@isettingkit/business-rules 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.d.ts +2 -0
- package/dist/index.es.js +463 -451
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a, jsxs as h, Fragment as D } from "react/jsx-runtime";
|
|
2
2
|
import { MdOutlineDelete as fe, MdClear as ne, MdAdd as ae, MdOutlineFilterAltOff as ie, MdOutlineFilterAlt as oe } from "react-icons/md";
|
|
3
|
-
import { inube as w, Stack as
|
|
4
|
-
import
|
|
3
|
+
import { inube as w, Stack as p, Divider as S, Icon as M, Text as f, SkeletonLine as $, useMediaQuery as A, Blanket as re, Button as N, Grid as le, Box as ye, Tag as se, Checkpicker as xe, Toggle as de, Checkbox as we, Date as Q } from "@inubekit/inubekit";
|
|
4
|
+
import y, { keyframes as ve } from "styled-components";
|
|
5
5
|
import { ValueDataType as k, ValueHowToSetUp as O, DecisionConditionRender as Y } from "@isettingkit/input";
|
|
6
|
-
import { DecisionViewConditionRenderer as
|
|
6
|
+
import { DecisionViewConditionRenderer as U } from "@isettingkit/view";
|
|
7
7
|
import { createPortal as ce } from "react-dom";
|
|
8
8
|
import { useFormik as Ce } from "formik";
|
|
9
9
|
import { string as H, mixed as he, object as V, number as q, lazy as K, date as W } from "yup";
|
|
10
|
-
import { useState as
|
|
10
|
+
import { useState as z, useEffect as Se } from "react";
|
|
11
11
|
import De from "axios";
|
|
12
12
|
import { franc as Ee } from "franc-min";
|
|
13
|
-
const Ne =
|
|
13
|
+
const Ne = y.div`
|
|
14
14
|
border-radius: 8px;
|
|
15
15
|
border: 1px solid ${w.palette.neutral.N30};
|
|
16
16
|
box-sizing: border-box;
|
|
@@ -22,7 +22,7 @@ const Ne = f.div`
|
|
|
22
22
|
height: 100%;
|
|
23
23
|
box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
|
|
24
24
|
`;
|
|
25
|
-
|
|
25
|
+
y.div`
|
|
26
26
|
width: 100%;
|
|
27
27
|
height: 100%;
|
|
28
28
|
overflow-y: auto;
|
|
@@ -42,26 +42,26 @@ f.div`
|
|
|
42
42
|
}
|
|
43
43
|
`;
|
|
44
44
|
const P = (e) => {
|
|
45
|
-
const { children: t, controls: n = !0, handleDelete:
|
|
46
|
-
return /* @__PURE__ */
|
|
45
|
+
const { children: t, controls: n = !0, handleDelete: i, id: o } = e;
|
|
46
|
+
return /* @__PURE__ */ a(Ne, { children: /* @__PURE__ */ h(p, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
47
47
|
t,
|
|
48
48
|
n && /* @__PURE__ */ h(D, { children: [
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ a(S, {}),
|
|
50
|
+
/* @__PURE__ */ a(p, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ a(
|
|
51
51
|
M,
|
|
52
52
|
{
|
|
53
53
|
cursorHover: !0,
|
|
54
54
|
appearance: "danger",
|
|
55
55
|
size: "24px",
|
|
56
|
-
icon: /* @__PURE__ */
|
|
56
|
+
icon: /* @__PURE__ */ a(fe, {}),
|
|
57
57
|
onClick: () => {
|
|
58
|
-
|
|
58
|
+
i(o);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
) })
|
|
62
62
|
] })
|
|
63
63
|
] }) });
|
|
64
|
-
}, J =
|
|
64
|
+
}, J = y.div`
|
|
65
65
|
& > div {
|
|
66
66
|
border-radius: 8px;
|
|
67
67
|
border: 1px solid
|
|
@@ -70,7 +70,7 @@ const P = (e) => {
|
|
|
70
70
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || w.palette.neutral.N30;
|
|
71
71
|
}};
|
|
72
72
|
}
|
|
73
|
-
`, X =
|
|
73
|
+
`, X = y.div`
|
|
74
74
|
width: 100%;
|
|
75
75
|
height: 100%;
|
|
76
76
|
overflow-y: auto;
|
|
@@ -92,51 +92,51 @@ const P = (e) => {
|
|
|
92
92
|
from: e.from ?? "",
|
|
93
93
|
to: e.to ?? ""
|
|
94
94
|
}), Ie = (e) => e.value, Re = (e) => e.value, Me = (e) => e.value;
|
|
95
|
-
var
|
|
95
|
+
var x = /* @__PURE__ */ ((e) => (e.EQUAL = "EqualTo", e.GREATER_THAN = "GreaterThan", e.LESS_THAN = "LessThan", e.LIST_OF_VALUES = "ListOfValues", e.LIST_OF_VALUES_MULTI = "ListOfValuesMulti", e.RANGE = "Range", e))(x || {});
|
|
96
96
|
const Le = {
|
|
97
|
-
[
|
|
98
|
-
[
|
|
99
|
-
[
|
|
100
|
-
[
|
|
101
|
-
[
|
|
102
|
-
[
|
|
97
|
+
[x.LIST_OF_VALUES]: Ae,
|
|
98
|
+
[x.LIST_OF_VALUES_MULTI]: Fe,
|
|
99
|
+
[x.RANGE]: $e,
|
|
100
|
+
[x.GREATER_THAN]: Ie,
|
|
101
|
+
[x.LESS_THAN]: Re,
|
|
102
|
+
[x.EQUAL]: Me
|
|
103
103
|
}, R = (e) => {
|
|
104
|
-
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t),
|
|
105
|
-
return n &&
|
|
104
|
+
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), i = Le[e == null ? void 0 : e.howToSetTheDecision] || ke;
|
|
105
|
+
return n && i(t) || t || void 0;
|
|
106
106
|
}, Oe = (e) => {
|
|
107
107
|
const {
|
|
108
108
|
conditionsAlignment: t,
|
|
109
109
|
decision: n,
|
|
110
|
-
decisionDateElement:
|
|
111
|
-
decisionMapper:
|
|
112
|
-
loading:
|
|
113
|
-
skeleton:
|
|
114
|
-
terms:
|
|
110
|
+
decisionDateElement: i,
|
|
111
|
+
decisionMapper: o,
|
|
112
|
+
loading: r,
|
|
113
|
+
skeleton: u,
|
|
114
|
+
terms: l,
|
|
115
115
|
textValues: s,
|
|
116
116
|
visibleConditions: g
|
|
117
117
|
} = e;
|
|
118
|
-
return
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
|
|
118
|
+
return r ? /* @__PURE__ */ h(p, { direction: "column", gap: "12px", children: [
|
|
119
|
+
/* @__PURE__ */ a(p, { direction: "column", alignItems: "center", children: /* @__PURE__ */ a(
|
|
120
|
+
U,
|
|
121
121
|
{
|
|
122
|
-
element:
|
|
122
|
+
element: o,
|
|
123
123
|
valueData: R(
|
|
124
|
-
|
|
124
|
+
o
|
|
125
125
|
),
|
|
126
126
|
type: "decision"
|
|
127
127
|
}
|
|
128
128
|
) }, n.ruleName),
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
|
|
129
|
+
/* @__PURE__ */ a(S, { dashed: !0 }),
|
|
130
|
+
/* @__PURE__ */ a(X, { children: /* @__PURE__ */ h(
|
|
131
|
+
p,
|
|
132
132
|
{
|
|
133
133
|
direction: "column",
|
|
134
134
|
gap: "12px",
|
|
135
135
|
justifyContent: t,
|
|
136
136
|
height: "203px",
|
|
137
137
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
|
|
138
|
+
/* @__PURE__ */ a(
|
|
139
|
+
f,
|
|
140
140
|
{
|
|
141
141
|
type: "label",
|
|
142
142
|
size: "large",
|
|
@@ -146,22 +146,22 @@ const Le = {
|
|
|
146
146
|
children: s.factsThatConditionIt
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
|
-
g.map((
|
|
150
|
-
|
|
149
|
+
g.map((c) => /* @__PURE__ */ a(J, { children: /* @__PURE__ */ a(p, { direction: "column", padding: "8px", children: /* @__PURE__ */ a(
|
|
150
|
+
U,
|
|
151
151
|
{
|
|
152
|
-
element: { ...
|
|
152
|
+
element: { ...c, value: c.value },
|
|
153
153
|
valueData: R(
|
|
154
|
-
|
|
154
|
+
c
|
|
155
155
|
)
|
|
156
156
|
}
|
|
157
|
-
) }) },
|
|
158
|
-
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
|
|
161
|
-
|
|
157
|
+
) }) }, c.conditionName)),
|
|
158
|
+
l && /* @__PURE__ */ h(D, { children: [
|
|
159
|
+
/* @__PURE__ */ a(S, { dashed: !0 }),
|
|
160
|
+
i && /* @__PURE__ */ a(
|
|
161
|
+
U,
|
|
162
162
|
{
|
|
163
|
-
element:
|
|
164
|
-
valueData:
|
|
163
|
+
element: i.element,
|
|
164
|
+
valueData: i.valueData,
|
|
165
165
|
type: "decision"
|
|
166
166
|
},
|
|
167
167
|
s.terms
|
|
@@ -170,49 +170,49 @@ const Le = {
|
|
|
170
170
|
]
|
|
171
171
|
}
|
|
172
172
|
) })
|
|
173
|
-
] }) : /* @__PURE__ */ h(
|
|
174
|
-
/* @__PURE__ */ h(
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
173
|
+
] }) : /* @__PURE__ */ h(p, { direction: "column", gap: "12px", children: [
|
|
174
|
+
/* @__PURE__ */ h(p, { direction: "column", alignItems: "center", gap: "4px", children: [
|
|
175
|
+
/* @__PURE__ */ a($, { animated: !0, width: "180px" }),
|
|
176
|
+
/* @__PURE__ */ a($, { animated: !0, width: "85px" })
|
|
177
177
|
] }, "loading"),
|
|
178
|
-
/* @__PURE__ */ h(
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ h(p, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
179
|
+
/* @__PURE__ */ a(S, { dashed: !0 }),
|
|
180
|
+
/* @__PURE__ */ a($, { animated: !0, width: "150px" })
|
|
181
181
|
] }),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
|
|
182
|
+
/* @__PURE__ */ a(X, { children: /* @__PURE__ */ a(
|
|
183
|
+
p,
|
|
184
184
|
{
|
|
185
185
|
direction: "column",
|
|
186
186
|
gap: "12px",
|
|
187
187
|
justifyContent: "space-between",
|
|
188
188
|
height: "203px",
|
|
189
|
-
children:
|
|
190
|
-
|
|
189
|
+
children: u.map((c, d) => /* @__PURE__ */ a(J, { children: /* @__PURE__ */ h(
|
|
190
|
+
p,
|
|
191
191
|
{
|
|
192
192
|
direction: "column",
|
|
193
193
|
gap: "12px",
|
|
194
194
|
alignItems: "start",
|
|
195
195
|
padding: "8px",
|
|
196
196
|
children: [
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ a($, { animated: !0, width: "180px" }),
|
|
198
|
+
/* @__PURE__ */ a($, { animated: !0, width: "85px" })
|
|
199
199
|
]
|
|
200
200
|
}
|
|
201
|
-
) }, `condition-${
|
|
201
|
+
) }, `condition-${d}`))
|
|
202
202
|
}
|
|
203
203
|
) })
|
|
204
204
|
] });
|
|
205
205
|
}, ue = (e) => {
|
|
206
206
|
var b;
|
|
207
|
-
const { decision: t, loading: n = !1, textValues:
|
|
207
|
+
const { decision: t, loading: n = !1, textValues: i } = e, o = !!(t != null && t.effectiveFrom), r = !!(t != null && t.validUntil), u = o && r ? {
|
|
208
208
|
element: {
|
|
209
|
-
labelName:
|
|
209
|
+
labelName: i == null ? void 0 : i.terms,
|
|
210
210
|
value: String(t.effectiveFrom),
|
|
211
211
|
howToSetTheDecision: O.RANGE,
|
|
212
212
|
decisionDataType: k.DATE
|
|
213
213
|
},
|
|
214
214
|
valueData: R({
|
|
215
|
-
labelName:
|
|
215
|
+
labelName: i == null ? void 0 : i.terms,
|
|
216
216
|
value: {
|
|
217
217
|
from: String(t.effectiveFrom),
|
|
218
218
|
to: String(t.validUntil)
|
|
@@ -220,47 +220,47 @@ const Le = {
|
|
|
220
220
|
howToSetTheDecision: O.RANGE,
|
|
221
221
|
decisionDataType: k.DATE
|
|
222
222
|
})
|
|
223
|
-
} :
|
|
223
|
+
} : o && !r ? {
|
|
224
224
|
element: {
|
|
225
|
-
labelName:
|
|
225
|
+
labelName: i == null ? void 0 : i.terms,
|
|
226
226
|
value: String(t.effectiveFrom),
|
|
227
227
|
howToSetTheDecision: O.EQUAL,
|
|
228
228
|
decisionDataType: k.DATE
|
|
229
229
|
},
|
|
230
230
|
valueData: R({
|
|
231
|
-
labelName:
|
|
231
|
+
labelName: i == null ? void 0 : i.terms,
|
|
232
232
|
value: String(t.effectiveFrom),
|
|
233
233
|
howToSetTheDecision: O.EQUAL,
|
|
234
234
|
decisionDataType: k.DATE
|
|
235
235
|
})
|
|
236
|
-
} : null,
|
|
236
|
+
} : null, l = t ? {
|
|
237
237
|
labelName: t.labelName || "",
|
|
238
238
|
decisionDataType: t.decisionDataType || "alphabetical",
|
|
239
239
|
value: R(t),
|
|
240
240
|
howToSetTheDecision: t.howToSetTheDecision || "EqualTo"
|
|
241
241
|
} : null, s = ((b = t == null ? void 0 : t.conditionsThatEstablishesTheDecision) == null ? void 0 : b.filter(
|
|
242
242
|
(T) => !T.hidden
|
|
243
|
-
)) || [], g = Array.from({ length: 5 }),
|
|
244
|
-
return /* @__PURE__ */
|
|
243
|
+
)) || [], g = Array.from({ length: 5 }), c = !!(!n && t && i && l), d = s.length < 2 ? "start" : "space-between";
|
|
244
|
+
return /* @__PURE__ */ a(
|
|
245
245
|
Oe,
|
|
246
246
|
{
|
|
247
|
-
conditionsAlignment:
|
|
247
|
+
conditionsAlignment: d,
|
|
248
248
|
decision: t,
|
|
249
|
-
decisionDateElement:
|
|
250
|
-
decisionMapper:
|
|
251
|
-
loading:
|
|
249
|
+
decisionDateElement: u,
|
|
250
|
+
decisionMapper: l,
|
|
251
|
+
loading: c,
|
|
252
252
|
skeleton: g,
|
|
253
|
-
terms: !!(
|
|
254
|
-
textValues:
|
|
253
|
+
terms: !!(i != null && i.terms),
|
|
254
|
+
textValues: i,
|
|
255
255
|
visibleConditions: s
|
|
256
256
|
}
|
|
257
257
|
);
|
|
258
|
-
}, Ve =
|
|
258
|
+
}, Ve = y.div`
|
|
259
259
|
position: relative;
|
|
260
260
|
& > div {
|
|
261
261
|
padding: 24px 16px;
|
|
262
262
|
}
|
|
263
|
-
`,
|
|
263
|
+
`, ze = y.div`
|
|
264
264
|
background-color: ${({ theme: e }) => {
|
|
265
265
|
var t, n;
|
|
266
266
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || w.palette.neutral.N0;
|
|
@@ -291,24 +291,24 @@ const Le = {
|
|
|
291
291
|
background-color: #ebecf0;
|
|
292
292
|
border-radius: 8px;
|
|
293
293
|
}
|
|
294
|
-
`,
|
|
295
|
-
const { children: t, portalId: n, onCloseModal:
|
|
296
|
-
if (!
|
|
294
|
+
`, _e = (e) => {
|
|
295
|
+
const { children: t, portalId: n, onCloseModal: i, title: o } = e, r = document.getElementById(n);
|
|
296
|
+
if (!r)
|
|
297
297
|
throw new Error(
|
|
298
298
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
299
299
|
);
|
|
300
|
-
const
|
|
300
|
+
const u = A("(max-width: 400px)");
|
|
301
301
|
return ce(
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
/* @__PURE__ */
|
|
305
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ a(Ve, { smallScreen: u, children: /* @__PURE__ */ a(re, { children: /* @__PURE__ */ a(ze, { children: /* @__PURE__ */ h(p, { direction: "column", gap: "24px", children: [
|
|
303
|
+
/* @__PURE__ */ a(p, { direction: "column", gap: "24px", children: /* @__PURE__ */ h(p, { alignItems: "center", justifyContent: "space-between", children: [
|
|
304
|
+
/* @__PURE__ */ a(f, { type: "title", size: "large", appearance: "dark", weight: "bold", children: o }),
|
|
305
|
+
/* @__PURE__ */ a(ne, { size: "24px", cursor: "pointer", onClick: i })
|
|
306
306
|
] }) }),
|
|
307
307
|
t
|
|
308
308
|
] }) }) }) }),
|
|
309
|
-
|
|
309
|
+
r
|
|
310
310
|
);
|
|
311
|
-
},
|
|
311
|
+
}, Ue = ve`
|
|
312
312
|
from {
|
|
313
313
|
opacity: 0;
|
|
314
314
|
transform: translateY(20px);
|
|
@@ -318,7 +318,7 @@ const Le = {
|
|
|
318
318
|
transform: translateY(0);
|
|
319
319
|
}
|
|
320
320
|
`;
|
|
321
|
-
|
|
321
|
+
y.div`
|
|
322
322
|
border-radius: 8px;
|
|
323
323
|
border: 1px solid
|
|
324
324
|
${({ theme: e }) => {
|
|
@@ -332,7 +332,7 @@ f.div`
|
|
|
332
332
|
height: 100%;
|
|
333
333
|
box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
|
|
334
334
|
`;
|
|
335
|
-
|
|
335
|
+
y.div`
|
|
336
336
|
& > div {
|
|
337
337
|
border-radius: 8px;
|
|
338
338
|
border: 1px solid
|
|
@@ -342,7 +342,7 @@ f.div`
|
|
|
342
342
|
}};
|
|
343
343
|
}
|
|
344
344
|
`;
|
|
345
|
-
const je =
|
|
345
|
+
const je = y.div`
|
|
346
346
|
& > div {
|
|
347
347
|
background-color: ${({ theme: e }) => {
|
|
348
348
|
var t, n;
|
|
@@ -354,18 +354,18 @@ const je = f.div`
|
|
|
354
354
|
width: 100%;
|
|
355
355
|
height: 100%;
|
|
356
356
|
padding-bottom: 12px;
|
|
357
|
-
`, pe =
|
|
357
|
+
`, pe = y.div`
|
|
358
358
|
width: 100%;
|
|
359
359
|
height: 100%;
|
|
360
360
|
& > div {
|
|
361
|
-
animation: ${
|
|
361
|
+
animation: ${Ue} 600ms ease-out;
|
|
362
362
|
}
|
|
363
|
-
`, qe =
|
|
363
|
+
`, qe = y.div`
|
|
364
364
|
& > div > div {
|
|
365
365
|
border-radius: 8px;
|
|
366
366
|
box-sizing: border-box;
|
|
367
367
|
}
|
|
368
|
-
`, Be =
|
|
368
|
+
`, Be = y.div`
|
|
369
369
|
& > div {
|
|
370
370
|
width: 100%;
|
|
371
371
|
height: 100%;
|
|
@@ -388,7 +388,7 @@ const je = f.div`
|
|
|
388
388
|
`;
|
|
389
389
|
function He(e) {
|
|
390
390
|
const { index: t, handleOpenModal: n } = e;
|
|
391
|
-
return /* @__PURE__ */
|
|
391
|
+
return /* @__PURE__ */ a(
|
|
392
392
|
P,
|
|
393
393
|
{
|
|
394
394
|
id: `loading-card-${t}`,
|
|
@@ -396,23 +396,23 @@ function He(e) {
|
|
|
396
396
|
},
|
|
397
397
|
handleView: () => n ? n() : null,
|
|
398
398
|
controls: !1,
|
|
399
|
-
children: /* @__PURE__ */
|
|
399
|
+
children: /* @__PURE__ */ a(ue, { loading: !0 })
|
|
400
400
|
},
|
|
401
401
|
`loading-card-${t}`
|
|
402
402
|
);
|
|
403
403
|
}
|
|
404
404
|
function Pe(e) {
|
|
405
|
-
const { decision: t, controls: n, handleOpenModal:
|
|
406
|
-
return t ? /* @__PURE__ */
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
-
/* @__PURE__ */
|
|
405
|
+
const { decision: t, controls: n, handleOpenModal: i, handleDelete: o, textValues: r } = e;
|
|
406
|
+
return t ? /* @__PURE__ */ a(pe, { children: /* @__PURE__ */ h(p, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
|
|
407
|
+
/* @__PURE__ */ a(f, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
|
|
408
|
+
/* @__PURE__ */ a(
|
|
409
409
|
P,
|
|
410
410
|
{
|
|
411
411
|
id: t.decisionId,
|
|
412
|
-
handleDelete: () =>
|
|
413
|
-
handleView: () =>
|
|
412
|
+
handleDelete: () => o ? o(t.decisionId) : null,
|
|
413
|
+
handleView: () => i ? i(t) : null,
|
|
414
414
|
controls: n,
|
|
415
|
-
children: /* @__PURE__ */
|
|
415
|
+
children: /* @__PURE__ */ a(ue, { decision: t, textValues: r })
|
|
416
416
|
}
|
|
417
417
|
)
|
|
418
418
|
] }) }, t.decisionId) : null;
|
|
@@ -421,26 +421,26 @@ function Ge(e) {
|
|
|
421
421
|
const {
|
|
422
422
|
customTitleContentAddCard: t,
|
|
423
423
|
index: n,
|
|
424
|
-
handleOpenModal:
|
|
425
|
-
shouldRenderEmptyMessage:
|
|
426
|
-
} = e,
|
|
427
|
-
return /* @__PURE__ */
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */
|
|
424
|
+
handleOpenModal: i,
|
|
425
|
+
shouldRenderEmptyMessage: o
|
|
426
|
+
} = e, r = t || "Agregar decisión";
|
|
427
|
+
return /* @__PURE__ */ a(pe, { children: o ? null : /* @__PURE__ */ h(p, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
|
|
428
|
+
/* @__PURE__ */ a(f, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
|
|
429
|
+
/* @__PURE__ */ a(
|
|
430
430
|
je,
|
|
431
431
|
{
|
|
432
|
-
onClick: () =>
|
|
433
|
-
children: /* @__PURE__ */
|
|
432
|
+
onClick: () => i ? i() : null,
|
|
433
|
+
children: /* @__PURE__ */ a(
|
|
434
434
|
P,
|
|
435
435
|
{
|
|
436
436
|
id: `add-decision-${n}`,
|
|
437
437
|
handleDelete: () => {
|
|
438
438
|
},
|
|
439
|
-
handleView: () =>
|
|
439
|
+
handleView: () => i ? i() : null,
|
|
440
440
|
controls: !1,
|
|
441
|
-
children: /* @__PURE__ */ h(
|
|
442
|
-
/* @__PURE__ */
|
|
443
|
-
/* @__PURE__ */
|
|
441
|
+
children: /* @__PURE__ */ h(p, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
442
|
+
/* @__PURE__ */ a(M, { appearance: "gray", icon: /* @__PURE__ */ a(ae, {}), size: "35px" }),
|
|
443
|
+
/* @__PURE__ */ a(f, { appearance: "gray", type: "body", size: "large", children: r })
|
|
444
444
|
] })
|
|
445
445
|
}
|
|
446
446
|
)
|
|
@@ -459,63 +459,63 @@ const Qe = {
|
|
|
459
459
|
const {
|
|
460
460
|
controls: t,
|
|
461
461
|
customTitleContentAddCard: n,
|
|
462
|
-
decisions:
|
|
463
|
-
loading:
|
|
464
|
-
handleOpenModal:
|
|
465
|
-
handleDelete:
|
|
466
|
-
textValues:
|
|
467
|
-
} = e, s =
|
|
468
|
-
(
|
|
462
|
+
decisions: i,
|
|
463
|
+
loading: o,
|
|
464
|
+
handleOpenModal: r,
|
|
465
|
+
handleDelete: u,
|
|
466
|
+
textValues: l
|
|
467
|
+
} = e, s = o ? Array.from({ length: 3 }).map(
|
|
468
|
+
(c, d) => B({
|
|
469
469
|
type: "loading",
|
|
470
|
-
index:
|
|
470
|
+
index: d,
|
|
471
471
|
controls: t,
|
|
472
472
|
customTitleContentAddCard: n,
|
|
473
|
-
loading:
|
|
474
|
-
handleOpenModal:
|
|
475
|
-
handleDelete:
|
|
476
|
-
textValues:
|
|
473
|
+
loading: o,
|
|
474
|
+
handleOpenModal: r,
|
|
475
|
+
handleDelete: u,
|
|
476
|
+
textValues: l
|
|
477
477
|
})
|
|
478
|
-
) :
|
|
479
|
-
(
|
|
478
|
+
) : i == null ? void 0 : i.map(
|
|
479
|
+
(c) => B({
|
|
480
480
|
type: "decision",
|
|
481
|
-
decision:
|
|
481
|
+
decision: c,
|
|
482
482
|
controls: t,
|
|
483
483
|
customTitleContentAddCard: n,
|
|
484
|
-
loading:
|
|
485
|
-
handleOpenModal:
|
|
486
|
-
handleDelete:
|
|
487
|
-
textValues:
|
|
484
|
+
loading: o,
|
|
485
|
+
handleOpenModal: r,
|
|
486
|
+
handleDelete: u,
|
|
487
|
+
textValues: l
|
|
488
488
|
})
|
|
489
|
-
), g = ((
|
|
489
|
+
), g = ((i == null ? void 0 : i.length) === 0 || i.length < Math.floor(window.innerWidth / 300)) && !o && t;
|
|
490
490
|
return { renderedCards: s, shouldRenderAddCard: g };
|
|
491
491
|
}, kt = (e) => {
|
|
492
492
|
const {
|
|
493
493
|
controls: t = !0,
|
|
494
494
|
customTitleContentAddCard: n,
|
|
495
|
-
customMessageEmptyDecisions:
|
|
496
|
-
decisions:
|
|
497
|
-
textValues:
|
|
498
|
-
decisionTemplate:
|
|
499
|
-
isModalOpen:
|
|
495
|
+
customMessageEmptyDecisions: i,
|
|
496
|
+
decisions: o,
|
|
497
|
+
textValues: r,
|
|
498
|
+
decisionTemplate: u,
|
|
499
|
+
isModalOpen: l,
|
|
500
500
|
selectedDecision: s,
|
|
501
501
|
loading: g,
|
|
502
|
-
handleOpenModal:
|
|
503
|
-
handleCloseModal:
|
|
502
|
+
handleOpenModal: c,
|
|
503
|
+
handleCloseModal: d,
|
|
504
504
|
handleSubmitForm: b,
|
|
505
505
|
handleDelete: T,
|
|
506
506
|
terms: m = !0
|
|
507
|
-
} = e, v = A("(max-width: 681px)"), C = A("(max-width: 400px)"), { renderedCards: F, shouldRenderAddCard:
|
|
507
|
+
} = e, v = A("(max-width: 681px)"), C = A("(max-width: 400px)"), { renderedCards: F, shouldRenderAddCard: _ } = Ye({
|
|
508
508
|
controls: t,
|
|
509
509
|
customTitleContentAddCard: n,
|
|
510
|
-
decisions:
|
|
510
|
+
decisions: o,
|
|
511
511
|
loading: g,
|
|
512
|
-
handleOpenModal:
|
|
512
|
+
handleOpenModal: c,
|
|
513
513
|
handleDelete: T,
|
|
514
|
-
textValues:
|
|
515
|
-
}), L = (
|
|
514
|
+
textValues: r
|
|
515
|
+
}), L = (o == null ? void 0 : o.length) === 0 && !g;
|
|
516
516
|
return /* @__PURE__ */ h(D, { children: [
|
|
517
|
-
/* @__PURE__ */
|
|
518
|
-
|
|
517
|
+
/* @__PURE__ */ a(qe, { children: /* @__PURE__ */ a(Be, { children: /* @__PURE__ */ a(p, { direction: "column", gap: "16px", padding: "6px", children: L ? /* @__PURE__ */ h(
|
|
518
|
+
p,
|
|
519
519
|
{
|
|
520
520
|
direction: "column",
|
|
521
521
|
gap: "28px",
|
|
@@ -524,10 +524,10 @@ const Qe = {
|
|
|
524
524
|
justifyContent: "center",
|
|
525
525
|
alignItems: "center",
|
|
526
526
|
children: [
|
|
527
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ a(f, { as: "span", type: "label", size: "large", appearance: "gray", children: i || /* @__PURE__ */ h(D, { children: [
|
|
528
528
|
"Aún NO tienes definidas tasas de interés efectivas . Presiona",
|
|
529
529
|
/* @__PURE__ */ h(
|
|
530
|
-
|
|
530
|
+
f,
|
|
531
531
|
{
|
|
532
532
|
as: "span",
|
|
533
533
|
type: "label",
|
|
@@ -543,11 +543,11 @@ const Qe = {
|
|
|
543
543
|
),
|
|
544
544
|
"para empezar."
|
|
545
545
|
] }) }),
|
|
546
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ a(
|
|
547
547
|
N,
|
|
548
548
|
{
|
|
549
|
-
iconBefore: /* @__PURE__ */
|
|
550
|
-
onClick: () =>
|
|
549
|
+
iconBefore: /* @__PURE__ */ a(ae, {}),
|
|
550
|
+
onClick: () => c ? c() : null,
|
|
551
551
|
children: n || "Agregar decisión"
|
|
552
552
|
}
|
|
553
553
|
)
|
|
@@ -567,42 +567,42 @@ const Qe = {
|
|
|
567
567
|
height: v ? "auto" : "484px",
|
|
568
568
|
children: [
|
|
569
569
|
F,
|
|
570
|
-
|
|
570
|
+
_ && B({
|
|
571
571
|
type: "add",
|
|
572
|
-
index:
|
|
572
|
+
index: o == null ? void 0 : o.length,
|
|
573
573
|
controls: t,
|
|
574
574
|
customTitleContentAddCard: n,
|
|
575
|
-
customMessageEmptyDecisions:
|
|
575
|
+
customMessageEmptyDecisions: i,
|
|
576
576
|
loading: g,
|
|
577
|
-
handleOpenModal:
|
|
577
|
+
handleOpenModal: c,
|
|
578
578
|
handleDelete: T,
|
|
579
|
-
textValues:
|
|
579
|
+
textValues: r,
|
|
580
580
|
shouldRenderEmptyMessage: L,
|
|
581
581
|
terms: m
|
|
582
582
|
})
|
|
583
583
|
]
|
|
584
584
|
}
|
|
585
585
|
) }) }) }),
|
|
586
|
-
|
|
587
|
-
|
|
586
|
+
l && /* @__PURE__ */ a(
|
|
587
|
+
_e,
|
|
588
588
|
{
|
|
589
589
|
portalId: "modal-portal",
|
|
590
|
-
onCloseModal:
|
|
590
|
+
onCloseModal: d,
|
|
591
591
|
title: s ? "Editar Decisión" : "Nueva decisión",
|
|
592
|
-
children: /* @__PURE__ */
|
|
592
|
+
children: /* @__PURE__ */ a(
|
|
593
593
|
st,
|
|
594
594
|
{
|
|
595
|
-
decision: s ||
|
|
595
|
+
decision: s || u,
|
|
596
596
|
onSubmitEvent: b,
|
|
597
|
-
textValues:
|
|
598
|
-
onCancel: () =>
|
|
597
|
+
textValues: r,
|
|
598
|
+
onCancel: () => d ? d() : () => {
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
601
|
)
|
|
602
602
|
}
|
|
603
603
|
)
|
|
604
604
|
] });
|
|
605
|
-
}, Ke =
|
|
605
|
+
}, Ke = y.div`
|
|
606
606
|
display: flex;
|
|
607
607
|
justify-content: ${({ justifyContent: e }) => e};
|
|
608
608
|
align-items: ${({ alignItems: e }) => e};
|
|
@@ -615,12 +615,12 @@ const Qe = {
|
|
|
615
615
|
margin: ${({ margin: e }) => e};
|
|
616
616
|
padding: ${({ padding: e }) => e};
|
|
617
617
|
background: ${({ background: e, theme: t }) => {
|
|
618
|
-
var n,
|
|
619
|
-
return e ? `${((
|
|
618
|
+
var n, i, o, r;
|
|
619
|
+
return e ? `${((i = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : i.N10) || w.palette.neutral.N10}` : `${((r = (o = t == null ? void 0 : t.palette) == null ? void 0 : o.neutral) == null ? void 0 : r.N0) || w.palette.neutral.N0}`;
|
|
620
620
|
}};
|
|
621
621
|
border: ${({ border: e, theme: t }) => {
|
|
622
|
-
var n,
|
|
623
|
-
return e ? `1px solid ${((
|
|
622
|
+
var n, i;
|
|
623
|
+
return e ? `1px solid ${((i = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : i.N40) || w.palette.neutral.N40}` : "none";
|
|
624
624
|
}};
|
|
625
625
|
border-radius: ${({ borderRadius: e }) => e};
|
|
626
626
|
box-sizing: ${({ boxSizing: e }) => e};
|
|
@@ -629,46 +629,53 @@ const Qe = {
|
|
|
629
629
|
const {
|
|
630
630
|
children: t,
|
|
631
631
|
wrap: n,
|
|
632
|
-
direction:
|
|
633
|
-
justifyContent:
|
|
634
|
-
alignItems:
|
|
635
|
-
alignContent:
|
|
636
|
-
height:
|
|
632
|
+
direction: i = "column",
|
|
633
|
+
justifyContent: o,
|
|
634
|
+
alignItems: r,
|
|
635
|
+
alignContent: u,
|
|
636
|
+
height: l,
|
|
637
637
|
width: s,
|
|
638
638
|
gap: g,
|
|
639
|
-
background:
|
|
640
|
-
borderRadius:
|
|
639
|
+
background: c,
|
|
640
|
+
borderRadius: d,
|
|
641
641
|
border: b,
|
|
642
642
|
margin: T = "0px",
|
|
643
643
|
padding: m = "0px",
|
|
644
644
|
boxSizing: v,
|
|
645
645
|
scroll: C = !1
|
|
646
646
|
} = e;
|
|
647
|
-
return /* @__PURE__ */
|
|
647
|
+
return /* @__PURE__ */ a(
|
|
648
648
|
Ke,
|
|
649
649
|
{
|
|
650
|
-
direction:
|
|
651
|
-
justifyContent:
|
|
652
|
-
alignItems:
|
|
653
|
-
alignContent:
|
|
654
|
-
height:
|
|
650
|
+
direction: i,
|
|
651
|
+
justifyContent: o,
|
|
652
|
+
alignItems: r,
|
|
653
|
+
alignContent: u,
|
|
654
|
+
height: l,
|
|
655
655
|
width: s,
|
|
656
656
|
wrap: n,
|
|
657
657
|
gap: g,
|
|
658
|
-
background:
|
|
658
|
+
background: c,
|
|
659
659
|
border: b,
|
|
660
660
|
margin: T,
|
|
661
661
|
padding: m,
|
|
662
|
-
borderRadius:
|
|
662
|
+
borderRadius: d,
|
|
663
663
|
boxSizing: v,
|
|
664
664
|
scroll: C,
|
|
665
665
|
children: t
|
|
666
666
|
}
|
|
667
667
|
);
|
|
668
668
|
}, At = (e) => {
|
|
669
|
-
const {
|
|
670
|
-
|
|
671
|
-
|
|
669
|
+
const {
|
|
670
|
+
appliedFilters: t,
|
|
671
|
+
onClear: n,
|
|
672
|
+
onClick: i,
|
|
673
|
+
noFiltersLabel: o,
|
|
674
|
+
titleClearFilter: r,
|
|
675
|
+
titleFilter: u
|
|
676
|
+
} = e, l = !t || t.length === 0;
|
|
677
|
+
return /* @__PURE__ */ a(ye, { borderRadius: "8px", width: "100%", children: /* @__PURE__ */ h(le, { gap: "12px", templateColumns: "1fr auto auto", width: "100%", children: [
|
|
678
|
+
/* @__PURE__ */ a(
|
|
672
679
|
ge,
|
|
673
680
|
{
|
|
674
681
|
background: !0,
|
|
@@ -678,43 +685,44 @@ const Qe = {
|
|
|
678
685
|
gap: "8px",
|
|
679
686
|
alignItems: "center",
|
|
680
687
|
padding: "0px 8px",
|
|
681
|
-
|
|
688
|
+
border: !0,
|
|
689
|
+
children: l ? /* @__PURE__ */ a(f, { size: "small", type: "label", appearance: "gray", children: o }) : t == null ? void 0 : t.map((s) => /* @__PURE__ */ a(
|
|
682
690
|
se,
|
|
683
691
|
{
|
|
684
692
|
appearance: "primary",
|
|
685
693
|
displayIcon: !0,
|
|
686
694
|
removable: !0,
|
|
687
|
-
icon:
|
|
688
|
-
label:
|
|
689
|
-
onClose:
|
|
695
|
+
icon: s.icon,
|
|
696
|
+
label: s.label,
|
|
697
|
+
onClose: s.onClose
|
|
690
698
|
},
|
|
691
|
-
|
|
699
|
+
s.label
|
|
692
700
|
))
|
|
693
701
|
}
|
|
694
702
|
),
|
|
695
|
-
/* @__PURE__ */
|
|
703
|
+
/* @__PURE__ */ a(
|
|
696
704
|
N,
|
|
697
705
|
{
|
|
698
706
|
cursorHover: !0,
|
|
699
|
-
disabled:
|
|
700
|
-
iconBefore: /* @__PURE__ */
|
|
707
|
+
disabled: l,
|
|
708
|
+
iconBefore: /* @__PURE__ */ a(ie, {}),
|
|
701
709
|
onClick: n,
|
|
702
710
|
variant: "outlined",
|
|
703
711
|
children: r
|
|
704
712
|
}
|
|
705
713
|
),
|
|
706
|
-
/* @__PURE__ */
|
|
714
|
+
/* @__PURE__ */ a(
|
|
707
715
|
N,
|
|
708
716
|
{
|
|
709
717
|
cursorHover: !0,
|
|
710
|
-
iconBefore: /* @__PURE__ */
|
|
711
|
-
onClick:
|
|
718
|
+
iconBefore: /* @__PURE__ */ a(oe, {}),
|
|
719
|
+
onClick: i,
|
|
712
720
|
variant: "outlined",
|
|
713
|
-
children:
|
|
721
|
+
children: u
|
|
714
722
|
}
|
|
715
723
|
)
|
|
716
724
|
] }) });
|
|
717
|
-
}, We =
|
|
725
|
+
}, We = y.div`
|
|
718
726
|
display: flex;
|
|
719
727
|
flex-direction: column;
|
|
720
728
|
background-color: ${({ theme: e }) => {
|
|
@@ -731,56 +739,56 @@ const Qe = {
|
|
|
731
739
|
const {
|
|
732
740
|
actionButtonLabel: t,
|
|
733
741
|
cancelButtonLabel: n,
|
|
734
|
-
children:
|
|
735
|
-
loading:
|
|
736
|
-
onClick:
|
|
737
|
-
onCloseModal:
|
|
738
|
-
portalId:
|
|
742
|
+
children: i,
|
|
743
|
+
loading: o,
|
|
744
|
+
onClick: r,
|
|
745
|
+
onCloseModal: u,
|
|
746
|
+
portalId: l,
|
|
739
747
|
title: s
|
|
740
|
-
} = e, g = A("(max-width: 768px)"),
|
|
741
|
-
if (!
|
|
748
|
+
} = e, g = A("(max-width: 768px)"), c = document.getElementById(l);
|
|
749
|
+
if (!c)
|
|
742
750
|
throw new Error(
|
|
743
751
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
744
752
|
);
|
|
745
753
|
return ce(
|
|
746
|
-
/* @__PURE__ */
|
|
747
|
-
/* @__PURE__ */ h(
|
|
748
|
-
/* @__PURE__ */ h(
|
|
749
|
-
/* @__PURE__ */
|
|
750
|
-
/* @__PURE__ */ h(
|
|
751
|
-
/* @__PURE__ */
|
|
752
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ a(re, { children: /* @__PURE__ */ h(We, { $smallScreen: g, children: [
|
|
755
|
+
/* @__PURE__ */ h(p, { direction: "column", gap: "16px", children: [
|
|
756
|
+
/* @__PURE__ */ h(p, { alignContent: "center", justifyContent: "space-between", children: [
|
|
757
|
+
/* @__PURE__ */ a(f, { appearance: "dark", size: "small", type: "headline", children: s }),
|
|
758
|
+
/* @__PURE__ */ h(p, { alignItems: "center", children: [
|
|
759
|
+
/* @__PURE__ */ a(f, { children: "Cerrar" }),
|
|
760
|
+
/* @__PURE__ */ a(
|
|
753
761
|
M,
|
|
754
762
|
{
|
|
755
763
|
appearance: "dark",
|
|
756
|
-
icon: /* @__PURE__ */
|
|
757
|
-
onClick:
|
|
764
|
+
icon: /* @__PURE__ */ a(ne, {}),
|
|
765
|
+
onClick: u,
|
|
758
766
|
cursorHover: !0
|
|
759
767
|
}
|
|
760
768
|
)
|
|
761
769
|
] })
|
|
762
770
|
] }),
|
|
763
|
-
/* @__PURE__ */
|
|
771
|
+
/* @__PURE__ */ a(S, {})
|
|
764
772
|
] }),
|
|
765
|
-
|
|
766
|
-
/* @__PURE__ */ h(
|
|
767
|
-
/* @__PURE__ */
|
|
773
|
+
i,
|
|
774
|
+
/* @__PURE__ */ h(p, { gap: "20px", justifyContent: "flex-end", children: [
|
|
775
|
+
/* @__PURE__ */ a(
|
|
768
776
|
N,
|
|
769
777
|
{
|
|
770
778
|
appearance: "gray",
|
|
771
|
-
onClick:
|
|
772
|
-
iconBefore: /* @__PURE__ */
|
|
779
|
+
onClick: u,
|
|
780
|
+
iconBefore: /* @__PURE__ */ a(ie, {}),
|
|
773
781
|
spacing: "wide",
|
|
774
782
|
variant: "outlined",
|
|
775
783
|
children: n
|
|
776
784
|
}
|
|
777
785
|
),
|
|
778
|
-
/* @__PURE__ */
|
|
786
|
+
/* @__PURE__ */ a(
|
|
779
787
|
N,
|
|
780
788
|
{
|
|
781
789
|
appearance: "primary",
|
|
782
|
-
loading:
|
|
783
|
-
onClick:
|
|
790
|
+
loading: o,
|
|
791
|
+
onClick: r,
|
|
784
792
|
spacing: "wide",
|
|
785
793
|
variant: "filled",
|
|
786
794
|
children: t
|
|
@@ -788,63 +796,67 @@ const Qe = {
|
|
|
788
796
|
)
|
|
789
797
|
] })
|
|
790
798
|
] }) }),
|
|
791
|
-
|
|
799
|
+
c
|
|
792
800
|
);
|
|
793
801
|
}, $t = (e) => {
|
|
794
|
-
const { appliedFilters: t, fields: n, onChange:
|
|
795
|
-
return /* @__PURE__ */ h(
|
|
796
|
-
r &&
|
|
797
|
-
/* @__PURE__ */ h(
|
|
798
|
-
/* @__PURE__ */
|
|
799
|
-
/* @__PURE__ */
|
|
802
|
+
const { appliedFilters: t, fields: n, onChange: i, noFiltersLabel: o } = e, r = A("(max-width: 768px)"), u = !t || t.length === 0;
|
|
803
|
+
return /* @__PURE__ */ h(p, { direction: "column", gap: "16px", children: [
|
|
804
|
+
r && /* @__PURE__ */ h(D, { children: [
|
|
805
|
+
/* @__PURE__ */ h(p, { gap: "6px", width: "100%", alignItems: "center", children: [
|
|
806
|
+
/* @__PURE__ */ a(M, { appearance: "gray", icon: /* @__PURE__ */ a(oe, {}) }),
|
|
807
|
+
/* @__PURE__ */ a(
|
|
800
808
|
ge,
|
|
801
809
|
{
|
|
802
810
|
background: !0,
|
|
803
811
|
borderRadius: "8px",
|
|
804
|
-
height: "100%",
|
|
805
812
|
direction: "row",
|
|
806
813
|
gap: "8px",
|
|
807
814
|
alignItems: "center",
|
|
808
815
|
padding: "0px 8px",
|
|
809
|
-
|
|
816
|
+
border: !0,
|
|
817
|
+
width: "100%",
|
|
818
|
+
height: "32px",
|
|
819
|
+
children: u ? /* @__PURE__ */ a(f, { size: "small", type: "label", appearance: "gray", children: o }) : t == null ? void 0 : t.map((l) => /* @__PURE__ */ a(
|
|
810
820
|
se,
|
|
811
821
|
{
|
|
812
822
|
appearance: "primary",
|
|
813
823
|
displayIcon: !0,
|
|
814
|
-
icon:
|
|
815
|
-
label:
|
|
824
|
+
icon: l.icon,
|
|
825
|
+
label: l.label,
|
|
826
|
+
onClose: l.onClose,
|
|
827
|
+
removable: !0
|
|
816
828
|
},
|
|
817
|
-
|
|
829
|
+
l.label
|
|
818
830
|
))
|
|
819
831
|
}
|
|
820
832
|
)
|
|
821
833
|
] }),
|
|
822
|
-
/* @__PURE__ */
|
|
823
|
-
] })
|
|
824
|
-
n.map((
|
|
825
|
-
/* @__PURE__ */
|
|
826
|
-
/* @__PURE__ */
|
|
834
|
+
/* @__PURE__ */ a(S, { dashed: !0 })
|
|
835
|
+
] }),
|
|
836
|
+
n.map((l) => /* @__PURE__ */ h(p, { gap: "6px", alignItems: "center", children: [
|
|
837
|
+
/* @__PURE__ */ a(p, { padding: "22px 0 0 0", children: /* @__PURE__ */ a(M, { appearance: "primary", icon: l.icon }) }),
|
|
838
|
+
/* @__PURE__ */ a(
|
|
827
839
|
xe,
|
|
828
840
|
{
|
|
829
|
-
disabled:
|
|
830
|
-
invalid:
|
|
831
|
-
label:
|
|
832
|
-
message:
|
|
833
|
-
name:
|
|
834
|
-
onChange:
|
|
835
|
-
options:
|
|
836
|
-
placeholder:
|
|
837
|
-
required:
|
|
838
|
-
values:
|
|
841
|
+
disabled: l.disabled,
|
|
842
|
+
invalid: l.invalid,
|
|
843
|
+
label: l.label,
|
|
844
|
+
message: l.message,
|
|
845
|
+
name: l.name,
|
|
846
|
+
onChange: i,
|
|
847
|
+
options: l.options,
|
|
848
|
+
placeholder: l.placeholder,
|
|
849
|
+
required: l.required,
|
|
850
|
+
values: l.values,
|
|
839
851
|
fullwidth: !0
|
|
840
852
|
},
|
|
841
|
-
|
|
853
|
+
l.name
|
|
842
854
|
)
|
|
843
|
-
] },
|
|
855
|
+
] }, l.name))
|
|
844
856
|
] });
|
|
845
857
|
}, It = (e) => {
|
|
846
858
|
console.log(e);
|
|
847
|
-
const { dataDecision: t, originalDecision: n } = e,
|
|
859
|
+
const { dataDecision: t, originalDecision: n } = e, i = {
|
|
848
860
|
conditionName: t.ruleName || "",
|
|
849
861
|
labelName: t.labelName || "",
|
|
850
862
|
conditionDataType: t.decisionDataType || "alphabetical",
|
|
@@ -856,17 +868,17 @@ const Qe = {
|
|
|
856
868
|
return {
|
|
857
869
|
...n,
|
|
858
870
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
859
|
-
(
|
|
871
|
+
(o) => o.hidden ? { ...i } : o
|
|
860
872
|
)
|
|
861
873
|
};
|
|
862
874
|
}, Rt = (e) => {
|
|
863
875
|
const { decisions: t } = e;
|
|
864
876
|
return t == null ? void 0 : t.map((n) => {
|
|
865
|
-
var
|
|
866
|
-
const
|
|
867
|
-
(
|
|
877
|
+
var o;
|
|
878
|
+
const i = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
|
|
879
|
+
(r) => r.hidden
|
|
868
880
|
);
|
|
869
|
-
return
|
|
881
|
+
return i ? {
|
|
870
882
|
...n,
|
|
871
883
|
ruleName: n.ruleName,
|
|
872
884
|
labelName: n.labelName,
|
|
@@ -874,7 +886,7 @@ const Qe = {
|
|
|
874
886
|
value: n.value,
|
|
875
887
|
howToSetTheDecision: n.howToSetTheDecision,
|
|
876
888
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
877
|
-
(
|
|
889
|
+
(r) => r.hidden ? { ...i, hidden: !1 } : r
|
|
878
890
|
)
|
|
879
891
|
} : n;
|
|
880
892
|
});
|
|
@@ -911,9 +923,9 @@ const Qe = {
|
|
|
911
923
|
to: q().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
|
|
912
924
|
"is-greater",
|
|
913
925
|
"To value must be greater than From value",
|
|
914
|
-
function(
|
|
915
|
-
const { from:
|
|
916
|
-
return
|
|
926
|
+
function(i) {
|
|
927
|
+
const { from: o } = this.parent;
|
|
928
|
+
return i > o;
|
|
917
929
|
}
|
|
918
930
|
)
|
|
919
931
|
}),
|
|
@@ -926,19 +938,19 @@ const Qe = {
|
|
|
926
938
|
schema: H().required("Required"),
|
|
927
939
|
value: e
|
|
928
940
|
}, tt = {
|
|
929
|
-
[
|
|
930
|
-
[
|
|
931
|
-
[
|
|
932
|
-
[
|
|
933
|
-
[
|
|
934
|
-
[
|
|
941
|
+
[x.LIST_OF_VALUES]: Xe,
|
|
942
|
+
[x.LIST_OF_VALUES_MULTI]: Ze,
|
|
943
|
+
[x.RANGE]: et,
|
|
944
|
+
[x.GREATER_THAN]: j,
|
|
945
|
+
[x.LESS_THAN]: j,
|
|
946
|
+
[x.EQUAL]: j
|
|
935
947
|
}, Z = (e) => tt[e] || Je;
|
|
936
948
|
function nt({
|
|
937
949
|
decision: e,
|
|
938
950
|
onSubmitEvent: t,
|
|
939
951
|
textValues: n
|
|
940
952
|
}) {
|
|
941
|
-
const
|
|
953
|
+
const i = {
|
|
942
954
|
ruleName: e.ruleName || "",
|
|
943
955
|
decisionDataType: e.decisionDataType || k.ALPHABETICAL,
|
|
944
956
|
howToSetTheDecision: e.howToSetTheDecision || "",
|
|
@@ -950,21 +962,21 @@ function nt({
|
|
|
950
962
|
checkClosed: !1,
|
|
951
963
|
terms: !0
|
|
952
964
|
};
|
|
953
|
-
let
|
|
954
|
-
const
|
|
965
|
+
let o;
|
|
966
|
+
const r = {
|
|
955
967
|
ruleName: H().required("Name is required"),
|
|
956
968
|
value: K(() => Z(
|
|
957
|
-
|
|
969
|
+
o.values.howToSetTheDecision
|
|
958
970
|
)(
|
|
959
|
-
|
|
960
|
-
|
|
971
|
+
o.values.value,
|
|
972
|
+
o.values.decisionDataType
|
|
961
973
|
).schema),
|
|
962
974
|
conditionsThatEstablishesTheDecision: K((s, { parent: g }) => {
|
|
963
975
|
var b;
|
|
964
976
|
if ((g == null ? void 0 : g.toggleNone) && Object.keys(g.conditionsThatEstablishesTheDecision || {}).length > 0) return V().shape({});
|
|
965
|
-
const
|
|
977
|
+
const d = (b = e.conditionsThatEstablishesTheDecision) == null ? void 0 : b.reduce(
|
|
966
978
|
(T, m) => {
|
|
967
|
-
if (
|
|
979
|
+
if (o.values.conditionsThatEstablishesTheDecision[m.conditionName] !== void 0) {
|
|
968
980
|
const C = Z(
|
|
969
981
|
m.howToSetTheCondition
|
|
970
982
|
);
|
|
@@ -977,7 +989,7 @@ function nt({
|
|
|
977
989
|
},
|
|
978
990
|
{}
|
|
979
991
|
);
|
|
980
|
-
return V(
|
|
992
|
+
return V(d).test(
|
|
981
993
|
"at-least-one-condition",
|
|
982
994
|
"It must be at least one condition in order for the decision to be validated correctly.",
|
|
983
995
|
(T) => T ? Object.values(T).some(
|
|
@@ -986,11 +998,11 @@ function nt({
|
|
|
986
998
|
);
|
|
987
999
|
})
|
|
988
1000
|
};
|
|
989
|
-
n.terms && (
|
|
1001
|
+
n.terms && (r.effectiveFrom = W().required(
|
|
990
1002
|
"effective From date is required"
|
|
991
|
-
),
|
|
1003
|
+
), r.validUntil = W().when(
|
|
992
1004
|
"checkClosed",
|
|
993
|
-
(s, g, { parent:
|
|
1005
|
+
(s, g, { parent: c }) => (c == null ? void 0 : c.checkClosed) ? g.required("valid Until date is required").test(
|
|
994
1006
|
"is-after-startDate",
|
|
995
1007
|
"valid Until date must be greater than or equal to Start date",
|
|
996
1008
|
function(b) {
|
|
@@ -999,13 +1011,13 @@ function nt({
|
|
|
999
1011
|
}
|
|
1000
1012
|
) : g.notRequired()
|
|
1001
1013
|
));
|
|
1002
|
-
const
|
|
1003
|
-
return
|
|
1004
|
-
initialValues:
|
|
1005
|
-
validationSchema:
|
|
1014
|
+
const u = V(r);
|
|
1015
|
+
return o = Ce({
|
|
1016
|
+
initialValues: i,
|
|
1017
|
+
validationSchema: u,
|
|
1006
1018
|
validateOnBlur: !0,
|
|
1007
1019
|
onSubmit: (s) => {
|
|
1008
|
-
var
|
|
1020
|
+
var c;
|
|
1009
1021
|
const g = {
|
|
1010
1022
|
...e,
|
|
1011
1023
|
ruleName: s.ruleName,
|
|
@@ -1014,35 +1026,35 @@ function nt({
|
|
|
1014
1026
|
value: s.value,
|
|
1015
1027
|
effectiveFrom: s.effectiveFrom,
|
|
1016
1028
|
validUntil: s.validUntil,
|
|
1017
|
-
conditionsThatEstablishesTheDecision: (
|
|
1018
|
-
const b = s.conditionsThatEstablishesTheDecision[
|
|
1029
|
+
conditionsThatEstablishesTheDecision: (c = e.conditionsThatEstablishesTheDecision) == null ? void 0 : c.filter((d) => {
|
|
1030
|
+
const b = s.conditionsThatEstablishesTheDecision[d.conditionName];
|
|
1019
1031
|
return b != null && b !== "";
|
|
1020
|
-
}).map((
|
|
1021
|
-
...
|
|
1022
|
-
value: s.conditionsThatEstablishesTheDecision[
|
|
1032
|
+
}).map((d) => ({
|
|
1033
|
+
...d,
|
|
1034
|
+
value: s.conditionsThatEstablishesTheDecision[d.conditionName]
|
|
1023
1035
|
}))
|
|
1024
1036
|
};
|
|
1025
1037
|
t(g);
|
|
1026
1038
|
}
|
|
1027
|
-
}), { formik:
|
|
1039
|
+
}), { formik: o, handleToggleNoneChange: (s) => {
|
|
1028
1040
|
var g;
|
|
1029
|
-
|
|
1041
|
+
o.setFieldValue("toggleNone", s), (g = e.conditionsThatEstablishesTheDecision) == null || g.forEach((c) => {
|
|
1030
1042
|
if (s)
|
|
1031
|
-
|
|
1032
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1043
|
+
o.setFieldValue(
|
|
1044
|
+
`conditionsThatEstablishesTheDecision.${c.conditionName}`,
|
|
1033
1045
|
void 0
|
|
1034
1046
|
);
|
|
1035
1047
|
else {
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1038
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1039
|
-
|
|
1048
|
+
const d = c.howToSetTheCondition === x.LIST_OF_VALUES_MULTI ? [] : "";
|
|
1049
|
+
o.setFieldValue(
|
|
1050
|
+
`conditionsThatEstablishesTheDecision.${c.conditionName}`,
|
|
1051
|
+
d
|
|
1040
1052
|
);
|
|
1041
1053
|
}
|
|
1042
1054
|
});
|
|
1043
1055
|
} };
|
|
1044
1056
|
}
|
|
1045
|
-
const at =
|
|
1057
|
+
const at = y.div`
|
|
1046
1058
|
& > div {
|
|
1047
1059
|
border-radius: 8px;
|
|
1048
1060
|
border: 1px solid
|
|
@@ -1051,7 +1063,7 @@ const at = f.div`
|
|
|
1051
1063
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || w.palette.neutral.N30;
|
|
1052
1064
|
}};
|
|
1053
1065
|
}
|
|
1054
|
-
`, it =
|
|
1066
|
+
`, it = y.div`
|
|
1055
1067
|
width: 100%;
|
|
1056
1068
|
height: 100%;
|
|
1057
1069
|
overflow-y: auto;
|
|
@@ -1072,57 +1084,57 @@ const at = f.div`
|
|
|
1072
1084
|
const {
|
|
1073
1085
|
checked: t,
|
|
1074
1086
|
children: n,
|
|
1075
|
-
handleToggleChange:
|
|
1076
|
-
id:
|
|
1077
|
-
labelToggle:
|
|
1078
|
-
name:
|
|
1079
|
-
valueToggle:
|
|
1080
|
-
} = e, [s, g] =
|
|
1081
|
-
g(
|
|
1087
|
+
handleToggleChange: i,
|
|
1088
|
+
id: o,
|
|
1089
|
+
labelToggle: r,
|
|
1090
|
+
name: u,
|
|
1091
|
+
valueToggle: l = ""
|
|
1092
|
+
} = e, [s, g] = z(t), c = (d) => {
|
|
1093
|
+
g(d.target.checked), i(d);
|
|
1082
1094
|
};
|
|
1083
1095
|
return Se(() => {
|
|
1084
1096
|
g(t);
|
|
1085
1097
|
}, [t]), /* @__PURE__ */ h(D, { children: [
|
|
1086
|
-
/* @__PURE__ */
|
|
1098
|
+
/* @__PURE__ */ a(p, { children: /* @__PURE__ */ a(
|
|
1087
1099
|
de,
|
|
1088
1100
|
{
|
|
1089
1101
|
checked: s,
|
|
1090
|
-
id:
|
|
1091
|
-
name:
|
|
1092
|
-
onChange:
|
|
1102
|
+
id: o,
|
|
1103
|
+
name: u,
|
|
1104
|
+
onChange: c,
|
|
1093
1105
|
size: "small",
|
|
1094
|
-
value:
|
|
1095
|
-
children: /* @__PURE__ */
|
|
1106
|
+
value: l,
|
|
1107
|
+
children: /* @__PURE__ */ a(f, { size: "medium", type: "label", weight: "bold", children: r })
|
|
1096
1108
|
}
|
|
1097
1109
|
) }),
|
|
1098
|
-
s && /* @__PURE__ */
|
|
1110
|
+
s && /* @__PURE__ */ a(D, { children: n })
|
|
1099
1111
|
] });
|
|
1100
1112
|
}, rt = (e) => {
|
|
1101
1113
|
const {
|
|
1102
1114
|
onHandleStartChange: t,
|
|
1103
1115
|
onHandleEndChange: n,
|
|
1104
|
-
onCheckClosedChange:
|
|
1105
|
-
labelStart:
|
|
1106
|
-
labelEnd:
|
|
1107
|
-
checkedClosed:
|
|
1108
|
-
required:
|
|
1116
|
+
onCheckClosedChange: i,
|
|
1117
|
+
labelStart: o,
|
|
1118
|
+
labelEnd: r,
|
|
1119
|
+
checkedClosed: u = !1,
|
|
1120
|
+
required: l = !1,
|
|
1109
1121
|
valueStart: s = "",
|
|
1110
1122
|
valueEnd: g = "",
|
|
1111
|
-
messageStart:
|
|
1112
|
-
messageEnd:
|
|
1123
|
+
messageStart: c = "",
|
|
1124
|
+
messageEnd: d = "",
|
|
1113
1125
|
statusStart: b = "pending",
|
|
1114
1126
|
statusEnd: T = "pending"
|
|
1115
|
-
} = e, [m, v] =
|
|
1116
|
-
v(E.checked),
|
|
1127
|
+
} = e, [m, v] = z(u), [C, F] = z(s), [_, L] = z(g), G = ({ target: E }) => {
|
|
1128
|
+
v(E.checked), i && i(E.checked);
|
|
1117
1129
|
}, me = (E) => {
|
|
1118
1130
|
F(E.target.value), t(E);
|
|
1119
1131
|
}, be = (E) => {
|
|
1120
1132
|
L(E.target.value), n(E);
|
|
1121
1133
|
}, Te = A("(max-width: 400px)");
|
|
1122
1134
|
return /* @__PURE__ */ h(D, { children: [
|
|
1123
|
-
/* @__PURE__ */ h(
|
|
1124
|
-
/* @__PURE__ */
|
|
1125
|
-
|
|
1135
|
+
/* @__PURE__ */ h(p, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
1136
|
+
/* @__PURE__ */ a(
|
|
1137
|
+
f,
|
|
1126
1138
|
{
|
|
1127
1139
|
appearance: "gray",
|
|
1128
1140
|
margin: "10px 0",
|
|
@@ -1132,14 +1144,14 @@ const at = f.div`
|
|
|
1132
1144
|
children: "Vigencia"
|
|
1133
1145
|
}
|
|
1134
1146
|
),
|
|
1135
|
-
/* @__PURE__ */
|
|
1136
|
-
|
|
1147
|
+
/* @__PURE__ */ a(
|
|
1148
|
+
p,
|
|
1137
1149
|
{
|
|
1138
1150
|
alignContent: "center",
|
|
1139
1151
|
justifyContent: "center",
|
|
1140
1152
|
wrap: "wrap",
|
|
1141
1153
|
gap: "4px",
|
|
1142
|
-
children: /* @__PURE__ */
|
|
1154
|
+
children: /* @__PURE__ */ a(
|
|
1143
1155
|
we,
|
|
1144
1156
|
{
|
|
1145
1157
|
label: "Cerrada",
|
|
@@ -1152,36 +1164,36 @@ const at = f.div`
|
|
|
1152
1164
|
)
|
|
1153
1165
|
] }),
|
|
1154
1166
|
/* @__PURE__ */ h(
|
|
1155
|
-
|
|
1167
|
+
p,
|
|
1156
1168
|
{
|
|
1157
1169
|
direction: Te ? "column" : "row",
|
|
1158
1170
|
justifyContent: "space-between",
|
|
1159
1171
|
gap: "24px",
|
|
1160
1172
|
children: [
|
|
1161
|
-
/* @__PURE__ */
|
|
1173
|
+
/* @__PURE__ */ a(
|
|
1162
1174
|
Q,
|
|
1163
1175
|
{
|
|
1164
1176
|
id: "dateStart",
|
|
1165
|
-
label:
|
|
1177
|
+
label: o,
|
|
1166
1178
|
onChange: me,
|
|
1167
1179
|
value: C,
|
|
1168
|
-
required:
|
|
1180
|
+
required: l,
|
|
1169
1181
|
size: "compact",
|
|
1170
1182
|
status: b,
|
|
1171
|
-
message:
|
|
1183
|
+
message: c
|
|
1172
1184
|
}
|
|
1173
1185
|
),
|
|
1174
|
-
m && /* @__PURE__ */
|
|
1186
|
+
m && /* @__PURE__ */ a(
|
|
1175
1187
|
Q,
|
|
1176
1188
|
{
|
|
1177
1189
|
id: "dateEnd",
|
|
1178
|
-
label:
|
|
1190
|
+
label: r,
|
|
1179
1191
|
onChange: be,
|
|
1180
|
-
value:
|
|
1181
|
-
required:
|
|
1192
|
+
value: _,
|
|
1193
|
+
required: l,
|
|
1182
1194
|
size: "compact",
|
|
1183
1195
|
status: T,
|
|
1184
|
-
message:
|
|
1196
|
+
message: d
|
|
1185
1197
|
}
|
|
1186
1198
|
)
|
|
1187
1199
|
]
|
|
@@ -1192,24 +1204,24 @@ const at = f.div`
|
|
|
1192
1204
|
const {
|
|
1193
1205
|
formik: t,
|
|
1194
1206
|
textValues: n,
|
|
1195
|
-
onCancel:
|
|
1196
|
-
visibleConditions:
|
|
1197
|
-
normalizedDecision:
|
|
1198
|
-
handleToggleNoneChange:
|
|
1199
|
-
handleConditionToggleChange:
|
|
1207
|
+
onCancel: i,
|
|
1208
|
+
visibleConditions: o,
|
|
1209
|
+
normalizedDecision: r,
|
|
1210
|
+
handleToggleNoneChange: u,
|
|
1211
|
+
handleConditionToggleChange: l,
|
|
1200
1212
|
showConditionsError: s,
|
|
1201
1213
|
termStartStatus: g,
|
|
1202
|
-
termEndStatus:
|
|
1214
|
+
termEndStatus: c
|
|
1203
1215
|
} = e;
|
|
1204
|
-
return /* @__PURE__ */
|
|
1216
|
+
return /* @__PURE__ */ a("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ h(p, { direction: "column", gap: "24px", children: [
|
|
1205
1217
|
Y({
|
|
1206
|
-
condition:
|
|
1218
|
+
condition: r,
|
|
1207
1219
|
formik: t,
|
|
1208
1220
|
isDecision: !0
|
|
1209
1221
|
}),
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1212
|
-
|
|
1222
|
+
/* @__PURE__ */ a(S, { dashed: !0 }),
|
|
1223
|
+
/* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(it, { children: /* @__PURE__ */ h(
|
|
1224
|
+
p,
|
|
1213
1225
|
{
|
|
1214
1226
|
direction: "column",
|
|
1215
1227
|
padding: "6px 12px",
|
|
@@ -1217,47 +1229,47 @@ const at = f.div`
|
|
|
1217
1229
|
height: "272px",
|
|
1218
1230
|
children: [
|
|
1219
1231
|
/* @__PURE__ */ h(
|
|
1220
|
-
|
|
1232
|
+
p,
|
|
1221
1233
|
{
|
|
1222
1234
|
justifyContent: "space-between",
|
|
1223
1235
|
alignItems: "center",
|
|
1224
1236
|
gap: "64px",
|
|
1225
1237
|
children: [
|
|
1226
|
-
/* @__PURE__ */
|
|
1227
|
-
/* @__PURE__ */
|
|
1238
|
+
/* @__PURE__ */ a(f, { type: "title", size: "small", weight: "bold", appearance: "gray", children: n.factsThatConditionIt }),
|
|
1239
|
+
/* @__PURE__ */ a(
|
|
1228
1240
|
de,
|
|
1229
1241
|
{
|
|
1230
1242
|
id: "toggleNone",
|
|
1231
|
-
onChange: () =>
|
|
1243
|
+
onChange: () => u(!t.values.toggleNone),
|
|
1232
1244
|
checked: t.values.toggleNone,
|
|
1233
1245
|
size: "small",
|
|
1234
|
-
children: /* @__PURE__ */
|
|
1246
|
+
children: /* @__PURE__ */ a(f, { as: "span", size: "medium", type: "label", weight: "bold", children: n.none })
|
|
1235
1247
|
}
|
|
1236
1248
|
)
|
|
1237
1249
|
]
|
|
1238
1250
|
}
|
|
1239
1251
|
),
|
|
1240
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ a(p, { direction: "column", gap: "20px", children: o == null ? void 0 : o.map((d) => /* @__PURE__ */ a(
|
|
1241
1253
|
ot,
|
|
1242
1254
|
{
|
|
1243
|
-
id: `toggle-${
|
|
1244
|
-
name: `toggle.${
|
|
1245
|
-
labelToggle:
|
|
1246
|
-
checked: !t.values.toggleNone && t.values.conditionsThatEstablishesTheDecision[
|
|
1247
|
-
handleToggleChange: (b) =>
|
|
1248
|
-
|
|
1249
|
-
|
|
1255
|
+
id: `toggle-${d.conditionName}`,
|
|
1256
|
+
name: `toggle.${d.conditionName}`,
|
|
1257
|
+
labelToggle: d.labelName,
|
|
1258
|
+
checked: !t.values.toggleNone && t.values.conditionsThatEstablishesTheDecision[d.conditionName] !== void 0,
|
|
1259
|
+
handleToggleChange: (b) => l(
|
|
1260
|
+
d.conditionName,
|
|
1261
|
+
d.howToSetTheCondition === x.LIST_OF_VALUES_MULTI
|
|
1250
1262
|
)(b.target.checked),
|
|
1251
|
-
children: Y({ condition:
|
|
1263
|
+
children: Y({ condition: d, formik: t })
|
|
1252
1264
|
},
|
|
1253
|
-
|
|
1265
|
+
d.conditionName
|
|
1254
1266
|
)) })
|
|
1255
1267
|
]
|
|
1256
1268
|
}
|
|
1257
1269
|
) }) }),
|
|
1258
1270
|
n.terms && /* @__PURE__ */ h(D, { children: [
|
|
1259
|
-
/* @__PURE__ */
|
|
1260
|
-
/* @__PURE__ */
|
|
1271
|
+
/* @__PURE__ */ a(S, { dashed: !0 }),
|
|
1272
|
+
/* @__PURE__ */ a(
|
|
1261
1273
|
rt,
|
|
1262
1274
|
{
|
|
1263
1275
|
labelStart: n.termStart,
|
|
@@ -1267,30 +1279,30 @@ const at = f.div`
|
|
|
1267
1279
|
messageStart: t.errors.effectiveFrom,
|
|
1268
1280
|
messageEnd: t.errors.validUntil,
|
|
1269
1281
|
statusStart: g,
|
|
1270
|
-
statusEnd:
|
|
1271
|
-
onHandleStartChange: (
|
|
1272
|
-
onHandleEndChange: (
|
|
1273
|
-
onCheckClosedChange: (
|
|
1274
|
-
t.setFieldValue("checkClosed",
|
|
1282
|
+
statusEnd: c,
|
|
1283
|
+
onHandleStartChange: (d) => t.setFieldValue("effectiveFrom", d.target.value),
|
|
1284
|
+
onHandleEndChange: (d) => t.setFieldValue("validUntil", d.target.value),
|
|
1285
|
+
onCheckClosedChange: (d) => {
|
|
1286
|
+
t.setFieldValue("checkClosed", d), d && t.setFieldValue("validUntil", "");
|
|
1275
1287
|
},
|
|
1276
1288
|
checkedClosed: t.values.checkClosed
|
|
1277
1289
|
}
|
|
1278
1290
|
)
|
|
1279
1291
|
] }),
|
|
1280
|
-
/* @__PURE__ */
|
|
1281
|
-
s && /* @__PURE__ */
|
|
1282
|
-
/* @__PURE__ */ h(
|
|
1283
|
-
/* @__PURE__ */
|
|
1284
|
-
/* @__PURE__ */
|
|
1292
|
+
/* @__PURE__ */ a(S, {}),
|
|
1293
|
+
s && /* @__PURE__ */ a(f, { type: "label", size: "medium", appearance: "danger", children: String(t.errors.conditionsThatEstablishesTheDecision) }),
|
|
1294
|
+
/* @__PURE__ */ h(p, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
1295
|
+
/* @__PURE__ */ a(N, { appearance: "gray", onClick: i, children: n.cancel }),
|
|
1296
|
+
/* @__PURE__ */ a(N, { type: "submit", children: n.confirm })
|
|
1285
1297
|
] })
|
|
1286
1298
|
] }) });
|
|
1287
1299
|
}, st = (e) => {
|
|
1288
1300
|
var T;
|
|
1289
|
-
const { decision: t, onSubmitEvent: n, textValues:
|
|
1301
|
+
const { decision: t, onSubmitEvent: n, textValues: i, onCancel: o } = e, { formik: r, handleToggleNoneChange: u } = nt({
|
|
1290
1302
|
decision: t,
|
|
1291
1303
|
onSubmitEvent: n,
|
|
1292
|
-
textValues:
|
|
1293
|
-
}),
|
|
1304
|
+
textValues: i
|
|
1305
|
+
}), l = {
|
|
1294
1306
|
ruleName: t.ruleName,
|
|
1295
1307
|
labelName: t.labelName,
|
|
1296
1308
|
howToSetTheCondition: t.howToSetTheDecision,
|
|
@@ -1298,80 +1310,80 @@ const at = f.div`
|
|
|
1298
1310
|
listOfPossibleValues: t.listOfPossibleValues
|
|
1299
1311
|
}, s = ((T = t.conditionsThatEstablishesTheDecision) == null ? void 0 : T.filter(
|
|
1300
1312
|
(m) => !m.hidden
|
|
1301
|
-
)) || [], g = !!
|
|
1302
|
-
return /* @__PURE__ */
|
|
1313
|
+
)) || [], g = !!r.errors.conditionsThatEstablishesTheDecision && r.submitCount > 0, c = r.touched.effectiveFrom ? r.errors.effectiveFrom ? "invalid" : "valid" : void 0, d = r.touched.validUntil ? r.errors.validUntil ? "invalid" : "valid" : void 0;
|
|
1314
|
+
return /* @__PURE__ */ a(
|
|
1303
1315
|
lt,
|
|
1304
1316
|
{
|
|
1305
|
-
formik:
|
|
1306
|
-
onCancel:
|
|
1307
|
-
textValues:
|
|
1317
|
+
formik: r,
|
|
1318
|
+
onCancel: o,
|
|
1319
|
+
textValues: i,
|
|
1308
1320
|
decision: t,
|
|
1309
1321
|
visibleConditions: s,
|
|
1310
|
-
normalizedDecision:
|
|
1311
|
-
handleToggleNoneChange:
|
|
1322
|
+
normalizedDecision: l,
|
|
1323
|
+
handleToggleNoneChange: u,
|
|
1312
1324
|
handleConditionToggleChange: (m, v) => (C) => {
|
|
1313
1325
|
if (!C)
|
|
1314
|
-
|
|
1326
|
+
r.setFieldValue(
|
|
1315
1327
|
`conditionsThatEstablishesTheDecision.${m}`,
|
|
1316
1328
|
void 0
|
|
1317
|
-
),
|
|
1329
|
+
), r.setFieldTouched(
|
|
1318
1330
|
`conditionsThatEstablishesTheDecision.${m}`,
|
|
1319
1331
|
!1,
|
|
1320
1332
|
!1
|
|
1321
1333
|
);
|
|
1322
1334
|
else {
|
|
1323
1335
|
const F = v ? [] : "";
|
|
1324
|
-
|
|
1336
|
+
r.setFieldValue(
|
|
1325
1337
|
`conditionsThatEstablishesTheDecision.${m}`,
|
|
1326
1338
|
F
|
|
1327
1339
|
);
|
|
1328
1340
|
}
|
|
1329
1341
|
},
|
|
1330
1342
|
showConditionsError: g,
|
|
1331
|
-
termStartStatus:
|
|
1332
|
-
termEndStatus:
|
|
1343
|
+
termStartStatus: c,
|
|
1344
|
+
termEndStatus: d
|
|
1333
1345
|
}
|
|
1334
1346
|
);
|
|
1335
1347
|
}, Mt = (e) => {
|
|
1336
|
-
var
|
|
1337
|
-
const { decisionTemplate: t } = e, n = { ...t },
|
|
1338
|
-
(
|
|
1348
|
+
var o;
|
|
1349
|
+
const { decisionTemplate: t } = e, n = { ...t }, i = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
|
|
1350
|
+
(r) => r.switchPlaces
|
|
1339
1351
|
);
|
|
1340
|
-
return
|
|
1352
|
+
return i ? {
|
|
1341
1353
|
...n,
|
|
1342
|
-
ruleName:
|
|
1343
|
-
labelName:
|
|
1344
|
-
decisionDataType:
|
|
1345
|
-
value:
|
|
1346
|
-
howToSetTheDecision:
|
|
1354
|
+
ruleName: i.conditionName,
|
|
1355
|
+
labelName: i.labelName,
|
|
1356
|
+
decisionDataType: i.conditionDataType,
|
|
1357
|
+
value: i.value,
|
|
1358
|
+
howToSetTheDecision: i.howToSetTheCondition,
|
|
1347
1359
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
1348
|
-
(
|
|
1360
|
+
(r) => r.conditionName === i.conditionName ? { ...r, hidden: !0 } : r
|
|
1349
1361
|
)
|
|
1350
1362
|
} : n;
|
|
1351
1363
|
}, Lt = (e) => {
|
|
1352
1364
|
const { decisions: t } = e;
|
|
1353
1365
|
return t == null ? void 0 : t.map((n) => {
|
|
1354
|
-
var
|
|
1355
|
-
const
|
|
1356
|
-
(
|
|
1366
|
+
var o;
|
|
1367
|
+
const i = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
|
|
1368
|
+
(r) => r.switchPlaces
|
|
1357
1369
|
);
|
|
1358
|
-
return
|
|
1370
|
+
return i ? {
|
|
1359
1371
|
...n,
|
|
1360
|
-
ruleName:
|
|
1361
|
-
labelName:
|
|
1362
|
-
decisionDataType:
|
|
1363
|
-
value:
|
|
1364
|
-
howToSetTheDecision:
|
|
1372
|
+
ruleName: i.conditionName,
|
|
1373
|
+
labelName: i.labelName,
|
|
1374
|
+
decisionDataType: i.conditionDataType,
|
|
1375
|
+
value: i.value,
|
|
1376
|
+
howToSetTheDecision: i.howToSetTheCondition,
|
|
1365
1377
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
1366
|
-
(
|
|
1378
|
+
(r) => r.conditionName === i.conditionName ? { ...r, hidden: !0 } : r
|
|
1367
1379
|
)
|
|
1368
1380
|
} : n;
|
|
1369
1381
|
});
|
|
1370
1382
|
}, I = /* @__PURE__ */ new Map(), dt = (e, t) => I.get(`${t}:${e}`), ct = (e, t, n) => {
|
|
1371
|
-
const
|
|
1372
|
-
if (I.set(
|
|
1373
|
-
const
|
|
1374
|
-
|
|
1383
|
+
const i = `${t}:${e}`;
|
|
1384
|
+
if (I.set(i, n), I.size > 1e3) {
|
|
1385
|
+
const o = I.keys().next().value;
|
|
1386
|
+
o !== void 0 && I.delete(o);
|
|
1375
1387
|
}
|
|
1376
1388
|
}, ee = /* @__PURE__ */ new Map(), ht = 1e3, ut = (e) => {
|
|
1377
1389
|
const t = Date.now(), n = ee.get(e) || 0;
|
|
@@ -1386,52 +1398,52 @@ const at = f.div`
|
|
|
1386
1398
|
ita: "it",
|
|
1387
1399
|
por: "pt"
|
|
1388
1400
|
}[t] || "en";
|
|
1389
|
-
}, gt = async (e, t, { url: n, apiKey:
|
|
1390
|
-
const
|
|
1391
|
-
if (
|
|
1392
|
-
if (ut(
|
|
1401
|
+
}, gt = async (e, t, { url: n, apiKey: i }) => {
|
|
1402
|
+
const o = `${t}:${e}`, r = dt(e, t);
|
|
1403
|
+
if (r) return r;
|
|
1404
|
+
if (ut(o))
|
|
1393
1405
|
return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
|
|
1394
|
-
const
|
|
1406
|
+
const u = pt(e);
|
|
1395
1407
|
try {
|
|
1396
|
-
const { data:
|
|
1408
|
+
const { data: l } = await De.post(
|
|
1397
1409
|
n,
|
|
1398
1410
|
{
|
|
1399
1411
|
q: e,
|
|
1400
|
-
source:
|
|
1412
|
+
source: u,
|
|
1401
1413
|
target: t,
|
|
1402
|
-
api_key:
|
|
1414
|
+
api_key: i
|
|
1403
1415
|
},
|
|
1404
1416
|
{
|
|
1405
1417
|
headers: {
|
|
1406
1418
|
"Content-Type": "application/json"
|
|
1407
1419
|
}
|
|
1408
1420
|
}
|
|
1409
|
-
), s = (
|
|
1421
|
+
), s = (l == null ? void 0 : l.translatedText) || e;
|
|
1410
1422
|
return ct(e, t, s), s;
|
|
1411
|
-
} catch (
|
|
1412
|
-
return console.warn(`[Translation] Failed for: "${e}"`,
|
|
1423
|
+
} catch (l) {
|
|
1424
|
+
return console.warn(`[Translation] Failed for: "${e}"`, l), e;
|
|
1413
1425
|
}
|
|
1414
1426
|
}, mt = (e) => typeof e == "string" && e.trim().length > 0, te = async (e, t, n) => {
|
|
1415
|
-
const
|
|
1416
|
-
Object.entries(e).map(async ([
|
|
1417
|
-
if (mt(
|
|
1418
|
-
const
|
|
1419
|
-
return [
|
|
1420
|
-
} else if (Array.isArray(
|
|
1421
|
-
const
|
|
1422
|
-
|
|
1423
|
-
async (
|
|
1427
|
+
const i = await Promise.all(
|
|
1428
|
+
Object.entries(e).map(async ([o, r]) => {
|
|
1429
|
+
if (mt(r)) {
|
|
1430
|
+
const u = await gt(r, t, n);
|
|
1431
|
+
return [o, u];
|
|
1432
|
+
} else if (Array.isArray(r)) {
|
|
1433
|
+
const u = await Promise.all(
|
|
1434
|
+
r.map(
|
|
1435
|
+
async (l) => typeof l == "object" && l !== null ? await te(l, t, n) : l
|
|
1424
1436
|
)
|
|
1425
1437
|
);
|
|
1426
|
-
return [
|
|
1427
|
-
} else if (typeof
|
|
1428
|
-
const
|
|
1429
|
-
return [
|
|
1438
|
+
return [o, u];
|
|
1439
|
+
} else if (typeof r == "object" && r !== null) {
|
|
1440
|
+
const u = await te(r, t, n);
|
|
1441
|
+
return [o, u];
|
|
1430
1442
|
} else
|
|
1431
|
-
return [
|
|
1443
|
+
return [o, r];
|
|
1432
1444
|
})
|
|
1433
1445
|
);
|
|
1434
|
-
return Object.fromEntries(
|
|
1446
|
+
return Object.fromEntries(i);
|
|
1435
1447
|
};
|
|
1436
1448
|
export {
|
|
1437
1449
|
P as BusinessRuleCard,
|
|
@@ -1440,7 +1452,7 @@ export {
|
|
|
1440
1452
|
At as Filter,
|
|
1441
1453
|
Ft as FilterModal,
|
|
1442
1454
|
$t as FormFilter,
|
|
1443
|
-
|
|
1455
|
+
_e as ModalRules,
|
|
1444
1456
|
st as RulesForm,
|
|
1445
1457
|
It as revertSortedDataSampleSwitchPlaces,
|
|
1446
1458
|
Rt as revertSortedDataSwitchPlaces,
|