@neuctra/authix 1.2.4 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/neuctra-authix.es.js +91 -100
- package/dist/neuctra-authix.umd.js +2 -2
- package/dist/react/UserLogin.d.ts.map +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/sdk/config.d.ts +0 -16
- package/dist/sdk/config.d.ts.map +0 -1
|
@@ -4,10 +4,10 @@ function At(t, e) {
|
|
|
4
4
|
return t.apply(e, arguments);
|
|
5
5
|
};
|
|
6
6
|
}
|
|
7
|
-
const { toString: ur } = Object.prototype, { getPrototypeOf: rt } = Object, { iterator:
|
|
7
|
+
const { toString: ur } = Object.prototype, { getPrototypeOf: rt } = Object, { iterator: Le, toStringTag: _t } = Symbol, Fe = /* @__PURE__ */ ((t) => (e) => {
|
|
8
8
|
const n = ur.call(e);
|
|
9
9
|
return t[n] || (t[n] = n.slice(8, -1).toLowerCase());
|
|
10
|
-
})(/* @__PURE__ */ Object.create(null)), ae = (t) => (t = t.toLowerCase(), (e) =>
|
|
10
|
+
})(/* @__PURE__ */ Object.create(null)), ae = (t) => (t = t.toLowerCase(), (e) => Fe(e) === t), qe = (t) => (e) => typeof e === t, { isArray: je } = Array, be = qe("undefined");
|
|
11
11
|
function Te(t) {
|
|
12
12
|
return t !== null && !be(t) && t.constructor !== null && !be(t.constructor) && te(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
13
13
|
}
|
|
@@ -17,10 +17,10 @@ function pr(t) {
|
|
|
17
17
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && Ut(t.buffer), e;
|
|
18
18
|
}
|
|
19
19
|
const fr = qe("string"), te = qe("function"), $t = qe("number"), Re = (t) => t !== null && typeof t == "object", xr = (t) => t === !0 || t === !1, _e = (t) => {
|
|
20
|
-
if (
|
|
20
|
+
if (Fe(t) !== "object")
|
|
21
21
|
return !1;
|
|
22
22
|
const e = rt(t);
|
|
23
|
-
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(_t in t) && !(
|
|
23
|
+
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(_t in t) && !(Le in t);
|
|
24
24
|
}, hr = (t) => {
|
|
25
25
|
if (!Re(t) || Te(t))
|
|
26
26
|
return !1;
|
|
@@ -31,7 +31,7 @@ const fr = qe("string"), te = qe("function"), $t = qe("number"), Re = (t) => t !
|
|
|
31
31
|
}
|
|
32
32
|
}, mr = ae("Date"), gr = ae("File"), yr = ae("Blob"), br = ae("FileList"), wr = (t) => Re(t) && te(t.pipe), jr = (t) => {
|
|
33
33
|
let e;
|
|
34
|
-
return t && (typeof FormData == "function" && t instanceof FormData || te(t.append) && ((e =
|
|
34
|
+
return t && (typeof FormData == "function" && t instanceof FormData || te(t.append) && ((e = Fe(t)) === "formdata" || // detect form-data instance
|
|
35
35
|
e === "object" && te(t.toString) && t.toString() === "[object FormData]"));
|
|
36
36
|
}, vr = ae("URLSearchParams"), [Sr, kr, Er, Cr] = ["ReadableStream", "Request", "Response", "Headers"].map(ae), Tr = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
37
37
|
function Pe(t, e, { allOwnKeys: n = !1 } = {}) {
|
|
@@ -101,7 +101,7 @@ const Rr = (t, e, n, { allOwnKeys: s } = {}) => (Pe(e, (i, a) => {
|
|
|
101
101
|
n[e] = t[e];
|
|
102
102
|
return n;
|
|
103
103
|
}, _r = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && rt(Uint8Array)), Ur = (t, e) => {
|
|
104
|
-
const s = (t && t[
|
|
104
|
+
const s = (t && t[Le]).call(t);
|
|
105
105
|
let i;
|
|
106
106
|
for (; (i = s.next()) && !i.done; ) {
|
|
107
107
|
const a = i.value;
|
|
@@ -118,14 +118,14 @@ const Rr = (t, e, n, { allOwnKeys: s } = {}) => (Pe(e, (i, a) => {
|
|
|
118
118
|
function(n, s, i) {
|
|
119
119
|
return s.toUpperCase() + i;
|
|
120
120
|
}
|
|
121
|
-
), ut = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype),
|
|
121
|
+
), ut = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype), Lr = ae("RegExp"), Lt = (t, e) => {
|
|
122
122
|
const n = Object.getOwnPropertyDescriptors(t), s = {};
|
|
123
123
|
Pe(n, (i, a) => {
|
|
124
124
|
let o;
|
|
125
125
|
(o = e(i, a, t)) !== !1 && (s[a] = o || i);
|
|
126
126
|
}), Object.defineProperties(t, s);
|
|
127
|
-
},
|
|
128
|
-
|
|
127
|
+
}, Fr = (t) => {
|
|
128
|
+
Lt(t, (e, n) => {
|
|
129
129
|
if (te(t) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
130
130
|
return !1;
|
|
131
131
|
const s = t[n];
|
|
@@ -149,7 +149,7 @@ const Rr = (t, e, n, { allOwnKeys: s } = {}) => (Pe(e, (i, a) => {
|
|
|
149
149
|
}, Mr = () => {
|
|
150
150
|
}, Wr = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
|
|
151
151
|
function Br(t) {
|
|
152
|
-
return !!(t && te(t.append) && t[_t] === "FormData" && t[
|
|
152
|
+
return !!(t && te(t.append) && t[_t] === "FormData" && t[Le]);
|
|
153
153
|
}
|
|
154
154
|
const Hr = (t) => {
|
|
155
155
|
const e = new Array(10), n = (s, i) => {
|
|
@@ -170,14 +170,14 @@ const Hr = (t) => {
|
|
|
170
170
|
return s;
|
|
171
171
|
};
|
|
172
172
|
return n(t, 0);
|
|
173
|
-
}, Vr = ae("AsyncFunction"), Yr = (t) => t && (Re(t) || te(t)) && te(t.then) && te(t.catch),
|
|
173
|
+
}, Vr = ae("AsyncFunction"), Yr = (t) => t && (Re(t) || te(t)) && te(t.then) && te(t.catch), Ft = ((t, e) => t ? setImmediate : e ? ((n, s) => (xe.addEventListener("message", ({ source: i, data: a }) => {
|
|
174
174
|
i === xe && a === n && s.length && s.shift()();
|
|
175
175
|
}, !1), (i) => {
|
|
176
176
|
s.push(i), xe.postMessage(n, "*");
|
|
177
177
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
178
178
|
typeof setImmediate == "function",
|
|
179
179
|
te(xe.postMessage)
|
|
180
|
-
), Jr = typeof queueMicrotask < "u" ? queueMicrotask.bind(xe) : typeof process < "u" && process.nextTick ||
|
|
180
|
+
), Jr = typeof queueMicrotask < "u" ? queueMicrotask.bind(xe) : typeof process < "u" && process.nextTick || Ft, Kr = (t) => t != null && te(t[Le]), x = {
|
|
181
181
|
isArray: je,
|
|
182
182
|
isArrayBuffer: Ut,
|
|
183
183
|
isBuffer: Te,
|
|
@@ -197,7 +197,7 @@ const Hr = (t) => {
|
|
|
197
197
|
isDate: mr,
|
|
198
198
|
isFile: gr,
|
|
199
199
|
isBlob: yr,
|
|
200
|
-
isRegExp:
|
|
200
|
+
isRegExp: Lr,
|
|
201
201
|
isFunction: te,
|
|
202
202
|
isStream: wr,
|
|
203
203
|
isURLSearchParams: vr,
|
|
@@ -210,7 +210,7 @@ const Hr = (t) => {
|
|
|
210
210
|
stripBOM: Pr,
|
|
211
211
|
inherits: Or,
|
|
212
212
|
toFlatObject: Ir,
|
|
213
|
-
kindOf:
|
|
213
|
+
kindOf: Fe,
|
|
214
214
|
kindOfTest: ae,
|
|
215
215
|
endsWith: zr,
|
|
216
216
|
toArray: Ar,
|
|
@@ -220,8 +220,8 @@ const Hr = (t) => {
|
|
|
220
220
|
hasOwnProperty: ut,
|
|
221
221
|
hasOwnProp: ut,
|
|
222
222
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
223
|
-
reduceDescriptors:
|
|
224
|
-
freezeMethods:
|
|
223
|
+
reduceDescriptors: Lt,
|
|
224
|
+
freezeMethods: Fr,
|
|
225
225
|
toObjectSet: qr,
|
|
226
226
|
toCamelCase: Nr,
|
|
227
227
|
noop: Mr,
|
|
@@ -233,7 +233,7 @@ const Hr = (t) => {
|
|
|
233
233
|
toJSONObject: Hr,
|
|
234
234
|
isAsyncFn: Vr,
|
|
235
235
|
isThenable: Yr,
|
|
236
|
-
setImmediate:
|
|
236
|
+
setImmediate: Ft,
|
|
237
237
|
asap: Jr,
|
|
238
238
|
isIterable: Kr
|
|
239
239
|
};
|
|
@@ -1264,8 +1264,8 @@ const Xt = (t) => {
|
|
|
1264
1264
|
};
|
|
1265
1265
|
G = a && new n(w, K);
|
|
1266
1266
|
let H = await (a ? W(G, X) : W(w, K));
|
|
1267
|
-
const
|
|
1268
|
-
if (p && (N ||
|
|
1267
|
+
const L = p && (j === "stream" || j === "response");
|
|
1268
|
+
if (p && (N || L && R)) {
|
|
1269
1269
|
const l = {};
|
|
1270
1270
|
["status", "statusText", "headers"].forEach((ne) => {
|
|
1271
1271
|
l[ne] = H[ne];
|
|
@@ -1283,7 +1283,7 @@ const Xt = (t) => {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
j = j || "text";
|
|
1285
1285
|
let Y = await y[x.findKey(y, j) || "text"](H, u);
|
|
1286
|
-
return !
|
|
1286
|
+
return !L && R && R(), await new Promise((l, m) => {
|
|
1287
1287
|
Kt(l, m, {
|
|
1288
1288
|
data: Y,
|
|
1289
1289
|
headers: re.from(H.headers),
|
|
@@ -1635,7 +1635,7 @@ function Nn(t) {
|
|
|
1635
1635
|
return t.apply(null, n);
|
|
1636
1636
|
};
|
|
1637
1637
|
}
|
|
1638
|
-
function
|
|
1638
|
+
function Ln(t) {
|
|
1639
1639
|
return x.isObject(t) && t.isAxiosError === !0;
|
|
1640
1640
|
}
|
|
1641
1641
|
const et = {
|
|
@@ -1725,7 +1725,7 @@ J.all = function(e) {
|
|
|
1725
1725
|
return Promise.all(e);
|
|
1726
1726
|
};
|
|
1727
1727
|
J.spread = Nn;
|
|
1728
|
-
J.isAxiosError =
|
|
1728
|
+
J.isAxiosError = Ln;
|
|
1729
1729
|
J.mergeConfig = me;
|
|
1730
1730
|
J.AxiosHeaders = re;
|
|
1731
1731
|
J.formToJSON = (t) => Yt(x.isHTMLForm(t) ? new FormData(t) : t);
|
|
@@ -1835,29 +1835,20 @@ class li {
|
|
|
1835
1835
|
}
|
|
1836
1836
|
/**
|
|
1837
1837
|
* Logout a user
|
|
1838
|
-
* @desc Calls
|
|
1838
|
+
* @desc Calls backend logout, clears cookie safely, reloads page (Next.js safe)
|
|
1839
1839
|
*/
|
|
1840
1840
|
async logoutUser() {
|
|
1841
1841
|
try {
|
|
1842
|
-
|
|
1842
|
+
return (await this.request(
|
|
1843
1843
|
"POST",
|
|
1844
1844
|
"/users/logout",
|
|
1845
1845
|
{},
|
|
1846
|
-
// no body needed
|
|
1847
1846
|
{},
|
|
1848
1847
|
!0
|
|
1849
|
-
// include credentials
|
|
1850
|
-
);
|
|
1851
|
-
if (e && e.success) {
|
|
1852
|
-
if (typeof document < "u") {
|
|
1853
|
-
const n = (/* @__PURE__ */ new Date(0)).toUTCString();
|
|
1854
|
-
document.cookie = `a_s_b=; path=/; Max-Age=${n}; SameSite=Lax`;
|
|
1855
|
-
}
|
|
1856
|
-
return { success: !0 };
|
|
1857
|
-
}
|
|
1858
|
-
return { success: !1 };
|
|
1848
|
+
// include credentials
|
|
1849
|
+
))?.success ? (typeof window < "u" && (document.cookie = "a_s_b=; path=/; Max-Age=0; SameSite=Lax", window.location.protocol === "https:" && (document.cookie = "a_s_b=; path=/; Max-Age=0; SameSite=Lax; Secure"), window.location.reload()), { success: !0 }) : { success: !1 };
|
|
1859
1850
|
} catch (e) {
|
|
1860
|
-
throw new Error(e
|
|
1851
|
+
throw new Error(e?.message || "Logout failed due to an unknown error");
|
|
1861
1852
|
}
|
|
1862
1853
|
}
|
|
1863
1854
|
/**
|
|
@@ -2286,7 +2277,7 @@ var Ae = { exports: {} }, ke = {};
|
|
|
2286
2277
|
* LICENSE file in the root directory of this source tree.
|
|
2287
2278
|
*/
|
|
2288
2279
|
var Tt;
|
|
2289
|
-
function
|
|
2280
|
+
function Fn() {
|
|
2290
2281
|
if (Tt) return ke;
|
|
2291
2282
|
Tt = 1;
|
|
2292
2283
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
@@ -2524,7 +2515,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2524
2515
|
var M, K = {}, H = E.react_stack_bottom_frame.bind(
|
|
2525
2516
|
E,
|
|
2526
2517
|
a
|
|
2527
|
-
)(),
|
|
2518
|
+
)(), L = z(s(a)), Y = {};
|
|
2528
2519
|
Ee.Fragment = h, Ee.jsx = function(l, m, S) {
|
|
2529
2520
|
var D = 1e4 > T.recentlyCreatedOwnerStacks++;
|
|
2530
2521
|
return p(
|
|
@@ -2533,7 +2524,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2533
2524
|
S,
|
|
2534
2525
|
!1,
|
|
2535
2526
|
D ? Error("react-stack-top-frame") : H,
|
|
2536
|
-
D ? z(s(l)) :
|
|
2527
|
+
D ? z(s(l)) : L
|
|
2537
2528
|
);
|
|
2538
2529
|
}, Ee.jsxs = function(l, m, S) {
|
|
2539
2530
|
var D = 1e4 > T.recentlyCreatedOwnerStacks++;
|
|
@@ -2543,14 +2534,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2543
2534
|
S,
|
|
2544
2535
|
!0,
|
|
2545
2536
|
D ? Error("react-stack-top-frame") : H,
|
|
2546
|
-
D ? z(s(l)) :
|
|
2537
|
+
D ? z(s(l)) : L
|
|
2547
2538
|
);
|
|
2548
2539
|
};
|
|
2549
2540
|
})()), Ee;
|
|
2550
2541
|
}
|
|
2551
2542
|
var Pt;
|
|
2552
2543
|
function Mn() {
|
|
2553
|
-
return Pt || (Pt = 1, process.env.NODE_ENV === "production" ? Ae.exports =
|
|
2544
|
+
return Pt || (Pt = 1, process.env.NODE_ENV === "production" ? Ae.exports = Fn() : Ae.exports = qn()), Ae.exports;
|
|
2554
2545
|
}
|
|
2555
2546
|
var r = Mn();
|
|
2556
2547
|
/**
|
|
@@ -2628,7 +2619,7 @@ const Yn = zt(
|
|
|
2628
2619
|
* This source code is licensed under the ISC license.
|
|
2629
2620
|
* See the LICENSE file in the root directory of this source tree.
|
|
2630
2621
|
*/
|
|
2631
|
-
const
|
|
2622
|
+
const F = (t, e) => {
|
|
2632
2623
|
const n = zt(
|
|
2633
2624
|
({ className: s, ...i }, a) => Ke(Yn, {
|
|
2634
2625
|
ref: a,
|
|
@@ -2658,7 +2649,7 @@ const Jn = [
|
|
|
2658
2649
|
}
|
|
2659
2650
|
],
|
|
2660
2651
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
2661
|
-
], Kn =
|
|
2652
|
+
], Kn = F("badge-check", Jn);
|
|
2662
2653
|
/**
|
|
2663
2654
|
* @license lucide-react v0.544.0 - ISC
|
|
2664
2655
|
*
|
|
@@ -2674,14 +2665,14 @@ const Gn = [
|
|
|
2674
2665
|
}
|
|
2675
2666
|
],
|
|
2676
2667
|
["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
|
|
2677
|
-
], tt =
|
|
2668
|
+
], tt = F("camera", Gn);
|
|
2678
2669
|
/**
|
|
2679
2670
|
* @license lucide-react v0.544.0 - ISC
|
|
2680
2671
|
*
|
|
2681
2672
|
* This source code is licensed under the ISC license.
|
|
2682
2673
|
* See the LICENSE file in the root directory of this source tree.
|
|
2683
2674
|
*/
|
|
2684
|
-
const Xn = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Zn =
|
|
2675
|
+
const Xn = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Zn = F("chevron-down", Xn);
|
|
2685
2676
|
/**
|
|
2686
2677
|
* @license lucide-react v0.544.0 - ISC
|
|
2687
2678
|
*
|
|
@@ -2692,7 +2683,7 @@ const Qn = [
|
|
|
2692
2683
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
2693
2684
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
2694
2685
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
2695
|
-
], se =
|
|
2686
|
+
], se = F("circle-alert", Qn);
|
|
2696
2687
|
/**
|
|
2697
2688
|
* @license lucide-react v0.544.0 - ISC
|
|
2698
2689
|
*
|
|
@@ -2702,7 +2693,7 @@ const Qn = [
|
|
|
2702
2693
|
const es = [
|
|
2703
2694
|
["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
|
|
2704
2695
|
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
2705
|
-
], ue =
|
|
2696
|
+
], ue = F("circle-check-big", es);
|
|
2706
2697
|
/**
|
|
2707
2698
|
* @license lucide-react v0.544.0 - ISC
|
|
2708
2699
|
*
|
|
@@ -2712,7 +2703,7 @@ const es = [
|
|
|
2712
2703
|
const ts = [
|
|
2713
2704
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
2714
2705
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
2715
|
-
], Je =
|
|
2706
|
+
], Je = F("circle-check", ts);
|
|
2716
2707
|
/**
|
|
2717
2708
|
* @license lucide-react v0.544.0 - ISC
|
|
2718
2709
|
*
|
|
@@ -2723,7 +2714,7 @@ const rs = [
|
|
|
2723
2714
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
2724
2715
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
2725
2716
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
2726
|
-
], ns =
|
|
2717
|
+
], ns = F("database", rs);
|
|
2727
2718
|
/**
|
|
2728
2719
|
* @license lucide-react v0.544.0 - ISC
|
|
2729
2720
|
*
|
|
@@ -2734,7 +2725,7 @@ const ss = [
|
|
|
2734
2725
|
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
2735
2726
|
["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
|
|
2736
2727
|
["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
|
|
2737
|
-
], is =
|
|
2728
|
+
], is = F("ellipsis-vertical", ss);
|
|
2738
2729
|
/**
|
|
2739
2730
|
* @license lucide-react v0.544.0 - ISC
|
|
2740
2731
|
*
|
|
@@ -2758,7 +2749,7 @@ const as = [
|
|
|
2758
2749
|
}
|
|
2759
2750
|
],
|
|
2760
2751
|
["path", { d: "m2 2 20 20", key: "1ooewy" }]
|
|
2761
|
-
], it =
|
|
2752
|
+
], it = F("eye-off", as);
|
|
2762
2753
|
/**
|
|
2763
2754
|
* @license lucide-react v0.544.0 - ISC
|
|
2764
2755
|
*
|
|
@@ -2774,7 +2765,7 @@ const os = [
|
|
|
2774
2765
|
}
|
|
2775
2766
|
],
|
|
2776
2767
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
2777
|
-
], at =
|
|
2768
|
+
], at = F("eye", os);
|
|
2778
2769
|
/**
|
|
2779
2770
|
* @license lucide-react v0.544.0 - ISC
|
|
2780
2771
|
*
|
|
@@ -2790,7 +2781,7 @@ const ls = [
|
|
|
2790
2781
|
key: "r6nss1"
|
|
2791
2782
|
}
|
|
2792
2783
|
]
|
|
2793
|
-
], cs =
|
|
2784
|
+
], cs = F("house", ls);
|
|
2794
2785
|
/**
|
|
2795
2786
|
* @license lucide-react v0.544.0 - ISC
|
|
2796
2787
|
*
|
|
@@ -2801,7 +2792,7 @@ const ds = [
|
|
|
2801
2792
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
2802
2793
|
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
|
|
2803
2794
|
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
|
|
2804
|
-
], sr =
|
|
2795
|
+
], sr = F("image", ds);
|
|
2805
2796
|
/**
|
|
2806
2797
|
* @license lucide-react v0.544.0 - ISC
|
|
2807
2798
|
*
|
|
@@ -2817,7 +2808,7 @@ const us = [
|
|
|
2817
2808
|
}
|
|
2818
2809
|
],
|
|
2819
2810
|
["circle", { cx: "16.5", cy: "7.5", r: ".5", fill: "currentColor", key: "w0ekpg" }]
|
|
2820
|
-
], ir =
|
|
2811
|
+
], ir = F("key-round", us);
|
|
2821
2812
|
/**
|
|
2822
2813
|
* @license lucide-react v0.544.0 - ISC
|
|
2823
2814
|
*
|
|
@@ -2828,7 +2819,7 @@ const ps = [
|
|
|
2828
2819
|
["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" }],
|
|
2829
2820
|
["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
|
|
2830
2821
|
["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
|
|
2831
|
-
], ot =
|
|
2822
|
+
], ot = F("key", ps);
|
|
2832
2823
|
/**
|
|
2833
2824
|
* @license lucide-react v0.544.0 - ISC
|
|
2834
2825
|
*
|
|
@@ -2839,14 +2830,14 @@ const fs = [
|
|
|
2839
2830
|
["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
|
|
2840
2831
|
["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
|
|
2841
2832
|
["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
|
|
2842
|
-
], xs =
|
|
2833
|
+
], xs = F("link-2", fs);
|
|
2843
2834
|
/**
|
|
2844
2835
|
* @license lucide-react v0.544.0 - ISC
|
|
2845
2836
|
*
|
|
2846
2837
|
* This source code is licensed under the ISC license.
|
|
2847
2838
|
* See the LICENSE file in the root directory of this source tree.
|
|
2848
2839
|
*/
|
|
2849
|
-
const hs = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], ie =
|
|
2840
|
+
const hs = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], ie = F("loader-circle", hs);
|
|
2850
2841
|
/**
|
|
2851
2842
|
* @license lucide-react v0.544.0 - ISC
|
|
2852
2843
|
*
|
|
@@ -2862,7 +2853,7 @@ const ms = [
|
|
|
2862
2853
|
["path", { d: "m4.9 19.1 2.9-2.9", key: "bwix9q" }],
|
|
2863
2854
|
["path", { d: "M2 12h4", key: "j09sii" }],
|
|
2864
2855
|
["path", { d: "m4.9 4.9 2.9 2.9", key: "giyufr" }]
|
|
2865
|
-
], gs =
|
|
2856
|
+
], gs = F("loader", ms);
|
|
2866
2857
|
/**
|
|
2867
2858
|
* @license lucide-react v0.544.0 - ISC
|
|
2868
2859
|
*
|
|
@@ -2872,7 +2863,7 @@ const ms = [
|
|
|
2872
2863
|
const ys = [
|
|
2873
2864
|
["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
|
|
2874
2865
|
["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
|
|
2875
|
-
], ye =
|
|
2866
|
+
], ye = F("lock", ys);
|
|
2876
2867
|
/**
|
|
2877
2868
|
* @license lucide-react v0.544.0 - ISC
|
|
2878
2869
|
*
|
|
@@ -2883,7 +2874,7 @@ const bs = [
|
|
|
2883
2874
|
["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
|
|
2884
2875
|
["path", { d: "M21 12H9", key: "dn1m92" }],
|
|
2885
2876
|
["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
|
|
2886
|
-
], lt =
|
|
2877
|
+
], lt = F("log-out", bs);
|
|
2887
2878
|
/**
|
|
2888
2879
|
* @license lucide-react v0.544.0 - ISC
|
|
2889
2880
|
*
|
|
@@ -2893,7 +2884,7 @@ const bs = [
|
|
|
2893
2884
|
const ws = [
|
|
2894
2885
|
["path", { d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7", key: "132q7q" }],
|
|
2895
2886
|
["rect", { x: "2", y: "4", width: "20", height: "16", rx: "2", key: "izxlao" }]
|
|
2896
|
-
], pe =
|
|
2887
|
+
], pe = F("mail", ws);
|
|
2897
2888
|
/**
|
|
2898
2889
|
* @license lucide-react v0.544.0 - ISC
|
|
2899
2890
|
*
|
|
@@ -2909,7 +2900,7 @@ const js = [
|
|
|
2909
2900
|
}
|
|
2910
2901
|
],
|
|
2911
2902
|
["circle", { cx: "12", cy: "10", r: "3", key: "ilqhr7" }]
|
|
2912
|
-
], vs =
|
|
2903
|
+
], vs = F("map-pin", js);
|
|
2913
2904
|
/**
|
|
2914
2905
|
* @license lucide-react v0.544.0 - ISC
|
|
2915
2906
|
*
|
|
@@ -2925,7 +2916,7 @@ const Ss = [
|
|
|
2925
2916
|
key: "1a8usu"
|
|
2926
2917
|
}
|
|
2927
2918
|
]
|
|
2928
|
-
], ks =
|
|
2919
|
+
], ks = F("pen-line", Ss);
|
|
2929
2920
|
/**
|
|
2930
2921
|
* @license lucide-react v0.544.0 - ISC
|
|
2931
2922
|
*
|
|
@@ -2940,7 +2931,7 @@ const Es = [
|
|
|
2940
2931
|
key: "9njp5v"
|
|
2941
2932
|
}
|
|
2942
2933
|
]
|
|
2943
|
-
], Cs =
|
|
2934
|
+
], Cs = F("phone", Es);
|
|
2944
2935
|
/**
|
|
2945
2936
|
* @license lucide-react v0.544.0 - ISC
|
|
2946
2937
|
*
|
|
@@ -2957,7 +2948,7 @@ const Ts = [
|
|
|
2957
2948
|
],
|
|
2958
2949
|
["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
|
|
2959
2950
|
["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
|
|
2960
|
-
], Rs =
|
|
2951
|
+
], Rs = F("save", Ts);
|
|
2961
2952
|
/**
|
|
2962
2953
|
* @license lucide-react v0.544.0 - ISC
|
|
2963
2954
|
*
|
|
@@ -2973,7 +2964,7 @@ const Ps = [
|
|
|
2973
2964
|
}
|
|
2974
2965
|
],
|
|
2975
2966
|
["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
|
|
2976
|
-
], ct =
|
|
2967
|
+
], ct = F("send", Ps);
|
|
2977
2968
|
/**
|
|
2978
2969
|
* @license lucide-react v0.544.0 - ISC
|
|
2979
2970
|
*
|
|
@@ -2989,7 +2980,7 @@ const Os = [
|
|
|
2989
2980
|
}
|
|
2990
2981
|
],
|
|
2991
2982
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
2992
|
-
], Is =
|
|
2983
|
+
], Is = F("settings", Os);
|
|
2993
2984
|
/**
|
|
2994
2985
|
* @license lucide-react v0.544.0 - ISC
|
|
2995
2986
|
*
|
|
@@ -3004,7 +2995,7 @@ const zs = [
|
|
|
3004
2995
|
key: "oel41y"
|
|
3005
2996
|
}
|
|
3006
2997
|
]
|
|
3007
|
-
], ar =
|
|
2998
|
+
], ar = F("shield", zs);
|
|
3008
2999
|
/**
|
|
3009
3000
|
* @license lucide-react v0.544.0 - ISC
|
|
3010
3001
|
*
|
|
@@ -3017,7 +3008,7 @@ const As = [
|
|
|
3017
3008
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
3018
3009
|
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
3019
3010
|
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
3020
|
-
], De =
|
|
3011
|
+
], De = F("trash-2", As);
|
|
3021
3012
|
/**
|
|
3022
3013
|
* @license lucide-react v0.544.0 - ISC
|
|
3023
3014
|
*
|
|
@@ -3034,7 +3025,7 @@ const _s = [
|
|
|
3034
3025
|
],
|
|
3035
3026
|
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
3036
3027
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
3037
|
-
], It =
|
|
3028
|
+
], It = F("triangle-alert", _s);
|
|
3038
3029
|
/**
|
|
3039
3030
|
* @license lucide-react v0.544.0 - ISC
|
|
3040
3031
|
*
|
|
@@ -3046,7 +3037,7 @@ const Us = [
|
|
|
3046
3037
|
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
3047
3038
|
["line", { x1: "17", x2: "22", y1: "8", y2: "13", key: "3nzzx3" }],
|
|
3048
3039
|
["line", { x1: "22", x2: "17", y1: "8", y2: "13", key: "1swrse" }]
|
|
3049
|
-
], $s =
|
|
3040
|
+
], $s = F("user-x", Us);
|
|
3050
3041
|
/**
|
|
3051
3042
|
* @license lucide-react v0.544.0 - ISC
|
|
3052
3043
|
*
|
|
@@ -3056,7 +3047,7 @@ const Us = [
|
|
|
3056
3047
|
const Ds = [
|
|
3057
3048
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
3058
3049
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
3059
|
-
], we =
|
|
3050
|
+
], we = F("user", Ds);
|
|
3060
3051
|
/**
|
|
3061
3052
|
* @license lucide-react v0.544.0 - ISC
|
|
3062
3053
|
*
|
|
@@ -3066,7 +3057,7 @@ const Ds = [
|
|
|
3066
3057
|
const Ns = [
|
|
3067
3058
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
3068
3059
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
3069
|
-
], Ie =
|
|
3060
|
+
], Ie = F("x", Ns), or = cr(null), ci = ({
|
|
3070
3061
|
authix: t,
|
|
3071
3062
|
children: e
|
|
3072
3063
|
}) => /* @__PURE__ */ r.jsx(or.Provider, { value: t, children: e }), fe = () => {
|
|
@@ -3101,18 +3092,18 @@ const Ns = [
|
|
|
3101
3092
|
}, [w, h] = P(u), [O, C] = P(!1), [g, A] = P(!1), [N, b] = P(null), [j, q] = P({}), [I, X] = P(!1), W = o ? "#ffffff" : "#111827", T = o ? "#a1a1aa" : "#6b7280", G = o ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", R = o ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)";
|
|
3102
3093
|
Ce.useEffect(() => {
|
|
3103
3094
|
if (typeof window < "u") {
|
|
3104
|
-
const
|
|
3105
|
-
return
|
|
3095
|
+
const L = () => X(window.innerWidth < 768);
|
|
3096
|
+
return L(), window.addEventListener("resize", L), () => window.removeEventListener("resize", L);
|
|
3106
3097
|
}
|
|
3107
3098
|
}, []);
|
|
3108
|
-
const z = (
|
|
3109
|
-
const { name: Y, value: l } =
|
|
3099
|
+
const z = (L) => {
|
|
3100
|
+
const { name: Y, value: l } = L.target;
|
|
3110
3101
|
h((m) => ({ ...m, [Y]: l })), j[Y] && q((m) => ({ ...m, [Y]: void 0 }));
|
|
3111
3102
|
}, M = () => {
|
|
3112
|
-
const
|
|
3113
|
-
return w.name.trim() || (
|
|
3114
|
-
}, K = async (
|
|
3115
|
-
if (
|
|
3103
|
+
const L = {};
|
|
3104
|
+
return w.name.trim() || (L.name = "Name is required"), w.email.trim() ? /\S+@\S+\.\S+/.test(w.email) || (L.email = "Invalid email address") : L.email = "Email is required", w.password ? w.password.length < 6 && (L.password = "Password must be at least 6 characters") : L.password = "Password is required", q(L), Object.keys(L).length === 0;
|
|
3105
|
+
}, K = async (L) => {
|
|
3106
|
+
if (L.preventDefault(), !!M()) {
|
|
3116
3107
|
A(!0), b(null);
|
|
3117
3108
|
try {
|
|
3118
3109
|
const Y = {
|
|
@@ -3249,8 +3240,8 @@ const Ns = [
|
|
|
3249
3240
|
objectFit: "cover",
|
|
3250
3241
|
border: `2px solid ${i}30`
|
|
3251
3242
|
},
|
|
3252
|
-
onError: (
|
|
3253
|
-
const Y =
|
|
3243
|
+
onError: (L) => {
|
|
3244
|
+
const Y = L.target;
|
|
3254
3245
|
Y.style.display = "none";
|
|
3255
3246
|
}
|
|
3256
3247
|
}
|
|
@@ -3317,7 +3308,7 @@ const Ns = [
|
|
|
3317
3308
|
"button",
|
|
3318
3309
|
{
|
|
3319
3310
|
type: "button",
|
|
3320
|
-
onClick: () => h((
|
|
3311
|
+
onClick: () => h((L) => ({ ...L, role: d[0] })),
|
|
3321
3312
|
style: {
|
|
3322
3313
|
flex: 1,
|
|
3323
3314
|
zIndex: 10,
|
|
@@ -3339,7 +3330,7 @@ const Ns = [
|
|
|
3339
3330
|
"button",
|
|
3340
3331
|
{
|
|
3341
3332
|
type: "button",
|
|
3342
|
-
onClick: () => h((
|
|
3333
|
+
onClick: () => h((L) => ({ ...L, role: d[1] })),
|
|
3343
3334
|
style: {
|
|
3344
3335
|
flex: 1,
|
|
3345
3336
|
zIndex: 10,
|
|
@@ -3732,7 +3723,7 @@ const Ns = [
|
|
|
3732
3723
|
const ne = "a_s_b", oe = "true", B = /* @__PURE__ */ new Date();
|
|
3733
3724
|
B.setTime(B.getTime() + 3600 * 1e3), document.cookie = `${ne}=${oe}; path=/; expires=${B.toUTCString()}; SameSite=Lax`;
|
|
3734
3725
|
}
|
|
3735
|
-
A({ type: "success", text: `Welcome ${D.name}` }), d?.(D);
|
|
3726
|
+
A({ type: "success", text: `Welcome ${D.name}` }), d?.(D), typeof window < "u" && window.location.reload();
|
|
3736
3727
|
} catch (S) {
|
|
3737
3728
|
const D = S.message || "Login failed";
|
|
3738
3729
|
A({ type: "error", text: D }), f?.(S);
|
|
@@ -3741,7 +3732,7 @@ const Ns = [
|
|
|
3741
3732
|
}
|
|
3742
3733
|
}, H = (m) => {
|
|
3743
3734
|
X({ ...I, [m.target.name]: m.target.value });
|
|
3744
|
-
},
|
|
3735
|
+
}, L = async (m) => {
|
|
3745
3736
|
m.preventDefault(), C(!0), A(null);
|
|
3746
3737
|
try {
|
|
3747
3738
|
const S = await p.requestResetUserPasswordOTP({
|
|
@@ -4053,7 +4044,7 @@ const Ns = [
|
|
|
4053
4044
|
y === "forgot" && /* @__PURE__ */ r.jsxs(
|
|
4054
4045
|
"form",
|
|
4055
4046
|
{
|
|
4056
|
-
onSubmit: E === 1 ?
|
|
4047
|
+
onSubmit: E === 1 ? L : Y,
|
|
4057
4048
|
style: { display: "flex", flexDirection: "column", gap: "14px" },
|
|
4058
4049
|
children: [
|
|
4059
4050
|
E === 1 ? /* @__PURE__ */ r.jsxs(
|
|
@@ -4319,7 +4310,7 @@ const Ns = [
|
|
|
4319
4310
|
}, []), !n) return null;
|
|
4320
4311
|
const o = (c) => typeof c == "function" ? c() : c;
|
|
4321
4312
|
return i === null ? o(e) ?? null : i ? /* @__PURE__ */ r.jsx(r.Fragment, { children: t }) : o(e);
|
|
4322
|
-
},
|
|
4313
|
+
}, Ls = ({
|
|
4323
4314
|
isOpen: t,
|
|
4324
4315
|
onClose: e,
|
|
4325
4316
|
onSuccess: n,
|
|
@@ -5170,7 +5161,7 @@ const Ns = [
|
|
|
5170
5161
|
]
|
|
5171
5162
|
}
|
|
5172
5163
|
);
|
|
5173
|
-
},
|
|
5164
|
+
}, Fs = ({
|
|
5174
5165
|
isOpen: t,
|
|
5175
5166
|
onClose: e,
|
|
5176
5167
|
onUpdate: n,
|
|
@@ -6372,7 +6363,7 @@ const Ns = [
|
|
|
6372
6363
|
const a = fe(), [o, c] = P(null), [d, f] = P(), [p, y] = P(!0), [k, E] = P(!1), [u, w] = P(!1), [h, O] = P(!1), [C, g] = P(!1), [A, N] = P(!1), [b, j] = P(!1), [q, I] = P(!1), [X, W] = P(!1), [T, G] = P(null), [R, z] = P(!1), [M, K] = P({
|
|
6373
6364
|
email: "",
|
|
6374
6365
|
otp: ""
|
|
6375
|
-
}), [H,
|
|
6366
|
+
}), [H, L] = P(!1), [Y, l] = P(!1);
|
|
6376
6367
|
ee(() => {
|
|
6377
6368
|
if (typeof window < "u") {
|
|
6378
6369
|
const v = () => c(window.innerWidth);
|
|
@@ -6412,7 +6403,7 @@ const Ns = [
|
|
|
6412
6403
|
userId: d.id,
|
|
6413
6404
|
email: M.email
|
|
6414
6405
|
}), U = v?.data?.success ?? v?.success, V = v?.data?.message ?? v?.message;
|
|
6415
|
-
U ? (m("success", V || "OTP sent to email!"),
|
|
6406
|
+
U ? (m("success", V || "OTP sent to email!"), L(!0)) : m("error", V || "Failed to send OTP");
|
|
6416
6407
|
} catch (v) {
|
|
6417
6408
|
const U = v?.response?.data?.message || v?.message || "Server error";
|
|
6418
6409
|
m("error", U);
|
|
@@ -6437,7 +6428,7 @@ const Ns = [
|
|
|
6437
6428
|
if (V) {
|
|
6438
6429
|
m("success", Z || "Email verified!");
|
|
6439
6430
|
const de = { ...d, isVerified: !0 };
|
|
6440
|
-
f(de), typeof s == "function" && s(de), K({ email: de.email, otp: "" }),
|
|
6431
|
+
f(de), typeof s == "function" && s(de), K({ email: de.email, otp: "" }), L(!1), j?.(!1);
|
|
6441
6432
|
} else
|
|
6442
6433
|
m("error", Z || "Verification failed");
|
|
6443
6434
|
} catch (U) {
|
|
@@ -7441,7 +7432,7 @@ const Ns = [
|
|
|
7441
7432
|
}
|
|
7442
7433
|
),
|
|
7443
7434
|
/* @__PURE__ */ r.jsx(
|
|
7444
|
-
|
|
7435
|
+
Fs,
|
|
7445
7436
|
{
|
|
7446
7437
|
isOpen: h,
|
|
7447
7438
|
onClose: () => {
|
|
@@ -7463,7 +7454,7 @@ const Ns = [
|
|
|
7463
7454
|
}
|
|
7464
7455
|
),
|
|
7465
7456
|
/* @__PURE__ */ r.jsx(
|
|
7466
|
-
|
|
7457
|
+
Ls,
|
|
7467
7458
|
{
|
|
7468
7459
|
userId: d.id,
|
|
7469
7460
|
isOpen: A,
|
|
@@ -7478,7 +7469,7 @@ const Ns = [
|
|
|
7478
7469
|
{
|
|
7479
7470
|
isOpen: b,
|
|
7480
7471
|
onClose: () => {
|
|
7481
|
-
j(!1),
|
|
7472
|
+
j(!1), L(!1), K({ email: d?.email || "", otp: "" });
|
|
7482
7473
|
},
|
|
7483
7474
|
onVerify: ne,
|
|
7484
7475
|
onSendOTP: D,
|
|
@@ -7909,7 +7900,7 @@ const Ns = [
|
|
|
7909
7900
|
}
|
|
7910
7901
|
}, K = (l, m) => {
|
|
7911
7902
|
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), m());
|
|
7912
|
-
}, H = () => o || C?.profileUrl,
|
|
7903
|
+
}, H = () => o || C?.profileUrl, L = () => {
|
|
7913
7904
|
const l = H();
|
|
7914
7905
|
l && window.open(l, "_self", "noopener,noreferrer");
|
|
7915
7906
|
}, Y = () => {
|
|
@@ -8066,14 +8057,14 @@ const Ns = [
|
|
|
8066
8057
|
"button",
|
|
8067
8058
|
{
|
|
8068
8059
|
style: z.menuItem,
|
|
8069
|
-
onClick:
|
|
8060
|
+
onClick: L,
|
|
8070
8061
|
onMouseOver: (l) => {
|
|
8071
8062
|
l.currentTarget.style.backgroundColor = R.surfaceHover;
|
|
8072
8063
|
},
|
|
8073
8064
|
onMouseOut: (l) => {
|
|
8074
8065
|
l.currentTarget.style.backgroundColor = "transparent";
|
|
8075
8066
|
},
|
|
8076
|
-
onKeyDown: (l) => K(l,
|
|
8067
|
+
onKeyDown: (l) => K(l, L),
|
|
8077
8068
|
role: "menuitem",
|
|
8078
8069
|
tabIndex: 0,
|
|
8079
8070
|
children: [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const s=new this(e);return n.forEach(i=>s.set(i)),s}static accessor(e){const s=(this[Ct]=this[Ct]={accessors:{}}).accessors,i=this.prototype;function o(a){const c=Ce(a);s[c]||(on(i,a),s[c]=!0)}return f.isArray(e)?e.forEach(o):o(e),this}};re.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),f.reduceDescriptors(re.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[n]=s}}}),f.freezeMethods(re);function Ge(t,e){const n=this||Te,s=e||n,i=re.from(s.headers);let o=s.data;return f.forEach(t,function(c){o=c.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function Pt(t){return!!(t&&t.__CANCEL__)}function be(t,e,n){N.call(this,t??"canceled",N.ERR_CANCELED,e,n),this.name="CanceledError"}f.inherits(be,N,{__CANCEL__:!0});function Ot(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new N("Request failed with status code "+n.status,[N.ERR_BAD_REQUEST,N.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function an(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ln(t,e){t=t||10;const n=new Array(t),s=new Array(t);let i=0,o=0,a;return e=e!==void 0?e:1e3,function(d){const x=Date.now(),p=s[o];a||(a=x),n[i]=d,s[i]=x;let y=o,k=0;for(;y!==i;)k+=n[y++],y=y%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),x-a<e)return;const T=p&&x-p;return T?Math.round(k*1e3/T):void 0}}function cn(t,e){let n=0,s=1e3/e,i,o;const a=(x,p=Date.now())=>{n=p,i=null,o&&(clearTimeout(o),o=null),t(...x)};return[(...x)=>{const p=Date.now(),y=p-n;y>=s?a(x,p):(i=x,o||(o=setTimeout(()=>{o=null,a(i)},s-y)))},()=>i&&a(i)]}const Ue=(t,e,n=3)=>{let s=0;const i=ln(50,250);return cn(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,d=a-s,x=i(d),p=a<=c;s=a;const y={loaded:a,total:c,progress:c?a/c:void 0,bytes:d,rate:x||void 0,estimated:x&&c&&p?(c-a)/x:void 0,event:o,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(y)},n)},_t=(t,e)=>{const n=t!=null;return[s=>e[0]({lengthComputable:n,total:t,loaded:s}),e[1]]},It=t=>(...e)=>f.asap(()=>t(...e)),dn=Z.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Z.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Z.origin),Z.navigator&&/(msie|trident)/i.test(Z.navigator.userAgent)):()=>!0,un=Z.hasStandardBrowserEnv?{write(t,e,n,s,i,o){const a=[t+"="+encodeURIComponent(e)];f.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),f.isString(s)&&a.push("path="+s),f.isString(i)&&a.push("domain="+i),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function pn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function fn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Rt(t,e,n){let s=!pn(e);return t&&(s||n==!1)?fn(t,e):e}const zt=t=>t instanceof re?{...t}:t;function he(t,e){e=e||{};const n={};function s(x,p,y,k){return f.isPlainObject(x)&&f.isPlainObject(p)?f.merge.call({caseless:k},x,p):f.isPlainObject(p)?f.merge({},p):f.isArray(p)?p.slice():p}function i(x,p,y,k){if(f.isUndefined(p)){if(!f.isUndefined(x))return s(void 0,x,y,k)}else return s(x,p,y,k)}function o(x,p){if(!f.isUndefined(p))return s(void 0,p)}function a(x,p){if(f.isUndefined(p)){if(!f.isUndefined(x))return s(void 0,x)}else return s(void 0,p)}function c(x,p,y){if(y in e)return s(x,p);if(y in t)return s(void 0,x)}const d={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(x,p,y)=>i(zt(x),zt(p),y,!0)};return f.forEach(Object.keys({...t,...e}),function(p){const y=d[p]||i,k=y(t[p],e[p],p);f.isUndefined(k)&&y!==c||(n[p]=k)}),n}const At=t=>{const e=he({},t);let{data:n,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:c}=e;if(e.headers=a=re.from(a),e.url=vt(Rt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),f.isFormData(n)){if(Z.hasStandardBrowserEnv||Z.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(f.isFunction(n.getHeaders)){const d=n.getHeaders(),x=["content-type","content-length"];Object.entries(d).forEach(([p,y])=>{x.includes(p.toLowerCase())&&a.set(p,y)})}}if(Z.hasStandardBrowserEnv&&(s&&f.isFunction(s)&&(s=s(e)),s||s!==!1&&dn(e.url))){const d=i&&o&&un.read(o);d&&a.set(i,d)}return e},xn=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,s){const i=At(t);let o=i.data;const a=re.from(i.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:x}=i,p,y,k,T,u;function w(){T&&T(),u&&u(),i.cancelToken&&i.cancelToken.unsubscribe(p),i.signal&&i.signal.removeEventListener("abort",p)}let h=new XMLHttpRequest;h.open(i.method.toUpperCase(),i.url,!0),h.timeout=i.timeout;function _(){if(!h)return;const g=re.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),D={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:g,config:t,request:h};Ot(function(j){n(j),w()},function(j){s(j),w()},D),h=null}"onloadend"in h?h.onloadend=_:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(_)},h.onabort=function(){h&&(s(new N("Request aborted",N.ECONNABORTED,t,h)),h=null)},h.onerror=function(z){const D=z&&z.message?z.message:"Network Error",b=new N(D,N.ERR_NETWORK,t,h);b.event=z||null,s(b),h=null},h.ontimeout=function(){let z=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const D=i.transitional||kt;i.timeoutErrorMessage&&(z=i.timeoutErrorMessage),s(new N(z,D.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,t,h)),h=null},o===void 0&&a.setContentType(null),"setRequestHeader"in h&&f.forEach(a.toJSON(),function(z,D){h.setRequestHeader(D,z)}),f.isUndefined(i.withCredentials)||(h.withCredentials=!!i.withCredentials),c&&c!=="json"&&(h.responseType=i.responseType),x&&([k,u]=Ue(x,!0),h.addEventListener("progress",k)),d&&h.upload&&([y,T]=Ue(d),h.upload.addEventListener("progress",y),h.upload.addEventListener("loadend",T)),(i.cancelToken||i.signal)&&(p=g=>{h&&(s(!g||g.type?new be(null,t,h):g),h.abort(),h=null)},i.cancelToken&&i.cancelToken.subscribe(p),i.signal&&(i.signal.aborted?p():i.signal.addEventListener("abort",p)));const C=an(i.url);if(C&&Z.protocols.indexOf(C)===-1){s(new N("Unsupported protocol "+C+":",N.ERR_BAD_REQUEST,t));return}h.send(o||null)})},hn=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let s=new AbortController,i;const o=function(x){if(!i){i=!0,c();const p=x instanceof Error?x:this.reason;s.abort(p instanceof N?p:new be(p instanceof Error?p.message:p))}};let a=e&&setTimeout(()=>{a=null,o(new N(`timeout ${e} of ms exceeded`,N.ETIMEDOUT))},e);const c=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(x=>{x.unsubscribe?x.unsubscribe(o):x.removeEventListener("abort",o)}),t=null)};t.forEach(x=>x.addEventListener("abort",o));const{signal:d}=s;return d.unsubscribe=()=>f.asap(c),d}},mn=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let s=0,i;for(;s<n;)i=s+e,yield t.slice(s,i),s=i},gn=async function*(t,e){for await(const n of yn(t))yield*mn(n,e)},yn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:s}=await e.read();if(n)break;yield s}}finally{await e.cancel()}},$t=(t,e,n,s)=>{const i=gn(t,e);let o=0,a,c=d=>{a||(a=!0,s&&s(d))};return new ReadableStream({async pull(d){try{const{done:x,value:p}=await i.next();if(x){c(),d.close();return}let y=p.byteLength;if(n){let k=o+=y;n(k)}d.enqueue(new Uint8Array(p))}catch(x){throw c(x),x}},cancel(d){return c(d),i.return()}},{highWaterMark:2})},Nt=64*1024,{isFunction:De}=f,bn=(({Request:t,Response:e})=>({Request:t,Response:e}))(f.global),{ReadableStream:Ut,TextEncoder:Dt}=f.global,Lt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},wn=t=>{t=f.merge.call({skipUndefined:!0},bn,t);const{fetch:e,Request:n,Response:s}=t,i=e?De(e):typeof fetch=="function",o=De(n),a=De(s);if(!i)return!1;const c=i&&De(Ut),d=i&&(typeof Dt=="function"?(u=>w=>u.encode(w))(new Dt):async u=>new Uint8Array(await new n(u).arrayBuffer())),x=o&&c&&Lt(()=>{let u=!1;const w=new n(Z.origin,{body:new Ut,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type");return u&&!w}),p=a&&c&&Lt(()=>f.isReadableStream(new s("").body)),y={stream:p&&(u=>u.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(u=>{!y[u]&&(y[u]=(w,h)=>{let _=w&&w[u];if(_)return _.call(w);throw new N(`Response type '${u}' is not supported`,N.ERR_NOT_SUPPORT,h)})});const k=async u=>{if(u==null)return 0;if(f.isBlob(u))return u.size;if(f.isSpecCompliantForm(u))return(await new n(Z.origin,{method:"POST",body:u}).arrayBuffer()).byteLength;if(f.isArrayBufferView(u)||f.isArrayBuffer(u))return u.byteLength;if(f.isURLSearchParams(u)&&(u=u+""),f.isString(u))return(await d(u)).byteLength},T=async(u,w)=>{const h=f.toFiniteNumber(u.getContentLength());return h??k(w)};return async u=>{let{url:w,method:h,data:_,signal:C,cancelToken:g,timeout:z,onDownloadProgress:D,onUploadProgress:b,responseType:j,headers:q,withCredentials:I="same-origin",fetchOptions:X}=At(u),W=e||fetch;j=j?(j+"").toLowerCase():"text";let P=hn([C,g&&g.toAbortSignal()],z),G=null;const O=P&&P.unsubscribe&&(()=>{P.unsubscribe()});let R;try{if(b&&x&&h!=="get"&&h!=="head"&&(R=await T(q,_))!==0){let l=new n(w,{method:"POST",body:_,duplex:"half"}),m;if(f.isFormData(_)&&(m=l.headers.get("content-type"))&&q.setContentType(m),l.body){const[E,U]=_t(R,Ue(It(b)));_=$t(l.body,Nt,E,U)}}f.isString(I)||(I=I?"include":"omit");const M=o&&"credentials"in n.prototype,K={...X,signal:P,method:h.toUpperCase(),headers:q.normalize().toJSON(),body:_,duplex:"half",credentials:M?I:void 0};G=o&&new n(w,K);let H=await(o?W(G,X):W(w,K));const L=p&&(j==="stream"||j==="response");if(p&&(D||L&&O)){const l={};["status","statusText","headers"].forEach(ne=>{l[ne]=H[ne]});const m=f.toFiniteNumber(H.headers.get("content-length")),[E,U]=D&&_t(m,Ue(It(D),!0))||[];H=new s($t(H.body,Nt,E,()=>{U&&U(),O&&O()}),l)}j=j||"text";let J=await y[f.findKey(y,j)||"text"](H,u);return!L&&O&&O(),await new Promise((l,m)=>{Ot(l,m,{data:J,headers:re.from(H.headers),status:H.status,statusText:H.statusText,config:u,request:G})})}catch(M){throw O&&O(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new N("Network Error",N.ERR_NETWORK,u,G),{cause:M.cause||M}):N.from(M,M&&M.code,u,G)}}},Sn=new Map,Ft=t=>{let e=t?t.env:{};const{fetch:n,Request:s,Response:i}=e,o=[s,i,n];let a=o.length,c=a,d,x,p=Sn;for(;c--;)d=o[c],x=p.get(d),x===void 0&&p.set(d,x=c?new Map:wn(e)),p=x;return x};Ft();const Xe={http:Mr,xhr:xn,fetch:{get:Ft}};f.forEach(Xe,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const qt=t=>`- ${t}`,jn=t=>f.isFunction(t)||t===null||t===!1,Mt={getAdapter:(t,e)=>{t=f.isArray(t)?t:[t];const{length:n}=t;let s,i;const o={};for(let a=0;a<n;a++){s=t[a];let c;if(i=s,!jn(s)&&(i=Xe[(c=String(s)).toLowerCase()],i===void 0))throw new N(`Unknown adapter '${c}'`);if(i&&(f.isFunction(i)||(i=i.get(e))))break;o[c||"#"+a]=i}if(!i){const a=Object.entries(o).map(([d,x])=>`adapter ${d} `+(x===!1?"is not supported by the environment":"is not available in the build"));let c=n?a.length>1?`since :
|
|
4
4
|
`+a.map(qt).join(`
|
|
5
5
|
`):" "+qt(a[0]):"as no adapter specified";throw new N("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return i},adapters:Xe};function Ze(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new be(null,t)}function Wt(t){return Ze(t),t.headers=re.from(t.headers),t.data=Ge.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Mt.getAdapter(t.adapter||Te.adapter,t)(t).then(function(s){return Ze(t),s.data=Ge.call(t,t.transformResponse,s),s.headers=re.from(s.headers),s},function(s){return Pt(s)||(Ze(t),s&&s.response&&(s.response.data=Ge.call(t,t.transformResponse,s.response),s.response.headers=re.from(s.response.headers))),Promise.reject(s)})}const Bt="1.12.2",Le={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Le[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Ht={};Le.transitional=function(e,n,s){function i(o,a){return"[Axios v"+Bt+"] Transitional option '"+o+"'"+a+(s?". "+s:"")}return(o,a,c)=>{if(e===!1)throw new N(i(a," has been removed"+(n?" in "+n:"")),N.ERR_DEPRECATED);return n&&!Ht[a]&&(Ht[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,a,c):!0}},Le.spelling=function(e){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function vn(t,e,n){if(typeof t!="object")throw new N("options must be an object",N.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let i=s.length;for(;i-- >0;){const o=s[i],a=e[o];if(a){const c=t[o],d=c===void 0||a(c,o,t);if(d!==!0)throw new N("option "+o+" must be "+d,N.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new N("Unknown option "+o,N.ERR_BAD_OPTION)}}const Fe={assertOptions:vn,validators:Le},ae=Fe.validators;let me=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Et,response:new Et}}async request(e,n){try{return await this._request(e,n)}catch(s){if(s instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
6
|
-
`+o):s.stack=o}catch{}}throw s}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=he(this.defaults,n);const{transitional:s,paramsSerializer:i,headers:o}=n;s!==void 0&&Fe.assertOptions(s,{silentJSONParsing:ae.transitional(ae.boolean),forcedJSONParsing:ae.transitional(ae.boolean),clarifyTimeoutError:ae.transitional(ae.boolean)},!1),i!=null&&(f.isFunction(i)?n.paramsSerializer={serialize:i}:Fe.assertOptions(i,{encode:ae.function,serialize:ae.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Fe.assertOptions(n,{baseUrl:ae.spelling("baseURL"),withXsrfToken:ae.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&f.merge(o.common,o[n.method]);o&&f.forEach(["delete","get","head","post","put","patch","common"],u=>{delete o[u]}),n.headers=re.concat(a,o);const c=[];let d=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(d=d&&w.synchronous,c.unshift(w.fulfilled,w.rejected))});const x=[];this.interceptors.response.forEach(function(w){x.push(w.fulfilled,w.rejected)});let p,y=0,k;if(!d){const u=[Wt.bind(this),void 0];for(u.unshift(...c),u.push(...x),k=u.length,p=Promise.resolve(n);y<k;)p=p.then(u[y++],u[y++]);return p}k=c.length;let T=n;for(;y<k;){const u=c[y++],w=c[y++];try{T=u(T)}catch(h){w.call(this,h);break}}try{p=Wt.call(this,T)}catch(u){return Promise.reject(u)}for(y=0,k=x.length;y<k;)p=p.then(x[y++],x[y++]);return p}getUri(e){e=he(this.defaults,e);const n=Rt(e.baseURL,e.url,e.allowAbsoluteUrls);return vt(n,e.params,e.paramsSerializer)}};f.forEach(["delete","get","head","options"],function(e){me.prototype[e]=function(n,s){return this.request(he(s||{},{method:e,url:n,data:(s||{}).data}))}}),f.forEach(["post","put","patch"],function(e){function n(s){return function(o,a,c){return this.request(he(c||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}me.prototype[e]=n(),me.prototype[e+"Form"]=n(!0)});let En=class nr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const s=this;this.promise.then(i=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](i);s._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(c=>{s.subscribe(c),o=c}).then(i);return a.cancel=function(){s.unsubscribe(o)},a},e(function(o,a,c){s.reason||(s.reason=new be(o,a,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=s=>{e.abort(s)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new nr(function(i){e=i}),cancel:e}}};function kn(t){return function(n){return t.apply(null,n)}}function Tn(t){return f.isObject(t)&&t.isAxiosError===!0}const Qe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Qe).forEach(([t,e])=>{Qe[e]=t});function Vt(t){const e=new me(t),n=lt(me.prototype.request,e);return f.extend(n,me.prototype,e,{allOwnKeys:!0}),f.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Vt(he(t,i))},n}const Y=Vt(Te);Y.Axios=me,Y.CanceledError=be,Y.CancelToken=En,Y.isCancel=Pt,Y.VERSION=Bt,Y.toFormData=$e,Y.AxiosError=N,Y.Cancel=Y.CanceledError,Y.all=function(e){return Promise.all(e)},Y.spread=kn,Y.isAxiosError=Tn,Y.mergeConfig=he,Y.AxiosHeaders=re,Y.formToJSON=t=>Tt(f.isHTMLForm(t)?new FormData(t):t),Y.getAdapter=Mt.getAdapter,Y.HttpStatusCode=Qe,Y.default=Y;const{Axios:xs,AxiosError:hs,CanceledError:ms,isCancel:gs,CancelToken:ys,VERSION:bs,all:ws,Cancel:Ss,isAxiosError:js,spread:vs,toFormData:Es,AxiosHeaders:ks,HttpStatusCode:Ts,formToJSON:Cs,getAdapter:Ps,mergeConfig:Os}=Y;class Cn{baseUrl;apiKey;appId;client;constructor(e){if(!e||!e.baseUrl)throw new Error("NeuctraAuthixClient: 'baseUrl' is required in config");this.baseUrl=e.baseUrl.replace(/\/$/,""),this.apiKey=e.apiKey||null,this.appId=e.appId||null,this.client=Y.create({baseURL:this.baseUrl,headers:{"Content-Type":"application/json",...this.apiKey?{"x-api-key":this.apiKey}:{}},timeout:3e4,withCredentials:!0})}async request(e,n,s,i={},o=!1){try{const a={...this.appId?{appId:this.appId}:{},...s||{}};return(await this.client.request({url:n,method:e,data:a,headers:i,withCredentials:o})).data}catch(a){throw Y.isAxiosError(a)?{message:a.response?.data?.message||a.message||"Request failed",status:a.response?.status??0}:{message:a.message||"Unexpected error occurred"}}}async signupUser(e){const{name:n,email:s,password:i}=e;if(!n||!s||!i)throw new Error("signup: 'name', 'email', and 'password' are required");return await this.request("POST","/users/signup",e,{},!0)}async loginUser(e){const{email:n,password:s}=e;if(!n||!s)throw new Error("login: 'email' and 'password' are required");try{return await this.request("POST","/users/login",{email:n,password:s},{},!0)}catch(i){throw new Error(i.message||"Login failed due to an unknown error")}}async logoutUser(){try{const e=await this.request("POST","/users/logout",{},{},!0);if(e&&e.success){if(typeof document<"u"){const n=new Date(0).toUTCString();document.cookie=`a_s_b=; path=/; Max-Age=${n}; SameSite=Lax`}return{success:!0}}return{success:!1}}catch(e){throw new Error(e.message||"Logout failed due to an unknown error")}}async changePassword(e){const{userId:n,currentPassword:s,newPassword:i}=e;if(!n)throw new Error("changePassword: 'userId' is required");if(!s||!i)throw new Error("changePassword: both 'currentPassword' and 'newPassword' are required");return await this.request("PUT",`/users/change-password/${n}`,{currentPassword:s,newPassword:i},{},!0)}async requestEmailVerificationOTP(e){const{userId:n,email:s}=e;if(!n)throw{message:"requestEmailVerificationOTP: 'userId' is required",status:400};if(!s)throw{message:"requestEmailVerificationOTP: 'email' is required",status:400};try{return await this.request("POST",`/users/send-verify-otp/${encodeURIComponent(n)}`,{email:s},{},!0)}catch(i){throw console.error("requestEmailVerificationOTP Error:",i),{message:i?.message||"Failed to send verification OTP",status:i?.status||500}}}async verifyEmail(e){const{email:n,otp:s}=e;if(!n)throw new Error("verifyEmail: 'email' is required");if(!s)throw new Error("verifyEmail: 'otp' is required");try{return await this.request("POST","/users/verify-email",{email:n,otp:s},{},!0)}catch(i){throw{message:i.message||"Failed to verify email",status:i.status||500}}}async checkUserSession(){if(typeof window>"u")return{authenticated:!1};try{return await this.request("GET","/users/session",void 0,{},!0)}catch{return{authenticated:!1}}}async updateUser(e){const{userId:n}=e;if(!n)throw new Error("updateUser: 'userId' is required");return await this.request("PUT",`/users/update/${n}`,{...e},{},!0)}async deleteUser(e){const{userId:n}=e;if(!n)throw new Error("deleteUser: 'userId' is required");return await this.request("DELETE",`/users/delete/${n}`,{},{},!0)}async getUserProfile(e){const{userId:n}=e;if(!n)throw new Error("getProfile: 'userId' and 'appId' are required");try{return await this.request("POST","/users/profile",{userId:n},{},!0)}catch(s){throw{message:s.message||"Failed to fetch profile",status:s.status||500}}}async requestResetUserPasswordOTP(e){const{email:n}=e;if(!n)throw new Error("forgotPassword: 'email' is required");return await this.request("POST","/users/forgot-password",{email:n})}async resetUserPassword(e){const{email:n,otp:s,newPassword:i}=e;if(!n||!s||!i)throw new Error("resetPassword: 'email', 'otp' and 'newPassword' are required");return await this.request("POST","/users/reset-password",{email:n,otp:s,newPassword:i})}async checkIfUserExists(e){if(!e)throw new Error("checkUser: 'userId' is required");return await this.request("GET",`/users/check-user/${e}?appId=${this.appId}`)}async searchUserData(e){const{userId:n,...s}=e;if(!n)throw new Error("userId required");const i=new URLSearchParams(s).toString();return await this.request("GET",`/users/${n}/data/search?${i}`,void 0,{},!1)}async searchUserDataByKeys(e){const{userId:n,...s}=e;if(!n)throw new Error("searchUserDataByKeys: 'userId' is required");const i=new URLSearchParams(Object.entries(s).reduce((o,[a,c])=>(c!=null&&(o[a]=String(c)),o),{})).toString();return await this.request("GET",`/users/${n}/data/searchbyref?${i}`,void 0,{},!1)}async getUserData(e){const{userId:n}=e;if(!n)throw new Error("getUserData: 'userId' is required");return await this.request("GET",`/users/${n}/data`,void 0,{},!1)}async getSingleUserData(e){const{userId:n,dataId:s}=e;if(!n||!s)throw new Error("getSingleUserData: 'userId' and 'dataId' are required");return await this.request("GET",`/users/${n}/data/${s}`,void 0,{},!1)}async addUserData(e){const{userId:n,dataCategory:s,data:i}=e;if(!n)throw new Error("addUserData: 'userId' is required");if(!s)throw new Error("addUserData: 'dataCategory' is required");if(!i)throw new Error("addUserData: 'data' is required");return await this.request("POST",`/users/${n}/data`,{dataCategory:s,...i},{},!1)}async updateUserData(e){const{userId:n,dataId:s,data:i}=e;if(!n||!s)throw new Error("updateUserData: 'userId' and 'dataId' are required");if(!i)throw new Error("updateUserData: 'data' is required");return await this.request("PUT",`/users/${n}/data/${s}`,i,{},!1)}async deleteUserData(e){const{userId:n,dataId:s}=e;if(!n||!s)throw new Error("deleteUserData: 'userId' and 'dataId' are required");return await this.request("DELETE",`/users/${n}/data/${s}`,void 0,{},!1)}async getAppData(e){const n=this.appId;if(!n)throw new Error("getAppData: 'appId' is required");const s=e?`?category=${encodeURIComponent(e)}`:"";return await this.request("GET",`/app/${n}/data${s}`,void 0,{},!1)}async getSingleAppData(e){const n=this.appId;if(!n)throw new Error("getSingleAppData: 'appId' is required");if(!e.dataId)throw new Error("getSingleAppData: 'dataId' is required");return await this.request("GET",`/app/${n}/data/${e.dataId}`,void 0,{},!1)}async searchAppDataByKeys(e){const n=this.appId;if(!n)throw new Error("searchAppDataByKeys: 'appId' is required");if(!e||typeof e!="object")throw new Error("searchAppDataByKeys: params object is required");return await this.request("POST",`/app/${encodeURIComponent(n)}/data/search/bykeys`,e,{},!1)}async addAppData(e){const n=this.appId;if(!n)throw new Error("addAppData: 'appId' is required");const{dataCategory:s,data:i}=e;if(!s)throw new Error("addAppData: 'dataCategory' is required");if(!i||typeof i!="object")throw new Error("addAppData: 'data' is required");return await this.request("POST",`/app/${n}/data/${encodeURIComponent(s)}`,{item:i},{},!1)}async updateAppData(e){const n=this.appId;if(!n)throw new Error("updateAppData: 'appId' is required");if(!e.dataId)throw new Error("updateAppData: 'dataId' is required");if(!e.data)throw new Error("updateAppData: 'data' is required");return await this.request("PATCH",`/app/${n}/data/${e.dataId}`,e.data,{},!1)}async deleteAppData(e){const n=this.appId;if(!n)throw new Error("deleteAppData: 'appId' is required");if(!e.dataId)throw new Error("deleteAppData: 'dataId' is required");return await this.request("DELETE",`/app/${n}/data/${e.dataId}`,void 0,{},!1)}}var qe={exports:{}},Pe={};/**
|
|
6
|
+
`+o):s.stack=o}catch{}}throw s}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=he(this.defaults,n);const{transitional:s,paramsSerializer:i,headers:o}=n;s!==void 0&&Fe.assertOptions(s,{silentJSONParsing:ae.transitional(ae.boolean),forcedJSONParsing:ae.transitional(ae.boolean),clarifyTimeoutError:ae.transitional(ae.boolean)},!1),i!=null&&(f.isFunction(i)?n.paramsSerializer={serialize:i}:Fe.assertOptions(i,{encode:ae.function,serialize:ae.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Fe.assertOptions(n,{baseUrl:ae.spelling("baseURL"),withXsrfToken:ae.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&f.merge(o.common,o[n.method]);o&&f.forEach(["delete","get","head","post","put","patch","common"],u=>{delete o[u]}),n.headers=re.concat(a,o);const c=[];let d=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(d=d&&w.synchronous,c.unshift(w.fulfilled,w.rejected))});const x=[];this.interceptors.response.forEach(function(w){x.push(w.fulfilled,w.rejected)});let p,y=0,k;if(!d){const u=[Wt.bind(this),void 0];for(u.unshift(...c),u.push(...x),k=u.length,p=Promise.resolve(n);y<k;)p=p.then(u[y++],u[y++]);return p}k=c.length;let T=n;for(;y<k;){const u=c[y++],w=c[y++];try{T=u(T)}catch(h){w.call(this,h);break}}try{p=Wt.call(this,T)}catch(u){return Promise.reject(u)}for(y=0,k=x.length;y<k;)p=p.then(x[y++],x[y++]);return p}getUri(e){e=he(this.defaults,e);const n=Rt(e.baseURL,e.url,e.allowAbsoluteUrls);return vt(n,e.params,e.paramsSerializer)}};f.forEach(["delete","get","head","options"],function(e){me.prototype[e]=function(n,s){return this.request(he(s||{},{method:e,url:n,data:(s||{}).data}))}}),f.forEach(["post","put","patch"],function(e){function n(s){return function(o,a,c){return this.request(he(c||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}me.prototype[e]=n(),me.prototype[e+"Form"]=n(!0)});let En=class nr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const s=this;this.promise.then(i=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](i);s._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(c=>{s.subscribe(c),o=c}).then(i);return a.cancel=function(){s.unsubscribe(o)},a},e(function(o,a,c){s.reason||(s.reason=new be(o,a,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=s=>{e.abort(s)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new nr(function(i){e=i}),cancel:e}}};function kn(t){return function(n){return t.apply(null,n)}}function Tn(t){return f.isObject(t)&&t.isAxiosError===!0}const Qe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Qe).forEach(([t,e])=>{Qe[e]=t});function Vt(t){const e=new me(t),n=lt(me.prototype.request,e);return f.extend(n,me.prototype,e,{allOwnKeys:!0}),f.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Vt(he(t,i))},n}const Y=Vt(Te);Y.Axios=me,Y.CanceledError=be,Y.CancelToken=En,Y.isCancel=Pt,Y.VERSION=Bt,Y.toFormData=$e,Y.AxiosError=N,Y.Cancel=Y.CanceledError,Y.all=function(e){return Promise.all(e)},Y.spread=kn,Y.isAxiosError=Tn,Y.mergeConfig=he,Y.AxiosHeaders=re,Y.formToJSON=t=>Tt(f.isHTMLForm(t)?new FormData(t):t),Y.getAdapter=Mt.getAdapter,Y.HttpStatusCode=Qe,Y.default=Y;const{Axios:xs,AxiosError:hs,CanceledError:ms,isCancel:gs,CancelToken:ys,VERSION:bs,all:ws,Cancel:Ss,isAxiosError:js,spread:vs,toFormData:Es,AxiosHeaders:ks,HttpStatusCode:Ts,formToJSON:Cs,getAdapter:Ps,mergeConfig:Os}=Y;class Cn{baseUrl;apiKey;appId;client;constructor(e){if(!e||!e.baseUrl)throw new Error("NeuctraAuthixClient: 'baseUrl' is required in config");this.baseUrl=e.baseUrl.replace(/\/$/,""),this.apiKey=e.apiKey||null,this.appId=e.appId||null,this.client=Y.create({baseURL:this.baseUrl,headers:{"Content-Type":"application/json",...this.apiKey?{"x-api-key":this.apiKey}:{}},timeout:3e4,withCredentials:!0})}async request(e,n,s,i={},o=!1){try{const a={...this.appId?{appId:this.appId}:{},...s||{}};return(await this.client.request({url:n,method:e,data:a,headers:i,withCredentials:o})).data}catch(a){throw Y.isAxiosError(a)?{message:a.response?.data?.message||a.message||"Request failed",status:a.response?.status??0}:{message:a.message||"Unexpected error occurred"}}}async signupUser(e){const{name:n,email:s,password:i}=e;if(!n||!s||!i)throw new Error("signup: 'name', 'email', and 'password' are required");return await this.request("POST","/users/signup",e,{},!0)}async loginUser(e){const{email:n,password:s}=e;if(!n||!s)throw new Error("login: 'email' and 'password' are required");try{return await this.request("POST","/users/login",{email:n,password:s},{},!0)}catch(i){throw new Error(i.message||"Login failed due to an unknown error")}}async logoutUser(){try{return(await this.request("POST","/users/logout",{},{},!0))?.success?(typeof window<"u"&&(document.cookie="a_s_b=; path=/; Max-Age=0; SameSite=Lax",window.location.protocol==="https:"&&(document.cookie="a_s_b=; path=/; Max-Age=0; SameSite=Lax; Secure"),window.location.reload()),{success:!0}):{success:!1}}catch(e){throw new Error(e?.message||"Logout failed due to an unknown error")}}async changePassword(e){const{userId:n,currentPassword:s,newPassword:i}=e;if(!n)throw new Error("changePassword: 'userId' is required");if(!s||!i)throw new Error("changePassword: both 'currentPassword' and 'newPassword' are required");return await this.request("PUT",`/users/change-password/${n}`,{currentPassword:s,newPassword:i},{},!0)}async requestEmailVerificationOTP(e){const{userId:n,email:s}=e;if(!n)throw{message:"requestEmailVerificationOTP: 'userId' is required",status:400};if(!s)throw{message:"requestEmailVerificationOTP: 'email' is required",status:400};try{return await this.request("POST",`/users/send-verify-otp/${encodeURIComponent(n)}`,{email:s},{},!0)}catch(i){throw console.error("requestEmailVerificationOTP Error:",i),{message:i?.message||"Failed to send verification OTP",status:i?.status||500}}}async verifyEmail(e){const{email:n,otp:s}=e;if(!n)throw new Error("verifyEmail: 'email' is required");if(!s)throw new Error("verifyEmail: 'otp' is required");try{return await this.request("POST","/users/verify-email",{email:n,otp:s},{},!0)}catch(i){throw{message:i.message||"Failed to verify email",status:i.status||500}}}async checkUserSession(){if(typeof window>"u")return{authenticated:!1};try{return await this.request("GET","/users/session",void 0,{},!0)}catch{return{authenticated:!1}}}async updateUser(e){const{userId:n}=e;if(!n)throw new Error("updateUser: 'userId' is required");return await this.request("PUT",`/users/update/${n}`,{...e},{},!0)}async deleteUser(e){const{userId:n}=e;if(!n)throw new Error("deleteUser: 'userId' is required");return await this.request("DELETE",`/users/delete/${n}`,{},{},!0)}async getUserProfile(e){const{userId:n}=e;if(!n)throw new Error("getProfile: 'userId' and 'appId' are required");try{return await this.request("POST","/users/profile",{userId:n},{},!0)}catch(s){throw{message:s.message||"Failed to fetch profile",status:s.status||500}}}async requestResetUserPasswordOTP(e){const{email:n}=e;if(!n)throw new Error("forgotPassword: 'email' is required");return await this.request("POST","/users/forgot-password",{email:n})}async resetUserPassword(e){const{email:n,otp:s,newPassword:i}=e;if(!n||!s||!i)throw new Error("resetPassword: 'email', 'otp' and 'newPassword' are required");return await this.request("POST","/users/reset-password",{email:n,otp:s,newPassword:i})}async checkIfUserExists(e){if(!e)throw new Error("checkUser: 'userId' is required");return await this.request("GET",`/users/check-user/${e}?appId=${this.appId}`)}async searchUserData(e){const{userId:n,...s}=e;if(!n)throw new Error("userId required");const i=new URLSearchParams(s).toString();return await this.request("GET",`/users/${n}/data/search?${i}`,void 0,{},!1)}async searchUserDataByKeys(e){const{userId:n,...s}=e;if(!n)throw new Error("searchUserDataByKeys: 'userId' is required");const i=new URLSearchParams(Object.entries(s).reduce((o,[a,c])=>(c!=null&&(o[a]=String(c)),o),{})).toString();return await this.request("GET",`/users/${n}/data/searchbyref?${i}`,void 0,{},!1)}async getUserData(e){const{userId:n}=e;if(!n)throw new Error("getUserData: 'userId' is required");return await this.request("GET",`/users/${n}/data`,void 0,{},!1)}async getSingleUserData(e){const{userId:n,dataId:s}=e;if(!n||!s)throw new Error("getSingleUserData: 'userId' and 'dataId' are required");return await this.request("GET",`/users/${n}/data/${s}`,void 0,{},!1)}async addUserData(e){const{userId:n,dataCategory:s,data:i}=e;if(!n)throw new Error("addUserData: 'userId' is required");if(!s)throw new Error("addUserData: 'dataCategory' is required");if(!i)throw new Error("addUserData: 'data' is required");return await this.request("POST",`/users/${n}/data`,{dataCategory:s,...i},{},!1)}async updateUserData(e){const{userId:n,dataId:s,data:i}=e;if(!n||!s)throw new Error("updateUserData: 'userId' and 'dataId' are required");if(!i)throw new Error("updateUserData: 'data' is required");return await this.request("PUT",`/users/${n}/data/${s}`,i,{},!1)}async deleteUserData(e){const{userId:n,dataId:s}=e;if(!n||!s)throw new Error("deleteUserData: 'userId' and 'dataId' are required");return await this.request("DELETE",`/users/${n}/data/${s}`,void 0,{},!1)}async getAppData(e){const n=this.appId;if(!n)throw new Error("getAppData: 'appId' is required");const s=e?`?category=${encodeURIComponent(e)}`:"";return await this.request("GET",`/app/${n}/data${s}`,void 0,{},!1)}async getSingleAppData(e){const n=this.appId;if(!n)throw new Error("getSingleAppData: 'appId' is required");if(!e.dataId)throw new Error("getSingleAppData: 'dataId' is required");return await this.request("GET",`/app/${n}/data/${e.dataId}`,void 0,{},!1)}async searchAppDataByKeys(e){const n=this.appId;if(!n)throw new Error("searchAppDataByKeys: 'appId' is required");if(!e||typeof e!="object")throw new Error("searchAppDataByKeys: params object is required");return await this.request("POST",`/app/${encodeURIComponent(n)}/data/search/bykeys`,e,{},!1)}async addAppData(e){const n=this.appId;if(!n)throw new Error("addAppData: 'appId' is required");const{dataCategory:s,data:i}=e;if(!s)throw new Error("addAppData: 'dataCategory' is required");if(!i||typeof i!="object")throw new Error("addAppData: 'data' is required");return await this.request("POST",`/app/${n}/data/${encodeURIComponent(s)}`,{item:i},{},!1)}async updateAppData(e){const n=this.appId;if(!n)throw new Error("updateAppData: 'appId' is required");if(!e.dataId)throw new Error("updateAppData: 'dataId' is required");if(!e.data)throw new Error("updateAppData: 'data' is required");return await this.request("PATCH",`/app/${n}/data/${e.dataId}`,e.data,{},!1)}async deleteAppData(e){const n=this.appId;if(!n)throw new Error("deleteAppData: 'appId' is required");if(!e.dataId)throw new Error("deleteAppData: 'dataId' is required");return await this.request("DELETE",`/app/${n}/data/${e.dataId}`,void 0,{},!1)}}var qe={exports:{}},Pe={};/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.js
|
|
9
9
|
*
|
|
@@ -209,7 +209,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
209
209
|
from { transform: rotate(0deg); }
|
|
210
210
|
to { transform: rotate(360deg); }
|
|
211
211
|
}
|
|
212
|
-
`})]})},Xn=({logoUrl:t,logoLinkUrl:e,title:n="Sign In to Your Account",subtitle:s="Welcome back! Please enter your details",primaryColor:i="#00C214",gradient:o="linear-gradient(135deg, #22c55e, #00C214)",darkMode:a=!0,signupUrl:c,onSuccess:d,onError:x})=>{const p=fe(),[y,k]=S.useState("login"),[T,u]=S.useState(1),[w,h]=S.useState(!1),[_,C]=S.useState(!1),[g,z]=S.useState(null),[D,b]=S.useState(""),[j,q]=S.useState(""),[I,X]=S.useState({email:"",otp:"",newPassword:""}),[W,P]=S.useState(!1),G=a?"#ffffff":"#111827",O=a?"#a1a1aa":"#6b7280",R=a?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.02)",M=a?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)";S.useEffect(()=>{if(typeof window<"u"){const m=()=>P(window.innerWidth<768);return m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)}},[]);const K=async m=>{m.preventDefault(),C(!0),z(null);try{const E=await p.loginUser({email:D,password:j}),{user:U}=E;if(!U)throw new Error(E.message||"Login failed");if(typeof document<"u"){const ne="a_s_b",le="true",B=new Date;B.setTime(B.getTime()+3600*1e3),document.cookie=`${ne}=${le}; path=/; expires=${B.toUTCString()}; SameSite=Lax`}z({type:"success",text:`Welcome ${U.name}`}),d?.(U)}catch(E){const U=E.message||"Login failed";z({type:"error",text:U}),x?.(E)}finally{C(!1)}},H=m=>{X({...I,[m.target.name]:m.target.value})},L=async m=>{m.preventDefault(),C(!0),z(null);try{const E=await p.requestResetUserPasswordOTP({email:I.email});E.success?(u(2),z({type:"success",text:E.message||"OTP sent to your email"})):z({type:"error",text:E.message||"Failed to send OTP"})}catch(E){z({type:"error",text:E.message||"Something went wrong"})}finally{C(!1)}},J=async m=>{m.preventDefault(),C(!0),z(null);try{const E=await p.resetUserPassword({email:I.email,otp:I.otp,newPassword:I.newPassword});E.success?(z({type:"success",text:E.message||"Password reset successfully!"}),u(1),X({email:"",otp:"",newPassword:""}),k("login")):z({type:"error",text:E.message||"Reset failed"})}catch(E){z({type:"error",text:E.message||"Something went wrong"})}finally{C(!1)}},l={width:"100%",padding:W?"10px 14px 10px 44px":"10px 16px 10px 44px",backgroundColor:R,border:`1px solid ${M}`,borderRadius:"10px",color:G,fontSize:"15px",outline:"none",transition:"all 0.2s ease"};return r.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsxs("div",{style:{minWidth:W?"320px":"380px",maxWidth:W?"340px":"390px",width:"100%",display:"flex",flexDirection:"column",borderRadius:"10px",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",backgroundColor:a?"#000000":"#ffffff",padding:W?"30px 24px":"18px 28px"},children:[r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginBottom:"10px"},children:[t?r.jsx("a",{href:e||"/",target:"_self",rel:"noopener noreferrer",children:r.jsx("img",{src:t,alt:"Logo",style:{height:"50px",width:"50px",marginBottom:"10px"}})}):r.jsx(Se,{size:40,color:i,style:{marginBottom:"10px"}}),r.jsx("h2",{style:{fontSize:"24px",fontWeight:700,color:G,margin:0},children:y==="login"?n:T===1?"Forgot Password":"Reset Password"}),r.jsx("p",{style:{fontSize:"14px",color:O},children:y==="login"?s:"Follow the steps to reset your password"})]}),y==="login"&&r.jsxs("form",{onSubmit:K,style:{display:"flex",flexDirection:"column",gap:"14px"},children:[r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[r.jsx("label",{htmlFor:"login-email",style:{fontSize:"14px",fontWeight:500,color:a?"#ffffff":"#000000"},children:"Email Address"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(pe,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:O}}),r.jsx("input",{id:"login-email",type:"email",placeholder:"Enter your email",value:D,onChange:m=>b(m.target.value),style:l})]})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[r.jsx("label",{htmlFor:"login-password",style:{fontSize:"14px",fontWeight:500,color:a?"#ffffff":"#000000"},children:"Password"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(we,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:O}}),r.jsx("input",{id:"login-password",type:w?"text":"password",placeholder:"Enter your password",value:j,onChange:m=>q(m.target.value),style:l}),r.jsx("button",{type:"button",onClick:()=>h(!w),style:{position:"absolute",right:"14px",padding:"4px",top:"50%",transform:"translateY(-50%)",background:"transparent",border:"none",color:O,cursor:"pointer"},children:w?r.jsx(rt,{size:20}):r.jsx(nt,{size:20})})]})]}),r.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"13px"},children:[c&&r.jsx("a",{href:c,style:{color:i,textDecoration:"none",fontWeight:500},children:"Create new account"}),r.jsx("button",{type:"button",onClick:()=>k("forgot"),style:{background:"none",border:"none",color:i,fontWeight:500,cursor:"pointer"},children:"Forgot password?"})]}),r.jsx("button",{type:"submit",disabled:_,style:{padding:"12px",background:o,color:"#fff",border:"none",borderRadius:"10px",fontSize:"14px",fontWeight:600},children:_?"Signing In...":"Sign In"})]}),y==="forgot"&&r.jsxs("form",{onSubmit:T===1?L:J,style:{display:"flex",flexDirection:"column",gap:"14px"},children:[T===1?r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[r.jsx("label",{htmlFor:"forgot-email",style:{fontSize:"14px",fontWeight:500,color:a?"#ffffff":"#000000"},children:"Email Address"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(pe,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:O}}),r.jsx("input",{id:"forgot-email",type:"email",name:"email",placeholder:"Enter your email",value:I.email,onChange:H,style:l})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[r.jsx("label",{htmlFor:"otp",style:{fontSize:"14px",fontWeight:500,color:a?"#ffffff":"#000000"},children:"One-Time Password (OTP)"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(Qt,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:O}}),r.jsx("input",{id:"otp",type:"text",name:"otp",placeholder:"Enter OTP",value:I.otp,onChange:H,style:l})]})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[r.jsx("label",{htmlFor:"newPassword",style:{fontSize:"14px",fontWeight:500,color:a?"#ffffff":"#000000"},children:"New Password"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(we,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:O}}),r.jsx("input",{id:"newPassword",type:"password",name:"newPassword",placeholder:"Enter new password",value:I.newPassword,onChange:H,style:l})]})]})]}),r.jsx("button",{type:"submit",disabled:_,style:{padding:"12px",background:o,color:"#fff",border:"none",fontSize:"14px",borderRadius:"10px",fontWeight:600},children:_?"Please wait...":T===1?"Send Reset OTP":"Reset Password"}),r.jsx("button",{type:"button",onClick:()=>{k("login"),u(1)},style:{background:"none",border:"none",fontSize:"14px",color:O,marginTop:"6px",cursor:"pointer"},children:"Back to Login"})]}),g&&r.jsxs("div",{style:{marginTop:"16px",padding:"12px",borderRadius:"12px",fontSize:"14px",display:"flex",alignItems:"center",gap:"10px",backgroundColor:g.type==="success"?`${i}15`:"rgba(239,68,68,0.1)",border:g.type==="success"?`1px solid ${i}30`:"1px solid rgba(239,68,68,0.3)",color:g.type==="success"?i:"#ef4444"},children:[g.type==="success"?r.jsx(de,{size:20}):r.jsx(ie,{size:20}),r.jsx("span",{children:g.text})]}),r.jsxs("div",{style:{textAlign:"center",fontSize:"12px",color:O,marginTop:"16px",padding:"0 4px"},children:["Secure authentication powered by"," ",r.jsx("span",{style:{color:i,fontWeight:600},children:"Neuctra Authix"})]})]})})},Zn=({children:t,fallback:e=null})=>{const n=fe(),[s,i]=S.useState("loading");S.useEffect(()=>{(async()=>{if(!(document.cookie.split(";").map(p=>p.trim()).find(p=>p.startsWith("a_s_b="))?.split("=")[1]==="true")){i("unauthenticated");return}try{(await n.checkUserSession())?.user?.id?i("authenticated"):(document.cookie="a_s_b=false; path=/; max-age=0; SameSite=Lax",i("unauthenticated"))}catch(p){console.error("Session validation failed:",p),document.cookie="a_s_b=false; path=/; max-age=0; SameSite=Lax",i("unauthenticated")}})()},[n]);const o=a=>typeof a=="function"?a():a;return s==="loading"?null:s==="unauthenticated"?o(e)??null:r.jsx(r.Fragment,{children:t})},Qn=({children:t,fallback:e=null})=>{const[n,s]=S.useState(!1),[i,o]=S.useState(null);if(S.useEffect(()=>{s(!0);const d=document.cookie.split(";").map(x=>x.trim()).find(x=>x.startsWith("a_s_b="));o(d?.split("=")[1]!=="true")},[]),!n)return null;const a=c=>typeof c=="function"?c():c;return i===null?a(e)??null:i?r.jsx(r.Fragment,{children:t}):a(e)},es=({isOpen:t,onClose:e,onSuccess:n,onError:s,userId:i,colors:o})=>{const a=fe(),[c,d]=S.useState(!1),[x,p]=S.useState(""),[y,k]=S.useState("warning"),[T,u]=S.useState(!1);if(S.useEffect(()=>{if(typeof window>"u")return;const g=()=>{u(window.innerWidth<640)};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),!t)return null;const w=async()=>{d(!0),k("processing");try{const g=await a.deleteUser({userId:i});g.success?(n(g.message||"Account deleted successfully"),k("success"),setTimeout(()=>{localStorage.removeItem("userInfo"),localStorage.removeItem("userToken"),window.location.href="/"},2e3)):(s(g.message||"Failed to delete account"),k("warning"))}catch(g){s(g.response?.data?.message||"Something went wrong"),k("warning")}finally{d(!1)}},h=x.toLowerCase()==="delete my account",_=g=>{g.target===g.currentTarget&&y!=="processing"&&y!=="success"&&e()},C=()=>{switch(y){case"warning":return r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"24px",gap:"16px"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flex:1},children:[r.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #ef4444, #dc2626)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:r.jsx(Me,{size:20})}),r.jsx("div",{children:r.jsx("h3",{style:{color:o.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Delete Account"})})]}),r.jsx("button",{onClick:e,"aria-label":"Close modal",style:{background:"transparent",border:"none",color:o.textTertiary,cursor:"pointer",padding:"8px",borderRadius:"8px",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=o.border,g.currentTarget.style.color=o.textPrimary},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.color=o.textTertiary},children:r.jsx(_e,{size:20})})]}),r.jsxs("div",{style:{display:"flex",gap:"16px",padding:"20px",background:`${o.error}15`,border:`1px solid ${o.error}30`,borderRadius:"12px",marginBottom:"20px"},children:[r.jsx("div",{style:{color:o.error,flexShrink:0,display:"flex",alignItems:"flex-start"},children:r.jsx(tr,{size:24})}),r.jsxs("div",{style:{flex:1},children:[r.jsx("h4",{style:{color:o.textPrimary,margin:"0 0 12px 0",fontSize:"16px",fontWeight:600},children:"Before you proceed..."}),r.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[{icon:r.jsx(Dn,{size:16}),text:"All your data will be permanently deleted"},{icon:r.jsx(Jn,{size:16}),text:"This action cannot be reversed"},{icon:r.jsx(it,{size:16}),text:"You will lose access to all services"}].map((g,z)=>r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"14px",color:o.textSecondary},children:[r.jsx("div",{style:{color:o.error,flexShrink:0},children:g.icon}),r.jsx("span",{children:g.text})]},z))})]})]}),r.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:T?"column-reverse":"row",justifyContent:"flex-end",alignItems:"stretch"},children:[r.jsx("button",{onClick:e,style:{padding:"10px 24px",borderRadius:"10px",border:`1.5px solid ${o.border}`,background:"transparent",color:o.textPrimary,fontSize:"14px",fontWeight:500,cursor:"pointer",flex:T?"none":1,minWidth:T?"100%":"120px",transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=o.border,g.currentTarget.style.transform="translateY(-1px)"},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.transform="translateY(0)"},children:"Cancel"}),r.jsxs("button",{onClick:()=>k("confirmation"),style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",fontSize:"14px",fontWeight:600,cursor:"pointer",flex:T?"none":1,minWidth:T?"100%":"140px",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease",boxShadow:"0 4px 12px rgba(239, 68, 68, 0.4)"},onMouseOver:g=>{g.currentTarget.style.transform="translateY(-1px)",g.currentTarget.style.boxShadow="0 6px 20px rgba(239, 68, 68, 0.5)"},onMouseOut:g=>{g.currentTarget.style.transform="translateY(0)",g.currentTarget.style.boxShadow="0 4px 12px rgba(239, 68, 68, 0.4)"},children:[r.jsx(Me,{size:16}),"Continue to Delete"]})]})]});case"confirmation":return r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[r.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #f59e0b, #d97706)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:r.jsx(tr,{size:24})}),r.jsx("div",{style:{flex:1},children:r.jsx("h3",{style:{color:o.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Confirm Deletion"})})]}),r.jsxs("div",{style:{marginBottom:"24px"},children:[r.jsxs("p",{style:{color:o.textSecondary,marginBottom:"16px",fontSize:"14px",lineHeight:"1.5"},children:["Type"," ",r.jsx("strong",{style:{color:o.textPrimary},children:'"delete my account"'})," ","to confirm:"]}),r.jsx("input",{type:"text",value:x,onChange:g=>p(g.target.value),placeholder:"delete my account",style:{width:"100%",padding:"14px 16px",borderRadius:"10px",border:`2px solid ${h?o.success:o.error}`,backgroundColor:"transparent",color:o.textPrimary,fontSize:"15px",outline:"none",transition:"all 0.2s ease",boxSizing:"border-box"},onFocus:g=>{g.target.style.boxShadow=`0 0 0 3px ${o.accent}20`},onBlur:g=>{g.target.style.boxShadow="none"},autoFocus:!0}),h&&r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"10px",color:o.success,fontSize:"14px",fontWeight:500},children:[r.jsx(tt,{size:16}),r.jsx("span",{children:"Confirmation accepted"})]})]}),r.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:"column-reverse",justifyContent:"flex-end",alignItems:"stretch"},children:[r.jsx("button",{onClick:()=>{k("warning"),p("")},style:{padding:"10px 24px",borderRadius:"10px",border:`1.5px solid ${o.border}`,background:"transparent",color:o.textPrimary,fontSize:"14px",fontWeight:500,cursor:"pointer",flex:T?"none":1,minWidth:T?"100%":"120px",transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=o.border,g.currentTarget.style.transform="translateY(-1px)"},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.transform="translateY(0)"},children:"Go Back"}),r.jsxs("button",{onClick:w,disabled:!h||c,style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",fontSize:"14px",fontWeight:600,cursor:!h||c?"not-allowed":"pointer",flex:T?"none":1,minWidth:T?"100%":"140px",opacity:!h||c?.6:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease",boxShadow:!h||c?"none":"0 4px 12px rgba(239, 68, 68, 0.4)"},onMouseOver:g=>{h&&!c&&(g.currentTarget.style.transform="translateY(-1px)",g.currentTarget.style.boxShadow="0 6px 20px rgba(239, 68, 68, 0.5)")},onMouseOut:g=>{h&&!c&&(g.currentTarget.style.transform="translateY(0)",g.currentTarget.style.boxShadow="0 4px 12px rgba(239, 68, 68, 0.4)")},children:[r.jsx(Me,{size:16}),"Yes, Delete My Account"]})]})]});case"processing":return r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[r.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #6b7280, #4b5563)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:r.jsx(oe,{size:20,style:{animation:"spin 1s linear infinite"}})}),r.jsxs("div",{style:{flex:1},children:[r.jsx("h3",{style:{color:o.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Deleting Account"}),r.jsx("p",{style:{color:o.textTertiary,margin:"4px 0 0 0",fontSize:"14px",lineHeight:"1.4"},children:"Please wait while we process your request"})]})]}),r.jsx("div",{style:{marginBottom:"20px"},children:r.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[{text:"Removing your data",active:!0},{text:"Closing active sessions",active:!1},{text:"Finalizing deletion",active:!1}].map((g,z)=>r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:g.active?`${o.accent}10`:"transparent"},children:[r.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:g.active?o.accent:o.textTertiary,transition:"all 0.3s ease",boxShadow:g.active?`0 0 0 4px ${o.accent}20`:"none"}}),r.jsx("span",{style:{fontSize:"14px",color:g.active?o.textPrimary:o.textSecondary,fontWeight:g.active?500:400},children:g.text})]},z))})}),r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px",background:`${o.accent}10`,borderRadius:"10px",fontSize:"14px",color:o.textSecondary},children:[r.jsx(er,{size:18,style:{color:o.accent,flexShrink:0}}),r.jsx("span",{children:"You will be redirected to the login page shortly"})]})]});case"success":return r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[r.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #10b981, #059669)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:r.jsx(tt,{size:20})}),r.jsxs("div",{style:{flex:1},children:[r.jsx("h3",{style:{color:o.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Account Deleted"}),r.jsx("p",{style:{color:o.textTertiary,margin:"4px 0 0 0",fontSize:"14px",lineHeight:"1.4"},children:"Your account has been successfully deleted"})]})]}),r.jsxs("div",{style:{textAlign:"center",padding:"20px",background:`${o.success}10`,border:`1px solid ${o.success}20`,borderRadius:"12px",marginBottom:"24px"},children:[r.jsx(tt,{size:48,style:{color:o.success,marginBottom:"12px",display:"block",margin:"0 auto 12px auto"}}),r.jsx("p",{style:{color:o.textPrimary,fontSize:"16px",fontWeight:600,margin:"0 0 8px 0"},children:"Goodbye!"}),r.jsx("p",{style:{color:o.textSecondary,fontSize:"14px",margin:0,lineHeight:"1.5"},children:"Your account and all associated data have been permanently removed from our systems."})]}),r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px",background:`${o.accent}10`,borderRadius:"10px",fontSize:"14px",color:o.textSecondary,justifyContent:"center"},children:[r.jsx(oe,{size:16,style:{animation:"spin 1s linear infinite",color:o.accent}}),r.jsx("span",{children:"Redirecting to login page..."})]})]})}};return r.jsxs("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",zIndex:1e4,animation:"fadeIn 0.3s ease-out"},onClick:_,children:[r.jsx("div",{style:{backgroundColor:o.surface,border:`1px solid ${o.border}`,borderRadius:"20px",width:"100%",maxWidth:"480px",padding:"24px",boxShadow:"0 32px 64px rgba(0,0,0,0.4)",animation:"scaleIn 0.3s ease-out"},className:"delete-modal-container",children:C()}),r.jsx("style",{children:`
|
|
212
|
+
`})]})},Xn=({logoUrl:t,logoLinkUrl:e,title:n="Sign In to Your Account",subtitle:s="Welcome back! Please enter your details",primaryColor:i="#00C214",gradient:o="linear-gradient(135deg, #22c55e, #00C214)",darkMode:a=!0,signupUrl:c,onSuccess:d,onError:x})=>{const p=fe(),[y,k]=S.useState("login"),[T,u]=S.useState(1),[w,h]=S.useState(!1),[_,C]=S.useState(!1),[g,z]=S.useState(null),[D,b]=S.useState(""),[j,q]=S.useState(""),[I,X]=S.useState({email:"",otp:"",newPassword:""}),[W,P]=S.useState(!1),G=a?"#ffffff":"#111827",O=a?"#a1a1aa":"#6b7280",R=a?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.02)",M=a?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)";S.useEffect(()=>{if(typeof window<"u"){const m=()=>P(window.innerWidth<768);return m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)}},[]);const K=async m=>{m.preventDefault(),C(!0),z(null);try{const E=await p.loginUser({email:D,password:j}),{user:U}=E;if(!U)throw new Error(E.message||"Login failed");if(typeof document<"u"){const ne="a_s_b",le="true",B=new Date;B.setTime(B.getTime()+3600*1e3),document.cookie=`${ne}=${le}; path=/; expires=${B.toUTCString()}; SameSite=Lax`}z({type:"success",text:`Welcome ${U.name}`}),d?.(U),typeof window<"u"&&window.location.reload()}catch(E){const U=E.message||"Login failed";z({type:"error",text:U}),x?.(E)}finally{C(!1)}},H=m=>{X({...I,[m.target.name]:m.target.value})},L=async m=>{m.preventDefault(),C(!0),z(null);try{const E=await p.requestResetUserPasswordOTP({email:I.email});E.success?(u(2),z({type:"success",text:E.message||"OTP sent to your email"})):z({type:"error",text:E.message||"Failed to send OTP"})}catch(E){z({type:"error",text:E.message||"Something went wrong"})}finally{C(!1)}},J=async m=>{m.preventDefault(),C(!0),z(null);try{const E=await p.resetUserPassword({email:I.email,otp:I.otp,newPassword:I.newPassword});E.success?(z({type:"success",text:E.message||"Password reset successfully!"}),u(1),X({email:"",otp:"",newPassword:""}),k("login")):z({type:"error",text:E.message||"Reset failed"})}catch(E){z({type:"error",text:E.message||"Something went wrong"})}finally{C(!1)}},l={width:"100%",padding:W?"10px 14px 10px 44px":"10px 16px 10px 44px",backgroundColor:R,border:`1px solid ${M}`,borderRadius:"10px",color:G,fontSize:"15px",outline:"none",transition:"all 0.2s ease"};return r.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsxs("div",{style:{minWidth:W?"320px":"380px",maxWidth:W?"340px":"390px",width:"100%",display:"flex",flexDirection:"column",borderRadius:"10px",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",backgroundColor:a?"#000000":"#ffffff",padding:W?"30px 24px":"18px 28px"},children:[r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginBottom:"10px"},children:[t?r.jsx("a",{href:e||"/",target:"_self",rel:"noopener noreferrer",children:r.jsx("img",{src:t,alt:"Logo",style:{height:"50px",width:"50px",marginBottom:"10px"}})}):r.jsx(Se,{size:40,color:i,style:{marginBottom:"10px"}}),r.jsx("h2",{style:{fontSize:"24px",fontWeight:700,color:G,margin:0},children:y==="login"?n:T===1?"Forgot Password":"Reset Password"}),r.jsx("p",{style:{fontSize:"14px",color:O},children:y==="login"?s:"Follow the steps to reset your password"})]}),y==="login"&&r.jsxs("form",{onSubmit:K,style:{display:"flex",flexDirection:"column",gap:"14px"},children:[r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[r.jsx("label",{htmlFor:"login-email",style:{fontSize:"14px",fontWeight:500,color:a?"#ffffff":"#000000"},children:"Email Address"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(pe,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:O}}),r.jsx("input",{id:"login-email",type:"email",placeholder:"Enter your email",value:D,onChange:m=>b(m.target.value),style:l})]})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[r.jsx("label",{htmlFor:"login-password",style:{fontSize:"14px",fontWeight:500,color:a?"#ffffff":"#000000"},children:"Password"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(we,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:O}}),r.jsx("input",{id:"login-password",type:w?"text":"password",placeholder:"Enter your password",value:j,onChange:m=>q(m.target.value),style:l}),r.jsx("button",{type:"button",onClick:()=>h(!w),style:{position:"absolute",right:"14px",padding:"4px",top:"50%",transform:"translateY(-50%)",background:"transparent",border:"none",color:O,cursor:"pointer"},children:w?r.jsx(rt,{size:20}):r.jsx(nt,{size:20})})]})]}),r.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"13px"},children:[c&&r.jsx("a",{href:c,style:{color:i,textDecoration:"none",fontWeight:500},children:"Create new account"}),r.jsx("button",{type:"button",onClick:()=>k("forgot"),style:{background:"none",border:"none",color:i,fontWeight:500,cursor:"pointer"},children:"Forgot password?"})]}),r.jsx("button",{type:"submit",disabled:_,style:{padding:"12px",background:o,color:"#fff",border:"none",borderRadius:"10px",fontSize:"14px",fontWeight:600},children:_?"Signing In...":"Sign In"})]}),y==="forgot"&&r.jsxs("form",{onSubmit:T===1?L:J,style:{display:"flex",flexDirection:"column",gap:"14px"},children:[T===1?r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[r.jsx("label",{htmlFor:"forgot-email",style:{fontSize:"14px",fontWeight:500,color:a?"#ffffff":"#000000"},children:"Email Address"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(pe,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:O}}),r.jsx("input",{id:"forgot-email",type:"email",name:"email",placeholder:"Enter your email",value:I.email,onChange:H,style:l})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[r.jsx("label",{htmlFor:"otp",style:{fontSize:"14px",fontWeight:500,color:a?"#ffffff":"#000000"},children:"One-Time Password (OTP)"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(Qt,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:O}}),r.jsx("input",{id:"otp",type:"text",name:"otp",placeholder:"Enter OTP",value:I.otp,onChange:H,style:l})]})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[r.jsx("label",{htmlFor:"newPassword",style:{fontSize:"14px",fontWeight:500,color:a?"#ffffff":"#000000"},children:"New Password"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(we,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:O}}),r.jsx("input",{id:"newPassword",type:"password",name:"newPassword",placeholder:"Enter new password",value:I.newPassword,onChange:H,style:l})]})]})]}),r.jsx("button",{type:"submit",disabled:_,style:{padding:"12px",background:o,color:"#fff",border:"none",fontSize:"14px",borderRadius:"10px",fontWeight:600},children:_?"Please wait...":T===1?"Send Reset OTP":"Reset Password"}),r.jsx("button",{type:"button",onClick:()=>{k("login"),u(1)},style:{background:"none",border:"none",fontSize:"14px",color:O,marginTop:"6px",cursor:"pointer"},children:"Back to Login"})]}),g&&r.jsxs("div",{style:{marginTop:"16px",padding:"12px",borderRadius:"12px",fontSize:"14px",display:"flex",alignItems:"center",gap:"10px",backgroundColor:g.type==="success"?`${i}15`:"rgba(239,68,68,0.1)",border:g.type==="success"?`1px solid ${i}30`:"1px solid rgba(239,68,68,0.3)",color:g.type==="success"?i:"#ef4444"},children:[g.type==="success"?r.jsx(de,{size:20}):r.jsx(ie,{size:20}),r.jsx("span",{children:g.text})]}),r.jsxs("div",{style:{textAlign:"center",fontSize:"12px",color:O,marginTop:"16px",padding:"0 4px"},children:["Secure authentication powered by"," ",r.jsx("span",{style:{color:i,fontWeight:600},children:"Neuctra Authix"})]})]})})},Zn=({children:t,fallback:e=null})=>{const n=fe(),[s,i]=S.useState("loading");S.useEffect(()=>{(async()=>{if(!(document.cookie.split(";").map(p=>p.trim()).find(p=>p.startsWith("a_s_b="))?.split("=")[1]==="true")){i("unauthenticated");return}try{(await n.checkUserSession())?.user?.id?i("authenticated"):(document.cookie="a_s_b=false; path=/; max-age=0; SameSite=Lax",i("unauthenticated"))}catch(p){console.error("Session validation failed:",p),document.cookie="a_s_b=false; path=/; max-age=0; SameSite=Lax",i("unauthenticated")}})()},[n]);const o=a=>typeof a=="function"?a():a;return s==="loading"?null:s==="unauthenticated"?o(e)??null:r.jsx(r.Fragment,{children:t})},Qn=({children:t,fallback:e=null})=>{const[n,s]=S.useState(!1),[i,o]=S.useState(null);if(S.useEffect(()=>{s(!0);const d=document.cookie.split(";").map(x=>x.trim()).find(x=>x.startsWith("a_s_b="));o(d?.split("=")[1]!=="true")},[]),!n)return null;const a=c=>typeof c=="function"?c():c;return i===null?a(e)??null:i?r.jsx(r.Fragment,{children:t}):a(e)},es=({isOpen:t,onClose:e,onSuccess:n,onError:s,userId:i,colors:o})=>{const a=fe(),[c,d]=S.useState(!1),[x,p]=S.useState(""),[y,k]=S.useState("warning"),[T,u]=S.useState(!1);if(S.useEffect(()=>{if(typeof window>"u")return;const g=()=>{u(window.innerWidth<640)};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),!t)return null;const w=async()=>{d(!0),k("processing");try{const g=await a.deleteUser({userId:i});g.success?(n(g.message||"Account deleted successfully"),k("success"),setTimeout(()=>{localStorage.removeItem("userInfo"),localStorage.removeItem("userToken"),window.location.href="/"},2e3)):(s(g.message||"Failed to delete account"),k("warning"))}catch(g){s(g.response?.data?.message||"Something went wrong"),k("warning")}finally{d(!1)}},h=x.toLowerCase()==="delete my account",_=g=>{g.target===g.currentTarget&&y!=="processing"&&y!=="success"&&e()},C=()=>{switch(y){case"warning":return r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"24px",gap:"16px"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flex:1},children:[r.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #ef4444, #dc2626)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:r.jsx(Me,{size:20})}),r.jsx("div",{children:r.jsx("h3",{style:{color:o.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Delete Account"})})]}),r.jsx("button",{onClick:e,"aria-label":"Close modal",style:{background:"transparent",border:"none",color:o.textTertiary,cursor:"pointer",padding:"8px",borderRadius:"8px",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=o.border,g.currentTarget.style.color=o.textPrimary},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.color=o.textTertiary},children:r.jsx(_e,{size:20})})]}),r.jsxs("div",{style:{display:"flex",gap:"16px",padding:"20px",background:`${o.error}15`,border:`1px solid ${o.error}30`,borderRadius:"12px",marginBottom:"20px"},children:[r.jsx("div",{style:{color:o.error,flexShrink:0,display:"flex",alignItems:"flex-start"},children:r.jsx(tr,{size:24})}),r.jsxs("div",{style:{flex:1},children:[r.jsx("h4",{style:{color:o.textPrimary,margin:"0 0 12px 0",fontSize:"16px",fontWeight:600},children:"Before you proceed..."}),r.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[{icon:r.jsx(Dn,{size:16}),text:"All your data will be permanently deleted"},{icon:r.jsx(Jn,{size:16}),text:"This action cannot be reversed"},{icon:r.jsx(it,{size:16}),text:"You will lose access to all services"}].map((g,z)=>r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"14px",color:o.textSecondary},children:[r.jsx("div",{style:{color:o.error,flexShrink:0},children:g.icon}),r.jsx("span",{children:g.text})]},z))})]})]}),r.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:T?"column-reverse":"row",justifyContent:"flex-end",alignItems:"stretch"},children:[r.jsx("button",{onClick:e,style:{padding:"10px 24px",borderRadius:"10px",border:`1.5px solid ${o.border}`,background:"transparent",color:o.textPrimary,fontSize:"14px",fontWeight:500,cursor:"pointer",flex:T?"none":1,minWidth:T?"100%":"120px",transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=o.border,g.currentTarget.style.transform="translateY(-1px)"},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.transform="translateY(0)"},children:"Cancel"}),r.jsxs("button",{onClick:()=>k("confirmation"),style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",fontSize:"14px",fontWeight:600,cursor:"pointer",flex:T?"none":1,minWidth:T?"100%":"140px",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease",boxShadow:"0 4px 12px rgba(239, 68, 68, 0.4)"},onMouseOver:g=>{g.currentTarget.style.transform="translateY(-1px)",g.currentTarget.style.boxShadow="0 6px 20px rgba(239, 68, 68, 0.5)"},onMouseOut:g=>{g.currentTarget.style.transform="translateY(0)",g.currentTarget.style.boxShadow="0 4px 12px rgba(239, 68, 68, 0.4)"},children:[r.jsx(Me,{size:16}),"Continue to Delete"]})]})]});case"confirmation":return r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[r.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #f59e0b, #d97706)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:r.jsx(tr,{size:24})}),r.jsx("div",{style:{flex:1},children:r.jsx("h3",{style:{color:o.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Confirm Deletion"})})]}),r.jsxs("div",{style:{marginBottom:"24px"},children:[r.jsxs("p",{style:{color:o.textSecondary,marginBottom:"16px",fontSize:"14px",lineHeight:"1.5"},children:["Type"," ",r.jsx("strong",{style:{color:o.textPrimary},children:'"delete my account"'})," ","to confirm:"]}),r.jsx("input",{type:"text",value:x,onChange:g=>p(g.target.value),placeholder:"delete my account",style:{width:"100%",padding:"14px 16px",borderRadius:"10px",border:`2px solid ${h?o.success:o.error}`,backgroundColor:"transparent",color:o.textPrimary,fontSize:"15px",outline:"none",transition:"all 0.2s ease",boxSizing:"border-box"},onFocus:g=>{g.target.style.boxShadow=`0 0 0 3px ${o.accent}20`},onBlur:g=>{g.target.style.boxShadow="none"},autoFocus:!0}),h&&r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"10px",color:o.success,fontSize:"14px",fontWeight:500},children:[r.jsx(tt,{size:16}),r.jsx("span",{children:"Confirmation accepted"})]})]}),r.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:"column-reverse",justifyContent:"flex-end",alignItems:"stretch"},children:[r.jsx("button",{onClick:()=>{k("warning"),p("")},style:{padding:"10px 24px",borderRadius:"10px",border:`1.5px solid ${o.border}`,background:"transparent",color:o.textPrimary,fontSize:"14px",fontWeight:500,cursor:"pointer",flex:T?"none":1,minWidth:T?"100%":"120px",transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=o.border,g.currentTarget.style.transform="translateY(-1px)"},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.transform="translateY(0)"},children:"Go Back"}),r.jsxs("button",{onClick:w,disabled:!h||c,style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",fontSize:"14px",fontWeight:600,cursor:!h||c?"not-allowed":"pointer",flex:T?"none":1,minWidth:T?"100%":"140px",opacity:!h||c?.6:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease",boxShadow:!h||c?"none":"0 4px 12px rgba(239, 68, 68, 0.4)"},onMouseOver:g=>{h&&!c&&(g.currentTarget.style.transform="translateY(-1px)",g.currentTarget.style.boxShadow="0 6px 20px rgba(239, 68, 68, 0.5)")},onMouseOut:g=>{h&&!c&&(g.currentTarget.style.transform="translateY(0)",g.currentTarget.style.boxShadow="0 4px 12px rgba(239, 68, 68, 0.4)")},children:[r.jsx(Me,{size:16}),"Yes, Delete My Account"]})]})]});case"processing":return r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[r.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #6b7280, #4b5563)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:r.jsx(oe,{size:20,style:{animation:"spin 1s linear infinite"}})}),r.jsxs("div",{style:{flex:1},children:[r.jsx("h3",{style:{color:o.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Deleting Account"}),r.jsx("p",{style:{color:o.textTertiary,margin:"4px 0 0 0",fontSize:"14px",lineHeight:"1.4"},children:"Please wait while we process your request"})]})]}),r.jsx("div",{style:{marginBottom:"20px"},children:r.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[{text:"Removing your data",active:!0},{text:"Closing active sessions",active:!1},{text:"Finalizing deletion",active:!1}].map((g,z)=>r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:g.active?`${o.accent}10`:"transparent"},children:[r.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:g.active?o.accent:o.textTertiary,transition:"all 0.3s ease",boxShadow:g.active?`0 0 0 4px ${o.accent}20`:"none"}}),r.jsx("span",{style:{fontSize:"14px",color:g.active?o.textPrimary:o.textSecondary,fontWeight:g.active?500:400},children:g.text})]},z))})}),r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px",background:`${o.accent}10`,borderRadius:"10px",fontSize:"14px",color:o.textSecondary},children:[r.jsx(er,{size:18,style:{color:o.accent,flexShrink:0}}),r.jsx("span",{children:"You will be redirected to the login page shortly"})]})]});case"success":return r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[r.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #10b981, #059669)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:r.jsx(tt,{size:20})}),r.jsxs("div",{style:{flex:1},children:[r.jsx("h3",{style:{color:o.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Account Deleted"}),r.jsx("p",{style:{color:o.textTertiary,margin:"4px 0 0 0",fontSize:"14px",lineHeight:"1.4"},children:"Your account has been successfully deleted"})]})]}),r.jsxs("div",{style:{textAlign:"center",padding:"20px",background:`${o.success}10`,border:`1px solid ${o.success}20`,borderRadius:"12px",marginBottom:"24px"},children:[r.jsx(tt,{size:48,style:{color:o.success,marginBottom:"12px",display:"block",margin:"0 auto 12px auto"}}),r.jsx("p",{style:{color:o.textPrimary,fontSize:"16px",fontWeight:600,margin:"0 0 8px 0"},children:"Goodbye!"}),r.jsx("p",{style:{color:o.textSecondary,fontSize:"14px",margin:0,lineHeight:"1.5"},children:"Your account and all associated data have been permanently removed from our systems."})]}),r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px",background:`${o.accent}10`,borderRadius:"10px",fontSize:"14px",color:o.textSecondary,justifyContent:"center"},children:[r.jsx(oe,{size:16,style:{animation:"spin 1s linear infinite",color:o.accent}}),r.jsx("span",{children:"Redirecting to login page..."})]})]})}};return r.jsxs("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",zIndex:1e4,animation:"fadeIn 0.3s ease-out"},onClick:_,children:[r.jsx("div",{style:{backgroundColor:o.surface,border:`1px solid ${o.border}`,borderRadius:"20px",width:"100%",maxWidth:"480px",padding:"24px",boxShadow:"0 32px 64px rgba(0,0,0,0.4)",animation:"scaleIn 0.3s ease-out"},className:"delete-modal-container",children:C()}),r.jsx("style",{children:`
|
|
213
213
|
@keyframes fadeIn {
|
|
214
214
|
from { opacity: 0; }
|
|
215
215
|
to { opacity: 1; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserLogin.d.ts","sourceRoot":"","sources":["../../src/react/UserLogin.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAcxC,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"UserLogin.d.ts","sourceRoot":"","sources":["../../src/react/UserLogin.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAcxC,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAymBlD,CAAC"}
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare class NeuctraAuthix {
|
|
|
32
32
|
loginUser(params: LoginParams): Promise<any>;
|
|
33
33
|
/**
|
|
34
34
|
* Logout a user
|
|
35
|
-
* @desc Calls
|
|
35
|
+
* @desc Calls backend logout, clears cookie safely, reloads page (Next.js safe)
|
|
36
36
|
*/
|
|
37
37
|
logoutUser(): Promise<{
|
|
38
38
|
success: boolean;
|
package/dist/sdk/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAEhB,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,MAAM,CAAgB;IAE9B;;;OAGG;gBACS,MAAM,EAAE,mBAAmB;IAoBvC;;;;;;OAMG;YACW,OAAO;IAqCrB;;;OAGG;IACG,UAAU,CAAC,MAAM,EAAE,YAAY;IASrC;;;OAGG;IACG,SAAS,CAAC,MAAM,EAAE,WAAW;IAqBnC;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAEhB,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,MAAM,CAAgB;IAE9B;;;OAGG;gBACS,MAAM,EAAE,mBAAmB;IAoBvC;;;;;;OAMG;YACW,OAAO;IAqCrB;;;OAGG;IACG,UAAU,CAAC,MAAM,EAAE,YAAY;IASrC;;;OAGG;IACG,SAAS,CAAC,MAAM,EAAE,WAAW;IAqBnC;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAmCjD;;;OAGG;IACG,cAAc,CAAC,MAAM,EAAE,oBAAoB;IAmBjD;;;OAGG;IACG,2BAA2B,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;IAsC3E;;;OAGG;IACG,WAAW,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;IAsBxD;;;OAGG;IACG,gBAAgB,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAoBvD;;;OAGG;IACG,UAAU,CAAC,MAAM,EAAE,gBAAgB;IAazC;;;OAGG;IACG,UAAU,CAAC,MAAM,EAAE,gBAAgB;IAazC;;;OAGG;IACG,cAAc,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;IAqB/C;;;OAGG;IACG,2BAA2B,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE;IAS3D;;;OAGG;IACG,iBAAiB,CAAC,MAAM,EAAE;QAC9B,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,WAAW,EAAE,MAAM,CAAC;KACrB;IAeD;;;;OAIG;IACG,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAa7D,cAAc,CAAC,MAAM,EAAE;QAC3B,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,CAAC,CAAC,EAAE,MAAM,CAAC;KACZ;IAeD;;;;;;;;;;OAUG;IACG,oBAAoB,CAAC,MAAM,EAAE;QACjC,MAAM,EAAE,MAAM,CAAC;QACf,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB;IA4BD;;;OAGG;IACG,WAAW,CAAC,MAAM,EAAE,iBAAiB;IAa3C;;;OAGG;IACG,iBAAiB,CAAC,MAAM,EAAE,uBAAuB;IAcvD;;;OAGG;IACG,WAAW,CAAC,MAAM,EAAE,iBAAiB;IAoB3C;;;OAGG;IACG,cAAc,CAAC,MAAM,EAAE,oBAAoB;IAejD;;;OAGG;IACG,cAAc,CAAC,MAAM,EAAE,oBAAoB;IAgBjD;;;OAGG;IACG,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAe3D;;OAEG;IACG,gBAAgB,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC;IAexE;;OAEG;IACG,mBAAmB,CAAC,MAAM,EAAE;QAChC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAgB1B;;OAEG;IACG,UAAU,CAAC,MAAM,EAAE;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC3B,GAAG,OAAO,CAAC,WAAW,CAAC;IAmBxB;;OAEG;IACG,aAAa,CAAC,MAAM,EAAE;QAC1B,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC3B,GAAG,OAAO,CAAC,WAAW,CAAC;IAexB;;OAEG;IACG,aAAa,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC;CAatE"}
|
package/package.json
CHANGED
package/dist/sdk/config.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
interface SdkConfig {
|
|
2
|
-
baseUrl: string;
|
|
3
|
-
apiKey: string;
|
|
4
|
-
appId: string;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Set SDK configuration once
|
|
8
|
-
* @param config - { baseUrl, apiKey, appId }
|
|
9
|
-
*/
|
|
10
|
-
export declare const setSdkConfig: (config: Partial<SdkConfig>) => void;
|
|
11
|
-
/**
|
|
12
|
-
* Get the global SDK config
|
|
13
|
-
*/
|
|
14
|
-
export declare const getSdkConfig: () => SdkConfig;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=config.d.ts.map
|
package/dist/sdk/config.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/sdk/config.ts"],"names":[],"mappings":"AACA,UAAU,SAAS;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAQD;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,OAAO,CAAC,SAAS,CAAC,SAOtD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,QAAO,SAAsB,CAAC"}
|