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