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