@hari_digitus/sms-ui-library 6.0.1 → 6.0.3

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,6 +1,5 @@
1
- import * as u from "react";
2
- import wt from "react";
3
- var he = { exports: {} }, ae = {};
1
+ import We, { createContext as pr, useState as K, useContext as vr, useEffect as hr } from "react";
2
+ var oe = { exports: {} }, q = {};
4
3
  /**
5
4
  * @license React
6
5
  * react-jsx-runtime.production.min.js
@@ -10,21 +9,21 @@ var he = { exports: {} }, ae = {};
10
9
  * This source code is licensed under the MIT license found in the
11
10
  * LICENSE file in the root directory of this source tree.
12
11
  */
13
- var vt;
14
- function gr() {
15
- if (vt) return ae;
16
- vt = 1;
17
- var e = wt, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function l(c, s, m) {
19
- var f, h = {}, v = null, y = null;
20
- m !== void 0 && (v = "" + m), s.key !== void 0 && (v = "" + s.key), s.ref !== void 0 && (y = s.ref);
21
- for (f in s) a.call(s, f) && !o.hasOwnProperty(f) && (h[f] = s[f]);
22
- if (c && c.defaultProps) for (f in s = c.defaultProps, s) h[f] === void 0 && (h[f] = s[f]);
23
- return { $$typeof: t, type: c, key: v, ref: y, props: h, _owner: i.current };
12
+ var Fe;
13
+ function mr() {
14
+ if (Fe) return q;
15
+ Fe = 1;
16
+ var C = We, O = Symbol.for("react.element"), m = Symbol.for("react.fragment"), w = Object.prototype.hasOwnProperty, T = C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, P = { key: !0, ref: !0, __self: !0, __source: !0 };
17
+ function N(x, p, I) {
18
+ var g, R = {}, S = null, L = null;
19
+ I !== void 0 && (S = "" + I), p.key !== void 0 && (S = "" + p.key), p.ref !== void 0 && (L = p.ref);
20
+ for (g in p) w.call(p, g) && !P.hasOwnProperty(g) && (R[g] = p[g]);
21
+ if (x && x.defaultProps) for (g in p = x.defaultProps, p) R[g] === void 0 && (R[g] = p[g]);
22
+ return { $$typeof: O, type: x, key: S, ref: L, props: R, _owner: T.current };
24
23
  }
25
- return ae.Fragment = n, ae.jsx = l, ae.jsxs = l, ae;
24
+ return q.Fragment = m, q.jsx = N, q.jsxs = N, q;
26
25
  }
27
- var ie = {};
26
+ var H = {};
28
27
  /**
29
28
  * @license React
30
29
  * react-jsx-runtime.development.js
@@ -34,91 +33,91 @@ var ie = {};
34
33
  * This source code is licensed under the MIT license found in the
35
34
  * LICENSE file in the root directory of this source tree.
36
35
  */
37
- var gt;
38
- function yr() {
39
- return gt || (gt = 1, process.env.NODE_ENV !== "production" && (function() {
40
- var e = wt, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), c = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), y = Symbol.for("react.offscreen"), b = Symbol.iterator, E = "@@iterator";
41
- function g(r) {
42
- if (r === null || typeof r != "object")
36
+ var Le;
37
+ function xr() {
38
+ return Le || (Le = 1, process.env.NODE_ENV !== "production" && (function() {
39
+ var C = We, O = Symbol.for("react.element"), m = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), T = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), N = Symbol.for("react.provider"), x = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), L = Symbol.for("react.offscreen"), E = Symbol.iterator, G = "@@iterator";
40
+ function Y(e) {
41
+ if (e === null || typeof e != "object")
43
42
  return null;
44
- var d = b && r[b] || r[E];
45
- return typeof d == "function" ? d : null;
43
+ var r = E && e[E] || e[G];
44
+ return typeof r == "function" ? r : null;
46
45
  }
47
- var w = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
- function R(r) {
46
+ var A = C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
47
+ function v(e) {
49
48
  {
50
- for (var d = arguments.length, p = new Array(d > 1 ? d - 1 : 0), x = 1; x < d; x++)
51
- p[x - 1] = arguments[x];
52
- _("error", r, p);
49
+ for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++)
50
+ t[a - 1] = arguments[a];
51
+ le("error", e, t);
53
52
  }
54
53
  }
55
- function _(r, d, p) {
54
+ function le(e, r, t) {
56
55
  {
57
- var x = w.ReactDebugCurrentFrame, T = x.getStackAddendum();
58
- T !== "" && (d += "%s", p = p.concat([T]));
59
- var k = p.map(function(S) {
60
- return String(S);
56
+ var a = A.ReactDebugCurrentFrame, o = a.getStackAddendum();
57
+ o !== "" && (r += "%s", t = t.concat([o]));
58
+ var l = t.map(function(s) {
59
+ return String(s);
61
60
  });
62
- k.unshift("Warning: " + d), Function.prototype.apply.call(console[r], console, k);
61
+ l.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, l);
63
62
  }
64
63
  }
65
- var $ = !1, j = !1, A = !1, H = !1, z = !1, K;
66
- K = Symbol.for("react.module.reference");
67
- function re(r) {
68
- return !!(typeof r == "string" || typeof r == "function" || r === a || r === o || z || r === i || r === m || r === f || H || r === y || $ || j || A || typeof r == "object" && r !== null && (r.$$typeof === v || r.$$typeof === h || r.$$typeof === l || r.$$typeof === c || r.$$typeof === s || // This needs to include all possible module reference object
64
+ var ce = !1, z = !1, ue = !1, X = !1, M = !1, U;
65
+ U = Symbol.for("react.module.reference");
66
+ function Z(e) {
67
+ return !!(typeof e == "string" || typeof e == "function" || e === w || e === P || M || e === T || e === I || e === g || X || e === L || ce || z || ue || typeof e == "object" && e !== null && (e.$$typeof === S || e.$$typeof === R || e.$$typeof === N || e.$$typeof === x || e.$$typeof === p || // This needs to include all possible module reference object
69
68
  // types supported by any Flight configuration anywhere since
70
69
  // we don't know which Flight build this will end up being used
71
70
  // with.
72
- r.$$typeof === K || r.getModuleId !== void 0));
71
+ e.$$typeof === U || e.getModuleId !== void 0));
73
72
  }
74
- function we(r, d, p) {
75
- var x = r.displayName;
76
- if (x)
77
- return x;
78
- var T = d.displayName || d.name || "";
79
- return T !== "" ? p + "(" + T + ")" : p;
73
+ function fe(e, r, t) {
74
+ var a = e.displayName;
75
+ if (a)
76
+ return a;
77
+ var o = r.displayName || r.name || "";
78
+ return o !== "" ? t + "(" + o + ")" : t;
80
79
  }
81
- function se(r) {
82
- return r.displayName || "Context";
80
+ function Q(e) {
81
+ return e.displayName || "Context";
83
82
  }
84
- function W(r) {
85
- if (r == null)
83
+ function k(e) {
84
+ if (e == null)
86
85
  return null;
87
- if (typeof r.tag == "number" && R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
88
- return r.displayName || r.name || null;
89
- if (typeof r == "string")
90
- return r;
91
- switch (r) {
92
- case a:
86
+ if (typeof e.tag == "number" && v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
87
+ return e.displayName || e.name || null;
88
+ if (typeof e == "string")
89
+ return e;
90
+ switch (e) {
91
+ case w:
93
92
  return "Fragment";
94
- case n:
93
+ case m:
95
94
  return "Portal";
96
- case o:
95
+ case P:
97
96
  return "Profiler";
98
- case i:
97
+ case T:
99
98
  return "StrictMode";
100
- case m:
99
+ case I:
101
100
  return "Suspense";
102
- case f:
101
+ case g:
103
102
  return "SuspenseList";
104
103
  }
105
- if (typeof r == "object")
106
- switch (r.$$typeof) {
107
- case c:
108
- var d = r;
109
- return se(d) + ".Consumer";
110
- case l:
111
- var p = r;
112
- return se(p._context) + ".Provider";
113
- case s:
114
- return we(r, r.render, "ForwardRef");
115
- case h:
116
- var x = r.displayName || null;
117
- return x !== null ? x : W(r.type) || "Memo";
118
- case v: {
119
- var T = r, k = T._payload, S = T._init;
104
+ if (typeof e == "object")
105
+ switch (e.$$typeof) {
106
+ case x:
107
+ var r = e;
108
+ return Q(r) + ".Consumer";
109
+ case N:
110
+ var t = e;
111
+ return Q(t._context) + ".Provider";
112
+ case p:
113
+ return fe(e, e.render, "ForwardRef");
114
+ case R:
115
+ var a = e.displayName || null;
116
+ return a !== null ? a : k(e.type) || "Memo";
117
+ case S: {
118
+ var o = e, l = o._payload, s = o._init;
120
119
  try {
121
- return W(S(k));
120
+ return k(s(l));
122
121
  } catch {
123
122
  return null;
124
123
  }
@@ -126,2212 +125,746 @@ function yr() {
126
125
  }
127
126
  return null;
128
127
  }
129
- var V = Object.assign, N = 0, qe, ze, Ke, Ge, Xe, Ze, Qe;
130
- function et() {
128
+ var c = Object.assign, j = 0, D, u, ee, re, B, V, h;
129
+ function ne() {
131
130
  }
132
- et.__reactDisabledLog = !0;
133
- function Vt() {
131
+ ne.__reactDisabledLog = !0;
132
+ function de() {
134
133
  {
135
- if (N === 0) {
136
- qe = console.log, ze = console.info, Ke = console.warn, Ge = console.error, Xe = console.group, Ze = console.groupCollapsed, Qe = console.groupEnd;
137
- var r = {
134
+ if (j === 0) {
135
+ D = console.log, u = console.info, ee = console.warn, re = console.error, B = console.group, V = console.groupCollapsed, h = console.groupEnd;
136
+ var e = {
138
137
  configurable: !0,
139
138
  enumerable: !0,
140
- value: et,
139
+ value: ne,
141
140
  writable: !0
142
141
  };
143
142
  Object.defineProperties(console, {
144
- info: r,
145
- log: r,
146
- warn: r,
147
- error: r,
148
- group: r,
149
- groupCollapsed: r,
150
- groupEnd: r
143
+ info: e,
144
+ log: e,
145
+ warn: e,
146
+ error: e,
147
+ group: e,
148
+ groupCollapsed: e,
149
+ groupEnd: e
151
150
  });
152
151
  }
153
- N++;
152
+ j++;
154
153
  }
155
154
  }
156
- function Yt() {
155
+ function Me() {
157
156
  {
158
- if (N--, N === 0) {
159
- var r = {
157
+ if (j--, j === 0) {
158
+ var e = {
160
159
  configurable: !0,
161
160
  enumerable: !0,
162
161
  writable: !0
163
162
  };
164
163
  Object.defineProperties(console, {
165
- log: V({}, r, {
166
- value: qe
164
+ log: c({}, e, {
165
+ value: D
167
166
  }),
168
- info: V({}, r, {
169
- value: ze
167
+ info: c({}, e, {
168
+ value: u
170
169
  }),
171
- warn: V({}, r, {
172
- value: Ke
170
+ warn: c({}, e, {
171
+ value: ee
173
172
  }),
174
- error: V({}, r, {
175
- value: Ge
173
+ error: c({}, e, {
174
+ value: re
176
175
  }),
177
- group: V({}, r, {
178
- value: Xe
176
+ group: c({}, e, {
177
+ value: B
179
178
  }),
180
- groupCollapsed: V({}, r, {
181
- value: Ze
179
+ groupCollapsed: c({}, e, {
180
+ value: V
182
181
  }),
183
- groupEnd: V({}, r, {
184
- value: Qe
182
+ groupEnd: c({}, e, {
183
+ value: h
185
184
  })
186
185
  });
187
186
  }
188
- N < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
187
+ j < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
188
  }
190
189
  }
191
- var Ce = w.ReactCurrentDispatcher, Se;
192
- function ue(r, d, p) {
190
+ var pe = A.ReactCurrentDispatcher, ve;
191
+ function te(e, r, t) {
193
192
  {
194
- if (Se === void 0)
193
+ if (ve === void 0)
195
194
  try {
196
195
  throw Error();
197
- } catch (T) {
198
- var x = T.stack.trim().match(/\n( *(at )?)/);
199
- Se = x && x[1] || "";
196
+ } catch (o) {
197
+ var a = o.stack.trim().match(/\n( *(at )?)/);
198
+ ve = a && a[1] || "";
200
199
  }
201
200
  return `
202
- ` + Se + r;
201
+ ` + ve + e;
203
202
  }
204
203
  }
205
- var Pe = !1, ce;
204
+ var he = !1, ae;
206
205
  {
207
- var Jt = typeof WeakMap == "function" ? WeakMap : Map;
208
- ce = new Jt();
206
+ var Ue = typeof WeakMap == "function" ? WeakMap : Map;
207
+ ae = new Ue();
209
208
  }
210
- function tt(r, d) {
211
- if (!r || Pe)
209
+ function ye(e, r) {
210
+ if (!e || he)
212
211
  return "";
213
212
  {
214
- var p = ce.get(r);
215
- if (p !== void 0)
216
- return p;
213
+ var t = ae.get(e);
214
+ if (t !== void 0)
215
+ return t;
217
216
  }
218
- var x;
219
- Pe = !0;
220
- var T = Error.prepareStackTrace;
217
+ var a;
218
+ he = !0;
219
+ var o = Error.prepareStackTrace;
221
220
  Error.prepareStackTrace = void 0;
222
- var k;
223
- k = Ce.current, Ce.current = null, Vt();
221
+ var l;
222
+ l = pe.current, pe.current = null, de();
224
223
  try {
225
- if (d) {
226
- var S = function() {
224
+ if (r) {
225
+ var s = function() {
227
226
  throw Error();
228
227
  };
229
- if (Object.defineProperty(S.prototype, "props", {
228
+ if (Object.defineProperty(s.prototype, "props", {
230
229
  set: function() {
231
230
  throw Error();
232
231
  }
233
232
  }), typeof Reflect == "object" && Reflect.construct) {
234
233
  try {
235
- Reflect.construct(S, []);
236
- } catch (I) {
237
- x = I;
234
+ Reflect.construct(s, []);
235
+ } catch (y) {
236
+ a = y;
238
237
  }
239
- Reflect.construct(r, [], S);
238
+ Reflect.construct(e, [], s);
240
239
  } else {
241
240
  try {
242
- S.call();
243
- } catch (I) {
244
- x = I;
241
+ s.call();
242
+ } catch (y) {
243
+ a = y;
245
244
  }
246
- r.call(S.prototype);
245
+ e.call(s.prototype);
247
246
  }
248
247
  } else {
249
248
  try {
250
249
  throw Error();
251
- } catch (I) {
252
- x = I;
250
+ } catch (y) {
251
+ a = y;
253
252
  }
254
- r();
253
+ e();
255
254
  }
256
- } catch (I) {
257
- if (I && x && typeof I.stack == "string") {
258
- for (var C = I.stack.split(`
259
- `), F = x.stack.split(`
260
- `), L = C.length - 1, O = F.length - 1; L >= 1 && O >= 0 && C[L] !== F[O]; )
261
- O--;
262
- for (; L >= 1 && O >= 0; L--, O--)
263
- if (C[L] !== F[O]) {
264
- if (L !== 1 || O !== 1)
255
+ } catch (y) {
256
+ if (y && a && typeof y.stack == "string") {
257
+ for (var i = y.stack.split(`
258
+ `), b = a.stack.split(`
259
+ `), f = i.length - 1, d = b.length - 1; f >= 1 && d >= 0 && i[f] !== b[d]; )
260
+ d--;
261
+ for (; f >= 1 && d >= 0; f--, d--)
262
+ if (i[f] !== b[d]) {
263
+ if (f !== 1 || d !== 1)
265
264
  do
266
- if (L--, O--, O < 0 || C[L] !== F[O]) {
267
- var M = `
268
- ` + C[L].replace(" at new ", " at ");
269
- return r.displayName && M.includes("<anonymous>") && (M = M.replace("<anonymous>", r.displayName)), typeof r == "function" && ce.set(r, M), M;
265
+ if (f--, d--, d < 0 || i[f] !== b[d]) {
266
+ var _ = `
267
+ ` + i[f].replace(" at new ", " at ");
268
+ return e.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", e.displayName)), typeof e == "function" && ae.set(e, _), _;
270
269
  }
271
- while (L >= 1 && O >= 0);
270
+ while (f >= 1 && d >= 0);
272
271
  break;
273
272
  }
274
273
  }
275
274
  } finally {
276
- Pe = !1, Ce.current = k, Yt(), Error.prepareStackTrace = T;
275
+ he = !1, pe.current = l, Me(), Error.prepareStackTrace = o;
277
276
  }
278
- var ee = r ? r.displayName || r.name : "", X = ee ? ue(ee) : "";
279
- return typeof r == "function" && ce.set(r, X), X;
277
+ var W = e ? e.displayName || e.name : "", F = W ? te(W) : "";
278
+ return typeof e == "function" && ae.set(e, F), F;
280
279
  }
281
- function qt(r, d, p) {
282
- return tt(r, !1);
280
+ function Be(e, r, t) {
281
+ return ye(e, !1);
283
282
  }
284
- function zt(r) {
285
- var d = r.prototype;
286
- return !!(d && d.isReactComponent);
283
+ function Ve(e) {
284
+ var r = e.prototype;
285
+ return !!(r && r.isReactComponent);
287
286
  }
288
- function fe(r, d, p) {
289
- if (r == null)
287
+ function ie(e, r, t) {
288
+ if (e == null)
290
289
  return "";
291
- if (typeof r == "function")
292
- return tt(r, zt(r));
293
- if (typeof r == "string")
294
- return ue(r);
295
- switch (r) {
296
- case m:
297
- return ue("Suspense");
298
- case f:
299
- return ue("SuspenseList");
300
- }
301
- if (typeof r == "object")
302
- switch (r.$$typeof) {
303
- case s:
304
- return qt(r.render);
305
- case h:
306
- return fe(r.type, d, p);
307
- case v: {
308
- var x = r, T = x._payload, k = x._init;
290
+ if (typeof e == "function")
291
+ return ye(e, Ve(e));
292
+ if (typeof e == "string")
293
+ return te(e);
294
+ switch (e) {
295
+ case I:
296
+ return te("Suspense");
297
+ case g:
298
+ return te("SuspenseList");
299
+ }
300
+ if (typeof e == "object")
301
+ switch (e.$$typeof) {
302
+ case p:
303
+ return Be(e.render);
304
+ case R:
305
+ return ie(e.type, r, t);
306
+ case S: {
307
+ var a = e, o = a._payload, l = a._init;
309
308
  try {
310
- return fe(k(T), d, p);
309
+ return ie(l(o), r, t);
311
310
  } catch {
312
311
  }
313
312
  }
314
313
  }
315
314
  return "";
316
315
  }
317
- var ne = Object.prototype.hasOwnProperty, rt = {}, nt = w.ReactDebugCurrentFrame;
318
- function de(r) {
319
- if (r) {
320
- var d = r._owner, p = fe(r.type, r._source, d ? d.type : null);
321
- nt.setExtraStackFrame(p);
316
+ var J = Object.prototype.hasOwnProperty, Ee = {}, Re = A.ReactDebugCurrentFrame;
317
+ function se(e) {
318
+ if (e) {
319
+ var r = e._owner, t = ie(e.type, e._source, r ? r.type : null);
320
+ Re.setExtraStackFrame(t);
322
321
  } else
323
- nt.setExtraStackFrame(null);
322
+ Re.setExtraStackFrame(null);
324
323
  }
325
- function Kt(r, d, p, x, T) {
324
+ function Je(e, r, t, a, o) {
326
325
  {
327
- var k = Function.call.bind(ne);
328
- for (var S in r)
329
- if (k(r, S)) {
330
- var C = void 0;
326
+ var l = Function.call.bind(J);
327
+ for (var s in e)
328
+ if (l(e, s)) {
329
+ var i = void 0;
331
330
  try {
332
- if (typeof r[S] != "function") {
333
- var F = Error((x || "React class") + ": " + p + " type `" + S + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[S] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
- throw F.name = "Invariant Violation", F;
331
+ if (typeof e[s] != "function") {
332
+ var b = Error((a || "React class") + ": " + t + " type `" + s + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[s] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
333
+ throw b.name = "Invariant Violation", b;
335
334
  }
336
- C = r[S](d, S, x, p, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
- } catch (L) {
338
- C = L;
335
+ i = e[s](r, s, a, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
336
+ } catch (f) {
337
+ i = f;
339
338
  }
340
- C && !(C instanceof Error) && (de(T), R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", x || "React class", p, S, typeof C), de(null)), C instanceof Error && !(C.message in rt) && (rt[C.message] = !0, de(T), R("Failed %s type: %s", p, C.message), de(null));
339
+ i && !(i instanceof Error) && (se(o), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", a || "React class", t, s, typeof i), se(null)), i instanceof Error && !(i.message in Ee) && (Ee[i.message] = !0, se(o), v("Failed %s type: %s", t, i.message), se(null));
341
340
  }
342
341
  }
343
342
  }
344
- var Gt = Array.isArray;
345
- function _e(r) {
346
- return Gt(r);
343
+ var qe = Array.isArray;
344
+ function me(e) {
345
+ return qe(e);
347
346
  }
348
- function Xt(r) {
347
+ function He(e) {
349
348
  {
350
- var d = typeof Symbol == "function" && Symbol.toStringTag, p = d && r[Symbol.toStringTag] || r.constructor.name || "Object";
351
- return p;
349
+ var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
350
+ return t;
352
351
  }
353
352
  }
354
- function Zt(r) {
353
+ function Ke(e) {
355
354
  try {
356
- return at(r), !1;
355
+ return _e(e), !1;
357
356
  } catch {
358
357
  return !0;
359
358
  }
360
359
  }
361
- function at(r) {
362
- return "" + r;
360
+ function _e(e) {
361
+ return "" + e;
363
362
  }
364
- function it(r) {
365
- if (Zt(r))
366
- return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Xt(r)), at(r);
363
+ function we(e) {
364
+ if (Ke(e))
365
+ return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", He(e)), _e(e);
367
366
  }
368
- var ot = w.ReactCurrentOwner, Qt = {
367
+ var Ce = A.ReactCurrentOwner, Ge = {
369
368
  key: !0,
370
369
  ref: !0,
371
370
  __self: !0,
372
371
  __source: !0
373
- }, lt, st;
374
- function er(r) {
375
- if (ne.call(r, "ref")) {
376
- var d = Object.getOwnPropertyDescriptor(r, "ref").get;
377
- if (d && d.isReactWarning)
372
+ }, Se, ke;
373
+ function ze(e) {
374
+ if (J.call(e, "ref")) {
375
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
376
+ if (r && r.isReactWarning)
378
377
  return !1;
379
378
  }
380
- return r.ref !== void 0;
379
+ return e.ref !== void 0;
381
380
  }
382
- function tr(r) {
383
- if (ne.call(r, "key")) {
384
- var d = Object.getOwnPropertyDescriptor(r, "key").get;
385
- if (d && d.isReactWarning)
381
+ function Xe(e) {
382
+ if (J.call(e, "key")) {
383
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
384
+ if (r && r.isReactWarning)
386
385
  return !1;
387
386
  }
388
- return r.key !== void 0;
387
+ return e.key !== void 0;
389
388
  }
390
- function rr(r, d) {
391
- typeof r.ref == "string" && ot.current;
389
+ function Ze(e, r) {
390
+ typeof e.ref == "string" && Ce.current;
392
391
  }
393
- function nr(r, d) {
392
+ function Qe(e, r) {
394
393
  {
395
- var p = function() {
396
- lt || (lt = !0, R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", d));
394
+ var t = function() {
395
+ Se || (Se = !0, v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
397
396
  };
398
- p.isReactWarning = !0, Object.defineProperty(r, "key", {
399
- get: p,
397
+ t.isReactWarning = !0, Object.defineProperty(e, "key", {
398
+ get: t,
400
399
  configurable: !0
401
400
  });
402
401
  }
403
402
  }
404
- function ar(r, d) {
403
+ function er(e, r) {
405
404
  {
406
- var p = function() {
407
- st || (st = !0, R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", d));
405
+ var t = function() {
406
+ ke || (ke = !0, v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
408
407
  };
409
- p.isReactWarning = !0, Object.defineProperty(r, "ref", {
410
- get: p,
408
+ t.isReactWarning = !0, Object.defineProperty(e, "ref", {
409
+ get: t,
411
410
  configurable: !0
412
411
  });
413
412
  }
414
413
  }
415
- var ir = function(r, d, p, x, T, k, S) {
416
- var C = {
414
+ var rr = function(e, r, t, a, o, l, s) {
415
+ var i = {
417
416
  // This tag allows us to uniquely identify this as a React Element
418
- $$typeof: t,
417
+ $$typeof: O,
419
418
  // Built-in properties that belong on the element
420
- type: r,
421
- key: d,
422
- ref: p,
423
- props: S,
419
+ type: e,
420
+ key: r,
421
+ ref: t,
422
+ props: s,
424
423
  // Record the component responsible for creating this element.
425
- _owner: k
424
+ _owner: l
426
425
  };
427
- return C._store = {}, Object.defineProperty(C._store, "validated", {
426
+ return i._store = {}, Object.defineProperty(i._store, "validated", {
428
427
  configurable: !1,
429
428
  enumerable: !1,
430
429
  writable: !0,
431
430
  value: !1
432
- }), Object.defineProperty(C, "_self", {
431
+ }), Object.defineProperty(i, "_self", {
433
432
  configurable: !1,
434
433
  enumerable: !1,
435
434
  writable: !1,
436
- value: x
437
- }), Object.defineProperty(C, "_source", {
435
+ value: a
436
+ }), Object.defineProperty(i, "_source", {
438
437
  configurable: !1,
439
438
  enumerable: !1,
440
439
  writable: !1,
441
- value: T
442
- }), Object.freeze && (Object.freeze(C.props), Object.freeze(C)), C;
440
+ value: o
441
+ }), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
443
442
  };
444
- function or(r, d, p, x, T) {
443
+ function nr(e, r, t, a, o) {
445
444
  {
446
- var k, S = {}, C = null, F = null;
447
- p !== void 0 && (it(p), C = "" + p), tr(d) && (it(d.key), C = "" + d.key), er(d) && (F = d.ref, rr(d, T));
448
- for (k in d)
449
- ne.call(d, k) && !Qt.hasOwnProperty(k) && (S[k] = d[k]);
450
- if (r && r.defaultProps) {
451
- var L = r.defaultProps;
452
- for (k in L)
453
- S[k] === void 0 && (S[k] = L[k]);
445
+ var l, s = {}, i = null, b = null;
446
+ t !== void 0 && (we(t), i = "" + t), Xe(r) && (we(r.key), i = "" + r.key), ze(r) && (b = r.ref, Ze(r, o));
447
+ for (l in r)
448
+ J.call(r, l) && !Ge.hasOwnProperty(l) && (s[l] = r[l]);
449
+ if (e && e.defaultProps) {
450
+ var f = e.defaultProps;
451
+ for (l in f)
452
+ s[l] === void 0 && (s[l] = f[l]);
454
453
  }
455
- if (C || F) {
456
- var O = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
457
- C && nr(S, O), F && ar(S, O);
454
+ if (i || b) {
455
+ var d = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
456
+ i && Qe(s, d), b && er(s, d);
458
457
  }
459
- return ir(r, C, F, T, x, ot.current, S);
458
+ return rr(e, i, b, o, a, Ce.current, s);
460
459
  }
461
460
  }
462
- var Te = w.ReactCurrentOwner, ut = w.ReactDebugCurrentFrame;
463
- function Q(r) {
464
- if (r) {
465
- var d = r._owner, p = fe(r.type, r._source, d ? d.type : null);
466
- ut.setExtraStackFrame(p);
461
+ var xe = A.ReactCurrentOwner, Oe = A.ReactDebugCurrentFrame;
462
+ function $(e) {
463
+ if (e) {
464
+ var r = e._owner, t = ie(e.type, e._source, r ? r.type : null);
465
+ Oe.setExtraStackFrame(t);
467
466
  } else
468
- ut.setExtraStackFrame(null);
467
+ Oe.setExtraStackFrame(null);
469
468
  }
470
- var ke;
471
- ke = !1;
472
- function je(r) {
473
- return typeof r == "object" && r !== null && r.$$typeof === t;
469
+ var ge;
470
+ ge = !1;
471
+ function be(e) {
472
+ return typeof e == "object" && e !== null && e.$$typeof === O;
474
473
  }
475
- function ct() {
474
+ function Te() {
476
475
  {
477
- if (Te.current) {
478
- var r = W(Te.current.type);
479
- if (r)
476
+ if (xe.current) {
477
+ var e = k(xe.current.type);
478
+ if (e)
480
479
  return `
481
480
 
482
- Check the render method of \`` + r + "`.";
481
+ Check the render method of \`` + e + "`.";
483
482
  }
484
483
  return "";
485
484
  }
486
485
  }
487
- function lr(r) {
486
+ function tr(e) {
488
487
  return "";
489
488
  }
490
- var ft = {};
491
- function sr(r) {
489
+ var Pe = {};
490
+ function ar(e) {
492
491
  {
493
- var d = ct();
494
- if (!d) {
495
- var p = typeof r == "string" ? r : r.displayName || r.name;
496
- p && (d = `
492
+ var r = Te();
493
+ if (!r) {
494
+ var t = typeof e == "string" ? e : e.displayName || e.name;
495
+ t && (r = `
497
496
 
498
- Check the top-level render call using <` + p + ">.");
497
+ Check the top-level render call using <` + t + ">.");
499
498
  }
500
- return d;
499
+ return r;
501
500
  }
502
501
  }
503
- function dt(r, d) {
502
+ function Ne(e, r) {
504
503
  {
505
- if (!r._store || r._store.validated || r.key != null)
504
+ if (!e._store || e._store.validated || e.key != null)
506
505
  return;
507
- r._store.validated = !0;
508
- var p = sr(d);
509
- if (ft[p])
506
+ e._store.validated = !0;
507
+ var t = ar(r);
508
+ if (Pe[t])
510
509
  return;
511
- ft[p] = !0;
512
- var x = "";
513
- r && r._owner && r._owner !== Te.current && (x = " It was passed a child from " + W(r._owner.type) + "."), Q(r), R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', p, x), Q(null);
510
+ Pe[t] = !0;
511
+ var a = "";
512
+ e && e._owner && e._owner !== xe.current && (a = " It was passed a child from " + k(e._owner.type) + "."), $(e), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, a), $(null);
514
513
  }
515
514
  }
516
- function ht(r, d) {
515
+ function Ie(e, r) {
517
516
  {
518
- if (typeof r != "object")
517
+ if (typeof e != "object")
519
518
  return;
520
- if (_e(r))
521
- for (var p = 0; p < r.length; p++) {
522
- var x = r[p];
523
- je(x) && dt(x, d);
519
+ if (me(e))
520
+ for (var t = 0; t < e.length; t++) {
521
+ var a = e[t];
522
+ be(a) && Ne(a, r);
524
523
  }
525
- else if (je(r))
526
- r._store && (r._store.validated = !0);
527
- else if (r) {
528
- var T = g(r);
529
- if (typeof T == "function" && T !== r.entries)
530
- for (var k = T.call(r), S; !(S = k.next()).done; )
531
- je(S.value) && dt(S.value, d);
524
+ else if (be(e))
525
+ e._store && (e._store.validated = !0);
526
+ else if (e) {
527
+ var o = Y(e);
528
+ if (typeof o == "function" && o !== e.entries)
529
+ for (var l = o.call(e), s; !(s = l.next()).done; )
530
+ be(s.value) && Ne(s.value, r);
532
531
  }
533
532
  }
534
533
  }
535
- function ur(r) {
534
+ function ir(e) {
536
535
  {
537
- var d = r.type;
538
- if (d == null || typeof d == "string")
536
+ var r = e.type;
537
+ if (r == null || typeof r == "string")
539
538
  return;
540
- var p;
541
- if (typeof d == "function")
542
- p = d.propTypes;
543
- else if (typeof d == "object" && (d.$$typeof === s || // Note: Memo only checks outer props here.
539
+ var t;
540
+ if (typeof r == "function")
541
+ t = r.propTypes;
542
+ else if (typeof r == "object" && (r.$$typeof === p || // Note: Memo only checks outer props here.
544
543
  // Inner props are checked in the reconciler.
545
- d.$$typeof === h))
546
- p = d.propTypes;
544
+ r.$$typeof === R))
545
+ t = r.propTypes;
547
546
  else
548
547
  return;
549
- if (p) {
550
- var x = W(d);
551
- Kt(p, r.props, "prop", x, r);
552
- } else if (d.PropTypes !== void 0 && !ke) {
553
- ke = !0;
554
- var T = W(d);
555
- R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", T || "Unknown");
548
+ if (t) {
549
+ var a = k(r);
550
+ Je(t, e.props, "prop", a, e);
551
+ } else if (r.PropTypes !== void 0 && !ge) {
552
+ ge = !0;
553
+ var o = k(r);
554
+ v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
556
555
  }
557
- typeof d.getDefaultProps == "function" && !d.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
556
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
557
  }
559
558
  }
560
- function cr(r) {
559
+ function sr(e) {
561
560
  {
562
- for (var d = Object.keys(r.props), p = 0; p < d.length; p++) {
563
- var x = d[p];
564
- if (x !== "children" && x !== "key") {
565
- Q(r), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", x), Q(null);
561
+ for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
562
+ var a = r[t];
563
+ if (a !== "children" && a !== "key") {
564
+ $(e), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", a), $(null);
566
565
  break;
567
566
  }
568
567
  }
569
- r.ref !== null && (Q(r), R("Invalid attribute `ref` supplied to `React.Fragment`."), Q(null));
568
+ e.ref !== null && ($(e), v("Invalid attribute `ref` supplied to `React.Fragment`."), $(null));
570
569
  }
571
570
  }
572
- var mt = {};
573
- function pt(r, d, p, x, T, k) {
571
+ var De = {};
572
+ function Ae(e, r, t, a, o, l) {
574
573
  {
575
- var S = re(r);
576
- if (!S) {
577
- var C = "";
578
- (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (C += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
- var F = lr();
580
- F ? C += F : C += ct();
581
- var L;
582
- r === null ? L = "null" : _e(r) ? L = "array" : r !== void 0 && r.$$typeof === t ? (L = "<" + (W(r.type) || "Unknown") + " />", C = " Did you accidentally export a JSX literal instead of a component?") : L = typeof r, R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", L, C);
574
+ var s = Z(e);
575
+ if (!s) {
576
+ var i = "";
577
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
578
+ var b = tr();
579
+ b ? i += b : i += Te();
580
+ var f;
581
+ e === null ? f = "null" : me(e) ? f = "array" : e !== void 0 && e.$$typeof === O ? (f = "<" + (k(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : f = typeof e, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", f, i);
583
582
  }
584
- var O = or(r, d, p, T, k);
585
- if (O == null)
586
- return O;
587
- if (S) {
588
- var M = d.children;
589
- if (M !== void 0)
590
- if (x)
591
- if (_e(M)) {
592
- for (var ee = 0; ee < M.length; ee++)
593
- ht(M[ee], r);
594
- Object.freeze && Object.freeze(M);
583
+ var d = nr(e, r, t, o, l);
584
+ if (d == null)
585
+ return d;
586
+ if (s) {
587
+ var _ = r.children;
588
+ if (_ !== void 0)
589
+ if (a)
590
+ if (me(_)) {
591
+ for (var W = 0; W < _.length; W++)
592
+ Ie(_[W], e);
593
+ Object.freeze && Object.freeze(_);
595
594
  } else
596
- R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
595
+ v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
596
  else
598
- ht(M, r);
597
+ Ie(_, e);
599
598
  }
600
- if (ne.call(d, "key")) {
601
- var X = W(r), I = Object.keys(d).filter(function(vr) {
602
- return vr !== "key";
603
- }), Le = I.length > 0 ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}";
604
- if (!mt[X + Le]) {
605
- var pr = I.length > 0 ? "{" + I.join(": ..., ") + ": ...}" : "{}";
606
- R(`A props object containing a "key" prop is being spread into JSX:
599
+ if (J.call(r, "key")) {
600
+ var F = k(e), y = Object.keys(r).filter(function(dr) {
601
+ return dr !== "key";
602
+ }), je = y.length > 0 ? "{key: someKey, " + y.join(": ..., ") + ": ...}" : "{key: someKey}";
603
+ if (!De[F + je]) {
604
+ var fr = y.length > 0 ? "{" + y.join(": ..., ") + ": ...}" : "{}";
605
+ v(`A props object containing a "key" prop is being spread into JSX:
607
606
  let props = %s;
608
607
  <%s {...props} />
609
608
  React keys must be passed directly to JSX without using spread:
610
609
  let props = %s;
611
- <%s key={someKey} {...props} />`, Le, X, pr, X), mt[X + Le] = !0;
610
+ <%s key={someKey} {...props} />`, je, F, fr, F), De[F + je] = !0;
612
611
  }
613
612
  }
614
- return r === a ? cr(O) : ur(O), O;
615
- }
616
- }
617
- function fr(r, d, p) {
618
- return pt(r, d, p, !0);
619
- }
620
- function dr(r, d, p) {
621
- return pt(r, d, p, !1);
622
- }
623
- var hr = dr, mr = fr;
624
- ie.Fragment = a, ie.jsx = hr, ie.jsxs = mr;
625
- })()), ie;
626
- }
627
- var yt;
628
- function xr() {
629
- return yt || (yt = 1, process.env.NODE_ENV === "production" ? he.exports = gr() : he.exports = yr()), he.exports;
630
- }
631
- var P = xr();
632
- /**
633
- * react-router v7.18.0
634
- *
635
- * Copyright (c) Remix Software Inc.
636
- *
637
- * This source code is licensed under the MIT license found in the
638
- * LICENSE.md file in the root directory of this source tree.
639
- *
640
- * @license MIT
641
- */
642
- var Ie = /^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i, Rr = /^[\\/]{2}/;
643
- function br(e, t) {
644
- return t + e.replace(/\\/g, "/");
645
- }
646
- function D(e, t) {
647
- if (e === !1 || e === null || typeof e > "u")
648
- throw new Error(t);
649
- }
650
- function Y(e, t) {
651
- if (!e) {
652
- typeof console < "u" && console.warn(t);
653
- try {
654
- throw new Error(t);
655
- } catch {
656
- }
657
- }
658
- }
659
- function Fe({
660
- pathname: e = "/",
661
- search: t = "",
662
- hash: n = ""
663
- }) {
664
- return t && t !== "?" && (e += t.charAt(0) === "?" ? t : "?" + t), n && n !== "#" && (e += n.charAt(0) === "#" ? n : "#" + n), e;
665
- }
666
- function Ae(e) {
667
- let t = {};
668
- if (e) {
669
- let n = e.indexOf("#");
670
- n >= 0 && (t.hash = e.substring(n), e = e.substring(0, n));
671
- let a = e.indexOf("?");
672
- a >= 0 && (t.search = e.substring(a), e = e.substring(0, a)), e && (t.pathname = e);
673
- }
674
- return t;
675
- }
676
- function Ct(e, t, n = "/") {
677
- return Er(e, t, n, !1);
678
- }
679
- function Er(e, t, n, a, i) {
680
- let o = typeof t == "string" ? Ae(t) : t, l = G(o.pathname || "/", n);
681
- if (l == null)
682
- return null;
683
- let c = wr(e), s = null, m = Dr(l);
684
- for (let f = 0; s == null && f < c.length; ++f)
685
- s = Or(
686
- c[f],
687
- m,
688
- a
689
- );
690
- return s;
691
- }
692
- function wr(e) {
693
- let t = St(e);
694
- return Cr(t), t;
695
- }
696
- function St(e, t = [], n = [], a = "", i = !1) {
697
- let o = (l, c, s = i, m) => {
698
- let f = {
699
- relativePath: m === void 0 ? l.path || "" : m,
700
- caseSensitive: l.caseSensitive === !0,
701
- childrenIndex: c,
702
- route: l
703
- };
704
- if (f.relativePath.startsWith("/")) {
705
- if (!f.relativePath.startsWith(a) && s)
706
- return;
707
- D(
708
- f.relativePath.startsWith(a),
709
- `Absolute route path "${f.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
710
- ), f.relativePath = f.relativePath.slice(a.length);
711
- }
712
- let h = B([a, f.relativePath]), v = n.concat(f);
713
- l.children && l.children.length > 0 && (D(
714
- // Our types know better, but runtime JS may not!
715
- // @ts-expect-error
716
- l.index !== !0,
717
- `Index routes must not have child routes. Please remove all child routes from route path "${h}".`
718
- ), St(
719
- l.children,
720
- t,
721
- v,
722
- h,
723
- s
724
- )), !(l.path == null && !l.index) && t.push({
725
- path: h,
726
- score: Lr(h, l.index),
727
- routesMeta: v.map((y, b) => {
728
- let [E, g] = Tt(
729
- y.relativePath,
730
- y.caseSensitive,
731
- b === v.length - 1
732
- );
733
- return {
734
- ...y,
735
- matcher: E,
736
- compiledParams: g
737
- };
738
- })
739
- });
740
- };
741
- return e.forEach((l, c) => {
742
- var s;
743
- if (l.path === "" || !((s = l.path) != null && s.includes("?")))
744
- o(l, c);
745
- else
746
- for (let m of Pt(l.path))
747
- o(l, c, !0, m);
748
- }), t;
749
- }
750
- function Pt(e) {
751
- let t = e.split("/");
752
- if (t.length === 0) return [];
753
- let [n, ...a] = t, i = n.endsWith("?"), o = n.replace(/\?$/, "");
754
- if (a.length === 0)
755
- return i ? [o, ""] : [o];
756
- let l = Pt(a.join("/")), c = [];
757
- return c.push(
758
- ...l.map(
759
- (s) => s === "" ? o : [o, s].join("/")
760
- )
761
- ), i && c.push(...l), c.map(
762
- (s) => e.startsWith("/") && s === "" ? "/" : s
763
- );
764
- }
765
- function Cr(e) {
766
- e.sort(
767
- (t, n) => t.score !== n.score ? n.score - t.score : $r(
768
- t.routesMeta.map((a) => a.childrenIndex),
769
- n.routesMeta.map((a) => a.childrenIndex)
770
- )
771
- );
772
- }
773
- var Sr = /^:[\w-]+$/, Pr = 3, _r = 2, Tr = 1, kr = 10, jr = -2, xt = (e) => e === "*";
774
- function Lr(e, t) {
775
- let n = e.split("/"), a = n.length;
776
- return n.some(xt) && (a += jr), t && (a += _r), n.filter((i) => !xt(i)).reduce(
777
- (i, o) => i + (Sr.test(o) ? Pr : o === "" ? Tr : kr),
778
- a
779
- );
780
- }
781
- function $r(e, t) {
782
- return e.length === t.length && e.slice(0, -1).every((a, i) => a === t[i]) ? (
783
- // If two routes are siblings, we should try to match the earlier sibling
784
- // first. This allows people to have fine-grained control over the matching
785
- // behavior by simply putting routes with identical paths in the order they
786
- // want them tried.
787
- e[e.length - 1] - t[t.length - 1]
788
- ) : (
789
- // Otherwise, it doesn't really make sense to rank non-siblings by index,
790
- // so they sort equally.
791
- 0
792
- );
793
- }
794
- function Or(e, t, n = !1) {
795
- let { routesMeta: a } = e, i = {}, o = "/", l = [];
796
- for (let c = 0; c < a.length; ++c) {
797
- let s = a[c], m = c === a.length - 1, f = o === "/" ? t : t.slice(o.length) || "/", h = {
798
- path: s.relativePath,
799
- caseSensitive: s.caseSensitive,
800
- end: m
801
- }, v = (
802
- // Use precomputed matcher if it exists
803
- s.matcher && s.compiledParams ? _t(
804
- h,
805
- f,
806
- s.matcher,
807
- s.compiledParams
808
- ) : ge(h, f)
809
- ), y = s.route;
810
- if (!v && m && n && !a[a.length - 1].route.index && (v = ge(
811
- {
812
- path: s.relativePath,
813
- caseSensitive: s.caseSensitive,
814
- end: !1
815
- },
816
- f
817
- )), !v)
818
- return null;
819
- Object.assign(i, v.params), l.push({
820
- // TODO: Can this as be avoided?
821
- params: i,
822
- pathname: B([o, v.pathname]),
823
- pathnameBase: Ir(
824
- B([o, v.pathnameBase])
825
- ),
826
- route: y
827
- }), v.pathnameBase !== "/" && (o = B([o, v.pathnameBase]));
828
- }
829
- return l;
830
- }
831
- function ge(e, t) {
832
- typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
833
- let [n, a] = Tt(
834
- e.path,
835
- e.caseSensitive,
836
- e.end
837
- );
838
- return _t(e, t, n, a);
839
- }
840
- function _t(e, t, n, a) {
841
- let i = t.match(n);
842
- if (!i) return null;
843
- let o = i[0], l = o.replace(/(.)\/+$/, "$1"), c = i.slice(1);
844
- return {
845
- params: a.reduce(
846
- (m, { paramName: f, isOptional: h }, v) => {
847
- if (f === "*") {
848
- let b = c[v] || "";
849
- l = o.slice(0, o.length - b.length).replace(/(.)\/+$/, "$1");
850
- }
851
- const y = c[v];
852
- return h && !y ? m[f] = void 0 : m[f] = (y || "").replace(/%2F/g, "/"), m;
853
- },
854
- {}
855
- ),
856
- pathname: o,
857
- pathnameBase: l,
858
- pattern: e
859
- };
860
- }
861
- function Tt(e, t = !1, n = !0) {
862
- Y(
863
- e === "*" || !e.endsWith("*") || e.endsWith("/*"),
864
- `Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`
865
- );
866
- let a = [], i = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
867
- /\/:([\w-]+)(\?)?/g,
868
- (l, c, s, m, f) => {
869
- if (a.push({ paramName: c, isOptional: s != null }), s) {
870
- let h = f.charAt(m + l.length);
871
- return h && h !== "/" ? "/([^\\/]*)" : "(?:/([^\\/]*))?";
872
- }
873
- return "/([^\\/]+)";
874
- }
875
- ).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
876
- return e.endsWith("*") ? (a.push({ paramName: "*" }), i += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? i += "\\/*$" : e !== "" && e !== "/" && (i += "(?:(?=\\/|$))"), [new RegExp(i, t ? void 0 : "i"), a];
877
- }
878
- function Dr(e) {
879
- try {
880
- return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
881
- } catch (t) {
882
- return Y(
883
- !1,
884
- `The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`
885
- ), e;
886
- }
887
- }
888
- function G(e, t) {
889
- if (t === "/") return e;
890
- if (!e.toLowerCase().startsWith(t.toLowerCase()))
891
- return null;
892
- let n = t.endsWith("/") ? t.length - 1 : t.length, a = e.charAt(n);
893
- return a && a !== "/" ? null : e.slice(n) || "/";
894
- }
895
- function Fr(e, t = "/") {
896
- let {
897
- pathname: n,
898
- search: a = "",
899
- hash: i = ""
900
- } = typeof e == "string" ? Ae(e) : e, o;
901
- return n ? (n = jt(n), n.startsWith("/") ? o = Rt(n.substring(1), "/") : o = Rt(n, t)) : o = t, {
902
- pathname: o,
903
- search: Ar(a),
904
- hash: Mr(i)
905
- };
906
- }
907
- function Rt(e, t) {
908
- let n = ye(t).split("/");
909
- return e.split("/").forEach((i) => {
910
- i === ".." ? n.length > 1 && n.pop() : i !== "." && n.push(i);
911
- }), n.length > 1 ? n.join("/") : "/";
912
- }
913
- function $e(e, t, n, a) {
914
- return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(
915
- a
916
- )}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
917
- }
918
- function Nr(e) {
919
- return e.filter(
920
- (t, n) => n === 0 || t.route.path && t.route.path.length > 0
921
- );
922
- }
923
- function kt(e) {
924
- let t = Nr(e);
925
- return t.map(
926
- (n, a) => a === t.length - 1 ? n.pathname : n.pathnameBase
927
- );
928
- }
929
- function Me(e, t, n, a = !1) {
930
- let i;
931
- typeof e == "string" ? i = Ae(e) : (i = { ...e }, D(
932
- !i.pathname || !i.pathname.includes("?"),
933
- $e("?", "pathname", "search", i)
934
- ), D(
935
- !i.pathname || !i.pathname.includes("#"),
936
- $e("#", "pathname", "hash", i)
937
- ), D(
938
- !i.search || !i.search.includes("#"),
939
- $e("#", "search", "hash", i)
940
- ));
941
- let o = e === "" || i.pathname === "", l = o ? "/" : i.pathname, c;
942
- if (l == null)
943
- c = n;
944
- else {
945
- let h = t.length - 1;
946
- if (!a && l.startsWith("..")) {
947
- let v = l.split("/");
948
- for (; v[0] === ".."; )
949
- v.shift(), h -= 1;
950
- i.pathname = v.join("/");
951
- }
952
- c = h >= 0 ? t[h] : "/";
953
- }
954
- let s = Fr(i, c), m = l && l !== "/" && l.endsWith("/"), f = (o || l === ".") && n.endsWith("/");
955
- return !s.pathname.endsWith("/") && (m || f) && (s.pathname += "/"), s;
956
- }
957
- var jt = (e) => e.replace(/[\\/]{2,}/g, "/"), B = (e) => jt(e.join("/")), ye = (e) => e.replace(/\/+$/, ""), Ir = (e) => ye(e).replace(/^\/*/, "/"), Ar = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, Mr = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, Wr = class {
958
- constructor(e, t, n, a = !1) {
959
- this.status = e, this.statusText = t || "", this.internal = a, n instanceof Error ? (this.data = n.toString(), this.error = n) : this.data = n;
960
- }
961
- };
962
- function Br(e) {
963
- return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
964
- }
965
- function Ur(e) {
966
- let t = e.map((n) => n.route.path).filter(Boolean);
967
- return B(t) || "/";
968
- }
969
- var Lt = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
970
- function $t(e, t) {
971
- let n = e;
972
- if (typeof n != "string" || !Ie.test(n))
973
- return {
974
- absoluteURL: void 0,
975
- isExternal: !1,
976
- to: n
977
- };
978
- let a = n, i = !1;
979
- if (Lt)
980
- try {
981
- let o = new URL(window.location.href), l = Rr.test(n) ? new URL(br(n, o.protocol)) : new URL(n), c = G(l.pathname, t);
982
- l.origin === o.origin && c != null ? n = c + l.search + l.hash : i = !0;
983
- } catch {
984
- Y(
985
- !1,
986
- `<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
987
- );
988
- }
989
- return {
990
- absoluteURL: a,
991
- isExternal: i,
992
- to: n
993
- };
994
- }
995
- Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
996
- var Ot = [
997
- "POST",
998
- "PUT",
999
- "PATCH",
1000
- "DELETE"
1001
- ];
1002
- new Set(
1003
- Ot
1004
- );
1005
- var Hr = [
1006
- "GET",
1007
- ...Ot
1008
- ];
1009
- new Set(Hr);
1010
- var Vr = [
1011
- "about:",
1012
- "blob:",
1013
- "chrome:",
1014
- "chrome-untrusted:",
1015
- "content:",
1016
- "data:",
1017
- "devtools:",
1018
- "file:",
1019
- "filesystem:",
1020
- // eslint-disable-next-line no-script-url
1021
- "javascript:"
1022
- ];
1023
- function Yr(e) {
1024
- try {
1025
- return Vr.includes(new URL(e).protocol);
1026
- } catch {
1027
- return !1;
1028
- }
1029
- }
1030
- var te = u.createContext(null);
1031
- te.displayName = "DataRouter";
1032
- var xe = u.createContext(null);
1033
- xe.displayName = "DataRouterState";
1034
- var Dt = u.createContext(!1);
1035
- function Jr() {
1036
- return u.useContext(Dt);
1037
- }
1038
- var Ft = u.createContext({
1039
- isTransitioning: !1
1040
- });
1041
- Ft.displayName = "ViewTransition";
1042
- var qr = u.createContext(
1043
- /* @__PURE__ */ new Map()
1044
- );
1045
- qr.displayName = "Fetchers";
1046
- var zr = u.createContext(null);
1047
- zr.displayName = "Await";
1048
- var U = u.createContext(
1049
- null
1050
- );
1051
- U.displayName = "Navigation";
1052
- var We = u.createContext(
1053
- null
1054
- );
1055
- We.displayName = "Location";
1056
- var J = u.createContext({
1057
- outlet: null,
1058
- matches: [],
1059
- isDataRoute: !1
1060
- });
1061
- J.displayName = "Route";
1062
- var Be = u.createContext(null);
1063
- Be.displayName = "RouteError";
1064
- var Nt = "REACT_ROUTER_ERROR", Kr = "REDIRECT", Gr = "ROUTE_ERROR_RESPONSE";
1065
- function Xr(e) {
1066
- if (e.startsWith(`${Nt}:${Kr}:{`))
1067
- try {
1068
- let t = JSON.parse(e.slice(28));
1069
- if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string" && typeof t.location == "string" && typeof t.reloadDocument == "boolean" && typeof t.replace == "boolean")
1070
- return t;
1071
- } catch {
1072
- }
1073
- }
1074
- function Zr(e) {
1075
- if (e.startsWith(
1076
- `${Nt}:${Gr}:{`
1077
- ))
1078
- try {
1079
- let t = JSON.parse(e.slice(40));
1080
- if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string")
1081
- return new Wr(
1082
- t.status,
1083
- t.statusText,
1084
- t.data
1085
- );
1086
- } catch {
1087
- }
1088
- }
1089
- function Qr(e, { relative: t } = {}) {
1090
- D(
1091
- Re(),
1092
- // TODO: This error is probably because they somehow have 2 versions of the
1093
- // router loaded. We can help them understand how to avoid that.
1094
- "useHref() may be used only in the context of a <Router> component."
1095
- );
1096
- let { basename: n, navigator: a } = u.useContext(U), { hash: i, pathname: o, search: l } = le(e, { relative: t }), c = o;
1097
- return n !== "/" && (c = o === "/" ? n : B([n, o])), a.createHref({ pathname: c, search: l, hash: i });
1098
- }
1099
- function Re() {
1100
- return u.useContext(We) != null;
1101
- }
1102
- function q() {
1103
- return D(
1104
- Re(),
1105
- // TODO: This error is probably because they somehow have 2 versions of the
1106
- // router loaded. We can help them understand how to avoid that.
1107
- "useLocation() may be used only in the context of a <Router> component."
1108
- ), u.useContext(We).location;
1109
- }
1110
- var It = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
1111
- function At(e) {
1112
- u.useContext(U).static || u.useLayoutEffect(e);
1113
- }
1114
- function en() {
1115
- let { isDataRoute: e } = u.useContext(J);
1116
- return e ? mn() : tn();
1117
- }
1118
- function tn() {
1119
- D(
1120
- Re(),
1121
- // TODO: This error is probably because they somehow have 2 versions of the
1122
- // router loaded. We can help them understand how to avoid that.
1123
- "useNavigate() may be used only in the context of a <Router> component."
1124
- );
1125
- let e = u.useContext(te), { basename: t, navigator: n } = u.useContext(U), { matches: a } = u.useContext(J), { pathname: i } = q(), o = JSON.stringify(kt(a)), l = u.useRef(!1);
1126
- return At(() => {
1127
- l.current = !0;
1128
- }), u.useCallback(
1129
- (s, m = {}) => {
1130
- if (Y(l.current, It), !l.current) return;
1131
- if (typeof s == "number") {
1132
- n.go(s);
1133
- return;
1134
- }
1135
- let f = Me(
1136
- s,
1137
- JSON.parse(o),
1138
- i,
1139
- m.relative === "path"
1140
- );
1141
- e == null && t !== "/" && (f.pathname = f.pathname === "/" ? t : B([t, f.pathname])), (m.replace ? n.replace : n.push)(
1142
- f,
1143
- m.state,
1144
- m
1145
- );
1146
- },
1147
- [
1148
- t,
1149
- n,
1150
- o,
1151
- i,
1152
- e
1153
- ]
1154
- );
1155
- }
1156
- u.createContext(null);
1157
- function le(e, { relative: t } = {}) {
1158
- let { matches: n } = u.useContext(J), { pathname: a } = q(), i = JSON.stringify(kt(n));
1159
- return u.useMemo(
1160
- () => Me(
1161
- e,
1162
- JSON.parse(i),
1163
- a,
1164
- t === "path"
1165
- ),
1166
- [e, i, a, t]
1167
- );
1168
- }
1169
- function rn(e, t, n) {
1170
- D(
1171
- Re(),
1172
- // TODO: This error is probably because they somehow have 2 versions of the
1173
- // router loaded. We can help them understand how to avoid that.
1174
- "useRoutes() may be used only in the context of a <Router> component."
1175
- );
1176
- let { navigator: a } = u.useContext(U), { matches: i } = u.useContext(J), o = i[i.length - 1], l = o ? o.params : {}, c = o ? o.pathname : "/", s = o ? o.pathnameBase : "/", m = o && o.route;
1177
- {
1178
- let g = m && m.path || "";
1179
- Wt(
1180
- c,
1181
- !m || g.endsWith("*") || g.endsWith("*?"),
1182
- `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${g}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
1183
-
1184
- Please change the parent <Route path="${g}"> to <Route path="${g === "/" ? "*" : `${g}/*`}">.`
1185
- );
1186
- }
1187
- let f = q(), h;
1188
- h = f;
1189
- let v = h.pathname || "/", y = v;
1190
- if (s !== "/") {
1191
- let g = s.replace(/^\//, "").split("/");
1192
- y = "/" + v.replace(/^\//, "").split("/").slice(g.length).join("/");
1193
- }
1194
- let b = n && n.state.matches.length ? (
1195
- // If we're in a data router, use the matches we've already identified but ensure
1196
- // we have the latest route instances from the manifest in case elements have changed
1197
- n.state.matches.map(
1198
- (g) => Object.assign(g, {
1199
- route: n.manifest[g.route.id] || g.route
1200
- })
1201
- )
1202
- ) : Ct(e, { pathname: y });
1203
- return Y(
1204
- m || b != null,
1205
- `No routes matched location "${h.pathname}${h.search}${h.hash}" `
1206
- ), Y(
1207
- b == null || b[b.length - 1].route.element !== void 0 || b[b.length - 1].route.Component !== void 0 || b[b.length - 1].route.lazy !== void 0,
1208
- `Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
1209
- ), sn(
1210
- b && b.map(
1211
- (g) => Object.assign({}, g, {
1212
- params: Object.assign({}, l, g.params),
1213
- pathname: B([
1214
- s,
1215
- // Re-encode pathnames that were decoded inside matchRoutes.
1216
- // Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
1217
- // `new URL()` internally and we need to prevent it from treating
1218
- // them as separators
1219
- a.encodeLocation ? a.encodeLocation(
1220
- g.pathname.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
1221
- ).pathname : g.pathname
1222
- ]),
1223
- pathnameBase: g.pathnameBase === "/" ? s : B([
1224
- s,
1225
- // Re-encode pathnames that were decoded inside matchRoutes
1226
- // Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
1227
- // `new URL()` internally and we need to prevent it from treating
1228
- // them as separators
1229
- a.encodeLocation ? a.encodeLocation(
1230
- g.pathnameBase.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
1231
- ).pathname : g.pathnameBase
1232
- ])
1233
- })
1234
- ),
1235
- i,
1236
- n
1237
- );
1238
- }
1239
- function nn() {
1240
- let e = hn(), t = Br(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), n = e instanceof Error ? e.stack : null, a = "rgba(200,200,200, 0.5)", i = { padding: "0.5rem", backgroundColor: a }, o = { padding: "2px 4px", backgroundColor: a }, l = null;
1241
- return console.error(
1242
- "Error handled by React Router default ErrorBoundary:",
1243
- e
1244
- ), l = /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ u.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ u.createElement("code", { style: o }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ u.createElement("code", { style: o }, "errorElement"), " prop on your route.")), /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ u.createElement("h3", { style: { fontStyle: "italic" } }, t), n ? /* @__PURE__ */ u.createElement("pre", { style: i }, n) : null, l);
1245
- }
1246
- var an = /* @__PURE__ */ u.createElement(nn, null), Mt = class extends u.Component {
1247
- constructor(e) {
1248
- super(e), this.state = {
1249
- location: e.location,
1250
- revalidation: e.revalidation,
1251
- error: e.error
1252
- };
1253
- }
1254
- static getDerivedStateFromError(e) {
1255
- return { error: e };
1256
- }
1257
- static getDerivedStateFromProps(e, t) {
1258
- return t.location !== e.location || t.revalidation !== "idle" && e.revalidation === "idle" ? {
1259
- error: e.error,
1260
- location: e.location,
1261
- revalidation: e.revalidation
1262
- } : {
1263
- error: e.error !== void 0 ? e.error : t.error,
1264
- location: t.location,
1265
- revalidation: e.revalidation || t.revalidation
1266
- };
1267
- }
1268
- componentDidCatch(e, t) {
1269
- this.props.onError ? this.props.onError(e, t) : console.error(
1270
- "React Router caught the following error during render",
1271
- e
1272
- );
1273
- }
1274
- render() {
1275
- let e = this.state.error;
1276
- if (this.context && typeof e == "object" && e && "digest" in e && typeof e.digest == "string") {
1277
- const n = Zr(e.digest);
1278
- n && (e = n);
1279
- }
1280
- let t = e !== void 0 ? /* @__PURE__ */ u.createElement(J.Provider, { value: this.props.routeContext }, /* @__PURE__ */ u.createElement(
1281
- Be.Provider,
1282
- {
1283
- value: e,
1284
- children: this.props.component
1285
- }
1286
- )) : this.props.children;
1287
- return this.context ? /* @__PURE__ */ u.createElement(on, { error: e }, t) : t;
1288
- }
1289
- };
1290
- Mt.contextType = Dt;
1291
- var Oe = /* @__PURE__ */ new WeakMap();
1292
- function on({
1293
- children: e,
1294
- error: t
1295
- }) {
1296
- let { basename: n } = u.useContext(U);
1297
- if (typeof t == "object" && t && "digest" in t && typeof t.digest == "string") {
1298
- let a = Xr(t.digest);
1299
- if (a) {
1300
- let i = Oe.get(t);
1301
- if (i) throw i;
1302
- let o = $t(a.location, n), l = o.absoluteURL || o.to;
1303
- if (Yr(l))
1304
- throw new Error("Invalid redirect location");
1305
- if (Lt && !Oe.get(t))
1306
- if (o.isExternal || a.reloadDocument)
1307
- window.location.href = l;
1308
- else {
1309
- const c = Promise.resolve().then(
1310
- () => window.__reactRouterDataRouter.navigate(o.to, {
1311
- replace: a.replace
1312
- })
1313
- );
1314
- throw Oe.set(t, c), c;
1315
- }
1316
- return /* @__PURE__ */ u.createElement("meta", { httpEquiv: "refresh", content: `0;url=${l}` });
1317
- }
1318
- }
1319
- return e;
1320
- }
1321
- function ln({ routeContext: e, match: t, children: n }) {
1322
- let a = u.useContext(te);
1323
- return a && a.static && a.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ u.createElement(J.Provider, { value: e }, n);
1324
- }
1325
- function sn(e, t = [], n) {
1326
- let a = n == null ? void 0 : n.state;
1327
- if (e == null) {
1328
- if (!a)
1329
- return null;
1330
- if (a.errors)
1331
- e = a.matches;
1332
- else if (t.length === 0 && !a.initialized && a.matches.length > 0)
1333
- e = a.matches;
1334
- else
1335
- return null;
1336
- }
1337
- let i = e, o = a == null ? void 0 : a.errors;
1338
- if (o != null) {
1339
- let f = i.findIndex(
1340
- (h) => h.route.id && (o == null ? void 0 : o[h.route.id]) !== void 0
1341
- );
1342
- D(
1343
- f >= 0,
1344
- `Could not find a matching route for errors on route IDs: ${Object.keys(
1345
- o
1346
- ).join(",")}`
1347
- ), i = i.slice(
1348
- 0,
1349
- Math.min(i.length, f + 1)
1350
- );
1351
- }
1352
- let l = !1, c = -1;
1353
- if (n && a) {
1354
- l = a.renderFallback;
1355
- for (let f = 0; f < i.length; f++) {
1356
- let h = i[f];
1357
- if ((h.route.HydrateFallback || h.route.hydrateFallbackElement) && (c = f), h.route.id) {
1358
- let { loaderData: v, errors: y } = a, b = h.route.loader && !v.hasOwnProperty(h.route.id) && (!y || y[h.route.id] === void 0);
1359
- if (h.route.lazy || b) {
1360
- n.isStatic && (l = !0), c >= 0 ? i = i.slice(0, c + 1) : i = [i[0]];
1361
- break;
1362
- }
613
+ return e === w ? sr(d) : ir(d), d;
1363
614
  }
1364
615
  }
1365
- }
1366
- let s = n == null ? void 0 : n.onError, m = a && s ? (f, h) => {
1367
- var v, y;
1368
- s(f, {
1369
- location: a.location,
1370
- params: ((y = (v = a.matches) == null ? void 0 : v[0]) == null ? void 0 : y.params) ?? {},
1371
- pattern: Ur(a.matches),
1372
- errorInfo: h
1373
- });
1374
- } : void 0;
1375
- return i.reduceRight(
1376
- (f, h, v) => {
1377
- let y, b = !1, E = null, g = null;
1378
- a && (y = o && h.route.id ? o[h.route.id] : void 0, E = h.route.errorElement || an, l && (c < 0 && v === 0 ? (Wt(
1379
- "route-fallback",
1380
- !1,
1381
- "No `HydrateFallback` element provided to render during initial hydration"
1382
- ), b = !0, g = null) : c === v && (b = !0, g = h.route.hydrateFallbackElement || null)));
1383
- let w = t.concat(i.slice(0, v + 1)), R = () => {
1384
- let _;
1385
- return y ? _ = E : b ? _ = g : h.route.Component ? _ = /* @__PURE__ */ u.createElement(h.route.Component, null) : h.route.element ? _ = h.route.element : _ = f, /* @__PURE__ */ u.createElement(
1386
- ln,
1387
- {
1388
- match: h,
1389
- routeContext: {
1390
- outlet: f,
1391
- matches: w,
1392
- isDataRoute: a != null
1393
- },
1394
- children: _
1395
- }
1396
- );
1397
- };
1398
- return a && (h.route.ErrorBoundary || h.route.errorElement || v === 0) ? /* @__PURE__ */ u.createElement(
1399
- Mt,
1400
- {
1401
- location: a.location,
1402
- revalidation: a.revalidation,
1403
- component: E,
1404
- error: y,
1405
- children: R(),
1406
- routeContext: { outlet: null, matches: w, isDataRoute: !0 },
1407
- onError: m
1408
- }
1409
- ) : R();
1410
- },
1411
- null
1412
- );
1413
- }
1414
- function Ue(e) {
1415
- return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
1416
- }
1417
- function un(e) {
1418
- let t = u.useContext(te);
1419
- return D(t, Ue(e)), t;
1420
- }
1421
- function cn(e) {
1422
- let t = u.useContext(xe);
1423
- return D(t, Ue(e)), t;
1424
- }
1425
- function fn(e) {
1426
- let t = u.useContext(J);
1427
- return D(t, Ue(e)), t;
1428
- }
1429
- function He(e) {
1430
- let t = fn(e), n = t.matches[t.matches.length - 1];
1431
- return D(
1432
- n.route.id,
1433
- `${e} can only be used on routes that contain a unique "id"`
1434
- ), n.route.id;
1435
- }
1436
- function dn() {
1437
- return He(
1438
- "useRouteId"
1439
- /* UseRouteId */
1440
- );
1441
- }
1442
- function hn() {
1443
- var a;
1444
- let e = u.useContext(Be), t = cn(
1445
- "useRouteError"
1446
- /* UseRouteError */
1447
- ), n = He(
1448
- "useRouteError"
1449
- /* UseRouteError */
1450
- );
1451
- return e !== void 0 ? e : (a = t.errors) == null ? void 0 : a[n];
1452
- }
1453
- function mn() {
1454
- let { router: e } = un(
1455
- "useNavigate"
1456
- /* UseNavigateStable */
1457
- ), t = He(
1458
- "useNavigate"
1459
- /* UseNavigateStable */
1460
- ), n = u.useRef(!1);
1461
- return At(() => {
1462
- n.current = !0;
1463
- }), u.useCallback(
1464
- async (i, o = {}) => {
1465
- Y(n.current, It), n.current && (typeof i == "number" ? await e.navigate(i) : await e.navigate(i, { fromRouteId: t, ...o }));
1466
- },
1467
- [e, t]
1468
- );
1469
- }
1470
- var bt = {};
1471
- function Wt(e, t, n) {
1472
- !t && !bt[e] && (bt[e] = !0, Y(!1, n));
1473
- }
1474
- u.memo(pn);
1475
- function pn({
1476
- routes: e,
1477
- manifest: t,
1478
- future: n,
1479
- state: a,
1480
- isStatic: i,
1481
- onError: o
1482
- }) {
1483
- return rn(e, void 0, {
1484
- manifest: t,
1485
- state: a,
1486
- isStatic: i,
1487
- onError: o
1488
- });
1489
- }
1490
- var pe = "get", ve = "application/x-www-form-urlencoded";
1491
- function be(e) {
1492
- return typeof HTMLElement < "u" && e instanceof HTMLElement;
1493
- }
1494
- function vn(e) {
1495
- return be(e) && e.tagName.toLowerCase() === "button";
1496
- }
1497
- function gn(e) {
1498
- return be(e) && e.tagName.toLowerCase() === "form";
1499
- }
1500
- function yn(e) {
1501
- return be(e) && e.tagName.toLowerCase() === "input";
1502
- }
1503
- function xn(e) {
1504
- return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
1505
- }
1506
- function Rn(e, t) {
1507
- return e.button === 0 && // Ignore everything but left clicks
1508
- (!t || t === "_self") && // Let browser handle "target=_blank" etc.
1509
- !xn(e);
1510
- }
1511
- var me = null;
1512
- function bn() {
1513
- if (me === null)
1514
- try {
1515
- new FormData(
1516
- document.createElement("form"),
1517
- // @ts-expect-error if FormData supports the submitter parameter, this will throw
1518
- 0
1519
- ), me = !1;
1520
- } catch {
1521
- me = !0;
1522
- }
1523
- return me;
1524
- }
1525
- var En = /* @__PURE__ */ new Set([
1526
- "application/x-www-form-urlencoded",
1527
- "multipart/form-data",
1528
- "text/plain"
1529
- ]);
1530
- function De(e) {
1531
- return e != null && !En.has(e) ? (Y(
1532
- !1,
1533
- `"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ve}"`
1534
- ), null) : e;
1535
- }
1536
- function wn(e, t) {
1537
- let n, a, i, o, l;
1538
- if (gn(e)) {
1539
- let c = e.getAttribute("action");
1540
- a = c ? G(c, t) : null, n = e.getAttribute("method") || pe, i = De(e.getAttribute("enctype")) || ve, o = new FormData(e);
1541
- } else if (vn(e) || yn(e) && (e.type === "submit" || e.type === "image")) {
1542
- let c = e.form;
1543
- if (c == null)
1544
- throw new Error(
1545
- 'Cannot submit a <button> or <input type="submit"> without a <form>'
1546
- );
1547
- let s = e.getAttribute("formaction") || c.getAttribute("action");
1548
- if (a = s ? G(s, t) : null, n = e.getAttribute("formmethod") || c.getAttribute("method") || pe, i = De(e.getAttribute("formenctype")) || De(c.getAttribute("enctype")) || ve, o = new FormData(c, e), !bn()) {
1549
- let { name: m, type: f, value: h } = e;
1550
- if (f === "image") {
1551
- let v = m ? `${m}.` : "";
1552
- o.append(`${v}x`, "0"), o.append(`${v}y`, "0");
1553
- } else m && o.append(m, h);
616
+ function or(e, r, t) {
617
+ return Ae(e, r, t, !0);
1554
618
  }
1555
- } else {
1556
- if (be(e))
1557
- throw new Error(
1558
- 'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
1559
- );
1560
- n = pe, a = null, i = ve, l = e;
1561
- }
1562
- return o && i === "text/plain" && (l = o, o = void 0), { action: a, method: n.toLowerCase(), encType: i, formData: o, body: l };
1563
- }
1564
- Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
1565
- function Ve(e, t) {
1566
- if (e === !1 || e === null || typeof e > "u")
1567
- throw new Error(t);
1568
- }
1569
- function Bt(e, t, n, a) {
1570
- let i = typeof e == "string" ? new URL(
1571
- e,
1572
- // This can be called during the SSR flow via PrefetchPageLinksImpl so
1573
- // don't assume window is available
1574
- typeof window > "u" ? "server://singlefetch/" : window.location.origin
1575
- ) : e;
1576
- return n ? i.pathname.endsWith("/") ? i.pathname = `${i.pathname}_.${a}` : i.pathname = `${i.pathname}.${a}` : i.pathname === "/" ? i.pathname = `_root.${a}` : t && G(i.pathname, t) === "/" ? i.pathname = `${ye(t)}/_root.${a}` : i.pathname = `${ye(i.pathname)}.${a}`, i;
1577
- }
1578
- async function Cn(e, t) {
1579
- if (e.id in t)
1580
- return t[e.id];
1581
- try {
1582
- let n = await import(
1583
- /* @vite-ignore */
1584
- /* webpackIgnore: true */
1585
- e.module
1586
- );
1587
- return t[e.id] = n, n;
1588
- } catch (n) {
1589
- return console.error(
1590
- `Error loading route module \`${e.module}\`, reloading page...`
1591
- ), console.error(n), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {
1592
- });
1593
- }
1594
- }
1595
- function Sn(e) {
1596
- return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
1597
- }
1598
- async function Pn(e, t, n) {
1599
- let a = await Promise.all(
1600
- e.map(async (i) => {
1601
- let o = t.routes[i.route.id];
1602
- if (o) {
1603
- let l = await Cn(o, n);
1604
- return l.links ? l.links() : [];
1605
- }
1606
- return [];
1607
- })
1608
- );
1609
- return jn(
1610
- a.flat(1).filter(Sn).filter((i) => i.rel === "stylesheet" || i.rel === "preload").map(
1611
- (i) => i.rel === "stylesheet" ? { ...i, rel: "prefetch", as: "style" } : { ...i, rel: "prefetch" }
1612
- )
1613
- );
1614
- }
1615
- function Et(e, t, n, a, i, o) {
1616
- let l = (s, m) => n[m] ? s.route.id !== n[m].route.id : !0, c = (s, m) => {
1617
- var f;
1618
- return (
1619
- // param change, /users/123 -> /users/456
1620
- n[m].pathname !== s.pathname || // splat param changed, which is not present in match.path
1621
- // e.g. /files/images/avatar.jpg -> files/finances.xls
1622
- ((f = n[m].route.path) == null ? void 0 : f.endsWith("*")) && n[m].params["*"] !== s.params["*"]
1623
- );
1624
- };
1625
- return o === "assets" ? t.filter(
1626
- (s, m) => l(s, m) || c(s, m)
1627
- ) : o === "data" ? t.filter((s, m) => {
1628
- var h;
1629
- let f = a.routes[s.route.id];
1630
- if (!f || !f.hasLoader)
1631
- return !1;
1632
- if (l(s, m) || c(s, m))
1633
- return !0;
1634
- if (s.route.shouldRevalidate) {
1635
- let v = s.route.shouldRevalidate({
1636
- currentUrl: new URL(
1637
- i.pathname + i.search + i.hash,
1638
- window.origin
1639
- ),
1640
- currentParams: ((h = n[0]) == null ? void 0 : h.params) || {},
1641
- nextUrl: new URL(e, window.origin),
1642
- nextParams: s.params,
1643
- defaultShouldRevalidate: !0
1644
- });
1645
- if (typeof v == "boolean")
1646
- return v;
619
+ function lr(e, r, t) {
620
+ return Ae(e, r, t, !1);
1647
621
  }
1648
- return !0;
1649
- }) : [];
1650
- }
1651
- function _n(e, t, { includeHydrateFallback: n } = {}) {
1652
- return Tn(
1653
- e.map((a) => {
1654
- let i = t.routes[a.route.id];
1655
- if (!i) return [];
1656
- let o = [i.module];
1657
- return i.clientActionModule && (o = o.concat(i.clientActionModule)), i.clientLoaderModule && (o = o.concat(i.clientLoaderModule)), n && i.hydrateFallbackModule && (o = o.concat(i.hydrateFallbackModule)), i.imports && (o = o.concat(i.imports)), o;
1658
- }).flat(1)
1659
- );
1660
- }
1661
- function Tn(e) {
1662
- return [...new Set(e)];
1663
- }
1664
- function kn(e) {
1665
- let t = {}, n = Object.keys(e).sort();
1666
- for (let a of n)
1667
- t[a] = e[a];
1668
- return t;
1669
- }
1670
- function jn(e, t) {
1671
- let n = /* @__PURE__ */ new Set();
1672
- return new Set(t), e.reduce((a, i) => {
1673
- let o = JSON.stringify(kn(i));
1674
- return n.has(o) || (n.add(o), a.push({ key: o, link: i })), a;
1675
- }, []);
622
+ var cr = lr, ur = or;
623
+ H.Fragment = w, H.jsx = cr, H.jsxs = ur;
624
+ })()), H;
1676
625
  }
1677
- function Ye() {
1678
- let e = u.useContext(te);
1679
- return Ve(
1680
- e,
1681
- "You must render this element inside a <DataRouterContext.Provider> element"
1682
- ), e;
1683
- }
1684
- function Ln() {
1685
- let e = u.useContext(xe);
1686
- return Ve(
1687
- e,
1688
- "You must render this element inside a <DataRouterStateContext.Provider> element"
1689
- ), e;
1690
- }
1691
- var Je = u.createContext(void 0);
1692
- Je.displayName = "FrameworkContext";
1693
- function Ee() {
1694
- let e = u.useContext(Je);
1695
- return Ve(
1696
- e,
1697
- "You must render this element inside a <HydratedRouter> element"
1698
- ), e;
1699
- }
1700
- function $n(e, t) {
1701
- let n = u.useContext(Je), [a, i] = u.useState(!1), [o, l] = u.useState(!1), { onFocus: c, onBlur: s, onMouseEnter: m, onMouseLeave: f, onTouchStart: h } = t, v = u.useRef(null);
1702
- u.useEffect(() => {
1703
- if (e === "render" && l(!0), e === "viewport") {
1704
- let E = (w) => {
1705
- w.forEach((R) => {
1706
- l(R.isIntersecting);
1707
- });
1708
- }, g = new IntersectionObserver(E, { threshold: 0.5 });
1709
- return v.current && g.observe(v.current), () => {
1710
- g.disconnect();
1711
- };
1712
- }
1713
- }, [e]), u.useEffect(() => {
1714
- if (a) {
1715
- let E = setTimeout(() => {
1716
- l(!0);
1717
- }, 100);
1718
- return () => {
1719
- clearTimeout(E);
1720
- };
1721
- }
1722
- }, [a]);
1723
- let y = () => {
1724
- i(!0);
1725
- }, b = () => {
1726
- i(!1), l(!1);
626
+ var $e;
627
+ function gr() {
628
+ return $e || ($e = 1, process.env.NODE_ENV === "production" ? oe.exports = mr() : oe.exports = xr()), oe.exports;
629
+ }
630
+ var n = gr();
631
+ const Ye = pr(null), Cr = ({ children: C }) => {
632
+ const [O, m] = K(!0), [w, T] = K(null), P = () => {
633
+ m((x) => !x), T(null);
634
+ }, N = (x) => {
635
+ T((p) => p === x ? null : x);
1727
636
  };
1728
- return n ? e !== "intent" ? [o, v, {}] : [
1729
- o,
1730
- v,
637
+ return /* @__PURE__ */ n.jsx(
638
+ Ye.Provider,
1731
639
  {
1732
- onFocus: oe(c, y),
1733
- onBlur: oe(s, b),
1734
- onMouseEnter: oe(m, y),
1735
- onMouseLeave: oe(f, b),
1736
- onTouchStart: oe(h, y)
1737
- }
1738
- ] : [!1, v, {}];
1739
- }
1740
- function oe(e, t) {
1741
- return (n) => {
1742
- e && e(n), n.defaultPrevented || t(n);
1743
- };
1744
- }
1745
- function On({ page: e, ...t }) {
1746
- let n = Jr(), { nonce: a } = Ee(), { router: i } = Ye(), o = u.useMemo(
1747
- () => Ct(i.routes, e, i.basename),
1748
- [i.routes, e, i.basename]
1749
- );
1750
- return o ? (t.nonce == null && a && (t = { ...t, nonce: a }), n ? /* @__PURE__ */ u.createElement(Fn, { page: e, matches: o, ...t }) : /* @__PURE__ */ u.createElement(Nn, { page: e, matches: o, ...t })) : null;
1751
- }
1752
- function Dn(e) {
1753
- let { manifest: t, routeModules: n } = Ee(), [a, i] = u.useState([]);
1754
- return u.useEffect(() => {
1755
- let o = !1;
1756
- return Pn(e, t, n).then(
1757
- (l) => {
1758
- o || i(l);
1759
- }
1760
- ), () => {
1761
- o = !0;
1762
- };
1763
- }, [e, t, n]), a;
1764
- }
1765
- function Fn({
1766
- page: e,
1767
- matches: t,
1768
- ...n
1769
- }) {
1770
- let a = q(), { future: i } = Ee(), { basename: o } = Ye(), l = u.useMemo(() => {
1771
- if (e === a.pathname + a.search + a.hash)
1772
- return [];
1773
- let c = Bt(
1774
- e,
1775
- o,
1776
- i.v8_trailingSlashAwareDataRequests,
1777
- "rsc"
1778
- ), s = !1, m = [];
1779
- for (let f of t)
1780
- typeof f.route.shouldRevalidate == "function" ? s = !0 : m.push(f.route.id);
1781
- return s && m.length > 0 && c.searchParams.set("_routes", m.join(",")), [c.pathname + c.search];
1782
- }, [
1783
- o,
1784
- i.v8_trailingSlashAwareDataRequests,
1785
- e,
1786
- a,
1787
- t
1788
- ]);
1789
- return /* @__PURE__ */ u.createElement(u.Fragment, null, l.map((c) => /* @__PURE__ */ u.createElement("link", { key: c, rel: "prefetch", as: "fetch", href: c, ...n })));
1790
- }
1791
- function Nn({
1792
- page: e,
1793
- matches: t,
1794
- ...n
1795
- }) {
1796
- let a = q(), { future: i, manifest: o, routeModules: l } = Ee(), { basename: c } = Ye(), { loaderData: s, matches: m } = Ln(), f = u.useMemo(
1797
- () => Et(
1798
- e,
1799
- t,
1800
- m,
1801
- o,
1802
- a,
1803
- "data"
1804
- ),
1805
- [e, t, m, o, a]
1806
- ), h = u.useMemo(
1807
- () => Et(
1808
- e,
1809
- t,
1810
- m,
1811
- o,
1812
- a,
1813
- "assets"
1814
- ),
1815
- [e, t, m, o, a]
1816
- ), v = u.useMemo(() => {
1817
- if (e === a.pathname + a.search + a.hash)
1818
- return [];
1819
- let E = /* @__PURE__ */ new Set(), g = !1;
1820
- if (t.forEach((R) => {
1821
- var $;
1822
- let _ = o.routes[R.route.id];
1823
- !_ || !_.hasLoader || (!f.some((j) => j.route.id === R.route.id) && R.route.id in s && (($ = l[R.route.id]) != null && $.shouldRevalidate) || _.hasClientLoader ? g = !0 : E.add(R.route.id));
1824
- }), E.size === 0)
1825
- return [];
1826
- let w = Bt(
1827
- e,
1828
- c,
1829
- i.v8_trailingSlashAwareDataRequests,
1830
- "data"
1831
- );
1832
- return g && E.size > 0 && w.searchParams.set(
1833
- "_routes",
1834
- t.filter((R) => E.has(R.route.id)).map((R) => R.route.id).join(",")
1835
- ), [w.pathname + w.search];
1836
- }, [
1837
- c,
1838
- i.v8_trailingSlashAwareDataRequests,
1839
- s,
1840
- a,
1841
- o,
1842
- f,
1843
- t,
1844
- e,
1845
- l
1846
- ]), y = u.useMemo(
1847
- () => _n(h, o),
1848
- [h, o]
1849
- ), b = Dn(h);
1850
- return /* @__PURE__ */ u.createElement(u.Fragment, null, v.map((E) => /* @__PURE__ */ u.createElement("link", { key: E, rel: "prefetch", as: "fetch", href: E, ...n })), y.map((E) => /* @__PURE__ */ u.createElement("link", { key: E, rel: "modulepreload", href: E, ...n })), b.map(({ key: E, link: g }) => (
1851
- // these don't spread `linkProps` because they are full link descriptors
1852
- // already with their own props
1853
- /* @__PURE__ */ u.createElement(
1854
- "link",
1855
- {
1856
- key: E,
1857
- nonce: n.nonce,
1858
- ...g,
1859
- crossOrigin: g.crossOrigin ?? n.crossOrigin
1860
- }
1861
- )
1862
- )));
1863
- }
1864
- function In(...e) {
1865
- return (t) => {
1866
- e.forEach((n) => {
1867
- typeof n == "function" ? n(t) : n != null && (n.current = t);
1868
- });
1869
- };
1870
- }
1871
- var An = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
1872
- try {
1873
- An && (window.__reactRouterVersion = // @ts-expect-error
1874
- "7.18.0");
1875
- } catch {
1876
- }
1877
- var Ut = u.forwardRef(
1878
- function({
1879
- onClick: t,
1880
- discover: n = "render",
1881
- prefetch: a = "none",
1882
- relative: i,
1883
- reloadDocument: o,
1884
- replace: l,
1885
- mask: c,
1886
- state: s,
1887
- target: m,
1888
- to: f,
1889
- preventScrollReset: h,
1890
- viewTransition: v,
1891
- defaultShouldRevalidate: y,
1892
- ...b
1893
- }, E) {
1894
- let { basename: g, navigator: w, useTransitions: R } = u.useContext(U), _ = typeof f == "string" && Ie.test(f), $ = $t(f, g);
1895
- f = $.to;
1896
- let j = Qr(f, { relative: i }), A = q(), H = null;
1897
- if (c) {
1898
- let N = Me(
1899
- c,
1900
- [],
1901
- A.mask ? A.mask.pathname : "/",
1902
- !0
1903
- );
1904
- g !== "/" && (N.pathname = N.pathname === "/" ? g : B([g, N.pathname])), H = w.createHref(N);
640
+ value: { isExpanded: O, toggleSidebar: P, openSubmenu: w, toggleSubmenu: N },
641
+ children: C
1905
642
  }
1906
- let [z, K, re] = $n(
1907
- a,
1908
- b
1909
- ), we = Bn(f, {
1910
- replace: l,
1911
- mask: c,
1912
- state: s,
1913
- target: m,
1914
- preventScrollReset: h,
1915
- relative: i,
1916
- viewTransition: v,
1917
- defaultShouldRevalidate: y,
1918
- useTransitions: R
1919
- });
1920
- function se(N) {
1921
- t && t(N), N.defaultPrevented || we(N);
1922
- }
1923
- let W = !($.isExternal || o), V = (
1924
- // eslint-disable-next-line jsx-a11y/anchor-has-content
1925
- /* @__PURE__ */ u.createElement(
1926
- "a",
1927
- {
1928
- ...b,
1929
- ...re,
1930
- href: (W ? H : void 0) || $.absoluteURL || j,
1931
- onClick: W ? se : t,
1932
- ref: In(E, K),
1933
- target: m,
1934
- "data-discover": !_ && n === "render" ? "true" : void 0
1935
- }
1936
- )
1937
- );
1938
- return z && !_ ? /* @__PURE__ */ u.createElement(u.Fragment, null, V, /* @__PURE__ */ u.createElement(On, { page: j })) : V;
1939
- }
1940
- );
1941
- Ut.displayName = "Link";
1942
- var Ne = u.forwardRef(
1943
- function({
1944
- "aria-current": t = "page",
1945
- caseSensitive: n = !1,
1946
- className: a = "",
1947
- end: i = !1,
1948
- style: o,
1949
- to: l,
1950
- viewTransition: c,
1951
- children: s,
1952
- ...m
1953
- }, f) {
1954
- let h = le(l, { relative: m.relative }), v = q(), y = u.useContext(xe), { navigator: b, basename: E } = u.useContext(U), g = y != null && // Conditional usage is OK here because the usage of a data router is static
1955
- // eslint-disable-next-line react-hooks/rules-of-hooks
1956
- Jn(h) && c === !0, w = b.encodeLocation ? b.encodeLocation(h).pathname : h.pathname, R = v.pathname, _ = y && y.navigation && y.navigation.location ? y.navigation.location.pathname : null;
1957
- n || (R = R.toLowerCase(), _ = _ ? _.toLowerCase() : null, w = w.toLowerCase()), _ && E && (_ = G(_, E) || _);
1958
- const $ = w !== "/" && w.endsWith("/") ? w.length - 1 : w.length;
1959
- let j = R === w || !i && R.startsWith(w) && R.charAt($) === "/", A = _ != null && (_ === w || !i && _.startsWith(w) && _.charAt(w.length) === "/"), H = {
1960
- isActive: j,
1961
- isPending: A,
1962
- isTransitioning: g
1963
- }, z = j ? t : void 0, K;
1964
- typeof a == "function" ? K = a(H) : K = [
1965
- a,
1966
- j ? "active" : null,
1967
- A ? "pending" : null,
1968
- g ? "transitioning" : null
1969
- ].filter(Boolean).join(" ");
1970
- let re = typeof o == "function" ? o(H) : o;
1971
- return /* @__PURE__ */ u.createElement(
1972
- Ut,
1973
- {
1974
- ...m,
1975
- "aria-current": z,
1976
- className: K,
1977
- ref: f,
1978
- style: re,
1979
- to: l,
1980
- viewTransition: c
1981
- },
1982
- typeof s == "function" ? s(H) : s
1983
- );
1984
- }
1985
- );
1986
- Ne.displayName = "NavLink";
1987
- var Mn = u.forwardRef(
1988
- ({
1989
- discover: e = "render",
1990
- fetcherKey: t,
1991
- navigate: n,
1992
- reloadDocument: a,
1993
- replace: i,
1994
- state: o,
1995
- method: l = pe,
1996
- action: c,
1997
- onSubmit: s,
1998
- relative: m,
1999
- preventScrollReset: f,
2000
- viewTransition: h,
2001
- defaultShouldRevalidate: v,
2002
- ...y
2003
- }, b) => {
2004
- let { useTransitions: E } = u.useContext(U), g = Vn(), w = Yn(c, { relative: m }), R = l.toLowerCase() === "get" ? "get" : "post", _ = typeof c == "string" && Ie.test(c), $ = (j) => {
2005
- if (s && s(j), j.defaultPrevented) return;
2006
- j.preventDefault();
2007
- let A = j.nativeEvent.submitter, H = (A == null ? void 0 : A.getAttribute("formmethod")) || l, z = () => g(A || j.currentTarget, {
2008
- fetcherKey: t,
2009
- method: H,
2010
- navigate: n,
2011
- replace: i,
2012
- state: o,
2013
- relative: m,
2014
- preventScrollReset: f,
2015
- viewTransition: h,
2016
- defaultShouldRevalidate: v
2017
- });
2018
- E && n !== !1 ? u.startTransition(() => z()) : z();
2019
- };
2020
- return /* @__PURE__ */ u.createElement(
2021
- "form",
2022
- {
2023
- ref: b,
2024
- method: R,
2025
- action: w,
2026
- onSubmit: a ? s : $,
2027
- ...y,
2028
- "data-discover": !_ && e === "render" ? "true" : void 0
2029
- }
2030
- );
2031
- }
2032
- );
2033
- Mn.displayName = "Form";
2034
- function Wn(e) {
2035
- return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
2036
- }
2037
- function Ht(e) {
2038
- let t = u.useContext(te);
2039
- return D(t, Wn(e)), t;
2040
- }
2041
- function Bn(e, {
2042
- target: t,
2043
- replace: n,
2044
- mask: a,
2045
- state: i,
2046
- preventScrollReset: o,
2047
- relative: l,
2048
- viewTransition: c,
2049
- defaultShouldRevalidate: s,
2050
- useTransitions: m
2051
- } = {}) {
2052
- let f = en(), h = q(), v = le(e, { relative: l });
2053
- return u.useCallback(
2054
- (y) => {
2055
- if (Rn(y, t)) {
2056
- y.preventDefault();
2057
- let b = n !== void 0 ? n : Fe(h) === Fe(v), E = () => f(e, {
2058
- replace: b,
2059
- mask: a,
2060
- state: i,
2061
- preventScrollReset: o,
2062
- relative: l,
2063
- viewTransition: c,
2064
- defaultShouldRevalidate: s
2065
- });
2066
- m ? u.startTransition(() => E()) : E();
2067
- }
2068
- },
2069
- [
2070
- h,
2071
- f,
2072
- v,
2073
- n,
2074
- a,
2075
- i,
2076
- t,
2077
- e,
2078
- o,
2079
- l,
2080
- c,
2081
- s,
2082
- m
2083
- ]
2084
643
  );
2085
- }
2086
- var Un = 0, Hn = () => `__${String(++Un)}__`;
2087
- function Vn() {
2088
- let { router: e } = Ht(
2089
- "useSubmit"
2090
- /* UseSubmit */
2091
- ), { basename: t } = u.useContext(U), n = dn(), a = e.fetch, i = e.navigate;
2092
- return u.useCallback(
2093
- async (o, l = {}) => {
2094
- let { action: c, method: s, encType: m, formData: f, body: h } = wn(
2095
- o,
2096
- t
2097
- );
2098
- if (l.navigate === !1) {
2099
- let v = l.fetcherKey || Hn();
2100
- await a(v, n, l.action || c, {
2101
- defaultShouldRevalidate: l.defaultShouldRevalidate,
2102
- preventScrollReset: l.preventScrollReset,
2103
- formData: f,
2104
- body: h,
2105
- formMethod: l.method || s,
2106
- formEncType: l.encType || m,
2107
- flushSync: l.flushSync
2108
- });
2109
- } else
2110
- await i(l.action || c, {
2111
- defaultShouldRevalidate: l.defaultShouldRevalidate,
2112
- preventScrollReset: l.preventScrollReset,
2113
- formData: f,
2114
- body: h,
2115
- formMethod: l.method || s,
2116
- formEncType: l.encType || m,
2117
- replace: l.replace,
2118
- state: l.state,
2119
- fromRouteId: n,
2120
- flushSync: l.flushSync,
2121
- viewTransition: l.viewTransition
2122
- });
644
+ }, br = () => {
645
+ const C = vr(Ye);
646
+ if (!C) throw new Error("useSidebar must be used inside <SidebarProvider>");
647
+ return C;
648
+ }, jr = () => /* @__PURE__ */ n.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
649
+ /* @__PURE__ */ n.jsx("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
650
+ /* @__PURE__ */ n.jsx("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
651
+ /* @__PURE__ */ n.jsx("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
652
+ ] }), yr = () => /* @__PURE__ */ n.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
653
+ /* @__PURE__ */ n.jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
654
+ /* @__PURE__ */ n.jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
655
+ ] }), Er = () => /* @__PURE__ */ n.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
656
+ /* @__PURE__ */ n.jsx("circle", { cx: "12", cy: "12", r: "10" }),
657
+ /* @__PURE__ */ n.jsx("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
658
+ /* @__PURE__ */ n.jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
659
+ ] }), Rr = () => /* @__PURE__ */ n.jsxs("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", children: [
660
+ /* @__PURE__ */ n.jsx("rect", { width: "32", height: "32", rx: "8", fill: "currentColor", opacity: "0.15" }),
661
+ /* @__PURE__ */ n.jsx("circle", { cx: "16", cy: "16", r: "6", fill: "currentColor" })
662
+ ] }), _r = () => /* @__PURE__ */ n.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
663
+ /* @__PURE__ */ n.jsx("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
664
+ /* @__PURE__ */ n.jsx("polyline", { points: "16 17 21 12 16 7" }),
665
+ /* @__PURE__ */ n.jsx("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
666
+ ] }), Sr = ({ config: C }) => {
667
+ const {
668
+ navItems: O,
669
+ user: m,
670
+ createButtonRoles: w,
671
+ createButtonLabel: T = "Create",
672
+ createButtonPath: P,
673
+ brandName: N = "Amphenol",
674
+ brandSubtitle: x = "COMMUNICATION SOLUTIONS",
675
+ logo: p,
676
+ helpLabel: I = "Help Center",
677
+ helpIcon: g,
678
+ onSignOut: R,
679
+ onNavigate: S,
680
+ className: L = ""
681
+ } = C, { isExpanded: E, toggleSidebar: G, openSubmenu: Y, toggleSubmenu: A } = br(), [v, le] = K(window.location.pathname), [ce, z] = K(!1), [ue, X] = K(!1);
682
+ hr(() => {
683
+ const c = () => le(window.location.pathname);
684
+ return window.addEventListener("popstate", c), () => window.removeEventListener("popstate", c);
685
+ }, []);
686
+ const M = (c, j) => {
687
+ c.preventDefault(), j && (S ? S(j) : (window.history.pushState({}, "", j), window.dispatchEvent(new PopStateEvent("popstate"))));
688
+ }, U = () => m.email ? m.email.split("@")[0] : "User", Z = () => m.email ? m.email.charAt(0).toUpperCase() : "U", fe = () => {
689
+ R ? R() : window.location.href = "/c/portal/logout";
690
+ }, Q = !w || w.includes(m.role), k = O.reduce(
691
+ (c, j) => {
692
+ const D = j.section || "GENERAL";
693
+ return c[D] || (c[D] = []), c[D].push(j), c;
2123
694
  },
2124
- [a, i, t, n]
695
+ {}
2125
696
  );
2126
- }
2127
- function Yn(e, { relative: t } = {}) {
2128
- let { basename: n } = u.useContext(U), a = u.useContext(J);
2129
- D(a, "useFormAction must be used inside a RouteContext");
2130
- let [i] = a.matches.slice(-1), o = { ...le(e || ".", { relative: t }) }, l = q();
2131
- if (e == null) {
2132
- o.search = l.search;
2133
- let c = new URLSearchParams(o.search), s = c.getAll("index");
2134
- if (s.some((f) => f === "")) {
2135
- c.delete("index"), s.filter((h) => h).forEach((h) => c.append("index", h));
2136
- let f = c.toString();
2137
- o.search = f ? `?${f}` : "";
2138
- }
2139
- }
2140
- return (!e || e === ".") && i.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), n !== "/" && (o.pathname = o.pathname === "/" ? n : B([n, o.pathname])), Fe(o);
2141
- }
2142
- function Jn(e, { relative: t } = {}) {
2143
- let n = u.useContext(Ft);
2144
- D(
2145
- n != null,
2146
- "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
2147
- );
2148
- let { basename: a } = Ht(
2149
- "useViewTransitionState"
2150
- /* useViewTransitionState */
2151
- ), i = le(e, { relative: t });
2152
- if (!n.isTransitioning)
2153
- return !1;
2154
- let o = G(n.currentLocation.pathname, a) || n.currentLocation.pathname, l = G(n.nextLocation.pathname, a) || n.nextLocation.pathname;
2155
- return ge(i.pathname, l) != null || ge(i.pathname, o) != null;
2156
- }
2157
- const Z = (...e) => e.filter(Boolean).join(" "), qn = () => /* @__PURE__ */ P.jsx("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", children: /* @__PURE__ */ P.jsx(
2158
- "path",
2159
- {
2160
- d: "M2 4h14M2 9h14M2 14h14",
2161
- stroke: "currentColor",
2162
- strokeWidth: "1.5",
2163
- strokeLinecap: "round"
2164
- }
2165
- ) });
2166
- function zn(e, t) {
2167
- return e ? {
2168
- activeBg: `bg-${e}/20`,
2169
- hoverBg: `hover:bg-${e}/10`,
2170
- textClass: `text-${e}`,
2171
- hoverTextClass: `hover:text-${e}`,
2172
- borderColor: t ?? "#4ade80"
2173
- } : {
2174
- activeBg: "bg-green-500/20",
2175
- hoverBg: "hover:bg-green-500/10",
2176
- textClass: "text-green-400",
2177
- hoverTextClass: "hover:text-green-400",
2178
- borderColor: t ?? "#4ade80"
2179
- };
2180
- }
2181
- function Gn({
2182
- open: e,
2183
- onToggle: t,
2184
- navConfig: n,
2185
- logo: a,
2186
- cta: i,
2187
- user: o,
2188
- footerLinks: l = [],
2189
- bgColor: c = "bg-[#1a1f2e]"
2190
- }) {
2191
- return /* @__PURE__ */ P.jsxs(
697
+ return /* @__PURE__ */ n.jsxs(
2192
698
  "aside",
2193
699
  {
2194
- className: Z(
2195
- "h-screen flex flex-col transition-all duration-300 ease-in-out flex-shrink-0",
2196
- c,
2197
- e ? "w-64" : "w-16"
2198
- ),
700
+ className: `rdr-sidebar ${E ? "expanded" : "collapsed"} ${L}`,
2199
701
  children: [
2200
- /* @__PURE__ */ P.jsxs(
2201
- "div",
2202
- {
2203
- className: Z(
2204
- "flex items-center gap-3 py-4 border-b border-white/10 min-h-[64px]",
2205
- e ? "px-3" : "px-0 justify-center"
2206
- ),
2207
- children: [
2208
- /* @__PURE__ */ P.jsx(
2209
- "div",
2210
- {
2211
- className: "w-8 h-8 flex-shrink-0 cursor-pointer",
2212
- onClick: t,
2213
- title: e ? "Collapse sidebar" : "Expand sidebar",
2214
- children: (a == null ? void 0 : a.icon) ?? /* @__PURE__ */ P.jsx("div", { className: "w-8 h-8 bg-green-500 rounded-full flex items-center justify-center text-white text-xs font-bold", children: "A" })
2215
- }
2216
- ),
2217
- e && /* @__PURE__ */ P.jsxs(P.Fragment, { children: [
2218
- /* @__PURE__ */ P.jsxs("div", { className: "overflow-hidden flex-1", children: [
2219
- (a == null ? void 0 : a.name) && /* @__PURE__ */ P.jsx("div", { className: "text-white font-bold text-sm truncate", children: a.name }),
2220
- (a == null ? void 0 : a.subLabel) && /* @__PURE__ */ P.jsx("div", { className: "text-gray-400 text-[10px] font-semibold whitespace-nowrap", children: a.subLabel })
2221
- ] }),
2222
- /* @__PURE__ */ P.jsx(
2223
- "button",
2224
- {
2225
- onClick: t,
2226
- className: "text-gray-400 hover:text-white flex-shrink-0",
2227
- title: "Collapse sidebar",
2228
- children: /* @__PURE__ */ P.jsx(qn, {})
2229
- }
2230
- )
2231
- ] })
2232
- ]
2233
- }
2234
- ),
2235
- i && /* @__PURE__ */ P.jsx("div", { className: "px-3 py-4", children: /* @__PURE__ */ P.jsxs(
2236
- Ne,
702
+ /* @__PURE__ */ n.jsxs("div", { className: "sidebar-header", children: [
703
+ /* @__PURE__ */ n.jsxs("div", { className: "logo-section", onClick: G, children: [
704
+ /* @__PURE__ */ n.jsx("span", { className: "logo-icon", style: { color: "var(--sidebar-accent)" }, children: p ?? /* @__PURE__ */ n.jsx(Rr, {}) }),
705
+ E && /* @__PURE__ */ n.jsxs("div", { className: "brand-text", children: [
706
+ /* @__PURE__ */ n.jsx("h2", { children: N }),
707
+ x && /* @__PURE__ */ n.jsx("span", { children: x })
708
+ ] })
709
+ ] }),
710
+ E && /* @__PURE__ */ n.jsx(
711
+ "button",
712
+ {
713
+ className: "menu-toggle",
714
+ onClick: G,
715
+ "aria-label": "Collapse sidebar",
716
+ children: /* @__PURE__ */ n.jsx(jr, {})
717
+ }
718
+ )
719
+ ] }),
720
+ Q && P && /* @__PURE__ */ n.jsx("div", { className: "sidebar-actions", children: /* @__PURE__ */ n.jsxs(
721
+ "button",
2237
722
  {
2238
- to: i.to,
2239
- className: Z(
2240
- "w-full text-white rounded-md flex items-center gap-2 transition-colors font-medium text-sm",
2241
- i.color ?? "bg-[#059669] hover:bg-green-600",
2242
- e ? "px-3 py-2 justify-start" : "p-2 justify-center"
2243
- ),
2244
- title: e ? void 0 : i.label,
723
+ className: "sidebar-create-btn",
724
+ style: {
725
+ display: "flex",
726
+ alignItems: "center",
727
+ justifyContent: "center",
728
+ gap: "8px",
729
+ width: "100%",
730
+ height: "44px",
731
+ padding: "0 16px",
732
+ borderRadius: "10px",
733
+ border: "none",
734
+ outline: "none",
735
+ boxShadow: "none",
736
+ cursor: "pointer",
737
+ fontSize: "14px",
738
+ fontWeight: 600,
739
+ color: "#fff",
740
+ background: ue ? "#149B6E" : "#18B885",
741
+ transition: "background-color 0.2s ease"
742
+ },
743
+ onMouseEnter: () => X(!0),
744
+ onMouseLeave: () => X(!1),
745
+ onClick: (c) => M(c, P),
2245
746
  children: [
2246
- /* @__PURE__ */ P.jsx("span", { className: "flex-shrink-0", children: i.icon }),
2247
- e && /* @__PURE__ */ P.jsx("span", { children: i.label })
747
+ /* @__PURE__ */ n.jsx(yr, {}),
748
+ E && /* @__PURE__ */ n.jsx("span", { children: T })
2248
749
  ]
2249
750
  }
2250
751
  ) }),
2251
- /* @__PURE__ */ P.jsx("nav", { className: "flex-1 overflow-y-auto px-2 space-y-1", children: n.map(({ section: s, color: m, rawColor: f, items: h }) => {
2252
- const { activeBg: v, hoverBg: y, textClass: b, hoverTextClass: E, borderColor: g } = zn(m, f);
2253
- return /* @__PURE__ */ P.jsxs("div", { className: "mb-4", children: [
2254
- e ? /* @__PURE__ */ P.jsx("p", { className: "text-gray-500 text-[10px] font-semibold uppercase tracking-widest px-2 mb-1", children: s }) : /* @__PURE__ */ P.jsx("div", { className: "border-t border-white/10 my-2" }),
2255
- h.map(({ label: w, icon: R, to: _ }) => /* @__PURE__ */ P.jsxs(
2256
- Ne,
752
+ /* @__PURE__ */ n.jsx("div", { className: "sidebar-nav", children: Object.entries(k).map(([c, j]) => {
753
+ const D = j.filter(
754
+ (u) => !u.roles || u.roles.includes(m.role)
755
+ );
756
+ return D.length ? /* @__PURE__ */ n.jsxs("div", { className: "nav-section", style: { listStyleType: "none" }, children: [
757
+ E && /* @__PURE__ */ n.jsx("h4", { className: "section-title", children: c }),
758
+ /* @__PURE__ */ n.jsx("ul", { className: "nav-items", children: D.map((u) => {
759
+ var B, V;
760
+ const ee = (B = u.subItems) == null ? void 0 : B.some(
761
+ (h) => h.path && v.includes(h.path)
762
+ ), re = u.path ? v === u.path : !1;
763
+ return /* @__PURE__ */ n.jsx("li", { children: (V = u.subItems) != null && V.length ? (
764
+ /* Parent with submenu */
765
+ /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
766
+ /* @__PURE__ */ n.jsxs(
767
+ "div",
768
+ {
769
+ className: `nav-item ${Y === u.name || ee ? "active" : ""}`,
770
+ "data-label": u.name,
771
+ onClick: () => A(u.name),
772
+ children: [
773
+ /* @__PURE__ */ n.jsx("span", { className: "nav-icon", children: u.icon }),
774
+ E && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
775
+ /* @__PURE__ */ n.jsx("span", { className: "nav-text", children: u.name }),
776
+ /* @__PURE__ */ n.jsx("span", { className: "submenu-arrow", children: Y === u.name ? "−" : "+" })
777
+ ] })
778
+ ]
779
+ }
780
+ ),
781
+ E && Y === u.name && /* @__PURE__ */ n.jsx("ul", { className: "submenu", children: u.subItems.map((h) => {
782
+ const ne = h.path ? v === h.path : !1;
783
+ return /* @__PURE__ */ n.jsx("li", { children: /* @__PURE__ */ n.jsxs(
784
+ "a",
785
+ {
786
+ href: h.path || "/",
787
+ onClick: (de) => M(de, h.path),
788
+ className: `submenu-item ${ne ? "active-sub" : ""}`,
789
+ children: [
790
+ h.icon && /* @__PURE__ */ n.jsx("span", { className: "submenu-icon", children: h.icon }),
791
+ /* @__PURE__ */ n.jsx("span", { children: h.name })
792
+ ]
793
+ }
794
+ ) }, h.name);
795
+ }) })
796
+ ] })
797
+ ) : (
798
+ /* Leaf nav item */
799
+ /* @__PURE__ */ n.jsxs(
800
+ "a",
801
+ {
802
+ href: u.path || "/",
803
+ "data-label": u.name,
804
+ onClick: (h) => M(h, u.path),
805
+ className: `nav-item ${re ? "active" : ""}`,
806
+ children: [
807
+ /* @__PURE__ */ n.jsx("span", { className: "nav-icon", children: u.icon }),
808
+ E && /* @__PURE__ */ n.jsx("span", { className: "nav-text", children: u.name })
809
+ ]
810
+ }
811
+ )
812
+ ) }, u.name);
813
+ }) })
814
+ ] }, c) : null;
815
+ }) }),
816
+ /* @__PURE__ */ n.jsxs("div", { className: "sidebar-footer", children: [
817
+ /* @__PURE__ */ n.jsxs("div", { className: "footer-link", "data-label": I, children: [
818
+ /* @__PURE__ */ n.jsx("span", { children: g ?? /* @__PURE__ */ n.jsx(Er, {}) }),
819
+ E && /* @__PURE__ */ n.jsx("span", { children: I })
820
+ ] }),
821
+ /* @__PURE__ */ n.jsxs("div", { className: "user-profile-wrapper", children: [
822
+ /* @__PURE__ */ n.jsxs(
823
+ "div",
2257
824
  {
2258
- to: _,
2259
- title: e ? void 0 : w,
2260
- className: ({ isActive: $ }) => Z(
2261
- // base
2262
- "group w-full flex items-center gap-3 rounded-md px-2 py-2 text-sm transition-all duration-200 mb-0.5",
2263
- // always reserve 2px on the left for the border — prevents layout shift
2264
- "border-l-2",
2265
- $ ? `${v} ${b}` : `text-[#DAE2FD] ${y} ${E}`,
2266
- !e && "justify-center"
2267
- ),
2268
- style: ({ isActive: $ }) => ({
2269
- borderColor: $ ? g : "transparent"
2270
- }),
2271
- onMouseEnter: ($) => {
2272
- const j = $.currentTarget;
2273
- j.getAttribute("aria-current") !== "page" && (j.style.borderColor = g);
2274
- },
2275
- onMouseLeave: ($) => {
2276
- const j = $.currentTarget;
2277
- j.getAttribute("aria-current") !== "page" && (j.style.borderColor = "transparent");
2278
- },
825
+ className: "user-profile",
826
+ onClick: () => z((c) => !c),
2279
827
  children: [
2280
- /* @__PURE__ */ P.jsx("span", { className: "flex-shrink-0", children: R }),
2281
- e && /* @__PURE__ */ P.jsx("span", { children: w })
828
+ /* @__PURE__ */ n.jsx("div", { className: "avatar", children: Z() }),
829
+ E && /* @__PURE__ */ n.jsxs("div", { className: "user-info", children: [
830
+ /* @__PURE__ */ n.jsx("div", { className: "user-name", children: U() }),
831
+ /* @__PURE__ */ n.jsx("div", { className: "user-role", children: m.roleName })
832
+ ] })
2282
833
  ]
2283
- },
2284
- w
2285
- ))
2286
- ] }, s);
2287
- }) }),
2288
- /* @__PURE__ */ P.jsxs("div", { className: "border-t border-white/10 px-2 py-3 space-y-0.5", children: [
2289
- l.map(({ label: s, icon: m, onClick: f }) => /* @__PURE__ */ P.jsxs(
2290
- "button",
2291
- {
2292
- onClick: f,
2293
- title: e ? void 0 : s,
2294
- className: Z(
2295
- "w-full flex items-center gap-3 rounded-md px-2 py-2 text-sm text-gray-400 hover:bg-white/5 hover:text-white",
2296
- !e && "justify-center"
2297
- ),
2298
- children: [
2299
- /* @__PURE__ */ P.jsx("span", { className: "flex-shrink-0", children: m }),
2300
- e && /* @__PURE__ */ P.jsx("span", { children: s })
2301
- ]
2302
- },
2303
- s
2304
- )),
2305
- o && /* @__PURE__ */ P.jsxs(
2306
- "div",
2307
- {
2308
- className: Z(
2309
- "flex items-center gap-3 px-2 py-2",
2310
- !e && "justify-center"
834
+ }
835
+ ),
836
+ ce && /* @__PURE__ */ n.jsxs("div", { className: "profile-popup", children: [
837
+ /* @__PURE__ */ n.jsx(
838
+ "button",
839
+ {
840
+ className: "popup-close",
841
+ onClick: () => z(!1),
842
+ "aria-label": "Close",
843
+ children: "✕"
844
+ }
2311
845
  ),
2312
- children: [
2313
- /* @__PURE__ */ P.jsx(
2314
- "div",
2315
- {
2316
- className: Z(
2317
- "w-8 h-8 rounded-full flex items-center justify-center text-white text-xs font-bold flex-shrink-0",
2318
- o.avatarColor ?? "bg-green-600"
2319
- ),
2320
- children: o.initials
2321
- }
2322
- ),
2323
- e && /* @__PURE__ */ P.jsxs("div", { className: "overflow-hidden", children: [
2324
- /* @__PURE__ */ P.jsx("div", { className: "text-white text-sm font-medium truncate", children: o.name }),
2325
- o.role && /* @__PURE__ */ P.jsx("div", { className: "text-gray-400 text-xs truncate", children: o.role })
846
+ /* @__PURE__ */ n.jsxs("div", { className: "popup-header", children: [
847
+ /* @__PURE__ */ n.jsx("div", { className: "popup-avatar", children: Z() }),
848
+ /* @__PURE__ */ n.jsxs("div", { className: "popup-user-details", children: [
849
+ /* @__PURE__ */ n.jsx("div", { className: "popup-name", children: U() }),
850
+ /* @__PURE__ */ n.jsx("div", { className: "popup-role", children: m.roleName }),
851
+ /* @__PURE__ */ n.jsx("div", { className: "popup-email", children: m.email })
2326
852
  ] })
2327
- ]
2328
- }
2329
- )
853
+ ] }),
854
+ /* @__PURE__ */ n.jsx("div", { className: "popup-divider" }),
855
+ /* @__PURE__ */ n.jsxs("button", { className: "signout-btn", onClick: fe, children: [
856
+ /* @__PURE__ */ n.jsx(_r, {}),
857
+ /* @__PURE__ */ n.jsx("span", { children: "Sign Out" })
858
+ ] })
859
+ ] })
860
+ ] })
2330
861
  ] })
2331
862
  ]
2332
863
  }
2333
864
  );
2334
- }
865
+ };
2335
866
  export {
2336
- Gn as Sidebar
867
+ Sr as SideNavbar,
868
+ Cr as SidebarProvider,
869
+ br as useSidebar
2337
870
  };