@isettingkit/business-rules 0.1.28 → 0.1.29

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.
Files changed (2) hide show
  1. package/dist/index.es.js +410 -418
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -1,44 +1,44 @@
1
- import { jsxs as c, Fragment as F, jsx as t } from "react/jsx-runtime";
2
- import { ValueDataType as V, ValueHowToSetUp as g, InputRange as te, MultipleChoices as re, DynamicField as ae } from "@isettingkit/input";
1
+ import { jsxs as c, Fragment as _, jsx as a } from "react/jsx-runtime";
2
+ import { ValueDataType as F, ValueHowToSetUp as f, InputRange as ae, MultipleChoices as re, DynamicField as ne } from "@isettingkit/input";
3
3
  import { Stack as s } from "@inubekit/stack";
4
- import { Divider as k } from "@inubekit/divider";
5
- import { Button as G } from "@inubekit/button";
6
- import { useState as _, useEffect as ne } from "react";
4
+ import { Divider as T } from "@inubekit/divider";
5
+ import { Button as P } from "@inubekit/button";
6
+ import { useState as z, useEffect as oe } from "react";
7
7
  import { Text as y } from "@inubekit/text";
8
- import { Date as P } from "@inubekit/date";
9
- import { Checkbox as oe } from "@inubekit/checkbox";
10
- import { Toggle as J } from "@inubekit/toggle";
8
+ import { Date as Q } from "@inubekit/date";
9
+ import { Checkbox as le } from "@inubekit/checkbox";
10
+ import { Toggle as K } from "@inubekit/toggle";
11
11
  import { inube as S } from "@inubekit/foundations";
12
- import f, { keyframes as le } from "styled-components";
12
+ import b, { keyframes as de } from "styled-components";
13
13
  import { useFormik as ie } from "formik";
14
- import { mixed as K, object as A, number as R, string as B, date as Q, lazy as de } from "yup";
14
+ import { mixed as X, object as V, number as L, string as B, date as Y, lazy as se } from "yup";
15
15
  import { DecisionViewConditionRenderer as q } from "@isettingkit/view";
16
16
  import { SkeletonLine as D } from "@inubekit/skeleton";
17
- import { MdOutlineDelete as se, MdClear as ce, MdAdd as ue } from "react-icons/md";
18
- import { Icon as X } from "@inubekit/icon";
19
- import { createPortal as he } from "react-dom";
20
- import { Blanket as pe } from "@inubekit/blanket";
21
- import { Grid as ge } from "@inubekit/grid";
22
- import { useMediaQuery as me } from "@inubekit/hooks";
23
- const be = (r) => {
17
+ import { MdOutlineDelete as ce, MdClear as ue, MdAdd as he } from "react-icons/md";
18
+ import { Icon as Z } from "@inubekit/icon";
19
+ import { createPortal as pe } from "react-dom";
20
+ import { Blanket as ge } from "@inubekit/blanket";
21
+ import { Grid as me } from "@inubekit/grid";
22
+ import { useMediaQuery as be } from "@inubekit/hooks";
23
+ const fe = (e) => {
24
24
  const {
25
- onHandleStartChange: e,
25
+ onHandleStartChange: t,
26
26
  onHandleEndChange: o,
27
- onCheckClosedChange: i,
27
+ onCheckClosedChange: d,
28
28
  labelStart: h,
29
- labelEnd: a,
30
- checkedClosed: d = !1,
29
+ labelEnd: r,
30
+ checkedClosed: i = !1,
31
31
  required: l = !1,
32
32
  valueStart: u = "",
33
33
  valueEnd: p = "",
34
- messageStart: b = "",
35
- messageEnd: m = "",
36
- statusStart: x = "pending",
34
+ messageStart: m = "",
35
+ messageEnd: g = "",
36
+ statusStart: v = "pending",
37
37
  statusEnd: w = "pending"
38
- } = r, [n, N] = _(d), [U, I] = _(u), [L, $] = _(p);
39
- return /* @__PURE__ */ c(F, { children: [
38
+ } = e, [n, R] = z(i), [N, I] = z(u), [U, $] = z(p);
39
+ return /* @__PURE__ */ c(_, { children: [
40
40
  /* @__PURE__ */ c(s, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
41
- /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
41
+ /* @__PURE__ */ a(s, { children: /* @__PURE__ */ a(
42
42
  y,
43
43
  {
44
44
  appearance: "gray",
@@ -49,19 +49,19 @@ const be = (r) => {
49
49
  children: "Vigencia"
50
50
  }
51
51
  ) }),
52
- /* @__PURE__ */ t(
52
+ /* @__PURE__ */ a(
53
53
  s,
54
54
  {
55
55
  alignContent: "center",
56
56
  justifyContent: "center",
57
57
  wrap: "wrap",
58
58
  gap: "4px",
59
- children: /* @__PURE__ */ t(
60
- oe,
59
+ children: /* @__PURE__ */ a(
60
+ le,
61
61
  {
62
62
  label: "Cerrada",
63
- onChange: ({ target: v }) => {
64
- N(v.checked), i && i(v.checked);
63
+ onChange: ({ target: x }) => {
64
+ R(x.checked), d && d(x.checked);
65
65
  },
66
66
  checked: n,
67
67
  value: ""
@@ -71,44 +71,44 @@ const be = (r) => {
71
71
  )
72
72
  ] }),
73
73
  /* @__PURE__ */ c(s, { justifyContent: "space-between", gap: "24px", children: [
74
- /* @__PURE__ */ t(s, { width: "189px", children: /* @__PURE__ */ t(
75
- P,
74
+ /* @__PURE__ */ a(s, { width: "189px", children: /* @__PURE__ */ a(
75
+ Q,
76
76
  {
77
77
  id: "dateStart",
78
78
  label: h,
79
- onChange: (v) => {
80
- I(v.target.value), e(v);
79
+ onChange: (x) => {
80
+ I(x.target.value), t(x);
81
81
  },
82
- value: U,
82
+ value: N,
83
83
  required: l,
84
84
  size: "compact",
85
- status: x,
86
- message: b
85
+ status: v,
86
+ message: m
87
87
  }
88
88
  ) }),
89
- n && /* @__PURE__ */ t(s, { width: "189px", children: /* @__PURE__ */ t(
90
- P,
89
+ n && /* @__PURE__ */ a(s, { width: "189px", children: /* @__PURE__ */ a(
90
+ Q,
91
91
  {
92
92
  id: "dateEnd",
93
- label: a,
94
- onChange: (v) => {
95
- $(v.target.value), o(v);
93
+ label: r,
94
+ onChange: (x) => {
95
+ $(x.target.value), o(x);
96
96
  },
97
- value: L,
97
+ value: U,
98
98
  required: l,
99
99
  size: "compact",
100
100
  status: w,
101
- message: m
101
+ message: g
102
102
  }
103
103
  ) })
104
104
  ] })
105
105
  ] });
106
- }, fe = f.div`
106
+ }, ve = b.div`
107
107
  & > div {
108
108
  border-radius: 8px;
109
109
  border: 1px solid ${S.palette.neutral.N30};
110
110
  }
111
- `, xe = f.div`
111
+ `, xe = b.div`
112
112
  width: 100%;
113
113
  height: 100%;
114
114
  overflow-y: auto;
@@ -125,129 +125,129 @@ const be = (r) => {
125
125
  background-color: #ebecf0;
126
126
  border-radius: 8px;
127
127
  }
128
- `, ve = (r) => {
128
+ `, ye = (e) => {
129
129
  const {
130
- checked: e,
130
+ checked: t,
131
131
  children: o,
132
- handleToggleChange: i,
132
+ handleToggleChange: d,
133
133
  id: h,
134
- labelToggle: a,
135
- name: d,
134
+ labelToggle: r,
135
+ name: i,
136
136
  valueToggle: l = ""
137
- } = r, [u, p] = _(e), b = (m) => {
138
- p(m.target.checked), i(m);
137
+ } = e, [u, p] = z(t), m = (g) => {
138
+ p(g.target.checked), d(g);
139
139
  };
140
- return ne(() => {
141
- p(e);
142
- }, [e]), /* @__PURE__ */ c(F, { children: [
143
- /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
144
- J,
140
+ return oe(() => {
141
+ p(t);
142
+ }, [t]), /* @__PURE__ */ c(_, { children: [
143
+ /* @__PURE__ */ a(s, { children: /* @__PURE__ */ a(
144
+ K,
145
145
  {
146
146
  checked: u,
147
147
  id: h,
148
- name: d,
149
- onChange: b,
148
+ name: i,
149
+ onChange: m,
150
150
  size: "small",
151
151
  value: l,
152
- children: /* @__PURE__ */ t(y, { size: "medium", type: "label", weight: "bold", children: a })
152
+ children: /* @__PURE__ */ a(y, { size: "medium", type: "label", weight: "bold", children: r })
153
153
  }
154
154
  ) }),
155
- u && /* @__PURE__ */ t(F, { children: o })
155
+ u && /* @__PURE__ */ a(_, { children: o })
156
156
  ] });
157
- }, ye = (r) => ({
158
- schema: K().test(
157
+ }, Ce = (e) => ({
158
+ schema: X().test(
159
159
  "isArrayOrString",
160
160
  "Must be an array of strings/numbers or a single string",
161
- (e) => Array.isArray(e) ? e.every(
161
+ (t) => Array.isArray(t) ? t.every(
162
162
  (o) => typeof o == "string" || typeof o == "number"
163
- ) : typeof e == "string"
163
+ ) : typeof t == "string"
164
164
  ),
165
- value: r
166
- }), Ce = (r) => ({
167
- schema: K().test(
165
+ value: e
166
+ }), we = (e) => ({
167
+ schema: X().test(
168
168
  "isArrayOrString",
169
169
  "Must be an array of strings/numbers or a single string",
170
- (e) => Array.isArray(e) ? e.every(
170
+ (t) => Array.isArray(t) ? t.every(
171
171
  (o) => typeof o == "string" || typeof o == "number"
172
- ) : typeof e == "string"
172
+ ) : typeof t == "string"
173
173
  ),
174
- value: r
175
- }), we = (r) => {
176
- const e = (r == null ? void 0 : r.from) ?? 0, o = (r == null ? void 0 : r.to) ?? 0;
174
+ value: e
175
+ }), Se = (e) => {
176
+ const t = (e == null ? void 0 : e.from) ?? 0, o = (e == null ? void 0 : e.to) ?? 0;
177
177
  return {
178
- schema: A({
179
- from: R().required("Range From is required").max(o, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
180
- to: R().required("Range To is required").min(e, "'Range To' cannot be less than 'Range From'").min(0, "'Range To' cannot be less than 0")
178
+ schema: V({
179
+ from: L().required("Range From is required").max(o, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
180
+ to: L().required("Range To is required").min(t, "'Range To' cannot be less than 'Range From'").min(0, "'Range To' cannot be less than 0")
181
181
  }),
182
- value: { from: e, to: o }
182
+ value: { from: t, to: o }
183
183
  };
184
- }, M = (r, e) => e === V.PERCENTAGE ? {
185
- schema: R().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
186
- value: r
184
+ }, j = (e, t) => t === F.PERCENTAGE ? {
185
+ schema: L().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
186
+ value: e
187
187
  } : {
188
188
  schema: B().required("Required"),
189
- value: r
190
- }, Se = (r) => ({
189
+ value: e
190
+ }, ke = (e) => ({
191
191
  schema: B().required("Required").test(
192
192
  "non-empty",
193
193
  "Value cannot be empty",
194
- (e) => e != null && e.trim() !== ""
194
+ (t) => t != null && t.trim() !== ""
195
195
  ),
196
- value: r
197
- }), ke = {
198
- [g.LIST_OF_VALUES]: ye,
199
- [g.LIST_OF_VALUES_MULTI]: Ce,
200
- [g.RANGE]: we,
201
- [g.GREATER_THAN]: M,
202
- [g.LESS_THAN]: M,
203
- [g.EQUAL]: M
204
- }, Te = (r) => ke[r] || Se;
205
- function De({ decision: r, onSubmitEvent: e }) {
196
+ value: e
197
+ }), Te = {
198
+ [f.LIST_OF_VALUES]: Ce,
199
+ [f.LIST_OF_VALUES_MULTI]: we,
200
+ [f.RANGE]: Se,
201
+ [f.GREATER_THAN]: j,
202
+ [f.LESS_THAN]: j,
203
+ [f.EQUAL]: j
204
+ }, Ee = (e) => Te[e] || ke;
205
+ function De({ decision: e, onSubmitEvent: t }) {
206
206
  const o = {
207
- name: r.name || "",
208
- dataType: r.dataType || "",
209
- valueUse: r.valueUse || "",
210
- value: r.value || { from: 0, to: 0 },
211
- startDate: r.startDate || "",
212
- endDate: r.endDate || "",
207
+ name: e.name || "",
208
+ dataType: e.dataType || "",
209
+ valueUse: e.valueUse || "",
210
+ value: e.value || { from: 0, to: 0 },
211
+ startDate: e.startDate || "",
212
+ endDate: e.endDate || "",
213
213
  toggleNone: !0,
214
214
  conditions: {},
215
215
  checkClosed: !1
216
- }, i = A({
216
+ }, d = V({
217
217
  name: B().required("Name is required"),
218
- startDate: Q().required("Start date is required"),
219
- endDate: Q().when("checkClosed", (d, l, { parent: u }) => (u == null ? void 0 : u.checkClosed) ? l.required("End date is required").test(
218
+ startDate: Y().required("Start date is required"),
219
+ endDate: Y().when("checkClosed", (i, l, { parent: u }) => (u == null ? void 0 : u.checkClosed) ? l.required("End date is required").test(
220
220
  "is-after-startDate",
221
221
  "End date must be greater than or equal to Start date",
222
- function(b) {
223
- const m = this.parent.startDate;
224
- return !m || !b ? !0 : new Date(b) >= new Date(m);
222
+ function(m) {
223
+ const g = this.parent.startDate;
224
+ return !g || !m ? !0 : new Date(m) >= new Date(g);
225
225
  }
226
226
  ) : l.notRequired()),
227
- value: A({
228
- from: R().min(0, "From value must be greater than or equal to 0").required("From value is required"),
229
- to: R().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
227
+ value: V({
228
+ from: L().min(0, "From value must be greater than or equal to 0").required("From value is required"),
229
+ to: L().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
230
230
  "is-greater",
231
231
  "To value must be greater than From value",
232
- function(d) {
232
+ function(i) {
233
233
  const { from: l } = this.parent;
234
- return d > l;
234
+ return i > l;
235
235
  }
236
236
  )
237
237
  }).required("Range value is required"),
238
- conditions: de((d, { parent: l }) => {
239
- var p, b;
240
- return (l == null ? void 0 : l.toggleNone) && ((p = l == null ? void 0 : l.conditions) == null ? void 0 : p.length) > 0 ? A().shape({}) : A(
241
- (b = r.conditions) == null ? void 0 : b.reduce(
242
- (m, x) => {
243
- if (h.values.conditions[x.name] !== void 0) {
244
- const w = Te(x.valueUse);
245
- m[x.name] = w(
246
- x.value,
247
- x.dataType
238
+ conditions: se((i, { parent: l }) => {
239
+ var p, m;
240
+ return (l == null ? void 0 : l.toggleNone) && ((p = l == null ? void 0 : l.conditions) == null ? void 0 : p.length) > 0 ? V().shape({}) : V(
241
+ (m = e.conditions) == null ? void 0 : m.reduce(
242
+ (g, v) => {
243
+ if (h.values.conditions[v.name] !== void 0) {
244
+ const w = Ee(v.valueUse);
245
+ g[v.name] = w(
246
+ v.value,
247
+ v.dataType
248
248
  ).schema;
249
249
  }
250
- return m;
250
+ return g;
251
251
  },
252
252
  {}
253
253
  )
@@ -255,64 +255,64 @@ function De({ decision: r, onSubmitEvent: e }) {
255
255
  })
256
256
  }), h = ie({
257
257
  initialValues: o,
258
- validationSchema: i,
258
+ validationSchema: d,
259
259
  validateOnBlur: !0,
260
- onSubmit: (d) => {
260
+ onSubmit: (i) => {
261
261
  var u;
262
262
  const l = {
263
- ...r,
264
- name: d.name,
265
- dataType: d.dataType,
266
- valueUse: d.valueUse,
267
- value: d.value,
268
- startDate: d.startDate,
269
- endDate: d.endDate,
270
- conditions: (u = r.conditions) == null ? void 0 : u.map((p) => ({
263
+ ...e,
264
+ name: i.name,
265
+ dataType: i.dataType,
266
+ valueUse: i.valueUse,
267
+ value: i.value,
268
+ startDate: i.startDate,
269
+ endDate: i.endDate,
270
+ conditions: (u = e.conditions) == null ? void 0 : u.map((p) => ({
271
271
  ...p,
272
- value: d.conditions[p.name]
272
+ value: i.conditions[p.name]
273
273
  }))
274
274
  };
275
- e(l);
275
+ t(l);
276
276
  }
277
277
  });
278
- return { formik: h, handleToggleNoneChange: (d) => {
278
+ return { formik: h, handleToggleNoneChange: (i) => {
279
279
  var l;
280
- h.setFieldValue("toggleNone", d), (l = r.conditions) == null || l.forEach((u) => {
281
- if (d)
280
+ h.setFieldValue("toggleNone", i), (l = e.conditions) == null || l.forEach((u) => {
281
+ if (i)
282
282
  h.setFieldValue(`conditions.${u.name}`, void 0);
283
283
  else {
284
- const p = u.valueUse === g.LIST_OF_VALUES_MULTI ? [] : "";
284
+ const p = u.valueUse === f.LIST_OF_VALUES_MULTI ? [] : "";
285
285
  h.setFieldValue(`conditions.${u.name}`, p);
286
286
  }
287
287
  });
288
288
  } };
289
289
  }
290
- const Ee = (r) => {
291
- var l, u, p, b, m, x, w;
292
- const { decision: e, onSubmitEvent: o, textValues: i, onCancel: h } = r, { formik: a, handleToggleNoneChange: d } = De({
293
- decision: e,
290
+ const Ae = (e) => {
291
+ var l, u, p, m, g, v, w;
292
+ const { decision: t, onSubmitEvent: o, textValues: d, onCancel: h } = e, { formik: r, handleToggleNoneChange: i } = De({
293
+ decision: t,
294
294
  onSubmitEvent: o
295
295
  });
296
- return /* @__PURE__ */ t("form", { onSubmit: a.handleSubmit, children: /* @__PURE__ */ c(s, { direction: "column", gap: "24px", children: [
297
- /* @__PURE__ */ t(
298
- te,
296
+ return /* @__PURE__ */ a("form", { onSubmit: r.handleSubmit, children: /* @__PURE__ */ c(s, { direction: "column", gap: "24px", children: [
297
+ /* @__PURE__ */ a(
298
+ ae,
299
299
  {
300
300
  id: "valueRange",
301
- typeInput: e.dataType.toLowerCase(),
302
- label: e.name,
303
- valueFrom: a.values.value.from,
304
- valueTo: a.values.value.to,
305
- handleInputChangeFrom: (n) => a.setFieldValue("value.from", n),
306
- handleInputChangeTo: (n) => a.setFieldValue("value.to", n),
307
- messageFrom: (l = a.errors.value) == null ? void 0 : l.from,
308
- messageTo: (u = a.errors.value) == null ? void 0 : u.to,
309
- statusFrom: (p = a.touched.value) != null && p.from ? (b = a.errors.value) != null && b.from ? "invalid" : "valid" : "pending",
310
- statusTo: (m = a.touched.value) != null && m.to ? (x = a.errors.value) != null && x.to ? "invalid" : "valid" : "pending",
311
- onBlur: a.handleBlur
301
+ typeInput: t.dataType.toLowerCase(),
302
+ label: t.name,
303
+ valueFrom: r.values.value.from,
304
+ valueTo: r.values.value.to,
305
+ handleInputChangeFrom: (n) => r.setFieldValue("value.from", n),
306
+ handleInputChangeTo: (n) => r.setFieldValue("value.to", n),
307
+ messageFrom: (l = r.errors.value) == null ? void 0 : l.from,
308
+ messageTo: (u = r.errors.value) == null ? void 0 : u.to,
309
+ statusFrom: (p = r.touched.value) != null && p.from ? (m = r.errors.value) != null && m.from ? "invalid" : "valid" : "pending",
310
+ statusTo: (g = r.touched.value) != null && g.to ? (v = r.errors.value) != null && v.to ? "invalid" : "valid" : "pending",
311
+ onBlur: r.handleBlur
312
312
  }
313
313
  ),
314
- /* @__PURE__ */ t(k, { dashed: !0 }),
315
- /* @__PURE__ */ t(fe, { children: /* @__PURE__ */ t(xe, { children: /* @__PURE__ */ c(
314
+ /* @__PURE__ */ a(T, { dashed: !0 }),
315
+ /* @__PURE__ */ a(ve, { children: /* @__PURE__ */ a(xe, { children: /* @__PURE__ */ c(
316
316
  s,
317
317
  {
318
318
  direction: "column",
@@ -321,91 +321,91 @@ const Ee = (r) => {
321
321
  height: "272px",
322
322
  children: [
323
323
  /* @__PURE__ */ c(s, { direction: "row", justifyContent: "space-between", children: [
324
- /* @__PURE__ */ t(y, { children: i.factsThatConditionIt }),
325
- /* @__PURE__ */ t(
326
- J,
324
+ /* @__PURE__ */ a(y, { children: d.factsThatConditionIt }),
325
+ /* @__PURE__ */ a(
326
+ K,
327
327
  {
328
328
  id: "toggleNone",
329
- onChange: () => d(!a.values.toggleNone),
330
- checked: a.values.toggleNone,
329
+ onChange: () => i(!r.values.toggleNone),
330
+ checked: r.values.toggleNone,
331
331
  size: "small",
332
- children: /* @__PURE__ */ t(y, { size: "medium", type: "label", weight: "bold", children: i.none })
332
+ children: /* @__PURE__ */ a(y, { size: "medium", type: "label", weight: "bold", children: d.none })
333
333
  }
334
334
  )
335
335
  ] }),
336
- /* @__PURE__ */ t(s, { direction: "column", gap: "20px", children: (w = e.conditions) == null ? void 0 : w.map((n) => {
337
- var N, U, I, L, $, z, j;
338
- return /* @__PURE__ */ t(
339
- ve,
336
+ /* @__PURE__ */ a(s, { direction: "column", gap: "20px", children: (w = t.conditions) == null ? void 0 : w.map((n) => {
337
+ var R, N, I, U, $, M, O;
338
+ return /* @__PURE__ */ a(
339
+ ye,
340
340
  {
341
341
  id: `toggle-${n.name}`,
342
342
  name: `toggle.${n.name}`,
343
343
  labelToggle: n.name,
344
- checked: !a.values.toggleNone && a.values.conditions[n.name] !== void 0,
344
+ checked: !r.values.toggleNone && r.values.conditions[n.name] !== void 0,
345
345
  handleToggleChange: (C) => {
346
346
  if (!C.target.checked)
347
- a.setFieldValue(
347
+ r.setFieldValue(
348
348
  `conditions.${n.name}`,
349
349
  void 0
350
- ), a.setFieldTouched(
350
+ ), r.setFieldTouched(
351
351
  `conditions.${n.name}`,
352
352
  !1,
353
353
  !1
354
354
  );
355
355
  else {
356
- const T = n.valueUse === g.LIST_OF_VALUES_MULTI ? [] : "";
357
- a.setFieldValue(
356
+ const E = n.valueUse === f.LIST_OF_VALUES_MULTI ? [] : "";
357
+ r.setFieldValue(
358
358
  `conditions.${n.name}`,
359
- T
359
+ E
360
360
  );
361
361
  }
362
362
  },
363
- children: n.valueUse === g.LIST_OF_VALUES_MULTI ? /* @__PURE__ */ t(
363
+ children: n.valueUse === f.LIST_OF_VALUES_MULTI ? /* @__PURE__ */ a(
364
364
  re,
365
365
  {
366
366
  id: n.name,
367
367
  labelSelect: n.name,
368
368
  labelSelected: `Selected ${n.name}`,
369
- options: (U = (N = n.possibleValue) == null ? void 0 : N.list) == null ? void 0 : U.map((C) => ({
369
+ options: (N = (R = n.possibleValue) == null ? void 0 : R.list) == null ? void 0 : N.map((C) => ({
370
370
  id: C,
371
371
  label: C,
372
- checked: (a.values.conditions[n.name] || []).includes(C)
372
+ checked: (r.values.conditions[n.name] || []).includes(C)
373
373
  })),
374
374
  onHandleSelectCheckChange: (C) => {
375
- const v = C.filter((T) => T.checked).map((T) => T.id);
376
- a.setFieldValue(
375
+ const x = C.filter((E) => E.checked).map((E) => E.id);
376
+ r.setFieldValue(
377
377
  `conditions.${n.name}`,
378
- v
379
- ), a.setFieldTouched(
378
+ x
379
+ ), r.setFieldTouched(
380
380
  `conditions.${n.name}`,
381
381
  !0,
382
382
  !0
383
383
  );
384
384
  },
385
385
  placeholderSelect: `Select ${n.name}`,
386
- message: (I = a.touched.conditions) != null && I[n.name] && ((L = a.errors.conditions) != null && L[n.name]) ? a.errors.conditions[n.name] : void 0,
387
- onBlur: () => a.setFieldTouched(
386
+ message: (I = r.touched.conditions) != null && I[n.name] && ((U = r.errors.conditions) != null && U[n.name]) ? r.errors.conditions[n.name] : void 0,
387
+ onBlur: () => r.setFieldTouched(
388
388
  `conditions.${n.name}`,
389
389
  !0,
390
390
  !0
391
391
  )
392
392
  }
393
- ) : /* @__PURE__ */ t(
394
- ae,
393
+ ) : /* @__PURE__ */ a(
394
+ ne,
395
395
  {
396
396
  type: n.dataType.toLowerCase(),
397
397
  name: `conditions.${n.name}`,
398
398
  label: n.name,
399
- value: a.values.conditions[n.name],
400
- onChange: (C) => a.setFieldValue(
399
+ value: r.values.conditions[n.name],
400
+ onChange: (C) => r.setFieldValue(
401
401
  `conditions.${n.name}`,
402
402
  C
403
403
  ),
404
404
  messageValidate: String(
405
- ($ = a.errors.conditions) == null ? void 0 : $[n.name]
405
+ ($ = r.errors.conditions) == null ? void 0 : $[n.name]
406
406
  ),
407
- statusValidate: (z = a.touched.conditions) != null && z[n.name] ? (j = a.errors.conditions) != null && j[n.name] ? "invalid" : "valid" : void 0,
408
- onBlur: a.handleBlur
407
+ statusValidate: (M = r.touched.conditions) != null && M[n.name] ? (O = r.errors.conditions) != null && O[n.name] ? "invalid" : "valid" : void 0,
408
+ onBlur: r.handleBlur
409
409
  }
410
410
  )
411
411
  },
@@ -415,63 +415,38 @@ const Ee = (r) => {
415
415
  ]
416
416
  }
417
417
  ) }) }),
418
- /* @__PURE__ */ t(k, { dashed: !0 }),
419
- /* @__PURE__ */ t(
420
- be,
418
+ /* @__PURE__ */ a(T, { dashed: !0 }),
419
+ /* @__PURE__ */ a(
420
+ fe,
421
421
  {
422
- labelStart: i.termStart,
423
- labelEnd: i.termEnd,
424
- valueStart: a.values.startDate,
425
- valueEnd: a.values.endDate,
426
- messageStart: a.errors.startDate,
427
- messageEnd: a.errors.endDate,
428
- statusStart: a.touched.startDate ? a.errors.startDate ? "invalid" : "valid" : void 0,
429
- statusEnd: a.touched.endDate ? a.errors.endDate ? "invalid" : "valid" : void 0,
430
- onHandleStartChange: (n) => a.setFieldValue("startDate", n.target.value),
431
- onHandleEndChange: (n) => a.setFieldValue("endDate", n.target.value),
422
+ labelStart: d.termStart,
423
+ labelEnd: d.termEnd,
424
+ valueStart: r.values.startDate,
425
+ valueEnd: r.values.endDate,
426
+ messageStart: r.errors.startDate,
427
+ messageEnd: r.errors.endDate,
428
+ statusStart: r.touched.startDate ? r.errors.startDate ? "invalid" : "valid" : void 0,
429
+ statusEnd: r.touched.endDate ? r.errors.endDate ? "invalid" : "valid" : void 0,
430
+ onHandleStartChange: (n) => r.setFieldValue("startDate", n.target.value),
431
+ onHandleEndChange: (n) => r.setFieldValue("endDate", n.target.value),
432
432
  onCheckClosedChange: (n) => {
433
- a.setFieldValue("checkClosed", n), n && a.setFieldValue("endDate", "");
433
+ r.setFieldValue("checkClosed", n), n && r.setFieldValue("endDate", "");
434
434
  },
435
- checkedClosed: a.values.checkClosed
435
+ checkedClosed: r.values.checkClosed
436
436
  }
437
437
  ),
438
- /* @__PURE__ */ t(k, {}),
438
+ /* @__PURE__ */ a(T, {}),
439
439
  /* @__PURE__ */ c(s, { direction: "row", justifyContent: "end", gap: "16px", children: [
440
- /* @__PURE__ */ t(G, { appearance: "gray", onClick: h, children: i.cancel }),
441
- /* @__PURE__ */ t(G, { type: "submit", children: i.confirm })
440
+ /* @__PURE__ */ a(P, { appearance: "gray", onClick: h, children: d.cancel }),
441
+ /* @__PURE__ */ a(P, { type: "submit", children: d.confirm })
442
442
  ] })
443
443
  ] }) });
444
- }, E = (r) => {
445
- if (!r)
446
- return;
447
- const e = r.value;
448
- if (!e)
449
- return;
450
- if (((i) => typeof i == "object" && i !== null)(e))
451
- switch (r.valueUse) {
452
- case g.LIST_OF_VALUES_MULTI:
453
- return e;
454
- case g.LIST_OF_VALUES:
455
- return e;
456
- case g.RANGE:
457
- return {
458
- from: e.from,
459
- to: e.to
460
- };
461
- case g.GREATER_THAN:
462
- case g.LESS_THAN:
463
- case g.EQUAL:
464
- return e.value;
465
- default:
466
- return e.value;
467
- }
468
- return e;
469
- }, Y = f.div`
444
+ }, W = b.div`
470
445
  & > div {
471
446
  border-radius: 8px;
472
447
  border: 1px solid ${S.palette.neutral.N30};
473
448
  }
474
- `, W = f.div`
449
+ `, J = b.div`
475
450
  width: 100%;
476
451
  height: 100%;
477
452
  overflow-y: auto;
@@ -489,24 +464,41 @@ const Ee = (r) => {
489
464
  background-color: #ebecf0;
490
465
  border-radius: 8px;
491
466
  }
492
- `, Z = (r) => {
493
- const { decision: e, loading: o = !1, textValues: i } = r, h = (d) => d && Object.keys(d).length > 0, a = {
494
- name: (e == null ? void 0 : e.name) || "",
495
- dataType: (e == null ? void 0 : e.dataType) || "alphabetical",
496
- value: E(e),
497
- valueUse: (e == null ? void 0 : e.valueUse) || "equal"
467
+ `, Fe = (e) => e.value, Ve = (e) => e.value, _e = (e) => ({
468
+ from: e.from ?? "",
469
+ to: e.to ?? ""
470
+ }), Le = (e) => e.value, Re = (e) => e.value, Ne = (e) => e.value;
471
+ var k = /* @__PURE__ */ ((e) => (e.EQUAL = "equal", e.GREATER_THAN = "greater_than", e.LESS_THAN = "less_than", e.LIST_OF_VALUES = "list_of_values", e.LIST_OF_VALUES_MULTI = "list_of_values_multi", e.RANGE = "range", e))(k || {});
472
+ const Ie = (e) => e.value, Ue = {
473
+ [k.LIST_OF_VALUES]: Fe,
474
+ [k.LIST_OF_VALUES_MULTI]: Ve,
475
+ [k.RANGE]: _e,
476
+ [k.GREATER_THAN]: Le,
477
+ [k.LESS_THAN]: Re,
478
+ [k.EQUAL]: Ne
479
+ };
480
+ function A(e) {
481
+ const t = e == null ? void 0 : e.value, o = typeof t == "object" && t !== null && !Array.isArray(t), d = Ue[e == null ? void 0 : e.valueUse] || Ie;
482
+ return o && d(t) || t || void 0;
483
+ }
484
+ const ee = (e) => {
485
+ const { decision: t, loading: o = !1, textValues: d } = e, h = (i) => i && Object.keys(i).length > 0, r = {
486
+ name: (t == null ? void 0 : t.name) || "",
487
+ dataType: (t == null ? void 0 : t.dataType) || "alphabetical",
488
+ value: A(t),
489
+ valueUse: (t == null ? void 0 : t.valueUse) || "equal"
498
490
  };
499
- return !o && e && i ? /* @__PURE__ */ c(s, { direction: "column", gap: "12px", children: [
500
- e && /* @__PURE__ */ t(s, { direction: "column", alignItems: "center", children: /* @__PURE__ */ t(
491
+ return !o && t && d ? /* @__PURE__ */ c(s, { direction: "column", gap: "12px", children: [
492
+ t && /* @__PURE__ */ a(s, { direction: "column", alignItems: "center", children: /* @__PURE__ */ a(
501
493
  q,
502
494
  {
503
- element: a,
504
- valueData: E(a),
495
+ element: r,
496
+ valueData: A(r),
505
497
  type: "decision"
506
498
  }
507
- ) }, e.name),
508
- /* @__PURE__ */ t(k, { dashed: !0 }),
509
- /* @__PURE__ */ t(W, { children: /* @__PURE__ */ c(
499
+ ) }, t.name),
500
+ /* @__PURE__ */ a(T, { dashed: !0 }),
501
+ /* @__PURE__ */ a(J, { children: /* @__PURE__ */ c(
510
502
  s,
511
503
  {
512
504
  direction: "column",
@@ -514,7 +506,7 @@ const Ee = (r) => {
514
506
  justifyContent: "space-between",
515
507
  height: "203px",
516
508
  children: [
517
- /* @__PURE__ */ t(
509
+ /* @__PURE__ */ a(
518
510
  y,
519
511
  {
520
512
  type: "label",
@@ -522,65 +514,65 @@ const Ee = (r) => {
522
514
  appearance: "dark",
523
515
  weight: "bold",
524
516
  textAlign: "center",
525
- children: i.factsThatConditionIt
517
+ children: d.factsThatConditionIt
526
518
  }
527
519
  ),
528
- e.conditions && e.conditions.map((d) => {
529
- if (d.hidden) return null;
530
- const l = d.value;
531
- return (typeof l == "object" && h(l) || l !== void 0 && typeof l == "string" && l.length > 0) && /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(s, { direction: "column", padding: "8px", children: /* @__PURE__ */ t(
520
+ t.conditions && t.conditions.map((i) => {
521
+ if (i.hidden) return null;
522
+ const l = i.value;
523
+ return (typeof l == "object" && h(l) || l !== void 0 && typeof l == "string" && l.length > 0) && /* @__PURE__ */ a(W, { children: /* @__PURE__ */ a(s, { direction: "column", padding: "8px", children: /* @__PURE__ */ a(
532
524
  q,
533
525
  {
534
526
  element: {
535
- ...d,
527
+ ...i,
536
528
  value: l
537
529
  },
538
- valueData: E(d)
530
+ valueData: A(i)
539
531
  }
540
- ) }) }, d.name);
532
+ ) }) }, i.name);
541
533
  }),
542
- /* @__PURE__ */ t(k, { dashed: !0 }),
534
+ /* @__PURE__ */ a(T, { dashed: !0 }),
543
535
  /* @__PURE__ */ c(s, { direction: "column", gap: "12px", children: [
544
- (e == null ? void 0 : e.startDate) && (e == null ? void 0 : e.endDate) && /* @__PURE__ */ t(
536
+ (t == null ? void 0 : t.startDate) && (t == null ? void 0 : t.endDate) && /* @__PURE__ */ a(
545
537
  q,
546
538
  {
547
539
  element: {
548
- name: i.terms,
549
- value: String(e.startDate),
550
- valueUse: g.RANGE,
551
- dataType: V.DATE
540
+ name: d.terms,
541
+ value: String(t.startDate),
542
+ valueUse: f.RANGE,
543
+ dataType: F.DATE
552
544
  },
553
- valueData: E({
554
- name: i.terms,
545
+ valueData: A({
546
+ name: d.terms,
555
547
  value: {
556
- from: String(e.startDate),
557
- to: String(e.endDate)
548
+ from: String(t.startDate),
549
+ to: String(t.endDate)
558
550
  },
559
- valueUse: g.RANGE,
560
- dataType: V.DATE
551
+ valueUse: f.RANGE,
552
+ dataType: F.DATE
561
553
  }),
562
554
  type: "decision"
563
555
  },
564
- i.terms
556
+ d.terms
565
557
  ),
566
- (e == null ? void 0 : e.startDate) && !(e != null && e.endDate) && /* @__PURE__ */ t(
558
+ (t == null ? void 0 : t.startDate) && !(t != null && t.endDate) && /* @__PURE__ */ a(
567
559
  q,
568
560
  {
569
561
  element: {
570
- name: i.terms,
571
- value: String(e.startDate),
572
- valueUse: g.EQUAL,
573
- dataType: V.DATE
562
+ name: d.terms,
563
+ value: String(t.startDate),
564
+ valueUse: f.EQUAL,
565
+ dataType: F.DATE
574
566
  },
575
- valueData: E({
576
- name: i.terms,
577
- value: String(e.startDate),
578
- valueUse: g.EQUAL,
579
- dataType: V.DATE
567
+ valueData: A({
568
+ name: d.terms,
569
+ value: String(t.startDate),
570
+ valueUse: f.EQUAL,
571
+ dataType: F.DATE
580
572
  }),
581
573
  type: "decision"
582
574
  },
583
- i.terms
575
+ d.terms
584
576
  )
585
577
  ] })
586
578
  ]
@@ -588,21 +580,21 @@ const Ee = (r) => {
588
580
  ) })
589
581
  ] }) : /* @__PURE__ */ c(s, { direction: "column", gap: "12px", children: [
590
582
  /* @__PURE__ */ c(s, { direction: "column", alignItems: "center", gap: "4px", children: [
591
- /* @__PURE__ */ t(D, { animated: !0, width: "180px" }),
592
- /* @__PURE__ */ t(D, { animated: !0, width: "85px" })
583
+ /* @__PURE__ */ a(D, { animated: !0, width: "180px" }),
584
+ /* @__PURE__ */ a(D, { animated: !0, width: "85px" })
593
585
  ] }, "loading"),
594
586
  /* @__PURE__ */ c(s, { direction: "column", gap: "12px", alignItems: "center", children: [
595
- /* @__PURE__ */ t(k, { dashed: !0 }),
596
- /* @__PURE__ */ t(D, { animated: !0, width: "150px" })
587
+ /* @__PURE__ */ a(T, { dashed: !0 }),
588
+ /* @__PURE__ */ a(D, { animated: !0, width: "150px" })
597
589
  ] }),
598
- /* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(
590
+ /* @__PURE__ */ a(J, { children: /* @__PURE__ */ a(
599
591
  s,
600
592
  {
601
593
  direction: "column",
602
594
  gap: "12px",
603
595
  justifyContent: "space-between",
604
596
  height: "203px",
605
- children: Array.from({ length: 5 }).map((d, l) => /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ c(
597
+ children: Array.from({ length: 5 }).map((i, l) => /* @__PURE__ */ a(W, { children: /* @__PURE__ */ c(
606
598
  s,
607
599
  {
608
600
  direction: "column",
@@ -610,15 +602,15 @@ const Ee = (r) => {
610
602
  alignItems: "start",
611
603
  padding: "8px",
612
604
  children: [
613
- /* @__PURE__ */ t(D, { animated: !0, width: "180px" }),
614
- /* @__PURE__ */ t(D, { animated: !0, width: "85px" })
605
+ /* @__PURE__ */ a(D, { animated: !0, width: "180px" }),
606
+ /* @__PURE__ */ a(D, { animated: !0, width: "85px" })
615
607
  ]
616
608
  }
617
609
  ) }, `condition-${l}`))
618
610
  }
619
611
  ) })
620
612
  ] });
621
- }, Ve = f.div`
613
+ }, $e = b.div`
622
614
  border-radius: 8px;
623
615
  border: 1px solid ${S.palette.neutral.N30};
624
616
  box-sizing: border-box;
@@ -630,7 +622,7 @@ const Ee = (r) => {
630
622
  height: 100%;
631
623
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
632
624
  `;
633
- f.div`
625
+ b.div`
634
626
  width: 100%;
635
627
  height: 100%;
636
628
  overflow-y: auto;
@@ -649,35 +641,35 @@ f.div`
649
641
  border-radius: 8px;
650
642
  }
651
643
  `;
652
- const H = (r) => {
653
- const { children: e, controls: o = !0, handleDelete: i, id: h } = r;
654
- return /* @__PURE__ */ t(Ve, { children: /* @__PURE__ */ c(s, { direction: "column", gap: "16px", padding: "12px 16px", children: [
655
- e,
656
- o && /* @__PURE__ */ c(F, { children: [
657
- /* @__PURE__ */ t(k, {}),
658
- /* @__PURE__ */ t(s, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ t(
659
- X,
644
+ const G = (e) => {
645
+ const { children: t, controls: o = !0, handleDelete: d, id: h } = e;
646
+ return /* @__PURE__ */ a($e, { children: /* @__PURE__ */ c(s, { direction: "column", gap: "16px", padding: "12px 16px", children: [
647
+ t,
648
+ o && /* @__PURE__ */ c(_, { children: [
649
+ /* @__PURE__ */ a(T, {}),
650
+ /* @__PURE__ */ a(s, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ a(
651
+ Z,
660
652
  {
661
653
  cursorHover: !0,
662
654
  appearance: "dark",
663
655
  size: "24px",
664
- icon: /* @__PURE__ */ t(se, {}),
656
+ icon: /* @__PURE__ */ a(ce, {}),
665
657
  onClick: () => {
666
- i(h);
658
+ d(h);
667
659
  }
668
660
  }
669
661
  ) })
670
662
  ] })
671
663
  ] }) });
672
- }, Ae = f.div`
664
+ }, qe = b.div`
673
665
  position: relative;
674
666
  & > div {
675
667
  padding: 24px 16px;
676
668
  }
677
- `, Fe = f.div`
678
- background-color: ${({ theme: r }) => {
679
- var e, o;
680
- return ((o = (e = r == null ? void 0 : r.palette) == null ? void 0 : e.neutral) == null ? void 0 : o.N0) || S.palette.neutral.N0;
669
+ `, ze = b.div`
670
+ background-color: ${({ theme: e }) => {
671
+ var t, o;
672
+ return ((o = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : o.N0) || S.palette.neutral.N0;
681
673
  }};
682
674
  max-width: 450px;
683
675
  max-height: 90vh;
@@ -705,23 +697,23 @@ const H = (r) => {
705
697
  background-color: #ebecf0;
706
698
  border-radius: 8px;
707
699
  }
708
- `, Re = (r) => {
709
- const { children: e, portalId: o, onCloseModal: i, title: h } = r, a = document.getElementById(o);
710
- if (!a)
700
+ `, Me = (e) => {
701
+ const { children: t, portalId: o, onCloseModal: d, title: h } = e, r = document.getElementById(o);
702
+ if (!r)
711
703
  throw new Error(
712
704
  "The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
713
705
  );
714
- return he(
715
- /* @__PURE__ */ t(Ae, { children: /* @__PURE__ */ t(pe, { children: /* @__PURE__ */ t(Fe, { children: /* @__PURE__ */ c(s, { direction: "column", gap: "24px", children: [
716
- /* @__PURE__ */ t(s, { direction: "column", gap: "24px", children: /* @__PURE__ */ c(s, { alignItems: "center", justifyContent: "space-between", children: [
717
- /* @__PURE__ */ t(y, { type: "title", size: "large", appearance: "dark", weight: "bold", children: h }),
718
- /* @__PURE__ */ t(ce, { size: "24px", cursor: "pointer", onClick: i })
706
+ return pe(
707
+ /* @__PURE__ */ a(qe, { children: /* @__PURE__ */ a(ge, { children: /* @__PURE__ */ a(ze, { children: /* @__PURE__ */ c(s, { direction: "column", gap: "24px", children: [
708
+ /* @__PURE__ */ a(s, { direction: "column", gap: "24px", children: /* @__PURE__ */ c(s, { alignItems: "center", justifyContent: "space-between", children: [
709
+ /* @__PURE__ */ a(y, { type: "title", size: "large", appearance: "dark", weight: "bold", children: h }),
710
+ /* @__PURE__ */ a(ue, { size: "24px", cursor: "pointer", onClick: d })
719
711
  ] }) }),
720
- e
712
+ t
721
713
  ] }) }) }) }),
722
- a
714
+ r
723
715
  );
724
- }, Ne = le`
716
+ }, Oe = de`
725
717
  from {
726
718
  opacity: 0;
727
719
  transform: translateY(20px);
@@ -730,14 +722,14 @@ const H = (r) => {
730
722
  opacity: 1;
731
723
  transform: translateY(0);
732
724
  }
733
- `, ee = f.div`
725
+ `, te = b.div`
734
726
  width: 100%;
735
727
  height: 100%;
736
728
  & > div {
737
- animation: ${Ne} 600ms ease-out;
729
+ animation: ${Oe} 600ms ease-out;
738
730
  }
739
731
  `;
740
- f.div`
732
+ b.div`
741
733
  border-radius: 8px;
742
734
  border: 1px solid ${S.palette.neutral.N30};
743
735
  box-sizing: border-box;
@@ -749,7 +741,7 @@ f.div`
749
741
  height: 100%;
750
742
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
751
743
  `;
752
- const Ue = f.div`
744
+ const je = b.div`
753
745
  & > div {
754
746
  width: 100%;
755
747
  height: 100%;
@@ -769,14 +761,14 @@ const Ue = f.div`
769
761
  border-radius: 8px;
770
762
  }
771
763
  }
772
- `, Ie = f.div`
764
+ `, He = b.div`
773
765
  & > div > div {
774
766
  border-radius: 8px;
775
767
  border: 1px solid ${S.palette.neutral.N30};
776
768
  box-sizing: border-box;
777
769
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
778
770
  }
779
- `, Le = f.div`
771
+ `, Be = b.div`
780
772
  & > div {
781
773
  background-color: ${S.palette.neutral.N30};
782
774
  justify-content: center;
@@ -786,138 +778,138 @@ const Ue = f.div`
786
778
  height: 100%;
787
779
  padding-bottom: 12px;
788
780
  `;
789
- f.div`
781
+ b.div`
790
782
  & > div {
791
783
  border-radius: 8px;
792
784
  border: 1px solid ${S.palette.neutral.N30};
793
785
  }
794
786
  `;
795
- function $e({
796
- index: r,
797
- handleOpenModal: e
787
+ function Ge({
788
+ index: e,
789
+ handleOpenModal: t
798
790
  }) {
799
- return /* @__PURE__ */ t(
800
- H,
791
+ return /* @__PURE__ */ a(
792
+ G,
801
793
  {
802
- id: `loading-card-${r}`,
794
+ id: `loading-card-${e}`,
803
795
  handleDelete: () => {
804
796
  },
805
- handleView: () => e(),
797
+ handleView: () => t(),
806
798
  controls: !1,
807
- children: /* @__PURE__ */ t(Z, { loading: !0 })
799
+ children: /* @__PURE__ */ a(ee, { loading: !0 })
808
800
  },
809
- `loading-card-${r}`
801
+ `loading-card-${e}`
810
802
  );
811
803
  }
812
- function qe({
813
- decision: r,
814
- controls: e,
804
+ function Pe({
805
+ decision: e,
806
+ controls: t,
815
807
  handleOpenModal: o,
816
- handleDelete: i,
808
+ handleDelete: d,
817
809
  textValues: h
818
810
  }) {
819
- return r ? /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ c(s, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
820
- /* @__PURE__ */ t(y, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: r.id }),
821
- /* @__PURE__ */ t(
822
- H,
811
+ return e ? /* @__PURE__ */ a(te, { children: /* @__PURE__ */ c(s, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
812
+ /* @__PURE__ */ a(y, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: e.id }),
813
+ /* @__PURE__ */ a(
814
+ G,
823
815
  {
824
- id: r.id,
825
- handleDelete: () => i(r.id),
826
- handleView: () => o(r),
827
- controls: e,
828
- children: /* @__PURE__ */ t(Z, { decision: r, textValues: h })
816
+ id: e.id,
817
+ handleDelete: () => d(e.id),
818
+ handleView: () => o(e),
819
+ controls: t,
820
+ children: /* @__PURE__ */ a(ee, { decision: e, textValues: h })
829
821
  }
830
822
  )
831
- ] }) }, r.id) : null;
823
+ ] }) }, e.id) : null;
832
824
  }
833
- function _e({
834
- index: r,
835
- handleOpenModal: e
825
+ function Qe({
826
+ index: e,
827
+ handleOpenModal: t
836
828
  }) {
837
- return /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ c(s, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
838
- /* @__PURE__ */ t(y, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
839
- /* @__PURE__ */ t(Le, { onClick: () => e(), children: /* @__PURE__ */ t(
840
- H,
829
+ return /* @__PURE__ */ a(te, { children: /* @__PURE__ */ c(s, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
830
+ /* @__PURE__ */ a(y, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
831
+ /* @__PURE__ */ a(Be, { onClick: () => t(), children: /* @__PURE__ */ a(
832
+ G,
841
833
  {
842
- id: `add-decision-${r}`,
834
+ id: `add-decision-${e}`,
843
835
  handleDelete: () => {
844
836
  },
845
- handleView: () => e(),
837
+ handleView: () => t(),
846
838
  controls: !1,
847
839
  children: /* @__PURE__ */ c(s, { direction: "column", gap: "12px", alignItems: "center", children: [
848
- /* @__PURE__ */ t(X, { appearance: "gray", icon: /* @__PURE__ */ t(ue, {}), size: "35px" }),
849
- /* @__PURE__ */ t(y, { appearance: "gray", type: "body", size: "large", children: "Agregar decisión" })
840
+ /* @__PURE__ */ a(Z, { appearance: "gray", icon: /* @__PURE__ */ a(he, {}), size: "35px" }),
841
+ /* @__PURE__ */ a(y, { appearance: "gray", type: "body", size: "large", children: "Agregar decisión" })
850
842
  ] })
851
843
  }
852
844
  ) })
853
- ] }) }, `add-decision-${r}`);
845
+ ] }) }, `add-decision-${e}`);
854
846
  }
855
- const ze = {
856
- loading: $e,
857
- decision: qe,
858
- add: _e
847
+ const Ye = {
848
+ loading: Ge,
849
+ decision: Pe,
850
+ add: Qe
859
851
  };
860
- function O(r) {
861
- const { type: e } = r, o = ze[e];
862
- return o ? o(r) : null;
852
+ function H(e) {
853
+ const { type: t } = e, o = Ye[t];
854
+ return o ? o(e) : null;
863
855
  }
864
- function je({
865
- controls: r,
866
- decisions: e,
856
+ function We({
857
+ controls: e,
858
+ decisions: t,
867
859
  loading: o,
868
- handleOpenModal: i,
860
+ handleOpenModal: d,
869
861
  handleDelete: h,
870
- textValues: a
862
+ textValues: r
871
863
  }) {
872
- const d = o ? Array.from({ length: 3 }).map(
873
- (u, p) => O({
864
+ const i = o ? Array.from({ length: 3 }).map(
865
+ (u, p) => H({
874
866
  type: "loading",
875
867
  index: p,
876
- controls: r,
868
+ controls: e,
877
869
  loading: o,
878
- handleOpenModal: i,
870
+ handleOpenModal: d,
879
871
  handleDelete: h,
880
- textValues: a
872
+ textValues: r
881
873
  })
882
- ) : e.map(
883
- (u) => O({
874
+ ) : t.map(
875
+ (u) => H({
884
876
  type: "decision",
885
877
  decision: u,
886
- controls: r,
878
+ controls: e,
887
879
  loading: o,
888
- handleOpenModal: i,
880
+ handleOpenModal: d,
889
881
  handleDelete: h,
890
- textValues: a
882
+ textValues: r
891
883
  })
892
- ), l = (e.length === 0 || e.length < Math.floor(window.innerWidth / 300)) && !o && r;
893
- return { renderedCards: d, shouldRenderAddCard: l };
884
+ ), l = (t.length === 0 || t.length < Math.floor(window.innerWidth / 300)) && !o && e;
885
+ return { renderedCards: i, shouldRenderAddCard: l };
894
886
  }
895
- const st = (r) => {
887
+ const vt = (e) => {
896
888
  const {
897
- controls: e = !0,
889
+ controls: t = !0,
898
890
  decisions: o,
899
- textValues: i,
891
+ textValues: d,
900
892
  decisionTemplate: h,
901
- isModalOpen: a,
902
- selectedDecision: d,
893
+ isModalOpen: r,
894
+ selectedDecision: i,
903
895
  loading: l,
904
896
  handleOpenModal: u,
905
897
  handleCloseModal: p,
906
- handleSubmitForm: b,
907
- handleDelete: m
908
- } = r, x = me("(max-width: 681px)"), { renderedCards: w, shouldRenderAddCard: n } = je({
909
- controls: e,
898
+ handleSubmitForm: m,
899
+ handleDelete: g
900
+ } = e, v = be("(max-width: 681px)"), { renderedCards: w, shouldRenderAddCard: n } = We({
901
+ controls: t,
910
902
  decisions: o,
911
903
  loading: l,
912
904
  handleOpenModal: u,
913
- handleDelete: m,
914
- textValues: i
905
+ handleDelete: g,
906
+ textValues: d
915
907
  });
916
- return /* @__PURE__ */ c(F, { children: [
917
- /* @__PURE__ */ t(Ie, { children: /* @__PURE__ */ t(Ue, { children: /* @__PURE__ */ c(s, { direction: "column", gap: "16px", padding: "6px", children: [
908
+ return /* @__PURE__ */ c(_, { children: [
909
+ /* @__PURE__ */ a(He, { children: /* @__PURE__ */ a(je, { children: /* @__PURE__ */ c(s, { direction: "column", gap: "16px", padding: "6px", children: [
918
910
  o.length === 0 && !l && /* @__PURE__ */ c(y, { as: "span", type: "label", size: "large", appearance: "gray", children: [
919
911
  "Aún no tienes definidas tasas de interés efectivas. Presiona",
920
- /* @__PURE__ */ t(
912
+ /* @__PURE__ */ a(
921
913
  y,
922
914
  {
923
915
  as: "span",
@@ -931,7 +923,7 @@ const st = (r) => {
931
923
  "para empezar."
932
924
  ] }),
933
925
  /* @__PURE__ */ c(
934
- ge,
926
+ me,
935
927
  {
936
928
  templateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
937
929
  autoFlow: "row dense",
@@ -941,34 +933,34 @@ const st = (r) => {
941
933
  autoRows: "1fr",
942
934
  justifyItems: "center",
943
935
  padding: "6px",
944
- height: x ? "auto" : "484px",
936
+ height: v ? "auto" : "484px",
945
937
  children: [
946
938
  w,
947
- n && O({
939
+ n && H({
948
940
  type: "add",
949
941
  index: o.length,
950
- controls: e,
942
+ controls: t,
951
943
  loading: l,
952
944
  handleOpenModal: u,
953
- handleDelete: m,
954
- textValues: i
945
+ handleDelete: g,
946
+ textValues: d
955
947
  })
956
948
  ]
957
949
  }
958
950
  )
959
951
  ] }) }) }),
960
- a && /* @__PURE__ */ t(
961
- Re,
952
+ r && /* @__PURE__ */ a(
953
+ Me,
962
954
  {
963
955
  portalId: "modal-portal",
964
956
  onCloseModal: p,
965
- title: d ? "Editar Decisión" : "Nueva decisión",
966
- children: /* @__PURE__ */ t(
967
- Ee,
957
+ title: i ? "Editar Decisión" : "Nueva decisión",
958
+ children: /* @__PURE__ */ a(
959
+ Ae,
968
960
  {
969
- decision: d || h,
970
- onSubmitEvent: b,
971
- textValues: i,
961
+ decision: i || h,
962
+ onSubmitEvent: m,
963
+ textValues: d,
972
964
  onCancel: () => p()
973
965
  }
974
966
  )
@@ -977,9 +969,9 @@ const st = (r) => {
977
969
  ] });
978
970
  };
979
971
  export {
980
- H as BusinessRuleCard,
981
- Z as BusinessRuleView,
982
- st as BusinessRules,
983
- Re as ModalRules,
984
- Ee as RulesForm
972
+ G as BusinessRuleCard,
973
+ ee as BusinessRuleView,
974
+ vt as BusinessRules,
975
+ Me as ModalRules,
976
+ Ae as RulesForm
985
977
  };
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "description": "",
12
12
  "private": false,
13
- "version": "0.1.28",
13
+ "version": "0.1.29",
14
14
  "type": "module",
15
15
  "exports": {
16
16
  ".": {