@isettingkit/business-rules 0.1.27 → 0.1.28

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