@isettingkit/business-rules 1.0.19 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,21 +1,21 @@
1
- import { jsx as a, jsxs as p, Fragment as A } from "react/jsx-runtime";
2
- import { MdOutlineDelete as Ce, MdClear as pe, MdAdd as ge, MdClose as Se, MdOutlineFilterAltOff as me, MdOutlineFilterAlt as be } from "react-icons/md";
3
- import { inube as y, Stack as g, Divider as I, Icon as M, Text as C, SkeletonLine as j, useMediaQuery as V, Blanket as fe, Button as L, Grid as J, Tag as q, OptionList as De, Checkpicker as ke, Toggle as Te, Checkbox as Ne, Date as ae } from "@inubekit/inubekit";
4
- import x, { keyframes as Ee, ThemeContext as $e } from "styled-components";
5
- import { ValueDataType as z, ValueHowToSetUp as B, DecisionConditionRender as re } from "@isettingkit/input";
6
- import { DecisionViewConditionRenderer as G } from "@isettingkit/view";
7
- import { createPortal as ye } from "react-dom";
8
- import Ae, { useState as R, useRef as H, useEffect as X, useContext as Fe } from "react";
9
- import { useFormik as Ie } from "formik";
10
- import { string as Z, mixed as xe, object as P, number as Q, lazy as ie, date as le } from "yup";
11
- import Re from "axios";
12
- import { franc as Oe } from "franc-min";
13
- const Me = x.div`
1
+ import { jsx as o, jsxs as h, Fragment as k } from "react/jsx-runtime";
2
+ import { MdOutlineDelete as Te, MdClear as xe, MdAdd as Y, MdExpandLess as Re, MdExpandMore as Oe, MdClose as Me, MdOutlineFilterAltOff as ve, MdOutlineFilterAlt as ye } from "react-icons/md";
3
+ import { inube as v, Stack as g, Divider as R, Icon as L, Text as S, SkeletonLine as z, useMediaQuery as B, Blanket as we, Button as U, Grid as K, Box as Le, Tag as H, SkeletonIcon as Ue, OptionList as ze, Checkpicker as Ve, Toggle as Ce, Checkbox as je, Date as de } from "@inubekit/inubekit";
4
+ import x, { keyframes as De, ThemeContext as Be } from "styled-components";
5
+ import { ValueDataType as I, ValueHowToSetUp as V, DecisionConditionRender as ce } from "@isettingkit/input";
6
+ import { DecisionViewConditionRenderer as X, DecisionViewConditionRendererNew as G } from "@isettingkit/view";
7
+ import { createPortal as Se } from "react-dom";
8
+ import _e, { useState as O, useRef as Q, useEffect as oe, useContext as He } from "react";
9
+ import { useFormik as qe } from "formik";
10
+ import { string as ie, mixed as Ne, object as W, number as ee, lazy as ue, date as pe } from "yup";
11
+ import Pe from "axios";
12
+ import { franc as Ge } from "franc-min";
13
+ const Qe = x.div`
14
14
  border-radius: 8px;
15
15
  border: 1px solid
16
16
  ${({ theme: e }) => {
17
- var t, n;
18
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
17
+ var n, t;
18
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
19
19
  }};
20
20
  box-sizing: border-box;
21
21
  display: flex;
@@ -45,36 +45,51 @@ x.div`
45
45
  border-radius: 8px;
46
46
  }
47
47
  `;
48
- const ee = (e) => {
49
- const { children: t, controls: n = !0, handleDelete: o, id: r } = e;
50
- return /* @__PURE__ */ a(Me, { children: /* @__PURE__ */ p(g, { direction: "column", gap: "16px", padding: "12px 16px", children: [
51
- t,
52
- n && /* @__PURE__ */ p(A, { children: [
53
- /* @__PURE__ */ a(I, {}),
54
- /* @__PURE__ */ a(g, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ a(
55
- M,
48
+ const re = (e) => {
49
+ const { children: n, controls: t = !0, handleDelete: a, id: i } = e;
50
+ return /* @__PURE__ */ o(Qe, { children: /* @__PURE__ */ h(g, { direction: "column", gap: "16px", padding: "12px 16px", children: [
51
+ n,
52
+ t && /* @__PURE__ */ h(k, { children: [
53
+ /* @__PURE__ */ o(R, {}),
54
+ /* @__PURE__ */ o(g, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ o(
55
+ L,
56
56
  {
57
57
  cursorHover: !0,
58
58
  appearance: "danger",
59
59
  size: "24px",
60
- icon: /* @__PURE__ */ a(Ce, {}),
60
+ icon: /* @__PURE__ */ o(Te, {}),
61
61
  onClick: () => {
62
- o(r);
62
+ a(i);
63
63
  }
64
64
  }
65
65
  ) })
66
66
  ] })
67
67
  ] }) });
68
- }, se = x.div`
68
+ }, We = (e) => e.value, Ye = (e) => e.value, Ke = (e) => e.value, Je = (e) => ({
69
+ from: e.from ?? "",
70
+ to: e.to ?? ""
71
+ }), Xe = (e) => e.value, Ze = (e) => e.value, en = (e) => e.value;
72
+ var D = /* @__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))(D || {});
73
+ const nn = {
74
+ [D.LIST_OF_VALUES]: Ye,
75
+ [D.LIST_OF_VALUES_MULTI]: Ke,
76
+ [D.RANGE]: Je,
77
+ [D.GREATER_THAN]: Xe,
78
+ [D.LESS_THAN]: Ze,
79
+ [D.EQUAL]: en
80
+ }, q = (e) => {
81
+ const n = e == null ? void 0 : e.value, t = typeof n == "object" && n !== null && !Array.isArray(n), a = nn[e == null ? void 0 : e.howToSetTheDecision] || We;
82
+ return t && a(n) || n || void 0;
83
+ }, he = x.div`
69
84
  & > div {
70
85
  border-radius: 8px;
71
86
  border: 1px solid
72
87
  ${({ theme: e }) => {
73
- var t, n;
74
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
88
+ var n, t;
89
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
75
90
  }};
76
91
  }
77
- `, de = x.div`
92
+ `, ge = x.div`
78
93
  width: 100%;
79
94
  height: 100%;
80
95
  overflow-y: auto;
@@ -92,105 +107,90 @@ const ee = (e) => {
92
107
  background-color: #ebecf0;
93
108
  border-radius: 8px;
94
109
  }
95
- `, Le = (e) => e.value, ze = (e) => e.value, Ve = (e) => e.value, je = (e) => ({
96
- from: e.from ?? "",
97
- to: e.to ?? ""
98
- }), _e = (e) => e.value, Ue = (e) => e.value, Be = (e) => e.value;
99
- var D = /* @__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))(D || {});
100
- const qe = {
101
- [D.LIST_OF_VALUES]: ze,
102
- [D.LIST_OF_VALUES_MULTI]: Ve,
103
- [D.RANGE]: je,
104
- [D.GREATER_THAN]: _e,
105
- [D.LESS_THAN]: Ue,
106
- [D.EQUAL]: Be
107
- }, U = (e) => {
108
- const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), o = qe[e == null ? void 0 : e.howToSetTheDecision] || Le;
109
- return n && o(t) || t || void 0;
110
- }, He = (e) => {
110
+ `, tn = (e) => {
111
111
  const {
112
- conditionsAlignment: t,
113
- decision: n,
114
- decisionDateElement: o,
115
- decisionMapper: r,
116
- loading: i,
117
- skeleton: h,
112
+ conditionsAlignment: n,
113
+ decision: t,
114
+ decisionDateElement: a,
115
+ decisionMapper: i,
116
+ loading: r,
117
+ skeleton: p,
118
118
  terms: l,
119
- textValues: c,
120
- visibleConditions: d
119
+ textValues: s,
120
+ visibleConditions: c
121
121
  } = e;
122
- return i ? /* @__PURE__ */ p(g, { direction: "column", gap: "12px", children: [
123
- /* @__PURE__ */ a(g, { direction: "column", alignItems: "center", children: /* @__PURE__ */ a(
124
- G,
122
+ return r ? /* @__PURE__ */ h(g, { direction: "column", gap: "12px", children: [
123
+ /* @__PURE__ */ o(g, { direction: "column", alignItems: "center", children: /* @__PURE__ */ o(
124
+ X,
125
125
  {
126
- element: r,
127
- valueData: U(
128
- r
126
+ element: i,
127
+ valueData: q(
128
+ i
129
129
  ),
130
130
  type: "decision"
131
131
  }
132
- ) }, n.ruleName),
133
- /* @__PURE__ */ a(I, { dashed: !0 }),
134
- /* @__PURE__ */ a(de, { children: /* @__PURE__ */ p(
132
+ ) }, t.ruleName),
133
+ /* @__PURE__ */ o(R, { dashed: !0 }),
134
+ /* @__PURE__ */ o(ge, { children: /* @__PURE__ */ h(
135
135
  g,
136
136
  {
137
137
  direction: "column",
138
138
  gap: "12px",
139
- justifyContent: t,
139
+ justifyContent: n,
140
140
  height: "203px",
141
141
  children: [
142
- /* @__PURE__ */ a(
143
- C,
142
+ /* @__PURE__ */ o(
143
+ S,
144
144
  {
145
145
  type: "label",
146
146
  size: "large",
147
147
  appearance: "dark",
148
148
  weight: "bold",
149
149
  textAlign: "center",
150
- children: c.factsThatConditionIt
150
+ children: s.factsThatConditionIt
151
151
  }
152
152
  ),
153
- d.map((u) => /* @__PURE__ */ a(se, { children: /* @__PURE__ */ a(g, { direction: "column", padding: "8px", children: /* @__PURE__ */ a(
154
- G,
153
+ c.map((u) => /* @__PURE__ */ o(he, { children: /* @__PURE__ */ o(g, { direction: "column", padding: "8px", children: /* @__PURE__ */ o(
154
+ X,
155
155
  {
156
156
  element: { ...u, value: u.value },
157
- valueData: U(
157
+ valueData: q(
158
158
  u
159
159
  )
160
160
  }
161
161
  ) }) }, u.conditionName)),
162
- l && /* @__PURE__ */ p(A, { children: [
163
- /* @__PURE__ */ a(I, { dashed: !0 }),
164
- o && /* @__PURE__ */ a(
165
- G,
162
+ l && /* @__PURE__ */ h(k, { children: [
163
+ /* @__PURE__ */ o(R, { dashed: !0 }),
164
+ a && /* @__PURE__ */ o(
165
+ X,
166
166
  {
167
- element: o.element,
168
- valueData: o.valueData,
167
+ element: a.element,
168
+ valueData: a.valueData,
169
169
  type: "decision"
170
170
  },
171
- c.terms
171
+ s.terms
172
172
  )
173
173
  ] })
174
174
  ]
175
175
  }
176
176
  ) })
177
- ] }) : /* @__PURE__ */ p(g, { direction: "column", gap: "12px", children: [
178
- /* @__PURE__ */ p(g, { direction: "column", alignItems: "center", gap: "4px", children: [
179
- /* @__PURE__ */ a(j, { animated: !0, width: "180px" }),
180
- /* @__PURE__ */ a(j, { animated: !0, width: "85px" })
177
+ ] }) : /* @__PURE__ */ h(g, { direction: "column", gap: "12px", children: [
178
+ /* @__PURE__ */ h(g, { direction: "column", alignItems: "center", gap: "4px", children: [
179
+ /* @__PURE__ */ o(z, { animated: !0, width: "180px" }),
180
+ /* @__PURE__ */ o(z, { animated: !0, width: "85px" })
181
181
  ] }, "loading"),
182
- /* @__PURE__ */ p(g, { direction: "column", gap: "12px", alignItems: "center", children: [
183
- /* @__PURE__ */ a(I, { dashed: !0 }),
184
- /* @__PURE__ */ a(j, { animated: !0, width: "150px" })
182
+ /* @__PURE__ */ h(g, { direction: "column", gap: "12px", alignItems: "center", children: [
183
+ /* @__PURE__ */ o(R, { dashed: !0 }),
184
+ /* @__PURE__ */ o(z, { animated: !0, width: "150px" })
185
185
  ] }),
186
- /* @__PURE__ */ a(de, { children: /* @__PURE__ */ a(
186
+ /* @__PURE__ */ o(ge, { children: /* @__PURE__ */ o(
187
187
  g,
188
188
  {
189
189
  direction: "column",
190
190
  gap: "12px",
191
191
  justifyContent: "space-between",
192
192
  height: "203px",
193
- children: h.map((u, s) => /* @__PURE__ */ a(se, { children: /* @__PURE__ */ p(
193
+ children: p.map((u, d) => /* @__PURE__ */ o(he, { children: /* @__PURE__ */ h(
194
194
  g,
195
195
  {
196
196
  direction: "column",
@@ -198,76 +198,76 @@ const qe = {
198
198
  alignItems: "start",
199
199
  padding: "8px",
200
200
  children: [
201
- /* @__PURE__ */ a(j, { animated: !0, width: "180px" }),
202
- /* @__PURE__ */ a(j, { animated: !0, width: "85px" })
201
+ /* @__PURE__ */ o(z, { animated: !0, width: "180px" }),
202
+ /* @__PURE__ */ o(z, { animated: !0, width: "85px" })
203
203
  ]
204
204
  }
205
- ) }, `condition-${s}`))
205
+ ) }, `condition-${d}`))
206
206
  }
207
207
  ) })
208
208
  ] });
209
- }, ve = (e) => {
210
- var f;
211
- const { decision: t, loading: n = !1, textValues: o } = e, r = !!(t != null && t.effectiveFrom), i = !!(t != null && t.validUntil), h = r && i ? {
209
+ }, Ee = (e) => {
210
+ var b;
211
+ const { decision: n, loading: t = !1, textValues: a } = e, i = !!(n != null && n.effectiveFrom), r = !!(n != null && n.validUntil), p = i && r ? {
212
212
  element: {
213
- labelName: o == null ? void 0 : o.terms,
214
- value: String(t.effectiveFrom),
215
- howToSetTheDecision: B.RANGE,
216
- decisionDataType: z.DATE
213
+ labelName: a == null ? void 0 : a.terms,
214
+ value: String(n.effectiveFrom),
215
+ howToSetTheDecision: V.RANGE,
216
+ decisionDataType: I.DATE
217
217
  },
218
- valueData: U({
219
- labelName: o == null ? void 0 : o.terms,
218
+ valueData: q({
219
+ labelName: a == null ? void 0 : a.terms,
220
220
  value: {
221
- from: String(t.effectiveFrom),
222
- to: String(t.validUntil)
221
+ from: String(n.effectiveFrom),
222
+ to: String(n.validUntil)
223
223
  },
224
- howToSetTheDecision: B.RANGE,
225
- decisionDataType: z.DATE
224
+ howToSetTheDecision: V.RANGE,
225
+ decisionDataType: I.DATE
226
226
  })
227
- } : r && !i ? {
227
+ } : i && !r ? {
228
228
  element: {
229
- labelName: o == null ? void 0 : o.terms,
230
- value: String(t.effectiveFrom),
231
- howToSetTheDecision: B.EQUAL,
232
- decisionDataType: z.DATE
229
+ labelName: a == null ? void 0 : a.terms,
230
+ value: String(n.effectiveFrom),
231
+ howToSetTheDecision: V.EQUAL,
232
+ decisionDataType: I.DATE
233
233
  },
234
- valueData: U({
235
- labelName: o == null ? void 0 : o.terms,
236
- value: String(t.effectiveFrom),
237
- howToSetTheDecision: B.EQUAL,
238
- decisionDataType: z.DATE
234
+ valueData: q({
235
+ labelName: a == null ? void 0 : a.terms,
236
+ value: String(n.effectiveFrom),
237
+ howToSetTheDecision: V.EQUAL,
238
+ decisionDataType: I.DATE
239
239
  })
240
- } : null, l = t ? {
241
- labelName: t.labelName || "",
242
- decisionDataType: t.decisionDataType || "alphabetical",
243
- value: U(t),
244
- howToSetTheDecision: t.howToSetTheDecision || "EqualTo"
245
- } : null, c = ((f = t == null ? void 0 : t.conditionsThatEstablishesTheDecision) == null ? void 0 : f.filter(
246
- (T) => !T.hidden
247
- )) || [], d = Array.from({ length: 5 }), u = !!(!n && t && o && l), s = c.length < 2 ? "start" : "space-between";
248
- return /* @__PURE__ */ a(
249
- He,
240
+ } : null, l = n ? {
241
+ labelName: n.labelName || "",
242
+ decisionDataType: n.decisionDataType || "alphabetical",
243
+ value: q(n),
244
+ howToSetTheDecision: n.howToSetTheDecision || "EqualTo"
245
+ } : null, s = ((b = n == null ? void 0 : n.conditionsThatEstablishesTheDecision) == null ? void 0 : b.filter(
246
+ (m) => !m.hidden
247
+ )) || [], c = Array.from({ length: 5 }), u = !!(!t && n && a && l), d = s.length < 2 ? "start" : "space-between";
248
+ return /* @__PURE__ */ o(
249
+ tn,
250
250
  {
251
- conditionsAlignment: s,
252
- decision: t,
253
- decisionDateElement: h,
251
+ conditionsAlignment: d,
252
+ decision: n,
253
+ decisionDateElement: p,
254
254
  decisionMapper: l,
255
255
  loading: u,
256
- skeleton: d,
257
- terms: !!(o != null && o.terms),
258
- textValues: o,
259
- visibleConditions: c
256
+ skeleton: c,
257
+ terms: !!(a != null && a.terms),
258
+ textValues: a,
259
+ visibleConditions: s
260
260
  }
261
261
  );
262
- }, Pe = x.div`
262
+ }, an = x.div`
263
263
  position: relative;
264
264
  & > div {
265
265
  padding: 24px 16px;
266
266
  }
267
- `, Ge = x.div`
267
+ `, on = x.div`
268
268
  background-color: ${({ theme: e }) => {
269
- var t, n;
270
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || y.palette.neutral.N0;
269
+ var n, t;
270
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N0) || v.palette.neutral.N0;
271
271
  }};
272
272
  max-width: 450px;
273
273
  max-height: 90vh;
@@ -295,24 +295,24 @@ const qe = {
295
295
  background-color: #ebecf0;
296
296
  border-radius: 8px;
297
297
  }
298
- `, We = (e) => {
299
- const { children: t, portalId: n, onCloseModal: o, title: r } = e, i = document.getElementById(n);
300
- if (!i)
298
+ `, ke = (e) => {
299
+ const { children: n, portalId: t, onCloseModal: a, title: i } = e, r = document.getElementById(t);
300
+ if (!r)
301
301
  throw new Error(
302
302
  "The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
303
303
  );
304
- const h = V("(max-width: 400px)");
305
- return ye(
306
- /* @__PURE__ */ a(Pe, { smallScreen: h, children: /* @__PURE__ */ a(fe, { children: /* @__PURE__ */ a(Ge, { children: /* @__PURE__ */ p(g, { direction: "column", gap: "24px", children: [
307
- /* @__PURE__ */ a(g, { direction: "column", gap: "24px", children: /* @__PURE__ */ p(g, { alignItems: "center", justifyContent: "space-between", children: [
308
- /* @__PURE__ */ a(C, { type: "title", size: "large", appearance: "dark", weight: "bold", children: r }),
309
- /* @__PURE__ */ a(pe, { size: "24px", cursor: "pointer", onClick: o })
304
+ const p = B("(max-width: 400px)");
305
+ return Se(
306
+ /* @__PURE__ */ o(an, { smallScreen: p, children: /* @__PURE__ */ o(we, { children: /* @__PURE__ */ o(on, { children: /* @__PURE__ */ h(g, { direction: "column", gap: "24px", children: [
307
+ /* @__PURE__ */ o(g, { direction: "column", gap: "24px", children: /* @__PURE__ */ h(g, { alignItems: "center", justifyContent: "space-between", children: [
308
+ /* @__PURE__ */ o(S, { type: "title", size: "large", appearance: "dark", weight: "bold", children: i }),
309
+ /* @__PURE__ */ o(xe, { size: "24px", cursor: "pointer", onClick: a })
310
310
  ] }) }),
311
- t
311
+ n
312
312
  ] }) }) }) }),
313
- i
313
+ r
314
314
  );
315
- }, Qe = Ee`
315
+ }, rn = De`
316
316
  from {
317
317
  opacity: 0;
318
318
  transform: translateY(20px);
@@ -326,8 +326,8 @@ x.div`
326
326
  border-radius: 8px;
327
327
  border: 1px solid
328
328
  ${({ theme: e }) => {
329
- var t, n;
330
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
329
+ var n, t;
330
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
331
331
  }};
332
332
  box-sizing: border-box;
333
333
  display: flex;
@@ -341,36 +341,32 @@ x.div`
341
341
  border-radius: 8px;
342
342
  border: 1px solid
343
343
  ${({ theme: e }) => {
344
- var t, n;
345
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
344
+ var n, t;
345
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
346
346
  }};
347
347
  }
348
348
  `;
349
- const Ye = x.div`
349
+ const Ae = x.div`
350
350
  & > div {
351
- background-color: ${({ theme: e }) => {
352
- var t, n;
353
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N10) || y.palette.neutral.N10;
351
+ box-shadow: 0px 2px 3px 0px
352
+ ${({ theme: e }) => {
353
+ var n, t;
354
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutralAlpha) == null ? void 0 : t.N700A) || v.palette.neutralAlpha.N30A;
354
355
  }};
355
- justify-content: center;
356
+ cursor: pointer;
356
357
  }
357
- min-height: 350px;
358
- width: 100%;
359
- height: 100%;
360
- padding-bottom: 12px;
361
- cursor: pointer;
362
- `, we = x.div`
358
+ `, J = x.div`
363
359
  width: 100%;
364
360
  height: 100%;
365
361
  & > div {
366
- animation: ${Qe} 600ms ease-out;
362
+ animation: ${rn} 600ms ease-out;
367
363
  }
368
- `, Ke = x.div`
364
+ `, ln = x.div`
369
365
  & > div > div {
370
366
  border-radius: 8px;
371
367
  box-sizing: border-box;
372
368
  }
373
- `, Je = x.div`
369
+ `, sn = x.div`
374
370
  & > div {
375
371
  width: 100%;
376
372
  height: 100%;
@@ -390,149 +386,145 @@ const Ye = x.div`
390
386
  border-radius: 8px;
391
387
  }
392
388
  }
393
- `;
394
- function Xe(e) {
395
- const { index: t, handleOpenModal: n } = e;
396
- return /* @__PURE__ */ a(
397
- ee,
389
+ `, dn = (e) => {
390
+ const { index: n, handleOpenModal: t } = e;
391
+ return /* @__PURE__ */ o(
392
+ re,
398
393
  {
399
- id: `loading-card-${t}`,
394
+ id: `loading-card-${n}`,
400
395
  handleDelete: () => {
401
396
  },
402
- handleView: () => n ? n() : null,
397
+ handleView: () => t ? t() : null,
403
398
  controls: !1,
404
- children: /* @__PURE__ */ a(ve, { loading: !0 })
399
+ children: /* @__PURE__ */ o(Ee, { loading: !0 })
405
400
  },
406
- `loading-card-${t}`
401
+ `loading-card-${n}`
407
402
  );
408
- }
409
- function Ze(e) {
410
- const { decision: t, controls: n, handleOpenModal: o, handleDelete: r, textValues: i } = e;
411
- return t ? /* @__PURE__ */ a(we, { children: /* @__PURE__ */ p(g, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
412
- /* @__PURE__ */ a(C, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
413
- /* @__PURE__ */ a(
414
- ee,
403
+ }, cn = (e) => {
404
+ const { decision: n, controls: t, handleOpenModal: a, handleDelete: i, textValues: r } = e;
405
+ return n ? /* @__PURE__ */ o(J, { children: /* @__PURE__ */ h(g, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
406
+ /* @__PURE__ */ o(S, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: n.decisionId }),
407
+ /* @__PURE__ */ o(
408
+ re,
415
409
  {
416
- id: t.decisionId,
417
- handleDelete: () => r ? r(t.decisionId) : null,
418
- handleView: () => o ? o(t) : null,
419
- controls: n,
420
- children: /* @__PURE__ */ a(ve, { decision: t, textValues: i })
410
+ id: n.decisionId,
411
+ handleDelete: () => i ? i(n.decisionId) : null,
412
+ handleView: () => a ? a(n) : null,
413
+ controls: t,
414
+ children: /* @__PURE__ */ o(Ee, { decision: n, textValues: r })
421
415
  }
422
416
  )
423
- ] }) }, t.decisionId) : null;
424
- }
425
- function et(e) {
417
+ ] }) }, n.decisionId) : null;
418
+ }, un = (e) => {
426
419
  const {
427
- customTitleContentAddCard: t,
428
- index: n,
429
- handleOpenModal: o,
430
- shouldRenderEmptyMessage: r
431
- } = e, i = t || "Agregar decisión";
432
- return /* @__PURE__ */ a(we, { children: r ? null : /* @__PURE__ */ p(g, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
433
- /* @__PURE__ */ a(C, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
434
- /* @__PURE__ */ a(
435
- Ye,
420
+ customTitleContentAddCard: n,
421
+ index: t,
422
+ handleOpenModal: a,
423
+ shouldRenderEmptyMessage: i
424
+ } = e, r = n || "Agregar decisión";
425
+ return /* @__PURE__ */ o(J, { children: i ? null : /* @__PURE__ */ h(g, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
426
+ /* @__PURE__ */ o(S, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
427
+ /* @__PURE__ */ o(
428
+ Ae,
436
429
  {
437
- onClick: () => o ? o() : null,
438
- children: /* @__PURE__ */ a(
439
- ee,
430
+ onClick: () => a ? a() : null,
431
+ children: /* @__PURE__ */ o(
432
+ re,
440
433
  {
441
- id: `add-decision-${n}`,
434
+ id: `add-decision-${t}`,
442
435
  handleDelete: () => {
443
436
  },
444
- handleView: () => o ? o() : null,
437
+ handleView: () => a ? a() : null,
445
438
  controls: !1,
446
- children: /* @__PURE__ */ p(g, { direction: "column", gap: "12px", alignItems: "center", children: [
447
- /* @__PURE__ */ a(M, { appearance: "gray", icon: /* @__PURE__ */ a(ge, {}), size: "35px" }),
448
- /* @__PURE__ */ a(C, { appearance: "gray", type: "body", size: "large", children: i })
439
+ children: /* @__PURE__ */ h(g, { direction: "column", gap: "12px", alignItems: "center", children: [
440
+ /* @__PURE__ */ o(L, { appearance: "gray", icon: /* @__PURE__ */ o(Y, {}), size: "35px" }),
441
+ /* @__PURE__ */ o(S, { appearance: "gray", type: "body", size: "large", children: r })
449
442
  ] })
450
443
  }
451
444
  )
452
445
  }
453
446
  )
454
- ] }) }, `add-decision-${n}`);
455
- }
456
- const tt = {
457
- loading: Xe,
458
- decision: Ze,
459
- add: et
460
- }, Y = (e) => {
461
- const { type: t } = e, n = tt[t];
462
- return n ? n(e) : null;
463
- }, nt = (e) => {
447
+ ] }) }, `add-decision-${t}`);
448
+ }, pn = {
449
+ loading: dn,
450
+ decision: cn,
451
+ add: un
452
+ }, ne = (e) => {
453
+ const { type: n } = e, t = pn[n];
454
+ return t ? t(e) : null;
455
+ }, hn = (e) => {
464
456
  const {
465
- controls: t,
466
- customTitleContentAddCard: n,
467
- decisions: o,
468
- loading: r,
469
- handleOpenModal: i,
470
- handleDelete: h,
457
+ controls: n,
458
+ customTitleContentAddCard: t,
459
+ decisions: a,
460
+ loading: i,
461
+ handleOpenModal: r,
462
+ handleDelete: p,
471
463
  textValues: l
472
- } = e, c = r ? Array.from({ length: 3 }).map(
473
- (u, s) => Y({
464
+ } = e, s = i ? Array.from({ length: 3 }).map(
465
+ (u, d) => ne({
474
466
  type: "loading",
475
- index: s,
476
- controls: t,
477
- customTitleContentAddCard: n,
478
- loading: r,
479
- handleOpenModal: i,
480
- handleDelete: h,
467
+ index: d,
468
+ controls: n,
469
+ customTitleContentAddCard: t,
470
+ loading: i,
471
+ handleOpenModal: r,
472
+ handleDelete: p,
481
473
  textValues: l
482
474
  })
483
- ) : o == null ? void 0 : o.map(
484
- (u) => Y({
475
+ ) : a == null ? void 0 : a.map(
476
+ (u) => ne({
485
477
  type: "decision",
486
478
  decision: u,
487
- controls: t,
488
- customTitleContentAddCard: n,
489
- loading: r,
490
- handleOpenModal: i,
491
- handleDelete: h,
479
+ controls: n,
480
+ customTitleContentAddCard: t,
481
+ loading: i,
482
+ handleOpenModal: r,
483
+ handleDelete: p,
492
484
  textValues: l
493
485
  })
494
- ), d = ((o == null ? void 0 : o.length) === 0 || o.length < Math.floor(window.innerWidth / 300)) && !r && t;
495
- return { renderedCards: c, shouldRenderAddCard: d };
496
- }, Gt = (e) => {
486
+ ), c = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !i && n;
487
+ return { renderedCards: s, shouldRenderAddCard: c };
488
+ }, xt = (e) => {
497
489
  const {
498
- controls: t = !0,
499
- customTitleContentAddCard: n,
500
- customMessageEmptyDecisions: o,
501
- decisions: r,
502
- textValues: i,
503
- decisionTemplate: h,
490
+ controls: n = !0,
491
+ customTitleContentAddCard: t,
492
+ customMessageEmptyDecisions: a,
493
+ decisions: i,
494
+ textValues: r,
495
+ decisionTemplate: p,
504
496
  isModalOpen: l,
505
- selectedDecision: c,
506
- loading: d,
497
+ selectedDecision: s,
498
+ loading: c,
507
499
  handleOpenModal: u,
508
- handleCloseModal: s,
509
- handleSubmitForm: f,
510
- handleDelete: T,
511
- terms: b = !0
512
- } = e, v = V("(max-width: 681px)"), w = V("(max-width: 400px)"), { renderedCards: S, shouldRenderAddCard: k } = nt({
513
- controls: t,
514
- customTitleContentAddCard: n,
515
- decisions: r,
516
- loading: d,
500
+ handleCloseModal: d,
501
+ handleSubmitForm: b,
502
+ handleDelete: m,
503
+ terms: f = !0
504
+ } = e, y = B("(max-width: 681px)"), C = B("(max-width: 400px)"), { renderedCards: w, shouldRenderAddCard: E } = hn({
505
+ controls: n,
506
+ customTitleContentAddCard: t,
507
+ decisions: i,
508
+ loading: c,
517
509
  handleOpenModal: u,
518
- handleDelete: T,
519
- textValues: i
520
- }), F = (r == null ? void 0 : r.length) === 0 && !d;
521
- return /* @__PURE__ */ p(A, { children: [
522
- /* @__PURE__ */ a(Ke, { children: /* @__PURE__ */ a(Je, { children: /* @__PURE__ */ a(g, { direction: "column", gap: "16px", padding: "6px", children: F ? /* @__PURE__ */ p(
510
+ handleDelete: m,
511
+ textValues: r
512
+ }), $ = (i == null ? void 0 : i.length) === 0 && !c;
513
+ return /* @__PURE__ */ h(k, { children: [
514
+ /* @__PURE__ */ o(ln, { children: /* @__PURE__ */ o(sn, { children: /* @__PURE__ */ o(g, { direction: "column", gap: "16px", padding: "6px", children: $ ? /* @__PURE__ */ h(
523
515
  g,
524
516
  {
525
517
  direction: "column",
526
518
  gap: "28px",
527
519
  width: "100%",
528
- height: v ? "auto" : "435px",
520
+ height: y ? "auto" : "435px",
529
521
  justifyContent: "center",
530
522
  alignItems: "center",
531
523
  children: [
532
- /* @__PURE__ */ a(C, { as: "span", type: "label", size: "large", appearance: "gray", children: o || /* @__PURE__ */ p(A, { children: [
524
+ /* @__PURE__ */ o(S, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ h(k, { children: [
533
525
  "Aún NO tienes definidas tasas de interés efectivas . Presiona",
534
- /* @__PURE__ */ p(
535
- C,
526
+ /* @__PURE__ */ h(
527
+ S,
536
528
  {
537
529
  as: "span",
538
530
  type: "label",
@@ -541,27 +533,27 @@ const tt = {
541
533
  weight: "bold",
542
534
  children: [
543
535
  "“",
544
- n || "+ Agregar decisión",
536
+ t || "+ Agregar decisión",
545
537
  "”"
546
538
  ]
547
539
  }
548
540
  ),
549
541
  "para empezar."
550
542
  ] }) }),
551
- /* @__PURE__ */ a(
552
- L,
543
+ /* @__PURE__ */ o(
544
+ U,
553
545
  {
554
- iconBefore: /* @__PURE__ */ a(ge, {}),
546
+ iconBefore: /* @__PURE__ */ o(Y, {}),
555
547
  onClick: () => u ? u() : null,
556
- children: n || "Agregar decisión"
548
+ children: t || "Agregar decisión"
557
549
  }
558
550
  )
559
551
  ]
560
552
  }
561
- ) : /* @__PURE__ */ p(
562
- J,
553
+ ) : /* @__PURE__ */ h(
554
+ K,
563
555
  {
564
- templateColumns: w ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
556
+ templateColumns: C ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
565
557
  autoFlow: "row dense",
566
558
  gap: "24px",
567
559
  alignItems: "start",
@@ -569,45 +561,77 @@ const tt = {
569
561
  autoRows: "1fr",
570
562
  justifyItems: "center",
571
563
  padding: "6px",
572
- height: v ? "auto" : "484px",
564
+ height: y ? "auto" : "484px",
573
565
  children: [
574
- S,
575
- k && Y({
566
+ w,
567
+ E && ne({
576
568
  type: "add",
577
- index: r == null ? void 0 : r.length,
578
- controls: t,
579
- customTitleContentAddCard: n,
580
- customMessageEmptyDecisions: o,
581
- loading: d,
569
+ index: i == null ? void 0 : i.length,
570
+ controls: n,
571
+ customTitleContentAddCard: t,
572
+ customMessageEmptyDecisions: a,
573
+ loading: c,
582
574
  handleOpenModal: u,
583
- handleDelete: T,
584
- textValues: i,
585
- shouldRenderEmptyMessage: F,
586
- terms: b
575
+ handleDelete: m,
576
+ textValues: r,
577
+ shouldRenderEmptyMessage: $,
578
+ terms: f
587
579
  })
588
580
  ]
589
581
  }
590
582
  ) }) }) }),
591
- l && /* @__PURE__ */ a(
592
- We,
583
+ l && /* @__PURE__ */ o(
584
+ ke,
593
585
  {
594
586
  portalId: "modal-portal",
595
- onCloseModal: s,
596
- title: c ? "Editar Decisión" : "Nueva decisión",
597
- children: /* @__PURE__ */ a(
598
- kt,
587
+ onCloseModal: d,
588
+ title: s ? "Editar Decisión" : "Nueva decisión",
589
+ children: /* @__PURE__ */ o(
590
+ Ie,
599
591
  {
600
- decision: c || h,
601
- onSubmitEvent: f,
602
- textValues: i,
603
- onCancel: () => s ? s() : () => {
592
+ decision: s || p,
593
+ onSubmitEvent: b,
594
+ textValues: r,
595
+ onCancel: () => d ? d() : () => {
604
596
  }
605
597
  }
606
598
  )
607
599
  }
608
600
  )
609
601
  ] });
610
- }, ot = x.div`
602
+ }, $e = (e) => {
603
+ const { children: n, controls: t = !0, handleDelete: a, id: i } = e;
604
+ return /* @__PURE__ */ h(Le, { width: "100%", children: [
605
+ n,
606
+ t && /* @__PURE__ */ o(k, { children: /* @__PURE__ */ o(g, { gap: "16px", justifyContent: "end", margin: "16px 0 0 0", children: /* @__PURE__ */ o(
607
+ U,
608
+ {
609
+ cursorHover: !0,
610
+ appearance: "danger",
611
+ spacing: "compact",
612
+ variant: "outlined",
613
+ iconBefore: /* @__PURE__ */ o(Te, {}),
614
+ onClick: () => {
615
+ a(i);
616
+ },
617
+ children: "Eliminar"
618
+ }
619
+ ) }) })
620
+ ] });
621
+ }, gn = (e) => e.value, mn = (e) => e.value, bn = (e) => e.value, fn = (e) => ({
622
+ from: e.from ?? "",
623
+ to: e.to ?? ""
624
+ }), Tn = (e) => e.value, xn = (e) => e.value, vn = (e) => e.value, yn = {
625
+ [D.LIST_OF_VALUES]: mn,
626
+ [D.LIST_OF_VALUES_MULTI]: bn,
627
+ [D.RANGE]: fn,
628
+ [D.GREATER_THAN]: Tn,
629
+ [D.LESS_THAN]: xn,
630
+ [D.EQUAL]: vn
631
+ }, P = (e) => {
632
+ const n = e == null ? void 0 : e.value, t = typeof n == "object" && n !== null && !Array.isArray(n), a = yn[e == null ? void 0 : e.howToSetTheDecision] || gn;
633
+ return t && a(n) || n || void 0;
634
+ }, wn = x.div`
611
635
  display: flex;
612
636
  justify-content: ${({ $justifyContent: e }) => e};
613
637
  align-items: ${({ $alignItems: e }) => e};
@@ -619,72 +643,603 @@ const tt = {
619
643
  gap: ${({ $gap: e }) => e};
620
644
  margin: ${({ $margin: e }) => e};
621
645
  padding: ${({ $padding: e }) => e};
622
- background: ${({ $background: e, theme: t }) => {
623
- var n, o, r, i;
624
- return e ? `${((o = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : o.N10) || y.palette.neutral.N10}` : `${((i = (r = t == null ? void 0 : t.palette) == null ? void 0 : r.neutral) == null ? void 0 : i.N0) || y.palette.neutral.N0}`;
646
+ background: ${({ $background: e, theme: n }) => {
647
+ var t, a, i, r;
648
+ return e ? `${((a = (t = n == null ? void 0 : n.palette) == null ? void 0 : t.neutral) == null ? void 0 : a.N10) || v.palette.neutral.N10}` : `${((r = (i = n == null ? void 0 : n.palette) == null ? void 0 : i.neutral) == null ? void 0 : r.N0) || v.palette.neutral.N0}`;
625
649
  }};
626
- border: ${({ $border: e, theme: t }) => {
627
- var n, o;
628
- return e ? `1px solid ${((o = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : o.N40) || y.palette.neutral.N40}` : "none";
650
+ border: ${({ $border: e, theme: n }) => {
651
+ var t, a;
652
+ return e ? `1px solid ${((a = (t = n == null ? void 0 : n.palette) == null ? void 0 : t.neutral) == null ? void 0 : a.N40) || v.palette.neutral.N40}` : "none";
629
653
  }};
630
654
  border-radius: ${({ $borderRadius: e }) => e};
631
655
  box-sizing: ${({ $boxSizing: e }) => e};
632
656
  overflow-y: ${({ $scroll: e }) => e ? "scroll" : "none"};
633
- `, te = Ae.forwardRef(
634
- (e, t) => {
657
+ `, j = _e.forwardRef(
658
+ (e, n) => {
635
659
  const {
636
- children: n,
637
- wrap: o,
638
- direction: r = "column",
639
- justifyContent: i,
640
- alignItems: h,
660
+ children: t,
661
+ wrap: a,
662
+ direction: i = "column",
663
+ justifyContent: r,
664
+ alignItems: p,
641
665
  alignContent: l,
642
- height: c,
643
- width: d,
666
+ height: s,
667
+ width: c,
644
668
  gap: u,
645
- background: s,
646
- borderRadius: f,
647
- border: T,
648
- margin: b = "0px",
649
- padding: v = "0px",
650
- boxSizing: w,
651
- scroll: S = !1
669
+ background: d,
670
+ borderRadius: b,
671
+ border: m,
672
+ margin: f = "0px",
673
+ padding: y = "0px",
674
+ boxSizing: C,
675
+ scroll: w = !1
652
676
  } = e;
653
- return /* @__PURE__ */ a(
654
- ot,
677
+ return /* @__PURE__ */ o(
678
+ wn,
655
679
  {
656
- ref: t,
657
- direction: r,
658
- $justifyContent: i,
659
- $alignItems: h,
680
+ ref: n,
681
+ direction: i,
682
+ $justifyContent: r,
683
+ $alignItems: p,
660
684
  $alignContent: l,
661
- height: c,
662
- width: d,
663
- wrap: o,
685
+ height: s,
686
+ width: c,
687
+ wrap: a,
664
688
  $gap: u,
665
- $background: s,
666
- $border: T,
667
- $margin: b,
668
- $padding: v,
669
- $borderRadius: f,
670
- $boxSizing: w,
671
- $scroll: S,
672
- children: n
689
+ $background: d,
690
+ $border: m,
691
+ $margin: f,
692
+ $padding: y,
693
+ $borderRadius: b,
694
+ $boxSizing: C,
695
+ $scroll: w,
696
+ children: t
673
697
  }
674
698
  );
675
699
  }
676
700
  );
677
- te.displayName = "BorderStack";
678
- const at = {
701
+ j.displayName = "BorderStack";
702
+ const Cn = (e) => {
703
+ const {
704
+ conditionsAlignment: n,
705
+ decision: t,
706
+ decisionMapper: a,
707
+ loading: i,
708
+ textValues: r,
709
+ visibleConditions: p,
710
+ tagLabel: l,
711
+ isOpen: s,
712
+ onToggle: c,
713
+ hasEffectiveFrom: u,
714
+ hasValidUntil: d,
715
+ effectiveFromRenderer: b,
716
+ validUntilRenderer: m
717
+ } = e;
718
+ return i ? /* @__PURE__ */ h(g, { direction: "column", gap: "16px", children: [
719
+ /* @__PURE__ */ h(
720
+ g,
721
+ {
722
+ alignItems: "start",
723
+ justifyContent: "space-between",
724
+ children: [
725
+ /* @__PURE__ */ o(
726
+ G,
727
+ {
728
+ element: a,
729
+ valueData: P(
730
+ a
731
+ ),
732
+ type: "decision"
733
+ }
734
+ ),
735
+ /* @__PURE__ */ h(g, { gap: "8px", children: [
736
+ /* @__PURE__ */ o(H, { appearance: "gray", label: l, displayIcon: !1 }),
737
+ /* @__PURE__ */ o(
738
+ L,
739
+ {
740
+ appearance: "dark",
741
+ icon: s ? /* @__PURE__ */ o(Re, {}) : /* @__PURE__ */ o(Oe, {}),
742
+ onClick: c,
743
+ size: "24px",
744
+ cursorHover: !0
745
+ }
746
+ )
747
+ ] })
748
+ ]
749
+ },
750
+ t.ruleName
751
+ ),
752
+ s && /* @__PURE__ */ h(k, { children: [
753
+ /* @__PURE__ */ o(R, { dashed: !0 }),
754
+ /* @__PURE__ */ h(g, { direction: "column", gap: "12px", children: [
755
+ /* @__PURE__ */ o(
756
+ S,
757
+ {
758
+ type: "label",
759
+ size: "large",
760
+ appearance: "dark",
761
+ weight: "bold",
762
+ textAlign: "start",
763
+ padding: "0 12px",
764
+ children: r.factsThatConditionIt
765
+ }
766
+ ),
767
+ /* @__PURE__ */ h(
768
+ g,
769
+ {
770
+ direction: "column",
771
+ gap: "8px",
772
+ justifyContent: n,
773
+ children: [
774
+ p.map((f) => /* @__PURE__ */ o(
775
+ j,
776
+ {
777
+ direction: "column",
778
+ padding: "6px 12px",
779
+ borderRadius: "8px",
780
+ background: !0,
781
+ children: /* @__PURE__ */ o(
782
+ G,
783
+ {
784
+ element: { ...f, value: f.value },
785
+ valueData: P(
786
+ f
787
+ )
788
+ }
789
+ )
790
+ },
791
+ f.conditionName
792
+ )),
793
+ u && b && /* @__PURE__ */ o(
794
+ j,
795
+ {
796
+ direction: "column",
797
+ padding: "6px 12px",
798
+ borderRadius: "8px",
799
+ background: !0,
800
+ children: /* @__PURE__ */ o(
801
+ G,
802
+ {
803
+ element: b.element,
804
+ valueData: b.valueData
805
+ },
806
+ "effectiveFrom"
807
+ )
808
+ }
809
+ ),
810
+ d && m && /* @__PURE__ */ o(
811
+ j,
812
+ {
813
+ direction: "column",
814
+ padding: "6px 12px",
815
+ borderRadius: "8px",
816
+ background: !0,
817
+ children: /* @__PURE__ */ o(
818
+ G,
819
+ {
820
+ element: m.element,
821
+ valueData: m.valueData
822
+ },
823
+ "validUntil"
824
+ )
825
+ }
826
+ )
827
+ ]
828
+ }
829
+ )
830
+ ] })
831
+ ] })
832
+ ] }) : /* @__PURE__ */ h(g, { justifyContent: "space-between", children: [
833
+ /* @__PURE__ */ h(g, { alignItems: "center", gap: "8px", children: [
834
+ /* @__PURE__ */ o(z, { animated: !0, width: "150px" }),
835
+ /* @__PURE__ */ o(z, { animated: !0, width: "70px" })
836
+ ] }),
837
+ /* @__PURE__ */ h(g, { alignItems: "center", gap: "8px", children: [
838
+ /* @__PURE__ */ o(z, { animated: !0, width: "50px" }),
839
+ /* @__PURE__ */ o(Ue, { animated: !0 })
840
+ ] })
841
+ ] });
842
+ }, Fe = (e) => {
843
+ var w;
844
+ const {
845
+ decision: n,
846
+ loading: t = !1,
847
+ textValues: a,
848
+ position: i,
849
+ isOpen: r = !1,
850
+ onToggle: p
851
+ } = e, l = !!(n != null && n.effectiveFrom), s = !!(n != null && n.validUntil), c = l ? {
852
+ element: {
853
+ labelName: a == null ? void 0 : a.effectiveFrom,
854
+ value: String(n.effectiveFrom),
855
+ howToSetTheDecision: V.EQUAL,
856
+ decisionDataType: I.DATE
857
+ },
858
+ valueData: P({
859
+ labelName: a == null ? void 0 : a.effectiveFrom,
860
+ value: String(n.effectiveFrom),
861
+ howToSetTheDecision: V.EQUAL,
862
+ decisionDataType: I.DATE
863
+ })
864
+ } : null, u = s ? {
865
+ element: {
866
+ labelName: a == null ? void 0 : a.validUntil,
867
+ value: String(n.validUntil),
868
+ howToSetTheDecision: V.EQUAL,
869
+ decisionDataType: I.DATE
870
+ },
871
+ valueData: P({
872
+ labelName: a == null ? void 0 : a.validUntil,
873
+ value: String(n.validUntil),
874
+ howToSetTheDecision: V.EQUAL,
875
+ decisionDataType: I.DATE
876
+ })
877
+ } : null, d = n ? {
878
+ labelName: n.labelName || "",
879
+ decisionDataType: n.decisionDataType || "alphabetical",
880
+ value: P(n),
881
+ howToSetTheDecision: n.howToSetTheDecision || "EqualTo"
882
+ } : null, b = ((w = n == null ? void 0 : n.conditionsThatEstablishesTheDecision) == null ? void 0 : w.filter(
883
+ (E) => !E.hidden
884
+ )) || [], m = Array.from({ length: 5 }), f = !!(!t && n && a && d), y = b.length < 2 ? "start" : "space-between", C = `N° ${String((i ?? 0) + 1).padStart(2, "0")}`;
885
+ return /* @__PURE__ */ o(
886
+ Cn,
887
+ {
888
+ conditionsAlignment: y,
889
+ decision: n,
890
+ decisionMapper: d,
891
+ loading: f,
892
+ skeleton: m,
893
+ textValues: a,
894
+ visibleConditions: b,
895
+ tagLabel: C,
896
+ isOpen: r,
897
+ onToggle: p,
898
+ hasEffectiveFrom: l,
899
+ hasValidUntil: s,
900
+ effectiveFromRenderer: c,
901
+ validUntilRenderer: u
902
+ }
903
+ );
904
+ }, Dn = De`
905
+ from {
906
+ opacity: 0;
907
+ transform: translateY(20px);
908
+ }
909
+ to {
910
+ opacity: 1;
911
+ transform: translateY(0);
912
+ }
913
+ `;
914
+ x.div`
915
+ border-radius: 8px;
916
+ border: 1px solid
917
+ ${({ theme: e }) => {
918
+ var n, t;
919
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
920
+ }};
921
+ box-sizing: border-box;
922
+ display: flex;
923
+ flex-direction: column;
924
+ width: 100%;
925
+ height: 100%;
926
+ box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
927
+ `;
928
+ x.div`
929
+ & > div {
930
+ border-radius: 8px;
931
+ border: 1px solid
932
+ ${({ theme: e }) => {
933
+ var n, t;
934
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
935
+ }};
936
+ }
937
+ `;
938
+ x.div`
939
+ & > div {
940
+ background-color: ${({ theme: e }) => {
941
+ var n, t;
942
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N10) || v.palette.neutral.N10;
943
+ }};
944
+ justify-content: center;
945
+ }
946
+ min-height: 350px;
947
+ width: 100%;
948
+ height: 100%;
949
+ padding-bottom: 12px;
950
+ cursor: pointer;
951
+ `;
952
+ x.div`
953
+ width: 100%;
954
+ height: 100%;
955
+ & > div {
956
+ animation: ${Dn} 600ms ease-out;
957
+ }
958
+ `;
959
+ const Sn = x.div`
960
+ & > div > div {
961
+ border-radius: 8px;
962
+ box-sizing: border-box;
963
+ }
964
+ `, Nn = x.div`
965
+ & > div {
966
+ width: 100%;
967
+ height: 100%;
968
+ overflow-y: auto;
969
+
970
+ &::-webkit-scrollbar {
971
+ width: 8px;
972
+ }
973
+
974
+ &::-webkit-scrollbar-thumb {
975
+ background-color: #c1c7d0;
976
+ border-radius: 8px;
977
+ }
978
+
979
+ &::-webkit-scrollbar-track {
980
+ background-color: #ebecf0;
981
+ border-radius: 8px;
982
+ }
983
+ }
984
+ `, En = (e) => {
985
+ const { index: n, handleOpenModal: t } = e;
986
+ return /* @__PURE__ */ o(
987
+ $e,
988
+ {
989
+ id: `loading-card-${n}`,
990
+ handleDelete: () => {
991
+ },
992
+ handleView: () => t ? t() : null,
993
+ controls: !1,
994
+ children: /* @__PURE__ */ o(Fe, { loading: !0 })
995
+ },
996
+ `loading-card-${n}`
997
+ );
998
+ }, kn = (e) => {
999
+ const {
1000
+ decision: n,
1001
+ controls: t,
1002
+ handleOpenModal: a,
1003
+ handleDelete: i,
1004
+ textValues: r,
1005
+ index: p,
1006
+ isOpen: l,
1007
+ onToggle: s
1008
+ } = e;
1009
+ return n ? /* @__PURE__ */ o(J, { children: /* @__PURE__ */ o(g, { direction: "column", gap: "4px", width: "100%", children: /* @__PURE__ */ o(
1010
+ $e,
1011
+ {
1012
+ id: n.decisionId,
1013
+ handleDelete: () => i ? i(n.decisionId) : null,
1014
+ handleView: () => a ? a(n) : null,
1015
+ controls: t,
1016
+ children: /* @__PURE__ */ o(
1017
+ Fe,
1018
+ {
1019
+ decision: n,
1020
+ textValues: r,
1021
+ position: p,
1022
+ isOpen: !!l,
1023
+ onToggle: () => s == null ? void 0 : s(!l)
1024
+ }
1025
+ )
1026
+ }
1027
+ ) }) }, n.decisionId) : null;
1028
+ }, An = (e) => {
1029
+ const {
1030
+ customTitleContentAddCard: n,
1031
+ index: t,
1032
+ handleOpenModal: a,
1033
+ shouldRenderEmptyMessage: i
1034
+ } = e;
1035
+ return /* @__PURE__ */ o(J, { children: i ? null : /* @__PURE__ */ o(
1036
+ Ae,
1037
+ {
1038
+ onClick: () => a ? a() : null,
1039
+ children: /* @__PURE__ */ o(
1040
+ j,
1041
+ {
1042
+ direction: "column",
1043
+ gap: "4px",
1044
+ width: "100%",
1045
+ height: "100%",
1046
+ background: !0,
1047
+ borderRadius: "8px",
1048
+ children: /* @__PURE__ */ h(
1049
+ g,
1050
+ {
1051
+ justifyContent: "space-between",
1052
+ alignItems: "center",
1053
+ padding: "16px",
1054
+ children: [
1055
+ /* @__PURE__ */ o(S, { appearance: "gray", type: "label", size: "large", weight: "bold", children: n || "Agregar decisión" }),
1056
+ /* @__PURE__ */ o(
1057
+ L,
1058
+ {
1059
+ appearance: "gray",
1060
+ icon: /* @__PURE__ */ o(Y, {}),
1061
+ size: "24px",
1062
+ cursorHover: !0
1063
+ }
1064
+ )
1065
+ ]
1066
+ }
1067
+ )
1068
+ }
1069
+ )
1070
+ }
1071
+ ) }, `add-decision-${t}`);
1072
+ }, $n = {
1073
+ loading: En,
1074
+ decision: kn,
1075
+ add: An
1076
+ }, te = (e) => {
1077
+ const { type: n } = e, t = $n[n];
1078
+ return t ? t(e) : null;
1079
+ }, Fn = (e) => {
1080
+ const {
1081
+ controls: n,
1082
+ customTitleContentAddCard: t,
1083
+ decisions: a,
1084
+ loading: i,
1085
+ handleOpenModal: r,
1086
+ handleDelete: p,
1087
+ textValues: l,
1088
+ isOpenFor: s,
1089
+ toggleAt: c
1090
+ } = e, u = i ? Array.from({ length: 3 }).map(
1091
+ (b, m) => te({
1092
+ type: "loading",
1093
+ index: m,
1094
+ controls: n,
1095
+ customTitleContentAddCard: t,
1096
+ loading: i,
1097
+ handleOpenModal: r,
1098
+ handleDelete: p,
1099
+ textValues: l
1100
+ })
1101
+ ) : a == null ? void 0 : a.map(
1102
+ (b, m) => te({
1103
+ type: "decision",
1104
+ decision: b,
1105
+ controls: s ? s(m) : !1,
1106
+ customTitleContentAddCard: t,
1107
+ loading: i,
1108
+ handleOpenModal: r,
1109
+ handleDelete: p,
1110
+ textValues: l,
1111
+ index: m,
1112
+ isOpen: s ? s(m) : !1,
1113
+ onToggle: c ? () => c(m) : void 0
1114
+ })
1115
+ ), d = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !i && n;
1116
+ return { renderedCards: u, shouldRenderAddCard: d };
1117
+ }, vt = (e) => {
1118
+ const {
1119
+ controls: n = !0,
1120
+ customTitleContentAddCard: t,
1121
+ customMessageEmptyDecisions: a,
1122
+ decisions: i,
1123
+ textValues: r,
1124
+ decisionTemplate: p,
1125
+ isModalOpen: l,
1126
+ selectedDecision: s,
1127
+ loading: c,
1128
+ handleOpenModal: u,
1129
+ handleCloseModal: d,
1130
+ handleSubmitForm: b,
1131
+ handleDelete: m,
1132
+ terms: f = !0
1133
+ } = e, [y, C] = O(null), w = B("(max-width: 681px)"), { renderedCards: E, shouldRenderAddCard: $ } = Fn({
1134
+ controls: n,
1135
+ customTitleContentAddCard: t,
1136
+ decisions: i,
1137
+ loading: c,
1138
+ handleOpenModal: u,
1139
+ handleDelete: m,
1140
+ textValues: r,
1141
+ isOpenFor: (N) => y === N,
1142
+ toggleAt: (N) => C((M) => M === N ? null : N)
1143
+ }), A = (i == null ? void 0 : i.length) === 0 && !c;
1144
+ return /* @__PURE__ */ h(k, { children: [
1145
+ /* @__PURE__ */ o(Sn, { children: /* @__PURE__ */ o(Nn, { children: /* @__PURE__ */ o(g, { direction: "column", gap: "16px", padding: "6px", children: A ? /* @__PURE__ */ h(
1146
+ g,
1147
+ {
1148
+ direction: "column",
1149
+ gap: "28px",
1150
+ width: "100%",
1151
+ height: w ? "auto" : "435px",
1152
+ justifyContent: "center",
1153
+ alignItems: "center",
1154
+ children: [
1155
+ /* @__PURE__ */ o(S, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ h(k, { children: [
1156
+ "Aún NO tienes definidas tasas de interés efectivas . Presiona",
1157
+ /* @__PURE__ */ h(
1158
+ S,
1159
+ {
1160
+ as: "span",
1161
+ type: "label",
1162
+ size: "large",
1163
+ appearance: "gray",
1164
+ weight: "bold",
1165
+ children: [
1166
+ "“",
1167
+ t || "+ Agregar decisión",
1168
+ "”"
1169
+ ]
1170
+ }
1171
+ ),
1172
+ "para empezar."
1173
+ ] }) }),
1174
+ /* @__PURE__ */ o(
1175
+ U,
1176
+ {
1177
+ iconBefore: /* @__PURE__ */ o(Y, {}),
1178
+ onClick: () => u ? u() : null,
1179
+ children: t || "Agregar decisión"
1180
+ }
1181
+ )
1182
+ ]
1183
+ }
1184
+ ) : /* @__PURE__ */ h(
1185
+ K,
1186
+ {
1187
+ templateColumns: "1fr",
1188
+ autoFlow: "row dense",
1189
+ gap: "16px",
1190
+ alignItems: "start",
1191
+ justifyContent: "center",
1192
+ autoRows: "auto",
1193
+ justifyItems: "center",
1194
+ padding: "6px",
1195
+ height: w ? "auto" : "484px",
1196
+ children: [
1197
+ E,
1198
+ $ && te({
1199
+ type: "add",
1200
+ index: i == null ? void 0 : i.length,
1201
+ controls: n,
1202
+ customTitleContentAddCard: t,
1203
+ customMessageEmptyDecisions: a,
1204
+ loading: c,
1205
+ handleOpenModal: u,
1206
+ handleDelete: m,
1207
+ textValues: r,
1208
+ shouldRenderEmptyMessage: A,
1209
+ terms: f
1210
+ })
1211
+ ]
1212
+ }
1213
+ ) }) }) }),
1214
+ l && /* @__PURE__ */ o(
1215
+ ke,
1216
+ {
1217
+ portalId: "modal-portal",
1218
+ onCloseModal: d,
1219
+ title: s ? "Editar Decisión" : "Nueva decisión",
1220
+ children: /* @__PURE__ */ o(
1221
+ Ie,
1222
+ {
1223
+ decision: s || p,
1224
+ onSubmitEvent: b,
1225
+ textValues: r,
1226
+ onCancel: () => d ? d() : () => {
1227
+ }
1228
+ }
1229
+ )
1230
+ }
1231
+ )
1232
+ ] });
1233
+ }, In = {
679
1234
  border: {
680
- color: y.palette.neutral.N40
1235
+ color: v.palette.neutral.N40
681
1236
  }
682
- }, rt = x.div`
1237
+ }, Rn = x.div`
683
1238
  border-width: 1px;
684
1239
  border-style: solid;
685
1240
  border-color: ${({ theme: e }) => {
686
- var t, n;
687
- return ((n = (t = e == null ? void 0 : e.box) == null ? void 0 : t.border) == null ? void 0 : n.color) || at.border.color;
1241
+ var n, t;
1242
+ return ((t = (n = e == null ? void 0 : e.box) == null ? void 0 : n.border) == null ? void 0 : t.color) || In.border.color;
688
1243
  }};
689
1244
  border-radius: ${({ $borderRadius: e }) => e};
690
1245
  margin: ${({ $margin: e }) => e};
@@ -693,92 +1248,92 @@ const at = {
693
1248
  height: ${({ $height: e }) => e};
694
1249
  box-sizing: border-box;
695
1250
  `;
696
- function it(e) {
1251
+ function On(e) {
697
1252
  const {
698
- children: t,
699
- padding: n = "16px",
700
- margin: o,
701
- borderRadius: r = "8px",
702
- width: i,
703
- height: h
1253
+ children: n,
1254
+ padding: t = "16px",
1255
+ margin: a,
1256
+ borderRadius: i = "8px",
1257
+ width: r,
1258
+ height: p
704
1259
  } = e;
705
- return /* @__PURE__ */ a(
706
- rt,
1260
+ return /* @__PURE__ */ o(
1261
+ Rn,
707
1262
  {
708
- $padding: n,
709
- $margin: o,
710
- $borderRadius: r,
711
- $width: i,
712
- $height: h,
713
- children: t
1263
+ $padding: t,
1264
+ $margin: a,
1265
+ $borderRadius: i,
1266
+ $width: r,
1267
+ $height: p,
1268
+ children: n
714
1269
  }
715
1270
  );
716
1271
  }
717
- const lt = (e, t) => {
718
- const [n, o] = R([]), [r, i] = R([]), [h, l] = R(!1), c = H(null);
719
- return X(() => {
720
- if (!e.current || !c.current) return;
721
- const d = e.current, u = c.current, s = () => {
722
- var F;
723
- const T = d.clientWidth, b = Array.from(
1272
+ const Mn = (e, n) => {
1273
+ const [t, a] = O([]), [i, r] = O([]), [p, l] = O(!1), s = Q(null);
1274
+ return oe(() => {
1275
+ if (!e.current || !s.current) return;
1276
+ const c = e.current, u = s.current, d = () => {
1277
+ var $;
1278
+ const m = c.clientWidth, f = Array.from(
724
1279
  u.querySelectorAll('[data-filter-tag="true"]')
725
- ), v = 48;
726
- let w = 0;
727
- const S = [], k = [];
728
- for (let $ = 0; $ < t.length; $++) {
729
- const m = ((F = b[$]) == null ? void 0 : F.offsetWidth) ?? 0;
730
- w + m + v <= T ? (S.push(t[$]), w += m) : k.push(t[$]);
1280
+ ), y = 48;
1281
+ let C = 0;
1282
+ const w = [], E = [];
1283
+ for (let A = 0; A < n.length; A++) {
1284
+ const T = (($ = f[A]) == null ? void 0 : $.offsetWidth) ?? 0;
1285
+ C + T + y <= m ? (w.push(n[A]), C += T) : E.push(n[A]);
731
1286
  }
732
- o(S), i(k), l(k.length > 0);
733
- }, f = new ResizeObserver(() => {
734
- requestAnimationFrame(s);
1287
+ a(w), r(E), l(E.length > 0);
1288
+ }, b = new ResizeObserver(() => {
1289
+ requestAnimationFrame(d);
735
1290
  });
736
- return f.observe(d), () => f.disconnect();
737
- }, [t, e]), { visible: n, hidden: r, showOverflowIndicator: h, measurementRef: c };
1291
+ return b.observe(c), () => b.disconnect();
1292
+ }, [n, e]), { visible: t, hidden: i, showOverflowIndicator: p, measurementRef: s };
738
1293
  };
739
1294
  x.div`
740
1295
  & > div {
741
1296
  width: 100%;
742
1297
  }
743
1298
  `;
744
- const st = x.div`
1299
+ const Ln = x.div`
745
1300
  position: absolute;
746
1301
  top: calc(100% + 4px);
747
1302
  right: 0;
748
1303
  z-index: 1000;
749
1304
  width: 170px;
750
- `, dt = x.div`
1305
+ `, Un = x.div`
751
1306
  position: absolute;
752
1307
  visibility: hidden;
753
1308
  pointer-events: none;
754
1309
  height: 0;
755
1310
  overflow: hidden;
756
- `, ct = x.div`
1311
+ `, zn = x.div`
757
1312
  cursor: pointer;
758
- `, K = {
1313
+ `, ae = {
759
1314
  border: {
760
1315
  color: {
761
- regular: y.palette.neutral.N40,
762
- disabled: y.palette.neutral.N40,
763
- focus: y.palette.blue.B300,
764
- invalid: y.palette.red.R400
1316
+ regular: v.palette.neutral.N40,
1317
+ disabled: v.palette.neutral.N40,
1318
+ focus: v.palette.blue.B300,
1319
+ invalid: v.palette.red.R400
765
1320
  }
766
1321
  },
767
1322
  background: {
768
1323
  color: {
769
- regular: y.palette.neutral.N0,
770
- disabled: y.palette.neutral.N10
1324
+ regular: v.palette.neutral.N0,
1325
+ disabled: v.palette.neutral.N10
771
1326
  }
772
1327
  },
773
1328
  content: {
774
1329
  color: {
775
- regular: y.palette.neutral.N900,
776
- disabled: y.palette.neutral.N70
1330
+ regular: v.palette.neutral.N900,
1331
+ disabled: v.palette.neutral.N70
777
1332
  }
778
1333
  },
779
1334
  placeholder: {
780
1335
  color: {
781
- regular: y.palette.neutral.N300
1336
+ regular: v.palette.neutral.N300
782
1337
  }
783
1338
  },
784
1339
  option: {
@@ -787,11 +1342,11 @@ const st = x.div`
787
1342
  hover: "primary"
788
1343
  },
789
1344
  background: {
790
- regular: y.palette.neutral.N0,
791
- hover: y.palette.neutral.N30
1345
+ regular: v.palette.neutral.N0,
1346
+ hover: v.palette.neutral.N30
792
1347
  }
793
1348
  }
794
- }, ut = x.li`
1349
+ }, Vn = x.li`
795
1350
  display: flex;
796
1351
  align-items: center;
797
1352
  align-self: stretch;
@@ -805,56 +1360,56 @@ const st = x.div`
805
1360
 
806
1361
  &:hover {
807
1362
  background-color: ${({ theme: e }) => {
808
- var t, n, o;
809
- 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) || K.background.color.regular;
1363
+ var n, t, a;
1364
+ return ((a = (t = (n = e == null ? void 0 : e.input) == null ? void 0 : n.background) == null ? void 0 : t.color) == null ? void 0 : a.regular) || ae.background.color.regular;
810
1365
  }};
811
1366
  }
812
- `, ht = (e) => {
813
- var f, T, b, v, w, S;
814
- const { id: t, label: n, leadingIcon: o, onClose: r } = e, [i, h] = R(!1), l = () => h(!0), c = () => h(!1), d = Fe($e), u = ((b = (T = (f = d == null ? void 0 : d.input) == null ? void 0 : f.option) == null ? void 0 : T.appearance) == null ? void 0 : b.hover) ?? K.option.appearance.hover, s = ((S = (w = (v = d == null ? void 0 : d.input) == null ? void 0 : v.option) == null ? void 0 : w.appearance) == null ? void 0 : S.regular) ?? K.option.appearance.regular;
815
- return /* @__PURE__ */ a(
816
- ut,
1367
+ `, jn = (e) => {
1368
+ var b, m, f, y, C, w;
1369
+ const { id: n, label: t, leadingIcon: a, onClose: i } = e, [r, p] = O(!1), l = () => p(!0), s = () => p(!1), c = He(Be), u = ((f = (m = (b = c == null ? void 0 : c.input) == null ? void 0 : b.option) == null ? void 0 : m.appearance) == null ? void 0 : f.hover) ?? ae.option.appearance.hover, d = ((w = (C = (y = c == null ? void 0 : c.input) == null ? void 0 : y.option) == null ? void 0 : C.appearance) == null ? void 0 : w.regular) ?? ae.option.appearance.regular;
1370
+ return /* @__PURE__ */ o(
1371
+ Vn,
817
1372
  {
818
- id: t,
1373
+ id: n,
819
1374
  onMouseEnter: l,
820
- onMouseLeave: c,
821
- onClick: (k) => {
822
- k.stopPropagation();
1375
+ onMouseLeave: s,
1376
+ onClick: (E) => {
1377
+ E.stopPropagation();
823
1378
  },
824
- children: /* @__PURE__ */ p(
825
- J,
1379
+ children: /* @__PURE__ */ h(
1380
+ K,
826
1381
  {
827
1382
  alignItems: "center",
828
1383
  gap: "8px",
829
1384
  templateColumns: "auto 1fr auto",
830
1385
  width: "100%",
831
1386
  children: [
832
- o && /* @__PURE__ */ a(
833
- M,
1387
+ a && /* @__PURE__ */ o(
1388
+ L,
834
1389
  {
835
- icon: o,
1390
+ icon: a,
836
1391
  size: "medium",
837
- appearance: i ? u : s
1392
+ appearance: r ? u : d
838
1393
  }
839
1394
  ),
840
- /* @__PURE__ */ a(
841
- C,
1395
+ /* @__PURE__ */ o(
1396
+ S,
842
1397
  {
843
1398
  textAlign: "start",
844
1399
  size: "medium",
845
- appearance: i ? u : s,
846
- children: n
1400
+ appearance: r ? u : d,
1401
+ children: t
847
1402
  }
848
1403
  ),
849
- /* @__PURE__ */ a(
850
- M,
1404
+ /* @__PURE__ */ o(
1405
+ L,
851
1406
  {
852
- icon: /* @__PURE__ */ a(Se, {}),
1407
+ icon: /* @__PURE__ */ o(Me, {}),
853
1408
  size: "small",
854
- onClick: (k) => {
855
- k.stopPropagation(), r == null || r();
1409
+ onClick: (E) => {
1410
+ E.stopPropagation(), i == null || i();
856
1411
  },
857
- appearance: i ? u : s,
1412
+ appearance: r ? u : d,
858
1413
  cursorHover: !0
859
1414
  }
860
1415
  )
@@ -863,54 +1418,54 @@ const st = x.div`
863
1418
  )
864
1419
  }
865
1420
  );
866
- }, Wt = (e) => {
1421
+ }, yt = (e) => {
867
1422
  const {
868
- appliedFilters: t = [],
869
- onClear: n,
870
- onClick: o,
871
- noFiltersLabel: r,
872
- titleClearFilter: i,
873
- titleFilter: h
874
- } = e, l = H(null), c = H(null), d = H(null), {
1423
+ appliedFilters: n = [],
1424
+ onClear: t,
1425
+ onClick: a,
1426
+ noFiltersLabel: i,
1427
+ titleClearFilter: r,
1428
+ titleFilter: p
1429
+ } = e, l = Q(null), s = Q(null), c = Q(null), {
875
1430
  visible: u,
876
- hidden: s,
877
- showOverflowIndicator: f,
878
- measurementRef: T
879
- } = lt(l, t), [b, v] = R(!1), w = (m) => {
880
- m.stopPropagation(), v((N) => !N);
1431
+ hidden: d,
1432
+ showOverflowIndicator: b,
1433
+ measurementRef: m
1434
+ } = Mn(l, n), [f, y] = O(!1), C = (T) => {
1435
+ T.stopPropagation(), y((N) => !N);
881
1436
  };
882
- X(() => {
883
- const m = (N) => {
884
- var ne, oe;
885
- const O = N.target;
886
- !((ne = c.current) != null && ne.contains(O)) && !((oe = d.current) != null && oe.contains(O)) && v(!1);
1437
+ oe(() => {
1438
+ const T = (N) => {
1439
+ var le, se;
1440
+ const M = N.target;
1441
+ !((le = s.current) != null && le.contains(M)) && !((se = c.current) != null && se.contains(M)) && y(!1);
887
1442
  };
888
- return b && window.addEventListener("mousedown", m), () => window.removeEventListener("mousedown", m);
889
- }, [b]);
890
- const S = t.length === 0, k = b && s.length > 0, F = s.map((m) => ({
891
- id: m.label,
892
- value: m.label,
893
- label: m.label,
894
- icon: m.icon
895
- })), $ = (m) => {
896
- var N, O;
897
- (O = (N = s.find((E) => E.label === m)) == null ? void 0 : N.onClose) == null || O.call(N), v(!1);
1443
+ return f && window.addEventListener("mousedown", T), () => window.removeEventListener("mousedown", T);
1444
+ }, [f]);
1445
+ const w = n.length === 0, E = f && d.length > 0, $ = d.map((T) => ({
1446
+ id: T.label,
1447
+ value: T.label,
1448
+ label: T.label,
1449
+ icon: T.icon
1450
+ })), A = (T) => {
1451
+ var N, M;
1452
+ (M = (N = d.find((F) => F.label === T)) == null ? void 0 : N.onClose) == null || M.call(N), y(!1);
898
1453
  };
899
- return /* @__PURE__ */ p(it, { borderRadius: "8px", width: "100%", children: [
900
- /* @__PURE__ */ a(dt, { ref: T, children: t.map((m) => /* @__PURE__ */ a("div", { "data-filter-tag": "true", children: /* @__PURE__ */ a(
901
- q,
1454
+ return /* @__PURE__ */ h(On, { borderRadius: "8px", width: "100%", children: [
1455
+ /* @__PURE__ */ o(Un, { ref: m, children: n.map((T) => /* @__PURE__ */ o("div", { "data-filter-tag": "true", children: /* @__PURE__ */ o(
1456
+ H,
902
1457
  {
903
1458
  appearance: "primary",
904
1459
  displayIcon: !0,
905
1460
  removable: !0,
906
- icon: m.icon,
907
- label: m.label,
908
- onClose: m.onClose
1461
+ icon: T.icon,
1462
+ label: T.label,
1463
+ onClose: T.onClose
909
1464
  }
910
- ) }, m.label)) }),
911
- /* @__PURE__ */ p(J, { gap: "12px", templateColumns: "1fr auto auto", width: "100%", children: [
912
- /* @__PURE__ */ a(
913
- te,
1465
+ ) }, T.label)) }),
1466
+ /* @__PURE__ */ h(K, { gap: "12px", templateColumns: "1fr auto auto", width: "100%", children: [
1467
+ /* @__PURE__ */ o(
1468
+ j,
914
1469
  {
915
1470
  ref: l,
916
1471
  background: !0,
@@ -921,50 +1476,50 @@ const st = x.div`
921
1476
  alignItems: "center",
922
1477
  padding: "0px 8px",
923
1478
  border: !0,
924
- children: S ? /* @__PURE__ */ a(C, { size: "small", type: "label", appearance: "gray", children: r }) : /* @__PURE__ */ p(A, { children: [
925
- u.map((m) => /* @__PURE__ */ a(
926
- q,
1479
+ children: w ? /* @__PURE__ */ o(S, { size: "small", type: "label", appearance: "gray", children: i }) : /* @__PURE__ */ h(k, { children: [
1480
+ u.map((T) => /* @__PURE__ */ o(
1481
+ H,
927
1482
  {
928
1483
  "data-filter-tag": "true",
929
1484
  appearance: "primary",
930
1485
  displayIcon: !0,
931
1486
  removable: !0,
932
- icon: m.icon,
933
- label: m.label,
934
- onClose: m.onClose
1487
+ icon: T.icon,
1488
+ label: T.label,
1489
+ onClose: T.onClose
935
1490
  },
936
- m.label
1491
+ T.label
937
1492
  )),
938
- f && /* @__PURE__ */ p(
1493
+ b && /* @__PURE__ */ h(
939
1494
  "div",
940
1495
  {
941
- ref: d,
1496
+ ref: c,
942
1497
  style: { position: "relative", display: "inline-block" },
943
1498
  children: [
944
- /* @__PURE__ */ a(ct, { onClick: w, children: /* @__PURE__ */ a(
945
- q,
1499
+ /* @__PURE__ */ o(zn, { onClick: C, children: /* @__PURE__ */ o(
1500
+ H,
946
1501
  {
947
1502
  appearance: "primary",
948
- label: `+${s.length}`
1503
+ label: `+${d.length}`
949
1504
  }
950
1505
  ) }),
951
- k && /* @__PURE__ */ a(st, { ref: c, children: /* @__PURE__ */ a(
952
- De,
1506
+ E && /* @__PURE__ */ o(Ln, { ref: s, children: /* @__PURE__ */ o(
1507
+ ze,
953
1508
  {
954
- options: F,
955
- onOptionClick: $,
956
- children: s.map((m) => /* @__PURE__ */ a(
957
- ht,
1509
+ options: $,
1510
+ onOptionClick: A,
1511
+ children: d.map((T) => /* @__PURE__ */ o(
1512
+ jn,
958
1513
  {
959
- id: m.label,
960
- label: m.label,
961
- leadingIcon: m.icon,
1514
+ id: T.label,
1515
+ label: T.label,
1516
+ leadingIcon: T.icon,
962
1517
  onClose: () => {
963
1518
  var N;
964
- (N = m.onClose) == null || N.call(m), v(!1);
1519
+ (N = T.onClose) == null || N.call(T), y(!1);
965
1520
  }
966
1521
  },
967
- m.label
1522
+ T.label
968
1523
  ))
969
1524
  }
970
1525
  ) })
@@ -974,35 +1529,35 @@ const st = x.div`
974
1529
  ] })
975
1530
  }
976
1531
  ),
977
- /* @__PURE__ */ a(
978
- L,
1532
+ /* @__PURE__ */ o(
1533
+ U,
979
1534
  {
980
1535
  cursorHover: !0,
981
- disabled: S,
982
- iconBefore: /* @__PURE__ */ a(me, {}),
983
- onClick: n,
1536
+ disabled: w,
1537
+ iconBefore: /* @__PURE__ */ o(ve, {}),
1538
+ onClick: t,
984
1539
  variant: "outlined",
985
- children: i
1540
+ children: r
986
1541
  }
987
1542
  ),
988
- /* @__PURE__ */ a(
989
- L,
1543
+ /* @__PURE__ */ o(
1544
+ U,
990
1545
  {
991
1546
  cursorHover: !0,
992
- iconBefore: /* @__PURE__ */ a(be, {}),
993
- onClick: o,
1547
+ iconBefore: /* @__PURE__ */ o(ye, {}),
1548
+ onClick: a,
994
1549
  variant: "outlined",
995
- children: h
1550
+ children: p
996
1551
  }
997
1552
  )
998
1553
  ] })
999
1554
  ] });
1000
- }, pt = x.div`
1555
+ }, Bn = x.div`
1001
1556
  display: flex;
1002
1557
  flex-direction: column;
1003
1558
  background-color: ${({ theme: e }) => {
1004
- var t, n;
1005
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || y.palette.neutral.N0;
1559
+ var n, t;
1560
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N0) || v.palette.neutral.N0;
1006
1561
  }};
1007
1562
  width: ${({ $smallScreen: e }) => e ? "auto" : "450px"};
1008
1563
  height: auto;
@@ -1010,77 +1565,77 @@ const st = x.div`
1010
1565
  padding: 24px;
1011
1566
  gap: 24px;
1012
1567
  box-sizing: border-box;
1013
- `, Qt = (e) => {
1568
+ `, wt = (e) => {
1014
1569
  const {
1015
- actionButtonLabel: t,
1016
- cancelButtonLabel: n,
1017
- children: o,
1018
- loading: r,
1019
- onClick: i,
1020
- onCloseModal: h,
1570
+ actionButtonLabel: n,
1571
+ cancelButtonLabel: t,
1572
+ children: a,
1573
+ loading: i,
1574
+ onClick: r,
1575
+ onCloseModal: p,
1021
1576
  portalId: l,
1022
- title: c
1023
- } = e, d = V("(max-width: 768px)"), u = document.getElementById(l);
1577
+ title: s
1578
+ } = e, c = B("(max-width: 768px)"), u = document.getElementById(l);
1024
1579
  if (!u)
1025
1580
  throw new Error(
1026
1581
  "The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
1027
1582
  );
1028
- return ye(
1029
- /* @__PURE__ */ a(fe, { children: /* @__PURE__ */ p(pt, { $smallScreen: d, children: [
1030
- /* @__PURE__ */ p(g, { direction: "column", gap: "16px", children: [
1031
- /* @__PURE__ */ p(g, { alignContent: "center", justifyContent: "space-between", children: [
1032
- /* @__PURE__ */ a(C, { appearance: "dark", size: "small", type: "headline", children: c }),
1033
- /* @__PURE__ */ p(g, { alignItems: "center", children: [
1034
- /* @__PURE__ */ a(C, { children: "Cerrar" }),
1035
- /* @__PURE__ */ a(
1036
- M,
1583
+ return Se(
1584
+ /* @__PURE__ */ o(we, { children: /* @__PURE__ */ h(Bn, { $smallScreen: c, children: [
1585
+ /* @__PURE__ */ h(g, { direction: "column", gap: "16px", children: [
1586
+ /* @__PURE__ */ h(g, { alignContent: "center", justifyContent: "space-between", children: [
1587
+ /* @__PURE__ */ o(S, { appearance: "dark", size: "small", type: "headline", children: s }),
1588
+ /* @__PURE__ */ h(g, { alignItems: "center", children: [
1589
+ /* @__PURE__ */ o(S, { children: "Cerrar" }),
1590
+ /* @__PURE__ */ o(
1591
+ L,
1037
1592
  {
1038
1593
  appearance: "dark",
1039
- icon: /* @__PURE__ */ a(pe, {}),
1040
- onClick: h,
1594
+ icon: /* @__PURE__ */ o(xe, {}),
1595
+ onClick: p,
1041
1596
  cursorHover: !0
1042
1597
  }
1043
1598
  )
1044
1599
  ] })
1045
1600
  ] }),
1046
- /* @__PURE__ */ a(I, {})
1601
+ /* @__PURE__ */ o(R, {})
1047
1602
  ] }),
1048
- o,
1049
- /* @__PURE__ */ p(g, { gap: "20px", justifyContent: "flex-end", children: [
1050
- /* @__PURE__ */ a(
1051
- L,
1603
+ a,
1604
+ /* @__PURE__ */ h(g, { gap: "20px", justifyContent: "flex-end", children: [
1605
+ /* @__PURE__ */ o(
1606
+ U,
1052
1607
  {
1053
1608
  appearance: "gray",
1054
- onClick: h,
1055
- iconBefore: /* @__PURE__ */ a(me, {}),
1609
+ onClick: p,
1610
+ iconBefore: /* @__PURE__ */ o(ve, {}),
1056
1611
  spacing: "wide",
1057
1612
  variant: "outlined",
1058
- children: n
1613
+ children: t
1059
1614
  }
1060
1615
  ),
1061
- /* @__PURE__ */ a(
1062
- L,
1616
+ /* @__PURE__ */ o(
1617
+ U,
1063
1618
  {
1064
1619
  appearance: "primary",
1065
- loading: r,
1066
- onClick: i,
1620
+ loading: i,
1621
+ onClick: r,
1067
1622
  spacing: "wide",
1068
1623
  variant: "filled",
1069
- children: t
1624
+ children: n
1070
1625
  }
1071
1626
  )
1072
1627
  ] })
1073
1628
  ] }) }),
1074
1629
  u
1075
1630
  );
1076
- }, Yt = (e) => {
1077
- const { appliedFilters: t, fields: n, onChange: o, noFiltersLabel: r } = e, i = V("(max-width: 768px)"), h = !t || t.length === 0;
1078
- return /* @__PURE__ */ p(g, { direction: "column", gap: "16px", children: [
1079
- i && /* @__PURE__ */ p(A, { children: [
1080
- /* @__PURE__ */ p(g, { gap: "6px", width: "100%", alignItems: "center", children: [
1081
- /* @__PURE__ */ a(M, { appearance: "gray", icon: /* @__PURE__ */ a(be, {}) }),
1082
- /* @__PURE__ */ a(
1083
- te,
1631
+ }, Ct = (e) => {
1632
+ const { appliedFilters: n, fields: t, onChange: a, noFiltersLabel: i } = e, r = B("(max-width: 768px)"), p = !n || n.length === 0;
1633
+ return /* @__PURE__ */ h(g, { direction: "column", gap: "16px", children: [
1634
+ r && /* @__PURE__ */ h(k, { children: [
1635
+ /* @__PURE__ */ h(g, { gap: "6px", width: "100%", alignItems: "center", children: [
1636
+ /* @__PURE__ */ o(L, { appearance: "gray", icon: /* @__PURE__ */ o(ye, {}) }),
1637
+ /* @__PURE__ */ o(
1638
+ j,
1084
1639
  {
1085
1640
  background: !0,
1086
1641
  borderRadius: "8px",
@@ -1091,8 +1646,8 @@ const st = x.div`
1091
1646
  border: !0,
1092
1647
  width: "100%",
1093
1648
  height: "36px",
1094
- children: h ? /* @__PURE__ */ a(C, { size: "small", type: "label", appearance: "gray", children: r }) : t == null ? void 0 : t.map((l) => /* @__PURE__ */ a(
1095
- q,
1649
+ children: p ? /* @__PURE__ */ o(S, { size: "small", type: "label", appearance: "gray", children: i }) : n == null ? void 0 : n.map((l) => /* @__PURE__ */ o(
1650
+ H,
1096
1651
  {
1097
1652
  appearance: "primary",
1098
1653
  displayIcon: !0,
@@ -1106,19 +1661,19 @@ const st = x.div`
1106
1661
  }
1107
1662
  )
1108
1663
  ] }),
1109
- /* @__PURE__ */ a(I, { dashed: !0 })
1664
+ /* @__PURE__ */ o(R, { dashed: !0 })
1110
1665
  ] }),
1111
- n.map((l) => /* @__PURE__ */ p(g, { gap: "6px", alignItems: "center", children: [
1112
- /* @__PURE__ */ a(g, { padding: "22px 0 0 0", children: /* @__PURE__ */ a(M, { appearance: "primary", icon: l.icon }) }),
1113
- /* @__PURE__ */ a(
1114
- ke,
1666
+ t.map((l) => /* @__PURE__ */ h(g, { gap: "6px", alignItems: "center", children: [
1667
+ /* @__PURE__ */ o(g, { padding: "22px 0 0 0", children: /* @__PURE__ */ o(L, { appearance: "primary", icon: l.icon }) }),
1668
+ /* @__PURE__ */ o(
1669
+ Ve,
1115
1670
  {
1116
1671
  disabled: l.disabled,
1117
1672
  invalid: l.invalid,
1118
1673
  label: l.label,
1119
1674
  message: l.message,
1120
1675
  name: l.name,
1121
- onChange: o,
1676
+ onChange: a,
1122
1677
  options: l.options,
1123
1678
  placeholder: l.placeholder,
1124
1679
  required: l.required,
@@ -1129,137 +1684,137 @@ const st = x.div`
1129
1684
  )
1130
1685
  ] }, l.name))
1131
1686
  ] });
1132
- }, gt = (e) => {
1133
- const t = [];
1134
- 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(";");
1135
- }, Kt = (e) => {
1136
- var h;
1137
- const { decision: t, fallbackId: n, template: o } = e, r = (l) => typeof l == "object" && l !== null && "from" in l && "to" in l ? gt(l) : l, i = ((h = t.conditionsThatEstablishesTheDecision) == null ? void 0 : h.map((l, c) => {
1138
- var s;
1139
- const d = l == null ? void 0 : l.value;
1140
- return d == null || typeof d == "string" && d.trim() === "" || Array.isArray(d) && d.length === 0 ? null : {
1141
- ...(s = o.conditionsThatEstablishesTheDecision) == null ? void 0 : s[c],
1687
+ }, _n = (e) => {
1688
+ const n = [];
1689
+ return e.from !== void 0 && e.from !== null && n.push(`>${e.from}`), e.to !== void 0 && e.to !== null && n.push(`<${e.to}`), n.join(";");
1690
+ }, Dt = (e) => {
1691
+ var p;
1692
+ const { decision: n, fallbackId: t, template: a } = e, i = (l) => typeof l == "object" && l !== null && "from" in l && "to" in l ? _n(l) : l, r = ((p = n.conditionsThatEstablishesTheDecision) == null ? void 0 : p.map((l, s) => {
1693
+ var d;
1694
+ const c = l == null ? void 0 : l.value;
1695
+ return c == null || typeof c == "string" && c.trim() === "" || Array.isArray(c) && c.length === 0 ? null : {
1696
+ ...(d = a.conditionsThatEstablishesTheDecision) == null ? void 0 : d[s],
1142
1697
  ...l,
1143
- value: r(d)
1698
+ value: i(c)
1144
1699
  };
1145
1700
  }).filter(Boolean)) ?? [];
1146
1701
  return {
1147
- ...o,
1148
- ...t,
1149
- decisionId: n,
1150
- value: r(t.value),
1151
- conditionsThatEstablishesTheDecision: i
1702
+ ...a,
1703
+ ...n,
1704
+ decisionId: t,
1705
+ value: i(n.value),
1706
+ conditionsThatEstablishesTheDecision: r
1152
1707
  };
1153
- }, Jt = (e) => {
1708
+ }, St = (e) => {
1154
1709
  if (typeof e != "string") return e;
1155
- const t = e.split(";").map((o) => o.trim()), n = {};
1156
- for (const o of t)
1157
- if (o.startsWith(">")) {
1158
- const r = parseFloat(o.slice(1));
1159
- isNaN(r) || (n.from = r);
1160
- } else if (o.startsWith("<")) {
1161
- const r = parseFloat(o.slice(1));
1162
- isNaN(r) || (n.to = r);
1710
+ const n = e.split(";").map((a) => a.trim()), t = {};
1711
+ for (const a of n)
1712
+ if (a.startsWith(">")) {
1713
+ const i = parseFloat(a.slice(1));
1714
+ isNaN(i) || (t.from = i);
1715
+ } else if (a.startsWith("<")) {
1716
+ const i = parseFloat(a.slice(1));
1717
+ isNaN(i) || (t.to = i);
1163
1718
  }
1164
- return n.from !== void 0 || n.to !== void 0 ? n : e;
1165
- }, Xt = (e) => {
1166
- const { dataDecision: t, originalDecision: n } = e, o = {
1167
- conditionName: t.ruleName || "",
1168
- labelName: t.labelName || "",
1169
- conditionDataType: t.decisionDataType || "alphabetical",
1170
- value: t.value || "",
1171
- howToSetTheCondition: t.howToSetTheDecision || "EqualTo",
1719
+ return t.from !== void 0 || t.to !== void 0 ? t : e;
1720
+ }, Nt = (e) => {
1721
+ const { dataDecision: n, originalDecision: t } = e, a = {
1722
+ conditionName: n.ruleName || "",
1723
+ labelName: n.labelName || "",
1724
+ conditionDataType: n.decisionDataType || "alphabetical",
1725
+ value: n.value || "",
1726
+ howToSetTheCondition: n.howToSetTheDecision || "EqualTo",
1172
1727
  switchPlaces: !0,
1173
1728
  hidden: !1
1174
1729
  };
1175
1730
  return {
1176
- ...n,
1177
- conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
1178
- (r) => r.hidden ? { ...o } : r
1731
+ ...t,
1732
+ conditionsThatEstablishesTheDecision: t.conditionsThatEstablishesTheDecision.map(
1733
+ (i) => i.hidden ? { ...a } : i
1179
1734
  )
1180
1735
  };
1181
- }, Zt = (e) => {
1182
- const { decisions: t } = e;
1183
- return t == null ? void 0 : t.map((n) => {
1184
- var r;
1185
- const o = (r = n.conditionsThatEstablishesTheDecision) == null ? void 0 : r.find(
1186
- (i) => i.hidden
1736
+ }, Et = (e) => {
1737
+ const { decisions: n } = e;
1738
+ return n == null ? void 0 : n.map((t) => {
1739
+ var i;
1740
+ const a = (i = t.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
1741
+ (r) => r.hidden
1187
1742
  );
1188
- return o ? {
1189
- ...n,
1190
- ruleName: n.ruleName,
1191
- labelName: n.labelName,
1192
- decisionDataType: n.decisionDataType,
1193
- value: n.value,
1194
- howToSetTheDecision: n.howToSetTheDecision,
1195
- conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
1196
- (i) => i.hidden ? { ...o, hidden: !1 } : i
1743
+ return a ? {
1744
+ ...t,
1745
+ ruleName: t.ruleName,
1746
+ labelName: t.labelName,
1747
+ decisionDataType: t.decisionDataType,
1748
+ value: t.value,
1749
+ howToSetTheDecision: t.howToSetTheDecision,
1750
+ conditionsThatEstablishesTheDecision: t.conditionsThatEstablishesTheDecision.map(
1751
+ (r) => r.hidden ? { ...a, hidden: !1 } : r
1197
1752
  )
1198
- } : n;
1753
+ } : t;
1199
1754
  });
1200
- }, mt = (e) => ({
1201
- schema: Z().required("Required").test(
1755
+ }, Hn = (e) => ({
1756
+ schema: ie().required("Required").test(
1202
1757
  "non-empty",
1203
1758
  "Value cannot be empty",
1204
- (t) => t != null && t.trim() !== ""
1759
+ (n) => n != null && n.trim() !== ""
1205
1760
  ),
1206
1761
  value: e
1207
- }), bt = (e) => ({
1208
- schema: xe().test(
1762
+ }), qn = (e) => ({
1763
+ schema: Ne().test(
1209
1764
  "isArrayOrString",
1210
1765
  "Must be an array of strings/numbers or a single string",
1211
- (t) => Array.isArray(t) ? t.every(
1212
- (n) => typeof n == "string" || typeof n == "number"
1213
- ) : typeof t == "string"
1766
+ (n) => Array.isArray(n) ? n.every(
1767
+ (t) => typeof t == "string" || typeof t == "number"
1768
+ ) : typeof n == "string"
1214
1769
  ),
1215
1770
  value: e
1216
- }), ft = (e) => ({
1217
- schema: xe().test(
1771
+ }), Pn = (e) => ({
1772
+ schema: Ne().test(
1218
1773
  "isArrayOrString",
1219
1774
  "Must be an array of strings/numbers or a single string",
1220
- (t) => Array.isArray(t) ? t.every(
1221
- (n) => typeof n == "string" || typeof n == "number"
1222
- ) : typeof t == "string"
1775
+ (n) => Array.isArray(n) ? n.every(
1776
+ (t) => typeof t == "string" || typeof t == "number"
1777
+ ) : typeof n == "string"
1223
1778
  ),
1224
1779
  value: e
1225
- }), Tt = (e) => {
1226
- const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
1780
+ }), Gn = (e) => {
1781
+ const n = (e == null ? void 0 : e.from) ?? 0, t = (e == null ? void 0 : e.to) ?? 0;
1227
1782
  return {
1228
- schema: P({
1229
- from: Q().required("Range From is required").max(n, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
1230
- to: Q().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
1783
+ schema: W({
1784
+ from: ee().required("Range From is required").max(t, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
1785
+ to: ee().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
1231
1786
  "is-greater",
1232
1787
  "To value must be greater than From value",
1233
- function(o) {
1234
- const { from: r } = this.parent;
1235
- return o > r;
1788
+ function(a) {
1789
+ const { from: i } = this.parent;
1790
+ return a > i;
1236
1791
  }
1237
1792
  )
1238
1793
  }),
1239
- value: { from: t, to: n }
1794
+ value: { from: n, to: t }
1240
1795
  };
1241
- }, W = (e, t) => t === z.PERCENTAGE ? {
1242
- schema: Q().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
1796
+ }, Z = (e, n) => n === I.PERCENTAGE ? {
1797
+ schema: ee().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
1243
1798
  value: e
1244
1799
  } : {
1245
- schema: Z().required("Required"),
1800
+ schema: ie().required("Required"),
1246
1801
  value: e
1247
- }, yt = {
1248
- [D.LIST_OF_VALUES]: bt,
1249
- [D.LIST_OF_VALUES_MULTI]: ft,
1250
- [D.RANGE]: Tt,
1251
- [D.GREATER_THAN]: W,
1252
- [D.LESS_THAN]: W,
1253
- [D.EQUAL]: W
1254
- }, ce = (e) => yt[e] || mt;
1255
- function xt({
1802
+ }, Qn = {
1803
+ [D.LIST_OF_VALUES]: qn,
1804
+ [D.LIST_OF_VALUES_MULTI]: Pn,
1805
+ [D.RANGE]: Gn,
1806
+ [D.GREATER_THAN]: Z,
1807
+ [D.LESS_THAN]: Z,
1808
+ [D.EQUAL]: Z
1809
+ }, me = (e) => Qn[e] || Hn;
1810
+ function Wn({
1256
1811
  decision: e,
1257
- onSubmitEvent: t,
1258
- textValues: n
1812
+ onSubmitEvent: n,
1813
+ textValues: t
1259
1814
  }) {
1260
- const o = {
1815
+ const a = {
1261
1816
  ruleName: e.ruleName || "",
1262
- decisionDataType: e.decisionDataType || z.ALPHABETICAL,
1817
+ decisionDataType: e.decisionDataType || I.ALPHABETICAL,
1263
1818
  howToSetTheDecision: e.howToSetTheDecision || "",
1264
1819
  value: e.value || "",
1265
1820
  effectiveFrom: e.effectiveFrom || "",
@@ -1269,108 +1824,108 @@ function xt({
1269
1824
  checkClosed: !1,
1270
1825
  terms: !0
1271
1826
  };
1272
- let r;
1273
- const i = {
1274
- ruleName: Z().required("Name is required"),
1275
- value: ie(() => ce(
1276
- r.values.howToSetTheDecision
1827
+ let i;
1828
+ const r = {
1829
+ ruleName: ie().required("Name is required"),
1830
+ value: ue(() => me(
1831
+ i.values.howToSetTheDecision
1277
1832
  )(
1278
- r.values.value,
1279
- r.values.decisionDataType
1833
+ i.values.value,
1834
+ i.values.decisionDataType
1280
1835
  ).schema),
1281
- conditionsThatEstablishesTheDecision: ie((c, { parent: d }) => {
1282
- var f;
1283
- if ((d == null ? void 0 : d.toggleNone) && Object.keys(d.conditionsThatEstablishesTheDecision || {}).length > 0) return P().shape({});
1284
- const s = (f = e.conditionsThatEstablishesTheDecision) == null ? void 0 : f.reduce(
1285
- (T, b) => {
1286
- if (r.values.conditionsThatEstablishesTheDecision[b.conditionName] !== void 0) {
1287
- const w = ce(
1288
- b.howToSetTheCondition
1836
+ conditionsThatEstablishesTheDecision: ue((s, { parent: c }) => {
1837
+ var b;
1838
+ if ((c == null ? void 0 : c.toggleNone) && Object.keys(c.conditionsThatEstablishesTheDecision || {}).length > 0) return W().shape({});
1839
+ const d = (b = e.conditionsThatEstablishesTheDecision) == null ? void 0 : b.reduce(
1840
+ (m, f) => {
1841
+ if (i.values.conditionsThatEstablishesTheDecision[f.conditionName] !== void 0) {
1842
+ const C = me(
1843
+ f.howToSetTheCondition
1289
1844
  );
1290
- T[b.conditionName] = w(
1291
- b.value,
1292
- b.conditionDataType
1845
+ m[f.conditionName] = C(
1846
+ f.value,
1847
+ f.conditionDataType
1293
1848
  ).schema;
1294
1849
  }
1295
- return T;
1850
+ return m;
1296
1851
  },
1297
1852
  {}
1298
1853
  );
1299
- return P(s).test(
1854
+ return W(d).test(
1300
1855
  "at-least-one-condition",
1301
1856
  "It must be at least one condition in order for the decision to be validated correctly.",
1302
- (T) => T ? Object.values(T).some(
1303
- (b) => b != null && b !== ""
1857
+ (m) => m ? Object.values(m).some(
1858
+ (f) => f != null && f !== ""
1304
1859
  ) : !1
1305
1860
  );
1306
1861
  })
1307
1862
  };
1308
- n.terms && (i.effectiveFrom = le().required(
1863
+ t.terms && (r.effectiveFrom = pe().required(
1309
1864
  "effective From date is required"
1310
- ), i.validUntil = le().when(
1865
+ ), r.validUntil = pe().when(
1311
1866
  "checkClosed",
1312
- (c, d, { parent: u }) => (u == null ? void 0 : u.checkClosed) ? d.required("valid Until date is required").test(
1867
+ (s, c, { parent: u }) => (u == null ? void 0 : u.checkClosed) ? c.required("valid Until date is required").test(
1313
1868
  "is-after-startDate",
1314
1869
  "valid Until date must be greater than or equal to Start date",
1315
- function(f) {
1316
- const T = this.parent.effectiveFrom;
1317
- return !T || !f ? !0 : new Date(f) >= new Date(T);
1870
+ function(b) {
1871
+ const m = this.parent.effectiveFrom;
1872
+ return !m || !b ? !0 : new Date(b) >= new Date(m);
1318
1873
  }
1319
- ) : d.notRequired()
1874
+ ) : c.notRequired()
1320
1875
  ));
1321
- const h = P(i);
1322
- return r = Ie({
1323
- initialValues: o,
1324
- validationSchema: h,
1876
+ const p = W(r);
1877
+ return i = qe({
1878
+ initialValues: a,
1879
+ validationSchema: p,
1325
1880
  validateOnBlur: !0,
1326
- onSubmit: (c) => {
1881
+ onSubmit: (s) => {
1327
1882
  var u;
1328
- const d = {
1883
+ const c = {
1329
1884
  ...e,
1330
- ruleName: c.ruleName,
1331
- decisionDataType: c.decisionDataType,
1332
- howToSetTheDecision: c.howToSetTheDecision,
1333
- value: c.value,
1334
- effectiveFrom: c.effectiveFrom,
1335
- validUntil: c.validUntil,
1336
- conditionsThatEstablishesTheDecision: (u = e.conditionsThatEstablishesTheDecision) == null ? void 0 : u.filter((s) => {
1337
- const f = c.conditionsThatEstablishesTheDecision[s.conditionName];
1338
- return f != null && f !== "";
1339
- }).map((s) => ({
1340
- ...s,
1341
- value: c.conditionsThatEstablishesTheDecision[s.conditionName]
1885
+ ruleName: s.ruleName,
1886
+ decisionDataType: s.decisionDataType,
1887
+ howToSetTheDecision: s.howToSetTheDecision,
1888
+ value: s.value,
1889
+ effectiveFrom: s.effectiveFrom,
1890
+ validUntil: s.validUntil,
1891
+ conditionsThatEstablishesTheDecision: (u = e.conditionsThatEstablishesTheDecision) == null ? void 0 : u.filter((d) => {
1892
+ const b = s.conditionsThatEstablishesTheDecision[d.conditionName];
1893
+ return b != null && b !== "";
1894
+ }).map((d) => ({
1895
+ ...d,
1896
+ value: s.conditionsThatEstablishesTheDecision[d.conditionName]
1342
1897
  }))
1343
1898
  };
1344
- t(d);
1899
+ n(c);
1345
1900
  }
1346
- }), { formik: r, handleToggleNoneChange: (c) => {
1347
- var d;
1348
- r.setFieldValue("toggleNone", c), (d = e.conditionsThatEstablishesTheDecision) == null || d.forEach((u) => {
1349
- if (c)
1350
- r.setFieldValue(
1901
+ }), { formik: i, handleToggleNoneChange: (s) => {
1902
+ var c;
1903
+ i.setFieldValue("toggleNone", s), (c = e.conditionsThatEstablishesTheDecision) == null || c.forEach((u) => {
1904
+ if (s)
1905
+ i.setFieldValue(
1351
1906
  `conditionsThatEstablishesTheDecision.${u.conditionName}`,
1352
1907
  void 0
1353
1908
  );
1354
1909
  else {
1355
- const s = u.howToSetTheCondition === D.LIST_OF_VALUES_MULTI ? [] : "";
1356
- r.setFieldValue(
1910
+ const d = u.howToSetTheCondition === D.LIST_OF_VALUES_MULTI ? [] : "";
1911
+ i.setFieldValue(
1357
1912
  `conditionsThatEstablishesTheDecision.${u.conditionName}`,
1358
- s
1913
+ d
1359
1914
  );
1360
1915
  }
1361
1916
  });
1362
1917
  } };
1363
1918
  }
1364
- const vt = x.div`
1919
+ const Yn = x.div`
1365
1920
  & > div {
1366
1921
  border-radius: 8px;
1367
1922
  border: 1px solid
1368
1923
  ${({ theme: e }) => {
1369
- var t, n;
1370
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
1924
+ var n, t;
1925
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
1371
1926
  }};
1372
1927
  }
1373
- `, wt = x.div`
1928
+ `, Kn = x.div`
1374
1929
  width: 100%;
1375
1930
  height: 100%;
1376
1931
  overflow-y: auto;
@@ -1387,61 +1942,61 @@ const vt = x.div`
1387
1942
  background-color: #ebecf0;
1388
1943
  border-radius: 8px;
1389
1944
  }
1390
- `, Ct = (e) => {
1945
+ `, Jn = (e) => {
1391
1946
  const {
1392
- checked: t,
1393
- children: n,
1394
- handleToggleChange: o,
1395
- id: r,
1396
- labelToggle: i,
1397
- name: h,
1947
+ checked: n,
1948
+ children: t,
1949
+ handleToggleChange: a,
1950
+ id: i,
1951
+ labelToggle: r,
1952
+ name: p,
1398
1953
  valueToggle: l = ""
1399
- } = e, [c, d] = R(t), u = (s) => {
1400
- d(s.target.checked), o(s);
1954
+ } = e, [s, c] = O(n), u = (d) => {
1955
+ c(d.target.checked), a(d);
1401
1956
  };
1402
- return X(() => {
1403
- d(t);
1404
- }, [t]), /* @__PURE__ */ p(A, { children: [
1405
- /* @__PURE__ */ a(g, { children: /* @__PURE__ */ a(
1406
- Te,
1957
+ return oe(() => {
1958
+ c(n);
1959
+ }, [n]), /* @__PURE__ */ h(k, { children: [
1960
+ /* @__PURE__ */ o(g, { children: /* @__PURE__ */ o(
1961
+ Ce,
1407
1962
  {
1408
- checked: c,
1409
- id: r,
1410
- name: h,
1963
+ checked: s,
1964
+ id: i,
1965
+ name: p,
1411
1966
  onChange: u,
1412
1967
  size: "small",
1413
1968
  value: l,
1414
- children: /* @__PURE__ */ a(C, { size: "medium", type: "label", weight: "bold", children: i })
1969
+ children: /* @__PURE__ */ o(S, { size: "medium", type: "label", weight: "bold", children: r })
1415
1970
  }
1416
1971
  ) }),
1417
- c && /* @__PURE__ */ a(A, { children: n })
1972
+ s && /* @__PURE__ */ o(k, { children: t })
1418
1973
  ] });
1419
- }, St = (e) => {
1974
+ }, Xn = (e) => {
1420
1975
  const {
1421
- onHandleStartChange: t,
1422
- onHandleEndChange: n,
1423
- onCheckClosedChange: o,
1424
- labelStart: r,
1425
- labelEnd: i,
1426
- checkedClosed: h = !1,
1976
+ onHandleStartChange: n,
1977
+ onHandleEndChange: t,
1978
+ onCheckClosedChange: a,
1979
+ labelStart: i,
1980
+ labelEnd: r,
1981
+ checkedClosed: p = !1,
1427
1982
  required: l = !1,
1428
- valueStart: c = "",
1429
- valueEnd: d = "",
1983
+ valueStart: s = "",
1984
+ valueEnd: c = "",
1430
1985
  messageStart: u = "",
1431
- messageEnd: s = "",
1432
- statusStart: f = "pending",
1433
- statusEnd: T = "pending"
1434
- } = e, [b, v] = R(h), [w, S] = R(c), [k, F] = R(d), $ = ({ target: E }) => {
1435
- v(E.checked), o && o(E.checked);
1436
- }, m = (E) => {
1437
- S(E.target.value), t(E);
1438
- }, N = (E) => {
1439
- F(E.target.value), n(E);
1440
- }, O = V("(max-width: 400px)");
1441
- return /* @__PURE__ */ p(A, { children: [
1442
- /* @__PURE__ */ p(g, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
1443
- /* @__PURE__ */ a(
1444
- C,
1986
+ messageEnd: d = "",
1987
+ statusStart: b = "pending",
1988
+ statusEnd: m = "pending"
1989
+ } = e, [f, y] = O(p), [C, w] = O(s), [E, $] = O(c), A = ({ target: F }) => {
1990
+ y(F.checked), a && a(F.checked);
1991
+ }, T = (F) => {
1992
+ w(F.target.value), n(F);
1993
+ }, N = (F) => {
1994
+ $(F.target.value), t(F);
1995
+ }, M = B("(max-width: 400px)");
1996
+ return /* @__PURE__ */ h(k, { children: [
1997
+ /* @__PURE__ */ h(g, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
1998
+ /* @__PURE__ */ o(
1999
+ S,
1445
2000
  {
1446
2001
  appearance: "gray",
1447
2002
  margin: "10px 0",
@@ -1451,83 +2006,83 @@ const vt = x.div`
1451
2006
  children: "Vigencia"
1452
2007
  }
1453
2008
  ),
1454
- /* @__PURE__ */ a(
2009
+ /* @__PURE__ */ o(
1455
2010
  g,
1456
2011
  {
1457
2012
  alignContent: "center",
1458
2013
  justifyContent: "center",
1459
2014
  wrap: "wrap",
1460
2015
  gap: "4px",
1461
- children: /* @__PURE__ */ a(
1462
- Ne,
2016
+ children: /* @__PURE__ */ o(
2017
+ je,
1463
2018
  {
1464
2019
  label: "Cerrada",
1465
- onChange: $,
1466
- checked: b,
2020
+ onChange: A,
2021
+ checked: f,
1467
2022
  value: ""
1468
2023
  }
1469
2024
  )
1470
2025
  }
1471
2026
  )
1472
2027
  ] }),
1473
- /* @__PURE__ */ p(
2028
+ /* @__PURE__ */ h(
1474
2029
  g,
1475
2030
  {
1476
- direction: O ? "column" : "row",
2031
+ direction: M ? "column" : "row",
1477
2032
  justifyContent: "space-between",
1478
2033
  gap: "24px",
1479
2034
  children: [
1480
- /* @__PURE__ */ a(
1481
- ae,
2035
+ /* @__PURE__ */ o(
2036
+ de,
1482
2037
  {
1483
2038
  id: "dateStart",
1484
- label: r,
1485
- onChange: m,
1486
- value: w,
2039
+ label: i,
2040
+ onChange: T,
2041
+ value: C,
1487
2042
  required: l,
1488
2043
  size: "compact",
1489
- status: f,
2044
+ status: b,
1490
2045
  message: u
1491
2046
  }
1492
2047
  ),
1493
- b && /* @__PURE__ */ a(
1494
- ae,
2048
+ f && /* @__PURE__ */ o(
2049
+ de,
1495
2050
  {
1496
2051
  id: "dateEnd",
1497
- label: i,
2052
+ label: r,
1498
2053
  onChange: N,
1499
- value: k,
2054
+ value: E,
1500
2055
  required: l,
1501
2056
  size: "compact",
1502
- status: T,
1503
- message: s
2057
+ status: m,
2058
+ message: d
1504
2059
  }
1505
2060
  )
1506
2061
  ]
1507
2062
  }
1508
2063
  )
1509
2064
  ] });
1510
- }, Dt = (e) => {
2065
+ }, Zn = (e) => {
1511
2066
  const {
1512
- formik: t,
1513
- textValues: n,
1514
- onCancel: o,
1515
- visibleConditions: r,
1516
- normalizedDecision: i,
1517
- handleToggleNoneChange: h,
2067
+ formik: n,
2068
+ textValues: t,
2069
+ onCancel: a,
2070
+ visibleConditions: i,
2071
+ normalizedDecision: r,
2072
+ handleToggleNoneChange: p,
1518
2073
  handleConditionToggleChange: l,
1519
- showConditionsError: c,
1520
- termStartStatus: d,
2074
+ showConditionsError: s,
2075
+ termStartStatus: c,
1521
2076
  termEndStatus: u
1522
2077
  } = e;
1523
- return /* @__PURE__ */ a("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ p(g, { direction: "column", gap: "24px", children: [
1524
- re({
1525
- condition: i,
1526
- formik: t,
2078
+ return /* @__PURE__ */ o("form", { onSubmit: n.handleSubmit, children: /* @__PURE__ */ h(g, { direction: "column", gap: "24px", children: [
2079
+ ce({
2080
+ condition: r,
2081
+ formik: n,
1527
2082
  isDecision: !0
1528
2083
  }),
1529
- /* @__PURE__ */ a(I, { dashed: !0 }),
1530
- /* @__PURE__ */ a(vt, { children: /* @__PURE__ */ a(wt, { children: /* @__PURE__ */ p(
2084
+ /* @__PURE__ */ o(R, { dashed: !0 }),
2085
+ /* @__PURE__ */ o(Yn, { children: /* @__PURE__ */ o(Kn, { children: /* @__PURE__ */ h(
1531
2086
  g,
1532
2087
  {
1533
2088
  direction: "column",
@@ -1535,168 +2090,168 @@ const vt = x.div`
1535
2090
  gap: "16px",
1536
2091
  height: "272px",
1537
2092
  children: [
1538
- /* @__PURE__ */ p(
2093
+ /* @__PURE__ */ h(
1539
2094
  g,
1540
2095
  {
1541
2096
  justifyContent: "space-between",
1542
2097
  alignItems: "center",
1543
2098
  gap: "64px",
1544
2099
  children: [
1545
- /* @__PURE__ */ a(C, { type: "title", size: "small", weight: "bold", appearance: "gray", children: n.factsThatConditionIt }),
1546
- /* @__PURE__ */ a(
1547
- Te,
2100
+ /* @__PURE__ */ o(S, { type: "title", size: "small", weight: "bold", appearance: "gray", children: t.factsThatConditionIt }),
2101
+ /* @__PURE__ */ o(
2102
+ Ce,
1548
2103
  {
1549
2104
  id: "toggleNone",
1550
- onChange: () => h(!t.values.toggleNone),
1551
- checked: t.values.toggleNone,
2105
+ onChange: () => p(!n.values.toggleNone),
2106
+ checked: n.values.toggleNone,
1552
2107
  size: "small",
1553
- children: /* @__PURE__ */ a(C, { as: "span", size: "medium", type: "label", weight: "bold", children: n.none })
2108
+ children: /* @__PURE__ */ o(S, { as: "span", size: "medium", type: "label", weight: "bold", children: t.none })
1554
2109
  }
1555
2110
  )
1556
2111
  ]
1557
2112
  }
1558
2113
  ),
1559
- /* @__PURE__ */ a(g, { direction: "column", gap: "20px", children: r == null ? void 0 : r.map((s) => /* @__PURE__ */ a(
1560
- Ct,
2114
+ /* @__PURE__ */ o(g, { direction: "column", gap: "20px", children: i == null ? void 0 : i.map((d) => /* @__PURE__ */ o(
2115
+ Jn,
1561
2116
  {
1562
- id: `toggle-${s.conditionName}`,
1563
- name: `toggle.${s.conditionName}`,
1564
- labelToggle: s.labelName,
1565
- checked: !t.values.toggleNone && t.values.conditionsThatEstablishesTheDecision[s.conditionName] !== void 0,
1566
- handleToggleChange: (f) => l(
1567
- s.conditionName,
1568
- s.howToSetTheCondition === D.LIST_OF_VALUES_MULTI
1569
- )(f.target.checked),
1570
- children: re({ condition: s, formik: t })
2117
+ id: `toggle-${d.conditionName}`,
2118
+ name: `toggle.${d.conditionName}`,
2119
+ labelToggle: d.labelName,
2120
+ checked: !n.values.toggleNone && n.values.conditionsThatEstablishesTheDecision[d.conditionName] !== void 0,
2121
+ handleToggleChange: (b) => l(
2122
+ d.conditionName,
2123
+ d.howToSetTheCondition === D.LIST_OF_VALUES_MULTI
2124
+ )(b.target.checked),
2125
+ children: ce({ condition: d, formik: n })
1571
2126
  },
1572
- s.conditionName
2127
+ d.conditionName
1573
2128
  )) })
1574
2129
  ]
1575
2130
  }
1576
2131
  ) }) }),
1577
- n.terms && /* @__PURE__ */ p(A, { children: [
1578
- /* @__PURE__ */ a(I, { dashed: !0 }),
1579
- /* @__PURE__ */ a(
1580
- St,
2132
+ t.terms && /* @__PURE__ */ h(k, { children: [
2133
+ /* @__PURE__ */ o(R, { dashed: !0 }),
2134
+ /* @__PURE__ */ o(
2135
+ Xn,
1581
2136
  {
1582
- labelStart: n.termStart,
1583
- labelEnd: n.termEnd,
1584
- valueStart: t.values.effectiveFrom,
1585
- valueEnd: t.values.validUntil,
1586
- messageStart: t.errors.effectiveFrom,
1587
- messageEnd: t.errors.validUntil,
1588
- statusStart: d,
2137
+ labelStart: t.termStart,
2138
+ labelEnd: t.termEnd,
2139
+ valueStart: n.values.effectiveFrom,
2140
+ valueEnd: n.values.validUntil,
2141
+ messageStart: n.errors.effectiveFrom,
2142
+ messageEnd: n.errors.validUntil,
2143
+ statusStart: c,
1589
2144
  statusEnd: u,
1590
- onHandleStartChange: (s) => t.setFieldValue("effectiveFrom", s.target.value),
1591
- onHandleEndChange: (s) => t.setFieldValue("validUntil", s.target.value),
1592
- onCheckClosedChange: (s) => {
1593
- t.setFieldValue("checkClosed", s), s && t.setFieldValue("validUntil", "");
2145
+ onHandleStartChange: (d) => n.setFieldValue("effectiveFrom", d.target.value),
2146
+ onHandleEndChange: (d) => n.setFieldValue("validUntil", d.target.value),
2147
+ onCheckClosedChange: (d) => {
2148
+ n.setFieldValue("checkClosed", d), d && n.setFieldValue("validUntil", "");
1594
2149
  },
1595
- checkedClosed: t.values.checkClosed
2150
+ checkedClosed: n.values.checkClosed
1596
2151
  }
1597
2152
  )
1598
2153
  ] }),
1599
- /* @__PURE__ */ a(I, {}),
1600
- c && /* @__PURE__ */ a(C, { type: "label", size: "medium", appearance: "danger", children: String(t.errors.conditionsThatEstablishesTheDecision) }),
1601
- /* @__PURE__ */ p(g, { direction: "row", justifyContent: "end", gap: "16px", children: [
1602
- /* @__PURE__ */ a(L, { appearance: "gray", onClick: o, children: n.cancel }),
1603
- /* @__PURE__ */ a(L, { type: "submit", children: n.confirm })
2154
+ /* @__PURE__ */ o(R, {}),
2155
+ s && /* @__PURE__ */ o(S, { type: "label", size: "medium", appearance: "danger", children: String(n.errors.conditionsThatEstablishesTheDecision) }),
2156
+ /* @__PURE__ */ h(g, { direction: "row", justifyContent: "end", gap: "16px", children: [
2157
+ /* @__PURE__ */ o(U, { appearance: "gray", onClick: a, children: t.cancel }),
2158
+ /* @__PURE__ */ o(U, { type: "submit", children: t.confirm })
1604
2159
  ] })
1605
2160
  ] }) });
1606
- }, kt = (e) => {
1607
- var T;
1608
- const { decision: t, onSubmitEvent: n, textValues: o, onCancel: r } = e, { formik: i, handleToggleNoneChange: h } = xt({
1609
- decision: t,
1610
- onSubmitEvent: n,
1611
- textValues: o
2161
+ }, Ie = (e) => {
2162
+ var m;
2163
+ const { decision: n, onSubmitEvent: t, textValues: a, onCancel: i } = e, { formik: r, handleToggleNoneChange: p } = Wn({
2164
+ decision: n,
2165
+ onSubmitEvent: t,
2166
+ textValues: a
1612
2167
  }), l = {
1613
- ruleName: t.ruleName,
1614
- labelName: t.labelName,
1615
- howToSetTheCondition: t.howToSetTheDecision,
1616
- decisionDataType: t.decisionDataType,
1617
- listOfPossibleValues: t.listOfPossibleValues
1618
- }, c = ((T = t.conditionsThatEstablishesTheDecision) == null ? void 0 : T.filter(
1619
- (b) => !b.hidden
1620
- )) || [], d = !!i.errors.conditionsThatEstablishesTheDecision && i.submitCount > 0, u = i.touched.effectiveFrom ? i.errors.effectiveFrom ? "invalid" : "valid" : void 0, s = i.touched.validUntil ? i.errors.validUntil ? "invalid" : "valid" : void 0;
1621
- return /* @__PURE__ */ a(
1622
- Dt,
2168
+ ruleName: n.ruleName,
2169
+ labelName: n.labelName,
2170
+ howToSetTheCondition: n.howToSetTheDecision,
2171
+ decisionDataType: n.decisionDataType,
2172
+ listOfPossibleValues: n.listOfPossibleValues
2173
+ }, s = ((m = n.conditionsThatEstablishesTheDecision) == null ? void 0 : m.filter(
2174
+ (f) => !f.hidden
2175
+ )) || [], c = !!r.errors.conditionsThatEstablishesTheDecision && r.submitCount > 0, u = r.touched.effectiveFrom ? r.errors.effectiveFrom ? "invalid" : "valid" : void 0, d = r.touched.validUntil ? r.errors.validUntil ? "invalid" : "valid" : void 0;
2176
+ return /* @__PURE__ */ o(
2177
+ Zn,
1623
2178
  {
1624
- formik: i,
1625
- onCancel: r,
1626
- textValues: o,
1627
- decision: t,
1628
- visibleConditions: c,
2179
+ formik: r,
2180
+ onCancel: i,
2181
+ textValues: a,
2182
+ decision: n,
2183
+ visibleConditions: s,
1629
2184
  normalizedDecision: l,
1630
- handleToggleNoneChange: h,
1631
- handleConditionToggleChange: (b, v) => (w) => {
1632
- if (!w)
1633
- i.setFieldValue(
1634
- `conditionsThatEstablishesTheDecision.${b}`,
2185
+ handleToggleNoneChange: p,
2186
+ handleConditionToggleChange: (f, y) => (C) => {
2187
+ if (!C)
2188
+ r.setFieldValue(
2189
+ `conditionsThatEstablishesTheDecision.${f}`,
1635
2190
  void 0
1636
- ), i.setFieldTouched(
1637
- `conditionsThatEstablishesTheDecision.${b}`,
2191
+ ), r.setFieldTouched(
2192
+ `conditionsThatEstablishesTheDecision.${f}`,
1638
2193
  !1,
1639
2194
  !1
1640
2195
  );
1641
2196
  else {
1642
- const S = v ? [] : "";
1643
- i.setFieldValue(
1644
- `conditionsThatEstablishesTheDecision.${b}`,
1645
- S
2197
+ const w = y ? [] : "";
2198
+ r.setFieldValue(
2199
+ `conditionsThatEstablishesTheDecision.${f}`,
2200
+ w
1646
2201
  );
1647
2202
  }
1648
2203
  },
1649
- showConditionsError: d,
2204
+ showConditionsError: c,
1650
2205
  termStartStatus: u,
1651
- termEndStatus: s
2206
+ termEndStatus: d
1652
2207
  }
1653
2208
  );
1654
- }, en = (e) => {
1655
- var r;
1656
- const { decisionTemplate: t } = e, n = { ...t }, o = (r = n.conditionsThatEstablishesTheDecision) == null ? void 0 : r.find(
1657
- (i) => i.switchPlaces
2209
+ }, kt = (e) => {
2210
+ var i;
2211
+ const { decisionTemplate: n } = e, t = { ...n }, a = (i = t.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
2212
+ (r) => r.switchPlaces
1658
2213
  );
1659
- return o ? {
1660
- ...n,
1661
- ruleName: o.conditionName,
1662
- labelName: o.labelName,
1663
- decisionDataType: o.conditionDataType,
1664
- value: o.value,
1665
- howToSetTheDecision: o.howToSetTheCondition,
1666
- conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
1667
- (i) => i.conditionName === o.conditionName ? { ...i, hidden: !0 } : i
2214
+ return a ? {
2215
+ ...t,
2216
+ ruleName: a.conditionName,
2217
+ labelName: a.labelName,
2218
+ decisionDataType: a.conditionDataType,
2219
+ value: a.value,
2220
+ howToSetTheDecision: a.howToSetTheCondition,
2221
+ conditionsThatEstablishesTheDecision: t.conditionsThatEstablishesTheDecision.map(
2222
+ (r) => r.conditionName === a.conditionName ? { ...r, hidden: !0 } : r
1668
2223
  )
1669
- } : n;
1670
- }, tn = (e) => {
1671
- const { decisions: t } = e;
1672
- return t == null ? void 0 : t.map((n) => {
1673
- var r;
1674
- const o = (r = n.conditionsThatEstablishesTheDecision) == null ? void 0 : r.find(
1675
- (i) => i.switchPlaces
2224
+ } : t;
2225
+ }, At = (e) => {
2226
+ const { decisions: n } = e;
2227
+ return n == null ? void 0 : n.map((t) => {
2228
+ var i;
2229
+ const a = (i = t.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
2230
+ (r) => r.switchPlaces
1676
2231
  );
1677
- return o ? {
1678
- ...n,
1679
- ruleName: o.conditionName,
1680
- labelName: o.labelName,
1681
- decisionDataType: o.conditionDataType,
1682
- value: o.value,
1683
- howToSetTheDecision: o.howToSetTheCondition,
1684
- conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
1685
- (i) => i.conditionName === o.conditionName ? { ...i, hidden: !0 } : i
2232
+ return a ? {
2233
+ ...t,
2234
+ ruleName: a.conditionName,
2235
+ labelName: a.labelName,
2236
+ decisionDataType: a.conditionDataType,
2237
+ value: a.value,
2238
+ howToSetTheDecision: a.howToSetTheCondition,
2239
+ conditionsThatEstablishesTheDecision: t.conditionsThatEstablishesTheDecision.map(
2240
+ (r) => r.conditionName === a.conditionName ? { ...r, hidden: !0 } : r
1686
2241
  )
1687
- } : n;
2242
+ } : t;
1688
2243
  });
1689
- }, _ = /* @__PURE__ */ new Map(), Nt = (e, t) => _.get(`${t}:${e}`), Et = (e, t, n) => {
1690
- const o = `${t}:${e}`;
1691
- if (_.set(o, n), _.size > 1e3) {
1692
- const r = _.keys().next().value;
1693
- r !== void 0 && _.delete(r);
2244
+ }, _ = /* @__PURE__ */ new Map(), et = (e, n) => _.get(`${n}:${e}`), nt = (e, n, t) => {
2245
+ const a = `${n}:${e}`;
2246
+ if (_.set(a, t), _.size > 1e3) {
2247
+ const i = _.keys().next().value;
2248
+ i !== void 0 && _.delete(i);
1694
2249
  }
1695
- }, ue = /* @__PURE__ */ new Map(), $t = 1e3, At = (e) => {
1696
- const t = Date.now(), n = ue.get(e) || 0;
1697
- return t - n < $t ? !0 : (ue.set(e, t), !1);
1698
- }, Ft = (e) => {
1699
- const t = Oe(e);
2250
+ }, be = /* @__PURE__ */ new Map(), tt = 1e3, at = (e) => {
2251
+ const n = Date.now(), t = be.get(e) || 0;
2252
+ return n - t < tt ? !0 : (be.set(e, n), !1);
2253
+ }, ot = (e) => {
2254
+ const n = Ge(e);
1700
2255
  return {
1701
2256
  spa: "es",
1702
2257
  eng: "en",
@@ -1704,70 +2259,73 @@ const vt = x.div`
1704
2259
  fra: "fr",
1705
2260
  ita: "it",
1706
2261
  por: "pt"
1707
- }[t] || "en";
1708
- }, It = async (e, t, { url: n, apiKey: o }) => {
1709
- const r = `${t}:${e}`, i = Nt(e, t);
1710
- if (i) return i;
1711
- if (At(r))
2262
+ }[n] || "en";
2263
+ }, it = async (e, n, { url: t, apiKey: a }) => {
2264
+ const i = `${n}:${e}`, r = et(e, n);
2265
+ if (r) return r;
2266
+ if (at(i))
1712
2267
  return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
1713
- const h = Ft(e);
2268
+ const p = ot(e);
1714
2269
  try {
1715
- const { data: l } = await Re.post(
1716
- n,
2270
+ const { data: l } = await Pe.post(
2271
+ t,
1717
2272
  {
1718
2273
  q: e,
1719
- source: h,
1720
- target: t,
1721
- api_key: o
2274
+ source: p,
2275
+ target: n,
2276
+ api_key: a
1722
2277
  },
1723
2278
  {
1724
2279
  headers: {
1725
2280
  "Content-Type": "application/json"
1726
2281
  }
1727
2282
  }
1728
- ), c = (l == null ? void 0 : l.translatedText) || e;
1729
- return Et(e, t, c), c;
2283
+ ), s = (l == null ? void 0 : l.translatedText) || e;
2284
+ return nt(e, n, s), s;
1730
2285
  } catch (l) {
1731
2286
  return console.warn(`[Translation] Failed for: "${e}"`, l), e;
1732
2287
  }
1733
- }, Rt = (e) => typeof e == "string" && e.trim().length > 0, he = async (e, t, n) => {
1734
- const o = await Promise.all(
1735
- Object.entries(e).map(async ([r, i]) => {
1736
- if (Rt(i)) {
1737
- const h = await It(i, t, n);
1738
- return [r, h];
1739
- } else if (Array.isArray(i)) {
1740
- const h = await Promise.all(
1741
- i.map(
1742
- async (l) => typeof l == "object" && l !== null ? await he(l, t, n) : l
2288
+ }, rt = (e) => typeof e == "string" && e.trim().length > 0, fe = async (e, n, t) => {
2289
+ const a = await Promise.all(
2290
+ Object.entries(e).map(async ([i, r]) => {
2291
+ if (rt(r)) {
2292
+ const p = await it(r, n, t);
2293
+ return [i, p];
2294
+ } else if (Array.isArray(r)) {
2295
+ const p = await Promise.all(
2296
+ r.map(
2297
+ async (l) => typeof l == "object" && l !== null ? await fe(l, n, t) : l
1743
2298
  )
1744
2299
  );
1745
- return [r, h];
1746
- } else if (typeof i == "object" && i !== null) {
1747
- const h = await he(i, t, n);
1748
- return [r, h];
2300
+ return [i, p];
2301
+ } else if (typeof r == "object" && r !== null) {
2302
+ const p = await fe(r, n, t);
2303
+ return [i, p];
1749
2304
  } else
1750
- return [r, i];
2305
+ return [i, r];
1751
2306
  })
1752
2307
  );
1753
- return Object.fromEntries(o);
2308
+ return Object.fromEntries(a);
1754
2309
  };
1755
2310
  export {
1756
- ee as BusinessRuleCard,
1757
- ve as BusinessRuleView,
1758
- Gt as BusinessRules,
1759
- Wt as Filter,
1760
- Qt as FilterModal,
1761
- Yt as FormFilter,
1762
- We as ModalRules,
1763
- kt as RulesForm,
1764
- gt as convertRangeToString,
1765
- Kt as formatDecisionForBackend,
1766
- Jt as parseRangeFromString,
1767
- Xt as revertSortedDataSampleSwitchPlaces,
1768
- Zt as revertSortedDataSwitchPlaces,
1769
- en as sortDisplayDataSampleSwitchPlaces,
1770
- tn as sortDisplayDataSwitchPlaces,
1771
- he as translateObject,
1772
- It as translateText
2311
+ re as BusinessRuleCard,
2312
+ $e as BusinessRuleCardNew,
2313
+ Ee as BusinessRuleView,
2314
+ Fe as BusinessRuleViewNew,
2315
+ xt as BusinessRules,
2316
+ vt as BusinessRulesNew,
2317
+ yt as Filter,
2318
+ wt as FilterModal,
2319
+ Ct as FormFilter,
2320
+ ke as ModalRules,
2321
+ Ie as RulesForm,
2322
+ _n as convertRangeToString,
2323
+ Dt as formatDecisionForBackend,
2324
+ St as parseRangeFromString,
2325
+ Nt as revertSortedDataSampleSwitchPlaces,
2326
+ Et as revertSortedDataSwitchPlaces,
2327
+ kt as sortDisplayDataSampleSwitchPlaces,
2328
+ At as sortDisplayDataSwitchPlaces,
2329
+ fe as translateObject,
2330
+ it as translateText
1773
2331
  };