@isettingkit/business-rules 2.2.12 → 2.2.13
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/index.es.js +717 -696
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as a, jsxs as m, Fragment as V } from "react/jsx-runtime";
|
|
2
|
-
import { MdOutlineDelete as ft, MdClear as Gt, MdAdd as We, MdOutlineCreate as
|
|
3
|
-
import { inube as I, Stack as y, Divider as Y, Icon as G, Text as F, SkeletonLine as re, useMediaQuery as ue, Blanket as Bt, Button as Q, Grid as Ye, Toggle as mt, Checkbox as qt, Date as
|
|
4
|
-
import E, { keyframes as Wt, ThemeContext as
|
|
2
|
+
import { MdOutlineDelete as ft, MdClear as Gt, MdAdd as We, MdOutlineCreate as Hn, MdExpandLess as Gn, MdExpandMore as Lt, MdInfo as Bn, MdCached as qn, MdOutlineInfo as Wn, MdClose as Yn, MdOutlineFilterAltOff as Xn, MdOutlineFilterAlt as xn, MdChevronRight as Kt, MdArrowRight as Qn, MdOutlineArrowCircleLeft as Jn, MdOutlineArrowCircleRight as Zn } from "react-icons/md";
|
|
3
|
+
import { inube as I, Stack as y, Divider as Y, Icon as G, Text as F, SkeletonLine as re, useMediaQuery as ue, Blanket as Bt, Button as Q, Grid as Ye, Toggle as mt, Checkbox as qt, Date as Ae, Box as Kn, Tag as _e, Tabs as Dn, SkeletonIcon as eo, Fieldset as Ve, OptionList as to, Checkpicker as no } from "@inubekit/inubekit";
|
|
4
|
+
import E, { keyframes as Wt, ThemeContext as oo } from "styled-components";
|
|
5
5
|
import { ValueDataType as H, ValueHowToSetUp as j, DecisionConditionRender as ut, DecisionConditionRenderNew as en } from "@isettingkit/input";
|
|
6
|
-
import { DecisionViewConditionRenderer as
|
|
6
|
+
import { DecisionViewConditionRenderer as Ne, DecisionViewConditionRendererNew as it } from "@isettingkit/view";
|
|
7
7
|
import { createPortal as Yt } from "react-dom";
|
|
8
8
|
import { useFormik as Xt } from "formik";
|
|
9
|
-
import { string as
|
|
10
|
-
import
|
|
11
|
-
import { Link as
|
|
12
|
-
import
|
|
13
|
-
import { franc as
|
|
14
|
-
const
|
|
9
|
+
import { string as ge, mixed as ve, object as te, number as pe, lazy as Ge, date as Ie } from "yup";
|
|
10
|
+
import _, { useState as B, useRef as je, useEffect as Be, useContext as ro } from "react";
|
|
11
|
+
import { Link as wn, useLocation as io } from "react-router-dom";
|
|
12
|
+
import ao from "axios";
|
|
13
|
+
import { franc as lo } from "franc-min";
|
|
14
|
+
const so = E.div`
|
|
15
15
|
border-radius: 8px;
|
|
16
16
|
border: 1px solid
|
|
17
17
|
${({ theme: e }) => {
|
|
@@ -48,7 +48,7 @@ E.div`
|
|
|
48
48
|
`;
|
|
49
49
|
const Xe = (e) => {
|
|
50
50
|
const { children: t, controls: n = !0, handleDelete: o, id: r } = e;
|
|
51
|
-
return /* @__PURE__ */ a(
|
|
51
|
+
return /* @__PURE__ */ a(so, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
52
52
|
t,
|
|
53
53
|
n && /* @__PURE__ */ m(V, { children: [
|
|
54
54
|
/* @__PURE__ */ a(Y, {}),
|
|
@@ -66,20 +66,20 @@ const Xe = (e) => {
|
|
|
66
66
|
) })
|
|
67
67
|
] })
|
|
68
68
|
] }) });
|
|
69
|
-
},
|
|
69
|
+
}, co = (e) => e.value, uo = (e) => e.value, po = (e) => e.value, ho = (e) => ({
|
|
70
70
|
from: e.from ?? "",
|
|
71
71
|
to: e.to ?? ""
|
|
72
|
-
}),
|
|
72
|
+
}), go = (e) => e.value, fo = (e) => e.value, mo = (e) => e.value;
|
|
73
73
|
var k = /* @__PURE__ */ ((e) => (e.EQUAL = "EqualTo", e.GREATER_THAN = "GreaterThan", e.LESS_THAN = "LessThan", e.LIST_OF_VALUES = "ListOfValues", e.LIST_OF_VALUES_MULTI = "ListOfValuesMulti", e.RANGE = "Range", e))(k || {});
|
|
74
|
-
const
|
|
75
|
-
[k.LIST_OF_VALUES]:
|
|
76
|
-
[k.LIST_OF_VALUES_MULTI]:
|
|
77
|
-
[k.RANGE]:
|
|
78
|
-
[k.GREATER_THAN]:
|
|
79
|
-
[k.LESS_THAN]:
|
|
80
|
-
[k.EQUAL]:
|
|
74
|
+
const bo = {
|
|
75
|
+
[k.LIST_OF_VALUES]: uo,
|
|
76
|
+
[k.LIST_OF_VALUES_MULTI]: po,
|
|
77
|
+
[k.RANGE]: ho,
|
|
78
|
+
[k.GREATER_THAN]: go,
|
|
79
|
+
[k.LESS_THAN]: fo,
|
|
80
|
+
[k.EQUAL]: mo
|
|
81
81
|
}, Ue = (e) => {
|
|
82
|
-
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), o =
|
|
82
|
+
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), o = bo[e == null ? void 0 : e.howToSetTheDecision] || co;
|
|
83
83
|
return n && o(t) || t || void 0;
|
|
84
84
|
}, tn = E.div`
|
|
85
85
|
& > div {
|
|
@@ -108,7 +108,7 @@ const mo = {
|
|
|
108
108
|
background-color: #ebecf0;
|
|
109
109
|
border-radius: 8px;
|
|
110
110
|
}
|
|
111
|
-
`,
|
|
111
|
+
`, vo = (e) => {
|
|
112
112
|
const {
|
|
113
113
|
conditionsAlignment: t,
|
|
114
114
|
decision: n,
|
|
@@ -122,7 +122,7 @@ const mo = {
|
|
|
122
122
|
} = e;
|
|
123
123
|
return i ? /* @__PURE__ */ m(y, { direction: "column", gap: "12px", children: [
|
|
124
124
|
/* @__PURE__ */ a(y, { direction: "column", alignItems: "center", children: /* @__PURE__ */ a(
|
|
125
|
-
|
|
125
|
+
Ne,
|
|
126
126
|
{
|
|
127
127
|
element: r,
|
|
128
128
|
valueData: Ue(
|
|
@@ -152,7 +152,7 @@ const mo = {
|
|
|
152
152
|
}
|
|
153
153
|
),
|
|
154
154
|
u.length > 0 && u.map((p) => /* @__PURE__ */ a(tn, { children: /* @__PURE__ */ a(y, { direction: "column", padding: "8px", children: /* @__PURE__ */ a(
|
|
155
|
-
|
|
155
|
+
Ne,
|
|
156
156
|
{
|
|
157
157
|
element: { ...p, value: p.value },
|
|
158
158
|
valueData: Ue(
|
|
@@ -162,7 +162,7 @@ const mo = {
|
|
|
162
162
|
) }) }, p.conditionName)),
|
|
163
163
|
u.length > 0 && /* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
164
164
|
d && /* @__PURE__ */ a(V, { children: o && /* @__PURE__ */ a(
|
|
165
|
-
|
|
165
|
+
Ne,
|
|
166
166
|
{
|
|
167
167
|
element: o.element,
|
|
168
168
|
valueData: o.valueData,
|
|
@@ -245,7 +245,7 @@ const mo = {
|
|
|
245
245
|
(g) => !g.hidden
|
|
246
246
|
)) || [], u = Array.from({ length: 5 }), p = !!(!n && t && o && d), c = l.length < 2 ? "start" : "space-between";
|
|
247
247
|
return /* @__PURE__ */ a(
|
|
248
|
-
|
|
248
|
+
vo,
|
|
249
249
|
{
|
|
250
250
|
conditionsAlignment: c,
|
|
251
251
|
decision: t,
|
|
@@ -258,12 +258,12 @@ const mo = {
|
|
|
258
258
|
visibleConditions: l
|
|
259
259
|
}
|
|
260
260
|
);
|
|
261
|
-
},
|
|
261
|
+
}, yo = E.div`
|
|
262
262
|
position: relative;
|
|
263
263
|
& > div {
|
|
264
264
|
padding: 24px 16px;
|
|
265
265
|
}
|
|
266
|
-
`,
|
|
266
|
+
`, To = E.div`
|
|
267
267
|
background-color: ${({ theme: e }) => {
|
|
268
268
|
var t, n;
|
|
269
269
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || I.palette.neutral.N0;
|
|
@@ -294,7 +294,7 @@ const mo = {
|
|
|
294
294
|
background-color: #ebecf0;
|
|
295
295
|
border-radius: 8px;
|
|
296
296
|
}
|
|
297
|
-
`,
|
|
297
|
+
`, Cn = (e) => {
|
|
298
298
|
const { children: t, portalId: n, onCloseModal: o, title: r } = e, i = document.getElementById(n);
|
|
299
299
|
if (!i)
|
|
300
300
|
throw new Error(
|
|
@@ -302,7 +302,7 @@ const mo = {
|
|
|
302
302
|
);
|
|
303
303
|
const s = ue("(max-width: 400px)");
|
|
304
304
|
return Yt(
|
|
305
|
-
/* @__PURE__ */ a(
|
|
305
|
+
/* @__PURE__ */ a(yo, { smallScreen: s, children: /* @__PURE__ */ a(Bt, { children: /* @__PURE__ */ a(To, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "24px", children: [
|
|
306
306
|
/* @__PURE__ */ a(y, { direction: "column", gap: "24px", children: /* @__PURE__ */ m(y, { alignItems: "center", justifyContent: "space-between", children: [
|
|
307
307
|
/* @__PURE__ */ a(F, { type: "title", size: "large", appearance: "dark", weight: "bold", children: r }),
|
|
308
308
|
/* @__PURE__ */ a(Gt, { size: "24px", cursor: "pointer", onClick: o })
|
|
@@ -311,7 +311,7 @@ const mo = {
|
|
|
311
311
|
] }) }) }) }),
|
|
312
312
|
i
|
|
313
313
|
);
|
|
314
|
-
},
|
|
314
|
+
}, xo = Wt`
|
|
315
315
|
from {
|
|
316
316
|
opacity: 0;
|
|
317
317
|
transform: translateY(20px);
|
|
@@ -345,7 +345,7 @@ E.div`
|
|
|
345
345
|
}};
|
|
346
346
|
}
|
|
347
347
|
`;
|
|
348
|
-
const
|
|
348
|
+
const Sn = E.div`
|
|
349
349
|
& > div {
|
|
350
350
|
background-color: ${({ theme: e }) => {
|
|
351
351
|
var t, n;
|
|
@@ -362,14 +362,14 @@ const Cn = E.div`
|
|
|
362
362
|
width: 100%;
|
|
363
363
|
height: 100%;
|
|
364
364
|
& > div {
|
|
365
|
-
animation: ${
|
|
365
|
+
animation: ${xo} 600ms ease-out;
|
|
366
366
|
}
|
|
367
|
-
`,
|
|
367
|
+
`, Do = E.div`
|
|
368
368
|
& > div > div {
|
|
369
369
|
border-radius: 8px;
|
|
370
370
|
box-sizing: border-box;
|
|
371
371
|
}
|
|
372
|
-
`,
|
|
372
|
+
`, wo = E.div`
|
|
373
373
|
& > div {
|
|
374
374
|
width: 100%;
|
|
375
375
|
height: 100%;
|
|
@@ -389,7 +389,7 @@ const Cn = E.div`
|
|
|
389
389
|
border-radius: 8px;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
`,
|
|
392
|
+
`, Co = (e) => {
|
|
393
393
|
const { index: t, handleOpenModal: n } = e;
|
|
394
394
|
return /* @__PURE__ */ a(
|
|
395
395
|
Xe,
|
|
@@ -403,7 +403,7 @@ const Cn = E.div`
|
|
|
403
403
|
},
|
|
404
404
|
`loading-card-${t}`
|
|
405
405
|
);
|
|
406
|
-
},
|
|
406
|
+
}, So = (e) => {
|
|
407
407
|
const { decision: t, controls: n, handleOpenModal: o, handleDelete: r, textValues: i } = e;
|
|
408
408
|
return t ? /* @__PURE__ */ a(Qe, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
|
|
409
409
|
/* @__PURE__ */ a(F, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
|
|
@@ -418,7 +418,7 @@ const Cn = E.div`
|
|
|
418
418
|
}
|
|
419
419
|
)
|
|
420
420
|
] }) }, t.decisionId) : null;
|
|
421
|
-
},
|
|
421
|
+
}, Eo = (e) => {
|
|
422
422
|
const {
|
|
423
423
|
customTitleContentAddCard: t,
|
|
424
424
|
index: n,
|
|
@@ -428,7 +428,7 @@ const Cn = E.div`
|
|
|
428
428
|
return /* @__PURE__ */ a(Qe, { children: r ? null : /* @__PURE__ */ m(y, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
|
|
429
429
|
/* @__PURE__ */ a(F, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
|
|
430
430
|
/* @__PURE__ */ a(
|
|
431
|
-
|
|
431
|
+
Sn,
|
|
432
432
|
{
|
|
433
433
|
onClick: () => o ? o() : null,
|
|
434
434
|
children: /* @__PURE__ */ a(
|
|
@@ -448,14 +448,14 @@ const Cn = E.div`
|
|
|
448
448
|
}
|
|
449
449
|
)
|
|
450
450
|
] }) }, `add-decision-${n}`);
|
|
451
|
-
},
|
|
452
|
-
loading:
|
|
453
|
-
decision:
|
|
454
|
-
add:
|
|
451
|
+
}, No = {
|
|
452
|
+
loading: Co,
|
|
453
|
+
decision: So,
|
|
454
|
+
add: Eo
|
|
455
455
|
}, Ot = (e) => {
|
|
456
|
-
const { type: t } = e, n =
|
|
456
|
+
const { type: t } = e, n = No[t];
|
|
457
457
|
return n ? n(e) : null;
|
|
458
|
-
},
|
|
458
|
+
}, ko = (e) => {
|
|
459
459
|
const {
|
|
460
460
|
controls: t,
|
|
461
461
|
customTitleContentAddCard: n,
|
|
@@ -488,7 +488,7 @@ const Cn = E.div`
|
|
|
488
488
|
})
|
|
489
489
|
), u = ((o == null ? void 0 : o.length) === 0 || o.length < Math.floor(window.innerWidth / 300)) && !r && t;
|
|
490
490
|
return { renderedCards: l, shouldRenderAddCard: u };
|
|
491
|
-
},
|
|
491
|
+
}, ml = (e) => {
|
|
492
492
|
const {
|
|
493
493
|
controls: t = !0,
|
|
494
494
|
customTitleContentAddCard: n,
|
|
@@ -504,7 +504,7 @@ const Cn = E.div`
|
|
|
504
504
|
handleSubmitForm: h,
|
|
505
505
|
handleDelete: g,
|
|
506
506
|
terms: f = !0
|
|
507
|
-
} = e, v = ue("(max-width: 681px)"), T = ue("(max-width: 400px)"), { renderedCards: w, shouldRenderAddCard: D } =
|
|
507
|
+
} = e, v = ue("(max-width: 681px)"), T = ue("(max-width: 400px)"), { renderedCards: w, shouldRenderAddCard: D } = ko({
|
|
508
508
|
controls: t,
|
|
509
509
|
customTitleContentAddCard: n,
|
|
510
510
|
decisions: r,
|
|
@@ -514,7 +514,7 @@ const Cn = E.div`
|
|
|
514
514
|
textValues: i
|
|
515
515
|
}), S = (r == null ? void 0 : r.length) === 0 && !u;
|
|
516
516
|
return /* @__PURE__ */ m(V, { children: [
|
|
517
|
-
/* @__PURE__ */ a(
|
|
517
|
+
/* @__PURE__ */ a(Do, { children: /* @__PURE__ */ a(wo, { children: /* @__PURE__ */ a(y, { direction: "column", gap: "16px", padding: "6px", children: S ? /* @__PURE__ */ m(
|
|
518
518
|
y,
|
|
519
519
|
{
|
|
520
520
|
direction: "column",
|
|
@@ -584,13 +584,13 @@ const Cn = E.div`
|
|
|
584
584
|
}
|
|
585
585
|
) }) }) }),
|
|
586
586
|
d && /* @__PURE__ */ a(
|
|
587
|
-
|
|
587
|
+
Cn,
|
|
588
588
|
{
|
|
589
589
|
portalId: "modal-portal",
|
|
590
590
|
onCloseModal: c,
|
|
591
591
|
title: l ? "Editar Decisión" : "Nueva decisión",
|
|
592
592
|
children: /* @__PURE__ */ a(
|
|
593
|
-
|
|
593
|
+
Li,
|
|
594
594
|
{
|
|
595
595
|
decision: l || s,
|
|
596
596
|
onSubmitEvent: h,
|
|
@@ -602,12 +602,12 @@ const Cn = E.div`
|
|
|
602
602
|
}
|
|
603
603
|
)
|
|
604
604
|
] });
|
|
605
|
-
},
|
|
605
|
+
}, Ao = E.div`
|
|
606
606
|
position: relative;
|
|
607
607
|
& > div {
|
|
608
608
|
padding: 24px 16px;
|
|
609
609
|
}
|
|
610
|
-
`,
|
|
610
|
+
`, Io = E.div`
|
|
611
611
|
background-color: ${({ theme: e }) => {
|
|
612
612
|
var t, n;
|
|
613
613
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || I.palette.neutral.N0;
|
|
@@ -638,7 +638,7 @@ const Cn = E.div`
|
|
|
638
638
|
background-color: #ebecf0;
|
|
639
639
|
border-radius: 8px;
|
|
640
640
|
}
|
|
641
|
-
`,
|
|
641
|
+
`, $o = (e) => {
|
|
642
642
|
const { children: t, portalId: n, onCloseModal: o, title: r } = e, i = document.getElementById(n);
|
|
643
643
|
if (!i)
|
|
644
644
|
throw new Error(
|
|
@@ -646,7 +646,7 @@ const Cn = E.div`
|
|
|
646
646
|
);
|
|
647
647
|
const s = ue("(max-width: 400px)");
|
|
648
648
|
return Yt(
|
|
649
|
-
/* @__PURE__ */ a(
|
|
649
|
+
/* @__PURE__ */ a(Ao, { $smallScreen: s, children: /* @__PURE__ */ a(Bt, { children: /* @__PURE__ */ a(Io, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "24px", children: [
|
|
650
650
|
/* @__PURE__ */ a(y, { direction: "column", gap: "24px", children: /* @__PURE__ */ m(y, { alignItems: "center", justifyContent: "space-between", children: [
|
|
651
651
|
/* @__PURE__ */ a(F, { type: "title", size: "large", appearance: "dark", weight: "bold", children: r }),
|
|
652
652
|
/* @__PURE__ */ a(Gt, { size: "24px", cursor: "pointer", onClick: o })
|
|
@@ -655,7 +655,7 @@ const Cn = E.div`
|
|
|
655
655
|
] }) }) }) }),
|
|
656
656
|
i
|
|
657
657
|
);
|
|
658
|
-
},
|
|
658
|
+
}, Fo = Wt`
|
|
659
659
|
from {
|
|
660
660
|
opacity: 0;
|
|
661
661
|
transform: translateY(20px);
|
|
@@ -707,15 +707,15 @@ E.div`
|
|
|
707
707
|
width: 100%;
|
|
708
708
|
height: 100%;
|
|
709
709
|
& > div {
|
|
710
|
-
animation: ${
|
|
710
|
+
animation: ${Fo} 600ms ease-out;
|
|
711
711
|
}
|
|
712
712
|
`;
|
|
713
|
-
const
|
|
713
|
+
const Ro = E.div`
|
|
714
714
|
& > div > div {
|
|
715
715
|
border-radius: 8px;
|
|
716
716
|
box-sizing: border-box;
|
|
717
717
|
}
|
|
718
|
-
`,
|
|
718
|
+
`, Lo = E.div`
|
|
719
719
|
& > div {
|
|
720
720
|
width: 100%;
|
|
721
721
|
height: 100%;
|
|
@@ -735,7 +735,7 @@ const Fo = E.div`
|
|
|
735
735
|
border-radius: 8px;
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
|
-
`,
|
|
738
|
+
`, Oo = (e) => {
|
|
739
739
|
const { index: t, handleOpenModal: n } = e;
|
|
740
740
|
return /* @__PURE__ */ a(
|
|
741
741
|
Xe,
|
|
@@ -749,18 +749,18 @@ const Fo = E.div`
|
|
|
749
749
|
},
|
|
750
750
|
`loading-card-${t}`
|
|
751
751
|
);
|
|
752
|
-
},
|
|
752
|
+
}, Mo = (e) => e.value, Po = (e) => e.value, _o = (e) => e.value, Vo = (e) => ({
|
|
753
753
|
from: e.from ?? "",
|
|
754
754
|
to: e.to ?? ""
|
|
755
|
-
}),
|
|
756
|
-
[k.LIST_OF_VALUES]:
|
|
755
|
+
}), jo = (e) => e.value, Uo = (e) => e.value, zo = (e) => e.value, Ho = {
|
|
756
|
+
[k.LIST_OF_VALUES]: Po,
|
|
757
757
|
[k.LIST_OF_VALUES_MULTI]: _o,
|
|
758
|
-
[k.RANGE]:
|
|
759
|
-
[k.GREATER_THAN]:
|
|
760
|
-
[k.LESS_THAN]:
|
|
761
|
-
[k.EQUAL]:
|
|
758
|
+
[k.RANGE]: Vo,
|
|
759
|
+
[k.GREATER_THAN]: jo,
|
|
760
|
+
[k.LESS_THAN]: Uo,
|
|
761
|
+
[k.EQUAL]: zo
|
|
762
762
|
}, ze = (e) => {
|
|
763
|
-
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), o =
|
|
763
|
+
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), o = Ho[e == null ? void 0 : e.howToSetTheDecision] || Mo;
|
|
764
764
|
return n && o(t) || t || void 0;
|
|
765
765
|
}, on = E.div`
|
|
766
766
|
& > div {
|
|
@@ -789,7 +789,7 @@ const Fo = E.div`
|
|
|
789
789
|
background-color: #ebecf0;
|
|
790
790
|
border-radius: 8px;
|
|
791
791
|
}
|
|
792
|
-
`,
|
|
792
|
+
`, Go = (e) => {
|
|
793
793
|
const {
|
|
794
794
|
conditionsAlignment: t,
|
|
795
795
|
decision: n,
|
|
@@ -803,7 +803,7 @@ const Fo = E.div`
|
|
|
803
803
|
} = e;
|
|
804
804
|
return i ? /* @__PURE__ */ m(y, { direction: "column", gap: "12px", children: [
|
|
805
805
|
/* @__PURE__ */ a(y, { direction: "column", alignItems: "center", children: /* @__PURE__ */ a(
|
|
806
|
-
|
|
806
|
+
Ne,
|
|
807
807
|
{
|
|
808
808
|
element: r,
|
|
809
809
|
valueData: ze(
|
|
@@ -833,7 +833,7 @@ const Fo = E.div`
|
|
|
833
833
|
}
|
|
834
834
|
),
|
|
835
835
|
u.length > 0 && u.map((p) => /* @__PURE__ */ a(on, { children: /* @__PURE__ */ a(y, { direction: "column", padding: "8px", children: /* @__PURE__ */ a(
|
|
836
|
-
|
|
836
|
+
Ne,
|
|
837
837
|
{
|
|
838
838
|
element: { ...p, value: p.value },
|
|
839
839
|
valueData: ze(
|
|
@@ -843,7 +843,7 @@ const Fo = E.div`
|
|
|
843
843
|
) }) }, p.conditionName)),
|
|
844
844
|
u.length > 0 && /* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
845
845
|
d && /* @__PURE__ */ a(V, { children: o && /* @__PURE__ */ a(
|
|
846
|
-
|
|
846
|
+
Ne,
|
|
847
847
|
{
|
|
848
848
|
element: o.element,
|
|
849
849
|
valueData: o.valueData,
|
|
@@ -886,10 +886,10 @@ const Fo = E.div`
|
|
|
886
886
|
}
|
|
887
887
|
) })
|
|
888
888
|
] });
|
|
889
|
-
},
|
|
889
|
+
}, Bo = (e) => Array.isArray(e) ? e[0] : e ?? null, qo = (e) => {
|
|
890
890
|
var t;
|
|
891
|
-
return ((t =
|
|
892
|
-
},
|
|
891
|
+
return ((t = Bo(e == null ? void 0 : e.conditionGroups)) == null ? void 0 : t.conditionsThatEstablishesTheDecision) ?? [];
|
|
892
|
+
}, Wo = (e) => {
|
|
893
893
|
const { decision: t, loading: n = !1, textValues: o } = e, r = !!(t != null && t.effectiveFrom), i = !!(t != null && t.validUntil), s = r && i ? {
|
|
894
894
|
element: {
|
|
895
895
|
labelName: o == null ? void 0 : o.terms,
|
|
@@ -924,9 +924,9 @@ const Fo = E.div`
|
|
|
924
924
|
decisionDataType: t.decisionDataType || "alphabetical",
|
|
925
925
|
value: ze(t),
|
|
926
926
|
howToSetTheDecision: t.howToSetTheDecision || "EqualTo"
|
|
927
|
-
} : null, l =
|
|
927
|
+
} : null, l = qo(t).filter((h) => !(h != null && h.hidden)), u = Array.from({ length: 5 }), p = !!(!n && t && o && d), c = l.length < 2 ? "start" : "space-between";
|
|
928
928
|
return /* @__PURE__ */ a(
|
|
929
|
-
|
|
929
|
+
Go,
|
|
930
930
|
{
|
|
931
931
|
conditionsAlignment: c,
|
|
932
932
|
decision: t,
|
|
@@ -939,7 +939,7 @@ const Fo = E.div`
|
|
|
939
939
|
visibleConditions: l
|
|
940
940
|
}
|
|
941
941
|
);
|
|
942
|
-
},
|
|
942
|
+
}, Yo = E.div`
|
|
943
943
|
border-radius: 8px;
|
|
944
944
|
border: 1px solid
|
|
945
945
|
${({ theme: e }) => {
|
|
@@ -974,9 +974,9 @@ E.div`
|
|
|
974
974
|
border-radius: 8px;
|
|
975
975
|
}
|
|
976
976
|
`;
|
|
977
|
-
const
|
|
977
|
+
const Xo = (e) => {
|
|
978
978
|
const { children: t, controls: n = !0, handleDelete: o, id: r } = e;
|
|
979
|
-
return /* @__PURE__ */ a(
|
|
979
|
+
return /* @__PURE__ */ a(Yo, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
980
980
|
t,
|
|
981
981
|
n && /* @__PURE__ */ m(V, { children: [
|
|
982
982
|
/* @__PURE__ */ a(Y, {}),
|
|
@@ -994,19 +994,19 @@ const Yo = (e) => {
|
|
|
994
994
|
) })
|
|
995
995
|
] })
|
|
996
996
|
] }) });
|
|
997
|
-
},
|
|
997
|
+
}, Qo = (e) => {
|
|
998
998
|
const { decision: t, controls: n, handleOpenModal: o, handleDelete: r, textValues: i } = e;
|
|
999
999
|
return t ? /* @__PURE__ */ a(Qe, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
|
|
1000
1000
|
/* @__PURE__ */ a(F, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
|
|
1001
1001
|
/* @__PURE__ */ a(
|
|
1002
|
-
|
|
1002
|
+
Xo,
|
|
1003
1003
|
{
|
|
1004
1004
|
id: t.decisionId,
|
|
1005
1005
|
handleDelete: () => r ? r(t.decisionId) : null,
|
|
1006
1006
|
handleView: () => o ? o(t) : null,
|
|
1007
1007
|
controls: n,
|
|
1008
1008
|
children: /* @__PURE__ */ a(
|
|
1009
|
-
|
|
1009
|
+
Wo,
|
|
1010
1010
|
{
|
|
1011
1011
|
decision: t,
|
|
1012
1012
|
textValues: i
|
|
@@ -1015,7 +1015,7 @@ const Yo = (e) => {
|
|
|
1015
1015
|
}
|
|
1016
1016
|
)
|
|
1017
1017
|
] }) }, t.decisionId) : null;
|
|
1018
|
-
},
|
|
1018
|
+
}, Jo = (e) => {
|
|
1019
1019
|
const {
|
|
1020
1020
|
customTitleContentAddCard: t,
|
|
1021
1021
|
index: n,
|
|
@@ -1025,7 +1025,7 @@ const Yo = (e) => {
|
|
|
1025
1025
|
return /* @__PURE__ */ a(Qe, { children: r ? null : /* @__PURE__ */ m(y, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
|
|
1026
1026
|
/* @__PURE__ */ a(F, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
|
|
1027
1027
|
/* @__PURE__ */ a(
|
|
1028
|
-
|
|
1028
|
+
Sn,
|
|
1029
1029
|
{
|
|
1030
1030
|
onClick: () => o ? o() : null,
|
|
1031
1031
|
children: /* @__PURE__ */ a(
|
|
@@ -1045,22 +1045,22 @@ const Yo = (e) => {
|
|
|
1045
1045
|
}
|
|
1046
1046
|
)
|
|
1047
1047
|
] }) }, `add-decision-${n}`);
|
|
1048
|
-
},
|
|
1049
|
-
loading:
|
|
1050
|
-
decision:
|
|
1051
|
-
add:
|
|
1048
|
+
}, Zo = {
|
|
1049
|
+
loading: Oo,
|
|
1050
|
+
decision: Qo,
|
|
1051
|
+
add: Jo
|
|
1052
1052
|
}, Mt = (e) => {
|
|
1053
|
-
const { type: t } = e, n =
|
|
1053
|
+
const { type: t } = e, n = Zo[t];
|
|
1054
1054
|
return n ? n(e) : null;
|
|
1055
|
-
},
|
|
1056
|
-
schema:
|
|
1055
|
+
}, Ko = (e) => ({
|
|
1056
|
+
schema: ge().required("Requerido").test(
|
|
1057
1057
|
"non-empty",
|
|
1058
1058
|
"El valor no puede estar vacío",
|
|
1059
1059
|
(t) => t != null && t.trim() !== ""
|
|
1060
1060
|
),
|
|
1061
1061
|
value: e
|
|
1062
|
-
}),
|
|
1063
|
-
schema:
|
|
1062
|
+
}), er = (e) => ({
|
|
1063
|
+
schema: ve().test(
|
|
1064
1064
|
"isArrayOrString",
|
|
1065
1065
|
"Debe ser un array de strings/numbers o un solo string",
|
|
1066
1066
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -1068,8 +1068,8 @@ const Yo = (e) => {
|
|
|
1068
1068
|
) : typeof t == "string"
|
|
1069
1069
|
),
|
|
1070
1070
|
value: e
|
|
1071
|
-
}),
|
|
1072
|
-
schema:
|
|
1071
|
+
}), tr = (e) => ({
|
|
1072
|
+
schema: ve().test(
|
|
1073
1073
|
"isArrayOrString",
|
|
1074
1074
|
"Debe ser un array de strings/numbers o un solo string ",
|
|
1075
1075
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -1077,12 +1077,12 @@ const Yo = (e) => {
|
|
|
1077
1077
|
) : typeof t == "string"
|
|
1078
1078
|
),
|
|
1079
1079
|
value: e
|
|
1080
|
-
}),
|
|
1080
|
+
}), nr = (e) => {
|
|
1081
1081
|
const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
|
|
1082
1082
|
return {
|
|
1083
1083
|
schema: te({
|
|
1084
|
-
from:
|
|
1085
|
-
to:
|
|
1084
|
+
from: pe().required("El campo 'Rango desde' es requerido").max(n, "'Rango desde' no puede ser mayor que 'Rango hasta'").min(0, "'Rango desde' no puede ser menor que 0"),
|
|
1085
|
+
to: pe().min(0, "El campo 'Rango hasta' debe ser mayor o igual a 0").required("El campo 'Rango hasta' es requerido").test(
|
|
1086
1086
|
"is-greater",
|
|
1087
1087
|
"El campo 'Rango hasta' debe ser mayor que 'Rango desde'",
|
|
1088
1088
|
function(o) {
|
|
@@ -1094,21 +1094,21 @@ const Yo = (e) => {
|
|
|
1094
1094
|
value: { from: t, to: n }
|
|
1095
1095
|
};
|
|
1096
1096
|
}, At = (e, t) => t === H.PERCENTAGE ? {
|
|
1097
|
-
schema:
|
|
1097
|
+
schema: pe().required("El campo tipo porcentaje es requerido").min(0, "El campo tipo porcentaje no puede ser menor que 0").max(100, "El campo tipo porcentaje no puede ser mayor que 100"),
|
|
1098
1098
|
value: e
|
|
1099
1099
|
} : {
|
|
1100
|
-
schema:
|
|
1100
|
+
schema: ge().required("Requerido"),
|
|
1101
1101
|
value: e
|
|
1102
|
-
},
|
|
1103
|
-
[k.LIST_OF_VALUES]:
|
|
1104
|
-
[k.LIST_OF_VALUES_MULTI]:
|
|
1105
|
-
[k.RANGE]:
|
|
1102
|
+
}, or = {
|
|
1103
|
+
[k.LIST_OF_VALUES]: er,
|
|
1104
|
+
[k.LIST_OF_VALUES_MULTI]: tr,
|
|
1105
|
+
[k.RANGE]: nr,
|
|
1106
1106
|
[k.GREATER_THAN]: At,
|
|
1107
1107
|
[k.LESS_THAN]: At,
|
|
1108
1108
|
[k.EQUAL]: At
|
|
1109
|
-
},
|
|
1109
|
+
}, rr = (e) => or[e] || Ko;
|
|
1110
1110
|
var Jt = /* @__PURE__ */ ((e) => (e.EQUAL = "EqualTo", e.GREATER_THAN = "GreaterThan", e.LESS_THAN = "LessThan", e.LIST_OF_VALUES = "ListOfValues", e.LIST_OF_VALUES_MULTI = "ListOfValuesMulti", e.RANGE = "Range", e))(Jt || {});
|
|
1111
|
-
const dt = (e) => e != null && (typeof e != "string" || e.trim() !== "") && (!Array.isArray(e) || e.length > 0),
|
|
1111
|
+
const dt = (e) => e != null && (typeof e != "string" || e.trim() !== "") && (!Array.isArray(e) || e.length > 0), ir = (e, t) => {
|
|
1112
1112
|
var d;
|
|
1113
1113
|
const n = Object.entries((e == null ? void 0 : e.conditionsThatEstablishesTheDecision) ?? {}).filter(([, l]) => dt(l)).map(([l, u]) => ({ conditionName: l, value: u }));
|
|
1114
1114
|
let o = [];
|
|
@@ -1127,7 +1127,7 @@ const dt = (e) => e != null && (typeof e != "string" || e.trim() !== "") && (!Ar
|
|
|
1127
1127
|
};
|
|
1128
1128
|
});
|
|
1129
1129
|
};
|
|
1130
|
-
function
|
|
1130
|
+
function ar({
|
|
1131
1131
|
decision: e,
|
|
1132
1132
|
onSubmitEvent: t,
|
|
1133
1133
|
textValues: n
|
|
@@ -1151,8 +1151,8 @@ function ir({
|
|
|
1151
1151
|
};
|
|
1152
1152
|
let d;
|
|
1153
1153
|
const l = {
|
|
1154
|
-
ruleName:
|
|
1155
|
-
value: Ge(() =>
|
|
1154
|
+
ruleName: ge().required("El nombre de la regla es requerido"),
|
|
1155
|
+
value: Ge(() => rr(
|
|
1156
1156
|
d.values.howToSetTheDecision
|
|
1157
1157
|
)(
|
|
1158
1158
|
d.values.value,
|
|
@@ -1160,7 +1160,7 @@ function ir({
|
|
|
1160
1160
|
).schema),
|
|
1161
1161
|
conditionsThatEstablishesTheDecision: te().shape({})
|
|
1162
1162
|
};
|
|
1163
|
-
n.terms && (l.effectiveFrom =
|
|
1163
|
+
n.terms && (l.effectiveFrom = Ie().required("La fecha de inicio es requerida"), l.validUntil = Ie().when(
|
|
1164
1164
|
"checkClosed",
|
|
1165
1165
|
(g, f, { parent: v }) => (v == null ? void 0 : v.checkClosed) ? f.required("La fecha de finalización es requerida").test(
|
|
1166
1166
|
"is-after-startDate",
|
|
@@ -1178,7 +1178,7 @@ function ir({
|
|
|
1178
1178
|
validateOnBlur: !0,
|
|
1179
1179
|
onSubmit: (g) => {
|
|
1180
1180
|
var w;
|
|
1181
|
-
const f = ((w = e.conditionGroups) == null ? void 0 : w.ConditionGroupId) ?? "group-primary", v = g.toggleNone ? [] :
|
|
1181
|
+
const f = ((w = e.conditionGroups) == null ? void 0 : w.ConditionGroupId) ?? "group-primary", v = g.toggleNone ? [] : ir(g, o), T = {
|
|
1182
1182
|
...e,
|
|
1183
1183
|
ruleName: g.ruleName,
|
|
1184
1184
|
decisionDataType: g.decisionDataType,
|
|
@@ -1210,7 +1210,7 @@ function ir({
|
|
|
1210
1210
|
});
|
|
1211
1211
|
} };
|
|
1212
1212
|
}
|
|
1213
|
-
const
|
|
1213
|
+
const lr = E.div`
|
|
1214
1214
|
& > div {
|
|
1215
1215
|
border-radius: 8px;
|
|
1216
1216
|
border: 1px solid
|
|
@@ -1219,7 +1219,7 @@ const ar = E.div`
|
|
|
1219
1219
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || I.palette.neutral.N30;
|
|
1220
1220
|
}};
|
|
1221
1221
|
}
|
|
1222
|
-
`,
|
|
1222
|
+
`, sr = E.div`
|
|
1223
1223
|
width: 100%;
|
|
1224
1224
|
height: 100%;
|
|
1225
1225
|
overflow-y: auto;
|
|
@@ -1236,7 +1236,7 @@ const ar = E.div`
|
|
|
1236
1236
|
background-color: #ebecf0;
|
|
1237
1237
|
border-radius: 8px;
|
|
1238
1238
|
}
|
|
1239
|
-
`,
|
|
1239
|
+
`, dr = (e) => {
|
|
1240
1240
|
const {
|
|
1241
1241
|
checked: t,
|
|
1242
1242
|
children: n,
|
|
@@ -1263,7 +1263,7 @@ const ar = E.div`
|
|
|
1263
1263
|
) }),
|
|
1264
1264
|
l && /* @__PURE__ */ a(V, { children: n })
|
|
1265
1265
|
] });
|
|
1266
|
-
},
|
|
1266
|
+
}, cr = (e) => {
|
|
1267
1267
|
const {
|
|
1268
1268
|
onHandleStartChange: t,
|
|
1269
1269
|
onHandleEndChange: n,
|
|
@@ -1325,7 +1325,7 @@ const ar = E.div`
|
|
|
1325
1325
|
gap: "24px",
|
|
1326
1326
|
children: [
|
|
1327
1327
|
/* @__PURE__ */ a(
|
|
1328
|
-
|
|
1328
|
+
Ae,
|
|
1329
1329
|
{
|
|
1330
1330
|
id: "dateStart",
|
|
1331
1331
|
label: r,
|
|
@@ -1338,7 +1338,7 @@ const ar = E.div`
|
|
|
1338
1338
|
}
|
|
1339
1339
|
),
|
|
1340
1340
|
f && /* @__PURE__ */ a(
|
|
1341
|
-
|
|
1341
|
+
Ae,
|
|
1342
1342
|
{
|
|
1343
1343
|
id: "dateEnd",
|
|
1344
1344
|
label: i,
|
|
@@ -1354,7 +1354,7 @@ const ar = E.div`
|
|
|
1354
1354
|
}
|
|
1355
1355
|
)
|
|
1356
1356
|
] });
|
|
1357
|
-
},
|
|
1357
|
+
}, ur = (e) => {
|
|
1358
1358
|
const {
|
|
1359
1359
|
formik: t,
|
|
1360
1360
|
textValues: n,
|
|
@@ -1374,7 +1374,7 @@ const ar = E.div`
|
|
|
1374
1374
|
isDecision: !0
|
|
1375
1375
|
}),
|
|
1376
1376
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
1377
|
-
/* @__PURE__ */ a(
|
|
1377
|
+
/* @__PURE__ */ a(lr, { children: /* @__PURE__ */ a(sr, { children: /* @__PURE__ */ m(
|
|
1378
1378
|
y,
|
|
1379
1379
|
{
|
|
1380
1380
|
direction: "column",
|
|
@@ -1406,7 +1406,7 @@ const ar = E.div`
|
|
|
1406
1406
|
/* @__PURE__ */ a(y, { direction: "column", gap: "20px", children: r == null ? void 0 : r.map((c) => {
|
|
1407
1407
|
var h;
|
|
1408
1408
|
return /* @__PURE__ */ a(
|
|
1409
|
-
|
|
1409
|
+
dr,
|
|
1410
1410
|
{
|
|
1411
1411
|
id: `toggle-${c.conditionName}`,
|
|
1412
1412
|
name: `toggle.${c.conditionName}`,
|
|
@@ -1427,7 +1427,7 @@ const ar = E.div`
|
|
|
1427
1427
|
n.terms && /* @__PURE__ */ m(V, { children: [
|
|
1428
1428
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
1429
1429
|
/* @__PURE__ */ a(
|
|
1430
|
-
|
|
1430
|
+
cr,
|
|
1431
1431
|
{
|
|
1432
1432
|
labelStart: n.termStart,
|
|
1433
1433
|
labelEnd: n.termEnd,
|
|
@@ -1453,9 +1453,9 @@ const ar = E.div`
|
|
|
1453
1453
|
/* @__PURE__ */ a(Q, { type: "submit", children: n.confirm })
|
|
1454
1454
|
] })
|
|
1455
1455
|
] }) });
|
|
1456
|
-
},
|
|
1456
|
+
}, pr = (e) => {
|
|
1457
1457
|
var g, f;
|
|
1458
|
-
const { decision: t, onSubmitEvent: n, textValues: o, onCancel: r } = e, { formik: i, handleToggleNoneChange: s } =
|
|
1458
|
+
const { decision: t, onSubmitEvent: n, textValues: o, onCancel: r } = e, { formik: i, handleToggleNoneChange: s } = ar({
|
|
1459
1459
|
decision: t,
|
|
1460
1460
|
onSubmitEvent: n,
|
|
1461
1461
|
textValues: o
|
|
@@ -1469,7 +1469,7 @@ const ar = E.div`
|
|
|
1469
1469
|
(v) => !v.hidden
|
|
1470
1470
|
)) || [], u = !!i.errors.conditionsThatEstablishesTheDecision && i.submitCount > 0, p = i.touched.effectiveFrom ? i.errors.effectiveFrom ? "invalid" : "valid" : void 0, c = i.touched.validUntil ? i.errors.validUntil ? "invalid" : "valid" : void 0;
|
|
1471
1471
|
return /* @__PURE__ */ a(
|
|
1472
|
-
|
|
1472
|
+
ur,
|
|
1473
1473
|
{
|
|
1474
1474
|
formik: i,
|
|
1475
1475
|
onCancel: r,
|
|
@@ -1501,7 +1501,7 @@ const ar = E.div`
|
|
|
1501
1501
|
termEndStatus: c
|
|
1502
1502
|
}
|
|
1503
1503
|
);
|
|
1504
|
-
},
|
|
1504
|
+
}, hr = (e) => {
|
|
1505
1505
|
const {
|
|
1506
1506
|
controls: t,
|
|
1507
1507
|
customTitleContentAddCard: n,
|
|
@@ -1534,7 +1534,7 @@ const ar = E.div`
|
|
|
1534
1534
|
})
|
|
1535
1535
|
), u = ((o == null ? void 0 : o.length) === 0 || o.length < Math.floor(window.innerWidth / 300)) && !r && t;
|
|
1536
1536
|
return { renderedCards: l, shouldRenderAddCard: u };
|
|
1537
|
-
},
|
|
1537
|
+
}, bl = (e) => {
|
|
1538
1538
|
const {
|
|
1539
1539
|
controls: t = !0,
|
|
1540
1540
|
customTitleContentAddCard: n,
|
|
@@ -1550,7 +1550,7 @@ const ar = E.div`
|
|
|
1550
1550
|
handleSubmitForm: h,
|
|
1551
1551
|
handleDelete: g,
|
|
1552
1552
|
terms: f = !0
|
|
1553
|
-
} = e, v = ue("(max-width: 681px)"), T = ue("(max-width: 400px)"), { renderedCards: w, shouldRenderAddCard: D } =
|
|
1553
|
+
} = e, v = ue("(max-width: 681px)"), T = ue("(max-width: 400px)"), { renderedCards: w, shouldRenderAddCard: D } = hr({
|
|
1554
1554
|
controls: t,
|
|
1555
1555
|
customTitleContentAddCard: n,
|
|
1556
1556
|
decisions: r,
|
|
@@ -1560,7 +1560,7 @@ const ar = E.div`
|
|
|
1560
1560
|
textValues: i
|
|
1561
1561
|
}), S = (r == null ? void 0 : r.length) === 0 && !u;
|
|
1562
1562
|
return /* @__PURE__ */ m(V, { children: [
|
|
1563
|
-
/* @__PURE__ */ a(
|
|
1563
|
+
/* @__PURE__ */ a(Ro, { children: /* @__PURE__ */ a(Lo, { children: /* @__PURE__ */ a(y, { direction: "column", gap: "16px", padding: "6px", children: S ? /* @__PURE__ */ m(
|
|
1564
1564
|
y,
|
|
1565
1565
|
{
|
|
1566
1566
|
direction: "column",
|
|
@@ -1630,13 +1630,13 @@ const ar = E.div`
|
|
|
1630
1630
|
}
|
|
1631
1631
|
) }) }) }),
|
|
1632
1632
|
d && /* @__PURE__ */ a(
|
|
1633
|
-
|
|
1633
|
+
$o,
|
|
1634
1634
|
{
|
|
1635
1635
|
portalId: "modal-portal",
|
|
1636
1636
|
onCloseModal: c,
|
|
1637
1637
|
title: l ? "Editar Decisión" : "Nueva decisión",
|
|
1638
1638
|
children: /* @__PURE__ */ a(
|
|
1639
|
-
|
|
1639
|
+
pr,
|
|
1640
1640
|
{
|
|
1641
1641
|
decision: l || s,
|
|
1642
1642
|
onSubmitEvent: h,
|
|
@@ -1648,19 +1648,19 @@ const ar = E.div`
|
|
|
1648
1648
|
}
|
|
1649
1649
|
)
|
|
1650
1650
|
] });
|
|
1651
|
-
},
|
|
1651
|
+
}, En = (e) => {
|
|
1652
1652
|
const { children: t } = e;
|
|
1653
|
-
return /* @__PURE__ */ a(
|
|
1654
|
-
},
|
|
1653
|
+
return /* @__PURE__ */ a(Kn, { width: "100%", children: t });
|
|
1654
|
+
}, gr = (e) => e.value, fr = (e) => e.value, mr = (e) => e.value, br = (e) => ({
|
|
1655
1655
|
from: e.from ?? "",
|
|
1656
1656
|
to: e.to ?? ""
|
|
1657
|
-
}),
|
|
1658
|
-
[k.LIST_OF_VALUES]:
|
|
1659
|
-
[k.LIST_OF_VALUES_MULTI]:
|
|
1660
|
-
[k.RANGE]:
|
|
1661
|
-
[k.GREATER_THAN]:
|
|
1662
|
-
[k.LESS_THAN]:
|
|
1663
|
-
[k.EQUAL]:
|
|
1657
|
+
}), vr = (e) => e.value, yr = (e) => e.value, Tr = (e) => e.value, xr = {
|
|
1658
|
+
[k.LIST_OF_VALUES]: fr,
|
|
1659
|
+
[k.LIST_OF_VALUES_MULTI]: mr,
|
|
1660
|
+
[k.RANGE]: br,
|
|
1661
|
+
[k.GREATER_THAN]: vr,
|
|
1662
|
+
[k.LESS_THAN]: yr,
|
|
1663
|
+
[k.EQUAL]: Tr
|
|
1664
1664
|
}, He = (e) => {
|
|
1665
1665
|
const t = e == null ? void 0 : e.value;
|
|
1666
1666
|
if (typeof t == "string" && t.includes(" a ")) {
|
|
@@ -1678,8 +1678,8 @@ const ar = E.div`
|
|
|
1678
1678
|
}
|
|
1679
1679
|
return t;
|
|
1680
1680
|
}
|
|
1681
|
-
return typeof t == "object" && t !== null && !Array.isArray(t) ? "from" in t && "to" in t ? t : (
|
|
1682
|
-
},
|
|
1681
|
+
return typeof t == "object" && t !== null && !Array.isArray(t) ? "from" in t && "to" in t ? t : (xr[e == null ? void 0 : e.howToSetTheDecision] || gr)(t) : t || void 0;
|
|
1682
|
+
}, Dr = E.div`
|
|
1683
1683
|
display: flex;
|
|
1684
1684
|
justify-content: ${({ $justifyContent: e }) => e};
|
|
1685
1685
|
align-items: ${({ $alignItems: e }) => e};
|
|
@@ -1702,7 +1702,7 @@ const ar = E.div`
|
|
|
1702
1702
|
border-radius: ${({ $borderRadius: e }) => e};
|
|
1703
1703
|
box-sizing: ${({ $boxSizing: e }) => e};
|
|
1704
1704
|
overflow-y: ${({ $scroll: e }) => e ? "scroll" : "none"};
|
|
1705
|
-
`, ce =
|
|
1705
|
+
`, ce = _.forwardRef(
|
|
1706
1706
|
(e, t) => {
|
|
1707
1707
|
const {
|
|
1708
1708
|
children: n,
|
|
@@ -1723,7 +1723,7 @@ const ar = E.div`
|
|
|
1723
1723
|
scroll: w = !1
|
|
1724
1724
|
} = e;
|
|
1725
1725
|
return /* @__PURE__ */ a(
|
|
1726
|
-
|
|
1726
|
+
Dr,
|
|
1727
1727
|
{
|
|
1728
1728
|
ref: t,
|
|
1729
1729
|
direction: r,
|
|
@@ -1776,20 +1776,20 @@ E.div`
|
|
|
1776
1776
|
border-radius: 8px;
|
|
1777
1777
|
}
|
|
1778
1778
|
`;
|
|
1779
|
-
const
|
|
1779
|
+
const wr = E.div`
|
|
1780
1780
|
cursor: pointer;
|
|
1781
|
-
`,
|
|
1781
|
+
`, Cr = E.div`
|
|
1782
1782
|
& > div > div > div > p {
|
|
1783
1783
|
text-wrap-mode: nowrap;
|
|
1784
1784
|
}
|
|
1785
|
-
`,
|
|
1785
|
+
`, Sr = E.div`
|
|
1786
1786
|
& > div {
|
|
1787
1787
|
justify-content: auto;
|
|
1788
1788
|
gap: 8px;
|
|
1789
1789
|
}
|
|
1790
1790
|
`;
|
|
1791
1791
|
var de = /* @__PURE__ */ ((e) => (e.EQUAL = "EqualTo", e.GREATER_THAN = "GreaterThan", e.LESS_THAN = "LessThan", e.LIST_OF_VALUES = "ListOfValues", e.LIST_OF_VALUES_MULTI = "ListOfValuesMulti", e.RANGE = "Range", e))(de || {});
|
|
1792
|
-
const
|
|
1792
|
+
const Er = (e) => {
|
|
1793
1793
|
const {
|
|
1794
1794
|
controls: t,
|
|
1795
1795
|
conditionsAlignment: n,
|
|
@@ -1813,15 +1813,15 @@ const Sr = (e) => {
|
|
|
1813
1813
|
hasMultipleGroups: N
|
|
1814
1814
|
} = e;
|
|
1815
1815
|
return i ? /* @__PURE__ */ m(y, { direction: "column", gap: "16px", children: [
|
|
1816
|
-
/* @__PURE__ */ a(
|
|
1816
|
+
/* @__PURE__ */ a(wr, { onClick: u, children: /* @__PURE__ */ m(
|
|
1817
1817
|
y,
|
|
1818
1818
|
{
|
|
1819
1819
|
alignItems: "start",
|
|
1820
1820
|
justifyContent: "space-between",
|
|
1821
1821
|
children: [
|
|
1822
1822
|
/* @__PURE__ */ m(y, { gap: "12px", children: [
|
|
1823
|
-
/* @__PURE__ */ a(
|
|
1824
|
-
|
|
1823
|
+
/* @__PURE__ */ a(Cr, { children: /* @__PURE__ */ a(
|
|
1824
|
+
_e,
|
|
1825
1825
|
{
|
|
1826
1826
|
id: "tag",
|
|
1827
1827
|
appearance: "gray",
|
|
@@ -1829,7 +1829,7 @@ const Sr = (e) => {
|
|
|
1829
1829
|
displayIcon: !1
|
|
1830
1830
|
}
|
|
1831
1831
|
) }),
|
|
1832
|
-
/* @__PURE__ */ a(
|
|
1832
|
+
/* @__PURE__ */ a(Sr, { children: /* @__PURE__ */ a(
|
|
1833
1833
|
it,
|
|
1834
1834
|
{
|
|
1835
1835
|
element: r,
|
|
@@ -1846,7 +1846,7 @@ const Sr = (e) => {
|
|
|
1846
1846
|
G,
|
|
1847
1847
|
{
|
|
1848
1848
|
appearance: "primary",
|
|
1849
|
-
icon: /* @__PURE__ */ a(
|
|
1849
|
+
icon: /* @__PURE__ */ a(Hn, {}),
|
|
1850
1850
|
size: "24px",
|
|
1851
1851
|
cursorHover: !0,
|
|
1852
1852
|
onClick: (C) => {
|
|
@@ -1871,7 +1871,7 @@ const Sr = (e) => {
|
|
|
1871
1871
|
G,
|
|
1872
1872
|
{
|
|
1873
1873
|
appearance: "dark",
|
|
1874
|
-
icon: l ? /* @__PURE__ */ a(
|
|
1874
|
+
icon: l ? /* @__PURE__ */ a(Gn, {}) : /* @__PURE__ */ a(Lt, {}),
|
|
1875
1875
|
size: "24px",
|
|
1876
1876
|
cursorHover: !0
|
|
1877
1877
|
}
|
|
@@ -1884,7 +1884,7 @@ const Sr = (e) => {
|
|
|
1884
1884
|
l && /* @__PURE__ */ m(V, { children: [
|
|
1885
1885
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
1886
1886
|
N ? /* @__PURE__ */ a(
|
|
1887
|
-
|
|
1887
|
+
Dn,
|
|
1888
1888
|
{
|
|
1889
1889
|
tabs: T,
|
|
1890
1890
|
selectedTab: w,
|
|
@@ -1977,7 +1977,7 @@ const Sr = (e) => {
|
|
|
1977
1977
|
] }),
|
|
1978
1978
|
/* @__PURE__ */ m(y, { alignItems: "center", gap: "8px", children: [
|
|
1979
1979
|
/* @__PURE__ */ a(re, { animated: !0, width: "50px" }),
|
|
1980
|
-
/* @__PURE__ */ a(
|
|
1980
|
+
/* @__PURE__ */ a(eo, { animated: !0 })
|
|
1981
1981
|
] })
|
|
1982
1982
|
] });
|
|
1983
1983
|
}, an = (e) => !e || typeof e != "object" || Array.isArray(e) ? !1 : Object.values(e).some(Array.isArray), ct = (e) => {
|
|
@@ -1987,7 +1987,7 @@ const Sr = (e) => {
|
|
|
1987
1987
|
t.has(r) || (t.add(r), n.push(o));
|
|
1988
1988
|
}
|
|
1989
1989
|
return n;
|
|
1990
|
-
},
|
|
1990
|
+
}, Te = (e) => {
|
|
1991
1991
|
if (!e) return {};
|
|
1992
1992
|
if (an(e.conditionsThatEstablishesTheDecision)) {
|
|
1993
1993
|
const t = e.conditionsThatEstablishesTheDecision;
|
|
@@ -2007,16 +2007,16 @@ const Sr = (e) => {
|
|
|
2007
2007
|
return an(e) ? Object.fromEntries(
|
|
2008
2008
|
Object.entries(e).map(([t, n]) => [t, ct(n)])
|
|
2009
2009
|
) : {};
|
|
2010
|
-
},
|
|
2010
|
+
}, Nn = (e, t) => Object.fromEntries(
|
|
2011
2011
|
Object.entries(e).map(([n, o]) => [n, o.filter(t)])
|
|
2012
|
-
),
|
|
2012
|
+
), Nr = {
|
|
2013
2013
|
Year: { label: "en años", labelView: "años" },
|
|
2014
2014
|
Month: { label: "en meses", labelView: "meses" },
|
|
2015
2015
|
Day: { label: "en días", labelView: "días" }
|
|
2016
|
-
},
|
|
2017
|
-
const o =
|
|
2016
|
+
}, Pt = (e, t, n = !1) => {
|
|
2017
|
+
const o = Nr[t ?? ""];
|
|
2018
2018
|
return o ? n ? `${e} ${o.labelView}` : `${e} ${o.label}` : e;
|
|
2019
|
-
},
|
|
2019
|
+
}, kr = (e, t) => {
|
|
2020
2020
|
if (e == null) return "";
|
|
2021
2021
|
const n = Array.isArray(e) ? e.join(", ") : typeof e == "object" && e !== null ? JSON.stringify(e) : String(e ?? "");
|
|
2022
2022
|
switch (t) {
|
|
@@ -2058,7 +2058,7 @@ const Sr = (e) => {
|
|
|
2058
2058
|
if (isNaN(o.getTime())) return "";
|
|
2059
2059
|
const r = o.getUTCDate(), i = o.getUTCMonth(), s = o.getUTCFullYear(), d = String(r).padStart(2, "0"), l = t[i] ?? "";
|
|
2060
2060
|
return l ? `${d}/${l}/${s}` : "";
|
|
2061
|
-
},
|
|
2061
|
+
}, _t = (e) => {
|
|
2062
2062
|
if (e == null) return !1;
|
|
2063
2063
|
if (typeof e == "number") return !Number.isNaN(e);
|
|
2064
2064
|
if (typeof e == "string") return e.trim().length > 0;
|
|
@@ -2066,10 +2066,10 @@ const Sr = (e) => {
|
|
|
2066
2066
|
if (typeof e == "object") {
|
|
2067
2067
|
if (Object.keys(e).length === 0) return !1;
|
|
2068
2068
|
const n = e.from ?? e.min ?? e.start, o = e.to ?? e.max ?? e.end;
|
|
2069
|
-
return n !== void 0 || o !== void 0 ?
|
|
2069
|
+
return n !== void 0 || o !== void 0 ? _t(n) || _t(o) : !0;
|
|
2070
2070
|
}
|
|
2071
2071
|
return !1;
|
|
2072
|
-
},
|
|
2072
|
+
}, Ar = (e) => _t(e == null ? void 0 : e.value), pt = (e, t) => e === "group-primary" ? "Condición principal" : `Condición alterna N° ${String(t).padStart(2, "0")}`, Ir = (e) => {
|
|
2073
2073
|
var i, s;
|
|
2074
2074
|
const t = ((i = e.listOfPossibleValues) == null ? void 0 : i.list) ?? [], n = e.value, o = Array.isArray(n) ? n : [n];
|
|
2075
2075
|
return { list: ((s = t.filter((d) => o.includes(d.value)).map((d, l) => ({
|
|
@@ -2077,7 +2077,7 @@ const Sr = (e) => {
|
|
|
2077
2077
|
label: d.label,
|
|
2078
2078
|
value: d.label
|
|
2079
2079
|
}))[0]) == null ? void 0 : s.label) ?? "" };
|
|
2080
|
-
},
|
|
2080
|
+
}, kn = (e) => {
|
|
2081
2081
|
var St, Et, Nt;
|
|
2082
2082
|
const {
|
|
2083
2083
|
cardTitle: t = !0,
|
|
@@ -2116,16 +2116,16 @@ const Sr = (e) => {
|
|
|
2116
2116
|
howToSetTheDecision: j.EQUAL,
|
|
2117
2117
|
decisionDataType: H.DATE
|
|
2118
2118
|
})
|
|
2119
|
-
} : null, v = (n == null ? void 0 : n.howToSetTheDecision) || j.EQUAL, T = n && (v === j.LIST_OF_VALUES || v === j.LIST_OF_VALUES_MULTI) ?
|
|
2119
|
+
} : null, v = (n == null ? void 0 : n.howToSetTheDecision) || j.EQUAL, T = n && (v === j.LIST_OF_VALUES || v === j.LIST_OF_VALUES_MULTI) ? Ir(n).list : He(n), w = n ? {
|
|
2120
2120
|
labelName: t && n.labelName || "",
|
|
2121
2121
|
decisionDataType: n.decisionDataType || H.ALPHABETICAL,
|
|
2122
2122
|
value: T,
|
|
2123
2123
|
howToSetTheDecision: v,
|
|
2124
2124
|
validUntil: n.validUntil
|
|
2125
|
-
} : null, D =
|
|
2126
|
-
() => n ?
|
|
2125
|
+
} : null, D = _.useMemo(
|
|
2126
|
+
() => n ? Te(n) : {},
|
|
2127
2127
|
[n]
|
|
2128
|
-
), S = ((Et = (St = n == null ? void 0 : n.conditionGroups) == null ? void 0 : St.map((O) => O == null ? void 0 : O.ConditionGroupId)) == null ? void 0 : Et.filter(Boolean)) || Object.keys(D), N = S[0] || "group-primary", C =
|
|
2128
|
+
), S = ((Et = (St = n == null ? void 0 : n.conditionGroups) == null ? void 0 : St.map((O) => O == null ? void 0 : O.ConditionGroupId)) == null ? void 0 : Et.filter(Boolean)) || Object.keys(D), N = S[0] || "group-primary", C = _.useMemo(() => {
|
|
2129
2129
|
const O = {}, q = D[N] || [], ee = D["group-primary"] || [];
|
|
2130
2130
|
O["group-primary"] = N === "group-primary" ? ee : [...q, ...ee];
|
|
2131
2131
|
for (const x of S)
|
|
@@ -2133,35 +2133,35 @@ const Sr = (e) => {
|
|
|
2133
2133
|
for (const x of Object.keys(D))
|
|
2134
2134
|
x === "group-primary" || x === N || x in O || (O[x] = D[x]);
|
|
2135
2135
|
return O;
|
|
2136
|
-
}, [D, N, S]), A =
|
|
2136
|
+
}, [D, N, S]), A = _.useMemo(() => {
|
|
2137
2137
|
const O = {};
|
|
2138
2138
|
return Object.keys(C).forEach((q) => {
|
|
2139
2139
|
const ee = C[q];
|
|
2140
2140
|
ee && Array.isArray(ee) ? O[q] = ee.map((x) => {
|
|
2141
2141
|
let L = x.labelName;
|
|
2142
|
-
x.timeUnit && x.labelName && (L =
|
|
2143
|
-
let
|
|
2144
|
-
return (x == null ? void 0 : x.howToSetTheCondition) !== void 0 && (x == null ? void 0 : x.howToSetTheCondition) !== null && (x == null ? void 0 : x.value) !== void 0 && (x == null ? void 0 : x.value) !== null && (x == null ? void 0 : x.value) !== "" && (
|
|
2142
|
+
x.timeUnit && x.labelName && (L = Pt(x.labelName, x.timeUnit));
|
|
2143
|
+
let P = x.value;
|
|
2144
|
+
return (x == null ? void 0 : x.howToSetTheCondition) !== void 0 && (x == null ? void 0 : x.howToSetTheCondition) !== null && (x == null ? void 0 : x.value) !== void 0 && (x == null ? void 0 : x.value) !== null && (x == null ? void 0 : x.value) !== "" && (P = kr(
|
|
2145
2145
|
x.value,
|
|
2146
2146
|
x.howToSetTheCondition
|
|
2147
2147
|
)), {
|
|
2148
2148
|
...x,
|
|
2149
2149
|
labelName: L,
|
|
2150
|
-
value:
|
|
2150
|
+
value: P
|
|
2151
2151
|
};
|
|
2152
2152
|
}) : O[q] = ee;
|
|
2153
2153
|
}), O;
|
|
2154
|
-
}, [C]), R =
|
|
2154
|
+
}, [C]), R = Nn(
|
|
2155
2155
|
A,
|
|
2156
2156
|
(O) => !O.hidden
|
|
2157
|
-
), $ =
|
|
2157
|
+
), $ = _.useMemo(() => {
|
|
2158
2158
|
const O = Object.entries(R).map(
|
|
2159
|
-
([ee, x]) => [ee, x.filter(
|
|
2159
|
+
([ee, x]) => [ee, x.filter(Ar)]
|
|
2160
2160
|
), q = {};
|
|
2161
2161
|
for (const [ee, x] of O)
|
|
2162
2162
|
x.length > 0 && (q[ee] = x);
|
|
2163
2163
|
return q;
|
|
2164
|
-
}, [R]), ae =
|
|
2164
|
+
}, [R]), ae = _.useMemo(() => {
|
|
2165
2165
|
const O = Object.keys($);
|
|
2166
2166
|
return O.includes("group-primary") ? ["group-primary", ...O.filter((q) => q !== "group-primary")] : O;
|
|
2167
2167
|
}, [$]), le = {};
|
|
@@ -2173,11 +2173,11 @@ const Sr = (e) => {
|
|
|
2173
2173
|
label: O === "group-primary" ? pt(O, 0) : pt(O, Number(q.split("-").at(-1))),
|
|
2174
2174
|
isDisabled: !1
|
|
2175
2175
|
};
|
|
2176
|
-
}), [Ze, xt] =
|
|
2176
|
+
}), [Ze, xt] = _.useState(
|
|
2177
2177
|
((Nt = Je[0]) == null ? void 0 : Nt.id) ?? "mainCondition"
|
|
2178
2178
|
), Ke = (O) => xt(O), Dt = le[Ze] ?? ae[0] ?? "group-primary", et = $[Dt] ?? [], tt = ae.length > 1, wt = Array.from({ length: 5 }), nt = !!(!o && n && r && w), Ct = et.length < 2 ? "start" : "space-between", Le = `N° ${String((i ?? 0) + 1).padStart(2, "0")}`;
|
|
2179
2179
|
return /* @__PURE__ */ a(
|
|
2180
|
-
|
|
2180
|
+
Er,
|
|
2181
2181
|
{
|
|
2182
2182
|
conditionsAlignment: Ct,
|
|
2183
2183
|
controls: p,
|
|
@@ -2202,7 +2202,7 @@ const Sr = (e) => {
|
|
|
2202
2202
|
hasMultipleGroups: tt
|
|
2203
2203
|
}
|
|
2204
2204
|
);
|
|
2205
|
-
},
|
|
2205
|
+
}, $r = Wt`
|
|
2206
2206
|
from {
|
|
2207
2207
|
opacity: 0;
|
|
2208
2208
|
transform: translateY(20px);
|
|
@@ -2236,7 +2236,7 @@ E.div`
|
|
|
2236
2236
|
}};
|
|
2237
2237
|
}
|
|
2238
2238
|
`;
|
|
2239
|
-
const
|
|
2239
|
+
const Fr = E.div`
|
|
2240
2240
|
& > div {
|
|
2241
2241
|
box-shadow: 0px 2px 3px 0px
|
|
2242
2242
|
${({ theme: e }) => {
|
|
@@ -2245,18 +2245,18 @@ const $r = E.div`
|
|
|
2245
2245
|
}};
|
|
2246
2246
|
cursor: pointer;
|
|
2247
2247
|
}
|
|
2248
|
-
`,
|
|
2248
|
+
`, Rr = E.div`
|
|
2249
2249
|
width: 100%;
|
|
2250
2250
|
height: 100%;
|
|
2251
2251
|
& > div {
|
|
2252
|
-
animation: ${
|
|
2252
|
+
animation: ${$r} 600ms ease-out;
|
|
2253
2253
|
}
|
|
2254
|
-
`,
|
|
2254
|
+
`, Lr = E.div`
|
|
2255
2255
|
& > div > div {
|
|
2256
2256
|
border-radius: 8px;
|
|
2257
2257
|
box-sizing: border-box;
|
|
2258
2258
|
}
|
|
2259
|
-
`,
|
|
2259
|
+
`, Or = E.div`
|
|
2260
2260
|
& > div {
|
|
2261
2261
|
width: 100%;
|
|
2262
2262
|
height: 100%;
|
|
@@ -2276,21 +2276,21 @@ const $r = E.div`
|
|
|
2276
2276
|
border-radius: 8px;
|
|
2277
2277
|
}
|
|
2278
2278
|
}
|
|
2279
|
-
`,
|
|
2279
|
+
`, Mr = (e) => {
|
|
2280
2280
|
const { index: t, handleOpenModal: n } = e;
|
|
2281
2281
|
return /* @__PURE__ */ a(
|
|
2282
|
-
|
|
2282
|
+
En,
|
|
2283
2283
|
{
|
|
2284
2284
|
id: `loading-card-${t}`,
|
|
2285
2285
|
handleDelete: () => {
|
|
2286
2286
|
},
|
|
2287
2287
|
handleView: () => n ? n() : null,
|
|
2288
2288
|
controls: !1,
|
|
2289
|
-
children: /* @__PURE__ */ a(
|
|
2289
|
+
children: /* @__PURE__ */ a(kn, { loading: !0 })
|
|
2290
2290
|
},
|
|
2291
2291
|
`loading-card-${t}`
|
|
2292
2292
|
);
|
|
2293
|
-
},
|
|
2293
|
+
}, Pr = (e) => {
|
|
2294
2294
|
const {
|
|
2295
2295
|
cardTitle: t,
|
|
2296
2296
|
decision: n,
|
|
@@ -2303,13 +2303,13 @@ const $r = E.div`
|
|
|
2303
2303
|
onToggle: u
|
|
2304
2304
|
} = e;
|
|
2305
2305
|
return n ? /* @__PURE__ */ a(Qe, { children: /* @__PURE__ */ a(y, { direction: "column", gap: "4px", width: "100%", children: /* @__PURE__ */ a(
|
|
2306
|
-
|
|
2306
|
+
En,
|
|
2307
2307
|
{
|
|
2308
2308
|
id: n.decisionId,
|
|
2309
2309
|
handleDelete: () => i ? i(n.decisionId) : null,
|
|
2310
2310
|
handleView: () => r ? r(n) : null,
|
|
2311
2311
|
children: /* @__PURE__ */ a(
|
|
2312
|
-
|
|
2312
|
+
kn,
|
|
2313
2313
|
{
|
|
2314
2314
|
cardTitle: t,
|
|
2315
2315
|
controls: o,
|
|
@@ -2331,8 +2331,8 @@ const $r = E.div`
|
|
|
2331
2331
|
handleOpenModal: o,
|
|
2332
2332
|
shouldRenderEmptyMessage: r
|
|
2333
2333
|
} = e;
|
|
2334
|
-
return /* @__PURE__ */ a(
|
|
2335
|
-
|
|
2334
|
+
return /* @__PURE__ */ a(Rr, { children: r ? null : /* @__PURE__ */ a(
|
|
2335
|
+
Fr,
|
|
2336
2336
|
{
|
|
2337
2337
|
onClick: () => o ? o() : null,
|
|
2338
2338
|
children: /* @__PURE__ */ a(
|
|
@@ -2368,14 +2368,14 @@ const $r = E.div`
|
|
|
2368
2368
|
)
|
|
2369
2369
|
}
|
|
2370
2370
|
) }, `add-decision-${n}`);
|
|
2371
|
-
},
|
|
2372
|
-
loading:
|
|
2373
|
-
decision:
|
|
2371
|
+
}, Vr = {
|
|
2372
|
+
loading: Mr,
|
|
2373
|
+
decision: Pr,
|
|
2374
2374
|
add: _r
|
|
2375
2375
|
}, Vt = (e) => {
|
|
2376
|
-
const { type: t } = e, n =
|
|
2376
|
+
const { type: t } = e, n = Vr[t];
|
|
2377
2377
|
return n ? n(e) : null;
|
|
2378
|
-
},
|
|
2378
|
+
}, jr = (e) => {
|
|
2379
2379
|
const {
|
|
2380
2380
|
cardTitle: t,
|
|
2381
2381
|
controls: n,
|
|
@@ -2415,13 +2415,13 @@ const $r = E.div`
|
|
|
2415
2415
|
})
|
|
2416
2416
|
), h = ((r == null ? void 0 : r.length) === 0 || r.length < Math.floor(window.innerWidth / 300)) && !i && n;
|
|
2417
2417
|
return { renderedCards: c, shouldRenderAddCard: h };
|
|
2418
|
-
},
|
|
2418
|
+
}, Ur = E.div`
|
|
2419
2419
|
position: relative;
|
|
2420
2420
|
& > div {
|
|
2421
2421
|
padding: 24px 16px;
|
|
2422
2422
|
place-items: unset;
|
|
2423
2423
|
}
|
|
2424
|
-
`,
|
|
2424
|
+
`, zr = E.div`
|
|
2425
2425
|
background-color: ${({ theme: e }) => {
|
|
2426
2426
|
var t, n;
|
|
2427
2427
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || I.palette.neutral.N0;
|
|
@@ -2453,7 +2453,7 @@ const $r = E.div`
|
|
|
2453
2453
|
background-color: #ebecf0;
|
|
2454
2454
|
border-radius: 8px;
|
|
2455
2455
|
}
|
|
2456
|
-
`,
|
|
2456
|
+
`, Hr = (e) => {
|
|
2457
2457
|
const { children: t, description: n, portalId: o, onCloseModal: r, title: i } = e, s = document.getElementById(o);
|
|
2458
2458
|
if (!s)
|
|
2459
2459
|
throw new Error(
|
|
@@ -2461,7 +2461,7 @@ const $r = E.div`
|
|
|
2461
2461
|
);
|
|
2462
2462
|
const d = ue("(max-width: 400px)");
|
|
2463
2463
|
return Yt(
|
|
2464
|
-
/* @__PURE__ */ a(
|
|
2464
|
+
/* @__PURE__ */ a(Ur, { smallScreen: d, children: /* @__PURE__ */ a(Bt, { children: /* @__PURE__ */ a(zr, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "24px", children: [
|
|
2465
2465
|
/* @__PURE__ */ m(y, { direction: "column", gap: "24px", children: [
|
|
2466
2466
|
/* @__PURE__ */ m(y, { alignItems: "center", justifyContent: "space-between", children: [
|
|
2467
2467
|
/* @__PURE__ */ m(y, { direction: "column", gap: "8px", children: [
|
|
@@ -2485,15 +2485,15 @@ const $r = E.div`
|
|
|
2485
2485
|
] }) }) }) }),
|
|
2486
2486
|
s
|
|
2487
2487
|
);
|
|
2488
|
-
},
|
|
2489
|
-
schema:
|
|
2488
|
+
}, Gr = (e) => ({
|
|
2489
|
+
schema: ge().required("Requerido").test(
|
|
2490
2490
|
"non-empty",
|
|
2491
2491
|
"El valor no puede estar vacío",
|
|
2492
2492
|
(t) => t != null && t.trim() !== ""
|
|
2493
2493
|
),
|
|
2494
2494
|
value: e
|
|
2495
|
-
}),
|
|
2496
|
-
schema:
|
|
2495
|
+
}), Br = (e) => ({
|
|
2496
|
+
schema: ve().test(
|
|
2497
2497
|
"isArrayOrString",
|
|
2498
2498
|
"Por favor selecciona una opcion",
|
|
2499
2499
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -2501,8 +2501,8 @@ const $r = E.div`
|
|
|
2501
2501
|
) : typeof t == "string"
|
|
2502
2502
|
),
|
|
2503
2503
|
value: e
|
|
2504
|
-
}),
|
|
2505
|
-
schema:
|
|
2504
|
+
}), qr = (e) => ({
|
|
2505
|
+
schema: ve().test(
|
|
2506
2506
|
"isArrayOrString",
|
|
2507
2507
|
"Por favor selecciona al menos una opcion",
|
|
2508
2508
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -2510,12 +2510,12 @@ const $r = E.div`
|
|
|
2510
2510
|
) : typeof t == "string"
|
|
2511
2511
|
),
|
|
2512
2512
|
value: e
|
|
2513
|
-
}),
|
|
2513
|
+
}), Wr = (e) => {
|
|
2514
2514
|
const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
|
|
2515
2515
|
return {
|
|
2516
2516
|
schema: te({
|
|
2517
|
-
from:
|
|
2518
|
-
to:
|
|
2517
|
+
from: pe().required("El campo de tipo rango es requerido").max(n, "El rango desde no puede ser mayor al rango hasta").min(0, "El rango desde no puede ser menor a 0"),
|
|
2518
|
+
to: pe().min(0, "El rengo hasta debe ser mayor o igual a 0").required("El rango hasta es requerido").test(
|
|
2519
2519
|
"is-greater",
|
|
2520
2520
|
"El rengo hasta debe ser mayor a el rango desde",
|
|
2521
2521
|
function(o) {
|
|
@@ -2526,47 +2526,70 @@ const $r = E.div`
|
|
|
2526
2526
|
}),
|
|
2527
2527
|
value: { from: t, to: n }
|
|
2528
2528
|
};
|
|
2529
|
-
}, It = (e, t) => {
|
|
2530
|
-
if (
|
|
2529
|
+
}, ln = (e) => e && typeof e == "object" && !Array.isArray(e) && "value" in e && e.value !== "" && e.value != null, It = (e, t) => {
|
|
2530
|
+
if (ln(e))
|
|
2531
|
+
return {
|
|
2532
|
+
schema: ve().test(
|
|
2533
|
+
"required-option",
|
|
2534
|
+
"Por favor selecciona una opcion",
|
|
2535
|
+
(n) => ln(n)
|
|
2536
|
+
),
|
|
2537
|
+
value: e
|
|
2538
|
+
};
|
|
2539
|
+
if (e && typeof e == "object" && "from" in e && "to" in e) {
|
|
2531
2540
|
const n = e;
|
|
2532
2541
|
return t === H.PERCENTAGE ? {
|
|
2533
2542
|
schema: te({
|
|
2534
|
-
from:
|
|
2535
|
-
to:
|
|
2543
|
+
from: pe().required("El campo desde es requerido").min(0, "El porcentaje no puede ser menor a 0").max(100, "El porcentaje no puede ser mayor a 100"),
|
|
2544
|
+
to: pe().required("El campo hasta es requerido").min(0, "El porcentaje no puede ser menor a 0").max(100, "El porcentaje no puede ser mayor a 100")
|
|
2536
2545
|
}),
|
|
2537
2546
|
value: n
|
|
2538
2547
|
} : {
|
|
2539
2548
|
schema: te({
|
|
2540
|
-
from:
|
|
2541
|
-
to:
|
|
2549
|
+
from: ge().required("Requerido"),
|
|
2550
|
+
to: ge().required("Requerido")
|
|
2542
2551
|
}),
|
|
2543
2552
|
value: n
|
|
2544
2553
|
};
|
|
2545
2554
|
}
|
|
2546
2555
|
return t === H.PERCENTAGE ? {
|
|
2547
|
-
schema:
|
|
2556
|
+
schema: pe().required("El campo porcentaje es requerido").min(0, "El porcentaje no puede ser menor a 0").max(100, "El porcentaje no puede ser mayor a 100"),
|
|
2548
2557
|
value: e
|
|
2549
2558
|
} : {
|
|
2550
|
-
schema:
|
|
2559
|
+
schema: ve().test("required", "Requerido", (n) => n == null ? !1 : typeof n == "string" ? n.trim().length > 0 : typeof n == "number" ? !Number.isNaN(n) : !1),
|
|
2551
2560
|
value: e
|
|
2552
2561
|
};
|
|
2553
|
-
},
|
|
2554
|
-
[k.LIST_OF_VALUES]:
|
|
2555
|
-
[k.LIST_OF_VALUES_MULTI]:
|
|
2556
|
-
[k.RANGE]:
|
|
2562
|
+
}, Yr = {
|
|
2563
|
+
[k.LIST_OF_VALUES]: Br,
|
|
2564
|
+
[k.LIST_OF_VALUES_MULTI]: qr,
|
|
2565
|
+
[k.RANGE]: Wr,
|
|
2557
2566
|
[k.GREATER_THAN]: It,
|
|
2558
2567
|
[k.LESS_THAN]: It,
|
|
2559
2568
|
[k.EQUAL]: It
|
|
2560
|
-
},
|
|
2569
|
+
}, sn = (e) => Yr[e] || Gr, Xr = (e) => {
|
|
2570
|
+
var t;
|
|
2571
|
+
return Array.isArray((t = e == null ? void 0 : e.listOfPossibleValues) == null ? void 0 : t.list) && e.listOfPossibleValues.list.length > 0;
|
|
2572
|
+
}, Qr = ve().test(
|
|
2573
|
+
"required-option",
|
|
2574
|
+
"Por favor selecciona una opcion",
|
|
2575
|
+
(e) => {
|
|
2576
|
+
if (e == null) return !1;
|
|
2577
|
+
if (typeof e == "object") {
|
|
2578
|
+
const t = e.value;
|
|
2579
|
+
return t != null && String(t).trim() !== "";
|
|
2580
|
+
}
|
|
2581
|
+
return typeof e == "string" ? e.trim().length > 0 : typeof e == "number" ? !Number.isNaN(e) : !1;
|
|
2582
|
+
}
|
|
2583
|
+
), jt = (e) => e && typeof e == "object" && "value" in e ? e.value : e, dn = (e) => {
|
|
2561
2584
|
const t = jt(e);
|
|
2562
2585
|
return t == null ? !1 : typeof t == "string" ? t.trim().length > 0 : typeof t == "number" ? !Number.isNaN(t) : Array.isArray(t) ? t.length > 0 : typeof t == "object" ? Object.keys(t).length > 0 : !0;
|
|
2563
2586
|
};
|
|
2564
|
-
function
|
|
2587
|
+
function Jr({
|
|
2565
2588
|
decision: e,
|
|
2566
2589
|
onSubmitEvent: t,
|
|
2567
2590
|
textValues: n
|
|
2568
2591
|
}) {
|
|
2569
|
-
const o =
|
|
2592
|
+
const o = Te(e) || {}, r = () => Object.entries(o).flatMap(
|
|
2570
2593
|
([h, g]) => g.map((f) => ({ group: h, cond: f }))
|
|
2571
2594
|
), i = Object.fromEntries(
|
|
2572
2595
|
Object.entries(o).map(([h, g]) => {
|
|
@@ -2608,8 +2631,8 @@ function Yr({
|
|
|
2608
2631
|
};
|
|
2609
2632
|
let l;
|
|
2610
2633
|
const u = {
|
|
2611
|
-
ruleName:
|
|
2612
|
-
value: Ge(() =>
|
|
2634
|
+
ruleName: ge().required("El nombre de la decision es requerido"),
|
|
2635
|
+
value: Ge(() => Xr(e) ? Qr : sn(
|
|
2613
2636
|
l.values.howToSetTheDecision
|
|
2614
2637
|
)(
|
|
2615
2638
|
l.values.value,
|
|
@@ -2625,7 +2648,7 @@ function Yr({
|
|
|
2625
2648
|
var R, $;
|
|
2626
2649
|
const C = ($ = (R = g == null ? void 0 : g.conditionsThatEstablishesTheDecision) == null ? void 0 : R[w]) == null ? void 0 : $[N.conditionName], A = jt(C);
|
|
2627
2650
|
if (A !== void 0) {
|
|
2628
|
-
const ae =
|
|
2651
|
+
const ae = sn(
|
|
2629
2652
|
N.howToSetTheCondition
|
|
2630
2653
|
);
|
|
2631
2654
|
S[N.conditionName] = ae(
|
|
@@ -2640,15 +2663,15 @@ function Yr({
|
|
|
2640
2663
|
"Debe existir al menos una condición para que la decisión se valide correctamente.",
|
|
2641
2664
|
(w) => !w || typeof w != "object" ? !1 : Object.values(w).some(
|
|
2642
2665
|
(D) => D && typeof D == "object" && Object.values(D).some(
|
|
2643
|
-
(S) =>
|
|
2666
|
+
(S) => dn(S)
|
|
2644
2667
|
)
|
|
2645
2668
|
)
|
|
2646
2669
|
);
|
|
2647
2670
|
})
|
|
2648
2671
|
};
|
|
2649
|
-
n.terms && (u.effectiveFrom =
|
|
2672
|
+
n.terms && (u.effectiveFrom = Ie().required(
|
|
2650
2673
|
"Se requiere la fecha de vigencia desde"
|
|
2651
|
-
), u.validUntil =
|
|
2674
|
+
), u.validUntil = Ie().when(
|
|
2652
2675
|
"checkClosed",
|
|
2653
2676
|
(h, g, { parent: f }) => (f == null ? void 0 : f.checkClosed) ? g.required("Se requiere la fecha de vigencia hasta").test(
|
|
2654
2677
|
"is-after-startDate",
|
|
@@ -2674,7 +2697,7 @@ function Yr({
|
|
|
2674
2697
|
...N,
|
|
2675
2698
|
value: R
|
|
2676
2699
|
};
|
|
2677
|
-
}).filter((N) =>
|
|
2700
|
+
}).filter((N) => dn(N.value));
|
|
2678
2701
|
return [v, D];
|
|
2679
2702
|
})
|
|
2680
2703
|
), f = {
|
|
@@ -2736,7 +2759,7 @@ E.div`
|
|
|
2736
2759
|
border-radius: 8px;
|
|
2737
2760
|
}
|
|
2738
2761
|
`;
|
|
2739
|
-
const
|
|
2762
|
+
const Zr = E.div`
|
|
2740
2763
|
display: flex;
|
|
2741
2764
|
width: -webkit-fill-available;
|
|
2742
2765
|
align-items: center;
|
|
@@ -2746,7 +2769,7 @@ const Xr = E.div`
|
|
|
2746
2769
|
gap: 16px;
|
|
2747
2770
|
width: -webkit-fill-available;
|
|
2748
2771
|
}
|
|
2749
|
-
`,
|
|
2772
|
+
`, Kr = (e) => {
|
|
2750
2773
|
const {
|
|
2751
2774
|
onHandleStartChange: t,
|
|
2752
2775
|
onHandleEndChange: n,
|
|
@@ -2789,7 +2812,7 @@ const Xr = E.div`
|
|
|
2789
2812
|
gap: "24px",
|
|
2790
2813
|
children: [
|
|
2791
2814
|
/* @__PURE__ */ a(
|
|
2792
|
-
|
|
2815
|
+
Ae,
|
|
2793
2816
|
{
|
|
2794
2817
|
id: "dateStart",
|
|
2795
2818
|
label: r,
|
|
@@ -2803,7 +2826,7 @@ const Xr = E.div`
|
|
|
2803
2826
|
}
|
|
2804
2827
|
),
|
|
2805
2828
|
f && /* @__PURE__ */ a(
|
|
2806
|
-
|
|
2829
|
+
Ae,
|
|
2807
2830
|
{
|
|
2808
2831
|
id: "dateEnd",
|
|
2809
2832
|
label: i,
|
|
@@ -2820,7 +2843,7 @@ const Xr = E.div`
|
|
|
2820
2843
|
}
|
|
2821
2844
|
)
|
|
2822
2845
|
] });
|
|
2823
|
-
},
|
|
2846
|
+
}, ei = (e) => {
|
|
2824
2847
|
const {
|
|
2825
2848
|
activeTab: t,
|
|
2826
2849
|
conditionsErrorText: n,
|
|
@@ -2861,7 +2884,7 @@ const Xr = E.div`
|
|
|
2861
2884
|
) }),
|
|
2862
2885
|
o && o.length > 0 && /* @__PURE__ */ a(Ve, { legend: "Condiciones a evaluar", spacing: "wide", children: /* @__PURE__ */ m(y, { direction: "column", gap: "20px", width: "100%", children: [
|
|
2863
2886
|
/* @__PURE__ */ a(
|
|
2864
|
-
|
|
2887
|
+
Dn,
|
|
2865
2888
|
{
|
|
2866
2889
|
onChange: l,
|
|
2867
2890
|
tabs: p,
|
|
@@ -2872,7 +2895,7 @@ const Xr = E.div`
|
|
|
2872
2895
|
/* @__PURE__ */ a(
|
|
2873
2896
|
G,
|
|
2874
2897
|
{
|
|
2875
|
-
icon: /* @__PURE__ */ a(
|
|
2898
|
+
icon: /* @__PURE__ */ a(Bn, {}),
|
|
2876
2899
|
appearance: "help",
|
|
2877
2900
|
onClick: T,
|
|
2878
2901
|
cursorHover: !0
|
|
@@ -2882,7 +2905,7 @@ const Xr = E.div`
|
|
|
2882
2905
|
Q,
|
|
2883
2906
|
{
|
|
2884
2907
|
type: "button",
|
|
2885
|
-
iconBefore: /* @__PURE__ */ a(
|
|
2908
|
+
iconBefore: /* @__PURE__ */ a(qn, {}),
|
|
2886
2909
|
variant: "none",
|
|
2887
2910
|
appearance: "gray",
|
|
2888
2911
|
onClick: T,
|
|
@@ -2894,7 +2917,7 @@ const Xr = E.div`
|
|
|
2894
2917
|
/* @__PURE__ */ a(y, { direction: "column", gap: "20px", children: o == null ? void 0 : o.map((S) => {
|
|
2895
2918
|
const N = S.__scopedName ?? `${S.groupKey}.${S.conditionName}`;
|
|
2896
2919
|
return /* @__PURE__ */ m(y, { gap: "16px", alignItems: "center", children: [
|
|
2897
|
-
/* @__PURE__ */ m(
|
|
2920
|
+
/* @__PURE__ */ m(Zr, { children: [
|
|
2898
2921
|
/* @__PURE__ */ a(
|
|
2899
2922
|
en,
|
|
2900
2923
|
{
|
|
@@ -2918,7 +2941,7 @@ const Xr = E.div`
|
|
|
2918
2941
|
u && /* @__PURE__ */ a(F, { type: "label", size: "medium", appearance: "danger", children: n ?? "Existen errores en el formulario, por favor revísalos." })
|
|
2919
2942
|
] }) }),
|
|
2920
2943
|
/* @__PURE__ */ a(Ve, { legend: "Vigencia", spacing: "wide", children: g.terms && /* @__PURE__ */ a(
|
|
2921
|
-
|
|
2944
|
+
Kr,
|
|
2922
2945
|
{
|
|
2923
2946
|
labelStart: g.termStart,
|
|
2924
2947
|
labelEnd: g.termEnd,
|
|
@@ -2942,7 +2965,7 @@ const Xr = E.div`
|
|
|
2942
2965
|
] })
|
|
2943
2966
|
] }) }),
|
|
2944
2967
|
v && f && /* @__PURE__ */ a(
|
|
2945
|
-
|
|
2968
|
+
Cn,
|
|
2946
2969
|
{
|
|
2947
2970
|
portalId: f,
|
|
2948
2971
|
title: "Redefinir la condición",
|
|
@@ -2967,18 +2990,18 @@ const Xr = E.div`
|
|
|
2967
2990
|
}
|
|
2968
2991
|
)
|
|
2969
2992
|
] });
|
|
2970
|
-
},
|
|
2971
|
-
const { label: t, howToSet: n, isFirst: o = !1 } = e, r =
|
|
2993
|
+
}, ti = (e) => {
|
|
2994
|
+
const { label: t, howToSet: n, isFirst: o = !1 } = e, r = ri(t), i = oi(r), s = o ? "Que" : "Y que", d = i ? r : `${ii(r)} ${r}`, l = di(n);
|
|
2972
2995
|
return `${s} ${d.toLowerCase()} ${l}`;
|
|
2973
|
-
},
|
|
2974
|
-
function
|
|
2975
|
-
return
|
|
2996
|
+
}, ni = /^(el|la|los|las)\s/i;
|
|
2997
|
+
function oi(e) {
|
|
2998
|
+
return ni.test(e);
|
|
2976
2999
|
}
|
|
2977
|
-
function
|
|
3000
|
+
function ri(e) {
|
|
2978
3001
|
return e.replace(/\s+/g, " ").trim();
|
|
2979
3002
|
}
|
|
2980
|
-
function
|
|
2981
|
-
const t =
|
|
3003
|
+
function ii(e) {
|
|
3004
|
+
const t = ai(e).toLowerCase(), n = /\b(s|es)\b/.test(li(e).toLowerCase()) && !t.endsWith("és");
|
|
2982
3005
|
return ({
|
|
2983
3006
|
mano: "f",
|
|
2984
3007
|
día: "m",
|
|
@@ -2990,21 +3013,21 @@ function ni(e) {
|
|
|
2990
3013
|
antigüedad: "f",
|
|
2991
3014
|
antiguedad: "f",
|
|
2992
3015
|
puntaje: "m"
|
|
2993
|
-
}[t] ??
|
|
3016
|
+
}[t] ?? si(t)) === "f" ? n ? "las" : "la" : n ? "los" : "el";
|
|
2994
3017
|
}
|
|
2995
|
-
function
|
|
3018
|
+
function ai(e) {
|
|
2996
3019
|
return (e.toLowerCase().split(
|
|
2997
3020
|
/\bdel\b|\bde la\b|\bde los\b|\bde las\b|\bde\b/
|
|
2998
3021
|
)[0].trim().split(/\s+/)[0] ?? "").normalize("NFD").replace(/^[^a-záéíóúüñ]+/i, "");
|
|
2999
3022
|
}
|
|
3000
|
-
function
|
|
3023
|
+
function li(e) {
|
|
3001
3024
|
const t = e.trim().split(/\s+/);
|
|
3002
3025
|
return t[t.length - 1] || "";
|
|
3003
3026
|
}
|
|
3004
|
-
function
|
|
3027
|
+
function si(e) {
|
|
3005
3028
|
return /(?:dad|tad|tud|umbre|ción|sión|ie|sis|itis)$/.test(e) || e.endsWith("ez") || e.endsWith("eza") ? "f" : /(?:aje|or|án|ambre)$/.test(e) ? "m" : e.endsWith("a") ? "f" : "m";
|
|
3006
3029
|
}
|
|
3007
|
-
function
|
|
3030
|
+
function di(e) {
|
|
3008
3031
|
switch (e) {
|
|
3009
3032
|
case k.EQUAL:
|
|
3010
3033
|
return "sea";
|
|
@@ -3046,7 +3069,7 @@ const Oe = (e) => {
|
|
|
3046
3069
|
default:
|
|
3047
3070
|
return "";
|
|
3048
3071
|
}
|
|
3049
|
-
},
|
|
3072
|
+
}, ci = (e, t, n) => {
|
|
3050
3073
|
const o = e == null ? void 0 : e.conditionGroups;
|
|
3051
3074
|
if (!Array.isArray(o)) return;
|
|
3052
3075
|
const r = o.find((s) => (s == null ? void 0 : s.ConditionGroupId) === t);
|
|
@@ -3055,10 +3078,10 @@ const Oe = (e) => {
|
|
|
3055
3078
|
(s) => (s == null ? void 0 : s.conditionName) === n
|
|
3056
3079
|
);
|
|
3057
3080
|
return i == null ? void 0 : i.value;
|
|
3058
|
-
},
|
|
3081
|
+
}, ui = (e, t, n) => {
|
|
3059
3082
|
var o, r;
|
|
3060
3083
|
return (r = (o = e == null ? void 0 : e.conditionsThatEstablishesTheDecision) == null ? void 0 : o[t]) == null ? void 0 : r[n];
|
|
3061
|
-
},
|
|
3084
|
+
}, pi = (e) => {
|
|
3062
3085
|
var q, ee;
|
|
3063
3086
|
const {
|
|
3064
3087
|
decision: t,
|
|
@@ -3068,11 +3091,11 @@ const Oe = (e) => {
|
|
|
3068
3091
|
onRemoveCondition: i,
|
|
3069
3092
|
onRestoreConditions: s,
|
|
3070
3093
|
fullTemplate: d
|
|
3071
|
-
} = e, { formik: l, handleToggleNoneChange: u } =
|
|
3094
|
+
} = e, { formik: l, handleToggleNoneChange: u } = Jr({
|
|
3072
3095
|
decision: t,
|
|
3073
3096
|
onSubmitEvent: n,
|
|
3074
3097
|
textValues: o
|
|
3075
|
-
}), p = d ?? t, c =
|
|
3098
|
+
}), p = d ?? t, c = Te(p), h = Te(t), g = Nn(
|
|
3076
3099
|
h,
|
|
3077
3100
|
(x) => !x.hidden
|
|
3078
3101
|
), f = Object.keys(g), v = [
|
|
@@ -3087,25 +3110,25 @@ const Oe = (e) => {
|
|
|
3087
3110
|
label: x === "group-primary" ? pt(x, 0) : pt(x, Number(L.split("-").at(-1))),
|
|
3088
3111
|
isDisabled: !1
|
|
3089
3112
|
};
|
|
3090
|
-
}), [S, N] =
|
|
3113
|
+
}), [S, N] = _.useState(
|
|
3091
3114
|
((q = D[0]) == null ? void 0 : q.id) ?? "mainCondition"
|
|
3092
3115
|
), C = (x) => N(x), A = T[S] ?? "group-primary";
|
|
3093
|
-
|
|
3116
|
+
_.useEffect(() => {
|
|
3094
3117
|
var W;
|
|
3095
3118
|
const x = (W = l.values) == null ? void 0 : W.conditionsThatEstablishesTheDecision;
|
|
3096
3119
|
let L = !1;
|
|
3097
3120
|
if (x && typeof x == "object" && (L = Object.values(x).some(
|
|
3098
3121
|
(X) => X && typeof X == "object" && Object.keys(X).length > 0
|
|
3099
3122
|
)), L) return;
|
|
3100
|
-
const
|
|
3101
|
-
if (!
|
|
3123
|
+
const P = Te(t);
|
|
3124
|
+
if (!P || Object.keys(P).length === 0)
|
|
3102
3125
|
return;
|
|
3103
3126
|
const M = Object.fromEntries(
|
|
3104
|
-
Object.entries(
|
|
3127
|
+
Object.entries(P).map(([X, U]) => {
|
|
3105
3128
|
const me = Object.fromEntries(
|
|
3106
3129
|
U.map((se) => {
|
|
3107
|
-
const
|
|
3108
|
-
return [se.conditionName,
|
|
3130
|
+
const he = Oe(se.howToSetTheCondition), ye = se.value ?? Me(he);
|
|
3131
|
+
return [se.conditionName, ye];
|
|
3109
3132
|
})
|
|
3110
3133
|
);
|
|
3111
3134
|
return [X, me];
|
|
@@ -3116,20 +3139,18 @@ const Oe = (e) => {
|
|
|
3116
3139
|
M,
|
|
3117
3140
|
!1
|
|
3118
3141
|
);
|
|
3119
|
-
}, [t]),
|
|
3142
|
+
}, [t]), _.useEffect(() => {
|
|
3120
3143
|
var U;
|
|
3121
3144
|
const x = (U = l.values) == null ? void 0 : U.conditionsThatEstablishesTheDecision;
|
|
3122
3145
|
if (!x || typeof x != "object") return;
|
|
3123
|
-
const L =
|
|
3146
|
+
const L = Te(p), P = Object.entries(x).map(
|
|
3124
3147
|
([me, se]) => {
|
|
3125
|
-
const
|
|
3126
|
-
const z = se[be], ne =
|
|
3148
|
+
const he = L[me] || [], ye = Object.keys(se).map((be) => {
|
|
3149
|
+
const z = se[be], ne = he.find((zn) => zn.conditionName === be) || {}, kt = Oe(
|
|
3127
3150
|
ne.howToSetTheCondition ?? (z == null ? void 0 : z.howToSetTheCondition)
|
|
3128
3151
|
), ot = ne.value ?? Me(kt), rt = z && typeof z == "object" && "value" in z ? z.value : z;
|
|
3129
3152
|
return {
|
|
3130
|
-
// meta (labelName, descriptionUse, timeUnit, etc.)
|
|
3131
3153
|
...ne,
|
|
3132
|
-
// any extra fields that might live in the wrapper
|
|
3133
3154
|
...typeof z == "object" && !Array.isArray(z) ? z : {},
|
|
3134
3155
|
conditionName: be,
|
|
3135
3156
|
value: rt !== void 0 ? rt : ot
|
|
@@ -3137,13 +3158,13 @@ const Oe = (e) => {
|
|
|
3137
3158
|
});
|
|
3138
3159
|
return {
|
|
3139
3160
|
ConditionGroupId: me,
|
|
3140
|
-
conditionsThatEstablishesTheDecision:
|
|
3161
|
+
conditionsThatEstablishesTheDecision: ye
|
|
3141
3162
|
};
|
|
3142
3163
|
}
|
|
3143
|
-
), M = l.values.conditionGroups, W = JSON.stringify(
|
|
3144
|
-
W !== X && l.setFieldValue("conditionGroups",
|
|
3164
|
+
), M = l.values.conditionGroups, W = JSON.stringify(P), X = JSON.stringify(M ?? []);
|
|
3165
|
+
W !== X && l.setFieldValue("conditionGroups", P, !1);
|
|
3145
3166
|
}, [(ee = l.values) == null ? void 0 : ee.conditionsThatEstablishesTheDecision, p]);
|
|
3146
|
-
const R =
|
|
3167
|
+
const R = _.useMemo(() => {
|
|
3147
3168
|
const x = [
|
|
3148
3169
|
...Object.keys(g).filter(
|
|
3149
3170
|
(M) => M === "group-primary"
|
|
@@ -3153,60 +3174,60 @@ const Oe = (e) => {
|
|
|
3153
3174
|
)
|
|
3154
3175
|
];
|
|
3155
3176
|
let L = !1;
|
|
3156
|
-
const
|
|
3177
|
+
const P = x.map((M) => {
|
|
3157
3178
|
const X = (g[M] ?? []).map((U, me) => {
|
|
3158
3179
|
const se = !L && M === "group-primary" && me === 0;
|
|
3159
3180
|
se && (L = !0);
|
|
3160
|
-
const
|
|
3181
|
+
const he = Oe(U.howToSetTheCondition), ye = ti({
|
|
3161
3182
|
label: U.labelName || "",
|
|
3162
|
-
howToSet:
|
|
3183
|
+
howToSet: he,
|
|
3163
3184
|
isFirst: se
|
|
3164
|
-
}), be = U.timeUnit ?
|
|
3185
|
+
}), be = U.timeUnit ? Pt("", U.timeUnit, !0).trim() : "", z = `${M}.${U.conditionName}`, ne = ci(
|
|
3165
3186
|
l.values,
|
|
3166
3187
|
M,
|
|
3167
3188
|
U.conditionName
|
|
3168
|
-
), kt =
|
|
3189
|
+
), kt = ui(
|
|
3169
3190
|
l.values,
|
|
3170
3191
|
M,
|
|
3171
3192
|
U.conditionName
|
|
3172
|
-
), ot = ne !== void 0 ? ne : kt, rt = ot !== void 0 ? ot : Me(
|
|
3193
|
+
), ot = ne !== void 0 ? ne : kt, rt = ot !== void 0 ? ot : Me(he);
|
|
3173
3194
|
return {
|
|
3174
3195
|
...U,
|
|
3175
3196
|
__originalConditionName: U.conditionName,
|
|
3176
3197
|
__groupKey: M,
|
|
3177
|
-
__howToSet:
|
|
3198
|
+
__howToSet: he,
|
|
3178
3199
|
__scopedName: z,
|
|
3179
3200
|
conditionName: U.conditionName,
|
|
3180
3201
|
groupKey: M,
|
|
3181
|
-
labelName:
|
|
3202
|
+
labelName: ye,
|
|
3182
3203
|
__unitAfterInput: be,
|
|
3183
3204
|
value: rt
|
|
3184
3205
|
};
|
|
3185
3206
|
});
|
|
3186
3207
|
return [M, X];
|
|
3187
3208
|
});
|
|
3188
|
-
return Object.fromEntries(
|
|
3209
|
+
return Object.fromEntries(P);
|
|
3189
3210
|
}, [g, l.values]), $ = R[A] ?? [], ae = R["group-primary"] ?? [], le = {
|
|
3190
3211
|
decisionDataType: t.decisionDataType,
|
|
3191
3212
|
howToSetTheCondition: t.howToSetTheDecision,
|
|
3192
3213
|
labelName: t.labelName,
|
|
3193
3214
|
listOfPossibleValues: t.listOfPossibleValues,
|
|
3194
3215
|
ruleName: t.ruleName,
|
|
3195
|
-
timeUnit: t.timeUnit ?
|
|
3196
|
-
}, Re = l.submitCount > 0 || !!l.touched.effectiveFrom, Je = l.submitCount > 0 || !!l.touched.validUntil, Ze = Re ? l.errors.effectiveFrom ? "invalid" : "valid" : void 0, xt = Je ? l.errors.validUntil ? "invalid" : "valid" : void 0, Ke =
|
|
3216
|
+
timeUnit: t.timeUnit ? Pt("", t.timeUnit, !0).trim() : ""
|
|
3217
|
+
}, Re = l.submitCount > 0 || !!l.touched.effectiveFrom, Je = l.submitCount > 0 || !!l.touched.validUntil, Ze = Re ? l.errors.effectiveFrom ? "invalid" : "valid" : void 0, xt = Je ? l.errors.validUntil ? "invalid" : "valid" : void 0, Ke = _.useMemo(() => {
|
|
3197
3218
|
const x = l.errors.conditionsThatEstablishesTheDecision;
|
|
3198
3219
|
if (!x) return;
|
|
3199
3220
|
if (typeof x == "string") return x;
|
|
3200
|
-
const L = (
|
|
3201
|
-
if (
|
|
3202
|
-
if (typeof
|
|
3203
|
-
if (Array.isArray(
|
|
3204
|
-
for (const M of
|
|
3221
|
+
const L = (P) => {
|
|
3222
|
+
if (P) {
|
|
3223
|
+
if (typeof P == "string") return P;
|
|
3224
|
+
if (Array.isArray(P))
|
|
3225
|
+
for (const M of P) {
|
|
3205
3226
|
const W = L(M);
|
|
3206
3227
|
if (W) return W;
|
|
3207
3228
|
}
|
|
3208
|
-
else if (typeof
|
|
3209
|
-
for (const M of Object.values(
|
|
3229
|
+
else if (typeof P == "object")
|
|
3230
|
+
for (const M of Object.values(P)) {
|
|
3210
3231
|
const W = L(M);
|
|
3211
3232
|
if (W) return W;
|
|
3212
3233
|
}
|
|
@@ -3216,25 +3237,25 @@ const Oe = (e) => {
|
|
|
3216
3237
|
}, [l.errors.conditionsThatEstablishesTheDecision]), Dt = l.submitCount > 0 && !!Ke, et = (x) => {
|
|
3217
3238
|
const L = (x == null ? void 0 : x.__howToSet) ?? Oe(x == null ? void 0 : x.howToSetTheCondition);
|
|
3218
3239
|
return Me(L);
|
|
3219
|
-
}, tt = (x, L,
|
|
3220
|
-
var U, me, se,
|
|
3240
|
+
}, tt = (x, L, P) => {
|
|
3241
|
+
var U, me, se, he, ye;
|
|
3221
3242
|
const M = `conditionsThatEstablishesTheDecision.${x}.${L}`, W = (se = (me = (U = l.values) == null ? void 0 : U.conditionsThatEstablishesTheDecision) == null ? void 0 : me[x]) == null ? void 0 : se[L];
|
|
3222
|
-
W && typeof W == "object" && !Array.isArray(W) ? l.setFieldValue(`${M}.value`,
|
|
3223
|
-
const X = (
|
|
3243
|
+
W && typeof W == "object" && !Array.isArray(W) ? l.setFieldValue(`${M}.value`, P, !1) : l.setFieldValue(M, P, !1);
|
|
3244
|
+
const X = (he = l.values) == null ? void 0 : he.conditionGroups;
|
|
3224
3245
|
if (Array.isArray(X)) {
|
|
3225
3246
|
const be = X.findIndex((z) => (z == null ? void 0 : z.ConditionGroupId) === x);
|
|
3226
3247
|
if (be >= 0) {
|
|
3227
|
-
const z = (
|
|
3248
|
+
const z = (ye = X[be].conditionsThatEstablishesTheDecision) == null ? void 0 : ye.findIndex(
|
|
3228
3249
|
(ne) => (ne == null ? void 0 : ne.conditionName) === L
|
|
3229
3250
|
);
|
|
3230
3251
|
if (z >= 0) {
|
|
3231
3252
|
const ne = JSON.parse(JSON.stringify(X));
|
|
3232
|
-
ne[be].conditionsThatEstablishesTheDecision[z].value =
|
|
3253
|
+
ne[be].conditionsThatEstablishesTheDecision[z].value = P, l.setFieldValue("conditionGroups", ne, !1);
|
|
3233
3254
|
}
|
|
3234
3255
|
}
|
|
3235
3256
|
}
|
|
3236
3257
|
}, wt = (x) => {
|
|
3237
|
-
const [L, ...
|
|
3258
|
+
const [L, ...P] = x.split("."), M = P.join("."), W = Object.values(c).flat().find((U) => U.conditionName === M), X = et(W || {});
|
|
3238
3259
|
tt(L, M, X), l.setFieldTouched(
|
|
3239
3260
|
`conditionsThatEstablishesTheDecision.${L}.${M}`,
|
|
3240
3261
|
!1,
|
|
@@ -3242,12 +3263,12 @@ const Oe = (e) => {
|
|
|
3242
3263
|
);
|
|
3243
3264
|
}, nt = () => {
|
|
3244
3265
|
(c[A] ?? []).forEach((L) => {
|
|
3245
|
-
const
|
|
3266
|
+
const P = Oe(L == null ? void 0 : L.howToSetTheCondition), M = Me(P);
|
|
3246
3267
|
tt(A, L.conditionName, M);
|
|
3247
3268
|
});
|
|
3248
|
-
}, [Ct, Le] =
|
|
3269
|
+
}, [Ct, Le] = _.useState(!1);
|
|
3249
3270
|
return /* @__PURE__ */ a(
|
|
3250
|
-
|
|
3271
|
+
ei,
|
|
3251
3272
|
{
|
|
3252
3273
|
activeTab: S,
|
|
3253
3274
|
conditionsErrorText: Ke,
|
|
@@ -3282,7 +3303,7 @@ const Oe = (e) => {
|
|
|
3282
3303
|
}
|
|
3283
3304
|
}
|
|
3284
3305
|
);
|
|
3285
|
-
},
|
|
3306
|
+
}, vl = (e) => {
|
|
3286
3307
|
const {
|
|
3287
3308
|
cardTitle: t = !0,
|
|
3288
3309
|
controls: n = !0,
|
|
@@ -3303,7 +3324,7 @@ const Oe = (e) => {
|
|
|
3303
3324
|
onRestoreConditions: w,
|
|
3304
3325
|
baseDecisionTemplate: D,
|
|
3305
3326
|
shouldRenderEmptyMessage: S = !0
|
|
3306
|
-
} = e, [N, C] = B(null), A = ue("(max-width: 681px)"), { renderedCards: R, shouldRenderAddCard: $ } =
|
|
3327
|
+
} = e, [N, C] = B(null), A = ue("(max-width: 681px)"), { renderedCards: R, shouldRenderAddCard: $ } = jr({
|
|
3307
3328
|
cardTitle: t,
|
|
3308
3329
|
controls: n,
|
|
3309
3330
|
customTitleContentAddCard: o,
|
|
@@ -3316,7 +3337,7 @@ const Oe = (e) => {
|
|
|
3316
3337
|
toggleAt: (le) => C((Re) => Re === le ? null : le)
|
|
3317
3338
|
}), ae = (i == null ? void 0 : i.length) === 0 && !p;
|
|
3318
3339
|
return /* @__PURE__ */ m(V, { children: [
|
|
3319
|
-
/* @__PURE__ */ a(
|
|
3340
|
+
/* @__PURE__ */ a(Lr, { children: /* @__PURE__ */ a(Or, { children: /* @__PURE__ */ a(y, { direction: "column", gap: "16px", padding: "6px", children: S && (ae ? /* @__PURE__ */ a(Ve, { legend: "Decisiones", children: /* @__PURE__ */ m(
|
|
3320
3341
|
y,
|
|
3321
3342
|
{
|
|
3322
3343
|
direction: "column",
|
|
@@ -3329,7 +3350,7 @@ const Oe = (e) => {
|
|
|
3329
3350
|
G,
|
|
3330
3351
|
{
|
|
3331
3352
|
appearance: "help",
|
|
3332
|
-
icon: /* @__PURE__ */ a(
|
|
3353
|
+
icon: /* @__PURE__ */ a(Wn, {}),
|
|
3333
3354
|
size: "40px"
|
|
3334
3355
|
}
|
|
3335
3356
|
),
|
|
@@ -3380,14 +3401,14 @@ const Oe = (e) => {
|
|
|
3380
3401
|
}
|
|
3381
3402
|
)) }) }) }),
|
|
3382
3403
|
l && /* @__PURE__ */ a(
|
|
3383
|
-
|
|
3404
|
+
Hr,
|
|
3384
3405
|
{
|
|
3385
3406
|
portalId: "modal-portal",
|
|
3386
3407
|
onCloseModal: h,
|
|
3387
3408
|
title: u ? "Editar Decisión" : "Configurar Decisión",
|
|
3388
3409
|
description: "Diligencia los campos para configurar tu decisión.",
|
|
3389
3410
|
children: /* @__PURE__ */ a(
|
|
3390
|
-
|
|
3411
|
+
pi,
|
|
3391
3412
|
{
|
|
3392
3413
|
decision: u || d,
|
|
3393
3414
|
fullTemplate: D ?? d,
|
|
@@ -3402,16 +3423,16 @@ const Oe = (e) => {
|
|
|
3402
3423
|
}
|
|
3403
3424
|
)
|
|
3404
3425
|
] });
|
|
3405
|
-
},
|
|
3426
|
+
}, hi = {
|
|
3406
3427
|
border: {
|
|
3407
3428
|
color: I.palette.neutral.N40
|
|
3408
3429
|
}
|
|
3409
|
-
},
|
|
3430
|
+
}, gi = E.div`
|
|
3410
3431
|
border-width: 1px;
|
|
3411
3432
|
border-style: solid;
|
|
3412
3433
|
border-color: ${({ theme: e }) => {
|
|
3413
3434
|
var t, n;
|
|
3414
|
-
return ((n = (t = e == null ? void 0 : e.box) == null ? void 0 : t.border) == null ? void 0 : n.color) ||
|
|
3435
|
+
return ((n = (t = e == null ? void 0 : e.box) == null ? void 0 : t.border) == null ? void 0 : n.color) || hi.border.color;
|
|
3415
3436
|
}};
|
|
3416
3437
|
border-radius: ${({ $borderRadius: e }) => e};
|
|
3417
3438
|
margin: ${({ $margin: e }) => e};
|
|
@@ -3420,7 +3441,7 @@ const Oe = (e) => {
|
|
|
3420
3441
|
height: ${({ $height: e }) => e};
|
|
3421
3442
|
box-sizing: border-box;
|
|
3422
3443
|
`;
|
|
3423
|
-
function
|
|
3444
|
+
function fi(e) {
|
|
3424
3445
|
const {
|
|
3425
3446
|
children: t,
|
|
3426
3447
|
padding: n = "16px",
|
|
@@ -3430,7 +3451,7 @@ function pi(e) {
|
|
|
3430
3451
|
height: s
|
|
3431
3452
|
} = e;
|
|
3432
3453
|
return /* @__PURE__ */ a(
|
|
3433
|
-
|
|
3454
|
+
gi,
|
|
3434
3455
|
{
|
|
3435
3456
|
$padding: n,
|
|
3436
3457
|
$margin: o,
|
|
@@ -3441,7 +3462,7 @@ function pi(e) {
|
|
|
3441
3462
|
}
|
|
3442
3463
|
);
|
|
3443
3464
|
}
|
|
3444
|
-
const
|
|
3465
|
+
const mi = (e, t) => {
|
|
3445
3466
|
const [n, o] = B([]), [r, i] = B([]), [s, d] = B(!1), l = je(null);
|
|
3446
3467
|
return Be(() => {
|
|
3447
3468
|
if (!e.current || !l.current) return;
|
|
@@ -3468,19 +3489,19 @@ E.div`
|
|
|
3468
3489
|
width: 100%;
|
|
3469
3490
|
}
|
|
3470
3491
|
`;
|
|
3471
|
-
const
|
|
3492
|
+
const bi = E.div`
|
|
3472
3493
|
position: absolute;
|
|
3473
3494
|
top: calc(100% + 4px);
|
|
3474
3495
|
right: 0;
|
|
3475
3496
|
z-index: 1000;
|
|
3476
3497
|
width: 170px;
|
|
3477
|
-
`,
|
|
3498
|
+
`, vi = E.div`
|
|
3478
3499
|
position: absolute;
|
|
3479
3500
|
visibility: hidden;
|
|
3480
3501
|
pointer-events: none;
|
|
3481
3502
|
height: 0;
|
|
3482
3503
|
overflow: hidden;
|
|
3483
|
-
`,
|
|
3504
|
+
`, yi = E.div`
|
|
3484
3505
|
cursor: pointer;
|
|
3485
3506
|
`, Ut = {
|
|
3486
3507
|
border: {
|
|
@@ -3518,7 +3539,7 @@ const gi = E.div`
|
|
|
3518
3539
|
hover: I.palette.neutral.N30
|
|
3519
3540
|
}
|
|
3520
3541
|
}
|
|
3521
|
-
},
|
|
3542
|
+
}, Ti = E.li`
|
|
3522
3543
|
display: flex;
|
|
3523
3544
|
align-items: center;
|
|
3524
3545
|
align-self: stretch;
|
|
@@ -3536,11 +3557,11 @@ const gi = E.div`
|
|
|
3536
3557
|
return ((o = (n = (t = e == null ? void 0 : e.input) == null ? void 0 : t.background) == null ? void 0 : n.color) == null ? void 0 : o.regular) || Ut.background.color.regular;
|
|
3537
3558
|
}};
|
|
3538
3559
|
}
|
|
3539
|
-
`,
|
|
3560
|
+
`, xi = (e) => {
|
|
3540
3561
|
var h, g, f, v, T, w;
|
|
3541
|
-
const { id: t, label: n, leadingIcon: o, onClose: r } = e, [i, s] = B(!1), d = () => s(!0), l = () => s(!1), u = oo
|
|
3562
|
+
const { id: t, label: n, leadingIcon: o, onClose: r } = e, [i, s] = B(!1), d = () => s(!0), l = () => s(!1), u = ro(oo), p = ((f = (g = (h = u == null ? void 0 : u.input) == null ? void 0 : h.option) == null ? void 0 : g.appearance) == null ? void 0 : f.hover) ?? Ut.option.appearance.hover, c = ((w = (T = (v = u == null ? void 0 : u.input) == null ? void 0 : v.option) == null ? void 0 : T.appearance) == null ? void 0 : w.regular) ?? Ut.option.appearance.regular;
|
|
3542
3563
|
return /* @__PURE__ */ a(
|
|
3543
|
-
|
|
3564
|
+
Ti,
|
|
3544
3565
|
{
|
|
3545
3566
|
id: t,
|
|
3546
3567
|
onMouseEnter: d,
|
|
@@ -3576,7 +3597,7 @@ const gi = E.div`
|
|
|
3576
3597
|
/* @__PURE__ */ a(
|
|
3577
3598
|
G,
|
|
3578
3599
|
{
|
|
3579
|
-
icon: /* @__PURE__ */ a(
|
|
3600
|
+
icon: /* @__PURE__ */ a(Yn, {}),
|
|
3580
3601
|
size: "small",
|
|
3581
3602
|
onClick: (D) => {
|
|
3582
3603
|
D.stopPropagation(), r == null || r();
|
|
@@ -3590,7 +3611,7 @@ const gi = E.div`
|
|
|
3590
3611
|
)
|
|
3591
3612
|
}
|
|
3592
3613
|
);
|
|
3593
|
-
},
|
|
3614
|
+
}, yl = (e) => {
|
|
3594
3615
|
const {
|
|
3595
3616
|
appliedFilters: t = [],
|
|
3596
3617
|
onClear: n,
|
|
@@ -3603,7 +3624,7 @@ const gi = E.div`
|
|
|
3603
3624
|
hidden: c,
|
|
3604
3625
|
showOverflowIndicator: h,
|
|
3605
3626
|
measurementRef: g
|
|
3606
|
-
} =
|
|
3627
|
+
} = mi(d, t), [f, v] = B(!1), T = (C) => {
|
|
3607
3628
|
C.stopPropagation(), v((A) => !A);
|
|
3608
3629
|
};
|
|
3609
3630
|
Be(() => {
|
|
@@ -3623,9 +3644,9 @@ const gi = E.div`
|
|
|
3623
3644
|
var A, R;
|
|
3624
3645
|
(R = (A = c.find(($) => $.label === C)) == null ? void 0 : A.onClose) == null || R.call(A), v(!1);
|
|
3625
3646
|
};
|
|
3626
|
-
return /* @__PURE__ */ m(
|
|
3627
|
-
/* @__PURE__ */ a(
|
|
3628
|
-
|
|
3647
|
+
return /* @__PURE__ */ m(fi, { borderRadius: "8px", width: "100%", children: [
|
|
3648
|
+
/* @__PURE__ */ a(vi, { ref: g, children: t.map((C) => /* @__PURE__ */ a("div", { "data-filter-tag": "true", children: /* @__PURE__ */ a(
|
|
3649
|
+
_e,
|
|
3629
3650
|
{
|
|
3630
3651
|
appearance: "primary",
|
|
3631
3652
|
displayIcon: !0,
|
|
@@ -3650,7 +3671,7 @@ const gi = E.div`
|
|
|
3650
3671
|
border: !0,
|
|
3651
3672
|
children: w ? /* @__PURE__ */ a(F, { size: "small", type: "label", appearance: "gray", children: r }) : /* @__PURE__ */ m(V, { children: [
|
|
3652
3673
|
p.map((C) => /* @__PURE__ */ a(
|
|
3653
|
-
|
|
3674
|
+
_e,
|
|
3654
3675
|
{
|
|
3655
3676
|
"data-filter-tag": "true",
|
|
3656
3677
|
appearance: "primary",
|
|
@@ -3668,20 +3689,20 @@ const gi = E.div`
|
|
|
3668
3689
|
ref: u,
|
|
3669
3690
|
style: { position: "relative", display: "inline-block" },
|
|
3670
3691
|
children: [
|
|
3671
|
-
/* @__PURE__ */ a(
|
|
3672
|
-
|
|
3692
|
+
/* @__PURE__ */ a(yi, { onClick: T, children: /* @__PURE__ */ a(
|
|
3693
|
+
_e,
|
|
3673
3694
|
{
|
|
3674
3695
|
appearance: "primary",
|
|
3675
3696
|
label: `+${c.length}`
|
|
3676
3697
|
}
|
|
3677
3698
|
) }),
|
|
3678
|
-
D && /* @__PURE__ */ a(
|
|
3679
|
-
|
|
3699
|
+
D && /* @__PURE__ */ a(bi, { ref: l, children: /* @__PURE__ */ a(
|
|
3700
|
+
to,
|
|
3680
3701
|
{
|
|
3681
3702
|
options: S,
|
|
3682
3703
|
onOptionClick: N,
|
|
3683
3704
|
children: c.map((C) => /* @__PURE__ */ a(
|
|
3684
|
-
|
|
3705
|
+
xi,
|
|
3685
3706
|
{
|
|
3686
3707
|
id: C.label,
|
|
3687
3708
|
label: C.label,
|
|
@@ -3706,7 +3727,7 @@ const gi = E.div`
|
|
|
3706
3727
|
{
|
|
3707
3728
|
cursorHover: !0,
|
|
3708
3729
|
disabled: w,
|
|
3709
|
-
iconBefore: /* @__PURE__ */ a(
|
|
3730
|
+
iconBefore: /* @__PURE__ */ a(Xn, {}),
|
|
3710
3731
|
onClick: n,
|
|
3711
3732
|
variant: "outlined",
|
|
3712
3733
|
children: i
|
|
@@ -3716,7 +3737,7 @@ const gi = E.div`
|
|
|
3716
3737
|
Q,
|
|
3717
3738
|
{
|
|
3718
3739
|
cursorHover: !0,
|
|
3719
|
-
iconBefore: /* @__PURE__ */ a(
|
|
3740
|
+
iconBefore: /* @__PURE__ */ a(xn, {}),
|
|
3720
3741
|
onClick: o,
|
|
3721
3742
|
variant: "outlined",
|
|
3722
3743
|
children: s
|
|
@@ -3724,12 +3745,12 @@ const gi = E.div`
|
|
|
3724
3745
|
)
|
|
3725
3746
|
] })
|
|
3726
3747
|
] });
|
|
3727
|
-
},
|
|
3748
|
+
}, Tl = (e) => {
|
|
3728
3749
|
const { appliedFilters: t, fields: n, onChange: o, noFiltersLabel: r } = e, i = ue("(max-width: 768px)"), s = !t || t.length === 0;
|
|
3729
3750
|
return /* @__PURE__ */ m(y, { direction: "column", gap: "16px", children: [
|
|
3730
3751
|
i && /* @__PURE__ */ m(V, { children: [
|
|
3731
3752
|
/* @__PURE__ */ m(y, { gap: "6px", width: "100%", alignItems: "center", children: [
|
|
3732
|
-
/* @__PURE__ */ a(G, { appearance: "gray", icon: /* @__PURE__ */ a(
|
|
3753
|
+
/* @__PURE__ */ a(G, { appearance: "gray", icon: /* @__PURE__ */ a(xn, {}) }),
|
|
3733
3754
|
/* @__PURE__ */ a(
|
|
3734
3755
|
ce,
|
|
3735
3756
|
{
|
|
@@ -3743,7 +3764,7 @@ const gi = E.div`
|
|
|
3743
3764
|
width: "100%",
|
|
3744
3765
|
height: "36px",
|
|
3745
3766
|
children: s ? /* @__PURE__ */ a(F, { size: "small", type: "label", appearance: "gray", children: r }) : t == null ? void 0 : t.map((d) => /* @__PURE__ */ a(
|
|
3746
|
-
|
|
3767
|
+
_e,
|
|
3747
3768
|
{
|
|
3748
3769
|
appearance: "primary",
|
|
3749
3770
|
displayIcon: !0,
|
|
@@ -3762,7 +3783,7 @@ const gi = E.div`
|
|
|
3762
3783
|
n.map((d) => /* @__PURE__ */ m(y, { gap: "6px", alignItems: "center", children: [
|
|
3763
3784
|
/* @__PURE__ */ a(y, { padding: "22px 0 0 0", children: /* @__PURE__ */ a(G, { appearance: "primary", icon: d.icon }) }),
|
|
3764
3785
|
/* @__PURE__ */ a(
|
|
3765
|
-
|
|
3786
|
+
no,
|
|
3766
3787
|
{
|
|
3767
3788
|
disabled: d.disabled,
|
|
3768
3789
|
invalid: d.invalid,
|
|
@@ -3780,12 +3801,12 @@ const gi = E.div`
|
|
|
3780
3801
|
)
|
|
3781
3802
|
] }, d.name))
|
|
3782
3803
|
] });
|
|
3783
|
-
},
|
|
3804
|
+
}, Di = (e) => {
|
|
3784
3805
|
const t = [];
|
|
3785
3806
|
return e.from !== void 0 && e.from !== null && t.push(`>${e.from}`), e.to !== void 0 && e.to !== null && t.push(`<${e.to}`), t.join(";");
|
|
3786
|
-
},
|
|
3807
|
+
}, xl = (e) => {
|
|
3787
3808
|
var s;
|
|
3788
|
-
const { decision: t, fallbackId: n, template: o } = e, r = (d) => typeof d == "object" && d !== null && "from" in d && "to" in d ?
|
|
3809
|
+
const { decision: t, fallbackId: n, template: o } = e, r = (d) => typeof d == "object" && d !== null && "from" in d && "to" in d ? Di(d) : d, i = ((s = t.conditionsThatEstablishesTheDecision) == null ? void 0 : s.map((d, l) => {
|
|
3789
3810
|
var c;
|
|
3790
3811
|
const u = d == null ? void 0 : d.value;
|
|
3791
3812
|
return u == null || typeof u == "string" && u.trim() === "" || Array.isArray(u) && u.length === 0 ? null : {
|
|
@@ -3801,7 +3822,7 @@ const gi = E.div`
|
|
|
3801
3822
|
value: r(t.value),
|
|
3802
3823
|
conditionsThatEstablishesTheDecision: i
|
|
3803
3824
|
};
|
|
3804
|
-
},
|
|
3825
|
+
}, Dl = (e) => {
|
|
3805
3826
|
if (typeof e != "string") return e;
|
|
3806
3827
|
const t = e.split(";").map((o) => o.trim()), n = {};
|
|
3807
3828
|
for (const o of t)
|
|
@@ -3813,7 +3834,7 @@ const gi = E.div`
|
|
|
3813
3834
|
isNaN(r) || (n.to = r);
|
|
3814
3835
|
}
|
|
3815
3836
|
return n.from !== void 0 || n.to !== void 0 ? n : e;
|
|
3816
|
-
},
|
|
3837
|
+
}, wl = (e) => {
|
|
3817
3838
|
const { dataDecision: t, originalDecision: n } = e, o = {
|
|
3818
3839
|
conditionName: t.ruleName || "",
|
|
3819
3840
|
labelName: t.labelName || "",
|
|
@@ -3829,7 +3850,7 @@ const gi = E.div`
|
|
|
3829
3850
|
(r) => r.hidden ? { ...o } : r
|
|
3830
3851
|
)
|
|
3831
3852
|
};
|
|
3832
|
-
},
|
|
3853
|
+
}, Cl = (e) => {
|
|
3833
3854
|
const { decisions: t } = e;
|
|
3834
3855
|
return t == null ? void 0 : t.map((n) => {
|
|
3835
3856
|
var r;
|
|
@@ -3848,15 +3869,15 @@ const gi = E.div`
|
|
|
3848
3869
|
)
|
|
3849
3870
|
} : n;
|
|
3850
3871
|
});
|
|
3851
|
-
},
|
|
3852
|
-
schema:
|
|
3872
|
+
}, wi = (e) => ({
|
|
3873
|
+
schema: ge().required("Requerido").test(
|
|
3853
3874
|
"non-empty",
|
|
3854
3875
|
"El valor no puede estar vacío",
|
|
3855
3876
|
(t) => t != null && t.trim() !== ""
|
|
3856
3877
|
),
|
|
3857
3878
|
value: e
|
|
3858
|
-
}),
|
|
3859
|
-
schema:
|
|
3879
|
+
}), Ci = (e) => ({
|
|
3880
|
+
schema: ve().test(
|
|
3860
3881
|
"isArrayOrString",
|
|
3861
3882
|
"Debe ser un array de strings/numbers o un solo string",
|
|
3862
3883
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -3864,8 +3885,8 @@ const gi = E.div`
|
|
|
3864
3885
|
) : typeof t == "string"
|
|
3865
3886
|
),
|
|
3866
3887
|
value: e
|
|
3867
|
-
}),
|
|
3868
|
-
schema:
|
|
3888
|
+
}), Si = (e) => ({
|
|
3889
|
+
schema: ve().test(
|
|
3869
3890
|
"isArrayOrString",
|
|
3870
3891
|
"Debe ser un array de strings/numbers o un solo string ",
|
|
3871
3892
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -3873,12 +3894,12 @@ const gi = E.div`
|
|
|
3873
3894
|
) : typeof t == "string"
|
|
3874
3895
|
),
|
|
3875
3896
|
value: e
|
|
3876
|
-
}),
|
|
3897
|
+
}), Ei = (e) => {
|
|
3877
3898
|
const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
|
|
3878
3899
|
return {
|
|
3879
3900
|
schema: te({
|
|
3880
|
-
from:
|
|
3881
|
-
to:
|
|
3901
|
+
from: pe().required("El campo 'Rango desde' es requerido").max(n, "'Rango desde' no puede ser mayor que 'Rango hasta'").min(0, "'Rango desde' no puede ser menor que 0"),
|
|
3902
|
+
to: pe().min(0, "El campo 'Rango hasta' debe ser mayor o igual a 0").required("El campo 'Rango hasta' es requerido").test(
|
|
3882
3903
|
"is-greater",
|
|
3883
3904
|
"El campo 'Rango hasta' debe ser mayor que 'Rango desde'",
|
|
3884
3905
|
function(o) {
|
|
@@ -3890,20 +3911,20 @@ const gi = E.div`
|
|
|
3890
3911
|
value: { from: t, to: n }
|
|
3891
3912
|
};
|
|
3892
3913
|
}, $t = (e, t) => t === H.PERCENTAGE ? {
|
|
3893
|
-
schema:
|
|
3914
|
+
schema: pe().required("El campo tipo porcentaje es requerido").min(0, "El campo tipo porcentaje no puede ser menor que 0").max(100, "El campo tipo porcentaje no puede ser mayor que 100"),
|
|
3894
3915
|
value: e
|
|
3895
3916
|
} : {
|
|
3896
|
-
schema:
|
|
3917
|
+
schema: ge().required("Requerido"),
|
|
3897
3918
|
value: e
|
|
3898
|
-
},
|
|
3899
|
-
[k.LIST_OF_VALUES]:
|
|
3900
|
-
[k.LIST_OF_VALUES_MULTI]:
|
|
3901
|
-
[k.RANGE]:
|
|
3919
|
+
}, Ni = {
|
|
3920
|
+
[k.LIST_OF_VALUES]: Ci,
|
|
3921
|
+
[k.LIST_OF_VALUES_MULTI]: Si,
|
|
3922
|
+
[k.RANGE]: Ei,
|
|
3902
3923
|
[k.GREATER_THAN]: $t,
|
|
3903
3924
|
[k.LESS_THAN]: $t,
|
|
3904
3925
|
[k.EQUAL]: $t
|
|
3905
|
-
},
|
|
3906
|
-
function
|
|
3926
|
+
}, cn = (e) => Ni[e] || wi;
|
|
3927
|
+
function ki({
|
|
3907
3928
|
decision: e,
|
|
3908
3929
|
onSubmitEvent: t,
|
|
3909
3930
|
textValues: n
|
|
@@ -3922,8 +3943,8 @@ function Si({
|
|
|
3922
3943
|
};
|
|
3923
3944
|
let r;
|
|
3924
3945
|
const i = {
|
|
3925
|
-
ruleName:
|
|
3926
|
-
value: Ge(() =>
|
|
3946
|
+
ruleName: ge().required("El nombre de la regla es requerido"),
|
|
3947
|
+
value: Ge(() => cn(
|
|
3927
3948
|
r.values.howToSetTheDecision
|
|
3928
3949
|
)(
|
|
3929
3950
|
r.values.value,
|
|
@@ -3972,7 +3993,7 @@ function Si({
|
|
|
3972
3993
|
const c = ((h = e.conditionsThatEstablishesTheDecision) == null ? void 0 : h.reduce(
|
|
3973
3994
|
(g, f) => {
|
|
3974
3995
|
if (r.values.conditionsThatEstablishesTheDecision[f.conditionName] !== void 0) {
|
|
3975
|
-
const T =
|
|
3996
|
+
const T = cn(
|
|
3976
3997
|
f.howToSetTheCondition
|
|
3977
3998
|
);
|
|
3978
3999
|
g[f.conditionName] = T(
|
|
@@ -3987,9 +4008,9 @@ function Si({
|
|
|
3987
4008
|
return te(c);
|
|
3988
4009
|
})
|
|
3989
4010
|
};
|
|
3990
|
-
n.terms && (i.effectiveFrom =
|
|
4011
|
+
n.terms && (i.effectiveFrom = Ie().required(
|
|
3991
4012
|
"La fecha de inicio es requerida"
|
|
3992
|
-
), i.validUntil =
|
|
4013
|
+
), i.validUntil = Ie().when(
|
|
3993
4014
|
"checkClosed",
|
|
3994
4015
|
(l, u, { parent: p }) => (p == null ? void 0 : p.checkClosed) ? u.required("La fecha de finalización es requerida").test(
|
|
3995
4016
|
"is-after-startDate",
|
|
@@ -4043,7 +4064,7 @@ function Si({
|
|
|
4043
4064
|
});
|
|
4044
4065
|
} };
|
|
4045
4066
|
}
|
|
4046
|
-
const
|
|
4067
|
+
const Ai = E.div`
|
|
4047
4068
|
& > div {
|
|
4048
4069
|
border-radius: 8px;
|
|
4049
4070
|
border: 1px solid
|
|
@@ -4052,7 +4073,7 @@ const Ei = E.div`
|
|
|
4052
4073
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || I.palette.neutral.N30;
|
|
4053
4074
|
}};
|
|
4054
4075
|
}
|
|
4055
|
-
`,
|
|
4076
|
+
`, Ii = E.div`
|
|
4056
4077
|
width: 100%;
|
|
4057
4078
|
height: 100%;
|
|
4058
4079
|
overflow-y: auto;
|
|
@@ -4069,7 +4090,7 @@ const Ei = E.div`
|
|
|
4069
4090
|
background-color: #ebecf0;
|
|
4070
4091
|
border-radius: 8px;
|
|
4071
4092
|
}
|
|
4072
|
-
`,
|
|
4093
|
+
`, $i = (e) => {
|
|
4073
4094
|
const {
|
|
4074
4095
|
checked: t,
|
|
4075
4096
|
children: n,
|
|
@@ -4098,7 +4119,7 @@ const Ei = E.div`
|
|
|
4098
4119
|
) }),
|
|
4099
4120
|
l && /* @__PURE__ */ a(V, { children: n })
|
|
4100
4121
|
] });
|
|
4101
|
-
},
|
|
4122
|
+
}, Fi = (e) => {
|
|
4102
4123
|
const {
|
|
4103
4124
|
onHandleStartChange: t,
|
|
4104
4125
|
onHandleEndChange: n,
|
|
@@ -4160,7 +4181,7 @@ const Ei = E.div`
|
|
|
4160
4181
|
gap: "24px",
|
|
4161
4182
|
children: [
|
|
4162
4183
|
/* @__PURE__ */ a(
|
|
4163
|
-
|
|
4184
|
+
Ae,
|
|
4164
4185
|
{
|
|
4165
4186
|
id: "dateStart",
|
|
4166
4187
|
label: r,
|
|
@@ -4173,7 +4194,7 @@ const Ei = E.div`
|
|
|
4173
4194
|
}
|
|
4174
4195
|
),
|
|
4175
4196
|
f && /* @__PURE__ */ a(
|
|
4176
|
-
|
|
4197
|
+
Ae,
|
|
4177
4198
|
{
|
|
4178
4199
|
id: "dateEnd",
|
|
4179
4200
|
label: i,
|
|
@@ -4189,7 +4210,7 @@ const Ei = E.div`
|
|
|
4189
4210
|
}
|
|
4190
4211
|
)
|
|
4191
4212
|
] });
|
|
4192
|
-
},
|
|
4213
|
+
}, Ri = (e) => {
|
|
4193
4214
|
const {
|
|
4194
4215
|
formik: t,
|
|
4195
4216
|
textValues: n,
|
|
@@ -4209,7 +4230,7 @@ const Ei = E.div`
|
|
|
4209
4230
|
isDecision: !0
|
|
4210
4231
|
}),
|
|
4211
4232
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
4212
|
-
/* @__PURE__ */ a(
|
|
4233
|
+
/* @__PURE__ */ a(Ai, { children: /* @__PURE__ */ a(Ii, { children: /* @__PURE__ */ m(
|
|
4213
4234
|
y,
|
|
4214
4235
|
{
|
|
4215
4236
|
direction: "column",
|
|
@@ -4239,7 +4260,7 @@ const Ei = E.div`
|
|
|
4239
4260
|
}
|
|
4240
4261
|
),
|
|
4241
4262
|
/* @__PURE__ */ a(y, { direction: "column", gap: "20px", children: r == null ? void 0 : r.map((c) => /* @__PURE__ */ a(
|
|
4242
|
-
|
|
4263
|
+
$i,
|
|
4243
4264
|
{
|
|
4244
4265
|
id: `toggle-${c.conditionName}`,
|
|
4245
4266
|
name: `toggle.${c.conditionName}`,
|
|
@@ -4259,7 +4280,7 @@ const Ei = E.div`
|
|
|
4259
4280
|
n.terms && /* @__PURE__ */ m(V, { children: [
|
|
4260
4281
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
4261
4282
|
/* @__PURE__ */ a(
|
|
4262
|
-
|
|
4283
|
+
Fi,
|
|
4263
4284
|
{
|
|
4264
4285
|
labelStart: n.termStart,
|
|
4265
4286
|
labelEnd: n.termEnd,
|
|
@@ -4285,9 +4306,9 @@ const Ei = E.div`
|
|
|
4285
4306
|
/* @__PURE__ */ a(Q, { type: "submit", children: n.confirm })
|
|
4286
4307
|
] })
|
|
4287
4308
|
] }) });
|
|
4288
|
-
},
|
|
4309
|
+
}, Li = (e) => {
|
|
4289
4310
|
var g;
|
|
4290
|
-
const { decision: t, onSubmitEvent: n, textValues: o, onCancel: r } = e, { formik: i, handleToggleNoneChange: s } =
|
|
4311
|
+
const { decision: t, onSubmitEvent: n, textValues: o, onCancel: r } = e, { formik: i, handleToggleNoneChange: s } = ki({
|
|
4291
4312
|
decision: t,
|
|
4292
4313
|
onSubmitEvent: n,
|
|
4293
4314
|
textValues: o
|
|
@@ -4301,7 +4322,7 @@ const Ei = E.div`
|
|
|
4301
4322
|
(f) => !f.hidden
|
|
4302
4323
|
)) || [], u = !!i.errors.conditionsThatEstablishesTheDecision && i.submitCount > 0, p = i.touched.effectiveFrom ? i.errors.effectiveFrom ? "invalid" : "valid" : void 0, c = i.touched.validUntil ? i.errors.validUntil ? "invalid" : "valid" : void 0;
|
|
4303
4324
|
return /* @__PURE__ */ a(
|
|
4304
|
-
|
|
4325
|
+
Ri,
|
|
4305
4326
|
{
|
|
4306
4327
|
formik: i,
|
|
4307
4328
|
onCancel: r,
|
|
@@ -4333,7 +4354,7 @@ const Ei = E.div`
|
|
|
4333
4354
|
termEndStatus: c
|
|
4334
4355
|
}
|
|
4335
4356
|
);
|
|
4336
|
-
},
|
|
4357
|
+
}, Sl = (e) => {
|
|
4337
4358
|
var r;
|
|
4338
4359
|
const { decisionTemplate: t } = e, n = { ...t }, o = (r = n.conditionsThatEstablishesTheDecision) == null ? void 0 : r.find(
|
|
4339
4360
|
(i) => i.switchPlaces
|
|
@@ -4349,7 +4370,7 @@ const Ei = E.div`
|
|
|
4349
4370
|
(i) => i.conditionName === o.conditionName ? { ...i, hidden: !0 } : i
|
|
4350
4371
|
)
|
|
4351
4372
|
} : n;
|
|
4352
|
-
},
|
|
4373
|
+
}, El = (e) => {
|
|
4353
4374
|
const { decisions: t } = e;
|
|
4354
4375
|
return t == null ? void 0 : t.map((n) => {
|
|
4355
4376
|
var r;
|
|
@@ -4368,7 +4389,7 @@ const Ei = E.div`
|
|
|
4368
4389
|
)
|
|
4369
4390
|
} : n;
|
|
4370
4391
|
});
|
|
4371
|
-
},
|
|
4392
|
+
}, xe = {
|
|
4372
4393
|
item: {
|
|
4373
4394
|
background: {
|
|
4374
4395
|
active: I.palette.blue.B50,
|
|
@@ -4385,12 +4406,12 @@ const Ei = E.div`
|
|
|
4385
4406
|
color: I.palette.neutral.N0
|
|
4386
4407
|
}
|
|
4387
4408
|
}
|
|
4388
|
-
},
|
|
4409
|
+
}, Oi = E.div`
|
|
4389
4410
|
& > div {
|
|
4390
4411
|
border: 1px solid
|
|
4391
4412
|
${({ theme: e, $active: t }) => {
|
|
4392
4413
|
var n, o, r, i;
|
|
4393
|
-
return t ? ((o = (n = e == null ? void 0 : e.border) == null ? void 0 : n.expanded) == null ? void 0 : o.color) ||
|
|
4414
|
+
return t ? ((o = (n = e == null ? void 0 : e.border) == null ? void 0 : n.expanded) == null ? void 0 : o.color) || xe.border.expanded.color : ((i = (r = e == null ? void 0 : e.border) == null ? void 0 : r.contracted) == null ? void 0 : i.color) || xe.border.contracted.color;
|
|
4394
4415
|
}};
|
|
4395
4416
|
}
|
|
4396
4417
|
&:hover {
|
|
@@ -4398,44 +4419,44 @@ const Ei = E.div`
|
|
|
4398
4419
|
background-color: ${({ theme: e, $disabled: t }) => {
|
|
4399
4420
|
var n, o, r;
|
|
4400
4421
|
if (!t)
|
|
4401
|
-
return ((r = (o = (n = e == null ? void 0 : e.menu) == null ? void 0 : n.item) == null ? void 0 : o.background) == null ? void 0 : r.hover) ||
|
|
4422
|
+
return ((r = (o = (n = e == null ? void 0 : e.menu) == null ? void 0 : n.item) == null ? void 0 : o.background) == null ? void 0 : r.hover) || xe.item.background.hover;
|
|
4402
4423
|
}};
|
|
4403
4424
|
}
|
|
4404
|
-
`,
|
|
4425
|
+
`, un = E.div`
|
|
4405
4426
|
display: flex;
|
|
4406
4427
|
align-items: center;
|
|
4407
4428
|
gap: 12px;
|
|
4408
4429
|
width: 100%;
|
|
4409
4430
|
outline: none;
|
|
4410
4431
|
cursor: pointer;
|
|
4411
|
-
`,
|
|
4432
|
+
`, Mi = E.div`
|
|
4412
4433
|
display: flex;
|
|
4413
4434
|
align-items: center;
|
|
4414
4435
|
outline: none;
|
|
4415
4436
|
cursor: pointer;
|
|
4416
|
-
`,
|
|
4437
|
+
`, Pi = E(wn)`
|
|
4417
4438
|
display: flex;
|
|
4418
4439
|
align-items: center;
|
|
4419
4440
|
text-decoration: none;
|
|
4420
|
-
`,
|
|
4441
|
+
`, _i = E(wn)`
|
|
4421
4442
|
display: block;
|
|
4422
4443
|
text-decoration: none;
|
|
4423
4444
|
color: inherit;
|
|
4424
|
-
`,
|
|
4445
|
+
`, Vi = E.div`
|
|
4425
4446
|
& > div {
|
|
4426
4447
|
border-bottom: 1px solid
|
|
4427
4448
|
${({ theme: e, $active: t }) => {
|
|
4428
4449
|
var n, o, r, i;
|
|
4429
|
-
return t ? ((o = (n = e == null ? void 0 : e.border) == null ? void 0 : n.expanded) == null ? void 0 : o.color) ||
|
|
4450
|
+
return t ? ((o = (n = e == null ? void 0 : e.border) == null ? void 0 : n.expanded) == null ? void 0 : o.color) || xe.border.expanded.color : ((i = (r = e == null ? void 0 : e.border) == null ? void 0 : r.contracted) == null ? void 0 : i.color) || xe.border.contracted.color;
|
|
4430
4451
|
}};
|
|
4431
4452
|
border-radius: 8px 8px 0 0;
|
|
4432
4453
|
}
|
|
4433
|
-
`,
|
|
4454
|
+
`, An = E.div`
|
|
4434
4455
|
display: block;
|
|
4435
4456
|
text-decoration: none;
|
|
4436
4457
|
background-color: ${({ theme: e, $active: t }) => {
|
|
4437
4458
|
var n, o, r, i, s, d;
|
|
4438
|
-
return t ? ((r = (o = (n = e == null ? void 0 : e.menu) == null ? void 0 : n.item) == null ? void 0 : o.background) == null ? void 0 : r.active) ||
|
|
4459
|
+
return t ? ((r = (o = (n = e == null ? void 0 : e.menu) == null ? void 0 : n.item) == null ? void 0 : o.background) == null ? void 0 : r.active) || xe.item.background.active : ((d = (s = (i = e == null ? void 0 : e.menu) == null ? void 0 : i.item) == null ? void 0 : s.background) == null ? void 0 : d.inactive) || xe.item.background.inactive;
|
|
4439
4460
|
}};
|
|
4440
4461
|
&:last-child {
|
|
4441
4462
|
border-radius: 0 0 8px 8px;
|
|
@@ -4445,34 +4466,34 @@ const Ei = E.div`
|
|
|
4445
4466
|
background-color: ${({ $active: e, theme: t, $disabled: n }) => {
|
|
4446
4467
|
var o, r, i;
|
|
4447
4468
|
if (!n && !e)
|
|
4448
|
-
return ((i = (r = (o = t == null ? void 0 : t.menu) == null ? void 0 : o.item) == null ? void 0 : r.background) == null ? void 0 : i.hover) ||
|
|
4469
|
+
return ((i = (r = (o = t == null ? void 0 : t.menu) == null ? void 0 : o.item) == null ? void 0 : r.background) == null ? void 0 : i.hover) || xe.item.background.hover;
|
|
4449
4470
|
}};
|
|
4450
4471
|
}
|
|
4451
|
-
`,
|
|
4472
|
+
`, ji = E.div`
|
|
4452
4473
|
display: flex;
|
|
4453
4474
|
flex-direction: column;
|
|
4454
4475
|
|
|
4455
|
-
& > a:last-child ${
|
|
4476
|
+
& > a:last-child ${An} {
|
|
4456
4477
|
border-radius: 0 0 8px 8px;
|
|
4457
4478
|
}
|
|
4458
|
-
`,
|
|
4479
|
+
`, Ui = (e) => {
|
|
4459
4480
|
const { isOpen: t, links: n, onClick: o, title: r, activeId: i, headerPath: s, headerActive: d } = e, l = (f) => {
|
|
4460
4481
|
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), o());
|
|
4461
4482
|
}, u = (f) => {
|
|
4462
4483
|
f.preventDefault(), f.stopPropagation(), o();
|
|
4463
4484
|
}, p = (f) => {
|
|
4464
4485
|
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), f.stopPropagation(), o());
|
|
4465
|
-
}, c = t || d ? "primary" : "dark", h = t || d ? "bold" : "normal", g =
|
|
4466
|
-
return /* @__PURE__ */ a(
|
|
4486
|
+
}, c = t || d ? "primary" : "dark", h = t || d ? "bold" : "normal", g = _.useId();
|
|
4487
|
+
return /* @__PURE__ */ a(Oi, { $active: t, children: /* @__PURE__ */ m(ce, { border: !0, borderRadius: "8px", width: "100%", children: [
|
|
4467
4488
|
/* @__PURE__ */ a(
|
|
4468
|
-
|
|
4489
|
+
Vi,
|
|
4469
4490
|
{
|
|
4470
4491
|
$active: t && n.length > 0,
|
|
4471
4492
|
"aria-controls": g,
|
|
4472
4493
|
"aria-expanded": t,
|
|
4473
4494
|
onClick: u,
|
|
4474
4495
|
onKeyDown: p,
|
|
4475
|
-
children: s ? /* @__PURE__ */ a(
|
|
4496
|
+
children: s ? /* @__PURE__ */ a(Pi, { to: s, children: /* @__PURE__ */ m(
|
|
4476
4497
|
ce,
|
|
4477
4498
|
{
|
|
4478
4499
|
alignItems: "center",
|
|
@@ -4489,7 +4510,7 @@ const Ei = E.div`
|
|
|
4489
4510
|
icon: t && n.length > 0 ? /* @__PURE__ */ a(Lt, {}) : /* @__PURE__ */ a(Kt, {})
|
|
4490
4511
|
}
|
|
4491
4512
|
),
|
|
4492
|
-
/* @__PURE__ */ a(
|
|
4513
|
+
/* @__PURE__ */ a(un, { children: /* @__PURE__ */ a(
|
|
4493
4514
|
F,
|
|
4494
4515
|
{
|
|
4495
4516
|
appearance: c,
|
|
@@ -4519,8 +4540,8 @@ const Ei = E.div`
|
|
|
4519
4540
|
icon: t && n.length > 0 ? /* @__PURE__ */ a(Lt, {}) : /* @__PURE__ */ a(Kt, {})
|
|
4520
4541
|
}
|
|
4521
4542
|
),
|
|
4522
|
-
/* @__PURE__ */ a(
|
|
4523
|
-
|
|
4543
|
+
/* @__PURE__ */ a(un, { children: /* @__PURE__ */ a(
|
|
4544
|
+
Mi,
|
|
4524
4545
|
{
|
|
4525
4546
|
"aria-controls": g,
|
|
4526
4547
|
"aria-expanded": t,
|
|
@@ -4545,9 +4566,9 @@ const Ei = E.div`
|
|
|
4545
4566
|
)
|
|
4546
4567
|
}
|
|
4547
4568
|
),
|
|
4548
|
-
t && n.length > 0 && /* @__PURE__ */ a(
|
|
4569
|
+
t && n.length > 0 && /* @__PURE__ */ a(ji, { id: g, children: n.map((f) => {
|
|
4549
4570
|
const v = f.id === i;
|
|
4550
|
-
return /* @__PURE__ */ a(
|
|
4571
|
+
return /* @__PURE__ */ a(_i, { to: f.path, children: /* @__PURE__ */ a(An, { $active: v, children: /* @__PURE__ */ m(
|
|
4551
4572
|
y,
|
|
4552
4573
|
{
|
|
4553
4574
|
alignItems: "center",
|
|
@@ -4555,7 +4576,7 @@ const Ei = E.div`
|
|
|
4555
4576
|
gap: "8px",
|
|
4556
4577
|
padding: v ? "8px 4px" : "8px 32px",
|
|
4557
4578
|
children: [
|
|
4558
|
-
v && /* @__PURE__ */ a(G, { appearance: "primary", icon: /* @__PURE__ */ a(
|
|
4579
|
+
v && /* @__PURE__ */ a(G, { appearance: "primary", icon: /* @__PURE__ */ a(Qn, {}) }),
|
|
4559
4580
|
/* @__PURE__ */ a(
|
|
4560
4581
|
F,
|
|
4561
4582
|
{
|
|
@@ -4571,7 +4592,7 @@ const Ei = E.div`
|
|
|
4571
4592
|
) }) }, f.id);
|
|
4572
4593
|
}) })
|
|
4573
4594
|
] }) });
|
|
4574
|
-
},
|
|
4595
|
+
}, zi = E.div`
|
|
4575
4596
|
& > div {
|
|
4576
4597
|
background: ${({ $background: e, theme: t }) => {
|
|
4577
4598
|
var n, o, r, i;
|
|
@@ -4579,36 +4600,36 @@ const Ei = E.div`
|
|
|
4579
4600
|
}};
|
|
4580
4601
|
}
|
|
4581
4602
|
height: 90vh;
|
|
4582
|
-
`,
|
|
4603
|
+
`, Hi = (e, t) => {
|
|
4583
4604
|
var n;
|
|
4584
4605
|
for (const o of t)
|
|
4585
4606
|
if (o.path && (e === o.path || e.startsWith(o.path + "/")) || (n = o.links) != null && n.some((r) => r.path === e)) return o.id;
|
|
4586
4607
|
return null;
|
|
4587
|
-
},
|
|
4588
|
-
const { collapseOnNavigate: t = !1, defaultOpenId: n = null, groups: o } = e, r =
|
|
4608
|
+
}, Nl = (e) => {
|
|
4609
|
+
const { collapseOnNavigate: t = !1, defaultOpenId: n = null, groups: o } = e, r = io(), [i, s] = _.useState(n), d = _.useRef(r.pathname), l = _.useCallback(
|
|
4589
4610
|
(p) => {
|
|
4590
4611
|
var c;
|
|
4591
4612
|
return (c = p.find((h) => h.path === r.pathname)) == null ? void 0 : c.id;
|
|
4592
4613
|
},
|
|
4593
4614
|
[r.pathname]
|
|
4594
|
-
), u =
|
|
4615
|
+
), u = _.useCallback(
|
|
4595
4616
|
(p) => !!p && (r.pathname === p || r.pathname.startsWith(p + "/")),
|
|
4596
4617
|
[r.pathname]
|
|
4597
4618
|
);
|
|
4598
|
-
return
|
|
4619
|
+
return _.useEffect(() => {
|
|
4599
4620
|
if (!(d.current !== r.pathname)) return;
|
|
4600
4621
|
if (d.current = r.pathname, t) {
|
|
4601
4622
|
s(null);
|
|
4602
4623
|
return;
|
|
4603
4624
|
}
|
|
4604
|
-
const c =
|
|
4625
|
+
const c = Hi(r.pathname, o);
|
|
4605
4626
|
if (c) {
|
|
4606
4627
|
s(c);
|
|
4607
4628
|
return;
|
|
4608
4629
|
}
|
|
4609
4630
|
n && s(n);
|
|
4610
|
-
}, [t, n, o, r.pathname]), /* @__PURE__ */ a(
|
|
4611
|
-
|
|
4631
|
+
}, [t, n, o, r.pathname]), /* @__PURE__ */ a(zi, { $background: !0, children: /* @__PURE__ */ a(y, { direction: "column", gap: "8px", padding: "12px", height: "100%", children: o.map((p) => /* @__PURE__ */ a(
|
|
4632
|
+
Ui,
|
|
4612
4633
|
{
|
|
4613
4634
|
activeId: l(p.links),
|
|
4614
4635
|
headerPath: p.path,
|
|
@@ -4624,10 +4645,10 @@ const Ei = E.div`
|
|
|
4624
4645
|
function Z(e) {
|
|
4625
4646
|
e.preventDefault();
|
|
4626
4647
|
}
|
|
4627
|
-
function
|
|
4648
|
+
function Ce(e) {
|
|
4628
4649
|
e.stopPropagation();
|
|
4629
4650
|
}
|
|
4630
|
-
function
|
|
4651
|
+
function In() {
|
|
4631
4652
|
const e = /* @__PURE__ */ new Map();
|
|
4632
4653
|
return [function(o, r) {
|
|
4633
4654
|
e.get(o) && e.get(o).forEach((i) => {
|
|
@@ -4638,8 +4659,8 @@ function An() {
|
|
|
4638
4659
|
i.push(r), e.set(o, i);
|
|
4639
4660
|
}];
|
|
4640
4661
|
}
|
|
4641
|
-
var [
|
|
4642
|
-
function
|
|
4662
|
+
var [$n, Fn] = In();
|
|
4663
|
+
function Gi(e, t) {
|
|
4643
4664
|
return e.source === t.source && e.flags.split("").sort().join("") === t.flags.split("").sort().join("");
|
|
4644
4665
|
}
|
|
4645
4666
|
function qe(e, t, n = !0, o = ["__key"]) {
|
|
@@ -4649,7 +4670,7 @@ function qe(e, t, n = !0, o = ["__key"]) {
|
|
|
4649
4670
|
if (e instanceof Date && t instanceof Date)
|
|
4650
4671
|
return e.getTime() === t.getTime();
|
|
4651
4672
|
if (e instanceof RegExp && t instanceof RegExp)
|
|
4652
|
-
return
|
|
4673
|
+
return Gi(e, t);
|
|
4653
4674
|
if (e === null || t === null) return !1;
|
|
4654
4675
|
const r = e, i = t;
|
|
4655
4676
|
if (Object.keys(r).length !== Object.keys(i).length) return !1;
|
|
@@ -4661,7 +4682,7 @@ function qe(e, t, n = !0, o = ["__key"]) {
|
|
|
4661
4682
|
}
|
|
4662
4683
|
return !1;
|
|
4663
4684
|
}
|
|
4664
|
-
function
|
|
4685
|
+
function Rn(e) {
|
|
4665
4686
|
return e.split(" ").filter((t) => t);
|
|
4666
4687
|
}
|
|
4667
4688
|
function Fe(e) {
|
|
@@ -4669,22 +4690,22 @@ function Fe(e) {
|
|
|
4669
4690
|
}
|
|
4670
4691
|
Array();
|
|
4671
4692
|
var Zt = typeof window < "u", J = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakMap();
|
|
4672
|
-
function
|
|
4693
|
+
function Ln() {
|
|
4673
4694
|
if (!Zt) return !1;
|
|
4674
4695
|
if ("userAgentData" in navigator)
|
|
4675
4696
|
return navigator.userAgentData.mobile === !0;
|
|
4676
4697
|
const e = navigator.userAgent, t = /android|iphone|ipod/i.test(e), n = /iPad/.test(e) || e.includes("Macintosh") && navigator.maxTouchPoints > 1;
|
|
4677
4698
|
return t || n;
|
|
4678
4699
|
}
|
|
4679
|
-
var
|
|
4700
|
+
var Bi = {
|
|
4680
4701
|
affectedNodes: [],
|
|
4681
4702
|
coordinates: {
|
|
4682
4703
|
x: 0,
|
|
4683
4704
|
y: 0
|
|
4684
4705
|
},
|
|
4685
4706
|
currentTargetValue: void 0,
|
|
4686
|
-
on:
|
|
4687
|
-
emit:
|
|
4707
|
+
on: Fn,
|
|
4708
|
+
emit: $n,
|
|
4688
4709
|
originalZIndex: void 0,
|
|
4689
4710
|
pointerSelection: !1,
|
|
4690
4711
|
preventEnter: !1,
|
|
@@ -4710,16 +4731,16 @@ var zi = {
|
|
|
4710
4731
|
scrollDebounceTimeout: void 0,
|
|
4711
4732
|
frameIdX: void 0,
|
|
4712
4733
|
frameIdY: void 0
|
|
4713
|
-
}, b =
|
|
4714
|
-
function
|
|
4734
|
+
}, b = Bi, we = !1, pn, Ft;
|
|
4735
|
+
function qi() {
|
|
4715
4736
|
b.scrollDebounceTimeout && clearTimeout(b.scrollDebounceTimeout), b.longPressTimeout && clearTimeout(b.longPressTimeout), b.frameIdX !== void 0 && cancelAnimationFrame(b.frameIdX), b.frameIdY !== void 0 && cancelAnimationFrame(b.frameIdY), b = { ...{
|
|
4716
4737
|
affectedNodes: [],
|
|
4717
4738
|
coordinates: {
|
|
4718
4739
|
x: 0,
|
|
4719
4740
|
y: 0
|
|
4720
4741
|
},
|
|
4721
|
-
on:
|
|
4722
|
-
emit:
|
|
4742
|
+
on: Fn,
|
|
4743
|
+
emit: $n,
|
|
4723
4744
|
currentTargetValue: void 0,
|
|
4724
4745
|
originalZIndex: void 0,
|
|
4725
4746
|
pointerId: void 0,
|
|
@@ -4752,38 +4773,38 @@ function Hi() {
|
|
|
4752
4773
|
frameIdY: void 0
|
|
4753
4774
|
} };
|
|
4754
4775
|
}
|
|
4755
|
-
function
|
|
4756
|
-
return Object.assign(b, e), e.initialParent.data.emit("dragStarted", b),
|
|
4776
|
+
function On(e) {
|
|
4777
|
+
return Object.assign(b, e), e.initialParent.data.emit("dragStarted", b), we = !1, b.emit("dragStarted", b), b;
|
|
4757
4778
|
}
|
|
4758
|
-
function
|
|
4759
|
-
b.activeState &&
|
|
4779
|
+
function Wi() {
|
|
4780
|
+
b.activeState && Ee(b.activeState.parent, void 0, b), b.selectedState && Se(b.selectedState.nodes, b.selectedState.parent, b), b.selectedState = b.activeState = void 0;
|
|
4760
4781
|
}
|
|
4761
|
-
function
|
|
4782
|
+
function Yi() {
|
|
4762
4783
|
if (b.pointerDown && (b.pointerDown.node.el.draggable = !0), b.pointerDown = void 0, !ie(b)) return;
|
|
4763
4784
|
const e = b.currentParent.data.config;
|
|
4764
4785
|
ie(b) && e.handleEnd(b);
|
|
4765
4786
|
}
|
|
4766
|
-
function
|
|
4767
|
-
e.key === "Escape" && (b.selectedState &&
|
|
4787
|
+
function Xi(e) {
|
|
4788
|
+
e.key === "Escape" && (b.selectedState && Se(b.selectedState.nodes, b.selectedState.parent, b), b.activeState && Ee(b.activeState.parent, void 0, b), b.selectedState = b.activeState = void 0);
|
|
4768
4789
|
}
|
|
4769
|
-
function
|
|
4790
|
+
function Qi(e) {
|
|
4770
4791
|
if (!K(b)) return;
|
|
4771
|
-
|
|
4792
|
+
we = !0;
|
|
4772
4793
|
const t = b.initialParent.data.config.handleEnd;
|
|
4773
4794
|
t(b);
|
|
4774
4795
|
}
|
|
4775
|
-
function
|
|
4796
|
+
function Ji(e) {
|
|
4776
4797
|
if (!K(b)) return;
|
|
4777
4798
|
Z(e);
|
|
4778
4799
|
const { x: t, y: n } = Fe(e);
|
|
4779
4800
|
K(b) && yt({ x: t, y: n }, e, b);
|
|
4780
4801
|
}
|
|
4781
|
-
function
|
|
4802
|
+
function Zi(e) {
|
|
4782
4803
|
if (!b.pointerDown || !b.pointerDown.validated) return;
|
|
4783
4804
|
const t = b.pointerDown.parent.data.config;
|
|
4784
|
-
if (!(e.pointerType === "mouse" && !
|
|
4805
|
+
if (!(e.pointerType === "mouse" && !Ln()))
|
|
4785
4806
|
if (ie(b))
|
|
4786
|
-
ie(b) &&
|
|
4807
|
+
ie(b) && hn(e, b);
|
|
4787
4808
|
else {
|
|
4788
4809
|
if (Z(e), t.longPress && !b.longPress) {
|
|
4789
4810
|
clearTimeout(b.longPressTimeout), b.longPress = !1;
|
|
@@ -4791,7 +4812,7 @@ function Xi(e) {
|
|
|
4791
4812
|
}
|
|
4792
4813
|
const n = t.draggedNodes(b.pointerDown);
|
|
4793
4814
|
t.dragstartClasses(b.pointerDown.node, n, t, !0);
|
|
4794
|
-
const o = b.pointerDown.node.el.getBoundingClientRect(), r =
|
|
4815
|
+
const o = b.pointerDown.node.el.getBoundingClientRect(), r = Na(
|
|
4795
4816
|
b.pointerDown.node,
|
|
4796
4817
|
b.pointerDown.parent,
|
|
4797
4818
|
e,
|
|
@@ -4799,10 +4820,10 @@ function Xi(e) {
|
|
|
4799
4820
|
n,
|
|
4800
4821
|
o
|
|
4801
4822
|
);
|
|
4802
|
-
|
|
4823
|
+
hn(e, r, !0);
|
|
4803
4824
|
}
|
|
4804
4825
|
}
|
|
4805
|
-
function
|
|
4826
|
+
function Ki({
|
|
4806
4827
|
parent: e,
|
|
4807
4828
|
getValues: t,
|
|
4808
4829
|
setValues: n,
|
|
@@ -4810,13 +4831,13 @@ function Qi({
|
|
|
4810
4831
|
}) {
|
|
4811
4832
|
var l, u, p;
|
|
4812
4833
|
if (!Zt) return;
|
|
4813
|
-
|
|
4814
|
-
dragover:
|
|
4815
|
-
pointerdown:
|
|
4816
|
-
pointerup:
|
|
4817
|
-
keydown:
|
|
4818
|
-
drop:
|
|
4819
|
-
pointermove:
|
|
4834
|
+
pn || (pn = ht(document, {
|
|
4835
|
+
dragover: Ji,
|
|
4836
|
+
pointerdown: Wi,
|
|
4837
|
+
pointerup: Yi,
|
|
4838
|
+
keydown: Xi,
|
|
4839
|
+
drop: Qi,
|
|
4840
|
+
pointermove: Zi,
|
|
4820
4841
|
pointercancel: oe(o.handlePointercancel),
|
|
4821
4842
|
touchmove: (c) => {
|
|
4822
4843
|
K(b) && c.cancelable && Z(c);
|
|
@@ -4824,45 +4845,45 @@ function Qi({
|
|
|
4824
4845
|
contextmenu: (c) => {
|
|
4825
4846
|
ie(b) && Z(c);
|
|
4826
4847
|
}
|
|
4827
|
-
})),
|
|
4828
|
-
const [r, i] =
|
|
4848
|
+
})), Pn(e);
|
|
4849
|
+
const [r, i] = In(), s = {
|
|
4829
4850
|
getValues: t,
|
|
4830
4851
|
setValues: n,
|
|
4831
4852
|
config: {
|
|
4832
4853
|
dragDropEffect: o.dragDropEffect ?? "move",
|
|
4833
4854
|
dragEffectAllowed: o.dragEffectAllowed ?? "move",
|
|
4834
|
-
draggedNodes:
|
|
4835
|
-
dragstartClasses:
|
|
4836
|
-
handleNodeKeydown:
|
|
4837
|
-
handleDragstart:
|
|
4838
|
-
handleNodeDragover:
|
|
4839
|
-
handleParentDragover:
|
|
4840
|
-
handleNodeDrop:
|
|
4841
|
-
handleNodeFocus:
|
|
4842
|
-
handleNodeBlur:
|
|
4843
|
-
handlePointercancel:
|
|
4844
|
-
handleEnd:
|
|
4845
|
-
handleDragend:
|
|
4846
|
-
handleParentFocus:
|
|
4847
|
-
handleNodePointerup:
|
|
4848
|
-
handleNodePointerover:
|
|
4849
|
-
handleParentPointerover:
|
|
4850
|
-
handleParentScroll:
|
|
4851
|
-
handleNodePointerdown:
|
|
4852
|
-
handleNodeDragenter:
|
|
4853
|
-
handleNodeDragleave:
|
|
4854
|
-
handleParentDrop:
|
|
4855
|
+
draggedNodes: pa,
|
|
4856
|
+
dragstartClasses: ma,
|
|
4857
|
+
handleNodeKeydown: va,
|
|
4858
|
+
handleDragstart: ga,
|
|
4859
|
+
handleNodeDragover: Aa,
|
|
4860
|
+
handleParentDragover: Ia,
|
|
4861
|
+
handleNodeDrop: Ta,
|
|
4862
|
+
handleNodeFocus: xa,
|
|
4863
|
+
handleNodeBlur: Da,
|
|
4864
|
+
handlePointercancel: Ca,
|
|
4865
|
+
handleEnd: Sa,
|
|
4866
|
+
handleDragend: wa,
|
|
4867
|
+
handleParentFocus: ta,
|
|
4868
|
+
handleNodePointerup: Ea,
|
|
4869
|
+
handleNodePointerover: ya,
|
|
4870
|
+
handleParentPointerover: $a,
|
|
4871
|
+
handleParentScroll: ha,
|
|
4872
|
+
handleNodePointerdown: fa,
|
|
4873
|
+
handleNodeDragenter: Ra,
|
|
4874
|
+
handleNodeDragleave: La,
|
|
4875
|
+
handleParentDrop: oa,
|
|
4855
4876
|
multiDrag: o.multiDrag ?? !1,
|
|
4856
4877
|
nativeDrag: o.nativeDrag ?? !0,
|
|
4857
|
-
performSort:
|
|
4858
|
-
performTransfer:
|
|
4878
|
+
performSort: ea,
|
|
4879
|
+
performTransfer: na,
|
|
4859
4880
|
root: o.root ?? document,
|
|
4860
|
-
setupNode:
|
|
4881
|
+
setupNode: ia,
|
|
4861
4882
|
setupNodeRemap: _n,
|
|
4862
|
-
reapplyDragClasses:
|
|
4863
|
-
tearDownNode:
|
|
4864
|
-
tearDownNodeRemap:
|
|
4865
|
-
remapFinished:
|
|
4883
|
+
reapplyDragClasses: aa,
|
|
4884
|
+
tearDownNode: sa,
|
|
4885
|
+
tearDownNodeRemap: la,
|
|
4886
|
+
remapFinished: ca,
|
|
4866
4887
|
threshold: {
|
|
4867
4888
|
horizontal: 0,
|
|
4868
4889
|
vertical: 0
|
|
@@ -4875,7 +4896,7 @@ function Qi({
|
|
|
4875
4896
|
on: i,
|
|
4876
4897
|
emit: r
|
|
4877
4898
|
};
|
|
4878
|
-
new MutationObserver(
|
|
4899
|
+
new MutationObserver(da).observe(e, { childList: !0 }), J.set(e, s), (l = o.plugins) == null || l.forEach((c) => {
|
|
4879
4900
|
var h, g;
|
|
4880
4901
|
(g = (h = c(e)) == null ? void 0 : h.tearDown) == null || g.call(h);
|
|
4881
4902
|
}), (u = o.plugins) == null || u.forEach((c) => {
|
|
@@ -4884,9 +4905,9 @@ function Qi({
|
|
|
4884
4905
|
}), (p = o.plugins) == null || p.forEach((c) => {
|
|
4885
4906
|
var h, g;
|
|
4886
4907
|
(g = (h = c(e)) == null ? void 0 : h.setup) == null || g.call(h);
|
|
4887
|
-
}),
|
|
4908
|
+
}), ra(e, s), bt(e, !0);
|
|
4888
4909
|
}
|
|
4889
|
-
function
|
|
4910
|
+
function Mn(e, t, n, o, r, i) {
|
|
4890
4911
|
const { x: s, y: d } = Fe(n), l = e.el.getBoundingClientRect();
|
|
4891
4912
|
return {
|
|
4892
4913
|
affectedNodes: [],
|
|
@@ -4921,13 +4942,13 @@ function On(e, t, n, o, r, i) {
|
|
|
4921
4942
|
transferred: !1
|
|
4922
4943
|
};
|
|
4923
4944
|
}
|
|
4924
|
-
function
|
|
4945
|
+
function ea({
|
|
4925
4946
|
parent: e,
|
|
4926
4947
|
draggedNodes: t,
|
|
4927
4948
|
targetNodes: n
|
|
4928
4949
|
}) {
|
|
4929
4950
|
bt(e.el);
|
|
4930
|
-
const o = t.map((l) => l.data.value), r =
|
|
4951
|
+
const o = t.map((l) => l.data.value), r = $e(e.el, e.data), i = t[0].data.index, s = [...e.data.enabledNodes], d = [
|
|
4931
4952
|
...r.filter((l) => !o.some((u) => qe(l, u)))
|
|
4932
4953
|
];
|
|
4933
4954
|
d.splice(n[0].data.index, 0, ...o), "draggedNode" in b && (b.currentTargetValue = n[0].data.value), zt(e.el, e.data, [...d]), e.data.config.onSort && e.data.config.onSort({
|
|
@@ -4946,7 +4967,7 @@ function Ji({
|
|
|
4946
4967
|
state: b
|
|
4947
4968
|
});
|
|
4948
4969
|
}
|
|
4949
|
-
function
|
|
4970
|
+
function Ee(e, t, n) {
|
|
4950
4971
|
if (!t) {
|
|
4951
4972
|
n.activeState = void 0;
|
|
4952
4973
|
return;
|
|
@@ -4956,11 +4977,11 @@ function Se(e, t, n) {
|
|
|
4956
4977
|
parent: e
|
|
4957
4978
|
};
|
|
4958
4979
|
}
|
|
4959
|
-
function
|
|
4980
|
+
function Se(e, t, n) {
|
|
4960
4981
|
const o = t.data.config.selectedClass;
|
|
4961
4982
|
if (!n.selectedState) return;
|
|
4962
4983
|
const r = Array.from(e);
|
|
4963
|
-
|
|
4984
|
+
De(
|
|
4964
4985
|
e.map((i) => i.el),
|
|
4965
4986
|
o
|
|
4966
4987
|
);
|
|
@@ -4973,17 +4994,17 @@ function Ce(e, t, n) {
|
|
|
4973
4994
|
function lt(e, t, n, o, r = !1) {
|
|
4974
4995
|
o.pointerSelection = r;
|
|
4975
4996
|
for (const i of t)
|
|
4976
|
-
i.el.setAttribute("aria-selected", "true"),
|
|
4997
|
+
i.el.setAttribute("aria-selected", "true"), ke([i.el], e.data.config.selectedClass, !0);
|
|
4977
4998
|
o.selectedState = {
|
|
4978
4999
|
nodes: t,
|
|
4979
5000
|
parent: e
|
|
4980
|
-
},
|
|
5001
|
+
}, Ee(e, n, o);
|
|
4981
5002
|
}
|
|
4982
|
-
function
|
|
5003
|
+
function ta(e, t) {
|
|
4983
5004
|
const n = e.targetData.parent.data.enabledNodes[0];
|
|
4984
|
-
n && (t.selectedState && t.selectedState.parent.el !== e.targetData.parent.el ?
|
|
5005
|
+
n && (t.selectedState && t.selectedState.parent.el !== e.targetData.parent.el ? Ee(e.targetData.parent, n, t) : t.selectedState || Ee(e.targetData.parent, n, t));
|
|
4985
5006
|
}
|
|
4986
|
-
function
|
|
5007
|
+
function na({
|
|
4987
5008
|
currentParent: e,
|
|
4988
5009
|
targetParent: t,
|
|
4989
5010
|
initialParent: n,
|
|
@@ -4994,10 +5015,10 @@ function Ki({
|
|
|
4994
5015
|
}) {
|
|
4995
5016
|
bt(n.el);
|
|
4996
5017
|
const d = o.map((h) => h.data.value), l = [
|
|
4997
|
-
|
|
5018
|
+
...$e(e.el, e.data).filter(
|
|
4998
5019
|
(h) => !d.some((g) => qe(h, g))
|
|
4999
5020
|
)
|
|
5000
|
-
], u =
|
|
5021
|
+
], u = $e(t.el, t.data), p = n.el === t.el && t.data.config.sortable === !1;
|
|
5001
5022
|
let c;
|
|
5002
5023
|
i.length ? (p ? c = r : t.data.config.sortable === !1 ? c = t.data.enabledNodes.length : c = i[0].data.index, u.splice(c, 0, ...d)) : (c = p ? r : t.data.enabledNodes.length, u.splice(c, 0, ...d)), zt(e.el, e.data, l), zt(t.el, t.data, u), t.data.config.onTransfer && t.data.config.onTransfer({
|
|
5003
5024
|
sourceParent: e,
|
|
@@ -5017,18 +5038,18 @@ function Ki({
|
|
|
5017
5038
|
targetNodes: i || []
|
|
5018
5039
|
});
|
|
5019
5040
|
}
|
|
5020
|
-
function
|
|
5041
|
+
function $e(e, t) {
|
|
5021
5042
|
return [...t.getValues(e)];
|
|
5022
5043
|
}
|
|
5023
5044
|
function zt(e, t, n) {
|
|
5024
5045
|
t.setValues(n, e);
|
|
5025
5046
|
}
|
|
5026
|
-
function
|
|
5027
|
-
|
|
5047
|
+
function oa(e, t) {
|
|
5048
|
+
Ce(e.e), we = !0;
|
|
5028
5049
|
const n = t.initialParent.data.config.handleEnd;
|
|
5029
5050
|
n(t);
|
|
5030
5051
|
}
|
|
5031
|
-
function
|
|
5052
|
+
function Pn(e) {
|
|
5032
5053
|
const t = J.get(e);
|
|
5033
5054
|
t && t.abortControllers.mainParent && t.abortControllers.mainParent.abort();
|
|
5034
5055
|
}
|
|
@@ -5038,7 +5059,7 @@ function K(e) {
|
|
|
5038
5059
|
function ie(e) {
|
|
5039
5060
|
return "synthDragging" in e && !!e.synthDragging;
|
|
5040
5061
|
}
|
|
5041
|
-
function
|
|
5062
|
+
function ra(e, t) {
|
|
5042
5063
|
t.abortControllers.mainParent = ht(e, {
|
|
5043
5064
|
dragover: st(t.config.handleParentDragover),
|
|
5044
5065
|
handleParentPointerover: t.config.handleParentPointerover,
|
|
@@ -5082,7 +5103,7 @@ function ta(e, t) {
|
|
|
5082
5103
|
}
|
|
5083
5104
|
));
|
|
5084
5105
|
}
|
|
5085
|
-
function
|
|
5106
|
+
function ia(e) {
|
|
5086
5107
|
var n;
|
|
5087
5108
|
const t = e.parent.data.config;
|
|
5088
5109
|
e.node.data.abortControllers.mainNode = ht(e.node.el, {
|
|
@@ -5117,26 +5138,26 @@ function _n(e) {
|
|
|
5117
5138
|
(r = (o = n(e.parent.el)) == null ? void 0 : o.setupNodeRemap) == null || r.call(o, e);
|
|
5118
5139
|
});
|
|
5119
5140
|
}
|
|
5120
|
-
function
|
|
5141
|
+
function aa(e, t) {
|
|
5121
5142
|
if (!K(b)) return;
|
|
5122
5143
|
const n = ie(b) ? t.config.synthDropZoneClass : t.config.dropZoneClass;
|
|
5123
|
-
b.draggedNode.el === e &&
|
|
5144
|
+
b.draggedNode.el === e && ke([e], n, !0);
|
|
5124
5145
|
}
|
|
5125
|
-
function
|
|
5146
|
+
function la(e) {
|
|
5126
5147
|
var t;
|
|
5127
5148
|
(t = e.parent.data.config.plugins) == null || t.forEach((n) => {
|
|
5128
5149
|
var o, r;
|
|
5129
5150
|
(r = (o = n(e.parent.el)) == null ? void 0 : o.tearDownNodeRemap) == null || r.call(o, e);
|
|
5130
5151
|
});
|
|
5131
5152
|
}
|
|
5132
|
-
function
|
|
5153
|
+
function sa(e) {
|
|
5133
5154
|
var t, n, o, r, i;
|
|
5134
5155
|
(t = e.parent.data.config.plugins) == null || t.forEach((s) => {
|
|
5135
5156
|
var d, l;
|
|
5136
5157
|
(l = (d = s(e.parent.el)) == null ? void 0 : d.tearDownNode) == null || l.call(d, e);
|
|
5137
5158
|
}), e.node.el.draggable = !1, (o = (n = e.node.data) == null ? void 0 : n.abortControllers) != null && o.mainNode && ((i = (r = e.node.data) == null ? void 0 : r.abortControllers) == null || i.mainNode.abort());
|
|
5138
5159
|
}
|
|
5139
|
-
function
|
|
5160
|
+
function da(e) {
|
|
5140
5161
|
if (e.length === 1 && e[0].addedNodes.length === 1 && !(e[0].addedNodes[0] instanceof HTMLElement))
|
|
5141
5162
|
return;
|
|
5142
5163
|
const t = e[0].target;
|
|
@@ -5183,7 +5204,7 @@ function bt(e, t) {
|
|
|
5183
5204
|
index: l
|
|
5184
5205
|
}
|
|
5185
5206
|
);
|
|
5186
|
-
if (!K(b) && b.activeState && qe(b.activeState.node.data.value, c.value) &&
|
|
5207
|
+
if (!K(b) && b.activeState && qe(b.activeState.node.data.value, c.value) && Ee(
|
|
5187
5208
|
{
|
|
5188
5209
|
data: n,
|
|
5189
5210
|
el: e
|
|
@@ -5228,13 +5249,13 @@ function bt(e, t) {
|
|
|
5228
5249
|
(p = (u = l(e)) == null ? void 0 : u.remapFinished) == null || p.call(u);
|
|
5229
5250
|
});
|
|
5230
5251
|
}
|
|
5231
|
-
function
|
|
5252
|
+
function ca() {
|
|
5232
5253
|
b.remapJustFinished = !0, "draggedNode" in b && (b.affectedNodes = []);
|
|
5233
5254
|
}
|
|
5234
|
-
function
|
|
5255
|
+
function ua(e) {
|
|
5235
5256
|
return !!e.targetData.parent.data.config.nativeDrag;
|
|
5236
5257
|
}
|
|
5237
|
-
function
|
|
5258
|
+
function pa(e) {
|
|
5238
5259
|
var t;
|
|
5239
5260
|
if (e.parent.data.config.multiDrag) {
|
|
5240
5261
|
if (b.selectedState)
|
|
@@ -5247,14 +5268,14 @@ function da(e) {
|
|
|
5247
5268
|
} else return [e.node];
|
|
5248
5269
|
return [];
|
|
5249
5270
|
}
|
|
5250
|
-
function
|
|
5271
|
+
function ha(e) {
|
|
5251
5272
|
K(b) && (b.emit("scrollStarted", b), !ie(b) && (b.preventEnter = !0, Ft && clearTimeout(Ft), Ft = setTimeout(() => {
|
|
5252
5273
|
b.preventEnter = !1, b.emit("scrollEnded", b);
|
|
5253
5274
|
}, 100)));
|
|
5254
5275
|
}
|
|
5255
|
-
function
|
|
5276
|
+
function ga(e, t) {
|
|
5256
5277
|
const n = e.targetData.parent.data.config;
|
|
5257
|
-
if (!n.nativeDrag || !
|
|
5278
|
+
if (!n.nativeDrag || !ua(e) || !Vn({
|
|
5258
5279
|
x: e.e.clientX,
|
|
5259
5280
|
y: e.e.clientY,
|
|
5260
5281
|
node: e.targetData.node,
|
|
@@ -5268,11 +5289,11 @@ function ua(e, t) {
|
|
|
5268
5289
|
node: e.targetData.node
|
|
5269
5290
|
});
|
|
5270
5291
|
o.length === 0 && (o = [e.targetData.node]), n.dragstartClasses(e.targetData.node, o, n);
|
|
5271
|
-
const r =
|
|
5292
|
+
const r = ba(e, o);
|
|
5272
5293
|
if (n.onDragstart) {
|
|
5273
5294
|
const i = {
|
|
5274
5295
|
parent: e.targetData.parent,
|
|
5275
|
-
values:
|
|
5296
|
+
values: $e(
|
|
5276
5297
|
e.targetData.parent.el,
|
|
5277
5298
|
e.targetData.parent.data
|
|
5278
5299
|
),
|
|
@@ -5284,20 +5305,20 @@ function ua(e, t) {
|
|
|
5284
5305
|
n.onDragstart(i);
|
|
5285
5306
|
}
|
|
5286
5307
|
}
|
|
5287
|
-
function
|
|
5308
|
+
function fa(e, t) {
|
|
5288
5309
|
var d, l;
|
|
5289
|
-
if (
|
|
5310
|
+
if (Ce(e.e), t.pointerDown = {
|
|
5290
5311
|
parent: e.targetData.parent,
|
|
5291
5312
|
node: e.targetData.node,
|
|
5292
5313
|
validated: !1
|
|
5293
|
-
}, !
|
|
5314
|
+
}, !Vn({
|
|
5294
5315
|
x: e.e.clientX,
|
|
5295
5316
|
y: e.e.clientY,
|
|
5296
5317
|
node: e.targetData.node,
|
|
5297
5318
|
config: e.targetData.parent.data.config
|
|
5298
5319
|
}))
|
|
5299
5320
|
return;
|
|
5300
|
-
t.pointerDown.validated = !0,
|
|
5321
|
+
t.pointerDown.validated = !0, ka(e, t, e.targetData.node);
|
|
5301
5322
|
const n = e.targetData.parent.data;
|
|
5302
5323
|
let o = [e.targetData.node];
|
|
5303
5324
|
const r = e.e.ctrlKey || e.e.metaKey, i = e.e.shiftKey, s = e.targetData.node;
|
|
@@ -5319,7 +5340,7 @@ function pa(e, t) {
|
|
|
5319
5340
|
const u = e.targetData.parent.data.enabledNodes;
|
|
5320
5341
|
if (t.selectedState && t.activeState)
|
|
5321
5342
|
if (t.selectedState.parent.el !== e.targetData.parent.el) {
|
|
5322
|
-
|
|
5343
|
+
Se(t.selectedState.nodes, t.selectedState.parent, t), t.selectedState = void 0;
|
|
5323
5344
|
for (let p = 0; p <= s.data.index; p++)
|
|
5324
5345
|
o.push(u[p]);
|
|
5325
5346
|
} else {
|
|
@@ -5346,7 +5367,7 @@ function pa(e, t) {
|
|
|
5346
5367
|
}
|
|
5347
5368
|
(l = (d = t.selectedState) == null ? void 0 : d.nodes) != null && l.length ? t.selectedState.nodes.findIndex(
|
|
5348
5369
|
(p) => p.el === e.targetData.node.el
|
|
5349
|
-
) === -1 && (t.selectedState.parent.el !== e.targetData.parent.el ?
|
|
5370
|
+
) === -1 && (t.selectedState.parent.el !== e.targetData.parent.el ? Se(t.selectedState.nodes, e.targetData.parent, t) : n.config.multiDrag && Ln() ? o.push(...t.selectedState.nodes) : Se(t.selectedState.nodes, e.targetData.parent, t), lt(
|
|
5350
5371
|
e.targetData.parent,
|
|
5351
5372
|
o,
|
|
5352
5373
|
e.targetData.node,
|
|
@@ -5360,30 +5381,30 @@ function pa(e, t) {
|
|
|
5360
5381
|
!0
|
|
5361
5382
|
);
|
|
5362
5383
|
}
|
|
5363
|
-
function
|
|
5364
|
-
|
|
5384
|
+
function ma(e, t, n, o = !1) {
|
|
5385
|
+
ke(
|
|
5365
5386
|
t.map((r) => r.el),
|
|
5366
5387
|
o ? n.synthDraggingClass : n.draggingClass
|
|
5367
5388
|
), setTimeout(() => {
|
|
5368
|
-
|
|
5389
|
+
De(
|
|
5369
5390
|
t.map((r) => r.el),
|
|
5370
5391
|
o ? n.synthDraggingClass : n.draggingClass
|
|
5371
|
-
),
|
|
5392
|
+
), ke(
|
|
5372
5393
|
t.map((r) => r.el),
|
|
5373
5394
|
o ? n.synthDragPlaceholderClass : n.dragPlaceholderClass
|
|
5374
|
-
),
|
|
5395
|
+
), ke(
|
|
5375
5396
|
t.map((r) => r.el),
|
|
5376
5397
|
o ? n.synthDropZoneClass : n.dropZoneClass
|
|
5377
|
-
),
|
|
5398
|
+
), De(
|
|
5378
5399
|
t.map((r) => r.el),
|
|
5379
5400
|
n.selectedClass
|
|
5380
5401
|
);
|
|
5381
5402
|
});
|
|
5382
5403
|
}
|
|
5383
|
-
function
|
|
5384
|
-
|
|
5385
|
-
const n =
|
|
5386
|
-
|
|
5404
|
+
function ba(e, t) {
|
|
5405
|
+
Ce(e.e);
|
|
5406
|
+
const n = On(
|
|
5407
|
+
Mn(
|
|
5387
5408
|
e.targetData.node,
|
|
5388
5409
|
e.targetData.parent,
|
|
5389
5410
|
e.e,
|
|
@@ -5435,7 +5456,7 @@ function ga(e, t) {
|
|
|
5435
5456
|
}
|
|
5436
5457
|
return n;
|
|
5437
5458
|
}
|
|
5438
|
-
function
|
|
5459
|
+
function Vn({
|
|
5439
5460
|
x: e,
|
|
5440
5461
|
y: t,
|
|
5441
5462
|
node: n,
|
|
@@ -5451,75 +5472,75 @@ function Pn({
|
|
|
5451
5472
|
if (i === s || s.contains(i)) return !0;
|
|
5452
5473
|
return !1;
|
|
5453
5474
|
}
|
|
5454
|
-
function
|
|
5475
|
+
function va(e) {
|
|
5455
5476
|
}
|
|
5456
|
-
function
|
|
5457
|
-
e.detail.targetData.parent.el === e.detail.state.currentParent.el ?
|
|
5477
|
+
function ya(e) {
|
|
5478
|
+
e.detail.targetData.parent.el === e.detail.state.currentParent.el ? Un(e.detail, e.detail.state) : vt(e.detail, e.detail.state);
|
|
5458
5479
|
}
|
|
5459
|
-
function
|
|
5480
|
+
function Ta(e, t) {
|
|
5460
5481
|
const n = e.targetData.parent.data.config;
|
|
5461
|
-
n.nativeDrag && (
|
|
5482
|
+
n.nativeDrag && (Ce(e.e), we = !0, n.handleEnd(t));
|
|
5462
5483
|
}
|
|
5463
|
-
function
|
|
5484
|
+
function xa(e) {
|
|
5464
5485
|
e.e.target !== e.e.currentTarget && b.pointerDown && (b.pointerDown.node.el.draggable = !1);
|
|
5465
5486
|
}
|
|
5466
|
-
function
|
|
5487
|
+
function Da(e) {
|
|
5467
5488
|
e.e.target !== e.e.currentTarget && b.pointerDown && (b.pointerDown.node.el.draggable = !0);
|
|
5468
5489
|
}
|
|
5469
|
-
function
|
|
5490
|
+
function wa(e, t) {
|
|
5470
5491
|
const n = e.targetData.parent.data.config;
|
|
5471
5492
|
if (n.nativeDrag) {
|
|
5472
|
-
if (Z(e.e),
|
|
5473
|
-
|
|
5493
|
+
if (Z(e.e), Ce(e.e), we) {
|
|
5494
|
+
we = !1;
|
|
5474
5495
|
return;
|
|
5475
5496
|
}
|
|
5476
5497
|
n.handleEnd(t);
|
|
5477
5498
|
}
|
|
5478
5499
|
}
|
|
5479
|
-
function
|
|
5500
|
+
function Ca(e, t) {
|
|
5480
5501
|
var o;
|
|
5481
5502
|
if (!ie(t)) return;
|
|
5482
|
-
if (Z(e.e),
|
|
5483
|
-
|
|
5503
|
+
if (Z(e.e), we) {
|
|
5504
|
+
we = !1;
|
|
5484
5505
|
return;
|
|
5485
5506
|
}
|
|
5486
5507
|
const n = (o = J.get(t.initialParent.el)) == null ? void 0 : o.config;
|
|
5487
5508
|
n != null && n.onDragend && n.onDragend({
|
|
5488
5509
|
parent: t.currentParent,
|
|
5489
|
-
values:
|
|
5510
|
+
values: $e(t.currentParent.el, t.currentParent.data),
|
|
5490
5511
|
draggedNode: t.draggedNode,
|
|
5491
5512
|
draggedNodes: t.draggedNodes,
|
|
5492
5513
|
state: t
|
|
5493
5514
|
}), n == null || n.handleEnd(t);
|
|
5494
5515
|
}
|
|
5495
|
-
function
|
|
5516
|
+
function Sa(e) {
|
|
5496
5517
|
var p, c, h, g, f;
|
|
5497
5518
|
e.draggedNode && (e.draggedNode.el.draggable = !0);
|
|
5498
5519
|
const t = e.draggedNodes.map((v) => v.el), n = e.initialParent.data, o = ie(e), r = (p = J.get(e.initialParent.el)) == null ? void 0 : p.config, i = o ? r == null ? void 0 : r.synthDropZoneClass : r == null ? void 0 : r.dropZoneClass, s = (c = n == null ? void 0 : n.config) == null ? void 0 : c.longPressClass, d = o ? (h = n == null ? void 0 : n.config) == null ? void 0 : h.synthDragPlaceholderClass : (g = n == null ? void 0 : n.config) == null ? void 0 : g.dragPlaceholderClass, l = e.originalZIndex;
|
|
5499
5520
|
ie(e) && (e.clonedDraggedNode && e.clonedDraggedNode.remove(), e.longPressTimeout && clearTimeout(e.longPressTimeout)), Ht(e), e.lastScrollDirectionX = void 0, e.lastScrollDirectionY = void 0, e.preventEnter = !1, e.scrollDebounceTimeout && (clearTimeout(e.scrollDebounceTimeout), e.scrollDebounceTimeout = void 0), l !== void 0 && e.draggedNode && (e.draggedNode.el.style.zIndex = l), requestAnimationFrame(() => {
|
|
5500
|
-
|
|
5501
|
-
}),
|
|
5521
|
+
De(t, i), De(t, s), De(t, d);
|
|
5522
|
+
}), Se(e.draggedNodes, e.currentParent, e), Ee(e.currentParent, void 0, e);
|
|
5502
5523
|
const u = { ...e };
|
|
5503
5524
|
(f = r == null ? void 0 : r.onDragend) == null || f.call(r, {
|
|
5504
5525
|
parent: u.currentParent,
|
|
5505
|
-
values:
|
|
5526
|
+
values: $e(
|
|
5506
5527
|
u.currentParent.el,
|
|
5507
5528
|
u.currentParent.data
|
|
5508
5529
|
),
|
|
5509
5530
|
draggedNode: u.draggedNode,
|
|
5510
5531
|
draggedNodes: u.draggedNodes,
|
|
5511
5532
|
state: u
|
|
5512
|
-
}), e.emit("dragEnded", u),
|
|
5533
|
+
}), e.emit("dragEnded", u), qi();
|
|
5513
5534
|
}
|
|
5514
|
-
function
|
|
5515
|
-
|
|
5535
|
+
function Ea(e, t) {
|
|
5536
|
+
Ce(e.e), !t.pointerSelection && t.selectedState && Se(t.selectedState.nodes, e.targetData.parent, t);
|
|
5516
5537
|
const n = e.targetData.parent.data.config;
|
|
5517
|
-
t.pointerSelection = !1, "longPressTimeout" in t && t.longPressTimeout && clearTimeout(t.longPressTimeout), t.longPress = !1,
|
|
5538
|
+
t.pointerSelection = !1, "longPressTimeout" in t && t.longPressTimeout && clearTimeout(t.longPressTimeout), t.longPress = !1, De(
|
|
5518
5539
|
e.targetData.parent.data.enabledNodes.map((o) => o.el),
|
|
5519
5540
|
n.longPressClass
|
|
5520
5541
|
), K(t) && n.handleEnd(t);
|
|
5521
5542
|
}
|
|
5522
|
-
function
|
|
5543
|
+
function Na(e, t, n, o, r, i) {
|
|
5523
5544
|
var f, v;
|
|
5524
5545
|
const s = t.data.config;
|
|
5525
5546
|
let d, l;
|
|
@@ -5590,8 +5611,8 @@ function Ca(e, t, n, o, r, i) {
|
|
|
5590
5611
|
rootScrollWidth: (f = document.scrollingElement) == null ? void 0 : f.scrollWidth,
|
|
5591
5612
|
rootScrollHeight: (v = document.scrollingElement) == null ? void 0 : v.scrollHeight
|
|
5592
5613
|
};
|
|
5593
|
-
return
|
|
5594
|
-
...
|
|
5614
|
+
return On({
|
|
5615
|
+
...Mn(
|
|
5595
5616
|
e,
|
|
5596
5617
|
t,
|
|
5597
5618
|
n,
|
|
@@ -5602,29 +5623,29 @@ function Ca(e, t, n, o, r, i) {
|
|
|
5602
5623
|
...h
|
|
5603
5624
|
});
|
|
5604
5625
|
}
|
|
5605
|
-
function
|
|
5626
|
+
function ka(e, t, n) {
|
|
5606
5627
|
const o = e.targetData.parent.data.config;
|
|
5607
5628
|
t.longPressTimeout = setTimeout(() => {
|
|
5608
|
-
t && (t.longPress = !0, o.longPressClass && e.e.cancelable &&
|
|
5629
|
+
t && (t.longPress = !0, o.longPressClass && e.e.cancelable && ke([n.el], o.longPressClass), Z(e.e));
|
|
5609
5630
|
}, o.longPressDuration || 1e3);
|
|
5610
5631
|
}
|
|
5611
5632
|
function Ht(e, t = !0, n = !0) {
|
|
5612
5633
|
t && (e.frameIdX !== void 0 && (cancelAnimationFrame(e.frameIdX), e.frameIdX = void 0), e.lastScrollDirectionX = void 0), n && (e.frameIdY !== void 0 && (cancelAnimationFrame(e.frameIdY), e.frameIdY = void 0), e.lastScrollDirectionY = void 0), !e.frameIdX && !e.frameIdY && (e.preventEnter = !1);
|
|
5613
5634
|
}
|
|
5614
|
-
function
|
|
5635
|
+
function jn(e, t = !1) {
|
|
5615
5636
|
var p;
|
|
5616
5637
|
const { x: n, y: o } = e.coordinates, r = e.startLeft ?? 0, i = e.startTop ?? 0, s = window.scrollX ?? 0, d = window.scrollY ?? 0, l = n - r + s, u = o - i + d;
|
|
5617
|
-
e.clonedDraggedNode.style.transform = `translate3d(${l}px, ${u}px, 0px)`, t && (e.clonedDraggedNode.style.opacity = "1",
|
|
5638
|
+
e.clonedDraggedNode.style.transform = `translate3d(${l}px, ${u}px, 0px)`, t && (e.clonedDraggedNode.style.opacity = "1", De(
|
|
5618
5639
|
e.draggedNodes.map((c) => c.el),
|
|
5619
5640
|
(p = e.initialParent.data.config) == null ? void 0 : p.longPressClass
|
|
5620
5641
|
));
|
|
5621
5642
|
}
|
|
5622
|
-
function
|
|
5643
|
+
function hn(e, t, n = !1) {
|
|
5623
5644
|
const o = Fe(e);
|
|
5624
|
-
t.coordinates.x = o.x, t.coordinates.y = o.y,
|
|
5645
|
+
t.coordinates.x = o.x, t.coordinates.y = o.y, jn(t, n), t.scrollDebounceTimeout && (clearTimeout(t.scrollDebounceTimeout), t.scrollDebounceTimeout = void 0), t.scrollDebounceTimeout = setTimeout(() => {
|
|
5625
5646
|
ie(t) && yt(t.coordinates, e, t);
|
|
5626
5647
|
}, 16);
|
|
5627
|
-
const r =
|
|
5648
|
+
const r = _a(o);
|
|
5628
5649
|
if (!r) {
|
|
5629
5650
|
document.dispatchEvent(
|
|
5630
5651
|
new CustomEvent("handleRootPointerover", {
|
|
@@ -5651,22 +5672,22 @@ function pn(e, t, n = !1) {
|
|
|
5651
5672
|
})
|
|
5652
5673
|
);
|
|
5653
5674
|
}
|
|
5654
|
-
function
|
|
5675
|
+
function Aa(e, t) {
|
|
5655
5676
|
var i;
|
|
5656
5677
|
if (!e.targetData.parent.data.config.nativeDrag) return;
|
|
5657
5678
|
const { x: o, y: r } = Fe(e.e);
|
|
5658
|
-
t.coordinates.y = r, t.coordinates.x = o, Z(e.e),
|
|
5679
|
+
t.coordinates.y = r, t.coordinates.x = o, Z(e.e), Ce(e.e), K(t) && yt({ x: o, y: r }, e.e, t), e.targetData.parent.el === ((i = t.currentParent) == null ? void 0 : i.el) ? Un(e, t) : vt(e, t);
|
|
5659
5680
|
}
|
|
5660
|
-
function
|
|
5681
|
+
function Ia(e, t) {
|
|
5661
5682
|
if (!e.targetData.parent.data.config.nativeDrag) return;
|
|
5662
|
-
Z(e.e),
|
|
5683
|
+
Z(e.e), Ce(e.e);
|
|
5663
5684
|
const { x: o, y: r } = Fe(e.e);
|
|
5664
5685
|
K(t) && yt({ x: o, y: r }, e.e, t), vt(e, t);
|
|
5665
5686
|
}
|
|
5666
|
-
function
|
|
5687
|
+
function $a(e) {
|
|
5667
5688
|
e.detail.targetData.parent.el !== e.detail.state.currentParent.el && vt(e.detail, e.detail.state);
|
|
5668
5689
|
}
|
|
5669
|
-
function
|
|
5690
|
+
function Fa({
|
|
5670
5691
|
currentParent: e,
|
|
5671
5692
|
targetParent: t,
|
|
5672
5693
|
initialParent: n,
|
|
@@ -5684,13 +5705,13 @@ function Aa({
|
|
|
5684
5705
|
r
|
|
5685
5706
|
) : !(!i.group || i.group !== s.group);
|
|
5686
5707
|
}
|
|
5687
|
-
function
|
|
5708
|
+
function Ra(e, t) {
|
|
5688
5709
|
Z(e.e);
|
|
5689
5710
|
}
|
|
5690
|
-
function
|
|
5711
|
+
function La(e, t) {
|
|
5691
5712
|
Z(e.e);
|
|
5692
5713
|
}
|
|
5693
|
-
function
|
|
5714
|
+
function Oa(e, t, n, o) {
|
|
5694
5715
|
var p;
|
|
5695
5716
|
if (t.affectedNodes.map((c) => c.data.value).includes(e.targetData.node.data.value))
|
|
5696
5717
|
return !1;
|
|
@@ -5724,9 +5745,9 @@ function Fa(e, t, n, o) {
|
|
|
5724
5745
|
}
|
|
5725
5746
|
return !1;
|
|
5726
5747
|
}
|
|
5727
|
-
function
|
|
5748
|
+
function Un(e, t) {
|
|
5728
5749
|
const { x: n, y: o } = Fe(e.e);
|
|
5729
|
-
if (!
|
|
5750
|
+
if (!Oa(e, t, n, o))
|
|
5730
5751
|
return;
|
|
5731
5752
|
const r = t.draggedNode.data.index > e.targetData.node.data.index ? [e.targetData.node.data.index, t.draggedNode.data.index] : [t.draggedNode.data.index, e.targetData.node.data.index];
|
|
5732
5753
|
t.targetIndex = e.targetData.node.data.index, t.affectedNodes = e.targetData.parent.data.enabledNodes.filter(
|
|
@@ -5767,7 +5788,7 @@ function oe(e) {
|
|
|
5767
5788
|
};
|
|
5768
5789
|
}
|
|
5769
5790
|
function vt(e, t) {
|
|
5770
|
-
Z(e.e),
|
|
5791
|
+
Z(e.e), Fa({
|
|
5771
5792
|
currentParent: t.currentParent,
|
|
5772
5793
|
targetParent: e.targetData.parent,
|
|
5773
5794
|
initialParent: t.initialParent,
|
|
@@ -5806,18 +5827,18 @@ function st(e) {
|
|
|
5806
5827
|
);
|
|
5807
5828
|
};
|
|
5808
5829
|
}
|
|
5809
|
-
function
|
|
5830
|
+
function ke(e, t, n = !1) {
|
|
5810
5831
|
function o(r, i) {
|
|
5811
5832
|
fe.set(r, i);
|
|
5812
5833
|
}
|
|
5813
5834
|
for (const r of e) {
|
|
5814
|
-
const i = fe.get(r), s =
|
|
5835
|
+
const i = fe.get(r), s = Ma(r, t, i, n);
|
|
5815
5836
|
s && o(r, s);
|
|
5816
5837
|
}
|
|
5817
5838
|
}
|
|
5818
|
-
function
|
|
5839
|
+
function Ma(e, t, n, o = !1) {
|
|
5819
5840
|
if (!t) return;
|
|
5820
|
-
const r =
|
|
5841
|
+
const r = Rn(t);
|
|
5821
5842
|
if (!r.length) return;
|
|
5822
5843
|
if (!n) {
|
|
5823
5844
|
e.classList.add(...r);
|
|
@@ -5832,9 +5853,9 @@ function Ra(e, t, n, o = !1) {
|
|
|
5832
5853
|
) : e.classList.add(s);
|
|
5833
5854
|
return n.privateClasses = i, n;
|
|
5834
5855
|
}
|
|
5835
|
-
function
|
|
5856
|
+
function De(e, t) {
|
|
5836
5857
|
if (!t) return;
|
|
5837
|
-
const n =
|
|
5858
|
+
const n = Rn(t);
|
|
5838
5859
|
if (n.length)
|
|
5839
5860
|
for (const o of e) {
|
|
5840
5861
|
if (!Tt(o)) {
|
|
@@ -5847,7 +5868,7 @@ function xe(e, t) {
|
|
|
5847
5868
|
r.privateClasses.includes(i) || o.classList.remove(i);
|
|
5848
5869
|
}
|
|
5849
5870
|
}
|
|
5850
|
-
function
|
|
5871
|
+
function gn(e, t, n, o, r) {
|
|
5851
5872
|
const s = r.axis === "x", d = e === document.scrollingElement, l = s ? "scrollLeft" : "scrollTop", u = s ? "clientWidth" : "clientHeight", p = s ? "offsetWidth" : "offsetHeight", c = s ? "scrollWidth" : "scrollHeight", h = s ? t.clientX : t.clientY, g = s ? o.left : o.top, f = s ? n.overflowX : n.overflowY;
|
|
5852
5873
|
if (d) {
|
|
5853
5874
|
const v = e[l], T = e[u], w = v > 0, D = v + T < (s ? r.state.rootScrollWidth || 0 : e[c]);
|
|
@@ -5871,7 +5892,7 @@ function hn(e, t, n, o, r) {
|
|
|
5871
5892
|
}
|
|
5872
5893
|
return s ? { left: !1, right: !1 } : { up: !1, down: !1 };
|
|
5873
5894
|
}
|
|
5874
|
-
function
|
|
5895
|
+
function Pa(e, t, n, o) {
|
|
5875
5896
|
if (!K(n) || !n.draggedNode)
|
|
5876
5897
|
return;
|
|
5877
5898
|
n.preventEnter = !0;
|
|
@@ -5887,11 +5908,11 @@ function La(e, t, n, o) {
|
|
|
5887
5908
|
n[l] = void 0, n[d] = void 0;
|
|
5888
5909
|
return;
|
|
5889
5910
|
}
|
|
5890
|
-
e[p] += s * i, ie(n) &&
|
|
5911
|
+
e[p] += s * i, ie(n) && jn(n), n[l] = requestAnimationFrame(u);
|
|
5891
5912
|
};
|
|
5892
5913
|
n[l] = requestAnimationFrame(u);
|
|
5893
5914
|
}
|
|
5894
|
-
function
|
|
5915
|
+
function fn(e, t, n) {
|
|
5895
5916
|
const o = e.getBoundingClientRect();
|
|
5896
5917
|
return t >= o.left && t <= o.right && n >= o.top && n <= o.bottom;
|
|
5897
5918
|
}
|
|
@@ -5902,15 +5923,15 @@ function yt(e, t, n) {
|
|
|
5902
5923
|
const { x: o, y: r } = e;
|
|
5903
5924
|
let i = !1;
|
|
5904
5925
|
const s = (l, u, p) => {
|
|
5905
|
-
|
|
5926
|
+
Pa(p, t, n, { axis: l, direction: u }), i = !0;
|
|
5906
5927
|
}, d = (l) => {
|
|
5907
|
-
const u = window.getComputedStyle(l), p = l.getBoundingClientRect(), c =
|
|
5928
|
+
const u = window.getComputedStyle(l), p = l.getBoundingClientRect(), c = gn(l, t, u, p, {
|
|
5908
5929
|
axis: "x",
|
|
5909
5930
|
state: n
|
|
5910
|
-
}), h =
|
|
5931
|
+
}), h = gn(l, t, u, p, { axis: "y" });
|
|
5911
5932
|
(c.left || c.right) && (n.lastScrollContainerX = l, s("x", c.right ? "positive" : "negative", l)), (h.up || h.down) && (n.lastScrollContainerY = l, s("y", h.down ? "positive" : "negative", l));
|
|
5912
5933
|
};
|
|
5913
|
-
if (n.lastScrollContainerX &&
|
|
5934
|
+
if (n.lastScrollContainerX && fn(n.lastScrollContainerX, o, r) && d(n.lastScrollContainerX), !i && n.lastScrollContainerY && fn(n.lastScrollContainerY, o, r) && d(n.lastScrollContainerY), !i) {
|
|
5914
5935
|
let l = document.elementFromPoint(o, r);
|
|
5915
5936
|
for (; l && !(i && n.lastScrollContainerX && n.lastScrollContainerY); )
|
|
5916
5937
|
l instanceof HTMLElement && d(l), l = l.parentElement;
|
|
@@ -5921,7 +5942,7 @@ function yt(e, t, n) {
|
|
|
5921
5942
|
}
|
|
5922
5943
|
i || Ht(n);
|
|
5923
5944
|
}
|
|
5924
|
-
function
|
|
5945
|
+
function _a(e) {
|
|
5925
5946
|
let t = document.elementFromPoint(e.x, e.y);
|
|
5926
5947
|
if (!Tt(t)) return;
|
|
5927
5948
|
let n, o = !0;
|
|
@@ -5971,48 +5992,48 @@ function ht(e, t) {
|
|
|
5971
5992
|
}
|
|
5972
5993
|
return n;
|
|
5973
5994
|
}
|
|
5974
|
-
function
|
|
5995
|
+
function Va(e) {
|
|
5975
5996
|
if (e instanceof HTMLElement) return e;
|
|
5976
5997
|
if ("current" in e && e.current instanceof HTMLElement)
|
|
5977
5998
|
return e.current;
|
|
5978
5999
|
console.warn("Invalid parent element", e);
|
|
5979
6000
|
}
|
|
5980
|
-
function
|
|
5981
|
-
const n =
|
|
6001
|
+
function ja(e, t) {
|
|
6002
|
+
const n = Va(e);
|
|
5982
6003
|
n && t(n);
|
|
5983
6004
|
}
|
|
5984
6005
|
var gt = /* @__PURE__ */ new WeakMap();
|
|
5985
|
-
function
|
|
6006
|
+
function Ua(e) {
|
|
5986
6007
|
const t = gt.get(e);
|
|
5987
6008
|
return t ? t[0] : (console.warn("No values found for parent element"), []);
|
|
5988
6009
|
}
|
|
5989
|
-
function
|
|
6010
|
+
function za(e, t) {
|
|
5990
6011
|
const n = gt.get(t);
|
|
5991
6012
|
n && n[1](e), gt.set(t, [e, n[1]]);
|
|
5992
6013
|
}
|
|
5993
|
-
function
|
|
6014
|
+
function Ha(e, t) {
|
|
5994
6015
|
return (n) => {
|
|
5995
|
-
gt.set(n, t),
|
|
6016
|
+
gt.set(n, t), Ki({ parent: n, getValues: Ua, setValues: za, config: e });
|
|
5996
6017
|
};
|
|
5997
6018
|
}
|
|
5998
|
-
function
|
|
6019
|
+
function mn(e) {
|
|
5999
6020
|
Zt && (Array.isArray(e) || (e = [e]), e.forEach((t) => {
|
|
6000
6021
|
const { parent: n, state: o, ...r } = t;
|
|
6001
|
-
|
|
6022
|
+
ja(n, Ha(r, o));
|
|
6002
6023
|
}));
|
|
6003
6024
|
}
|
|
6004
|
-
function
|
|
6025
|
+
function Ga(e, t = {}) {
|
|
6005
6026
|
const n = je(null), [o, r] = B(e);
|
|
6006
6027
|
function i(s = {}) {
|
|
6007
|
-
|
|
6028
|
+
mn({ parent: n, state: [o, r], ...s });
|
|
6008
6029
|
}
|
|
6009
6030
|
return Be(() => {
|
|
6010
|
-
|
|
6031
|
+
mn({ parent: n, state: [o, r], ...t });
|
|
6011
6032
|
}, [o]), Be(() => () => {
|
|
6012
|
-
n.current &&
|
|
6033
|
+
n.current && Pn(n.current);
|
|
6013
6034
|
}, []), [n, o, r, i];
|
|
6014
6035
|
}
|
|
6015
|
-
const
|
|
6036
|
+
const bn = {
|
|
6016
6037
|
border: {
|
|
6017
6038
|
selected: {
|
|
6018
6039
|
color: I.palette.blue.B400
|
|
@@ -6021,7 +6042,7 @@ const mn = {
|
|
|
6021
6042
|
color: I.palette.neutral.N40
|
|
6022
6043
|
}
|
|
6023
6044
|
}
|
|
6024
|
-
},
|
|
6045
|
+
}, Ba = E.ul`
|
|
6025
6046
|
list-style: none;
|
|
6026
6047
|
padding: 0;
|
|
6027
6048
|
margin: 0;
|
|
@@ -6030,15 +6051,15 @@ const mn = {
|
|
|
6030
6051
|
gap: 12px;
|
|
6031
6052
|
width: 100%;
|
|
6032
6053
|
justify-content: ${({ $isEmpty: e }) => e ? "center" : "flex-start"};
|
|
6033
|
-
`,
|
|
6054
|
+
`, qa = E.li`
|
|
6034
6055
|
& > div {
|
|
6035
6056
|
border: 1px solid
|
|
6036
6057
|
${({ theme: e, $active: t }) => {
|
|
6037
6058
|
var n, o, r, i;
|
|
6038
|
-
return t ? ((o = (n = e == null ? void 0 : e.border) == null ? void 0 : n.selected) == null ? void 0 : o.color) ||
|
|
6059
|
+
return t ? ((o = (n = e == null ? void 0 : e.border) == null ? void 0 : n.selected) == null ? void 0 : o.color) || bn.border.selected.color : ((i = (r = e == null ? void 0 : e.border) == null ? void 0 : r.clear) == null ? void 0 : i.color) || bn.border.clear.color;
|
|
6039
6060
|
}};
|
|
6040
6061
|
}
|
|
6041
|
-
`, Rt = "dnd:draggingLabel",
|
|
6062
|
+
`, Rt = "dnd:draggingLabel", vn = (e) => {
|
|
6042
6063
|
const {
|
|
6043
6064
|
emptyMessage: t,
|
|
6044
6065
|
id: n,
|
|
@@ -6048,10 +6069,10 @@ const mn = {
|
|
|
6048
6069
|
highlightFirst: s,
|
|
6049
6070
|
onMove: d,
|
|
6050
6071
|
locked: l = !1
|
|
6051
|
-
} = e, u =
|
|
6072
|
+
} = e, u = _.useRef(null), p = l ? [u, i] : Ga(i, { group: o }), [c, h] = p, [g, f] = _.useState(
|
|
6052
6073
|
null
|
|
6053
|
-
), v =
|
|
6054
|
-
|
|
6074
|
+
), v = _.useRef(i);
|
|
6075
|
+
_.useEffect(() => {
|
|
6055
6076
|
if (l) return;
|
|
6056
6077
|
const N = (C) => {
|
|
6057
6078
|
const A = C.detail ?? null;
|
|
@@ -6059,7 +6080,7 @@ const mn = {
|
|
|
6059
6080
|
};
|
|
6060
6081
|
return window.addEventListener(Rt, N), () => window.removeEventListener(Rt, N);
|
|
6061
6082
|
}, [l]);
|
|
6062
|
-
const T =
|
|
6083
|
+
const T = _.useCallback((N) => {
|
|
6063
6084
|
l || window.dispatchEvent(
|
|
6064
6085
|
new CustomEvent(Rt, { detail: N })
|
|
6065
6086
|
);
|
|
@@ -6068,16 +6089,16 @@ const mn = {
|
|
|
6068
6089
|
if (l) return;
|
|
6069
6090
|
const C = N.target, A = ($ = C == null ? void 0 : C.closest) == null ? void 0 : $.call(C, "li.dnd-item"), R = (A == null ? void 0 : A.getAttribute("data-label")) || null;
|
|
6070
6091
|
R && (f(R), T(R));
|
|
6071
|
-
}, D =
|
|
6092
|
+
}, D = _.useCallback(() => {
|
|
6072
6093
|
l || (f(null), T(null));
|
|
6073
6094
|
}, [T, l]);
|
|
6074
|
-
|
|
6095
|
+
_.useEffect(() => {
|
|
6075
6096
|
if (l) return;
|
|
6076
6097
|
const N = () => D();
|
|
6077
6098
|
return window.addEventListener("pointerup", N), window.addEventListener("blur", N), () => {
|
|
6078
6099
|
window.removeEventListener("pointerup", N), window.removeEventListener("blur", N);
|
|
6079
6100
|
};
|
|
6080
|
-
}, [D, l]),
|
|
6101
|
+
}, [D, l]), _.useEffect(() => {
|
|
6081
6102
|
if (l) return;
|
|
6082
6103
|
const N = v.current;
|
|
6083
6104
|
if (h.length !== N.length && h.length === N.length + 1) {
|
|
@@ -6098,7 +6119,7 @@ const mn = {
|
|
|
6098
6119
|
height: "-webkit-fill-available",
|
|
6099
6120
|
spacing: "wide",
|
|
6100
6121
|
children: /* @__PURE__ */ a(
|
|
6101
|
-
|
|
6122
|
+
Ba,
|
|
6102
6123
|
{
|
|
6103
6124
|
ref: c,
|
|
6104
6125
|
onPointerDownCapture: l ? void 0 : w,
|
|
@@ -6121,7 +6142,7 @@ const mn = {
|
|
|
6121
6142
|
) : h.map((N, C) => {
|
|
6122
6143
|
const A = !l && g === N;
|
|
6123
6144
|
return /* @__PURE__ */ a(
|
|
6124
|
-
|
|
6145
|
+
qa,
|
|
6125
6146
|
{
|
|
6126
6147
|
className: `dnd-item${A ? " is-dragging" : ""}`,
|
|
6127
6148
|
"data-label": N,
|
|
@@ -6146,7 +6167,7 @@ const mn = {
|
|
|
6146
6167
|
)
|
|
6147
6168
|
}
|
|
6148
6169
|
);
|
|
6149
|
-
},
|
|
6170
|
+
}, kl = (e) => {
|
|
6150
6171
|
const { group: t = "clients", left: n, right: o, onMove: r, locked: i = !1 } = e, s = (d) => {
|
|
6151
6172
|
i || r == null || r(d);
|
|
6152
6173
|
};
|
|
@@ -6159,7 +6180,7 @@ const mn = {
|
|
|
6159
6180
|
gap: "40px",
|
|
6160
6181
|
children: [
|
|
6161
6182
|
/* @__PURE__ */ a(
|
|
6162
|
-
|
|
6183
|
+
vn,
|
|
6163
6184
|
{
|
|
6164
6185
|
group: t,
|
|
6165
6186
|
highlightFirst: n.highlightFirst,
|
|
@@ -6172,7 +6193,7 @@ const mn = {
|
|
|
6172
6193
|
}
|
|
6173
6194
|
),
|
|
6174
6195
|
/* @__PURE__ */ a(
|
|
6175
|
-
|
|
6196
|
+
vn,
|
|
6176
6197
|
{
|
|
6177
6198
|
group: t,
|
|
6178
6199
|
highlightFirst: o.highlightFirst,
|
|
@@ -6187,7 +6208,7 @@ const mn = {
|
|
|
6187
6208
|
]
|
|
6188
6209
|
}
|
|
6189
6210
|
);
|
|
6190
|
-
},
|
|
6211
|
+
}, Wa = E.div`
|
|
6191
6212
|
& > button {
|
|
6192
6213
|
height: 66px;
|
|
6193
6214
|
min-width: 66px;
|
|
@@ -6205,7 +6226,7 @@ const mn = {
|
|
|
6205
6226
|
}
|
|
6206
6227
|
}
|
|
6207
6228
|
}
|
|
6208
|
-
`,
|
|
6229
|
+
`, Al = (e) => /* @__PURE__ */ a(Wa, { children: /* @__PURE__ */ a(Q, { ...e }) }), Ya = E.div`
|
|
6209
6230
|
display: flex;
|
|
6210
6231
|
justify-content: space-between;
|
|
6211
6232
|
align-items: center;
|
|
@@ -6234,14 +6255,14 @@ const mn = {
|
|
|
6234
6255
|
}
|
|
6235
6256
|
}
|
|
6236
6257
|
}
|
|
6237
|
-
`,
|
|
6258
|
+
`, Il = (e) => {
|
|
6238
6259
|
const { handleBack: t, handleNext: n, disabledBack: o, disabledNext: r, textValues: i } = e;
|
|
6239
|
-
return /* @__PURE__ */ m(
|
|
6260
|
+
return /* @__PURE__ */ m(Ya, { children: [
|
|
6240
6261
|
/* @__PURE__ */ a(
|
|
6241
6262
|
Q,
|
|
6242
6263
|
{
|
|
6243
6264
|
...e,
|
|
6244
|
-
iconBefore: /* @__PURE__ */ a(
|
|
6265
|
+
iconBefore: /* @__PURE__ */ a(Jn, {}),
|
|
6245
6266
|
variant: "none",
|
|
6246
6267
|
onClick: t,
|
|
6247
6268
|
children: i.back,
|
|
@@ -6252,7 +6273,7 @@ const mn = {
|
|
|
6252
6273
|
Q,
|
|
6253
6274
|
{
|
|
6254
6275
|
...e,
|
|
6255
|
-
iconBefore: /* @__PURE__ */ a(
|
|
6276
|
+
iconBefore: /* @__PURE__ */ a(Zn, {}),
|
|
6256
6277
|
variant: "none",
|
|
6257
6278
|
onClick: n,
|
|
6258
6279
|
children: i.next,
|
|
@@ -6260,34 +6281,34 @@ const mn = {
|
|
|
6260
6281
|
}
|
|
6261
6282
|
)
|
|
6262
6283
|
] });
|
|
6263
|
-
},
|
|
6264
|
-
const n =
|
|
6284
|
+
}, $l = (e) => Object.values(e).flat(), Fl = (e, t) => {
|
|
6285
|
+
const n = Te(e);
|
|
6265
6286
|
return Object.fromEntries(
|
|
6266
6287
|
Object.entries(n).map(([o, r]) => [o, r.map(t)])
|
|
6267
6288
|
);
|
|
6268
|
-
},
|
|
6289
|
+
}, Xa = (e) => Object.entries(e).map(([t, n]) => ({
|
|
6269
6290
|
ConditionGroupId: t,
|
|
6270
6291
|
conditionsThatEstablishesTheDecision: ct(n)
|
|
6271
|
-
})),
|
|
6272
|
-
const t =
|
|
6292
|
+
})), Rl = (e) => {
|
|
6293
|
+
const t = Te(e);
|
|
6273
6294
|
return {
|
|
6274
6295
|
...e,
|
|
6275
|
-
conditionGroups:
|
|
6296
|
+
conditionGroups: Xa(t),
|
|
6276
6297
|
// UI-only
|
|
6277
6298
|
conditionsThatEstablishesTheDecision: t
|
|
6278
6299
|
// preserve full structure
|
|
6279
6300
|
};
|
|
6280
|
-
},
|
|
6301
|
+
}, Pe = /* @__PURE__ */ new Map(), Qa = (e, t) => Pe.get(`${t}:${e}`), Ja = (e, t, n) => {
|
|
6281
6302
|
const o = `${t}:${e}`;
|
|
6282
|
-
if (
|
|
6283
|
-
const r =
|
|
6284
|
-
r !== void 0 &&
|
|
6285
|
-
}
|
|
6286
|
-
},
|
|
6287
|
-
const t = Date.now(), n =
|
|
6288
|
-
return t - n <
|
|
6289
|
-
},
|
|
6290
|
-
const t =
|
|
6303
|
+
if (Pe.set(o, n), Pe.size > 1e3) {
|
|
6304
|
+
const r = Pe.keys().next().value;
|
|
6305
|
+
r !== void 0 && Pe.delete(r);
|
|
6306
|
+
}
|
|
6307
|
+
}, yn = /* @__PURE__ */ new Map(), Za = 1e3, Ka = (e) => {
|
|
6308
|
+
const t = Date.now(), n = yn.get(e) || 0;
|
|
6309
|
+
return t - n < Za ? !0 : (yn.set(e, t), !1);
|
|
6310
|
+
}, el = (e) => {
|
|
6311
|
+
const t = lo(e);
|
|
6291
6312
|
return {
|
|
6292
6313
|
spa: "es",
|
|
6293
6314
|
eng: "en",
|
|
@@ -6296,14 +6317,14 @@ const mn = {
|
|
|
6296
6317
|
ita: "it",
|
|
6297
6318
|
por: "pt"
|
|
6298
6319
|
}[t] || "en";
|
|
6299
|
-
},
|
|
6300
|
-
const r = `${t}:${e}`, i =
|
|
6320
|
+
}, tl = async (e, t, { url: n, apiKey: o }) => {
|
|
6321
|
+
const r = `${t}:${e}`, i = Qa(e, t);
|
|
6301
6322
|
if (i) return i;
|
|
6302
|
-
if (
|
|
6323
|
+
if (Ka(r))
|
|
6303
6324
|
return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
|
|
6304
|
-
const s =
|
|
6325
|
+
const s = el(e);
|
|
6305
6326
|
try {
|
|
6306
|
-
const { data: d } = await
|
|
6327
|
+
const { data: d } = await ao.post(
|
|
6307
6328
|
n,
|
|
6308
6329
|
{
|
|
6309
6330
|
q: e,
|
|
@@ -6317,25 +6338,25 @@ const mn = {
|
|
|
6317
6338
|
}
|
|
6318
6339
|
}
|
|
6319
6340
|
), l = (d == null ? void 0 : d.translatedText) || e;
|
|
6320
|
-
return
|
|
6341
|
+
return Ja(e, t, l), l;
|
|
6321
6342
|
} catch (d) {
|
|
6322
6343
|
return console.warn(`[Translation] Failed for: "${e}"`, d), e;
|
|
6323
6344
|
}
|
|
6324
|
-
},
|
|
6345
|
+
}, nl = (e) => typeof e == "string" && e.trim().length > 0, Tn = async (e, t, n) => {
|
|
6325
6346
|
const o = await Promise.all(
|
|
6326
6347
|
Object.entries(e).map(async ([r, i]) => {
|
|
6327
|
-
if (
|
|
6328
|
-
const s = await
|
|
6348
|
+
if (nl(i)) {
|
|
6349
|
+
const s = await tl(i, t, n);
|
|
6329
6350
|
return [r, s];
|
|
6330
6351
|
} else if (Array.isArray(i)) {
|
|
6331
6352
|
const s = await Promise.all(
|
|
6332
6353
|
i.map(
|
|
6333
|
-
async (d) => typeof d == "object" && d !== null ? await
|
|
6354
|
+
async (d) => typeof d == "object" && d !== null ? await Tn(d, t, n) : d
|
|
6334
6355
|
)
|
|
6335
6356
|
);
|
|
6336
6357
|
return [r, s];
|
|
6337
6358
|
} else if (typeof i == "object" && i !== null) {
|
|
6338
|
-
const s = await
|
|
6359
|
+
const s = await Tn(i, t, n);
|
|
6339
6360
|
return [r, s];
|
|
6340
6361
|
} else
|
|
6341
6362
|
return [r, i];
|
|
@@ -6344,38 +6365,38 @@ const mn = {
|
|
|
6344
6365
|
return Object.fromEntries(o);
|
|
6345
6366
|
};
|
|
6346
6367
|
export {
|
|
6347
|
-
|
|
6368
|
+
Il as BackAndNextButton,
|
|
6348
6369
|
Xe as BusinessRuleCard,
|
|
6349
|
-
|
|
6370
|
+
En as BusinessRuleCardNew,
|
|
6350
6371
|
Qt as BusinessRuleView,
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6372
|
+
kn as BusinessRuleViewNew,
|
|
6373
|
+
ml as BusinessRules,
|
|
6374
|
+
vl as BusinessRulesNew,
|
|
6375
|
+
bl as BusinessRulesWithGroup,
|
|
6376
|
+
kl as DragAndDropBoxes,
|
|
6377
|
+
vn as DraggableList,
|
|
6378
|
+
Ui as DropdownMenu,
|
|
6379
|
+
Nl as DropdownMenuContainer,
|
|
6359
6380
|
de as EValueHowToSetUp,
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
+
yl as Filter,
|
|
6382
|
+
Tl as FormFilter,
|
|
6383
|
+
Cn as ModalRules,
|
|
6384
|
+
Li as RulesForm,
|
|
6385
|
+
Al as SendButton,
|
|
6386
|
+
ti as buildEsConditionSentence,
|
|
6387
|
+
Di as convertRangeToString,
|
|
6388
|
+
Nn as filterByGroup,
|
|
6389
|
+
$l as flatFromGroups,
|
|
6390
|
+
xl as formatDecisionForBackend,
|
|
6391
|
+
Te as getConditionsByGroupNew,
|
|
6392
|
+
Xa as groupsRecordToArrayNew,
|
|
6393
|
+
Fl as mapByGroupNew,
|
|
6394
|
+
Rl as normalizeDecisionToNewShape,
|
|
6395
|
+
Dl as parseRangeFromString,
|
|
6396
|
+
wl as revertSortedDataSampleSwitchPlaces,
|
|
6397
|
+
Cl as revertSortedDataSwitchPlaces,
|
|
6398
|
+
Sl as sortDisplayDataSampleSwitchPlaces,
|
|
6399
|
+
El as sortDisplayDataSwitchPlaces,
|
|
6400
|
+
Tn as translateObject,
|
|
6401
|
+
tl as translateText
|
|
6381
6402
|
};
|