@scmlatam/web-ui 0.2.47 → 0.2.50
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/src/rb-components/timeline/BoundaryDot.d.ts +2 -1
- package/dist/src/rb-components/timeline/BoundaryDot.test.d.ts +1 -0
- package/dist/src/rb-components/timeline/Timeline.d.ts +1 -1
- package/dist/src/rb-components/timeline/timeline.types.d.ts +2 -0
- package/dist/src/rb-components/timeline/timelineLayout.d.ts +2 -1
- package/dist/web-ui.js +108 -97
- package/dist/web-ui.umd.cjs +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
2
|
import { Dayjs } from 'dayjs';
|
|
3
3
|
import { ResolvedBoundary } from './timeline.types';
|
|
4
4
|
interface BoundaryDotProps {
|
|
@@ -13,5 +13,6 @@ interface BoundaryDotProps {
|
|
|
13
13
|
onDateChange?: (date: Dayjs) => void;
|
|
14
14
|
onClick?: (anchorEl: HTMLElement) => void;
|
|
15
15
|
}
|
|
16
|
+
export declare function getBoundaryDotStyle(color: string): CSSProperties;
|
|
16
17
|
export declare function BoundaryDot({ boundary, isEdge, color, tooltip, editable, minDate, maxDate, align, onDateChange, onClick, }: BoundaryDotProps): React.JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TimelineProps } from './timeline.types';
|
|
2
|
-
export declare function Timeline({ segments, mode, external_labels, legend, compactRange, tooltips, startBoundary, endBoundary, colors, formatDate, segmentTooltip, boundaryTooltip, onSegmentClick, onBoundaryClick, allowGaps, scale, editableBoundaries, exclusiveEnd, indefiniteDate, indefiniteLabel, onBoundaryDateChange, className, }: TimelineProps): import("react").JSX.Element | null;
|
|
2
|
+
export declare function Timeline({ segments, mode, external_labels, legend, compactRange, tooltips, startBoundary, endBoundary, colors, formatDate, segmentTooltip, boundaryTooltip, onSegmentClick, onBoundaryClick, allowGaps, mergeAdjacentBoundaries, scale, editableBoundaries, exclusiveEnd, indefiniteDate, indefiniteLabel, onBoundaryDateChange, className, }: TimelineProps): import("react").JSX.Element | null;
|
|
3
3
|
export default Timeline;
|
|
@@ -81,6 +81,8 @@ export interface TimelineProps {
|
|
|
81
81
|
onBoundaryClick?: (args: TimelineBoundaryClickArgs) => void;
|
|
82
82
|
className?: string;
|
|
83
83
|
allowGaps?: boolean;
|
|
84
|
+
/** Si dos tramos son contiguos por 1 día, usa un único punto compartido entre ambos. */
|
|
85
|
+
mergeAdjacentBoundaries?: boolean;
|
|
84
86
|
/**
|
|
85
87
|
* `"equal"` reparte el ancho por igual entre tramos; `"proportional"` lo
|
|
86
88
|
* calcula según la duración real de cada uno.
|
|
@@ -8,9 +8,10 @@ export interface BuildSlotsOptions {
|
|
|
8
8
|
startDate: Dayjs;
|
|
9
9
|
endDate: Dayjs;
|
|
10
10
|
};
|
|
11
|
+
mergeAdjacentBoundaries?: boolean;
|
|
11
12
|
}
|
|
12
13
|
export declare function buildSlots(segments: TimelineSegment[], allowGaps: boolean, options?: BuildSlotsOptions): TimelineSlot[];
|
|
13
|
-
export declare function buildBoundaries(segments: TimelineSegment[], segmentSlots: TimelineSlot[], allowGaps: boolean): ResolvedBoundary[];
|
|
14
|
+
export declare function buildBoundaries(segments: TimelineSegment[], segmentSlots: TimelineSlot[], allowGaps: boolean, mergeAdjacentBoundaries?: boolean): ResolvedBoundary[];
|
|
14
15
|
export declare function boundaryBounds(boundary: ResolvedBoundary, segments: TimelineSegment[], allowGaps: boolean, exclusiveEnd?: boolean): {
|
|
15
16
|
min: Dayjs | null;
|
|
16
17
|
max: Dayjs | null;
|
package/dist/web-ui.js
CHANGED
|
@@ -18459,9 +18459,8 @@ var JE = (e) => /* @__PURE__ */ W(VE, { ...e }), YE = ({ sidebar: e, routes: t,
|
|
|
18459
18459
|
},
|
|
18460
18460
|
color: "gr-yellow"
|
|
18461
18461
|
})
|
|
18462
|
-
}), $E(t).
|
|
18463
|
-
let n = e.items.some((e) => `${e.label} ${e.sublabel ?? ""}`.toLowerCase().includes(v.toLowerCase()))
|
|
18464
|
-
return /* @__PURE__ */ G(le, { children: [e.group ? /* @__PURE__ */ W(F, {
|
|
18462
|
+
}), $E(t).flatMap((e, t) => {
|
|
18463
|
+
let n = e.items.some((e) => `${e.label} ${e.sublabel ?? ""}`.toLowerCase().includes(v.toLowerCase())), r = e.group ? /* @__PURE__ */ W(F, {
|
|
18465
18464
|
disableSticky: !0,
|
|
18466
18465
|
sx: {
|
|
18467
18466
|
display: n ? "block" : "none",
|
|
@@ -18470,18 +18469,19 @@ var JE = (e) => /* @__PURE__ */ W(VE, { ...e }), YE = ({ sidebar: e, routes: t,
|
|
|
18470
18469
|
fontWeight: 600
|
|
18471
18470
|
},
|
|
18472
18471
|
children: e.group
|
|
18473
|
-
}) : null, e.items.map((
|
|
18474
|
-
value:
|
|
18475
|
-
sx: { display: `${
|
|
18472
|
+
}, `group-${e.group}-${t}`) : null, i = e.items.map((t) => /* @__PURE__ */ W(L, {
|
|
18473
|
+
value: t.value,
|
|
18474
|
+
sx: { display: `${t.label} ${t.sublabel ?? ""}`.toLowerCase().includes(v.toLowerCase()) ? "block" : "none" },
|
|
18476
18475
|
onClick: () => {
|
|
18477
18476
|
h(!1);
|
|
18478
18477
|
},
|
|
18479
18478
|
children: /* @__PURE__ */ G(ae, {
|
|
18480
18479
|
variant: "caption",
|
|
18481
18480
|
color: "textSecondary",
|
|
18482
|
-
children: [
|
|
18481
|
+
children: [t.label, t.sublabel && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("br", {}), t.sublabel] })]
|
|
18483
18482
|
})
|
|
18484
|
-
},
|
|
18483
|
+
}, `${e.group ?? ""}-${t.value}`));
|
|
18484
|
+
return r ? [r, ...i] : i;
|
|
18485
18485
|
})]
|
|
18486
18486
|
})]
|
|
18487
18487
|
}) });
|
|
@@ -40035,7 +40035,14 @@ function WG({ segment: e, index: t, color: n, leftPct: r, tooltip: i, align: a =
|
|
|
40035
40035
|
}
|
|
40036
40036
|
//#endregion
|
|
40037
40037
|
//#region src/rb-components/timeline/BoundaryDot.tsx
|
|
40038
|
-
function GG(
|
|
40038
|
+
function GG(e) {
|
|
40039
|
+
return {
|
|
40040
|
+
backgroundColor: e,
|
|
40041
|
+
border: `0.125rem solid ${e}`,
|
|
40042
|
+
boxSizing: "border-box"
|
|
40043
|
+
};
|
|
40044
|
+
}
|
|
40045
|
+
function KG({ boundary: e, isEdge: t, color: n, tooltip: r, editable: i, minDate: a, maxDate: o, align: s = "center", onDateChange: c, onClick: l }) {
|
|
40039
40046
|
let { open: u, ready: d, close: f, toggle: p, position: m, anchorVars: h, triggerRef: g, panelRef: _ } = qC(), v = t ? "1.25rem" : "1rem", y = i || !!l, b = [];
|
|
40040
40047
|
a && b.push({ before: a.toDate() }), o && b.push({ after: o.toDate() });
|
|
40041
40048
|
let x = /* @__PURE__ */ W("button", {
|
|
@@ -40052,12 +40059,11 @@ function GG({ boundary: e, isEdge: t, color: n, tooltip: r, editable: i, minDate
|
|
|
40052
40059
|
}
|
|
40053
40060
|
l?.(e.currentTarget);
|
|
40054
40061
|
},
|
|
40055
|
-
className: Z("block rounded-full
|
|
40062
|
+
className: Z("block rounded-full transition-transform duration-150", y && "cursor-pointer hover:scale-110", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--ring)"),
|
|
40056
40063
|
style: {
|
|
40057
40064
|
width: v,
|
|
40058
40065
|
height: v,
|
|
40059
|
-
|
|
40060
|
-
boxSizing: "border-box"
|
|
40066
|
+
...GG(n)
|
|
40061
40067
|
}
|
|
40062
40068
|
}), S = i && u && d && typeof document < "u" ? Ae(/* @__PURE__ */ W("div", {
|
|
40063
40069
|
ref: _,
|
|
@@ -40092,8 +40098,8 @@ function GG({ boundary: e, isEdge: t, color: n, tooltip: r, editable: i, minDate
|
|
|
40092
40098
|
}
|
|
40093
40099
|
//#endregion
|
|
40094
40100
|
//#region src/rb-components/timeline/timelineLayout.ts
|
|
40095
|
-
var
|
|
40096
|
-
function
|
|
40101
|
+
var qG = .4, JG = .5, YG = .01;
|
|
40102
|
+
function XG(e, t, n) {
|
|
40097
40103
|
if (n) return {
|
|
40098
40104
|
start: n.startDate,
|
|
40099
40105
|
end: n.endDate
|
|
@@ -40109,36 +40115,36 @@ function YG(e, t, n) {
|
|
|
40109
40115
|
end: o.isAfter(s) ? o : s
|
|
40110
40116
|
};
|
|
40111
40117
|
}
|
|
40112
|
-
function
|
|
40113
|
-
let { start: r, end: i } =
|
|
40118
|
+
function ZG(e, t, n) {
|
|
40119
|
+
let { start: r, end: i } = XG(e, t, n), a = Math.max(1, i.diff(r, "day")), o = (e) => !!(t && e.isSame(t, "day")), s = (e) => {
|
|
40114
40120
|
if (o(e)) return 100;
|
|
40115
40121
|
let t = e.diff(r, "day");
|
|
40116
40122
|
return Math.max(0, Math.min(100, t / a * 100));
|
|
40117
40123
|
}, c = [], l = 0;
|
|
40118
40124
|
return e.forEach((e, t) => {
|
|
40119
40125
|
let n = Math.max(l, s(e.startDate)), r = s(e.endDate);
|
|
40120
|
-
n - l >
|
|
40126
|
+
n - l > YG && c.push({
|
|
40121
40127
|
type: "gap",
|
|
40122
40128
|
index: t,
|
|
40123
40129
|
startPct: l,
|
|
40124
40130
|
widthPct: n - l
|
|
40125
40131
|
});
|
|
40126
|
-
let i = Math.min(100 - n, Math.max(
|
|
40132
|
+
let i = Math.min(100 - n, Math.max(JG, r - n));
|
|
40127
40133
|
c.push({
|
|
40128
40134
|
type: "segment",
|
|
40129
40135
|
index: t,
|
|
40130
40136
|
startPct: n,
|
|
40131
40137
|
widthPct: i
|
|
40132
40138
|
}), l = n + i;
|
|
40133
|
-
}), 100 - l >
|
|
40139
|
+
}), 100 - l > YG && c.push({
|
|
40134
40140
|
type: "gap",
|
|
40135
40141
|
index: e.length,
|
|
40136
40142
|
startPct: l,
|
|
40137
40143
|
widthPct: 100 - l
|
|
40138
40144
|
}), c;
|
|
40139
40145
|
}
|
|
40140
|
-
function
|
|
40141
|
-
if (n.proportional) return
|
|
40146
|
+
function QG(e, t, n = {}) {
|
|
40147
|
+
if (n.proportional) return ZG(e, n.indefiniteDate, n.domain);
|
|
40142
40148
|
if (!t) {
|
|
40143
40149
|
let t = 100 / e.length;
|
|
40144
40150
|
return e.map((e, n) => ({
|
|
@@ -40148,60 +40154,64 @@ function ZG(e, t, n = {}) {
|
|
|
40148
40154
|
widthPct: t
|
|
40149
40155
|
}));
|
|
40150
40156
|
}
|
|
40151
|
-
let r = e.
|
|
40152
|
-
|
|
40153
|
-
|
|
40154
|
-
|
|
40157
|
+
let r = e.slice(1).filter((t, r) => {
|
|
40158
|
+
let i = e[r];
|
|
40159
|
+
return !(n.mergeAdjacentBoundaries && i.endDate.add(1, "day").isSame(t.startDate, "day"));
|
|
40160
|
+
}).length, i = 100 / (e.length + r * qG), a = [], o = 0;
|
|
40161
|
+
return e.forEach((t, r) => {
|
|
40162
|
+
let s = r > 0 ? e[r - 1] : null, c = n.mergeAdjacentBoundaries && !!(s && s.endDate.add(1, "day").isSame(t.startDate, "day"));
|
|
40163
|
+
if (r > 0 && !c) {
|
|
40164
|
+
let e = i * qG;
|
|
40155
40165
|
a.push({
|
|
40156
40166
|
type: "gap",
|
|
40157
|
-
index:
|
|
40167
|
+
index: r,
|
|
40158
40168
|
startPct: o,
|
|
40159
40169
|
widthPct: e
|
|
40160
40170
|
}), o += e;
|
|
40161
40171
|
}
|
|
40162
40172
|
a.push({
|
|
40163
40173
|
type: "segment",
|
|
40164
|
-
index:
|
|
40174
|
+
index: r,
|
|
40165
40175
|
startPct: o,
|
|
40166
40176
|
widthPct: i
|
|
40167
40177
|
}), o += i;
|
|
40168
40178
|
}), a;
|
|
40169
40179
|
}
|
|
40170
|
-
function
|
|
40171
|
-
let
|
|
40172
|
-
e.forEach((
|
|
40173
|
-
let
|
|
40174
|
-
if (
|
|
40175
|
-
let e = t[
|
|
40176
|
-
|
|
40177
|
-
key: `${
|
|
40180
|
+
function $G(e, t, n, r = !1) {
|
|
40181
|
+
let i = [];
|
|
40182
|
+
e.forEach((a, o) => {
|
|
40183
|
+
let s = o > 0 ? e[o - 1] : null, c = !!(s && s.endDate.add(1, "day").isSame(a.startDate, "day")), l = r && c, u = n && s !== null && !l;
|
|
40184
|
+
if (s && u) {
|
|
40185
|
+
let e = t[o - 1];
|
|
40186
|
+
i.push({
|
|
40187
|
+
key: `${s.id}-end`,
|
|
40178
40188
|
kind: "end",
|
|
40179
|
-
date:
|
|
40189
|
+
date: s.endDate,
|
|
40180
40190
|
leftPct: e.startPct + e.widthPct,
|
|
40181
|
-
segmentIndex:
|
|
40191
|
+
segmentIndex: o - 1,
|
|
40182
40192
|
previousIndex: null
|
|
40183
40193
|
});
|
|
40184
40194
|
}
|
|
40185
|
-
|
|
40186
|
-
key: `${
|
|
40187
|
-
kind:
|
|
40188
|
-
date:
|
|
40189
|
-
leftPct: t[
|
|
40190
|
-
segmentIndex:
|
|
40191
|
-
previousIndex:
|
|
40195
|
+
i.push({
|
|
40196
|
+
key: `${a.id}-start`,
|
|
40197
|
+
kind: s && (!u || l) ? "shared" : "start",
|
|
40198
|
+
date: a.startDate,
|
|
40199
|
+
leftPct: s && l ? (t[o - 1].startPct + t[o - 1].widthPct + t[o].startPct) / 2 : t[o].startPct,
|
|
40200
|
+
segmentIndex: o,
|
|
40201
|
+
previousIndex: s ? o - 1 : null
|
|
40192
40202
|
});
|
|
40193
40203
|
});
|
|
40194
|
-
let
|
|
40195
|
-
return
|
|
40196
|
-
key: `${e[
|
|
40204
|
+
let a = e.length - 1;
|
|
40205
|
+
return i.push({
|
|
40206
|
+
key: `${e[a].id}-end`,
|
|
40197
40207
|
kind: "end",
|
|
40198
|
-
date: e[
|
|
40208
|
+
date: e[a].endDate,
|
|
40199
40209
|
leftPct: 100,
|
|
40200
|
-
segmentIndex:
|
|
40210
|
+
segmentIndex: a,
|
|
40201
40211
|
previousIndex: null
|
|
40202
|
-
}),
|
|
40212
|
+
}), i;
|
|
40203
40213
|
}
|
|
40204
|
-
function
|
|
40214
|
+
function eK(e, t, n, r = !1) {
|
|
40205
40215
|
let i = t[e.segmentIndex], a = +!r;
|
|
40206
40216
|
if (e.kind === "end") {
|
|
40207
40217
|
let r = t[e.segmentIndex + 1];
|
|
@@ -40218,62 +40228,63 @@ function $G(e, t, n, r = !1) {
|
|
|
40218
40228
|
}
|
|
40219
40229
|
//#endregion
|
|
40220
40230
|
//#region src/rb-components/timeline/Timeline.tsx
|
|
40221
|
-
var
|
|
40231
|
+
var tK = [
|
|
40222
40232
|
"#EAB300",
|
|
40223
40233
|
"#8A9A00",
|
|
40224
40234
|
"#50E300",
|
|
40225
40235
|
"#00A85A",
|
|
40226
40236
|
"#00D5EE",
|
|
40227
40237
|
"#008CF0"
|
|
40228
|
-
],
|
|
40229
|
-
function
|
|
40238
|
+
], nK = "#90a4ae", rK = "h-full bg-(--g-200)", iK = 5.5, aK = 8, oK = (e) => e?.isValid?.() ? e.format("DD/MM/YYYY") : "";
|
|
40239
|
+
function sK(e, t) {
|
|
40230
40240
|
let n = {}, r = 0;
|
|
40231
40241
|
return e.forEach((e) => {
|
|
40232
40242
|
if (e.color) return;
|
|
40233
40243
|
let i = String(e.id);
|
|
40234
|
-
n[i] || (n[i] = t[r++ % t.length] ??
|
|
40244
|
+
n[i] || (n[i] = t[r++ % t.length] ?? nK);
|
|
40235
40245
|
}), n;
|
|
40236
40246
|
}
|
|
40237
|
-
function
|
|
40238
|
-
return e.color ?? t[String(e.id)] ??
|
|
40247
|
+
function cK(e, t) {
|
|
40248
|
+
return e.color ?? t[String(e.id)] ?? nK;
|
|
40239
40249
|
}
|
|
40240
|
-
function
|
|
40250
|
+
function lK(e) {
|
|
40241
40251
|
return typeof e.label == "string" && e.label.trim() ? e.label : null;
|
|
40242
40252
|
}
|
|
40243
|
-
function
|
|
40244
|
-
let r =
|
|
40253
|
+
function uK(e, t, n) {
|
|
40254
|
+
let r = lK(e);
|
|
40245
40255
|
if (!r) return !1;
|
|
40246
|
-
let i = r.length *
|
|
40256
|
+
let i = r.length * iK + aK;
|
|
40247
40257
|
return n * t / 100 >= i;
|
|
40248
40258
|
}
|
|
40249
|
-
function
|
|
40250
|
-
let
|
|
40259
|
+
function dK({ segments: e, mode: t = "simple", external_labels: n, legend: r = !1, compactRange: i, tooltips: a = !0, startBoundary: o, endBoundary: s, colors: c = tK, formatDate: l = oK, segmentTooltip: u, boundaryTooltip: d, onSegmentClick: f, onBoundaryClick: p, allowGaps: m = !1, mergeAdjacentBoundaries: h = !1, scale: g = "equal", editableBoundaries: _ = !1, exclusiveEnd: v = !1, indefiniteDate: y, indefiniteLabel: b = "Indefinido", onBoundaryDateChange: x, className: S }) {
|
|
40260
|
+
let C = ye(null), [w, T] = be(0);
|
|
40251
40261
|
if (me(() => {
|
|
40252
|
-
let e =
|
|
40262
|
+
let e = C.current;
|
|
40253
40263
|
if (!e || typeof ResizeObserver > "u") return;
|
|
40254
|
-
let t = () =>
|
|
40264
|
+
let t = () => T(e.clientWidth);
|
|
40255
40265
|
t();
|
|
40256
40266
|
let n = new ResizeObserver(t);
|
|
40257
40267
|
return n.observe(e), () => n.disconnect();
|
|
40258
40268
|
}, []), e.length === 0) return null;
|
|
40259
|
-
let
|
|
40260
|
-
proportional:
|
|
40261
|
-
indefiniteDate:
|
|
40262
|
-
|
|
40269
|
+
let E = sK(e, c), D = QG(e, m, {
|
|
40270
|
+
proportional: g === "proportional",
|
|
40271
|
+
indefiniteDate: y,
|
|
40272
|
+
mergeAdjacentBoundaries: h
|
|
40273
|
+
}), O = D.filter((e) => e.type === "segment"), k = $G(e, O, m, h), A = _ && !!x, j = k.length - 1, M = (e) => !!(y && e.isSame(y, "day")), N = (e) => M(e) ? b : l(e), P = n?.fecha_inicio ?? l(i?.startDate ?? e[0].startDate), F = n?.fecha_fin ?? N(i?.endDate ?? e[e.length - 1].endDate), I = QG(e, !0, {
|
|
40263
40274
|
proportional: !0,
|
|
40264
|
-
indefiniteDate:
|
|
40275
|
+
indefiniteDate: y,
|
|
40265
40276
|
domain: i
|
|
40266
|
-
}),
|
|
40277
|
+
}), L = (e, t) => e.tooltip ?? u?.(e, t) ?? /* @__PURE__ */ G("span", {
|
|
40267
40278
|
className: "flex flex-col gap-1",
|
|
40268
40279
|
children: [/* @__PURE__ */ W("strong", { children: e.label ?? "—" }), /* @__PURE__ */ G("span", { children: [
|
|
40269
40280
|
l(e.startDate),
|
|
40270
40281
|
" -",
|
|
40271
40282
|
" ",
|
|
40272
|
-
|
|
40283
|
+
N(e.endDate)
|
|
40273
40284
|
] })]
|
|
40274
40285
|
});
|
|
40275
40286
|
return t === "compact" ? /* @__PURE__ */ G("div", {
|
|
40276
|
-
className: Z("flex w-full min-w-0 flex-col rounded-md bg-black/5",
|
|
40287
|
+
className: Z("flex w-full min-w-0 flex-col rounded-md bg-black/5", S),
|
|
40277
40288
|
style: {
|
|
40278
40289
|
padding: "0.75rem 0.5rem",
|
|
40279
40290
|
rowGap: "0.5rem"
|
|
@@ -40286,11 +40297,11 @@ function uK({ segments: e, mode: t = "simple", external_labels: n, legend: r = !
|
|
|
40286
40297
|
"aria-label": "Fecha de inicio",
|
|
40287
40298
|
children: /* @__PURE__ */ W("span", {
|
|
40288
40299
|
className: "text-xs font-semibold whitespace-nowrap",
|
|
40289
|
-
children:
|
|
40300
|
+
children: P
|
|
40290
40301
|
})
|
|
40291
40302
|
}),
|
|
40292
40303
|
/* @__PURE__ */ G("div", {
|
|
40293
|
-
ref:
|
|
40304
|
+
ref: C,
|
|
40294
40305
|
className: "relative min-w-0 flex-1",
|
|
40295
40306
|
style: {
|
|
40296
40307
|
height: "2.25rem",
|
|
@@ -40299,13 +40310,13 @@ function uK({ segments: e, mode: t = "simple", external_labels: n, legend: r = !
|
|
|
40299
40310
|
children: [/* @__PURE__ */ W("div", {
|
|
40300
40311
|
className: "absolute inset-x-0 bottom-0 rounded-full bg-(--g-200)",
|
|
40301
40312
|
style: { height: "0.375rem" }
|
|
40302
|
-
}),
|
|
40313
|
+
}), I.map((t) => {
|
|
40303
40314
|
if (t.type === "gap") return null;
|
|
40304
|
-
let n = e[t.index], r =
|
|
40315
|
+
let n = e[t.index], r = uK(n, t.widthPct, w) ? lK(n) : null, i = /* @__PURE__ */ W("div", {
|
|
40305
40316
|
className: "h-3 w-full rounded-full border border-(--surface) shadow-[0_0_0_1px_color-mix(in_srgb,currentColor_34%,transparent)]",
|
|
40306
40317
|
style: {
|
|
40307
|
-
color:
|
|
40308
|
-
backgroundColor:
|
|
40318
|
+
color: cK(n, E),
|
|
40319
|
+
backgroundColor: cK(n, E)
|
|
40309
40320
|
}
|
|
40310
40321
|
}), o = /* @__PURE__ */ G("div", {
|
|
40311
40322
|
className: "relative h-full w-full",
|
|
@@ -40324,7 +40335,7 @@ function uK({ segments: e, mode: t = "simple", external_labels: n, legend: r = !
|
|
|
40324
40335
|
width: `${t.widthPct}%`
|
|
40325
40336
|
},
|
|
40326
40337
|
children: a ? /* @__PURE__ */ W(Dw, {
|
|
40327
|
-
content:
|
|
40338
|
+
content: L(n, t.index),
|
|
40328
40339
|
placement: "bottom",
|
|
40329
40340
|
multiline: !0,
|
|
40330
40341
|
triggerClassName: "block h-9 w-full",
|
|
@@ -40338,7 +40349,7 @@ function uK({ segments: e, mode: t = "simple", external_labels: n, legend: r = !
|
|
|
40338
40349
|
"aria-label": "Fecha de fin",
|
|
40339
40350
|
children: /* @__PURE__ */ W("span", {
|
|
40340
40351
|
className: "text-xs font-semibold whitespace-nowrap",
|
|
40341
|
-
children:
|
|
40352
|
+
children: F
|
|
40342
40353
|
})
|
|
40343
40354
|
})
|
|
40344
40355
|
]
|
|
@@ -40349,12 +40360,12 @@ function uK({ segments: e, mode: t = "simple", external_labels: n, legend: r = !
|
|
|
40349
40360
|
children: [/* @__PURE__ */ W("span", {
|
|
40350
40361
|
"aria-hidden": "true",
|
|
40351
40362
|
className: "size-2.5 shrink-0 rounded-full",
|
|
40352
|
-
style: { backgroundColor:
|
|
40363
|
+
style: { backgroundColor: cK(e, E) }
|
|
40353
40364
|
}), /* @__PURE__ */ W("span", { children: e.label ?? "—" })]
|
|
40354
40365
|
}, `legend-${e.id}`))
|
|
40355
40366
|
}) : null]
|
|
40356
40367
|
}) : /* @__PURE__ */ G("div", {
|
|
40357
|
-
className: Z("flex w-full min-w-0 flex-col rounded-md bg-black/5",
|
|
40368
|
+
className: Z("flex w-full min-w-0 flex-col rounded-md bg-black/5", S),
|
|
40358
40369
|
style: {
|
|
40359
40370
|
padding: "0.75rem 0.5rem",
|
|
40360
40371
|
rowGap: "0.25rem"
|
|
@@ -40366,8 +40377,8 @@ function uK({ segments: e, mode: t = "simple", external_labels: n, legend: r = !
|
|
|
40366
40377
|
children: e.map((e, t) => /* @__PURE__ */ W(WG, {
|
|
40367
40378
|
segment: e,
|
|
40368
40379
|
index: t,
|
|
40369
|
-
color:
|
|
40370
|
-
leftPct:
|
|
40380
|
+
color: cK(e, E),
|
|
40381
|
+
leftPct: O[t].startPct + O[t].widthPct / 2,
|
|
40371
40382
|
tooltip: e.tooltip ?? u?.(e, t) ?? null,
|
|
40372
40383
|
onClick: f ? (t, n) => f({
|
|
40373
40384
|
segment: e,
|
|
@@ -40382,33 +40393,33 @@ function uK({ segments: e, mode: t = "simple", external_labels: n, legend: r = !
|
|
|
40382
40393
|
children: [/* @__PURE__ */ W("div", {
|
|
40383
40394
|
className: "flex w-full overflow-hidden rounded-md",
|
|
40384
40395
|
style: { height: "0.375rem" },
|
|
40385
|
-
children:
|
|
40396
|
+
children: D.map((t) => t.type === "gap" ? /* @__PURE__ */ W("div", {
|
|
40386
40397
|
style: { width: `${t.widthPct}%` },
|
|
40387
|
-
className:
|
|
40398
|
+
className: rK
|
|
40388
40399
|
}, `gap-${t.index}`) : /* @__PURE__ */ W("div", {
|
|
40389
40400
|
style: {
|
|
40390
40401
|
width: `${t.widthPct}%`,
|
|
40391
|
-
backgroundColor:
|
|
40402
|
+
backgroundColor: cK(e[t.index], E)
|
|
40392
40403
|
},
|
|
40393
40404
|
className: "h-full"
|
|
40394
40405
|
}, e[t.index].id))
|
|
40395
|
-
}),
|
|
40396
|
-
let r = n === 0, i = n ===
|
|
40406
|
+
}), k.map((t, n) => {
|
|
40407
|
+
let r = n === 0, i = n === j, a = !r && !i, c = M(t.date), { min: u, max: f } = eK(t, e, m, v), h = r ? o?.color ?? cK(e[0], E) : i ? s?.color ?? nK : cK(e[t.segmentIndex], E), g = r ? o?.tooltip ?? l(t.date) : i ? s?.tooltip ?? (c ? b : l(t.date)) : d?.({
|
|
40397
40408
|
index: n,
|
|
40398
40409
|
previousSegment: t.previousIndex === null ? e[t.segmentIndex] : e[t.previousIndex],
|
|
40399
40410
|
nextSegment: e[t.segmentIndex],
|
|
40400
40411
|
anchorEl: null
|
|
40401
40412
|
}) ?? l(t.date);
|
|
40402
|
-
return /* @__PURE__ */ W(
|
|
40413
|
+
return /* @__PURE__ */ W(KG, {
|
|
40403
40414
|
boundary: t,
|
|
40404
40415
|
isEdge: r || i,
|
|
40405
40416
|
color: h,
|
|
40406
40417
|
tooltip: g,
|
|
40407
|
-
editable:
|
|
40418
|
+
editable: A && !c,
|
|
40408
40419
|
minDate: u,
|
|
40409
40420
|
maxDate: f,
|
|
40410
40421
|
align: r ? "start" : i ? "end" : "center",
|
|
40411
|
-
onDateChange: (e) =>
|
|
40422
|
+
onDateChange: (e) => x?.({
|
|
40412
40423
|
kind: t.kind,
|
|
40413
40424
|
date: e,
|
|
40414
40425
|
segmentIndex: t.segmentIndex,
|
|
@@ -40416,7 +40427,7 @@ function uK({ segments: e, mode: t = "simple", external_labels: n, legend: r = !
|
|
|
40416
40427
|
minDate: u,
|
|
40417
40428
|
maxDate: f
|
|
40418
40429
|
}),
|
|
40419
|
-
onClick: a && p && !
|
|
40430
|
+
onClick: a && p && !A ? (r) => p({
|
|
40420
40431
|
index: n,
|
|
40421
40432
|
previousSegment: e[t.previousIndex ?? t.segmentIndex],
|
|
40422
40433
|
nextSegment: e[t.segmentIndex],
|
|
@@ -40431,7 +40442,7 @@ function uK({ segments: e, mode: t = "simple", external_labels: n, legend: r = !
|
|
|
40431
40442
|
height: "1.5rem",
|
|
40432
40443
|
marginTop: "0.25rem"
|
|
40433
40444
|
},
|
|
40434
|
-
children:
|
|
40445
|
+
children: k.map((e, t) => /* @__PURE__ */ W("span", {
|
|
40435
40446
|
className: "absolute whitespace-nowrap text-(--muted,#666)",
|
|
40436
40447
|
style: {
|
|
40437
40448
|
left: `${e.leftPct}%`,
|
|
@@ -40441,11 +40452,11 @@ function uK({ segments: e, mode: t = "simple", external_labels: n, legend: r = !
|
|
|
40441
40452
|
lineHeight: "1.25rem",
|
|
40442
40453
|
fontWeight: 400
|
|
40443
40454
|
},
|
|
40444
|
-
children: t === 0 ? o?.label ?? l(e.date) : t ===
|
|
40455
|
+
children: t === 0 ? o?.label ?? l(e.date) : t === j ? s?.label ?? (M(e.date) ? b : l(e.date)) : M(e.date) ? b : l(e.date)
|
|
40445
40456
|
}, e.key))
|
|
40446
40457
|
})
|
|
40447
40458
|
]
|
|
40448
40459
|
});
|
|
40449
40460
|
}
|
|
40450
40461
|
//#endregion
|
|
40451
|
-
export { Kv as AuthLanguageDropdown, fE as AuthPasswordInput, Gv as AuthShell, cy as AutoCustomCompleteField, qE as Breadcrumbs, NT as CalendarChipIcon, DT as Calendario, XT as Card, $T as CardContent, eE as CardFooter, ZT as CardHeader, QT as CardTitle, kw as Checkbox, PT as ClockChipIcon, dE as ConfirmDialog, XE as Core, xt as CoreContext, ZE as CoreProvider, Uw as CustomDateControl, yw as CustomDatePicker, $w as CustomDateRangeCalendar, Xw as CustomDateRangePicker, qw as CustomDateRangefield, aw as CustomDatefield, Hw as CustomIndefiniteDatePicker, dD as CustomSelect, Gw as CustomTimefield, e as DGEnUs, t as DGEsEs, VE as DashboardShell, jD as EmptyState, bD as Form, HD as FormField, VD as FormGrid, LD as FormShell, yt as GoodRabbitDarkTheme, bt as GoodRabbitLightTheme, rE as Input, mD as LegacyCustomTimefield, CD as MessageAlert, KD as PillsTabs, KD as RbPillsTabs, sE as Portal, Yv as RBButton, aE as Radio, AT as RbContextMenu, MW as RbExcelTable, nE as RbIconButton, JT as RbInlineChipField, UD as RbList, WD as RbListItem, oE as RbStepper, JD as RbTabPanel, JD as TabPanel, jO as RbTable, dO as RbTableToolbar, NW as RbToolbarActionButton, PW as RbToolbarActions, FW as RbToolbarDateRangeField, RW as RbToolbarMultiSelectField, BW as RbToolbarSearchField, UW as RbToolbarSelectField, _E as ShellContent, Zm as Sidebar, QW as SidebarContent, eG as SidebarFooter, qW as SidebarHeader, LE as SystemAlert, oD as Table,
|
|
40462
|
+
export { Kv as AuthLanguageDropdown, fE as AuthPasswordInput, Gv as AuthShell, cy as AutoCustomCompleteField, qE as Breadcrumbs, NT as CalendarChipIcon, DT as Calendario, XT as Card, $T as CardContent, eE as CardFooter, ZT as CardHeader, QT as CardTitle, kw as Checkbox, PT as ClockChipIcon, dE as ConfirmDialog, XE as Core, xt as CoreContext, ZE as CoreProvider, Uw as CustomDateControl, yw as CustomDatePicker, $w as CustomDateRangeCalendar, Xw as CustomDateRangePicker, qw as CustomDateRangefield, aw as CustomDatefield, Hw as CustomIndefiniteDatePicker, dD as CustomSelect, Gw as CustomTimefield, e as DGEnUs, t as DGEsEs, VE as DashboardShell, jD as EmptyState, bD as Form, HD as FormField, VD as FormGrid, LD as FormShell, yt as GoodRabbitDarkTheme, bt as GoodRabbitLightTheme, rE as Input, mD as LegacyCustomTimefield, CD as MessageAlert, KD as PillsTabs, KD as RbPillsTabs, sE as Portal, Yv as RBButton, aE as Radio, AT as RbContextMenu, MW as RbExcelTable, nE as RbIconButton, JT as RbInlineChipField, UD as RbList, WD as RbListItem, oE as RbStepper, JD as RbTabPanel, JD as TabPanel, jO as RbTable, dO as RbTableToolbar, NW as RbToolbarActionButton, PW as RbToolbarActions, FW as RbToolbarDateRangeField, RW as RbToolbarMultiSelectField, BW as RbToolbarSearchField, UW as RbToolbarSelectField, _E as ShellContent, Zm as Sidebar, QW as SidebarContent, eG as SidebarFooter, qW as SidebarHeader, LE as SystemAlert, oD as Table, dK as Timeline, Dw as Tooltip, SE as TopBar, vE as TopBarUserMenu, CG as TreePanel, UG as VirtualTree, TG as buildVirtualTreeIndex, Hv as chekingSSOMS, Z as cn, n as coreEnUS, r as coreEsES, MG as filterVirtualTreeItems, lG as findNodeById, cG as flattenTree, dW as formatRbExcelDate, fW as formatRbExcelTime, uG as getExpandableNodeIds, mG as getNodeSelectionState, oW as getRbExcelValueAtPath, Bm as getRbImageUrl, fG as getSelectableDescendantIds, dG as getSelectableSubtreeIds, EG as getVirtualTreeAncestorIds, OG as getVisibleVirtualTreeItems, sG as hasNodeChildren, Uv as initializeAuth, aG as isNodeSelectable, oG as isNodeSelectionMutable, cW as isRbExcelEmptyValue, mW as isValidRbExcelDate, gW as isValidRbExcelNumber, hW as isValidRbExcelTime, pG as normalizeHierarchicalSelection, kG as normalizeVirtualTreeSearch, FG as normalizeVirtualTreeSelection, Wv as observeSSO, pW as parseRbExcelValue, i as pickersEnUS, a as pickersEsES, zm as rbImages, sW as setRbExcelValueAtPath, gG as toggleExpandedNode, hG as toggleNodeSelection, IG as toggleVirtualTreeSelection, zE as useRbSystemAlert, cD as useSystemAlert, sD as useTable, LG as useVirtualTreeState };
|
package/dist/web-ui.umd.cjs
CHANGED
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
scale(1);
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
`})]});return r?(0,f.createPortal)(a,document.body):null};function DT(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():Math.random().toString(36).slice(2,10)}var OT=()=>({showAlert:(e,t,n={})=>{let r=DT(),i=e===`loading`||e==="default";return gT({id:r,severity:e,message:t,duration:n.duration??(i?void 0:5e3),closeLabel:n.closeLabel}),r},closeAlert:e=>{_T(e)}}),kT=`(max-width: 63.9375rem)`,AT=({sidebar:e,routes:t,account:n})=>{let{state:r,setState:i,getWidth:a}=fe(),[o,s]=(0,l.useState)(()=>typeof window>`u`?!1:window.matchMedia(kT).matches),[c,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=window.matchMedia(kT),t=()=>{let t=e.matches;s(t),t||u(!1)};return t(),e.addEventListener?.(`change`,t),()=>{e.removeEventListener?.(`change`,t)}},[]),(0,d.jsxs)(`div`,{className:`rb-shell rb-shell--${r}`,children:[(0,d.jsx)(Bp,{items:e.items,signOut:e.signOut,tooltips:e.tooltips,state:r,setState:i,getWidth:a,isMobile:o,mobileOpen:c,onCloseMobile:()=>u(!1)}),(0,d.jsx)(dT,{account:n,sidebarItems:e.items,onOpenMobile:o?()=>u(!0):void 0}),(0,d.jsx)(oT,{state:r,getWidth:a,routes:t,account:n}),(0,d.jsx)(ET,{})]})},jT=[`module`,`view`];function MT(){return(0,d.jsx)(`img`,{src:Op.arrowBread,alt:``,"aria-hidden":`true`,className:`size-3 opacity-70`})}function NT(e){return e?decodeURIComponent(e).replaceAll(`-`,` `).replaceAll(`_`,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase()):`—`}function PT(e){let t=e!==`/`&&e.endsWith(`/`)?e.slice(0,-1):e;if(t===`/`)return[];let n=t.split(`/`).filter(Boolean),r=``;return n.map(e=>(r+=`/${e}`,{label:NT(e),to:r}))}function FT({pathname:e,searchParams:t,queryKeys:n,labelFormatter:r}){let i=new URLSearchParams;return n.reduce((n,a)=>{let o=t.get(a);if(!o)return n;i.set(a,o);let s=i.toString();return n.push({label:r?r({key:a,value:o}):NT(o),to:`${e}${s?`?${s}`:``}`}),n},[])}function IT({items:e=[],separator:t=(0,d.jsx)(MT,{}),className:n=``,queryKeys:r=jT,includeHome:i=!0,homeLabel:a=`Home`,homeTo:o=`/`,labelFormatter:s}){let c=(0,u.useNavigate)(),f=(0,u.useLocation)(),[p]=(0,u.useSearchParams)(),m=(0,l.useMemo)(()=>{if(e.length>0)return e;let t=FT({pathname:f.pathname,searchParams:p,queryKeys:r,labelFormatter:s}),n=t.length>0?t:PT(f.pathname);return[...i?[{label:a,to:o}]:[],...n]},[e,f.pathname,p,r,i,a,o,s]);return m.length===0?null:(0,d.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:Z(`max-w-full overflow-hidden`,n),children:(0,d.jsx)(`ol`,{className:`flex min-w-0 flex-wrap items-center gap-2 p2 text-[var(--muted)]`,children:m.map((e,n)=>{let r=n===m.length-1,i=!!e.to&&!r;return(0,d.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2`,children:[n>0&&(0,d.jsx)(`span`,{className:`flex shrink-0 items-center justify-center text-[var(--g-400)]`,"aria-hidden":`true`,children:t}),i?(0,d.jsx)(`button`,{type:`button`,onClick:()=>c(e.to),className:`p2 min-w-0 max-w-[14rem] truncate bg-transparent p-0 text-left text-[var(--muted)] transition-colors hover:text-[var(--text)] hover:underline`,children:e.label}):(0,d.jsx)(`span`,{"aria-current":r?`page`:void 0,className:`p2 min-w-0 max-w-[14rem] truncate font-semibold text-[var(--text)]`,title:typeof e.label==`string`?e.label:void 0,children:e.label})]},`${String(e.label)}-${n}`)})})})}var LT=e=>(0,d.jsx)(AT,{...e}),RT=({sidebar:e,routes:t,product:n,account:r,languages:i,loginForm:a,signup:o,unsavedChangesAlert:s})=>{let{isAuthenticated:c,openUnsaved:u,setOpenUnsaved:f}=(0,l.useContext)(W),p=[{text:s.message,ncolumn:12,element:`TypographyField`}];return(0,d.jsxs)(d.Fragment,{children:[c?(0,d.jsx)(LT,{routes:t,sidebar:e,account:r}):(0,d.jsx)(iT,{product:n,languages:i,form:a,signup:o}),(0,d.jsx)(lE,{title:s.title,open:u,setOpen:f,fields:p,loading:!1,onClickSave:s.actionButton.onClick,action:{actionButton:s.actionButton,cancelButton:s.cancelButton}})]})},zT=({sidebar:e,routes:t,product:n,account:r,languages:o,loginForm:s,signup:c,unsavedChangesAlert:f,msalInstance:g})=>{let{isAuthenticated:_,setIsAuthenticated:v}=(0,l.useContext)(W),[y,b]=(0,l.useState)(0),x=o.find(e=>e.active)||o[0];(0,l.useEffect)(()=>{switch(x.code){case`es`:a.default.locale(`es`);break;case`en`:a.default.locale(`en`);break;case`pt`:a.default.locale(`pt`);break;default:a.default.locale(`en`)}let e=[`token`,`company`,`config`,`privileges`,`account`,`language`,`authenticated`,`type-signin`].filter(e=>localStorage.getItem(e)===null);if(localStorage.getItem(`ues`)===`403`){localStorage.removeItem(`ues`),window.location.href=`/signup`;return}y===0&&window.location.pathname!==`/signup`&&(g.getActiveAccount()&&e.length>0?(console.log(`if 1`),j_(g,g.getActiveAccount())):g.getActiveAccount()&&e.length===0?(console.log(`if 2`),v(!0),localStorage.setItem(`authenticated`,`true`)):!g.getActiveAccount()&&_?(console.log(`if 6`),v(!0)):!g.getActiveAccount()&&e.length===0?(console.log(`if 3`),v(!0),localStorage.setItem(`authenticated`,`true`)):!g.getActiveAccount()&&e.length>0&&(console.log(`if 4`),v(!1),localStorage.setItem(`authenticated`,`false`)),b(y+1))},[x,y]);let S={rabbitLight:de,rabbitDark:(0,i.createTheme)(ue,x.theme.dg,x.theme.core,x.theme.pickers)};return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(Cp,{instance:g,children:(0,d.jsx)(i.Box,{sx:{overflow:`hidden`,height:`100vh`},children:(0,d.jsx)(u.BrowserRouter,{children:(0,d.jsx)(i.ThemeProvider,{theme:S.rabbitDark,children:(0,d.jsx)(m.LocalizationProvider,{dateAdapter:h.AdapterDayjs,adapterLocale:x.code,children:(0,d.jsxs)(p.SnackbarProvider,{maxSnack:15,autoHideDuration:1e4,anchorOrigin:{vertical:`top`,horizontal:`center`},children:[(0,d.jsx)(i.CssBaseline,{}),(0,d.jsx)(RT,{sidebar:e,routes:t,product:n,account:r,languages:o,msalInstance:g,loginForm:s,signup:c,unsavedChangesAlert:f})]})})})})})})})},BT=({children:e})=>{let[t,n]=(0,l.useState)(localStorage.getItem(`authenticated`)===`true`),[r,i]=(0,l.useState)(``),[a,o]=(0,l.useState)(``),[s,c]=(0,l.useState)(``),[u,f]=(0,l.useState)(``),[p,m]=(0,l.useState)(`DD/MM/YYYY`),[h,g]=(0,l.useState)([]),[_,v]=(0,l.useState)([]),[y,b]=(0,l.useState)(!1),[x,S]=(0,l.useState)(``),[C,w]=(0,l.useState)(!1);return(0,d.jsx)(W.Provider,{value:{isAuthenticated:t,setIsAuthenticated:n,user:r,setUser:i,pass:a,setPass:o,avatar:s,setAvatar:c,email:u,setEmail:f,loadingAuth:C,setLoadingAuth:w,format:p,setFormat:m,singleShortcut:h,setSingleShortcut:g,rangeShortcut:_,setRangeShortcut:v,encrypter:(e,t,n)=>{e===`session`?sessionStorage.setItem(t,n):e===`local`&&localStorage.setItem(t,n)},decrypter:(e,t)=>e===`session`?sessionStorage.getItem(t)||``:e===`local`&&localStorage.getItem(t)||``,openUnsaved:y,setOpenUnsaved:b,redirect:x,setRedirect:S},children:e})},VT=({contextMenu:e,setContextMenu:t,options:n,checked:r,optionGroup:a})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i.Menu,{open:e!==null,onClose:()=>t(null),anchorReference:`anchorPosition`,anchorPosition:e===null?void 0:{top:e.mouseY,left:e.mouseX},slots:{transition:i.Fade},slotProps:{paper:{sx:{bgcolor:e=>a===`toolbar`?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main,borderRadius:`12px`},elevation:1}},sx:{cursor:`pointer`},children:n.filter(e=>!e.hide).map((e,t)=>(0,d.jsxs)(i.Box,{children:[t!==0&&n[t-1].group!==e.group?(0,d.jsx)(i.Divider,{}):null,(0,d.jsxs)(i.MenuItem,{onClick:e.click,disabled:e.disabled,children:[(0,d.jsx)(i.ListItemIcon,{sx:{color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},children:e.icon}),(0,d.jsx)(i.ListItemText,{children:(0,d.jsx)(i.Typography,{sx:{color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},children:e.name})}),e.selected?(0,d.jsxs)(i.Typography,{sx:{pl:3,color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},variant:`body2`,children:[`selecionados`,`:`,r.length]}):null,e.onlyOne?(0,d.jsx)(i.Typography,{sx:{pl:3,color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},variant:`body2`,children:`solo uno`}):null]},t)]},t))}),n.filter(e=>!e.hide).map((e,t)=>(0,d.jsx)(i.Box,{children:e.dialog},t))]}),HT=e=>{let t=[],n=new Map;return e.forEach(e=>{let r=e.group??``;n.has(r)||(n.set(r,t.length),t.push({group:e.group,items:[]})),t[n.get(r)].items.push(e)}),t},UT=({label:e,values:t,placeholder:n,value:r,setValue:a,disabled:o,fullWidth:s,white:c,search:u})=>{let f=(0,l.useRef)(null),p=(0,l.useRef)(null),m=(0,l.useRef)(null),[h,g]=(0,l.useState)({width:0,height:0}),[v,y]=(0,l.useState)(!1),[b,x]=(0,l.useState)(``),S=u?.value??b,C=e=>(0,d.jsx)(_.default,{...e,sx:{color:c?`black !important`:`white !important`,...e.sx},onClick:()=>{console.log(`icon click`),y(!v)}});(0,l.useEffect)(()=>{if(!f.current)return;let e=new ResizeObserver(e=>{let{width:t,height:n}=e[0].contentRect;g({width:t,height:n})});return e.observe(f.current),()=>e.disconnect()},[h]),(0,l.useEffect)(()=>{v&&m.current?.focus()},[v]);let w={marginTop:`-55px`,maxHeight:`500px`,borderRadius:`24px`,borderTopLeftRadius:`24px`,borderTopRightRadius:`24px`,width:h.width+20,backgroundColor:`transparent`,"--Paper-overlay":`none`,border:`1px solid rgba(255, 255, 255, 0.2)`};return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.FormControl,{fullWidth:s,focused:!0,children:[(0,d.jsx)(i.InputLabel,{id:`filter-table-label-${e}`,sx:{color:c?`black`:`white`,position:`absolute`,"&.Mui-focused":{color:c?`black`:`white`},'&[data-shrink="false"]':{transform:`translateY(12px) translateX(12px)`}},children:e}),(0,d.jsxs)(i.Select,{ref:f,labelId:`filter-table-label-${e}`,id:`filter-${e}`,open:v,onOpen:()=>{y(!0)},onClose:e=>{let t=e?.target;t&&p.current?.contains(t)||y(!1)},value:r,label:e,onChange:e=>a(e.target.value),multiple:!1,renderValue:e=>{let r=Array.isArray(e)?e[0]:e;return r==null||r===``?n:t.find(e=>e.value===r)?.label||n},color:`gr-yellow`,sx:{color:c?`black`:`white`},IconComponent:C,MenuProps:{autoFocus:!1,disableAutoFocusItem:!0,slotProps:{paper:{style:w},list:{sx:{marginTop:`60px`,backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,"& .MuiMenuItem-root":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,color:c?`black`:`white`,"&:hover":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-selected":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-focusVisible":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main}}}}}},displayEmpty:!0,disabled:o,children:[(0,d.jsx)(i.ListSubheader,{disableSticky:!0,sx:{backgroundColor:`transparent`,px:1.5,py:1},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation()},children:(0,d.jsx)(i.TextField,{ref:p,inputRef:m,variant:`standard`,fullWidth:!0,size:`small`,placeholder:u?.placeholder||`Buscar...`,value:S,onMouseDown:e=>{e.stopPropagation(),y(!0)},onClick:e=>{e.stopPropagation(),y(!0)},onKeyDown:e=>{e.stopPropagation()},onChange:e=>{let t=e.target.value;if(u?.setValue){u.setValue(t);return}x(t)},color:`gr-yellow`})}),HT(t).map((e,t)=>{let n=e.items.some(e=>`${e.label} ${e.sublabel??``}`.toLowerCase().includes(S.toLowerCase()));return(0,d.jsxs)(l.Fragment,{children:[e.group?(0,d.jsx)(i.ListSubheader,{disableSticky:!0,sx:{display:n?`block`:`none`,backgroundColor:`transparent`,color:c?`black`:`white`,fontWeight:600},children:e.group}):null,e.items.map(e=>(0,d.jsx)(i.MenuItem,{value:e.value,sx:{display:`${e.label} ${e.sublabel??``}`.toLowerCase().includes(S.toLowerCase())?`block`:`none`},onClick:()=>{y(!1)},children:(0,d.jsxs)(i.Typography,{variant:`caption`,color:`textSecondary`,children:[e.label,e.sublabel&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`br`,{}),e.sublabel]})]})},e.value))]},`group-${e.group??`none`}-${t}`)})]})]})})},WT=({label:e,value:t,setValue:n,values:r,placeholder:a,disabled:o,fullWidth:s,white:c,search:u})=>{let f=(0,l.useRef)(null),p=(0,l.useRef)(null),[m,h]=(0,l.useState)({width:0,height:0}),[g,v]=(0,l.useState)(!1),[y,b]=(0,l.useState)(``),x=u?.value??y,S=r.filter(e=>`${e.label} ${e.sublabel??``}`.toLowerCase().includes(x.toLowerCase())).map(e=>e.value),C=S.filter(e=>t.includes(e)).length,w=S.length>0&&C===S.length,T=C>0&&!w,E=e=>(0,d.jsx)(_.default,{...e,sx:{color:c?`black !important`:`white !important`,...e.sx},onClick:()=>{v(!g)}});(0,l.useEffect)(()=>{if(!f.current)return;let e=new ResizeObserver(e=>{let{width:t,height:n}=e[0].contentRect;h({width:t,height:n})});return e.observe(f.current),()=>e.disconnect()},[m]);let D={marginTop:`-55px`,maxHeight:`500px`,borderRadius:`24px`,borderTopLeftRadius:`24px`,borderTopRightRadius:`24px`,width:m.width+20,backgroundColor:`transparent`,"--Paper-overlay":`none`,border:`1px solid rgba(255, 255, 255, 0.2)`};return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.FormControl,{fullWidth:s,focused:!0,children:[(0,d.jsx)(i.InputLabel,{id:`filter-table-label-${e}`,sx:{color:c?`black`:`white`,position:`absolute`,"&.Mui-focused":{color:c?`black`:`white`},'&[data-shrink="false"]':{transform:`translateY(12px) translateX(12px)`}},children:e}),(0,d.jsxs)(i.Select,{ref:f,labelId:`filter-table-label-${e}`,id:`filter-${e}`,open:g,onOpen:()=>{v(!0)},onClose:e=>{let t=e?.target;t&&p.current?.contains(t)||v(!1)},value:t,label:e,onChange:e=>{let{target:{value:r}}=e,i=typeof r==`string`?r.split(`,`):r;if(i.includes(`select-all`)){if(w){n(t.filter(e=>!S.includes(e)));return}n(Array.from(new Set([...t,...S])));return}n(i.filter(e=>e!==`select-all`))},color:`gr-yellow`,sx:{color:c?`black`:`white`},IconComponent:E,MenuProps:{slotProps:{paper:{style:D},list:{sx:{marginTop:`60px`,backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,"& .MuiMenuItem-root":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,color:c?`black`:`white`,"&:hover":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-selected":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-focusVisible":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main}}}}}},renderValue:e=>!e||e.length===0?a:r.filter(t=>e.includes(t.value)).map(e=>e.label).join(`, `),displayEmpty:!0,disabled:o,multiple:!0,children:[(0,d.jsx)(i.ListSubheader,{disableSticky:!0,sx:{backgroundColor:`transparent`,px:1.5,py:1},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation()},children:(0,d.jsx)(i.TextField,{ref:p,variant:`standard`,fullWidth:!0,size:`small`,placeholder:u?.placeholder||`Buscar...`,value:x,onMouseDown:e=>{e.stopPropagation(),v(!0)},onClick:e=>{e.stopPropagation(),v(!0)},onKeyDown:e=>{e.stopPropagation()},onChange:e=>{let t=e.target.value;if(u?.setValue){u.setValue(t);return}b(t)},focused:!1,color:`gr-yellow`})}),(0,d.jsxs)(i.MenuItem,{value:`select-all`,disabled:S.length===0,children:[(0,d.jsx)(i.Checkbox,{checked:w,indeterminate:T}),(0,d.jsx)(i.ListItemText,{slotProps:{primary:{sx:{color:`#FFFFFF`}}},primary:`Seleccionar todo`})]}),r.map(e=>(0,d.jsx)(i.MenuItem,{value:e.value,sx:{display:S.includes(e.value)?`block`:`none`},children:(0,d.jsxs)(i.Box,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,d.jsx)(i.Checkbox,{checked:t.includes(e.value)}),(0,d.jsxs)(i.Typography,{variant:`caption`,color:`textSecondary`,children:[e.label,e.sublabel&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`br`,{}),e.sublabel]})]})]})},e.value))]})]})})},GT=({label:e,value:t,setValue:n,disabled:r,fullWidth:i})=>{let{format:a}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(y.LocalizationProvider,{dateAdapter:h.AdapterDayjs,children:(0,d.jsx)(v.SingleInputDateRangeField,{label:e,value:t,onChange:e=>{n(e)},sx:{"& .MuiInputBase-root":{borderRadius:`16px`}},size:`small`,color:`gr-yellow`,slotProps:{textField:{sx:{"& .MuiInputLabel-root":{color:`white !important`}}}},focused:!0,format:a,disabled:r,fullWidth:i})})})},KT=({label:e,initialValue:t,value:n,setValue:r,calendars:i,disabled:a,white:o,fullWidth:s,maxDate:c,minDate:u})=>{let{format:f,rangeShortcut:p}=(0,l.useContext)(W),m=(0,x.useTheme)(),h=(0,x.createTheme)({...m,palette:{...m.palette,primary:{main:`#9D9A95`}}});return(0,d.jsx)(x.ThemeProvider,{theme:h,children:(0,d.jsx)(b.DateRangePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:a,format:f,calendars:i,slotProps:{shortcuts:{items:p},textField:{variant:`outlined`,size:`small`,fullWidth:s,color:`gr-yellow`,focused:!0,sx:{"& .MuiInputLabel-root":{color:o?`black !important`:`white !important`},"& .MuiInputLabel-root.Mui-focused":{color:o?`black !important`:`white !important`},"& .MuiGrid-root":{marginBottom:`0px !important`}},slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:o?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>o?e.palette[`gr-grey`].light:e.palette[`gr-grey`].main},"& .MuiChip-label":{color:o?`black !important`:`white !important`},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>o?e.palette[`gr-base-dark`].main:`white !important`},"& .MuiPickersCalendarHeader-label":{color:o?`black !important`:`white !important`},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>o?e.palette[`gr-base-dark`].main:`white !important`},"& .Mui-disabled":{color:e=>`${e.palette[`gr-grey`].main} !important`},"& .MuiPickersArrowSwitcher-root":{color:`(theme) => theme.palette["gr-base-dark"].main`},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:o?`black !important`:`white !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:e=>o?e.palette[`gr-grey`].light:`black !important`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}},maxDate:c,minDate:u})})},qT=({label:e,initialValue:t,value:n,setValue:r,disabled:i,white:a,fullWidth:o})=>{let{format:s,singleShortcut:c}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(m.DatePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:i,format:s,slotProps:{shortcuts:{items:c},textField:{variant:`outlined`,size:`small`,fullWidth:o,color:`gr-yellow`,focused:!0,sx:{"& .MuiInputLabel-root":{color:a?`black !important`:`white !important`},"& .MuiInputLabel-root.Mui-focused":{color:a?`black !important`:`white !important`},"& .MuiGrid-root":{marginBottom:`0px !important`}},slotProps:{input:{sx:{borderRadius:`16px`,color:a?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:a?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>a?e.palette[`gr-grey`].light:e.palette[`gr-grey`].main},"& .MuiChip-label":{color:a?`black !important`:`white !important`},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>a?e.palette[`gr-base-dark`].main:`white !important`},"& .MuiPickersCalendarHeader-label":{color:a?`black !important`:`white !important`},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>a?e.palette[`gr-base-dark`].main:`white !important`},"& .Mui-disabled":{color:e=>`${e.palette[`gr-grey`].main} !important`},"& .MuiPickersArrowSwitcher-root":{color:`(theme) => theme.palette["gr-base-dark"].main`},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:a?`black !important`:`white !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:e=>a?e.palette[`gr-grey`].light:`black !important`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}}})})},JT=e=>{let{name:t={title:``,ncolumn:0},fields:n=[],actions:r={ncolumn:1,buttons:[]}}=e,a=(e,t)=>{switch(e.element){case`SelectField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(UT,{label:e.label,placeholder:e.placeholder,value:e.value,setValue:e.setValue,values:e.values,disabled:e.disable,search:e.search,multiple:e.multiple,fullWidth:!0,white:!1})},t);case`MultiSelectField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(WT,{label:e.label,placeholder:e.placeholder,value:e.value,setValue:e.setValue,values:e.values,disabled:e.disable,search:e.search,fullWidth:!0,white:!1})},t);case`DateRangeField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(GT,{label:e.label,value:e.value,setValue:e.setValue,disabled:e.disable,fullWidth:!0})},t);case`DatePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(qT,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:e.disable,fullWidth:!0,white:!1})},t)});case`DateRangePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(KT,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,calendars:e.calendars,disabled:e.disable,fullWidth:!0,white:!1,maxDate:e.maxDate,minDate:e.minDate})},t)});default:return(0,d.jsx)(d.Fragment,{})}};return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Box,{sx:{bgcolor:e=>e.palette.background.paper,height:`70px`,borderTopLeftRadius:`20px`,borderTopRightRadius:`20px`,display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`flex-end`,padding:`20px`,gap:`20px`},children:(0,d.jsxs)(i.Grid,{container:!0,spacing:2,sx:{flexGrow:1},children:[t.title&&(0,d.jsx)(i.Grid,{size:t.ncolumn,sx:{display:`flex`,alignItems:`center`},children:t.title}),n.map((e,t)=>a(e,t)),r&&r.buttons.length>0&&(0,d.jsx)(i.Grid,{size:r.ncolumn,children:(0,d.jsx)(i.Box,{sx:{display:`flex`,justifyContent:`flex-end`,alignItems:`center`,gap:`10px`},children:r.buttons.map((e,t)=>(0,d.jsx)(i.Button,{variant:e.variant,color:`gr-yellow`,sx:{...e.sx},onClick:e.onClick,disabled:e.disabled,disableElevation:!0,children:e.icon?e.icon:(0,d.jsx)(`span`,{style:{marginTop:`2px`,textTransform:`none`,padding:`0px 5px`},children:e.text})},t))})})]})})})},YT=e=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.DataGridPro,{...e,apiRef:e.apiRef,showToolbar:e.toolbar!==void 0,headerFilters:e.headerFilters,slots:{toolbar:JT,headerFilterMenu:null,...e.slots},slotProps:{...e.slotProps,toolbar:{...e.toolbar},baseTextField:{color:e.toolbar===void 0?`error`:`primary`,slotProps:{input:{endAdornment:(0,d.jsx)(i.InputAdornment,{sx:{color:t=>e.toolbar===void 0?t.palette[`gr-grey`].light:t.palette[`gr-grey`].main},position:`end`,children:(0,d.jsx)(S.default,{})})}}},loadingOverlay:{variant:`circular-progress`,noRowsVariant:`circular-progress`}},sx:{border:`none`,color:`black`,flex:1,borderTopLeftRadius:e.toolbar?`0px`:`20px !important`,borderTopRightRadius:e.toolbar?`0px`:`20px !important`,"--DataGrid-t-color-background-base":`transparent !important`,"& .MuiDataGrid-columnHeaderCheckbox":{backgroundColor:`white`},"& .MuiDataGrid-filler--pinnedLeft":{backgroundColor:`white`},"& .MuiDataGrid-filterForm .MuiInputBase-root":{backgroundColor:`#F3F2F2`},"& .MuiDataGrid-columnHeader":{backgroundColor:e.toolbar?`white`:`transparent`,color:e.toolbar?`black`:`white`,borderBottom:e.headerFilters?`none !important`:e=>`${e.palette.primary.main} 1px solid !important`},"& .MuiDataGrid-headerFilterRow":{bgcolor:e.toolbar?`white !important`:`transparent !important`,borderBottom:e=>`${e.palette.primary.main} 1px solid !important`},"& .MuiDataGrid-virtualScroller":{bgcolor:`white`,borderBottomLeftRadius:e.slots?.footer?`0px`:`20px`,borderBottomRightRadius:e.slots?.footer?`0px`:`20px`},"& .MuiDataGrid-columnHeaderTitleContainer":{"& .MuiCheckbox-root":{color:t=>e.toolbar===void 0?t.palette[`gr-grey`].light:t.palette.background.paper}},"& .MuiDataGrid-iconButtonContainer":{"& .MuiIconButton-root":{color:t=>e.toolbar===void 0?t.palette[`gr-grey`].light:t.palette[`gr-grey`].main}},"& .MuiDataGrid-footerContainer":{borderTop:`none`,fontWeight:`500`,display:`flex`,justifyContent:`center`,alignItems:`center`,borderBottomLeftRadius:`20px`,borderBottomRightRadius:`20px`,backgroundColor:`black`},"& .MuiIconButton-root":{color:e=>e.palette.background.paper,"&.Mui-disabled":{color:`#888`,backgroundColor:`#eee`,opacity:.7}},"& .MuiDataGrid-row":{minHeight:45,maxHeight:`none`},"& .MuiDataGrid-cell":{minHeight:45,height:`auto`,maxHeight:`none`,display:`flex`,flexDirection:`column`,alignItems:`start`,justifyContent:`flex-start`,gap:1.5,p:1,borderBottom:`none`,borderTop:`1px solid #CECDCA`},"& .MuiDataGrid-cell--editing":{minHeight:45,height:`auto`,maxHeight:`none`,display:`flex`,flexDirection:`column`,alignItems:`start`,justifyContent:`flex-start`,gap:1.5,p:1},"& .MuiDataGrid-cell--editing input":{color:`black !important`,backgroundColor:`white !important`},"& .MuiDataGrid-row:hover, & .MuiDataGrid-row.Mui-selected":{bgcolor:`#B6B4AF`},"& .MuiDataGrid-cell.enable-cell":{backgroundColor:`white !important`,"& .MuiCheckbox-root":{color:e=>e.palette.background.paper}},"& .MuiDataGrid-cell.parcial-cell":{backgroundColor:`#E7E6E4 !important`,"& .MuiCheckbox-root":{color:e=>e.palette.background.paper}},"& .MuiDataGrid-cell.disable-cell":{backgroundColor:`#E7E6E4 !important`,"& .MuiCheckbox-root":{color:`#CECDCA`}},"& .MuiDataGrid-row:hover .MuiDataGrid-cell.enable-cell":{backgroundColor:`#B6B4AF !important`},"& .MuiDataGrid-row:hover .MuiDataGrid-cell.parcial-cell":{backgroundColor:`#B6B4AF !important`},"& .MuiDataGrid-row:hover .MuiDataGrid-cell.disable-cell":{backgroundColor:`#B6B4AF !important`},...e.sx},loading:e.loading,checkboxSelection:e.checkboxSelection,paginationModel:e.paginationModel,onPaginationModelChange:e.setPaginationModel,onRowSelectionModelChange:e.setRowSelectionModel,rowSelectionModel:e.rowSelectionModel,disableRowSelectionOnClick:e.disableRowSelectionOnClick,getRowHeight:()=>`auto`,onCellEditStop:e.onCellEditStop,disableVirtualization:!0,initialState:e.initialState,showColumnVerticalBorder:!1,showCellVerticalBorder:!1}),(0,d.jsx)(VT,{contextMenu:e.contextMenu,setContextMenu:e.setContextMenu,options:e.options,checked:e.rowSelectionModel,optionGroup:e.optionGroup})]}),XT=()=>{let e=(0,g.useGridApiRef)(),[t,n]=(0,l.useState)(!1),[r,i]=(0,l.useState)([]),[a,o]=(0,l.useState)({pageSize:25,page:0}),[s,c]=(0,l.useState)({type:`include`,ids:new Set}),[u,d]=(0,l.useState)(null),[f,p]=(0,l.useState)(`table`);return{apiRef:e,rows:r,setRows:i,loading:t,setLoading:n,paginationModel:a,setPaginationModel:o,rowSelectionModel:s,setRowSelectionModel:c,contextMenu:u,setContextMenu:d,optionGroup:f,setOptionGroup:p}},ZT=()=>{let{enqueueSnackbar:e}=(0,p.useSnackbar)(),t=e=>{(0,p.closeSnackbar)(e)};return{showAlert:(n,r)=>e(r,{variant:n,content:(e,r)=>(0,d.jsx)(i.Alert,{sx:{borderRadius:`24px`,bgcolor:`#fff`,boxShadow:3,color:e=>e.palette[`gr-base-dark`].main},severity:n,iconMapping:{error:(0,d.jsx)(C.default,{}),info:(0,d.jsx)(E.default,{}),success:(0,d.jsx)(w.default,{}),warning:(0,d.jsx)(T.default,{}),default:(0,d.jsx)(i.CircularProgress,{color:`gr-blue`,size:20})},onClose:()=>t(e),children:r},e)}),closeAlert:t}},QT=({label:e,initialValue:t,value:n,setValue:r,disabled:i,fullWidth:a,white:o})=>{let{format:s}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(k.DateTimeField,{label:e,defaultValue:t,value:n,onChange:e=>{r(e)},sx:{"& .MuiInputBase-root":{borderRadius:`16px`,color:o?`black !important`:`white !important`}},size:`small`,color:`gr-yellow`,slotProps:{textField:{sx:{"& .MuiInputLabel-root":{color:o?`black !important`:`white !important`}},slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:o?`black !important`:`white !important`}}}}}},focused:!0,format:s,disabled:i,fullWidth:a})})},$T=({label:e,placeholder:t,values:n,value:r,setValue:a,white:o})=>{let[s,c]=(0,l.useState)(!1);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Autocomplete,{multiple:!0,options:n,getOptionLabel:e=>e.label,value:n.filter(e=>r.includes(e.value)),onChange:(e,t)=>{a(t.map(e=>e.value))},onOpen:()=>c(!0),onClose:()=>c(!1),renderInput:n=>(0,d.jsx)(i.TextField,{...n,label:e,placeholder:t,variant:`outlined`,sx:{backgroundColor:e=>o?`white`:e.palette[`gr-base-dark`].main,borderTopLeftRadius:`18px`,borderTopRightRadius:`18px`,borderBottomLeftRadius:s?`0px`:`18px`,borderBottomRightRadius:s?`0px`:`18px`,color:o?`black !important`:`white !important`,"& .MuiChip-root":{maxWidth:`100px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},"& .MuiAutocomplete-tag":{maxHeight:`32px`,overflow:`hidden`,display:`inline-flex`,flexWrap:`nowrap`},"& .MuiAutocomplete-inputRoot":{flexWrap:`nowrap`}},color:`gr-yellow`,focused:!0}),renderValue:(e,t)=>e.map((e,n)=>{let{key:r,...a}=t({index:n});return(0,d.jsx)(i.Tooltip,{title:e.highlight?.tooltip,sx:{borderRadius:`24px`},children:(0,d.jsx)(i.Chip,{variant:`filled`,label:e.label,size:`small`,...a,sx:{bgcolor:t=>e.highlight?.active?`${t.palette[`gr-orange`].main}20`:`${t.palette[`gr-grey`].main}20`,color:e=>e.palette[`gr-base-dark`].main,"& .MuiChip-deleteIcon":{color:e=>e.palette[`gr-base-dark`].main,"&:hover":{color:e=>e.palette[`gr-base-dark`].main}},border:e.highlight?.active?`1px solid`:`none`,borderColor:t=>e.highlight?.active?t.palette[`gr-orange`].main:`none`}},r)})}),popupIcon:(0,d.jsx)(A.default,{sx:{color:o?`black`:`white`}}),slotProps:{paper:{sx:{maxHeight:`500px`,borderBottomLeftRadius:`32px`,borderBottomRightRadius:`32px`,borderTopLeftRadius:`0px`,borderTopRightRadius:`0px`,backgroundColor:e=>o?`white`:e.palette[`gr-base-dark`].main,color:o?`black`:`white`}},chip:{sx:{bgcolor:e=>o?`${e.palette[`gr-grey`].light} !important`:`${e.palette[`gr-grey`].main} !important`,color:o?`black`:`white`},size:`small`,deleteIcon:(0,d.jsx)(C.default,{sx:{color:o?`black !important`:`white !important`}})}},limitTags:2,size:`small`})})},eE=({label:e,value:t,setValue:n,values:r,placeholder:a,disabled:o,fullWidth:s,white:c})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.FormControl,{fullWidth:s,focused:!0,children:[(0,d.jsx)(i.InputLabel,{id:`filter-table-label-${e}`,sx:{color:c?`black`:`white`,position:`absolute`,"&.Mui-focused":{color:c?`black`:`white`},'&[data-shrink="false"]':{transform:`translateY(12px) translateX(12px)`}},children:e}),(0,d.jsxs)(i.Select,{labelId:`filter-table-label-${e}`,id:`filter-${e}`,value:t,label:e,onChange:e=>n(e.target.value),color:`gr-yellow`,sx:{color:c?`black`:`white`},IconComponent:e=>(0,d.jsx)(_.default,{...e,sx:{color:c?`black !important`:`white !important`,...e.sx}}),MenuProps:{slotProps:{paper:{style:{maxHeight:`500px`,borderBottomLeftRadius:`32px`,borderBottomRightRadius:`32px`,borderTopLeftRadius:`0px`,borderTopRightRadius:`0px`}},list:{sx:{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,"& .MuiMenuItem-root":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,color:c?`black`:`white`,"&:hover":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-selected":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-focusVisible":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main}}}}}},displayEmpty:!0,disabled:o,children:[(0,d.jsx)(i.MenuItem,{sx:{mt:2},disabled:!0,value:``,children:(0,d.jsx)(`em`,{children:a})}),r.map(e=>(0,d.jsx)(i.MenuItem,{value:e.value,children:e.label},e.value))]})]})}),tE=({item:e,path:t})=>e.children.length===0?(0,d.jsx)(M.TreeItem,{itemId:`${t}/${e.id}`,label:e.name,disabled:e.disabled,onClick:()=>{e.onClick&&e.onClick(`${t}/${e.id}`)}}):(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(M.TreeItem,{itemId:`${t}/${e.id}`,label:e.name,disabled:e.disabled,children:e.children.map(n=>(0,d.jsx)(tE,{item:n,path:`${t}/${e.id}`},n.id))})}),nE=({items:e})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(j.SimpleTreeView,{sx:{borderRadius:`16px`,border:e=>`1px solid ${e.palette[`gr-base-dark`].main}`,p:1.5},children:e.map(e=>(0,d.jsx)(tE,{item:e,path:`origin`},e.id))})}),rE=({label:e,initialValue:t,value:n,setValue:r,disabled:i,fullWidth:a,white:o})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(m.TimeField,{label:e,disabled:i,format:`HH:mm`,ampm:!1,defaultValue:t,value:n,autoFocus:!0,onChange:e=>{r(e)},slotProps:{textField:{variant:`outlined`,size:`small`,fullWidth:a,color:`gr-yellow`,focused:!0,sx:{borderRadius:`16px`},slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`},endAdornment:(0,d.jsx)(N.default,{style:{color:o?`black`:`white`}})}}}}})}),iE=({label:e,initialValue:t,value:n,setValue:r,disabled:i,white:a,fullWidth:o})=>{let{format:s,singleShortcut:c}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(m.DatePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:i,format:s,slotProps:{shortcuts:{items:c},textField:{variant:`outlined`,size:`small`,fullWidth:o,color:`gr-yellow`,focused:!0,slotProps:{input:{sx:{borderRadius:`16px`,color:a?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:a?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>e.palette[`gr-grey`].light},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>e.palette[`gr-base-dark`].main},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:a?`white`:`black`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}}})})},aE=({label:e,initialValue:t,value:n,setValue:r,calendars:i,disabled:a,white:o,fullWidth:s})=>{let{format:c,rangeShortcut:u}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(b.DateRangePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:a,format:c,calendars:i,slotProps:{shortcuts:{items:u},textField:{variant:`outlined`,size:`small`,fullWidth:s,color:`gr-yellow`,focused:!0,slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:o?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>e.palette[`gr-grey`].light},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiPickersArrowSwitcher-root":{color:e=>e.palette[`gr-base-dark`].main},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:o?`white`:`black`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}}})})},oE=({initialValue:e,value:t,setValue:n,calendars:r,disabled:i,white:a})=>{let{rangeShortcut:o}=(0,l.useContext)(W);return(0,d.jsx)(P.StaticDateRangePicker,{defaultValue:e,value:t,onChange:e=>{n(e),console.log(`Selected Range:`,e)},calendars:r,disabled:i,sx:{width:`560px`,overflowX:`auto`,borderRadius:`20px`,"& .MuiChip-root":{bgcolor:e=>e.palette[`gr-grey`].light},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiYearCalendar-button":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiButtonBase-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiPickersArrowSwitcher-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:a?`black !important`:`white !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:a?`black !important`:`white !important`},"& .MuiPickersDay-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiChip-label":{color:e=>`${e.palette[`gr-base-dark`].main} !important`},"& .MuiTypography-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiPickersCalendarHeader-label":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main}},slotProps:{shortcuts:{items:o},actionBar:{actions:[]},layout:{sx:{borderRadius:`20px !important`,bgcolor:a?`white !important`:`black !important`}}}})},sE=({data:e,setData:t,columnLabels:n,buttons:r})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.Grid,{sx:{overflow:`hidden`},container:!0,spacing:2,children:[(0,d.jsxs)(i.Grid,{size:1,children:[(0,d.jsx)(i.Button,{variant:`contained`,size:`small`,color:`gr-base-dark`,sx:{borderRadius:`20px`,height:`40px`,maxWidth:`40px`,minWidth:`40px`,width:`40px`,p:1,mt:7,mb:2},onClick:()=>t(e.slice(0,-1)),children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:`#FFFFFF`,fontSize:`18px`},children:`remove`})}),(0,d.jsx)(i.Button,{variant:`contained`,size:`small`,color:`gr-base-dark`,sx:{borderRadius:`20px`,height:`40px`,maxWidth:`40px`,minWidth:`40px`,width:`40px`,p:1},onClick:()=>t([...e,n.map(()=>({value:``}))]),children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:`#FFFFFF`,fontSize:`18px`},children:`add`})})]}),(0,d.jsx)(i.Grid,{size:11,children:(0,d.jsxs)(i.Grid,{container:!0,children:[(0,d.jsx)(i.Grid,{size:8,sx:{bgcolor:e=>e.palette[`gr-base-dark`].main,borderTopLeftRadius:`20px`,p:1.5,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:1},children:r.map((e,t)=>(0,d.jsxs)(i.Button,{sx:{borderRadius:`20px`,textTransform:`none`},variant:`outlined`,size:`small`,color:`gr-base-light`,onClick:e.onClick,children:[e.label,(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{ml:1,mt:-.5,color:`#FFFFFF`,fontSize:`18px`},children:e.icon})]},t))}),(0,d.jsx)(i.Grid,{size:4,sx:{bgcolor:e=>e.palette[`gr-base-dark`].main,borderTopRightRadius:`20px`,p:1.5,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:1}}),(0,d.jsx)(i.Grid,{size:12,sx:{overflowX:`auto`,width:`55vh`,borderBottomLeftRadius:`20px`,borderBottomRightRadius:`20px`},children:(0,d.jsx)(F.default,{data:e,columnLabels:n,onChange:e=>t(e),className:``})})]})})]})}),cE=e=>{let t=(0,l.useRef)(null);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(D.default,{nodeRef:t,handle:`#draggable-dialog-title`,cancel:`[class*="MuiDialogContent-root"]`,children:(0,d.jsx)(i.Paper,{...e,ref:t,sx:{bgcolor:`white`,color:e=>e.palette.background.paper,padding:`20px`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,gap:`50px`,borderRadius:`20px`}})})})},lE=({title:e,alert:t,action:n,fields:r,open:a,setOpen:o,loading:s,onClickSave:c,showAlertUnsavedChanges:u=!0})=>{let[f,p]=(0,l.useState)(!1),m=(e,t)=>{switch(e.element){case`TextField`:let[r,a]=(0,l.useState)(!1);return e.hide?null:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.TextField,{fullWidth:!0,variant:`outlined`,label:e.label,type:r?`text`:e.type,placeholder:e.placeholder,focused:!0,value:e.value,multiline:e.multiline,rows:e.rows,onChange:t=>{e.setValue(t.target.value)},disabled:e.disable||n?.actionButton?.loading,slotProps:{input:{endAdornment:e.type===`password`?(0,d.jsx)(i.InputAdornment,{position:`end`,children:(0,d.jsx)(i.IconButton,{"aria-label":r?`Ocultar contraseña`:`Mostrar contraseña`,onClick:()=>{a(!r)},edge:`end`,sx:{color:e=>e.palette[`gr-grey`].main},children:r?(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,children:`visibility_off`}):(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,children:`visibility`})})}):void 0}},size:`small`})},t);case`SelectField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(eE,{label:e.label,placeholder:e.placeholder,value:e.value,setValue:e.setValue,values:e.values,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t);case`DateField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(QT,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t);case`CheckboxField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.FormGroup,{children:(0,d.jsx)(i.FormControlLabel,{control:(0,d.jsx)(i.Checkbox,{sx:{ml:1.5,color:e=>e.palette[`gr-base-dark`].main,"&.Mui-checked":{color:e=>e.palette[`gr-base-dark`].main}},checked:e.value,onChange:t=>e.setValue(t.target.checked),disabled:!!(e.disable||n?.actionButton?.loading)}),label:e.label})})},t);case`CheckboxGroup`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.FormGroup,{children:e.checkboxs.map((e,t)=>(0,d.jsx)(i.FormControlLabel,{control:(0,d.jsx)(i.Checkbox,{sx:{ml:1.5,color:e=>e.palette[`gr-base-dark`].main,"&.Mui-checked":{color:e=>e.palette[`gr-base-dark`].main}},checked:e.value,onChange:t=>e.setValue(t.target.checked)}),label:e.label},t))})},t);case`RadioGroupField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsxs)(i.FormControl,{sx:{mt:e.label.text?`none`:`-7px`},children:[(0,d.jsx)(i.FormLabel,{children:e.label.text}),(0,d.jsx)(i.RadioGroup,{value:e.value,onChange:t=>e.setValue(t.target.value),row:e.row,children:e.radios.map((e,t)=>(0,d.jsx)(i.FormControlLabel,{value:e.value,control:(0,d.jsx)(i.Radio,{sx:{color:e=>e.palette[`gr-base-dark`].main,"&.Mui-checked":{color:e=>e.palette[`gr-base-dark`].main}}}),label:e.label.text,labelPlacement:e.label.position,disabled:e.disable},t))})]})},t);case`AutoCompleteField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)($T,{label:e.label,placeholder:`Seleccionar`,values:e.values,value:e.value,setValue:e.setValue,white:!0})},t);case`ListField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.List,{dense:!0,sx:{borderRadius:`16px`,border:t=>e.border?`1px solid ${t.palette[`gr-grey`].dark}`:`none`},children:e.items.map((t,n)=>(0,d.jsxs)(i.ListItem,{secondaryAction:e.action,children:[t.icon&&(0,d.jsx)(i.ListItemIcon,{children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:t.icon?.color},children:t.icon?.name})}),(0,d.jsx)(i.ListItemText,{primary:t.primaryText,secondary:t.secondaryText})]},n))})},t);case`TreeviewField`:return(0,d.jsxs)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:[(0,d.jsx)(i.Typography,{variant:`body1`,children:e.label}),(0,d.jsx)(nE,{items:e.items})]},t);case`TimeField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(rE,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t);case`TypographyField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.Typography,{variant:`body1`,children:e.text})},t);case`DatePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(iE,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!!e.white})},t)});case`DateRangePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(aE,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,calendars:e.calendars,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t)});case`DateRangeCalendarField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(oE,{initialValue:e.initialValue,value:e.value,setValue:e.setValue,calendars:e.calendars,disabled:!!(e.disable||n?.actionButton?.loading),white:e.white})},t)});case`SheetField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(sE,{data:e.data,setData:e.setData,columnLabels:e.columnLabels,buttons:e.buttons})},t)});case`DividerField`:return(0,d.jsx)(i.Grid,{size:12,sx:{mb:`20px`},children:(0,d.jsx)(i.Box,{sx:{width:`100%`,height:`1px`,bgcolor:e=>e.palette[`gr-grey`].dark}})},t);case`CustomField`:return(0,d.jsx)(i.Grid,{size:12,sx:{mb:`20px`},children:e.content},t);default:return(0,d.jsx)(d.Fragment,{})}},h=()=>{r.forEach(e=>{switch(e.element){case`TextField`:e.setValue(e.initialValue);break;case`SelectField`:e.setValue(e.initialValue);break;case`DateField`:e.setValue(e.initialValue);break;case`CheckboxField`:e.setValue(e.initialValue);break;case`CheckboxGroup`:e.checkboxs.forEach(e=>{e.setValue(e.initialValue)});break;case`AutoCompleteField`:e.setValue(e.initialValue);break;case`ListField`:break;case`TreeviewField`:break;case`TimeField`:e.setValue(e.initialValue);break;case`DatePickerField`:e.setValue(e.initialValue);break;case`DateRangePickerField`:e.setValue(e.initialValue);break;case`TypographyField`:break;case`DateRangeCalendarField`:e.setValue(e.initialValue);break;case`RadioGroup`:e.setValue(e.initialValue)}}),p(!1)},g=e=>{e.some(e=>{if(e.element===`CheckboxGroup`)return e.checkboxs.some(e=>e.value!==e.initialValue);if(e.element===`CheckboxField`||e.element===`TextField`||e.element===`SelectField`||e.element===`DateField`)return e.value!==e.initialValue;if(e.element===`AutoCompleteField`)return JSON.stringify(e.value.sort())!==JSON.stringify(e.initialValue.sort());if(e.element===`TimeField`||e.element===`DatePickerField`)return e.value!==e.initialValue;if(e.element===`DateRangePickerField`||e.element===`DateRangeCalendarField`)return JSON.stringify(e.value)!==JSON.stringify(e.initialValue);if(e.element===`RadioGroup`)return e.value!==e.initialValue})?p(!0):o(!1)};return(0,l.useEffect)(()=>{a||h()},[a]),(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.Dialog,{open:a,onClose:()=>{u?g(r):(h(),o(!1))},PaperComponent:cE,"aria-labelledby":`draggable-dialog-title`,children:[(0,d.jsxs)(i.DialogTitle,{style:{cursor:`move`,textAlign:`left`,margin:0,padding:0,width:`100%`},id:`draggable-dialog-title`,children:[e,(0,d.jsx)(i.IconButton,{sx:{position:`absolute`,right:10,top:10},onClick:()=>g(r),children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:e=>e.palette[`gr-base-dark`].main,fontSize:`24px`},children:`close`})})]}),f&&u&&t&&(0,d.jsx)(i.DialogContent,{sx:{padding:0,margin:0,width:`100%`,overflow:`hidden`,minHeight:`85px`},children:(0,d.jsxs)(i.Alert,{icon:(0,d.jsx)(O.default,{}),sx:{borderRadius:`24px`,bgcolor:`#FFEFE5`,border:e=>`1px solid ${e.palette[`gr-orange`].main}`,"& .MuiAlert-icon":{color:e=>e.palette[`gr-orange`].main}},action:(0,d.jsxs)(i.Box,{sx:{mt:3.75},children:[(0,d.jsx)(i.Button,{color:`gr-grey`,size:`small`,onClick:()=>p(!1),children:(0,d.jsx)(`b`,{children:t.actionButton.buttonText})}),(0,d.jsx)(i.Button,{color:`gr-grey`,size:`small`,onClick:()=>{h(),o(!1)},children:(0,d.jsx)(`b`,{children:t.cancelButton.buttonText})})]}),children:[(0,d.jsx)(i.AlertTitle,{children:t.title}),(0,d.jsx)(i.Typography,{variant:`body2`,children:t.message})]})}),(0,d.jsxs)(i.DialogContent,{sx:{padding:0,margin:0,position:`relative`,overflow:s?`hidden`:`auto`},children:[(0,d.jsx)(i.Grid,{container:!0,spacing:2,sx:{mt:1,visibility:s?`hidden`:`visible`},children:r.map((e,t)=>m(e,t))}),s&&(0,d.jsx)(i.Box,{sx:{position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`},children:(0,d.jsx)(i.CircularProgress,{size:60})})]}),(0,d.jsxs)(i.DialogActions,{sx:{display:`flex`,flexDirection:`row`,justifyContent:`flex-end`,alignItems:`center`,width:`100%`},children:[n?.cancelButton&&(0,d.jsx)(i.Button,{variant:`outlined`,autoFocus:!0,onClick:()=>{u?g(r):(h(),o(!1))},sx:{minWidth:`130px`,borderRadius:`44px`,fontWeight:`500`,textTransform:`none`},color:`gr-base-dark`,children:n.cancelButton?.buttonText}),n?.actionButton&&(0,d.jsx)(i.Button,{variant:`contained`,onClick:()=>{c()},sx:{minWidth:`130px`,borderRadius:`44px`,color:`white`,fontWeight:`500`,textTransform:`none`},color:`gr-base-dark`,disableElevation:!0,disabled:n.actionButton.disabled,loading:n.actionButton.loading,children:n.actionButton.buttonText})]})]})})},uE={error:``,warning:``,success:``,suggestion:``,info:``},dE={error:Op.feedbackError,warning:Op.feedbackWarning,success:Op.feedbackSuccess,suggestion:Op.feedbackSuggestion,info:Op.feedbackInfo};function fE({type:e=`info`,title:t,children:n,message:r,onClose:i,closeLabel:a=`Close message`,actions:o,hideIcon:s=!1,className:c}){let l=n??r,u=t??uE[e]??``,f=!!o?.length;return(0,d.jsxs)(`div`,{className:Z(`rb-message-alert`,`rb-message-alert--${e}`,s&&`rb-message-alert--no-icon`,f&&`rb-message-alert--with-actions`,c),role:e===`error`||e===`warning`?`alert`:`status`,children:[s?null:(0,d.jsx)(`span`,{className:`rb-message-alert__icon`,"aria-hidden":`true`,children:(0,d.jsx)(`img`,{src:dE[e],alt:``,className:`size-6`,draggable:!1})}),(0,d.jsxs)(`div`,{className:`rb-message-alert__content`,children:[u?(0,d.jsx)(`div`,{className:`rb-message-alert__title`,children:u}):null,l?(0,d.jsx)(`div`,{className:`rb-message-alert__text`,children:l}):null]}),f?(0,d.jsx)(`div`,{className:`rb-message-alert__actions`,children:o?.map((e,t)=>(0,d.jsx)(R_,{type:`button`,variant:`ghost`,size:`s`,onClick:e.onClick,disabled:e.disabled,children:e.label},t))}):null,i?(0,d.jsx)(`button`,{type:`button`,className:`rb-message-alert__close`,onClick:i,"aria-label":a,children:(0,d.jsx)(`img`,{src:Op.close,alt:``,className:`size-4`,draggable:!1})}):null]})}var pE=`Ir a inicio`,mE=(0,d.jsx)(`span`,{className:`material-symbols-rounded`,children:`inventory_2`}),hE=(0,d.jsx)(`span`,{className:`material-symbols-rounded`,children:`article`}),gE=`Necesitas permisos adicionales`,_E=`No pudimos encontrar esta página`,vE=`Es posible que el enlace haya cambiado, esté deshabilitado o la dirección se haya ingresado de forma incorrecta.`;function yE(e){let t=!!(e&&e.length>0);return(0,d.jsxs)(d.Fragment,{children:[`Por configuración de tu perfil, actualmente no cuentas con el acceso habilitado para esta vista.`,(0,d.jsx)(`br`,{}),`Si consideras que necesitas trabajar en esta pantalla, por favor contacta al administrador de tu cuenta para actualizar tu configuración.`,t?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`br`,{}),(0,d.jsx)(`br`,{}),`Los permisos que se requieren son:`,(0,d.jsx)(`span`,{className:`rb-empty-state__permissions`,role:`list`,children:e.map(e=>(0,d.jsxs)(`span`,{role:`listitem`,children:[`• `,e]},e))})]}):null]})}function bE({variant:e=`empty`,context:t=`page`,icon:n,title:r,description:i,primaryAction:a,secondaryAction:o,permissions:s,onGoHome:c,homePath:l=`/`,hideIcon:u=!1,hideTitle:f=!1,hideDescription:p=!1,hidePrimaryAction:m=!1,hideSecondaryAction:h=!1,className:g}){let _=e!==`empty`,v=n??(_?hE:mE),y=e===`no-permission`?gE:e===`not-found`?_E:r,b=e===`no-permission`?yE(s):e===`not-found`?vE:i,x=_?{label:pE,onClick:c??(()=>window.location.assign(l))}:a,S=!u,C=(_||!f)&&!!y,w=(_||!p)&&!!b,T=(_||!m)&&!!x,E=!_&&!h&&!!o,D=T||E;return(0,d.jsxs)(`div`,{className:Z(`rb-empty-state`,`rb-empty-state--${t}`,g),children:[S?(0,d.jsx)(`span`,{className:`rb-empty-state__icon`,"aria-hidden":`true`,children:v}):null,C?(0,d.jsx)(`h4`,{className:`rb-empty-state__title h4`,children:y}):null,w?(0,d.jsx)(`p`,{className:`rb-empty-state__description p1`,children:b}):null,D?(0,d.jsxs)(`div`,{className:`rb-empty-state__actions`,children:[E?(0,d.jsx)(R_,{type:`button`,size:`s`,variant:`secondary`,onClick:o?.onClick,disabled:o?.disabled,children:o?.label}):null,T?(0,d.jsx)(R_,{type:`button`,size:`s`,variant:`primary`,onClick:x?.onClick,disabled:x?.disabled,children:x?.label}):null]}):null]})}var xE={s:`max-w-[var(--form-shell-s)]`,m:`max-w-[var(--form-shell-m)]`,l:`max-w-[var(--form-shell-l)]`},SE=16,CE=[`button:not([disabled])`,`a[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function wE(e){return e?Array.from(e.querySelectorAll(CE)).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`):[]}function TE(e,t,n){return Math.min(Math.max(e,t),n)}function EE({open:e,title:t,ariaLabel:n,alert:r,children:i,footer:a,onClose:o,loading:s=!1,loadingLabel:c=`Cargando`,closeLabel:u=`Cerrar`,size:f=`m`,draggable:p=!0,closeOnEscape:m=!0,closeOnBackdrop:h=!1,className:g,headerClassName:_,bodyClassName:v,footerClassName:y,marginY:b=0}){let x=(0,l.useId)(),S=(0,l.useRef)(null),C=(0,l.useRef)(null),[w,T]=(0,l.useState)({x:0,y:0}),[E,D]=(0,l.useState)(!1),O=(0,l.useRef)({mouseX:0,mouseY:0,startX:0,startY:0});if((0,l.useEffect)(()=>{e||(T({x:0,y:0}),D(!1))},[e]),(0,l.useEffect)(()=>{if(!e||typeof document>`u`)return;C.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let t=window.requestAnimationFrame(()=>{(wE(S.current)[0]??S.current)?.focus()});return()=>{window.cancelAnimationFrame(t),C.current?.focus()}},[e]),(0,l.useEffect)(()=>{if(!e)return;let t=e=>{if(e.key===`Escape`&&m){e.preventDefault(),o?.();return}if(e.key!==`Tab`||!S.current)return;let t=wE(S.current);if(t.length===0){e.preventDefault(),S.current.focus();return}let n=t[0],r=t[t.length-1],i=document.activeElement;if(e.shiftKey&&i===n){e.preventDefault(),r.focus();return}!e.shiftKey&&i===r&&(e.preventDefault(),n.focus())};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t)}},[e,o,m]),!e)return null;let k=e=>{!p||e.button!==0||e.target instanceof HTMLElement&&e.target.closest(`[data-form-shell-close]`)||(D(!0),O.current={mouseX:e.clientX,mouseY:e.clientY,startX:w.x,startY:w.y},e.currentTarget.setPointerCapture?.(e.pointerId))},A=e=>{if(!p||!E)return;let t=e.clientX-O.current.mouseX,n=e.clientY-O.current.mouseY,r=O.current.startX+t,i=O.current.startY+n,a=S.current;if(!a){T({x:r,y:i});return}let o=SE,s=Math.max(0,(window.innerWidth-a.offsetWidth)/2-o),c=Math.max(0,(window.innerHeight-a.offsetHeight)/2-o);T({x:TE(r,-s,s),y:TE(i,-c,c)})},j=e=>{p&&(D(!1),e.currentTarget.releasePointerCapture?.(e.pointerId))};return(0,d.jsx)(Xw,{children:(0,d.jsx)(`div`,{className:`rb-modal-layer fixed inset-0 flex items-center justify-center bg-[rgba(0,0,0,0.24)] p-4`,role:`presentation`,onPointerDown:e=>{!h||e.target!==e.currentTarget||o?.()},children:(0,d.jsx)(`section`,{ref:S,role:`dialog`,tabIndex:-1,"aria-modal":`true`,"aria-labelledby":t?x:void 0,"aria-label":t?void 0:n??`Formulario`,"aria-busy":s||void 0,className:Z(`relative flex h-fit w-full min-w-0`,`flex-col overflow-hidden`,`font-sans`,`max-h-[calc(100dvh-2rem)]`,`rounded-[var(--r-m)]`,`border border-[var(--border)]`,`bg-[var(--surface-elevated)]`,`text-[var(--text)]`,`shadow-none`,`p-4 min-[36rem]:p-5`,xE[f],g),style:{transform:`translate(${w.x}px, ${w.y}px)`},children:(0,d.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-[var(--surface-elevated)]`,children:[(0,d.jsx)(`header`,{className:Z(`flex shrink-0`,`touch-none select-none`,`items-start gap-3 pr-10`,`bg-[var(--surface-elevated)]`,p?E?`cursor-grabbing`:`cursor-move`:`cursor-default`,_),onPointerDown:k,onPointerMove:A,onPointerUp:j,onPointerCancel:j,children:(0,d.jsx)(`div`,{className:`min-w-0 flex-1`,children:t?(0,d.jsx)(`h2`,{id:x,className:`h4 truncate`,children:t}):null})}),o?(0,d.jsx)(`button`,{type:`button`,"data-form-shell-close":!0,onClick:o,"aria-label":u,className:Z(`motion-fast`,`absolute right-4 top-4`,`z-20 flex size-8`,`items-center justify-center`,`rounded-full`,`min-[36rem]:right-5`,`min-[36rem]:top-5`,`bg-transparent`,`text-[var(--text)]`,`hover:bg-[var(--interaction-hover)]`,`focus-visible:outline-none`,`focus-visible:shadow-[var(--focus-ring-shadow)]`),children:(0,d.jsx)(`img`,{src:Op.close,alt:``,className:`size-4`,draggable:!1})}):null,r?(0,d.jsx)(`div`,{className:`p1 mt-5 shrink-0 bg-[var(--surface-elevated)]`,children:r}):null,(0,d.jsxs)(`div`,{className:Z(`relative flex min-h-0 flex-1`,`flex-col overflow-hidden`,`bg-[var(--surface-elevated)]`,`${`my-${r?`5`:`${b===0?`8`:`${b}`}`}`}`),children:[(0,d.jsx)(`div`,{className:Z(`min-h-0 flex-1`,`overflow-x-hidden`,`overflow-y-auto`,`bg-[var(--surface-elevated)] pr-1`,s&&`overflow-hidden`,v),children:(0,d.jsx)(`div`,{className:Z(`p1 min-w-0 pt-3`,s&&`invisible`),children:i})}),s?(0,d.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:` absolute inset-0 flex items-center justify-center bg-[var(--loading-overlay)]`,children:[(0,d.jsx)(`div`,{className:Z(`size-10 animate-spin`,`rounded-full border-4`,`border-[color-mix(in_oklab,var(--text)_14%,transparent)]`,`border-t-[var(--text)]`),"aria-hidden":`true`}),(0,d.jsx)(`span`,{className:`sr-only`,children:c})]}):null]}),a?(0,d.jsx)(`footer`,{className:Z(`shrink-0`,`bg-[var(--surface-elevated)]`,y),children:a}):null]})})})})}var DE={compact:`gap-y-6`,default:`gap-y-8`,relaxed:`gap-y-10`,loose:`gap-y-12`,spacious:`gap-y-16`},OE={compact:`gap-x-4`,default:`gap-x-5`,wide:`gap-x-6`},kE={1:`col-span-12 min-[36rem]:col-span-1`,2:`col-span-12 min-[36rem]:col-span-2`,3:`col-span-12 min-[36rem]:col-span-3`,4:`col-span-12 min-[36rem]:col-span-4`,5:`col-span-12 min-[36rem]:col-span-5`,6:`col-span-12 min-[36rem]:col-span-6`,7:`col-span-12 min-[36rem]:col-span-7`,8:`col-span-12 min-[36rem]:col-span-8`,9:`col-span-12 min-[36rem]:col-span-9`,10:`col-span-12 min-[36rem]:col-span-10`,11:`col-span-12 min-[36rem]:col-span-11`,12:`col-span-12`};function AE({children:e,rowGap:t=`default`,columnGap:n=`default`,className:r,...i}){return(0,d.jsx)(`div`,{className:Z(`grid w-full min-w-0 grid-cols-12 items-start`,DE[t],OE[n],r),...i,children:e})}function jE({children:e,span:t=12,className:n,...r}){return(0,d.jsx)(`div`,{className:Z(`w-full min-w-0 self-start`,`[&>*]:w-full [&>*]:min-w-0 [&>*]:max-w-full`,kE[t],n),...r,children:e})}var ME=(0,l.forwardRef)(function({children:e,variant:t=`plain`,size:n=`m`,divided:r=!1,emptyState:i=`No hay elementos disponibles.`,className:a,...o},s){let c=l.Children.toArray(e),u=c.length>0;return(0,d.jsx)(`ul`,{ref:s,className:Z(`rb-list`,`rb-list--${t}`,`rb-list--${n}`,r&&`rb-list--divided`,a),...o,children:u?c:i==null?null:(0,d.jsx)(`li`,{className:`rb-list__empty p1`,children:i})})}),NE=(0,l.forwardRef)(function({children:e,icon:t,actions:n,selected:r=!1,disabled:i=!1,className:a,onClick:o,onClickCapture:s,onKeyDown:c,onKeyDownCapture:l,role:u,tabIndex:f,...p},m){let h=!!o&&!n&&!i;return(0,d.jsxs)(`li`,{ref:m,className:Z(`rb-list-item`,a),"data-selected":r||void 0,"data-disabled":i||void 0,"data-interactive":h||void 0,"data-has-actions":!!n||void 0,"data-has-icon":!!t||void 0,"aria-disabled":i||void 0,role:u??(h?`button`:void 0),tabIndex:f??(h?0:void 0),onClick:i?void 0:o,onClickCapture:e=>{if(i){e.preventDefault(),e.stopPropagation();return}s?.(e)},onKeyDownCapture:e=>{if(i){e.preventDefault(),e.stopPropagation();return}l?.(e)},onKeyDown:e=>{c?.(e),!(e.defaultPrevented||!h||e.repeat)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.currentTarget.click())},...p,children:[(0,d.jsxs)(`div`,{className:`rb-list-item__content`,children:[t?(0,d.jsx)(`span`,{className:`rb-list-item__icon`,"aria-hidden":`true`,children:t}):null,(0,d.jsx)(`div`,{className:`rb-list-item__body p1`,children:e})]}),n?(0,d.jsx)(`div`,{className:`rb-list-item__actions`,children:n}):null]})});function PE(...e){return e.filter(Boolean).join(` `)}function FE({value:e,items:t,onChange:n,className:r,ariaLabel:i=`Pestañas`}){return(0,d.jsx)(`div`,{role:`tablist`,"aria-label":i,className:PE(`inline-flex w-fit max-w-full items-center rounded-full bg-white p-1`,`shadow-[0_1px_2px_rgba(0,0,0,0.03)]`,r),children:t.map(t=>{let r=t.value===e;return(0,d.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":r,disabled:t.disabled,onClick:()=>{t.disabled||n(t.value)},className:PE(`inline-flex h-11 items-center justify-center rounded-full px-5 sm:px-6`,`p1 font-semibold leading-none transition-colors`,`min-w-[9rem]`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--base-dark)] focus-visible:ring-offset-2`,r?`bg-[var(--base-dark)] text-white`:`bg-transparent text-[var(--base-dark)] hover:bg-[color-mix(in_oklab,var(--base-dark)_4%,transparent)]`,t.disabled&&`cursor-not-allowed opacity-50 hover:bg-transparent`),children:t.label},t.value)})})}function IE(...e){return e.filter(Boolean).join(` `)}function LE({value:e,items:t,onChange:n,onClose:r,closeLabel:i=`Cerrar`,ariaLabel:a=`Pestañas`,className:o,children:s}){return(0,d.jsxs)(`div`,{className:IE(`flex w-full flex-col items-start gap-6`,`rounded-[20px] bg-white p-5`,o),children:[(0,d.jsxs)(`div`,{className:`flex w-full items-center gap-4`,children:[(0,d.jsx)(`div`,{role:`tablist`,"aria-label":a,className:`flex w-full flex-1 flex-wrap items-center gap-3`,children:t.map(t=>{let r=t.value===e;return(0,d.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":r,disabled:t.disabled,onClick:()=>{t.disabled||n(t.value)},className:IE(`inline-flex h-10 items-center justify-center rounded-full px-5`,`p2 font-semibold leading-none transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--base-dark)] focus-visible:ring-offset-2`,r?`bg-[var(--base-dark)] text-white`:`bg-[var(--g-100)] text-[var(--base-dark)] hover:bg-[var(--g-200)]`,t.disabled&&`cursor-not-allowed opacity-40 hover:bg-[var(--g-100)]`),children:t.label},t.value)})}),r&&(0,d.jsx)(`button`,{type:`button`,onClick:r,"aria-label":i,className:IE(`inline-flex size-11 shrink-0 items-center justify-center rounded-full`,`bg-white text-[var(--base-dark)]`,`transition-colors hover:bg-[var(--interaction-hover)]`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--base-dark)] focus-visible:ring-offset-2`),children:(0,d.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,d.jsx)(`path`,{d:`M2 2L14 14M14 2L2 14`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`})})})]}),s&&(0,d.jsx)(`div`,{className:`w-full`,children:s})]})}function RE(...e){return Z(...e)}function zE(e){return`field`in e}function BE(e=[]){return e.filter(e=>e.show!==!1).map(e=>{if(!zE(e))return e;let t=e.field,n=VE(e),r=e.cellClassName;return{key:t,header:e.headerName??e.header??t,show:e.show,width:n,minWidth:e.minWidth,maxWidth:e.maxWidth,align:e.align??e.headerAlign??`left`,fullWidthRender:e.fullWidthRender,headerClassName:e.headerClassName,sortable:e.sortable,filterable:e.filterable,cellClassName:typeof r==`function`?(e,n)=>r({row:e,index:n,id:HE(e,n),field:t,value:UE(e,t)}):r,render:(n,r)=>{let i={row:n,index:r,id:HE(n,r),field:t,value:UE(n,t)};return e.renderCell?e.renderCell(i):e.valueGetter?e.valueGetter(i):i.value??`—`}}})}function VE(e){return e.width?e.width:e.flex?`${e.flex}fr`:e.minWidth?`minmax(${e.minWidth}px, 1fr)`:`1fr`}function HE(e,t){let n=e?.id;if(n==null||n===``)throw Error(`[RbTable] Cada row debe traer un id obligatorio. Revisa la fila en posición ${t??`desconocida`}.`);return n}function UE(e,t){return e?.[t]}function WE(e){if(!e)return[];if(Array.isArray(e))return e;if(e instanceof Set)return Array.from(e);if(typeof e==`object`&&`ids`in e){let t=e.ids;if(t instanceof Set)return Array.from(t);if(Array.isArray(t))return t}return[]}function GE(e,t){return WE(t).includes(e)}function KE(e,t){let n=WE(t);return n.includes(e)?n.filter(t=>t!==e):[...n,e]}function qE(e,t){return{left:e?.left??t?.left??[],right:e?.right??t?.right??[]}}function JE(e){if(!e)return`minmax(0, 1fr)`;if(typeof e==`number`)return`${e}px`;let t=e.trim();return t.startsWith(`minmax(`)||t.endsWith(`px`)?t:t.includes(`fr`)?`minmax(0, ${t.replace(`fr`,``).trim()||`1`}fr)`:t}function YE(e){if(!e)return 180;if(typeof e==`number`)return e;if(e.endsWith(`px`)){let t=Number(e.replace(`px`,``));return Number.isFinite(t)?t:180}return e.includes(`56`)?56:180}function XE(e){return e===`center`?`text-center justify-center`:e===`right`?`text-right justify-end`:`text-left justify-start`}function ZE(e){return l.default.Children.toArray(e).flatMap(e=>{if(!l.default.isValidElement(e))return e;if(e.type===l.default.Fragment){let t=e.props;return ZE(t.children)}return e})}function QE(e){return e===!0||e===`true`}function $E(e){if(!l.default.isValidElement(e))return!1;let t=e.props,n=e.type;return QE(t[`data-toolbar-actions`])||n.rbToolbarActions===!0}function eD({title:e,description:t,left:n,right:r,className:i}){let a=!!(e||t),o=!!(n||r),s=!!n,c=ZE(r).filter(Boolean);return!a&&!o?null:(0,d.jsxs)(`div`,{className:RE(`rb-table-toolbar`,i),children:[a?(0,d.jsxs)(`div`,{className:`rb-table-toolbar__header`,children:[e?(0,d.jsx)(`div`,{className:`
|
|
287
|
+
`})]});return r?(0,f.createPortal)(a,document.body):null};function DT(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():Math.random().toString(36).slice(2,10)}var OT=()=>({showAlert:(e,t,n={})=>{let r=DT(),i=e===`loading`||e==="default";return gT({id:r,severity:e,message:t,duration:n.duration??(i?void 0:5e3),closeLabel:n.closeLabel}),r},closeAlert:e=>{_T(e)}}),kT=`(max-width: 63.9375rem)`,AT=({sidebar:e,routes:t,account:n})=>{let{state:r,setState:i,getWidth:a}=fe(),[o,s]=(0,l.useState)(()=>typeof window>`u`?!1:window.matchMedia(kT).matches),[c,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=window.matchMedia(kT),t=()=>{let t=e.matches;s(t),t||u(!1)};return t(),e.addEventListener?.(`change`,t),()=>{e.removeEventListener?.(`change`,t)}},[]),(0,d.jsxs)(`div`,{className:`rb-shell rb-shell--${r}`,children:[(0,d.jsx)(Bp,{items:e.items,signOut:e.signOut,tooltips:e.tooltips,state:r,setState:i,getWidth:a,isMobile:o,mobileOpen:c,onCloseMobile:()=>u(!1)}),(0,d.jsx)(dT,{account:n,sidebarItems:e.items,onOpenMobile:o?()=>u(!0):void 0}),(0,d.jsx)(oT,{state:r,getWidth:a,routes:t,account:n}),(0,d.jsx)(ET,{})]})},jT=[`module`,`view`];function MT(){return(0,d.jsx)(`img`,{src:Op.arrowBread,alt:``,"aria-hidden":`true`,className:`size-3 opacity-70`})}function NT(e){return e?decodeURIComponent(e).replaceAll(`-`,` `).replaceAll(`_`,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase()):`—`}function PT(e){let t=e!==`/`&&e.endsWith(`/`)?e.slice(0,-1):e;if(t===`/`)return[];let n=t.split(`/`).filter(Boolean),r=``;return n.map(e=>(r+=`/${e}`,{label:NT(e),to:r}))}function FT({pathname:e,searchParams:t,queryKeys:n,labelFormatter:r}){let i=new URLSearchParams;return n.reduce((n,a)=>{let o=t.get(a);if(!o)return n;i.set(a,o);let s=i.toString();return n.push({label:r?r({key:a,value:o}):NT(o),to:`${e}${s?`?${s}`:``}`}),n},[])}function IT({items:e=[],separator:t=(0,d.jsx)(MT,{}),className:n=``,queryKeys:r=jT,includeHome:i=!0,homeLabel:a=`Home`,homeTo:o=`/`,labelFormatter:s}){let c=(0,u.useNavigate)(),f=(0,u.useLocation)(),[p]=(0,u.useSearchParams)(),m=(0,l.useMemo)(()=>{if(e.length>0)return e;let t=FT({pathname:f.pathname,searchParams:p,queryKeys:r,labelFormatter:s}),n=t.length>0?t:PT(f.pathname);return[...i?[{label:a,to:o}]:[],...n]},[e,f.pathname,p,r,i,a,o,s]);return m.length===0?null:(0,d.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:Z(`max-w-full overflow-hidden`,n),children:(0,d.jsx)(`ol`,{className:`flex min-w-0 flex-wrap items-center gap-2 p2 text-[var(--muted)]`,children:m.map((e,n)=>{let r=n===m.length-1,i=!!e.to&&!r;return(0,d.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2`,children:[n>0&&(0,d.jsx)(`span`,{className:`flex shrink-0 items-center justify-center text-[var(--g-400)]`,"aria-hidden":`true`,children:t}),i?(0,d.jsx)(`button`,{type:`button`,onClick:()=>c(e.to),className:`p2 min-w-0 max-w-[14rem] truncate bg-transparent p-0 text-left text-[var(--muted)] transition-colors hover:text-[var(--text)] hover:underline`,children:e.label}):(0,d.jsx)(`span`,{"aria-current":r?`page`:void 0,className:`p2 min-w-0 max-w-[14rem] truncate font-semibold text-[var(--text)]`,title:typeof e.label==`string`?e.label:void 0,children:e.label})]},`${String(e.label)}-${n}`)})})})}var LT=e=>(0,d.jsx)(AT,{...e}),RT=({sidebar:e,routes:t,product:n,account:r,languages:i,loginForm:a,signup:o,unsavedChangesAlert:s})=>{let{isAuthenticated:c,openUnsaved:u,setOpenUnsaved:f}=(0,l.useContext)(W),p=[{text:s.message,ncolumn:12,element:`TypographyField`}];return(0,d.jsxs)(d.Fragment,{children:[c?(0,d.jsx)(LT,{routes:t,sidebar:e,account:r}):(0,d.jsx)(iT,{product:n,languages:i,form:a,signup:o}),(0,d.jsx)(lE,{title:s.title,open:u,setOpen:f,fields:p,loading:!1,onClickSave:s.actionButton.onClick,action:{actionButton:s.actionButton,cancelButton:s.cancelButton}})]})},zT=({sidebar:e,routes:t,product:n,account:r,languages:o,loginForm:s,signup:c,unsavedChangesAlert:f,msalInstance:g})=>{let{isAuthenticated:_,setIsAuthenticated:v}=(0,l.useContext)(W),[y,b]=(0,l.useState)(0),x=o.find(e=>e.active)||o[0];(0,l.useEffect)(()=>{switch(x.code){case`es`:a.default.locale(`es`);break;case`en`:a.default.locale(`en`);break;case`pt`:a.default.locale(`pt`);break;default:a.default.locale(`en`)}let e=[`token`,`company`,`config`,`privileges`,`account`,`language`,`authenticated`,`type-signin`].filter(e=>localStorage.getItem(e)===null);if(localStorage.getItem(`ues`)===`403`){localStorage.removeItem(`ues`),window.location.href=`/signup`;return}y===0&&window.location.pathname!==`/signup`&&(g.getActiveAccount()&&e.length>0?(console.log(`if 1`),j_(g,g.getActiveAccount())):g.getActiveAccount()&&e.length===0?(console.log(`if 2`),v(!0),localStorage.setItem(`authenticated`,`true`)):!g.getActiveAccount()&&_?(console.log(`if 6`),v(!0)):!g.getActiveAccount()&&e.length===0?(console.log(`if 3`),v(!0),localStorage.setItem(`authenticated`,`true`)):!g.getActiveAccount()&&e.length>0&&(console.log(`if 4`),v(!1),localStorage.setItem(`authenticated`,`false`)),b(y+1))},[x,y]);let S={rabbitLight:de,rabbitDark:(0,i.createTheme)(ue,x.theme.dg,x.theme.core,x.theme.pickers)};return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(Cp,{instance:g,children:(0,d.jsx)(i.Box,{sx:{overflow:`hidden`,height:`100vh`},children:(0,d.jsx)(u.BrowserRouter,{children:(0,d.jsx)(i.ThemeProvider,{theme:S.rabbitDark,children:(0,d.jsx)(m.LocalizationProvider,{dateAdapter:h.AdapterDayjs,adapterLocale:x.code,children:(0,d.jsxs)(p.SnackbarProvider,{maxSnack:15,autoHideDuration:1e4,anchorOrigin:{vertical:`top`,horizontal:`center`},children:[(0,d.jsx)(i.CssBaseline,{}),(0,d.jsx)(RT,{sidebar:e,routes:t,product:n,account:r,languages:o,msalInstance:g,loginForm:s,signup:c,unsavedChangesAlert:f})]})})})})})})})},BT=({children:e})=>{let[t,n]=(0,l.useState)(localStorage.getItem(`authenticated`)===`true`),[r,i]=(0,l.useState)(``),[a,o]=(0,l.useState)(``),[s,c]=(0,l.useState)(``),[u,f]=(0,l.useState)(``),[p,m]=(0,l.useState)(`DD/MM/YYYY`),[h,g]=(0,l.useState)([]),[_,v]=(0,l.useState)([]),[y,b]=(0,l.useState)(!1),[x,S]=(0,l.useState)(``),[C,w]=(0,l.useState)(!1);return(0,d.jsx)(W.Provider,{value:{isAuthenticated:t,setIsAuthenticated:n,user:r,setUser:i,pass:a,setPass:o,avatar:s,setAvatar:c,email:u,setEmail:f,loadingAuth:C,setLoadingAuth:w,format:p,setFormat:m,singleShortcut:h,setSingleShortcut:g,rangeShortcut:_,setRangeShortcut:v,encrypter:(e,t,n)=>{e===`session`?sessionStorage.setItem(t,n):e===`local`&&localStorage.setItem(t,n)},decrypter:(e,t)=>e===`session`?sessionStorage.getItem(t)||``:e===`local`&&localStorage.getItem(t)||``,openUnsaved:y,setOpenUnsaved:b,redirect:x,setRedirect:S},children:e})},VT=({contextMenu:e,setContextMenu:t,options:n,checked:r,optionGroup:a})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i.Menu,{open:e!==null,onClose:()=>t(null),anchorReference:`anchorPosition`,anchorPosition:e===null?void 0:{top:e.mouseY,left:e.mouseX},slots:{transition:i.Fade},slotProps:{paper:{sx:{bgcolor:e=>a===`toolbar`?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main,borderRadius:`12px`},elevation:1}},sx:{cursor:`pointer`},children:n.filter(e=>!e.hide).map((e,t)=>(0,d.jsxs)(i.Box,{children:[t!==0&&n[t-1].group!==e.group?(0,d.jsx)(i.Divider,{}):null,(0,d.jsxs)(i.MenuItem,{onClick:e.click,disabled:e.disabled,children:[(0,d.jsx)(i.ListItemIcon,{sx:{color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},children:e.icon}),(0,d.jsx)(i.ListItemText,{children:(0,d.jsx)(i.Typography,{sx:{color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},children:e.name})}),e.selected?(0,d.jsxs)(i.Typography,{sx:{pl:3,color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},variant:`body2`,children:[`selecionados`,`:`,r.length]}):null,e.onlyOne?(0,d.jsx)(i.Typography,{sx:{pl:3,color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},variant:`body2`,children:`solo uno`}):null]},t)]},t))}),n.filter(e=>!e.hide).map((e,t)=>(0,d.jsx)(i.Box,{children:e.dialog},t))]}),HT=e=>{let t=[],n=new Map;return e.forEach(e=>{let r=e.group??``;n.has(r)||(n.set(r,t.length),t.push({group:e.group,items:[]})),t[n.get(r)].items.push(e)}),t},UT=({label:e,values:t,placeholder:n,value:r,setValue:a,disabled:o,fullWidth:s,white:c,search:u})=>{let f=(0,l.useRef)(null),p=(0,l.useRef)(null),m=(0,l.useRef)(null),[h,g]=(0,l.useState)({width:0,height:0}),[v,y]=(0,l.useState)(!1),[b,x]=(0,l.useState)(``),S=u?.value??b,C=e=>(0,d.jsx)(_.default,{...e,sx:{color:c?`black !important`:`white !important`,...e.sx},onClick:()=>{console.log(`icon click`),y(!v)}});(0,l.useEffect)(()=>{if(!f.current)return;let e=new ResizeObserver(e=>{let{width:t,height:n}=e[0].contentRect;g({width:t,height:n})});return e.observe(f.current),()=>e.disconnect()},[h]),(0,l.useEffect)(()=>{v&&m.current?.focus()},[v]);let w={marginTop:`-55px`,maxHeight:`500px`,borderRadius:`24px`,borderTopLeftRadius:`24px`,borderTopRightRadius:`24px`,width:h.width+20,backgroundColor:`transparent`,"--Paper-overlay":`none`,border:`1px solid rgba(255, 255, 255, 0.2)`};return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.FormControl,{fullWidth:s,focused:!0,children:[(0,d.jsx)(i.InputLabel,{id:`filter-table-label-${e}`,sx:{color:c?`black`:`white`,position:`absolute`,"&.Mui-focused":{color:c?`black`:`white`},'&[data-shrink="false"]':{transform:`translateY(12px) translateX(12px)`}},children:e}),(0,d.jsxs)(i.Select,{ref:f,labelId:`filter-table-label-${e}`,id:`filter-${e}`,open:v,onOpen:()=>{y(!0)},onClose:e=>{let t=e?.target;t&&p.current?.contains(t)||y(!1)},value:r,label:e,onChange:e=>a(e.target.value),multiple:!1,renderValue:e=>{let r=Array.isArray(e)?e[0]:e;return r==null||r===``?n:t.find(e=>e.value===r)?.label||n},color:`gr-yellow`,sx:{color:c?`black`:`white`},IconComponent:C,MenuProps:{autoFocus:!1,disableAutoFocusItem:!0,slotProps:{paper:{style:w},list:{sx:{marginTop:`60px`,backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,"& .MuiMenuItem-root":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,color:c?`black`:`white`,"&:hover":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-selected":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-focusVisible":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main}}}}}},displayEmpty:!0,disabled:o,children:[(0,d.jsx)(i.ListSubheader,{disableSticky:!0,sx:{backgroundColor:`transparent`,px:1.5,py:1},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation()},children:(0,d.jsx)(i.TextField,{ref:p,inputRef:m,variant:`standard`,fullWidth:!0,size:`small`,placeholder:u?.placeholder||`Buscar...`,value:S,onMouseDown:e=>{e.stopPropagation(),y(!0)},onClick:e=>{e.stopPropagation(),y(!0)},onKeyDown:e=>{e.stopPropagation()},onChange:e=>{let t=e.target.value;if(u?.setValue){u.setValue(t);return}x(t)},color:`gr-yellow`})}),HT(t).flatMap((e,t)=>{let n=e.items.some(e=>`${e.label} ${e.sublabel??``}`.toLowerCase().includes(S.toLowerCase())),r=e.group?(0,d.jsx)(i.ListSubheader,{disableSticky:!0,sx:{display:n?`block`:`none`,backgroundColor:`transparent`,color:c?`black`:`white`,fontWeight:600},children:e.group},`group-${e.group}-${t}`):null,a=e.items.map(t=>(0,d.jsx)(i.MenuItem,{value:t.value,sx:{display:`${t.label} ${t.sublabel??``}`.toLowerCase().includes(S.toLowerCase())?`block`:`none`},onClick:()=>{y(!1)},children:(0,d.jsxs)(i.Typography,{variant:`caption`,color:`textSecondary`,children:[t.label,t.sublabel&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`br`,{}),t.sublabel]})]})},`${e.group??``}-${t.value}`));return r?[r,...a]:a})]})]})})},WT=({label:e,value:t,setValue:n,values:r,placeholder:a,disabled:o,fullWidth:s,white:c,search:u})=>{let f=(0,l.useRef)(null),p=(0,l.useRef)(null),[m,h]=(0,l.useState)({width:0,height:0}),[g,v]=(0,l.useState)(!1),[y,b]=(0,l.useState)(``),x=u?.value??y,S=r.filter(e=>`${e.label} ${e.sublabel??``}`.toLowerCase().includes(x.toLowerCase())).map(e=>e.value),C=S.filter(e=>t.includes(e)).length,w=S.length>0&&C===S.length,T=C>0&&!w,E=e=>(0,d.jsx)(_.default,{...e,sx:{color:c?`black !important`:`white !important`,...e.sx},onClick:()=>{v(!g)}});(0,l.useEffect)(()=>{if(!f.current)return;let e=new ResizeObserver(e=>{let{width:t,height:n}=e[0].contentRect;h({width:t,height:n})});return e.observe(f.current),()=>e.disconnect()},[m]);let D={marginTop:`-55px`,maxHeight:`500px`,borderRadius:`24px`,borderTopLeftRadius:`24px`,borderTopRightRadius:`24px`,width:m.width+20,backgroundColor:`transparent`,"--Paper-overlay":`none`,border:`1px solid rgba(255, 255, 255, 0.2)`};return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.FormControl,{fullWidth:s,focused:!0,children:[(0,d.jsx)(i.InputLabel,{id:`filter-table-label-${e}`,sx:{color:c?`black`:`white`,position:`absolute`,"&.Mui-focused":{color:c?`black`:`white`},'&[data-shrink="false"]':{transform:`translateY(12px) translateX(12px)`}},children:e}),(0,d.jsxs)(i.Select,{ref:f,labelId:`filter-table-label-${e}`,id:`filter-${e}`,open:g,onOpen:()=>{v(!0)},onClose:e=>{let t=e?.target;t&&p.current?.contains(t)||v(!1)},value:t,label:e,onChange:e=>{let{target:{value:r}}=e,i=typeof r==`string`?r.split(`,`):r;if(i.includes(`select-all`)){if(w){n(t.filter(e=>!S.includes(e)));return}n(Array.from(new Set([...t,...S])));return}n(i.filter(e=>e!==`select-all`))},color:`gr-yellow`,sx:{color:c?`black`:`white`},IconComponent:E,MenuProps:{slotProps:{paper:{style:D},list:{sx:{marginTop:`60px`,backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,"& .MuiMenuItem-root":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,color:c?`black`:`white`,"&:hover":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-selected":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-focusVisible":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main}}}}}},renderValue:e=>!e||e.length===0?a:r.filter(t=>e.includes(t.value)).map(e=>e.label).join(`, `),displayEmpty:!0,disabled:o,multiple:!0,children:[(0,d.jsx)(i.ListSubheader,{disableSticky:!0,sx:{backgroundColor:`transparent`,px:1.5,py:1},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation()},children:(0,d.jsx)(i.TextField,{ref:p,variant:`standard`,fullWidth:!0,size:`small`,placeholder:u?.placeholder||`Buscar...`,value:x,onMouseDown:e=>{e.stopPropagation(),v(!0)},onClick:e=>{e.stopPropagation(),v(!0)},onKeyDown:e=>{e.stopPropagation()},onChange:e=>{let t=e.target.value;if(u?.setValue){u.setValue(t);return}b(t)},focused:!1,color:`gr-yellow`})}),(0,d.jsxs)(i.MenuItem,{value:`select-all`,disabled:S.length===0,children:[(0,d.jsx)(i.Checkbox,{checked:w,indeterminate:T}),(0,d.jsx)(i.ListItemText,{slotProps:{primary:{sx:{color:`#FFFFFF`}}},primary:`Seleccionar todo`})]}),r.map(e=>(0,d.jsx)(i.MenuItem,{value:e.value,sx:{display:S.includes(e.value)?`block`:`none`},children:(0,d.jsxs)(i.Box,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,d.jsx)(i.Checkbox,{checked:t.includes(e.value)}),(0,d.jsxs)(i.Typography,{variant:`caption`,color:`textSecondary`,children:[e.label,e.sublabel&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`br`,{}),e.sublabel]})]})]})},e.value))]})]})})},GT=({label:e,value:t,setValue:n,disabled:r,fullWidth:i})=>{let{format:a}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(y.LocalizationProvider,{dateAdapter:h.AdapterDayjs,children:(0,d.jsx)(v.SingleInputDateRangeField,{label:e,value:t,onChange:e=>{n(e)},sx:{"& .MuiInputBase-root":{borderRadius:`16px`}},size:`small`,color:`gr-yellow`,slotProps:{textField:{sx:{"& .MuiInputLabel-root":{color:`white !important`}}}},focused:!0,format:a,disabled:r,fullWidth:i})})})},KT=({label:e,initialValue:t,value:n,setValue:r,calendars:i,disabled:a,white:o,fullWidth:s,maxDate:c,minDate:u})=>{let{format:f,rangeShortcut:p}=(0,l.useContext)(W),m=(0,x.useTheme)(),h=(0,x.createTheme)({...m,palette:{...m.palette,primary:{main:`#9D9A95`}}});return(0,d.jsx)(x.ThemeProvider,{theme:h,children:(0,d.jsx)(b.DateRangePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:a,format:f,calendars:i,slotProps:{shortcuts:{items:p},textField:{variant:`outlined`,size:`small`,fullWidth:s,color:`gr-yellow`,focused:!0,sx:{"& .MuiInputLabel-root":{color:o?`black !important`:`white !important`},"& .MuiInputLabel-root.Mui-focused":{color:o?`black !important`:`white !important`},"& .MuiGrid-root":{marginBottom:`0px !important`}},slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:o?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>o?e.palette[`gr-grey`].light:e.palette[`gr-grey`].main},"& .MuiChip-label":{color:o?`black !important`:`white !important`},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>o?e.palette[`gr-base-dark`].main:`white !important`},"& .MuiPickersCalendarHeader-label":{color:o?`black !important`:`white !important`},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>o?e.palette[`gr-base-dark`].main:`white !important`},"& .Mui-disabled":{color:e=>`${e.palette[`gr-grey`].main} !important`},"& .MuiPickersArrowSwitcher-root":{color:`(theme) => theme.palette["gr-base-dark"].main`},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:o?`black !important`:`white !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:e=>o?e.palette[`gr-grey`].light:`black !important`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}},maxDate:c,minDate:u})})},qT=({label:e,initialValue:t,value:n,setValue:r,disabled:i,white:a,fullWidth:o})=>{let{format:s,singleShortcut:c}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(m.DatePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:i,format:s,slotProps:{shortcuts:{items:c},textField:{variant:`outlined`,size:`small`,fullWidth:o,color:`gr-yellow`,focused:!0,sx:{"& .MuiInputLabel-root":{color:a?`black !important`:`white !important`},"& .MuiInputLabel-root.Mui-focused":{color:a?`black !important`:`white !important`},"& .MuiGrid-root":{marginBottom:`0px !important`}},slotProps:{input:{sx:{borderRadius:`16px`,color:a?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:a?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>a?e.palette[`gr-grey`].light:e.palette[`gr-grey`].main},"& .MuiChip-label":{color:a?`black !important`:`white !important`},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>a?e.palette[`gr-base-dark`].main:`white !important`},"& .MuiPickersCalendarHeader-label":{color:a?`black !important`:`white !important`},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>a?e.palette[`gr-base-dark`].main:`white !important`},"& .Mui-disabled":{color:e=>`${e.palette[`gr-grey`].main} !important`},"& .MuiPickersArrowSwitcher-root":{color:`(theme) => theme.palette["gr-base-dark"].main`},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:a?`black !important`:`white !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:e=>a?e.palette[`gr-grey`].light:`black !important`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}}})})},JT=e=>{let{name:t={title:``,ncolumn:0},fields:n=[],actions:r={ncolumn:1,buttons:[]}}=e,a=(e,t)=>{switch(e.element){case`SelectField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(UT,{label:e.label,placeholder:e.placeholder,value:e.value,setValue:e.setValue,values:e.values,disabled:e.disable,search:e.search,multiple:e.multiple,fullWidth:!0,white:!1})},t);case`MultiSelectField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(WT,{label:e.label,placeholder:e.placeholder,value:e.value,setValue:e.setValue,values:e.values,disabled:e.disable,search:e.search,fullWidth:!0,white:!1})},t);case`DateRangeField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(GT,{label:e.label,value:e.value,setValue:e.setValue,disabled:e.disable,fullWidth:!0})},t);case`DatePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(qT,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:e.disable,fullWidth:!0,white:!1})},t)});case`DateRangePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(KT,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,calendars:e.calendars,disabled:e.disable,fullWidth:!0,white:!1,maxDate:e.maxDate,minDate:e.minDate})},t)});default:return(0,d.jsx)(d.Fragment,{})}};return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Box,{sx:{bgcolor:e=>e.palette.background.paper,height:`70px`,borderTopLeftRadius:`20px`,borderTopRightRadius:`20px`,display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`flex-end`,padding:`20px`,gap:`20px`},children:(0,d.jsxs)(i.Grid,{container:!0,spacing:2,sx:{flexGrow:1},children:[t.title&&(0,d.jsx)(i.Grid,{size:t.ncolumn,sx:{display:`flex`,alignItems:`center`},children:t.title}),n.map((e,t)=>a(e,t)),r&&r.buttons.length>0&&(0,d.jsx)(i.Grid,{size:r.ncolumn,children:(0,d.jsx)(i.Box,{sx:{display:`flex`,justifyContent:`flex-end`,alignItems:`center`,gap:`10px`},children:r.buttons.map((e,t)=>(0,d.jsx)(i.Button,{variant:e.variant,color:`gr-yellow`,sx:{...e.sx},onClick:e.onClick,disabled:e.disabled,disableElevation:!0,children:e.icon?e.icon:(0,d.jsx)(`span`,{style:{marginTop:`2px`,textTransform:`none`,padding:`0px 5px`},children:e.text})},t))})})]})})})},YT=e=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.DataGridPro,{...e,apiRef:e.apiRef,showToolbar:e.toolbar!==void 0,headerFilters:e.headerFilters,slots:{toolbar:JT,headerFilterMenu:null,...e.slots},slotProps:{...e.slotProps,toolbar:{...e.toolbar},baseTextField:{color:e.toolbar===void 0?`error`:`primary`,slotProps:{input:{endAdornment:(0,d.jsx)(i.InputAdornment,{sx:{color:t=>e.toolbar===void 0?t.palette[`gr-grey`].light:t.palette[`gr-grey`].main},position:`end`,children:(0,d.jsx)(S.default,{})})}}},loadingOverlay:{variant:`circular-progress`,noRowsVariant:`circular-progress`}},sx:{border:`none`,color:`black`,flex:1,borderTopLeftRadius:e.toolbar?`0px`:`20px !important`,borderTopRightRadius:e.toolbar?`0px`:`20px !important`,"--DataGrid-t-color-background-base":`transparent !important`,"& .MuiDataGrid-columnHeaderCheckbox":{backgroundColor:`white`},"& .MuiDataGrid-filler--pinnedLeft":{backgroundColor:`white`},"& .MuiDataGrid-filterForm .MuiInputBase-root":{backgroundColor:`#F3F2F2`},"& .MuiDataGrid-columnHeader":{backgroundColor:e.toolbar?`white`:`transparent`,color:e.toolbar?`black`:`white`,borderBottom:e.headerFilters?`none !important`:e=>`${e.palette.primary.main} 1px solid !important`},"& .MuiDataGrid-headerFilterRow":{bgcolor:e.toolbar?`white !important`:`transparent !important`,borderBottom:e=>`${e.palette.primary.main} 1px solid !important`},"& .MuiDataGrid-virtualScroller":{bgcolor:`white`,borderBottomLeftRadius:e.slots?.footer?`0px`:`20px`,borderBottomRightRadius:e.slots?.footer?`0px`:`20px`},"& .MuiDataGrid-columnHeaderTitleContainer":{"& .MuiCheckbox-root":{color:t=>e.toolbar===void 0?t.palette[`gr-grey`].light:t.palette.background.paper}},"& .MuiDataGrid-iconButtonContainer":{"& .MuiIconButton-root":{color:t=>e.toolbar===void 0?t.palette[`gr-grey`].light:t.palette[`gr-grey`].main}},"& .MuiDataGrid-footerContainer":{borderTop:`none`,fontWeight:`500`,display:`flex`,justifyContent:`center`,alignItems:`center`,borderBottomLeftRadius:`20px`,borderBottomRightRadius:`20px`,backgroundColor:`black`},"& .MuiIconButton-root":{color:e=>e.palette.background.paper,"&.Mui-disabled":{color:`#888`,backgroundColor:`#eee`,opacity:.7}},"& .MuiDataGrid-row":{minHeight:45,maxHeight:`none`},"& .MuiDataGrid-cell":{minHeight:45,height:`auto`,maxHeight:`none`,display:`flex`,flexDirection:`column`,alignItems:`start`,justifyContent:`flex-start`,gap:1.5,p:1,borderBottom:`none`,borderTop:`1px solid #CECDCA`},"& .MuiDataGrid-cell--editing":{minHeight:45,height:`auto`,maxHeight:`none`,display:`flex`,flexDirection:`column`,alignItems:`start`,justifyContent:`flex-start`,gap:1.5,p:1},"& .MuiDataGrid-cell--editing input":{color:`black !important`,backgroundColor:`white !important`},"& .MuiDataGrid-row:hover, & .MuiDataGrid-row.Mui-selected":{bgcolor:`#B6B4AF`},"& .MuiDataGrid-cell.enable-cell":{backgroundColor:`white !important`,"& .MuiCheckbox-root":{color:e=>e.palette.background.paper}},"& .MuiDataGrid-cell.parcial-cell":{backgroundColor:`#E7E6E4 !important`,"& .MuiCheckbox-root":{color:e=>e.palette.background.paper}},"& .MuiDataGrid-cell.disable-cell":{backgroundColor:`#E7E6E4 !important`,"& .MuiCheckbox-root":{color:`#CECDCA`}},"& .MuiDataGrid-row:hover .MuiDataGrid-cell.enable-cell":{backgroundColor:`#B6B4AF !important`},"& .MuiDataGrid-row:hover .MuiDataGrid-cell.parcial-cell":{backgroundColor:`#B6B4AF !important`},"& .MuiDataGrid-row:hover .MuiDataGrid-cell.disable-cell":{backgroundColor:`#B6B4AF !important`},...e.sx},loading:e.loading,checkboxSelection:e.checkboxSelection,paginationModel:e.paginationModel,onPaginationModelChange:e.setPaginationModel,onRowSelectionModelChange:e.setRowSelectionModel,rowSelectionModel:e.rowSelectionModel,disableRowSelectionOnClick:e.disableRowSelectionOnClick,getRowHeight:()=>`auto`,onCellEditStop:e.onCellEditStop,disableVirtualization:!0,initialState:e.initialState,showColumnVerticalBorder:!1,showCellVerticalBorder:!1}),(0,d.jsx)(VT,{contextMenu:e.contextMenu,setContextMenu:e.setContextMenu,options:e.options,checked:e.rowSelectionModel,optionGroup:e.optionGroup})]}),XT=()=>{let e=(0,g.useGridApiRef)(),[t,n]=(0,l.useState)(!1),[r,i]=(0,l.useState)([]),[a,o]=(0,l.useState)({pageSize:25,page:0}),[s,c]=(0,l.useState)({type:`include`,ids:new Set}),[u,d]=(0,l.useState)(null),[f,p]=(0,l.useState)(`table`);return{apiRef:e,rows:r,setRows:i,loading:t,setLoading:n,paginationModel:a,setPaginationModel:o,rowSelectionModel:s,setRowSelectionModel:c,contextMenu:u,setContextMenu:d,optionGroup:f,setOptionGroup:p}},ZT=()=>{let{enqueueSnackbar:e}=(0,p.useSnackbar)(),t=e=>{(0,p.closeSnackbar)(e)};return{showAlert:(n,r)=>e(r,{variant:n,content:(e,r)=>(0,d.jsx)(i.Alert,{sx:{borderRadius:`24px`,bgcolor:`#fff`,boxShadow:3,color:e=>e.palette[`gr-base-dark`].main},severity:n,iconMapping:{error:(0,d.jsx)(C.default,{}),info:(0,d.jsx)(E.default,{}),success:(0,d.jsx)(w.default,{}),warning:(0,d.jsx)(T.default,{}),default:(0,d.jsx)(i.CircularProgress,{color:`gr-blue`,size:20})},onClose:()=>t(e),children:r},e)}),closeAlert:t}},QT=({label:e,initialValue:t,value:n,setValue:r,disabled:i,fullWidth:a,white:o})=>{let{format:s}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(k.DateTimeField,{label:e,defaultValue:t,value:n,onChange:e=>{r(e)},sx:{"& .MuiInputBase-root":{borderRadius:`16px`,color:o?`black !important`:`white !important`}},size:`small`,color:`gr-yellow`,slotProps:{textField:{sx:{"& .MuiInputLabel-root":{color:o?`black !important`:`white !important`}},slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:o?`black !important`:`white !important`}}}}}},focused:!0,format:s,disabled:i,fullWidth:a})})},$T=({label:e,placeholder:t,values:n,value:r,setValue:a,white:o})=>{let[s,c]=(0,l.useState)(!1);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Autocomplete,{multiple:!0,options:n,getOptionLabel:e=>e.label,value:n.filter(e=>r.includes(e.value)),onChange:(e,t)=>{a(t.map(e=>e.value))},onOpen:()=>c(!0),onClose:()=>c(!1),renderInput:n=>(0,d.jsx)(i.TextField,{...n,label:e,placeholder:t,variant:`outlined`,sx:{backgroundColor:e=>o?`white`:e.palette[`gr-base-dark`].main,borderTopLeftRadius:`18px`,borderTopRightRadius:`18px`,borderBottomLeftRadius:s?`0px`:`18px`,borderBottomRightRadius:s?`0px`:`18px`,color:o?`black !important`:`white !important`,"& .MuiChip-root":{maxWidth:`100px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},"& .MuiAutocomplete-tag":{maxHeight:`32px`,overflow:`hidden`,display:`inline-flex`,flexWrap:`nowrap`},"& .MuiAutocomplete-inputRoot":{flexWrap:`nowrap`}},color:`gr-yellow`,focused:!0}),renderValue:(e,t)=>e.map((e,n)=>{let{key:r,...a}=t({index:n});return(0,d.jsx)(i.Tooltip,{title:e.highlight?.tooltip,sx:{borderRadius:`24px`},children:(0,d.jsx)(i.Chip,{variant:`filled`,label:e.label,size:`small`,...a,sx:{bgcolor:t=>e.highlight?.active?`${t.palette[`gr-orange`].main}20`:`${t.palette[`gr-grey`].main}20`,color:e=>e.palette[`gr-base-dark`].main,"& .MuiChip-deleteIcon":{color:e=>e.palette[`gr-base-dark`].main,"&:hover":{color:e=>e.palette[`gr-base-dark`].main}},border:e.highlight?.active?`1px solid`:`none`,borderColor:t=>e.highlight?.active?t.palette[`gr-orange`].main:`none`}},r)})}),popupIcon:(0,d.jsx)(A.default,{sx:{color:o?`black`:`white`}}),slotProps:{paper:{sx:{maxHeight:`500px`,borderBottomLeftRadius:`32px`,borderBottomRightRadius:`32px`,borderTopLeftRadius:`0px`,borderTopRightRadius:`0px`,backgroundColor:e=>o?`white`:e.palette[`gr-base-dark`].main,color:o?`black`:`white`}},chip:{sx:{bgcolor:e=>o?`${e.palette[`gr-grey`].light} !important`:`${e.palette[`gr-grey`].main} !important`,color:o?`black`:`white`},size:`small`,deleteIcon:(0,d.jsx)(C.default,{sx:{color:o?`black !important`:`white !important`}})}},limitTags:2,size:`small`})})},eE=({label:e,value:t,setValue:n,values:r,placeholder:a,disabled:o,fullWidth:s,white:c})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.FormControl,{fullWidth:s,focused:!0,children:[(0,d.jsx)(i.InputLabel,{id:`filter-table-label-${e}`,sx:{color:c?`black`:`white`,position:`absolute`,"&.Mui-focused":{color:c?`black`:`white`},'&[data-shrink="false"]':{transform:`translateY(12px) translateX(12px)`}},children:e}),(0,d.jsxs)(i.Select,{labelId:`filter-table-label-${e}`,id:`filter-${e}`,value:t,label:e,onChange:e=>n(e.target.value),color:`gr-yellow`,sx:{color:c?`black`:`white`},IconComponent:e=>(0,d.jsx)(_.default,{...e,sx:{color:c?`black !important`:`white !important`,...e.sx}}),MenuProps:{slotProps:{paper:{style:{maxHeight:`500px`,borderBottomLeftRadius:`32px`,borderBottomRightRadius:`32px`,borderTopLeftRadius:`0px`,borderTopRightRadius:`0px`}},list:{sx:{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,"& .MuiMenuItem-root":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,color:c?`black`:`white`,"&:hover":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-selected":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-focusVisible":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main}}}}}},displayEmpty:!0,disabled:o,children:[(0,d.jsx)(i.MenuItem,{sx:{mt:2},disabled:!0,value:``,children:(0,d.jsx)(`em`,{children:a})}),r.map(e=>(0,d.jsx)(i.MenuItem,{value:e.value,children:e.label},e.value))]})]})}),tE=({item:e,path:t})=>e.children.length===0?(0,d.jsx)(M.TreeItem,{itemId:`${t}/${e.id}`,label:e.name,disabled:e.disabled,onClick:()=>{e.onClick&&e.onClick(`${t}/${e.id}`)}}):(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(M.TreeItem,{itemId:`${t}/${e.id}`,label:e.name,disabled:e.disabled,children:e.children.map(n=>(0,d.jsx)(tE,{item:n,path:`${t}/${e.id}`},n.id))})}),nE=({items:e})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(j.SimpleTreeView,{sx:{borderRadius:`16px`,border:e=>`1px solid ${e.palette[`gr-base-dark`].main}`,p:1.5},children:e.map(e=>(0,d.jsx)(tE,{item:e,path:`origin`},e.id))})}),rE=({label:e,initialValue:t,value:n,setValue:r,disabled:i,fullWidth:a,white:o})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(m.TimeField,{label:e,disabled:i,format:`HH:mm`,ampm:!1,defaultValue:t,value:n,autoFocus:!0,onChange:e=>{r(e)},slotProps:{textField:{variant:`outlined`,size:`small`,fullWidth:a,color:`gr-yellow`,focused:!0,sx:{borderRadius:`16px`},slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`},endAdornment:(0,d.jsx)(N.default,{style:{color:o?`black`:`white`}})}}}}})}),iE=({label:e,initialValue:t,value:n,setValue:r,disabled:i,white:a,fullWidth:o})=>{let{format:s,singleShortcut:c}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(m.DatePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:i,format:s,slotProps:{shortcuts:{items:c},textField:{variant:`outlined`,size:`small`,fullWidth:o,color:`gr-yellow`,focused:!0,slotProps:{input:{sx:{borderRadius:`16px`,color:a?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:a?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>e.palette[`gr-grey`].light},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>e.palette[`gr-base-dark`].main},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:a?`white`:`black`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}}})})},aE=({label:e,initialValue:t,value:n,setValue:r,calendars:i,disabled:a,white:o,fullWidth:s})=>{let{format:c,rangeShortcut:u}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(b.DateRangePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:a,format:c,calendars:i,slotProps:{shortcuts:{items:u},textField:{variant:`outlined`,size:`small`,fullWidth:s,color:`gr-yellow`,focused:!0,slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:o?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>e.palette[`gr-grey`].light},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiPickersArrowSwitcher-root":{color:e=>e.palette[`gr-base-dark`].main},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:o?`white`:`black`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}}})})},oE=({initialValue:e,value:t,setValue:n,calendars:r,disabled:i,white:a})=>{let{rangeShortcut:o}=(0,l.useContext)(W);return(0,d.jsx)(P.StaticDateRangePicker,{defaultValue:e,value:t,onChange:e=>{n(e),console.log(`Selected Range:`,e)},calendars:r,disabled:i,sx:{width:`560px`,overflowX:`auto`,borderRadius:`20px`,"& .MuiChip-root":{bgcolor:e=>e.palette[`gr-grey`].light},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiYearCalendar-button":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiButtonBase-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiPickersArrowSwitcher-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:a?`black !important`:`white !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:a?`black !important`:`white !important`},"& .MuiPickersDay-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiChip-label":{color:e=>`${e.palette[`gr-base-dark`].main} !important`},"& .MuiTypography-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiPickersCalendarHeader-label":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main}},slotProps:{shortcuts:{items:o},actionBar:{actions:[]},layout:{sx:{borderRadius:`20px !important`,bgcolor:a?`white !important`:`black !important`}}}})},sE=({data:e,setData:t,columnLabels:n,buttons:r})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.Grid,{sx:{overflow:`hidden`},container:!0,spacing:2,children:[(0,d.jsxs)(i.Grid,{size:1,children:[(0,d.jsx)(i.Button,{variant:`contained`,size:`small`,color:`gr-base-dark`,sx:{borderRadius:`20px`,height:`40px`,maxWidth:`40px`,minWidth:`40px`,width:`40px`,p:1,mt:7,mb:2},onClick:()=>t(e.slice(0,-1)),children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:`#FFFFFF`,fontSize:`18px`},children:`remove`})}),(0,d.jsx)(i.Button,{variant:`contained`,size:`small`,color:`gr-base-dark`,sx:{borderRadius:`20px`,height:`40px`,maxWidth:`40px`,minWidth:`40px`,width:`40px`,p:1},onClick:()=>t([...e,n.map(()=>({value:``}))]),children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:`#FFFFFF`,fontSize:`18px`},children:`add`})})]}),(0,d.jsx)(i.Grid,{size:11,children:(0,d.jsxs)(i.Grid,{container:!0,children:[(0,d.jsx)(i.Grid,{size:8,sx:{bgcolor:e=>e.palette[`gr-base-dark`].main,borderTopLeftRadius:`20px`,p:1.5,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:1},children:r.map((e,t)=>(0,d.jsxs)(i.Button,{sx:{borderRadius:`20px`,textTransform:`none`},variant:`outlined`,size:`small`,color:`gr-base-light`,onClick:e.onClick,children:[e.label,(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{ml:1,mt:-.5,color:`#FFFFFF`,fontSize:`18px`},children:e.icon})]},t))}),(0,d.jsx)(i.Grid,{size:4,sx:{bgcolor:e=>e.palette[`gr-base-dark`].main,borderTopRightRadius:`20px`,p:1.5,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:1}}),(0,d.jsx)(i.Grid,{size:12,sx:{overflowX:`auto`,width:`55vh`,borderBottomLeftRadius:`20px`,borderBottomRightRadius:`20px`},children:(0,d.jsx)(F.default,{data:e,columnLabels:n,onChange:e=>t(e),className:``})})]})})]})}),cE=e=>{let t=(0,l.useRef)(null);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(D.default,{nodeRef:t,handle:`#draggable-dialog-title`,cancel:`[class*="MuiDialogContent-root"]`,children:(0,d.jsx)(i.Paper,{...e,ref:t,sx:{bgcolor:`white`,color:e=>e.palette.background.paper,padding:`20px`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,gap:`50px`,borderRadius:`20px`}})})})},lE=({title:e,alert:t,action:n,fields:r,open:a,setOpen:o,loading:s,onClickSave:c,showAlertUnsavedChanges:u=!0})=>{let[f,p]=(0,l.useState)(!1),m=(e,t)=>{switch(e.element){case`TextField`:let[r,a]=(0,l.useState)(!1);return e.hide?null:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.TextField,{fullWidth:!0,variant:`outlined`,label:e.label,type:r?`text`:e.type,placeholder:e.placeholder,focused:!0,value:e.value,multiline:e.multiline,rows:e.rows,onChange:t=>{e.setValue(t.target.value)},disabled:e.disable||n?.actionButton?.loading,slotProps:{input:{endAdornment:e.type===`password`?(0,d.jsx)(i.InputAdornment,{position:`end`,children:(0,d.jsx)(i.IconButton,{"aria-label":r?`Ocultar contraseña`:`Mostrar contraseña`,onClick:()=>{a(!r)},edge:`end`,sx:{color:e=>e.palette[`gr-grey`].main},children:r?(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,children:`visibility_off`}):(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,children:`visibility`})})}):void 0}},size:`small`})},t);case`SelectField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(eE,{label:e.label,placeholder:e.placeholder,value:e.value,setValue:e.setValue,values:e.values,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t);case`DateField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(QT,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t);case`CheckboxField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.FormGroup,{children:(0,d.jsx)(i.FormControlLabel,{control:(0,d.jsx)(i.Checkbox,{sx:{ml:1.5,color:e=>e.palette[`gr-base-dark`].main,"&.Mui-checked":{color:e=>e.palette[`gr-base-dark`].main}},checked:e.value,onChange:t=>e.setValue(t.target.checked),disabled:!!(e.disable||n?.actionButton?.loading)}),label:e.label})})},t);case`CheckboxGroup`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.FormGroup,{children:e.checkboxs.map((e,t)=>(0,d.jsx)(i.FormControlLabel,{control:(0,d.jsx)(i.Checkbox,{sx:{ml:1.5,color:e=>e.palette[`gr-base-dark`].main,"&.Mui-checked":{color:e=>e.palette[`gr-base-dark`].main}},checked:e.value,onChange:t=>e.setValue(t.target.checked)}),label:e.label},t))})},t);case`RadioGroupField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsxs)(i.FormControl,{sx:{mt:e.label.text?`none`:`-7px`},children:[(0,d.jsx)(i.FormLabel,{children:e.label.text}),(0,d.jsx)(i.RadioGroup,{value:e.value,onChange:t=>e.setValue(t.target.value),row:e.row,children:e.radios.map((e,t)=>(0,d.jsx)(i.FormControlLabel,{value:e.value,control:(0,d.jsx)(i.Radio,{sx:{color:e=>e.palette[`gr-base-dark`].main,"&.Mui-checked":{color:e=>e.palette[`gr-base-dark`].main}}}),label:e.label.text,labelPlacement:e.label.position,disabled:e.disable},t))})]})},t);case`AutoCompleteField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)($T,{label:e.label,placeholder:`Seleccionar`,values:e.values,value:e.value,setValue:e.setValue,white:!0})},t);case`ListField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.List,{dense:!0,sx:{borderRadius:`16px`,border:t=>e.border?`1px solid ${t.palette[`gr-grey`].dark}`:`none`},children:e.items.map((t,n)=>(0,d.jsxs)(i.ListItem,{secondaryAction:e.action,children:[t.icon&&(0,d.jsx)(i.ListItemIcon,{children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:t.icon?.color},children:t.icon?.name})}),(0,d.jsx)(i.ListItemText,{primary:t.primaryText,secondary:t.secondaryText})]},n))})},t);case`TreeviewField`:return(0,d.jsxs)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:[(0,d.jsx)(i.Typography,{variant:`body1`,children:e.label}),(0,d.jsx)(nE,{items:e.items})]},t);case`TimeField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(rE,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t);case`TypographyField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.Typography,{variant:`body1`,children:e.text})},t);case`DatePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(iE,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!!e.white})},t)});case`DateRangePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(aE,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,calendars:e.calendars,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t)});case`DateRangeCalendarField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(oE,{initialValue:e.initialValue,value:e.value,setValue:e.setValue,calendars:e.calendars,disabled:!!(e.disable||n?.actionButton?.loading),white:e.white})},t)});case`SheetField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(sE,{data:e.data,setData:e.setData,columnLabels:e.columnLabels,buttons:e.buttons})},t)});case`DividerField`:return(0,d.jsx)(i.Grid,{size:12,sx:{mb:`20px`},children:(0,d.jsx)(i.Box,{sx:{width:`100%`,height:`1px`,bgcolor:e=>e.palette[`gr-grey`].dark}})},t);case`CustomField`:return(0,d.jsx)(i.Grid,{size:12,sx:{mb:`20px`},children:e.content},t);default:return(0,d.jsx)(d.Fragment,{})}},h=()=>{r.forEach(e=>{switch(e.element){case`TextField`:e.setValue(e.initialValue);break;case`SelectField`:e.setValue(e.initialValue);break;case`DateField`:e.setValue(e.initialValue);break;case`CheckboxField`:e.setValue(e.initialValue);break;case`CheckboxGroup`:e.checkboxs.forEach(e=>{e.setValue(e.initialValue)});break;case`AutoCompleteField`:e.setValue(e.initialValue);break;case`ListField`:break;case`TreeviewField`:break;case`TimeField`:e.setValue(e.initialValue);break;case`DatePickerField`:e.setValue(e.initialValue);break;case`DateRangePickerField`:e.setValue(e.initialValue);break;case`TypographyField`:break;case`DateRangeCalendarField`:e.setValue(e.initialValue);break;case`RadioGroup`:e.setValue(e.initialValue)}}),p(!1)},g=e=>{e.some(e=>{if(e.element===`CheckboxGroup`)return e.checkboxs.some(e=>e.value!==e.initialValue);if(e.element===`CheckboxField`||e.element===`TextField`||e.element===`SelectField`||e.element===`DateField`)return e.value!==e.initialValue;if(e.element===`AutoCompleteField`)return JSON.stringify(e.value.sort())!==JSON.stringify(e.initialValue.sort());if(e.element===`TimeField`||e.element===`DatePickerField`)return e.value!==e.initialValue;if(e.element===`DateRangePickerField`||e.element===`DateRangeCalendarField`)return JSON.stringify(e.value)!==JSON.stringify(e.initialValue);if(e.element===`RadioGroup`)return e.value!==e.initialValue})?p(!0):o(!1)};return(0,l.useEffect)(()=>{a||h()},[a]),(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.Dialog,{open:a,onClose:()=>{u?g(r):(h(),o(!1))},PaperComponent:cE,"aria-labelledby":`draggable-dialog-title`,children:[(0,d.jsxs)(i.DialogTitle,{style:{cursor:`move`,textAlign:`left`,margin:0,padding:0,width:`100%`},id:`draggable-dialog-title`,children:[e,(0,d.jsx)(i.IconButton,{sx:{position:`absolute`,right:10,top:10},onClick:()=>g(r),children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:e=>e.palette[`gr-base-dark`].main,fontSize:`24px`},children:`close`})})]}),f&&u&&t&&(0,d.jsx)(i.DialogContent,{sx:{padding:0,margin:0,width:`100%`,overflow:`hidden`,minHeight:`85px`},children:(0,d.jsxs)(i.Alert,{icon:(0,d.jsx)(O.default,{}),sx:{borderRadius:`24px`,bgcolor:`#FFEFE5`,border:e=>`1px solid ${e.palette[`gr-orange`].main}`,"& .MuiAlert-icon":{color:e=>e.palette[`gr-orange`].main}},action:(0,d.jsxs)(i.Box,{sx:{mt:3.75},children:[(0,d.jsx)(i.Button,{color:`gr-grey`,size:`small`,onClick:()=>p(!1),children:(0,d.jsx)(`b`,{children:t.actionButton.buttonText})}),(0,d.jsx)(i.Button,{color:`gr-grey`,size:`small`,onClick:()=>{h(),o(!1)},children:(0,d.jsx)(`b`,{children:t.cancelButton.buttonText})})]}),children:[(0,d.jsx)(i.AlertTitle,{children:t.title}),(0,d.jsx)(i.Typography,{variant:`body2`,children:t.message})]})}),(0,d.jsxs)(i.DialogContent,{sx:{padding:0,margin:0,position:`relative`,overflow:s?`hidden`:`auto`},children:[(0,d.jsx)(i.Grid,{container:!0,spacing:2,sx:{mt:1,visibility:s?`hidden`:`visible`},children:r.map((e,t)=>m(e,t))}),s&&(0,d.jsx)(i.Box,{sx:{position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`},children:(0,d.jsx)(i.CircularProgress,{size:60})})]}),(0,d.jsxs)(i.DialogActions,{sx:{display:`flex`,flexDirection:`row`,justifyContent:`flex-end`,alignItems:`center`,width:`100%`},children:[n?.cancelButton&&(0,d.jsx)(i.Button,{variant:`outlined`,autoFocus:!0,onClick:()=>{u?g(r):(h(),o(!1))},sx:{minWidth:`130px`,borderRadius:`44px`,fontWeight:`500`,textTransform:`none`},color:`gr-base-dark`,children:n.cancelButton?.buttonText}),n?.actionButton&&(0,d.jsx)(i.Button,{variant:`contained`,onClick:()=>{c()},sx:{minWidth:`130px`,borderRadius:`44px`,color:`white`,fontWeight:`500`,textTransform:`none`},color:`gr-base-dark`,disableElevation:!0,disabled:n.actionButton.disabled,loading:n.actionButton.loading,children:n.actionButton.buttonText})]})]})})},uE={error:``,warning:``,success:``,suggestion:``,info:``},dE={error:Op.feedbackError,warning:Op.feedbackWarning,success:Op.feedbackSuccess,suggestion:Op.feedbackSuggestion,info:Op.feedbackInfo};function fE({type:e=`info`,title:t,children:n,message:r,onClose:i,closeLabel:a=`Close message`,actions:o,hideIcon:s=!1,className:c}){let l=n??r,u=t??uE[e]??``,f=!!o?.length;return(0,d.jsxs)(`div`,{className:Z(`rb-message-alert`,`rb-message-alert--${e}`,s&&`rb-message-alert--no-icon`,f&&`rb-message-alert--with-actions`,c),role:e===`error`||e===`warning`?`alert`:`status`,children:[s?null:(0,d.jsx)(`span`,{className:`rb-message-alert__icon`,"aria-hidden":`true`,children:(0,d.jsx)(`img`,{src:dE[e],alt:``,className:`size-6`,draggable:!1})}),(0,d.jsxs)(`div`,{className:`rb-message-alert__content`,children:[u?(0,d.jsx)(`div`,{className:`rb-message-alert__title`,children:u}):null,l?(0,d.jsx)(`div`,{className:`rb-message-alert__text`,children:l}):null]}),f?(0,d.jsx)(`div`,{className:`rb-message-alert__actions`,children:o?.map((e,t)=>(0,d.jsx)(R_,{type:`button`,variant:`ghost`,size:`s`,onClick:e.onClick,disabled:e.disabled,children:e.label},t))}):null,i?(0,d.jsx)(`button`,{type:`button`,className:`rb-message-alert__close`,onClick:i,"aria-label":a,children:(0,d.jsx)(`img`,{src:Op.close,alt:``,className:`size-4`,draggable:!1})}):null]})}var pE=`Ir a inicio`,mE=(0,d.jsx)(`span`,{className:`material-symbols-rounded`,children:`inventory_2`}),hE=(0,d.jsx)(`span`,{className:`material-symbols-rounded`,children:`article`}),gE=`Necesitas permisos adicionales`,_E=`No pudimos encontrar esta página`,vE=`Es posible que el enlace haya cambiado, esté deshabilitado o la dirección se haya ingresado de forma incorrecta.`;function yE(e){let t=!!(e&&e.length>0);return(0,d.jsxs)(d.Fragment,{children:[`Por configuración de tu perfil, actualmente no cuentas con el acceso habilitado para esta vista.`,(0,d.jsx)(`br`,{}),`Si consideras que necesitas trabajar en esta pantalla, por favor contacta al administrador de tu cuenta para actualizar tu configuración.`,t?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`br`,{}),(0,d.jsx)(`br`,{}),`Los permisos que se requieren son:`,(0,d.jsx)(`span`,{className:`rb-empty-state__permissions`,role:`list`,children:e.map(e=>(0,d.jsxs)(`span`,{role:`listitem`,children:[`• `,e]},e))})]}):null]})}function bE({variant:e=`empty`,context:t=`page`,icon:n,title:r,description:i,primaryAction:a,secondaryAction:o,permissions:s,onGoHome:c,homePath:l=`/`,hideIcon:u=!1,hideTitle:f=!1,hideDescription:p=!1,hidePrimaryAction:m=!1,hideSecondaryAction:h=!1,className:g}){let _=e!==`empty`,v=n??(_?hE:mE),y=e===`no-permission`?gE:e===`not-found`?_E:r,b=e===`no-permission`?yE(s):e===`not-found`?vE:i,x=_?{label:pE,onClick:c??(()=>window.location.assign(l))}:a,S=!u,C=(_||!f)&&!!y,w=(_||!p)&&!!b,T=(_||!m)&&!!x,E=!_&&!h&&!!o,D=T||E;return(0,d.jsxs)(`div`,{className:Z(`rb-empty-state`,`rb-empty-state--${t}`,g),children:[S?(0,d.jsx)(`span`,{className:`rb-empty-state__icon`,"aria-hidden":`true`,children:v}):null,C?(0,d.jsx)(`h4`,{className:`rb-empty-state__title h4`,children:y}):null,w?(0,d.jsx)(`p`,{className:`rb-empty-state__description p1`,children:b}):null,D?(0,d.jsxs)(`div`,{className:`rb-empty-state__actions`,children:[E?(0,d.jsx)(R_,{type:`button`,size:`s`,variant:`secondary`,onClick:o?.onClick,disabled:o?.disabled,children:o?.label}):null,T?(0,d.jsx)(R_,{type:`button`,size:`s`,variant:`primary`,onClick:x?.onClick,disabled:x?.disabled,children:x?.label}):null]}):null]})}var xE={s:`max-w-[var(--form-shell-s)]`,m:`max-w-[var(--form-shell-m)]`,l:`max-w-[var(--form-shell-l)]`},SE=16,CE=[`button:not([disabled])`,`a[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function wE(e){return e?Array.from(e.querySelectorAll(CE)).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`):[]}function TE(e,t,n){return Math.min(Math.max(e,t),n)}function EE({open:e,title:t,ariaLabel:n,alert:r,children:i,footer:a,onClose:o,loading:s=!1,loadingLabel:c=`Cargando`,closeLabel:u=`Cerrar`,size:f=`m`,draggable:p=!0,closeOnEscape:m=!0,closeOnBackdrop:h=!1,className:g,headerClassName:_,bodyClassName:v,footerClassName:y,marginY:b=0}){let x=(0,l.useId)(),S=(0,l.useRef)(null),C=(0,l.useRef)(null),[w,T]=(0,l.useState)({x:0,y:0}),[E,D]=(0,l.useState)(!1),O=(0,l.useRef)({mouseX:0,mouseY:0,startX:0,startY:0});if((0,l.useEffect)(()=>{e||(T({x:0,y:0}),D(!1))},[e]),(0,l.useEffect)(()=>{if(!e||typeof document>`u`)return;C.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let t=window.requestAnimationFrame(()=>{(wE(S.current)[0]??S.current)?.focus()});return()=>{window.cancelAnimationFrame(t),C.current?.focus()}},[e]),(0,l.useEffect)(()=>{if(!e)return;let t=e=>{if(e.key===`Escape`&&m){e.preventDefault(),o?.();return}if(e.key!==`Tab`||!S.current)return;let t=wE(S.current);if(t.length===0){e.preventDefault(),S.current.focus();return}let n=t[0],r=t[t.length-1],i=document.activeElement;if(e.shiftKey&&i===n){e.preventDefault(),r.focus();return}!e.shiftKey&&i===r&&(e.preventDefault(),n.focus())};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t)}},[e,o,m]),!e)return null;let k=e=>{!p||e.button!==0||e.target instanceof HTMLElement&&e.target.closest(`[data-form-shell-close]`)||(D(!0),O.current={mouseX:e.clientX,mouseY:e.clientY,startX:w.x,startY:w.y},e.currentTarget.setPointerCapture?.(e.pointerId))},A=e=>{if(!p||!E)return;let t=e.clientX-O.current.mouseX,n=e.clientY-O.current.mouseY,r=O.current.startX+t,i=O.current.startY+n,a=S.current;if(!a){T({x:r,y:i});return}let o=SE,s=Math.max(0,(window.innerWidth-a.offsetWidth)/2-o),c=Math.max(0,(window.innerHeight-a.offsetHeight)/2-o);T({x:TE(r,-s,s),y:TE(i,-c,c)})},j=e=>{p&&(D(!1),e.currentTarget.releasePointerCapture?.(e.pointerId))};return(0,d.jsx)(Xw,{children:(0,d.jsx)(`div`,{className:`rb-modal-layer fixed inset-0 flex items-center justify-center bg-[rgba(0,0,0,0.24)] p-4`,role:`presentation`,onPointerDown:e=>{!h||e.target!==e.currentTarget||o?.()},children:(0,d.jsx)(`section`,{ref:S,role:`dialog`,tabIndex:-1,"aria-modal":`true`,"aria-labelledby":t?x:void 0,"aria-label":t?void 0:n??`Formulario`,"aria-busy":s||void 0,className:Z(`relative flex h-fit w-full min-w-0`,`flex-col overflow-hidden`,`font-sans`,`max-h-[calc(100dvh-2rem)]`,`rounded-[var(--r-m)]`,`border border-[var(--border)]`,`bg-[var(--surface-elevated)]`,`text-[var(--text)]`,`shadow-none`,`p-4 min-[36rem]:p-5`,xE[f],g),style:{transform:`translate(${w.x}px, ${w.y}px)`},children:(0,d.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-[var(--surface-elevated)]`,children:[(0,d.jsx)(`header`,{className:Z(`flex shrink-0`,`touch-none select-none`,`items-start gap-3 pr-10`,`bg-[var(--surface-elevated)]`,p?E?`cursor-grabbing`:`cursor-move`:`cursor-default`,_),onPointerDown:k,onPointerMove:A,onPointerUp:j,onPointerCancel:j,children:(0,d.jsx)(`div`,{className:`min-w-0 flex-1`,children:t?(0,d.jsx)(`h2`,{id:x,className:`h4 truncate`,children:t}):null})}),o?(0,d.jsx)(`button`,{type:`button`,"data-form-shell-close":!0,onClick:o,"aria-label":u,className:Z(`motion-fast`,`absolute right-4 top-4`,`z-20 flex size-8`,`items-center justify-center`,`rounded-full`,`min-[36rem]:right-5`,`min-[36rem]:top-5`,`bg-transparent`,`text-[var(--text)]`,`hover:bg-[var(--interaction-hover)]`,`focus-visible:outline-none`,`focus-visible:shadow-[var(--focus-ring-shadow)]`),children:(0,d.jsx)(`img`,{src:Op.close,alt:``,className:`size-4`,draggable:!1})}):null,r?(0,d.jsx)(`div`,{className:`p1 mt-5 shrink-0 bg-[var(--surface-elevated)]`,children:r}):null,(0,d.jsxs)(`div`,{className:Z(`relative flex min-h-0 flex-1`,`flex-col overflow-hidden`,`bg-[var(--surface-elevated)]`,`${`my-${r?`5`:`${b===0?`8`:`${b}`}`}`}`),children:[(0,d.jsx)(`div`,{className:Z(`min-h-0 flex-1`,`overflow-x-hidden`,`overflow-y-auto`,`bg-[var(--surface-elevated)] pr-1`,s&&`overflow-hidden`,v),children:(0,d.jsx)(`div`,{className:Z(`p1 min-w-0 pt-3`,s&&`invisible`),children:i})}),s?(0,d.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:` absolute inset-0 flex items-center justify-center bg-[var(--loading-overlay)]`,children:[(0,d.jsx)(`div`,{className:Z(`size-10 animate-spin`,`rounded-full border-4`,`border-[color-mix(in_oklab,var(--text)_14%,transparent)]`,`border-t-[var(--text)]`),"aria-hidden":`true`}),(0,d.jsx)(`span`,{className:`sr-only`,children:c})]}):null]}),a?(0,d.jsx)(`footer`,{className:Z(`shrink-0`,`bg-[var(--surface-elevated)]`,y),children:a}):null]})})})})}var DE={compact:`gap-y-6`,default:`gap-y-8`,relaxed:`gap-y-10`,loose:`gap-y-12`,spacious:`gap-y-16`},OE={compact:`gap-x-4`,default:`gap-x-5`,wide:`gap-x-6`},kE={1:`col-span-12 min-[36rem]:col-span-1`,2:`col-span-12 min-[36rem]:col-span-2`,3:`col-span-12 min-[36rem]:col-span-3`,4:`col-span-12 min-[36rem]:col-span-4`,5:`col-span-12 min-[36rem]:col-span-5`,6:`col-span-12 min-[36rem]:col-span-6`,7:`col-span-12 min-[36rem]:col-span-7`,8:`col-span-12 min-[36rem]:col-span-8`,9:`col-span-12 min-[36rem]:col-span-9`,10:`col-span-12 min-[36rem]:col-span-10`,11:`col-span-12 min-[36rem]:col-span-11`,12:`col-span-12`};function AE({children:e,rowGap:t=`default`,columnGap:n=`default`,className:r,...i}){return(0,d.jsx)(`div`,{className:Z(`grid w-full min-w-0 grid-cols-12 items-start`,DE[t],OE[n],r),...i,children:e})}function jE({children:e,span:t=12,className:n,...r}){return(0,d.jsx)(`div`,{className:Z(`w-full min-w-0 self-start`,`[&>*]:w-full [&>*]:min-w-0 [&>*]:max-w-full`,kE[t],n),...r,children:e})}var ME=(0,l.forwardRef)(function({children:e,variant:t=`plain`,size:n=`m`,divided:r=!1,emptyState:i=`No hay elementos disponibles.`,className:a,...o},s){let c=l.Children.toArray(e),u=c.length>0;return(0,d.jsx)(`ul`,{ref:s,className:Z(`rb-list`,`rb-list--${t}`,`rb-list--${n}`,r&&`rb-list--divided`,a),...o,children:u?c:i==null?null:(0,d.jsx)(`li`,{className:`rb-list__empty p1`,children:i})})}),NE=(0,l.forwardRef)(function({children:e,icon:t,actions:n,selected:r=!1,disabled:i=!1,className:a,onClick:o,onClickCapture:s,onKeyDown:c,onKeyDownCapture:l,role:u,tabIndex:f,...p},m){let h=!!o&&!n&&!i;return(0,d.jsxs)(`li`,{ref:m,className:Z(`rb-list-item`,a),"data-selected":r||void 0,"data-disabled":i||void 0,"data-interactive":h||void 0,"data-has-actions":!!n||void 0,"data-has-icon":!!t||void 0,"aria-disabled":i||void 0,role:u??(h?`button`:void 0),tabIndex:f??(h?0:void 0),onClick:i?void 0:o,onClickCapture:e=>{if(i){e.preventDefault(),e.stopPropagation();return}s?.(e)},onKeyDownCapture:e=>{if(i){e.preventDefault(),e.stopPropagation();return}l?.(e)},onKeyDown:e=>{c?.(e),!(e.defaultPrevented||!h||e.repeat)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.currentTarget.click())},...p,children:[(0,d.jsxs)(`div`,{className:`rb-list-item__content`,children:[t?(0,d.jsx)(`span`,{className:`rb-list-item__icon`,"aria-hidden":`true`,children:t}):null,(0,d.jsx)(`div`,{className:`rb-list-item__body p1`,children:e})]}),n?(0,d.jsx)(`div`,{className:`rb-list-item__actions`,children:n}):null]})});function PE(...e){return e.filter(Boolean).join(` `)}function FE({value:e,items:t,onChange:n,className:r,ariaLabel:i=`Pestañas`}){return(0,d.jsx)(`div`,{role:`tablist`,"aria-label":i,className:PE(`inline-flex w-fit max-w-full items-center rounded-full bg-white p-1`,`shadow-[0_1px_2px_rgba(0,0,0,0.03)]`,r),children:t.map(t=>{let r=t.value===e;return(0,d.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":r,disabled:t.disabled,onClick:()=>{t.disabled||n(t.value)},className:PE(`inline-flex h-11 items-center justify-center rounded-full px-5 sm:px-6`,`p1 font-semibold leading-none transition-colors`,`min-w-[9rem]`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--base-dark)] focus-visible:ring-offset-2`,r?`bg-[var(--base-dark)] text-white`:`bg-transparent text-[var(--base-dark)] hover:bg-[color-mix(in_oklab,var(--base-dark)_4%,transparent)]`,t.disabled&&`cursor-not-allowed opacity-50 hover:bg-transparent`),children:t.label},t.value)})})}function IE(...e){return e.filter(Boolean).join(` `)}function LE({value:e,items:t,onChange:n,onClose:r,closeLabel:i=`Cerrar`,ariaLabel:a=`Pestañas`,className:o,children:s}){return(0,d.jsxs)(`div`,{className:IE(`flex w-full flex-col items-start gap-6`,`rounded-[20px] bg-white p-5`,o),children:[(0,d.jsxs)(`div`,{className:`flex w-full items-center gap-4`,children:[(0,d.jsx)(`div`,{role:`tablist`,"aria-label":a,className:`flex w-full flex-1 flex-wrap items-center gap-3`,children:t.map(t=>{let r=t.value===e;return(0,d.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":r,disabled:t.disabled,onClick:()=>{t.disabled||n(t.value)},className:IE(`inline-flex h-10 items-center justify-center rounded-full px-5`,`p2 font-semibold leading-none transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--base-dark)] focus-visible:ring-offset-2`,r?`bg-[var(--base-dark)] text-white`:`bg-[var(--g-100)] text-[var(--base-dark)] hover:bg-[var(--g-200)]`,t.disabled&&`cursor-not-allowed opacity-40 hover:bg-[var(--g-100)]`),children:t.label},t.value)})}),r&&(0,d.jsx)(`button`,{type:`button`,onClick:r,"aria-label":i,className:IE(`inline-flex size-11 shrink-0 items-center justify-center rounded-full`,`bg-white text-[var(--base-dark)]`,`transition-colors hover:bg-[var(--interaction-hover)]`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--base-dark)] focus-visible:ring-offset-2`),children:(0,d.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,d.jsx)(`path`,{d:`M2 2L14 14M14 2L2 14`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`})})})]}),s&&(0,d.jsx)(`div`,{className:`w-full`,children:s})]})}function RE(...e){return Z(...e)}function zE(e){return`field`in e}function BE(e=[]){return e.filter(e=>e.show!==!1).map(e=>{if(!zE(e))return e;let t=e.field,n=VE(e),r=e.cellClassName;return{key:t,header:e.headerName??e.header??t,show:e.show,width:n,minWidth:e.minWidth,maxWidth:e.maxWidth,align:e.align??e.headerAlign??`left`,fullWidthRender:e.fullWidthRender,headerClassName:e.headerClassName,sortable:e.sortable,filterable:e.filterable,cellClassName:typeof r==`function`?(e,n)=>r({row:e,index:n,id:HE(e,n),field:t,value:UE(e,t)}):r,render:(n,r)=>{let i={row:n,index:r,id:HE(n,r),field:t,value:UE(n,t)};return e.renderCell?e.renderCell(i):e.valueGetter?e.valueGetter(i):i.value??`—`}}})}function VE(e){return e.width?e.width:e.flex?`${e.flex}fr`:e.minWidth?`minmax(${e.minWidth}px, 1fr)`:`1fr`}function HE(e,t){let n=e?.id;if(n==null||n===``)throw Error(`[RbTable] Cada row debe traer un id obligatorio. Revisa la fila en posición ${t??`desconocida`}.`);return n}function UE(e,t){return e?.[t]}function WE(e){if(!e)return[];if(Array.isArray(e))return e;if(e instanceof Set)return Array.from(e);if(typeof e==`object`&&`ids`in e){let t=e.ids;if(t instanceof Set)return Array.from(t);if(Array.isArray(t))return t}return[]}function GE(e,t){return WE(t).includes(e)}function KE(e,t){let n=WE(t);return n.includes(e)?n.filter(t=>t!==e):[...n,e]}function qE(e,t){return{left:e?.left??t?.left??[],right:e?.right??t?.right??[]}}function JE(e){if(!e)return`minmax(0, 1fr)`;if(typeof e==`number`)return`${e}px`;let t=e.trim();return t.startsWith(`minmax(`)||t.endsWith(`px`)?t:t.includes(`fr`)?`minmax(0, ${t.replace(`fr`,``).trim()||`1`}fr)`:t}function YE(e){if(!e)return 180;if(typeof e==`number`)return e;if(e.endsWith(`px`)){let t=Number(e.replace(`px`,``));return Number.isFinite(t)?t:180}return e.includes(`56`)?56:180}function XE(e){return e===`center`?`text-center justify-center`:e===`right`?`text-right justify-end`:`text-left justify-start`}function ZE(e){return l.default.Children.toArray(e).flatMap(e=>{if(!l.default.isValidElement(e))return e;if(e.type===l.default.Fragment){let t=e.props;return ZE(t.children)}return e})}function QE(e){return e===!0||e===`true`}function $E(e){if(!l.default.isValidElement(e))return!1;let t=e.props,n=e.type;return QE(t[`data-toolbar-actions`])||n.rbToolbarActions===!0}function eD({title:e,description:t,left:n,right:r,className:i}){let a=!!(e||t),o=!!(n||r),s=!!n,c=ZE(r).filter(Boolean);return!a&&!o?null:(0,d.jsxs)(`div`,{className:RE(`rb-table-toolbar`,i),children:[a?(0,d.jsxs)(`div`,{className:`rb-table-toolbar__header`,children:[e?(0,d.jsx)(`div`,{className:`
|
|
288
288
|
h4 min-w-0
|
|
289
289
|
text-left
|
|
290
290
|
text-[var(--on-dark-text)]
|
|
@@ -409,4 +409,4 @@
|
|
|
409
409
|
absolute inset-0
|
|
410
410
|
flex items-center justify-center
|
|
411
411
|
bg-(--loading-overlay)
|
|
412
|
-
`,children:[(0,d.jsx)(`div`,{className:Z(`size-10 animate-spin`,`rounded-full border-4`,`border-[color-mix(in_oklab,var(--text)_14%,transparent)]`,`border-t-(--text)`),"aria-hidden":`true`}),(0,d.jsx)(`span`,{className:`sr-only`,children:b})]}):null]})]})}function pW(e){return e?Array.from(e):[]}function mW(e){let t=[],n=new Map,r=new Set;function i(e,a,o){for(let s of e){if(n.has(s.id))throw Error(`VirtualTree requiere IDs únicos: ${String(s.id)}`);let e=!!s.children?.length,c={id:s.id,node:s,parentId:a,depth:o,hasChildren:e};t.push(c),n.set(s.id,c),e&&r.add(s.id),s.children?.length&&i(s.children,s.id,o+1)}}return i(e,null,0),{allItems:t,itemsById:n,expandableIds:r,rootIds:e.map(e=>e.id)}}function hW(e,t){let n=[],r=e.itemsById.get(t)?.parentId??null;for(;r!==null;)n.unshift(r),r=e.itemsById.get(r)?.parentId??null;return n}function gW(e,t,n){let r=e.parentId;for(;r!==null;){if(!n.has(r))return!1;r=t.itemsById.get(r)?.parentId??null}return!0}function _W(e,t){return e.allItems.filter(n=>gW(n,e,t))}function vW(e){return e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).toLocaleLowerCase().trim()}function yW(e,t,n){for(let r of hW(t,n))e.add(r)}function bW(e,t,n){let r=t.itemsById.get(n)?.depth;if(r===void 0)return;let i=t.allItems.findIndex(e=>e.id===n);for(let n=i+1;n<t.allItems.length;n+=1){let i=t.allItems[n];if(i.depth<=r)break;e.add(i.id)}}function xW(e,t,n){let r=vW(n);if(!r)return e.allItems;let i=new Set;for(let n of e.allItems)n.node.type===t&&vW(n.node.label).includes(r)&&(i.add(n.id),yW(i,e,n.id),t!==`work_position`&&bW(i,e,n.id));return e.allItems.filter(e=>i.has(e.id))}function SW(e){let t=new Set,n=new Set(e.map(e=>e.id));for(let r of e)r.parentId!==null&&n.has(r.parentId)&&t.add(r.parentId);return t}function CW(e,t,n){let r=new Set(t.map(e=>e.id));return t.filter(t=>{let i=t.parentId;for(;i!==null&&r.has(i);){if(!n.has(i))return!1;i=e.itemsById.get(i)?.parentId??null}return!0})}function wW(e,t,n){let r=pW(t).filter(t=>{let n=e.itemsById.get(t)?.node;return n?.type===`work_position`&&n.disabled!==!0});return n===`single`?r.slice(-1):Array.from(new Set(r))}function TW(e,t,n,r){let i=e.itemsById.get(n)?.node,a=wW(e,t,r);if(i?.type!==`work_position`||i.disabled)return a;if(r===`single`)return[n];let o=new Set(a);return o.has(n)?o.delete(n):o.add(n),Array.from(o)}function EW({items:e,selectionMode:t,selectedIds:n,defaultSelectedIds:r,onSelectionChange:i,expandedIds:a,defaultExpandedIds:o,defaultExpandAll:s=!1,onExpandedChange:c}){let u=l.default.useMemo(()=>mW(e),[e]),d=n!==void 0,f=a!==void 0,[p,m]=l.default.useState(()=>wW(u,r,t)),[h,g]=l.default.useState(()=>s?Array.from(u.expandableIds):o===void 0?u.rootIds.filter(e=>u.expandableIds.has(e)):pW(o)),_=l.default.useMemo(()=>wW(u,d?n:p,t),[u,p,n,d,t]),v=f?pW(a):h,y=l.default.useMemo(()=>new Set(v),[v]),b=l.default.useMemo(()=>new Set(_),[_]),x=l.default.useMemo(()=>_W(u,y),[y,u]),S=l.default.useCallback((e,t)=>{f||g(e),c?.(e,{nodeId:t,node:u.itemsById.get(t)?.node??null})},[f,u,c]),C=l.default.useCallback((e,t)=>{if(!u.expandableIds.has(e))return;let n=new Set(v);t?n.add(e):n.delete(e),S(Array.from(n),e)},[S,v,u.expandableIds]);return{index:u,visibleItems:x,expandedSet:y,selectedSet:b,selectedIds:_,toggleExpansion:l.default.useCallback(e=>{C(e,!y.has(e))},[y,C]),setItemExpansion:C,expandItems:l.default.useCallback(e=>{let t=new Set(v),n;for(let r of e)!u.expandableIds.has(r)||t.has(r)||(t.add(r),n??=r);n!==void 0&&S(Array.from(t),n)},[S,v,u.expandableIds]),expandAll:l.default.useCallback(()=>{let e=Array.from(u.expandableIds),t=e[0]??u.rootIds[0];t!==void 0&&S(e,t)},[S,u]),collapseAll:l.default.useCallback(()=>{let e=v[0]??u.rootIds[0];e!==void 0&&S([],e)},[S,v,u.rootIds]),expandAncestors:l.default.useCallback(e=>{let t=new Set(v);for(let n of hW(u,e))u.expandableIds.has(n)&&t.add(n);S(Array.from(t),e)},[S,v,u]),toggleSelection:l.default.useCallback(e=>{let n=TW(u,_,e,t);d||m(n),i?.(n,{nodeId:e,node:u.itemsById.get(e)?.node??null})},[u,_,i,d,t])}}var DW={subcompany:`S`,area:`A`,work_position:`P`},OW=[{value:`subcompany`,label:`Subcompañía`},{value:`area`,label:`Área`},{value:`work_position`,label:`Puesto`}];function kW({label:e,query:t}){let n=vW(e),r=vW(t),i=n.indexOf(r);return!r||i<0?e:(0,d.jsxs)(d.Fragment,{children:[e.slice(0,i),(0,d.jsx)(`mark`,{className:`rounded-sm bg-(--amarillo-light) text-inherit`,children:e.slice(i,i+t.length)}),e.slice(i+t.length)]})}function AW({ariaAttributes:e,index:t,style:n,items:r,expandedSet:i,selectedSet:a,selectionMode:o,selectionName:s,selectionDisabled:c,branchIds:l,filterType:u,query:f,expandLabel:p,collapseLabel:m,onToggleExpansion:h,onToggleSelection:g}){let _=r[t];if(!_)return null;let{node:v}=_,y=l?l.has(_.id):_.hasChildren,b=y&&i.has(_.id),x=a.has(_.id),S=v.type===`work_position`,C=c||v.disabled===!0,w=e=>{e.key===`ArrowRight`&&y&&!b||e.key===`ArrowLeft`&&y&&b?(e.preventDefault(),h(_.id)):(e.key===`Enter`||e.key===` `)&&S&&(e.preventDefault(),C||g(_.id))};return(0,d.jsxs)(`div`,{...e,role:`treeitem`,"aria-level":_.depth+1,"aria-expanded":y?b:void 0,"aria-selected":S?x:void 0,tabIndex:0,style:{...n,paddingLeft:`${12+_.depth*20}px`},className:Z(`flex min-w-0 items-center gap-2 px-3`,`outline-none transition-colors focus-visible:bg-(--interaction-hover)`,x&&`bg-(--interaction-selected)`,v.disabled&&`opacity-60`,v.className),onDoubleClick:()=>y&&h(_.id),onKeyDown:w,children:[(0,d.jsx)(`div`,{className:`flex size-7 shrink-0 items-center justify-center`,children:y?(0,d.jsx)(Gw,{type:`button`,size:`s`,"aria-label":`${b?m:p}: ${v.label}`,"aria-expanded":b,onClick:()=>h(_.id),children:(0,d.jsx)(KU,{name:b?`arrowUp`:`arrow`,size:`s`,className:`text-(--text)`})}):null}),S?o===`multiple`?(0,d.jsx)(vC,{size:`s`,checked:x,disabled:C,"aria-label":`Seleccionar ${v.label}`,onChange:()=>g(_.id)}):(0,d.jsx)(Jw,{size:`s`,name:s,checked:x,disabled:C,"aria-label":`Seleccionar ${v.label}`,onChange:()=>g(_.id)}):(0,d.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-5 shrink-0 items-center justify-center rounded-sm bg-(--g-100) p3 font-semibold text-(--muted)`,children:DW[v.type]}),(0,d.jsx)(`span`,{className:Z(`p2 min-w-0 flex-1 truncate text-(--text)`,v.type===`subcompany`&&`font-semibold`),children:(0,d.jsx)(kW,{label:v.label,query:v.type===u?f:``})})]})}function jW({ariaLabel:e,items:t=[],selectionMode:n=`single`,selectedIds:r,defaultSelectedIds:i,onSelectionChange:a,expandedIds:o,defaultExpandedIds:s,defaultExpandAll:c=!1,onExpandedChange:u,selectionDisabled:f=!1,filterTypeLabel:p=`Buscar por`,searchPlaceholder:m=`Ingresa una palabra`,clearSearchLabel:h=`Limpiar búsqueda`,subcompanyLabel:g=`Subcompañía`,areaLabel:_=`Área`,workPositionLabel:v=`Puesto`,emptyText:y=`No hay elementos disponibles`,noResultsText:b=`No se encontró un valor`,expandLabel:x=`Expandir`,collapseLabel:S=`Contraer`,height:C=360,rowHeight:w=48,overscanCount:T=5,loading:E=!1,loadingLabel:D=`Cargando`,className:O,headerClassName:k,bodyClassName:A},j){let M=(0,ee.useListRef)(null),N=l.default.useId(),P=l.default.useRef(null),[F,I]=l.default.useState(`work_position`),[L,R]=l.default.useState(``),[te,ne]=l.default.useState(``),{index:re,visibleItems:ie,expandedSet:z,selectedSet:ae,toggleExpansion:B,setItemExpansion:V,expandItems:H,expandAll:oe,collapseAll:se,expandAncestors:ce,toggleSelection:le}=EW({items:t,selectionMode:n,selectedIds:r,defaultSelectedIds:i,onSelectionChange:a,expandedIds:o,defaultExpandedIds:s,defaultExpandAll:c,onExpandedChange:u});l.default.useEffect(()=>{let e=window.setTimeout(()=>ne(L),200);return()=>window.clearTimeout(e)},[L]);let ue=te.trim().length>0,U=l.default.useMemo(()=>ue?xW(re,F,te):null,[te,F,re,ue]),de=l.default.useMemo(()=>U?SW(U):null,[U]),W=l.default.useMemo(()=>U?CW(re,U,z):ie,[z,U,re,ie]),fe=ue?`${F}:${te.trim()}`:``,pe=l.default.useRef(``);l.default.useEffect(()=>{pe.current!==fe&&(pe.current=fe,de?.size&&H(Array.from(de)))},[de,H,fe]),l.default.useEffect(()=>{let e=P.current;if(e===null)return;let t=W.findIndex(t=>t.id===e);t<0||(P.current=null,M.current?.scrollToRow({index:t,align:`smart`}))},[W,M]);let me=l.default.useCallback(e=>{let t=W.findIndex(t=>t.id===e);t>=0&&M.current?.scrollToRow({index:t,align:`smart`})},[W,M]);l.default.useImperativeHandle(j,()=>({expandAll:oe,collapseAll:se,setItemExpansion:V,focusItem:e=>{P.current=e,ce(e)},getItem:e=>re.itemsById.get(e)?.node,scrollToItem:me}),[se,oe,ce,re.itemsById,me,V]);let he=l.default.useMemo(()=>({items:W,expandedSet:z,selectedSet:ae,selectionMode:n,selectionName:N,selectionDisabled:f,branchIds:de,filterType:F,query:ue?te.trim():``,expandLabel:x,collapseLabel:S,onToggleExpansion:B,onToggleSelection:le}),[de,S,te,W,x,z,F,ue,ae,N,f,n,B,le]),ge=l.default.useCallback((e,t)=>t.items[e]?.id??e,[]),_e=e??`Árbol virtual`,ve=t.length>0,ye=W.length>0;return(0,d.jsxs)(`section`,{"aria-busy":E||void 0,className:Z(`relative flex w-full min-w-0 flex-col overflow-hidden rounded-(--r-m)`,`border border-(--border) bg-(--surface)`,O),children:[(0,d.jsxs)(`header`,{className:Z(`grid gap-2 bg-(--base-dark) px-5 py-4 text-(--on-dark-text) sm:grid-cols-[minmax(0,1fr)_15rem]`,k),children:[(0,d.jsxs)(`div`,{className:`relative min-w-10 w-full`,children:[(0,d.jsx)(Kw,{value:L,placeholder:m,white:!1,className:`pr-2`,onChange:e=>R(e.target.value)}),L&&(0,d.jsx)(Gw,{type:`button`,size:`s`,"aria-label":h,disabled:!L,onClick:()=>R(``),className:`absolute bottom-1.5 right-2 z-10 size-8 top-0`,children:(0,d.jsx)(`img`,{src:Op.close,alt:``,className:`size-4`})})]}),(0,d.jsx)(Z_,{selectionMode:`single`,label:p,placeholder:`Seleccionar filtro`,values:OW.map(e=>({...e,label:e.value===`subcompany`?g:e.value===`area`?_:v})),value:F,setValue:e=>{OW.some(t=>t.value===e)&&I(e)},clearLabel:`Mantener filtro seleccionado`,white:!1})]}),(0,d.jsx)(`div`,{className:Z(`grid min-h-0 gap-2 p-4`,A),children:(0,d.jsxs)(`div`,{className:`relative min-h-0 overflow-hidden rounded-(--r-s) border border-(--border)`,children:[ve?ye?(0,d.jsx)(ee.List,{listRef:M,role:`tree`,"aria-label":_e,"aria-multiselectable":n===`multiple`||void 0,rowComponent:AW,rowCount:W.length,rowHeight:w,rowProps:he,rowKey:ge,overscanCount:T,style:{height:C}}):(0,d.jsx)(`div`,{role:`status`,className:`p2 flex items-center justify-center px-3 text-center text-(--muted)`,style:{height:C},children:b}):(0,d.jsx)(`div`,{className:`p2 flex items-center justify-center px-4 text-center text-(--muted)`,style:{height:C},children:y}),E?(0,d.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`p2 absolute inset-0 flex items-center justify-center bg-(--loading-overlay)`,children:D}):null]})})]})}var MW=l.default.forwardRef(jW);function NW({segment:e,index:t,color:n,leftPct:r,tooltip:i,align:a=`center`,onClick:o}){let s=!!o,c=(0,d.jsx)(`span`,{role:s?`button`:void 0,tabIndex:s?0:void 0,onClick:s?e=>o?.(t,e.currentTarget):void 0,onKeyDown:s?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o?.(t,e.currentTarget))}:void 0,style:{color:n,fontSize:`1rem`,lineHeight:`1.25rem`},className:Z(`block whitespace-nowrap font-semibold`,s&&`cursor-pointer hover:underline`),children:e.label??`—`});return(0,d.jsx)(`span`,{className:`absolute`,style:{left:`${r}%`,transform:a===`start`?void 0:a===`end`?`translateX(-100%)`:`translateX(-50%)`},children:i?(0,d.jsx)(gC,{content:i,placement:`bottom`,children:c}):c})}function PW({boundary:e,isEdge:t,color:n,tooltip:r,editable:i,minDate:o,maxDate:s,align:c=`center`,onDateChange:l,onClick:u}){let{open:p,ready:m,close:h,toggle:g,position:_,anchorVars:v,triggerRef:y,panelRef:b}=IS(),x=t?`1.25rem`:`1rem`,S=i||!!u,C=[];o&&C.push({before:o.toDate()}),s&&C.push({after:s.toDate()});let w=(0,d.jsx)(`button`,{ref:y,type:`button`,"aria-label":i?`Editar fecha ${e.date.format(`DD/MM/YYYY`)}`:e.date.format(`DD/MM/YYYY`),"aria-haspopup":i?`dialog`:void 0,"aria-expanded":i?p:void 0,disabled:!S,onClick:e=>{if(i){g();return}u?.(e.currentTarget)},className:Z(`block rounded-full bg-white transition-transform duration-150`,S&&`cursor-pointer hover:scale-110`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--ring)`),style:{width:x,height:x,border:`0.125rem solid ${n}`,boxSizing:`border-box`}}),T=i&&p&&m&&typeof document<`u`?(0,f.createPortal)((0,d.jsx)(`div`,{ref:b,style:v,className:Z(`rb-popover-layer p1 absolute top-(--panel-top) left-(--panel-left)`,`w-(--datepicker-w) max-w-[calc(100vw-var(--sp-m))]`,`flex flex-col overflow-hidden rounded-(--r-m) bg-(--surface) p-(--sp-xs) shadow-(--shadow-lg)`,_.placement===`top`&&`-translate-y-full`),children:(0,d.jsx)(uS,{mode:`single`,fixedWeeks:!0,showOutsideDays:!0,weekStartsOn:1,selected:e.date.toDate(),defaultMonth:e.date.toDate(),disabled:C.length?C:void 0,onSelect:e=>{e&&l?.((0,a.default)(e)),h()}})}),document.body):null;return(0,d.jsxs)(`span`,{className:`absolute z-2 block`,style:{left:`${e.leftPct}%`,top:`50%`,transform:c===`start`?`translate(0, -50%)`:c===`end`?`translate(-100%, -50%)`:`translate(-50%, -50%)`},children:[r?(0,d.jsx)(gC,{content:r,placement:`bottom`,children:w}):w,T]})}var FW=.4,IW=.5,LW=.01;function RW(e,t,n){if(n)return{start:n.startDate,end:n.endDate};let r=e[0].startDate,i=e[e.length-1],a=e=>!!(t&&e.isSame(t,`day`));if(!a(i.endDate))return{start:r,end:i.endDate};let o=e.map(e=>e.endDate).filter(e=>!a(e)).reduce((e,t)=>t.isAfter(e)?t:e,r),s=i.startDate.add(30,`day`);return{start:r,end:o.isAfter(s)?o:s}}function zW(e,t,n){let{start:r,end:i}=RW(e,t,n),a=Math.max(1,i.diff(r,`day`)),o=e=>!!(t&&e.isSame(t,`day`)),s=e=>{if(o(e))return 100;let t=e.diff(r,`day`);return Math.max(0,Math.min(100,t/a*100))},c=[],l=0;return e.forEach((e,t)=>{let n=Math.max(l,s(e.startDate)),r=s(e.endDate);n-l>LW&&c.push({type:`gap`,index:t,startPct:l,widthPct:n-l});let i=Math.min(100-n,Math.max(IW,r-n));c.push({type:`segment`,index:t,startPct:n,widthPct:i}),l=n+i}),100-l>LW&&c.push({type:`gap`,index:e.length,startPct:l,widthPct:100-l}),c}function BW(e,t,n={}){if(n.proportional)return zW(e,n.indefiniteDate,n.domain);if(!t){let t=100/e.length;return e.map((e,n)=>({type:`segment`,index:n,startPct:n*t,widthPct:t}))}let r=e.length-1,i=100/(e.length+r*FW),a=[],o=0;return e.forEach((e,t)=>{if(t>0){let e=i*FW;a.push({type:`gap`,index:t,startPct:o,widthPct:e}),o+=e}a.push({type:`segment`,index:t,startPct:o,widthPct:i}),o+=i}),a}function VW(e,t,n){let r=[];e.forEach((i,a)=>{let o=a>0?e[a-1]:null,s=n&&o!==null;if(o&&s){let e=t[a-1];r.push({key:`${o.id}-end`,kind:`end`,date:o.endDate,leftPct:e.startPct+e.widthPct,segmentIndex:a-1,previousIndex:null})}r.push({key:`${i.id}-start`,kind:o&&!s?`shared`:`start`,date:i.startDate,leftPct:t[a].startPct,segmentIndex:a,previousIndex:o?a-1:null})});let i=e.length-1;return r.push({key:`${e[i].id}-end`,kind:`end`,date:e[i].endDate,leftPct:100,segmentIndex:i,previousIndex:null}),r}function HW(e,t,n,r=!1){let i=t[e.segmentIndex],a=+!r;if(e.kind===`end`){let r=t[e.segmentIndex+1];return{min:i.startDate,max:n&&r?r.startDate.subtract(a,`day`):null}}let o=e.previousIndex===null?null:t[e.previousIndex];return{min:o?e.kind===`shared`?o.startDate.add(a,`day`):o.endDate.add(a,`day`):null,max:i.endDate}}var UW=[`#EAB300`,`#8A9A00`,`#50E300`,`#00A85A`,`#00D5EE`,`#008CF0`],WW=`#90a4ae`,GW=`h-full bg-(--g-200)`,KW=5.5,qW=8,JW=e=>e?.isValid?.()?e.format(`DD/MM/YYYY`):``;function YW(e,t){let n={},r=0;return e.forEach(e=>{if(e.color)return;let i=String(e.id);n[i]||(n[i]=t[r++%t.length]??WW)}),n}function XW(e,t){return e.color??t[String(e.id)]??WW}function ZW(e){return typeof e.label==`string`&&e.label.trim()?e.label:null}function QW(e,t,n){let r=ZW(e);if(!r)return!1;let i=r.length*KW+qW;return n*t/100>=i}function $W({segments:e,mode:t=`simple`,external_labels:n,legend:r=!1,compactRange:i,tooltips:a=!0,startBoundary:o,endBoundary:s,colors:c=UW,formatDate:u=JW,segmentTooltip:f,boundaryTooltip:p,onSegmentClick:m,onBoundaryClick:h,allowGaps:g=!1,scale:_=`equal`,editableBoundaries:v=!1,exclusiveEnd:y=!1,indefiniteDate:b,indefiniteLabel:x=`Indefinido`,onBoundaryDateChange:S,className:C}){let w=(0,l.useRef)(null),[T,E]=(0,l.useState)(0);if((0,l.useEffect)(()=>{let e=w.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>E(e.clientWidth);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),e.length===0)return null;let D=YW(e,c),O=BW(e,g,{proportional:_===`proportional`,indefiniteDate:b}),k=O.filter(e=>e.type===`segment`),A=VW(e,k,g),j=v&&!!S,M=A.length-1,N=e=>!!(b&&e.isSame(b,`day`)),P=e=>N(e)?x:u(e),F=n?.fecha_inicio??u(i?.startDate??e[0].startDate),I=n?.fecha_fin??P(i?.endDate??e[e.length-1].endDate),ee=BW(e,!0,{proportional:!0,indefiniteDate:b,domain:i}),L=(e,t)=>e.tooltip??f?.(e,t)??(0,d.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,d.jsx)(`strong`,{children:e.label??`—`}),(0,d.jsxs)(`span`,{children:[u(e.startDate),` -`,` `,P(e.endDate)]})]});return t===`compact`?(0,d.jsxs)(`div`,{className:Z(`flex w-full min-w-0 flex-col rounded-md bg-black/5`,C),style:{padding:`0.75rem 0.5rem`,rowGap:`0.5rem`},children:[(0,d.jsxs)(`div`,{className:`flex w-full items-center gap-3`,children:[(0,d.jsx)(`span`,{className:`flex shrink-0 flex-col items-center gap-1 text-(--muted,#666)`,"aria-label":`Fecha de inicio`,children:(0,d.jsx)(`span`,{className:`text-xs font-semibold whitespace-nowrap`,children:F})}),(0,d.jsxs)(`div`,{ref:w,className:`relative min-w-0 flex-1`,style:{height:`2.25rem`,minWidth:`6.25rem`},children:[(0,d.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-full bg-(--g-200)`,style:{height:`0.375rem`}}),ee.map(t=>{if(t.type===`gap`)return null;let n=e[t.index],r=QW(n,t.widthPct,T)?ZW(n):null,i=(0,d.jsx)(`div`,{className:`h-3 w-full rounded-full border border-(--surface) shadow-[0_0_0_1px_color-mix(in_srgb,currentColor_34%,transparent)]`,style:{color:XW(n,D),backgroundColor:XW(n,D)}}),o=(0,d.jsxs)(`div`,{className:`relative h-full w-full`,children:[r?(0,d.jsx)(`span`,{className:`absolute bottom-5 left-1/2 z-10 -translate-x-1/2 whitespace-nowrap text-[0.825rem] font-semibold leading-none text-(--text)`,children:r}):null,(0,d.jsx)(`div`,{className:`absolute inset-x-0 bottom-0`,children:i})]});return(0,d.jsx)(`div`,{className:`absolute bottom-0`,style:{left:`${t.startPct}%`,width:`${t.widthPct}%`},children:a?(0,d.jsx)(gC,{content:L(n,t.index),placement:`bottom`,multiline:!0,triggerClassName:`block h-9 w-full`,children:o}):(0,d.jsx)(l.Fragment,{children:o})},`compact-segment-${n.id}`)})]}),(0,d.jsx)(`span`,{className:`flex shrink-0 flex-col items-center gap-1 text-(--muted,#666)`,"aria-label":`Fecha de fin`,children:(0,d.jsx)(`span`,{className:`text-xs font-semibold whitespace-nowrap`,children:I})})]}),r?(0,d.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:e.map(e=>(0,d.jsxs)(`span`,{className:`flex items-center gap-2 text-sm text-(--text)`,children:[(0,d.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full`,style:{backgroundColor:XW(e,D)}}),(0,d.jsx)(`span`,{children:e.label??`—`})]},`legend-${e.id}`))}):null]}):(0,d.jsxs)(`div`,{className:Z(`flex w-full min-w-0 flex-col rounded-md bg-black/5`,C),style:{padding:`0.75rem 0.5rem`,rowGap:`0.25rem`},children:[(0,d.jsx)(`div`,{className:`relative w-full`,style:{height:`1.5rem`},children:e.map((e,t)=>(0,d.jsx)(NW,{segment:e,index:t,color:XW(e,D),leftPct:k[t].startPct+k[t].widthPct/2,tooltip:e.tooltip??f?.(e,t)??null,onClick:m?(t,n)=>m({segment:e,index:t,anchorEl:n}):void 0},e.id))}),(0,d.jsxs)(`div`,{className:`relative flex w-full items-center`,style:{height:`2rem`},children:[(0,d.jsx)(`div`,{className:`flex w-full overflow-hidden rounded-md`,style:{height:`0.375rem`},children:O.map(t=>t.type===`gap`?(0,d.jsx)(`div`,{style:{width:`${t.widthPct}%`},className:GW},`gap-${t.index}`):(0,d.jsx)(`div`,{style:{width:`${t.widthPct}%`,backgroundColor:XW(e[t.index],D)},className:`h-full`},e[t.index].id))}),A.map((t,n)=>{let r=n===0,i=n===M,a=!r&&!i,c=N(t.date),{min:l,max:f}=HW(t,e,g,y),m=r?o?.color??XW(e[0],D):i?s?.color??WW:XW(e[t.segmentIndex],D),_=r?o?.tooltip??u(t.date):i?s?.tooltip??(c?x:u(t.date)):p?.({index:n,previousSegment:t.previousIndex===null?e[t.segmentIndex]:e[t.previousIndex],nextSegment:e[t.segmentIndex],anchorEl:null})??u(t.date);return(0,d.jsx)(PW,{boundary:t,isEdge:r||i,color:m,tooltip:_,editable:j&&!c,minDate:l,maxDate:f,align:r?`start`:i?`end`:`center`,onDateChange:e=>S?.({kind:t.kind,date:e,segmentIndex:t.segmentIndex,previousIndex:t.previousIndex,minDate:l,maxDate:f}),onClick:a&&h&&!j?r=>h({index:n,previousSegment:e[t.previousIndex??t.segmentIndex],nextSegment:e[t.segmentIndex],anchorEl:r}):void 0},t.key)})]}),(0,d.jsx)(`div`,{className:`relative w-full`,style:{height:`1.5rem`,marginTop:`0.25rem`},children:A.map((e,t)=>(0,d.jsx)(`span`,{className:`absolute whitespace-nowrap text-(--muted,#666)`,style:{left:`${e.leftPct}%`,transform:e.kind===`end`?`translateX(-100%)`:void 0,textAlign:e.kind===`end`?`right`:`left`,fontSize:`0.875rem`,lineHeight:`1.25rem`,fontWeight:400},children:t===0?o?.label??u(e.date):t===M?s?.label??(N(e.date)?x:u(e.date)):N(e.date)?x:u(e.date)},e.key))})]})}e.AuthLanguageDropdown=F_,e.AuthPasswordInput=tT,e.AuthShell=P_,e.AutoCustomCompleteField=Z_,e.Breadcrumbs=IT,e.CalendarChipIcon=Sw,e.Calendario=gw,e.Card=zw,e.CardContent=Hw,e.CardFooter=Uw,e.CardHeader=Bw,e.CardTitle=Vw,e.Checkbox=vC,e.ClockChipIcon=Cw,e.ConfirmDialog=eT,e.Core=zT,e.CoreContext=W,e.CoreProvider=BT,e.CustomDateControl=MC,e.CustomDatePicker=cC,e.CustomDateRangeCalendar=HC,e.CustomDateRangePicker=zC,e.CustomDateRangefield=IC,e.CustomDatefield=JS,e.CustomIndefiniteDatePicker=jC,e.CustomSelect=eE,e.CustomTimefield=PC,Object.defineProperty(e,"DGEnUs",{enumerable:!0,get:function(){return t.enUS}}),Object.defineProperty(e,"DGEsEs",{enumerable:!0,get:function(){return t.esES}}),e.DashboardShell=AT,e.EmptyState=bE,e.Form=lE,e.FormField=jE,e.FormGrid=AE,e.FormShell=EE,e.GoodRabbitDarkTheme=U,e.GoodRabbitLightTheme=de,e.Input=Kw,e.LegacyCustomTimefield=rE,e.MessageAlert=fE,e.PillsTabs=FE,e.RbPillsTabs=FE,e.Portal=Xw,e.RBButton=R_,e.Radio=Jw,e.RbContextMenu=yw,e.RbExcelTable=xU,e.RbIconButton=Gw,e.RbInlineChipField=Lw,e.RbList=ME,e.RbListItem=NE,e.RbStepper=Yw,e.RbTabPanel=LE,e.TabPanel=LE,e.RbTable=bD,e.RbTableToolbar=eD,e.RbToolbarActionButton=SU,e.RbToolbarActions=CU,e.RbToolbarDateRangeField=wU,e.RbToolbarMultiSelectField=DU,e.RbToolbarSearchField=kU,e.RbToolbarSelectField=MU,e.ShellContent=oT,e.Sidebar=Bp,e.SidebarContent=VU,e.SidebarFooter=UU,e.SidebarHeader=IU,e.SystemAlert=ET,e.Table=YT,e.Timeline=$W,e.Tooltip=gC,e.TopBar=dT,e.TopBarUserMenu=sT,e.TreePanel=fW,e.VirtualTree=MW,e.buildVirtualTreeIndex=mW,e.chekingSSOMS=j_,e.cn=Z,Object.defineProperty(e,"coreEnUS",{enumerable:!0,get:function(){return n.enUS}}),Object.defineProperty(e,"coreEsES",{enumerable:!0,get:function(){return n.esES}}),e.filterVirtualTreeItems=xW,e.findNodeById=QU,e.flattenTree=ZU,e.formatRbExcelDate=eU,e.formatRbExcelTime=tU,e.getExpandableNodeIds=$U,e.getNodeSelectionState=rW,e.getRbExcelValueAtPath=YH,e.getRbImageUrl=kp,e.getSelectableDescendantIds=tW,e.getSelectableSubtreeIds=eW,e.getVirtualTreeAncestorIds=hW,e.getVisibleVirtualTreeItems=_W,e.hasNodeChildren=XU,e.initializeAuth=M_,e.isNodeSelectable=JU,e.isNodeSelectionMutable=YU,e.isRbExcelEmptyValue=ZH,e.isValidRbExcelDate=rU,e.isValidRbExcelNumber=aU,e.isValidRbExcelTime=iU,e.normalizeHierarchicalSelection=nW,e.normalizeVirtualTreeSearch=vW,e.normalizeVirtualTreeSelection=wW,e.observeSSO=N_,e.parseRbExcelValue=nU,Object.defineProperty(e,"pickersEnUS",{enumerable:!0,get:function(){return r.enUS}}),Object.defineProperty(e,"pickersEsES",{enumerable:!0,get:function(){return r.esES}}),e.rbImages=Op,e.setRbExcelValueAtPath=XH,e.toggleExpandedNode=aW,e.toggleNodeSelection=iW,e.toggleVirtualTreeSelection=TW,e.useRbSystemAlert=OT,e.useSystemAlert=ZT,e.useTable=XT,e.useVirtualTreeState=EW});
|
|
412
|
+
`,children:[(0,d.jsx)(`div`,{className:Z(`size-10 animate-spin`,`rounded-full border-4`,`border-[color-mix(in_oklab,var(--text)_14%,transparent)]`,`border-t-(--text)`),"aria-hidden":`true`}),(0,d.jsx)(`span`,{className:`sr-only`,children:b})]}):null]})]})}function pW(e){return e?Array.from(e):[]}function mW(e){let t=[],n=new Map,r=new Set;function i(e,a,o){for(let s of e){if(n.has(s.id))throw Error(`VirtualTree requiere IDs únicos: ${String(s.id)}`);let e=!!s.children?.length,c={id:s.id,node:s,parentId:a,depth:o,hasChildren:e};t.push(c),n.set(s.id,c),e&&r.add(s.id),s.children?.length&&i(s.children,s.id,o+1)}}return i(e,null,0),{allItems:t,itemsById:n,expandableIds:r,rootIds:e.map(e=>e.id)}}function hW(e,t){let n=[],r=e.itemsById.get(t)?.parentId??null;for(;r!==null;)n.unshift(r),r=e.itemsById.get(r)?.parentId??null;return n}function gW(e,t,n){let r=e.parentId;for(;r!==null;){if(!n.has(r))return!1;r=t.itemsById.get(r)?.parentId??null}return!0}function _W(e,t){return e.allItems.filter(n=>gW(n,e,t))}function vW(e){return e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).toLocaleLowerCase().trim()}function yW(e,t,n){for(let r of hW(t,n))e.add(r)}function bW(e,t,n){let r=t.itemsById.get(n)?.depth;if(r===void 0)return;let i=t.allItems.findIndex(e=>e.id===n);for(let n=i+1;n<t.allItems.length;n+=1){let i=t.allItems[n];if(i.depth<=r)break;e.add(i.id)}}function xW(e,t,n){let r=vW(n);if(!r)return e.allItems;let i=new Set;for(let n of e.allItems)n.node.type===t&&vW(n.node.label).includes(r)&&(i.add(n.id),yW(i,e,n.id),t!==`work_position`&&bW(i,e,n.id));return e.allItems.filter(e=>i.has(e.id))}function SW(e){let t=new Set,n=new Set(e.map(e=>e.id));for(let r of e)r.parentId!==null&&n.has(r.parentId)&&t.add(r.parentId);return t}function CW(e,t,n){let r=new Set(t.map(e=>e.id));return t.filter(t=>{let i=t.parentId;for(;i!==null&&r.has(i);){if(!n.has(i))return!1;i=e.itemsById.get(i)?.parentId??null}return!0})}function wW(e,t,n){let r=pW(t).filter(t=>{let n=e.itemsById.get(t)?.node;return n?.type===`work_position`&&n.disabled!==!0});return n===`single`?r.slice(-1):Array.from(new Set(r))}function TW(e,t,n,r){let i=e.itemsById.get(n)?.node,a=wW(e,t,r);if(i?.type!==`work_position`||i.disabled)return a;if(r===`single`)return[n];let o=new Set(a);return o.has(n)?o.delete(n):o.add(n),Array.from(o)}function EW({items:e,selectionMode:t,selectedIds:n,defaultSelectedIds:r,onSelectionChange:i,expandedIds:a,defaultExpandedIds:o,defaultExpandAll:s=!1,onExpandedChange:c}){let u=l.default.useMemo(()=>mW(e),[e]),d=n!==void 0,f=a!==void 0,[p,m]=l.default.useState(()=>wW(u,r,t)),[h,g]=l.default.useState(()=>s?Array.from(u.expandableIds):o===void 0?u.rootIds.filter(e=>u.expandableIds.has(e)):pW(o)),_=l.default.useMemo(()=>wW(u,d?n:p,t),[u,p,n,d,t]),v=f?pW(a):h,y=l.default.useMemo(()=>new Set(v),[v]),b=l.default.useMemo(()=>new Set(_),[_]),x=l.default.useMemo(()=>_W(u,y),[y,u]),S=l.default.useCallback((e,t)=>{f||g(e),c?.(e,{nodeId:t,node:u.itemsById.get(t)?.node??null})},[f,u,c]),C=l.default.useCallback((e,t)=>{if(!u.expandableIds.has(e))return;let n=new Set(v);t?n.add(e):n.delete(e),S(Array.from(n),e)},[S,v,u.expandableIds]);return{index:u,visibleItems:x,expandedSet:y,selectedSet:b,selectedIds:_,toggleExpansion:l.default.useCallback(e=>{C(e,!y.has(e))},[y,C]),setItemExpansion:C,expandItems:l.default.useCallback(e=>{let t=new Set(v),n;for(let r of e)!u.expandableIds.has(r)||t.has(r)||(t.add(r),n??=r);n!==void 0&&S(Array.from(t),n)},[S,v,u.expandableIds]),expandAll:l.default.useCallback(()=>{let e=Array.from(u.expandableIds),t=e[0]??u.rootIds[0];t!==void 0&&S(e,t)},[S,u]),collapseAll:l.default.useCallback(()=>{let e=v[0]??u.rootIds[0];e!==void 0&&S([],e)},[S,v,u.rootIds]),expandAncestors:l.default.useCallback(e=>{let t=new Set(v);for(let n of hW(u,e))u.expandableIds.has(n)&&t.add(n);S(Array.from(t),e)},[S,v,u]),toggleSelection:l.default.useCallback(e=>{let n=TW(u,_,e,t);d||m(n),i?.(n,{nodeId:e,node:u.itemsById.get(e)?.node??null})},[u,_,i,d,t])}}var DW={subcompany:`S`,area:`A`,work_position:`P`},OW=[{value:`subcompany`,label:`Subcompañía`},{value:`area`,label:`Área`},{value:`work_position`,label:`Puesto`}];function kW({label:e,query:t}){let n=vW(e),r=vW(t),i=n.indexOf(r);return!r||i<0?e:(0,d.jsxs)(d.Fragment,{children:[e.slice(0,i),(0,d.jsx)(`mark`,{className:`rounded-sm bg-(--amarillo-light) text-inherit`,children:e.slice(i,i+t.length)}),e.slice(i+t.length)]})}function AW({ariaAttributes:e,index:t,style:n,items:r,expandedSet:i,selectedSet:a,selectionMode:o,selectionName:s,selectionDisabled:c,branchIds:l,filterType:u,query:f,expandLabel:p,collapseLabel:m,onToggleExpansion:h,onToggleSelection:g}){let _=r[t];if(!_)return null;let{node:v}=_,y=l?l.has(_.id):_.hasChildren,b=y&&i.has(_.id),x=a.has(_.id),S=v.type===`work_position`,C=c||v.disabled===!0,w=e=>{e.key===`ArrowRight`&&y&&!b||e.key===`ArrowLeft`&&y&&b?(e.preventDefault(),h(_.id)):(e.key===`Enter`||e.key===` `)&&S&&(e.preventDefault(),C||g(_.id))};return(0,d.jsxs)(`div`,{...e,role:`treeitem`,"aria-level":_.depth+1,"aria-expanded":y?b:void 0,"aria-selected":S?x:void 0,tabIndex:0,style:{...n,paddingLeft:`${12+_.depth*20}px`},className:Z(`flex min-w-0 items-center gap-2 px-3`,`outline-none transition-colors focus-visible:bg-(--interaction-hover)`,x&&`bg-(--interaction-selected)`,v.disabled&&`opacity-60`,v.className),onDoubleClick:()=>y&&h(_.id),onKeyDown:w,children:[(0,d.jsx)(`div`,{className:`flex size-7 shrink-0 items-center justify-center`,children:y?(0,d.jsx)(Gw,{type:`button`,size:`s`,"aria-label":`${b?m:p}: ${v.label}`,"aria-expanded":b,onClick:()=>h(_.id),children:(0,d.jsx)(KU,{name:b?`arrowUp`:`arrow`,size:`s`,className:`text-(--text)`})}):null}),S?o===`multiple`?(0,d.jsx)(vC,{size:`s`,checked:x,disabled:C,"aria-label":`Seleccionar ${v.label}`,onChange:()=>g(_.id)}):(0,d.jsx)(Jw,{size:`s`,name:s,checked:x,disabled:C,"aria-label":`Seleccionar ${v.label}`,onChange:()=>g(_.id)}):(0,d.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-5 shrink-0 items-center justify-center rounded-sm bg-(--g-100) p3 font-semibold text-(--muted)`,children:DW[v.type]}),(0,d.jsx)(`span`,{className:Z(`p2 min-w-0 flex-1 truncate text-(--text)`,v.type===`subcompany`&&`font-semibold`),children:(0,d.jsx)(kW,{label:v.label,query:v.type===u?f:``})})]})}function jW({ariaLabel:e,items:t=[],selectionMode:n=`single`,selectedIds:r,defaultSelectedIds:i,onSelectionChange:a,expandedIds:o,defaultExpandedIds:s,defaultExpandAll:c=!1,onExpandedChange:u,selectionDisabled:f=!1,filterTypeLabel:p=`Buscar por`,searchPlaceholder:m=`Ingresa una palabra`,clearSearchLabel:h=`Limpiar búsqueda`,subcompanyLabel:g=`Subcompañía`,areaLabel:_=`Área`,workPositionLabel:v=`Puesto`,emptyText:y=`No hay elementos disponibles`,noResultsText:b=`No se encontró un valor`,expandLabel:x=`Expandir`,collapseLabel:S=`Contraer`,height:C=360,rowHeight:w=48,overscanCount:T=5,loading:E=!1,loadingLabel:D=`Cargando`,className:O,headerClassName:k,bodyClassName:A},j){let M=(0,ee.useListRef)(null),N=l.default.useId(),P=l.default.useRef(null),[F,I]=l.default.useState(`work_position`),[L,R]=l.default.useState(``),[te,ne]=l.default.useState(``),{index:re,visibleItems:ie,expandedSet:z,selectedSet:ae,toggleExpansion:B,setItemExpansion:V,expandItems:H,expandAll:oe,collapseAll:se,expandAncestors:ce,toggleSelection:le}=EW({items:t,selectionMode:n,selectedIds:r,defaultSelectedIds:i,onSelectionChange:a,expandedIds:o,defaultExpandedIds:s,defaultExpandAll:c,onExpandedChange:u});l.default.useEffect(()=>{let e=window.setTimeout(()=>ne(L),200);return()=>window.clearTimeout(e)},[L]);let ue=te.trim().length>0,U=l.default.useMemo(()=>ue?xW(re,F,te):null,[te,F,re,ue]),de=l.default.useMemo(()=>U?SW(U):null,[U]),W=l.default.useMemo(()=>U?CW(re,U,z):ie,[z,U,re,ie]),fe=ue?`${F}:${te.trim()}`:``,pe=l.default.useRef(``);l.default.useEffect(()=>{pe.current!==fe&&(pe.current=fe,de?.size&&H(Array.from(de)))},[de,H,fe]),l.default.useEffect(()=>{let e=P.current;if(e===null)return;let t=W.findIndex(t=>t.id===e);t<0||(P.current=null,M.current?.scrollToRow({index:t,align:`smart`}))},[W,M]);let me=l.default.useCallback(e=>{let t=W.findIndex(t=>t.id===e);t>=0&&M.current?.scrollToRow({index:t,align:`smart`})},[W,M]);l.default.useImperativeHandle(j,()=>({expandAll:oe,collapseAll:se,setItemExpansion:V,focusItem:e=>{P.current=e,ce(e)},getItem:e=>re.itemsById.get(e)?.node,scrollToItem:me}),[se,oe,ce,re.itemsById,me,V]);let he=l.default.useMemo(()=>({items:W,expandedSet:z,selectedSet:ae,selectionMode:n,selectionName:N,selectionDisabled:f,branchIds:de,filterType:F,query:ue?te.trim():``,expandLabel:x,collapseLabel:S,onToggleExpansion:B,onToggleSelection:le}),[de,S,te,W,x,z,F,ue,ae,N,f,n,B,le]),ge=l.default.useCallback((e,t)=>t.items[e]?.id??e,[]),_e=e??`Árbol virtual`,ve=t.length>0,ye=W.length>0;return(0,d.jsxs)(`section`,{"aria-busy":E||void 0,className:Z(`relative flex w-full min-w-0 flex-col overflow-hidden rounded-(--r-m)`,`border border-(--border) bg-(--surface)`,O),children:[(0,d.jsxs)(`header`,{className:Z(`grid gap-2 bg-(--base-dark) px-5 py-4 text-(--on-dark-text) sm:grid-cols-[minmax(0,1fr)_15rem]`,k),children:[(0,d.jsxs)(`div`,{className:`relative min-w-10 w-full`,children:[(0,d.jsx)(Kw,{value:L,placeholder:m,white:!1,className:`pr-2`,onChange:e=>R(e.target.value)}),L&&(0,d.jsx)(Gw,{type:`button`,size:`s`,"aria-label":h,disabled:!L,onClick:()=>R(``),className:`absolute bottom-1.5 right-2 z-10 size-8 top-0`,children:(0,d.jsx)(`img`,{src:Op.close,alt:``,className:`size-4`})})]}),(0,d.jsx)(Z_,{selectionMode:`single`,label:p,placeholder:`Seleccionar filtro`,values:OW.map(e=>({...e,label:e.value===`subcompany`?g:e.value===`area`?_:v})),value:F,setValue:e=>{OW.some(t=>t.value===e)&&I(e)},clearLabel:`Mantener filtro seleccionado`,white:!1})]}),(0,d.jsx)(`div`,{className:Z(`grid min-h-0 gap-2 p-4`,A),children:(0,d.jsxs)(`div`,{className:`relative min-h-0 overflow-hidden rounded-(--r-s) border border-(--border)`,children:[ve?ye?(0,d.jsx)(ee.List,{listRef:M,role:`tree`,"aria-label":_e,"aria-multiselectable":n===`multiple`||void 0,rowComponent:AW,rowCount:W.length,rowHeight:w,rowProps:he,rowKey:ge,overscanCount:T,style:{height:C}}):(0,d.jsx)(`div`,{role:`status`,className:`p2 flex items-center justify-center px-3 text-center text-(--muted)`,style:{height:C},children:b}):(0,d.jsx)(`div`,{className:`p2 flex items-center justify-center px-4 text-center text-(--muted)`,style:{height:C},children:y}),E?(0,d.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`p2 absolute inset-0 flex items-center justify-center bg-(--loading-overlay)`,children:D}):null]})})]})}var MW=l.default.forwardRef(jW);function NW({segment:e,index:t,color:n,leftPct:r,tooltip:i,align:a=`center`,onClick:o}){let s=!!o,c=(0,d.jsx)(`span`,{role:s?`button`:void 0,tabIndex:s?0:void 0,onClick:s?e=>o?.(t,e.currentTarget):void 0,onKeyDown:s?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o?.(t,e.currentTarget))}:void 0,style:{color:n,fontSize:`1rem`,lineHeight:`1.25rem`},className:Z(`block whitespace-nowrap font-semibold`,s&&`cursor-pointer hover:underline`),children:e.label??`—`});return(0,d.jsx)(`span`,{className:`absolute`,style:{left:`${r}%`,transform:a===`start`?void 0:a===`end`?`translateX(-100%)`:`translateX(-50%)`},children:i?(0,d.jsx)(gC,{content:i,placement:`bottom`,children:c}):c})}function PW(e){return{backgroundColor:e,border:`0.125rem solid ${e}`,boxSizing:`border-box`}}function FW({boundary:e,isEdge:t,color:n,tooltip:r,editable:i,minDate:o,maxDate:s,align:c=`center`,onDateChange:l,onClick:u}){let{open:p,ready:m,close:h,toggle:g,position:_,anchorVars:v,triggerRef:y,panelRef:b}=IS(),x=t?`1.25rem`:`1rem`,S=i||!!u,C=[];o&&C.push({before:o.toDate()}),s&&C.push({after:s.toDate()});let w=(0,d.jsx)(`button`,{ref:y,type:`button`,"aria-label":i?`Editar fecha ${e.date.format(`DD/MM/YYYY`)}`:e.date.format(`DD/MM/YYYY`),"aria-haspopup":i?`dialog`:void 0,"aria-expanded":i?p:void 0,disabled:!S,onClick:e=>{if(i){g();return}u?.(e.currentTarget)},className:Z(`block rounded-full transition-transform duration-150`,S&&`cursor-pointer hover:scale-110`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--ring)`),style:{width:x,height:x,...PW(n)}}),T=i&&p&&m&&typeof document<`u`?(0,f.createPortal)((0,d.jsx)(`div`,{ref:b,style:v,className:Z(`rb-popover-layer p1 absolute top-(--panel-top) left-(--panel-left)`,`w-(--datepicker-w) max-w-[calc(100vw-var(--sp-m))]`,`flex flex-col overflow-hidden rounded-(--r-m) bg-(--surface) p-(--sp-xs) shadow-(--shadow-lg)`,_.placement===`top`&&`-translate-y-full`),children:(0,d.jsx)(uS,{mode:`single`,fixedWeeks:!0,showOutsideDays:!0,weekStartsOn:1,selected:e.date.toDate(),defaultMonth:e.date.toDate(),disabled:C.length?C:void 0,onSelect:e=>{e&&l?.((0,a.default)(e)),h()}})}),document.body):null;return(0,d.jsxs)(`span`,{className:`absolute z-2 block`,style:{left:`${e.leftPct}%`,top:`50%`,transform:c===`start`?`translate(0, -50%)`:c===`end`?`translate(-100%, -50%)`:`translate(-50%, -50%)`},children:[r?(0,d.jsx)(gC,{content:r,placement:`bottom`,children:w}):w,T]})}var IW=.4,LW=.5,RW=.01;function zW(e,t,n){if(n)return{start:n.startDate,end:n.endDate};let r=e[0].startDate,i=e[e.length-1],a=e=>!!(t&&e.isSame(t,`day`));if(!a(i.endDate))return{start:r,end:i.endDate};let o=e.map(e=>e.endDate).filter(e=>!a(e)).reduce((e,t)=>t.isAfter(e)?t:e,r),s=i.startDate.add(30,`day`);return{start:r,end:o.isAfter(s)?o:s}}function BW(e,t,n){let{start:r,end:i}=zW(e,t,n),a=Math.max(1,i.diff(r,`day`)),o=e=>!!(t&&e.isSame(t,`day`)),s=e=>{if(o(e))return 100;let t=e.diff(r,`day`);return Math.max(0,Math.min(100,t/a*100))},c=[],l=0;return e.forEach((e,t)=>{let n=Math.max(l,s(e.startDate)),r=s(e.endDate);n-l>RW&&c.push({type:`gap`,index:t,startPct:l,widthPct:n-l});let i=Math.min(100-n,Math.max(LW,r-n));c.push({type:`segment`,index:t,startPct:n,widthPct:i}),l=n+i}),100-l>RW&&c.push({type:`gap`,index:e.length,startPct:l,widthPct:100-l}),c}function VW(e,t,n={}){if(n.proportional)return BW(e,n.indefiniteDate,n.domain);if(!t){let t=100/e.length;return e.map((e,n)=>({type:`segment`,index:n,startPct:n*t,widthPct:t}))}let r=e.slice(1).filter((t,r)=>{let i=e[r];return!(n.mergeAdjacentBoundaries&&i.endDate.add(1,`day`).isSame(t.startDate,`day`))}).length,i=100/(e.length+r*IW),a=[],o=0;return e.forEach((t,r)=>{let s=r>0?e[r-1]:null,c=n.mergeAdjacentBoundaries&&!!(s&&s.endDate.add(1,`day`).isSame(t.startDate,`day`));if(r>0&&!c){let e=i*IW;a.push({type:`gap`,index:r,startPct:o,widthPct:e}),o+=e}a.push({type:`segment`,index:r,startPct:o,widthPct:i}),o+=i}),a}function HW(e,t,n,r=!1){let i=[];e.forEach((a,o)=>{let s=o>0?e[o-1]:null,c=!!(s&&s.endDate.add(1,`day`).isSame(a.startDate,`day`)),l=r&&c,u=n&&s!==null&&!l;if(s&&u){let e=t[o-1];i.push({key:`${s.id}-end`,kind:`end`,date:s.endDate,leftPct:e.startPct+e.widthPct,segmentIndex:o-1,previousIndex:null})}i.push({key:`${a.id}-start`,kind:s&&(!u||l)?`shared`:`start`,date:a.startDate,leftPct:s&&l?(t[o-1].startPct+t[o-1].widthPct+t[o].startPct)/2:t[o].startPct,segmentIndex:o,previousIndex:s?o-1:null})});let a=e.length-1;return i.push({key:`${e[a].id}-end`,kind:`end`,date:e[a].endDate,leftPct:100,segmentIndex:a,previousIndex:null}),i}function UW(e,t,n,r=!1){let i=t[e.segmentIndex],a=+!r;if(e.kind===`end`){let r=t[e.segmentIndex+1];return{min:i.startDate,max:n&&r?r.startDate.subtract(a,`day`):null}}let o=e.previousIndex===null?null:t[e.previousIndex];return{min:o?e.kind===`shared`?o.startDate.add(a,`day`):o.endDate.add(a,`day`):null,max:i.endDate}}var WW=[`#EAB300`,`#8A9A00`,`#50E300`,`#00A85A`,`#00D5EE`,`#008CF0`],GW=`#90a4ae`,KW=`h-full bg-(--g-200)`,qW=5.5,JW=8,YW=e=>e?.isValid?.()?e.format(`DD/MM/YYYY`):``;function XW(e,t){let n={},r=0;return e.forEach(e=>{if(e.color)return;let i=String(e.id);n[i]||(n[i]=t[r++%t.length]??GW)}),n}function ZW(e,t){return e.color??t[String(e.id)]??GW}function QW(e){return typeof e.label==`string`&&e.label.trim()?e.label:null}function $W(e,t,n){let r=QW(e);if(!r)return!1;let i=r.length*qW+JW;return n*t/100>=i}function eG({segments:e,mode:t=`simple`,external_labels:n,legend:r=!1,compactRange:i,tooltips:a=!0,startBoundary:o,endBoundary:s,colors:c=WW,formatDate:u=YW,segmentTooltip:f,boundaryTooltip:p,onSegmentClick:m,onBoundaryClick:h,allowGaps:g=!1,mergeAdjacentBoundaries:_=!1,scale:v=`equal`,editableBoundaries:y=!1,exclusiveEnd:b=!1,indefiniteDate:x,indefiniteLabel:S=`Indefinido`,onBoundaryDateChange:C,className:w}){let T=(0,l.useRef)(null),[E,D]=(0,l.useState)(0);if((0,l.useEffect)(()=>{let e=T.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>D(e.clientWidth);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),e.length===0)return null;let O=XW(e,c),k=VW(e,g,{proportional:v===`proportional`,indefiniteDate:x,mergeAdjacentBoundaries:_}),A=k.filter(e=>e.type===`segment`),j=HW(e,A,g,_),M=y&&!!C,N=j.length-1,P=e=>!!(x&&e.isSame(x,`day`)),F=e=>P(e)?S:u(e),I=n?.fecha_inicio??u(i?.startDate??e[0].startDate),ee=n?.fecha_fin??F(i?.endDate??e[e.length-1].endDate),L=VW(e,!0,{proportional:!0,indefiniteDate:x,domain:i}),R=(e,t)=>e.tooltip??f?.(e,t)??(0,d.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,d.jsx)(`strong`,{children:e.label??`—`}),(0,d.jsxs)(`span`,{children:[u(e.startDate),` -`,` `,F(e.endDate)]})]});return t===`compact`?(0,d.jsxs)(`div`,{className:Z(`flex w-full min-w-0 flex-col rounded-md bg-black/5`,w),style:{padding:`0.75rem 0.5rem`,rowGap:`0.5rem`},children:[(0,d.jsxs)(`div`,{className:`flex w-full items-center gap-3`,children:[(0,d.jsx)(`span`,{className:`flex shrink-0 flex-col items-center gap-1 text-(--muted,#666)`,"aria-label":`Fecha de inicio`,children:(0,d.jsx)(`span`,{className:`text-xs font-semibold whitespace-nowrap`,children:I})}),(0,d.jsxs)(`div`,{ref:T,className:`relative min-w-0 flex-1`,style:{height:`2.25rem`,minWidth:`6.25rem`},children:[(0,d.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-full bg-(--g-200)`,style:{height:`0.375rem`}}),L.map(t=>{if(t.type===`gap`)return null;let n=e[t.index],r=$W(n,t.widthPct,E)?QW(n):null,i=(0,d.jsx)(`div`,{className:`h-3 w-full rounded-full border border-(--surface) shadow-[0_0_0_1px_color-mix(in_srgb,currentColor_34%,transparent)]`,style:{color:ZW(n,O),backgroundColor:ZW(n,O)}}),o=(0,d.jsxs)(`div`,{className:`relative h-full w-full`,children:[r?(0,d.jsx)(`span`,{className:`absolute bottom-5 left-1/2 z-10 -translate-x-1/2 whitespace-nowrap text-[0.825rem] font-semibold leading-none text-(--text)`,children:r}):null,(0,d.jsx)(`div`,{className:`absolute inset-x-0 bottom-0`,children:i})]});return(0,d.jsx)(`div`,{className:`absolute bottom-0`,style:{left:`${t.startPct}%`,width:`${t.widthPct}%`},children:a?(0,d.jsx)(gC,{content:R(n,t.index),placement:`bottom`,multiline:!0,triggerClassName:`block h-9 w-full`,children:o}):(0,d.jsx)(l.Fragment,{children:o})},`compact-segment-${n.id}`)})]}),(0,d.jsx)(`span`,{className:`flex shrink-0 flex-col items-center gap-1 text-(--muted,#666)`,"aria-label":`Fecha de fin`,children:(0,d.jsx)(`span`,{className:`text-xs font-semibold whitespace-nowrap`,children:ee})})]}),r?(0,d.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:e.map(e=>(0,d.jsxs)(`span`,{className:`flex items-center gap-2 text-sm text-(--text)`,children:[(0,d.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full`,style:{backgroundColor:ZW(e,O)}}),(0,d.jsx)(`span`,{children:e.label??`—`})]},`legend-${e.id}`))}):null]}):(0,d.jsxs)(`div`,{className:Z(`flex w-full min-w-0 flex-col rounded-md bg-black/5`,w),style:{padding:`0.75rem 0.5rem`,rowGap:`0.25rem`},children:[(0,d.jsx)(`div`,{className:`relative w-full`,style:{height:`1.5rem`},children:e.map((e,t)=>(0,d.jsx)(NW,{segment:e,index:t,color:ZW(e,O),leftPct:A[t].startPct+A[t].widthPct/2,tooltip:e.tooltip??f?.(e,t)??null,onClick:m?(t,n)=>m({segment:e,index:t,anchorEl:n}):void 0},e.id))}),(0,d.jsxs)(`div`,{className:`relative flex w-full items-center`,style:{height:`2rem`},children:[(0,d.jsx)(`div`,{className:`flex w-full overflow-hidden rounded-md`,style:{height:`0.375rem`},children:k.map(t=>t.type===`gap`?(0,d.jsx)(`div`,{style:{width:`${t.widthPct}%`},className:KW},`gap-${t.index}`):(0,d.jsx)(`div`,{style:{width:`${t.widthPct}%`,backgroundColor:ZW(e[t.index],O)},className:`h-full`},e[t.index].id))}),j.map((t,n)=>{let r=n===0,i=n===N,a=!r&&!i,c=P(t.date),{min:l,max:f}=UW(t,e,g,b),m=r?o?.color??ZW(e[0],O):i?s?.color??GW:ZW(e[t.segmentIndex],O),_=r?o?.tooltip??u(t.date):i?s?.tooltip??(c?S:u(t.date)):p?.({index:n,previousSegment:t.previousIndex===null?e[t.segmentIndex]:e[t.previousIndex],nextSegment:e[t.segmentIndex],anchorEl:null})??u(t.date);return(0,d.jsx)(FW,{boundary:t,isEdge:r||i,color:m,tooltip:_,editable:M&&!c,minDate:l,maxDate:f,align:r?`start`:i?`end`:`center`,onDateChange:e=>C?.({kind:t.kind,date:e,segmentIndex:t.segmentIndex,previousIndex:t.previousIndex,minDate:l,maxDate:f}),onClick:a&&h&&!M?r=>h({index:n,previousSegment:e[t.previousIndex??t.segmentIndex],nextSegment:e[t.segmentIndex],anchorEl:r}):void 0},t.key)})]}),(0,d.jsx)(`div`,{className:`relative w-full`,style:{height:`1.5rem`,marginTop:`0.25rem`},children:j.map((e,t)=>(0,d.jsx)(`span`,{className:`absolute whitespace-nowrap text-(--muted,#666)`,style:{left:`${e.leftPct}%`,transform:e.kind===`end`?`translateX(-100%)`:void 0,textAlign:e.kind===`end`?`right`:`left`,fontSize:`0.875rem`,lineHeight:`1.25rem`,fontWeight:400},children:t===0?o?.label??u(e.date):t===N?s?.label??(P(e.date)?S:u(e.date)):P(e.date)?S:u(e.date)},e.key))})]})}e.AuthLanguageDropdown=F_,e.AuthPasswordInput=tT,e.AuthShell=P_,e.AutoCustomCompleteField=Z_,e.Breadcrumbs=IT,e.CalendarChipIcon=Sw,e.Calendario=gw,e.Card=zw,e.CardContent=Hw,e.CardFooter=Uw,e.CardHeader=Bw,e.CardTitle=Vw,e.Checkbox=vC,e.ClockChipIcon=Cw,e.ConfirmDialog=eT,e.Core=zT,e.CoreContext=W,e.CoreProvider=BT,e.CustomDateControl=MC,e.CustomDatePicker=cC,e.CustomDateRangeCalendar=HC,e.CustomDateRangePicker=zC,e.CustomDateRangefield=IC,e.CustomDatefield=JS,e.CustomIndefiniteDatePicker=jC,e.CustomSelect=eE,e.CustomTimefield=PC,Object.defineProperty(e,"DGEnUs",{enumerable:!0,get:function(){return t.enUS}}),Object.defineProperty(e,"DGEsEs",{enumerable:!0,get:function(){return t.esES}}),e.DashboardShell=AT,e.EmptyState=bE,e.Form=lE,e.FormField=jE,e.FormGrid=AE,e.FormShell=EE,e.GoodRabbitDarkTheme=U,e.GoodRabbitLightTheme=de,e.Input=Kw,e.LegacyCustomTimefield=rE,e.MessageAlert=fE,e.PillsTabs=FE,e.RbPillsTabs=FE,e.Portal=Xw,e.RBButton=R_,e.Radio=Jw,e.RbContextMenu=yw,e.RbExcelTable=xU,e.RbIconButton=Gw,e.RbInlineChipField=Lw,e.RbList=ME,e.RbListItem=NE,e.RbStepper=Yw,e.RbTabPanel=LE,e.TabPanel=LE,e.RbTable=bD,e.RbTableToolbar=eD,e.RbToolbarActionButton=SU,e.RbToolbarActions=CU,e.RbToolbarDateRangeField=wU,e.RbToolbarMultiSelectField=DU,e.RbToolbarSearchField=kU,e.RbToolbarSelectField=MU,e.ShellContent=oT,e.Sidebar=Bp,e.SidebarContent=VU,e.SidebarFooter=UU,e.SidebarHeader=IU,e.SystemAlert=ET,e.Table=YT,e.Timeline=eG,e.Tooltip=gC,e.TopBar=dT,e.TopBarUserMenu=sT,e.TreePanel=fW,e.VirtualTree=MW,e.buildVirtualTreeIndex=mW,e.chekingSSOMS=j_,e.cn=Z,Object.defineProperty(e,"coreEnUS",{enumerable:!0,get:function(){return n.enUS}}),Object.defineProperty(e,"coreEsES",{enumerable:!0,get:function(){return n.esES}}),e.filterVirtualTreeItems=xW,e.findNodeById=QU,e.flattenTree=ZU,e.formatRbExcelDate=eU,e.formatRbExcelTime=tU,e.getExpandableNodeIds=$U,e.getNodeSelectionState=rW,e.getRbExcelValueAtPath=YH,e.getRbImageUrl=kp,e.getSelectableDescendantIds=tW,e.getSelectableSubtreeIds=eW,e.getVirtualTreeAncestorIds=hW,e.getVisibleVirtualTreeItems=_W,e.hasNodeChildren=XU,e.initializeAuth=M_,e.isNodeSelectable=JU,e.isNodeSelectionMutable=YU,e.isRbExcelEmptyValue=ZH,e.isValidRbExcelDate=rU,e.isValidRbExcelNumber=aU,e.isValidRbExcelTime=iU,e.normalizeHierarchicalSelection=nW,e.normalizeVirtualTreeSearch=vW,e.normalizeVirtualTreeSelection=wW,e.observeSSO=N_,e.parseRbExcelValue=nU,Object.defineProperty(e,"pickersEnUS",{enumerable:!0,get:function(){return r.enUS}}),Object.defineProperty(e,"pickersEsES",{enumerable:!0,get:function(){return r.esES}}),e.rbImages=Op,e.setRbExcelValueAtPath=XH,e.toggleExpandedNode=aW,e.toggleNodeSelection=iW,e.toggleVirtualTreeSelection=TW,e.useRbSystemAlert=OT,e.useSystemAlert=ZT,e.useTable=XT,e.useVirtualTreeState=EW});
|