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