@isettingkit/business-rules 1.0.23 → 1.0.24
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.js +130 -121
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as r, jsxs as h, Fragment as E } from "react/jsx-runtime";
|
|
2
2
|
import { MdOutlineDelete as Te, MdClear as ye, MdAdd as J, MdExpandLess as Me, MdExpandMore as we, MdClose as Le, MdOutlineFilterAltOff as Ce, MdOutlineFilterAlt as De, MdChevronRight as ze, MdArrowRight as Ue } from "react-icons/md";
|
|
3
|
-
import { inube as x, Stack as g, Divider as
|
|
3
|
+
import { inube as x, Stack as g, Divider as O, Icon as F, Text as w, SkeletonLine as V, useMediaQuery as H, Blanket as Se, Button as U, Grid as X, Box as Ve, Tag as q, SkeletonIcon as Be, OptionList as je, Checkpicker as He, Toggle as ke, Checkbox as _e, Date as ue } from "@inubekit/inubekit";
|
|
4
4
|
import T, { keyframes as Ne, ThemeContext as qe } from "styled-components";
|
|
5
|
-
import { ValueDataType as
|
|
5
|
+
import { ValueDataType as R, ValueHowToSetUp as B, DecisionConditionRender as pe } from "@isettingkit/input";
|
|
6
6
|
import { DecisionViewConditionRenderer as Z, DecisionViewConditionRendererNew as Q } from "@isettingkit/view";
|
|
7
7
|
import { createPortal as Ee } from "react-dom";
|
|
8
8
|
import W, { useState as M, useRef as Y, useEffect as oe, useContext as Pe } from "react";
|
|
@@ -51,9 +51,9 @@ const le = (e) => {
|
|
|
51
51
|
return /* @__PURE__ */ r(Je, { children: /* @__PURE__ */ h(g, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
52
52
|
n,
|
|
53
53
|
t && /* @__PURE__ */ h(E, { children: [
|
|
54
|
-
/* @__PURE__ */ r(
|
|
54
|
+
/* @__PURE__ */ r(O, {}),
|
|
55
55
|
/* @__PURE__ */ r(g, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ r(
|
|
56
|
-
|
|
56
|
+
F,
|
|
57
57
|
{
|
|
58
58
|
cursorHover: !0,
|
|
59
59
|
appearance: "danger",
|
|
@@ -131,7 +131,7 @@ const on = {
|
|
|
131
131
|
type: "decision"
|
|
132
132
|
}
|
|
133
133
|
) }, t.ruleName),
|
|
134
|
-
/* @__PURE__ */ r(
|
|
134
|
+
/* @__PURE__ */ r(O, { dashed: !0 }),
|
|
135
135
|
/* @__PURE__ */ r(me, { children: /* @__PURE__ */ h(
|
|
136
136
|
g,
|
|
137
137
|
{
|
|
@@ -161,7 +161,7 @@ const on = {
|
|
|
161
161
|
}
|
|
162
162
|
) }) }, p.conditionName)),
|
|
163
163
|
l && /* @__PURE__ */ h(E, { children: [
|
|
164
|
-
/* @__PURE__ */ r(
|
|
164
|
+
/* @__PURE__ */ r(O, { dashed: !0 }),
|
|
165
165
|
a && /* @__PURE__ */ r(
|
|
166
166
|
Z,
|
|
167
167
|
{
|
|
@@ -181,7 +181,7 @@ const on = {
|
|
|
181
181
|
/* @__PURE__ */ r(V, { animated: !0, width: "85px" })
|
|
182
182
|
] }, "loading"),
|
|
183
183
|
/* @__PURE__ */ h(g, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
184
|
-
/* @__PURE__ */ r(
|
|
184
|
+
/* @__PURE__ */ r(O, { dashed: !0 }),
|
|
185
185
|
/* @__PURE__ */ r(V, { animated: !0, width: "150px" })
|
|
186
186
|
] }),
|
|
187
187
|
/* @__PURE__ */ r(me, { children: /* @__PURE__ */ r(
|
|
@@ -214,7 +214,7 @@ const on = {
|
|
|
214
214
|
labelName: a == null ? void 0 : a.terms,
|
|
215
215
|
value: String(n.effectiveFrom),
|
|
216
216
|
howToSetTheDecision: B.RANGE,
|
|
217
|
-
decisionDataType:
|
|
217
|
+
decisionDataType: R.DATE
|
|
218
218
|
},
|
|
219
219
|
valueData: P({
|
|
220
220
|
labelName: a == null ? void 0 : a.terms,
|
|
@@ -223,20 +223,20 @@ const on = {
|
|
|
223
223
|
to: String(n.validUntil)
|
|
224
224
|
},
|
|
225
225
|
howToSetTheDecision: B.RANGE,
|
|
226
|
-
decisionDataType:
|
|
226
|
+
decisionDataType: R.DATE
|
|
227
227
|
})
|
|
228
228
|
} : o && !i ? {
|
|
229
229
|
element: {
|
|
230
230
|
labelName: a == null ? void 0 : a.terms,
|
|
231
231
|
value: String(n.effectiveFrom),
|
|
232
232
|
howToSetTheDecision: B.EQUAL,
|
|
233
|
-
decisionDataType:
|
|
233
|
+
decisionDataType: R.DATE
|
|
234
234
|
},
|
|
235
235
|
valueData: P({
|
|
236
236
|
labelName: a == null ? void 0 : a.terms,
|
|
237
237
|
value: String(n.effectiveFrom),
|
|
238
238
|
howToSetTheDecision: B.EQUAL,
|
|
239
|
-
decisionDataType:
|
|
239
|
+
decisionDataType: R.DATE
|
|
240
240
|
})
|
|
241
241
|
} : null, l = n ? {
|
|
242
242
|
labelName: n.labelName || "",
|
|
@@ -442,7 +442,7 @@ const un = T.div`
|
|
|
442
442
|
handleView: () => a ? a() : null,
|
|
443
443
|
controls: !1,
|
|
444
444
|
children: /* @__PURE__ */ h(g, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
445
|
-
/* @__PURE__ */ r(
|
|
445
|
+
/* @__PURE__ */ r(F, { appearance: "gray", icon: /* @__PURE__ */ r(J, {}), size: "35px" }),
|
|
446
446
|
/* @__PURE__ */ r(w, { appearance: "gray", type: "body", size: "large", children: i })
|
|
447
447
|
] })
|
|
448
448
|
}
|
|
@@ -490,7 +490,7 @@ const un = T.div`
|
|
|
490
490
|
})
|
|
491
491
|
), s = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !o && n;
|
|
492
492
|
return { renderedCards: d, shouldRenderAddCard: s };
|
|
493
|
-
},
|
|
493
|
+
}, Rt = (e) => {
|
|
494
494
|
const {
|
|
495
495
|
controls: n = !0,
|
|
496
496
|
customTitleContentAddCard: t,
|
|
@@ -740,7 +740,7 @@ const En = (e) => {
|
|
|
740
740
|
/* @__PURE__ */ h(g, { gap: "8px", children: [
|
|
741
741
|
/* @__PURE__ */ r(q, { appearance: "gray", label: l, displayIcon: !1 }),
|
|
742
742
|
/* @__PURE__ */ r(
|
|
743
|
-
|
|
743
|
+
F,
|
|
744
744
|
{
|
|
745
745
|
appearance: "dark",
|
|
746
746
|
icon: d ? /* @__PURE__ */ r(Me, {}) : /* @__PURE__ */ r(we, {}),
|
|
@@ -755,7 +755,7 @@ const En = (e) => {
|
|
|
755
755
|
t.ruleName
|
|
756
756
|
),
|
|
757
757
|
d && /* @__PURE__ */ h(E, { children: [
|
|
758
|
-
/* @__PURE__ */ r(
|
|
758
|
+
/* @__PURE__ */ r(O, { dashed: !0 }),
|
|
759
759
|
/* @__PURE__ */ h(g, { direction: "column", gap: "12px", children: [
|
|
760
760
|
/* @__PURE__ */ r(
|
|
761
761
|
w,
|
|
@@ -858,26 +858,26 @@ const En = (e) => {
|
|
|
858
858
|
labelName: a == null ? void 0 : a.effectiveFrom,
|
|
859
859
|
value: String(n.effectiveFrom),
|
|
860
860
|
howToSetTheDecision: B.EQUAL,
|
|
861
|
-
decisionDataType:
|
|
861
|
+
decisionDataType: R.DATE
|
|
862
862
|
},
|
|
863
863
|
valueData: G({
|
|
864
864
|
labelName: a == null ? void 0 : a.effectiveFrom,
|
|
865
865
|
value: String(n.effectiveFrom),
|
|
866
866
|
howToSetTheDecision: B.EQUAL,
|
|
867
|
-
decisionDataType:
|
|
867
|
+
decisionDataType: R.DATE
|
|
868
868
|
})
|
|
869
869
|
} : null, p = d ? {
|
|
870
870
|
element: {
|
|
871
871
|
labelName: a == null ? void 0 : a.validUntil,
|
|
872
872
|
value: String(n.validUntil),
|
|
873
873
|
howToSetTheDecision: B.EQUAL,
|
|
874
|
-
decisionDataType:
|
|
874
|
+
decisionDataType: R.DATE
|
|
875
875
|
},
|
|
876
876
|
valueData: G({
|
|
877
877
|
labelName: a == null ? void 0 : a.validUntil,
|
|
878
878
|
value: String(n.validUntil),
|
|
879
879
|
howToSetTheDecision: B.EQUAL,
|
|
880
|
-
decisionDataType:
|
|
880
|
+
decisionDataType: R.DATE
|
|
881
881
|
})
|
|
882
882
|
} : null, c = n ? {
|
|
883
883
|
labelName: n.labelName || "",
|
|
@@ -1053,7 +1053,7 @@ const An = T.div`
|
|
|
1053
1053
|
children: [
|
|
1054
1054
|
/* @__PURE__ */ r(w, { appearance: "gray", type: "label", size: "large", weight: "bold", children: n || "Agregar decisión" }),
|
|
1055
1055
|
/* @__PURE__ */ r(
|
|
1056
|
-
|
|
1056
|
+
F,
|
|
1057
1057
|
{
|
|
1058
1058
|
appearance: "gray",
|
|
1059
1059
|
icon: /* @__PURE__ */ r(J, {}),
|
|
@@ -1113,7 +1113,7 @@ const An = T.div`
|
|
|
1113
1113
|
})
|
|
1114
1114
|
), c = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !o && n;
|
|
1115
1115
|
return { renderedCards: p, shouldRenderAddCard: c };
|
|
1116
|
-
},
|
|
1116
|
+
}, Ot = (e) => {
|
|
1117
1117
|
const {
|
|
1118
1118
|
controls: n = !0,
|
|
1119
1119
|
customTitleContentAddCard: t,
|
|
@@ -1247,7 +1247,7 @@ const An = T.div`
|
|
|
1247
1247
|
height: ${({ $height: e }) => e};
|
|
1248
1248
|
box-sizing: border-box;
|
|
1249
1249
|
`;
|
|
1250
|
-
function
|
|
1250
|
+
function jn(e) {
|
|
1251
1251
|
const {
|
|
1252
1252
|
children: n,
|
|
1253
1253
|
padding: t = "16px",
|
|
@@ -1268,7 +1268,7 @@ function Hn(e) {
|
|
|
1268
1268
|
}
|
|
1269
1269
|
);
|
|
1270
1270
|
}
|
|
1271
|
-
const
|
|
1271
|
+
const Hn = (e, n) => {
|
|
1272
1272
|
const [t, a] = M([]), [o, i] = M([]), [u, l] = M(!1), d = Y(null);
|
|
1273
1273
|
return oe(() => {
|
|
1274
1274
|
if (!e.current || !d.current) return;
|
|
@@ -1384,7 +1384,7 @@ const _n = T.div`
|
|
|
1384
1384
|
width: "100%",
|
|
1385
1385
|
children: [
|
|
1386
1386
|
a && /* @__PURE__ */ r(
|
|
1387
|
-
|
|
1387
|
+
F,
|
|
1388
1388
|
{
|
|
1389
1389
|
icon: a,
|
|
1390
1390
|
size: "medium",
|
|
@@ -1401,7 +1401,7 @@ const _n = T.div`
|
|
|
1401
1401
|
}
|
|
1402
1402
|
),
|
|
1403
1403
|
/* @__PURE__ */ r(
|
|
1404
|
-
|
|
1404
|
+
F,
|
|
1405
1405
|
{
|
|
1406
1406
|
icon: /* @__PURE__ */ r(Le, {}),
|
|
1407
1407
|
size: "small",
|
|
@@ -1417,7 +1417,7 @@ const _n = T.div`
|
|
|
1417
1417
|
)
|
|
1418
1418
|
}
|
|
1419
1419
|
);
|
|
1420
|
-
},
|
|
1420
|
+
}, Mt = (e) => {
|
|
1421
1421
|
const {
|
|
1422
1422
|
appliedFilters: n = [],
|
|
1423
1423
|
onClear: t,
|
|
@@ -1430,7 +1430,7 @@ const _n = T.div`
|
|
|
1430
1430
|
hidden: c,
|
|
1431
1431
|
showOverflowIndicator: m,
|
|
1432
1432
|
measurementRef: b
|
|
1433
|
-
} =
|
|
1433
|
+
} = Hn(l, n), [f, y] = M(!1), D = (v) => {
|
|
1434
1434
|
v.stopPropagation(), y((k) => !k);
|
|
1435
1435
|
};
|
|
1436
1436
|
oe(() => {
|
|
@@ -1450,7 +1450,7 @@ const _n = T.div`
|
|
|
1450
1450
|
var k, L;
|
|
1451
1451
|
(L = (k = c.find((I) => I.label === v)) == null ? void 0 : k.onClose) == null || L.call(k), y(!1);
|
|
1452
1452
|
};
|
|
1453
|
-
return /* @__PURE__ */ h(
|
|
1453
|
+
return /* @__PURE__ */ h(jn, { borderRadius: "8px", width: "100%", children: [
|
|
1454
1454
|
/* @__PURE__ */ r(qn, { ref: b, children: n.map((v) => /* @__PURE__ */ r("div", { "data-filter-tag": "true", children: /* @__PURE__ */ r(
|
|
1455
1455
|
q,
|
|
1456
1456
|
{
|
|
@@ -1503,7 +1503,7 @@ const _n = T.div`
|
|
|
1503
1503
|
}
|
|
1504
1504
|
) }),
|
|
1505
1505
|
N && /* @__PURE__ */ r(_n, { ref: d, children: /* @__PURE__ */ r(
|
|
1506
|
-
|
|
1506
|
+
je,
|
|
1507
1507
|
{
|
|
1508
1508
|
options: A,
|
|
1509
1509
|
onOptionClick: $,
|
|
@@ -1564,7 +1564,7 @@ const _n = T.div`
|
|
|
1564
1564
|
padding: 24px;
|
|
1565
1565
|
gap: 24px;
|
|
1566
1566
|
box-sizing: border-box;
|
|
1567
|
-
`,
|
|
1567
|
+
`, Lt = (e) => {
|
|
1568
1568
|
const {
|
|
1569
1569
|
actionButtonLabel: n,
|
|
1570
1570
|
cancelButtonLabel: t,
|
|
@@ -1587,7 +1587,7 @@ const _n = T.div`
|
|
|
1587
1587
|
/* @__PURE__ */ h(g, { alignItems: "center", children: [
|
|
1588
1588
|
/* @__PURE__ */ r(w, { children: "Cerrar" }),
|
|
1589
1589
|
/* @__PURE__ */ r(
|
|
1590
|
-
|
|
1590
|
+
F,
|
|
1591
1591
|
{
|
|
1592
1592
|
appearance: "dark",
|
|
1593
1593
|
icon: /* @__PURE__ */ r(ye, {}),
|
|
@@ -1597,7 +1597,7 @@ const _n = T.div`
|
|
|
1597
1597
|
)
|
|
1598
1598
|
] })
|
|
1599
1599
|
] }),
|
|
1600
|
-
/* @__PURE__ */ r(
|
|
1600
|
+
/* @__PURE__ */ r(O, {})
|
|
1601
1601
|
] }),
|
|
1602
1602
|
a,
|
|
1603
1603
|
/* @__PURE__ */ h(g, { gap: "20px", justifyContent: "flex-end", children: [
|
|
@@ -1627,12 +1627,12 @@ const _n = T.div`
|
|
|
1627
1627
|
] }) }),
|
|
1628
1628
|
p
|
|
1629
1629
|
);
|
|
1630
|
-
},
|
|
1630
|
+
}, zt = (e) => {
|
|
1631
1631
|
const { appliedFilters: n, fields: t, onChange: a, noFiltersLabel: o } = e, i = H("(max-width: 768px)"), u = !n || n.length === 0;
|
|
1632
1632
|
return /* @__PURE__ */ h(g, { direction: "column", gap: "16px", children: [
|
|
1633
1633
|
i && /* @__PURE__ */ h(E, { children: [
|
|
1634
1634
|
/* @__PURE__ */ h(g, { gap: "6px", width: "100%", alignItems: "center", children: [
|
|
1635
|
-
/* @__PURE__ */ r(
|
|
1635
|
+
/* @__PURE__ */ r(F, { appearance: "gray", icon: /* @__PURE__ */ r(De, {}) }),
|
|
1636
1636
|
/* @__PURE__ */ r(
|
|
1637
1637
|
z,
|
|
1638
1638
|
{
|
|
@@ -1660,12 +1660,12 @@ const _n = T.div`
|
|
|
1660
1660
|
}
|
|
1661
1661
|
)
|
|
1662
1662
|
] }),
|
|
1663
|
-
/* @__PURE__ */ r(
|
|
1663
|
+
/* @__PURE__ */ r(O, { dashed: !0 })
|
|
1664
1664
|
] }),
|
|
1665
1665
|
t.map((l) => /* @__PURE__ */ h(g, { gap: "6px", alignItems: "center", children: [
|
|
1666
|
-
/* @__PURE__ */ r(g, { padding: "22px 0 0 0", children: /* @__PURE__ */ r(
|
|
1666
|
+
/* @__PURE__ */ r(g, { padding: "22px 0 0 0", children: /* @__PURE__ */ r(F, { appearance: "primary", icon: l.icon }) }),
|
|
1667
1667
|
/* @__PURE__ */ r(
|
|
1668
|
-
|
|
1668
|
+
He,
|
|
1669
1669
|
{
|
|
1670
1670
|
disabled: l.disabled,
|
|
1671
1671
|
invalid: l.invalid,
|
|
@@ -1686,7 +1686,7 @@ const _n = T.div`
|
|
|
1686
1686
|
}, Yn = (e) => {
|
|
1687
1687
|
const n = [];
|
|
1688
1688
|
return e.from !== void 0 && e.from !== null && n.push(`>${e.from}`), e.to !== void 0 && e.to !== null && n.push(`<${e.to}`), n.join(";");
|
|
1689
|
-
},
|
|
1689
|
+
}, Ut = (e) => {
|
|
1690
1690
|
var u;
|
|
1691
1691
|
const { decision: n, fallbackId: t, template: a } = e, o = (l) => typeof l == "object" && l !== null && "from" in l && "to" in l ? Yn(l) : l, i = ((u = n.conditionsThatEstablishesTheDecision) == null ? void 0 : u.map((l, d) => {
|
|
1692
1692
|
var c;
|
|
@@ -1704,7 +1704,7 @@ const _n = T.div`
|
|
|
1704
1704
|
value: o(n.value),
|
|
1705
1705
|
conditionsThatEstablishesTheDecision: i
|
|
1706
1706
|
};
|
|
1707
|
-
},
|
|
1707
|
+
}, Vt = (e) => {
|
|
1708
1708
|
if (typeof e != "string") return e;
|
|
1709
1709
|
const n = e.split(";").map((a) => a.trim()), t = {};
|
|
1710
1710
|
for (const a of n)
|
|
@@ -1716,7 +1716,7 @@ const _n = T.div`
|
|
|
1716
1716
|
isNaN(o) || (t.to = o);
|
|
1717
1717
|
}
|
|
1718
1718
|
return t.from !== void 0 || t.to !== void 0 ? t : e;
|
|
1719
|
-
},
|
|
1719
|
+
}, Bt = (e) => {
|
|
1720
1720
|
const { dataDecision: n, originalDecision: t } = e, a = {
|
|
1721
1721
|
conditionName: n.ruleName || "",
|
|
1722
1722
|
labelName: n.labelName || "",
|
|
@@ -1732,7 +1732,7 @@ const _n = T.div`
|
|
|
1732
1732
|
(o) => o.hidden ? { ...a } : o
|
|
1733
1733
|
)
|
|
1734
1734
|
};
|
|
1735
|
-
},
|
|
1735
|
+
}, jt = (e) => {
|
|
1736
1736
|
const { decisions: n } = e;
|
|
1737
1737
|
return n == null ? void 0 : n.map((t) => {
|
|
1738
1738
|
var o;
|
|
@@ -1792,7 +1792,7 @@ const _n = T.div`
|
|
|
1792
1792
|
}),
|
|
1793
1793
|
value: { from: n, to: t }
|
|
1794
1794
|
};
|
|
1795
|
-
}, ee = (e, n) => n ===
|
|
1795
|
+
}, ee = (e, n) => n === R.PERCENTAGE ? {
|
|
1796
1796
|
schema: ne().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
|
|
1797
1797
|
value: e
|
|
1798
1798
|
} : {
|
|
@@ -1813,7 +1813,7 @@ function nt({
|
|
|
1813
1813
|
}) {
|
|
1814
1814
|
const a = {
|
|
1815
1815
|
ruleName: e.ruleName || "",
|
|
1816
|
-
decisionDataType: e.decisionDataType ||
|
|
1816
|
+
decisionDataType: e.decisionDataType || R.ALPHABETICAL,
|
|
1817
1817
|
howToSetTheDecision: e.howToSetTheDecision || "",
|
|
1818
1818
|
value: e.value || "",
|
|
1819
1819
|
effectiveFrom: e.effectiveFrom || "",
|
|
@@ -2080,7 +2080,7 @@ const tt = T.div`
|
|
|
2080
2080
|
formik: n,
|
|
2081
2081
|
isDecision: !0
|
|
2082
2082
|
}),
|
|
2083
|
-
/* @__PURE__ */ r(
|
|
2083
|
+
/* @__PURE__ */ r(O, { dashed: !0 }),
|
|
2084
2084
|
/* @__PURE__ */ r(tt, { children: /* @__PURE__ */ r(at, { children: /* @__PURE__ */ h(
|
|
2085
2085
|
g,
|
|
2086
2086
|
{
|
|
@@ -2129,7 +2129,7 @@ const tt = T.div`
|
|
|
2129
2129
|
}
|
|
2130
2130
|
) }) }),
|
|
2131
2131
|
t.terms && /* @__PURE__ */ h(E, { children: [
|
|
2132
|
-
/* @__PURE__ */ r(
|
|
2132
|
+
/* @__PURE__ */ r(O, { dashed: !0 }),
|
|
2133
2133
|
/* @__PURE__ */ r(
|
|
2134
2134
|
ot,
|
|
2135
2135
|
{
|
|
@@ -2150,7 +2150,7 @@ const tt = T.div`
|
|
|
2150
2150
|
}
|
|
2151
2151
|
)
|
|
2152
2152
|
] }),
|
|
2153
|
-
/* @__PURE__ */ r(
|
|
2153
|
+
/* @__PURE__ */ r(O, {}),
|
|
2154
2154
|
d && /* @__PURE__ */ r(w, { type: "label", size: "medium", appearance: "danger", children: String(n.errors.conditionsThatEstablishesTheDecision) }),
|
|
2155
2155
|
/* @__PURE__ */ h(g, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
2156
2156
|
/* @__PURE__ */ r(U, { appearance: "gray", onClick: a, children: t.cancel }),
|
|
@@ -2221,7 +2221,7 @@ const tt = T.div`
|
|
|
2221
2221
|
(i) => i.conditionName === a.conditionName ? { ...i, hidden: !0 } : i
|
|
2222
2222
|
)
|
|
2223
2223
|
} : t;
|
|
2224
|
-
},
|
|
2224
|
+
}, _t = (e) => {
|
|
2225
2225
|
const { decisions: n } = e;
|
|
2226
2226
|
return n == null ? void 0 : n.map((t) => {
|
|
2227
2227
|
var o;
|
|
@@ -2280,6 +2280,9 @@ const tt = T.div`
|
|
|
2280
2280
|
var t, a, o, i, u, l;
|
|
2281
2281
|
return n ? ((o = (a = (t = e == null ? void 0 : e.menu) == null ? void 0 : t.item) == null ? void 0 : a.background) == null ? void 0 : o.active) || j.item.background.active : ((l = (u = (i = e == null ? void 0 : e.menu) == null ? void 0 : i.item) == null ? void 0 : u.background) == null ? void 0 : l.inactive) || j.item.background.inactive;
|
|
2282
2282
|
}};
|
|
2283
|
+
&:last-child {
|
|
2284
|
+
border-radius: 0 0 8px 8px;
|
|
2285
|
+
}
|
|
2283
2286
|
&:hover {
|
|
2284
2287
|
cursor: ${({ $disabled: e }) => e ? "not-allowed" : "pointer"};
|
|
2285
2288
|
background-color: ${({ $active: e, theme: n, $disabled: t }) => {
|
|
@@ -2295,10 +2298,21 @@ const tt = T.div`
|
|
|
2295
2298
|
width: 100%;
|
|
2296
2299
|
outline: none;
|
|
2297
2300
|
cursor: pointer;
|
|
2298
|
-
`, ct =
|
|
2299
|
-
|
|
2301
|
+
`, ct = T.div`
|
|
2302
|
+
& > div {
|
|
2303
|
+
border-bottom: 1px solid
|
|
2304
|
+
${({ theme: e, $active: n }) => {
|
|
2305
|
+
var t, a, o, i;
|
|
2306
|
+
return n ? ((a = (t = e == null ? void 0 : e.border) == null ? void 0 : t.expanded) == null ? void 0 : a.color) || j.border.expanded.color : ((i = (o = e == null ? void 0 : e.border) == null ? void 0 : o.contracted) == null ? void 0 : i.color) || j.border.contracted.color;
|
|
2307
|
+
}};
|
|
2308
|
+
border-radius: 8px 8px 0 0;
|
|
2309
|
+
}
|
|
2310
|
+
`, ut = (e) => {
|
|
2311
|
+
const { isOpen: n, links: t, onClick: a, title: o, activeId: i } = e, u = (l) => {
|
|
2312
|
+
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), a());
|
|
2313
|
+
};
|
|
2300
2314
|
return /* @__PURE__ */ r(lt, { $active: n, children: /* @__PURE__ */ h(z, { border: !0, borderRadius: "8px", width: "100%", children: [
|
|
2301
|
-
/* @__PURE__ */ r(
|
|
2315
|
+
/* @__PURE__ */ r(ct, { $active: n && t.length > 0, children: /* @__PURE__ */ r(
|
|
2302
2316
|
z,
|
|
2303
2317
|
{
|
|
2304
2318
|
alignItems: "center",
|
|
@@ -2310,20 +2324,18 @@ const tt = T.div`
|
|
|
2310
2324
|
st,
|
|
2311
2325
|
{
|
|
2312
2326
|
onClick: a,
|
|
2313
|
-
onKeyDown:
|
|
2314
|
-
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), a());
|
|
2315
|
-
},
|
|
2327
|
+
onKeyDown: u,
|
|
2316
2328
|
role: "button",
|
|
2317
2329
|
tabIndex: 0,
|
|
2318
2330
|
"aria-expanded": n,
|
|
2319
2331
|
"aria-controls": "dropdown-links",
|
|
2320
2332
|
children: [
|
|
2321
2333
|
/* @__PURE__ */ r(
|
|
2322
|
-
|
|
2334
|
+
F,
|
|
2323
2335
|
{
|
|
2324
2336
|
appearance: n ? "primary" : "dark",
|
|
2325
2337
|
cursorHover: !0,
|
|
2326
|
-
icon: n ? /* @__PURE__ */ r(we, {}) : /* @__PURE__ */ r(ze, {})
|
|
2338
|
+
icon: n && t.length > 0 ? /* @__PURE__ */ r(we, {}) : /* @__PURE__ */ r(ze, {})
|
|
2327
2339
|
}
|
|
2328
2340
|
),
|
|
2329
2341
|
/* @__PURE__ */ r(
|
|
@@ -2341,45 +2353,42 @@ const tt = T.div`
|
|
|
2341
2353
|
}
|
|
2342
2354
|
)
|
|
2343
2355
|
}
|
|
2344
|
-
),
|
|
2345
|
-
n && /* @__PURE__ */
|
|
2346
|
-
|
|
2347
|
-
/* @__PURE__ */ r(
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
{
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
);
|
|
2379
|
-
}) })
|
|
2380
|
-
] })
|
|
2356
|
+
) }),
|
|
2357
|
+
n && t.length > 0 && /* @__PURE__ */ r(E, { children: /* @__PURE__ */ r(g, { direction: "column", children: t.map((l) => {
|
|
2358
|
+
const d = l.id === i;
|
|
2359
|
+
return /* @__PURE__ */ r(
|
|
2360
|
+
Qe,
|
|
2361
|
+
{
|
|
2362
|
+
to: l.path,
|
|
2363
|
+
style: { textDecoration: "none" },
|
|
2364
|
+
children: /* @__PURE__ */ r(dt, { $active: d, children: /* @__PURE__ */ h(
|
|
2365
|
+
g,
|
|
2366
|
+
{
|
|
2367
|
+
alignItems: "center",
|
|
2368
|
+
direction: "row",
|
|
2369
|
+
gap: "8px",
|
|
2370
|
+
padding: d ? "8px 4px" : "8px 32px",
|
|
2371
|
+
children: [
|
|
2372
|
+
d && /* @__PURE__ */ r(F, { appearance: "primary", icon: /* @__PURE__ */ r(Ue, {}) }),
|
|
2373
|
+
/* @__PURE__ */ r(
|
|
2374
|
+
w,
|
|
2375
|
+
{
|
|
2376
|
+
appearance: d ? "primary" : "dark",
|
|
2377
|
+
size: "small",
|
|
2378
|
+
type: "title",
|
|
2379
|
+
weight: d ? "bold" : "normal",
|
|
2380
|
+
children: l.label
|
|
2381
|
+
}
|
|
2382
|
+
)
|
|
2383
|
+
]
|
|
2384
|
+
}
|
|
2385
|
+
) })
|
|
2386
|
+
},
|
|
2387
|
+
l.id
|
|
2388
|
+
);
|
|
2389
|
+
}) }) })
|
|
2381
2390
|
] }) });
|
|
2382
|
-
},
|
|
2391
|
+
}, pt = T.div`
|
|
2383
2392
|
& > div {
|
|
2384
2393
|
background: ${({ $background: e, theme: n }) => {
|
|
2385
2394
|
var t, a, o, i;
|
|
@@ -2387,7 +2396,7 @@ const tt = T.div`
|
|
|
2387
2396
|
}};
|
|
2388
2397
|
}
|
|
2389
2398
|
height: 90vh;
|
|
2390
|
-
`,
|
|
2399
|
+
`, qt = (e) => {
|
|
2391
2400
|
const { collapseOnNavigate: n = !1, defaultOpenId: t = null, groups: a } = e, [o, i] = W.useState(t), u = We();
|
|
2392
2401
|
W.useEffect(() => {
|
|
2393
2402
|
n && i(null);
|
|
@@ -2399,8 +2408,8 @@ const tt = T.div`
|
|
|
2399
2408
|
},
|
|
2400
2409
|
[u.pathname]
|
|
2401
2410
|
);
|
|
2402
|
-
return /* @__PURE__ */ r(
|
|
2403
|
-
|
|
2411
|
+
return /* @__PURE__ */ r(pt, { $background: !0, children: /* @__PURE__ */ r(g, { direction: "column", gap: "8px", padding: "12px", height: "100%", children: a.map((d) => /* @__PURE__ */ r(
|
|
2412
|
+
ut,
|
|
2404
2413
|
{
|
|
2405
2414
|
activeId: l(d.links),
|
|
2406
2415
|
isOpen: o === d.id,
|
|
@@ -2410,16 +2419,16 @@ const tt = T.div`
|
|
|
2410
2419
|
},
|
|
2411
2420
|
d.id
|
|
2412
2421
|
)) }) });
|
|
2413
|
-
}, _ = /* @__PURE__ */ new Map(),
|
|
2422
|
+
}, _ = /* @__PURE__ */ new Map(), ht = (e, n) => _.get(`${n}:${e}`), gt = (e, n, t) => {
|
|
2414
2423
|
const a = `${n}:${e}`;
|
|
2415
2424
|
if (_.set(a, t), _.size > 1e3) {
|
|
2416
2425
|
const o = _.keys().next().value;
|
|
2417
2426
|
o !== void 0 && _.delete(o);
|
|
2418
2427
|
}
|
|
2419
|
-
}, ve = /* @__PURE__ */ new Map(),
|
|
2428
|
+
}, ve = /* @__PURE__ */ new Map(), bt = 1e3, mt = (e) => {
|
|
2420
2429
|
const n = Date.now(), t = ve.get(e) || 0;
|
|
2421
|
-
return n - t <
|
|
2422
|
-
},
|
|
2430
|
+
return n - t < bt ? !0 : (ve.set(e, n), !1);
|
|
2431
|
+
}, ft = (e) => {
|
|
2423
2432
|
const n = Ke(e);
|
|
2424
2433
|
return {
|
|
2425
2434
|
spa: "es",
|
|
@@ -2429,12 +2438,12 @@ const tt = T.div`
|
|
|
2429
2438
|
ita: "it",
|
|
2430
2439
|
por: "pt"
|
|
2431
2440
|
}[n] || "en";
|
|
2432
|
-
},
|
|
2433
|
-
const o = `${n}:${e}`, i =
|
|
2441
|
+
}, vt = async (e, n, { url: t, apiKey: a }) => {
|
|
2442
|
+
const o = `${n}:${e}`, i = ht(e, n);
|
|
2434
2443
|
if (i) return i;
|
|
2435
|
-
if (
|
|
2444
|
+
if (mt(o))
|
|
2436
2445
|
return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
|
|
2437
|
-
const u =
|
|
2446
|
+
const u = ft(e);
|
|
2438
2447
|
try {
|
|
2439
2448
|
const { data: l } = await Ye.post(
|
|
2440
2449
|
t,
|
|
@@ -2450,15 +2459,15 @@ const tt = T.div`
|
|
|
2450
2459
|
}
|
|
2451
2460
|
}
|
|
2452
2461
|
), d = (l == null ? void 0 : l.translatedText) || e;
|
|
2453
|
-
return
|
|
2462
|
+
return gt(e, n, d), d;
|
|
2454
2463
|
} catch (l) {
|
|
2455
2464
|
return console.warn(`[Translation] Failed for: "${e}"`, l), e;
|
|
2456
2465
|
}
|
|
2457
|
-
},
|
|
2466
|
+
}, xt = (e) => typeof e == "string" && e.trim().length > 0, xe = async (e, n, t) => {
|
|
2458
2467
|
const a = await Promise.all(
|
|
2459
2468
|
Object.entries(e).map(async ([o, i]) => {
|
|
2460
|
-
if (
|
|
2461
|
-
const u = await
|
|
2469
|
+
if (xt(i)) {
|
|
2470
|
+
const u = await vt(i, n, t);
|
|
2462
2471
|
return [o, u];
|
|
2463
2472
|
} else if (Array.isArray(i)) {
|
|
2464
2473
|
const u = await Promise.all(
|
|
@@ -2481,22 +2490,22 @@ export {
|
|
|
2481
2490
|
Fe as BusinessRuleCardNew,
|
|
2482
2491
|
Ae as BusinessRuleView,
|
|
2483
2492
|
Re as BusinessRuleViewNew,
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2493
|
+
Rt as BusinessRules,
|
|
2494
|
+
Ot as BusinessRulesNew,
|
|
2495
|
+
ut as DropdownMenu,
|
|
2496
|
+
qt as DropdownMenuContainer,
|
|
2497
|
+
Mt as Filter,
|
|
2498
|
+
Lt as FilterModal,
|
|
2499
|
+
zt as FormFilter,
|
|
2491
2500
|
Ie as ModalRules,
|
|
2492
2501
|
Oe as RulesForm,
|
|
2493
2502
|
Yn as convertRangeToString,
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2503
|
+
Ut as formatDecisionForBackend,
|
|
2504
|
+
Vt as parseRangeFromString,
|
|
2505
|
+
Bt as revertSortedDataSampleSwitchPlaces,
|
|
2506
|
+
jt as revertSortedDataSwitchPlaces,
|
|
2498
2507
|
Ht as sortDisplayDataSampleSwitchPlaces,
|
|
2499
|
-
|
|
2508
|
+
_t as sortDisplayDataSwitchPlaces,
|
|
2500
2509
|
xe as translateObject,
|
|
2501
|
-
|
|
2510
|
+
vt as translateText
|
|
2502
2511
|
};
|