prometeo-design-system 4.0.0 → 4.1.1

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.
Files changed (47) hide show
  1. package/dist/{CardProfile-y9Knsg26.js → CardProfile-C1F83KJV.js} +1 -1
  2. package/dist/CardProfile.es.js +1 -1
  3. package/dist/{DatePicker-6eb-0Ns5.js → DatePicker-QuBgR5DQ.js} +799 -794
  4. package/dist/DatePicker.es.js +1 -1
  5. package/dist/DialogModal.es.js +25 -22
  6. package/dist/PlainTooltip.d.ts +6 -0
  7. package/dist/PlainTooltip.es.js +72 -0
  8. package/dist/PyrionLayout.es.js +791 -742
  9. package/dist/RecurrentDatePicker.es.js +1 -1
  10. package/dist/RecurrentDatePickerRRule.es.js +1 -1
  11. package/dist/Scrollable.es.js +1 -1
  12. package/dist/Select.es.js +524 -524
  13. package/dist/SelectSearch.es.js +44 -43
  14. package/dist/TabLinks.d.ts +2 -0
  15. package/dist/TabLinks.es.js +81 -52
  16. package/dist/{badge-B1IK_-i5.js → badge-CbqYNrl4.js} +28 -28
  17. package/dist/components/DatePicker/DatePicker.d.ts +1 -0
  18. package/dist/components/NavigationDrawer/NavigationDrawer.d.ts +2 -1
  19. package/dist/components/NavigationDrawer/NavigationDrawerActionItem.d.ts +4 -3
  20. package/dist/components/NavigationDrawer/NavigationDrawerActions.d.ts +3 -4
  21. package/dist/components/NavigationDrawer/NavigationDrawerItemBase.d.ts +1 -0
  22. package/dist/components/NavigationDrawer/NavigationDrawerLinkItem.d.ts +3 -2
  23. package/dist/components/NavigationDrawer/NavigationDrawerNavlinks.d.ts +2 -2
  24. package/dist/components/PlainTooltip/PlainTooltip.d.ts +11 -0
  25. package/dist/components/PyrionNavigationDrawer/PLContent.d.ts +4 -4
  26. package/dist/components/PyrionNavigationDrawer/PLFooter.d.ts +3 -2
  27. package/dist/components/PyrionNavigationDrawer/PLSidebarContent.d.ts +2 -2
  28. package/dist/components/PyrionNavigationDrawer/PLayoutBase.d.ts +7 -6
  29. package/dist/components/PyrionNavigationDrawer/PyrionLayout.d.ts +15 -12
  30. package/dist/components/PyrionNavigationDrawer/index.d.ts +2 -2
  31. package/dist/components/Select/Select.d.ts +1 -0
  32. package/dist/components/TabLinks/TabLinks.d.ts +10 -1
  33. package/dist/components/TabSwitch/TabSwitch.d.ts +2 -0
  34. package/dist/exports/PlainTooltip.d.ts +2 -0
  35. package/dist/exports/TabLinks.d.ts +1 -0
  36. package/dist/hooks/useDevice.d.ts +1 -0
  37. package/dist/index.d.ts +0 -1
  38. package/dist/prometeo-design-system.es.js +50 -52
  39. package/dist/styles.css +1 -1
  40. package/dist/useDevice-vwn4GLwK.js +16 -0
  41. package/dist/useDevice.es.js +2 -11
  42. package/package.json +6 -6
  43. package/src/styles/base.css +1 -0
  44. package/dist/SwipeContainer.d.ts +0 -4
  45. package/dist/SwipeContainer.es.js +0 -185
  46. package/dist/components/SwipeContainer/SwipeContainer.d.ts +0 -19
  47. package/dist/exports/SwipeContainer.d.ts +0 -1
@@ -1,215 +1,227 @@
1
1
  import { j as e } from "./jsx-runtime-GkKLlHH4.js";
2
- import { useIsMobile as Fe } from "./useDevice.es.js";
3
- import { g as de } from "./utils-X4-h3cum.js";
4
- import Te, { memo as L, forwardRef as he, useState as te, useEffect as V, useContext as Se, createContext as ke, useRef as O, useCallback as g, Children as ot, isValidElement as ue, useMemo as ne, useImperativeHandle as De } from "react";
5
- import { useNavigate as lt } from "react-router";
6
- import { B as it, T as ct } from "./badge-B1IK_-i5.js";
2
+ import { u as We, g as ft } from "./useDevice-vwn4GLwK.js";
3
+ import { g as xe } from "./utils-X4-h3cum.js";
4
+ import Ue, { memo as T, forwardRef as Ne, useState as Z, useEffect as X, useContext as $e, createContext as Oe, useRef as I, useCallback as x, Children as mt, isValidElement as ge, useMemo as ue, useImperativeHandle as Le, use as pt } from "react";
5
+ import { createPortal as ze } from "react-dom";
6
+ import { useLocation as ht, useNavigate as bt } from "react-router";
7
+ import { B as xt, T as gt } from "./badge-CbqYNrl4.js";
7
8
  import { c as A } from "./cn-B6yFEsav.js";
8
- import { CloseNavBarDesktop as dt } from "./Icons/CloseNavBarDesktop.es.js";
9
- import { c as Ae } from "./index-BOQuZ0gG.js";
10
- import { CrevronLeft as ut } from "./Icons/CrevronLeft.es.js";
11
- import { Scrollable as be } from "./Scrollable.es.js";
12
- import $ from "./TicketCard.es.js";
13
- import ft from "./Avatar.es.js";
9
+ import { CloseNavBarDesktop as vt } from "./Icons/CloseNavBarDesktop.es.js";
10
+ import { c as Te } from "./index-BOQuZ0gG.js";
11
+ import wt from "./PlainTooltip.es.js";
12
+ import { CrevronLeft as Nt } from "./Icons/CrevronLeft.es.js";
13
+ import { Scrollable as ye } from "./Scrollable.es.js";
14
+ import ee from "./TicketCard.es.js";
15
+ import yt from "./Avatar.es.js";
14
16
  import fe from "./Button.es.js";
15
- import { Logout as mt } from "./Icons/Logout.es.js";
16
- import pt from "./NotificationCard.es.js";
17
- import { Notifications as Me } from "./Icons/Notifications.es.js";
18
- import { Close as Be } from "./Icons/Close.es.js";
19
- import { Help as Ue } from "./Icons/Help.es.js";
20
- import { createPortal as Ee } from "react-dom";
21
- import { Settings as ht } from "./Icons/Settings.es.js";
22
- const ze = L(he(({ children: t, className: r, context: s, modal: l = !1, closeOnOverlayClick: d = !1, unmountChildrenOnClose: o = !0 }, i) => {
23
- const p = ae(t, s), c = typeof window < "u" && window.matchMedia("(min-width: 768px)").matches, { isSidebarOpen: x } = bt(), { closeSidebar: b } = re(), [C, u] = te(() => o ? x : !0), [h, N] = te(!1);
24
- return V(() => {
25
- o && s?.subscribeToSidebarOpen((m) => {
26
- m ? (N(!1), u(!0)) : N(!0);
17
+ import { Logout as Ct } from "./Icons/Logout.es.js";
18
+ import jt from "./NotificationCard.es.js";
19
+ import { Notifications as qe } from "./Icons/Notifications.es.js";
20
+ import { Close as Ie } from "./Icons/Close.es.js";
21
+ import { Help as Ke } from "./Icons/Help.es.js";
22
+ import { Settings as St } from "./Icons/Settings.es.js";
23
+ const Ye = T(Ne(({ children: t, className: r, context: s, modal: l = !1, closeOnOverlayClick: i = !1, unmountChildrenOnClose: n = !0 }, c) => {
24
+ const m = me(t, s), d = typeof window < "u" && window.matchMedia("(min-width: 768px)").matches, { isSidebarOpen: h } = kt(), { closeSidebar: b } = ie(), [w, u] = Z(() => n ? h : !0), [N, y] = Z(!1);
25
+ return X(() => {
26
+ n && s?.subscribeToSidebarOpen((f) => {
27
+ f ? (y(!1), u(!0)) : y(!0);
27
28
  });
28
- }, [o, s]), V(() => {
29
- const m = i && typeof i == "object" && "current" in i ? i.current : null;
30
- if (!m) return;
31
- const P = () => {
32
- h && (u(!1), N(!1));
29
+ }, [n, s]), X(() => {
30
+ const f = c && typeof c == "object" && "current" in c ? c.current : null;
31
+ if (!f) return;
32
+ const F = () => {
33
+ N && (u(!1), y(!1));
33
34
  };
34
- return m.addEventListener("transitionend", P), () => m.removeEventListener("transitionend", P);
35
- }, [h]), /* @__PURE__ */ e.jsxs("div", { ref: i, className: A("sidebar", c ? "collapsed" : "expanded", "h-full overflow-auto", r), "aria-modal": l || void 0, children: [
36
- l && c && /* @__PURE__ */ e.jsx(
35
+ return f.addEventListener("transitionend", F), () => f.removeEventListener("transitionend", F);
36
+ }, [N]), /* @__PURE__ */ e.jsxs("div", { ref: c, className: A("sidebar", d ? "collapsed" : "expanded", "h-full overflow-auto", r), "aria-modal": l || void 0, children: [
37
+ l && d && /* @__PURE__ */ e.jsx(
37
38
  "div",
38
39
  {
39
40
  className: A("navigation-drawer-sidebar-overlay"),
40
- onClick: (m) => {
41
- m.preventDefault(), m.stopPropagation(), d && b?.();
41
+ onClick: (f) => {
42
+ f.preventDefault(), f.stopPropagation(), i && b?.();
42
43
  },
43
44
  "aria-hidden": "true"
44
45
  }
45
46
  ),
46
47
  /* @__PURE__ */ e.jsxs("div", { className: A("navigation-drawer-sidebar-inner"), children: [
47
48
  /* @__PURE__ */ e.jsx("div", { className: "secure-click-margin" }),
48
- C && p
49
+ w && m
49
50
  ] })
50
51
  ] });
51
- })), Ve = ke(null), He = ke(null), bt = () => {
52
- const t = Se(Ve);
52
+ })), Xe = Oe(null), Je = Oe(null), kt = () => {
53
+ const t = $e(Xe);
53
54
  if (!t) throw new Error("useDrawerState must be used within NavigationDrawer");
54
55
  return t;
55
- }, re = () => {
56
- const t = Se(He);
56
+ }, ie = () => {
57
+ const t = $e(Je);
57
58
  if (!t) throw new Error("useDrawerActions must be used within NavigationDrawer");
58
59
  return t;
59
- }, ae = (t, r) => typeof t == "function" ? r ? t(r) : null : t, We = "navigation-drawer-collapsed", Pe = () => {
60
+ }, me = (t, r) => typeof t == "function" ? r ? t(r) : null : t, Ge = "navigation-drawer-collapsed", He = () => {
60
61
  if (typeof window > "u") return !1;
61
62
  try {
62
- const t = sessionStorage.getItem(We);
63
+ const t = sessionStorage.getItem(Ge);
63
64
  return t ? JSON.parse(t) : !1;
64
65
  } catch {
65
66
  return !1;
66
67
  }
67
- }, xt = (t) => {
68
+ }, Dt = (t) => {
68
69
  if (!(typeof window > "u"))
69
70
  try {
70
- sessionStorage.setItem(We, JSON.stringify(t));
71
+ sessionStorage.setItem(Ge, JSON.stringify(t));
71
72
  } catch {
72
73
  }
73
- }, gt = (t) => {
74
- const { children: r, classNameDrawer: s, classNameSidebar: l, disableDragOpen: d } = t, o = O(null), i = O(null), p = O(null), c = O(null), x = O(Pe()), b = O(!1), C = O("drawer"), u = O(/* @__PURE__ */ new Set()), h = O(/* @__PURE__ */ new Set()), N = O(!1), m = O(null), P = g((n) => {
75
- const f = i.current;
76
- f && (f.classList.toggle("collapsed", n), f.classList.toggle("expanded", !n));
77
- }, []), k = g((n) => {
78
- const f = c.current;
79
- if (!f) return;
80
- f.classList.toggle("collapsed", n), f.classList.toggle("expanded", !n);
81
- const w = o.current;
82
- w && (w.classList.toggle("sidebar-collapsed", n), w.classList.toggle("sidebar-expanded", !n));
83
- }, []), j = g(
84
- (n, { notify: f = !0 } = {}) => {
85
- const w = x.current !== n;
86
- x.current = n, xt(n), P(n), f && w && u.current.forEach((D) => D(n));
74
+ }, At = (t) => {
75
+ const { children: r, classNameDrawer: s, classNameSidebar: l, disableDragOpen: i } = t, n = I(null), c = I(null), m = t.outletRef ?? I(null), d = I(null), h = I(He()), b = I(!1), w = I("drawer"), u = I(/* @__PURE__ */ new Set()), N = I(/* @__PURE__ */ new Set()), y = I(!1), f = I(null), F = x((o) => {
76
+ const p = c.current;
77
+ p && (p.classList.toggle("collapsed", o), p.classList.toggle("expanded", !o));
78
+ }, []), D = x((o) => {
79
+ const p = d.current;
80
+ if (!p) return;
81
+ p.classList.toggle("collapsed", o), p.classList.toggle("expanded", !o);
82
+ const g = n.current;
83
+ g && (g.classList.toggle("sidebar-collapsed", o), g.classList.toggle("sidebar-expanded", !o));
84
+ }, []), P = x(
85
+ (o, { notify: p = !0 } = {}) => {
86
+ const g = h.current !== o;
87
+ h.current = o, Dt(o), F(o), p && g && u.current.forEach((O) => O(o));
87
88
  },
88
- [P]
89
- ), R = g(
90
- (n, { notify: f = !0 } = {}) => {
91
- const w = b.current !== n;
92
- if (b.current = n, k(n), f && w) {
93
- const D = !n;
94
- h.current.forEach((E) => E(D));
89
+ [F]
90
+ ), R = x(
91
+ (o, { notify: p = !0 } = {}) => {
92
+ const g = b.current !== o;
93
+ if (b.current = o, D(o), p && g) {
94
+ const O = !o;
95
+ N.current.forEach((B) => B(O));
95
96
  }
96
97
  },
97
- [k]
98
- ), T = g(
99
- (n, { notify: f = !0 } = {}) => {
100
- const w = C.current, D = w !== n;
101
- C.current = n, window.matchMedia("(min-width: 768px)").matches || j(n !== "drawer", { notify: f });
102
- const E = w === "sidebar", a = n === "sidebar";
103
- f && D && E !== a && h.current.forEach((v) => v(a)), R(n !== "sidebar", { notify: f }), j(n !== "drawer", { notify: f });
98
+ [D]
99
+ ), k = x(
100
+ (o, { notify: p = !0 } = {}) => {
101
+ const g = w.current, O = g !== o;
102
+ w.current = o, window.matchMedia("(min-width: 768px)").matches || P(o !== "drawer", { notify: p });
103
+ const B = g === "sidebar", _ = o === "sidebar";
104
+ p && O && B !== _ && N.current.forEach((Q) => Q(_)), R(o !== "sidebar", { notify: p }), P(o !== "drawer", { notify: p });
104
105
  },
105
- [j, R]
106
- ), F = g((n) => {
107
- const f = o.current;
108
- if (!f || window.matchMedia("(min-width: 768px)").matches) return;
109
- N.current = !0;
110
- const w = p.current?.offsetLeft ?? 0, D = c.current?.offsetLeft ?? w, E = n === "drawer" ? 0 : n === "sidebar" ? D : w;
111
- m.current = E, f.scrollTo({ left: E, behavior: "smooth" });
112
- const a = () => {
113
- N.current = !1, m.current = null, f.removeEventListener("scrollend", a);
106
+ [P, R]
107
+ ), j = x((o) => {
108
+ const p = n.current;
109
+ if (!p || window.matchMedia("(min-width: 768px)").matches) return;
110
+ y.current = !0;
111
+ const g = m.current?.offsetLeft ?? 0, O = d.current?.offsetLeft ?? g, B = o === "drawer" ? 0 : o === "sidebar" ? O : g;
112
+ f.current = B, p.scrollTo({ left: B, behavior: "smooth" });
113
+ const _ = () => {
114
+ y.current = !1, f.current = null, p.removeEventListener("scrollend", _);
114
115
  };
115
- f.addEventListener("scrollend", a, { once: !0 }), setTimeout(() => {
116
- N.current && a();
116
+ p.addEventListener("scrollend", _, { once: !0 }), setTimeout(() => {
117
+ y.current && _();
117
118
  }, 1e3);
118
- }, []), H = g(() => {
119
- const n = o.current, f = p.current;
120
- if (!n || !f || window.matchMedia("(min-width: 768px)").matches) return;
121
- const w = [
119
+ }, []), K = x(() => {
120
+ const o = n.current, p = m.current;
121
+ if (!o || !p || window.matchMedia("(min-width: 768px)").matches) return;
122
+ const g = [
122
123
  { panel: "drawer", offset: 0 },
123
- { panel: "outlet", offset: f.offsetLeft }
124
- ], D = c.current;
125
- D && w.push({ panel: "sidebar", offset: D.offsetLeft });
126
- const E = n.scrollLeft;
127
- let a = w[0], v = Math.abs(E - a.offset);
128
- for (let S = 1; S < w.length; S++) {
129
- const y = Math.abs(E - w[S].offset);
130
- y < v && (a = w[S], v = y);
124
+ { panel: "outlet", offset: p.offsetLeft }
125
+ ], O = d.current;
126
+ O && g.push({ panel: "sidebar", offset: O.offsetLeft });
127
+ const B = o.scrollLeft;
128
+ let _ = g[0], Q = Math.abs(B - _.offset);
129
+ for (let $ = 1; $ < g.length; $++) {
130
+ const le = Math.abs(B - g[$].offset);
131
+ le < Q && (_ = g[$], Q = le);
131
132
  }
132
- T(a.panel);
133
- }, [T]);
134
- V(() => {
135
- const n = o.current;
136
- n && (d?.drawer && n.classList.add("disabled-dragopen"), d?.sidebar && n.classList.add("disabled-dragopen-sidebar"));
137
- }, [d]), V(() => {
138
- const n = o.current, f = p.current;
139
- if (!n || !f) return;
133
+ k(_.panel);
134
+ }, [k]);
135
+ X(() => {
136
+ const o = n.current;
137
+ o && (i?.drawer && o.classList.add("disabled-dragopen"), i?.sidebar && o.classList.add("disabled-dragopen-sidebar"));
138
+ }, [i, n]), X(() => {
139
+ const o = n.current, p = m.current;
140
+ if (!o || !p) return;
140
141
  if (window.matchMedia("(min-width: 768px)").matches) {
141
- const D = Pe();
142
- j(D, { notify: !1 }), R(!0, { notify: !1 });
142
+ const O = He();
143
+ P(O, { notify: !1 }), R(!0, { notify: !1 });
143
144
  return;
144
145
  }
145
146
  requestAnimationFrame(() => {
146
- n.scrollLeft = f.offsetLeft, T("outlet");
147
+ o.scrollLeft = p.offsetLeft, k("outlet");
147
148
  });
148
- }, [T, j, R]), V(() => {
149
- const n = o.current;
150
- if (!n) return;
151
- const f = p.current;
152
- if (!f) return;
153
- const w = f.offsetLeft;
154
- let D = w, E = !1;
155
- const a = () => {
156
- if (window.matchMedia("(min-width: 768px)").matches) return;
157
- if (N.current) {
158
- if (D = n.scrollLeft, E) return;
159
- E = !0, requestAnimationFrame(() => {
160
- H(), E = !1;
161
- });
162
- return;
149
+ }, [k, P, R]), X(() => {
150
+ const o = n.current;
151
+ if (!o || !m.current) return;
152
+ let g = !1, O = 0, B = 0;
153
+ const _ = (S) => {
154
+ O = S.touches[0].clientX, B = S.touches[0].clientY;
155
+ }, Q = (S, U) => {
156
+ const a = window.getComputedStyle(S), v = U === "x" ? a.overflowX : a.overflowY;
157
+ return /(auto|scroll|overlay)/.test(v) ? U === "x" ? S.scrollWidth > S.clientWidth : S.scrollHeight > S.clientHeight : !1;
158
+ }, $ = (S, U) => {
159
+ let a = S;
160
+ for (; a && a !== o; ) {
161
+ if (Q(a, U))
162
+ return a;
163
+ a = a.parentElement;
163
164
  }
164
- const v = n.classList.contains("disabled-dragopen"), S = n.classList.contains("disabled-dragopen-sidebar");
165
- if (v || S) {
166
- const y = n.scrollLeft, z = y - D;
167
- if (z !== 0) {
168
- const ce = i.current?.offsetLeft ?? 0, at = c.current?.offsetLeft ?? w;
169
- if (v) {
170
- const ve = z < 0 && y < w, Ne = y >= ce && y < w;
171
- if (ve || Ne) {
172
- n.scrollLeft = D;
173
- return;
174
- }
165
+ return null;
166
+ }, le = (S, U, a) => a === 0 ? !1 : U === "x" ? a < 0 ? S.scrollLeft + S.clientWidth < S.scrollWidth : S.scrollLeft > 0 : a < 0 ? S.scrollTop + S.clientHeight < S.scrollHeight : S.scrollTop > 0, he = (S) => {
167
+ if (!(S.target instanceof HTMLElement)) return;
168
+ const U = S.touches[0].clientX - O, a = S.touches[0].clientY - B, v = Math.abs(U) > Math.abs(a) ? "x" : "y", L = v === "x" ? U : a, C = $(S.target, v);
169
+ if (C && le(C, v, L))
170
+ return;
171
+ const z = o.classList.contains("disabled-dragopen"), de = o.classList.contains("disabled-dragopen-sidebar"), Fe = () => S.cancelable ? (S.preventDefault(), !0) : !1;
172
+ if (v === "x") {
173
+ if (U > 0) {
174
+ if (w.current === "sidebar" && !de) {
175
+ g = !0;
176
+ return;
175
177
  }
176
- if (S) {
177
- const ve = z > 0 && y > w, Ne = y > w && y <= at;
178
- if (ve || Ne) {
179
- n.scrollLeft = D;
180
- return;
181
- }
178
+ if (z) {
179
+ Fe();
180
+ return;
181
+ }
182
+ } else if (U < 0) {
183
+ if (w.current === "drawer" && !z) {
184
+ g = !0;
185
+ return;
186
+ }
187
+ if (de) {
188
+ Fe();
189
+ return;
182
190
  }
183
191
  }
192
+ g = !0;
184
193
  }
185
- D = n.scrollLeft, !E && (E = !0, requestAnimationFrame(() => {
186
- H(), E = !1;
187
- }));
194
+ }, be = () => {
195
+ setTimeout(() => {
196
+ g && (K(), g = !1);
197
+ }, 100);
198
+ };
199
+ return o.addEventListener("touchstart", _, { passive: !0 }), o.addEventListener("touchmove", he, { passive: !1 }), o.addEventListener("touchend", be), () => {
200
+ o.removeEventListener("touchstart", _), o.removeEventListener("touchmove", he), o.removeEventListener("touchend", be);
188
201
  };
189
- return n.addEventListener("scroll", a), () => n.removeEventListener("scroll", a);
190
- }, [H]);
191
- const M = g(() => {
192
- const n = window.matchMedia("(min-width: 768px)").matches, f = !x.current;
193
- if (n) {
194
- j(f);
202
+ }, [K]);
203
+ const Y = x(() => {
204
+ const o = window.matchMedia("(min-width: 768px)").matches, p = !h.current;
205
+ if (o) {
206
+ P(p);
195
207
  return;
196
208
  }
197
- const w = f ? "outlet" : "drawer";
198
- T(w), F(w);
199
- }, [F, T, j]), W = O(null);
200
- W.current || (W.current = {
201
- toggleCollapse: () => M(),
202
- getIsCollapsed: () => x.current,
203
- subscribeToCollapse: (n) => (u.current.add(n), () => {
204
- u.current.delete(n);
209
+ const g = p ? "outlet" : "drawer";
210
+ k(g), j(g);
211
+ }, [j, k, P]), J = I(null);
212
+ J.current || (J.current = {
213
+ toggleCollapse: () => Y(),
214
+ getIsCollapsed: () => h.current,
215
+ subscribeToCollapse: (o) => (u.current.add(o), () => {
216
+ u.current.delete(o);
205
217
  }),
206
218
  openSidebar: () => {
207
- if (c.current) {
219
+ if (d.current) {
208
220
  if (window.matchMedia("(min-width: 768px)").matches) {
209
221
  R(!1);
210
222
  return;
211
223
  }
212
- T("sidebar"), F("sidebar");
224
+ k("sidebar"), j("sidebar");
213
225
  }
214
226
  },
215
227
  closeSidebar: () => {
@@ -217,160 +229,161 @@ const ze = L(he(({ children: t, className: r, context: s, modal: l = !1, closeOn
217
229
  R(!0);
218
230
  return;
219
231
  }
220
- T("outlet"), F("outlet");
232
+ k("outlet"), j("outlet");
221
233
  },
222
234
  toggleSidebar: () => {
223
- if (!c.current) return;
235
+ if (!d.current) return;
224
236
  if (window.matchMedia("(min-width: 768px)").matches) {
225
237
  R(!b.current);
226
238
  return;
227
239
  }
228
- const n = C.current === "sidebar" ? "outlet" : "sidebar";
229
- T(n), F(n);
240
+ const o = w.current === "sidebar" ? "outlet" : "sidebar";
241
+ k(o), j(o);
230
242
  },
231
- getIsSidebarOpen: () => c.current ? window.matchMedia("(min-width: 768px)").matches ? !b.current : C.current === "sidebar" : !1,
232
- subscribeToSidebarOpen: (n) => (h.current.add(n), () => {
233
- h.current.delete(n);
243
+ getIsSidebarOpen: () => d.current ? window.matchMedia("(min-width: 768px)").matches ? !b.current : w.current === "sidebar" : !1,
244
+ subscribeToSidebarOpen: (o) => (N.current.add(o), () => {
245
+ N.current.delete(o);
234
246
  }),
235
- setDrawerDragEnabled: (n) => {
236
- const f = o.current;
237
- if (f)
238
- if (n) {
239
- const w = f.scrollLeft, D = f.style.scrollBehavior;
240
- f.style.scrollBehavior = "auto", f.classList.remove("disabled-dragopen"), requestAnimationFrame(() => {
241
- f.scrollLeft = w, requestAnimationFrame(() => {
242
- f.style.scrollBehavior = D;
243
- });
247
+ setDrawerDragEnabled: (o) => {
248
+ const p = n.current;
249
+ if (!p) return;
250
+ const g = p.scrollLeft;
251
+ if (o) {
252
+ const O = p.style.scrollBehavior;
253
+ p.style.scrollBehavior = "auto", p.classList.remove("disabled-dragopen"), requestAnimationFrame(() => {
254
+ p.scrollLeft = g, requestAnimationFrame(() => {
255
+ p.style.scrollBehavior = O;
244
256
  });
245
- } else
246
- f.classList.add("disabled-dragopen");
257
+ });
258
+ } else
259
+ p.classList.add("disabled-dragopen");
247
260
  },
248
- setSidebarDragEnabled: (n) => {
249
- const f = o.current;
250
- if (f)
251
- if (n) {
252
- const w = f.scrollLeft, D = f.style.scrollBehavior;
253
- f.style.scrollBehavior = "auto", f.classList.remove("disabled-dragopen-sidebar"), requestAnimationFrame(() => {
254
- f.scrollLeft = w, requestAnimationFrame(() => {
255
- f.style.scrollBehavior = D;
261
+ setSidebarDragEnabled: (o) => {
262
+ const p = n.current;
263
+ if (p)
264
+ if (o) {
265
+ const g = p.scrollLeft, O = p.style.scrollBehavior;
266
+ p.style.scrollBehavior = "auto", p.classList.remove("disabled-dragopen-sidebar"), requestAnimationFrame(() => {
267
+ p.scrollLeft = g, requestAnimationFrame(() => {
268
+ p.style.scrollBehavior = O;
256
269
  });
257
270
  });
258
271
  } else
259
- f.classList.add("disabled-dragopen-sidebar");
272
+ p.classList.add("disabled-dragopen-sidebar");
260
273
  }
261
274
  });
262
- const Q = W.current, _ = typeof r == "function" ? r(Q) : r, I = ot.toArray(_);
263
- let q = null, J = null, K = null;
264
- const G = [];
265
- let X = null, Z = null;
266
- I.forEach((n) => {
267
- if (!ue(n)) {
268
- G.push(n);
275
+ const te = J.current, H = typeof r == "function" ? r(te) : r, M = mt.toArray(H);
276
+ let E = null, V = null, W = null;
277
+ const re = [];
278
+ let ne = null, se = null;
279
+ M.forEach((o) => {
280
+ if (!ge(o)) {
281
+ re.push(o);
269
282
  return;
270
283
  }
271
- if (n.type === Le && !q) {
272
- q = n;
284
+ if (o.type === Ee && !E) {
285
+ E = o;
273
286
  return;
274
287
  }
275
- if (n.type === me && !J) {
276
- J = n;
288
+ if (o.type === ve && !V) {
289
+ V = o;
277
290
  return;
278
291
  }
279
- if (n.type === pe && !K) {
280
- K = n;
292
+ if (o.type === we && !W) {
293
+ W = o;
281
294
  return;
282
295
  }
283
- if (n.type === ye && !X) {
284
- X = n;
296
+ if (o.type === ke && !ne) {
297
+ ne = o;
285
298
  return;
286
299
  }
287
- if (n.type === ze && !Z) {
288
- Z = n;
300
+ if (o.type === Ye && !se) {
301
+ se = o;
289
302
  return;
290
303
  }
291
- G.push(n);
304
+ re.push(o);
292
305
  });
293
- const xe = !!J, oe = J ?? (G.length ? /* @__PURE__ */ e.jsx(me, { children: G }) : null), ee = xe ? G : [], Y = X ?? (!!X ? /* @__PURE__ */ e.jsx(ye, { children: _ }) : null), le = K ?? (!!K ? /* @__PURE__ */ e.jsx(pe, { children: K }) : null), ie = !!Z, B = Z, we = ne(() => ({
294
- isCollapsed: x.current,
306
+ const ce = !!V, Re = V ?? (re.length ? /* @__PURE__ */ e.jsx(ve, { children: re }) : null), pe = ce ? re : [], ae = ne ?? (!!ne ? /* @__PURE__ */ e.jsx(ke, { children: H }) : null), Ce = W ?? (!!W ? /* @__PURE__ */ e.jsx(we, { children: W }) : null), je = !!se, G = se, oe = ue(() => ({
307
+ isCollapsed: h.current,
295
308
  isSidebarOpen: !b.current
296
- }), [x.current, b.current]);
297
- return /* @__PURE__ */ e.jsx(Ve.Provider, { value: we, children: /* @__PURE__ */ e.jsx(He.Provider, { value: Q, children: /* @__PURE__ */ e.jsxs("div", { ref: o, className: A(
298
- "w-full h-full overflow-y-hidden",
299
- ie ? "navigation-drawer-with-sidebar" : "navigation-drawer",
300
- d?.drawer ? "disabled-dragopen" : "",
301
- d?.sidebar ? "disabled-dragopen-sidebar" : ""
309
+ }), [h.current, b.current]);
310
+ return /* @__PURE__ */ e.jsx(Xe.Provider, { value: oe, children: /* @__PURE__ */ e.jsx(Je.Provider, { value: te, children: /* @__PURE__ */ e.jsxs("div", { id: "navigation-drawer-container", ref: n, className: A(
311
+ "w-full h-full max-h-dvh overflow-y-hidden",
312
+ je ? "navigation-drawer-with-sidebar" : "navigation-drawer",
313
+ i?.drawer ? "disabled-dragopen" : "",
314
+ i?.sidebar ? "disabled-dragopen-sidebar" : ""
302
315
  ), children: [
303
316
  /* @__PURE__ */ e.jsxs(
304
317
  "div",
305
318
  {
306
- ref: i,
319
+ ref: c,
307
320
  className: A(
308
321
  "bg-neutral-default-default border-r border-neutral-strong-default h-dvh md:h-screen p-4 overflow-hidden drawer flex flex-col gap-4",
309
- x.current ? "collapsed" : "expanded w-min",
322
+ h.current ? "collapsed" : "expanded w-min",
310
323
  s
311
324
  ),
312
325
  children: [
313
326
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col flex-1 gap-4 overflow-hidden", children: [
314
327
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
315
- /* @__PURE__ */ e.jsx(qe, { onToggleCollapse: M }),
316
- q
328
+ /* @__PURE__ */ e.jsx(Qe, { onToggleCollapse: Y }),
329
+ E
317
330
  ] }),
318
331
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 overflow-hidden relative flex-col", children: [
319
- ee,
320
- oe
332
+ pe,
333
+ Re
321
334
  ] })
322
335
  ] }),
323
- le
336
+ Ce
324
337
  ]
325
338
  }
326
339
  ),
327
- Y && ue(Y) ? Te.cloneElement(Y, { ref: p }) : Y,
328
- B && ue(B) ? Te.cloneElement(B, {
329
- ref: c,
330
- className: A("sidebar", B.props?.className, l)
331
- }) : B
340
+ ae && ge(ae) ? Ue.cloneElement(ae, { ref: m }) : ae,
341
+ G && ge(G) ? Ue.cloneElement(G, {
342
+ ref: d,
343
+ className: A("sidebar", G.props?.className, l)
344
+ }) : G
332
345
  ] }) }) });
333
- }, _e = L(gt), qe = L(({ onToggleCollapse: t }) => /* @__PURE__ */ e.jsx(
346
+ }, Ve = T(At), Qe = T(({ onToggleCollapse: t }) => /* @__PURE__ */ e.jsx(
334
347
  "button",
335
348
  {
336
349
  type: "button",
337
350
  onClick: t,
338
351
  className: "collapse-button cursor-pointer text-neutral-default-default hover:text-primary-default transition-colors duration-300 w-max",
339
- children: /* @__PURE__ */ e.jsx(dt, { size: 32, className: "transition-transform duration-300 p-1" })
352
+ children: /* @__PURE__ */ e.jsx(vt, { size: 32, className: "transition-transform duration-300 p-1" })
340
353
  }
341
354
  ), (t, r) => t.onToggleCollapse === r.onToggleCollapse);
342
- qe.displayName = "NavigationDrawerCollapseButton";
343
- const Le = L(({ children: t, className: r, context: s }) => {
344
- const l = ae(t, s);
355
+ Qe.displayName = "NavigationDrawerCollapseButton";
356
+ const Ee = T(({ children: t, className: r, context: s }) => {
357
+ const l = me(t, s);
345
358
  return /* @__PURE__ */ e.jsx("div", { className: A("flex items-center justify-between", r), children: l });
346
359
  });
347
- Le.displayName = "NavigationDrawerHeader";
348
- const me = L(({ children: t, className: r, context: s, ...l }) => {
349
- const d = ae(t, s);
350
- return /* @__PURE__ */ e.jsx("div", { ...l, className: A("w-full flex-1 drawer-content", r), children: d });
360
+ Ee.displayName = "NavigationDrawerHeader";
361
+ const ve = T(({ children: t, className: r, context: s, ...l }) => {
362
+ const i = me(t, s);
363
+ return /* @__PURE__ */ e.jsx("div", { ...l, className: A("w-full flex-1 drawer-content", r), children: i });
351
364
  });
352
- me.displayName = "NavigationDrawerContent";
353
- const pe = L(({ children: t, className: r, context: s }) => {
354
- const l = ae(t, s);
365
+ ve.displayName = "NavigationDrawerContent";
366
+ const we = T(({ children: t, className: r, context: s }) => {
367
+ const l = me(t, s);
355
368
  return /* @__PURE__ */ e.jsx("div", { className: A("flex items-center justify-between", r), children: l });
356
369
  });
357
- pe.displayName = "NavigationDrawerFooter";
358
- const $e = L(({ className: t }) => /* @__PURE__ */ e.jsx("div", { className: A("w-full border-t border-neutral-strong-default ", t) }));
359
- $e.displayName = "NavigationDrawerSpacer";
360
- const ye = L(he(({ children: t, className: r, context: s }, l) => {
361
- const d = ae(t, s);
362
- return /* @__PURE__ */ e.jsx("div", { ref: l, className: A("flex-1 overflow-auto ", r), children: d });
363
- }), (t, r) => t.children === r.children && t.className === r.className), U = Object.assign(_e, {
364
- Root: _e,
365
- Header: Le,
366
- Content: me,
367
- Footer: pe,
368
- Spacer: $e,
369
- Outlet: ye,
370
- Sidebar: ze
370
+ we.displayName = "NavigationDrawerFooter";
371
+ const Ze = T(({ className: t }) => /* @__PURE__ */ e.jsx("div", { className: A("w-full border-t border-neutral-strong-default ", t) }));
372
+ Ze.displayName = "NavigationDrawerSpacer";
373
+ const ke = T(Ne(({ children: t, className: r, context: s }, l) => {
374
+ const i = me(t, s);
375
+ return /* @__PURE__ */ e.jsx("div", { id: "navigation-drawer-outlet", ref: l, className: A("flex-1 overflow-auto ", r), children: i });
376
+ }), (t, r) => t.children === r.children && t.className === r.className), q = Object.assign(Ve, {
377
+ Root: Ve,
378
+ Header: Ee,
379
+ Content: ve,
380
+ Footer: we,
381
+ Spacer: Ze,
382
+ Outlet: ke,
383
+ Sidebar: Ye
371
384
  });
372
- U.displayName = "NavigationDrawer";
373
- const wt = "hover:bg-neutral-medium-hover", vt = Ae("", {
385
+ q.displayName = "NavigationDrawer";
386
+ const Ot = "hover:bg-neutral-medium-hover", Lt = Te("", {
374
387
  variants: {
375
388
  isSelected: {
376
389
  true: "bg-neutral-medium-selected ",
@@ -381,7 +394,7 @@ const wt = "hover:bg-neutral-medium-hover", vt = Ae("", {
381
394
  false: "cursor-pointer"
382
395
  }
383
396
  }
384
- }), Nt = Ae(
397
+ }), Tt = Te(
385
398
  A(
386
399
  "select-none line-clamp-1 min-w-max",
387
400
  "prometeo-fonts-label-large transition-colors duration-300 ease-out"
@@ -398,13 +411,13 @@ const wt = "hover:bg-neutral-medium-hover", vt = Ae("", {
398
411
  }
399
412
  },
400
413
  compoundVariants: [
401
- { isSelected: !0, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
402
- { isSelected: !1, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
403
- { isSelected: !0, disabled: !1, className: " text-primary-default-default group-active:text-neutral-default-pressed group-focus:text-neutral-default-pressed" },
404
- { isSelected: !1, disabled: !1, className: " text-neutral-default-default group-active:text-neutral-default-pressed group-focus:text-neutral-default-pressed" }
414
+ { isSelected: !0, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus-visible:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
415
+ { isSelected: !1, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus-visible:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
416
+ { isSelected: !0, disabled: !1, className: " text-primary-default-default group-active:text-neutral-default-pressed group-focus-visible:text-neutral-default-pressed" },
417
+ { isSelected: !1, disabled: !1, className: " text-neutral-default-default group-active:text-neutral-default-pressed group-focus-visible:text-neutral-default-pressed" }
405
418
  ]
406
419
  }
407
- ), Re = Ae(
420
+ ), Se = Te(
408
421
  A(
409
422
  "transition-colors duration-300 ease-out min-w-max"
410
423
  ),
@@ -420,290 +433,293 @@ const wt = "hover:bg-neutral-medium-hover", vt = Ae("", {
420
433
  }
421
434
  },
422
435
  compoundVariants: [
423
- { isSelected: !0, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
424
- { isSelected: !1, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
425
- { isSelected: !0, disabled: !1, className: "text-primary-default-default group-active:text-neutral-default-pressed group-focus:text-neutral-default-pressed" },
426
- { isSelected: !1, disabled: !1, className: "text-neutral-default-default group-active:text-neutral-default-pressed group-focus:text-neutral-default-pressed" }
436
+ { isSelected: !0, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus-visible:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
437
+ { isSelected: !1, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus-visible:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
438
+ { isSelected: !0, disabled: !1, className: "text-primary-default-default group-active:text-neutral-default-pressed group-focus-visible:text-neutral-default-pressed" },
439
+ { isSelected: !1, disabled: !1, className: "text-neutral-default-default group-active:text-neutral-default-pressed group-focus-visible:text-neutral-default-pressed" }
427
440
  ]
428
441
  }
429
- ), yt = (t) => {
442
+ ), It = (t) => {
430
443
  const {
431
444
  title: r,
432
445
  icon: s,
433
446
  count: l,
434
- className: d,
435
- isSelected: o = !1,
436
- hasSublinks: i,
437
- subLinksCollapsed: p,
438
- onToggleSublinks: c,
439
- as: x = "div",
447
+ className: i,
448
+ isSelected: n = !1,
449
+ hasSublinks: c,
450
+ subLinksCollapsed: m,
451
+ onToggleSublinks: d,
452
+ as: h = "div",
440
453
  onClick: b,
441
- onAuxClick: C,
442
- disabled: u = !1
443
- } = t, h = (k) => {
444
- u || b?.(k);
445
- }, N = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
454
+ onAuxClick: w,
455
+ disabled: u = !1,
456
+ tooltipText: N
457
+ } = t, y = (P) => {
458
+ u || b?.(P);
459
+ }, f = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
446
460
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center flex-nowrap", children: [
447
- s && /* @__PURE__ */ e.jsx(s, { size: 24, className: Re({ disabled: u, isSelected: o }) }),
448
- /* @__PURE__ */ e.jsx("label", { className: Nt({ disabled: u, isSelected: o }), children: r })
461
+ s && (N ? /* @__PURE__ */ e.jsx(wt, { title: N, disabled: u, children: /* @__PURE__ */ e.jsx(s, { size: 24, className: Se({ disabled: u, isSelected: n }) }) }) : /* @__PURE__ */ e.jsx(s, { size: 24, className: Se({ disabled: u, isSelected: n }) })),
462
+ /* @__PURE__ */ e.jsx("label", { className: Tt({ disabled: u, isSelected: n }), children: r })
449
463
  ] }),
450
464
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 items-center", children: [
451
- l && l ? /* @__PURE__ */ e.jsx(it, { count: l, maxCount: 9, className: "badge", disabled: u }) : "",
452
- i && /* @__PURE__ */ e.jsx(
465
+ l && l ? /* @__PURE__ */ e.jsx(xt, { count: l, maxCount: 9, className: "badge", disabled: u }) : "",
466
+ c && /* @__PURE__ */ e.jsx(
453
467
  "div",
454
468
  {
455
469
  className: A(
456
470
  "sublinks-toggle",
457
471
  "transition-all duration-200",
458
472
  "rounded-full relative grid place-items-center size-6",
459
- o && "text-primary-default-default",
460
- `${p ? "-rotate-90" : "rotate-90"}`
473
+ n && "text-primary-default-default",
474
+ `${m ? "-rotate-90" : "rotate-90"}`
461
475
  ),
462
476
  children: /* @__PURE__ */ e.jsx(
463
477
  "button",
464
478
  {
465
479
  disabled: u,
466
480
  type: "button",
467
- onClick: c,
468
- className: A("absolute cursor-pointer hover:text-primary-default-hover top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 p-2 z-100 select-none", Re({ disabled: u, isSelected: o }), u && "pointer-events-none"),
469
- children: /* @__PURE__ */ e.jsx(ut, {})
481
+ onClick: d,
482
+ className: A("absolute cursor-pointer hover:text-primary-default-hover top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 p-2 z-100 select-none", Se({ disabled: u, isSelected: n }), u && "pointer-events-none"),
483
+ children: /* @__PURE__ */ e.jsx(Nt, {})
470
484
  }
471
485
  )
472
486
  }
473
487
  )
474
488
  ] })
475
- ] }), m = A(
489
+ ] }), F = A(
476
490
  "group navitem",
477
491
  "h-12 flex-1 flex items-center p-3 rounded-lg justify-between w-full",
478
492
  "transition-all duration-300",
479
- wt,
480
- vt({ isSelected: o, disabled: u }),
481
- d
493
+ Ot,
494
+ Lt({ isSelected: n, disabled: u }),
495
+ i
482
496
  );
483
- if (x === "a") {
484
- const k = {
485
- onClick: h,
486
- onAuxClick: C,
487
- className: m
497
+ if (h === "a") {
498
+ const P = {
499
+ onClick: y,
500
+ onAuxClick: w,
501
+ className: F
488
502
  };
489
- return /* @__PURE__ */ e.jsx("a", { ...k, children: N });
503
+ return /* @__PURE__ */ e.jsx("a", { ...P, children: f });
490
504
  }
491
- if (x === "button") {
492
- const k = {
493
- onClick: h,
505
+ if (h === "button") {
506
+ const P = {
507
+ onClick: y,
494
508
  type: "button",
495
- className: m
509
+ className: F
496
510
  };
497
- return /* @__PURE__ */ e.jsx("button", { ...k, children: N });
511
+ return /* @__PURE__ */ e.jsx("button", { ...P, children: f });
498
512
  }
499
- const P = {
500
- onClick: h,
501
- className: m
513
+ const D = {
514
+ onClick: y,
515
+ className: F
502
516
  };
503
- return /* @__PURE__ */ e.jsx("div", { ...P, children: N });
504
- }, Oe = L(yt);
505
- Oe.displayName = "NavigationDrawerItemBase";
506
- const Ct = (t) => {
507
- const { title: r, icon: s, count: l, className: d, isActive: o, onClick: i, isView: p = !0, disabled: c } = t;
508
- return p ? /* @__PURE__ */ e.jsx(
509
- Oe,
517
+ return /* @__PURE__ */ e.jsx("div", { ...D, children: f });
518
+ }, Pe = T(It);
519
+ Pe.displayName = "NavigationDrawerItemBase";
520
+ const Et = (t) => {
521
+ const { title: r, icon: s, count: l, className: i, isActive: n, onClick: c, isView: m = !0, disabled: d, tooltipText: h } = t;
522
+ return m ? /* @__PURE__ */ e.jsx(
523
+ Pe,
510
524
  {
511
525
  as: "button",
512
526
  title: r,
513
527
  icon: s,
514
528
  count: l,
515
- className: d,
516
- isSelected: o,
517
- onClick: i,
518
- disabled: c
529
+ className: i,
530
+ isSelected: n,
531
+ onClick: c,
532
+ disabled: d,
533
+ tooltipText: h
519
534
  }
520
535
  ) : null;
521
- }, Je = L(Ct);
522
- Je.displayName = "NavigationDrawerActionItem";
523
- const jt = ({ actions: t, activeActionId: r, onActionClick: s, className: l, payload: d }) => /* @__PURE__ */ e.jsx(be, { className: A("flex flex-col gap-2 w-full ", l), scrollbarProps: { hide: !0 }, persistScroll: "navigation-actions", indicators: {
536
+ }, et = T(Et);
537
+ et.displayName = "NavigationDrawerActionItem";
538
+ const Pt = ({ actions: t, activeActionId: r, onActionClick: s, className: l }) => /* @__PURE__ */ e.jsx(ye, { className: A("flex flex-col gap-2 w-full ", l), scrollbarProps: { hide: !0 }, persistScroll: "navigation-actions", indicators: {
524
539
  top: { type: "shadow", behavior: "scroll-on-hover", show: !0 },
525
540
  bottom: { type: "shadow", behavior: "scroll-on-hover", show: !0 }
526
- }, children: t?.map((o) => {
527
- const { id: i, onClick: p, isView: c = !0, ...x } = o, b = i === r, C = () => {
528
- s?.(i, d), p?.();
541
+ }, children: t?.map((i) => {
542
+ const { id: n, onClick: c, isView: m = !0, payload: d, ...h } = i, b = n === r, w = () => {
543
+ s?.(n, d), c?.();
529
544
  };
530
- return c ? /* @__PURE__ */ e.jsx(
531
- Je,
545
+ return m ? /* @__PURE__ */ e.jsx(
546
+ et,
532
547
  {
533
- ...x,
534
- id: i,
548
+ ...h,
549
+ id: n,
535
550
  isActive: b,
536
- onClick: C
551
+ onClick: w
537
552
  },
538
- i
553
+ n
539
554
  ) : null;
540
- }) }), Ke = L(jt);
541
- Ke.displayName = "NavigationDrawerActions";
542
- const St = (t) => {
543
- const { className: r, title: s, path: l, onClick: d, isSelected: o, parentPath: i } = t, p = g(() => {
544
- d?.(l);
545
- }, [l]), c = g(() => {
555
+ }) }), tt = T(Pt);
556
+ tt.displayName = "NavigationDrawerActions";
557
+ const _t = (t) => {
558
+ const { className: r, title: s, path: l, onClick: i, isSelected: n, parentPath: c } = t, m = x(() => {
559
+ i?.(l);
560
+ }, [l]), d = x(() => {
546
561
  if (l.startsWith("./")) {
547
- if (!i) return;
548
- const x = i + l.slice(2);
549
- window.open(x, "_blank");
562
+ if (!c) return;
563
+ const h = c + l.slice(2);
564
+ window.open(h, "_blank");
550
565
  } else
551
566
  window.open(l, "_blank");
552
567
  }, [l]);
553
568
  return /* @__PURE__ */ e.jsx(
554
569
  "a",
555
570
  {
556
- onClick: p,
557
- onAuxClick: c,
571
+ onClick: m,
572
+ onAuxClick: d,
558
573
  className: A(
559
574
  "group",
560
575
  "transition-all duration-300 ease-in-out cursor-pointer",
561
576
  "h-10 w-full rounded-lg py-[11px] px-3",
562
577
  "hover:bg-neutral-medium-hover",
563
- o && "bg-neutral-medium-selected hover:bg-neutral-medium-hover active:bg-transparent focus:bg-transparent",
578
+ n && "bg-neutral-medium-selected hover:bg-neutral-medium-hover active:bg-transparent focus:bg-transparent",
564
579
  r
565
580
  ),
566
581
  children: /* @__PURE__ */ e.jsx("p", { className: A(
567
582
  "prometeo-fonts-label-large text-neutral-medium-default",
568
583
  "group-active:text-neutral-default-focused group-focus:text-neutral-default-focused",
569
- o && "text-primary-default-default group-hover:text-primary-default-hover group-focus:text-primary-default-focused group-active:text-primary-default-focused"
584
+ n && "text-primary-default-default group-hover:text-primary-default-hover group-focus:text-primary-default-focused group-active:text-primary-default-focused"
570
585
  ), children: s })
571
586
  }
572
587
  );
573
- }, Ge = L(St);
574
- Ge.displayName = "NavItemSecondary";
575
- const kt = he((t, r) => {
576
- const [s, l] = te(!0), d = O(null), { path: o, title: i, icon: p, count: c, className: x, isSelected: b = !1, onClick: C, sublinks: u, toggleCollapse: h, getIsCollapsed: N, subscribeToCollapse: m, isView: P = !0, disabled: k } = t;
577
- V(() => m ? m((I) => {
578
- I && l(!0);
579
- }) : void 0, [m]);
580
- const j = g(() => {
581
- l((_) => !_);
582
- }, []), R = g((_) => {
583
- l(_);
584
- }, []), T = {
585
- toggle: j,
586
- setIsCollapsed: R,
588
+ }, rt = T(_t);
589
+ rt.displayName = "NavItemSecondary";
590
+ const Rt = Ne((t, r) => {
591
+ const [s, l] = Z(!0), i = I(null), { path: n, title: c, icon: m, count: d, className: h, isSelected: b = !1, onClick: w, sublinks: u, toggleCollapse: N, getIsCollapsed: y, subscribeToCollapse: f, isView: F = !0, disabled: D, tooltipText: P } = t;
592
+ X(() => f ? f((E) => {
593
+ E && l(!0);
594
+ }) : void 0, [f]);
595
+ const R = x(() => {
596
+ l((M) => !M);
597
+ }, []), k = x((M) => {
598
+ l(M);
599
+ }, []), j = {
600
+ toggle: R,
601
+ setIsCollapsed: k,
587
602
  get isCollapsed() {
588
603
  return s;
589
604
  },
590
605
  get isDrawerCollapsed() {
591
- return N?.() ?? !1;
606
+ return y?.() ?? !1;
592
607
  },
593
- toggleDrawerCollapse: h,
594
- subscribeToCollapse: m
608
+ toggleDrawerCollapse: N,
609
+ subscribeToCollapse: f
595
610
  };
596
- De(r, () => T, [T, s, N, h]);
597
- const F = p, H = g(() => {
598
- const _ = N?.() ?? !1;
599
- if (u && u.length > 0 && _) {
600
- R(!1), h?.();
611
+ Le(r, () => j, [j, s, y, N]);
612
+ const K = m, Y = x(() => {
613
+ const M = y?.() ?? !1;
614
+ if (u && u.length > 0 && M) {
615
+ k(!1), N?.();
601
616
  return;
602
617
  }
603
- C?.(o);
604
- }, [o, C, u, h, R, N]), M = g(() => {
605
- window.open(o, "_blank");
606
- }, [o]), W = () => {
607
- if (!u || k) return null;
618
+ w?.(n);
619
+ }, [n, w, u, N, k, y]), J = x(() => {
620
+ window.open(n, "_blank");
621
+ }, [n]), te = () => {
622
+ if (!u || D) return null;
608
623
  if (t.subLinksRender && u)
609
- return t.subLinksRender(u, T);
610
- const _ = g((I) => {
611
- if (I.startsWith("./")) {
612
- const q = o + I.slice(2);
613
- C?.(q);
624
+ return t.subLinksRender(u, j);
625
+ const M = x((E) => {
626
+ if (E.startsWith("./")) {
627
+ const V = n + E.slice(2);
628
+ w?.(V);
614
629
  } else
615
- C?.(I);
616
- }, [o]);
617
- return V(() => {
618
- const I = d.current;
619
- if (!I) return;
620
- const q = I.scrollHeight;
621
- I.style.setProperty("--sublinks-max-height", `${q}px`);
622
- }, []), /* @__PURE__ */ e.jsx("div", { ref: d, className: `sublinks flex flex-col gap-1 ml-8 ${s ? "collapsed" : "expanded"}`, children: u.map((I) => /* @__PURE__ */ e.jsx(Ge, { ...I, onClick: _, parentPath: o }, `${I.title}-${I.path}`)) });
623
- }, Q = (_) => {
624
- _.stopPropagation(), _.preventDefault(), j();
630
+ w?.(E);
631
+ }, [n]);
632
+ return X(() => {
633
+ const E = i.current;
634
+ if (!E) return;
635
+ const V = E.scrollHeight;
636
+ E.style.setProperty("--sublinks-max-height", `${V}px`);
637
+ }, []), /* @__PURE__ */ e.jsx("div", { ref: i, className: `sublinks flex flex-col gap-1 ml-8 ${s ? "collapsed" : "expanded"}`, children: u.map((E) => /* @__PURE__ */ e.jsx(rt, { ...E, onClick: M, parentPath: n }, `${E.title}-${E.path}`)) });
638
+ }, H = (M) => {
639
+ M.stopPropagation(), M.preventDefault(), R();
625
640
  };
626
- return P ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
641
+ return F ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
627
642
  /* @__PURE__ */ e.jsx(
628
- Oe,
643
+ Pe,
629
644
  {
630
645
  as: "a",
631
- title: i,
632
- icon: F,
633
- count: c,
634
- className: x,
646
+ title: c,
647
+ icon: K,
648
+ count: d,
649
+ className: h,
635
650
  isSelected: b,
636
651
  hasSublinks: !!u,
637
652
  subLinksCollapsed: s,
638
- onToggleSublinks: Q,
639
- onClick: H,
640
- onAuxClick: M,
641
- disabled: k
653
+ onToggleSublinks: H,
654
+ onClick: Y,
655
+ onAuxClick: J,
656
+ disabled: D,
657
+ tooltipText: P
642
658
  }
643
659
  ),
644
- W()
660
+ te()
645
661
  ] }) : null;
646
- }), Ye = L(kt);
647
- Ye.displayName = "NavigationDrawerLinkItem";
648
- const Dt = ({ navlinks: t, handleNavigation: r, className: s, getIsCollapsed: l, toggleCollapse: d, subscribeToCollapse: o }) => (
649
- // <div className={cn("flex flex-col gap-2 h-full",className)}>
650
- /* @__PURE__ */ e.jsx(be, { className: A("flex flex-col gap-2 w-full ", s), scrollbarProps: { hide: !0 }, persistScroll: "navigation-links", indicators: {
662
+ }), st = T(Rt);
663
+ st.displayName = "NavigationDrawerLinkItem";
664
+ const Mt = ({ navlinks: t, handleNavigation: r, className: s, getIsCollapsed: l, toggleCollapse: i, subscribeToCollapse: n }) => {
665
+ const { pathname: c } = ht();
666
+ return /* @__PURE__ */ e.jsx(ye, { className: A("flex flex-col gap-2 w-full ", s), scrollbarProps: { hide: !0 }, persistScroll: "navigation-links", indicators: {
651
667
  top: { type: "shadow", behavior: "scroll-on-hover", show: !0 },
652
668
  bottom: { type: "shadow", behavior: "scroll-on-hover", show: !0 }
653
- }, children: t?.map((i, p) => {
654
- const c = i.isSelected || i.path === window.location.pathname || (i.relatedPaths?.some((x) => window.location.pathname.startsWith(x)) ?? !1);
669
+ }, children: t?.map((m, d) => {
670
+ const h = m.isSelected || m.path === c || (m.relatedPaths?.some((b) => c.startsWith(b)) ?? !1);
655
671
  return /* @__PURE__ */ e.jsx(
656
- Ye,
672
+ st,
657
673
  {
658
674
  className: "",
659
- ...i,
660
- isSelected: c,
675
+ ...m,
676
+ isSelected: h,
661
677
  onClick: r,
662
- toggleCollapse: d,
678
+ toggleCollapse: i,
663
679
  getIsCollapsed: l,
664
- subscribeToCollapse: o,
665
- disabled: i.disabled,
666
- isView: i.isView
680
+ subscribeToCollapse: n,
681
+ disabled: m.disabled,
682
+ isView: m.isView
667
683
  },
668
- p
684
+ d
669
685
  );
670
- }) })
671
- ), Qe = L(Dt);
672
- Qe.displayName = "NavigationDrawerNavlinks";
673
- const Xe = L(({ navlinks: t, handleNavigation: r, allActions: s, activeActionId: l, onActionClick: d }) => {
674
- const { getIsCollapsed: o, toggleCollapse: i, subscribeToCollapse: p } = re();
686
+ }) });
687
+ }, nt = T(Mt);
688
+ nt.displayName = "NavigationDrawerNavlinks";
689
+ const at = T(({ navlinks: t, handleNavigation: r, allActions: s, activeActionId: l, onActionClick: i }) => {
690
+ const { getIsCollapsed: n, toggleCollapse: c, subscribeToCollapse: m } = ie();
675
691
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
676
- /* @__PURE__ */ e.jsx(U.Spacer, { className: "pb-3" }),
692
+ /* @__PURE__ */ e.jsx(q.Spacer, { className: "pb-3" }),
677
693
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col overflow-hidden h-full gap-4", children: [
678
694
  /* @__PURE__ */ e.jsx(
679
- Qe,
695
+ nt,
680
696
  {
681
- getIsCollapsed: o,
682
- toggleCollapse: i,
683
- subscribeToCollapse: p,
697
+ getIsCollapsed: n,
698
+ toggleCollapse: c,
699
+ subscribeToCollapse: m,
684
700
  navlinks: t,
685
701
  handleNavigation: r,
686
702
  className: "flex flex-1 min-h-[30vh]"
687
703
  }
688
704
  ),
689
705
  /* @__PURE__ */ e.jsx(
690
- Ke,
706
+ tt,
691
707
  {
692
708
  actions: s,
693
709
  activeActionId: l,
694
- onActionClick: d,
710
+ onActionClick: i,
695
711
  className: "max-h-[35vh]"
696
712
  }
697
713
  )
698
714
  ] })
699
715
  ] });
700
716
  }, (t, r) => t.navlinks === r.navlinks && t.handleNavigation === r.handleNavigation && t.allActions === r.allActions && t.activeActionId === r.activeActionId && t.onActionClick === r.onActionClick);
701
- Xe.displayName = "PyrionNavigationDrawer.Content";
702
- const At = ({ name: t, imageUrl: r, avatarSize: s = "xxs", subImageUrl: l, className: d, mainSlot: o = t, secondarySlot: i }) => {
703
- const p = g(() => o ? typeof o == "string" ? /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-large text-neutral-default-default line-clamp-1 select-text", children: o }) : typeof o == "function" ? o() : o : null, [o]), c = g(() => i ? typeof i == "string" ? /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-pre text-ellipsis select-text", children: i }) : typeof i == "function" ? i() : i : null, [i]);
704
- return /* @__PURE__ */ e.jsxs("div", { className: A("flex items-center gap-2 p-3 rounded-lg max-w-full max-h-full select-none ", d), children: [
717
+ at.displayName = "PyrionNavigationDrawer.Content";
718
+ const Bt = ({ name: t, imageUrl: r, avatarSize: s = "xxs", subImageUrl: l, className: i, mainSlot: n = t, secondarySlot: c }) => {
719
+ const m = x(() => n ? typeof n == "string" ? /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-large text-neutral-default-default line-clamp-1 select-text", children: n }) : typeof n == "function" ? n() : n : null, [n]), d = x(() => c ? typeof c == "string" ? /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-pre text-ellipsis select-text", children: c }) : typeof c == "function" ? c() : c : null, [c]);
720
+ return /* @__PURE__ */ e.jsxs("div", { className: A("flex items-center gap-2 p-3 rounded-lg max-w-full max-h-full select-none ", i), children: [
705
721
  /* @__PURE__ */ e.jsx(
706
- ft,
722
+ yt,
707
723
  {
708
724
  fallbackText: t,
709
725
  sizeImage: s,
@@ -712,66 +728,68 @@ const At = ({ name: t, imageUrl: r, avatarSize: s = "xxs", subImageUrl: l, class
712
728
  subImageUrl: l
713
729
  }
714
730
  ),
715
- /* @__PURE__ */ e.jsxs("div", { className: A("usercard-content flex flex-col gap-0 flex-1 overflow-hidden w-full transition-all duration-300 ease-in-out ", i && "gap-1"), children: [
716
- /* @__PURE__ */ e.jsx("div", { className: "w-full", children: p() }),
717
- /* @__PURE__ */ e.jsx("div", { className: "flex gap-1 justify-between overflow-hidden relative w-full", children: c() })
731
+ /* @__PURE__ */ e.jsxs("div", { className: A("usercard-content flex flex-col gap-0 flex-1 overflow-hidden w-full transition-all duration-300 ease-in-out ", c && "gap-1"), children: [
732
+ /* @__PURE__ */ e.jsx("div", { className: "w-full", children: m() }),
733
+ /* @__PURE__ */ e.jsx("div", { className: "flex gap-1 justify-between overflow-hidden relative w-full", children: d() })
718
734
  ] })
719
735
  ] });
720
- }, Ie = L(At);
721
- Ie.displayName = "UserCard";
722
- const Lt = (t) => {
723
- const { sessions: r, onSessionClick: s, secondarySlot: l, subImageUrlAccessor: d } = t;
736
+ }, _e = T(Bt);
737
+ _e.displayName = "UserCard";
738
+ const Ft = (t) => {
739
+ const { sessions: r, onSessionClick: s, secondarySlot: l, subImageUrlAccessor: i } = t;
724
740
  if (!r || r.length === 0)
725
741
  return null;
726
- const o = (c) => {
727
- s && s(c);
728
- }, i = (c) => {
729
- if (!d)
742
+ const n = (d) => {
743
+ s && s(d);
744
+ }, c = (d) => {
745
+ if (!i)
730
746
  return;
731
- const x = c.metadata;
732
- if (!x)
747
+ const h = d.metadata;
748
+ if (!h)
733
749
  return;
734
- const b = de({ metadata: x }, d);
750
+ const b = xe({ metadata: h }, i);
735
751
  if (b != null)
736
752
  return typeof b == "string" ? b : String(b);
737
- }, p = g((c) => typeof l == "function" ? l(c) : l, [l]);
738
- return /* @__PURE__ */ e.jsx("div", { className: "w-full h-full flex flex-col gap-2", children: r?.map((c) => {
739
- const { auth_id: x } = c;
740
- return /* @__PURE__ */ e.jsx($, { className: " shrink-0 h-max", children: /* @__PURE__ */ e.jsx($.Content, { onClick: () => o(c), className: "p-0 group-data-[expanded=true]/ticketcard:border-none", children: /* @__PURE__ */ e.jsx(
741
- Ie,
753
+ }, m = x((d) => typeof l == "function" ? l(d) : l, [l]);
754
+ return /* @__PURE__ */ e.jsx("div", { className: "w-full h-full flex flex-col gap-2", children: r?.map((d) => {
755
+ const { auth_id: h } = d;
756
+ return /* @__PURE__ */ e.jsx(ee, { className: " shrink-0 h-max", children: /* @__PURE__ */ e.jsx(ee.Content, { onClick: () => n(d), className: "p-0 group-data-[expanded=true]/ticketcard:border-none", children: /* @__PURE__ */ e.jsx(
757
+ _e,
742
758
  {
743
- name: x.name,
759
+ name: h.name,
744
760
  avatarSize: "xxs",
745
- secondarySlot: p(c),
746
- subImageUrl: i(c),
747
- imageUrl: x.profile_picture,
761
+ secondarySlot: m(d),
762
+ subImageUrl: c(d),
763
+ imageUrl: h.profile_picture,
748
764
  className: "pyrion-navigation-drawer-user-card"
749
765
  },
750
- c.token
751
- ) }) }, c.token);
766
+ d.token
767
+ ) }) }, d.token);
752
768
  }) });
753
- }, Ot = ({
769
+ }, Ut = ({
754
770
  state: t,
755
771
  currentAppSessions: r,
756
772
  resolveUserSecondarySlot: s,
757
773
  resolveSessionSecondarySlot: l,
758
- onSessionClick: d,
759
- onLogoutClick: o,
760
- options: i,
761
- currentSystemId: p,
762
- userOptionsControls: c,
763
- mobileAppSwitcherControls: x
774
+ onSessionClick: i,
775
+ onLogoutClick: n,
776
+ onProfileClick: c,
777
+ options: m,
778
+ currentSystemId: d,
779
+ userOptionsControls: h,
780
+ mobileAppSwitcherControls: b
764
781
  }) => {
765
- const { getIsCollapsed: b, toggleCollapse: C, subscribeToCollapse: u } = re(), h = g(() => {
766
- b() && (C(), c.current?.open());
767
- }, [b, C, c]);
768
- return V(() => u((N) => {
769
- N && (c.current?.close(), x.current?.close());
770
- }), [u, c, x]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
771
- /* @__PURE__ */ e.jsx(U.Spacer, { className: "mb-3" }),
772
- /* @__PURE__ */ e.jsxs($, { className: "", controls: c, children: [
773
- /* @__PURE__ */ e.jsx($.Content, { onClick: h, children: /* @__PURE__ */ e.jsx(
774
- Ie,
782
+ const { getIsCollapsed: w, toggleCollapse: u, subscribeToCollapse: N } = ie(), y = x(() => {
783
+ const f = w();
784
+ f ? (u(), h.current?.open()) : c?.(f);
785
+ }, [w, u, h, c]);
786
+ return X(() => N((f) => {
787
+ f && (h.current?.close(), b.current?.close());
788
+ }), [N, h, b]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
789
+ /* @__PURE__ */ e.jsx(q.Spacer, { className: "mb-3" }),
790
+ /* @__PURE__ */ e.jsxs(ee, { className: "", controls: h, children: [
791
+ /* @__PURE__ */ e.jsx(ee.Content, { onClick: y, children: /* @__PURE__ */ e.jsx(
792
+ _e,
775
793
  {
776
794
  className: "pyrion-navigation-drawer-user-card p-0",
777
795
  name: t.user.name,
@@ -781,31 +799,31 @@ const Lt = (t) => {
781
799
  avatarSize: "xxs"
782
800
  }
783
801
  ) }),
784
- /* @__PURE__ */ e.jsxs($.Options, { className: "min-h-max flex flex-col gap-3 pl-3 mt-3 pt-2", children: [
802
+ /* @__PURE__ */ e.jsxs(ee.Options, { className: "min-h-max flex flex-col gap-3 pl-3 mt-3 pt-2", children: [
785
803
  r && r.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
786
804
  /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-medium text-neutral-medium-default select-none", children: "Cambiar cuenta" }),
787
- /* @__PURE__ */ e.jsx(be, { className: "flex flex-col gap-2 max-h-[165px] flex-1", scrollbarProps: { hide: !0 }, children: /* @__PURE__ */ e.jsx(
788
- Lt,
805
+ /* @__PURE__ */ e.jsx(ye, { className: "flex flex-col gap-2 max-h-[165px] flex-1", scrollbarProps: { hide: !0 }, children: /* @__PURE__ */ e.jsx(
806
+ Ft,
789
807
  {
790
808
  sessions: r,
791
- onSessionClick: d,
809
+ onSessionClick: i,
792
810
  secondarySlot: l,
793
- subImageUrlAccessor: i?.sessionCardOptions?.subImageUrlAccessor,
794
- currentSystemId: p
811
+ subImageUrlAccessor: m?.sessionCardOptions?.subImageUrlAccessor,
812
+ currentSystemId: d
795
813
  }
796
814
  ) })
797
815
  ] }),
798
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: o && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
816
+ /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: n && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
799
817
  /* @__PURE__ */ e.jsx("span", { className: "border-t border-neutral-strong-default w-full bg-neutral-strong-default" }),
800
818
  /* @__PURE__ */ e.jsx(
801
819
  fe,
802
820
  {
803
- onClick: o,
821
+ onClick: n,
804
822
  animate: !1,
805
823
  animateIcon: !1,
806
824
  variant: "text",
807
825
  label: "Cerrar sesión",
808
- icon: /* @__PURE__ */ e.jsx(mt, {}),
826
+ icon: /* @__PURE__ */ e.jsx(Ct, {}),
809
827
  size: "small",
810
828
  color: "secondary"
811
829
  }
@@ -814,15 +832,27 @@ const Lt = (t) => {
814
832
  ] })
815
833
  ] })
816
834
  ] });
817
- }, Ze = L(Ot, (t, r) => t.state !== r.state || t.currentAppSessions !== r.currentAppSessions || t.options !== r.options || t.currentSystemId !== r.currentSystemId || t.userOptionsControls !== r.userOptionsControls || t.mobileAppSwitcherControls !== r.mobileAppSwitcherControls);
818
- Ze.displayName = "PyrionNavigationDrawer.Footer";
819
- const It = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs($, { controls: s, children: [
820
- /* @__PURE__ */ e.jsx($.Content, { children: typeof r == "function" ? r() : r }),
821
- /* @__PURE__ */ e.jsxs($.Options, { children: [
835
+ }, ot = T(Ut, (t, r) => {
836
+ const s = Object.keys(t), l = Object.keys(r);
837
+ if (s.length !== l.length)
838
+ return !1;
839
+ for (const i of s) {
840
+ if (!Object.prototype.hasOwnProperty.call(r, i))
841
+ return !1;
842
+ const n = t[i], c = r[i];
843
+ if (n !== c)
844
+ return !1;
845
+ }
846
+ return t.currentAppSessions !== r.currentAppSessions || t.options !== r.options || t.currentSystemId !== r.currentSystemId || t.userOptionsControls !== r.userOptionsControls || t.mobileAppSwitcherControls !== r.mobileAppSwitcherControls;
847
+ });
848
+ ot.displayName = "PyrionNavigationDrawer.Footer";
849
+ const zt = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs(ee, { controls: s, children: [
850
+ /* @__PURE__ */ e.jsx(ee.Content, { children: typeof r == "function" ? r() : r }),
851
+ /* @__PURE__ */ e.jsxs(ee.Options, { children: [
822
852
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col p-2 pl-4 gap-2", children: [
823
853
  /* @__PURE__ */ e.jsx("p", { className: " prometeo-fonts-label-medium text-neutral-medium-default", children: "Cambiar módulo" }),
824
- /* @__PURE__ */ e.jsx(be, { className: "max-h-52", scrollbarProps: { hide: !0 }, children: t?.map((l) => {
825
- const d = typeof l.thumbnail == "string" ? /* @__PURE__ */ e.jsx(
854
+ /* @__PURE__ */ e.jsx(ye, { className: "max-h-52", scrollbarProps: { hide: !0 }, children: t?.map((l) => {
855
+ const i = typeof l.thumbnail == "string" ? /* @__PURE__ */ e.jsx(
826
856
  "img",
827
857
  {
828
858
  src: l.thumbnail,
@@ -830,11 +860,11 @@ const It = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs($, {
830
860
  className: "size-8 aspect-square rounded",
831
861
  draggable: !1
832
862
  }
833
- ) : l.thumbnail, o = () => {
863
+ ) : l.thumbnail, n = () => {
834
864
  l.disabled || l.onClick && l.onClick(l.name);
835
865
  };
836
- return /* @__PURE__ */ e.jsxs("div", { onClick: o, className: "flex gap-2 p-2 rounded-lg h-12", children: [
837
- d,
866
+ return /* @__PURE__ */ e.jsxs("div", { onClick: n, className: "flex gap-2 p-2 rounded-lg h-12", children: [
867
+ i,
838
868
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center h-full justify-center ", children: [
839
869
  /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-large text-neutral-default-default line-clamp-1", children: l.name }),
840
870
  l.description && /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-medium-default line-clamp-1", children: l.description })
@@ -844,25 +874,25 @@ const It = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs($, {
844
874
  ] }),
845
875
  /* @__PURE__ */ e.jsx("div", {})
846
876
  ] })
847
- ] }), Ce = L(({ enabled_systems: t, onClick: r, currentSystemId: s }) => {
848
- const l = g(() => {
877
+ ] }), De = T(({ enabled_systems: t, onClick: r, currentSystemId: s }) => {
878
+ const l = x(() => {
849
879
  if (t) {
850
880
  if (s) {
851
- const p = t.find((c) => c._id === s);
852
- if (p) return { coverImage: p.coverImage, thumbnail: p.thumbnail };
881
+ const m = t.find((d) => d._id === s);
882
+ if (m) return { coverImage: m.coverImage, thumbnail: m.thumbnail };
853
883
  }
854
- const o = window.location.origin, i = t.find((p) => p.url === o);
855
- if (i) return { coverImage: i.coverImage, thumbnail: i.thumbnail };
884
+ const n = window.location.origin, c = t.find((m) => m.url === n);
885
+ if (c) return { coverImage: c.coverImage, thumbnail: c.thumbnail };
856
886
  }
857
887
  return { coverImage: "", thumbnail: "" };
858
- }, [t]), d = !!r;
888
+ }, [t]), i = !!r;
859
889
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
860
890
  /* @__PURE__ */ e.jsx(
861
891
  "img",
862
892
  {
863
893
  src: l().coverImage,
864
894
  alt: "System Logo",
865
- className: A("w-full h-12 rounded object-contain system-cover-image ", d && "cursor-pointer"),
895
+ className: A("w-full h-12 rounded object-contain system-cover-image ", i && "cursor-pointer"),
866
896
  draggable: !1,
867
897
  onClick: r
868
898
  }
@@ -872,71 +902,71 @@ const It = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs($, {
872
902
  {
873
903
  src: l().thumbnail,
874
904
  alt: "System Logo",
875
- className: A("w-12 h-12 rounded object-cover system-thumbnail ", d && "cursor-pointer"),
905
+ className: A("w-12 h-12 rounded object-cover system-thumbnail ", i && "cursor-pointer"),
876
906
  draggable: !1,
877
907
  onClick: r
878
908
  }
879
909
  )
880
910
  ] });
881
911
  }, (t, r) => t.enabled_systems === r.enabled_systems && t.onClick === r.onClick && t.currentSystemId === r.currentSystemId);
882
- Ce.displayName = "PyrionNavigationDrawer.SystemLogo";
883
- const et = L(({ onSystemLogoClick: t, state: r, currentSystemId: s, tabs: l, mobileAppSwitcherControls: d }) => {
884
- const { getIsCollapsed: o } = re(), i = Fe(), p = g(() => {
912
+ De.displayName = "PyrionNavigationDrawer.SystemLogo";
913
+ const lt = T(({ onSystemLogoClick: t, state: r, currentSystemId: s, tabs: l, mobileAppSwitcherControls: i }) => {
914
+ const { getIsCollapsed: n } = ie(), c = We(), m = x(() => {
885
915
  if (t) {
886
- const c = o();
887
- t(c);
916
+ const d = n();
917
+ t(d);
888
918
  }
889
- }, [t, o]);
890
- return i ? /* @__PURE__ */ e.jsx(
891
- It,
919
+ }, [t, n]);
920
+ return c ? /* @__PURE__ */ e.jsx(
921
+ zt,
892
922
  {
893
- controls: d,
923
+ controls: i,
894
924
  tabs: l,
895
925
  content: /* @__PURE__ */ e.jsx(
896
- Ce,
926
+ De,
897
927
  {
898
928
  enabled_systems: r.enabled_systems,
899
- onClick: p,
929
+ onClick: m,
900
930
  currentSystemId: s
901
931
  }
902
932
  )
903
933
  }
904
934
  ) : /* @__PURE__ */ e.jsx(
905
- Ce,
935
+ De,
906
936
  {
907
937
  enabled_systems: r.enabled_systems,
908
- onClick: p,
938
+ onClick: m,
909
939
  currentSystemId: s
910
940
  }
911
941
  );
912
942
  });
913
- et.displayName = "PyrionNavigationDrawer.Header";
914
- const Tt = ({ onCloseClick: t, onMarkAllAsRead: r, notificationsListControls: s }) => {
915
- const [l, d] = te([]), o = O(/* @__PURE__ */ new Set()), i = g((u, h = "top") => {
916
- d((N) => {
917
- const m = Array.isArray(u) ? h === "bottom" ? [...N, ...u] : [...u, ...N] : h === "bottom" ? [...N, u] : [u, ...N];
918
- return o.current.forEach((P) => P(m, m.length)), m;
943
+ lt.displayName = "PyrionNavigationDrawer.Header";
944
+ const Ht = ({ onCloseClick: t, onMarkAllAsRead: r, notificationsListControls: s }) => {
945
+ const [l, i] = Z([]), n = I(/* @__PURE__ */ new Set()), c = x((u, N = "top") => {
946
+ i((y) => {
947
+ const f = Array.isArray(u) ? N === "bottom" ? [...y, ...u] : [...u, ...y] : N === "bottom" ? [...y, u] : [u, ...y];
948
+ return n.current.forEach((F) => F(f, f.length)), f;
919
949
  });
920
- }, []), p = g((u) => (o.current.add(u), () => {
921
- o.current.delete(u);
922
- }), []), c = g((u) => {
923
- d((h) => {
924
- const N = Array.isArray(u) ? h.filter((m) => !u.includes(m._id)) : h.filter((m) => m._id !== u);
925
- return o.current.forEach((m) => m(N, N.length)), N;
950
+ }, []), m = x((u) => (n.current.add(u), () => {
951
+ n.current.delete(u);
952
+ }), []), d = x((u) => {
953
+ i((N) => {
954
+ const y = Array.isArray(u) ? N.filter((f) => !u.includes(f._id)) : N.filter((f) => f._id !== u);
955
+ return n.current.forEach((f) => f(y, y.length)), y;
926
956
  });
927
- }, []), x = g(() => {
928
- d([]), o.current.forEach((u) => u([], 0));
929
- }, []), b = g((u) => {
930
- d(u), o.current.forEach((h) => h(u, u.length));
957
+ }, []), h = x(() => {
958
+ i([]), n.current.forEach((u) => u([], 0));
959
+ }, []), b = x((u) => {
960
+ i(u), n.current.forEach((N) => N(u, u.length));
931
961
  }, []);
932
- De(s, () => ({
933
- addNewNotification: i,
934
- subscribeToUpdates: p,
962
+ Le(s, () => ({
963
+ addNewNotification: c,
964
+ subscribeToUpdates: m,
935
965
  setNotifications: b,
936
- removeNotification: c,
937
- removeAllNotifications: x
938
- }), [i, p, b, c, x]);
939
- const C = l.length > 0;
966
+ removeNotification: d,
967
+ removeAllNotifications: h
968
+ }), [c, m, b, d, h]);
969
+ const w = l.length > 0;
940
970
  return /* @__PURE__ */ e.jsxs(
941
971
  "section",
942
972
  {
@@ -944,365 +974,384 @@ const Tt = ({ onCloseClick: t, onMarkAllAsRead: r, notificationsListControls: s
944
974
  children: [
945
975
  /* @__PURE__ */ e.jsxs("div", { className: "w-full h-max flex gap-2 items-center justify-between pt-8 pb-2 pr-2 pl-4 border-b border-neutral-strong-default sticky top-0 z-50 bg-neutral-default-default", children: [
946
976
  /* @__PURE__ */ e.jsxs("span", { className: "flex gap-2 items-center", children: [
947
- /* @__PURE__ */ e.jsx(Me, { className: "text-neutral-strong-default", size: 24 }),
977
+ /* @__PURE__ */ e.jsx(qe, { className: "text-neutral-strong-default", size: 24 }),
948
978
  /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-headline-small text-neutral-strong-default", children: "Notificaciones" })
949
979
  ] }),
950
- /* @__PURE__ */ e.jsx(fe, { onClick: () => t?.(), icon: /* @__PURE__ */ e.jsx(Be, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
980
+ /* @__PURE__ */ e.jsx(fe, { onClick: () => t?.(), icon: /* @__PURE__ */ e.jsx(Ie, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
951
981
  ] }),
952
982
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-3 pb-8 pt-4 px-4", children: [
953
- r && C && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(fe, { onClick: r, label: "Marcar todas como leidas", variant: "text", animate: !1, animateIcon: !1, size: "small" }) }),
954
- C ? l?.map((u, h) => /* @__PURE__ */ e.jsx(pt, { ...u, className: " border-b border-neutral-strong-default rounded-b-none last:border-b-0" }, h)) : /* @__PURE__ */ e.jsx("p", { className: " prometeo-fonts-body-medium text-neutral-default-hover text-center py-8", children: "No hay notificaciones" })
983
+ r && w && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(fe, { onClick: r, label: "Marcar todas como leidas", variant: "text", animate: !1, animateIcon: !1, size: "small" }) }),
984
+ w ? l?.map((u, N) => /* @__PURE__ */ e.jsx(jt, { ...u, className: " border-b border-neutral-strong-default rounded-b-none last:border-b-0" }, N)) : /* @__PURE__ */ e.jsx("p", { className: " prometeo-fonts-body-medium text-neutral-default-hover text-center py-8", children: "No hay notificaciones" })
955
985
  ] })
956
986
  ]
957
987
  }
958
988
  );
959
- }, Et = ({ onCloseClick: t, children: r, title: s = "Ayuda" }) => /* @__PURE__ */ e.jsxs(
989
+ }, Vt = ({ onCloseClick: t, children: r, title: s = "Ayuda" }) => /* @__PURE__ */ e.jsxs(
960
990
  "section",
961
991
  {
962
992
  className: "w-full md:w-[479px] bg-neutral-default-default border-l-0 md:border-l border-neutral-strong-default h-full",
963
993
  children: [
964
994
  /* @__PURE__ */ e.jsxs("div", { className: "w-full h-max flex gap-2 items-center justify-between pt-8 pb-2 pr-2 pl-4 border-b border-neutral-strong-default sticky top-0 z-50 bg-neutral-default-default", children: [
965
995
  /* @__PURE__ */ e.jsxs("span", { className: "flex gap-2 items-center", children: [
966
- /* @__PURE__ */ e.jsx(Ue, { className: "text-neutral-strong-default", size: 24 }),
996
+ /* @__PURE__ */ e.jsx(Ke, { className: "text-neutral-strong-default", size: 24 }),
967
997
  /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-headline-small text-neutral-strong-default", children: s })
968
998
  ] }),
969
- /* @__PURE__ */ e.jsx(fe, { onClick: () => t?.(), icon: /* @__PURE__ */ e.jsx(Be, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
999
+ /* @__PURE__ */ e.jsx(fe, { onClick: () => t?.(), icon: /* @__PURE__ */ e.jsx(Ie, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
970
1000
  ] }),
971
1001
  /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-3 pb-8 pt-4 px-4", children: r })
972
1002
  ]
973
1003
  }
974
- ), Pt = ({ closeSidebar: t, options: r, helpSection: s, initialSection: l, notificationsListControls: d }, o) => {
975
- const [i, p] = te(l ?? "notifications");
976
- De(o, () => ({
977
- setActiveSection: p
1004
+ ), Wt = ({ closeSidebar: t, options: r, helpSection: s, initialSection: l, notificationsListControls: i }, n) => {
1005
+ const [c, m] = Z(l ?? "notifications");
1006
+ Le(n, () => ({
1007
+ setActiveSection: m
978
1008
  }));
979
- const c = () => {
1009
+ const d = () => {
980
1010
  t();
981
1011
  };
982
1012
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
983
- i === "notifications" && !r?.notificationsDrawerOptions?.hide && /* @__PURE__ */ e.jsx(
984
- Tt,
1013
+ c === "notifications" && !r?.notificationsDrawerOptions?.hide && /* @__PURE__ */ e.jsx(
1014
+ Ht,
985
1015
  {
986
- onCloseClick: c,
1016
+ onCloseClick: d,
987
1017
  onMarkAllAsRead: r?.notificationsDrawerOptions?.onMarkAllAsRead,
988
- notificationsListControls: d
1018
+ notificationsListControls: i
989
1019
  }
990
1020
  ),
991
- i === "help" && s && !r?.helpSectionDrawerOptions?.hide && /* @__PURE__ */ e.jsx(Et, { onCloseClick: c, children: typeof s == "function" ? s() : s })
1021
+ c === "help" && s && !r?.helpSectionDrawerOptions?.hide && /* @__PURE__ */ e.jsx(Vt, { onCloseClick: d, children: typeof s == "function" ? s() : s })
992
1022
  ] });
993
- }, tt = he(Pt);
994
- tt.displayName = "SidebarContent";
995
- const _t = ({
1023
+ }, it = Ne(Wt);
1024
+ it.displayName = "SidebarContent";
1025
+ const $t = ({
996
1026
  options: t,
997
1027
  helpSection: r,
998
1028
  sidebarContentRef: s,
999
1029
  initialSectionRef: l,
1000
- notificationsListControls: d
1030
+ notificationsListControls: i
1001
1031
  }) => {
1002
- const { closeSidebar: o } = re();
1032
+ const { closeSidebar: n } = ie();
1003
1033
  return /* @__PURE__ */ e.jsx(
1004
- tt,
1034
+ it,
1005
1035
  {
1006
1036
  ref: s,
1007
- closeSidebar: o,
1037
+ closeSidebar: n,
1008
1038
  options: t,
1009
1039
  helpSection: r,
1010
1040
  initialSection: l.current,
1011
- notificationsListControls: d
1041
+ notificationsListControls: i
1012
1042
  }
1013
1043
  );
1014
- }, rt = L(_t);
1015
- rt.displayName = "PyrionNavigationDrawer.Sidebar";
1016
- const Rt = ({ navigationControlsRef: t }) => {
1017
- const r = re();
1044
+ }, ct = T($t);
1045
+ ct.displayName = "PyrionNavigationDrawer.Sidebar";
1046
+ const qt = ({ navigationControlsRef: t }) => {
1047
+ const r = ie();
1018
1048
  return t.current.toggleCollapse = r.toggleCollapse, t.current.getIsCollapsed = r.getIsCollapsed, t.current.subscribeToCollapse = r.subscribeToCollapse, t.current.openSidebar = r.openSidebar, t.current.closeSidebar = r.closeSidebar, t.current.toggleSidebar = r.toggleSidebar, t.current.getIsSidebarOpen = r.getIsSidebarOpen, t.current.subscribeToSidebarOpen = r.subscribeToSidebarOpen, t.current.setDrawerDragEnabled = r.setDrawerDragEnabled, t.current.setSidebarDragEnabled = r.setSidebarDragEnabled, null;
1019
- }, Ft = (t) => {
1020
- const { children: r, currentAppSessions: s, resolveUserSecondarySlot: l, resolveSessionSecondarySlot: d, handleNavigation: o, allActions: i, tabs: p, navigationControlsRef: c, sidebarContentRef: x, initialSectionRef: b, userOptionsControls: C, mobileAppSwitcherControls: u, notificationsListControls: h, outletRef: N, ...m } = t;
1021
- return /* @__PURE__ */ e.jsxs(U, { disableDragOpen: m.options?.disableDragOpen, children: [
1022
- /* @__PURE__ */ e.jsx(Rt, { navigationControlsRef: c }),
1023
- /* @__PURE__ */ e.jsx(U.Header, { className: "flex flex-col relative w-full select-none", children: /* @__PURE__ */ e.jsx(
1024
- et,
1049
+ }, Kt = (t) => {
1050
+ const { children: r, currentAppSessions: s, resolveUserSecondarySlot: l, resolveSessionSecondarySlot: i, handleNavigation: n, allActions: c, tabs: m, navigationControlsRef: d, sidebarContentRef: h, initialSectionRef: b, userOptionsControls: w, mobileAppSwitcherControls: u, notificationsListControls: N, outletRef: y, ...f } = t;
1051
+ return /* @__PURE__ */ e.jsxs(q, { disableDragOpen: f.options?.disableDragOpen, outletRef: y, children: [
1052
+ /* @__PURE__ */ e.jsx(qt, { navigationControlsRef: d }),
1053
+ /* @__PURE__ */ e.jsx(q.Header, { className: "flex flex-col relative w-full select-none", children: /* @__PURE__ */ e.jsx(
1054
+ lt,
1025
1055
  {
1026
- onSystemLogoClick: m.onSystemLogoClick,
1027
- state: m.state,
1028
- currentSystemId: m.currentSystemId,
1029
- tabs: p,
1056
+ onSystemLogoClick: f.onSystemLogoClick,
1057
+ state: f.state,
1058
+ currentSystemId: f.currentSystemId,
1059
+ tabs: m,
1030
1060
  mobileAppSwitcherControls: u
1031
1061
  }
1032
1062
  ) }, "PL-Header"),
1033
- /* @__PURE__ */ e.jsx(U.Content, { className: "overflow-hidden flex flex-col relative flex-1 w-[285px] md:w-auto", children: /* @__PURE__ */ e.jsx(
1034
- Xe,
1063
+ /* @__PURE__ */ e.jsx(q.Content, { className: "overflow-hidden flex flex-col relative flex-1 w-[285px] md:w-auto", children: /* @__PURE__ */ e.jsx(
1064
+ at,
1035
1065
  {
1036
- navlinks: m.links,
1037
- handleNavigation: o,
1038
- allActions: i,
1039
- activeActionId: m.activeActionId,
1040
- onActionClick: m.onActionClick
1066
+ navlinks: f.links,
1067
+ handleNavigation: n,
1068
+ allActions: c,
1069
+ activeActionId: f.activeActionId,
1070
+ onActionClick: f.onActionClick
1041
1071
  }
1042
1072
  ) }, "PL-Content"),
1043
- /* @__PURE__ */ e.jsx(U.Footer, { className: "md:min-h-max flex flex-col w-full overflow-hidden max-w-full", children: /* @__PURE__ */ e.jsx(
1044
- Ze,
1073
+ /* @__PURE__ */ e.jsx(q.Footer, { className: "md:min-h-max flex flex-col w-full overflow-hidden max-w-full", children: /* @__PURE__ */ e.jsx(
1074
+ ot,
1045
1075
  {
1046
- state: m.state,
1076
+ state: f.state,
1047
1077
  currentAppSessions: s,
1048
1078
  resolveUserSecondarySlot: l,
1049
- resolveSessionSecondarySlot: d,
1050
- onSessionClick: m.onSessionClick,
1051
- onLogoutClick: m.onLogoutClick,
1052
- options: m.options,
1053
- currentSystemId: m.currentSystemId,
1054
- userOptionsControls: C,
1055
- mobileAppSwitcherControls: u
1079
+ resolveSessionSecondarySlot: i,
1080
+ onSessionClick: f.onSessionClick,
1081
+ onLogoutClick: f.onLogoutClick,
1082
+ options: f.options,
1083
+ currentSystemId: f.currentSystemId,
1084
+ userOptionsControls: w,
1085
+ mobileAppSwitcherControls: u,
1086
+ onProfileClick: f.onProfileClick
1056
1087
  }
1057
1088
  ) }, "PL-Footer"),
1058
- /* @__PURE__ */ e.jsx(U.Outlet, { ref: N, children: /* @__PURE__ */ e.jsx(st, { children: r }) }),
1089
+ /* @__PURE__ */ e.jsx(q.Outlet, { children: /* @__PURE__ */ e.jsx(dt, { children: r }) }),
1059
1090
  /* @__PURE__ */ e.jsx(
1060
- U.Sidebar,
1091
+ q.Sidebar,
1061
1092
  {
1062
1093
  className: "bg-neutral-default-default",
1063
- modal: m.options?.sidebarOptions?.modal,
1064
- closeOnOverlayClick: m.options?.sidebarOptions?.closeOnOverlayClick,
1094
+ modal: f.options?.sidebarOptions?.modal,
1095
+ closeOnOverlayClick: f.options?.sidebarOptions?.closeOnOverlayClick,
1065
1096
  children: /* @__PURE__ */ e.jsx(
1066
- rt,
1097
+ ct,
1067
1098
  {
1068
- options: m.options,
1069
- helpSection: m.helpSection,
1070
- sidebarContentRef: x,
1099
+ options: f.options,
1100
+ helpSection: f.helpSection,
1101
+ sidebarContentRef: h,
1071
1102
  initialSectionRef: b,
1072
- notificationsListControls: h
1103
+ notificationsListControls: N
1073
1104
  }
1074
1105
  )
1075
1106
  }
1076
1107
  )
1077
1108
  ] });
1078
- }, je = L(Ft, (t, r) => {
1079
- const { children: s, ...l } = t, { children: d, ...o } = r, i = Object.keys(l), p = Object.keys(o);
1080
- if (i.length !== p.length)
1109
+ }, Ae = T(Kt, (t, r) => {
1110
+ const { children: s, ...l } = t, { children: i, ...n } = r, c = Object.keys(l), m = Object.keys(n);
1111
+ if (c.length !== m.length)
1081
1112
  return !1;
1082
- for (const c of i) {
1083
- if (!Object.prototype.hasOwnProperty.call(o, c))
1113
+ for (const d of c) {
1114
+ if (!Object.prototype.hasOwnProperty.call(n, d))
1084
1115
  return !1;
1085
- const x = l[c], b = o[c];
1086
- if (x !== b)
1116
+ const h = l[d], b = n[d];
1117
+ if (h !== b)
1087
1118
  return !1;
1088
1119
  }
1089
1120
  return !0;
1090
1121
  });
1091
- je.displayName = "PyrionNavigationDrawer.LayoutBase";
1092
- const st = L(({ children: t }) => /* @__PURE__ */ e.jsx(U.Outlet, { children: t }));
1093
- st.displayName = "PyrionNavigationDrawer.IsolatedOutlet";
1094
- const nt = ke(null), ar = () => {
1095
- const t = Se(nt);
1122
+ Ae.displayName = "PyrionNavigationDrawer.LayoutBase";
1123
+ const dt = T(({ children: t }) => /* @__PURE__ */ e.jsx(q.Outlet, { children: t }));
1124
+ dt.displayName = "PyrionNavigationDrawer.IsolatedOutlet";
1125
+ const ut = Oe(null), br = () => {
1126
+ const t = pt(ut);
1096
1127
  if (!t)
1097
1128
  throw new Error("usePyrionNavigation debe usarse dentro de PyrionNavigationDrawer");
1098
1129
  return t;
1099
- }, or = ({ children: t, helpSection: r, state: s, links: l, onLinkClick: d, onNavigate: o, onLogoutClick: i, actions: p, activeActionId: c, onActionClick: x, tabsProps: b, currentSystemId: C, onSessionClick: u, options: h, onSystemLogoClick: N }) => {
1100
- const m = lt(), P = Fe(), k = O(null), j = O({}), R = O(null), T = O("notifications"), F = O(null), H = O(null), M = O(null), [W, Q] = te(0), _ = g((a) => {
1101
- if (d) {
1102
- d(a);
1130
+ }, xr = ({ children: t, helpSection: r, state: s, links: l, onLinkClick: i, onNavigate: n, onLogoutClick: c, actions: m, activeActionId: d, onActionClick: h, tabsProps: b, currentSystemId: w, onSessionClick: u, onSystemLogoClick: N, onProfileClick: y, ...f }) => {
1131
+ const D = Object.assign({
1132
+ closeDrawerOnNavigate: !0,
1133
+ disableDragOpen: {
1134
+ sidebar: !0,
1135
+ drawer: !1
1136
+ }
1137
+ }, f.options), P = bt(), R = We(), k = I(null), j = I({}), K = I(null), Y = I("notifications"), J = I(null), te = I(null), H = I(null), [M, E] = Z(0), [V, W] = Z(!1), [re, ne] = Z(null), se = x((a) => {
1138
+ if (W(!1), i) {
1139
+ i(a);
1103
1140
  return;
1104
1141
  }
1105
1142
  const v = window.location.pathname;
1106
- m(a), o && o(v, a);
1107
- }, [d, o, m]), I = (a) => {
1143
+ P(a), D.closeDrawerOnNavigate && ft() && !j.current?.getIsCollapsed?.() && j.current?.toggleCollapse?.(), n && n(v, a);
1144
+ }, [i, n, P]), ce = (a) => {
1108
1145
  a && window.open(a, "_blank");
1109
- }, J = {
1146
+ }, pe = {
1110
1147
  system: {
1111
- mobile: I,
1148
+ mobile: ce,
1112
1149
  desktop: (a) => {
1113
1150
  typeof window < "u" && a && (window.location.href = a);
1114
1151
  }
1115
1152
  },
1116
1153
  product: {
1117
- mobile: I,
1118
- desktop: I
1154
+ mobile: ce,
1155
+ desktop: ce
1119
1156
  }
1120
- }, K = g((a) => {
1121
- const v = P ? "mobile" : "desktop", S = s.enabled_systems.find((y) => y.name === a)?.url;
1122
- J.system[v](S), b?.onTabClick?.(a);
1123
- }, [P, s.enabled_systems, b?.onTabClick]), G = g((a) => {
1124
- const v = P ? "mobile" : "desktop", S = s.company.products?.find((y) => y.name === a)?.domain;
1125
- J.product[v](S), b?.onTabClick?.(a);
1126
- }, [P, s.company.products, b?.onTabClick]), X = g((a, v) => {
1157
+ }, Me = x((a) => {
1158
+ const v = R ? "mobile" : "desktop", L = s.enabled_systems.find((C) => C.name === a)?.url;
1159
+ pe.system[v](L), b?.onTabClick?.(a);
1160
+ }, [R, s.enabled_systems, b?.onTabClick]), ae = x((a) => {
1161
+ const v = R ? "mobile" : "desktop", L = s.company.products?.find((C) => C.name === a)?.domain;
1162
+ pe.product[v](L), b?.onTabClick?.(a);
1163
+ }, [R, s.company.products, b?.onTabClick]), Be = x((a, v) => {
1127
1164
  if (v) {
1128
1165
  v(a), b?.onTabClick?.(a);
1129
1166
  return;
1130
1167
  } else
1131
1168
  b?.onTabClick?.(a);
1132
- }, [b?.onTabClick]), Z = g(() => {
1169
+ }, [b?.onTabClick]), Ce = x(() => {
1133
1170
  const a = {};
1134
- s.enabled_systems.forEach((S) => {
1135
- a[S.url] = S.name;
1171
+ s.enabled_systems.forEach((L) => {
1172
+ a[L.url] = L.name;
1136
1173
  });
1137
1174
  const v = window.location.origin;
1138
- for (const [S, y] of Object.entries(a))
1139
- if (v === S)
1140
- return y;
1175
+ for (const [L, C] of Object.entries(a))
1176
+ if (v === L)
1177
+ return C;
1141
1178
  return "";
1142
- }, [s.enabled_systems]), xe = b?.currentTabName || Z(), oe = ne(
1179
+ }, [s.enabled_systems]), je = b?.currentTabName || Ce(), G = ue(
1143
1180
  () => s.sessions || [],
1144
1181
  [s.sessions]
1145
- ), ee = (a) => a == null ? null : typeof a == "string" || typeof a == "number" || typeof a == "boolean" ? String(a) : ue(a) ? a : typeof a == "object" ? JSON.stringify(a) : null, se = g((a, v) => {
1182
+ ), oe = (a) => a == null ? null : typeof a == "string" || typeof a == "number" || typeof a == "boolean" ? String(a) : ge(a) ? a : typeof a == "object" ? JSON.stringify(a) : null, o = x((a, v) => {
1146
1183
  if (!a) return null;
1147
1184
  if (Array.isArray(a)) {
1148
- const S = a?.[0] ? de(v, a[0]) : null, y = a?.[1] ? de(v, a[1]) : null, z = ee(S), ce = ee(y);
1185
+ const L = a?.[0] ? xe(v, a[0]) : null, C = a?.[1] ? xe(v, a[1]) : null, z = oe(L), de = oe(C);
1149
1186
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1150
1187
  /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-break-spaces min-w-1/2", children: z }),
1151
- ce && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 flex-1 grow shrink-0 min-w-[40%] overflow-hidden", children: [
1188
+ de && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 flex-1 grow shrink-0 min-w-[40%] overflow-hidden", children: [
1152
1189
  /* @__PURE__ */ e.jsx("span", { className: "size-0.5 bg-[--neutral-300] rounded-full" }),
1153
- /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-pre text-ellipsis", children: ce })
1190
+ /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-pre text-ellipsis", children: de })
1154
1191
  ] })
1155
1192
  ] });
1156
1193
  }
1157
1194
  if (typeof a == "string") {
1158
- const S = de(v, a);
1159
- return ee(S);
1195
+ const L = xe(v, a);
1196
+ return oe(L);
1160
1197
  }
1161
- return typeof a == "function" ? ee(a(v)) : null;
1162
- }, []), Y = g(
1198
+ return typeof a == "function" ? oe(a(v)) : null;
1199
+ }, []), p = x(
1163
1200
  (a) => {
1164
- const v = h?.userCardOptions?.secondarySlot;
1201
+ const v = D?.userCardOptions?.secondarySlot;
1165
1202
  if (!v) return null;
1166
- const S = s.enabled_systems?.find((z) => z._id === C), y = { company: s.company, user: s.user, system: S, metadata: a };
1167
- return se(v, y);
1203
+ const L = s.enabled_systems?.find((z) => z._id === w), C = { company: s.company, user: s.user, system: L, metadata: a };
1204
+ return o(v, C);
1168
1205
  },
1169
- [C, h?.userCardOptions?.secondarySlot, se, s.company, s.enabled_systems, s.user]
1170
- ), ge = g(
1206
+ [w, D?.userCardOptions?.secondarySlot, o, s.company, s.enabled_systems, s.user]
1207
+ ), g = x(
1171
1208
  (a) => {
1172
- const v = h?.sessionCardOptions?.secondarySlot || h?.userCardOptions?.secondarySlot;
1209
+ const v = D?.sessionCardOptions?.secondarySlot || D?.userCardOptions?.secondarySlot;
1173
1210
  if (!v) return null;
1174
- const S = s.enabled_systems?.find((z) => z._id === C), y = { company: s.company, user: a.auth_id, metadata: a?.metadata, system: S };
1175
- return se(v, y);
1211
+ const L = s.enabled_systems?.find((z) => z._id === w), C = { company: s.company, user: a.auth_id, metadata: a?.metadata, system: L };
1212
+ return o(v, C);
1176
1213
  },
1177
- [C, h?.sessionCardOptions?.secondarySlot, h?.userCardOptions?.secondarySlot, se, s.company]
1178
- ), le = ne(() => {
1214
+ [w, D?.sessionCardOptions?.secondarySlot, D?.userCardOptions?.secondarySlot, o, s.company]
1215
+ ), O = ue(() => {
1179
1216
  const a = [];
1180
1217
  return j.current.openNotifications = () => {
1181
- T.current = "notifications", j.current.openSidebar?.(), R.current?.setActiveSection("notifications");
1218
+ Y.current = "notifications", j.current.openSidebar?.(), K.current?.setActiveSection("notifications");
1182
1219
  }, j.current.openHelp = () => {
1183
- T.current = "help", j.current.openSidebar?.(), R.current?.setActiveSection("help");
1184
- }, !h?.notificationsDrawerOptions?.hideActionButton && !h?.notificationsDrawerOptions?.hide && a.push({
1220
+ Y.current = "help", j.current.openSidebar?.(), K.current?.setActiveSection("help");
1221
+ }, !D?.notificationsDrawerOptions?.hideActionButton && !D?.notificationsDrawerOptions?.hide && a.push({
1185
1222
  id: "notifications",
1186
1223
  title: "Notificaciones",
1187
- icon: Me,
1224
+ icon: qe,
1188
1225
  onClick: j.current.openNotifications,
1189
- count: W
1190
- }), !h?.helpSectionDrawerOptions?.hideActionButton && r && !h?.helpSectionDrawerOptions?.hide && a.push({
1226
+ count: M
1227
+ }), !D?.helpSectionDrawerOptions?.hideActionButton && r && !D?.helpSectionDrawerOptions?.hide && a.push({
1191
1228
  id: "help",
1192
1229
  title: "Ayuda",
1193
- icon: Ue,
1230
+ icon: Ke,
1194
1231
  onClick: j.current.openHelp
1195
- }), h?.configurationActionOptions?.onClick && !h?.configurationActionOptions?.hideActionButton && a.push({
1232
+ }), D?.configurationActionOptions?.onClick && !D?.configurationActionOptions?.hideActionButton && a.push({
1196
1233
  id: "configuration",
1197
1234
  title: "Configuracion",
1198
- icon: ht,
1199
- onClick: h.configurationActionOptions?.onClick
1235
+ icon: St,
1236
+ onClick: D.configurationActionOptions?.onClick
1200
1237
  }), a;
1201
- }, [h, r, x, W]), ie = ne(
1202
- () => [...le, ...p || []],
1203
- [le, p]
1204
- ), B = ne(() => {
1205
- const a = s.enabled_systems.map((y) => ({
1206
- name: y.name,
1207
- thumbnail: y.thumbnail,
1208
- onClick: K
1209
- })) || [], v = b?.customTabs?.map((y) => ({
1210
- ...y,
1211
- onClick: () => X(y.name, y?.onClick)
1212
- })) || [], S = s.company.products?.map((y) => ({
1213
- name: y.name,
1214
- thumbnail: y.thumbnail,
1215
- onClick: G
1238
+ }, [D, r, h, M]), B = ue(
1239
+ () => [...O, ...m || []],
1240
+ [O, m]
1241
+ ), _ = ue(() => {
1242
+ const a = s.enabled_systems.map((C) => ({
1243
+ name: C.name,
1244
+ thumbnail: C.thumbnail,
1245
+ onClick: Me,
1246
+ id: C._id
1247
+ })) || [], v = b?.customTabs?.map((C) => ({
1248
+ ...C,
1249
+ onClick: () => Be(C.name, C?.onClick)
1250
+ })) || [], L = s.company.products?.map((C) => ({
1251
+ name: C.name,
1252
+ thumbnail: C.thumbnail,
1253
+ onClick: ae
1216
1254
  })) || [];
1217
- return [...a, ...v, ...S];
1218
- }, [s.enabled_systems, s.company.products, b?.customTabs]), we = g((a) => {
1255
+ return [...a, ...v, ...L];
1256
+ }, [s.enabled_systems, s.company.products, b?.customTabs]), Q = x((a) => {
1219
1257
  k.current?.addNewNotification ? k.current.addNewNotification(a) : console.warn("Notifications controls not ready yet");
1220
- }, []), n = g((a) => k.current?.subscribeToUpdates ? k.current.subscribeToUpdates(a) : (console.warn("Notifications controls not ready yet"), () => {
1221
- }), []), f = g((a) => {
1258
+ }, []), $ = x((a) => k.current?.subscribeToUpdates ? k.current.subscribeToUpdates(a) : (console.warn("Notifications controls not ready yet"), () => {
1259
+ }), []), le = x((a) => {
1222
1260
  k.current?.removeNotification ? k.current.removeNotification(a) : console.warn("Notifications controls not ready yet");
1223
- }, []), w = g(() => {
1261
+ }, []), he = x(() => {
1224
1262
  k.current?.removeAllNotifications ? k.current.removeAllNotifications() : console.warn("Notifications controls not ready yet");
1225
- }, []), D = g((a) => {
1263
+ }, []), be = x((a) => {
1226
1264
  k.current?.setNotifications ? k.current.setNotifications(a) : console.warn("Notifications controls not ready yet");
1227
- }, []), E = g((a) => {
1228
- console.log("Show error modal", { disableDrawer: a });
1229
- const v = /* @__PURE__ */ e.jsx("div", { className: "bg-red-800 rounded fixed z-200 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 h-[40vh] w-[40vw]", children: /* @__PURE__ */ e.jsx("p", { className: "text-red-700", children: "Error occurred" }) });
1230
- return a ? (console.log(document.body), Ee(v, document.body)) : (console.log(M.current, "outlet ref"), Ee(v, M.current));
1231
- }, [M]);
1232
- return j.current.addNewNotification = we, j.current.subscribeToNotificationsUpdates = n, j.current.removeNotification = f, j.current.removeAllNotifications = w, j.current.setNotifications = D, j.current.showErrorModal = E, V(() => {
1233
- n((a, v) => {
1234
- Q(v);
1265
+ }, []), S = x((a, v, L) => {
1266
+ const C = /* @__PURE__ */ e.jsxs("div", { className: A(" bg-black/60 z-200 inset-0 h-full w-full grid place-items-center text-neutral-default-default", v ? "fixed" : "sticky"), children: [
1267
+ !L && /* @__PURE__ */ e.jsx(fe, { label: "", icon: /* @__PURE__ */ e.jsx(Ie, {}), onClick: () => W(!1), variant: "text", className: "absolute top-0 right-0", size: "small", color: "secondary" }),
1268
+ typeof a == "function" ? a() : a
1269
+ ] });
1270
+ let z;
1271
+ return v ? z = ze(C, document.body, `modal-error-${Date.now()}`) : H.current && (z = ze(C, H.current, `modal-error-${Date.now()}`)), ne(z), W(!0), C;
1272
+ }, [H]), U = x(() => {
1273
+ W(!1);
1274
+ }, []);
1275
+ return j.current.addNewNotification = Q, j.current.subscribeToNotificationsUpdates = $, j.current.removeNotification = le, j.current.removeAllNotifications = he, j.current.setNotifications = be, j.current.showErrorModal = S, j.current.closeErrorModal = U, X(() => {
1276
+ $((a, v) => {
1277
+ E(v);
1235
1278
  });
1236
- }, [n]), /* @__PURE__ */ e.jsx(nt.Provider, { value: j.current, children: P ? /* @__PURE__ */ e.jsx("div", { className: "flex h-screen", children: /* @__PURE__ */ e.jsx(
1237
- je,
1238
- {
1239
- links: l,
1240
- handleNavigation: _,
1241
- allActions: ie,
1242
- activeActionId: c,
1243
- onActionClick: x,
1244
- state: s,
1245
- currentAppSessions: oe,
1246
- resolveUserSecondarySlot: Y,
1247
- resolveSessionSecondarySlot: ge,
1248
- onSessionClick: u,
1249
- onLogoutClick: i,
1250
- options: h,
1251
- currentSystemId: C,
1252
- userOptionsControls: F,
1253
- mobileAppSwitcherControls: H,
1254
- onSystemLogoClick: N,
1255
- tabs: B,
1256
- helpSection: r,
1257
- sidebarContentRef: R,
1258
- initialSectionRef: T,
1259
- navigationControlsRef: j,
1260
- notificationsListControls: k,
1261
- outletRef: M,
1262
- children: t
1263
- }
1264
- ) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex h-screen", children: [
1265
- B.length > 0 && /* @__PURE__ */ e.jsx(
1266
- ct,
1267
- {
1268
- className: "hidden md:flex",
1269
- tabs: B,
1270
- activeColor: "var(--neutral-900)",
1271
- currentTabName: xe
1272
- }
1273
- ),
1274
- /* @__PURE__ */ e.jsx(
1275
- je,
1279
+ }, [$]), /* @__PURE__ */ e.jsxs(ut.Provider, { value: j.current, children: [
1280
+ V && re,
1281
+ R ? /* @__PURE__ */ e.jsx("div", { className: "flex h-screen", children: /* @__PURE__ */ e.jsx(
1282
+ Ae,
1276
1283
  {
1277
1284
  links: l,
1278
- handleNavigation: _,
1279
- allActions: ie,
1280
- activeActionId: c,
1281
- onActionClick: x,
1285
+ handleNavigation: se,
1286
+ allActions: B,
1287
+ activeActionId: d,
1288
+ onActionClick: h,
1282
1289
  state: s,
1283
- currentAppSessions: oe,
1284
- resolveUserSecondarySlot: Y,
1285
- resolveSessionSecondarySlot: ge,
1290
+ currentAppSessions: G,
1291
+ resolveUserSecondarySlot: p,
1292
+ resolveSessionSecondarySlot: g,
1286
1293
  onSessionClick: u,
1287
- onLogoutClick: i,
1288
- options: h,
1289
- currentSystemId: C,
1290
- userOptionsControls: F,
1291
- mobileAppSwitcherControls: H,
1294
+ onLogoutClick: c,
1295
+ options: D,
1296
+ currentSystemId: w,
1297
+ userOptionsControls: J,
1298
+ mobileAppSwitcherControls: te,
1292
1299
  onSystemLogoClick: N,
1293
- tabs: B,
1300
+ tabs: _,
1294
1301
  helpSection: r,
1295
- sidebarContentRef: R,
1296
- initialSectionRef: T,
1302
+ sidebarContentRef: K,
1303
+ initialSectionRef: Y,
1297
1304
  navigationControlsRef: j,
1298
1305
  notificationsListControls: k,
1299
- outletRef: M,
1306
+ outletRef: H,
1307
+ onProfileClick: y,
1300
1308
  children: t
1301
1309
  }
1302
- )
1303
- ] }) });
1310
+ ) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex h-screen", children: [
1311
+ _.length > 0 && /* @__PURE__ */ e.jsx(
1312
+ gt,
1313
+ {
1314
+ className: "hidden md:flex",
1315
+ tabs: _,
1316
+ activeColor: "var(--neutral-900)",
1317
+ currentTabName: je,
1318
+ currentSystemId: w
1319
+ }
1320
+ ),
1321
+ /* @__PURE__ */ e.jsx(
1322
+ Ae,
1323
+ {
1324
+ links: l,
1325
+ handleNavigation: se,
1326
+ allActions: B,
1327
+ activeActionId: d,
1328
+ onActionClick: h,
1329
+ state: s,
1330
+ currentAppSessions: G,
1331
+ resolveUserSecondarySlot: p,
1332
+ resolveSessionSecondarySlot: g,
1333
+ onSessionClick: u,
1334
+ onLogoutClick: c,
1335
+ options: D,
1336
+ currentSystemId: w,
1337
+ userOptionsControls: J,
1338
+ mobileAppSwitcherControls: te,
1339
+ onSystemLogoClick: N,
1340
+ tabs: _,
1341
+ helpSection: r,
1342
+ sidebarContentRef: K,
1343
+ initialSectionRef: Y,
1344
+ navigationControlsRef: j,
1345
+ notificationsListControls: k,
1346
+ outletRef: H,
1347
+ onProfileClick: y,
1348
+ children: t
1349
+ }
1350
+ )
1351
+ ] })
1352
+ ] });
1304
1353
  };
1305
1354
  export {
1306
- or as default,
1307
- ar as u
1355
+ xr as default,
1356
+ br as u
1308
1357
  };