@arudovwen/form-builder-react 1.8.2 → 1.8.3
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.
|
@@ -25,14 +25,14 @@ const be = xn(void 0), Pi = {
|
|
|
25
25
|
onChange: n,
|
|
26
26
|
onLogAction: a
|
|
27
27
|
}) => {
|
|
28
|
-
const [s, o] = D(!0), [l, d] = D({}), [u, t] = D({}), [
|
|
28
|
+
const [s, o] = D(!0), [l, d] = D({}), [u, t] = D({}), [r, m] = D([Pi]), [c, h] = D(() => {
|
|
29
29
|
try {
|
|
30
30
|
const O = sessionStorage.getItem("editor_past");
|
|
31
31
|
return O ? JSON.parse(O) : [];
|
|
32
32
|
} catch (O) {
|
|
33
33
|
return [];
|
|
34
34
|
}
|
|
35
|
-
}), [
|
|
35
|
+
}), [p, y] = D(() => {
|
|
36
36
|
try {
|
|
37
37
|
const O = sessionStorage.getItem("editor_future");
|
|
38
38
|
return O ? JSON.parse(O) : [];
|
|
@@ -41,64 +41,64 @@ const be = xn(void 0), Pi = {
|
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
G(() => {
|
|
44
|
-
n && n(
|
|
45
|
-
}, [
|
|
44
|
+
n && n(r);
|
|
45
|
+
}, [r, n]), G(() => {
|
|
46
46
|
try {
|
|
47
|
-
sessionStorage.setItem("editor_past", JSON.stringify(
|
|
47
|
+
sessionStorage.setItem("editor_past", JSON.stringify(c));
|
|
48
48
|
} catch (O) {
|
|
49
49
|
console.warn("Could not save editor_past to sessionStorage", O);
|
|
50
50
|
}
|
|
51
|
-
}, [
|
|
51
|
+
}, [c]), G(() => {
|
|
52
52
|
try {
|
|
53
|
-
sessionStorage.setItem("editor_future", JSON.stringify(
|
|
53
|
+
sessionStorage.setItem("editor_future", JSON.stringify(p));
|
|
54
54
|
} catch (O) {
|
|
55
55
|
console.warn("Could not save editor_future to sessionStorage", O);
|
|
56
56
|
}
|
|
57
|
-
}, [
|
|
58
|
-
const
|
|
59
|
-
|
|
57
|
+
}, [p]);
|
|
58
|
+
const g = re(Date.now()), f = se.useCallback((O) => {
|
|
59
|
+
m((B) => {
|
|
60
60
|
const K = typeof O == "function" ? O(B) : O;
|
|
61
61
|
if (JSON.stringify(B) !== JSON.stringify(K)) {
|
|
62
62
|
const P = Date.now();
|
|
63
63
|
h((L) => {
|
|
64
64
|
if (L.length > 0 && JSON.stringify(L[L.length - 1]) === JSON.stringify(B))
|
|
65
65
|
return L;
|
|
66
|
-
if (P -
|
|
67
|
-
return
|
|
68
|
-
|
|
66
|
+
if (P - g.current < 800 && L.length > 0)
|
|
67
|
+
return g.current = P, L;
|
|
68
|
+
g.current = P;
|
|
69
69
|
const U = [...L, B];
|
|
70
70
|
return U.length > 20 ? U.slice(U.length - 20) : U;
|
|
71
71
|
}), y([]);
|
|
72
72
|
}
|
|
73
73
|
return K;
|
|
74
74
|
});
|
|
75
|
-
}, []),
|
|
76
|
-
if (
|
|
77
|
-
const O =
|
|
78
|
-
h(B), y([
|
|
79
|
-
}, [
|
|
80
|
-
if (
|
|
81
|
-
const O =
|
|
82
|
-
y(B), h([...
|
|
83
|
-
}, [
|
|
75
|
+
}, []), v = se.useCallback(() => {
|
|
76
|
+
if (c.length === 0) return;
|
|
77
|
+
const O = c[c.length - 1], B = c.slice(0, c.length - 1);
|
|
78
|
+
h(B), y([r, ...p]), m(O), a == null || a("UNDO", null);
|
|
79
|
+
}, [c, p, r, a]), N = se.useCallback(() => {
|
|
80
|
+
if (p.length === 0) return;
|
|
81
|
+
const O = p[0], B = p.slice(1);
|
|
82
|
+
y(B), h([...c, r]), m(O), a == null || a("REDO", null);
|
|
83
|
+
}, [c, p, r, a]), A = r, k = c.length > 0, x = p.length > 0, [C, M] = D(!1), [w, S] = D(null), [T, I] = D([
|
|
84
84
|
0
|
|
85
85
|
]), [E, F] = D(""), [Z, ie] = D(0), X = se.useCallback(() => {
|
|
86
86
|
}, []), he = se.useCallback(() => {
|
|
87
87
|
const O = pe();
|
|
88
|
-
|
|
89
|
-
}, [A, a,
|
|
88
|
+
f((B) => [...B, { ...Pi, id: O }]), S(O), I([A.length]), a == null || a("ADD_SECTION", { sectionId: O });
|
|
89
|
+
}, [A, a, f]), _ = se.useCallback(
|
|
90
90
|
(O) => {
|
|
91
|
-
|
|
91
|
+
f(
|
|
92
92
|
(B) => B.filter((K) => K.id !== O)
|
|
93
93
|
), S(null), a == null || a("REMOVE_SECTION", { sectionId: O });
|
|
94
94
|
},
|
|
95
|
-
[a,
|
|
95
|
+
[a, f]
|
|
96
96
|
), V = se.useCallback(
|
|
97
97
|
(O, B) => {
|
|
98
98
|
const K = A.find((L) => L.id === B), P = K == null ? void 0 : K.questionData.find(
|
|
99
99
|
(L) => L.id === O
|
|
100
100
|
);
|
|
101
|
-
P && (
|
|
101
|
+
P && (f(
|
|
102
102
|
(L) => L == null ? void 0 : L.map(
|
|
103
103
|
(U) => U.id === B ? {
|
|
104
104
|
...U,
|
|
@@ -107,7 +107,7 @@ const be = xn(void 0), Pi = {
|
|
|
107
107
|
)
|
|
108
108
|
), a == null || a("REMOVE_ELEMENT", { sectionId: B, elementId: O }));
|
|
109
109
|
},
|
|
110
|
-
[A,
|
|
110
|
+
[A, f, a]
|
|
111
111
|
), ce = se.useCallback(
|
|
112
112
|
(O, B) => {
|
|
113
113
|
const K = A.find(($) => $.id === B);
|
|
@@ -121,7 +121,7 @@ const be = xn(void 0), Pi = {
|
|
|
121
121
|
id: pe(),
|
|
122
122
|
...j
|
|
123
123
|
});
|
|
124
|
-
|
|
124
|
+
f(
|
|
125
125
|
($) => $ == null ? void 0 : $.map((j) => {
|
|
126
126
|
var W;
|
|
127
127
|
if (j.id !== B) return j;
|
|
@@ -161,19 +161,19 @@ const be = xn(void 0), Pi = {
|
|
|
161
161
|
})
|
|
162
162
|
), a == null || a("DUPLICATE_ELEMENT", { sectionId: B, elementId: O });
|
|
163
163
|
},
|
|
164
|
-
[A,
|
|
164
|
+
[A, f, a]
|
|
165
165
|
), Se = se.useCallback(
|
|
166
166
|
(O, B) => {
|
|
167
|
-
|
|
167
|
+
f(
|
|
168
168
|
(K) => K == null ? void 0 : K.map(
|
|
169
169
|
(P) => P.id === B ? { ...P, questionData: O } : P
|
|
170
170
|
)
|
|
171
171
|
), a == null || a("UPDATE_ELEMENT_POSITION", { sectionId: B });
|
|
172
172
|
},
|
|
173
|
-
[
|
|
173
|
+
[f, a]
|
|
174
174
|
), ge = se.useCallback(
|
|
175
175
|
(O, B) => {
|
|
176
|
-
|
|
176
|
+
f(
|
|
177
177
|
(K) => K == null ? void 0 : K.map(
|
|
178
178
|
(P) => P.id === B ? {
|
|
179
179
|
...P,
|
|
@@ -182,10 +182,10 @@ const be = xn(void 0), Pi = {
|
|
|
182
182
|
)
|
|
183
183
|
), a == null || a("ADD_ELEMENT", { sectionId: B, element: O });
|
|
184
184
|
},
|
|
185
|
-
[
|
|
185
|
+
[f, a]
|
|
186
186
|
), ue = se.useCallback(
|
|
187
187
|
(O, B, K) => {
|
|
188
|
-
|
|
188
|
+
f(
|
|
189
189
|
(P) => P == null ? void 0 : P.map(
|
|
190
190
|
(L) => L.id === B ? {
|
|
191
191
|
...L,
|
|
@@ -198,10 +198,10 @@ const be = xn(void 0), Pi = {
|
|
|
198
198
|
)
|
|
199
199
|
), a == null || a("ADD_ELEMENT_IN_POSITION", { sectionId: B, element: O, index: K });
|
|
200
200
|
},
|
|
201
|
-
[
|
|
201
|
+
[f, a]
|
|
202
202
|
), Ae = se.useCallback(
|
|
203
203
|
(O, B, K) => {
|
|
204
|
-
|
|
204
|
+
f(
|
|
205
205
|
(P) => P == null ? void 0 : P.map(
|
|
206
206
|
(L) => {
|
|
207
207
|
var U;
|
|
@@ -228,10 +228,10 @@ const be = xn(void 0), Pi = {
|
|
|
228
228
|
)
|
|
229
229
|
), a == null || a("UPDATE_GRID_ELEMENT", { sectionId: K, gridIndex: O, element: B });
|
|
230
230
|
},
|
|
231
|
-
[
|
|
231
|
+
[f, a]
|
|
232
232
|
), ke = se.useCallback(
|
|
233
233
|
(O, B) => {
|
|
234
|
-
|
|
234
|
+
f(
|
|
235
235
|
(K) => K == null ? void 0 : K.map(
|
|
236
236
|
(P) => {
|
|
237
237
|
var L;
|
|
@@ -245,7 +245,7 @@ const be = xn(void 0), Pi = {
|
|
|
245
245
|
)
|
|
246
246
|
), a == null || a("UPDATE_ELEMENT", { sectionId: B, value: O });
|
|
247
247
|
},
|
|
248
|
-
[
|
|
248
|
+
[f, a]
|
|
249
249
|
), Be = se.useCallback(
|
|
250
250
|
(O) => {
|
|
251
251
|
const {
|
|
@@ -256,7 +256,7 @@ const be = xn(void 0), Pi = {
|
|
|
256
256
|
targetGridId: U,
|
|
257
257
|
targetCol: $
|
|
258
258
|
} = O;
|
|
259
|
-
|
|
259
|
+
f(
|
|
260
260
|
(j) => j.map((H) => {
|
|
261
261
|
if (H.id !== K) return H;
|
|
262
262
|
const W = [...H == null ? void 0 : H.questionData], Q = W.findIndex((le) => le.id === B);
|
|
@@ -302,10 +302,10 @@ const be = xn(void 0), Pi = {
|
|
|
302
302
|
})
|
|
303
303
|
), a == null || a("MOVE_ELEMENT", O);
|
|
304
304
|
},
|
|
305
|
-
[
|
|
305
|
+
[f, a]
|
|
306
306
|
), Me = se.useCallback(
|
|
307
307
|
(O, B) => {
|
|
308
|
-
|
|
308
|
+
f(
|
|
309
309
|
(K) => K == null ? void 0 : K.map(
|
|
310
310
|
(P) => P.id === B ? {
|
|
311
311
|
...P,
|
|
@@ -314,11 +314,11 @@ const be = xn(void 0), Pi = {
|
|
|
314
314
|
)
|
|
315
315
|
), a == null || a("UPDATE_SECTION", { sectionId: B, value: O });
|
|
316
316
|
},
|
|
317
|
-
[
|
|
317
|
+
[f, a]
|
|
318
318
|
), Ee = ee(
|
|
319
319
|
() => ({
|
|
320
320
|
formData: A,
|
|
321
|
-
setFormData:
|
|
321
|
+
setFormData: f,
|
|
322
322
|
handleDragStop: X,
|
|
323
323
|
removeElement: V,
|
|
324
324
|
elementData: u,
|
|
@@ -347,7 +347,7 @@ const be = xn(void 0), Pi = {
|
|
|
347
347
|
moveElement: Be,
|
|
348
348
|
showPreview: s,
|
|
349
349
|
setShowPreview: o,
|
|
350
|
-
undo:
|
|
350
|
+
undo: v,
|
|
351
351
|
redo: N,
|
|
352
352
|
canUndo: k,
|
|
353
353
|
canRedo: x
|
|
@@ -374,7 +374,7 @@ const be = xn(void 0), Pi = {
|
|
|
374
374
|
ce,
|
|
375
375
|
Be,
|
|
376
376
|
s,
|
|
377
|
-
|
|
377
|
+
v,
|
|
378
378
|
N,
|
|
379
379
|
k,
|
|
380
380
|
x
|
|
@@ -579,10 +579,14 @@ const vi = ({
|
|
|
579
579
|
maxDate: u,
|
|
580
580
|
showYearDropdown: t
|
|
581
581
|
}) => {
|
|
582
|
-
const
|
|
582
|
+
const r = (y) => {
|
|
583
|
+
if (!y) return null;
|
|
584
|
+
const g = new Date(y);
|
|
585
|
+
return isNaN(g.getTime()) ? null : g;
|
|
586
|
+
}, m = r(e), [c, h] = D(m);
|
|
583
587
|
return G(() => {
|
|
584
|
-
const
|
|
585
|
-
(
|
|
588
|
+
const y = r(e);
|
|
589
|
+
(y && c && y.getTime() !== c.getTime() || !y && c || y && !c) && h(y);
|
|
586
590
|
}, [e]), G(() => {
|
|
587
591
|
n && n(o, c);
|
|
588
592
|
}, [c, n, o]), /* @__PURE__ */ i("div", { className: "builder_date__picker", children: /* @__PURE__ */ i(
|
|
@@ -594,8 +598,8 @@ const vi = ({
|
|
|
594
598
|
dateFormat: s,
|
|
595
599
|
disabled: a,
|
|
596
600
|
selected: c,
|
|
597
|
-
onChange: (
|
|
598
|
-
|
|
601
|
+
onChange: (y) => {
|
|
602
|
+
h(y);
|
|
599
603
|
},
|
|
600
604
|
className: "field-control",
|
|
601
605
|
portalId: "root-portal",
|
|
@@ -776,12 +780,12 @@ const sn = /^[a-z0-9]+(-[a-z0-9]+)*$/, Qe = (e, n, a, s = "") => {
|
|
|
776
780
|
}
|
|
777
781
|
if (o.length > 3 || !o.length) return null;
|
|
778
782
|
if (o.length > 1) {
|
|
779
|
-
const u = o.pop(), t = o.pop(),
|
|
783
|
+
const u = o.pop(), t = o.pop(), r = {
|
|
780
784
|
provider: o.length > 0 ? o[0] : s,
|
|
781
785
|
prefix: t,
|
|
782
786
|
name: u
|
|
783
787
|
};
|
|
784
|
-
return n && !Je(
|
|
788
|
+
return n && !Je(r) ? null : r;
|
|
785
789
|
}
|
|
786
790
|
const l = o[0], d = l.split("-");
|
|
787
791
|
if (d.length > 1) {
|
|
@@ -896,36 +900,36 @@ function $n(e, n) {
|
|
|
896
900
|
height: a.height
|
|
897
901
|
};
|
|
898
902
|
let l = a.body;
|
|
899
|
-
[a, s].forEach((
|
|
900
|
-
const
|
|
901
|
-
let A =
|
|
902
|
-
|
|
903
|
+
[a, s].forEach((g) => {
|
|
904
|
+
const f = [], v = g.hFlip, N = g.vFlip;
|
|
905
|
+
let A = g.rotate;
|
|
906
|
+
v ? N ? A += 2 : (f.push("translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"), f.push("scale(-1 1)"), o.top = o.left = 0) : N && (f.push("translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"), f.push("scale(1 -1)"), o.top = o.left = 0);
|
|
903
907
|
let k;
|
|
904
908
|
switch (A < 0 && (A -= Math.floor(A / 4) * 4), A = A % 4, A) {
|
|
905
909
|
case 1:
|
|
906
|
-
k = o.height / 2 + o.top,
|
|
910
|
+
k = o.height / 2 + o.top, f.unshift("rotate(90 " + k.toString() + " " + k.toString() + ")");
|
|
907
911
|
break;
|
|
908
912
|
case 2:
|
|
909
|
-
|
|
913
|
+
f.unshift("rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")");
|
|
910
914
|
break;
|
|
911
915
|
case 3:
|
|
912
|
-
k = o.width / 2 + o.left,
|
|
916
|
+
k = o.width / 2 + o.left, f.unshift("rotate(-90 " + k.toString() + " " + k.toString() + ")");
|
|
913
917
|
break;
|
|
914
918
|
}
|
|
915
|
-
A % 2 === 1 && (o.left !== o.top && (k = o.left, o.left = o.top, o.top = k), o.width !== o.height && (k = o.width, o.width = o.height, o.height = k)),
|
|
919
|
+
A % 2 === 1 && (o.left !== o.top && (k = o.left, o.left = o.top, o.top = k), o.width !== o.height && (k = o.width, o.width = o.height, o.height = k)), f.length && (l = Yn(l, '<g transform="' + f.join(" ") + '">', "</g>"));
|
|
916
920
|
});
|
|
917
|
-
const d = s.width, u = s.height, t = o.width,
|
|
918
|
-
let
|
|
919
|
-
d === null ? (
|
|
920
|
-
const h = {},
|
|
921
|
-
Zn(
|
|
921
|
+
const d = s.width, u = s.height, t = o.width, r = o.height;
|
|
922
|
+
let m, c;
|
|
923
|
+
d === null ? (c = u === null ? "1em" : u === "auto" ? r : u, m = Ki(c, t / r)) : (m = d === "auto" ? t : d, c = u === null ? Ki(m, r / t) : u === "auto" ? r : u);
|
|
924
|
+
const h = {}, p = (g, f) => {
|
|
925
|
+
Zn(f) || (h[g] = f.toString());
|
|
922
926
|
};
|
|
923
|
-
|
|
927
|
+
p("width", m), p("height", c);
|
|
924
928
|
const y = [
|
|
925
929
|
o.left,
|
|
926
930
|
o.top,
|
|
927
931
|
t,
|
|
928
|
-
|
|
932
|
+
r
|
|
929
933
|
];
|
|
930
934
|
return h.viewBox = y.join(" "), {
|
|
931
935
|
attributes: h,
|
|
@@ -1012,8 +1016,8 @@ const da = (e, n, a) => {
|
|
|
1012
1016
|
prefix: n,
|
|
1013
1017
|
icons: []
|
|
1014
1018
|
}, u = 0;
|
|
1015
|
-
return a.forEach((t,
|
|
1016
|
-
u += t.length + 1, u >= o &&
|
|
1019
|
+
return a.forEach((t, r) => {
|
|
1020
|
+
u += t.length + 1, u >= o && r > 0 && (s.push(d), d = {
|
|
1017
1021
|
type: l,
|
|
1018
1022
|
provider: e,
|
|
1019
1023
|
prefix: n,
|
|
@@ -1093,16 +1097,16 @@ function ra(e) {
|
|
|
1093
1097
|
const d = l.icons, u = d.pending.length;
|
|
1094
1098
|
d.pending = d.pending.filter((t) => {
|
|
1095
1099
|
if (t.prefix !== o) return !0;
|
|
1096
|
-
const
|
|
1097
|
-
if (e.icons[
|
|
1100
|
+
const r = t.name;
|
|
1101
|
+
if (e.icons[r]) d.loaded.push({
|
|
1098
1102
|
provider: s,
|
|
1099
1103
|
prefix: o,
|
|
1100
|
-
name:
|
|
1104
|
+
name: r
|
|
1101
1105
|
});
|
|
1102
|
-
else if (e.missing.has(
|
|
1106
|
+
else if (e.missing.has(r)) d.missing.push({
|
|
1103
1107
|
provider: s,
|
|
1104
1108
|
prefix: o,
|
|
1105
|
-
name:
|
|
1109
|
+
name: r
|
|
1106
1110
|
});
|
|
1107
1111
|
else
|
|
1108
1112
|
return a = !0, !0;
|
|
@@ -1140,15 +1144,15 @@ function va(e) {
|
|
|
1140
1144
|
return e.forEach((o) => {
|
|
1141
1145
|
if (s.name === o.name && s.prefix === o.prefix && s.provider === o.provider) return;
|
|
1142
1146
|
s = o;
|
|
1143
|
-
const l = o.provider, d = o.prefix, u = o.name, t = a[l] || (a[l] = /* @__PURE__ */ Object.create(null)),
|
|
1144
|
-
let
|
|
1145
|
-
u in
|
|
1146
|
-
const
|
|
1147
|
+
const l = o.provider, d = o.prefix, u = o.name, t = a[l] || (a[l] = /* @__PURE__ */ Object.create(null)), r = t[d] || (t[d] = Ke(l, d));
|
|
1148
|
+
let m;
|
|
1149
|
+
u in r.icons ? m = n.loaded : d === "" || r.missing.has(u) ? m = n.missing : m = n.pending;
|
|
1150
|
+
const c = {
|
|
1147
1151
|
provider: l,
|
|
1148
1152
|
prefix: d,
|
|
1149
1153
|
name: u
|
|
1150
1154
|
};
|
|
1151
|
-
|
|
1155
|
+
m.push(c);
|
|
1152
1156
|
}), n;
|
|
1153
1157
|
}
|
|
1154
1158
|
function pa(e, n = !0, a = !1) {
|
|
@@ -1178,33 +1182,33 @@ function ga(e, n, a, s) {
|
|
|
1178
1182
|
d = d.concat(C);
|
|
1179
1183
|
} else d = e.resources.slice(l).concat(e.resources.slice(0, l));
|
|
1180
1184
|
const u = Date.now();
|
|
1181
|
-
let t = "pending",
|
|
1182
|
-
typeof s == "function" &&
|
|
1185
|
+
let t = "pending", r = 0, m, c = null, h = [], p = [];
|
|
1186
|
+
typeof s == "function" && p.push(s);
|
|
1183
1187
|
function y() {
|
|
1184
|
-
|
|
1188
|
+
c && (clearTimeout(c), c = null);
|
|
1185
1189
|
}
|
|
1186
|
-
function
|
|
1190
|
+
function g() {
|
|
1187
1191
|
t === "pending" && (t = "aborted"), y(), h.forEach((C) => {
|
|
1188
1192
|
C.status === "pending" && (C.status = "aborted");
|
|
1189
1193
|
}), h = [];
|
|
1190
1194
|
}
|
|
1191
|
-
function
|
|
1192
|
-
M && (
|
|
1195
|
+
function f(C, M) {
|
|
1196
|
+
M && (p = []), typeof C == "function" && p.push(C);
|
|
1193
1197
|
}
|
|
1194
|
-
function
|
|
1198
|
+
function v() {
|
|
1195
1199
|
return {
|
|
1196
1200
|
startTime: u,
|
|
1197
1201
|
payload: n,
|
|
1198
1202
|
status: t,
|
|
1199
|
-
queriesSent:
|
|
1203
|
+
queriesSent: r,
|
|
1200
1204
|
queriesPending: h.length,
|
|
1201
|
-
subscribe:
|
|
1202
|
-
abort:
|
|
1205
|
+
subscribe: f,
|
|
1206
|
+
abort: g
|
|
1203
1207
|
};
|
|
1204
1208
|
}
|
|
1205
1209
|
function N() {
|
|
1206
|
-
t = "failed",
|
|
1207
|
-
C(void 0,
|
|
1210
|
+
t = "failed", p.forEach((C) => {
|
|
1211
|
+
C(void 0, m);
|
|
1208
1212
|
});
|
|
1209
1213
|
}
|
|
1210
1214
|
function A() {
|
|
@@ -1224,18 +1228,18 @@ function ga(e, n, a, s) {
|
|
|
1224
1228
|
return;
|
|
1225
1229
|
}
|
|
1226
1230
|
if (M === "abort") {
|
|
1227
|
-
|
|
1231
|
+
m = w, N();
|
|
1228
1232
|
return;
|
|
1229
1233
|
}
|
|
1230
1234
|
if (S) {
|
|
1231
|
-
|
|
1235
|
+
m = w, h.length || (d.length ? x() : N());
|
|
1232
1236
|
return;
|
|
1233
1237
|
}
|
|
1234
1238
|
if (y(), A(), !e.random) {
|
|
1235
1239
|
const T = e.resources.indexOf(C.resource);
|
|
1236
1240
|
T !== -1 && T !== e.index && (e.index = T);
|
|
1237
1241
|
}
|
|
1238
|
-
t = "completed",
|
|
1242
|
+
t = "completed", p.forEach((T) => {
|
|
1239
1243
|
T(w);
|
|
1240
1244
|
});
|
|
1241
1245
|
}
|
|
@@ -1245,7 +1249,7 @@ function ga(e, n, a, s) {
|
|
|
1245
1249
|
const C = d.shift();
|
|
1246
1250
|
if (C === void 0) {
|
|
1247
1251
|
if (h.length) {
|
|
1248
|
-
|
|
1252
|
+
c = setTimeout(() => {
|
|
1249
1253
|
y(), t === "pending" && (A(), N());
|
|
1250
1254
|
}, e.timeout);
|
|
1251
1255
|
return;
|
|
@@ -1260,9 +1264,9 @@ function ga(e, n, a, s) {
|
|
|
1260
1264
|
k(M, w, S);
|
|
1261
1265
|
}
|
|
1262
1266
|
};
|
|
1263
|
-
h.push(M),
|
|
1267
|
+
h.push(M), r++, c = setTimeout(x, e.rotate), a(C, n, M.callback);
|
|
1264
1268
|
}
|
|
1265
|
-
return setTimeout(x),
|
|
1269
|
+
return setTimeout(x), v;
|
|
1266
1270
|
}
|
|
1267
1271
|
function cn(e) {
|
|
1268
1272
|
const n = {
|
|
@@ -1273,11 +1277,11 @@ function cn(e) {
|
|
|
1273
1277
|
function s() {
|
|
1274
1278
|
a = a.filter((u) => u().status === "pending");
|
|
1275
1279
|
}
|
|
1276
|
-
function o(u, t,
|
|
1277
|
-
const
|
|
1278
|
-
s(),
|
|
1280
|
+
function o(u, t, r) {
|
|
1281
|
+
const m = ga(n, u, t, (c, h) => {
|
|
1282
|
+
s(), r && r(c, h);
|
|
1279
1283
|
});
|
|
1280
|
-
return a.push(
|
|
1284
|
+
return a.push(m), m;
|
|
1281
1285
|
}
|
|
1282
1286
|
function l(u) {
|
|
1283
1287
|
return a.find((t) => u(t)) || null;
|
|
@@ -1373,20 +1377,20 @@ function Aa(e, n) {
|
|
|
1373
1377
|
if (delete e.iconsToLoad, !o || !o.length) return;
|
|
1374
1378
|
const l = e.loadIcon;
|
|
1375
1379
|
if (e.loadIcons && (o.length > 1 || !l)) {
|
|
1376
|
-
Hi(e.loadIcons(o, s, a), (
|
|
1377
|
-
He(e, o,
|
|
1380
|
+
Hi(e.loadIcons(o, s, a), (m) => {
|
|
1381
|
+
He(e, o, m);
|
|
1378
1382
|
});
|
|
1379
1383
|
return;
|
|
1380
1384
|
}
|
|
1381
1385
|
if (l) {
|
|
1382
|
-
o.forEach((
|
|
1383
|
-
const
|
|
1384
|
-
Hi(
|
|
1385
|
-
const
|
|
1386
|
+
o.forEach((m) => {
|
|
1387
|
+
const c = l(m, s, a);
|
|
1388
|
+
Hi(c, (h) => {
|
|
1389
|
+
const p = h ? {
|
|
1386
1390
|
prefix: s,
|
|
1387
|
-
icons: { [
|
|
1391
|
+
icons: { [m]: h }
|
|
1388
1392
|
} : null;
|
|
1389
|
-
He(e, [
|
|
1393
|
+
He(e, [m], p);
|
|
1390
1394
|
});
|
|
1391
1395
|
});
|
|
1392
1396
|
return;
|
|
@@ -1398,9 +1402,9 @@ function Aa(e, n) {
|
|
|
1398
1402
|
He(e, d, null);
|
|
1399
1403
|
return;
|
|
1400
1404
|
}
|
|
1401
|
-
t.prepare(a, s, d).forEach((
|
|
1402
|
-
ya(a,
|
|
1403
|
-
He(e,
|
|
1405
|
+
t.prepare(a, s, d).forEach((m) => {
|
|
1406
|
+
ya(a, m, (c) => {
|
|
1407
|
+
He(e, m.icons, c);
|
|
1404
1408
|
});
|
|
1405
1409
|
});
|
|
1406
1410
|
}));
|
|
@@ -1418,17 +1422,17 @@ const Na = (e, n) => {
|
|
|
1418
1422
|
const o = /* @__PURE__ */ Object.create(null), l = [];
|
|
1419
1423
|
let d, u;
|
|
1420
1424
|
return s.pending.forEach((t) => {
|
|
1421
|
-
const { provider:
|
|
1422
|
-
if (
|
|
1423
|
-
d =
|
|
1424
|
-
const
|
|
1425
|
-
|
|
1425
|
+
const { provider: r, prefix: m } = t;
|
|
1426
|
+
if (m === u && r === d) return;
|
|
1427
|
+
d = r, u = m, l.push(Ke(r, m));
|
|
1428
|
+
const c = o[r] || (o[r] = /* @__PURE__ */ Object.create(null));
|
|
1429
|
+
c[m] || (c[m] = []);
|
|
1426
1430
|
}), s.pending.forEach((t) => {
|
|
1427
|
-
const { provider:
|
|
1428
|
-
|
|
1431
|
+
const { provider: r, prefix: m, name: c } = t, h = Ke(r, m), p = h.pendingIcons || (h.pendingIcons = /* @__PURE__ */ new Set());
|
|
1432
|
+
p.has(c) || (p.add(c), o[r][m].push(c));
|
|
1429
1433
|
}), l.forEach((t) => {
|
|
1430
|
-
const
|
|
1431
|
-
|
|
1434
|
+
const r = o[t.provider][t.prefix];
|
|
1435
|
+
r.length && Aa(t, r);
|
|
1432
1436
|
}), n ? ba(n, s, l) : ji;
|
|
1433
1437
|
};
|
|
1434
1438
|
function Ca(e, n) {
|
|
@@ -1542,21 +1546,21 @@ const Oa = (e, n, a) => {
|
|
|
1542
1546
|
...l === "svg" ? Da : {}
|
|
1543
1547
|
};
|
|
1544
1548
|
if (a) {
|
|
1545
|
-
const
|
|
1546
|
-
if (
|
|
1547
|
-
const
|
|
1549
|
+
const f = Qe(a, !1, !0);
|
|
1550
|
+
if (f) {
|
|
1551
|
+
const v = ["iconify"], N = [
|
|
1548
1552
|
"provider",
|
|
1549
1553
|
"prefix"
|
|
1550
1554
|
];
|
|
1551
1555
|
for (const A of N)
|
|
1552
|
-
|
|
1553
|
-
t.className =
|
|
1556
|
+
f[A] && v.push("iconify--" + f[A]);
|
|
1557
|
+
t.className = v.join(" ");
|
|
1554
1558
|
}
|
|
1555
1559
|
}
|
|
1556
|
-
for (let
|
|
1557
|
-
const
|
|
1558
|
-
if (
|
|
1559
|
-
switch (
|
|
1560
|
+
for (let f in n) {
|
|
1561
|
+
const v = n[f];
|
|
1562
|
+
if (v !== void 0)
|
|
1563
|
+
switch (f) {
|
|
1560
1564
|
// Properties to ignore
|
|
1561
1565
|
case "icon":
|
|
1562
1566
|
case "style":
|
|
@@ -1568,61 +1572,61 @@ const Oa = (e, n, a) => {
|
|
|
1568
1572
|
break;
|
|
1569
1573
|
// Forward ref
|
|
1570
1574
|
case "_ref":
|
|
1571
|
-
t.ref =
|
|
1575
|
+
t.ref = v;
|
|
1572
1576
|
break;
|
|
1573
1577
|
// Merge class names
|
|
1574
1578
|
case "className":
|
|
1575
|
-
t[
|
|
1579
|
+
t[f] = (t[f] ? t[f] + " " : "") + v;
|
|
1576
1580
|
break;
|
|
1577
1581
|
// Boolean attributes
|
|
1578
1582
|
case "inline":
|
|
1579
1583
|
case "hFlip":
|
|
1580
1584
|
case "vFlip":
|
|
1581
|
-
o[
|
|
1585
|
+
o[f] = v === !0 || v === "true" || v === 1;
|
|
1582
1586
|
break;
|
|
1583
1587
|
// Flip as string: 'horizontal,vertical'
|
|
1584
1588
|
case "flip":
|
|
1585
|
-
typeof
|
|
1589
|
+
typeof v == "string" && Ma(o, v);
|
|
1586
1590
|
break;
|
|
1587
1591
|
// Color: copy to style
|
|
1588
1592
|
case "color":
|
|
1589
|
-
d.color =
|
|
1593
|
+
d.color = v;
|
|
1590
1594
|
break;
|
|
1591
1595
|
// Rotation as string
|
|
1592
1596
|
case "rotate":
|
|
1593
|
-
typeof
|
|
1597
|
+
typeof v == "string" ? o[f] = wa(v) : typeof v == "number" && (o[f] = v);
|
|
1594
1598
|
break;
|
|
1595
1599
|
// Remove aria-hidden
|
|
1596
1600
|
case "ariaHidden":
|
|
1597
1601
|
case "aria-hidden":
|
|
1598
|
-
|
|
1602
|
+
v !== !0 && v !== "true" && delete t["aria-hidden"];
|
|
1599
1603
|
break;
|
|
1600
1604
|
// Copy missing property if it does not exist in customisations
|
|
1601
1605
|
default:
|
|
1602
|
-
s[
|
|
1606
|
+
s[f] === void 0 && (t[f] = v);
|
|
1603
1607
|
}
|
|
1604
1608
|
}
|
|
1605
|
-
const
|
|
1609
|
+
const r = $n(e, o), m = r.attributes;
|
|
1606
1610
|
if (o.inline && (d.verticalAlign = "-0.125em"), l === "svg") {
|
|
1607
1611
|
t.style = {
|
|
1608
1612
|
...d,
|
|
1609
1613
|
...u
|
|
1610
|
-
}, Object.assign(t,
|
|
1611
|
-
let
|
|
1612
|
-
return typeof
|
|
1613
|
-
__html: Ra(ia(
|
|
1614
|
+
}, Object.assign(t, m);
|
|
1615
|
+
let f = 0, v = n.id;
|
|
1616
|
+
return typeof v == "string" && (v = v.replace(/-/g, "_")), t.dangerouslySetInnerHTML = {
|
|
1617
|
+
__html: Ra(ia(r.body, v ? () => v + "ID" + f++ : "iconifyReact"))
|
|
1614
1618
|
}, bi("svg", t);
|
|
1615
1619
|
}
|
|
1616
|
-
const { body:
|
|
1617
|
-
...
|
|
1620
|
+
const { body: c, width: h, height: p } = e, y = l === "mask" || (l === "bg" ? !1 : c.indexOf("currentColor") !== -1), g = Ta(c, {
|
|
1621
|
+
...m,
|
|
1618
1622
|
width: h + "",
|
|
1619
|
-
height:
|
|
1623
|
+
height: p + ""
|
|
1620
1624
|
});
|
|
1621
1625
|
return t.style = {
|
|
1622
1626
|
...d,
|
|
1623
|
-
"--svg": La(
|
|
1624
|
-
width: Ui(
|
|
1625
|
-
height: Ui(
|
|
1627
|
+
"--svg": La(g),
|
|
1628
|
+
width: Ui(m.width),
|
|
1629
|
+
height: Ui(m.height),
|
|
1626
1630
|
...Ia,
|
|
1627
1631
|
...y ? fi : mn,
|
|
1628
1632
|
...u
|
|
@@ -1663,19 +1667,19 @@ if (typeof document != "undefined" && typeof window != "undefined") {
|
|
|
1663
1667
|
}
|
|
1664
1668
|
function bn(e) {
|
|
1665
1669
|
const [n, a] = D(!!e.ssr), [s, o] = D({});
|
|
1666
|
-
function l(
|
|
1667
|
-
if (
|
|
1670
|
+
function l(p) {
|
|
1671
|
+
if (p) {
|
|
1668
1672
|
const y = e.icon;
|
|
1669
1673
|
if (typeof y == "object")
|
|
1670
1674
|
return {
|
|
1671
1675
|
name: "",
|
|
1672
1676
|
data: y
|
|
1673
1677
|
};
|
|
1674
|
-
const
|
|
1675
|
-
if (
|
|
1678
|
+
const g = Ii(y);
|
|
1679
|
+
if (g)
|
|
1676
1680
|
return {
|
|
1677
1681
|
name: y,
|
|
1678
|
-
data:
|
|
1682
|
+
data: g
|
|
1679
1683
|
};
|
|
1680
1684
|
}
|
|
1681
1685
|
return {
|
|
@@ -1684,43 +1688,43 @@ function bn(e) {
|
|
|
1684
1688
|
}
|
|
1685
1689
|
const [d, u] = D(l(!!e.ssr));
|
|
1686
1690
|
function t() {
|
|
1687
|
-
const
|
|
1688
|
-
|
|
1691
|
+
const p = s.callback;
|
|
1692
|
+
p && (p(), o({}));
|
|
1689
1693
|
}
|
|
1690
|
-
function
|
|
1691
|
-
if (JSON.stringify(d) !== JSON.stringify(
|
|
1692
|
-
return t(), u(
|
|
1694
|
+
function r(p) {
|
|
1695
|
+
if (JSON.stringify(d) !== JSON.stringify(p))
|
|
1696
|
+
return t(), u(p), !0;
|
|
1693
1697
|
}
|
|
1694
|
-
function
|
|
1695
|
-
var
|
|
1698
|
+
function m() {
|
|
1699
|
+
var p;
|
|
1696
1700
|
const y = e.icon;
|
|
1697
1701
|
if (typeof y == "object") {
|
|
1698
|
-
|
|
1702
|
+
r({
|
|
1699
1703
|
name: "",
|
|
1700
1704
|
data: y
|
|
1701
1705
|
});
|
|
1702
1706
|
return;
|
|
1703
1707
|
}
|
|
1704
|
-
const
|
|
1705
|
-
if (
|
|
1708
|
+
const g = Ii(y);
|
|
1709
|
+
if (r({
|
|
1706
1710
|
name: y,
|
|
1707
|
-
data:
|
|
1711
|
+
data: g
|
|
1708
1712
|
}))
|
|
1709
|
-
if (
|
|
1710
|
-
const
|
|
1713
|
+
if (g === void 0) {
|
|
1714
|
+
const f = Na([y], m);
|
|
1711
1715
|
o({
|
|
1712
|
-
callback:
|
|
1716
|
+
callback: f
|
|
1713
1717
|
});
|
|
1714
|
-
} else
|
|
1718
|
+
} else g && ((p = e.onLoad) === null || p === void 0 || p.call(e, y));
|
|
1715
1719
|
}
|
|
1716
1720
|
G(() => (a(!0), t), []), G(() => {
|
|
1717
|
-
n &&
|
|
1721
|
+
n && m();
|
|
1718
1722
|
}, [e.icon, n]);
|
|
1719
|
-
const { name:
|
|
1723
|
+
const { name: c, data: h } = d;
|
|
1720
1724
|
return h ? Oa({
|
|
1721
1725
|
...Ai,
|
|
1722
1726
|
...h
|
|
1723
|
-
}, e,
|
|
1727
|
+
}, e, c) : e.children ? e.children : e.fallback ? e.fallback : bi("span", {});
|
|
1724
1728
|
}
|
|
1725
1729
|
const vn = Zi((e, n) => bn({
|
|
1726
1730
|
...e,
|
|
@@ -1742,17 +1746,17 @@ function Mi({
|
|
|
1742
1746
|
validationData: n,
|
|
1743
1747
|
placeholder: a
|
|
1744
1748
|
}) {
|
|
1745
|
-
var
|
|
1749
|
+
var c;
|
|
1746
1750
|
const {
|
|
1747
1751
|
register: s = () => ({}),
|
|
1748
1752
|
setValue: o,
|
|
1749
1753
|
isReadOnly: l,
|
|
1750
1754
|
watch: d,
|
|
1751
1755
|
getValues: u
|
|
1752
|
-
} = n || {}, [t,
|
|
1756
|
+
} = n || {}, [t, r] = D(() => {
|
|
1753
1757
|
const h = u == null ? void 0 : u(e.id);
|
|
1754
1758
|
return Array.isArray(h) ? h : [];
|
|
1755
|
-
}),
|
|
1759
|
+
}), m = ee(
|
|
1756
1760
|
() => t == null ? void 0 : t.map((h) => h.label).join(", "),
|
|
1757
1761
|
[t]
|
|
1758
1762
|
);
|
|
@@ -1760,20 +1764,20 @@ function Mi({
|
|
|
1760
1764
|
s(e.id);
|
|
1761
1765
|
}, [e.id, s]), G(() => {
|
|
1762
1766
|
if (!d) return;
|
|
1763
|
-
const h = d((
|
|
1764
|
-
const y =
|
|
1765
|
-
y !== void 0 &&
|
|
1767
|
+
const h = d((p) => {
|
|
1768
|
+
const y = p[e.id];
|
|
1769
|
+
y !== void 0 && r(Array.isArray(y) ? y : []);
|
|
1766
1770
|
});
|
|
1767
1771
|
return () => {
|
|
1768
|
-
var
|
|
1769
|
-
return (
|
|
1772
|
+
var p;
|
|
1773
|
+
return (p = h.unsubscribe) == null ? void 0 : p.call(h);
|
|
1770
1774
|
};
|
|
1771
1775
|
}, [d, e.id]), /* @__PURE__ */ i("div", { className: "custom-select", children: /* @__PURE__ */ i(
|
|
1772
1776
|
ae,
|
|
1773
1777
|
{
|
|
1774
1778
|
value: t || [],
|
|
1775
1779
|
onChange: (h) => {
|
|
1776
|
-
|
|
1780
|
+
r(h), o == null || o(e.id, h);
|
|
1777
1781
|
},
|
|
1778
1782
|
multiple: !0,
|
|
1779
1783
|
disabled: l,
|
|
@@ -1785,7 +1789,7 @@ function Mi({
|
|
|
1785
1789
|
className: "custom-select__control field-control",
|
|
1786
1790
|
disabled: l,
|
|
1787
1791
|
children: [
|
|
1788
|
-
/* @__PURE__ */ i("span", { className: "custom-select__value", children: (t == null ? void 0 : t.length) > 0 ?
|
|
1792
|
+
/* @__PURE__ */ i("span", { className: "custom-select__value", children: (t == null ? void 0 : t.length) > 0 ? m : /* @__PURE__ */ i("span", { className: "custom-select__placeholder", children: a != null ? a : " Select options" }) }),
|
|
1789
1793
|
/* @__PURE__ */ i("span", { className: "custom-select__icon", children: /* @__PURE__ */ i(J, { icon: "lucide:chevron-down" }) })
|
|
1790
1794
|
]
|
|
1791
1795
|
}
|
|
@@ -1795,8 +1799,8 @@ function Mi({
|
|
|
1795
1799
|
{
|
|
1796
1800
|
anchor: "bottom start",
|
|
1797
1801
|
className: "custom-select__options",
|
|
1798
|
-
children: (
|
|
1799
|
-
(h,
|
|
1802
|
+
children: (c = e == null ? void 0 : e.options) == null ? void 0 : c.map(
|
|
1803
|
+
(h, p) => /* @__PURE__ */ i(
|
|
1800
1804
|
ae.Option,
|
|
1801
1805
|
{
|
|
1802
1806
|
value: h,
|
|
@@ -1812,7 +1816,7 @@ function Mi({
|
|
|
1812
1816
|
y && /* @__PURE__ */ i("span", { className: "custom-select__check", children: "✓" })
|
|
1813
1817
|
] })
|
|
1814
1818
|
},
|
|
1815
|
-
|
|
1819
|
+
p
|
|
1816
1820
|
)
|
|
1817
1821
|
)
|
|
1818
1822
|
}
|
|
@@ -1851,41 +1855,41 @@ function pn({
|
|
|
1851
1855
|
}, [e]), G(() => {
|
|
1852
1856
|
if (l === "pdf" && (e != null && e.startsWith("data:")))
|
|
1853
1857
|
try {
|
|
1854
|
-
const
|
|
1855
|
-
for (let N = 0; N <
|
|
1856
|
-
|
|
1857
|
-
const
|
|
1858
|
-
return t(
|
|
1859
|
-
} catch (
|
|
1860
|
-
console.error("Error creating blob URL:",
|
|
1858
|
+
const p = atob(e.split(",")[1]), y = new ArrayBuffer(p.length), g = new Uint8Array(y);
|
|
1859
|
+
for (let N = 0; N < p.length; N++)
|
|
1860
|
+
g[N] = p.charCodeAt(N);
|
|
1861
|
+
const f = new Blob([y], { type: "application/pdf" }), v = URL.createObjectURL(f);
|
|
1862
|
+
return t(v), () => URL.revokeObjectURL(v);
|
|
1863
|
+
} catch (p) {
|
|
1864
|
+
console.error("Error creating blob URL:", p);
|
|
1861
1865
|
}
|
|
1862
1866
|
else
|
|
1863
1867
|
t(null);
|
|
1864
1868
|
}, [e, l]);
|
|
1865
|
-
const
|
|
1869
|
+
const r = () => {
|
|
1866
1870
|
l === "image" || l === "pdf" ? o(!0) : window.open(u || e, "_blank");
|
|
1867
|
-
},
|
|
1868
|
-
function h(
|
|
1869
|
-
if (!
|
|
1870
|
-
if (
|
|
1871
|
-
const
|
|
1872
|
-
|
|
1871
|
+
}, m = () => o(!1), c = n || (e == null ? void 0 : e.split("/").pop()) || "Unknown file";
|
|
1872
|
+
function h(p, y = "download") {
|
|
1873
|
+
if (!p) return;
|
|
1874
|
+
if (p.startsWith("data:")) {
|
|
1875
|
+
const f = document.createElement("a");
|
|
1876
|
+
f.href = p, f.download = y, document.body.appendChild(f), f.click(), document.body.removeChild(f);
|
|
1873
1877
|
return;
|
|
1874
1878
|
}
|
|
1875
|
-
const
|
|
1876
|
-
|
|
1879
|
+
const g = document.createElement("a");
|
|
1880
|
+
g.href = p, g.setAttribute("download", y), document.body.appendChild(g), g.click(), document.body.removeChild(g);
|
|
1877
1881
|
}
|
|
1878
1882
|
return /* @__PURE__ */ b("div", { className: "mt-2 field-control !py-1 !bg-gray-50 !flex justify-between gap-x-8 items-center", children: [
|
|
1879
1883
|
/* @__PURE__ */ b(
|
|
1880
1884
|
"div",
|
|
1881
1885
|
{
|
|
1882
|
-
onClick:
|
|
1886
|
+
onClick: r,
|
|
1883
1887
|
className: "!flex items-center rounded cursor-pointer gap-x-3",
|
|
1884
|
-
title: `Click to preview ${
|
|
1888
|
+
title: `Click to preview ${c}`,
|
|
1885
1889
|
children: [
|
|
1886
1890
|
l === "image" && /* @__PURE__ */ i("div", { className: "flex items-center justify-center ", children: /* @__PURE__ */ i(J, { iconClass: "text-4xl", icon: "fluent-color:image-48" }) }),
|
|
1887
1891
|
l !== "image" && /* @__PURE__ */ i(J, { icon: Ha[l], iconClass: "text-4xl" }),
|
|
1888
|
-
/* @__PURE__ */ i("span", { className: "text-sm font-semibold text-center text-gray-700 truncate max-w-[300px]", children:
|
|
1892
|
+
/* @__PURE__ */ i("span", { className: "text-sm font-semibold text-center text-gray-700 truncate max-w-[300px]", children: c })
|
|
1889
1893
|
]
|
|
1890
1894
|
}
|
|
1891
1895
|
),
|
|
@@ -1896,7 +1900,7 @@ function pn({
|
|
|
1896
1900
|
type: "button",
|
|
1897
1901
|
className: "p-2",
|
|
1898
1902
|
onClick: () => h(u || e, n),
|
|
1899
|
-
title: `Download ${
|
|
1903
|
+
title: `Download ${c}`,
|
|
1900
1904
|
children: /* @__PURE__ */ i(J, { icon: "streamline-flex:download-tray-solid" })
|
|
1901
1905
|
}
|
|
1902
1906
|
),
|
|
@@ -1914,17 +1918,17 @@ function pn({
|
|
|
1914
1918
|
"div",
|
|
1915
1919
|
{
|
|
1916
1920
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",
|
|
1917
|
-
onClick:
|
|
1921
|
+
onClick: m,
|
|
1918
1922
|
children: /* @__PURE__ */ b(
|
|
1919
1923
|
"div",
|
|
1920
1924
|
{
|
|
1921
1925
|
className: "relative bg-white p-8 rounded-lg w-full max-w-[90vw] max-h-[90vh] overflow-auto",
|
|
1922
|
-
onClick: (
|
|
1926
|
+
onClick: (p) => p.stopPropagation(),
|
|
1923
1927
|
children: [
|
|
1924
1928
|
/* @__PURE__ */ i(
|
|
1925
1929
|
"button",
|
|
1926
1930
|
{
|
|
1927
|
-
onClick:
|
|
1931
|
+
onClick: m,
|
|
1928
1932
|
className: "absolute text-2xl font-bold text-gray-700 top-2 right-2",
|
|
1929
1933
|
"aria-label": "Close preview",
|
|
1930
1934
|
children: "×"
|
|
@@ -1934,7 +1938,7 @@ function pn({
|
|
|
1934
1938
|
"img",
|
|
1935
1939
|
{
|
|
1936
1940
|
src: e,
|
|
1937
|
-
alt:
|
|
1941
|
+
alt: c,
|
|
1938
1942
|
className: "max-w-full max-h-[80vh] mx-auto object-contain",
|
|
1939
1943
|
crossOrigin: "anonymous"
|
|
1940
1944
|
}
|
|
@@ -1942,7 +1946,7 @@ function pn({
|
|
|
1942
1946
|
"iframe",
|
|
1943
1947
|
{
|
|
1944
1948
|
src: u || e,
|
|
1945
|
-
title:
|
|
1949
|
+
title: c,
|
|
1946
1950
|
className: "w-full h-[80vh] rounded border"
|
|
1947
1951
|
}
|
|
1948
1952
|
) : null
|
|
@@ -1972,17 +1976,17 @@ function Va({
|
|
|
1972
1976
|
list: o = null,
|
|
1973
1977
|
accept: l = []
|
|
1974
1978
|
}) {
|
|
1975
|
-
const { uploadUrl: d, setApiActivityCount: u } = ye(be), t = re(null), [
|
|
1979
|
+
const { uploadUrl: d, setApiActivityCount: u } = ye(be), t = re(null), [r, m] = D(o), [c, h] = D(!1);
|
|
1976
1980
|
G(() => {
|
|
1977
|
-
|
|
1981
|
+
m(o);
|
|
1978
1982
|
}, [o]);
|
|
1979
|
-
const
|
|
1983
|
+
const p = ee(
|
|
1980
1984
|
() => l == null ? void 0 : l.map((x) => x.value).join(", "),
|
|
1981
1985
|
[l]
|
|
1982
1986
|
), y = ee(
|
|
1983
1987
|
() => l == null ? void 0 : l.map((x) => x.label).join(", "),
|
|
1984
1988
|
[l]
|
|
1985
|
-
),
|
|
1989
|
+
), g = Y(
|
|
1986
1990
|
async (x) => {
|
|
1987
1991
|
var w, S;
|
|
1988
1992
|
const C = de("token"), M = ((w = de("orgData")) == null ? void 0 : w.id) || de("organizationId");
|
|
@@ -2006,7 +2010,7 @@ function Va({
|
|
|
2006
2010
|
}
|
|
2007
2011
|
},
|
|
2008
2012
|
[d]
|
|
2009
|
-
),
|
|
2013
|
+
), f = Y(
|
|
2010
2014
|
(x) => new Promise((C, M) => {
|
|
2011
2015
|
const w = new FileReader();
|
|
2012
2016
|
w.onloadend = async () => {
|
|
@@ -2014,7 +2018,7 @@ function Va({
|
|
|
2014
2018
|
const S = w.result.replace(
|
|
2015
2019
|
/^data:.*;base64,/,
|
|
2016
2020
|
""
|
|
2017
|
-
), T = d ? await
|
|
2021
|
+
), T = d ? await g({
|
|
2018
2022
|
base64: S,
|
|
2019
2023
|
ext: `.${x.name.split(".").pop()}`,
|
|
2020
2024
|
fileName: x.name
|
|
@@ -2029,11 +2033,11 @@ function Va({
|
|
|
2029
2033
|
}
|
|
2030
2034
|
}, w.onerror = () => M(new Error("File read failed")), w.readAsDataURL(x);
|
|
2031
2035
|
}),
|
|
2032
|
-
[d,
|
|
2033
|
-
),
|
|
2036
|
+
[d, g]
|
|
2037
|
+
), v = Y(
|
|
2034
2038
|
(x) => {
|
|
2035
2039
|
var M;
|
|
2036
|
-
const C =
|
|
2040
|
+
const C = p ? (M = p.split(",")) == null ? void 0 : M.map((w) => w.trim()) : [];
|
|
2037
2041
|
for (const w of x) {
|
|
2038
2042
|
if (w.size > Fa)
|
|
2039
2043
|
return xe.error(
|
|
@@ -2048,19 +2052,19 @@ function Va({
|
|
|
2048
2052
|
}
|
|
2049
2053
|
return !0;
|
|
2050
2054
|
},
|
|
2051
|
-
[
|
|
2055
|
+
[p, y]
|
|
2052
2056
|
), N = Y(
|
|
2053
2057
|
async (x) => {
|
|
2054
2058
|
const C = Array.from(x.target.files || []);
|
|
2055
|
-
if (!(!C.length ||
|
|
2056
|
-
if (!
|
|
2059
|
+
if (!(!C.length || c)) {
|
|
2060
|
+
if (!v(C)) {
|
|
2057
2061
|
t.current && (t.current.value = "");
|
|
2058
2062
|
return;
|
|
2059
2063
|
}
|
|
2060
2064
|
try {
|
|
2061
2065
|
h(!0), u == null || u((S) => S + 1);
|
|
2062
|
-
const M = await Promise.all(C == null ? void 0 : C.map(
|
|
2063
|
-
|
|
2066
|
+
const M = await Promise.all(C == null ? void 0 : C.map(f)), w = s && r ? [...r, ...M] : M;
|
|
2067
|
+
m(w), e(w), xe.success(`Successfully uploaded ${C.length} file(s)`);
|
|
2064
2068
|
} catch (M) {
|
|
2065
2069
|
console.error("Upload error:", M), xe.error("Failed to upload file(s). Please try again.");
|
|
2066
2070
|
} finally {
|
|
@@ -2068,16 +2072,16 @@ function Va({
|
|
|
2068
2072
|
}
|
|
2069
2073
|
}
|
|
2070
2074
|
},
|
|
2071
|
-
[
|
|
2075
|
+
[c, v, f, e, s, r, u]
|
|
2072
2076
|
), A = Y(
|
|
2073
2077
|
(x) => {
|
|
2074
|
-
|
|
2078
|
+
c || (t.current && (t.current.value = ""), m((C) => {
|
|
2075
2079
|
const M = x === void 0 ? null : (C == null ? void 0 : C.filter((w, S) => S !== x)) || null;
|
|
2076
2080
|
return e(M), M;
|
|
2077
2081
|
}), a == null || a());
|
|
2078
2082
|
},
|
|
2079
|
-
[a, e,
|
|
2080
|
-
), k =
|
|
2083
|
+
[a, e, c]
|
|
2084
|
+
), k = r && r.length > 0;
|
|
2081
2085
|
return /* @__PURE__ */ b("div", { className: "flex flex-col items-start gap-2", children: [
|
|
2082
2086
|
!n && /* @__PURE__ */ b("div", { className: "!flex field-control !py-0 !px-0 relative", children: [
|
|
2083
2087
|
/* @__PURE__ */ i(
|
|
@@ -2086,9 +2090,9 @@ function Va({
|
|
|
2086
2090
|
ref: t,
|
|
2087
2091
|
type: "file",
|
|
2088
2092
|
onChange: N,
|
|
2089
|
-
disabled: n ||
|
|
2093
|
+
disabled: n || c,
|
|
2090
2094
|
multiple: s,
|
|
2091
|
-
accept:
|
|
2095
|
+
accept: p || "",
|
|
2092
2096
|
className: `w-full text-sm text-gray-500 file:mr-4 flex-1 file:px-4 !py-1 !pl-1\r
|
|
2093
2097
|
file:rounded-[6px] file:py-[6px] file:border-0\r
|
|
2094
2098
|
file:text-sm file:font-semibold\r
|
|
@@ -2102,18 +2106,18 @@ function Va({
|
|
|
2102
2106
|
type: "button",
|
|
2103
2107
|
className: "p-2 text-lg text-red-500 hover:text-red-600 transition-colors disabled:opacity-50",
|
|
2104
2108
|
onClick: () => A(),
|
|
2105
|
-
disabled:
|
|
2109
|
+
disabled: c,
|
|
2106
2110
|
"aria-label": "Remove all files",
|
|
2107
2111
|
children: /* @__PURE__ */ i(J, { icon: "lets-icons:trash-duotone" })
|
|
2108
2112
|
}
|
|
2109
2113
|
)
|
|
2110
2114
|
] }),
|
|
2111
2115
|
k && /* @__PURE__ */ b("div", { className: "relative grid gap-y-1 flex-1 w-full", children: [
|
|
2112
|
-
|
|
2116
|
+
c && /* @__PURE__ */ i("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-white/60 rounded", children: /* @__PURE__ */ b("div", { className: "flex items-center gap-2 text-sm text-blue-600 font-medium", children: [
|
|
2113
2117
|
/* @__PURE__ */ i("span", { className: "animate-spin h-4 w-4 border-2 border-blue-500 border-t-transparent rounded-full" }),
|
|
2114
2118
|
"Uploading..."
|
|
2115
2119
|
] }) }),
|
|
2116
|
-
typeof
|
|
2120
|
+
typeof r == "object" && (r == null ? void 0 : r.map((x, C) => /* @__PURE__ */ i(
|
|
2117
2121
|
pn,
|
|
2118
2122
|
{
|
|
2119
2123
|
fileUrl: x.base64,
|
|
@@ -2126,8 +2130,8 @@ function Va({
|
|
|
2126
2130
|
] });
|
|
2127
2131
|
}
|
|
2128
2132
|
function Ua({ element: e, validationData: n }) {
|
|
2129
|
-
var
|
|
2130
|
-
const [a, s] = D((
|
|
2133
|
+
var m;
|
|
2134
|
+
const [a, s] = D((m = e == null ? void 0 : e.value) != null ? m : null), {
|
|
2131
2135
|
register: o = () => ({}),
|
|
2132
2136
|
setValue: l,
|
|
2133
2137
|
isReadOnly: d,
|
|
@@ -2137,21 +2141,21 @@ function Ua({ element: e, validationData: n }) {
|
|
|
2137
2141
|
o(e.id);
|
|
2138
2142
|
}, [e.id, o]), G(() => {
|
|
2139
2143
|
if (u) {
|
|
2140
|
-
const
|
|
2144
|
+
const c = u((h) => {
|
|
2141
2145
|
s(h[e.id]);
|
|
2142
2146
|
});
|
|
2143
2147
|
return () => {
|
|
2144
2148
|
var h;
|
|
2145
|
-
return (h =
|
|
2149
|
+
return (h = c.unsubscribe) == null ? void 0 : h.call(c);
|
|
2146
2150
|
};
|
|
2147
2151
|
}
|
|
2148
2152
|
}, [u, e.id]);
|
|
2149
2153
|
const t = Y(
|
|
2150
|
-
(
|
|
2151
|
-
l == null || l(e.id,
|
|
2154
|
+
(c) => {
|
|
2155
|
+
l == null || l(e.id, c), s(c);
|
|
2152
2156
|
},
|
|
2153
2157
|
[e.id, l]
|
|
2154
|
-
),
|
|
2158
|
+
), r = () => {
|
|
2155
2159
|
l == null || l(e.id, null), s(null);
|
|
2156
2160
|
};
|
|
2157
2161
|
return /* @__PURE__ */ b("div", { children: [
|
|
@@ -2161,17 +2165,17 @@ function Ua({ element: e, validationData: n }) {
|
|
|
2161
2165
|
onFileLoaded: t,
|
|
2162
2166
|
disabled: d,
|
|
2163
2167
|
multiple: e == null ? void 0 : e.isMultiple,
|
|
2164
|
-
handleDeleteFile:
|
|
2168
|
+
handleDeleteFile: r,
|
|
2165
2169
|
list: a,
|
|
2166
2170
|
accept: e == null ? void 0 : e.acceptedFiles
|
|
2167
2171
|
}
|
|
2168
2172
|
),
|
|
2169
2173
|
d && /* @__PURE__ */ i(ve, { children: a ? /* @__PURE__ */ i("div", { className: "relative grid gap-y-1 flex-1 w-full", children: typeof a == "object" && Array.isArray(a) && a.map(
|
|
2170
|
-
(
|
|
2174
|
+
(c, h) => /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
2171
2175
|
pn,
|
|
2172
2176
|
{
|
|
2173
|
-
fileUrl:
|
|
2174
|
-
fileName:
|
|
2177
|
+
fileUrl: c.base64,
|
|
2178
|
+
fileName: c.name
|
|
2175
2179
|
}
|
|
2176
2180
|
) }, h)
|
|
2177
2181
|
) }) : /* @__PURE__ */ i("span", { className: "field-control !bg-gray-50 w-full !text-gray-400 !text-sm !italic ", children: "No File Uploaded" }) })
|
|
@@ -2203,15 +2207,15 @@ const z = ({
|
|
|
2203
2207
|
placeholder: d = "",
|
|
2204
2208
|
isFloating: u,
|
|
2205
2209
|
setValue: t,
|
|
2206
|
-
value:
|
|
2207
|
-
trigger:
|
|
2208
|
-
prefix:
|
|
2210
|
+
value: r,
|
|
2211
|
+
trigger: m,
|
|
2212
|
+
prefix: c,
|
|
2209
2213
|
disabled: h,
|
|
2210
|
-
watch:
|
|
2214
|
+
watch: p,
|
|
2211
2215
|
min: y,
|
|
2212
|
-
max:
|
|
2213
|
-
description:
|
|
2214
|
-
onChange:
|
|
2216
|
+
max: g,
|
|
2217
|
+
description: f,
|
|
2218
|
+
onChange: v
|
|
2215
2219
|
}) => {
|
|
2216
2220
|
var A, k, x, C;
|
|
2217
2221
|
const N = a ? { ...a(n) } : {};
|
|
@@ -2228,33 +2232,33 @@ const z = ({
|
|
|
2228
2232
|
$e,
|
|
2229
2233
|
{
|
|
2230
2234
|
onValueChange: (M) => {
|
|
2231
|
-
t(n, M != null ? M : null), a && a(n),
|
|
2235
|
+
t(n, M != null ? M : null), a && a(n), m && m(n);
|
|
2232
2236
|
},
|
|
2233
2237
|
placeholder: d,
|
|
2234
2238
|
className: `field-control ${s != null && s[n] ? "border-red-300" : "border-[#D0D5DD]"}`,
|
|
2235
2239
|
decimalsLimit: 2,
|
|
2236
|
-
value:
|
|
2237
|
-
prefix:
|
|
2240
|
+
value: r,
|
|
2241
|
+
prefix: c,
|
|
2238
2242
|
disabled: h
|
|
2239
2243
|
}
|
|
2240
2244
|
),
|
|
2241
2245
|
(s == null ? void 0 : s[n]) && /* @__PURE__ */ i("p", { className: "mt-1 text-sm text-red-600", children: (A = s[n]) == null ? void 0 : A.message })
|
|
2242
2246
|
] });
|
|
2243
2247
|
if (["checkbox", "radio"].includes(l)) {
|
|
2244
|
-
const M = (
|
|
2248
|
+
const M = (p == null ? void 0 : p(n)) || null;
|
|
2245
2249
|
let w = !1;
|
|
2246
|
-
return M && (M != null && M.length && l === "checkbox" ? w = M == null ? void 0 : M.includes(
|
|
2250
|
+
return M && (M != null && M.length && l === "checkbox" ? w = M == null ? void 0 : M.includes(r) : w = M == r), /* @__PURE__ */ b("div", { className: "space-y-1", children: [
|
|
2247
2251
|
/* @__PURE__ */ b(
|
|
2248
2252
|
"label",
|
|
2249
2253
|
{
|
|
2250
|
-
className: `flex gap-3 cursor-pointer select-none ${
|
|
2254
|
+
className: `flex gap-3 cursor-pointer select-none ${f ? "items-start" : "items-center"}`,
|
|
2251
2255
|
children: [
|
|
2252
2256
|
/* @__PURE__ */ i(
|
|
2253
2257
|
"input",
|
|
2254
2258
|
{
|
|
2255
2259
|
...N,
|
|
2256
2260
|
type: l,
|
|
2257
|
-
value:
|
|
2261
|
+
value: r || "",
|
|
2258
2262
|
disabled: h,
|
|
2259
2263
|
className: "peer sr-only"
|
|
2260
2264
|
}
|
|
@@ -2282,7 +2286,7 @@ const z = ({
|
|
|
2282
2286
|
),
|
|
2283
2287
|
/* @__PURE__ */ b("div", { children: [
|
|
2284
2288
|
/* @__PURE__ */ i("span", { className: "text-sm leading-none block font-medium text-[#344054] font-onest", children: e }),
|
|
2285
|
-
|
|
2289
|
+
f && /* @__PURE__ */ i("span", { className: "text-xs font-medium leading-none text-[#5c6c86] font-onest", children: f })
|
|
2286
2290
|
] })
|
|
2287
2291
|
]
|
|
2288
2292
|
}
|
|
@@ -2304,7 +2308,7 @@ const z = ({
|
|
|
2304
2308
|
...N,
|
|
2305
2309
|
onChange: (M) => {
|
|
2306
2310
|
var w;
|
|
2307
|
-
(w = N.onChange) == null || w.call(N, M),
|
|
2311
|
+
(w = N.onChange) == null || w.call(N, M), v == null || v(M);
|
|
2308
2312
|
},
|
|
2309
2313
|
className: `field-control ${s != null && s[n] ? "border-red-300" : "border-[#D0D5DD]"} ${o}`,
|
|
2310
2314
|
placeholder: d,
|
|
@@ -2326,14 +2330,14 @@ const z = ({
|
|
|
2326
2330
|
...N,
|
|
2327
2331
|
onChange: (M) => {
|
|
2328
2332
|
var w;
|
|
2329
|
-
(w = N.onChange) == null || w.call(N, M),
|
|
2333
|
+
(w = N.onChange) == null || w.call(N, M), v == null || v(M);
|
|
2330
2334
|
},
|
|
2331
2335
|
type: l,
|
|
2332
2336
|
className: `field-control ${s != null && s[n] ? "border-red-300" : "border-[#D0D5DD]"} ${o}`,
|
|
2333
2337
|
placeholder: u ? "" : d,
|
|
2334
2338
|
disabled: h,
|
|
2335
2339
|
min: y,
|
|
2336
|
-
max:
|
|
2340
|
+
max: g
|
|
2337
2341
|
}
|
|
2338
2342
|
),
|
|
2339
2343
|
(s == null ? void 0 : s[n]) && /* @__PURE__ */ i("p", { className: "mt-1 text-sm text-red-600", children: (C = s[n]) == null ? void 0 : C.message })
|
|
@@ -2399,14 +2403,14 @@ const Ie = ({
|
|
|
2399
2403
|
label: d,
|
|
2400
2404
|
value: u,
|
|
2401
2405
|
trigger: t,
|
|
2402
|
-
isMultiple:
|
|
2403
|
-
isFloatingLabel:
|
|
2404
|
-
subText:
|
|
2406
|
+
isMultiple: r,
|
|
2407
|
+
isFloatingLabel: m,
|
|
2408
|
+
subText: c,
|
|
2405
2409
|
labelClass: h = "text-[10px]",
|
|
2406
|
-
loading:
|
|
2410
|
+
loading: p,
|
|
2407
2411
|
disabled: y
|
|
2408
2412
|
}) => {
|
|
2409
|
-
const [
|
|
2413
|
+
const [g, f] = D(r ? [] : null), v = re(!1), N = ee(() => !u || !e || e.length === 0 ? r ? [] : null : r ? Array.isArray(u) ? e.filter((x) => u.some(
|
|
2410
2414
|
(C) => {
|
|
2411
2415
|
var M;
|
|
2412
2416
|
return typeof x.value == "object" ? ((M = x.value) == null ? void 0 : M.id) === (C == null ? void 0 : C.id) : x.value === C;
|
|
@@ -2414,28 +2418,28 @@ const Ie = ({
|
|
|
2414
2418
|
)) : [] : e.find((x) => {
|
|
2415
2419
|
var C;
|
|
2416
2420
|
return typeof x.value == "string" && typeof u == "string" ? x.value.toLowerCase() === u.toLowerCase() : typeof x.value == "object" && typeof u == "object" ? ((C = x.value) == null ? void 0 : C.id) === (u == null ? void 0 : u.id) : x.value === u;
|
|
2417
|
-
}) || null, [u, e,
|
|
2421
|
+
}) || null, [u, e, r]);
|
|
2418
2422
|
G(() => {
|
|
2419
|
-
if (
|
|
2420
|
-
|
|
2423
|
+
if (v.current) {
|
|
2424
|
+
v.current = !1;
|
|
2421
2425
|
return;
|
|
2422
2426
|
}
|
|
2423
|
-
if (
|
|
2424
|
-
const x =
|
|
2425
|
-
JSON.stringify(x) !== JSON.stringify(C) &&
|
|
2426
|
-
} else (N == null ? void 0 : N.value) !== (
|
|
2427
|
-
}, [N,
|
|
2427
|
+
if (r && Array.isArray(N) && Array.isArray(g)) {
|
|
2428
|
+
const x = g == null ? void 0 : g.map((M) => M.value), C = N == null ? void 0 : N.map((M) => M.value);
|
|
2429
|
+
JSON.stringify(x) !== JSON.stringify(C) && f(N);
|
|
2430
|
+
} else (N == null ? void 0 : N.value) !== (g == null ? void 0 : g.value) && f(N);
|
|
2431
|
+
}, [N, r]);
|
|
2428
2432
|
const A = Y((x) => {
|
|
2429
2433
|
var C;
|
|
2430
|
-
if (
|
|
2431
|
-
const M =
|
|
2434
|
+
if (v.current = !0, f(x), o) {
|
|
2435
|
+
const M = r ? Array.isArray(x) ? x == null ? void 0 : x.map((w) => w.value) : [] : (C = x == null ? void 0 : x.value) != null ? C : null;
|
|
2432
2436
|
o(l, M), t == null || t(l);
|
|
2433
2437
|
}
|
|
2434
|
-
s && !
|
|
2435
|
-
}, [o, l, t, s,
|
|
2438
|
+
s && !v.current && s(l);
|
|
2439
|
+
}, [o, l, t, s, r]), k = ee(() => p ? "Fetching data..." : g ? r && Array.isArray(g) ? g.length > 0 ? g == null ? void 0 : g.map((x) => x.label).join(", ") : n : (g == null ? void 0 : g.label) || n : n, [g, p, n, r]);
|
|
2436
2440
|
return /* @__PURE__ */ b("div", { className: "relative", children: [
|
|
2437
|
-
!
|
|
2438
|
-
|
|
2441
|
+
!m && d && /* @__PURE__ */ i("label", { className: "block text-sm text-[#686878] darks:text-white/70 mb-2", children: d }),
|
|
2442
|
+
m && d && /* @__PURE__ */ i(
|
|
2439
2443
|
"label",
|
|
2440
2444
|
{
|
|
2441
2445
|
className: q(
|
|
@@ -2448,17 +2452,17 @@ const Ie = ({
|
|
|
2448
2452
|
/* @__PURE__ */ i(
|
|
2449
2453
|
ae,
|
|
2450
2454
|
{
|
|
2451
|
-
value:
|
|
2455
|
+
value: g,
|
|
2452
2456
|
onChange: A,
|
|
2453
|
-
multiple:
|
|
2454
|
-
disabled: y ||
|
|
2457
|
+
multiple: r,
|
|
2458
|
+
disabled: y || p,
|
|
2455
2459
|
children: /* @__PURE__ */ b("div", { className: "relative", children: [
|
|
2456
|
-
/* @__PURE__ */ b(ae.Button, { className: "field-control", disabled: y ||
|
|
2460
|
+
/* @__PURE__ */ b(ae.Button, { className: "field-control", disabled: y || p, children: [
|
|
2457
2461
|
/* @__PURE__ */ i(
|
|
2458
2462
|
"span",
|
|
2459
2463
|
{
|
|
2460
2464
|
className: q("block text-sm text-left truncate", {
|
|
2461
|
-
"opacity-60": !
|
|
2465
|
+
"opacity-60": !g || p
|
|
2462
2466
|
}),
|
|
2463
2467
|
children: k
|
|
2464
2468
|
}
|
|
@@ -2488,7 +2492,7 @@ const Ie = ({
|
|
|
2488
2492
|
] })
|
|
2489
2493
|
}
|
|
2490
2494
|
),
|
|
2491
|
-
!a &&
|
|
2495
|
+
!a && c && /* @__PURE__ */ i("p", { className: "text-[10px] text-[#98A2B3] mt-[6px]", children: c }),
|
|
2492
2496
|
(a == null ? void 0 : a.message) && /* @__PURE__ */ i("span", { className: "text-sm text-red-500", children: a.message })
|
|
2493
2497
|
] });
|
|
2494
2498
|
};
|
|
@@ -2502,12 +2506,12 @@ function Ue({
|
|
|
2502
2506
|
name: d,
|
|
2503
2507
|
customClass: u
|
|
2504
2508
|
}) {
|
|
2505
|
-
const [t,
|
|
2509
|
+
const [t, r] = D(""), [m, c] = D([]), [h, p] = D(!1);
|
|
2506
2510
|
G(() => {
|
|
2507
2511
|
(async () => {
|
|
2508
2512
|
var x, C;
|
|
2509
2513
|
if (n) {
|
|
2510
|
-
|
|
2514
|
+
p(!0);
|
|
2511
2515
|
try {
|
|
2512
2516
|
const M = de("token"), w = M ? { headers: { Authorization: `Bearer ${M}` } } : {};
|
|
2513
2517
|
let T = (await Pe.get(n, w)).data;
|
|
@@ -2516,27 +2520,27 @@ function Ue({
|
|
|
2516
2520
|
label: E.label || E.name || String(E.id || E.value),
|
|
2517
2521
|
value: String(E.value || E.id || E.name)
|
|
2518
2522
|
});
|
|
2519
|
-
|
|
2523
|
+
c(I);
|
|
2520
2524
|
}
|
|
2521
2525
|
} catch (M) {
|
|
2522
2526
|
console.error("Failed to fetch options", M);
|
|
2523
2527
|
} finally {
|
|
2524
|
-
|
|
2528
|
+
p(!1);
|
|
2525
2529
|
}
|
|
2526
2530
|
}
|
|
2527
2531
|
})();
|
|
2528
2532
|
}, [n]);
|
|
2529
|
-
const y = n ?
|
|
2533
|
+
const y = n ? m : e, g = ee(() => {
|
|
2530
2534
|
const k = a != null ? a : s;
|
|
2531
2535
|
return k == null || k === "" ? null : y.find((x) => String(x.value) === String(k) || String(x.label) === String(k)) || null;
|
|
2532
|
-
}, [a, s, y]), [
|
|
2536
|
+
}, [a, s, y]), [f, v] = D(g);
|
|
2533
2537
|
G(() => {
|
|
2534
2538
|
if (a !== void 0)
|
|
2535
2539
|
if (a === null || a === "")
|
|
2536
|
-
|
|
2540
|
+
v(null);
|
|
2537
2541
|
else {
|
|
2538
2542
|
const k = y.find((x) => String(x.value) === String(a) || String(x.label) === String(a)) || null;
|
|
2539
|
-
|
|
2543
|
+
v(k);
|
|
2540
2544
|
}
|
|
2541
2545
|
}, [a, y]);
|
|
2542
2546
|
const N = ee(() => {
|
|
@@ -2546,12 +2550,12 @@ function Ue({
|
|
|
2546
2550
|
(x) => x.label.toLowerCase().includes(k)
|
|
2547
2551
|
);
|
|
2548
2552
|
}, [t, y]), A = Y((k) => {
|
|
2549
|
-
|
|
2553
|
+
v(k), o(d, k);
|
|
2550
2554
|
}, [d, o]);
|
|
2551
2555
|
return /* @__PURE__ */ i("div", { className: "relative w-full", children: /* @__PURE__ */ b(
|
|
2552
2556
|
De,
|
|
2553
2557
|
{
|
|
2554
|
-
value:
|
|
2558
|
+
value: f,
|
|
2555
2559
|
onChange: A,
|
|
2556
2560
|
disabled: l,
|
|
2557
2561
|
children: [
|
|
@@ -2561,7 +2565,7 @@ function Ue({
|
|
|
2561
2565
|
{
|
|
2562
2566
|
className: `field-control ${u}`,
|
|
2563
2567
|
displayValue: (k) => (k == null ? void 0 : k.label) || "",
|
|
2564
|
-
onChange: (k) =>
|
|
2568
|
+
onChange: (k) => r(k.target.value),
|
|
2565
2569
|
placeholder: h ? "Loading..." : l ? "" : "Select an option..."
|
|
2566
2570
|
}
|
|
2567
2571
|
),
|
|
@@ -2641,21 +2645,21 @@ function wi(e, n, a) {
|
|
|
2641
2645
|
try {
|
|
2642
2646
|
return Promise.resolve(function(d, u) {
|
|
2643
2647
|
try {
|
|
2644
|
-
var t = (n.context && process.env.NODE_ENV === "development" && console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"), Promise.resolve(e[a.mode === "sync" ? "validateSync" : "validate"](s, Object.assign({ abortEarly: !1 }, n, { context: o }))).then(function(
|
|
2645
|
-
return l.shouldUseNativeValidation && Ln({}, l), { values: a.raw ? s :
|
|
2648
|
+
var t = (n.context && process.env.NODE_ENV === "development" && console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"), Promise.resolve(e[a.mode === "sync" ? "validateSync" : "validate"](s, Object.assign({ abortEarly: !1 }, n, { context: o }))).then(function(r) {
|
|
2649
|
+
return l.shouldUseNativeValidation && Ln({}, l), { values: a.raw ? s : r, errors: {} };
|
|
2646
2650
|
}));
|
|
2647
|
-
} catch (
|
|
2648
|
-
return u(
|
|
2651
|
+
} catch (r) {
|
|
2652
|
+
return u(r);
|
|
2649
2653
|
}
|
|
2650
2654
|
return t && t.then ? t.then(void 0, u) : t;
|
|
2651
2655
|
}(0, function(d) {
|
|
2652
2656
|
if (!d.inner) throw d;
|
|
2653
|
-
return { values: {}, errors: Pn((u = d, t = !l.shouldUseNativeValidation && l.criteriaMode === "all", (u.inner || []).reduce(function(
|
|
2654
|
-
if (m
|
|
2655
|
-
var
|
|
2656
|
-
m
|
|
2657
|
+
return { values: {}, errors: Pn((u = d, t = !l.shouldUseNativeValidation && l.criteriaMode === "all", (u.inner || []).reduce(function(r, m) {
|
|
2658
|
+
if (r[m.path] || (r[m.path] = { message: m.message, type: m.type }), t) {
|
|
2659
|
+
var c = r[m.path].types, h = c && c[m.type];
|
|
2660
|
+
r[m.path] = Tn(m.path, t, r, m.type, h ? [].concat(h, m.message) : m.message);
|
|
2657
2661
|
}
|
|
2658
|
-
return
|
|
2662
|
+
return r;
|
|
2659
2663
|
}, {})), l) };
|
|
2660
2664
|
var u, t;
|
|
2661
2665
|
}));
|
|
@@ -2677,19 +2681,19 @@ const Za = ({
|
|
|
2677
2681
|
n
|
|
2678
2682
|
);
|
|
2679
2683
|
return /* @__PURE__ */ i("div", { className: d, children: e == null ? void 0 : e.map((u) => {
|
|
2680
|
-
const t = o === u.key,
|
|
2684
|
+
const t = o === u.key, r = a[u.key] || 0, m = q(
|
|
2681
2685
|
"capitalize text-sm whitespace-nowrap no-scrollbar font-semibold pb-[14px] border-b-2 border-[#EAECF0] px-6 flex items-center gap-x-1 flex-1 text-center",
|
|
2682
2686
|
`${e.length === 1 ? "justify-start" : "justify-center"}`,
|
|
2683
2687
|
l
|
|
2684
|
-
),
|
|
2688
|
+
), c = q({
|
|
2685
2689
|
"border-gray-500 border-primary border-primary-500 text-primary text-primary-500": t,
|
|
2686
2690
|
"border-transparent text-gray-400 ": !t
|
|
2687
|
-
}), h =
|
|
2691
|
+
}), h = r > 0 && /* @__PURE__ */ i("span", { className: "text-xs h-6 min-w-[24px] rounded-full flex justify-center items-center border border-[#EAECF0] darks:border-gray-500 bg-[#F9FAFB] darks:bg-gray-800 text-[#454745] darks:text-white/80", children: r });
|
|
2688
2692
|
return /* @__PURE__ */ b(
|
|
2689
2693
|
"button",
|
|
2690
2694
|
{
|
|
2691
2695
|
onClick: () => s(u.key),
|
|
2692
|
-
className: q(
|
|
2696
|
+
className: q(m, c),
|
|
2693
2697
|
"aria-selected": t,
|
|
2694
2698
|
role: "tab",
|
|
2695
2699
|
type: "button",
|
|
@@ -3112,12 +3116,12 @@ function mo({
|
|
|
3112
3116
|
G(() => {
|
|
3113
3117
|
(e == null ? void 0 : e.length) > 0 && JSON.stringify(e) !== JSON.stringify(s) && o(e);
|
|
3114
3118
|
}, [e]);
|
|
3115
|
-
function l(t,
|
|
3116
|
-
const
|
|
3117
|
-
|
|
3118
|
-
...
|
|
3119
|
+
function l(t, r) {
|
|
3120
|
+
const m = [...s];
|
|
3121
|
+
m[r] = {
|
|
3122
|
+
...m[r],
|
|
3119
3123
|
value: t
|
|
3120
|
-
}, o(
|
|
3124
|
+
}, o(m), n && n(m);
|
|
3121
3125
|
}
|
|
3122
3126
|
function d() {
|
|
3123
3127
|
const t = [
|
|
@@ -3129,15 +3133,15 @@ function mo({
|
|
|
3129
3133
|
o(t), n && n(t);
|
|
3130
3134
|
}
|
|
3131
3135
|
function u(t) {
|
|
3132
|
-
const
|
|
3133
|
-
o(
|
|
3136
|
+
const r = s.filter((m, c) => c !== t);
|
|
3137
|
+
o(r), n && n(r);
|
|
3134
3138
|
}
|
|
3135
3139
|
return G(() => {
|
|
3136
3140
|
a && a(JSON.stringify({ values: s }));
|
|
3137
3141
|
}, [a, s]), /* @__PURE__ */ b("div", { className: "]", children: [
|
|
3138
3142
|
/* @__PURE__ */ b("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: [
|
|
3139
3143
|
/* @__PURE__ */ i("div", { className: "grid text-sm font-bold border-b border-gray-100 bg-gray-50", children: /* @__PURE__ */ i("div", { className: "px-2 py-2", children: /* @__PURE__ */ i("span", { className: "", children: "Add Denominations" }) }) }),
|
|
3140
|
-
s == null ? void 0 : s.map((t,
|
|
3144
|
+
s == null ? void 0 : s.map((t, r) => /* @__PURE__ */ i(
|
|
3141
3145
|
"div",
|
|
3142
3146
|
{
|
|
3143
3147
|
className: "grid text-sm border-b border-gray-100",
|
|
@@ -3149,14 +3153,14 @@ function mo({
|
|
|
3149
3153
|
className: "border border-gray-100 rounded w-full px-3 py-1 outline-none",
|
|
3150
3154
|
decimalsLimit: 6,
|
|
3151
3155
|
defaultValue: t.value,
|
|
3152
|
-
onValueChange: (
|
|
3156
|
+
onValueChange: (m) => l(m, r),
|
|
3153
3157
|
allowNegativeValue: !1
|
|
3154
3158
|
}
|
|
3155
3159
|
) }),
|
|
3156
3160
|
/* @__PURE__ */ i(
|
|
3157
3161
|
"button",
|
|
3158
3162
|
{
|
|
3159
|
-
onClick: () => u(
|
|
3163
|
+
onClick: () => u(r),
|
|
3160
3164
|
className: "text-red-500 hover:text-red-700 px-2",
|
|
3161
3165
|
type: "button",
|
|
3162
3166
|
"aria-label": "Remove row",
|
|
@@ -3165,7 +3169,7 @@ function mo({
|
|
|
3165
3169
|
)
|
|
3166
3170
|
] })
|
|
3167
3171
|
},
|
|
3168
|
-
|
|
3172
|
+
r + "index"
|
|
3169
3173
|
))
|
|
3170
3174
|
] }),
|
|
3171
3175
|
/* @__PURE__ */ i("div", { className: "mt-1 flex justify-end", children: /* @__PURE__ */ i(
|
|
@@ -3249,26 +3253,26 @@ const bo = () => /* @__PURE__ */ i("blockquote", { className: "bg-gray-100 p-4 r
|
|
|
3249
3253
|
{
|
|
3250
3254
|
type: "file",
|
|
3251
3255
|
accept: ".csv,.xlsx,.xls",
|
|
3252
|
-
onChange: (
|
|
3253
|
-
const
|
|
3254
|
-
if (!
|
|
3255
|
-
d(
|
|
3256
|
-
const
|
|
3257
|
-
|
|
3258
|
-
const
|
|
3256
|
+
onChange: (r) => {
|
|
3257
|
+
const m = r.target.files[0];
|
|
3258
|
+
if (!m) return;
|
|
3259
|
+
d(m.name);
|
|
3260
|
+
const c = new FileReader();
|
|
3261
|
+
m.name.endsWith(".csv") ? (c.onload = (h) => {
|
|
3262
|
+
const p = h.target.result, y = Rn.parse(p, { header: !0 });
|
|
3259
3263
|
e(
|
|
3260
3264
|
n,
|
|
3261
3265
|
(o === "dataGrid" ? xi : yi)(
|
|
3262
3266
|
y.data
|
|
3263
3267
|
)
|
|
3264
3268
|
);
|
|
3265
|
-
},
|
|
3266
|
-
const
|
|
3269
|
+
}, c.readAsText(m)) : m.name.endsWith(".xlsx") || m.name.endsWith(".xls") ? (c.onload = (h) => {
|
|
3270
|
+
const p = new Uint8Array(h.target.result), y = Li.read(p, { type: "array" }), g = y.SheetNames[0], f = y.Sheets[g], v = Li.utils.sheet_to_json(f);
|
|
3267
3271
|
e(
|
|
3268
3272
|
n,
|
|
3269
|
-
(o === "dataGrid" ? xi : yi)(
|
|
3273
|
+
(o === "dataGrid" ? xi : yi)(v)
|
|
3270
3274
|
);
|
|
3271
|
-
},
|
|
3275
|
+
}, c.readAsArrayBuffer(m)) : xe.error("Unsupported file type. Please upload a CSV or Excel file.");
|
|
3272
3276
|
},
|
|
3273
3277
|
className: "mb-4 field-control file:bg-gray-600 file:text-white file:text-sm file:rounded file:border-gray-600 file:outline-none"
|
|
3274
3278
|
}
|
|
@@ -3356,24 +3360,24 @@ function xo({
|
|
|
3356
3360
|
id: o
|
|
3357
3361
|
}) {
|
|
3358
3362
|
const { formData: l } = ye(be), d = s("visibilityDependentFields") || [], u = ee(() => {
|
|
3359
|
-
var
|
|
3360
|
-
return (
|
|
3361
|
-
const
|
|
3362
|
-
(h) => h.id ===
|
|
3363
|
+
var r;
|
|
3364
|
+
return (r = fo(l).filter((m) => m.id !== o)) == null ? void 0 : r.map((m) => {
|
|
3365
|
+
const c = d.find(
|
|
3366
|
+
(h) => h.id === m.id
|
|
3363
3367
|
);
|
|
3364
3368
|
return {
|
|
3365
|
-
id:
|
|
3366
|
-
value:
|
|
3367
|
-
label:
|
|
3368
|
-
sectionId:
|
|
3369
|
-
fieldType: (
|
|
3370
|
-
operator: (
|
|
3371
|
-
fieldValue: (
|
|
3369
|
+
id: m.id,
|
|
3370
|
+
value: m.id,
|
|
3371
|
+
label: m.inputLabel,
|
|
3372
|
+
sectionId: m.sectionId,
|
|
3373
|
+
fieldType: (c == null ? void 0 : c.fieldType) || "text",
|
|
3374
|
+
operator: (c == null ? void 0 : c.operator) || "equals",
|
|
3375
|
+
fieldValue: (c == null ? void 0 : c.fieldValue) !== void 0 ? c.fieldValue : ""
|
|
3372
3376
|
};
|
|
3373
3377
|
});
|
|
3374
|
-
}, [l, d, o]), t = (m, c
|
|
3378
|
+
}, [l, d, o]), t = (r, m, c) => {
|
|
3375
3379
|
const h = d == null ? void 0 : d.map(
|
|
3376
|
-
(
|
|
3380
|
+
(p, y) => y === r ? { ...p, [m]: c } : p
|
|
3377
3381
|
);
|
|
3378
3382
|
n("visibilityDependentFields", h);
|
|
3379
3383
|
};
|
|
@@ -3390,14 +3394,14 @@ function xo({
|
|
|
3390
3394
|
validationData: { register: e, setValue: n, trigger: a, watch: s }
|
|
3391
3395
|
}
|
|
3392
3396
|
),
|
|
3393
|
-
d.length > 0 && /* @__PURE__ */ i("div", { className: "py-1 bg-gray-100 rounded dependent-fields", children: d == null ? void 0 : d.map((
|
|
3394
|
-
var
|
|
3397
|
+
d.length > 0 && /* @__PURE__ */ i("div", { className: "py-1 bg-gray-100 rounded dependent-fields", children: d == null ? void 0 : d.map((r, m) => {
|
|
3398
|
+
var c, h;
|
|
3395
3399
|
return /* @__PURE__ */ b("div", { className: "dependent-field", children: [
|
|
3396
3400
|
/* @__PURE__ */ i(
|
|
3397
3401
|
"input",
|
|
3398
3402
|
{
|
|
3399
3403
|
type: "text",
|
|
3400
|
-
value:
|
|
3404
|
+
value: r.label,
|
|
3401
3405
|
readOnly: !0,
|
|
3402
3406
|
disabled: !0,
|
|
3403
3407
|
className: "field-label"
|
|
@@ -3406,10 +3410,10 @@ function xo({
|
|
|
3406
3410
|
/* @__PURE__ */ i("div", { className: "field-listbox min-w-[100px]", children: /* @__PURE__ */ i(
|
|
3407
3411
|
ae,
|
|
3408
3412
|
{
|
|
3409
|
-
value:
|
|
3410
|
-
onChange: (
|
|
3413
|
+
value: r.fieldType,
|
|
3414
|
+
onChange: (p) => t(m, "fieldType", p),
|
|
3411
3415
|
children: /* @__PURE__ */ b("div", { className: "listbox-wrapper", children: [
|
|
3412
|
-
/* @__PURE__ */ i(ae.Button, { className: "listbox-button", children:
|
|
3416
|
+
/* @__PURE__ */ i(ae.Button, { className: "listbox-button", children: r.fieldType }),
|
|
3413
3417
|
/* @__PURE__ */ i(
|
|
3414
3418
|
we,
|
|
3415
3419
|
{
|
|
@@ -3422,14 +3426,14 @@ function xo({
|
|
|
3422
3426
|
{
|
|
3423
3427
|
className: "listbox-options ",
|
|
3424
3428
|
anchor: "bottom",
|
|
3425
|
-
children: di == null ? void 0 : di.map((
|
|
3429
|
+
children: di == null ? void 0 : di.map((p) => /* @__PURE__ */ i(
|
|
3426
3430
|
ae.Option,
|
|
3427
3431
|
{
|
|
3428
|
-
value:
|
|
3432
|
+
value: p,
|
|
3429
3433
|
className: "listbox-option",
|
|
3430
|
-
children:
|
|
3434
|
+
children: p
|
|
3431
3435
|
},
|
|
3432
|
-
|
|
3436
|
+
p
|
|
3433
3437
|
))
|
|
3434
3438
|
}
|
|
3435
3439
|
)
|
|
@@ -3441,10 +3445,10 @@ function xo({
|
|
|
3441
3445
|
/* @__PURE__ */ i("div", { className: "field-listbox min-w-[100px]", children: /* @__PURE__ */ i(
|
|
3442
3446
|
ae,
|
|
3443
3447
|
{
|
|
3444
|
-
value:
|
|
3445
|
-
onChange: (
|
|
3448
|
+
value: r.operator,
|
|
3449
|
+
onChange: (p) => t(m, "operator", p),
|
|
3446
3450
|
children: /* @__PURE__ */ b("div", { className: "listbox-wrapper", children: [
|
|
3447
|
-
/* @__PURE__ */ i(ae.Button, { className: "listbox-button", children:
|
|
3451
|
+
/* @__PURE__ */ i(ae.Button, { className: "listbox-button", children: r.operator.replace("_", " ") }),
|
|
3448
3452
|
/* @__PURE__ */ i(
|
|
3449
3453
|
we,
|
|
3450
3454
|
{
|
|
@@ -3457,14 +3461,14 @@ function xo({
|
|
|
3457
3461
|
{
|
|
3458
3462
|
className: "listbox-options ",
|
|
3459
3463
|
anchor: "bottom",
|
|
3460
|
-
children: (
|
|
3464
|
+
children: (c = r.fieldType === "number" ? [...zi, ...yo] : zi) == null ? void 0 : c.map((p) => /* @__PURE__ */ i(
|
|
3461
3465
|
ae.Option,
|
|
3462
3466
|
{
|
|
3463
|
-
value:
|
|
3467
|
+
value: p,
|
|
3464
3468
|
className: "listbox-option",
|
|
3465
|
-
children:
|
|
3469
|
+
children: p.replace("_", " ")
|
|
3466
3470
|
},
|
|
3467
|
-
|
|
3471
|
+
p
|
|
3468
3472
|
))
|
|
3469
3473
|
}
|
|
3470
3474
|
)
|
|
@@ -3473,22 +3477,22 @@ function xo({
|
|
|
3473
3477
|
] })
|
|
3474
3478
|
}
|
|
3475
3479
|
) }),
|
|
3476
|
-
|
|
3480
|
+
r.fieldType !== "boolean" ? /* @__PURE__ */ i(
|
|
3477
3481
|
"input",
|
|
3478
3482
|
{
|
|
3479
|
-
type:
|
|
3480
|
-
value:
|
|
3481
|
-
onChange: (
|
|
3483
|
+
type: r.fieldType,
|
|
3484
|
+
value: r.fieldValue || "",
|
|
3485
|
+
onChange: (p) => t(m, "fieldValue", p.target.value),
|
|
3482
3486
|
placeholder: "Value",
|
|
3483
3487
|
className: "field-value"
|
|
3484
3488
|
}
|
|
3485
3489
|
) : /* @__PURE__ */ i("div", { className: "field-listbox", children: /* @__PURE__ */ i(
|
|
3486
3490
|
ae,
|
|
3487
3491
|
{
|
|
3488
|
-
value: (h =
|
|
3489
|
-
onChange: (
|
|
3492
|
+
value: (h = r.fieldValue) != null ? h : "",
|
|
3493
|
+
onChange: (p) => t(m, "fieldValue", p),
|
|
3490
3494
|
children: /* @__PURE__ */ b("div", { className: "listbox-wrapper", children: [
|
|
3491
|
-
/* @__PURE__ */ i(ae.Button, { className: "listbox-button", children:
|
|
3495
|
+
/* @__PURE__ */ i(ae.Button, { className: "listbox-button", children: r.fieldValue === !0 ? "True" : r.fieldValue === !1 ? "False" : "Select value" }),
|
|
3492
3496
|
/* @__PURE__ */ i(
|
|
3493
3497
|
we,
|
|
3494
3498
|
{
|
|
@@ -3526,7 +3530,7 @@ function xo({
|
|
|
3526
3530
|
] })
|
|
3527
3531
|
}
|
|
3528
3532
|
) })
|
|
3529
|
-
] },
|
|
3533
|
+
] }, r.id);
|
|
3530
3534
|
}) })
|
|
3531
3535
|
] });
|
|
3532
3536
|
}
|
|
@@ -3551,31 +3555,31 @@ function Ao({
|
|
|
3551
3555
|
fields: a,
|
|
3552
3556
|
placeholder: s
|
|
3553
3557
|
}) {
|
|
3554
|
-
const [o, l] = D(() => Ji(e)), [d, u] = D(null), [t,
|
|
3558
|
+
const [o, l] = D(() => Ji(e)), [d, u] = D(null), [t, r] = D(!1), [m, c] = D(""), [h, p] = D(null), y = re(null), g = re(null), f = re(/* @__PURE__ */ new Map());
|
|
3555
3559
|
G(() => {
|
|
3556
3560
|
const S = Ji(e);
|
|
3557
3561
|
l(S);
|
|
3558
3562
|
}, []);
|
|
3559
|
-
const
|
|
3563
|
+
const v = Y(
|
|
3560
3564
|
(S) => {
|
|
3561
3565
|
n(So(S));
|
|
3562
3566
|
},
|
|
3563
3567
|
[n]
|
|
3564
3568
|
), N = (S, T) => {
|
|
3565
3569
|
const I = [...o];
|
|
3566
|
-
I[S] = { type: "operator", value: T }, l(I),
|
|
3570
|
+
I[S] = { type: "operator", value: T }, l(I), v(I);
|
|
3567
3571
|
}, A = (S) => {
|
|
3568
3572
|
const T = o.filter((I, E) => E !== S);
|
|
3569
|
-
l(T),
|
|
3573
|
+
l(T), v(T);
|
|
3570
3574
|
}, k = (S) => {
|
|
3571
|
-
|
|
3575
|
+
p(S), c(""), r(!0);
|
|
3572
3576
|
}, x = (S, T) => {
|
|
3573
3577
|
const I = T !== void 0 ? T : h != null ? h : o.length, E = [...o], F = E.slice(0, I), Z = E.slice(I), ie = [
|
|
3574
3578
|
...F,
|
|
3575
3579
|
{ type: "field", id: S.id, display: S.display },
|
|
3576
3580
|
...Z
|
|
3577
3581
|
], X = C(ie);
|
|
3578
|
-
l(X),
|
|
3582
|
+
l(X), v(X), r(!1), p(null);
|
|
3579
3583
|
};
|
|
3580
3584
|
function C(S) {
|
|
3581
3585
|
const T = [];
|
|
@@ -3586,11 +3590,11 @@ function Ao({
|
|
|
3586
3590
|
return T;
|
|
3587
3591
|
}
|
|
3588
3592
|
const M = a.filter(
|
|
3589
|
-
(S) => S.display.toLowerCase().includes(
|
|
3593
|
+
(S) => S.display.toLowerCase().includes(m.toLowerCase())
|
|
3590
3594
|
), w = o.every(
|
|
3591
3595
|
(S) => S.type === "operator" && S.value.trim() === ""
|
|
3592
3596
|
);
|
|
3593
|
-
return /* @__PURE__ */ b("div", { className: "relative", ref:
|
|
3597
|
+
return /* @__PURE__ */ b("div", { className: "relative", ref: g, children: [
|
|
3594
3598
|
/* @__PURE__ */ b(
|
|
3595
3599
|
"div",
|
|
3596
3600
|
{
|
|
@@ -3601,7 +3605,7 @@ function Ao({
|
|
|
3601
3605
|
const S = [...o].reverse().findIndex((I) => I.type === "operator");
|
|
3602
3606
|
if (S !== -1) {
|
|
3603
3607
|
const I = o.length - 1 - S;
|
|
3604
|
-
(T =
|
|
3608
|
+
(T = f.current.get(I)) == null || T.focus();
|
|
3605
3609
|
}
|
|
3606
3610
|
},
|
|
3607
3611
|
children: [
|
|
@@ -3631,7 +3635,7 @@ function Ao({
|
|
|
3631
3635
|
"input",
|
|
3632
3636
|
{
|
|
3633
3637
|
ref: (I) => {
|
|
3634
|
-
I ?
|
|
3638
|
+
I ? f.current.set(T, I) : f.current.delete(T);
|
|
3635
3639
|
},
|
|
3636
3640
|
type: "text",
|
|
3637
3641
|
value: S.value,
|
|
@@ -3673,7 +3677,7 @@ function Ao({
|
|
|
3673
3677
|
"div",
|
|
3674
3678
|
{
|
|
3675
3679
|
className: "fixed inset-0 z-40",
|
|
3676
|
-
onMouseDown: () =>
|
|
3680
|
+
onMouseDown: () => r(!1)
|
|
3677
3681
|
}
|
|
3678
3682
|
),
|
|
3679
3683
|
/* @__PURE__ */ b(
|
|
@@ -3689,11 +3693,11 @@ function Ao({
|
|
|
3689
3693
|
autoFocus: !0,
|
|
3690
3694
|
type: "text",
|
|
3691
3695
|
placeholder: "Search fields...",
|
|
3692
|
-
value:
|
|
3693
|
-
onChange: (S) =>
|
|
3696
|
+
value: m,
|
|
3697
|
+
onChange: (S) => c(S.target.value),
|
|
3694
3698
|
className: "w-full text-sm px-2 py-1 border border-gray-200 rounded outline-none focus:border-blue-300",
|
|
3695
3699
|
onKeyDown: (S) => {
|
|
3696
|
-
S.key === "Escape" &&
|
|
3700
|
+
S.key === "Escape" && r(!1), S.key === "Enter" && M.length > 0 && x(M[0]);
|
|
3697
3701
|
}
|
|
3698
3702
|
}
|
|
3699
3703
|
) }),
|
|
@@ -3821,7 +3825,7 @@ const No = R.object().shape({
|
|
|
3821
3825
|
var O;
|
|
3822
3826
|
const s = Co.filter(
|
|
3823
3827
|
(B) => !We.includes(a.inputType) || B.key !== "validation"
|
|
3824
|
-
), { updateElement: o, formData: l } = se.useContext(be), [d, u] = D("basic"), [t,
|
|
3828
|
+
), { updateElement: o, formData: l } = se.useContext(be), [d, u] = D("basic"), [t, r] = D(!1), [m, c] = D("manual"), h = ((O = l == null ? void 0 : l.flatMap((B) => (B == null ? void 0 : B.questionData) || [])) == null ? void 0 : O.length) || 0, p = se.useMemo(() => (l == null ? void 0 : l.flatMap((B) => (B == null ? void 0 : B.questionData) || []).filter(
|
|
3825
3829
|
(B) => {
|
|
3826
3830
|
var K;
|
|
3827
3831
|
return B.id !== (a == null ? void 0 : a.id) && !["spacer", "divider", "section", "grid"].includes(
|
|
@@ -3832,9 +3836,9 @@ const No = R.object().shape({
|
|
|
3832
3836
|
id: B.id,
|
|
3833
3837
|
display: B.inputLabel || B.label || "Unnamed"
|
|
3834
3838
|
}))) || [], [h, a == null ? void 0 : a.id]), y = de("config"), {
|
|
3835
|
-
register:
|
|
3836
|
-
handleSubmit:
|
|
3837
|
-
control:
|
|
3839
|
+
register: g,
|
|
3840
|
+
handleSubmit: f,
|
|
3841
|
+
control: v,
|
|
3838
3842
|
setValue: N,
|
|
3839
3843
|
watch: A,
|
|
3840
3844
|
trigger: k,
|
|
@@ -3847,21 +3851,21 @@ const No = R.object().shape({
|
|
|
3847
3851
|
options: a.options || []
|
|
3848
3852
|
}
|
|
3849
3853
|
}), S = A(), { fields: T, append: I, remove: E } = ni({
|
|
3850
|
-
control:
|
|
3854
|
+
control: v,
|
|
3851
3855
|
name: "options"
|
|
3852
3856
|
}), {
|
|
3853
3857
|
fields: F,
|
|
3854
3858
|
append: Z,
|
|
3855
3859
|
remove: ie
|
|
3856
3860
|
} = ni({
|
|
3857
|
-
control:
|
|
3861
|
+
control: v,
|
|
3858
3862
|
name: "options1"
|
|
3859
3863
|
}), {
|
|
3860
3864
|
fields: X,
|
|
3861
3865
|
append: he,
|
|
3862
3866
|
remove: _
|
|
3863
3867
|
} = ni({
|
|
3864
|
-
control:
|
|
3868
|
+
control: v,
|
|
3865
3869
|
name: "dataColumns"
|
|
3866
3870
|
});
|
|
3867
3871
|
G(() => {
|
|
@@ -3880,7 +3884,7 @@ const No = R.object().shape({
|
|
|
3880
3884
|
return;
|
|
3881
3885
|
}
|
|
3882
3886
|
try {
|
|
3883
|
-
|
|
3887
|
+
r(!0);
|
|
3884
3888
|
const { status: L, data: U } = await Pe.get(S.apiUrl, Se);
|
|
3885
3889
|
if (L !== 200 || !U) {
|
|
3886
3890
|
xe.error("Unexpected response from server.");
|
|
@@ -3896,11 +3900,11 @@ const No = R.object().shape({
|
|
|
3896
3900
|
const U = ((P = (K = L == null ? void 0 : L.response) == null ? void 0 : K.data) == null ? void 0 : P.message) || (L == null ? void 0 : L.message) || "Unable to load options";
|
|
3897
3901
|
xe.error(U);
|
|
3898
3902
|
} finally {
|
|
3899
|
-
|
|
3903
|
+
r(!1);
|
|
3900
3904
|
}
|
|
3901
3905
|
}, [a.type, N, S.apiUrl]), ue = ["manual", "api", "sheet"];
|
|
3902
3906
|
function Ae() {
|
|
3903
|
-
|
|
3907
|
+
m === "api" && ge();
|
|
3904
3908
|
}
|
|
3905
3909
|
const ke = () => {
|
|
3906
3910
|
var B, K;
|
|
@@ -3911,7 +3915,7 @@ const No = R.object().shape({
|
|
|
3911
3915
|
{
|
|
3912
3916
|
type: "radio",
|
|
3913
3917
|
name: "optionType",
|
|
3914
|
-
onChange: (L) =>
|
|
3918
|
+
onChange: (L) => c(L.target.value),
|
|
3915
3919
|
value: P
|
|
3916
3920
|
}
|
|
3917
3921
|
),
|
|
@@ -3921,7 +3925,7 @@ const No = R.object().shape({
|
|
|
3921
3925
|
" options"
|
|
3922
3926
|
] })
|
|
3923
3927
|
] }, P)) }),
|
|
3924
|
-
|
|
3928
|
+
m === "api" && /* @__PURE__ */ b("div", { className: "mb-4", children: [
|
|
3925
3929
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-x-2", children: [
|
|
3926
3930
|
/* @__PURE__ */ b("div", { className: "relative flex items-center w-full mb-2", children: [
|
|
3927
3931
|
/* @__PURE__ */ i(
|
|
@@ -3931,7 +3935,7 @@ const No = R.object().shape({
|
|
|
3931
3935
|
label: "Load Options from Api",
|
|
3932
3936
|
name: "apiUrl",
|
|
3933
3937
|
errors: x,
|
|
3934
|
-
register:
|
|
3938
|
+
register: g,
|
|
3935
3939
|
className: "!w-full",
|
|
3936
3940
|
placeholder: "https://example.com/options",
|
|
3937
3941
|
isFloating: !0
|
|
@@ -3951,7 +3955,7 @@ const No = R.object().shape({
|
|
|
3951
3955
|
] }),
|
|
3952
3956
|
/* @__PURE__ */ i(vo, {})
|
|
3953
3957
|
] }),
|
|
3954
|
-
|
|
3958
|
+
m === "sheet" && /* @__PURE__ */ i("div", { className: "mb-4", children: /* @__PURE__ */ i(
|
|
3955
3959
|
Wi,
|
|
3956
3960
|
{
|
|
3957
3961
|
type: a.type,
|
|
@@ -3973,7 +3977,7 @@ const No = R.object().shape({
|
|
|
3973
3977
|
watch: A,
|
|
3974
3978
|
label: L === 0 ? "Label" : "",
|
|
3975
3979
|
name: `options.${L}.label`,
|
|
3976
|
-
register:
|
|
3980
|
+
register: g,
|
|
3977
3981
|
errors: x,
|
|
3978
3982
|
element: a,
|
|
3979
3983
|
placeholder: "Label",
|
|
@@ -3992,7 +3996,7 @@ const No = R.object().shape({
|
|
|
3992
3996
|
watch: A,
|
|
3993
3997
|
label: L === 0 ? "Value" : "",
|
|
3994
3998
|
name: `options.${L}.value`,
|
|
3995
|
-
register:
|
|
3999
|
+
register: g,
|
|
3996
4000
|
errors: x,
|
|
3997
4001
|
element: a,
|
|
3998
4002
|
placeholder: "Value"
|
|
@@ -4045,7 +4049,7 @@ const No = R.object().shape({
|
|
|
4045
4049
|
watch: A,
|
|
4046
4050
|
label: L === 0 ? "Label" : "",
|
|
4047
4051
|
name: `options1.${L}.label`,
|
|
4048
|
-
register:
|
|
4052
|
+
register: g,
|
|
4049
4053
|
errors: x,
|
|
4050
4054
|
element: a,
|
|
4051
4055
|
placeholder: "Label",
|
|
@@ -4064,7 +4068,7 @@ const No = R.object().shape({
|
|
|
4064
4068
|
watch: A,
|
|
4065
4069
|
label: L === 0 ? "Value" : "",
|
|
4066
4070
|
name: `options1.${L}.value`,
|
|
4067
|
-
register:
|
|
4071
|
+
register: g,
|
|
4068
4072
|
errors: x,
|
|
4069
4073
|
element: a,
|
|
4070
4074
|
placeholder: "Value"
|
|
@@ -4076,7 +4080,7 @@ const No = R.object().shape({
|
|
|
4076
4080
|
watch: A,
|
|
4077
4081
|
label: L === 0 ? "Key" : "",
|
|
4078
4082
|
name: `options1.${L}.key`,
|
|
4079
|
-
register:
|
|
4083
|
+
register: g,
|
|
4080
4084
|
errors: x,
|
|
4081
4085
|
element: a,
|
|
4082
4086
|
placeholder: "Key"
|
|
@@ -4121,9 +4125,9 @@ const No = R.object().shape({
|
|
|
4121
4125
|
{
|
|
4122
4126
|
type: "radio",
|
|
4123
4127
|
name: "optionType",
|
|
4124
|
-
onChange: (K) =>
|
|
4128
|
+
onChange: (K) => c(K.target.value),
|
|
4125
4129
|
value: B,
|
|
4126
|
-
checked: B ===
|
|
4130
|
+
checked: B === m
|
|
4127
4131
|
}
|
|
4128
4132
|
),
|
|
4129
4133
|
" ",
|
|
@@ -4132,7 +4136,7 @@ const No = R.object().shape({
|
|
|
4132
4136
|
" options"
|
|
4133
4137
|
] })
|
|
4134
4138
|
] }, B)) }),
|
|
4135
|
-
|
|
4139
|
+
m === "api" && /* @__PURE__ */ b("div", { className: "mb-4", children: [
|
|
4136
4140
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-x-2", children: [
|
|
4137
4141
|
/* @__PURE__ */ b("div", { className: "relative flex items-center w-full mb-2", children: [
|
|
4138
4142
|
/* @__PURE__ */ i(
|
|
@@ -4142,7 +4146,7 @@ const No = R.object().shape({
|
|
|
4142
4146
|
label: "Load Columns from Api",
|
|
4143
4147
|
name: "apiUrl",
|
|
4144
4148
|
errors: x,
|
|
4145
|
-
register:
|
|
4149
|
+
register: g,
|
|
4146
4150
|
className: "!w-full",
|
|
4147
4151
|
placeholder: "https://example.com/columns"
|
|
4148
4152
|
}
|
|
@@ -4162,7 +4166,7 @@ const No = R.object().shape({
|
|
|
4162
4166
|
] }),
|
|
4163
4167
|
/* @__PURE__ */ i(po, {})
|
|
4164
4168
|
] }),
|
|
4165
|
-
|
|
4169
|
+
m === "sheet" && /* @__PURE__ */ i("div", { className: "mb-4", children: /* @__PURE__ */ i(
|
|
4166
4170
|
Wi,
|
|
4167
4171
|
{
|
|
4168
4172
|
type: a.type,
|
|
@@ -4201,7 +4205,7 @@ const No = R.object().shape({
|
|
|
4201
4205
|
value: "select"
|
|
4202
4206
|
}
|
|
4203
4207
|
],
|
|
4204
|
-
register:
|
|
4208
|
+
register: g,
|
|
4205
4209
|
name: `dataColumns.${K}.type`,
|
|
4206
4210
|
setValue: N,
|
|
4207
4211
|
trigger: k,
|
|
@@ -4214,7 +4218,7 @@ const No = R.object().shape({
|
|
|
4214
4218
|
watch: A,
|
|
4215
4219
|
label: K === 0 ? "Display header" : "",
|
|
4216
4220
|
name: `dataColumns.${K}.headerName`,
|
|
4217
|
-
register:
|
|
4221
|
+
register: g,
|
|
4218
4222
|
onChange: (U) => {
|
|
4219
4223
|
const j = U.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
|
|
4220
4224
|
N(`dataColumns.${K}.field`, j, {
|
|
@@ -4233,7 +4237,7 @@ const No = R.object().shape({
|
|
|
4233
4237
|
watch: A,
|
|
4234
4238
|
label: K === 0 ? "Field key" : "",
|
|
4235
4239
|
name: `dataColumns.${K}.field`,
|
|
4236
|
-
register:
|
|
4240
|
+
register: g,
|
|
4237
4241
|
errors: x,
|
|
4238
4242
|
element: a,
|
|
4239
4243
|
placeholder: "fieldKey",
|
|
@@ -4257,7 +4261,7 @@ const No = R.object().shape({
|
|
|
4257
4261
|
watch: A,
|
|
4258
4262
|
label: "Options API URL",
|
|
4259
4263
|
name: `dataColumns.${K}.optionsUrl`,
|
|
4260
|
-
register:
|
|
4264
|
+
register: g,
|
|
4261
4265
|
errors: x,
|
|
4262
4266
|
element: a,
|
|
4263
4267
|
placeholder: "https://api.example.com/options"
|
|
@@ -4332,7 +4336,7 @@ const No = R.object().shape({
|
|
|
4332
4336
|
/* @__PURE__ */ b(
|
|
4333
4337
|
"form",
|
|
4334
4338
|
{
|
|
4335
|
-
onSubmit:
|
|
4339
|
+
onSubmit: f(V),
|
|
4336
4340
|
className: "w-full flex-1 flex flex-col",
|
|
4337
4341
|
children: [
|
|
4338
4342
|
/* @__PURE__ */ b("div", { className: "flex-1", children: [
|
|
@@ -4345,7 +4349,7 @@ const No = R.object().shape({
|
|
|
4345
4349
|
watch: A,
|
|
4346
4350
|
label: "Value",
|
|
4347
4351
|
name: "value",
|
|
4348
|
-
register:
|
|
4352
|
+
register: g,
|
|
4349
4353
|
errors: x,
|
|
4350
4354
|
element: a
|
|
4351
4355
|
}
|
|
@@ -4357,7 +4361,7 @@ const No = R.object().shape({
|
|
|
4357
4361
|
watch: A,
|
|
4358
4362
|
label: "Label",
|
|
4359
4363
|
name: "inputLabel",
|
|
4360
|
-
register:
|
|
4364
|
+
register: g,
|
|
4361
4365
|
errors: x,
|
|
4362
4366
|
element: a
|
|
4363
4367
|
}
|
|
@@ -4369,7 +4373,7 @@ const No = R.object().shape({
|
|
|
4369
4373
|
watch: A,
|
|
4370
4374
|
label: "Child Label",
|
|
4371
4375
|
name: "childLabel",
|
|
4372
|
-
register:
|
|
4376
|
+
register: g,
|
|
4373
4377
|
errors: x,
|
|
4374
4378
|
element: a
|
|
4375
4379
|
}
|
|
@@ -4381,7 +4385,7 @@ const No = R.object().shape({
|
|
|
4381
4385
|
watch: A,
|
|
4382
4386
|
label: "Placeholder",
|
|
4383
4387
|
name: "placeholder",
|
|
4384
|
-
register:
|
|
4388
|
+
register: g,
|
|
4385
4389
|
errors: x,
|
|
4386
4390
|
element: a
|
|
4387
4391
|
}
|
|
@@ -4392,7 +4396,7 @@ const No = R.object().shape({
|
|
|
4392
4396
|
watch: A,
|
|
4393
4397
|
label: "Prefix",
|
|
4394
4398
|
name: "prefix",
|
|
4395
|
-
register:
|
|
4399
|
+
register: g,
|
|
4396
4400
|
errors: x,
|
|
4397
4401
|
element: a
|
|
4398
4402
|
}
|
|
@@ -4405,7 +4409,7 @@ const No = R.object().shape({
|
|
|
4405
4409
|
watch: A,
|
|
4406
4410
|
label: "Api Url",
|
|
4407
4411
|
name: "url",
|
|
4408
|
-
register:
|
|
4412
|
+
register: g,
|
|
4409
4413
|
errors: x,
|
|
4410
4414
|
element: a
|
|
4411
4415
|
}
|
|
@@ -4424,7 +4428,7 @@ const No = R.object().shape({
|
|
|
4424
4428
|
value: "POST"
|
|
4425
4429
|
}
|
|
4426
4430
|
],
|
|
4427
|
-
register:
|
|
4431
|
+
register: g,
|
|
4428
4432
|
name: "method",
|
|
4429
4433
|
setValue: N,
|
|
4430
4434
|
trigger: k,
|
|
@@ -4445,7 +4449,7 @@ const No = R.object().shape({
|
|
|
4445
4449
|
value: "object"
|
|
4446
4450
|
}
|
|
4447
4451
|
],
|
|
4448
|
-
register:
|
|
4452
|
+
register: g,
|
|
4449
4453
|
name: "responseType",
|
|
4450
4454
|
setValue: N,
|
|
4451
4455
|
trigger: k,
|
|
@@ -4468,7 +4472,7 @@ const No = R.object().shape({
|
|
|
4468
4472
|
watch: A,
|
|
4469
4473
|
label: "Short Description",
|
|
4470
4474
|
name: "description",
|
|
4471
|
-
register:
|
|
4475
|
+
register: g,
|
|
4472
4476
|
errors: x,
|
|
4473
4477
|
element: a
|
|
4474
4478
|
}
|
|
@@ -4479,7 +4483,7 @@ const No = R.object().shape({
|
|
|
4479
4483
|
{
|
|
4480
4484
|
label: "Date Format",
|
|
4481
4485
|
options: no,
|
|
4482
|
-
register:
|
|
4486
|
+
register: g,
|
|
4483
4487
|
name: "dateFormat",
|
|
4484
4488
|
setValue: N,
|
|
4485
4489
|
trigger: k,
|
|
@@ -4492,7 +4496,7 @@ const No = R.object().shape({
|
|
|
4492
4496
|
watch: A,
|
|
4493
4497
|
label: "Allow Range",
|
|
4494
4498
|
name: "canHaveDateRange",
|
|
4495
|
-
register:
|
|
4499
|
+
register: g,
|
|
4496
4500
|
errors: x,
|
|
4497
4501
|
element: a,
|
|
4498
4502
|
type: "checkbox",
|
|
@@ -4526,7 +4530,7 @@ const No = R.object().shape({
|
|
|
4526
4530
|
watch: A,
|
|
4527
4531
|
label: "Allow Year Picker",
|
|
4528
4532
|
name: "allowYearPicker",
|
|
4529
|
-
register:
|
|
4533
|
+
register: g,
|
|
4530
4534
|
errors: x,
|
|
4531
4535
|
element: a,
|
|
4532
4536
|
type: "checkbox",
|
|
@@ -4540,7 +4544,7 @@ const No = R.object().shape({
|
|
|
4540
4544
|
watch: A,
|
|
4541
4545
|
label: "Allow States",
|
|
4542
4546
|
name: "showState",
|
|
4543
|
-
register:
|
|
4547
|
+
register: g,
|
|
4544
4548
|
errors: x,
|
|
4545
4549
|
element: a,
|
|
4546
4550
|
type: "checkbox",
|
|
@@ -4561,7 +4565,7 @@ const No = R.object().shape({
|
|
|
4561
4565
|
value: "Combobox"
|
|
4562
4566
|
}
|
|
4563
4567
|
],
|
|
4564
|
-
register:
|
|
4568
|
+
register: g,
|
|
4565
4569
|
name: "selectType",
|
|
4566
4570
|
setValue: N,
|
|
4567
4571
|
trigger: k,
|
|
@@ -4574,7 +4578,7 @@ const No = R.object().shape({
|
|
|
4574
4578
|
watch: A,
|
|
4575
4579
|
label: "Number of columns (max: 4)",
|
|
4576
4580
|
name: "columns",
|
|
4577
|
-
register:
|
|
4581
|
+
register: g,
|
|
4578
4582
|
errors: x,
|
|
4579
4583
|
element: a,
|
|
4580
4584
|
max: 4,
|
|
@@ -4589,7 +4593,7 @@ const No = R.object().shape({
|
|
|
4589
4593
|
watch: A,
|
|
4590
4594
|
label: "Document Options Url",
|
|
4591
4595
|
name: "url",
|
|
4592
|
-
register:
|
|
4596
|
+
register: g,
|
|
4593
4597
|
errors: x,
|
|
4594
4598
|
element: a
|
|
4595
4599
|
}
|
|
@@ -4604,7 +4608,7 @@ const No = R.object().shape({
|
|
|
4604
4608
|
watch: A,
|
|
4605
4609
|
label: "Document Validation Url",
|
|
4606
4610
|
name: "validationUrl",
|
|
4607
|
-
register:
|
|
4611
|
+
register: g,
|
|
4608
4612
|
errors: x,
|
|
4609
4613
|
element: a
|
|
4610
4614
|
}
|
|
@@ -4617,7 +4621,7 @@ const No = R.object().shape({
|
|
|
4617
4621
|
watch: A,
|
|
4618
4622
|
label: "Signature Page Url",
|
|
4619
4623
|
name: "signatureLink",
|
|
4620
|
-
register:
|
|
4624
|
+
register: g,
|
|
4621
4625
|
errors: x,
|
|
4622
4626
|
element: a
|
|
4623
4627
|
}
|
|
@@ -4631,7 +4635,7 @@ const No = R.object().shape({
|
|
|
4631
4635
|
watch: A,
|
|
4632
4636
|
label: "Allow Multiple Uploads",
|
|
4633
4637
|
name: "isMultiple",
|
|
4634
|
-
register:
|
|
4638
|
+
register: g,
|
|
4635
4639
|
errors: x,
|
|
4636
4640
|
element: a,
|
|
4637
4641
|
type: "checkbox",
|
|
@@ -4646,7 +4650,7 @@ const No = R.object().shape({
|
|
|
4646
4650
|
id: "acceptedFiles",
|
|
4647
4651
|
value: S == null ? void 0 : S.acceptedFiles
|
|
4648
4652
|
},
|
|
4649
|
-
validationData: { register:
|
|
4653
|
+
validationData: { register: g, setValue: N, trigger: k, watch: A },
|
|
4650
4654
|
placeholder: "Choose file types"
|
|
4651
4655
|
}
|
|
4652
4656
|
)
|
|
@@ -4659,7 +4663,7 @@ const No = R.object().shape({
|
|
|
4659
4663
|
watch: A,
|
|
4660
4664
|
label: "Toggle Visibility",
|
|
4661
4665
|
name: "isHidden",
|
|
4662
|
-
register:
|
|
4666
|
+
register: g,
|
|
4663
4667
|
errors: x,
|
|
4664
4668
|
element: a,
|
|
4665
4669
|
type: "checkbox",
|
|
@@ -4670,7 +4674,7 @@ const No = R.object().shape({
|
|
|
4670
4674
|
S.isHidden && /* @__PURE__ */ i(
|
|
4671
4675
|
xo,
|
|
4672
4676
|
{
|
|
4673
|
-
register:
|
|
4677
|
+
register: g,
|
|
4674
4678
|
setValue: N,
|
|
4675
4679
|
trigger: k,
|
|
4676
4680
|
watch: A,
|
|
@@ -4688,7 +4692,7 @@ const No = R.object().shape({
|
|
|
4688
4692
|
shouldValidate: !0,
|
|
4689
4693
|
shouldDirty: !0
|
|
4690
4694
|
}),
|
|
4691
|
-
fields:
|
|
4695
|
+
fields: p,
|
|
4692
4696
|
placeholder: "Build your formula..."
|
|
4693
4697
|
}
|
|
4694
4698
|
)
|
|
@@ -4700,7 +4704,7 @@ const No = R.object().shape({
|
|
|
4700
4704
|
watch: A,
|
|
4701
4705
|
label: "Fetch results from external API",
|
|
4702
4706
|
name: "fetchExternalResults",
|
|
4703
|
-
register:
|
|
4707
|
+
register: g,
|
|
4704
4708
|
errors: x,
|
|
4705
4709
|
element: a,
|
|
4706
4710
|
type: "checkbox",
|
|
@@ -4713,7 +4717,7 @@ const No = R.object().shape({
|
|
|
4713
4717
|
watch: A,
|
|
4714
4718
|
label: "External API URL (returns options results)",
|
|
4715
4719
|
name: "externalApiUrl",
|
|
4716
|
-
register:
|
|
4720
|
+
register: g,
|
|
4717
4721
|
errors: x,
|
|
4718
4722
|
element: a,
|
|
4719
4723
|
placeholder: "https://api.example.com/poll/results"
|
|
@@ -4729,7 +4733,7 @@ const No = R.object().shape({
|
|
|
4729
4733
|
watch: A,
|
|
4730
4734
|
label: "Required",
|
|
4731
4735
|
name: "isRequired",
|
|
4732
|
-
register:
|
|
4736
|
+
register: g,
|
|
4733
4737
|
errors: x,
|
|
4734
4738
|
element: a,
|
|
4735
4739
|
type: "checkbox",
|
|
@@ -4743,7 +4747,7 @@ const No = R.object().shape({
|
|
|
4743
4747
|
watch: A,
|
|
4744
4748
|
label: "Error message text",
|
|
4745
4749
|
name: "requiredMessage",
|
|
4746
|
-
register:
|
|
4750
|
+
register: g,
|
|
4747
4751
|
errors: x,
|
|
4748
4752
|
element: a
|
|
4749
4753
|
}
|
|
@@ -4757,7 +4761,7 @@ const No = R.object().shape({
|
|
|
4757
4761
|
watch: A,
|
|
4758
4762
|
label: "Min Length",
|
|
4759
4763
|
name: "minLength",
|
|
4760
|
-
register:
|
|
4764
|
+
register: g,
|
|
4761
4765
|
errors: x,
|
|
4762
4766
|
element: a,
|
|
4763
4767
|
type: "number"
|
|
@@ -4770,7 +4774,7 @@ const No = R.object().shape({
|
|
|
4770
4774
|
watch: A,
|
|
4771
4775
|
label: "Error message text",
|
|
4772
4776
|
name: "minLengthMessage",
|
|
4773
|
-
register:
|
|
4777
|
+
register: g,
|
|
4774
4778
|
errors: x,
|
|
4775
4779
|
element: a
|
|
4776
4780
|
}
|
|
@@ -4783,7 +4787,7 @@ const No = R.object().shape({
|
|
|
4783
4787
|
watch: A,
|
|
4784
4788
|
label: "Max Length",
|
|
4785
4789
|
name: "maxLength",
|
|
4786
|
-
register:
|
|
4790
|
+
register: g,
|
|
4787
4791
|
errors: x,
|
|
4788
4792
|
element: a,
|
|
4789
4793
|
type: "number"
|
|
@@ -4796,7 +4800,7 @@ const No = R.object().shape({
|
|
|
4796
4800
|
watch: A,
|
|
4797
4801
|
label: "Error message text",
|
|
4798
4802
|
name: "maxLengthMessage",
|
|
4799
|
-
register:
|
|
4803
|
+
register: g,
|
|
4800
4804
|
errors: x,
|
|
4801
4805
|
element: a
|
|
4802
4806
|
}
|
|
@@ -4811,7 +4815,7 @@ const No = R.object().shape({
|
|
|
4811
4815
|
watch: A,
|
|
4812
4816
|
label: "Min Amount",
|
|
4813
4817
|
name: "minAmount",
|
|
4814
|
-
register:
|
|
4818
|
+
register: g,
|
|
4815
4819
|
errors: x,
|
|
4816
4820
|
element: a,
|
|
4817
4821
|
type: "amount"
|
|
@@ -4824,7 +4828,7 @@ const No = R.object().shape({
|
|
|
4824
4828
|
watch: A,
|
|
4825
4829
|
label: "Error message text",
|
|
4826
4830
|
name: "minAmountMessage",
|
|
4827
|
-
register:
|
|
4831
|
+
register: g,
|
|
4828
4832
|
errors: x,
|
|
4829
4833
|
element: a
|
|
4830
4834
|
}
|
|
@@ -4837,7 +4841,7 @@ const No = R.object().shape({
|
|
|
4837
4841
|
watch: A,
|
|
4838
4842
|
label: "Max Amount",
|
|
4839
4843
|
name: "maxAmount",
|
|
4840
|
-
register:
|
|
4844
|
+
register: g,
|
|
4841
4845
|
errors: x,
|
|
4842
4846
|
element: a,
|
|
4843
4847
|
type: "amount"
|
|
@@ -4850,7 +4854,7 @@ const No = R.object().shape({
|
|
|
4850
4854
|
watch: A,
|
|
4851
4855
|
label: "Error message text",
|
|
4852
4856
|
name: "maxAmountMessage",
|
|
4853
|
-
register:
|
|
4857
|
+
register: g,
|
|
4854
4858
|
errors: x,
|
|
4855
4859
|
element: a
|
|
4856
4860
|
}
|
|
@@ -4890,14 +4894,14 @@ const No = R.object().shape({
|
|
|
4890
4894
|
return document.body ? wn(Ee, document.body) : Ee;
|
|
4891
4895
|
}, Ti = Ze(
|
|
4892
4896
|
({ state: e, element: n, children: a }) => {
|
|
4893
|
-
var
|
|
4897
|
+
var m, c;
|
|
4894
4898
|
const [s, o] = D(!1), { removeElement: l, duplicateElement: d, updateElement: u } = se.useContext(be), t = ee(
|
|
4895
4899
|
() => {
|
|
4896
4900
|
var h;
|
|
4897
|
-
return (h = n == null ? void 0 : n.acceptedFiles) == null ? void 0 : h.map((
|
|
4901
|
+
return (h = n == null ? void 0 : n.acceptedFiles) == null ? void 0 : h.map((p) => p.label).join(", ");
|
|
4898
4902
|
},
|
|
4899
4903
|
[n]
|
|
4900
|
-
),
|
|
4904
|
+
), r = Y(() => {
|
|
4901
4905
|
l(n.id, n.sectionId);
|
|
4902
4906
|
}, [n.id, n.sectionId, l]);
|
|
4903
4907
|
return /* @__PURE__ */ b("div", { className: "w-full min-w-0", children: [
|
|
@@ -4923,7 +4927,7 @@ const No = R.object().shape({
|
|
|
4923
4927
|
] })
|
|
4924
4928
|
] }),
|
|
4925
4929
|
e === "edit" && /* @__PURE__ */ b("span", { className: "flex items-center gap-x-3", children: [
|
|
4926
|
-
((
|
|
4930
|
+
((m = n.type) == null ? void 0 : m.toLowerCase()) !== "spacer" && ((c = n.type) == null ? void 0 : c.toLowerCase()) !== "divider" && /* @__PURE__ */ b("label", { className: "flex items-center gap-1 text-xs cursor-pointer text-gray-500 mr-2 hover:text-gray-700 select-none", children: [
|
|
4927
4931
|
/* @__PURE__ */ i(
|
|
4928
4932
|
"input",
|
|
4929
4933
|
{
|
|
@@ -4963,7 +4967,7 @@ const No = R.object().shape({
|
|
|
4963
4967
|
{
|
|
4964
4968
|
type: "button",
|
|
4965
4969
|
className: "text-sm outline-none hover:opacity-80 text-gray-600 py-1",
|
|
4966
|
-
onClick:
|
|
4970
|
+
onClick: r,
|
|
4967
4971
|
title: "Remove",
|
|
4968
4972
|
children: /* @__PURE__ */ i(J, { icon: "iconamoon:trash", iconClass: "text-base" })
|
|
4969
4973
|
}
|
|
@@ -5102,47 +5106,47 @@ function Bo({
|
|
|
5102
5106
|
validationData: n
|
|
5103
5107
|
}) {
|
|
5104
5108
|
var C;
|
|
5105
|
-
const { register: a = () => ({}), setValue: s, watch: o } = n || {}, [l, d] = D(), [u, t] = D(!1), [
|
|
5109
|
+
const { register: a = () => ({}), setValue: s, watch: o } = n || {}, [l, d] = D(), [u, t] = D(!1), [r, m] = D(!1), [c, h] = D(""), p = o && o(e == null ? void 0 : e.id);
|
|
5106
5110
|
G(() => {
|
|
5107
|
-
d(
|
|
5108
|
-
}, [
|
|
5109
|
-
const [y,
|
|
5111
|
+
d(p);
|
|
5112
|
+
}, [p]);
|
|
5113
|
+
const [y, g] = D("");
|
|
5110
5114
|
G(() => {
|
|
5111
5115
|
a(e.id);
|
|
5112
5116
|
}, [e.id, a]);
|
|
5113
|
-
const { url:
|
|
5117
|
+
const { url: f, method: v, responseType: N } = e || {}, k = {
|
|
5114
5118
|
headers: {
|
|
5115
5119
|
Authorization: `Bearer ${de("token")}`
|
|
5116
5120
|
}
|
|
5117
5121
|
}, x = Y(
|
|
5118
5122
|
async (M) => {
|
|
5119
5123
|
var w, S, T, I, E, F, Z, ie, X, he, _;
|
|
5120
|
-
if (!(!
|
|
5124
|
+
if (!(!f || !v)) {
|
|
5121
5125
|
t(!0);
|
|
5122
5126
|
try {
|
|
5123
5127
|
let V;
|
|
5124
|
-
if (
|
|
5125
|
-
const ce = `${
|
|
5128
|
+
if (v.toLowerCase() === "get") {
|
|
5129
|
+
const ce = `${f}?value=${M}`;
|
|
5126
5130
|
V = await Pe.get(ce, k);
|
|
5127
|
-
} else if (
|
|
5128
|
-
V = await Pe.post(
|
|
5131
|
+
} else if (v.toLowerCase() === "post")
|
|
5132
|
+
V = await Pe.post(f, { value: M }, k);
|
|
5129
5133
|
else
|
|
5130
5134
|
throw new Error("Unsupported HTTP method");
|
|
5131
|
-
V.status === 200 && ((((S = (w = V == null ? void 0 : V.data) == null ? void 0 : w.data) == null ? void 0 : S.status) || ((T = V == null ? void 0 : V.data) == null ? void 0 : T.status)) === !0 ? (
|
|
5135
|
+
V.status === 200 && ((((S = (w = V == null ? void 0 : V.data) == null ? void 0 : w.data) == null ? void 0 : S.status) || ((T = V == null ? void 0 : V.data) == null ? void 0 : T.status)) === !0 ? (m(!0), N === "string" ? h(
|
|
5132
5136
|
((E = (I = V == null ? void 0 : V.data) == null ? void 0 : I.data) == null ? void 0 : E.description) || ((F = V == null ? void 0 : V.data) == null ? void 0 : F.description) || "Validation successful"
|
|
5133
|
-
) :
|
|
5137
|
+
) : g(
|
|
5134
5138
|
((ie = (Z = V == null ? void 0 : V.data) == null ? void 0 : Z.data) == null ? void 0 : ie.description) || ((X = V == null ? void 0 : V.data) == null ? void 0 : X.description) || {}
|
|
5135
|
-
)) : (console.error("Invalid input:", M), h("Unable to validate input"),
|
|
5139
|
+
)) : (console.error("Invalid input:", M), h("Unable to validate input"), m(!1)));
|
|
5136
5140
|
} catch (V) {
|
|
5137
5141
|
console.error("Error validating input:", V), h(
|
|
5138
5142
|
((_ = (he = V == null ? void 0 : V.response) == null ? void 0 : he.data) == null ? void 0 : _.message) || "Unable to validate input"
|
|
5139
|
-
),
|
|
5143
|
+
), m(!1);
|
|
5140
5144
|
} finally {
|
|
5141
5145
|
t(!1);
|
|
5142
5146
|
}
|
|
5143
5147
|
}
|
|
5144
5148
|
},
|
|
5145
|
-
[
|
|
5149
|
+
[v, N, f]
|
|
5146
5150
|
);
|
|
5147
5151
|
return G(() => {
|
|
5148
5152
|
if (l) {
|
|
@@ -5200,14 +5204,14 @@ function Bo({
|
|
|
5200
5204
|
}
|
|
5201
5205
|
)
|
|
5202
5206
|
] }),
|
|
5203
|
-
|
|
5207
|
+
r && !u && /* @__PURE__ */ i("span", { className: "block pr-3 text-lg text-green-600", children: /* @__PURE__ */ i(J, { icon: "gg:check-o" }) })
|
|
5204
5208
|
] })
|
|
5205
5209
|
] }),
|
|
5206
|
-
|
|
5210
|
+
c && N === "string" && /* @__PURE__ */ i(
|
|
5207
5211
|
"span",
|
|
5208
5212
|
{
|
|
5209
|
-
className: `${
|
|
5210
|
-
children:
|
|
5213
|
+
className: `${r ? "text-green-600" : "text-red-600"} text-sm`,
|
|
5214
|
+
children: c
|
|
5211
5215
|
}
|
|
5212
5216
|
),
|
|
5213
5217
|
N === "object" && /* @__PURE__ */ i("div", { className: "grid grid-cols-2 gap-6 mt-2 text-sm text-gray-600", children: (C = Object.entries(y)) == null ? void 0 : C.map(([M, w]) => /* @__PURE__ */ b("div", { className: "flex items-center gap-x-2", children: [
|
|
@@ -5226,22 +5230,22 @@ function Eo({
|
|
|
5226
5230
|
denominators: s
|
|
5227
5231
|
}) {
|
|
5228
5232
|
const [o, l] = D([...a]);
|
|
5229
|
-
function d(
|
|
5230
|
-
l((
|
|
5231
|
-
const h = [...
|
|
5232
|
-
return h[
|
|
5233
|
-
...h[
|
|
5234
|
-
value:
|
|
5233
|
+
function d(r, m) {
|
|
5234
|
+
l((c) => {
|
|
5235
|
+
const h = [...c];
|
|
5236
|
+
return h[m] = {
|
|
5237
|
+
...h[m],
|
|
5238
|
+
value: r
|
|
5235
5239
|
}, h;
|
|
5236
5240
|
});
|
|
5237
5241
|
}
|
|
5238
|
-
function u(
|
|
5239
|
-
return parseFloat(
|
|
5242
|
+
function u(r, m) {
|
|
5243
|
+
return parseFloat(r) * parseFloat(m) || 0;
|
|
5240
5244
|
}
|
|
5241
5245
|
const t = ee(
|
|
5242
|
-
() => o.reduce((
|
|
5243
|
-
const
|
|
5244
|
-
return
|
|
5246
|
+
() => o.reduce((r, m) => {
|
|
5247
|
+
const c = u(m.key, m.value);
|
|
5248
|
+
return r + c;
|
|
5245
5249
|
}, 0),
|
|
5246
5250
|
[o]
|
|
5247
5251
|
);
|
|
@@ -5249,11 +5253,11 @@ function Eo({
|
|
|
5249
5253
|
e && e(o);
|
|
5250
5254
|
}, [o]), G(() => {
|
|
5251
5255
|
if (s != null && s.length) {
|
|
5252
|
-
const
|
|
5253
|
-
key:
|
|
5254
|
-
value: Array.isArray(a) && a[
|
|
5256
|
+
const r = s == null ? void 0 : s.map((m, c) => ({
|
|
5257
|
+
key: m.value,
|
|
5258
|
+
value: Array.isArray(a) && a[c] ? a[c].value : ""
|
|
5255
5259
|
}));
|
|
5256
|
-
l(
|
|
5260
|
+
l(r);
|
|
5257
5261
|
}
|
|
5258
5262
|
}, [a, s]), /* @__PURE__ */ i("div", { className: "mt-2", children: /* @__PURE__ */ b("div", { className: "border border-gray-200 rounded-lg overflow-hidden text-gray-700", children: [
|
|
5259
5263
|
/* @__PURE__ */ b("div", { className: "grid grid-cols-3 text-sm font-bold border-b border-gray-100 bg-gray-50", children: [
|
|
@@ -5261,30 +5265,30 @@ function Eo({
|
|
|
5261
5265
|
/* @__PURE__ */ i("div", { className: "border-r px-4 py-2", children: /* @__PURE__ */ i("span", { children: "Quantity" }) }),
|
|
5262
5266
|
/* @__PURE__ */ i("div", { className: "px-4 py-2", children: /* @__PURE__ */ i("span", { children: "Sub total" }) })
|
|
5263
5267
|
] }),
|
|
5264
|
-
o == null ? void 0 : o.map((
|
|
5265
|
-
var
|
|
5268
|
+
o == null ? void 0 : o.map((r, m) => {
|
|
5269
|
+
var c, h;
|
|
5266
5270
|
return /* @__PURE__ */ b(
|
|
5267
5271
|
"div",
|
|
5268
5272
|
{
|
|
5269
5273
|
className: "grid grid-cols-3 text-sm border-b border-gray-100",
|
|
5270
5274
|
children: [
|
|
5271
|
-
/* @__PURE__ */ i("div", { className: "border-r px-4 py-2 flex items-center", children: /* @__PURE__ */ i("span", { className: "", children: (
|
|
5275
|
+
/* @__PURE__ */ i("div", { className: "border-r px-4 py-2 flex items-center", children: /* @__PURE__ */ i("span", { className: "", children: (c = parseFloat(r.key)) == null ? void 0 : c.toLocaleString() }) }),
|
|
5272
5276
|
/* @__PURE__ */ i("div", { className: "border-r px-4 py-1", children: /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(
|
|
5273
5277
|
$e,
|
|
5274
5278
|
{
|
|
5275
5279
|
id: "input-example",
|
|
5276
5280
|
className: "border border-gray-100 rounded w-full px-3 py-1 outline-none",
|
|
5277
5281
|
decimalsLimit: 6,
|
|
5278
|
-
value:
|
|
5279
|
-
onValueChange: (
|
|
5282
|
+
value: r.value,
|
|
5283
|
+
onValueChange: (p) => d(p, m),
|
|
5280
5284
|
disabled: n,
|
|
5281
5285
|
allowNegativeValue: !1
|
|
5282
5286
|
}
|
|
5283
5287
|
) }) }),
|
|
5284
|
-
/* @__PURE__ */ i("div", { className: "px-4 py-2 flex justify-between items-center", children: /* @__PURE__ */ i("span", { children: (h = u(
|
|
5288
|
+
/* @__PURE__ */ i("div", { className: "px-4 py-2 flex justify-between items-center", children: /* @__PURE__ */ i("span", { children: (h = u(r.key, r.value)) == null ? void 0 : h.toLocaleString() }) })
|
|
5285
5289
|
]
|
|
5286
5290
|
},
|
|
5287
|
-
|
|
5291
|
+
m + "index"
|
|
5288
5292
|
);
|
|
5289
5293
|
}),
|
|
5290
5294
|
/* @__PURE__ */ b("div", { className: "grid grid-cols-3 text-sm font-bold bg-gray-50", children: [
|
|
@@ -5349,11 +5353,11 @@ function Ko({
|
|
|
5349
5353
|
}) {
|
|
5350
5354
|
return /* @__PURE__ */ b("tr", { children: [
|
|
5351
5355
|
n.map((d) => {
|
|
5352
|
-
var
|
|
5353
|
-
const u = e[d.field], t = d.editable && !a, { isValidating:
|
|
5354
|
-
let
|
|
5355
|
-
d.validate && ((
|
|
5356
|
-
const h = `w-full py-1 rounded outline-none ${
|
|
5356
|
+
var p;
|
|
5357
|
+
const u = e[d.field], t = d.editable && !a, { isValidating: r, result: m } = o(e.id, d.field);
|
|
5358
|
+
let c = "border-gray-300";
|
|
5359
|
+
d.validate && ((m == null ? void 0 : m.isValid) === !1 ? c = "border-red-500 bg-red-50" : (m == null ? void 0 : m.isValid) === !0 && (c = "border-green-500 bg-green-50"));
|
|
5360
|
+
const h = `w-full py-1 rounded outline-none ${c}`;
|
|
5357
5361
|
return /* @__PURE__ */ i(
|
|
5358
5362
|
"td",
|
|
5359
5363
|
{
|
|
@@ -5369,24 +5373,24 @@ function Ko({
|
|
|
5369
5373
|
onValueChange: (y) => s(y, e.id, d.field)
|
|
5370
5374
|
}
|
|
5371
5375
|
) : d.type === "checkbox" ? /* @__PURE__ */ i("div", { className: "flex items-center gap-x-4", children: ["yes", "no"].map((y) => {
|
|
5372
|
-
const
|
|
5376
|
+
const g = y === "yes", f = `radio-${e.id}-${String(d.field)}-${y}`;
|
|
5373
5377
|
return /* @__PURE__ */ b(
|
|
5374
5378
|
"label",
|
|
5375
5379
|
{
|
|
5376
|
-
htmlFor:
|
|
5380
|
+
htmlFor: f,
|
|
5377
5381
|
className: "flex items-center gap-1 cursor-pointer",
|
|
5378
5382
|
children: [
|
|
5379
5383
|
/* @__PURE__ */ i(
|
|
5380
5384
|
"input",
|
|
5381
5385
|
{
|
|
5382
|
-
id:
|
|
5386
|
+
id: f,
|
|
5383
5387
|
type: "radio",
|
|
5384
5388
|
name: `boolean-${e.id}-${String(d.field)}`,
|
|
5385
|
-
checked: u ===
|
|
5386
|
-
onChange: () => s(
|
|
5389
|
+
checked: u === g,
|
|
5390
|
+
onChange: () => s(g, e.id, d.field)
|
|
5387
5391
|
}
|
|
5388
5392
|
),
|
|
5389
|
-
/* @__PURE__ */ i("span", { className: "text-sm", children:
|
|
5393
|
+
/* @__PURE__ */ i("span", { className: "text-sm", children: g ? "Yes" : "No" })
|
|
5390
5394
|
]
|
|
5391
5395
|
},
|
|
5392
5396
|
y
|
|
@@ -5398,7 +5402,7 @@ function Ko({
|
|
|
5398
5402
|
options: d.options || [],
|
|
5399
5403
|
apiUrl: d.optionsUrl,
|
|
5400
5404
|
value: u,
|
|
5401
|
-
onGetValue: (y,
|
|
5405
|
+
onGetValue: (y, g) => s((g == null ? void 0 : g.value) || "", e.id, d.field),
|
|
5402
5406
|
customClass: "!border-none !p-0"
|
|
5403
5407
|
}
|
|
5404
5408
|
) : /* @__PURE__ */ i(
|
|
@@ -5410,18 +5414,18 @@ function Ko({
|
|
|
5410
5414
|
className: h
|
|
5411
5415
|
}
|
|
5412
5416
|
),
|
|
5413
|
-
|
|
5414
|
-
] }) : d.validate &&
|
|
5417
|
+
r && /* @__PURE__ */ i("div", { className: "absolute right-1 top-1", children: /* @__PURE__ */ i("div", { className: "w-4 h-4 border-2 border-blue-500 rounded-full border-t-transparent animate-spin" }) })
|
|
5418
|
+
] }) : d.validate && m ? /* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
|
|
5415
5419
|
/* @__PURE__ */ b("span", { children: [
|
|
5416
5420
|
String(u != null ? u : ""),
|
|
5417
5421
|
" ",
|
|
5418
|
-
|
|
5422
|
+
m.data && `[${m.data}]`
|
|
5419
5423
|
] }),
|
|
5420
|
-
|
|
5424
|
+
m.isValid ? /* @__PURE__ */ i("span", { className: "text-xs text-green-600", children: "✓" }) : /* @__PURE__ */ i(
|
|
5421
5425
|
"span",
|
|
5422
5426
|
{
|
|
5423
5427
|
className: "text-xs text-red-600 cursor-help",
|
|
5424
|
-
title: (
|
|
5428
|
+
title: (p = m.error) != null ? p : "",
|
|
5425
5429
|
children: "✗"
|
|
5426
5430
|
}
|
|
5427
5431
|
)
|
|
@@ -5466,23 +5470,23 @@ function Go({
|
|
|
5466
5470
|
l((h) => JSON.stringify(h) !== JSON.stringify(e) ? e : h);
|
|
5467
5471
|
}, [e]);
|
|
5468
5472
|
const t = Y(
|
|
5469
|
-
(h,
|
|
5470
|
-
const
|
|
5471
|
-
(
|
|
5473
|
+
(h, p, y) => {
|
|
5474
|
+
const g = u.current.map(
|
|
5475
|
+
(f) => f.id === p ? { ...f, [y]: h } : f
|
|
5472
5476
|
);
|
|
5473
|
-
l(
|
|
5477
|
+
l(g), n == null || n(g);
|
|
5474
5478
|
},
|
|
5475
5479
|
[n]
|
|
5476
|
-
),
|
|
5477
|
-
const h = pe(),
|
|
5480
|
+
), r = Y(() => {
|
|
5481
|
+
const h = pe(), p = s.reduce((g, f) => (g[f.field] = f.field === "id" ? h : "", g), {}), y = [...u.current, { id: h, ...p }];
|
|
5478
5482
|
l(y), n == null || n(y);
|
|
5479
|
-
}, [s, n]),
|
|
5483
|
+
}, [s, n]), m = Y(
|
|
5480
5484
|
(h) => {
|
|
5481
|
-
const
|
|
5482
|
-
l(
|
|
5485
|
+
const p = u.current.filter((y) => y.id !== h);
|
|
5486
|
+
l(p), n == null || n(p);
|
|
5483
5487
|
},
|
|
5484
5488
|
[n]
|
|
5485
|
-
),
|
|
5489
|
+
), c = Y(
|
|
5486
5490
|
() => ({
|
|
5487
5491
|
isValidating: !1,
|
|
5488
5492
|
result: void 0
|
|
@@ -5492,7 +5496,7 @@ function Go({
|
|
|
5492
5496
|
return /* @__PURE__ */ b("div", { className: "mt-3 rounded", children: [
|
|
5493
5497
|
/* @__PURE__ */ i("div", { className: "w-full max-w-full overflow-x-auto border rounded-lg", children: /* @__PURE__ */ b("table", { className: "min-w-max w-full text-sm border-collapse table-auto", children: [
|
|
5494
5498
|
/* @__PURE__ */ i("thead", { children: /* @__PURE__ */ b("tr", { className: "bg-gray-100", children: [
|
|
5495
|
-
s.map((h,
|
|
5499
|
+
s.map((h, p) => {
|
|
5496
5500
|
var y;
|
|
5497
5501
|
return /* @__PURE__ */ b(
|
|
5498
5502
|
"th",
|
|
@@ -5503,7 +5507,7 @@ function Go({
|
|
|
5503
5507
|
h.validate && /* @__PURE__ */ i("span", { className: "ml-1 text-blue-600", children: "*" })
|
|
5504
5508
|
]
|
|
5505
5509
|
},
|
|
5506
|
-
`${String(h.id)}-${
|
|
5510
|
+
`${String(h.id)}-${p}`
|
|
5507
5511
|
);
|
|
5508
5512
|
}),
|
|
5509
5513
|
!a && /* @__PURE__ */ i("th", { className: "w-10 px-2 py-2 border sticky right-0 bg-gray-100 z-10" })
|
|
@@ -5515,8 +5519,8 @@ function Go({
|
|
|
5515
5519
|
columns: s,
|
|
5516
5520
|
isReadOnly: a,
|
|
5517
5521
|
handleCellChange: t,
|
|
5518
|
-
getValidationStatus:
|
|
5519
|
-
deleteRow:
|
|
5522
|
+
getValidationStatus: c,
|
|
5523
|
+
deleteRow: m
|
|
5520
5524
|
},
|
|
5521
5525
|
h.id
|
|
5522
5526
|
)) : /* @__PURE__ */ i("tr", { children: /* @__PURE__ */ i(
|
|
@@ -5531,7 +5535,7 @@ function Go({
|
|
|
5531
5535
|
!a && /* @__PURE__ */ i("div", { className: "flex justify-center mt-2", children: /* @__PURE__ */ i(
|
|
5532
5536
|
"button",
|
|
5533
5537
|
{
|
|
5534
|
-
onClick:
|
|
5538
|
+
onClick: r,
|
|
5535
5539
|
type: "button",
|
|
5536
5540
|
style: { color: (d == null ? void 0 : d.buttonColor) || "#333" },
|
|
5537
5541
|
className: "px-2 py-1 mb-3 text-xs text-gray-600 font-medium",
|
|
@@ -5544,24 +5548,24 @@ function jo({
|
|
|
5544
5548
|
element: e,
|
|
5545
5549
|
validationData: n
|
|
5546
5550
|
}) {
|
|
5547
|
-
var
|
|
5551
|
+
var p;
|
|
5548
5552
|
const {
|
|
5549
5553
|
register: a = () => ({}),
|
|
5550
5554
|
setValue: s,
|
|
5551
5555
|
watch: o,
|
|
5552
5556
|
isReadOnly: l
|
|
5553
|
-
} = n || {}, d = o && o(e == null ? void 0 : e.id) || {}, u = Array.isArray(d) ? d : (
|
|
5557
|
+
} = n || {}, d = o && o(e == null ? void 0 : e.id) || {}, u = Array.isArray(d) ? d : (p = d == null ? void 0 : d.rows) != null ? p : [];
|
|
5554
5558
|
G(() => {
|
|
5555
5559
|
a(e.id);
|
|
5556
5560
|
}, [e.id, a]);
|
|
5557
|
-
const t = re(""),
|
|
5558
|
-
|
|
5561
|
+
const t = re(""), r = re(e == null ? void 0 : e.id), m = re(e == null ? void 0 : e.dataColumns), c = re(s);
|
|
5562
|
+
r.current = e == null ? void 0 : e.id, m.current = e == null ? void 0 : e.dataColumns, c.current = s;
|
|
5559
5563
|
const h = Y((y) => {
|
|
5560
|
-
var
|
|
5561
|
-
const
|
|
5562
|
-
|
|
5564
|
+
var f;
|
|
5565
|
+
const g = JSON.stringify(y);
|
|
5566
|
+
g !== t.current && (t.current = g, (f = c.current) == null || f.call(c, r.current, {
|
|
5563
5567
|
rows: y,
|
|
5564
|
-
columns:
|
|
5568
|
+
columns: m.current
|
|
5565
5569
|
}));
|
|
5566
5570
|
}, []);
|
|
5567
5571
|
return /* @__PURE__ */ i(
|
|
@@ -5584,36 +5588,36 @@ const qi = ({
|
|
|
5584
5588
|
name: d,
|
|
5585
5589
|
label: u,
|
|
5586
5590
|
value: t,
|
|
5587
|
-
trigger:
|
|
5588
|
-
isMultiple:
|
|
5589
|
-
isFloatingLabel:
|
|
5591
|
+
trigger: r,
|
|
5592
|
+
isMultiple: m = !1,
|
|
5593
|
+
isFloatingLabel: c = !1,
|
|
5590
5594
|
subText: h,
|
|
5591
|
-
labelClass:
|
|
5595
|
+
labelClass: p = "",
|
|
5592
5596
|
loading: y,
|
|
5593
|
-
disabled:
|
|
5597
|
+
disabled: g
|
|
5594
5598
|
}) => {
|
|
5595
|
-
const [
|
|
5599
|
+
const [f, v] = D(m ? [] : null), N = q("custom-select__control", e), A = ee(() => n, [n]);
|
|
5596
5600
|
return G(() => {
|
|
5597
5601
|
const k = n == null ? void 0 : n.find((x) => {
|
|
5598
5602
|
var C;
|
|
5599
5603
|
return typeof x.value == "string" && typeof t == "string" ? x.value.toLowerCase() === t.toLowerCase() : typeof x.value == "object" && typeof t == "object" ? ((C = x.value) == null ? void 0 : C.id) === (t == null ? void 0 : t.id) : x.value === t;
|
|
5600
5604
|
});
|
|
5601
|
-
|
|
5605
|
+
v(k || null);
|
|
5602
5606
|
}, [t, n]), G(() => {
|
|
5603
|
-
|
|
5604
|
-
}, [d,
|
|
5605
|
-
u && !
|
|
5606
|
-
|
|
5607
|
+
f && l && o && (l(d, f == null ? void 0 : f.value), o(d), r == null || r(d));
|
|
5608
|
+
}, [d, f]), /* @__PURE__ */ b("div", { className: "custom-select", children: [
|
|
5609
|
+
u && !c && /* @__PURE__ */ i("label", { className: "custom-select__label", children: u }),
|
|
5610
|
+
c && u && /* @__PURE__ */ i("label", { className: q("custom-select__floating-label", p), children: u }),
|
|
5607
5611
|
/* @__PURE__ */ i(
|
|
5608
5612
|
ae,
|
|
5609
5613
|
{
|
|
5610
|
-
value:
|
|
5611
|
-
onChange:
|
|
5612
|
-
multiple:
|
|
5613
|
-
disabled:
|
|
5614
|
+
value: f,
|
|
5615
|
+
onChange: v,
|
|
5616
|
+
multiple: m,
|
|
5617
|
+
disabled: g,
|
|
5614
5618
|
children: /* @__PURE__ */ b("div", { className: "custom-select__wrapper", children: [
|
|
5615
|
-
/* @__PURE__ */ b(ae.Button, { className: N, disabled:
|
|
5616
|
-
y ? /* @__PURE__ */ i("span", { className: "custom-select__loading", children: "Fetching data..." }) : /* @__PURE__ */ i("span", { className: "custom-select__value", children: (
|
|
5619
|
+
/* @__PURE__ */ b(ae.Button, { className: N, disabled: g, children: [
|
|
5620
|
+
y ? /* @__PURE__ */ i("span", { className: "custom-select__loading", children: "Fetching data..." }) : /* @__PURE__ */ i("span", { className: "custom-select__value", children: (f == null ? void 0 : f.label) || /* @__PURE__ */ i("span", { className: "custom-select__placeholder", children: a }) }),
|
|
5617
5621
|
/* @__PURE__ */ i("span", { className: "custom-select__icon", children: /* @__PURE__ */ i(J, { icon: "lucide:chevron-down" }) })
|
|
5618
5622
|
] }),
|
|
5619
5623
|
/* @__PURE__ */ i(
|
|
@@ -5654,32 +5658,32 @@ const qi = ({
|
|
|
5654
5658
|
element: e,
|
|
5655
5659
|
validationData: n
|
|
5656
5660
|
}) => {
|
|
5657
|
-
var
|
|
5661
|
+
var g;
|
|
5658
5662
|
const {
|
|
5659
5663
|
register: a = () => ({}),
|
|
5660
5664
|
trigger: s,
|
|
5661
5665
|
setValue: o,
|
|
5662
5666
|
watch: l,
|
|
5663
5667
|
isReadOnly: d
|
|
5664
|
-
} = n || {}, u = (
|
|
5665
|
-
const N =
|
|
5668
|
+
} = n || {}, u = (g = e == null ? void 0 : e.id) != null ? g : "cascadeValue", [t, r] = D(""), [m, c] = D(""), h = (f, v) => {
|
|
5669
|
+
const N = f && v ? `${f}_${v}` : "";
|
|
5666
5670
|
o == null || o(u, N), s == null || s(u);
|
|
5667
|
-
},
|
|
5668
|
-
|
|
5671
|
+
}, p = (f, v) => {
|
|
5672
|
+
f === "first" ? (r(v), c(""), h(v, "")) : (c(v), h(t, v));
|
|
5669
5673
|
};
|
|
5670
5674
|
G(() => {
|
|
5671
5675
|
if (l) {
|
|
5672
|
-
const
|
|
5673
|
-
if (
|
|
5674
|
-
const [
|
|
5675
|
-
|
|
5676
|
+
const f = l(u);
|
|
5677
|
+
if (f != null && f.includes("_")) {
|
|
5678
|
+
const [v, N] = f.split("_");
|
|
5679
|
+
r(v), c(N);
|
|
5676
5680
|
}
|
|
5677
5681
|
}
|
|
5678
5682
|
}, [l, u]);
|
|
5679
5683
|
const y = ee(
|
|
5680
5684
|
() => {
|
|
5681
|
-
var
|
|
5682
|
-
return (
|
|
5685
|
+
var f;
|
|
5686
|
+
return (f = e.options1) == null ? void 0 : f.filter((v) => v.key === t);
|
|
5683
5687
|
},
|
|
5684
5688
|
[e.options1, t]
|
|
5685
5689
|
);
|
|
@@ -5688,7 +5692,7 @@ const qi = ({
|
|
|
5688
5692
|
/* @__PURE__ */ i("div", { className: "relative", children: /* @__PURE__ */ i(
|
|
5689
5693
|
qi,
|
|
5690
5694
|
{
|
|
5691
|
-
setValue: (
|
|
5695
|
+
setValue: (f, v) => p("first", v),
|
|
5692
5696
|
options: e.options,
|
|
5693
5697
|
name: `${u}`,
|
|
5694
5698
|
register: a,
|
|
@@ -5700,11 +5704,11 @@ const qi = ({
|
|
|
5700
5704
|
/* @__PURE__ */ i(
|
|
5701
5705
|
qi,
|
|
5702
5706
|
{
|
|
5703
|
-
setValue: (
|
|
5707
|
+
setValue: (f, v) => p("second", v),
|
|
5704
5708
|
options: y,
|
|
5705
5709
|
name: `${u}`,
|
|
5706
5710
|
register: a,
|
|
5707
|
-
value:
|
|
5711
|
+
value: m
|
|
5708
5712
|
}
|
|
5709
5713
|
)
|
|
5710
5714
|
] })
|
|
@@ -5719,27 +5723,27 @@ const qi = ({
|
|
|
5719
5723
|
element: d,
|
|
5720
5724
|
validationData: u
|
|
5721
5725
|
}) => {
|
|
5722
|
-
var
|
|
5726
|
+
var v;
|
|
5723
5727
|
const {
|
|
5724
5728
|
register: t = () => ({}),
|
|
5725
|
-
trigger:
|
|
5726
|
-
setValue:
|
|
5727
|
-
watch:
|
|
5729
|
+
trigger: r,
|
|
5730
|
+
setValue: m,
|
|
5731
|
+
watch: c,
|
|
5728
5732
|
isReadOnly: h
|
|
5729
|
-
} = u || {},
|
|
5733
|
+
} = u || {}, p = (v = c == null ? void 0 : c(d.id)) != null ? v : 0, [y, g] = D(null);
|
|
5730
5734
|
G(() => {
|
|
5731
|
-
|
|
5735
|
+
p == null && (m == null || m(d.id, e));
|
|
5732
5736
|
}, []);
|
|
5733
|
-
const
|
|
5737
|
+
const f = (N) => {
|
|
5734
5738
|
if (!a && !h) {
|
|
5735
5739
|
const A = N + 1;
|
|
5736
|
-
|
|
5740
|
+
m == null || m(d.id, A), r == null || r(d.id), s == null || s(A);
|
|
5737
5741
|
}
|
|
5738
5742
|
};
|
|
5739
5743
|
return /* @__PURE__ */ b("div", { className: `flex gap-1 ${l}`, children: [
|
|
5740
5744
|
/* @__PURE__ */ i("input", { type: "hidden", ...t(d.id) }),
|
|
5741
5745
|
Array.from({ length: n }, (N, A) => {
|
|
5742
|
-
const k = y !== null ? A <= y : A <
|
|
5746
|
+
const k = y !== null ? A <= y : A < p;
|
|
5743
5747
|
return /* @__PURE__ */ i(
|
|
5744
5748
|
vn,
|
|
5745
5749
|
{
|
|
@@ -5747,9 +5751,9 @@ const qi = ({
|
|
|
5747
5751
|
className: `cursor-pointer transition-colors ${k ? "text-yellow-400" : "text-gray-300"}`,
|
|
5748
5752
|
width: o,
|
|
5749
5753
|
height: o,
|
|
5750
|
-
onMouseEnter: () => !(a || h) &&
|
|
5751
|
-
onMouseLeave: () => !(a || h) &&
|
|
5752
|
-
onClick: () =>
|
|
5754
|
+
onMouseEnter: () => !(a || h) && g(A),
|
|
5755
|
+
onMouseLeave: () => !(a || h) && g(null),
|
|
5756
|
+
onClick: () => f(A)
|
|
5753
5757
|
},
|
|
5754
5758
|
A
|
|
5755
5759
|
);
|
|
@@ -5805,28 +5809,28 @@ function _i({
|
|
|
5805
5809
|
trigger: o,
|
|
5806
5810
|
isReadOnly: l,
|
|
5807
5811
|
watch: d
|
|
5808
|
-
} = n || {}, u = (d == null ? void 0 : d(e.id)) || "", { country: t, state:
|
|
5812
|
+
} = n || {}, u = (d == null ? void 0 : d(e.id)) || "", { country: t, state: r } = ee(() => {
|
|
5809
5813
|
var y;
|
|
5810
5814
|
if (typeof u == "string" && u.includes(",")) {
|
|
5811
|
-
const [
|
|
5812
|
-
return { country:
|
|
5815
|
+
const [g, f] = (y = u.split(",")) == null ? void 0 : y.map((v) => v.trim());
|
|
5816
|
+
return { country: f, state: g };
|
|
5813
5817
|
}
|
|
5814
5818
|
return { country: u, state: "" };
|
|
5815
|
-
}, [u]),
|
|
5816
|
-
var y,
|
|
5817
|
-
return t ? ((
|
|
5818
|
-
label:
|
|
5819
|
-
value:
|
|
5819
|
+
}, [u]), m = re(u), c = ee(() => {
|
|
5820
|
+
var y, g;
|
|
5821
|
+
return t ? ((g = (y = _e.find((f) => f.name === t)) == null ? void 0 : y.states) == null ? void 0 : g.map((f) => ({
|
|
5822
|
+
label: f.name,
|
|
5823
|
+
value: f.name
|
|
5820
5824
|
}))) || [] : [];
|
|
5821
|
-
}, [t]), h = (y,
|
|
5822
|
-
const
|
|
5823
|
-
s &&
|
|
5824
|
-
},
|
|
5825
|
-
const
|
|
5826
|
-
s &&
|
|
5825
|
+
}, [t]), h = (y, g) => {
|
|
5826
|
+
const v = (g == null ? void 0 : g.value) || "";
|
|
5827
|
+
s && v !== m.current && (s(e.id, v), o == null || o(e.id), m.current = v);
|
|
5828
|
+
}, p = (y, g) => {
|
|
5829
|
+
const f = (g == null ? void 0 : g.value) || "", v = f ? `${f}, ${t}` : t;
|
|
5830
|
+
s && v !== m.current && (s(e.id, v), o == null || o(e.id), m.current = v);
|
|
5827
5831
|
};
|
|
5828
5832
|
return G(() => {
|
|
5829
|
-
|
|
5833
|
+
m.current = u;
|
|
5830
5834
|
}, [u]), /* @__PURE__ */ b("div", { className: "grid gap-y-6", children: [
|
|
5831
5835
|
/* @__PURE__ */ i("input", { type: "hidden", ...a(e.id) }),
|
|
5832
5836
|
/* @__PURE__ */ i(
|
|
@@ -5840,18 +5844,18 @@ function _i({
|
|
|
5840
5844
|
},
|
|
5841
5845
|
`country-${t}`
|
|
5842
5846
|
),
|
|
5843
|
-
|
|
5847
|
+
c.length > 0 && e.showState && /* @__PURE__ */ b("div", { children: [
|
|
5844
5848
|
/* @__PURE__ */ i("label", { className: "block text-sm font-medium mb-1.5 input_label", children: "State" }),
|
|
5845
5849
|
/* @__PURE__ */ i(
|
|
5846
5850
|
Ue,
|
|
5847
5851
|
{
|
|
5848
|
-
options:
|
|
5849
|
-
onGetValue:
|
|
5852
|
+
options: c,
|
|
5853
|
+
onGetValue: p,
|
|
5850
5854
|
name: `${e.id}-state`,
|
|
5851
5855
|
readOnly: l,
|
|
5852
|
-
defaultValue:
|
|
5856
|
+
defaultValue: r
|
|
5853
5857
|
},
|
|
5854
|
-
`state-${
|
|
5858
|
+
`state-${r}`
|
|
5855
5859
|
)
|
|
5856
5860
|
] })
|
|
5857
5861
|
] });
|
|
@@ -5860,34 +5864,34 @@ function Uo({
|
|
|
5860
5864
|
element: e,
|
|
5861
5865
|
validationData: n
|
|
5862
5866
|
}) {
|
|
5863
|
-
const { register: a = () => ({}), isReadOnly: s } = n || {}, { validationUrl: o, documentObj: l, signatureLink: d } = e, u = ee(() => de("config"), []), [t,
|
|
5864
|
-
var
|
|
5867
|
+
const { register: a = () => ({}), isReadOnly: s } = n || {}, { validationUrl: o, documentObj: l, signatureLink: d } = e, u = ee(() => de("config"), []), [t, r] = D(!1), [m, c] = D(!1), h = Y(async () => {
|
|
5868
|
+
var p, y;
|
|
5865
5869
|
if (!(!o || !l))
|
|
5866
5870
|
try {
|
|
5867
|
-
|
|
5868
|
-
const
|
|
5871
|
+
c(!0);
|
|
5872
|
+
const f = {
|
|
5869
5873
|
headers: {
|
|
5870
5874
|
Authorization: `Bearer ${de("token")}`
|
|
5871
5875
|
}
|
|
5872
|
-
}, { data:
|
|
5876
|
+
}, { data: v } = await Pe.get(
|
|
5873
5877
|
`${o}/${l}`,
|
|
5874
|
-
|
|
5875
|
-
), N = !!((y = (
|
|
5876
|
-
return
|
|
5877
|
-
} catch (
|
|
5878
|
-
console.error("Failed to check sign status",
|
|
5878
|
+
f
|
|
5879
|
+
), N = !!((y = (p = v == null ? void 0 : v.data) == null ? void 0 : p.isSigned) != null ? y : v != null && v.isSigned);
|
|
5880
|
+
return r(N), N;
|
|
5881
|
+
} catch (g) {
|
|
5882
|
+
console.error("Failed to check sign status", g);
|
|
5879
5883
|
} finally {
|
|
5880
|
-
|
|
5884
|
+
c(!1);
|
|
5881
5885
|
}
|
|
5882
5886
|
}, [o, l]);
|
|
5883
5887
|
return G(() => {
|
|
5884
|
-
let
|
|
5888
|
+
let p = null;
|
|
5885
5889
|
return !t && l && o && (async () => {
|
|
5886
|
-
await h() || (
|
|
5887
|
-
await h() &&
|
|
5890
|
+
await h() || (p = setInterval(async () => {
|
|
5891
|
+
await h() && p && clearInterval(p);
|
|
5888
5892
|
}, 2e3));
|
|
5889
5893
|
})(), () => {
|
|
5890
|
-
|
|
5894
|
+
p && clearInterval(p);
|
|
5891
5895
|
};
|
|
5892
5896
|
}, [h, t, l, o]), /* @__PURE__ */ b("div", { className: "flex items-center gap-x-2", children: [
|
|
5893
5897
|
/* @__PURE__ */ i(
|
|
@@ -5905,21 +5909,21 @@ function Uo({
|
|
|
5905
5909
|
{
|
|
5906
5910
|
type: "button",
|
|
5907
5911
|
onClick: h,
|
|
5908
|
-
disabled:
|
|
5912
|
+
disabled: m || t,
|
|
5909
5913
|
style: { background: (u == null ? void 0 : u.buttonColor) || "#333" },
|
|
5910
5914
|
className: q(
|
|
5911
5915
|
"flex items-center gap-x-1 rounded-lg border border-gray-200 bg-gray-200 px-3 py-[10px] text-sm text-white",
|
|
5912
|
-
{ "!opacity-60":
|
|
5916
|
+
{ "!opacity-60": m }
|
|
5913
5917
|
),
|
|
5914
5918
|
children: [
|
|
5915
5919
|
/* @__PURE__ */ i(
|
|
5916
5920
|
J,
|
|
5917
5921
|
{
|
|
5918
|
-
icon:
|
|
5919
|
-
iconClass:
|
|
5922
|
+
icon: m ? "solar:refresh-outline" : t ? "solar:check-circle-bold" : "solar:pen-2-line-duotone",
|
|
5923
|
+
iconClass: m ? "animate-spin" : ""
|
|
5920
5924
|
}
|
|
5921
5925
|
),
|
|
5922
|
-
|
|
5926
|
+
m ? "Checking..." : t ? "Signed" : "Sign"
|
|
5923
5927
|
]
|
|
5924
5928
|
}
|
|
5925
5929
|
) })
|
|
@@ -6181,22 +6185,22 @@ function Wo({
|
|
|
6181
6185
|
value: d,
|
|
6182
6186
|
error: u,
|
|
6183
6187
|
disabled: t,
|
|
6184
|
-
readOnly:
|
|
6185
|
-
horizontal:
|
|
6186
|
-
description:
|
|
6188
|
+
readOnly: r,
|
|
6189
|
+
horizontal: m,
|
|
6190
|
+
description: c,
|
|
6187
6191
|
validate: h,
|
|
6188
|
-
onChange:
|
|
6192
|
+
onChange: p,
|
|
6189
6193
|
onError: y
|
|
6190
6194
|
}) {
|
|
6191
|
-
const [
|
|
6195
|
+
const [g, f] = D(""), [v, N] = D(null), [A, k] = D(""), x = ee(
|
|
6192
6196
|
() => {
|
|
6193
6197
|
var E;
|
|
6194
6198
|
return (E = ui == null ? void 0 : ui.slice().sort((F, Z) => F.label.localeCompare(Z.label))) == null ? void 0 : E.map((F) => ({ ...F, phone: `+${F.phone}` }));
|
|
6195
6199
|
},
|
|
6196
6200
|
[]
|
|
6197
|
-
), C = ee(() =>
|
|
6198
|
-
(E) => `${E.label} ${E.phone}`.toLowerCase().includes(
|
|
6199
|
-
) : x, [
|
|
6201
|
+
), C = ee(() => g ? x.filter(
|
|
6202
|
+
(E) => `${E.label} ${E.phone}`.toLowerCase().includes(g.toLowerCase())
|
|
6203
|
+
) : x, [g, x]), M = (v == null ? void 0 : v.min) || 10, w = (v == null ? void 0 : v.max) || 10, S = () => A ? `${(v == null ? void 0 : v.phone) || "+234"}-${A}` : "", T = (E) => {
|
|
6200
6204
|
if (!E) return { code: "+234", number: "" };
|
|
6201
6205
|
const F = E.split(/[-\s]/);
|
|
6202
6206
|
return { code: F[0], number: F.slice(1).join(" ") };
|
|
@@ -6215,17 +6219,17 @@ function Wo({
|
|
|
6215
6219
|
return s && E === 0 ? "Phone number is required" : E > 0 && !/^\d+$/.test(A) ? "Phone number must contain only digits" : E > 0 && E < M ? `Minimum length is ${M}` : E > w ? `Maximum length is ${w}` : "";
|
|
6216
6220
|
}, [u, A, M, w, s]);
|
|
6217
6221
|
return G(() => {
|
|
6218
|
-
|
|
6219
|
-
}, [A,
|
|
6222
|
+
p == null || p(S()), y == null || y(I || null);
|
|
6223
|
+
}, [A, v, I]), /* @__PURE__ */ b(
|
|
6220
6224
|
"div",
|
|
6221
6225
|
{
|
|
6222
|
-
className: `relative formGroup ${I && !
|
|
6226
|
+
className: `relative formGroup ${I && !r ? "has-error" : ""} ${m ? "flex" : ""} ${!I && A.length > 0 && !r ? "is-valid" : ""}`,
|
|
6223
6227
|
children: [
|
|
6224
6228
|
e && /* @__PURE__ */ b(
|
|
6225
6229
|
"label",
|
|
6226
6230
|
{
|
|
6227
6231
|
htmlFor: l,
|
|
6228
|
-
className: `${a} ${
|
|
6232
|
+
className: `${a} ${m ? "flex-0 mr-6 md:w-[100px] w-[60px] break-words" : ""} flex items-center gap-x-1 input-label text-sm text-[#1B2B41B8]`,
|
|
6229
6233
|
children: [
|
|
6230
6234
|
e,
|
|
6231
6235
|
" ",
|
|
@@ -6236,14 +6240,14 @@ function Wo({
|
|
|
6236
6240
|
),
|
|
6237
6241
|
/* @__PURE__ */ b("div", { className: "relative !flex items-center input-control text-[#667085] !py-0 field-control", children: [
|
|
6238
6242
|
/* @__PURE__ */ i(J, { icon: "lucide:phone-call" }),
|
|
6239
|
-
/* @__PURE__ */ i(De, { value:
|
|
6243
|
+
/* @__PURE__ */ i(De, { value: v, onChange: N, children: /* @__PURE__ */ b("div", { className: "relative", children: [
|
|
6240
6244
|
/* @__PURE__ */ i(
|
|
6241
6245
|
De.Input,
|
|
6242
6246
|
{
|
|
6243
6247
|
className: "pl-3 pr-4 mr-1 text-sm bg-white py-[10px] outline-none whitespace-nowrap max-w-[70px]",
|
|
6244
6248
|
displayValue: (E) => (E == null ? void 0 : E.phone) || "+234",
|
|
6245
6249
|
placeholder: "+234",
|
|
6246
|
-
onChange: (E) =>
|
|
6250
|
+
onChange: (E) => f(E.target.value)
|
|
6247
6251
|
}
|
|
6248
6252
|
),
|
|
6249
6253
|
/* @__PURE__ */ i(De.Button, { className: "absolute inset-y-0 right-0 flex items-center pr-2", children: /* @__PURE__ */ i(J, { icon: "lucide:chevron-down" }) }),
|
|
@@ -6269,7 +6273,7 @@ function Wo({
|
|
|
6269
6273
|
inputMode: "numeric",
|
|
6270
6274
|
value: A,
|
|
6271
6275
|
disabled: t,
|
|
6272
|
-
readOnly:
|
|
6276
|
+
readOnly: r,
|
|
6273
6277
|
onChange: (E) => {
|
|
6274
6278
|
const F = E.target.value.replace(/\D/g, "");
|
|
6275
6279
|
k(F);
|
|
@@ -6280,10 +6284,10 @@ function Wo({
|
|
|
6280
6284
|
minLength: M
|
|
6281
6285
|
}
|
|
6282
6286
|
),
|
|
6283
|
-
/* @__PURE__ */ i("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !I && A.length > 0 && !
|
|
6287
|
+
/* @__PURE__ */ i("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !I && A.length > 0 && !r && /* @__PURE__ */ i("span", { className: "text-green-500", children: /* @__PURE__ */ i(J, { icon: "bi:check-lg" }) }) })
|
|
6284
6288
|
] })
|
|
6285
6289
|
] }),
|
|
6286
|
-
|
|
6290
|
+
c && /* @__PURE__ */ i("span", { className: "block text-[#475467] font-light leading-4 text-xs mt-2", children: c })
|
|
6287
6291
|
]
|
|
6288
6292
|
}
|
|
6289
6293
|
);
|
|
@@ -6312,11 +6316,11 @@ function zo({
|
|
|
6312
6316
|
value: t,
|
|
6313
6317
|
readOnly: l,
|
|
6314
6318
|
disabled: l,
|
|
6315
|
-
onError: (
|
|
6316
|
-
|
|
6319
|
+
onError: (r) => {
|
|
6320
|
+
r ? d == null || d(e.id, { type: "manual", message: r }) : u == null || u(e.id);
|
|
6317
6321
|
},
|
|
6318
|
-
onChange: (
|
|
6319
|
-
|
|
6322
|
+
onChange: (r) => {
|
|
6323
|
+
r && (s == null || s(e.id, r));
|
|
6320
6324
|
}
|
|
6321
6325
|
}
|
|
6322
6326
|
);
|
|
@@ -6325,10 +6329,10 @@ function Jo({
|
|
|
6325
6329
|
element: e,
|
|
6326
6330
|
validationData: n
|
|
6327
6331
|
}) {
|
|
6328
|
-
var
|
|
6332
|
+
var r;
|
|
6329
6333
|
const { register: a = () => ({}), watch: s } = n || {};
|
|
6330
6334
|
let o = "";
|
|
6331
|
-
s && (o = (
|
|
6335
|
+
s && (o = (r = s()[e.id]) != null ? r : "");
|
|
6332
6336
|
const l = o.trim(), d = /^https?:\/\//i.test(l), u = l ? d ? l : `https://${l}` : "", t = !d;
|
|
6333
6337
|
return /* @__PURE__ */ b("div", { children: [
|
|
6334
6338
|
!(n != null && n.isReadOnly) && /* @__PURE__ */ b("div", { className: "relative", children: [
|
|
@@ -6376,24 +6380,24 @@ function qo({
|
|
|
6376
6380
|
}) {
|
|
6377
6381
|
var t;
|
|
6378
6382
|
const { watch: a, setValue: s } = n || {}, o = (e == null ? void 0 : e.formula) || "", l = ee(() => {
|
|
6379
|
-
const
|
|
6380
|
-
const y = /@\[.*?\]\((.*?)\)/.exec(
|
|
6383
|
+
const m = (o.match(/\{\{([^{}]+)\}\}/g) || []).map((p) => p.replace(/[{}]/g, "")), h = (o.match(/@\[.*?\]\((.*?)\)/g) || []).map((p) => {
|
|
6384
|
+
const y = /@\[.*?\]\((.*?)\)/.exec(p);
|
|
6381
6385
|
return y ? y[1] : "";
|
|
6382
6386
|
}).filter(Boolean);
|
|
6383
|
-
return Array.from(/* @__PURE__ */ new Set([...
|
|
6387
|
+
return Array.from(/* @__PURE__ */ new Set([...m, ...h]));
|
|
6384
6388
|
}, [o]), d = a ? a(l) : [], u = ee(() => {
|
|
6385
6389
|
if (!o) return "";
|
|
6386
|
-
let
|
|
6387
|
-
if (l.forEach((
|
|
6388
|
-
const
|
|
6389
|
-
(isNaN(y) ||
|
|
6390
|
-
}),
|
|
6390
|
+
let r = o, m = !1;
|
|
6391
|
+
if (l.forEach((c, h) => {
|
|
6392
|
+
const p = d[h], y = Number(p);
|
|
6393
|
+
(isNaN(y) || p === void 0 || p === null || p === "") && (m = !0), r = r.replace(new RegExp(`\\{\\{${c}\\}\\}`, "g"), String(y || 0)), r = r.replace(new RegExp(`@\\[.*?\\]\\(${c}\\)`, "g"), String(y || 0));
|
|
6394
|
+
}), m) return "";
|
|
6391
6395
|
try {
|
|
6392
|
-
const
|
|
6393
|
-
if (!
|
|
6394
|
-
const h = new Function(`return ${
|
|
6396
|
+
const c = r.replace(/[^0-9+\-*/().\s]/g, "");
|
|
6397
|
+
if (!c) return "";
|
|
6398
|
+
const h = new Function(`return ${c}`)();
|
|
6395
6399
|
return !isNaN(h) && h !== null ? Number.isInteger(h) ? h : Number(h.toFixed(2)) : "";
|
|
6396
|
-
} catch (
|
|
6400
|
+
} catch (c) {
|
|
6397
6401
|
return "Error";
|
|
6398
6402
|
}
|
|
6399
6403
|
}, [o, l, d]);
|
|
@@ -6417,38 +6421,38 @@ function _o({
|
|
|
6417
6421
|
validationData: n,
|
|
6418
6422
|
state: a
|
|
6419
6423
|
}) {
|
|
6420
|
-
var
|
|
6421
|
-
const { register: s, watch: o, setValue: l } = n || {}, [d, u] = D({}), [t,
|
|
6424
|
+
var p;
|
|
6425
|
+
const { register: s, watch: o, setValue: l } = n || {}, [d, u] = D({}), [t, r] = D(0), m = o ? o(e.id) : null, c = !!(m || a && a !== "edit");
|
|
6422
6426
|
G(() => {
|
|
6423
6427
|
if (!e.fetchExternalResults || !e.externalApiUrl) return;
|
|
6424
6428
|
const y = async () => {
|
|
6425
6429
|
try {
|
|
6426
|
-
const
|
|
6427
|
-
if (!
|
|
6428
|
-
const
|
|
6430
|
+
const f = await fetch(e.externalApiUrl);
|
|
6431
|
+
if (!f.ok) return;
|
|
6432
|
+
const v = await f.json();
|
|
6429
6433
|
let N = {};
|
|
6430
|
-
Array.isArray(
|
|
6434
|
+
Array.isArray(v) ? v.forEach((k) => {
|
|
6431
6435
|
const x = k.value || k.id || k.option, C = k.count || k.votes || k.value || 0;
|
|
6432
6436
|
x && (N[x] = Number(C));
|
|
6433
|
-
}) : typeof
|
|
6437
|
+
}) : typeof v == "object" && (N = v), u(N);
|
|
6434
6438
|
const A = Object.values(N).reduce((k, x) => k + Number(x), 0);
|
|
6435
|
-
|
|
6436
|
-
} catch (
|
|
6437
|
-
console.error("Failed to fetch polling results",
|
|
6439
|
+
r(A);
|
|
6440
|
+
} catch (f) {
|
|
6441
|
+
console.error("Failed to fetch polling results", f);
|
|
6438
6442
|
}
|
|
6439
6443
|
};
|
|
6440
6444
|
y();
|
|
6441
|
-
const
|
|
6442
|
-
return () => clearInterval(
|
|
6445
|
+
const g = setInterval(y, 1e4);
|
|
6446
|
+
return () => clearInterval(g);
|
|
6443
6447
|
}, [e.fetchExternalResults, e.externalApiUrl]), G(() => {
|
|
6444
|
-
e.fetchExternalResults || (
|
|
6445
|
-
}, [
|
|
6448
|
+
e.fetchExternalResults || (m ? (u({ [m]: 1 }), r(1)) : (u({}), r(0)));
|
|
6449
|
+
}, [m, e.fetchExternalResults]);
|
|
6446
6450
|
const h = (y) => {
|
|
6447
6451
|
n != null && n.isReadOnly || l && l(e.id, y, { shouldValidate: !0, shouldDirty: !0 });
|
|
6448
6452
|
};
|
|
6449
6453
|
return /* @__PURE__ */ b("div", { className: "w-full", children: [
|
|
6450
|
-
/* @__PURE__ */ i("div", { className: "grid gap-y-3", children: (
|
|
6451
|
-
const
|
|
6454
|
+
/* @__PURE__ */ i("div", { className: "grid gap-y-3", children: (p = e.options) == null ? void 0 : p.map((y) => {
|
|
6455
|
+
const g = d[y.value] || 0, f = t > 0 ? Math.round(g / t * 100) : 0, v = m === y.value;
|
|
6452
6456
|
return /* @__PURE__ */ b(
|
|
6453
6457
|
"div",
|
|
6454
6458
|
{
|
|
@@ -6456,14 +6460,14 @@ function _o({
|
|
|
6456
6460
|
className: q(
|
|
6457
6461
|
"relative flex items-center justify-between p-3 border rounded-lg overflow-hidden transition-all duration-200",
|
|
6458
6462
|
n != null && n.isReadOnly ? "cursor-default" : "cursor-pointer hover:border-blue-400 hover:bg-blue-50/50",
|
|
6459
|
-
|
|
6463
|
+
v ? "border-blue-500 ring-1 ring-blue-500" : "border-gray-200"
|
|
6460
6464
|
),
|
|
6461
6465
|
children: [
|
|
6462
|
-
|
|
6466
|
+
c && /* @__PURE__ */ i(
|
|
6463
6467
|
"div",
|
|
6464
6468
|
{
|
|
6465
6469
|
className: "absolute top-0 left-0 bottom-0 bg-blue-100/60 transition-all duration-1000 ease-out",
|
|
6466
|
-
style: { width: `${
|
|
6470
|
+
style: { width: `${f}%` }
|
|
6467
6471
|
}
|
|
6468
6472
|
),
|
|
6469
6473
|
/* @__PURE__ */ b("div", { className: "relative z-10 flex items-center gap-3", children: [
|
|
@@ -6472,9 +6476,9 @@ function _o({
|
|
|
6472
6476
|
{
|
|
6473
6477
|
className: q(
|
|
6474
6478
|
"flex-shrink-0 w-5 h-5 rounded-full border flex items-center justify-center transition-colors",
|
|
6475
|
-
|
|
6479
|
+
v ? "border-blue-500 bg-blue-500" : "border-gray-300 bg-white"
|
|
6476
6480
|
),
|
|
6477
|
-
children:
|
|
6481
|
+
children: v && /* @__PURE__ */ i("div", { className: "w-2 h-2 bg-white rounded-full" })
|
|
6478
6482
|
}
|
|
6479
6483
|
),
|
|
6480
6484
|
/* @__PURE__ */ i(
|
|
@@ -6482,18 +6486,18 @@ function _o({
|
|
|
6482
6486
|
{
|
|
6483
6487
|
className: q(
|
|
6484
6488
|
"font-medium text-sm",
|
|
6485
|
-
|
|
6489
|
+
v ? "text-blue-900" : "text-gray-700"
|
|
6486
6490
|
),
|
|
6487
6491
|
children: y.label || y.name || y.option || y.value || "Unknown Option"
|
|
6488
6492
|
}
|
|
6489
6493
|
)
|
|
6490
6494
|
] }),
|
|
6491
|
-
|
|
6495
|
+
c && /* @__PURE__ */ b("div", { className: "relative z-10 flex items-center gap-2", children: [
|
|
6492
6496
|
/* @__PURE__ */ b("span", { className: "text-sm font-semibold text-gray-700", children: [
|
|
6493
|
-
|
|
6497
|
+
f,
|
|
6494
6498
|
"%"
|
|
6495
6499
|
] }),
|
|
6496
|
-
|
|
6500
|
+
v && /* @__PURE__ */ i(J, { icon: "material-symbols:check-circle", iconClass: "text-blue-500 text-lg" })
|
|
6497
6501
|
] }),
|
|
6498
6502
|
/* @__PURE__ */ i(
|
|
6499
6503
|
"input",
|
|
@@ -6509,7 +6513,7 @@ function _o({
|
|
|
6509
6513
|
y.id || y.value
|
|
6510
6514
|
);
|
|
6511
6515
|
}) }),
|
|
6512
|
-
|
|
6516
|
+
c && /* @__PURE__ */ b("div", { className: "mt-3 text-xs text-gray-500 text-right flex justify-between items-center", children: [
|
|
6513
6517
|
/* @__PURE__ */ b("span", { children: [
|
|
6514
6518
|
t,
|
|
6515
6519
|
" ",
|
|
@@ -6591,30 +6595,30 @@ const fn = {
|
|
|
6591
6595
|
formData: d,
|
|
6592
6596
|
addElement: u,
|
|
6593
6597
|
setIsDragging: t,
|
|
6594
|
-
moveElement:
|
|
6595
|
-
isDragging:
|
|
6596
|
-
removeElement:
|
|
6598
|
+
moveElement: r,
|
|
6599
|
+
isDragging: m,
|
|
6600
|
+
removeElement: c
|
|
6597
6601
|
} = ye(be), h = ee(
|
|
6598
6602
|
() => Array.from({ length: e.columns }),
|
|
6599
6603
|
[e.columns]
|
|
6600
|
-
), [
|
|
6604
|
+
), [p, y] = D(null);
|
|
6601
6605
|
G(() => {
|
|
6602
6606
|
const k = () => {
|
|
6603
6607
|
y(null), t(!1);
|
|
6604
6608
|
};
|
|
6605
6609
|
return document.addEventListener("dragend", k), () => document.removeEventListener("dragend", k);
|
|
6606
6610
|
}, [t]);
|
|
6607
|
-
const
|
|
6611
|
+
const g = Y(
|
|
6608
6612
|
(k, x) => {
|
|
6609
6613
|
k.preventDefault(), k.stopPropagation(), k.dataTransfer.dropEffect = "move", y(x);
|
|
6610
6614
|
},
|
|
6611
6615
|
[]
|
|
6612
|
-
),
|
|
6616
|
+
), f = Y(
|
|
6613
6617
|
(k, x) => {
|
|
6614
6618
|
k.preventDefault(), k.stopPropagation(), y(x);
|
|
6615
6619
|
},
|
|
6616
6620
|
[]
|
|
6617
|
-
),
|
|
6621
|
+
), v = Y(
|
|
6618
6622
|
(k, x) => {
|
|
6619
6623
|
const C = k.relatedTarget;
|
|
6620
6624
|
C && k.currentTarget.contains(C) || y((M) => M === x ? null : M);
|
|
@@ -6626,7 +6630,7 @@ const fn = {
|
|
|
6626
6630
|
k.preventDefault(), k.stopPropagation(), t(!1), y(null);
|
|
6627
6631
|
const C = x + 1, M = k.dataTransfer.getData("elementId");
|
|
6628
6632
|
if (M) {
|
|
6629
|
-
|
|
6633
|
+
r({
|
|
6630
6634
|
draggedId: M,
|
|
6631
6635
|
sectionId: n,
|
|
6632
6636
|
targetGridId: e.id,
|
|
@@ -6645,7 +6649,7 @@ const fn = {
|
|
|
6645
6649
|
return Z.gridId === e.id && ((ie = Z.gridPosition) == null ? void 0 : ie.col) === C;
|
|
6646
6650
|
}
|
|
6647
6651
|
);
|
|
6648
|
-
E &&
|
|
6652
|
+
E && c(E.id, n);
|
|
6649
6653
|
const F = {
|
|
6650
6654
|
...T,
|
|
6651
6655
|
id: pe(),
|
|
@@ -6658,7 +6662,7 @@ const fn = {
|
|
|
6658
6662
|
console.error("Drop failed in grid:", S), t(!1);
|
|
6659
6663
|
}
|
|
6660
6664
|
},
|
|
6661
|
-
[u, e.id, d, n, t,
|
|
6665
|
+
[u, e.id, d, n, t, r]
|
|
6662
6666
|
), A = (k, x, C) => {
|
|
6663
6667
|
var ie, X, he;
|
|
6664
6668
|
const M = k + 1, w = (X = (ie = d.find((_) => _.id === n)) == null ? void 0 : ie.questionData) == null ? void 0 : X.find(
|
|
@@ -6669,7 +6673,7 @@ const fn = {
|
|
|
6669
6673
|
), S = (he = w == null ? void 0 : w.id) != null ? he : null, T = Array.isArray(a) && a.find((_) => {
|
|
6670
6674
|
var V;
|
|
6671
6675
|
return ((V = _ == null ? void 0 : _.props) == null ? void 0 : V.col) === M;
|
|
6672
|
-
}), I =
|
|
6676
|
+
}), I = m && p === k, E = !!T, F = m && !!l, Z = E && S && C === "edit" ? {
|
|
6673
6677
|
draggable: !0,
|
|
6674
6678
|
onDragStart: (_) => {
|
|
6675
6679
|
_.stopPropagation(), _.dataTransfer.setData("elementId", S), _.dataTransfer.setData("properties", S), _.dataTransfer.effectAllowed = "move", t(!0);
|
|
@@ -6684,9 +6688,9 @@ const fn = {
|
|
|
6684
6688
|
id: `grid-cell-${e.id}-${k}`,
|
|
6685
6689
|
...Z,
|
|
6686
6690
|
onDrop: (_) => N(_, k),
|
|
6687
|
-
onDragEnter: (_) =>
|
|
6688
|
-
onDragOver: (_) =>
|
|
6689
|
-
onDragLeave: (_) =>
|
|
6691
|
+
onDragEnter: (_) => f(_, k),
|
|
6692
|
+
onDragOver: (_) => g(_, k),
|
|
6693
|
+
onDragLeave: (_) => v(_, k),
|
|
6690
6694
|
className: q(
|
|
6691
6695
|
"relative border rounded-lg min-h-[110px] min-w-0",
|
|
6692
6696
|
"flex items-center justify-center",
|
|
@@ -6777,47 +6781,47 @@ function Qo({ elementData: e, sectionId: n }) {
|
|
|
6777
6781
|
setIsDragging: o,
|
|
6778
6782
|
addElementInPosition: l,
|
|
6779
6783
|
moveElement: d
|
|
6780
|
-
} = ye(be), [u, t] = D(null),
|
|
6784
|
+
} = ye(be), [u, t] = D(null), r = ee(
|
|
6781
6785
|
() => {
|
|
6782
|
-
var
|
|
6783
|
-
return ((
|
|
6786
|
+
var v;
|
|
6787
|
+
return ((v = a.find((N) => N.id === n)) == null ? void 0 : v.questionData) || [];
|
|
6784
6788
|
},
|
|
6785
6789
|
[a, n]
|
|
6786
|
-
),
|
|
6787
|
-
(
|
|
6788
|
-
|
|
6790
|
+
), m = Y(
|
|
6791
|
+
(v, N) => {
|
|
6792
|
+
v.dataTransfer.setData("elementId", N), v.dataTransfer.setData("properties", N), v.dataTransfer.effectAllowed = "move", t(N), o(!0);
|
|
6789
6793
|
},
|
|
6790
6794
|
[o]
|
|
6791
|
-
),
|
|
6795
|
+
), c = Y(() => {
|
|
6792
6796
|
t(null), o(!1);
|
|
6793
6797
|
}, [o]);
|
|
6794
6798
|
G(() => {
|
|
6795
6799
|
!s && u && t(null);
|
|
6796
6800
|
}, [s, u]);
|
|
6797
6801
|
const h = Y(
|
|
6798
|
-
(
|
|
6799
|
-
|
|
6800
|
-
const N =
|
|
6802
|
+
(v) => {
|
|
6803
|
+
v.preventDefault(), v.stopPropagation();
|
|
6804
|
+
const N = v.dataTransfer.getData("elementId"), A = v.currentTarget.id;
|
|
6801
6805
|
if (!N || !A || N === A) {
|
|
6802
|
-
|
|
6806
|
+
c();
|
|
6803
6807
|
return;
|
|
6804
6808
|
}
|
|
6805
|
-
const k =
|
|
6809
|
+
const k = r.find((C) => C.id === N), x = r.findIndex(
|
|
6806
6810
|
(C) => C.id === A
|
|
6807
6811
|
);
|
|
6808
6812
|
k != null && k.gridId && x !== -1 ? d({ draggedId: N, sectionId: n, targetIndex: x }) : d({ draggedId: N, sectionId: n, targetId: A }), t(null), o(!1);
|
|
6809
6813
|
},
|
|
6810
|
-
[n, d, o,
|
|
6811
|
-
),
|
|
6812
|
-
(
|
|
6813
|
-
|
|
6814
|
-
const A =
|
|
6814
|
+
[n, d, o, c, r]
|
|
6815
|
+
), p = Y(
|
|
6816
|
+
(v, N) => {
|
|
6817
|
+
v.preventDefault(), v.stopPropagation(), o(!1);
|
|
6818
|
+
const A = v.dataTransfer.getData("elementId");
|
|
6815
6819
|
if (A) {
|
|
6816
6820
|
d({ draggedId: A, sectionId: n, targetIndex: N }), t(null);
|
|
6817
6821
|
return;
|
|
6818
6822
|
}
|
|
6819
6823
|
try {
|
|
6820
|
-
const k = JSON.parse(
|
|
6824
|
+
const k = JSON.parse(v.dataTransfer.getData("properties"));
|
|
6821
6825
|
if ((k == null ? void 0 : k.type) === "section") return;
|
|
6822
6826
|
const x = { ...k, id: pe(), sectionId: n };
|
|
6823
6827
|
l(x, n, N), t(null);
|
|
@@ -6827,75 +6831,75 @@ function Qo({ elementData: e, sectionId: n }) {
|
|
|
6827
6831
|
},
|
|
6828
6832
|
[l, n, o, d]
|
|
6829
6833
|
), y = Y(
|
|
6830
|
-
(
|
|
6834
|
+
(v, N = !1) => /* @__PURE__ */ i(
|
|
6831
6835
|
"div",
|
|
6832
6836
|
{
|
|
6833
|
-
id:
|
|
6837
|
+
id: v.id,
|
|
6834
6838
|
draggable: !0,
|
|
6835
|
-
onDragStart: (A) =>
|
|
6839
|
+
onDragStart: (A) => m(A, v.id),
|
|
6836
6840
|
onDragOver: N ? void 0 : (A) => {
|
|
6837
6841
|
A.preventDefault(), A.stopPropagation();
|
|
6838
6842
|
},
|
|
6839
6843
|
onDrop: N ? void 0 : h,
|
|
6840
|
-
onDragEnd:
|
|
6844
|
+
onDragEnd: c,
|
|
6841
6845
|
className: q(
|
|
6842
6846
|
"cursor-grab active:cursor-grabbing border p-4 w-full rounded-lg",
|
|
6843
6847
|
"transition-all duration-200 ease-in-out",
|
|
6844
|
-
u ===
|
|
6848
|
+
u === v.id ? "opacity-40 scale-[0.98] bg-gray-100 border-dashed border-blue-300 shadow-inner" : u ? "bg-white border-dashed border-blue-200 shadow-sm" : "bg-white border-gray-200 shadow-sm hover:border-blue-300 hover:shadow-md"
|
|
6845
6849
|
),
|
|
6846
|
-
children: Yo(
|
|
6850
|
+
children: Yo(v, n)
|
|
6847
6851
|
},
|
|
6848
|
-
|
|
6852
|
+
v.id
|
|
6849
6853
|
),
|
|
6850
|
-
[u, h, n,
|
|
6851
|
-
),
|
|
6854
|
+
[u, h, n, m, c]
|
|
6855
|
+
), g = ee(() => (e == null ? void 0 : e.reduce((v, N) => (N.gridId && (v[N.gridId] = v[N.gridId] || [], v[N.gridId].push(N)), v), {})) || {}, [e]);
|
|
6852
6856
|
if (!(e != null && e.length))
|
|
6853
6857
|
return /* @__PURE__ */ i(
|
|
6854
6858
|
"div",
|
|
6855
6859
|
{
|
|
6856
|
-
onDragOver: (
|
|
6857
|
-
onDrop: (
|
|
6858
|
-
onDragEnd:
|
|
6860
|
+
onDragOver: (v) => v.preventDefault(),
|
|
6861
|
+
onDrop: (v) => p(v, 0),
|
|
6862
|
+
onDragEnd: c,
|
|
6859
6863
|
className: "w-full h-full flex items-center justify-center text-gray-400 min-h-[200px] p-10 col-span-2 border border-dashed border-gray-300 rounded-lg",
|
|
6860
6864
|
children: "Drag or click an element to display"
|
|
6861
6865
|
}
|
|
6862
6866
|
);
|
|
6863
|
-
const
|
|
6867
|
+
const f = e.filter((v) => !v.gridId);
|
|
6864
6868
|
return /* @__PURE__ */ b("div", { className: "relative flex flex-col w-full h-full gap-2", children: [
|
|
6865
6869
|
/* @__PURE__ */ i(
|
|
6866
6870
|
ti,
|
|
6867
6871
|
{
|
|
6868
6872
|
index: 0,
|
|
6869
6873
|
isDragging: s,
|
|
6870
|
-
onDrop:
|
|
6871
|
-
onDragEnd:
|
|
6874
|
+
onDrop: p,
|
|
6875
|
+
onDragEnd: c
|
|
6872
6876
|
}
|
|
6873
6877
|
),
|
|
6874
|
-
|
|
6875
|
-
const N =
|
|
6876
|
-
if (
|
|
6877
|
-
const A =
|
|
6878
|
+
f.map((v) => {
|
|
6879
|
+
const N = r.findIndex((A) => A.id === v.id);
|
|
6880
|
+
if (v.type === "grid") {
|
|
6881
|
+
const A = g[v.id] || [], k = u === v.id, x = !!u && !k;
|
|
6878
6882
|
return /* @__PURE__ */ b("div", { className: "flex flex-col gap-0", children: [
|
|
6879
6883
|
/* @__PURE__ */ i(
|
|
6880
6884
|
"div",
|
|
6881
6885
|
{
|
|
6882
|
-
id:
|
|
6886
|
+
id: v.id,
|
|
6883
6887
|
draggable: !0,
|
|
6884
|
-
onDragStart: (C) =>
|
|
6888
|
+
onDragStart: (C) => m(C, v.id),
|
|
6885
6889
|
onDragOver: (C) => {
|
|
6886
6890
|
C.preventDefault(), C.stopPropagation();
|
|
6887
6891
|
},
|
|
6888
6892
|
onDrop: h,
|
|
6889
|
-
onDragEnd:
|
|
6893
|
+
onDragEnd: c,
|
|
6890
6894
|
className: q(
|
|
6891
6895
|
"w-full p-4 border rounded-lg cursor-grab active:cursor-grabbing",
|
|
6892
6896
|
"transition-all duration-200 ease-in-out",
|
|
6893
6897
|
k ? "opacity-40 scale-[0.98] bg-gray-100 border-dashed border-blue-400 shadow-inner" : x ? "bg-white border-dashed border-blue-200" : "bg-white border-gray-200 shadow-sm hover:border-blue-300 hover:shadow-md"
|
|
6894
6898
|
),
|
|
6895
|
-
children: /* @__PURE__ */ i(Ti, { element:
|
|
6899
|
+
children: /* @__PURE__ */ i(Ti, { element: v, state: "edit", children: /* @__PURE__ */ i(
|
|
6896
6900
|
ei,
|
|
6897
6901
|
{
|
|
6898
|
-
element:
|
|
6902
|
+
element: v,
|
|
6899
6903
|
sectionId: n,
|
|
6900
6904
|
state: $o,
|
|
6901
6905
|
draggedElementId: u,
|
|
@@ -6914,24 +6918,24 @@ function Qo({ elementData: e, sectionId: n }) {
|
|
|
6914
6918
|
{
|
|
6915
6919
|
index: N + 1,
|
|
6916
6920
|
isDragging: s,
|
|
6917
|
-
onDrop:
|
|
6918
|
-
onDragEnd:
|
|
6921
|
+
onDrop: p,
|
|
6922
|
+
onDragEnd: c
|
|
6919
6923
|
}
|
|
6920
6924
|
)
|
|
6921
|
-
] },
|
|
6925
|
+
] }, v.id);
|
|
6922
6926
|
}
|
|
6923
6927
|
return /* @__PURE__ */ b("div", { className: "flex flex-col gap-0", children: [
|
|
6924
|
-
y(
|
|
6928
|
+
y(v),
|
|
6925
6929
|
/* @__PURE__ */ i(
|
|
6926
6930
|
ti,
|
|
6927
6931
|
{
|
|
6928
6932
|
index: N + 1,
|
|
6929
6933
|
isDragging: s,
|
|
6930
|
-
onDrop:
|
|
6931
|
-
onDragEnd:
|
|
6934
|
+
onDrop: p,
|
|
6935
|
+
onDragEnd: c
|
|
6932
6936
|
}
|
|
6933
6937
|
)
|
|
6934
|
-
] },
|
|
6938
|
+
] }, v.id);
|
|
6935
6939
|
})
|
|
6936
6940
|
] });
|
|
6937
6941
|
}
|
|
@@ -6945,17 +6949,17 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
6945
6949
|
register: o,
|
|
6946
6950
|
handleSubmit: l,
|
|
6947
6951
|
watch: d,
|
|
6948
|
-
formState: { errors: u, isSubmitting: t, isValid:
|
|
6949
|
-
reset:
|
|
6952
|
+
formState: { errors: u, isSubmitting: t, isValid: r },
|
|
6953
|
+
reset: m
|
|
6950
6954
|
} = Si({
|
|
6951
6955
|
resolver: wi(es),
|
|
6952
6956
|
defaultValues: a
|
|
6953
6957
|
});
|
|
6954
6958
|
if (se.useEffect(() => {
|
|
6955
|
-
e ||
|
|
6956
|
-
}, [e,
|
|
6957
|
-
const
|
|
6958
|
-
s(
|
|
6959
|
+
e || m();
|
|
6960
|
+
}, [e, m]), !e) return null;
|
|
6961
|
+
const c = (p) => {
|
|
6962
|
+
s(p, a.id), n();
|
|
6959
6963
|
}, h = d();
|
|
6960
6964
|
return /* @__PURE__ */ i("div", { className: "fixed inset-0 bg-black/30 flex items-center justify-center z-[999] cursor-default no-drag select-none", children: /* @__PURE__ */ b("div", { className: "min-w-[600px] bg-white rounded-xl shadow-xl relative flex flex-col items-center", children: [
|
|
6961
6965
|
/* @__PURE__ */ b("div", { className: "w-full px-6 pt-6 pb-5 flex flex-col items-start gap-4 z-10 mb-6", children: [
|
|
@@ -6969,7 +6973,7 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
6969
6973
|
}
|
|
6970
6974
|
)
|
|
6971
6975
|
] }),
|
|
6972
|
-
/* @__PURE__ */ b("form", { onSubmit: l(
|
|
6976
|
+
/* @__PURE__ */ b("form", { onSubmit: l(c), className: "w-full", children: [
|
|
6973
6977
|
/* @__PURE__ */ b("div", { className: "w-full px-6 flex flex-col gap-5 z-10", children: [
|
|
6974
6978
|
/* @__PURE__ */ i(
|
|
6975
6979
|
z,
|
|
@@ -7033,9 +7037,9 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7033
7037
|
"button",
|
|
7034
7038
|
{
|
|
7035
7039
|
type: "submit",
|
|
7036
|
-
disabled: !
|
|
7040
|
+
disabled: !r || t,
|
|
7037
7041
|
style: { background: (ci == null ? void 0 : ci.buttonColor) || "#333" },
|
|
7038
|
-
className: `flex-1 px-4 py-2.5 ${!
|
|
7042
|
+
className: `flex-1 px-4 py-2.5 ${!r || t ? "bg-[#F2F4F7]" : "bg-[#2563EB]"} ${!r || t ? "text-[#98A2B3]" : "text-white"} rounded-lg shadow-xs font-semibold font-onest disabled:opacity-50`,
|
|
7039
7043
|
children: t ? "Saving..." : "Save"
|
|
7040
7044
|
}
|
|
7041
7045
|
)
|
|
@@ -7247,15 +7251,15 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7247
7251
|
handleSectionEdit: d,
|
|
7248
7252
|
removeSection: u,
|
|
7249
7253
|
formDataLength: t,
|
|
7250
|
-
onDragOver:
|
|
7251
|
-
setIsDragging:
|
|
7252
|
-
onReorderSection:
|
|
7254
|
+
onDragOver: r,
|
|
7255
|
+
setIsDragging: m,
|
|
7256
|
+
onReorderSection: c
|
|
7253
7257
|
}) => {
|
|
7254
|
-
var y,
|
|
7255
|
-
const h = re(null),
|
|
7258
|
+
var y, g;
|
|
7259
|
+
const h = re(null), p = re((y = e == null ? void 0 : e.questionData) == null ? void 0 : y.length);
|
|
7256
7260
|
return G(() => {
|
|
7257
|
-
var
|
|
7258
|
-
if (((
|
|
7261
|
+
var f, v;
|
|
7262
|
+
if (((f = e == null ? void 0 : e.questionData) == null ? void 0 : f.length) > p.current) {
|
|
7259
7263
|
const N = document.getElementById("section-container");
|
|
7260
7264
|
N && requestAnimationFrame(() => {
|
|
7261
7265
|
N.scrollTo({
|
|
@@ -7264,17 +7268,17 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7264
7268
|
});
|
|
7265
7269
|
});
|
|
7266
7270
|
}
|
|
7267
|
-
|
|
7268
|
-
}, [(
|
|
7271
|
+
p.current = (v = e == null ? void 0 : e.questionData) == null ? void 0 : v.length;
|
|
7272
|
+
}, [(g = e == null ? void 0 : e.questionData) == null ? void 0 : g.length]), /* @__PURE__ */ i(
|
|
7269
7273
|
"div",
|
|
7270
7274
|
{
|
|
7271
7275
|
ref: h,
|
|
7272
|
-
onDragOver: (
|
|
7273
|
-
|
|
7276
|
+
onDragOver: (f) => {
|
|
7277
|
+
f.dataTransfer.types.includes("sectionid") && f.preventDefault();
|
|
7274
7278
|
},
|
|
7275
|
-
onDrop: (
|
|
7276
|
-
const
|
|
7277
|
-
|
|
7279
|
+
onDrop: (f) => {
|
|
7280
|
+
const v = f.dataTransfer.getData("sectionid");
|
|
7281
|
+
v && (f.preventDefault(), f.stopPropagation(), c && c(v, e.id));
|
|
7278
7282
|
},
|
|
7279
7283
|
className: "bg-white group cursor-pointer rounded-lg shadow-[rgba(149,157,165,0.2)_0px_2px_2px] transition-colors duration-200",
|
|
7280
7284
|
children: /* @__PURE__ */ b(
|
|
@@ -7288,10 +7292,10 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7288
7292
|
"div",
|
|
7289
7293
|
{
|
|
7290
7294
|
draggable: !0,
|
|
7291
|
-
onDragStart: (
|
|
7292
|
-
|
|
7295
|
+
onDragStart: (f) => {
|
|
7296
|
+
f.dataTransfer.setData("sectionid", e.id), f.dataTransfer.effectAllowed = "move", m(!0);
|
|
7293
7297
|
},
|
|
7294
|
-
onDragEnd: () =>
|
|
7298
|
+
onDragEnd: () => m(!1),
|
|
7295
7299
|
onClick: () => s(e.id),
|
|
7296
7300
|
className: "flex-1 h-full py-4 cursor-grab active:cursor-grabbing flex items-center gap-2",
|
|
7297
7301
|
title: "Drag to reorder section",
|
|
@@ -7343,8 +7347,8 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7343
7347
|
{
|
|
7344
7348
|
className: "h-full mt-4 transition-all duration-200",
|
|
7345
7349
|
id: e.id,
|
|
7346
|
-
onDragOver:
|
|
7347
|
-
onDragEnd: () =>
|
|
7350
|
+
onDragOver: r,
|
|
7351
|
+
onDragEnd: () => m(!1),
|
|
7348
7352
|
onClick: () => s(e.id),
|
|
7349
7353
|
children: [
|
|
7350
7354
|
/* @__PURE__ */ i("hr", { className: "group-last:hidden" }),
|
|
@@ -7366,43 +7370,43 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7366
7370
|
);
|
|
7367
7371
|
}, ss = ({ onAddTemplate: e, templates: n }) => {
|
|
7368
7372
|
const a = [...as, ...n || []], [s, o] = D(!1), [l, d] = D(!1), u = re(null), t = re(null), {
|
|
7369
|
-
removeSection:
|
|
7373
|
+
removeSection: r,
|
|
7370
7374
|
// addElement,
|
|
7371
|
-
addSection:
|
|
7372
|
-
formData:
|
|
7375
|
+
addSection: m,
|
|
7376
|
+
formData: c,
|
|
7373
7377
|
setIsDragging: h,
|
|
7374
|
-
setSelectedSection:
|
|
7378
|
+
setSelectedSection: p,
|
|
7375
7379
|
selectedSection: y,
|
|
7376
|
-
activeSections:
|
|
7377
|
-
setActiveSections:
|
|
7378
|
-
setFormData:
|
|
7379
|
-
} = ye(be), N = re((
|
|
7380
|
+
activeSections: g,
|
|
7381
|
+
setActiveSections: f,
|
|
7382
|
+
setFormData: v
|
|
7383
|
+
} = ye(be), N = re((c == null ? void 0 : c.length) || 0);
|
|
7380
7384
|
G(() => {
|
|
7381
7385
|
var S;
|
|
7382
|
-
|
|
7386
|
+
p(((S = c[0]) == null ? void 0 : S.id) || null);
|
|
7383
7387
|
}, []), G(() => {
|
|
7384
|
-
(
|
|
7388
|
+
(c == null ? void 0 : c.length) > N.current && t.current && requestAnimationFrame(() => {
|
|
7385
7389
|
var S;
|
|
7386
7390
|
(S = t.current) == null || S.scrollTo({
|
|
7387
7391
|
top: t.current.scrollHeight,
|
|
7388
7392
|
behavior: "smooth"
|
|
7389
7393
|
});
|
|
7390
|
-
}), N.current = (
|
|
7391
|
-
}, [
|
|
7394
|
+
}), N.current = (c == null ? void 0 : c.length) || 0;
|
|
7395
|
+
}, [c == null ? void 0 : c.length]);
|
|
7392
7396
|
const A = Y((S) => {
|
|
7393
7397
|
S.preventDefault(), S.dataTransfer.dropEffect = "move", t.current && (t.current.scrollTop = t.current.scrollHeight);
|
|
7394
7398
|
}, []), k = Y((S, T) => {
|
|
7395
|
-
|
|
7399
|
+
v((I) => {
|
|
7396
7400
|
const E = I.findIndex((X) => X.id === S), F = I.findIndex((X) => X.id === T);
|
|
7397
7401
|
if (E === -1 || F === -1 || E === F) return I;
|
|
7398
7402
|
const Z = [...I], [ie] = Z.splice(E, 1);
|
|
7399
7403
|
return Z.splice(F, 0, ie), Z;
|
|
7400
7404
|
});
|
|
7401
|
-
}, [
|
|
7405
|
+
}, [v]);
|
|
7402
7406
|
function x(S) {
|
|
7403
|
-
|
|
7407
|
+
g.includes(S) ? f(
|
|
7404
7408
|
(T) => T.filter((I) => I !== S)
|
|
7405
|
-
) :
|
|
7409
|
+
) : f((T) => [...T, S]);
|
|
7406
7410
|
}
|
|
7407
7411
|
function C(S) {
|
|
7408
7412
|
u.current = S, o(!0);
|
|
@@ -7427,7 +7431,7 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7427
7431
|
}
|
|
7428
7432
|
return T(_, { id: V, questionData: ce || [] });
|
|
7429
7433
|
});
|
|
7430
|
-
|
|
7434
|
+
c.length === 1 && c[0].title === "" && c[0].description === "" && (!((I = c[0]) != null && I.questionData) || ((F = (E = c[0]) == null ? void 0 : E.questionData) == null ? void 0 : F.length) === 0) ? (v(X), X.length > 0 && p((Z = X[0]) == null ? void 0 : Z.id)) : v((_) => [..._, ...X]);
|
|
7431
7435
|
}
|
|
7432
7436
|
}, w = de("config");
|
|
7433
7437
|
return /* @__PURE__ */ b(
|
|
@@ -7450,19 +7454,19 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7450
7454
|
ref: t,
|
|
7451
7455
|
className: "relative flex flex-col flex-1 w-full gap-y-3 container overflow-y-auto",
|
|
7452
7456
|
children: [
|
|
7453
|
-
|
|
7457
|
+
c == null ? void 0 : c.map(
|
|
7454
7458
|
(S, T) => /* @__PURE__ */ i(
|
|
7455
7459
|
os,
|
|
7456
7460
|
{
|
|
7457
7461
|
section: S,
|
|
7458
7462
|
index: T,
|
|
7459
7463
|
selectedSection: y,
|
|
7460
|
-
setSelectedSection:
|
|
7461
|
-
activeSections:
|
|
7464
|
+
setSelectedSection: p,
|
|
7465
|
+
activeSections: g,
|
|
7462
7466
|
toggleSection: x,
|
|
7463
7467
|
handleSectionEdit: C,
|
|
7464
|
-
removeSection:
|
|
7465
|
-
formDataLength:
|
|
7468
|
+
removeSection: r,
|
|
7469
|
+
formDataLength: c.length,
|
|
7466
7470
|
onDragOver: A,
|
|
7467
7471
|
setIsDragging: h,
|
|
7468
7472
|
onReorderSection: k
|
|
@@ -7475,7 +7479,7 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7475
7479
|
"button",
|
|
7476
7480
|
{
|
|
7477
7481
|
type: "button",
|
|
7478
|
-
onClick: () =>
|
|
7482
|
+
onClick: () => m(),
|
|
7479
7483
|
style: { color: (w == null ? void 0 : w.buttonColor) || "#333" },
|
|
7480
7484
|
className: "text-sm font-medium",
|
|
7481
7485
|
children: [
|
|
@@ -7558,7 +7562,7 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7558
7562
|
const a = de("config"), s = (a == null ? void 0 : a.loaderColor) || "#333";
|
|
7559
7563
|
document.documentElement.style.setProperty("--loader-color", s);
|
|
7560
7564
|
}, []), /* @__PURE__ */ i("div", { className: n, children: /* @__PURE__ */ i("span", { className: "loader" }) });
|
|
7561
|
-
}, ds = se.lazy(() => import("./logic-flow-
|
|
7565
|
+
}, ds = se.lazy(() => import("./logic-flow-Hydh9htB.js"));
|
|
7562
7566
|
function us({
|
|
7563
7567
|
questionData: e,
|
|
7564
7568
|
uploadUrl: n,
|
|
@@ -7566,16 +7570,16 @@ function us({
|
|
|
7566
7570
|
templates: s,
|
|
7567
7571
|
viewMode: o = "canvas"
|
|
7568
7572
|
}) {
|
|
7569
|
-
const { setFormData: l, addSection: d, setUploadUrl: u, showPreview: t, formData:
|
|
7573
|
+
const { setFormData: l, addSection: d, setUploadUrl: u, showPreview: t, formData: r } = ye(be);
|
|
7570
7574
|
G(() => {
|
|
7571
7575
|
e && e.length > 0 && l(e);
|
|
7572
7576
|
}, [e, l]), G(() => {
|
|
7573
7577
|
u(n);
|
|
7574
7578
|
}, [n, u]);
|
|
7575
|
-
const
|
|
7576
|
-
|
|
7579
|
+
const m = Y((c) => {
|
|
7580
|
+
c.preventDefault();
|
|
7577
7581
|
try {
|
|
7578
|
-
const h = JSON.parse(
|
|
7582
|
+
const h = JSON.parse(c.dataTransfer.getData("properties"));
|
|
7579
7583
|
if ((h == null ? void 0 : h.type) === "section") {
|
|
7580
7584
|
d();
|
|
7581
7585
|
return;
|
|
@@ -7588,10 +7592,10 @@ function us({
|
|
|
7588
7592
|
/* @__PURE__ */ i(
|
|
7589
7593
|
"div",
|
|
7590
7594
|
{
|
|
7591
|
-
onDragOver: (
|
|
7592
|
-
onDrop: (
|
|
7595
|
+
onDragOver: (c) => c.preventDefault(),
|
|
7596
|
+
onDrop: (c) => m(c),
|
|
7593
7597
|
className: " h-full overflow-y-auto no-scrollbar max-h-[calc(100vh-80px)] flex-1 form_builder",
|
|
7594
|
-
children: o === "canvas" ? /* @__PURE__ */ i(ss, { onAddTemplate: a, templates: s }) : /* @__PURE__ */ i(Sn, { fallback: /* @__PURE__ */ i(Bi, { loadingClass: "!w-full !h-full" }), children: /* @__PURE__ */ i(ds, { formData:
|
|
7598
|
+
children: o === "canvas" ? /* @__PURE__ */ i(ss, { onAddTemplate: a, templates: s }) : /* @__PURE__ */ i(Sn, { fallback: /* @__PURE__ */ i(Bi, { loadingClass: "!w-full !h-full" }), children: /* @__PURE__ */ i(ds, { formData: r }) })
|
|
7595
7599
|
}
|
|
7596
7600
|
),
|
|
7597
7601
|
o === "canvas" && /* @__PURE__ */ i(
|
|
@@ -7620,38 +7624,38 @@ const ri = [
|
|
|
7620
7624
|
{ key: "advancedData", title: "Advanced / Data" }
|
|
7621
7625
|
], ts = () => {
|
|
7622
7626
|
const [e, n] = D(""), { setIsDragging: a, addElement: s, selectedSection: o } = ye(be), l = Y(
|
|
7623
|
-
(
|
|
7627
|
+
(p, y) => {
|
|
7624
7628
|
if (!o) {
|
|
7625
7629
|
xe.error("Please select a section to add an element.");
|
|
7626
7630
|
return;
|
|
7627
7631
|
}
|
|
7628
|
-
|
|
7632
|
+
p.dataTransfer.setData("properties", JSON.stringify(y)), p.dataTransfer.effectAllowed = "move", a(!0);
|
|
7629
7633
|
},
|
|
7630
7634
|
[a, o]
|
|
7631
7635
|
);
|
|
7632
|
-
function d(
|
|
7636
|
+
function d(p) {
|
|
7633
7637
|
if (!o) {
|
|
7634
7638
|
xe.error("Please select a section to add an element.");
|
|
7635
7639
|
return;
|
|
7636
7640
|
}
|
|
7637
7641
|
const y = {
|
|
7638
|
-
...
|
|
7642
|
+
...p,
|
|
7639
7643
|
id: pe(),
|
|
7640
7644
|
sectionId: o
|
|
7641
7645
|
};
|
|
7642
7646
|
s(y, o);
|
|
7643
7647
|
}
|
|
7644
|
-
const u = de("config") || {}, t = u.elementColor,
|
|
7645
|
-
(
|
|
7646
|
-
), h = ri == null ? void 0 : ri.map((
|
|
7647
|
-
title:
|
|
7648
|
-
elements:
|
|
7648
|
+
const u = de("config") || {}, t = u.elementColor, r = u.elementBgColor, m = u.elementBorderColor, c = eo.filter(
|
|
7649
|
+
(p) => p.label.toLowerCase().includes(e.toLowerCase())
|
|
7650
|
+
), h = ri == null ? void 0 : ri.map((p) => ({
|
|
7651
|
+
title: p.title,
|
|
7652
|
+
elements: c.filter(
|
|
7649
7653
|
(y) => {
|
|
7650
|
-
var
|
|
7651
|
-
return (
|
|
7654
|
+
var g;
|
|
7655
|
+
return (g = io[p.key]) == null ? void 0 : g.includes(y.type);
|
|
7652
7656
|
}
|
|
7653
7657
|
)
|
|
7654
|
-
})).filter((
|
|
7658
|
+
})).filter((p) => p.elements.length > 0);
|
|
7655
7659
|
return /* @__PURE__ */ b("div", { className: "pt-4 flex flex-col gap-y-6", children: [
|
|
7656
7660
|
/* @__PURE__ */ i("div", { className: "px-5", children: /* @__PURE__ */ i(
|
|
7657
7661
|
"input",
|
|
@@ -7659,24 +7663,24 @@ const ri = [
|
|
|
7659
7663
|
className: "field-control",
|
|
7660
7664
|
placeholder: "Search",
|
|
7661
7665
|
value: e,
|
|
7662
|
-
onChange: (
|
|
7666
|
+
onChange: (p) => n(p.target.value),
|
|
7663
7667
|
name: "search",
|
|
7664
7668
|
id: "search"
|
|
7665
7669
|
}
|
|
7666
7670
|
) }),
|
|
7667
|
-
/* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto no-scrollbar max-h-[calc(100vh-100px)]", children: /* @__PURE__ */ i("ul", { className: "grid gap-y-5 mt-3 px-5 ", children: h == null ? void 0 : h.map((
|
|
7668
|
-
var
|
|
7671
|
+
/* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto no-scrollbar max-h-[calc(100vh-100px)]", children: /* @__PURE__ */ i("ul", { className: "grid gap-y-5 mt-3 px-5 ", children: h == null ? void 0 : h.map((p, y) => {
|
|
7672
|
+
var g;
|
|
7669
7673
|
return /* @__PURE__ */ b("li", { children: [
|
|
7670
|
-
/* @__PURE__ */ i("h4", { className: "mb-2 text-[11px] font-bold text-gray-500 uppercase", children:
|
|
7671
|
-
/* @__PURE__ */ i("ul", { className: "grid grid-cols-2 gap-y-3 gap-x-4 mb-3", children: (
|
|
7674
|
+
/* @__PURE__ */ i("h4", { className: "mb-2 text-[11px] font-bold text-gray-500 uppercase", children: p.title }),
|
|
7675
|
+
/* @__PURE__ */ i("ul", { className: "grid grid-cols-2 gap-y-3 gap-x-4 mb-3", children: (g = p.elements) == null ? void 0 : g.map((f) => /* @__PURE__ */ i(
|
|
7672
7676
|
"li",
|
|
7673
7677
|
{
|
|
7674
|
-
onDragStart: (
|
|
7678
|
+
onDragStart: (v) => l(v, f),
|
|
7675
7679
|
onDragEnd: () => a(!1),
|
|
7676
|
-
onClick: () => d(
|
|
7680
|
+
onClick: () => d(f),
|
|
7677
7681
|
style: {
|
|
7678
|
-
borderColor:
|
|
7679
|
-
backgroundColor:
|
|
7682
|
+
borderColor: m,
|
|
7683
|
+
backgroundColor: r
|
|
7680
7684
|
},
|
|
7681
7685
|
className: `cursor-move text-[#475467] flex justify-between items-center \r
|
|
7682
7686
|
border-[1.5px] border-[#98A2B3] rounded-lg py-2 px-2 shadow-custom\r
|
|
@@ -7684,18 +7688,18 @@ const ri = [
|
|
|
7684
7688
|
active:opacity-50 element_class`,
|
|
7685
7689
|
draggable: !0,
|
|
7686
7690
|
children: /* @__PURE__ */ b("span", { className: "flex flex-col items-center justify-center w-full gap-2", children: [
|
|
7687
|
-
/* @__PURE__ */ i("span", { style: { color: t }, children: /* @__PURE__ */ i(J, { icon:
|
|
7691
|
+
/* @__PURE__ */ i("span", { style: { color: t }, children: /* @__PURE__ */ i(J, { icon: f.icon, iconClass: "w-6 h-6" }) }),
|
|
7688
7692
|
/* @__PURE__ */ i(
|
|
7689
7693
|
"span",
|
|
7690
7694
|
{
|
|
7691
7695
|
style: { color: t },
|
|
7692
7696
|
className: "text-xs font-medium text-center",
|
|
7693
|
-
children:
|
|
7697
|
+
children: f.label
|
|
7694
7698
|
}
|
|
7695
7699
|
)
|
|
7696
7700
|
] })
|
|
7697
7701
|
},
|
|
7698
|
-
|
|
7702
|
+
f.type
|
|
7699
7703
|
)) })
|
|
7700
7704
|
] }, y);
|
|
7701
7705
|
}) }) })
|
|
@@ -7710,12 +7714,12 @@ const ri = [
|
|
|
7710
7714
|
iconClass: d = "text-[20px]",
|
|
7711
7715
|
loadingClass: u = "",
|
|
7712
7716
|
link: t = "",
|
|
7713
|
-
div:
|
|
7714
|
-
type:
|
|
7715
|
-
style:
|
|
7717
|
+
div: r = !1,
|
|
7718
|
+
type: m = "button",
|
|
7719
|
+
style: c,
|
|
7716
7720
|
onClick: h
|
|
7717
7721
|
}) => {
|
|
7718
|
-
const
|
|
7722
|
+
const p = q(
|
|
7719
7723
|
"btn inline-flex justify-center",
|
|
7720
7724
|
{
|
|
7721
7725
|
"pointer-events-none": a,
|
|
@@ -7759,15 +7763,15 @@ const ri = [
|
|
|
7759
7763
|
e && /* @__PURE__ */ i("span", { children: e }),
|
|
7760
7764
|
o && l === "right" && /* @__PURE__ */ i("span", { className: `ml-[6px] ${d}`, children: /* @__PURE__ */ i(J, { icon: o }) })
|
|
7761
7765
|
] });
|
|
7762
|
-
return
|
|
7766
|
+
return r ? /* @__PURE__ */ i("div", { className: p, children: y() }) : t ? /* @__PURE__ */ i(Dn, { to: t, className: p, children: y() }) : /* @__PURE__ */ i(
|
|
7763
7767
|
"button",
|
|
7764
7768
|
{
|
|
7765
7769
|
disabled: n,
|
|
7766
|
-
type:
|
|
7767
|
-
className:
|
|
7770
|
+
type: m,
|
|
7771
|
+
className: p,
|
|
7768
7772
|
"data-testid": "btn",
|
|
7769
7773
|
onClick: h,
|
|
7770
|
-
style:
|
|
7774
|
+
style: c,
|
|
7771
7775
|
children: y()
|
|
7772
7776
|
}
|
|
7773
7777
|
);
|
|
@@ -7875,33 +7879,33 @@ function vs({
|
|
|
7875
7879
|
publishLoading: d,
|
|
7876
7880
|
onTitleChange: u,
|
|
7877
7881
|
viewMode: t,
|
|
7878
|
-
setViewMode:
|
|
7879
|
-
onShowVersion:
|
|
7882
|
+
setViewMode: r,
|
|
7883
|
+
onShowVersion: m
|
|
7880
7884
|
}) {
|
|
7881
7885
|
const {
|
|
7882
|
-
formData:
|
|
7886
|
+
formData: c,
|
|
7883
7887
|
setShowPreview: h,
|
|
7884
|
-
showPreview:
|
|
7888
|
+
showPreview: p,
|
|
7885
7889
|
undo: y,
|
|
7886
|
-
redo:
|
|
7887
|
-
canUndo:
|
|
7888
|
-
canRedo:
|
|
7890
|
+
redo: g,
|
|
7891
|
+
canUndo: f,
|
|
7892
|
+
canRedo: v
|
|
7889
7893
|
} = ye(be), [N, A] = D(!1), [k, x] = D(!1), [C, M] = D(e || ""), w = de("config");
|
|
7890
7894
|
function S() {
|
|
7891
7895
|
try {
|
|
7892
|
-
localStorage.setItem("formData", JSON.stringify(
|
|
7896
|
+
localStorage.setItem("formData", JSON.stringify(c));
|
|
7893
7897
|
} catch (E) {
|
|
7894
7898
|
console.warn("Could not save formData to localStorage", E);
|
|
7895
7899
|
}
|
|
7896
|
-
a == null || a(
|
|
7900
|
+
a == null || a(c);
|
|
7897
7901
|
}
|
|
7898
7902
|
function T() {
|
|
7899
7903
|
try {
|
|
7900
|
-
localStorage.setItem("formData", JSON.stringify(
|
|
7904
|
+
localStorage.setItem("formData", JSON.stringify(c));
|
|
7901
7905
|
} catch (E) {
|
|
7902
7906
|
console.warn("Could not save formData to localStorage", E);
|
|
7903
7907
|
}
|
|
7904
|
-
s == null || s(
|
|
7908
|
+
s == null || s(c);
|
|
7905
7909
|
}
|
|
7906
7910
|
function I() {
|
|
7907
7911
|
x(!1), u && C !== e && u(C.trim());
|
|
@@ -7948,14 +7952,14 @@ function vs({
|
|
|
7948
7952
|
}
|
|
7949
7953
|
),
|
|
7950
7954
|
/* @__PURE__ */ b("div", { className: "flex justify-end text-xs gap-x-3 items-center", children: [
|
|
7951
|
-
|
|
7955
|
+
r && /* @__PURE__ */ b("div", { className: "flex border border-gray-300 rounded-lg overflow-hidden h-[36px] text-sm font-medium shadow-sm mr-2", children: [
|
|
7952
7956
|
/* @__PURE__ */ b(
|
|
7953
7957
|
"button",
|
|
7954
7958
|
{
|
|
7955
7959
|
type: "button",
|
|
7956
7960
|
style: { color: (w == null ? void 0 : w.buttonColor) || "#333" },
|
|
7957
7961
|
className: `px-3 flex items-center gap-1.5 transition-colors canvas_view ${t === "canvas" ? "bg-white font-medium" : "bg-gray-100 text-gray-500 hover:bg-gray-50"}`,
|
|
7958
|
-
onClick: () =>
|
|
7962
|
+
onClick: () => r("canvas"),
|
|
7959
7963
|
children: [
|
|
7960
7964
|
/* @__PURE__ */ i(
|
|
7961
7965
|
J,
|
|
@@ -7975,7 +7979,7 @@ function vs({
|
|
|
7975
7979
|
type: "button",
|
|
7976
7980
|
style: { color: (w == null ? void 0 : w.buttonColor) || "#333" },
|
|
7977
7981
|
className: `px-3 flex items-center gap-1.5 border-l border-gray-300 transition-colors flow_view ${t === "flow" ? " bg-white font-medium" : "bg-gray-100 text-gray-500 hover:bg-gray-50"}`,
|
|
7978
|
-
onClick: () =>
|
|
7982
|
+
onClick: () => r("flow"),
|
|
7979
7983
|
children: [
|
|
7980
7984
|
/* @__PURE__ */ i(J, { icon: "mdi:sitemap-outline", iconClass: "text-base" }),
|
|
7981
7985
|
" Flow"
|
|
@@ -7988,29 +7992,29 @@ function vs({
|
|
|
7988
7992
|
{
|
|
7989
7993
|
onClick: y,
|
|
7990
7994
|
text: "",
|
|
7991
|
-
btnClass: `!px-2 bg-transparent undo ${
|
|
7995
|
+
btnClass: `!px-2 bg-transparent undo ${f ? "" : "opacity-50"}`,
|
|
7992
7996
|
icon: "material-symbols:undo",
|
|
7993
7997
|
iconClass: "text-xl !mr-0",
|
|
7994
7998
|
style: { color: (w == null ? void 0 : w.buttonColor) || "#333" },
|
|
7995
|
-
isDisabled: !
|
|
7999
|
+
isDisabled: !f
|
|
7996
8000
|
}
|
|
7997
8001
|
),
|
|
7998
8002
|
/* @__PURE__ */ i(
|
|
7999
8003
|
Ce,
|
|
8000
8004
|
{
|
|
8001
|
-
onClick:
|
|
8005
|
+
onClick: g,
|
|
8002
8006
|
text: "",
|
|
8003
|
-
btnClass: `!px-2 bg-transparent redo ${
|
|
8007
|
+
btnClass: `!px-2 bg-transparent redo ${v ? "" : "opacity-50"}`,
|
|
8004
8008
|
icon: "material-symbols:redo",
|
|
8005
8009
|
iconClass: "text-xl !mr-0",
|
|
8006
8010
|
style: { color: (w == null ? void 0 : w.buttonColor) || "#333" },
|
|
8007
|
-
isDisabled: !
|
|
8011
|
+
isDisabled: !v
|
|
8008
8012
|
}
|
|
8009
8013
|
),
|
|
8010
|
-
|
|
8014
|
+
m && /* @__PURE__ */ i(
|
|
8011
8015
|
Ce,
|
|
8012
8016
|
{
|
|
8013
|
-
onClick:
|
|
8017
|
+
onClick: m,
|
|
8014
8018
|
text: "Versions",
|
|
8015
8019
|
btnClass: "px-2 bg-transparent font-medium text-sm version_btn",
|
|
8016
8020
|
icon: "tabler:history",
|
|
@@ -8022,9 +8026,9 @@ function vs({
|
|
|
8022
8026
|
Ce,
|
|
8023
8027
|
{
|
|
8024
8028
|
onClick: () => h((E) => !E),
|
|
8025
|
-
text:
|
|
8029
|
+
text: p ? "Hide Preview" : "Preview",
|
|
8026
8030
|
btnClass: "px-2 bg-transparent font-medium text-sm form_preview",
|
|
8027
|
-
icon:
|
|
8031
|
+
icon: p ? "iconamoon:eye-off-duotone" : "solar:eye-bold-duotone",
|
|
8028
8032
|
iconClass: "text-base",
|
|
8029
8033
|
style: { color: (w == null ? void 0 : w.buttonColor) || "#333" },
|
|
8030
8034
|
isDisabled: o,
|
|
@@ -8068,20 +8072,20 @@ function ps({
|
|
|
8068
8072
|
loading: d,
|
|
8069
8073
|
onPublish: u,
|
|
8070
8074
|
previewLoading: t,
|
|
8071
|
-
saveLoading:
|
|
8072
|
-
publishLoading:
|
|
8073
|
-
onTitleChange:
|
|
8075
|
+
saveLoading: r,
|
|
8076
|
+
publishLoading: m,
|
|
8077
|
+
onTitleChange: c,
|
|
8074
8078
|
uploadUrl: h,
|
|
8075
|
-
onAddTemplate:
|
|
8079
|
+
onAddTemplate: p,
|
|
8076
8080
|
templates: y,
|
|
8077
|
-
onShowVersion:
|
|
8081
|
+
onShowVersion: g
|
|
8078
8082
|
}) {
|
|
8079
|
-
const [
|
|
8083
|
+
const [f, v] = D("canvas");
|
|
8080
8084
|
return /* @__PURE__ */ b(Qi, { onChange: n, onLogAction: a, children: [
|
|
8081
8085
|
/* @__PURE__ */ i($i, { position: "top-right", richColors: !0, closeButton: !0 }),
|
|
8082
8086
|
/* @__PURE__ */ i("div", { className: "w-full h-full bg-[#F8F9FC] flex flex-col", children: /* @__PURE__ */ b("div", { className: "flex flex-1 ", children: [
|
|
8083
|
-
|
|
8084
|
-
/* @__PURE__ */ b("div", { className: `flex-1 h-full max-h-full z-[1] ${
|
|
8087
|
+
f === "canvas" && /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i("div", { className: "w-[250px] h-screen border-r border-[#E4E7EC] bg-white ", children: /* @__PURE__ */ i(cs, {}) }) }),
|
|
8088
|
+
/* @__PURE__ */ b("div", { className: `flex-1 h-full max-h-full z-[1] ${f === "canvas" ? "w-[calc(100%-250px)]" : "w-full"}`, children: [
|
|
8085
8089
|
/* @__PURE__ */ i("div", { className: " h-[70px]", children: /* @__PURE__ */ i(
|
|
8086
8090
|
vs,
|
|
8087
8091
|
{
|
|
@@ -8090,12 +8094,12 @@ function ps({
|
|
|
8090
8094
|
onSubmit: e,
|
|
8091
8095
|
onPublish: u,
|
|
8092
8096
|
previewLoading: t,
|
|
8093
|
-
saveLoading:
|
|
8094
|
-
publishLoading:
|
|
8095
|
-
onTitleChange:
|
|
8096
|
-
viewMode:
|
|
8097
|
-
setViewMode:
|
|
8098
|
-
onShowVersion:
|
|
8097
|
+
saveLoading: r,
|
|
8098
|
+
publishLoading: m,
|
|
8099
|
+
onTitleChange: c,
|
|
8100
|
+
viewMode: f,
|
|
8101
|
+
setViewMode: v,
|
|
8102
|
+
onShowVersion: g
|
|
8099
8103
|
}
|
|
8100
8104
|
) }),
|
|
8101
8105
|
/* @__PURE__ */ i("div", { className: "p-6 h-[calc(100vh-70px)]", children: d ? /* @__PURE__ */ i(Bi, { loadingClass: "!w-full !h-[800px]" }) : /* @__PURE__ */ i(
|
|
@@ -8103,9 +8107,9 @@ function ps({
|
|
|
8103
8107
|
{
|
|
8104
8108
|
questionData: s,
|
|
8105
8109
|
uploadUrl: h,
|
|
8106
|
-
onAddTemplate:
|
|
8110
|
+
onAddTemplate: p,
|
|
8107
8111
|
templates: y,
|
|
8108
|
-
viewMode:
|
|
8112
|
+
viewMode: f
|
|
8109
8113
|
}
|
|
8110
8114
|
) })
|
|
8111
8115
|
] })
|
|
@@ -8124,15 +8128,15 @@ const Hs = ({
|
|
|
8124
8128
|
title: d,
|
|
8125
8129
|
loading: u,
|
|
8126
8130
|
goBackUrl: t,
|
|
8127
|
-
onPublish:
|
|
8128
|
-
previewLoading:
|
|
8129
|
-
saveLoading:
|
|
8131
|
+
onPublish: r,
|
|
8132
|
+
previewLoading: m,
|
|
8133
|
+
saveLoading: c,
|
|
8130
8134
|
publishLoading: h,
|
|
8131
|
-
onTitleChange:
|
|
8135
|
+
onTitleChange: p,
|
|
8132
8136
|
uploadUrl: y,
|
|
8133
|
-
onAddTemplate:
|
|
8134
|
-
templates:
|
|
8135
|
-
onShowVersion:
|
|
8137
|
+
onAddTemplate: g,
|
|
8138
|
+
templates: f,
|
|
8139
|
+
onShowVersion: v
|
|
8136
8140
|
}) => (G(() => {
|
|
8137
8141
|
l && hn("config", l);
|
|
8138
8142
|
}, [l]), /* @__PURE__ */ i(
|
|
@@ -8141,20 +8145,20 @@ const Hs = ({
|
|
|
8141
8145
|
onSubmit: e,
|
|
8142
8146
|
onChange: n,
|
|
8143
8147
|
onLogAction: a,
|
|
8144
|
-
onPublish:
|
|
8148
|
+
onPublish: r,
|
|
8145
8149
|
questionData: s,
|
|
8146
8150
|
isReadOnly: o,
|
|
8147
8151
|
title: d,
|
|
8148
8152
|
goBackUrl: t,
|
|
8149
8153
|
loading: u,
|
|
8150
|
-
previewLoading:
|
|
8151
|
-
saveLoading:
|
|
8154
|
+
previewLoading: m,
|
|
8155
|
+
saveLoading: c,
|
|
8152
8156
|
publishLoading: h,
|
|
8153
|
-
onTitleChange:
|
|
8157
|
+
onTitleChange: p,
|
|
8154
8158
|
uploadUrl: y,
|
|
8155
|
-
onAddTemplate:
|
|
8156
|
-
templates:
|
|
8157
|
-
onShowVersion:
|
|
8159
|
+
onAddTemplate: g,
|
|
8160
|
+
templates: f,
|
|
8161
|
+
onShowVersion: v
|
|
8158
8162
|
}
|
|
8159
8163
|
)), Te = {
|
|
8160
8164
|
required: "This field is required",
|
|
@@ -8235,19 +8239,19 @@ function xs({ formData: e, isReadOnly: n, answerData: a }) {
|
|
|
8235
8239
|
o == null || o.forEach((l) => {
|
|
8236
8240
|
if (!Ei(l, a))
|
|
8237
8241
|
return;
|
|
8238
|
-
const { id: d, type: u, isRequired: t, requiredMessage:
|
|
8239
|
-
let
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
), u === "textField" || u === "longText" || u === "email" || u === "url" ?
|
|
8245
|
-
|
|
8242
|
+
const { id: d, type: u, isRequired: t, requiredMessage: r, isDisabled: m } = l;
|
|
8243
|
+
let c = hs(u, n);
|
|
8244
|
+
c = gs(
|
|
8245
|
+
c,
|
|
8246
|
+
m || n ? !1 : t,
|
|
8247
|
+
r
|
|
8248
|
+
), u === "textField" || u === "longText" || u === "email" || u === "url" ? c = fs(
|
|
8249
|
+
c,
|
|
8246
8250
|
l
|
|
8247
|
-
) : (u === "numberField" || u === "amountField") && (
|
|
8248
|
-
|
|
8251
|
+
) : (u === "numberField" || u === "amountField") && (c = ys(
|
|
8252
|
+
c,
|
|
8249
8253
|
l
|
|
8250
|
-
)), s[d] =
|
|
8254
|
+
)), s[d] = c;
|
|
8251
8255
|
});
|
|
8252
8256
|
}), R.object().shape(s);
|
|
8253
8257
|
}
|
|
@@ -8285,7 +8289,7 @@ const Oe = ({ element: e, validationData: n }) => {
|
|
|
8285
8289
|
}, Ge = (e, n) => e != null && e.allowEdit ? { ...n, isReadOnly: !1 } : n;
|
|
8286
8290
|
function Ss({ form_data: e, options: n }) {
|
|
8287
8291
|
const a = (o, l) => /* @__PURE__ */ i("div", { className: "min-w-0", children: /* @__PURE__ */ i(ei, { element: o, customClass: "p-0 min-h-[60px] border-none", children: l == null ? void 0 : l.map((d) => {
|
|
8288
|
-
var u, t,
|
|
8292
|
+
var u, t, r;
|
|
8289
8293
|
return /* @__PURE__ */ b(
|
|
8290
8294
|
Xe,
|
|
8291
8295
|
{
|
|
@@ -8299,7 +8303,7 @@ function Ss({ form_data: e, options: n }) {
|
|
|
8299
8303
|
validationData: Ge(d, n)
|
|
8300
8304
|
}
|
|
8301
8305
|
),
|
|
8302
|
-
((
|
|
8306
|
+
((r = (t = n == null ? void 0 : n.errors) == null ? void 0 : t[d.id]) == null ? void 0 : r.message) && /* @__PURE__ */ i("div", { className: "mt-1 text-xs text-red-600", children: n.errors[d.id].message })
|
|
8303
8307
|
]
|
|
8304
8308
|
},
|
|
8305
8309
|
d.id
|
|
@@ -8347,35 +8351,35 @@ function Ss({ form_data: e, options: n }) {
|
|
|
8347
8351
|
function As({ form_data: e, options: n, current: a }) {
|
|
8348
8352
|
var s, o;
|
|
8349
8353
|
return /* @__PURE__ */ i("div", { className: "grid gap-y-3 multi_section__content min-w-0", children: (o = (s = e[a]) == null ? void 0 : s.questionData) == null ? void 0 : o.map((l) => {
|
|
8350
|
-
var d, u, t,
|
|
8354
|
+
var d, u, t, r;
|
|
8351
8355
|
if (l.type === "grid") {
|
|
8352
|
-
const
|
|
8353
|
-
(
|
|
8356
|
+
const m = (u = (d = e[a]) == null ? void 0 : d.questionData) == null ? void 0 : u.filter(
|
|
8357
|
+
(c) => c.gridId === l.id
|
|
8354
8358
|
);
|
|
8355
8359
|
return /* @__PURE__ */ i("div", { className: "min-w-0", children: /* @__PURE__ */ i(
|
|
8356
8360
|
ei,
|
|
8357
8361
|
{
|
|
8358
8362
|
element: l,
|
|
8359
8363
|
customClass: "p-0 min-h-[60px] border-none",
|
|
8360
|
-
children:
|
|
8361
|
-
var h,
|
|
8364
|
+
children: m == null ? void 0 : m.map((c) => {
|
|
8365
|
+
var h, p, y;
|
|
8362
8366
|
return /* @__PURE__ */ b(
|
|
8363
8367
|
Xe,
|
|
8364
8368
|
{
|
|
8365
|
-
col: (h =
|
|
8369
|
+
col: (h = c.gridPosition) == null ? void 0 : h.col,
|
|
8366
8370
|
customClass: "p-0",
|
|
8367
8371
|
children: [
|
|
8368
8372
|
/* @__PURE__ */ i(
|
|
8369
8373
|
Oe,
|
|
8370
8374
|
{
|
|
8371
|
-
element:
|
|
8372
|
-
validationData: Ge(
|
|
8375
|
+
element: c,
|
|
8376
|
+
validationData: Ge(c, n)
|
|
8373
8377
|
}
|
|
8374
8378
|
),
|
|
8375
|
-
/* @__PURE__ */ i("div", { className: "mt-1 text-xs text-red-600", children: (y = (
|
|
8379
|
+
/* @__PURE__ */ i("div", { className: "mt-1 text-xs text-red-600", children: (y = (p = n == null ? void 0 : n.errors) == null ? void 0 : p[c.id]) == null ? void 0 : y.message })
|
|
8376
8380
|
]
|
|
8377
8381
|
},
|
|
8378
|
-
|
|
8382
|
+
c.id
|
|
8379
8383
|
);
|
|
8380
8384
|
})
|
|
8381
8385
|
}
|
|
@@ -8396,7 +8400,7 @@ function As({ form_data: e, options: n, current: a }) {
|
|
|
8396
8400
|
validationData: Ge(l, n)
|
|
8397
8401
|
}
|
|
8398
8402
|
),
|
|
8399
|
-
/* @__PURE__ */ i("div", { className: "mt-1 text-xs text-red-600", children: (
|
|
8403
|
+
/* @__PURE__ */ i("div", { className: "mt-1 text-xs text-red-600", children: (r = (t = n == null ? void 0 : n.errors) == null ? void 0 : t[l.id]) == null ? void 0 : r.message })
|
|
8400
8404
|
]
|
|
8401
8405
|
},
|
|
8402
8406
|
l.id
|
|
@@ -8407,21 +8411,21 @@ const mi = de("config");
|
|
|
8407
8411
|
function Ns({ element: e, options: n, onNext: a, onPrev: s, isFirst: o, isLast: l, isReadOnly: d }) {
|
|
8408
8412
|
if (!e)
|
|
8409
8413
|
return /* @__PURE__ */ i("div", { className: "flex items-center justify-center min-h-[500px] text-gray-500", children: "No questions available." });
|
|
8410
|
-
const u = (
|
|
8411
|
-
|
|
8412
|
-
}, t = (
|
|
8413
|
-
var
|
|
8414
|
+
const u = (m) => {
|
|
8415
|
+
m.key === "Enter" && !m.shiftKey && (m.preventDefault(), a());
|
|
8416
|
+
}, t = (m) => {
|
|
8417
|
+
var c;
|
|
8414
8418
|
return /* @__PURE__ */ i("div", { className: "min-w-0 w-full", children: /* @__PURE__ */ i(
|
|
8415
8419
|
ei,
|
|
8416
8420
|
{
|
|
8417
|
-
element:
|
|
8421
|
+
element: m,
|
|
8418
8422
|
customClass: "p-0 min-h-[60px] border-none w-full",
|
|
8419
|
-
children: (
|
|
8420
|
-
var
|
|
8423
|
+
children: (c = m.gridChildren) == null ? void 0 : c.map((h) => {
|
|
8424
|
+
var p, y, g;
|
|
8421
8425
|
return /* @__PURE__ */ b(
|
|
8422
8426
|
Xe,
|
|
8423
8427
|
{
|
|
8424
|
-
col: (
|
|
8428
|
+
col: (p = h.gridPosition) == null ? void 0 : p.col,
|
|
8425
8429
|
customClass: "p-0",
|
|
8426
8430
|
children: [
|
|
8427
8431
|
/* @__PURE__ */ i(
|
|
@@ -8431,32 +8435,32 @@ function Ns({ element: e, options: n, onNext: a, onPrev: s, isFirst: o, isLast:
|
|
|
8431
8435
|
validationData: Ge(h, n)
|
|
8432
8436
|
}
|
|
8433
8437
|
),
|
|
8434
|
-
((
|
|
8438
|
+
((g = (y = n == null ? void 0 : n.errors) == null ? void 0 : y[h.id]) == null ? void 0 : g.message) && /* @__PURE__ */ i("div", { className: "mt-1 text-xs text-red-600", children: n.errors[h.id].message })
|
|
8435
8439
|
]
|
|
8436
8440
|
},
|
|
8437
8441
|
h.id
|
|
8438
8442
|
);
|
|
8439
8443
|
})
|
|
8440
8444
|
}
|
|
8441
|
-
) },
|
|
8442
|
-
},
|
|
8443
|
-
var
|
|
8445
|
+
) }, m.id);
|
|
8446
|
+
}, r = (m) => {
|
|
8447
|
+
var c, h;
|
|
8444
8448
|
return /* @__PURE__ */ b(
|
|
8445
8449
|
"div",
|
|
8446
8450
|
{
|
|
8447
|
-
className: q("group relative grid gap-y-[6px] min-w-0 w-full",
|
|
8451
|
+
className: q("group relative grid gap-y-[6px] min-w-0 w-full", m.elementClass),
|
|
8448
8452
|
children: [
|
|
8449
8453
|
/* @__PURE__ */ i(
|
|
8450
8454
|
Oe,
|
|
8451
8455
|
{
|
|
8452
|
-
element:
|
|
8453
|
-
validationData: Ge(
|
|
8456
|
+
element: m,
|
|
8457
|
+
validationData: Ge(m, n)
|
|
8454
8458
|
}
|
|
8455
8459
|
),
|
|
8456
|
-
((h = (
|
|
8460
|
+
((h = (c = n == null ? void 0 : n.errors) == null ? void 0 : c[m.id]) == null ? void 0 : h.message) && /* @__PURE__ */ i("div", { className: "mt-1 text-xs text-red-600", children: n.errors[m.id].message })
|
|
8457
8461
|
]
|
|
8458
8462
|
},
|
|
8459
|
-
|
|
8463
|
+
m.id
|
|
8460
8464
|
);
|
|
8461
8465
|
};
|
|
8462
8466
|
return /* @__PURE__ */ i(
|
|
@@ -8479,7 +8483,7 @@ function Ns({ element: e, options: n, onNext: a, onPrev: s, isFirst: o, isLast:
|
|
|
8479
8483
|
leaveTo: "opacity-0 -translate-y-8",
|
|
8480
8484
|
className: "w-full max-w-2xl",
|
|
8481
8485
|
children: [
|
|
8482
|
-
/* @__PURE__ */ i("div", { className: "text-left w-full mb-8", children: e.type === "grid" ? t(e) :
|
|
8486
|
+
/* @__PURE__ */ i("div", { className: "text-left w-full mb-8", children: e.type === "grid" ? t(e) : r(e) }),
|
|
8483
8487
|
!d && /* @__PURE__ */ b("div", { className: "flex items-center gap-4 mt-8", children: [
|
|
8484
8488
|
/* @__PURE__ */ i(
|
|
8485
8489
|
Ce,
|
|
@@ -8518,10 +8522,10 @@ const ks = ({
|
|
|
8518
8522
|
renderType: d = "multi",
|
|
8519
8523
|
children: u,
|
|
8520
8524
|
hideFooter: t = !1,
|
|
8521
|
-
uploadUrl:
|
|
8525
|
+
uploadUrl: r
|
|
8522
8526
|
}) => {
|
|
8523
8527
|
var Be, Me, Ee, O, B, K, P, L, U, $;
|
|
8524
|
-
const { setAnswerData:
|
|
8528
|
+
const { setAnswerData: m, setUploadUrl: c, apiActivityCount: h } = ye(be), [p, y] = D(0), [g, f] = D(0), v = ee(
|
|
8525
8529
|
() => e.filter((j) => !j.isHidden).map((j) => {
|
|
8526
8530
|
var W;
|
|
8527
8531
|
return j.isDisabled || j.disabled ? {
|
|
@@ -8533,17 +8537,17 @@ const ks = ({
|
|
|
8533
8537
|
} : j;
|
|
8534
8538
|
}),
|
|
8535
8539
|
[e]
|
|
8536
|
-
), N = (Be =
|
|
8540
|
+
), N = (Be = v == null ? void 0 : v.length) != null ? Be : 0, A = de("config"), k = Y(
|
|
8537
8541
|
async (j, H, W) => {
|
|
8538
8542
|
const Q = xs({
|
|
8539
|
-
formData:
|
|
8543
|
+
formData: v,
|
|
8540
8544
|
isReadOnly: l,
|
|
8541
8545
|
answerData: j
|
|
8542
8546
|
// use current form data to evaluate visibility
|
|
8543
8547
|
});
|
|
8544
8548
|
return wi(Q)(j, H, W);
|
|
8545
8549
|
},
|
|
8546
|
-
[
|
|
8550
|
+
[v, l]
|
|
8547
8551
|
), x = Si({
|
|
8548
8552
|
resolver: k,
|
|
8549
8553
|
mode: "onSubmit",
|
|
@@ -8566,7 +8570,7 @@ const ks = ({
|
|
|
8566
8570
|
), ce = ee(() => {
|
|
8567
8571
|
if (d !== "conversational") return [];
|
|
8568
8572
|
const j = [];
|
|
8569
|
-
return
|
|
8573
|
+
return v.forEach((H) => {
|
|
8570
8574
|
var W;
|
|
8571
8575
|
(W = H == null ? void 0 : H.questionData) == null || W.forEach((Q) => {
|
|
8572
8576
|
var oe;
|
|
@@ -8579,17 +8583,17 @@ const ks = ({
|
|
|
8579
8583
|
} else Q.gridId || j.push(Q);
|
|
8580
8584
|
});
|
|
8581
8585
|
}), j;
|
|
8582
|
-
}, [
|
|
8586
|
+
}, [v, V, d]), Se = Y(
|
|
8583
8587
|
(j) => {
|
|
8584
8588
|
o && o(j);
|
|
8585
8589
|
},
|
|
8586
8590
|
[o]
|
|
8587
8591
|
);
|
|
8588
8592
|
G(() => {
|
|
8589
|
-
r
|
|
8590
|
-
}, [
|
|
8591
|
-
if (!(
|
|
8592
|
-
const j =
|
|
8593
|
+
c(r);
|
|
8594
|
+
}, [c, r]), G(() => {
|
|
8595
|
+
if (!(v != null && v.length) || !o) return;
|
|
8596
|
+
const j = v.flatMap(
|
|
8593
8597
|
(H) => {
|
|
8594
8598
|
var W;
|
|
8595
8599
|
return (W = H == null ? void 0 : H.questionData) == null ? void 0 : W.map((Q) => ({
|
|
@@ -8604,19 +8608,19 @@ const ks = ({
|
|
|
8604
8608
|
}));
|
|
8605
8609
|
}
|
|
8606
8610
|
);
|
|
8607
|
-
Se(j),
|
|
8611
|
+
Se(j), m(V);
|
|
8608
8612
|
}, [
|
|
8609
8613
|
V,
|
|
8610
|
-
|
|
8614
|
+
v,
|
|
8611
8615
|
Se,
|
|
8612
8616
|
o,
|
|
8613
|
-
|
|
8617
|
+
m
|
|
8614
8618
|
]), G(() => {
|
|
8615
8619
|
n != null && n.length && T(Cs(n));
|
|
8616
8620
|
}, [n, T]);
|
|
8617
8621
|
const ge = Y(
|
|
8618
8622
|
(j) => {
|
|
8619
|
-
const H =
|
|
8623
|
+
const H = v.flatMap(
|
|
8620
8624
|
(W) => {
|
|
8621
8625
|
var Q;
|
|
8622
8626
|
return (Q = W == null ? void 0 : W.questionData) == null ? void 0 : Q.map((oe) => ({
|
|
@@ -8633,31 +8637,31 @@ const ks = ({
|
|
|
8633
8637
|
);
|
|
8634
8638
|
Object.keys(F).length > 0 || s == null || s(H);
|
|
8635
8639
|
},
|
|
8636
|
-
[F,
|
|
8640
|
+
[F, v, s]
|
|
8637
8641
|
), ue = Y(async () => {
|
|
8638
8642
|
var j, H;
|
|
8639
8643
|
if (d === "conversational") {
|
|
8640
8644
|
if (!a) {
|
|
8641
|
-
const W = ce[
|
|
8645
|
+
const W = ce[g];
|
|
8642
8646
|
if (!W) return;
|
|
8643
8647
|
const Q = W.gridChildren ? W.gridChildren.map((le) => le.id) : [W.id];
|
|
8644
8648
|
if (!await ie(Q)) return;
|
|
8645
8649
|
}
|
|
8646
|
-
|
|
8650
|
+
g < ce.length - 1 ? f((W) => W + 1) : S(ge)();
|
|
8647
8651
|
return;
|
|
8648
8652
|
}
|
|
8649
8653
|
if (!a) {
|
|
8650
|
-
const W = (H = (j =
|
|
8654
|
+
const W = (H = (j = v == null ? void 0 : v[p]) == null ? void 0 : j.questionData) == null ? void 0 : H.map(
|
|
8651
8655
|
(oe) => oe.id
|
|
8652
8656
|
);
|
|
8653
8657
|
if (!await ie(W)) return;
|
|
8654
8658
|
}
|
|
8655
8659
|
y((W) => W + 1);
|
|
8656
8660
|
}, [
|
|
8657
|
-
v,
|
|
8658
|
-
f,
|
|
8659
|
-
ce,
|
|
8660
8661
|
p,
|
|
8662
|
+
g,
|
|
8663
|
+
ce,
|
|
8664
|
+
v,
|
|
8661
8665
|
a,
|
|
8662
8666
|
ie,
|
|
8663
8667
|
d,
|
|
@@ -8665,7 +8669,7 @@ const ks = ({
|
|
|
8665
8669
|
ge
|
|
8666
8670
|
]), Ae = Y(() => {
|
|
8667
8671
|
if (d === "conversational") {
|
|
8668
|
-
|
|
8672
|
+
f((j) => Math.max(0, j - 1));
|
|
8669
8673
|
return;
|
|
8670
8674
|
}
|
|
8671
8675
|
y((j) => j - 1);
|
|
@@ -8710,44 +8714,44 @@ const ks = ({
|
|
|
8710
8714
|
{
|
|
8711
8715
|
className: "multi_section__box min-w-0",
|
|
8712
8716
|
children: [
|
|
8713
|
-
d === "multi" && (((Me =
|
|
8714
|
-
((O = p
|
|
8715
|
-
((K = p
|
|
8717
|
+
d === "multi" && (((Me = v == null ? void 0 : v[p]) == null ? void 0 : Me.title) || ((Ee = v == null ? void 0 : v[p]) == null ? void 0 : Ee.description)) && /* @__PURE__ */ b("div", { className: "py-4 mb-4 border-b border-gray-100 multi_section__title", children: [
|
|
8718
|
+
((O = v[p]) == null ? void 0 : O.title) && /* @__PURE__ */ i("h2", { className: "text-lg font-semibold mb-[6px]", children: (B = v[p]) == null ? void 0 : B.title }),
|
|
8719
|
+
((K = v[p]) == null ? void 0 : K.description) && /* @__PURE__ */ i("p", { className: "text-sm", children: (P = v[p]) == null ? void 0 : P.description })
|
|
8716
8720
|
] }),
|
|
8717
8721
|
d === "multi" ? /* @__PURE__ */ i(
|
|
8718
8722
|
As,
|
|
8719
8723
|
{
|
|
8720
|
-
form_data:
|
|
8724
|
+
form_data: v,
|
|
8721
8725
|
options: ke,
|
|
8722
|
-
current:
|
|
8726
|
+
current: p
|
|
8723
8727
|
}
|
|
8724
8728
|
) : d === "conversational" ? /* @__PURE__ */ i(
|
|
8725
8729
|
Ns,
|
|
8726
8730
|
{
|
|
8727
|
-
element: ce[
|
|
8731
|
+
element: ce[g],
|
|
8728
8732
|
options: ke,
|
|
8729
8733
|
onNext: ue,
|
|
8730
8734
|
onPrev: Ae,
|
|
8731
|
-
isFirst:
|
|
8732
|
-
isLast:
|
|
8735
|
+
isFirst: g === 0,
|
|
8736
|
+
isLast: g === ce.length - 1,
|
|
8733
8737
|
isReadOnly: l
|
|
8734
8738
|
}
|
|
8735
8739
|
) : /* @__PURE__ */ i(
|
|
8736
8740
|
Ss,
|
|
8737
8741
|
{
|
|
8738
|
-
form_data:
|
|
8742
|
+
form_data: v,
|
|
8739
8743
|
options: ke
|
|
8740
8744
|
}
|
|
8741
8745
|
)
|
|
8742
8746
|
]
|
|
8743
8747
|
},
|
|
8744
|
-
d === "conversational" ? `conv-${
|
|
8748
|
+
d === "conversational" ? `conv-${g}` : (L = v == null ? void 0 : v[p]) == null ? void 0 : L.id
|
|
8745
8749
|
) }),
|
|
8746
8750
|
!t && d !== "conversational" && /* @__PURE__ */ i("footer", { className: "flex items-center justify-end gap-4 footer flex-wrap", children: d === "multi" ? /* @__PURE__ */ b(ve, { children: [
|
|
8747
8751
|
/* @__PURE__ */ b("div", { className: "flex gap-x-4 justify-between navigation_container w-full", children: [
|
|
8748
8752
|
/* @__PURE__ */ b("div", { children: [
|
|
8749
8753
|
" ",
|
|
8750
|
-
|
|
8754
|
+
p > 0 && /* @__PURE__ */ b(
|
|
8751
8755
|
"button",
|
|
8752
8756
|
{
|
|
8753
8757
|
type: "button",
|
|
@@ -8766,7 +8770,7 @@ const ks = ({
|
|
|
8766
8770
|
}
|
|
8767
8771
|
)
|
|
8768
8772
|
] }),
|
|
8769
|
-
|
|
8773
|
+
p < N - 1 && /* @__PURE__ */ i(
|
|
8770
8774
|
Ce,
|
|
8771
8775
|
{
|
|
8772
8776
|
type: "button",
|
|
@@ -8777,7 +8781,7 @@ const ks = ({
|
|
|
8777
8781
|
}
|
|
8778
8782
|
)
|
|
8779
8783
|
] }),
|
|
8780
|
-
(
|
|
8784
|
+
(p === N - 1 || l) && !a && ((U = typeof u == "function" ? u({ isUploading: h > 0, isSubmitting: Z, hasErrors: Object.keys(F).length > 0 }) : u) != null ? U : /* @__PURE__ */ i(
|
|
8781
8785
|
Ce,
|
|
8782
8786
|
{
|
|
8783
8787
|
isDisabled: Z || Object.keys(F).length > 0 || h > 0,
|
|
@@ -8804,7 +8808,7 @@ const ks = ({
|
|
|
8804
8808
|
{
|
|
8805
8809
|
className: "h-full bg-blue-600 transition-all duration-500 ease-out",
|
|
8806
8810
|
style: {
|
|
8807
|
-
width: `${(
|
|
8811
|
+
width: `${(g + 1) / ce.length * 100}%`,
|
|
8808
8812
|
background: (A == null ? void 0 : A.buttonColor) || "#2563EB"
|
|
8809
8813
|
}
|
|
8810
8814
|
}
|
|
@@ -8824,18 +8828,18 @@ function yn({
|
|
|
8824
8828
|
config: d = { buttonColor: "#333" },
|
|
8825
8829
|
renderType: u,
|
|
8826
8830
|
children: t,
|
|
8827
|
-
hideFooter:
|
|
8828
|
-
onGetValues:
|
|
8829
|
-
uploadUrl:
|
|
8831
|
+
hideFooter: r,
|
|
8832
|
+
onGetValues: m,
|
|
8833
|
+
uploadUrl: c
|
|
8830
8834
|
}) {
|
|
8831
8835
|
G(() => {
|
|
8832
8836
|
d && hn("config", d);
|
|
8833
8837
|
}, [d]);
|
|
8834
8838
|
const h = Y(
|
|
8835
|
-
(
|
|
8836
|
-
|
|
8839
|
+
(p) => {
|
|
8840
|
+
m && m(p);
|
|
8837
8841
|
},
|
|
8838
|
-
[
|
|
8842
|
+
[m]
|
|
8839
8843
|
);
|
|
8840
8844
|
return l ? /* @__PURE__ */ i(Bi, {}) : n ? /* @__PURE__ */ b("div", { className: "w-full h-full min-w-0", children: [
|
|
8841
8845
|
/* @__PURE__ */ i("div", { id: "root-portal" }),
|
|
@@ -8848,9 +8852,9 @@ function yn({
|
|
|
8848
8852
|
onSubmitData: s,
|
|
8849
8853
|
isReadOnly: o,
|
|
8850
8854
|
renderType: u,
|
|
8851
|
-
hideFooter:
|
|
8855
|
+
hideFooter: r,
|
|
8852
8856
|
onGetValues: h,
|
|
8853
|
-
uploadUrl:
|
|
8857
|
+
uploadUrl: c,
|
|
8854
8858
|
children: t
|
|
8855
8859
|
}
|
|
8856
8860
|
) })
|