@arudovwen/form-builder-react 1.7.2 → 1.8.1

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.
@@ -1,8 +1,8 @@
1
- import { jsx as i, Fragment as re, jsxs as b } from "react/jsx-runtime";
2
- import ae, { createContext as xn, useState as D, useEffect as j, useRef as te, useMemo as X, forwardRef as Zi, createElement as bi, Fragment as ze, useContext as ye, useCallback as Y, memo as Ze, Suspense as An } from "react";
3
- import { v4 as me } from "uuid";
1
+ import { jsx as i, Fragment as ve, jsxs as b } from "react/jsx-runtime";
2
+ import se, { createContext as xn, useState as D, useEffect as G, useRef as re, useMemo as ee, forwardRef as Zi, createElement as bi, Fragment as ze, useContext as ye, useCallback as Y, memo as Ze, Suspense as An } from "react";
3
+ import { v4 as pe } from "uuid";
4
4
  import Sn from "react-datepicker";
5
- import { Listbox as ne, Transition as we, Combobox as De, ComboboxInput as Nn, ComboboxButton as Cn, ComboboxOptions as kn, ComboboxOption as Mn } from "@headlessui/react";
5
+ import { Listbox as ae, Transition as we, Combobox as De, ComboboxInput as Nn, ComboboxButton as kn, ComboboxOptions as Cn, ComboboxOption as Mn } from "@headlessui/react";
6
6
  import { toast as xe, Toaster as $i } from "sonner";
7
7
  import Pe from "axios";
8
8
  import $e from "react-currency-input-field";
@@ -13,10 +13,10 @@ import * as R from "yup";
13
13
  import Rn from "papaparse";
14
14
  import * as Li from "xlsx";
15
15
  import { Link as Dn } from "react-router-dom";
16
- const ce = xn(void 0), Pi = {
16
+ const be = xn(void 0), Pi = {
17
17
  title: "",
18
18
  description: "",
19
- id: me(),
19
+ id: pe(),
20
20
  questionData: [],
21
21
  disabled: !1,
22
22
  isHidden: !1
@@ -27,194 +27,194 @@ const ce = xn(void 0), Pi = {
27
27
  }) => {
28
28
  const [s, o] = D(!0), [l, d] = D({}), [u, t] = D({}), [m, c] = D([Pi]), [r, h] = D(() => {
29
29
  try {
30
- const G = sessionStorage.getItem("editor_past");
31
- return G ? JSON.parse(G) : [];
32
- } catch (G) {
30
+ const O = sessionStorage.getItem("editor_past");
31
+ return O ? JSON.parse(O) : [];
32
+ } catch (O) {
33
33
  return [];
34
34
  }
35
35
  }), [v, y] = D(() => {
36
36
  try {
37
- const G = sessionStorage.getItem("editor_future");
38
- return G ? JSON.parse(G) : [];
39
- } catch (G) {
37
+ const O = sessionStorage.getItem("editor_future");
38
+ return O ? JSON.parse(O) : [];
39
+ } catch (O) {
40
40
  return [];
41
41
  }
42
42
  });
43
- j(() => {
43
+ G(() => {
44
44
  n && n(m);
45
- }, [m, n]), j(() => {
45
+ }, [m, n]), G(() => {
46
46
  sessionStorage.setItem("editor_past", JSON.stringify(r));
47
- }, [r]), j(() => {
47
+ }, [r]), G(() => {
48
48
  sessionStorage.setItem("editor_future", JSON.stringify(v));
49
49
  }, [v]);
50
- const f = te(Date.now()), g = ae.useCallback((G) => {
50
+ const f = re(Date.now()), g = se.useCallback((O) => {
51
51
  c((B) => {
52
- const K = typeof G == "function" ? G(B) : G;
52
+ const K = typeof O == "function" ? O(B) : O;
53
53
  if (JSON.stringify(B) !== JSON.stringify(K)) {
54
54
  const P = Date.now();
55
55
  h((E) => E.length > 0 && JSON.stringify(E[E.length - 1]) === JSON.stringify(B) ? E : P - f.current < 800 && E.length > 0 ? (f.current = P, E) : (f.current = P, [...E, B])), y([]);
56
56
  }
57
57
  return K;
58
58
  });
59
- }, []), p = ae.useCallback(() => {
59
+ }, []), p = se.useCallback(() => {
60
60
  if (r.length === 0) return;
61
- const G = r[r.length - 1], B = r.slice(0, r.length - 1);
62
- h(B), y([m, ...v]), c(G), a == null || a("UNDO", null);
63
- }, [r, v, m, a]), N = ae.useCallback(() => {
61
+ const O = r[r.length - 1], B = r.slice(0, r.length - 1);
62
+ h(B), y([m, ...v]), c(O), a == null || a("UNDO", null);
63
+ }, [r, v, m, a]), N = se.useCallback(() => {
64
64
  if (v.length === 0) return;
65
- const G = v[0], B = v.slice(1);
66
- y(B), h([...r, m]), c(G), a == null || a("REDO", null);
67
- }, [r, v, m, a]), S = m, k = r.length > 0, x = v.length > 0, [C, M] = D(!1), [w, A] = D(null), [T, I] = D([
65
+ const O = v[0], B = v.slice(1);
66
+ y(B), h([...r, m]), c(O), a == null || a("REDO", null);
67
+ }, [r, v, m, a]), S = m, C = r.length > 0, x = v.length > 0, [k, M] = D(!1), [w, A] = D(null), [T, I] = D([
68
68
  0
69
- ]), [L, W] = D(""), [Z, ee] = D(0), $ = ae.useCallback(() => {
70
- }, []), be = ae.useCallback(() => {
71
- const G = me();
72
- g((B) => [...B, { ...Pi, id: G }]), A(G), I([S.length]), a == null || a("ADD_SECTION", { sectionId: G });
73
- }, [S, a, g]), _ = ae.useCallback(
74
- (G) => {
69
+ ]), [L, F] = D(""), [Z, ie] = D(0), X = se.useCallback(() => {
70
+ }, []), he = se.useCallback(() => {
71
+ const O = pe();
72
+ g((B) => [...B, { ...Pi, id: O }]), A(O), I([S.length]), a == null || a("ADD_SECTION", { sectionId: O });
73
+ }, [S, a, g]), _ = se.useCallback(
74
+ (O) => {
75
75
  g(
76
- (B) => B.filter((K) => K.id !== G)
77
- ), A(null), a == null || a("REMOVE_SECTION", { sectionId: G });
76
+ (B) => B.filter((K) => K.id !== O)
77
+ ), A(null), a == null || a("REMOVE_SECTION", { sectionId: O });
78
78
  },
79
79
  [a, g]
80
- ), V = ae.useCallback(
81
- (G, B) => {
80
+ ), V = se.useCallback(
81
+ (O, B) => {
82
82
  const K = S.find((E) => E.id === B), P = K == null ? void 0 : K.questionData.find(
83
- (E) => E.id === G
83
+ (E) => E.id === O
84
84
  );
85
85
  P && (g(
86
86
  (E) => E == null ? void 0 : E.map(
87
- (O) => O.id === B ? {
88
- ...O,
89
- questionData: O == null ? void 0 : O.questionData.filter((H) => P.type === "grid" ? H.gridId !== P.id && H.id !== P.id : H.id !== G)
90
- } : O
87
+ (q) => q.id === B ? {
88
+ ...q,
89
+ questionData: q == null ? void 0 : q.questionData.filter(($) => P.type === "grid" ? $.gridId !== P.id && $.id !== P.id : $.id !== O)
90
+ } : q
91
91
  )
92
- ), a == null || a("REMOVE_ELEMENT", { sectionId: B, elementId: G }));
92
+ ), a == null || a("REMOVE_ELEMENT", { sectionId: B, elementId: O }));
93
93
  },
94
94
  [S, g, a]
95
- ), de = ae.useCallback(
96
- (G, B) => {
97
- const K = S.find((H) => H.id === B);
95
+ ), ce = se.useCallback(
96
+ (O, B) => {
97
+ const K = S.find(($) => $.id === B);
98
98
  if (!K) return;
99
99
  const P = K == null ? void 0 : K.questionData.findIndex(
100
- (H) => H.id === G
100
+ ($) => $.id === O
101
101
  );
102
102
  if (P === -1) return;
103
- const E = K == null ? void 0 : K.questionData[P], O = (H, U = {}) => ({
104
- ...JSON.parse(JSON.stringify(H)),
105
- id: me(),
106
- ...U
103
+ const E = K == null ? void 0 : K.questionData[P], q = ($, j = {}) => ({
104
+ ...JSON.parse(JSON.stringify($)),
105
+ id: pe(),
106
+ ...j
107
107
  });
108
108
  g(
109
- (H) => H == null ? void 0 : H.map((U) => {
110
- var Q;
111
- if (U.id !== B) return U;
112
- const F = [...U.questionData];
109
+ ($) => $ == null ? void 0 : $.map((j) => {
110
+ var U;
111
+ if (j.id !== B) return j;
112
+ const H = [...j.questionData];
113
113
  if (E.type === "grid") {
114
- const pe = (Q = F == null ? void 0 : F.map((fe, ii) => ({ e: fe, i: ii })).filter(
114
+ const Q = (U = H == null ? void 0 : H.map((fe, ii) => ({ e: fe, i: ii })).filter(
115
115
  ({ e: fe }) => fe.id === E.id || fe.gridId === E.id
116
- )) == null ? void 0 : Q.map(({ i: fe }) => fe), he = pe.length ? Math.max(...pe) + 1 : P + 1, ue = me(), ge = O(E, {});
117
- ge.id = ue;
118
- const le = F.filter((fe) => fe.gridId === E.id), Ne = le == null ? void 0 : le.map(
119
- (fe) => O(fe, { gridId: ue })
116
+ )) == null ? void 0 : U.map(({ i: fe }) => fe), oe = Q.length ? Math.max(...Q) + 1 : P + 1, le = pe(), me = q(E, {});
117
+ me.id = le;
118
+ const te = H.filter((fe) => fe.gridId === E.id), Ne = te == null ? void 0 : te.map(
119
+ (fe) => q(fe, { gridId: le })
120
120
  ), Le = [
121
- ...F.slice(0, he),
122
- ge,
121
+ ...H.slice(0, oe),
122
+ me,
123
123
  ...Ne,
124
- ...F.slice(he)
124
+ ...H.slice(oe)
125
125
  ];
126
- return { ...U, questionData: Le };
126
+ return { ...j, questionData: Le };
127
127
  } else if (E.gridId) {
128
- const { gridId: pe, gridPosition: he, ...ue } = E, ge = O(ue, {}), le = F.reduce(
128
+ const { gridId: Q, gridPosition: oe, ...le } = E, me = q(le, {}), te = H.reduce(
129
129
  (Le, fe, ii) => fe.id === E.gridId || fe.gridId === E.gridId ? ii : Le,
130
130
  P
131
131
  ), Ne = [
132
- ...F.slice(0, le + 1),
133
- ge,
134
- ...F.slice(le + 1)
132
+ ...H.slice(0, te + 1),
133
+ me,
134
+ ...H.slice(te + 1)
135
135
  ];
136
- return { ...U, questionData: Ne };
136
+ return { ...j, questionData: Ne };
137
137
  } else {
138
- const pe = O(E, {}), he = [
139
- ...F.slice(0, P + 1),
140
- pe,
141
- ...F.slice(P + 1)
138
+ const Q = q(E, {}), oe = [
139
+ ...H.slice(0, P + 1),
140
+ Q,
141
+ ...H.slice(P + 1)
142
142
  ];
143
- return { ...U, questionData: he };
143
+ return { ...j, questionData: oe };
144
144
  }
145
145
  })
146
- ), a == null || a("DUPLICATE_ELEMENT", { sectionId: B, elementId: G });
146
+ ), a == null || a("DUPLICATE_ELEMENT", { sectionId: B, elementId: O });
147
147
  },
148
148
  [S, g, a]
149
- ), Ae = ae.useCallback(
150
- (G, B) => {
149
+ ), Ae = se.useCallback(
150
+ (O, B) => {
151
151
  g(
152
152
  (K) => K == null ? void 0 : K.map(
153
- (P) => P.id === B ? { ...P, questionData: G } : P
153
+ (P) => P.id === B ? { ...P, questionData: O } : P
154
154
  )
155
155
  ), a == null || a("UPDATE_ELEMENT_POSITION", { sectionId: B });
156
156
  },
157
157
  [g, a]
158
- ), ve = ae.useCallback(
159
- (G, B) => {
158
+ ), ge = se.useCallback(
159
+ (O, B) => {
160
160
  g(
161
161
  (K) => K == null ? void 0 : K.map(
162
162
  (P) => P.id === B ? {
163
163
  ...P,
164
- questionData: [...P == null ? void 0 : P.questionData, G]
164
+ questionData: [...P == null ? void 0 : P.questionData, O]
165
165
  } : P
166
166
  )
167
- ), a == null || a("ADD_ELEMENT", { sectionId: B, element: G });
167
+ ), a == null || a("ADD_ELEMENT", { sectionId: B, element: O });
168
168
  },
169
169
  [g, a]
170
- ), se = ae.useCallback(
171
- (G, B, K) => {
170
+ ), ue = se.useCallback(
171
+ (O, B, K) => {
172
172
  g(
173
173
  (P) => P == null ? void 0 : P.map(
174
174
  (E) => E.id === B ? {
175
175
  ...E,
176
176
  questionData: [
177
177
  ...E == null ? void 0 : E.questionData.slice(0, K),
178
- G,
178
+ O,
179
179
  ...E == null ? void 0 : E.questionData.slice(K)
180
180
  ]
181
181
  } : E
182
182
  )
183
- ), a == null || a("ADD_ELEMENT_IN_POSITION", { sectionId: B, element: G, index: K });
183
+ ), a == null || a("ADD_ELEMENT_IN_POSITION", { sectionId: B, element: O, index: K });
184
184
  },
185
185
  [g, a]
186
- ), Se = ae.useCallback(
187
- (G, B, K) => {
186
+ ), Se = se.useCallback(
187
+ (O, B, K) => {
188
188
  g(
189
189
  (P) => P == null ? void 0 : P.map(
190
190
  (E) => {
191
- var O;
191
+ var q;
192
192
  return E.id === K ? {
193
193
  ...E,
194
- questionData: (O = E == null ? void 0 : E.questionData) == null ? void 0 : O.map(
195
- (H) => {
196
- var U;
197
- return H.type === "grid" && H.gridData ? {
198
- ...H,
199
- gridData: (U = H.gridData) == null ? void 0 : U.map(
200
- (F, Q) => Q === G ? {
201
- ...F,
194
+ questionData: (q = E == null ? void 0 : E.questionData) == null ? void 0 : q.map(
195
+ ($) => {
196
+ var j;
197
+ return $.type === "grid" && $.gridData ? {
198
+ ...$,
199
+ gridData: (j = $.gridData) == null ? void 0 : j.map(
200
+ (H, U) => U === O ? {
201
+ ...H,
202
202
  ...B
203
- } : F
203
+ } : H
204
204
  ).concat(
205
- G >= H.gridData.length ? { ...B } : []
205
+ O >= $.gridData.length ? { ...B } : []
206
206
  )
207
- } : H;
207
+ } : $;
208
208
  }
209
209
  )
210
210
  } : E;
211
211
  }
212
212
  )
213
- ), a == null || a("UPDATE_GRID_ELEMENT", { sectionId: K, gridIndex: G, element: B });
213
+ ), a == null || a("UPDATE_GRID_ELEMENT", { sectionId: K, gridIndex: O, element: B });
214
214
  },
215
215
  [g, a]
216
- ), ke = ae.useCallback(
217
- (G, B) => {
216
+ ), Ce = se.useCallback(
217
+ (O, B) => {
218
218
  g(
219
219
  (K) => K == null ? void 0 : K.map(
220
220
  (P) => {
@@ -222,99 +222,99 @@ const ce = xn(void 0), Pi = {
222
222
  return P.id === B ? {
223
223
  ...P,
224
224
  questionData: (E = P == null ? void 0 : P.questionData) == null ? void 0 : E.map(
225
- (O) => O.id === G.id ? { ...O, ...G } : O
225
+ (q) => q.id === O.id ? { ...q, ...O } : q
226
226
  )
227
227
  } : P;
228
228
  }
229
229
  )
230
- ), a == null || a("UPDATE_ELEMENT", { sectionId: B, value: G });
230
+ ), a == null || a("UPDATE_ELEMENT", { sectionId: B, value: O });
231
231
  },
232
232
  [g, a]
233
- ), Be = ae.useCallback(
234
- (G) => {
233
+ ), Be = se.useCallback(
234
+ (O) => {
235
235
  const {
236
236
  draggedId: B,
237
237
  sectionId: K,
238
238
  targetIndex: P,
239
239
  targetId: E,
240
- targetGridId: O,
241
- targetCol: H
242
- } = G;
240
+ targetGridId: q,
241
+ targetCol: $
242
+ } = O;
243
243
  g(
244
- (U) => U.map((F) => {
245
- if (F.id !== K) return F;
246
- const Q = [...F == null ? void 0 : F.questionData], pe = Q.findIndex((ue) => ue.id === B);
247
- if (pe === -1) return F;
248
- const he = { ...Q[pe] };
249
- if (O !== void 0 && H !== void 0) {
250
- if (he.type === "grid") return F;
251
- const ue = Q.findIndex(
252
- (le) => {
244
+ (j) => j.map((H) => {
245
+ if (H.id !== K) return H;
246
+ const U = [...H == null ? void 0 : H.questionData], Q = U.findIndex((le) => le.id === B);
247
+ if (Q === -1) return H;
248
+ const oe = { ...U[Q] };
249
+ if (q !== void 0 && $ !== void 0) {
250
+ if (oe.type === "grid") return H;
251
+ const le = U.findIndex(
252
+ (te) => {
253
253
  var Ne;
254
- return le.id !== B && le.gridId === O && ((Ne = le.gridPosition) == null ? void 0 : Ne.col) === H;
254
+ return te.id !== B && te.gridId === q && ((Ne = te.gridPosition) == null ? void 0 : Ne.col) === $;
255
255
  }
256
256
  );
257
- let ge = Q.map(
258
- (le) => le.id === B ? {
259
- ...le,
260
- gridId: O,
261
- gridPosition: { col: H }
262
- } : le
257
+ let me = U.map(
258
+ (te) => te.id === B ? {
259
+ ...te,
260
+ gridId: q,
261
+ gridPosition: { col: $ }
262
+ } : te
263
263
  );
264
- return ue !== -1 && (ge = ge.map((le, Ne) => {
265
- if (Ne !== ue) return le;
266
- const Le = { ...le };
264
+ return le !== -1 && (me = me.map((te, Ne) => {
265
+ if (Ne !== le) return te;
266
+ const Le = { ...te };
267
267
  return delete Le.gridId, delete Le.gridPosition, Le;
268
- })), { ...F, questionData: ge };
268
+ })), { ...H, questionData: me };
269
269
  }
270
- if (he.gridId && P !== void 0 && O === void 0) {
271
- const ue = { ...he };
272
- delete ue.gridId, delete ue.gridPosition;
273
- const ge = Q.filter((Ne) => Ne.id !== B), le = Math.min(P, ge.length);
274
- return ge.splice(le, 0, ue), { ...F, questionData: ge };
270
+ if (oe.gridId && P !== void 0 && q === void 0) {
271
+ const le = { ...oe };
272
+ delete le.gridId, delete le.gridPosition;
273
+ const me = U.filter((Ne) => Ne.id !== B), te = Math.min(P, me.length);
274
+ return me.splice(te, 0, le), { ...H, questionData: me };
275
275
  }
276
- if (!he.gridId && P !== void 0 && O === void 0 && !E) {
277
- Q.splice(pe, 1);
278
- const ue = Math.min(P, Q.length);
279
- return Q.splice(ue, 0, he), { ...F, questionData: Q };
276
+ if (!oe.gridId && P !== void 0 && q === void 0 && !E) {
277
+ U.splice(Q, 1);
278
+ const le = Math.min(P, U.length);
279
+ return U.splice(le, 0, oe), { ...H, questionData: U };
280
280
  }
281
281
  if (E) {
282
- const ue = Q.findIndex((ge) => ge.id === E);
283
- return ue === -1 ? F : (Q.splice(pe, 1), Q.splice(ue, 0, he), { ...F, questionData: Q });
282
+ const le = U.findIndex((me) => me.id === E);
283
+ return le === -1 ? H : (U.splice(Q, 1), U.splice(le, 0, oe), { ...H, questionData: U });
284
284
  }
285
- return F;
285
+ return H;
286
286
  })
287
- ), a == null || a("MOVE_ELEMENT", G);
287
+ ), a == null || a("MOVE_ELEMENT", O);
288
288
  },
289
289
  [g, a]
290
- ), Me = ae.useCallback(
291
- (G, B) => {
290
+ ), Me = se.useCallback(
291
+ (O, B) => {
292
292
  g(
293
293
  (K) => K == null ? void 0 : K.map(
294
294
  (P) => P.id === B ? {
295
295
  ...P,
296
- ...G
296
+ ...O
297
297
  } : P
298
298
  )
299
- ), a == null || a("UPDATE_SECTION", { sectionId: B, value: G });
299
+ ), a == null || a("UPDATE_SECTION", { sectionId: B, value: O });
300
300
  },
301
301
  [g, a]
302
- ), Ee = X(
302
+ ), Ee = ee(
303
303
  () => ({
304
304
  formData: S,
305
305
  setFormData: g,
306
- handleDragStop: $,
306
+ handleDragStop: X,
307
307
  removeElement: V,
308
308
  elementData: u,
309
309
  setElementData: t,
310
310
  updateElementPosition: Ae,
311
- addElement: ve,
312
- addElementInPosition: se,
313
- updateElement: ke,
314
- addSection: be,
311
+ addElement: ge,
312
+ addElementInPosition: ue,
313
+ updateElement: Ce,
314
+ addSection: he,
315
315
  removeSection: _,
316
316
  updateSection: Me,
317
- isDragging: C,
317
+ isDragging: k,
318
318
  setIsDragging: M,
319
319
  selectedSection: w,
320
320
  setSelectedSection: A,
@@ -324,47 +324,47 @@ const ce = xn(void 0), Pi = {
324
324
  answerData: l,
325
325
  setAnswerData: d,
326
326
  uploadUrl: L,
327
- setUploadUrl: W,
327
+ setUploadUrl: F,
328
328
  apiActivityCount: Z,
329
- setApiActivityCount: ee,
330
- duplicateElement: de,
329
+ setApiActivityCount: ie,
330
+ duplicateElement: ce,
331
331
  moveElement: Be,
332
332
  showPreview: s,
333
333
  setShowPreview: o,
334
334
  undo: p,
335
335
  redo: N,
336
- canUndo: k,
336
+ canUndo: C,
337
337
  canRedo: x
338
338
  }),
339
339
  [
340
340
  S,
341
- $,
341
+ X,
342
342
  V,
343
343
  u,
344
344
  Ae,
345
- ve,
346
- se,
347
- ke,
348
- be,
345
+ ge,
346
+ ue,
347
+ Ce,
348
+ he,
349
349
  _,
350
350
  Me,
351
- C,
351
+ k,
352
352
  w,
353
353
  T,
354
354
  Se,
355
355
  l,
356
356
  L,
357
357
  Z,
358
- de,
358
+ ce,
359
359
  Be,
360
360
  s,
361
361
  p,
362
362
  N,
363
- k,
363
+ C,
364
364
  x
365
365
  ]
366
366
  );
367
- return /* @__PURE__ */ i(ce.Provider, { value: Ee, children: e });
367
+ return /* @__PURE__ */ i(be.Provider, { value: Ee, children: e });
368
368
  };
369
369
  function Xi(e) {
370
370
  var n, a, s = "";
@@ -375,12 +375,12 @@ function Xi(e) {
375
375
  } else for (a in e) e[a] && (s && (s += " "), s += a);
376
376
  return s;
377
377
  }
378
- function q() {
378
+ function J() {
379
379
  for (var e, n, a = 0, s = "", o = arguments.length; a < o; a++) (e = arguments[a]) && (n = Xi(e)) && (s && (s += " "), s += n);
380
380
  return s;
381
381
  }
382
382
  function In({ type: e = "calendar", className: n }) {
383
- return /* @__PURE__ */ i(re, { children: e === "calendar" ? /* @__PURE__ */ b(
383
+ return /* @__PURE__ */ i(ve, { children: e === "calendar" ? /* @__PURE__ */ b(
384
384
  "svg",
385
385
  {
386
386
  width: "20",
@@ -564,10 +564,10 @@ const vi = ({
564
564
  showYearDropdown: t
565
565
  }) => {
566
566
  const m = e ? new Date(e) : null, [c, r] = D(m);
567
- return j(() => {
567
+ return G(() => {
568
568
  const v = e ? new Date(e) : null;
569
569
  (v && c && v.getTime() !== c.getTime() || !v && c || v && !c) && r(v);
570
- }, [e]), j(() => {
570
+ }, [e]), G(() => {
571
571
  n && n(o, c);
572
572
  }, [c, n, o]), /* @__PURE__ */ i("div", { className: "builder_date__picker", children: /* @__PURE__ */ i(
573
573
  Sn,
@@ -602,7 +602,7 @@ function Kn({
602
602
  watch: o
603
603
  } = n || {};
604
604
  let l;
605
- return o && (l = o()[e.id]), j(() => {
605
+ return o && (l = o()[e.id]), G(() => {
606
606
  a(e.id);
607
607
  }, [e.id]), /* @__PURE__ */ i(
608
608
  vi,
@@ -629,7 +629,7 @@ function ai({
629
629
  {
630
630
  placeholder: (e == null ? void 0 : e.placeholder) || "",
631
631
  type: (e == null ? void 0 : e.inputType) || "text",
632
- className: q("field-control", e == null ? void 0 : e.customClass),
632
+ className: J("field-control", e == null ? void 0 : e.customClass),
633
633
  ...a(e == null ? void 0 : e.id),
634
634
  disabled: n == null ? void 0 : n.isReadOnly,
635
635
  inputMode: (e == null ? void 0 : e.inputMode) || void 0,
@@ -884,19 +884,19 @@ function $n(e, n) {
884
884
  const g = [], p = f.hFlip, N = f.vFlip;
885
885
  let S = f.rotate;
886
886
  p ? N ? S += 2 : (g.push("translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"), g.push("scale(-1 1)"), o.top = o.left = 0) : N && (g.push("translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"), g.push("scale(1 -1)"), o.top = o.left = 0);
887
- let k;
887
+ let C;
888
888
  switch (S < 0 && (S -= Math.floor(S / 4) * 4), S = S % 4, S) {
889
889
  case 1:
890
- k = o.height / 2 + o.top, g.unshift("rotate(90 " + k.toString() + " " + k.toString() + ")");
890
+ C = o.height / 2 + o.top, g.unshift("rotate(90 " + C.toString() + " " + C.toString() + ")");
891
891
  break;
892
892
  case 2:
893
893
  g.unshift("rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")");
894
894
  break;
895
895
  case 3:
896
- k = o.width / 2 + o.left, g.unshift("rotate(-90 " + k.toString() + " " + k.toString() + ")");
896
+ C = o.width / 2 + o.left, g.unshift("rotate(-90 " + C.toString() + " " + C.toString() + ")");
897
897
  break;
898
898
  }
899
- S % 2 === 1 && (o.left !== o.top && (k = o.left, o.left = o.top, o.top = k), o.width !== o.height && (k = o.width, o.width = o.height, o.height = k)), g.length && (l = Yn(l, '<g transform="' + g.join(" ") + '">', "</g>"));
899
+ S % 2 === 1 && (o.left !== o.top && (C = o.left, o.left = o.top, o.top = C), o.width !== o.height && (C = o.width, o.width = o.height, o.height = C)), g.length && (l = Yn(l, '<g transform="' + g.join(" ") + '">', "</g>"));
900
900
  });
901
901
  const d = s.width, u = s.height, t = o.width, m = o.height;
902
902
  let c, r;
@@ -952,15 +952,15 @@ function Ni(e) {
952
952
  dataAfterTimeout: e.dataAfterTimeout !== !1
953
953
  };
954
954
  }
955
- const Ci = /* @__PURE__ */ Object.create(null), je = ["https://api.simplesvg.com", "https://api.unisvg.com"], qe = [];
955
+ const ki = /* @__PURE__ */ Object.create(null), je = ["https://api.simplesvg.com", "https://api.unisvg.com"], qe = [];
956
956
  for (; je.length > 0; ) je.length === 1 || Math.random() > 0.5 ? qe.push(je.shift()) : qe.push(je.pop());
957
- Ci[""] = Ni({ resources: ["https://api.iconify.design"].concat(qe) });
957
+ ki[""] = Ni({ resources: ["https://api.iconify.design"].concat(qe) });
958
958
  function aa(e, n) {
959
959
  const a = Ni(n);
960
- return a === null ? !1 : (Ci[e] = a, !0);
960
+ return a === null ? !1 : (ki[e] = a, !0);
961
961
  }
962
- function ki(e) {
963
- return Ci[e];
962
+ function Ci(e) {
963
+ return ki[e];
964
964
  }
965
965
  const oa = () => {
966
966
  let e;
@@ -971,7 +971,7 @@ const oa = () => {
971
971
  };
972
972
  let Oi = oa();
973
973
  function sa(e, n) {
974
- const a = ki(e);
974
+ const a = Ci(e);
975
975
  if (!a) return 0;
976
976
  let s;
977
977
  if (!a.maxURL) s = 0;
@@ -1007,7 +1007,7 @@ const da = (e, n, a) => {
1007
1007
  };
1008
1008
  function ua(e) {
1009
1009
  if (typeof e == "string") {
1010
- const n = ki(e);
1010
+ const n = Ci(e);
1011
1011
  if (n) return n.path;
1012
1012
  }
1013
1013
  return "/";
@@ -1154,12 +1154,12 @@ function ga(e, n, a, s) {
1154
1154
  const o = e.resources.length, l = e.random ? Math.floor(Math.random() * o) : e.index;
1155
1155
  let d;
1156
1156
  if (e.random) {
1157
- let C = e.resources.slice(0);
1158
- for (d = []; C.length > 1; ) {
1159
- const M = Math.floor(Math.random() * C.length);
1160
- d.push(C[M]), C = C.slice(0, M).concat(C.slice(M + 1));
1157
+ let k = e.resources.slice(0);
1158
+ for (d = []; k.length > 1; ) {
1159
+ const M = Math.floor(Math.random() * k.length);
1160
+ d.push(k[M]), k = k.slice(0, M).concat(k.slice(M + 1));
1161
1161
  }
1162
- d = d.concat(C);
1162
+ d = d.concat(k);
1163
1163
  } else d = e.resources.slice(l).concat(e.resources.slice(0, l));
1164
1164
  const u = Date.now();
1165
1165
  let t = "pending", m = 0, c, r = null, h = [], v = [];
@@ -1168,12 +1168,12 @@ function ga(e, n, a, s) {
1168
1168
  r && (clearTimeout(r), r = null);
1169
1169
  }
1170
1170
  function f() {
1171
- t === "pending" && (t = "aborted"), y(), h.forEach((C) => {
1172
- C.status === "pending" && (C.status = "aborted");
1171
+ t === "pending" && (t = "aborted"), y(), h.forEach((k) => {
1172
+ k.status === "pending" && (k.status = "aborted");
1173
1173
  }), h = [];
1174
1174
  }
1175
- function g(C, M) {
1176
- M && (v = []), typeof C == "function" && v.push(C);
1175
+ function g(k, M) {
1176
+ M && (v = []), typeof k == "function" && v.push(k);
1177
1177
  }
1178
1178
  function p() {
1179
1179
  return {
@@ -1187,18 +1187,18 @@ function ga(e, n, a, s) {
1187
1187
  };
1188
1188
  }
1189
1189
  function N() {
1190
- t = "failed", v.forEach((C) => {
1191
- C(void 0, c);
1190
+ t = "failed", v.forEach((k) => {
1191
+ k(void 0, c);
1192
1192
  });
1193
1193
  }
1194
1194
  function S() {
1195
- h.forEach((C) => {
1196
- C.status === "pending" && (C.status = "aborted");
1195
+ h.forEach((k) => {
1196
+ k.status === "pending" && (k.status = "aborted");
1197
1197
  }), h = [];
1198
1198
  }
1199
- function k(C, M, w) {
1199
+ function C(k, M, w) {
1200
1200
  const A = M !== "success";
1201
- switch (h = h.filter((T) => T !== C), t) {
1201
+ switch (h = h.filter((T) => T !== k), t) {
1202
1202
  case "pending":
1203
1203
  break;
1204
1204
  case "failed":
@@ -1216,7 +1216,7 @@ function ga(e, n, a, s) {
1216
1216
  return;
1217
1217
  }
1218
1218
  if (y(), S(), !e.random) {
1219
- const T = e.resources.indexOf(C.resource);
1219
+ const T = e.resources.indexOf(k.resource);
1220
1220
  T !== -1 && T !== e.index && (e.index = T);
1221
1221
  }
1222
1222
  t = "completed", v.forEach((T) => {
@@ -1226,8 +1226,8 @@ function ga(e, n, a, s) {
1226
1226
  function x() {
1227
1227
  if (t !== "pending") return;
1228
1228
  y();
1229
- const C = d.shift();
1230
- if (C === void 0) {
1229
+ const k = d.shift();
1230
+ if (k === void 0) {
1231
1231
  if (h.length) {
1232
1232
  r = setTimeout(() => {
1233
1233
  y(), t === "pending" && (S(), N());
@@ -1239,12 +1239,12 @@ function ga(e, n, a, s) {
1239
1239
  }
1240
1240
  const M = {
1241
1241
  status: "pending",
1242
- resource: C,
1242
+ resource: k,
1243
1243
  callback: (w, A) => {
1244
- k(M, w, A);
1244
+ C(M, w, A);
1245
1245
  }
1246
1246
  };
1247
- h.push(M), m++, r = setTimeout(x, e.rotate), a(C, n, M.callback);
1247
+ h.push(M), m++, r = setTimeout(x, e.rotate), a(k, n, M.callback);
1248
1248
  }
1249
1249
  return setTimeout(x), p;
1250
1250
  }
@@ -1281,7 +1281,7 @@ function Gi() {
1281
1281
  const si = /* @__PURE__ */ Object.create(null);
1282
1282
  function fa(e) {
1283
1283
  if (!si[e]) {
1284
- const n = ki(e);
1284
+ const n = Ci(e);
1285
1285
  if (!n) return;
1286
1286
  const a = cn(n), s = {
1287
1287
  config: n,
@@ -1415,7 +1415,7 @@ const Na = (e, n) => {
1415
1415
  m.length && Sa(t, m);
1416
1416
  }), n ? ba(n, s, l) : ji;
1417
1417
  };
1418
- function Ca(e, n) {
1418
+ function ka(e, n) {
1419
1419
  const a = { ...e };
1420
1420
  for (const s in n) {
1421
1421
  const o = n[s], l = typeof o;
@@ -1423,9 +1423,9 @@ function Ca(e, n) {
1423
1423
  }
1424
1424
  return a;
1425
1425
  }
1426
- const ka = /[\s,]+/;
1426
+ const Ca = /[\s,]+/;
1427
1427
  function Ma(e, n) {
1428
- n.split(ka).forEach((a) => {
1428
+ n.split(Ca).forEach((a) => {
1429
1429
  switch (a.trim()) {
1430
1430
  case "horizontal":
1431
1431
  e.hFlip = !0;
@@ -1522,7 +1522,7 @@ function Ui(e) {
1522
1522
  return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
1523
1523
  }
1524
1524
  const Oa = (e, n, a) => {
1525
- const s = n.inline ? Ka : rn, o = Ca(s, n), l = n.mode || "svg", d = {}, u = n.style || {}, t = {
1525
+ const s = n.inline ? Ka : rn, o = ka(s, n), l = n.mode || "svg", d = {}, u = n.style || {}, t = {
1526
1526
  ...l === "svg" ? Da : {}
1527
1527
  };
1528
1528
  if (a) {
@@ -1697,7 +1697,7 @@ function bn(e) {
1697
1697
  });
1698
1698
  } else f && ((v = e.onLoad) === null || v === void 0 || v.call(e, y));
1699
1699
  }
1700
- j(() => (a(!0), t), []), j(() => {
1700
+ G(() => (a(!0), t), []), G(() => {
1701
1701
  n && c();
1702
1702
  }, [e.icon, n]);
1703
1703
  const { name: r, data: h } = d;
@@ -1715,11 +1715,11 @@ Zi((e, n) => bn({
1715
1715
  ...e,
1716
1716
  _ref: n
1717
1717
  }));
1718
- function J({
1718
+ function z({
1719
1719
  icon: e,
1720
1720
  iconClass: n
1721
1721
  }) {
1722
- return /* @__PURE__ */ i(re, { children: /* @__PURE__ */ i(vn, { icon: e, className: n }) });
1722
+ return /* @__PURE__ */ i(ve, { children: /* @__PURE__ */ i(vn, { icon: e, className: n }) });
1723
1723
  }
1724
1724
  function Mi({
1725
1725
  element: e,
@@ -1736,13 +1736,13 @@ function Mi({
1736
1736
  } = n || {}, [t, m] = D(() => {
1737
1737
  const h = u == null ? void 0 : u(e.id);
1738
1738
  return Array.isArray(h) ? h : [];
1739
- }), c = X(
1739
+ }), c = ee(
1740
1740
  () => t == null ? void 0 : t.map((h) => h.label).join(", "),
1741
1741
  [t]
1742
1742
  );
1743
- return j(() => {
1743
+ return G(() => {
1744
1744
  s(e.id);
1745
- }, [e.id, s]), j(() => {
1745
+ }, [e.id, s]), G(() => {
1746
1746
  if (!d) return;
1747
1747
  const h = d((v) => {
1748
1748
  const y = v[e.id];
@@ -1753,7 +1753,7 @@ function Mi({
1753
1753
  return (v = h.unsubscribe) == null ? void 0 : v.call(h);
1754
1754
  };
1755
1755
  }, [d, e.id]), /* @__PURE__ */ i("div", { className: "custom-select", children: /* @__PURE__ */ i(
1756
- ne,
1756
+ ae,
1757
1757
  {
1758
1758
  value: t || [],
1759
1759
  onChange: (h) => {
@@ -1764,24 +1764,24 @@ function Mi({
1764
1764
  by: "value",
1765
1765
  children: /* @__PURE__ */ b("div", { className: "custom-select__wrapper", children: [
1766
1766
  /* @__PURE__ */ b(
1767
- ne.Button,
1767
+ ae.Button,
1768
1768
  {
1769
1769
  className: "custom-select__control field-control",
1770
1770
  disabled: l,
1771
1771
  children: [
1772
1772
  /* @__PURE__ */ i("span", { className: "custom-select__value", children: (t == null ? void 0 : t.length) > 0 ? c : /* @__PURE__ */ i("span", { className: "custom-select__placeholder", children: a != null ? a : " Select options" }) }),
1773
- /* @__PURE__ */ i("span", { className: "custom-select__icon", children: /* @__PURE__ */ i(J, { icon: "lucide:chevron-down" }) })
1773
+ /* @__PURE__ */ i("span", { className: "custom-select__icon", children: /* @__PURE__ */ i(z, { icon: "lucide:chevron-down" }) })
1774
1774
  ]
1775
1775
  }
1776
1776
  ),
1777
1777
  /* @__PURE__ */ i(we, { as: ze, leave: "custom-select__transition", children: /* @__PURE__ */ i(
1778
- ne.Options,
1778
+ ae.Options,
1779
1779
  {
1780
1780
  anchor: "bottom start",
1781
1781
  className: "custom-select__options",
1782
1782
  children: (r = e == null ? void 0 : e.options) == null ? void 0 : r.map(
1783
1783
  (h, v) => /* @__PURE__ */ i(
1784
- ne.Option,
1784
+ ae.Option,
1785
1785
  {
1786
1786
  value: h,
1787
1787
  className: ({ active: y }) => `custom-select__option ${y ? "custom-select__option--active" : ""}`,
@@ -1830,9 +1830,9 @@ function pn({
1830
1830
  removeFile: a
1831
1831
  }) {
1832
1832
  const [s, o] = D(!1), [l, d] = D("unknown"), [u, t] = D(null);
1833
- j(() => {
1833
+ G(() => {
1834
1834
  e && d(ja(e));
1835
- }, [e]), j(() => {
1835
+ }, [e]), G(() => {
1836
1836
  if (l === "pdf" && (e != null && e.startsWith("data:")))
1837
1837
  try {
1838
1838
  const v = atob(e.split(",")[1]), y = new ArrayBuffer(v.length), f = new Uint8Array(y);
@@ -1867,8 +1867,8 @@ function pn({
1867
1867
  className: "!flex items-center rounded cursor-pointer gap-x-3",
1868
1868
  title: `Click to preview ${r}`,
1869
1869
  children: [
1870
- l === "image" && /* @__PURE__ */ i("div", { className: "flex items-center justify-center ", children: /* @__PURE__ */ i(J, { iconClass: "text-4xl", icon: "fluent-color:image-48" }) }),
1871
- l !== "image" && /* @__PURE__ */ i(J, { icon: Ha[l], iconClass: "text-4xl" }),
1870
+ l === "image" && /* @__PURE__ */ i("div", { className: "flex items-center justify-center ", children: /* @__PURE__ */ i(z, { iconClass: "text-4xl", icon: "fluent-color:image-48" }) }),
1871
+ l !== "image" && /* @__PURE__ */ i(z, { icon: Ha[l], iconClass: "text-4xl" }),
1872
1872
  /* @__PURE__ */ i("span", { className: "text-sm font-semibold text-center text-gray-700 truncate max-w-[300px]", children: r })
1873
1873
  ]
1874
1874
  }
@@ -1881,7 +1881,7 @@ function pn({
1881
1881
  className: "p-2",
1882
1882
  onClick: () => h(u || e, n),
1883
1883
  title: `Download ${r}`,
1884
- children: /* @__PURE__ */ i(J, { icon: "streamline-flex:download-tray-solid" })
1884
+ children: /* @__PURE__ */ i(z, { icon: "streamline-flex:download-tray-solid" })
1885
1885
  }
1886
1886
  ),
1887
1887
  a && /* @__PURE__ */ i(
@@ -1890,7 +1890,7 @@ function pn({
1890
1890
  type: "button",
1891
1891
  className: "p-2 text-lg text-red-500",
1892
1892
  onClick: a,
1893
- children: /* @__PURE__ */ i(J, { icon: "lets-icons:trash-duotone" })
1893
+ children: /* @__PURE__ */ i(z, { icon: "lets-icons:trash-duotone" })
1894
1894
  }
1895
1895
  )
1896
1896
  ] }),
@@ -1937,7 +1937,7 @@ function pn({
1937
1937
  )
1938
1938
  ] });
1939
1939
  }
1940
- const oe = (e) => {
1940
+ const de = (e) => {
1941
1941
  const n = typeof window != "undefined" ? localStorage.getItem(e) : "";
1942
1942
  try {
1943
1943
  return JSON.parse(n);
@@ -1956,20 +1956,20 @@ function Va({
1956
1956
  list: o = null,
1957
1957
  accept: l = []
1958
1958
  }) {
1959
- const { uploadUrl: d, setApiActivityCount: u } = ye(ce), t = te(null), [m, c] = D(o), [r, h] = D(!1);
1960
- j(() => {
1959
+ const { uploadUrl: d, setApiActivityCount: u } = ye(be), t = re(null), [m, c] = D(o), [r, h] = D(!1);
1960
+ G(() => {
1961
1961
  c(o);
1962
1962
  }, [o]);
1963
- const v = X(
1963
+ const v = ee(
1964
1964
  () => l == null ? void 0 : l.map((x) => x.value).join(", "),
1965
1965
  [l]
1966
- ), y = X(
1966
+ ), y = ee(
1967
1967
  () => l == null ? void 0 : l.map((x) => x.label).join(", "),
1968
1968
  [l]
1969
1969
  ), f = Y(
1970
1970
  async (x) => {
1971
1971
  var w, A;
1972
- const C = oe("token"), M = ((w = oe("orgData")) == null ? void 0 : w.id) || oe("organizationId");
1972
+ const k = de("token"), M = ((w = de("orgData")) == null ? void 0 : w.id) || de("organizationId");
1973
1973
  try {
1974
1974
  const { data: T } = await Pe.post(
1975
1975
  d,
@@ -1980,7 +1980,7 @@ function Va({
1980
1980
  },
1981
1981
  {
1982
1982
  headers: {
1983
- Authorization: `Bearer ${C}`
1983
+ Authorization: `Bearer ${k}`
1984
1984
  }
1985
1985
  }
1986
1986
  );
@@ -1991,7 +1991,7 @@ function Va({
1991
1991
  },
1992
1992
  [d]
1993
1993
  ), g = Y(
1994
- (x) => new Promise((C, M) => {
1994
+ (x) => new Promise((k, M) => {
1995
1995
  const w = new FileReader();
1996
1996
  w.onloadend = async () => {
1997
1997
  try {
@@ -2003,7 +2003,7 @@ function Va({
2003
2003
  ext: `.${x.name.split(".").pop()}`,
2004
2004
  fileName: x.name
2005
2005
  }) : w.result;
2006
- C({
2006
+ k({
2007
2007
  base64: T,
2008
2008
  type: x.type,
2009
2009
  name: x.name
@@ -2017,13 +2017,13 @@ function Va({
2017
2017
  ), p = Y(
2018
2018
  (x) => {
2019
2019
  var M;
2020
- const C = v ? (M = v.split(",")) == null ? void 0 : M.map((w) => w.trim()) : [];
2020
+ const k = v ? (M = v.split(",")) == null ? void 0 : M.map((w) => w.trim()) : [];
2021
2021
  for (const w of x) {
2022
2022
  if (w.size > Fa)
2023
2023
  return xe.error(
2024
2024
  `File "${w.name}" exceeds 5MB limit (${(w.size / 1024 / 1024).toFixed(2)}MB)`
2025
2025
  ), !1;
2026
- if (C.length && !C.some(
2026
+ if (k.length && !k.some(
2027
2027
  (A) => w.type === A || w.name.toLowerCase().endsWith(A.replace("*", ""))
2028
2028
  ))
2029
2029
  return xe.error(
@@ -2035,16 +2035,16 @@ function Va({
2035
2035
  [v, y]
2036
2036
  ), N = Y(
2037
2037
  async (x) => {
2038
- const C = Array.from(x.target.files || []);
2039
- if (!(!C.length || r)) {
2040
- if (!p(C)) {
2038
+ const k = Array.from(x.target.files || []);
2039
+ if (!(!k.length || r)) {
2040
+ if (!p(k)) {
2041
2041
  t.current && (t.current.value = "");
2042
2042
  return;
2043
2043
  }
2044
2044
  try {
2045
2045
  h(!0), u == null || u((A) => A + 1);
2046
- const M = await Promise.all(C == null ? void 0 : C.map(g)), w = s && m ? [...m, ...M] : M;
2047
- c(w), e(w), xe.success(`Successfully uploaded ${C.length} file(s)`);
2046
+ const M = await Promise.all(k == null ? void 0 : k.map(g)), w = s && m ? [...m, ...M] : M;
2047
+ c(w), e(w), xe.success(`Successfully uploaded ${k.length} file(s)`);
2048
2048
  } catch (M) {
2049
2049
  console.error("Upload error:", M), xe.error("Failed to upload file(s). Please try again.");
2050
2050
  } finally {
@@ -2055,13 +2055,13 @@ function Va({
2055
2055
  [r, p, g, e, s, m, u]
2056
2056
  ), S = Y(
2057
2057
  (x) => {
2058
- r || (t.current && (t.current.value = ""), c((C) => {
2059
- const M = x === void 0 ? null : (C == null ? void 0 : C.filter((w, A) => A !== x)) || null;
2058
+ r || (t.current && (t.current.value = ""), c((k) => {
2059
+ const M = x === void 0 ? null : (k == null ? void 0 : k.filter((w, A) => A !== x)) || null;
2060
2060
  return e(M), M;
2061
2061
  }), a == null || a());
2062
2062
  },
2063
2063
  [a, e, r]
2064
- ), k = m && m.length > 0;
2064
+ ), C = m && m.length > 0;
2065
2065
  return /* @__PURE__ */ b("div", { className: "flex flex-col items-start gap-2", children: [
2066
2066
  !n && /* @__PURE__ */ b("div", { className: "!flex field-control !py-0 !px-0 relative", children: [
2067
2067
  /* @__PURE__ */ i(
@@ -2080,7 +2080,7 @@ function Va({
2080
2080
  hover:file:bg-blue-100 disabled:opacity-50 disabled:cursor-not-allowed`
2081
2081
  }
2082
2082
  ),
2083
- k && /* @__PURE__ */ i(
2083
+ C && /* @__PURE__ */ i(
2084
2084
  "button",
2085
2085
  {
2086
2086
  type: "button",
@@ -2088,23 +2088,23 @@ function Va({
2088
2088
  onClick: () => S(),
2089
2089
  disabled: r,
2090
2090
  "aria-label": "Remove all files",
2091
- children: /* @__PURE__ */ i(J, { icon: "lets-icons:trash-duotone" })
2091
+ children: /* @__PURE__ */ i(z, { icon: "lets-icons:trash-duotone" })
2092
2092
  }
2093
2093
  )
2094
2094
  ] }),
2095
- k && /* @__PURE__ */ b("div", { className: "relative grid gap-y-1 flex-1 w-full", children: [
2095
+ C && /* @__PURE__ */ b("div", { className: "relative grid gap-y-1 flex-1 w-full", children: [
2096
2096
  r && /* @__PURE__ */ i("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-white/60 rounded", children: /* @__PURE__ */ b("div", { className: "flex items-center gap-2 text-sm text-blue-600 font-medium", children: [
2097
2097
  /* @__PURE__ */ i("span", { className: "animate-spin h-4 w-4 border-2 border-blue-500 border-t-transparent rounded-full" }),
2098
2098
  "Uploading..."
2099
2099
  ] }) }),
2100
- typeof m == "object" && (m == null ? void 0 : m.map((x, C) => /* @__PURE__ */ i(
2100
+ typeof m == "object" && (m == null ? void 0 : m.map((x, k) => /* @__PURE__ */ i(
2101
2101
  pn,
2102
2102
  {
2103
2103
  fileUrl: x.base64,
2104
2104
  fileName: x.name,
2105
- removeFile: () => S(C)
2105
+ removeFile: () => S(k)
2106
2106
  },
2107
- `${x.name}-${C}`
2107
+ `${x.name}-${k}`
2108
2108
  )))
2109
2109
  ] })
2110
2110
  ] });
@@ -2117,9 +2117,9 @@ function Ua({ element: e, validationData: n }) {
2117
2117
  isReadOnly: d,
2118
2118
  watch: u
2119
2119
  } = n || {};
2120
- j(() => {
2120
+ G(() => {
2121
2121
  o(e.id);
2122
- }, [e.id, o]), j(() => {
2122
+ }, [e.id, o]), G(() => {
2123
2123
  if (u) {
2124
2124
  const r = u((h) => {
2125
2125
  s(h[e.id]);
@@ -2150,7 +2150,7 @@ function Ua({ element: e, validationData: n }) {
2150
2150
  accept: e == null ? void 0 : e.acceptedFiles
2151
2151
  }
2152
2152
  ),
2153
- d && /* @__PURE__ */ i(re, { children: a ? /* @__PURE__ */ i("div", { className: "relative grid gap-y-1 flex-1 w-full", children: typeof a == "object" && Array.isArray(a) && a.map(
2153
+ d && /* @__PURE__ */ i(ve, { children: a ? /* @__PURE__ */ i("div", { className: "relative grid gap-y-1 flex-1 w-full", children: typeof a == "object" && Array.isArray(a) && a.map(
2154
2154
  (r, h) => /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
2155
2155
  pn,
2156
2156
  {
@@ -2171,13 +2171,13 @@ function Wa({
2171
2171
  {
2172
2172
  placeholder: e.placeholder,
2173
2173
  type: e.inputType,
2174
- className: q("field-control", e == null ? void 0 : e.customClass),
2174
+ className: J("field-control", e == null ? void 0 : e.customClass),
2175
2175
  ...a(e.id),
2176
2176
  disabled: n == null ? void 0 : n.isReadOnly
2177
2177
  }
2178
2178
  );
2179
2179
  }
2180
- const z = ({
2180
+ const W = ({
2181
2181
  label: e,
2182
2182
  name: n,
2183
2183
  register: a,
@@ -2197,7 +2197,7 @@ const z = ({
2197
2197
  description: g,
2198
2198
  onChange: p
2199
2199
  }) => {
2200
- var S, k, x, C;
2200
+ var S, C, x, k;
2201
2201
  const N = a ? { ...a(n) } : {};
2202
2202
  if (l === "amount")
2203
2203
  return /* @__PURE__ */ b("div", { className: "space-y-1.5 relative", children: [
@@ -2256,7 +2256,7 @@ const z = ({
2256
2256
  peer-disabled:cursor-not-allowed
2257
2257
  `,
2258
2258
  children: w && /* @__PURE__ */ i(
2259
- J,
2259
+ z,
2260
2260
  {
2261
2261
  icon: "meteor-icons:check",
2262
2262
  iconClass: "w-3.5 h-3.5 text-white"
@@ -2271,7 +2271,7 @@ const z = ({
2271
2271
  ]
2272
2272
  }
2273
2273
  ),
2274
- (s == null ? void 0 : s[n]) && /* @__PURE__ */ i("p", { className: "ml-8 text-sm text-red-600", children: (k = s[n]) == null ? void 0 : k.message })
2274
+ (s == null ? void 0 : s[n]) && /* @__PURE__ */ i("p", { className: "ml-8 text-sm text-red-600", children: (C = s[n]) == null ? void 0 : C.message })
2275
2275
  ] });
2276
2276
  }
2277
2277
  return l === "textarea" ? /* @__PURE__ */ b("div", { className: "space-y-1.5 relative", children: [
@@ -2320,7 +2320,7 @@ const z = ({
2320
2320
  max: f
2321
2321
  }
2322
2322
  ),
2323
- (s == null ? void 0 : s[n]) && /* @__PURE__ */ i("p", { className: "mt-1 text-sm text-red-600", children: (C = s[n]) == null ? void 0 : C.message })
2323
+ (s == null ? void 0 : s[n]) && /* @__PURE__ */ i("p", { className: "mt-1 text-sm text-red-600", children: (k = s[n]) == null ? void 0 : k.message })
2324
2324
  ] });
2325
2325
  };
2326
2326
  function za({
@@ -2329,9 +2329,9 @@ function za({
2329
2329
  }) {
2330
2330
  var o;
2331
2331
  const { register: a = () => ({}), watch: s } = n || {};
2332
- return /* @__PURE__ */ i("div", { className: q("grid gap-y-[6px]", e.customClass), children: (o = e == null ? void 0 : e.options) == null ? void 0 : o.map(
2332
+ return /* @__PURE__ */ i("div", { className: J("grid gap-y-[6px]", e.customClass), children: (o = e == null ? void 0 : e.options) == null ? void 0 : o.map(
2333
2333
  (l) => /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
2334
- z,
2334
+ W,
2335
2335
  {
2336
2336
  placeholder: e.placeholder,
2337
2337
  type: e.inputType,
@@ -2357,9 +2357,9 @@ function qa({
2357
2357
  }) {
2358
2358
  var o;
2359
2359
  const { register: a = () => ({}), watch: s } = n || {};
2360
- return /* @__PURE__ */ i("div", { className: q("grid gap-y-[6px]", e.customClass), children: (o = e == null ? void 0 : e.options) == null ? void 0 : o.map(
2360
+ return /* @__PURE__ */ i("div", { className: J("grid gap-y-[6px]", e.customClass), children: (o = e == null ? void 0 : e.options) == null ? void 0 : o.map(
2361
2361
  (l) => /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
2362
- z,
2362
+ W,
2363
2363
  {
2364
2364
  placeholder: e.placeholder,
2365
2365
  type: e.inputType,
@@ -2390,39 +2390,39 @@ const Ie = ({
2390
2390
  loading: v,
2391
2391
  disabled: y
2392
2392
  }) => {
2393
- const [f, g] = D(m ? [] : null), p = te(!1), N = X(() => !u || !e || e.length === 0 ? m ? [] : null : m ? Array.isArray(u) ? e.filter((x) => u.some(
2394
- (C) => {
2393
+ const [f, g] = D(m ? [] : null), p = re(!1), N = ee(() => !u || !e || e.length === 0 ? m ? [] : null : m ? Array.isArray(u) ? e.filter((x) => u.some(
2394
+ (k) => {
2395
2395
  var M;
2396
- return typeof x.value == "object" ? ((M = x.value) == null ? void 0 : M.id) === (C == null ? void 0 : C.id) : x.value === C;
2396
+ return typeof x.value == "object" ? ((M = x.value) == null ? void 0 : M.id) === (k == null ? void 0 : k.id) : x.value === k;
2397
2397
  }
2398
2398
  )) : [] : e.find((x) => {
2399
- var C;
2400
- return typeof x.value == "string" && typeof u == "string" ? x.value.toLowerCase() === u.toLowerCase() : typeof x.value == "object" && typeof u == "object" ? ((C = x.value) == null ? void 0 : C.id) === (u == null ? void 0 : u.id) : x.value === u;
2399
+ var k;
2400
+ return typeof x.value == "string" && typeof u == "string" ? x.value.toLowerCase() === u.toLowerCase() : typeof x.value == "object" && typeof u == "object" ? ((k = x.value) == null ? void 0 : k.id) === (u == null ? void 0 : u.id) : x.value === u;
2401
2401
  }) || null, [u, e, m]);
2402
- j(() => {
2402
+ G(() => {
2403
2403
  if (p.current) {
2404
2404
  p.current = !1;
2405
2405
  return;
2406
2406
  }
2407
2407
  if (m && Array.isArray(N) && Array.isArray(f)) {
2408
- const x = f == null ? void 0 : f.map((M) => M.value), C = N == null ? void 0 : N.map((M) => M.value);
2409
- JSON.stringify(x) !== JSON.stringify(C) && g(N);
2408
+ const x = f == null ? void 0 : f.map((M) => M.value), k = N == null ? void 0 : N.map((M) => M.value);
2409
+ JSON.stringify(x) !== JSON.stringify(k) && g(N);
2410
2410
  } else (N == null ? void 0 : N.value) !== (f == null ? void 0 : f.value) && g(N);
2411
2411
  }, [N, m]);
2412
2412
  const S = Y((x) => {
2413
- var C;
2413
+ var k;
2414
2414
  if (p.current = !0, g(x), o) {
2415
- const M = m ? Array.isArray(x) ? x == null ? void 0 : x.map((w) => w.value) : [] : (C = x == null ? void 0 : x.value) != null ? C : null;
2415
+ const M = m ? Array.isArray(x) ? x == null ? void 0 : x.map((w) => w.value) : [] : (k = x == null ? void 0 : x.value) != null ? k : null;
2416
2416
  o(l, M), t == null || t(l);
2417
2417
  }
2418
2418
  s && !p.current && s(l);
2419
- }, [o, l, t, s, m]), k = X(() => v ? "Fetching data..." : f ? m && Array.isArray(f) ? f.length > 0 ? f == null ? void 0 : f.map((x) => x.label).join(", ") : n : (f == null ? void 0 : f.label) || n : n, [f, v, n, m]);
2419
+ }, [o, l, t, s, m]), C = ee(() => v ? "Fetching data..." : f ? m && Array.isArray(f) ? f.length > 0 ? f == null ? void 0 : f.map((x) => x.label).join(", ") : n : (f == null ? void 0 : f.label) || n : n, [f, v, n, m]);
2420
2420
  return /* @__PURE__ */ b("div", { className: "relative", children: [
2421
2421
  !c && d && /* @__PURE__ */ i("label", { className: "block text-sm text-[#686878] darks:text-white/70 mb-2", children: d }),
2422
2422
  c && d && /* @__PURE__ */ i(
2423
2423
  "label",
2424
2424
  {
2425
- className: q(
2425
+ className: J(
2426
2426
  "z-[40] absolute bg-white py-[2px] px-1 -top-[10px] left-3",
2427
2427
  h
2428
2428
  ),
@@ -2430,24 +2430,24 @@ const Ie = ({
2430
2430
  }
2431
2431
  ),
2432
2432
  /* @__PURE__ */ i(
2433
- ne,
2433
+ ae,
2434
2434
  {
2435
2435
  value: f,
2436
2436
  onChange: S,
2437
2437
  multiple: m,
2438
2438
  disabled: y || v,
2439
2439
  children: /* @__PURE__ */ b("div", { className: "relative", children: [
2440
- /* @__PURE__ */ b(ne.Button, { className: "field-control", disabled: y || v, children: [
2440
+ /* @__PURE__ */ b(ae.Button, { className: "field-control", disabled: y || v, children: [
2441
2441
  /* @__PURE__ */ i(
2442
2442
  "span",
2443
2443
  {
2444
- className: q("block text-sm text-left truncate", {
2444
+ className: J("block text-sm text-left truncate", {
2445
2445
  "opacity-60": !f || v
2446
2446
  }),
2447
- children: k
2447
+ children: C
2448
2448
  }
2449
2449
  ),
2450
- /* @__PURE__ */ i("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ i(J, { icon: "lucide:chevron-down" }) })
2450
+ /* @__PURE__ */ i("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ i(z, { icon: "lucide:chevron-down" }) })
2451
2451
  ] }),
2452
2452
  /* @__PURE__ */ i(
2453
2453
  we,
@@ -2455,16 +2455,16 @@ const Ie = ({
2455
2455
  leave: "transition ease-in duration-100",
2456
2456
  leaveFrom: "opacity-100",
2457
2457
  leaveTo: "opacity-0",
2458
- children: /* @__PURE__ */ i(ne.Options, { anchor: "bottom start", className: "select-button-options", children: e.length === 0 ? /* @__PURE__ */ i("div", { className: "px-3 py-2 text-sm text-gray-500", children: "No options available" }) : e == null ? void 0 : e.map((x, C) => {
2458
+ children: /* @__PURE__ */ i(ae.Options, { anchor: "bottom start", className: "select-button-options", children: e.length === 0 ? /* @__PURE__ */ i("div", { className: "px-3 py-2 text-sm text-gray-500", children: "No options available" }) : e == null ? void 0 : e.map((x, k) => {
2459
2459
  var M;
2460
2460
  return /* @__PURE__ */ i(
2461
- ne.Option,
2461
+ ae.Option,
2462
2462
  {
2463
2463
  value: x,
2464
- className: ({ active: w }) => q("select-option", { active: w }),
2465
- children: ({ selected: w }) => /* @__PURE__ */ i("div", { className: q("option-text", { selected: w }), children: x.label })
2464
+ className: ({ active: w }) => J("select-option", { active: w }),
2465
+ children: ({ selected: w }) => /* @__PURE__ */ i("div", { className: J("option-text", { selected: w }), children: x.label })
2466
2466
  },
2467
- ((M = x.value) == null ? void 0 : M.id) || x.value || C
2467
+ ((M = x.value) == null ? void 0 : M.id) || x.value || k
2468
2468
  );
2469
2469
  }) })
2470
2470
  }
@@ -2487,15 +2487,15 @@ function Ue({
2487
2487
  customClass: u
2488
2488
  }) {
2489
2489
  const [t, m] = D(""), [c, r] = D([]), [h, v] = D(!1);
2490
- j(() => {
2490
+ G(() => {
2491
2491
  (async () => {
2492
- var x, C;
2492
+ var x, k;
2493
2493
  if (n) {
2494
2494
  v(!0);
2495
2495
  try {
2496
- const M = oe("token"), w = M ? { headers: { Authorization: `Bearer ${M}` } } : {};
2496
+ const M = de("token"), w = M ? { headers: { Authorization: `Bearer ${M}` } } : {};
2497
2497
  let T = (await Pe.get(n, w)).data;
2498
- if (T && !Array.isArray(T) && (T.data && Array.isArray(T.data) ? T = T.data : (x = T.data) != null && x.data && Array.isArray(T.data.data) ? T = T.data.data : T.results && Array.isArray(T.results) ? T = T.results : (C = T.data) != null && C.results && Array.isArray(T.data.results) ? T = T.data.results : T.items && Array.isArray(T.items) && (T = T.items)), Array.isArray(T)) {
2498
+ if (T && !Array.isArray(T) && (T.data && Array.isArray(T.data) ? T = T.data : (x = T.data) != null && x.data && Array.isArray(T.data.data) ? T = T.data.data : T.results && Array.isArray(T.results) ? T = T.results : (k = T.data) != null && k.results && Array.isArray(T.data.results) ? T = T.data.results : T.items && Array.isArray(T.items) && (T = T.items)), Array.isArray(T)) {
2499
2499
  const I = T.map((L) => typeof L == "string" ? { label: L, value: L } : {
2500
2500
  label: L.label || L.name || String(L.id || L.value),
2501
2501
  value: String(L.value || L.id || L.name)
@@ -2510,27 +2510,27 @@ function Ue({
2510
2510
  }
2511
2511
  })();
2512
2512
  }, [n]);
2513
- const y = n ? c : e, f = X(() => {
2514
- const k = a != null ? a : s;
2515
- return k == null || k === "" ? null : y.find((x) => String(x.value) === String(k) || String(x.label) === String(k)) || null;
2513
+ const y = n ? c : e, f = ee(() => {
2514
+ const C = a != null ? a : s;
2515
+ return C == null || C === "" ? null : y.find((x) => String(x.value) === String(C) || String(x.label) === String(C)) || null;
2516
2516
  }, [a, s, y]), [g, p] = D(f);
2517
- j(() => {
2517
+ G(() => {
2518
2518
  if (a !== void 0)
2519
2519
  if (a === null || a === "")
2520
2520
  p(null);
2521
2521
  else {
2522
- const k = y.find((x) => String(x.value) === String(a) || String(x.label) === String(a)) || null;
2523
- p(k);
2522
+ const C = y.find((x) => String(x.value) === String(a) || String(x.label) === String(a)) || null;
2523
+ p(C);
2524
2524
  }
2525
2525
  }, [a, y]);
2526
- const N = X(() => {
2526
+ const N = ee(() => {
2527
2527
  if (t === "") return y;
2528
- const k = t.toLowerCase();
2528
+ const C = t.toLowerCase();
2529
2529
  return y.filter(
2530
- (x) => x.label.toLowerCase().includes(k)
2530
+ (x) => x.label.toLowerCase().includes(C)
2531
2531
  );
2532
- }, [t, y]), S = Y((k) => {
2533
- p(k), o(d, k);
2532
+ }, [t, y]), S = Y((C) => {
2533
+ p(C), o(d, C);
2534
2534
  }, [d, o]);
2535
2535
  return /* @__PURE__ */ i("div", { className: "relative w-full", children: /* @__PURE__ */ b(
2536
2536
  De,
@@ -2544,24 +2544,24 @@ function Ue({
2544
2544
  Nn,
2545
2545
  {
2546
2546
  className: `field-control ${u}`,
2547
- displayValue: (k) => (k == null ? void 0 : k.label) || "",
2548
- onChange: (k) => m(k.target.value),
2547
+ displayValue: (C) => (C == null ? void 0 : C.label) || "",
2548
+ onChange: (C) => m(C.target.value),
2549
2549
  placeholder: h ? "Loading..." : l ? "" : "Select an option..."
2550
2550
  }
2551
2551
  ),
2552
- !l && /* @__PURE__ */ i(Cn, { className: "absolute inset-y-0 right-0 flex items-center px-2 text-gray-400 hover:text-gray-600", children: h ? /* @__PURE__ */ b("svg", { className: "animate-spin h-4 w-4", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
2552
+ !l && /* @__PURE__ */ i(kn, { className: "absolute inset-y-0 right-0 flex items-center px-2 text-gray-400 hover:text-gray-600", children: h ? /* @__PURE__ */ b("svg", { className: "animate-spin h-4 w-4", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
2553
2553
  /* @__PURE__ */ i("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
2554
2554
  /* @__PURE__ */ i("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
2555
- ] }) : /* @__PURE__ */ i(J, { icon: "octicon:chevron-down-12" }) })
2555
+ ] }) : /* @__PURE__ */ i(z, { icon: "octicon:chevron-down-12" }) })
2556
2556
  ] }),
2557
- /* @__PURE__ */ i(kn, { anchor: "bottom start", className: "select-options__combo", children: h ? /* @__PURE__ */ i("div", { className: "px-3 py-2 text-sm text-gray-500", children: "Loading..." }) : N.length === 0 ? /* @__PURE__ */ i("div", { className: "px-3 py-2 text-sm text-gray-500", children: "No results found." }) : N == null ? void 0 : N.map((k) => /* @__PURE__ */ i(
2557
+ /* @__PURE__ */ i(Cn, { anchor: "bottom start", className: "select-options__combo", children: h ? /* @__PURE__ */ i("div", { className: "px-3 py-2 text-sm text-gray-500", children: "Loading..." }) : N.length === 0 ? /* @__PURE__ */ i("div", { className: "px-3 py-2 text-sm text-gray-500", children: "No results found." }) : N == null ? void 0 : N.map((C) => /* @__PURE__ */ i(
2558
2558
  Mn,
2559
2559
  {
2560
- value: k,
2561
- className: ({ active: x, selected: C }) => q("select-option", { active: x, selected: C }),
2562
- children: ({ selected: x }) => /* @__PURE__ */ i("div", { className: q("option-text", { selected: x }), children: k.label })
2560
+ value: C,
2561
+ className: ({ active: x, selected: k }) => J("select-option", { active: x, selected: k }),
2562
+ children: ({ selected: x }) => /* @__PURE__ */ i("div", { className: J("option-text", { selected: x }), children: C.label })
2563
2563
  },
2564
- k.value
2564
+ C.value
2565
2565
  )) })
2566
2566
  ]
2567
2567
  }
@@ -2579,9 +2579,9 @@ function _a({
2579
2579
  watch: l
2580
2580
  } = n || {};
2581
2581
  let d;
2582
- return l && (d = l()[e.id]), j(() => {
2582
+ return l && (d = l()[e.id]), G(() => {
2583
2583
  a(e.id);
2584
- }, [e.id, a]), /* @__PURE__ */ i(re, { children: e.selectType === "list" ? /* @__PURE__ */ i(
2584
+ }, [e.id, a]), /* @__PURE__ */ i(ve, { children: e.selectType === "list" ? /* @__PURE__ */ i(
2585
2585
  Ie,
2586
2586
  {
2587
2587
  options: (u = e == null ? void 0 : e.options) != null ? u : [],
@@ -2590,7 +2590,7 @@ function _a({
2590
2590
  setValue: o,
2591
2591
  trigger: s,
2592
2592
  value: d,
2593
- className: q("field-control", e == null ? void 0 : e.customClass),
2593
+ className: J("field-control", e == null ? void 0 : e.customClass),
2594
2594
  disabled: n == null ? void 0 : n.isReadOnly
2595
2595
  }
2596
2596
  ) : /* @__PURE__ */ i(
@@ -2614,7 +2614,7 @@ function Ya({
2614
2614
  {
2615
2615
  placeholder: e.placeholder,
2616
2616
  rows: 4,
2617
- className: q("field-control resize-none", e == null ? void 0 : e.customClass),
2617
+ className: J("field-control resize-none", e == null ? void 0 : e.customClass),
2618
2618
  ...a(e.id),
2619
2619
  disabled: n == null ? void 0 : n.isReadOnly
2620
2620
  }
@@ -2656,16 +2656,16 @@ const Za = ({
2656
2656
  activeTab: o,
2657
2657
  btnClass: l = ""
2658
2658
  }) => {
2659
- const d = q(
2659
+ const d = J(
2660
2660
  "flex gap-x-3 mb-8 w-full no-scrollbar overflow-x-auto border-b-2 border-[#EAECF0] darks:border-gray-500",
2661
2661
  n
2662
2662
  );
2663
2663
  return /* @__PURE__ */ i("div", { className: d, children: e == null ? void 0 : e.map((u) => {
2664
- const t = o === u.key, m = a[u.key] || 0, c = q(
2664
+ const t = o === u.key, m = a[u.key] || 0, c = J(
2665
2665
  "capitalize text-sm whitespace-nowrap no-scrollbar font-semibold pb-[14px] border-b-2 border-[#EAECF0] px-6 flex items-center gap-x-1 flex-1 text-center",
2666
2666
  `${e.length === 1 ? "justify-start" : "justify-center"}`,
2667
2667
  l
2668
- ), r = q({
2668
+ ), r = J({
2669
2669
  "border-gray-500 border-primary border-primary-500 text-primary text-primary-500": t,
2670
2670
  "border-transparent text-gray-400 ": !t
2671
2671
  }), h = m > 0 && /* @__PURE__ */ i("span", { className: "text-xs h-6 min-w-[24px] rounded-full flex justify-center items-center border border-[#EAECF0] darks:border-gray-500 bg-[#F9FAFB] darks:bg-gray-800 text-[#454745] darks:text-white/80", children: m });
@@ -2673,7 +2673,7 @@ const Za = ({
2673
2673
  "button",
2674
2674
  {
2675
2675
  onClick: () => s(u.key),
2676
- className: q(c, r),
2676
+ className: J(c, r),
2677
2677
  "aria-selected": t,
2678
2678
  role: "tab",
2679
2679
  type: "button",
@@ -2709,8 +2709,8 @@ const Za = ({
2709
2709
  }, Re = (e, n = e) => ({
2710
2710
  label: e,
2711
2711
  value: n,
2712
- id: me()
2713
- }), ie = (e) => ({
2712
+ id: pe()
2713
+ }), ne = (e) => ({
2714
2714
  ...Qa,
2715
2715
  ...e
2716
2716
  }), Xa = _e == null ? void 0 : _e.map((e) => ({
@@ -2718,28 +2718,28 @@ const Za = ({
2718
2718
  value: e.name,
2719
2719
  id: e.code || e.name
2720
2720
  })), eo = [
2721
- ie({
2721
+ ne({
2722
2722
  type: "basicText",
2723
2723
  label: "Basic Text",
2724
2724
  icon: "majesticons:text",
2725
2725
  inputLabel: "",
2726
2726
  inputType: "basicText"
2727
2727
  }),
2728
- ie({
2728
+ ne({
2729
2729
  type: "textField",
2730
2730
  label: "Text Input",
2731
2731
  icon: "fluent:text-16-filled",
2732
2732
  inputLabel: "Text Label",
2733
2733
  inputType: "text"
2734
2734
  }),
2735
- ie({
2735
+ ne({
2736
2736
  type: "longText",
2737
2737
  label: "Long Text",
2738
2738
  icon: "dashicons:text",
2739
2739
  inputLabel: "Long Text Label",
2740
2740
  inputType: "text"
2741
2741
  }),
2742
- ie({
2742
+ ne({
2743
2743
  type: "selectField",
2744
2744
  label: "List",
2745
2745
  icon: "tabler:select",
@@ -2757,7 +2757,7 @@ const Za = ({
2757
2757
  // options: [option("Parent", "")],
2758
2758
  // options2: [option("Child", "")],
2759
2759
  // }),
2760
- ie({
2760
+ ne({
2761
2761
  type: "multiSelect",
2762
2762
  label: "Multi List",
2763
2763
  icon: "fluent-mdl2:multi-select",
@@ -2765,7 +2765,7 @@ const Za = ({
2765
2765
  inputType: "select",
2766
2766
  options: [Re("Placeholder 1", "placeholder_1")]
2767
2767
  }),
2768
- ie({
2768
+ ne({
2769
2769
  type: "validateInput",
2770
2770
  label: "Validate",
2771
2771
  icon: "iconoir:www",
@@ -2775,7 +2775,7 @@ const Za = ({
2775
2775
  method: "GET",
2776
2776
  responseType: "string"
2777
2777
  }),
2778
- ie({
2778
+ ne({
2779
2779
  type: "numberField",
2780
2780
  label: "Number",
2781
2781
  icon: "octicon:number-16",
@@ -2783,7 +2783,7 @@ const Za = ({
2783
2783
  inputType: "number",
2784
2784
  inputMode: "decimal"
2785
2785
  }),
2786
- ie({
2786
+ ne({
2787
2787
  type: "amountField",
2788
2788
  label: "Amount",
2789
2789
  icon: "carbon:currency",
@@ -2791,7 +2791,7 @@ const Za = ({
2791
2791
  inputType: "amount",
2792
2792
  prefix: null
2793
2793
  }),
2794
- ie({
2794
+ ne({
2795
2795
  type: "date",
2796
2796
  label: "Date",
2797
2797
  icon: "bx:calendar",
@@ -2804,21 +2804,21 @@ const Za = ({
2804
2804
  canHaveDateRange: !1,
2805
2805
  allowYearPicker: !1
2806
2806
  }),
2807
- ie({
2807
+ ne({
2808
2808
  type: "url",
2809
2809
  label: "Link",
2810
2810
  icon: "iconamoon:link",
2811
2811
  inputLabel: "Url Link",
2812
2812
  inputType: "url"
2813
2813
  }),
2814
- ie({
2814
+ ne({
2815
2815
  type: "password",
2816
2816
  label: "Password",
2817
2817
  icon: "ic:round-password",
2818
2818
  inputLabel: "Password Label",
2819
2819
  inputType: "password"
2820
2820
  }),
2821
- ie({
2821
+ ne({
2822
2822
  type: "checkbox",
2823
2823
  label: "Checkbox",
2824
2824
  icon: "mingcute:checkbox-line",
@@ -2826,7 +2826,7 @@ const Za = ({
2826
2826
  inputType: "checkbox",
2827
2827
  options: [Re("Checkbox Option", "")]
2828
2828
  }),
2829
- ie({
2829
+ ne({
2830
2830
  type: "phoneField",
2831
2831
  label: "Phone",
2832
2832
  icon: "fluent-mdl2:add-phone",
@@ -2834,7 +2834,7 @@ const Za = ({
2834
2834
  inputType: "tel",
2835
2835
  pattern: "^\\+?[0-9]{7,15}$"
2836
2836
  }),
2837
- ie({
2837
+ ne({
2838
2838
  type: "radio",
2839
2839
  label: "Radio",
2840
2840
  icon: "ri:checkbox-circle-line",
@@ -2842,14 +2842,14 @@ const Za = ({
2842
2842
  inputType: "radio",
2843
2843
  options: [Re("Radio Option", "")]
2844
2844
  }),
2845
- ie({
2845
+ ne({
2846
2846
  type: "email",
2847
2847
  label: "Email",
2848
2848
  icon: "mdi:email-outline",
2849
2849
  inputLabel: "Email Label",
2850
2850
  inputType: "email"
2851
2851
  }),
2852
- ie({
2852
+ ne({
2853
2853
  type: "file",
2854
2854
  label: "File",
2855
2855
  icon: "ion:attach-sharp",
@@ -2858,7 +2858,7 @@ const Za = ({
2858
2858
  isMultiple: !1,
2859
2859
  acceptedFiles: []
2860
2860
  }),
2861
- ie({
2861
+ ne({
2862
2862
  type: "country",
2863
2863
  label: "Country",
2864
2864
  icon: "fluent:globe-16-regular",
@@ -2867,14 +2867,14 @@ const Za = ({
2867
2867
  options: Xa,
2868
2868
  showState: !1
2869
2869
  }),
2870
- ie({
2870
+ ne({
2871
2871
  type: "rating",
2872
2872
  label: "Ratings",
2873
2873
  icon: "streamline-ultimate:rating-star-ribbon",
2874
2874
  inputLabel: "Rating Label",
2875
2875
  inputType: "rating"
2876
2876
  }),
2877
- ie({
2877
+ ne({
2878
2878
  type: "dataGrid",
2879
2879
  label: "Table",
2880
2880
  icon: "carbon:data-table",
@@ -2883,7 +2883,7 @@ const Za = ({
2883
2883
  value: [],
2884
2884
  dataColumns: [
2885
2885
  {
2886
- id: me(),
2886
+ id: pe(),
2887
2887
  field: "",
2888
2888
  headerName: "",
2889
2889
  width: 150,
@@ -2901,14 +2901,14 @@ const Za = ({
2901
2901
  // inputType: "tableInput",
2902
2902
  // value: [],
2903
2903
  // }),
2904
- ie({
2904
+ ne({
2905
2905
  type: "divider",
2906
2906
  label: "Divider",
2907
2907
  icon: "pixel:divider",
2908
2908
  inputLabel: "",
2909
2909
  inputType: "divider"
2910
2910
  }),
2911
- ie({
2911
+ ne({
2912
2912
  type: "spacer",
2913
2913
  label: "Spacer",
2914
2914
  icon: "fluent-mdl2:spacer",
@@ -2922,7 +2922,7 @@ const Za = ({
2922
2922
  // inputLabel: "",
2923
2923
  // inputType: "section",
2924
2924
  // }),
2925
- ie({
2925
+ ne({
2926
2926
  type: "grid",
2927
2927
  label: "Grid",
2928
2928
  icon: "cuida:grid-outline",
@@ -2930,7 +2930,7 @@ const Za = ({
2930
2930
  inputType: "grid",
2931
2931
  columns: 2
2932
2932
  }),
2933
- ie({
2933
+ ne({
2934
2934
  type: "matrix",
2935
2935
  label: "Likert Scale",
2936
2936
  icon: "pepicons-pop:list",
@@ -2947,7 +2947,7 @@ const Za = ({
2947
2947
  { id: "c5", label: "Strongly Agree", value: "strongly_agree" }
2948
2948
  ]
2949
2949
  }),
2950
- ie({
2950
+ ne({
2951
2951
  type: "calculatedField",
2952
2952
  label: "Calculated Field",
2953
2953
  icon: "material-symbols:functions",
@@ -2955,7 +2955,7 @@ const Za = ({
2955
2955
  inputType: "calculatedField",
2956
2956
  formula: ""
2957
2957
  }),
2958
- ie({
2958
+ ne({
2959
2959
  type: "polling",
2960
2960
  label: "Polling",
2961
2961
  icon: "mdi:poll",
@@ -3093,7 +3093,7 @@ function mo({
3093
3093
  const [s, o] = D(
3094
3094
  (e == null ? void 0 : e.length) > 0 ? e : [{ value: "" }]
3095
3095
  );
3096
- j(() => {
3096
+ G(() => {
3097
3097
  (e == null ? void 0 : e.length) > 0 && JSON.stringify(e) !== JSON.stringify(s) && o(e);
3098
3098
  }, [e]);
3099
3099
  function l(t, m) {
@@ -3116,7 +3116,7 @@ function mo({
3116
3116
  const m = s.filter((c, r) => r !== t);
3117
3117
  o(m), n && n(m);
3118
3118
  }
3119
- return j(() => {
3119
+ return G(() => {
3120
3120
  a && a(JSON.stringify({ values: s }));
3121
3121
  }, [a, s]), /* @__PURE__ */ b("div", { className: "]", children: [
3122
3122
  /* @__PURE__ */ b("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: [
@@ -3218,7 +3218,7 @@ const bo = () => /* @__PURE__ */ i("blockquote", { className: "bg-gray-100 p-4 r
3218
3218
  label: s,
3219
3219
  type: o
3220
3220
  }) => {
3221
- const [l, d] = D(""), u = oe("config");
3221
+ const [l, d] = D(""), u = de("config");
3222
3222
  return /* @__PURE__ */ b("div", { children: [
3223
3223
  /* @__PURE__ */ b("div", { className: "relative", children: [
3224
3224
  /* @__PURE__ */ i(
@@ -3339,7 +3339,7 @@ function xo({
3339
3339
  watch: s,
3340
3340
  id: o
3341
3341
  }) {
3342
- const { formData: l } = ye(ce), d = s("visibilityDependentFields") || [], u = X(() => {
3342
+ const { formData: l } = ye(be), d = s("visibilityDependentFields") || [], u = ee(() => {
3343
3343
  var m;
3344
3344
  return (m = fo(l).filter((c) => c.id !== o)) == null ? void 0 : m.map((c) => {
3345
3345
  const r = d.find(
@@ -3388,12 +3388,12 @@ function xo({
3388
3388
  }
3389
3389
  ),
3390
3390
  /* @__PURE__ */ i("div", { className: "field-listbox min-w-[100px]", children: /* @__PURE__ */ i(
3391
- ne,
3391
+ ae,
3392
3392
  {
3393
3393
  value: m.fieldType,
3394
3394
  onChange: (v) => t(c, "fieldType", v),
3395
3395
  children: /* @__PURE__ */ b("div", { className: "listbox-wrapper", children: [
3396
- /* @__PURE__ */ i(ne.Button, { className: "listbox-button", children: m.fieldType }),
3396
+ /* @__PURE__ */ i(ae.Button, { className: "listbox-button", children: m.fieldType }),
3397
3397
  /* @__PURE__ */ i(
3398
3398
  we,
3399
3399
  {
@@ -3402,12 +3402,12 @@ function xo({
3402
3402
  leaveFrom: "opacity-100",
3403
3403
  leaveTo: "opacity-0",
3404
3404
  children: /* @__PURE__ */ i(
3405
- ne.Options,
3405
+ ae.Options,
3406
3406
  {
3407
3407
  className: "listbox-options ",
3408
3408
  anchor: "bottom",
3409
3409
  children: di == null ? void 0 : di.map((v) => /* @__PURE__ */ i(
3410
- ne.Option,
3410
+ ae.Option,
3411
3411
  {
3412
3412
  value: v,
3413
3413
  className: "listbox-option",
@@ -3423,12 +3423,12 @@ function xo({
3423
3423
  }
3424
3424
  ) }),
3425
3425
  /* @__PURE__ */ i("div", { className: "field-listbox min-w-[100px]", children: /* @__PURE__ */ i(
3426
- ne,
3426
+ ae,
3427
3427
  {
3428
3428
  value: m.operator,
3429
3429
  onChange: (v) => t(c, "operator", v),
3430
3430
  children: /* @__PURE__ */ b("div", { className: "listbox-wrapper", children: [
3431
- /* @__PURE__ */ i(ne.Button, { className: "listbox-button", children: m.operator.replace("_", " ") }),
3431
+ /* @__PURE__ */ i(ae.Button, { className: "listbox-button", children: m.operator.replace("_", " ") }),
3432
3432
  /* @__PURE__ */ i(
3433
3433
  we,
3434
3434
  {
@@ -3437,12 +3437,12 @@ function xo({
3437
3437
  leaveFrom: "opacity-100",
3438
3438
  leaveTo: "opacity-0",
3439
3439
  children: /* @__PURE__ */ i(
3440
- ne.Options,
3440
+ ae.Options,
3441
3441
  {
3442
3442
  className: "listbox-options ",
3443
3443
  anchor: "bottom",
3444
3444
  children: (r = m.fieldType === "number" ? [...zi, ...yo] : zi) == null ? void 0 : r.map((v) => /* @__PURE__ */ i(
3445
- ne.Option,
3445
+ ae.Option,
3446
3446
  {
3447
3447
  value: v,
3448
3448
  className: "listbox-option",
@@ -3467,12 +3467,12 @@ function xo({
3467
3467
  className: "field-value"
3468
3468
  }
3469
3469
  ) : /* @__PURE__ */ i("div", { className: "field-listbox", children: /* @__PURE__ */ i(
3470
- ne,
3470
+ ae,
3471
3471
  {
3472
3472
  value: (h = m.fieldValue) != null ? h : "",
3473
3473
  onChange: (v) => t(c, "fieldValue", v),
3474
3474
  children: /* @__PURE__ */ b("div", { className: "listbox-wrapper", children: [
3475
- /* @__PURE__ */ i(ne.Button, { className: "listbox-button", children: m.fieldValue === !0 ? "True" : m.fieldValue === !1 ? "False" : "Select value" }),
3475
+ /* @__PURE__ */ i(ae.Button, { className: "listbox-button", children: m.fieldValue === !0 ? "True" : m.fieldValue === !1 ? "False" : "Select value" }),
3476
3476
  /* @__PURE__ */ i(
3477
3477
  we,
3478
3478
  {
@@ -3481,13 +3481,13 @@ function xo({
3481
3481
  leaveFrom: "opacity-100",
3482
3482
  leaveTo: "opacity-0",
3483
3483
  children: /* @__PURE__ */ b(
3484
- ne.Options,
3484
+ ae.Options,
3485
3485
  {
3486
3486
  className: "listbox-options ",
3487
3487
  anchor: "bottom",
3488
3488
  children: [
3489
3489
  /* @__PURE__ */ i(
3490
- ne.Option,
3490
+ ae.Option,
3491
3491
  {
3492
3492
  value: !0,
3493
3493
  className: "listbox-option",
@@ -3495,7 +3495,7 @@ function xo({
3495
3495
  }
3496
3496
  ),
3497
3497
  /* @__PURE__ */ i(
3498
- ne.Option,
3498
+ ae.Option,
3499
3499
  {
3500
3500
  value: !1,
3501
3501
  className: "listbox-option",
@@ -3535,8 +3535,8 @@ function So({
3535
3535
  fields: a,
3536
3536
  placeholder: s
3537
3537
  }) {
3538
- const [o, l] = D(() => Ji(e)), [d, u] = D(null), [t, m] = D(!1), [c, r] = D(""), [h, v] = D(null), y = te(null), f = te(null), g = te(/* @__PURE__ */ new Map());
3539
- j(() => {
3538
+ const [o, l] = D(() => Ji(e)), [d, u] = D(null), [t, m] = D(!1), [c, r] = D(""), [h, v] = D(null), y = re(null), f = re(null), g = re(/* @__PURE__ */ new Map());
3539
+ G(() => {
3540
3540
  const A = Ji(e);
3541
3541
  l(A);
3542
3542
  }, []);
@@ -3551,17 +3551,17 @@ function So({
3551
3551
  }, S = (A) => {
3552
3552
  const T = o.filter((I, L) => L !== A);
3553
3553
  l(T), p(T);
3554
- }, k = (A) => {
3554
+ }, C = (A) => {
3555
3555
  v(A), r(""), m(!0);
3556
3556
  }, x = (A, T) => {
3557
- const I = T !== void 0 ? T : h != null ? h : o.length, L = [...o], W = L.slice(0, I), Z = L.slice(I), ee = [
3558
- ...W,
3557
+ const I = T !== void 0 ? T : h != null ? h : o.length, L = [...o], F = L.slice(0, I), Z = L.slice(I), ie = [
3558
+ ...F,
3559
3559
  { type: "field", id: A.id, display: A.display },
3560
3560
  ...Z
3561
- ], $ = C(ee);
3562
- l($), p($), m(!1), v(null);
3561
+ ], X = k(ie);
3562
+ l(X), p(X), m(!1), v(null);
3563
3563
  };
3564
- function C(A) {
3564
+ function k(A) {
3565
3565
  const T = [];
3566
3566
  if (A.length === 0) return [{ type: "operator", value: "" }];
3567
3567
  A[0].type === "field" && T.push({ type: "operator", value: "" });
@@ -3638,7 +3638,7 @@ function So({
3638
3638
  {
3639
3639
  type: "button",
3640
3640
  onMouseDown: (A) => {
3641
- A.preventDefault(), k(o.length);
3641
+ A.preventDefault(), C(o.length);
3642
3642
  },
3643
3643
  className: "inline-flex items-center gap-1 text-xs text-blue-600 hover:text-blue-800 hover:bg-blue-50 px-1.5 py-0.5 rounded transition-colors",
3644
3644
  title: "Insert a field",
@@ -3652,7 +3652,7 @@ function So({
3652
3652
  /* @__PURE__ */ i("span", { className: "font-sans font-semibold text-blue-500 uppercase tracking-wide mr-1", children: "Preview:" }),
3653
3653
  o.map((A) => A.type === "field" ? `[${A.display}]` : A.value).join("")
3654
3654
  ] }),
3655
- t && /* @__PURE__ */ b(re, { children: [
3655
+ t && /* @__PURE__ */ b(ve, { children: [
3656
3656
  /* @__PURE__ */ i(
3657
3657
  "div",
3658
3658
  {
@@ -3794,18 +3794,18 @@ const No = R.object().shape({
3794
3794
  formula: R.string().nullable(),
3795
3795
  fetchExternalResults: R.boolean(),
3796
3796
  externalApiUrl: R.string().nullable()
3797
- }), Co = [
3797
+ }), ko = [
3798
3798
  { title: "Configurations", key: "basic" },
3799
3799
  { title: "Validations", key: "validation" }
3800
- ], ko = ({
3800
+ ], Co = ({
3801
3801
  isOpen: e,
3802
3802
  onClose: n,
3803
3803
  element: a
3804
3804
  }) => {
3805
- var G;
3806
- const s = Co.filter(
3805
+ var O;
3806
+ const s = ko.filter(
3807
3807
  (B) => !We.includes(a.inputType) || B.key !== "validation"
3808
- ), { updateElement: o, formData: l } = ae.useContext(ce), [d, u] = D("basic"), [t, m] = D(!1), [c, r] = D("manual"), h = ((G = l == null ? void 0 : l.flatMap((B) => (B == null ? void 0 : B.questionData) || [])) == null ? void 0 : G.length) || 0, v = ae.useMemo(() => (l == null ? void 0 : l.flatMap((B) => (B == null ? void 0 : B.questionData) || []).filter(
3808
+ ), { updateElement: o, formData: l } = se.useContext(be), [d, u] = D("basic"), [t, m] = D(!1), [c, r] = D("manual"), h = ((O = l == null ? void 0 : l.flatMap((B) => (B == null ? void 0 : B.questionData) || [])) == null ? void 0 : O.length) || 0, v = se.useMemo(() => (l == null ? void 0 : l.flatMap((B) => (B == null ? void 0 : B.questionData) || []).filter(
3809
3809
  (B) => {
3810
3810
  var K;
3811
3811
  return B.id !== (a == null ? void 0 : a.id) && !["spacer", "divider", "section", "grid"].includes(
@@ -3815,14 +3815,14 @@ const No = R.object().shape({
3815
3815
  ).map((B) => ({
3816
3816
  id: B.id,
3817
3817
  display: B.inputLabel || B.label || "Unnamed"
3818
- }))) || [], [h, a == null ? void 0 : a.id]), y = oe("config"), {
3818
+ }))) || [], [h, a == null ? void 0 : a.id]), y = de("config"), {
3819
3819
  register: f,
3820
3820
  handleSubmit: g,
3821
3821
  control: p,
3822
3822
  setValue: N,
3823
3823
  watch: S,
3824
- trigger: k,
3825
- formState: { errors: x, isSubmitting: C, isValid: M },
3824
+ trigger: C,
3825
+ formState: { errors: x, isSubmitting: k, isValid: M },
3826
3826
  reset: w
3827
3827
  } = Ai({
3828
3828
  resolver: wi(No),
@@ -3834,30 +3834,30 @@ const No = R.object().shape({
3834
3834
  control: p,
3835
3835
  name: "options"
3836
3836
  }), {
3837
- fields: W,
3837
+ fields: F,
3838
3838
  append: Z,
3839
- remove: ee
3839
+ remove: ie
3840
3840
  } = ni({
3841
3841
  control: p,
3842
3842
  name: "options1"
3843
3843
  }), {
3844
- fields: $,
3845
- append: be,
3844
+ fields: X,
3845
+ append: he,
3846
3846
  remove: _
3847
3847
  } = ni({
3848
3848
  control: p,
3849
3849
  name: "dataColumns"
3850
3850
  });
3851
- j(() => {
3851
+ G(() => {
3852
3852
  e || w();
3853
3853
  }, [e, w]);
3854
3854
  const V = (B) => {
3855
3855
  o(B, a.sectionId), n();
3856
3856
  }, Ae = {
3857
3857
  headers: {
3858
- Authorization: `Bearer ${oe("token")}`
3858
+ Authorization: `Bearer ${de("token")}`
3859
3859
  }
3860
- }, ve = Y(async () => {
3860
+ }, ge = Y(async () => {
3861
3861
  var B, K, P;
3862
3862
  if (!A.apiUrl || !/^https?:\/\//.test(A.apiUrl)) {
3863
3863
  xe.info("Please provide a valid API URL");
@@ -3865,31 +3865,31 @@ const No = R.object().shape({
3865
3865
  }
3866
3866
  try {
3867
3867
  m(!0);
3868
- const { status: E, data: O } = await Pe.get(A.apiUrl, Ae);
3869
- if (E !== 200 || !O) {
3868
+ const { status: E, data: q } = await Pe.get(A.apiUrl, Ae);
3869
+ if (E !== 200 || !q) {
3870
3870
  xe.error("Unexpected response from server.");
3871
3871
  return;
3872
3872
  }
3873
- const H = O.data || O.record || O.result;
3874
- if (!Array.isArray(H)) {
3873
+ const $ = q.data || q.record || q.result;
3874
+ if (!Array.isArray($)) {
3875
3875
  xe.error("Expected an array in response (data, record, or result).");
3876
3876
  return;
3877
3877
  }
3878
- ((B = a.type) == null ? void 0 : B.toLowerCase()) === "datagrid" ? N("dataColumns", xi(H)) : N("options", yi(H));
3878
+ ((B = a.type) == null ? void 0 : B.toLowerCase()) === "datagrid" ? N("dataColumns", xi($)) : N("options", yi($));
3879
3879
  } catch (E) {
3880
- const O = ((P = (K = E == null ? void 0 : E.response) == null ? void 0 : K.data) == null ? void 0 : P.message) || (E == null ? void 0 : E.message) || "Unable to load options";
3881
- xe.error(O);
3880
+ const q = ((P = (K = E == null ? void 0 : E.response) == null ? void 0 : K.data) == null ? void 0 : P.message) || (E == null ? void 0 : E.message) || "Unable to load options";
3881
+ xe.error(q);
3882
3882
  } finally {
3883
3883
  m(!1);
3884
3884
  }
3885
- }, [a.type, N, A.apiUrl]), se = ["manual", "api", "sheet"];
3885
+ }, [a.type, N, A.apiUrl]), ue = ["manual", "api", "sheet"];
3886
3886
  function Se() {
3887
- c === "api" && ve();
3887
+ c === "api" && ge();
3888
3888
  }
3889
- const ke = () => {
3889
+ const Ce = () => {
3890
3890
  var B, K;
3891
3891
  return /* @__PURE__ */ b("div", { className: "flex flex-col justify-start gap-y-1", children: [
3892
- /* @__PURE__ */ i("div", { className: "flex items-center mb-4 gap-x-5", children: se == null ? void 0 : se.map((P) => /* @__PURE__ */ b("label", { className: "items-center text-base capitalize gap-x-3", children: [
3892
+ /* @__PURE__ */ i("div", { className: "flex items-center mb-4 gap-x-5", children: ue == null ? void 0 : ue.map((P) => /* @__PURE__ */ b("label", { className: "items-center text-base capitalize gap-x-3", children: [
3893
3893
  /* @__PURE__ */ i(
3894
3894
  "input",
3895
3895
  {
@@ -3909,7 +3909,7 @@ const No = R.object().shape({
3909
3909
  /* @__PURE__ */ b("div", { className: "flex items-center gap-x-2", children: [
3910
3910
  /* @__PURE__ */ b("div", { className: "relative flex items-center w-full mb-2", children: [
3911
3911
  /* @__PURE__ */ i(
3912
- z,
3912
+ W,
3913
3913
  {
3914
3914
  watch: S,
3915
3915
  label: "Load Options from Api",
@@ -3952,7 +3952,7 @@ const No = R.object().shape({
3952
3952
  className: "flex items-center mb-1 gap-x-4 last:mb-0",
3953
3953
  children: [
3954
3954
  /* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
3955
- z,
3955
+ W,
3956
3956
  {
3957
3957
  watch: S,
3958
3958
  label: E === 0 ? "Label" : "",
@@ -3961,9 +3961,9 @@ const No = R.object().shape({
3961
3961
  errors: x,
3962
3962
  element: a,
3963
3963
  placeholder: "Label",
3964
- onChange: (O) => {
3965
- const U = O.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
3966
- N(`options.${E}.value`, U, {
3964
+ onChange: (q) => {
3965
+ const j = q.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
3966
+ N(`options.${E}.value`, j, {
3967
3967
  shouldValidate: !0,
3968
3968
  shouldDirty: !0
3969
3969
  });
@@ -3971,7 +3971,7 @@ const No = R.object().shape({
3971
3971
  }
3972
3972
  ) }),
3973
3973
  /* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
3974
- z,
3974
+ W,
3975
3975
  {
3976
3976
  watch: S,
3977
3977
  label: E === 0 ? "Value" : "",
@@ -3989,7 +3989,7 @@ const No = R.object().shape({
3989
3989
  type: "button",
3990
3990
  className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
3991
3991
  onClick: () => L(E),
3992
- children: /* @__PURE__ */ i(J, { icon: "iconamoon:sign-times-fill" })
3992
+ children: /* @__PURE__ */ i(z, { icon: "iconamoon:sign-times-fill" })
3993
3993
  }
3994
3994
  )
3995
3995
  ]
@@ -4004,27 +4004,27 @@ const No = R.object().shape({
4004
4004
  {
4005
4005
  type: "button",
4006
4006
  className: "flex items-center mt-2 text-sm font-medium text-gray-700 gap-x-1",
4007
- onClick: () => I({ label: "", value: "", id: me() }),
4007
+ onClick: () => I({ label: "", value: "", id: pe() }),
4008
4008
  children: [
4009
- /* @__PURE__ */ i(J, { icon: "qlementine-icons:plus-16" }),
4009
+ /* @__PURE__ */ i(z, { icon: "qlementine-icons:plus-16" }),
4010
4010
  " Add Option"
4011
4011
  ]
4012
4012
  }
4013
4013
  )
4014
4014
  ] })
4015
4015
  ] }),
4016
- ["cascadeselect", "matrix"].includes(a.type.toLowerCase()) && /* @__PURE__ */ b(re, { children: [
4016
+ ["cascadeselect", "matrix"].includes(a.type.toLowerCase()) && /* @__PURE__ */ b(ve, { children: [
4017
4017
  /* @__PURE__ */ i("hr", { className: "my-5" }),
4018
4018
  /* @__PURE__ */ b("div", { children: [
4019
4019
  " ",
4020
4020
  /* @__PURE__ */ i("h3", { className: "mb-4 text-sm text-gray-500 font-semibold", children: ((K = a == null ? void 0 : a.type) == null ? void 0 : K.toLowerCase()) === "matrix" ? "Columns Options" : "Child Options" }),
4021
- W == null ? void 0 : W.map((P, E) => /* @__PURE__ */ b(
4021
+ F == null ? void 0 : F.map((P, E) => /* @__PURE__ */ b(
4022
4022
  "div",
4023
4023
  {
4024
4024
  className: "flex items-center mb-1 gap-x-4 last:mb-0",
4025
4025
  children: [
4026
4026
  /* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
4027
- z,
4027
+ W,
4028
4028
  {
4029
4029
  watch: S,
4030
4030
  label: E === 0 ? "Label" : "",
@@ -4033,9 +4033,9 @@ const No = R.object().shape({
4033
4033
  errors: x,
4034
4034
  element: a,
4035
4035
  placeholder: "Label",
4036
- onChange: (O) => {
4037
- const U = O.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
4038
- N(`options1.${E}.value`, U, {
4036
+ onChange: (q) => {
4037
+ const j = q.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
4038
+ N(`options1.${E}.value`, j, {
4039
4039
  shouldValidate: !0,
4040
4040
  shouldDirty: !0
4041
4041
  });
@@ -4043,7 +4043,7 @@ const No = R.object().shape({
4043
4043
  }
4044
4044
  ) }),
4045
4045
  /* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
4046
- z,
4046
+ W,
4047
4047
  {
4048
4048
  watch: S,
4049
4049
  label: E === 0 ? "Value" : "",
@@ -4055,7 +4055,7 @@ const No = R.object().shape({
4055
4055
  }
4056
4056
  ) }),
4057
4057
  /* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
4058
- z,
4058
+ W,
4059
4059
  {
4060
4060
  watch: S,
4061
4061
  label: E === 0 ? "Key" : "",
@@ -4069,11 +4069,11 @@ const No = R.object().shape({
4069
4069
  /* @__PURE__ */ i(
4070
4070
  "button",
4071
4071
  {
4072
- disabled: W.length === 1,
4072
+ disabled: F.length === 1,
4073
4073
  type: "button",
4074
4074
  className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
4075
- onClick: () => ee(E),
4076
- children: /* @__PURE__ */ i(J, { icon: "iconamoon:sign-times-fill" })
4075
+ onClick: () => ie(E),
4076
+ children: /* @__PURE__ */ i(z, { icon: "iconamoon:sign-times-fill" })
4077
4077
  }
4078
4078
  )
4079
4079
  ]
@@ -4087,9 +4087,9 @@ const No = R.object().shape({
4087
4087
  {
4088
4088
  type: "button",
4089
4089
  className: "flex items-center mt-2 text-sm font-medium text-gray-700 gap-x-1",
4090
- onClick: () => Z({ label: "", value: "", key: "", id: me() }),
4090
+ onClick: () => Z({ label: "", value: "", key: "", id: pe() }),
4091
4091
  children: [
4092
- /* @__PURE__ */ i(J, { icon: "qlementine-icons:plus-16" }),
4092
+ /* @__PURE__ */ i(z, { icon: "qlementine-icons:plus-16" }),
4093
4093
  " Add Option"
4094
4094
  ]
4095
4095
  }
@@ -4099,7 +4099,7 @@ const No = R.object().shape({
4099
4099
  ] })
4100
4100
  ] });
4101
4101
  }, Be = () => /* @__PURE__ */ b("div", { className: "flex flex-col justify-start gap-y-1", children: [
4102
- /* @__PURE__ */ i("div", { className: "flex items-center mb-4 gap-x-5", children: se == null ? void 0 : se.map((B) => /* @__PURE__ */ b("label", { className: "items-center text-base capitalize gap-x-3", children: [
4102
+ /* @__PURE__ */ i("div", { className: "flex items-center mb-4 gap-x-5", children: ue == null ? void 0 : ue.map((B) => /* @__PURE__ */ b("label", { className: "items-center text-base capitalize gap-x-3", children: [
4103
4103
  /* @__PURE__ */ i(
4104
4104
  "input",
4105
4105
  {
@@ -4120,7 +4120,7 @@ const No = R.object().shape({
4120
4120
  /* @__PURE__ */ b("div", { className: "flex items-center gap-x-2", children: [
4121
4121
  /* @__PURE__ */ b("div", { className: "relative flex items-center w-full mb-2", children: [
4122
4122
  /* @__PURE__ */ i(
4123
- z,
4123
+ W,
4124
4124
  {
4125
4125
  watch: S,
4126
4126
  label: "Load Columns from Api",
@@ -4155,7 +4155,7 @@ const No = R.object().shape({
4155
4155
  name: "dataColumns"
4156
4156
  }
4157
4157
  ) }),
4158
- /* @__PURE__ */ i("div", { className: "grid gap-y-3", children: $ == null ? void 0 : $.map((B, K) => {
4158
+ /* @__PURE__ */ i("div", { className: "grid gap-y-3", children: X == null ? void 0 : X.map((B, K) => {
4159
4159
  var P, E;
4160
4160
  return /* @__PURE__ */ b(
4161
4161
  "div",
@@ -4188,20 +4188,20 @@ const No = R.object().shape({
4188
4188
  register: f,
4189
4189
  name: `dataColumns.${K}.type`,
4190
4190
  setValue: N,
4191
- trigger: k,
4191
+ trigger: C,
4192
4192
  value: A.dataColumns[K].type
4193
4193
  }
4194
4194
  ) }),
4195
4195
  /* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
4196
- z,
4196
+ W,
4197
4197
  {
4198
4198
  watch: S,
4199
4199
  label: K === 0 ? "Display header" : "",
4200
4200
  name: `dataColumns.${K}.headerName`,
4201
4201
  register: f,
4202
- onChange: (O) => {
4203
- const U = O.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
4204
- N(`dataColumns.${K}.field`, U, {
4202
+ onChange: (q) => {
4203
+ const j = q.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
4204
+ N(`dataColumns.${K}.field`, j, {
4205
4205
  shouldValidate: !0,
4206
4206
  shouldDirty: !0
4207
4207
  });
@@ -4212,7 +4212,7 @@ const No = R.object().shape({
4212
4212
  }
4213
4213
  ) }),
4214
4214
  /* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
4215
- z,
4215
+ W,
4216
4216
  {
4217
4217
  watch: S,
4218
4218
  label: K === 0 ? "Field key" : "",
@@ -4227,16 +4227,16 @@ const No = R.object().shape({
4227
4227
  /* @__PURE__ */ i(
4228
4228
  "button",
4229
4229
  {
4230
- disabled: $.length === 1,
4230
+ disabled: X.length === 1,
4231
4231
  type: "button",
4232
4232
  className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
4233
4233
  onClick: () => _(K),
4234
- children: /* @__PURE__ */ i(J, { icon: "iconamoon:sign-times-fill" })
4234
+ children: /* @__PURE__ */ i(z, { icon: "iconamoon:sign-times-fill" })
4235
4235
  }
4236
4236
  )
4237
4237
  ] }),
4238
4238
  ((E = (P = A.dataColumns) == null ? void 0 : P[K]) == null ? void 0 : E.type) === "select" && /* @__PURE__ */ i("div", { className: "flex items-center gap-x-4", children: /* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
4239
- z,
4239
+ W,
4240
4240
  {
4241
4241
  watch: S,
4242
4242
  label: "Options API URL",
@@ -4259,30 +4259,30 @@ const No = R.object().shape({
4259
4259
  {
4260
4260
  type: "button",
4261
4261
  className: "flex items-center mt-2 text-sm font-medium text-gray-700 gap-x-1",
4262
- onClick: () => be({
4262
+ onClick: () => he({
4263
4263
  headerName: "",
4264
4264
  field: "",
4265
4265
  editable: !0,
4266
- id: me(),
4266
+ id: pe(),
4267
4267
  type: "text",
4268
4268
  validate: !1
4269
4269
  }),
4270
4270
  children: [
4271
- /* @__PURE__ */ i(J, { icon: "qlementine-icons:plus-16" }),
4271
+ /* @__PURE__ */ i(z, { icon: "qlementine-icons:plus-16" }),
4272
4272
  " Add column"
4273
4273
  ]
4274
4274
  }
4275
4275
  )
4276
4276
  ] })
4277
4277
  ] }), Me = Y(async () => {
4278
- const B = oe("token"), { status: K, data: P } = await Pe.get(A.url, {
4278
+ const B = de("token"), { status: K, data: P } = await Pe.get(A.url, {
4279
4279
  headers: {
4280
4280
  Authorization: `Bearer ${B}`
4281
4281
  }
4282
4282
  });
4283
4283
  K === 200 && N("options", (P == null ? void 0 : P.data) || P);
4284
4284
  }, [N, A.url]);
4285
- j(() => {
4285
+ G(() => {
4286
4286
  a.type === "document" && A.url && Me();
4287
4287
  }, [A.url, a.type, Me]);
4288
4288
  const Ee = /* @__PURE__ */ i(
@@ -4300,7 +4300,7 @@ const No = R.object().shape({
4300
4300
  {
4301
4301
  className: "bg-white h-10 w-10 flex justify-center items-center absolute top-1 -left-12 rounded-lg hover:bg-gray-50",
4302
4302
  onClick: n,
4303
- children: /* @__PURE__ */ i(J, { icon: "tabler:x", iconClass: "text-xl" })
4303
+ children: /* @__PURE__ */ i(z, { icon: "tabler:x", iconClass: "text-xl" })
4304
4304
  }
4305
4305
  ),
4306
4306
  /* @__PURE__ */ i("div", { className: "w-full pt-4", children: /* @__PURE__ */ i(
@@ -4323,8 +4323,8 @@ const No = R.object().shape({
4323
4323
  " ",
4324
4324
  /* @__PURE__ */ b("div", { className: " max-h-[70vh] overflow-y-auto flex-1", children: [
4325
4325
  d === "basic" && /* @__PURE__ */ b("div", { className: "z-10 flex flex-col w-full gap-5 px-6", children: [
4326
- li.includes(a.inputType) && /* @__PURE__ */ i(re, { children: /* @__PURE__ */ i(
4327
- z,
4326
+ li.includes(a.inputType) && /* @__PURE__ */ i(ve, { children: /* @__PURE__ */ i(
4327
+ W,
4328
4328
  {
4329
4329
  watch: S,
4330
4330
  label: "Value",
@@ -4334,9 +4334,9 @@ const No = R.object().shape({
4334
4334
  element: a
4335
4335
  }
4336
4336
  ) }),
4337
- !li.includes(a.inputType) && !We.includes(a.inputType) && /* @__PURE__ */ b(re, { children: [
4337
+ !li.includes(a.inputType) && !We.includes(a.inputType) && /* @__PURE__ */ b(ve, { children: [
4338
4338
  /* @__PURE__ */ i(
4339
- z,
4339
+ W,
4340
4340
  {
4341
4341
  watch: S,
4342
4342
  label: "Label",
@@ -4348,7 +4348,7 @@ const No = R.object().shape({
4348
4348
  ),
4349
4349
  " ",
4350
4350
  a.type.toLowerCase() === "cascadeselect" && /* @__PURE__ */ i(
4351
- z,
4351
+ W,
4352
4352
  {
4353
4353
  watch: S,
4354
4354
  label: "Child Label",
@@ -4360,7 +4360,7 @@ const No = R.object().shape({
4360
4360
  )
4361
4361
  ] }),
4362
4362
  so.includes(a.inputType) && /* @__PURE__ */ i(
4363
- z,
4363
+ W,
4364
4364
  {
4365
4365
  watch: S,
4366
4366
  label: "Placeholder",
@@ -4371,7 +4371,7 @@ const No = R.object().shape({
4371
4371
  }
4372
4372
  ),
4373
4373
  ao.includes(a.inputType) && /* @__PURE__ */ i(
4374
- z,
4374
+ W,
4375
4375
  {
4376
4376
  watch: S,
4377
4377
  label: "Prefix",
@@ -4384,7 +4384,7 @@ const No = R.object().shape({
4384
4384
  to.includes(a.inputType) && /* @__PURE__ */ b("div", { className: "grid gap-y-4", children: [
4385
4385
  /* @__PURE__ */ i(bo, {}),
4386
4386
  /* @__PURE__ */ i(
4387
- z,
4387
+ W,
4388
4388
  {
4389
4389
  watch: S,
4390
4390
  label: "Api Url",
@@ -4411,7 +4411,7 @@ const No = R.object().shape({
4411
4411
  register: f,
4412
4412
  name: "method",
4413
4413
  setValue: N,
4414
- trigger: k,
4414
+ trigger: C,
4415
4415
  value: S("method")
4416
4416
  }
4417
4417
  ),
@@ -4432,7 +4432,7 @@ const No = R.object().shape({
4432
4432
  register: f,
4433
4433
  name: "responseType",
4434
4434
  setValue: N,
4435
- trigger: k,
4435
+ trigger: C,
4436
4436
  value: S("responseType")
4437
4437
  }
4438
4438
  )
@@ -4447,7 +4447,7 @@ const No = R.object().shape({
4447
4447
  }
4448
4448
  ),
4449
4449
  !li.includes(a.inputType) && !We.includes(a.inputType) && /* @__PURE__ */ i(
4450
- z,
4450
+ W,
4451
4451
  {
4452
4452
  watch: S,
4453
4453
  label: "Short Description",
@@ -4457,7 +4457,7 @@ const No = R.object().shape({
4457
4457
  element: a
4458
4458
  }
4459
4459
  ),
4460
- a.type.toLowerCase() === "date" && /* @__PURE__ */ b(re, { children: [
4460
+ a.type.toLowerCase() === "date" && /* @__PURE__ */ b(ve, { children: [
4461
4461
  /* @__PURE__ */ i(
4462
4462
  Ie,
4463
4463
  {
@@ -4466,12 +4466,12 @@ const No = R.object().shape({
4466
4466
  register: f,
4467
4467
  name: "dateFormat",
4468
4468
  setValue: N,
4469
- trigger: k,
4469
+ trigger: C,
4470
4470
  value: S("dateFormat")
4471
4471
  }
4472
4472
  ),
4473
4473
  /* @__PURE__ */ i(
4474
- z,
4474
+ W,
4475
4475
  {
4476
4476
  watch: S,
4477
4477
  label: "Allow Range",
@@ -4505,7 +4505,7 @@ const No = R.object().shape({
4505
4505
  )
4506
4506
  ] }),
4507
4507
  /* @__PURE__ */ i(
4508
- z,
4508
+ W,
4509
4509
  {
4510
4510
  watch: S,
4511
4511
  label: "Allow Year Picker",
@@ -4519,7 +4519,7 @@ const No = R.object().shape({
4519
4519
  )
4520
4520
  ] }),
4521
4521
  a.type.toLowerCase() === "country" && /* @__PURE__ */ i(
4522
- z,
4522
+ W,
4523
4523
  {
4524
4524
  watch: S,
4525
4525
  label: "Allow States",
@@ -4548,12 +4548,12 @@ const No = R.object().shape({
4548
4548
  register: f,
4549
4549
  name: "selectType",
4550
4550
  setValue: N,
4551
- trigger: k,
4551
+ trigger: C,
4552
4552
  value: S("selectType")
4553
4553
  }
4554
4554
  ),
4555
4555
  a.type.toLowerCase() === "grid" && /* @__PURE__ */ i(
4556
- z,
4556
+ W,
4557
4557
  {
4558
4558
  watch: S,
4559
4559
  label: "Number of columns (max: 4)",
@@ -4568,7 +4568,7 @@ const No = R.object().shape({
4568
4568
  a.type.toLowerCase() === "document" && /* @__PURE__ */ b("div", { className: "grid gap-y-6", children: [
4569
4569
  /* @__PURE__ */ b("div", { className: "grid gap-y-1", children: [
4570
4570
  /* @__PURE__ */ i(
4571
- z,
4571
+ W,
4572
4572
  {
4573
4573
  watch: S,
4574
4574
  label: "Document Options Url",
@@ -4583,7 +4583,7 @@ const No = R.object().shape({
4583
4583
  ] }),
4584
4584
  /* @__PURE__ */ b("div", { className: "grid gap-y-1", children: [
4585
4585
  /* @__PURE__ */ i(
4586
- z,
4586
+ W,
4587
4587
  {
4588
4588
  watch: S,
4589
4589
  label: "Document Validation Url",
@@ -4596,7 +4596,7 @@ const No = R.object().shape({
4596
4596
  /* @__PURE__ */ i(go, {})
4597
4597
  ] }),
4598
4598
  /* @__PURE__ */ i("div", { className: "grid gap-y-1", children: /* @__PURE__ */ i(
4599
- z,
4599
+ W,
4600
4600
  {
4601
4601
  watch: S,
4602
4602
  label: "Signature Page Url",
@@ -4608,9 +4608,9 @@ const No = R.object().shape({
4608
4608
  ) })
4609
4609
  ] }),
4610
4610
  a.type.toLowerCase() === "datagrid" && Be(),
4611
- a.type.toLowerCase() === "file" && /* @__PURE__ */ b(re, { children: [
4611
+ a.type.toLowerCase() === "file" && /* @__PURE__ */ b(ve, { children: [
4612
4612
  /* @__PURE__ */ i(
4613
- z,
4613
+ W,
4614
4614
  {
4615
4615
  watch: S,
4616
4616
  label: "Allow Multiple Uploads",
@@ -4630,15 +4630,15 @@ const No = R.object().shape({
4630
4630
  id: "acceptedFiles",
4631
4631
  value: A == null ? void 0 : A.acceptedFiles
4632
4632
  },
4633
- validationData: { register: f, setValue: N, trigger: k, watch: S },
4633
+ validationData: { register: f, setValue: N, trigger: C, watch: S },
4634
4634
  placeholder: "Choose file types"
4635
4635
  }
4636
4636
  )
4637
4637
  ] }),
4638
- uo.includes(a.inputType) && ke(),
4638
+ uo.includes(a.inputType) && Ce(),
4639
4639
  /* @__PURE__ */ b("div", { children: [
4640
4640
  /* @__PURE__ */ i("div", { className: "w-[150px] mb-4", children: /* @__PURE__ */ i(
4641
- z,
4641
+ W,
4642
4642
  {
4643
4643
  watch: S,
4644
4644
  label: "Toggle Visibility",
@@ -4656,7 +4656,7 @@ const No = R.object().shape({
4656
4656
  {
4657
4657
  register: f,
4658
4658
  setValue: N,
4659
- trigger: k,
4659
+ trigger: C,
4660
4660
  watch: S,
4661
4661
  id: a == null ? void 0 : a.id
4662
4662
  }
@@ -4679,7 +4679,7 @@ const No = R.object().shape({
4679
4679
  ] }),
4680
4680
  a.type.toLowerCase() === "polling" && /* @__PURE__ */ b("div", { className: "grid gap-y-4 mb-4 mt-2", children: [
4681
4681
  /* @__PURE__ */ i(
4682
- z,
4682
+ W,
4683
4683
  {
4684
4684
  watch: S,
4685
4685
  label: "Fetch results from external API",
@@ -4692,7 +4692,7 @@ const No = R.object().shape({
4692
4692
  }
4693
4693
  ),
4694
4694
  A.fetchExternalResults && /* @__PURE__ */ i(
4695
- z,
4695
+ W,
4696
4696
  {
4697
4697
  watch: S,
4698
4698
  label: "External API URL (returns options results)",
@@ -4708,7 +4708,7 @@ const No = R.object().shape({
4708
4708
  !We.includes(a.type.toLowerCase()) && d === "validation" && /* @__PURE__ */ b("div", { className: "z-10 flex flex-col w-full gap-5 px-6", children: [
4709
4709
  /* @__PURE__ */ b("div", { className: "flex items-center gap-x-6", children: [
4710
4710
  /* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
4711
- z,
4711
+ W,
4712
4712
  {
4713
4713
  watch: S,
4714
4714
  label: "Required",
@@ -4722,7 +4722,7 @@ const No = R.object().shape({
4722
4722
  ) }),
4723
4723
  " ",
4724
4724
  /* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
4725
- z,
4725
+ W,
4726
4726
  {
4727
4727
  watch: S,
4728
4728
  label: "Error message text",
@@ -4733,10 +4733,10 @@ const No = R.object().shape({
4733
4733
  }
4734
4734
  ) })
4735
4735
  ] }),
4736
- oo.includes(a.inputType) && /* @__PURE__ */ b(re, { children: [
4736
+ oo.includes(a.inputType) && /* @__PURE__ */ b(ve, { children: [
4737
4737
  /* @__PURE__ */ b("div", { className: "flex items-center gap-x-6", children: [
4738
4738
  /* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
4739
- z,
4739
+ W,
4740
4740
  {
4741
4741
  watch: S,
4742
4742
  label: "Min Length",
@@ -4749,7 +4749,7 @@ const No = R.object().shape({
4749
4749
  ) }),
4750
4750
  " ",
4751
4751
  /* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
4752
- z,
4752
+ W,
4753
4753
  {
4754
4754
  watch: S,
4755
4755
  label: "Error message text",
@@ -4762,7 +4762,7 @@ const No = R.object().shape({
4762
4762
  ] }),
4763
4763
  /* @__PURE__ */ b("div", { className: "flex items-center gap-x-6", children: [
4764
4764
  /* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
4765
- z,
4765
+ W,
4766
4766
  {
4767
4767
  watch: S,
4768
4768
  label: "Max Length",
@@ -4775,7 +4775,7 @@ const No = R.object().shape({
4775
4775
  ) }),
4776
4776
  " ",
4777
4777
  /* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
4778
- z,
4778
+ W,
4779
4779
  {
4780
4780
  watch: S,
4781
4781
  label: "Error message text",
@@ -4787,10 +4787,10 @@ const No = R.object().shape({
4787
4787
  ) })
4788
4788
  ] })
4789
4789
  ] }),
4790
- lo.includes(a.inputType) && /* @__PURE__ */ b(re, { children: [
4790
+ lo.includes(a.inputType) && /* @__PURE__ */ b(ve, { children: [
4791
4791
  /* @__PURE__ */ b("div", { className: "flex items-center gap-x-6", children: [
4792
4792
  /* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
4793
- z,
4793
+ W,
4794
4794
  {
4795
4795
  watch: S,
4796
4796
  label: "Min Amount",
@@ -4803,7 +4803,7 @@ const No = R.object().shape({
4803
4803
  ) }),
4804
4804
  " ",
4805
4805
  /* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
4806
- z,
4806
+ W,
4807
4807
  {
4808
4808
  watch: S,
4809
4809
  label: "Error message text",
@@ -4816,7 +4816,7 @@ const No = R.object().shape({
4816
4816
  ] }),
4817
4817
  /* @__PURE__ */ b("div", { className: "flex items-center gap-x-6", children: [
4818
4818
  /* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
4819
- z,
4819
+ W,
4820
4820
  {
4821
4821
  watch: S,
4822
4822
  label: "Max Amount",
@@ -4829,7 +4829,7 @@ const No = R.object().shape({
4829
4829
  ) }),
4830
4830
  " ",
4831
4831
  /* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
4832
- z,
4832
+ W,
4833
4833
  {
4834
4834
  watch: S,
4835
4835
  label: "Error message text",
@@ -4858,10 +4858,10 @@ const No = R.object().shape({
4858
4858
  "button",
4859
4859
  {
4860
4860
  type: "submit",
4861
- disabled: !M || C,
4861
+ disabled: !M || k,
4862
4862
  style: { background: (y == null ? void 0 : y.buttonColor) || "#333" },
4863
- className: `flex-1 px-4 py-2.5 ${!M || C ? "bg-[#F2F4F7]" : "bg-[#2563EB]"} ${!M || C ? "text-[#98A2B3]" : "text-white"} rounded-lg shadow-xs font-semibold font-onest disabled:opacity-50 editor_option__save`,
4864
- children: C ? "Saving..." : "Save"
4863
+ className: `flex-1 px-4 py-2.5 ${!M || k ? "bg-[#F2F4F7]" : "bg-[#2563EB]"} ${!M || k ? "text-[#98A2B3]" : "text-white"} rounded-lg shadow-xs font-semibold font-onest disabled:opacity-50 editor_option__save`,
4864
+ children: k ? "Saving..." : "Save"
4865
4865
  }
4866
4866
  )
4867
4867
  ] })
@@ -4875,7 +4875,7 @@ const No = R.object().shape({
4875
4875
  }, Ti = Ze(
4876
4876
  ({ state: e, element: n, children: a }) => {
4877
4877
  var c, r;
4878
- const [s, o] = D(!1), { removeElement: l, duplicateElement: d, updateElement: u } = ae.useContext(ce), t = X(
4878
+ const [s, o] = D(!1), { removeElement: l, duplicateElement: d, updateElement: u } = se.useContext(be), t = ee(
4879
4879
  () => {
4880
4880
  var h;
4881
4881
  return (h = n == null ? void 0 : n.acceptedFiles) == null ? void 0 : h.map((v) => v.label).join(", ");
@@ -4886,7 +4886,7 @@ const No = R.object().shape({
4886
4886
  }, [n.id, n.sectionId, l]);
4887
4887
  return /* @__PURE__ */ b("div", { className: "w-full min-w-0", children: [
4888
4888
  s && /* @__PURE__ */ i(
4889
- ko,
4889
+ Co,
4890
4890
  {
4891
4891
  isOpen: s,
4892
4892
  onClose: () => o(!1),
@@ -4929,7 +4929,7 @@ const No = R.object().shape({
4929
4929
  className: "text-sm outline-none hover:opacity-80 py-1 text-gray-600",
4930
4930
  onClick: () => d(n == null ? void 0 : n.id, n.sectionId),
4931
4931
  title: "Duplicate",
4932
- children: /* @__PURE__ */ i(J, { icon: "tabler:copy", iconClass: "text-base" })
4932
+ children: /* @__PURE__ */ i(z, { icon: "tabler:copy", iconClass: "text-base" })
4933
4933
  }
4934
4934
  ),
4935
4935
  /* @__PURE__ */ i(
@@ -4939,7 +4939,7 @@ const No = R.object().shape({
4939
4939
  className: "text-sm outline-none hover:opacity-80 text-gray-600 py-1",
4940
4940
  onClick: () => o(!0),
4941
4941
  title: "Edit",
4942
- children: /* @__PURE__ */ i(J, { icon: "circum:edit", iconClass: "text-base" })
4942
+ children: /* @__PURE__ */ i(z, { icon: "circum:edit", iconClass: "text-base" })
4943
4943
  }
4944
4944
  ),
4945
4945
  /* @__PURE__ */ i(
@@ -4949,12 +4949,13 @@ const No = R.object().shape({
4949
4949
  className: "text-sm outline-none hover:opacity-80 text-gray-600 py-1",
4950
4950
  onClick: m,
4951
4951
  title: "Remove",
4952
- children: /* @__PURE__ */ i(J, { icon: "iconamoon:trash", iconClass: "text-base" })
4952
+ children: /* @__PURE__ */ i(z, { icon: "iconamoon:trash", iconClass: "text-base" })
4953
4953
  }
4954
4954
  )
4955
4955
  ] })
4956
4956
  ] }),
4957
- a
4957
+ a,
4958
+ n.description && /* @__PURE__ */ i("small", { className: "block text-gray-400 mt-1 text-xs", children: n.description })
4958
4959
  ] });
4959
4960
  }
4960
4961
  );
@@ -4972,7 +4973,7 @@ function Mo({
4972
4973
  } = n || {};
4973
4974
  let u;
4974
4975
  return l && (u = l()[e.id]), /* @__PURE__ */ i(
4975
- z,
4976
+ W,
4976
4977
  {
4977
4978
  placeholder: e.placeholder,
4978
4979
  type: e.inputType,
@@ -5084,41 +5085,41 @@ function Bo({
5084
5085
  element: e,
5085
5086
  validationData: n
5086
5087
  }) {
5087
- var C;
5088
+ var k;
5088
5089
  const { register: a = () => ({}), setValue: s, watch: o } = n || {}, [l, d] = D(), [u, t] = D(!1), [m, c] = D(!1), [r, h] = D(""), v = o && o(e == null ? void 0 : e.id);
5089
- j(() => {
5090
+ G(() => {
5090
5091
  d(v);
5091
5092
  }, [v]);
5092
5093
  const [y, f] = D("");
5093
- j(() => {
5094
+ G(() => {
5094
5095
  a(e.id);
5095
5096
  }, [e.id, a]);
5096
- const { url: g, method: p, responseType: N } = e || {}, k = {
5097
+ const { url: g, method: p, responseType: N } = e || {}, C = {
5097
5098
  headers: {
5098
- Authorization: `Bearer ${oe("token")}`
5099
+ Authorization: `Bearer ${de("token")}`
5099
5100
  }
5100
5101
  }, x = Y(
5101
5102
  async (M) => {
5102
- var w, A, T, I, L, W, Z, ee, $, be, _;
5103
+ var w, A, T, I, L, F, Z, ie, X, he, _;
5103
5104
  if (!(!g || !p)) {
5104
5105
  t(!0);
5105
5106
  try {
5106
5107
  let V;
5107
5108
  if (p.toLowerCase() === "get") {
5108
- const de = `${g}?value=${M}`;
5109
- V = await Pe.get(de, k);
5109
+ const ce = `${g}?value=${M}`;
5110
+ V = await Pe.get(ce, C);
5110
5111
  } else if (p.toLowerCase() === "post")
5111
- V = await Pe.post(g, { value: M }, k);
5112
+ V = await Pe.post(g, { value: M }, C);
5112
5113
  else
5113
5114
  throw new Error("Unsupported HTTP method");
5114
5115
  V.status === 200 && ((((A = (w = V == null ? void 0 : V.data) == null ? void 0 : w.data) == null ? void 0 : A.status) || ((T = V == null ? void 0 : V.data) == null ? void 0 : T.status)) === !0 ? (c(!0), N === "string" ? h(
5115
- ((L = (I = V == null ? void 0 : V.data) == null ? void 0 : I.data) == null ? void 0 : L.description) || ((W = V == null ? void 0 : V.data) == null ? void 0 : W.description) || "Validation successful"
5116
+ ((L = (I = V == null ? void 0 : V.data) == null ? void 0 : I.data) == null ? void 0 : L.description) || ((F = V == null ? void 0 : V.data) == null ? void 0 : F.description) || "Validation successful"
5116
5117
  ) : f(
5117
- ((ee = (Z = V == null ? void 0 : V.data) == null ? void 0 : Z.data) == null ? void 0 : ee.description) || (($ = V == null ? void 0 : V.data) == null ? void 0 : $.description) || {}
5118
+ ((ie = (Z = V == null ? void 0 : V.data) == null ? void 0 : Z.data) == null ? void 0 : ie.description) || ((X = V == null ? void 0 : V.data) == null ? void 0 : X.description) || {}
5118
5119
  )) : (console.error("Invalid input:", M), h("Unable to validate input"), c(!1)));
5119
5120
  } catch (V) {
5120
5121
  console.error("Error validating input:", V), h(
5121
- ((_ = (be = V == null ? void 0 : V.response) == null ? void 0 : be.data) == null ? void 0 : _.message) || "Unable to validate input"
5122
+ ((_ = (he = V == null ? void 0 : V.response) == null ? void 0 : he.data) == null ? void 0 : _.message) || "Unable to validate input"
5122
5123
  ), c(!1);
5123
5124
  } finally {
5124
5125
  t(!1);
@@ -5127,7 +5128,7 @@ function Bo({
5127
5128
  },
5128
5129
  [p, N, g]
5129
5130
  );
5130
- return j(() => {
5131
+ return G(() => {
5131
5132
  if (l) {
5132
5133
  const M = setTimeout(() => {
5133
5134
  x(l);
@@ -5141,7 +5142,7 @@ function Bo({
5141
5142
  {
5142
5143
  placeholder: (e == null ? void 0 : e.placeholder) || "",
5143
5144
  type: (e == null ? void 0 : e.inputType) || "text",
5144
- className: q("field-control", e == null ? void 0 : e.customClass),
5145
+ className: J("field-control", e == null ? void 0 : e.customClass),
5145
5146
  ...a(e == null ? void 0 : e.id),
5146
5147
  onChange: (M) => {
5147
5148
  d(M.target.value), s(e == null ? void 0 : e.id, M.target.value);
@@ -5183,7 +5184,7 @@ function Bo({
5183
5184
  }
5184
5185
  )
5185
5186
  ] }),
5186
- m && !u && /* @__PURE__ */ i("span", { className: "block pr-3 text-lg text-green-600", children: /* @__PURE__ */ i(J, { icon: "gg:check-o" }) })
5187
+ m && !u && /* @__PURE__ */ i("span", { className: "block pr-3 text-lg text-green-600", children: /* @__PURE__ */ i(z, { icon: "gg:check-o" }) })
5187
5188
  ] })
5188
5189
  ] }),
5189
5190
  r && N === "string" && /* @__PURE__ */ i(
@@ -5193,7 +5194,7 @@ function Bo({
5193
5194
  children: r
5194
5195
  }
5195
5196
  ),
5196
- N === "object" && /* @__PURE__ */ i("div", { className: "grid grid-cols-2 gap-6 mt-2 text-sm text-gray-600", children: (C = Object.entries(y)) == null ? void 0 : C.map(([M, w]) => /* @__PURE__ */ b("div", { className: "flex items-center gap-x-2", children: [
5197
+ N === "object" && /* @__PURE__ */ i("div", { className: "grid grid-cols-2 gap-6 mt-2 text-sm text-gray-600", children: (k = Object.entries(y)) == null ? void 0 : k.map(([M, w]) => /* @__PURE__ */ b("div", { className: "flex items-center gap-x-2", children: [
5197
5198
  /* @__PURE__ */ b("span", { className: "font-semibold", children: [
5198
5199
  M,
5199
5200
  ":"
@@ -5221,16 +5222,16 @@ function Eo({
5221
5222
  function u(m, c) {
5222
5223
  return parseFloat(m) * parseFloat(c) || 0;
5223
5224
  }
5224
- const t = X(
5225
+ const t = ee(
5225
5226
  () => o.reduce((m, c) => {
5226
5227
  const r = u(c.key, c.value);
5227
5228
  return m + r;
5228
5229
  }, 0),
5229
5230
  [o]
5230
5231
  );
5231
- return j(() => {
5232
+ return G(() => {
5232
5233
  e && e(o);
5233
- }, [o]), j(() => {
5234
+ }, [o]), G(() => {
5234
5235
  if (s != null && s.length) {
5235
5236
  const m = s == null ? void 0 : s.map((c, r) => ({
5236
5237
  key: c.value,
@@ -5281,7 +5282,7 @@ function Lo({
5281
5282
  validationData: n
5282
5283
  }) {
5283
5284
  const { register: a = () => ({}), setValue: s, getValues: o } = n || {}, l = o && o(e == null ? void 0 : e.id) || [];
5284
- return j(() => {
5285
+ return G(() => {
5285
5286
  a(e.id);
5286
5287
  }, [e.id, a]), /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
5287
5288
  Eo,
@@ -5296,10 +5297,10 @@ function Lo({
5296
5297
  ) });
5297
5298
  }
5298
5299
  function Po({ element: e }) {
5299
- return /* @__PURE__ */ i("div", { className: q("py-6", e == null ? void 0 : e.customClass) });
5300
+ return /* @__PURE__ */ i("div", { className: J("py-6", e == null ? void 0 : e.customClass) });
5300
5301
  }
5301
5302
  function Ro({ element: e }) {
5302
- return /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i("hr", { className: q("border-gray-200 my-4", e == null ? void 0 : e.customClass) }) });
5303
+ return /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i("hr", { className: J("border-gray-200 my-4", e == null ? void 0 : e.customClass) }) });
5303
5304
  }
5304
5305
  function Do({
5305
5306
  element: e,
@@ -5320,7 +5321,7 @@ function Io({
5320
5321
  element: e,
5321
5322
  state: n
5322
5323
  }) {
5323
- return /* @__PURE__ */ i(re, { children: /* @__PURE__ */ i("div", { className: e == null ? void 0 : e.customClass, children: (e == null ? void 0 : e.value) || n === "edit" && /* @__PURE__ */ i("span", { className: "text-gray-400", children: "Provide text" }) }) });
5324
+ return /* @__PURE__ */ i(ve, { children: /* @__PURE__ */ i("div", { className: e == null ? void 0 : e.customClass, children: (e == null ? void 0 : e.value) || n === "edit" && /* @__PURE__ */ i("span", { className: "text-gray-400", children: "Provide text" }) }) });
5324
5325
  }
5325
5326
  function Ko({
5326
5327
  row: e,
@@ -5432,7 +5433,7 @@ function Ko({
5432
5433
  onClick: () => l(e.id),
5433
5434
  className: "text-red-500 hover:text-red-700",
5434
5435
  "aria-label": "Delete row",
5435
- children: /* @__PURE__ */ i(J, { icon: "lets-icons:trash-duotone", iconClass: "text-xl" })
5436
+ children: /* @__PURE__ */ i(z, { icon: "lets-icons:trash-duotone", iconClass: "text-xl" })
5436
5437
  }
5437
5438
  ) })
5438
5439
  ] });
@@ -5444,8 +5445,8 @@ function Go({
5444
5445
  isReadOnly: a = !1,
5445
5446
  columns: s
5446
5447
  }) {
5447
- const [o, l] = D(e), d = oe("config"), u = te(o);
5448
- u.current = o, j(() => {
5448
+ const [o, l] = D(e), d = de("config"), u = re(o);
5449
+ u.current = o, G(() => {
5449
5450
  l((h) => JSON.stringify(h) !== JSON.stringify(e) ? e : h);
5450
5451
  }, [e]);
5451
5452
  const t = Y(
@@ -5457,7 +5458,7 @@ function Go({
5457
5458
  },
5458
5459
  [n]
5459
5460
  ), m = Y(() => {
5460
- const h = me(), v = s.reduce((f, g) => (f[g.field] = g.field === "id" ? h : "", f), {}), y = [...u.current, { id: h, ...v }];
5461
+ const h = pe(), v = s.reduce((f, g) => (f[g.field] = g.field === "id" ? h : "", f), {}), y = [...u.current, { id: h, ...v }];
5461
5462
  l(y), n == null || n(y);
5462
5463
  }, [s, n]), c = Y(
5463
5464
  (h) => {
@@ -5534,10 +5535,10 @@ function jo({
5534
5535
  watch: o,
5535
5536
  isReadOnly: l
5536
5537
  } = n || {}, d = o && o(e == null ? void 0 : e.id) || {}, u = Array.isArray(d) ? d : (v = d == null ? void 0 : d.rows) != null ? v : [];
5537
- j(() => {
5538
+ G(() => {
5538
5539
  a(e.id);
5539
5540
  }, [e.id, a]);
5540
- const t = te(""), m = te(e == null ? void 0 : e.id), c = te(e == null ? void 0 : e.dataColumns), r = te(s);
5541
+ const t = re(""), m = re(e == null ? void 0 : e.id), c = re(e == null ? void 0 : e.dataColumns), r = re(s);
5541
5542
  m.current = e == null ? void 0 : e.id, c.current = e == null ? void 0 : e.dataColumns, r.current = s;
5542
5543
  const h = Y((y) => {
5543
5544
  var g;
@@ -5575,51 +5576,51 @@ const qi = ({
5575
5576
  loading: y,
5576
5577
  disabled: f
5577
5578
  }) => {
5578
- const [g, p] = D(c ? [] : null), N = q("custom-select__control", e), S = X(() => n, [n]);
5579
- return j(() => {
5580
- const k = n == null ? void 0 : n.find((x) => {
5581
- var C;
5582
- return typeof x.value == "string" && typeof t == "string" ? x.value.toLowerCase() === t.toLowerCase() : typeof x.value == "object" && typeof t == "object" ? ((C = x.value) == null ? void 0 : C.id) === (t == null ? void 0 : t.id) : x.value === t;
5579
+ const [g, p] = D(c ? [] : null), N = J("custom-select__control", e), S = ee(() => n, [n]);
5580
+ return G(() => {
5581
+ const C = n == null ? void 0 : n.find((x) => {
5582
+ var k;
5583
+ return typeof x.value == "string" && typeof t == "string" ? x.value.toLowerCase() === t.toLowerCase() : typeof x.value == "object" && typeof t == "object" ? ((k = x.value) == null ? void 0 : k.id) === (t == null ? void 0 : t.id) : x.value === t;
5583
5584
  });
5584
- p(k || null);
5585
- }, [t, n]), j(() => {
5585
+ p(C || null);
5586
+ }, [t, n]), G(() => {
5586
5587
  g && l && o && (l(d, g == null ? void 0 : g.value), o(d), m == null || m(d));
5587
5588
  }, [d, g]), /* @__PURE__ */ b("div", { className: "custom-select", children: [
5588
5589
  u && !r && /* @__PURE__ */ i("label", { className: "custom-select__label", children: u }),
5589
- r && u && /* @__PURE__ */ i("label", { className: q("custom-select__floating-label", v), children: u }),
5590
+ r && u && /* @__PURE__ */ i("label", { className: J("custom-select__floating-label", v), children: u }),
5590
5591
  /* @__PURE__ */ i(
5591
- ne,
5592
+ ae,
5592
5593
  {
5593
5594
  value: g,
5594
5595
  onChange: p,
5595
5596
  multiple: c,
5596
5597
  disabled: f,
5597
5598
  children: /* @__PURE__ */ b("div", { className: "custom-select__wrapper", children: [
5598
- /* @__PURE__ */ b(ne.Button, { className: N, disabled: f, children: [
5599
+ /* @__PURE__ */ b(ae.Button, { className: N, disabled: f, children: [
5599
5600
  y ? /* @__PURE__ */ i("span", { className: "custom-select__loading", children: "Fetching data..." }) : /* @__PURE__ */ i("span", { className: "custom-select__value", children: (g == null ? void 0 : g.label) || /* @__PURE__ */ i("span", { className: "custom-select__placeholder", children: a }) }),
5600
- /* @__PURE__ */ i("span", { className: "custom-select__icon", children: /* @__PURE__ */ i(J, { icon: "lucide:chevron-down" }) })
5601
+ /* @__PURE__ */ i("span", { className: "custom-select__icon", children: /* @__PURE__ */ i(z, { icon: "lucide:chevron-down" }) })
5601
5602
  ] }),
5602
5603
  /* @__PURE__ */ i(
5603
5604
  we,
5604
5605
  {
5605
- as: ae.Fragment,
5606
+ as: se.Fragment,
5606
5607
  leave: "custom-select__transition",
5607
- children: /* @__PURE__ */ i(ne.Options, { className: "custom-select__options", anchor: "bottom", children: S == null ? void 0 : S.map((k, x) => /* @__PURE__ */ i(
5608
- ne.Option,
5608
+ children: /* @__PURE__ */ i(ae.Options, { className: "custom-select__options", anchor: "bottom", children: S == null ? void 0 : S.map((C, x) => /* @__PURE__ */ i(
5609
+ ae.Option,
5609
5610
  {
5610
- value: k,
5611
- className: ({ active: C }) => q(
5611
+ value: C,
5612
+ className: ({ active: k }) => J(
5612
5613
  "custom-select__option",
5613
- C && "custom-select__option--active"
5614
+ k && "custom-select__option--active"
5614
5615
  ),
5615
- children: ({ selected: C }) => /* @__PURE__ */ i(
5616
+ children: ({ selected: k }) => /* @__PURE__ */ i(
5616
5617
  "span",
5617
5618
  {
5618
- className: q(
5619
+ className: J(
5619
5620
  "custom-select__option-label",
5620
- C && "custom-select__option--selected"
5621
+ k && "custom-select__option--selected"
5621
5622
  ),
5622
- children: k.label
5623
+ children: C.label
5623
5624
  }
5624
5625
  )
5625
5626
  },
@@ -5650,7 +5651,7 @@ const qi = ({
5650
5651
  }, v = (g, p) => {
5651
5652
  g === "first" ? (m(p), r(""), h(p, "")) : (r(p), h(t, p));
5652
5653
  };
5653
- j(() => {
5654
+ G(() => {
5654
5655
  if (l) {
5655
5656
  const g = l(u);
5656
5657
  if (g != null && g.includes("_")) {
@@ -5659,7 +5660,7 @@ const qi = ({
5659
5660
  }
5660
5661
  }
5661
5662
  }, [l, u]);
5662
- const y = X(
5663
+ const y = ee(
5663
5664
  () => {
5664
5665
  var g;
5665
5666
  return (g = e.options1) == null ? void 0 : g.filter((p) => p.key === t);
@@ -5710,7 +5711,7 @@ const qi = ({
5710
5711
  watch: r,
5711
5712
  isReadOnly: h
5712
5713
  } = u || {}, v = (p = r == null ? void 0 : r(d.id)) != null ? p : 0, [y, f] = D(null);
5713
- j(() => {
5714
+ G(() => {
5714
5715
  v == null && (c == null || c(d.id, e));
5715
5716
  }, []);
5716
5717
  const g = (N) => {
@@ -5722,12 +5723,12 @@ const qi = ({
5722
5723
  return /* @__PURE__ */ b("div", { className: `flex gap-1 ${l}`, children: [
5723
5724
  /* @__PURE__ */ i("input", { type: "hidden", ...t(d.id) }),
5724
5725
  Array.from({ length: n }, (N, S) => {
5725
- const k = y !== null ? S <= y : S < v;
5726
+ const C = y !== null ? S <= y : S < v;
5726
5727
  return /* @__PURE__ */ i(
5727
5728
  vn,
5728
5729
  {
5729
- icon: k ? "mdi:star" : "mdi:star-outline",
5730
- className: `cursor-pointer transition-colors ${k ? "text-yellow-400" : "text-gray-300"}`,
5730
+ icon: C ? "mdi:star" : "mdi:star-outline",
5731
+ className: `cursor-pointer transition-colors ${C ? "text-yellow-400" : "text-gray-300"}`,
5731
5732
  width: o,
5732
5733
  height: o,
5733
5734
  onMouseEnter: () => !(a || h) && f(S),
@@ -5744,7 +5745,7 @@ function Vo({
5744
5745
  validationData: n
5745
5746
  }) {
5746
5747
  const { register: a = () => ({}) } = n || {}, s = (e == null ? void 0 : e.options) || [], o = (e == null ? void 0 : e.options1) || [];
5747
- return /* @__PURE__ */ i("div", { className: q("w-full overflow-x-auto", e.customClass), children: /* @__PURE__ */ b("table", { className: "w-full text-left border-collapse min-w-[600px] mb-2", children: [
5748
+ return /* @__PURE__ */ i("div", { className: J("w-full overflow-x-auto", e.customClass), children: /* @__PURE__ */ b("table", { className: "w-full text-left border-collapse min-w-[600px] mb-2", children: [
5748
5749
  /* @__PURE__ */ i("thead", { children: /* @__PURE__ */ b("tr", { children: [
5749
5750
  /* @__PURE__ */ i("th", { className: "p-3 border-b bg-gray-50/50" }),
5750
5751
  o.map((l) => /* @__PURE__ */ i(
@@ -5788,14 +5789,14 @@ function _i({
5788
5789
  trigger: o,
5789
5790
  isReadOnly: l,
5790
5791
  watch: d
5791
- } = n || {}, u = (d == null ? void 0 : d(e.id)) || "", { country: t, state: m } = X(() => {
5792
+ } = n || {}, u = (d == null ? void 0 : d(e.id)) || "", { country: t, state: m } = ee(() => {
5792
5793
  var y;
5793
5794
  if (typeof u == "string" && u.includes(",")) {
5794
5795
  const [f, g] = (y = u.split(",")) == null ? void 0 : y.map((p) => p.trim());
5795
5796
  return { country: g, state: f };
5796
5797
  }
5797
5798
  return { country: u, state: "" };
5798
- }, [u]), c = te(u), r = X(() => {
5799
+ }, [u]), c = re(u), r = ee(() => {
5799
5800
  var y, f;
5800
5801
  return t ? ((f = (y = _e.find((g) => g.name === t)) == null ? void 0 : y.states) == null ? void 0 : f.map((g) => ({
5801
5802
  label: g.name,
@@ -5808,7 +5809,7 @@ function _i({
5808
5809
  const g = (f == null ? void 0 : f.value) || "", p = g ? `${g}, ${t}` : t;
5809
5810
  s && p !== c.current && (s(e.id, p), o == null || o(e.id), c.current = p);
5810
5811
  };
5811
- return j(() => {
5812
+ return G(() => {
5812
5813
  c.current = u;
5813
5814
  }, [u]), /* @__PURE__ */ b("div", { className: "grid gap-y-6", children: [
5814
5815
  /* @__PURE__ */ i("input", { type: "hidden", ...a(e.id) }),
@@ -5843,14 +5844,14 @@ function Uo({
5843
5844
  element: e,
5844
5845
  validationData: n
5845
5846
  }) {
5846
- const { register: a = () => ({}), isReadOnly: s } = n || {}, { validationUrl: o, documentObj: l, signatureLink: d } = e, u = X(() => oe("config"), []), [t, m] = D(!1), [c, r] = D(!1), h = Y(async () => {
5847
+ const { register: a = () => ({}), isReadOnly: s } = n || {}, { validationUrl: o, documentObj: l, signatureLink: d } = e, u = ee(() => de("config"), []), [t, m] = D(!1), [c, r] = D(!1), h = Y(async () => {
5847
5848
  var v, y;
5848
5849
  if (!(!o || !l))
5849
5850
  try {
5850
5851
  r(!0);
5851
5852
  const g = {
5852
5853
  headers: {
5853
- Authorization: `Bearer ${oe("token")}`
5854
+ Authorization: `Bearer ${de("token")}`
5854
5855
  }
5855
5856
  }, { data: p } = await Pe.get(
5856
5857
  `${o}/${l}`,
@@ -5863,7 +5864,7 @@ function Uo({
5863
5864
  r(!1);
5864
5865
  }
5865
5866
  }, [o, l]);
5866
- return j(() => {
5867
+ return G(() => {
5867
5868
  let v = null;
5868
5869
  return !t && l && o && (async () => {
5869
5870
  await h() || (v = setInterval(async () => {
@@ -5878,7 +5879,7 @@ function Uo({
5878
5879
  {
5879
5880
  placeholder: e.placeholder,
5880
5881
  type: e.inputType,
5881
- className: q("field-control", e.customClass),
5882
+ className: J("field-control", e.customClass),
5882
5883
  ...a(e.id),
5883
5884
  disabled: s
5884
5885
  }
@@ -5890,13 +5891,13 @@ function Uo({
5890
5891
  onClick: h,
5891
5892
  disabled: c || t,
5892
5893
  style: { background: (u == null ? void 0 : u.buttonColor) || "#333" },
5893
- className: q(
5894
+ className: J(
5894
5895
  "flex items-center gap-x-1 rounded-lg border border-gray-200 bg-gray-200 px-3 py-[10px] text-sm text-white",
5895
5896
  { "!opacity-60": c }
5896
5897
  ),
5897
5898
  children: [
5898
5899
  /* @__PURE__ */ i(
5899
- J,
5900
+ z,
5900
5901
  {
5901
5902
  icon: c ? "solar:refresh-outline" : t ? "solar:check-circle-bold" : "solar:pen-2-line-duotone",
5902
5903
  iconClass: c ? "animate-spin" : ""
@@ -6171,33 +6172,33 @@ function Wo({
6171
6172
  onChange: v,
6172
6173
  onError: y
6173
6174
  }) {
6174
- const [f, g] = D(""), [p, N] = D(null), [S, k] = D(""), x = X(
6175
+ const [f, g] = D(""), [p, N] = D(null), [S, C] = D(""), x = ee(
6175
6176
  () => {
6176
6177
  var L;
6177
- return (L = ui == null ? void 0 : ui.slice().sort((W, Z) => W.label.localeCompare(Z.label))) == null ? void 0 : L.map((W) => ({ ...W, phone: `+${W.phone}` }));
6178
+ return (L = ui == null ? void 0 : ui.slice().sort((F, Z) => F.label.localeCompare(Z.label))) == null ? void 0 : L.map((F) => ({ ...F, phone: `+${F.phone}` }));
6178
6179
  },
6179
6180
  []
6180
- ), C = X(() => f ? x.filter(
6181
+ ), k = ee(() => f ? x.filter(
6181
6182
  (L) => `${L.label} ${L.phone}`.toLowerCase().includes(f.toLowerCase())
6182
6183
  ) : x, [f, x]), M = (p == null ? void 0 : p.min) || 10, w = (p == null ? void 0 : p.max) || 10, A = () => S ? `${(p == null ? void 0 : p.phone) || "+234"}-${S}` : "", T = (L) => {
6183
6184
  if (!L) return { code: "+234", number: "" };
6184
- const W = L.split(/[-\s]/);
6185
- return { code: W[0], number: W.slice(1).join(" ") };
6185
+ const F = L.split(/[-\s]/);
6186
+ return { code: F[0], number: F.slice(1).join(" ") };
6186
6187
  };
6187
- j(() => {
6188
+ G(() => {
6188
6189
  if (d) {
6189
6190
  const L = T(d);
6190
6191
  N(
6191
- x.find((W) => W.phone === L.code) || x[0]
6192
- ), k(L.number);
6192
+ x.find((F) => F.phone === L.code) || x[0]
6193
+ ), C(L.number);
6193
6194
  }
6194
6195
  }, [d, x]);
6195
- const I = X(() => {
6196
+ const I = ee(() => {
6196
6197
  if (u) return u;
6197
6198
  const L = S.length;
6198
6199
  return s && L === 0 ? "Phone number is required" : L > 0 && !/^\d+$/.test(S) ? "Phone number must contain only digits" : L > 0 && L < M ? `Minimum length is ${M}` : L > w ? `Maximum length is ${w}` : "";
6199
6200
  }, [u, S, M, w, s]);
6200
- return j(() => {
6201
+ return G(() => {
6201
6202
  v == null || v(A()), y == null || y(I || null);
6202
6203
  }, [S, p, I]), /* @__PURE__ */ b(
6203
6204
  "div",
@@ -6218,7 +6219,7 @@ function Wo({
6218
6219
  }
6219
6220
  ),
6220
6221
  /* @__PURE__ */ b("div", { className: "relative !flex items-center input-control text-[#667085] !py-0 field-control", children: [
6221
- /* @__PURE__ */ i(J, { icon: "lucide:phone-call" }),
6222
+ /* @__PURE__ */ i(z, { icon: "lucide:phone-call" }),
6222
6223
  /* @__PURE__ */ i(De, { value: p, onChange: N, children: /* @__PURE__ */ b("div", { className: "relative", children: [
6223
6224
  /* @__PURE__ */ i(
6224
6225
  De.Input,
@@ -6229,8 +6230,8 @@ function Wo({
6229
6230
  onChange: (L) => g(L.target.value)
6230
6231
  }
6231
6232
  ),
6232
- /* @__PURE__ */ i(De.Button, { className: "absolute inset-y-0 right-0 flex items-center pr-2", children: /* @__PURE__ */ i(J, { icon: "lucide:chevron-down" }) }),
6233
- /* @__PURE__ */ i(De.Options, { className: "absolute z-10 w-[250px] left-0 bg-white border rounded-md shadow-lg max-h-[400px] overflow-y-auto", children: C == null ? void 0 : C.map((L, W) => /* @__PURE__ */ b(
6233
+ /* @__PURE__ */ i(De.Button, { className: "absolute inset-y-0 right-0 flex items-center pr-2", children: /* @__PURE__ */ i(z, { icon: "lucide:chevron-down" }) }),
6234
+ /* @__PURE__ */ i(De.Options, { className: "absolute z-10 w-[250px] left-0 bg-white border rounded-md shadow-lg max-h-[400px] overflow-y-auto", children: k == null ? void 0 : k.map((L, F) => /* @__PURE__ */ b(
6234
6235
  De.Option,
6235
6236
  {
6236
6237
  value: L,
@@ -6241,7 +6242,7 @@ function Wo({
6241
6242
  L.label
6242
6243
  ]
6243
6244
  },
6244
- `${L.code}+ ${W}`
6245
+ `${L.code}+ ${F}`
6245
6246
  )) })
6246
6247
  ] }) }),
6247
6248
  /* @__PURE__ */ b("div", { className: "relative flex items-center flex-1 z-[1]", children: [
@@ -6254,8 +6255,8 @@ function Wo({
6254
6255
  disabled: t,
6255
6256
  readOnly: m,
6256
6257
  onChange: (L) => {
6257
- const W = L.target.value.replace(/\D/g, "");
6258
- k(W);
6258
+ const F = L.target.value.replace(/\D/g, "");
6259
+ C(F);
6259
6260
  },
6260
6261
  placeholder: n,
6261
6262
  className: "w-full px-3 outline-none",
@@ -6263,7 +6264,7 @@ function Wo({
6263
6264
  minLength: M
6264
6265
  }
6265
6266
  ),
6266
- /* @__PURE__ */ i("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !I && S.length > 0 && !m && /* @__PURE__ */ i("span", { className: "text-green-500", children: /* @__PURE__ */ i(J, { icon: "bi:check-lg" }) }) })
6267
+ /* @__PURE__ */ i("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !I && S.length > 0 && !m && /* @__PURE__ */ i("span", { className: "text-green-500", children: /* @__PURE__ */ i(z, { icon: "bi:check-lg" }) }) })
6267
6268
  ] })
6268
6269
  ] }),
6269
6270
  r && /* @__PURE__ */ i("span", { className: "block text-[#475467] font-light leading-4 text-xs mt-2", children: r })
@@ -6284,7 +6285,7 @@ function zo({
6284
6285
  clearErrors: u
6285
6286
  } = n || {};
6286
6287
  let t;
6287
- return j(() => {
6288
+ return G(() => {
6288
6289
  a(e.id);
6289
6290
  }, [e.id, a]), o && (t = o()[e.id]), /* @__PURE__ */ i(
6290
6291
  Wo,
@@ -6321,7 +6322,7 @@ function Jo({
6321
6322
  {
6322
6323
  placeholder: (e == null ? void 0 : e.placeholder) || "Enter Url link",
6323
6324
  type: "text",
6324
- className: q(
6325
+ className: J(
6325
6326
  "field-control",
6326
6327
  t && "!pl-16",
6327
6328
  e == null ? void 0 : e.customClass
@@ -6358,13 +6359,13 @@ function qo({
6358
6359
  validationData: n
6359
6360
  }) {
6360
6361
  var t;
6361
- const { watch: a, setValue: s } = n || {}, o = (e == null ? void 0 : e.formula) || "", l = X(() => {
6362
+ const { watch: a, setValue: s } = n || {}, o = (e == null ? void 0 : e.formula) || "", l = ee(() => {
6362
6363
  const c = (o.match(/\{\{([^{}]+)\}\}/g) || []).map((v) => v.replace(/[{}]/g, "")), h = (o.match(/@\[.*?\]\((.*?)\)/g) || []).map((v) => {
6363
6364
  const y = /@\[.*?\]\((.*?)\)/.exec(v);
6364
6365
  return y ? y[1] : "";
6365
6366
  }).filter(Boolean);
6366
6367
  return Array.from(/* @__PURE__ */ new Set([...c, ...h]));
6367
- }, [o]), d = a ? a(l) : [], u = X(() => {
6368
+ }, [o]), d = a ? a(l) : [], u = ee(() => {
6368
6369
  if (!o) return "";
6369
6370
  let m = o, c = !1;
6370
6371
  if (l.forEach((r, h) => {
@@ -6380,14 +6381,14 @@ function qo({
6380
6381
  return "Error";
6381
6382
  }
6382
6383
  }, [o, l, d]);
6383
- return j(() => {
6384
+ return G(() => {
6384
6385
  s && u !== "Error" && u !== "" && s(e.id, u, { shouldValidate: !0, shouldDirty: !0 });
6385
6386
  }, [u, e.id, s]), /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
6386
6387
  "input",
6387
6388
  {
6388
6389
  placeholder: (e == null ? void 0 : e.placeholder) || "Calculated result",
6389
6390
  type: "text",
6390
- className: q("field-control bg-gray-100 cursor-not-allowed", e == null ? void 0 : e.customClass),
6391
+ className: J("field-control bg-gray-100 cursor-not-allowed", e == null ? void 0 : e.customClass),
6391
6392
  value: u,
6392
6393
  readOnly: !0,
6393
6394
  disabled: !0,
@@ -6402,7 +6403,7 @@ function _o({
6402
6403
  }) {
6403
6404
  var v;
6404
6405
  const { register: s, watch: o, setValue: l } = n || {}, [d, u] = D({}), [t, m] = D(0), c = o ? o(e.id) : null, r = !!(c || a && a !== "edit");
6405
- j(() => {
6406
+ G(() => {
6406
6407
  if (!e.fetchExternalResults || !e.externalApiUrl) return;
6407
6408
  const y = async () => {
6408
6409
  try {
@@ -6410,11 +6411,11 @@ function _o({
6410
6411
  if (!g.ok) return;
6411
6412
  const p = await g.json();
6412
6413
  let N = {};
6413
- Array.isArray(p) ? p.forEach((k) => {
6414
- const x = k.value || k.id || k.option, C = k.count || k.votes || k.value || 0;
6415
- x && (N[x] = Number(C));
6414
+ Array.isArray(p) ? p.forEach((C) => {
6415
+ const x = C.value || C.id || C.option, k = C.count || C.votes || C.value || 0;
6416
+ x && (N[x] = Number(k));
6416
6417
  }) : typeof p == "object" && (N = p), u(N);
6417
- const S = Object.values(N).reduce((k, x) => k + Number(x), 0);
6418
+ const S = Object.values(N).reduce((C, x) => C + Number(x), 0);
6418
6419
  m(S);
6419
6420
  } catch (g) {
6420
6421
  console.error("Failed to fetch polling results", g);
@@ -6423,7 +6424,7 @@ function _o({
6423
6424
  y();
6424
6425
  const f = setInterval(y, 1e4);
6425
6426
  return () => clearInterval(f);
6426
- }, [e.fetchExternalResults, e.externalApiUrl]), j(() => {
6427
+ }, [e.fetchExternalResults, e.externalApiUrl]), G(() => {
6427
6428
  e.fetchExternalResults || (c ? (u({ [c]: 1 }), m(1)) : (u({}), m(0)));
6428
6429
  }, [c, e.fetchExternalResults]);
6429
6430
  const h = (y) => {
@@ -6436,7 +6437,7 @@ function _o({
6436
6437
  "div",
6437
6438
  {
6438
6439
  onClick: () => h(y.value),
6439
- className: q(
6440
+ className: J(
6440
6441
  "relative flex items-center justify-between p-3 border rounded-lg overflow-hidden transition-all duration-200",
6441
6442
  n != null && n.isReadOnly ? "cursor-default" : "cursor-pointer hover:border-blue-400 hover:bg-blue-50/50",
6442
6443
  p ? "border-blue-500 ring-1 ring-blue-500" : "border-gray-200"
@@ -6453,7 +6454,7 @@ function _o({
6453
6454
  /* @__PURE__ */ i(
6454
6455
  "div",
6455
6456
  {
6456
- className: q(
6457
+ className: J(
6457
6458
  "flex-shrink-0 w-5 h-5 rounded-full border flex items-center justify-center transition-colors",
6458
6459
  p ? "border-blue-500 bg-blue-500" : "border-gray-300 bg-white"
6459
6460
  ),
@@ -6463,7 +6464,7 @@ function _o({
6463
6464
  /* @__PURE__ */ i(
6464
6465
  "span",
6465
6466
  {
6466
- className: q(
6467
+ className: J(
6467
6468
  "font-medium text-sm",
6468
6469
  p ? "text-blue-900" : "text-gray-700"
6469
6470
  ),
@@ -6476,7 +6477,7 @@ function _o({
6476
6477
  g,
6477
6478
  "%"
6478
6479
  ] }),
6479
- p && /* @__PURE__ */ i(J, { icon: "material-symbols:check-circle", iconClass: "text-blue-500 text-lg" })
6480
+ p && /* @__PURE__ */ i(z, { icon: "material-symbols:check-circle", iconClass: "text-blue-500 text-lg" })
6480
6481
  ] }),
6481
6482
  /* @__PURE__ */ i(
6482
6483
  "input",
@@ -6558,7 +6559,7 @@ const fn = {
6558
6559
  }, Xe = ({ col: e, children: n, customClass: a }) => /* @__PURE__ */ i(
6559
6560
  "div",
6560
6561
  {
6561
- className: q("w-full bg-white min-w-0", a),
6562
+ className: J("w-full bg-white min-w-0", a),
6562
6563
  style: { gridColumn: e },
6563
6564
  children: n
6564
6565
  }
@@ -6577,82 +6578,82 @@ const fn = {
6577
6578
  moveElement: m,
6578
6579
  isDragging: c,
6579
6580
  removeElement: r
6580
- } = ye(ce), h = X(
6581
+ } = ye(be), h = ee(
6581
6582
  () => Array.from({ length: e.columns }),
6582
6583
  [e.columns]
6583
6584
  ), [v, y] = D(null);
6584
- j(() => {
6585
- const k = () => {
6585
+ G(() => {
6586
+ const C = () => {
6586
6587
  y(null), t(!1);
6587
6588
  };
6588
- return document.addEventListener("dragend", k), () => document.removeEventListener("dragend", k);
6589
+ return document.addEventListener("dragend", C), () => document.removeEventListener("dragend", C);
6589
6590
  }, [t]);
6590
6591
  const f = Y(
6591
- (k, x) => {
6592
- k.preventDefault(), k.stopPropagation(), k.dataTransfer.dropEffect = "move", y(x);
6592
+ (C, x) => {
6593
+ C.preventDefault(), C.stopPropagation(), C.dataTransfer.dropEffect = "move", y(x);
6593
6594
  },
6594
6595
  []
6595
6596
  ), g = Y(
6596
- (k, x) => {
6597
- k.preventDefault(), k.stopPropagation(), y(x);
6597
+ (C, x) => {
6598
+ C.preventDefault(), C.stopPropagation(), y(x);
6598
6599
  },
6599
6600
  []
6600
6601
  ), p = Y(
6601
- (k, x) => {
6602
- const C = k.relatedTarget;
6603
- C && k.currentTarget.contains(C) || y((M) => M === x ? null : M);
6602
+ (C, x) => {
6603
+ const k = C.relatedTarget;
6604
+ k && C.currentTarget.contains(k) || y((M) => M === x ? null : M);
6604
6605
  },
6605
6606
  []
6606
6607
  ), N = Y(
6607
- (k, x) => {
6608
+ (C, x) => {
6608
6609
  var w;
6609
- k.preventDefault(), k.stopPropagation(), t(!1), y(null);
6610
- const C = x + 1, M = k.dataTransfer.getData("elementId");
6610
+ C.preventDefault(), C.stopPropagation(), t(!1), y(null);
6611
+ const k = x + 1, M = C.dataTransfer.getData("elementId");
6611
6612
  if (M) {
6612
6613
  m({
6613
6614
  draggedId: M,
6614
6615
  sectionId: n,
6615
6616
  targetGridId: e.id,
6616
- targetCol: C
6617
+ targetCol: k
6617
6618
  });
6618
6619
  return;
6619
6620
  }
6620
6621
  try {
6621
- const A = k.dataTransfer.getData("properties");
6622
+ const A = C.dataTransfer.getData("properties");
6622
6623
  if (!A) return;
6623
6624
  const T = JSON.parse(A);
6624
6625
  if ((T == null ? void 0 : T.type) === "grid") return;
6625
6626
  const I = d.find((Z) => Z.id === n), L = (w = I == null ? void 0 : I.questionData) == null ? void 0 : w.find(
6626
6627
  (Z) => {
6627
- var ee;
6628
- return Z.gridId === e.id && ((ee = Z.gridPosition) == null ? void 0 : ee.col) === C;
6628
+ var ie;
6629
+ return Z.gridId === e.id && ((ie = Z.gridPosition) == null ? void 0 : ie.col) === k;
6629
6630
  }
6630
6631
  );
6631
6632
  L && r(L.id, n);
6632
- const W = {
6633
+ const F = {
6633
6634
  ...T,
6634
- id: me(),
6635
+ id: pe(),
6635
6636
  sectionId: n,
6636
6637
  gridId: e.id,
6637
- gridPosition: { col: C }
6638
+ gridPosition: { col: k }
6638
6639
  };
6639
- u(W, n);
6640
+ u(F, n);
6640
6641
  } catch (A) {
6641
6642
  console.error("Drop failed in grid:", A), t(!1);
6642
6643
  }
6643
6644
  },
6644
6645
  [u, e.id, d, n, t, m]
6645
- ), S = (k, x, C) => {
6646
- var ee, $, be;
6647
- const M = k + 1, w = ($ = (ee = d.find((_) => _.id === n)) == null ? void 0 : ee.questionData) == null ? void 0 : $.find(
6646
+ ), S = (C, x, k) => {
6647
+ var ie, X, he;
6648
+ const M = C + 1, w = (X = (ie = d.find((_) => _.id === n)) == null ? void 0 : ie.questionData) == null ? void 0 : X.find(
6648
6649
  (_) => {
6649
6650
  var V;
6650
6651
  return _.gridId === e.id && ((V = _.gridPosition) == null ? void 0 : V.col) === M;
6651
6652
  }
6652
- ), A = (be = w == null ? void 0 : w.id) != null ? be : null, T = Array.isArray(a) && a.find((_) => {
6653
+ ), A = (he = w == null ? void 0 : w.id) != null ? he : null, T = Array.isArray(a) && a.find((_) => {
6653
6654
  var V;
6654
6655
  return ((V = _ == null ? void 0 : _.props) == null ? void 0 : V.col) === M;
6655
- }), I = c && v === k, L = !!T, W = c && !!l, Z = L && A && C === "edit" ? {
6656
+ }), I = c && v === C, L = !!T, F = c && !!l, Z = L && A && k === "edit" ? {
6656
6657
  draggable: !0,
6657
6658
  onDragStart: (_) => {
6658
6659
  _.stopPropagation(), _.dataTransfer.setData("elementId", A), _.dataTransfer.setData("properties", A), _.dataTransfer.effectAllowed = "move", t(!0);
@@ -6664,45 +6665,45 @@ const fn = {
6664
6665
  return /* @__PURE__ */ i("div", { className: "min-w-0", children: /* @__PURE__ */ b(
6665
6666
  "div",
6666
6667
  {
6667
- id: `grid-cell-${e.id}-${k}`,
6668
+ id: `grid-cell-${e.id}-${C}`,
6668
6669
  ...Z,
6669
- onDrop: (_) => N(_, k),
6670
- onDragEnter: (_) => g(_, k),
6671
- onDragOver: (_) => f(_, k),
6672
- onDragLeave: (_) => p(_, k),
6673
- className: q(
6670
+ onDrop: (_) => N(_, C),
6671
+ onDragEnter: (_) => g(_, C),
6672
+ onDragOver: (_) => f(_, C),
6673
+ onDragLeave: (_) => p(_, C),
6674
+ className: J(
6674
6675
  "relative border rounded-lg min-h-[110px] min-w-0",
6675
6676
  "flex items-center justify-center",
6676
6677
  "transition-all duration-200 ease-in-out",
6677
- C === "edit" ? "py-3 " : "",
6678
- L && C === "edit" && "cursor-grab active:cursor-grabbing border-none",
6678
+ k === "edit" ? "py-3 " : "",
6679
+ L && k === "edit" && "cursor-grab active:cursor-grabbing border-none",
6679
6680
  x,
6680
- !W && !I && "bg-white border-gray-200 text-gray-300",
6681
- W && !I && !L && "bg-blue-50 border-blue-200 border-dashed text-blue-300",
6682
- W && !I && L && "bg-white border-orange-200 border-dashed",
6681
+ !F && !I && "bg-white border-gray-200 text-gray-300",
6682
+ F && !I && !L && "bg-blue-50 border-blue-200 border-dashed text-blue-300",
6683
+ F && !I && L && "bg-white border-orange-200 border-dashed",
6683
6684
  I && !L && "bg-blue-100 border-blue-400 border-dashed shadow-inner scale-[1.01] text-blue-500",
6684
6685
  I && L && "bg-orange-50 border-orange-400 border-dashed shadow-inner scale-[1.01] text-orange-500"
6685
6686
  ),
6686
6687
  children: [
6687
- L && C === "edit" && /* @__PURE__ */ i("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__ */ i(J, { icon: "ph:dots-six-bold" }) }),
6688
+ L && k === "edit" && /* @__PURE__ */ i("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__ */ i(z, { icon: "ph:dots-six-bold" }) }),
6688
6689
  I && !L && /* @__PURE__ */ b("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: [
6689
- /* @__PURE__ */ i(J, { icon: "ph:plus-bold" }),
6690
+ /* @__PURE__ */ i(z, { icon: "ph:plus-bold" }),
6690
6691
  "Drop here"
6691
6692
  ] }),
6692
6693
  I && L && /* @__PURE__ */ i("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" }),
6693
6694
  /* @__PURE__ */ i(
6694
6695
  "div",
6695
6696
  {
6696
- className: q(
6697
+ className: J(
6697
6698
  "w-full select-none min-w-0",
6698
6699
  I && "opacity-50 pointer-events-none"
6699
6700
  ),
6700
- children: T || /* @__PURE__ */ i("span", { className: "flex items-center justify-center text-gray-300", children: C === "edit" && /* @__PURE__ */ i(J, { icon: "ph:plus-bold" }) })
6701
+ children: T || /* @__PURE__ */ i("span", { className: "flex items-center justify-center text-gray-300", children: k === "edit" && /* @__PURE__ */ i(z, { icon: "ph:plus-bold" }) })
6701
6702
  }
6702
6703
  )
6703
6704
  ]
6704
6705
  }
6705
- ) }, k);
6706
+ ) }, C);
6706
6707
  };
6707
6708
  return /* @__PURE__ */ i("div", { className: "relative w-full", children: /* @__PURE__ */ i(
6708
6709
  "div",
@@ -6712,11 +6713,11 @@ const fn = {
6712
6713
  gridTemplateColumns: `repeat(${e.columns}, minmax(0, 1fr))`
6713
6714
  },
6714
6715
  children: h == null ? void 0 : h.map(
6715
- (k, x) => S(x, s, o)
6716
+ (C, x) => S(x, s, o)
6716
6717
  )
6717
6718
  }
6718
6719
  ) });
6719
- }, ei = ae.memo(Zo), $o = "edit";
6720
+ }, ei = se.memo(Zo), $o = "edit";
6720
6721
  function ti({
6721
6722
  index: e,
6722
6723
  onDrop: n,
@@ -6741,13 +6742,13 @@ function ti({
6741
6742
  l(!1), a();
6742
6743
  },
6743
6744
  style: { height: `${o ? 52 : s ? 28 : 4}px` },
6744
- className: q(
6745
+ className: J(
6745
6746
  "w-full rounded-md flex items-center justify-center",
6746
6747
  "transition-all duration-150 ease-in-out overflow-hidden",
6747
6748
  o ? "bg-blue-50 border-2 border-blue-300 border-dashed" : s ? "border-2 border-blue-200 border-dashed" : "border-2 border-transparent"
6748
6749
  ),
6749
6750
  children: o && /* @__PURE__ */ b("span", { className: "flex items-center gap-1 text-blue-500 text-xs font-medium select-none pointer-events-none", children: [
6750
- /* @__PURE__ */ i(J, { icon: "octicon:plus-16" }),
6751
+ /* @__PURE__ */ i(z, { icon: "octicon:plus-16" }),
6751
6752
  "Drop here"
6752
6753
  ] })
6753
6754
  }
@@ -6760,7 +6761,7 @@ function Qo({ elementData: e, sectionId: n }) {
6760
6761
  setIsDragging: o,
6761
6762
  addElementInPosition: l,
6762
6763
  moveElement: d
6763
- } = ye(ce), [u, t] = D(null), m = X(
6764
+ } = ye(be), [u, t] = D(null), m = ee(
6764
6765
  () => {
6765
6766
  var p;
6766
6767
  return ((p = a.find((N) => N.id === n)) == null ? void 0 : p.questionData) || [];
@@ -6774,7 +6775,7 @@ function Qo({ elementData: e, sectionId: n }) {
6774
6775
  ), r = Y(() => {
6775
6776
  t(null), o(!1);
6776
6777
  }, [o]);
6777
- j(() => {
6778
+ G(() => {
6778
6779
  !s && u && t(null);
6779
6780
  }, [s, u]);
6780
6781
  const h = Y(
@@ -6785,10 +6786,10 @@ function Qo({ elementData: e, sectionId: n }) {
6785
6786
  r();
6786
6787
  return;
6787
6788
  }
6788
- const k = m.find((C) => C.id === N), x = m.findIndex(
6789
- (C) => C.id === S
6789
+ const C = m.find((k) => k.id === N), x = m.findIndex(
6790
+ (k) => k.id === S
6790
6791
  );
6791
- k != null && k.gridId && x !== -1 ? d({ draggedId: N, sectionId: n, targetIndex: x }) : d({ draggedId: N, sectionId: n, targetId: S }), t(null), o(!1);
6792
+ C != null && C.gridId && x !== -1 ? d({ draggedId: N, sectionId: n, targetIndex: x }) : d({ draggedId: N, sectionId: n, targetId: S }), t(null), o(!1);
6792
6793
  },
6793
6794
  [n, d, o, r, m]
6794
6795
  ), v = Y(
@@ -6800,12 +6801,12 @@ function Qo({ elementData: e, sectionId: n }) {
6800
6801
  return;
6801
6802
  }
6802
6803
  try {
6803
- const k = JSON.parse(p.dataTransfer.getData("properties"));
6804
- if ((k == null ? void 0 : k.type) === "section") return;
6805
- const x = { ...k, id: me(), sectionId: n };
6804
+ const C = JSON.parse(p.dataTransfer.getData("properties"));
6805
+ if ((C == null ? void 0 : C.type) === "section") return;
6806
+ const x = { ...C, id: pe(), sectionId: n };
6806
6807
  l(x, n, N), t(null);
6807
- } catch (k) {
6808
- console.error("Drop error:", k);
6808
+ } catch (C) {
6809
+ console.error("Drop error:", C);
6809
6810
  }
6810
6811
  },
6811
6812
  [l, n, o, d]
@@ -6821,7 +6822,7 @@ function Qo({ elementData: e, sectionId: n }) {
6821
6822
  },
6822
6823
  onDrop: N ? void 0 : h,
6823
6824
  onDragEnd: r,
6824
- className: q(
6825
+ className: J(
6825
6826
  "cursor-grab active:cursor-grabbing border p-4 w-full rounded-lg",
6826
6827
  "transition-all duration-200 ease-in-out",
6827
6828
  u === p.id ? "opacity-40 scale-[0.98] bg-gray-100 border-dashed border-blue-300 shadow-inner" : u ? "bg-white border-dashed border-blue-200 shadow-sm" : "bg-white border-gray-200 shadow-sm hover:border-blue-300 hover:shadow-md"
@@ -6831,7 +6832,7 @@ function Qo({ elementData: e, sectionId: n }) {
6831
6832
  p.id
6832
6833
  ),
6833
6834
  [u, h, n, c, r]
6834
- ), f = X(() => (e == null ? void 0 : e.reduce((p, N) => (N.gridId && (p[N.gridId] = p[N.gridId] || [], p[N.gridId].push(N)), p), {})) || {}, [e]);
6835
+ ), f = ee(() => (e == null ? void 0 : e.reduce((p, N) => (N.gridId && (p[N.gridId] = p[N.gridId] || [], p[N.gridId].push(N)), p), {})) || {}, [e]);
6835
6836
  if (!(e != null && e.length))
6836
6837
  return /* @__PURE__ */ i(
6837
6838
  "div",
@@ -6857,23 +6858,23 @@ function Qo({ elementData: e, sectionId: n }) {
6857
6858
  g.map((p) => {
6858
6859
  const N = m.findIndex((S) => S.id === p.id);
6859
6860
  if (p.type === "grid") {
6860
- const S = f[p.id] || [], k = u === p.id, x = !!u && !k;
6861
+ const S = f[p.id] || [], C = u === p.id, x = !!u && !C;
6861
6862
  return /* @__PURE__ */ b("div", { className: "flex flex-col gap-0", children: [
6862
6863
  /* @__PURE__ */ i(
6863
6864
  "div",
6864
6865
  {
6865
6866
  id: p.id,
6866
6867
  draggable: !0,
6867
- onDragStart: (C) => c(C, p.id),
6868
- onDragOver: (C) => {
6869
- C.preventDefault(), C.stopPropagation();
6868
+ onDragStart: (k) => c(k, p.id),
6869
+ onDragOver: (k) => {
6870
+ k.preventDefault(), k.stopPropagation();
6870
6871
  },
6871
6872
  onDrop: h,
6872
6873
  onDragEnd: r,
6873
- className: q(
6874
+ className: J(
6874
6875
  "w-full p-4 border rounded-lg cursor-grab active:cursor-grabbing",
6875
6876
  "transition-all duration-200 ease-in-out",
6876
- k ? "opacity-40 scale-[0.98] bg-gray-100 border-dashed border-blue-400 shadow-inner" : x ? "bg-white border-dashed border-blue-200" : "bg-white border-gray-200 shadow-sm hover:border-blue-300 hover:shadow-md"
6877
+ C ? "opacity-40 scale-[0.98] bg-gray-100 border-dashed border-blue-400 shadow-inner" : x ? "bg-white border-dashed border-blue-200" : "bg-white border-gray-200 shadow-sm hover:border-blue-300 hover:shadow-md"
6877
6878
  ),
6878
6879
  children: /* @__PURE__ */ i(Ti, { element: p, state: "edit", children: /* @__PURE__ */ i(
6879
6880
  ei,
@@ -6883,9 +6884,9 @@ function Qo({ elementData: e, sectionId: n }) {
6883
6884
  state: $o,
6884
6885
  draggedElementId: u,
6885
6886
  children: S == null ? void 0 : S.map(
6886
- (C) => {
6887
+ (k) => {
6887
6888
  var M;
6888
- return /* @__PURE__ */ i(Xe, { col: (M = C.gridPosition) == null ? void 0 : M.col, children: y(C, !0) }, C.id);
6889
+ return /* @__PURE__ */ i(Xe, { col: (M = k.gridPosition) == null ? void 0 : M.col, children: y(k, !0) }, k.id);
6889
6890
  }
6890
6891
  )
6891
6892
  }
@@ -6923,8 +6924,8 @@ const Xo = Ze(Qo), es = R.object({
6923
6924
  description: R.string(),
6924
6925
  disabled: R.boolean().default(!1),
6925
6926
  isHidden: R.boolean().default(!1)
6926
- }).required(), ci = oe("config"), is = ({ isOpen: e, onClose: n, section: a }) => {
6927
- const { updateSection: s } = ae.useContext(ce), {
6927
+ }).required(), ci = de("config"), is = ({ isOpen: e, onClose: n, section: a }) => {
6928
+ const { updateSection: s } = se.useContext(be), {
6928
6929
  register: o,
6929
6930
  handleSubmit: l,
6930
6931
  watch: d,
@@ -6934,7 +6935,7 @@ const Xo = Ze(Qo), es = R.object({
6934
6935
  resolver: wi(es),
6935
6936
  defaultValues: a
6936
6937
  });
6937
- if (ae.useEffect(() => {
6938
+ if (se.useEffect(() => {
6938
6939
  e || c();
6939
6940
  }, [e, c]), !e) return null;
6940
6941
  const r = (v) => {
@@ -6948,14 +6949,14 @@ const Xo = Ze(Qo), es = R.object({
6948
6949
  {
6949
6950
  onClick: n,
6950
6951
  className: "absolute right-4 top-4 p-2 text-[#98A2B3] hover:bg-gray-50 rounded-lg",
6951
- children: /* @__PURE__ */ i(J, { icon: "tabler:x" })
6952
+ children: /* @__PURE__ */ i(z, { icon: "tabler:x" })
6952
6953
  }
6953
6954
  )
6954
6955
  ] }),
6955
6956
  /* @__PURE__ */ b("form", { onSubmit: l(r), className: "w-full", children: [
6956
6957
  /* @__PURE__ */ b("div", { className: "w-full px-6 flex flex-col gap-5 z-10", children: [
6957
6958
  /* @__PURE__ */ i(
6958
- z,
6959
+ W,
6959
6960
  {
6960
6961
  label: "Title",
6961
6962
  name: "title",
@@ -6965,7 +6966,7 @@ const Xo = Ze(Qo), es = R.object({
6965
6966
  }
6966
6967
  ),
6967
6968
  /* @__PURE__ */ i(
6968
- z,
6969
+ W,
6969
6970
  {
6970
6971
  label: "Description",
6971
6972
  name: "description",
@@ -6976,7 +6977,7 @@ const Xo = Ze(Qo), es = R.object({
6976
6977
  }
6977
6978
  ),
6978
6979
  /* @__PURE__ */ i(
6979
- z,
6980
+ W,
6980
6981
  {
6981
6982
  label: "Disable Section",
6982
6983
  name: "disabled",
@@ -6989,7 +6990,7 @@ const Xo = Ze(Qo), es = R.object({
6989
6990
  }
6990
6991
  ),
6991
6992
  /* @__PURE__ */ i(
6992
- z,
6993
+ W,
6993
6994
  {
6994
6995
  label: "Hide Section",
6995
6996
  name: "isHidden",
@@ -7033,7 +7034,7 @@ const Xo = Ze(Qo), es = R.object({
7033
7034
  {
7034
7035
  onClick: n,
7035
7036
  className: "absolute right-4 top-4 p-2 text-[#98A2B3] hover:bg-gray-50 rounded-lg",
7036
- children: /* @__PURE__ */ i(J, { icon: "tabler:x" })
7037
+ children: /* @__PURE__ */ i(z, { icon: "tabler:x" })
7037
7038
  }
7038
7039
  )
7039
7040
  ] }),
@@ -7235,16 +7236,19 @@ const Xo = Ze(Qo), es = R.object({
7235
7236
  onReorderSection: r
7236
7237
  }) => {
7237
7238
  var y, f;
7238
- const h = te(null), v = te((y = e == null ? void 0 : e.questionData) == null ? void 0 : y.length);
7239
- return j(() => {
7239
+ const h = re(null), v = re((y = e == null ? void 0 : e.questionData) == null ? void 0 : y.length);
7240
+ return G(() => {
7240
7241
  var g, p;
7241
- ((g = e == null ? void 0 : e.questionData) == null ? void 0 : g.length) > v.current && h.current && requestAnimationFrame(() => {
7242
- var N;
7243
- (N = h.current) == null || N.scrollTo({
7244
- top: h.current.scrollHeight,
7245
- behavior: "smooth"
7242
+ if (((g = e == null ? void 0 : e.questionData) == null ? void 0 : g.length) > v.current) {
7243
+ const N = document.getElementById("section-container");
7244
+ N && requestAnimationFrame(() => {
7245
+ N.scrollTo({
7246
+ top: N.scrollHeight,
7247
+ behavior: "smooth"
7248
+ });
7246
7249
  });
7247
- }), v.current = (p = e == null ? void 0 : e.questionData) == null ? void 0 : p.length;
7250
+ }
7251
+ v.current = (p = e == null ? void 0 : e.questionData) == null ? void 0 : p.length;
7248
7252
  }, [(f = e == null ? void 0 : e.questionData) == null ? void 0 : f.length]), /* @__PURE__ */ i(
7249
7253
  "div",
7250
7254
  {
@@ -7276,7 +7280,7 @@ const Xo = Ze(Qo), es = R.object({
7276
7280
  className: "flex-1 h-full py-4 cursor-grab active:cursor-grabbing flex items-center gap-2",
7277
7281
  title: "Drag to reorder section",
7278
7282
  children: [
7279
- /* @__PURE__ */ i(J, { icon: "material-symbols:drag-indicator", iconClass: "text-gray-400 text-lg" }),
7283
+ /* @__PURE__ */ i(z, { icon: "material-symbols:drag-indicator", iconClass: "text-gray-400 text-lg" }),
7280
7284
  /* @__PURE__ */ i("h2", { className: "font-medium", children: e.title || "Section title" })
7281
7285
  ]
7282
7286
  }
@@ -7288,7 +7292,7 @@ const Xo = Ze(Qo), es = R.object({
7288
7292
  type: "button",
7289
7293
  className: "p-1 text-xs border rounded-lg",
7290
7294
  onClick: () => d(e),
7291
- children: /* @__PURE__ */ i(J, { icon: "fluent:edit-28-regular" })
7295
+ children: /* @__PURE__ */ i(z, { icon: "fluent:edit-28-regular" })
7292
7296
  }
7293
7297
  ),
7294
7298
  t > 1 && /* @__PURE__ */ i(
@@ -7297,7 +7301,7 @@ const Xo = Ze(Qo), es = R.object({
7297
7301
  type: "button",
7298
7302
  className: "p-1 text-xs border rounded-lg",
7299
7303
  onClick: () => u(e.id),
7300
- children: /* @__PURE__ */ i(J, { icon: "lets-icons:trash-duotone-line" })
7304
+ children: /* @__PURE__ */ i(z, { icon: "lets-icons:trash-duotone-line" })
7301
7305
  }
7302
7306
  ),
7303
7307
  /* @__PURE__ */ i(
@@ -7307,7 +7311,7 @@ const Xo = Ze(Qo), es = R.object({
7307
7311
  className: "p-1 text-xs rounded-lg",
7308
7312
  onClick: () => l(n),
7309
7313
  children: /* @__PURE__ */ i(
7310
- J,
7314
+ z,
7311
7315
  {
7312
7316
  icon: o.includes(n) ? "fa6-solid:chevron-up" : "fa6-solid:chevron-down",
7313
7317
  iconClass: "text-base"
@@ -7345,7 +7349,7 @@ const Xo = Ze(Qo), es = R.object({
7345
7349
  e == null ? void 0 : e.id
7346
7350
  );
7347
7351
  }, ss = ({ onAddTemplate: e, templates: n }) => {
7348
- const a = [...as, ...n || []], [s, o] = D(!1), [l, d] = D(!1), u = te(null), t = te(null), {
7352
+ const a = [...as, ...n || []], [s, o] = D(!1), [l, d] = D(!1), u = re(null), t = re(null), {
7349
7353
  removeSection: m,
7350
7354
  // addElement,
7351
7355
  addSection: c,
@@ -7356,11 +7360,11 @@ const Xo = Ze(Qo), es = R.object({
7356
7360
  activeSections: f,
7357
7361
  setActiveSections: g,
7358
7362
  setFormData: p
7359
- } = ye(ce), N = te((r == null ? void 0 : r.length) || 0);
7360
- j(() => {
7363
+ } = ye(be), N = re((r == null ? void 0 : r.length) || 0);
7364
+ G(() => {
7361
7365
  var A;
7362
7366
  v(((A = r[0]) == null ? void 0 : A.id) || null);
7363
- }, []), j(() => {
7367
+ }, []), G(() => {
7364
7368
  (r == null ? void 0 : r.length) > N.current && t.current && requestAnimationFrame(() => {
7365
7369
  var A;
7366
7370
  (A = t.current) == null || A.scrollTo({
@@ -7371,12 +7375,12 @@ const Xo = Ze(Qo), es = R.object({
7371
7375
  }, [r == null ? void 0 : r.length]);
7372
7376
  const S = Y((A) => {
7373
7377
  A.preventDefault(), A.dataTransfer.dropEffect = "move", t.current && (t.current.scrollTop = t.current.scrollHeight);
7374
- }, []), k = Y((A, T) => {
7378
+ }, []), C = Y((A, T) => {
7375
7379
  p((I) => {
7376
- const L = I.findIndex(($) => $.id === A), W = I.findIndex(($) => $.id === T);
7377
- if (L === -1 || W === -1 || L === W) return I;
7378
- const Z = [...I], [ee] = Z.splice(L, 1);
7379
- return Z.splice(W, 0, ee), Z;
7380
+ const L = I.findIndex((X) => X.id === A), F = I.findIndex((X) => X.id === T);
7381
+ if (L === -1 || F === -1 || L === F) return I;
7382
+ const Z = [...I], [ie] = Z.splice(L, 1);
7383
+ return Z.splice(F, 0, ie), Z;
7380
7384
  });
7381
7385
  }, [p]);
7382
7386
  function x(A) {
@@ -7384,36 +7388,35 @@ const Xo = Ze(Qo), es = R.object({
7384
7388
  (T) => T.filter((I) => I !== A)
7385
7389
  ) : g((T) => [...T, A]);
7386
7390
  }
7387
- function C(A) {
7391
+ function k(A) {
7388
7392
  u.current = A, o(!0);
7389
7393
  }
7390
7394
  const M = (A) => {
7391
- var I, L, W, Z;
7392
- const T = (ee, $ = {}) => ({
7393
- ...JSON.parse(JSON.stringify(ee)),
7394
- ...$
7395
+ var I, L, F, Z;
7396
+ const T = (ie, X = {}) => ({
7397
+ ...JSON.parse(JSON.stringify(ie)),
7398
+ ...X
7395
7399
  });
7396
7400
  if (A.sections && Array.isArray(A.sections)) {
7397
- const $ = A.sections.filter(Boolean).map((_) => {
7401
+ const X = A.sections.filter(Boolean).map((_) => {
7398
7402
  var Ae;
7399
- const V = me(), de = (Ae = _.questionData) == null ? void 0 : Ae.map((ve) => T(ve, { id: me(), sectionId: V }));
7400
- if (de) {
7401
- const ve = /* @__PURE__ */ new Map();
7402
- _.questionData.forEach((se, Se) => {
7403
- ve.set(se.id, de[Se].id);
7404
- }), de.forEach((se) => {
7405
- se.gridId && ve.has(se.gridId) && (se.gridId = ve.get(se.gridId));
7403
+ const V = pe(), ce = (Ae = _.questionData) == null ? void 0 : Ae.map((ge) => T(ge, { id: pe(), sectionId: V }));
7404
+ if (ce) {
7405
+ const ge = /* @__PURE__ */ new Map();
7406
+ _.questionData.forEach((ue, Se) => {
7407
+ ge.set(ue.id, ce[Se].id);
7408
+ }), ce.forEach((ue) => {
7409
+ ue.gridId && ge.has(ue.gridId) && (ue.gridId = ge.get(ue.gridId));
7406
7410
  });
7407
7411
  }
7408
- return T(_, { id: V, questionData: de || [] });
7412
+ return T(_, { id: V, questionData: ce || [] });
7409
7413
  });
7410
- r.length === 1 && r[0].title === "" && r[0].description === "" && (!((I = r[0]) != null && I.questionData) || ((W = (L = r[0]) == null ? void 0 : L.questionData) == null ? void 0 : W.length) === 0) ? (p($), $.length > 0 && v((Z = $[0]) == null ? void 0 : Z.id)) : p((_) => [..._, ...$]);
7414
+ r.length === 1 && r[0].title === "" && r[0].description === "" && (!((I = r[0]) != null && I.questionData) || ((F = (L = r[0]) == null ? void 0 : L.questionData) == null ? void 0 : F.length) === 0) ? (p(X), X.length > 0 && v((Z = X[0]) == null ? void 0 : Z.id)) : p((_) => [..._, ...X]);
7411
7415
  }
7412
- }, w = oe("config");
7416
+ }, w = de("config");
7413
7417
  return /* @__PURE__ */ b(
7414
7418
  "div",
7415
7419
  {
7416
- ref: t,
7417
7420
  className: "relative flex flex-col h-full pb-5 mx-auto gap-x-4 ",
7418
7421
  children: [
7419
7422
  s && /* @__PURE__ */ i(
@@ -7428,6 +7431,7 @@ const Xo = Ze(Qo), es = R.object({
7428
7431
  "div",
7429
7432
  {
7430
7433
  id: "section-container",
7434
+ ref: t,
7431
7435
  className: "relative flex flex-col flex-1 w-full gap-y-3 container overflow-y-auto",
7432
7436
  children: [
7433
7437
  r == null ? void 0 : r.map(
@@ -7440,12 +7444,12 @@ const Xo = Ze(Qo), es = R.object({
7440
7444
  setSelectedSection: v,
7441
7445
  activeSections: f,
7442
7446
  toggleSection: x,
7443
- handleSectionEdit: C,
7447
+ handleSectionEdit: k,
7444
7448
  removeSection: m,
7445
7449
  formDataLength: r.length,
7446
7450
  onDragOver: S,
7447
7451
  setIsDragging: h,
7448
- onReorderSection: k
7452
+ onReorderSection: C
7449
7453
  },
7450
7454
  A.id
7451
7455
  )
@@ -7494,8 +7498,8 @@ const Xo = Ze(Qo), es = R.object({
7494
7498
  );
7495
7499
  }, ls = () => {
7496
7500
  const { formData: e, uploadUrl: n } = ye(
7497
- ce
7498
- ), [a, s] = D("multi"), o = oe("config");
7501
+ be
7502
+ ), [a, s] = D("multi"), o = de("config");
7499
7503
  return /* @__PURE__ */ b("div", { className: "flex flex-col h-full w-full", children: [
7500
7504
  /* @__PURE__ */ i("div", { className: "flex justify-center p-3 border-b border-gray-100 bg-gray-50/50", children: /* @__PURE__ */ b("div", { className: "flex bg-gray-200 p-1 rounded-lg text-sm font-medium", children: [
7501
7505
  /* @__PURE__ */ i(
@@ -7530,15 +7534,15 @@ const Xo = Ze(Qo), es = R.object({
7530
7534
  ) })
7531
7535
  ] });
7532
7536
  }, Bi = ({ loadingClass: e }) => {
7533
- const n = q(
7537
+ const n = J(
7534
7538
  "h-full w-full min-h-[300px] flex justify-center items-center",
7535
7539
  e
7536
7540
  );
7537
- return j(() => {
7538
- const a = oe("config"), s = (a == null ? void 0 : a.loaderColor) || "#333";
7541
+ return G(() => {
7542
+ const a = de("config"), s = (a == null ? void 0 : a.loaderColor) || "#333";
7539
7543
  document.documentElement.style.setProperty("--loader-color", s);
7540
7544
  }, []), /* @__PURE__ */ i("div", { className: n, children: /* @__PURE__ */ i("span", { className: "loader" }) });
7541
- }, ds = ae.lazy(() => import("./logic-flow-BCnTaMDm.js"));
7545
+ }, ds = se.lazy(() => import("./logic-flow-C_YsGfPF.js"));
7542
7546
  function us({
7543
7547
  questionData: e,
7544
7548
  uploadUrl: n,
@@ -7546,10 +7550,10 @@ function us({
7546
7550
  templates: s,
7547
7551
  viewMode: o = "canvas"
7548
7552
  }) {
7549
- const { setFormData: l, addSection: d, setUploadUrl: u, showPreview: t, formData: m } = ye(ce);
7550
- j(() => {
7553
+ const { setFormData: l, addSection: d, setUploadUrl: u, showPreview: t, formData: m } = ye(be);
7554
+ G(() => {
7551
7555
  e && e.length > 0 && l(e);
7552
- }, [e, l]), j(() => {
7556
+ }, [e, l]), G(() => {
7553
7557
  u(n);
7554
7558
  }, [n, u]);
7555
7559
  const c = Y((r) => {
@@ -7599,7 +7603,7 @@ const ri = [
7599
7603
  { key: "layoutAndDisplay", title: "Layout & Display" },
7600
7604
  { key: "advancedData", title: "Advanced / Data" }
7601
7605
  ], ts = () => {
7602
- const [e, n] = D(""), { setIsDragging: a, addElement: s, selectedSection: o } = ye(ce), l = Y(
7606
+ const [e, n] = D(""), { setIsDragging: a, addElement: s, selectedSection: o } = ye(be), l = Y(
7603
7607
  (v, y) => {
7604
7608
  if (!o) {
7605
7609
  xe.error("Please select a section to add an element.");
@@ -7616,12 +7620,12 @@ const ri = [
7616
7620
  }
7617
7621
  const y = {
7618
7622
  ...v,
7619
- id: me(),
7623
+ id: pe(),
7620
7624
  sectionId: o
7621
7625
  };
7622
7626
  s(y, o);
7623
7627
  }
7624
- const u = oe("config") || {}, t = u.elementColor, m = u.elementBgColor, c = u.elementBorderColor, r = eo.filter(
7628
+ const u = de("config") || {}, t = u.elementColor, m = u.elementBgColor, c = u.elementBorderColor, r = eo.filter(
7625
7629
  (v) => v.label.toLowerCase().includes(e.toLowerCase())
7626
7630
  ), h = ri == null ? void 0 : ri.map((v) => ({
7627
7631
  title: v.title,
@@ -7664,7 +7668,7 @@ const ri = [
7664
7668
  active:opacity-50 element_class`,
7665
7669
  draggable: !0,
7666
7670
  children: /* @__PURE__ */ b("span", { className: "flex flex-col items-center justify-center w-full gap-2", children: [
7667
- /* @__PURE__ */ i("span", { style: { color: t }, children: /* @__PURE__ */ i(J, { icon: g.icon, iconClass: "w-6 h-6" }) }),
7671
+ /* @__PURE__ */ i("span", { style: { color: t }, children: /* @__PURE__ */ i(z, { icon: g.icon, iconClass: "w-6 h-6" }) }),
7668
7672
  /* @__PURE__ */ i(
7669
7673
  "span",
7670
7674
  {
@@ -7680,7 +7684,7 @@ const ri = [
7680
7684
  ] }, y);
7681
7685
  }) }) })
7682
7686
  ] });
7683
- }, cs = Ze(ts), Ce = ({
7687
+ }, cs = Ze(ts), ke = ({
7684
7688
  text: e = "",
7685
7689
  isDisabled: n = !1,
7686
7690
  isLoading: a = !1,
@@ -7695,14 +7699,14 @@ const ri = [
7695
7699
  style: r,
7696
7700
  onClick: h
7697
7701
  }) => {
7698
- const v = q(
7702
+ const v = J(
7699
7703
  "btn inline-flex justify-center",
7700
7704
  {
7701
7705
  "pointer-events-none": a,
7702
7706
  "opacity-40 cursor-not-allowed": n
7703
7707
  },
7704
7708
  s
7705
- ), y = () => a ? /* @__PURE__ */ b(re, { children: [
7709
+ ), y = () => a ? /* @__PURE__ */ b(ve, { children: [
7706
7710
  /* @__PURE__ */ b(
7707
7711
  "svg",
7708
7712
  {
@@ -7735,9 +7739,9 @@ const ri = [
7735
7739
  ),
7736
7740
  "Submitting..."
7737
7741
  ] }) : /* @__PURE__ */ b("span", { className: "flex items-center", children: [
7738
- o && l === "left" && /* @__PURE__ */ i("span", { className: `mr-[6px] ${d}`, children: /* @__PURE__ */ i(J, { icon: o }) }),
7742
+ o && l === "left" && /* @__PURE__ */ i("span", { className: `mr-[6px] ${d}`, children: /* @__PURE__ */ i(z, { icon: o }) }),
7739
7743
  e && /* @__PURE__ */ i("span", { children: e }),
7740
- o && l === "right" && /* @__PURE__ */ i("span", { className: `ml-[6px] ${d}`, children: /* @__PURE__ */ i(J, { icon: o }) })
7744
+ o && l === "right" && /* @__PURE__ */ i("span", { className: `ml-[6px] ${d}`, children: /* @__PURE__ */ i(z, { icon: o }) })
7741
7745
  ] });
7742
7746
  return m ? /* @__PURE__ */ i("div", { className: v, children: y() }) : t ? /* @__PURE__ */ i(Dn, { to: t, className: v, children: y() }) : /* @__PURE__ */ i(
7743
7747
  "button",
@@ -7793,10 +7797,10 @@ const ms = ({
7793
7797
  onClose: n
7794
7798
  }) => {
7795
7799
  const { formData: a, uploadUrl: s } = ye(
7796
- ce
7800
+ be
7797
7801
  );
7798
7802
  if (!e) return null;
7799
- const o = oe("config");
7803
+ const o = de("config");
7800
7804
  return /* @__PURE__ */ b("div", { className: "fixed inset-0 flex justify-center z-[999] cursor-default no-drag select-none w-screen h-screen pt-20 bg-[#F8F9FC]", children: [
7801
7805
  /* @__PURE__ */ i(
7802
7806
  "button",
@@ -7866,7 +7870,7 @@ function vs({
7866
7870
  redo: f,
7867
7871
  canUndo: g,
7868
7872
  canRedo: p
7869
- } = ye(ce), [N, S] = D(!1), [k, x] = D(!1), [C, M] = D(e || ""), w = oe("config");
7873
+ } = ye(be), [N, S] = D(!1), [C, x] = D(!1), [k, M] = D(e || ""), w = de("config");
7870
7874
  function A() {
7871
7875
  localStorage.setItem("formData", JSON.stringify(r)), a == null || a(r);
7872
7876
  }
@@ -7874,7 +7878,7 @@ function vs({
7874
7878
  localStorage.setItem("formData", JSON.stringify(r)), s == null || s(r);
7875
7879
  }
7876
7880
  function I() {
7877
- x(!1), u && C !== e && u(C.trim());
7881
+ x(!1), u && k !== e && u(k.trim());
7878
7882
  }
7879
7883
  return /* @__PURE__ */ b("div", { className: "px-[30px] py-3 flex justify-between items-center bg-[#F9F9FB] top_bar border-b h-full", children: [
7880
7884
  /* @__PURE__ */ b("span", { className: "flex items-center gap-x-2", children: [
@@ -7889,11 +7893,11 @@ function vs({
7889
7893
  }
7890
7894
  ),
7891
7895
  " ",
7892
- k ? /* @__PURE__ */ i(
7896
+ C ? /* @__PURE__ */ i(
7893
7897
  "input",
7894
7898
  {
7895
7899
  type: "text",
7896
- value: C,
7900
+ value: k,
7897
7901
  onChange: (L) => M(L.target.value),
7898
7902
  onBlur: I,
7899
7903
  autoFocus: !0,
@@ -7905,7 +7909,7 @@ function vs({
7905
7909
  title: "Click to edit",
7906
7910
  className: "text-base font-semibold cursor-pointer form_title",
7907
7911
  onClick: () => x(!0),
7908
- children: C || "Untitled"
7912
+ children: k || "Untitled"
7909
7913
  }
7910
7914
  )
7911
7915
  ] }),
@@ -7928,7 +7932,7 @@ function vs({
7928
7932
  onClick: () => m("canvas"),
7929
7933
  children: [
7930
7934
  /* @__PURE__ */ i(
7931
- J,
7935
+ z,
7932
7936
  {
7933
7937
  icon: "mdi:view-dashboard-outline",
7934
7938
  iconClass: "text-base"
@@ -7947,14 +7951,14 @@ function vs({
7947
7951
  className: `px-3 flex items-center gap-1.5 border-l border-gray-300 transition-colors flow_view ${t === "flow" ? " bg-white font-medium" : "bg-gray-100 text-gray-500 hover:bg-gray-50"}`,
7948
7952
  onClick: () => m("flow"),
7949
7953
  children: [
7950
- /* @__PURE__ */ i(J, { icon: "mdi:sitemap-outline", iconClass: "text-base" }),
7954
+ /* @__PURE__ */ i(z, { icon: "mdi:sitemap-outline", iconClass: "text-base" }),
7951
7955
  " Flow"
7952
7956
  ]
7953
7957
  }
7954
7958
  )
7955
7959
  ] }),
7956
7960
  /* @__PURE__ */ i(
7957
- Ce,
7961
+ ke,
7958
7962
  {
7959
7963
  onClick: y,
7960
7964
  text: "",
@@ -7966,7 +7970,7 @@ function vs({
7966
7970
  }
7967
7971
  ),
7968
7972
  /* @__PURE__ */ i(
7969
- Ce,
7973
+ ke,
7970
7974
  {
7971
7975
  onClick: f,
7972
7976
  text: "",
@@ -7978,7 +7982,7 @@ function vs({
7978
7982
  }
7979
7983
  ),
7980
7984
  c && /* @__PURE__ */ i(
7981
- Ce,
7985
+ ke,
7982
7986
  {
7983
7987
  onClick: c,
7984
7988
  text: "Versions",
@@ -7989,7 +7993,7 @@ function vs({
7989
7993
  }
7990
7994
  ),
7991
7995
  /* @__PURE__ */ i(
7992
- Ce,
7996
+ ke,
7993
7997
  {
7994
7998
  onClick: () => h((L) => !L),
7995
7999
  text: v ? "Hide Preview" : "Preview",
@@ -8002,7 +8006,7 @@ function vs({
8002
8006
  }
8003
8007
  ),
8004
8008
  /* @__PURE__ */ i(
8005
- Ce,
8009
+ ke,
8006
8010
  {
8007
8011
  onClick: A,
8008
8012
  text: "Save",
@@ -8015,7 +8019,7 @@ function vs({
8015
8019
  }
8016
8020
  ),
8017
8021
  /* @__PURE__ */ i(
8018
- Ce,
8022
+ ke,
8019
8023
  {
8020
8024
  onClick: T,
8021
8025
  text: "Publish",
@@ -8103,7 +8107,7 @@ const Hs = ({
8103
8107
  onAddTemplate: f,
8104
8108
  templates: g,
8105
8109
  onShowVersion: p
8106
- }) => (j(() => {
8110
+ }) => (G(() => {
8107
8111
  l && hn("config", l);
8108
8112
  }, [l]), /* @__PURE__ */ i(
8109
8113
  ps,
@@ -8222,29 +8226,23 @@ function xs({ formData: e, isReadOnly: n, answerData: a }) {
8222
8226
  }), R.object().shape(s);
8223
8227
  }
8224
8228
  const Oe = ({ element: e, validationData: n }) => {
8225
- const a = fn[e.type], { answerData: s } = ye(ce), o = X(
8229
+ const a = fn[e.type], { answerData: s } = ye(be), o = ee(
8226
8230
  () => {
8227
8231
  var d;
8228
8232
  return (d = e == null ? void 0 : e.acceptedFiles) == null ? void 0 : d.map((u) => u.label).join(", ");
8229
8233
  },
8230
8234
  [e]
8231
- ), l = X(() => Ei(e, s), [s, e]);
8232
- return a ? /* @__PURE__ */ b("div", { className: `${l ? "" : "invisible h-0"} min-w-0 w-full`, children: [
8233
- /* @__PURE__ */ b("div", { className: "mb-1.5 min-w-0", children: [
8234
- e.inputLabel && /* @__PURE__ */ b("label", { className: "block text-sm font-medium input_label", children: [
8235
- e.inputLabel,
8236
- " ",
8237
- o && /* @__PURE__ */ b("span", { className: "text-gray-400 text-xs", children: [
8238
- "(",
8239
- o == null ? void 0 : o.toLowerCase(),
8240
- ")"
8241
- ] })
8242
- ] }),
8243
- e.description && /* @__PURE__ */ b("small", { className: "block text-gray-400 mt-0.5 text-xs", children: [
8244
- " ",
8245
- e.description
8235
+ ), l = ee(() => Ei(e, s), [s, e]);
8236
+ return a ? /* @__PURE__ */ b("div", { className: `${l ? "" : "hidden"} min-w-0 w-full`, children: [
8237
+ /* @__PURE__ */ i("div", { className: "mb-1.5 min-w-0", children: e.inputLabel && /* @__PURE__ */ b("label", { className: "block text-sm font-medium input_label", children: [
8238
+ e.inputLabel,
8239
+ " ",
8240
+ o && /* @__PURE__ */ b("span", { className: "text-gray-400 text-xs", children: [
8241
+ "(",
8242
+ o == null ? void 0 : o.toLowerCase(),
8243
+ ")"
8246
8244
  ] })
8247
- ] }),
8245
+ ] }) }),
8248
8246
  /* @__PURE__ */ i(
8249
8247
  a,
8250
8248
  {
@@ -8255,7 +8253,8 @@ const Oe = ({ element: e, validationData: n }) => {
8255
8253
  isReadOnly: n.isReadOnly || e.isDisabled
8256
8254
  }
8257
8255
  }
8258
- )
8256
+ ),
8257
+ e.description && /* @__PURE__ */ i("small", { className: "block text-gray-400 mt-0.5 text-xs", children: e.description })
8259
8258
  ] }) : null;
8260
8259
  }, Ge = (e, n) => e != null && e.allowEdit ? { ...n, isReadOnly: !1 } : n;
8261
8260
  function As({ form_data: e, options: n }) {
@@ -8284,7 +8283,7 @@ function As({ form_data: e, options: n }) {
8284
8283
  return /* @__PURE__ */ b(
8285
8284
  "div",
8286
8285
  {
8287
- className: q(
8286
+ className: J(
8288
8287
  "group relative grid gap-y-[6px] min-w-0",
8289
8288
  o.elementClass
8290
8289
  ),
@@ -8359,7 +8358,7 @@ function Ss({ form_data: e, options: n, current: a }) {
8359
8358
  return l.gridId ? null : /* @__PURE__ */ b(
8360
8359
  "div",
8361
8360
  {
8362
- className: q(
8361
+ className: J(
8363
8362
  "group relative grid gap-y-[6px] min-w-0",
8364
8363
  l.elementClass
8365
8364
  ),
@@ -8378,7 +8377,7 @@ function Ss({ form_data: e, options: n, current: a }) {
8378
8377
  );
8379
8378
  }) });
8380
8379
  }
8381
- const mi = oe("config");
8380
+ const mi = de("config");
8382
8381
  function Ns({ element: e, options: n, onNext: a, onPrev: s, isFirst: o, isLast: l, isReadOnly: d }) {
8383
8382
  if (!e)
8384
8383
  return /* @__PURE__ */ i("div", { className: "flex items-center justify-center min-h-[500px] text-gray-500", children: "No questions available." });
@@ -8419,7 +8418,7 @@ function Ns({ element: e, options: n, onNext: a, onPrev: s, isFirst: o, isLast:
8419
8418
  return /* @__PURE__ */ b(
8420
8419
  "div",
8421
8420
  {
8422
- className: q("group relative grid gap-y-[6px] min-w-0 w-full", c.elementClass),
8421
+ className: J("group relative grid gap-y-[6px] min-w-0 w-full", c.elementClass),
8423
8422
  children: [
8424
8423
  /* @__PURE__ */ i(
8425
8424
  Oe,
@@ -8457,7 +8456,7 @@ function Ns({ element: e, options: n, onNext: a, onPrev: s, isFirst: o, isLast:
8457
8456
  /* @__PURE__ */ i("div", { className: "text-left w-full mb-8", children: e.type === "grid" ? t(e) : m(e) }),
8458
8457
  !d && /* @__PURE__ */ b("div", { className: "flex items-center gap-4 mt-8", children: [
8459
8458
  /* @__PURE__ */ i(
8460
- Ce,
8459
+ ke,
8461
8460
  {
8462
8461
  type: "button",
8463
8462
  text: l ? n != null && n.isSubmitting ? "Submitting..." : "Submit" : "OK",
@@ -8469,7 +8468,7 @@ function Ns({ element: e, options: n, onNext: a, onPrev: s, isFirst: o, isLast:
8469
8468
  ),
8470
8469
  !l && /* @__PURE__ */ i("span", { className: "text-xs text-gray-400 font-medium hidden sm:inline-block", children: "press Enter ↵" }),
8471
8470
  !o && /* @__PURE__ */ b("button", { type: "button", onClick: s, className: "text-gray-400 hover:text-gray-600 font-medium text-sm ml-auto flex items-center gap-1 transition-colors", children: [
8472
- /* @__PURE__ */ i(J, { icon: "material-symbols:arrow-upward-rounded", iconClass: "text-lg" }),
8471
+ /* @__PURE__ */ i(z, { icon: "material-symbols:arrow-upward-rounded", iconClass: "text-lg" }),
8473
8472
  "Back"
8474
8473
  ] })
8475
8474
  ] })
@@ -8480,10 +8479,10 @@ function Ns({ element: e, options: n, onNext: a, onPrev: s, isFirst: o, isLast:
8480
8479
  }
8481
8480
  );
8482
8481
  }
8483
- function Cs(e) {
8482
+ function ks(e) {
8484
8483
  return e.reduce((n, a) => (n[a.id] = a.value, n), {});
8485
8484
  }
8486
- const ks = ({
8485
+ const Cs = ({
8487
8486
  form_data: e,
8488
8487
  answerData: n = [],
8489
8488
  ignoreValidation: a = !1,
@@ -8495,180 +8494,180 @@ const ks = ({
8495
8494
  hideFooter: t = !1,
8496
8495
  uploadUrl: m
8497
8496
  }) => {
8498
- var Be, Me, Ee, G, B, K, P, E;
8499
- const { setAnswerData: c, setUploadUrl: r, apiActivityCount: h } = ye(ce), [v, y] = D(0), [f, g] = D(0), p = X(
8500
- () => e.filter((O) => !O.isHidden).map((O) => {
8497
+ var Be, Me, Ee, O, B, K, P, E, q, $;
8498
+ const { setAnswerData: c, setUploadUrl: r, apiActivityCount: h } = ye(be), [v, y] = D(0), [f, g] = D(0), p = ee(
8499
+ () => e.filter((j) => !j.isHidden).map((j) => {
8501
8500
  var U;
8502
- return O.isDisabled || O.disabled ? {
8503
- ...O,
8504
- questionData: (U = O == null ? void 0 : O.questionData) == null ? void 0 : U.map((F) => ({
8505
- ...F,
8501
+ return j.isDisabled || j.disabled ? {
8502
+ ...j,
8503
+ questionData: (U = j == null ? void 0 : j.questionData) == null ? void 0 : U.map((Q) => ({
8504
+ ...Q,
8506
8505
  isDisabled: !0
8507
8506
  }))
8508
- } : O;
8507
+ } : j;
8509
8508
  }),
8510
8509
  [e]
8511
- ), N = (Be = p == null ? void 0 : p.length) != null ? Be : 0, S = oe("config"), k = Y(
8512
- async (O, H, U) => {
8513
- const F = xs({
8510
+ ), N = (Be = p == null ? void 0 : p.length) != null ? Be : 0, S = de("config"), C = Y(
8511
+ async (j, H, U) => {
8512
+ const Q = xs({
8514
8513
  formData: p,
8515
8514
  isReadOnly: l,
8516
- answerData: O
8515
+ answerData: j
8517
8516
  // use current form data to evaluate visibility
8518
8517
  });
8519
- return wi(F)(O, H, U);
8518
+ return wi(Q)(j, H, U);
8520
8519
  },
8521
8520
  [p, l]
8522
8521
  ), x = Ai({
8523
- resolver: k,
8522
+ resolver: C,
8524
8523
  mode: "onSubmit",
8525
8524
  defaultValues: {}
8526
8525
  }), {
8527
- register: C,
8526
+ register: k,
8528
8527
  setValue: M,
8529
8528
  control: w,
8530
8529
  handleSubmit: A,
8531
8530
  reset: T,
8532
8531
  getValues: I,
8533
8532
  watch: L,
8534
- formState: { errors: W, isSubmitting: Z },
8535
- trigger: ee,
8536
- setError: $,
8537
- clearErrors: be
8538
- } = x, _ = Bn({ control: w }), V = X(
8533
+ formState: { errors: F, isSubmitting: Z },
8534
+ trigger: ie,
8535
+ setError: X,
8536
+ clearErrors: he
8537
+ } = x, _ = Bn({ control: w }), V = ee(
8539
8538
  () => _,
8540
8539
  [JSON.stringify(_)]
8541
- ), de = X(() => {
8540
+ ), ce = ee(() => {
8542
8541
  if (d !== "conversational") return [];
8543
- const O = [];
8542
+ const j = [];
8544
8543
  return p.forEach((H) => {
8545
8544
  var U;
8546
- (U = H == null ? void 0 : H.questionData) == null || U.forEach((F) => {
8547
- var Q;
8548
- if (Ei(F, V))
8549
- if (F.type === "grid") {
8550
- const pe = (Q = H == null ? void 0 : H.questionData) == null ? void 0 : Q.filter(
8551
- (he) => he.gridId === F.id
8545
+ (U = H == null ? void 0 : H.questionData) == null || U.forEach((Q) => {
8546
+ var oe;
8547
+ if (Ei(Q, V))
8548
+ if (Q.type === "grid") {
8549
+ const le = (oe = H == null ? void 0 : H.questionData) == null ? void 0 : oe.filter(
8550
+ (me) => me.gridId === Q.id
8552
8551
  );
8553
- O.push({ ...F, gridChildren: pe });
8554
- } else F.gridId || O.push(F);
8552
+ j.push({ ...Q, gridChildren: le });
8553
+ } else Q.gridId || j.push(Q);
8555
8554
  });
8556
- }), O;
8555
+ }), j;
8557
8556
  }, [p, V, d]), Ae = Y(
8558
- (O) => {
8559
- o && o(O);
8557
+ (j) => {
8558
+ o && o(j);
8560
8559
  },
8561
8560
  [o]
8562
8561
  );
8563
- j(() => {
8562
+ G(() => {
8564
8563
  r(m);
8565
- }, [r, m]), j(() => {
8564
+ }, [r, m]), G(() => {
8566
8565
  if (!(p != null && p.length) || !o) return;
8567
- const O = p.flatMap(
8566
+ const j = p.flatMap(
8568
8567
  (H) => {
8569
8568
  var U;
8570
- return (U = H == null ? void 0 : H.questionData) == null ? void 0 : U.map((F) => ({
8571
- id: F.id,
8572
- value: V[F.id] || "",
8569
+ return (U = H == null ? void 0 : H.questionData) == null ? void 0 : U.map((Q) => ({
8570
+ id: Q.id,
8571
+ value: V[Q.id] || "",
8573
8572
  sectionId: H.id,
8574
- type: F.type,
8573
+ type: Q.type,
8575
8574
  metaData: {
8576
- prefix: F.prefix,
8577
- dateFormat: F.dateFormat
8575
+ prefix: Q.prefix,
8576
+ dateFormat: Q.dateFormat
8578
8577
  }
8579
8578
  }));
8580
8579
  }
8581
8580
  );
8582
- Ae(O), c(V);
8581
+ Ae(j), c(V);
8583
8582
  }, [
8584
8583
  V,
8585
8584
  p,
8586
8585
  Ae,
8587
8586
  o,
8588
8587
  c
8589
- ]), j(() => {
8590
- n != null && n.length && T(Cs(n));
8588
+ ]), G(() => {
8589
+ n != null && n.length && T(ks(n));
8591
8590
  }, [n, T]);
8592
- const ve = Y(
8593
- (O) => {
8591
+ const ge = Y(
8592
+ (j) => {
8594
8593
  const H = p.flatMap(
8595
8594
  (U) => {
8596
- var F;
8597
- return (F = U == null ? void 0 : U.questionData) == null ? void 0 : F.map((Q) => ({
8598
- id: Q.id,
8599
- value: O[Q.id] || "",
8595
+ var Q;
8596
+ return (Q = U == null ? void 0 : U.questionData) == null ? void 0 : Q.map((oe) => ({
8597
+ id: oe.id,
8598
+ value: j[oe.id] || "",
8600
8599
  sectionId: U.id,
8601
- type: Q.type,
8600
+ type: oe.type,
8602
8601
  metaData: {
8603
- prefix: Q.prefix,
8604
- dateFormat: Q.dateFormat
8602
+ prefix: oe.prefix,
8603
+ dateFormat: oe.dateFormat
8605
8604
  }
8606
8605
  }));
8607
8606
  }
8608
8607
  );
8609
- Object.keys(W).length > 0 || s == null || s(H);
8608
+ Object.keys(F).length > 0 || s == null || s(H);
8610
8609
  },
8611
- [W, p, s]
8612
- ), se = Y(async () => {
8613
- var O, H;
8610
+ [F, p, s]
8611
+ ), ue = Y(async () => {
8612
+ var j, H;
8614
8613
  if (d === "conversational") {
8615
8614
  if (!a) {
8616
- const U = de[f];
8615
+ const U = ce[f];
8617
8616
  if (!U) return;
8618
- const F = U.gridChildren ? U.gridChildren.map((pe) => pe.id) : [U.id];
8619
- if (!await ee(F)) return;
8617
+ const Q = U.gridChildren ? U.gridChildren.map((le) => le.id) : [U.id];
8618
+ if (!await ie(Q)) return;
8620
8619
  }
8621
- f < de.length - 1 ? g((U) => U + 1) : A(ve)();
8620
+ f < ce.length - 1 ? g((U) => U + 1) : A(ge)();
8622
8621
  return;
8623
8622
  }
8624
8623
  if (!a) {
8625
- const U = (H = (O = p == null ? void 0 : p[v]) == null ? void 0 : O.questionData) == null ? void 0 : H.map(
8626
- (Q) => Q.id
8624
+ const U = (H = (j = p == null ? void 0 : p[v]) == null ? void 0 : j.questionData) == null ? void 0 : H.map(
8625
+ (oe) => oe.id
8627
8626
  );
8628
- if (!await ee(U)) return;
8627
+ if (!await ie(U)) return;
8629
8628
  }
8630
8629
  y((U) => U + 1);
8631
8630
  }, [
8632
8631
  v,
8633
8632
  f,
8634
- de,
8633
+ ce,
8635
8634
  p,
8636
8635
  a,
8637
- ee,
8636
+ ie,
8638
8637
  d,
8639
8638
  A,
8640
- ve
8639
+ ge
8641
8640
  ]), Se = Y(() => {
8642
8641
  if (d === "conversational") {
8643
- g((O) => Math.max(0, O - 1));
8642
+ g((j) => Math.max(0, j - 1));
8644
8643
  return;
8645
8644
  }
8646
- y((O) => O - 1);
8647
- }, [d]), ke = X(
8645
+ y((j) => j - 1);
8646
+ }, [d]), Ce = ee(
8648
8647
  () => ({
8649
- register: C,
8648
+ register: k,
8650
8649
  setValue: M,
8651
8650
  watch: L,
8652
- errors: W,
8653
- trigger: ee,
8651
+ errors: F,
8652
+ trigger: ie,
8654
8653
  isSubmitting: Z,
8655
8654
  isReadOnly: l,
8656
8655
  getValues: I,
8657
- setError: $,
8658
- clearErrors: be,
8656
+ setError: X,
8657
+ clearErrors: he,
8659
8658
  apiActivityCount: h
8660
8659
  }),
8661
8660
  [
8662
- C,
8661
+ k,
8663
8662
  M,
8664
8663
  L,
8665
- W,
8666
- ee,
8664
+ F,
8665
+ ie,
8667
8666
  Z,
8668
8667
  l,
8669
8668
  I,
8670
- $,
8671
- be,
8669
+ X,
8670
+ he,
8672
8671
  h
8673
8672
  ]
8674
8673
  );
@@ -8677,7 +8676,7 @@ const ks = ({
8677
8676
  /* @__PURE__ */ b(
8678
8677
  "form",
8679
8678
  {
8680
- onSubmit: A(ve),
8679
+ onSubmit: A(ge),
8681
8680
  className: "container h-full mx-auto",
8682
8681
  children: [
8683
8682
  /* @__PURE__ */ i("div", { className: "relative flex flex-col w-full min-w-0 py-4 gap-y-12", children: /* @__PURE__ */ b(
@@ -8686,39 +8685,39 @@ const ks = ({
8686
8685
  className: "multi_section__box min-w-0",
8687
8686
  children: [
8688
8687
  d === "multi" && (((Me = p == null ? void 0 : p[v]) == null ? void 0 : Me.title) || ((Ee = p == null ? void 0 : p[v]) == null ? void 0 : Ee.description)) && /* @__PURE__ */ b("div", { className: "py-4 mb-4 border-b border-gray-100 multi_section__title", children: [
8689
- ((G = p[v]) == null ? void 0 : G.title) && /* @__PURE__ */ i("h2", { className: "text-lg font-semibold mb-[6px]", children: (B = p[v]) == null ? void 0 : B.title }),
8688
+ ((O = p[v]) == null ? void 0 : O.title) && /* @__PURE__ */ i("h2", { className: "text-lg font-semibold mb-[6px]", children: (B = p[v]) == null ? void 0 : B.title }),
8690
8689
  ((K = p[v]) == null ? void 0 : K.description) && /* @__PURE__ */ i("p", { className: "text-sm", children: (P = p[v]) == null ? void 0 : P.description })
8691
8690
  ] }),
8692
8691
  d === "multi" ? /* @__PURE__ */ i(
8693
8692
  Ss,
8694
8693
  {
8695
8694
  form_data: p,
8696
- options: ke,
8695
+ options: Ce,
8697
8696
  current: v
8698
8697
  }
8699
8698
  ) : d === "conversational" ? /* @__PURE__ */ i(
8700
8699
  Ns,
8701
8700
  {
8702
- element: de[f],
8703
- options: ke,
8704
- onNext: se,
8701
+ element: ce[f],
8702
+ options: Ce,
8703
+ onNext: ue,
8705
8704
  onPrev: Se,
8706
8705
  isFirst: f === 0,
8707
- isLast: f === de.length - 1,
8706
+ isLast: f === ce.length - 1,
8708
8707
  isReadOnly: l
8709
8708
  }
8710
8709
  ) : /* @__PURE__ */ i(
8711
8710
  As,
8712
8711
  {
8713
8712
  form_data: p,
8714
- options: ke
8713
+ options: Ce
8715
8714
  }
8716
8715
  )
8717
8716
  ]
8718
8717
  },
8719
8718
  d === "conversational" ? `conv-${f}` : (E = p == null ? void 0 : p[v]) == null ? void 0 : E.id
8720
8719
  ) }),
8721
- !t && d !== "conversational" && /* @__PURE__ */ i("footer", { className: "flex items-center justify-end gap-4 footer flex-wrap", children: d === "multi" ? /* @__PURE__ */ b(re, { children: [
8720
+ !t && d !== "conversational" && /* @__PURE__ */ i("footer", { className: "flex items-center justify-end gap-4 footer flex-wrap", children: d === "multi" ? /* @__PURE__ */ b(ve, { children: [
8722
8721
  /* @__PURE__ */ b("div", { className: "flex gap-x-4 justify-between navigation_container w-full", children: [
8723
8722
  /* @__PURE__ */ b("div", { children: [
8724
8723
  " ",
@@ -8730,7 +8729,7 @@ const ks = ({
8730
8729
  className: "text-gray-400 hover:text-gray-600 font-medium text-sm flex items-center gap-1 transition-colors back_btn",
8731
8730
  children: [
8732
8731
  /* @__PURE__ */ i(
8733
- J,
8732
+ z,
8734
8733
  {
8735
8734
  icon: "material-symbols:arrow-upward-rounded",
8736
8735
  iconClass: "text-lg"
@@ -8742,20 +8741,20 @@ const ks = ({
8742
8741
  )
8743
8742
  ] }),
8744
8743
  v < N - 1 && /* @__PURE__ */ i(
8745
- Ce,
8744
+ ke,
8746
8745
  {
8747
8746
  type: "button",
8748
8747
  text: "Next",
8749
- onClick: se,
8748
+ onClick: ue,
8750
8749
  style: { background: (S == null ? void 0 : S.buttonColor) || "#333" },
8751
8750
  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"
8752
8751
  }
8753
8752
  )
8754
8753
  ] }),
8755
- (v === N - 1 || l) && !a && (u != null ? u : /* @__PURE__ */ i(
8756
- Ce,
8754
+ (v === N - 1 || l) && !a && ((q = typeof u == "function" ? u({ isUploading: h > 0, isSubmitting: Z, hasErrors: Object.keys(F).length > 0 }) : u) != null ? q : /* @__PURE__ */ i(
8755
+ ke,
8757
8756
  {
8758
- isDisabled: Z || Object.keys(W).length > 0 || h > 0,
8757
+ isDisabled: Z || Object.keys(F).length > 0 || h > 0,
8759
8758
  isLoading: Z,
8760
8759
  type: "submit",
8761
8760
  text: "Submit",
@@ -8763,10 +8762,10 @@ const ks = ({
8763
8762
  btnClass: "text-gray-700 border-[#98A2B3] submit_btn !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg submit_btn"
8764
8763
  }
8765
8764
  ))
8766
- ] }) : !a && (u != null ? u : /* @__PURE__ */ i(
8767
- Ce,
8765
+ ] }) : !a && (($ = typeof u == "function" ? u({ isUploading: h > 0, isSubmitting: Z, hasErrors: Object.keys(F).length > 0 }) : u) != null ? $ : /* @__PURE__ */ i(
8766
+ ke,
8768
8767
  {
8769
- isDisabled: Z || Object.keys(W).length > 0 || h > 0,
8768
+ isDisabled: Z || Object.keys(F).length > 0 || h > 0,
8770
8769
  isLoading: Z,
8771
8770
  type: "submit",
8772
8771
  text: "Submit",
@@ -8774,12 +8773,12 @@ const ks = ({
8774
8773
  btnClass: "text-gray-700 border-[#98A2B3] submit_btn !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg submit_btn"
8775
8774
  }
8776
8775
  )) }),
8777
- d === "conversational" && de.length > 0 && /* @__PURE__ */ i("div", { className: "fixed bottom-0 left-0 w-full h-1.5 bg-gray-200", children: /* @__PURE__ */ i(
8776
+ d === "conversational" && ce.length > 0 && /* @__PURE__ */ i("div", { className: "fixed bottom-0 left-0 w-full h-1.5 bg-gray-200", children: /* @__PURE__ */ i(
8778
8777
  "div",
8779
8778
  {
8780
8779
  className: "h-full bg-blue-600 transition-all duration-500 ease-out",
8781
8780
  style: {
8782
- width: `${(f + 1) / de.length * 100}%`,
8781
+ width: `${(f + 1) / ce.length * 100}%`,
8783
8782
  background: (S == null ? void 0 : S.buttonColor) || "#2563EB"
8784
8783
  }
8785
8784
  }
@@ -8788,7 +8787,7 @@ const ks = ({
8788
8787
  }
8789
8788
  )
8790
8789
  ] });
8791
- }, Ms = ae.memo(ks);
8790
+ }, Ms = se.memo(Cs);
8792
8791
  function yn({
8793
8792
  answerData: e,
8794
8793
  form_data: n,
@@ -8803,7 +8802,7 @@ function yn({
8803
8802
  onGetValues: c,
8804
8803
  uploadUrl: r
8805
8804
  }) {
8806
- j(() => {
8805
+ G(() => {
8807
8806
  d && hn("config", d);
8808
8807
  }, [d]);
8809
8808
  const h = Y(
@@ -8832,7 +8831,7 @@ function yn({
8832
8831
  ] }) : /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i("p", { className: "p-6 text-sm text-gray-400", children: "Error: No form data available." }) });
8833
8832
  }
8834
8833
  export {
8835
- J as A,
8834
+ z as A,
8836
8835
  Hs as H,
8837
8836
  yn as V
8838
8837
  };