@neuctra/authix 1.1.69 → 1.1.71

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,26 +1,26 @@
1
- import Te, { forwardRef as _t, createElement as Xe, createContext as pr, useContext as fr, useState as R, useEffect as te, useRef as ft } from "react";
2
- function Dt(t, e) {
1
+ import Te, { forwardRef as Ut, createElement as Xe, createContext as pr, useContext as fr, useState as R, useEffect as te, useRef as ft } from "react";
2
+ function Nt(t, e) {
3
3
  return function() {
4
4
  return t.apply(e, arguments);
5
5
  };
6
6
  }
7
- const { toString: xr } = Object.prototype, { getPrototypeOf: st } = Object, { iterator: qe, toStringTag: $t } = Symbol, Me = /* @__PURE__ */ ((t) => (e) => {
7
+ const { toString: xr } = Object.prototype, { getPrototypeOf: st } = Object, { iterator: qe, toStringTag: Dt } = Symbol, Me = /* @__PURE__ */ ((t) => (e) => {
8
8
  const r = xr.call(e);
9
9
  return t[r] || (t[r] = r.slice(8, -1).toLowerCase());
10
10
  })(/* @__PURE__ */ Object.create(null)), ae = (t) => (t = t.toLowerCase(), (e) => Me(e) === t), We = (t) => (e) => typeof e === t, { isArray: we } = Array, ye = We("undefined");
11
11
  function Re(t) {
12
12
  return t !== null && !ye(t) && t.constructor !== null && !ye(t.constructor) && re(t.constructor.isBuffer) && t.constructor.isBuffer(t);
13
13
  }
14
- const Nt = ae("ArrayBuffer");
14
+ const $t = ae("ArrayBuffer");
15
15
  function hr(t) {
16
16
  let e;
17
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && Nt(t.buffer), e;
17
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && $t(t.buffer), e;
18
18
  }
19
- const mr = We("string"), re = We("function"), Lt = We("number"), Pe = (t) => t !== null && typeof t == "object", gr = (t) => t === !0 || t === !1, _e = (t) => {
19
+ const mr = We("string"), re = We("function"), Ft = We("number"), Pe = (t) => t !== null && typeof t == "object", gr = (t) => t === !0 || t === !1, Ue = (t) => {
20
20
  if (Me(t) !== "object")
21
21
  return !1;
22
22
  const e = st(t);
23
- return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !($t in t) && !(qe in t);
23
+ return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Dt in t) && !(qe in t);
24
24
  }, yr = (t) => {
25
25
  if (!Pe(t) || Re(t))
26
26
  return !1;
@@ -29,11 +29,11 @@ const mr = We("string"), re = We("function"), Lt = We("number"), Pe = (t) => t !
29
29
  } catch {
30
30
  return !1;
31
31
  }
32
- }, br = ae("Date"), wr = ae("File"), jr = ae("Blob"), vr = ae("FileList"), Sr = (t) => Pe(t) && re(t.pipe), Er = (t) => {
32
+ }, br = ae("Date"), wr = ae("File"), jr = ae("Blob"), vr = ae("FileList"), Sr = (t) => Pe(t) && re(t.pipe), kr = (t) => {
33
33
  let e;
34
34
  return t && (typeof FormData == "function" && t instanceof FormData || re(t.append) && ((e = Me(t)) === "formdata" || // detect form-data instance
35
35
  e === "object" && re(t.toString) && t.toString() === "[object FormData]"));
36
- }, kr = ae("URLSearchParams"), [Cr, Tr, Rr, Pr] = ["ReadableStream", "Request", "Response", "Headers"].map(ae), Ir = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
36
+ }, Er = ae("URLSearchParams"), [Cr, Tr, Rr, Pr] = ["ReadableStream", "Request", "Response", "Headers"].map(ae), Ir = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
37
37
  function Ie(t, e, { allOwnKeys: r = !1 } = {}) {
38
38
  if (t === null || typeof t > "u")
39
39
  return;
@@ -50,7 +50,7 @@ function Ie(t, e, { allOwnKeys: r = !1 } = {}) {
50
50
  c = o[s], e.call(null, t[c], c, t);
51
51
  }
52
52
  }
53
- function Ft(t, e) {
53
+ function Lt(t, e) {
54
54
  if (Re(t))
55
55
  return null;
56
56
  e = e.toLowerCase();
@@ -64,20 +64,20 @@ function Ft(t, e) {
64
64
  const xe = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, qt = (t) => !ye(t) && t !== xe;
65
65
  function Ze() {
66
66
  const { caseless: t, skipUndefined: e } = qt(this) && this || {}, r = {}, s = (i, o) => {
67
- const a = t && Ft(r, o) || o;
68
- _e(r[a]) && _e(i) ? r[a] = Ze(r[a], i) : _e(i) ? r[a] = Ze({}, i) : we(i) ? r[a] = i.slice() : (!e || !ye(i)) && (r[a] = i);
67
+ const a = t && Lt(r, o) || o;
68
+ Ue(r[a]) && Ue(i) ? r[a] = Ze(r[a], i) : Ue(i) ? r[a] = Ze({}, i) : we(i) ? r[a] = i.slice() : (!e || !ye(i)) && (r[a] = i);
69
69
  };
70
70
  for (let i = 0, o = arguments.length; i < o; i++)
71
71
  arguments[i] && Ie(arguments[i], s);
72
72
  return r;
73
73
  }
74
74
  const Or = (t, e, r, { allOwnKeys: s } = {}) => (Ie(e, (i, o) => {
75
- r && re(i) ? t[o] = Dt(i, r) : t[o] = i;
75
+ r && re(i) ? t[o] = Nt(i, r) : t[o] = i;
76
76
  }, { allOwnKeys: s }), t), zr = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Ar = (t, e, r, s) => {
77
77
  t.prototype = Object.create(e.prototype, s), t.prototype.constructor = t, Object.defineProperty(t, "super", {
78
78
  value: e.prototype
79
79
  }), r && Object.assign(t.prototype, r);
80
- }, Ur = (t, e, r, s) => {
80
+ }, _r = (t, e, r, s) => {
81
81
  let i, o, a;
82
82
  const c = {};
83
83
  if (e = e || {}, t == null) return e;
@@ -87,33 +87,33 @@ const Or = (t, e, r, { allOwnKeys: s } = {}) => (Ie(e, (i, o) => {
87
87
  t = r !== !1 && st(t);
88
88
  } while (t && (!r || r(t, e)) && t !== Object.prototype);
89
89
  return e;
90
- }, _r = (t, e, r) => {
90
+ }, Ur = (t, e, r) => {
91
91
  t = String(t), (r === void 0 || r > t.length) && (r = t.length), r -= e.length;
92
92
  const s = t.indexOf(e, r);
93
93
  return s !== -1 && s === r;
94
- }, Dr = (t) => {
94
+ }, Nr = (t) => {
95
95
  if (!t) return null;
96
96
  if (we(t)) return t;
97
97
  let e = t.length;
98
- if (!Lt(e)) return null;
98
+ if (!Ft(e)) return null;
99
99
  const r = new Array(e);
100
100
  for (; e-- > 0; )
101
101
  r[e] = t[e];
102
102
  return r;
103
- }, $r = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && st(Uint8Array)), Nr = (t, e) => {
103
+ }, Dr = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && st(Uint8Array)), $r = (t, e) => {
104
104
  const s = (t && t[qe]).call(t);
105
105
  let i;
106
106
  for (; (i = s.next()) && !i.done; ) {
107
107
  const o = i.value;
108
108
  e.call(t, o[0], o[1]);
109
109
  }
110
- }, Lr = (t, e) => {
110
+ }, Fr = (t, e) => {
111
111
  let r;
112
112
  const s = [];
113
113
  for (; (r = t.exec(e)) !== null; )
114
114
  s.push(r);
115
115
  return s;
116
- }, Fr = ae("HTMLFormElement"), qr = (t) => t.toLowerCase().replace(
116
+ }, Lr = ae("HTMLFormElement"), qr = (t) => t.toLowerCase().replace(
117
117
  /[-_\s]([a-z\d])(\w*)/g,
118
118
  function(r, s, i) {
119
119
  return s.toUpperCase() + i;
@@ -149,7 +149,7 @@ const Or = (t, e, r, { allOwnKeys: s } = {}) => (Ie(e, (i, o) => {
149
149
  }, Hr = () => {
150
150
  }, Vr = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
151
151
  function Yr(t) {
152
- return !!(t && re(t.append) && t[$t] === "FormData" && t[qe]);
152
+ return !!(t && re(t.append) && t[Dt] === "FormData" && t[qe]);
153
153
  }
154
154
  const Kr = (t) => {
155
155
  const e = new Array(10), r = (s, i) => {
@@ -179,15 +179,15 @@ const Kr = (t) => {
179
179
  re(xe.postMessage)
180
180
  ), Xr = typeof queueMicrotask < "u" ? queueMicrotask.bind(xe) : typeof process < "u" && process.nextTick || Wt, Zr = (t) => t != null && re(t[qe]), f = {
181
181
  isArray: we,
182
- isArrayBuffer: Nt,
182
+ isArrayBuffer: $t,
183
183
  isBuffer: Re,
184
- isFormData: Er,
184
+ isFormData: kr,
185
185
  isArrayBufferView: hr,
186
186
  isString: mr,
187
- isNumber: Lt,
187
+ isNumber: Ft,
188
188
  isBoolean: gr,
189
189
  isObject: Pe,
190
- isPlainObject: _e,
190
+ isPlainObject: Ue,
191
191
  isEmptyObject: yr,
192
192
  isReadableStream: Cr,
193
193
  isRequest: Tr,
@@ -200,8 +200,8 @@ const Kr = (t) => {
200
200
  isRegExp: Mr,
201
201
  isFunction: re,
202
202
  isStream: Sr,
203
- isURLSearchParams: kr,
204
- isTypedArray: $r,
203
+ isURLSearchParams: Er,
204
+ isTypedArray: Dr,
205
205
  isFileList: vr,
206
206
  forEach: Ie,
207
207
  merge: Ze,
@@ -209,14 +209,14 @@ const Kr = (t) => {
209
209
  trim: Ir,
210
210
  stripBOM: zr,
211
211
  inherits: Ar,
212
- toFlatObject: Ur,
212
+ toFlatObject: _r,
213
213
  kindOf: Me,
214
214
  kindOfTest: ae,
215
- endsWith: _r,
216
- toArray: Dr,
217
- forEachEntry: Nr,
218
- matchAll: Lr,
219
- isHTMLForm: Fr,
215
+ endsWith: Ur,
216
+ toArray: Nr,
217
+ forEachEntry: $r,
218
+ matchAll: Fr,
219
+ isHTMLForm: Lr,
220
220
  hasOwnProperty: xt,
221
221
  hasOwnProp: xt,
222
222
  // an alias to avoid ESLint no-prototype-builtins detection
@@ -226,7 +226,7 @@ const Kr = (t) => {
226
226
  toCamelCase: qr,
227
227
  noop: Hr,
228
228
  toFiniteNumber: Vr,
229
- findKey: Ft,
229
+ findKey: Lt,
230
230
  global: xe,
231
231
  isContextDefined: qt,
232
232
  isSpecCompliantForm: Yr,
@@ -237,10 +237,10 @@ const Kr = (t) => {
237
237
  asap: Xr,
238
238
  isIterable: Zr
239
239
  };
240
- function N(t, e, r, s, i) {
240
+ function $(t, e, r, s, i) {
241
241
  Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), r && (this.config = r), s && (this.request = s), i && (this.response = i, this.status = i.status ? i.status : null);
242
242
  }
243
- f.inherits(N, Error, {
243
+ f.inherits($, Error, {
244
244
  toJSON: function() {
245
245
  return {
246
246
  // Standard
@@ -261,7 +261,7 @@ f.inherits(N, Error, {
261
261
  };
262
262
  }
263
263
  });
264
- const Bt = N.prototype, Ht = {};
264
+ const Bt = $.prototype, Ht = {};
265
265
  [
266
266
  "ERR_BAD_OPTION_VALUE",
267
267
  "ERR_BAD_OPTION",
@@ -279,15 +279,15 @@ const Bt = N.prototype, Ht = {};
279
279
  ].forEach((t) => {
280
280
  Ht[t] = { value: t };
281
281
  });
282
- Object.defineProperties(N, Ht);
282
+ Object.defineProperties($, Ht);
283
283
  Object.defineProperty(Bt, "isAxiosError", { value: !0 });
284
- N.from = (t, e, r, s, i, o) => {
284
+ $.from = (t, e, r, s, i, o) => {
285
285
  const a = Object.create(Bt);
286
286
  f.toFlatObject(t, a, function(d) {
287
287
  return d !== Error.prototype;
288
288
  }, (p) => p !== "isAxiosError");
289
289
  const c = t && t.message ? t.message : "Error", h = e == null && t ? t.code : e;
290
- return N.call(a, c, h, r, s, i), t && a.cause == null && Object.defineProperty(a, "cause", { value: t, configurable: !0 }), a.name = t && t.name || "Error", o && Object.assign(a, o), a;
290
+ return $.call(a, c, h, r, s, i), t && a.cause == null && Object.defineProperty(a, "cause", { value: t, configurable: !0 }), a.name = t && t.name || "Error", o && Object.assign(a, o), a;
291
291
  };
292
292
  const Qr = null;
293
293
  function Qe(t) {
@@ -327,7 +327,7 @@ function Be(t, e, r) {
327
327
  if (f.isBoolean(u))
328
328
  return u.toString();
329
329
  if (!h && f.isBlob(u))
330
- throw new N("Blob is not supported. Use a Buffer instead.");
330
+ throw new $("Blob is not supported. Use a Buffer instead.");
331
331
  return f.isArrayBuffer(u) || f.isTypedArray(u) ? h && typeof Blob == "function" ? new Blob([u]) : Buffer.from(u) : u;
332
332
  }
333
333
  function d(u, w, x) {
@@ -578,7 +578,7 @@ const Oe = {
578
578
  return JSON.parse(e, this.parseReviver);
579
579
  } catch (c) {
580
580
  if (a)
581
- throw c.name === "SyntaxError" ? N.from(c, N.ERR_BAD_RESPONSE, this, null, this.response) : c;
581
+ throw c.name === "SyntaxError" ? $.from(c, $.ERR_BAD_RESPONSE, this, null, this.response) : c;
582
582
  }
583
583
  }
584
584
  return e;
@@ -635,11 +635,11 @@ const mn = f.toObjectSet([
635
635
  i = a.indexOf(":"), r = a.substring(0, i).trim().toLowerCase(), s = a.substring(i + 1).trim(), !(!r || e[r] && mn[r]) && (r === "set-cookie" ? e[r] ? e[r].push(s) : e[r] = [s] : e[r] = e[r] ? e[r] + ", " + s : s);
636
636
  }), e;
637
637
  }, yt = Symbol("internals");
638
- function Ee(t) {
638
+ function ke(t) {
639
639
  return t && String(t).trim().toLowerCase();
640
640
  }
641
- function De(t) {
642
- return t === !1 || t == null ? t : f.isArray(t) ? t.map(De) : String(t);
641
+ function Ne(t) {
642
+ return t === !1 || t == null ? t : f.isArray(t) ? t.map(Ne) : String(t);
643
643
  }
644
644
  function yn(t) {
645
645
  const e = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
@@ -680,11 +680,11 @@ let ne = class {
680
680
  set(e, r, s) {
681
681
  const i = this;
682
682
  function o(c, h, p) {
683
- const d = Ee(h);
683
+ const d = ke(h);
684
684
  if (!d)
685
685
  throw new Error("header name must be a non-empty string");
686
686
  const m = f.findKey(i, d);
687
- (!m || i[m] === void 0 || p === !0 || p === void 0 && i[m] !== !1) && (i[m || h] = De(c));
687
+ (!m || i[m] === void 0 || p === !0 || p === void 0 && i[m] !== !1) && (i[m || h] = Ne(c));
688
688
  }
689
689
  const a = (c, h) => f.forEach(c, (p, d) => o(p, d, h));
690
690
  if (f.isPlainObject(e) || e instanceof this.constructor)
@@ -704,7 +704,7 @@ let ne = class {
704
704
  return this;
705
705
  }
706
706
  get(e, r) {
707
- if (e = Ee(e), e) {
707
+ if (e = ke(e), e) {
708
708
  const s = f.findKey(this, e);
709
709
  if (s) {
710
710
  const i = this[s];
@@ -721,7 +721,7 @@ let ne = class {
721
721
  }
722
722
  }
723
723
  has(e, r) {
724
- if (e = Ee(e), e) {
724
+ if (e = ke(e), e) {
725
725
  const s = f.findKey(this, e);
726
726
  return !!(s && this[s] !== void 0 && (!r || Ye(this, this[s], s, r)));
727
727
  }
@@ -731,7 +731,7 @@ let ne = class {
731
731
  const s = this;
732
732
  let i = !1;
733
733
  function o(a) {
734
- if (a = Ee(a), a) {
734
+ if (a = ke(a), a) {
735
735
  const c = f.findKey(s, a);
736
736
  c && (!r || Ye(s, s[c], c, r)) && (delete s[c], i = !0);
737
737
  }
@@ -752,11 +752,11 @@ let ne = class {
752
752
  return f.forEach(this, (i, o) => {
753
753
  const a = f.findKey(s, o);
754
754
  if (a) {
755
- r[a] = De(i), delete r[o];
755
+ r[a] = Ne(i), delete r[o];
756
756
  return;
757
757
  }
758
758
  const c = e ? wn(o) : String(o).trim();
759
- c !== o && delete r[o], r[c] = De(i), s[c] = !0;
759
+ c !== o && delete r[o], r[c] = Ne(i), s[c] = !0;
760
760
  }), this;
761
761
  }
762
762
  concat(...e) {
@@ -793,7 +793,7 @@ let ne = class {
793
793
  accessors: {}
794
794
  }).accessors, i = this.prototype;
795
795
  function o(a) {
796
- const c = Ee(a);
796
+ const c = ke(a);
797
797
  s[c] || (jn(i, a), s[c] = !0);
798
798
  }
799
799
  return f.isArray(e) ? e.forEach(o) : o(e), this;
@@ -821,16 +821,16 @@ function Xt(t) {
821
821
  return !!(t && t.__CANCEL__);
822
822
  }
823
823
  function je(t, e, r) {
824
- N.call(this, t ?? "canceled", N.ERR_CANCELED, e, r), this.name = "CanceledError";
824
+ $.call(this, t ?? "canceled", $.ERR_CANCELED, e, r), this.name = "CanceledError";
825
825
  }
826
- f.inherits(je, N, {
826
+ f.inherits(je, $, {
827
827
  __CANCEL__: !0
828
828
  });
829
829
  function Zt(t, e, r) {
830
830
  const s = r.config.validateStatus;
831
- !r.status || !s || s(r.status) ? t(r) : e(new N(
831
+ !r.status || !s || s(r.status) ? t(r) : e(new $(
832
832
  "Request failed with status code " + r.status,
833
- [N.ERR_BAD_REQUEST, N.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
833
+ [$.ERR_BAD_REQUEST, $.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
834
834
  r.config,
835
835
  r.request,
836
836
  r
@@ -856,7 +856,7 @@ function Sn(t, e) {
856
856
  return O ? Math.round(P * 1e3 / O) : void 0;
857
857
  };
858
858
  }
859
- function En(t, e) {
859
+ function kn(t, e) {
860
860
  let r = 0, s = 1e3 / e, i, o;
861
861
  const a = (p, d = Date.now()) => {
862
862
  r = d, i = null, o && (clearTimeout(o), o = null), t(...p);
@@ -868,10 +868,10 @@ function En(t, e) {
868
868
  }, s - m)));
869
869
  }, () => i && a(i)];
870
870
  }
871
- const Fe = (t, e, r = 3) => {
871
+ const Le = (t, e, r = 3) => {
872
872
  let s = 0;
873
873
  const i = Sn(50, 250);
874
- return En((o) => {
874
+ return kn((o) => {
875
875
  const a = o.loaded, c = o.lengthComputable ? o.total : void 0, h = a - s, p = i(h), d = a <= c;
876
876
  s = a;
877
877
  const m = {
@@ -894,7 +894,7 @@ const Fe = (t, e, r = 3) => {
894
894
  total: t,
895
895
  loaded: s
896
896
  }), e[1]];
897
- }, wt = (t) => (...e) => f.asap(() => t(...e)), kn = ee.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (r) => (r = new URL(r, ee.origin), t.protocol === r.protocol && t.host === r.host && (e || t.port === r.port)))(
897
+ }, wt = (t) => (...e) => f.asap(() => t(...e)), En = ee.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (r) => (r = new URL(r, ee.origin), t.protocol === r.protocol && t.host === r.host && (e || t.port === r.port)))(
898
898
  new URL(ee.origin),
899
899
  ee.navigator && /(msie|trident)/i.test(ee.navigator.userAgent)
900
900
  ) : () => !0, Cn = ee.hasStandardBrowserEnv ? (
@@ -1015,7 +1015,7 @@ const er = (t) => {
1015
1015
  });
1016
1016
  }
1017
1017
  }
1018
- if (ee.hasStandardBrowserEnv && (s && f.isFunction(s) && (s = s(e)), s || s !== !1 && kn(e.url))) {
1018
+ if (ee.hasStandardBrowserEnv && (s && f.isFunction(s) && (s = s(e)), s || s !== !1 && En(e.url))) {
1019
1019
  const h = i && o && Cn.read(o);
1020
1020
  h && a.set(i, h);
1021
1021
  }
@@ -1036,7 +1036,7 @@ const er = (t) => {
1036
1036
  return;
1037
1037
  const A = ne.from(
1038
1038
  "getAllResponseHeaders" in x && x.getAllResponseHeaders()
1039
- ), U = {
1039
+ ), _ = {
1040
1040
  data: !c || c === "text" || c === "json" ? x.responseText : x.response,
1041
1041
  status: x.status,
1042
1042
  statusText: x.statusText,
@@ -1048,32 +1048,32 @@ const er = (t) => {
1048
1048
  r(v), w();
1049
1049
  }, function(v) {
1050
1050
  s(v), w();
1051
- }, U), x = null;
1051
+ }, _), x = null;
1052
1052
  }
1053
1053
  "onloadend" in x ? x.onloadend = C : x.onreadystatechange = function() {
1054
1054
  !x || x.readyState !== 4 || x.status === 0 && !(x.responseURL && x.responseURL.indexOf("file:") === 0) || setTimeout(C);
1055
1055
  }, x.onabort = function() {
1056
- x && (s(new N("Request aborted", N.ECONNABORTED, t, x)), x = null);
1056
+ x && (s(new $("Request aborted", $.ECONNABORTED, t, x)), x = null);
1057
1057
  }, x.onerror = function(y) {
1058
- const U = y && y.message ? y.message : "Network Error", g = new N(U, N.ERR_NETWORK, t, x);
1058
+ const _ = y && y.message ? y.message : "Network Error", g = new $(_, $.ERR_NETWORK, t, x);
1059
1059
  g.event = y || null, s(g), x = null;
1060
1060
  }, x.ontimeout = function() {
1061
1061
  let y = i.timeout ? "timeout of " + i.timeout + "ms exceeded" : "timeout exceeded";
1062
- const U = i.transitional || Jt;
1063
- i.timeoutErrorMessage && (y = i.timeoutErrorMessage), s(new N(
1062
+ const _ = i.transitional || Jt;
1063
+ i.timeoutErrorMessage && (y = i.timeoutErrorMessage), s(new $(
1064
1064
  y,
1065
- U.clarifyTimeoutError ? N.ETIMEDOUT : N.ECONNABORTED,
1065
+ _.clarifyTimeoutError ? $.ETIMEDOUT : $.ECONNABORTED,
1066
1066
  t,
1067
1067
  x
1068
1068
  )), x = null;
1069
- }, o === void 0 && a.setContentType(null), "setRequestHeader" in x && f.forEach(a.toJSON(), function(y, U) {
1070
- x.setRequestHeader(U, y);
1071
- }), f.isUndefined(i.withCredentials) || (x.withCredentials = !!i.withCredentials), c && c !== "json" && (x.responseType = i.responseType), p && ([P, u] = Fe(p, !0), x.addEventListener("progress", P)), h && x.upload && ([m, O] = Fe(h), x.upload.addEventListener("progress", m), x.upload.addEventListener("loadend", O)), (i.cancelToken || i.signal) && (d = (A) => {
1069
+ }, o === void 0 && a.setContentType(null), "setRequestHeader" in x && f.forEach(a.toJSON(), function(y, _) {
1070
+ x.setRequestHeader(_, y);
1071
+ }), f.isUndefined(i.withCredentials) || (x.withCredentials = !!i.withCredentials), c && c !== "json" && (x.responseType = i.responseType), p && ([P, u] = Le(p, !0), x.addEventListener("progress", P)), h && x.upload && ([m, O] = Le(h), x.upload.addEventListener("progress", m), x.upload.addEventListener("loadend", O)), (i.cancelToken || i.signal) && (d = (A) => {
1072
1072
  x && (s(!A || A.type ? new je(null, t, x) : A), x.abort(), x = null);
1073
1073
  }, i.cancelToken && i.cancelToken.subscribe(d), i.signal && (i.signal.aborted ? d() : i.signal.addEventListener("abort", d)));
1074
1074
  const T = vn(i.url);
1075
1075
  if (T && ee.protocols.indexOf(T) === -1) {
1076
- s(new N("Unsupported protocol " + T + ":", N.ERR_BAD_REQUEST, t));
1076
+ s(new $("Unsupported protocol " + T + ":", $.ERR_BAD_REQUEST, t));
1077
1077
  return;
1078
1078
  }
1079
1079
  x.send(o || null);
@@ -1086,11 +1086,11 @@ const er = (t) => {
1086
1086
  if (!i) {
1087
1087
  i = !0, c();
1088
1088
  const d = p instanceof Error ? p : this.reason;
1089
- s.abort(d instanceof N ? d : new je(d instanceof Error ? d.message : d));
1089
+ s.abort(d instanceof $ ? d : new je(d instanceof Error ? d.message : d));
1090
1090
  }
1091
1091
  };
1092
1092
  let a = e && setTimeout(() => {
1093
- a = null, o(new N(`timeout ${e} of ms exceeded`, N.ETIMEDOUT));
1093
+ a = null, o(new $(`timeout ${e} of ms exceeded`, $.ETIMEDOUT));
1094
1094
  }, e);
1095
1095
  const c = () => {
1096
1096
  t && (a && clearTimeout(a), a = null, t.forEach((p) => {
@@ -1111,9 +1111,9 @@ const er = (t) => {
1111
1111
  for (; s < r; )
1112
1112
  i = s + e, yield t.slice(s, i), s = i;
1113
1113
  }, An = async function* (t, e) {
1114
- for await (const r of Un(t))
1114
+ for await (const r of _n(t))
1115
1115
  yield* zn(r, e);
1116
- }, Un = async function* (t) {
1116
+ }, _n = async function* (t) {
1117
1117
  if (t[Symbol.asyncIterator]) {
1118
1118
  yield* t;
1119
1119
  return;
@@ -1158,29 +1158,29 @@ const er = (t) => {
1158
1158
  }, {
1159
1159
  highWaterMark: 2
1160
1160
  });
1161
- }, St = 64 * 1024, { isFunction: Ae } = f, _n = (({ Request: t, Response: e }) => ({
1161
+ }, St = 64 * 1024, { isFunction: Ae } = f, Un = (({ Request: t, Response: e }) => ({
1162
1162
  Request: t,
1163
1163
  Response: e
1164
1164
  }))(f.global), {
1165
- ReadableStream: Et,
1166
- TextEncoder: kt
1165
+ ReadableStream: kt,
1166
+ TextEncoder: Et
1167
1167
  } = f.global, Ct = (t, ...e) => {
1168
1168
  try {
1169
1169
  return !!t(...e);
1170
1170
  } catch {
1171
1171
  return !1;
1172
1172
  }
1173
- }, Dn = (t) => {
1173
+ }, Nn = (t) => {
1174
1174
  t = f.merge.call({
1175
1175
  skipUndefined: !0
1176
- }, _n, t);
1176
+ }, Un, t);
1177
1177
  const { fetch: e, Request: r, Response: s } = t, i = e ? Ae(e) : typeof fetch == "function", o = Ae(r), a = Ae(s);
1178
1178
  if (!i)
1179
1179
  return !1;
1180
- const c = i && Ae(Et), h = i && (typeof kt == "function" ? /* @__PURE__ */ ((u) => (w) => u.encode(w))(new kt()) : async (u) => new Uint8Array(await new r(u).arrayBuffer())), p = o && c && Ct(() => {
1180
+ const c = i && Ae(kt), h = i && (typeof Et == "function" ? /* @__PURE__ */ ((u) => (w) => u.encode(w))(new Et()) : async (u) => new Uint8Array(await new r(u).arrayBuffer())), p = o && c && Ct(() => {
1181
1181
  let u = !1;
1182
1182
  const w = new r(ee.origin, {
1183
- body: new Et(),
1183
+ body: new kt(),
1184
1184
  method: "POST",
1185
1185
  get duplex() {
1186
1186
  return u = !0, "half";
@@ -1195,7 +1195,7 @@ const er = (t) => {
1195
1195
  let C = w && w[u];
1196
1196
  if (C)
1197
1197
  return C.call(w);
1198
- throw new N(`Response type '${u}' is not supported`, N.ERR_NOT_SUPPORT, x);
1198
+ throw new $(`Response type '${u}' is not supported`, $.ERR_NOT_SUPPORT, x);
1199
1199
  });
1200
1200
  });
1201
1201
  const P = async (u) => {
@@ -1224,55 +1224,55 @@ const er = (t) => {
1224
1224
  signal: T,
1225
1225
  cancelToken: A,
1226
1226
  timeout: y,
1227
- onDownloadProgress: U,
1227
+ onDownloadProgress: _,
1228
1228
  onUploadProgress: g,
1229
1229
  responseType: v,
1230
- headers: L,
1231
- withCredentials: _ = "same-origin",
1230
+ headers: F,
1231
+ withCredentials: U = "same-origin",
1232
1232
  fetchOptions: M
1233
1233
  } = er(u), X = e || fetch;
1234
1234
  v = v ? (v + "").toLowerCase() : "text";
1235
- let k = On([T, A && A.toAbortSignal()], y), V = null;
1236
- const z = k && k.unsubscribe && (() => {
1237
- k.unsubscribe();
1235
+ let E = On([T, A && A.toAbortSignal()], y), V = null;
1236
+ const z = E && E.unsubscribe && (() => {
1237
+ E.unsubscribe();
1238
1238
  });
1239
1239
  let I;
1240
1240
  try {
1241
- if (g && p && x !== "get" && x !== "head" && (I = await O(L, C)) !== 0) {
1241
+ if (g && p && x !== "get" && x !== "head" && (I = await O(F, C)) !== 0) {
1242
1242
  let l = new r(w, {
1243
1243
  method: "POST",
1244
1244
  body: C,
1245
1245
  duplex: "half"
1246
1246
  }), b;
1247
- if (f.isFormData(C) && (b = l.headers.get("content-type")) && L.setContentType(b), l.body) {
1247
+ if (f.isFormData(C) && (b = l.headers.get("content-type")) && F.setContentType(b), l.body) {
1248
1248
  const [S, j] = bt(
1249
1249
  I,
1250
- Fe(wt(g))
1250
+ Le(wt(g))
1251
1251
  );
1252
1252
  C = vt(l.body, St, S, j);
1253
1253
  }
1254
1254
  }
1255
- f.isString(_) || (_ = _ ? "include" : "omit");
1255
+ f.isString(U) || (U = U ? "include" : "omit");
1256
1256
  const W = o && "credentials" in r.prototype, Z = {
1257
1257
  ...M,
1258
- signal: k,
1258
+ signal: E,
1259
1259
  method: x.toUpperCase(),
1260
- headers: L.normalize().toJSON(),
1260
+ headers: F.normalize().toJSON(),
1261
1261
  body: C,
1262
1262
  duplex: "half",
1263
- credentials: W ? _ : void 0
1263
+ credentials: W ? U : void 0
1264
1264
  };
1265
1265
  V = o && new r(w, Z);
1266
1266
  let B = await (o ? X(V, M) : X(w, Z));
1267
1267
  const K = d && (v === "stream" || v === "response");
1268
- if (d && (U || K && z)) {
1268
+ if (d && (_ || K && z)) {
1269
1269
  const l = {};
1270
1270
  ["status", "statusText", "headers"].forEach((G) => {
1271
1271
  l[G] = B[G];
1272
1272
  });
1273
- const b = f.toFiniteNumber(B.headers.get("content-length")), [S, j] = U && bt(
1273
+ const b = f.toFiniteNumber(B.headers.get("content-length")), [S, j] = _ && bt(
1274
1274
  b,
1275
- Fe(wt(U), !0)
1275
+ Le(wt(_), !0)
1276
1276
  ) || [];
1277
1277
  B = new s(
1278
1278
  vt(B.body, St, S, () => {
@@ -1282,10 +1282,10 @@ const er = (t) => {
1282
1282
  );
1283
1283
  }
1284
1284
  v = v || "text";
1285
- let F = await m[f.findKey(m, v) || "text"](B, u);
1285
+ let L = await m[f.findKey(m, v) || "text"](B, u);
1286
1286
  return !K && z && z(), await new Promise((l, b) => {
1287
1287
  Zt(l, b, {
1288
- data: F,
1288
+ data: L,
1289
1289
  headers: ne.from(B.headers),
1290
1290
  status: B.status,
1291
1291
  statusText: B.statusText,
@@ -1295,23 +1295,23 @@ const er = (t) => {
1295
1295
  });
1296
1296
  } catch (W) {
1297
1297
  throw z && z(), W && W.name === "TypeError" && /Load failed|fetch/i.test(W.message) ? Object.assign(
1298
- new N("Network Error", N.ERR_NETWORK, u, V),
1298
+ new $("Network Error", $.ERR_NETWORK, u, V),
1299
1299
  {
1300
1300
  cause: W.cause || W
1301
1301
  }
1302
- ) : N.from(W, W && W.code, u, V);
1302
+ ) : $.from(W, W && W.code, u, V);
1303
1303
  }
1304
1304
  };
1305
- }, $n = /* @__PURE__ */ new Map(), tr = (t) => {
1305
+ }, Dn = /* @__PURE__ */ new Map(), tr = (t) => {
1306
1306
  let e = t ? t.env : {};
1307
1307
  const { fetch: r, Request: s, Response: i } = e, o = [
1308
1308
  s,
1309
1309
  i,
1310
1310
  r
1311
1311
  ];
1312
- let a = o.length, c = a, h, p, d = $n;
1312
+ let a = o.length, c = a, h, p, d = Dn;
1313
1313
  for (; c--; )
1314
- h = o[c], p = d.get(h), p === void 0 && d.set(h, p = c ? /* @__PURE__ */ new Map() : Dn(e)), d = p;
1314
+ h = o[c], p = d.get(h), p === void 0 && d.set(h, p = c ? /* @__PURE__ */ new Map() : Nn(e)), d = p;
1315
1315
  return p;
1316
1316
  };
1317
1317
  tr();
@@ -1331,7 +1331,7 @@ f.forEach(tt, (t, e) => {
1331
1331
  Object.defineProperty(t, "adapterName", { value: e });
1332
1332
  }
1333
1333
  });
1334
- const Tt = (t) => `- ${t}`, Nn = (t) => f.isFunction(t) || t === null || t === !1, rr = {
1334
+ const Tt = (t) => `- ${t}`, $n = (t) => f.isFunction(t) || t === null || t === !1, rr = {
1335
1335
  getAdapter: (t, e) => {
1336
1336
  t = f.isArray(t) ? t : [t];
1337
1337
  const { length: r } = t;
@@ -1340,8 +1340,8 @@ const Tt = (t) => `- ${t}`, Nn = (t) => f.isFunction(t) || t === null || t === !
1340
1340
  for (let a = 0; a < r; a++) {
1341
1341
  s = t[a];
1342
1342
  let c;
1343
- if (i = s, !Nn(s) && (i = tt[(c = String(s)).toLowerCase()], i === void 0))
1344
- throw new N(`Unknown adapter '${c}'`);
1343
+ if (i = s, !$n(s) && (i = tt[(c = String(s)).toLowerCase()], i === void 0))
1344
+ throw new $(`Unknown adapter '${c}'`);
1345
1345
  if (i && (f.isFunction(i) || (i = i.get(e))))
1346
1346
  break;
1347
1347
  o[c || "#" + a] = i;
@@ -1353,7 +1353,7 @@ const Tt = (t) => `- ${t}`, Nn = (t) => f.isFunction(t) || t === null || t === !
1353
1353
  let c = r ? a.length > 1 ? `since :
1354
1354
  ` + a.map(Tt).join(`
1355
1355
  `) : " " + Tt(a[0]) : "as no adapter specified";
1356
- throw new N(
1356
+ throw new $(
1357
1357
  "There is no suitable adapter to dispatch the request " + c,
1358
1358
  "ERR_NOT_SUPPORT"
1359
1359
  );
@@ -1397,9 +1397,9 @@ He.transitional = function(e, r, s) {
1397
1397
  }
1398
1398
  return (o, a, c) => {
1399
1399
  if (e === !1)
1400
- throw new N(
1400
+ throw new $(
1401
1401
  i(a, " has been removed" + (r ? " in " + r : "")),
1402
- N.ERR_DEPRECATED
1402
+ $.ERR_DEPRECATED
1403
1403
  );
1404
1404
  return r && !Pt[a] && (Pt[a] = !0, console.warn(
1405
1405
  i(
@@ -1412,9 +1412,9 @@ He.transitional = function(e, r, s) {
1412
1412
  He.spelling = function(e) {
1413
1413
  return (r, s) => (console.warn(`${s} is likely a misspelling of ${e}`), !0);
1414
1414
  };
1415
- function Ln(t, e, r) {
1415
+ function Fn(t, e, r) {
1416
1416
  if (typeof t != "object")
1417
- throw new N("options must be an object", N.ERR_BAD_OPTION_VALUE);
1417
+ throw new $("options must be an object", $.ERR_BAD_OPTION_VALUE);
1418
1418
  const s = Object.keys(t);
1419
1419
  let i = s.length;
1420
1420
  for (; i-- > 0; ) {
@@ -1422,17 +1422,17 @@ function Ln(t, e, r) {
1422
1422
  if (a) {
1423
1423
  const c = t[o], h = c === void 0 || a(c, o, t);
1424
1424
  if (h !== !0)
1425
- throw new N("option " + o + " must be " + h, N.ERR_BAD_OPTION_VALUE);
1425
+ throw new $("option " + o + " must be " + h, $.ERR_BAD_OPTION_VALUE);
1426
1426
  continue;
1427
1427
  }
1428
1428
  if (r !== !0)
1429
- throw new N("Unknown option " + o, N.ERR_BAD_OPTION);
1429
+ throw new $("Unknown option " + o, $.ERR_BAD_OPTION);
1430
1430
  }
1431
1431
  }
1432
- const $e = {
1433
- assertOptions: Ln,
1432
+ const De = {
1433
+ assertOptions: Fn,
1434
1434
  validators: He
1435
- }, ce = $e.validators;
1435
+ }, ce = De.validators;
1436
1436
  let he = class {
1437
1437
  constructor(e) {
1438
1438
  this.defaults = e || {}, this.interceptors = {
@@ -1468,16 +1468,16 @@ let he = class {
1468
1468
  _request(e, r) {
1469
1469
  typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r = me(this.defaults, r);
1470
1470
  const { transitional: s, paramsSerializer: i, headers: o } = r;
1471
- s !== void 0 && $e.assertOptions(s, {
1471
+ s !== void 0 && De.assertOptions(s, {
1472
1472
  silentJSONParsing: ce.transitional(ce.boolean),
1473
1473
  forcedJSONParsing: ce.transitional(ce.boolean),
1474
1474
  clarifyTimeoutError: ce.transitional(ce.boolean)
1475
1475
  }, !1), i != null && (f.isFunction(i) ? r.paramsSerializer = {
1476
1476
  serialize: i
1477
- } : $e.assertOptions(i, {
1477
+ } : De.assertOptions(i, {
1478
1478
  encode: ce.function,
1479
1479
  serialize: ce.function
1480
- }, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), $e.assertOptions(r, {
1480
+ }, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), De.assertOptions(r, {
1481
1481
  baseUrl: ce.spelling("baseURL"),
1482
1482
  withXsrfToken: ce.spelling("withXSRFToken")
1483
1483
  }, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
@@ -1557,7 +1557,7 @@ f.forEach(["post", "put", "patch"], function(e) {
1557
1557
  }
1558
1558
  he.prototype[e] = r(), he.prototype[e + "Form"] = r(!0);
1559
1559
  });
1560
- let Fn = class sr {
1560
+ let Ln = class sr {
1561
1561
  constructor(e) {
1562
1562
  if (typeof e != "function")
1563
1563
  throw new TypeError("executor must be a function.");
@@ -1707,7 +1707,7 @@ Object.entries(rt).forEach(([t, e]) => {
1707
1707
  rt[e] = t;
1708
1708
  });
1709
1709
  function ir(t) {
1710
- const e = new he(t), r = Dt(he.prototype.request, e);
1710
+ const e = new he(t), r = Nt(he.prototype.request, e);
1711
1711
  return f.extend(r, he.prototype, e, { allOwnKeys: !0 }), f.extend(r, e, null, { allOwnKeys: !0 }), r.create = function(i) {
1712
1712
  return ir(me(t, i));
1713
1713
  }, r;
@@ -1715,11 +1715,11 @@ function ir(t) {
1715
1715
  const J = ir(Oe);
1716
1716
  J.Axios = he;
1717
1717
  J.CanceledError = je;
1718
- J.CancelToken = Fn;
1718
+ J.CancelToken = Ln;
1719
1719
  J.isCancel = Xt;
1720
1720
  J.VERSION = nr;
1721
1721
  J.toFormData = Be;
1722
- J.AxiosError = N;
1722
+ J.AxiosError = $;
1723
1723
  J.Cancel = J.CanceledError;
1724
1724
  J.all = function(e) {
1725
1725
  return Promise.all(e);
@@ -1781,25 +1781,25 @@ class ui {
1781
1781
  * @param data Optional request body
1782
1782
  * @param extraHeaders Optional custom headers
1783
1783
  */
1784
- async request(e, r, s, i = {}) {
1784
+ async request(e, r, s, i = {}, o = !1) {
1785
1785
  try {
1786
- const o = {
1786
+ const a = {
1787
1787
  ...this.appId ? { appId: this.appId } : {},
1788
1788
  ...s || {}
1789
1789
  };
1790
1790
  return (await this.client.request({
1791
1791
  url: r,
1792
1792
  method: e,
1793
- data: o,
1794
- headers: i
1793
+ data: a,
1794
+ headers: i,
1795
+ withCredentials: o
1796
+ // 👈 override axios default
1795
1797
  })).data;
1796
- } catch (o) {
1797
- throw J.isAxiosError(o) ? {
1798
- message: o.response?.data?.message || o.message || "Request failed",
1799
- status: o.response?.status ?? 0
1800
- } : {
1801
- message: o.message || "Unexpected error occurred"
1802
- };
1798
+ } catch (a) {
1799
+ throw J.isAxiosError(a) ? {
1800
+ message: a.response?.data?.message || a.message || "Request failed",
1801
+ status: a.response?.status ?? 0
1802
+ } : { message: a.message || "Unexpected error occurred" };
1803
1803
  }
1804
1804
  }
1805
1805
  // ================= USERS =================
@@ -1989,16 +1989,18 @@ class ui {
1989
1989
  );
1990
1990
  }
1991
1991
  // ================= USER EXTRA DATA =================
1992
- async searchAllUsersData(e) {
1993
- if (!this.appId) throw new Error("searchAllUsersData: appId missing");
1994
- const r = new URLSearchParams(e).toString();
1995
- return this.request("GET", `/users/${this.appId}/data/search?${r}`);
1996
- }
1997
1992
  async searchUserData(e) {
1998
1993
  const { userId: r, ...s } = e;
1999
1994
  if (!r) throw new Error("userId required");
2000
1995
  const i = new URLSearchParams(s).toString();
2001
- return this.request("GET", `/users/${r}/data/search?${i}`);
1996
+ return this.request(
1997
+ "GET",
1998
+ `/users/${r}/data/search?${i}`,
1999
+ void 0,
2000
+ {},
2001
+ !1
2002
+ // 👈 no credentials
2003
+ );
2002
2004
  }
2003
2005
  /**
2004
2006
  * Search user's extra data by dynamic reference keys
@@ -2021,45 +2023,15 @@ class ui {
2021
2023
  {}
2022
2024
  )
2023
2025
  ).toString();
2024
- return this.request("GET", `/users/${r}/data/searchbyref?${i}`);
2025
- }
2026
- /**
2027
- * 🌐 Search ALL users' data by dynamic keys for the current app
2028
- * @example
2029
- * sdk.searchAllUsersDataByKeys({
2030
- * category: "orders",
2031
- * shopId: 12,
2032
- * productId: 99,
2033
- * status: "active",
2034
- * q: "iphone" // optional keyword search
2035
- * })
2036
- */
2037
- async searchAllUsersDataByKeys(e) {
2038
- const r = this.appId;
2039
- if (!r)
2040
- throw new Error(
2041
- "searchAllUsersDataByKeys: 'appId' is required on SDK initialization"
2042
- );
2043
- const s = new URLSearchParams(
2044
- Object.entries(e).reduce(
2045
- (i, [o, a]) => (a != null && (i[o] = String(a)), i),
2046
- {}
2047
- )
2048
- ).toString();
2049
2026
  return this.request(
2050
2027
  "GET",
2051
- `/users/${encodeURIComponent(r)}/data/searchbyref/all?${s}`
2028
+ `/users/${r}/data/searchbyref?${i}`,
2029
+ void 0,
2030
+ {},
2031
+ !1
2032
+ // 👈 no credentials
2052
2033
  );
2053
2034
  }
2054
- /**
2055
- * Fetch ALL users' merged data for a specific app
2056
- * @param params requires appId
2057
- */
2058
- async getAllUsersData() {
2059
- if (!this.appId)
2060
- throw new Error("getAllUsersData: SDK 'appId' is missing in config");
2061
- return this.request("GET", `/users/all-data/${this.appId}/data`);
2062
- }
2063
2035
  /**
2064
2036
  * Get all data objects for a user
2065
2037
  * @param params requires userId
@@ -2067,7 +2039,14 @@ class ui {
2067
2039
  async getUserData(e) {
2068
2040
  const { userId: r } = e;
2069
2041
  if (!r) throw new Error("getUserData: 'userId' is required");
2070
- return this.request("GET", `/users/${r}/data`);
2042
+ return this.request(
2043
+ "GET",
2044
+ `/users/${r}/data`,
2045
+ void 0,
2046
+ {},
2047
+ !1
2048
+ // 👈 no credentials
2049
+ );
2071
2050
  }
2072
2051
  /**
2073
2052
  * Get a single data object for a user
@@ -2077,7 +2056,14 @@ class ui {
2077
2056
  const { userId: r, dataId: s } = e;
2078
2057
  if (!r || !s)
2079
2058
  throw new Error("getSingleUserData: 'userId' and 'dataId' are required");
2080
- return this.request("GET", `/users/${r}/data/${s}`);
2059
+ return this.request(
2060
+ "GET",
2061
+ `/users/${r}/data/${s}`,
2062
+ void 0,
2063
+ {},
2064
+ !1
2065
+ // 👈 no credentials
2066
+ );
2081
2067
  }
2082
2068
  /**
2083
2069
  * Add a new data object to a user
@@ -2089,10 +2075,17 @@ class ui {
2089
2075
  if (!s)
2090
2076
  throw new Error("addUserData: 'dataCategory' is required");
2091
2077
  if (!i) throw new Error("addUserData: 'data' is required");
2092
- return this.request("POST", `/users/${r}/data`, {
2093
- dataCategory: s,
2094
- ...i
2095
- });
2078
+ return this.request(
2079
+ "POST",
2080
+ `/users/${r}/data`,
2081
+ {
2082
+ dataCategory: s,
2083
+ ...i
2084
+ },
2085
+ {},
2086
+ !1
2087
+ // 👈 no credentials
2088
+ );
2096
2089
  }
2097
2090
  /**
2098
2091
  * Update a data object by its id
@@ -2103,7 +2096,14 @@ class ui {
2103
2096
  if (!r || !s)
2104
2097
  throw new Error("updateUserData: 'userId' and 'dataId' are required");
2105
2098
  if (!i) throw new Error("updateUserData: 'data' is required");
2106
- return this.request("PUT", `/users/${r}/data/${s}`, i);
2099
+ return this.request(
2100
+ "PUT",
2101
+ `/users/${r}/data/${s}`,
2102
+ i,
2103
+ {},
2104
+ !1
2105
+ // 👈 no credentials
2106
+ );
2107
2107
  }
2108
2108
  /**
2109
2109
  * Delete a data object by its id
@@ -2113,7 +2113,14 @@ class ui {
2113
2113
  const { userId: r, dataId: s } = e;
2114
2114
  if (!r || !s)
2115
2115
  throw new Error("deleteUserData: 'userId' and 'dataId' are required");
2116
- return this.request("DELETE", `/users/${r}/data/${s}`);
2116
+ return this.request(
2117
+ "DELETE",
2118
+ `/users/${r}/data/${s}`,
2119
+ void 0,
2120
+ {},
2121
+ !1
2122
+ // 👈 no credentials
2123
+ );
2117
2124
  }
2118
2125
  // ================= APP DATA =================
2119
2126
  /**
@@ -2214,7 +2221,7 @@ class ui {
2214
2221
  ))?.data;
2215
2222
  }
2216
2223
  }
2217
- var Ue = { exports: {} }, ke = {};
2224
+ var _e = { exports: {} }, Ee = {};
2218
2225
  /**
2219
2226
  * @license React
2220
2227
  * react-jsx-runtime.production.js
@@ -2226,7 +2233,7 @@ var Ue = { exports: {} }, ke = {};
2226
2233
  */
2227
2234
  var It;
2228
2235
  function Wn() {
2229
- if (It) return ke;
2236
+ if (It) return Ee;
2230
2237
  It = 1;
2231
2238
  var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
2232
2239
  function r(s, i, o) {
@@ -2244,7 +2251,7 @@ function Wn() {
2244
2251
  props: o
2245
2252
  };
2246
2253
  }
2247
- return ke.Fragment = e, ke.jsx = r, ke.jsxs = r, ke;
2254
+ return Ee.Fragment = e, Ee.jsx = r, Ee.jsxs = r, Ee;
2248
2255
  }
2249
2256
  var Ce = {};
2250
2257
  /**
@@ -2288,12 +2295,12 @@ function Bn() {
2288
2295
  return l.displayName || "Context";
2289
2296
  case A:
2290
2297
  return (l._context.displayName || "Context") + ".Consumer";
2291
- case U:
2298
+ case _:
2292
2299
  var b = l.render;
2293
2300
  return l = l.displayName, l || (l = b.displayName || b.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
2294
- case L:
2301
+ case F:
2295
2302
  return b = l.displayName || null, b !== null ? b : t(l.type) || "Memo";
2296
- case _:
2303
+ case U:
2297
2304
  b = l._payload, l = l._init;
2298
2305
  try {
2299
2306
  return t(l(b));
@@ -2324,7 +2331,7 @@ function Bn() {
2324
2331
  }
2325
2332
  function s(l) {
2326
2333
  if (l === x) return "<>";
2327
- if (typeof l == "object" && l !== null && l.$$typeof === _)
2334
+ if (typeof l == "object" && l !== null && l.$$typeof === U)
2328
2335
  return "<...>";
2329
2336
  try {
2330
2337
  var b = t(l);
@@ -2334,7 +2341,7 @@ function Bn() {
2334
2341
  }
2335
2342
  }
2336
2343
  function i() {
2337
- var l = k.A;
2344
+ var l = E.A;
2338
2345
  return l === null ? null : l.getOwner();
2339
2346
  }
2340
2347
  function o() {
@@ -2416,7 +2423,7 @@ function Bn() {
2416
2423
  var oe = Object.keys(b).filter(function(Ve) {
2417
2424
  return Ve !== "key";
2418
2425
  });
2419
- j = 0 < oe.length ? "{key: someKey, " + oe.join(": ..., ") + ": ...}" : "{key: someKey}", F[Y + j] || (oe = 0 < oe.length ? "{" + oe.join(": ..., ") + ": ...}" : "{}", console.error(
2426
+ j = 0 < oe.length ? "{key: someKey, " + oe.join(": ..., ") + ": ...}" : "{key: someKey}", L[Y + j] || (oe = 0 < oe.length ? "{" + oe.join(": ..., ") + ": ...}" : "{}", console.error(
2420
2427
  `A props object containing a "key" prop is being spread into JSX:
2421
2428
  let props = %s;
2422
2429
  <%s {...props} />
@@ -2427,7 +2434,7 @@ React keys must be passed directly to JSX without using spread:
2427
2434
  Y,
2428
2435
  oe,
2429
2436
  Y
2430
- ), F[Y + j] = !0);
2437
+ ), L[Y + j] = !0);
2431
2438
  }
2432
2439
  if (Y = null, S !== void 0 && (r(S), Y = "" + S), a(b) && (r(b.key), Y = "" + b.key), "key" in b) {
2433
2440
  S = {};
@@ -2447,12 +2454,12 @@ React keys must be passed directly to JSX without using spread:
2447
2454
  );
2448
2455
  }
2449
2456
  function m(l) {
2450
- P(l) ? l._store && (l._store.validated = 1) : typeof l == "object" && l !== null && l.$$typeof === _ && (l._payload.status === "fulfilled" ? P(l._payload.value) && l._payload.value._store && (l._payload.value._store.validated = 1) : l._store && (l._store.validated = 1));
2457
+ P(l) ? l._store && (l._store.validated = 1) : typeof l == "object" && l !== null && l.$$typeof === U && (l._payload.status === "fulfilled" ? P(l._payload.value) && l._payload.value._store && (l._payload.value._store.validated = 1) : l._store && (l._store.validated = 1));
2451
2458
  }
2452
2459
  function P(l) {
2453
2460
  return typeof l == "object" && l !== null && l.$$typeof === u;
2454
2461
  }
2455
- var O = Te, u = Symbol.for("react.transitional.element"), w = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), y = Symbol.for("react.context"), U = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), L = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), M = Symbol.for("react.activity"), X = Symbol.for("react.client.reference"), k = O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, z = Array.isArray, I = console.createTask ? console.createTask : function() {
2462
+ var O = Te, u = Symbol.for("react.transitional.element"), w = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), y = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), U = Symbol.for("react.lazy"), M = Symbol.for("react.activity"), X = Symbol.for("react.client.reference"), E = O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, z = Array.isArray, I = console.createTask ? console.createTask : function() {
2456
2463
  return null;
2457
2464
  };
2458
2465
  O = {
@@ -2463,9 +2470,9 @@ React keys must be passed directly to JSX without using spread:
2463
2470
  var W, Z = {}, B = O.react_stack_bottom_frame.bind(
2464
2471
  O,
2465
2472
  o
2466
- )(), K = I(s(o)), F = {};
2473
+ )(), K = I(s(o)), L = {};
2467
2474
  Ce.Fragment = x, Ce.jsx = function(l, b, S) {
2468
- var j = 1e4 > k.recentlyCreatedOwnerStacks++;
2475
+ var j = 1e4 > E.recentlyCreatedOwnerStacks++;
2469
2476
  return d(
2470
2477
  l,
2471
2478
  b,
@@ -2475,7 +2482,7 @@ React keys must be passed directly to JSX without using spread:
2475
2482
  j ? I(s(l)) : K
2476
2483
  );
2477
2484
  }, Ce.jsxs = function(l, b, S) {
2478
- var j = 1e4 > k.recentlyCreatedOwnerStacks++;
2485
+ var j = 1e4 > E.recentlyCreatedOwnerStacks++;
2479
2486
  return d(
2480
2487
  l,
2481
2488
  b,
@@ -2489,7 +2496,7 @@ React keys must be passed directly to JSX without using spread:
2489
2496
  }
2490
2497
  var zt;
2491
2498
  function Hn() {
2492
- return zt || (zt = 1, process.env.NODE_ENV === "production" ? Ue.exports = Wn() : Ue.exports = Bn()), Ue.exports;
2499
+ return zt || (zt = 1, process.env.NODE_ENV === "production" ? _e.exports = Wn() : _e.exports = Bn()), _e.exports;
2493
2500
  }
2494
2501
  var n = Hn();
2495
2502
  /**
@@ -2532,7 +2539,7 @@ var Jn = {
2532
2539
  * This source code is licensed under the ISC license.
2533
2540
  * See the LICENSE file in the root directory of this source tree.
2534
2541
  */
2535
- const Gn = _t(
2542
+ const Gn = Ut(
2536
2543
  ({
2537
2544
  color: t = "currentColor",
2538
2545
  size: e = 24,
@@ -2568,7 +2575,7 @@ const Gn = _t(
2568
2575
  * See the LICENSE file in the root directory of this source tree.
2569
2576
  */
2570
2577
  const q = (t, e) => {
2571
- const r = _t(
2578
+ const r = Ut(
2572
2579
  ({ className: s, ...i }, o) => Xe(Gn, {
2573
2580
  ref: o,
2574
2581
  iconNode: e,
@@ -2839,7 +2846,7 @@ const Ss = [
2839
2846
  * This source code is licensed under the ISC license.
2840
2847
  * See the LICENSE file in the root directory of this source tree.
2841
2848
  */
2842
- const Es = [
2849
+ const ks = [
2843
2850
  [
2844
2851
  "path",
2845
2852
  {
@@ -2848,7 +2855,7 @@ const Es = [
2848
2855
  }
2849
2856
  ],
2850
2857
  ["circle", { cx: "12", cy: "10", r: "3", key: "ilqhr7" }]
2851
- ], ks = q("map-pin", Es);
2858
+ ], Es = q("map-pin", ks);
2852
2859
  /**
2853
2860
  * @license lucide-react v0.544.0 - ISC
2854
2861
  *
@@ -2928,14 +2935,14 @@ const As = [
2928
2935
  }
2929
2936
  ],
2930
2937
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
2931
- ], Us = q("settings", As);
2938
+ ], _s = q("settings", As);
2932
2939
  /**
2933
2940
  * @license lucide-react v0.544.0 - ISC
2934
2941
  *
2935
2942
  * This source code is licensed under the ISC license.
2936
2943
  * See the LICENSE file in the root directory of this source tree.
2937
2944
  */
2938
- const _s = [
2945
+ const Us = [
2939
2946
  [
2940
2947
  "path",
2941
2948
  {
@@ -2943,27 +2950,27 @@ const _s = [
2943
2950
  key: "oel41y"
2944
2951
  }
2945
2952
  ]
2946
- ], cr = q("shield", _s);
2953
+ ], cr = q("shield", Us);
2947
2954
  /**
2948
2955
  * @license lucide-react v0.544.0 - ISC
2949
2956
  *
2950
2957
  * This source code is licensed under the ISC license.
2951
2958
  * See the LICENSE file in the root directory of this source tree.
2952
2959
  */
2953
- const Ds = [
2960
+ const Ns = [
2954
2961
  ["path", { d: "M10 11v6", key: "nco0om" }],
2955
2962
  ["path", { d: "M14 11v6", key: "outv1u" }],
2956
2963
  ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
2957
2964
  ["path", { d: "M3 6h18", key: "d0wm0j" }],
2958
2965
  ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
2959
- ], Ne = q("trash-2", Ds);
2966
+ ], $e = q("trash-2", Ns);
2960
2967
  /**
2961
2968
  * @license lucide-react v0.544.0 - ISC
2962
2969
  *
2963
2970
  * This source code is licensed under the ISC license.
2964
2971
  * See the LICENSE file in the root directory of this source tree.
2965
2972
  */
2966
- const $s = [
2973
+ const Ds = [
2967
2974
  [
2968
2975
  "path",
2969
2976
  {
@@ -2973,29 +2980,29 @@ const $s = [
2973
2980
  ],
2974
2981
  ["path", { d: "M12 9v4", key: "juzpu7" }],
2975
2982
  ["path", { d: "M12 17h.01", key: "p32p05" }]
2976
- ], Ut = q("triangle-alert", $s);
2983
+ ], _t = q("triangle-alert", Ds);
2977
2984
  /**
2978
2985
  * @license lucide-react v0.544.0 - ISC
2979
2986
  *
2980
2987
  * This source code is licensed under the ISC license.
2981
2988
  * See the LICENSE file in the root directory of this source tree.
2982
2989
  */
2983
- const Ns = [
2990
+ const $s = [
2984
2991
  ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
2985
2992
  ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
2986
2993
  ["line", { x1: "17", x2: "22", y1: "8", y2: "13", key: "3nzzx3" }],
2987
2994
  ["line", { x1: "22", x2: "17", y1: "8", y2: "13", key: "1swrse" }]
2988
- ], Ls = q("user-x", Ns);
2995
+ ], Fs = q("user-x", $s);
2989
2996
  /**
2990
2997
  * @license lucide-react v0.544.0 - ISC
2991
2998
  *
2992
2999
  * This source code is licensed under the ISC license.
2993
3000
  * See the LICENSE file in the root directory of this source tree.
2994
3001
  */
2995
- const Fs = [
3002
+ const Ls = [
2996
3003
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
2997
3004
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
2998
- ], be = q("user", Fs);
3005
+ ], be = q("user", Ls);
2999
3006
  /**
3000
3007
  * @license lucide-react v0.544.0 - ISC
3001
3008
  *
@@ -3038,22 +3045,22 @@ const qs = [
3038
3045
  password: "",
3039
3046
  role: p.length ? p[0] : "user",
3040
3047
  ...h && { avatarUrl: "" }
3041
- }, [x, C] = R(w), [T, A] = R(!1), [y, U] = R(!1), [g, v] = R(null), [L, _] = R({}), [M, X] = R(!1), k = c ? "#ffffff" : "#111827", V = c ? "#a1a1aa" : "#6b7280", z = c ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", I = c ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)";
3048
+ }, [x, C] = R(w), [T, A] = R(!1), [y, _] = R(!1), [g, v] = R(null), [F, U] = R({}), [M, X] = R(!1), E = c ? "#ffffff" : "#111827", V = c ? "#a1a1aa" : "#6b7280", z = c ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", I = c ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)";
3042
3049
  Te.useEffect(() => {
3043
3050
  if (typeof window < "u") {
3044
- const F = () => X(window.innerWidth < 768);
3045
- return F(), window.addEventListener("resize", F), () => window.removeEventListener("resize", F);
3051
+ const L = () => X(window.innerWidth < 768);
3052
+ return L(), window.addEventListener("resize", L), () => window.removeEventListener("resize", L);
3046
3053
  }
3047
3054
  }, []);
3048
- const W = (F) => {
3049
- const { name: l, value: b } = F.target;
3050
- C((S) => ({ ...S, [l]: b })), L[l] && _((S) => ({ ...S, [l]: void 0 }));
3055
+ const W = (L) => {
3056
+ const { name: l, value: b } = L.target;
3057
+ C((S) => ({ ...S, [l]: b })), F[l] && U((S) => ({ ...S, [l]: void 0 }));
3051
3058
  }, Z = () => {
3052
- const F = {};
3053
- return x.name.trim() || (F.name = "Name is required"), x.email.trim() ? /\S+@\S+\.\S+/.test(x.email) || (F.email = "Invalid email address") : F.email = "Email is required", x.password ? x.password.length < 6 && (F.password = "Password must be at least 6 characters") : F.password = "Password is required", _(F), Object.keys(F).length === 0;
3054
- }, B = async (F) => {
3055
- if (F.preventDefault(), !!Z()) {
3056
- U(!0), v(null);
3059
+ const L = {};
3060
+ return x.name.trim() || (L.name = "Name is required"), x.email.trim() ? /\S+@\S+\.\S+/.test(x.email) || (L.email = "Invalid email address") : L.email = "Email is required", x.password ? x.password.length < 6 && (L.password = "Password must be at least 6 characters") : L.password = "Password is required", U(L), Object.keys(L).length === 0;
3061
+ }, B = async (L) => {
3062
+ if (L.preventDefault(), !!Z()) {
3063
+ _(!0), v(null);
3057
3064
  try {
3058
3065
  const l = {
3059
3066
  name: x.name,
@@ -3072,7 +3079,7 @@ const qs = [
3072
3079
  text: l.message || "Signup failed. Please try again."
3073
3080
  }), O?.(l);
3074
3081
  } finally {
3075
- U(!1);
3082
+ _(!1);
3076
3083
  }
3077
3084
  }
3078
3085
  }, K = {
@@ -3081,7 +3088,7 @@ const qs = [
3081
3088
  backgroundColor: z,
3082
3089
  border: `1px solid ${I}`,
3083
3090
  borderRadius: "10px",
3084
- color: k,
3091
+ color: E,
3085
3092
  fontSize: "15px",
3086
3093
  outline: "none",
3087
3094
  transition: "all 0.2s ease",
@@ -3150,7 +3157,7 @@ const qs = [
3150
3157
  style: {
3151
3158
  fontSize: "24px",
3152
3159
  fontWeight: 700,
3153
- color: k,
3160
+ color: E,
3154
3161
  margin: 0
3155
3162
  },
3156
3163
  children: r
@@ -3189,8 +3196,8 @@ const qs = [
3189
3196
  objectFit: "cover",
3190
3197
  border: `2px solid ${o}30`
3191
3198
  },
3192
- onError: (F) => {
3193
- const l = F.target;
3199
+ onError: (L) => {
3200
+ const l = L.target;
3194
3201
  l.style.display = "none";
3195
3202
  }
3196
3203
  }
@@ -3214,7 +3221,7 @@ const qs = [
3214
3221
  style: {
3215
3222
  fontSize: "14px",
3216
3223
  fontWeight: 500,
3217
- color: k
3224
+ color: E
3218
3225
  },
3219
3226
  children: "Select Role"
3220
3227
  }
@@ -3257,7 +3264,7 @@ const qs = [
3257
3264
  "button",
3258
3265
  {
3259
3266
  type: "button",
3260
- onClick: () => C((F) => ({ ...F, role: p[0] })),
3267
+ onClick: () => C((L) => ({ ...L, role: p[0] })),
3261
3268
  style: {
3262
3269
  flex: 1,
3263
3270
  zIndex: 10,
@@ -3279,7 +3286,7 @@ const qs = [
3279
3286
  "button",
3280
3287
  {
3281
3288
  type: "button",
3282
- onClick: () => C((F) => ({ ...F, role: p[1] })),
3289
+ onClick: () => C((L) => ({ ...L, role: p[1] })),
3283
3290
  style: {
3284
3291
  flex: 1,
3285
3292
  zIndex: 10,
@@ -3310,7 +3317,7 @@ const qs = [
3310
3317
  style: {
3311
3318
  fontSize: "14px",
3312
3319
  fontWeight: 500,
3313
- color: k
3320
+ color: E
3314
3321
  },
3315
3322
  children: "Full Name"
3316
3323
  }
@@ -3340,12 +3347,12 @@ const qs = [
3340
3347
  onChange: W,
3341
3348
  style: {
3342
3349
  ...K,
3343
- borderColor: L.name ? "#ef4444" : I
3350
+ borderColor: F.name ? "#ef4444" : I
3344
3351
  }
3345
3352
  }
3346
3353
  )
3347
3354
  ] }),
3348
- L.name && /* @__PURE__ */ n.jsx(
3355
+ F.name && /* @__PURE__ */ n.jsx(
3349
3356
  "span",
3350
3357
  {
3351
3358
  style: {
@@ -3353,7 +3360,7 @@ const qs = [
3353
3360
  fontSize: "12px",
3354
3361
  marginTop: "2px"
3355
3362
  },
3356
- children: L.name
3363
+ children: F.name
3357
3364
  }
3358
3365
  )
3359
3366
  ] }),
@@ -3365,7 +3372,7 @@ const qs = [
3365
3372
  style: {
3366
3373
  fontSize: "14px",
3367
3374
  fontWeight: 500,
3368
- color: k
3375
+ color: E
3369
3376
  },
3370
3377
  children: "Email Address"
3371
3378
  }
@@ -3395,12 +3402,12 @@ const qs = [
3395
3402
  onChange: W,
3396
3403
  style: {
3397
3404
  ...K,
3398
- borderColor: L.email ? "#ef4444" : I
3405
+ borderColor: F.email ? "#ef4444" : I
3399
3406
  }
3400
3407
  }
3401
3408
  )
3402
3409
  ] }),
3403
- L.email && /* @__PURE__ */ n.jsx(
3410
+ F.email && /* @__PURE__ */ n.jsx(
3404
3411
  "span",
3405
3412
  {
3406
3413
  style: {
@@ -3408,7 +3415,7 @@ const qs = [
3408
3415
  fontSize: "12px",
3409
3416
  marginTop: "2px"
3410
3417
  },
3411
- children: L.email
3418
+ children: F.email
3412
3419
  }
3413
3420
  )
3414
3421
  ] }),
@@ -3420,7 +3427,7 @@ const qs = [
3420
3427
  style: {
3421
3428
  fontSize: "14px",
3422
3429
  fontWeight: 500,
3423
- color: k
3430
+ color: E
3424
3431
  },
3425
3432
  children: "Password"
3426
3433
  }
@@ -3450,7 +3457,7 @@ const qs = [
3450
3457
  onChange: W,
3451
3458
  style: {
3452
3459
  ...K,
3453
- borderColor: L.password ? "#ef4444" : I
3460
+ borderColor: F.password ? "#ef4444" : I
3454
3461
  }
3455
3462
  }
3456
3463
  ),
@@ -3474,7 +3481,7 @@ const qs = [
3474
3481
  }
3475
3482
  )
3476
3483
  ] }),
3477
- L.password && /* @__PURE__ */ n.jsx(
3484
+ F.password && /* @__PURE__ */ n.jsx(
3478
3485
  "span",
3479
3486
  {
3480
3487
  style: {
@@ -3482,7 +3489,7 @@ const qs = [
3482
3489
  fontSize: "12px",
3483
3490
  marginTop: "2px"
3484
3491
  },
3485
- children: L.password
3492
+ children: F.password
3486
3493
  }
3487
3494
  )
3488
3495
  ] }),
@@ -3498,7 +3505,7 @@ const qs = [
3498
3505
  style: {
3499
3506
  fontSize: "14px",
3500
3507
  fontWeight: 500,
3501
- color: k
3508
+ color: E
3502
3509
  },
3503
3510
  children: "Avatar URL (Optional)"
3504
3511
  }
@@ -3652,11 +3659,11 @@ const qs = [
3652
3659
  onSuccess: p,
3653
3660
  onError: d
3654
3661
  }) => {
3655
- const m = ue(), [P, O] = R("login"), [u, w] = R(1), [x, C] = R(!1), [T, A] = R(!1), [y, U] = R(null), [g, v] = R(""), [L, _] = R(""), [M, X] = R({
3662
+ const m = ue(), [P, O] = R("login"), [u, w] = R(1), [x, C] = R(!1), [T, A] = R(!1), [y, _] = R(null), [g, v] = R(""), [F, U] = R(""), [M, X] = R({
3656
3663
  email: "",
3657
3664
  otp: "",
3658
3665
  newPassword: ""
3659
- }), [k, V] = R(!1), z = c ? "#ffffff" : "#111827", I = c ? "#a1a1aa" : "#6b7280", W = c ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", Z = c ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)";
3666
+ }), [E, V] = R(!1), z = c ? "#ffffff" : "#111827", I = c ? "#a1a1aa" : "#6b7280", W = c ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", Z = c ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)";
3660
3667
  Te.useEffect(() => {
3661
3668
  if (typeof window < "u") {
3662
3669
  const S = () => V(window.innerWidth < 768);
@@ -3664,35 +3671,35 @@ const qs = [
3664
3671
  }
3665
3672
  }, []);
3666
3673
  const B = async (S) => {
3667
- S.preventDefault(), A(!0), U(null);
3674
+ S.preventDefault(), A(!0), _(null);
3668
3675
  try {
3669
- const j = await m.loginUser({ email: g, password: L }), { user: G } = j;
3676
+ const j = await m.loginUser({ email: g, password: F }), { user: G } = j;
3670
3677
  if (!G)
3671
3678
  throw new Error(j.message || "Login failed");
3672
- U({ type: "success", text: `Welcome ${G.name}` }), p?.(G);
3679
+ _({ type: "success", text: `Welcome ${G.name}` }), p?.(G);
3673
3680
  } catch (j) {
3674
3681
  const G = j.message || "Login failed";
3675
- U({ type: "error", text: G }), d?.(j);
3682
+ _({ type: "error", text: G }), d?.(j);
3676
3683
  } finally {
3677
3684
  A(!1);
3678
3685
  }
3679
3686
  }, K = (S) => {
3680
3687
  X({ ...M, [S.target.name]: S.target.value });
3681
- }, F = async (S) => {
3682
- S.preventDefault(), A(!0), U(null);
3688
+ }, L = async (S) => {
3689
+ S.preventDefault(), A(!0), _(null);
3683
3690
  try {
3684
3691
  const j = await m.requestResetUserPasswordOTP({
3685
3692
  email: M.email
3686
3693
  });
3687
- j.success ? (w(2), U({
3694
+ j.success ? (w(2), _({
3688
3695
  type: "success",
3689
3696
  text: j.message || "OTP sent to your email"
3690
- })) : U({
3697
+ })) : _({
3691
3698
  type: "error",
3692
3699
  text: j.message || "Failed to send OTP"
3693
3700
  });
3694
3701
  } catch (j) {
3695
- U({
3702
+ _({
3696
3703
  type: "error",
3697
3704
  text: j.message || "Something went wrong"
3698
3705
  });
@@ -3700,19 +3707,19 @@ const qs = [
3700
3707
  A(!1);
3701
3708
  }
3702
3709
  }, l = async (S) => {
3703
- S.preventDefault(), A(!0), U(null);
3710
+ S.preventDefault(), A(!0), _(null);
3704
3711
  try {
3705
3712
  const j = await m.resetUserPassword({
3706
3713
  email: M.email,
3707
3714
  otp: M.otp,
3708
3715
  newPassword: M.newPassword
3709
3716
  });
3710
- j.success ? (U({
3717
+ j.success ? (_({
3711
3718
  type: "success",
3712
3719
  text: j.message || "Password reset successfully!"
3713
- }), w(1), X({ email: "", otp: "", newPassword: "" }), O("login")) : U({ type: "error", text: j.message || "Reset failed" });
3720
+ }), w(1), X({ email: "", otp: "", newPassword: "" }), O("login")) : _({ type: "error", text: j.message || "Reset failed" });
3714
3721
  } catch (j) {
3715
- U({
3722
+ _({
3716
3723
  type: "error",
3717
3724
  text: j.message || "Something went wrong"
3718
3725
  });
@@ -3721,7 +3728,7 @@ const qs = [
3721
3728
  }
3722
3729
  }, b = {
3723
3730
  width: "100%",
3724
- padding: k ? "10px 14px 10px 44px" : "10px 16px 10px 44px",
3731
+ padding: E ? "10px 14px 10px 44px" : "10px 16px 10px 44px",
3725
3732
  backgroundColor: W,
3726
3733
  border: `1px solid ${Z}`,
3727
3734
  borderRadius: "10px",
@@ -3742,15 +3749,15 @@ const qs = [
3742
3749
  "div",
3743
3750
  {
3744
3751
  style: {
3745
- minWidth: k ? "320px" : "380px",
3746
- maxWidth: k ? "340px" : "390px",
3752
+ minWidth: E ? "320px" : "380px",
3753
+ maxWidth: E ? "340px" : "390px",
3747
3754
  width: "100%",
3748
3755
  display: "flex",
3749
3756
  flexDirection: "column",
3750
3757
  borderRadius: "10px",
3751
3758
  fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
3752
3759
  backgroundColor: c ? "#000000" : "#ffffff",
3753
- padding: k ? "30px 24px" : "18px 28px"
3760
+ padding: E ? "30px 24px" : "18px 28px"
3754
3761
  },
3755
3762
  children: [
3756
3763
  /* @__PURE__ */ n.jsxs(
@@ -3900,8 +3907,8 @@ const qs = [
3900
3907
  id: "login-password",
3901
3908
  type: x ? "text" : "password",
3902
3909
  placeholder: "Enter your password",
3903
- value: L,
3904
- onChange: (S) => _(S.target.value),
3910
+ value: F,
3911
+ onChange: (S) => U(S.target.value),
3905
3912
  style: b
3906
3913
  }
3907
3914
  ),
@@ -3990,7 +3997,7 @@ const qs = [
3990
3997
  P === "forgot" && /* @__PURE__ */ n.jsxs(
3991
3998
  "form",
3992
3999
  {
3993
- onSubmit: u === 1 ? F : l,
4000
+ onSubmit: u === 1 ? L : l,
3994
4001
  style: { display: "flex", flexDirection: "column", gap: "14px" },
3995
4002
  children: [
3996
4003
  u === 1 ? /* @__PURE__ */ n.jsxs(
@@ -4398,7 +4405,7 @@ const qs = [
4398
4405
  color: "white",
4399
4406
  flexShrink: 0
4400
4407
  },
4401
- children: /* @__PURE__ */ n.jsx(Ne, { size: 20 })
4408
+ children: /* @__PURE__ */ n.jsx($e, { size: 20 })
4402
4409
  }
4403
4410
  ),
4404
4411
  /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx(
@@ -4471,7 +4478,7 @@ const qs = [
4471
4478
  display: "flex",
4472
4479
  alignItems: "flex-start"
4473
4480
  },
4474
- children: /* @__PURE__ */ n.jsx(Ut, { size: 24 })
4481
+ children: /* @__PURE__ */ n.jsx(_t, { size: 24 })
4475
4482
  }
4476
4483
  ),
4477
4484
  /* @__PURE__ */ n.jsxs("div", { style: { flex: 1 }, children: [
@@ -4501,14 +4508,14 @@ const qs = [
4501
4508
  text: "All your data will be permanently deleted"
4502
4509
  },
4503
4510
  {
4504
- icon: /* @__PURE__ */ n.jsx(Ls, { size: 16 }),
4511
+ icon: /* @__PURE__ */ n.jsx(Fs, { size: 16 }),
4505
4512
  text: "This action cannot be reversed"
4506
4513
  },
4507
4514
  {
4508
4515
  icon: /* @__PURE__ */ n.jsx(dt, { size: 16 }),
4509
4516
  text: "You will lose access to all services"
4510
4517
  }
4511
- ].map((y, U) => /* @__PURE__ */ n.jsxs(
4518
+ ].map((y, _) => /* @__PURE__ */ n.jsxs(
4512
4519
  "div",
4513
4520
  {
4514
4521
  style: {
@@ -4523,7 +4530,7 @@ const qs = [
4523
4530
  /* @__PURE__ */ n.jsx("span", { children: y.text })
4524
4531
  ]
4525
4532
  },
4526
- U
4533
+ _
4527
4534
  ))
4528
4535
  }
4529
4536
  )
@@ -4597,7 +4604,7 @@ const qs = [
4597
4604
  y.currentTarget.style.transform = "translateY(0)", y.currentTarget.style.boxShadow = "0 4px 12px rgba(239, 68, 68, 0.4)";
4598
4605
  },
4599
4606
  children: [
4600
- /* @__PURE__ */ n.jsx(Ne, { size: 16 }),
4607
+ /* @__PURE__ */ n.jsx($e, { size: 16 }),
4601
4608
  "Continue to Delete"
4602
4609
  ]
4603
4610
  }
@@ -4632,7 +4639,7 @@ const qs = [
4632
4639
  color: "white",
4633
4640
  flexShrink: 0
4634
4641
  },
4635
- children: /* @__PURE__ */ n.jsx(Ut, { size: 24 })
4642
+ children: /* @__PURE__ */ n.jsx(_t, { size: 24 })
4636
4643
  }
4637
4644
  ),
4638
4645
  /* @__PURE__ */ n.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ n.jsx(
@@ -4787,7 +4794,7 @@ const qs = [
4787
4794
  C && !h && (y.currentTarget.style.transform = "translateY(0)", y.currentTarget.style.boxShadow = "0 4px 12px rgba(239, 68, 68, 0.4)");
4788
4795
  },
4789
4796
  children: [
4790
- /* @__PURE__ */ n.jsx(Ne, { size: 16 }),
4797
+ /* @__PURE__ */ n.jsx($e, { size: 16 }),
4791
4798
  "Yes, Delete My Account"
4792
4799
  ]
4793
4800
  }
@@ -4875,7 +4882,7 @@ const qs = [
4875
4882
  { text: "Removing your data", active: !0 },
4876
4883
  { text: "Closing active sessions", active: !1 },
4877
4884
  { text: "Finalizing deletion", active: !1 }
4878
- ].map((y, U) => /* @__PURE__ */ n.jsxs(
4885
+ ].map((y, _) => /* @__PURE__ */ n.jsxs(
4879
4886
  "div",
4880
4887
  {
4881
4888
  style: {
@@ -4914,7 +4921,7 @@ const qs = [
4914
4921
  )
4915
4922
  ]
4916
4923
  },
4917
- U
4924
+ _
4918
4925
  ))
4919
4926
  }
4920
4927
  ) }),
@@ -5655,8 +5662,8 @@ const qs = [
5655
5662
  return g(), window.addEventListener("resize", g), () => window.removeEventListener("resize", g);
5656
5663
  }, []), !t) return null;
5657
5664
  const C = (g) => {
5658
- const { name: v, value: L } = g.target;
5659
- h((_) => ({ ..._, [v]: L })), p[v] && d((_) => ({ ..._, [v]: "" }));
5665
+ const { name: v, value: F } = g.target;
5666
+ h((U) => ({ ...U, [v]: F })), p[v] && d((U) => ({ ...U, [v]: "" }));
5660
5667
  }, T = (g) => {
5661
5668
  u((v) => ({ ...v, [g]: !v[g] }));
5662
5669
  }, A = () => {
@@ -5682,7 +5689,7 @@ const qs = [
5682
5689
  P(!1);
5683
5690
  }
5684
5691
  }
5685
- }, U = [
5692
+ }, _ = [
5686
5693
  {
5687
5694
  field: "currentPassword",
5688
5695
  label: "Current Password",
@@ -5815,7 +5822,7 @@ const qs = [
5815
5822
  }
5816
5823
  ),
5817
5824
  /* @__PURE__ */ n.jsxs("form", { onSubmit: y, children: [
5818
- U.map(({ field: g, label: v, icon: L }) => /* @__PURE__ */ n.jsxs(
5825
+ _.map(({ field: g, label: v, icon: F }) => /* @__PURE__ */ n.jsxs(
5819
5826
  "div",
5820
5827
  {
5821
5828
  style: {
@@ -5850,7 +5857,7 @@ const qs = [
5850
5857
  color: o.textTertiary,
5851
5858
  zIndex: 2
5852
5859
  },
5853
- children: L
5860
+ children: F
5854
5861
  }
5855
5862
  ),
5856
5863
  /* @__PURE__ */ n.jsx(
@@ -5874,11 +5881,11 @@ const qs = [
5874
5881
  transition: "all 0.2s ease",
5875
5882
  boxSizing: "border-box"
5876
5883
  },
5877
- onFocus: (_) => {
5878
- _.target.style.borderColor = o.accent, _.target.style.boxShadow = `0 0 0 3px ${o.accent}20`;
5884
+ onFocus: (U) => {
5885
+ U.target.style.borderColor = o.accent, U.target.style.boxShadow = `0 0 0 3px ${o.accent}20`;
5879
5886
  },
5880
- onBlur: (_) => {
5881
- _.target.style.borderColor = p[g] ? o.error : o.border, _.target.style.boxShadow = "none";
5887
+ onBlur: (U) => {
5888
+ U.target.style.borderColor = p[g] ? o.error : o.border, U.target.style.boxShadow = "none";
5882
5889
  }
5883
5890
  }
5884
5891
  ),
@@ -5904,11 +5911,11 @@ const qs = [
5904
5911
  alignItems: "center",
5905
5912
  justifyContent: "center"
5906
5913
  },
5907
- onMouseOver: (_) => {
5908
- _.currentTarget.style.backgroundColor = o.border, _.currentTarget.style.color = o.textPrimary;
5914
+ onMouseOver: (U) => {
5915
+ U.currentTarget.style.backgroundColor = o.border, U.currentTarget.style.color = o.textPrimary;
5909
5916
  },
5910
- onMouseOut: (_) => {
5911
- _.currentTarget.style.backgroundColor = "transparent", _.currentTarget.style.color = o.textTertiary;
5917
+ onMouseOut: (U) => {
5918
+ U.currentTarget.style.backgroundColor = "transparent", U.currentTarget.style.color = o.textTertiary;
5912
5919
  },
5913
5920
  children: O[g] ? /* @__PURE__ */ n.jsx(ot, { size: 18 }) : /* @__PURE__ */ n.jsx(lt, { size: 18 })
5914
5921
  }
@@ -6359,32 +6366,32 @@ const qs = [
6359
6366
  onVerify: o,
6360
6367
  primaryColor: a = "#00C212"
6361
6368
  }) => {
6362
- const c = ue(), [h, p] = R(null), [d, m] = R(e), [P, O] = R(!0), [u, w] = R(!1), [x, C] = R(!1), [T, A] = R(!1), [y, U] = R(!1), [g, v] = R(!1), [L, _] = R(!1), [M, X] = R(!1), [k, V] = R(!1), [z, I] = R(null), [W, Z] = R(!1), [B, K] = R({
6369
+ const c = ue(), [h, p] = R(null), [d, m] = R(e), [P, O] = R(!0), [u, w] = R(!1), [x, C] = R(!1), [T, A] = R(!1), [y, _] = R(!1), [g, v] = R(!1), [F, U] = R(!1), [M, X] = R(!1), [E, V] = R(!1), [z, I] = R(null), [W, Z] = R(!1), [B, K] = R({
6363
6370
  email: "",
6364
6371
  otp: ""
6365
- }), [F, l] = R(!1), [b, S] = R(!1);
6372
+ }), [L, l] = R(!1), [b, S] = R(!1);
6366
6373
  te(() => {
6367
6374
  if (typeof window < "u") {
6368
- const E = () => p(window.innerWidth);
6369
- return E(), window.addEventListener("resize", E), () => window.removeEventListener("resize", E);
6375
+ const k = () => p(window.innerWidth);
6376
+ return k(), window.addEventListener("resize", k), () => window.removeEventListener("resize", k);
6370
6377
  }
6371
6378
  }, []);
6372
- const j = (E, D) => {
6373
- I({ type: E, message: D }), setTimeout(() => I(null), 3e3);
6379
+ const j = (k, N) => {
6380
+ I({ type: k, message: N }), setTimeout(() => I(null), 3e3);
6374
6381
  }, G = () => {
6375
6382
  V(!0);
6376
- const E = setTimeout(() => {
6383
+ const k = setTimeout(() => {
6377
6384
  X(!1), V(!1);
6378
6385
  }, 150);
6379
- return () => clearTimeout(E);
6386
+ return () => clearTimeout(k);
6380
6387
  };
6381
6388
  te(() => {
6382
- const E = (D) => {
6389
+ const k = (N) => {
6383
6390
  const H = document.querySelector(".dropdown-container");
6384
- H && !H.contains(D.target) && G();
6391
+ H && !H.contains(N.target) && G();
6385
6392
  };
6386
- return M && document.addEventListener("mousedown", E), () => {
6387
- document.removeEventListener("mousedown", E);
6393
+ return M && document.addEventListener("mousedown", k), () => {
6394
+ document.removeEventListener("mousedown", k);
6388
6395
  };
6389
6396
  }, [M]);
6390
6397
  const pe = async () => {
@@ -6398,19 +6405,19 @@ const qs = [
6398
6405
  }
6399
6406
  try {
6400
6407
  S(!0);
6401
- const E = await c.requestEmailVerificationOTP({
6408
+ const k = await c.requestEmailVerificationOTP({
6402
6409
  userId: d.id,
6403
6410
  email: B.email
6404
- }), D = E?.data?.success ?? E?.success, H = E?.data?.message ?? E?.message;
6405
- D ? (j("success", H || "OTP sent to email!"), l(!0)) : j("error", H || "Failed to send OTP");
6406
- } catch (E) {
6407
- const D = E?.response?.data?.message || E?.message || "Server error";
6408
- j("error", D);
6411
+ }), N = k?.data?.success ?? k?.success, H = k?.data?.message ?? k?.message;
6412
+ N ? (j("success", H || "OTP sent to email!"), l(!0)) : j("error", H || "Failed to send OTP");
6413
+ } catch (k) {
6414
+ const N = k?.response?.data?.message || k?.message || "Server error";
6415
+ j("error", N);
6409
6416
  } finally {
6410
6417
  S(!1);
6411
6418
  }
6412
- }, Y = async (E) => {
6413
- if (E.preventDefault(), !B.email || !B.otp) {
6419
+ }, Y = async (k) => {
6420
+ if (k.preventDefault(), !B.email || !B.otp) {
6414
6421
  j("error", "Please fill in all fields");
6415
6422
  return;
6416
6423
  }
@@ -6420,10 +6427,10 @@ const qs = [
6420
6427
  }
6421
6428
  try {
6422
6429
  S(!0);
6423
- const D = await c.verifyEmail({
6430
+ const N = await c.verifyEmail({
6424
6431
  email: B.email,
6425
6432
  otp: B.otp
6426
- }), H = D?.data?.success ?? D?.success, Q = D?.data?.message ?? D?.message;
6433
+ }), H = N?.data?.success ?? N?.success, Q = N?.data?.message ?? N?.message;
6427
6434
  if (H) {
6428
6435
  j("success", Q || "Email verified!");
6429
6436
  const le = { ...d, isVerified: !0 };
@@ -6432,49 +6439,49 @@ const qs = [
6432
6439
  localStorage.setItem(
6433
6440
  "userInfo",
6434
6441
  JSON.stringify({ ...le, token: Se })
6435
- ), typeof o == "function" && o(le), K({ email: le.email, otp: "" }), l(!1), _?.(!1);
6442
+ ), typeof o == "function" && o(le), K({ email: le.email, otp: "" }), l(!1), U?.(!1);
6436
6443
  } else
6437
6444
  j("error", Q || "Verification failed");
6438
- } catch (D) {
6439
- const H = D?.response?.data?.message || D?.message || "Something went wrong";
6445
+ } catch (N) {
6446
+ const H = N?.response?.data?.message || N?.message || "Something went wrong";
6440
6447
  j("error", H);
6441
6448
  } finally {
6442
6449
  S(!1);
6443
6450
  }
6444
- }, oe = async (E) => {
6451
+ }, oe = async (k) => {
6445
6452
  if (!d) return !1;
6446
6453
  try {
6447
- const D = await c.updateUser({
6454
+ const N = await c.updateUser({
6448
6455
  userId: d.id,
6449
- avatarUrl: E
6456
+ avatarUrl: k
6450
6457
  });
6451
- if (D?.success) {
6458
+ if (N?.success) {
6452
6459
  const H = {
6453
6460
  ...d,
6454
6461
  // 🔒 keep existing auth fields
6455
- ...D.user,
6462
+ ...N.user,
6456
6463
  // 🔁 merge backend response if present
6457
- avatarUrl: E
6464
+ avatarUrl: k
6458
6465
  };
6459
6466
  return m(H), j("success", "Avatar updated successfully!"), !0;
6460
6467
  }
6461
- return j("error", D?.message || "Failed to update avatar"), !1;
6462
- } catch (D) {
6463
- return console.error("Avatar update error:", D), j("error", "Failed to update avatar"), !1;
6468
+ return j("error", N?.message || "Failed to update avatar"), !1;
6469
+ } catch (N) {
6470
+ return console.error("Avatar update error:", N), j("error", "Failed to update avatar"), !1;
6464
6471
  }
6465
6472
  }, ve = async () => {
6466
6473
  if (d) {
6467
6474
  C(!0);
6468
6475
  try {
6469
- const E = d.email, D = await c.updateUser({
6476
+ const k = d.email, N = await c.updateUser({
6470
6477
  userId: d.id,
6471
6478
  ...d
6472
6479
  });
6473
- if (D.success && D.user) {
6474
- const H = D.user.email !== E, Q = {
6480
+ if (N.success && N.user) {
6481
+ const H = N.user.email !== k, Q = {
6475
6482
  ...d,
6476
6483
  // keep old state
6477
- ...D.user,
6484
+ ...N.user,
6478
6485
  // overwrite updated fields
6479
6486
  isVerified: H ? !1 : d.isVerified
6480
6487
  };
@@ -6483,28 +6490,28 @@ const qs = [
6483
6490
  H ? "Email updated. Please verify your new email." : "Profile updated successfully"
6484
6491
  ), w(!1);
6485
6492
  } else
6486
- j("error", D.message || "Update failed");
6487
- } catch (E) {
6488
- console.error(E), j("error", "Update failed");
6493
+ j("error", N.message || "Update failed");
6494
+ } catch (k) {
6495
+ console.error(k), j("error", "Update failed");
6489
6496
  } finally {
6490
6497
  C(!1);
6491
6498
  }
6492
6499
  }
6493
- }, Ve = async (E) => {
6500
+ }, Ve = async (k) => {
6494
6501
  try {
6495
- const D = await c.checkIfUserExists(E);
6496
- D?.success === !0 && D?.exists === !1 && (console.warn("❌ User does not exist on server. Clearing session..."), localStorage.removeItem("userInfo"), m(null));
6497
- } catch (D) {
6498
- console.error("⚠️ User validation request failed:", D);
6502
+ const N = await c.checkIfUserExists(k);
6503
+ N?.success === !0 && N?.exists === !1 && (console.warn("❌ User does not exist on server. Clearing session..."), localStorage.removeItem("userInfo"), m(null));
6504
+ } catch (N) {
6505
+ console.error("⚠️ User validation request failed:", N);
6499
6506
  }
6500
6507
  };
6501
6508
  te(() => {
6502
6509
  (async () => {
6503
6510
  try {
6504
6511
  O(!0);
6505
- const D = await c.checkUserSession();
6506
- if (D.user?.id) {
6507
- const H = D.user.id, Q = await c.getUserProfile({ userId: H });
6512
+ const N = await c.checkUserSession();
6513
+ if (N.user?.id) {
6514
+ const H = N.user.id, Q = await c.getUserProfile({ userId: H });
6508
6515
  if (Q.user) {
6509
6516
  const le = Q.user;
6510
6517
  m(le), Ve(H);
@@ -6512,19 +6519,19 @@ const qs = [
6512
6519
  m(null), localStorage.removeItem("userInfo");
6513
6520
  } else
6514
6521
  m(null), localStorage.removeItem("userInfo");
6515
- } catch (D) {
6516
- console.error("User init failed:", D), m(null), localStorage.removeItem("userInfo");
6522
+ } catch (N) {
6523
+ console.error("User init failed:", N), m(null), localStorage.removeItem("userInfo");
6517
6524
  } finally {
6518
6525
  O(!1);
6519
6526
  }
6520
6527
  })();
6521
6528
  }, [e]), te(() => {
6522
- d?.email && K((E) => ({ ...E, email: d.email }));
6529
+ d?.email && K((k) => ({ ...k, email: d.email }));
6523
6530
  }, [d?.email]);
6524
- const pt = (E, D) => {
6525
- let H = parseInt(E.replace("#", ""), 16), Q = (H >> 16) + D, le = (H >> 8 & 255) + D, Se = (H & 255) + D;
6531
+ const pt = (k, N) => {
6532
+ let H = parseInt(k.replace("#", ""), 16), Q = (H >> 16) + N, le = (H >> 8 & 255) + N, Se = (H & 255) + N;
6526
6533
  return Q = Math.min(255, Math.max(0, Q)), le = Math.min(255, Math.max(0, le)), Se = Math.min(255, Math.max(0, Se)), `#${(Se | le << 8 | Q << 16).toString(16).padStart(6, "0")}`;
6527
- }, $ = r ? {
6534
+ }, D = r ? {
6528
6535
  background: "#000000",
6529
6536
  surface: "#09090b",
6530
6537
  surfaceLight: "#27272a",
@@ -6563,7 +6570,7 @@ const qs = [
6563
6570
  display: "flex",
6564
6571
  alignItems: "center",
6565
6572
  justifyContent: "center",
6566
- color: $.textPrimary,
6573
+ color: D.textPrimary,
6567
6574
  fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, sans-serif"
6568
6575
  },
6569
6576
  children: /* @__PURE__ */ n.jsxs(
@@ -6581,12 +6588,12 @@ const qs = [
6581
6588
  ie,
6582
6589
  {
6583
6590
  size: 40,
6584
- color: $.accent,
6591
+ color: D.accent,
6585
6592
  style: { animation: "spin 1s linear infinite" },
6586
6593
  "aria-hidden": "true"
6587
6594
  }
6588
6595
  ),
6589
- /* @__PURE__ */ n.jsx("p", { style: { color: $.textTertiary, margin: 0 }, children: "Loading your profile..." })
6596
+ /* @__PURE__ */ n.jsx("p", { style: { color: D.textTertiary, margin: 0 }, children: "Loading your profile..." })
6590
6597
  ]
6591
6598
  }
6592
6599
  )
@@ -6602,7 +6609,7 @@ const qs = [
6602
6609
  display: "flex",
6603
6610
  alignItems: "center",
6604
6611
  justifyContent: "center",
6605
- color: $.textPrimary,
6612
+ color: D.textPrimary,
6606
6613
  fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, sans-serif"
6607
6614
  },
6608
6615
  children: /* @__PURE__ */ n.jsxs(
@@ -6616,8 +6623,8 @@ const qs = [
6616
6623
  textAlign: "center"
6617
6624
  },
6618
6625
  children: [
6619
- /* @__PURE__ */ n.jsx(se, { size: 40, color: $.error, "aria-hidden": "true" }),
6620
- /* @__PURE__ */ n.jsx("p", { style: { color: $.textTertiary, margin: 0 }, children: "No profile found. Please log in again." })
6626
+ /* @__PURE__ */ n.jsx(se, { size: 40, color: D.error, "aria-hidden": "true" }),
6627
+ /* @__PURE__ */ n.jsx("p", { style: { color: D.textTertiary, margin: 0 }, children: "No profile found. Please log in again." })
6621
6628
  ]
6622
6629
  }
6623
6630
  )
@@ -6650,7 +6657,7 @@ const qs = [
6650
6657
  value: d.address || "Not provided",
6651
6658
  name: "address",
6652
6659
  type: "text",
6653
- icon: ks
6660
+ icon: Es
6654
6661
  }
6655
6662
  ];
6656
6663
  return /* @__PURE__ */ n.jsxs(
@@ -6661,7 +6668,7 @@ const qs = [
6661
6668
  display: "flex",
6662
6669
  alignItems: "center",
6663
6670
  justifyContent: "center",
6664
- color: $.textPrimary,
6671
+ color: D.textPrimary,
6665
6672
  fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, sans-serif",
6666
6673
  lineHeight: 1.5,
6667
6674
  minHeight: "80vh"
@@ -6747,7 +6754,7 @@ const qs = [
6747
6754
  "section",
6748
6755
  {
6749
6756
  style: {
6750
- backgroundColor: $.surface,
6757
+ backgroundColor: D.surface,
6751
6758
  borderRadius: "16px",
6752
6759
  position: "relative",
6753
6760
  padding: "24px",
@@ -6801,7 +6808,7 @@ const qs = [
6801
6808
  borderRadius: "50%",
6802
6809
  objectFit: "cover",
6803
6810
  boxShadow: "0 10px 25px -5px rgba(0, 0, 0, 0.3)",
6804
- border: `3px solid ${$.border}`
6811
+ border: `3px solid ${D.border}`
6805
6812
  },
6806
6813
  width: 128,
6807
6814
  height: 128,
@@ -6816,7 +6823,7 @@ const qs = [
6816
6823
  position: "absolute",
6817
6824
  bottom: "8px",
6818
6825
  right: "8px",
6819
- backgroundColor: $.accent,
6826
+ backgroundColor: D.accent,
6820
6827
  color: "white",
6821
6828
  padding: "8px",
6822
6829
  borderRadius: "50%",
@@ -6843,7 +6850,7 @@ const qs = [
6843
6850
  fontSize: "24px",
6844
6851
  fontWeight: 600,
6845
6852
  margin: "0 0 4px 0",
6846
- color: $.textPrimary
6853
+ color: D.textPrimary
6847
6854
  },
6848
6855
  children: d.name
6849
6856
  }
@@ -6852,7 +6859,7 @@ const qs = [
6852
6859
  "p",
6853
6860
  {
6854
6861
  style: {
6855
- color: $.textTertiary,
6862
+ color: D.textTertiary,
6856
6863
  margin: "0 0 8px 0"
6857
6864
  },
6858
6865
  children: d.email
@@ -6863,7 +6870,7 @@ const qs = [
6863
6870
  {
6864
6871
  style: {
6865
6872
  backgroundColor: d.isVerified ? r ? "rgba(16, 185, 129, 0.1)" : "rgba(16, 185, 129, 0.05)" : r ? "rgba(245, 158, 11, 0.1)" : "rgba(245, 158, 11, 0.05)",
6866
- color: d.isVerified ? $.success : $.warning,
6873
+ color: d.isVerified ? D.success : D.warning,
6867
6874
  border: `1px solid ${d.isVerified ? r ? "rgba(16, 185, 129, 0.3)" : "rgba(16, 185, 129, 0.2)" : r ? "rgba(245, 158, 11, 0.3)" : "rgba(245, 158, 11, 0.2)"}`,
6868
6875
  padding: "6px 12px",
6869
6876
  borderRadius: "20px",
@@ -6897,9 +6904,9 @@ const qs = [
6897
6904
  {
6898
6905
  onClick: () => w(!1),
6899
6906
  style: {
6900
- backgroundColor: $.surfaceLight,
6901
- border: `1px solid ${$.border}`,
6902
- color: $.textPrimary,
6907
+ backgroundColor: D.surfaceLight,
6908
+ border: `1px solid ${D.border}`,
6909
+ color: D.textPrimary,
6903
6910
  padding: "10px 20px",
6904
6911
  borderRadius: "6px",
6905
6912
  borderStyle: "solid",
@@ -6927,7 +6934,7 @@ const qs = [
6927
6934
  onClick: ve,
6928
6935
  disabled: x,
6929
6936
  style: {
6930
- background: `linear-gradient(to right, ${$.accent}, ${$.accentHover})`,
6937
+ background: `linear-gradient(to right, ${D.accent}, ${D.accentHover})`,
6931
6938
  opacity: x ? 0.7 : 1,
6932
6939
  color: "white",
6933
6940
  padding: "10px 20px",
@@ -6964,7 +6971,7 @@ const qs = [
6964
6971
  {
6965
6972
  onClick: () => w(!0),
6966
6973
  style: {
6967
- background: `linear-gradient(to right, ${$.accent}, ${$.accentHover})`,
6974
+ background: `linear-gradient(to right, ${D.accent}, ${D.accentHover})`,
6968
6975
  color: "white",
6969
6976
  padding: "10px 20px",
6970
6977
  borderRadius: "6px",
@@ -6990,7 +6997,7 @@ const qs = [
6990
6997
  !d.isVerified && /* @__PURE__ */ n.jsxs(
6991
6998
  "button",
6992
6999
  {
6993
- onClick: () => _(!0),
7000
+ onClick: () => U(!0),
6994
7001
  disabled: W,
6995
7002
  style: {
6996
7003
  background: "linear-gradient(to right, #fbbf24, #f59e0b)",
@@ -7029,8 +7036,8 @@ const qs = [
7029
7036
  "button",
7030
7037
  {
7031
7038
  style: {
7032
- backgroundColor: $.surfaceLight,
7033
- color: $.textPrimary,
7039
+ backgroundColor: D.surfaceLight,
7040
+ color: D.textPrimary,
7034
7041
  padding: "10px 20px",
7035
7042
  borderRadius: "6px",
7036
7043
  border: "none",
@@ -7057,34 +7064,34 @@ const qs = [
7057
7064
  M && /* @__PURE__ */ n.jsxs(
7058
7065
  "div",
7059
7066
  {
7060
- className: `dropdown-container ${k ? "closing" : ""}`,
7067
+ className: `dropdown-container ${E ? "closing" : ""}`,
7061
7068
  style: {
7062
7069
  position: "absolute",
7063
7070
  bottom: "100%",
7064
7071
  left: 0,
7065
7072
  right: 0,
7066
- backgroundColor: $.surface,
7067
- border: `1px solid ${$.border}`,
7073
+ backgroundColor: D.surface,
7074
+ border: `1px solid ${D.border}`,
7068
7075
  borderRadius: "12px 12px 0 0",
7069
7076
  boxShadow: "0 -8px 24px rgba(0, 0, 0, 0.25)",
7070
7077
  zIndex: 200,
7071
7078
  marginBottom: "6px",
7072
7079
  overflow: "hidden",
7073
- animation: `${k ? "drawerSlideDown" : "drawerSlideUp"} 0.25s ease-out forwards`
7080
+ animation: `${E ? "drawerSlideDown" : "drawerSlideUp"} 0.25s ease-out forwards`
7074
7081
  },
7075
7082
  children: [
7076
7083
  /* @__PURE__ */ n.jsxs(
7077
7084
  "button",
7078
7085
  {
7079
7086
  onClick: () => {
7080
- U(!0), G();
7087
+ _(!0), G();
7081
7088
  },
7082
7089
  style: {
7083
7090
  width: "100%",
7084
7091
  padding: "14px 18px",
7085
7092
  backgroundColor: "transparent",
7086
7093
  border: "none",
7087
- color: $.textPrimary,
7094
+ color: D.textPrimary,
7088
7095
  cursor: "pointer",
7089
7096
  transition: "all 0.2s ease",
7090
7097
  fontSize: "13px",
@@ -7094,8 +7101,8 @@ const qs = [
7094
7101
  gap: "8px",
7095
7102
  textAlign: "left"
7096
7103
  },
7097
- onMouseEnter: (E) => E.currentTarget.style.backgroundColor = $.surfaceLight,
7098
- onMouseLeave: (E) => E.currentTarget.style.backgroundColor = "transparent",
7104
+ onMouseEnter: (k) => k.currentTarget.style.backgroundColor = D.surfaceLight,
7105
+ onMouseLeave: (k) => k.currentTarget.style.backgroundColor = "transparent",
7099
7106
  children: [
7100
7107
  /* @__PURE__ */ n.jsx(ct, { size: 14, "aria-hidden": "true" }),
7101
7108
  "Change Password"
@@ -7123,10 +7130,10 @@ const qs = [
7123
7130
  gap: "8px",
7124
7131
  textAlign: "left"
7125
7132
  },
7126
- onMouseEnter: (E) => {
7127
- E.currentTarget.style.backgroundColor = r ? "rgba(239, 68, 68, 0.1)" : "rgba(239, 68, 68, 0.05)";
7133
+ onMouseEnter: (k) => {
7134
+ k.currentTarget.style.backgroundColor = r ? "rgba(239, 68, 68, 0.1)" : "rgba(239, 68, 68, 0.05)";
7128
7135
  },
7129
- onMouseLeave: (E) => E.currentTarget.style.backgroundColor = "transparent",
7136
+ onMouseLeave: (k) => k.currentTarget.style.backgroundColor = "transparent",
7130
7137
  children: [
7131
7138
  /* @__PURE__ */ n.jsx(dt, { size: 14, "aria-hidden": "true" }),
7132
7139
  "Logout"
@@ -7154,12 +7161,12 @@ const qs = [
7154
7161
  gap: "8px",
7155
7162
  textAlign: "left"
7156
7163
  },
7157
- onMouseEnter: (E) => {
7158
- E.currentTarget.style.backgroundColor = r ? "rgba(239, 68, 68, 0.1)" : "rgba(239, 68, 68, 0.05)";
7164
+ onMouseEnter: (k) => {
7165
+ k.currentTarget.style.backgroundColor = r ? "rgba(239, 68, 68, 0.1)" : "rgba(239, 68, 68, 0.05)";
7159
7166
  },
7160
- onMouseLeave: (E) => E.currentTarget.style.backgroundColor = "transparent",
7167
+ onMouseLeave: (k) => k.currentTarget.style.backgroundColor = "transparent",
7161
7168
  children: [
7162
- /* @__PURE__ */ n.jsx(Ne, { size: 14, "aria-hidden": "true" }),
7169
+ /* @__PURE__ */ n.jsx($e, { size: 14, "aria-hidden": "true" }),
7163
7170
  "Delete Account"
7164
7171
  ]
7165
7172
  }
@@ -7188,7 +7195,7 @@ const qs = [
7188
7195
  "section",
7189
7196
  {
7190
7197
  style: {
7191
- backgroundColor: $.surface,
7198
+ backgroundColor: D.surface,
7192
7199
  borderRadius: "16px",
7193
7200
  padding: "24px",
7194
7201
  boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)"
@@ -7201,7 +7208,7 @@ const qs = [
7201
7208
  fontSize: "20px",
7202
7209
  fontWeight: 600,
7203
7210
  margin: "0 0 24px 0",
7204
- color: $.textSecondary,
7211
+ color: D.textSecondary,
7205
7212
  display: "flex",
7206
7213
  alignItems: "center",
7207
7214
  gap: "8px"
@@ -7224,8 +7231,8 @@ const qs = [
7224
7231
  gap: "20px"
7225
7232
  }
7226
7233
  },
7227
- children: ur.map((E) => {
7228
- const D = E.icon;
7234
+ children: ur.map((k) => {
7235
+ const N = k.icon;
7229
7236
  return /* @__PURE__ */ n.jsxs(
7230
7237
  "div",
7231
7238
  {
@@ -7239,7 +7246,7 @@ const qs = [
7239
7246
  "label",
7240
7247
  {
7241
7248
  style: {
7242
- color: $.textTertiary,
7249
+ color: D.textTertiary,
7243
7250
  fontSize: "12px",
7244
7251
  fontWeight: 500,
7245
7252
  display: "flex",
@@ -7247,17 +7254,17 @@ const qs = [
7247
7254
  gap: "8px"
7248
7255
  },
7249
7256
  children: [
7250
- /* @__PURE__ */ n.jsx(D, { size: 16, "aria-hidden": "true" }),
7251
- E.label
7257
+ /* @__PURE__ */ n.jsx(N, { size: 16, "aria-hidden": "true" }),
7258
+ k.label
7252
7259
  ]
7253
7260
  }
7254
7261
  ),
7255
7262
  u ? /* @__PURE__ */ n.jsx(
7256
7263
  "input",
7257
7264
  {
7258
- type: E.type,
7259
- name: E.name,
7260
- value: d[E.name],
7265
+ type: k.type,
7266
+ name: k.name,
7267
+ value: d[k.name],
7261
7268
  onChange: (H) => m(
7262
7269
  (Q) => Q && { ...Q, [H.target.name]: H.target.value }
7263
7270
  ),
@@ -7266,7 +7273,7 @@ const qs = [
7266
7273
  borderRadius: "8px",
7267
7274
  border: `1px solid ${a}`,
7268
7275
  backgroundColor: "transparent",
7269
- color: $.textPrimary,
7276
+ color: D.textPrimary,
7270
7277
  fontSize: "12px",
7271
7278
  outline: "none",
7272
7279
  transition: "border-color 0.2s ease",
@@ -7274,8 +7281,8 @@ const qs = [
7274
7281
  width: "100%",
7275
7282
  boxSizing: "border-box"
7276
7283
  },
7277
- placeholder: `Enter ${E.label.toLowerCase()}`,
7278
- "aria-label": E.label
7284
+ placeholder: `Enter ${k.label.toLowerCase()}`,
7285
+ "aria-label": k.label
7279
7286
  }
7280
7287
  ) : /* @__PURE__ */ n.jsx(
7281
7288
  "div",
@@ -7289,15 +7296,15 @@ const qs = [
7289
7296
  display: "flex",
7290
7297
  alignItems: "center",
7291
7298
  boxSizing: "border-box",
7292
- color: $.textPrimary,
7299
+ color: D.textPrimary,
7293
7300
  backgroundColor: r ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.05)"
7294
7301
  },
7295
- children: E.value
7302
+ children: k.value
7296
7303
  }
7297
7304
  )
7298
7305
  ]
7299
7306
  },
7300
- E.name
7307
+ k.name
7301
7308
  );
7302
7309
  })
7303
7310
  }
@@ -7309,7 +7316,7 @@ const qs = [
7309
7316
  "section",
7310
7317
  {
7311
7318
  style: {
7312
- backgroundColor: $.surface,
7319
+ backgroundColor: D.surface,
7313
7320
  borderRadius: "16px",
7314
7321
  padding: "30px 24px",
7315
7322
  boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)"
@@ -7322,7 +7329,7 @@ const qs = [
7322
7329
  fontSize: "20px",
7323
7330
  fontWeight: 600,
7324
7331
  margin: "0 0 24px 0",
7325
- color: $.textSecondary,
7332
+ color: D.textSecondary,
7326
7333
  display: "flex",
7327
7334
  alignItems: "center",
7328
7335
  gap: "8px"
@@ -7359,7 +7366,7 @@ const qs = [
7359
7366
  display: "flex",
7360
7367
  alignItems: "center",
7361
7368
  gap: "12px",
7362
- color: $.textSecondary
7369
+ color: D.textSecondary
7363
7370
  },
7364
7371
  children: [
7365
7372
  /* @__PURE__ */ n.jsx(fe, { size: 16, "aria-hidden": "true" }),
@@ -7380,11 +7387,11 @@ const qs = [
7380
7387
  gap: "6px",
7381
7388
  ...d.isVerified ? {
7382
7389
  backgroundColor: r ? "rgba(16, 185, 129, 0.1)" : "rgba(16, 185, 129, 0.05)",
7383
- color: $.success,
7390
+ color: D.success,
7384
7391
  border: `1px solid ${r ? "rgba(16, 185, 129, 0.3)" : "rgba(16, 185, 129, 0.2)"}`
7385
7392
  } : {
7386
7393
  backgroundColor: r ? "rgba(245, 158, 11, 0.1)" : "rgba(245, 158, 11, 0.05)",
7387
- color: $.warning,
7394
+ color: D.warning,
7388
7395
  border: `1px solid ${r ? "rgba(245, 158, 11, 0.3)" : "rgba(245, 158, 11, 0.2)"}`
7389
7396
  }
7390
7397
  },
@@ -7412,7 +7419,7 @@ const qs = [
7412
7419
  "p",
7413
7420
  {
7414
7421
  style: {
7415
- color: $.textTertiary,
7422
+ color: D.textTertiary,
7416
7423
  fontSize: "12px",
7417
7424
  margin: 0
7418
7425
  },
@@ -7443,7 +7450,7 @@ const qs = [
7443
7450
  A(!1);
7444
7451
  },
7445
7452
  onUpdate: oe,
7446
- colors: $
7453
+ colors: D
7447
7454
  }
7448
7455
  ),
7449
7456
  /* @__PURE__ */ n.jsx(
@@ -7451,10 +7458,10 @@ const qs = [
7451
7458
  {
7452
7459
  userId: d.id,
7453
7460
  isOpen: y,
7454
- onClose: () => U(!1),
7455
- onSuccess: (E) => j("success", E),
7456
- onError: (E) => j("error", E),
7457
- colors: $
7461
+ onClose: () => _(!1),
7462
+ onSuccess: (k) => j("success", k),
7463
+ onError: (k) => j("error", k),
7464
+ colors: D
7458
7465
  }
7459
7466
  ),
7460
7467
  /* @__PURE__ */ n.jsx(
@@ -7464,26 +7471,26 @@ const qs = [
7464
7471
  token: t,
7465
7472
  isOpen: g,
7466
7473
  onClose: () => v(!1),
7467
- onSuccess: (E) => j("success", E),
7468
- onError: (E) => j("error", E),
7469
- colors: $
7474
+ onSuccess: (k) => j("success", k),
7475
+ onError: (k) => j("error", k),
7476
+ colors: D
7470
7477
  }
7471
7478
  ),
7472
7479
  /* @__PURE__ */ n.jsx(
7473
7480
  Hs,
7474
7481
  {
7475
- isOpen: L,
7482
+ isOpen: F,
7476
7483
  onClose: () => {
7477
- _(!1), l(!1), K({ email: d?.email || "", otp: "" });
7484
+ U(!1), l(!1), K({ email: d?.email || "", otp: "" });
7478
7485
  },
7479
7486
  onVerify: Y,
7480
7487
  onSendOTP: pe,
7481
7488
  verifyFormData: B,
7482
7489
  setVerifyFormData: K,
7483
- otpSent: F,
7490
+ otpSent: L,
7484
7491
  verifying: b,
7485
7492
  user: d,
7486
- colors: $,
7493
+ colors: D,
7487
7494
  darkMode: r
7488
7495
  }
7489
7496
  ),
@@ -7599,7 +7606,7 @@ const qs = [
7599
7606
  viewProfileLabel: O = "View Profile",
7600
7607
  logoutLabel: u = "Sign Out"
7601
7608
  }) => {
7602
- const w = ue(), [x, C] = R(!1), [T, A] = R(null), [y, U] = R(!0), [g, v] = R(null), L = ft(null), _ = ft(null), [M, X] = R(!1), [k, V] = R(!1);
7609
+ const w = ue(), [x, C] = R(!1), [T, A] = R(null), [y, _] = R(!0), [g, v] = R(null), F = ft(null), U = ft(null), [M, X] = R(!1), [E, V] = R(!1);
7603
7610
  te(() => {
7604
7611
  if (typeof window > "u") return;
7605
7612
  const l = () => {
@@ -7610,7 +7617,7 @@ const qs = [
7610
7617
  let l = !0;
7611
7618
  return (async () => {
7612
7619
  try {
7613
- if (U(!0), v(null), i) {
7620
+ if (_(!0), v(null), i) {
7614
7621
  if (!i.id || !i.name || !i.email)
7615
7622
  throw new Error("Invalid user data provided");
7616
7623
  l && A(i);
@@ -7632,7 +7639,7 @@ const qs = [
7632
7639
  } catch (S) {
7633
7640
  console.error("User initialization failed:", S), l && (A(null), v(S.message || "Failed to load user"));
7634
7641
  } finally {
7635
- l && U(!1);
7642
+ l && _(!1);
7636
7643
  }
7637
7644
  })(), () => {
7638
7645
  l = !1;
@@ -7640,8 +7647,8 @@ const qs = [
7640
7647
  }, [i, w]), te(() => {
7641
7648
  if (typeof window > "u") return;
7642
7649
  const l = () => {
7643
- if (!x || !_.current) return;
7644
- const b = _.current.getBoundingClientRect(), S = window.innerWidth, j = window.innerHeight, G = 280, pe = S - b.right, Y = b.left;
7650
+ if (!x || !U.current) return;
7651
+ const b = U.current.getBoundingClientRect(), S = window.innerWidth, j = window.innerHeight, G = 280, pe = S - b.right, Y = b.left;
7645
7652
  j - b.bottom;
7646
7653
  const oe = pe >= G || pe > Y;
7647
7654
  X(oe);
@@ -7651,7 +7658,7 @@ const qs = [
7651
7658
  if (typeof window > "u" || typeof document > "u")
7652
7659
  return;
7653
7660
  const l = (j) => {
7654
- L.current && !L.current.contains(j.target) && !_.current?.contains(j.target) && C(!1);
7661
+ F.current && !F.current.contains(j.target) && !U.current?.contains(j.target) && C(!1);
7655
7662
  }, b = (j) => {
7656
7663
  j.key === "Escape" && C(!1);
7657
7664
  }, S = () => {
@@ -7693,19 +7700,19 @@ const qs = [
7693
7700
  avatarButton: {
7694
7701
  display: "flex",
7695
7702
  alignItems: "center",
7696
- gap: k ? "6px" : "8px",
7697
- padding: k ? "6px 10px 6px 6px" : "8px 12px 8px 8px",
7703
+ gap: E ? "6px" : "8px",
7704
+ padding: E ? "6px 10px 6px 6px" : "8px 12px 8px 8px",
7698
7705
  borderRadius: "24px",
7699
7706
  backgroundColor: z.surface,
7700
7707
  cursor: "pointer",
7701
7708
  transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
7702
- minWidth: k ? "auto" : "140px",
7703
- maxWidth: k ? "200px" : "none",
7709
+ minWidth: E ? "auto" : "140px",
7710
+ maxWidth: E ? "200px" : "none",
7704
7711
  outline: "none"
7705
7712
  },
7706
7713
  avatarImage: {
7707
- width: k ? "28px" : "32px",
7708
- height: k ? "28px" : "32px",
7714
+ width: E ? "28px" : "32px",
7715
+ height: E ? "28px" : "32px",
7709
7716
  borderRadius: "50%",
7710
7717
  objectFit: "cover",
7711
7718
  border: `2px solid ${z.borderLight}`,
@@ -7720,23 +7727,23 @@ const qs = [
7720
7727
  overflow: "hidden"
7721
7728
  },
7722
7729
  userName: {
7723
- fontSize: k ? "13px" : "14px",
7730
+ fontSize: E ? "13px" : "14px",
7724
7731
  fontWeight: 600,
7725
7732
  color: z.textPrimary,
7726
7733
  lineHeight: "1.2",
7727
7734
  whiteSpace: "nowrap",
7728
7735
  overflow: "hidden",
7729
7736
  textOverflow: "ellipsis",
7730
- maxWidth: k ? "80px" : "120px"
7737
+ maxWidth: E ? "80px" : "120px"
7731
7738
  },
7732
7739
  userEmail: {
7733
- fontSize: k ? "11px" : "12px",
7740
+ fontSize: E ? "11px" : "12px",
7734
7741
  color: z.textTertiary,
7735
7742
  lineHeight: "1.2",
7736
7743
  whiteSpace: "nowrap",
7737
7744
  overflow: "hidden",
7738
7745
  textOverflow: "ellipsis",
7739
- maxWidth: k ? "80px" : "120px"
7746
+ maxWidth: E ? "80px" : "120px"
7740
7747
  },
7741
7748
  chevron: {
7742
7749
  transition: "transform 0.2s ease",
@@ -7765,7 +7772,7 @@ const qs = [
7765
7772
  overflow: "hidden"
7766
7773
  },
7767
7774
  dropdownSection: {
7768
- padding: k ? "10px 12px" : "0px 16px",
7775
+ padding: E ? "10px 12px" : "0px 16px",
7769
7776
  "&:last-child": {
7770
7777
  borderBottom: "none"
7771
7778
  }
@@ -7773,12 +7780,12 @@ const qs = [
7773
7780
  userSection: {
7774
7781
  display: "flex",
7775
7782
  alignItems: "center",
7776
- gap: k ? "10px" : "12px",
7777
- padding: k ? "14px" : "16px"
7783
+ gap: E ? "10px" : "12px",
7784
+ padding: E ? "14px" : "16px"
7778
7785
  },
7779
7786
  dropdownAvatar: {
7780
- width: k ? "40px" : "48px",
7781
- height: k ? "40px" : "48px",
7787
+ width: E ? "40px" : "48px",
7788
+ height: E ? "40px" : "48px",
7782
7789
  borderRadius: "50%",
7783
7790
  objectFit: "cover",
7784
7791
  border: `2px solid ${z.borderLight}`,
@@ -7791,7 +7798,7 @@ const qs = [
7791
7798
  minWidth: 0
7792
7799
  },
7793
7800
  dropdownUserName: {
7794
- fontSize: k ? "15px" : "16px",
7801
+ fontSize: E ? "15px" : "16px",
7795
7802
  fontWeight: 600,
7796
7803
  color: z.textPrimary,
7797
7804
  lineHeight: "1.2",
@@ -7800,7 +7807,7 @@ const qs = [
7800
7807
  textOverflow: "ellipsis"
7801
7808
  },
7802
7809
  dropdownUserEmail: {
7803
- fontSize: k ? "13px" : "14px",
7810
+ fontSize: E ? "13px" : "14px",
7804
7811
  color: z.textSecondary,
7805
7812
  lineHeight: "1.2",
7806
7813
  overflow: "hidden",
@@ -7809,8 +7816,8 @@ const qs = [
7809
7816
  menuItem: {
7810
7817
  display: "flex",
7811
7818
  alignItems: "center",
7812
- gap: k ? "10px" : "12px",
7813
- padding: k ? "10px 12px" : "12px 16px",
7819
+ gap: E ? "10px" : "12px",
7820
+ padding: E ? "10px 12px" : "12px 16px",
7814
7821
  borderRadius: "8px",
7815
7822
  cursor: "pointer",
7816
7823
  transition: "all 0.15s ease",
@@ -7819,7 +7826,7 @@ const qs = [
7819
7826
  border: "none",
7820
7827
  background: "none",
7821
7828
  width: "100%",
7822
- fontSize: k ? "13px" : "14px",
7829
+ fontSize: E ? "13px" : "14px",
7823
7830
  textAlign: "left",
7824
7831
  outline: "none"
7825
7832
  },
@@ -7827,38 +7834,38 @@ const qs = [
7827
7834
  flex: 1
7828
7835
  },
7829
7836
  icon: {
7830
- width: k ? "16px" : "18px",
7831
- height: k ? "16px" : "18px",
7837
+ width: E ? "16px" : "18px",
7838
+ height: E ? "16px" : "18px",
7832
7839
  color: z.textSecondary,
7833
7840
  flexShrink: 0
7834
7841
  },
7835
7842
  logoutButton: {
7836
7843
  display: "flex",
7837
7844
  alignItems: "center",
7838
- gap: k ? "10px" : "12px",
7839
- padding: k ? "10px 12px" : "12px 16px",
7845
+ gap: E ? "10px" : "12px",
7846
+ padding: E ? "10px 12px" : "12px 16px",
7840
7847
  borderRadius: "8px",
7841
7848
  cursor: "pointer",
7842
7849
  transition: "all 0.15s ease",
7843
7850
  background: "none",
7844
7851
  border: "none",
7845
7852
  width: "100%",
7846
- fontSize: k ? "13px" : "14px",
7853
+ fontSize: E ? "13px" : "14px",
7847
7854
  color: z.error,
7848
7855
  textAlign: "left",
7849
7856
  outline: "none"
7850
7857
  },
7851
7858
  loadingText: {
7852
- padding: k ? "16px 12px" : "20px 16px",
7859
+ padding: E ? "16px 12px" : "20px 16px",
7853
7860
  textAlign: "center",
7854
7861
  color: z.textSecondary,
7855
- fontSize: k ? "13px" : "14px"
7862
+ fontSize: E ? "13px" : "14px"
7856
7863
  },
7857
7864
  errorState: {
7858
- padding: k ? "16px 12px" : "20px 16px",
7865
+ padding: E ? "16px 12px" : "20px 16px",
7859
7866
  textAlign: "center",
7860
7867
  color: z.textSecondary,
7861
- fontSize: k ? "13px" : "14px",
7868
+ fontSize: E ? "13px" : "14px",
7862
7869
  display: "flex",
7863
7870
  alignItems: "center",
7864
7871
  justifyContent: "center",
@@ -7878,7 +7885,7 @@ const qs = [
7878
7885
  transition: "background-color 0.2s ease"
7879
7886
  }
7880
7887
  }, W = async () => {
7881
- v(null), U(!0);
7888
+ v(null), _(!0);
7882
7889
  try {
7883
7890
  if (i) {
7884
7891
  if (!i.id || !i.name || !i.email)
@@ -7901,21 +7908,21 @@ const qs = [
7901
7908
  } catch (l) {
7902
7909
  console.error("Retry failed:", l), A(null), v(l.message || "Failed to reload user");
7903
7910
  } finally {
7904
- U(!1);
7911
+ _(!1);
7905
7912
  }
7906
7913
  }, Z = (l, b) => {
7907
7914
  (l.key === "Enter" || l.key === " ") && (l.preventDefault(), b());
7908
7915
  }, B = () => a || T?.profileUrl, K = () => {
7909
7916
  const l = B();
7910
7917
  l && window.open(l, "_self", "noopener,noreferrer");
7911
- }, F = () => {
7918
+ }, L = () => {
7912
7919
  c && window.open(c, "_self", "noopener,noreferrer");
7913
7920
  };
7914
7921
  return /* @__PURE__ */ n.jsxs(
7915
7922
  "div",
7916
7923
  {
7917
7924
  style: I.wrapper,
7918
- ref: L,
7925
+ ref: F,
7919
7926
  className: o,
7920
7927
  role: "menu",
7921
7928
  "aria-label": "User menu",
@@ -7923,7 +7930,7 @@ const qs = [
7923
7930
  s === "classic" ? /* @__PURE__ */ n.jsx(
7924
7931
  "div",
7925
7932
  {
7926
- ref: _,
7933
+ ref: U,
7927
7934
  onClick: () => C((l) => !l),
7928
7935
  onKeyDown: (l) => Z(l, () => C((b) => !b)),
7929
7936
  tabIndex: 0,
@@ -7937,8 +7944,8 @@ const qs = [
7937
7944
  src: T.avatarUrl,
7938
7945
  alt: `${T?.name || "User"}'s avatar`,
7939
7946
  style: {
7940
- width: k ? "34px" : "36px",
7941
- height: k ? "34px" : "36px",
7947
+ width: E ? "34px" : "36px",
7948
+ height: E ? "34px" : "36px",
7942
7949
  borderRadius: "50%",
7943
7950
  objectFit: "cover",
7944
7951
  border: `2px solid ${z.borderLight}`,
@@ -7960,8 +7967,8 @@ const qs = [
7960
7967
  )}`,
7961
7968
  alt: "Default user avatar",
7962
7969
  style: {
7963
- width: k ? "34px" : "40px",
7964
- height: k ? "34px" : "40px",
7970
+ width: E ? "34px" : "40px",
7971
+ height: E ? "34px" : "40px",
7965
7972
  borderRadius: "50%",
7966
7973
  objectFit: "cover",
7967
7974
  border: `2px solid ${z.borderLight}`,
@@ -7974,7 +7981,7 @@ const qs = [
7974
7981
  ) : /* @__PURE__ */ n.jsxs(
7975
7982
  "div",
7976
7983
  {
7977
- ref: _,
7984
+ ref: U,
7978
7985
  style: I.avatarButton,
7979
7986
  onClick: () => C((l) => !l),
7980
7987
  onKeyDown: (l) => Z(l, () => C((b) => !b)),
@@ -8014,14 +8021,14 @@ const qs = [
8014
8021
  loading: "lazy"
8015
8022
  }
8016
8023
  ),
8017
- !k && /* @__PURE__ */ n.jsxs("div", { style: I.userInfo, children: [
8024
+ !E && /* @__PURE__ */ n.jsxs("div", { style: I.userInfo, children: [
8018
8025
  /* @__PURE__ */ n.jsx("div", { style: I.userName, title: T?.name, children: T?.name || "Guest" }),
8019
8026
  T?.email && /* @__PURE__ */ n.jsx("div", { style: I.userEmail, title: T.email, children: T.email })
8020
8027
  ] }),
8021
8028
  /* @__PURE__ */ n.jsx(
8022
8029
  ts,
8023
8030
  {
8024
- size: k ? 14 : 16,
8031
+ size: E ? 14 : 16,
8025
8032
  style: I.chevron,
8026
8033
  "aria-hidden": "true"
8027
8034
  }
@@ -8082,18 +8089,18 @@ const qs = [
8082
8089
  "button",
8083
8090
  {
8084
8091
  style: I.menuItem,
8085
- onClick: F,
8092
+ onClick: L,
8086
8093
  onMouseOver: (l) => {
8087
8094
  l.currentTarget.style.backgroundColor = z.surfaceHover;
8088
8095
  },
8089
8096
  onMouseOut: (l) => {
8090
8097
  l.currentTarget.style.backgroundColor = "transparent";
8091
8098
  },
8092
- onKeyDown: (l) => Z(l, F),
8099
+ onKeyDown: (l) => Z(l, L),
8093
8100
  role: "menuitem",
8094
8101
  tabIndex: 0,
8095
8102
  children: [
8096
- /* @__PURE__ */ n.jsx(Us, { style: I.icon, "aria-hidden": "true" }),
8103
+ /* @__PURE__ */ n.jsx(_s, { style: I.icon, "aria-hidden": "true" }),
8097
8104
  /* @__PURE__ */ n.jsx("span", { style: I.menuItemText, children: P })
8098
8105
  ]
8099
8106
  }
@@ -8216,8 +8223,8 @@ const qs = [
8216
8223
  }
8217
8224
  }, []);
8218
8225
  const w = (g, v) => {
8219
- let L = parseInt(g.replace("#", ""), 16), _ = (L >> 16) + v, M = (L >> 8 & 255) + v, X = (L & 255) + v;
8220
- return _ = Math.min(255, Math.max(0, _)), M = Math.min(255, Math.max(0, M)), X = Math.min(255, Math.max(0, X)), `#${(X | M << 8 | _ << 16).toString(16).padStart(6, "0")}`;
8226
+ let F = parseInt(g.replace("#", ""), 16), U = (F >> 16) + v, M = (F >> 8 & 255) + v, X = (F & 255) + v;
8227
+ return U = Math.min(255, Math.max(0, U)), M = Math.min(255, Math.max(0, M)), X = Math.min(255, Math.max(0, X)), `#${(X | M << 8 | U << 16).toString(16).padStart(6, "0")}`;
8221
8228
  }, x = e ? {
8222
8229
  surface: "#000000",
8223
8230
  textPrimary: "#ffffff",
@@ -8283,8 +8290,8 @@ const qs = [
8283
8290
  otp: c.otp
8284
8291
  });
8285
8292
  if (v.success) {
8286
- const L = { ...t, isVerified: !0 };
8287
- s?.(L), C("success", v.message || "Email verified!"), d(!1), h({ email: t.email, otp: "" });
8293
+ const F = { ...t, isVerified: !0 };
8294
+ s?.(F), C("success", v.message || "Email verified!"), d(!1), h({ email: t.email, otp: "" });
8288
8295
  } else
8289
8296
  C("error", v.message || "Verification failed");
8290
8297
  } catch (v) {
@@ -8301,7 +8308,7 @@ const qs = [
8301
8308
  color: x.textPrimary,
8302
8309
  fontSize: 14,
8303
8310
  outline: "none"
8304
- }, U = (g = !1) => ({
8311
+ }, _ = (g = !1) => ({
8305
8312
  flex: 1,
8306
8313
  padding: 12,
8307
8314
  borderRadius: 8,
@@ -8500,7 +8507,7 @@ const qs = [
8500
8507
  type: "submit",
8501
8508
  disabled: m,
8502
8509
  style: {
8503
- ...U(m),
8510
+ ..._(m),
8504
8511
  borderRadius: 12,
8505
8512
  padding: "12px 16px",
8506
8513
  fontSize: 14
@@ -8517,7 +8524,7 @@ const qs = [
8517
8524
  onClick: T,
8518
8525
  disabled: m || !t?.id,
8519
8526
  style: {
8520
- ...U(m),
8527
+ ..._(m),
8521
8528
  borderRadius: 12,
8522
8529
  padding: "12px 16px",
8523
8530
  fontSize: 14
@@ -8531,15 +8538,15 @@ const qs = [
8531
8538
  ]
8532
8539
  }
8533
8540
  );
8534
- }, Le = {
8541
+ }, Fe = {
8535
8542
  baseUrl: "",
8536
8543
  apiKey: "",
8537
8544
  appId: ""
8538
8545
  }, wi = (t) => {
8539
8546
  if (!t.baseUrl || !t.apiKey || !t.appId)
8540
8547
  throw new Error("baseUrl, apiKey, and appId are required");
8541
- Le.baseUrl = t.baseUrl, Le.apiKey = t.apiKey, Le.appId = t.appId;
8542
- }, ji = () => Le;
8548
+ Fe.baseUrl = t.baseUrl, Fe.apiKey = t.apiKey, Fe.appId = t.appId;
8549
+ }, ji = () => Fe;
8543
8550
  export {
8544
8551
  pi as AuthixProvider,
8545
8552
  ui as NeuctraAuthix,