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