@neuctra/authix 1.1.35 → 1.1.37
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 +959 -863
- package/dist/neuctra-authix.umd.js +50 -50
- package/dist/sdk/index.d.ts +64 -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, ze = (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,10 +31,10 @@ 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
|
-
},
|
|
37
|
-
function
|
|
36
|
+
}, Er = oe("URLSearchParams"), [kr, Cr, Tr, Ir] = ["ReadableStream", "Request", "Response", "Headers"].map(oe), Rr = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
37
|
+
function Ie(t, e, { allOwnKeys: r = !1 } = {}) {
|
|
38
38
|
if (t === null || typeof t > "u")
|
|
39
39
|
return;
|
|
40
40
|
let s, a;
|
|
@@ -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,23 +61,23 @@ 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 &&
|
|
68
|
-
|
|
66
|
+
const { caseless: t, skipUndefined: e } = Mt(this) && this || {}, r = {}, s = (a, i) => {
|
|
67
|
+
const o = t && qt(r, i) || i;
|
|
68
|
+
ze(r[o]) && ze(a) ? r[o] = Ze(r[o], a) : ze(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++)
|
|
71
|
-
arguments[a] &&
|
|
71
|
+
arguments[a] && Ie(arguments[a], s);
|
|
72
72
|
return r;
|
|
73
73
|
}
|
|
74
|
-
const Pr = (t, e, r, { allOwnKeys: s } = {}) => (
|
|
75
|
-
r && re(a) ? t[i] =
|
|
76
|
-
}, { allOwnKeys: s }), t), Or = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t),
|
|
74
|
+
const Pr = (t, e, r, { allOwnKeys: s } = {}) => (Ie(e, (a, i) => {
|
|
75
|
+
r && re(a) ? t[i] = Dt(a, r) : t[i] = a;
|
|
76
|
+
}, { allOwnKeys: s }), t), Or = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Ar = (t, e, r, s) => {
|
|
77
77
|
t.prototype = Object.create(e.prototype, s), t.prototype.constructor = t, Object.defineProperty(t, "super", {
|
|
78
78
|
value: e.prototype
|
|
79
79
|
}), r && Object.assign(t.prototype, r);
|
|
80
|
-
},
|
|
80
|
+
}, zr = (t, e, r, s) => {
|
|
81
81
|
let a, i, o;
|
|
82
82
|
const l = {};
|
|
83
83
|
if (e = e || {}, t == null) return e;
|
|
@@ -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,14 +118,14 @@ 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"), Bt = (t, e) => {
|
|
122
122
|
const r = Object.getOwnPropertyDescriptors(t), s = {};
|
|
123
|
-
|
|
123
|
+
Ie(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
|
-
},
|
|
128
|
-
|
|
127
|
+
}, Mr = (t) => {
|
|
128
|
+
Bt(t, (e, r) => {
|
|
129
129
|
if (re(t) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
|
|
130
130
|
return !1;
|
|
131
131
|
const s = t[r];
|
|
@@ -139,17 +139,17 @@ const Pr = (t, e, r, { allOwnKeys: s } = {}) => (Re(e, (a, i) => {
|
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
|
-
},
|
|
142
|
+
}, Br = (t, e) => {
|
|
143
143
|
const r = {}, s = (a) => {
|
|
144
144
|
a.forEach((i) => {
|
|
145
145
|
r[i] = !0;
|
|
146
146
|
});
|
|
147
147
|
};
|
|
148
148
|
return we(t) ? s(t) : s(String(t).split(e)), r;
|
|
149
|
-
},
|
|
149
|
+
}, Wr = () => {
|
|
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) => {
|
|
@@ -161,7 +161,7 @@ const Yr = (t) => {
|
|
|
161
161
|
if (!("toJSON" in s)) {
|
|
162
162
|
e[a] = s;
|
|
163
163
|
const i = we(s) ? [] : {};
|
|
164
|
-
return
|
|
164
|
+
return Ie(s, (o, l) => {
|
|
165
165
|
const h = r(o, a + 1);
|
|
166
166
|
!ye(h) && (i[l] = h);
|
|
167
167
|
}), e[a] = void 0, i;
|
|
@@ -170,14 +170,14 @@ const Yr = (t) => {
|
|
|
170
170
|
return s;
|
|
171
171
|
};
|
|
172
172
|
return r(t, 0);
|
|
173
|
-
}, Kr = oe("AsyncFunction"), Jr = (t) => t && (Te(t) || re(t)) && re(t.then) && re(t.catch),
|
|
173
|
+
}, Kr = oe("AsyncFunction"), Jr = (t) => t && (Te(t) || re(t)) && re(t.then) && re(t.catch), Wt = ((t, e) => t ? setImmediate : e ? ((r, s) => (fe.addEventListener("message", ({ source: a, data: i }) => {
|
|
174
174
|
a === fe && i === r && s.length && s.shift()();
|
|
175
175
|
}, !1), (a) => {
|
|
176
176
|
s.push(a), fe.postMessage(r, "*");
|
|
177
177
|
}))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
|
|
178
178
|
typeof setImmediate == "function",
|
|
179
179
|
re(fe.postMessage)
|
|
180
|
-
), Gr = typeof queueMicrotask < "u" ? queueMicrotask.bind(fe) : typeof process < "u" && process.nextTick ||
|
|
180
|
+
), Gr = typeof queueMicrotask < "u" ? queueMicrotask.bind(fe) : typeof process < "u" && process.nextTick || Wt, Xr = (t) => t != null && re(t[Fe]), p = {
|
|
181
181
|
isArray: we,
|
|
182
182
|
isArrayBuffer: Lt,
|
|
183
183
|
isBuffer: Ce,
|
|
@@ -187,53 +187,53 @@ const Yr = (t) => {
|
|
|
187
187
|
isNumber: Ft,
|
|
188
188
|
isBoolean: gr,
|
|
189
189
|
isObject: Te,
|
|
190
|
-
isPlainObject:
|
|
190
|
+
isPlainObject: ze,
|
|
191
191
|
isEmptyObject: mr,
|
|
192
|
-
isReadableStream:
|
|
192
|
+
isReadableStream: kr,
|
|
193
193
|
isRequest: Cr,
|
|
194
194
|
isResponse: Tr,
|
|
195
|
-
isHeaders:
|
|
195
|
+
isHeaders: Ir,
|
|
196
196
|
isUndefined: ye,
|
|
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
|
-
isURLSearchParams:
|
|
203
|
+
isURLSearchParams: Er,
|
|
204
204
|
isTypedArray: Nr,
|
|
205
205
|
isFileList: jr,
|
|
206
|
-
forEach:
|
|
206
|
+
forEach: Ie,
|
|
207
207
|
merge: Ze,
|
|
208
208
|
extend: Pr,
|
|
209
|
-
trim:
|
|
209
|
+
trim: Rr,
|
|
210
210
|
stripBOM: Or,
|
|
211
|
-
inherits:
|
|
212
|
-
toFlatObject:
|
|
213
|
-
kindOf:
|
|
211
|
+
inherits: Ar,
|
|
212
|
+
toFlatObject: zr,
|
|
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
|
-
reduceDescriptors:
|
|
224
|
-
freezeMethods:
|
|
225
|
-
toObjectSet:
|
|
223
|
+
reduceDescriptors: Bt,
|
|
224
|
+
freezeMethods: Mr,
|
|
225
|
+
toObjectSet: Br,
|
|
226
226
|
toCamelCase: Fr,
|
|
227
|
-
noop:
|
|
227
|
+
noop: Wr,
|
|
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,
|
|
235
235
|
isThenable: Jr,
|
|
236
|
-
setImmediate:
|
|
236
|
+
setImmediate: Wt,
|
|
237
237
|
asap: Gr,
|
|
238
238
|
isIterable: Xr
|
|
239
239
|
};
|
|
@@ -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
|
};
|
|
@@ -307,7 +307,7 @@ function Qr(t) {
|
|
|
307
307
|
const en = p.toFlatObject(p, {}, null, function(e) {
|
|
308
308
|
return /^is[A-Z]/.test(e);
|
|
309
309
|
});
|
|
310
|
-
function
|
|
310
|
+
function Be(t, e, r) {
|
|
311
311
|
if (!p.isObject(t))
|
|
312
312
|
throw new TypeError("target must be an object");
|
|
313
313
|
e = e || new FormData(), r = p.toFlatObject(r, {
|
|
@@ -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),
|
|
340
|
-
!(p.isUndefined(
|
|
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(z, C) {
|
|
340
|
+
!(p.isUndefined(z) || z === 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(z)
|
|
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($, I) {
|
|
359
|
+
(!(p.isUndefined($) || $ === null) && a.call(
|
|
360
360
|
e,
|
|
361
|
-
|
|
362
|
-
p.isString(
|
|
361
|
+
$,
|
|
362
|
+
p.isString(I) ? I.trim() : I,
|
|
363
363
|
j,
|
|
364
364
|
y
|
|
365
|
-
)) === !0 && w(
|
|
365
|
+
)) === !0 && w($, j ? j.concat(I) : [I]);
|
|
366
366
|
}), b.pop();
|
|
367
367
|
}
|
|
368
368
|
}
|
|
@@ -385,7 +385,7 @@ function mt(t) {
|
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
387
|
function at(t, e) {
|
|
388
|
-
this._pairs = [], t &&
|
|
388
|
+
this._pairs = [], t && Be(t, this, e);
|
|
389
389
|
}
|
|
390
390
|
const Kt = at.prototype;
|
|
391
391
|
Kt.append = function(e, r) {
|
|
@@ -484,19 +484,19 @@ 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) {
|
|
499
|
-
return
|
|
499
|
+
return Be(t, new ee.classes.URLSearchParams(), {
|
|
500
500
|
visitor: function(r, s, a, i) {
|
|
501
501
|
return ee.isNode && p.isBuffer(r) ? (this.append(s, r.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
502
502
|
},
|
|
@@ -540,7 +540,7 @@ function xn(t, e, r) {
|
|
|
540
540
|
}
|
|
541
541
|
return (r || JSON.stringify)(t);
|
|
542
542
|
}
|
|
543
|
-
const
|
|
543
|
+
const Re = {
|
|
544
544
|
transitional: Gt,
|
|
545
545
|
adapter: ["xhr", "http", "fetch"],
|
|
546
546
|
transformRequest: [function(e, r) {
|
|
@@ -559,7 +559,7 @@ const Ie = {
|
|
|
559
559
|
return un(e, this.formSerializer).toString();
|
|
560
560
|
if ((l = p.isFileList(e)) || s.indexOf("multipart/form-data") > -1) {
|
|
561
561
|
const h = this.env && this.env.FormData;
|
|
562
|
-
return
|
|
562
|
+
return Be(
|
|
563
563
|
l ? { "files[]": e } : e,
|
|
564
564
|
h && new h(),
|
|
565
565
|
this.formSerializer
|
|
@@ -569,7 +569,7 @@ const Ie = {
|
|
|
569
569
|
return i || a ? (r.setContentType("application/json", !1), xn(e)) : e;
|
|
570
570
|
}],
|
|
571
571
|
transformResponse: [function(e) {
|
|
572
|
-
const r = this.transitional ||
|
|
572
|
+
const r = this.transitional || Re.transitional, s = r && r.forcedJSONParsing, a = this.responseType === "json";
|
|
573
573
|
if (p.isResponse(e) || p.isReadableStream(e))
|
|
574
574
|
return e;
|
|
575
575
|
if (e && p.isString(e) && (s && !this.responseType || a)) {
|
|
@@ -607,7 +607,7 @@ const Ie = {
|
|
|
607
607
|
}
|
|
608
608
|
};
|
|
609
609
|
p.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
|
|
610
|
-
|
|
610
|
+
Re.headers[t] = {};
|
|
611
611
|
});
|
|
612
612
|
const hn = p.toObjectSet([
|
|
613
613
|
"age",
|
|
@@ -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) {
|
|
@@ -811,7 +811,7 @@ p.reduceDescriptors(ne.prototype, ({ value: t }, e) => {
|
|
|
811
811
|
});
|
|
812
812
|
p.freezeMethods(ne);
|
|
813
813
|
function Ke(t, e) {
|
|
814
|
-
const r = this ||
|
|
814
|
+
const r = this || Re, s = e || r, a = ne.from(s.headers);
|
|
815
815
|
let i = s.data;
|
|
816
816
|
return p.forEach(t, function(l) {
|
|
817
817
|
i = l.call(r, i, a.normalize(), e ? e.status : void 0);
|
|
@@ -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
|
|
@@ -894,10 +894,10 @@ const De = (t, e, r = 3) => {
|
|
|
894
894
|
total: t,
|
|
895
895
|
loaded: s
|
|
896
896
|
}), e[1]];
|
|
897
|
-
}, jt = (t) => (...e) => p.asap(() => t(...e)),
|
|
897
|
+
}, jt = (t) => (...e) => p.asap(() => t(...e)), En = ee.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (r) => (r = new URL(r, ee.origin), t.protocol === r.protocol && t.host === r.host && (e || t.port === r.port)))(
|
|
898
898
|
new URL(ee.origin),
|
|
899
899
|
ee.navigator && /(msie|trident)/i.test(ee.navigator.userAgent)
|
|
900
|
-
) : () => !0,
|
|
900
|
+
) : () => !0, kn = ee.hasStandardBrowserEnv ? (
|
|
901
901
|
// Standard browser envs support document.cookie
|
|
902
902
|
{
|
|
903
903
|
write(t, e, r, s, a, i) {
|
|
@@ -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,71 +1009,71 @@ 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
|
}
|
|
1018
|
-
if (ee.hasStandardBrowserEnv && (s && p.isFunction(s) && (s = s(e)), s || s !== !1 &&
|
|
1019
|
-
const h = a && i &&
|
|
1018
|
+
if (ee.hasStandardBrowserEnv && (s && p.isFunction(s) && (s = s(e)), s || s !== !1 && En(e.url))) {
|
|
1019
|
+
const h = a && i && kn.read(i);
|
|
1020
1020
|
h && o.set(a, h);
|
|
1021
1021
|
}
|
|
1022
1022
|
return e;
|
|
1023
|
-
},
|
|
1023
|
+
}, In = typeof XMLHttpRequest < "u", Rn = In && function(t) {
|
|
1024
1024
|
return new Promise(function(r, s) {
|
|
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
|
-
const
|
|
1037
|
+
const z = 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,
|
|
1043
|
-
headers:
|
|
1043
|
+
headers: z,
|
|
1044
1044
|
config: t,
|
|
1045
1045
|
request: m
|
|
1046
1046
|
};
|
|
1047
|
-
Qt(function(
|
|
1048
|
-
r(
|
|
1049
|
-
}, function(
|
|
1050
|
-
s(
|
|
1051
|
-
},
|
|
1047
|
+
Qt(function(R) {
|
|
1048
|
+
r(R), j();
|
|
1049
|
+
}, function(R) {
|
|
1050
|
+
s(R), j();
|
|
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),
|
|
1072
|
-
m && (s(!
|
|
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 = (z) => {
|
|
1072
|
+
m && (s(!z || z.type ? new je(null, t, m) : z), m.abort(), m = null);
|
|
1073
1073
|
}, a.cancelToken && a.cancelToken.subscribe(u), a.signal && (a.signal.aborted ? u() : a.signal.addEventListener("abort", u)));
|
|
1074
|
-
const
|
|
1075
|
-
if (
|
|
1076
|
-
s(new L("Unsupported protocol " +
|
|
1074
|
+
const I = jn(a.url);
|
|
1075
|
+
if (I && ee.protocols.indexOf(I) === -1) {
|
|
1076
|
+
s(new L("Unsupported protocol " + I + ":", L.ERR_BAD_REQUEST, t));
|
|
1077
1077
|
return;
|
|
1078
1078
|
}
|
|
1079
1079
|
m.send(i || null);
|
|
@@ -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
|
}
|
|
@@ -1110,10 +1110,10 @@ const tr = (t) => {
|
|
|
1110
1110
|
let s = 0, a;
|
|
1111
1111
|
for (; s < r; )
|
|
1112
1112
|
a = s + e, yield t.slice(s, a), s = a;
|
|
1113
|
-
},
|
|
1114
|
-
for await (const r of
|
|
1113
|
+
}, An = async function* (t, e) {
|
|
1114
|
+
for await (const r of zn(t))
|
|
1115
1115
|
yield* On(r, e);
|
|
1116
|
-
},
|
|
1116
|
+
}, zn = async function* (t) {
|
|
1117
1117
|
if (t[Symbol.asyncIterator]) {
|
|
1118
1118
|
yield* t;
|
|
1119
1119
|
return;
|
|
@@ -1130,15 +1130,15 @@ const tr = (t) => {
|
|
|
1130
1130
|
await e.cancel();
|
|
1131
1131
|
}
|
|
1132
1132
|
}, St = (t, e, r, s) => {
|
|
1133
|
-
const a =
|
|
1133
|
+
const a = An(t, e);
|
|
1134
1134
|
let i = 0, o, l = (h) => {
|
|
1135
1135
|
o || (o = !0, s && s(h));
|
|
1136
1136
|
};
|
|
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,11 +1158,11 @@ const tr = (t) => {
|
|
|
1158
1158
|
}, {
|
|
1159
1159
|
highWaterMark: 2
|
|
1160
1160
|
});
|
|
1161
|
-
},
|
|
1161
|
+
}, Et = 64 * 1024, { isFunction: Oe } = p, $n = (({ Request: t, Response: e }) => ({
|
|
1162
1162
|
Request: t,
|
|
1163
1163
|
Response: e
|
|
1164
1164
|
}))(p.global), {
|
|
1165
|
-
ReadableStream:
|
|
1165
|
+
ReadableStream: kt,
|
|
1166
1166
|
TextEncoder: Ct
|
|
1167
1167
|
} = p.global, Tt = (t, ...e) => {
|
|
1168
1168
|
try {
|
|
@@ -1170,136 +1170,136 @@ 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(
|
|
1181
|
-
let
|
|
1180
|
+
const l = a && Oe(kt), 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
|
-
body: new
|
|
1183
|
+
body: new kt(),
|
|
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:
|
|
1224
|
-
signal:
|
|
1225
|
-
cancelToken:
|
|
1223
|
+
data: $,
|
|
1224
|
+
signal: I,
|
|
1225
|
+
cancelToken: z,
|
|
1226
1226
|
timeout: C,
|
|
1227
|
-
onDownloadProgress:
|
|
1227
|
+
onDownloadProgress: q,
|
|
1228
1228
|
onUploadProgress: g,
|
|
1229
|
-
responseType:
|
|
1229
|
+
responseType: R,
|
|
1230
1230
|
headers: v,
|
|
1231
|
-
withCredentials:
|
|
1232
|
-
fetchOptions:
|
|
1233
|
-
} = tr(
|
|
1234
|
-
|
|
1235
|
-
let V = Pn([
|
|
1231
|
+
withCredentials: D = "same-origin",
|
|
1232
|
+
fetchOptions: B
|
|
1233
|
+
} = tr(c), F = e || fetch;
|
|
1234
|
+
R = R ? (R + "").toLowerCase() : "text";
|
|
1235
|
+
let V = Pn([I, z && z.toAbortSignal()], C), Z = null;
|
|
1236
1236
|
const T = V && V.unsubscribe && (() => {
|
|
1237
1237
|
V.unsubscribe();
|
|
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(
|
|
1248
|
-
const [x,
|
|
1247
|
+
if (p.isFormData($) && (S = f.headers.get("content-type")) && v.setContentType(S), f.body) {
|
|
1248
|
+
const [x, E] = wt(
|
|
1249
1249
|
J,
|
|
1250
|
-
|
|
1250
|
+
Ue(jt(g))
|
|
1251
1251
|
);
|
|
1252
|
-
|
|
1252
|
+
$ = St(f.body, Et, x, E);
|
|
1253
1253
|
}
|
|
1254
1254
|
}
|
|
1255
|
-
p.isString(
|
|
1256
|
-
const
|
|
1257
|
-
...
|
|
1255
|
+
p.isString(D) || (D = D ? "include" : "omit");
|
|
1256
|
+
const A = i && "credentials" in r.prototype, P = {
|
|
1257
|
+
...B,
|
|
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:
|
|
1263
|
+
credentials: A ? D : void 0
|
|
1264
1264
|
};
|
|
1265
1265
|
Z = i && new r(j, P);
|
|
1266
|
-
let K = await (i ? F(Z,
|
|
1267
|
-
const Q = u && (
|
|
1268
|
-
if (u && (
|
|
1266
|
+
let K = await (i ? F(Z, B) : F(j, P));
|
|
1267
|
+
const Q = u && (R === "stream" || R === "response");
|
|
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,
|
|
1273
|
+
const S = p.toFiniteNumber(K.headers.get("content-length")), [x, E] = q && wt(
|
|
1274
1274
|
S,
|
|
1275
|
-
|
|
1275
|
+
Ue(jt(q), !0)
|
|
1276
1276
|
) || [];
|
|
1277
1277
|
K = new s(
|
|
1278
|
-
St(K.body,
|
|
1279
|
-
|
|
1278
|
+
St(K.body, Et, x, () => {
|
|
1279
|
+
E && E(), T && T();
|
|
1280
1280
|
}),
|
|
1281
1281
|
f
|
|
1282
1282
|
);
|
|
1283
1283
|
}
|
|
1284
|
-
|
|
1285
|
-
let G = await b[p.findKey(b,
|
|
1284
|
+
R = R || "text";
|
|
1285
|
+
let G = await b[p.findKey(b, R) || "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
|
-
} catch (
|
|
1297
|
-
throw T && T(),
|
|
1298
|
-
new L("Network Error", L.ERR_NETWORK,
|
|
1296
|
+
} catch (A) {
|
|
1297
|
+
throw T && T(), A && A.name === "TypeError" && /Load failed|fetch/i.test(A.message) ? Object.assign(
|
|
1298
|
+
new L("Network Error", L.ERR_NETWORK, c, Z),
|
|
1299
1299
|
{
|
|
1300
|
-
cause:
|
|
1300
|
+
cause: A.cause || A
|
|
1301
1301
|
}
|
|
1302
|
-
) : L.from(
|
|
1302
|
+
) : L.from(A, A && A.code, c, Z);
|
|
1303
1303
|
}
|
|
1304
1304
|
};
|
|
1305
1305
|
}, Nn = /* @__PURE__ */ new Map(), rr = (t) => {
|
|
@@ -1309,15 +1309,15 @@ 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 = {
|
|
1319
1319
|
http: Zr,
|
|
1320
|
-
xhr:
|
|
1320
|
+
xhr: Rn,
|
|
1321
1321
|
fetch: {
|
|
1322
1322
|
get: rr
|
|
1323
1323
|
}
|
|
@@ -1331,7 +1331,7 @@ p.forEach(tt, (t, e) => {
|
|
|
1331
1331
|
Object.defineProperty(t, "adapterName", { value: e });
|
|
1332
1332
|
}
|
|
1333
1333
|
});
|
|
1334
|
-
const
|
|
1334
|
+
const It = (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,11 +1348,11 @@ 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
|
-
` + o.map(
|
|
1355
|
-
`) : " " +
|
|
1354
|
+
` + o.map(It).join(`
|
|
1355
|
+
`) : " " + It(o[0]) : "as no adapter specified";
|
|
1356
1356
|
throw new L(
|
|
1357
1357
|
"There is no suitable adapter to dispatch the request " + l,
|
|
1358
1358
|
"ERR_NOT_SUPPORT"
|
|
@@ -1366,11 +1366,11 @@ function Je(t) {
|
|
|
1366
1366
|
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
|
|
1367
1367
|
throw new je(null, t);
|
|
1368
1368
|
}
|
|
1369
|
-
function
|
|
1369
|
+
function Rt(t) {
|
|
1370
1370
|
return Je(t), t.headers = ne.from(t.headers), t.data = Ke.call(
|
|
1371
1371
|
t,
|
|
1372
1372
|
t.transformRequest
|
|
1373
|
-
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), nr.getAdapter(t.adapter ||
|
|
1373
|
+
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), nr.getAdapter(t.adapter || Re.adapter, t)(t).then(function(s) {
|
|
1374
1374
|
return Je(t), s.data = Ke.call(
|
|
1375
1375
|
t,
|
|
1376
1376
|
t.transformResponse,
|
|
@@ -1384,14 +1384,14 @@ function It(t) {
|
|
|
1384
1384
|
), s.response.headers = ne.from(s.response.headers))), Promise.reject(s);
|
|
1385
1385
|
});
|
|
1386
1386
|
}
|
|
1387
|
-
const sr = "1.12.2",
|
|
1387
|
+
const sr = "1.12.2", We = {};
|
|
1388
1388
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
|
|
1389
|
-
|
|
1389
|
+
We[t] = function(s) {
|
|
1390
1390
|
return typeof s === t || "a" + (e < 1 ? "n " : " ") + t;
|
|
1391
1391
|
};
|
|
1392
1392
|
});
|
|
1393
1393
|
const Pt = {};
|
|
1394
|
-
|
|
1394
|
+
We.transitional = function(e, r, s) {
|
|
1395
1395
|
function a(i, o) {
|
|
1396
1396
|
return "[Axios v" + sr + "] Transitional option '" + i + "'" + o + (s ? ". " + s : "");
|
|
1397
1397
|
}
|
|
@@ -1409,10 +1409,10 @@ Be.transitional = function(e, r, s) {
|
|
|
1409
1409
|
)), e ? e(i, o, l) : !0;
|
|
1410
1410
|
};
|
|
1411
1411
|
};
|
|
1412
|
-
|
|
1412
|
+
We.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:
|
|
1434
|
-
validators:
|
|
1435
|
-
}, ie =
|
|
1432
|
+
const _e = {
|
|
1433
|
+
assertOptions: Un,
|
|
1434
|
+
validators: We
|
|
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,35 +1496,35 @@ 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 = [Rt.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;
|
|
1519
1519
|
}
|
|
1520
1520
|
}
|
|
1521
1521
|
try {
|
|
1522
|
-
u =
|
|
1523
|
-
} catch (
|
|
1524
|
-
return Promise.reject(
|
|
1522
|
+
u = Rt.call(this, w);
|
|
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(Re);
|
|
1716
|
+
M.Axios = xe;
|
|
1717
|
+
M.CanceledError = je;
|
|
1718
|
+
M.CancelToken = Ln;
|
|
1719
|
+
M.isCancel = Zt;
|
|
1720
|
+
M.VERSION = sr;
|
|
1721
|
+
M.toFormData = Be;
|
|
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",
|
|
@@ -1982,7 +1982,10 @@ class da {
|
|
|
1982
1982
|
if (!r)
|
|
1983
1983
|
throw new Error("searchUserDataByKeys: 'userId' is required");
|
|
1984
1984
|
const a = new URLSearchParams(
|
|
1985
|
-
Object.entries(s).reduce(
|
|
1985
|
+
Object.entries(s).reduce(
|
|
1986
|
+
(i, [o, l]) => (l != null && (i[o] = String(l)), i),
|
|
1987
|
+
{}
|
|
1988
|
+
)
|
|
1986
1989
|
).toString();
|
|
1987
1990
|
return this.request("GET", `/users/${r}/data/searchbyref?${a}`);
|
|
1988
1991
|
}
|
|
@@ -2004,7 +2007,10 @@ class da {
|
|
|
2004
2007
|
"searchAllUsersDataByKeys: 'appId' is required on SDK initialization"
|
|
2005
2008
|
);
|
|
2006
2009
|
const s = new URLSearchParams(
|
|
2007
|
-
Object.entries(e).reduce(
|
|
2010
|
+
Object.entries(e).reduce(
|
|
2011
|
+
(a, [i, o]) => (o != null && (a[i] = String(o)), a),
|
|
2012
|
+
{}
|
|
2013
|
+
)
|
|
2008
2014
|
).toString();
|
|
2009
2015
|
return this.request(
|
|
2010
2016
|
"GET",
|
|
@@ -2075,8 +2081,98 @@ class da {
|
|
|
2075
2081
|
throw new Error("deleteUserData: 'userId' and 'dataId' are required");
|
|
2076
2082
|
return this.request("DELETE", `/users/${r}/data/${s}`);
|
|
2077
2083
|
}
|
|
2084
|
+
// ================= APP DATA =================
|
|
2085
|
+
/**
|
|
2086
|
+
* Get all app data items for the current app
|
|
2087
|
+
* @param category optional filter by dataCategory
|
|
2088
|
+
*/
|
|
2089
|
+
async getAppData(e) {
|
|
2090
|
+
const r = this.appId;
|
|
2091
|
+
if (!r) throw new Error("getAppData: 'appId' is required");
|
|
2092
|
+
const s = e ? `?category=${encodeURIComponent(e)}` : "";
|
|
2093
|
+
return this.request("GET", `/app/${r}/data${s}`);
|
|
2094
|
+
}
|
|
2095
|
+
/**
|
|
2096
|
+
* Get a single data item from app.appData[] by id
|
|
2097
|
+
*/
|
|
2098
|
+
async getSingleAppData(e) {
|
|
2099
|
+
const r = this.appId;
|
|
2100
|
+
if (!r) throw new Error("getSingleAppData: 'appId' is required");
|
|
2101
|
+
if (!e.dataId)
|
|
2102
|
+
throw new Error("getSingleAppData: 'dataId' is required");
|
|
2103
|
+
return this.request(
|
|
2104
|
+
"GET",
|
|
2105
|
+
`/app/${r}/data/${e.dataId}`
|
|
2106
|
+
);
|
|
2107
|
+
}
|
|
2108
|
+
/**
|
|
2109
|
+
* 🔍 Search app data items by dynamic keys
|
|
2110
|
+
* @example
|
|
2111
|
+
* sdk.searchAppDataByKeys({
|
|
2112
|
+
* dataCategory: "orders",
|
|
2113
|
+
* shopId: 12,
|
|
2114
|
+
* status: "active",
|
|
2115
|
+
* productId: "abc123"
|
|
2116
|
+
* })
|
|
2117
|
+
*/
|
|
2118
|
+
async searchAppDataByKeys(e) {
|
|
2119
|
+
const r = this.appId;
|
|
2120
|
+
if (!r)
|
|
2121
|
+
throw new Error("searchAppDataByKeys: 'appId' is required in SDK config");
|
|
2122
|
+
const s = new URLSearchParams(
|
|
2123
|
+
Object.entries(e).reduce(
|
|
2124
|
+
(a, [i, o]) => (o != null && (a[i] = String(o)), a),
|
|
2125
|
+
{}
|
|
2126
|
+
)
|
|
2127
|
+
).toString();
|
|
2128
|
+
return this.request(
|
|
2129
|
+
"GET",
|
|
2130
|
+
`/app/${encodeURIComponent(r)}/data/searchByKeys${s ? `?${s}` : ""}`
|
|
2131
|
+
);
|
|
2132
|
+
}
|
|
2133
|
+
/**
|
|
2134
|
+
* Add a new item to app.appData[] under a specific category
|
|
2135
|
+
*/
|
|
2136
|
+
async addAppData(e) {
|
|
2137
|
+
const r = this.appId;
|
|
2138
|
+
if (!r) throw new Error("addAppData: 'appId' is required");
|
|
2139
|
+
if (!e.dataCategory)
|
|
2140
|
+
throw new Error("addAppData: 'dataCategory' is required");
|
|
2141
|
+
if (!e.data) throw new Error("addAppData: 'data' is required");
|
|
2142
|
+
return this.request(
|
|
2143
|
+
"POST",
|
|
2144
|
+
`/app/${r}/data/${encodeURIComponent(e.dataCategory)}`,
|
|
2145
|
+
e.data
|
|
2146
|
+
);
|
|
2147
|
+
}
|
|
2148
|
+
/**
|
|
2149
|
+
* Update an item in app.appData[] by id
|
|
2150
|
+
*/
|
|
2151
|
+
async updateAppData(e) {
|
|
2152
|
+
const r = this.appId;
|
|
2153
|
+
if (!r) throw new Error("updateAppData: 'appId' is required");
|
|
2154
|
+
if (!e.dataId) throw new Error("updateAppData: 'dataId' is required");
|
|
2155
|
+
if (!e.data) throw new Error("updateAppData: 'data' is required");
|
|
2156
|
+
return this.request(
|
|
2157
|
+
"PATCH",
|
|
2158
|
+
`/app/${r}/data/${e.dataId}`,
|
|
2159
|
+
e.data
|
|
2160
|
+
);
|
|
2161
|
+
}
|
|
2162
|
+
/**
|
|
2163
|
+
* Delete an item from app.appData[] by id
|
|
2164
|
+
*/
|
|
2165
|
+
async deleteAppData(e) {
|
|
2166
|
+
const r = this.appId;
|
|
2167
|
+
if (!r) throw new Error("deleteAppData: 'appId' is required");
|
|
2168
|
+
if (!e.dataId) throw new Error("deleteAppData: 'dataId' is required");
|
|
2169
|
+
return this.request(
|
|
2170
|
+
"DELETE",
|
|
2171
|
+
`/app/${r}/data/${e.dataId}`
|
|
2172
|
+
);
|
|
2173
|
+
}
|
|
2078
2174
|
}
|
|
2079
|
-
var
|
|
2175
|
+
var Ae = { exports: {} }, Ee = {};
|
|
2080
2176
|
/**
|
|
2081
2177
|
* @license React
|
|
2082
2178
|
* react-jsx-runtime.production.js
|
|
@@ -2087,8 +2183,8 @@ var ze = { exports: {} }, ke = {};
|
|
|
2087
2183
|
* LICENSE file in the root directory of this source tree.
|
|
2088
2184
|
*/
|
|
2089
2185
|
var Ot;
|
|
2090
|
-
function
|
|
2091
|
-
if (Ot) return
|
|
2186
|
+
function Mn() {
|
|
2187
|
+
if (Ot) return Ee;
|
|
2092
2188
|
Ot = 1;
|
|
2093
2189
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
2094
2190
|
function r(s, a, i) {
|
|
@@ -2106,9 +2202,9 @@ function qn() {
|
|
|
2106
2202
|
props: i
|
|
2107
2203
|
};
|
|
2108
2204
|
}
|
|
2109
|
-
return
|
|
2205
|
+
return Ee.Fragment = e, Ee.jsx = r, Ee.jsxs = r, Ee;
|
|
2110
2206
|
}
|
|
2111
|
-
var
|
|
2207
|
+
var ke = {};
|
|
2112
2208
|
/**
|
|
2113
2209
|
* @license React
|
|
2114
2210
|
* react-jsx-runtime.development.js
|
|
@@ -2118,9 +2214,9 @@ var Ee = {};
|
|
|
2118
2214
|
* This source code is licensed under the MIT license found in the
|
|
2119
2215
|
* LICENSE file in the root directory of this source tree.
|
|
2120
2216
|
*/
|
|
2121
|
-
var
|
|
2122
|
-
function
|
|
2123
|
-
return
|
|
2217
|
+
var At;
|
|
2218
|
+
function Bn() {
|
|
2219
|
+
return At || (At = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
2124
2220
|
function t(f) {
|
|
2125
2221
|
if (f == null) return null;
|
|
2126
2222
|
if (typeof f == "function")
|
|
@@ -2129,15 +2225,15 @@ function Wn() {
|
|
|
2129
2225
|
switch (f) {
|
|
2130
2226
|
case m:
|
|
2131
2227
|
return "Fragment";
|
|
2132
|
-
case
|
|
2228
|
+
case I:
|
|
2133
2229
|
return "Profiler";
|
|
2134
|
-
case
|
|
2230
|
+
case $:
|
|
2135
2231
|
return "StrictMode";
|
|
2136
2232
|
case g:
|
|
2137
2233
|
return "Suspense";
|
|
2138
|
-
case
|
|
2234
|
+
case R:
|
|
2139
2235
|
return "SuspenseList";
|
|
2140
|
-
case
|
|
2236
|
+
case B:
|
|
2141
2237
|
return "Activity";
|
|
2142
2238
|
}
|
|
2143
2239
|
if (typeof f == "object")
|
|
@@ -2148,14 +2244,14 @@ function Wn() {
|
|
|
2148
2244
|
return "Portal";
|
|
2149
2245
|
case C:
|
|
2150
2246
|
return f.displayName || "Context";
|
|
2151
|
-
case
|
|
2247
|
+
case z:
|
|
2152
2248
|
return (f._context.displayName || "Context") + ".Consumer";
|
|
2153
|
-
case
|
|
2249
|
+
case q:
|
|
2154
2250
|
var S = f.render;
|
|
2155
2251
|
return f = f.displayName, f || (f = S.displayName || S.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
|
|
2156
2252
|
case v:
|
|
2157
2253
|
return S = f.displayName || null, S !== null ? S : t(f.type) || "Memo";
|
|
2158
|
-
case
|
|
2254
|
+
case D:
|
|
2159
2255
|
S = f._payload, f = f._init;
|
|
2160
2256
|
try {
|
|
2161
2257
|
return t(f(S));
|
|
@@ -2176,17 +2272,17 @@ function Wn() {
|
|
|
2176
2272
|
}
|
|
2177
2273
|
if (S) {
|
|
2178
2274
|
S = console;
|
|
2179
|
-
var x = S.error,
|
|
2275
|
+
var x = S.error, E = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
|
|
2180
2276
|
return x.call(
|
|
2181
2277
|
S,
|
|
2182
2278
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
2183
|
-
|
|
2279
|
+
E
|
|
2184
2280
|
), e(f);
|
|
2185
2281
|
}
|
|
2186
2282
|
}
|
|
2187
2283
|
function s(f) {
|
|
2188
2284
|
if (f === m) return "<>";
|
|
2189
|
-
if (typeof f == "object" && f !== null && f.$$typeof ===
|
|
2285
|
+
if (typeof f == "object" && f !== null && f.$$typeof === D)
|
|
2190
2286
|
return "<...>";
|
|
2191
2287
|
try {
|
|
2192
2288
|
var S = t(f);
|
|
@@ -2211,7 +2307,7 @@ function Wn() {
|
|
|
2211
2307
|
}
|
|
2212
2308
|
function l(f, S) {
|
|
2213
2309
|
function x() {
|
|
2214
|
-
|
|
2310
|
+
A || (A = !0, console.error(
|
|
2215
2311
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
2216
2312
|
S
|
|
2217
2313
|
));
|
|
@@ -2227,14 +2323,14 @@ function Wn() {
|
|
|
2227
2323
|
"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
2324
|
)), f = this.props.ref, f !== void 0 ? f : null;
|
|
2229
2325
|
}
|
|
2230
|
-
function
|
|
2326
|
+
function d(f, S, x, E, _, N) {
|
|
2231
2327
|
var Y = x.ref;
|
|
2232
2328
|
return f = {
|
|
2233
|
-
$$typeof:
|
|
2329
|
+
$$typeof: c,
|
|
2234
2330
|
type: f,
|
|
2235
2331
|
key: S,
|
|
2236
2332
|
props: x,
|
|
2237
|
-
_owner:
|
|
2333
|
+
_owner: E
|
|
2238
2334
|
}, (Y !== void 0 ? Y : null) !== null ? Object.defineProperty(f, "ref", {
|
|
2239
2335
|
enumerable: !1,
|
|
2240
2336
|
get: h
|
|
@@ -2252,7 +2348,7 @@ function Wn() {
|
|
|
2252
2348
|
configurable: !1,
|
|
2253
2349
|
enumerable: !1,
|
|
2254
2350
|
writable: !0,
|
|
2255
|
-
value:
|
|
2351
|
+
value: _
|
|
2256
2352
|
}), Object.defineProperty(f, "_debugTask", {
|
|
2257
2353
|
configurable: !1,
|
|
2258
2354
|
enumerable: !1,
|
|
@@ -2260,13 +2356,13 @@ function Wn() {
|
|
|
2260
2356
|
value: N
|
|
2261
2357
|
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
2262
2358
|
}
|
|
2263
|
-
function u(f, S, x,
|
|
2359
|
+
function u(f, S, x, E, _, N) {
|
|
2264
2360
|
var Y = S.children;
|
|
2265
2361
|
if (Y !== void 0)
|
|
2266
|
-
if (
|
|
2362
|
+
if (E)
|
|
2267
2363
|
if (T(Y)) {
|
|
2268
|
-
for (
|
|
2269
|
-
b(Y[
|
|
2364
|
+
for (E = 0; E < Y.length; E++)
|
|
2365
|
+
b(Y[E]);
|
|
2270
2366
|
Object.freeze && Object.freeze(Y);
|
|
2271
2367
|
} else
|
|
2272
2368
|
console.error(
|
|
@@ -2278,18 +2374,18 @@ function Wn() {
|
|
|
2278
2374
|
var se = Object.keys(S).filter(function(ve) {
|
|
2279
2375
|
return ve !== "key";
|
|
2280
2376
|
});
|
|
2281
|
-
|
|
2377
|
+
E = 0 < se.length ? "{key: someKey, " + se.join(": ..., ") + ": ...}" : "{key: someKey}", G[Y + E] || (se = 0 < se.length ? "{" + se.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
2282
2378
|
`A props object containing a "key" prop is being spread into JSX:
|
|
2283
2379
|
let props = %s;
|
|
2284
2380
|
<%s {...props} />
|
|
2285
2381
|
React keys must be passed directly to JSX without using spread:
|
|
2286
2382
|
let props = %s;
|
|
2287
2383
|
<%s key={someKey} {...props} />`,
|
|
2288
|
-
|
|
2384
|
+
E,
|
|
2289
2385
|
Y,
|
|
2290
2386
|
se,
|
|
2291
2387
|
Y
|
|
2292
|
-
), G[Y +
|
|
2388
|
+
), G[Y + E] = !0);
|
|
2293
2389
|
}
|
|
2294
2390
|
if (Y = null, x !== void 0 && (r(x), Y = "" + x), o(S) && (r(S.key), Y = "" + S.key), "key" in S) {
|
|
2295
2391
|
x = {};
|
|
@@ -2299,22 +2395,22 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2299
2395
|
return Y && l(
|
|
2300
2396
|
x,
|
|
2301
2397
|
typeof f == "function" ? f.displayName || f.name || "Unknown" : f
|
|
2302
|
-
),
|
|
2398
|
+
), d(
|
|
2303
2399
|
f,
|
|
2304
2400
|
Y,
|
|
2305
2401
|
x,
|
|
2306
2402
|
a(),
|
|
2307
|
-
|
|
2403
|
+
_,
|
|
2308
2404
|
N
|
|
2309
2405
|
);
|
|
2310
2406
|
}
|
|
2311
2407
|
function b(f) {
|
|
2312
|
-
y(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof ===
|
|
2408
|
+
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
2409
|
}
|
|
2314
2410
|
function y(f) {
|
|
2315
|
-
return typeof f == "object" && f !== null && f.$$typeof ===
|
|
2411
|
+
return typeof f == "object" && f !== null && f.$$typeof === c;
|
|
2316
2412
|
}
|
|
2317
|
-
var w = Le,
|
|
2413
|
+
var w = Le, c = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), I = Symbol.for("react.profiler"), z = Symbol.for("react.consumer"), C = Symbol.for("react.context"), q = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), R = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), B = 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
2414
|
return null;
|
|
2319
2415
|
};
|
|
2320
2416
|
w = {
|
|
@@ -2322,46 +2418,46 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2322
2418
|
return f();
|
|
2323
2419
|
}
|
|
2324
2420
|
};
|
|
2325
|
-
var
|
|
2421
|
+
var A, P = {}, K = w.react_stack_bottom_frame.bind(
|
|
2326
2422
|
w,
|
|
2327
2423
|
i
|
|
2328
2424
|
)(), Q = J(s(i)), G = {};
|
|
2329
|
-
|
|
2330
|
-
var
|
|
2425
|
+
ke.Fragment = m, ke.jsx = function(f, S, x) {
|
|
2426
|
+
var E = 1e4 > V.recentlyCreatedOwnerStacks++;
|
|
2331
2427
|
return u(
|
|
2332
2428
|
f,
|
|
2333
2429
|
S,
|
|
2334
2430
|
x,
|
|
2335
2431
|
!1,
|
|
2336
|
-
|
|
2337
|
-
|
|
2432
|
+
E ? Error("react-stack-top-frame") : K,
|
|
2433
|
+
E ? J(s(f)) : Q
|
|
2338
2434
|
);
|
|
2339
|
-
},
|
|
2340
|
-
var
|
|
2435
|
+
}, ke.jsxs = function(f, S, x) {
|
|
2436
|
+
var E = 1e4 > V.recentlyCreatedOwnerStacks++;
|
|
2341
2437
|
return u(
|
|
2342
2438
|
f,
|
|
2343
2439
|
S,
|
|
2344
2440
|
x,
|
|
2345
2441
|
!0,
|
|
2346
|
-
|
|
2347
|
-
|
|
2442
|
+
E ? Error("react-stack-top-frame") : K,
|
|
2443
|
+
E ? J(s(f)) : Q
|
|
2348
2444
|
);
|
|
2349
2445
|
};
|
|
2350
|
-
})()),
|
|
2446
|
+
})()), ke;
|
|
2351
2447
|
}
|
|
2352
|
-
var
|
|
2353
|
-
function
|
|
2354
|
-
return
|
|
2448
|
+
var zt;
|
|
2449
|
+
function Wn() {
|
|
2450
|
+
return zt || (zt = 1, process.env.NODE_ENV === "production" ? Ae.exports = Mn() : Ae.exports = Bn()), Ae.exports;
|
|
2355
2451
|
}
|
|
2356
|
-
var n =
|
|
2452
|
+
var n = Wn();
|
|
2357
2453
|
const Hn = async (t, e) => {
|
|
2358
|
-
const { name: r, email: s, password: a, appId: i, phone: o, address: l, avatarUrl: h, isActive:
|
|
2454
|
+
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
2455
|
if (!y)
|
|
2360
2456
|
throw new Error("API key is required for signup");
|
|
2361
2457
|
if (!r || !s || !a || !i)
|
|
2362
2458
|
throw new Error("Name, email, password, and appId are required");
|
|
2363
2459
|
try {
|
|
2364
|
-
const w = await
|
|
2460
|
+
const w = await M.post(
|
|
2365
2461
|
`${b}/users/signup`,
|
|
2366
2462
|
{
|
|
2367
2463
|
name: r,
|
|
@@ -2371,7 +2467,7 @@ const Hn = async (t, e) => {
|
|
|
2371
2467
|
phone: o,
|
|
2372
2468
|
address: l,
|
|
2373
2469
|
avatarUrl: h,
|
|
2374
|
-
isActive:
|
|
2470
|
+
isActive: d,
|
|
2375
2471
|
role: u
|
|
2376
2472
|
},
|
|
2377
2473
|
{
|
|
@@ -2383,15 +2479,15 @@ const Hn = async (t, e) => {
|
|
|
2383
2479
|
);
|
|
2384
2480
|
return w.data?.user && localStorage.setItem("userInfo", JSON.stringify(w.data.user)), w.data.user;
|
|
2385
2481
|
} catch (w) {
|
|
2386
|
-
const
|
|
2387
|
-
if (console.error("Signup API Error:",
|
|
2388
|
-
if (
|
|
2482
|
+
const c = w.response?.data?.message || w.message || "Signup failed";
|
|
2483
|
+
if (console.error("Signup API Error:", c), w.response?.status === 400) {
|
|
2484
|
+
if (c.includes("already exists"))
|
|
2389
2485
|
throw {
|
|
2390
2486
|
success: !1,
|
|
2391
2487
|
message: "User with this email already exists for this app",
|
|
2392
2488
|
status: 400
|
|
2393
2489
|
};
|
|
2394
|
-
if (
|
|
2490
|
+
if (c.includes("inactive"))
|
|
2395
2491
|
throw {
|
|
2396
2492
|
success: !1,
|
|
2397
2493
|
message: "Cannot signup under an inactive app",
|
|
@@ -2404,7 +2500,7 @@ const Hn = async (t, e) => {
|
|
|
2404
2500
|
status: 404
|
|
2405
2501
|
} : {
|
|
2406
2502
|
success: !1,
|
|
2407
|
-
message:
|
|
2503
|
+
message: c,
|
|
2408
2504
|
status: w.response?.status || 500
|
|
2409
2505
|
};
|
|
2410
2506
|
}
|
|
@@ -2418,7 +2514,7 @@ const Hn = async (t, e) => {
|
|
|
2418
2514
|
const Vn = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Yn = (t) => t.replace(
|
|
2419
2515
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
2420
2516
|
(e, r, s) => s ? s.toUpperCase() : r.toLowerCase()
|
|
2421
|
-
),
|
|
2517
|
+
), $t = (t) => {
|
|
2422
2518
|
const e = Yn(t);
|
|
2423
2519
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
2424
2520
|
}, ir = (...t) => t.filter((e, r, s) => !!e && e.trim() !== "" && s.indexOf(e) === r).join(" ").trim(), Kn = (t) => {
|
|
@@ -2473,7 +2569,7 @@ const Gn = Nt(
|
|
|
2473
2569
|
...l
|
|
2474
2570
|
},
|
|
2475
2571
|
[
|
|
2476
|
-
...o.map(([
|
|
2572
|
+
...o.map(([d, u]) => Xe(d, u)),
|
|
2477
2573
|
...Array.isArray(i) ? i : [i]
|
|
2478
2574
|
]
|
|
2479
2575
|
)
|
|
@@ -2484,20 +2580,20 @@ const Gn = Nt(
|
|
|
2484
2580
|
* This source code is licensed under the ISC license.
|
|
2485
2581
|
* See the LICENSE file in the root directory of this source tree.
|
|
2486
2582
|
*/
|
|
2487
|
-
const
|
|
2583
|
+
const W = (t, e) => {
|
|
2488
2584
|
const r = Nt(
|
|
2489
2585
|
({ className: s, ...a }, i) => Xe(Gn, {
|
|
2490
2586
|
ref: i,
|
|
2491
2587
|
iconNode: e,
|
|
2492
2588
|
className: ir(
|
|
2493
|
-
`lucide-${Vn(
|
|
2589
|
+
`lucide-${Vn($t(t))}`,
|
|
2494
2590
|
`lucide-${t}`,
|
|
2495
2591
|
s
|
|
2496
2592
|
),
|
|
2497
2593
|
...a
|
|
2498
2594
|
})
|
|
2499
2595
|
);
|
|
2500
|
-
return r.displayName =
|
|
2596
|
+
return r.displayName = $t(t), r;
|
|
2501
2597
|
};
|
|
2502
2598
|
/**
|
|
2503
2599
|
* @license lucide-react v0.544.0 - ISC
|
|
@@ -2514,14 +2610,14 @@ const Xn = [
|
|
|
2514
2610
|
}
|
|
2515
2611
|
],
|
|
2516
2612
|
["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
|
|
2517
|
-
], nt =
|
|
2613
|
+
], nt = W("camera", Xn);
|
|
2518
2614
|
/**
|
|
2519
2615
|
* @license lucide-react v0.544.0 - ISC
|
|
2520
2616
|
*
|
|
2521
2617
|
* This source code is licensed under the ISC license.
|
|
2522
2618
|
* See the LICENSE file in the root directory of this source tree.
|
|
2523
2619
|
*/
|
|
2524
|
-
const Zn = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Qn =
|
|
2620
|
+
const Zn = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Qn = W("chevron-down", Zn);
|
|
2525
2621
|
/**
|
|
2526
2622
|
* @license lucide-react v0.544.0 - ISC
|
|
2527
2623
|
*
|
|
@@ -2532,7 +2628,7 @@ const es = [
|
|
|
2532
2628
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
2533
2629
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
2534
2630
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
2535
|
-
], le =
|
|
2631
|
+
], le = W("circle-alert", es);
|
|
2536
2632
|
/**
|
|
2537
2633
|
* @license lucide-react v0.544.0 - ISC
|
|
2538
2634
|
*
|
|
@@ -2542,7 +2638,7 @@ const es = [
|
|
|
2542
2638
|
const ts = [
|
|
2543
2639
|
["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
|
|
2544
2640
|
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
2545
|
-
],
|
|
2641
|
+
], de = W("circle-check-big", ts);
|
|
2546
2642
|
/**
|
|
2547
2643
|
* @license lucide-react v0.544.0 - ISC
|
|
2548
2644
|
*
|
|
@@ -2552,7 +2648,7 @@ const ts = [
|
|
|
2552
2648
|
const rs = [
|
|
2553
2649
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
2554
2650
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
2555
|
-
], Ge =
|
|
2651
|
+
], Ge = W("circle-check", rs);
|
|
2556
2652
|
/**
|
|
2557
2653
|
* @license lucide-react v0.544.0 - ISC
|
|
2558
2654
|
*
|
|
@@ -2563,7 +2659,7 @@ const ns = [
|
|
|
2563
2659
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
2564
2660
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
2565
2661
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
2566
|
-
], ss =
|
|
2662
|
+
], ss = W("database", ns);
|
|
2567
2663
|
/**
|
|
2568
2664
|
* @license lucide-react v0.544.0 - ISC
|
|
2569
2665
|
*
|
|
@@ -2574,7 +2670,7 @@ const as = [
|
|
|
2574
2670
|
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
2575
2671
|
["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
|
|
2576
2672
|
["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
|
|
2577
|
-
], os =
|
|
2673
|
+
], os = W("ellipsis-vertical", as);
|
|
2578
2674
|
/**
|
|
2579
2675
|
* @license lucide-react v0.544.0 - ISC
|
|
2580
2676
|
*
|
|
@@ -2598,7 +2694,7 @@ const is = [
|
|
|
2598
2694
|
}
|
|
2599
2695
|
],
|
|
2600
2696
|
["path", { d: "m2 2 20 20", key: "1ooewy" }]
|
|
2601
|
-
], it =
|
|
2697
|
+
], it = W("eye-off", is);
|
|
2602
2698
|
/**
|
|
2603
2699
|
* @license lucide-react v0.544.0 - ISC
|
|
2604
2700
|
*
|
|
@@ -2614,14 +2710,14 @@ const ls = [
|
|
|
2614
2710
|
}
|
|
2615
2711
|
],
|
|
2616
2712
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
2617
|
-
], lt =
|
|
2713
|
+
], lt = W("eye", ls);
|
|
2618
2714
|
/**
|
|
2619
2715
|
* @license lucide-react v0.544.0 - ISC
|
|
2620
2716
|
*
|
|
2621
2717
|
* This source code is licensed under the ISC license.
|
|
2622
2718
|
* See the LICENSE file in the root directory of this source tree.
|
|
2623
2719
|
*/
|
|
2624
|
-
const
|
|
2720
|
+
const ds = [
|
|
2625
2721
|
["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
|
|
2626
2722
|
[
|
|
2627
2723
|
"path",
|
|
@@ -2630,7 +2726,7 @@ const cs = [
|
|
|
2630
2726
|
key: "r6nss1"
|
|
2631
2727
|
}
|
|
2632
2728
|
]
|
|
2633
|
-
],
|
|
2729
|
+
], cs = W("house", ds);
|
|
2634
2730
|
/**
|
|
2635
2731
|
* @license lucide-react v0.544.0 - ISC
|
|
2636
2732
|
*
|
|
@@ -2641,7 +2737,7 @@ const us = [
|
|
|
2641
2737
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
2642
2738
|
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
|
|
2643
2739
|
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
|
|
2644
|
-
], lr =
|
|
2740
|
+
], lr = W("image", us);
|
|
2645
2741
|
/**
|
|
2646
2742
|
* @license lucide-react v0.544.0 - ISC
|
|
2647
2743
|
*
|
|
@@ -2657,7 +2753,7 @@ const ps = [
|
|
|
2657
2753
|
}
|
|
2658
2754
|
],
|
|
2659
2755
|
["circle", { cx: "16.5", cy: "7.5", r: ".5", fill: "currentColor", key: "w0ekpg" }]
|
|
2660
|
-
],
|
|
2756
|
+
], dr = W("key-round", ps);
|
|
2661
2757
|
/**
|
|
2662
2758
|
* @license lucide-react v0.544.0 - ISC
|
|
2663
2759
|
*
|
|
@@ -2668,7 +2764,7 @@ const fs = [
|
|
|
2668
2764
|
["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
2765
|
["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
|
|
2670
2766
|
["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
|
|
2671
|
-
],
|
|
2767
|
+
], dt = W("key", fs);
|
|
2672
2768
|
/**
|
|
2673
2769
|
* @license lucide-react v0.544.0 - ISC
|
|
2674
2770
|
*
|
|
@@ -2679,14 +2775,14 @@ const xs = [
|
|
|
2679
2775
|
["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
|
|
2680
2776
|
["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
|
|
2681
2777
|
["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
|
|
2682
|
-
], hs =
|
|
2778
|
+
], hs = W("link-2", xs);
|
|
2683
2779
|
/**
|
|
2684
2780
|
* @license lucide-react v0.544.0 - ISC
|
|
2685
2781
|
*
|
|
2686
2782
|
* This source code is licensed under the ISC license.
|
|
2687
2783
|
* See the LICENSE file in the root directory of this source tree.
|
|
2688
2784
|
*/
|
|
2689
|
-
const gs = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], ae =
|
|
2785
|
+
const gs = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], ae = W("loader-circle", gs);
|
|
2690
2786
|
/**
|
|
2691
2787
|
* @license lucide-react v0.544.0 - ISC
|
|
2692
2788
|
*
|
|
@@ -2702,7 +2798,7 @@ const ms = [
|
|
|
2702
2798
|
["path", { d: "m4.9 19.1 2.9-2.9", key: "bwix9q" }],
|
|
2703
2799
|
["path", { d: "M2 12h4", key: "j09sii" }],
|
|
2704
2800
|
["path", { d: "m4.9 4.9 2.9 2.9", key: "giyufr" }]
|
|
2705
|
-
], ys =
|
|
2801
|
+
], ys = W("loader", ms);
|
|
2706
2802
|
/**
|
|
2707
2803
|
* @license lucide-react v0.544.0 - ISC
|
|
2708
2804
|
*
|
|
@@ -2712,7 +2808,7 @@ const ms = [
|
|
|
2712
2808
|
const bs = [
|
|
2713
2809
|
["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
|
|
2714
2810
|
["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
|
|
2715
|
-
], me =
|
|
2811
|
+
], me = W("lock", bs);
|
|
2716
2812
|
/**
|
|
2717
2813
|
* @license lucide-react v0.544.0 - ISC
|
|
2718
2814
|
*
|
|
@@ -2723,7 +2819,7 @@ const ws = [
|
|
|
2723
2819
|
["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
|
|
2724
2820
|
["path", { d: "M21 12H9", key: "dn1m92" }],
|
|
2725
2821
|
["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
|
|
2726
|
-
],
|
|
2822
|
+
], ct = W("log-out", ws);
|
|
2727
2823
|
/**
|
|
2728
2824
|
* @license lucide-react v0.544.0 - ISC
|
|
2729
2825
|
*
|
|
@@ -2733,7 +2829,7 @@ const ws = [
|
|
|
2733
2829
|
const js = [
|
|
2734
2830
|
["path", { d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7", key: "132q7q" }],
|
|
2735
2831
|
["rect", { x: "2", y: "4", width: "20", height: "16", rx: "2", key: "izxlao" }]
|
|
2736
|
-
],
|
|
2832
|
+
], ce = W("mail", js);
|
|
2737
2833
|
/**
|
|
2738
2834
|
* @license lucide-react v0.544.0 - ISC
|
|
2739
2835
|
*
|
|
@@ -2749,14 +2845,14 @@ const vs = [
|
|
|
2749
2845
|
}
|
|
2750
2846
|
],
|
|
2751
2847
|
["circle", { cx: "12", cy: "10", r: "3", key: "ilqhr7" }]
|
|
2752
|
-
], Ss =
|
|
2848
|
+
], Ss = W("map-pin", vs);
|
|
2753
2849
|
/**
|
|
2754
2850
|
* @license lucide-react v0.544.0 - ISC
|
|
2755
2851
|
*
|
|
2756
2852
|
* This source code is licensed under the ISC license.
|
|
2757
2853
|
* See the LICENSE file in the root directory of this source tree.
|
|
2758
2854
|
*/
|
|
2759
|
-
const
|
|
2855
|
+
const Es = [
|
|
2760
2856
|
["path", { d: "M13 21h8", key: "1jsn5i" }],
|
|
2761
2857
|
[
|
|
2762
2858
|
"path",
|
|
@@ -2765,7 +2861,7 @@ const ks = [
|
|
|
2765
2861
|
key: "1a8usu"
|
|
2766
2862
|
}
|
|
2767
2863
|
]
|
|
2768
|
-
],
|
|
2864
|
+
], ks = W("pen-line", Es);
|
|
2769
2865
|
/**
|
|
2770
2866
|
* @license lucide-react v0.544.0 - ISC
|
|
2771
2867
|
*
|
|
@@ -2780,14 +2876,14 @@ const Cs = [
|
|
|
2780
2876
|
key: "9njp5v"
|
|
2781
2877
|
}
|
|
2782
2878
|
]
|
|
2783
|
-
], Ts =
|
|
2879
|
+
], Ts = W("phone", Cs);
|
|
2784
2880
|
/**
|
|
2785
2881
|
* @license lucide-react v0.544.0 - ISC
|
|
2786
2882
|
*
|
|
2787
2883
|
* This source code is licensed under the ISC license.
|
|
2788
2884
|
* See the LICENSE file in the root directory of this source tree.
|
|
2789
2885
|
*/
|
|
2790
|
-
const
|
|
2886
|
+
const Is = [
|
|
2791
2887
|
[
|
|
2792
2888
|
"path",
|
|
2793
2889
|
{
|
|
@@ -2797,7 +2893,7 @@ const Rs = [
|
|
|
2797
2893
|
],
|
|
2798
2894
|
["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
|
|
2799
2895
|
["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
|
|
2800
|
-
],
|
|
2896
|
+
], Rs = W("save", Is);
|
|
2801
2897
|
/**
|
|
2802
2898
|
* @license lucide-react v0.544.0 - ISC
|
|
2803
2899
|
*
|
|
@@ -2813,7 +2909,7 @@ const Ps = [
|
|
|
2813
2909
|
}
|
|
2814
2910
|
],
|
|
2815
2911
|
["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
|
|
2816
|
-
], ut =
|
|
2912
|
+
], ut = W("send", Ps);
|
|
2817
2913
|
/**
|
|
2818
2914
|
* @license lucide-react v0.544.0 - ISC
|
|
2819
2915
|
*
|
|
@@ -2829,14 +2925,14 @@ const Os = [
|
|
|
2829
2925
|
}
|
|
2830
2926
|
],
|
|
2831
2927
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
2832
|
-
],
|
|
2928
|
+
], As = W("settings", Os);
|
|
2833
2929
|
/**
|
|
2834
2930
|
* @license lucide-react v0.544.0 - ISC
|
|
2835
2931
|
*
|
|
2836
2932
|
* This source code is licensed under the ISC license.
|
|
2837
2933
|
* See the LICENSE file in the root directory of this source tree.
|
|
2838
2934
|
*/
|
|
2839
|
-
const
|
|
2935
|
+
const zs = [
|
|
2840
2936
|
[
|
|
2841
2937
|
"path",
|
|
2842
2938
|
{
|
|
@@ -2844,27 +2940,27 @@ const As = [
|
|
|
2844
2940
|
key: "oel41y"
|
|
2845
2941
|
}
|
|
2846
2942
|
]
|
|
2847
|
-
],
|
|
2943
|
+
], cr = W("shield", zs);
|
|
2848
2944
|
/**
|
|
2849
2945
|
* @license lucide-react v0.544.0 - ISC
|
|
2850
2946
|
*
|
|
2851
2947
|
* This source code is licensed under the ISC license.
|
|
2852
2948
|
* See the LICENSE file in the root directory of this source tree.
|
|
2853
2949
|
*/
|
|
2854
|
-
const
|
|
2950
|
+
const $s = [
|
|
2855
2951
|
["path", { d: "M10 11v6", key: "nco0om" }],
|
|
2856
2952
|
["path", { d: "M14 11v6", key: "outv1u" }],
|
|
2857
2953
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
2858
2954
|
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
2859
2955
|
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
2860
|
-
], Ne =
|
|
2956
|
+
], Ne = W("trash-2", $s);
|
|
2861
2957
|
/**
|
|
2862
2958
|
* @license lucide-react v0.544.0 - ISC
|
|
2863
2959
|
*
|
|
2864
2960
|
* This source code is licensed under the ISC license.
|
|
2865
2961
|
* See the LICENSE file in the root directory of this source tree.
|
|
2866
2962
|
*/
|
|
2867
|
-
const
|
|
2963
|
+
const _s = [
|
|
2868
2964
|
[
|
|
2869
2965
|
"path",
|
|
2870
2966
|
{
|
|
@@ -2874,7 +2970,7 @@ const $s = [
|
|
|
2874
2970
|
],
|
|
2875
2971
|
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
2876
2972
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
2877
|
-
],
|
|
2973
|
+
], _t = W("triangle-alert", _s);
|
|
2878
2974
|
/**
|
|
2879
2975
|
* @license lucide-react v0.544.0 - ISC
|
|
2880
2976
|
*
|
|
@@ -2886,17 +2982,17 @@ const Ns = [
|
|
|
2886
2982
|
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
2887
2983
|
["line", { x1: "17", x2: "22", y1: "8", y2: "13", key: "3nzzx3" }],
|
|
2888
2984
|
["line", { x1: "22", x2: "17", y1: "8", y2: "13", key: "1swrse" }]
|
|
2889
|
-
],
|
|
2985
|
+
], Ds = W("user-x", Ns);
|
|
2890
2986
|
/**
|
|
2891
2987
|
* @license lucide-react v0.544.0 - ISC
|
|
2892
2988
|
*
|
|
2893
2989
|
* This source code is licensed under the ISC license.
|
|
2894
2990
|
* See the LICENSE file in the root directory of this source tree.
|
|
2895
2991
|
*/
|
|
2896
|
-
const
|
|
2992
|
+
const Us = [
|
|
2897
2993
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
2898
2994
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
2899
|
-
], be =
|
|
2995
|
+
], be = W("user", Us);
|
|
2900
2996
|
/**
|
|
2901
2997
|
* @license lucide-react v0.544.0 - ISC
|
|
2902
2998
|
*
|
|
@@ -2906,15 +3002,15 @@ const Ds = [
|
|
|
2906
3002
|
const Ls = [
|
|
2907
3003
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
2908
3004
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
2909
|
-
], Pe =
|
|
3005
|
+
], Pe = W("x", Ls), De = {
|
|
2910
3006
|
baseUrl: "",
|
|
2911
3007
|
apiKey: "",
|
|
2912
3008
|
appId: ""
|
|
2913
3009
|
}, ua = (t) => {
|
|
2914
3010
|
if (!t.baseUrl || !t.apiKey || !t.appId)
|
|
2915
3011
|
throw new Error("baseUrl, apiKey, and appId are required");
|
|
2916
|
-
|
|
2917
|
-
}, ge = () =>
|
|
3012
|
+
De.baseUrl = t.baseUrl, De.apiKey = t.apiKey, De.appId = t.appId;
|
|
3013
|
+
}, ge = () => De, pa = ({
|
|
2918
3014
|
logoUrl: t,
|
|
2919
3015
|
logoLinkUrl: e,
|
|
2920
3016
|
title: r = "Create Your Account",
|
|
@@ -2925,7 +3021,7 @@ const Ls = [
|
|
|
2925
3021
|
darkMode: l = !0,
|
|
2926
3022
|
// Only avatar is optional
|
|
2927
3023
|
showAvatar: h = !1,
|
|
2928
|
-
roles:
|
|
3024
|
+
roles: d = [],
|
|
2929
3025
|
// 🔥 FIXED
|
|
2930
3026
|
showRoleSelector: u = !1,
|
|
2931
3027
|
// 🔥 FIXED
|
|
@@ -2933,13 +3029,13 @@ const Ls = [
|
|
|
2933
3029
|
onSuccess: y,
|
|
2934
3030
|
onError: w
|
|
2935
3031
|
}) => {
|
|
2936
|
-
const { baseUrl:
|
|
3032
|
+
const { baseUrl: c, apiKey: j, appId: m } = ge(), $ = {
|
|
2937
3033
|
name: "",
|
|
2938
3034
|
email: "",
|
|
2939
3035
|
password: "",
|
|
2940
|
-
role:
|
|
3036
|
+
role: d.length ? d[0] : "user",
|
|
2941
3037
|
...h && { avatarUrl: "" }
|
|
2942
|
-
}, [
|
|
3038
|
+
}, [I, z] = O($), [C, q] = O(!1), [g, R] = O(!1), [v, D] = O(null), [B, F] = O({}), [V, Z] = O(!1), T = l ? "#ffffff" : "#111827", J = l ? "#a1a1aa" : "#6b7280", A = 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
3039
|
Le.useEffect(() => {
|
|
2944
3040
|
if (typeof window < "u") {
|
|
2945
3041
|
const S = () => Z(window.innerWidth < 768);
|
|
@@ -2947,31 +3043,31 @@ const Ls = [
|
|
|
2947
3043
|
}
|
|
2948
3044
|
}, []);
|
|
2949
3045
|
const K = (S) => {
|
|
2950
|
-
const { name: x, value:
|
|
2951
|
-
|
|
3046
|
+
const { name: x, value: E } = S.target;
|
|
3047
|
+
z((_) => ({ ..._, [x]: E })), B[x] && F((_) => ({ ..._, [x]: void 0 }));
|
|
2952
3048
|
}, Q = () => {
|
|
2953
3049
|
const S = {};
|
|
2954
|
-
return
|
|
3050
|
+
return I.name.trim() || (S.name = "Name is required"), I.email.trim() ? /\S+@\S+\.\S+/.test(I.email) || (S.email = "Invalid email address") : S.email = "Email is required", I.password ? I.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
3051
|
}, G = async (S) => {
|
|
2956
3052
|
if (S.preventDefault(), !!Q()) {
|
|
2957
|
-
|
|
3053
|
+
R(!0), D(null);
|
|
2958
3054
|
try {
|
|
2959
3055
|
const x = {
|
|
2960
|
-
...
|
|
3056
|
+
...I,
|
|
2961
3057
|
appId: m
|
|
2962
|
-
},
|
|
2963
|
-
|
|
3058
|
+
}, E = await Hn(x, { baseUrl: c, apiKey: j });
|
|
3059
|
+
D({ type: "success", text: "Account created successfully!" }), y && y(E);
|
|
2964
3060
|
} catch (x) {
|
|
2965
|
-
const
|
|
2966
|
-
|
|
3061
|
+
const E = x.message || "Signup failed. Please try again.";
|
|
3062
|
+
D({ type: "error", text: E }), w && w(x);
|
|
2967
3063
|
} finally {
|
|
2968
|
-
|
|
3064
|
+
R(!1);
|
|
2969
3065
|
}
|
|
2970
3066
|
}
|
|
2971
3067
|
}, f = {
|
|
2972
3068
|
width: "100%",
|
|
2973
3069
|
padding: V ? "10px 14px 10px 44px" : "10px 16px 10px 44px",
|
|
2974
|
-
backgroundColor:
|
|
3070
|
+
backgroundColor: A,
|
|
2975
3071
|
border: `1px solid ${P}`,
|
|
2976
3072
|
borderRadius: "10px",
|
|
2977
3073
|
color: T,
|
|
@@ -3062,7 +3158,7 @@ const Ls = [
|
|
|
3062
3158
|
]
|
|
3063
3159
|
}
|
|
3064
3160
|
),
|
|
3065
|
-
h &&
|
|
3161
|
+
h && I.avatarUrl && /* @__PURE__ */ n.jsx(
|
|
3066
3162
|
"div",
|
|
3067
3163
|
{
|
|
3068
3164
|
style: {
|
|
@@ -3073,7 +3169,7 @@ const Ls = [
|
|
|
3073
3169
|
children: /* @__PURE__ */ n.jsx(
|
|
3074
3170
|
"img",
|
|
3075
3171
|
{
|
|
3076
|
-
src:
|
|
3172
|
+
src: I.avatarUrl,
|
|
3077
3173
|
alt: "Avatar Preview",
|
|
3078
3174
|
style: {
|
|
3079
3175
|
width: "60px",
|
|
@@ -3096,7 +3192,7 @@ const Ls = [
|
|
|
3096
3192
|
onSubmit: G,
|
|
3097
3193
|
style: { display: "flex", flexDirection: "column", gap: "14px" },
|
|
3098
3194
|
children: [
|
|
3099
|
-
u &&
|
|
3195
|
+
u && d && d.length === 2 && /* @__PURE__ */ n.jsxs(
|
|
3100
3196
|
"div",
|
|
3101
3197
|
{
|
|
3102
3198
|
style: { display: "flex", flexDirection: "column", gap: "4px" },
|
|
@@ -3120,7 +3216,7 @@ const Ls = [
|
|
|
3120
3216
|
display: "flex",
|
|
3121
3217
|
borderRadius: "10px",
|
|
3122
3218
|
border: `1px solid ${P}`,
|
|
3123
|
-
backgroundColor:
|
|
3219
|
+
backgroundColor: A,
|
|
3124
3220
|
overflow: "hidden",
|
|
3125
3221
|
cursor: "pointer",
|
|
3126
3222
|
height: "42px"
|
|
@@ -3141,7 +3237,7 @@ const Ls = [
|
|
|
3141
3237
|
// subtle shadow
|
|
3142
3238
|
borderRadius: "10px",
|
|
3143
3239
|
transition: "transform 0.3s ease, background-color 0.3s ease",
|
|
3144
|
-
transform:
|
|
3240
|
+
transform: I.role === d[1] ? "translateX(100%)" : "translateX(0)",
|
|
3145
3241
|
zIndex: 0
|
|
3146
3242
|
}
|
|
3147
3243
|
}
|
|
@@ -3150,43 +3246,43 @@ const Ls = [
|
|
|
3150
3246
|
"button",
|
|
3151
3247
|
{
|
|
3152
3248
|
type: "button",
|
|
3153
|
-
onClick: () =>
|
|
3249
|
+
onClick: () => z((S) => ({ ...S, role: d[0] })),
|
|
3154
3250
|
style: {
|
|
3155
3251
|
flex: 1,
|
|
3156
3252
|
zIndex: 10,
|
|
3157
3253
|
border: "none",
|
|
3158
3254
|
background: "transparent",
|
|
3159
|
-
color:
|
|
3255
|
+
color: I.role === d[0] ? i : l ? "#9ca3af" : "#6b7280",
|
|
3160
3256
|
// theme-aware inactive color
|
|
3161
|
-
fontWeight:
|
|
3257
|
+
fontWeight: I.role === d[0] ? 600 : 500,
|
|
3162
3258
|
fontSize: "14px",
|
|
3163
3259
|
display: "flex",
|
|
3164
3260
|
alignItems: "center",
|
|
3165
3261
|
justifyContent: "center",
|
|
3166
3262
|
transition: "color 0.2s ease"
|
|
3167
3263
|
},
|
|
3168
|
-
children:
|
|
3264
|
+
children: d[0].charAt(0).toUpperCase() + d[0].slice(1)
|
|
3169
3265
|
}
|
|
3170
3266
|
),
|
|
3171
3267
|
/* @__PURE__ */ n.jsx(
|
|
3172
3268
|
"button",
|
|
3173
3269
|
{
|
|
3174
3270
|
type: "button",
|
|
3175
|
-
onClick: () =>
|
|
3271
|
+
onClick: () => z((S) => ({ ...S, role: d[1] })),
|
|
3176
3272
|
style: {
|
|
3177
3273
|
flex: 1,
|
|
3178
3274
|
zIndex: 10,
|
|
3179
3275
|
border: "none",
|
|
3180
3276
|
background: "transparent",
|
|
3181
|
-
color:
|
|
3182
|
-
fontWeight:
|
|
3277
|
+
color: I.role === d[1] ? i : l ? "#9ca3af" : "#6b7280",
|
|
3278
|
+
fontWeight: I.role === d[1] ? 600 : 500,
|
|
3183
3279
|
fontSize: "14px",
|
|
3184
3280
|
display: "flex",
|
|
3185
3281
|
alignItems: "center",
|
|
3186
3282
|
justifyContent: "center",
|
|
3187
3283
|
transition: "color 0.2s ease"
|
|
3188
3284
|
},
|
|
3189
|
-
children:
|
|
3285
|
+
children: d[1].charAt(0).toUpperCase() + d[1].slice(1)
|
|
3190
3286
|
}
|
|
3191
3287
|
)
|
|
3192
3288
|
]
|
|
@@ -3229,16 +3325,16 @@ const Ls = [
|
|
|
3229
3325
|
type: "text",
|
|
3230
3326
|
name: "name",
|
|
3231
3327
|
placeholder: "Enter your full name",
|
|
3232
|
-
value:
|
|
3328
|
+
value: I.name,
|
|
3233
3329
|
onChange: K,
|
|
3234
3330
|
style: {
|
|
3235
3331
|
...f,
|
|
3236
|
-
borderColor:
|
|
3332
|
+
borderColor: B.name ? "#ef4444" : P
|
|
3237
3333
|
}
|
|
3238
3334
|
}
|
|
3239
3335
|
)
|
|
3240
3336
|
] }),
|
|
3241
|
-
|
|
3337
|
+
B.name && /* @__PURE__ */ n.jsx(
|
|
3242
3338
|
"span",
|
|
3243
3339
|
{
|
|
3244
3340
|
style: {
|
|
@@ -3246,7 +3342,7 @@ const Ls = [
|
|
|
3246
3342
|
fontSize: "12px",
|
|
3247
3343
|
marginTop: "2px"
|
|
3248
3344
|
},
|
|
3249
|
-
children:
|
|
3345
|
+
children: B.name
|
|
3250
3346
|
}
|
|
3251
3347
|
)
|
|
3252
3348
|
] }),
|
|
@@ -3265,7 +3361,7 @@ const Ls = [
|
|
|
3265
3361
|
),
|
|
3266
3362
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
3267
3363
|
/* @__PURE__ */ n.jsx(
|
|
3268
|
-
|
|
3364
|
+
ce,
|
|
3269
3365
|
{
|
|
3270
3366
|
size: 20,
|
|
3271
3367
|
style: {
|
|
@@ -3284,16 +3380,16 @@ const Ls = [
|
|
|
3284
3380
|
type: "email",
|
|
3285
3381
|
name: "email",
|
|
3286
3382
|
placeholder: "Enter your email address",
|
|
3287
|
-
value:
|
|
3383
|
+
value: I.email,
|
|
3288
3384
|
onChange: K,
|
|
3289
3385
|
style: {
|
|
3290
3386
|
...f,
|
|
3291
|
-
borderColor:
|
|
3387
|
+
borderColor: B.email ? "#ef4444" : P
|
|
3292
3388
|
}
|
|
3293
3389
|
}
|
|
3294
3390
|
)
|
|
3295
3391
|
] }),
|
|
3296
|
-
|
|
3392
|
+
B.email && /* @__PURE__ */ n.jsx(
|
|
3297
3393
|
"span",
|
|
3298
3394
|
{
|
|
3299
3395
|
style: {
|
|
@@ -3301,7 +3397,7 @@ const Ls = [
|
|
|
3301
3397
|
fontSize: "12px",
|
|
3302
3398
|
marginTop: "2px"
|
|
3303
3399
|
},
|
|
3304
|
-
children:
|
|
3400
|
+
children: B.email
|
|
3305
3401
|
}
|
|
3306
3402
|
)
|
|
3307
3403
|
] }),
|
|
@@ -3339,11 +3435,11 @@ const Ls = [
|
|
|
3339
3435
|
type: C ? "text" : "password",
|
|
3340
3436
|
name: "password",
|
|
3341
3437
|
placeholder: "Create a secure password",
|
|
3342
|
-
value:
|
|
3438
|
+
value: I.password,
|
|
3343
3439
|
onChange: K,
|
|
3344
3440
|
style: {
|
|
3345
3441
|
...f,
|
|
3346
|
-
borderColor:
|
|
3442
|
+
borderColor: B.password ? "#ef4444" : P
|
|
3347
3443
|
}
|
|
3348
3444
|
}
|
|
3349
3445
|
),
|
|
@@ -3351,7 +3447,7 @@ const Ls = [
|
|
|
3351
3447
|
"button",
|
|
3352
3448
|
{
|
|
3353
3449
|
type: "button",
|
|
3354
|
-
onClick: () =>
|
|
3450
|
+
onClick: () => q(!C),
|
|
3355
3451
|
style: {
|
|
3356
3452
|
position: "absolute",
|
|
3357
3453
|
right: "14px",
|
|
@@ -3367,7 +3463,7 @@ const Ls = [
|
|
|
3367
3463
|
}
|
|
3368
3464
|
)
|
|
3369
3465
|
] }),
|
|
3370
|
-
|
|
3466
|
+
B.password && /* @__PURE__ */ n.jsx(
|
|
3371
3467
|
"span",
|
|
3372
3468
|
{
|
|
3373
3469
|
style: {
|
|
@@ -3375,7 +3471,7 @@ const Ls = [
|
|
|
3375
3471
|
fontSize: "12px",
|
|
3376
3472
|
marginTop: "2px"
|
|
3377
3473
|
},
|
|
3378
|
-
children:
|
|
3474
|
+
children: B.password
|
|
3379
3475
|
}
|
|
3380
3476
|
)
|
|
3381
3477
|
] }),
|
|
@@ -3417,7 +3513,7 @@ const Ls = [
|
|
|
3417
3513
|
type: "url",
|
|
3418
3514
|
name: "avatarUrl",
|
|
3419
3515
|
placeholder: "Paste your avatar image URL",
|
|
3420
|
-
value:
|
|
3516
|
+
value: I.avatarUrl || "",
|
|
3421
3517
|
onChange: K,
|
|
3422
3518
|
style: f
|
|
3423
3519
|
}
|
|
@@ -3463,7 +3559,7 @@ const Ls = [
|
|
|
3463
3559
|
color: v.type === "success" ? i : "#ef4444"
|
|
3464
3560
|
},
|
|
3465
3561
|
children: [
|
|
3466
|
-
v.type === "success" ? /* @__PURE__ */ n.jsx(
|
|
3562
|
+
v.type === "success" ? /* @__PURE__ */ n.jsx(de, { size: 20 }) : /* @__PURE__ */ n.jsx(le, { size: 20 }),
|
|
3467
3563
|
/* @__PURE__ */ n.jsx("span", { children: v.text })
|
|
3468
3564
|
]
|
|
3469
3565
|
}
|
|
@@ -3537,7 +3633,7 @@ const Ls = [
|
|
|
3537
3633
|
if (!o)
|
|
3538
3634
|
throw new Error("API key is required for login");
|
|
3539
3635
|
try {
|
|
3540
|
-
const l = await
|
|
3636
|
+
const l = await M.post(
|
|
3541
3637
|
`${i}/users/login`,
|
|
3542
3638
|
{ email: r, password: s, appId: a },
|
|
3543
3639
|
{
|
|
@@ -3566,41 +3662,41 @@ const Ls = [
|
|
|
3566
3662
|
gradient: o = "linear-gradient(135deg, #22c55e, #00C214)",
|
|
3567
3663
|
darkMode: l = !0,
|
|
3568
3664
|
signupUrl: h,
|
|
3569
|
-
onSuccess:
|
|
3665
|
+
onSuccess: d,
|
|
3570
3666
|
onError: u
|
|
3571
3667
|
}) => {
|
|
3572
|
-
const { baseUrl: b, apiKey: y, appId: w } = ge(), [
|
|
3668
|
+
const { baseUrl: b, apiKey: y, appId: w } = ge(), [c, j] = O("login"), [m, $] = O(1), [I, z] = O(!1), [C, q] = O(!1), [g, R] = O(null), [v, D] = O(""), [B, F] = O(""), [V, Z] = O({
|
|
3573
3669
|
email: "",
|
|
3574
3670
|
otp: "",
|
|
3575
3671
|
newPassword: "",
|
|
3576
3672
|
appId: w
|
|
3577
|
-
}), [T, J] = O(!1),
|
|
3673
|
+
}), [T, J] = O(!1), A = 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
3674
|
Le.useEffect(() => {
|
|
3579
3675
|
if (typeof window < "u") {
|
|
3580
|
-
const
|
|
3581
|
-
return
|
|
3676
|
+
const _ = () => J(window.innerWidth < 768);
|
|
3677
|
+
return _(), window.addEventListener("resize", _), () => window.removeEventListener("resize", _);
|
|
3582
3678
|
}
|
|
3583
3679
|
}, []);
|
|
3584
|
-
const G = async (
|
|
3585
|
-
|
|
3680
|
+
const G = async (_) => {
|
|
3681
|
+
_.preventDefault(), q(!0), R(null);
|
|
3586
3682
|
try {
|
|
3587
3683
|
const N = await Fs(
|
|
3588
|
-
{ email: v, password:
|
|
3684
|
+
{ email: v, password: B, appId: w },
|
|
3589
3685
|
{ baseUrl: b, apiKey: y }
|
|
3590
3686
|
);
|
|
3591
|
-
|
|
3687
|
+
R({ type: "success", text: `Welcome ${N.name}` }), d?.(N);
|
|
3592
3688
|
} catch (N) {
|
|
3593
3689
|
const Y = N.message || "Login failed";
|
|
3594
|
-
|
|
3690
|
+
R({ type: "error", text: Y }), u?.(N);
|
|
3595
3691
|
} finally {
|
|
3596
|
-
|
|
3692
|
+
q(!1);
|
|
3597
3693
|
}
|
|
3598
|
-
}, f = (
|
|
3599
|
-
Z({ ...V, [
|
|
3600
|
-
}, S = async (
|
|
3601
|
-
|
|
3694
|
+
}, f = (_) => {
|
|
3695
|
+
Z({ ...V, [_.target.name]: _.target.value });
|
|
3696
|
+
}, S = async (_) => {
|
|
3697
|
+
_.preventDefault(), q(!0), R(null);
|
|
3602
3698
|
try {
|
|
3603
|
-
const N = await
|
|
3699
|
+
const N = await M.post(
|
|
3604
3700
|
`${b}/users/forgot-password`,
|
|
3605
3701
|
{
|
|
3606
3702
|
email: V.email,
|
|
@@ -3608,42 +3704,42 @@ const Ls = [
|
|
|
3608
3704
|
},
|
|
3609
3705
|
{ headers: { "x-api-key": y } }
|
|
3610
3706
|
);
|
|
3611
|
-
N.data.success ? (
|
|
3707
|
+
N.data.success ? ($(2), R({ type: "success", text: "OTP sent to your email" })) : R({
|
|
3612
3708
|
type: "error",
|
|
3613
3709
|
text: N.data.message || "Failed to send OTP"
|
|
3614
3710
|
});
|
|
3615
3711
|
} catch (N) {
|
|
3616
|
-
|
|
3712
|
+
R({
|
|
3617
3713
|
type: "error",
|
|
3618
3714
|
text: N.response?.data?.message || "Something went wrong"
|
|
3619
3715
|
});
|
|
3620
3716
|
} finally {
|
|
3621
|
-
|
|
3717
|
+
q(!1);
|
|
3622
3718
|
}
|
|
3623
|
-
}, x = async (
|
|
3624
|
-
|
|
3719
|
+
}, x = async (_) => {
|
|
3720
|
+
_.preventDefault(), q(!0), R(null);
|
|
3625
3721
|
try {
|
|
3626
|
-
const N = await
|
|
3722
|
+
const N = await M.post(
|
|
3627
3723
|
`${b}/users/reset-password`,
|
|
3628
3724
|
V,
|
|
3629
3725
|
{ headers: { "x-api-key": y } }
|
|
3630
3726
|
);
|
|
3631
|
-
N.data.success ? (
|
|
3727
|
+
N.data.success ? (R({ type: "success", text: "Password reset successfully!" }), $(1), Z({ email: "", otp: "", newPassword: "", appId: w }), j("login")) : R({ type: "error", text: N.data.message || "Reset failed" });
|
|
3632
3728
|
} catch (N) {
|
|
3633
|
-
|
|
3729
|
+
R({
|
|
3634
3730
|
type: "error",
|
|
3635
3731
|
text: N.response?.data?.message || "Something went wrong"
|
|
3636
3732
|
});
|
|
3637
3733
|
} finally {
|
|
3638
|
-
|
|
3734
|
+
q(!1);
|
|
3639
3735
|
}
|
|
3640
|
-
},
|
|
3736
|
+
}, E = {
|
|
3641
3737
|
width: "100%",
|
|
3642
3738
|
padding: T ? "10px 14px 10px 44px" : "10px 16px 10px 44px",
|
|
3643
3739
|
backgroundColor: K,
|
|
3644
3740
|
border: `1px solid ${Q}`,
|
|
3645
3741
|
borderRadius: "10px",
|
|
3646
|
-
color:
|
|
3742
|
+
color: A,
|
|
3647
3743
|
fontSize: "15px",
|
|
3648
3744
|
outline: "none",
|
|
3649
3745
|
transition: "all 0.2s ease"
|
|
@@ -3710,10 +3806,10 @@ const Ls = [
|
|
|
3710
3806
|
style: {
|
|
3711
3807
|
fontSize: "24px",
|
|
3712
3808
|
fontWeight: 700,
|
|
3713
|
-
color:
|
|
3809
|
+
color: A,
|
|
3714
3810
|
margin: 0
|
|
3715
3811
|
},
|
|
3716
|
-
children:
|
|
3812
|
+
children: c === "login" ? r : m === 1 ? "Forgot Password" : "Reset Password"
|
|
3717
3813
|
}
|
|
3718
3814
|
),
|
|
3719
3815
|
/* @__PURE__ */ n.jsx(
|
|
@@ -3723,13 +3819,13 @@ const Ls = [
|
|
|
3723
3819
|
fontSize: "14px",
|
|
3724
3820
|
color: P
|
|
3725
3821
|
},
|
|
3726
|
-
children:
|
|
3822
|
+
children: c === "login" ? s : "Follow the steps to reset your password"
|
|
3727
3823
|
}
|
|
3728
3824
|
)
|
|
3729
3825
|
]
|
|
3730
3826
|
}
|
|
3731
3827
|
),
|
|
3732
|
-
|
|
3828
|
+
c === "login" && /* @__PURE__ */ n.jsxs(
|
|
3733
3829
|
"form",
|
|
3734
3830
|
{
|
|
3735
3831
|
onSubmit: G,
|
|
@@ -3754,7 +3850,7 @@ const Ls = [
|
|
|
3754
3850
|
),
|
|
3755
3851
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
3756
3852
|
/* @__PURE__ */ n.jsx(
|
|
3757
|
-
|
|
3853
|
+
ce,
|
|
3758
3854
|
{
|
|
3759
3855
|
size: 20,
|
|
3760
3856
|
style: {
|
|
@@ -3773,8 +3869,8 @@ const Ls = [
|
|
|
3773
3869
|
type: "email",
|
|
3774
3870
|
placeholder: "Enter your email",
|
|
3775
3871
|
value: v,
|
|
3776
|
-
onChange: (
|
|
3777
|
-
style:
|
|
3872
|
+
onChange: (_) => D(_.target.value),
|
|
3873
|
+
style: E
|
|
3778
3874
|
}
|
|
3779
3875
|
)
|
|
3780
3876
|
] })
|
|
@@ -3816,18 +3912,18 @@ const Ls = [
|
|
|
3816
3912
|
"input",
|
|
3817
3913
|
{
|
|
3818
3914
|
id: "login-password",
|
|
3819
|
-
type:
|
|
3915
|
+
type: I ? "text" : "password",
|
|
3820
3916
|
placeholder: "Enter your password",
|
|
3821
|
-
value:
|
|
3822
|
-
onChange: (
|
|
3823
|
-
style:
|
|
3917
|
+
value: B,
|
|
3918
|
+
onChange: (_) => F(_.target.value),
|
|
3919
|
+
style: E
|
|
3824
3920
|
}
|
|
3825
3921
|
),
|
|
3826
3922
|
/* @__PURE__ */ n.jsx(
|
|
3827
3923
|
"button",
|
|
3828
3924
|
{
|
|
3829
3925
|
type: "button",
|
|
3830
|
-
onClick: () =>
|
|
3926
|
+
onClick: () => z(!I),
|
|
3831
3927
|
style: {
|
|
3832
3928
|
position: "absolute",
|
|
3833
3929
|
right: "14px",
|
|
@@ -3839,7 +3935,7 @@ const Ls = [
|
|
|
3839
3935
|
color: P,
|
|
3840
3936
|
cursor: "pointer"
|
|
3841
3937
|
},
|
|
3842
|
-
children:
|
|
3938
|
+
children: I ? /* @__PURE__ */ n.jsx(it, { size: 20 }) : /* @__PURE__ */ n.jsx(lt, { size: 20 })
|
|
3843
3939
|
}
|
|
3844
3940
|
)
|
|
3845
3941
|
] })
|
|
@@ -3905,7 +4001,7 @@ const Ls = [
|
|
|
3905
4001
|
]
|
|
3906
4002
|
}
|
|
3907
4003
|
),
|
|
3908
|
-
|
|
4004
|
+
c === "forgot" && /* @__PURE__ */ n.jsxs(
|
|
3909
4005
|
"form",
|
|
3910
4006
|
{
|
|
3911
4007
|
onSubmit: m === 1 ? S : x,
|
|
@@ -3930,7 +4026,7 @@ const Ls = [
|
|
|
3930
4026
|
),
|
|
3931
4027
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
3932
4028
|
/* @__PURE__ */ n.jsx(
|
|
3933
|
-
|
|
4029
|
+
ce,
|
|
3934
4030
|
{
|
|
3935
4031
|
size: 20,
|
|
3936
4032
|
style: {
|
|
@@ -3951,7 +4047,7 @@ const Ls = [
|
|
|
3951
4047
|
placeholder: "Enter your email",
|
|
3952
4048
|
value: V.email,
|
|
3953
4049
|
onChange: f,
|
|
3954
|
-
style:
|
|
4050
|
+
style: E
|
|
3955
4051
|
}
|
|
3956
4052
|
)
|
|
3957
4053
|
] })
|
|
@@ -3981,7 +4077,7 @@ const Ls = [
|
|
|
3981
4077
|
),
|
|
3982
4078
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
3983
4079
|
/* @__PURE__ */ n.jsx(
|
|
3984
|
-
|
|
4080
|
+
dr,
|
|
3985
4081
|
{
|
|
3986
4082
|
size: 20,
|
|
3987
4083
|
style: {
|
|
@@ -4002,7 +4098,7 @@ const Ls = [
|
|
|
4002
4098
|
placeholder: "Enter OTP",
|
|
4003
4099
|
value: V.otp,
|
|
4004
4100
|
onChange: f,
|
|
4005
|
-
style:
|
|
4101
|
+
style: E
|
|
4006
4102
|
}
|
|
4007
4103
|
)
|
|
4008
4104
|
] })
|
|
@@ -4053,7 +4149,7 @@ const Ls = [
|
|
|
4053
4149
|
placeholder: "Enter new password",
|
|
4054
4150
|
value: V.newPassword,
|
|
4055
4151
|
onChange: f,
|
|
4056
|
-
style:
|
|
4152
|
+
style: E
|
|
4057
4153
|
}
|
|
4058
4154
|
)
|
|
4059
4155
|
] })
|
|
@@ -4083,7 +4179,7 @@ const Ls = [
|
|
|
4083
4179
|
{
|
|
4084
4180
|
type: "button",
|
|
4085
4181
|
onClick: () => {
|
|
4086
|
-
j("login"),
|
|
4182
|
+
j("login"), $(1);
|
|
4087
4183
|
},
|
|
4088
4184
|
style: {
|
|
4089
4185
|
background: "none",
|
|
@@ -4115,7 +4211,7 @@ const Ls = [
|
|
|
4115
4211
|
color: g.type === "success" ? i : "#ef4444"
|
|
4116
4212
|
},
|
|
4117
4213
|
children: [
|
|
4118
|
-
g.type === "success" ? /* @__PURE__ */ n.jsx(
|
|
4214
|
+
g.type === "success" ? /* @__PURE__ */ n.jsx(de, { size: 20 }) : /* @__PURE__ */ n.jsx(le, { size: 20 }),
|
|
4119
4215
|
/* @__PURE__ */ n.jsx("span", { children: g.text })
|
|
4120
4216
|
]
|
|
4121
4217
|
}
|
|
@@ -4227,7 +4323,7 @@ const Ls = [
|
|
|
4227
4323
|
children: t
|
|
4228
4324
|
}
|
|
4229
4325
|
) : typeof e == "function" ? e() : e;
|
|
4230
|
-
},
|
|
4326
|
+
}, qs = ({
|
|
4231
4327
|
isOpen: t,
|
|
4232
4328
|
onClose: e,
|
|
4233
4329
|
onSuccess: r,
|
|
@@ -4236,19 +4332,19 @@ const Ls = [
|
|
|
4236
4332
|
token: i,
|
|
4237
4333
|
colors: o
|
|
4238
4334
|
}) => {
|
|
4239
|
-
const { baseUrl: l, apiKey: h, appId:
|
|
4335
|
+
const { baseUrl: l, apiKey: h, appId: d } = ge(), [u, b] = O(!1), [y, w] = O(""), [c, j] = O("warning"), [m, $] = O(!1);
|
|
4240
4336
|
if (te(() => {
|
|
4241
4337
|
if (typeof window > "u") return;
|
|
4242
4338
|
const g = () => {
|
|
4243
|
-
|
|
4339
|
+
$(window.innerWidth < 640);
|
|
4244
4340
|
};
|
|
4245
4341
|
return g(), window.addEventListener("resize", g), () => window.removeEventListener("resize", g);
|
|
4246
4342
|
}, []), !t) return null;
|
|
4247
|
-
const
|
|
4343
|
+
const I = async () => {
|
|
4248
4344
|
b(!0), j("processing");
|
|
4249
4345
|
try {
|
|
4250
|
-
const { data: g } = await
|
|
4251
|
-
data: { appId:
|
|
4346
|
+
const { data: g } = await M.delete(`${l}/users/delete/${a}`, {
|
|
4347
|
+
data: { appId: d },
|
|
4252
4348
|
headers: {
|
|
4253
4349
|
"x-api-key": h
|
|
4254
4350
|
}
|
|
@@ -4261,10 +4357,10 @@ const Ls = [
|
|
|
4261
4357
|
} finally {
|
|
4262
4358
|
b(!1);
|
|
4263
4359
|
}
|
|
4264
|
-
},
|
|
4265
|
-
g.target === g.currentTarget &&
|
|
4266
|
-
},
|
|
4267
|
-
switch (
|
|
4360
|
+
}, z = y.toLowerCase() === "delete my account", C = (g) => {
|
|
4361
|
+
g.target === g.currentTarget && c !== "processing" && c !== "success" && e();
|
|
4362
|
+
}, q = () => {
|
|
4363
|
+
switch (c) {
|
|
4268
4364
|
case "warning":
|
|
4269
4365
|
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
4270
4366
|
/* @__PURE__ */ n.jsxs(
|
|
@@ -4375,7 +4471,7 @@ const Ls = [
|
|
|
4375
4471
|
display: "flex",
|
|
4376
4472
|
alignItems: "flex-start"
|
|
4377
4473
|
},
|
|
4378
|
-
children: /* @__PURE__ */ n.jsx(
|
|
4474
|
+
children: /* @__PURE__ */ n.jsx(_t, { size: 24 })
|
|
4379
4475
|
}
|
|
4380
4476
|
),
|
|
4381
4477
|
/* @__PURE__ */ n.jsxs("div", { style: { flex: 1 }, children: [
|
|
@@ -4405,14 +4501,14 @@ const Ls = [
|
|
|
4405
4501
|
text: "All your data will be permanently deleted"
|
|
4406
4502
|
},
|
|
4407
4503
|
{
|
|
4408
|
-
icon: /* @__PURE__ */ n.jsx(
|
|
4504
|
+
icon: /* @__PURE__ */ n.jsx(Ds, { size: 16 }),
|
|
4409
4505
|
text: "This action cannot be reversed"
|
|
4410
4506
|
},
|
|
4411
4507
|
{
|
|
4412
|
-
icon: /* @__PURE__ */ n.jsx(
|
|
4508
|
+
icon: /* @__PURE__ */ n.jsx(ct, { size: 16 }),
|
|
4413
4509
|
text: "You will lose access to all services"
|
|
4414
4510
|
}
|
|
4415
|
-
].map((g,
|
|
4511
|
+
].map((g, R) => /* @__PURE__ */ n.jsxs(
|
|
4416
4512
|
"div",
|
|
4417
4513
|
{
|
|
4418
4514
|
style: {
|
|
@@ -4427,7 +4523,7 @@ const Ls = [
|
|
|
4427
4523
|
/* @__PURE__ */ n.jsx("span", { children: g.text })
|
|
4428
4524
|
]
|
|
4429
4525
|
},
|
|
4430
|
-
|
|
4526
|
+
R
|
|
4431
4527
|
))
|
|
4432
4528
|
}
|
|
4433
4529
|
)
|
|
@@ -4536,7 +4632,7 @@ const Ls = [
|
|
|
4536
4632
|
color: "white",
|
|
4537
4633
|
flexShrink: 0
|
|
4538
4634
|
},
|
|
4539
|
-
children: /* @__PURE__ */ n.jsx(
|
|
4635
|
+
children: /* @__PURE__ */ n.jsx(_t, { size: 24 })
|
|
4540
4636
|
}
|
|
4541
4637
|
),
|
|
4542
4638
|
/* @__PURE__ */ n.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ n.jsx(
|
|
@@ -4585,7 +4681,7 @@ const Ls = [
|
|
|
4585
4681
|
width: "100%",
|
|
4586
4682
|
padding: "14px 16px",
|
|
4587
4683
|
borderRadius: "10px",
|
|
4588
|
-
border: `2px solid ${
|
|
4684
|
+
border: `2px solid ${z ? o.success : o.error}`,
|
|
4589
4685
|
backgroundColor: "transparent",
|
|
4590
4686
|
color: o.textPrimary,
|
|
4591
4687
|
fontSize: "15px",
|
|
@@ -4602,7 +4698,7 @@ const Ls = [
|
|
|
4602
4698
|
autoFocus: !0
|
|
4603
4699
|
}
|
|
4604
4700
|
),
|
|
4605
|
-
|
|
4701
|
+
z && /* @__PURE__ */ n.jsxs(
|
|
4606
4702
|
"div",
|
|
4607
4703
|
{
|
|
4608
4704
|
style: {
|
|
@@ -4663,8 +4759,8 @@ const Ls = [
|
|
|
4663
4759
|
/* @__PURE__ */ n.jsxs(
|
|
4664
4760
|
"button",
|
|
4665
4761
|
{
|
|
4666
|
-
onClick:
|
|
4667
|
-
disabled: !
|
|
4762
|
+
onClick: I,
|
|
4763
|
+
disabled: !z || u,
|
|
4668
4764
|
style: {
|
|
4669
4765
|
padding: "10px 24px",
|
|
4670
4766
|
borderRadius: "10px",
|
|
@@ -4673,22 +4769,22 @@ const Ls = [
|
|
|
4673
4769
|
color: "white",
|
|
4674
4770
|
fontSize: "14px",
|
|
4675
4771
|
fontWeight: 600,
|
|
4676
|
-
cursor: !
|
|
4772
|
+
cursor: !z || u ? "not-allowed" : "pointer",
|
|
4677
4773
|
flex: m ? "none" : 1,
|
|
4678
4774
|
minWidth: m ? "100%" : "140px",
|
|
4679
|
-
opacity: !
|
|
4775
|
+
opacity: !z || u ? 0.6 : 1,
|
|
4680
4776
|
display: "flex",
|
|
4681
4777
|
alignItems: "center",
|
|
4682
4778
|
justifyContent: "center",
|
|
4683
4779
|
gap: "8px",
|
|
4684
4780
|
transition: "all 0.2s ease",
|
|
4685
|
-
boxShadow: !
|
|
4781
|
+
boxShadow: !z || u ? "none" : "0 4px 12px rgba(239, 68, 68, 0.4)"
|
|
4686
4782
|
},
|
|
4687
4783
|
onMouseOver: (g) => {
|
|
4688
|
-
|
|
4784
|
+
z && !u && (g.currentTarget.style.transform = "translateY(-1px)", g.currentTarget.style.boxShadow = "0 6px 20px rgba(239, 68, 68, 0.5)");
|
|
4689
4785
|
},
|
|
4690
4786
|
onMouseOut: (g) => {
|
|
4691
|
-
|
|
4787
|
+
z && !u && (g.currentTarget.style.transform = "translateY(0)", g.currentTarget.style.boxShadow = "0 4px 12px rgba(239, 68, 68, 0.4)");
|
|
4692
4788
|
},
|
|
4693
4789
|
children: [
|
|
4694
4790
|
/* @__PURE__ */ n.jsx(Ne, { size: 16 }),
|
|
@@ -4779,7 +4875,7 @@ const Ls = [
|
|
|
4779
4875
|
{ text: "Removing your data", active: !0 },
|
|
4780
4876
|
{ text: "Closing active sessions", active: !1 },
|
|
4781
4877
|
{ text: "Finalizing deletion", active: !1 }
|
|
4782
|
-
].map((g,
|
|
4878
|
+
].map((g, R) => /* @__PURE__ */ n.jsxs(
|
|
4783
4879
|
"div",
|
|
4784
4880
|
{
|
|
4785
4881
|
style: {
|
|
@@ -4818,7 +4914,7 @@ const Ls = [
|
|
|
4818
4914
|
)
|
|
4819
4915
|
]
|
|
4820
4916
|
},
|
|
4821
|
-
|
|
4917
|
+
R
|
|
4822
4918
|
))
|
|
4823
4919
|
}
|
|
4824
4920
|
) }),
|
|
@@ -4837,7 +4933,7 @@ const Ls = [
|
|
|
4837
4933
|
},
|
|
4838
4934
|
children: [
|
|
4839
4935
|
/* @__PURE__ */ n.jsx(
|
|
4840
|
-
|
|
4936
|
+
cr,
|
|
4841
4937
|
{
|
|
4842
4938
|
size: 18,
|
|
4843
4939
|
style: { color: o.accent, flexShrink: 0 }
|
|
@@ -5021,7 +5117,7 @@ const Ls = [
|
|
|
5021
5117
|
animation: "scaleIn 0.3s ease-out"
|
|
5022
5118
|
},
|
|
5023
5119
|
className: "delete-modal-container",
|
|
5024
|
-
children:
|
|
5120
|
+
children: q()
|
|
5025
5121
|
}
|
|
5026
5122
|
),
|
|
5027
5123
|
/* @__PURE__ */ n.jsx("style", { children: `
|
|
@@ -5082,26 +5178,26 @@ const Ls = [
|
|
|
5082
5178
|
]
|
|
5083
5179
|
}
|
|
5084
5180
|
);
|
|
5085
|
-
},
|
|
5181
|
+
}, Ms = ({
|
|
5086
5182
|
isOpen: t,
|
|
5087
5183
|
onClose: e,
|
|
5088
5184
|
onUpdate: r,
|
|
5089
5185
|
colors: s
|
|
5090
5186
|
}) => {
|
|
5091
|
-
const [a, i] = O(""), [o, l] = O(!1), [h,
|
|
5187
|
+
const [a, i] = O(""), [o, l] = O(!1), [h, d] = O(!1), [u, b] = O({ isValid: !1, message: "", type: null });
|
|
5092
5188
|
if (te(() => {
|
|
5093
5189
|
if (typeof window > "u") return;
|
|
5094
|
-
const
|
|
5095
|
-
|
|
5190
|
+
const c = () => {
|
|
5191
|
+
d(window.innerWidth < 640);
|
|
5096
5192
|
};
|
|
5097
|
-
return
|
|
5193
|
+
return c(), window.addEventListener("resize", c), () => window.removeEventListener("resize", c);
|
|
5098
5194
|
}, []), te(() => {
|
|
5099
5195
|
if (!a.trim()) {
|
|
5100
5196
|
b({ isValid: !1, message: "", type: null });
|
|
5101
5197
|
return;
|
|
5102
5198
|
}
|
|
5103
5199
|
try {
|
|
5104
|
-
const
|
|
5200
|
+
const c = new URL(a), j = /\.(jpg|jpeg|png|gif|webp|svg)$/i.test(c.pathname);
|
|
5105
5201
|
b(j ? {
|
|
5106
5202
|
isValid: !0,
|
|
5107
5203
|
message: "Valid image URL",
|
|
@@ -5128,8 +5224,8 @@ const Ls = [
|
|
|
5128
5224
|
l(!1);
|
|
5129
5225
|
}
|
|
5130
5226
|
}
|
|
5131
|
-
}, w = (
|
|
5132
|
-
|
|
5227
|
+
}, w = (c) => {
|
|
5228
|
+
c.target === c.currentTarget && e();
|
|
5133
5229
|
};
|
|
5134
5230
|
return /* @__PURE__ */ n.jsxs(
|
|
5135
5231
|
"div",
|
|
@@ -5236,11 +5332,11 @@ const Ls = [
|
|
|
5236
5332
|
flexShrink: 0,
|
|
5237
5333
|
transition: "all 0.2s ease"
|
|
5238
5334
|
},
|
|
5239
|
-
onMouseOver: (
|
|
5240
|
-
|
|
5335
|
+
onMouseOver: (c) => {
|
|
5336
|
+
c.currentTarget.style.backgroundColor = s.border, c.currentTarget.style.color = s.textPrimary;
|
|
5241
5337
|
},
|
|
5242
|
-
onMouseOut: (
|
|
5243
|
-
|
|
5338
|
+
onMouseOut: (c) => {
|
|
5339
|
+
c.currentTarget.style.backgroundColor = "transparent", c.currentTarget.style.color = s.textTertiary;
|
|
5244
5340
|
},
|
|
5245
5341
|
children: /* @__PURE__ */ n.jsx(Pe, { size: 20 })
|
|
5246
5342
|
}
|
|
@@ -5285,7 +5381,7 @@ const Ls = [
|
|
|
5285
5381
|
id: "avatar-url",
|
|
5286
5382
|
placeholder: "https://example.com/your-avatar.jpg",
|
|
5287
5383
|
value: a,
|
|
5288
|
-
onChange: (
|
|
5384
|
+
onChange: (c) => i(c.target.value),
|
|
5289
5385
|
style: {
|
|
5290
5386
|
width: "100%",
|
|
5291
5387
|
padding: "14px 16px",
|
|
@@ -5299,11 +5395,11 @@ const Ls = [
|
|
|
5299
5395
|
transition: "all 0.2s ease",
|
|
5300
5396
|
boxSizing: "border-box"
|
|
5301
5397
|
},
|
|
5302
|
-
onFocus: (
|
|
5303
|
-
|
|
5398
|
+
onFocus: (c) => {
|
|
5399
|
+
c.target.style.borderColor = s.accent, c.target.style.boxShadow = `0 0 0 3px ${s.accent}20`;
|
|
5304
5400
|
},
|
|
5305
|
-
onBlur: (
|
|
5306
|
-
|
|
5401
|
+
onBlur: (c) => {
|
|
5402
|
+
c.target.style.borderColor = u.type === "error" ? s.error : u.type === "success" ? s.success : s.border, c.target.style.boxShadow = "none";
|
|
5307
5403
|
},
|
|
5308
5404
|
disabled: o
|
|
5309
5405
|
}
|
|
@@ -5334,7 +5430,7 @@ const Ls = [
|
|
|
5334
5430
|
color: u.type === "success" ? s.success : u.type === "error" ? s.error : s.textTertiary
|
|
5335
5431
|
},
|
|
5336
5432
|
children: [
|
|
5337
|
-
u.type === "success" && /* @__PURE__ */ n.jsx(
|
|
5433
|
+
u.type === "success" && /* @__PURE__ */ n.jsx(de, { size: 14 }),
|
|
5338
5434
|
u.type === "error" && /* @__PURE__ */ n.jsx(le, { size: 14 }),
|
|
5339
5435
|
u.type === "warning" && /* @__PURE__ */ n.jsx(le, { size: 14 }),
|
|
5340
5436
|
u.message
|
|
@@ -5378,8 +5474,8 @@ const Ls = [
|
|
|
5378
5474
|
border: `2px solid ${s.success}40`,
|
|
5379
5475
|
margin: "0 auto"
|
|
5380
5476
|
},
|
|
5381
|
-
onError: (
|
|
5382
|
-
|
|
5477
|
+
onError: (c) => {
|
|
5478
|
+
c.currentTarget.style.display = "none";
|
|
5383
5479
|
}
|
|
5384
5480
|
}
|
|
5385
5481
|
)
|
|
@@ -5420,11 +5516,11 @@ const Ls = [
|
|
|
5420
5516
|
opacity: o ? 0.6 : 1,
|
|
5421
5517
|
transition: "all 0.2s ease"
|
|
5422
5518
|
},
|
|
5423
|
-
onMouseOver: (
|
|
5424
|
-
o || (
|
|
5519
|
+
onMouseOver: (c) => {
|
|
5520
|
+
o || (c.currentTarget.style.backgroundColor = s.border, c.currentTarget.style.transform = "translateY(-1px)");
|
|
5425
5521
|
},
|
|
5426
|
-
onMouseOut: (
|
|
5427
|
-
o || (
|
|
5522
|
+
onMouseOut: (c) => {
|
|
5523
|
+
o || (c.currentTarget.style.backgroundColor = "transparent", c.currentTarget.style.transform = "translateY(0)");
|
|
5428
5524
|
},
|
|
5429
5525
|
children: "Cancel"
|
|
5430
5526
|
}
|
|
@@ -5453,11 +5549,11 @@ const Ls = [
|
|
|
5453
5549
|
transition: "all 0.2s ease",
|
|
5454
5550
|
boxShadow: o || !u.isValid ? "none" : `0 4px 12px ${s.accent}40`
|
|
5455
5551
|
},
|
|
5456
|
-
onMouseOver: (
|
|
5457
|
-
!o && u.isValid && (
|
|
5552
|
+
onMouseOver: (c) => {
|
|
5553
|
+
!o && u.isValid && (c.currentTarget.style.transform = "translateY(-1px)", c.currentTarget.style.boxShadow = `0 6px 20px ${s.accent}60`);
|
|
5458
5554
|
},
|
|
5459
|
-
onMouseOut: (
|
|
5460
|
-
!o && u.isValid && (
|
|
5555
|
+
onMouseOut: (c) => {
|
|
5556
|
+
!o && u.isValid && (c.currentTarget.style.transform = "translateY(0)", c.currentTarget.style.boxShadow = `0 4px 12px ${s.accent}40`);
|
|
5461
5557
|
},
|
|
5462
5558
|
children: o ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
5463
5559
|
/* @__PURE__ */ n.jsx(
|
|
@@ -5534,7 +5630,7 @@ const Ls = [
|
|
|
5534
5630
|
]
|
|
5535
5631
|
}
|
|
5536
5632
|
);
|
|
5537
|
-
},
|
|
5633
|
+
}, Bs = ({
|
|
5538
5634
|
isOpen: t,
|
|
5539
5635
|
onClose: e,
|
|
5540
5636
|
onSuccess: r,
|
|
@@ -5542,40 +5638,40 @@ const Ls = [
|
|
|
5542
5638
|
userId: a,
|
|
5543
5639
|
colors: i
|
|
5544
5640
|
}) => {
|
|
5545
|
-
const { baseUrl: o, apiKey: l, appId: h } = ge(), [
|
|
5641
|
+
const { baseUrl: o, apiKey: l, appId: h } = ge(), [d, u] = O({
|
|
5546
5642
|
currentPassword: "",
|
|
5547
5643
|
newPassword: "",
|
|
5548
5644
|
confirmPassword: ""
|
|
5549
|
-
}), [b, y] = O({}), [w,
|
|
5645
|
+
}), [b, y] = O({}), [w, c] = O(!1), [j, m] = O({
|
|
5550
5646
|
currentPassword: !1,
|
|
5551
5647
|
newPassword: !1,
|
|
5552
5648
|
confirmPassword: !1
|
|
5553
|
-
}), [
|
|
5649
|
+
}), [$, I] = O(!1);
|
|
5554
5650
|
if (Le.useEffect(() => {
|
|
5555
5651
|
if (typeof window > "u") return;
|
|
5556
5652
|
const v = () => {
|
|
5557
|
-
|
|
5653
|
+
I(window.innerWidth < 640);
|
|
5558
5654
|
};
|
|
5559
5655
|
return v(), window.addEventListener("resize", v), () => window.removeEventListener("resize", v);
|
|
5560
5656
|
}, []), !t) return null;
|
|
5561
|
-
const
|
|
5562
|
-
const { name:
|
|
5563
|
-
u((F) => ({ ...F, [
|
|
5657
|
+
const z = (v) => {
|
|
5658
|
+
const { name: D, value: B } = v.target;
|
|
5659
|
+
u((F) => ({ ...F, [D]: B })), b[D] && y((F) => ({ ...F, [D]: "" }));
|
|
5564
5660
|
}, C = (v) => {
|
|
5565
|
-
m((
|
|
5566
|
-
},
|
|
5661
|
+
m((D) => ({ ...D, [v]: !D[v] }));
|
|
5662
|
+
}, q = () => {
|
|
5567
5663
|
const v = {};
|
|
5568
|
-
return
|
|
5664
|
+
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
5665
|
}, g = async (v) => {
|
|
5570
|
-
if (v.preventDefault(), !!
|
|
5571
|
-
|
|
5666
|
+
if (v.preventDefault(), !!q()) {
|
|
5667
|
+
c(!0);
|
|
5572
5668
|
try {
|
|
5573
|
-
const { data:
|
|
5669
|
+
const { data: D } = await M.put(
|
|
5574
5670
|
`${o}/users/change-password/${a}`,
|
|
5575
5671
|
{
|
|
5576
5672
|
appId: h,
|
|
5577
|
-
currentPassword:
|
|
5578
|
-
newPassword:
|
|
5673
|
+
currentPassword: d.currentPassword,
|
|
5674
|
+
newPassword: d.newPassword
|
|
5579
5675
|
},
|
|
5580
5676
|
{
|
|
5581
5677
|
headers: {
|
|
@@ -5583,22 +5679,22 @@ const Ls = [
|
|
|
5583
5679
|
}
|
|
5584
5680
|
}
|
|
5585
5681
|
);
|
|
5586
|
-
|
|
5682
|
+
D.success ? (r(D.message || "Password updated successfully"), u({
|
|
5587
5683
|
currentPassword: "",
|
|
5588
5684
|
newPassword: "",
|
|
5589
5685
|
confirmPassword: ""
|
|
5590
|
-
}), e()) : s(
|
|
5591
|
-
} catch (
|
|
5592
|
-
s(
|
|
5686
|
+
}), e()) : s(D.message || "Failed to update password");
|
|
5687
|
+
} catch (D) {
|
|
5688
|
+
s(D.response?.data?.message || "Something went wrong");
|
|
5593
5689
|
} finally {
|
|
5594
|
-
|
|
5690
|
+
c(!1);
|
|
5595
5691
|
}
|
|
5596
5692
|
}
|
|
5597
|
-
},
|
|
5693
|
+
}, R = [
|
|
5598
5694
|
{
|
|
5599
5695
|
field: "currentPassword",
|
|
5600
5696
|
label: "Current Password",
|
|
5601
|
-
icon: /* @__PURE__ */ n.jsx(
|
|
5697
|
+
icon: /* @__PURE__ */ n.jsx(dt, { size: 18 })
|
|
5602
5698
|
},
|
|
5603
5699
|
{
|
|
5604
5700
|
field: "newPassword",
|
|
@@ -5727,7 +5823,7 @@ const Ls = [
|
|
|
5727
5823
|
}
|
|
5728
5824
|
),
|
|
5729
5825
|
/* @__PURE__ */ n.jsxs("form", { onSubmit: g, children: [
|
|
5730
|
-
|
|
5826
|
+
R.map(({ field: v, label: D, icon: B }) => /* @__PURE__ */ n.jsxs(
|
|
5731
5827
|
"div",
|
|
5732
5828
|
{
|
|
5733
5829
|
style: {
|
|
@@ -5747,7 +5843,7 @@ const Ls = [
|
|
|
5747
5843
|
fontWeight: 500,
|
|
5748
5844
|
lineHeight: "1.4"
|
|
5749
5845
|
},
|
|
5750
|
-
children:
|
|
5846
|
+
children: D
|
|
5751
5847
|
}
|
|
5752
5848
|
),
|
|
5753
5849
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
@@ -5762,7 +5858,7 @@ const Ls = [
|
|
|
5762
5858
|
color: i.textTertiary,
|
|
5763
5859
|
zIndex: 2
|
|
5764
5860
|
},
|
|
5765
|
-
children:
|
|
5861
|
+
children: B
|
|
5766
5862
|
}
|
|
5767
5863
|
),
|
|
5768
5864
|
/* @__PURE__ */ n.jsx(
|
|
@@ -5771,9 +5867,9 @@ const Ls = [
|
|
|
5771
5867
|
type: j[v] ? "text" : "password",
|
|
5772
5868
|
id: v,
|
|
5773
5869
|
name: v,
|
|
5774
|
-
placeholder: `Enter ${
|
|
5775
|
-
value:
|
|
5776
|
-
onChange:
|
|
5870
|
+
placeholder: `Enter ${D.toLowerCase()}`,
|
|
5871
|
+
value: d[v],
|
|
5872
|
+
onChange: z,
|
|
5777
5873
|
style: {
|
|
5778
5874
|
width: "100%",
|
|
5779
5875
|
padding: "14px 48px 14px 44px",
|
|
@@ -5853,7 +5949,7 @@ const Ls = [
|
|
|
5853
5949
|
style: {
|
|
5854
5950
|
display: "flex",
|
|
5855
5951
|
gap: "12px",
|
|
5856
|
-
flexDirection:
|
|
5952
|
+
flexDirection: $ ? "column-reverse" : "row",
|
|
5857
5953
|
justifyContent: "flex-end",
|
|
5858
5954
|
alignItems: "stretch"
|
|
5859
5955
|
},
|
|
@@ -5873,8 +5969,8 @@ const Ls = [
|
|
|
5873
5969
|
fontSize: "14px",
|
|
5874
5970
|
fontWeight: 500,
|
|
5875
5971
|
cursor: w ? "not-allowed" : "pointer",
|
|
5876
|
-
flex:
|
|
5877
|
-
minWidth:
|
|
5972
|
+
flex: $ ? "none" : 1,
|
|
5973
|
+
minWidth: $ ? "100%" : "120px",
|
|
5878
5974
|
opacity: w ? 0.6 : 1,
|
|
5879
5975
|
transition: "all 0.2s ease"
|
|
5880
5976
|
},
|
|
@@ -5901,8 +5997,8 @@ const Ls = [
|
|
|
5901
5997
|
fontSize: "14px",
|
|
5902
5998
|
fontWeight: 600,
|
|
5903
5999
|
cursor: w ? "not-allowed" : "pointer",
|
|
5904
|
-
flex:
|
|
5905
|
-
minWidth:
|
|
6000
|
+
flex: $ ? "none" : 1,
|
|
6001
|
+
minWidth: $ ? "100%" : "140px",
|
|
5906
6002
|
opacity: w ? 0.8 : 1,
|
|
5907
6003
|
display: "flex",
|
|
5908
6004
|
alignItems: "center",
|
|
@@ -5979,7 +6075,7 @@ const Ls = [
|
|
|
5979
6075
|
)
|
|
5980
6076
|
}
|
|
5981
6077
|
);
|
|
5982
|
-
},
|
|
6078
|
+
}, Ws = ({
|
|
5983
6079
|
isOpen: t,
|
|
5984
6080
|
onClose: e,
|
|
5985
6081
|
onVerify: r,
|
|
@@ -5989,7 +6085,7 @@ const Ls = [
|
|
|
5989
6085
|
otpSent: o,
|
|
5990
6086
|
verifying: l,
|
|
5991
6087
|
user: h,
|
|
5992
|
-
colors:
|
|
6088
|
+
colors: d,
|
|
5993
6089
|
darkMode: u
|
|
5994
6090
|
}) => {
|
|
5995
6091
|
if (!t) return null;
|
|
@@ -6009,18 +6105,18 @@ const Ls = [
|
|
|
6009
6105
|
{
|
|
6010
6106
|
className: "verify-email-modal",
|
|
6011
6107
|
style: {
|
|
6012
|
-
backgroundColor:
|
|
6013
|
-
border: `1px solid ${
|
|
6108
|
+
backgroundColor: d.surface,
|
|
6109
|
+
border: `1px solid ${d.border}`
|
|
6014
6110
|
},
|
|
6015
6111
|
children: [
|
|
6016
6112
|
/* @__PURE__ */ n.jsxs("div", { className: "modal-header", children: [
|
|
6017
|
-
/* @__PURE__ */ n.jsx("h3", { style: { color:
|
|
6113
|
+
/* @__PURE__ */ n.jsx("h3", { style: { color: d.textPrimary }, children: "Verify Your Email" }),
|
|
6018
6114
|
/* @__PURE__ */ n.jsx(
|
|
6019
6115
|
"button",
|
|
6020
6116
|
{
|
|
6021
6117
|
onClick: b,
|
|
6022
6118
|
className: "close-btn",
|
|
6023
|
-
style: { color:
|
|
6119
|
+
style: { color: d.textTertiary },
|
|
6024
6120
|
"aria-label": "Close verification modal",
|
|
6025
6121
|
children: /* @__PURE__ */ n.jsx(Pe, { size: 20, "aria-hidden": "true" })
|
|
6026
6122
|
}
|
|
@@ -6028,9 +6124,9 @@ const Ls = [
|
|
|
6028
6124
|
] }),
|
|
6029
6125
|
/* @__PURE__ */ n.jsxs("form", { className: "verify-form", onSubmit: r, children: [
|
|
6030
6126
|
/* @__PURE__ */ n.jsxs("div", { className: "form-group", children: [
|
|
6031
|
-
/* @__PURE__ */ n.jsx("label", { style: { color:
|
|
6127
|
+
/* @__PURE__ */ n.jsx("label", { style: { color: d.textSecondary }, children: "Email" }),
|
|
6032
6128
|
/* @__PURE__ */ n.jsxs("div", { className: "input-container", children: [
|
|
6033
|
-
/* @__PURE__ */ n.jsx(
|
|
6129
|
+
/* @__PURE__ */ n.jsx(ce, { size: 18, style: { color: d.textTertiary }, "aria-hidden": "true" }),
|
|
6034
6130
|
/* @__PURE__ */ n.jsx(
|
|
6035
6131
|
"input",
|
|
6036
6132
|
{
|
|
@@ -6039,9 +6135,9 @@ const Ls = [
|
|
|
6039
6135
|
onChange: (y) => i((w) => ({ ...w, email: y.target.value })),
|
|
6040
6136
|
placeholder: "Enter your email",
|
|
6041
6137
|
style: {
|
|
6042
|
-
backgroundColor:
|
|
6043
|
-
color:
|
|
6044
|
-
borderColor:
|
|
6138
|
+
backgroundColor: d.surfaceLight,
|
|
6139
|
+
color: d.textPrimary,
|
|
6140
|
+
borderColor: d.border
|
|
6045
6141
|
},
|
|
6046
6142
|
required: !0,
|
|
6047
6143
|
"aria-required": "true",
|
|
@@ -6051,9 +6147,9 @@ const Ls = [
|
|
|
6051
6147
|
] })
|
|
6052
6148
|
] }),
|
|
6053
6149
|
o && /* @__PURE__ */ n.jsxs("div", { className: "form-group", children: [
|
|
6054
|
-
/* @__PURE__ */ n.jsx("label", { style: { color:
|
|
6150
|
+
/* @__PURE__ */ n.jsx("label", { style: { color: d.textSecondary }, children: "OTP" }),
|
|
6055
6151
|
/* @__PURE__ */ n.jsxs("div", { className: "input-container", children: [
|
|
6056
|
-
/* @__PURE__ */ n.jsx(
|
|
6152
|
+
/* @__PURE__ */ n.jsx(dr, { size: 18, style: { color: d.textTertiary }, "aria-hidden": "true" }),
|
|
6057
6153
|
/* @__PURE__ */ n.jsx(
|
|
6058
6154
|
"input",
|
|
6059
6155
|
{
|
|
@@ -6062,9 +6158,9 @@ const Ls = [
|
|
|
6062
6158
|
onChange: (y) => i((w) => ({ ...w, otp: y.target.value })),
|
|
6063
6159
|
placeholder: "Enter OTP",
|
|
6064
6160
|
style: {
|
|
6065
|
-
backgroundColor:
|
|
6066
|
-
color:
|
|
6067
|
-
borderColor:
|
|
6161
|
+
backgroundColor: d.surfaceLight,
|
|
6162
|
+
color: d.textPrimary,
|
|
6163
|
+
borderColor: d.border
|
|
6068
6164
|
},
|
|
6069
6165
|
required: !0,
|
|
6070
6166
|
"aria-required": "true",
|
|
@@ -6080,12 +6176,12 @@ const Ls = [
|
|
|
6080
6176
|
disabled: l,
|
|
6081
6177
|
className: "btn-primary",
|
|
6082
6178
|
style: {
|
|
6083
|
-
background: `linear-gradient(to right, ${
|
|
6179
|
+
background: `linear-gradient(to right, ${d.accent}, ${d.accentHover})`,
|
|
6084
6180
|
opacity: l ? 0.7 : 1
|
|
6085
6181
|
},
|
|
6086
6182
|
"aria-label": l ? "Verifying email" : "Verify email",
|
|
6087
6183
|
children: [
|
|
6088
|
-
l ? /* @__PURE__ */ n.jsx(ae, { size: 16, className: "spinner", "aria-hidden": "true" }) : /* @__PURE__ */ n.jsx(
|
|
6184
|
+
l ? /* @__PURE__ */ n.jsx(ae, { size: 16, className: "spinner", "aria-hidden": "true" }) : /* @__PURE__ */ n.jsx(de, { size: 16, "aria-hidden": "true" }),
|
|
6089
6185
|
l ? "Verifying..." : "Verify Email"
|
|
6090
6186
|
]
|
|
6091
6187
|
}
|
|
@@ -6097,7 +6193,7 @@ const Ls = [
|
|
|
6097
6193
|
disabled: l,
|
|
6098
6194
|
className: "btn-primary",
|
|
6099
6195
|
style: {
|
|
6100
|
-
background: `linear-gradient(to right, ${
|
|
6196
|
+
background: `linear-gradient(to right, ${d.accent}, ${d.accentHover})`,
|
|
6101
6197
|
opacity: l ? 0.7 : 1
|
|
6102
6198
|
},
|
|
6103
6199
|
"aria-label": l ? "Sending OTP" : "Send OTP",
|
|
@@ -6204,8 +6300,8 @@ const Ls = [
|
|
|
6204
6300
|
}
|
|
6205
6301
|
|
|
6206
6302
|
.input-container input:focus {
|
|
6207
|
-
border-color: ${
|
|
6208
|
-
box-shadow: 0 0 0 3px ${
|
|
6303
|
+
border-color: ${d.accent};
|
|
6304
|
+
box-shadow: 0 0 0 3px ${d.accent}20;
|
|
6209
6305
|
}
|
|
6210
6306
|
|
|
6211
6307
|
.modal-actions {
|
|
@@ -6271,33 +6367,33 @@ const Ls = [
|
|
|
6271
6367
|
onVerify: i,
|
|
6272
6368
|
primaryColor: o = "#00C212"
|
|
6273
6369
|
}) => {
|
|
6274
|
-
const { baseUrl: l, apiKey: h, appId:
|
|
6370
|
+
const { baseUrl: l, apiKey: h, appId: d } = ge(), [u, b] = O(null), [y, w] = O(e), [c, j] = O(!0), [m, $] = O(!1), [I, z] = O(!1), [C, q] = O(!1), [g, R] = O(!1), [v, D] = O(!1), [B, F] = O(!1), [V, Z] = O(!1), [T, J] = O(!1), [A, P] = O(null), [K, Q] = O(!1), [G, f] = O({
|
|
6275
6371
|
email: "",
|
|
6276
6372
|
otp: "",
|
|
6277
|
-
appId:
|
|
6278
|
-
}), [S, x] = O(!1), [
|
|
6373
|
+
appId: d
|
|
6374
|
+
}), [S, x] = O(!1), [E, _] = O(!1);
|
|
6279
6375
|
te(() => {
|
|
6280
6376
|
if (typeof window < "u") {
|
|
6281
|
-
const
|
|
6282
|
-
return
|
|
6377
|
+
const k = () => b(window.innerWidth);
|
|
6378
|
+
return k(), window.addEventListener("resize", k), () => window.removeEventListener("resize", k);
|
|
6283
6379
|
}
|
|
6284
6380
|
}, []);
|
|
6285
|
-
const N = (
|
|
6286
|
-
P({ type:
|
|
6381
|
+
const N = (k, H) => {
|
|
6382
|
+
P({ type: k, message: H }), setTimeout(() => P(null), 3e3);
|
|
6287
6383
|
}, Y = () => {
|
|
6288
6384
|
J(!0);
|
|
6289
|
-
const
|
|
6385
|
+
const k = setTimeout(() => {
|
|
6290
6386
|
Z(!1), J(!1);
|
|
6291
6387
|
}, 150);
|
|
6292
|
-
return () => clearTimeout(
|
|
6388
|
+
return () => clearTimeout(k);
|
|
6293
6389
|
};
|
|
6294
6390
|
te(() => {
|
|
6295
|
-
const
|
|
6391
|
+
const k = (H) => {
|
|
6296
6392
|
const X = document.querySelector(".dropdown-container");
|
|
6297
6393
|
X && !X.contains(H.target) && Y();
|
|
6298
6394
|
};
|
|
6299
|
-
return V && document.addEventListener("mousedown",
|
|
6300
|
-
document.removeEventListener("mousedown",
|
|
6395
|
+
return V && document.addEventListener("mousedown", k), () => {
|
|
6396
|
+
document.removeEventListener("mousedown", k);
|
|
6301
6397
|
};
|
|
6302
6398
|
}, [V]);
|
|
6303
6399
|
const se = async () => {
|
|
@@ -6306,28 +6402,28 @@ const Ls = [
|
|
|
6306
6402
|
return;
|
|
6307
6403
|
}
|
|
6308
6404
|
try {
|
|
6309
|
-
|
|
6310
|
-
const
|
|
6405
|
+
_(!0);
|
|
6406
|
+
const k = await M.post(
|
|
6311
6407
|
`${l}/users/send-verify-otp/${y?.id}`,
|
|
6312
6408
|
{ email: G.email },
|
|
6313
6409
|
{
|
|
6314
|
-
headers: { "x-api-key": h, "x-app-id":
|
|
6410
|
+
headers: { "x-api-key": h, "x-app-id": d }
|
|
6315
6411
|
}
|
|
6316
6412
|
);
|
|
6317
|
-
|
|
6318
|
-
} catch (
|
|
6319
|
-
N("error",
|
|
6413
|
+
k.data.success ? (N("success", k.data.message || "OTP sent to email!"), x(!0)) : N("error", k.data.message || "Failed to send OTP");
|
|
6414
|
+
} catch (k) {
|
|
6415
|
+
N("error", k.response?.data?.message || "Server error");
|
|
6320
6416
|
} finally {
|
|
6321
|
-
|
|
6417
|
+
_(!1);
|
|
6322
6418
|
}
|
|
6323
|
-
}, ue = async (
|
|
6324
|
-
if (
|
|
6419
|
+
}, ue = async (k) => {
|
|
6420
|
+
if (k.preventDefault(), !G.email || !G.otp) {
|
|
6325
6421
|
N("error", "Please fill in all fields");
|
|
6326
6422
|
return;
|
|
6327
6423
|
}
|
|
6328
6424
|
try {
|
|
6329
|
-
|
|
6330
|
-
const H = await
|
|
6425
|
+
_(!0);
|
|
6426
|
+
const H = await M.post(
|
|
6331
6427
|
`${l}/users/verify-email`,
|
|
6332
6428
|
G
|
|
6333
6429
|
);
|
|
@@ -6339,7 +6435,7 @@ const Ls = [
|
|
|
6339
6435
|
JSON.stringify({ ...X, token: t })
|
|
6340
6436
|
), typeof i == "function" && i(X);
|
|
6341
6437
|
}
|
|
6342
|
-
f({ email: "", otp: "", appId:
|
|
6438
|
+
f({ email: "", otp: "", appId: d }), x(!1), F(!1);
|
|
6343
6439
|
} else
|
|
6344
6440
|
N("error", H.data.message || "Verification failed");
|
|
6345
6441
|
} catch (H) {
|
|
@@ -6348,12 +6444,12 @@ const Ls = [
|
|
|
6348
6444
|
H.response?.data?.message || "Something went wrong"
|
|
6349
6445
|
);
|
|
6350
6446
|
} finally {
|
|
6351
|
-
|
|
6447
|
+
_(!1);
|
|
6352
6448
|
}
|
|
6353
|
-
}, ve = async (
|
|
6449
|
+
}, ve = async (k) => {
|
|
6354
6450
|
if (!y) return !1;
|
|
6355
6451
|
try {
|
|
6356
|
-
const H = { ...y, avatarUrl:
|
|
6452
|
+
const H = { ...y, avatarUrl: k }, { data: X } = await M.put(
|
|
6357
6453
|
`${l}/users/update/${y.id}`,
|
|
6358
6454
|
H,
|
|
6359
6455
|
{ headers: { "x-api-key": h } }
|
|
@@ -6367,27 +6463,27 @@ const Ls = [
|
|
|
6367
6463
|
}
|
|
6368
6464
|
}, ur = async () => {
|
|
6369
6465
|
if (y) {
|
|
6370
|
-
|
|
6466
|
+
z(!0);
|
|
6371
6467
|
try {
|
|
6372
|
-
const { data:
|
|
6468
|
+
const { data: k } = await M.put(
|
|
6373
6469
|
`${l}/users/update/${y.id}`,
|
|
6374
6470
|
y,
|
|
6375
6471
|
{ headers: { "x-api-key": h } }
|
|
6376
6472
|
);
|
|
6377
|
-
|
|
6473
|
+
k.success ? (w(k.user), $(!1), localStorage.setItem(
|
|
6378
6474
|
"userInfo",
|
|
6379
|
-
JSON.stringify({ ...
|
|
6380
|
-
), N("success", "Profile updated successfully")) : N("error",
|
|
6381
|
-
} catch (
|
|
6382
|
-
console.error(
|
|
6475
|
+
JSON.stringify({ ...k.user, token: t })
|
|
6476
|
+
), N("success", "Profile updated successfully")) : N("error", k.message);
|
|
6477
|
+
} catch (k) {
|
|
6478
|
+
console.error(k), N("error", "Update failed");
|
|
6383
6479
|
} finally {
|
|
6384
|
-
|
|
6480
|
+
z(!1);
|
|
6385
6481
|
}
|
|
6386
6482
|
}
|
|
6387
|
-
}, pt = async (
|
|
6483
|
+
}, pt = async (k) => {
|
|
6388
6484
|
try {
|
|
6389
|
-
const { data: H } = await
|
|
6390
|
-
`${l}/users/check-user/${
|
|
6485
|
+
const { data: H } = await M.get(
|
|
6486
|
+
`${l}/users/check-user/${k}?appId=${d}`,
|
|
6391
6487
|
{ headers: { "x-api-key": h } }
|
|
6392
6488
|
);
|
|
6393
6489
|
H?.success === !0 && H?.exists === !1 && (console.warn("❌ User does not exist on server. Clearing session..."), localStorage.removeItem("userInfo"), w(null));
|
|
@@ -6409,12 +6505,12 @@ const Ls = [
|
|
|
6409
6505
|
}
|
|
6410
6506
|
})();
|
|
6411
6507
|
}, [e]), te(() => {
|
|
6412
|
-
y?.email && f((
|
|
6508
|
+
y?.email && f((k) => ({ ...k, email: y.email }));
|
|
6413
6509
|
}, [y?.email]);
|
|
6414
|
-
const ft = (
|
|
6415
|
-
let X = parseInt(
|
|
6510
|
+
const ft = (k, H) => {
|
|
6511
|
+
let X = parseInt(k.replace("#", ""), 16), pe = (X >> 16) + H, He = (X >> 8 & 255) + H, Ve = (X & 255) + H;
|
|
6416
6512
|
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
|
-
},
|
|
6513
|
+
}, U = r ? {
|
|
6418
6514
|
background: "#000000",
|
|
6419
6515
|
surface: "#09090b",
|
|
6420
6516
|
surfaceLight: "#27272a",
|
|
@@ -6443,7 +6539,7 @@ const Ls = [
|
|
|
6443
6539
|
border: "#e4e4e7",
|
|
6444
6540
|
warning: "#d97706"
|
|
6445
6541
|
};
|
|
6446
|
-
if (
|
|
6542
|
+
if (c)
|
|
6447
6543
|
return /* @__PURE__ */ n.jsx(
|
|
6448
6544
|
"div",
|
|
6449
6545
|
{
|
|
@@ -6453,7 +6549,7 @@ const Ls = [
|
|
|
6453
6549
|
display: "flex",
|
|
6454
6550
|
alignItems: "center",
|
|
6455
6551
|
justifyContent: "center",
|
|
6456
|
-
color:
|
|
6552
|
+
color: U.textPrimary,
|
|
6457
6553
|
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, sans-serif"
|
|
6458
6554
|
},
|
|
6459
6555
|
children: /* @__PURE__ */ n.jsxs(
|
|
@@ -6471,12 +6567,12 @@ const Ls = [
|
|
|
6471
6567
|
ae,
|
|
6472
6568
|
{
|
|
6473
6569
|
size: 40,
|
|
6474
|
-
color:
|
|
6570
|
+
color: U.accent,
|
|
6475
6571
|
style: { animation: "spin 1s linear infinite" },
|
|
6476
6572
|
"aria-hidden": "true"
|
|
6477
6573
|
}
|
|
6478
6574
|
),
|
|
6479
|
-
/* @__PURE__ */ n.jsx("p", { style: { color:
|
|
6575
|
+
/* @__PURE__ */ n.jsx("p", { style: { color: U.textTertiary, margin: 0 }, children: "Loading your profile..." })
|
|
6480
6576
|
]
|
|
6481
6577
|
}
|
|
6482
6578
|
)
|
|
@@ -6492,7 +6588,7 @@ const Ls = [
|
|
|
6492
6588
|
display: "flex",
|
|
6493
6589
|
alignItems: "center",
|
|
6494
6590
|
justifyContent: "center",
|
|
6495
|
-
color:
|
|
6591
|
+
color: U.textPrimary,
|
|
6496
6592
|
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, sans-serif"
|
|
6497
6593
|
},
|
|
6498
6594
|
children: /* @__PURE__ */ n.jsxs(
|
|
@@ -6506,8 +6602,8 @@ const Ls = [
|
|
|
6506
6602
|
textAlign: "center"
|
|
6507
6603
|
},
|
|
6508
6604
|
children: [
|
|
6509
|
-
/* @__PURE__ */ n.jsx(le, { size: 40, color:
|
|
6510
|
-
/* @__PURE__ */ n.jsx("p", { style: { color:
|
|
6605
|
+
/* @__PURE__ */ n.jsx(le, { size: 40, color: U.error, "aria-hidden": "true" }),
|
|
6606
|
+
/* @__PURE__ */ n.jsx("p", { style: { color: U.textTertiary, margin: 0 }, children: "No profile found. Please log in again." })
|
|
6511
6607
|
]
|
|
6512
6608
|
}
|
|
6513
6609
|
)
|
|
@@ -6526,7 +6622,7 @@ const Ls = [
|
|
|
6526
6622
|
value: y.email,
|
|
6527
6623
|
name: "email",
|
|
6528
6624
|
type: "email",
|
|
6529
|
-
icon:
|
|
6625
|
+
icon: ce
|
|
6530
6626
|
},
|
|
6531
6627
|
{
|
|
6532
6628
|
label: "Phone Number",
|
|
@@ -6551,13 +6647,13 @@ const Ls = [
|
|
|
6551
6647
|
display: "flex",
|
|
6552
6648
|
alignItems: "center",
|
|
6553
6649
|
justifyContent: "center",
|
|
6554
|
-
color:
|
|
6650
|
+
color: U.textPrimary,
|
|
6555
6651
|
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, sans-serif",
|
|
6556
6652
|
lineHeight: 1.5,
|
|
6557
6653
|
minHeight: "80vh"
|
|
6558
6654
|
},
|
|
6559
6655
|
children: [
|
|
6560
|
-
|
|
6656
|
+
A && /* @__PURE__ */ n.jsxs(
|
|
6561
6657
|
"div",
|
|
6562
6658
|
{
|
|
6563
6659
|
style: {
|
|
@@ -6577,7 +6673,7 @@ const Ls = [
|
|
|
6577
6673
|
fontWeight: 500,
|
|
6578
6674
|
maxWidth: "400px",
|
|
6579
6675
|
animation: "slideIn 0.3s ease-out",
|
|
6580
|
-
...
|
|
6676
|
+
...A.type === "success" ? {
|
|
6581
6677
|
backgroundColor: r ? "rgba(16, 185, 129, 0.1)" : "rgba(16, 185, 129, 0.05)",
|
|
6582
6678
|
borderColor: r ? "rgba(16, 185, 129, 0.3)" : "rgba(16, 185, 129, 0.2)",
|
|
6583
6679
|
color: r ? "#34d399" : "#059669"
|
|
@@ -6590,8 +6686,8 @@ const Ls = [
|
|
|
6590
6686
|
role: "alert",
|
|
6591
6687
|
"aria-live": "polite",
|
|
6592
6688
|
children: [
|
|
6593
|
-
|
|
6594
|
-
|
|
6689
|
+
A.type === "success" ? /* @__PURE__ */ n.jsx(de, { size: 20, "aria-hidden": "true" }) : /* @__PURE__ */ n.jsx(le, { size: 20, "aria-hidden": "true" }),
|
|
6690
|
+
A.message
|
|
6595
6691
|
]
|
|
6596
6692
|
}
|
|
6597
6693
|
),
|
|
@@ -6637,7 +6733,7 @@ const Ls = [
|
|
|
6637
6733
|
"section",
|
|
6638
6734
|
{
|
|
6639
6735
|
style: {
|
|
6640
|
-
backgroundColor:
|
|
6736
|
+
backgroundColor: U.surface,
|
|
6641
6737
|
borderRadius: "16px",
|
|
6642
6738
|
position: "relative",
|
|
6643
6739
|
padding: "24px",
|
|
@@ -6659,7 +6755,7 @@ const Ls = [
|
|
|
6659
6755
|
rel: "noopener noreferrer",
|
|
6660
6756
|
style: { position: "absolute", top: "18px", left: "18px" },
|
|
6661
6757
|
children: /* @__PURE__ */ n.jsx(
|
|
6662
|
-
|
|
6758
|
+
cs,
|
|
6663
6759
|
{
|
|
6664
6760
|
size: 20,
|
|
6665
6761
|
style: {
|
|
@@ -6691,7 +6787,7 @@ const Ls = [
|
|
|
6691
6787
|
borderRadius: "50%",
|
|
6692
6788
|
objectFit: "cover",
|
|
6693
6789
|
boxShadow: "0 10px 25px -5px rgba(0, 0, 0, 0.3)",
|
|
6694
|
-
border: `3px solid ${
|
|
6790
|
+
border: `3px solid ${U.border}`
|
|
6695
6791
|
},
|
|
6696
6792
|
width: 128,
|
|
6697
6793
|
height: 128,
|
|
@@ -6701,12 +6797,12 @@ const Ls = [
|
|
|
6701
6797
|
/* @__PURE__ */ n.jsx(
|
|
6702
6798
|
"button",
|
|
6703
6799
|
{
|
|
6704
|
-
onClick: () =>
|
|
6800
|
+
onClick: () => q(!0),
|
|
6705
6801
|
style: {
|
|
6706
6802
|
position: "absolute",
|
|
6707
6803
|
bottom: "8px",
|
|
6708
6804
|
right: "8px",
|
|
6709
|
-
backgroundColor:
|
|
6805
|
+
backgroundColor: U.accent,
|
|
6710
6806
|
color: "white",
|
|
6711
6807
|
padding: "8px",
|
|
6712
6808
|
borderRadius: "50%",
|
|
@@ -6733,7 +6829,7 @@ const Ls = [
|
|
|
6733
6829
|
fontSize: "24px",
|
|
6734
6830
|
fontWeight: 600,
|
|
6735
6831
|
margin: "0 0 4px 0",
|
|
6736
|
-
color:
|
|
6832
|
+
color: U.textPrimary
|
|
6737
6833
|
},
|
|
6738
6834
|
children: y.name
|
|
6739
6835
|
}
|
|
@@ -6742,7 +6838,7 @@ const Ls = [
|
|
|
6742
6838
|
"p",
|
|
6743
6839
|
{
|
|
6744
6840
|
style: {
|
|
6745
|
-
color:
|
|
6841
|
+
color: U.textTertiary,
|
|
6746
6842
|
margin: "0 0 8px 0"
|
|
6747
6843
|
},
|
|
6748
6844
|
children: y.email
|
|
@@ -6753,7 +6849,7 @@ const Ls = [
|
|
|
6753
6849
|
{
|
|
6754
6850
|
style: {
|
|
6755
6851
|
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 ?
|
|
6852
|
+
color: y.isVerified ? U.success : U.warning,
|
|
6757
6853
|
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
6854
|
padding: "6px 12px",
|
|
6759
6855
|
borderRadius: "20px",
|
|
@@ -6765,7 +6861,7 @@ const Ls = [
|
|
|
6765
6861
|
marginTop: "8px"
|
|
6766
6862
|
},
|
|
6767
6863
|
children: [
|
|
6768
|
-
y.isVerified ? /* @__PURE__ */ n.jsx(
|
|
6864
|
+
y.isVerified ? /* @__PURE__ */ n.jsx(de, { size: 16, "aria-hidden": "true" }) : /* @__PURE__ */ n.jsx(le, { size: 16, "aria-hidden": "true" }),
|
|
6769
6865
|
y.isVerified ? "Email Verified" : "Not Verified"
|
|
6770
6866
|
]
|
|
6771
6867
|
}
|
|
@@ -6785,11 +6881,11 @@ const Ls = [
|
|
|
6785
6881
|
/* @__PURE__ */ n.jsxs(
|
|
6786
6882
|
"button",
|
|
6787
6883
|
{
|
|
6788
|
-
onClick: () =>
|
|
6884
|
+
onClick: () => $(!1),
|
|
6789
6885
|
style: {
|
|
6790
|
-
backgroundColor:
|
|
6791
|
-
border: `1px solid ${
|
|
6792
|
-
color:
|
|
6886
|
+
backgroundColor: U.surfaceLight,
|
|
6887
|
+
border: `1px solid ${U.border}`,
|
|
6888
|
+
color: U.textPrimary,
|
|
6793
6889
|
padding: "10px 20px",
|
|
6794
6890
|
borderRadius: "6px",
|
|
6795
6891
|
borderStyle: "solid",
|
|
@@ -6815,15 +6911,15 @@ const Ls = [
|
|
|
6815
6911
|
"button",
|
|
6816
6912
|
{
|
|
6817
6913
|
onClick: ur,
|
|
6818
|
-
disabled:
|
|
6914
|
+
disabled: I,
|
|
6819
6915
|
style: {
|
|
6820
|
-
background: `linear-gradient(to right, ${
|
|
6821
|
-
opacity:
|
|
6916
|
+
background: `linear-gradient(to right, ${U.accent}, ${U.accentHover})`,
|
|
6917
|
+
opacity: I ? 0.7 : 1,
|
|
6822
6918
|
color: "white",
|
|
6823
6919
|
padding: "10px 20px",
|
|
6824
6920
|
borderRadius: "6px",
|
|
6825
6921
|
border: "none",
|
|
6826
|
-
cursor:
|
|
6922
|
+
cursor: I ? "not-allowed" : "pointer",
|
|
6827
6923
|
transition: "all 0.2s ease",
|
|
6828
6924
|
fontSize: "12px",
|
|
6829
6925
|
fontWeight: 500,
|
|
@@ -6836,15 +6932,15 @@ const Ls = [
|
|
|
6836
6932
|
flex: u && window.innerWidth < 1024 ? "1" : "auto"
|
|
6837
6933
|
},
|
|
6838
6934
|
children: [
|
|
6839
|
-
|
|
6935
|
+
I ? /* @__PURE__ */ n.jsx(
|
|
6840
6936
|
ae,
|
|
6841
6937
|
{
|
|
6842
6938
|
size: 16,
|
|
6843
6939
|
style: { animation: "spin 1s linear infinite" },
|
|
6844
6940
|
"aria-hidden": "true"
|
|
6845
6941
|
}
|
|
6846
|
-
) : /* @__PURE__ */ n.jsx(
|
|
6847
|
-
|
|
6942
|
+
) : /* @__PURE__ */ n.jsx(Rs, { size: 16, "aria-hidden": "true" }),
|
|
6943
|
+
I ? "Saving..." : "Save Changes"
|
|
6848
6944
|
]
|
|
6849
6945
|
}
|
|
6850
6946
|
)
|
|
@@ -6852,9 +6948,9 @@ const Ls = [
|
|
|
6852
6948
|
/* @__PURE__ */ n.jsxs(
|
|
6853
6949
|
"button",
|
|
6854
6950
|
{
|
|
6855
|
-
onClick: () =>
|
|
6951
|
+
onClick: () => $(!0),
|
|
6856
6952
|
style: {
|
|
6857
|
-
background: `linear-gradient(to right, ${
|
|
6953
|
+
background: `linear-gradient(to right, ${U.accent}, ${U.accentHover})`,
|
|
6858
6954
|
color: "white",
|
|
6859
6955
|
padding: "10px 20px",
|
|
6860
6956
|
borderRadius: "6px",
|
|
@@ -6872,7 +6968,7 @@ const Ls = [
|
|
|
6872
6968
|
flex: u && window.innerWidth < 1024 ? "1" : "auto"
|
|
6873
6969
|
},
|
|
6874
6970
|
children: [
|
|
6875
|
-
/* @__PURE__ */ n.jsx(
|
|
6971
|
+
/* @__PURE__ */ n.jsx(ks, { size: 16, "aria-hidden": "true" }),
|
|
6876
6972
|
"Edit Profile"
|
|
6877
6973
|
]
|
|
6878
6974
|
}
|
|
@@ -6919,8 +7015,8 @@ const Ls = [
|
|
|
6919
7015
|
"button",
|
|
6920
7016
|
{
|
|
6921
7017
|
style: {
|
|
6922
|
-
backgroundColor:
|
|
6923
|
-
color:
|
|
7018
|
+
backgroundColor: U.surfaceLight,
|
|
7019
|
+
color: U.textPrimary,
|
|
6924
7020
|
padding: "10px 20px",
|
|
6925
7021
|
borderRadius: "6px",
|
|
6926
7022
|
border: "none",
|
|
@@ -6953,8 +7049,8 @@ const Ls = [
|
|
|
6953
7049
|
bottom: "100%",
|
|
6954
7050
|
left: 0,
|
|
6955
7051
|
right: 0,
|
|
6956
|
-
backgroundColor:
|
|
6957
|
-
border: `1px solid ${
|
|
7052
|
+
backgroundColor: U.surface,
|
|
7053
|
+
border: `1px solid ${U.border}`,
|
|
6958
7054
|
borderRadius: "12px 12px 0 0",
|
|
6959
7055
|
boxShadow: "0 -8px 24px rgba(0, 0, 0, 0.25)",
|
|
6960
7056
|
zIndex: 200,
|
|
@@ -6967,14 +7063,14 @@ const Ls = [
|
|
|
6967
7063
|
"button",
|
|
6968
7064
|
{
|
|
6969
7065
|
onClick: () => {
|
|
6970
|
-
|
|
7066
|
+
R(!0), Y();
|
|
6971
7067
|
},
|
|
6972
7068
|
style: {
|
|
6973
7069
|
width: "100%",
|
|
6974
7070
|
padding: "14px 18px",
|
|
6975
7071
|
backgroundColor: "transparent",
|
|
6976
7072
|
border: "none",
|
|
6977
|
-
color:
|
|
7073
|
+
color: U.textPrimary,
|
|
6978
7074
|
cursor: "pointer",
|
|
6979
7075
|
transition: "all 0.2s ease",
|
|
6980
7076
|
fontSize: "13px",
|
|
@@ -6984,10 +7080,10 @@ const Ls = [
|
|
|
6984
7080
|
gap: "8px",
|
|
6985
7081
|
textAlign: "left"
|
|
6986
7082
|
},
|
|
6987
|
-
onMouseEnter: (
|
|
6988
|
-
onMouseLeave: (
|
|
7083
|
+
onMouseEnter: (k) => k.currentTarget.style.backgroundColor = U.surfaceLight,
|
|
7084
|
+
onMouseLeave: (k) => k.currentTarget.style.backgroundColor = "transparent",
|
|
6989
7085
|
children: [
|
|
6990
|
-
/* @__PURE__ */ n.jsx(
|
|
7086
|
+
/* @__PURE__ */ n.jsx(dt, { size: 14, "aria-hidden": "true" }),
|
|
6991
7087
|
"Change Password"
|
|
6992
7088
|
]
|
|
6993
7089
|
}
|
|
@@ -7013,12 +7109,12 @@ const Ls = [
|
|
|
7013
7109
|
gap: "8px",
|
|
7014
7110
|
textAlign: "left"
|
|
7015
7111
|
},
|
|
7016
|
-
onMouseEnter: (
|
|
7017
|
-
|
|
7112
|
+
onMouseEnter: (k) => {
|
|
7113
|
+
k.currentTarget.style.backgroundColor = r ? "rgba(239, 68, 68, 0.1)" : "rgba(239, 68, 68, 0.05)";
|
|
7018
7114
|
},
|
|
7019
|
-
onMouseLeave: (
|
|
7115
|
+
onMouseLeave: (k) => k.currentTarget.style.backgroundColor = "transparent",
|
|
7020
7116
|
children: [
|
|
7021
|
-
/* @__PURE__ */ n.jsx(
|
|
7117
|
+
/* @__PURE__ */ n.jsx(ct, { size: 14, "aria-hidden": "true" }),
|
|
7022
7118
|
"Logout"
|
|
7023
7119
|
]
|
|
7024
7120
|
}
|
|
@@ -7027,7 +7123,7 @@ const Ls = [
|
|
|
7027
7123
|
"button",
|
|
7028
7124
|
{
|
|
7029
7125
|
onClick: () => {
|
|
7030
|
-
|
|
7126
|
+
D(!0), Y();
|
|
7031
7127
|
},
|
|
7032
7128
|
style: {
|
|
7033
7129
|
width: "100%",
|
|
@@ -7044,10 +7140,10 @@ const Ls = [
|
|
|
7044
7140
|
gap: "8px",
|
|
7045
7141
|
textAlign: "left"
|
|
7046
7142
|
},
|
|
7047
|
-
onMouseEnter: (
|
|
7048
|
-
|
|
7143
|
+
onMouseEnter: (k) => {
|
|
7144
|
+
k.currentTarget.style.backgroundColor = r ? "rgba(239, 68, 68, 0.1)" : "rgba(239, 68, 68, 0.05)";
|
|
7049
7145
|
},
|
|
7050
|
-
onMouseLeave: (
|
|
7146
|
+
onMouseLeave: (k) => k.currentTarget.style.backgroundColor = "transparent",
|
|
7051
7147
|
children: [
|
|
7052
7148
|
/* @__PURE__ */ n.jsx(Ne, { size: 14, "aria-hidden": "true" }),
|
|
7053
7149
|
"Delete Account"
|
|
@@ -7078,7 +7174,7 @@ const Ls = [
|
|
|
7078
7174
|
"section",
|
|
7079
7175
|
{
|
|
7080
7176
|
style: {
|
|
7081
|
-
backgroundColor:
|
|
7177
|
+
backgroundColor: U.surface,
|
|
7082
7178
|
borderRadius: "16px",
|
|
7083
7179
|
padding: "24px",
|
|
7084
7180
|
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)"
|
|
@@ -7091,7 +7187,7 @@ const Ls = [
|
|
|
7091
7187
|
fontSize: "20px",
|
|
7092
7188
|
fontWeight: 600,
|
|
7093
7189
|
margin: "0 0 24px 0",
|
|
7094
|
-
color:
|
|
7190
|
+
color: U.textSecondary,
|
|
7095
7191
|
display: "flex",
|
|
7096
7192
|
alignItems: "center",
|
|
7097
7193
|
gap: "8px"
|
|
@@ -7114,8 +7210,8 @@ const Ls = [
|
|
|
7114
7210
|
gap: "20px"
|
|
7115
7211
|
}
|
|
7116
7212
|
},
|
|
7117
|
-
children: pr.map((
|
|
7118
|
-
const H =
|
|
7213
|
+
children: pr.map((k) => {
|
|
7214
|
+
const H = k.icon;
|
|
7119
7215
|
return /* @__PURE__ */ n.jsxs(
|
|
7120
7216
|
"div",
|
|
7121
7217
|
{
|
|
@@ -7129,7 +7225,7 @@ const Ls = [
|
|
|
7129
7225
|
"label",
|
|
7130
7226
|
{
|
|
7131
7227
|
style: {
|
|
7132
|
-
color:
|
|
7228
|
+
color: U.textTertiary,
|
|
7133
7229
|
fontSize: "12px",
|
|
7134
7230
|
fontWeight: 500,
|
|
7135
7231
|
display: "flex",
|
|
@@ -7138,16 +7234,16 @@ const Ls = [
|
|
|
7138
7234
|
},
|
|
7139
7235
|
children: [
|
|
7140
7236
|
/* @__PURE__ */ n.jsx(H, { size: 16, "aria-hidden": "true" }),
|
|
7141
|
-
|
|
7237
|
+
k.label
|
|
7142
7238
|
]
|
|
7143
7239
|
}
|
|
7144
7240
|
),
|
|
7145
7241
|
m ? /* @__PURE__ */ n.jsx(
|
|
7146
7242
|
"input",
|
|
7147
7243
|
{
|
|
7148
|
-
type:
|
|
7149
|
-
name:
|
|
7150
|
-
value: y[
|
|
7244
|
+
type: k.type,
|
|
7245
|
+
name: k.name,
|
|
7246
|
+
value: y[k.name],
|
|
7151
7247
|
onChange: (X) => w(
|
|
7152
7248
|
(pe) => pe && { ...pe, [X.target.name]: X.target.value }
|
|
7153
7249
|
),
|
|
@@ -7156,7 +7252,7 @@ const Ls = [
|
|
|
7156
7252
|
borderRadius: "8px",
|
|
7157
7253
|
border: `1px solid ${o}`,
|
|
7158
7254
|
backgroundColor: "transparent",
|
|
7159
|
-
color:
|
|
7255
|
+
color: U.textPrimary,
|
|
7160
7256
|
fontSize: "12px",
|
|
7161
7257
|
outline: "none",
|
|
7162
7258
|
transition: "border-color 0.2s ease",
|
|
@@ -7164,8 +7260,8 @@ const Ls = [
|
|
|
7164
7260
|
width: "100%",
|
|
7165
7261
|
boxSizing: "border-box"
|
|
7166
7262
|
},
|
|
7167
|
-
placeholder: `Enter ${
|
|
7168
|
-
"aria-label":
|
|
7263
|
+
placeholder: `Enter ${k.label.toLowerCase()}`,
|
|
7264
|
+
"aria-label": k.label
|
|
7169
7265
|
}
|
|
7170
7266
|
) : /* @__PURE__ */ n.jsx(
|
|
7171
7267
|
"div",
|
|
@@ -7179,15 +7275,15 @@ const Ls = [
|
|
|
7179
7275
|
display: "flex",
|
|
7180
7276
|
alignItems: "center",
|
|
7181
7277
|
boxSizing: "border-box",
|
|
7182
|
-
color:
|
|
7278
|
+
color: U.textPrimary,
|
|
7183
7279
|
backgroundColor: r ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.05)"
|
|
7184
7280
|
},
|
|
7185
|
-
children:
|
|
7281
|
+
children: k.value
|
|
7186
7282
|
}
|
|
7187
7283
|
)
|
|
7188
7284
|
]
|
|
7189
7285
|
},
|
|
7190
|
-
|
|
7286
|
+
k.name
|
|
7191
7287
|
);
|
|
7192
7288
|
})
|
|
7193
7289
|
}
|
|
@@ -7199,7 +7295,7 @@ const Ls = [
|
|
|
7199
7295
|
"section",
|
|
7200
7296
|
{
|
|
7201
7297
|
style: {
|
|
7202
|
-
backgroundColor:
|
|
7298
|
+
backgroundColor: U.surface,
|
|
7203
7299
|
borderRadius: "16px",
|
|
7204
7300
|
padding: "30px 24px",
|
|
7205
7301
|
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)"
|
|
@@ -7212,13 +7308,13 @@ const Ls = [
|
|
|
7212
7308
|
fontSize: "20px",
|
|
7213
7309
|
fontWeight: 600,
|
|
7214
7310
|
margin: "0 0 24px 0",
|
|
7215
|
-
color:
|
|
7311
|
+
color: U.textSecondary,
|
|
7216
7312
|
display: "flex",
|
|
7217
7313
|
alignItems: "center",
|
|
7218
7314
|
gap: "8px"
|
|
7219
7315
|
},
|
|
7220
7316
|
children: [
|
|
7221
|
-
/* @__PURE__ */ n.jsx(
|
|
7317
|
+
/* @__PURE__ */ n.jsx(cr, { size: 20, "aria-hidden": "true" }),
|
|
7222
7318
|
"Security Status"
|
|
7223
7319
|
]
|
|
7224
7320
|
}
|
|
@@ -7249,10 +7345,10 @@ const Ls = [
|
|
|
7249
7345
|
display: "flex",
|
|
7250
7346
|
alignItems: "center",
|
|
7251
7347
|
gap: "12px",
|
|
7252
|
-
color:
|
|
7348
|
+
color: U.textSecondary
|
|
7253
7349
|
},
|
|
7254
7350
|
children: [
|
|
7255
|
-
/* @__PURE__ */ n.jsx(
|
|
7351
|
+
/* @__PURE__ */ n.jsx(ce, { size: 16, "aria-hidden": "true" }),
|
|
7256
7352
|
/* @__PURE__ */ n.jsx("span", { children: "Email Verification" })
|
|
7257
7353
|
]
|
|
7258
7354
|
}
|
|
@@ -7270,16 +7366,16 @@ const Ls = [
|
|
|
7270
7366
|
gap: "6px",
|
|
7271
7367
|
...y.isVerified ? {
|
|
7272
7368
|
backgroundColor: r ? "rgba(16, 185, 129, 0.1)" : "rgba(16, 185, 129, 0.05)",
|
|
7273
|
-
color:
|
|
7369
|
+
color: U.success,
|
|
7274
7370
|
border: `1px solid ${r ? "rgba(16, 185, 129, 0.3)" : "rgba(16, 185, 129, 0.2)"}`
|
|
7275
7371
|
} : {
|
|
7276
7372
|
backgroundColor: r ? "rgba(245, 158, 11, 0.1)" : "rgba(245, 158, 11, 0.05)",
|
|
7277
|
-
color:
|
|
7373
|
+
color: U.warning,
|
|
7278
7374
|
border: `1px solid ${r ? "rgba(245, 158, 11, 0.3)" : "rgba(245, 158, 11, 0.2)"}`
|
|
7279
7375
|
}
|
|
7280
7376
|
},
|
|
7281
7377
|
children: y.isVerified ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
7282
|
-
/* @__PURE__ */ n.jsx(
|
|
7378
|
+
/* @__PURE__ */ n.jsx(de, { size: 16, "aria-hidden": "true" }),
|
|
7283
7379
|
"Verified"
|
|
7284
7380
|
] }) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
7285
7381
|
/* @__PURE__ */ n.jsx(le, { size: 16, "aria-hidden": "true" }),
|
|
@@ -7302,7 +7398,7 @@ const Ls = [
|
|
|
7302
7398
|
"p",
|
|
7303
7399
|
{
|
|
7304
7400
|
style: {
|
|
7305
|
-
color:
|
|
7401
|
+
color: U.textTertiary,
|
|
7306
7402
|
fontSize: "12px",
|
|
7307
7403
|
margin: 0
|
|
7308
7404
|
},
|
|
@@ -7326,60 +7422,60 @@ const Ls = [
|
|
|
7326
7422
|
}
|
|
7327
7423
|
),
|
|
7328
7424
|
/* @__PURE__ */ n.jsx(
|
|
7329
|
-
|
|
7425
|
+
Ms,
|
|
7330
7426
|
{
|
|
7331
7427
|
isOpen: C,
|
|
7332
7428
|
onClose: () => {
|
|
7333
|
-
|
|
7429
|
+
q(!1);
|
|
7334
7430
|
},
|
|
7335
7431
|
onUpdate: ve,
|
|
7336
|
-
colors:
|
|
7432
|
+
colors: U
|
|
7337
7433
|
}
|
|
7338
7434
|
),
|
|
7339
7435
|
/* @__PURE__ */ n.jsx(
|
|
7340
|
-
|
|
7436
|
+
Bs,
|
|
7341
7437
|
{
|
|
7342
7438
|
baseUrl: l,
|
|
7343
7439
|
apiKey: h,
|
|
7344
|
-
appId:
|
|
7440
|
+
appId: d,
|
|
7345
7441
|
userId: y.id,
|
|
7346
7442
|
isOpen: g,
|
|
7347
|
-
onClose: () =>
|
|
7348
|
-
onSuccess: (
|
|
7349
|
-
onError: (
|
|
7350
|
-
colors:
|
|
7443
|
+
onClose: () => R(!1),
|
|
7444
|
+
onSuccess: (k) => N("success", k),
|
|
7445
|
+
onError: (k) => N("error", k),
|
|
7446
|
+
colors: U
|
|
7351
7447
|
}
|
|
7352
7448
|
),
|
|
7353
7449
|
/* @__PURE__ */ n.jsx(
|
|
7354
|
-
|
|
7450
|
+
qs,
|
|
7355
7451
|
{
|
|
7356
7452
|
baseUrl: l,
|
|
7357
7453
|
apiKey: h,
|
|
7358
|
-
appId:
|
|
7454
|
+
appId: d,
|
|
7359
7455
|
userId: y.id,
|
|
7360
7456
|
token: t,
|
|
7361
7457
|
isOpen: v,
|
|
7362
|
-
onClose: () =>
|
|
7363
|
-
onSuccess: (
|
|
7364
|
-
onError: (
|
|
7365
|
-
colors:
|
|
7458
|
+
onClose: () => D(!1),
|
|
7459
|
+
onSuccess: (k) => N("success", k),
|
|
7460
|
+
onError: (k) => N("error", k),
|
|
7461
|
+
colors: U
|
|
7366
7462
|
}
|
|
7367
7463
|
),
|
|
7368
7464
|
/* @__PURE__ */ n.jsx(
|
|
7369
|
-
|
|
7465
|
+
Ws,
|
|
7370
7466
|
{
|
|
7371
|
-
isOpen:
|
|
7467
|
+
isOpen: B,
|
|
7372
7468
|
onClose: () => {
|
|
7373
|
-
F(!1), x(!1), f({ email: y?.email || "", otp: "", appId:
|
|
7469
|
+
F(!1), x(!1), f({ email: y?.email || "", otp: "", appId: d });
|
|
7374
7470
|
},
|
|
7375
7471
|
onVerify: ue,
|
|
7376
7472
|
onSendOTP: se,
|
|
7377
7473
|
verifyFormData: G,
|
|
7378
7474
|
setVerifyFormData: f,
|
|
7379
7475
|
otpSent: S,
|
|
7380
|
-
verifying:
|
|
7476
|
+
verifying: E,
|
|
7381
7477
|
user: y,
|
|
7382
|
-
colors:
|
|
7478
|
+
colors: U,
|
|
7383
7479
|
darkMode: r
|
|
7384
7480
|
}
|
|
7385
7481
|
),
|
|
@@ -7487,15 +7583,15 @@ const Ls = [
|
|
|
7487
7583
|
settingsUrl: l,
|
|
7488
7584
|
// Menu item visibility with defaults
|
|
7489
7585
|
showProfileMenuItem: h = !0,
|
|
7490
|
-
showSettingsMenuItem:
|
|
7586
|
+
showSettingsMenuItem: d = !0,
|
|
7491
7587
|
showViewProfileMenuItem: u = !0,
|
|
7492
7588
|
// Custom labels with defaults
|
|
7493
7589
|
profileLabel: b = "My Profile",
|
|
7494
7590
|
settingsLabel: y = "Settings",
|
|
7495
7591
|
viewProfileLabel: w = "View Profile",
|
|
7496
|
-
logoutLabel:
|
|
7592
|
+
logoutLabel: c = "Sign Out"
|
|
7497
7593
|
}) => {
|
|
7498
|
-
const { baseUrl: j, apiKey: m, appId:
|
|
7594
|
+
const { baseUrl: j, apiKey: m, appId: $ } = ge(), [I, z] = O(!1), [C, q] = O(null), [g, R] = O(!0), [v, D] = O(null), B = xt(null), F = xt(null), [V, Z] = O(!1), [T, J] = O(!1);
|
|
7499
7595
|
te(() => {
|
|
7500
7596
|
if (typeof window > "u") return;
|
|
7501
7597
|
const x = () => {
|
|
@@ -7505,53 +7601,53 @@ const Ls = [
|
|
|
7505
7601
|
}, []), te(() => {
|
|
7506
7602
|
(async () => {
|
|
7507
7603
|
try {
|
|
7508
|
-
if (
|
|
7604
|
+
if (R(!0), D(null), a) {
|
|
7509
7605
|
if (!a.id || !a.name || !a.email)
|
|
7510
7606
|
throw new Error("Invalid user data provided");
|
|
7511
|
-
|
|
7607
|
+
q(a);
|
|
7512
7608
|
} else if (typeof window < "u") {
|
|
7513
|
-
const
|
|
7514
|
-
if (
|
|
7609
|
+
const E = localStorage.getItem("userInfo");
|
|
7610
|
+
if (E)
|
|
7515
7611
|
try {
|
|
7516
|
-
const
|
|
7517
|
-
if (
|
|
7612
|
+
const _ = JSON.parse(E);
|
|
7613
|
+
if (!_.id || !_.name || !_.email)
|
|
7518
7614
|
throw new Error("Invalid stored user data");
|
|
7519
|
-
|
|
7520
|
-
} catch (
|
|
7521
|
-
console.error("Failed to parse stored user data:",
|
|
7615
|
+
q(_);
|
|
7616
|
+
} catch (_) {
|
|
7617
|
+
console.error("Failed to parse stored user data:", _), localStorage.removeItem("userInfo"), D("Invalid user data");
|
|
7522
7618
|
}
|
|
7523
7619
|
}
|
|
7524
|
-
} catch (
|
|
7525
|
-
console.error("User initialization failed:",
|
|
7620
|
+
} catch (E) {
|
|
7621
|
+
console.error("User initialization failed:", E), D(E.message || "Failed to load user");
|
|
7526
7622
|
} finally {
|
|
7527
|
-
|
|
7623
|
+
R(!1);
|
|
7528
7624
|
}
|
|
7529
7625
|
})();
|
|
7530
7626
|
}, [a]), te(() => {
|
|
7531
7627
|
if (typeof window > "u") return;
|
|
7532
7628
|
const x = () => {
|
|
7533
|
-
if (!
|
|
7534
|
-
const
|
|
7535
|
-
N -
|
|
7629
|
+
if (!I || !F.current) return;
|
|
7630
|
+
const E = F.current.getBoundingClientRect(), _ = window.innerWidth, N = window.innerHeight, Y = 280, se = _ - E.right, ue = E.left;
|
|
7631
|
+
N - E.bottom;
|
|
7536
7632
|
const ve = se >= Y || se > ue;
|
|
7537
7633
|
Z(ve);
|
|
7538
7634
|
};
|
|
7539
7635
|
return x(), window.addEventListener("resize", x), () => window.removeEventListener("resize", x);
|
|
7540
|
-
}, [
|
|
7636
|
+
}, [I]), te(() => {
|
|
7541
7637
|
if (typeof window > "u" || typeof document > "u")
|
|
7542
7638
|
return;
|
|
7543
7639
|
const x = (N) => {
|
|
7544
|
-
|
|
7545
|
-
},
|
|
7546
|
-
N.key === "Escape" &&
|
|
7547
|
-
},
|
|
7548
|
-
|
|
7640
|
+
B.current && !B.current.contains(N.target) && !F.current?.contains(N.target) && z(!1);
|
|
7641
|
+
}, E = (N) => {
|
|
7642
|
+
N.key === "Escape" && z(!1);
|
|
7643
|
+
}, _ = () => {
|
|
7644
|
+
I && z(!1);
|
|
7549
7645
|
};
|
|
7550
|
-
return
|
|
7551
|
-
document.removeEventListener("mousedown", x), document.removeEventListener("keydown",
|
|
7646
|
+
return I && (document.addEventListener("mousedown", x), document.addEventListener("keydown", E), window.addEventListener("scroll", _)), () => {
|
|
7647
|
+
document.removeEventListener("mousedown", x), document.removeEventListener("keydown", E), window.removeEventListener("scroll", _);
|
|
7552
7648
|
};
|
|
7553
|
-
}, [
|
|
7554
|
-
const
|
|
7649
|
+
}, [I]);
|
|
7650
|
+
const A = t ? {
|
|
7555
7651
|
surface: "#000000",
|
|
7556
7652
|
surfaceElevated: "#000000",
|
|
7557
7653
|
surfaceHover: "#262626",
|
|
@@ -7586,7 +7682,7 @@ const Ls = [
|
|
|
7586
7682
|
gap: T ? "6px" : "8px",
|
|
7587
7683
|
padding: T ? "6px 10px 6px 6px" : "8px 12px 8px 8px",
|
|
7588
7684
|
borderRadius: "24px",
|
|
7589
|
-
backgroundColor:
|
|
7685
|
+
backgroundColor: A.surface,
|
|
7590
7686
|
cursor: "pointer",
|
|
7591
7687
|
transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
7592
7688
|
minWidth: T ? "auto" : "140px",
|
|
@@ -7598,7 +7694,7 @@ const Ls = [
|
|
|
7598
7694
|
height: T ? "28px" : "32px",
|
|
7599
7695
|
borderRadius: "50%",
|
|
7600
7696
|
objectFit: "cover",
|
|
7601
|
-
border: `2px solid ${
|
|
7697
|
+
border: `2px solid ${A.borderLight}`,
|
|
7602
7698
|
flexShrink: 0
|
|
7603
7699
|
},
|
|
7604
7700
|
userInfo: {
|
|
@@ -7612,7 +7708,7 @@ const Ls = [
|
|
|
7612
7708
|
userName: {
|
|
7613
7709
|
fontSize: T ? "13px" : "14px",
|
|
7614
7710
|
fontWeight: 600,
|
|
7615
|
-
color:
|
|
7711
|
+
color: A.textPrimary,
|
|
7616
7712
|
lineHeight: "1.2",
|
|
7617
7713
|
whiteSpace: "nowrap",
|
|
7618
7714
|
overflow: "hidden",
|
|
@@ -7621,7 +7717,7 @@ const Ls = [
|
|
|
7621
7717
|
},
|
|
7622
7718
|
userEmail: {
|
|
7623
7719
|
fontSize: T ? "11px" : "12px",
|
|
7624
|
-
color:
|
|
7720
|
+
color: A.textTertiary,
|
|
7625
7721
|
lineHeight: "1.2",
|
|
7626
7722
|
whiteSpace: "nowrap",
|
|
7627
7723
|
overflow: "hidden",
|
|
@@ -7630,8 +7726,8 @@ const Ls = [
|
|
|
7630
7726
|
},
|
|
7631
7727
|
chevron: {
|
|
7632
7728
|
transition: "transform 0.2s ease",
|
|
7633
|
-
transform:
|
|
7634
|
-
color:
|
|
7729
|
+
transform: I ? "rotate(180deg)" : "rotate(0deg)",
|
|
7730
|
+
color: A.textTertiary,
|
|
7635
7731
|
flexShrink: 0
|
|
7636
7732
|
},
|
|
7637
7733
|
dropdown: {
|
|
@@ -7639,8 +7735,8 @@ const Ls = [
|
|
|
7639
7735
|
top: "100%",
|
|
7640
7736
|
marginTop: "8px",
|
|
7641
7737
|
[V ? "left" : "right"]: "0",
|
|
7642
|
-
backgroundColor:
|
|
7643
|
-
border: `1px solid ${
|
|
7738
|
+
backgroundColor: A.surfaceElevated,
|
|
7739
|
+
border: `1px solid ${A.border}`,
|
|
7644
7740
|
borderRadius: "12px",
|
|
7645
7741
|
boxShadow: "0 20px 40px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.1)",
|
|
7646
7742
|
width: "min(280px, 90vw)",
|
|
@@ -7648,10 +7744,10 @@ const Ls = [
|
|
|
7648
7744
|
padding: "6px 6px 16px 6px",
|
|
7649
7745
|
zIndex: 1e3,
|
|
7650
7746
|
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
7651
|
-
opacity:
|
|
7652
|
-
pointerEvents:
|
|
7747
|
+
opacity: I ? 1 : 0,
|
|
7748
|
+
pointerEvents: I ? "auto" : "none",
|
|
7653
7749
|
transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
7654
|
-
transform:
|
|
7750
|
+
transform: I ? "translateY(0) scale(1)" : "translateY(-8px) scale(0.95)",
|
|
7655
7751
|
overflow: "hidden"
|
|
7656
7752
|
},
|
|
7657
7753
|
dropdownSection: {
|
|
@@ -7671,7 +7767,7 @@ const Ls = [
|
|
|
7671
7767
|
height: T ? "40px" : "48px",
|
|
7672
7768
|
borderRadius: "50%",
|
|
7673
7769
|
objectFit: "cover",
|
|
7674
|
-
border: `2px solid ${
|
|
7770
|
+
border: `2px solid ${A.borderLight}`,
|
|
7675
7771
|
flexShrink: 0
|
|
7676
7772
|
},
|
|
7677
7773
|
dropdownUserInfo: {
|
|
@@ -7683,7 +7779,7 @@ const Ls = [
|
|
|
7683
7779
|
dropdownUserName: {
|
|
7684
7780
|
fontSize: T ? "15px" : "16px",
|
|
7685
7781
|
fontWeight: 600,
|
|
7686
|
-
color:
|
|
7782
|
+
color: A.textPrimary,
|
|
7687
7783
|
lineHeight: "1.2",
|
|
7688
7784
|
marginBottom: "2px",
|
|
7689
7785
|
overflow: "hidden",
|
|
@@ -7691,7 +7787,7 @@ const Ls = [
|
|
|
7691
7787
|
},
|
|
7692
7788
|
dropdownUserEmail: {
|
|
7693
7789
|
fontSize: T ? "13px" : "14px",
|
|
7694
|
-
color:
|
|
7790
|
+
color: A.textSecondary,
|
|
7695
7791
|
lineHeight: "1.2",
|
|
7696
7792
|
overflow: "hidden",
|
|
7697
7793
|
textOverflow: "ellipsis"
|
|
@@ -7704,7 +7800,7 @@ const Ls = [
|
|
|
7704
7800
|
borderRadius: "8px",
|
|
7705
7801
|
cursor: "pointer",
|
|
7706
7802
|
transition: "all 0.15s ease",
|
|
7707
|
-
color:
|
|
7803
|
+
color: A.textPrimary,
|
|
7708
7804
|
textDecoration: "none",
|
|
7709
7805
|
border: "none",
|
|
7710
7806
|
background: "none",
|
|
@@ -7719,7 +7815,7 @@ const Ls = [
|
|
|
7719
7815
|
icon: {
|
|
7720
7816
|
width: T ? "16px" : "18px",
|
|
7721
7817
|
height: T ? "16px" : "18px",
|
|
7722
|
-
color:
|
|
7818
|
+
color: A.textSecondary,
|
|
7723
7819
|
flexShrink: 0
|
|
7724
7820
|
},
|
|
7725
7821
|
logoutButton: {
|
|
@@ -7734,20 +7830,20 @@ const Ls = [
|
|
|
7734
7830
|
border: "none",
|
|
7735
7831
|
width: "100%",
|
|
7736
7832
|
fontSize: T ? "13px" : "14px",
|
|
7737
|
-
color:
|
|
7833
|
+
color: A.error,
|
|
7738
7834
|
textAlign: "left",
|
|
7739
7835
|
outline: "none"
|
|
7740
7836
|
},
|
|
7741
7837
|
loadingText: {
|
|
7742
7838
|
padding: T ? "16px 12px" : "20px 16px",
|
|
7743
7839
|
textAlign: "center",
|
|
7744
|
-
color:
|
|
7840
|
+
color: A.textSecondary,
|
|
7745
7841
|
fontSize: T ? "13px" : "14px"
|
|
7746
7842
|
},
|
|
7747
7843
|
errorState: {
|
|
7748
7844
|
padding: T ? "16px 12px" : "20px 16px",
|
|
7749
7845
|
textAlign: "center",
|
|
7750
|
-
color:
|
|
7846
|
+
color: A.textSecondary,
|
|
7751
7847
|
fontSize: T ? "13px" : "14px",
|
|
7752
7848
|
display: "flex",
|
|
7753
7849
|
alignItems: "center",
|
|
@@ -7758,7 +7854,7 @@ const Ls = [
|
|
|
7758
7854
|
retryButton: {
|
|
7759
7855
|
marginTop: "8px",
|
|
7760
7856
|
padding: "8px 16px",
|
|
7761
|
-
backgroundColor:
|
|
7857
|
+
backgroundColor: A.accent,
|
|
7762
7858
|
color: "#ffffff",
|
|
7763
7859
|
border: "none",
|
|
7764
7860
|
borderRadius: "6px",
|
|
@@ -7768,20 +7864,20 @@ const Ls = [
|
|
|
7768
7864
|
transition: "background-color 0.2s ease"
|
|
7769
7865
|
}
|
|
7770
7866
|
}, K = async () => {
|
|
7771
|
-
|
|
7867
|
+
D(null), R(!0);
|
|
7772
7868
|
try {
|
|
7773
7869
|
const x = localStorage.getItem("userInfo");
|
|
7774
7870
|
if (x) {
|
|
7775
|
-
const
|
|
7776
|
-
|
|
7777
|
-
} else a &&
|
|
7871
|
+
const E = JSON.parse(x);
|
|
7872
|
+
q(E);
|
|
7873
|
+
} else a && q(a);
|
|
7778
7874
|
} catch (x) {
|
|
7779
|
-
console.error("Retry failed:", x),
|
|
7875
|
+
console.error("Retry failed:", x), D("Invalid user data"), localStorage.removeItem("userInfo"), q(null);
|
|
7780
7876
|
} finally {
|
|
7781
|
-
|
|
7877
|
+
R(!1);
|
|
7782
7878
|
}
|
|
7783
|
-
}, Q = (x,
|
|
7784
|
-
(x.key === "Enter" || x.key === " ") && (x.preventDefault(),
|
|
7879
|
+
}, Q = (x, E) => {
|
|
7880
|
+
(x.key === "Enter" || x.key === " ") && (x.preventDefault(), E());
|
|
7785
7881
|
}, G = () => o || C?.profileUrl, f = () => {
|
|
7786
7882
|
const x = G();
|
|
7787
7883
|
x && window.open(x, "_self", "noopener,noreferrer");
|
|
@@ -7792,7 +7888,7 @@ const Ls = [
|
|
|
7792
7888
|
"div",
|
|
7793
7889
|
{
|
|
7794
7890
|
style: P.wrapper,
|
|
7795
|
-
ref:
|
|
7891
|
+
ref: B,
|
|
7796
7892
|
className: i,
|
|
7797
7893
|
role: "menu",
|
|
7798
7894
|
"aria-label": "User menu",
|
|
@@ -7801,12 +7897,12 @@ const Ls = [
|
|
|
7801
7897
|
"div",
|
|
7802
7898
|
{
|
|
7803
7899
|
ref: F,
|
|
7804
|
-
onClick: () =>
|
|
7805
|
-
onKeyDown: (x) => Q(x, () =>
|
|
7900
|
+
onClick: () => z((x) => !x),
|
|
7901
|
+
onKeyDown: (x) => Q(x, () => z((E) => !E)),
|
|
7806
7902
|
tabIndex: 0,
|
|
7807
7903
|
role: "button",
|
|
7808
7904
|
"aria-haspopup": "true",
|
|
7809
|
-
"aria-expanded":
|
|
7905
|
+
"aria-expanded": I,
|
|
7810
7906
|
"aria-label": "Toggle user menu",
|
|
7811
7907
|
children: C?.avatarUrl ? /* @__PURE__ */ n.jsx(
|
|
7812
7908
|
"img",
|
|
@@ -7818,13 +7914,13 @@ const Ls = [
|
|
|
7818
7914
|
height: T ? "34px" : "36px",
|
|
7819
7915
|
borderRadius: "50%",
|
|
7820
7916
|
objectFit: "cover",
|
|
7821
|
-
border: `2px solid ${
|
|
7917
|
+
border: `2px solid ${A.borderLight}`,
|
|
7822
7918
|
flexShrink: 0
|
|
7823
7919
|
},
|
|
7824
7920
|
loading: "lazy",
|
|
7825
7921
|
onError: (x) => {
|
|
7826
|
-
const
|
|
7827
|
-
|
|
7922
|
+
const E = x.target;
|
|
7923
|
+
E.onerror = null, E.src = `https://api.dicebear.com/9.x/initials/svg?seed=${encodeURIComponent(
|
|
7828
7924
|
C?.name || "User"
|
|
7829
7925
|
)}`;
|
|
7830
7926
|
}
|
|
@@ -7841,7 +7937,7 @@ const Ls = [
|
|
|
7841
7937
|
height: T ? "34px" : "40px",
|
|
7842
7938
|
borderRadius: "50%",
|
|
7843
7939
|
objectFit: "cover",
|
|
7844
|
-
border: `2px solid ${
|
|
7940
|
+
border: `2px solid ${A.borderLight}`,
|
|
7845
7941
|
flexShrink: 0
|
|
7846
7942
|
},
|
|
7847
7943
|
loading: "lazy"
|
|
@@ -7853,18 +7949,18 @@ const Ls = [
|
|
|
7853
7949
|
{
|
|
7854
7950
|
ref: F,
|
|
7855
7951
|
style: P.avatarButton,
|
|
7856
|
-
onClick: () =>
|
|
7857
|
-
onKeyDown: (x) => Q(x, () =>
|
|
7952
|
+
onClick: () => z((x) => !x),
|
|
7953
|
+
onKeyDown: (x) => Q(x, () => z((E) => !E)),
|
|
7858
7954
|
tabIndex: 0,
|
|
7859
7955
|
role: "button",
|
|
7860
7956
|
"aria-haspopup": "true",
|
|
7861
|
-
"aria-expanded":
|
|
7957
|
+
"aria-expanded": I,
|
|
7862
7958
|
"aria-label": "Toggle user menu",
|
|
7863
7959
|
onMouseOver: (x) => {
|
|
7864
|
-
x.currentTarget.style.backgroundColor =
|
|
7960
|
+
x.currentTarget.style.backgroundColor = A.surfaceHover, x.currentTarget.style.boxShadow = "0 4px 12px rgba(0,0,0,0.15)";
|
|
7865
7961
|
},
|
|
7866
7962
|
onMouseOut: (x) => {
|
|
7867
|
-
x.currentTarget.style.backgroundColor =
|
|
7963
|
+
x.currentTarget.style.backgroundColor = A.surface, x.currentTarget.style.boxShadow = "none";
|
|
7868
7964
|
},
|
|
7869
7965
|
onBlur: (x) => {
|
|
7870
7966
|
x.currentTarget.style.outline = "none";
|
|
@@ -7878,8 +7974,8 @@ const Ls = [
|
|
|
7878
7974
|
style: P.avatarImage,
|
|
7879
7975
|
loading: "lazy",
|
|
7880
7976
|
onError: (x) => {
|
|
7881
|
-
const
|
|
7882
|
-
|
|
7977
|
+
const E = x.target;
|
|
7978
|
+
E.src = "https://api.dicebear.com/9.x/glass/svg?seed=Kingston";
|
|
7883
7979
|
}
|
|
7884
7980
|
}
|
|
7885
7981
|
) : /* @__PURE__ */ n.jsx(
|
|
@@ -7906,7 +8002,7 @@ const Ls = [
|
|
|
7906
8002
|
]
|
|
7907
8003
|
}
|
|
7908
8004
|
),
|
|
7909
|
-
|
|
8005
|
+
I && /* @__PURE__ */ n.jsx("div", { style: P.dropdown, role: "menu", "aria-label": "User options", children: g ? /* @__PURE__ */ n.jsx("div", { style: P.loadingText, role: "status", "aria-live": "polite", children: "Loading user information..." }) : C ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
7910
8006
|
/* @__PURE__ */ n.jsxs("div", { style: P.userSection, children: [
|
|
7911
8007
|
C?.avatarUrl ? /* @__PURE__ */ n.jsx(
|
|
7912
8008
|
"img",
|
|
@@ -7916,8 +8012,8 @@ const Ls = [
|
|
|
7916
8012
|
style: P.dropdownAvatar,
|
|
7917
8013
|
loading: "lazy",
|
|
7918
8014
|
onError: (x) => {
|
|
7919
|
-
const
|
|
7920
|
-
|
|
8015
|
+
const E = x.target;
|
|
8016
|
+
E.src = `https://api.dicebear.com/9.x/initials/svg?seed=${C.name}`;
|
|
7921
8017
|
}
|
|
7922
8018
|
}
|
|
7923
8019
|
) : /* @__PURE__ */ n.jsx(
|
|
@@ -7941,7 +8037,7 @@ const Ls = [
|
|
|
7941
8037
|
style: P.menuItem,
|
|
7942
8038
|
onClick: f,
|
|
7943
8039
|
onMouseOver: (x) => {
|
|
7944
|
-
x.currentTarget.style.backgroundColor =
|
|
8040
|
+
x.currentTarget.style.backgroundColor = A.surfaceHover;
|
|
7945
8041
|
},
|
|
7946
8042
|
onMouseOut: (x) => {
|
|
7947
8043
|
x.currentTarget.style.backgroundColor = "transparent";
|
|
@@ -7955,13 +8051,13 @@ const Ls = [
|
|
|
7955
8051
|
]
|
|
7956
8052
|
}
|
|
7957
8053
|
),
|
|
7958
|
-
|
|
8054
|
+
d && l && /* @__PURE__ */ n.jsxs(
|
|
7959
8055
|
"button",
|
|
7960
8056
|
{
|
|
7961
8057
|
style: P.menuItem,
|
|
7962
8058
|
onClick: S,
|
|
7963
8059
|
onMouseOver: (x) => {
|
|
7964
|
-
x.currentTarget.style.backgroundColor =
|
|
8060
|
+
x.currentTarget.style.backgroundColor = A.surfaceHover;
|
|
7965
8061
|
},
|
|
7966
8062
|
onMouseOut: (x) => {
|
|
7967
8063
|
x.currentTarget.style.backgroundColor = "transparent";
|
|
@@ -7970,7 +8066,7 @@ const Ls = [
|
|
|
7970
8066
|
role: "menuitem",
|
|
7971
8067
|
tabIndex: 0,
|
|
7972
8068
|
children: [
|
|
7973
|
-
/* @__PURE__ */ n.jsx(
|
|
8069
|
+
/* @__PURE__ */ n.jsx(As, { style: P.icon, "aria-hidden": "true" }),
|
|
7974
8070
|
/* @__PURE__ */ n.jsx("span", { style: P.menuItemText, children: y })
|
|
7975
8071
|
]
|
|
7976
8072
|
}
|
|
@@ -7983,7 +8079,7 @@ const Ls = [
|
|
|
7983
8079
|
rel: "noopener noreferrer",
|
|
7984
8080
|
style: P.menuItem,
|
|
7985
8081
|
onMouseOver: (x) => {
|
|
7986
|
-
x.currentTarget.style.backgroundColor =
|
|
8082
|
+
x.currentTarget.style.backgroundColor = A.surfaceHover;
|
|
7987
8083
|
},
|
|
7988
8084
|
onMouseOut: (x) => {
|
|
7989
8085
|
x.currentTarget.style.backgroundColor = "transparent";
|
|
@@ -7991,7 +8087,7 @@ const Ls = [
|
|
|
7991
8087
|
role: "menuitem",
|
|
7992
8088
|
tabIndex: 0,
|
|
7993
8089
|
children: [
|
|
7994
|
-
/* @__PURE__ */ n.jsx(
|
|
8090
|
+
/* @__PURE__ */ n.jsx(ce, { style: P.icon, "aria-hidden": "true" }),
|
|
7995
8091
|
/* @__PURE__ */ n.jsx("span", { style: P.menuItemText, children: w })
|
|
7996
8092
|
]
|
|
7997
8093
|
}
|
|
@@ -8003,7 +8099,7 @@ const Ls = [
|
|
|
8003
8099
|
style: P.logoutButton,
|
|
8004
8100
|
onClick: r,
|
|
8005
8101
|
onMouseOver: (x) => {
|
|
8006
|
-
x.currentTarget.style.backgroundColor =
|
|
8102
|
+
x.currentTarget.style.backgroundColor = A.surfaceHover;
|
|
8007
8103
|
},
|
|
8008
8104
|
onMouseOut: (x) => {
|
|
8009
8105
|
x.currentTarget.style.backgroundColor = "transparent";
|
|
@@ -8013,13 +8109,13 @@ const Ls = [
|
|
|
8013
8109
|
tabIndex: 0,
|
|
8014
8110
|
children: [
|
|
8015
8111
|
/* @__PURE__ */ n.jsx(
|
|
8016
|
-
|
|
8112
|
+
ct,
|
|
8017
8113
|
{
|
|
8018
|
-
style: { ...P.icon, color:
|
|
8114
|
+
style: { ...P.icon, color: A.error },
|
|
8019
8115
|
"aria-hidden": "true"
|
|
8020
8116
|
}
|
|
8021
8117
|
),
|
|
8022
|
-
/* @__PURE__ */ n.jsx("span", { style: P.menuItemText, children:
|
|
8118
|
+
/* @__PURE__ */ n.jsx("span", { style: P.menuItemText, children: c })
|
|
8023
8119
|
]
|
|
8024
8120
|
}
|
|
8025
8121
|
) })
|
|
@@ -8040,10 +8136,10 @@ const Ls = [
|
|
|
8040
8136
|
style: P.retryButton,
|
|
8041
8137
|
onClick: K,
|
|
8042
8138
|
onMouseOver: (x) => {
|
|
8043
|
-
x.currentTarget.style.backgroundColor =
|
|
8139
|
+
x.currentTarget.style.backgroundColor = A.accentHover;
|
|
8044
8140
|
},
|
|
8045
8141
|
onMouseOut: (x) => {
|
|
8046
|
-
x.currentTarget.style.backgroundColor =
|
|
8142
|
+
x.currentTarget.style.backgroundColor = A.accent;
|
|
8047
8143
|
},
|
|
8048
8144
|
children: "Try Again"
|
|
8049
8145
|
}
|
|
@@ -8062,9 +8158,9 @@ const Ls = [
|
|
|
8062
8158
|
email: t?.email || "",
|
|
8063
8159
|
otp: "",
|
|
8064
8160
|
appId: a
|
|
8065
|
-
}), [
|
|
8066
|
-
let v = parseInt(g.replace("#", ""), 16),
|
|
8067
|
-
return
|
|
8161
|
+
}), [d, u] = O(!1), [b, y] = O(!1), [w, c] = O(null), j = (g, R) => {
|
|
8162
|
+
let v = parseInt(g.replace("#", ""), 16), D = (v >> 16) + R, B = (v >> 8 & 255) + R, F = (v & 255) + R;
|
|
8163
|
+
return D = Math.min(255, Math.max(0, D)), B = Math.min(255, Math.max(0, B)), F = Math.min(255, Math.max(0, F)), `#${(F | B << 8 | D << 16).toString(16).padStart(6, "0")}`;
|
|
8068
8164
|
}, m = e ? {
|
|
8069
8165
|
surface: "#09090b",
|
|
8070
8166
|
surfaceLight: "#27272a",
|
|
@@ -8091,41 +8187,41 @@ const Ls = [
|
|
|
8091
8187
|
te(() => {
|
|
8092
8188
|
t?.email && h((g) => ({ ...g, email: t.email }));
|
|
8093
8189
|
}, [t?.email]);
|
|
8094
|
-
const
|
|
8095
|
-
|
|
8096
|
-
},
|
|
8190
|
+
const $ = (g, R) => {
|
|
8191
|
+
c({ type: g, message: R }), setTimeout(() => c(null), 3e3);
|
|
8192
|
+
}, I = async () => {
|
|
8097
8193
|
if (!l.email || !/\S+@\S+\.\S+/.test(l.email)) {
|
|
8098
|
-
|
|
8194
|
+
$("error", "Please enter a valid email");
|
|
8099
8195
|
return;
|
|
8100
8196
|
}
|
|
8101
8197
|
try {
|
|
8102
8198
|
y(!0);
|
|
8103
|
-
const g = await
|
|
8199
|
+
const g = await M.post(
|
|
8104
8200
|
`${i}/users/send-verify-otp/${t?.id}`,
|
|
8105
8201
|
{ email: l.email },
|
|
8106
8202
|
{ headers: { "x-api-key": o, "x-app-id": a } }
|
|
8107
8203
|
);
|
|
8108
|
-
g.data.success ? (
|
|
8204
|
+
g.data.success ? ($("success", g.data.message || "OTP sent!"), u(!0)) : $("error", g.data.message || "Failed to send OTP");
|
|
8109
8205
|
} catch (g) {
|
|
8110
|
-
|
|
8206
|
+
$("error", g.response?.data?.message || "Server error");
|
|
8111
8207
|
} finally {
|
|
8112
8208
|
y(!1);
|
|
8113
8209
|
}
|
|
8114
|
-
},
|
|
8210
|
+
}, z = async (g) => {
|
|
8115
8211
|
if (g.preventDefault(), !l.email || !l.otp) {
|
|
8116
|
-
|
|
8212
|
+
$("error", "Please fill in all fields");
|
|
8117
8213
|
return;
|
|
8118
8214
|
}
|
|
8119
8215
|
try {
|
|
8120
8216
|
y(!0);
|
|
8121
|
-
const
|
|
8122
|
-
if (
|
|
8217
|
+
const R = await M.post(`${i}/users/verify-email`, l);
|
|
8218
|
+
if (R.data.success && t) {
|
|
8123
8219
|
const v = { ...t, isVerified: !0 };
|
|
8124
|
-
s?.(v),
|
|
8220
|
+
s?.(v), $("success", R.data.message || "Email verified!"), u(!1), h({ email: t.email, otp: "", appId: a });
|
|
8125
8221
|
} else
|
|
8126
|
-
|
|
8127
|
-
} catch (
|
|
8128
|
-
|
|
8222
|
+
$("error", R.data.message || "Verification failed");
|
|
8223
|
+
} catch (R) {
|
|
8224
|
+
$("error", R.response?.data?.message || "Server error");
|
|
8129
8225
|
} finally {
|
|
8130
8226
|
y(!1);
|
|
8131
8227
|
}
|
|
@@ -8138,7 +8234,7 @@ const Ls = [
|
|
|
8138
8234
|
color: m.textPrimary,
|
|
8139
8235
|
fontSize: 14,
|
|
8140
8236
|
outline: "none"
|
|
8141
|
-
},
|
|
8237
|
+
}, q = (g = !1) => ({
|
|
8142
8238
|
flex: 1,
|
|
8143
8239
|
padding: 12,
|
|
8144
8240
|
borderRadius: 8,
|
|
@@ -8157,7 +8253,7 @@ const Ls = [
|
|
|
8157
8253
|
return /* @__PURE__ */ n.jsxs(
|
|
8158
8254
|
"form",
|
|
8159
8255
|
{
|
|
8160
|
-
onSubmit:
|
|
8256
|
+
onSubmit: z,
|
|
8161
8257
|
style: {
|
|
8162
8258
|
width: "100%",
|
|
8163
8259
|
height: "100%",
|
|
@@ -8186,7 +8282,7 @@ const Ls = [
|
|
|
8186
8282
|
gap: 8
|
|
8187
8283
|
},
|
|
8188
8284
|
children: [
|
|
8189
|
-
w.type === "success" ? /* @__PURE__ */ n.jsx(
|
|
8285
|
+
w.type === "success" ? /* @__PURE__ */ n.jsx(de, { size: 16 }) : /* @__PURE__ */ n.jsx(le, { size: 16 }),
|
|
8190
8286
|
w.message
|
|
8191
8287
|
]
|
|
8192
8288
|
}
|
|
@@ -8195,7 +8291,7 @@ const Ls = [
|
|
|
8195
8291
|
/* @__PURE__ */ n.jsx("label", { style: { color: m.textSecondary }, children: "Email" }),
|
|
8196
8292
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
8197
8293
|
/* @__PURE__ */ n.jsx(
|
|
8198
|
-
|
|
8294
|
+
ce,
|
|
8199
8295
|
{
|
|
8200
8296
|
size: 18,
|
|
8201
8297
|
style: {
|
|
@@ -8213,7 +8309,7 @@ const Ls = [
|
|
|
8213
8309
|
{
|
|
8214
8310
|
type: "email",
|
|
8215
8311
|
value: l.email,
|
|
8216
|
-
onChange: (g) => h((
|
|
8312
|
+
onChange: (g) => h((R) => ({ ...R, email: g.target.value })),
|
|
8217
8313
|
placeholder: "Enter your email",
|
|
8218
8314
|
style: C,
|
|
8219
8315
|
required: !0
|
|
@@ -8221,11 +8317,11 @@ const Ls = [
|
|
|
8221
8317
|
)
|
|
8222
8318
|
] })
|
|
8223
8319
|
] }),
|
|
8224
|
-
|
|
8320
|
+
d && /* @__PURE__ */ n.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
8225
8321
|
/* @__PURE__ */ n.jsx("label", { style: { color: m.textSecondary }, children: "OTP" }),
|
|
8226
8322
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
8227
8323
|
/* @__PURE__ */ n.jsx(
|
|
8228
|
-
|
|
8324
|
+
dt,
|
|
8229
8325
|
{
|
|
8230
8326
|
size: 18,
|
|
8231
8327
|
style: {
|
|
@@ -8243,7 +8339,7 @@ const Ls = [
|
|
|
8243
8339
|
{
|
|
8244
8340
|
type: "text",
|
|
8245
8341
|
value: l.otp,
|
|
8246
|
-
onChange: (g) => h((
|
|
8342
|
+
onChange: (g) => h((R) => ({ ...R, otp: g.target.value })),
|
|
8247
8343
|
placeholder: "Enter OTP",
|
|
8248
8344
|
style: C,
|
|
8249
8345
|
required: !0
|
|
@@ -8251,16 +8347,16 @@ const Ls = [
|
|
|
8251
8347
|
)
|
|
8252
8348
|
] })
|
|
8253
8349
|
] }),
|
|
8254
|
-
/* @__PURE__ */ n.jsx("div", { style: { display: "flex", gap: 12 }, children:
|
|
8255
|
-
b ? /* @__PURE__ */ n.jsx(ae, { size: 16, className: "spinner" }) : /* @__PURE__ */ n.jsx(
|
|
8350
|
+
/* @__PURE__ */ n.jsx("div", { style: { display: "flex", gap: 12 }, children: d ? /* @__PURE__ */ n.jsxs("button", { type: "submit", disabled: b, style: q(b), children: [
|
|
8351
|
+
b ? /* @__PURE__ */ n.jsx(ae, { size: 16, className: "spinner" }) : /* @__PURE__ */ n.jsx(de, { size: 16 }),
|
|
8256
8352
|
b ? "Verifying..." : "Verify Email"
|
|
8257
8353
|
] }) : /* @__PURE__ */ n.jsxs(
|
|
8258
8354
|
"button",
|
|
8259
8355
|
{
|
|
8260
8356
|
type: "button",
|
|
8261
|
-
onClick:
|
|
8357
|
+
onClick: I,
|
|
8262
8358
|
disabled: b,
|
|
8263
|
-
style:
|
|
8359
|
+
style: q(b),
|
|
8264
8360
|
children: [
|
|
8265
8361
|
b ? /* @__PURE__ */ n.jsx(ae, { size: 16, className: "spinner" }) : /* @__PURE__ */ n.jsx(ut, { size: 16 }),
|
|
8266
8362
|
b ? "Sending..." : "Send OTP"
|
|
@@ -8272,7 +8368,7 @@ const Ls = [
|
|
|
8272
8368
|
);
|
|
8273
8369
|
};
|
|
8274
8370
|
export {
|
|
8275
|
-
|
|
8371
|
+
ca as NeuctraAuthix,
|
|
8276
8372
|
ya as ReactEmailVerification,
|
|
8277
8373
|
xa as ReactSignedIn,
|
|
8278
8374
|
ha as ReactSignedOut,
|