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