@neuctra/authix 1.1.35 → 1.1.36
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/authix.css +1 -1
- package/dist/neuctra-authix.es.js +590 -525
- package/dist/neuctra-authix.umd.js +25 -25
- package/dist/sdk/index.d.ts +51 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import Le, { forwardRef as Nt, createElement as Xe, useState as O, useEffect as te, useRef as xt } from "react";
|
|
2
|
-
function
|
|
2
|
+
function Dt(t, e) {
|
|
3
3
|
return function() {
|
|
4
4
|
return t.apply(e, arguments);
|
|
5
5
|
};
|
|
6
6
|
}
|
|
7
|
-
const { toString: fr } = Object.prototype, { getPrototypeOf: st } = Object, { iterator: Fe, toStringTag:
|
|
7
|
+
const { toString: fr } = Object.prototype, { getPrototypeOf: st } = Object, { iterator: Fe, toStringTag: Ut } = Symbol, qe = /* @__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)), oe = (t) => (t = t.toLowerCase(), (e) =>
|
|
10
|
+
})(/* @__PURE__ */ Object.create(null)), oe = (t) => (t = t.toLowerCase(), (e) => qe(e) === t), Me = (t) => (e) => typeof e === t, { isArray: we } = Array, ye = Me("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
|
}
|
|
@@ -16,11 +16,11 @@ 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;
|
|
18
18
|
}
|
|
19
|
-
const hr =
|
|
20
|
-
if (
|
|
19
|
+
const hr = Me("string"), re = Me("function"), Ft = Me("number"), Te = (t) => t !== null && typeof t == "object", gr = (t) => t === !0 || t === !1, Ae = (t) => {
|
|
20
|
+
if (qe(t) !== "object")
|
|
21
21
|
return !1;
|
|
22
22
|
const e = st(t);
|
|
23
|
-
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(
|
|
23
|
+
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Ut in t) && !(Fe in t);
|
|
24
24
|
}, mr = (t) => {
|
|
25
25
|
if (!Te(t) || Ce(t))
|
|
26
26
|
return !1;
|
|
@@ -31,7 +31,7 @@ const hr = qe("string"), re = qe("function"), Ft = qe("number"), Te = (t) => t !
|
|
|
31
31
|
}
|
|
32
32
|
}, yr = oe("Date"), br = oe("File"), wr = oe("Blob"), jr = oe("FileList"), vr = (t) => Te(t) && re(t.pipe), Sr = (t) => {
|
|
33
33
|
let e;
|
|
34
|
-
return t && (typeof FormData == "function" && t instanceof FormData || re(t.append) && ((e =
|
|
34
|
+
return t && (typeof FormData == "function" && t instanceof FormData || re(t.append) && ((e = qe(t)) === "formdata" || // detect form-data instance
|
|
35
35
|
e === "object" && re(t.toString) && t.toString() === "[object FormData]"));
|
|
36
36
|
}, kr = oe("URLSearchParams"), [Er, Cr, Tr, Rr] = ["ReadableStream", "Request", "Response", "Headers"].map(oe), Ir = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
37
37
|
function Re(t, e, { allOwnKeys: r = !1 } = {}) {
|
|
@@ -50,7 +50,7 @@ function Re(t, e, { allOwnKeys: r = !1 } = {}) {
|
|
|
50
50
|
l = i[s], e.call(null, t[l], l, t);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function qt(t, e) {
|
|
54
54
|
if (Ce(t))
|
|
55
55
|
return null;
|
|
56
56
|
e = e.toLowerCase();
|
|
@@ -61,10 +61,10 @@ function Mt(t, e) {
|
|
|
61
61
|
return a;
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
|
-
const fe = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global,
|
|
64
|
+
const fe = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Mt = (t) => !ye(t) && t !== fe;
|
|
65
65
|
function Ze() {
|
|
66
|
-
const { caseless: t, skipUndefined: e } =
|
|
67
|
-
const o = t &&
|
|
66
|
+
const { caseless: t, skipUndefined: e } = Mt(this) && this || {}, r = {}, s = (a, i) => {
|
|
67
|
+
const o = t && qt(r, i) || i;
|
|
68
68
|
Ae(r[o]) && Ae(a) ? r[o] = Ze(r[o], a) : Ae(a) ? r[o] = Ze({}, a) : we(a) ? r[o] = a.slice() : (!e || !ye(a)) && (r[o] = a);
|
|
69
69
|
};
|
|
70
70
|
for (let a = 0, i = arguments.length; a < i; a++)
|
|
@@ -72,7 +72,7 @@ function Ze() {
|
|
|
72
72
|
return r;
|
|
73
73
|
}
|
|
74
74
|
const Pr = (t, e, r, { allOwnKeys: s } = {}) => (Re(e, (a, i) => {
|
|
75
|
-
r && re(a) ? t[i] =
|
|
75
|
+
r && re(a) ? t[i] = Dt(a, r) : t[i] = a;
|
|
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
|
|
@@ -87,11 +87,11 @@ const Pr = (t, e, r, { allOwnKeys: s } = {}) => (Re(e, (a, i) => {
|
|
|
87
87
|
t = r !== !1 && st(t);
|
|
88
88
|
} while (t && (!r || r(t, e)) && t !== Object.prototype);
|
|
89
89
|
return e;
|
|
90
|
-
},
|
|
90
|
+
}, $r = (t, e, r) => {
|
|
91
91
|
t = String(t), (r === void 0 || r > t.length) && (r = t.length), r -= e.length;
|
|
92
92
|
const s = t.indexOf(e, r);
|
|
93
93
|
return s !== -1 && s === r;
|
|
94
|
-
},
|
|
94
|
+
}, _r = (t) => {
|
|
95
95
|
if (!t) return null;
|
|
96
96
|
if (we(t)) return t;
|
|
97
97
|
let e = t.length;
|
|
@@ -100,14 +100,14 @@ const Pr = (t, e, r, { allOwnKeys: s } = {}) => (Re(e, (a, i) => {
|
|
|
100
100
|
for (; e-- > 0; )
|
|
101
101
|
r[e] = t[e];
|
|
102
102
|
return r;
|
|
103
|
-
}, Nr = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && st(Uint8Array)),
|
|
103
|
+
}, Nr = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && st(Uint8Array)), Dr = (t, e) => {
|
|
104
104
|
const s = (t && t[Fe]).call(t);
|
|
105
105
|
let a;
|
|
106
106
|
for (; (a = s.next()) && !a.done; ) {
|
|
107
107
|
const i = a.value;
|
|
108
108
|
e.call(t, i[0], i[1]);
|
|
109
109
|
}
|
|
110
|
-
},
|
|
110
|
+
}, Ur = (t, e) => {
|
|
111
111
|
let r;
|
|
112
112
|
const s = [];
|
|
113
113
|
for (; (r = t.exec(e)) !== null; )
|
|
@@ -118,13 +118,13 @@ const Pr = (t, e, r, { allOwnKeys: s } = {}) => (Re(e, (a, i) => {
|
|
|
118
118
|
function(r, s, a) {
|
|
119
119
|
return s.toUpperCase() + a;
|
|
120
120
|
}
|
|
121
|
-
), ht = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype),
|
|
121
|
+
), ht = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), qr = oe("RegExp"), Wt = (t, e) => {
|
|
122
122
|
const r = Object.getOwnPropertyDescriptors(t), s = {};
|
|
123
123
|
Re(r, (a, i) => {
|
|
124
124
|
let o;
|
|
125
125
|
(o = e(a, i, t)) !== !1 && (s[i] = o || a);
|
|
126
126
|
}), Object.defineProperties(t, s);
|
|
127
|
-
},
|
|
127
|
+
}, Mr = (t) => {
|
|
128
128
|
Wt(t, (e, r) => {
|
|
129
129
|
if (re(t) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
|
|
130
130
|
return !1;
|
|
@@ -149,7 +149,7 @@ const Pr = (t, e, r, { allOwnKeys: s } = {}) => (Re(e, (a, i) => {
|
|
|
149
149
|
}, Br = () => {
|
|
150
150
|
}, Hr = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
|
|
151
151
|
function Vr(t) {
|
|
152
|
-
return !!(t && re(t.append) && t[
|
|
152
|
+
return !!(t && re(t.append) && t[Ut] === "FormData" && t[Fe]);
|
|
153
153
|
}
|
|
154
154
|
const Yr = (t) => {
|
|
155
155
|
const e = new Array(10), r = (s, a) => {
|
|
@@ -197,7 +197,7 @@ const Yr = (t) => {
|
|
|
197
197
|
isDate: yr,
|
|
198
198
|
isFile: br,
|
|
199
199
|
isBlob: wr,
|
|
200
|
-
isRegExp:
|
|
200
|
+
isRegExp: qr,
|
|
201
201
|
isFunction: re,
|
|
202
202
|
isStream: vr,
|
|
203
203
|
isURLSearchParams: kr,
|
|
@@ -210,25 +210,25 @@ const Yr = (t) => {
|
|
|
210
210
|
stripBOM: Or,
|
|
211
211
|
inherits: zr,
|
|
212
212
|
toFlatObject: Ar,
|
|
213
|
-
kindOf:
|
|
213
|
+
kindOf: qe,
|
|
214
214
|
kindOfTest: oe,
|
|
215
|
-
endsWith:
|
|
216
|
-
toArray:
|
|
217
|
-
forEachEntry:
|
|
218
|
-
matchAll:
|
|
215
|
+
endsWith: $r,
|
|
216
|
+
toArray: _r,
|
|
217
|
+
forEachEntry: Dr,
|
|
218
|
+
matchAll: Ur,
|
|
219
219
|
isHTMLForm: Lr,
|
|
220
220
|
hasOwnProperty: ht,
|
|
221
221
|
hasOwnProp: ht,
|
|
222
222
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
223
223
|
reduceDescriptors: Wt,
|
|
224
|
-
freezeMethods:
|
|
224
|
+
freezeMethods: Mr,
|
|
225
225
|
toObjectSet: Wr,
|
|
226
226
|
toCamelCase: Fr,
|
|
227
227
|
noop: Br,
|
|
228
228
|
toFiniteNumber: Hr,
|
|
229
|
-
findKey:
|
|
229
|
+
findKey: qt,
|
|
230
230
|
global: fe,
|
|
231
|
-
isContextDefined:
|
|
231
|
+
isContextDefined: Mt,
|
|
232
232
|
isSpecCompliantForm: Vr,
|
|
233
233
|
toJSONObject: Yr,
|
|
234
234
|
isAsyncFn: Kr,
|
|
@@ -285,7 +285,7 @@ L.from = (t, e, r, s, a, i) => {
|
|
|
285
285
|
const o = Object.create(Ht);
|
|
286
286
|
p.toFlatObject(t, o, function(u) {
|
|
287
287
|
return u !== Error.prototype;
|
|
288
|
-
}, (
|
|
288
|
+
}, (d) => d !== "isAxiosError");
|
|
289
289
|
const l = t && t.message ? t.message : "Error", h = e == null && t ? t.code : e;
|
|
290
290
|
return L.call(o, l, h, r, s, a), t && o.cause == null && Object.defineProperty(o, "cause", { value: t, configurable: !0 }), o.name = t && t.name || "Error", i && Object.assign(o, i), o;
|
|
291
291
|
};
|
|
@@ -320,49 +320,49 @@ function We(t, e, r) {
|
|
|
320
320
|
const s = r.metaTokens, a = r.visitor || u, i = r.dots, o = r.indexes, h = (r.Blob || typeof Blob < "u" && Blob) && p.isSpecCompliantForm(e);
|
|
321
321
|
if (!p.isFunction(a))
|
|
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 d(c) {
|
|
324
|
+
if (c === null) return "";
|
|
325
|
+
if (p.isDate(c))
|
|
326
|
+
return c.toISOString();
|
|
327
|
+
if (p.isBoolean(c))
|
|
328
|
+
return c.toString();
|
|
329
|
+
if (!h && p.isBlob(c))
|
|
330
330
|
throw new L("Blob is not supported. Use a Buffer instead.");
|
|
331
|
-
return p.isArrayBuffer(
|
|
331
|
+
return p.isArrayBuffer(c) || p.isTypedArray(c) ? h && typeof Blob == "function" ? new Blob([c]) : Buffer.from(c) : c;
|
|
332
332
|
}
|
|
333
|
-
function u(
|
|
334
|
-
let
|
|
335
|
-
if (
|
|
333
|
+
function u(c, j, m) {
|
|
334
|
+
let $ = c;
|
|
335
|
+
if (c && !m && typeof c == "object") {
|
|
336
336
|
if (p.endsWith(j, "{}"))
|
|
337
|
-
j = s ? j : j.slice(0, -2),
|
|
338
|
-
else if (p.isArray(
|
|
339
|
-
return j = Yt(j),
|
|
337
|
+
j = s ? j : j.slice(0, -2), c = JSON.stringify(c);
|
|
338
|
+
else if (p.isArray(c) && Qr(c) || (p.isFileList(c) || p.endsWith(j, "[]")) && ($ = p.toArray(c)))
|
|
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
|
o === !0 ? gt([j], C, i) : o === null ? j : j + "[]",
|
|
343
|
-
|
|
343
|
+
d(A)
|
|
344
344
|
);
|
|
345
345
|
}), !1;
|
|
346
346
|
}
|
|
347
|
-
return Qe(
|
|
347
|
+
return Qe(c) ? !0 : (e.append(gt(m, j, i), d(c)), !1);
|
|
348
348
|
}
|
|
349
349
|
const b = [], y = Object.assign(en, {
|
|
350
350
|
defaultVisitor: u,
|
|
351
|
-
convertValue:
|
|
351
|
+
convertValue: d,
|
|
352
352
|
isVisitable: Qe
|
|
353
353
|
});
|
|
354
|
-
function w(
|
|
355
|
-
if (!p.isUndefined(
|
|
356
|
-
if (b.indexOf(
|
|
354
|
+
function w(c, j) {
|
|
355
|
+
if (!p.isUndefined(c)) {
|
|
356
|
+
if (b.indexOf(c) !== -1)
|
|
357
357
|
throw Error("Circular reference detected in " + j.join("."));
|
|
358
|
-
b.push(
|
|
359
|
-
(!(p.isUndefined(
|
|
358
|
+
b.push(c), p.forEach(c, function($, R) {
|
|
359
|
+
(!(p.isUndefined($) || $ === null) && a.call(
|
|
360
360
|
e,
|
|
361
|
-
|
|
361
|
+
$,
|
|
362
362
|
p.isString(R) ? R.trim() : R,
|
|
363
363
|
j,
|
|
364
364
|
y
|
|
365
|
-
)) === !0 && w(
|
|
365
|
+
)) === !0 && w($, j ? j.concat(R) : [R]);
|
|
366
366
|
}), b.pop();
|
|
367
367
|
}
|
|
368
368
|
}
|
|
@@ -484,15 +484,15 @@ const Gt = {
|
|
|
484
484
|
},
|
|
485
485
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
486
486
|
}, ot = typeof window < "u" && typeof document < "u", et = typeof navigator == "object" && navigator || void 0, on = ot && (!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",
|
|
487
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", dn = ot && window.location.href || "http://localhost", cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
488
488
|
__proto__: null,
|
|
489
489
|
hasBrowserEnv: ot,
|
|
490
490
|
hasStandardBrowserEnv: on,
|
|
491
491
|
hasStandardBrowserWebWorkerEnv: ln,
|
|
492
492
|
navigator: et,
|
|
493
|
-
origin:
|
|
493
|
+
origin: dn
|
|
494
494
|
}, Symbol.toStringTag, { value: "Module" })), ee = {
|
|
495
|
-
...
|
|
495
|
+
...cn,
|
|
496
496
|
...an
|
|
497
497
|
};
|
|
498
498
|
function un(t, e) {
|
|
@@ -638,8 +638,8 @@ const hn = p.toObjectSet([
|
|
|
638
638
|
function Se(t) {
|
|
639
639
|
return t && String(t).trim().toLowerCase();
|
|
640
640
|
}
|
|
641
|
-
function
|
|
642
|
-
return t === !1 || t == null ? t : p.isArray(t) ? t.map(
|
|
641
|
+
function $e(t) {
|
|
642
|
+
return t === !1 || t == null ? t : p.isArray(t) ? t.map($e) : String(t);
|
|
643
643
|
}
|
|
644
644
|
function mn(t) {
|
|
645
645
|
const e = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
@@ -679,24 +679,24 @@ let ne = class {
|
|
|
679
679
|
}
|
|
680
680
|
set(e, r, s) {
|
|
681
681
|
const a = this;
|
|
682
|
-
function i(l, h,
|
|
682
|
+
function i(l, h, d) {
|
|
683
683
|
const u = Se(h);
|
|
684
684
|
if (!u)
|
|
685
685
|
throw new Error("header name must be a non-empty string");
|
|
686
686
|
const b = p.findKey(a, u);
|
|
687
|
-
(!b || a[b] === void 0 ||
|
|
687
|
+
(!b || a[b] === void 0 || d === !0 || d === void 0 && a[b] !== !1) && (a[b || h] = $e(l));
|
|
688
688
|
}
|
|
689
|
-
const o = (l, h) => p.forEach(l, (
|
|
689
|
+
const o = (l, h) => p.forEach(l, (d, u) => i(d, u, h));
|
|
690
690
|
if (p.isPlainObject(e) || e instanceof this.constructor)
|
|
691
691
|
o(e, r);
|
|
692
692
|
else if (p.isString(e) && (e = e.trim()) && !yn(e))
|
|
693
693
|
o(gn(e), r);
|
|
694
694
|
else if (p.isObject(e) && p.isIterable(e)) {
|
|
695
|
-
let l = {}, h,
|
|
695
|
+
let l = {}, h, d;
|
|
696
696
|
for (const u of e) {
|
|
697
697
|
if (!p.isArray(u))
|
|
698
698
|
throw TypeError("Object iterator must return a key-value pair");
|
|
699
|
-
l[
|
|
699
|
+
l[d = u[0]] = (h = l[d]) ? p.isArray(h) ? [...h, u[1]] : [h, u[1]] : u[1];
|
|
700
700
|
}
|
|
701
701
|
o(l, r);
|
|
702
702
|
} else
|
|
@@ -752,11 +752,11 @@ let ne = class {
|
|
|
752
752
|
return p.forEach(this, (a, i) => {
|
|
753
753
|
const o = p.findKey(s, i);
|
|
754
754
|
if (o) {
|
|
755
|
-
r[o] =
|
|
755
|
+
r[o] = $e(a), 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] =
|
|
759
|
+
l !== i && delete r[i], r[l] = $e(a), s[l] = !0;
|
|
760
760
|
}), this;
|
|
761
761
|
}
|
|
762
762
|
concat(...e) {
|
|
@@ -845,42 +845,42 @@ function vn(t, e) {
|
|
|
845
845
|
const r = new Array(t), s = new Array(t);
|
|
846
846
|
let a = 0, i = 0, o;
|
|
847
847
|
return e = e !== void 0 ? e : 1e3, function(h) {
|
|
848
|
-
const
|
|
849
|
-
o || (o =
|
|
848
|
+
const d = Date.now(), u = s[i];
|
|
849
|
+
o || (o = d), r[a] = h, s[a] = d;
|
|
850
850
|
let b = i, y = 0;
|
|
851
851
|
for (; b !== a; )
|
|
852
852
|
y += r[b++], b = b % t;
|
|
853
|
-
if (a = (a + 1) % t, a === i && (i = (i + 1) % t),
|
|
853
|
+
if (a = (a + 1) % t, a === i && (i = (i + 1) % t), d - o < e)
|
|
854
854
|
return;
|
|
855
|
-
const w = u &&
|
|
855
|
+
const w = u && d - u;
|
|
856
856
|
return w ? Math.round(y * 1e3 / w) : void 0;
|
|
857
857
|
};
|
|
858
858
|
}
|
|
859
859
|
function Sn(t, e) {
|
|
860
860
|
let r = 0, s = 1e3 / e, a, i;
|
|
861
|
-
const o = (
|
|
862
|
-
r = u, a = null, i && (clearTimeout(i), i = null), t(...
|
|
861
|
+
const o = (d, u = Date.now()) => {
|
|
862
|
+
r = u, a = null, i && (clearTimeout(i), i = null), t(...d);
|
|
863
863
|
};
|
|
864
|
-
return [(...
|
|
864
|
+
return [(...d) => {
|
|
865
865
|
const u = Date.now(), b = u - r;
|
|
866
|
-
b >= s ? o(
|
|
866
|
+
b >= s ? o(d, u) : (a = d, i || (i = setTimeout(() => {
|
|
867
867
|
i = null, o(a);
|
|
868
868
|
}, s - b)));
|
|
869
869
|
}, () => a && o(a)];
|
|
870
870
|
}
|
|
871
|
-
const
|
|
871
|
+
const Ue = (t, e, r = 3) => {
|
|
872
872
|
let s = 0;
|
|
873
873
|
const a = vn(50, 250);
|
|
874
874
|
return Sn((i) => {
|
|
875
|
-
const o = i.loaded, l = i.lengthComputable ? i.total : void 0, h = o - s,
|
|
875
|
+
const o = i.loaded, l = i.lengthComputable ? i.total : void 0, h = o - s, d = a(h), u = o <= l;
|
|
876
876
|
s = o;
|
|
877
877
|
const b = {
|
|
878
878
|
loaded: o,
|
|
879
879
|
total: l,
|
|
880
880
|
progress: l ? o / l : void 0,
|
|
881
881
|
bytes: h,
|
|
882
|
-
rate:
|
|
883
|
-
estimated:
|
|
882
|
+
rate: d || void 0,
|
|
883
|
+
estimated: d && l && u ? (l - o) / d : void 0,
|
|
884
884
|
event: i,
|
|
885
885
|
lengthComputable: l != null,
|
|
886
886
|
[e ? "download" : "upload"]: !0
|
|
@@ -938,30 +938,30 @@ const vt = (t) => t instanceof ne ? { ...t } : t;
|
|
|
938
938
|
function he(t, e) {
|
|
939
939
|
e = e || {};
|
|
940
940
|
const r = {};
|
|
941
|
-
function s(
|
|
942
|
-
return p.isPlainObject(
|
|
941
|
+
function s(d, u, b, y) {
|
|
942
|
+
return p.isPlainObject(d) && p.isPlainObject(u) ? p.merge.call({ caseless: y }, d, u) : p.isPlainObject(u) ? p.merge({}, u) : p.isArray(u) ? u.slice() : u;
|
|
943
943
|
}
|
|
944
|
-
function a(
|
|
944
|
+
function a(d, u, b, y) {
|
|
945
945
|
if (p.isUndefined(u)) {
|
|
946
|
-
if (!p.isUndefined(
|
|
947
|
-
return s(void 0,
|
|
948
|
-
} else return s(
|
|
946
|
+
if (!p.isUndefined(d))
|
|
947
|
+
return s(void 0, d, b, y);
|
|
948
|
+
} else return s(d, u, b, y);
|
|
949
949
|
}
|
|
950
|
-
function i(
|
|
950
|
+
function i(d, u) {
|
|
951
951
|
if (!p.isUndefined(u))
|
|
952
952
|
return s(void 0, u);
|
|
953
953
|
}
|
|
954
|
-
function o(
|
|
954
|
+
function o(d, u) {
|
|
955
955
|
if (p.isUndefined(u)) {
|
|
956
|
-
if (!p.isUndefined(
|
|
957
|
-
return s(void 0,
|
|
956
|
+
if (!p.isUndefined(d))
|
|
957
|
+
return s(void 0, d);
|
|
958
958
|
} else return s(void 0, u);
|
|
959
959
|
}
|
|
960
|
-
function l(
|
|
960
|
+
function l(d, u, b) {
|
|
961
961
|
if (b in e)
|
|
962
|
-
return s(
|
|
962
|
+
return s(d, u);
|
|
963
963
|
if (b in t)
|
|
964
|
-
return s(void 0,
|
|
964
|
+
return s(void 0, d);
|
|
965
965
|
}
|
|
966
966
|
const h = {
|
|
967
967
|
url: i,
|
|
@@ -992,7 +992,7 @@ function he(t, e) {
|
|
|
992
992
|
socketPath: o,
|
|
993
993
|
responseEncoding: o,
|
|
994
994
|
validateStatus: l,
|
|
995
|
-
headers: (
|
|
995
|
+
headers: (d, u, b) => a(vt(d), vt(u), b, !0)
|
|
996
996
|
};
|
|
997
997
|
return p.forEach(Object.keys({ ...t, ...e }), function(u) {
|
|
998
998
|
const b = h[u] || a, y = b(t[u], e[u], u);
|
|
@@ -1009,9 +1009,9 @@ const tr = (t) => {
|
|
|
1009
1009
|
if (ee.hasStandardBrowserEnv || ee.hasStandardBrowserWebWorkerEnv)
|
|
1010
1010
|
o.setContentType(void 0);
|
|
1011
1011
|
else if (p.isFunction(r.getHeaders)) {
|
|
1012
|
-
const h = r.getHeaders(),
|
|
1012
|
+
const h = r.getHeaders(), d = ["content-type", "content-length"];
|
|
1013
1013
|
Object.entries(h).forEach(([u, b]) => {
|
|
1014
|
-
|
|
1014
|
+
d.includes(u.toLowerCase()) && o.set(u, b);
|
|
1015
1015
|
});
|
|
1016
1016
|
}
|
|
1017
1017
|
}
|
|
@@ -1025,18 +1025,18 @@ const tr = (t) => {
|
|
|
1025
1025
|
const a = tr(t);
|
|
1026
1026
|
let i = a.data;
|
|
1027
1027
|
const o = ne.from(a.headers).normalize();
|
|
1028
|
-
let { responseType: l, onUploadProgress: h, onDownloadProgress:
|
|
1028
|
+
let { responseType: l, onUploadProgress: h, onDownloadProgress: d } = a, u, b, y, w, c;
|
|
1029
1029
|
function j() {
|
|
1030
|
-
w && w(),
|
|
1030
|
+
w && w(), c && c(), a.cancelToken && a.cancelToken.unsubscribe(u), a.signal && a.signal.removeEventListener("abort", u);
|
|
1031
1031
|
}
|
|
1032
1032
|
let m = new XMLHttpRequest();
|
|
1033
1033
|
m.open(a.method.toUpperCase(), a.url, !0), m.timeout = a.timeout;
|
|
1034
|
-
function
|
|
1034
|
+
function $() {
|
|
1035
1035
|
if (!m)
|
|
1036
1036
|
return;
|
|
1037
1037
|
const A = ne.from(
|
|
1038
1038
|
"getAllResponseHeaders" in m && m.getAllResponseHeaders()
|
|
1039
|
-
),
|
|
1039
|
+
), q = {
|
|
1040
1040
|
data: !l || l === "text" || l === "json" ? m.responseText : m.response,
|
|
1041
1041
|
status: m.status,
|
|
1042
1042
|
statusText: m.statusText,
|
|
@@ -1048,27 +1048,27 @@ const tr = (t) => {
|
|
|
1048
1048
|
r(I), j();
|
|
1049
1049
|
}, function(I) {
|
|
1050
1050
|
s(I), j();
|
|
1051
|
-
},
|
|
1051
|
+
}, q), m = null;
|
|
1052
1052
|
}
|
|
1053
|
-
"onloadend" in m ? m.onloadend =
|
|
1054
|
-
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(
|
|
1053
|
+
"onloadend" in m ? m.onloadend = $ : m.onreadystatechange = function() {
|
|
1054
|
+
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout($);
|
|
1055
1055
|
}, m.onabort = function() {
|
|
1056
1056
|
m && (s(new L("Request aborted", L.ECONNABORTED, t, m)), m = null);
|
|
1057
1057
|
}, m.onerror = function(C) {
|
|
1058
|
-
const
|
|
1058
|
+
const q = C && C.message ? C.message : "Network Error", g = new L(q, L.ERR_NETWORK, t, m);
|
|
1059
1059
|
g.event = C || null, s(g), m = null;
|
|
1060
1060
|
}, m.ontimeout = function() {
|
|
1061
1061
|
let C = a.timeout ? "timeout of " + a.timeout + "ms exceeded" : "timeout exceeded";
|
|
1062
|
-
const
|
|
1062
|
+
const q = a.transitional || Gt;
|
|
1063
1063
|
a.timeoutErrorMessage && (C = a.timeoutErrorMessage), s(new L(
|
|
1064
1064
|
C,
|
|
1065
|
-
|
|
1065
|
+
q.clarifyTimeoutError ? L.ETIMEDOUT : L.ECONNABORTED,
|
|
1066
1066
|
t,
|
|
1067
1067
|
m
|
|
1068
1068
|
)), m = null;
|
|
1069
|
-
}, i === void 0 && o.setContentType(null), "setRequestHeader" in m && p.forEach(o.toJSON(), function(C,
|
|
1070
|
-
m.setRequestHeader(
|
|
1071
|
-
}), p.isUndefined(a.withCredentials) || (m.withCredentials = !!a.withCredentials), l && l !== "json" && (m.responseType = a.responseType),
|
|
1069
|
+
}, i === void 0 && o.setContentType(null), "setRequestHeader" in m && p.forEach(o.toJSON(), function(C, q) {
|
|
1070
|
+
m.setRequestHeader(q, C);
|
|
1071
|
+
}), p.isUndefined(a.withCredentials) || (m.withCredentials = !!a.withCredentials), l && l !== "json" && (m.responseType = a.responseType), d && ([y, c] = Ue(d, !0), m.addEventListener("progress", y)), h && m.upload && ([b, w] = Ue(h), m.upload.addEventListener("progress", b), m.upload.addEventListener("loadend", w)), (a.cancelToken || a.signal) && (u = (A) => {
|
|
1072
1072
|
m && (s(!A || A.type ? new je(null, t, m) : A), m.abort(), m = null);
|
|
1073
1073
|
}, a.cancelToken && a.cancelToken.subscribe(u), a.signal && (a.signal.aborted ? u() : a.signal.addEventListener("abort", u)));
|
|
1074
1074
|
const R = jn(a.url);
|
|
@@ -1082,10 +1082,10 @@ const tr = (t) => {
|
|
|
1082
1082
|
const { length: r } = t = t ? t.filter(Boolean) : [];
|
|
1083
1083
|
if (e || r) {
|
|
1084
1084
|
let s = new AbortController(), a;
|
|
1085
|
-
const i = function(
|
|
1085
|
+
const i = function(d) {
|
|
1086
1086
|
if (!a) {
|
|
1087
1087
|
a = !0, l();
|
|
1088
|
-
const u =
|
|
1088
|
+
const u = d instanceof Error ? d : this.reason;
|
|
1089
1089
|
s.abort(u instanceof L ? u : new je(u instanceof Error ? u.message : u));
|
|
1090
1090
|
}
|
|
1091
1091
|
};
|
|
@@ -1093,11 +1093,11 @@ const tr = (t) => {
|
|
|
1093
1093
|
o = null, i(new L(`timeout ${e} of ms exceeded`, L.ETIMEDOUT));
|
|
1094
1094
|
}, e);
|
|
1095
1095
|
const l = () => {
|
|
1096
|
-
t && (o && clearTimeout(o), o = null, t.forEach((
|
|
1097
|
-
|
|
1096
|
+
t && (o && clearTimeout(o), o = null, t.forEach((d) => {
|
|
1097
|
+
d.unsubscribe ? d.unsubscribe(i) : d.removeEventListener("abort", i);
|
|
1098
1098
|
}), t = null);
|
|
1099
1099
|
};
|
|
1100
|
-
t.forEach((
|
|
1100
|
+
t.forEach((d) => d.addEventListener("abort", i));
|
|
1101
1101
|
const { signal: h } = s;
|
|
1102
1102
|
return h.unsubscribe = () => p.asap(l), h;
|
|
1103
1103
|
}
|
|
@@ -1137,8 +1137,8 @@ const tr = (t) => {
|
|
|
1137
1137
|
return new ReadableStream({
|
|
1138
1138
|
async pull(h) {
|
|
1139
1139
|
try {
|
|
1140
|
-
const { done:
|
|
1141
|
-
if (
|
|
1140
|
+
const { done: d, value: u } = await a.next();
|
|
1141
|
+
if (d) {
|
|
1142
1142
|
l(), h.close();
|
|
1143
1143
|
return;
|
|
1144
1144
|
}
|
|
@@ -1148,8 +1148,8 @@ const tr = (t) => {
|
|
|
1148
1148
|
r(y);
|
|
1149
1149
|
}
|
|
1150
1150
|
h.enqueue(new Uint8Array(u));
|
|
1151
|
-
} catch (
|
|
1152
|
-
throw l(
|
|
1151
|
+
} catch (d) {
|
|
1152
|
+
throw l(d), d;
|
|
1153
1153
|
}
|
|
1154
1154
|
},
|
|
1155
1155
|
cancel(h) {
|
|
@@ -1158,7 +1158,7 @@ const tr = (t) => {
|
|
|
1158
1158
|
}, {
|
|
1159
1159
|
highWaterMark: 2
|
|
1160
1160
|
});
|
|
1161
|
-
}, kt = 64 * 1024, { isFunction: Oe } = p,
|
|
1161
|
+
}, kt = 64 * 1024, { isFunction: Oe } = p, $n = (({ Request: t, Response: e }) => ({
|
|
1162
1162
|
Request: t,
|
|
1163
1163
|
Response: e
|
|
1164
1164
|
}))(p.global), {
|
|
@@ -1170,67 +1170,67 @@ const tr = (t) => {
|
|
|
1170
1170
|
} catch {
|
|
1171
1171
|
return !1;
|
|
1172
1172
|
}
|
|
1173
|
-
},
|
|
1173
|
+
}, _n = (t) => {
|
|
1174
1174
|
t = p.merge.call({
|
|
1175
1175
|
skipUndefined: !0
|
|
1176
|
-
},
|
|
1176
|
+
}, $n, t);
|
|
1177
1177
|
const { fetch: e, Request: r, Response: s } = t, a = e ? Oe(e) : typeof fetch == "function", i = Oe(r), o = Oe(s);
|
|
1178
1178
|
if (!a)
|
|
1179
1179
|
return !1;
|
|
1180
|
-
const l = a && Oe(Et), h = a && (typeof Ct == "function" ? /* @__PURE__ */ ((
|
|
1181
|
-
let
|
|
1180
|
+
const l = a && Oe(Et), h = a && (typeof Ct == "function" ? /* @__PURE__ */ ((c) => (j) => c.encode(j))(new Ct()) : async (c) => new Uint8Array(await new r(c).arrayBuffer())), d = i && l && Tt(() => {
|
|
1181
|
+
let c = !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 c = !0, "half";
|
|
1187
1187
|
}
|
|
1188
1188
|
}).headers.has("Content-Type");
|
|
1189
|
-
return
|
|
1189
|
+
return c && !j;
|
|
1190
1190
|
}), u = o && l && Tt(() => p.isReadableStream(new s("").body)), b = {
|
|
1191
|
-
stream: u && ((
|
|
1191
|
+
stream: u && ((c) => c.body)
|
|
1192
1192
|
};
|
|
1193
|
-
a && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((
|
|
1194
|
-
!b[
|
|
1195
|
-
let
|
|
1196
|
-
if (
|
|
1197
|
-
return
|
|
1198
|
-
throw new L(`Response type '${
|
|
1193
|
+
a && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((c) => {
|
|
1194
|
+
!b[c] && (b[c] = (j, m) => {
|
|
1195
|
+
let $ = j && j[c];
|
|
1196
|
+
if ($)
|
|
1197
|
+
return $.call(j);
|
|
1198
|
+
throw new L(`Response type '${c}' is not supported`, L.ERR_NOT_SUPPORT, m);
|
|
1199
1199
|
});
|
|
1200
1200
|
});
|
|
1201
|
-
const y = async (
|
|
1202
|
-
if (
|
|
1201
|
+
const y = async (c) => {
|
|
1202
|
+
if (c == null)
|
|
1203
1203
|
return 0;
|
|
1204
|
-
if (p.isBlob(
|
|
1205
|
-
return
|
|
1206
|
-
if (p.isSpecCompliantForm(
|
|
1204
|
+
if (p.isBlob(c))
|
|
1205
|
+
return c.size;
|
|
1206
|
+
if (p.isSpecCompliantForm(c))
|
|
1207
1207
|
return (await new r(ee.origin, {
|
|
1208
1208
|
method: "POST",
|
|
1209
|
-
body:
|
|
1209
|
+
body: c
|
|
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(c) || p.isArrayBuffer(c))
|
|
1212
|
+
return c.byteLength;
|
|
1213
|
+
if (p.isURLSearchParams(c) && (c = c + ""), p.isString(c))
|
|
1214
|
+
return (await h(c)).byteLength;
|
|
1215
|
+
}, w = async (c, j) => {
|
|
1216
|
+
const m = p.toFiniteNumber(c.getContentLength());
|
|
1217
1217
|
return m ?? y(j);
|
|
1218
1218
|
};
|
|
1219
|
-
return async (
|
|
1219
|
+
return async (c) => {
|
|
1220
1220
|
let {
|
|
1221
1221
|
url: j,
|
|
1222
1222
|
method: m,
|
|
1223
|
-
data:
|
|
1223
|
+
data: $,
|
|
1224
1224
|
signal: R,
|
|
1225
1225
|
cancelToken: A,
|
|
1226
1226
|
timeout: C,
|
|
1227
|
-
onDownloadProgress:
|
|
1227
|
+
onDownloadProgress: q,
|
|
1228
1228
|
onUploadProgress: g,
|
|
1229
1229
|
responseType: I,
|
|
1230
1230
|
headers: v,
|
|
1231
|
-
withCredentials:
|
|
1231
|
+
withCredentials: D = "same-origin",
|
|
1232
1232
|
fetchOptions: W
|
|
1233
|
-
} = tr(
|
|
1233
|
+
} = tr(c), 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 && (() => {
|
|
@@ -1238,41 +1238,41 @@ const tr = (t) => {
|
|
|
1238
1238
|
});
|
|
1239
1239
|
let J;
|
|
1240
1240
|
try {
|
|
1241
|
-
if (g &&
|
|
1241
|
+
if (g && d && m !== "get" && m !== "head" && (J = await w(v, $)) !== 0) {
|
|
1242
1242
|
let f = new r(j, {
|
|
1243
1243
|
method: "POST",
|
|
1244
|
-
body:
|
|
1244
|
+
body: $,
|
|
1245
1245
|
duplex: "half"
|
|
1246
1246
|
}), S;
|
|
1247
|
-
if (p.isFormData(
|
|
1247
|
+
if (p.isFormData($) && (S = f.headers.get("content-type")) && v.setContentType(S), f.body) {
|
|
1248
1248
|
const [x, k] = wt(
|
|
1249
1249
|
J,
|
|
1250
|
-
|
|
1250
|
+
Ue(jt(g))
|
|
1251
1251
|
);
|
|
1252
|
-
|
|
1252
|
+
$ = St(f.body, kt, x, k);
|
|
1253
1253
|
}
|
|
1254
1254
|
}
|
|
1255
|
-
p.isString(
|
|
1255
|
+
p.isString(D) || (D = D ? "include" : "omit");
|
|
1256
1256
|
const z = i && "credentials" in r.prototype, P = {
|
|
1257
1257
|
...W,
|
|
1258
1258
|
signal: V,
|
|
1259
1259
|
method: m.toUpperCase(),
|
|
1260
1260
|
headers: v.normalize().toJSON(),
|
|
1261
|
-
body:
|
|
1261
|
+
body: $,
|
|
1262
1262
|
duplex: "half",
|
|
1263
|
-
credentials: z ?
|
|
1263
|
+
credentials: z ? D : void 0
|
|
1264
1264
|
};
|
|
1265
1265
|
Z = i && new r(j, P);
|
|
1266
1266
|
let K = await (i ? F(Z, W) : F(j, P));
|
|
1267
1267
|
const Q = u && (I === "stream" || I === "response");
|
|
1268
|
-
if (u && (
|
|
1268
|
+
if (u && (q || Q && T)) {
|
|
1269
1269
|
const f = {};
|
|
1270
|
-
["status", "statusText", "headers"].forEach((
|
|
1271
|
-
f[
|
|
1270
|
+
["status", "statusText", "headers"].forEach((_) => {
|
|
1271
|
+
f[_] = K[_];
|
|
1272
1272
|
});
|
|
1273
|
-
const S = p.toFiniteNumber(K.headers.get("content-length")), [x, k] =
|
|
1273
|
+
const S = p.toFiniteNumber(K.headers.get("content-length")), [x, k] = q && wt(
|
|
1274
1274
|
S,
|
|
1275
|
-
|
|
1275
|
+
Ue(jt(q), !0)
|
|
1276
1276
|
) || [];
|
|
1277
1277
|
K = new s(
|
|
1278
1278
|
St(K.body, kt, x, () => {
|
|
@@ -1282,24 +1282,24 @@ const tr = (t) => {
|
|
|
1282
1282
|
);
|
|
1283
1283
|
}
|
|
1284
1284
|
I = I || "text";
|
|
1285
|
-
let G = await b[p.findKey(b, I) || "text"](K,
|
|
1285
|
+
let G = await b[p.findKey(b, I) || "text"](K, c);
|
|
1286
1286
|
return !Q && T && T(), await new Promise((f, S) => {
|
|
1287
1287
|
Qt(f, S, {
|
|
1288
1288
|
data: G,
|
|
1289
1289
|
headers: ne.from(K.headers),
|
|
1290
1290
|
status: K.status,
|
|
1291
1291
|
statusText: K.statusText,
|
|
1292
|
-
config:
|
|
1292
|
+
config: c,
|
|
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, c, 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, c, Z);
|
|
1303
1303
|
}
|
|
1304
1304
|
};
|
|
1305
1305
|
}, Nn = /* @__PURE__ */ new Map(), rr = (t) => {
|
|
@@ -1309,10 +1309,10 @@ const tr = (t) => {
|
|
|
1309
1309
|
a,
|
|
1310
1310
|
r
|
|
1311
1311
|
];
|
|
1312
|
-
let o = i.length, l = o, h,
|
|
1312
|
+
let o = i.length, l = o, h, d, u = Nn;
|
|
1313
1313
|
for (; l--; )
|
|
1314
|
-
h = i[l],
|
|
1315
|
-
return
|
|
1314
|
+
h = i[l], d = u.get(h), d === void 0 && u.set(h, d = l ? /* @__PURE__ */ new Map() : _n(e)), u = d;
|
|
1315
|
+
return d;
|
|
1316
1316
|
};
|
|
1317
1317
|
rr();
|
|
1318
1318
|
const tt = {
|
|
@@ -1331,7 +1331,7 @@ p.forEach(tt, (t, e) => {
|
|
|
1331
1331
|
Object.defineProperty(t, "adapterName", { value: e });
|
|
1332
1332
|
}
|
|
1333
1333
|
});
|
|
1334
|
-
const Rt = (t) => `- ${t}`,
|
|
1334
|
+
const Rt = (t) => `- ${t}`, Dn = (t) => p.isFunction(t) || t === null || t === !1, nr = {
|
|
1335
1335
|
getAdapter: (t, e) => {
|
|
1336
1336
|
t = p.isArray(t) ? t : [t];
|
|
1337
1337
|
const { length: r } = t;
|
|
@@ -1340,7 +1340,7 @@ const Rt = (t) => `- ${t}`, Un = (t) => p.isFunction(t) || t === null || t === !
|
|
|
1340
1340
|
for (let o = 0; o < r; o++) {
|
|
1341
1341
|
s = t[o];
|
|
1342
1342
|
let l;
|
|
1343
|
-
if (a = s, !
|
|
1343
|
+
if (a = s, !Dn(s) && (a = tt[(l = String(s)).toLowerCase()], a === void 0))
|
|
1344
1344
|
throw new L(`Unknown adapter '${l}'`);
|
|
1345
1345
|
if (a && (p.isFunction(a) || (a = a.get(e))))
|
|
1346
1346
|
break;
|
|
@@ -1348,7 +1348,7 @@ const Rt = (t) => `- ${t}`, Un = (t) => p.isFunction(t) || t === null || t === !
|
|
|
1348
1348
|
}
|
|
1349
1349
|
if (!a) {
|
|
1350
1350
|
const o = Object.entries(i).map(
|
|
1351
|
-
([h,
|
|
1351
|
+
([h, d]) => `adapter ${h} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1352
1352
|
);
|
|
1353
1353
|
let l = r ? o.length > 1 ? `since :
|
|
1354
1354
|
` + o.map(Rt).join(`
|
|
@@ -1412,7 +1412,7 @@ Be.transitional = function(e, r, s) {
|
|
|
1412
1412
|
Be.spelling = function(e) {
|
|
1413
1413
|
return (r, s) => (console.warn(`${s} is likely a misspelling of ${e}`), !0);
|
|
1414
1414
|
};
|
|
1415
|
-
function
|
|
1415
|
+
function Un(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);
|
|
@@ -1429,10 +1429,10 @@ function Dn(t, e, r) {
|
|
|
1429
1429
|
throw new L("Unknown option " + i, L.ERR_BAD_OPTION);
|
|
1430
1430
|
}
|
|
1431
1431
|
}
|
|
1432
|
-
const
|
|
1433
|
-
assertOptions:
|
|
1432
|
+
const _e = {
|
|
1433
|
+
assertOptions: Un,
|
|
1434
1434
|
validators: Be
|
|
1435
|
-
}, ie =
|
|
1435
|
+
}, ie = _e.validators;
|
|
1436
1436
|
let xe = class {
|
|
1437
1437
|
constructor(e) {
|
|
1438
1438
|
this.defaults = e || {}, this.interceptors = {
|
|
@@ -1468,16 +1468,16 @@ let xe = class {
|
|
|
1468
1468
|
_request(e, r) {
|
|
1469
1469
|
typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r = he(this.defaults, r);
|
|
1470
1470
|
const { transitional: s, paramsSerializer: a, headers: i } = r;
|
|
1471
|
-
s !== void 0 &&
|
|
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
1475
|
}, !1), a != null && (p.isFunction(a) ? r.paramsSerializer = {
|
|
1476
1476
|
serialize: a
|
|
1477
|
-
} :
|
|
1477
|
+
} : _e.assertOptions(a, {
|
|
1478
1478
|
encode: ie.function,
|
|
1479
1479
|
serialize: ie.function
|
|
1480
|
-
}, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0),
|
|
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();
|
|
@@ -1487,8 +1487,8 @@ let xe = class {
|
|
|
1487
1487
|
);
|
|
1488
1488
|
i && p.forEach(
|
|
1489
1489
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1490
|
-
(
|
|
1491
|
-
delete i[
|
|
1490
|
+
(c) => {
|
|
1491
|
+
delete i[c];
|
|
1492
1492
|
}
|
|
1493
1493
|
), r.headers = ne.concat(o, i);
|
|
1494
1494
|
const l = [];
|
|
@@ -1496,23 +1496,23 @@ let xe = class {
|
|
|
1496
1496
|
this.interceptors.request.forEach(function(j) {
|
|
1497
1497
|
typeof j.runWhen == "function" && j.runWhen(r) === !1 || (h = h && j.synchronous, l.unshift(j.fulfilled, j.rejected));
|
|
1498
1498
|
});
|
|
1499
|
-
const
|
|
1499
|
+
const d = [];
|
|
1500
1500
|
this.interceptors.response.forEach(function(j) {
|
|
1501
|
-
|
|
1501
|
+
d.push(j.fulfilled, j.rejected);
|
|
1502
1502
|
});
|
|
1503
1503
|
let u, b = 0, y;
|
|
1504
1504
|
if (!h) {
|
|
1505
|
-
const
|
|
1506
|
-
for (
|
|
1507
|
-
u = u.then(
|
|
1505
|
+
const c = [It.bind(this), void 0];
|
|
1506
|
+
for (c.unshift(...l), c.push(...d), y = c.length, u = Promise.resolve(r); b < y; )
|
|
1507
|
+
u = u.then(c[b++], c[b++]);
|
|
1508
1508
|
return u;
|
|
1509
1509
|
}
|
|
1510
1510
|
y = l.length;
|
|
1511
1511
|
let w = r;
|
|
1512
1512
|
for (; b < y; ) {
|
|
1513
|
-
const
|
|
1513
|
+
const c = l[b++], j = l[b++];
|
|
1514
1514
|
try {
|
|
1515
|
-
w =
|
|
1515
|
+
w = c(w);
|
|
1516
1516
|
} catch (m) {
|
|
1517
1517
|
j.call(this, m);
|
|
1518
1518
|
break;
|
|
@@ -1520,11 +1520,11 @@ let xe = class {
|
|
|
1520
1520
|
}
|
|
1521
1521
|
try {
|
|
1522
1522
|
u = It.call(this, w);
|
|
1523
|
-
} catch (
|
|
1524
|
-
return Promise.reject(
|
|
1523
|
+
} catch (c) {
|
|
1524
|
+
return Promise.reject(c);
|
|
1525
1525
|
}
|
|
1526
|
-
for (b = 0, y =
|
|
1527
|
-
u = u.then(
|
|
1526
|
+
for (b = 0, y = d.length; b < y; )
|
|
1527
|
+
u = u.then(d[b++], d[b++]);
|
|
1528
1528
|
return u;
|
|
1529
1529
|
}
|
|
1530
1530
|
getUri(e) {
|
|
@@ -1635,7 +1635,7 @@ function Fn(t) {
|
|
|
1635
1635
|
return t.apply(null, r);
|
|
1636
1636
|
};
|
|
1637
1637
|
}
|
|
1638
|
-
function
|
|
1638
|
+
function qn(t) {
|
|
1639
1639
|
return p.isObject(t) && t.isAxiosError === !0;
|
|
1640
1640
|
}
|
|
1641
1641
|
const rt = {
|
|
@@ -1707,31 +1707,31 @@ Object.entries(rt).forEach(([t, e]) => {
|
|
|
1707
1707
|
rt[e] = t;
|
|
1708
1708
|
});
|
|
1709
1709
|
function or(t) {
|
|
1710
|
-
const e = new xe(t), r =
|
|
1710
|
+
const e = new xe(t), r = Dt(xe.prototype.request, e);
|
|
1711
1711
|
return p.extend(r, xe.prototype, e, { allOwnKeys: !0 }), p.extend(r, e, null, { allOwnKeys: !0 }), r.create = function(a) {
|
|
1712
1712
|
return or(he(t, a));
|
|
1713
1713
|
}, r;
|
|
1714
1714
|
}
|
|
1715
|
-
const
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1715
|
+
const M = or(Ie);
|
|
1716
|
+
M.Axios = xe;
|
|
1717
|
+
M.CanceledError = je;
|
|
1718
|
+
M.CancelToken = Ln;
|
|
1719
|
+
M.isCancel = Zt;
|
|
1720
|
+
M.VERSION = sr;
|
|
1721
|
+
M.toFormData = We;
|
|
1722
|
+
M.AxiosError = L;
|
|
1723
|
+
M.Cancel = M.CanceledError;
|
|
1724
|
+
M.all = function(e) {
|
|
1725
1725
|
return Promise.all(e);
|
|
1726
1726
|
};
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1727
|
+
M.spread = Fn;
|
|
1728
|
+
M.isAxiosError = qn;
|
|
1729
|
+
M.mergeConfig = he;
|
|
1730
|
+
M.AxiosHeaders = ne;
|
|
1731
|
+
M.formToJSON = (t) => Xt(p.isHTMLForm(t) ? new FormData(t) : t);
|
|
1732
|
+
M.getAdapter = nr.getAdapter;
|
|
1733
|
+
M.HttpStatusCode = rt;
|
|
1734
|
+
M.default = M;
|
|
1735
1735
|
const {
|
|
1736
1736
|
Axios: Ks,
|
|
1737
1737
|
AxiosError: Js,
|
|
@@ -1748,9 +1748,9 @@ const {
|
|
|
1748
1748
|
HttpStatusCode: oa,
|
|
1749
1749
|
formToJSON: ia,
|
|
1750
1750
|
getAdapter: la,
|
|
1751
|
-
mergeConfig:
|
|
1752
|
-
} =
|
|
1753
|
-
class
|
|
1751
|
+
mergeConfig: da
|
|
1752
|
+
} = M;
|
|
1753
|
+
class ca {
|
|
1754
1754
|
baseUrl;
|
|
1755
1755
|
apiKey;
|
|
1756
1756
|
appId;
|
|
@@ -1762,7 +1762,7 @@ class da {
|
|
|
1762
1762
|
constructor(e) {
|
|
1763
1763
|
if (!e || !e.baseUrl)
|
|
1764
1764
|
throw new Error("NeuctraAuthixClient: 'baseUrl' is required in config");
|
|
1765
|
-
this.baseUrl = e.baseUrl.replace(/\/$/, ""), this.apiKey = e.apiKey || null, this.appId = e.appId || null, this.client =
|
|
1765
|
+
this.baseUrl = e.baseUrl.replace(/\/$/, ""), this.apiKey = e.apiKey || null, this.appId = e.appId || null, this.client = M.create({
|
|
1766
1766
|
baseURL: this.baseUrl,
|
|
1767
1767
|
headers: {
|
|
1768
1768
|
"Content-Type": "application/json",
|
|
@@ -2075,6 +2075,71 @@ class da {
|
|
|
2075
2075
|
throw new Error("deleteUserData: 'userId' and 'dataId' are required");
|
|
2076
2076
|
return this.request("DELETE", `/users/${r}/data/${s}`);
|
|
2077
2077
|
}
|
|
2078
|
+
// ================= APP DATA =================
|
|
2079
|
+
/**
|
|
2080
|
+
* Get all app data items for the current app
|
|
2081
|
+
* @param category optional filter by dataCategory
|
|
2082
|
+
*/
|
|
2083
|
+
async getAppData(e) {
|
|
2084
|
+
const r = this.appId;
|
|
2085
|
+
if (!r) throw new Error("getAppData: 'appId' is required");
|
|
2086
|
+
const s = e ? `?category=${encodeURIComponent(e)}` : "";
|
|
2087
|
+
return this.request("GET", `/app/${r}/data${s}`);
|
|
2088
|
+
}
|
|
2089
|
+
/**
|
|
2090
|
+
* Get a single data item from app.appData[] by id
|
|
2091
|
+
*/
|
|
2092
|
+
async getSingleAppData(e) {
|
|
2093
|
+
const r = this.appId;
|
|
2094
|
+
if (!r) throw new Error("getSingleAppData: 'appId' is required");
|
|
2095
|
+
if (!e.dataId)
|
|
2096
|
+
throw new Error("getSingleAppData: 'dataId' is required");
|
|
2097
|
+
return this.request(
|
|
2098
|
+
"GET",
|
|
2099
|
+
`/app/${r}/data/${e.dataId}`
|
|
2100
|
+
);
|
|
2101
|
+
}
|
|
2102
|
+
/**
|
|
2103
|
+
* Add a new item to app.appData[] under a specific category
|
|
2104
|
+
*/
|
|
2105
|
+
async addAppData(e) {
|
|
2106
|
+
const r = this.appId;
|
|
2107
|
+
if (!r) throw new Error("addAppData: 'appId' is required");
|
|
2108
|
+
if (!e.dataCategory)
|
|
2109
|
+
throw new Error("addAppData: 'dataCategory' is required");
|
|
2110
|
+
if (!e.data) throw new Error("addAppData: 'data' is required");
|
|
2111
|
+
return this.request(
|
|
2112
|
+
"POST",
|
|
2113
|
+
`/app/${r}/data/${encodeURIComponent(e.dataCategory)}`,
|
|
2114
|
+
e.data
|
|
2115
|
+
);
|
|
2116
|
+
}
|
|
2117
|
+
/**
|
|
2118
|
+
* Update an item in app.appData[] by id
|
|
2119
|
+
*/
|
|
2120
|
+
async updateAppData(e) {
|
|
2121
|
+
const r = this.appId;
|
|
2122
|
+
if (!r) throw new Error("updateAppData: 'appId' is required");
|
|
2123
|
+
if (!e.dataId) throw new Error("updateAppData: 'dataId' is required");
|
|
2124
|
+
if (!e.data) throw new Error("updateAppData: 'data' is required");
|
|
2125
|
+
return this.request(
|
|
2126
|
+
"PATCH",
|
|
2127
|
+
`/app/${r}/data/${e.dataId}`,
|
|
2128
|
+
e.data
|
|
2129
|
+
);
|
|
2130
|
+
}
|
|
2131
|
+
/**
|
|
2132
|
+
* Delete an item from app.appData[] by id
|
|
2133
|
+
*/
|
|
2134
|
+
async deleteAppData(e) {
|
|
2135
|
+
const r = this.appId;
|
|
2136
|
+
if (!r) throw new Error("deleteAppData: 'appId' is required");
|
|
2137
|
+
if (!e.dataId) throw new Error("deleteAppData: 'dataId' is required");
|
|
2138
|
+
return this.request(
|
|
2139
|
+
"DELETE",
|
|
2140
|
+
`/app/${r}/data/${e.dataId}`
|
|
2141
|
+
);
|
|
2142
|
+
}
|
|
2078
2143
|
}
|
|
2079
2144
|
var ze = { exports: {} }, ke = {};
|
|
2080
2145
|
/**
|
|
@@ -2087,7 +2152,7 @@ var ze = { exports: {} }, ke = {};
|
|
|
2087
2152
|
* LICENSE file in the root directory of this source tree.
|
|
2088
2153
|
*/
|
|
2089
2154
|
var Ot;
|
|
2090
|
-
function
|
|
2155
|
+
function Mn() {
|
|
2091
2156
|
if (Ot) return ke;
|
|
2092
2157
|
Ot = 1;
|
|
2093
2158
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
@@ -2131,7 +2196,7 @@ function Wn() {
|
|
|
2131
2196
|
return "Fragment";
|
|
2132
2197
|
case R:
|
|
2133
2198
|
return "Profiler";
|
|
2134
|
-
case
|
|
2199
|
+
case $:
|
|
2135
2200
|
return "StrictMode";
|
|
2136
2201
|
case g:
|
|
2137
2202
|
return "Suspense";
|
|
@@ -2150,12 +2215,12 @@ function Wn() {
|
|
|
2150
2215
|
return f.displayName || "Context";
|
|
2151
2216
|
case A:
|
|
2152
2217
|
return (f._context.displayName || "Context") + ".Consumer";
|
|
2153
|
-
case
|
|
2218
|
+
case q:
|
|
2154
2219
|
var S = f.render;
|
|
2155
2220
|
return f = f.displayName, f || (f = S.displayName || S.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
|
|
2156
2221
|
case v:
|
|
2157
2222
|
return S = f.displayName || null, S !== null ? S : t(f.type) || "Memo";
|
|
2158
|
-
case
|
|
2223
|
+
case D:
|
|
2159
2224
|
S = f._payload, f = f._init;
|
|
2160
2225
|
try {
|
|
2161
2226
|
return t(f(S));
|
|
@@ -2186,7 +2251,7 @@ function Wn() {
|
|
|
2186
2251
|
}
|
|
2187
2252
|
function s(f) {
|
|
2188
2253
|
if (f === m) return "<>";
|
|
2189
|
-
if (typeof f == "object" && f !== null && f.$$typeof ===
|
|
2254
|
+
if (typeof f == "object" && f !== null && f.$$typeof === D)
|
|
2190
2255
|
return "<...>";
|
|
2191
2256
|
try {
|
|
2192
2257
|
var S = t(f);
|
|
@@ -2227,10 +2292,10 @@ function Wn() {
|
|
|
2227
2292
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
2228
2293
|
)), f = this.props.ref, f !== void 0 ? f : null;
|
|
2229
2294
|
}
|
|
2230
|
-
function
|
|
2295
|
+
function d(f, S, x, k, _, N) {
|
|
2231
2296
|
var Y = x.ref;
|
|
2232
2297
|
return f = {
|
|
2233
|
-
$$typeof:
|
|
2298
|
+
$$typeof: c,
|
|
2234
2299
|
type: f,
|
|
2235
2300
|
key: S,
|
|
2236
2301
|
props: x,
|
|
@@ -2252,7 +2317,7 @@ function Wn() {
|
|
|
2252
2317
|
configurable: !1,
|
|
2253
2318
|
enumerable: !1,
|
|
2254
2319
|
writable: !0,
|
|
2255
|
-
value:
|
|
2320
|
+
value: _
|
|
2256
2321
|
}), Object.defineProperty(f, "_debugTask", {
|
|
2257
2322
|
configurable: !1,
|
|
2258
2323
|
enumerable: !1,
|
|
@@ -2260,7 +2325,7 @@ function Wn() {
|
|
|
2260
2325
|
value: N
|
|
2261
2326
|
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
2262
2327
|
}
|
|
2263
|
-
function u(f, S, x, k,
|
|
2328
|
+
function u(f, S, x, k, _, N) {
|
|
2264
2329
|
var Y = S.children;
|
|
2265
2330
|
if (Y !== void 0)
|
|
2266
2331
|
if (k)
|
|
@@ -2299,22 +2364,22 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2299
2364
|
return Y && l(
|
|
2300
2365
|
x,
|
|
2301
2366
|
typeof f == "function" ? f.displayName || f.name || "Unknown" : f
|
|
2302
|
-
),
|
|
2367
|
+
), d(
|
|
2303
2368
|
f,
|
|
2304
2369
|
Y,
|
|
2305
2370
|
x,
|
|
2306
2371
|
a(),
|
|
2307
|
-
|
|
2372
|
+
_,
|
|
2308
2373
|
N
|
|
2309
2374
|
);
|
|
2310
2375
|
}
|
|
2311
2376
|
function b(f) {
|
|
2312
|
-
y(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof ===
|
|
2377
|
+
y(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === D && (f._payload.status === "fulfilled" ? y(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
|
|
2313
2378
|
}
|
|
2314
2379
|
function y(f) {
|
|
2315
|
-
return typeof f == "object" && f !== null && f.$$typeof ===
|
|
2380
|
+
return typeof f == "object" && f !== null && f.$$typeof === c;
|
|
2316
2381
|
}
|
|
2317
|
-
var w = Le,
|
|
2382
|
+
var w = Le, c = 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"), q = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), I = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), W = 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() {
|
|
2318
2383
|
return null;
|
|
2319
2384
|
};
|
|
2320
2385
|
w = {
|
|
@@ -2351,17 +2416,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2351
2416
|
}
|
|
2352
2417
|
var At;
|
|
2353
2418
|
function Bn() {
|
|
2354
|
-
return At || (At = 1, process.env.NODE_ENV === "production" ? ze.exports =
|
|
2419
|
+
return At || (At = 1, process.env.NODE_ENV === "production" ? ze.exports = Mn() : ze.exports = Wn()), ze.exports;
|
|
2355
2420
|
}
|
|
2356
2421
|
var n = Bn();
|
|
2357
2422
|
const Hn = async (t, e) => {
|
|
2358
|
-
const { name: r, email: s, password: a, appId: i, phone: o, address: l, avatarUrl: h, isActive:
|
|
2423
|
+
const { name: r, email: s, password: a, appId: i, phone: o, address: l, avatarUrl: h, isActive: d = !0, role: u = "user" } = t, { baseUrl: b, apiKey: y } = e;
|
|
2359
2424
|
if (!y)
|
|
2360
2425
|
throw new Error("API key is required for signup");
|
|
2361
2426
|
if (!r || !s || !a || !i)
|
|
2362
2427
|
throw new Error("Name, email, password, and appId are required");
|
|
2363
2428
|
try {
|
|
2364
|
-
const w = await
|
|
2429
|
+
const w = await M.post(
|
|
2365
2430
|
`${b}/users/signup`,
|
|
2366
2431
|
{
|
|
2367
2432
|
name: r,
|
|
@@ -2371,7 +2436,7 @@ const Hn = async (t, e) => {
|
|
|
2371
2436
|
phone: o,
|
|
2372
2437
|
address: l,
|
|
2373
2438
|
avatarUrl: h,
|
|
2374
|
-
isActive:
|
|
2439
|
+
isActive: d,
|
|
2375
2440
|
role: u
|
|
2376
2441
|
},
|
|
2377
2442
|
{
|
|
@@ -2383,15 +2448,15 @@ const Hn = async (t, e) => {
|
|
|
2383
2448
|
);
|
|
2384
2449
|
return w.data?.user && localStorage.setItem("userInfo", JSON.stringify(w.data.user)), w.data.user;
|
|
2385
2450
|
} catch (w) {
|
|
2386
|
-
const
|
|
2387
|
-
if (console.error("Signup API Error:",
|
|
2388
|
-
if (
|
|
2451
|
+
const c = w.response?.data?.message || w.message || "Signup failed";
|
|
2452
|
+
if (console.error("Signup API Error:", c), w.response?.status === 400) {
|
|
2453
|
+
if (c.includes("already exists"))
|
|
2389
2454
|
throw {
|
|
2390
2455
|
success: !1,
|
|
2391
2456
|
message: "User with this email already exists for this app",
|
|
2392
2457
|
status: 400
|
|
2393
2458
|
};
|
|
2394
|
-
if (
|
|
2459
|
+
if (c.includes("inactive"))
|
|
2395
2460
|
throw {
|
|
2396
2461
|
success: !1,
|
|
2397
2462
|
message: "Cannot signup under an inactive app",
|
|
@@ -2404,7 +2469,7 @@ const Hn = async (t, e) => {
|
|
|
2404
2469
|
status: 404
|
|
2405
2470
|
} : {
|
|
2406
2471
|
success: !1,
|
|
2407
|
-
message:
|
|
2472
|
+
message: c,
|
|
2408
2473
|
status: w.response?.status || 500
|
|
2409
2474
|
};
|
|
2410
2475
|
}
|
|
@@ -2418,7 +2483,7 @@ const Hn = async (t, e) => {
|
|
|
2418
2483
|
const Vn = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Yn = (t) => t.replace(
|
|
2419
2484
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
2420
2485
|
(e, r, s) => s ? s.toUpperCase() : r.toLowerCase()
|
|
2421
|
-
),
|
|
2486
|
+
), $t = (t) => {
|
|
2422
2487
|
const e = Yn(t);
|
|
2423
2488
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
2424
2489
|
}, ir = (...t) => t.filter((e, r, s) => !!e && e.trim() !== "" && s.indexOf(e) === r).join(" ").trim(), Kn = (t) => {
|
|
@@ -2473,7 +2538,7 @@ const Gn = Nt(
|
|
|
2473
2538
|
...l
|
|
2474
2539
|
},
|
|
2475
2540
|
[
|
|
2476
|
-
...o.map(([
|
|
2541
|
+
...o.map(([d, u]) => Xe(d, u)),
|
|
2477
2542
|
...Array.isArray(i) ? i : [i]
|
|
2478
2543
|
]
|
|
2479
2544
|
)
|
|
@@ -2490,14 +2555,14 @@ const B = (t, e) => {
|
|
|
2490
2555
|
ref: i,
|
|
2491
2556
|
iconNode: e,
|
|
2492
2557
|
className: ir(
|
|
2493
|
-
`lucide-${Vn(
|
|
2558
|
+
`lucide-${Vn($t(t))}`,
|
|
2494
2559
|
`lucide-${t}`,
|
|
2495
2560
|
s
|
|
2496
2561
|
),
|
|
2497
2562
|
...a
|
|
2498
2563
|
})
|
|
2499
2564
|
);
|
|
2500
|
-
return r.displayName =
|
|
2565
|
+
return r.displayName = $t(t), r;
|
|
2501
2566
|
};
|
|
2502
2567
|
/**
|
|
2503
2568
|
* @license lucide-react v0.544.0 - ISC
|
|
@@ -2542,7 +2607,7 @@ const es = [
|
|
|
2542
2607
|
const ts = [
|
|
2543
2608
|
["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
|
|
2544
2609
|
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
2545
|
-
],
|
|
2610
|
+
], de = B("circle-check-big", ts);
|
|
2546
2611
|
/**
|
|
2547
2612
|
* @license lucide-react v0.544.0 - ISC
|
|
2548
2613
|
*
|
|
@@ -2621,7 +2686,7 @@ const ls = [
|
|
|
2621
2686
|
* This source code is licensed under the ISC license.
|
|
2622
2687
|
* See the LICENSE file in the root directory of this source tree.
|
|
2623
2688
|
*/
|
|
2624
|
-
const
|
|
2689
|
+
const ds = [
|
|
2625
2690
|
["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
|
|
2626
2691
|
[
|
|
2627
2692
|
"path",
|
|
@@ -2630,7 +2695,7 @@ const cs = [
|
|
|
2630
2695
|
key: "r6nss1"
|
|
2631
2696
|
}
|
|
2632
2697
|
]
|
|
2633
|
-
],
|
|
2698
|
+
], cs = B("house", ds);
|
|
2634
2699
|
/**
|
|
2635
2700
|
* @license lucide-react v0.544.0 - ISC
|
|
2636
2701
|
*
|
|
@@ -2657,7 +2722,7 @@ const ps = [
|
|
|
2657
2722
|
}
|
|
2658
2723
|
],
|
|
2659
2724
|
["circle", { cx: "16.5", cy: "7.5", r: ".5", fill: "currentColor", key: "w0ekpg" }]
|
|
2660
|
-
],
|
|
2725
|
+
], dr = B("key-round", ps);
|
|
2661
2726
|
/**
|
|
2662
2727
|
* @license lucide-react v0.544.0 - ISC
|
|
2663
2728
|
*
|
|
@@ -2668,7 +2733,7 @@ const fs = [
|
|
|
2668
2733
|
["path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4", key: "g0fldk" }],
|
|
2669
2734
|
["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
|
|
2670
2735
|
["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
|
|
2671
|
-
],
|
|
2736
|
+
], dt = B("key", fs);
|
|
2672
2737
|
/**
|
|
2673
2738
|
* @license lucide-react v0.544.0 - ISC
|
|
2674
2739
|
*
|
|
@@ -2723,7 +2788,7 @@ const ws = [
|
|
|
2723
2788
|
["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
|
|
2724
2789
|
["path", { d: "M21 12H9", key: "dn1m92" }],
|
|
2725
2790
|
["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
|
|
2726
|
-
],
|
|
2791
|
+
], ct = B("log-out", ws);
|
|
2727
2792
|
/**
|
|
2728
2793
|
* @license lucide-react v0.544.0 - ISC
|
|
2729
2794
|
*
|
|
@@ -2733,7 +2798,7 @@ const ws = [
|
|
|
2733
2798
|
const js = [
|
|
2734
2799
|
["path", { d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7", key: "132q7q" }],
|
|
2735
2800
|
["rect", { x: "2", y: "4", width: "20", height: "16", rx: "2", key: "izxlao" }]
|
|
2736
|
-
],
|
|
2801
|
+
], ce = B("mail", js);
|
|
2737
2802
|
/**
|
|
2738
2803
|
* @license lucide-react v0.544.0 - ISC
|
|
2739
2804
|
*
|
|
@@ -2844,27 +2909,27 @@ const As = [
|
|
|
2844
2909
|
key: "oel41y"
|
|
2845
2910
|
}
|
|
2846
2911
|
]
|
|
2847
|
-
],
|
|
2912
|
+
], cr = B("shield", As);
|
|
2848
2913
|
/**
|
|
2849
2914
|
* @license lucide-react v0.544.0 - ISC
|
|
2850
2915
|
*
|
|
2851
2916
|
* This source code is licensed under the ISC license.
|
|
2852
2917
|
* See the LICENSE file in the root directory of this source tree.
|
|
2853
2918
|
*/
|
|
2854
|
-
const
|
|
2919
|
+
const $s = [
|
|
2855
2920
|
["path", { d: "M10 11v6", key: "nco0om" }],
|
|
2856
2921
|
["path", { d: "M14 11v6", key: "outv1u" }],
|
|
2857
2922
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
2858
2923
|
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
2859
2924
|
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
2860
|
-
], Ne = B("trash-2",
|
|
2925
|
+
], Ne = B("trash-2", $s);
|
|
2861
2926
|
/**
|
|
2862
2927
|
* @license lucide-react v0.544.0 - ISC
|
|
2863
2928
|
*
|
|
2864
2929
|
* This source code is licensed under the ISC license.
|
|
2865
2930
|
* See the LICENSE file in the root directory of this source tree.
|
|
2866
2931
|
*/
|
|
2867
|
-
const
|
|
2932
|
+
const _s = [
|
|
2868
2933
|
[
|
|
2869
2934
|
"path",
|
|
2870
2935
|
{
|
|
@@ -2874,7 +2939,7 @@ const $s = [
|
|
|
2874
2939
|
],
|
|
2875
2940
|
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
2876
2941
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
2877
|
-
],
|
|
2942
|
+
], _t = B("triangle-alert", _s);
|
|
2878
2943
|
/**
|
|
2879
2944
|
* @license lucide-react v0.544.0 - ISC
|
|
2880
2945
|
*
|
|
@@ -2886,17 +2951,17 @@ const Ns = [
|
|
|
2886
2951
|
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
2887
2952
|
["line", { x1: "17", x2: "22", y1: "8", y2: "13", key: "3nzzx3" }],
|
|
2888
2953
|
["line", { x1: "22", x2: "17", y1: "8", y2: "13", key: "1swrse" }]
|
|
2889
|
-
],
|
|
2954
|
+
], Ds = B("user-x", Ns);
|
|
2890
2955
|
/**
|
|
2891
2956
|
* @license lucide-react v0.544.0 - ISC
|
|
2892
2957
|
*
|
|
2893
2958
|
* This source code is licensed under the ISC license.
|
|
2894
2959
|
* See the LICENSE file in the root directory of this source tree.
|
|
2895
2960
|
*/
|
|
2896
|
-
const
|
|
2961
|
+
const Us = [
|
|
2897
2962
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
2898
2963
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
2899
|
-
], be = B("user",
|
|
2964
|
+
], be = B("user", Us);
|
|
2900
2965
|
/**
|
|
2901
2966
|
* @license lucide-react v0.544.0 - ISC
|
|
2902
2967
|
*
|
|
@@ -2906,15 +2971,15 @@ const Ds = [
|
|
|
2906
2971
|
const Ls = [
|
|
2907
2972
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
2908
2973
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
2909
|
-
], Pe = B("x", Ls),
|
|
2974
|
+
], Pe = B("x", Ls), De = {
|
|
2910
2975
|
baseUrl: "",
|
|
2911
2976
|
apiKey: "",
|
|
2912
2977
|
appId: ""
|
|
2913
2978
|
}, ua = (t) => {
|
|
2914
2979
|
if (!t.baseUrl || !t.apiKey || !t.appId)
|
|
2915
2980
|
throw new Error("baseUrl, apiKey, and appId are required");
|
|
2916
|
-
|
|
2917
|
-
}, ge = () =>
|
|
2981
|
+
De.baseUrl = t.baseUrl, De.apiKey = t.apiKey, De.appId = t.appId;
|
|
2982
|
+
}, ge = () => De, pa = ({
|
|
2918
2983
|
logoUrl: t,
|
|
2919
2984
|
logoLinkUrl: e,
|
|
2920
2985
|
title: r = "Create Your Account",
|
|
@@ -2925,7 +2990,7 @@ const Ls = [
|
|
|
2925
2990
|
darkMode: l = !0,
|
|
2926
2991
|
// Only avatar is optional
|
|
2927
2992
|
showAvatar: h = !1,
|
|
2928
|
-
roles:
|
|
2993
|
+
roles: d = [],
|
|
2929
2994
|
// 🔥 FIXED
|
|
2930
2995
|
showRoleSelector: u = !1,
|
|
2931
2996
|
// 🔥 FIXED
|
|
@@ -2933,13 +2998,13 @@ const Ls = [
|
|
|
2933
2998
|
onSuccess: y,
|
|
2934
2999
|
onError: w
|
|
2935
3000
|
}) => {
|
|
2936
|
-
const { baseUrl:
|
|
3001
|
+
const { baseUrl: c, apiKey: j, appId: m } = ge(), $ = {
|
|
2937
3002
|
name: "",
|
|
2938
3003
|
email: "",
|
|
2939
3004
|
password: "",
|
|
2940
|
-
role:
|
|
3005
|
+
role: d.length ? d[0] : "user",
|
|
2941
3006
|
...h && { avatarUrl: "" }
|
|
2942
|
-
}, [R, A] = O(
|
|
3007
|
+
}, [R, A] = O($), [C, q] = O(!1), [g, I] = O(!1), [v, D] = O(null), [W, F] = O({}), [V, Z] = O(!1), T = l ? "#ffffff" : "#111827", J = l ? "#a1a1aa" : "#6b7280", z = l ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", P = l ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)";
|
|
2943
3008
|
Le.useEffect(() => {
|
|
2944
3009
|
if (typeof window < "u") {
|
|
2945
3010
|
const S = () => Z(window.innerWidth < 768);
|
|
@@ -2948,22 +3013,22 @@ const Ls = [
|
|
|
2948
3013
|
}, []);
|
|
2949
3014
|
const K = (S) => {
|
|
2950
3015
|
const { name: x, value: k } = S.target;
|
|
2951
|
-
A((
|
|
3016
|
+
A((_) => ({ ..._, [x]: k })), W[x] && F((_) => ({ ..._, [x]: void 0 }));
|
|
2952
3017
|
}, Q = () => {
|
|
2953
3018
|
const S = {};
|
|
2954
3019
|
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;
|
|
2955
3020
|
}, G = async (S) => {
|
|
2956
3021
|
if (S.preventDefault(), !!Q()) {
|
|
2957
|
-
I(!0),
|
|
3022
|
+
I(!0), D(null);
|
|
2958
3023
|
try {
|
|
2959
3024
|
const x = {
|
|
2960
3025
|
...R,
|
|
2961
3026
|
appId: m
|
|
2962
|
-
}, k = await Hn(x, { baseUrl:
|
|
2963
|
-
|
|
3027
|
+
}, k = await Hn(x, { baseUrl: c, apiKey: j });
|
|
3028
|
+
D({ type: "success", text: "Account created successfully!" }), y && y(k);
|
|
2964
3029
|
} catch (x) {
|
|
2965
3030
|
const k = x.message || "Signup failed. Please try again.";
|
|
2966
|
-
|
|
3031
|
+
D({ type: "error", text: k }), w && w(x);
|
|
2967
3032
|
} finally {
|
|
2968
3033
|
I(!1);
|
|
2969
3034
|
}
|
|
@@ -3096,7 +3161,7 @@ const Ls = [
|
|
|
3096
3161
|
onSubmit: G,
|
|
3097
3162
|
style: { display: "flex", flexDirection: "column", gap: "14px" },
|
|
3098
3163
|
children: [
|
|
3099
|
-
u &&
|
|
3164
|
+
u && d && d.length === 2 && /* @__PURE__ */ n.jsxs(
|
|
3100
3165
|
"div",
|
|
3101
3166
|
{
|
|
3102
3167
|
style: { display: "flex", flexDirection: "column", gap: "4px" },
|
|
@@ -3141,7 +3206,7 @@ const Ls = [
|
|
|
3141
3206
|
// subtle shadow
|
|
3142
3207
|
borderRadius: "10px",
|
|
3143
3208
|
transition: "transform 0.3s ease, background-color 0.3s ease",
|
|
3144
|
-
transform: R.role ===
|
|
3209
|
+
transform: R.role === d[1] ? "translateX(100%)" : "translateX(0)",
|
|
3145
3210
|
zIndex: 0
|
|
3146
3211
|
}
|
|
3147
3212
|
}
|
|
@@ -3150,43 +3215,43 @@ const Ls = [
|
|
|
3150
3215
|
"button",
|
|
3151
3216
|
{
|
|
3152
3217
|
type: "button",
|
|
3153
|
-
onClick: () => A((S) => ({ ...S, role:
|
|
3218
|
+
onClick: () => A((S) => ({ ...S, role: d[0] })),
|
|
3154
3219
|
style: {
|
|
3155
3220
|
flex: 1,
|
|
3156
3221
|
zIndex: 10,
|
|
3157
3222
|
border: "none",
|
|
3158
3223
|
background: "transparent",
|
|
3159
|
-
color: R.role ===
|
|
3224
|
+
color: R.role === d[0] ? i : l ? "#9ca3af" : "#6b7280",
|
|
3160
3225
|
// theme-aware inactive color
|
|
3161
|
-
fontWeight: R.role ===
|
|
3226
|
+
fontWeight: R.role === d[0] ? 600 : 500,
|
|
3162
3227
|
fontSize: "14px",
|
|
3163
3228
|
display: "flex",
|
|
3164
3229
|
alignItems: "center",
|
|
3165
3230
|
justifyContent: "center",
|
|
3166
3231
|
transition: "color 0.2s ease"
|
|
3167
3232
|
},
|
|
3168
|
-
children:
|
|
3233
|
+
children: d[0].charAt(0).toUpperCase() + d[0].slice(1)
|
|
3169
3234
|
}
|
|
3170
3235
|
),
|
|
3171
3236
|
/* @__PURE__ */ n.jsx(
|
|
3172
3237
|
"button",
|
|
3173
3238
|
{
|
|
3174
3239
|
type: "button",
|
|
3175
|
-
onClick: () => A((S) => ({ ...S, role:
|
|
3240
|
+
onClick: () => A((S) => ({ ...S, role: d[1] })),
|
|
3176
3241
|
style: {
|
|
3177
3242
|
flex: 1,
|
|
3178
3243
|
zIndex: 10,
|
|
3179
3244
|
border: "none",
|
|
3180
3245
|
background: "transparent",
|
|
3181
|
-
color: R.role ===
|
|
3182
|
-
fontWeight: R.role ===
|
|
3246
|
+
color: R.role === d[1] ? i : l ? "#9ca3af" : "#6b7280",
|
|
3247
|
+
fontWeight: R.role === d[1] ? 600 : 500,
|
|
3183
3248
|
fontSize: "14px",
|
|
3184
3249
|
display: "flex",
|
|
3185
3250
|
alignItems: "center",
|
|
3186
3251
|
justifyContent: "center",
|
|
3187
3252
|
transition: "color 0.2s ease"
|
|
3188
3253
|
},
|
|
3189
|
-
children:
|
|
3254
|
+
children: d[1].charAt(0).toUpperCase() + d[1].slice(1)
|
|
3190
3255
|
}
|
|
3191
3256
|
)
|
|
3192
3257
|
]
|
|
@@ -3265,7 +3330,7 @@ const Ls = [
|
|
|
3265
3330
|
),
|
|
3266
3331
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
3267
3332
|
/* @__PURE__ */ n.jsx(
|
|
3268
|
-
|
|
3333
|
+
ce,
|
|
3269
3334
|
{
|
|
3270
3335
|
size: 20,
|
|
3271
3336
|
style: {
|
|
@@ -3351,7 +3416,7 @@ const Ls = [
|
|
|
3351
3416
|
"button",
|
|
3352
3417
|
{
|
|
3353
3418
|
type: "button",
|
|
3354
|
-
onClick: () =>
|
|
3419
|
+
onClick: () => q(!C),
|
|
3355
3420
|
style: {
|
|
3356
3421
|
position: "absolute",
|
|
3357
3422
|
right: "14px",
|
|
@@ -3463,7 +3528,7 @@ const Ls = [
|
|
|
3463
3528
|
color: v.type === "success" ? i : "#ef4444"
|
|
3464
3529
|
},
|
|
3465
3530
|
children: [
|
|
3466
|
-
v.type === "success" ? /* @__PURE__ */ n.jsx(
|
|
3531
|
+
v.type === "success" ? /* @__PURE__ */ n.jsx(de, { size: 20 }) : /* @__PURE__ */ n.jsx(le, { size: 20 }),
|
|
3467
3532
|
/* @__PURE__ */ n.jsx("span", { children: v.text })
|
|
3468
3533
|
]
|
|
3469
3534
|
}
|
|
@@ -3537,7 +3602,7 @@ const Ls = [
|
|
|
3537
3602
|
if (!o)
|
|
3538
3603
|
throw new Error("API key is required for login");
|
|
3539
3604
|
try {
|
|
3540
|
-
const l = await
|
|
3605
|
+
const l = await M.post(
|
|
3541
3606
|
`${i}/users/login`,
|
|
3542
3607
|
{ email: r, password: s, appId: a },
|
|
3543
3608
|
{
|
|
@@ -3566,10 +3631,10 @@ const Ls = [
|
|
|
3566
3631
|
gradient: o = "linear-gradient(135deg, #22c55e, #00C214)",
|
|
3567
3632
|
darkMode: l = !0,
|
|
3568
3633
|
signupUrl: h,
|
|
3569
|
-
onSuccess:
|
|
3634
|
+
onSuccess: d,
|
|
3570
3635
|
onError: u
|
|
3571
3636
|
}) => {
|
|
3572
|
-
const { baseUrl: b, apiKey: y, appId: w } = ge(), [
|
|
3637
|
+
const { baseUrl: b, apiKey: y, appId: w } = ge(), [c, j] = O("login"), [m, $] = O(1), [R, A] = O(!1), [C, q] = O(!1), [g, I] = O(null), [v, D] = O(""), [W, F] = O(""), [V, Z] = O({
|
|
3573
3638
|
email: "",
|
|
3574
3639
|
otp: "",
|
|
3575
3640
|
newPassword: "",
|
|
@@ -3577,30 +3642,30 @@ const Ls = [
|
|
|
3577
3642
|
}), [T, J] = O(!1), z = l ? "#ffffff" : "#111827", P = l ? "#a1a1aa" : "#6b7280", K = l ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", Q = l ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)";
|
|
3578
3643
|
Le.useEffect(() => {
|
|
3579
3644
|
if (typeof window < "u") {
|
|
3580
|
-
const
|
|
3581
|
-
return
|
|
3645
|
+
const _ = () => J(window.innerWidth < 768);
|
|
3646
|
+
return _(), window.addEventListener("resize", _), () => window.removeEventListener("resize", _);
|
|
3582
3647
|
}
|
|
3583
3648
|
}, []);
|
|
3584
|
-
const G = async (
|
|
3585
|
-
|
|
3649
|
+
const G = async (_) => {
|
|
3650
|
+
_.preventDefault(), q(!0), I(null);
|
|
3586
3651
|
try {
|
|
3587
3652
|
const N = await Fs(
|
|
3588
3653
|
{ email: v, password: W, appId: w },
|
|
3589
3654
|
{ baseUrl: b, apiKey: y }
|
|
3590
3655
|
);
|
|
3591
|
-
I({ type: "success", text: `Welcome ${N.name}` }),
|
|
3656
|
+
I({ type: "success", text: `Welcome ${N.name}` }), d?.(N);
|
|
3592
3657
|
} catch (N) {
|
|
3593
3658
|
const Y = N.message || "Login failed";
|
|
3594
3659
|
I({ type: "error", text: Y }), u?.(N);
|
|
3595
3660
|
} finally {
|
|
3596
|
-
|
|
3661
|
+
q(!1);
|
|
3597
3662
|
}
|
|
3598
|
-
}, f = (
|
|
3599
|
-
Z({ ...V, [
|
|
3600
|
-
}, S = async (
|
|
3601
|
-
|
|
3663
|
+
}, f = (_) => {
|
|
3664
|
+
Z({ ...V, [_.target.name]: _.target.value });
|
|
3665
|
+
}, S = async (_) => {
|
|
3666
|
+
_.preventDefault(), q(!0), I(null);
|
|
3602
3667
|
try {
|
|
3603
|
-
const N = await
|
|
3668
|
+
const N = await M.post(
|
|
3604
3669
|
`${b}/users/forgot-password`,
|
|
3605
3670
|
{
|
|
3606
3671
|
email: V.email,
|
|
@@ -3608,7 +3673,7 @@ const Ls = [
|
|
|
3608
3673
|
},
|
|
3609
3674
|
{ headers: { "x-api-key": y } }
|
|
3610
3675
|
);
|
|
3611
|
-
N.data.success ? (
|
|
3676
|
+
N.data.success ? ($(2), I({ type: "success", text: "OTP sent to your email" })) : I({
|
|
3612
3677
|
type: "error",
|
|
3613
3678
|
text: N.data.message || "Failed to send OTP"
|
|
3614
3679
|
});
|
|
@@ -3618,24 +3683,24 @@ const Ls = [
|
|
|
3618
3683
|
text: N.response?.data?.message || "Something went wrong"
|
|
3619
3684
|
});
|
|
3620
3685
|
} finally {
|
|
3621
|
-
|
|
3686
|
+
q(!1);
|
|
3622
3687
|
}
|
|
3623
|
-
}, x = async (
|
|
3624
|
-
|
|
3688
|
+
}, x = async (_) => {
|
|
3689
|
+
_.preventDefault(), q(!0), I(null);
|
|
3625
3690
|
try {
|
|
3626
|
-
const N = await
|
|
3691
|
+
const N = await M.post(
|
|
3627
3692
|
`${b}/users/reset-password`,
|
|
3628
3693
|
V,
|
|
3629
3694
|
{ headers: { "x-api-key": y } }
|
|
3630
3695
|
);
|
|
3631
|
-
N.data.success ? (I({ type: "success", text: "Password reset successfully!" }),
|
|
3696
|
+
N.data.success ? (I({ type: "success", text: "Password reset successfully!" }), $(1), Z({ email: "", otp: "", newPassword: "", appId: w }), j("login")) : I({ type: "error", text: N.data.message || "Reset failed" });
|
|
3632
3697
|
} catch (N) {
|
|
3633
3698
|
I({
|
|
3634
3699
|
type: "error",
|
|
3635
3700
|
text: N.response?.data?.message || "Something went wrong"
|
|
3636
3701
|
});
|
|
3637
3702
|
} finally {
|
|
3638
|
-
|
|
3703
|
+
q(!1);
|
|
3639
3704
|
}
|
|
3640
3705
|
}, k = {
|
|
3641
3706
|
width: "100%",
|
|
@@ -3713,7 +3778,7 @@ const Ls = [
|
|
|
3713
3778
|
color: z,
|
|
3714
3779
|
margin: 0
|
|
3715
3780
|
},
|
|
3716
|
-
children:
|
|
3781
|
+
children: c === "login" ? r : m === 1 ? "Forgot Password" : "Reset Password"
|
|
3717
3782
|
}
|
|
3718
3783
|
),
|
|
3719
3784
|
/* @__PURE__ */ n.jsx(
|
|
@@ -3723,13 +3788,13 @@ const Ls = [
|
|
|
3723
3788
|
fontSize: "14px",
|
|
3724
3789
|
color: P
|
|
3725
3790
|
},
|
|
3726
|
-
children:
|
|
3791
|
+
children: c === "login" ? s : "Follow the steps to reset your password"
|
|
3727
3792
|
}
|
|
3728
3793
|
)
|
|
3729
3794
|
]
|
|
3730
3795
|
}
|
|
3731
3796
|
),
|
|
3732
|
-
|
|
3797
|
+
c === "login" && /* @__PURE__ */ n.jsxs(
|
|
3733
3798
|
"form",
|
|
3734
3799
|
{
|
|
3735
3800
|
onSubmit: G,
|
|
@@ -3754,7 +3819,7 @@ const Ls = [
|
|
|
3754
3819
|
),
|
|
3755
3820
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
3756
3821
|
/* @__PURE__ */ n.jsx(
|
|
3757
|
-
|
|
3822
|
+
ce,
|
|
3758
3823
|
{
|
|
3759
3824
|
size: 20,
|
|
3760
3825
|
style: {
|
|
@@ -3773,7 +3838,7 @@ const Ls = [
|
|
|
3773
3838
|
type: "email",
|
|
3774
3839
|
placeholder: "Enter your email",
|
|
3775
3840
|
value: v,
|
|
3776
|
-
onChange: (
|
|
3841
|
+
onChange: (_) => D(_.target.value),
|
|
3777
3842
|
style: k
|
|
3778
3843
|
}
|
|
3779
3844
|
)
|
|
@@ -3819,7 +3884,7 @@ const Ls = [
|
|
|
3819
3884
|
type: R ? "text" : "password",
|
|
3820
3885
|
placeholder: "Enter your password",
|
|
3821
3886
|
value: W,
|
|
3822
|
-
onChange: (
|
|
3887
|
+
onChange: (_) => F(_.target.value),
|
|
3823
3888
|
style: k
|
|
3824
3889
|
}
|
|
3825
3890
|
),
|
|
@@ -3905,7 +3970,7 @@ const Ls = [
|
|
|
3905
3970
|
]
|
|
3906
3971
|
}
|
|
3907
3972
|
),
|
|
3908
|
-
|
|
3973
|
+
c === "forgot" && /* @__PURE__ */ n.jsxs(
|
|
3909
3974
|
"form",
|
|
3910
3975
|
{
|
|
3911
3976
|
onSubmit: m === 1 ? S : x,
|
|
@@ -3930,7 +3995,7 @@ const Ls = [
|
|
|
3930
3995
|
),
|
|
3931
3996
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
3932
3997
|
/* @__PURE__ */ n.jsx(
|
|
3933
|
-
|
|
3998
|
+
ce,
|
|
3934
3999
|
{
|
|
3935
4000
|
size: 20,
|
|
3936
4001
|
style: {
|
|
@@ -3981,7 +4046,7 @@ const Ls = [
|
|
|
3981
4046
|
),
|
|
3982
4047
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
3983
4048
|
/* @__PURE__ */ n.jsx(
|
|
3984
|
-
|
|
4049
|
+
dr,
|
|
3985
4050
|
{
|
|
3986
4051
|
size: 20,
|
|
3987
4052
|
style: {
|
|
@@ -4083,7 +4148,7 @@ const Ls = [
|
|
|
4083
4148
|
{
|
|
4084
4149
|
type: "button",
|
|
4085
4150
|
onClick: () => {
|
|
4086
|
-
j("login"),
|
|
4151
|
+
j("login"), $(1);
|
|
4087
4152
|
},
|
|
4088
4153
|
style: {
|
|
4089
4154
|
background: "none",
|
|
@@ -4115,7 +4180,7 @@ const Ls = [
|
|
|
4115
4180
|
color: g.type === "success" ? i : "#ef4444"
|
|
4116
4181
|
},
|
|
4117
4182
|
children: [
|
|
4118
|
-
g.type === "success" ? /* @__PURE__ */ n.jsx(
|
|
4183
|
+
g.type === "success" ? /* @__PURE__ */ n.jsx(de, { size: 20 }) : /* @__PURE__ */ n.jsx(le, { size: 20 }),
|
|
4119
4184
|
/* @__PURE__ */ n.jsx("span", { children: g.text })
|
|
4120
4185
|
]
|
|
4121
4186
|
}
|
|
@@ -4227,7 +4292,7 @@ const Ls = [
|
|
|
4227
4292
|
children: t
|
|
4228
4293
|
}
|
|
4229
4294
|
) : typeof e == "function" ? e() : e;
|
|
4230
|
-
},
|
|
4295
|
+
}, qs = ({
|
|
4231
4296
|
isOpen: t,
|
|
4232
4297
|
onClose: e,
|
|
4233
4298
|
onSuccess: r,
|
|
@@ -4236,19 +4301,19 @@ const Ls = [
|
|
|
4236
4301
|
token: i,
|
|
4237
4302
|
colors: o
|
|
4238
4303
|
}) => {
|
|
4239
|
-
const { baseUrl: l, apiKey: h, appId:
|
|
4304
|
+
const { baseUrl: l, apiKey: h, appId: d } = ge(), [u, b] = O(!1), [y, w] = O(""), [c, j] = O("warning"), [m, $] = O(!1);
|
|
4240
4305
|
if (te(() => {
|
|
4241
4306
|
if (typeof window > "u") return;
|
|
4242
4307
|
const g = () => {
|
|
4243
|
-
|
|
4308
|
+
$(window.innerWidth < 640);
|
|
4244
4309
|
};
|
|
4245
4310
|
return g(), window.addEventListener("resize", g), () => window.removeEventListener("resize", g);
|
|
4246
4311
|
}, []), !t) return null;
|
|
4247
4312
|
const R = async () => {
|
|
4248
4313
|
b(!0), j("processing");
|
|
4249
4314
|
try {
|
|
4250
|
-
const { data: g } = await
|
|
4251
|
-
data: { appId:
|
|
4315
|
+
const { data: g } = await M.delete(`${l}/users/delete/${a}`, {
|
|
4316
|
+
data: { appId: d },
|
|
4252
4317
|
headers: {
|
|
4253
4318
|
"x-api-key": h
|
|
4254
4319
|
}
|
|
@@ -4262,9 +4327,9 @@ const Ls = [
|
|
|
4262
4327
|
b(!1);
|
|
4263
4328
|
}
|
|
4264
4329
|
}, A = y.toLowerCase() === "delete my account", C = (g) => {
|
|
4265
|
-
g.target === g.currentTarget &&
|
|
4266
|
-
},
|
|
4267
|
-
switch (
|
|
4330
|
+
g.target === g.currentTarget && c !== "processing" && c !== "success" && e();
|
|
4331
|
+
}, q = () => {
|
|
4332
|
+
switch (c) {
|
|
4268
4333
|
case "warning":
|
|
4269
4334
|
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
4270
4335
|
/* @__PURE__ */ n.jsxs(
|
|
@@ -4375,7 +4440,7 @@ const Ls = [
|
|
|
4375
4440
|
display: "flex",
|
|
4376
4441
|
alignItems: "flex-start"
|
|
4377
4442
|
},
|
|
4378
|
-
children: /* @__PURE__ */ n.jsx(
|
|
4443
|
+
children: /* @__PURE__ */ n.jsx(_t, { size: 24 })
|
|
4379
4444
|
}
|
|
4380
4445
|
),
|
|
4381
4446
|
/* @__PURE__ */ n.jsxs("div", { style: { flex: 1 }, children: [
|
|
@@ -4405,11 +4470,11 @@ const Ls = [
|
|
|
4405
4470
|
text: "All your data will be permanently deleted"
|
|
4406
4471
|
},
|
|
4407
4472
|
{
|
|
4408
|
-
icon: /* @__PURE__ */ n.jsx(
|
|
4473
|
+
icon: /* @__PURE__ */ n.jsx(Ds, { size: 16 }),
|
|
4409
4474
|
text: "This action cannot be reversed"
|
|
4410
4475
|
},
|
|
4411
4476
|
{
|
|
4412
|
-
icon: /* @__PURE__ */ n.jsx(
|
|
4477
|
+
icon: /* @__PURE__ */ n.jsx(ct, { size: 16 }),
|
|
4413
4478
|
text: "You will lose access to all services"
|
|
4414
4479
|
}
|
|
4415
4480
|
].map((g, I) => /* @__PURE__ */ n.jsxs(
|
|
@@ -4536,7 +4601,7 @@ const Ls = [
|
|
|
4536
4601
|
color: "white",
|
|
4537
4602
|
flexShrink: 0
|
|
4538
4603
|
},
|
|
4539
|
-
children: /* @__PURE__ */ n.jsx(
|
|
4604
|
+
children: /* @__PURE__ */ n.jsx(_t, { size: 24 })
|
|
4540
4605
|
}
|
|
4541
4606
|
),
|
|
4542
4607
|
/* @__PURE__ */ n.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ n.jsx(
|
|
@@ -4837,7 +4902,7 @@ const Ls = [
|
|
|
4837
4902
|
},
|
|
4838
4903
|
children: [
|
|
4839
4904
|
/* @__PURE__ */ n.jsx(
|
|
4840
|
-
|
|
4905
|
+
cr,
|
|
4841
4906
|
{
|
|
4842
4907
|
size: 18,
|
|
4843
4908
|
style: { color: o.accent, flexShrink: 0 }
|
|
@@ -5021,7 +5086,7 @@ const Ls = [
|
|
|
5021
5086
|
animation: "scaleIn 0.3s ease-out"
|
|
5022
5087
|
},
|
|
5023
5088
|
className: "delete-modal-container",
|
|
5024
|
-
children:
|
|
5089
|
+
children: q()
|
|
5025
5090
|
}
|
|
5026
5091
|
),
|
|
5027
5092
|
/* @__PURE__ */ n.jsx("style", { children: `
|
|
@@ -5082,26 +5147,26 @@ const Ls = [
|
|
|
5082
5147
|
]
|
|
5083
5148
|
}
|
|
5084
5149
|
);
|
|
5085
|
-
},
|
|
5150
|
+
}, Ms = ({
|
|
5086
5151
|
isOpen: t,
|
|
5087
5152
|
onClose: e,
|
|
5088
5153
|
onUpdate: r,
|
|
5089
5154
|
colors: s
|
|
5090
5155
|
}) => {
|
|
5091
|
-
const [a, i] = O(""), [o, l] = O(!1), [h,
|
|
5156
|
+
const [a, i] = O(""), [o, l] = O(!1), [h, d] = O(!1), [u, b] = O({ isValid: !1, message: "", type: null });
|
|
5092
5157
|
if (te(() => {
|
|
5093
5158
|
if (typeof window > "u") return;
|
|
5094
|
-
const
|
|
5095
|
-
|
|
5159
|
+
const c = () => {
|
|
5160
|
+
d(window.innerWidth < 640);
|
|
5096
5161
|
};
|
|
5097
|
-
return
|
|
5162
|
+
return c(), window.addEventListener("resize", c), () => window.removeEventListener("resize", c);
|
|
5098
5163
|
}, []), te(() => {
|
|
5099
5164
|
if (!a.trim()) {
|
|
5100
5165
|
b({ isValid: !1, message: "", type: null });
|
|
5101
5166
|
return;
|
|
5102
5167
|
}
|
|
5103
5168
|
try {
|
|
5104
|
-
const
|
|
5169
|
+
const c = new URL(a), j = /\.(jpg|jpeg|png|gif|webp|svg)$/i.test(c.pathname);
|
|
5105
5170
|
b(j ? {
|
|
5106
5171
|
isValid: !0,
|
|
5107
5172
|
message: "Valid image URL",
|
|
@@ -5128,8 +5193,8 @@ const Ls = [
|
|
|
5128
5193
|
l(!1);
|
|
5129
5194
|
}
|
|
5130
5195
|
}
|
|
5131
|
-
}, w = (
|
|
5132
|
-
|
|
5196
|
+
}, w = (c) => {
|
|
5197
|
+
c.target === c.currentTarget && e();
|
|
5133
5198
|
};
|
|
5134
5199
|
return /* @__PURE__ */ n.jsxs(
|
|
5135
5200
|
"div",
|
|
@@ -5236,11 +5301,11 @@ const Ls = [
|
|
|
5236
5301
|
flexShrink: 0,
|
|
5237
5302
|
transition: "all 0.2s ease"
|
|
5238
5303
|
},
|
|
5239
|
-
onMouseOver: (
|
|
5240
|
-
|
|
5304
|
+
onMouseOver: (c) => {
|
|
5305
|
+
c.currentTarget.style.backgroundColor = s.border, c.currentTarget.style.color = s.textPrimary;
|
|
5241
5306
|
},
|
|
5242
|
-
onMouseOut: (
|
|
5243
|
-
|
|
5307
|
+
onMouseOut: (c) => {
|
|
5308
|
+
c.currentTarget.style.backgroundColor = "transparent", c.currentTarget.style.color = s.textTertiary;
|
|
5244
5309
|
},
|
|
5245
5310
|
children: /* @__PURE__ */ n.jsx(Pe, { size: 20 })
|
|
5246
5311
|
}
|
|
@@ -5285,7 +5350,7 @@ const Ls = [
|
|
|
5285
5350
|
id: "avatar-url",
|
|
5286
5351
|
placeholder: "https://example.com/your-avatar.jpg",
|
|
5287
5352
|
value: a,
|
|
5288
|
-
onChange: (
|
|
5353
|
+
onChange: (c) => i(c.target.value),
|
|
5289
5354
|
style: {
|
|
5290
5355
|
width: "100%",
|
|
5291
5356
|
padding: "14px 16px",
|
|
@@ -5299,11 +5364,11 @@ const Ls = [
|
|
|
5299
5364
|
transition: "all 0.2s ease",
|
|
5300
5365
|
boxSizing: "border-box"
|
|
5301
5366
|
},
|
|
5302
|
-
onFocus: (
|
|
5303
|
-
|
|
5367
|
+
onFocus: (c) => {
|
|
5368
|
+
c.target.style.borderColor = s.accent, c.target.style.boxShadow = `0 0 0 3px ${s.accent}20`;
|
|
5304
5369
|
},
|
|
5305
|
-
onBlur: (
|
|
5306
|
-
|
|
5370
|
+
onBlur: (c) => {
|
|
5371
|
+
c.target.style.borderColor = u.type === "error" ? s.error : u.type === "success" ? s.success : s.border, c.target.style.boxShadow = "none";
|
|
5307
5372
|
},
|
|
5308
5373
|
disabled: o
|
|
5309
5374
|
}
|
|
@@ -5334,7 +5399,7 @@ const Ls = [
|
|
|
5334
5399
|
color: u.type === "success" ? s.success : u.type === "error" ? s.error : s.textTertiary
|
|
5335
5400
|
},
|
|
5336
5401
|
children: [
|
|
5337
|
-
u.type === "success" && /* @__PURE__ */ n.jsx(
|
|
5402
|
+
u.type === "success" && /* @__PURE__ */ n.jsx(de, { size: 14 }),
|
|
5338
5403
|
u.type === "error" && /* @__PURE__ */ n.jsx(le, { size: 14 }),
|
|
5339
5404
|
u.type === "warning" && /* @__PURE__ */ n.jsx(le, { size: 14 }),
|
|
5340
5405
|
u.message
|
|
@@ -5378,8 +5443,8 @@ const Ls = [
|
|
|
5378
5443
|
border: `2px solid ${s.success}40`,
|
|
5379
5444
|
margin: "0 auto"
|
|
5380
5445
|
},
|
|
5381
|
-
onError: (
|
|
5382
|
-
|
|
5446
|
+
onError: (c) => {
|
|
5447
|
+
c.currentTarget.style.display = "none";
|
|
5383
5448
|
}
|
|
5384
5449
|
}
|
|
5385
5450
|
)
|
|
@@ -5420,11 +5485,11 @@ const Ls = [
|
|
|
5420
5485
|
opacity: o ? 0.6 : 1,
|
|
5421
5486
|
transition: "all 0.2s ease"
|
|
5422
5487
|
},
|
|
5423
|
-
onMouseOver: (
|
|
5424
|
-
o || (
|
|
5488
|
+
onMouseOver: (c) => {
|
|
5489
|
+
o || (c.currentTarget.style.backgroundColor = s.border, c.currentTarget.style.transform = "translateY(-1px)");
|
|
5425
5490
|
},
|
|
5426
|
-
onMouseOut: (
|
|
5427
|
-
o || (
|
|
5491
|
+
onMouseOut: (c) => {
|
|
5492
|
+
o || (c.currentTarget.style.backgroundColor = "transparent", c.currentTarget.style.transform = "translateY(0)");
|
|
5428
5493
|
},
|
|
5429
5494
|
children: "Cancel"
|
|
5430
5495
|
}
|
|
@@ -5453,11 +5518,11 @@ const Ls = [
|
|
|
5453
5518
|
transition: "all 0.2s ease",
|
|
5454
5519
|
boxShadow: o || !u.isValid ? "none" : `0 4px 12px ${s.accent}40`
|
|
5455
5520
|
},
|
|
5456
|
-
onMouseOver: (
|
|
5457
|
-
!o && u.isValid && (
|
|
5521
|
+
onMouseOver: (c) => {
|
|
5522
|
+
!o && u.isValid && (c.currentTarget.style.transform = "translateY(-1px)", c.currentTarget.style.boxShadow = `0 6px 20px ${s.accent}60`);
|
|
5458
5523
|
},
|
|
5459
|
-
onMouseOut: (
|
|
5460
|
-
!o && u.isValid && (
|
|
5524
|
+
onMouseOut: (c) => {
|
|
5525
|
+
!o && u.isValid && (c.currentTarget.style.transform = "translateY(0)", c.currentTarget.style.boxShadow = `0 4px 12px ${s.accent}40`);
|
|
5461
5526
|
},
|
|
5462
5527
|
children: o ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
5463
5528
|
/* @__PURE__ */ n.jsx(
|
|
@@ -5542,15 +5607,15 @@ const Ls = [
|
|
|
5542
5607
|
userId: a,
|
|
5543
5608
|
colors: i
|
|
5544
5609
|
}) => {
|
|
5545
|
-
const { baseUrl: o, apiKey: l, appId: h } = ge(), [
|
|
5610
|
+
const { baseUrl: o, apiKey: l, appId: h } = ge(), [d, u] = O({
|
|
5546
5611
|
currentPassword: "",
|
|
5547
5612
|
newPassword: "",
|
|
5548
5613
|
confirmPassword: ""
|
|
5549
|
-
}), [b, y] = O({}), [w,
|
|
5614
|
+
}), [b, y] = O({}), [w, c] = O(!1), [j, m] = O({
|
|
5550
5615
|
currentPassword: !1,
|
|
5551
5616
|
newPassword: !1,
|
|
5552
5617
|
confirmPassword: !1
|
|
5553
|
-
}), [
|
|
5618
|
+
}), [$, R] = O(!1);
|
|
5554
5619
|
if (Le.useEffect(() => {
|
|
5555
5620
|
if (typeof window > "u") return;
|
|
5556
5621
|
const v = () => {
|
|
@@ -5559,23 +5624,23 @@ const Ls = [
|
|
|
5559
5624
|
return v(), window.addEventListener("resize", v), () => window.removeEventListener("resize", v);
|
|
5560
5625
|
}, []), !t) return null;
|
|
5561
5626
|
const A = (v) => {
|
|
5562
|
-
const { name:
|
|
5563
|
-
u((F) => ({ ...F, [
|
|
5627
|
+
const { name: D, value: W } = v.target;
|
|
5628
|
+
u((F) => ({ ...F, [D]: W })), b[D] && y((F) => ({ ...F, [D]: "" }));
|
|
5564
5629
|
}, C = (v) => {
|
|
5565
|
-
m((
|
|
5566
|
-
},
|
|
5630
|
+
m((D) => ({ ...D, [v]: !D[v] }));
|
|
5631
|
+
}, q = () => {
|
|
5567
5632
|
const v = {};
|
|
5568
|
-
return
|
|
5633
|
+
return d.currentPassword || (v.currentPassword = "Current password is required"), d.newPassword ? d.newPassword.length < 6 && (v.newPassword = "Password must be at least 6 characters") : v.newPassword = "New password is required", d.newPassword !== d.confirmPassword && (v.confirmPassword = "Passwords do not match"), y(v), Object.keys(v).length === 0;
|
|
5569
5634
|
}, g = async (v) => {
|
|
5570
|
-
if (v.preventDefault(), !!
|
|
5571
|
-
|
|
5635
|
+
if (v.preventDefault(), !!q()) {
|
|
5636
|
+
c(!0);
|
|
5572
5637
|
try {
|
|
5573
|
-
const { data:
|
|
5638
|
+
const { data: D } = await M.put(
|
|
5574
5639
|
`${o}/users/change-password/${a}`,
|
|
5575
5640
|
{
|
|
5576
5641
|
appId: h,
|
|
5577
|
-
currentPassword:
|
|
5578
|
-
newPassword:
|
|
5642
|
+
currentPassword: d.currentPassword,
|
|
5643
|
+
newPassword: d.newPassword
|
|
5579
5644
|
},
|
|
5580
5645
|
{
|
|
5581
5646
|
headers: {
|
|
@@ -5583,22 +5648,22 @@ const Ls = [
|
|
|
5583
5648
|
}
|
|
5584
5649
|
}
|
|
5585
5650
|
);
|
|
5586
|
-
|
|
5651
|
+
D.success ? (r(D.message || "Password updated successfully"), u({
|
|
5587
5652
|
currentPassword: "",
|
|
5588
5653
|
newPassword: "",
|
|
5589
5654
|
confirmPassword: ""
|
|
5590
|
-
}), e()) : s(
|
|
5591
|
-
} catch (
|
|
5592
|
-
s(
|
|
5655
|
+
}), e()) : s(D.message || "Failed to update password");
|
|
5656
|
+
} catch (D) {
|
|
5657
|
+
s(D.response?.data?.message || "Something went wrong");
|
|
5593
5658
|
} finally {
|
|
5594
|
-
|
|
5659
|
+
c(!1);
|
|
5595
5660
|
}
|
|
5596
5661
|
}
|
|
5597
5662
|
}, I = [
|
|
5598
5663
|
{
|
|
5599
5664
|
field: "currentPassword",
|
|
5600
5665
|
label: "Current Password",
|
|
5601
|
-
icon: /* @__PURE__ */ n.jsx(
|
|
5666
|
+
icon: /* @__PURE__ */ n.jsx(dt, { size: 18 })
|
|
5602
5667
|
},
|
|
5603
5668
|
{
|
|
5604
5669
|
field: "newPassword",
|
|
@@ -5727,7 +5792,7 @@ const Ls = [
|
|
|
5727
5792
|
}
|
|
5728
5793
|
),
|
|
5729
5794
|
/* @__PURE__ */ n.jsxs("form", { onSubmit: g, children: [
|
|
5730
|
-
I.map(({ field: v, label:
|
|
5795
|
+
I.map(({ field: v, label: D, icon: W }) => /* @__PURE__ */ n.jsxs(
|
|
5731
5796
|
"div",
|
|
5732
5797
|
{
|
|
5733
5798
|
style: {
|
|
@@ -5747,7 +5812,7 @@ const Ls = [
|
|
|
5747
5812
|
fontWeight: 500,
|
|
5748
5813
|
lineHeight: "1.4"
|
|
5749
5814
|
},
|
|
5750
|
-
children:
|
|
5815
|
+
children: D
|
|
5751
5816
|
}
|
|
5752
5817
|
),
|
|
5753
5818
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
@@ -5771,8 +5836,8 @@ const Ls = [
|
|
|
5771
5836
|
type: j[v] ? "text" : "password",
|
|
5772
5837
|
id: v,
|
|
5773
5838
|
name: v,
|
|
5774
|
-
placeholder: `Enter ${
|
|
5775
|
-
value:
|
|
5839
|
+
placeholder: `Enter ${D.toLowerCase()}`,
|
|
5840
|
+
value: d[v],
|
|
5776
5841
|
onChange: A,
|
|
5777
5842
|
style: {
|
|
5778
5843
|
width: "100%",
|
|
@@ -5853,7 +5918,7 @@ const Ls = [
|
|
|
5853
5918
|
style: {
|
|
5854
5919
|
display: "flex",
|
|
5855
5920
|
gap: "12px",
|
|
5856
|
-
flexDirection:
|
|
5921
|
+
flexDirection: $ ? "column-reverse" : "row",
|
|
5857
5922
|
justifyContent: "flex-end",
|
|
5858
5923
|
alignItems: "stretch"
|
|
5859
5924
|
},
|
|
@@ -5873,8 +5938,8 @@ const Ls = [
|
|
|
5873
5938
|
fontSize: "14px",
|
|
5874
5939
|
fontWeight: 500,
|
|
5875
5940
|
cursor: w ? "not-allowed" : "pointer",
|
|
5876
|
-
flex:
|
|
5877
|
-
minWidth:
|
|
5941
|
+
flex: $ ? "none" : 1,
|
|
5942
|
+
minWidth: $ ? "100%" : "120px",
|
|
5878
5943
|
opacity: w ? 0.6 : 1,
|
|
5879
5944
|
transition: "all 0.2s ease"
|
|
5880
5945
|
},
|
|
@@ -5901,8 +5966,8 @@ const Ls = [
|
|
|
5901
5966
|
fontSize: "14px",
|
|
5902
5967
|
fontWeight: 600,
|
|
5903
5968
|
cursor: w ? "not-allowed" : "pointer",
|
|
5904
|
-
flex:
|
|
5905
|
-
minWidth:
|
|
5969
|
+
flex: $ ? "none" : 1,
|
|
5970
|
+
minWidth: $ ? "100%" : "140px",
|
|
5906
5971
|
opacity: w ? 0.8 : 1,
|
|
5907
5972
|
display: "flex",
|
|
5908
5973
|
alignItems: "center",
|
|
@@ -5989,7 +6054,7 @@ const Ls = [
|
|
|
5989
6054
|
otpSent: o,
|
|
5990
6055
|
verifying: l,
|
|
5991
6056
|
user: h,
|
|
5992
|
-
colors:
|
|
6057
|
+
colors: d,
|
|
5993
6058
|
darkMode: u
|
|
5994
6059
|
}) => {
|
|
5995
6060
|
if (!t) return null;
|
|
@@ -6009,18 +6074,18 @@ const Ls = [
|
|
|
6009
6074
|
{
|
|
6010
6075
|
className: "verify-email-modal",
|
|
6011
6076
|
style: {
|
|
6012
|
-
backgroundColor:
|
|
6013
|
-
border: `1px solid ${
|
|
6077
|
+
backgroundColor: d.surface,
|
|
6078
|
+
border: `1px solid ${d.border}`
|
|
6014
6079
|
},
|
|
6015
6080
|
children: [
|
|
6016
6081
|
/* @__PURE__ */ n.jsxs("div", { className: "modal-header", children: [
|
|
6017
|
-
/* @__PURE__ */ n.jsx("h3", { style: { color:
|
|
6082
|
+
/* @__PURE__ */ n.jsx("h3", { style: { color: d.textPrimary }, children: "Verify Your Email" }),
|
|
6018
6083
|
/* @__PURE__ */ n.jsx(
|
|
6019
6084
|
"button",
|
|
6020
6085
|
{
|
|
6021
6086
|
onClick: b,
|
|
6022
6087
|
className: "close-btn",
|
|
6023
|
-
style: { color:
|
|
6088
|
+
style: { color: d.textTertiary },
|
|
6024
6089
|
"aria-label": "Close verification modal",
|
|
6025
6090
|
children: /* @__PURE__ */ n.jsx(Pe, { size: 20, "aria-hidden": "true" })
|
|
6026
6091
|
}
|
|
@@ -6028,9 +6093,9 @@ const Ls = [
|
|
|
6028
6093
|
] }),
|
|
6029
6094
|
/* @__PURE__ */ n.jsxs("form", { className: "verify-form", onSubmit: r, children: [
|
|
6030
6095
|
/* @__PURE__ */ n.jsxs("div", { className: "form-group", children: [
|
|
6031
|
-
/* @__PURE__ */ n.jsx("label", { style: { color:
|
|
6096
|
+
/* @__PURE__ */ n.jsx("label", { style: { color: d.textSecondary }, children: "Email" }),
|
|
6032
6097
|
/* @__PURE__ */ n.jsxs("div", { className: "input-container", children: [
|
|
6033
|
-
/* @__PURE__ */ n.jsx(
|
|
6098
|
+
/* @__PURE__ */ n.jsx(ce, { size: 18, style: { color: d.textTertiary }, "aria-hidden": "true" }),
|
|
6034
6099
|
/* @__PURE__ */ n.jsx(
|
|
6035
6100
|
"input",
|
|
6036
6101
|
{
|
|
@@ -6039,9 +6104,9 @@ const Ls = [
|
|
|
6039
6104
|
onChange: (y) => i((w) => ({ ...w, email: y.target.value })),
|
|
6040
6105
|
placeholder: "Enter your email",
|
|
6041
6106
|
style: {
|
|
6042
|
-
backgroundColor:
|
|
6043
|
-
color:
|
|
6044
|
-
borderColor:
|
|
6107
|
+
backgroundColor: d.surfaceLight,
|
|
6108
|
+
color: d.textPrimary,
|
|
6109
|
+
borderColor: d.border
|
|
6045
6110
|
},
|
|
6046
6111
|
required: !0,
|
|
6047
6112
|
"aria-required": "true",
|
|
@@ -6051,9 +6116,9 @@ const Ls = [
|
|
|
6051
6116
|
] })
|
|
6052
6117
|
] }),
|
|
6053
6118
|
o && /* @__PURE__ */ n.jsxs("div", { className: "form-group", children: [
|
|
6054
|
-
/* @__PURE__ */ n.jsx("label", { style: { color:
|
|
6119
|
+
/* @__PURE__ */ n.jsx("label", { style: { color: d.textSecondary }, children: "OTP" }),
|
|
6055
6120
|
/* @__PURE__ */ n.jsxs("div", { className: "input-container", children: [
|
|
6056
|
-
/* @__PURE__ */ n.jsx(
|
|
6121
|
+
/* @__PURE__ */ n.jsx(dr, { size: 18, style: { color: d.textTertiary }, "aria-hidden": "true" }),
|
|
6057
6122
|
/* @__PURE__ */ n.jsx(
|
|
6058
6123
|
"input",
|
|
6059
6124
|
{
|
|
@@ -6062,9 +6127,9 @@ const Ls = [
|
|
|
6062
6127
|
onChange: (y) => i((w) => ({ ...w, otp: y.target.value })),
|
|
6063
6128
|
placeholder: "Enter OTP",
|
|
6064
6129
|
style: {
|
|
6065
|
-
backgroundColor:
|
|
6066
|
-
color:
|
|
6067
|
-
borderColor:
|
|
6130
|
+
backgroundColor: d.surfaceLight,
|
|
6131
|
+
color: d.textPrimary,
|
|
6132
|
+
borderColor: d.border
|
|
6068
6133
|
},
|
|
6069
6134
|
required: !0,
|
|
6070
6135
|
"aria-required": "true",
|
|
@@ -6080,12 +6145,12 @@ const Ls = [
|
|
|
6080
6145
|
disabled: l,
|
|
6081
6146
|
className: "btn-primary",
|
|
6082
6147
|
style: {
|
|
6083
|
-
background: `linear-gradient(to right, ${
|
|
6148
|
+
background: `linear-gradient(to right, ${d.accent}, ${d.accentHover})`,
|
|
6084
6149
|
opacity: l ? 0.7 : 1
|
|
6085
6150
|
},
|
|
6086
6151
|
"aria-label": l ? "Verifying email" : "Verify email",
|
|
6087
6152
|
children: [
|
|
6088
|
-
l ? /* @__PURE__ */ n.jsx(ae, { size: 16, className: "spinner", "aria-hidden": "true" }) : /* @__PURE__ */ n.jsx(
|
|
6153
|
+
l ? /* @__PURE__ */ n.jsx(ae, { size: 16, className: "spinner", "aria-hidden": "true" }) : /* @__PURE__ */ n.jsx(de, { size: 16, "aria-hidden": "true" }),
|
|
6089
6154
|
l ? "Verifying..." : "Verify Email"
|
|
6090
6155
|
]
|
|
6091
6156
|
}
|
|
@@ -6097,7 +6162,7 @@ const Ls = [
|
|
|
6097
6162
|
disabled: l,
|
|
6098
6163
|
className: "btn-primary",
|
|
6099
6164
|
style: {
|
|
6100
|
-
background: `linear-gradient(to right, ${
|
|
6165
|
+
background: `linear-gradient(to right, ${d.accent}, ${d.accentHover})`,
|
|
6101
6166
|
opacity: l ? 0.7 : 1
|
|
6102
6167
|
},
|
|
6103
6168
|
"aria-label": l ? "Sending OTP" : "Send OTP",
|
|
@@ -6204,8 +6269,8 @@ const Ls = [
|
|
|
6204
6269
|
}
|
|
6205
6270
|
|
|
6206
6271
|
.input-container input:focus {
|
|
6207
|
-
border-color: ${
|
|
6208
|
-
box-shadow: 0 0 0 3px ${
|
|
6272
|
+
border-color: ${d.accent};
|
|
6273
|
+
box-shadow: 0 0 0 3px ${d.accent}20;
|
|
6209
6274
|
}
|
|
6210
6275
|
|
|
6211
6276
|
.modal-actions {
|
|
@@ -6271,11 +6336,11 @@ const Ls = [
|
|
|
6271
6336
|
onVerify: i,
|
|
6272
6337
|
primaryColor: o = "#00C212"
|
|
6273
6338
|
}) => {
|
|
6274
|
-
const { baseUrl: l, apiKey: h, appId:
|
|
6339
|
+
const { baseUrl: l, apiKey: h, appId: d } = ge(), [u, b] = O(null), [y, w] = O(e), [c, j] = O(!0), [m, $] = O(!1), [R, A] = O(!1), [C, q] = O(!1), [g, I] = O(!1), [v, D] = O(!1), [W, F] = O(!1), [V, Z] = O(!1), [T, J] = O(!1), [z, P] = O(null), [K, Q] = O(!1), [G, f] = O({
|
|
6275
6340
|
email: "",
|
|
6276
6341
|
otp: "",
|
|
6277
|
-
appId:
|
|
6278
|
-
}), [S, x] = O(!1), [k,
|
|
6342
|
+
appId: d
|
|
6343
|
+
}), [S, x] = O(!1), [k, _] = O(!1);
|
|
6279
6344
|
te(() => {
|
|
6280
6345
|
if (typeof window < "u") {
|
|
6281
6346
|
const E = () => b(window.innerWidth);
|
|
@@ -6306,19 +6371,19 @@ const Ls = [
|
|
|
6306
6371
|
return;
|
|
6307
6372
|
}
|
|
6308
6373
|
try {
|
|
6309
|
-
|
|
6310
|
-
const E = await
|
|
6374
|
+
_(!0);
|
|
6375
|
+
const E = await M.post(
|
|
6311
6376
|
`${l}/users/send-verify-otp/${y?.id}`,
|
|
6312
6377
|
{ email: G.email },
|
|
6313
6378
|
{
|
|
6314
|
-
headers: { "x-api-key": h, "x-app-id":
|
|
6379
|
+
headers: { "x-api-key": h, "x-app-id": d }
|
|
6315
6380
|
}
|
|
6316
6381
|
);
|
|
6317
6382
|
E.data.success ? (N("success", E.data.message || "OTP sent to email!"), x(!0)) : N("error", E.data.message || "Failed to send OTP");
|
|
6318
6383
|
} catch (E) {
|
|
6319
6384
|
N("error", E.response?.data?.message || "Server error");
|
|
6320
6385
|
} finally {
|
|
6321
|
-
|
|
6386
|
+
_(!1);
|
|
6322
6387
|
}
|
|
6323
6388
|
}, ue = async (E) => {
|
|
6324
6389
|
if (E.preventDefault(), !G.email || !G.otp) {
|
|
@@ -6326,8 +6391,8 @@ const Ls = [
|
|
|
6326
6391
|
return;
|
|
6327
6392
|
}
|
|
6328
6393
|
try {
|
|
6329
|
-
|
|
6330
|
-
const H = await
|
|
6394
|
+
_(!0);
|
|
6395
|
+
const H = await M.post(
|
|
6331
6396
|
`${l}/users/verify-email`,
|
|
6332
6397
|
G
|
|
6333
6398
|
);
|
|
@@ -6339,7 +6404,7 @@ const Ls = [
|
|
|
6339
6404
|
JSON.stringify({ ...X, token: t })
|
|
6340
6405
|
), typeof i == "function" && i(X);
|
|
6341
6406
|
}
|
|
6342
|
-
f({ email: "", otp: "", appId:
|
|
6407
|
+
f({ email: "", otp: "", appId: d }), x(!1), F(!1);
|
|
6343
6408
|
} else
|
|
6344
6409
|
N("error", H.data.message || "Verification failed");
|
|
6345
6410
|
} catch (H) {
|
|
@@ -6348,12 +6413,12 @@ const Ls = [
|
|
|
6348
6413
|
H.response?.data?.message || "Something went wrong"
|
|
6349
6414
|
);
|
|
6350
6415
|
} finally {
|
|
6351
|
-
|
|
6416
|
+
_(!1);
|
|
6352
6417
|
}
|
|
6353
6418
|
}, ve = async (E) => {
|
|
6354
6419
|
if (!y) return !1;
|
|
6355
6420
|
try {
|
|
6356
|
-
const H = { ...y, avatarUrl: E }, { data: X } = await
|
|
6421
|
+
const H = { ...y, avatarUrl: E }, { data: X } = await M.put(
|
|
6357
6422
|
`${l}/users/update/${y.id}`,
|
|
6358
6423
|
H,
|
|
6359
6424
|
{ headers: { "x-api-key": h } }
|
|
@@ -6369,12 +6434,12 @@ const Ls = [
|
|
|
6369
6434
|
if (y) {
|
|
6370
6435
|
A(!0);
|
|
6371
6436
|
try {
|
|
6372
|
-
const { data: E } = await
|
|
6437
|
+
const { data: E } = await M.put(
|
|
6373
6438
|
`${l}/users/update/${y.id}`,
|
|
6374
6439
|
y,
|
|
6375
6440
|
{ headers: { "x-api-key": h } }
|
|
6376
6441
|
);
|
|
6377
|
-
E.success ? (w(E.user),
|
|
6442
|
+
E.success ? (w(E.user), $(!1), localStorage.setItem(
|
|
6378
6443
|
"userInfo",
|
|
6379
6444
|
JSON.stringify({ ...E.user, token: t })
|
|
6380
6445
|
), N("success", "Profile updated successfully")) : N("error", E.message);
|
|
@@ -6386,8 +6451,8 @@ const Ls = [
|
|
|
6386
6451
|
}
|
|
6387
6452
|
}, pt = async (E) => {
|
|
6388
6453
|
try {
|
|
6389
|
-
const { data: H } = await
|
|
6390
|
-
`${l}/users/check-user/${E}?appId=${
|
|
6454
|
+
const { data: H } = await M.get(
|
|
6455
|
+
`${l}/users/check-user/${E}?appId=${d}`,
|
|
6391
6456
|
{ headers: { "x-api-key": h } }
|
|
6392
6457
|
);
|
|
6393
6458
|
H?.success === !0 && H?.exists === !1 && (console.warn("❌ User does not exist on server. Clearing session..."), localStorage.removeItem("userInfo"), w(null));
|
|
@@ -6414,7 +6479,7 @@ const Ls = [
|
|
|
6414
6479
|
const ft = (E, H) => {
|
|
6415
6480
|
let X = parseInt(E.replace("#", ""), 16), pe = (X >> 16) + H, He = (X >> 8 & 255) + H, Ve = (X & 255) + H;
|
|
6416
6481
|
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")}`;
|
|
6417
|
-
},
|
|
6482
|
+
}, U = r ? {
|
|
6418
6483
|
background: "#000000",
|
|
6419
6484
|
surface: "#09090b",
|
|
6420
6485
|
surfaceLight: "#27272a",
|
|
@@ -6443,7 +6508,7 @@ const Ls = [
|
|
|
6443
6508
|
border: "#e4e4e7",
|
|
6444
6509
|
warning: "#d97706"
|
|
6445
6510
|
};
|
|
6446
|
-
if (
|
|
6511
|
+
if (c)
|
|
6447
6512
|
return /* @__PURE__ */ n.jsx(
|
|
6448
6513
|
"div",
|
|
6449
6514
|
{
|
|
@@ -6453,7 +6518,7 @@ const Ls = [
|
|
|
6453
6518
|
display: "flex",
|
|
6454
6519
|
alignItems: "center",
|
|
6455
6520
|
justifyContent: "center",
|
|
6456
|
-
color:
|
|
6521
|
+
color: U.textPrimary,
|
|
6457
6522
|
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, sans-serif"
|
|
6458
6523
|
},
|
|
6459
6524
|
children: /* @__PURE__ */ n.jsxs(
|
|
@@ -6471,12 +6536,12 @@ const Ls = [
|
|
|
6471
6536
|
ae,
|
|
6472
6537
|
{
|
|
6473
6538
|
size: 40,
|
|
6474
|
-
color:
|
|
6539
|
+
color: U.accent,
|
|
6475
6540
|
style: { animation: "spin 1s linear infinite" },
|
|
6476
6541
|
"aria-hidden": "true"
|
|
6477
6542
|
}
|
|
6478
6543
|
),
|
|
6479
|
-
/* @__PURE__ */ n.jsx("p", { style: { color:
|
|
6544
|
+
/* @__PURE__ */ n.jsx("p", { style: { color: U.textTertiary, margin: 0 }, children: "Loading your profile..." })
|
|
6480
6545
|
]
|
|
6481
6546
|
}
|
|
6482
6547
|
)
|
|
@@ -6492,7 +6557,7 @@ const Ls = [
|
|
|
6492
6557
|
display: "flex",
|
|
6493
6558
|
alignItems: "center",
|
|
6494
6559
|
justifyContent: "center",
|
|
6495
|
-
color:
|
|
6560
|
+
color: U.textPrimary,
|
|
6496
6561
|
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, sans-serif"
|
|
6497
6562
|
},
|
|
6498
6563
|
children: /* @__PURE__ */ n.jsxs(
|
|
@@ -6506,8 +6571,8 @@ const Ls = [
|
|
|
6506
6571
|
textAlign: "center"
|
|
6507
6572
|
},
|
|
6508
6573
|
children: [
|
|
6509
|
-
/* @__PURE__ */ n.jsx(le, { size: 40, color:
|
|
6510
|
-
/* @__PURE__ */ n.jsx("p", { style: { color:
|
|
6574
|
+
/* @__PURE__ */ n.jsx(le, { size: 40, color: U.error, "aria-hidden": "true" }),
|
|
6575
|
+
/* @__PURE__ */ n.jsx("p", { style: { color: U.textTertiary, margin: 0 }, children: "No profile found. Please log in again." })
|
|
6511
6576
|
]
|
|
6512
6577
|
}
|
|
6513
6578
|
)
|
|
@@ -6526,7 +6591,7 @@ const Ls = [
|
|
|
6526
6591
|
value: y.email,
|
|
6527
6592
|
name: "email",
|
|
6528
6593
|
type: "email",
|
|
6529
|
-
icon:
|
|
6594
|
+
icon: ce
|
|
6530
6595
|
},
|
|
6531
6596
|
{
|
|
6532
6597
|
label: "Phone Number",
|
|
@@ -6551,7 +6616,7 @@ const Ls = [
|
|
|
6551
6616
|
display: "flex",
|
|
6552
6617
|
alignItems: "center",
|
|
6553
6618
|
justifyContent: "center",
|
|
6554
|
-
color:
|
|
6619
|
+
color: U.textPrimary,
|
|
6555
6620
|
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, sans-serif",
|
|
6556
6621
|
lineHeight: 1.5,
|
|
6557
6622
|
minHeight: "80vh"
|
|
@@ -6590,7 +6655,7 @@ const Ls = [
|
|
|
6590
6655
|
role: "alert",
|
|
6591
6656
|
"aria-live": "polite",
|
|
6592
6657
|
children: [
|
|
6593
|
-
z.type === "success" ? /* @__PURE__ */ n.jsx(
|
|
6658
|
+
z.type === "success" ? /* @__PURE__ */ n.jsx(de, { size: 20, "aria-hidden": "true" }) : /* @__PURE__ */ n.jsx(le, { size: 20, "aria-hidden": "true" }),
|
|
6594
6659
|
z.message
|
|
6595
6660
|
]
|
|
6596
6661
|
}
|
|
@@ -6637,7 +6702,7 @@ const Ls = [
|
|
|
6637
6702
|
"section",
|
|
6638
6703
|
{
|
|
6639
6704
|
style: {
|
|
6640
|
-
backgroundColor:
|
|
6705
|
+
backgroundColor: U.surface,
|
|
6641
6706
|
borderRadius: "16px",
|
|
6642
6707
|
position: "relative",
|
|
6643
6708
|
padding: "24px",
|
|
@@ -6659,7 +6724,7 @@ const Ls = [
|
|
|
6659
6724
|
rel: "noopener noreferrer",
|
|
6660
6725
|
style: { position: "absolute", top: "18px", left: "18px" },
|
|
6661
6726
|
children: /* @__PURE__ */ n.jsx(
|
|
6662
|
-
|
|
6727
|
+
cs,
|
|
6663
6728
|
{
|
|
6664
6729
|
size: 20,
|
|
6665
6730
|
style: {
|
|
@@ -6691,7 +6756,7 @@ const Ls = [
|
|
|
6691
6756
|
borderRadius: "50%",
|
|
6692
6757
|
objectFit: "cover",
|
|
6693
6758
|
boxShadow: "0 10px 25px -5px rgba(0, 0, 0, 0.3)",
|
|
6694
|
-
border: `3px solid ${
|
|
6759
|
+
border: `3px solid ${U.border}`
|
|
6695
6760
|
},
|
|
6696
6761
|
width: 128,
|
|
6697
6762
|
height: 128,
|
|
@@ -6701,12 +6766,12 @@ const Ls = [
|
|
|
6701
6766
|
/* @__PURE__ */ n.jsx(
|
|
6702
6767
|
"button",
|
|
6703
6768
|
{
|
|
6704
|
-
onClick: () =>
|
|
6769
|
+
onClick: () => q(!0),
|
|
6705
6770
|
style: {
|
|
6706
6771
|
position: "absolute",
|
|
6707
6772
|
bottom: "8px",
|
|
6708
6773
|
right: "8px",
|
|
6709
|
-
backgroundColor:
|
|
6774
|
+
backgroundColor: U.accent,
|
|
6710
6775
|
color: "white",
|
|
6711
6776
|
padding: "8px",
|
|
6712
6777
|
borderRadius: "50%",
|
|
@@ -6733,7 +6798,7 @@ const Ls = [
|
|
|
6733
6798
|
fontSize: "24px",
|
|
6734
6799
|
fontWeight: 600,
|
|
6735
6800
|
margin: "0 0 4px 0",
|
|
6736
|
-
color:
|
|
6801
|
+
color: U.textPrimary
|
|
6737
6802
|
},
|
|
6738
6803
|
children: y.name
|
|
6739
6804
|
}
|
|
@@ -6742,7 +6807,7 @@ const Ls = [
|
|
|
6742
6807
|
"p",
|
|
6743
6808
|
{
|
|
6744
6809
|
style: {
|
|
6745
|
-
color:
|
|
6810
|
+
color: U.textTertiary,
|
|
6746
6811
|
margin: "0 0 8px 0"
|
|
6747
6812
|
},
|
|
6748
6813
|
children: y.email
|
|
@@ -6753,7 +6818,7 @@ const Ls = [
|
|
|
6753
6818
|
{
|
|
6754
6819
|
style: {
|
|
6755
6820
|
backgroundColor: y.isVerified ? r ? "rgba(16, 185, 129, 0.1)" : "rgba(16, 185, 129, 0.05)" : r ? "rgba(245, 158, 11, 0.1)" : "rgba(245, 158, 11, 0.05)",
|
|
6756
|
-
color: y.isVerified ?
|
|
6821
|
+
color: y.isVerified ? U.success : U.warning,
|
|
6757
6822
|
border: `1px solid ${y.isVerified ? r ? "rgba(16, 185, 129, 0.3)" : "rgba(16, 185, 129, 0.2)" : r ? "rgba(245, 158, 11, 0.3)" : "rgba(245, 158, 11, 0.2)"}`,
|
|
6758
6823
|
padding: "6px 12px",
|
|
6759
6824
|
borderRadius: "20px",
|
|
@@ -6765,7 +6830,7 @@ const Ls = [
|
|
|
6765
6830
|
marginTop: "8px"
|
|
6766
6831
|
},
|
|
6767
6832
|
children: [
|
|
6768
|
-
y.isVerified ? /* @__PURE__ */ n.jsx(
|
|
6833
|
+
y.isVerified ? /* @__PURE__ */ n.jsx(de, { size: 16, "aria-hidden": "true" }) : /* @__PURE__ */ n.jsx(le, { size: 16, "aria-hidden": "true" }),
|
|
6769
6834
|
y.isVerified ? "Email Verified" : "Not Verified"
|
|
6770
6835
|
]
|
|
6771
6836
|
}
|
|
@@ -6785,11 +6850,11 @@ const Ls = [
|
|
|
6785
6850
|
/* @__PURE__ */ n.jsxs(
|
|
6786
6851
|
"button",
|
|
6787
6852
|
{
|
|
6788
|
-
onClick: () =>
|
|
6853
|
+
onClick: () => $(!1),
|
|
6789
6854
|
style: {
|
|
6790
|
-
backgroundColor:
|
|
6791
|
-
border: `1px solid ${
|
|
6792
|
-
color:
|
|
6855
|
+
backgroundColor: U.surfaceLight,
|
|
6856
|
+
border: `1px solid ${U.border}`,
|
|
6857
|
+
color: U.textPrimary,
|
|
6793
6858
|
padding: "10px 20px",
|
|
6794
6859
|
borderRadius: "6px",
|
|
6795
6860
|
borderStyle: "solid",
|
|
@@ -6817,7 +6882,7 @@ const Ls = [
|
|
|
6817
6882
|
onClick: ur,
|
|
6818
6883
|
disabled: R,
|
|
6819
6884
|
style: {
|
|
6820
|
-
background: `linear-gradient(to right, ${
|
|
6885
|
+
background: `linear-gradient(to right, ${U.accent}, ${U.accentHover})`,
|
|
6821
6886
|
opacity: R ? 0.7 : 1,
|
|
6822
6887
|
color: "white",
|
|
6823
6888
|
padding: "10px 20px",
|
|
@@ -6852,9 +6917,9 @@ const Ls = [
|
|
|
6852
6917
|
/* @__PURE__ */ n.jsxs(
|
|
6853
6918
|
"button",
|
|
6854
6919
|
{
|
|
6855
|
-
onClick: () =>
|
|
6920
|
+
onClick: () => $(!0),
|
|
6856
6921
|
style: {
|
|
6857
|
-
background: `linear-gradient(to right, ${
|
|
6922
|
+
background: `linear-gradient(to right, ${U.accent}, ${U.accentHover})`,
|
|
6858
6923
|
color: "white",
|
|
6859
6924
|
padding: "10px 20px",
|
|
6860
6925
|
borderRadius: "6px",
|
|
@@ -6919,8 +6984,8 @@ const Ls = [
|
|
|
6919
6984
|
"button",
|
|
6920
6985
|
{
|
|
6921
6986
|
style: {
|
|
6922
|
-
backgroundColor:
|
|
6923
|
-
color:
|
|
6987
|
+
backgroundColor: U.surfaceLight,
|
|
6988
|
+
color: U.textPrimary,
|
|
6924
6989
|
padding: "10px 20px",
|
|
6925
6990
|
borderRadius: "6px",
|
|
6926
6991
|
border: "none",
|
|
@@ -6953,8 +7018,8 @@ const Ls = [
|
|
|
6953
7018
|
bottom: "100%",
|
|
6954
7019
|
left: 0,
|
|
6955
7020
|
right: 0,
|
|
6956
|
-
backgroundColor:
|
|
6957
|
-
border: `1px solid ${
|
|
7021
|
+
backgroundColor: U.surface,
|
|
7022
|
+
border: `1px solid ${U.border}`,
|
|
6958
7023
|
borderRadius: "12px 12px 0 0",
|
|
6959
7024
|
boxShadow: "0 -8px 24px rgba(0, 0, 0, 0.25)",
|
|
6960
7025
|
zIndex: 200,
|
|
@@ -6974,7 +7039,7 @@ const Ls = [
|
|
|
6974
7039
|
padding: "14px 18px",
|
|
6975
7040
|
backgroundColor: "transparent",
|
|
6976
7041
|
border: "none",
|
|
6977
|
-
color:
|
|
7042
|
+
color: U.textPrimary,
|
|
6978
7043
|
cursor: "pointer",
|
|
6979
7044
|
transition: "all 0.2s ease",
|
|
6980
7045
|
fontSize: "13px",
|
|
@@ -6984,10 +7049,10 @@ const Ls = [
|
|
|
6984
7049
|
gap: "8px",
|
|
6985
7050
|
textAlign: "left"
|
|
6986
7051
|
},
|
|
6987
|
-
onMouseEnter: (E) => E.currentTarget.style.backgroundColor =
|
|
7052
|
+
onMouseEnter: (E) => E.currentTarget.style.backgroundColor = U.surfaceLight,
|
|
6988
7053
|
onMouseLeave: (E) => E.currentTarget.style.backgroundColor = "transparent",
|
|
6989
7054
|
children: [
|
|
6990
|
-
/* @__PURE__ */ n.jsx(
|
|
7055
|
+
/* @__PURE__ */ n.jsx(dt, { size: 14, "aria-hidden": "true" }),
|
|
6991
7056
|
"Change Password"
|
|
6992
7057
|
]
|
|
6993
7058
|
}
|
|
@@ -7018,7 +7083,7 @@ const Ls = [
|
|
|
7018
7083
|
},
|
|
7019
7084
|
onMouseLeave: (E) => E.currentTarget.style.backgroundColor = "transparent",
|
|
7020
7085
|
children: [
|
|
7021
|
-
/* @__PURE__ */ n.jsx(
|
|
7086
|
+
/* @__PURE__ */ n.jsx(ct, { size: 14, "aria-hidden": "true" }),
|
|
7022
7087
|
"Logout"
|
|
7023
7088
|
]
|
|
7024
7089
|
}
|
|
@@ -7027,7 +7092,7 @@ const Ls = [
|
|
|
7027
7092
|
"button",
|
|
7028
7093
|
{
|
|
7029
7094
|
onClick: () => {
|
|
7030
|
-
|
|
7095
|
+
D(!0), Y();
|
|
7031
7096
|
},
|
|
7032
7097
|
style: {
|
|
7033
7098
|
width: "100%",
|
|
@@ -7078,7 +7143,7 @@ const Ls = [
|
|
|
7078
7143
|
"section",
|
|
7079
7144
|
{
|
|
7080
7145
|
style: {
|
|
7081
|
-
backgroundColor:
|
|
7146
|
+
backgroundColor: U.surface,
|
|
7082
7147
|
borderRadius: "16px",
|
|
7083
7148
|
padding: "24px",
|
|
7084
7149
|
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)"
|
|
@@ -7091,7 +7156,7 @@ const Ls = [
|
|
|
7091
7156
|
fontSize: "20px",
|
|
7092
7157
|
fontWeight: 600,
|
|
7093
7158
|
margin: "0 0 24px 0",
|
|
7094
|
-
color:
|
|
7159
|
+
color: U.textSecondary,
|
|
7095
7160
|
display: "flex",
|
|
7096
7161
|
alignItems: "center",
|
|
7097
7162
|
gap: "8px"
|
|
@@ -7129,7 +7194,7 @@ const Ls = [
|
|
|
7129
7194
|
"label",
|
|
7130
7195
|
{
|
|
7131
7196
|
style: {
|
|
7132
|
-
color:
|
|
7197
|
+
color: U.textTertiary,
|
|
7133
7198
|
fontSize: "12px",
|
|
7134
7199
|
fontWeight: 500,
|
|
7135
7200
|
display: "flex",
|
|
@@ -7156,7 +7221,7 @@ const Ls = [
|
|
|
7156
7221
|
borderRadius: "8px",
|
|
7157
7222
|
border: `1px solid ${o}`,
|
|
7158
7223
|
backgroundColor: "transparent",
|
|
7159
|
-
color:
|
|
7224
|
+
color: U.textPrimary,
|
|
7160
7225
|
fontSize: "12px",
|
|
7161
7226
|
outline: "none",
|
|
7162
7227
|
transition: "border-color 0.2s ease",
|
|
@@ -7179,7 +7244,7 @@ const Ls = [
|
|
|
7179
7244
|
display: "flex",
|
|
7180
7245
|
alignItems: "center",
|
|
7181
7246
|
boxSizing: "border-box",
|
|
7182
|
-
color:
|
|
7247
|
+
color: U.textPrimary,
|
|
7183
7248
|
backgroundColor: r ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.05)"
|
|
7184
7249
|
},
|
|
7185
7250
|
children: E.value
|
|
@@ -7199,7 +7264,7 @@ const Ls = [
|
|
|
7199
7264
|
"section",
|
|
7200
7265
|
{
|
|
7201
7266
|
style: {
|
|
7202
|
-
backgroundColor:
|
|
7267
|
+
backgroundColor: U.surface,
|
|
7203
7268
|
borderRadius: "16px",
|
|
7204
7269
|
padding: "30px 24px",
|
|
7205
7270
|
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)"
|
|
@@ -7212,13 +7277,13 @@ const Ls = [
|
|
|
7212
7277
|
fontSize: "20px",
|
|
7213
7278
|
fontWeight: 600,
|
|
7214
7279
|
margin: "0 0 24px 0",
|
|
7215
|
-
color:
|
|
7280
|
+
color: U.textSecondary,
|
|
7216
7281
|
display: "flex",
|
|
7217
7282
|
alignItems: "center",
|
|
7218
7283
|
gap: "8px"
|
|
7219
7284
|
},
|
|
7220
7285
|
children: [
|
|
7221
|
-
/* @__PURE__ */ n.jsx(
|
|
7286
|
+
/* @__PURE__ */ n.jsx(cr, { size: 20, "aria-hidden": "true" }),
|
|
7222
7287
|
"Security Status"
|
|
7223
7288
|
]
|
|
7224
7289
|
}
|
|
@@ -7249,10 +7314,10 @@ const Ls = [
|
|
|
7249
7314
|
display: "flex",
|
|
7250
7315
|
alignItems: "center",
|
|
7251
7316
|
gap: "12px",
|
|
7252
|
-
color:
|
|
7317
|
+
color: U.textSecondary
|
|
7253
7318
|
},
|
|
7254
7319
|
children: [
|
|
7255
|
-
/* @__PURE__ */ n.jsx(
|
|
7320
|
+
/* @__PURE__ */ n.jsx(ce, { size: 16, "aria-hidden": "true" }),
|
|
7256
7321
|
/* @__PURE__ */ n.jsx("span", { children: "Email Verification" })
|
|
7257
7322
|
]
|
|
7258
7323
|
}
|
|
@@ -7270,16 +7335,16 @@ const Ls = [
|
|
|
7270
7335
|
gap: "6px",
|
|
7271
7336
|
...y.isVerified ? {
|
|
7272
7337
|
backgroundColor: r ? "rgba(16, 185, 129, 0.1)" : "rgba(16, 185, 129, 0.05)",
|
|
7273
|
-
color:
|
|
7338
|
+
color: U.success,
|
|
7274
7339
|
border: `1px solid ${r ? "rgba(16, 185, 129, 0.3)" : "rgba(16, 185, 129, 0.2)"}`
|
|
7275
7340
|
} : {
|
|
7276
7341
|
backgroundColor: r ? "rgba(245, 158, 11, 0.1)" : "rgba(245, 158, 11, 0.05)",
|
|
7277
|
-
color:
|
|
7342
|
+
color: U.warning,
|
|
7278
7343
|
border: `1px solid ${r ? "rgba(245, 158, 11, 0.3)" : "rgba(245, 158, 11, 0.2)"}`
|
|
7279
7344
|
}
|
|
7280
7345
|
},
|
|
7281
7346
|
children: y.isVerified ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
7282
|
-
/* @__PURE__ */ n.jsx(
|
|
7347
|
+
/* @__PURE__ */ n.jsx(de, { size: 16, "aria-hidden": "true" }),
|
|
7283
7348
|
"Verified"
|
|
7284
7349
|
] }) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
7285
7350
|
/* @__PURE__ */ n.jsx(le, { size: 16, "aria-hidden": "true" }),
|
|
@@ -7302,7 +7367,7 @@ const Ls = [
|
|
|
7302
7367
|
"p",
|
|
7303
7368
|
{
|
|
7304
7369
|
style: {
|
|
7305
|
-
color:
|
|
7370
|
+
color: U.textTertiary,
|
|
7306
7371
|
fontSize: "12px",
|
|
7307
7372
|
margin: 0
|
|
7308
7373
|
},
|
|
@@ -7326,14 +7391,14 @@ const Ls = [
|
|
|
7326
7391
|
}
|
|
7327
7392
|
),
|
|
7328
7393
|
/* @__PURE__ */ n.jsx(
|
|
7329
|
-
|
|
7394
|
+
Ms,
|
|
7330
7395
|
{
|
|
7331
7396
|
isOpen: C,
|
|
7332
7397
|
onClose: () => {
|
|
7333
|
-
|
|
7398
|
+
q(!1);
|
|
7334
7399
|
},
|
|
7335
7400
|
onUpdate: ve,
|
|
7336
|
-
colors:
|
|
7401
|
+
colors: U
|
|
7337
7402
|
}
|
|
7338
7403
|
),
|
|
7339
7404
|
/* @__PURE__ */ n.jsx(
|
|
@@ -7341,28 +7406,28 @@ const Ls = [
|
|
|
7341
7406
|
{
|
|
7342
7407
|
baseUrl: l,
|
|
7343
7408
|
apiKey: h,
|
|
7344
|
-
appId:
|
|
7409
|
+
appId: d,
|
|
7345
7410
|
userId: y.id,
|
|
7346
7411
|
isOpen: g,
|
|
7347
7412
|
onClose: () => I(!1),
|
|
7348
7413
|
onSuccess: (E) => N("success", E),
|
|
7349
7414
|
onError: (E) => N("error", E),
|
|
7350
|
-
colors:
|
|
7415
|
+
colors: U
|
|
7351
7416
|
}
|
|
7352
7417
|
),
|
|
7353
7418
|
/* @__PURE__ */ n.jsx(
|
|
7354
|
-
|
|
7419
|
+
qs,
|
|
7355
7420
|
{
|
|
7356
7421
|
baseUrl: l,
|
|
7357
7422
|
apiKey: h,
|
|
7358
|
-
appId:
|
|
7423
|
+
appId: d,
|
|
7359
7424
|
userId: y.id,
|
|
7360
7425
|
token: t,
|
|
7361
7426
|
isOpen: v,
|
|
7362
|
-
onClose: () =>
|
|
7427
|
+
onClose: () => D(!1),
|
|
7363
7428
|
onSuccess: (E) => N("success", E),
|
|
7364
7429
|
onError: (E) => N("error", E),
|
|
7365
|
-
colors:
|
|
7430
|
+
colors: U
|
|
7366
7431
|
}
|
|
7367
7432
|
),
|
|
7368
7433
|
/* @__PURE__ */ n.jsx(
|
|
@@ -7370,7 +7435,7 @@ const Ls = [
|
|
|
7370
7435
|
{
|
|
7371
7436
|
isOpen: W,
|
|
7372
7437
|
onClose: () => {
|
|
7373
|
-
F(!1), x(!1), f({ email: y?.email || "", otp: "", appId:
|
|
7438
|
+
F(!1), x(!1), f({ email: y?.email || "", otp: "", appId: d });
|
|
7374
7439
|
},
|
|
7375
7440
|
onVerify: ue,
|
|
7376
7441
|
onSendOTP: se,
|
|
@@ -7379,7 +7444,7 @@ const Ls = [
|
|
|
7379
7444
|
otpSent: S,
|
|
7380
7445
|
verifying: k,
|
|
7381
7446
|
user: y,
|
|
7382
|
-
colors:
|
|
7447
|
+
colors: U,
|
|
7383
7448
|
darkMode: r
|
|
7384
7449
|
}
|
|
7385
7450
|
),
|
|
@@ -7487,15 +7552,15 @@ const Ls = [
|
|
|
7487
7552
|
settingsUrl: l,
|
|
7488
7553
|
// Menu item visibility with defaults
|
|
7489
7554
|
showProfileMenuItem: h = !0,
|
|
7490
|
-
showSettingsMenuItem:
|
|
7555
|
+
showSettingsMenuItem: d = !0,
|
|
7491
7556
|
showViewProfileMenuItem: u = !0,
|
|
7492
7557
|
// Custom labels with defaults
|
|
7493
7558
|
profileLabel: b = "My Profile",
|
|
7494
7559
|
settingsLabel: y = "Settings",
|
|
7495
7560
|
viewProfileLabel: w = "View Profile",
|
|
7496
|
-
logoutLabel:
|
|
7561
|
+
logoutLabel: c = "Sign Out"
|
|
7497
7562
|
}) => {
|
|
7498
|
-
const { baseUrl: j, apiKey: m, appId:
|
|
7563
|
+
const { baseUrl: j, apiKey: m, appId: $ } = ge(), [R, A] = O(!1), [C, q] = O(null), [g, I] = O(!0), [v, D] = O(null), W = xt(null), F = xt(null), [V, Z] = O(!1), [T, J] = O(!1);
|
|
7499
7564
|
te(() => {
|
|
7500
7565
|
if (typeof window > "u") return;
|
|
7501
7566
|
const x = () => {
|
|
@@ -7505,24 +7570,24 @@ const Ls = [
|
|
|
7505
7570
|
}, []), te(() => {
|
|
7506
7571
|
(async () => {
|
|
7507
7572
|
try {
|
|
7508
|
-
if (I(!0),
|
|
7573
|
+
if (I(!0), D(null), a) {
|
|
7509
7574
|
if (!a.id || !a.name || !a.email)
|
|
7510
7575
|
throw new Error("Invalid user data provided");
|
|
7511
|
-
|
|
7576
|
+
q(a);
|
|
7512
7577
|
} else if (typeof window < "u") {
|
|
7513
7578
|
const k = localStorage.getItem("userInfo");
|
|
7514
7579
|
if (k)
|
|
7515
7580
|
try {
|
|
7516
|
-
const
|
|
7517
|
-
if (
|
|
7581
|
+
const _ = JSON.parse(k);
|
|
7582
|
+
if (!_.id || !_.name || !_.email)
|
|
7518
7583
|
throw new Error("Invalid stored user data");
|
|
7519
|
-
|
|
7520
|
-
} catch (
|
|
7521
|
-
console.error("Failed to parse stored user data:",
|
|
7584
|
+
q(_);
|
|
7585
|
+
} catch (_) {
|
|
7586
|
+
console.error("Failed to parse stored user data:", _), localStorage.removeItem("userInfo"), D("Invalid user data");
|
|
7522
7587
|
}
|
|
7523
7588
|
}
|
|
7524
7589
|
} catch (k) {
|
|
7525
|
-
console.error("User initialization failed:", k),
|
|
7590
|
+
console.error("User initialization failed:", k), D(k.message || "Failed to load user");
|
|
7526
7591
|
} finally {
|
|
7527
7592
|
I(!1);
|
|
7528
7593
|
}
|
|
@@ -7531,7 +7596,7 @@ const Ls = [
|
|
|
7531
7596
|
if (typeof window > "u") return;
|
|
7532
7597
|
const x = () => {
|
|
7533
7598
|
if (!R || !F.current) return;
|
|
7534
|
-
const k = F.current.getBoundingClientRect(),
|
|
7599
|
+
const k = F.current.getBoundingClientRect(), _ = window.innerWidth, N = window.innerHeight, Y = 280, se = _ - k.right, ue = k.left;
|
|
7535
7600
|
N - k.bottom;
|
|
7536
7601
|
const ve = se >= Y || se > ue;
|
|
7537
7602
|
Z(ve);
|
|
@@ -7544,11 +7609,11 @@ const Ls = [
|
|
|
7544
7609
|
W.current && !W.current.contains(N.target) && !F.current?.contains(N.target) && A(!1);
|
|
7545
7610
|
}, k = (N) => {
|
|
7546
7611
|
N.key === "Escape" && A(!1);
|
|
7547
|
-
},
|
|
7612
|
+
}, _ = () => {
|
|
7548
7613
|
R && A(!1);
|
|
7549
7614
|
};
|
|
7550
|
-
return R && (document.addEventListener("mousedown", x), document.addEventListener("keydown", k), window.addEventListener("scroll",
|
|
7551
|
-
document.removeEventListener("mousedown", x), document.removeEventListener("keydown", k), window.removeEventListener("scroll",
|
|
7615
|
+
return R && (document.addEventListener("mousedown", x), document.addEventListener("keydown", k), window.addEventListener("scroll", _)), () => {
|
|
7616
|
+
document.removeEventListener("mousedown", x), document.removeEventListener("keydown", k), window.removeEventListener("scroll", _);
|
|
7552
7617
|
};
|
|
7553
7618
|
}, [R]);
|
|
7554
7619
|
const z = t ? {
|
|
@@ -7768,15 +7833,15 @@ const Ls = [
|
|
|
7768
7833
|
transition: "background-color 0.2s ease"
|
|
7769
7834
|
}
|
|
7770
7835
|
}, K = async () => {
|
|
7771
|
-
|
|
7836
|
+
D(null), I(!0);
|
|
7772
7837
|
try {
|
|
7773
7838
|
const x = localStorage.getItem("userInfo");
|
|
7774
7839
|
if (x) {
|
|
7775
7840
|
const k = JSON.parse(x);
|
|
7776
|
-
|
|
7777
|
-
} else a &&
|
|
7841
|
+
q(k);
|
|
7842
|
+
} else a && q(a);
|
|
7778
7843
|
} catch (x) {
|
|
7779
|
-
console.error("Retry failed:", x),
|
|
7844
|
+
console.error("Retry failed:", x), D("Invalid user data"), localStorage.removeItem("userInfo"), q(null);
|
|
7780
7845
|
} finally {
|
|
7781
7846
|
I(!1);
|
|
7782
7847
|
}
|
|
@@ -7955,7 +8020,7 @@ const Ls = [
|
|
|
7955
8020
|
]
|
|
7956
8021
|
}
|
|
7957
8022
|
),
|
|
7958
|
-
|
|
8023
|
+
d && l && /* @__PURE__ */ n.jsxs(
|
|
7959
8024
|
"button",
|
|
7960
8025
|
{
|
|
7961
8026
|
style: P.menuItem,
|
|
@@ -7991,7 +8056,7 @@ const Ls = [
|
|
|
7991
8056
|
role: "menuitem",
|
|
7992
8057
|
tabIndex: 0,
|
|
7993
8058
|
children: [
|
|
7994
|
-
/* @__PURE__ */ n.jsx(
|
|
8059
|
+
/* @__PURE__ */ n.jsx(ce, { style: P.icon, "aria-hidden": "true" }),
|
|
7995
8060
|
/* @__PURE__ */ n.jsx("span", { style: P.menuItemText, children: w })
|
|
7996
8061
|
]
|
|
7997
8062
|
}
|
|
@@ -8013,13 +8078,13 @@ const Ls = [
|
|
|
8013
8078
|
tabIndex: 0,
|
|
8014
8079
|
children: [
|
|
8015
8080
|
/* @__PURE__ */ n.jsx(
|
|
8016
|
-
|
|
8081
|
+
ct,
|
|
8017
8082
|
{
|
|
8018
8083
|
style: { ...P.icon, color: z.error },
|
|
8019
8084
|
"aria-hidden": "true"
|
|
8020
8085
|
}
|
|
8021
8086
|
),
|
|
8022
|
-
/* @__PURE__ */ n.jsx("span", { style: P.menuItemText, children:
|
|
8087
|
+
/* @__PURE__ */ n.jsx("span", { style: P.menuItemText, children: c })
|
|
8023
8088
|
]
|
|
8024
8089
|
}
|
|
8025
8090
|
) })
|
|
@@ -8062,9 +8127,9 @@ const Ls = [
|
|
|
8062
8127
|
email: t?.email || "",
|
|
8063
8128
|
otp: "",
|
|
8064
8129
|
appId: a
|
|
8065
|
-
}), [
|
|
8066
|
-
let v = parseInt(g.replace("#", ""), 16),
|
|
8067
|
-
return
|
|
8130
|
+
}), [d, u] = O(!1), [b, y] = O(!1), [w, c] = O(null), j = (g, I) => {
|
|
8131
|
+
let v = parseInt(g.replace("#", ""), 16), D = (v >> 16) + I, W = (v >> 8 & 255) + I, F = (v & 255) + I;
|
|
8132
|
+
return D = Math.min(255, Math.max(0, D)), W = Math.min(255, Math.max(0, W)), F = Math.min(255, Math.max(0, F)), `#${(F | W << 8 | D << 16).toString(16).padStart(6, "0")}`;
|
|
8068
8133
|
}, m = e ? {
|
|
8069
8134
|
surface: "#09090b",
|
|
8070
8135
|
surfaceLight: "#27272a",
|
|
@@ -8091,41 +8156,41 @@ const Ls = [
|
|
|
8091
8156
|
te(() => {
|
|
8092
8157
|
t?.email && h((g) => ({ ...g, email: t.email }));
|
|
8093
8158
|
}, [t?.email]);
|
|
8094
|
-
const
|
|
8095
|
-
|
|
8159
|
+
const $ = (g, I) => {
|
|
8160
|
+
c({ type: g, message: I }), setTimeout(() => c(null), 3e3);
|
|
8096
8161
|
}, R = async () => {
|
|
8097
8162
|
if (!l.email || !/\S+@\S+\.\S+/.test(l.email)) {
|
|
8098
|
-
|
|
8163
|
+
$("error", "Please enter a valid email");
|
|
8099
8164
|
return;
|
|
8100
8165
|
}
|
|
8101
8166
|
try {
|
|
8102
8167
|
y(!0);
|
|
8103
|
-
const g = await
|
|
8168
|
+
const g = await M.post(
|
|
8104
8169
|
`${i}/users/send-verify-otp/${t?.id}`,
|
|
8105
8170
|
{ email: l.email },
|
|
8106
8171
|
{ headers: { "x-api-key": o, "x-app-id": a } }
|
|
8107
8172
|
);
|
|
8108
|
-
g.data.success ? (
|
|
8173
|
+
g.data.success ? ($("success", g.data.message || "OTP sent!"), u(!0)) : $("error", g.data.message || "Failed to send OTP");
|
|
8109
8174
|
} catch (g) {
|
|
8110
|
-
|
|
8175
|
+
$("error", g.response?.data?.message || "Server error");
|
|
8111
8176
|
} finally {
|
|
8112
8177
|
y(!1);
|
|
8113
8178
|
}
|
|
8114
8179
|
}, A = async (g) => {
|
|
8115
8180
|
if (g.preventDefault(), !l.email || !l.otp) {
|
|
8116
|
-
|
|
8181
|
+
$("error", "Please fill in all fields");
|
|
8117
8182
|
return;
|
|
8118
8183
|
}
|
|
8119
8184
|
try {
|
|
8120
8185
|
y(!0);
|
|
8121
|
-
const I = await
|
|
8186
|
+
const I = await M.post(`${i}/users/verify-email`, l);
|
|
8122
8187
|
if (I.data.success && t) {
|
|
8123
8188
|
const v = { ...t, isVerified: !0 };
|
|
8124
|
-
s?.(v),
|
|
8189
|
+
s?.(v), $("success", I.data.message || "Email verified!"), u(!1), h({ email: t.email, otp: "", appId: a });
|
|
8125
8190
|
} else
|
|
8126
|
-
|
|
8191
|
+
$("error", I.data.message || "Verification failed");
|
|
8127
8192
|
} catch (I) {
|
|
8128
|
-
|
|
8193
|
+
$("error", I.response?.data?.message || "Server error");
|
|
8129
8194
|
} finally {
|
|
8130
8195
|
y(!1);
|
|
8131
8196
|
}
|
|
@@ -8138,7 +8203,7 @@ const Ls = [
|
|
|
8138
8203
|
color: m.textPrimary,
|
|
8139
8204
|
fontSize: 14,
|
|
8140
8205
|
outline: "none"
|
|
8141
|
-
},
|
|
8206
|
+
}, q = (g = !1) => ({
|
|
8142
8207
|
flex: 1,
|
|
8143
8208
|
padding: 12,
|
|
8144
8209
|
borderRadius: 8,
|
|
@@ -8186,7 +8251,7 @@ const Ls = [
|
|
|
8186
8251
|
gap: 8
|
|
8187
8252
|
},
|
|
8188
8253
|
children: [
|
|
8189
|
-
w.type === "success" ? /* @__PURE__ */ n.jsx(
|
|
8254
|
+
w.type === "success" ? /* @__PURE__ */ n.jsx(de, { size: 16 }) : /* @__PURE__ */ n.jsx(le, { size: 16 }),
|
|
8190
8255
|
w.message
|
|
8191
8256
|
]
|
|
8192
8257
|
}
|
|
@@ -8195,7 +8260,7 @@ const Ls = [
|
|
|
8195
8260
|
/* @__PURE__ */ n.jsx("label", { style: { color: m.textSecondary }, children: "Email" }),
|
|
8196
8261
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
8197
8262
|
/* @__PURE__ */ n.jsx(
|
|
8198
|
-
|
|
8263
|
+
ce,
|
|
8199
8264
|
{
|
|
8200
8265
|
size: 18,
|
|
8201
8266
|
style: {
|
|
@@ -8221,11 +8286,11 @@ const Ls = [
|
|
|
8221
8286
|
)
|
|
8222
8287
|
] })
|
|
8223
8288
|
] }),
|
|
8224
|
-
|
|
8289
|
+
d && /* @__PURE__ */ n.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
8225
8290
|
/* @__PURE__ */ n.jsx("label", { style: { color: m.textSecondary }, children: "OTP" }),
|
|
8226
8291
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
8227
8292
|
/* @__PURE__ */ n.jsx(
|
|
8228
|
-
|
|
8293
|
+
dt,
|
|
8229
8294
|
{
|
|
8230
8295
|
size: 18,
|
|
8231
8296
|
style: {
|
|
@@ -8251,8 +8316,8 @@ const Ls = [
|
|
|
8251
8316
|
)
|
|
8252
8317
|
] })
|
|
8253
8318
|
] }),
|
|
8254
|
-
/* @__PURE__ */ n.jsx("div", { style: { display: "flex", gap: 12 }, children:
|
|
8255
|
-
b ? /* @__PURE__ */ n.jsx(ae, { size: 16, className: "spinner" }) : /* @__PURE__ */ n.jsx(
|
|
8319
|
+
/* @__PURE__ */ n.jsx("div", { style: { display: "flex", gap: 12 }, children: d ? /* @__PURE__ */ n.jsxs("button", { type: "submit", disabled: b, style: q(b), children: [
|
|
8320
|
+
b ? /* @__PURE__ */ n.jsx(ae, { size: 16, className: "spinner" }) : /* @__PURE__ */ n.jsx(de, { size: 16 }),
|
|
8256
8321
|
b ? "Verifying..." : "Verify Email"
|
|
8257
8322
|
] }) : /* @__PURE__ */ n.jsxs(
|
|
8258
8323
|
"button",
|
|
@@ -8260,7 +8325,7 @@ const Ls = [
|
|
|
8260
8325
|
type: "button",
|
|
8261
8326
|
onClick: R,
|
|
8262
8327
|
disabled: b,
|
|
8263
|
-
style:
|
|
8328
|
+
style: q(b),
|
|
8264
8329
|
children: [
|
|
8265
8330
|
b ? /* @__PURE__ */ n.jsx(ae, { size: 16, className: "spinner" }) : /* @__PURE__ */ n.jsx(ut, { size: 16 }),
|
|
8266
8331
|
b ? "Sending..." : "Send OTP"
|
|
@@ -8272,7 +8337,7 @@ const Ls = [
|
|
|
8272
8337
|
);
|
|
8273
8338
|
};
|
|
8274
8339
|
export {
|
|
8275
|
-
|
|
8340
|
+
ca as NeuctraAuthix,
|
|
8276
8341
|
ya as ReactEmailVerification,
|
|
8277
8342
|
xa as ReactSignedIn,
|
|
8278
8343
|
ha as ReactSignedOut,
|