prometeo-design-system 4.7.4 → 4.7.6

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