@neuctra/authix 1.0.16 → 1.0.17

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.
@@ -1,4 +1,4 @@
1
- import At, { forwardRef as zt, createElement as Ge, useState as O, useEffect as ie, useRef as dt } from "react";
1
+ import zt, { forwardRef as At, createElement as Ge, useState as O, useEffect as ie, useRef as dt } from "react";
2
2
  function _t(e, t) {
3
3
  return function() {
4
4
  return e.apply(t, arguments);
@@ -16,7 +16,7 @@ function ur(e) {
16
16
  let t;
17
17
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && $t(e.buffer), t;
18
18
  }
19
- const pr = Me("string"), te = Me("function"), Ut = Me("number"), Te = (e) => e !== null && typeof e == "object", fr = (e) => e === !0 || e === !1, ze = (e) => {
19
+ const pr = Me("string"), te = Me("function"), Ut = Me("number"), Te = (e) => e !== null && typeof e == "object", fr = (e) => e === !0 || e === !1, Ae = (e) => {
20
20
  if (Le(e) !== "object")
21
21
  return !1;
22
22
  const t = st(e);
@@ -65,7 +65,7 @@ const pe = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typ
65
65
  function Ze() {
66
66
  const { caseless: e, skipUndefined: t } = Ft(this) && this || {}, r = {}, s = (o, i) => {
67
67
  const a = e && Dt(r, i) || i;
68
- ze(r[a]) && ze(o) ? r[a] = Ze(r[a], o) : ze(o) ? r[a] = Ze({}, o) : we(o) ? r[a] = o.slice() : (!t || !ye(o)) && (r[a] = o);
68
+ Ae(r[a]) && Ae(o) ? r[a] = Ze(r[a], o) : Ae(o) ? r[a] = Ze({}, o) : we(o) ? r[a] = o.slice() : (!t || !ye(o)) && (r[a] = o);
69
69
  };
70
70
  for (let o = 0, i = arguments.length; o < i; o++)
71
71
  arguments[o] && Re(arguments[o], s);
@@ -91,7 +91,7 @@ const Tr = (e, t, r, { allOwnKeys: s } = {}) => (Re(t, (o, i) => {
91
91
  e = String(e), (r === void 0 || r > e.length) && (r = e.length), r -= t.length;
92
92
  const s = e.indexOf(t, r);
93
93
  return s !== -1 && s === r;
94
- }, Ar = (e) => {
94
+ }, zr = (e) => {
95
95
  if (!e) return null;
96
96
  if (we(e)) return e;
97
97
  let t = e.length;
@@ -100,7 +100,7 @@ const Tr = (e, t, r, { allOwnKeys: s } = {}) => (Re(t, (o, i) => {
100
100
  for (; t-- > 0; )
101
101
  r[t] = e[t];
102
102
  return r;
103
- }, zr = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && st(Uint8Array)), _r = (e, t) => {
103
+ }, Ar = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && st(Uint8Array)), _r = (e, t) => {
104
104
  const s = (e && e[Fe]).call(e);
105
105
  let o;
106
106
  for (; (o = s.next()) && !o.done; ) {
@@ -187,7 +187,7 @@ const qr = (e) => {
187
187
  isNumber: Ut,
188
188
  isBoolean: fr,
189
189
  isObject: Te,
190
- isPlainObject: ze,
190
+ isPlainObject: Ae,
191
191
  isEmptyObject: xr,
192
192
  isReadableStream: vr,
193
193
  isRequest: Sr,
@@ -201,7 +201,7 @@ const qr = (e) => {
201
201
  isFunction: te,
202
202
  isStream: br,
203
203
  isURLSearchParams: jr,
204
- isTypedArray: zr,
204
+ isTypedArray: Ar,
205
205
  isFileList: yr,
206
206
  forEach: Re,
207
207
  merge: Ze,
@@ -213,7 +213,7 @@ const qr = (e) => {
213
213
  kindOf: Le,
214
214
  kindOfTest: oe,
215
215
  endsWith: Or,
216
- toArray: Ar,
216
+ toArray: zr,
217
217
  forEachEntry: _r,
218
218
  matchAll: Nr,
219
219
  isHTMLForm: $r,
@@ -336,11 +336,11 @@ function Be(e, t, r) {
336
336
  if (p.endsWith(b, "{}"))
337
337
  b = s ? b : b.slice(0, -2), d = JSON.stringify(d);
338
338
  else if (p.isArray(d) && Xr(d) || (p.isFileList(d) || p.endsWith(b, "[]")) && (L = p.toArray(d)))
339
- return b = qt(b), L.forEach(function(A, k) {
340
- !(p.isUndefined(A) || A === null) && t.append(
339
+ return b = qt(b), L.forEach(function(z, k) {
340
+ !(p.isUndefined(z) || z === null) && t.append(
341
341
  // eslint-disable-next-line no-nested-ternary
342
342
  a === !0 ? pt([b], k, i) : a === null ? b : b + "[]",
343
- c(A)
343
+ c(z)
344
344
  );
345
345
  }), !1;
346
346
  }
@@ -1034,13 +1034,13 @@ const Zt = (e) => {
1034
1034
  function L() {
1035
1035
  if (!g)
1036
1036
  return;
1037
- const A = re.from(
1037
+ const z = re.from(
1038
1038
  "getAllResponseHeaders" in g && g.getAllResponseHeaders()
1039
1039
  ), M = {
1040
1040
  data: !l || l === "text" || l === "json" ? g.responseText : g.response,
1041
1041
  status: g.status,
1042
1042
  statusText: g.statusText,
1043
- headers: A,
1043
+ headers: z,
1044
1044
  config: e,
1045
1045
  request: g
1046
1046
  };
@@ -1068,8 +1068,8 @@ const Zt = (e) => {
1068
1068
  )), g = null;
1069
1069
  }, i === void 0 && a.setContentType(null), "setRequestHeader" in g && p.forEach(a.toJSON(), function(k, M) {
1070
1070
  g.setRequestHeader(M, k);
1071
- }), p.isUndefined(o.withCredentials) || (g.withCredentials = !!o.withCredentials), l && l !== "json" && (g.responseType = o.responseType), c && ([T, d] = De(c, !0), g.addEventListener("progress", T)), h && g.upload && ([y, S] = De(h), g.upload.addEventListener("progress", y), g.upload.addEventListener("loadend", S)), (o.cancelToken || o.signal) && (u = (A) => {
1072
- g && (s(!A || A.type ? new je(null, e, g) : A), g.abort(), g = null);
1071
+ }), p.isUndefined(o.withCredentials) || (g.withCredentials = !!o.withCredentials), l && l !== "json" && (g.responseType = o.responseType), c && ([T, d] = De(c, !0), g.addEventListener("progress", T)), h && g.upload && ([y, S] = De(h), g.upload.addEventListener("progress", y), g.upload.addEventListener("loadend", S)), (o.cancelToken || o.signal) && (u = (z) => {
1072
+ g && (s(!z || z.type ? new je(null, e, g) : z), g.abort(), g = null);
1073
1073
  }, o.cancelToken && o.cancelToken.subscribe(u), o.signal && (o.signal.aborted ? u() : o.signal.addEventListener("abort", u)));
1074
1074
  const $ = yn(o.url);
1075
1075
  if ($ && ee.protocols.indexOf($) === -1) {
@@ -1170,7 +1170,7 @@ const Zt = (e) => {
1170
1170
  } catch {
1171
1171
  return !1;
1172
1172
  }
1173
- }, An = (e) => {
1173
+ }, zn = (e) => {
1174
1174
  e = p.merge.call({
1175
1175
  skipUndefined: !0
1176
1176
  }, On, e);
@@ -1222,7 +1222,7 @@ const Zt = (e) => {
1222
1222
  method: g,
1223
1223
  data: L,
1224
1224
  signal: $,
1225
- cancelToken: A,
1225
+ cancelToken: z,
1226
1226
  timeout: k,
1227
1227
  onDownloadProgress: M,
1228
1228
  onUploadProgress: m,
@@ -1232,7 +1232,7 @@ const Zt = (e) => {
1232
1232
  fetchOptions: K
1233
1233
  } = Zt(d), F = t || fetch;
1234
1234
  N = N ? (N + "").toLowerCase() : "text";
1235
- let V = Tn([$, A && A.toAbortSignal()], k), Z = null;
1235
+ let V = Tn([$, z && z.toAbortSignal()], k), Z = null;
1236
1236
  const E = V && V.unsubscribe && (() => {
1237
1237
  V.unsubscribe();
1238
1238
  });
@@ -1253,7 +1253,7 @@ const Zt = (e) => {
1253
1253
  }
1254
1254
  }
1255
1255
  p.isString(D) || (D = D ? "include" : "omit");
1256
- const q = i && "credentials" in r.prototype, z = {
1256
+ const q = i && "credentials" in r.prototype, A = {
1257
1257
  ...K,
1258
1258
  signal: V,
1259
1259
  method: g.toUpperCase(),
@@ -1262,8 +1262,8 @@ const Zt = (e) => {
1262
1262
  duplex: "half",
1263
1263
  credentials: q ? D : void 0
1264
1264
  };
1265
- Z = i && new r(b, z);
1266
- let R = await (i ? F(Z, K) : F(b, z));
1265
+ Z = i && new r(b, A);
1266
+ let R = await (i ? F(Z, K) : F(b, A));
1267
1267
  const Y = u && (N === "stream" || N === "response");
1268
1268
  if (u && (M || Y && E)) {
1269
1269
  const C = {};
@@ -1302,16 +1302,16 @@ const Zt = (e) => {
1302
1302
  ) : U.from(q, q && q.code, d, Z);
1303
1303
  }
1304
1304
  };
1305
- }, zn = /* @__PURE__ */ new Map(), Qt = (e) => {
1305
+ }, An = /* @__PURE__ */ new Map(), Qt = (e) => {
1306
1306
  let t = e ? e.env : {};
1307
1307
  const { fetch: r, Request: s, Response: o } = t, i = [
1308
1308
  s,
1309
1309
  o,
1310
1310
  r
1311
1311
  ];
1312
- let a = i.length, l = a, h, c, u = zn;
1312
+ let a = i.length, l = a, h, c, u = An;
1313
1313
  for (; l--; )
1314
- h = i[l], c = u.get(h), c === void 0 && u.set(h, c = l ? /* @__PURE__ */ new Map() : An(t)), u = c;
1314
+ h = i[l], c = u.get(h), c === void 0 && u.set(h, c = l ? /* @__PURE__ */ new Map() : zn(t)), u = c;
1315
1315
  return c;
1316
1316
  };
1317
1317
  Qt();
@@ -1773,36 +1773,47 @@ class co {
1773
1773
  });
1774
1774
  }
1775
1775
  /**
1776
- * Universal request helper with error handling
1777
- * @param method HTTP method (GET, POST, PUT, DELETE)
1778
- * @param path API endpoint path
1779
- * @param data optional request body
1780
- * @param extraHeaders optional headers
1781
- */
1776
+ * 🌐 Universal request helper with structured responses and error handling
1777
+ * @param method HTTP method (GET, POST, PUT, DELETE)
1778
+ * @param path API endpoint path
1779
+ * @param data optional request body
1780
+ * @param extraHeaders optional headers
1781
+ */
1782
1782
  async request(t, r, s, o = {}) {
1783
- if (!t) throw new Error("HTTP method is required");
1784
- if (!r) throw new Error("Request path is required");
1783
+ if (!t) return { success: !1, message: "HTTP method is required" };
1784
+ if (!r) return { success: !1, message: "Request path is required" };
1785
1785
  try {
1786
1786
  const i = {
1787
1787
  ...this.appId ? { appId: this.appId } : {},
1788
1788
  ...s || {}
1789
1789
  };
1790
- return (await this.client.request({
1791
- url: r,
1792
- method: t,
1793
- data: i,
1794
- headers: o
1795
- })).data;
1790
+ return {
1791
+ success: !0,
1792
+ data: (await this.client.request({
1793
+ url: r,
1794
+ method: t,
1795
+ data: i,
1796
+ headers: o
1797
+ })).data,
1798
+ message: "✅ Request completed successfully"
1799
+ };
1796
1800
  } catch (i) {
1797
- if (i.isAxiosError && !i.response)
1798
- throw new Error(`Network error: ${i.message}`);
1801
+ if (console.error("❌ [Request Error]:", i), i.isAxiosError && !i.response)
1802
+ return {
1803
+ success: !1,
1804
+ message: `🌐 Network error: ${i.message}`
1805
+ };
1799
1806
  if (i.response) {
1800
- const a = i.response.status, l = i.response.data?.message || i.response.statusText;
1801
- throw new Error(`API Error (${a}): ${l}`);
1807
+ const a = i.response.status, l = i.response.data?.message || i.response.statusText || "Server returned an error";
1808
+ return {
1809
+ success: !1,
1810
+ message: `⚠️ Request failed (${a}): ${l}`
1811
+ };
1802
1812
  }
1803
- throw new Error(
1804
- i.message || "Unknown error occurred during API request"
1805
- );
1813
+ return {
1814
+ success: !1,
1815
+ message: `🚨 Unexpected error: ${i.message || "Something went wrong"}`
1816
+ };
1806
1817
  }
1807
1818
  }
1808
1819
  // ================= USERS =================
@@ -1995,7 +2006,7 @@ class co {
1995
2006
  return this.request("DELETE", `/users/${r}/data/${s}`);
1996
2007
  }
1997
2008
  }
1998
- var Ae = { exports: {} }, ke = {};
2009
+ var ze = { exports: {} }, ke = {};
1999
2010
  /**
2000
2011
  * @license React
2001
2012
  * react-jsx-runtime.production.js
@@ -2065,7 +2076,7 @@ function Ln() {
2065
2076
  ), f.$$typeof) {
2066
2077
  case d:
2067
2078
  return "Portal";
2068
- case A:
2079
+ case z:
2069
2080
  return (f.displayName || "Context") + ".Provider";
2070
2081
  case $:
2071
2082
  return (f._context.displayName || "Context") + ".Consumer";
@@ -2231,7 +2242,7 @@ React keys must be passed directly to JSX without using spread:
2231
2242
  function y(f) {
2232
2243
  typeof f == "object" && f !== null && f.$$typeof === S && f._store && (f._store.validated = 1);
2233
2244
  }
2234
- var T = At, S = Symbol.for("react.transitional.element"), d = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), L = Symbol.for("react.profiler"), $ = Symbol.for("react.consumer"), A = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), N = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), K = Symbol.for("react.client.reference"), F = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, Z = Array.isArray, E = console.createTask ? console.createTask : function() {
2245
+ var T = zt, S = Symbol.for("react.transitional.element"), d = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), L = Symbol.for("react.profiler"), $ = Symbol.for("react.consumer"), z = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), N = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), K = Symbol.for("react.client.reference"), F = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, Z = Array.isArray, E = console.createTask ? console.createTask : function() {
2235
2246
  return null;
2236
2247
  };
2237
2248
  T = {
@@ -2239,7 +2250,7 @@ React keys must be passed directly to JSX without using spread:
2239
2250
  return f();
2240
2251
  }
2241
2252
  };
2242
- var J, q = {}, z = T.react_stack_bottom_frame.bind(
2253
+ var J, q = {}, A = T.react_stack_bottom_frame.bind(
2243
2254
  T,
2244
2255
  i
2245
2256
  )(), R = E(s(i)), Y = {};
@@ -2252,7 +2263,7 @@ React keys must be passed directly to JSX without using spread:
2252
2263
  !1,
2253
2264
  P,
2254
2265
  x,
2255
- j ? Error("react-stack-top-frame") : z,
2266
+ j ? Error("react-stack-top-frame") : A,
2256
2267
  j ? E(s(f)) : R
2257
2268
  );
2258
2269
  }, Ee.jsxs = function(f, C, _, P, x) {
@@ -2264,7 +2275,7 @@ React keys must be passed directly to JSX without using spread:
2264
2275
  !0,
2265
2276
  P,
2266
2277
  x,
2267
- j ? Error("react-stack-top-frame") : z,
2278
+ j ? Error("react-stack-top-frame") : A,
2268
2279
  j ? E(s(f)) : R
2269
2280
  );
2270
2281
  };
@@ -2272,7 +2283,7 @@ React keys must be passed directly to JSX without using spread:
2272
2283
  }
2273
2284
  var It;
2274
2285
  function Mn() {
2275
- return It || (It = 1, process.env.NODE_ENV === "production" ? Ae.exports = Fn() : Ae.exports = Ln()), Ae.exports;
2286
+ return It || (It = 1, process.env.NODE_ENV === "production" ? ze.exports = Fn() : ze.exports = Ln()), ze.exports;
2276
2287
  }
2277
2288
  var n = Mn();
2278
2289
  const Bn = async (e, t) => {
@@ -2370,7 +2381,7 @@ var Vn = {
2370
2381
  * This source code is licensed under the ISC license.
2371
2382
  * See the LICENSE file in the root directory of this source tree.
2372
2383
  */
2373
- const Yn = zt(
2384
+ const Yn = At(
2374
2385
  ({
2375
2386
  color: e = "currentColor",
2376
2387
  size: t = 24,
@@ -2406,7 +2417,7 @@ const Yn = zt(
2406
2417
  * See the LICENSE file in the root directory of this source tree.
2407
2418
  */
2408
2419
  const W = (e, t) => {
2409
- const r = zt(
2420
+ const r = At(
2410
2421
  ({ className: s, ...o }, i) => Ge(Yn, {
2411
2422
  ref: i,
2412
2423
  iconNode: t,
@@ -2785,7 +2796,7 @@ const Os = [
2785
2796
  * This source code is licensed under the ISC license.
2786
2797
  * See the LICENSE file in the root directory of this source tree.
2787
2798
  */
2788
- const As = [
2799
+ const zs = [
2789
2800
  [
2790
2801
  "path",
2791
2802
  {
@@ -2795,19 +2806,19 @@ const As = [
2795
2806
  ],
2796
2807
  ["path", { d: "M12 9v4", key: "juzpu7" }],
2797
2808
  ["path", { d: "M12 17h.01", key: "p32p05" }]
2798
- ], Ot = W("triangle-alert", As);
2809
+ ], Ot = W("triangle-alert", zs);
2799
2810
  /**
2800
2811
  * @license lucide-react v0.544.0 - ISC
2801
2812
  *
2802
2813
  * This source code is licensed under the ISC license.
2803
2814
  * See the LICENSE file in the root directory of this source tree.
2804
2815
  */
2805
- const zs = [
2816
+ const As = [
2806
2817
  ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
2807
2818
  ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
2808
2819
  ["line", { x1: "17", x2: "22", y1: "8", y2: "13", key: "3nzzx3" }],
2809
2820
  ["line", { x1: "22", x2: "17", y1: "8", y2: "13", key: "1swrse" }]
2810
- ], _s = W("user-x", zs);
2821
+ ], _s = W("user-x", As);
2811
2822
  /**
2812
2823
  * @license lucide-react v0.544.0 - ISC
2813
2824
  *
@@ -2855,13 +2866,13 @@ const $s = [
2855
2866
  email: "",
2856
2867
  password: "",
2857
2868
  ...h && { avatarUrl: "" }
2858
- }, [g, L] = O(b), [$, A] = O(!1), [k, M] = O(!1), [m, N] = O(null), [w, D] = O({}), K = typeof window < "u" ? window.innerWidth < 768 : !1, F = l ? "#ffffff" : "#111827", V = l ? "#a1a1aa" : "#6b7280", Z = l ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", E = l ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)", J = (Y) => {
2869
+ }, [g, L] = O(b), [$, z] = O(!1), [k, M] = O(!1), [m, N] = O(null), [w, D] = O({}), K = typeof window < "u" ? window.innerWidth < 768 : !1, F = l ? "#ffffff" : "#111827", V = l ? "#a1a1aa" : "#6b7280", Z = l ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", E = l ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)", J = (Y) => {
2859
2870
  const { name: f, value: C } = Y.target;
2860
2871
  L((_) => ({ ..._, [f]: C })), w[f] && D((_) => ({ ..._, [f]: void 0 }));
2861
2872
  }, q = () => {
2862
2873
  const Y = {};
2863
2874
  return g.name.trim() || (Y.name = "Name is required"), g.email.trim() ? /\S+@\S+\.\S+/.test(g.email) || (Y.email = "Invalid email address") : Y.email = "Email is required", g.password ? g.password.length < 6 && (Y.password = "Password must be at least 6 characters") : Y.password = "Password is required", D(Y), Object.keys(Y).length === 0;
2864
- }, z = async (Y) => {
2875
+ }, A = async (Y) => {
2865
2876
  if (Y.preventDefault(), !!q()) {
2866
2877
  M(!0), N(null);
2867
2878
  try {
@@ -2994,7 +3005,7 @@ const $s = [
2994
3005
  /* @__PURE__ */ n.jsxs(
2995
3006
  "form",
2996
3007
  {
2997
- onSubmit: z,
3008
+ onSubmit: A,
2998
3009
  style: { display: "flex", flexDirection: "column", gap: "14px" },
2999
3010
  children: [
3000
3011
  /* @__PURE__ */ n.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
@@ -3153,7 +3164,7 @@ const $s = [
3153
3164
  "button",
3154
3165
  {
3155
3166
  type: "button",
3156
- onClick: () => A(!$),
3167
+ onClick: () => z(!$),
3157
3168
  style: {
3158
3169
  position: "absolute",
3159
3170
  right: "14px",
@@ -3371,12 +3382,12 @@ const $s = [
3371
3382
  onSuccess: c,
3372
3383
  onError: u
3373
3384
  }) => {
3374
- const { baseUrl: y, apiKey: T, appId: S } = ve(), [d, b] = O("login"), [g, L] = O(1), [$, A] = O(!1), [k, M] = O(!1), [m, N] = O(null), [w, D] = O(""), [K, F] = O(""), [V, Z] = O({
3385
+ const { baseUrl: y, apiKey: T, appId: S } = ve(), [d, b] = O("login"), [g, L] = O(1), [$, z] = O(!1), [k, M] = O(!1), [m, N] = O(null), [w, D] = O(""), [K, F] = O(""), [V, Z] = O({
3375
3386
  email: "",
3376
3387
  otp: "",
3377
3388
  newPassword: "",
3378
3389
  appId: S
3379
- }), E = window.innerWidth < 768, J = l ? "#ffffff" : "#111827", q = l ? "#a1a1aa" : "#6b7280", z = l ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", R = l ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)", Y = async (x) => {
3390
+ }), E = window.innerWidth < 768, J = l ? "#ffffff" : "#111827", q = l ? "#a1a1aa" : "#6b7280", A = l ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", R = l ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)", Y = async (x) => {
3380
3391
  x.preventDefault(), M(!0), N(null);
3381
3392
  try {
3382
3393
  const j = await Us(
@@ -3435,7 +3446,7 @@ const $s = [
3435
3446
  }, P = {
3436
3447
  width: "100%",
3437
3448
  padding: E ? "10px 14px 10px 44px" : "10px 16px 10px 44px",
3438
- backgroundColor: z,
3449
+ backgroundColor: A,
3439
3450
  border: `1px solid ${R}`,
3440
3451
  borderRadius: "10px",
3441
3452
  color: J,
@@ -3614,7 +3625,7 @@ const $s = [
3614
3625
  "button",
3615
3626
  {
3616
3627
  type: "button",
3617
- onClick: () => A(!$),
3628
+ onClick: () => z(!$),
3618
3629
  style: {
3619
3630
  position: "absolute",
3620
3631
  right: "14px",
@@ -4006,7 +4017,7 @@ const $s = [
4006
4017
  } finally {
4007
4018
  y(!1);
4008
4019
  }
4009
- }, A = T.toLowerCase() === "delete my account", k = (m) => {
4020
+ }, z = T.toLowerCase() === "delete my account", k = (m) => {
4010
4021
  m.target === m.currentTarget && d !== "processing" && d !== "success" && t();
4011
4022
  }, M = () => {
4012
4023
  switch (d) {
@@ -4330,7 +4341,7 @@ const $s = [
4330
4341
  width: "100%",
4331
4342
  padding: "14px 16px",
4332
4343
  borderRadius: "10px",
4333
- border: `2px solid ${A ? a.success : a.error}`,
4344
+ border: `2px solid ${z ? a.success : a.error}`,
4334
4345
  backgroundColor: "transparent",
4335
4346
  color: a.textPrimary,
4336
4347
  fontSize: "15px",
@@ -4347,7 +4358,7 @@ const $s = [
4347
4358
  autoFocus: !0
4348
4359
  }
4349
4360
  ),
4350
- A && /* @__PURE__ */ n.jsxs(
4361
+ z && /* @__PURE__ */ n.jsxs(
4351
4362
  "div",
4352
4363
  {
4353
4364
  style: {
@@ -4409,7 +4420,7 @@ const $s = [
4409
4420
  "button",
4410
4421
  {
4411
4422
  onClick: $,
4412
- disabled: !A || u,
4423
+ disabled: !z || u,
4413
4424
  style: {
4414
4425
  padding: "10px 24px",
4415
4426
  borderRadius: "10px",
@@ -4418,22 +4429,22 @@ const $s = [
4418
4429
  color: "white",
4419
4430
  fontSize: "14px",
4420
4431
  fontWeight: 600,
4421
- cursor: !A || u ? "not-allowed" : "pointer",
4432
+ cursor: !z || u ? "not-allowed" : "pointer",
4422
4433
  flex: g ? "none" : 1,
4423
4434
  minWidth: g ? "100%" : "140px",
4424
- opacity: !A || u ? 0.6 : 1,
4435
+ opacity: !z || u ? 0.6 : 1,
4425
4436
  display: "flex",
4426
4437
  alignItems: "center",
4427
4438
  justifyContent: "center",
4428
4439
  gap: "8px",
4429
4440
  transition: "all 0.2s ease",
4430
- boxShadow: !A || u ? "none" : "0 4px 12px rgba(239, 68, 68, 0.4)"
4441
+ boxShadow: !z || u ? "none" : "0 4px 12px rgba(239, 68, 68, 0.4)"
4431
4442
  },
4432
4443
  onMouseOver: (m) => {
4433
- A && !u && (m.currentTarget.style.transform = "translateY(-1px)", m.currentTarget.style.boxShadow = "0 6px 20px rgba(239, 68, 68, 0.5)");
4444
+ z && !u && (m.currentTarget.style.transform = "translateY(-1px)", m.currentTarget.style.boxShadow = "0 6px 20px rgba(239, 68, 68, 0.5)");
4434
4445
  },
4435
4446
  onMouseOut: (m) => {
4436
- A && !u && (m.currentTarget.style.transform = "translateY(0)", m.currentTarget.style.boxShadow = "0 4px 12px rgba(239, 68, 68, 0.4)");
4447
+ z && !u && (m.currentTarget.style.transform = "translateY(0)", m.currentTarget.style.boxShadow = "0 4px 12px rgba(239, 68, 68, 0.4)");
4437
4448
  },
4438
4449
  children: [
4439
4450
  /* @__PURE__ */ n.jsx($e, { size: 16 }),
@@ -5295,13 +5306,13 @@ const $s = [
5295
5306
  newPassword: !1,
5296
5307
  confirmPassword: !1
5297
5308
  }), [L, $] = O(!1);
5298
- if (At.useEffect(() => {
5309
+ if (zt.useEffect(() => {
5299
5310
  const w = () => {
5300
5311
  $(window.innerWidth < 640);
5301
5312
  };
5302
5313
  return w(), window.addEventListener("resize", w), () => window.removeEventListener("resize", w);
5303
5314
  }, []), !e) return null;
5304
- const A = (w) => {
5315
+ const z = (w) => {
5305
5316
  const { name: D, value: K } = w.target;
5306
5317
  u((F) => ({ ...F, [D]: K })), y[D] && T((F) => ({ ...F, [D]: "" }));
5307
5318
  }, k = (w) => {
@@ -5516,7 +5527,7 @@ const $s = [
5516
5527
  name: w,
5517
5528
  placeholder: `Enter ${D.toLowerCase()}`,
5518
5529
  value: c[w],
5519
- onChange: A,
5530
+ onChange: z,
5520
5531
  style: {
5521
5532
  width: "100%",
5522
5533
  padding: "14px 48px 14px 44px",
@@ -6013,7 +6024,7 @@ const $s = [
6013
6024
  onLogout: o,
6014
6025
  primaryColor: i = "#00C212"
6015
6026
  }) => {
6016
- const { baseUrl: a, apiKey: l, appId: h } = ve(), [c, u] = O(t), [y, T] = O(!0), [S, d] = O(!1), [b, g] = O(!1), [L, $] = O(!1), [A, k] = O(!1), [M, m] = O(!1), [N, w] = O(!1), [D, K] = O(!1), [F, V] = O(!1), [Z, E] = O(null), [J, q] = O(!1), [z, R] = O({
6027
+ const { baseUrl: a, apiKey: l, appId: h } = ve(), [c, u] = O(t), [y, T] = O(!0), [S, d] = O(!1), [b, g] = O(!1), [L, $] = O(!1), [z, k] = O(!1), [M, m] = O(!1), [N, w] = O(!1), [D, K] = O(!1), [F, V] = O(!1), [Z, E] = O(null), [J, q] = O(!1), [A, R] = O({
6017
6028
  email: "",
6018
6029
  otp: "",
6019
6030
  appId: h
@@ -6036,7 +6047,7 @@ const $s = [
6036
6047
  };
6037
6048
  }, [D]);
6038
6049
  const j = async () => {
6039
- if (!z.email || !/\S+@\S+\.\S+/.test(z.email)) {
6050
+ if (!A.email || !/\S+@\S+\.\S+/.test(A.email)) {
6040
6051
  P("error", "Please enter a valid email");
6041
6052
  return;
6042
6053
  }
@@ -6044,7 +6055,7 @@ const $s = [
6044
6055
  _(!0);
6045
6056
  const v = await B.post(
6046
6057
  `${a}/users/send-verify-otp/${c?.id}`,
6047
- { email: z.email },
6058
+ { email: A.email },
6048
6059
  {
6049
6060
  headers: { "x-api-key": l, "x-app-id": h }
6050
6061
  }
@@ -6056,7 +6067,7 @@ const $s = [
6056
6067
  _(!1);
6057
6068
  }
6058
6069
  }, X = async (v) => {
6059
- if (v.preventDefault(), !z.email || !z.otp) {
6070
+ if (v.preventDefault(), !A.email || !A.otp) {
6060
6071
  P("error", "Please fill in all fields");
6061
6072
  return;
6062
6073
  }
@@ -6064,7 +6075,7 @@ const $s = [
6064
6075
  _(!0);
6065
6076
  const H = await B.post(
6066
6077
  `${a}/users/verify-email`,
6067
- z
6078
+ A
6068
6079
  );
6069
6080
  if (H.data.success) {
6070
6081
  if (P("success", H.data.message || "Email verified!"), c) {
@@ -7084,7 +7095,7 @@ const $s = [
7084
7095
  apiKey: l,
7085
7096
  appId: h,
7086
7097
  userId: c.id,
7087
- isOpen: A,
7098
+ isOpen: z,
7088
7099
  onClose: () => k(!1),
7089
7100
  onSuccess: (v) => P("success", v),
7090
7101
  onError: (v) => P("error", v),
@@ -7115,7 +7126,7 @@ const $s = [
7115
7126
  },
7116
7127
  onVerify: X,
7117
7128
  onSendOTP: j,
7118
- verifyFormData: z,
7129
+ verifyFormData: A,
7119
7130
  setVerifyFormData: R,
7120
7131
  otpSent: Y,
7121
7132
  verifying: C,
@@ -7236,7 +7247,7 @@ const $s = [
7236
7247
  viewProfileLabel: S = "View Profile",
7237
7248
  logoutLabel: d = "Sign Out"
7238
7249
  }) => {
7239
- const { baseUrl: b, apiKey: g, appId: L } = ve(), [$, A] = O(!1), [k, M] = O(null), [m, N] = O(!0), [w, D] = O(null), K = dt(null), F = dt(null), [V, Z] = O(!1), [E, J] = O(!1);
7250
+ const { baseUrl: b, apiKey: g, appId: L } = ve(), [$, z] = O(!1), [k, M] = O(null), [m, N] = O(!0), [w, D] = O(null), K = dt(null), F = dt(null), [V, Z] = O(!1), [E, J] = O(!1);
7240
7251
  ie(() => {
7241
7252
  const x = () => {
7242
7253
  J(window.innerWidth < 768);
@@ -7297,17 +7308,17 @@ const $s = [
7297
7308
  return x(), window.addEventListener("resize", x), () => window.removeEventListener("resize", x);
7298
7309
  }, [$]), ie(() => {
7299
7310
  const x = (ne) => {
7300
- K.current && !K.current.contains(ne.target) && !F.current?.contains(ne.target) && A(!1);
7311
+ K.current && !K.current.contains(ne.target) && !F.current?.contains(ne.target) && z(!1);
7301
7312
  }, j = (ne) => {
7302
- ne.key === "Escape" && A(!1);
7313
+ ne.key === "Escape" && z(!1);
7303
7314
  }, X = () => {
7304
- $ && A(!1);
7315
+ $ && z(!1);
7305
7316
  };
7306
7317
  return $ && (document.addEventListener("mousedown", x), document.addEventListener("keydown", j), window.addEventListener("scroll", X, { passive: !0 })), () => {
7307
7318
  document.removeEventListener("mousedown", x), document.removeEventListener("keydown", j), window.removeEventListener("scroll", X);
7308
7319
  };
7309
7320
  }, [$]);
7310
- const z = e ? {
7321
+ const A = e ? {
7311
7322
  surface: "#000000",
7312
7323
  surfaceElevated: "#000000",
7313
7324
  surfaceHover: "#262626",
@@ -7342,7 +7353,7 @@ const $s = [
7342
7353
  gap: E ? "6px" : "8px",
7343
7354
  padding: E ? "6px 10px 6px 6px" : "8px 12px 8px 8px",
7344
7355
  borderRadius: "24px",
7345
- backgroundColor: z.surface,
7356
+ backgroundColor: A.surface,
7346
7357
  cursor: "pointer",
7347
7358
  transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
7348
7359
  minWidth: E ? "auto" : "140px",
@@ -7354,7 +7365,7 @@ const $s = [
7354
7365
  height: E ? "28px" : "32px",
7355
7366
  borderRadius: "50%",
7356
7367
  objectFit: "cover",
7357
- border: `2px solid ${z.borderLight}`,
7368
+ border: `2px solid ${A.borderLight}`,
7358
7369
  flexShrink: 0
7359
7370
  },
7360
7371
  userInfo: {
@@ -7368,7 +7379,7 @@ const $s = [
7368
7379
  userName: {
7369
7380
  fontSize: E ? "13px" : "14px",
7370
7381
  fontWeight: 600,
7371
- color: z.textPrimary,
7382
+ color: A.textPrimary,
7372
7383
  lineHeight: "1.2",
7373
7384
  whiteSpace: "nowrap",
7374
7385
  overflow: "hidden",
@@ -7377,7 +7388,7 @@ const $s = [
7377
7388
  },
7378
7389
  userEmail: {
7379
7390
  fontSize: E ? "11px" : "12px",
7380
- color: z.textTertiary,
7391
+ color: A.textTertiary,
7381
7392
  lineHeight: "1.2",
7382
7393
  whiteSpace: "nowrap",
7383
7394
  overflow: "hidden",
@@ -7387,7 +7398,7 @@ const $s = [
7387
7398
  chevron: {
7388
7399
  transition: "transform 0.2s ease",
7389
7400
  transform: $ ? "rotate(180deg)" : "rotate(0deg)",
7390
- color: z.textTertiary,
7401
+ color: A.textTertiary,
7391
7402
  flexShrink: 0
7392
7403
  },
7393
7404
  dropdown: {
@@ -7395,8 +7406,8 @@ const $s = [
7395
7406
  top: "100%",
7396
7407
  marginTop: "8px",
7397
7408
  [V ? "left" : "right"]: "0",
7398
- backgroundColor: z.surfaceElevated,
7399
- border: `1px solid ${z.border}`,
7409
+ backgroundColor: A.surfaceElevated,
7410
+ border: `1px solid ${A.border}`,
7400
7411
  borderRadius: "12px",
7401
7412
  boxShadow: "0 20px 40px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.1)",
7402
7413
  width: "min(280px, 90vw)",
@@ -7427,7 +7438,7 @@ const $s = [
7427
7438
  height: E ? "40px" : "48px",
7428
7439
  borderRadius: "50%",
7429
7440
  objectFit: "cover",
7430
- border: `2px solid ${z.borderLight}`,
7441
+ border: `2px solid ${A.borderLight}`,
7431
7442
  flexShrink: 0
7432
7443
  },
7433
7444
  dropdownUserInfo: {
@@ -7439,7 +7450,7 @@ const $s = [
7439
7450
  dropdownUserName: {
7440
7451
  fontSize: E ? "15px" : "16px",
7441
7452
  fontWeight: 600,
7442
- color: z.textPrimary,
7453
+ color: A.textPrimary,
7443
7454
  lineHeight: "1.2",
7444
7455
  marginBottom: "2px",
7445
7456
  overflow: "hidden",
@@ -7447,7 +7458,7 @@ const $s = [
7447
7458
  },
7448
7459
  dropdownUserEmail: {
7449
7460
  fontSize: E ? "13px" : "14px",
7450
- color: z.textSecondary,
7461
+ color: A.textSecondary,
7451
7462
  lineHeight: "1.2",
7452
7463
  overflow: "hidden",
7453
7464
  textOverflow: "ellipsis"
@@ -7460,7 +7471,7 @@ const $s = [
7460
7471
  borderRadius: "8px",
7461
7472
  cursor: "pointer",
7462
7473
  transition: "all 0.15s ease",
7463
- color: z.textPrimary,
7474
+ color: A.textPrimary,
7464
7475
  textDecoration: "none",
7465
7476
  border: "none",
7466
7477
  background: "none",
@@ -7475,7 +7486,7 @@ const $s = [
7475
7486
  icon: {
7476
7487
  width: E ? "16px" : "18px",
7477
7488
  height: E ? "16px" : "18px",
7478
- color: z.textSecondary,
7489
+ color: A.textSecondary,
7479
7490
  flexShrink: 0
7480
7491
  },
7481
7492
  logoutButton: {
@@ -7490,20 +7501,20 @@ const $s = [
7490
7501
  border: "none",
7491
7502
  width: "100%",
7492
7503
  fontSize: E ? "13px" : "14px",
7493
- color: z.error,
7504
+ color: A.error,
7494
7505
  textAlign: "left",
7495
7506
  outline: "none"
7496
7507
  },
7497
7508
  loadingText: {
7498
7509
  padding: E ? "16px 12px" : "20px 16px",
7499
7510
  textAlign: "center",
7500
- color: z.textSecondary,
7511
+ color: A.textSecondary,
7501
7512
  fontSize: E ? "13px" : "14px"
7502
7513
  },
7503
7514
  errorState: {
7504
7515
  padding: E ? "16px 12px" : "20px 16px",
7505
7516
  textAlign: "center",
7506
- color: z.textSecondary,
7517
+ color: A.textSecondary,
7507
7518
  fontSize: E ? "13px" : "14px",
7508
7519
  display: "flex",
7509
7520
  alignItems: "center",
@@ -7514,7 +7525,7 @@ const $s = [
7514
7525
  retryButton: {
7515
7526
  marginTop: "8px",
7516
7527
  padding: "8px 16px",
7517
- backgroundColor: z.accent,
7528
+ backgroundColor: A.accent,
7518
7529
  color: "#ffffff",
7519
7530
  border: "none",
7520
7531
  borderRadius: "6px",
@@ -7555,8 +7566,8 @@ const $s = [
7555
7566
  "div",
7556
7567
  {
7557
7568
  ref: F,
7558
- onClick: () => A((x) => !x),
7559
- onKeyDown: (x) => f(x, () => A((j) => !j)),
7569
+ onClick: () => z((x) => !x),
7570
+ onKeyDown: (x) => f(x, () => z((j) => !j)),
7560
7571
  tabIndex: 0,
7561
7572
  role: "button",
7562
7573
  "aria-haspopup": "true",
@@ -7572,7 +7583,7 @@ const $s = [
7572
7583
  height: E ? "34px" : "40px",
7573
7584
  borderRadius: "50%",
7574
7585
  objectFit: "cover",
7575
- border: `2px solid ${z.borderLight}`,
7586
+ border: `2px solid ${A.borderLight}`,
7576
7587
  flexShrink: 0
7577
7588
  },
7578
7589
  loading: "lazy",
@@ -7595,7 +7606,7 @@ const $s = [
7595
7606
  height: E ? "34px" : "40px",
7596
7607
  borderRadius: "50%",
7597
7608
  objectFit: "cover",
7598
- border: `2px solid ${z.borderLight}`,
7609
+ border: `2px solid ${A.borderLight}`,
7599
7610
  flexShrink: 0
7600
7611
  },
7601
7612
  loading: "lazy"
@@ -7607,18 +7618,18 @@ const $s = [
7607
7618
  {
7608
7619
  ref: F,
7609
7620
  style: R.avatarButton,
7610
- onClick: () => A((x) => !x),
7611
- onKeyDown: (x) => f(x, () => A((j) => !j)),
7621
+ onClick: () => z((x) => !x),
7622
+ onKeyDown: (x) => f(x, () => z((j) => !j)),
7612
7623
  tabIndex: 0,
7613
7624
  role: "button",
7614
7625
  "aria-haspopup": "true",
7615
7626
  "aria-expanded": $,
7616
7627
  "aria-label": "Toggle user menu",
7617
7628
  onMouseOver: (x) => {
7618
- x.currentTarget.style.backgroundColor = z.surfaceHover, x.currentTarget.style.boxShadow = "0 4px 12px rgba(0,0,0,0.15)";
7629
+ x.currentTarget.style.backgroundColor = A.surfaceHover, x.currentTarget.style.boxShadow = "0 4px 12px rgba(0,0,0,0.15)";
7619
7630
  },
7620
7631
  onMouseOut: (x) => {
7621
- x.currentTarget.style.backgroundColor = z.surface, x.currentTarget.style.boxShadow = "none";
7632
+ x.currentTarget.style.backgroundColor = A.surface, x.currentTarget.style.boxShadow = "none";
7622
7633
  },
7623
7634
  onBlur: (x) => {
7624
7635
  x.currentTarget.style.outline = "none";
@@ -7695,7 +7706,7 @@ const $s = [
7695
7706
  style: R.menuItem,
7696
7707
  onClick: _,
7697
7708
  onMouseOver: (x) => {
7698
- x.currentTarget.style.backgroundColor = z.surfaceHover;
7709
+ x.currentTarget.style.backgroundColor = A.surfaceHover;
7699
7710
  },
7700
7711
  onMouseOut: (x) => {
7701
7712
  x.currentTarget.style.backgroundColor = "transparent";
@@ -7715,7 +7726,7 @@ const $s = [
7715
7726
  style: R.menuItem,
7716
7727
  onClick: P,
7717
7728
  onMouseOver: (x) => {
7718
- x.currentTarget.style.backgroundColor = z.surfaceHover;
7729
+ x.currentTarget.style.backgroundColor = A.surfaceHover;
7719
7730
  },
7720
7731
  onMouseOut: (x) => {
7721
7732
  x.currentTarget.style.backgroundColor = "transparent";
@@ -7737,7 +7748,7 @@ const $s = [
7737
7748
  rel: "noopener noreferrer",
7738
7749
  style: R.menuItem,
7739
7750
  onMouseOver: (x) => {
7740
- x.currentTarget.style.backgroundColor = z.surfaceHover;
7751
+ x.currentTarget.style.backgroundColor = A.surfaceHover;
7741
7752
  },
7742
7753
  onMouseOut: (x) => {
7743
7754
  x.currentTarget.style.backgroundColor = "transparent";
@@ -7757,7 +7768,7 @@ const $s = [
7757
7768
  style: R.logoutButton,
7758
7769
  onClick: r,
7759
7770
  onMouseOver: (x) => {
7760
- x.currentTarget.style.backgroundColor = z.surfaceHover;
7771
+ x.currentTarget.style.backgroundColor = A.surfaceHover;
7761
7772
  },
7762
7773
  onMouseOut: (x) => {
7763
7774
  x.currentTarget.style.backgroundColor = "transparent";
@@ -7769,7 +7780,7 @@ const $s = [
7769
7780
  /* @__PURE__ */ n.jsx(
7770
7781
  ct,
7771
7782
  {
7772
- style: { ...R.icon, color: z.error },
7783
+ style: { ...R.icon, color: A.error },
7773
7784
  "aria-hidden": "true"
7774
7785
  }
7775
7786
  ),
@@ -7794,10 +7805,10 @@ const $s = [
7794
7805
  style: R.retryButton,
7795
7806
  onClick: Y,
7796
7807
  onMouseOver: (x) => {
7797
- x.currentTarget.style.backgroundColor = z.accentHover;
7808
+ x.currentTarget.style.backgroundColor = A.accentHover;
7798
7809
  },
7799
7810
  onMouseOut: (x) => {
7800
- x.currentTarget.style.backgroundColor = z.accent;
7811
+ x.currentTarget.style.backgroundColor = A.accent;
7801
7812
  },
7802
7813
  children: "Try Again"
7803
7814
  }
@@ -3,7 +3,7 @@
3
3
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const s=new this(t);return r.forEach(o=>s.set(o)),s}static accessor(t){const s=(this[Rt]=this[Rt]={accessors:{}}).accessors,o=this.prototype;function i(a){const l=Te(a);s[l]||(ln(o,a),s[l]=!0)}return p.isArray(t)?t.forEach(i):i(t),this}};ne.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),p.reduceDescriptors(ne.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[r]=s}}}),p.freezeMethods(ne);function Ge(e,t){const r=this||Ce,s=t||r,o=ne.from(s.headers);let i=s.data;return p.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function It(e){return!!(e&&e.__CANCEL__)}function we(e,t,r){U.call(this,e??"canceled",U.ERR_CANCELED,t,r),this.name="CanceledError"}p.inherits(we,U,{__CANCEL__:!0});function Pt(e,t,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?e(r):t(new U("Request failed with status code "+r.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function cn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function dn(e,t){e=e||10;const r=new Array(e),s=new Array(e);let o=0,i=0,a;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),u=s[i];a||(a=c),r[o]=h,s[o]=c;let y=i,R=0;for(;y!==o;)R+=r[y++],y=y%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-a<t)return;const k=u&&c-u;return k?Math.round(R*1e3/k):void 0}}function un(e,t){let r=0,s=1e3/t,o,i;const a=(c,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...c)};return[(...c)=>{const u=Date.now(),y=u-r;y>=s?a(c,u):(o=c,i||(i=setTimeout(()=>{i=null,a(o)},s-y)))},()=>o&&a(o)]}const De=(e,t,r=3)=>{let s=0;const o=dn(50,250);return un(i=>{const a=i.loaded,l=i.lengthComputable?i.total:void 0,h=a-s,c=o(h),u=a<=l;s=a;const y={loaded:a,total:l,progress:l?a/l:void 0,bytes:h,rate:c||void 0,estimated:c&&l&&u?(l-a)/c:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(y)},r)},Ot=(e,t)=>{const r=e!=null;return[s=>t[0]({lengthComputable:r,total:e,loaded:s}),t[1]]},_t=e=>(...t)=>p.asap(()=>e(...t)),pn=ee.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ee.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ee.origin),ee.navigator&&/(msie|trident)/i.test(ee.navigator.userAgent)):()=>!0,fn=ee.hasStandardBrowserEnv?{write(e,t,r,s,o,i){const a=[e+"="+encodeURIComponent(t)];p.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),p.isString(s)&&a.push("path="+s),p.isString(o)&&a.push("domain="+o),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function xn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function hn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function At(e,t,r){let s=!xn(t);return e&&(s||r==!1)?hn(e,t):t}const zt=e=>e instanceof ne?{...e}:e;function pe(e,t){t=t||{};const r={};function s(c,u,y,R){return p.isPlainObject(c)&&p.isPlainObject(u)?p.merge.call({caseless:R},c,u):p.isPlainObject(u)?p.merge({},u):p.isArray(u)?u.slice():u}function o(c,u,y,R){if(p.isUndefined(u)){if(!p.isUndefined(c))return s(void 0,c,y,R)}else return s(c,u,y,R)}function i(c,u){if(!p.isUndefined(u))return s(void 0,u)}function a(c,u){if(p.isUndefined(u)){if(!p.isUndefined(c))return s(void 0,c)}else return s(void 0,u)}function l(c,u,y){if(y in t)return s(c,u);if(y in e)return s(void 0,c)}const h={url:i,method:i,data:i,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:l,headers:(c,u,y)=>o(zt(c),zt(u),y,!0)};return p.forEach(Object.keys({...e,...t}),function(u){const y=h[u]||o,R=y(e[u],t[u],u);p.isUndefined(R)&&y!==l||(r[u]=R)}),r}const Nt=e=>{const t=pe({},e);let{data:r,withXSRFToken:s,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:l}=t;if(t.headers=a=ne.from(a),t.url=kt(At(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),p.isFormData(r)){if(ee.hasStandardBrowserEnv||ee.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(p.isFunction(r.getHeaders)){const h=r.getHeaders(),c=["content-type","content-length"];Object.entries(h).forEach(([u,y])=>{c.includes(u.toLowerCase())&&a.set(u,y)})}}if(ee.hasStandardBrowserEnv&&(s&&p.isFunction(s)&&(s=s(t)),s||s!==!1&&pn(t.url))){const h=o&&i&&fn.read(i);h&&a.set(o,h)}return t},gn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,s){const o=Nt(e);let i=o.data;const a=ne.from(o.headers).normalize();let{responseType:l,onUploadProgress:h,onDownloadProgress:c}=o,u,y,R,k,d;function b(){k&&k(),d&&d(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let g=new XMLHttpRequest;g.open(o.method.toUpperCase(),o.url,!0),g.timeout=o.timeout;function M(){if(!g)return;const _=ne.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),B={data:!l||l==="text"||l==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:_,config:e,request:g};Pt(function(N){r(N),b()},function(N){s(N),b()},B),g=null}"onloadend"in g?g.onloadend=M:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(M)},g.onabort=function(){g&&(s(new U("Request aborted",U.ECONNABORTED,e,g)),g=null)},g.onerror=function(E){const B=E&&E.message?E.message:"Network Error",m=new U(B,U.ERR_NETWORK,e,g);m.event=E||null,s(m),g=null},g.ontimeout=function(){let E=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const B=o.transitional||Ct;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),s(new U(E,B.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,g)),g=null},i===void 0&&a.setContentType(null),"setRequestHeader"in g&&p.forEach(a.toJSON(),function(E,B){g.setRequestHeader(B,E)}),p.isUndefined(o.withCredentials)||(g.withCredentials=!!o.withCredentials),l&&l!=="json"&&(g.responseType=o.responseType),c&&([R,d]=De(c,!0),g.addEventListener("progress",R)),h&&g.upload&&([y,k]=De(h),g.upload.addEventListener("progress",y),g.upload.addEventListener("loadend",k)),(o.cancelToken||o.signal)&&(u=_=>{g&&(s(!_||_.type?new we(null,e,g):_),g.abort(),g=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const D=cn(o.url);if(D&&ee.protocols.indexOf(D)===-1){s(new U("Unsupported protocol "+D+":",U.ERR_BAD_REQUEST,e));return}g.send(i||null)})},mn=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let s=new AbortController,o;const i=function(c){if(!o){o=!0,l();const u=c instanceof Error?c:this.reason;s.abort(u instanceof U?u:new we(u instanceof Error?u.message:u))}};let a=t&&setTimeout(()=>{a=null,i(new U(`timeout ${t} of ms exceeded`,U.ETIMEDOUT))},t);const l=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:h}=s;return h.unsubscribe=()=>p.asap(l),h}},yn=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let s=0,o;for(;s<r;)o=s+t,yield e.slice(s,o),s=o},bn=async function*(e,t){for await(const r of wn(e))yield*yn(r,t)},wn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:s}=await t.read();if(r)break;yield s}}finally{await t.cancel()}},Ut=(e,t,r,s)=>{const o=bn(e,t);let i=0,a,l=h=>{a||(a=!0,s&&s(h))};return new ReadableStream({async pull(h){try{const{done:c,value:u}=await o.next();if(c){l(),h.close();return}let y=u.byteLength;if(r){let R=i+=y;r(R)}h.enqueue(new Uint8Array(u))}catch(c){throw l(c),c}},cancel(h){return l(h),o.return()}},{highWaterMark:2})},Dt=64*1024,{isFunction:Fe}=p,Sn=(({Request:e,Response:t})=>({Request:e,Response:t}))(p.global),{ReadableStream:Ft,TextEncoder:Lt}=p.global,Mt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},jn=e=>{e=p.merge.call({skipUndefined:!0},Sn,e);const{fetch:t,Request:r,Response:s}=e,o=t?Fe(t):typeof fetch=="function",i=Fe(r),a=Fe(s);if(!o)return!1;const l=o&&Fe(Ft),h=o&&(typeof Lt=="function"?(d=>b=>d.encode(b))(new Lt):async d=>new Uint8Array(await new r(d).arrayBuffer())),c=i&&l&&Mt(()=>{let d=!1;const b=new r(ee.origin,{body:new Ft,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!b}),u=a&&l&&Mt(()=>p.isReadableStream(new s("").body)),y={stream:u&&(d=>d.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!y[d]&&(y[d]=(b,g)=>{let M=b&&b[d];if(M)return M.call(b);throw new U(`Response type '${d}' is not supported`,U.ERR_NOT_SUPPORT,g)})});const R=async d=>{if(d==null)return 0;if(p.isBlob(d))return d.size;if(p.isSpecCompliantForm(d))return(await new r(ee.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(p.isArrayBufferView(d)||p.isArrayBuffer(d))return d.byteLength;if(p.isURLSearchParams(d)&&(d=d+""),p.isString(d))return(await h(d)).byteLength},k=async(d,b)=>{const g=p.toFiniteNumber(d.getContentLength());return g??R(b)};return async d=>{let{url:b,method:g,data:M,signal:D,cancelToken:_,timeout:E,onDownloadProgress:B,onUploadProgress:m,responseType:N,headers:w,withCredentials:F="same-origin",fetchOptions:K}=Nt(d),L=t||fetch;N=N?(N+"").toLowerCase():"text";let Y=mn([D,_&&_.toAbortSignal()],E),Z=null;const C=Y&&Y.unsubscribe&&(()=>{Y.unsubscribe()});let J;try{if(m&&c&&g!=="get"&&g!=="head"&&(J=await k(w,M))!==0){let T=new r(b,{method:"POST",body:M,duplex:"half"}),z;if(p.isFormData(M)&&(z=T.headers.get("content-type"))&&w.setContentType(z),T.body){const[O,x]=Ot(J,De(_t(m)));M=Ut(T.body,Dt,O,x)}}p.isString(F)||(F=F?"include":"omit");const H=i&&"credentials"in r.prototype,A={...K,signal:Y,method:g.toUpperCase(),headers:w.normalize().toJSON(),body:M,duplex:"half",credentials:H?F:void 0};Z=i&&new r(b,A);let I=await(i?L(Z,K):L(b,A));const q=u&&(N==="stream"||N==="response");if(u&&(B||q&&C)){const T={};["status","statusText","headers"].forEach(j=>{T[j]=I[j]});const z=p.toFiniteNumber(I.headers.get("content-length")),[O,x]=B&&Ot(z,De(_t(B),!0))||[];I=new s(Ut(I.body,Dt,O,()=>{x&&x(),C&&C()}),T)}N=N||"text";let f=await y[p.findKey(y,N)||"text"](I,d);return!q&&C&&C(),await new Promise((T,z)=>{Pt(T,z,{data:f,headers:ne.from(I.headers),status:I.status,statusText:I.statusText,config:d,request:Z})})}catch(H){throw C&&C(),H&&H.name==="TypeError"&&/Load failed|fetch/i.test(H.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,d,Z),{cause:H.cause||H}):U.from(H,H&&H.code,d,Z)}}},vn=new Map,Bt=e=>{let t=e?e.env:{};const{fetch:r,Request:s,Response:o}=t,i=[s,o,r];let a=i.length,l=a,h,c,u=vn;for(;l--;)h=i[l],c=u.get(h),c===void 0&&u.set(h,c=l?new Map:jn(t)),u=c;return c};Bt();const Ze={http:Hr,xhr:gn,fetch:{get:Bt}};p.forEach(Ze,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Wt=e=>`- ${e}`,kn=e=>p.isFunction(e)||e===null||e===!1,$t={getAdapter:(e,t)=>{e=p.isArray(e)?e:[e];const{length:r}=e;let s,o;const i={};for(let a=0;a<r;a++){s=e[a];let l;if(o=s,!kn(s)&&(o=Ze[(l=String(s)).toLowerCase()],o===void 0))throw new U(`Unknown adapter '${l}'`);if(o&&(p.isFunction(o)||(o=o.get(t))))break;i[l||"#"+a]=o}if(!o){const a=Object.entries(i).map(([h,c])=>`adapter ${h} `+(c===!1?"is not supported by the environment":"is not available in the build"));let l=r?a.length>1?`since :
4
4
  `+a.map(Wt).join(`
5
5
  `):" "+Wt(a[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o},adapters:Ze};function Qe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new we(null,e)}function Ht(e){return Qe(e),e.headers=ne.from(e.headers),e.data=Ge.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),$t.getAdapter(e.adapter||Ce.adapter,e)(e).then(function(s){return Qe(e),s.data=Ge.call(e,e.transformResponse,s),s.headers=ne.from(s.headers),s},function(s){return It(s)||(Qe(e),s&&s.response&&(s.response.data=Ge.call(e,e.transformResponse,s.response),s.response.headers=ne.from(s.response.headers))),Promise.reject(s)})}const Vt="1.12.2",Le={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Le[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Yt={};Le.transitional=function(t,r,s){function o(i,a){return"[Axios v"+Vt+"] Transitional option '"+i+"'"+a+(s?". "+s:"")}return(i,a,l)=>{if(t===!1)throw new U(o(a," has been removed"+(r?" in "+r:"")),U.ERR_DEPRECATED);return r&&!Yt[a]&&(Yt[a]=!0,console.warn(o(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,a,l):!0}},Le.spelling=function(t){return(r,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function En(e,t,r){if(typeof e!="object")throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let o=s.length;for(;o-- >0;){const i=s[o],a=t[i];if(a){const l=e[i],h=l===void 0||a(l,i,e);if(h!==!0)throw new U("option "+i+" must be "+h,U.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new U("Unknown option "+i,U.ERR_BAD_OPTION)}}const Me={assertOptions:En,validators:Le},ie=Me.validators;let fe=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Et,response:new Et}}async request(t,r){try{return await this._request(t,r)}catch(s){if(s instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
6
- `+i):s.stack=i}catch{}}throw s}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=pe(this.defaults,r);const{transitional:s,paramsSerializer:o,headers:i}=r;s!==void 0&&Me.assertOptions(s,{silentJSONParsing:ie.transitional(ie.boolean),forcedJSONParsing:ie.transitional(ie.boolean),clarifyTimeoutError:ie.transitional(ie.boolean)},!1),o!=null&&(p.isFunction(o)?r.paramsSerializer={serialize:o}:Me.assertOptions(o,{encode:ie.function,serialize:ie.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Me.assertOptions(r,{baseUrl:ie.spelling("baseURL"),withXsrfToken:ie.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=i&&p.merge(i.common,i[r.method]);i&&p.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),r.headers=ne.concat(a,i);const l=[];let h=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(h=h&&b.synchronous,l.unshift(b.fulfilled,b.rejected))});const c=[];this.interceptors.response.forEach(function(b){c.push(b.fulfilled,b.rejected)});let u,y=0,R;if(!h){const d=[Ht.bind(this),void 0];for(d.unshift(...l),d.push(...c),R=d.length,u=Promise.resolve(r);y<R;)u=u.then(d[y++],d[y++]);return u}R=l.length;let k=r;for(;y<R;){const d=l[y++],b=l[y++];try{k=d(k)}catch(g){b.call(this,g);break}}try{u=Ht.call(this,k)}catch(d){return Promise.reject(d)}for(y=0,R=c.length;y<R;)u=u.then(c[y++],c[y++]);return u}getUri(t){t=pe(this.defaults,t);const r=At(t.baseURL,t.url,t.allowAbsoluteUrls);return kt(r,t.params,t.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(t){fe.prototype[t]=function(r,s){return this.request(pe(s||{},{method:t,url:r,data:(s||{}).data}))}}),p.forEach(["post","put","patch"],function(t){function r(s){return function(i,a,l){return this.request(pe(l||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}fe.prototype[t]=r(),fe.prototype[t+"Form"]=r(!0)});let Cn=class or{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const s=this;this.promise.then(o=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](o);s._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(l=>{s.subscribe(l),i=l}).then(o);return a.cancel=function(){s.unsubscribe(i)},a},t(function(i,a,l){s.reason||(s.reason=new we(i,a,l),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=s=>{t.abort(s)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new or(function(o){t=o}),cancel:t}}};function Tn(e){return function(r){return e.apply(null,r)}}function Rn(e){return p.isObject(e)&&e.isAxiosError===!0}const et={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(et).forEach(([e,t])=>{et[t]=e});function qt(e){const t=new fe(e),r=ct(fe.prototype.request,t);return p.extend(r,fe.prototype,t,{allOwnKeys:!0}),p.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return qt(pe(e,o))},r}const W=qt(Ce);W.Axios=fe,W.CanceledError=we,W.CancelToken=Cn,W.isCancel=It,W.VERSION=Vt,W.toFormData=Ne,W.AxiosError=U,W.Cancel=W.CanceledError,W.all=function(t){return Promise.all(t)},W.spread=Tn,W.isAxiosError=Rn,W.mergeConfig=pe,W.AxiosHeaders=ne,W.formToJSON=e=>Tt(p.isHTMLForm(e)?new FormData(e):e),W.getAdapter=$t.getAdapter,W.HttpStatusCode=et,W.default=W;const{Axios:ms,AxiosError:ys,CanceledError:bs,isCancel:ws,CancelToken:Ss,VERSION:js,all:vs,Cancel:ks,isAxiosError:Es,spread:Cs,toFormData:Ts,AxiosHeaders:Rs,HttpStatusCode:Is,formToJSON:Ps,getAdapter:Os,mergeConfig:_s}=W;class In{baseUrl;apiKey;appId;client;constructor(t){if(!t||!t.baseUrl)throw new Error("NeuctraAuthixClient: 'baseUrl' is required in config");this.baseUrl=t.baseUrl.replace(/\/$/,""),this.apiKey=t.apiKey||null,this.appId=t.appId||null,this.client=W.create({baseURL:this.baseUrl,headers:{"Content-Type":"application/json",...this.apiKey?{"x-api-key":this.apiKey}:{}},timeout:1e4})}async request(t,r,s,o={}){if(!t)throw new Error("HTTP method is required");if(!r)throw new Error("Request path is required");try{const i={...this.appId?{appId:this.appId}:{},...s||{}};return(await this.client.request({url:r,method:t,data:i,headers:o})).data}catch(i){if(i.isAxiosError&&!i.response)throw new Error(`Network error: ${i.message}`);if(i.response){const a=i.response.status,l=i.response.data?.message||i.response.statusText;throw new Error(`API Error (${a}): ${l}`)}throw new Error(i.message||"Unknown error occurred during API request")}}async signup(t){const{name:r,email:s,password:o}=t;if(!r||!s||!o)throw new Error("signup: 'name', 'email', and 'password' are required");return this.request("POST","/users/signup",t)}async login(t){const{email:r,password:s,appId:o}=t;if(!r||!s)throw new Error("login: 'email' and 'password' are required");return this.request("POST","/users/login",{email:r,password:s,appId:o||this.appId})}async updateUser(t){const{userId:r,appId:s}=t;if(!r)throw new Error("updateUser: 'userId' is required");return this.request("PUT",`/users/update/${r}`,{...t,appId:s||this.appId})}async changePassword(t){const{userId:r,currentPassword:s,newPassword:o,appId:i}=t;if(!r)throw new Error("changePassword: 'userId' is required");if(!s||!o)throw new Error("changePassword: both 'currentPassword' and 'newPassword' are required");return this.request("PUT",`/users/change-password/${r}`,{currentPassword:s,newPassword:o,appId:i||this.appId})}async deleteUser(t){const{userId:r,appId:s}=t;if(!r)throw new Error("deleteUser: 'userId' is required");return this.request("DELETE",`/users/delete/${r}`,{appId:s||this.appId})}async getProfile(t){const{token:r}=t;if(!r)throw new Error("getProfile: 'token' is required");return this.request("GET","/users/profile",{},{Authorization:`Bearer ${r}`})}async sendVerifyOTP(t){const{token:r,appId:s}=t;if(!r)throw new Error("sendVerifyOTP: 'token' is required");return this.request("POST","/users/send-verify-otp",{appId:s||this.appId},{Authorization:`Bearer ${r}`})}async verifyEmail(t){const{token:r,otp:s,appId:o}=t;if(!r)throw new Error("verifyEmail: 'token' is required");if(!s)throw new Error("verifyEmail: 'otp' is required");return this.request("POST","/users/verify-email",{otp:s,appId:o||this.appId},{Authorization:`Bearer ${r}`})}async forgotPassword(t){const{email:r,appId:s}=t;if(!r)throw new Error("forgotPassword: 'email' is required");return this.request("POST","/users/forgot-password",{email:r,appId:s||this.appId})}async resetPassword(t){const{email:r,otp:s,newPassword:o,appId:i}=t;if(!r||!s||!o)throw new Error("resetPassword: 'email', 'otp' and 'newPassword' are required");return this.request("POST","/users/reset-password",{email:r,otp:s,newPassword:o,appId:i||this.appId})}async getUserData(t){const{userId:r}=t;if(!r)throw new Error("getUserData: 'userId' is required");return this.request("GET",`/users/${r}/data`)}async getSingleUserData(t){const{userId:r,dataId:s}=t;if(!r||!s)throw new Error("getSingleUserData: 'userId' and 'dataId' are required");return this.request("GET",`/users/${r}/data/${s}`)}async addUserData(t){const{userId:r,data:s}=t;if(!r)throw new Error("addUserData: 'userId' is required");if(!s)throw new Error("addUserData: 'data' is required");return this.request("POST",`/users/${r}/data`,s)}async updateUserData(t){const{userId:r,dataId:s,data:o}=t;if(!r||!s)throw new Error("updateUserData: 'userId' and 'dataId' are required");if(!o)throw new Error("updateUserData: 'data' is required");return this.request("PUT",`/users/${r}/data/${s}`,o)}async deleteUserData(t){const{userId:r,dataId:s}=t;if(!r||!s)throw new Error("deleteUserData: 'userId' and 'dataId' are required");return this.request("DELETE",`/users/${r}/data/${s}`)}}var Be={exports:{}},Re={};/**
6
+ `+i):s.stack=i}catch{}}throw s}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=pe(this.defaults,r);const{transitional:s,paramsSerializer:o,headers:i}=r;s!==void 0&&Me.assertOptions(s,{silentJSONParsing:ie.transitional(ie.boolean),forcedJSONParsing:ie.transitional(ie.boolean),clarifyTimeoutError:ie.transitional(ie.boolean)},!1),o!=null&&(p.isFunction(o)?r.paramsSerializer={serialize:o}:Me.assertOptions(o,{encode:ie.function,serialize:ie.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Me.assertOptions(r,{baseUrl:ie.spelling("baseURL"),withXsrfToken:ie.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=i&&p.merge(i.common,i[r.method]);i&&p.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),r.headers=ne.concat(a,i);const l=[];let h=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(h=h&&b.synchronous,l.unshift(b.fulfilled,b.rejected))});const c=[];this.interceptors.response.forEach(function(b){c.push(b.fulfilled,b.rejected)});let u,y=0,R;if(!h){const d=[Ht.bind(this),void 0];for(d.unshift(...l),d.push(...c),R=d.length,u=Promise.resolve(r);y<R;)u=u.then(d[y++],d[y++]);return u}R=l.length;let k=r;for(;y<R;){const d=l[y++],b=l[y++];try{k=d(k)}catch(g){b.call(this,g);break}}try{u=Ht.call(this,k)}catch(d){return Promise.reject(d)}for(y=0,R=c.length;y<R;)u=u.then(c[y++],c[y++]);return u}getUri(t){t=pe(this.defaults,t);const r=At(t.baseURL,t.url,t.allowAbsoluteUrls);return kt(r,t.params,t.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(t){fe.prototype[t]=function(r,s){return this.request(pe(s||{},{method:t,url:r,data:(s||{}).data}))}}),p.forEach(["post","put","patch"],function(t){function r(s){return function(i,a,l){return this.request(pe(l||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}fe.prototype[t]=r(),fe.prototype[t+"Form"]=r(!0)});let Cn=class or{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const s=this;this.promise.then(o=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](o);s._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(l=>{s.subscribe(l),i=l}).then(o);return a.cancel=function(){s.unsubscribe(i)},a},t(function(i,a,l){s.reason||(s.reason=new we(i,a,l),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=s=>{t.abort(s)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new or(function(o){t=o}),cancel:t}}};function Tn(e){return function(r){return e.apply(null,r)}}function Rn(e){return p.isObject(e)&&e.isAxiosError===!0}const et={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(et).forEach(([e,t])=>{et[t]=e});function qt(e){const t=new fe(e),r=ct(fe.prototype.request,t);return p.extend(r,fe.prototype,t,{allOwnKeys:!0}),p.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return qt(pe(e,o))},r}const W=qt(Ce);W.Axios=fe,W.CanceledError=we,W.CancelToken=Cn,W.isCancel=It,W.VERSION=Vt,W.toFormData=Ne,W.AxiosError=U,W.Cancel=W.CanceledError,W.all=function(t){return Promise.all(t)},W.spread=Tn,W.isAxiosError=Rn,W.mergeConfig=pe,W.AxiosHeaders=ne,W.formToJSON=e=>Tt(p.isHTMLForm(e)?new FormData(e):e),W.getAdapter=$t.getAdapter,W.HttpStatusCode=et,W.default=W;const{Axios:ms,AxiosError:ys,CanceledError:bs,isCancel:ws,CancelToken:Ss,VERSION:js,all:vs,Cancel:ks,isAxiosError:Es,spread:Cs,toFormData:Ts,AxiosHeaders:Rs,HttpStatusCode:Is,formToJSON:Ps,getAdapter:Os,mergeConfig:_s}=W;class In{baseUrl;apiKey;appId;client;constructor(t){if(!t||!t.baseUrl)throw new Error("NeuctraAuthixClient: 'baseUrl' is required in config");this.baseUrl=t.baseUrl.replace(/\/$/,""),this.apiKey=t.apiKey||null,this.appId=t.appId||null,this.client=W.create({baseURL:this.baseUrl,headers:{"Content-Type":"application/json",...this.apiKey?{"x-api-key":this.apiKey}:{}},timeout:1e4})}async request(t,r,s,o={}){if(!t)return{success:!1,message:"HTTP method is required"};if(!r)return{success:!1,message:"Request path is required"};try{const i={...this.appId?{appId:this.appId}:{},...s||{}};return{success:!0,data:(await this.client.request({url:r,method:t,data:i,headers:o})).data,message:"✅ Request completed successfully"}}catch(i){if(console.error("❌ [Request Error]:",i),i.isAxiosError&&!i.response)return{success:!1,message:`🌐 Network error: ${i.message}`};if(i.response){const a=i.response.status,l=i.response.data?.message||i.response.statusText||"Server returned an error";return{success:!1,message:`⚠️ Request failed (${a}): ${l}`}}return{success:!1,message:`🚨 Unexpected error: ${i.message||"Something went wrong"}`}}}async signup(t){const{name:r,email:s,password:o}=t;if(!r||!s||!o)throw new Error("signup: 'name', 'email', and 'password' are required");return this.request("POST","/users/signup",t)}async login(t){const{email:r,password:s,appId:o}=t;if(!r||!s)throw new Error("login: 'email' and 'password' are required");return this.request("POST","/users/login",{email:r,password:s,appId:o||this.appId})}async updateUser(t){const{userId:r,appId:s}=t;if(!r)throw new Error("updateUser: 'userId' is required");return this.request("PUT",`/users/update/${r}`,{...t,appId:s||this.appId})}async changePassword(t){const{userId:r,currentPassword:s,newPassword:o,appId:i}=t;if(!r)throw new Error("changePassword: 'userId' is required");if(!s||!o)throw new Error("changePassword: both 'currentPassword' and 'newPassword' are required");return this.request("PUT",`/users/change-password/${r}`,{currentPassword:s,newPassword:o,appId:i||this.appId})}async deleteUser(t){const{userId:r,appId:s}=t;if(!r)throw new Error("deleteUser: 'userId' is required");return this.request("DELETE",`/users/delete/${r}`,{appId:s||this.appId})}async getProfile(t){const{token:r}=t;if(!r)throw new Error("getProfile: 'token' is required");return this.request("GET","/users/profile",{},{Authorization:`Bearer ${r}`})}async sendVerifyOTP(t){const{token:r,appId:s}=t;if(!r)throw new Error("sendVerifyOTP: 'token' is required");return this.request("POST","/users/send-verify-otp",{appId:s||this.appId},{Authorization:`Bearer ${r}`})}async verifyEmail(t){const{token:r,otp:s,appId:o}=t;if(!r)throw new Error("verifyEmail: 'token' is required");if(!s)throw new Error("verifyEmail: 'otp' is required");return this.request("POST","/users/verify-email",{otp:s,appId:o||this.appId},{Authorization:`Bearer ${r}`})}async forgotPassword(t){const{email:r,appId:s}=t;if(!r)throw new Error("forgotPassword: 'email' is required");return this.request("POST","/users/forgot-password",{email:r,appId:s||this.appId})}async resetPassword(t){const{email:r,otp:s,newPassword:o,appId:i}=t;if(!r||!s||!o)throw new Error("resetPassword: 'email', 'otp' and 'newPassword' are required");return this.request("POST","/users/reset-password",{email:r,otp:s,newPassword:o,appId:i||this.appId})}async getUserData(t){const{userId:r}=t;if(!r)throw new Error("getUserData: 'userId' is required");return this.request("GET",`/users/${r}/data`)}async getSingleUserData(t){const{userId:r,dataId:s}=t;if(!r||!s)throw new Error("getSingleUserData: 'userId' and 'dataId' are required");return this.request("GET",`/users/${r}/data/${s}`)}async addUserData(t){const{userId:r,data:s}=t;if(!r)throw new Error("addUserData: 'userId' is required");if(!s)throw new Error("addUserData: 'data' is required");return this.request("POST",`/users/${r}/data`,s)}async updateUserData(t){const{userId:r,dataId:s,data:o}=t;if(!r||!s)throw new Error("updateUserData: 'userId' and 'dataId' are required");if(!o)throw new Error("updateUserData: 'data' is required");return this.request("PUT",`/users/${r}/data/${s}`,o)}async deleteUserData(t){const{userId:r,dataId:s}=t;if(!r||!s)throw new Error("deleteUserData: 'userId' and 'dataId' are required");return this.request("DELETE",`/users/${r}/data/${s}`)}}var Be={exports:{}},Re={};/**
7
7
  * @license React
8
8
  * react-jsx-runtime.production.js
9
9
  *
@@ -120,43 +120,67 @@ export declare class NeuctraAuthix {
120
120
  */
121
121
  constructor(config: NeuctraAuthixConfig);
122
122
  /**
123
- * Universal request helper with error handling
124
- * @param method HTTP method (GET, POST, PUT, DELETE)
125
- * @param path API endpoint path
126
- * @param data optional request body
127
- * @param extraHeaders optional headers
128
- */
123
+ * 🌐 Universal request helper with structured responses and error handling
124
+ * @param method HTTP method (GET, POST, PUT, DELETE)
125
+ * @param path API endpoint path
126
+ * @param data optional request body
127
+ * @param extraHeaders optional headers
128
+ */
129
129
  private request;
130
130
  /**
131
131
  * Register a new user
132
132
  * @param params user details
133
133
  */
134
- signup(params: SignupParams): Promise<any>;
134
+ signup(params: SignupParams): Promise<{
135
+ success: boolean;
136
+ data?: any;
137
+ message: string;
138
+ }>;
135
139
  /**
136
140
  * Login a user
137
141
  * @param params login details
138
142
  */
139
- login(params: LoginParams): Promise<any>;
143
+ login(params: LoginParams): Promise<{
144
+ success: boolean;
145
+ data?: any;
146
+ message: string;
147
+ }>;
140
148
  /**
141
149
  * Update an existing user
142
150
  * @param params fields to update
143
151
  */
144
- updateUser(params: UpdateUserParams): Promise<any>;
152
+ updateUser(params: UpdateUserParams): Promise<{
153
+ success: boolean;
154
+ data?: any;
155
+ message: string;
156
+ }>;
145
157
  /**
146
158
  * Change a user's password (Admin only)
147
159
  * @param params requires userId, currentPassword, newPassword
148
160
  */
149
- changePassword(params: ChangePasswordParams): Promise<any>;
161
+ changePassword(params: ChangePasswordParams): Promise<{
162
+ success: boolean;
163
+ data?: any;
164
+ message: string;
165
+ }>;
150
166
  /**
151
167
  * Delete a user
152
168
  * @param params requires userId and optionally appId
153
169
  */
154
- deleteUser(params: DeleteUserParams): Promise<any>;
170
+ deleteUser(params: DeleteUserParams): Promise<{
171
+ success: boolean;
172
+ data?: any;
173
+ message: string;
174
+ }>;
155
175
  /**
156
176
  * Get the profile of the authenticated user
157
177
  * @param params requires JWT token
158
178
  */
159
- getProfile(params: GetProfileParams): Promise<any>;
179
+ getProfile(params: GetProfileParams): Promise<{
180
+ success: boolean;
181
+ data?: any;
182
+ message: string;
183
+ }>;
160
184
  /**
161
185
  * Send verification OTP (requires logged-in user token)
162
186
  * @param params requires token
@@ -164,7 +188,11 @@ export declare class NeuctraAuthix {
164
188
  sendVerifyOTP(params: {
165
189
  token: string;
166
190
  appId?: string;
167
- }): Promise<any>;
191
+ }): Promise<{
192
+ success: boolean;
193
+ data?: any;
194
+ message: string;
195
+ }>;
168
196
  /**
169
197
  * Verify email with OTP (requires logged-in user token)
170
198
  * @param params requires token + otp
@@ -173,7 +201,11 @@ export declare class NeuctraAuthix {
173
201
  token: string;
174
202
  otp: string;
175
203
  appId?: string;
176
- }): Promise<any>;
204
+ }): Promise<{
205
+ success: boolean;
206
+ data?: any;
207
+ message: string;
208
+ }>;
177
209
  /**
178
210
  * Forgot password (public route)
179
211
  * @param params requires email
@@ -181,7 +213,11 @@ export declare class NeuctraAuthix {
181
213
  forgotPassword(params: {
182
214
  email: string;
183
215
  appId?: string;
184
- }): Promise<any>;
216
+ }): Promise<{
217
+ success: boolean;
218
+ data?: any;
219
+ message: string;
220
+ }>;
185
221
  /**
186
222
  * Reset password (public route)
187
223
  * @param params requires email, otp, newPassword
@@ -191,31 +227,55 @@ export declare class NeuctraAuthix {
191
227
  otp: string;
192
228
  newPassword: string;
193
229
  appId?: string;
194
- }): Promise<any>;
230
+ }): Promise<{
231
+ success: boolean;
232
+ data?: any;
233
+ message: string;
234
+ }>;
195
235
  /**
196
236
  * Get all data objects for a user
197
237
  * @param params requires userId
198
238
  */
199
- getUserData(params: GetUserDataParams): Promise<any>;
239
+ getUserData(params: GetUserDataParams): Promise<{
240
+ success: boolean;
241
+ data?: any;
242
+ message: string;
243
+ }>;
200
244
  /**
201
245
  * Get a single data object for a user
202
246
  * @param params requires userId and dataId
203
247
  */
204
- getSingleUserData(params: GetSingleUserDataParams): Promise<any>;
248
+ getSingleUserData(params: GetSingleUserDataParams): Promise<{
249
+ success: boolean;
250
+ data?: any;
251
+ message: string;
252
+ }>;
205
253
  /**
206
254
  * Add a new data object to a user
207
255
  * @param params requires userId and data object
208
256
  */
209
- addUserData(params: AddUserDataParams): Promise<any>;
257
+ addUserData(params: AddUserDataParams): Promise<{
258
+ success: boolean;
259
+ data?: any;
260
+ message: string;
261
+ }>;
210
262
  /**
211
263
  * Update a data object by its id
212
264
  * @param params requires userId, dataId, and updated fields
213
265
  */
214
- updateUserData(params: UpdateUserDataParams): Promise<any>;
266
+ updateUserData(params: UpdateUserDataParams): Promise<{
267
+ success: boolean;
268
+ data?: any;
269
+ message: string;
270
+ }>;
215
271
  /**
216
272
  * Delete a data object by its id
217
273
  * @param params requires userId and dataId
218
274
  */
219
- deleteUserData(params: DeleteUserDataParams): Promise<any>;
275
+ deleteUserData(params: DeleteUserDataParams): Promise<{
276
+ success: boolean;
277
+ data?: any;
278
+ message: string;
279
+ }>;
220
280
  }
221
281
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neuctra/authix",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "Authentication SDK and UI components library for React and Vue with TailwindCSS",
5
5
  "author": "Taha Asif",
6
6
  "license": "MIT",