@isettingkit/business-rules 1.0.16 → 1.0.18

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 h, Fragment as D } from "react/jsx-runtime";
2
- import { MdOutlineDelete as fe, MdClear as ne, MdAdd as ae, MdOutlineFilterAltOff as ie, MdOutlineFilterAlt as oe } from "react-icons/md";
3
- import { inube as w, Stack as p, Divider as S, Icon as M, Text as y, SkeletonLine as $, useMediaQuery as A, Blanket as re, Button as N, Grid as le, Box as ye, Tag as se, Checkpicker as xe, Toggle as de, Checkbox as we, Date as Q } from "@inubekit/inubekit";
4
- import f, { keyframes as ve } from "styled-components";
5
- import { ValueDataType as k, ValueHowToSetUp as O, DecisionConditionRender as Y } from "@isettingkit/input";
6
- import { DecisionViewConditionRenderer as U } from "@isettingkit/view";
7
- import { createPortal as ce } from "react-dom";
8
- import { useFormik as Ce } from "formik";
9
- import { string as H, mixed as he, object as V, number as q, lazy as K, date as W } from "yup";
10
- import { useState as z, useEffect as Se } from "react";
11
- import De from "axios";
12
- import { franc as Ee } from "franc-min";
13
- const Ne = f.div`
1
+ import { jsx as o, 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 _, useMediaQuery as V, Blanket as fe, Button as L, Grid as J, Tag as B, OptionList as De, Checkpicker as ke, Toggle as Te, Checkbox as Ne, Date as ae } from "@inubekit/inubekit";
4
+ import v, { keyframes as Ee, ThemeContext as $e } from "styled-components";
5
+ import { ValueDataType as z, ValueHowToSetUp as q, DecisionConditionRender as ie } 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 ve, object as P, number as W, lazy as re, date as le } from "yup";
11
+ import Re from "axios";
12
+ import { franc as Oe } from "franc-min";
13
+ const Me = v.div`
14
14
  border-radius: 8px;
15
15
  border: 1px solid
16
16
  ${({ theme: e }) => {
17
17
  var t, n;
18
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || w.palette.neutral.N30;
18
+ return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
19
19
  }};
20
20
  box-sizing: border-box;
21
21
  display: flex;
@@ -26,7 +26,7 @@ const Ne = f.div`
26
26
  height: 100%;
27
27
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
28
28
  `;
29
- f.div`
29
+ v.div`
30
30
  width: 100%;
31
31
  height: 100%;
32
32
  overflow-y: auto;
@@ -45,36 +45,36 @@ f.div`
45
45
  border-radius: 8px;
46
46
  }
47
47
  `;
48
- const P = (e) => {
49
- const { children: t, controls: n = !0, handleDelete: i, id: o } = e;
50
- return /* @__PURE__ */ a(Ne, { children: /* @__PURE__ */ h(p, { direction: "column", gap: "16px", padding: "12px 16px", children: [
48
+ const ee = (e) => {
49
+ const { children: t, controls: n = !0, handleDelete: a, id: i } = e;
50
+ return /* @__PURE__ */ o(Me, { children: /* @__PURE__ */ p(g, { direction: "column", gap: "16px", padding: "12px 16px", children: [
51
51
  t,
52
- n && /* @__PURE__ */ h(D, { children: [
53
- /* @__PURE__ */ a(S, {}),
54
- /* @__PURE__ */ a(p, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ a(
52
+ n && /* @__PURE__ */ p(A, { children: [
53
+ /* @__PURE__ */ o(I, {}),
54
+ /* @__PURE__ */ o(g, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ o(
55
55
  M,
56
56
  {
57
57
  cursorHover: !0,
58
58
  appearance: "danger",
59
59
  size: "24px",
60
- icon: /* @__PURE__ */ a(fe, {}),
60
+ icon: /* @__PURE__ */ o(Ce, {}),
61
61
  onClick: () => {
62
- i(o);
62
+ a(i);
63
63
  }
64
64
  }
65
65
  ) })
66
66
  ] })
67
67
  ] }) });
68
- }, J = f.div`
68
+ }, se = v.div`
69
69
  & > div {
70
70
  border-radius: 8px;
71
71
  border: 1px solid
72
72
  ${({ theme: e }) => {
73
73
  var t, n;
74
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || w.palette.neutral.N30;
74
+ return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
75
75
  }};
76
76
  }
77
- `, X = f.div`
77
+ `, de = v.div`
78
78
  width: 100%;
79
79
  height: 100%;
80
80
  overflow-y: auto;
@@ -92,182 +92,182 @@ const P = (e) => {
92
92
  background-color: #ebecf0;
93
93
  border-radius: 8px;
94
94
  }
95
- `, ke = (e) => e.value, Ae = (e) => e.value, Fe = (e) => e.value, $e = (e) => ({
95
+ `, Le = (e) => e.value, ze = (e) => e.value, Ve = (e) => e.value, _e = (e) => ({
96
96
  from: e.from ?? "",
97
97
  to: e.to ?? ""
98
- }), Ie = (e) => e.value, Re = (e) => e.value, Me = (e) => e.value;
99
- var x = /* @__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))(x || {});
100
- const Le = {
101
- [x.LIST_OF_VALUES]: Ae,
102
- [x.LIST_OF_VALUES_MULTI]: Fe,
103
- [x.RANGE]: $e,
104
- [x.GREATER_THAN]: Ie,
105
- [x.LESS_THAN]: Re,
106
- [x.EQUAL]: Me
107
- }, R = (e) => {
108
- const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), i = Le[e == null ? void 0 : e.howToSetTheDecision] || ke;
109
- return n && i(t) || t || void 0;
110
- }, Oe = (e) => {
98
+ }), Ue = (e) => e.value, je = (e) => e.value, qe = (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 Be = {
101
+ [D.LIST_OF_VALUES]: ze,
102
+ [D.LIST_OF_VALUES_MULTI]: Ve,
103
+ [D.RANGE]: _e,
104
+ [D.GREATER_THAN]: Ue,
105
+ [D.LESS_THAN]: je,
106
+ [D.EQUAL]: qe
107
+ }, j = (e) => {
108
+ const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), a = Be[e == null ? void 0 : e.howToSetTheDecision] || Le;
109
+ return n && a(t) || t || void 0;
110
+ }, He = (e) => {
111
111
  const {
112
112
  conditionsAlignment: t,
113
113
  decision: n,
114
- decisionDateElement: i,
115
- decisionMapper: o,
114
+ decisionDateElement: a,
115
+ decisionMapper: i,
116
116
  loading: r,
117
- skeleton: u,
117
+ skeleton: h,
118
118
  terms: l,
119
- textValues: s,
120
- visibleConditions: g
119
+ textValues: d,
120
+ visibleConditions: c
121
121
  } = e;
122
- return r ? /* @__PURE__ */ h(p, { direction: "column", gap: "12px", children: [
123
- /* @__PURE__ */ a(p, { direction: "column", alignItems: "center", children: /* @__PURE__ */ a(
124
- U,
122
+ return r ? /* @__PURE__ */ p(g, { direction: "column", gap: "12px", children: [
123
+ /* @__PURE__ */ o(g, { direction: "column", alignItems: "center", children: /* @__PURE__ */ o(
124
+ G,
125
125
  {
126
- element: o,
127
- valueData: R(
128
- o
126
+ element: i,
127
+ valueData: j(
128
+ i
129
129
  ),
130
130
  type: "decision"
131
131
  }
132
132
  ) }, n.ruleName),
133
- /* @__PURE__ */ a(S, { dashed: !0 }),
134
- /* @__PURE__ */ a(X, { children: /* @__PURE__ */ h(
135
- p,
133
+ /* @__PURE__ */ o(I, { dashed: !0 }),
134
+ /* @__PURE__ */ o(de, { children: /* @__PURE__ */ p(
135
+ g,
136
136
  {
137
137
  direction: "column",
138
138
  gap: "12px",
139
139
  justifyContent: t,
140
140
  height: "203px",
141
141
  children: [
142
- /* @__PURE__ */ a(
143
- y,
142
+ /* @__PURE__ */ o(
143
+ C,
144
144
  {
145
145
  type: "label",
146
146
  size: "large",
147
147
  appearance: "dark",
148
148
  weight: "bold",
149
149
  textAlign: "center",
150
- children: s.factsThatConditionIt
150
+ children: d.factsThatConditionIt
151
151
  }
152
152
  ),
153
- g.map((c) => /* @__PURE__ */ a(J, { children: /* @__PURE__ */ a(p, { direction: "column", padding: "8px", children: /* @__PURE__ */ a(
154
- U,
153
+ c.map((u) => /* @__PURE__ */ o(se, { children: /* @__PURE__ */ o(g, { direction: "column", padding: "8px", children: /* @__PURE__ */ o(
154
+ G,
155
155
  {
156
- element: { ...c, value: c.value },
157
- valueData: R(
158
- c
156
+ element: { ...u, value: u.value },
157
+ valueData: j(
158
+ u
159
159
  )
160
160
  }
161
- ) }) }, c.conditionName)),
162
- l && /* @__PURE__ */ h(D, { children: [
163
- /* @__PURE__ */ a(S, { dashed: !0 }),
164
- i && /* @__PURE__ */ a(
165
- U,
161
+ ) }) }, u.conditionName)),
162
+ l && /* @__PURE__ */ p(A, { children: [
163
+ /* @__PURE__ */ o(I, { dashed: !0 }),
164
+ a && /* @__PURE__ */ o(
165
+ G,
166
166
  {
167
- element: i.element,
168
- valueData: i.valueData,
167
+ element: a.element,
168
+ valueData: a.valueData,
169
169
  type: "decision"
170
170
  },
171
- s.terms
171
+ d.terms
172
172
  )
173
173
  ] })
174
174
  ]
175
175
  }
176
176
  ) })
177
- ] }) : /* @__PURE__ */ h(p, { direction: "column", gap: "12px", children: [
178
- /* @__PURE__ */ h(p, { direction: "column", alignItems: "center", gap: "4px", children: [
179
- /* @__PURE__ */ a($, { animated: !0, width: "180px" }),
180
- /* @__PURE__ */ a($, { animated: !0, width: "85px" })
177
+ ] }) : /* @__PURE__ */ p(g, { direction: "column", gap: "12px", children: [
178
+ /* @__PURE__ */ p(g, { direction: "column", alignItems: "center", gap: "4px", children: [
179
+ /* @__PURE__ */ o(_, { animated: !0, width: "180px" }),
180
+ /* @__PURE__ */ o(_, { animated: !0, width: "85px" })
181
181
  ] }, "loading"),
182
- /* @__PURE__ */ h(p, { direction: "column", gap: "12px", alignItems: "center", children: [
183
- /* @__PURE__ */ a(S, { dashed: !0 }),
184
- /* @__PURE__ */ a($, { animated: !0, width: "150px" })
182
+ /* @__PURE__ */ p(g, { direction: "column", gap: "12px", alignItems: "center", children: [
183
+ /* @__PURE__ */ o(I, { dashed: !0 }),
184
+ /* @__PURE__ */ o(_, { animated: !0, width: "150px" })
185
185
  ] }),
186
- /* @__PURE__ */ a(X, { children: /* @__PURE__ */ a(
187
- p,
186
+ /* @__PURE__ */ o(de, { children: /* @__PURE__ */ o(
187
+ g,
188
188
  {
189
189
  direction: "column",
190
190
  gap: "12px",
191
191
  justifyContent: "space-between",
192
192
  height: "203px",
193
- children: u.map((c, d) => /* @__PURE__ */ a(J, { children: /* @__PURE__ */ h(
194
- p,
193
+ children: h.map((u, s) => /* @__PURE__ */ o(se, { children: /* @__PURE__ */ p(
194
+ g,
195
195
  {
196
196
  direction: "column",
197
197
  gap: "12px",
198
198
  alignItems: "start",
199
199
  padding: "8px",
200
200
  children: [
201
- /* @__PURE__ */ a($, { animated: !0, width: "180px" }),
202
- /* @__PURE__ */ a($, { animated: !0, width: "85px" })
201
+ /* @__PURE__ */ o(_, { animated: !0, width: "180px" }),
202
+ /* @__PURE__ */ o(_, { animated: !0, width: "85px" })
203
203
  ]
204
204
  }
205
- ) }, `condition-${d}`))
205
+ ) }, `condition-${s}`))
206
206
  }
207
207
  ) })
208
208
  ] });
209
- }, ue = (e) => {
210
- var b;
211
- const { decision: t, loading: n = !1, textValues: i } = e, o = !!(t != null && t.effectiveFrom), r = !!(t != null && t.validUntil), u = o && r ? {
209
+ }, xe = (e) => {
210
+ var f;
211
+ const { decision: t, loading: n = !1, textValues: a } = e, i = !!(t != null && t.effectiveFrom), r = !!(t != null && t.validUntil), h = i && r ? {
212
212
  element: {
213
- labelName: i == null ? void 0 : i.terms,
213
+ labelName: a == null ? void 0 : a.terms,
214
214
  value: String(t.effectiveFrom),
215
- howToSetTheDecision: O.RANGE,
216
- decisionDataType: k.DATE
215
+ howToSetTheDecision: q.RANGE,
216
+ decisionDataType: z.DATE
217
217
  },
218
- valueData: R({
219
- labelName: i == null ? void 0 : i.terms,
218
+ valueData: j({
219
+ labelName: a == null ? void 0 : a.terms,
220
220
  value: {
221
221
  from: String(t.effectiveFrom),
222
222
  to: String(t.validUntil)
223
223
  },
224
- howToSetTheDecision: O.RANGE,
225
- decisionDataType: k.DATE
224
+ howToSetTheDecision: q.RANGE,
225
+ decisionDataType: z.DATE
226
226
  })
227
- } : o && !r ? {
227
+ } : i && !r ? {
228
228
  element: {
229
- labelName: i == null ? void 0 : i.terms,
229
+ labelName: a == null ? void 0 : a.terms,
230
230
  value: String(t.effectiveFrom),
231
- howToSetTheDecision: O.EQUAL,
232
- decisionDataType: k.DATE
231
+ howToSetTheDecision: q.EQUAL,
232
+ decisionDataType: z.DATE
233
233
  },
234
- valueData: R({
235
- labelName: i == null ? void 0 : i.terms,
234
+ valueData: j({
235
+ labelName: a == null ? void 0 : a.terms,
236
236
  value: String(t.effectiveFrom),
237
- howToSetTheDecision: O.EQUAL,
238
- decisionDataType: k.DATE
237
+ howToSetTheDecision: q.EQUAL,
238
+ decisionDataType: z.DATE
239
239
  })
240
240
  } : null, l = t ? {
241
241
  labelName: t.labelName || "",
242
242
  decisionDataType: t.decisionDataType || "alphabetical",
243
- value: R(t),
243
+ value: j(t),
244
244
  howToSetTheDecision: t.howToSetTheDecision || "EqualTo"
245
- } : null, s = ((b = t == null ? void 0 : t.conditionsThatEstablishesTheDecision) == null ? void 0 : b.filter(
245
+ } : null, d = ((f = t == null ? void 0 : t.conditionsThatEstablishesTheDecision) == null ? void 0 : f.filter(
246
246
  (T) => !T.hidden
247
- )) || [], g = Array.from({ length: 5 }), c = !!(!n && t && i && l), d = s.length < 2 ? "start" : "space-between";
248
- return /* @__PURE__ */ a(
249
- Oe,
247
+ )) || [], c = Array.from({ length: 5 }), u = !!(!n && t && a && l), s = d.length < 2 ? "start" : "space-between";
248
+ return /* @__PURE__ */ o(
249
+ He,
250
250
  {
251
- conditionsAlignment: d,
251
+ conditionsAlignment: s,
252
252
  decision: t,
253
- decisionDateElement: u,
253
+ decisionDateElement: h,
254
254
  decisionMapper: l,
255
- loading: c,
256
- skeleton: g,
257
- terms: !!(i != null && i.terms),
258
- textValues: i,
259
- visibleConditions: s
255
+ loading: u,
256
+ skeleton: c,
257
+ terms: !!(a != null && a.terms),
258
+ textValues: a,
259
+ visibleConditions: d
260
260
  }
261
261
  );
262
- }, Ve = f.div`
262
+ }, Pe = v.div`
263
263
  position: relative;
264
264
  & > div {
265
265
  padding: 24px 16px;
266
266
  }
267
- `, ze = f.div`
267
+ `, Ge = v.div`
268
268
  background-color: ${({ theme: e }) => {
269
269
  var t, n;
270
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || w.palette.neutral.N0;
270
+ return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || y.palette.neutral.N0;
271
271
  }};
272
272
  max-width: 450px;
273
273
  max-height: 90vh;
@@ -295,24 +295,24 @@ const Le = {
295
295
  background-color: #ebecf0;
296
296
  border-radius: 8px;
297
297
  }
298
- `, _e = (e) => {
299
- const { children: t, portalId: n, onCloseModal: i, title: o } = e, r = document.getElementById(n);
298
+ `, Qe = (e) => {
299
+ const { children: t, portalId: n, onCloseModal: a, title: i } = e, r = document.getElementById(n);
300
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 u = A("(max-width: 400px)");
305
- return ce(
306
- /* @__PURE__ */ a(Ve, { smallScreen: u, children: /* @__PURE__ */ a(re, { children: /* @__PURE__ */ a(ze, { children: /* @__PURE__ */ h(p, { direction: "column", gap: "24px", children: [
307
- /* @__PURE__ */ a(p, { direction: "column", gap: "24px", children: /* @__PURE__ */ h(p, { alignItems: "center", justifyContent: "space-between", children: [
308
- /* @__PURE__ */ a(y, { type: "title", size: "large", appearance: "dark", weight: "bold", children: o }),
309
- /* @__PURE__ */ a(ne, { size: "24px", cursor: "pointer", onClick: i })
304
+ const h = V("(max-width: 400px)");
305
+ return ye(
306
+ /* @__PURE__ */ o(Pe, { smallScreen: h, children: /* @__PURE__ */ o(fe, { children: /* @__PURE__ */ o(Ge, { children: /* @__PURE__ */ p(g, { direction: "column", gap: "24px", children: [
307
+ /* @__PURE__ */ o(g, { direction: "column", gap: "24px", children: /* @__PURE__ */ p(g, { alignItems: "center", justifyContent: "space-between", children: [
308
+ /* @__PURE__ */ o(C, { type: "title", size: "large", appearance: "dark", weight: "bold", children: i }),
309
+ /* @__PURE__ */ o(pe, { size: "24px", cursor: "pointer", onClick: a })
310
310
  ] }) }),
311
311
  t
312
312
  ] }) }) }) }),
313
313
  r
314
314
  );
315
- }, Ue = ve`
315
+ }, We = Ee`
316
316
  from {
317
317
  opacity: 0;
318
318
  transform: translateY(20px);
@@ -322,12 +322,12 @@ const Le = {
322
322
  transform: translateY(0);
323
323
  }
324
324
  `;
325
- f.div`
325
+ v.div`
326
326
  border-radius: 8px;
327
327
  border: 1px solid
328
328
  ${({ theme: e }) => {
329
329
  var t, n;
330
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || w.palette.neutral.N30;
330
+ return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
331
331
  }};
332
332
  box-sizing: border-box;
333
333
  display: flex;
@@ -336,21 +336,21 @@ f.div`
336
336
  height: 100%;
337
337
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
338
338
  `;
339
- f.div`
339
+ v.div`
340
340
  & > div {
341
341
  border-radius: 8px;
342
342
  border: 1px solid
343
343
  ${({ theme: e }) => {
344
344
  var t, n;
345
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || w.palette.neutral.N30;
345
+ return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
346
346
  }};
347
347
  }
348
348
  `;
349
- const je = f.div`
349
+ const Ye = v.div`
350
350
  & > div {
351
351
  background-color: ${({ theme: e }) => {
352
352
  var t, n;
353
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N10) || w.palette.neutral.N10;
353
+ return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N10) || y.palette.neutral.N10;
354
354
  }};
355
355
  justify-content: center;
356
356
  }
@@ -358,18 +358,18 @@ const je = f.div`
358
358
  width: 100%;
359
359
  height: 100%;
360
360
  padding-bottom: 12px;
361
- `, pe = f.div`
361
+ `, we = v.div`
362
362
  width: 100%;
363
363
  height: 100%;
364
364
  & > div {
365
- animation: ${Ue} 600ms ease-out;
365
+ animation: ${We} 600ms ease-out;
366
366
  }
367
- `, qe = f.div`
367
+ `, Ke = v.div`
368
368
  & > div > div {
369
369
  border-radius: 8px;
370
370
  box-sizing: border-box;
371
371
  }
372
- `, Be = f.div`
372
+ `, Je = v.div`
373
373
  & > div {
374
374
  width: 100%;
375
375
  height: 100%;
@@ -390,61 +390,61 @@ const je = f.div`
390
390
  }
391
391
  }
392
392
  `;
393
- function He(e) {
393
+ function Xe(e) {
394
394
  const { index: t, handleOpenModal: n } = e;
395
- return /* @__PURE__ */ a(
396
- P,
395
+ return /* @__PURE__ */ o(
396
+ ee,
397
397
  {
398
398
  id: `loading-card-${t}`,
399
399
  handleDelete: () => {
400
400
  },
401
401
  handleView: () => n ? n() : null,
402
402
  controls: !1,
403
- children: /* @__PURE__ */ a(ue, { loading: !0 })
403
+ children: /* @__PURE__ */ o(xe, { loading: !0 })
404
404
  },
405
405
  `loading-card-${t}`
406
406
  );
407
407
  }
408
- function Pe(e) {
409
- const { decision: t, controls: n, handleOpenModal: i, handleDelete: o, textValues: r } = e;
410
- return t ? /* @__PURE__ */ a(pe, { children: /* @__PURE__ */ h(p, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
411
- /* @__PURE__ */ a(y, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
412
- /* @__PURE__ */ a(
413
- P,
408
+ function Ze(e) {
409
+ const { decision: t, controls: n, handleOpenModal: a, handleDelete: i, textValues: r } = e;
410
+ return t ? /* @__PURE__ */ o(we, { children: /* @__PURE__ */ p(g, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
411
+ /* @__PURE__ */ o(C, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
412
+ /* @__PURE__ */ o(
413
+ ee,
414
414
  {
415
415
  id: t.decisionId,
416
- handleDelete: () => o ? o(t.decisionId) : null,
417
- handleView: () => i ? i(t) : null,
416
+ handleDelete: () => i ? i(t.decisionId) : null,
417
+ handleView: () => a ? a(t) : null,
418
418
  controls: n,
419
- children: /* @__PURE__ */ a(ue, { decision: t, textValues: r })
419
+ children: /* @__PURE__ */ o(xe, { decision: t, textValues: r })
420
420
  }
421
421
  )
422
422
  ] }) }, t.decisionId) : null;
423
423
  }
424
- function Ge(e) {
424
+ function et(e) {
425
425
  const {
426
426
  customTitleContentAddCard: t,
427
427
  index: n,
428
- handleOpenModal: i,
429
- shouldRenderEmptyMessage: o
428
+ handleOpenModal: a,
429
+ shouldRenderEmptyMessage: i
430
430
  } = e, r = t || "Agregar decisión";
431
- return /* @__PURE__ */ a(pe, { children: o ? null : /* @__PURE__ */ h(p, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
432
- /* @__PURE__ */ a(y, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
433
- /* @__PURE__ */ a(
434
- je,
431
+ return /* @__PURE__ */ o(we, { children: i ? null : /* @__PURE__ */ p(g, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
432
+ /* @__PURE__ */ o(C, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
433
+ /* @__PURE__ */ o(
434
+ Ye,
435
435
  {
436
- onClick: () => i ? i() : null,
437
- children: /* @__PURE__ */ a(
438
- P,
436
+ onClick: () => a ? a() : null,
437
+ children: /* @__PURE__ */ o(
438
+ ee,
439
439
  {
440
440
  id: `add-decision-${n}`,
441
441
  handleDelete: () => {
442
442
  },
443
- handleView: () => i ? i() : null,
443
+ handleView: () => a ? a() : null,
444
444
  controls: !1,
445
- children: /* @__PURE__ */ h(p, { direction: "column", gap: "12px", alignItems: "center", children: [
446
- /* @__PURE__ */ a(M, { appearance: "gray", icon: /* @__PURE__ */ a(ae, {}), size: "35px" }),
447
- /* @__PURE__ */ a(y, { appearance: "gray", type: "body", size: "large", children: r })
445
+ children: /* @__PURE__ */ p(g, { direction: "column", gap: "12px", alignItems: "center", children: [
446
+ /* @__PURE__ */ o(M, { appearance: "gray", icon: /* @__PURE__ */ o(ge, {}), size: "35px" }),
447
+ /* @__PURE__ */ o(C, { appearance: "gray", type: "body", size: "large", children: r })
448
448
  ] })
449
449
  }
450
450
  )
@@ -452,86 +452,86 @@ function Ge(e) {
452
452
  )
453
453
  ] }) }, `add-decision-${n}`);
454
454
  }
455
- const Qe = {
456
- loading: He,
457
- decision: Pe,
458
- add: Ge
459
- }, B = (e) => {
460
- const { type: t } = e, n = Qe[t];
455
+ const tt = {
456
+ loading: Xe,
457
+ decision: Ze,
458
+ add: et
459
+ }, Y = (e) => {
460
+ const { type: t } = e, n = tt[t];
461
461
  return n ? n(e) : null;
462
- }, Ye = (e) => {
462
+ }, nt = (e) => {
463
463
  const {
464
464
  controls: t,
465
465
  customTitleContentAddCard: n,
466
- decisions: i,
467
- loading: o,
466
+ decisions: a,
467
+ loading: i,
468
468
  handleOpenModal: r,
469
- handleDelete: u,
469
+ handleDelete: h,
470
470
  textValues: l
471
- } = e, s = o ? Array.from({ length: 3 }).map(
472
- (c, d) => B({
471
+ } = e, d = i ? Array.from({ length: 3 }).map(
472
+ (u, s) => Y({
473
473
  type: "loading",
474
- index: d,
474
+ index: s,
475
475
  controls: t,
476
476
  customTitleContentAddCard: n,
477
- loading: o,
477
+ loading: i,
478
478
  handleOpenModal: r,
479
- handleDelete: u,
479
+ handleDelete: h,
480
480
  textValues: l
481
481
  })
482
- ) : i == null ? void 0 : i.map(
483
- (c) => B({
482
+ ) : a == null ? void 0 : a.map(
483
+ (u) => Y({
484
484
  type: "decision",
485
- decision: c,
485
+ decision: u,
486
486
  controls: t,
487
487
  customTitleContentAddCard: n,
488
- loading: o,
488
+ loading: i,
489
489
  handleOpenModal: r,
490
- handleDelete: u,
490
+ handleDelete: h,
491
491
  textValues: l
492
492
  })
493
- ), g = ((i == null ? void 0 : i.length) === 0 || i.length < Math.floor(window.innerWidth / 300)) && !o && t;
494
- return { renderedCards: s, shouldRenderAddCard: g };
495
- }, At = (e) => {
493
+ ), c = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !i && t;
494
+ return { renderedCards: d, shouldRenderAddCard: c };
495
+ }, Pt = (e) => {
496
496
  const {
497
497
  controls: t = !0,
498
498
  customTitleContentAddCard: n,
499
- customMessageEmptyDecisions: i,
500
- decisions: o,
499
+ customMessageEmptyDecisions: a,
500
+ decisions: i,
501
501
  textValues: r,
502
- decisionTemplate: u,
502
+ decisionTemplate: h,
503
503
  isModalOpen: l,
504
- selectedDecision: s,
505
- loading: g,
506
- handleOpenModal: c,
507
- handleCloseModal: d,
508
- handleSubmitForm: b,
504
+ selectedDecision: d,
505
+ loading: c,
506
+ handleOpenModal: u,
507
+ handleCloseModal: s,
508
+ handleSubmitForm: f,
509
509
  handleDelete: T,
510
- terms: m = !0
511
- } = e, v = A("(max-width: 681px)"), C = A("(max-width: 400px)"), { renderedCards: F, shouldRenderAddCard: _ } = Ye({
510
+ terms: b = !0
511
+ } = e, x = V("(max-width: 681px)"), w = V("(max-width: 400px)"), { renderedCards: S, shouldRenderAddCard: k } = nt({
512
512
  controls: t,
513
513
  customTitleContentAddCard: n,
514
- decisions: o,
515
- loading: g,
516
- handleOpenModal: c,
514
+ decisions: i,
515
+ loading: c,
516
+ handleOpenModal: u,
517
517
  handleDelete: T,
518
518
  textValues: r
519
- }), L = (o == null ? void 0 : o.length) === 0 && !g;
520
- return /* @__PURE__ */ h(D, { children: [
521
- /* @__PURE__ */ a(qe, { children: /* @__PURE__ */ a(Be, { children: /* @__PURE__ */ a(p, { direction: "column", gap: "16px", padding: "6px", children: L ? /* @__PURE__ */ h(
522
- p,
519
+ }), F = (i == null ? void 0 : i.length) === 0 && !c;
520
+ return /* @__PURE__ */ p(A, { children: [
521
+ /* @__PURE__ */ o(Ke, { children: /* @__PURE__ */ o(Je, { children: /* @__PURE__ */ o(g, { direction: "column", gap: "16px", padding: "6px", children: F ? /* @__PURE__ */ p(
522
+ g,
523
523
  {
524
524
  direction: "column",
525
525
  gap: "28px",
526
526
  width: "100%",
527
- height: v ? "auto" : "435px",
527
+ height: x ? "auto" : "435px",
528
528
  justifyContent: "center",
529
529
  alignItems: "center",
530
530
  children: [
531
- /* @__PURE__ */ a(y, { as: "span", type: "label", size: "large", appearance: "gray", children: i || /* @__PURE__ */ h(D, { children: [
531
+ /* @__PURE__ */ o(C, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ p(A, { children: [
532
532
  "Aún NO tienes definidas tasas de interés efectivas . Presiona",
533
- /* @__PURE__ */ h(
534
- y,
533
+ /* @__PURE__ */ p(
534
+ C,
535
535
  {
536
536
  as: "span",
537
537
  type: "label",
@@ -547,20 +547,20 @@ const Qe = {
547
547
  ),
548
548
  "para empezar."
549
549
  ] }) }),
550
- /* @__PURE__ */ a(
551
- N,
550
+ /* @__PURE__ */ o(
551
+ L,
552
552
  {
553
- iconBefore: /* @__PURE__ */ a(ae, {}),
554
- onClick: () => c ? c() : null,
553
+ iconBefore: /* @__PURE__ */ o(ge, {}),
554
+ onClick: () => u ? u() : null,
555
555
  children: n || "Agregar decisión"
556
556
  }
557
557
  )
558
558
  ]
559
559
  }
560
- ) : /* @__PURE__ */ h(
561
- le,
560
+ ) : /* @__PURE__ */ p(
561
+ J,
562
562
  {
563
- templateColumns: C ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
563
+ templateColumns: w ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
564
564
  autoFlow: "row dense",
565
565
  gap: "24px",
566
566
  alignItems: "start",
@@ -568,174 +568,440 @@ const Qe = {
568
568
  autoRows: "1fr",
569
569
  justifyItems: "center",
570
570
  padding: "6px",
571
- height: v ? "auto" : "484px",
571
+ height: x ? "auto" : "484px",
572
572
  children: [
573
- F,
574
- _ && B({
573
+ S,
574
+ k && Y({
575
575
  type: "add",
576
- index: o == null ? void 0 : o.length,
576
+ index: i == null ? void 0 : i.length,
577
577
  controls: t,
578
578
  customTitleContentAddCard: n,
579
- customMessageEmptyDecisions: i,
580
- loading: g,
581
- handleOpenModal: c,
579
+ customMessageEmptyDecisions: a,
580
+ loading: c,
581
+ handleOpenModal: u,
582
582
  handleDelete: T,
583
583
  textValues: r,
584
- shouldRenderEmptyMessage: L,
585
- terms: m
584
+ shouldRenderEmptyMessage: F,
585
+ terms: b
586
586
  })
587
587
  ]
588
588
  }
589
589
  ) }) }) }),
590
- l && /* @__PURE__ */ a(
591
- _e,
590
+ l && /* @__PURE__ */ o(
591
+ Qe,
592
592
  {
593
593
  portalId: "modal-portal",
594
- onCloseModal: d,
595
- title: s ? "Editar Decisión" : "Nueva decisión",
596
- children: /* @__PURE__ */ a(
597
- dt,
594
+ onCloseModal: s,
595
+ title: d ? "Editar Decisión" : "Nueva decisión",
596
+ children: /* @__PURE__ */ o(
597
+ Dt,
598
598
  {
599
- decision: s || u,
600
- onSubmitEvent: b,
599
+ decision: d || h,
600
+ onSubmitEvent: f,
601
601
  textValues: r,
602
- onCancel: () => d ? d() : () => {
602
+ onCancel: () => s ? s() : () => {
603
603
  }
604
604
  }
605
605
  )
606
606
  }
607
607
  )
608
608
  ] });
609
- }, Ke = f.div`
609
+ }, ot = v.div`
610
610
  display: flex;
611
- justify-content: ${({ justifyContent: e }) => e};
612
- align-items: ${({ alignItems: e }) => e};
613
- align-content: ${({ alignContent: e }) => e};
611
+ justify-content: ${({ $justifyContent: e }) => e};
612
+ align-items: ${({ $alignItems: e }) => e};
613
+ align-content: ${({ $alignContent: e }) => e};
614
614
  flex-direction: ${({ direction: e }) => e};
615
- flex-wrap: ${({ wrap: e }) => e};
615
+ flex-wrap: ${({ $wrap: e }) => e};
616
616
  height: ${({ height: e }) => e};
617
617
  width: ${({ width: e }) => e};
618
- gap: ${({ gap: e }) => e};
619
- margin: ${({ margin: e }) => e};
620
- padding: ${({ padding: e }) => e};
621
- background: ${({ background: e, theme: t }) => {
622
- var n, i, o, r;
623
- return e ? `${((i = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : i.N10) || w.palette.neutral.N10}` : `${((r = (o = t == null ? void 0 : t.palette) == null ? void 0 : o.neutral) == null ? void 0 : r.N0) || w.palette.neutral.N0}`;
618
+ gap: ${({ $gap: e }) => e};
619
+ margin: ${({ $margin: e }) => e};
620
+ padding: ${({ $padding: e }) => e};
621
+ background: ${({ $background: e, theme: t }) => {
622
+ var n, a, i, r;
623
+ return e ? `${((a = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : a.N10) || y.palette.neutral.N10}` : `${((r = (i = t == null ? void 0 : t.palette) == null ? void 0 : i.neutral) == null ? void 0 : r.N0) || y.palette.neutral.N0}`;
624
+ }};
625
+ border: ${({ $border: e, theme: t }) => {
626
+ var n, a;
627
+ return e ? `1px solid ${((a = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : a.N40) || y.palette.neutral.N40}` : "none";
624
628
  }};
625
- border: ${({ border: e, theme: t }) => {
626
- var n, i;
627
- return e ? `1px solid ${((i = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : i.N40) || w.palette.neutral.N40}` : "none";
629
+ border-radius: ${({ $borderRadius: e }) => e};
630
+ box-sizing: ${({ $boxSizing: e }) => e};
631
+ overflow-y: ${({ $scroll: e }) => e ? "scroll" : "none"};
632
+ `, te = Ae.forwardRef(
633
+ (e, t) => {
634
+ const {
635
+ children: n,
636
+ wrap: a,
637
+ direction: i = "column",
638
+ justifyContent: r,
639
+ alignItems: h,
640
+ alignContent: l,
641
+ height: d,
642
+ width: c,
643
+ gap: u,
644
+ background: s,
645
+ borderRadius: f,
646
+ border: T,
647
+ margin: b = "0px",
648
+ padding: x = "0px",
649
+ boxSizing: w,
650
+ scroll: S = !1
651
+ } = e;
652
+ return /* @__PURE__ */ o(
653
+ ot,
654
+ {
655
+ ref: t,
656
+ direction: i,
657
+ $justifyContent: r,
658
+ $alignItems: h,
659
+ $alignContent: l,
660
+ height: d,
661
+ width: c,
662
+ wrap: a,
663
+ $gap: u,
664
+ $background: s,
665
+ $border: T,
666
+ $margin: b,
667
+ $padding: x,
668
+ $borderRadius: f,
669
+ $boxSizing: w,
670
+ $scroll: S,
671
+ children: n
672
+ }
673
+ );
674
+ }
675
+ );
676
+ te.displayName = "BorderStack";
677
+ const at = {
678
+ border: {
679
+ color: y.palette.neutral.N40
680
+ }
681
+ }, it = v.div`
682
+ border-width: 1px;
683
+ border-style: solid;
684
+ border-color: ${({ theme: e }) => {
685
+ var t, n;
686
+ return ((n = (t = e == null ? void 0 : e.box) == null ? void 0 : t.border) == null ? void 0 : n.color) || at.border.color;
628
687
  }};
629
- border-radius: ${({ borderRadius: e }) => e};
630
- box-sizing: ${({ boxSizing: e }) => e};
631
- overflow-y: ${({ scroll: e }) => e ? "scroll" : "none"};
632
- `, ge = (e) => {
688
+ border-radius: ${({ $borderRadius: e }) => e};
689
+ margin: ${({ $margin: e }) => e};
690
+ padding: ${({ $padding: e }) => e};
691
+ width: ${({ $width: e }) => e};
692
+ height: ${({ $height: e }) => e};
693
+ box-sizing: border-box;
694
+ `;
695
+ function rt(e) {
633
696
  const {
634
697
  children: t,
635
- wrap: n,
636
- direction: i = "column",
637
- justifyContent: o,
638
- alignItems: r,
639
- alignContent: u,
640
- height: l,
641
- width: s,
642
- gap: g,
643
- background: c,
644
- borderRadius: d,
645
- border: b,
646
- margin: T = "0px",
647
- padding: m = "0px",
648
- boxSizing: v,
649
- scroll: C = !1
698
+ padding: n = "16px",
699
+ margin: a,
700
+ borderRadius: i = "8px",
701
+ width: r,
702
+ height: h
650
703
  } = e;
651
- return /* @__PURE__ */ a(
652
- Ke,
704
+ return /* @__PURE__ */ o(
705
+ it,
653
706
  {
654
- direction: i,
655
- justifyContent: o,
656
- alignItems: r,
657
- alignContent: u,
658
- height: l,
659
- width: s,
660
- wrap: n,
661
- gap: g,
662
- background: c,
663
- border: b,
664
- margin: T,
665
- padding: m,
666
- borderRadius: d,
667
- boxSizing: v,
668
- scroll: C,
707
+ $padding: n,
708
+ $margin: a,
709
+ $borderRadius: i,
710
+ $width: r,
711
+ $height: h,
669
712
  children: t
670
713
  }
671
714
  );
672
- }, We = f.div`
715
+ }
716
+ const lt = (e, t) => {
717
+ const [n, a] = R([]), [i, r] = R([]), [h, l] = R(!1), d = H(null);
718
+ return X(() => {
719
+ if (!e.current || !d.current) return;
720
+ const c = e.current, u = d.current, s = () => {
721
+ var F;
722
+ const T = c.clientWidth, b = Array.from(
723
+ u.querySelectorAll('[data-filter-tag="true"]')
724
+ ), x = 48;
725
+ let w = 0;
726
+ const S = [], k = [];
727
+ for (let $ = 0; $ < t.length; $++) {
728
+ const m = ((F = b[$]) == null ? void 0 : F.offsetWidth) ?? 0;
729
+ w + m + x <= T ? (S.push(t[$]), w += m) : k.push(t[$]);
730
+ }
731
+ a(S), r(k), l(k.length > 0);
732
+ }, f = new ResizeObserver(() => {
733
+ requestAnimationFrame(s);
734
+ });
735
+ return f.observe(c), () => f.disconnect();
736
+ }, [t, e]), { visible: n, hidden: i, showOverflowIndicator: h, measurementRef: d };
737
+ };
738
+ v.div`
673
739
  & > div {
674
740
  width: 100%;
675
741
  }
676
- `, Ft = (e) => {
742
+ `;
743
+ const st = v.div`
744
+ position: absolute;
745
+ top: calc(100% + 4px);
746
+ right: 0;
747
+ z-index: 1000;
748
+ width: 170px;
749
+ `, dt = v.div`
750
+ position: absolute;
751
+ visibility: hidden;
752
+ pointer-events: none;
753
+ height: 0;
754
+ overflow: hidden;
755
+ `, ct = v.div`
756
+ cursor: pointer;
757
+ `, K = {
758
+ border: {
759
+ color: {
760
+ regular: y.palette.neutral.N40,
761
+ disabled: y.palette.neutral.N40,
762
+ focus: y.palette.blue.B300,
763
+ invalid: y.palette.red.R400
764
+ }
765
+ },
766
+ background: {
767
+ color: {
768
+ regular: y.palette.neutral.N0,
769
+ disabled: y.palette.neutral.N10
770
+ }
771
+ },
772
+ content: {
773
+ color: {
774
+ regular: y.palette.neutral.N900,
775
+ disabled: y.palette.neutral.N70
776
+ }
777
+ },
778
+ placeholder: {
779
+ color: {
780
+ regular: y.palette.neutral.N300
781
+ }
782
+ },
783
+ option: {
784
+ appearance: {
785
+ regular: "dark",
786
+ hover: "primary"
787
+ },
788
+ background: {
789
+ regular: y.palette.neutral.N0,
790
+ hover: y.palette.neutral.N30
791
+ }
792
+ }
793
+ }, ut = v.li`
794
+ display: flex;
795
+ align-items: center;
796
+ align-self: stretch;
797
+ min-height: 40px;
798
+ border-left: 4px solid transparent;
799
+ padding: 4px 16px 4px 12px;
800
+ cursor: pointer;
801
+
802
+ border-left-width: 4px;
803
+ border-left-style: solid;
804
+
805
+ &:hover {
806
+ background-color: ${({ theme: e }) => {
807
+ var t, n, a;
808
+ return ((a = (n = (t = e == null ? void 0 : e.input) == null ? void 0 : t.background) == null ? void 0 : n.color) == null ? void 0 : a.regular) || K.background.color.regular;
809
+ }};
810
+ }
811
+ `, ht = (e) => {
812
+ var f, T, b, x, w, S;
813
+ const { id: t, label: n, leadingIcon: a, onClose: i } = e, [r, h] = R(!1), l = () => h(!0), d = () => h(!1), c = Fe($e), u = ((b = (T = (f = c == null ? void 0 : c.input) == null ? void 0 : f.option) == null ? void 0 : T.appearance) == null ? void 0 : b.hover) ?? K.option.appearance.hover, s = ((S = (w = (x = c == null ? void 0 : c.input) == null ? void 0 : x.option) == null ? void 0 : w.appearance) == null ? void 0 : S.regular) ?? K.option.appearance.regular;
814
+ return /* @__PURE__ */ o(
815
+ ut,
816
+ {
817
+ id: t,
818
+ onMouseEnter: l,
819
+ onMouseLeave: d,
820
+ onClick: (k) => {
821
+ k.stopPropagation();
822
+ },
823
+ children: /* @__PURE__ */ p(
824
+ J,
825
+ {
826
+ alignItems: "center",
827
+ gap: "8px",
828
+ templateColumns: "auto 1fr auto",
829
+ width: "100%",
830
+ children: [
831
+ a && /* @__PURE__ */ o(
832
+ M,
833
+ {
834
+ icon: a,
835
+ size: "medium",
836
+ appearance: r ? u : s
837
+ }
838
+ ),
839
+ /* @__PURE__ */ o(
840
+ C,
841
+ {
842
+ textAlign: "start",
843
+ size: "medium",
844
+ appearance: r ? u : s,
845
+ children: n
846
+ }
847
+ ),
848
+ /* @__PURE__ */ o(
849
+ M,
850
+ {
851
+ icon: /* @__PURE__ */ o(Se, {}),
852
+ size: "small",
853
+ onClick: (k) => {
854
+ k.stopPropagation(), i == null || i();
855
+ },
856
+ appearance: r ? u : s,
857
+ cursorHover: !0
858
+ }
859
+ )
860
+ ]
861
+ }
862
+ )
863
+ }
864
+ );
865
+ }, Gt = (e) => {
677
866
  const {
678
- appliedFilters: t,
867
+ appliedFilters: t = [],
679
868
  onClear: n,
680
- onClick: i,
681
- noFiltersLabel: o,
869
+ onClick: a,
870
+ noFiltersLabel: i,
682
871
  titleClearFilter: r,
683
- titleFilter: u
684
- } = e, l = !t || t.length === 0;
685
- return /* @__PURE__ */ a(We, { children: /* @__PURE__ */ a(ye, { borderRadius: "8px", width: "100%", children: /* @__PURE__ */ h(le, { gap: "12px", templateColumns: "1fr auto auto", width: "100%", children: [
686
- /* @__PURE__ */ a(
687
- ge,
688
- {
689
- background: !0,
690
- borderRadius: "8px",
691
- height: "100%",
692
- direction: "row",
693
- gap: "8px",
694
- alignItems: "center",
695
- padding: "0px 8px",
696
- border: !0,
697
- children: l ? /* @__PURE__ */ a(y, { size: "small", type: "label", appearance: "gray", children: o }) : t == null ? void 0 : t.map((s) => /* @__PURE__ */ a(
698
- se,
699
- {
700
- appearance: "primary",
701
- displayIcon: !0,
702
- removable: !0,
703
- icon: s.icon,
704
- label: s.label,
705
- onClose: s.onClose
706
- },
707
- s.label
708
- ))
709
- }
710
- ),
711
- /* @__PURE__ */ a(
712
- N,
713
- {
714
- cursorHover: !0,
715
- disabled: l,
716
- iconBefore: /* @__PURE__ */ a(ie, {}),
717
- onClick: n,
718
- variant: "outlined",
719
- children: r
720
- }
721
- ),
722
- /* @__PURE__ */ a(
723
- N,
872
+ titleFilter: h
873
+ } = e, l = H(null), d = H(null), c = H(null), {
874
+ visible: u,
875
+ hidden: s,
876
+ showOverflowIndicator: f,
877
+ measurementRef: T
878
+ } = lt(l, t), [b, x] = R(!1), w = (m) => {
879
+ m.stopPropagation(), x((N) => !N);
880
+ };
881
+ X(() => {
882
+ const m = (N) => {
883
+ var ne, oe;
884
+ const O = N.target;
885
+ !((ne = d.current) != null && ne.contains(O)) && !((oe = c.current) != null && oe.contains(O)) && x(!1);
886
+ };
887
+ return b && window.addEventListener("mousedown", m), () => window.removeEventListener("mousedown", m);
888
+ }, [b]);
889
+ const S = t.length === 0, k = b && s.length > 0, F = s.map((m) => ({
890
+ id: m.label,
891
+ value: m.label,
892
+ label: m.label,
893
+ icon: m.icon
894
+ })), $ = (m) => {
895
+ var N, O;
896
+ (O = (N = s.find((E) => E.label === m)) == null ? void 0 : N.onClose) == null || O.call(N), x(!1);
897
+ };
898
+ return /* @__PURE__ */ p(rt, { borderRadius: "8px", width: "100%", children: [
899
+ /* @__PURE__ */ o(dt, { ref: T, children: t.map((m) => /* @__PURE__ */ o("div", { "data-filter-tag": "true", children: /* @__PURE__ */ o(
900
+ B,
724
901
  {
725
- cursorHover: !0,
726
- iconBefore: /* @__PURE__ */ a(oe, {}),
727
- onClick: i,
728
- variant: "outlined",
729
- children: u
902
+ appearance: "primary",
903
+ displayIcon: !0,
904
+ removable: !0,
905
+ icon: m.icon,
906
+ label: m.label,
907
+ onClose: m.onClose
730
908
  }
731
- )
732
- ] }) }) });
733
- }, Je = f.div`
909
+ ) }, m.label)) }),
910
+ /* @__PURE__ */ p(J, { gap: "12px", templateColumns: "1fr auto auto", width: "100%", children: [
911
+ /* @__PURE__ */ o(
912
+ te,
913
+ {
914
+ ref: l,
915
+ background: !0,
916
+ borderRadius: "8px",
917
+ height: "100%",
918
+ direction: "row",
919
+ gap: "8px",
920
+ alignItems: "center",
921
+ padding: "0px 8px",
922
+ border: !0,
923
+ children: S ? /* @__PURE__ */ o(C, { size: "small", type: "label", appearance: "gray", children: i }) : /* @__PURE__ */ p(A, { children: [
924
+ u.map((m) => /* @__PURE__ */ o(
925
+ B,
926
+ {
927
+ "data-filter-tag": "true",
928
+ appearance: "primary",
929
+ displayIcon: !0,
930
+ removable: !0,
931
+ icon: m.icon,
932
+ label: m.label,
933
+ onClose: m.onClose
934
+ },
935
+ m.label
936
+ )),
937
+ f && /* @__PURE__ */ p(
938
+ "div",
939
+ {
940
+ ref: c,
941
+ style: { position: "relative", display: "inline-block" },
942
+ children: [
943
+ /* @__PURE__ */ o(ct, { onClick: w, children: /* @__PURE__ */ o(
944
+ B,
945
+ {
946
+ appearance: "primary",
947
+ label: `+${s.length}`
948
+ }
949
+ ) }),
950
+ k && /* @__PURE__ */ o(st, { ref: d, children: /* @__PURE__ */ o(
951
+ De,
952
+ {
953
+ options: F,
954
+ onOptionClick: $,
955
+ children: s.map((m) => /* @__PURE__ */ o(
956
+ ht,
957
+ {
958
+ id: m.label,
959
+ label: m.label,
960
+ leadingIcon: m.icon,
961
+ onClose: () => {
962
+ var N;
963
+ (N = m.onClose) == null || N.call(m), x(!1);
964
+ }
965
+ },
966
+ m.label
967
+ ))
968
+ }
969
+ ) })
970
+ ]
971
+ }
972
+ )
973
+ ] })
974
+ }
975
+ ),
976
+ /* @__PURE__ */ o(
977
+ L,
978
+ {
979
+ cursorHover: !0,
980
+ disabled: S,
981
+ iconBefore: /* @__PURE__ */ o(me, {}),
982
+ onClick: n,
983
+ variant: "outlined",
984
+ children: r
985
+ }
986
+ ),
987
+ /* @__PURE__ */ o(
988
+ L,
989
+ {
990
+ cursorHover: !0,
991
+ iconBefore: /* @__PURE__ */ o(be, {}),
992
+ onClick: a,
993
+ variant: "outlined",
994
+ children: h
995
+ }
996
+ )
997
+ ] })
998
+ ] });
999
+ }, pt = v.div`
734
1000
  display: flex;
735
1001
  flex-direction: column;
736
1002
  background-color: ${({ theme: e }) => {
737
1003
  var t, n;
738
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || w.palette.neutral.N0;
1004
+ return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || y.palette.neutral.N0;
739
1005
  }};
740
1006
  width: ${({ $smallScreen: e }) => e ? "auto" : "450px"};
741
1007
  height: auto;
@@ -743,59 +1009,59 @@ const Qe = {
743
1009
  padding: 24px;
744
1010
  gap: 24px;
745
1011
  box-sizing: border-box;
746
- `, $t = (e) => {
1012
+ `, Qt = (e) => {
747
1013
  const {
748
1014
  actionButtonLabel: t,
749
1015
  cancelButtonLabel: n,
750
- children: i,
751
- loading: o,
1016
+ children: a,
1017
+ loading: i,
752
1018
  onClick: r,
753
- onCloseModal: u,
1019
+ onCloseModal: h,
754
1020
  portalId: l,
755
- title: s
756
- } = e, g = A("(max-width: 768px)"), c = document.getElementById(l);
757
- if (!c)
1021
+ title: d
1022
+ } = e, c = V("(max-width: 768px)"), u = document.getElementById(l);
1023
+ if (!u)
758
1024
  throw new Error(
759
1025
  "The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
760
1026
  );
761
- return ce(
762
- /* @__PURE__ */ a(re, { children: /* @__PURE__ */ h(Je, { $smallScreen: g, children: [
763
- /* @__PURE__ */ h(p, { direction: "column", gap: "16px", children: [
764
- /* @__PURE__ */ h(p, { alignContent: "center", justifyContent: "space-between", children: [
765
- /* @__PURE__ */ a(y, { appearance: "dark", size: "small", type: "headline", children: s }),
766
- /* @__PURE__ */ h(p, { alignItems: "center", children: [
767
- /* @__PURE__ */ a(y, { children: "Cerrar" }),
768
- /* @__PURE__ */ a(
1027
+ return ye(
1028
+ /* @__PURE__ */ o(fe, { children: /* @__PURE__ */ p(pt, { $smallScreen: c, children: [
1029
+ /* @__PURE__ */ p(g, { direction: "column", gap: "16px", children: [
1030
+ /* @__PURE__ */ p(g, { alignContent: "center", justifyContent: "space-between", children: [
1031
+ /* @__PURE__ */ o(C, { appearance: "dark", size: "small", type: "headline", children: d }),
1032
+ /* @__PURE__ */ p(g, { alignItems: "center", children: [
1033
+ /* @__PURE__ */ o(C, { children: "Cerrar" }),
1034
+ /* @__PURE__ */ o(
769
1035
  M,
770
1036
  {
771
1037
  appearance: "dark",
772
- icon: /* @__PURE__ */ a(ne, {}),
773
- onClick: u,
1038
+ icon: /* @__PURE__ */ o(pe, {}),
1039
+ onClick: h,
774
1040
  cursorHover: !0
775
1041
  }
776
1042
  )
777
1043
  ] })
778
1044
  ] }),
779
- /* @__PURE__ */ a(S, {})
1045
+ /* @__PURE__ */ o(I, {})
780
1046
  ] }),
781
- i,
782
- /* @__PURE__ */ h(p, { gap: "20px", justifyContent: "flex-end", children: [
783
- /* @__PURE__ */ a(
784
- N,
1047
+ a,
1048
+ /* @__PURE__ */ p(g, { gap: "20px", justifyContent: "flex-end", children: [
1049
+ /* @__PURE__ */ o(
1050
+ L,
785
1051
  {
786
1052
  appearance: "gray",
787
- onClick: u,
788
- iconBefore: /* @__PURE__ */ a(ie, {}),
1053
+ onClick: h,
1054
+ iconBefore: /* @__PURE__ */ o(me, {}),
789
1055
  spacing: "wide",
790
1056
  variant: "outlined",
791
1057
  children: n
792
1058
  }
793
1059
  ),
794
- /* @__PURE__ */ a(
795
- N,
1060
+ /* @__PURE__ */ o(
1061
+ L,
796
1062
  {
797
1063
  appearance: "primary",
798
- loading: o,
1064
+ loading: i,
799
1065
  onClick: r,
800
1066
  spacing: "wide",
801
1067
  variant: "filled",
@@ -804,16 +1070,16 @@ const Qe = {
804
1070
  )
805
1071
  ] })
806
1072
  ] }) }),
807
- c
1073
+ u
808
1074
  );
809
- }, It = (e) => {
810
- const { appliedFilters: t, fields: n, onChange: i, noFiltersLabel: o } = e, r = A("(max-width: 768px)"), u = !t || t.length === 0;
811
- return /* @__PURE__ */ h(p, { direction: "column", gap: "16px", children: [
812
- r && /* @__PURE__ */ h(D, { children: [
813
- /* @__PURE__ */ h(p, { gap: "6px", width: "100%", alignItems: "center", children: [
814
- /* @__PURE__ */ a(M, { appearance: "gray", icon: /* @__PURE__ */ a(oe, {}) }),
815
- /* @__PURE__ */ a(
816
- ge,
1075
+ }, Wt = (e) => {
1076
+ const { appliedFilters: t, fields: n, onChange: a, noFiltersLabel: i } = e, r = V("(max-width: 768px)"), h = !t || t.length === 0;
1077
+ return /* @__PURE__ */ p(g, { direction: "column", gap: "16px", children: [
1078
+ r && /* @__PURE__ */ p(A, { children: [
1079
+ /* @__PURE__ */ p(g, { gap: "6px", width: "100%", alignItems: "center", children: [
1080
+ /* @__PURE__ */ o(M, { appearance: "gray", icon: /* @__PURE__ */ o(be, {}) }),
1081
+ /* @__PURE__ */ o(
1082
+ te,
817
1083
  {
818
1084
  background: !0,
819
1085
  borderRadius: "8px",
@@ -823,9 +1089,9 @@ const Qe = {
823
1089
  padding: "0px 8px",
824
1090
  border: !0,
825
1091
  width: "100%",
826
- height: "32px",
827
- children: u ? /* @__PURE__ */ a(y, { size: "small", type: "label", appearance: "gray", children: o }) : t == null ? void 0 : t.map((l) => /* @__PURE__ */ a(
828
- se,
1092
+ height: "36px",
1093
+ children: h ? /* @__PURE__ */ o(C, { size: "small", type: "label", appearance: "gray", children: i }) : t == null ? void 0 : t.map((l) => /* @__PURE__ */ o(
1094
+ B,
829
1095
  {
830
1096
  appearance: "primary",
831
1097
  displayIcon: !0,
@@ -839,19 +1105,19 @@ const Qe = {
839
1105
  }
840
1106
  )
841
1107
  ] }),
842
- /* @__PURE__ */ a(S, { dashed: !0 })
1108
+ /* @__PURE__ */ o(I, { dashed: !0 })
843
1109
  ] }),
844
- n.map((l) => /* @__PURE__ */ h(p, { gap: "6px", alignItems: "center", children: [
845
- /* @__PURE__ */ a(p, { padding: "22px 0 0 0", children: /* @__PURE__ */ a(M, { appearance: "primary", icon: l.icon }) }),
846
- /* @__PURE__ */ a(
847
- xe,
1110
+ n.map((l) => /* @__PURE__ */ p(g, { gap: "6px", alignItems: "center", children: [
1111
+ /* @__PURE__ */ o(g, { padding: "22px 0 0 0", children: /* @__PURE__ */ o(M, { appearance: "primary", icon: l.icon }) }),
1112
+ /* @__PURE__ */ o(
1113
+ ke,
848
1114
  {
849
1115
  disabled: l.disabled,
850
1116
  invalid: l.invalid,
851
1117
  label: l.label,
852
1118
  message: l.message,
853
1119
  name: l.name,
854
- onChange: i,
1120
+ onChange: a,
855
1121
  options: l.options,
856
1122
  placeholder: l.placeholder,
857
1123
  required: l.required,
@@ -862,9 +1128,9 @@ const Qe = {
862
1128
  )
863
1129
  ] }, l.name))
864
1130
  ] });
865
- }, Rt = (e) => {
1131
+ }, Yt = (e) => {
866
1132
  console.log(e);
867
- const { dataDecision: t, originalDecision: n } = e, i = {
1133
+ const { dataDecision: t, originalDecision: n } = e, a = {
868
1134
  conditionName: t.ruleName || "",
869
1135
  labelName: t.labelName || "",
870
1136
  conditionDataType: t.decisionDataType || "alphabetical",
@@ -876,17 +1142,17 @@ const Qe = {
876
1142
  return {
877
1143
  ...n,
878
1144
  conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
879
- (o) => o.hidden ? { ...i } : o
1145
+ (i) => i.hidden ? { ...a } : i
880
1146
  )
881
1147
  };
882
- }, Mt = (e) => {
1148
+ }, Kt = (e) => {
883
1149
  const { decisions: t } = e;
884
1150
  return t == null ? void 0 : t.map((n) => {
885
- var o;
886
- const i = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
1151
+ var i;
1152
+ const a = (i = n.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
887
1153
  (r) => r.hidden
888
1154
  );
889
- return i ? {
1155
+ return a ? {
890
1156
  ...n,
891
1157
  ruleName: n.ruleName,
892
1158
  labelName: n.labelName,
@@ -894,19 +1160,19 @@ const Qe = {
894
1160
  value: n.value,
895
1161
  howToSetTheDecision: n.howToSetTheDecision,
896
1162
  conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
897
- (r) => r.hidden ? { ...i, hidden: !1 } : r
1163
+ (r) => r.hidden ? { ...a, hidden: !1 } : r
898
1164
  )
899
1165
  } : n;
900
1166
  });
901
- }, Xe = (e) => ({
902
- schema: H().required("Required").test(
1167
+ }, gt = (e) => ({
1168
+ schema: Z().required("Required").test(
903
1169
  "non-empty",
904
1170
  "Value cannot be empty",
905
1171
  (t) => t != null && t.trim() !== ""
906
1172
  ),
907
1173
  value: e
908
- }), Ze = (e) => ({
909
- schema: he().test(
1174
+ }), mt = (e) => ({
1175
+ schema: ve().test(
910
1176
  "isArrayOrString",
911
1177
  "Must be an array of strings/numbers or a single string",
912
1178
  (t) => Array.isArray(t) ? t.every(
@@ -914,8 +1180,8 @@ const Qe = {
914
1180
  ) : typeof t == "string"
915
1181
  ),
916
1182
  value: e
917
- }), et = (e) => ({
918
- schema: he().test(
1183
+ }), bt = (e) => ({
1184
+ schema: ve().test(
919
1185
  "isArrayOrString",
920
1186
  "Must be an array of strings/numbers or a single string",
921
1187
  (t) => Array.isArray(t) ? t.every(
@@ -923,44 +1189,44 @@ const Qe = {
923
1189
  ) : typeof t == "string"
924
1190
  ),
925
1191
  value: e
926
- }), tt = (e) => {
1192
+ }), ft = (e) => {
927
1193
  const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
928
1194
  return {
929
- schema: V({
930
- 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"),
931
- to: q().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
1195
+ schema: P({
1196
+ from: W().required("Range From is required").max(n, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
1197
+ to: W().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
932
1198
  "is-greater",
933
1199
  "To value must be greater than From value",
934
- function(i) {
935
- const { from: o } = this.parent;
936
- return i > o;
1200
+ function(a) {
1201
+ const { from: i } = this.parent;
1202
+ return a > i;
937
1203
  }
938
1204
  )
939
1205
  }),
940
1206
  value: { from: t, to: n }
941
1207
  };
942
- }, j = (e, t) => t === k.PERCENTAGE ? {
943
- schema: q().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
1208
+ }, Q = (e, t) => t === z.PERCENTAGE ? {
1209
+ schema: W().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
944
1210
  value: e
945
1211
  } : {
946
- schema: H().required("Required"),
1212
+ schema: Z().required("Required"),
947
1213
  value: e
948
- }, nt = {
949
- [x.LIST_OF_VALUES]: Ze,
950
- [x.LIST_OF_VALUES_MULTI]: et,
951
- [x.RANGE]: tt,
952
- [x.GREATER_THAN]: j,
953
- [x.LESS_THAN]: j,
954
- [x.EQUAL]: j
955
- }, Z = (e) => nt[e] || Xe;
956
- function at({
1214
+ }, Tt = {
1215
+ [D.LIST_OF_VALUES]: mt,
1216
+ [D.LIST_OF_VALUES_MULTI]: bt,
1217
+ [D.RANGE]: ft,
1218
+ [D.GREATER_THAN]: Q,
1219
+ [D.LESS_THAN]: Q,
1220
+ [D.EQUAL]: Q
1221
+ }, ce = (e) => Tt[e] || gt;
1222
+ function yt({
957
1223
  decision: e,
958
1224
  onSubmitEvent: t,
959
1225
  textValues: n
960
1226
  }) {
961
- const i = {
1227
+ const a = {
962
1228
  ruleName: e.ruleName || "",
963
- decisionDataType: e.decisionDataType || k.ALPHABETICAL,
1229
+ decisionDataType: e.decisionDataType || z.ALPHABETICAL,
964
1230
  howToSetTheDecision: e.howToSetTheDecision || "",
965
1231
  value: e.value || "",
966
1232
  effectiveFrom: e.effectiveFrom || "",
@@ -970,108 +1236,108 @@ function at({
970
1236
  checkClosed: !1,
971
1237
  terms: !0
972
1238
  };
973
- let o;
1239
+ let i;
974
1240
  const r = {
975
- ruleName: H().required("Name is required"),
976
- value: K(() => Z(
977
- o.values.howToSetTheDecision
1241
+ ruleName: Z().required("Name is required"),
1242
+ value: re(() => ce(
1243
+ i.values.howToSetTheDecision
978
1244
  )(
979
- o.values.value,
980
- o.values.decisionDataType
1245
+ i.values.value,
1246
+ i.values.decisionDataType
981
1247
  ).schema),
982
- conditionsThatEstablishesTheDecision: K((s, { parent: g }) => {
983
- var b;
984
- if ((g == null ? void 0 : g.toggleNone) && Object.keys(g.conditionsThatEstablishesTheDecision || {}).length > 0) return V().shape({});
985
- const d = (b = e.conditionsThatEstablishesTheDecision) == null ? void 0 : b.reduce(
986
- (T, m) => {
987
- if (o.values.conditionsThatEstablishesTheDecision[m.conditionName] !== void 0) {
988
- const C = Z(
989
- m.howToSetTheCondition
1248
+ conditionsThatEstablishesTheDecision: re((d, { parent: c }) => {
1249
+ var f;
1250
+ if ((c == null ? void 0 : c.toggleNone) && Object.keys(c.conditionsThatEstablishesTheDecision || {}).length > 0) return P().shape({});
1251
+ const s = (f = e.conditionsThatEstablishesTheDecision) == null ? void 0 : f.reduce(
1252
+ (T, b) => {
1253
+ if (i.values.conditionsThatEstablishesTheDecision[b.conditionName] !== void 0) {
1254
+ const w = ce(
1255
+ b.howToSetTheCondition
990
1256
  );
991
- T[m.conditionName] = C(
992
- m.value,
993
- m.conditionDataType
1257
+ T[b.conditionName] = w(
1258
+ b.value,
1259
+ b.conditionDataType
994
1260
  ).schema;
995
1261
  }
996
1262
  return T;
997
1263
  },
998
1264
  {}
999
1265
  );
1000
- return V(d).test(
1266
+ return P(s).test(
1001
1267
  "at-least-one-condition",
1002
1268
  "It must be at least one condition in order for the decision to be validated correctly.",
1003
1269
  (T) => T ? Object.values(T).some(
1004
- (m) => m != null && m !== ""
1270
+ (b) => b != null && b !== ""
1005
1271
  ) : !1
1006
1272
  );
1007
1273
  })
1008
1274
  };
1009
- n.terms && (r.effectiveFrom = W().required(
1275
+ n.terms && (r.effectiveFrom = le().required(
1010
1276
  "effective From date is required"
1011
- ), r.validUntil = W().when(
1277
+ ), r.validUntil = le().when(
1012
1278
  "checkClosed",
1013
- (s, g, { parent: c }) => (c == null ? void 0 : c.checkClosed) ? g.required("valid Until date is required").test(
1279
+ (d, c, { parent: u }) => (u == null ? void 0 : u.checkClosed) ? c.required("valid Until date is required").test(
1014
1280
  "is-after-startDate",
1015
1281
  "valid Until date must be greater than or equal to Start date",
1016
- function(b) {
1282
+ function(f) {
1017
1283
  const T = this.parent.effectiveFrom;
1018
- return !T || !b ? !0 : new Date(b) >= new Date(T);
1284
+ return !T || !f ? !0 : new Date(f) >= new Date(T);
1019
1285
  }
1020
- ) : g.notRequired()
1286
+ ) : c.notRequired()
1021
1287
  ));
1022
- const u = V(r);
1023
- return o = Ce({
1024
- initialValues: i,
1025
- validationSchema: u,
1288
+ const h = P(r);
1289
+ return i = Ie({
1290
+ initialValues: a,
1291
+ validationSchema: h,
1026
1292
  validateOnBlur: !0,
1027
- onSubmit: (s) => {
1028
- var c;
1029
- const g = {
1293
+ onSubmit: (d) => {
1294
+ var u;
1295
+ const c = {
1030
1296
  ...e,
1031
- ruleName: s.ruleName,
1032
- decisionDataType: s.decisionDataType,
1033
- howToSetTheDecision: s.howToSetTheDecision,
1034
- value: s.value,
1035
- effectiveFrom: s.effectiveFrom,
1036
- validUntil: s.validUntil,
1037
- conditionsThatEstablishesTheDecision: (c = e.conditionsThatEstablishesTheDecision) == null ? void 0 : c.filter((d) => {
1038
- const b = s.conditionsThatEstablishesTheDecision[d.conditionName];
1039
- return b != null && b !== "";
1040
- }).map((d) => ({
1041
- ...d,
1042
- value: s.conditionsThatEstablishesTheDecision[d.conditionName]
1297
+ ruleName: d.ruleName,
1298
+ decisionDataType: d.decisionDataType,
1299
+ howToSetTheDecision: d.howToSetTheDecision,
1300
+ value: d.value,
1301
+ effectiveFrom: d.effectiveFrom,
1302
+ validUntil: d.validUntil,
1303
+ conditionsThatEstablishesTheDecision: (u = e.conditionsThatEstablishesTheDecision) == null ? void 0 : u.filter((s) => {
1304
+ const f = d.conditionsThatEstablishesTheDecision[s.conditionName];
1305
+ return f != null && f !== "";
1306
+ }).map((s) => ({
1307
+ ...s,
1308
+ value: d.conditionsThatEstablishesTheDecision[s.conditionName]
1043
1309
  }))
1044
1310
  };
1045
- t(g);
1311
+ t(c);
1046
1312
  }
1047
- }), { formik: o, handleToggleNoneChange: (s) => {
1048
- var g;
1049
- o.setFieldValue("toggleNone", s), (g = e.conditionsThatEstablishesTheDecision) == null || g.forEach((c) => {
1050
- if (s)
1051
- o.setFieldValue(
1052
- `conditionsThatEstablishesTheDecision.${c.conditionName}`,
1313
+ }), { formik: i, handleToggleNoneChange: (d) => {
1314
+ var c;
1315
+ i.setFieldValue("toggleNone", d), (c = e.conditionsThatEstablishesTheDecision) == null || c.forEach((u) => {
1316
+ if (d)
1317
+ i.setFieldValue(
1318
+ `conditionsThatEstablishesTheDecision.${u.conditionName}`,
1053
1319
  void 0
1054
1320
  );
1055
1321
  else {
1056
- const d = c.howToSetTheCondition === x.LIST_OF_VALUES_MULTI ? [] : "";
1057
- o.setFieldValue(
1058
- `conditionsThatEstablishesTheDecision.${c.conditionName}`,
1059
- d
1322
+ const s = u.howToSetTheCondition === D.LIST_OF_VALUES_MULTI ? [] : "";
1323
+ i.setFieldValue(
1324
+ `conditionsThatEstablishesTheDecision.${u.conditionName}`,
1325
+ s
1060
1326
  );
1061
1327
  }
1062
1328
  });
1063
1329
  } };
1064
1330
  }
1065
- const it = f.div`
1331
+ const vt = v.div`
1066
1332
  & > div {
1067
1333
  border-radius: 8px;
1068
1334
  border: 1px solid
1069
1335
  ${({ theme: e }) => {
1070
1336
  var t, n;
1071
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || w.palette.neutral.N30;
1337
+ return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
1072
1338
  }};
1073
1339
  }
1074
- `, ot = f.div`
1340
+ `, xt = v.div`
1075
1341
  width: 100%;
1076
1342
  height: 100%;
1077
1343
  overflow-y: auto;
@@ -1088,61 +1354,61 @@ const it = f.div`
1088
1354
  background-color: #ebecf0;
1089
1355
  border-radius: 8px;
1090
1356
  }
1091
- `, rt = (e) => {
1357
+ `, wt = (e) => {
1092
1358
  const {
1093
1359
  checked: t,
1094
1360
  children: n,
1095
- handleToggleChange: i,
1096
- id: o,
1361
+ handleToggleChange: a,
1362
+ id: i,
1097
1363
  labelToggle: r,
1098
- name: u,
1364
+ name: h,
1099
1365
  valueToggle: l = ""
1100
- } = e, [s, g] = z(t), c = (d) => {
1101
- g(d.target.checked), i(d);
1366
+ } = e, [d, c] = R(t), u = (s) => {
1367
+ c(s.target.checked), a(s);
1102
1368
  };
1103
- return Se(() => {
1104
- g(t);
1105
- }, [t]), /* @__PURE__ */ h(D, { children: [
1106
- /* @__PURE__ */ a(p, { children: /* @__PURE__ */ a(
1107
- de,
1369
+ return X(() => {
1370
+ c(t);
1371
+ }, [t]), /* @__PURE__ */ p(A, { children: [
1372
+ /* @__PURE__ */ o(g, { children: /* @__PURE__ */ o(
1373
+ Te,
1108
1374
  {
1109
- checked: s,
1110
- id: o,
1111
- name: u,
1112
- onChange: c,
1375
+ checked: d,
1376
+ id: i,
1377
+ name: h,
1378
+ onChange: u,
1113
1379
  size: "small",
1114
1380
  value: l,
1115
- children: /* @__PURE__ */ a(y, { size: "medium", type: "label", weight: "bold", children: r })
1381
+ children: /* @__PURE__ */ o(C, { size: "medium", type: "label", weight: "bold", children: r })
1116
1382
  }
1117
1383
  ) }),
1118
- s && /* @__PURE__ */ a(D, { children: n })
1384
+ d && /* @__PURE__ */ o(A, { children: n })
1119
1385
  ] });
1120
- }, lt = (e) => {
1386
+ }, Ct = (e) => {
1121
1387
  const {
1122
1388
  onHandleStartChange: t,
1123
1389
  onHandleEndChange: n,
1124
- onCheckClosedChange: i,
1125
- labelStart: o,
1390
+ onCheckClosedChange: a,
1391
+ labelStart: i,
1126
1392
  labelEnd: r,
1127
- checkedClosed: u = !1,
1393
+ checkedClosed: h = !1,
1128
1394
  required: l = !1,
1129
- valueStart: s = "",
1130
- valueEnd: g = "",
1131
- messageStart: c = "",
1132
- messageEnd: d = "",
1133
- statusStart: b = "pending",
1395
+ valueStart: d = "",
1396
+ valueEnd: c = "",
1397
+ messageStart: u = "",
1398
+ messageEnd: s = "",
1399
+ statusStart: f = "pending",
1134
1400
  statusEnd: T = "pending"
1135
- } = e, [m, v] = z(u), [C, F] = z(s), [_, L] = z(g), G = ({ target: E }) => {
1136
- v(E.checked), i && i(E.checked);
1137
- }, me = (E) => {
1138
- F(E.target.value), t(E);
1139
- }, be = (E) => {
1140
- L(E.target.value), n(E);
1141
- }, Te = A("(max-width: 400px)");
1142
- return /* @__PURE__ */ h(D, { children: [
1143
- /* @__PURE__ */ h(p, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
1144
- /* @__PURE__ */ a(
1145
- y,
1401
+ } = e, [b, x] = R(h), [w, S] = R(d), [k, F] = R(c), $ = ({ target: E }) => {
1402
+ x(E.checked), a && a(E.checked);
1403
+ }, m = (E) => {
1404
+ S(E.target.value), t(E);
1405
+ }, N = (E) => {
1406
+ F(E.target.value), n(E);
1407
+ }, O = V("(max-width: 400px)");
1408
+ return /* @__PURE__ */ p(A, { children: [
1409
+ /* @__PURE__ */ p(g, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
1410
+ /* @__PURE__ */ o(
1411
+ C,
1146
1412
  {
1147
1413
  appearance: "gray",
1148
1414
  margin: "10px 0",
@@ -1152,133 +1418,133 @@ const it = f.div`
1152
1418
  children: "Vigencia"
1153
1419
  }
1154
1420
  ),
1155
- /* @__PURE__ */ a(
1156
- p,
1421
+ /* @__PURE__ */ o(
1422
+ g,
1157
1423
  {
1158
1424
  alignContent: "center",
1159
1425
  justifyContent: "center",
1160
1426
  wrap: "wrap",
1161
1427
  gap: "4px",
1162
- children: /* @__PURE__ */ a(
1163
- we,
1428
+ children: /* @__PURE__ */ o(
1429
+ Ne,
1164
1430
  {
1165
1431
  label: "Cerrada",
1166
- onChange: G,
1167
- checked: m,
1432
+ onChange: $,
1433
+ checked: b,
1168
1434
  value: ""
1169
1435
  }
1170
1436
  )
1171
1437
  }
1172
1438
  )
1173
1439
  ] }),
1174
- /* @__PURE__ */ h(
1175
- p,
1440
+ /* @__PURE__ */ p(
1441
+ g,
1176
1442
  {
1177
- direction: Te ? "column" : "row",
1443
+ direction: O ? "column" : "row",
1178
1444
  justifyContent: "space-between",
1179
1445
  gap: "24px",
1180
1446
  children: [
1181
- /* @__PURE__ */ a(
1182
- Q,
1447
+ /* @__PURE__ */ o(
1448
+ ae,
1183
1449
  {
1184
1450
  id: "dateStart",
1185
- label: o,
1186
- onChange: me,
1187
- value: C,
1451
+ label: i,
1452
+ onChange: m,
1453
+ value: w,
1188
1454
  required: l,
1189
1455
  size: "compact",
1190
- status: b,
1191
- message: c
1456
+ status: f,
1457
+ message: u
1192
1458
  }
1193
1459
  ),
1194
- m && /* @__PURE__ */ a(
1195
- Q,
1460
+ b && /* @__PURE__ */ o(
1461
+ ae,
1196
1462
  {
1197
1463
  id: "dateEnd",
1198
1464
  label: r,
1199
- onChange: be,
1200
- value: _,
1465
+ onChange: N,
1466
+ value: k,
1201
1467
  required: l,
1202
1468
  size: "compact",
1203
1469
  status: T,
1204
- message: d
1470
+ message: s
1205
1471
  }
1206
1472
  )
1207
1473
  ]
1208
1474
  }
1209
1475
  )
1210
1476
  ] });
1211
- }, st = (e) => {
1477
+ }, St = (e) => {
1212
1478
  const {
1213
1479
  formik: t,
1214
1480
  textValues: n,
1215
- onCancel: i,
1216
- visibleConditions: o,
1481
+ onCancel: a,
1482
+ visibleConditions: i,
1217
1483
  normalizedDecision: r,
1218
- handleToggleNoneChange: u,
1484
+ handleToggleNoneChange: h,
1219
1485
  handleConditionToggleChange: l,
1220
- showConditionsError: s,
1221
- termStartStatus: g,
1222
- termEndStatus: c
1486
+ showConditionsError: d,
1487
+ termStartStatus: c,
1488
+ termEndStatus: u
1223
1489
  } = e;
1224
- return /* @__PURE__ */ a("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ h(p, { direction: "column", gap: "24px", children: [
1225
- Y({
1490
+ return /* @__PURE__ */ o("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ p(g, { direction: "column", gap: "24px", children: [
1491
+ ie({
1226
1492
  condition: r,
1227
1493
  formik: t,
1228
1494
  isDecision: !0
1229
1495
  }),
1230
- /* @__PURE__ */ a(S, { dashed: !0 }),
1231
- /* @__PURE__ */ a(it, { children: /* @__PURE__ */ a(ot, { children: /* @__PURE__ */ h(
1232
- p,
1496
+ /* @__PURE__ */ o(I, { dashed: !0 }),
1497
+ /* @__PURE__ */ o(vt, { children: /* @__PURE__ */ o(xt, { children: /* @__PURE__ */ p(
1498
+ g,
1233
1499
  {
1234
1500
  direction: "column",
1235
1501
  padding: "6px 12px",
1236
1502
  gap: "16px",
1237
1503
  height: "272px",
1238
1504
  children: [
1239
- /* @__PURE__ */ h(
1240
- p,
1505
+ /* @__PURE__ */ p(
1506
+ g,
1241
1507
  {
1242
1508
  justifyContent: "space-between",
1243
1509
  alignItems: "center",
1244
1510
  gap: "64px",
1245
1511
  children: [
1246
- /* @__PURE__ */ a(y, { type: "title", size: "small", weight: "bold", appearance: "gray", children: n.factsThatConditionIt }),
1247
- /* @__PURE__ */ a(
1248
- de,
1512
+ /* @__PURE__ */ o(C, { type: "title", size: "small", weight: "bold", appearance: "gray", children: n.factsThatConditionIt }),
1513
+ /* @__PURE__ */ o(
1514
+ Te,
1249
1515
  {
1250
1516
  id: "toggleNone",
1251
- onChange: () => u(!t.values.toggleNone),
1517
+ onChange: () => h(!t.values.toggleNone),
1252
1518
  checked: t.values.toggleNone,
1253
1519
  size: "small",
1254
- children: /* @__PURE__ */ a(y, { as: "span", size: "medium", type: "label", weight: "bold", children: n.none })
1520
+ children: /* @__PURE__ */ o(C, { as: "span", size: "medium", type: "label", weight: "bold", children: n.none })
1255
1521
  }
1256
1522
  )
1257
1523
  ]
1258
1524
  }
1259
1525
  ),
1260
- /* @__PURE__ */ a(p, { direction: "column", gap: "20px", children: o == null ? void 0 : o.map((d) => /* @__PURE__ */ a(
1261
- rt,
1526
+ /* @__PURE__ */ o(g, { direction: "column", gap: "20px", children: i == null ? void 0 : i.map((s) => /* @__PURE__ */ o(
1527
+ wt,
1262
1528
  {
1263
- id: `toggle-${d.conditionName}`,
1264
- name: `toggle.${d.conditionName}`,
1265
- labelToggle: d.labelName,
1266
- checked: !t.values.toggleNone && t.values.conditionsThatEstablishesTheDecision[d.conditionName] !== void 0,
1267
- handleToggleChange: (b) => l(
1268
- d.conditionName,
1269
- d.howToSetTheCondition === x.LIST_OF_VALUES_MULTI
1270
- )(b.target.checked),
1271
- children: Y({ condition: d, formik: t })
1529
+ id: `toggle-${s.conditionName}`,
1530
+ name: `toggle.${s.conditionName}`,
1531
+ labelToggle: s.labelName,
1532
+ checked: !t.values.toggleNone && t.values.conditionsThatEstablishesTheDecision[s.conditionName] !== void 0,
1533
+ handleToggleChange: (f) => l(
1534
+ s.conditionName,
1535
+ s.howToSetTheCondition === D.LIST_OF_VALUES_MULTI
1536
+ )(f.target.checked),
1537
+ children: ie({ condition: s, formik: t })
1272
1538
  },
1273
- d.conditionName
1539
+ s.conditionName
1274
1540
  )) })
1275
1541
  ]
1276
1542
  }
1277
1543
  ) }) }),
1278
- n.terms && /* @__PURE__ */ h(D, { children: [
1279
- /* @__PURE__ */ a(S, { dashed: !0 }),
1280
- /* @__PURE__ */ a(
1281
- lt,
1544
+ n.terms && /* @__PURE__ */ p(A, { children: [
1545
+ /* @__PURE__ */ o(I, { dashed: !0 }),
1546
+ /* @__PURE__ */ o(
1547
+ Ct,
1282
1548
  {
1283
1549
  labelStart: n.termStart,
1284
1550
  labelEnd: n.termEnd,
@@ -1286,118 +1552,118 @@ const it = f.div`
1286
1552
  valueEnd: t.values.validUntil,
1287
1553
  messageStart: t.errors.effectiveFrom,
1288
1554
  messageEnd: t.errors.validUntil,
1289
- statusStart: g,
1290
- statusEnd: c,
1291
- onHandleStartChange: (d) => t.setFieldValue("effectiveFrom", d.target.value),
1292
- onHandleEndChange: (d) => t.setFieldValue("validUntil", d.target.value),
1293
- onCheckClosedChange: (d) => {
1294
- t.setFieldValue("checkClosed", d), d && t.setFieldValue("validUntil", "");
1555
+ statusStart: c,
1556
+ statusEnd: u,
1557
+ onHandleStartChange: (s) => t.setFieldValue("effectiveFrom", s.target.value),
1558
+ onHandleEndChange: (s) => t.setFieldValue("validUntil", s.target.value),
1559
+ onCheckClosedChange: (s) => {
1560
+ t.setFieldValue("checkClosed", s), s && t.setFieldValue("validUntil", "");
1295
1561
  },
1296
1562
  checkedClosed: t.values.checkClosed
1297
1563
  }
1298
1564
  )
1299
1565
  ] }),
1300
- /* @__PURE__ */ a(S, {}),
1301
- s && /* @__PURE__ */ a(y, { type: "label", size: "medium", appearance: "danger", children: String(t.errors.conditionsThatEstablishesTheDecision) }),
1302
- /* @__PURE__ */ h(p, { direction: "row", justifyContent: "end", gap: "16px", children: [
1303
- /* @__PURE__ */ a(N, { appearance: "gray", onClick: i, children: n.cancel }),
1304
- /* @__PURE__ */ a(N, { type: "submit", children: n.confirm })
1566
+ /* @__PURE__ */ o(I, {}),
1567
+ d && /* @__PURE__ */ o(C, { type: "label", size: "medium", appearance: "danger", children: String(t.errors.conditionsThatEstablishesTheDecision) }),
1568
+ /* @__PURE__ */ p(g, { direction: "row", justifyContent: "end", gap: "16px", children: [
1569
+ /* @__PURE__ */ o(L, { appearance: "gray", onClick: a, children: n.cancel }),
1570
+ /* @__PURE__ */ o(L, { type: "submit", children: n.confirm })
1305
1571
  ] })
1306
1572
  ] }) });
1307
- }, dt = (e) => {
1573
+ }, Dt = (e) => {
1308
1574
  var T;
1309
- const { decision: t, onSubmitEvent: n, textValues: i, onCancel: o } = e, { formik: r, handleToggleNoneChange: u } = at({
1575
+ const { decision: t, onSubmitEvent: n, textValues: a, onCancel: i } = e, { formik: r, handleToggleNoneChange: h } = yt({
1310
1576
  decision: t,
1311
1577
  onSubmitEvent: n,
1312
- textValues: i
1578
+ textValues: a
1313
1579
  }), l = {
1314
1580
  ruleName: t.ruleName,
1315
1581
  labelName: t.labelName,
1316
1582
  howToSetTheCondition: t.howToSetTheDecision,
1317
1583
  decisionDataType: t.decisionDataType,
1318
1584
  listOfPossibleValues: t.listOfPossibleValues
1319
- }, s = ((T = t.conditionsThatEstablishesTheDecision) == null ? void 0 : T.filter(
1320
- (m) => !m.hidden
1321
- )) || [], g = !!r.errors.conditionsThatEstablishesTheDecision && r.submitCount > 0, c = r.touched.effectiveFrom ? r.errors.effectiveFrom ? "invalid" : "valid" : void 0, d = r.touched.validUntil ? r.errors.validUntil ? "invalid" : "valid" : void 0;
1322
- return /* @__PURE__ */ a(
1323
- st,
1585
+ }, d = ((T = t.conditionsThatEstablishesTheDecision) == null ? void 0 : T.filter(
1586
+ (b) => !b.hidden
1587
+ )) || [], c = !!r.errors.conditionsThatEstablishesTheDecision && r.submitCount > 0, u = r.touched.effectiveFrom ? r.errors.effectiveFrom ? "invalid" : "valid" : void 0, s = r.touched.validUntil ? r.errors.validUntil ? "invalid" : "valid" : void 0;
1588
+ return /* @__PURE__ */ o(
1589
+ St,
1324
1590
  {
1325
1591
  formik: r,
1326
- onCancel: o,
1327
- textValues: i,
1592
+ onCancel: i,
1593
+ textValues: a,
1328
1594
  decision: t,
1329
- visibleConditions: s,
1595
+ visibleConditions: d,
1330
1596
  normalizedDecision: l,
1331
- handleToggleNoneChange: u,
1332
- handleConditionToggleChange: (m, v) => (C) => {
1333
- if (!C)
1597
+ handleToggleNoneChange: h,
1598
+ handleConditionToggleChange: (b, x) => (w) => {
1599
+ if (!w)
1334
1600
  r.setFieldValue(
1335
- `conditionsThatEstablishesTheDecision.${m}`,
1601
+ `conditionsThatEstablishesTheDecision.${b}`,
1336
1602
  void 0
1337
1603
  ), r.setFieldTouched(
1338
- `conditionsThatEstablishesTheDecision.${m}`,
1604
+ `conditionsThatEstablishesTheDecision.${b}`,
1339
1605
  !1,
1340
1606
  !1
1341
1607
  );
1342
1608
  else {
1343
- const F = v ? [] : "";
1609
+ const S = x ? [] : "";
1344
1610
  r.setFieldValue(
1345
- `conditionsThatEstablishesTheDecision.${m}`,
1346
- F
1611
+ `conditionsThatEstablishesTheDecision.${b}`,
1612
+ S
1347
1613
  );
1348
1614
  }
1349
1615
  },
1350
- showConditionsError: g,
1351
- termStartStatus: c,
1352
- termEndStatus: d
1616
+ showConditionsError: c,
1617
+ termStartStatus: u,
1618
+ termEndStatus: s
1353
1619
  }
1354
1620
  );
1355
- }, Lt = (e) => {
1356
- var o;
1357
- const { decisionTemplate: t } = e, n = { ...t }, i = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
1621
+ }, Jt = (e) => {
1622
+ var i;
1623
+ const { decisionTemplate: t } = e, n = { ...t }, a = (i = n.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
1358
1624
  (r) => r.switchPlaces
1359
1625
  );
1360
- return i ? {
1626
+ return a ? {
1361
1627
  ...n,
1362
- ruleName: i.conditionName,
1363
- labelName: i.labelName,
1364
- decisionDataType: i.conditionDataType,
1365
- value: i.value,
1366
- howToSetTheDecision: i.howToSetTheCondition,
1628
+ ruleName: a.conditionName,
1629
+ labelName: a.labelName,
1630
+ decisionDataType: a.conditionDataType,
1631
+ value: a.value,
1632
+ howToSetTheDecision: a.howToSetTheCondition,
1367
1633
  conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
1368
- (r) => r.conditionName === i.conditionName ? { ...r, hidden: !0 } : r
1634
+ (r) => r.conditionName === a.conditionName ? { ...r, hidden: !0 } : r
1369
1635
  )
1370
1636
  } : n;
1371
- }, Ot = (e) => {
1637
+ }, Xt = (e) => {
1372
1638
  const { decisions: t } = e;
1373
1639
  return t == null ? void 0 : t.map((n) => {
1374
- var o;
1375
- const i = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
1640
+ var i;
1641
+ const a = (i = n.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
1376
1642
  (r) => r.switchPlaces
1377
1643
  );
1378
- return i ? {
1644
+ return a ? {
1379
1645
  ...n,
1380
- ruleName: i.conditionName,
1381
- labelName: i.labelName,
1382
- decisionDataType: i.conditionDataType,
1383
- value: i.value,
1384
- howToSetTheDecision: i.howToSetTheCondition,
1646
+ ruleName: a.conditionName,
1647
+ labelName: a.labelName,
1648
+ decisionDataType: a.conditionDataType,
1649
+ value: a.value,
1650
+ howToSetTheDecision: a.howToSetTheCondition,
1385
1651
  conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
1386
- (r) => r.conditionName === i.conditionName ? { ...r, hidden: !0 } : r
1652
+ (r) => r.conditionName === a.conditionName ? { ...r, hidden: !0 } : r
1387
1653
  )
1388
1654
  } : n;
1389
1655
  });
1390
- }, I = /* @__PURE__ */ new Map(), ct = (e, t) => I.get(`${t}:${e}`), ht = (e, t, n) => {
1391
- const i = `${t}:${e}`;
1392
- if (I.set(i, n), I.size > 1e3) {
1393
- const o = I.keys().next().value;
1394
- o !== void 0 && I.delete(o);
1656
+ }, U = /* @__PURE__ */ new Map(), kt = (e, t) => U.get(`${t}:${e}`), Nt = (e, t, n) => {
1657
+ const a = `${t}:${e}`;
1658
+ if (U.set(a, n), U.size > 1e3) {
1659
+ const i = U.keys().next().value;
1660
+ i !== void 0 && U.delete(i);
1395
1661
  }
1396
- }, ee = /* @__PURE__ */ new Map(), ut = 1e3, pt = (e) => {
1397
- const t = Date.now(), n = ee.get(e) || 0;
1398
- return t - n < ut ? !0 : (ee.set(e, t), !1);
1399
- }, gt = (e) => {
1400
- const t = Ee(e);
1662
+ }, ue = /* @__PURE__ */ new Map(), Et = 1e3, $t = (e) => {
1663
+ const t = Date.now(), n = ue.get(e) || 0;
1664
+ return t - n < Et ? !0 : (ue.set(e, t), !1);
1665
+ }, At = (e) => {
1666
+ const t = Oe(e);
1401
1667
  return {
1402
1668
  spa: "es",
1403
1669
  eng: "en",
@@ -1406,66 +1672,66 @@ const it = f.div`
1406
1672
  ita: "it",
1407
1673
  por: "pt"
1408
1674
  }[t] || "en";
1409
- }, mt = async (e, t, { url: n, apiKey: i }) => {
1410
- const o = `${t}:${e}`, r = ct(e, t);
1675
+ }, Ft = async (e, t, { url: n, apiKey: a }) => {
1676
+ const i = `${t}:${e}`, r = kt(e, t);
1411
1677
  if (r) return r;
1412
- if (pt(o))
1678
+ if ($t(i))
1413
1679
  return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
1414
- const u = gt(e);
1680
+ const h = At(e);
1415
1681
  try {
1416
- const { data: l } = await De.post(
1682
+ const { data: l } = await Re.post(
1417
1683
  n,
1418
1684
  {
1419
1685
  q: e,
1420
- source: u,
1686
+ source: h,
1421
1687
  target: t,
1422
- api_key: i
1688
+ api_key: a
1423
1689
  },
1424
1690
  {
1425
1691
  headers: {
1426
1692
  "Content-Type": "application/json"
1427
1693
  }
1428
1694
  }
1429
- ), s = (l == null ? void 0 : l.translatedText) || e;
1430
- return ht(e, t, s), s;
1695
+ ), d = (l == null ? void 0 : l.translatedText) || e;
1696
+ return Nt(e, t, d), d;
1431
1697
  } catch (l) {
1432
1698
  return console.warn(`[Translation] Failed for: "${e}"`, l), e;
1433
1699
  }
1434
- }, bt = (e) => typeof e == "string" && e.trim().length > 0, te = async (e, t, n) => {
1435
- const i = await Promise.all(
1436
- Object.entries(e).map(async ([o, r]) => {
1437
- if (bt(r)) {
1438
- const u = await mt(r, t, n);
1439
- return [o, u];
1700
+ }, It = (e) => typeof e == "string" && e.trim().length > 0, he = async (e, t, n) => {
1701
+ const a = await Promise.all(
1702
+ Object.entries(e).map(async ([i, r]) => {
1703
+ if (It(r)) {
1704
+ const h = await Ft(r, t, n);
1705
+ return [i, h];
1440
1706
  } else if (Array.isArray(r)) {
1441
- const u = await Promise.all(
1707
+ const h = await Promise.all(
1442
1708
  r.map(
1443
- async (l) => typeof l == "object" && l !== null ? await te(l, t, n) : l
1709
+ async (l) => typeof l == "object" && l !== null ? await he(l, t, n) : l
1444
1710
  )
1445
1711
  );
1446
- return [o, u];
1712
+ return [i, h];
1447
1713
  } else if (typeof r == "object" && r !== null) {
1448
- const u = await te(r, t, n);
1449
- return [o, u];
1714
+ const h = await he(r, t, n);
1715
+ return [i, h];
1450
1716
  } else
1451
- return [o, r];
1717
+ return [i, r];
1452
1718
  })
1453
1719
  );
1454
- return Object.fromEntries(i);
1720
+ return Object.fromEntries(a);
1455
1721
  };
1456
1722
  export {
1457
- P as BusinessRuleCard,
1458
- ue as BusinessRuleView,
1459
- At as BusinessRules,
1460
- Ft as Filter,
1461
- $t as FilterModal,
1462
- It as FormFilter,
1463
- _e as ModalRules,
1464
- dt as RulesForm,
1465
- Rt as revertSortedDataSampleSwitchPlaces,
1466
- Mt as revertSortedDataSwitchPlaces,
1467
- Lt as sortDisplayDataSampleSwitchPlaces,
1468
- Ot as sortDisplayDataSwitchPlaces,
1469
- te as translateObject,
1470
- mt as translateText
1723
+ ee as BusinessRuleCard,
1724
+ xe as BusinessRuleView,
1725
+ Pt as BusinessRules,
1726
+ Gt as Filter,
1727
+ Qt as FilterModal,
1728
+ Wt as FormFilter,
1729
+ Qe as ModalRules,
1730
+ Dt as RulesForm,
1731
+ Yt as revertSortedDataSampleSwitchPlaces,
1732
+ Kt as revertSortedDataSwitchPlaces,
1733
+ Jt as sortDisplayDataSampleSwitchPlaces,
1734
+ Xt as sortDisplayDataSwitchPlaces,
1735
+ he as translateObject,
1736
+ Ft as translateText
1471
1737
  };