@isettingkit/business-rules 1.0.7 → 1.0.9
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 +7 -2
- package/dist/index.es.js +426 -426
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { MdOutlineDelete as ge, MdClear as ne, MdAdd as
|
|
3
|
-
import { inube as v, Stack as
|
|
1
|
+
import { jsx as a, jsxs as g, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import { MdOutlineDelete as ge, MdClear as ne, MdAdd as ie, MdOutlineFilterAltOff as me, MdOutlineFilterAlt as be } from "react-icons/md";
|
|
3
|
+
import { inube as v, Stack as p, Divider as D, Icon as _, Text as x, SkeletonLine as F, useMediaQuery as R, Blanket as ae, Button as N, Grid as oe, Box as Te, Tag as fe, Checkpicker as ye, Toggle as re, Checkbox as xe, Date as Q } from "@inubekit/inubekit";
|
|
4
4
|
import f, { keyframes as ve } from "styled-components";
|
|
5
|
-
import { ValueDataType as k, ValueHowToSetUp as L, DecisionConditionRender as
|
|
6
|
-
import { DecisionViewConditionRenderer as
|
|
5
|
+
import { ValueDataType as k, ValueHowToSetUp as L, DecisionConditionRender as Y } from "@isettingkit/input";
|
|
6
|
+
import { DecisionViewConditionRenderer as z } from "@isettingkit/view";
|
|
7
7
|
import { createPortal as le } from "react-dom";
|
|
8
8
|
import { useFormik as we } from "formik";
|
|
9
|
-
import { string as H, mixed as se, object as O, number as q, lazy as
|
|
9
|
+
import { string as H, mixed as se, object as O, number as q, lazy as K, date as W } from "yup";
|
|
10
10
|
import { useState as V, useEffect as Ce } from "react";
|
|
11
11
|
import Se from "axios";
|
|
12
12
|
import { franc as De } from "franc-min";
|
|
13
|
-
const
|
|
13
|
+
const Ee = f.div`
|
|
14
14
|
border-radius: 8px;
|
|
15
15
|
border: 1px solid ${v.palette.neutral.N30};
|
|
16
16
|
box-sizing: border-box;
|
|
@@ -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(Ee, { children: /* @__PURE__ */ g(p, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
47
47
|
t,
|
|
48
|
-
n && /* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
48
|
+
n && /* @__PURE__ */ g(E, { children: [
|
|
49
|
+
/* @__PURE__ */ a(D, {}),
|
|
50
|
+
/* @__PURE__ */ a(p, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ a(
|
|
51
|
+
_,
|
|
52
52
|
{
|
|
53
53
|
cursorHover: !0,
|
|
54
54
|
appearance: "danger",
|
|
55
55
|
size: "24px",
|
|
56
|
-
icon: /* @__PURE__ */
|
|
56
|
+
icon: /* @__PURE__ */ a(ge, {}),
|
|
57
57
|
onClick: () => {
|
|
58
|
-
|
|
58
|
+
i(o);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
) })
|
|
62
62
|
] })
|
|
63
63
|
] }) });
|
|
64
|
-
},
|
|
64
|
+
}, J = f.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) || v.palette.neutral.N30;
|
|
71
71
|
}};
|
|
72
72
|
}
|
|
73
|
-
`,
|
|
73
|
+
`, X = f.div`
|
|
74
74
|
width: 100%;
|
|
75
75
|
height: 100%;
|
|
76
76
|
overflow-y: auto;
|
|
@@ -88,54 +88,54 @@ const P = (e) => {
|
|
|
88
88
|
background-color: #ebecf0;
|
|
89
89
|
border-radius: 8px;
|
|
90
90
|
}
|
|
91
|
-
`,
|
|
91
|
+
`, Ne = (e) => e.value, ke = (e) => e.value, Ae = (e) => e.value, Fe = (e) => ({
|
|
92
92
|
from: e.from ?? "",
|
|
93
93
|
to: e.to ?? ""
|
|
94
|
-
}), $e = (e) => e.value,
|
|
94
|
+
}), $e = (e) => e.value, Ie = (e) => e.value, Re = (e) => e.value;
|
|
95
95
|
var y = /* @__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))(y || {});
|
|
96
96
|
const Me = {
|
|
97
97
|
[y.LIST_OF_VALUES]: ke,
|
|
98
98
|
[y.LIST_OF_VALUES_MULTI]: Ae,
|
|
99
99
|
[y.RANGE]: Fe,
|
|
100
100
|
[y.GREATER_THAN]: $e,
|
|
101
|
-
[y.LESS_THAN]:
|
|
102
|
-
[y.EQUAL]:
|
|
103
|
-
},
|
|
104
|
-
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t),
|
|
105
|
-
return n &&
|
|
101
|
+
[y.LESS_THAN]: Ie,
|
|
102
|
+
[y.EQUAL]: Re
|
|
103
|
+
}, I = (e) => {
|
|
104
|
+
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), i = Me[e == null ? void 0 : e.howToSetTheDecision] || Ne;
|
|
105
|
+
return n && i(t) || t || void 0;
|
|
106
106
|
}, Le = (e) => {
|
|
107
107
|
const {
|
|
108
108
|
conditionsAlignment: t,
|
|
109
109
|
decision: n,
|
|
110
|
-
decisionDateElement:
|
|
110
|
+
decisionDateElement: i,
|
|
111
111
|
decisionMapper: o,
|
|
112
112
|
loading: r,
|
|
113
|
-
skeleton:
|
|
114
|
-
terms:
|
|
115
|
-
textValues:
|
|
116
|
-
visibleConditions:
|
|
113
|
+
skeleton: h,
|
|
114
|
+
terms: c,
|
|
115
|
+
textValues: s,
|
|
116
|
+
visibleConditions: u
|
|
117
117
|
} = e;
|
|
118
|
-
return r ? /* @__PURE__ */ p
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
|
|
118
|
+
return r ? /* @__PURE__ */ g(p, { direction: "column", gap: "12px", children: [
|
|
119
|
+
/* @__PURE__ */ a(p, { direction: "column", alignItems: "center", children: /* @__PURE__ */ a(
|
|
120
|
+
z,
|
|
121
121
|
{
|
|
122
122
|
element: o,
|
|
123
|
-
valueData:
|
|
123
|
+
valueData: I(
|
|
124
124
|
o
|
|
125
125
|
),
|
|
126
126
|
type: "decision"
|
|
127
127
|
}
|
|
128
128
|
) }, n.ruleName),
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
|
|
129
|
+
/* @__PURE__ */ a(D, { dashed: !0 }),
|
|
130
|
+
/* @__PURE__ */ a(X, { children: /* @__PURE__ */ g(
|
|
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__ */
|
|
138
|
+
/* @__PURE__ */ a(
|
|
139
139
|
x,
|
|
140
140
|
{
|
|
141
141
|
type: "label",
|
|
@@ -143,59 +143,59 @@ const Me = {
|
|
|
143
143
|
appearance: "dark",
|
|
144
144
|
weight: "bold",
|
|
145
145
|
textAlign: "center",
|
|
146
|
-
children:
|
|
146
|
+
children: s.factsThatConditionIt
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
u.map((d) => /* @__PURE__ */ a(J, { children: /* @__PURE__ */ a(p, { direction: "column", padding: "8px", children: /* @__PURE__ */ a(
|
|
150
|
+
z,
|
|
151
151
|
{
|
|
152
|
-
element: { ...
|
|
153
|
-
valueData:
|
|
154
|
-
|
|
152
|
+
element: { ...d, value: d.value },
|
|
153
|
+
valueData: I(
|
|
154
|
+
d
|
|
155
155
|
)
|
|
156
156
|
}
|
|
157
|
-
) }) },
|
|
158
|
-
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
|
|
161
|
-
|
|
157
|
+
) }) }, d.conditionName)),
|
|
158
|
+
c && /* @__PURE__ */ g(E, { children: [
|
|
159
|
+
/* @__PURE__ */ a(D, { dashed: !0 }),
|
|
160
|
+
i && /* @__PURE__ */ a(
|
|
161
|
+
z,
|
|
162
162
|
{
|
|
163
|
-
element:
|
|
164
|
-
valueData:
|
|
163
|
+
element: i.element,
|
|
164
|
+
valueData: i.valueData,
|
|
165
165
|
type: "decision"
|
|
166
166
|
},
|
|
167
|
-
|
|
167
|
+
s.terms
|
|
168
168
|
)
|
|
169
169
|
] })
|
|
170
170
|
]
|
|
171
171
|
}
|
|
172
172
|
) })
|
|
173
|
-
] }) : /* @__PURE__ */ p
|
|
174
|
-
/* @__PURE__ */ p
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
173
|
+
] }) : /* @__PURE__ */ g(p, { direction: "column", gap: "12px", children: [
|
|
174
|
+
/* @__PURE__ */ g(p, { direction: "column", alignItems: "center", gap: "4px", children: [
|
|
175
|
+
/* @__PURE__ */ a(F, { animated: !0, width: "180px" }),
|
|
176
|
+
/* @__PURE__ */ a(F, { animated: !0, width: "85px" })
|
|
177
177
|
] }, "loading"),
|
|
178
|
-
/* @__PURE__ */ p
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ g(p, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
179
|
+
/* @__PURE__ */ a(D, { dashed: !0 }),
|
|
180
|
+
/* @__PURE__ */ a(F, { 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: h.map((d, l) => /* @__PURE__ */ a(J, { children: /* @__PURE__ */ g(
|
|
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(F, { animated: !0, width: "180px" }),
|
|
198
|
+
/* @__PURE__ */ a(F, { animated: !0, width: "85px" })
|
|
199
199
|
]
|
|
200
200
|
}
|
|
201
201
|
) }, `condition-${l}`))
|
|
@@ -204,15 +204,15 @@ const Me = {
|
|
|
204
204
|
] });
|
|
205
205
|
}, de = (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), h = o && r ? {
|
|
208
208
|
element: {
|
|
209
|
-
labelName:
|
|
209
|
+
labelName: i == null ? void 0 : i.terms,
|
|
210
210
|
value: String(t.effectiveFrom),
|
|
211
211
|
howToSetTheDecision: L.RANGE,
|
|
212
212
|
decisionDataType: k.DATE
|
|
213
213
|
},
|
|
214
|
-
valueData:
|
|
215
|
-
labelName:
|
|
214
|
+
valueData: I({
|
|
215
|
+
labelName: i == null ? void 0 : i.terms,
|
|
216
216
|
value: {
|
|
217
217
|
from: String(t.effectiveFrom),
|
|
218
218
|
to: String(t.validUntil)
|
|
@@ -222,37 +222,37 @@ const Me = {
|
|
|
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: L.EQUAL,
|
|
228
228
|
decisionDataType: k.DATE
|
|
229
229
|
},
|
|
230
|
-
valueData:
|
|
231
|
-
labelName:
|
|
230
|
+
valueData: I({
|
|
231
|
+
labelName: i == null ? void 0 : i.terms,
|
|
232
232
|
value: String(t.effectiveFrom),
|
|
233
233
|
howToSetTheDecision: L.EQUAL,
|
|
234
234
|
decisionDataType: k.DATE
|
|
235
235
|
})
|
|
236
|
-
} : null,
|
|
236
|
+
} : null, c = t ? {
|
|
237
237
|
labelName: t.labelName || "",
|
|
238
238
|
decisionDataType: t.decisionDataType || "alphabetical",
|
|
239
|
-
value:
|
|
239
|
+
value: I(t),
|
|
240
240
|
howToSetTheDecision: t.howToSetTheDecision || "EqualTo"
|
|
241
|
-
} : null,
|
|
241
|
+
} : null, s = ((b = t == null ? void 0 : t.conditionsThatEstablishesTheDecision) == null ? void 0 : b.filter(
|
|
242
242
|
(T) => !T.hidden
|
|
243
|
-
)) || [],
|
|
244
|
-
return /* @__PURE__ */
|
|
243
|
+
)) || [], u = Array.from({ length: 5 }), d = !!(!n && t && i && c), l = s.length < 2 ? "start" : "space-between";
|
|
244
|
+
return /* @__PURE__ */ a(
|
|
245
245
|
Le,
|
|
246
246
|
{
|
|
247
247
|
conditionsAlignment: l,
|
|
248
248
|
decision: t,
|
|
249
|
-
decisionDateElement:
|
|
250
|
-
decisionMapper:
|
|
251
|
-
loading:
|
|
252
|
-
skeleton:
|
|
253
|
-
terms: !!(
|
|
254
|
-
textValues:
|
|
255
|
-
visibleConditions:
|
|
249
|
+
decisionDateElement: h,
|
|
250
|
+
decisionMapper: c,
|
|
251
|
+
loading: d,
|
|
252
|
+
skeleton: u,
|
|
253
|
+
terms: !!(i != null && i.terms),
|
|
254
|
+
textValues: i,
|
|
255
|
+
visibleConditions: s
|
|
256
256
|
}
|
|
257
257
|
);
|
|
258
258
|
}, Oe = f.div`
|
|
@@ -291,18 +291,18 @@ const Me = {
|
|
|
291
291
|
background-color: #ebecf0;
|
|
292
292
|
border-radius: 8px;
|
|
293
293
|
}
|
|
294
|
-
`,
|
|
295
|
-
const { children: t, portalId: n, onCloseModal:
|
|
294
|
+
`, _e = (e) => {
|
|
295
|
+
const { children: t, portalId: n, onCloseModal: i, title: o } = e, r = document.getElementById(n);
|
|
296
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 h = R("(max-width: 400px)");
|
|
301
301
|
return le(
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
/* @__PURE__ */
|
|
305
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ a(Oe, { smallScreen: h, children: /* @__PURE__ */ a(ae, { children: /* @__PURE__ */ a(Ve, { children: /* @__PURE__ */ g(p, { direction: "column", gap: "24px", children: [
|
|
303
|
+
/* @__PURE__ */ a(p, { direction: "column", gap: "24px", children: /* @__PURE__ */ g(p, { alignItems: "center", justifyContent: "space-between", children: [
|
|
304
|
+
/* @__PURE__ */ a(x, { 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
|
] }) }) }) }),
|
|
@@ -342,7 +342,7 @@ f.div`
|
|
|
342
342
|
}};
|
|
343
343
|
}
|
|
344
344
|
`;
|
|
345
|
-
const
|
|
345
|
+
const ze = f.div`
|
|
346
346
|
& > div {
|
|
347
347
|
background-color: ${({ theme: e }) => {
|
|
348
348
|
var t, n;
|
|
@@ -388,7 +388,7 @@ const _e = f.div`
|
|
|
388
388
|
`;
|
|
389
389
|
function Be(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 Be(e) {
|
|
|
396
396
|
},
|
|
397
397
|
handleView: () => n ? n() : null,
|
|
398
398
|
controls: !1,
|
|
399
|
-
children: /* @__PURE__ */
|
|
399
|
+
children: /* @__PURE__ */ a(de, { loading: !0 })
|
|
400
400
|
},
|
|
401
401
|
`loading-card-${t}`
|
|
402
402
|
);
|
|
403
403
|
}
|
|
404
404
|
function He(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(ce, { children: /* @__PURE__ */ g(p, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
|
|
407
|
+
/* @__PURE__ */ a(x, { 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
412
|
handleDelete: () => o ? o(t.decisionId) : null,
|
|
413
|
-
handleView: () =>
|
|
413
|
+
handleView: () => i ? i(t) : null,
|
|
414
414
|
controls: n,
|
|
415
|
-
children: /* @__PURE__ */
|
|
415
|
+
children: /* @__PURE__ */ a(de, { decision: t, textValues: r })
|
|
416
416
|
}
|
|
417
417
|
)
|
|
418
418
|
] }) }, t.decisionId) : null;
|
|
@@ -421,26 +421,26 @@ function Pe(e) {
|
|
|
421
421
|
const {
|
|
422
422
|
customTitleContentAddCard: t,
|
|
423
423
|
index: n,
|
|
424
|
-
handleOpenModal:
|
|
424
|
+
handleOpenModal: i,
|
|
425
425
|
shouldRenderEmptyMessage: o
|
|
426
426
|
} = e, r = t || "Agregar decisión";
|
|
427
|
-
return /* @__PURE__ */
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
|
|
427
|
+
return /* @__PURE__ */ a(ce, { children: o ? null : /* @__PURE__ */ g(p, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
|
|
428
|
+
/* @__PURE__ */ a(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
|
|
429
|
+
/* @__PURE__ */ a(
|
|
430
|
+
ze,
|
|
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__ */ p
|
|
442
|
-
/* @__PURE__ */
|
|
443
|
-
/* @__PURE__ */
|
|
441
|
+
children: /* @__PURE__ */ g(p, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
442
|
+
/* @__PURE__ */ a(_, { appearance: "gray", icon: /* @__PURE__ */ a(ie, {}), size: "35px" }),
|
|
443
|
+
/* @__PURE__ */ a(x, { appearance: "gray", type: "body", size: "large", children: r })
|
|
444
444
|
] })
|
|
445
445
|
}
|
|
446
446
|
)
|
|
@@ -459,63 +459,63 @@ const Ge = {
|
|
|
459
459
|
const {
|
|
460
460
|
controls: t,
|
|
461
461
|
customTitleContentAddCard: n,
|
|
462
|
-
decisions:
|
|
462
|
+
decisions: i,
|
|
463
463
|
loading: o,
|
|
464
464
|
handleOpenModal: r,
|
|
465
|
-
handleDelete:
|
|
466
|
-
textValues:
|
|
467
|
-
} = e,
|
|
468
|
-
(
|
|
465
|
+
handleDelete: h,
|
|
466
|
+
textValues: c
|
|
467
|
+
} = e, s = o ? Array.from({ length: 3 }).map(
|
|
468
|
+
(d, l) => B({
|
|
469
469
|
type: "loading",
|
|
470
470
|
index: l,
|
|
471
471
|
controls: t,
|
|
472
472
|
customTitleContentAddCard: n,
|
|
473
473
|
loading: o,
|
|
474
474
|
handleOpenModal: r,
|
|
475
|
-
handleDelete:
|
|
476
|
-
textValues:
|
|
475
|
+
handleDelete: h,
|
|
476
|
+
textValues: c
|
|
477
477
|
})
|
|
478
|
-
) :
|
|
479
|
-
(
|
|
478
|
+
) : i == null ? void 0 : i.map(
|
|
479
|
+
(d) => B({
|
|
480
480
|
type: "decision",
|
|
481
|
-
decision:
|
|
481
|
+
decision: d,
|
|
482
482
|
controls: t,
|
|
483
483
|
customTitleContentAddCard: n,
|
|
484
484
|
loading: o,
|
|
485
485
|
handleOpenModal: r,
|
|
486
|
-
handleDelete:
|
|
487
|
-
textValues:
|
|
486
|
+
handleDelete: h,
|
|
487
|
+
textValues: c
|
|
488
488
|
})
|
|
489
|
-
),
|
|
490
|
-
return { renderedCards:
|
|
491
|
-
},
|
|
489
|
+
), u = ((i == null ? void 0 : i.length) === 0 || i.length < Math.floor(window.innerWidth / 300)) && !o && t;
|
|
490
|
+
return { renderedCards: s, shouldRenderAddCard: u };
|
|
491
|
+
}, kt = (e) => {
|
|
492
492
|
const {
|
|
493
493
|
controls: t = !0,
|
|
494
494
|
customTitleContentAddCard: n,
|
|
495
|
-
customMessageEmptyDecisions:
|
|
495
|
+
customMessageEmptyDecisions: i,
|
|
496
496
|
decisions: o,
|
|
497
497
|
textValues: r,
|
|
498
|
-
decisionTemplate:
|
|
499
|
-
isModalOpen:
|
|
500
|
-
selectedDecision:
|
|
501
|
-
loading:
|
|
502
|
-
handleOpenModal:
|
|
498
|
+
decisionTemplate: h,
|
|
499
|
+
isModalOpen: c,
|
|
500
|
+
selectedDecision: s,
|
|
501
|
+
loading: u,
|
|
502
|
+
handleOpenModal: d,
|
|
503
503
|
handleCloseModal: l,
|
|
504
504
|
handleSubmitForm: b,
|
|
505
505
|
handleDelete: T,
|
|
506
506
|
terms: m = !0
|
|
507
|
-
} = e, w =
|
|
507
|
+
} = e, w = R("(max-width: 681px)"), C = R("(max-width: 400px)"), { renderedCards: A, shouldRenderAddCard: U } = Qe({
|
|
508
508
|
controls: t,
|
|
509
509
|
customTitleContentAddCard: n,
|
|
510
510
|
decisions: o,
|
|
511
|
-
loading:
|
|
512
|
-
handleOpenModal:
|
|
511
|
+
loading: u,
|
|
512
|
+
handleOpenModal: d,
|
|
513
513
|
handleDelete: T,
|
|
514
514
|
textValues: r
|
|
515
|
-
}), M = (o == null ? void 0 : o.length) === 0 && !
|
|
516
|
-
return /* @__PURE__ */
|
|
517
|
-
/* @__PURE__ */
|
|
518
|
-
|
|
515
|
+
}), M = (o == null ? void 0 : o.length) === 0 && !u;
|
|
516
|
+
return /* @__PURE__ */ g(E, { children: [
|
|
517
|
+
/* @__PURE__ */ a(je, { children: /* @__PURE__ */ a(qe, { children: /* @__PURE__ */ a(p, { direction: "column", gap: "16px", padding: "6px", children: M ? /* @__PURE__ */ g(
|
|
518
|
+
p,
|
|
519
519
|
{
|
|
520
520
|
direction: "column",
|
|
521
521
|
gap: "28px",
|
|
@@ -524,9 +524,9 @@ const Ge = {
|
|
|
524
524
|
justifyContent: "center",
|
|
525
525
|
alignItems: "center",
|
|
526
526
|
children: [
|
|
527
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ a(x, { as: "span", type: "label", size: "large", appearance: "gray", children: i || /* @__PURE__ */ g(E, { children: [
|
|
528
528
|
"Aún NO tienes definidas tasas de interés efectivas . Presiona",
|
|
529
|
-
/* @__PURE__ */
|
|
529
|
+
/* @__PURE__ */ g(
|
|
530
530
|
x,
|
|
531
531
|
{
|
|
532
532
|
as: "span",
|
|
@@ -543,17 +543,17 @@ const Ge = {
|
|
|
543
543
|
),
|
|
544
544
|
"para empezar."
|
|
545
545
|
] }) }),
|
|
546
|
-
/* @__PURE__ */
|
|
547
|
-
|
|
546
|
+
/* @__PURE__ */ a(
|
|
547
|
+
N,
|
|
548
548
|
{
|
|
549
|
-
iconBefore: /* @__PURE__ */
|
|
550
|
-
onClick: () =>
|
|
549
|
+
iconBefore: /* @__PURE__ */ a(ie, {}),
|
|
550
|
+
onClick: () => d ? d() : null,
|
|
551
551
|
children: n || "Agregar decisión"
|
|
552
552
|
}
|
|
553
553
|
)
|
|
554
554
|
]
|
|
555
555
|
}
|
|
556
|
-
) : /* @__PURE__ */
|
|
556
|
+
) : /* @__PURE__ */ g(
|
|
557
557
|
oe,
|
|
558
558
|
{
|
|
559
559
|
templateColumns: C ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
|
|
@@ -572,9 +572,9 @@ const Ge = {
|
|
|
572
572
|
index: o == null ? void 0 : o.length,
|
|
573
573
|
controls: t,
|
|
574
574
|
customTitleContentAddCard: n,
|
|
575
|
-
customMessageEmptyDecisions:
|
|
576
|
-
loading:
|
|
577
|
-
handleOpenModal:
|
|
575
|
+
customMessageEmptyDecisions: i,
|
|
576
|
+
loading: u,
|
|
577
|
+
handleOpenModal: d,
|
|
578
578
|
handleDelete: T,
|
|
579
579
|
textValues: r,
|
|
580
580
|
shouldRenderEmptyMessage: M,
|
|
@@ -583,16 +583,16 @@ const Ge = {
|
|
|
583
583
|
]
|
|
584
584
|
}
|
|
585
585
|
) }) }) }),
|
|
586
|
-
|
|
587
|
-
|
|
586
|
+
c && /* @__PURE__ */ a(
|
|
587
|
+
_e,
|
|
588
588
|
{
|
|
589
589
|
portalId: "modal-portal",
|
|
590
590
|
onCloseModal: l,
|
|
591
|
-
title:
|
|
592
|
-
children: /* @__PURE__ */
|
|
591
|
+
title: s ? "Editar Decisión" : "Nueva decisión",
|
|
592
|
+
children: /* @__PURE__ */ a(
|
|
593
593
|
st,
|
|
594
594
|
{
|
|
595
|
-
decision:
|
|
595
|
+
decision: s || h,
|
|
596
596
|
onSubmitEvent: b,
|
|
597
597
|
textValues: r,
|
|
598
598
|
onCancel: () => l ? l() : () => {
|
|
@@ -602,7 +602,7 @@ const Ge = {
|
|
|
602
602
|
}
|
|
603
603
|
)
|
|
604
604
|
] });
|
|
605
|
-
},
|
|
605
|
+
}, Ye = f.div`
|
|
606
606
|
display: flex;
|
|
607
607
|
justify-content: ${({ justifyContent: e }) => e};
|
|
608
608
|
align-items: ${({ alignItems: e }) => e};
|
|
@@ -615,28 +615,28 @@ const Ge = {
|
|
|
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) || v.palette.neutral.N10}` : `${((r = (o = t == null ? void 0 : t.palette) == null ? void 0 : o.neutral) == null ? void 0 : r.N0) || v.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) || v.palette.neutral.N40}` : "none";
|
|
624
624
|
}};
|
|
625
625
|
border-radius: ${({ borderRadius: e }) => e};
|
|
626
626
|
box-sizing: ${({ boxSizing: e }) => e};
|
|
627
627
|
overflow-y: ${({ scroll: e }) => e ? "scroll" : "none"};
|
|
628
|
-
`,
|
|
628
|
+
`, Ke = (e) => {
|
|
629
629
|
const {
|
|
630
630
|
children: t,
|
|
631
631
|
wrap: n,
|
|
632
|
-
direction:
|
|
632
|
+
direction: i = "column",
|
|
633
633
|
justifyContent: o,
|
|
634
634
|
alignItems: r,
|
|
635
|
-
alignContent:
|
|
636
|
-
height:
|
|
637
|
-
width:
|
|
638
|
-
gap:
|
|
639
|
-
background:
|
|
635
|
+
alignContent: h,
|
|
636
|
+
height: c,
|
|
637
|
+
width: s,
|
|
638
|
+
gap: u,
|
|
639
|
+
background: d,
|
|
640
640
|
borderRadius: l,
|
|
641
641
|
border: b,
|
|
642
642
|
margin: T = "0px",
|
|
@@ -644,18 +644,18 @@ const Ge = {
|
|
|
644
644
|
boxSizing: w,
|
|
645
645
|
scroll: C = !1
|
|
646
646
|
} = e;
|
|
647
|
-
return /* @__PURE__ */
|
|
648
|
-
|
|
647
|
+
return /* @__PURE__ */ a(
|
|
648
|
+
Ye,
|
|
649
649
|
{
|
|
650
|
-
direction:
|
|
650
|
+
direction: i,
|
|
651
651
|
justifyContent: o,
|
|
652
652
|
alignItems: r,
|
|
653
|
-
alignContent:
|
|
654
|
-
height:
|
|
655
|
-
width:
|
|
653
|
+
alignContent: h,
|
|
654
|
+
height: c,
|
|
655
|
+
width: s,
|
|
656
656
|
wrap: n,
|
|
657
|
-
gap:
|
|
658
|
-
background:
|
|
657
|
+
gap: u,
|
|
658
|
+
background: d,
|
|
659
659
|
border: b,
|
|
660
660
|
margin: T,
|
|
661
661
|
padding: m,
|
|
@@ -665,11 +665,11 @@ const Ge = {
|
|
|
665
665
|
children: t
|
|
666
666
|
}
|
|
667
667
|
);
|
|
668
|
-
},
|
|
669
|
-
const { appliedFilters: t, onClear: n, onClick:
|
|
670
|
-
return /* @__PURE__ */
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
-
|
|
668
|
+
}, At = (e) => {
|
|
669
|
+
const { appliedFilters: t, onClear: n, onClick: i, titleClearFilter: o, titleFilter: r } = e, h = !t || t.length === 0;
|
|
670
|
+
return /* @__PURE__ */ a(Te, { borderRadius: "8px", children: /* @__PURE__ */ g(oe, { gap: "12px", templateColumns: "1fr auto auto", children: [
|
|
671
|
+
/* @__PURE__ */ a(
|
|
672
|
+
Ke,
|
|
673
673
|
{
|
|
674
674
|
background: !0,
|
|
675
675
|
borderRadius: "8px",
|
|
@@ -678,41 +678,41 @@ const Ge = {
|
|
|
678
678
|
gap: "8px",
|
|
679
679
|
alignItems: "center",
|
|
680
680
|
padding: "0px 8px",
|
|
681
|
-
children: t == null ? void 0 : t.map((
|
|
681
|
+
children: t == null ? void 0 : t.map((c) => /* @__PURE__ */ a(
|
|
682
682
|
fe,
|
|
683
683
|
{
|
|
684
684
|
appearance: "primary",
|
|
685
685
|
displayIcon: !0,
|
|
686
|
-
icon:
|
|
687
|
-
label:
|
|
686
|
+
icon: c.icon,
|
|
687
|
+
label: c.label
|
|
688
688
|
},
|
|
689
|
-
|
|
689
|
+
c.label
|
|
690
690
|
))
|
|
691
691
|
}
|
|
692
692
|
),
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
|
|
693
|
+
/* @__PURE__ */ a(
|
|
694
|
+
N,
|
|
695
695
|
{
|
|
696
696
|
cursorHover: !0,
|
|
697
|
-
disabled:
|
|
698
|
-
iconBefore: /* @__PURE__ */
|
|
697
|
+
disabled: h,
|
|
698
|
+
iconBefore: /* @__PURE__ */ a(me, {}),
|
|
699
699
|
onClick: n,
|
|
700
700
|
variant: "outlined",
|
|
701
701
|
children: o
|
|
702
702
|
}
|
|
703
703
|
),
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
|
|
704
|
+
/* @__PURE__ */ a(
|
|
705
|
+
N,
|
|
706
706
|
{
|
|
707
707
|
cursorHover: !0,
|
|
708
|
-
iconBefore: /* @__PURE__ */
|
|
709
|
-
onClick:
|
|
708
|
+
iconBefore: /* @__PURE__ */ a(be, {}),
|
|
709
|
+
onClick: i,
|
|
710
710
|
variant: "outlined",
|
|
711
711
|
children: r
|
|
712
712
|
}
|
|
713
713
|
)
|
|
714
714
|
] }) });
|
|
715
|
-
},
|
|
715
|
+
}, We = f.div`
|
|
716
716
|
display: flex;
|
|
717
717
|
flex-direction: column;
|
|
718
718
|
background-color: ${({ theme: e }) => {
|
|
@@ -725,55 +725,55 @@ const Ge = {
|
|
|
725
725
|
padding: 24px;
|
|
726
726
|
gap: 24px;
|
|
727
727
|
box-sizing: border-box;
|
|
728
|
-
`,
|
|
728
|
+
`, Ft = (e) => {
|
|
729
729
|
const {
|
|
730
730
|
actionButtonLabel: t,
|
|
731
731
|
cancelButtonLabel: n,
|
|
732
|
-
children:
|
|
732
|
+
children: i,
|
|
733
733
|
loading: o,
|
|
734
734
|
onClick: r,
|
|
735
|
-
onCloseModal:
|
|
736
|
-
portalId:
|
|
737
|
-
title:
|
|
738
|
-
} = e,
|
|
739
|
-
if (!
|
|
735
|
+
onCloseModal: h,
|
|
736
|
+
portalId: c,
|
|
737
|
+
title: s
|
|
738
|
+
} = e, u = R("(max-width: 768px)"), d = document.getElementById(c);
|
|
739
|
+
if (!d)
|
|
740
740
|
throw new Error(
|
|
741
741
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
742
742
|
);
|
|
743
743
|
return le(
|
|
744
|
-
/* @__PURE__ */
|
|
745
|
-
/* @__PURE__ */ p
|
|
746
|
-
/* @__PURE__ */ p
|
|
747
|
-
/* @__PURE__ */
|
|
748
|
-
/* @__PURE__ */ p
|
|
749
|
-
/* @__PURE__ */
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
|
|
744
|
+
/* @__PURE__ */ a(ae, { children: /* @__PURE__ */ g(We, { $smallScreen: u, children: [
|
|
745
|
+
/* @__PURE__ */ g(p, { direction: "column", gap: "16px", children: [
|
|
746
|
+
/* @__PURE__ */ g(p, { alignContent: "center", justifyContent: "space-between", children: [
|
|
747
|
+
/* @__PURE__ */ a(x, { appearance: "dark", size: "small", type: "headline", children: s }),
|
|
748
|
+
/* @__PURE__ */ g(p, { alignItems: "center", children: [
|
|
749
|
+
/* @__PURE__ */ a(x, { children: "Cerrar" }),
|
|
750
|
+
/* @__PURE__ */ a(
|
|
751
|
+
_,
|
|
752
752
|
{
|
|
753
753
|
appearance: "dark",
|
|
754
|
-
icon: /* @__PURE__ */
|
|
755
|
-
onClick:
|
|
754
|
+
icon: /* @__PURE__ */ a(ne, {}),
|
|
755
|
+
onClick: h,
|
|
756
756
|
cursorHover: !0
|
|
757
757
|
}
|
|
758
758
|
)
|
|
759
759
|
] })
|
|
760
760
|
] }),
|
|
761
|
-
/* @__PURE__ */
|
|
761
|
+
/* @__PURE__ */ a(D, {})
|
|
762
762
|
] }),
|
|
763
|
-
|
|
764
|
-
/* @__PURE__ */ p
|
|
765
|
-
/* @__PURE__ */
|
|
766
|
-
|
|
763
|
+
i,
|
|
764
|
+
/* @__PURE__ */ g(p, { gap: "20px", justifyContent: "flex-end", children: [
|
|
765
|
+
/* @__PURE__ */ a(
|
|
766
|
+
N,
|
|
767
767
|
{
|
|
768
768
|
appearance: "gray",
|
|
769
|
-
onClick:
|
|
769
|
+
onClick: h,
|
|
770
770
|
spacing: "wide",
|
|
771
771
|
variant: "outlined",
|
|
772
772
|
children: n
|
|
773
773
|
}
|
|
774
774
|
),
|
|
775
|
-
/* @__PURE__ */
|
|
776
|
-
|
|
775
|
+
/* @__PURE__ */ a(
|
|
776
|
+
N,
|
|
777
777
|
{
|
|
778
778
|
appearance: "primary",
|
|
779
779
|
loading: o,
|
|
@@ -785,33 +785,33 @@ const Ge = {
|
|
|
785
785
|
)
|
|
786
786
|
] })
|
|
787
787
|
] }) }),
|
|
788
|
-
|
|
788
|
+
d
|
|
789
789
|
);
|
|
790
|
-
},
|
|
790
|
+
}, $t = (e) => {
|
|
791
791
|
const { fields: t, onChange: n } = e;
|
|
792
|
-
return /* @__PURE__ */
|
|
793
|
-
/* @__PURE__ */
|
|
794
|
-
/* @__PURE__ */
|
|
792
|
+
return /* @__PURE__ */ a(p, { direction: "column", gap: "16px", children: t.map((i) => /* @__PURE__ */ g(p, { gap: "6px", alignItems: "center", children: [
|
|
793
|
+
/* @__PURE__ */ a(p, { padding: "22px 0 0 0", children: /* @__PURE__ */ a(_, { appearance: "primary", icon: i.icon }) }),
|
|
794
|
+
/* @__PURE__ */ a(
|
|
795
795
|
ye,
|
|
796
796
|
{
|
|
797
|
-
disabled:
|
|
798
|
-
invalid:
|
|
799
|
-
label:
|
|
800
|
-
message:
|
|
801
|
-
name:
|
|
797
|
+
disabled: i.disabled,
|
|
798
|
+
invalid: i.invalid,
|
|
799
|
+
label: i.label,
|
|
800
|
+
message: i.message,
|
|
801
|
+
name: i.name,
|
|
802
802
|
onChange: n,
|
|
803
|
-
options:
|
|
804
|
-
placeholder:
|
|
805
|
-
required:
|
|
806
|
-
values:
|
|
803
|
+
options: i.options,
|
|
804
|
+
placeholder: i.placeholder,
|
|
805
|
+
required: i.required,
|
|
806
|
+
values: i.values,
|
|
807
807
|
fullwidth: !0
|
|
808
808
|
},
|
|
809
|
-
|
|
809
|
+
i.name
|
|
810
810
|
)
|
|
811
|
-
] },
|
|
812
|
-
},
|
|
811
|
+
] }, i.name)) });
|
|
812
|
+
}, It = (e) => {
|
|
813
813
|
console.log(e);
|
|
814
|
-
const { dataDecision: t, originalDecision: n } = e,
|
|
814
|
+
const { dataDecision: t, originalDecision: n } = e, i = {
|
|
815
815
|
conditionName: t.ruleName || "",
|
|
816
816
|
labelName: t.labelName || "",
|
|
817
817
|
conditionDataType: t.decisionDataType || "alphabetical",
|
|
@@ -823,17 +823,17 @@ const Ge = {
|
|
|
823
823
|
return {
|
|
824
824
|
...n,
|
|
825
825
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
826
|
-
(o) => o.hidden ? { ...
|
|
826
|
+
(o) => o.hidden ? { ...i } : o
|
|
827
827
|
)
|
|
828
828
|
};
|
|
829
|
-
},
|
|
829
|
+
}, Rt = (e) => {
|
|
830
830
|
const { decisions: t } = e;
|
|
831
831
|
return t == null ? void 0 : t.map((n) => {
|
|
832
832
|
var o;
|
|
833
|
-
const
|
|
833
|
+
const i = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
|
|
834
834
|
(r) => r.hidden
|
|
835
835
|
);
|
|
836
|
-
return
|
|
836
|
+
return i ? {
|
|
837
837
|
...n,
|
|
838
838
|
ruleName: n.ruleName,
|
|
839
839
|
labelName: n.labelName,
|
|
@@ -841,18 +841,18 @@ const Ge = {
|
|
|
841
841
|
value: n.value,
|
|
842
842
|
howToSetTheDecision: n.howToSetTheDecision,
|
|
843
843
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
844
|
-
(r) => r.hidden ? { ...
|
|
844
|
+
(r) => r.hidden ? { ...i, hidden: !1 } : r
|
|
845
845
|
)
|
|
846
846
|
} : n;
|
|
847
847
|
});
|
|
848
|
-
},
|
|
848
|
+
}, Je = (e) => ({
|
|
849
849
|
schema: H().required("Required").test(
|
|
850
850
|
"non-empty",
|
|
851
851
|
"Value cannot be empty",
|
|
852
852
|
(t) => t != null && t.trim() !== ""
|
|
853
853
|
),
|
|
854
854
|
value: e
|
|
855
|
-
}),
|
|
855
|
+
}), Xe = (e) => ({
|
|
856
856
|
schema: se().test(
|
|
857
857
|
"isArrayOrString",
|
|
858
858
|
"Must be an array of strings/numbers or a single string",
|
|
@@ -861,7 +861,7 @@ const Ge = {
|
|
|
861
861
|
) : typeof t == "string"
|
|
862
862
|
),
|
|
863
863
|
value: e
|
|
864
|
-
}),
|
|
864
|
+
}), Ze = (e) => ({
|
|
865
865
|
schema: se().test(
|
|
866
866
|
"isArrayOrString",
|
|
867
867
|
"Must be an array of strings/numbers or a single string",
|
|
@@ -878,9 +878,9 @@ const Ge = {
|
|
|
878
878
|
to: q().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
|
|
879
879
|
"is-greater",
|
|
880
880
|
"To value must be greater than From value",
|
|
881
|
-
function(
|
|
881
|
+
function(i) {
|
|
882
882
|
const { from: o } = this.parent;
|
|
883
|
-
return
|
|
883
|
+
return i > o;
|
|
884
884
|
}
|
|
885
885
|
)
|
|
886
886
|
}),
|
|
@@ -893,19 +893,19 @@ const Ge = {
|
|
|
893
893
|
schema: H().required("Required"),
|
|
894
894
|
value: e
|
|
895
895
|
}, tt = {
|
|
896
|
-
[y.LIST_OF_VALUES]:
|
|
897
|
-
[y.LIST_OF_VALUES_MULTI]:
|
|
896
|
+
[y.LIST_OF_VALUES]: Xe,
|
|
897
|
+
[y.LIST_OF_VALUES_MULTI]: Ze,
|
|
898
898
|
[y.RANGE]: et,
|
|
899
899
|
[y.GREATER_THAN]: j,
|
|
900
900
|
[y.LESS_THAN]: j,
|
|
901
901
|
[y.EQUAL]: j
|
|
902
|
-
},
|
|
902
|
+
}, Z = (e) => tt[e] || Je;
|
|
903
903
|
function nt({
|
|
904
904
|
decision: e,
|
|
905
905
|
onSubmitEvent: t,
|
|
906
906
|
textValues: n
|
|
907
907
|
}) {
|
|
908
|
-
const
|
|
908
|
+
const i = {
|
|
909
909
|
ruleName: e.ruleName || "",
|
|
910
910
|
decisionDataType: e.decisionDataType || k.ALPHABETICAL,
|
|
911
911
|
howToSetTheDecision: e.howToSetTheDecision || "",
|
|
@@ -920,19 +920,19 @@ function nt({
|
|
|
920
920
|
let o;
|
|
921
921
|
const r = {
|
|
922
922
|
ruleName: H().required("Name is required"),
|
|
923
|
-
value:
|
|
923
|
+
value: K(() => Z(
|
|
924
924
|
o.values.howToSetTheDecision
|
|
925
925
|
)(
|
|
926
926
|
o.values.value,
|
|
927
927
|
o.values.decisionDataType
|
|
928
928
|
).schema),
|
|
929
|
-
conditionsThatEstablishesTheDecision:
|
|
929
|
+
conditionsThatEstablishesTheDecision: K((s, { parent: u }) => {
|
|
930
930
|
var b;
|
|
931
|
-
if ((
|
|
931
|
+
if ((u == null ? void 0 : u.toggleNone) && Object.keys(u.conditionsThatEstablishesTheDecision || {}).length > 0) return O().shape({});
|
|
932
932
|
const l = (b = e.conditionsThatEstablishesTheDecision) == null ? void 0 : b.reduce(
|
|
933
933
|
(T, m) => {
|
|
934
934
|
if (o.values.conditionsThatEstablishesTheDecision[m.conditionName] !== void 0) {
|
|
935
|
-
const C =
|
|
935
|
+
const C = Z(
|
|
936
936
|
m.howToSetTheCondition
|
|
937
937
|
);
|
|
938
938
|
T[m.conditionName] = C(
|
|
@@ -953,63 +953,63 @@ function nt({
|
|
|
953
953
|
);
|
|
954
954
|
})
|
|
955
955
|
};
|
|
956
|
-
n.terms && (r.effectiveFrom =
|
|
956
|
+
n.terms && (r.effectiveFrom = W().required(
|
|
957
957
|
"effective From date is required"
|
|
958
|
-
), r.validUntil =
|
|
958
|
+
), r.validUntil = W().when(
|
|
959
959
|
"checkClosed",
|
|
960
|
-
(
|
|
960
|
+
(s, u, { parent: d }) => (d == null ? void 0 : d.checkClosed) ? u.required("valid Until date is required").test(
|
|
961
961
|
"is-after-startDate",
|
|
962
962
|
"valid Until date must be greater than or equal to Start date",
|
|
963
963
|
function(b) {
|
|
964
964
|
const T = this.parent.effectiveFrom;
|
|
965
965
|
return !T || !b ? !0 : new Date(b) >= new Date(T);
|
|
966
966
|
}
|
|
967
|
-
) :
|
|
967
|
+
) : u.notRequired()
|
|
968
968
|
));
|
|
969
|
-
const
|
|
969
|
+
const h = O(r);
|
|
970
970
|
return o = we({
|
|
971
|
-
initialValues:
|
|
972
|
-
validationSchema:
|
|
971
|
+
initialValues: i,
|
|
972
|
+
validationSchema: h,
|
|
973
973
|
validateOnBlur: !0,
|
|
974
|
-
onSubmit: (
|
|
975
|
-
var
|
|
976
|
-
const
|
|
974
|
+
onSubmit: (s) => {
|
|
975
|
+
var d;
|
|
976
|
+
const u = {
|
|
977
977
|
...e,
|
|
978
|
-
ruleName:
|
|
979
|
-
decisionDataType:
|
|
980
|
-
howToSetTheDecision:
|
|
981
|
-
value:
|
|
982
|
-
effectiveFrom:
|
|
983
|
-
validUntil:
|
|
984
|
-
conditionsThatEstablishesTheDecision: (
|
|
985
|
-
const b =
|
|
978
|
+
ruleName: s.ruleName,
|
|
979
|
+
decisionDataType: s.decisionDataType,
|
|
980
|
+
howToSetTheDecision: s.howToSetTheDecision,
|
|
981
|
+
value: s.value,
|
|
982
|
+
effectiveFrom: s.effectiveFrom,
|
|
983
|
+
validUntil: s.validUntil,
|
|
984
|
+
conditionsThatEstablishesTheDecision: (d = e.conditionsThatEstablishesTheDecision) == null ? void 0 : d.filter((l) => {
|
|
985
|
+
const b = s.conditionsThatEstablishesTheDecision[l.conditionName];
|
|
986
986
|
return b != null && b !== "";
|
|
987
987
|
}).map((l) => ({
|
|
988
988
|
...l,
|
|
989
|
-
value:
|
|
989
|
+
value: s.conditionsThatEstablishesTheDecision[l.conditionName]
|
|
990
990
|
}))
|
|
991
991
|
};
|
|
992
|
-
t(
|
|
992
|
+
t(u);
|
|
993
993
|
}
|
|
994
|
-
}), { formik: o, handleToggleNoneChange: (
|
|
995
|
-
var
|
|
996
|
-
o.setFieldValue("toggleNone",
|
|
997
|
-
if (
|
|
994
|
+
}), { formik: o, handleToggleNoneChange: (s) => {
|
|
995
|
+
var u;
|
|
996
|
+
o.setFieldValue("toggleNone", s), (u = e.conditionsThatEstablishesTheDecision) == null || u.forEach((d) => {
|
|
997
|
+
if (s)
|
|
998
998
|
o.setFieldValue(
|
|
999
|
-
`conditionsThatEstablishesTheDecision.${
|
|
999
|
+
`conditionsThatEstablishesTheDecision.${d.conditionName}`,
|
|
1000
1000
|
void 0
|
|
1001
1001
|
);
|
|
1002
1002
|
else {
|
|
1003
|
-
const l =
|
|
1003
|
+
const l = d.howToSetTheCondition === y.LIST_OF_VALUES_MULTI ? [] : "";
|
|
1004
1004
|
o.setFieldValue(
|
|
1005
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1005
|
+
`conditionsThatEstablishesTheDecision.${d.conditionName}`,
|
|
1006
1006
|
l
|
|
1007
1007
|
);
|
|
1008
1008
|
}
|
|
1009
1009
|
});
|
|
1010
1010
|
} };
|
|
1011
1011
|
}
|
|
1012
|
-
const
|
|
1012
|
+
const it = f.div`
|
|
1013
1013
|
& > div {
|
|
1014
1014
|
border-radius: 8px;
|
|
1015
1015
|
border: 1px solid
|
|
@@ -1018,7 +1018,7 @@ const at = f.div`
|
|
|
1018
1018
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || v.palette.neutral.N30;
|
|
1019
1019
|
}};
|
|
1020
1020
|
}
|
|
1021
|
-
`,
|
|
1021
|
+
`, at = f.div`
|
|
1022
1022
|
width: 100%;
|
|
1023
1023
|
height: 100%;
|
|
1024
1024
|
overflow-y: auto;
|
|
@@ -1039,56 +1039,56 @@ const at = f.div`
|
|
|
1039
1039
|
const {
|
|
1040
1040
|
checked: t,
|
|
1041
1041
|
children: n,
|
|
1042
|
-
handleToggleChange:
|
|
1042
|
+
handleToggleChange: i,
|
|
1043
1043
|
id: o,
|
|
1044
1044
|
labelToggle: r,
|
|
1045
|
-
name:
|
|
1046
|
-
valueToggle:
|
|
1047
|
-
} = e, [
|
|
1048
|
-
|
|
1045
|
+
name: h,
|
|
1046
|
+
valueToggle: c = ""
|
|
1047
|
+
} = e, [s, u] = V(t), d = (l) => {
|
|
1048
|
+
u(l.target.checked), i(l);
|
|
1049
1049
|
};
|
|
1050
1050
|
return Ce(() => {
|
|
1051
|
-
|
|
1052
|
-
}, [t]), /* @__PURE__ */
|
|
1053
|
-
/* @__PURE__ */
|
|
1051
|
+
u(t);
|
|
1052
|
+
}, [t]), /* @__PURE__ */ g(E, { children: [
|
|
1053
|
+
/* @__PURE__ */ a(p, { children: /* @__PURE__ */ a(
|
|
1054
1054
|
re,
|
|
1055
1055
|
{
|
|
1056
|
-
checked:
|
|
1056
|
+
checked: s,
|
|
1057
1057
|
id: o,
|
|
1058
|
-
name:
|
|
1059
|
-
onChange:
|
|
1058
|
+
name: h,
|
|
1059
|
+
onChange: d,
|
|
1060
1060
|
size: "small",
|
|
1061
|
-
value:
|
|
1062
|
-
children: /* @__PURE__ */
|
|
1061
|
+
value: c,
|
|
1062
|
+
children: /* @__PURE__ */ a(x, { size: "medium", type: "label", weight: "bold", children: r })
|
|
1063
1063
|
}
|
|
1064
1064
|
) }),
|
|
1065
|
-
|
|
1065
|
+
s && /* @__PURE__ */ a(E, { children: n })
|
|
1066
1066
|
] });
|
|
1067
1067
|
}, rt = (e) => {
|
|
1068
1068
|
const {
|
|
1069
1069
|
onHandleStartChange: t,
|
|
1070
1070
|
onHandleEndChange: n,
|
|
1071
|
-
onCheckClosedChange:
|
|
1071
|
+
onCheckClosedChange: i,
|
|
1072
1072
|
labelStart: o,
|
|
1073
1073
|
labelEnd: r,
|
|
1074
|
-
checkedClosed:
|
|
1075
|
-
required:
|
|
1076
|
-
valueStart:
|
|
1077
|
-
valueEnd:
|
|
1078
|
-
messageStart:
|
|
1074
|
+
checkedClosed: h = !1,
|
|
1075
|
+
required: c = !1,
|
|
1076
|
+
valueStart: s = "",
|
|
1077
|
+
valueEnd: u = "",
|
|
1078
|
+
messageStart: d = "",
|
|
1079
1079
|
messageEnd: l = "",
|
|
1080
1080
|
statusStart: b = "pending",
|
|
1081
1081
|
statusEnd: T = "pending"
|
|
1082
|
-
} = e, [m, w] = V(
|
|
1083
|
-
w(S.checked),
|
|
1082
|
+
} = e, [m, w] = V(h), [C, A] = V(s), [U, M] = V(u), G = ({ target: S }) => {
|
|
1083
|
+
w(S.checked), i && i(S.checked);
|
|
1084
1084
|
}, he = (S) => {
|
|
1085
1085
|
A(S.target.value), t(S);
|
|
1086
1086
|
}, ue = (S) => {
|
|
1087
1087
|
M(S.target.value), n(S);
|
|
1088
|
-
}, pe =
|
|
1089
|
-
return /* @__PURE__ */
|
|
1090
|
-
/* @__PURE__ */ p
|
|
1091
|
-
/* @__PURE__ */
|
|
1088
|
+
}, pe = R("(max-width: 400px)");
|
|
1089
|
+
return /* @__PURE__ */ g(E, { children: [
|
|
1090
|
+
/* @__PURE__ */ g(p, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
1091
|
+
/* @__PURE__ */ a(
|
|
1092
1092
|
x,
|
|
1093
1093
|
{
|
|
1094
1094
|
appearance: "gray",
|
|
@@ -1099,14 +1099,14 @@ const at = f.div`
|
|
|
1099
1099
|
children: "Vigencia"
|
|
1100
1100
|
}
|
|
1101
1101
|
),
|
|
1102
|
-
/* @__PURE__ */
|
|
1103
|
-
|
|
1102
|
+
/* @__PURE__ */ a(
|
|
1103
|
+
p,
|
|
1104
1104
|
{
|
|
1105
1105
|
alignContent: "center",
|
|
1106
1106
|
justifyContent: "center",
|
|
1107
1107
|
wrap: "wrap",
|
|
1108
1108
|
gap: "4px",
|
|
1109
|
-
children: /* @__PURE__ */
|
|
1109
|
+
children: /* @__PURE__ */ a(
|
|
1110
1110
|
xe,
|
|
1111
1111
|
{
|
|
1112
1112
|
label: "Cerrada",
|
|
@@ -1118,34 +1118,34 @@ const at = f.div`
|
|
|
1118
1118
|
}
|
|
1119
1119
|
)
|
|
1120
1120
|
] }),
|
|
1121
|
-
/* @__PURE__ */
|
|
1122
|
-
|
|
1121
|
+
/* @__PURE__ */ g(
|
|
1122
|
+
p,
|
|
1123
1123
|
{
|
|
1124
1124
|
direction: pe ? "column" : "row",
|
|
1125
1125
|
justifyContent: "space-between",
|
|
1126
1126
|
gap: "24px",
|
|
1127
1127
|
children: [
|
|
1128
|
-
/* @__PURE__ */
|
|
1128
|
+
/* @__PURE__ */ a(
|
|
1129
1129
|
Q,
|
|
1130
1130
|
{
|
|
1131
1131
|
id: "dateStart",
|
|
1132
1132
|
label: o,
|
|
1133
1133
|
onChange: he,
|
|
1134
1134
|
value: C,
|
|
1135
|
-
required:
|
|
1135
|
+
required: c,
|
|
1136
1136
|
size: "compact",
|
|
1137
1137
|
status: b,
|
|
1138
|
-
message:
|
|
1138
|
+
message: d
|
|
1139
1139
|
}
|
|
1140
1140
|
),
|
|
1141
|
-
m && /* @__PURE__ */
|
|
1141
|
+
m && /* @__PURE__ */ a(
|
|
1142
1142
|
Q,
|
|
1143
1143
|
{
|
|
1144
1144
|
id: "dateEnd",
|
|
1145
1145
|
label: r,
|
|
1146
1146
|
onChange: ue,
|
|
1147
1147
|
value: U,
|
|
1148
|
-
required:
|
|
1148
|
+
required: c,
|
|
1149
1149
|
size: "compact",
|
|
1150
1150
|
status: T,
|
|
1151
1151
|
message: l
|
|
@@ -1159,72 +1159,72 @@ const at = f.div`
|
|
|
1159
1159
|
const {
|
|
1160
1160
|
formik: t,
|
|
1161
1161
|
textValues: n,
|
|
1162
|
-
onCancel:
|
|
1162
|
+
onCancel: i,
|
|
1163
1163
|
visibleConditions: o,
|
|
1164
1164
|
normalizedDecision: r,
|
|
1165
|
-
handleToggleNoneChange:
|
|
1166
|
-
handleConditionToggleChange:
|
|
1167
|
-
showConditionsError:
|
|
1168
|
-
termStartStatus:
|
|
1169
|
-
termEndStatus:
|
|
1165
|
+
handleToggleNoneChange: h,
|
|
1166
|
+
handleConditionToggleChange: c,
|
|
1167
|
+
showConditionsError: s,
|
|
1168
|
+
termStartStatus: u,
|
|
1169
|
+
termEndStatus: d
|
|
1170
1170
|
} = e;
|
|
1171
|
-
return /* @__PURE__ */
|
|
1172
|
-
|
|
1171
|
+
return /* @__PURE__ */ a("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ g(p, { direction: "column", gap: "24px", children: [
|
|
1172
|
+
Y({
|
|
1173
1173
|
condition: r,
|
|
1174
1174
|
formik: t,
|
|
1175
1175
|
isDecision: !0
|
|
1176
1176
|
}),
|
|
1177
|
-
/* @__PURE__ */
|
|
1178
|
-
/* @__PURE__ */
|
|
1179
|
-
|
|
1177
|
+
/* @__PURE__ */ a(D, { dashed: !0 }),
|
|
1178
|
+
/* @__PURE__ */ a(it, { children: /* @__PURE__ */ a(at, { children: /* @__PURE__ */ g(
|
|
1179
|
+
p,
|
|
1180
1180
|
{
|
|
1181
1181
|
direction: "column",
|
|
1182
1182
|
padding: "6px 12px",
|
|
1183
1183
|
gap: "16px",
|
|
1184
1184
|
height: "272px",
|
|
1185
1185
|
children: [
|
|
1186
|
-
/* @__PURE__ */
|
|
1187
|
-
|
|
1186
|
+
/* @__PURE__ */ g(
|
|
1187
|
+
p,
|
|
1188
1188
|
{
|
|
1189
1189
|
justifyContent: "space-between",
|
|
1190
1190
|
alignItems: "center",
|
|
1191
1191
|
gap: "64px",
|
|
1192
1192
|
children: [
|
|
1193
|
-
/* @__PURE__ */
|
|
1194
|
-
/* @__PURE__ */
|
|
1193
|
+
/* @__PURE__ */ a(x, { type: "title", size: "small", weight: "bold", appearance: "gray", children: n.factsThatConditionIt }),
|
|
1194
|
+
/* @__PURE__ */ a(
|
|
1195
1195
|
re,
|
|
1196
1196
|
{
|
|
1197
1197
|
id: "toggleNone",
|
|
1198
|
-
onChange: () =>
|
|
1198
|
+
onChange: () => h(!t.values.toggleNone),
|
|
1199
1199
|
checked: t.values.toggleNone,
|
|
1200
1200
|
size: "small",
|
|
1201
|
-
children: /* @__PURE__ */
|
|
1201
|
+
children: /* @__PURE__ */ a(x, { as: "span", size: "medium", type: "label", weight: "bold", children: n.none })
|
|
1202
1202
|
}
|
|
1203
1203
|
)
|
|
1204
1204
|
]
|
|
1205
1205
|
}
|
|
1206
1206
|
),
|
|
1207
|
-
/* @__PURE__ */
|
|
1207
|
+
/* @__PURE__ */ a(p, { direction: "column", gap: "20px", children: o == null ? void 0 : o.map((l) => /* @__PURE__ */ a(
|
|
1208
1208
|
ot,
|
|
1209
1209
|
{
|
|
1210
1210
|
id: `toggle-${l.conditionName}`,
|
|
1211
1211
|
name: `toggle.${l.conditionName}`,
|
|
1212
1212
|
labelToggle: l.labelName,
|
|
1213
1213
|
checked: !t.values.toggleNone && t.values.conditionsThatEstablishesTheDecision[l.conditionName] !== void 0,
|
|
1214
|
-
handleToggleChange: (b) =>
|
|
1214
|
+
handleToggleChange: (b) => c(
|
|
1215
1215
|
l.conditionName,
|
|
1216
1216
|
l.howToSetTheCondition === y.LIST_OF_VALUES_MULTI
|
|
1217
1217
|
)(b.target.checked),
|
|
1218
|
-
children:
|
|
1218
|
+
children: Y({ condition: l, formik: t })
|
|
1219
1219
|
},
|
|
1220
1220
|
l.conditionName
|
|
1221
1221
|
)) })
|
|
1222
1222
|
]
|
|
1223
1223
|
}
|
|
1224
1224
|
) }) }),
|
|
1225
|
-
n.terms && /* @__PURE__ */
|
|
1226
|
-
/* @__PURE__ */
|
|
1227
|
-
/* @__PURE__ */
|
|
1225
|
+
n.terms && /* @__PURE__ */ g(E, { children: [
|
|
1226
|
+
/* @__PURE__ */ a(D, { dashed: !0 }),
|
|
1227
|
+
/* @__PURE__ */ a(
|
|
1228
1228
|
rt,
|
|
1229
1229
|
{
|
|
1230
1230
|
labelStart: n.termStart,
|
|
@@ -1233,8 +1233,8 @@ const at = f.div`
|
|
|
1233
1233
|
valueEnd: t.values.validUntil,
|
|
1234
1234
|
messageStart: t.errors.effectiveFrom,
|
|
1235
1235
|
messageEnd: t.errors.validUntil,
|
|
1236
|
-
statusStart:
|
|
1237
|
-
statusEnd:
|
|
1236
|
+
statusStart: u,
|
|
1237
|
+
statusEnd: d,
|
|
1238
1238
|
onHandleStartChange: (l) => t.setFieldValue("effectiveFrom", l.target.value),
|
|
1239
1239
|
onHandleEndChange: (l) => t.setFieldValue("validUntil", l.target.value),
|
|
1240
1240
|
onCheckClosedChange: (l) => {
|
|
@@ -1244,38 +1244,38 @@ const at = f.div`
|
|
|
1244
1244
|
}
|
|
1245
1245
|
)
|
|
1246
1246
|
] }),
|
|
1247
|
-
/* @__PURE__ */
|
|
1248
|
-
|
|
1249
|
-
/* @__PURE__ */ p
|
|
1250
|
-
/* @__PURE__ */
|
|
1251
|
-
/* @__PURE__ */
|
|
1247
|
+
/* @__PURE__ */ a(D, {}),
|
|
1248
|
+
s && /* @__PURE__ */ a(x, { type: "label", size: "medium", appearance: "danger", children: String(t.errors.conditionsThatEstablishesTheDecision) }),
|
|
1249
|
+
/* @__PURE__ */ g(p, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
1250
|
+
/* @__PURE__ */ a(N, { appearance: "gray", onClick: i, children: n.cancel }),
|
|
1251
|
+
/* @__PURE__ */ a(N, { type: "submit", children: n.confirm })
|
|
1252
1252
|
] })
|
|
1253
1253
|
] }) });
|
|
1254
1254
|
}, st = (e) => {
|
|
1255
1255
|
var T;
|
|
1256
|
-
const { decision: t, onSubmitEvent: n, textValues:
|
|
1256
|
+
const { decision: t, onSubmitEvent: n, textValues: i, onCancel: o } = e, { formik: r, handleToggleNoneChange: h } = nt({
|
|
1257
1257
|
decision: t,
|
|
1258
1258
|
onSubmitEvent: n,
|
|
1259
|
-
textValues:
|
|
1260
|
-
}),
|
|
1259
|
+
textValues: i
|
|
1260
|
+
}), c = {
|
|
1261
1261
|
ruleName: t.ruleName,
|
|
1262
1262
|
labelName: t.labelName,
|
|
1263
1263
|
howToSetTheCondition: t.howToSetTheDecision,
|
|
1264
1264
|
decisionDataType: t.decisionDataType,
|
|
1265
1265
|
listOfPossibleValues: t.listOfPossibleValues
|
|
1266
|
-
},
|
|
1266
|
+
}, s = ((T = t.conditionsThatEstablishesTheDecision) == null ? void 0 : T.filter(
|
|
1267
1267
|
(m) => !m.hidden
|
|
1268
|
-
)) || [],
|
|
1269
|
-
return /* @__PURE__ */
|
|
1268
|
+
)) || [], u = !!r.errors.conditionsThatEstablishesTheDecision && r.submitCount > 0, d = r.touched.effectiveFrom ? r.errors.effectiveFrom ? "invalid" : "valid" : void 0, l = r.touched.validUntil ? r.errors.validUntil ? "invalid" : "valid" : void 0;
|
|
1269
|
+
return /* @__PURE__ */ a(
|
|
1270
1270
|
lt,
|
|
1271
1271
|
{
|
|
1272
1272
|
formik: r,
|
|
1273
1273
|
onCancel: o,
|
|
1274
|
-
textValues:
|
|
1274
|
+
textValues: i,
|
|
1275
1275
|
decision: t,
|
|
1276
|
-
visibleConditions:
|
|
1277
|
-
normalizedDecision:
|
|
1278
|
-
handleToggleNoneChange:
|
|
1276
|
+
visibleConditions: s,
|
|
1277
|
+
normalizedDecision: c,
|
|
1278
|
+
handleToggleNoneChange: h,
|
|
1279
1279
|
handleConditionToggleChange: (m, w) => (C) => {
|
|
1280
1280
|
if (!C)
|
|
1281
1281
|
r.setFieldValue(
|
|
@@ -1294,62 +1294,56 @@ const at = f.div`
|
|
|
1294
1294
|
);
|
|
1295
1295
|
}
|
|
1296
1296
|
},
|
|
1297
|
-
showConditionsError:
|
|
1298
|
-
termStartStatus:
|
|
1297
|
+
showConditionsError: u,
|
|
1298
|
+
termStartStatus: d,
|
|
1299
1299
|
termEndStatus: l
|
|
1300
1300
|
}
|
|
1301
1301
|
);
|
|
1302
|
-
},
|
|
1302
|
+
}, Mt = (e) => {
|
|
1303
1303
|
var o;
|
|
1304
|
-
const { decisionTemplate: t } = e, n = { ...t },
|
|
1304
|
+
const { decisionTemplate: t } = e, n = { ...t }, i = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
|
|
1305
1305
|
(r) => r.switchPlaces
|
|
1306
1306
|
);
|
|
1307
|
-
return
|
|
1307
|
+
return i ? {
|
|
1308
1308
|
...n,
|
|
1309
|
-
ruleName:
|
|
1310
|
-
labelName:
|
|
1311
|
-
decisionDataType:
|
|
1312
|
-
value:
|
|
1313
|
-
howToSetTheDecision:
|
|
1309
|
+
ruleName: i.conditionName,
|
|
1310
|
+
labelName: i.labelName,
|
|
1311
|
+
decisionDataType: i.conditionDataType,
|
|
1312
|
+
value: i.value,
|
|
1313
|
+
howToSetTheDecision: i.howToSetTheCondition,
|
|
1314
1314
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
1315
|
-
(r) => r.conditionName ===
|
|
1315
|
+
(r) => r.conditionName === i.conditionName ? { ...r, hidden: !0 } : r
|
|
1316
1316
|
)
|
|
1317
1317
|
} : n;
|
|
1318
|
-
},
|
|
1318
|
+
}, Lt = (e) => {
|
|
1319
1319
|
const { decisions: t } = e;
|
|
1320
1320
|
return t == null ? void 0 : t.map((n) => {
|
|
1321
1321
|
var o;
|
|
1322
|
-
const
|
|
1322
|
+
const i = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
|
|
1323
1323
|
(r) => r.switchPlaces
|
|
1324
1324
|
);
|
|
1325
|
-
return
|
|
1325
|
+
return i ? {
|
|
1326
1326
|
...n,
|
|
1327
|
-
ruleName:
|
|
1328
|
-
labelName:
|
|
1329
|
-
decisionDataType:
|
|
1330
|
-
value:
|
|
1331
|
-
howToSetTheDecision:
|
|
1327
|
+
ruleName: i.conditionName,
|
|
1328
|
+
labelName: i.labelName,
|
|
1329
|
+
decisionDataType: i.conditionDataType,
|
|
1330
|
+
value: i.value,
|
|
1331
|
+
howToSetTheDecision: i.howToSetTheCondition,
|
|
1332
1332
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
1333
|
-
(r) => r.conditionName ===
|
|
1333
|
+
(r) => r.conditionName === i.conditionName ? { ...r, hidden: !0 } : r
|
|
1334
1334
|
)
|
|
1335
1335
|
} : n;
|
|
1336
1336
|
});
|
|
1337
1337
|
}, $ = /* @__PURE__ */ new Map(), dt = (e, t) => $.get(`${t}:${e}`), ct = (e, t, n) => {
|
|
1338
|
-
const
|
|
1339
|
-
if ($.set(
|
|
1338
|
+
const i = `${t}:${e}`;
|
|
1339
|
+
if ($.set(i, n), $.size > 1e3) {
|
|
1340
1340
|
const o = $.keys().next().value;
|
|
1341
1341
|
o !== void 0 && $.delete(o);
|
|
1342
1342
|
}
|
|
1343
|
-
}, ht = (e) => {
|
|
1344
|
-
const t = e.trim();
|
|
1345
|
-
if (t.length < 3) return !1;
|
|
1346
|
-
if (/^(Mr|Mrs|Ms|Dr|Sr|Sra)\.?\s+[A-ZÁÉÍÓÚÑ][a-záéíóúñ]+(?:\s[A-ZÁÉÍÓÚÑ][a-záéíóúñ]+)?$/.test(t)) return !0;
|
|
1347
|
-
const a = /^[A-ZÁÉÍÓÚÑ][a-záéíóúñ]+(?:\s[A-ZÁÉÍÓÚÑ][a-záéíóúñ]+){1,2}$/;
|
|
1348
|
-
return t === t.toUpperCase() ? !1 : a.test(t);
|
|
1349
|
-
}, ee = /* @__PURE__ */ new Map(), ut = 1e3, pt = (e) => {
|
|
1343
|
+
}, ee = /* @__PURE__ */ new Map(), ht = 1e3, ut = (e) => {
|
|
1350
1344
|
const t = Date.now(), n = ee.get(e) || 0;
|
|
1351
|
-
return t - n <
|
|
1352
|
-
},
|
|
1345
|
+
return t - n < ht ? !0 : (ee.set(e, t), !1);
|
|
1346
|
+
}, pt = (e) => {
|
|
1353
1347
|
const t = De(e);
|
|
1354
1348
|
return {
|
|
1355
1349
|
spa: "es",
|
|
@@ -1359,60 +1353,66 @@ const at = f.div`
|
|
|
1359
1353
|
ita: "it",
|
|
1360
1354
|
por: "pt"
|
|
1361
1355
|
}[t] || "en";
|
|
1362
|
-
},
|
|
1363
|
-
|
|
1364
|
-
if (
|
|
1365
|
-
|
|
1366
|
-
if (a) return a;
|
|
1367
|
-
if (pt(n))
|
|
1356
|
+
}, gt = async (e, t, { url: n, apiKey: i }) => {
|
|
1357
|
+
const o = `${t}:${e}`, r = dt(e, t);
|
|
1358
|
+
if (r) return r;
|
|
1359
|
+
if (ut(o))
|
|
1368
1360
|
return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
|
|
1369
|
-
const
|
|
1361
|
+
const h = pt(e);
|
|
1370
1362
|
try {
|
|
1371
|
-
const { data: c } = await Se.
|
|
1372
|
-
|
|
1363
|
+
const { data: c } = await Se.post(
|
|
1364
|
+
n,
|
|
1365
|
+
{
|
|
1373
1366
|
q: e,
|
|
1374
|
-
|
|
1367
|
+
source: h,
|
|
1368
|
+
target: t,
|
|
1369
|
+
api_key: i
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
headers: {
|
|
1373
|
+
"Content-Type": "application/json"
|
|
1374
|
+
}
|
|
1375
1375
|
}
|
|
1376
|
-
|
|
1377
|
-
return ct(e, t,
|
|
1376
|
+
), s = (c == null ? void 0 : c.translatedText) || e;
|
|
1377
|
+
return ct(e, t, s), s;
|
|
1378
1378
|
} catch (c) {
|
|
1379
1379
|
return console.warn(`[Translation] Failed for: "${e}"`, c), e;
|
|
1380
1380
|
}
|
|
1381
|
-
},
|
|
1382
|
-
const
|
|
1383
|
-
Object.entries(e).map(async ([
|
|
1384
|
-
if (
|
|
1385
|
-
const
|
|
1386
|
-
return [
|
|
1387
|
-
} else if (Array.isArray(
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1390
|
-
async (c) => typeof c == "object" && c !== null ? await te(c, t) : c
|
|
1381
|
+
}, mt = (e) => typeof e == "string" && e.trim().length > 0, te = async (e, t, n) => {
|
|
1382
|
+
const i = await Promise.all(
|
|
1383
|
+
Object.entries(e).map(async ([o, r]) => {
|
|
1384
|
+
if (mt(r)) {
|
|
1385
|
+
const h = await gt(r, t, n);
|
|
1386
|
+
return [o, h];
|
|
1387
|
+
} else if (Array.isArray(r)) {
|
|
1388
|
+
const h = await Promise.all(
|
|
1389
|
+
r.map(
|
|
1390
|
+
async (c) => typeof c == "object" && c !== null ? await te(c, t, n) : c
|
|
1391
1391
|
)
|
|
1392
1392
|
);
|
|
1393
|
-
return [
|
|
1394
|
-
} else if (typeof
|
|
1395
|
-
const
|
|
1396
|
-
return [
|
|
1393
|
+
return [o, h];
|
|
1394
|
+
} else if (typeof r == "object" && r !== null) {
|
|
1395
|
+
const h = await te(r, t, n);
|
|
1396
|
+
return [o, h];
|
|
1397
1397
|
} else
|
|
1398
|
-
return [
|
|
1398
|
+
return [o, r];
|
|
1399
1399
|
})
|
|
1400
1400
|
);
|
|
1401
|
-
return Object.fromEntries(
|
|
1401
|
+
return Object.fromEntries(i);
|
|
1402
1402
|
};
|
|
1403
1403
|
export {
|
|
1404
1404
|
P as BusinessRuleCard,
|
|
1405
1405
|
de as BusinessRuleView,
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1406
|
+
kt as BusinessRules,
|
|
1407
|
+
At as Filter,
|
|
1408
|
+
Ft as FilterModal,
|
|
1409
|
+
$t as FormFilter,
|
|
1410
|
+
_e as ModalRules,
|
|
1411
1411
|
st as RulesForm,
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1412
|
+
It as revertSortedDataSampleSwitchPlaces,
|
|
1413
|
+
Rt as revertSortedDataSwitchPlaces,
|
|
1414
|
+
Mt as sortDisplayDataSampleSwitchPlaces,
|
|
1415
|
+
Lt as sortDisplayDataSwitchPlaces,
|
|
1416
1416
|
te as translateObject,
|
|
1417
|
-
|
|
1417
|
+
gt as translateText
|
|
1418
1418
|
};
|