@arudovwen/form-builder-react 1.4.51 → 1.4.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/form-builder.es.js +1000 -1023
- package/dist/form-builder.umd.js +14 -14
- package/dist/index.css +1 -1
- package/package.json +1 -1
package/dist/form-builder.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import mi, { createContext as mo, useState as P, useMemo as oi, useEffect as D, forwardRef as ye, createElement as Sn, Fragment as Zi, useContext as ji, useRef as Ci, useCallback as $, memo as an } from "react";
|
|
2
2
|
import { v4 as Ai } from "uuid";
|
|
3
3
|
import bo from "react-datepicker";
|
|
4
|
-
import { Listbox as di, Transition as
|
|
4
|
+
import { Listbox as di, Transition as Ei, Combobox as Ri, ComboboxInput as vo, ComboboxButton as ho, ComboboxOptions as po, ComboboxOption as go } from "@headlessui/react";
|
|
5
5
|
import { toast as ki, Toaster as Ae } from "sonner";
|
|
6
6
|
import Ii from "axios";
|
|
7
7
|
import sn from "react-currency-input-field";
|
|
@@ -28,11 +28,11 @@ function Co() {
|
|
|
28
28
|
ie = 1;
|
|
29
29
|
var i = mi, e = Symbol.for("react.element"), o = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, a = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
30
30
|
function u(t, d, r) {
|
|
31
|
-
var c, v = {}, h = null,
|
|
32
|
-
r !== void 0 && (h = "" + r), d.key !== void 0 && (h = "" + d.key), d.ref !== void 0 && (
|
|
31
|
+
var c, v = {}, h = null, b = null;
|
|
32
|
+
r !== void 0 && (h = "" + r), d.key !== void 0 && (h = "" + d.key), d.ref !== void 0 && (b = d.ref);
|
|
33
33
|
for (c in d) s.call(d, c) && !l.hasOwnProperty(c) && (v[c] = d[c]);
|
|
34
34
|
if (t && t.defaultProps) for (c in d = t.defaultProps, d) v[c] === void 0 && (v[c] = d[c]);
|
|
35
|
-
return { $$typeof: e, type: t, key: h, ref:
|
|
35
|
+
return { $$typeof: e, type: t, key: h, ref: b, props: v, _owner: a.current };
|
|
36
36
|
}
|
|
37
37
|
return Gi.Fragment = o, Gi.jsx = u, Gi.jsxs = u, Gi;
|
|
38
38
|
}
|
|
@@ -49,58 +49,58 @@ var Hi = {};
|
|
|
49
49
|
var ne;
|
|
50
50
|
function Mo() {
|
|
51
51
|
return ne || (ne = 1, process.env.NODE_ENV !== "production" && function() {
|
|
52
|
-
var i = mi, e = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), t = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), r = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), h = Symbol.for("react.lazy"),
|
|
53
|
-
function g(
|
|
54
|
-
if (
|
|
52
|
+
var i = mi, e = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), t = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), r = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), b = Symbol.for("react.offscreen"), f = Symbol.iterator, x = "@@iterator";
|
|
53
|
+
function g(m) {
|
|
54
|
+
if (m === null || typeof m != "object")
|
|
55
55
|
return null;
|
|
56
|
-
var
|
|
57
|
-
return typeof
|
|
56
|
+
var k = f && m[f] || m[x];
|
|
57
|
+
return typeof k == "function" ? k : null;
|
|
58
58
|
}
|
|
59
|
-
var
|
|
60
|
-
function
|
|
59
|
+
var p = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
60
|
+
function y(m) {
|
|
61
61
|
{
|
|
62
|
-
for (var
|
|
62
|
+
for (var k = arguments.length, M = new Array(k > 1 ? k - 1 : 0), V = 1; V < k; V++)
|
|
63
63
|
M[V - 1] = arguments[V];
|
|
64
|
-
|
|
64
|
+
C("error", m, M);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function C(m, k, M) {
|
|
68
68
|
{
|
|
69
|
-
var V =
|
|
70
|
-
ei !== "" && (
|
|
69
|
+
var V = p.ReactDebugCurrentFrame, ei = V.getStackAddendum();
|
|
70
|
+
ei !== "" && (k += "%s", M = M.concat([ei]));
|
|
71
71
|
var ai = M.map(function(Q) {
|
|
72
72
|
return String(Q);
|
|
73
73
|
});
|
|
74
|
-
ai.unshift("Warning: " +
|
|
74
|
+
ai.unshift("Warning: " + k), Function.prototype.apply.call(console[m], console, ai);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
var S = !1, N = !1, A = !1,
|
|
77
|
+
var S = !1, N = !1, A = !1, j = !1, O = !1, ii;
|
|
78
78
|
ii = Symbol.for("react.module.reference");
|
|
79
|
-
function z(
|
|
80
|
-
return !!(typeof
|
|
79
|
+
function z(m) {
|
|
80
|
+
return !!(typeof m == "string" || typeof m == "function" || m === s || m === l || O || m === a || m === r || m === c || j || m === b || S || N || A || typeof m == "object" && m !== null && (m.$$typeof === h || m.$$typeof === v || m.$$typeof === u || m.$$typeof === t || m.$$typeof === d || // This needs to include all possible module reference object
|
|
81
81
|
// types supported by any Flight configuration anywhere since
|
|
82
82
|
// we don't know which Flight build this will end up being used
|
|
83
83
|
// with.
|
|
84
|
-
|
|
84
|
+
m.$$typeof === ii || m.getModuleId !== void 0));
|
|
85
85
|
}
|
|
86
|
-
function Z(
|
|
87
|
-
var V =
|
|
86
|
+
function Z(m, k, M) {
|
|
87
|
+
var V = m.displayName;
|
|
88
88
|
if (V)
|
|
89
89
|
return V;
|
|
90
|
-
var ei =
|
|
90
|
+
var ei = k.displayName || k.name || "";
|
|
91
91
|
return ei !== "" ? M + "(" + ei + ")" : M;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
return
|
|
93
|
+
function E(m) {
|
|
94
|
+
return m.displayName || "Context";
|
|
95
95
|
}
|
|
96
|
-
function W(
|
|
97
|
-
if (
|
|
96
|
+
function W(m) {
|
|
97
|
+
if (m == null)
|
|
98
98
|
return null;
|
|
99
|
-
if (typeof
|
|
100
|
-
return
|
|
101
|
-
if (typeof
|
|
102
|
-
return
|
|
103
|
-
switch (
|
|
99
|
+
if (typeof m.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof m == "function")
|
|
100
|
+
return m.displayName || m.name || null;
|
|
101
|
+
if (typeof m == "string")
|
|
102
|
+
return m;
|
|
103
|
+
switch (m) {
|
|
104
104
|
case s:
|
|
105
105
|
return "Fragment";
|
|
106
106
|
case o:
|
|
@@ -114,21 +114,21 @@ function Mo() {
|
|
|
114
114
|
case c:
|
|
115
115
|
return "SuspenseList";
|
|
116
116
|
}
|
|
117
|
-
if (typeof
|
|
118
|
-
switch (
|
|
117
|
+
if (typeof m == "object")
|
|
118
|
+
switch (m.$$typeof) {
|
|
119
119
|
case t:
|
|
120
|
-
var
|
|
121
|
-
return
|
|
120
|
+
var k = m;
|
|
121
|
+
return E(k) + ".Consumer";
|
|
122
122
|
case u:
|
|
123
|
-
var M =
|
|
124
|
-
return
|
|
123
|
+
var M = m;
|
|
124
|
+
return E(M._context) + ".Provider";
|
|
125
125
|
case d:
|
|
126
|
-
return Z(
|
|
126
|
+
return Z(m, m.render, "ForwardRef");
|
|
127
127
|
case v:
|
|
128
|
-
var V =
|
|
129
|
-
return V !== null ? V : W(
|
|
128
|
+
var V = m.displayName || null;
|
|
129
|
+
return V !== null ? V : W(m.type) || "Memo";
|
|
130
130
|
case h: {
|
|
131
|
-
var ei =
|
|
131
|
+
var ei = m, ai = ei._payload, Q = ei._init;
|
|
132
132
|
try {
|
|
133
133
|
return W(Q(ai));
|
|
134
134
|
} catch (Y) {
|
|
@@ -138,28 +138,28 @@ function Mo() {
|
|
|
138
138
|
}
|
|
139
139
|
return null;
|
|
140
140
|
}
|
|
141
|
-
var I = Object.assign, G = 0, H, R, T,
|
|
141
|
+
var I = Object.assign, G = 0, H, R, T, w, U, ci, ni;
|
|
142
142
|
function si() {
|
|
143
143
|
}
|
|
144
144
|
si.__reactDisabledLog = !0;
|
|
145
145
|
function hi() {
|
|
146
146
|
{
|
|
147
147
|
if (G === 0) {
|
|
148
|
-
H = console.log, R = console.info, T = console.warn,
|
|
149
|
-
var
|
|
148
|
+
H = console.log, R = console.info, T = console.warn, w = console.error, U = console.group, ci = console.groupCollapsed, ni = console.groupEnd;
|
|
149
|
+
var m = {
|
|
150
150
|
configurable: !0,
|
|
151
151
|
enumerable: !0,
|
|
152
152
|
value: si,
|
|
153
153
|
writable: !0
|
|
154
154
|
};
|
|
155
155
|
Object.defineProperties(console, {
|
|
156
|
-
info:
|
|
157
|
-
log:
|
|
158
|
-
warn:
|
|
159
|
-
error:
|
|
160
|
-
group:
|
|
161
|
-
groupCollapsed:
|
|
162
|
-
groupEnd:
|
|
156
|
+
info: m,
|
|
157
|
+
log: m,
|
|
158
|
+
warn: m,
|
|
159
|
+
error: m,
|
|
160
|
+
group: m,
|
|
161
|
+
groupCollapsed: m,
|
|
162
|
+
groupEnd: m
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
G++;
|
|
@@ -168,40 +168,40 @@ function Mo() {
|
|
|
168
168
|
function vi() {
|
|
169
169
|
{
|
|
170
170
|
if (G--, G === 0) {
|
|
171
|
-
var
|
|
171
|
+
var m = {
|
|
172
172
|
configurable: !0,
|
|
173
173
|
enumerable: !0,
|
|
174
174
|
writable: !0
|
|
175
175
|
};
|
|
176
176
|
Object.defineProperties(console, {
|
|
177
|
-
log: I({},
|
|
177
|
+
log: I({}, m, {
|
|
178
178
|
value: H
|
|
179
179
|
}),
|
|
180
|
-
info: I({},
|
|
180
|
+
info: I({}, m, {
|
|
181
181
|
value: R
|
|
182
182
|
}),
|
|
183
|
-
warn: I({},
|
|
183
|
+
warn: I({}, m, {
|
|
184
184
|
value: T
|
|
185
185
|
}),
|
|
186
|
-
error: I({},
|
|
187
|
-
value:
|
|
186
|
+
error: I({}, m, {
|
|
187
|
+
value: w
|
|
188
188
|
}),
|
|
189
|
-
group: I({},
|
|
189
|
+
group: I({}, m, {
|
|
190
190
|
value: U
|
|
191
191
|
}),
|
|
192
|
-
groupCollapsed: I({},
|
|
192
|
+
groupCollapsed: I({}, m, {
|
|
193
193
|
value: ci
|
|
194
194
|
}),
|
|
195
|
-
groupEnd: I({},
|
|
195
|
+
groupEnd: I({}, m, {
|
|
196
196
|
value: ni
|
|
197
197
|
})
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
|
-
G < 0 &&
|
|
200
|
+
G < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
var L =
|
|
204
|
-
function X(
|
|
203
|
+
var L = p.ReactCurrentDispatcher, K;
|
|
204
|
+
function X(m, k, M) {
|
|
205
205
|
{
|
|
206
206
|
if (K === void 0)
|
|
207
207
|
try {
|
|
@@ -211,7 +211,7 @@ function Mo() {
|
|
|
211
211
|
K = V && V[1] || "";
|
|
212
212
|
}
|
|
213
213
|
return `
|
|
214
|
-
` + K +
|
|
214
|
+
` + K + m;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
var ui = !1, J;
|
|
@@ -219,11 +219,11 @@ function Mo() {
|
|
|
219
219
|
var li = typeof WeakMap == "function" ? WeakMap : Map;
|
|
220
220
|
J = new li();
|
|
221
221
|
}
|
|
222
|
-
function pi(
|
|
223
|
-
if (!
|
|
222
|
+
function pi(m, k) {
|
|
223
|
+
if (!m || ui)
|
|
224
224
|
return "";
|
|
225
225
|
{
|
|
226
|
-
var M = J.get(
|
|
226
|
+
var M = J.get(m);
|
|
227
227
|
if (M !== void 0)
|
|
228
228
|
return M;
|
|
229
229
|
}
|
|
@@ -234,7 +234,7 @@ function Mo() {
|
|
|
234
234
|
var ai;
|
|
235
235
|
ai = L.current, L.current = null, hi();
|
|
236
236
|
try {
|
|
237
|
-
if (
|
|
237
|
+
if (k) {
|
|
238
238
|
var Q = function() {
|
|
239
239
|
throw Error();
|
|
240
240
|
};
|
|
@@ -248,14 +248,14 @@ function Mo() {
|
|
|
248
248
|
} catch (yi) {
|
|
249
249
|
V = yi;
|
|
250
250
|
}
|
|
251
|
-
Reflect.construct(
|
|
251
|
+
Reflect.construct(m, [], Q);
|
|
252
252
|
} else {
|
|
253
253
|
try {
|
|
254
254
|
Q.call();
|
|
255
255
|
} catch (yi) {
|
|
256
256
|
V = yi;
|
|
257
257
|
}
|
|
258
|
-
|
|
258
|
+
m.call(Q.prototype);
|
|
259
259
|
}
|
|
260
260
|
} else {
|
|
261
261
|
try {
|
|
@@ -263,7 +263,7 @@ function Mo() {
|
|
|
263
263
|
} catch (yi) {
|
|
264
264
|
V = yi;
|
|
265
265
|
}
|
|
266
|
-
|
|
266
|
+
m();
|
|
267
267
|
}
|
|
268
268
|
} catch (yi) {
|
|
269
269
|
if (yi && V && typeof yi.stack == "string") {
|
|
@@ -278,7 +278,7 @@ function Mo() {
|
|
|
278
278
|
if (ri--, bi--, bi < 0 || Y[ri] !== fi[bi]) {
|
|
279
279
|
var Ni = `
|
|
280
280
|
` + Y[ri].replace(" at new ", " at ");
|
|
281
|
-
return
|
|
281
|
+
return m.displayName && Ni.includes("<anonymous>") && (Ni = Ni.replace("<anonymous>", m.displayName)), typeof m == "function" && J.set(m, Ni), Ni;
|
|
282
282
|
}
|
|
283
283
|
while (ri >= 1 && bi >= 0);
|
|
284
284
|
break;
|
|
@@ -287,150 +287,150 @@ function Mo() {
|
|
|
287
287
|
} finally {
|
|
288
288
|
ui = !1, L.current = ai, vi(), Error.prepareStackTrace = ei;
|
|
289
289
|
}
|
|
290
|
-
var Pi =
|
|
291
|
-
return typeof
|
|
290
|
+
var Pi = m ? m.displayName || m.name : "", Bi = Pi ? X(Pi) : "";
|
|
291
|
+
return typeof m == "function" && J.set(m, Bi), Bi;
|
|
292
292
|
}
|
|
293
|
-
function Si(
|
|
294
|
-
return pi(
|
|
293
|
+
function Si(m, k, M) {
|
|
294
|
+
return pi(m, !1);
|
|
295
295
|
}
|
|
296
|
-
function Mi(
|
|
297
|
-
var
|
|
298
|
-
return !!(
|
|
296
|
+
function Mi(m) {
|
|
297
|
+
var k = m.prototype;
|
|
298
|
+
return !!(k && k.isReactComponent);
|
|
299
299
|
}
|
|
300
|
-
function zi(
|
|
301
|
-
if (
|
|
300
|
+
function zi(m, k, M) {
|
|
301
|
+
if (m == null)
|
|
302
302
|
return "";
|
|
303
|
-
if (typeof
|
|
304
|
-
return pi(
|
|
305
|
-
if (typeof
|
|
306
|
-
return X(
|
|
307
|
-
switch (
|
|
303
|
+
if (typeof m == "function")
|
|
304
|
+
return pi(m, Mi(m));
|
|
305
|
+
if (typeof m == "string")
|
|
306
|
+
return X(m);
|
|
307
|
+
switch (m) {
|
|
308
308
|
case r:
|
|
309
309
|
return X("Suspense");
|
|
310
310
|
case c:
|
|
311
311
|
return X("SuspenseList");
|
|
312
312
|
}
|
|
313
|
-
if (typeof
|
|
314
|
-
switch (
|
|
313
|
+
if (typeof m == "object")
|
|
314
|
+
switch (m.$$typeof) {
|
|
315
315
|
case d:
|
|
316
|
-
return Si(
|
|
316
|
+
return Si(m.render);
|
|
317
317
|
case v:
|
|
318
|
-
return zi(
|
|
318
|
+
return zi(m.type, k, M);
|
|
319
319
|
case h: {
|
|
320
|
-
var V =
|
|
320
|
+
var V = m, ei = V._payload, ai = V._init;
|
|
321
321
|
try {
|
|
322
|
-
return zi(ai(ei),
|
|
322
|
+
return zi(ai(ei), k, M);
|
|
323
323
|
} catch (Q) {
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
return "";
|
|
328
328
|
}
|
|
329
|
-
var Ki = Object.prototype.hasOwnProperty, Gn = {}, Hn =
|
|
330
|
-
function _i(
|
|
331
|
-
if (
|
|
332
|
-
var
|
|
329
|
+
var Ki = Object.prototype.hasOwnProperty, Gn = {}, Hn = p.ReactDebugCurrentFrame;
|
|
330
|
+
function _i(m) {
|
|
331
|
+
if (m) {
|
|
332
|
+
var k = m._owner, M = zi(m.type, m._source, k ? k.type : null);
|
|
333
333
|
Hn.setExtraStackFrame(M);
|
|
334
334
|
} else
|
|
335
335
|
Hn.setExtraStackFrame(null);
|
|
336
336
|
}
|
|
337
|
-
function We(
|
|
337
|
+
function We(m, k, M, V, ei) {
|
|
338
338
|
{
|
|
339
339
|
var ai = Function.call.bind(Ki);
|
|
340
|
-
for (var Q in
|
|
341
|
-
if (ai(
|
|
340
|
+
for (var Q in m)
|
|
341
|
+
if (ai(m, Q)) {
|
|
342
342
|
var Y = void 0;
|
|
343
343
|
try {
|
|
344
|
-
if (typeof
|
|
345
|
-
var fi = Error((V || "React class") + ": " + M + " type `" + Q + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof
|
|
344
|
+
if (typeof m[Q] != "function") {
|
|
345
|
+
var fi = Error((V || "React class") + ": " + M + " type `" + Q + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof m[Q] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
346
346
|
throw fi.name = "Invariant Violation", fi;
|
|
347
347
|
}
|
|
348
|
-
Y =
|
|
348
|
+
Y = m[Q](k, Q, V, M, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
349
349
|
} catch (ri) {
|
|
350
350
|
Y = ri;
|
|
351
351
|
}
|
|
352
|
-
Y && !(Y instanceof Error) && (_i(ei),
|
|
352
|
+
Y && !(Y instanceof Error) && (_i(ei), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", V || "React class", M, Q, typeof Y), _i(null)), Y instanceof Error && !(Y.message in Gn) && (Gn[Y.message] = !0, _i(ei), y("Failed %s type: %s", M, Y.message), _i(null));
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
var Ue = Array.isArray;
|
|
357
|
-
function dn(
|
|
358
|
-
return Ue(
|
|
357
|
+
function dn(m) {
|
|
358
|
+
return Ue(m);
|
|
359
359
|
}
|
|
360
|
-
function ze(
|
|
360
|
+
function ze(m) {
|
|
361
361
|
{
|
|
362
|
-
var
|
|
362
|
+
var k = typeof Symbol == "function" && Symbol.toStringTag, M = k && m[Symbol.toStringTag] || m.constructor.name || "Object";
|
|
363
363
|
return M;
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
function _e(
|
|
366
|
+
function _e(m) {
|
|
367
367
|
try {
|
|
368
|
-
return Vn(
|
|
369
|
-
} catch (
|
|
368
|
+
return Vn(m), !1;
|
|
369
|
+
} catch (k) {
|
|
370
370
|
return !0;
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
function Vn(
|
|
374
|
-
return "" +
|
|
373
|
+
function Vn(m) {
|
|
374
|
+
return "" + m;
|
|
375
375
|
}
|
|
376
|
-
function Fn(
|
|
377
|
-
if (_e(
|
|
378
|
-
return
|
|
376
|
+
function Fn(m) {
|
|
377
|
+
if (_e(m))
|
|
378
|
+
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ze(m)), Vn(m);
|
|
379
379
|
}
|
|
380
|
-
var Wn =
|
|
380
|
+
var Wn = p.ReactCurrentOwner, Je = {
|
|
381
381
|
key: !0,
|
|
382
382
|
ref: !0,
|
|
383
383
|
__self: !0,
|
|
384
384
|
__source: !0
|
|
385
385
|
}, Un, zn;
|
|
386
|
-
function Ye(
|
|
387
|
-
if (Ki.call(
|
|
388
|
-
var
|
|
389
|
-
if (
|
|
386
|
+
function Ye(m) {
|
|
387
|
+
if (Ki.call(m, "ref")) {
|
|
388
|
+
var k = Object.getOwnPropertyDescriptor(m, "ref").get;
|
|
389
|
+
if (k && k.isReactWarning)
|
|
390
390
|
return !1;
|
|
391
391
|
}
|
|
392
|
-
return
|
|
392
|
+
return m.ref !== void 0;
|
|
393
393
|
}
|
|
394
|
-
function qe(
|
|
395
|
-
if (Ki.call(
|
|
396
|
-
var
|
|
397
|
-
if (
|
|
394
|
+
function qe(m) {
|
|
395
|
+
if (Ki.call(m, "key")) {
|
|
396
|
+
var k = Object.getOwnPropertyDescriptor(m, "key").get;
|
|
397
|
+
if (k && k.isReactWarning)
|
|
398
398
|
return !1;
|
|
399
399
|
}
|
|
400
|
-
return
|
|
400
|
+
return m.key !== void 0;
|
|
401
401
|
}
|
|
402
|
-
function Ze(
|
|
403
|
-
typeof
|
|
402
|
+
function Ze(m, k) {
|
|
403
|
+
typeof m.ref == "string" && Wn.current;
|
|
404
404
|
}
|
|
405
|
-
function $e(
|
|
405
|
+
function $e(m, k) {
|
|
406
406
|
{
|
|
407
407
|
var M = function() {
|
|
408
|
-
Un || (Un = !0,
|
|
408
|
+
Un || (Un = !0, y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", k));
|
|
409
409
|
};
|
|
410
|
-
M.isReactWarning = !0, Object.defineProperty(
|
|
410
|
+
M.isReactWarning = !0, Object.defineProperty(m, "key", {
|
|
411
411
|
get: M,
|
|
412
412
|
configurable: !0
|
|
413
413
|
});
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
|
-
function Qe(
|
|
416
|
+
function Qe(m, k) {
|
|
417
417
|
{
|
|
418
418
|
var M = function() {
|
|
419
|
-
zn || (zn = !0,
|
|
419
|
+
zn || (zn = !0, y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", k));
|
|
420
420
|
};
|
|
421
|
-
M.isReactWarning = !0, Object.defineProperty(
|
|
421
|
+
M.isReactWarning = !0, Object.defineProperty(m, "ref", {
|
|
422
422
|
get: M,
|
|
423
423
|
configurable: !0
|
|
424
424
|
});
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
|
-
var Xe = function(
|
|
427
|
+
var Xe = function(m, k, M, V, ei, ai, Q) {
|
|
428
428
|
var Y = {
|
|
429
429
|
// This tag allows us to uniquely identify this as a React Element
|
|
430
430
|
$$typeof: e,
|
|
431
431
|
// Built-in properties that belong on the element
|
|
432
|
-
type:
|
|
433
|
-
key:
|
|
432
|
+
type: m,
|
|
433
|
+
key: k,
|
|
434
434
|
ref: M,
|
|
435
435
|
props: Q,
|
|
436
436
|
// Record the component responsible for creating this element.
|
|
@@ -453,169 +453,169 @@ function Mo() {
|
|
|
453
453
|
value: ei
|
|
454
454
|
}), Object.freeze && (Object.freeze(Y.props), Object.freeze(Y)), Y;
|
|
455
455
|
};
|
|
456
|
-
function io(
|
|
456
|
+
function io(m, k, M, V, ei) {
|
|
457
457
|
{
|
|
458
458
|
var ai, Q = {}, Y = null, fi = null;
|
|
459
|
-
M !== void 0 && (Fn(M), Y = "" + M), qe(
|
|
460
|
-
for (ai in
|
|
461
|
-
Ki.call(
|
|
462
|
-
if (
|
|
463
|
-
var ri =
|
|
459
|
+
M !== void 0 && (Fn(M), Y = "" + M), qe(k) && (Fn(k.key), Y = "" + k.key), Ye(k) && (fi = k.ref, Ze(k, ei));
|
|
460
|
+
for (ai in k)
|
|
461
|
+
Ki.call(k, ai) && !Je.hasOwnProperty(ai) && (Q[ai] = k[ai]);
|
|
462
|
+
if (m && m.defaultProps) {
|
|
463
|
+
var ri = m.defaultProps;
|
|
464
464
|
for (ai in ri)
|
|
465
465
|
Q[ai] === void 0 && (Q[ai] = ri[ai]);
|
|
466
466
|
}
|
|
467
467
|
if (Y || fi) {
|
|
468
|
-
var bi = typeof
|
|
468
|
+
var bi = typeof m == "function" ? m.displayName || m.name || "Unknown" : m;
|
|
469
469
|
Y && $e(Q, bi), fi && Qe(Q, bi);
|
|
470
470
|
}
|
|
471
|
-
return Xe(
|
|
471
|
+
return Xe(m, Y, fi, ei, V, Wn.current, Q);
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
var un =
|
|
475
|
-
function Li(
|
|
476
|
-
if (
|
|
477
|
-
var
|
|
474
|
+
var un = p.ReactCurrentOwner, _n = p.ReactDebugCurrentFrame;
|
|
475
|
+
function Li(m) {
|
|
476
|
+
if (m) {
|
|
477
|
+
var k = m._owner, M = zi(m.type, m._source, k ? k.type : null);
|
|
478
478
|
_n.setExtraStackFrame(M);
|
|
479
479
|
} else
|
|
480
480
|
_n.setExtraStackFrame(null);
|
|
481
481
|
}
|
|
482
482
|
var tn;
|
|
483
483
|
tn = !1;
|
|
484
|
-
function cn(
|
|
485
|
-
return typeof
|
|
484
|
+
function cn(m) {
|
|
485
|
+
return typeof m == "object" && m !== null && m.$$typeof === e;
|
|
486
486
|
}
|
|
487
487
|
function Jn() {
|
|
488
488
|
{
|
|
489
489
|
if (un.current) {
|
|
490
|
-
var
|
|
491
|
-
if (
|
|
490
|
+
var m = W(un.current.type);
|
|
491
|
+
if (m)
|
|
492
492
|
return `
|
|
493
493
|
|
|
494
|
-
Check the render method of \`` +
|
|
494
|
+
Check the render method of \`` + m + "`.";
|
|
495
495
|
}
|
|
496
496
|
return "";
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
function no(
|
|
499
|
+
function no(m) {
|
|
500
500
|
return "";
|
|
501
501
|
}
|
|
502
502
|
var Yn = {};
|
|
503
|
-
function eo(
|
|
503
|
+
function eo(m) {
|
|
504
504
|
{
|
|
505
|
-
var
|
|
506
|
-
if (!
|
|
507
|
-
var M = typeof
|
|
508
|
-
M && (
|
|
505
|
+
var k = Jn();
|
|
506
|
+
if (!k) {
|
|
507
|
+
var M = typeof m == "string" ? m : m.displayName || m.name;
|
|
508
|
+
M && (k = `
|
|
509
509
|
|
|
510
510
|
Check the top-level render call using <` + M + ">.");
|
|
511
511
|
}
|
|
512
|
-
return
|
|
512
|
+
return k;
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
function qn(
|
|
515
|
+
function qn(m, k) {
|
|
516
516
|
{
|
|
517
|
-
if (!
|
|
517
|
+
if (!m._store || m._store.validated || m.key != null)
|
|
518
518
|
return;
|
|
519
|
-
|
|
520
|
-
var M = eo(
|
|
519
|
+
m._store.validated = !0;
|
|
520
|
+
var M = eo(k);
|
|
521
521
|
if (Yn[M])
|
|
522
522
|
return;
|
|
523
523
|
Yn[M] = !0;
|
|
524
524
|
var V = "";
|
|
525
|
-
|
|
525
|
+
m && m._owner && m._owner !== un.current && (V = " It was passed a child from " + W(m._owner.type) + "."), Li(m), y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', M, V), Li(null);
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
function Zn(
|
|
528
|
+
function Zn(m, k) {
|
|
529
529
|
{
|
|
530
|
-
if (typeof
|
|
530
|
+
if (typeof m != "object")
|
|
531
531
|
return;
|
|
532
|
-
if (dn(
|
|
533
|
-
for (var M = 0; M <
|
|
534
|
-
var V =
|
|
535
|
-
cn(V) && qn(V,
|
|
532
|
+
if (dn(m))
|
|
533
|
+
for (var M = 0; M < m.length; M++) {
|
|
534
|
+
var V = m[M];
|
|
535
|
+
cn(V) && qn(V, k);
|
|
536
536
|
}
|
|
537
|
-
else if (cn(
|
|
538
|
-
|
|
539
|
-
else if (
|
|
540
|
-
var ei = g(
|
|
541
|
-
if (typeof ei == "function" && ei !==
|
|
542
|
-
for (var ai = ei.call(
|
|
543
|
-
cn(Q.value) && qn(Q.value,
|
|
537
|
+
else if (cn(m))
|
|
538
|
+
m._store && (m._store.validated = !0);
|
|
539
|
+
else if (m) {
|
|
540
|
+
var ei = g(m);
|
|
541
|
+
if (typeof ei == "function" && ei !== m.entries)
|
|
542
|
+
for (var ai = ei.call(m), Q; !(Q = ai.next()).done; )
|
|
543
|
+
cn(Q.value) && qn(Q.value, k);
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
function oo(
|
|
547
|
+
function oo(m) {
|
|
548
548
|
{
|
|
549
|
-
var
|
|
550
|
-
if (
|
|
549
|
+
var k = m.type;
|
|
550
|
+
if (k == null || typeof k == "string")
|
|
551
551
|
return;
|
|
552
552
|
var M;
|
|
553
|
-
if (typeof
|
|
554
|
-
M =
|
|
555
|
-
else if (typeof
|
|
553
|
+
if (typeof k == "function")
|
|
554
|
+
M = k.propTypes;
|
|
555
|
+
else if (typeof k == "object" && (k.$$typeof === d || // Note: Memo only checks outer props here.
|
|
556
556
|
// Inner props are checked in the reconciler.
|
|
557
|
-
|
|
558
|
-
M =
|
|
557
|
+
k.$$typeof === v))
|
|
558
|
+
M = k.propTypes;
|
|
559
559
|
else
|
|
560
560
|
return;
|
|
561
561
|
if (M) {
|
|
562
|
-
var V = W(
|
|
563
|
-
We(M,
|
|
564
|
-
} else if (
|
|
562
|
+
var V = W(k);
|
|
563
|
+
We(M, m.props, "prop", V, m);
|
|
564
|
+
} else if (k.PropTypes !== void 0 && !tn) {
|
|
565
565
|
tn = !0;
|
|
566
|
-
var ei = W(
|
|
567
|
-
|
|
566
|
+
var ei = W(k);
|
|
567
|
+
y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", ei || "Unknown");
|
|
568
568
|
}
|
|
569
|
-
typeof
|
|
569
|
+
typeof k.getDefaultProps == "function" && !k.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
function ao(
|
|
572
|
+
function ao(m) {
|
|
573
573
|
{
|
|
574
|
-
for (var
|
|
575
|
-
var V =
|
|
574
|
+
for (var k = Object.keys(m.props), M = 0; M < k.length; M++) {
|
|
575
|
+
var V = k[M];
|
|
576
576
|
if (V !== "children" && V !== "key") {
|
|
577
|
-
Li(
|
|
577
|
+
Li(m), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", V), Li(null);
|
|
578
578
|
break;
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
|
|
581
|
+
m.ref !== null && (Li(m), y("Invalid attribute `ref` supplied to `React.Fragment`."), Li(null));
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
var $n = {};
|
|
585
|
-
function Qn(
|
|
585
|
+
function Qn(m, k, M, V, ei, ai) {
|
|
586
586
|
{
|
|
587
|
-
var Q = z(
|
|
587
|
+
var Q = z(m);
|
|
588
588
|
if (!Q) {
|
|
589
589
|
var Y = "";
|
|
590
|
-
(
|
|
590
|
+
(m === void 0 || typeof m == "object" && m !== null && Object.keys(m).length === 0) && (Y += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
591
591
|
var fi = no();
|
|
592
592
|
fi ? Y += fi : Y += Jn();
|
|
593
593
|
var ri;
|
|
594
|
-
|
|
594
|
+
m === null ? ri = "null" : dn(m) ? ri = "array" : m !== void 0 && m.$$typeof === e ? (ri = "<" + (W(m.type) || "Unknown") + " />", Y = " Did you accidentally export a JSX literal instead of a component?") : ri = typeof m, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ri, Y);
|
|
595
595
|
}
|
|
596
|
-
var bi = io(
|
|
596
|
+
var bi = io(m, k, M, ei, ai);
|
|
597
597
|
if (bi == null)
|
|
598
598
|
return bi;
|
|
599
599
|
if (Q) {
|
|
600
|
-
var Ni =
|
|
600
|
+
var Ni = k.children;
|
|
601
601
|
if (Ni !== void 0)
|
|
602
602
|
if (V)
|
|
603
603
|
if (dn(Ni)) {
|
|
604
604
|
for (var Pi = 0; Pi < Ni.length; Pi++)
|
|
605
|
-
Zn(Ni[Pi],
|
|
605
|
+
Zn(Ni[Pi], m);
|
|
606
606
|
Object.freeze && Object.freeze(Ni);
|
|
607
607
|
} else
|
|
608
|
-
|
|
608
|
+
y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
609
609
|
else
|
|
610
|
-
Zn(Ni,
|
|
610
|
+
Zn(Ni, m);
|
|
611
611
|
}
|
|
612
|
-
if (Ki.call(
|
|
613
|
-
var Bi = W(
|
|
612
|
+
if (Ki.call(k, "key")) {
|
|
613
|
+
var Bi = W(m), yi = Object.keys(k).filter(function(ro) {
|
|
614
614
|
return ro !== "key";
|
|
615
615
|
}), rn = yi.length > 0 ? "{key: someKey, " + yi.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
616
616
|
if (!$n[Bi + rn]) {
|
|
617
617
|
var co = yi.length > 0 ? "{" + yi.join(": ..., ") + ": ...}" : "{}";
|
|
618
|
-
|
|
618
|
+
y(`A props object containing a "key" prop is being spread into JSX:
|
|
619
619
|
let props = %s;
|
|
620
620
|
<%s {...props} />
|
|
621
621
|
React keys must be passed directly to JSX without using spread:
|
|
@@ -623,14 +623,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
623
623
|
<%s key={someKey} {...props} />`, rn, Bi, co, Bi), $n[Bi + rn] = !0;
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
|
-
return
|
|
626
|
+
return m === s ? ao(bi) : oo(bi), bi;
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
|
-
function so(
|
|
630
|
-
return Qn(
|
|
629
|
+
function so(m, k, M) {
|
|
630
|
+
return Qn(m, k, M, !0);
|
|
631
631
|
}
|
|
632
|
-
function lo(
|
|
633
|
-
return Qn(
|
|
632
|
+
function lo(m, k, M) {
|
|
633
|
+
return Qn(m, k, M, !1);
|
|
634
634
|
}
|
|
635
635
|
var uo = lo, to = so;
|
|
636
636
|
Hi.Fragment = s, Hi.jsx = uo, Hi.jsxs = to;
|
|
@@ -649,13 +649,13 @@ const gi = mo(void 0), oe = {
|
|
|
649
649
|
disabled: !1,
|
|
650
650
|
isHidden: !1
|
|
651
651
|
}, Se = ({ children: i }) => {
|
|
652
|
-
const [e, o] = P(!0), [s, a] = P({}), [l, u] = P({}), [t, d] = P([oe]), [r, c] = P(!1), [v, h] = P(null), [
|
|
652
|
+
const [e, o] = P(!0), [s, a] = P({}), [l, u] = P({}), [t, d] = P([oe]), [r, c] = P(!1), [v, h] = P(null), [b, f] = P([
|
|
653
653
|
0
|
|
654
|
-
]), [
|
|
655
|
-
}, []),
|
|
654
|
+
]), [x, g] = P(""), p = mi.useCallback(() => {
|
|
655
|
+
}, []), y = mi.useCallback(() => {
|
|
656
656
|
const I = Ai();
|
|
657
|
-
d((G) => [...G, { ...oe, id: I }]), h(I),
|
|
658
|
-
}, [t]),
|
|
657
|
+
d((G) => [...G, { ...oe, id: I }]), h(I), f([t.length]);
|
|
658
|
+
}, [t]), C = mi.useCallback((I) => {
|
|
659
659
|
d(
|
|
660
660
|
(G) => G.filter((H) => H.id !== I)
|
|
661
661
|
), h(null);
|
|
@@ -666,10 +666,10 @@ const gi = mo(void 0), oe = {
|
|
|
666
666
|
);
|
|
667
667
|
R && d(
|
|
668
668
|
(T) => T == null ? void 0 : T.map(
|
|
669
|
-
(
|
|
670
|
-
...
|
|
671
|
-
questionData:
|
|
672
|
-
} :
|
|
669
|
+
(w) => w.id === G ? {
|
|
670
|
+
...w,
|
|
671
|
+
questionData: w.questionData.filter((U) => R.type === "grid" ? U.gridId !== R.id && U.id !== R.id : U.id !== I)
|
|
672
|
+
} : w
|
|
673
673
|
)
|
|
674
674
|
);
|
|
675
675
|
},
|
|
@@ -682,7 +682,7 @@ const gi = mo(void 0), oe = {
|
|
|
682
682
|
(U) => U.id === I
|
|
683
683
|
);
|
|
684
684
|
if (R === -1) return;
|
|
685
|
-
const T = H.questionData[R],
|
|
685
|
+
const T = H.questionData[R], w = (U, ci = {}) => ({
|
|
686
686
|
...JSON.parse(JSON.stringify(U)),
|
|
687
687
|
id: Ai(),
|
|
688
688
|
...ci
|
|
@@ -695,10 +695,10 @@ const gi = mo(void 0), oe = {
|
|
|
695
695
|
if (T.type === "grid") {
|
|
696
696
|
const hi = (si = ni == null ? void 0 : ni.map((li, pi) => ({ e: li, i: pi })).filter(
|
|
697
697
|
({ e: li }) => li.id === T.id || li.gridId === T.id
|
|
698
|
-
)) == null ? void 0 : si.map(({ i: li }) => li), vi = hi.length ? Math.max(...hi) + 1 : R + 1, L = Ai(), K =
|
|
698
|
+
)) == null ? void 0 : si.map(({ i: li }) => li), vi = hi.length ? Math.max(...hi) + 1 : R + 1, L = Ai(), K = w(T, {});
|
|
699
699
|
K.id = L;
|
|
700
700
|
const X = ni.filter((li) => li.gridId === T.id), ui = X == null ? void 0 : X.map(
|
|
701
|
-
(li) =>
|
|
701
|
+
(li) => w(li, { gridId: L })
|
|
702
702
|
), J = [
|
|
703
703
|
...ni.slice(0, vi),
|
|
704
704
|
K,
|
|
@@ -707,7 +707,7 @@ const gi = mo(void 0), oe = {
|
|
|
707
707
|
];
|
|
708
708
|
return { ...ci, questionData: J };
|
|
709
709
|
} else {
|
|
710
|
-
const hi =
|
|
710
|
+
const hi = w(
|
|
711
711
|
T,
|
|
712
712
|
T.gridId ? { gridId: T.gridId } : {}
|
|
713
713
|
), vi = [
|
|
@@ -730,7 +730,7 @@ const gi = mo(void 0), oe = {
|
|
|
730
730
|
);
|
|
731
731
|
},
|
|
732
732
|
[]
|
|
733
|
-
),
|
|
733
|
+
), j = mi.useCallback((I, G) => {
|
|
734
734
|
d(
|
|
735
735
|
(H) => H == null ? void 0 : H.map(
|
|
736
736
|
(R) => R.id === G ? {
|
|
@@ -760,10 +760,10 @@ const gi = mo(void 0), oe = {
|
|
|
760
760
|
d(
|
|
761
761
|
(R) => R == null ? void 0 : R.map(
|
|
762
762
|
(T) => {
|
|
763
|
-
var
|
|
763
|
+
var w;
|
|
764
764
|
return T.id === H ? {
|
|
765
765
|
...T,
|
|
766
|
-
questionData: (
|
|
766
|
+
questionData: (w = T.questionData) == null ? void 0 : w.map(
|
|
767
767
|
(U) => {
|
|
768
768
|
var ci;
|
|
769
769
|
return U.type === "grid" && U.gridData ? {
|
|
@@ -793,7 +793,7 @@ const gi = mo(void 0), oe = {
|
|
|
793
793
|
return R.id === G ? {
|
|
794
794
|
...R,
|
|
795
795
|
questionData: (T = R.questionData) == null ? void 0 : T.map(
|
|
796
|
-
(
|
|
796
|
+
(w) => w.id === I.id ? { ...w, ...I } : w
|
|
797
797
|
)
|
|
798
798
|
} : R;
|
|
799
799
|
}
|
|
@@ -806,7 +806,7 @@ const gi = mo(void 0), oe = {
|
|
|
806
806
|
sectionId: H,
|
|
807
807
|
targetIndex: R,
|
|
808
808
|
targetId: T,
|
|
809
|
-
targetGridId:
|
|
809
|
+
targetGridId: w,
|
|
810
810
|
targetCol: U
|
|
811
811
|
} = I;
|
|
812
812
|
d(
|
|
@@ -815,18 +815,18 @@ const gi = mo(void 0), oe = {
|
|
|
815
815
|
const si = [...ni.questionData], hi = si.findIndex((L) => L.id === G);
|
|
816
816
|
if (hi === -1) return ni;
|
|
817
817
|
const vi = { ...si[hi] };
|
|
818
|
-
if (
|
|
818
|
+
if (w !== void 0 && U !== void 0) {
|
|
819
819
|
if (vi.type === "grid") return ni;
|
|
820
820
|
const L = si.findIndex(
|
|
821
821
|
(X) => {
|
|
822
822
|
var ui;
|
|
823
|
-
return X.id !== G && X.gridId ===
|
|
823
|
+
return X.id !== G && X.gridId === w && ((ui = X.gridPosition) == null ? void 0 : ui.col) === U;
|
|
824
824
|
}
|
|
825
825
|
);
|
|
826
826
|
let K = si.map(
|
|
827
827
|
(X) => X.id === G ? {
|
|
828
828
|
...X,
|
|
829
|
-
gridId:
|
|
829
|
+
gridId: w,
|
|
830
830
|
gridPosition: { col: U }
|
|
831
831
|
} : X
|
|
832
832
|
);
|
|
@@ -836,13 +836,13 @@ const gi = mo(void 0), oe = {
|
|
|
836
836
|
return delete J.gridId, delete J.gridPosition, J;
|
|
837
837
|
})), { ...ni, questionData: K };
|
|
838
838
|
}
|
|
839
|
-
if (vi.gridId && R !== void 0 &&
|
|
839
|
+
if (vi.gridId && R !== void 0 && w === void 0) {
|
|
840
840
|
const L = { ...vi };
|
|
841
841
|
delete L.gridId, delete L.gridPosition;
|
|
842
842
|
const K = si.filter((ui) => ui.id !== G), X = Math.min(R, K.length);
|
|
843
843
|
return K.splice(X, 0, L), { ...ni, questionData: K };
|
|
844
844
|
}
|
|
845
|
-
if (!vi.gridId && R !== void 0 &&
|
|
845
|
+
if (!vi.gridId && R !== void 0 && w === void 0 && !T) {
|
|
846
846
|
si.splice(hi, 1);
|
|
847
847
|
const L = Math.min(R, si.length);
|
|
848
848
|
return si.splice(L, 0, vi), { ...ni, questionData: si };
|
|
@@ -856,7 +856,7 @@ const gi = mo(void 0), oe = {
|
|
|
856
856
|
);
|
|
857
857
|
},
|
|
858
858
|
[]
|
|
859
|
-
),
|
|
859
|
+
), E = mi.useCallback((I, G) => {
|
|
860
860
|
d(
|
|
861
861
|
(H) => H == null ? void 0 : H.map(
|
|
862
862
|
(R) => R.id === G ? {
|
|
@@ -869,27 +869,27 @@ const gi = mo(void 0), oe = {
|
|
|
869
869
|
() => ({
|
|
870
870
|
formData: t,
|
|
871
871
|
setFormData: d,
|
|
872
|
-
handleDragStop:
|
|
872
|
+
handleDragStop: p,
|
|
873
873
|
removeElement: S,
|
|
874
874
|
elementData: l,
|
|
875
875
|
setElementData: u,
|
|
876
876
|
updateElementPosition: A,
|
|
877
|
-
addElement:
|
|
877
|
+
addElement: j,
|
|
878
878
|
addElementInPosition: O,
|
|
879
879
|
updateElement: z,
|
|
880
|
-
addSection:
|
|
881
|
-
removeSection:
|
|
882
|
-
updateSection:
|
|
880
|
+
addSection: y,
|
|
881
|
+
removeSection: C,
|
|
882
|
+
updateSection: E,
|
|
883
883
|
isDragging: r,
|
|
884
884
|
setIsDragging: c,
|
|
885
885
|
selectedSection: v,
|
|
886
886
|
setSelectedSection: h,
|
|
887
|
-
activeSections:
|
|
888
|
-
setActiveSections:
|
|
887
|
+
activeSections: b,
|
|
888
|
+
setActiveSections: f,
|
|
889
889
|
updateGridElement: ii,
|
|
890
890
|
answerData: s,
|
|
891
891
|
setAnswerData: a,
|
|
892
|
-
uploadUrl:
|
|
892
|
+
uploadUrl: x,
|
|
893
893
|
setUploadUrl: g,
|
|
894
894
|
duplicateElement: N,
|
|
895
895
|
moveElement: Z,
|
|
@@ -898,22 +898,22 @@ const gi = mo(void 0), oe = {
|
|
|
898
898
|
}),
|
|
899
899
|
[
|
|
900
900
|
t,
|
|
901
|
-
|
|
901
|
+
p,
|
|
902
902
|
S,
|
|
903
903
|
l,
|
|
904
904
|
A,
|
|
905
|
-
|
|
905
|
+
j,
|
|
906
906
|
O,
|
|
907
907
|
z,
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
908
|
+
y,
|
|
909
|
+
C,
|
|
910
|
+
E,
|
|
911
911
|
r,
|
|
912
912
|
v,
|
|
913
|
-
|
|
913
|
+
b,
|
|
914
914
|
ii,
|
|
915
915
|
s,
|
|
916
|
-
|
|
916
|
+
x,
|
|
917
917
|
N,
|
|
918
918
|
Z,
|
|
919
919
|
e
|
|
@@ -1120,13 +1120,13 @@ const Nn = ({
|
|
|
1120
1120
|
}) => {
|
|
1121
1121
|
const r = i ? new Date(i) : null, [c, v] = P(r);
|
|
1122
1122
|
D(() => {
|
|
1123
|
-
const
|
|
1124
|
-
(
|
|
1123
|
+
const b = i ? new Date(i) : null;
|
|
1124
|
+
(b && c && b.getTime() !== c.getTime() || !b && c || b && !c) && v(b);
|
|
1125
1125
|
}, [i]), D(() => {
|
|
1126
1126
|
e && e(a, c);
|
|
1127
1127
|
}, [c, e, a]);
|
|
1128
|
-
const h = (
|
|
1129
|
-
v(
|
|
1128
|
+
const h = (b) => {
|
|
1129
|
+
v(b);
|
|
1130
1130
|
};
|
|
1131
1131
|
return /* @__PURE__ */ n.jsx("div", { className: "builder_date__picker", children: /* @__PURE__ */ n.jsx(
|
|
1132
1132
|
bo,
|
|
@@ -1149,7 +1149,7 @@ const Nn = ({
|
|
|
1149
1149
|
}
|
|
1150
1150
|
) });
|
|
1151
1151
|
};
|
|
1152
|
-
function
|
|
1152
|
+
function wo({
|
|
1153
1153
|
element: i,
|
|
1154
1154
|
validationData: e
|
|
1155
1155
|
}) {
|
|
@@ -1195,7 +1195,7 @@ function bn({
|
|
|
1195
1195
|
}
|
|
1196
1196
|
) });
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1198
|
+
function Eo(i, e) {
|
|
1199
1199
|
const o = i.icons, s = i.aliases || /* @__PURE__ */ Object.create(null), a = /* @__PURE__ */ Object.create(null);
|
|
1200
1200
|
function l(u) {
|
|
1201
1201
|
if (o[u]) return a[u] = [];
|
|
@@ -1217,11 +1217,11 @@ const je = Object.freeze({
|
|
|
1217
1217
|
rotate: 0,
|
|
1218
1218
|
vFlip: !1,
|
|
1219
1219
|
hFlip: !1
|
|
1220
|
-
}),
|
|
1220
|
+
}), wn = Object.freeze({
|
|
1221
1221
|
...je,
|
|
1222
1222
|
...nn
|
|
1223
1223
|
}), jn = Object.freeze({
|
|
1224
|
-
...
|
|
1224
|
+
...wn,
|
|
1225
1225
|
body: "",
|
|
1226
1226
|
hidden: !1
|
|
1227
1227
|
});
|
|
@@ -1250,7 +1250,7 @@ function ke(i, e) {
|
|
|
1250
1250
|
i.not_found instanceof Array && i.not_found.forEach((a) => {
|
|
1251
1251
|
e(a, null), o.push(a);
|
|
1252
1252
|
});
|
|
1253
|
-
const s =
|
|
1253
|
+
const s = Eo(i);
|
|
1254
1254
|
for (const a in s) {
|
|
1255
1255
|
const l = s[a];
|
|
1256
1256
|
l && (e(a, Po(i, a, l)), o.push(a));
|
|
@@ -1376,11 +1376,11 @@ function Ko(i, e) {
|
|
|
1376
1376
|
const s = Oi(e, o);
|
|
1377
1377
|
return !!Me(s, i);
|
|
1378
1378
|
}
|
|
1379
|
-
const
|
|
1379
|
+
const we = Object.freeze({
|
|
1380
1380
|
width: null,
|
|
1381
1381
|
height: null
|
|
1382
|
-
}),
|
|
1383
|
-
...
|
|
1382
|
+
}), Ee = Object.freeze({
|
|
1383
|
+
...we,
|
|
1384
1384
|
...nn
|
|
1385
1385
|
}), Go = /(-?[0-9.]*[0-9]+[0-9.]*)/g, Ho = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
1386
1386
|
function de(i, e, o) {
|
|
@@ -1425,10 +1425,10 @@ function Wo(i, e, o) {
|
|
|
1425
1425
|
const Uo = (i) => i === "unset" || i === "undefined" || i === "none";
|
|
1426
1426
|
function zo(i, e) {
|
|
1427
1427
|
const o = {
|
|
1428
|
-
...
|
|
1428
|
+
...wn,
|
|
1429
1429
|
...i
|
|
1430
1430
|
}, s = {
|
|
1431
|
-
...
|
|
1431
|
+
...Ee,
|
|
1432
1432
|
...e
|
|
1433
1433
|
}, a = {
|
|
1434
1434
|
left: o.left,
|
|
@@ -1437,12 +1437,12 @@ function zo(i, e) {
|
|
|
1437
1437
|
height: o.height
|
|
1438
1438
|
};
|
|
1439
1439
|
let l = o.body;
|
|
1440
|
-
[o, s].forEach((
|
|
1441
|
-
const g = [],
|
|
1442
|
-
let
|
|
1443
|
-
|
|
1440
|
+
[o, s].forEach((x) => {
|
|
1441
|
+
const g = [], p = x.hFlip, y = x.vFlip;
|
|
1442
|
+
let C = x.rotate;
|
|
1443
|
+
p ? y ? C += 2 : (g.push("translate(" + (a.width + a.left).toString() + " " + (0 - a.top).toString() + ")"), g.push("scale(-1 1)"), a.top = a.left = 0) : y && (g.push("translate(" + (0 - a.left).toString() + " " + (a.height + a.top).toString() + ")"), g.push("scale(1 -1)"), a.top = a.left = 0);
|
|
1444
1444
|
let S;
|
|
1445
|
-
switch (
|
|
1445
|
+
switch (C < 0 && (C -= Math.floor(C / 4) * 4), C = C % 4, C) {
|
|
1446
1446
|
case 1:
|
|
1447
1447
|
S = a.height / 2 + a.top, g.unshift("rotate(90 " + S.toString() + " " + S.toString() + ")");
|
|
1448
1448
|
break;
|
|
@@ -1453,24 +1453,24 @@ function zo(i, e) {
|
|
|
1453
1453
|
S = a.width / 2 + a.left, g.unshift("rotate(-90 " + S.toString() + " " + S.toString() + ")");
|
|
1454
1454
|
break;
|
|
1455
1455
|
}
|
|
1456
|
-
|
|
1456
|
+
C % 2 === 1 && (a.left !== a.top && (S = a.left, a.left = a.top, a.top = S), a.width !== a.height && (S = a.width, a.width = a.height, a.height = S)), g.length && (l = Wo(l, '<g transform="' + g.join(" ") + '">', "</g>"));
|
|
1457
1457
|
});
|
|
1458
1458
|
const u = s.width, t = s.height, d = a.width, r = a.height;
|
|
1459
1459
|
let c, v;
|
|
1460
1460
|
u === null ? (v = t === null ? "1em" : t === "auto" ? r : t, c = de(v, d / r)) : (c = u === "auto" ? d : u, v = t === null ? de(c, r / d) : t === "auto" ? r : t);
|
|
1461
|
-
const h = {},
|
|
1462
|
-
Uo(g) || (h[
|
|
1461
|
+
const h = {}, b = (x, g) => {
|
|
1462
|
+
Uo(g) || (h[x] = g.toString());
|
|
1463
1463
|
};
|
|
1464
|
-
|
|
1465
|
-
const
|
|
1464
|
+
b("width", c), b("height", v);
|
|
1465
|
+
const f = [
|
|
1466
1466
|
a.left,
|
|
1467
1467
|
a.top,
|
|
1468
1468
|
d,
|
|
1469
1469
|
r
|
|
1470
1470
|
];
|
|
1471
|
-
return h.viewBox =
|
|
1471
|
+
return h.viewBox = f.join(" "), {
|
|
1472
1472
|
attributes: h,
|
|
1473
|
-
viewBox:
|
|
1473
|
+
viewBox: f,
|
|
1474
1474
|
body: l
|
|
1475
1475
|
};
|
|
1476
1476
|
}
|
|
@@ -1494,7 +1494,7 @@ function Zo(i, e) {
|
|
|
1494
1494
|
function Cn(i) {
|
|
1495
1495
|
return kn[i] || kn[""];
|
|
1496
1496
|
}
|
|
1497
|
-
function
|
|
1497
|
+
function En(i) {
|
|
1498
1498
|
let e;
|
|
1499
1499
|
if (typeof i.resources == "string") e = [i.resources];
|
|
1500
1500
|
else if (e = i.resources, !(e instanceof Array) || !e.length) return null;
|
|
@@ -1511,9 +1511,9 @@ function wn(i) {
|
|
|
1511
1511
|
}
|
|
1512
1512
|
const Ln = /* @__PURE__ */ Object.create(null), Vi = ["https://api.simplesvg.com", "https://api.unisvg.com"], Qi = [];
|
|
1513
1513
|
for (; Vi.length > 0; ) Vi.length === 1 || Math.random() > 0.5 ? Qi.push(Vi.shift()) : Qi.push(Vi.pop());
|
|
1514
|
-
Ln[""] =
|
|
1514
|
+
Ln[""] = En({ resources: ["https://api.iconify.design"].concat(Qi) });
|
|
1515
1515
|
function $o(i, e) {
|
|
1516
|
-
const o =
|
|
1516
|
+
const o = En(e);
|
|
1517
1517
|
return o === null ? !1 : (Ln[i] = o, !0);
|
|
1518
1518
|
}
|
|
1519
1519
|
function Pn(i) {
|
|
@@ -1713,26 +1713,26 @@ function ra(i, e, o, s) {
|
|
|
1713
1713
|
if (i.random) {
|
|
1714
1714
|
let A = i.resources.slice(0);
|
|
1715
1715
|
for (u = []; A.length > 1; ) {
|
|
1716
|
-
const
|
|
1717
|
-
u.push(A[
|
|
1716
|
+
const j = Math.floor(Math.random() * A.length);
|
|
1717
|
+
u.push(A[j]), A = A.slice(0, j).concat(A.slice(j + 1));
|
|
1718
1718
|
}
|
|
1719
1719
|
u = u.concat(A);
|
|
1720
1720
|
} else u = i.resources.slice(l).concat(i.resources.slice(0, l));
|
|
1721
1721
|
const t = Date.now();
|
|
1722
|
-
let d = "pending", r = 0, c, v = null, h = [],
|
|
1723
|
-
typeof s == "function" &&
|
|
1724
|
-
function
|
|
1722
|
+
let d = "pending", r = 0, c, v = null, h = [], b = [];
|
|
1723
|
+
typeof s == "function" && b.push(s);
|
|
1724
|
+
function f() {
|
|
1725
1725
|
v && (clearTimeout(v), v = null);
|
|
1726
1726
|
}
|
|
1727
|
-
function
|
|
1728
|
-
d === "pending" && (d = "aborted"),
|
|
1727
|
+
function x() {
|
|
1728
|
+
d === "pending" && (d = "aborted"), f(), h.forEach((A) => {
|
|
1729
1729
|
A.status === "pending" && (A.status = "aborted");
|
|
1730
1730
|
}), h = [];
|
|
1731
1731
|
}
|
|
1732
|
-
function g(A,
|
|
1733
|
-
|
|
1732
|
+
function g(A, j) {
|
|
1733
|
+
j && (b = []), typeof A == "function" && b.push(A);
|
|
1734
1734
|
}
|
|
1735
|
-
function
|
|
1735
|
+
function p() {
|
|
1736
1736
|
return {
|
|
1737
1737
|
startTime: t,
|
|
1738
1738
|
payload: e,
|
|
@@ -1740,21 +1740,21 @@ function ra(i, e, o, s) {
|
|
|
1740
1740
|
queriesSent: r,
|
|
1741
1741
|
queriesPending: h.length,
|
|
1742
1742
|
subscribe: g,
|
|
1743
|
-
abort:
|
|
1743
|
+
abort: x
|
|
1744
1744
|
};
|
|
1745
1745
|
}
|
|
1746
|
-
function
|
|
1747
|
-
d = "failed",
|
|
1746
|
+
function y() {
|
|
1747
|
+
d = "failed", b.forEach((A) => {
|
|
1748
1748
|
A(void 0, c);
|
|
1749
1749
|
});
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1751
|
+
function C() {
|
|
1752
1752
|
h.forEach((A) => {
|
|
1753
1753
|
A.status === "pending" && (A.status = "aborted");
|
|
1754
1754
|
}), h = [];
|
|
1755
1755
|
}
|
|
1756
|
-
function S(A,
|
|
1757
|
-
const ii =
|
|
1756
|
+
function S(A, j, O) {
|
|
1757
|
+
const ii = j !== "success";
|
|
1758
1758
|
switch (h = h.filter((z) => z !== A), d) {
|
|
1759
1759
|
case "pending":
|
|
1760
1760
|
break;
|
|
@@ -1764,46 +1764,46 @@ function ra(i, e, o, s) {
|
|
|
1764
1764
|
default:
|
|
1765
1765
|
return;
|
|
1766
1766
|
}
|
|
1767
|
-
if (
|
|
1768
|
-
c = O,
|
|
1767
|
+
if (j === "abort") {
|
|
1768
|
+
c = O, y();
|
|
1769
1769
|
return;
|
|
1770
1770
|
}
|
|
1771
1771
|
if (ii) {
|
|
1772
|
-
c = O, h.length || (u.length ? N() :
|
|
1772
|
+
c = O, h.length || (u.length ? N() : y());
|
|
1773
1773
|
return;
|
|
1774
1774
|
}
|
|
1775
|
-
if (
|
|
1775
|
+
if (f(), C(), !i.random) {
|
|
1776
1776
|
const z = i.resources.indexOf(A.resource);
|
|
1777
1777
|
z !== -1 && z !== i.index && (i.index = z);
|
|
1778
1778
|
}
|
|
1779
|
-
d = "completed",
|
|
1779
|
+
d = "completed", b.forEach((z) => {
|
|
1780
1780
|
z(O);
|
|
1781
1781
|
});
|
|
1782
1782
|
}
|
|
1783
1783
|
function N() {
|
|
1784
1784
|
if (d !== "pending") return;
|
|
1785
|
-
|
|
1785
|
+
f();
|
|
1786
1786
|
const A = u.shift();
|
|
1787
1787
|
if (A === void 0) {
|
|
1788
1788
|
if (h.length) {
|
|
1789
1789
|
v = setTimeout(() => {
|
|
1790
|
-
|
|
1790
|
+
f(), d === "pending" && (C(), y());
|
|
1791
1791
|
}, i.timeout);
|
|
1792
1792
|
return;
|
|
1793
1793
|
}
|
|
1794
|
-
|
|
1794
|
+
y();
|
|
1795
1795
|
return;
|
|
1796
1796
|
}
|
|
1797
|
-
const
|
|
1797
|
+
const j = {
|
|
1798
1798
|
status: "pending",
|
|
1799
1799
|
resource: A,
|
|
1800
1800
|
callback: (O, ii) => {
|
|
1801
|
-
S(
|
|
1801
|
+
S(j, O, ii);
|
|
1802
1802
|
}
|
|
1803
1803
|
};
|
|
1804
|
-
h.push(
|
|
1804
|
+
h.push(j), r++, v = setTimeout(N, i.rotate), o(A, e, j.callback);
|
|
1805
1805
|
}
|
|
1806
|
-
return setTimeout(N),
|
|
1806
|
+
return setTimeout(N), p;
|
|
1807
1807
|
}
|
|
1808
1808
|
function Pe(i) {
|
|
1809
1809
|
const e = {
|
|
@@ -1858,7 +1858,7 @@ function ba(i, e, o) {
|
|
|
1858
1858
|
const u = ma(i);
|
|
1859
1859
|
u && (s = u.redundancy);
|
|
1860
1860
|
} else {
|
|
1861
|
-
const l =
|
|
1861
|
+
const l = En(i);
|
|
1862
1862
|
if (l) {
|
|
1863
1863
|
s = Pe(l);
|
|
1864
1864
|
const u = i.resources ? i.resources[0] : "", t = Cn(u);
|
|
@@ -1923,11 +1923,11 @@ function pa(i, e) {
|
|
|
1923
1923
|
a.forEach((c) => {
|
|
1924
1924
|
const v = l(c, s, o);
|
|
1925
1925
|
re(v, (h) => {
|
|
1926
|
-
const
|
|
1926
|
+
const b = h ? {
|
|
1927
1927
|
prefix: s,
|
|
1928
1928
|
icons: { [c]: h }
|
|
1929
1929
|
} : null;
|
|
1930
|
-
Fi(i, [c],
|
|
1930
|
+
Fi(i, [c], b);
|
|
1931
1931
|
});
|
|
1932
1932
|
});
|
|
1933
1933
|
return;
|
|
@@ -1965,8 +1965,8 @@ const ga = (i, e) => {
|
|
|
1965
1965
|
const v = a[r] || (a[r] = /* @__PURE__ */ Object.create(null));
|
|
1966
1966
|
v[c] || (v[c] = []);
|
|
1967
1967
|
}), s.pending.forEach((d) => {
|
|
1968
|
-
const { provider: r, prefix: c, name: v } = d, h = Oi(r, c),
|
|
1969
|
-
|
|
1968
|
+
const { provider: r, prefix: c, name: v } = d, h = Oi(r, c), b = h.pendingIcons || (h.pendingIcons = /* @__PURE__ */ new Set());
|
|
1969
|
+
b.has(v) || (b.add(v), a[r][c].push(v));
|
|
1970
1970
|
}), l.forEach((d) => {
|
|
1971
1971
|
const r = a[d.provider][d.prefix];
|
|
1972
1972
|
r.length && pa(d, r);
|
|
@@ -1976,7 +1976,7 @@ function fa(i, e) {
|
|
|
1976
1976
|
const o = { ...i };
|
|
1977
1977
|
for (const s in e) {
|
|
1978
1978
|
const a = e[s], l = typeof a;
|
|
1979
|
-
s in
|
|
1979
|
+
s in we ? (a === null || a && (l === "string" || l === "number")) && (o[s] = a) : l === typeof o[s] && (o[s] = s === "rotate" ? a % 4 : a);
|
|
1980
1980
|
}
|
|
1981
1981
|
return o;
|
|
1982
1982
|
}
|
|
@@ -2044,7 +2044,7 @@ function Ma(i) {
|
|
|
2044
2044
|
return Wi === void 0 && Ca(), Wi ? Wi.createHTML(i) : i;
|
|
2045
2045
|
}
|
|
2046
2046
|
const Re = {
|
|
2047
|
-
...
|
|
2047
|
+
...Ee,
|
|
2048
2048
|
inline: !1
|
|
2049
2049
|
}, Ta = {
|
|
2050
2050
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2071,32 +2071,32 @@ for (const i in be) {
|
|
|
2071
2071
|
for (const o in me)
|
|
2072
2072
|
e[i + o] = me[o];
|
|
2073
2073
|
}
|
|
2074
|
-
const
|
|
2074
|
+
const wa = {
|
|
2075
2075
|
...Re,
|
|
2076
2076
|
inline: !0
|
|
2077
2077
|
};
|
|
2078
2078
|
function ve(i) {
|
|
2079
2079
|
return i + (i.match(/^[-0-9.]+$/) ? "px" : "");
|
|
2080
2080
|
}
|
|
2081
|
-
const
|
|
2082
|
-
const s = e.inline ?
|
|
2081
|
+
const Ea = (i, e, o) => {
|
|
2082
|
+
const s = e.inline ? wa : Re, a = fa(s, e), l = e.mode || "svg", u = {}, t = e.style || {}, d = {
|
|
2083
2083
|
...l === "svg" ? Ta : {}
|
|
2084
2084
|
};
|
|
2085
2085
|
if (o) {
|
|
2086
2086
|
const g = ln(o, !1, !0);
|
|
2087
2087
|
if (g) {
|
|
2088
|
-
const
|
|
2088
|
+
const p = ["iconify"], y = [
|
|
2089
2089
|
"provider",
|
|
2090
2090
|
"prefix"
|
|
2091
2091
|
];
|
|
2092
|
-
for (const
|
|
2093
|
-
g[
|
|
2094
|
-
d.className =
|
|
2092
|
+
for (const C of y)
|
|
2093
|
+
g[C] && p.push("iconify--" + g[C]);
|
|
2094
|
+
d.className = p.join(" ");
|
|
2095
2095
|
}
|
|
2096
2096
|
}
|
|
2097
2097
|
for (let g in e) {
|
|
2098
|
-
const
|
|
2099
|
-
if (
|
|
2098
|
+
const p = e[g];
|
|
2099
|
+
if (p !== void 0)
|
|
2100
2100
|
switch (g) {
|
|
2101
2101
|
// Properties to ignore
|
|
2102
2102
|
case "icon":
|
|
@@ -2109,38 +2109,38 @@ const wa = (i, e, o) => {
|
|
|
2109
2109
|
break;
|
|
2110
2110
|
// Forward ref
|
|
2111
2111
|
case "_ref":
|
|
2112
|
-
d.ref =
|
|
2112
|
+
d.ref = p;
|
|
2113
2113
|
break;
|
|
2114
2114
|
// Merge class names
|
|
2115
2115
|
case "className":
|
|
2116
|
-
d[g] = (d[g] ? d[g] + " " : "") +
|
|
2116
|
+
d[g] = (d[g] ? d[g] + " " : "") + p;
|
|
2117
2117
|
break;
|
|
2118
2118
|
// Boolean attributes
|
|
2119
2119
|
case "inline":
|
|
2120
2120
|
case "hFlip":
|
|
2121
2121
|
case "vFlip":
|
|
2122
|
-
a[g] =
|
|
2122
|
+
a[g] = p === !0 || p === "true" || p === 1;
|
|
2123
2123
|
break;
|
|
2124
2124
|
// Flip as string: 'horizontal,vertical'
|
|
2125
2125
|
case "flip":
|
|
2126
|
-
typeof
|
|
2126
|
+
typeof p == "string" && ya(a, p);
|
|
2127
2127
|
break;
|
|
2128
2128
|
// Color: copy to style
|
|
2129
2129
|
case "color":
|
|
2130
|
-
u.color =
|
|
2130
|
+
u.color = p;
|
|
2131
2131
|
break;
|
|
2132
2132
|
// Rotation as string
|
|
2133
2133
|
case "rotate":
|
|
2134
|
-
typeof
|
|
2134
|
+
typeof p == "string" ? a[g] = Aa(p) : typeof p == "number" && (a[g] = p);
|
|
2135
2135
|
break;
|
|
2136
2136
|
// Remove aria-hidden
|
|
2137
2137
|
case "ariaHidden":
|
|
2138
2138
|
case "aria-hidden":
|
|
2139
|
-
|
|
2139
|
+
p !== !0 && p !== "true" && delete d["aria-hidden"];
|
|
2140
2140
|
break;
|
|
2141
2141
|
// Copy missing property if it does not exist in customisations
|
|
2142
2142
|
default:
|
|
2143
|
-
s[g] === void 0 && (d[g] =
|
|
2143
|
+
s[g] === void 0 && (d[g] = p);
|
|
2144
2144
|
}
|
|
2145
2145
|
}
|
|
2146
2146
|
const r = zo(i, a), c = r.attributes;
|
|
@@ -2149,23 +2149,23 @@ const wa = (i, e, o) => {
|
|
|
2149
2149
|
...u,
|
|
2150
2150
|
...t
|
|
2151
2151
|
}, Object.assign(d, c);
|
|
2152
|
-
let g = 0,
|
|
2153
|
-
return typeof
|
|
2154
|
-
__html: Ma(qo(r.body,
|
|
2152
|
+
let g = 0, p = e.id;
|
|
2153
|
+
return typeof p == "string" && (p = p.replace(/-/g, "_")), d.dangerouslySetInnerHTML = {
|
|
2154
|
+
__html: Ma(qo(r.body, p ? () => p + "ID" + g++ : "iconifyReact"))
|
|
2155
2155
|
}, Sn("svg", d);
|
|
2156
2156
|
}
|
|
2157
|
-
const { body: v, width: h, height:
|
|
2157
|
+
const { body: v, width: h, height: b } = i, f = l === "mask" || (l === "bg" ? !1 : v.indexOf("currentColor") !== -1), x = Sa(v, {
|
|
2158
2158
|
...c,
|
|
2159
2159
|
width: h + "",
|
|
2160
|
-
height:
|
|
2160
|
+
height: b + ""
|
|
2161
2161
|
});
|
|
2162
2162
|
return d.style = {
|
|
2163
2163
|
...u,
|
|
2164
|
-
"--svg": ka(
|
|
2164
|
+
"--svg": ka(x),
|
|
2165
2165
|
width: ve(c.width),
|
|
2166
2166
|
height: ve(c.height),
|
|
2167
2167
|
...Ba,
|
|
2168
|
-
...
|
|
2168
|
+
...f ? Mn : De,
|
|
2169
2169
|
...t
|
|
2170
2170
|
}, Sn("span", d);
|
|
2171
2171
|
};
|
|
@@ -2204,19 +2204,19 @@ if (typeof document != "undefined" && typeof window != "undefined") {
|
|
|
2204
2204
|
}
|
|
2205
2205
|
function Ie(i) {
|
|
2206
2206
|
const [e, o] = P(!!i.ssr), [s, a] = P({});
|
|
2207
|
-
function l(
|
|
2208
|
-
if (
|
|
2209
|
-
const
|
|
2210
|
-
if (typeof
|
|
2207
|
+
function l(b) {
|
|
2208
|
+
if (b) {
|
|
2209
|
+
const f = i.icon;
|
|
2210
|
+
if (typeof f == "object")
|
|
2211
2211
|
return {
|
|
2212
2212
|
name: "",
|
|
2213
|
-
data:
|
|
2213
|
+
data: f
|
|
2214
2214
|
};
|
|
2215
|
-
const
|
|
2216
|
-
if (
|
|
2215
|
+
const x = le(f);
|
|
2216
|
+
if (x)
|
|
2217
2217
|
return {
|
|
2218
|
-
name:
|
|
2219
|
-
data:
|
|
2218
|
+
name: f,
|
|
2219
|
+
data: x
|
|
2220
2220
|
};
|
|
2221
2221
|
}
|
|
2222
2222
|
return {
|
|
@@ -2225,41 +2225,41 @@ function Ie(i) {
|
|
|
2225
2225
|
}
|
|
2226
2226
|
const [u, t] = P(l(!!i.ssr));
|
|
2227
2227
|
function d() {
|
|
2228
|
-
const
|
|
2229
|
-
|
|
2228
|
+
const b = s.callback;
|
|
2229
|
+
b && (b(), a({}));
|
|
2230
2230
|
}
|
|
2231
|
-
function r(
|
|
2232
|
-
if (JSON.stringify(u) !== JSON.stringify(
|
|
2233
|
-
return d(), t(
|
|
2231
|
+
function r(b) {
|
|
2232
|
+
if (JSON.stringify(u) !== JSON.stringify(b))
|
|
2233
|
+
return d(), t(b), !0;
|
|
2234
2234
|
}
|
|
2235
2235
|
function c() {
|
|
2236
|
-
var
|
|
2237
|
-
const
|
|
2238
|
-
if (typeof
|
|
2236
|
+
var b;
|
|
2237
|
+
const f = i.icon;
|
|
2238
|
+
if (typeof f == "object") {
|
|
2239
2239
|
r({
|
|
2240
2240
|
name: "",
|
|
2241
|
-
data:
|
|
2241
|
+
data: f
|
|
2242
2242
|
});
|
|
2243
2243
|
return;
|
|
2244
2244
|
}
|
|
2245
|
-
const
|
|
2245
|
+
const x = le(f);
|
|
2246
2246
|
if (r({
|
|
2247
|
-
name:
|
|
2248
|
-
data:
|
|
2247
|
+
name: f,
|
|
2248
|
+
data: x
|
|
2249
2249
|
}))
|
|
2250
|
-
if (
|
|
2251
|
-
const g = ga([
|
|
2250
|
+
if (x === void 0) {
|
|
2251
|
+
const g = ga([f], c);
|
|
2252
2252
|
a({
|
|
2253
2253
|
callback: g
|
|
2254
2254
|
});
|
|
2255
|
-
} else
|
|
2255
|
+
} else x && ((b = i.onLoad) === null || b === void 0 || b.call(i, f));
|
|
2256
2256
|
}
|
|
2257
2257
|
D(() => (o(!0), d), []), D(() => {
|
|
2258
2258
|
e && c();
|
|
2259
2259
|
}, [i.icon, e]);
|
|
2260
2260
|
const { name: v, data: h } = u;
|
|
2261
|
-
return h ?
|
|
2262
|
-
...
|
|
2261
|
+
return h ? Ea({
|
|
2262
|
+
...wn,
|
|
2263
2263
|
...h
|
|
2264
2264
|
}, i, v) : i.children ? i.children : i.fallback ? i.fallback : Sn("span", {});
|
|
2265
2265
|
}
|
|
@@ -2327,7 +2327,7 @@ function Rn({
|
|
|
2327
2327
|
]
|
|
2328
2328
|
}
|
|
2329
2329
|
),
|
|
2330
|
-
/* @__PURE__ */ n.jsx(
|
|
2330
|
+
/* @__PURE__ */ n.jsx(Ei, { as: Zi, leave: "custom-select__transition", children: /* @__PURE__ */ n.jsx(
|
|
2331
2331
|
di.Options,
|
|
2332
2332
|
{
|
|
2333
2333
|
anchor: "bottom start",
|
|
@@ -2337,16 +2337,16 @@ function Rn({
|
|
|
2337
2337
|
di.Option,
|
|
2338
2338
|
{
|
|
2339
2339
|
value: v,
|
|
2340
|
-
className: ({ active:
|
|
2341
|
-
children: ({ selected:
|
|
2340
|
+
className: ({ active: b }) => `custom-select__option ${b ? "custom-select__option--active" : ""}`,
|
|
2341
|
+
children: ({ selected: b }) => /* @__PURE__ */ n.jsxs("div", { className: "custom-select__option-row", children: [
|
|
2342
2342
|
/* @__PURE__ */ n.jsx(
|
|
2343
2343
|
"span",
|
|
2344
2344
|
{
|
|
2345
|
-
className: `custom-select__option-label ${
|
|
2345
|
+
className: `custom-select__option-label ${b ? "custom-select__option--selected" : ""}`,
|
|
2346
2346
|
children: v.label
|
|
2347
2347
|
}
|
|
2348
2348
|
),
|
|
2349
|
-
|
|
2349
|
+
b && /* @__PURE__ */ n.jsx("span", { className: "custom-select__check", children: "✓" })
|
|
2350
2350
|
] })
|
|
2351
2351
|
},
|
|
2352
2352
|
h
|
|
@@ -2388,13 +2388,13 @@ function Ke({
|
|
|
2388
2388
|
}, [i]), D(() => {
|
|
2389
2389
|
if (l === "pdf" && (i != null && i.startsWith("data:")))
|
|
2390
2390
|
try {
|
|
2391
|
-
const
|
|
2392
|
-
for (let
|
|
2393
|
-
|
|
2394
|
-
const g = new Blob([
|
|
2395
|
-
return d(
|
|
2396
|
-
} catch (
|
|
2397
|
-
console.error("Error creating blob URL:",
|
|
2391
|
+
const b = atob(i.split(",")[1]), f = new ArrayBuffer(b.length), x = new Uint8Array(f);
|
|
2392
|
+
for (let y = 0; y < b.length; y++)
|
|
2393
|
+
x[y] = b.charCodeAt(y);
|
|
2394
|
+
const g = new Blob([f], { type: "application/pdf" }), p = URL.createObjectURL(g);
|
|
2395
|
+
return d(p), () => URL.revokeObjectURL(p);
|
|
2396
|
+
} catch (b) {
|
|
2397
|
+
console.error("Error creating blob URL:", b);
|
|
2398
2398
|
}
|
|
2399
2399
|
else
|
|
2400
2400
|
d(null);
|
|
@@ -2402,15 +2402,15 @@ function Ke({
|
|
|
2402
2402
|
const r = () => {
|
|
2403
2403
|
l === "image" || l === "pdf" ? a(!0) : window.open(t || i, "_blank");
|
|
2404
2404
|
}, c = () => a(!1), v = e || (i == null ? void 0 : i.split("/").pop()) || "Unknown file";
|
|
2405
|
-
function h(
|
|
2406
|
-
if (!
|
|
2407
|
-
if (
|
|
2405
|
+
function h(b, f = "download") {
|
|
2406
|
+
if (!b) return;
|
|
2407
|
+
if (b.startsWith("data:")) {
|
|
2408
2408
|
const g = document.createElement("a");
|
|
2409
|
-
g.href =
|
|
2409
|
+
g.href = b, g.download = f, document.body.appendChild(g), g.click(), document.body.removeChild(g);
|
|
2410
2410
|
return;
|
|
2411
2411
|
}
|
|
2412
|
-
const
|
|
2413
|
-
|
|
2412
|
+
const x = document.createElement("a");
|
|
2413
|
+
x.href = b, x.setAttribute("download", f), document.body.appendChild(x), x.click(), document.body.removeChild(x);
|
|
2414
2414
|
}
|
|
2415
2415
|
return /* @__PURE__ */ n.jsxs("div", { className: "mt-2 field-control !py-1 !bg-gray-50 !flex justify-between gap-x-8 items-center", children: [
|
|
2416
2416
|
/* @__PURE__ */ n.jsxs(
|
|
@@ -2456,7 +2456,7 @@ function Ke({
|
|
|
2456
2456
|
"div",
|
|
2457
2457
|
{
|
|
2458
2458
|
className: "relative bg-white p-8 rounded-lg w-full max-w-[90vw] max-h-[90vh] overflow-auto",
|
|
2459
|
-
onClick: (
|
|
2459
|
+
onClick: (b) => b.stopPropagation(),
|
|
2460
2460
|
children: [
|
|
2461
2461
|
/* @__PURE__ */ n.jsx(
|
|
2462
2462
|
"button",
|
|
@@ -2516,38 +2516,38 @@ function Ia({
|
|
|
2516
2516
|
const h = oi(
|
|
2517
2517
|
() => l == null ? void 0 : l.map((S) => S.value).join(", "),
|
|
2518
2518
|
[l]
|
|
2519
|
-
),
|
|
2519
|
+
), b = oi(
|
|
2520
2520
|
() => l == null ? void 0 : l.map((S) => S.label).join(", "),
|
|
2521
2521
|
[l]
|
|
2522
|
-
),
|
|
2522
|
+
), f = $(
|
|
2523
2523
|
async (S) => {
|
|
2524
2524
|
var A;
|
|
2525
2525
|
const N = xi("token");
|
|
2526
2526
|
try {
|
|
2527
|
-
const { data:
|
|
2527
|
+
const { data: j } = await Ii.post(u, S, {
|
|
2528
2528
|
headers: {
|
|
2529
2529
|
Authorization: `Bearer ${N}`
|
|
2530
2530
|
}
|
|
2531
2531
|
});
|
|
2532
|
-
return (A =
|
|
2533
|
-
} catch (
|
|
2534
|
-
throw console.error("File upload error:",
|
|
2532
|
+
return (A = j == null ? void 0 : j.data) == null ? void 0 : A.url;
|
|
2533
|
+
} catch (j) {
|
|
2534
|
+
throw console.error("File upload error:", j), new Error("Failed to upload file to server");
|
|
2535
2535
|
}
|
|
2536
2536
|
},
|
|
2537
2537
|
[u]
|
|
2538
|
-
),
|
|
2538
|
+
), x = $(
|
|
2539
2539
|
(S) => new Promise((N, A) => {
|
|
2540
|
-
const
|
|
2541
|
-
|
|
2540
|
+
const j = new FileReader();
|
|
2541
|
+
j.onloadend = async () => {
|
|
2542
2542
|
try {
|
|
2543
|
-
const O =
|
|
2543
|
+
const O = j.result.replace(
|
|
2544
2544
|
/^data:.*;base64,/,
|
|
2545
2545
|
""
|
|
2546
|
-
), ii = u ? await
|
|
2546
|
+
), ii = u ? await f({
|
|
2547
2547
|
base64: O,
|
|
2548
2548
|
ext: `.${S.name.split(".").pop()}`,
|
|
2549
2549
|
fileName: S.name
|
|
2550
|
-
}) :
|
|
2550
|
+
}) : j.result;
|
|
2551
2551
|
N({
|
|
2552
2552
|
base64: ii,
|
|
2553
2553
|
type: S.type,
|
|
@@ -2556,29 +2556,29 @@ function Ia({
|
|
|
2556
2556
|
} catch (O) {
|
|
2557
2557
|
A(O);
|
|
2558
2558
|
}
|
|
2559
|
-
},
|
|
2559
|
+
}, j.onerror = () => A(new Error("File read failed")), j.readAsDataURL(S);
|
|
2560
2560
|
}),
|
|
2561
|
-
[u,
|
|
2561
|
+
[u, f]
|
|
2562
2562
|
), g = $(
|
|
2563
2563
|
(S) => {
|
|
2564
2564
|
var A;
|
|
2565
|
-
const N = h ? (A = h.split(",")) == null ? void 0 : A.map((
|
|
2566
|
-
for (const
|
|
2567
|
-
if (
|
|
2565
|
+
const N = h ? (A = h.split(",")) == null ? void 0 : A.map((j) => j.trim()) : [];
|
|
2566
|
+
for (const j of S) {
|
|
2567
|
+
if (j.size > Da)
|
|
2568
2568
|
return ki.error(
|
|
2569
|
-
`File "${
|
|
2569
|
+
`File "${j.name}" exceeds 5MB limit (${(j.size / 1024 / 1024).toFixed(2)}MB)`
|
|
2570
2570
|
), !1;
|
|
2571
2571
|
if (N.length && !N.some(
|
|
2572
|
-
(O) =>
|
|
2572
|
+
(O) => j.type === O || j.name.toLowerCase().endsWith(O.replace("*", ""))
|
|
2573
2573
|
))
|
|
2574
2574
|
return ki.error(
|
|
2575
|
-
`File "${
|
|
2575
|
+
`File "${j.name}" is not an allowed type. Allowed: ${b || "any"}`
|
|
2576
2576
|
), !1;
|
|
2577
2577
|
}
|
|
2578
2578
|
return !0;
|
|
2579
2579
|
},
|
|
2580
|
-
[h,
|
|
2581
|
-
),
|
|
2580
|
+
[h, b]
|
|
2581
|
+
), p = $(
|
|
2582
2582
|
async (S) => {
|
|
2583
2583
|
const N = Array.from(S.target.files || []);
|
|
2584
2584
|
if (!(!N.length || c)) {
|
|
@@ -2588,8 +2588,8 @@ function Ia({
|
|
|
2588
2588
|
}
|
|
2589
2589
|
try {
|
|
2590
2590
|
v(!0);
|
|
2591
|
-
const A = await Promise.all(N == null ? void 0 : N.map(
|
|
2592
|
-
r(
|
|
2591
|
+
const A = await Promise.all(N == null ? void 0 : N.map(x)), j = s && d ? [...d, ...A] : A;
|
|
2592
|
+
r(j), i(j), ki.success(`Successfully uploaded ${N.length} file(s)`);
|
|
2593
2593
|
} catch (A) {
|
|
2594
2594
|
console.error("Upload error:", A), ki.error("Failed to upload file(s). Please try again.");
|
|
2595
2595
|
} finally {
|
|
@@ -2597,16 +2597,16 @@ function Ia({
|
|
|
2597
2597
|
}
|
|
2598
2598
|
}
|
|
2599
2599
|
},
|
|
2600
|
-
[c, g,
|
|
2601
|
-
),
|
|
2600
|
+
[c, g, x, i, s, d]
|
|
2601
|
+
), y = $(
|
|
2602
2602
|
(S) => {
|
|
2603
2603
|
c || (t.current && (t.current.value = ""), r((N) => {
|
|
2604
|
-
const A = S === void 0 ? null : (N == null ? void 0 : N.filter((
|
|
2604
|
+
const A = S === void 0 ? null : (N == null ? void 0 : N.filter((j, O) => O !== S)) || null;
|
|
2605
2605
|
return i(A), A;
|
|
2606
2606
|
}), o == null || o());
|
|
2607
2607
|
},
|
|
2608
2608
|
[o, i, c]
|
|
2609
|
-
),
|
|
2609
|
+
), C = d && d.length > 0;
|
|
2610
2610
|
return /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col items-start gap-2", children: [
|
|
2611
2611
|
!e && /* @__PURE__ */ n.jsxs("div", { className: "!flex field-control !py-0 !px-0 relative", children: [
|
|
2612
2612
|
/* @__PURE__ */ n.jsx(
|
|
@@ -2614,7 +2614,7 @@ function Ia({
|
|
|
2614
2614
|
{
|
|
2615
2615
|
ref: t,
|
|
2616
2616
|
type: "file",
|
|
2617
|
-
onChange:
|
|
2617
|
+
onChange: p,
|
|
2618
2618
|
disabled: e || c,
|
|
2619
2619
|
multiple: s,
|
|
2620
2620
|
accept: h || "",
|
|
@@ -2625,19 +2625,19 @@ function Ia({
|
|
|
2625
2625
|
hover:file:bg-blue-100 disabled:opacity-50 disabled:cursor-not-allowed`
|
|
2626
2626
|
}
|
|
2627
2627
|
),
|
|
2628
|
-
|
|
2628
|
+
C && /* @__PURE__ */ n.jsx(
|
|
2629
2629
|
"button",
|
|
2630
2630
|
{
|
|
2631
2631
|
type: "button",
|
|
2632
2632
|
className: "p-2 text-lg text-red-500 hover:text-red-600 transition-colors disabled:opacity-50",
|
|
2633
|
-
onClick: () =>
|
|
2633
|
+
onClick: () => y(),
|
|
2634
2634
|
disabled: c,
|
|
2635
2635
|
"aria-label": "Remove all files",
|
|
2636
2636
|
children: /* @__PURE__ */ n.jsx(_, { icon: "lets-icons:trash-duotone" })
|
|
2637
2637
|
}
|
|
2638
2638
|
)
|
|
2639
2639
|
] }),
|
|
2640
|
-
|
|
2640
|
+
C && /* @__PURE__ */ n.jsxs("div", { className: "relative grid gap-y-1 flex-1 w-full", children: [
|
|
2641
2641
|
c && /* @__PURE__ */ n.jsx("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-white/60 rounded", children: /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2 text-sm text-blue-600 font-medium", children: [
|
|
2642
2642
|
/* @__PURE__ */ n.jsx("span", { className: "animate-spin h-4 w-4 border-2 border-blue-500 border-t-transparent rounded-full" }),
|
|
2643
2643
|
"Uploading..."
|
|
@@ -2647,7 +2647,7 @@ function Ia({
|
|
|
2647
2647
|
{
|
|
2648
2648
|
fileUrl: S.base64,
|
|
2649
2649
|
fileName: S.name,
|
|
2650
|
-
removeFile: () =>
|
|
2650
|
+
removeFile: () => y(N)
|
|
2651
2651
|
},
|
|
2652
2652
|
`${S.name}-${N}`
|
|
2653
2653
|
)))
|
|
@@ -2728,13 +2728,13 @@ const F = ({
|
|
|
2728
2728
|
trigger: c,
|
|
2729
2729
|
prefix: v,
|
|
2730
2730
|
disabled: h,
|
|
2731
|
-
watch:
|
|
2732
|
-
min:
|
|
2733
|
-
max:
|
|
2731
|
+
watch: b,
|
|
2732
|
+
min: f,
|
|
2733
|
+
max: x,
|
|
2734
2734
|
description: g
|
|
2735
2735
|
}) => {
|
|
2736
|
-
var
|
|
2737
|
-
const
|
|
2736
|
+
var y, C, S, N;
|
|
2737
|
+
const p = o ? { ...o(e) } : {};
|
|
2738
2738
|
if (l === "amount")
|
|
2739
2739
|
return /* @__PURE__ */ n.jsxs("div", { className: "space-y-1.5 relative", children: [
|
|
2740
2740
|
/* @__PURE__ */ n.jsx(
|
|
@@ -2758,12 +2758,12 @@ const F = ({
|
|
|
2758
2758
|
disabled: h
|
|
2759
2759
|
}
|
|
2760
2760
|
),
|
|
2761
|
-
(s == null ? void 0 : s[e]) && /* @__PURE__ */ n.jsx("p", { className: "mt-1 text-sm text-red-600", children: (
|
|
2761
|
+
(s == null ? void 0 : s[e]) && /* @__PURE__ */ n.jsx("p", { className: "mt-1 text-sm text-red-600", children: (y = s[e]) == null ? void 0 : y.message })
|
|
2762
2762
|
] });
|
|
2763
2763
|
if (["checkbox", "radio"].includes(l)) {
|
|
2764
|
-
const A = (
|
|
2765
|
-
let
|
|
2766
|
-
return A && (A != null && A.length && l === "checkbox" ?
|
|
2764
|
+
const A = (b == null ? void 0 : b(e)) || null;
|
|
2765
|
+
let j = !1;
|
|
2766
|
+
return A && (A != null && A.length && l === "checkbox" ? j = A == null ? void 0 : A.includes(r) : j = A == r), /* @__PURE__ */ n.jsxs("div", { className: "space-y-1", children: [
|
|
2767
2767
|
/* @__PURE__ */ n.jsxs(
|
|
2768
2768
|
"label",
|
|
2769
2769
|
{
|
|
@@ -2772,7 +2772,7 @@ const F = ({
|
|
|
2772
2772
|
/* @__PURE__ */ n.jsx(
|
|
2773
2773
|
"input",
|
|
2774
2774
|
{
|
|
2775
|
-
...
|
|
2775
|
+
...p,
|
|
2776
2776
|
type: l,
|
|
2777
2777
|
value: r || "",
|
|
2778
2778
|
disabled: h,
|
|
@@ -2791,7 +2791,7 @@ const F = ({
|
|
|
2791
2791
|
peer-disabled:opacity-60
|
|
2792
2792
|
peer-disabled:cursor-not-allowed
|
|
2793
2793
|
`,
|
|
2794
|
-
children:
|
|
2794
|
+
children: j && /* @__PURE__ */ n.jsx(
|
|
2795
2795
|
_,
|
|
2796
2796
|
{
|
|
2797
2797
|
icon: "meteor-icons:check",
|
|
@@ -2807,7 +2807,7 @@ const F = ({
|
|
|
2807
2807
|
]
|
|
2808
2808
|
}
|
|
2809
2809
|
),
|
|
2810
|
-
(s == null ? void 0 : s[e]) && /* @__PURE__ */ n.jsx("p", { className: "ml-8 text-sm text-red-600", children: (
|
|
2810
|
+
(s == null ? void 0 : s[e]) && /* @__PURE__ */ n.jsx("p", { className: "ml-8 text-sm text-red-600", children: (C = s[e]) == null ? void 0 : C.message })
|
|
2811
2811
|
] });
|
|
2812
2812
|
}
|
|
2813
2813
|
return l === "textarea" ? /* @__PURE__ */ n.jsxs("div", { className: "space-y-1.5 relative", children: [
|
|
@@ -2821,7 +2821,7 @@ const F = ({
|
|
|
2821
2821
|
/* @__PURE__ */ n.jsx(
|
|
2822
2822
|
"textarea",
|
|
2823
2823
|
{
|
|
2824
|
-
...
|
|
2824
|
+
...p,
|
|
2825
2825
|
className: `field-control ${s != null && s[e] ? "border-red-300" : "border-[#D0D5DD]"} ${a}`,
|
|
2826
2826
|
placeholder: u,
|
|
2827
2827
|
disabled: h
|
|
@@ -2839,13 +2839,13 @@ const F = ({
|
|
|
2839
2839
|
/* @__PURE__ */ n.jsx(
|
|
2840
2840
|
"input",
|
|
2841
2841
|
{
|
|
2842
|
-
...
|
|
2842
|
+
...p,
|
|
2843
2843
|
type: l,
|
|
2844
2844
|
className: `field-control ${s != null && s[e] ? "border-red-300" : "border-[#D0D5DD]"} ${a}`,
|
|
2845
2845
|
placeholder: t ? "" : u,
|
|
2846
2846
|
disabled: h,
|
|
2847
|
-
min:
|
|
2848
|
-
max:
|
|
2847
|
+
min: f,
|
|
2848
|
+
max: x
|
|
2849
2849
|
}
|
|
2850
2850
|
),
|
|
2851
2851
|
(s == null ? void 0 : s[e]) && /* @__PURE__ */ n.jsx("p", { className: "mt-1 text-sm text-red-600", children: (N = s[e]) == null ? void 0 : N.message })
|
|
@@ -2915,36 +2915,36 @@ const Di = ({
|
|
|
2915
2915
|
isFloatingLabel: c,
|
|
2916
2916
|
subText: v,
|
|
2917
2917
|
labelClass: h = "text-[10px]",
|
|
2918
|
-
loading:
|
|
2919
|
-
disabled:
|
|
2918
|
+
loading: b,
|
|
2919
|
+
disabled: f
|
|
2920
2920
|
}) => {
|
|
2921
|
-
const [
|
|
2921
|
+
const [x, g] = P(r ? [] : null), p = Ci(!1), y = oi(() => !t || !i || i.length === 0 ? r ? [] : null : r ? Array.isArray(t) ? i.filter((N) => t.some(
|
|
2922
2922
|
(A) => {
|
|
2923
|
-
var
|
|
2924
|
-
return typeof N.value == "object" ? ((
|
|
2923
|
+
var j;
|
|
2924
|
+
return typeof N.value == "object" ? ((j = N.value) == null ? void 0 : j.id) === (A == null ? void 0 : A.id) : N.value === A;
|
|
2925
2925
|
}
|
|
2926
2926
|
)) : [] : i.find((N) => {
|
|
2927
2927
|
var A;
|
|
2928
2928
|
return typeof N.value == "string" && typeof t == "string" ? N.value.toLowerCase() === t.toLowerCase() : typeof N.value == "object" && typeof t == "object" ? ((A = N.value) == null ? void 0 : A.id) === (t == null ? void 0 : t.id) : N.value === t;
|
|
2929
2929
|
}) || null, [t, i, r]);
|
|
2930
2930
|
D(() => {
|
|
2931
|
-
if (
|
|
2932
|
-
|
|
2931
|
+
if (p.current) {
|
|
2932
|
+
p.current = !1;
|
|
2933
2933
|
return;
|
|
2934
2934
|
}
|
|
2935
|
-
if (r && Array.isArray(
|
|
2936
|
-
const N =
|
|
2937
|
-
JSON.stringify(N) !== JSON.stringify(A) && g(
|
|
2938
|
-
} else (
|
|
2939
|
-
}, [
|
|
2940
|
-
const
|
|
2935
|
+
if (r && Array.isArray(y) && Array.isArray(x)) {
|
|
2936
|
+
const N = x == null ? void 0 : x.map((j) => j.value), A = y == null ? void 0 : y.map((j) => j.value);
|
|
2937
|
+
JSON.stringify(N) !== JSON.stringify(A) && g(y);
|
|
2938
|
+
} else (y == null ? void 0 : y.value) !== (x == null ? void 0 : x.value) && g(y);
|
|
2939
|
+
}, [y, r]);
|
|
2940
|
+
const C = $((N) => {
|
|
2941
2941
|
var A;
|
|
2942
|
-
if (
|
|
2943
|
-
const
|
|
2944
|
-
a(l,
|
|
2942
|
+
if (p.current = !0, g(N), a) {
|
|
2943
|
+
const j = r ? Array.isArray(N) ? N == null ? void 0 : N.map((O) => O.value) : [] : (A = N == null ? void 0 : N.value) != null ? A : null;
|
|
2944
|
+
a(l, j), d == null || d(l);
|
|
2945
2945
|
}
|
|
2946
|
-
s && !
|
|
2947
|
-
}, [a, l, d, s, r]), S = oi(() =>
|
|
2946
|
+
s && !p.current && s(l);
|
|
2947
|
+
}, [a, l, d, s, r]), S = oi(() => b ? "Fetching data..." : x ? r && Array.isArray(x) ? x.length > 0 ? x == null ? void 0 : x.map((N) => N.label).join(", ") : e : (x == null ? void 0 : x.label) || e : e, [x, b, e, r]);
|
|
2948
2948
|
return /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
|
|
2949
2949
|
!c && u && /* @__PURE__ */ n.jsx("label", { className: "block text-sm text-[#686878] darks:text-white/70 mb-2", children: u }),
|
|
2950
2950
|
c && u && /* @__PURE__ */ n.jsx(
|
|
@@ -2960,17 +2960,17 @@ const Di = ({
|
|
|
2960
2960
|
/* @__PURE__ */ n.jsx(
|
|
2961
2961
|
di,
|
|
2962
2962
|
{
|
|
2963
|
-
value:
|
|
2964
|
-
onChange:
|
|
2963
|
+
value: x,
|
|
2964
|
+
onChange: C,
|
|
2965
2965
|
multiple: r,
|
|
2966
|
-
disabled:
|
|
2966
|
+
disabled: f || b,
|
|
2967
2967
|
children: /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
|
|
2968
|
-
/* @__PURE__ */ n.jsxs(di.Button, { className: "field-control", disabled:
|
|
2968
|
+
/* @__PURE__ */ n.jsxs(di.Button, { className: "field-control", disabled: f || b, children: [
|
|
2969
2969
|
/* @__PURE__ */ n.jsx(
|
|
2970
2970
|
"span",
|
|
2971
2971
|
{
|
|
2972
2972
|
className: q("block text-sm text-left truncate", {
|
|
2973
|
-
"opacity-60": !
|
|
2973
|
+
"opacity-60": !x || b
|
|
2974
2974
|
}),
|
|
2975
2975
|
children: S
|
|
2976
2976
|
}
|
|
@@ -2978,13 +2978,13 @@ const Di = ({
|
|
|
2978
2978
|
/* @__PURE__ */ n.jsx("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ n.jsx(_, { icon: "lucide:chevron-down" }) })
|
|
2979
2979
|
] }),
|
|
2980
2980
|
/* @__PURE__ */ n.jsx(
|
|
2981
|
-
|
|
2981
|
+
Ei,
|
|
2982
2982
|
{
|
|
2983
2983
|
leave: "transition ease-in duration-100",
|
|
2984
2984
|
leaveFrom: "opacity-100",
|
|
2985
2985
|
leaveTo: "opacity-0",
|
|
2986
2986
|
children: /* @__PURE__ */ n.jsx(di.Options, { anchor: "bottom start", className: "select-button-options", children: i.length === 0 ? /* @__PURE__ */ n.jsx("div", { className: "px-3 py-2 text-sm text-gray-500", children: "No options available" }) : i == null ? void 0 : i.map((N, A) => {
|
|
2987
|
-
var
|
|
2987
|
+
var j;
|
|
2988
2988
|
return /* @__PURE__ */ n.jsx(
|
|
2989
2989
|
di.Option,
|
|
2990
2990
|
{
|
|
@@ -2992,7 +2992,7 @@ const Di = ({
|
|
|
2992
2992
|
className: ({ active: O }) => q("select-option", { active: O }),
|
|
2993
2993
|
children: ({ selected: O }) => /* @__PURE__ */ n.jsx("div", { className: q("option-text", { selected: O }), children: N.label })
|
|
2994
2994
|
},
|
|
2995
|
-
((
|
|
2995
|
+
((j = N.value) == null ? void 0 : j.id) || N.value || A
|
|
2996
2996
|
);
|
|
2997
2997
|
}) })
|
|
2998
2998
|
}
|
|
@@ -3013,23 +3013,23 @@ function Tn({
|
|
|
3013
3013
|
name: l
|
|
3014
3014
|
}) {
|
|
3015
3015
|
const [u, t] = P(""), d = oi(() => {
|
|
3016
|
-
const
|
|
3017
|
-
return i.find((
|
|
3016
|
+
const b = e != null ? e : o;
|
|
3017
|
+
return i.find((f) => f.value === b || f.label === b) || null;
|
|
3018
3018
|
}, [e, o, i]), [r, c] = P(d);
|
|
3019
3019
|
D(() => {
|
|
3020
3020
|
if (e !== void 0) {
|
|
3021
|
-
const
|
|
3022
|
-
c(
|
|
3021
|
+
const b = i.find((f) => f.value === e || f.label === e) || null;
|
|
3022
|
+
c(b);
|
|
3023
3023
|
}
|
|
3024
3024
|
}, [e, i]);
|
|
3025
3025
|
const v = oi(() => {
|
|
3026
3026
|
if (u === "") return i;
|
|
3027
|
-
const
|
|
3027
|
+
const b = u.toLowerCase();
|
|
3028
3028
|
return i.filter(
|
|
3029
|
-
(
|
|
3029
|
+
(f) => f.label.toLowerCase().includes(b)
|
|
3030
3030
|
);
|
|
3031
|
-
}, [u, i]), h = $((
|
|
3032
|
-
c(
|
|
3031
|
+
}, [u, i]), h = $((b) => {
|
|
3032
|
+
c(b), s(l, b);
|
|
3033
3033
|
}, [l, s]);
|
|
3034
3034
|
return /* @__PURE__ */ n.jsx("div", { className: "relative w-full", children: /* @__PURE__ */ n.jsxs(
|
|
3035
3035
|
Ri,
|
|
@@ -3043,21 +3043,21 @@ function Tn({
|
|
|
3043
3043
|
vo,
|
|
3044
3044
|
{
|
|
3045
3045
|
className: "field-control",
|
|
3046
|
-
displayValue: (
|
|
3047
|
-
onChange: (
|
|
3046
|
+
displayValue: (b) => (b == null ? void 0 : b.label) || "",
|
|
3047
|
+
onChange: (b) => t(b.target.value),
|
|
3048
3048
|
placeholder: "Select an option..."
|
|
3049
3049
|
}
|
|
3050
3050
|
),
|
|
3051
3051
|
/* @__PURE__ */ n.jsx(ho, { className: "absolute inset-y-0 right-0 flex items-center px-2 text-gray-400 hover:text-gray-600", children: /* @__PURE__ */ n.jsx(_, { icon: "octicon:chevron-down-12" }) })
|
|
3052
3052
|
] }),
|
|
3053
|
-
/* @__PURE__ */ n.jsx(po, { anchor: "bottom start", className: "select-options__combo", children: v.length === 0 ? /* @__PURE__ */ n.jsx("div", { className: "px-3 py-2 text-sm text-gray-500", children: "No results found." }) : v == null ? void 0 : v.map((
|
|
3053
|
+
/* @__PURE__ */ n.jsx(po, { anchor: "bottom start", className: "select-options__combo", children: v.length === 0 ? /* @__PURE__ */ n.jsx("div", { className: "px-3 py-2 text-sm text-gray-500", children: "No results found." }) : v == null ? void 0 : v.map((b) => /* @__PURE__ */ n.jsx(
|
|
3054
3054
|
go,
|
|
3055
3055
|
{
|
|
3056
|
-
value:
|
|
3057
|
-
className: ({ active:
|
|
3058
|
-
children: ({ selected:
|
|
3056
|
+
value: b,
|
|
3057
|
+
className: ({ active: f, selected: x }) => q("select-option", { active: f, selected: x }),
|
|
3058
|
+
children: ({ selected: f }) => /* @__PURE__ */ n.jsx("div", { className: q("option-text", { selected: f }), children: b.label })
|
|
3059
3059
|
},
|
|
3060
|
-
|
|
3060
|
+
b.value
|
|
3061
3061
|
)) })
|
|
3062
3062
|
]
|
|
3063
3063
|
}
|
|
@@ -3670,8 +3670,8 @@ const ls = () => /* @__PURE__ */ n.jsx("blockquote", { className: "bg-gray-100 p
|
|
|
3670
3670
|
const v = c.target.result, h = jo.parse(v, { header: !0 });
|
|
3671
3671
|
i(e, h.data);
|
|
3672
3672
|
}, r.readAsText(d)) : d.name.endsWith(".xlsx") || d.name.endsWith(".xls") ? (r.onload = (c) => {
|
|
3673
|
-
const v = new Uint8Array(c.target.result), h = Xn.read(v, { type: "array" }),
|
|
3674
|
-
i(e,
|
|
3673
|
+
const v = new Uint8Array(c.target.result), h = Xn.read(v, { type: "array" }), b = h.SheetNames[0], f = h.Sheets[b], x = Xn.utils.sheet_to_json(f);
|
|
3674
|
+
i(e, x);
|
|
3675
3675
|
}, r.readAsArrayBuffer(d)) : ki.error("Unsupported file type. Please upload a CSV or Excel file.");
|
|
3676
3676
|
};
|
|
3677
3677
|
return /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
|
|
@@ -3778,7 +3778,7 @@ function bs({
|
|
|
3778
3778
|
});
|
|
3779
3779
|
}, [l, u, a]), d = (r, c, v) => {
|
|
3780
3780
|
const h = u == null ? void 0 : u.map(
|
|
3781
|
-
(
|
|
3781
|
+
(b, f) => f === r ? { ...b, [c]: v } : b
|
|
3782
3782
|
);
|
|
3783
3783
|
e("visibilityDependentFields", h);
|
|
3784
3784
|
};
|
|
@@ -3812,11 +3812,11 @@ function bs({
|
|
|
3812
3812
|
di,
|
|
3813
3813
|
{
|
|
3814
3814
|
value: r.fieldType,
|
|
3815
|
-
onChange: (
|
|
3815
|
+
onChange: (b) => d(c, "fieldType", b),
|
|
3816
3816
|
children: /* @__PURE__ */ n.jsxs("div", { className: "listbox-wrapper", children: [
|
|
3817
3817
|
/* @__PURE__ */ n.jsx(di.Button, { className: "listbox-button", children: r.fieldType }),
|
|
3818
3818
|
/* @__PURE__ */ n.jsx(
|
|
3819
|
-
|
|
3819
|
+
Ei,
|
|
3820
3820
|
{
|
|
3821
3821
|
as: Zi,
|
|
3822
3822
|
leave: "transition ease-in duration-100",
|
|
@@ -3827,14 +3827,14 @@ function bs({
|
|
|
3827
3827
|
{
|
|
3828
3828
|
className: "listbox-options ",
|
|
3829
3829
|
anchor: "bottom",
|
|
3830
|
-
children: gn == null ? void 0 : gn.map((
|
|
3830
|
+
children: gn == null ? void 0 : gn.map((b) => /* @__PURE__ */ n.jsx(
|
|
3831
3831
|
di.Option,
|
|
3832
3832
|
{
|
|
3833
|
-
value:
|
|
3833
|
+
value: b,
|
|
3834
3834
|
className: "listbox-option",
|
|
3835
|
-
children:
|
|
3835
|
+
children: b
|
|
3836
3836
|
},
|
|
3837
|
-
|
|
3837
|
+
b
|
|
3838
3838
|
))
|
|
3839
3839
|
}
|
|
3840
3840
|
)
|
|
@@ -3847,11 +3847,11 @@ function bs({
|
|
|
3847
3847
|
di,
|
|
3848
3848
|
{
|
|
3849
3849
|
value: r.operator,
|
|
3850
|
-
onChange: (
|
|
3850
|
+
onChange: (b) => d(c, "operator", b),
|
|
3851
3851
|
children: /* @__PURE__ */ n.jsxs("div", { className: "listbox-wrapper", children: [
|
|
3852
3852
|
/* @__PURE__ */ n.jsx(di.Button, { className: "listbox-button", children: r.operator.replace("_", " ") }),
|
|
3853
3853
|
/* @__PURE__ */ n.jsx(
|
|
3854
|
-
|
|
3854
|
+
Ei,
|
|
3855
3855
|
{
|
|
3856
3856
|
as: Zi,
|
|
3857
3857
|
leave: "transition ease-in duration-100",
|
|
@@ -3862,14 +3862,14 @@ function bs({
|
|
|
3862
3862
|
{
|
|
3863
3863
|
className: "listbox-options ",
|
|
3864
3864
|
anchor: "bottom",
|
|
3865
|
-
children: (v = r.fieldType === "number" ? [...pe, ...ms] : pe) == null ? void 0 : v.map((
|
|
3865
|
+
children: (v = r.fieldType === "number" ? [...pe, ...ms] : pe) == null ? void 0 : v.map((b) => /* @__PURE__ */ n.jsx(
|
|
3866
3866
|
di.Option,
|
|
3867
3867
|
{
|
|
3868
|
-
value:
|
|
3868
|
+
value: b,
|
|
3869
3869
|
className: "listbox-option",
|
|
3870
|
-
children:
|
|
3870
|
+
children: b.replace("_", " ")
|
|
3871
3871
|
},
|
|
3872
|
-
|
|
3872
|
+
b
|
|
3873
3873
|
))
|
|
3874
3874
|
}
|
|
3875
3875
|
)
|
|
@@ -3883,7 +3883,7 @@ function bs({
|
|
|
3883
3883
|
{
|
|
3884
3884
|
type: r.fieldType,
|
|
3885
3885
|
value: r.fieldValue || "",
|
|
3886
|
-
onChange: (
|
|
3886
|
+
onChange: (b) => d(c, "fieldValue", b.target.value),
|
|
3887
3887
|
placeholder: "Value",
|
|
3888
3888
|
className: "field-value"
|
|
3889
3889
|
}
|
|
@@ -3891,11 +3891,11 @@ function bs({
|
|
|
3891
3891
|
di,
|
|
3892
3892
|
{
|
|
3893
3893
|
value: (h = r.fieldValue) != null ? h : "",
|
|
3894
|
-
onChange: (
|
|
3894
|
+
onChange: (b) => d(c, "fieldValue", b),
|
|
3895
3895
|
children: /* @__PURE__ */ n.jsxs("div", { className: "listbox-wrapper", children: [
|
|
3896
3896
|
/* @__PURE__ */ n.jsx(di.Button, { className: "listbox-button", children: r.fieldValue === !0 ? "True" : r.fieldValue === !1 ? "False" : "Select value" }),
|
|
3897
3897
|
/* @__PURE__ */ n.jsx(
|
|
3898
|
-
|
|
3898
|
+
Ei,
|
|
3899
3899
|
{
|
|
3900
3900
|
as: Zi,
|
|
3901
3901
|
leave: "transition ease-in duration-100",
|
|
@@ -4016,12 +4016,12 @@ const vs = B.object().shape({
|
|
|
4016
4016
|
(L) => !qi.includes(o.inputType) || L.key !== "validation"
|
|
4017
4017
|
), { updateElement: a } = mi.useContext(gi), [l, u] = P("basic"), [t, d] = P(!1), [r, c] = P("manual"), v = xi("config"), {
|
|
4018
4018
|
register: h,
|
|
4019
|
-
handleSubmit:
|
|
4020
|
-
control:
|
|
4021
|
-
setValue:
|
|
4019
|
+
handleSubmit: b,
|
|
4020
|
+
control: f,
|
|
4021
|
+
setValue: x,
|
|
4022
4022
|
watch: g,
|
|
4023
|
-
trigger:
|
|
4024
|
-
formState: { errors:
|
|
4023
|
+
trigger: p,
|
|
4024
|
+
formState: { errors: y, isSubmitting: C, isValid: S },
|
|
4025
4025
|
reset: N
|
|
4026
4026
|
} = Bn({
|
|
4027
4027
|
resolver: Dn(vs),
|
|
@@ -4029,22 +4029,22 @@ const vs = B.object().shape({
|
|
|
4029
4029
|
...o,
|
|
4030
4030
|
options: o.options || []
|
|
4031
4031
|
}
|
|
4032
|
-
}), A = g(), { fields:
|
|
4033
|
-
control:
|
|
4032
|
+
}), A = g(), { fields: j, append: O, remove: ii } = mn({
|
|
4033
|
+
control: f,
|
|
4034
4034
|
name: "options"
|
|
4035
4035
|
}), {
|
|
4036
4036
|
fields: z,
|
|
4037
4037
|
append: Z,
|
|
4038
|
-
remove:
|
|
4038
|
+
remove: E
|
|
4039
4039
|
} = mn({
|
|
4040
|
-
control:
|
|
4040
|
+
control: f,
|
|
4041
4041
|
name: "options1"
|
|
4042
4042
|
}), {
|
|
4043
4043
|
fields: W,
|
|
4044
4044
|
append: I,
|
|
4045
4045
|
remove: G
|
|
4046
4046
|
} = mn({
|
|
4047
|
-
control:
|
|
4047
|
+
control: f,
|
|
4048
4048
|
name: "dataColumns"
|
|
4049
4049
|
});
|
|
4050
4050
|
D(() => {
|
|
@@ -4056,7 +4056,7 @@ const vs = B.object().shape({
|
|
|
4056
4056
|
headers: {
|
|
4057
4057
|
Authorization: `Bearer ${xi("token")}`
|
|
4058
4058
|
}
|
|
4059
|
-
},
|
|
4059
|
+
}, w = $(async () => {
|
|
4060
4060
|
var L, K, X;
|
|
4061
4061
|
if (!A.apiUrl || !/^https?:\/\//.test(A.apiUrl)) {
|
|
4062
4062
|
ki.info("Please provide a valid API URL");
|
|
@@ -4074,16 +4074,16 @@ const vs = B.object().shape({
|
|
|
4074
4074
|
ki.error("Expected an array in response (data, record, or result).");
|
|
4075
4075
|
return;
|
|
4076
4076
|
}
|
|
4077
|
-
((L = o.type) == null ? void 0 : L.toLowerCase()) === "datagrid" ?
|
|
4077
|
+
((L = o.type) == null ? void 0 : L.toLowerCase()) === "datagrid" ? x("dataColumns", li) : x("options", li);
|
|
4078
4078
|
} catch (ui) {
|
|
4079
4079
|
const J = ((X = (K = ui == null ? void 0 : ui.response) == null ? void 0 : K.data) == null ? void 0 : X.message) || (ui == null ? void 0 : ui.message) || "Unable to load options";
|
|
4080
4080
|
ki.error(J);
|
|
4081
4081
|
} finally {
|
|
4082
4082
|
d(!1);
|
|
4083
4083
|
}
|
|
4084
|
-
}, [o.type,
|
|
4084
|
+
}, [o.type, x, A.apiUrl]), U = ["manual", "api", "sheet"];
|
|
4085
4085
|
function ci() {
|
|
4086
|
-
r === "api" &&
|
|
4086
|
+
r === "api" && w();
|
|
4087
4087
|
}
|
|
4088
4088
|
const ni = () => /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col justify-start gap-y-1", children: [
|
|
4089
4089
|
/* @__PURE__ */ n.jsx("div", { className: "flex items-center mb-4 gap-x-5", children: U == null ? void 0 : U.map((L) => /* @__PURE__ */ n.jsxs("label", { className: "items-center text-base capitalize gap-x-3", children: [
|
|
@@ -4111,7 +4111,7 @@ const vs = B.object().shape({
|
|
|
4111
4111
|
watch: g,
|
|
4112
4112
|
label: "Load Options from Api",
|
|
4113
4113
|
name: "apiUrl",
|
|
4114
|
-
errors:
|
|
4114
|
+
errors: y,
|
|
4115
4115
|
register: h,
|
|
4116
4116
|
className: "!w-full",
|
|
4117
4117
|
placeholder: "https://example.com/options",
|
|
@@ -4137,13 +4137,13 @@ const vs = B.object().shape({
|
|
|
4137
4137
|
{
|
|
4138
4138
|
isFloating: !0,
|
|
4139
4139
|
label: "Load options form sheet (csv, xlsx)",
|
|
4140
|
-
setValue:
|
|
4140
|
+
setValue: x,
|
|
4141
4141
|
name: "options"
|
|
4142
4142
|
}
|
|
4143
4143
|
) }),
|
|
4144
4144
|
/* @__PURE__ */ n.jsxs("div", { children: [
|
|
4145
4145
|
/* @__PURE__ */ n.jsx("h3", { className: "mb-4 text-sm text-gray-500", children: "Parent Options " }),
|
|
4146
|
-
|
|
4146
|
+
j == null ? void 0 : j.map((L, K) => /* @__PURE__ */ n.jsxs(
|
|
4147
4147
|
"div",
|
|
4148
4148
|
{
|
|
4149
4149
|
className: "flex items-center mb-1 gap-x-4 last:mb-0",
|
|
@@ -4155,7 +4155,7 @@ const vs = B.object().shape({
|
|
|
4155
4155
|
label: K === 0 ? "Label" : "",
|
|
4156
4156
|
name: `options.${K}.label`,
|
|
4157
4157
|
register: h,
|
|
4158
|
-
errors:
|
|
4158
|
+
errors: y,
|
|
4159
4159
|
element: o,
|
|
4160
4160
|
placeholder: "Label"
|
|
4161
4161
|
}
|
|
@@ -4167,7 +4167,7 @@ const vs = B.object().shape({
|
|
|
4167
4167
|
label: K === 0 ? "Value" : "",
|
|
4168
4168
|
name: `options.${K}.value`,
|
|
4169
4169
|
register: h,
|
|
4170
|
-
errors:
|
|
4170
|
+
errors: y,
|
|
4171
4171
|
element: o,
|
|
4172
4172
|
placeholder: "Value"
|
|
4173
4173
|
}
|
|
@@ -4175,7 +4175,7 @@ const vs = B.object().shape({
|
|
|
4175
4175
|
/* @__PURE__ */ n.jsx(
|
|
4176
4176
|
"button",
|
|
4177
4177
|
{
|
|
4178
|
-
disabled:
|
|
4178
|
+
disabled: j.length === 1,
|
|
4179
4179
|
type: "button",
|
|
4180
4180
|
className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
4181
4181
|
onClick: () => ii(K),
|
|
@@ -4220,7 +4220,7 @@ const vs = B.object().shape({
|
|
|
4220
4220
|
label: "Label",
|
|
4221
4221
|
name: `options1.${K}.label`,
|
|
4222
4222
|
register: h,
|
|
4223
|
-
errors:
|
|
4223
|
+
errors: y,
|
|
4224
4224
|
element: o,
|
|
4225
4225
|
placeholder: "Label",
|
|
4226
4226
|
isFloating: !0
|
|
@@ -4233,7 +4233,7 @@ const vs = B.object().shape({
|
|
|
4233
4233
|
label: "Value",
|
|
4234
4234
|
name: `options1.${K}.value`,
|
|
4235
4235
|
register: h,
|
|
4236
|
-
errors:
|
|
4236
|
+
errors: y,
|
|
4237
4237
|
element: o,
|
|
4238
4238
|
placeholder: "Value",
|
|
4239
4239
|
isFloating: !0
|
|
@@ -4246,7 +4246,7 @@ const vs = B.object().shape({
|
|
|
4246
4246
|
label: "Key",
|
|
4247
4247
|
name: `options1.${K}.key`,
|
|
4248
4248
|
register: h,
|
|
4249
|
-
errors:
|
|
4249
|
+
errors: y,
|
|
4250
4250
|
element: o,
|
|
4251
4251
|
placeholder: "Key",
|
|
4252
4252
|
isFloating: !0
|
|
@@ -4258,7 +4258,7 @@ const vs = B.object().shape({
|
|
|
4258
4258
|
disabled: z.length === 1,
|
|
4259
4259
|
type: "button",
|
|
4260
4260
|
className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
4261
|
-
onClick: () =>
|
|
4261
|
+
onClick: () => E(K),
|
|
4262
4262
|
children: /* @__PURE__ */ n.jsx(_, { icon: "iconamoon:sign-times-fill" })
|
|
4263
4263
|
}
|
|
4264
4264
|
)
|
|
@@ -4310,7 +4310,7 @@ const vs = B.object().shape({
|
|
|
4310
4310
|
watch: g,
|
|
4311
4311
|
label: "Load Columns from Api",
|
|
4312
4312
|
name: "apiUrl",
|
|
4313
|
-
errors:
|
|
4313
|
+
errors: y,
|
|
4314
4314
|
register: h,
|
|
4315
4315
|
className: "!w-full",
|
|
4316
4316
|
placeholder: "https://example.com/columns",
|
|
@@ -4337,7 +4337,7 @@ const vs = B.object().shape({
|
|
|
4337
4337
|
{
|
|
4338
4338
|
isFloating: !0,
|
|
4339
4339
|
label: "Load columns form sheet (csv, xlsx)",
|
|
4340
|
-
setValue:
|
|
4340
|
+
setValue: x,
|
|
4341
4341
|
name: "dataColumns"
|
|
4342
4342
|
}
|
|
4343
4343
|
) }),
|
|
@@ -4362,8 +4362,8 @@ const vs = B.object().shape({
|
|
|
4362
4362
|
],
|
|
4363
4363
|
register: h,
|
|
4364
4364
|
name: `dataColumns.${K}.type`,
|
|
4365
|
-
setValue:
|
|
4366
|
-
trigger:
|
|
4365
|
+
setValue: x,
|
|
4366
|
+
trigger: p,
|
|
4367
4367
|
value: A.dataColumns[K].type
|
|
4368
4368
|
}
|
|
4369
4369
|
) }),
|
|
@@ -4374,7 +4374,7 @@ const vs = B.object().shape({
|
|
|
4374
4374
|
label: K === 0 ? "Field key" : "",
|
|
4375
4375
|
name: `dataColumns.${K}.field`,
|
|
4376
4376
|
register: h,
|
|
4377
|
-
errors:
|
|
4377
|
+
errors: y,
|
|
4378
4378
|
element: o,
|
|
4379
4379
|
placeholder: "fieldKey"
|
|
4380
4380
|
}
|
|
@@ -4386,7 +4386,7 @@ const vs = B.object().shape({
|
|
|
4386
4386
|
label: K === 0 ? "Display header" : "",
|
|
4387
4387
|
name: `dataColumns.${K}.headerName`,
|
|
4388
4388
|
register: h,
|
|
4389
|
-
errors:
|
|
4389
|
+
errors: y,
|
|
4390
4390
|
element: o,
|
|
4391
4391
|
placeholder: "header"
|
|
4392
4392
|
}
|
|
@@ -4430,8 +4430,8 @@ const vs = B.object().shape({
|
|
|
4430
4430
|
Authorization: `Bearer ${L}`
|
|
4431
4431
|
}
|
|
4432
4432
|
});
|
|
4433
|
-
K === 200 &&
|
|
4434
|
-
}, [
|
|
4433
|
+
K === 200 && x("options", (X == null ? void 0 : X.data) || X);
|
|
4434
|
+
}, [x, A.url]);
|
|
4435
4435
|
D(() => {
|
|
4436
4436
|
o.type === "document" && A.url && hi();
|
|
4437
4437
|
}, [A.url, o.type, hi]);
|
|
@@ -4466,7 +4466,7 @@ const vs = B.object().shape({
|
|
|
4466
4466
|
/* @__PURE__ */ n.jsxs(
|
|
4467
4467
|
"form",
|
|
4468
4468
|
{
|
|
4469
|
-
onSubmit:
|
|
4469
|
+
onSubmit: b(H),
|
|
4470
4470
|
className: "w-full flex-1 flex flex-col",
|
|
4471
4471
|
children: [
|
|
4472
4472
|
/* @__PURE__ */ n.jsxs("div", { className: "flex-1", children: [
|
|
@@ -4480,7 +4480,7 @@ const vs = B.object().shape({
|
|
|
4480
4480
|
label: "Value",
|
|
4481
4481
|
name: "value",
|
|
4482
4482
|
register: h,
|
|
4483
|
-
errors:
|
|
4483
|
+
errors: y,
|
|
4484
4484
|
element: o
|
|
4485
4485
|
}
|
|
4486
4486
|
) }),
|
|
@@ -4492,7 +4492,7 @@ const vs = B.object().shape({
|
|
|
4492
4492
|
label: "Label",
|
|
4493
4493
|
name: "inputLabel",
|
|
4494
4494
|
register: h,
|
|
4495
|
-
errors:
|
|
4495
|
+
errors: y,
|
|
4496
4496
|
element: o
|
|
4497
4497
|
}
|
|
4498
4498
|
),
|
|
@@ -4504,7 +4504,7 @@ const vs = B.object().shape({
|
|
|
4504
4504
|
label: "Child Label",
|
|
4505
4505
|
name: "childLabel",
|
|
4506
4506
|
register: h,
|
|
4507
|
-
errors:
|
|
4507
|
+
errors: y,
|
|
4508
4508
|
element: o
|
|
4509
4509
|
}
|
|
4510
4510
|
)
|
|
@@ -4516,7 +4516,7 @@ const vs = B.object().shape({
|
|
|
4516
4516
|
label: "Placeholder",
|
|
4517
4517
|
name: "placeholder",
|
|
4518
4518
|
register: h,
|
|
4519
|
-
errors:
|
|
4519
|
+
errors: y,
|
|
4520
4520
|
element: o
|
|
4521
4521
|
}
|
|
4522
4522
|
),
|
|
@@ -4527,7 +4527,7 @@ const vs = B.object().shape({
|
|
|
4527
4527
|
label: "Prefix",
|
|
4528
4528
|
name: "prefix",
|
|
4529
4529
|
register: h,
|
|
4530
|
-
errors:
|
|
4530
|
+
errors: y,
|
|
4531
4531
|
element: o
|
|
4532
4532
|
}
|
|
4533
4533
|
),
|
|
@@ -4540,7 +4540,7 @@ const vs = B.object().shape({
|
|
|
4540
4540
|
label: "Api Url",
|
|
4541
4541
|
name: "url",
|
|
4542
4542
|
register: h,
|
|
4543
|
-
errors:
|
|
4543
|
+
errors: y,
|
|
4544
4544
|
element: o
|
|
4545
4545
|
}
|
|
4546
4546
|
),
|
|
@@ -4560,8 +4560,8 @@ const vs = B.object().shape({
|
|
|
4560
4560
|
],
|
|
4561
4561
|
register: h,
|
|
4562
4562
|
name: "method",
|
|
4563
|
-
setValue:
|
|
4564
|
-
trigger:
|
|
4563
|
+
setValue: x,
|
|
4564
|
+
trigger: p,
|
|
4565
4565
|
value: g("method")
|
|
4566
4566
|
}
|
|
4567
4567
|
),
|
|
@@ -4581,8 +4581,8 @@ const vs = B.object().shape({
|
|
|
4581
4581
|
],
|
|
4582
4582
|
register: h,
|
|
4583
4583
|
name: "responseType",
|
|
4584
|
-
setValue:
|
|
4585
|
-
trigger:
|
|
4584
|
+
setValue: x,
|
|
4585
|
+
trigger: p,
|
|
4586
4586
|
value: g("responseType")
|
|
4587
4587
|
}
|
|
4588
4588
|
)
|
|
@@ -4591,7 +4591,7 @@ const vs = B.object().shape({
|
|
|
4591
4591
|
ss,
|
|
4592
4592
|
{
|
|
4593
4593
|
onChange: (L) => {
|
|
4594
|
-
|
|
4594
|
+
x("denominators", L);
|
|
4595
4595
|
},
|
|
4596
4596
|
value: g("denominators")
|
|
4597
4597
|
}
|
|
@@ -4603,7 +4603,7 @@ const vs = B.object().shape({
|
|
|
4603
4603
|
label: "Short Description",
|
|
4604
4604
|
name: "description",
|
|
4605
4605
|
register: h,
|
|
4606
|
-
errors:
|
|
4606
|
+
errors: y,
|
|
4607
4607
|
element: o
|
|
4608
4608
|
}
|
|
4609
4609
|
),
|
|
@@ -4615,8 +4615,8 @@ const vs = B.object().shape({
|
|
|
4615
4615
|
options: Za,
|
|
4616
4616
|
register: h,
|
|
4617
4617
|
name: "dateFormat",
|
|
4618
|
-
setValue:
|
|
4619
|
-
trigger:
|
|
4618
|
+
setValue: x,
|
|
4619
|
+
trigger: p,
|
|
4620
4620
|
value: g("dateFormat")
|
|
4621
4621
|
}
|
|
4622
4622
|
),
|
|
@@ -4627,7 +4627,7 @@ const vs = B.object().shape({
|
|
|
4627
4627
|
label: "Allow Range",
|
|
4628
4628
|
name: "canHaveDateRange",
|
|
4629
4629
|
register: h,
|
|
4630
|
-
errors:
|
|
4630
|
+
errors: y,
|
|
4631
4631
|
element: o,
|
|
4632
4632
|
type: "checkbox",
|
|
4633
4633
|
value: A.canHaveDateRange
|
|
@@ -4639,7 +4639,7 @@ const vs = B.object().shape({
|
|
|
4639
4639
|
{
|
|
4640
4640
|
name: "minDate",
|
|
4641
4641
|
value: A == null ? void 0 : A.minDate,
|
|
4642
|
-
onGetValue:
|
|
4642
|
+
onGetValue: x,
|
|
4643
4643
|
placeholder: "Select min date"
|
|
4644
4644
|
}
|
|
4645
4645
|
),
|
|
@@ -4648,7 +4648,7 @@ const vs = B.object().shape({
|
|
|
4648
4648
|
{
|
|
4649
4649
|
name: "maxDate",
|
|
4650
4650
|
value: A == null ? void 0 : A.minDate,
|
|
4651
|
-
onGetValue:
|
|
4651
|
+
onGetValue: x,
|
|
4652
4652
|
placeholder: "Select max date",
|
|
4653
4653
|
minDate: A == null ? void 0 : A.minDate
|
|
4654
4654
|
}
|
|
@@ -4661,7 +4661,7 @@ const vs = B.object().shape({
|
|
|
4661
4661
|
label: "Allow Year Picker",
|
|
4662
4662
|
name: "allowYearPicker",
|
|
4663
4663
|
register: h,
|
|
4664
|
-
errors:
|
|
4664
|
+
errors: y,
|
|
4665
4665
|
element: o,
|
|
4666
4666
|
type: "checkbox",
|
|
4667
4667
|
value: A.allowYearPicker
|
|
@@ -4675,7 +4675,7 @@ const vs = B.object().shape({
|
|
|
4675
4675
|
label: "Allow States",
|
|
4676
4676
|
name: "showState",
|
|
4677
4677
|
register: h,
|
|
4678
|
-
errors:
|
|
4678
|
+
errors: y,
|
|
4679
4679
|
element: o,
|
|
4680
4680
|
type: "checkbox",
|
|
4681
4681
|
value: A.showState
|
|
@@ -4697,8 +4697,8 @@ const vs = B.object().shape({
|
|
|
4697
4697
|
],
|
|
4698
4698
|
register: h,
|
|
4699
4699
|
name: "selectType",
|
|
4700
|
-
setValue:
|
|
4701
|
-
trigger:
|
|
4700
|
+
setValue: x,
|
|
4701
|
+
trigger: p,
|
|
4702
4702
|
value: g("selectType")
|
|
4703
4703
|
}
|
|
4704
4704
|
),
|
|
@@ -4709,7 +4709,7 @@ const vs = B.object().shape({
|
|
|
4709
4709
|
label: "Number of columns (max: 4)",
|
|
4710
4710
|
name: "columns",
|
|
4711
4711
|
register: h,
|
|
4712
|
-
errors:
|
|
4712
|
+
errors: y,
|
|
4713
4713
|
element: o,
|
|
4714
4714
|
max: 4,
|
|
4715
4715
|
min: 1
|
|
@@ -4724,7 +4724,7 @@ const vs = B.object().shape({
|
|
|
4724
4724
|
label: "Document Options Url",
|
|
4725
4725
|
name: "url",
|
|
4726
4726
|
register: h,
|
|
4727
|
-
errors:
|
|
4727
|
+
errors: y,
|
|
4728
4728
|
element: o
|
|
4729
4729
|
}
|
|
4730
4730
|
),
|
|
@@ -4739,7 +4739,7 @@ const vs = B.object().shape({
|
|
|
4739
4739
|
label: "Document Validation Url",
|
|
4740
4740
|
name: "validationUrl",
|
|
4741
4741
|
register: h,
|
|
4742
|
-
errors:
|
|
4742
|
+
errors: y,
|
|
4743
4743
|
element: o
|
|
4744
4744
|
}
|
|
4745
4745
|
),
|
|
@@ -4752,7 +4752,7 @@ const vs = B.object().shape({
|
|
|
4752
4752
|
label: "Signature Page Url",
|
|
4753
4753
|
name: "signatureLink",
|
|
4754
4754
|
register: h,
|
|
4755
|
-
errors:
|
|
4755
|
+
errors: y,
|
|
4756
4756
|
element: o
|
|
4757
4757
|
}
|
|
4758
4758
|
) })
|
|
@@ -4766,7 +4766,7 @@ const vs = B.object().shape({
|
|
|
4766
4766
|
label: "Allow Multiple Uploads",
|
|
4767
4767
|
name: "isMultiple",
|
|
4768
4768
|
register: h,
|
|
4769
|
-
errors:
|
|
4769
|
+
errors: y,
|
|
4770
4770
|
element: o,
|
|
4771
4771
|
type: "checkbox",
|
|
4772
4772
|
value: A.isMultiple
|
|
@@ -4780,7 +4780,7 @@ const vs = B.object().shape({
|
|
|
4780
4780
|
id: "acceptedFiles",
|
|
4781
4781
|
value: A == null ? void 0 : A.acceptedFiles
|
|
4782
4782
|
},
|
|
4783
|
-
validationData: { register: h, setValue:
|
|
4783
|
+
validationData: { register: h, setValue: x, trigger: p, watch: g },
|
|
4784
4784
|
placeholder: "Choose file types"
|
|
4785
4785
|
}
|
|
4786
4786
|
)
|
|
@@ -4794,7 +4794,7 @@ const vs = B.object().shape({
|
|
|
4794
4794
|
label: "Toggle Visibility",
|
|
4795
4795
|
name: "isHidden",
|
|
4796
4796
|
register: h,
|
|
4797
|
-
errors:
|
|
4797
|
+
errors: y,
|
|
4798
4798
|
element: o,
|
|
4799
4799
|
type: "checkbox",
|
|
4800
4800
|
value: A.isHidden
|
|
@@ -4805,8 +4805,8 @@ const vs = B.object().shape({
|
|
|
4805
4805
|
bs,
|
|
4806
4806
|
{
|
|
4807
4807
|
register: h,
|
|
4808
|
-
setValue:
|
|
4809
|
-
trigger:
|
|
4808
|
+
setValue: x,
|
|
4809
|
+
trigger: p,
|
|
4810
4810
|
watch: g,
|
|
4811
4811
|
id: o == null ? void 0 : o.id
|
|
4812
4812
|
}
|
|
@@ -4822,7 +4822,7 @@ const vs = B.object().shape({
|
|
|
4822
4822
|
label: "Required",
|
|
4823
4823
|
name: "isRequired",
|
|
4824
4824
|
register: h,
|
|
4825
|
-
errors:
|
|
4825
|
+
errors: y,
|
|
4826
4826
|
element: o,
|
|
4827
4827
|
type: "checkbox",
|
|
4828
4828
|
value: A.isRequired
|
|
@@ -4836,7 +4836,7 @@ const vs = B.object().shape({
|
|
|
4836
4836
|
label: "Error message text",
|
|
4837
4837
|
name: "requiredMessage",
|
|
4838
4838
|
register: h,
|
|
4839
|
-
errors:
|
|
4839
|
+
errors: y,
|
|
4840
4840
|
element: o
|
|
4841
4841
|
}
|
|
4842
4842
|
) })
|
|
@@ -4850,7 +4850,7 @@ const vs = B.object().shape({
|
|
|
4850
4850
|
label: "Min Length",
|
|
4851
4851
|
name: "minLength",
|
|
4852
4852
|
register: h,
|
|
4853
|
-
errors:
|
|
4853
|
+
errors: y,
|
|
4854
4854
|
element: o,
|
|
4855
4855
|
type: "number"
|
|
4856
4856
|
}
|
|
@@ -4863,7 +4863,7 @@ const vs = B.object().shape({
|
|
|
4863
4863
|
label: "Error message text",
|
|
4864
4864
|
name: "minLengthMessage",
|
|
4865
4865
|
register: h,
|
|
4866
|
-
errors:
|
|
4866
|
+
errors: y,
|
|
4867
4867
|
element: o
|
|
4868
4868
|
}
|
|
4869
4869
|
) })
|
|
@@ -4876,7 +4876,7 @@ const vs = B.object().shape({
|
|
|
4876
4876
|
label: "Max Length",
|
|
4877
4877
|
name: "maxLength",
|
|
4878
4878
|
register: h,
|
|
4879
|
-
errors:
|
|
4879
|
+
errors: y,
|
|
4880
4880
|
element: o,
|
|
4881
4881
|
type: "number"
|
|
4882
4882
|
}
|
|
@@ -4889,7 +4889,7 @@ const vs = B.object().shape({
|
|
|
4889
4889
|
label: "Error message text",
|
|
4890
4890
|
name: "maxLengthMessage",
|
|
4891
4891
|
register: h,
|
|
4892
|
-
errors:
|
|
4892
|
+
errors: y,
|
|
4893
4893
|
element: o
|
|
4894
4894
|
}
|
|
4895
4895
|
) })
|
|
@@ -4904,7 +4904,7 @@ const vs = B.object().shape({
|
|
|
4904
4904
|
label: "Min Amount",
|
|
4905
4905
|
name: "minAmount",
|
|
4906
4906
|
register: h,
|
|
4907
|
-
errors:
|
|
4907
|
+
errors: y,
|
|
4908
4908
|
element: o,
|
|
4909
4909
|
type: "amount"
|
|
4910
4910
|
}
|
|
@@ -4917,7 +4917,7 @@ const vs = B.object().shape({
|
|
|
4917
4917
|
label: "Error message text",
|
|
4918
4918
|
name: "minAmountMessage",
|
|
4919
4919
|
register: h,
|
|
4920
|
-
errors:
|
|
4920
|
+
errors: y,
|
|
4921
4921
|
element: o
|
|
4922
4922
|
}
|
|
4923
4923
|
) })
|
|
@@ -4930,7 +4930,7 @@ const vs = B.object().shape({
|
|
|
4930
4930
|
label: "Max Amount",
|
|
4931
4931
|
name: "maxAmount",
|
|
4932
4932
|
register: h,
|
|
4933
|
-
errors:
|
|
4933
|
+
errors: y,
|
|
4934
4934
|
element: o,
|
|
4935
4935
|
type: "amount"
|
|
4936
4936
|
}
|
|
@@ -4943,7 +4943,7 @@ const vs = B.object().shape({
|
|
|
4943
4943
|
label: "Error message text",
|
|
4944
4944
|
name: "maxAmountMessage",
|
|
4945
4945
|
register: h,
|
|
4946
|
-
errors:
|
|
4946
|
+
errors: y,
|
|
4947
4947
|
element: o
|
|
4948
4948
|
}
|
|
4949
4949
|
) })
|
|
@@ -4966,10 +4966,10 @@ const vs = B.object().shape({
|
|
|
4966
4966
|
"button",
|
|
4967
4967
|
{
|
|
4968
4968
|
type: "submit",
|
|
4969
|
-
disabled: !S ||
|
|
4969
|
+
disabled: !S || C,
|
|
4970
4970
|
style: { background: (v == null ? void 0 : v.buttonColor) || "#333" },
|
|
4971
|
-
className: `flex-1 px-4 py-2.5 ${!S ||
|
|
4972
|
-
children:
|
|
4971
|
+
className: `flex-1 px-4 py-2.5 ${!S || C ? "bg-[#F2F4F7]" : "bg-[#2563EB]"} ${!S || C ? "text-[#98A2B3]" : "text-white"} rounded-lg shadow-xs font-semibold font-onest disabled:opacity-50 editor_option__save`,
|
|
4972
|
+
children: C ? "Saving..." : "Save"
|
|
4973
4973
|
}
|
|
4974
4974
|
)
|
|
4975
4975
|
] })
|
|
@@ -4991,7 +4991,7 @@ const vs = B.object().shape({
|
|
|
4991
4991
|
), d = $(() => {
|
|
4992
4992
|
l(e.id, e.sectionId);
|
|
4993
4993
|
}, [e.id, e.sectionId, l]);
|
|
4994
|
-
return /* @__PURE__ */ n.jsxs("div", { className: "w-full", children: [
|
|
4994
|
+
return /* @__PURE__ */ n.jsxs("div", { className: "w-full min-w-0", children: [
|
|
4995
4995
|
s && /* @__PURE__ */ n.jsx(
|
|
4996
4996
|
ps,
|
|
4997
4997
|
{
|
|
@@ -5177,54 +5177,54 @@ function ys({
|
|
|
5177
5177
|
validationData: e
|
|
5178
5178
|
}) {
|
|
5179
5179
|
var A;
|
|
5180
|
-
const { register: o = () => ({}), setValue: s, watch: a } = e || {}, [l, u] = P(), [t, d] = P(!1), [r, c] = P(!1), [v, h] = P(""),
|
|
5180
|
+
const { register: o = () => ({}), setValue: s, watch: a } = e || {}, [l, u] = P(), [t, d] = P(!1), [r, c] = P(!1), [v, h] = P(""), b = a && a(i == null ? void 0 : i.id);
|
|
5181
5181
|
D(() => {
|
|
5182
|
-
u(
|
|
5183
|
-
}, [
|
|
5184
|
-
const [
|
|
5182
|
+
u(b);
|
|
5183
|
+
}, [b]);
|
|
5184
|
+
const [f, x] = P("");
|
|
5185
5185
|
D(() => {
|
|
5186
5186
|
o(i.id);
|
|
5187
5187
|
}, [i.id, o]);
|
|
5188
|
-
const { url: g, method:
|
|
5188
|
+
const { url: g, method: p, responseType: y } = i || {}, S = {
|
|
5189
5189
|
headers: {
|
|
5190
5190
|
Authorization: `Bearer ${xi("token")}`
|
|
5191
5191
|
}
|
|
5192
5192
|
}, N = $(
|
|
5193
|
-
async (
|
|
5194
|
-
var O, ii, z, Z,
|
|
5195
|
-
if (!(!g || !
|
|
5193
|
+
async (j) => {
|
|
5194
|
+
var O, ii, z, Z, E, W, I, G, H, R, T;
|
|
5195
|
+
if (!(!g || !p)) {
|
|
5196
5196
|
d(!0);
|
|
5197
5197
|
try {
|
|
5198
|
-
let
|
|
5199
|
-
if (
|
|
5200
|
-
const U = `${g}?value=${
|
|
5201
|
-
|
|
5202
|
-
} else if (
|
|
5203
|
-
|
|
5198
|
+
let w;
|
|
5199
|
+
if (p.toLowerCase() === "get") {
|
|
5200
|
+
const U = `${g}?value=${j}`;
|
|
5201
|
+
w = await Ii.get(U, S);
|
|
5202
|
+
} else if (p.toLowerCase() === "post")
|
|
5203
|
+
w = await Ii.post(g, { value: j }, S);
|
|
5204
5204
|
else
|
|
5205
5205
|
throw new Error("Unsupported HTTP method");
|
|
5206
|
-
|
|
5207
|
-
((
|
|
5208
|
-
) :
|
|
5209
|
-
((G = (I =
|
|
5210
|
-
)) : (console.error("Invalid input:",
|
|
5211
|
-
} catch (
|
|
5212
|
-
console.error("Error validating input:",
|
|
5213
|
-
((T = (R =
|
|
5206
|
+
w.status === 200 && ((((ii = (O = w == null ? void 0 : w.data) == null ? void 0 : O.data) == null ? void 0 : ii.status) || ((z = w == null ? void 0 : w.data) == null ? void 0 : z.status)) === !0 ? (c(!0), y === "string" ? h(
|
|
5207
|
+
((E = (Z = w == null ? void 0 : w.data) == null ? void 0 : Z.data) == null ? void 0 : E.description) || ((W = w == null ? void 0 : w.data) == null ? void 0 : W.description) || "Validation successful"
|
|
5208
|
+
) : x(
|
|
5209
|
+
((G = (I = w == null ? void 0 : w.data) == null ? void 0 : I.data) == null ? void 0 : G.description) || ((H = w == null ? void 0 : w.data) == null ? void 0 : H.description) || {}
|
|
5210
|
+
)) : (console.error("Invalid input:", j), h("Unable to validate input"), c(!1)));
|
|
5211
|
+
} catch (w) {
|
|
5212
|
+
console.error("Error validating input:", w), h(
|
|
5213
|
+
((T = (R = w == null ? void 0 : w.response) == null ? void 0 : R.data) == null ? void 0 : T.message) || "Unable to validate input"
|
|
5214
5214
|
), c(!1);
|
|
5215
5215
|
} finally {
|
|
5216
5216
|
d(!1);
|
|
5217
5217
|
}
|
|
5218
5218
|
}
|
|
5219
5219
|
},
|
|
5220
|
-
[
|
|
5220
|
+
[p, y, g]
|
|
5221
5221
|
);
|
|
5222
5222
|
return D(() => {
|
|
5223
5223
|
if (l) {
|
|
5224
|
-
const
|
|
5224
|
+
const j = setTimeout(() => {
|
|
5225
5225
|
N(l);
|
|
5226
5226
|
}, 700);
|
|
5227
|
-
return () => clearTimeout(
|
|
5227
|
+
return () => clearTimeout(j);
|
|
5228
5228
|
}
|
|
5229
5229
|
}, [N, l]), /* @__PURE__ */ n.jsxs("div", { children: [
|
|
5230
5230
|
/* @__PURE__ */ n.jsxs("div", { className: "relative flex items-center", children: [
|
|
@@ -5235,8 +5235,8 @@ function ys({
|
|
|
5235
5235
|
type: (i == null ? void 0 : i.inputType) || "text",
|
|
5236
5236
|
className: q("field-control", i == null ? void 0 : i.customClass),
|
|
5237
5237
|
...o(i == null ? void 0 : i.id),
|
|
5238
|
-
onChange: (
|
|
5239
|
-
u(
|
|
5238
|
+
onChange: (j) => {
|
|
5239
|
+
u(j.target.value), s(i == null ? void 0 : i.id, j.target.value);
|
|
5240
5240
|
},
|
|
5241
5241
|
disabled: e == null ? void 0 : e.isReadOnly
|
|
5242
5242
|
}
|
|
@@ -5278,20 +5278,20 @@ function ys({
|
|
|
5278
5278
|
r && !t && /* @__PURE__ */ n.jsx("span", { className: "block pr-3 text-lg text-green-600", children: /* @__PURE__ */ n.jsx(_, { icon: "gg:check-o" }) })
|
|
5279
5279
|
] })
|
|
5280
5280
|
] }),
|
|
5281
|
-
v &&
|
|
5281
|
+
v && y === "string" && /* @__PURE__ */ n.jsx(
|
|
5282
5282
|
"span",
|
|
5283
5283
|
{
|
|
5284
5284
|
className: `${r ? "text-green-600" : "text-red-600"} text-sm`,
|
|
5285
5285
|
children: v
|
|
5286
5286
|
}
|
|
5287
5287
|
),
|
|
5288
|
-
|
|
5288
|
+
y === "object" && /* @__PURE__ */ n.jsx("div", { className: "grid grid-cols-2 gap-6 mt-2 text-sm text-gray-600", children: (A = Object.entries(f)) == null ? void 0 : A.map(([j, O]) => /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
5289
5289
|
/* @__PURE__ */ n.jsxs("span", { className: "font-semibold", children: [
|
|
5290
|
-
|
|
5290
|
+
j,
|
|
5291
5291
|
":"
|
|
5292
5292
|
] }),
|
|
5293
5293
|
fs(O) ? /* @__PURE__ */ n.jsx(xs, { imageUrl: O }) : /* @__PURE__ */ n.jsx("span", { children: String(O) })
|
|
5294
|
-
] },
|
|
5294
|
+
] }, j)) })
|
|
5295
5295
|
] });
|
|
5296
5296
|
}
|
|
5297
5297
|
function As({
|
|
@@ -5351,7 +5351,7 @@ function As({
|
|
|
5351
5351
|
className: "border border-gray-100 rounded w-full px-3 py-1 outline-none",
|
|
5352
5352
|
decimalsLimit: 6,
|
|
5353
5353
|
value: r.value,
|
|
5354
|
-
onValueChange: (
|
|
5354
|
+
onValueChange: (b) => u(b, c),
|
|
5355
5355
|
disabled: e,
|
|
5356
5356
|
allowNegativeValue: !1
|
|
5357
5357
|
}
|
|
@@ -5428,11 +5428,11 @@ function Ms({
|
|
|
5428
5428
|
const r = (c) => (s == null ? void 0 : s.rowId) === i.id && (s == null ? void 0 : s.field) === c;
|
|
5429
5429
|
return /* @__PURE__ */ n.jsxs("tr", { children: [
|
|
5430
5430
|
e.map((c) => {
|
|
5431
|
-
var
|
|
5432
|
-
const v = i[c.field], h = c.editable && !o,
|
|
5431
|
+
var y;
|
|
5432
|
+
const v = i[c.field], h = c.editable && !o, b = r(c.field), { isValidating: f, result: x } = t(i.id, c.field);
|
|
5433
5433
|
let g = "border-gray-300";
|
|
5434
|
-
c.validate && ((
|
|
5435
|
-
const
|
|
5434
|
+
c.validate && ((x == null ? void 0 : x.isValid) === !1 ? g = "border-red-500 bg-red-50" : (x == null ? void 0 : x.isValid) === !0 && (g = "border-green-500 bg-green-50"));
|
|
5435
|
+
const p = `w-full px-2 py-1 border rounded outline-none ${g}`;
|
|
5436
5436
|
return /* @__PURE__ */ n.jsx(
|
|
5437
5437
|
"td",
|
|
5438
5438
|
{
|
|
@@ -5442,24 +5442,24 @@ function Ms({
|
|
|
5442
5442
|
rowId: i.id,
|
|
5443
5443
|
field: c.field
|
|
5444
5444
|
}),
|
|
5445
|
-
children: h &&
|
|
5445
|
+
children: h && b ? /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
|
|
5446
5446
|
c.type === "number" ? /* @__PURE__ */ n.jsx(
|
|
5447
5447
|
sn,
|
|
5448
5448
|
{
|
|
5449
5449
|
value: v,
|
|
5450
5450
|
decimalsLimit: 6,
|
|
5451
5451
|
allowNegativeValue: !1,
|
|
5452
|
-
className:
|
|
5453
|
-
onValueChange: (
|
|
5452
|
+
className: p,
|
|
5453
|
+
onValueChange: (C) => l(C, i.id, c.field),
|
|
5454
5454
|
onBlur: () => {
|
|
5455
5455
|
a(null), u(v, i.id, c.field, c);
|
|
5456
5456
|
},
|
|
5457
5457
|
autoFocus: !0
|
|
5458
5458
|
}
|
|
5459
|
-
) : c.type === "checkbox" ? /* @__PURE__ */ n.jsx("div", { className: "flex items-center gap-x-4", children: ["yes", "no"].map((
|
|
5460
|
-
const S =
|
|
5459
|
+
) : c.type === "checkbox" ? /* @__PURE__ */ n.jsx("div", { className: "flex items-center gap-x-4", children: ["yes", "no"].map((C) => {
|
|
5460
|
+
const S = C === "yes", N = `radio-${i.id}-${String(
|
|
5461
5461
|
c.field
|
|
5462
|
-
)}-${
|
|
5462
|
+
)}-${C}`;
|
|
5463
5463
|
return /* @__PURE__ */ n.jsxs(
|
|
5464
5464
|
"label",
|
|
5465
5465
|
{
|
|
@@ -5479,33 +5479,33 @@ function Ms({
|
|
|
5479
5479
|
/* @__PURE__ */ n.jsx("span", { className: "text-sm", children: S ? "Yes" : "No" })
|
|
5480
5480
|
]
|
|
5481
5481
|
},
|
|
5482
|
-
|
|
5482
|
+
C
|
|
5483
5483
|
);
|
|
5484
5484
|
}) }) : /* @__PURE__ */ n.jsx(
|
|
5485
5485
|
"input",
|
|
5486
5486
|
{
|
|
5487
5487
|
type: "text",
|
|
5488
5488
|
value: String(v != null ? v : ""),
|
|
5489
|
-
onChange: (
|
|
5489
|
+
onChange: (C) => l(C.target.value, i.id, c.field),
|
|
5490
5490
|
onBlur: () => {
|
|
5491
5491
|
a(null), u(v, i.id, c.field, c);
|
|
5492
5492
|
},
|
|
5493
|
-
className:
|
|
5493
|
+
className: p,
|
|
5494
5494
|
autoFocus: !0
|
|
5495
5495
|
}
|
|
5496
5496
|
),
|
|
5497
|
-
|
|
5498
|
-
] }) : c.validate &&
|
|
5497
|
+
f && /* @__PURE__ */ n.jsx("div", { className: "absolute right-1 top-1", children: /* @__PURE__ */ n.jsx("div", { className: "w-4 h-4 border-2 border-blue-500 rounded-full border-t-transparent animate-spin" }) })
|
|
5498
|
+
] }) : c.validate && x ? /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5499
5499
|
/* @__PURE__ */ n.jsxs("span", { children: [
|
|
5500
5500
|
String(v != null ? v : ""),
|
|
5501
5501
|
" ",
|
|
5502
|
-
|
|
5502
|
+
x.data && `[${x.data}]`
|
|
5503
5503
|
] }),
|
|
5504
|
-
|
|
5504
|
+
x.isValid ? /* @__PURE__ */ n.jsx("span", { className: "text-xs text-green-600", children: "✓" }) : /* @__PURE__ */ n.jsx(
|
|
5505
5505
|
"span",
|
|
5506
5506
|
{
|
|
5507
5507
|
className: "text-xs text-red-600 cursor-help",
|
|
5508
|
-
title: (
|
|
5508
|
+
title: (y = x.error) != null ? y : "",
|
|
5509
5509
|
children: "✗"
|
|
5510
5510
|
}
|
|
5511
5511
|
)
|
|
@@ -5533,45 +5533,32 @@ function Bs({
|
|
|
5533
5533
|
isReadOnly: o = !1,
|
|
5534
5534
|
columns: s
|
|
5535
5535
|
}) {
|
|
5536
|
-
const [a, l] = P(i), [u, t] = P(null), d = Ci(null)
|
|
5536
|
+
const [a, l] = P(i), [u, t] = P(null), d = Ci(null);
|
|
5537
5537
|
D(() => {
|
|
5538
|
-
|
|
5539
|
-
if (!f) return;
|
|
5540
|
-
const g = (x) => {
|
|
5541
|
-
const j = x.getBoundingClientRect().width;
|
|
5542
|
-
c(j ? j - 48 : 0);
|
|
5543
|
-
};
|
|
5544
|
-
g(f);
|
|
5545
|
-
const m = new ResizeObserver((x) => {
|
|
5546
|
-
for (const j of x)
|
|
5547
|
-
g(j.target);
|
|
5548
|
-
});
|
|
5549
|
-
return m.observe(f), () => m.disconnect();
|
|
5550
|
-
}, []), D(() => {
|
|
5551
|
-
l((f) => JSON.stringify(f) !== JSON.stringify(i) ? i : f);
|
|
5538
|
+
l((b) => JSON.stringify(b) !== JSON.stringify(i) ? i : b);
|
|
5552
5539
|
}, [i]), D(() => {
|
|
5553
5540
|
e == null || e(a);
|
|
5554
5541
|
}, [a, e]), D(() => {
|
|
5555
|
-
const
|
|
5556
|
-
d.current && !d.current.contains(
|
|
5542
|
+
const b = (f) => {
|
|
5543
|
+
d.current && !d.current.contains(f.target) && t(null);
|
|
5557
5544
|
};
|
|
5558
|
-
return document.addEventListener("mousedown",
|
|
5545
|
+
return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
5559
5546
|
}, []);
|
|
5560
|
-
const
|
|
5561
|
-
(
|
|
5547
|
+
const r = $(
|
|
5548
|
+
(b, f, x) => {
|
|
5562
5549
|
l(
|
|
5563
|
-
(
|
|
5564
|
-
(
|
|
5550
|
+
(g) => g.map(
|
|
5551
|
+
(p) => p.id === f ? { ...p, [x]: b } : p
|
|
5565
5552
|
)
|
|
5566
5553
|
);
|
|
5567
5554
|
},
|
|
5568
5555
|
[]
|
|
5569
|
-
),
|
|
5570
|
-
const
|
|
5571
|
-
l((
|
|
5572
|
-
}, [s]),
|
|
5573
|
-
l((
|
|
5574
|
-
}, []),
|
|
5556
|
+
), c = $(() => {
|
|
5557
|
+
const b = Ai(), f = s.reduce((x, g) => (x[g.field] = g.field === "id" ? b : "", x), {});
|
|
5558
|
+
l((x) => [...x, { id: b, ...f }]);
|
|
5559
|
+
}, [s]), v = $((b) => {
|
|
5560
|
+
l((f) => f.filter((x) => x.id !== b));
|
|
5561
|
+
}, []), h = $(
|
|
5575
5562
|
() => ({
|
|
5576
5563
|
isValidating: !1,
|
|
5577
5564
|
result: void 0
|
|
@@ -5582,64 +5569,57 @@ function Bs({
|
|
|
5582
5569
|
/* @__PURE__ */ n.jsx("div", { className: "flex justify-end", children: !o && /* @__PURE__ */ n.jsx(
|
|
5583
5570
|
"button",
|
|
5584
5571
|
{
|
|
5585
|
-
onClick:
|
|
5572
|
+
onClick: c,
|
|
5586
5573
|
type: "button",
|
|
5587
5574
|
className: "px-2 py-1 mb-3 text-xs text-white bg-gray-600 rounded hover:bg-gray-700",
|
|
5588
5575
|
children: "Add Row"
|
|
5589
5576
|
}
|
|
5590
5577
|
) }),
|
|
5591
|
-
/* @__PURE__ */ n.jsx(
|
|
5592
|
-
"
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
/* @__PURE__ */ n.jsx("thead", { children: /* @__PURE__ */ n.jsxs("tr", { className: "bg-gray-100", children: [
|
|
5598
|
-
s.map((f, g) => {
|
|
5599
|
-
var m;
|
|
5600
|
-
return /* @__PURE__ */ n.jsxs(
|
|
5601
|
-
"th",
|
|
5602
|
-
{
|
|
5603
|
-
className: "px-3 py-2 text-xs font-semibold text-left text-gray-600 border whitespace-nowrap",
|
|
5604
|
-
children: [
|
|
5605
|
-
(m = f.headerName) != null ? m : String(f.field),
|
|
5606
|
-
f.validate && /* @__PURE__ */ n.jsx("span", { className: "ml-1 text-blue-600", children: "*" })
|
|
5607
|
-
]
|
|
5608
|
-
},
|
|
5609
|
-
`${String(f.id)}-${g}`
|
|
5610
|
-
);
|
|
5611
|
-
}),
|
|
5612
|
-
!o && /* @__PURE__ */ n.jsx("th", { className: "w-10 px-2 py-2 border" })
|
|
5613
|
-
] }) }),
|
|
5614
|
-
/* @__PURE__ */ n.jsx("tbody", { children: a.length > 0 ? a.map((f) => /* @__PURE__ */ n.jsx(
|
|
5615
|
-
Ts,
|
|
5578
|
+
/* @__PURE__ */ n.jsx("div", { className: "w-full max-w-full overflow-x-auto border rounded-lg", children: /* @__PURE__ */ n.jsxs("table", { className: "min-w-max w-full text-sm border-collapse rounded table-auto bg-gray-50", children: [
|
|
5579
|
+
/* @__PURE__ */ n.jsx("thead", { children: /* @__PURE__ */ n.jsxs("tr", { className: "bg-gray-100", children: [
|
|
5580
|
+
s.map((b, f) => {
|
|
5581
|
+
var x;
|
|
5582
|
+
return /* @__PURE__ */ n.jsxs(
|
|
5583
|
+
"th",
|
|
5616
5584
|
{
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
handleCellChange: v,
|
|
5623
|
-
debouncedValidate: () => {
|
|
5624
|
-
},
|
|
5625
|
-
getValidationStatus: y,
|
|
5626
|
-
deleteRow: p
|
|
5585
|
+
className: "px-3 py-2 text-xs font-semibold text-left text-gray-600 border whitespace-nowrap",
|
|
5586
|
+
children: [
|
|
5587
|
+
(x = b.headerName) != null ? x : String(b.field),
|
|
5588
|
+
b.validate && /* @__PURE__ */ n.jsx("span", { className: "ml-1 text-blue-600", children: "*" })
|
|
5589
|
+
]
|
|
5627
5590
|
},
|
|
5628
|
-
|
|
5629
|
-
)
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5591
|
+
`${String(b.id)}-${f}`
|
|
5592
|
+
);
|
|
5593
|
+
}),
|
|
5594
|
+
!o && /* @__PURE__ */ n.jsx("th", { className: "w-10 px-2 py-2 border" })
|
|
5595
|
+
] }) }),
|
|
5596
|
+
/* @__PURE__ */ n.jsx("tbody", { children: a.length > 0 ? a.map((b) => /* @__PURE__ */ n.jsx(
|
|
5597
|
+
Ts,
|
|
5598
|
+
{
|
|
5599
|
+
row: b,
|
|
5600
|
+
columns: s,
|
|
5601
|
+
isReadOnly: o,
|
|
5602
|
+
editingCell: u,
|
|
5603
|
+
setEditingCell: t,
|
|
5604
|
+
handleCellChange: r,
|
|
5605
|
+
debouncedValidate: () => {
|
|
5606
|
+
},
|
|
5607
|
+
getValidationStatus: h,
|
|
5608
|
+
deleteRow: v
|
|
5609
|
+
},
|
|
5610
|
+
b.id
|
|
5611
|
+
)) : /* @__PURE__ */ n.jsx("tr", { children: /* @__PURE__ */ n.jsx(
|
|
5612
|
+
"td",
|
|
5613
|
+
{
|
|
5614
|
+
colSpan: s.length + (o ? 0 : 1),
|
|
5615
|
+
className: "p-2 text-xs text-center text-gray-400",
|
|
5616
|
+
children: "No data available"
|
|
5617
|
+
}
|
|
5618
|
+
) }) })
|
|
5619
|
+
] }) })
|
|
5640
5620
|
] });
|
|
5641
5621
|
}
|
|
5642
|
-
function
|
|
5622
|
+
function ws({
|
|
5643
5623
|
element: i,
|
|
5644
5624
|
validationData: e
|
|
5645
5625
|
}) {
|
|
@@ -5682,40 +5662,40 @@ const ge = ({
|
|
|
5682
5662
|
isMultiple: c = !1,
|
|
5683
5663
|
isFloatingLabel: v = !1,
|
|
5684
5664
|
subText: h,
|
|
5685
|
-
labelClass:
|
|
5686
|
-
loading:
|
|
5687
|
-
disabled:
|
|
5665
|
+
labelClass: b = "",
|
|
5666
|
+
loading: f,
|
|
5667
|
+
disabled: x
|
|
5688
5668
|
}) => {
|
|
5689
|
-
const [g,
|
|
5669
|
+
const [g, p] = P(c ? [] : null), y = q("custom-select__control", i), C = oi(() => e, [e]);
|
|
5690
5670
|
return D(() => {
|
|
5691
5671
|
const S = e == null ? void 0 : e.find((N) => {
|
|
5692
5672
|
var A;
|
|
5693
5673
|
return typeof N.value == "string" && typeof d == "string" ? N.value.toLowerCase() === d.toLowerCase() : typeof N.value == "object" && typeof d == "object" ? ((A = N.value) == null ? void 0 : A.id) === (d == null ? void 0 : d.id) : N.value === d;
|
|
5694
5674
|
});
|
|
5695
|
-
|
|
5675
|
+
p(S || null);
|
|
5696
5676
|
}, [d, e]), D(() => {
|
|
5697
5677
|
g && l && a && (l(u, g == null ? void 0 : g.value), a(u), r == null || r(u));
|
|
5698
5678
|
}, [u, g]), /* @__PURE__ */ n.jsxs("div", { className: "custom-select", children: [
|
|
5699
5679
|
t && !v && /* @__PURE__ */ n.jsx("label", { className: "custom-select__label", children: t }),
|
|
5700
|
-
v && t && /* @__PURE__ */ n.jsx("label", { className: q("custom-select__floating-label",
|
|
5680
|
+
v && t && /* @__PURE__ */ n.jsx("label", { className: q("custom-select__floating-label", b), children: t }),
|
|
5701
5681
|
/* @__PURE__ */ n.jsx(
|
|
5702
5682
|
di,
|
|
5703
5683
|
{
|
|
5704
5684
|
value: g,
|
|
5705
|
-
onChange:
|
|
5685
|
+
onChange: p,
|
|
5706
5686
|
multiple: c,
|
|
5707
|
-
disabled:
|
|
5687
|
+
disabled: x,
|
|
5708
5688
|
children: /* @__PURE__ */ n.jsxs("div", { className: "custom-select__wrapper", children: [
|
|
5709
|
-
/* @__PURE__ */ n.jsxs(di.Button, { className:
|
|
5710
|
-
|
|
5689
|
+
/* @__PURE__ */ n.jsxs(di.Button, { className: y, disabled: x, children: [
|
|
5690
|
+
f ? /* @__PURE__ */ n.jsx("span", { className: "custom-select__loading", children: "Fetching data..." }) : /* @__PURE__ */ n.jsx("span", { className: "custom-select__value", children: (g == null ? void 0 : g.label) || /* @__PURE__ */ n.jsx("span", { className: "custom-select__placeholder", children: o }) }),
|
|
5711
5691
|
/* @__PURE__ */ n.jsx("span", { className: "custom-select__icon", children: /* @__PURE__ */ n.jsx(_, { icon: "lucide:chevron-down" }) })
|
|
5712
5692
|
] }),
|
|
5713
5693
|
/* @__PURE__ */ n.jsx(
|
|
5714
|
-
|
|
5694
|
+
Ei,
|
|
5715
5695
|
{
|
|
5716
5696
|
as: mi.Fragment,
|
|
5717
5697
|
leave: "custom-select__transition",
|
|
5718
|
-
children: /* @__PURE__ */ n.jsx(di.Options, { className: "custom-select__options", anchor: "bottom", children:
|
|
5698
|
+
children: /* @__PURE__ */ n.jsx(di.Options, { className: "custom-select__options", anchor: "bottom", children: C == null ? void 0 : C.map((S, N) => /* @__PURE__ */ n.jsx(
|
|
5719
5699
|
di.Option,
|
|
5720
5700
|
{
|
|
5721
5701
|
value: S,
|
|
@@ -5744,36 +5724,36 @@ const ge = ({
|
|
|
5744
5724
|
h && !s && /* @__PURE__ */ n.jsx("p", { className: "custom-select__subtext", children: h }),
|
|
5745
5725
|
s && /* @__PURE__ */ n.jsx("span", { className: "custom-select__error", children: s.message })
|
|
5746
5726
|
] });
|
|
5747
|
-
},
|
|
5727
|
+
}, Es = ({
|
|
5748
5728
|
element: i,
|
|
5749
5729
|
validationData: e
|
|
5750
5730
|
}) => {
|
|
5751
|
-
var
|
|
5731
|
+
var x;
|
|
5752
5732
|
const {
|
|
5753
5733
|
register: o = () => ({}),
|
|
5754
5734
|
trigger: s,
|
|
5755
5735
|
setValue: a,
|
|
5756
5736
|
watch: l,
|
|
5757
5737
|
isReadOnly: u
|
|
5758
|
-
} = e || {}, t = (
|
|
5759
|
-
const
|
|
5760
|
-
a == null || a(t,
|
|
5761
|
-
},
|
|
5762
|
-
g === "first" ? (r(
|
|
5738
|
+
} = e || {}, t = (x = i == null ? void 0 : i.id) != null ? x : "cascadeValue", [d, r] = P(""), [c, v] = P(""), h = (g, p) => {
|
|
5739
|
+
const y = g && p ? `${g}_${p}` : "";
|
|
5740
|
+
a == null || a(t, y), s == null || s(t);
|
|
5741
|
+
}, b = (g, p) => {
|
|
5742
|
+
g === "first" ? (r(p), v(""), h(p, "")) : (v(p), h(d, p));
|
|
5763
5743
|
};
|
|
5764
5744
|
D(() => {
|
|
5765
5745
|
if (l) {
|
|
5766
5746
|
const g = l(t);
|
|
5767
5747
|
if (g != null && g.includes("_")) {
|
|
5768
|
-
const [
|
|
5769
|
-
r(
|
|
5748
|
+
const [p, y] = g.split("_");
|
|
5749
|
+
r(p), v(y);
|
|
5770
5750
|
}
|
|
5771
5751
|
}
|
|
5772
5752
|
}, [l, t]);
|
|
5773
|
-
const
|
|
5753
|
+
const f = oi(
|
|
5774
5754
|
() => {
|
|
5775
5755
|
var g;
|
|
5776
|
-
return (g = i.options1) == null ? void 0 : g.filter((
|
|
5756
|
+
return (g = i.options1) == null ? void 0 : g.filter((p) => p.key === d);
|
|
5777
5757
|
},
|
|
5778
5758
|
[i.options1, d]
|
|
5779
5759
|
);
|
|
@@ -5782,7 +5762,7 @@ const ge = ({
|
|
|
5782
5762
|
/* @__PURE__ */ n.jsx("div", { className: "relative", children: /* @__PURE__ */ n.jsx(
|
|
5783
5763
|
ge,
|
|
5784
5764
|
{
|
|
5785
|
-
setValue: (g,
|
|
5765
|
+
setValue: (g, p) => b("first", p),
|
|
5786
5766
|
options: i.options,
|
|
5787
5767
|
name: `${t}`,
|
|
5788
5768
|
register: o,
|
|
@@ -5794,8 +5774,8 @@ const ge = ({
|
|
|
5794
5774
|
/* @__PURE__ */ n.jsx(
|
|
5795
5775
|
ge,
|
|
5796
5776
|
{
|
|
5797
|
-
setValue: (g,
|
|
5798
|
-
options:
|
|
5777
|
+
setValue: (g, p) => b("second", p),
|
|
5778
|
+
options: f,
|
|
5799
5779
|
name: `${t}`,
|
|
5800
5780
|
register: o,
|
|
5801
5781
|
value: c
|
|
@@ -5813,27 +5793,27 @@ const ge = ({
|
|
|
5813
5793
|
element: u,
|
|
5814
5794
|
validationData: t
|
|
5815
5795
|
}) => {
|
|
5816
|
-
var
|
|
5796
|
+
var p;
|
|
5817
5797
|
const {
|
|
5818
5798
|
register: d = () => ({}),
|
|
5819
5799
|
trigger: r,
|
|
5820
5800
|
setValue: c,
|
|
5821
5801
|
watch: v,
|
|
5822
5802
|
isReadOnly: h
|
|
5823
|
-
} = t || {},
|
|
5803
|
+
} = t || {}, b = (p = v == null ? void 0 : v(u.id)) != null ? p : 0, [f, x] = P(null);
|
|
5824
5804
|
D(() => {
|
|
5825
|
-
|
|
5805
|
+
b == null && (c == null || c(u.id, i));
|
|
5826
5806
|
}, []);
|
|
5827
|
-
const g = (
|
|
5807
|
+
const g = (y) => {
|
|
5828
5808
|
if (!o && !h) {
|
|
5829
|
-
const
|
|
5830
|
-
c == null || c(u.id,
|
|
5809
|
+
const C = y + 1;
|
|
5810
|
+
c == null || c(u.id, C), r == null || r(u.id), s == null || s(C);
|
|
5831
5811
|
}
|
|
5832
5812
|
};
|
|
5833
5813
|
return /* @__PURE__ */ n.jsxs("div", { className: `flex gap-1 ${l}`, children: [
|
|
5834
5814
|
/* @__PURE__ */ n.jsx("input", { type: "hidden", ...d(u.id) }),
|
|
5835
|
-
Array.from({ length: e }, (
|
|
5836
|
-
const S =
|
|
5815
|
+
Array.from({ length: e }, (y, C) => {
|
|
5816
|
+
const S = f !== null ? C <= f : C < b;
|
|
5837
5817
|
return /* @__PURE__ */ n.jsx(
|
|
5838
5818
|
Oe,
|
|
5839
5819
|
{
|
|
@@ -5841,11 +5821,11 @@ const ge = ({
|
|
|
5841
5821
|
className: `cursor-pointer transition-colors ${S ? "text-yellow-400" : "text-gray-300"}`,
|
|
5842
5822
|
width: a,
|
|
5843
5823
|
height: a,
|
|
5844
|
-
onMouseEnter: () => !(o || h) &&
|
|
5845
|
-
onMouseLeave: () => !(o || h) &&
|
|
5846
|
-
onClick: () => g(
|
|
5824
|
+
onMouseEnter: () => !(o || h) && x(C),
|
|
5825
|
+
onMouseLeave: () => !(o || h) && x(null),
|
|
5826
|
+
onClick: () => g(C)
|
|
5847
5827
|
},
|
|
5848
|
-
|
|
5828
|
+
C
|
|
5849
5829
|
);
|
|
5850
5830
|
})
|
|
5851
5831
|
] });
|
|
@@ -5861,24 +5841,24 @@ function fe({
|
|
|
5861
5841
|
isReadOnly: l,
|
|
5862
5842
|
watch: u
|
|
5863
5843
|
} = e || {}, t = (u == null ? void 0 : u(i.id)) || "", { country: d, state: r } = oi(() => {
|
|
5864
|
-
var
|
|
5844
|
+
var f;
|
|
5865
5845
|
if (typeof t == "string" && t.includes(",")) {
|
|
5866
|
-
const [
|
|
5867
|
-
return { country: g, state:
|
|
5846
|
+
const [x, g] = (f = t.split(",")) == null ? void 0 : f.map((p) => p.trim());
|
|
5847
|
+
return { country: g, state: x };
|
|
5868
5848
|
}
|
|
5869
5849
|
return { country: t, state: "" };
|
|
5870
5850
|
}, [t]), c = Ci(t), v = oi(() => {
|
|
5871
|
-
var
|
|
5872
|
-
return d ? ((
|
|
5851
|
+
var f, x;
|
|
5852
|
+
return d ? ((x = (f = Xi.find((g) => g.name === d)) == null ? void 0 : f.states) == null ? void 0 : x.map((g) => ({
|
|
5873
5853
|
label: g.name,
|
|
5874
5854
|
value: g.name
|
|
5875
5855
|
}))) || [] : [];
|
|
5876
|
-
}, [d]), h = (
|
|
5877
|
-
const
|
|
5878
|
-
s &&
|
|
5879
|
-
},
|
|
5880
|
-
const g = (
|
|
5881
|
-
s &&
|
|
5856
|
+
}, [d]), h = (f, x) => {
|
|
5857
|
+
const p = (x == null ? void 0 : x.value) || "";
|
|
5858
|
+
s && p !== c.current && (s(i.id, p), a == null || a(i.id), c.current = p);
|
|
5859
|
+
}, b = (f, x) => {
|
|
5860
|
+
const g = (x == null ? void 0 : x.value) || "", p = g ? `${g}, ${d}` : d;
|
|
5861
|
+
s && p !== c.current && (s(i.id, p), a == null || a(i.id), c.current = p);
|
|
5882
5862
|
};
|
|
5883
5863
|
return D(() => {
|
|
5884
5864
|
c.current = t;
|
|
@@ -5901,7 +5881,7 @@ function fe({
|
|
|
5901
5881
|
Tn,
|
|
5902
5882
|
{
|
|
5903
5883
|
options: v,
|
|
5904
|
-
onGetValue:
|
|
5884
|
+
onGetValue: b,
|
|
5905
5885
|
name: `${i.id}-state`,
|
|
5906
5886
|
readOnly: l,
|
|
5907
5887
|
defaultValue: r
|
|
@@ -5916,7 +5896,7 @@ function Ps({
|
|
|
5916
5896
|
validationData: e
|
|
5917
5897
|
}) {
|
|
5918
5898
|
const { register: o = () => ({}), isReadOnly: s } = e || {}, { validationUrl: a, documentObj: l, signatureLink: u } = i, t = oi(() => xi("config"), []), [d, r] = P(!1), [c, v] = P(!1), h = $(async () => {
|
|
5919
|
-
var
|
|
5899
|
+
var b, f;
|
|
5920
5900
|
if (!(!a || !l))
|
|
5921
5901
|
try {
|
|
5922
5902
|
v(!0);
|
|
@@ -5924,25 +5904,25 @@ function Ps({
|
|
|
5924
5904
|
headers: {
|
|
5925
5905
|
Authorization: `Bearer ${xi("token")}`
|
|
5926
5906
|
}
|
|
5927
|
-
}, { data:
|
|
5907
|
+
}, { data: p } = await Ii.get(
|
|
5928
5908
|
`${a}/${l}`,
|
|
5929
5909
|
g
|
|
5930
|
-
),
|
|
5931
|
-
return r(
|
|
5932
|
-
} catch (
|
|
5933
|
-
console.error("Failed to check sign status",
|
|
5910
|
+
), y = !!((f = (b = p == null ? void 0 : p.data) == null ? void 0 : b.isSigned) != null ? f : p != null && p.isSigned);
|
|
5911
|
+
return r(y), y;
|
|
5912
|
+
} catch (x) {
|
|
5913
|
+
console.error("Failed to check sign status", x);
|
|
5934
5914
|
} finally {
|
|
5935
5915
|
v(!1);
|
|
5936
5916
|
}
|
|
5937
5917
|
}, [a, l]);
|
|
5938
5918
|
return D(() => {
|
|
5939
|
-
let
|
|
5919
|
+
let b = null;
|
|
5940
5920
|
return !d && l && a && (async () => {
|
|
5941
|
-
await h() || (
|
|
5942
|
-
await h() &&
|
|
5921
|
+
await h() || (b = setInterval(async () => {
|
|
5922
|
+
await h() && b && clearInterval(b);
|
|
5943
5923
|
}, 2e3));
|
|
5944
5924
|
})(), () => {
|
|
5945
|
-
|
|
5925
|
+
b && clearInterval(b);
|
|
5946
5926
|
};
|
|
5947
5927
|
}, [h, d, l, a]), /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
5948
5928
|
/* @__PURE__ */ n.jsx(
|
|
@@ -6240,41 +6220,41 @@ function Rs({
|
|
|
6240
6220
|
horizontal: c,
|
|
6241
6221
|
description: v,
|
|
6242
6222
|
validate: h,
|
|
6243
|
-
onChange:
|
|
6244
|
-
onError:
|
|
6223
|
+
onChange: b,
|
|
6224
|
+
onError: f
|
|
6245
6225
|
}) {
|
|
6246
|
-
const [
|
|
6226
|
+
const [x, g] = P(""), [p, y] = P(null), [C, S] = P(""), N = oi(
|
|
6247
6227
|
() => {
|
|
6248
|
-
var
|
|
6249
|
-
return (
|
|
6228
|
+
var E;
|
|
6229
|
+
return (E = fn == null ? void 0 : fn.slice().sort((W, I) => W.label.localeCompare(I.label))) == null ? void 0 : E.map((W) => ({ ...W, phone: `+${W.phone}` }));
|
|
6250
6230
|
},
|
|
6251
6231
|
[]
|
|
6252
|
-
), A = oi(() =>
|
|
6253
|
-
(
|
|
6254
|
-
) : N, [
|
|
6255
|
-
if (!
|
|
6256
|
-
const W =
|
|
6232
|
+
), A = oi(() => x ? N.filter(
|
|
6233
|
+
(E) => `${E.label} ${E.phone}`.toLowerCase().includes(x.toLowerCase())
|
|
6234
|
+
) : N, [x, N]), j = (p == null ? void 0 : p.min) || 10, O = (p == null ? void 0 : p.max) || 10, ii = () => C ? `${(p == null ? void 0 : p.phone) || "+234"}-${C}` : "", z = (E) => {
|
|
6235
|
+
if (!E) return { code: "+234", number: "" };
|
|
6236
|
+
const W = E.split(/[-\s]/);
|
|
6257
6237
|
return { code: W[0], number: W.slice(1).join(" ") };
|
|
6258
6238
|
};
|
|
6259
6239
|
D(() => {
|
|
6260
6240
|
if (u) {
|
|
6261
|
-
const
|
|
6262
|
-
|
|
6263
|
-
N.find((W) => W.phone ===
|
|
6264
|
-
), S(
|
|
6241
|
+
const E = z(u);
|
|
6242
|
+
y(
|
|
6243
|
+
N.find((W) => W.phone === E.code) || N[0]
|
|
6244
|
+
), S(E.number);
|
|
6265
6245
|
}
|
|
6266
6246
|
}, [u, N]);
|
|
6267
6247
|
const Z = oi(() => {
|
|
6268
6248
|
if (t) return t;
|
|
6269
|
-
const
|
|
6270
|
-
return s &&
|
|
6271
|
-
}, [t,
|
|
6249
|
+
const E = C.length;
|
|
6250
|
+
return s && E === 0 ? "Phone number is required" : E > 0 && !/^\d+$/.test(C) ? "Phone number must contain only digits" : E > 0 && E < j ? `Minimum length is ${j}` : E > O ? `Maximum length is ${O}` : "";
|
|
6251
|
+
}, [t, C, j, O, s]);
|
|
6272
6252
|
return D(() => {
|
|
6273
|
-
|
|
6274
|
-
}, [
|
|
6253
|
+
b == null || b(ii()), f == null || f(Z || null);
|
|
6254
|
+
}, [C, p, Z]), /* @__PURE__ */ n.jsxs(
|
|
6275
6255
|
"div",
|
|
6276
6256
|
{
|
|
6277
|
-
className: `relative formGroup ${Z && !r ? "has-error" : ""} ${c ? "flex" : ""} ${!Z &&
|
|
6257
|
+
className: `relative formGroup ${Z && !r ? "has-error" : ""} ${c ? "flex" : ""} ${!Z && C.length > 0 && !r ? "is-valid" : ""}`,
|
|
6278
6258
|
children: [
|
|
6279
6259
|
i && /* @__PURE__ */ n.jsxs(
|
|
6280
6260
|
"label",
|
|
@@ -6291,29 +6271,29 @@ function Rs({
|
|
|
6291
6271
|
),
|
|
6292
6272
|
/* @__PURE__ */ n.jsxs("div", { className: "relative !flex items-center input-control text-[#667085] !py-0 field-control", children: [
|
|
6293
6273
|
/* @__PURE__ */ n.jsx(_, { icon: "lucide:phone-call" }),
|
|
6294
|
-
/* @__PURE__ */ n.jsx(Ri, { value:
|
|
6274
|
+
/* @__PURE__ */ n.jsx(Ri, { value: p, onChange: y, children: /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
|
|
6295
6275
|
/* @__PURE__ */ n.jsx(
|
|
6296
6276
|
Ri.Input,
|
|
6297
6277
|
{
|
|
6298
6278
|
className: "pl-3 pr-4 mr-1 text-sm bg-white py-[10px] outline-none whitespace-nowrap max-w-[70px]",
|
|
6299
|
-
displayValue: (
|
|
6279
|
+
displayValue: (E) => (E == null ? void 0 : E.phone) || "+234",
|
|
6300
6280
|
placeholder: "+234",
|
|
6301
|
-
onChange: (
|
|
6281
|
+
onChange: (E) => g(E.target.value)
|
|
6302
6282
|
}
|
|
6303
6283
|
),
|
|
6304
6284
|
/* @__PURE__ */ n.jsx(Ri.Button, { className: "absolute inset-y-0 right-0 flex items-center pr-2", children: /* @__PURE__ */ n.jsx(_, { icon: "lucide:chevron-down" }) }),
|
|
6305
|
-
/* @__PURE__ */ n.jsx(Ri.Options, { className: "absolute z-10 w-[250px] left-0 bg-white border rounded-md shadow-lg max-h-[400px] overflow-y-auto", children: A == null ? void 0 : A.map((
|
|
6285
|
+
/* @__PURE__ */ n.jsx(Ri.Options, { className: "absolute z-10 w-[250px] left-0 bg-white border rounded-md shadow-lg max-h-[400px] overflow-y-auto", children: A == null ? void 0 : A.map((E, W) => /* @__PURE__ */ n.jsxs(
|
|
6306
6286
|
Ri.Option,
|
|
6307
6287
|
{
|
|
6308
|
-
value:
|
|
6288
|
+
value: E,
|
|
6309
6289
|
className: "px-4 py-2 cursor-pointer hover:bg-gray-100",
|
|
6310
6290
|
children: [
|
|
6311
|
-
|
|
6291
|
+
E.phone,
|
|
6312
6292
|
" - ",
|
|
6313
|
-
|
|
6293
|
+
E.label
|
|
6314
6294
|
]
|
|
6315
6295
|
},
|
|
6316
|
-
`${
|
|
6296
|
+
`${E.code}+ ${W}`
|
|
6317
6297
|
)) })
|
|
6318
6298
|
] }) }),
|
|
6319
6299
|
/* @__PURE__ */ n.jsxs("div", { className: "relative flex items-center flex-1 z-[1]", children: [
|
|
@@ -6322,20 +6302,20 @@ function Rs({
|
|
|
6322
6302
|
{
|
|
6323
6303
|
type: "tel",
|
|
6324
6304
|
inputMode: "numeric",
|
|
6325
|
-
value:
|
|
6305
|
+
value: C,
|
|
6326
6306
|
disabled: d,
|
|
6327
6307
|
readOnly: r,
|
|
6328
|
-
onChange: (
|
|
6329
|
-
const W =
|
|
6308
|
+
onChange: (E) => {
|
|
6309
|
+
const W = E.target.value.replace(/\D/g, "");
|
|
6330
6310
|
S(W);
|
|
6331
6311
|
},
|
|
6332
6312
|
placeholder: e,
|
|
6333
6313
|
className: "w-full px-3 outline-none",
|
|
6334
6314
|
maxLength: O,
|
|
6335
|
-
minLength:
|
|
6315
|
+
minLength: j
|
|
6336
6316
|
}
|
|
6337
6317
|
),
|
|
6338
|
-
/* @__PURE__ */ n.jsx("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !Z &&
|
|
6318
|
+
/* @__PURE__ */ n.jsx("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !Z && C.length > 0 && !r && /* @__PURE__ */ n.jsx("span", { className: "text-green-500", children: /* @__PURE__ */ n.jsx(_, { icon: "bi:check-lg" }) }) })
|
|
6339
6319
|
] })
|
|
6340
6320
|
] }),
|
|
6341
6321
|
v && /* @__PURE__ */ n.jsx("span", { className: "block text-[#475467] font-light leading-4 text-xs mt-2", children: v })
|
|
@@ -6433,13 +6413,13 @@ const He = {
|
|
|
6433
6413
|
multiSelect: Rn,
|
|
6434
6414
|
numberField: bn,
|
|
6435
6415
|
amountField: gs,
|
|
6436
|
-
date:
|
|
6416
|
+
date: wo,
|
|
6437
6417
|
password: Ka,
|
|
6438
6418
|
checkbox: Va,
|
|
6439
6419
|
radio: Ga,
|
|
6440
6420
|
email: bn,
|
|
6441
6421
|
file: Oa,
|
|
6442
|
-
dataGrid:
|
|
6422
|
+
dataGrid: ws,
|
|
6443
6423
|
section: Ha,
|
|
6444
6424
|
validateInput: ys,
|
|
6445
6425
|
tableInput: Ss,
|
|
@@ -6448,7 +6428,7 @@ const He = {
|
|
|
6448
6428
|
header: ks,
|
|
6449
6429
|
basicText: Cs,
|
|
6450
6430
|
phoneField: Ds,
|
|
6451
|
-
cascadeSelect:
|
|
6431
|
+
cascadeSelect: Es,
|
|
6452
6432
|
rating: Ls,
|
|
6453
6433
|
country: fe,
|
|
6454
6434
|
bank: fe,
|
|
@@ -6470,7 +6450,7 @@ const He = {
|
|
|
6470
6450
|
}, On = ({ col: i, children: e, customClass: o }) => /* @__PURE__ */ n.jsx(
|
|
6471
6451
|
"div",
|
|
6472
6452
|
{
|
|
6473
|
-
className: q("w-full bg-white", o),
|
|
6453
|
+
className: q("w-full bg-white min-w-0", o),
|
|
6474
6454
|
style: { gridColumn: i },
|
|
6475
6455
|
children: e
|
|
6476
6456
|
}
|
|
@@ -6492,37 +6472,37 @@ const He = {
|
|
|
6492
6472
|
} = ji(gi), h = oi(
|
|
6493
6473
|
() => Array.from({ length: i.columns }),
|
|
6494
6474
|
[i.columns]
|
|
6495
|
-
), [
|
|
6475
|
+
), [b, f] = P(null);
|
|
6496
6476
|
D(() => {
|
|
6497
6477
|
const S = () => {
|
|
6498
|
-
|
|
6478
|
+
f(null), d(!1);
|
|
6499
6479
|
};
|
|
6500
6480
|
return document.addEventListener("dragend", S), () => document.removeEventListener("dragend", S);
|
|
6501
6481
|
}, [d]);
|
|
6502
|
-
const
|
|
6482
|
+
const x = $(
|
|
6503
6483
|
(S, N) => {
|
|
6504
|
-
S.preventDefault(), S.stopPropagation(), S.dataTransfer.dropEffect = "move",
|
|
6484
|
+
S.preventDefault(), S.stopPropagation(), S.dataTransfer.dropEffect = "move", f(N);
|
|
6505
6485
|
},
|
|
6506
6486
|
[]
|
|
6507
6487
|
), g = $(
|
|
6508
6488
|
(S, N) => {
|
|
6509
|
-
S.preventDefault(), S.stopPropagation(),
|
|
6489
|
+
S.preventDefault(), S.stopPropagation(), f(N);
|
|
6510
6490
|
},
|
|
6511
6491
|
[]
|
|
6512
|
-
),
|
|
6492
|
+
), p = $(
|
|
6513
6493
|
(S, N) => {
|
|
6514
6494
|
const A = S.relatedTarget;
|
|
6515
|
-
A && S.currentTarget.contains(A) ||
|
|
6495
|
+
A && S.currentTarget.contains(A) || f((j) => j === N ? null : j);
|
|
6516
6496
|
},
|
|
6517
6497
|
[]
|
|
6518
|
-
),
|
|
6498
|
+
), y = $(
|
|
6519
6499
|
(S, N) => {
|
|
6520
6500
|
var O;
|
|
6521
|
-
S.preventDefault(), S.stopPropagation(), d(!1),
|
|
6522
|
-
const A = N + 1,
|
|
6523
|
-
if (
|
|
6501
|
+
S.preventDefault(), S.stopPropagation(), d(!1), f(null);
|
|
6502
|
+
const A = N + 1, j = S.dataTransfer.getData("elementId");
|
|
6503
|
+
if (j) {
|
|
6524
6504
|
r({
|
|
6525
|
-
draggedId:
|
|
6505
|
+
draggedId: j,
|
|
6526
6506
|
sectionId: e,
|
|
6527
6507
|
targetGridId: i.id,
|
|
6528
6508
|
targetCol: A
|
|
@@ -6534,13 +6514,13 @@ const He = {
|
|
|
6534
6514
|
if (!ii) return;
|
|
6535
6515
|
const z = JSON.parse(ii);
|
|
6536
6516
|
if ((z == null ? void 0 : z.type) === "grid") return;
|
|
6537
|
-
const Z = u.find((I) => I.id === e),
|
|
6517
|
+
const Z = u.find((I) => I.id === e), E = (O = Z == null ? void 0 : Z.questionData) == null ? void 0 : O.find(
|
|
6538
6518
|
(I) => {
|
|
6539
6519
|
var G;
|
|
6540
6520
|
return I.gridId === i.id && ((G = I.gridPosition) == null ? void 0 : G.col) === A;
|
|
6541
6521
|
}
|
|
6542
6522
|
);
|
|
6543
|
-
|
|
6523
|
+
E && v(E.id, e);
|
|
6544
6524
|
const W = {
|
|
6545
6525
|
...z,
|
|
6546
6526
|
id: Ai(),
|
|
@@ -6554,59 +6534,59 @@ const He = {
|
|
|
6554
6534
|
}
|
|
6555
6535
|
},
|
|
6556
6536
|
[t, i.id, u, e, d, r]
|
|
6557
|
-
),
|
|
6537
|
+
), C = (S, N, A) => {
|
|
6558
6538
|
var G, H, R;
|
|
6559
|
-
const
|
|
6539
|
+
const j = S + 1, O = (H = (G = u.find((T) => T.id === e)) == null ? void 0 : G.questionData) == null ? void 0 : H.find(
|
|
6560
6540
|
(T) => {
|
|
6561
|
-
var
|
|
6562
|
-
return T.gridId === i.id && ((
|
|
6541
|
+
var w;
|
|
6542
|
+
return T.gridId === i.id && ((w = T.gridPosition) == null ? void 0 : w.col) === j;
|
|
6563
6543
|
}
|
|
6564
6544
|
), ii = (R = O == null ? void 0 : O.id) != null ? R : null, z = Array.isArray(o) && o.find((T) => {
|
|
6565
|
-
var
|
|
6566
|
-
return ((
|
|
6567
|
-
}), Z = c &&
|
|
6545
|
+
var w;
|
|
6546
|
+
return ((w = T == null ? void 0 : T.props) == null ? void 0 : w.col) === j;
|
|
6547
|
+
}), Z = c && b === S, E = !!z, W = c && !!l, I = E && ii && A === "edit" ? {
|
|
6568
6548
|
draggable: !0,
|
|
6569
6549
|
onDragStart: (T) => {
|
|
6570
6550
|
T.stopPropagation(), T.dataTransfer.setData("elementId", ii), T.dataTransfer.setData("properties", ii), T.dataTransfer.effectAllowed = "move", d(!0);
|
|
6571
6551
|
},
|
|
6572
6552
|
onDragEnd: () => {
|
|
6573
|
-
|
|
6553
|
+
f(null), d(!1);
|
|
6574
6554
|
}
|
|
6575
6555
|
} : {};
|
|
6576
|
-
return /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsxs(
|
|
6556
|
+
return /* @__PURE__ */ n.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ n.jsxs(
|
|
6577
6557
|
"div",
|
|
6578
6558
|
{
|
|
6579
6559
|
id: `grid-cell-${i.id}-${S}`,
|
|
6580
6560
|
...I,
|
|
6581
|
-
onDrop: (T) =>
|
|
6561
|
+
onDrop: (T) => y(T, S),
|
|
6582
6562
|
onDragEnter: (T) => g(T, S),
|
|
6583
|
-
onDragOver: (T) =>
|
|
6584
|
-
onDragLeave: (T) =>
|
|
6563
|
+
onDragOver: (T) => x(T, S),
|
|
6564
|
+
onDragLeave: (T) => p(T, S),
|
|
6585
6565
|
className: q(
|
|
6586
|
-
"relative border rounded-lg min-h-[110px]",
|
|
6566
|
+
"relative border rounded-lg min-h-[110px] min-w-0",
|
|
6587
6567
|
"flex items-center justify-center",
|
|
6588
6568
|
"transition-all duration-200 ease-in-out",
|
|
6589
6569
|
A === "edit" ? "py-3 " : "",
|
|
6590
|
-
|
|
6570
|
+
E && A === "edit" && "cursor-grab active:cursor-grabbing border-none",
|
|
6591
6571
|
N,
|
|
6592
6572
|
!W && !Z && "bg-white border-gray-200 text-gray-300",
|
|
6593
|
-
W && !Z && !
|
|
6594
|
-
W && !Z &&
|
|
6595
|
-
Z && !
|
|
6596
|
-
Z &&
|
|
6573
|
+
W && !Z && !E && "bg-blue-50 border-blue-200 border-dashed text-blue-300",
|
|
6574
|
+
W && !Z && E && "bg-white border-orange-200 border-dashed",
|
|
6575
|
+
Z && !E && "bg-blue-100 border-blue-400 border-dashed shadow-inner scale-[1.01] text-blue-500",
|
|
6576
|
+
Z && E && "bg-orange-50 border-orange-400 border-dashed shadow-inner scale-[1.01] text-orange-500"
|
|
6597
6577
|
),
|
|
6598
6578
|
children: [
|
|
6599
|
-
|
|
6600
|
-
Z && !
|
|
6579
|
+
E && A === "edit" && /* @__PURE__ */ n.jsx("div", { className: "absolute top-1 left-1/2 -translate-x-1/2 flex items-center gap-0.5 px-2 py-0.5 rounded-full bg-gray-100 hover:bg-blue-100 text-gray-400 hover:text-blue-500 cursor-grab active:cursor-grabbing transition-colors z-10 opacity-60 hover:opacity-100 pointer-events-none select-none", children: /* @__PURE__ */ n.jsx(_, { icon: "ph:dots-six-bold" }) }),
|
|
6580
|
+
Z && !E && /* @__PURE__ */ n.jsxs("span", { className: "absolute inset-0 flex flex-col items-center justify-center gap-1 text-blue-400 text-xs font-medium pointer-events-none", children: [
|
|
6601
6581
|
/* @__PURE__ */ n.jsx(_, { icon: "ph:plus-bold" }),
|
|
6602
6582
|
"Drop here"
|
|
6603
6583
|
] }),
|
|
6604
|
-
Z &&
|
|
6584
|
+
Z && E && /* @__PURE__ */ n.jsx("span", { className: "absolute top-1 right-1 text-xs text-orange-400 font-medium pointer-events-none px-1 py-0.5 bg-orange-50 rounded", children: "Replace" }),
|
|
6605
6585
|
/* @__PURE__ */ n.jsx(
|
|
6606
6586
|
"div",
|
|
6607
6587
|
{
|
|
6608
6588
|
className: q(
|
|
6609
|
-
"w-full select-none",
|
|
6589
|
+
"w-full select-none min-w-0",
|
|
6610
6590
|
Z && "opacity-50 pointer-events-none"
|
|
6611
6591
|
),
|
|
6612
6592
|
children: z || /* @__PURE__ */ n.jsx("span", { className: "flex items-center justify-center text-gray-300", children: A === "edit" && /* @__PURE__ */ n.jsx(_, { icon: "ph:plus-bold" }) })
|
|
@@ -6621,10 +6601,10 @@ const He = {
|
|
|
6621
6601
|
{
|
|
6622
6602
|
className: "grid w-full gap-3 items-center",
|
|
6623
6603
|
style: {
|
|
6624
|
-
gridTemplateColumns: `repeat(${i.columns}, 1fr)`
|
|
6604
|
+
gridTemplateColumns: `repeat(${i.columns}, minmax(0, 1fr))`
|
|
6625
6605
|
},
|
|
6626
6606
|
children: h == null ? void 0 : h.map(
|
|
6627
|
-
(S, N) =>
|
|
6607
|
+
(S, N) => C(N, s, a)
|
|
6628
6608
|
)
|
|
6629
6609
|
}
|
|
6630
6610
|
) });
|
|
@@ -6674,13 +6654,13 @@ function Hs({ elementData: i, sectionId: e }) {
|
|
|
6674
6654
|
moveElement: u
|
|
6675
6655
|
} = ji(gi), [t, d] = P(null), r = oi(
|
|
6676
6656
|
() => {
|
|
6677
|
-
var
|
|
6678
|
-
return ((
|
|
6657
|
+
var p;
|
|
6658
|
+
return ((p = o.find((y) => y.id === e)) == null ? void 0 : p.questionData) || [];
|
|
6679
6659
|
},
|
|
6680
6660
|
[o, e]
|
|
6681
6661
|
), c = $(
|
|
6682
|
-
(
|
|
6683
|
-
|
|
6662
|
+
(p, y) => {
|
|
6663
|
+
p.dataTransfer.setData("elementId", y), p.dataTransfer.setData("properties", y), p.dataTransfer.effectAllowed = "move", d(y), a(!0);
|
|
6684
6664
|
},
|
|
6685
6665
|
[a]
|
|
6686
6666
|
), v = $(() => {
|
|
@@ -6690,93 +6670,93 @@ function Hs({ elementData: i, sectionId: e }) {
|
|
|
6690
6670
|
!s && t && d(null);
|
|
6691
6671
|
}, [s, t]);
|
|
6692
6672
|
const h = $(
|
|
6693
|
-
(
|
|
6694
|
-
|
|
6695
|
-
const
|
|
6696
|
-
if (!
|
|
6673
|
+
(p) => {
|
|
6674
|
+
p.preventDefault(), p.stopPropagation();
|
|
6675
|
+
const y = p.dataTransfer.getData("elementId"), C = p.currentTarget.id;
|
|
6676
|
+
if (!y || !C || y === C) {
|
|
6697
6677
|
v();
|
|
6698
6678
|
return;
|
|
6699
6679
|
}
|
|
6700
|
-
const S = r.find((A) => A.id ===
|
|
6701
|
-
(A) => A.id ===
|
|
6680
|
+
const S = r.find((A) => A.id === y), N = r.findIndex(
|
|
6681
|
+
(A) => A.id === C
|
|
6702
6682
|
);
|
|
6703
|
-
S != null && S.gridId && N !== -1 ? u({ draggedId:
|
|
6683
|
+
S != null && S.gridId && N !== -1 ? u({ draggedId: y, sectionId: e, targetIndex: N }) : u({ draggedId: y, sectionId: e, targetId: C }), d(null), a(!1);
|
|
6704
6684
|
},
|
|
6705
6685
|
[e, u, a, v, r]
|
|
6706
|
-
),
|
|
6707
|
-
(
|
|
6708
|
-
|
|
6709
|
-
const
|
|
6710
|
-
if (
|
|
6711
|
-
u({ draggedId:
|
|
6686
|
+
), b = $(
|
|
6687
|
+
(p, y) => {
|
|
6688
|
+
p.preventDefault(), p.stopPropagation(), a(!1);
|
|
6689
|
+
const C = p.dataTransfer.getData("elementId");
|
|
6690
|
+
if (C) {
|
|
6691
|
+
u({ draggedId: C, sectionId: e, targetIndex: y }), d(null);
|
|
6712
6692
|
return;
|
|
6713
6693
|
}
|
|
6714
6694
|
try {
|
|
6715
|
-
const S = JSON.parse(
|
|
6695
|
+
const S = JSON.parse(p.dataTransfer.getData("properties"));
|
|
6716
6696
|
if ((S == null ? void 0 : S.type) === "section") return;
|
|
6717
6697
|
const N = { ...S, id: Ai(), sectionId: e };
|
|
6718
|
-
l(N, e,
|
|
6698
|
+
l(N, e, y), d(null);
|
|
6719
6699
|
} catch (S) {
|
|
6720
6700
|
console.error("Drop error:", S);
|
|
6721
6701
|
}
|
|
6722
6702
|
},
|
|
6723
6703
|
[l, e, a, u]
|
|
6724
|
-
),
|
|
6725
|
-
(
|
|
6704
|
+
), f = $(
|
|
6705
|
+
(p, y = !1) => /* @__PURE__ */ n.jsx(
|
|
6726
6706
|
"div",
|
|
6727
6707
|
{
|
|
6728
|
-
id:
|
|
6708
|
+
id: p.id,
|
|
6729
6709
|
draggable: !0,
|
|
6730
|
-
onDragStart: (
|
|
6731
|
-
onDragOver:
|
|
6732
|
-
|
|
6710
|
+
onDragStart: (C) => c(C, p.id),
|
|
6711
|
+
onDragOver: y ? void 0 : (C) => {
|
|
6712
|
+
C.preventDefault(), C.stopPropagation();
|
|
6733
6713
|
},
|
|
6734
|
-
onDrop:
|
|
6714
|
+
onDrop: y ? void 0 : h,
|
|
6735
6715
|
onDragEnd: v,
|
|
6736
6716
|
className: q(
|
|
6737
6717
|
"cursor-grab active:cursor-grabbing border p-4 w-full rounded-lg",
|
|
6738
6718
|
"transition-all duration-200 ease-in-out",
|
|
6739
|
-
t ===
|
|
6719
|
+
t === p.id ? "opacity-40 scale-[0.98] bg-gray-100 border-dashed border-blue-300 shadow-inner" : t ? "bg-white border-dashed border-blue-200 shadow-sm" : "bg-white border-gray-200 shadow-sm hover:border-blue-300 hover:shadow-md"
|
|
6740
6720
|
),
|
|
6741
|
-
children: Os(
|
|
6721
|
+
children: Os(p, e)
|
|
6742
6722
|
},
|
|
6743
|
-
|
|
6723
|
+
p.id
|
|
6744
6724
|
),
|
|
6745
6725
|
[t, h, e, c, v]
|
|
6746
|
-
),
|
|
6726
|
+
), x = oi(() => (i == null ? void 0 : i.reduce((p, y) => (y.gridId && (p[y.gridId] = p[y.gridId] || [], p[y.gridId].push(y)), p), {})) || {}, [i]);
|
|
6747
6727
|
if (!(i != null && i.length))
|
|
6748
6728
|
return /* @__PURE__ */ n.jsx(
|
|
6749
6729
|
"div",
|
|
6750
6730
|
{
|
|
6751
|
-
onDragOver: (
|
|
6752
|
-
onDrop: (
|
|
6731
|
+
onDragOver: (p) => p.preventDefault(),
|
|
6732
|
+
onDrop: (p) => b(p, 0),
|
|
6753
6733
|
onDragEnd: v,
|
|
6754
6734
|
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",
|
|
6755
6735
|
children: "Drag or click an element to display"
|
|
6756
6736
|
}
|
|
6757
6737
|
);
|
|
6758
|
-
const g = i.filter((
|
|
6738
|
+
const g = i.filter((p) => !p.gridId);
|
|
6759
6739
|
return /* @__PURE__ */ n.jsxs("div", { className: "relative flex flex-col w-full h-full gap-2", children: [
|
|
6760
6740
|
/* @__PURE__ */ n.jsx(
|
|
6761
6741
|
xn,
|
|
6762
6742
|
{
|
|
6763
6743
|
index: 0,
|
|
6764
6744
|
isDragging: s,
|
|
6765
|
-
onDrop:
|
|
6745
|
+
onDrop: b,
|
|
6766
6746
|
onDragEnd: v
|
|
6767
6747
|
}
|
|
6768
6748
|
),
|
|
6769
|
-
g.map((
|
|
6770
|
-
const
|
|
6771
|
-
if (
|
|
6772
|
-
const
|
|
6749
|
+
g.map((p) => {
|
|
6750
|
+
const y = r.findIndex((C) => C.id === p.id);
|
|
6751
|
+
if (p.type === "grid") {
|
|
6752
|
+
const C = x[p.id] || [], S = t === p.id, N = !!t && !S;
|
|
6773
6753
|
return /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col gap-0", children: [
|
|
6774
6754
|
/* @__PURE__ */ n.jsx(
|
|
6775
6755
|
"div",
|
|
6776
6756
|
{
|
|
6777
|
-
id:
|
|
6757
|
+
id: p.id,
|
|
6778
6758
|
draggable: !0,
|
|
6779
|
-
onDragStart: (A) => c(A,
|
|
6759
|
+
onDragStart: (A) => c(A, p.id),
|
|
6780
6760
|
onDragOver: (A) => {
|
|
6781
6761
|
A.preventDefault(), A.stopPropagation();
|
|
6782
6762
|
},
|
|
@@ -6787,17 +6767,17 @@ function Hs({ elementData: i, sectionId: e }) {
|
|
|
6787
6767
|
"transition-all duration-200 ease-in-out",
|
|
6788
6768
|
S ? "opacity-40 scale-[0.98] bg-gray-100 border-dashed border-blue-400 shadow-inner" : N ? "bg-white border-dashed border-blue-200" : "bg-white border-gray-200 shadow-sm hover:border-blue-300 hover:shadow-md"
|
|
6789
6769
|
),
|
|
6790
|
-
children: /* @__PURE__ */ n.jsx(In, { element:
|
|
6770
|
+
children: /* @__PURE__ */ n.jsx(In, { element: p, state: "edit", children: /* @__PURE__ */ n.jsx(
|
|
6791
6771
|
Kn,
|
|
6792
6772
|
{
|
|
6793
|
-
element:
|
|
6773
|
+
element: p,
|
|
6794
6774
|
sectionId: e,
|
|
6795
6775
|
state: Gs,
|
|
6796
6776
|
draggedElementId: t,
|
|
6797
|
-
children:
|
|
6777
|
+
children: C == null ? void 0 : C.map(
|
|
6798
6778
|
(A) => {
|
|
6799
|
-
var
|
|
6800
|
-
return /* @__PURE__ */ n.jsx(On, { col: (
|
|
6779
|
+
var j;
|
|
6780
|
+
return /* @__PURE__ */ n.jsx(On, { col: (j = A.gridPosition) == null ? void 0 : j.col, children: f(A, !0) }, A.id);
|
|
6801
6781
|
}
|
|
6802
6782
|
)
|
|
6803
6783
|
}
|
|
@@ -6807,26 +6787,26 @@ function Hs({ elementData: i, sectionId: e }) {
|
|
|
6807
6787
|
/* @__PURE__ */ n.jsx(
|
|
6808
6788
|
xn,
|
|
6809
6789
|
{
|
|
6810
|
-
index:
|
|
6790
|
+
index: y + 1,
|
|
6811
6791
|
isDragging: s,
|
|
6812
|
-
onDrop:
|
|
6792
|
+
onDrop: b,
|
|
6813
6793
|
onDragEnd: v
|
|
6814
6794
|
}
|
|
6815
6795
|
)
|
|
6816
|
-
] },
|
|
6796
|
+
] }, p.id);
|
|
6817
6797
|
}
|
|
6818
6798
|
return /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col gap-0", children: [
|
|
6819
|
-
|
|
6799
|
+
f(p),
|
|
6820
6800
|
/* @__PURE__ */ n.jsx(
|
|
6821
6801
|
xn,
|
|
6822
6802
|
{
|
|
6823
|
-
index:
|
|
6803
|
+
index: y + 1,
|
|
6824
6804
|
isDragging: s,
|
|
6825
|
-
onDrop:
|
|
6805
|
+
onDrop: b,
|
|
6826
6806
|
onDragEnd: v
|
|
6827
6807
|
}
|
|
6828
6808
|
)
|
|
6829
|
-
] },
|
|
6809
|
+
] }, p.id);
|
|
6830
6810
|
})
|
|
6831
6811
|
] });
|
|
6832
6812
|
}
|
|
@@ -6849,8 +6829,8 @@ const Vs = an(Hs), Fs = B.object({
|
|
|
6849
6829
|
if (mi.useEffect(() => {
|
|
6850
6830
|
i || c();
|
|
6851
6831
|
}, [i, c]), !i) return null;
|
|
6852
|
-
const v = (
|
|
6853
|
-
s(
|
|
6832
|
+
const v = (b) => {
|
|
6833
|
+
s(b, o.id), e();
|
|
6854
6834
|
}, h = u();
|
|
6855
6835
|
return /* @__PURE__ */ n.jsx("div", { className: "fixed inset-0 bg-black/30 flex items-center justify-center z-[999] cursor-default no-drag select-none", children: /* @__PURE__ */ n.jsxs("div", { className: "min-w-[600px] bg-white rounded-xl shadow-xl relative flex flex-col items-center", children: [
|
|
6856
6836
|
/* @__PURE__ */ n.jsxs("div", { className: "w-full px-6 pt-6 pb-5 flex flex-col items-start gap-4 z-10 mb-6", children: [
|
|
@@ -6953,8 +6933,8 @@ const Vs = an(Hs), Fs = B.object({
|
|
|
6953
6933
|
const v = Ci(null), h = Ci(i.questionData.length);
|
|
6954
6934
|
return D(() => {
|
|
6955
6935
|
i.questionData.length > h.current && v.current && requestAnimationFrame(() => {
|
|
6956
|
-
var
|
|
6957
|
-
(
|
|
6936
|
+
var b;
|
|
6937
|
+
(b = v.current) == null || b.scrollTo({
|
|
6958
6938
|
top: v.current.scrollHeight,
|
|
6959
6939
|
behavior: "smooth"
|
|
6960
6940
|
});
|
|
@@ -7055,27 +7035,27 @@ const Vs = an(Hs), Fs = B.object({
|
|
|
7055
7035
|
setActiveSections: v
|
|
7056
7036
|
} = ji(gi), h = Ci((u == null ? void 0 : u.length) || 0);
|
|
7057
7037
|
D(() => {
|
|
7058
|
-
var
|
|
7059
|
-
d(((
|
|
7038
|
+
var p;
|
|
7039
|
+
d(((p = u[0]) == null ? void 0 : p.id) || null);
|
|
7060
7040
|
}, []), D(() => {
|
|
7061
7041
|
(u == null ? void 0 : u.length) > h.current && s.current && requestAnimationFrame(() => {
|
|
7062
|
-
var
|
|
7063
|
-
(
|
|
7042
|
+
var p;
|
|
7043
|
+
(p = s.current) == null || p.scrollTo({
|
|
7064
7044
|
top: s.current.scrollHeight,
|
|
7065
7045
|
behavior: "smooth"
|
|
7066
7046
|
});
|
|
7067
7047
|
}), h.current = (u == null ? void 0 : u.length) || 0;
|
|
7068
7048
|
}, [u == null ? void 0 : u.length]);
|
|
7069
|
-
const
|
|
7070
|
-
|
|
7049
|
+
const b = $((p) => {
|
|
7050
|
+
p.preventDefault(), p.dataTransfer.dropEffect = "move", s.current && (s.current.scrollTop = s.current.scrollHeight);
|
|
7071
7051
|
}, []);
|
|
7072
|
-
function
|
|
7073
|
-
c.includes(
|
|
7074
|
-
(
|
|
7075
|
-
) : v((
|
|
7052
|
+
function f(p) {
|
|
7053
|
+
c.includes(p) ? v(
|
|
7054
|
+
(y) => y.filter((C) => C !== p)
|
|
7055
|
+
) : v((y) => [...y, p]);
|
|
7076
7056
|
}
|
|
7077
|
-
function
|
|
7078
|
-
o.current =
|
|
7057
|
+
function x(p) {
|
|
7058
|
+
o.current = p, e(!0);
|
|
7079
7059
|
}
|
|
7080
7060
|
const g = xi("config");
|
|
7081
7061
|
return /* @__PURE__ */ n.jsxs(
|
|
@@ -7092,24 +7072,24 @@ const Vs = an(Hs), Fs = B.object({
|
|
|
7092
7072
|
section: o.current
|
|
7093
7073
|
}
|
|
7094
7074
|
),
|
|
7095
|
-
/* @__PURE__ */ n.jsxs("div", { className: "relative flex flex-col flex-1 w-full gap-y-3", children: [
|
|
7075
|
+
/* @__PURE__ */ n.jsxs("div", { id: "section-container", className: "relative flex flex-col flex-1 w-full gap-y-3 container", children: [
|
|
7096
7076
|
u == null ? void 0 : u.map(
|
|
7097
|
-
(
|
|
7077
|
+
(p, y) => /* @__PURE__ */ n.jsx(
|
|
7098
7078
|
Us,
|
|
7099
7079
|
{
|
|
7100
|
-
section:
|
|
7101
|
-
index:
|
|
7080
|
+
section: p,
|
|
7081
|
+
index: y,
|
|
7102
7082
|
selectedSection: r,
|
|
7103
7083
|
setSelectedSection: d,
|
|
7104
7084
|
activeSections: c,
|
|
7105
|
-
toggleSection:
|
|
7106
|
-
handleSectionEdit:
|
|
7085
|
+
toggleSection: f,
|
|
7086
|
+
handleSectionEdit: x,
|
|
7107
7087
|
removeSection: a,
|
|
7108
7088
|
formDataLength: u.length,
|
|
7109
|
-
onDragOver:
|
|
7089
|
+
onDragOver: b,
|
|
7110
7090
|
setIsDragging: t
|
|
7111
7091
|
},
|
|
7112
|
-
|
|
7092
|
+
p.id
|
|
7113
7093
|
)
|
|
7114
7094
|
),
|
|
7115
7095
|
/* @__PURE__ */ n.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ n.jsxs(
|
|
@@ -7177,7 +7157,7 @@ function Js({
|
|
|
7177
7157
|
}
|
|
7178
7158
|
),
|
|
7179
7159
|
/* @__PURE__ */ n.jsx(
|
|
7180
|
-
|
|
7160
|
+
Ei,
|
|
7181
7161
|
{
|
|
7182
7162
|
show: l,
|
|
7183
7163
|
as: "div",
|
|
@@ -7187,8 +7167,8 @@ function Js({
|
|
|
7187
7167
|
leave: "transition-all duration-300 ease-in-out origin-right",
|
|
7188
7168
|
leaveFrom: "opacity-100 w-2/5 translate-x-0",
|
|
7189
7169
|
leaveTo: "opacity-0 w-0 translate-x-10 px-0 overflow-hidden border-transparent shadow-none",
|
|
7190
|
-
className: "shrink-0
|
|
7191
|
-
children: /* @__PURE__ */ n.jsx("div", { className: "px-2 shadow_box
|
|
7170
|
+
className: "shrink-0 overflow-y-auto no-scrollbar max-h-[calc(100vh-70px)] form_preview w-2/5 min-w-0",
|
|
7171
|
+
children: /* @__PURE__ */ n.jsx("div", { className: "px-2 shadow_box min-w-[320px] min-w-0 bg-white border border-gray-100 rounded-lg container", children: /* @__PURE__ */ n.jsx(_s, {}) })
|
|
7192
7172
|
}
|
|
7193
7173
|
)
|
|
7194
7174
|
] });
|
|
@@ -7202,38 +7182,38 @@ const An = [
|
|
|
7202
7182
|
{ key: "advancedData", title: "Advanced / Data" }
|
|
7203
7183
|
], Ys = () => {
|
|
7204
7184
|
const [i, e] = P(""), { setIsDragging: o, addElement: s, selectedSection: a } = ji(gi), l = $(
|
|
7205
|
-
(
|
|
7185
|
+
(b, f) => {
|
|
7206
7186
|
if (!a) {
|
|
7207
7187
|
ki.error("Please select a section to add an element.");
|
|
7208
7188
|
return;
|
|
7209
7189
|
}
|
|
7210
|
-
|
|
7190
|
+
b.dataTransfer.setData("properties", JSON.stringify(f)), b.dataTransfer.effectAllowed = "move", o(!0);
|
|
7211
7191
|
},
|
|
7212
7192
|
[o, a]
|
|
7213
7193
|
);
|
|
7214
|
-
function u(
|
|
7194
|
+
function u(b) {
|
|
7215
7195
|
if (!a) {
|
|
7216
7196
|
ki.error("Please select a section to add an element.");
|
|
7217
7197
|
return;
|
|
7218
7198
|
}
|
|
7219
|
-
const
|
|
7220
|
-
...
|
|
7199
|
+
const f = {
|
|
7200
|
+
...b,
|
|
7221
7201
|
id: Ai(),
|
|
7222
7202
|
sectionId: a
|
|
7223
7203
|
};
|
|
7224
|
-
s(
|
|
7204
|
+
s(f, a);
|
|
7225
7205
|
}
|
|
7226
7206
|
const t = xi("config") || {}, d = t.elementColor, r = t.elementBgColor, c = t.elementBorderColor, v = Ya.filter(
|
|
7227
|
-
(
|
|
7228
|
-
), h = An == null ? void 0 : An.map((
|
|
7229
|
-
title:
|
|
7207
|
+
(b) => b.label.toLowerCase().includes(i.toLowerCase())
|
|
7208
|
+
), h = An == null ? void 0 : An.map((b) => ({
|
|
7209
|
+
title: b.title,
|
|
7230
7210
|
elements: v.filter(
|
|
7231
|
-
(
|
|
7232
|
-
var
|
|
7233
|
-
return (
|
|
7211
|
+
(f) => {
|
|
7212
|
+
var x;
|
|
7213
|
+
return (x = qa[b.key]) == null ? void 0 : x.includes(f.type);
|
|
7234
7214
|
}
|
|
7235
7215
|
)
|
|
7236
|
-
})).filter((
|
|
7216
|
+
})).filter((b) => b.elements.length > 0);
|
|
7237
7217
|
return /* @__PURE__ */ n.jsxs("div", { className: "pt-4 flex flex-col gap-y-6", children: [
|
|
7238
7218
|
/* @__PURE__ */ n.jsx("div", { className: "px-5", children: /* @__PURE__ */ n.jsx(
|
|
7239
7219
|
"input",
|
|
@@ -7241,19 +7221,19 @@ const An = [
|
|
|
7241
7221
|
className: "field-control",
|
|
7242
7222
|
placeholder: "Search",
|
|
7243
7223
|
value: i,
|
|
7244
|
-
onChange: (
|
|
7224
|
+
onChange: (b) => e(b.target.value),
|
|
7245
7225
|
name: "search",
|
|
7246
7226
|
id: "search"
|
|
7247
7227
|
}
|
|
7248
7228
|
) }),
|
|
7249
|
-
/* @__PURE__ */ n.jsx("div", { className: "flex-1 overflow-y-auto no-scrollbar max-h-[calc(100vh-100px)]", children: /* @__PURE__ */ n.jsx("ul", { className: "grid gap-y-5 mt-3 px-5 ", children: h == null ? void 0 : h.map((
|
|
7250
|
-
var
|
|
7229
|
+
/* @__PURE__ */ n.jsx("div", { className: "flex-1 overflow-y-auto no-scrollbar max-h-[calc(100vh-100px)]", children: /* @__PURE__ */ n.jsx("ul", { className: "grid gap-y-5 mt-3 px-5 ", children: h == null ? void 0 : h.map((b, f) => {
|
|
7230
|
+
var x;
|
|
7251
7231
|
return /* @__PURE__ */ n.jsxs("li", { children: [
|
|
7252
|
-
/* @__PURE__ */ n.jsx("h4", { className: "mb-2 text-[11px] font-bold text-gray-500 uppercase", children:
|
|
7253
|
-
/* @__PURE__ */ n.jsx("ul", { className: "grid grid-cols-2 gap-y-3 gap-x-4 mb-3", children: (
|
|
7232
|
+
/* @__PURE__ */ n.jsx("h4", { className: "mb-2 text-[11px] font-bold text-gray-500 uppercase", children: b.title }),
|
|
7233
|
+
/* @__PURE__ */ n.jsx("ul", { className: "grid grid-cols-2 gap-y-3 gap-x-4 mb-3", children: (x = b.elements) == null ? void 0 : x.map((g) => /* @__PURE__ */ n.jsx(
|
|
7254
7234
|
"li",
|
|
7255
7235
|
{
|
|
7256
|
-
onDragStart: (
|
|
7236
|
+
onDragStart: (p) => l(p, g),
|
|
7257
7237
|
onDragEnd: () => o(!1),
|
|
7258
7238
|
onClick: () => u(g),
|
|
7259
7239
|
style: {
|
|
@@ -7279,10 +7259,10 @@ const An = [
|
|
|
7279
7259
|
},
|
|
7280
7260
|
g.type
|
|
7281
7261
|
)) })
|
|
7282
|
-
] },
|
|
7262
|
+
] }, f);
|
|
7283
7263
|
}) }) })
|
|
7284
7264
|
] });
|
|
7285
|
-
}, qs = an(Ys),
|
|
7265
|
+
}, qs = an(Ys), wi = ({
|
|
7286
7266
|
text: i = "",
|
|
7287
7267
|
isDisabled: e = !1,
|
|
7288
7268
|
isLoading: o = !1,
|
|
@@ -7297,14 +7277,14 @@ const An = [
|
|
|
7297
7277
|
style: v,
|
|
7298
7278
|
onClick: h
|
|
7299
7279
|
}) => {
|
|
7300
|
-
const
|
|
7280
|
+
const b = q(
|
|
7301
7281
|
"btn inline-flex justify-center",
|
|
7302
7282
|
{
|
|
7303
7283
|
"pointer-events-none": o,
|
|
7304
7284
|
"opacity-40 cursor-not-allowed": e
|
|
7305
7285
|
},
|
|
7306
7286
|
s
|
|
7307
|
-
),
|
|
7287
|
+
), f = () => o ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
7308
7288
|
/* @__PURE__ */ n.jsxs(
|
|
7309
7289
|
"svg",
|
|
7310
7290
|
{
|
|
@@ -7341,16 +7321,16 @@ const An = [
|
|
|
7341
7321
|
i && /* @__PURE__ */ n.jsx("span", { children: i }),
|
|
7342
7322
|
a && l === "right" && /* @__PURE__ */ n.jsx("span", { className: `ml-[6px] ${u}`, children: /* @__PURE__ */ n.jsx(_, { icon: a }) })
|
|
7343
7323
|
] });
|
|
7344
|
-
return r ? /* @__PURE__ */ n.jsx("div", { className:
|
|
7324
|
+
return r ? /* @__PURE__ */ n.jsx("div", { className: b, children: f() }) : d ? /* @__PURE__ */ n.jsx(ko, { to: d, className: b, children: f() }) : /* @__PURE__ */ n.jsx(
|
|
7345
7325
|
"button",
|
|
7346
7326
|
{
|
|
7347
7327
|
disabled: e,
|
|
7348
7328
|
type: c,
|
|
7349
|
-
className:
|
|
7329
|
+
className: b,
|
|
7350
7330
|
"data-testid": "btn",
|
|
7351
7331
|
onClick: h,
|
|
7352
7332
|
style: v,
|
|
7353
|
-
children:
|
|
7333
|
+
children: f()
|
|
7354
7334
|
}
|
|
7355
7335
|
);
|
|
7356
7336
|
};
|
|
@@ -7411,7 +7391,7 @@ const $s = ({
|
|
|
7411
7391
|
}
|
|
7412
7392
|
),
|
|
7413
7393
|
" ",
|
|
7414
|
-
/* @__PURE__ */ n.jsx("div", { className: "max-h-[80vh] overflow-y-auto h-max w-full max-w-[650px] min-w-0 border border-[#D5D9EB] rounded-lg bg-white form_submit", children: /* @__PURE__ */ n.jsx(
|
|
7394
|
+
/* @__PURE__ */ n.jsx("div", { className: "max-h-[80vh] overflow-y-auto h-max w-full max-w-[650px] min-w-0 border border-[#D5D9EB] rounded-lg bg-white form_submit container", children: /* @__PURE__ */ n.jsx(
|
|
7415
7395
|
Fe,
|
|
7416
7396
|
{
|
|
7417
7397
|
form_data: o,
|
|
@@ -7457,15 +7437,15 @@ function Xs({
|
|
|
7457
7437
|
publishLoading: u,
|
|
7458
7438
|
onTitleChange: t
|
|
7459
7439
|
}) {
|
|
7460
|
-
const { formData: d, setShowPreview: r, showPreview: c } = ji(gi), [v, h] = P(!1), [
|
|
7461
|
-
function
|
|
7440
|
+
const { formData: d, setShowPreview: r, showPreview: c } = ji(gi), [v, h] = P(!1), [b, f] = P(!1), [x, g] = P(i || ""), p = xi("config");
|
|
7441
|
+
function y() {
|
|
7462
7442
|
localStorage.setItem("formData", JSON.stringify(d)), o == null || o(d);
|
|
7463
7443
|
}
|
|
7464
|
-
function
|
|
7444
|
+
function C() {
|
|
7465
7445
|
localStorage.setItem("formData", JSON.stringify(d)), s == null || s(d);
|
|
7466
7446
|
}
|
|
7467
7447
|
function S() {
|
|
7468
|
-
|
|
7448
|
+
f(!1), t && x !== i && t(x.trim());
|
|
7469
7449
|
}
|
|
7470
7450
|
return /* @__PURE__ */ n.jsxs("div", { className: "px-[30px] py-3 flex justify-between items-center bg-[#F9F9FB] top_bar border-b h-full", children: [
|
|
7471
7451
|
/* @__PURE__ */ n.jsxs("span", { className: "flex items-center gap-x-2", children: [
|
|
@@ -7474,17 +7454,17 @@ function Xs({
|
|
|
7474
7454
|
{
|
|
7475
7455
|
type: "button",
|
|
7476
7456
|
onClick: () => e(),
|
|
7477
|
-
style: { color: (
|
|
7457
|
+
style: { color: (p == null ? void 0 : p.buttonColor) || "#333" },
|
|
7478
7458
|
className: "flex items-center gap-x-3",
|
|
7479
7459
|
children: /* @__PURE__ */ n.jsx(Qs, {})
|
|
7480
7460
|
}
|
|
7481
7461
|
),
|
|
7482
7462
|
" ",
|
|
7483
|
-
|
|
7463
|
+
b ? /* @__PURE__ */ n.jsx(
|
|
7484
7464
|
"input",
|
|
7485
7465
|
{
|
|
7486
7466
|
type: "text",
|
|
7487
|
-
value:
|
|
7467
|
+
value: x,
|
|
7488
7468
|
onChange: (N) => g(N.target.value),
|
|
7489
7469
|
onBlur: S,
|
|
7490
7470
|
autoFocus: !0,
|
|
@@ -7495,8 +7475,8 @@ function Xs({
|
|
|
7495
7475
|
{
|
|
7496
7476
|
title: "Click to edit",
|
|
7497
7477
|
className: "text-base font-semibold cursor-pointer form_title",
|
|
7498
|
-
onClick: () =>
|
|
7499
|
-
children:
|
|
7478
|
+
onClick: () => f(!0),
|
|
7479
|
+
children: x || "Untitled"
|
|
7500
7480
|
}
|
|
7501
7481
|
)
|
|
7502
7482
|
] }),
|
|
@@ -7510,37 +7490,37 @@ function Xs({
|
|
|
7510
7490
|
),
|
|
7511
7491
|
/* @__PURE__ */ n.jsxs("div", { className: "flex justify-end text-xs gap-x-3", children: [
|
|
7512
7492
|
/* @__PURE__ */ n.jsx(
|
|
7513
|
-
|
|
7493
|
+
wi,
|
|
7514
7494
|
{
|
|
7515
7495
|
onClick: () => r((N) => !N),
|
|
7516
7496
|
text: c ? "Hide Preview" : "Preview",
|
|
7517
7497
|
btnClass: "px-2 bg-transparent font-medium text-sm form_preview",
|
|
7518
7498
|
icon: c ? "iconamoon:eye-off-duotone" : "solar:eye-bold-duotone",
|
|
7519
7499
|
iconClass: "text-base",
|
|
7520
|
-
style: { color: (
|
|
7500
|
+
style: { color: (p == null ? void 0 : p.buttonColor) || "#333" },
|
|
7521
7501
|
isDisabled: a,
|
|
7522
7502
|
isLoading: a
|
|
7523
7503
|
}
|
|
7524
7504
|
),
|
|
7525
7505
|
/* @__PURE__ */ n.jsx(
|
|
7526
|
-
|
|
7506
|
+
wi,
|
|
7527
7507
|
{
|
|
7528
|
-
onClick:
|
|
7508
|
+
onClick: y,
|
|
7529
7509
|
text: "Save",
|
|
7530
7510
|
btnClass: "px-2 bg-transparent font-medium text-sm form_save__btn",
|
|
7531
7511
|
icon: "lets-icons:save-duotone",
|
|
7532
7512
|
iconClass: "text-base",
|
|
7533
|
-
style: { color: (
|
|
7513
|
+
style: { color: (p == null ? void 0 : p.buttonColor) || "#333" },
|
|
7534
7514
|
isDisabled: l,
|
|
7535
7515
|
isLoading: l
|
|
7536
7516
|
}
|
|
7537
7517
|
),
|
|
7538
7518
|
/* @__PURE__ */ n.jsx(
|
|
7539
|
-
|
|
7519
|
+
wi,
|
|
7540
7520
|
{
|
|
7541
|
-
onClick:
|
|
7521
|
+
onClick: C,
|
|
7542
7522
|
text: "Publish",
|
|
7543
|
-
style: { background: (
|
|
7523
|
+
style: { background: (p == null ? void 0 : p.buttonColor) || "#333" },
|
|
7544
7524
|
btnClass: "border-[#98A2B3] font-medium text-sm py-2 px-6 text-white rounded-lg form_publish__btn",
|
|
7545
7525
|
isDisabled: u,
|
|
7546
7526
|
isLoading: u
|
|
@@ -7575,8 +7555,8 @@ function il({
|
|
|
7575
7555
|
return /* @__PURE__ */ n.jsxs(Se, { children: [
|
|
7576
7556
|
/* @__PURE__ */ n.jsx(Ae, { position: "top-right", richColors: !0, closeButton: !0 }),
|
|
7577
7557
|
/* @__PURE__ */ n.jsx("div", { className: "w-full h-full bg-[#F8F9FC] flex flex-col", children: /* @__PURE__ */ n.jsxs("div", { className: "flex flex-1 ", children: [
|
|
7578
|
-
/* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx("div", { className: "w-[
|
|
7579
|
-
/* @__PURE__ */ n.jsxs("div", { className: "flex-1 h-full max-h-full z-[1]", children: [
|
|
7558
|
+
/* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx("div", { className: "w-[250px] h-screen border-r border-[#E4E7EC] bg-white ", children: /* @__PURE__ */ n.jsx(qs, {}) }) }),
|
|
7559
|
+
/* @__PURE__ */ n.jsxs("div", { className: "flex-1 h-full max-h-full z-[1] w-[calc(100%-250px)]", children: [
|
|
7580
7560
|
/* @__PURE__ */ n.jsx("div", { className: " h-[70px]", children: /* @__PURE__ */ n.jsx(
|
|
7581
7561
|
Xs,
|
|
7582
7562
|
{
|
|
@@ -7731,8 +7711,8 @@ const en = ({ element: i, validationData: e }) => {
|
|
|
7731
7711
|
}
|
|
7732
7712
|
}
|
|
7733
7713
|
) : !0, [l, s, i]);
|
|
7734
|
-
return o ? /* @__PURE__ */ n.jsxs("div", { className: u ? "" : "invisible h-0"
|
|
7735
|
-
/* @__PURE__ */ n.jsxs("div", { className: "mb-1.5", children: [
|
|
7714
|
+
return o ? /* @__PURE__ */ n.jsxs("div", { className: `${u ? "" : "invisible h-0"} min-w-0 w-full`, children: [
|
|
7715
|
+
/* @__PURE__ */ n.jsxs("div", { className: "mb-1.5 min-w-0", children: [
|
|
7736
7716
|
i.inputLabel && /* @__PURE__ */ n.jsxs("label", { className: "block text-sm font-medium input_label", children: [
|
|
7737
7717
|
i.inputLabel,
|
|
7738
7718
|
" ",
|
|
@@ -7761,7 +7741,7 @@ const en = ({ element: i, validationData: e }) => {
|
|
|
7761
7741
|
] }) : null;
|
|
7762
7742
|
}, on = (i, e) => i != null && i.allowEdit ? { ...e, isReadOnly: !1 } : e;
|
|
7763
7743
|
function ll({ form_data: i, options: e }) {
|
|
7764
|
-
const o = (a, l) => /* @__PURE__ */ n.jsx(
|
|
7744
|
+
const o = (a, l) => /* @__PURE__ */ n.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ n.jsx(
|
|
7765
7745
|
Kn,
|
|
7766
7746
|
{
|
|
7767
7747
|
element: a,
|
|
@@ -7787,14 +7767,13 @@ function ll({ form_data: i, options: e }) {
|
|
|
7787
7767
|
u.id
|
|
7788
7768
|
);
|
|
7789
7769
|
})
|
|
7790
|
-
}
|
|
7791
|
-
|
|
7792
|
-
), s = (a) => {
|
|
7770
|
+
}
|
|
7771
|
+
) }, a.id), s = (a) => {
|
|
7793
7772
|
var l, u;
|
|
7794
7773
|
return /* @__PURE__ */ n.jsxs(
|
|
7795
7774
|
"div",
|
|
7796
7775
|
{
|
|
7797
|
-
className: q("group relative grid gap-y-[6px]", a.elementClass),
|
|
7776
|
+
className: q("group relative grid gap-y-[6px] min-w-0", a.elementClass),
|
|
7798
7777
|
children: [
|
|
7799
7778
|
/* @__PURE__ */ n.jsx(
|
|
7800
7779
|
en,
|
|
@@ -7814,12 +7793,12 @@ function ll({ form_data: i, options: e }) {
|
|
|
7814
7793
|
const l = /* @__PURE__ */ new Map();
|
|
7815
7794
|
return (u = a.questionData) == null || u.forEach((d) => {
|
|
7816
7795
|
d.gridId && (l.has(d.gridId) || l.set(d.gridId, []), l.get(d.gridId).push(d));
|
|
7817
|
-
}), /* @__PURE__ */ n.jsxs("div", { className: "pb-6 section_box", children: [
|
|
7796
|
+
}), /* @__PURE__ */ n.jsxs("div", { className: "pb-6 section_box min-w-0", children: [
|
|
7818
7797
|
(a.title || a.description) && /* @__PURE__ */ n.jsxs("div", { className: "py-4 border-b border-gray-100 mb-7 section_box__title", children: [
|
|
7819
7798
|
a.title && /* @__PURE__ */ n.jsx("h2", { className: "text-lg font-semibold mb-[4px]", children: a.title }),
|
|
7820
7799
|
a.description && /* @__PURE__ */ n.jsx("p", { className: "text-sm", children: a.description })
|
|
7821
7800
|
] }),
|
|
7822
|
-
/* @__PURE__ */ n.jsx("div", { className: "grid gap-y-6 section_box__content", children: (t = a.questionData) == null ? void 0 : t.map((d) => d.gridId ? null : d.type === "grid" ? o(
|
|
7801
|
+
/* @__PURE__ */ n.jsx("div", { className: "grid gap-y-6 section_box__content min-w-0", children: (t = a.questionData) == null ? void 0 : t.map((d) => d.gridId ? null : d.type === "grid" ? o(
|
|
7823
7802
|
d,
|
|
7824
7803
|
l.get(d.id) || []
|
|
7825
7804
|
) : s(d)) })
|
|
@@ -7828,13 +7807,13 @@ function ll({ form_data: i, options: e }) {
|
|
|
7828
7807
|
}
|
|
7829
7808
|
function dl({ form_data: i, options: e, current: o }) {
|
|
7830
7809
|
var s;
|
|
7831
|
-
return /* @__PURE__ */ n.jsx("div", { className: "grid gap-y-3 multi_section__content", children: (s = i[o].questionData) == null ? void 0 : s.map((a) => {
|
|
7810
|
+
return /* @__PURE__ */ n.jsx("div", { className: "grid gap-y-3 multi_section__content min-w-0", children: (s = i[o].questionData) == null ? void 0 : s.map((a) => {
|
|
7832
7811
|
var l, u;
|
|
7833
7812
|
if (a.type === "grid") {
|
|
7834
7813
|
const t = i[o].questionData.filter(
|
|
7835
7814
|
(d) => d.gridId === a.id
|
|
7836
7815
|
);
|
|
7837
|
-
return /* @__PURE__ */ n.jsx(
|
|
7816
|
+
return /* @__PURE__ */ n.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ n.jsx(
|
|
7838
7817
|
Kn,
|
|
7839
7818
|
{
|
|
7840
7819
|
element: a,
|
|
@@ -7860,15 +7839,14 @@ function dl({ form_data: i, options: e, current: o }) {
|
|
|
7860
7839
|
d.id
|
|
7861
7840
|
);
|
|
7862
7841
|
})
|
|
7863
|
-
}
|
|
7864
|
-
|
|
7865
|
-
);
|
|
7842
|
+
}
|
|
7843
|
+
) }, a.id);
|
|
7866
7844
|
}
|
|
7867
7845
|
return a.gridId ? null : /* @__PURE__ */ n.jsxs(
|
|
7868
7846
|
"div",
|
|
7869
7847
|
{
|
|
7870
7848
|
className: q(
|
|
7871
|
-
"group relative grid gap-y-[6px]",
|
|
7849
|
+
"group relative grid gap-y-[6px] min-w-0",
|
|
7872
7850
|
a.elementClass
|
|
7873
7851
|
),
|
|
7874
7852
|
children: [
|
|
@@ -7902,7 +7880,7 @@ const tl = ({
|
|
|
7902
7880
|
uploadUrl: r
|
|
7903
7881
|
}) => {
|
|
7904
7882
|
var ni, si, hi, vi, L, K, X, ui;
|
|
7905
|
-
const { setAnswerData: c, setUploadUrl: v } = ji(gi), [h,
|
|
7883
|
+
const { setAnswerData: c, setUploadUrl: v } = ji(gi), [h, b] = P(0), f = oi(
|
|
7906
7884
|
() => i.filter((J) => !J.isHidden).map((J) => {
|
|
7907
7885
|
var pi;
|
|
7908
7886
|
return J.isDisabled || J.disabled ? {
|
|
@@ -7914,26 +7892,26 @@ const tl = ({
|
|
|
7914
7892
|
} : J;
|
|
7915
7893
|
}),
|
|
7916
7894
|
[i]
|
|
7917
|
-
),
|
|
7918
|
-
() => sl(
|
|
7919
|
-
[
|
|
7920
|
-
),
|
|
7921
|
-
resolver: Dn(
|
|
7895
|
+
), x = (ni = f == null ? void 0 : f.length) != null ? ni : 0, g = xi("config"), p = oi(
|
|
7896
|
+
() => sl(f),
|
|
7897
|
+
[f]
|
|
7898
|
+
), y = Bn({
|
|
7899
|
+
resolver: Dn(p),
|
|
7922
7900
|
mode: "onSubmit",
|
|
7923
7901
|
defaultValues: {}
|
|
7924
7902
|
}), {
|
|
7925
|
-
register:
|
|
7903
|
+
register: C,
|
|
7926
7904
|
setValue: S,
|
|
7927
7905
|
control: N,
|
|
7928
7906
|
handleSubmit: A,
|
|
7929
|
-
reset:
|
|
7907
|
+
reset: j,
|
|
7930
7908
|
getValues: O,
|
|
7931
7909
|
watch: ii,
|
|
7932
7910
|
formState: { errors: z, isSubmitting: Z },
|
|
7933
|
-
trigger:
|
|
7911
|
+
trigger: E,
|
|
7934
7912
|
setError: W,
|
|
7935
7913
|
clearErrors: I
|
|
7936
|
-
} =
|
|
7914
|
+
} = y, G = yo({ control: N }), H = oi(
|
|
7937
7915
|
() => G,
|
|
7938
7916
|
[JSON.stringify(G)]
|
|
7939
7917
|
), R = $(
|
|
@@ -7945,8 +7923,8 @@ const tl = ({
|
|
|
7945
7923
|
D(() => {
|
|
7946
7924
|
v(r);
|
|
7947
7925
|
}, [v, r]), D(() => {
|
|
7948
|
-
if (!(
|
|
7949
|
-
const J =
|
|
7926
|
+
if (!(f != null && f.length) || !a) return;
|
|
7927
|
+
const J = f.flatMap(
|
|
7950
7928
|
(li) => {
|
|
7951
7929
|
var pi;
|
|
7952
7930
|
return (pi = li.questionData) == null ? void 0 : pi.map((Si) => ({
|
|
@@ -7963,16 +7941,16 @@ const tl = ({
|
|
|
7963
7941
|
R(J), c(H);
|
|
7964
7942
|
}, [
|
|
7965
7943
|
H,
|
|
7966
|
-
|
|
7944
|
+
f,
|
|
7967
7945
|
R,
|
|
7968
7946
|
a,
|
|
7969
7947
|
c
|
|
7970
7948
|
]), D(() => {
|
|
7971
|
-
e != null && e.length &&
|
|
7972
|
-
}, [e,
|
|
7949
|
+
e != null && e.length && j(ul(e));
|
|
7950
|
+
}, [e, j]);
|
|
7973
7951
|
const T = $(
|
|
7974
7952
|
(J) => {
|
|
7975
|
-
const li =
|
|
7953
|
+
const li = f.flatMap(
|
|
7976
7954
|
(pi) => {
|
|
7977
7955
|
var Si;
|
|
7978
7956
|
return (Si = pi.questionData) == null ? void 0 : Si.map((Mi) => ({
|
|
@@ -7988,25 +7966,25 @@ const tl = ({
|
|
|
7988
7966
|
);
|
|
7989
7967
|
Object.keys(z).length > 0 || s == null || s(li);
|
|
7990
7968
|
},
|
|
7991
|
-
[z,
|
|
7992
|
-
),
|
|
7969
|
+
[z, f, s]
|
|
7970
|
+
), w = $(async () => {
|
|
7993
7971
|
var J, li;
|
|
7994
7972
|
if (!o) {
|
|
7995
|
-
const pi = (li = (J =
|
|
7973
|
+
const pi = (li = (J = f == null ? void 0 : f[h]) == null ? void 0 : J.questionData) == null ? void 0 : li.map(
|
|
7996
7974
|
(Mi) => Mi.id
|
|
7997
7975
|
);
|
|
7998
|
-
if (!await
|
|
7976
|
+
if (!await E(pi)) return;
|
|
7999
7977
|
}
|
|
8000
|
-
|
|
8001
|
-
}, [h,
|
|
8002
|
-
|
|
7978
|
+
b((pi) => pi + 1);
|
|
7979
|
+
}, [h, f, o, E]), U = $(() => {
|
|
7980
|
+
b((J) => J - 1);
|
|
8003
7981
|
}, []), ci = oi(
|
|
8004
7982
|
() => ({
|
|
8005
|
-
register:
|
|
7983
|
+
register: C,
|
|
8006
7984
|
setValue: S,
|
|
8007
7985
|
watch: ii,
|
|
8008
7986
|
errors: z,
|
|
8009
|
-
trigger:
|
|
7987
|
+
trigger: E,
|
|
8010
7988
|
isSubmitting: Z,
|
|
8011
7989
|
isReadOnly: l,
|
|
8012
7990
|
getValues: O,
|
|
@@ -8014,11 +7992,11 @@ const tl = ({
|
|
|
8014
7992
|
clearErrors: I
|
|
8015
7993
|
}),
|
|
8016
7994
|
[
|
|
8017
|
-
|
|
7995
|
+
C,
|
|
8018
7996
|
S,
|
|
8019
7997
|
ii,
|
|
8020
7998
|
z,
|
|
8021
|
-
|
|
7999
|
+
E,
|
|
8022
8000
|
Z,
|
|
8023
8001
|
l,
|
|
8024
8002
|
O,
|
|
@@ -8026,48 +8004,47 @@ const tl = ({
|
|
|
8026
8004
|
I
|
|
8027
8005
|
]
|
|
8028
8006
|
);
|
|
8029
|
-
return /* @__PURE__ */ n.jsxs(Ao, { ...
|
|
8007
|
+
return /* @__PURE__ */ n.jsxs(Ao, { ...y, children: [
|
|
8030
8008
|
/* @__PURE__ */ n.jsx(Ae, { position: "top-right", richColors: !0, closeButton: !0 }),
|
|
8031
8009
|
/* @__PURE__ */ n.jsxs(
|
|
8032
8010
|
"form",
|
|
8033
8011
|
{
|
|
8034
|
-
id: "form",
|
|
8035
8012
|
onSubmit: A(T),
|
|
8036
8013
|
className: "container h-full mx-auto",
|
|
8037
8014
|
children: [
|
|
8038
|
-
/* @__PURE__ */ n.jsx("div", { className: "relative flex flex-col w-full py-4 gap-y-12", children: /* @__PURE__ */ n.jsxs(
|
|
8015
|
+
/* @__PURE__ */ n.jsx("div", { className: "relative flex flex-col w-full min-w-0 py-4 gap-y-12", children: /* @__PURE__ */ n.jsxs(
|
|
8039
8016
|
"div",
|
|
8040
8017
|
{
|
|
8041
|
-
className: "multi_section__box",
|
|
8018
|
+
className: "multi_section__box min-w-0",
|
|
8042
8019
|
children: [
|
|
8043
|
-
u === "multi" && (((si =
|
|
8044
|
-
((vi =
|
|
8045
|
-
((K =
|
|
8020
|
+
u === "multi" && (((si = f == null ? void 0 : f[h]) == null ? void 0 : si.title) || ((hi = f == null ? void 0 : f[h]) == null ? void 0 : hi.description)) && /* @__PURE__ */ n.jsxs("div", { className: "py-4 mb-4 border-b border-gray-100 multi_section__title", children: [
|
|
8021
|
+
((vi = f[h]) == null ? void 0 : vi.title) && /* @__PURE__ */ n.jsx("h2", { className: "text-lg font-semibold mb-[6px]", children: (L = f[h]) == null ? void 0 : L.title }),
|
|
8022
|
+
((K = f[h]) == null ? void 0 : K.description) && /* @__PURE__ */ n.jsx("p", { className: "text-sm", children: (X = f[h]) == null ? void 0 : X.description })
|
|
8046
8023
|
] }),
|
|
8047
8024
|
u === "multi" ? /* @__PURE__ */ n.jsx(
|
|
8048
8025
|
dl,
|
|
8049
8026
|
{
|
|
8050
|
-
form_data:
|
|
8027
|
+
form_data: f,
|
|
8051
8028
|
options: ci,
|
|
8052
8029
|
current: h
|
|
8053
8030
|
}
|
|
8054
8031
|
) : /* @__PURE__ */ n.jsx(
|
|
8055
8032
|
ll,
|
|
8056
8033
|
{
|
|
8057
|
-
form_data:
|
|
8034
|
+
form_data: f,
|
|
8058
8035
|
options: ci
|
|
8059
8036
|
}
|
|
8060
8037
|
)
|
|
8061
8038
|
]
|
|
8062
8039
|
},
|
|
8063
|
-
(ui =
|
|
8040
|
+
(ui = f == null ? void 0 : f[h]) == null ? void 0 : ui.id
|
|
8064
8041
|
) }),
|
|
8065
8042
|
!d && /* @__PURE__ */ n.jsx("footer", { className: "flex items-center justify-end gap-4 footer flex-wrap", children: u === "multi" ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
8066
8043
|
/* @__PURE__ */ n.jsxs("div", { className: "flex gap-x-4 justify-between navigation_container w-full", children: [
|
|
8067
8044
|
/* @__PURE__ */ n.jsxs("div", { children: [
|
|
8068
8045
|
" ",
|
|
8069
8046
|
h > 0 && /* @__PURE__ */ n.jsx(
|
|
8070
|
-
|
|
8047
|
+
wi,
|
|
8071
8048
|
{
|
|
8072
8049
|
type: "button",
|
|
8073
8050
|
text: "Back",
|
|
@@ -8076,19 +8053,19 @@ const tl = ({
|
|
|
8076
8053
|
}
|
|
8077
8054
|
)
|
|
8078
8055
|
] }),
|
|
8079
|
-
h <
|
|
8080
|
-
|
|
8056
|
+
h < x - 1 && /* @__PURE__ */ n.jsx(
|
|
8057
|
+
wi,
|
|
8081
8058
|
{
|
|
8082
8059
|
type: "button",
|
|
8083
8060
|
text: "Next",
|
|
8084
|
-
onClick:
|
|
8061
|
+
onClick: w,
|
|
8085
8062
|
style: { background: (g == null ? void 0 : g.buttonColor) || "#333" },
|
|
8086
8063
|
btnClass: "text-gray-700 next_btn text-sm border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg continue_btn"
|
|
8087
8064
|
}
|
|
8088
8065
|
)
|
|
8089
8066
|
] }),
|
|
8090
|
-
(h ===
|
|
8091
|
-
|
|
8067
|
+
(h === x - 1 || l) && !o && (t != null ? t : /* @__PURE__ */ n.jsx(
|
|
8068
|
+
wi,
|
|
8092
8069
|
{
|
|
8093
8070
|
isDisabled: Z || Object.keys(z).length > 0,
|
|
8094
8071
|
isLoading: Z,
|
|
@@ -8099,7 +8076,7 @@ const tl = ({
|
|
|
8099
8076
|
}
|
|
8100
8077
|
))
|
|
8101
8078
|
] }) : !o && (t != null ? t : /* @__PURE__ */ n.jsx(
|
|
8102
|
-
|
|
8079
|
+
wi,
|
|
8103
8080
|
{
|
|
8104
8081
|
isDisabled: Z || Object.keys(z).length > 0,
|
|
8105
8082
|
isLoading: Z,
|
|
@@ -8132,12 +8109,12 @@ function Fe({
|
|
|
8132
8109
|
u && Ge("config", u);
|
|
8133
8110
|
}, [u]);
|
|
8134
8111
|
const h = $(
|
|
8135
|
-
(
|
|
8136
|
-
c && c(
|
|
8112
|
+
(b) => {
|
|
8113
|
+
c && c(b);
|
|
8137
8114
|
},
|
|
8138
8115
|
[c]
|
|
8139
8116
|
);
|
|
8140
|
-
return l ? /* @__PURE__ */ n.jsx(Ve, {}) : e ? /* @__PURE__ */ n.jsxs("div", {
|
|
8117
|
+
return l ? /* @__PURE__ */ n.jsx(Ve, {}) : e ? /* @__PURE__ */ n.jsxs("div", { className: "w-full h-full min-w-0", children: [
|
|
8141
8118
|
/* @__PURE__ */ n.jsx("div", { id: "root-portal" }),
|
|
8142
8119
|
/* @__PURE__ */ n.jsx(Se, { children: /* @__PURE__ */ n.jsx(
|
|
8143
8120
|
cl,
|