@isettingkit/business-rules 2.2.11 → 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.
Files changed (2) hide show
  1. package/dist/index.es.js +717 -698
  2. package/package.json +8 -8
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 zn, MdExpandLess as Hn, MdExpandMore as Lt, MdInfo as Gn, MdCached as Bn, MdOutlineInfo as qn, MdClose as Wn, MdOutlineFilterAltOff as Yn, MdOutlineFilterAlt as Tn, MdChevronRight as Kt, MdArrowRight as Xn, MdOutlineArrowCircleLeft as Qn, MdOutlineArrowCircleRight as Jn } 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 ke, Box as Zn, Tag as Pe, Tabs as xn, SkeletonIcon as Kn, Fieldset as Ve, OptionList as eo, Checkpicker as to } from "@inubekit/inubekit";
4
- import E, { keyframes as Wt, ThemeContext as no } from "styled-components";
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 Ee, DecisionViewConditionRendererNew as it } from "@isettingkit/view";
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 pe, mixed as $e, object as te, number as he, lazy as Ge, date as Ae } from "yup";
10
- import P, { useState as B, useRef as je, useEffect as Be, useContext as oo } from "react";
11
- import { Link as Dn, useLocation as ro } from "react-router-dom";
12
- import io from "axios";
13
- import { franc as ao } from "franc-min";
14
- const lo = E.div`
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(lo, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "16px", padding: "12px 16px", children: [
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
- }, so = (e) => e.value, co = (e) => e.value, uo = (e) => e.value, po = (e) => ({
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
- }), ho = (e) => e.value, go = (e) => e.value, fo = (e) => e.value;
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 mo = {
75
- [k.LIST_OF_VALUES]: co,
76
- [k.LIST_OF_VALUES_MULTI]: uo,
77
- [k.RANGE]: po,
78
- [k.GREATER_THAN]: ho,
79
- [k.LESS_THAN]: go,
80
- [k.EQUAL]: fo
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 = mo[e == null ? void 0 : e.howToSetTheDecision] || so;
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
- `, bo = (e) => {
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
- Ee,
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
- Ee,
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
- Ee,
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
- bo,
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
- }, vo = E.div`
261
+ }, yo = E.div`
262
262
  position: relative;
263
263
  & > div {
264
264
  padding: 24px 16px;
265
265
  }
266
- `, yo = E.div`
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
- `, wn = (e) => {
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(vo, { smallScreen: s, children: /* @__PURE__ */ a(Bt, { children: /* @__PURE__ */ a(yo, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "24px", children: [
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
- }, To = Wt`
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 Cn = E.div`
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: ${To} 600ms ease-out;
365
+ animation: ${xo} 600ms ease-out;
366
366
  }
367
- `, xo = E.div`
367
+ `, Do = E.div`
368
368
  & > div > div {
369
369
  border-radius: 8px;
370
370
  box-sizing: border-box;
371
371
  }
372
- `, Do = E.div`
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
- `, wo = (e) => {
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
- }, Co = (e) => {
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
- }, So = (e) => {
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
- Cn,
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
- }, Eo = {
452
- loading: wo,
453
- decision: Co,
454
- add: So
451
+ }, No = {
452
+ loading: Co,
453
+ decision: So,
454
+ add: Eo
455
455
  }, Ot = (e) => {
456
- const { type: t } = e, n = Eo[t];
456
+ const { type: t } = e, n = No[t];
457
457
  return n ? n(e) : null;
458
- }, No = (e) => {
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
- }, hl = (e) => {
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 } = No({
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(xo, { children: /* @__PURE__ */ a(Do, { children: /* @__PURE__ */ a(y, { direction: "column", gap: "16px", padding: "6px", children: S ? /* @__PURE__ */ m(
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
- wn,
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
- $i,
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
- }, ko = E.div`
605
+ }, Ao = E.div`
606
606
  position: relative;
607
607
  & > div {
608
608
  padding: 24px 16px;
609
609
  }
610
- `, Ao = E.div`
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
- `, Io = (e) => {
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(ko, { $smallScreen: s, children: /* @__PURE__ */ a(Bt, { children: /* @__PURE__ */ a(Ao, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "24px", children: [
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
- }, $o = Wt`
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: ${$o} 600ms ease-out;
710
+ animation: ${Fo} 600ms ease-out;
711
711
  }
712
712
  `;
713
- const Fo = E.div`
713
+ const Ro = E.div`
714
714
  & > div > div {
715
715
  border-radius: 8px;
716
716
  box-sizing: border-box;
717
717
  }
718
- `, Ro = E.div`
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
- `, Lo = (e) => {
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
- }, Oo = (e) => e.value, Mo = (e) => e.value, _o = (e) => e.value, Po = (e) => ({
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
- }), Vo = (e) => e.value, jo = (e) => e.value, Uo = (e) => e.value, zo = {
756
- [k.LIST_OF_VALUES]: Mo,
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]: Po,
759
- [k.GREATER_THAN]: Vo,
760
- [k.LESS_THAN]: jo,
761
- [k.EQUAL]: Uo
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 = zo[e == null ? void 0 : e.howToSetTheDecision] || Oo;
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
- `, Ho = (e) => {
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
- Ee,
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
- Ee,
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
- Ee,
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
- }, Go = (e) => Array.isArray(e) ? e[0] : e ?? null, Bo = (e) => {
889
+ }, Bo = (e) => Array.isArray(e) ? e[0] : e ?? null, qo = (e) => {
890
890
  var t;
891
- return ((t = Go(e == null ? void 0 : e.conditionGroups)) == null ? void 0 : t.conditionsThatEstablishesTheDecision) ?? [];
892
- }, qo = (e) => {
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 = Bo(t).filter((h) => !(h != null && h.hidden)), u = Array.from({ length: 5 }), p = !!(!n && t && o && d), c = l.length < 2 ? "start" : "space-between";
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
- Ho,
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
- }, Wo = E.div`
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 Yo = (e) => {
977
+ const Xo = (e) => {
978
978
  const { children: t, controls: n = !0, handleDelete: o, id: r } = e;
979
- return /* @__PURE__ */ a(Wo, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "16px", padding: "12px 16px", children: [
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
- }, Xo = (e) => {
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
- Yo,
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
- qo,
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
- }, Qo = (e) => {
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
- Cn,
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
- }, Jo = {
1049
- loading: Lo,
1050
- decision: Xo,
1051
- add: Qo
1048
+ }, Zo = {
1049
+ loading: Oo,
1050
+ decision: Qo,
1051
+ add: Jo
1052
1052
  }, Mt = (e) => {
1053
- const { type: t } = e, n = Jo[t];
1053
+ const { type: t } = e, n = Zo[t];
1054
1054
  return n ? n(e) : null;
1055
- }, Zo = (e) => ({
1056
- schema: pe().required("Requerido").test(
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
- }), Ko = (e) => ({
1063
- schema: $e().test(
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
- }), er = (e) => ({
1072
- schema: $e().test(
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
- }), tr = (e) => {
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: he().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: he().min(0, "El campo 'Rango hasta' debe ser mayor o igual a 0").required("El campo 'Rango hasta' es requerido").test(
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: he().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"),
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: pe().required("Requerido"),
1100
+ schema: ge().required("Requerido"),
1101
1101
  value: e
1102
- }, nr = {
1103
- [k.LIST_OF_VALUES]: Ko,
1104
- [k.LIST_OF_VALUES_MULTI]: er,
1105
- [k.RANGE]: tr,
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
- }, or = (e) => nr[e] || Zo;
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), rr = (e, t) => {
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 ir({
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: pe().required("El nombre de la regla es requerido"),
1155
- value: Ge(() => or(
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 = Ae().required("La fecha de inicio es requerida"), l.validUntil = Ae().when(
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 ? [] : rr(g, o), T = {
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 ar = E.div`
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
- `, lr = E.div`
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
- `, sr = (e) => {
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
- }, dr = (e) => {
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
- ke,
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
- ke,
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
- }, cr = (e) => {
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(ar, { children: /* @__PURE__ */ a(lr, { children: /* @__PURE__ */ m(
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
- sr,
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
- dr,
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
- }, ur = (e) => {
1456
+ }, pr = (e) => {
1457
1457
  var g, f;
1458
- const { decision: t, onSubmitEvent: n, textValues: o, onCancel: r } = e, { formik: i, handleToggleNoneChange: s } = ir({
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
- cr,
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
- }, pr = (e) => {
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
- }, gl = (e) => {
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 } = pr({
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(Fo, { children: /* @__PURE__ */ a(Ro, { children: /* @__PURE__ */ a(y, { direction: "column", gap: "16px", padding: "6px", children: S ? /* @__PURE__ */ m(
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
- Io,
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
- ur,
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
- }, Sn = (e) => {
1651
+ }, En = (e) => {
1652
1652
  const { children: t } = e;
1653
- return /* @__PURE__ */ a(Zn, { width: "100%", children: t });
1654
- }, hr = (e) => e.value, gr = (e) => e.value, fr = (e) => e.value, mr = (e) => ({
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
- }), br = (e) => e.value, vr = (e) => e.value, yr = (e) => e.value, Tr = {
1658
- [k.LIST_OF_VALUES]: gr,
1659
- [k.LIST_OF_VALUES_MULTI]: fr,
1660
- [k.RANGE]: mr,
1661
- [k.GREATER_THAN]: br,
1662
- [k.LESS_THAN]: vr,
1663
- [k.EQUAL]: yr
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 : (Tr[e == null ? void 0 : e.howToSetTheDecision] || hr)(t) : t || void 0;
1682
- }, xr = E.div`
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 = P.forwardRef(
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
- xr,
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 Dr = E.div`
1779
+ const wr = E.div`
1780
1780
  cursor: pointer;
1781
- `, wr = E.div`
1781
+ `, Cr = E.div`
1782
1782
  & > div > div > div > p {
1783
1783
  text-wrap-mode: nowrap;
1784
1784
  }
1785
- `, Cr = E.div`
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 Sr = (e) => {
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(Dr, { onClick: u, children: /* @__PURE__ */ m(
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(wr, { children: /* @__PURE__ */ a(
1824
- Pe,
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(Cr, { children: /* @__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(zn, {}),
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(Hn, {}) : /* @__PURE__ */ a(Lt, {}),
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
- xn,
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(Kn, { animated: !0 })
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
- }, ye = (e) => {
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
- }, En = (e, t) => Object.fromEntries(
2010
+ }, Nn = (e, t) => Object.fromEntries(
2011
2011
  Object.entries(e).map(([n, o]) => [n, o.filter(t)])
2012
- ), Er = {
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
- }, _t = (e, t, n = !1) => {
2017
- const o = Er[t ?? ""];
2016
+ }, Pt = (e, t, n = !1) => {
2017
+ const o = Nr[t ?? ""];
2018
2018
  return o ? n ? `${e} ${o.labelView}` : `${e} ${o.label}` : e;
2019
- }, Nr = (e, t) => {
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
- }, Pt = (e) => {
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 ? Pt(n) || Pt(o) : !0;
2069
+ return n !== void 0 || o !== void 0 ? _t(n) || _t(o) : !0;
2070
2070
  }
2071
2071
  return !1;
2072
- }, kr = (e) => Pt(e == null ? void 0 : e.value), pt = (e, t) => e === "group-primary" ? "Condición principal" : `Condición alterna N° ${String(t).padStart(2, "0")}`, Ar = (e) => {
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
- }, Nn = (e) => {
2080
+ }, kn = (e) => {
2081
2081
  var St, Et, Nt;
2082
2082
  const {
2083
2083
  cardTitle: t = !0,
@@ -2116,18 +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) ? Ar(n).list : He(n), w = n ? {
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;
2126
- console.log("decisionMapper from library: ", w);
2127
- const D = P.useMemo(
2128
- () => n ? ye(n) : {},
2125
+ } : null, D = _.useMemo(
2126
+ () => n ? Te(n) : {},
2129
2127
  [n]
2130
- ), 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 = P.useMemo(() => {
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(() => {
2131
2129
  const O = {}, q = D[N] || [], ee = D["group-primary"] || [];
2132
2130
  O["group-primary"] = N === "group-primary" ? ee : [...q, ...ee];
2133
2131
  for (const x of S)
@@ -2135,35 +2133,35 @@ const Sr = (e) => {
2135
2133
  for (const x of Object.keys(D))
2136
2134
  x === "group-primary" || x === N || x in O || (O[x] = D[x]);
2137
2135
  return O;
2138
- }, [D, N, S]), A = P.useMemo(() => {
2136
+ }, [D, N, S]), A = _.useMemo(() => {
2139
2137
  const O = {};
2140
2138
  return Object.keys(C).forEach((q) => {
2141
2139
  const ee = C[q];
2142
2140
  ee && Array.isArray(ee) ? O[q] = ee.map((x) => {
2143
2141
  let L = x.labelName;
2144
- x.timeUnit && x.labelName && (L = _t(x.labelName, x.timeUnit));
2145
- let _ = x.value;
2146
- 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) !== "" && (_ = Nr(
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(
2147
2145
  x.value,
2148
2146
  x.howToSetTheCondition
2149
2147
  )), {
2150
2148
  ...x,
2151
2149
  labelName: L,
2152
- value: _
2150
+ value: P
2153
2151
  };
2154
2152
  }) : O[q] = ee;
2155
2153
  }), O;
2156
- }, [C]), R = En(
2154
+ }, [C]), R = Nn(
2157
2155
  A,
2158
2156
  (O) => !O.hidden
2159
- ), $ = P.useMemo(() => {
2157
+ ), $ = _.useMemo(() => {
2160
2158
  const O = Object.entries(R).map(
2161
- ([ee, x]) => [ee, x.filter(kr)]
2159
+ ([ee, x]) => [ee, x.filter(Ar)]
2162
2160
  ), q = {};
2163
2161
  for (const [ee, x] of O)
2164
2162
  x.length > 0 && (q[ee] = x);
2165
2163
  return q;
2166
- }, [R]), ae = P.useMemo(() => {
2164
+ }, [R]), ae = _.useMemo(() => {
2167
2165
  const O = Object.keys($);
2168
2166
  return O.includes("group-primary") ? ["group-primary", ...O.filter((q) => q !== "group-primary")] : O;
2169
2167
  }, [$]), le = {};
@@ -2175,11 +2173,11 @@ const Sr = (e) => {
2175
2173
  label: O === "group-primary" ? pt(O, 0) : pt(O, Number(q.split("-").at(-1))),
2176
2174
  isDisabled: !1
2177
2175
  };
2178
- }), [Ze, xt] = P.useState(
2176
+ }), [Ze, xt] = _.useState(
2179
2177
  ((Nt = Je[0]) == null ? void 0 : Nt.id) ?? "mainCondition"
2180
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")}`;
2181
2179
  return /* @__PURE__ */ a(
2182
- Sr,
2180
+ Er,
2183
2181
  {
2184
2182
  conditionsAlignment: Ct,
2185
2183
  controls: p,
@@ -2204,7 +2202,7 @@ const Sr = (e) => {
2204
2202
  hasMultipleGroups: tt
2205
2203
  }
2206
2204
  );
2207
- }, Ir = Wt`
2205
+ }, $r = Wt`
2208
2206
  from {
2209
2207
  opacity: 0;
2210
2208
  transform: translateY(20px);
@@ -2238,7 +2236,7 @@ E.div`
2238
2236
  }};
2239
2237
  }
2240
2238
  `;
2241
- const $r = E.div`
2239
+ const Fr = E.div`
2242
2240
  & > div {
2243
2241
  box-shadow: 0px 2px 3px 0px
2244
2242
  ${({ theme: e }) => {
@@ -2247,18 +2245,18 @@ const $r = E.div`
2247
2245
  }};
2248
2246
  cursor: pointer;
2249
2247
  }
2250
- `, Fr = E.div`
2248
+ `, Rr = E.div`
2251
2249
  width: 100%;
2252
2250
  height: 100%;
2253
2251
  & > div {
2254
- animation: ${Ir} 600ms ease-out;
2252
+ animation: ${$r} 600ms ease-out;
2255
2253
  }
2256
- `, Rr = E.div`
2254
+ `, Lr = E.div`
2257
2255
  & > div > div {
2258
2256
  border-radius: 8px;
2259
2257
  box-sizing: border-box;
2260
2258
  }
2261
- `, Lr = E.div`
2259
+ `, Or = E.div`
2262
2260
  & > div {
2263
2261
  width: 100%;
2264
2262
  height: 100%;
@@ -2278,21 +2276,21 @@ const $r = E.div`
2278
2276
  border-radius: 8px;
2279
2277
  }
2280
2278
  }
2281
- `, Or = (e) => {
2279
+ `, Mr = (e) => {
2282
2280
  const { index: t, handleOpenModal: n } = e;
2283
2281
  return /* @__PURE__ */ a(
2284
- Sn,
2282
+ En,
2285
2283
  {
2286
2284
  id: `loading-card-${t}`,
2287
2285
  handleDelete: () => {
2288
2286
  },
2289
2287
  handleView: () => n ? n() : null,
2290
2288
  controls: !1,
2291
- children: /* @__PURE__ */ a(Nn, { loading: !0 })
2289
+ children: /* @__PURE__ */ a(kn, { loading: !0 })
2292
2290
  },
2293
2291
  `loading-card-${t}`
2294
2292
  );
2295
- }, Mr = (e) => {
2293
+ }, Pr = (e) => {
2296
2294
  const {
2297
2295
  cardTitle: t,
2298
2296
  decision: n,
@@ -2305,13 +2303,13 @@ const $r = E.div`
2305
2303
  onToggle: u
2306
2304
  } = e;
2307
2305
  return n ? /* @__PURE__ */ a(Qe, { children: /* @__PURE__ */ a(y, { direction: "column", gap: "4px", width: "100%", children: /* @__PURE__ */ a(
2308
- Sn,
2306
+ En,
2309
2307
  {
2310
2308
  id: n.decisionId,
2311
2309
  handleDelete: () => i ? i(n.decisionId) : null,
2312
2310
  handleView: () => r ? r(n) : null,
2313
2311
  children: /* @__PURE__ */ a(
2314
- Nn,
2312
+ kn,
2315
2313
  {
2316
2314
  cardTitle: t,
2317
2315
  controls: o,
@@ -2333,8 +2331,8 @@ const $r = E.div`
2333
2331
  handleOpenModal: o,
2334
2332
  shouldRenderEmptyMessage: r
2335
2333
  } = e;
2336
- return /* @__PURE__ */ a(Fr, { children: r ? null : /* @__PURE__ */ a(
2337
- $r,
2334
+ return /* @__PURE__ */ a(Rr, { children: r ? null : /* @__PURE__ */ a(
2335
+ Fr,
2338
2336
  {
2339
2337
  onClick: () => o ? o() : null,
2340
2338
  children: /* @__PURE__ */ a(
@@ -2370,14 +2368,14 @@ const $r = E.div`
2370
2368
  )
2371
2369
  }
2372
2370
  ) }, `add-decision-${n}`);
2373
- }, Pr = {
2374
- loading: Or,
2375
- decision: Mr,
2371
+ }, Vr = {
2372
+ loading: Mr,
2373
+ decision: Pr,
2376
2374
  add: _r
2377
2375
  }, Vt = (e) => {
2378
- const { type: t } = e, n = Pr[t];
2376
+ const { type: t } = e, n = Vr[t];
2379
2377
  return n ? n(e) : null;
2380
- }, Vr = (e) => {
2378
+ }, jr = (e) => {
2381
2379
  const {
2382
2380
  cardTitle: t,
2383
2381
  controls: n,
@@ -2417,13 +2415,13 @@ const $r = E.div`
2417
2415
  })
2418
2416
  ), h = ((r == null ? void 0 : r.length) === 0 || r.length < Math.floor(window.innerWidth / 300)) && !i && n;
2419
2417
  return { renderedCards: c, shouldRenderAddCard: h };
2420
- }, jr = E.div`
2418
+ }, Ur = E.div`
2421
2419
  position: relative;
2422
2420
  & > div {
2423
2421
  padding: 24px 16px;
2424
2422
  place-items: unset;
2425
2423
  }
2426
- `, Ur = E.div`
2424
+ `, zr = E.div`
2427
2425
  background-color: ${({ theme: e }) => {
2428
2426
  var t, n;
2429
2427
  return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || I.palette.neutral.N0;
@@ -2455,7 +2453,7 @@ const $r = E.div`
2455
2453
  background-color: #ebecf0;
2456
2454
  border-radius: 8px;
2457
2455
  }
2458
- `, zr = (e) => {
2456
+ `, Hr = (e) => {
2459
2457
  const { children: t, description: n, portalId: o, onCloseModal: r, title: i } = e, s = document.getElementById(o);
2460
2458
  if (!s)
2461
2459
  throw new Error(
@@ -2463,7 +2461,7 @@ const $r = E.div`
2463
2461
  );
2464
2462
  const d = ue("(max-width: 400px)");
2465
2463
  return Yt(
2466
- /* @__PURE__ */ a(jr, { smallScreen: d, children: /* @__PURE__ */ a(Bt, { children: /* @__PURE__ */ a(Ur, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "24px", children: [
2464
+ /* @__PURE__ */ a(Ur, { smallScreen: d, children: /* @__PURE__ */ a(Bt, { children: /* @__PURE__ */ a(zr, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "24px", children: [
2467
2465
  /* @__PURE__ */ m(y, { direction: "column", gap: "24px", children: [
2468
2466
  /* @__PURE__ */ m(y, { alignItems: "center", justifyContent: "space-between", children: [
2469
2467
  /* @__PURE__ */ m(y, { direction: "column", gap: "8px", children: [
@@ -2487,15 +2485,15 @@ const $r = E.div`
2487
2485
  ] }) }) }) }),
2488
2486
  s
2489
2487
  );
2490
- }, Hr = (e) => ({
2491
- schema: pe().required("Requerido").test(
2488
+ }, Gr = (e) => ({
2489
+ schema: ge().required("Requerido").test(
2492
2490
  "non-empty",
2493
2491
  "El valor no puede estar vacío",
2494
2492
  (t) => t != null && t.trim() !== ""
2495
2493
  ),
2496
2494
  value: e
2497
- }), Gr = (e) => ({
2498
- schema: $e().test(
2495
+ }), Br = (e) => ({
2496
+ schema: ve().test(
2499
2497
  "isArrayOrString",
2500
2498
  "Por favor selecciona una opcion",
2501
2499
  (t) => Array.isArray(t) ? t.every(
@@ -2503,8 +2501,8 @@ const $r = E.div`
2503
2501
  ) : typeof t == "string"
2504
2502
  ),
2505
2503
  value: e
2506
- }), Br = (e) => ({
2507
- schema: $e().test(
2504
+ }), qr = (e) => ({
2505
+ schema: ve().test(
2508
2506
  "isArrayOrString",
2509
2507
  "Por favor selecciona al menos una opcion",
2510
2508
  (t) => Array.isArray(t) ? t.every(
@@ -2512,12 +2510,12 @@ const $r = E.div`
2512
2510
  ) : typeof t == "string"
2513
2511
  ),
2514
2512
  value: e
2515
- }), qr = (e) => {
2513
+ }), Wr = (e) => {
2516
2514
  const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
2517
2515
  return {
2518
2516
  schema: te({
2519
- from: he().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"),
2520
- to: he().min(0, "El rengo hasta debe ser mayor o igual a 0").required("El rango hasta es requerido").test(
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(
2521
2519
  "is-greater",
2522
2520
  "El rengo hasta debe ser mayor a el rango desde",
2523
2521
  function(o) {
@@ -2528,47 +2526,70 @@ const $r = E.div`
2528
2526
  }),
2529
2527
  value: { from: t, to: n }
2530
2528
  };
2531
- }, It = (e, t) => {
2532
- if (typeof e == "object" && e !== null && "from" in e && "to" in e) {
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) {
2533
2540
  const n = e;
2534
2541
  return t === H.PERCENTAGE ? {
2535
2542
  schema: te({
2536
- from: he().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"),
2537
- to: he().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")
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")
2538
2545
  }),
2539
2546
  value: n
2540
2547
  } : {
2541
2548
  schema: te({
2542
- from: pe().required("Requerido"),
2543
- to: pe().required("Requerido")
2549
+ from: ge().required("Requerido"),
2550
+ to: ge().required("Requerido")
2544
2551
  }),
2545
2552
  value: n
2546
2553
  };
2547
2554
  }
2548
2555
  return t === H.PERCENTAGE ? {
2549
- schema: he().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"),
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"),
2550
2557
  value: e
2551
2558
  } : {
2552
- schema: pe().required("Requerido"),
2559
+ schema: ve().test("required", "Requerido", (n) => n == null ? !1 : typeof n == "string" ? n.trim().length > 0 : typeof n == "number" ? !Number.isNaN(n) : !1),
2553
2560
  value: e
2554
2561
  };
2555
- }, Wr = {
2556
- [k.LIST_OF_VALUES]: Gr,
2557
- [k.LIST_OF_VALUES_MULTI]: Br,
2558
- [k.RANGE]: qr,
2562
+ }, Yr = {
2563
+ [k.LIST_OF_VALUES]: Br,
2564
+ [k.LIST_OF_VALUES_MULTI]: qr,
2565
+ [k.RANGE]: Wr,
2559
2566
  [k.GREATER_THAN]: It,
2560
2567
  [k.LESS_THAN]: It,
2561
2568
  [k.EQUAL]: It
2562
- }, ln = (e) => Wr[e] || Hr, jt = (e) => e && typeof e == "object" && "value" in e ? e.value : e, sn = (e) => {
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) => {
2563
2584
  const t = jt(e);
2564
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;
2565
2586
  };
2566
- function Yr({
2587
+ function Jr({
2567
2588
  decision: e,
2568
2589
  onSubmitEvent: t,
2569
2590
  textValues: n
2570
2591
  }) {
2571
- const o = ye(e) || {}, r = () => Object.entries(o).flatMap(
2592
+ const o = Te(e) || {}, r = () => Object.entries(o).flatMap(
2572
2593
  ([h, g]) => g.map((f) => ({ group: h, cond: f }))
2573
2594
  ), i = Object.fromEntries(
2574
2595
  Object.entries(o).map(([h, g]) => {
@@ -2610,8 +2631,8 @@ function Yr({
2610
2631
  };
2611
2632
  let l;
2612
2633
  const u = {
2613
- ruleName: pe().required("El nombre de la decision es requerido"),
2614
- value: Ge(() => ln(
2634
+ ruleName: ge().required("El nombre de la decision es requerido"),
2635
+ value: Ge(() => Xr(e) ? Qr : sn(
2615
2636
  l.values.howToSetTheDecision
2616
2637
  )(
2617
2638
  l.values.value,
@@ -2627,7 +2648,7 @@ function Yr({
2627
2648
  var R, $;
2628
2649
  const C = ($ = (R = g == null ? void 0 : g.conditionsThatEstablishesTheDecision) == null ? void 0 : R[w]) == null ? void 0 : $[N.conditionName], A = jt(C);
2629
2650
  if (A !== void 0) {
2630
- const ae = ln(
2651
+ const ae = sn(
2631
2652
  N.howToSetTheCondition
2632
2653
  );
2633
2654
  S[N.conditionName] = ae(
@@ -2642,15 +2663,15 @@ function Yr({
2642
2663
  "Debe existir al menos una condición para que la decisión se valide correctamente.",
2643
2664
  (w) => !w || typeof w != "object" ? !1 : Object.values(w).some(
2644
2665
  (D) => D && typeof D == "object" && Object.values(D).some(
2645
- (S) => sn(S)
2666
+ (S) => dn(S)
2646
2667
  )
2647
2668
  )
2648
2669
  );
2649
2670
  })
2650
2671
  };
2651
- n.terms && (u.effectiveFrom = Ae().required(
2672
+ n.terms && (u.effectiveFrom = Ie().required(
2652
2673
  "Se requiere la fecha de vigencia desde"
2653
- ), u.validUntil = Ae().when(
2674
+ ), u.validUntil = Ie().when(
2654
2675
  "checkClosed",
2655
2676
  (h, g, { parent: f }) => (f == null ? void 0 : f.checkClosed) ? g.required("Se requiere la fecha de vigencia hasta").test(
2656
2677
  "is-after-startDate",
@@ -2676,7 +2697,7 @@ function Yr({
2676
2697
  ...N,
2677
2698
  value: R
2678
2699
  };
2679
- }).filter((N) => sn(N.value));
2700
+ }).filter((N) => dn(N.value));
2680
2701
  return [v, D];
2681
2702
  })
2682
2703
  ), f = {
@@ -2738,7 +2759,7 @@ E.div`
2738
2759
  border-radius: 8px;
2739
2760
  }
2740
2761
  `;
2741
- const Xr = E.div`
2762
+ const Zr = E.div`
2742
2763
  display: flex;
2743
2764
  width: -webkit-fill-available;
2744
2765
  align-items: center;
@@ -2748,7 +2769,7 @@ const Xr = E.div`
2748
2769
  gap: 16px;
2749
2770
  width: -webkit-fill-available;
2750
2771
  }
2751
- `, Qr = (e) => {
2772
+ `, Kr = (e) => {
2752
2773
  const {
2753
2774
  onHandleStartChange: t,
2754
2775
  onHandleEndChange: n,
@@ -2791,7 +2812,7 @@ const Xr = E.div`
2791
2812
  gap: "24px",
2792
2813
  children: [
2793
2814
  /* @__PURE__ */ a(
2794
- ke,
2815
+ Ae,
2795
2816
  {
2796
2817
  id: "dateStart",
2797
2818
  label: r,
@@ -2805,7 +2826,7 @@ const Xr = E.div`
2805
2826
  }
2806
2827
  ),
2807
2828
  f && /* @__PURE__ */ a(
2808
- ke,
2829
+ Ae,
2809
2830
  {
2810
2831
  id: "dateEnd",
2811
2832
  label: i,
@@ -2822,7 +2843,7 @@ const Xr = E.div`
2822
2843
  }
2823
2844
  )
2824
2845
  ] });
2825
- }, Jr = (e) => {
2846
+ }, ei = (e) => {
2826
2847
  const {
2827
2848
  activeTab: t,
2828
2849
  conditionsErrorText: n,
@@ -2863,7 +2884,7 @@ const Xr = E.div`
2863
2884
  ) }),
2864
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: [
2865
2886
  /* @__PURE__ */ a(
2866
- xn,
2887
+ Dn,
2867
2888
  {
2868
2889
  onChange: l,
2869
2890
  tabs: p,
@@ -2874,7 +2895,7 @@ const Xr = E.div`
2874
2895
  /* @__PURE__ */ a(
2875
2896
  G,
2876
2897
  {
2877
- icon: /* @__PURE__ */ a(Gn, {}),
2898
+ icon: /* @__PURE__ */ a(Bn, {}),
2878
2899
  appearance: "help",
2879
2900
  onClick: T,
2880
2901
  cursorHover: !0
@@ -2884,7 +2905,7 @@ const Xr = E.div`
2884
2905
  Q,
2885
2906
  {
2886
2907
  type: "button",
2887
- iconBefore: /* @__PURE__ */ a(Bn, {}),
2908
+ iconBefore: /* @__PURE__ */ a(qn, {}),
2888
2909
  variant: "none",
2889
2910
  appearance: "gray",
2890
2911
  onClick: T,
@@ -2896,7 +2917,7 @@ const Xr = E.div`
2896
2917
  /* @__PURE__ */ a(y, { direction: "column", gap: "20px", children: o == null ? void 0 : o.map((S) => {
2897
2918
  const N = S.__scopedName ?? `${S.groupKey}.${S.conditionName}`;
2898
2919
  return /* @__PURE__ */ m(y, { gap: "16px", alignItems: "center", children: [
2899
- /* @__PURE__ */ m(Xr, { children: [
2920
+ /* @__PURE__ */ m(Zr, { children: [
2900
2921
  /* @__PURE__ */ a(
2901
2922
  en,
2902
2923
  {
@@ -2920,7 +2941,7 @@ const Xr = E.div`
2920
2941
  u && /* @__PURE__ */ a(F, { type: "label", size: "medium", appearance: "danger", children: n ?? "Existen errores en el formulario, por favor revísalos." })
2921
2942
  ] }) }),
2922
2943
  /* @__PURE__ */ a(Ve, { legend: "Vigencia", spacing: "wide", children: g.terms && /* @__PURE__ */ a(
2923
- Qr,
2944
+ Kr,
2924
2945
  {
2925
2946
  labelStart: g.termStart,
2926
2947
  labelEnd: g.termEnd,
@@ -2944,7 +2965,7 @@ const Xr = E.div`
2944
2965
  ] })
2945
2966
  ] }) }),
2946
2967
  v && f && /* @__PURE__ */ a(
2947
- wn,
2968
+ Cn,
2948
2969
  {
2949
2970
  portalId: f,
2950
2971
  title: "Redefinir la condición",
@@ -2969,18 +2990,18 @@ const Xr = E.div`
2969
2990
  }
2970
2991
  )
2971
2992
  ] });
2972
- }, Zr = (e) => {
2973
- const { label: t, howToSet: n, isFirst: o = !1 } = e, r = ti(t), i = ei(r), s = o ? "Que" : "Y que", d = i ? r : `${ni(r)} ${r}`, l = ai(n);
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);
2974
2995
  return `${s} ${d.toLowerCase()} ${l}`;
2975
- }, Kr = /^(el|la|los|las)\s/i;
2976
- function ei(e) {
2977
- return Kr.test(e);
2996
+ }, ni = /^(el|la|los|las)\s/i;
2997
+ function oi(e) {
2998
+ return ni.test(e);
2978
2999
  }
2979
- function ti(e) {
3000
+ function ri(e) {
2980
3001
  return e.replace(/\s+/g, " ").trim();
2981
3002
  }
2982
- function ni(e) {
2983
- const t = oi(e).toLowerCase(), n = /\b(s|es)\b/.test(ri(e).toLowerCase()) && !t.endsWith("és");
3003
+ function ii(e) {
3004
+ const t = ai(e).toLowerCase(), n = /\b(s|es)\b/.test(li(e).toLowerCase()) && !t.endsWith("és");
2984
3005
  return ({
2985
3006
  mano: "f",
2986
3007
  día: "m",
@@ -2992,21 +3013,21 @@ function ni(e) {
2992
3013
  antigüedad: "f",
2993
3014
  antiguedad: "f",
2994
3015
  puntaje: "m"
2995
- }[t] ?? ii(t)) === "f" ? n ? "las" : "la" : n ? "los" : "el";
3016
+ }[t] ?? si(t)) === "f" ? n ? "las" : "la" : n ? "los" : "el";
2996
3017
  }
2997
- function oi(e) {
3018
+ function ai(e) {
2998
3019
  return (e.toLowerCase().split(
2999
3020
  /\bdel\b|\bde la\b|\bde los\b|\bde las\b|\bde\b/
3000
3021
  )[0].trim().split(/\s+/)[0] ?? "").normalize("NFD").replace(/^[^a-záéíóúüñ]+/i, "");
3001
3022
  }
3002
- function ri(e) {
3023
+ function li(e) {
3003
3024
  const t = e.trim().split(/\s+/);
3004
3025
  return t[t.length - 1] || "";
3005
3026
  }
3006
- function ii(e) {
3027
+ function si(e) {
3007
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";
3008
3029
  }
3009
- function ai(e) {
3030
+ function di(e) {
3010
3031
  switch (e) {
3011
3032
  case k.EQUAL:
3012
3033
  return "sea";
@@ -3048,7 +3069,7 @@ const Oe = (e) => {
3048
3069
  default:
3049
3070
  return "";
3050
3071
  }
3051
- }, li = (e, t, n) => {
3072
+ }, ci = (e, t, n) => {
3052
3073
  const o = e == null ? void 0 : e.conditionGroups;
3053
3074
  if (!Array.isArray(o)) return;
3054
3075
  const r = o.find((s) => (s == null ? void 0 : s.ConditionGroupId) === t);
@@ -3057,10 +3078,10 @@ const Oe = (e) => {
3057
3078
  (s) => (s == null ? void 0 : s.conditionName) === n
3058
3079
  );
3059
3080
  return i == null ? void 0 : i.value;
3060
- }, si = (e, t, n) => {
3081
+ }, ui = (e, t, n) => {
3061
3082
  var o, r;
3062
3083
  return (r = (o = e == null ? void 0 : e.conditionsThatEstablishesTheDecision) == null ? void 0 : o[t]) == null ? void 0 : r[n];
3063
- }, di = (e) => {
3084
+ }, pi = (e) => {
3064
3085
  var q, ee;
3065
3086
  const {
3066
3087
  decision: t,
@@ -3070,11 +3091,11 @@ const Oe = (e) => {
3070
3091
  onRemoveCondition: i,
3071
3092
  onRestoreConditions: s,
3072
3093
  fullTemplate: d
3073
- } = e, { formik: l, handleToggleNoneChange: u } = Yr({
3094
+ } = e, { formik: l, handleToggleNoneChange: u } = Jr({
3074
3095
  decision: t,
3075
3096
  onSubmitEvent: n,
3076
3097
  textValues: o
3077
- }), p = d ?? t, c = ye(p), h = ye(t), g = En(
3098
+ }), p = d ?? t, c = Te(p), h = Te(t), g = Nn(
3078
3099
  h,
3079
3100
  (x) => !x.hidden
3080
3101
  ), f = Object.keys(g), v = [
@@ -3089,25 +3110,25 @@ const Oe = (e) => {
3089
3110
  label: x === "group-primary" ? pt(x, 0) : pt(x, Number(L.split("-").at(-1))),
3090
3111
  isDisabled: !1
3091
3112
  };
3092
- }), [S, N] = P.useState(
3113
+ }), [S, N] = _.useState(
3093
3114
  ((q = D[0]) == null ? void 0 : q.id) ?? "mainCondition"
3094
3115
  ), C = (x) => N(x), A = T[S] ?? "group-primary";
3095
- P.useEffect(() => {
3116
+ _.useEffect(() => {
3096
3117
  var W;
3097
3118
  const x = (W = l.values) == null ? void 0 : W.conditionsThatEstablishesTheDecision;
3098
3119
  let L = !1;
3099
3120
  if (x && typeof x == "object" && (L = Object.values(x).some(
3100
3121
  (X) => X && typeof X == "object" && Object.keys(X).length > 0
3101
3122
  )), L) return;
3102
- const _ = ye(t);
3103
- if (!_ || Object.keys(_).length === 0)
3123
+ const P = Te(t);
3124
+ if (!P || Object.keys(P).length === 0)
3104
3125
  return;
3105
3126
  const M = Object.fromEntries(
3106
- Object.entries(_).map(([X, U]) => {
3127
+ Object.entries(P).map(([X, U]) => {
3107
3128
  const me = Object.fromEntries(
3108
3129
  U.map((se) => {
3109
- const ge = Oe(se.howToSetTheCondition), ve = se.value ?? Me(ge);
3110
- return [se.conditionName, ve];
3130
+ const he = Oe(se.howToSetTheCondition), ye = se.value ?? Me(he);
3131
+ return [se.conditionName, ye];
3111
3132
  })
3112
3133
  );
3113
3134
  return [X, me];
@@ -3118,20 +3139,18 @@ const Oe = (e) => {
3118
3139
  M,
3119
3140
  !1
3120
3141
  );
3121
- }, [t]), P.useEffect(() => {
3142
+ }, [t]), _.useEffect(() => {
3122
3143
  var U;
3123
3144
  const x = (U = l.values) == null ? void 0 : U.conditionsThatEstablishesTheDecision;
3124
3145
  if (!x || typeof x != "object") return;
3125
- const L = ye(p), _ = Object.entries(x).map(
3146
+ const L = Te(p), P = Object.entries(x).map(
3126
3147
  ([me, se]) => {
3127
- const ge = L[me] || [], ve = Object.keys(se).map((be) => {
3128
- const z = se[be], ne = ge.find((Un) => Un.conditionName === be) || {}, kt = Oe(
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(
3129
3150
  ne.howToSetTheCondition ?? (z == null ? void 0 : z.howToSetTheCondition)
3130
3151
  ), ot = ne.value ?? Me(kt), rt = z && typeof z == "object" && "value" in z ? z.value : z;
3131
3152
  return {
3132
- // meta (labelName, descriptionUse, timeUnit, etc.)
3133
3153
  ...ne,
3134
- // any extra fields that might live in the wrapper
3135
3154
  ...typeof z == "object" && !Array.isArray(z) ? z : {},
3136
3155
  conditionName: be,
3137
3156
  value: rt !== void 0 ? rt : ot
@@ -3139,13 +3158,13 @@ const Oe = (e) => {
3139
3158
  });
3140
3159
  return {
3141
3160
  ConditionGroupId: me,
3142
- conditionsThatEstablishesTheDecision: ve
3161
+ conditionsThatEstablishesTheDecision: ye
3143
3162
  };
3144
3163
  }
3145
- ), M = l.values.conditionGroups, W = JSON.stringify(_), X = JSON.stringify(M ?? []);
3146
- W !== X && l.setFieldValue("conditionGroups", _, !1);
3164
+ ), M = l.values.conditionGroups, W = JSON.stringify(P), X = JSON.stringify(M ?? []);
3165
+ W !== X && l.setFieldValue("conditionGroups", P, !1);
3147
3166
  }, [(ee = l.values) == null ? void 0 : ee.conditionsThatEstablishesTheDecision, p]);
3148
- const R = P.useMemo(() => {
3167
+ const R = _.useMemo(() => {
3149
3168
  const x = [
3150
3169
  ...Object.keys(g).filter(
3151
3170
  (M) => M === "group-primary"
@@ -3155,60 +3174,60 @@ const Oe = (e) => {
3155
3174
  )
3156
3175
  ];
3157
3176
  let L = !1;
3158
- const _ = x.map((M) => {
3177
+ const P = x.map((M) => {
3159
3178
  const X = (g[M] ?? []).map((U, me) => {
3160
3179
  const se = !L && M === "group-primary" && me === 0;
3161
3180
  se && (L = !0);
3162
- const ge = Oe(U.howToSetTheCondition), ve = Zr({
3181
+ const he = Oe(U.howToSetTheCondition), ye = ti({
3163
3182
  label: U.labelName || "",
3164
- howToSet: ge,
3183
+ howToSet: he,
3165
3184
  isFirst: se
3166
- }), be = U.timeUnit ? _t("", U.timeUnit, !0).trim() : "", z = `${M}.${U.conditionName}`, ne = li(
3185
+ }), be = U.timeUnit ? Pt("", U.timeUnit, !0).trim() : "", z = `${M}.${U.conditionName}`, ne = ci(
3167
3186
  l.values,
3168
3187
  M,
3169
3188
  U.conditionName
3170
- ), kt = si(
3189
+ ), kt = ui(
3171
3190
  l.values,
3172
3191
  M,
3173
3192
  U.conditionName
3174
- ), ot = ne !== void 0 ? ne : kt, rt = ot !== void 0 ? ot : Me(ge);
3193
+ ), ot = ne !== void 0 ? ne : kt, rt = ot !== void 0 ? ot : Me(he);
3175
3194
  return {
3176
3195
  ...U,
3177
3196
  __originalConditionName: U.conditionName,
3178
3197
  __groupKey: M,
3179
- __howToSet: ge,
3198
+ __howToSet: he,
3180
3199
  __scopedName: z,
3181
3200
  conditionName: U.conditionName,
3182
3201
  groupKey: M,
3183
- labelName: ve,
3202
+ labelName: ye,
3184
3203
  __unitAfterInput: be,
3185
3204
  value: rt
3186
3205
  };
3187
3206
  });
3188
3207
  return [M, X];
3189
3208
  });
3190
- return Object.fromEntries(_);
3209
+ return Object.fromEntries(P);
3191
3210
  }, [g, l.values]), $ = R[A] ?? [], ae = R["group-primary"] ?? [], le = {
3192
3211
  decisionDataType: t.decisionDataType,
3193
3212
  howToSetTheCondition: t.howToSetTheDecision,
3194
3213
  labelName: t.labelName,
3195
3214
  listOfPossibleValues: t.listOfPossibleValues,
3196
3215
  ruleName: t.ruleName,
3197
- timeUnit: t.timeUnit ? _t("", t.timeUnit, !0).trim() : ""
3198
- }, 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 = P.useMemo(() => {
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(() => {
3199
3218
  const x = l.errors.conditionsThatEstablishesTheDecision;
3200
3219
  if (!x) return;
3201
3220
  if (typeof x == "string") return x;
3202
- const L = (_) => {
3203
- if (_) {
3204
- if (typeof _ == "string") return _;
3205
- if (Array.isArray(_))
3206
- 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) {
3207
3226
  const W = L(M);
3208
3227
  if (W) return W;
3209
3228
  }
3210
- else if (typeof _ == "object")
3211
- for (const M of Object.values(_)) {
3229
+ else if (typeof P == "object")
3230
+ for (const M of Object.values(P)) {
3212
3231
  const W = L(M);
3213
3232
  if (W) return W;
3214
3233
  }
@@ -3218,25 +3237,25 @@ const Oe = (e) => {
3218
3237
  }, [l.errors.conditionsThatEstablishesTheDecision]), Dt = l.submitCount > 0 && !!Ke, et = (x) => {
3219
3238
  const L = (x == null ? void 0 : x.__howToSet) ?? Oe(x == null ? void 0 : x.howToSetTheCondition);
3220
3239
  return Me(L);
3221
- }, tt = (x, L, _) => {
3222
- var U, me, se, ge, ve;
3240
+ }, tt = (x, L, P) => {
3241
+ var U, me, se, he, ye;
3223
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];
3224
- W && typeof W == "object" && !Array.isArray(W) ? l.setFieldValue(`${M}.value`, _, !1) : l.setFieldValue(M, _, !1);
3225
- const X = (ge = l.values) == null ? void 0 : ge.conditionGroups;
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;
3226
3245
  if (Array.isArray(X)) {
3227
3246
  const be = X.findIndex((z) => (z == null ? void 0 : z.ConditionGroupId) === x);
3228
3247
  if (be >= 0) {
3229
- const z = (ve = X[be].conditionsThatEstablishesTheDecision) == null ? void 0 : ve.findIndex(
3248
+ const z = (ye = X[be].conditionsThatEstablishesTheDecision) == null ? void 0 : ye.findIndex(
3230
3249
  (ne) => (ne == null ? void 0 : ne.conditionName) === L
3231
3250
  );
3232
3251
  if (z >= 0) {
3233
3252
  const ne = JSON.parse(JSON.stringify(X));
3234
- ne[be].conditionsThatEstablishesTheDecision[z].value = _, l.setFieldValue("conditionGroups", ne, !1);
3253
+ ne[be].conditionsThatEstablishesTheDecision[z].value = P, l.setFieldValue("conditionGroups", ne, !1);
3235
3254
  }
3236
3255
  }
3237
3256
  }
3238
3257
  }, wt = (x) => {
3239
- const [L, ..._] = x.split("."), M = _.join("."), W = Object.values(c).flat().find((U) => U.conditionName === M), X = et(W || {});
3258
+ const [L, ...P] = x.split("."), M = P.join("."), W = Object.values(c).flat().find((U) => U.conditionName === M), X = et(W || {});
3240
3259
  tt(L, M, X), l.setFieldTouched(
3241
3260
  `conditionsThatEstablishesTheDecision.${L}.${M}`,
3242
3261
  !1,
@@ -3244,12 +3263,12 @@ const Oe = (e) => {
3244
3263
  );
3245
3264
  }, nt = () => {
3246
3265
  (c[A] ?? []).forEach((L) => {
3247
- const _ = Oe(L == null ? void 0 : L.howToSetTheCondition), M = Me(_);
3266
+ const P = Oe(L == null ? void 0 : L.howToSetTheCondition), M = Me(P);
3248
3267
  tt(A, L.conditionName, M);
3249
3268
  });
3250
- }, [Ct, Le] = P.useState(!1);
3269
+ }, [Ct, Le] = _.useState(!1);
3251
3270
  return /* @__PURE__ */ a(
3252
- Jr,
3271
+ ei,
3253
3272
  {
3254
3273
  activeTab: S,
3255
3274
  conditionsErrorText: Ke,
@@ -3284,7 +3303,7 @@ const Oe = (e) => {
3284
3303
  }
3285
3304
  }
3286
3305
  );
3287
- }, fl = (e) => {
3306
+ }, vl = (e) => {
3288
3307
  const {
3289
3308
  cardTitle: t = !0,
3290
3309
  controls: n = !0,
@@ -3305,7 +3324,7 @@ const Oe = (e) => {
3305
3324
  onRestoreConditions: w,
3306
3325
  baseDecisionTemplate: D,
3307
3326
  shouldRenderEmptyMessage: S = !0
3308
- } = e, [N, C] = B(null), A = ue("(max-width: 681px)"), { renderedCards: R, shouldRenderAddCard: $ } = Vr({
3327
+ } = e, [N, C] = B(null), A = ue("(max-width: 681px)"), { renderedCards: R, shouldRenderAddCard: $ } = jr({
3309
3328
  cardTitle: t,
3310
3329
  controls: n,
3311
3330
  customTitleContentAddCard: o,
@@ -3318,7 +3337,7 @@ const Oe = (e) => {
3318
3337
  toggleAt: (le) => C((Re) => Re === le ? null : le)
3319
3338
  }), ae = (i == null ? void 0 : i.length) === 0 && !p;
3320
3339
  return /* @__PURE__ */ m(V, { children: [
3321
- /* @__PURE__ */ a(Rr, { children: /* @__PURE__ */ a(Lr, { children: /* @__PURE__ */ a(y, { direction: "column", gap: "16px", padding: "6px", children: S && (ae ? /* @__PURE__ */ a(Ve, { legend: "Decisiones", children: /* @__PURE__ */ m(
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(
3322
3341
  y,
3323
3342
  {
3324
3343
  direction: "column",
@@ -3331,7 +3350,7 @@ const Oe = (e) => {
3331
3350
  G,
3332
3351
  {
3333
3352
  appearance: "help",
3334
- icon: /* @__PURE__ */ a(qn, {}),
3353
+ icon: /* @__PURE__ */ a(Wn, {}),
3335
3354
  size: "40px"
3336
3355
  }
3337
3356
  ),
@@ -3382,14 +3401,14 @@ const Oe = (e) => {
3382
3401
  }
3383
3402
  )) }) }) }),
3384
3403
  l && /* @__PURE__ */ a(
3385
- zr,
3404
+ Hr,
3386
3405
  {
3387
3406
  portalId: "modal-portal",
3388
3407
  onCloseModal: h,
3389
3408
  title: u ? "Editar Decisión" : "Configurar Decisión",
3390
3409
  description: "Diligencia los campos para configurar tu decisión.",
3391
3410
  children: /* @__PURE__ */ a(
3392
- di,
3411
+ pi,
3393
3412
  {
3394
3413
  decision: u || d,
3395
3414
  fullTemplate: D ?? d,
@@ -3404,16 +3423,16 @@ const Oe = (e) => {
3404
3423
  }
3405
3424
  )
3406
3425
  ] });
3407
- }, ci = {
3426
+ }, hi = {
3408
3427
  border: {
3409
3428
  color: I.palette.neutral.N40
3410
3429
  }
3411
- }, ui = E.div`
3430
+ }, gi = E.div`
3412
3431
  border-width: 1px;
3413
3432
  border-style: solid;
3414
3433
  border-color: ${({ theme: e }) => {
3415
3434
  var t, n;
3416
- return ((n = (t = e == null ? void 0 : e.box) == null ? void 0 : t.border) == null ? void 0 : n.color) || ci.border.color;
3435
+ return ((n = (t = e == null ? void 0 : e.box) == null ? void 0 : t.border) == null ? void 0 : n.color) || hi.border.color;
3417
3436
  }};
3418
3437
  border-radius: ${({ $borderRadius: e }) => e};
3419
3438
  margin: ${({ $margin: e }) => e};
@@ -3422,7 +3441,7 @@ const Oe = (e) => {
3422
3441
  height: ${({ $height: e }) => e};
3423
3442
  box-sizing: border-box;
3424
3443
  `;
3425
- function pi(e) {
3444
+ function fi(e) {
3426
3445
  const {
3427
3446
  children: t,
3428
3447
  padding: n = "16px",
@@ -3432,7 +3451,7 @@ function pi(e) {
3432
3451
  height: s
3433
3452
  } = e;
3434
3453
  return /* @__PURE__ */ a(
3435
- ui,
3454
+ gi,
3436
3455
  {
3437
3456
  $padding: n,
3438
3457
  $margin: o,
@@ -3443,7 +3462,7 @@ function pi(e) {
3443
3462
  }
3444
3463
  );
3445
3464
  }
3446
- const hi = (e, t) => {
3465
+ const mi = (e, t) => {
3447
3466
  const [n, o] = B([]), [r, i] = B([]), [s, d] = B(!1), l = je(null);
3448
3467
  return Be(() => {
3449
3468
  if (!e.current || !l.current) return;
@@ -3470,19 +3489,19 @@ E.div`
3470
3489
  width: 100%;
3471
3490
  }
3472
3491
  `;
3473
- const gi = E.div`
3492
+ const bi = E.div`
3474
3493
  position: absolute;
3475
3494
  top: calc(100% + 4px);
3476
3495
  right: 0;
3477
3496
  z-index: 1000;
3478
3497
  width: 170px;
3479
- `, fi = E.div`
3498
+ `, vi = E.div`
3480
3499
  position: absolute;
3481
3500
  visibility: hidden;
3482
3501
  pointer-events: none;
3483
3502
  height: 0;
3484
3503
  overflow: hidden;
3485
- `, mi = E.div`
3504
+ `, yi = E.div`
3486
3505
  cursor: pointer;
3487
3506
  `, Ut = {
3488
3507
  border: {
@@ -3520,7 +3539,7 @@ const gi = E.div`
3520
3539
  hover: I.palette.neutral.N30
3521
3540
  }
3522
3541
  }
3523
- }, bi = E.li`
3542
+ }, Ti = E.li`
3524
3543
  display: flex;
3525
3544
  align-items: center;
3526
3545
  align-self: stretch;
@@ -3538,11 +3557,11 @@ const gi = E.div`
3538
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;
3539
3558
  }};
3540
3559
  }
3541
- `, vi = (e) => {
3560
+ `, xi = (e) => {
3542
3561
  var h, g, f, v, T, w;
3543
- const { id: t, label: n, leadingIcon: o, onClose: r } = e, [i, s] = B(!1), d = () => s(!0), l = () => s(!1), u = oo(no), 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;
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;
3544
3563
  return /* @__PURE__ */ a(
3545
- bi,
3564
+ Ti,
3546
3565
  {
3547
3566
  id: t,
3548
3567
  onMouseEnter: d,
@@ -3578,7 +3597,7 @@ const gi = E.div`
3578
3597
  /* @__PURE__ */ a(
3579
3598
  G,
3580
3599
  {
3581
- icon: /* @__PURE__ */ a(Wn, {}),
3600
+ icon: /* @__PURE__ */ a(Yn, {}),
3582
3601
  size: "small",
3583
3602
  onClick: (D) => {
3584
3603
  D.stopPropagation(), r == null || r();
@@ -3592,7 +3611,7 @@ const gi = E.div`
3592
3611
  )
3593
3612
  }
3594
3613
  );
3595
- }, ml = (e) => {
3614
+ }, yl = (e) => {
3596
3615
  const {
3597
3616
  appliedFilters: t = [],
3598
3617
  onClear: n,
@@ -3605,7 +3624,7 @@ const gi = E.div`
3605
3624
  hidden: c,
3606
3625
  showOverflowIndicator: h,
3607
3626
  measurementRef: g
3608
- } = hi(d, t), [f, v] = B(!1), T = (C) => {
3627
+ } = mi(d, t), [f, v] = B(!1), T = (C) => {
3609
3628
  C.stopPropagation(), v((A) => !A);
3610
3629
  };
3611
3630
  Be(() => {
@@ -3625,9 +3644,9 @@ const gi = E.div`
3625
3644
  var A, R;
3626
3645
  (R = (A = c.find(($) => $.label === C)) == null ? void 0 : A.onClose) == null || R.call(A), v(!1);
3627
3646
  };
3628
- return /* @__PURE__ */ m(pi, { borderRadius: "8px", width: "100%", children: [
3629
- /* @__PURE__ */ a(fi, { ref: g, children: t.map((C) => /* @__PURE__ */ a("div", { "data-filter-tag": "true", children: /* @__PURE__ */ a(
3630
- Pe,
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,
3631
3650
  {
3632
3651
  appearance: "primary",
3633
3652
  displayIcon: !0,
@@ -3652,7 +3671,7 @@ const gi = E.div`
3652
3671
  border: !0,
3653
3672
  children: w ? /* @__PURE__ */ a(F, { size: "small", type: "label", appearance: "gray", children: r }) : /* @__PURE__ */ m(V, { children: [
3654
3673
  p.map((C) => /* @__PURE__ */ a(
3655
- Pe,
3674
+ _e,
3656
3675
  {
3657
3676
  "data-filter-tag": "true",
3658
3677
  appearance: "primary",
@@ -3670,20 +3689,20 @@ const gi = E.div`
3670
3689
  ref: u,
3671
3690
  style: { position: "relative", display: "inline-block" },
3672
3691
  children: [
3673
- /* @__PURE__ */ a(mi, { onClick: T, children: /* @__PURE__ */ a(
3674
- Pe,
3692
+ /* @__PURE__ */ a(yi, { onClick: T, children: /* @__PURE__ */ a(
3693
+ _e,
3675
3694
  {
3676
3695
  appearance: "primary",
3677
3696
  label: `+${c.length}`
3678
3697
  }
3679
3698
  ) }),
3680
- D && /* @__PURE__ */ a(gi, { ref: l, children: /* @__PURE__ */ a(
3681
- eo,
3699
+ D && /* @__PURE__ */ a(bi, { ref: l, children: /* @__PURE__ */ a(
3700
+ to,
3682
3701
  {
3683
3702
  options: S,
3684
3703
  onOptionClick: N,
3685
3704
  children: c.map((C) => /* @__PURE__ */ a(
3686
- vi,
3705
+ xi,
3687
3706
  {
3688
3707
  id: C.label,
3689
3708
  label: C.label,
@@ -3708,7 +3727,7 @@ const gi = E.div`
3708
3727
  {
3709
3728
  cursorHover: !0,
3710
3729
  disabled: w,
3711
- iconBefore: /* @__PURE__ */ a(Yn, {}),
3730
+ iconBefore: /* @__PURE__ */ a(Xn, {}),
3712
3731
  onClick: n,
3713
3732
  variant: "outlined",
3714
3733
  children: i
@@ -3718,7 +3737,7 @@ const gi = E.div`
3718
3737
  Q,
3719
3738
  {
3720
3739
  cursorHover: !0,
3721
- iconBefore: /* @__PURE__ */ a(Tn, {}),
3740
+ iconBefore: /* @__PURE__ */ a(xn, {}),
3722
3741
  onClick: o,
3723
3742
  variant: "outlined",
3724
3743
  children: s
@@ -3726,12 +3745,12 @@ const gi = E.div`
3726
3745
  )
3727
3746
  ] })
3728
3747
  ] });
3729
- }, bl = (e) => {
3748
+ }, Tl = (e) => {
3730
3749
  const { appliedFilters: t, fields: n, onChange: o, noFiltersLabel: r } = e, i = ue("(max-width: 768px)"), s = !t || t.length === 0;
3731
3750
  return /* @__PURE__ */ m(y, { direction: "column", gap: "16px", children: [
3732
3751
  i && /* @__PURE__ */ m(V, { children: [
3733
3752
  /* @__PURE__ */ m(y, { gap: "6px", width: "100%", alignItems: "center", children: [
3734
- /* @__PURE__ */ a(G, { appearance: "gray", icon: /* @__PURE__ */ a(Tn, {}) }),
3753
+ /* @__PURE__ */ a(G, { appearance: "gray", icon: /* @__PURE__ */ a(xn, {}) }),
3735
3754
  /* @__PURE__ */ a(
3736
3755
  ce,
3737
3756
  {
@@ -3745,7 +3764,7 @@ const gi = E.div`
3745
3764
  width: "100%",
3746
3765
  height: "36px",
3747
3766
  children: s ? /* @__PURE__ */ a(F, { size: "small", type: "label", appearance: "gray", children: r }) : t == null ? void 0 : t.map((d) => /* @__PURE__ */ a(
3748
- Pe,
3767
+ _e,
3749
3768
  {
3750
3769
  appearance: "primary",
3751
3770
  displayIcon: !0,
@@ -3764,7 +3783,7 @@ const gi = E.div`
3764
3783
  n.map((d) => /* @__PURE__ */ m(y, { gap: "6px", alignItems: "center", children: [
3765
3784
  /* @__PURE__ */ a(y, { padding: "22px 0 0 0", children: /* @__PURE__ */ a(G, { appearance: "primary", icon: d.icon }) }),
3766
3785
  /* @__PURE__ */ a(
3767
- to,
3786
+ no,
3768
3787
  {
3769
3788
  disabled: d.disabled,
3770
3789
  invalid: d.invalid,
@@ -3782,12 +3801,12 @@ const gi = E.div`
3782
3801
  )
3783
3802
  ] }, d.name))
3784
3803
  ] });
3785
- }, yi = (e) => {
3804
+ }, Di = (e) => {
3786
3805
  const t = [];
3787
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(";");
3788
- }, vl = (e) => {
3807
+ }, xl = (e) => {
3789
3808
  var s;
3790
- const { decision: t, fallbackId: n, template: o } = e, r = (d) => typeof d == "object" && d !== null && "from" in d && "to" in d ? yi(d) : d, i = ((s = t.conditionsThatEstablishesTheDecision) == null ? void 0 : s.map((d, l) => {
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) => {
3791
3810
  var c;
3792
3811
  const u = d == null ? void 0 : d.value;
3793
3812
  return u == null || typeof u == "string" && u.trim() === "" || Array.isArray(u) && u.length === 0 ? null : {
@@ -3803,7 +3822,7 @@ const gi = E.div`
3803
3822
  value: r(t.value),
3804
3823
  conditionsThatEstablishesTheDecision: i
3805
3824
  };
3806
- }, yl = (e) => {
3825
+ }, Dl = (e) => {
3807
3826
  if (typeof e != "string") return e;
3808
3827
  const t = e.split(";").map((o) => o.trim()), n = {};
3809
3828
  for (const o of t)
@@ -3815,7 +3834,7 @@ const gi = E.div`
3815
3834
  isNaN(r) || (n.to = r);
3816
3835
  }
3817
3836
  return n.from !== void 0 || n.to !== void 0 ? n : e;
3818
- }, Tl = (e) => {
3837
+ }, wl = (e) => {
3819
3838
  const { dataDecision: t, originalDecision: n } = e, o = {
3820
3839
  conditionName: t.ruleName || "",
3821
3840
  labelName: t.labelName || "",
@@ -3831,7 +3850,7 @@ const gi = E.div`
3831
3850
  (r) => r.hidden ? { ...o } : r
3832
3851
  )
3833
3852
  };
3834
- }, xl = (e) => {
3853
+ }, Cl = (e) => {
3835
3854
  const { decisions: t } = e;
3836
3855
  return t == null ? void 0 : t.map((n) => {
3837
3856
  var r;
@@ -3850,15 +3869,15 @@ const gi = E.div`
3850
3869
  )
3851
3870
  } : n;
3852
3871
  });
3853
- }, Ti = (e) => ({
3854
- schema: pe().required("Requerido").test(
3872
+ }, wi = (e) => ({
3873
+ schema: ge().required("Requerido").test(
3855
3874
  "non-empty",
3856
3875
  "El valor no puede estar vacío",
3857
3876
  (t) => t != null && t.trim() !== ""
3858
3877
  ),
3859
3878
  value: e
3860
- }), xi = (e) => ({
3861
- schema: $e().test(
3879
+ }), Ci = (e) => ({
3880
+ schema: ve().test(
3862
3881
  "isArrayOrString",
3863
3882
  "Debe ser un array de strings/numbers o un solo string",
3864
3883
  (t) => Array.isArray(t) ? t.every(
@@ -3866,8 +3885,8 @@ const gi = E.div`
3866
3885
  ) : typeof t == "string"
3867
3886
  ),
3868
3887
  value: e
3869
- }), Di = (e) => ({
3870
- schema: $e().test(
3888
+ }), Si = (e) => ({
3889
+ schema: ve().test(
3871
3890
  "isArrayOrString",
3872
3891
  "Debe ser un array de strings/numbers o un solo string ",
3873
3892
  (t) => Array.isArray(t) ? t.every(
@@ -3875,12 +3894,12 @@ const gi = E.div`
3875
3894
  ) : typeof t == "string"
3876
3895
  ),
3877
3896
  value: e
3878
- }), wi = (e) => {
3897
+ }), Ei = (e) => {
3879
3898
  const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
3880
3899
  return {
3881
3900
  schema: te({
3882
- from: he().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"),
3883
- to: he().min(0, "El campo 'Rango hasta' debe ser mayor o igual a 0").required("El campo 'Rango hasta' es requerido").test(
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(
3884
3903
  "is-greater",
3885
3904
  "El campo 'Rango hasta' debe ser mayor que 'Rango desde'",
3886
3905
  function(o) {
@@ -3892,20 +3911,20 @@ const gi = E.div`
3892
3911
  value: { from: t, to: n }
3893
3912
  };
3894
3913
  }, $t = (e, t) => t === H.PERCENTAGE ? {
3895
- schema: he().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"),
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"),
3896
3915
  value: e
3897
3916
  } : {
3898
- schema: pe().required("Requerido"),
3917
+ schema: ge().required("Requerido"),
3899
3918
  value: e
3900
- }, Ci = {
3901
- [k.LIST_OF_VALUES]: xi,
3902
- [k.LIST_OF_VALUES_MULTI]: Di,
3903
- [k.RANGE]: wi,
3919
+ }, Ni = {
3920
+ [k.LIST_OF_VALUES]: Ci,
3921
+ [k.LIST_OF_VALUES_MULTI]: Si,
3922
+ [k.RANGE]: Ei,
3904
3923
  [k.GREATER_THAN]: $t,
3905
3924
  [k.LESS_THAN]: $t,
3906
3925
  [k.EQUAL]: $t
3907
- }, dn = (e) => Ci[e] || Ti;
3908
- function Si({
3926
+ }, cn = (e) => Ni[e] || wi;
3927
+ function ki({
3909
3928
  decision: e,
3910
3929
  onSubmitEvent: t,
3911
3930
  textValues: n
@@ -3924,8 +3943,8 @@ function Si({
3924
3943
  };
3925
3944
  let r;
3926
3945
  const i = {
3927
- ruleName: pe().required("El nombre de la regla es requerido"),
3928
- value: Ge(() => dn(
3946
+ ruleName: ge().required("El nombre de la regla es requerido"),
3947
+ value: Ge(() => cn(
3929
3948
  r.values.howToSetTheDecision
3930
3949
  )(
3931
3950
  r.values.value,
@@ -3974,7 +3993,7 @@ function Si({
3974
3993
  const c = ((h = e.conditionsThatEstablishesTheDecision) == null ? void 0 : h.reduce(
3975
3994
  (g, f) => {
3976
3995
  if (r.values.conditionsThatEstablishesTheDecision[f.conditionName] !== void 0) {
3977
- const T = dn(
3996
+ const T = cn(
3978
3997
  f.howToSetTheCondition
3979
3998
  );
3980
3999
  g[f.conditionName] = T(
@@ -3989,9 +4008,9 @@ function Si({
3989
4008
  return te(c);
3990
4009
  })
3991
4010
  };
3992
- n.terms && (i.effectiveFrom = Ae().required(
4011
+ n.terms && (i.effectiveFrom = Ie().required(
3993
4012
  "La fecha de inicio es requerida"
3994
- ), i.validUntil = Ae().when(
4013
+ ), i.validUntil = Ie().when(
3995
4014
  "checkClosed",
3996
4015
  (l, u, { parent: p }) => (p == null ? void 0 : p.checkClosed) ? u.required("La fecha de finalización es requerida").test(
3997
4016
  "is-after-startDate",
@@ -4045,7 +4064,7 @@ function Si({
4045
4064
  });
4046
4065
  } };
4047
4066
  }
4048
- const Ei = E.div`
4067
+ const Ai = E.div`
4049
4068
  & > div {
4050
4069
  border-radius: 8px;
4051
4070
  border: 1px solid
@@ -4054,7 +4073,7 @@ const Ei = E.div`
4054
4073
  return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || I.palette.neutral.N30;
4055
4074
  }};
4056
4075
  }
4057
- `, Ni = E.div`
4076
+ `, Ii = E.div`
4058
4077
  width: 100%;
4059
4078
  height: 100%;
4060
4079
  overflow-y: auto;
@@ -4071,7 +4090,7 @@ const Ei = E.div`
4071
4090
  background-color: #ebecf0;
4072
4091
  border-radius: 8px;
4073
4092
  }
4074
- `, ki = (e) => {
4093
+ `, $i = (e) => {
4075
4094
  const {
4076
4095
  checked: t,
4077
4096
  children: n,
@@ -4100,7 +4119,7 @@ const Ei = E.div`
4100
4119
  ) }),
4101
4120
  l && /* @__PURE__ */ a(V, { children: n })
4102
4121
  ] });
4103
- }, Ai = (e) => {
4122
+ }, Fi = (e) => {
4104
4123
  const {
4105
4124
  onHandleStartChange: t,
4106
4125
  onHandleEndChange: n,
@@ -4162,7 +4181,7 @@ const Ei = E.div`
4162
4181
  gap: "24px",
4163
4182
  children: [
4164
4183
  /* @__PURE__ */ a(
4165
- ke,
4184
+ Ae,
4166
4185
  {
4167
4186
  id: "dateStart",
4168
4187
  label: r,
@@ -4175,7 +4194,7 @@ const Ei = E.div`
4175
4194
  }
4176
4195
  ),
4177
4196
  f && /* @__PURE__ */ a(
4178
- ke,
4197
+ Ae,
4179
4198
  {
4180
4199
  id: "dateEnd",
4181
4200
  label: i,
@@ -4191,7 +4210,7 @@ const Ei = E.div`
4191
4210
  }
4192
4211
  )
4193
4212
  ] });
4194
- }, Ii = (e) => {
4213
+ }, Ri = (e) => {
4195
4214
  const {
4196
4215
  formik: t,
4197
4216
  textValues: n,
@@ -4211,7 +4230,7 @@ const Ei = E.div`
4211
4230
  isDecision: !0
4212
4231
  }),
4213
4232
  /* @__PURE__ */ a(Y, { dashed: !0 }),
4214
- /* @__PURE__ */ a(Ei, { children: /* @__PURE__ */ a(Ni, { children: /* @__PURE__ */ m(
4233
+ /* @__PURE__ */ a(Ai, { children: /* @__PURE__ */ a(Ii, { children: /* @__PURE__ */ m(
4215
4234
  y,
4216
4235
  {
4217
4236
  direction: "column",
@@ -4241,7 +4260,7 @@ const Ei = E.div`
4241
4260
  }
4242
4261
  ),
4243
4262
  /* @__PURE__ */ a(y, { direction: "column", gap: "20px", children: r == null ? void 0 : r.map((c) => /* @__PURE__ */ a(
4244
- ki,
4263
+ $i,
4245
4264
  {
4246
4265
  id: `toggle-${c.conditionName}`,
4247
4266
  name: `toggle.${c.conditionName}`,
@@ -4261,7 +4280,7 @@ const Ei = E.div`
4261
4280
  n.terms && /* @__PURE__ */ m(V, { children: [
4262
4281
  /* @__PURE__ */ a(Y, { dashed: !0 }),
4263
4282
  /* @__PURE__ */ a(
4264
- Ai,
4283
+ Fi,
4265
4284
  {
4266
4285
  labelStart: n.termStart,
4267
4286
  labelEnd: n.termEnd,
@@ -4287,9 +4306,9 @@ const Ei = E.div`
4287
4306
  /* @__PURE__ */ a(Q, { type: "submit", children: n.confirm })
4288
4307
  ] })
4289
4308
  ] }) });
4290
- }, $i = (e) => {
4309
+ }, Li = (e) => {
4291
4310
  var g;
4292
- const { decision: t, onSubmitEvent: n, textValues: o, onCancel: r } = e, { formik: i, handleToggleNoneChange: s } = Si({
4311
+ const { decision: t, onSubmitEvent: n, textValues: o, onCancel: r } = e, { formik: i, handleToggleNoneChange: s } = ki({
4293
4312
  decision: t,
4294
4313
  onSubmitEvent: n,
4295
4314
  textValues: o
@@ -4303,7 +4322,7 @@ const Ei = E.div`
4303
4322
  (f) => !f.hidden
4304
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;
4305
4324
  return /* @__PURE__ */ a(
4306
- Ii,
4325
+ Ri,
4307
4326
  {
4308
4327
  formik: i,
4309
4328
  onCancel: r,
@@ -4335,7 +4354,7 @@ const Ei = E.div`
4335
4354
  termEndStatus: c
4336
4355
  }
4337
4356
  );
4338
- }, Dl = (e) => {
4357
+ }, Sl = (e) => {
4339
4358
  var r;
4340
4359
  const { decisionTemplate: t } = e, n = { ...t }, o = (r = n.conditionsThatEstablishesTheDecision) == null ? void 0 : r.find(
4341
4360
  (i) => i.switchPlaces
@@ -4351,7 +4370,7 @@ const Ei = E.div`
4351
4370
  (i) => i.conditionName === o.conditionName ? { ...i, hidden: !0 } : i
4352
4371
  )
4353
4372
  } : n;
4354
- }, wl = (e) => {
4373
+ }, El = (e) => {
4355
4374
  const { decisions: t } = e;
4356
4375
  return t == null ? void 0 : t.map((n) => {
4357
4376
  var r;
@@ -4370,7 +4389,7 @@ const Ei = E.div`
4370
4389
  )
4371
4390
  } : n;
4372
4391
  });
4373
- }, Te = {
4392
+ }, xe = {
4374
4393
  item: {
4375
4394
  background: {
4376
4395
  active: I.palette.blue.B50,
@@ -4387,12 +4406,12 @@ const Ei = E.div`
4387
4406
  color: I.palette.neutral.N0
4388
4407
  }
4389
4408
  }
4390
- }, Fi = E.div`
4409
+ }, Oi = E.div`
4391
4410
  & > div {
4392
4411
  border: 1px solid
4393
4412
  ${({ theme: e, $active: t }) => {
4394
4413
  var n, o, r, i;
4395
- return t ? ((o = (n = e == null ? void 0 : e.border) == null ? void 0 : n.expanded) == null ? void 0 : o.color) || Te.border.expanded.color : ((i = (r = e == null ? void 0 : e.border) == null ? void 0 : r.contracted) == null ? void 0 : i.color) || Te.border.contracted.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;
4396
4415
  }};
4397
4416
  }
4398
4417
  &:hover {
@@ -4400,44 +4419,44 @@ const Ei = E.div`
4400
4419
  background-color: ${({ theme: e, $disabled: t }) => {
4401
4420
  var n, o, r;
4402
4421
  if (!t)
4403
- 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) || Te.item.background.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;
4404
4423
  }};
4405
4424
  }
4406
- `, cn = E.div`
4425
+ `, un = E.div`
4407
4426
  display: flex;
4408
4427
  align-items: center;
4409
4428
  gap: 12px;
4410
4429
  width: 100%;
4411
4430
  outline: none;
4412
4431
  cursor: pointer;
4413
- `, Ri = E.div`
4432
+ `, Mi = E.div`
4414
4433
  display: flex;
4415
4434
  align-items: center;
4416
4435
  outline: none;
4417
4436
  cursor: pointer;
4418
- `, Li = E(Dn)`
4437
+ `, Pi = E(wn)`
4419
4438
  display: flex;
4420
4439
  align-items: center;
4421
4440
  text-decoration: none;
4422
- `, Oi = E(Dn)`
4441
+ `, _i = E(wn)`
4423
4442
  display: block;
4424
4443
  text-decoration: none;
4425
4444
  color: inherit;
4426
- `, Mi = E.div`
4445
+ `, Vi = E.div`
4427
4446
  & > div {
4428
4447
  border-bottom: 1px solid
4429
4448
  ${({ theme: e, $active: t }) => {
4430
4449
  var n, o, r, i;
4431
- return t ? ((o = (n = e == null ? void 0 : e.border) == null ? void 0 : n.expanded) == null ? void 0 : o.color) || Te.border.expanded.color : ((i = (r = e == null ? void 0 : e.border) == null ? void 0 : r.contracted) == null ? void 0 : i.color) || Te.border.contracted.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;
4432
4451
  }};
4433
4452
  border-radius: 8px 8px 0 0;
4434
4453
  }
4435
- `, kn = E.div`
4454
+ `, An = E.div`
4436
4455
  display: block;
4437
4456
  text-decoration: none;
4438
4457
  background-color: ${({ theme: e, $active: t }) => {
4439
4458
  var n, o, r, i, s, d;
4440
- 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) || Te.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) || Te.item.background.inactive;
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;
4441
4460
  }};
4442
4461
  &:last-child {
4443
4462
  border-radius: 0 0 8px 8px;
@@ -4447,34 +4466,34 @@ const Ei = E.div`
4447
4466
  background-color: ${({ $active: e, theme: t, $disabled: n }) => {
4448
4467
  var o, r, i;
4449
4468
  if (!n && !e)
4450
- 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) || Te.item.background.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;
4451
4470
  }};
4452
4471
  }
4453
- `, _i = E.div`
4472
+ `, ji = E.div`
4454
4473
  display: flex;
4455
4474
  flex-direction: column;
4456
4475
 
4457
- & > a:last-child ${kn} {
4476
+ & > a:last-child ${An} {
4458
4477
  border-radius: 0 0 8px 8px;
4459
4478
  }
4460
- `, Pi = (e) => {
4479
+ `, Ui = (e) => {
4461
4480
  const { isOpen: t, links: n, onClick: o, title: r, activeId: i, headerPath: s, headerActive: d } = e, l = (f) => {
4462
4481
  (f.key === "Enter" || f.key === " ") && (f.preventDefault(), o());
4463
4482
  }, u = (f) => {
4464
4483
  f.preventDefault(), f.stopPropagation(), o();
4465
4484
  }, p = (f) => {
4466
4485
  (f.key === "Enter" || f.key === " ") && (f.preventDefault(), f.stopPropagation(), o());
4467
- }, c = t || d ? "primary" : "dark", h = t || d ? "bold" : "normal", g = P.useId();
4468
- return /* @__PURE__ */ a(Fi, { $active: t, children: /* @__PURE__ */ m(ce, { border: !0, borderRadius: "8px", width: "100%", children: [
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: [
4469
4488
  /* @__PURE__ */ a(
4470
- Mi,
4489
+ Vi,
4471
4490
  {
4472
4491
  $active: t && n.length > 0,
4473
4492
  "aria-controls": g,
4474
4493
  "aria-expanded": t,
4475
4494
  onClick: u,
4476
4495
  onKeyDown: p,
4477
- children: s ? /* @__PURE__ */ a(Li, { to: s, children: /* @__PURE__ */ m(
4496
+ children: s ? /* @__PURE__ */ a(Pi, { to: s, children: /* @__PURE__ */ m(
4478
4497
  ce,
4479
4498
  {
4480
4499
  alignItems: "center",
@@ -4491,7 +4510,7 @@ const Ei = E.div`
4491
4510
  icon: t && n.length > 0 ? /* @__PURE__ */ a(Lt, {}) : /* @__PURE__ */ a(Kt, {})
4492
4511
  }
4493
4512
  ),
4494
- /* @__PURE__ */ a(cn, { children: /* @__PURE__ */ a(
4513
+ /* @__PURE__ */ a(un, { children: /* @__PURE__ */ a(
4495
4514
  F,
4496
4515
  {
4497
4516
  appearance: c,
@@ -4521,8 +4540,8 @@ const Ei = E.div`
4521
4540
  icon: t && n.length > 0 ? /* @__PURE__ */ a(Lt, {}) : /* @__PURE__ */ a(Kt, {})
4522
4541
  }
4523
4542
  ),
4524
- /* @__PURE__ */ a(cn, { children: /* @__PURE__ */ a(
4525
- Ri,
4543
+ /* @__PURE__ */ a(un, { children: /* @__PURE__ */ a(
4544
+ Mi,
4526
4545
  {
4527
4546
  "aria-controls": g,
4528
4547
  "aria-expanded": t,
@@ -4547,9 +4566,9 @@ const Ei = E.div`
4547
4566
  )
4548
4567
  }
4549
4568
  ),
4550
- t && n.length > 0 && /* @__PURE__ */ a(_i, { id: g, children: n.map((f) => {
4569
+ t && n.length > 0 && /* @__PURE__ */ a(ji, { id: g, children: n.map((f) => {
4551
4570
  const v = f.id === i;
4552
- return /* @__PURE__ */ a(Oi, { to: f.path, children: /* @__PURE__ */ a(kn, { $active: v, children: /* @__PURE__ */ m(
4571
+ return /* @__PURE__ */ a(_i, { to: f.path, children: /* @__PURE__ */ a(An, { $active: v, children: /* @__PURE__ */ m(
4553
4572
  y,
4554
4573
  {
4555
4574
  alignItems: "center",
@@ -4557,7 +4576,7 @@ const Ei = E.div`
4557
4576
  gap: "8px",
4558
4577
  padding: v ? "8px 4px" : "8px 32px",
4559
4578
  children: [
4560
- v && /* @__PURE__ */ a(G, { appearance: "primary", icon: /* @__PURE__ */ a(Xn, {}) }),
4579
+ v && /* @__PURE__ */ a(G, { appearance: "primary", icon: /* @__PURE__ */ a(Qn, {}) }),
4561
4580
  /* @__PURE__ */ a(
4562
4581
  F,
4563
4582
  {
@@ -4573,7 +4592,7 @@ const Ei = E.div`
4573
4592
  ) }) }, f.id);
4574
4593
  }) })
4575
4594
  ] }) });
4576
- }, Vi = E.div`
4595
+ }, zi = E.div`
4577
4596
  & > div {
4578
4597
  background: ${({ $background: e, theme: t }) => {
4579
4598
  var n, o, r, i;
@@ -4581,36 +4600,36 @@ const Ei = E.div`
4581
4600
  }};
4582
4601
  }
4583
4602
  height: 90vh;
4584
- `, ji = (e, t) => {
4603
+ `, Hi = (e, t) => {
4585
4604
  var n;
4586
4605
  for (const o of t)
4587
4606
  if (o.path && (e === o.path || e.startsWith(o.path + "/")) || (n = o.links) != null && n.some((r) => r.path === e)) return o.id;
4588
4607
  return null;
4589
- }, Cl = (e) => {
4590
- const { collapseOnNavigate: t = !1, defaultOpenId: n = null, groups: o } = e, r = ro(), [i, s] = P.useState(n), d = P.useRef(r.pathname), l = P.useCallback(
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(
4591
4610
  (p) => {
4592
4611
  var c;
4593
4612
  return (c = p.find((h) => h.path === r.pathname)) == null ? void 0 : c.id;
4594
4613
  },
4595
4614
  [r.pathname]
4596
- ), u = P.useCallback(
4615
+ ), u = _.useCallback(
4597
4616
  (p) => !!p && (r.pathname === p || r.pathname.startsWith(p + "/")),
4598
4617
  [r.pathname]
4599
4618
  );
4600
- return P.useEffect(() => {
4619
+ return _.useEffect(() => {
4601
4620
  if (!(d.current !== r.pathname)) return;
4602
4621
  if (d.current = r.pathname, t) {
4603
4622
  s(null);
4604
4623
  return;
4605
4624
  }
4606
- const c = ji(r.pathname, o);
4625
+ const c = Hi(r.pathname, o);
4607
4626
  if (c) {
4608
4627
  s(c);
4609
4628
  return;
4610
4629
  }
4611
4630
  n && s(n);
4612
- }, [t, n, o, r.pathname]), /* @__PURE__ */ a(Vi, { $background: !0, children: /* @__PURE__ */ a(y, { direction: "column", gap: "8px", padding: "12px", height: "100%", children: o.map((p) => /* @__PURE__ */ a(
4613
- Pi,
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,
4614
4633
  {
4615
4634
  activeId: l(p.links),
4616
4635
  headerPath: p.path,
@@ -4626,10 +4645,10 @@ const Ei = E.div`
4626
4645
  function Z(e) {
4627
4646
  e.preventDefault();
4628
4647
  }
4629
- function we(e) {
4648
+ function Ce(e) {
4630
4649
  e.stopPropagation();
4631
4650
  }
4632
- function An() {
4651
+ function In() {
4633
4652
  const e = /* @__PURE__ */ new Map();
4634
4653
  return [function(o, r) {
4635
4654
  e.get(o) && e.get(o).forEach((i) => {
@@ -4640,8 +4659,8 @@ function An() {
4640
4659
  i.push(r), e.set(o, i);
4641
4660
  }];
4642
4661
  }
4643
- var [In, $n] = An();
4644
- function Ui(e, t) {
4662
+ var [$n, Fn] = In();
4663
+ function Gi(e, t) {
4645
4664
  return e.source === t.source && e.flags.split("").sort().join("") === t.flags.split("").sort().join("");
4646
4665
  }
4647
4666
  function qe(e, t, n = !0, o = ["__key"]) {
@@ -4651,7 +4670,7 @@ function qe(e, t, n = !0, o = ["__key"]) {
4651
4670
  if (e instanceof Date && t instanceof Date)
4652
4671
  return e.getTime() === t.getTime();
4653
4672
  if (e instanceof RegExp && t instanceof RegExp)
4654
- return Ui(e, t);
4673
+ return Gi(e, t);
4655
4674
  if (e === null || t === null) return !1;
4656
4675
  const r = e, i = t;
4657
4676
  if (Object.keys(r).length !== Object.keys(i).length) return !1;
@@ -4663,7 +4682,7 @@ function qe(e, t, n = !0, o = ["__key"]) {
4663
4682
  }
4664
4683
  return !1;
4665
4684
  }
4666
- function Fn(e) {
4685
+ function Rn(e) {
4667
4686
  return e.split(" ").filter((t) => t);
4668
4687
  }
4669
4688
  function Fe(e) {
@@ -4671,22 +4690,22 @@ function Fe(e) {
4671
4690
  }
4672
4691
  Array();
4673
4692
  var Zt = typeof window < "u", J = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakMap();
4674
- function Rn() {
4693
+ function Ln() {
4675
4694
  if (!Zt) return !1;
4676
4695
  if ("userAgentData" in navigator)
4677
4696
  return navigator.userAgentData.mobile === !0;
4678
4697
  const e = navigator.userAgent, t = /android|iphone|ipod/i.test(e), n = /iPad/.test(e) || e.includes("Macintosh") && navigator.maxTouchPoints > 1;
4679
4698
  return t || n;
4680
4699
  }
4681
- var zi = {
4700
+ var Bi = {
4682
4701
  affectedNodes: [],
4683
4702
  coordinates: {
4684
4703
  x: 0,
4685
4704
  y: 0
4686
4705
  },
4687
4706
  currentTargetValue: void 0,
4688
- on: $n,
4689
- emit: In,
4707
+ on: Fn,
4708
+ emit: $n,
4690
4709
  originalZIndex: void 0,
4691
4710
  pointerSelection: !1,
4692
4711
  preventEnter: !1,
@@ -4712,16 +4731,16 @@ var zi = {
4712
4731
  scrollDebounceTimeout: void 0,
4713
4732
  frameIdX: void 0,
4714
4733
  frameIdY: void 0
4715
- }, b = zi, De = !1, un, Ft;
4716
- function Hi() {
4734
+ }, b = Bi, we = !1, pn, Ft;
4735
+ function qi() {
4717
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 = { ...{
4718
4737
  affectedNodes: [],
4719
4738
  coordinates: {
4720
4739
  x: 0,
4721
4740
  y: 0
4722
4741
  },
4723
- on: $n,
4724
- emit: In,
4742
+ on: Fn,
4743
+ emit: $n,
4725
4744
  currentTargetValue: void 0,
4726
4745
  originalZIndex: void 0,
4727
4746
  pointerId: void 0,
@@ -4754,38 +4773,38 @@ function Hi() {
4754
4773
  frameIdY: void 0
4755
4774
  } };
4756
4775
  }
4757
- function Ln(e) {
4758
- return Object.assign(b, e), e.initialParent.data.emit("dragStarted", b), De = !1, b.emit("dragStarted", b), b;
4776
+ function On(e) {
4777
+ return Object.assign(b, e), e.initialParent.data.emit("dragStarted", b), we = !1, b.emit("dragStarted", b), b;
4759
4778
  }
4760
- function Gi() {
4761
- b.activeState && Se(b.activeState.parent, void 0, b), b.selectedState && Ce(b.selectedState.nodes, b.selectedState.parent, b), b.selectedState = b.activeState = void 0;
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;
4762
4781
  }
4763
- function Bi() {
4782
+ function Yi() {
4764
4783
  if (b.pointerDown && (b.pointerDown.node.el.draggable = !0), b.pointerDown = void 0, !ie(b)) return;
4765
4784
  const e = b.currentParent.data.config;
4766
4785
  ie(b) && e.handleEnd(b);
4767
4786
  }
4768
- function qi(e) {
4769
- e.key === "Escape" && (b.selectedState && Ce(b.selectedState.nodes, b.selectedState.parent, b), b.activeState && Se(b.activeState.parent, void 0, b), b.selectedState = b.activeState = void 0);
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);
4770
4789
  }
4771
- function Wi(e) {
4790
+ function Qi(e) {
4772
4791
  if (!K(b)) return;
4773
- De = !0;
4792
+ we = !0;
4774
4793
  const t = b.initialParent.data.config.handleEnd;
4775
4794
  t(b);
4776
4795
  }
4777
- function Yi(e) {
4796
+ function Ji(e) {
4778
4797
  if (!K(b)) return;
4779
4798
  Z(e);
4780
4799
  const { x: t, y: n } = Fe(e);
4781
4800
  K(b) && yt({ x: t, y: n }, e, b);
4782
4801
  }
4783
- function Xi(e) {
4802
+ function Zi(e) {
4784
4803
  if (!b.pointerDown || !b.pointerDown.validated) return;
4785
4804
  const t = b.pointerDown.parent.data.config;
4786
- if (!(e.pointerType === "mouse" && !Rn()))
4805
+ if (!(e.pointerType === "mouse" && !Ln()))
4787
4806
  if (ie(b))
4788
- ie(b) && pn(e, b);
4807
+ ie(b) && hn(e, b);
4789
4808
  else {
4790
4809
  if (Z(e), t.longPress && !b.longPress) {
4791
4810
  clearTimeout(b.longPressTimeout), b.longPress = !1;
@@ -4793,7 +4812,7 @@ function Xi(e) {
4793
4812
  }
4794
4813
  const n = t.draggedNodes(b.pointerDown);
4795
4814
  t.dragstartClasses(b.pointerDown.node, n, t, !0);
4796
- const o = b.pointerDown.node.el.getBoundingClientRect(), r = Ca(
4815
+ const o = b.pointerDown.node.el.getBoundingClientRect(), r = Na(
4797
4816
  b.pointerDown.node,
4798
4817
  b.pointerDown.parent,
4799
4818
  e,
@@ -4801,10 +4820,10 @@ function Xi(e) {
4801
4820
  n,
4802
4821
  o
4803
4822
  );
4804
- pn(e, r, !0);
4823
+ hn(e, r, !0);
4805
4824
  }
4806
4825
  }
4807
- function Qi({
4826
+ function Ki({
4808
4827
  parent: e,
4809
4828
  getValues: t,
4810
4829
  setValues: n,
@@ -4812,13 +4831,13 @@ function Qi({
4812
4831
  }) {
4813
4832
  var l, u, p;
4814
4833
  if (!Zt) return;
4815
- un || (un = ht(document, {
4816
- dragover: Yi,
4817
- pointerdown: Gi,
4818
- pointerup: Bi,
4819
- keydown: qi,
4820
- drop: Wi,
4821
- pointermove: Xi,
4834
+ pn || (pn = ht(document, {
4835
+ dragover: Ji,
4836
+ pointerdown: Wi,
4837
+ pointerup: Yi,
4838
+ keydown: Xi,
4839
+ drop: Qi,
4840
+ pointermove: Zi,
4822
4841
  pointercancel: oe(o.handlePointercancel),
4823
4842
  touchmove: (c) => {
4824
4843
  K(b) && c.cancelable && Z(c);
@@ -4826,45 +4845,45 @@ function Qi({
4826
4845
  contextmenu: (c) => {
4827
4846
  ie(b) && Z(c);
4828
4847
  }
4829
- })), Mn(e);
4830
- const [r, i] = An(), s = {
4848
+ })), Pn(e);
4849
+ const [r, i] = In(), s = {
4831
4850
  getValues: t,
4832
4851
  setValues: n,
4833
4852
  config: {
4834
4853
  dragDropEffect: o.dragDropEffect ?? "move",
4835
4854
  dragEffectAllowed: o.dragEffectAllowed ?? "move",
4836
- draggedNodes: da,
4837
- dragstartClasses: ha,
4838
- handleNodeKeydown: fa,
4839
- handleDragstart: ua,
4840
- handleNodeDragover: Ea,
4841
- handleParentDragover: Na,
4842
- handleNodeDrop: ba,
4843
- handleNodeFocus: va,
4844
- handleNodeBlur: ya,
4845
- handlePointercancel: xa,
4846
- handleEnd: Da,
4847
- handleDragend: Ta,
4848
- handleParentFocus: Zi,
4849
- handleNodePointerup: wa,
4850
- handleNodePointerover: ma,
4851
- handleParentPointerover: ka,
4852
- handleParentScroll: ca,
4853
- handleNodePointerdown: pa,
4854
- handleNodeDragenter: Ia,
4855
- handleNodeDragleave: $a,
4856
- handleParentDrop: ea,
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,
4857
4876
  multiDrag: o.multiDrag ?? !1,
4858
4877
  nativeDrag: o.nativeDrag ?? !0,
4859
- performSort: Ji,
4860
- performTransfer: Ki,
4878
+ performSort: ea,
4879
+ performTransfer: na,
4861
4880
  root: o.root ?? document,
4862
- setupNode: na,
4881
+ setupNode: ia,
4863
4882
  setupNodeRemap: _n,
4864
- reapplyDragClasses: oa,
4865
- tearDownNode: ia,
4866
- tearDownNodeRemap: ra,
4867
- remapFinished: la,
4883
+ reapplyDragClasses: aa,
4884
+ tearDownNode: sa,
4885
+ tearDownNodeRemap: la,
4886
+ remapFinished: ca,
4868
4887
  threshold: {
4869
4888
  horizontal: 0,
4870
4889
  vertical: 0
@@ -4877,7 +4896,7 @@ function Qi({
4877
4896
  on: i,
4878
4897
  emit: r
4879
4898
  };
4880
- new MutationObserver(aa).observe(e, { childList: !0 }), J.set(e, s), (l = o.plugins) == null || l.forEach((c) => {
4899
+ new MutationObserver(da).observe(e, { childList: !0 }), J.set(e, s), (l = o.plugins) == null || l.forEach((c) => {
4881
4900
  var h, g;
4882
4901
  (g = (h = c(e)) == null ? void 0 : h.tearDown) == null || g.call(h);
4883
4902
  }), (u = o.plugins) == null || u.forEach((c) => {
@@ -4886,9 +4905,9 @@ function Qi({
4886
4905
  }), (p = o.plugins) == null || p.forEach((c) => {
4887
4906
  var h, g;
4888
4907
  (g = (h = c(e)) == null ? void 0 : h.setup) == null || g.call(h);
4889
- }), ta(e, s), bt(e, !0);
4908
+ }), ra(e, s), bt(e, !0);
4890
4909
  }
4891
- function On(e, t, n, o, r, i) {
4910
+ function Mn(e, t, n, o, r, i) {
4892
4911
  const { x: s, y: d } = Fe(n), l = e.el.getBoundingClientRect();
4893
4912
  return {
4894
4913
  affectedNodes: [],
@@ -4923,13 +4942,13 @@ function On(e, t, n, o, r, i) {
4923
4942
  transferred: !1
4924
4943
  };
4925
4944
  }
4926
- function Ji({
4945
+ function ea({
4927
4946
  parent: e,
4928
4947
  draggedNodes: t,
4929
4948
  targetNodes: n
4930
4949
  }) {
4931
4950
  bt(e.el);
4932
- const o = t.map((l) => l.data.value), r = Ie(e.el, e.data), i = t[0].data.index, s = [...e.data.enabledNodes], d = [
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 = [
4933
4952
  ...r.filter((l) => !o.some((u) => qe(l, u)))
4934
4953
  ];
4935
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({
@@ -4948,7 +4967,7 @@ function Ji({
4948
4967
  state: b
4949
4968
  });
4950
4969
  }
4951
- function Se(e, t, n) {
4970
+ function Ee(e, t, n) {
4952
4971
  if (!t) {
4953
4972
  n.activeState = void 0;
4954
4973
  return;
@@ -4958,11 +4977,11 @@ function Se(e, t, n) {
4958
4977
  parent: e
4959
4978
  };
4960
4979
  }
4961
- function Ce(e, t, n) {
4980
+ function Se(e, t, n) {
4962
4981
  const o = t.data.config.selectedClass;
4963
4982
  if (!n.selectedState) return;
4964
4983
  const r = Array.from(e);
4965
- xe(
4984
+ De(
4966
4985
  e.map((i) => i.el),
4967
4986
  o
4968
4987
  );
@@ -4975,17 +4994,17 @@ function Ce(e, t, n) {
4975
4994
  function lt(e, t, n, o, r = !1) {
4976
4995
  o.pointerSelection = r;
4977
4996
  for (const i of t)
4978
- i.el.setAttribute("aria-selected", "true"), Ne([i.el], e.data.config.selectedClass, !0);
4997
+ i.el.setAttribute("aria-selected", "true"), ke([i.el], e.data.config.selectedClass, !0);
4979
4998
  o.selectedState = {
4980
4999
  nodes: t,
4981
5000
  parent: e
4982
- }, Se(e, n, o);
5001
+ }, Ee(e, n, o);
4983
5002
  }
4984
- function Zi(e, t) {
5003
+ function ta(e, t) {
4985
5004
  const n = e.targetData.parent.data.enabledNodes[0];
4986
- n && (t.selectedState && t.selectedState.parent.el !== e.targetData.parent.el ? Se(e.targetData.parent, n, t) : t.selectedState || Se(e.targetData.parent, n, t));
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));
4987
5006
  }
4988
- function Ki({
5007
+ function na({
4989
5008
  currentParent: e,
4990
5009
  targetParent: t,
4991
5010
  initialParent: n,
@@ -4996,10 +5015,10 @@ function Ki({
4996
5015
  }) {
4997
5016
  bt(n.el);
4998
5017
  const d = o.map((h) => h.data.value), l = [
4999
- ...Ie(e.el, e.data).filter(
5018
+ ...$e(e.el, e.data).filter(
5000
5019
  (h) => !d.some((g) => qe(h, g))
5001
5020
  )
5002
- ], u = Ie(t.el, t.data), p = n.el === t.el && t.data.config.sortable === !1;
5021
+ ], u = $e(t.el, t.data), p = n.el === t.el && t.data.config.sortable === !1;
5003
5022
  let c;
5004
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({
5005
5024
  sourceParent: e,
@@ -5019,18 +5038,18 @@ function Ki({
5019
5038
  targetNodes: i || []
5020
5039
  });
5021
5040
  }
5022
- function Ie(e, t) {
5041
+ function $e(e, t) {
5023
5042
  return [...t.getValues(e)];
5024
5043
  }
5025
5044
  function zt(e, t, n) {
5026
5045
  t.setValues(n, e);
5027
5046
  }
5028
- function ea(e, t) {
5029
- we(e.e), De = !0;
5047
+ function oa(e, t) {
5048
+ Ce(e.e), we = !0;
5030
5049
  const n = t.initialParent.data.config.handleEnd;
5031
5050
  n(t);
5032
5051
  }
5033
- function Mn(e) {
5052
+ function Pn(e) {
5034
5053
  const t = J.get(e);
5035
5054
  t && t.abortControllers.mainParent && t.abortControllers.mainParent.abort();
5036
5055
  }
@@ -5040,7 +5059,7 @@ function K(e) {
5040
5059
  function ie(e) {
5041
5060
  return "synthDragging" in e && !!e.synthDragging;
5042
5061
  }
5043
- function ta(e, t) {
5062
+ function ra(e, t) {
5044
5063
  t.abortControllers.mainParent = ht(e, {
5045
5064
  dragover: st(t.config.handleParentDragover),
5046
5065
  handleParentPointerover: t.config.handleParentPointerover,
@@ -5084,7 +5103,7 @@ function ta(e, t) {
5084
5103
  }
5085
5104
  ));
5086
5105
  }
5087
- function na(e) {
5106
+ function ia(e) {
5088
5107
  var n;
5089
5108
  const t = e.parent.data.config;
5090
5109
  e.node.data.abortControllers.mainNode = ht(e.node.el, {
@@ -5119,26 +5138,26 @@ function _n(e) {
5119
5138
  (r = (o = n(e.parent.el)) == null ? void 0 : o.setupNodeRemap) == null || r.call(o, e);
5120
5139
  });
5121
5140
  }
5122
- function oa(e, t) {
5141
+ function aa(e, t) {
5123
5142
  if (!K(b)) return;
5124
5143
  const n = ie(b) ? t.config.synthDropZoneClass : t.config.dropZoneClass;
5125
- b.draggedNode.el === e && Ne([e], n, !0);
5144
+ b.draggedNode.el === e && ke([e], n, !0);
5126
5145
  }
5127
- function ra(e) {
5146
+ function la(e) {
5128
5147
  var t;
5129
5148
  (t = e.parent.data.config.plugins) == null || t.forEach((n) => {
5130
5149
  var o, r;
5131
5150
  (r = (o = n(e.parent.el)) == null ? void 0 : o.tearDownNodeRemap) == null || r.call(o, e);
5132
5151
  });
5133
5152
  }
5134
- function ia(e) {
5153
+ function sa(e) {
5135
5154
  var t, n, o, r, i;
5136
5155
  (t = e.parent.data.config.plugins) == null || t.forEach((s) => {
5137
5156
  var d, l;
5138
5157
  (l = (d = s(e.parent.el)) == null ? void 0 : d.tearDownNode) == null || l.call(d, e);
5139
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());
5140
5159
  }
5141
- function aa(e) {
5160
+ function da(e) {
5142
5161
  if (e.length === 1 && e[0].addedNodes.length === 1 && !(e[0].addedNodes[0] instanceof HTMLElement))
5143
5162
  return;
5144
5163
  const t = e[0].target;
@@ -5185,7 +5204,7 @@ function bt(e, t) {
5185
5204
  index: l
5186
5205
  }
5187
5206
  );
5188
- if (!K(b) && b.activeState && qe(b.activeState.node.data.value, c.value) && Se(
5207
+ if (!K(b) && b.activeState && qe(b.activeState.node.data.value, c.value) && Ee(
5189
5208
  {
5190
5209
  data: n,
5191
5210
  el: e
@@ -5230,13 +5249,13 @@ function bt(e, t) {
5230
5249
  (p = (u = l(e)) == null ? void 0 : u.remapFinished) == null || p.call(u);
5231
5250
  });
5232
5251
  }
5233
- function la() {
5252
+ function ca() {
5234
5253
  b.remapJustFinished = !0, "draggedNode" in b && (b.affectedNodes = []);
5235
5254
  }
5236
- function sa(e) {
5255
+ function ua(e) {
5237
5256
  return !!e.targetData.parent.data.config.nativeDrag;
5238
5257
  }
5239
- function da(e) {
5258
+ function pa(e) {
5240
5259
  var t;
5241
5260
  if (e.parent.data.config.multiDrag) {
5242
5261
  if (b.selectedState)
@@ -5249,14 +5268,14 @@ function da(e) {
5249
5268
  } else return [e.node];
5250
5269
  return [];
5251
5270
  }
5252
- function ca(e) {
5271
+ function ha(e) {
5253
5272
  K(b) && (b.emit("scrollStarted", b), !ie(b) && (b.preventEnter = !0, Ft && clearTimeout(Ft), Ft = setTimeout(() => {
5254
5273
  b.preventEnter = !1, b.emit("scrollEnded", b);
5255
5274
  }, 100)));
5256
5275
  }
5257
- function ua(e, t) {
5276
+ function ga(e, t) {
5258
5277
  const n = e.targetData.parent.data.config;
5259
- if (!n.nativeDrag || !sa(e) || !Pn({
5278
+ if (!n.nativeDrag || !ua(e) || !Vn({
5260
5279
  x: e.e.clientX,
5261
5280
  y: e.e.clientY,
5262
5281
  node: e.targetData.node,
@@ -5270,11 +5289,11 @@ function ua(e, t) {
5270
5289
  node: e.targetData.node
5271
5290
  });
5272
5291
  o.length === 0 && (o = [e.targetData.node]), n.dragstartClasses(e.targetData.node, o, n);
5273
- const r = ga(e, o);
5292
+ const r = ba(e, o);
5274
5293
  if (n.onDragstart) {
5275
5294
  const i = {
5276
5295
  parent: e.targetData.parent,
5277
- values: Ie(
5296
+ values: $e(
5278
5297
  e.targetData.parent.el,
5279
5298
  e.targetData.parent.data
5280
5299
  ),
@@ -5286,20 +5305,20 @@ function ua(e, t) {
5286
5305
  n.onDragstart(i);
5287
5306
  }
5288
5307
  }
5289
- function pa(e, t) {
5308
+ function fa(e, t) {
5290
5309
  var d, l;
5291
- if (we(e.e), t.pointerDown = {
5310
+ if (Ce(e.e), t.pointerDown = {
5292
5311
  parent: e.targetData.parent,
5293
5312
  node: e.targetData.node,
5294
5313
  validated: !1
5295
- }, !Pn({
5314
+ }, !Vn({
5296
5315
  x: e.e.clientX,
5297
5316
  y: e.e.clientY,
5298
5317
  node: e.targetData.node,
5299
5318
  config: e.targetData.parent.data.config
5300
5319
  }))
5301
5320
  return;
5302
- t.pointerDown.validated = !0, Sa(e, t, e.targetData.node);
5321
+ t.pointerDown.validated = !0, ka(e, t, e.targetData.node);
5303
5322
  const n = e.targetData.parent.data;
5304
5323
  let o = [e.targetData.node];
5305
5324
  const r = e.e.ctrlKey || e.e.metaKey, i = e.e.shiftKey, s = e.targetData.node;
@@ -5321,7 +5340,7 @@ function pa(e, t) {
5321
5340
  const u = e.targetData.parent.data.enabledNodes;
5322
5341
  if (t.selectedState && t.activeState)
5323
5342
  if (t.selectedState.parent.el !== e.targetData.parent.el) {
5324
- Ce(t.selectedState.nodes, t.selectedState.parent, t), t.selectedState = void 0;
5343
+ Se(t.selectedState.nodes, t.selectedState.parent, t), t.selectedState = void 0;
5325
5344
  for (let p = 0; p <= s.data.index; p++)
5326
5345
  o.push(u[p]);
5327
5346
  } else {
@@ -5348,7 +5367,7 @@ function pa(e, t) {
5348
5367
  }
5349
5368
  (l = (d = t.selectedState) == null ? void 0 : d.nodes) != null && l.length ? t.selectedState.nodes.findIndex(
5350
5369
  (p) => p.el === e.targetData.node.el
5351
- ) === -1 && (t.selectedState.parent.el !== e.targetData.parent.el ? Ce(t.selectedState.nodes, e.targetData.parent, t) : n.config.multiDrag && Rn() ? o.push(...t.selectedState.nodes) : Ce(t.selectedState.nodes, e.targetData.parent, t), lt(
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(
5352
5371
  e.targetData.parent,
5353
5372
  o,
5354
5373
  e.targetData.node,
@@ -5362,30 +5381,30 @@ function pa(e, t) {
5362
5381
  !0
5363
5382
  );
5364
5383
  }
5365
- function ha(e, t, n, o = !1) {
5366
- Ne(
5384
+ function ma(e, t, n, o = !1) {
5385
+ ke(
5367
5386
  t.map((r) => r.el),
5368
5387
  o ? n.synthDraggingClass : n.draggingClass
5369
5388
  ), setTimeout(() => {
5370
- xe(
5389
+ De(
5371
5390
  t.map((r) => r.el),
5372
5391
  o ? n.synthDraggingClass : n.draggingClass
5373
- ), Ne(
5392
+ ), ke(
5374
5393
  t.map((r) => r.el),
5375
5394
  o ? n.synthDragPlaceholderClass : n.dragPlaceholderClass
5376
- ), Ne(
5395
+ ), ke(
5377
5396
  t.map((r) => r.el),
5378
5397
  o ? n.synthDropZoneClass : n.dropZoneClass
5379
- ), xe(
5398
+ ), De(
5380
5399
  t.map((r) => r.el),
5381
5400
  n.selectedClass
5382
5401
  );
5383
5402
  });
5384
5403
  }
5385
- function ga(e, t) {
5386
- we(e.e);
5387
- const n = Ln(
5388
- On(
5404
+ function ba(e, t) {
5405
+ Ce(e.e);
5406
+ const n = On(
5407
+ Mn(
5389
5408
  e.targetData.node,
5390
5409
  e.targetData.parent,
5391
5410
  e.e,
@@ -5437,7 +5456,7 @@ function ga(e, t) {
5437
5456
  }
5438
5457
  return n;
5439
5458
  }
5440
- function Pn({
5459
+ function Vn({
5441
5460
  x: e,
5442
5461
  y: t,
5443
5462
  node: n,
@@ -5453,75 +5472,75 @@ function Pn({
5453
5472
  if (i === s || s.contains(i)) return !0;
5454
5473
  return !1;
5455
5474
  }
5456
- function fa(e) {
5475
+ function va(e) {
5457
5476
  }
5458
- function ma(e) {
5459
- e.detail.targetData.parent.el === e.detail.state.currentParent.el ? jn(e.detail, e.detail.state) : vt(e.detail, e.detail.state);
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);
5460
5479
  }
5461
- function ba(e, t) {
5480
+ function Ta(e, t) {
5462
5481
  const n = e.targetData.parent.data.config;
5463
- n.nativeDrag && (we(e.e), De = !0, n.handleEnd(t));
5482
+ n.nativeDrag && (Ce(e.e), we = !0, n.handleEnd(t));
5464
5483
  }
5465
- function va(e) {
5484
+ function xa(e) {
5466
5485
  e.e.target !== e.e.currentTarget && b.pointerDown && (b.pointerDown.node.el.draggable = !1);
5467
5486
  }
5468
- function ya(e) {
5487
+ function Da(e) {
5469
5488
  e.e.target !== e.e.currentTarget && b.pointerDown && (b.pointerDown.node.el.draggable = !0);
5470
5489
  }
5471
- function Ta(e, t) {
5490
+ function wa(e, t) {
5472
5491
  const n = e.targetData.parent.data.config;
5473
5492
  if (n.nativeDrag) {
5474
- if (Z(e.e), we(e.e), De) {
5475
- De = !1;
5493
+ if (Z(e.e), Ce(e.e), we) {
5494
+ we = !1;
5476
5495
  return;
5477
5496
  }
5478
5497
  n.handleEnd(t);
5479
5498
  }
5480
5499
  }
5481
- function xa(e, t) {
5500
+ function Ca(e, t) {
5482
5501
  var o;
5483
5502
  if (!ie(t)) return;
5484
- if (Z(e.e), De) {
5485
- De = !1;
5503
+ if (Z(e.e), we) {
5504
+ we = !1;
5486
5505
  return;
5487
5506
  }
5488
5507
  const n = (o = J.get(t.initialParent.el)) == null ? void 0 : o.config;
5489
5508
  n != null && n.onDragend && n.onDragend({
5490
5509
  parent: t.currentParent,
5491
- values: Ie(t.currentParent.el, t.currentParent.data),
5510
+ values: $e(t.currentParent.el, t.currentParent.data),
5492
5511
  draggedNode: t.draggedNode,
5493
5512
  draggedNodes: t.draggedNodes,
5494
5513
  state: t
5495
5514
  }), n == null || n.handleEnd(t);
5496
5515
  }
5497
- function Da(e) {
5516
+ function Sa(e) {
5498
5517
  var p, c, h, g, f;
5499
5518
  e.draggedNode && (e.draggedNode.el.draggable = !0);
5500
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;
5501
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(() => {
5502
- xe(t, i), xe(t, s), xe(t, d);
5503
- }), Ce(e.draggedNodes, e.currentParent, e), Se(e.currentParent, void 0, e);
5521
+ De(t, i), De(t, s), De(t, d);
5522
+ }), Se(e.draggedNodes, e.currentParent, e), Ee(e.currentParent, void 0, e);
5504
5523
  const u = { ...e };
5505
5524
  (f = r == null ? void 0 : r.onDragend) == null || f.call(r, {
5506
5525
  parent: u.currentParent,
5507
- values: Ie(
5526
+ values: $e(
5508
5527
  u.currentParent.el,
5509
5528
  u.currentParent.data
5510
5529
  ),
5511
5530
  draggedNode: u.draggedNode,
5512
5531
  draggedNodes: u.draggedNodes,
5513
5532
  state: u
5514
- }), e.emit("dragEnded", u), Hi();
5533
+ }), e.emit("dragEnded", u), qi();
5515
5534
  }
5516
- function wa(e, t) {
5517
- we(e.e), !t.pointerSelection && t.selectedState && Ce(t.selectedState.nodes, e.targetData.parent, t);
5535
+ function Ea(e, t) {
5536
+ Ce(e.e), !t.pointerSelection && t.selectedState && Se(t.selectedState.nodes, e.targetData.parent, t);
5518
5537
  const n = e.targetData.parent.data.config;
5519
- t.pointerSelection = !1, "longPressTimeout" in t && t.longPressTimeout && clearTimeout(t.longPressTimeout), t.longPress = !1, xe(
5538
+ t.pointerSelection = !1, "longPressTimeout" in t && t.longPressTimeout && clearTimeout(t.longPressTimeout), t.longPress = !1, De(
5520
5539
  e.targetData.parent.data.enabledNodes.map((o) => o.el),
5521
5540
  n.longPressClass
5522
5541
  ), K(t) && n.handleEnd(t);
5523
5542
  }
5524
- function Ca(e, t, n, o, r, i) {
5543
+ function Na(e, t, n, o, r, i) {
5525
5544
  var f, v;
5526
5545
  const s = t.data.config;
5527
5546
  let d, l;
@@ -5592,8 +5611,8 @@ function Ca(e, t, n, o, r, i) {
5592
5611
  rootScrollWidth: (f = document.scrollingElement) == null ? void 0 : f.scrollWidth,
5593
5612
  rootScrollHeight: (v = document.scrollingElement) == null ? void 0 : v.scrollHeight
5594
5613
  };
5595
- return Ln({
5596
- ...On(
5614
+ return On({
5615
+ ...Mn(
5597
5616
  e,
5598
5617
  t,
5599
5618
  n,
@@ -5604,29 +5623,29 @@ function Ca(e, t, n, o, r, i) {
5604
5623
  ...h
5605
5624
  });
5606
5625
  }
5607
- function Sa(e, t, n) {
5626
+ function ka(e, t, n) {
5608
5627
  const o = e.targetData.parent.data.config;
5609
5628
  t.longPressTimeout = setTimeout(() => {
5610
- t && (t.longPress = !0, o.longPressClass && e.e.cancelable && Ne([n.el], o.longPressClass), Z(e.e));
5629
+ t && (t.longPress = !0, o.longPressClass && e.e.cancelable && ke([n.el], o.longPressClass), Z(e.e));
5611
5630
  }, o.longPressDuration || 1e3);
5612
5631
  }
5613
5632
  function Ht(e, t = !0, n = !0) {
5614
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);
5615
5634
  }
5616
- function Vn(e, t = !1) {
5635
+ function jn(e, t = !1) {
5617
5636
  var p;
5618
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;
5619
- e.clonedDraggedNode.style.transform = `translate3d(${l}px, ${u}px, 0px)`, t && (e.clonedDraggedNode.style.opacity = "1", xe(
5638
+ e.clonedDraggedNode.style.transform = `translate3d(${l}px, ${u}px, 0px)`, t && (e.clonedDraggedNode.style.opacity = "1", De(
5620
5639
  e.draggedNodes.map((c) => c.el),
5621
5640
  (p = e.initialParent.data.config) == null ? void 0 : p.longPressClass
5622
5641
  ));
5623
5642
  }
5624
- function pn(e, t, n = !1) {
5643
+ function hn(e, t, n = !1) {
5625
5644
  const o = Fe(e);
5626
- t.coordinates.x = o.x, t.coordinates.y = o.y, Vn(t, n), t.scrollDebounceTimeout && (clearTimeout(t.scrollDebounceTimeout), t.scrollDebounceTimeout = void 0), t.scrollDebounceTimeout = setTimeout(() => {
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(() => {
5627
5646
  ie(t) && yt(t.coordinates, e, t);
5628
5647
  }, 16);
5629
- const r = Oa(o);
5648
+ const r = _a(o);
5630
5649
  if (!r) {
5631
5650
  document.dispatchEvent(
5632
5651
  new CustomEvent("handleRootPointerover", {
@@ -5653,22 +5672,22 @@ function pn(e, t, n = !1) {
5653
5672
  })
5654
5673
  );
5655
5674
  }
5656
- function Ea(e, t) {
5675
+ function Aa(e, t) {
5657
5676
  var i;
5658
5677
  if (!e.targetData.parent.data.config.nativeDrag) return;
5659
5678
  const { x: o, y: r } = Fe(e.e);
5660
- t.coordinates.y = r, t.coordinates.x = o, Z(e.e), we(e.e), K(t) && yt({ x: o, y: r }, e.e, t), e.targetData.parent.el === ((i = t.currentParent) == null ? void 0 : i.el) ? jn(e, t) : vt(e, t);
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);
5661
5680
  }
5662
- function Na(e, t) {
5681
+ function Ia(e, t) {
5663
5682
  if (!e.targetData.parent.data.config.nativeDrag) return;
5664
- Z(e.e), we(e.e);
5683
+ Z(e.e), Ce(e.e);
5665
5684
  const { x: o, y: r } = Fe(e.e);
5666
5685
  K(t) && yt({ x: o, y: r }, e.e, t), vt(e, t);
5667
5686
  }
5668
- function ka(e) {
5687
+ function $a(e) {
5669
5688
  e.detail.targetData.parent.el !== e.detail.state.currentParent.el && vt(e.detail, e.detail.state);
5670
5689
  }
5671
- function Aa({
5690
+ function Fa({
5672
5691
  currentParent: e,
5673
5692
  targetParent: t,
5674
5693
  initialParent: n,
@@ -5686,13 +5705,13 @@ function Aa({
5686
5705
  r
5687
5706
  ) : !(!i.group || i.group !== s.group);
5688
5707
  }
5689
- function Ia(e, t) {
5708
+ function Ra(e, t) {
5690
5709
  Z(e.e);
5691
5710
  }
5692
- function $a(e, t) {
5711
+ function La(e, t) {
5693
5712
  Z(e.e);
5694
5713
  }
5695
- function Fa(e, t, n, o) {
5714
+ function Oa(e, t, n, o) {
5696
5715
  var p;
5697
5716
  if (t.affectedNodes.map((c) => c.data.value).includes(e.targetData.node.data.value))
5698
5717
  return !1;
@@ -5726,9 +5745,9 @@ function Fa(e, t, n, o) {
5726
5745
  }
5727
5746
  return !1;
5728
5747
  }
5729
- function jn(e, t) {
5748
+ function Un(e, t) {
5730
5749
  const { x: n, y: o } = Fe(e.e);
5731
- if (!Fa(e, t, n, o))
5750
+ if (!Oa(e, t, n, o))
5732
5751
  return;
5733
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];
5734
5753
  t.targetIndex = e.targetData.node.data.index, t.affectedNodes = e.targetData.parent.data.enabledNodes.filter(
@@ -5769,7 +5788,7 @@ function oe(e) {
5769
5788
  };
5770
5789
  }
5771
5790
  function vt(e, t) {
5772
- Z(e.e), Aa({
5791
+ Z(e.e), Fa({
5773
5792
  currentParent: t.currentParent,
5774
5793
  targetParent: e.targetData.parent,
5775
5794
  initialParent: t.initialParent,
@@ -5808,18 +5827,18 @@ function st(e) {
5808
5827
  );
5809
5828
  };
5810
5829
  }
5811
- function Ne(e, t, n = !1) {
5830
+ function ke(e, t, n = !1) {
5812
5831
  function o(r, i) {
5813
5832
  fe.set(r, i);
5814
5833
  }
5815
5834
  for (const r of e) {
5816
- const i = fe.get(r), s = Ra(r, t, i, n);
5835
+ const i = fe.get(r), s = Ma(r, t, i, n);
5817
5836
  s && o(r, s);
5818
5837
  }
5819
5838
  }
5820
- function Ra(e, t, n, o = !1) {
5839
+ function Ma(e, t, n, o = !1) {
5821
5840
  if (!t) return;
5822
- const r = Fn(t);
5841
+ const r = Rn(t);
5823
5842
  if (!r.length) return;
5824
5843
  if (!n) {
5825
5844
  e.classList.add(...r);
@@ -5834,9 +5853,9 @@ function Ra(e, t, n, o = !1) {
5834
5853
  ) : e.classList.add(s);
5835
5854
  return n.privateClasses = i, n;
5836
5855
  }
5837
- function xe(e, t) {
5856
+ function De(e, t) {
5838
5857
  if (!t) return;
5839
- const n = Fn(t);
5858
+ const n = Rn(t);
5840
5859
  if (n.length)
5841
5860
  for (const o of e) {
5842
5861
  if (!Tt(o)) {
@@ -5849,7 +5868,7 @@ function xe(e, t) {
5849
5868
  r.privateClasses.includes(i) || o.classList.remove(i);
5850
5869
  }
5851
5870
  }
5852
- function hn(e, t, n, o, r) {
5871
+ function gn(e, t, n, o, r) {
5853
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;
5854
5873
  if (d) {
5855
5874
  const v = e[l], T = e[u], w = v > 0, D = v + T < (s ? r.state.rootScrollWidth || 0 : e[c]);
@@ -5873,7 +5892,7 @@ function hn(e, t, n, o, r) {
5873
5892
  }
5874
5893
  return s ? { left: !1, right: !1 } : { up: !1, down: !1 };
5875
5894
  }
5876
- function La(e, t, n, o) {
5895
+ function Pa(e, t, n, o) {
5877
5896
  if (!K(n) || !n.draggedNode)
5878
5897
  return;
5879
5898
  n.preventEnter = !0;
@@ -5889,11 +5908,11 @@ function La(e, t, n, o) {
5889
5908
  n[l] = void 0, n[d] = void 0;
5890
5909
  return;
5891
5910
  }
5892
- e[p] += s * i, ie(n) && Vn(n), n[l] = requestAnimationFrame(u);
5911
+ e[p] += s * i, ie(n) && jn(n), n[l] = requestAnimationFrame(u);
5893
5912
  };
5894
5913
  n[l] = requestAnimationFrame(u);
5895
5914
  }
5896
- function gn(e, t, n) {
5915
+ function fn(e, t, n) {
5897
5916
  const o = e.getBoundingClientRect();
5898
5917
  return t >= o.left && t <= o.right && n >= o.top && n <= o.bottom;
5899
5918
  }
@@ -5904,15 +5923,15 @@ function yt(e, t, n) {
5904
5923
  const { x: o, y: r } = e;
5905
5924
  let i = !1;
5906
5925
  const s = (l, u, p) => {
5907
- La(p, t, n, { axis: l, direction: u }), i = !0;
5926
+ Pa(p, t, n, { axis: l, direction: u }), i = !0;
5908
5927
  }, d = (l) => {
5909
- const u = window.getComputedStyle(l), p = l.getBoundingClientRect(), c = hn(l, t, u, p, {
5928
+ const u = window.getComputedStyle(l), p = l.getBoundingClientRect(), c = gn(l, t, u, p, {
5910
5929
  axis: "x",
5911
5930
  state: n
5912
- }), h = hn(l, t, u, p, { axis: "y" });
5931
+ }), h = gn(l, t, u, p, { axis: "y" });
5913
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));
5914
5933
  };
5915
- if (n.lastScrollContainerX && gn(n.lastScrollContainerX, o, r) && d(n.lastScrollContainerX), !i && n.lastScrollContainerY && gn(n.lastScrollContainerY, o, r) && d(n.lastScrollContainerY), !i) {
5934
+ if (n.lastScrollContainerX && fn(n.lastScrollContainerX, o, r) && d(n.lastScrollContainerX), !i && n.lastScrollContainerY && fn(n.lastScrollContainerY, o, r) && d(n.lastScrollContainerY), !i) {
5916
5935
  let l = document.elementFromPoint(o, r);
5917
5936
  for (; l && !(i && n.lastScrollContainerX && n.lastScrollContainerY); )
5918
5937
  l instanceof HTMLElement && d(l), l = l.parentElement;
@@ -5923,7 +5942,7 @@ function yt(e, t, n) {
5923
5942
  }
5924
5943
  i || Ht(n);
5925
5944
  }
5926
- function Oa(e) {
5945
+ function _a(e) {
5927
5946
  let t = document.elementFromPoint(e.x, e.y);
5928
5947
  if (!Tt(t)) return;
5929
5948
  let n, o = !0;
@@ -5973,48 +5992,48 @@ function ht(e, t) {
5973
5992
  }
5974
5993
  return n;
5975
5994
  }
5976
- function Ma(e) {
5995
+ function Va(e) {
5977
5996
  if (e instanceof HTMLElement) return e;
5978
5997
  if ("current" in e && e.current instanceof HTMLElement)
5979
5998
  return e.current;
5980
5999
  console.warn("Invalid parent element", e);
5981
6000
  }
5982
- function _a(e, t) {
5983
- const n = Ma(e);
6001
+ function ja(e, t) {
6002
+ const n = Va(e);
5984
6003
  n && t(n);
5985
6004
  }
5986
6005
  var gt = /* @__PURE__ */ new WeakMap();
5987
- function Pa(e) {
6006
+ function Ua(e) {
5988
6007
  const t = gt.get(e);
5989
6008
  return t ? t[0] : (console.warn("No values found for parent element"), []);
5990
6009
  }
5991
- function Va(e, t) {
6010
+ function za(e, t) {
5992
6011
  const n = gt.get(t);
5993
6012
  n && n[1](e), gt.set(t, [e, n[1]]);
5994
6013
  }
5995
- function ja(e, t) {
6014
+ function Ha(e, t) {
5996
6015
  return (n) => {
5997
- gt.set(n, t), Qi({ parent: n, getValues: Pa, setValues: Va, config: e });
6016
+ gt.set(n, t), Ki({ parent: n, getValues: Ua, setValues: za, config: e });
5998
6017
  };
5999
6018
  }
6000
- function fn(e) {
6019
+ function mn(e) {
6001
6020
  Zt && (Array.isArray(e) || (e = [e]), e.forEach((t) => {
6002
6021
  const { parent: n, state: o, ...r } = t;
6003
- _a(n, ja(r, o));
6022
+ ja(n, Ha(r, o));
6004
6023
  }));
6005
6024
  }
6006
- function Ua(e, t = {}) {
6025
+ function Ga(e, t = {}) {
6007
6026
  const n = je(null), [o, r] = B(e);
6008
6027
  function i(s = {}) {
6009
- fn({ parent: n, state: [o, r], ...s });
6028
+ mn({ parent: n, state: [o, r], ...s });
6010
6029
  }
6011
6030
  return Be(() => {
6012
- fn({ parent: n, state: [o, r], ...t });
6031
+ mn({ parent: n, state: [o, r], ...t });
6013
6032
  }, [o]), Be(() => () => {
6014
- n.current && Mn(n.current);
6033
+ n.current && Pn(n.current);
6015
6034
  }, []), [n, o, r, i];
6016
6035
  }
6017
- const mn = {
6036
+ const bn = {
6018
6037
  border: {
6019
6038
  selected: {
6020
6039
  color: I.palette.blue.B400
@@ -6023,7 +6042,7 @@ const mn = {
6023
6042
  color: I.palette.neutral.N40
6024
6043
  }
6025
6044
  }
6026
- }, za = E.ul`
6045
+ }, Ba = E.ul`
6027
6046
  list-style: none;
6028
6047
  padding: 0;
6029
6048
  margin: 0;
@@ -6032,15 +6051,15 @@ const mn = {
6032
6051
  gap: 12px;
6033
6052
  width: 100%;
6034
6053
  justify-content: ${({ $isEmpty: e }) => e ? "center" : "flex-start"};
6035
- `, Ha = E.li`
6054
+ `, qa = E.li`
6036
6055
  & > div {
6037
6056
  border: 1px solid
6038
6057
  ${({ theme: e, $active: t }) => {
6039
6058
  var n, o, r, i;
6040
- return t ? ((o = (n = e == null ? void 0 : e.border) == null ? void 0 : n.selected) == null ? void 0 : o.color) || mn.border.selected.color : ((i = (r = e == null ? void 0 : e.border) == null ? void 0 : r.clear) == null ? void 0 : i.color) || mn.border.clear.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;
6041
6060
  }};
6042
6061
  }
6043
- `, Rt = "dnd:draggingLabel", bn = (e) => {
6062
+ `, Rt = "dnd:draggingLabel", vn = (e) => {
6044
6063
  const {
6045
6064
  emptyMessage: t,
6046
6065
  id: n,
@@ -6050,10 +6069,10 @@ const mn = {
6050
6069
  highlightFirst: s,
6051
6070
  onMove: d,
6052
6071
  locked: l = !1
6053
- } = e, u = P.useRef(null), p = l ? [u, i] : Ua(i, { group: o }), [c, h] = p, [g, f] = P.useState(
6072
+ } = e, u = _.useRef(null), p = l ? [u, i] : Ga(i, { group: o }), [c, h] = p, [g, f] = _.useState(
6054
6073
  null
6055
- ), v = P.useRef(i);
6056
- P.useEffect(() => {
6074
+ ), v = _.useRef(i);
6075
+ _.useEffect(() => {
6057
6076
  if (l) return;
6058
6077
  const N = (C) => {
6059
6078
  const A = C.detail ?? null;
@@ -6061,7 +6080,7 @@ const mn = {
6061
6080
  };
6062
6081
  return window.addEventListener(Rt, N), () => window.removeEventListener(Rt, N);
6063
6082
  }, [l]);
6064
- const T = P.useCallback((N) => {
6083
+ const T = _.useCallback((N) => {
6065
6084
  l || window.dispatchEvent(
6066
6085
  new CustomEvent(Rt, { detail: N })
6067
6086
  );
@@ -6070,16 +6089,16 @@ const mn = {
6070
6089
  if (l) return;
6071
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;
6072
6091
  R && (f(R), T(R));
6073
- }, D = P.useCallback(() => {
6092
+ }, D = _.useCallback(() => {
6074
6093
  l || (f(null), T(null));
6075
6094
  }, [T, l]);
6076
- P.useEffect(() => {
6095
+ _.useEffect(() => {
6077
6096
  if (l) return;
6078
6097
  const N = () => D();
6079
6098
  return window.addEventListener("pointerup", N), window.addEventListener("blur", N), () => {
6080
6099
  window.removeEventListener("pointerup", N), window.removeEventListener("blur", N);
6081
6100
  };
6082
- }, [D, l]), P.useEffect(() => {
6101
+ }, [D, l]), _.useEffect(() => {
6083
6102
  if (l) return;
6084
6103
  const N = v.current;
6085
6104
  if (h.length !== N.length && h.length === N.length + 1) {
@@ -6100,7 +6119,7 @@ const mn = {
6100
6119
  height: "-webkit-fill-available",
6101
6120
  spacing: "wide",
6102
6121
  children: /* @__PURE__ */ a(
6103
- za,
6122
+ Ba,
6104
6123
  {
6105
6124
  ref: c,
6106
6125
  onPointerDownCapture: l ? void 0 : w,
@@ -6123,7 +6142,7 @@ const mn = {
6123
6142
  ) : h.map((N, C) => {
6124
6143
  const A = !l && g === N;
6125
6144
  return /* @__PURE__ */ a(
6126
- Ha,
6145
+ qa,
6127
6146
  {
6128
6147
  className: `dnd-item${A ? " is-dragging" : ""}`,
6129
6148
  "data-label": N,
@@ -6148,7 +6167,7 @@ const mn = {
6148
6167
  )
6149
6168
  }
6150
6169
  );
6151
- }, Sl = (e) => {
6170
+ }, kl = (e) => {
6152
6171
  const { group: t = "clients", left: n, right: o, onMove: r, locked: i = !1 } = e, s = (d) => {
6153
6172
  i || r == null || r(d);
6154
6173
  };
@@ -6161,7 +6180,7 @@ const mn = {
6161
6180
  gap: "40px",
6162
6181
  children: [
6163
6182
  /* @__PURE__ */ a(
6164
- bn,
6183
+ vn,
6165
6184
  {
6166
6185
  group: t,
6167
6186
  highlightFirst: n.highlightFirst,
@@ -6174,7 +6193,7 @@ const mn = {
6174
6193
  }
6175
6194
  ),
6176
6195
  /* @__PURE__ */ a(
6177
- bn,
6196
+ vn,
6178
6197
  {
6179
6198
  group: t,
6180
6199
  highlightFirst: o.highlightFirst,
@@ -6189,7 +6208,7 @@ const mn = {
6189
6208
  ]
6190
6209
  }
6191
6210
  );
6192
- }, Ga = E.div`
6211
+ }, Wa = E.div`
6193
6212
  & > button {
6194
6213
  height: 66px;
6195
6214
  min-width: 66px;
@@ -6207,7 +6226,7 @@ const mn = {
6207
6226
  }
6208
6227
  }
6209
6228
  }
6210
- `, El = (e) => /* @__PURE__ */ a(Ga, { children: /* @__PURE__ */ a(Q, { ...e }) }), Ba = E.div`
6229
+ `, Al = (e) => /* @__PURE__ */ a(Wa, { children: /* @__PURE__ */ a(Q, { ...e }) }), Ya = E.div`
6211
6230
  display: flex;
6212
6231
  justify-content: space-between;
6213
6232
  align-items: center;
@@ -6236,14 +6255,14 @@ const mn = {
6236
6255
  }
6237
6256
  }
6238
6257
  }
6239
- `, Nl = (e) => {
6258
+ `, Il = (e) => {
6240
6259
  const { handleBack: t, handleNext: n, disabledBack: o, disabledNext: r, textValues: i } = e;
6241
- return /* @__PURE__ */ m(Ba, { children: [
6260
+ return /* @__PURE__ */ m(Ya, { children: [
6242
6261
  /* @__PURE__ */ a(
6243
6262
  Q,
6244
6263
  {
6245
6264
  ...e,
6246
- iconBefore: /* @__PURE__ */ a(Qn, {}),
6265
+ iconBefore: /* @__PURE__ */ a(Jn, {}),
6247
6266
  variant: "none",
6248
6267
  onClick: t,
6249
6268
  children: i.back,
@@ -6254,7 +6273,7 @@ const mn = {
6254
6273
  Q,
6255
6274
  {
6256
6275
  ...e,
6257
- iconBefore: /* @__PURE__ */ a(Jn, {}),
6276
+ iconBefore: /* @__PURE__ */ a(Zn, {}),
6258
6277
  variant: "none",
6259
6278
  onClick: n,
6260
6279
  children: i.next,
@@ -6262,34 +6281,34 @@ const mn = {
6262
6281
  }
6263
6282
  )
6264
6283
  ] });
6265
- }, kl = (e) => Object.values(e).flat(), Al = (e, t) => {
6266
- const n = ye(e);
6284
+ }, $l = (e) => Object.values(e).flat(), Fl = (e, t) => {
6285
+ const n = Te(e);
6267
6286
  return Object.fromEntries(
6268
6287
  Object.entries(n).map(([o, r]) => [o, r.map(t)])
6269
6288
  );
6270
- }, qa = (e) => Object.entries(e).map(([t, n]) => ({
6289
+ }, Xa = (e) => Object.entries(e).map(([t, n]) => ({
6271
6290
  ConditionGroupId: t,
6272
6291
  conditionsThatEstablishesTheDecision: ct(n)
6273
- })), Il = (e) => {
6274
- const t = ye(e);
6292
+ })), Rl = (e) => {
6293
+ const t = Te(e);
6275
6294
  return {
6276
6295
  ...e,
6277
- conditionGroups: qa(t),
6296
+ conditionGroups: Xa(t),
6278
6297
  // UI-only
6279
6298
  conditionsThatEstablishesTheDecision: t
6280
6299
  // preserve full structure
6281
6300
  };
6282
- }, _e = /* @__PURE__ */ new Map(), Wa = (e, t) => _e.get(`${t}:${e}`), Ya = (e, t, n) => {
6301
+ }, Pe = /* @__PURE__ */ new Map(), Qa = (e, t) => Pe.get(`${t}:${e}`), Ja = (e, t, n) => {
6283
6302
  const o = `${t}:${e}`;
6284
- if (_e.set(o, n), _e.size > 1e3) {
6285
- const r = _e.keys().next().value;
6286
- r !== void 0 && _e.delete(r);
6287
- }
6288
- }, vn = /* @__PURE__ */ new Map(), Xa = 1e3, Qa = (e) => {
6289
- const t = Date.now(), n = vn.get(e) || 0;
6290
- return t - n < Xa ? !0 : (vn.set(e, t), !1);
6291
- }, Ja = (e) => {
6292
- const t = ao(e);
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);
6293
6312
  return {
6294
6313
  spa: "es",
6295
6314
  eng: "en",
@@ -6298,14 +6317,14 @@ const mn = {
6298
6317
  ita: "it",
6299
6318
  por: "pt"
6300
6319
  }[t] || "en";
6301
- }, Za = async (e, t, { url: n, apiKey: o }) => {
6302
- const r = `${t}:${e}`, i = Wa(e, t);
6320
+ }, tl = async (e, t, { url: n, apiKey: o }) => {
6321
+ const r = `${t}:${e}`, i = Qa(e, t);
6303
6322
  if (i) return i;
6304
- if (Qa(r))
6323
+ if (Ka(r))
6305
6324
  return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
6306
- const s = Ja(e);
6325
+ const s = el(e);
6307
6326
  try {
6308
- const { data: d } = await io.post(
6327
+ const { data: d } = await ao.post(
6309
6328
  n,
6310
6329
  {
6311
6330
  q: e,
@@ -6319,25 +6338,25 @@ const mn = {
6319
6338
  }
6320
6339
  }
6321
6340
  ), l = (d == null ? void 0 : d.translatedText) || e;
6322
- return Ya(e, t, l), l;
6341
+ return Ja(e, t, l), l;
6323
6342
  } catch (d) {
6324
6343
  return console.warn(`[Translation] Failed for: "${e}"`, d), e;
6325
6344
  }
6326
- }, Ka = (e) => typeof e == "string" && e.trim().length > 0, yn = async (e, t, n) => {
6345
+ }, nl = (e) => typeof e == "string" && e.trim().length > 0, Tn = async (e, t, n) => {
6327
6346
  const o = await Promise.all(
6328
6347
  Object.entries(e).map(async ([r, i]) => {
6329
- if (Ka(i)) {
6330
- const s = await Za(i, t, n);
6348
+ if (nl(i)) {
6349
+ const s = await tl(i, t, n);
6331
6350
  return [r, s];
6332
6351
  } else if (Array.isArray(i)) {
6333
6352
  const s = await Promise.all(
6334
6353
  i.map(
6335
- async (d) => typeof d == "object" && d !== null ? await yn(d, t, n) : d
6354
+ async (d) => typeof d == "object" && d !== null ? await Tn(d, t, n) : d
6336
6355
  )
6337
6356
  );
6338
6357
  return [r, s];
6339
6358
  } else if (typeof i == "object" && i !== null) {
6340
- const s = await yn(i, t, n);
6359
+ const s = await Tn(i, t, n);
6341
6360
  return [r, s];
6342
6361
  } else
6343
6362
  return [r, i];
@@ -6346,38 +6365,38 @@ const mn = {
6346
6365
  return Object.fromEntries(o);
6347
6366
  };
6348
6367
  export {
6349
- Nl as BackAndNextButton,
6368
+ Il as BackAndNextButton,
6350
6369
  Xe as BusinessRuleCard,
6351
- Sn as BusinessRuleCardNew,
6370
+ En as BusinessRuleCardNew,
6352
6371
  Qt as BusinessRuleView,
6353
- Nn as BusinessRuleViewNew,
6354
- hl as BusinessRules,
6355
- fl as BusinessRulesNew,
6356
- gl as BusinessRulesWithGroup,
6357
- Sl as DragAndDropBoxes,
6358
- bn as DraggableList,
6359
- Pi as DropdownMenu,
6360
- Cl as DropdownMenuContainer,
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,
6361
6380
  de as EValueHowToSetUp,
6362
- ml as Filter,
6363
- bl as FormFilter,
6364
- wn as ModalRules,
6365
- $i as RulesForm,
6366
- El as SendButton,
6367
- Zr as buildEsConditionSentence,
6368
- yi as convertRangeToString,
6369
- En as filterByGroup,
6370
- kl as flatFromGroups,
6371
- vl as formatDecisionForBackend,
6372
- ye as getConditionsByGroupNew,
6373
- qa as groupsRecordToArrayNew,
6374
- Al as mapByGroupNew,
6375
- Il as normalizeDecisionToNewShape,
6376
- yl as parseRangeFromString,
6377
- Tl as revertSortedDataSampleSwitchPlaces,
6378
- xl as revertSortedDataSwitchPlaces,
6379
- Dl as sortDisplayDataSampleSwitchPlaces,
6380
- wl as sortDisplayDataSwitchPlaces,
6381
- yn as translateObject,
6382
- Za as translateText
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
6383
6402
  };