@overmap-ai/forms 1.0.17-file-viewer-updates.7 → 1.0.17-file-viewer-updates.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/forms.js +1219 -1195
- package/dist/forms.umd.cjs +4 -4
- package/package.json +2 -2
package/dist/forms.js
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var w = (t, n, e) =>
|
|
4
|
-
import { jsxs as y, jsx as
|
|
5
|
-
import { Popover as oe, IconButton as
|
|
1
|
+
var ir = Object.defineProperty;
|
|
2
|
+
var rr = (t, n, e) => n in t ? ir(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
3
|
+
var w = (t, n, e) => rr(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { jsxs as y, jsx as a, Fragment as he } from "react/jsx-runtime";
|
|
5
|
+
import { Popover as oe, IconButton as B, RiIcon as T, Badge as ot, Spinner as yt, ButtonGroup as bt, Tooltip as Ee, Separator as Ht, Text as ye, Checkbox as at, Button as X, DayPicker as or, useToast as Gt, Input as de, Card as Ue, Menu as M, TextArea as Un, useSize as jn, Heading as Wn, HoverCard as St, useAlertDialog as ar, Tabs as Ie, IconToggleButton as sr } from "@overmap-ai/blocks";
|
|
6
6
|
import * as p from "react";
|
|
7
|
-
import { memo as O, useCallback as N, useMemo as A, forwardRef as qe, createContext as
|
|
8
|
-
import { truncate as
|
|
9
|
-
import { useField as
|
|
10
|
-
import * as
|
|
11
|
-
import
|
|
12
|
-
import { RiCheckboxCircleLine as
|
|
7
|
+
import { memo as O, useCallback as N, useMemo as A, forwardRef as qe, createContext as lr, useContext as cr, useState as H, useRef as ne, useEffect as K, useLayoutEffect as dr, useReducer as ur, Fragment as fr } from "react";
|
|
8
|
+
import { truncate as Xt, downloadFile as qn, slugify as mr, Colors as Hn, fileToBlob as Gn, hashFile as En, DeferredPromise as hr } from "@overmap-ai/core";
|
|
9
|
+
import { useField as Kt, useFormikContext as be, useFormik as Yt, FormikProvider as Qt } from "formik";
|
|
10
|
+
import * as pr from "react-dom";
|
|
11
|
+
import gr from "react-dom";
|
|
12
|
+
import { RiCheckboxCircleLine as vr, RiCalendarLine as yr, RiListCheck as br, RiHashtag as wr, RiQrCodeLine as Cr, RiCheckboxLine as xr, RiMenuFoldLine as Er, RiInputField as Ir, RiAlignJustify as Sr, RiUpload2Line as Rr, RiFileCopyLine as Nr, RiDeleteBin7Fill as Tr, RiImageLine as Lr, RiArrowDownLine as Fr, RiArrowUpLine as Dr } from "react-icons/ri";
|
|
13
13
|
import Y from "lodash.get";
|
|
14
|
-
import
|
|
15
|
-
import { DragDropContext as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { ReactSketchCanvas as
|
|
19
|
-
const
|
|
14
|
+
import Jt from "lodash.set";
|
|
15
|
+
import { DragDropContext as Xn, Droppable as Zt, Draggable as en } from "@hello-pangea/dnd";
|
|
16
|
+
import Ar from "qr-scanner";
|
|
17
|
+
import Or from "lodash.clonedeep";
|
|
18
|
+
import { ReactSketchCanvas as Pr } from "react-sketch-canvas";
|
|
19
|
+
const Kn = O((t) => {
|
|
20
20
|
const { selectedColor: n, allColors: e, onFinish: i, trigger: r } = t, o = N(
|
|
21
|
-
(
|
|
22
|
-
i(
|
|
21
|
+
(s) => () => {
|
|
22
|
+
i(s);
|
|
23
23
|
},
|
|
24
24
|
[i]
|
|
25
25
|
);
|
|
26
26
|
return /* @__PURE__ */ y(oe.Root, { children: [
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
27
|
+
/* @__PURE__ */ a(oe.Trigger, { children: r }),
|
|
28
|
+
/* @__PURE__ */ a(oe.Content, { size: "sm", children: /* @__PURE__ */ a("div", { className: "grid w-max grid-cols-7 gap-x-1 gap-y-1", children: e.map((s) => /* @__PURE__ */ a(
|
|
29
|
+
B,
|
|
30
30
|
{
|
|
31
|
-
onClick: o(
|
|
31
|
+
onClick: o(s),
|
|
32
32
|
style: {
|
|
33
|
-
backgroundColor:
|
|
33
|
+
backgroundColor: s
|
|
34
34
|
},
|
|
35
35
|
type: "button",
|
|
36
36
|
variant: "solid",
|
|
37
|
-
"aria-label":
|
|
38
|
-
children: n ===
|
|
37
|
+
"aria-label": s,
|
|
38
|
+
children: n === s && /* @__PURE__ */ a(T, { icon: "RiCheckLine" })
|
|
39
39
|
},
|
|
40
|
-
|
|
40
|
+
s
|
|
41
41
|
)) }) })
|
|
42
42
|
] });
|
|
43
43
|
});
|
|
44
|
-
|
|
45
|
-
const
|
|
44
|
+
Kn.displayName = "ColorPicker";
|
|
45
|
+
const kr = ["image/jpeg", "image/png", "image/svg+xml"], Mr = [
|
|
46
46
|
// .csv
|
|
47
47
|
"text/csv",
|
|
48
48
|
// .xlsx
|
|
49
49
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
50
50
|
// .xls
|
|
51
51
|
"application/vnd.ms-excel"
|
|
52
|
-
],
|
|
53
|
-
const { fileType: n } = t, e = A(() =>
|
|
54
|
-
return /* @__PURE__ */
|
|
52
|
+
], zr = ["application/pdf"], wt = O((t) => {
|
|
53
|
+
const { fileType: n } = t, e = A(() => Mr.includes(n) ? /* @__PURE__ */ a(T, { icon: "RiFileExcelLine" }) : zr.includes(n) ? /* @__PURE__ */ a(T, { icon: "RiFilePdfLine" }) : kr.includes(n) ? /* @__PURE__ */ a(T, { icon: "RiFileImageLine" }) : /* @__PURE__ */ a(T, { icon: "RiFileLine" }), [n]);
|
|
54
|
+
return /* @__PURE__ */ a("div", { className: "h-max w-max", children: e });
|
|
55
55
|
});
|
|
56
|
-
|
|
56
|
+
wt.displayName = "FileIcon";
|
|
57
57
|
const _r = O((t) => {
|
|
58
58
|
const { file: n, truncateLength: e, hideName: i = !1, ...r } = t, o = A(
|
|
59
|
-
() => e !== void 0 ?
|
|
59
|
+
() => e !== void 0 ? Xt(n.name, e) : n.name,
|
|
60
60
|
[n.name, e]
|
|
61
61
|
);
|
|
62
|
-
return /* @__PURE__ */ y(
|
|
63
|
-
/* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ y(ot, { ...r, children: [
|
|
63
|
+
/* @__PURE__ */ a(wt, { fileType: n.type }),
|
|
64
64
|
!i && o
|
|
65
65
|
] });
|
|
66
66
|
});
|
|
67
67
|
_r.displayName = "FileBadge";
|
|
68
|
-
function
|
|
68
|
+
function Yn(t) {
|
|
69
69
|
var n, e, i = "";
|
|
70
70
|
if (typeof t == "string" || typeof t == "number") i += t;
|
|
71
71
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
72
72
|
var r = t.length;
|
|
73
|
-
for (n = 0; n < r; n++) t[n] && (e =
|
|
73
|
+
for (n = 0; n < r; n++) t[n] && (e = Yn(t[n])) && (i && (i += " "), i += e);
|
|
74
74
|
} else for (e in t) t[e] && (i && (i += " "), i += e);
|
|
75
75
|
return i;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
for (var t, n, e = 0, i = "", r = arguments.length; e < r; e++) (t = arguments[e]) && (n =
|
|
77
|
+
function $r() {
|
|
78
|
+
for (var t, n, e = 0, i = "", r = arguments.length; e < r; e++) (t = arguments[e]) && (n = Yn(t)) && (i && (i += " "), i += n);
|
|
79
79
|
return i;
|
|
80
80
|
}
|
|
81
|
-
const
|
|
81
|
+
const Ve = $r, Qn = O(
|
|
82
82
|
qe((t, n) => {
|
|
83
|
-
const { file: e, className: i, error: r, truncateLength: o, rightSlot:
|
|
83
|
+
const { file: e, className: i, error: r, truncateLength: o, rightSlot: s, ...l } = t, f = A(() => {
|
|
84
84
|
if (e)
|
|
85
|
-
return o !== void 0 ?
|
|
85
|
+
return o !== void 0 ? Xt(e.name, o) : e.name;
|
|
86
86
|
}, [e, o]);
|
|
87
87
|
return /* @__PURE__ */ y(
|
|
88
88
|
"div",
|
|
89
89
|
{
|
|
90
|
-
className:
|
|
90
|
+
className: Ve(
|
|
91
91
|
i,
|
|
92
92
|
"flex h-5 w-full items-center gap-2 rounded-md border border-(--base-a6) bg-(--base-2) text-sm py-1 px-2 h-max",
|
|
93
93
|
{
|
|
@@ -97,22 +97,22 @@ const Be = zr, Yn = O(
|
|
|
97
97
|
ref: n,
|
|
98
98
|
...l,
|
|
99
99
|
children: [
|
|
100
|
-
r ? /* @__PURE__ */
|
|
101
|
-
r || (e ? f : /* @__PURE__ */
|
|
102
|
-
|
|
100
|
+
r ? /* @__PURE__ */ a(T, { icon: "RiFileWarningLine" }) : /* @__PURE__ */ a(wt, { fileType: (e == null ? void 0 : e.type) ?? "" }),
|
|
101
|
+
r || (e ? f : /* @__PURE__ */ a("div", { className: "flex w-full justify-center", children: /* @__PURE__ */ a(yt, {}) })),
|
|
102
|
+
s
|
|
103
103
|
]
|
|
104
104
|
}
|
|
105
105
|
);
|
|
106
106
|
})
|
|
107
107
|
);
|
|
108
|
-
|
|
109
|
-
const Ze = 500, _e = 1e4,
|
|
108
|
+
Qn.displayName = "FileCard";
|
|
109
|
+
const Ze = 500, _e = 1e4, ue = {
|
|
110
110
|
danger: "danger",
|
|
111
111
|
warning: "warning",
|
|
112
112
|
info: "base",
|
|
113
113
|
success: "success"
|
|
114
114
|
};
|
|
115
|
-
class
|
|
115
|
+
class Jn {
|
|
116
116
|
constructor(n) {
|
|
117
117
|
w(this, "type");
|
|
118
118
|
w(this, "identifier");
|
|
@@ -141,9 +141,9 @@ const Q = {
|
|
|
141
141
|
description: "",
|
|
142
142
|
required: !1
|
|
143
143
|
};
|
|
144
|
-
class G extends
|
|
144
|
+
class G extends Jn {
|
|
145
145
|
constructor(e) {
|
|
146
|
-
const { label: i, required: r, image: o, fieldValidators:
|
|
146
|
+
const { label: i, required: r, image: o, fieldValidators: s = [], formValidators: l = [], ...f } = e;
|
|
147
147
|
super(f);
|
|
148
148
|
w(this, "required");
|
|
149
149
|
w(this, "formValidators");
|
|
@@ -157,7 +157,7 @@ class G extends Qn {
|
|
|
157
157
|
* which don't have a `onBlur` event (which is used to set the `touched` state).
|
|
158
158
|
*/
|
|
159
159
|
w(this, "onlyValidateAfterTouched", !0);
|
|
160
|
-
this.label = i, this.required = r, this.image = o, this.fieldValidators =
|
|
160
|
+
this.label = i, this.required = r, this.image = o, this.fieldValidators = s, this.formValidators = l;
|
|
161
161
|
}
|
|
162
162
|
static getFieldCreationSchema() {
|
|
163
163
|
return [];
|
|
@@ -205,7 +205,7 @@ class G extends Qn {
|
|
|
205
205
|
}
|
|
206
206
|
w(G, "fieldTypeName"), w(G, "fieldTypeDescription");
|
|
207
207
|
const U = (t) => {
|
|
208
|
-
const { id: n, field: e, formId: i, size: r, showInputOnly: o, internal:
|
|
208
|
+
const { id: n, field: e, formId: i, size: r, showInputOnly: o, internal: s, ...l } = t, [f, c, d] = Kt(e.getId()), { touched: u } = c, h = c.error ?? e.description, g = c.error ? "danger" : void 0, b = n ?? `${i}-${e.getId()}-input`, m = `${b}-label`, v = e.required ? `${e.label} *` : e.label, x = A(() => ({
|
|
209
209
|
...f,
|
|
210
210
|
onChange: (C) => {
|
|
211
211
|
const I = e.getValueFromChangeEvent(C);
|
|
@@ -224,55 +224,55 @@ const U = (t) => {
|
|
|
224
224
|
labelId: m,
|
|
225
225
|
label: v,
|
|
226
226
|
showInputOnly: o,
|
|
227
|
-
internal:
|
|
227
|
+
internal: s,
|
|
228
228
|
fieldProps: x,
|
|
229
229
|
helpers: d,
|
|
230
230
|
field: e
|
|
231
231
|
},
|
|
232
232
|
{ ...l, "aria-labelledby": m }
|
|
233
233
|
];
|
|
234
|
-
},
|
|
234
|
+
}, Zn = lr(() => {
|
|
235
235
|
throw new Error("No ImageViewerProvider found");
|
|
236
|
-
}),
|
|
237
|
-
function
|
|
236
|
+
}), tn = () => cr(Zn);
|
|
237
|
+
function ce(t, n, { checkForDefaultPrevented: e = !0 } = {}) {
|
|
238
238
|
return function(r) {
|
|
239
239
|
if (t == null || t(r), e === !1 || !r.defaultPrevented)
|
|
240
240
|
return n == null ? void 0 : n(r);
|
|
241
241
|
};
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function In(t, n) {
|
|
244
244
|
if (typeof t == "function")
|
|
245
245
|
return t(n);
|
|
246
246
|
t != null && (t.current = n);
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function ei(...t) {
|
|
249
249
|
return (n) => {
|
|
250
250
|
let e = !1;
|
|
251
251
|
const i = t.map((r) => {
|
|
252
|
-
const o =
|
|
252
|
+
const o = In(r, n);
|
|
253
253
|
return !e && typeof o == "function" && (e = !0), o;
|
|
254
254
|
});
|
|
255
255
|
if (e)
|
|
256
256
|
return () => {
|
|
257
257
|
for (let r = 0; r < i.length; r++) {
|
|
258
258
|
const o = i[r];
|
|
259
|
-
typeof o == "function" ? o() :
|
|
259
|
+
typeof o == "function" ? o() : In(t[r], null);
|
|
260
260
|
}
|
|
261
261
|
};
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
|
-
function
|
|
265
|
-
return p.useCallback(
|
|
264
|
+
function we(...t) {
|
|
265
|
+
return p.useCallback(ei(...t), t);
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function Br(t, n) {
|
|
268
268
|
const e = p.createContext(n), i = (o) => {
|
|
269
|
-
const { children:
|
|
270
|
-
return /* @__PURE__ */
|
|
269
|
+
const { children: s, ...l } = o, f = p.useMemo(() => l, Object.values(l));
|
|
270
|
+
return /* @__PURE__ */ a(e.Provider, { value: f, children: s });
|
|
271
271
|
};
|
|
272
272
|
i.displayName = t + "Provider";
|
|
273
273
|
function r(o) {
|
|
274
|
-
const
|
|
275
|
-
if (
|
|
274
|
+
const s = p.useContext(e);
|
|
275
|
+
if (s) return s;
|
|
276
276
|
if (n !== void 0) return n;
|
|
277
277
|
throw new Error(`\`${o}\` must be used within \`${t}\``);
|
|
278
278
|
}
|
|
@@ -280,26 +280,26 @@ function $r(t, n) {
|
|
|
280
280
|
}
|
|
281
281
|
function Vr(t, n = []) {
|
|
282
282
|
let e = [];
|
|
283
|
-
function i(o,
|
|
284
|
-
const l = p.createContext(
|
|
285
|
-
e = [...e,
|
|
283
|
+
function i(o, s) {
|
|
284
|
+
const l = p.createContext(s), f = e.length;
|
|
285
|
+
e = [...e, s];
|
|
286
286
|
const c = (u) => {
|
|
287
287
|
var x;
|
|
288
288
|
const { scope: h, children: g, ...b } = u, m = ((x = h == null ? void 0 : h[t]) == null ? void 0 : x[f]) || l, v = p.useMemo(() => b, Object.values(b));
|
|
289
|
-
return /* @__PURE__ */
|
|
289
|
+
return /* @__PURE__ */ a(m.Provider, { value: v, children: g });
|
|
290
290
|
};
|
|
291
291
|
c.displayName = o + "Provider";
|
|
292
292
|
function d(u, h) {
|
|
293
293
|
var m;
|
|
294
294
|
const g = ((m = h == null ? void 0 : h[t]) == null ? void 0 : m[f]) || l, b = p.useContext(g);
|
|
295
295
|
if (b) return b;
|
|
296
|
-
if (
|
|
296
|
+
if (s !== void 0) return s;
|
|
297
297
|
throw new Error(`\`${u}\` must be used within \`${o}\``);
|
|
298
298
|
}
|
|
299
299
|
return [c, d];
|
|
300
300
|
}
|
|
301
301
|
const r = () => {
|
|
302
|
-
const o = e.map((
|
|
302
|
+
const o = e.map((s) => p.createContext(s));
|
|
303
303
|
return function(l) {
|
|
304
304
|
const f = (l == null ? void 0 : l[t]) || o;
|
|
305
305
|
return p.useMemo(
|
|
@@ -308,9 +308,9 @@ function Vr(t, n = []) {
|
|
|
308
308
|
);
|
|
309
309
|
};
|
|
310
310
|
};
|
|
311
|
-
return r.scopeName = t, [i,
|
|
311
|
+
return r.scopeName = t, [i, Ur(r, ...n)];
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function Ur(...t) {
|
|
314
314
|
const n = t[0];
|
|
315
315
|
if (t.length === 1) return n;
|
|
316
316
|
const e = () => {
|
|
@@ -319,22 +319,22 @@ function Br(...t) {
|
|
|
319
319
|
scopeName: r.scopeName
|
|
320
320
|
}));
|
|
321
321
|
return function(o) {
|
|
322
|
-
const
|
|
322
|
+
const s = i.reduce((l, { useScope: f, scopeName: c }) => {
|
|
323
323
|
const u = f(o)[`__scope${c}`];
|
|
324
324
|
return { ...l, ...u };
|
|
325
325
|
}, {});
|
|
326
|
-
return p.useMemo(() => ({ [`__scope${n.scopeName}`]:
|
|
326
|
+
return p.useMemo(() => ({ [`__scope${n.scopeName}`]: s }), [s]);
|
|
327
327
|
};
|
|
328
328
|
};
|
|
329
329
|
return e.scopeName = n.scopeName, e;
|
|
330
330
|
}
|
|
331
|
-
var
|
|
332
|
-
},
|
|
333
|
-
}),
|
|
334
|
-
function
|
|
335
|
-
const [n, e] = p.useState(
|
|
336
|
-
return
|
|
337
|
-
e((i) => i ?? String(
|
|
331
|
+
var st = globalThis != null && globalThis.document ? p.useLayoutEffect : () => {
|
|
332
|
+
}, jr = p.useId || (() => {
|
|
333
|
+
}), Wr = 0;
|
|
334
|
+
function Rt(t) {
|
|
335
|
+
const [n, e] = p.useState(jr());
|
|
336
|
+
return st(() => {
|
|
337
|
+
e((i) => i ?? String(Wr++));
|
|
338
338
|
}, [t]), t || (n ? `radix-${n}` : "");
|
|
339
339
|
}
|
|
340
340
|
function pe(t) {
|
|
@@ -346,13 +346,13 @@ function pe(t) {
|
|
|
346
346
|
return (i = n.current) == null ? void 0 : i.call(n, ...e);
|
|
347
347
|
}, []);
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function qr({
|
|
350
350
|
prop: t,
|
|
351
351
|
defaultProp: n,
|
|
352
352
|
onChange: e = () => {
|
|
353
353
|
}
|
|
354
354
|
}) {
|
|
355
|
-
const [i, r] =
|
|
355
|
+
const [i, r] = Hr({ defaultProp: n, onChange: e }), o = t !== void 0, s = o ? t : i, l = pe(e), f = p.useCallback(
|
|
356
356
|
(c) => {
|
|
357
357
|
if (o) {
|
|
358
358
|
const u = typeof c == "function" ? c(t) : c;
|
|
@@ -362,9 +362,9 @@ function Wr({
|
|
|
362
362
|
},
|
|
363
363
|
[o, t, r, l]
|
|
364
364
|
);
|
|
365
|
-
return [
|
|
365
|
+
return [s, f];
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function Hr({
|
|
368
368
|
defaultProp: t,
|
|
369
369
|
onChange: n
|
|
370
370
|
}) {
|
|
@@ -373,33 +373,33 @@ function qr({
|
|
|
373
373
|
r.current !== i && (o(i), r.current = i);
|
|
374
374
|
}, [i, r, o]), e;
|
|
375
375
|
}
|
|
376
|
-
var
|
|
377
|
-
const { children: e, ...i } = t, r = p.Children.toArray(e), o = r.find(
|
|
376
|
+
var nn = p.forwardRef((t, n) => {
|
|
377
|
+
const { children: e, ...i } = t, r = p.Children.toArray(e), o = r.find(Xr);
|
|
378
378
|
if (o) {
|
|
379
|
-
const
|
|
380
|
-
return /* @__PURE__ */
|
|
379
|
+
const s = o.props.children, l = r.map((f) => f === o ? p.Children.count(s) > 1 ? p.Children.only(null) : p.isValidElement(s) ? s.props.children : null : f);
|
|
380
|
+
return /* @__PURE__ */ a(Pt, { ...i, ref: n, children: p.isValidElement(s) ? p.cloneElement(s, void 0, l) : null });
|
|
381
381
|
}
|
|
382
|
-
return /* @__PURE__ */
|
|
382
|
+
return /* @__PURE__ */ a(Pt, { ...i, ref: n, children: e });
|
|
383
383
|
});
|
|
384
|
-
|
|
385
|
-
var
|
|
384
|
+
nn.displayName = "Slot";
|
|
385
|
+
var Pt = p.forwardRef((t, n) => {
|
|
386
386
|
const { children: e, ...i } = t;
|
|
387
387
|
if (p.isValidElement(e)) {
|
|
388
|
-
const r =
|
|
388
|
+
const r = Yr(e);
|
|
389
389
|
return p.cloneElement(e, {
|
|
390
|
-
...
|
|
390
|
+
...Kr(i, e.props),
|
|
391
391
|
// @ts-ignore
|
|
392
|
-
ref: n ?
|
|
392
|
+
ref: n ? ei(n, r) : r
|
|
393
393
|
});
|
|
394
394
|
}
|
|
395
395
|
return p.Children.count(e) > 1 ? p.Children.only(null) : null;
|
|
396
396
|
});
|
|
397
|
-
|
|
398
|
-
var
|
|
399
|
-
function
|
|
400
|
-
return p.isValidElement(t) && t.type ===
|
|
397
|
+
Pt.displayName = "SlotClone";
|
|
398
|
+
var Gr = ({ children: t }) => /* @__PURE__ */ a(he, { children: t });
|
|
399
|
+
function Xr(t) {
|
|
400
|
+
return p.isValidElement(t) && t.type === Gr;
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function Kr(t, n) {
|
|
403
403
|
const e = { ...n };
|
|
404
404
|
for (const i in n) {
|
|
405
405
|
const r = t[i], o = n[i];
|
|
@@ -409,12 +409,12 @@ function Xr(t, n) {
|
|
|
409
409
|
}
|
|
410
410
|
return { ...t, ...e };
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function Yr(t) {
|
|
413
413
|
var i, r;
|
|
414
414
|
let n = (i = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : i.get, e = n && "isReactWarning" in n && n.isReactWarning;
|
|
415
415
|
return e ? t.ref : (n = (r = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : r.get, e = n && "isReactWarning" in n && n.isReactWarning, e ? t.props.ref : t.props.ref || t.ref);
|
|
416
416
|
}
|
|
417
|
-
var
|
|
417
|
+
var Qr = [
|
|
418
418
|
"a",
|
|
419
419
|
"button",
|
|
420
420
|
"div",
|
|
@@ -431,17 +431,17 @@ var Yr = [
|
|
|
431
431
|
"span",
|
|
432
432
|
"svg",
|
|
433
433
|
"ul"
|
|
434
|
-
],
|
|
434
|
+
], ae = Qr.reduce((t, n) => {
|
|
435
435
|
const e = p.forwardRef((i, r) => {
|
|
436
|
-
const { asChild: o, ...
|
|
437
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */
|
|
436
|
+
const { asChild: o, ...s } = i, l = o ? nn : n;
|
|
437
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ a(l, { ...s, ref: r });
|
|
438
438
|
});
|
|
439
439
|
return e.displayName = `Primitive.${n}`, { ...t, [n]: e };
|
|
440
440
|
}, {});
|
|
441
|
-
function
|
|
442
|
-
t &&
|
|
441
|
+
function Jr(t, n) {
|
|
442
|
+
t && pr.flushSync(() => t.dispatchEvent(n));
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function Zr(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
445
445
|
const e = pe(t);
|
|
446
446
|
p.useEffect(() => {
|
|
447
447
|
const i = (r) => {
|
|
@@ -450,41 +450,41 @@ function Jr(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
|
450
450
|
return n.addEventListener("keydown", i, { capture: !0 }), () => n.removeEventListener("keydown", i, { capture: !0 });
|
|
451
451
|
}, [e, n]);
|
|
452
452
|
}
|
|
453
|
-
var
|
|
453
|
+
var eo = "DismissableLayer", kt = "dismissableLayer.update", to = "dismissableLayer.pointerDownOutside", no = "dismissableLayer.focusOutside", Sn, ti = p.createContext({
|
|
454
454
|
layers: /* @__PURE__ */ new Set(),
|
|
455
455
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
456
456
|
branches: /* @__PURE__ */ new Set()
|
|
457
|
-
}),
|
|
457
|
+
}), ni = p.forwardRef(
|
|
458
458
|
(t, n) => {
|
|
459
459
|
const {
|
|
460
460
|
disableOutsidePointerEvents: e = !1,
|
|
461
461
|
onEscapeKeyDown: i,
|
|
462
462
|
onPointerDownOutside: r,
|
|
463
463
|
onFocusOutside: o,
|
|
464
|
-
onInteractOutside:
|
|
464
|
+
onInteractOutside: s,
|
|
465
465
|
onDismiss: l,
|
|
466
466
|
...f
|
|
467
|
-
} = t, c = p.useContext(
|
|
468
|
-
const F = R.target,
|
|
469
|
-
!C ||
|
|
470
|
-
}, h), L =
|
|
467
|
+
} = t, c = p.useContext(ti), [d, u] = p.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, g] = p.useState({}), b = we(n, (R) => u(R)), m = Array.from(c.layers), [v] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), x = m.indexOf(v), E = d ? m.indexOf(d) : -1, S = c.layersWithOutsidePointerEventsDisabled.size > 0, C = E >= x, I = oo((R) => {
|
|
468
|
+
const F = R.target, V = [...c.branches].some((_) => _.contains(F));
|
|
469
|
+
!C || V || (r == null || r(R), s == null || s(R), R.defaultPrevented || l == null || l());
|
|
470
|
+
}, h), L = ao((R) => {
|
|
471
471
|
const F = R.target;
|
|
472
|
-
[...c.branches].some((
|
|
472
|
+
[...c.branches].some((_) => _.contains(F)) || (o == null || o(R), s == null || s(R), R.defaultPrevented || l == null || l());
|
|
473
473
|
}, h);
|
|
474
|
-
return
|
|
474
|
+
return Zr((R) => {
|
|
475
475
|
E === c.layers.size - 1 && (i == null || i(R), !R.defaultPrevented && l && (R.preventDefault(), l()));
|
|
476
476
|
}, h), p.useEffect(() => {
|
|
477
477
|
if (d)
|
|
478
|
-
return e && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (
|
|
479
|
-
e && c.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents =
|
|
478
|
+
return e && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (Sn = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(d)), c.layers.add(d), Rn(), () => {
|
|
479
|
+
e && c.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = Sn);
|
|
480
480
|
};
|
|
481
481
|
}, [d, h, e, c]), p.useEffect(() => () => {
|
|
482
|
-
d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d),
|
|
482
|
+
d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d), Rn());
|
|
483
483
|
}, [d, c]), p.useEffect(() => {
|
|
484
484
|
const R = () => g({});
|
|
485
|
-
return document.addEventListener(
|
|
486
|
-
}, []), /* @__PURE__ */
|
|
487
|
-
|
|
485
|
+
return document.addEventListener(kt, R), () => document.removeEventListener(kt, R);
|
|
486
|
+
}, []), /* @__PURE__ */ a(
|
|
487
|
+
ae.div,
|
|
488
488
|
{
|
|
489
489
|
...f,
|
|
490
490
|
ref: b,
|
|
@@ -492,9 +492,9 @@ var Zr = "DismissableLayer", At = "dismissableLayer.update", eo = "dismissableLa
|
|
|
492
492
|
pointerEvents: S ? C ? "auto" : "none" : void 0,
|
|
493
493
|
...t.style
|
|
494
494
|
},
|
|
495
|
-
onFocusCapture:
|
|
496
|
-
onBlurCapture:
|
|
497
|
-
onPointerDownCapture:
|
|
495
|
+
onFocusCapture: ce(t.onFocusCapture, L.onFocusCapture),
|
|
496
|
+
onBlurCapture: ce(t.onBlurCapture, L.onBlurCapture),
|
|
497
|
+
onPointerDownCapture: ce(
|
|
498
498
|
t.onPointerDownCapture,
|
|
499
499
|
I.onPointerDownCapture
|
|
500
500
|
)
|
|
@@ -502,27 +502,27 @@ var Zr = "DismissableLayer", At = "dismissableLayer.update", eo = "dismissableLa
|
|
|
502
502
|
);
|
|
503
503
|
}
|
|
504
504
|
);
|
|
505
|
-
|
|
506
|
-
var
|
|
507
|
-
const e = p.useContext(
|
|
505
|
+
ni.displayName = eo;
|
|
506
|
+
var io = "DismissableLayerBranch", ro = p.forwardRef((t, n) => {
|
|
507
|
+
const e = p.useContext(ti), i = p.useRef(null), r = we(n, i);
|
|
508
508
|
return p.useEffect(() => {
|
|
509
509
|
const o = i.current;
|
|
510
510
|
if (o)
|
|
511
511
|
return e.branches.add(o), () => {
|
|
512
512
|
e.branches.delete(o);
|
|
513
513
|
};
|
|
514
|
-
}, [e.branches]), /* @__PURE__ */
|
|
514
|
+
}, [e.branches]), /* @__PURE__ */ a(ae.div, { ...t, ref: r });
|
|
515
515
|
});
|
|
516
|
-
|
|
517
|
-
function
|
|
516
|
+
ro.displayName = io;
|
|
517
|
+
function oo(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
518
518
|
const e = pe(t), i = p.useRef(!1), r = p.useRef(() => {
|
|
519
519
|
});
|
|
520
520
|
return p.useEffect(() => {
|
|
521
521
|
const o = (l) => {
|
|
522
522
|
if (l.target && !i.current) {
|
|
523
523
|
let f = function() {
|
|
524
|
-
|
|
525
|
-
|
|
524
|
+
ii(
|
|
525
|
+
to,
|
|
526
526
|
e,
|
|
527
527
|
c,
|
|
528
528
|
{ discrete: !0 }
|
|
@@ -533,22 +533,22 @@ function ro(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
|
533
533
|
} else
|
|
534
534
|
n.removeEventListener("click", r.current);
|
|
535
535
|
i.current = !1;
|
|
536
|
-
},
|
|
536
|
+
}, s = window.setTimeout(() => {
|
|
537
537
|
n.addEventListener("pointerdown", o);
|
|
538
538
|
}, 0);
|
|
539
539
|
return () => {
|
|
540
|
-
window.clearTimeout(
|
|
540
|
+
window.clearTimeout(s), n.removeEventListener("pointerdown", o), n.removeEventListener("click", r.current);
|
|
541
541
|
};
|
|
542
542
|
}, [n, e]), {
|
|
543
543
|
// ensures we check React component tree (not just DOM tree)
|
|
544
544
|
onPointerDownCapture: () => i.current = !0
|
|
545
545
|
};
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function ao(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
548
548
|
const e = pe(t), i = p.useRef(!1);
|
|
549
549
|
return p.useEffect(() => {
|
|
550
550
|
const r = (o) => {
|
|
551
|
-
o.target && !i.current &&
|
|
551
|
+
o.target && !i.current && ii(no, e, { originalEvent: o }, {
|
|
552
552
|
discrete: !1
|
|
553
553
|
});
|
|
554
554
|
};
|
|
@@ -558,22 +558,22 @@ function oo(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
|
558
558
|
onBlurCapture: () => i.current = !1
|
|
559
559
|
};
|
|
560
560
|
}
|
|
561
|
-
function
|
|
562
|
-
const t = new CustomEvent(
|
|
561
|
+
function Rn() {
|
|
562
|
+
const t = new CustomEvent(kt);
|
|
563
563
|
document.dispatchEvent(t);
|
|
564
564
|
}
|
|
565
|
-
function
|
|
565
|
+
function ii(t, n, e, { discrete: i }) {
|
|
566
566
|
const r = e.originalEvent.target, o = new CustomEvent(t, { bubbles: !1, cancelable: !0, detail: e });
|
|
567
|
-
n && r.addEventListener(t, n, { once: !0 }), i ?
|
|
567
|
+
n && r.addEventListener(t, n, { once: !0 }), i ? Jr(r, o) : r.dispatchEvent(o);
|
|
568
568
|
}
|
|
569
|
-
var
|
|
569
|
+
var Nt = "focusScope.autoFocusOnMount", Tt = "focusScope.autoFocusOnUnmount", Nn = { bubbles: !1, cancelable: !0 }, so = "FocusScope", ri = p.forwardRef((t, n) => {
|
|
570
570
|
const {
|
|
571
571
|
loop: e = !1,
|
|
572
572
|
trapped: i = !1,
|
|
573
573
|
onMountAutoFocus: r,
|
|
574
574
|
onUnmountAutoFocus: o,
|
|
575
|
-
...
|
|
576
|
-
} = t, [l, f] = p.useState(null), c = pe(r), d = pe(o), u = p.useRef(null), h =
|
|
575
|
+
...s
|
|
576
|
+
} = t, [l, f] = p.useState(null), c = pe(r), d = pe(o), u = p.useRef(null), h = we(n, (m) => f(m)), g = p.useRef({
|
|
577
577
|
paused: !1,
|
|
578
578
|
pause() {
|
|
579
579
|
this.paused = !0;
|
|
@@ -587,15 +587,15 @@ var It = "focusScope.autoFocusOnMount", St = "focusScope.autoFocusOnUnmount", Rn
|
|
|
587
587
|
let m = function(S) {
|
|
588
588
|
if (g.paused || !l) return;
|
|
589
589
|
const C = S.target;
|
|
590
|
-
l.contains(C) ? u.current = C :
|
|
590
|
+
l.contains(C) ? u.current = C : le(u.current, { select: !0 });
|
|
591
591
|
}, v = function(S) {
|
|
592
592
|
if (g.paused || !l) return;
|
|
593
593
|
const C = S.relatedTarget;
|
|
594
|
-
C !== null && (l.contains(C) ||
|
|
594
|
+
C !== null && (l.contains(C) || le(u.current, { select: !0 }));
|
|
595
595
|
}, x = function(S) {
|
|
596
596
|
if (document.activeElement === document.body)
|
|
597
597
|
for (const I of S)
|
|
598
|
-
I.removedNodes.length > 0 &&
|
|
598
|
+
I.removedNodes.length > 0 && le(l);
|
|
599
599
|
};
|
|
600
600
|
document.addEventListener("focusin", m), document.addEventListener("focusout", v);
|
|
601
601
|
const E = new MutationObserver(x);
|
|
@@ -605,16 +605,16 @@ var It = "focusScope.autoFocusOnMount", St = "focusScope.autoFocusOnUnmount", Rn
|
|
|
605
605
|
}
|
|
606
606
|
}, [i, l, g.paused]), p.useEffect(() => {
|
|
607
607
|
if (l) {
|
|
608
|
-
|
|
608
|
+
Ln.add(g);
|
|
609
609
|
const m = document.activeElement;
|
|
610
610
|
if (!l.contains(m)) {
|
|
611
|
-
const x = new CustomEvent(
|
|
612
|
-
l.addEventListener(
|
|
611
|
+
const x = new CustomEvent(Nt, Nn);
|
|
612
|
+
l.addEventListener(Nt, c), l.dispatchEvent(x), x.defaultPrevented || (lo(ho(oi(l)), { select: !0 }), document.activeElement === m && le(l));
|
|
613
613
|
}
|
|
614
614
|
return () => {
|
|
615
|
-
l.removeEventListener(
|
|
616
|
-
const x = new CustomEvent(
|
|
617
|
-
l.addEventListener(
|
|
615
|
+
l.removeEventListener(Nt, c), setTimeout(() => {
|
|
616
|
+
const x = new CustomEvent(Tt, Nn);
|
|
617
|
+
l.addEventListener(Tt, d), l.dispatchEvent(x), x.defaultPrevented || le(m ?? document.body, { select: !0 }), l.removeEventListener(Tt, d), Ln.remove(g);
|
|
618
618
|
}, 0);
|
|
619
619
|
};
|
|
620
620
|
}
|
|
@@ -624,25 +624,25 @@ var It = "focusScope.autoFocusOnMount", St = "focusScope.autoFocusOnUnmount", Rn
|
|
|
624
624
|
if (!e && !i || g.paused) return;
|
|
625
625
|
const v = m.key === "Tab" && !m.altKey && !m.ctrlKey && !m.metaKey, x = document.activeElement;
|
|
626
626
|
if (v && x) {
|
|
627
|
-
const E = m.currentTarget, [S, C] =
|
|
628
|
-
S && C ? !m.shiftKey && x === C ? (m.preventDefault(), e &&
|
|
627
|
+
const E = m.currentTarget, [S, C] = co(E);
|
|
628
|
+
S && C ? !m.shiftKey && x === C ? (m.preventDefault(), e && le(S, { select: !0 })) : m.shiftKey && x === S && (m.preventDefault(), e && le(C, { select: !0 })) : x === E && m.preventDefault();
|
|
629
629
|
}
|
|
630
630
|
},
|
|
631
631
|
[e, i, g.paused]
|
|
632
632
|
);
|
|
633
|
-
return /* @__PURE__ */
|
|
633
|
+
return /* @__PURE__ */ a(ae.div, { tabIndex: -1, ...s, ref: h, onKeyDown: b });
|
|
634
634
|
});
|
|
635
|
-
|
|
636
|
-
function
|
|
635
|
+
ri.displayName = so;
|
|
636
|
+
function lo(t, { select: n = !1 } = {}) {
|
|
637
637
|
const e = document.activeElement;
|
|
638
638
|
for (const i of t)
|
|
639
|
-
if (
|
|
639
|
+
if (le(i, { select: n }), document.activeElement !== e) return;
|
|
640
640
|
}
|
|
641
|
-
function
|
|
642
|
-
const n =
|
|
641
|
+
function co(t) {
|
|
642
|
+
const n = oi(t), e = Tn(n, t), i = Tn(n.reverse(), t);
|
|
643
643
|
return [e, i];
|
|
644
644
|
}
|
|
645
|
-
function
|
|
645
|
+
function oi(t) {
|
|
646
646
|
const n = [], e = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, {
|
|
647
647
|
acceptNode: (i) => {
|
|
648
648
|
const r = i.tagName === "INPUT" && i.type === "hidden";
|
|
@@ -652,11 +652,11 @@ function ri(t) {
|
|
|
652
652
|
for (; e.nextNode(); ) n.push(e.currentNode);
|
|
653
653
|
return n;
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function Tn(t, n) {
|
|
656
656
|
for (const e of t)
|
|
657
|
-
if (!
|
|
657
|
+
if (!uo(e, { upTo: n })) return e;
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function uo(t, { upTo: n }) {
|
|
660
660
|
if (getComputedStyle(t).visibility === "hidden") return !0;
|
|
661
661
|
for (; t; ) {
|
|
662
662
|
if (n !== void 0 && t === n) return !1;
|
|
@@ -665,54 +665,54 @@ function co(t, { upTo: n }) {
|
|
|
665
665
|
}
|
|
666
666
|
return !1;
|
|
667
667
|
}
|
|
668
|
-
function
|
|
668
|
+
function fo(t) {
|
|
669
669
|
return t instanceof HTMLInputElement && "select" in t;
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function le(t, { select: n = !1 } = {}) {
|
|
672
672
|
if (t && t.focus) {
|
|
673
673
|
const e = document.activeElement;
|
|
674
|
-
t.focus({ preventScroll: !0 }), t !== e &&
|
|
674
|
+
t.focus({ preventScroll: !0 }), t !== e && fo(t) && n && t.select();
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
|
-
var
|
|
678
|
-
function
|
|
677
|
+
var Ln = mo();
|
|
678
|
+
function mo() {
|
|
679
679
|
let t = [];
|
|
680
680
|
return {
|
|
681
681
|
add(n) {
|
|
682
682
|
const e = t[0];
|
|
683
|
-
n !== e && (e == null || e.pause()), t =
|
|
683
|
+
n !== e && (e == null || e.pause()), t = Fn(t, n), t.unshift(n);
|
|
684
684
|
},
|
|
685
685
|
remove(n) {
|
|
686
686
|
var e;
|
|
687
|
-
t =
|
|
687
|
+
t = Fn(t, n), (e = t[0]) == null || e.resume();
|
|
688
688
|
}
|
|
689
689
|
};
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function Fn(t, n) {
|
|
692
692
|
const e = [...t], i = e.indexOf(n);
|
|
693
693
|
return i !== -1 && e.splice(i, 1), e;
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function ho(t) {
|
|
696
696
|
return t.filter((n) => n.tagName !== "A");
|
|
697
697
|
}
|
|
698
|
-
var
|
|
698
|
+
var po = "Portal", ai = p.forwardRef((t, n) => {
|
|
699
699
|
var l;
|
|
700
700
|
const { container: e, ...i } = t, [r, o] = p.useState(!1);
|
|
701
|
-
|
|
702
|
-
const
|
|
703
|
-
return
|
|
701
|
+
st(() => o(!0), []);
|
|
702
|
+
const s = e || r && ((l = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : l.body);
|
|
703
|
+
return s ? gr.createPortal(/* @__PURE__ */ a(ae.div, { ...i, ref: n }), s) : null;
|
|
704
704
|
});
|
|
705
|
-
|
|
706
|
-
function
|
|
705
|
+
ai.displayName = po;
|
|
706
|
+
function go(t, n) {
|
|
707
707
|
return p.useReducer((e, i) => n[e][i] ?? e, t);
|
|
708
708
|
}
|
|
709
|
-
var
|
|
710
|
-
const { present: n, children: e } = t, i =
|
|
709
|
+
var Ct = (t) => {
|
|
710
|
+
const { present: n, children: e } = t, i = vo(n), r = typeof e == "function" ? e({ present: i.isPresent }) : p.Children.only(e), o = we(i.ref, yo(r));
|
|
711
711
|
return typeof e == "function" || i.isPresent ? p.cloneElement(r, { ref: o }) : null;
|
|
712
712
|
};
|
|
713
|
-
|
|
714
|
-
function
|
|
715
|
-
const [n, e] = p.useState(), i = p.useRef({}), r = p.useRef(t), o = p.useRef("none"),
|
|
713
|
+
Ct.displayName = "Presence";
|
|
714
|
+
function vo(t) {
|
|
715
|
+
const [n, e] = p.useState(), i = p.useRef({}), r = p.useRef(t), o = p.useRef("none"), s = t ? "mounted" : "unmounted", [l, f] = go(s, {
|
|
716
716
|
mounted: {
|
|
717
717
|
UNMOUNT: "unmounted",
|
|
718
718
|
ANIMATION_OUT: "unmountSuspended"
|
|
@@ -728,13 +728,13 @@ function go(t) {
|
|
|
728
728
|
return p.useEffect(() => {
|
|
729
729
|
const c = Ge(i.current);
|
|
730
730
|
o.current = l === "mounted" ? c : "none";
|
|
731
|
-
}, [l]),
|
|
731
|
+
}, [l]), st(() => {
|
|
732
732
|
const c = i.current, d = r.current;
|
|
733
733
|
if (d !== t) {
|
|
734
734
|
const h = o.current, g = Ge(c);
|
|
735
735
|
t ? f("MOUNT") : g === "none" || (c == null ? void 0 : c.display) === "none" ? f("UNMOUNT") : f(d && h !== g ? "ANIMATION_OUT" : "UNMOUNT"), r.current = t;
|
|
736
736
|
}
|
|
737
|
-
}, [t, f]),
|
|
737
|
+
}, [t, f]), st(() => {
|
|
738
738
|
if (n) {
|
|
739
739
|
let c;
|
|
740
740
|
const d = n.ownerDocument.defaultView ?? window, u = (g) => {
|
|
@@ -763,21 +763,21 @@ function go(t) {
|
|
|
763
763
|
function Ge(t) {
|
|
764
764
|
return (t == null ? void 0 : t.animationName) || "none";
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function yo(t) {
|
|
767
767
|
var i, r;
|
|
768
768
|
let n = (i = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : i.get, e = n && "isReactWarning" in n && n.isReactWarning;
|
|
769
769
|
return e ? t.ref : (n = (r = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : r.get, e = n && "isReactWarning" in n && n.isReactWarning, e ? t.props.ref : t.props.ref || t.ref);
|
|
770
770
|
}
|
|
771
|
-
var
|
|
772
|
-
function
|
|
771
|
+
var Lt = 0;
|
|
772
|
+
function bo() {
|
|
773
773
|
p.useEffect(() => {
|
|
774
774
|
const t = document.querySelectorAll("[data-radix-focus-guard]");
|
|
775
|
-
return document.body.insertAdjacentElement("afterbegin", t[0] ??
|
|
776
|
-
|
|
775
|
+
return document.body.insertAdjacentElement("afterbegin", t[0] ?? Dn()), document.body.insertAdjacentElement("beforeend", t[1] ?? Dn()), Lt++, () => {
|
|
776
|
+
Lt === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((n) => n.remove()), Lt--;
|
|
777
777
|
};
|
|
778
778
|
}, []);
|
|
779
779
|
}
|
|
780
|
-
function
|
|
780
|
+
function Dn() {
|
|
781
781
|
const t = document.createElement("span");
|
|
782
782
|
return t.setAttribute("data-radix-focus-guard", ""), t.tabIndex = 0, t.style.outline = "none", t.style.opacity = "0", t.style.position = "fixed", t.style.pointerEvents = "none", t;
|
|
783
783
|
}
|
|
@@ -790,7 +790,7 @@ var te = function() {
|
|
|
790
790
|
return n;
|
|
791
791
|
}, te.apply(this, arguments);
|
|
792
792
|
};
|
|
793
|
-
function
|
|
793
|
+
function si(t, n) {
|
|
794
794
|
var e = {};
|
|
795
795
|
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && n.indexOf(i) < 0 && (e[i] = t[i]);
|
|
796
796
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -798,16 +798,16 @@ function ai(t, n) {
|
|
|
798
798
|
n.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[r]) && (e[i[r]] = t[i[r]]);
|
|
799
799
|
return e;
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function wo(t, n, e) {
|
|
802
802
|
if (e || arguments.length === 2) for (var i = 0, r = n.length, o; i < r; i++)
|
|
803
803
|
(o || !(i in n)) && (o || (o = Array.prototype.slice.call(n, 0, i)), o[i] = n[i]);
|
|
804
804
|
return t.concat(o || Array.prototype.slice.call(n));
|
|
805
805
|
}
|
|
806
|
-
var et = "right-scroll-bar-position", tt = "width-before-scroll-bar",
|
|
807
|
-
function
|
|
806
|
+
var et = "right-scroll-bar-position", tt = "width-before-scroll-bar", Co = "with-scroll-bars-hidden", xo = "--removed-body-scroll-bar-size";
|
|
807
|
+
function Ft(t, n) {
|
|
808
808
|
return typeof t == "function" ? t(n) : t && (t.current = n), t;
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function Eo(t, n) {
|
|
811
811
|
var e = H(function() {
|
|
812
812
|
return {
|
|
813
813
|
// value
|
|
@@ -828,31 +828,31 @@ function xo(t, n) {
|
|
|
828
828
|
})[0];
|
|
829
829
|
return e.callback = n, e.facade;
|
|
830
830
|
}
|
|
831
|
-
var
|
|
832
|
-
function
|
|
833
|
-
var e =
|
|
831
|
+
var Io = typeof window < "u" ? p.useLayoutEffect : p.useEffect, An = /* @__PURE__ */ new WeakMap();
|
|
832
|
+
function So(t, n) {
|
|
833
|
+
var e = Eo(null, function(i) {
|
|
834
834
|
return t.forEach(function(r) {
|
|
835
|
-
return
|
|
835
|
+
return Ft(r, i);
|
|
836
836
|
});
|
|
837
837
|
});
|
|
838
|
-
return
|
|
839
|
-
var i =
|
|
838
|
+
return Io(function() {
|
|
839
|
+
var i = An.get(e);
|
|
840
840
|
if (i) {
|
|
841
|
-
var r = new Set(i), o = new Set(t),
|
|
841
|
+
var r = new Set(i), o = new Set(t), s = e.current;
|
|
842
842
|
r.forEach(function(l) {
|
|
843
|
-
o.has(l) ||
|
|
843
|
+
o.has(l) || Ft(l, null);
|
|
844
844
|
}), o.forEach(function(l) {
|
|
845
|
-
r.has(l) ||
|
|
845
|
+
r.has(l) || Ft(l, s);
|
|
846
846
|
});
|
|
847
847
|
}
|
|
848
|
-
|
|
848
|
+
An.set(e, t);
|
|
849
849
|
}, [t]), e;
|
|
850
850
|
}
|
|
851
|
-
function
|
|
851
|
+
function Ro(t) {
|
|
852
852
|
return t;
|
|
853
853
|
}
|
|
854
|
-
function
|
|
855
|
-
n === void 0 && (n =
|
|
854
|
+
function No(t, n) {
|
|
855
|
+
n === void 0 && (n = Ro);
|
|
856
856
|
var e = [], i = !1, r = {
|
|
857
857
|
read: function() {
|
|
858
858
|
if (i)
|
|
@@ -860,17 +860,17 @@ function Ro(t, n) {
|
|
|
860
860
|
return e.length ? e[e.length - 1] : t;
|
|
861
861
|
},
|
|
862
862
|
useMedium: function(o) {
|
|
863
|
-
var
|
|
864
|
-
return e.push(
|
|
863
|
+
var s = n(o, i);
|
|
864
|
+
return e.push(s), function() {
|
|
865
865
|
e = e.filter(function(l) {
|
|
866
|
-
return l !==
|
|
866
|
+
return l !== s;
|
|
867
867
|
});
|
|
868
868
|
};
|
|
869
869
|
},
|
|
870
870
|
assignSyncMedium: function(o) {
|
|
871
871
|
for (i = !0; e.length; ) {
|
|
872
|
-
var
|
|
873
|
-
e = [],
|
|
872
|
+
var s = e;
|
|
873
|
+
e = [], s.forEach(o);
|
|
874
874
|
}
|
|
875
875
|
e = {
|
|
876
876
|
push: function(l) {
|
|
@@ -883,36 +883,36 @@ function Ro(t, n) {
|
|
|
883
883
|
},
|
|
884
884
|
assignMedium: function(o) {
|
|
885
885
|
i = !0;
|
|
886
|
-
var
|
|
886
|
+
var s = [];
|
|
887
887
|
if (e.length) {
|
|
888
888
|
var l = e;
|
|
889
|
-
e = [], l.forEach(o),
|
|
889
|
+
e = [], l.forEach(o), s = e;
|
|
890
890
|
}
|
|
891
891
|
var f = function() {
|
|
892
|
-
var d =
|
|
893
|
-
|
|
892
|
+
var d = s;
|
|
893
|
+
s = [], d.forEach(o);
|
|
894
894
|
}, c = function() {
|
|
895
895
|
return Promise.resolve().then(f);
|
|
896
896
|
};
|
|
897
897
|
c(), e = {
|
|
898
898
|
push: function(d) {
|
|
899
|
-
|
|
899
|
+
s.push(d), c();
|
|
900
900
|
},
|
|
901
901
|
filter: function(d) {
|
|
902
|
-
return
|
|
902
|
+
return s = s.filter(d), e;
|
|
903
903
|
}
|
|
904
904
|
};
|
|
905
905
|
}
|
|
906
906
|
};
|
|
907
907
|
return r;
|
|
908
908
|
}
|
|
909
|
-
function
|
|
909
|
+
function To(t) {
|
|
910
910
|
t === void 0 && (t = {});
|
|
911
|
-
var n =
|
|
911
|
+
var n = No(null);
|
|
912
912
|
return n.options = te({ async: !0, ssr: !1 }, t), n;
|
|
913
913
|
}
|
|
914
|
-
var
|
|
915
|
-
var n = t.sideCar, e =
|
|
914
|
+
var li = function(t) {
|
|
915
|
+
var n = t.sideCar, e = si(t, ["sideCar"]);
|
|
916
916
|
if (!n)
|
|
917
917
|
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
918
918
|
var i = n.read();
|
|
@@ -920,64 +920,64 @@ var si = function(t) {
|
|
|
920
920
|
throw new Error("Sidecar medium not found");
|
|
921
921
|
return p.createElement(i, te({}, e));
|
|
922
922
|
};
|
|
923
|
-
|
|
924
|
-
function
|
|
925
|
-
return t.useMedium(n),
|
|
923
|
+
li.isSideCarExport = !0;
|
|
924
|
+
function Lo(t, n) {
|
|
925
|
+
return t.useMedium(n), li;
|
|
926
926
|
}
|
|
927
|
-
var
|
|
928
|
-
},
|
|
927
|
+
var ci = To(), Dt = function() {
|
|
928
|
+
}, xt = p.forwardRef(function(t, n) {
|
|
929
929
|
var e = p.useRef(null), i = p.useState({
|
|
930
|
-
onScrollCapture:
|
|
931
|
-
onWheelCapture:
|
|
932
|
-
onTouchMoveCapture:
|
|
933
|
-
}), r = i[0], o = i[1],
|
|
930
|
+
onScrollCapture: Dt,
|
|
931
|
+
onWheelCapture: Dt,
|
|
932
|
+
onTouchMoveCapture: Dt
|
|
933
|
+
}), r = i[0], o = i[1], s = t.forwardProps, l = t.children, f = t.className, c = t.removeScrollBar, d = t.enabled, u = t.shards, h = t.sideCar, g = t.noIsolation, b = t.inert, m = t.allowPinchZoom, v = t.as, x = v === void 0 ? "div" : v, E = t.gapMode, S = si(t, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = h, I = So([e, n]), L = te(te({}, S), r);
|
|
934
934
|
return p.createElement(
|
|
935
935
|
p.Fragment,
|
|
936
936
|
null,
|
|
937
|
-
d && p.createElement(C, { sideCar:
|
|
938
|
-
|
|
937
|
+
d && p.createElement(C, { sideCar: ci, removeScrollBar: c, shards: u, noIsolation: g, inert: b, setCallbacks: o, allowPinchZoom: !!m, lockRef: e, gapMode: E }),
|
|
938
|
+
s ? p.cloneElement(p.Children.only(l), te(te({}, L), { ref: I })) : p.createElement(x, te({}, L, { className: f, ref: I }), l)
|
|
939
939
|
);
|
|
940
940
|
});
|
|
941
|
-
|
|
941
|
+
xt.defaultProps = {
|
|
942
942
|
enabled: !0,
|
|
943
943
|
removeScrollBar: !0,
|
|
944
944
|
inert: !1
|
|
945
945
|
};
|
|
946
|
-
|
|
946
|
+
xt.classNames = {
|
|
947
947
|
fullWidth: tt,
|
|
948
948
|
zeroRight: et
|
|
949
949
|
};
|
|
950
|
-
var
|
|
950
|
+
var Fo = function() {
|
|
951
951
|
if (typeof __webpack_nonce__ < "u")
|
|
952
952
|
return __webpack_nonce__;
|
|
953
953
|
};
|
|
954
|
-
function
|
|
954
|
+
function Do() {
|
|
955
955
|
if (!document)
|
|
956
956
|
return null;
|
|
957
957
|
var t = document.createElement("style");
|
|
958
958
|
t.type = "text/css";
|
|
959
|
-
var n =
|
|
959
|
+
var n = Fo();
|
|
960
960
|
return n && t.setAttribute("nonce", n), t;
|
|
961
961
|
}
|
|
962
|
-
function
|
|
962
|
+
function Ao(t, n) {
|
|
963
963
|
t.styleSheet ? t.styleSheet.cssText = n : t.appendChild(document.createTextNode(n));
|
|
964
964
|
}
|
|
965
|
-
function
|
|
965
|
+
function Oo(t) {
|
|
966
966
|
var n = document.head || document.getElementsByTagName("head")[0];
|
|
967
967
|
n.appendChild(t);
|
|
968
968
|
}
|
|
969
|
-
var
|
|
969
|
+
var Po = function() {
|
|
970
970
|
var t = 0, n = null;
|
|
971
971
|
return {
|
|
972
972
|
add: function(e) {
|
|
973
|
-
t == 0 && (n =
|
|
973
|
+
t == 0 && (n = Do()) && (Ao(n, e), Oo(n)), t++;
|
|
974
974
|
},
|
|
975
975
|
remove: function() {
|
|
976
976
|
t--, !t && n && (n.parentNode && n.parentNode.removeChild(n), n = null);
|
|
977
977
|
}
|
|
978
978
|
};
|
|
979
|
-
},
|
|
980
|
-
var t =
|
|
979
|
+
}, ko = function() {
|
|
980
|
+
var t = Po();
|
|
981
981
|
return function(n, e) {
|
|
982
982
|
p.useEffect(function() {
|
|
983
983
|
return t.add(n), function() {
|
|
@@ -985,40 +985,40 @@ var Oo = function() {
|
|
|
985
985
|
};
|
|
986
986
|
}, [n && e]);
|
|
987
987
|
};
|
|
988
|
-
},
|
|
989
|
-
var t =
|
|
988
|
+
}, di = function() {
|
|
989
|
+
var t = ko(), n = function(e) {
|
|
990
990
|
var i = e.styles, r = e.dynamic;
|
|
991
991
|
return t(i, r), null;
|
|
992
992
|
};
|
|
993
993
|
return n;
|
|
994
|
-
},
|
|
994
|
+
}, Mo = {
|
|
995
995
|
left: 0,
|
|
996
996
|
top: 0,
|
|
997
997
|
right: 0,
|
|
998
998
|
gap: 0
|
|
999
|
-
},
|
|
999
|
+
}, At = function(t) {
|
|
1000
1000
|
return parseInt(t || "", 10) || 0;
|
|
1001
|
-
},
|
|
1001
|
+
}, zo = function(t) {
|
|
1002
1002
|
var n = window.getComputedStyle(document.body), e = n[t === "padding" ? "paddingLeft" : "marginLeft"], i = n[t === "padding" ? "paddingTop" : "marginTop"], r = n[t === "padding" ? "paddingRight" : "marginRight"];
|
|
1003
|
-
return [
|
|
1003
|
+
return [At(e), At(i), At(r)];
|
|
1004
1004
|
}, _o = function(t) {
|
|
1005
1005
|
if (t === void 0 && (t = "margin"), typeof window > "u")
|
|
1006
|
-
return
|
|
1007
|
-
var n =
|
|
1006
|
+
return Mo;
|
|
1007
|
+
var n = zo(t), e = document.documentElement.clientWidth, i = window.innerWidth;
|
|
1008
1008
|
return {
|
|
1009
1009
|
left: n[0],
|
|
1010
1010
|
top: n[1],
|
|
1011
1011
|
right: n[2],
|
|
1012
1012
|
gap: Math.max(0, i - e + n[2] - n[0])
|
|
1013
1013
|
};
|
|
1014
|
-
},
|
|
1015
|
-
var r = t.left, o = t.top,
|
|
1014
|
+
}, $o = di(), $e = "data-scroll-locked", Bo = function(t, n, e, i) {
|
|
1015
|
+
var r = t.left, o = t.top, s = t.right, l = t.gap;
|
|
1016
1016
|
return e === void 0 && (e = "margin"), `
|
|
1017
|
-
.`.concat(
|
|
1017
|
+
.`.concat(Co, ` {
|
|
1018
1018
|
overflow: hidden `).concat(i, `;
|
|
1019
1019
|
padding-right: `).concat(l, "px ").concat(i, `;
|
|
1020
1020
|
}
|
|
1021
|
-
body[`).concat(
|
|
1021
|
+
body[`).concat($e, `] {
|
|
1022
1022
|
overflow: hidden `).concat(i, `;
|
|
1023
1023
|
overscroll-behavior: contain;
|
|
1024
1024
|
`).concat([
|
|
@@ -1026,7 +1026,7 @@ var Oo = function() {
|
|
|
1026
1026
|
e === "margin" && `
|
|
1027
1027
|
padding-left: `.concat(r, `px;
|
|
1028
1028
|
padding-top: `).concat(o, `px;
|
|
1029
|
-
padding-right: `).concat(
|
|
1029
|
+
padding-right: `).concat(s, `px;
|
|
1030
1030
|
margin-left:0;
|
|
1031
1031
|
margin-top:0;
|
|
1032
1032
|
margin-right: `).concat(l, "px ").concat(i, `;
|
|
@@ -1051,92 +1051,92 @@ var Oo = function() {
|
|
|
1051
1051
|
margin-right: 0 `).concat(i, `;
|
|
1052
1052
|
}
|
|
1053
1053
|
|
|
1054
|
-
body[`).concat(
|
|
1055
|
-
`).concat(
|
|
1054
|
+
body[`).concat($e, `] {
|
|
1055
|
+
`).concat(xo, ": ").concat(l, `px;
|
|
1056
1056
|
}
|
|
1057
1057
|
`);
|
|
1058
|
-
},
|
|
1059
|
-
var t = parseInt(document.body.getAttribute(
|
|
1058
|
+
}, On = function() {
|
|
1059
|
+
var t = parseInt(document.body.getAttribute($e) || "0", 10);
|
|
1060
1060
|
return isFinite(t) ? t : 0;
|
|
1061
1061
|
}, Vo = function() {
|
|
1062
1062
|
p.useEffect(function() {
|
|
1063
|
-
return document.body.setAttribute(
|
|
1064
|
-
var t =
|
|
1065
|
-
t <= 0 ? document.body.removeAttribute(
|
|
1063
|
+
return document.body.setAttribute($e, (On() + 1).toString()), function() {
|
|
1064
|
+
var t = On() - 1;
|
|
1065
|
+
t <= 0 ? document.body.removeAttribute($e) : document.body.setAttribute($e, t.toString());
|
|
1066
1066
|
};
|
|
1067
1067
|
}, []);
|
|
1068
|
-
},
|
|
1068
|
+
}, Uo = function(t) {
|
|
1069
1069
|
var n = t.noRelative, e = t.noImportant, i = t.gapMode, r = i === void 0 ? "margin" : i;
|
|
1070
1070
|
Vo();
|
|
1071
1071
|
var o = p.useMemo(function() {
|
|
1072
1072
|
return _o(r);
|
|
1073
1073
|
}, [r]);
|
|
1074
|
-
return p.createElement(
|
|
1075
|
-
},
|
|
1074
|
+
return p.createElement($o, { styles: Bo(o, !n, r, e ? "" : "!important") });
|
|
1075
|
+
}, Mt = !1;
|
|
1076
1076
|
if (typeof window < "u")
|
|
1077
1077
|
try {
|
|
1078
1078
|
var Xe = Object.defineProperty({}, "passive", {
|
|
1079
1079
|
get: function() {
|
|
1080
|
-
return
|
|
1080
|
+
return Mt = !0, !0;
|
|
1081
1081
|
}
|
|
1082
1082
|
});
|
|
1083
1083
|
window.addEventListener("test", Xe, Xe), window.removeEventListener("test", Xe, Xe);
|
|
1084
1084
|
} catch {
|
|
1085
|
-
|
|
1085
|
+
Mt = !1;
|
|
1086
1086
|
}
|
|
1087
|
-
var
|
|
1087
|
+
var Se = Mt ? { passive: !1 } : !1, jo = function(t) {
|
|
1088
1088
|
return t.tagName === "TEXTAREA";
|
|
1089
|
-
},
|
|
1089
|
+
}, ui = function(t, n) {
|
|
1090
1090
|
if (!(t instanceof Element))
|
|
1091
1091
|
return !1;
|
|
1092
1092
|
var e = window.getComputedStyle(t);
|
|
1093
1093
|
return (
|
|
1094
1094
|
// not-not-scrollable
|
|
1095
1095
|
e[n] !== "hidden" && // contains scroll inside self
|
|
1096
|
-
!(e.overflowY === e.overflowX && !
|
|
1096
|
+
!(e.overflowY === e.overflowX && !jo(t) && e[n] === "visible")
|
|
1097
1097
|
);
|
|
1098
|
-
}, jo = function(t) {
|
|
1099
|
-
return di(t, "overflowY");
|
|
1100
1098
|
}, Wo = function(t) {
|
|
1101
|
-
return
|
|
1102
|
-
},
|
|
1099
|
+
return ui(t, "overflowY");
|
|
1100
|
+
}, qo = function(t) {
|
|
1101
|
+
return ui(t, "overflowX");
|
|
1102
|
+
}, Pn = function(t, n) {
|
|
1103
1103
|
var e = n.ownerDocument, i = n;
|
|
1104
1104
|
do {
|
|
1105
1105
|
typeof ShadowRoot < "u" && i instanceof ShadowRoot && (i = i.host);
|
|
1106
|
-
var r =
|
|
1106
|
+
var r = fi(t, i);
|
|
1107
1107
|
if (r) {
|
|
1108
|
-
var o =
|
|
1109
|
-
if (
|
|
1108
|
+
var o = mi(t, i), s = o[1], l = o[2];
|
|
1109
|
+
if (s > l)
|
|
1110
1110
|
return !0;
|
|
1111
1111
|
}
|
|
1112
1112
|
i = i.parentNode;
|
|
1113
1113
|
} while (i && i !== e.body);
|
|
1114
1114
|
return !1;
|
|
1115
|
-
},
|
|
1115
|
+
}, Ho = function(t) {
|
|
1116
1116
|
var n = t.scrollTop, e = t.scrollHeight, i = t.clientHeight;
|
|
1117
1117
|
return [
|
|
1118
1118
|
n,
|
|
1119
1119
|
e,
|
|
1120
1120
|
i
|
|
1121
1121
|
];
|
|
1122
|
-
},
|
|
1122
|
+
}, Go = function(t) {
|
|
1123
1123
|
var n = t.scrollLeft, e = t.scrollWidth, i = t.clientWidth;
|
|
1124
1124
|
return [
|
|
1125
1125
|
n,
|
|
1126
1126
|
e,
|
|
1127
1127
|
i
|
|
1128
1128
|
];
|
|
1129
|
-
}, ui = function(t, n) {
|
|
1130
|
-
return t === "v" ? jo(n) : Wo(n);
|
|
1131
1129
|
}, fi = function(t, n) {
|
|
1132
|
-
return t === "v" ?
|
|
1133
|
-
},
|
|
1130
|
+
return t === "v" ? Wo(n) : qo(n);
|
|
1131
|
+
}, mi = function(t, n) {
|
|
1132
|
+
return t === "v" ? Ho(n) : Go(n);
|
|
1133
|
+
}, Xo = function(t, n) {
|
|
1134
1134
|
return t === "h" && n === "rtl" ? -1 : 1;
|
|
1135
|
-
},
|
|
1136
|
-
var o =
|
|
1135
|
+
}, Ko = function(t, n, e, i, r) {
|
|
1136
|
+
var o = Xo(t, window.getComputedStyle(n).direction), s = o * i, l = e.target, f = n.contains(l), c = !1, d = s > 0, u = 0, h = 0;
|
|
1137
1137
|
do {
|
|
1138
|
-
var g =
|
|
1139
|
-
(b || x) &&
|
|
1138
|
+
var g = mi(t, l), b = g[0], m = g[1], v = g[2], x = m - v - o * b;
|
|
1139
|
+
(b || x) && fi(t, l) && (u += x, h += b), l instanceof ShadowRoot ? l = l.host : l = l.parentNode;
|
|
1140
1140
|
} while (
|
|
1141
1141
|
// portaled content
|
|
1142
1142
|
!f && l !== document.body || // self content
|
|
@@ -1145,26 +1145,26 @@ var Ie = Ot ? { passive: !1 } : !1, Uo = function(t) {
|
|
|
1145
1145
|
return (d && Math.abs(u) < 1 || !d && Math.abs(h) < 1) && (c = !0), c;
|
|
1146
1146
|
}, Ke = function(t) {
|
|
1147
1147
|
return "changedTouches" in t ? [t.changedTouches[0].clientX, t.changedTouches[0].clientY] : [0, 0];
|
|
1148
|
-
}, Pn = function(t) {
|
|
1149
|
-
return [t.deltaX, t.deltaY];
|
|
1150
1148
|
}, kn = function(t) {
|
|
1149
|
+
return [t.deltaX, t.deltaY];
|
|
1150
|
+
}, Mn = function(t) {
|
|
1151
1151
|
return t && "current" in t ? t.current : t;
|
|
1152
|
-
},
|
|
1152
|
+
}, Yo = function(t, n) {
|
|
1153
1153
|
return t[0] === n[0] && t[1] === n[1];
|
|
1154
|
-
},
|
|
1154
|
+
}, Qo = function(t) {
|
|
1155
1155
|
return `
|
|
1156
1156
|
.block-interactivity-`.concat(t, ` {pointer-events: none;}
|
|
1157
1157
|
.allow-interactivity-`).concat(t, ` {pointer-events: all;}
|
|
1158
1158
|
`);
|
|
1159
|
-
},
|
|
1160
|
-
function
|
|
1161
|
-
var n = p.useRef([]), e = p.useRef([0, 0]), i = p.useRef(), r = p.useState(
|
|
1159
|
+
}, Jo = 0, Re = [];
|
|
1160
|
+
function Zo(t) {
|
|
1161
|
+
var n = p.useRef([]), e = p.useRef([0, 0]), i = p.useRef(), r = p.useState(Jo++)[0], o = p.useState(di)[0], s = p.useRef(t);
|
|
1162
1162
|
p.useEffect(function() {
|
|
1163
|
-
|
|
1163
|
+
s.current = t;
|
|
1164
1164
|
}, [t]), p.useEffect(function() {
|
|
1165
1165
|
if (t.inert) {
|
|
1166
1166
|
document.body.classList.add("block-interactivity-".concat(r));
|
|
1167
|
-
var m =
|
|
1167
|
+
var m = wo([t.lockRef.current], (t.shards || []).map(Mn), !0).filter(Boolean);
|
|
1168
1168
|
return m.forEach(function(v) {
|
|
1169
1169
|
return v.classList.add("allow-interactivity-".concat(r));
|
|
1170
1170
|
}), function() {
|
|
@@ -1176,38 +1176,38 @@ function Jo(t) {
|
|
|
1176
1176
|
}, [t.inert, t.lockRef.current, t.shards]);
|
|
1177
1177
|
var l = p.useCallback(function(m, v) {
|
|
1178
1178
|
if ("touches" in m && m.touches.length === 2 || m.type === "wheel" && m.ctrlKey)
|
|
1179
|
-
return !
|
|
1179
|
+
return !s.current.allowPinchZoom;
|
|
1180
1180
|
var x = Ke(m), E = e.current, S = "deltaX" in m ? m.deltaX : E[0] - x[0], C = "deltaY" in m ? m.deltaY : E[1] - x[1], I, L = m.target, R = Math.abs(S) > Math.abs(C) ? "h" : "v";
|
|
1181
1181
|
if ("touches" in m && R === "h" && L.type === "range")
|
|
1182
1182
|
return !1;
|
|
1183
|
-
var F =
|
|
1183
|
+
var F = Pn(R, L);
|
|
1184
1184
|
if (!F)
|
|
1185
1185
|
return !0;
|
|
1186
|
-
if (F ? I = R : (I = R === "v" ? "h" : "v", F =
|
|
1186
|
+
if (F ? I = R : (I = R === "v" ? "h" : "v", F = Pn(R, L)), !F)
|
|
1187
1187
|
return !1;
|
|
1188
1188
|
if (!i.current && "changedTouches" in m && (S || C) && (i.current = I), !I)
|
|
1189
1189
|
return !0;
|
|
1190
|
-
var
|
|
1191
|
-
return
|
|
1190
|
+
var V = i.current || I;
|
|
1191
|
+
return Ko(V, v, m, V === "h" ? S : C);
|
|
1192
1192
|
}, []), f = p.useCallback(function(m) {
|
|
1193
1193
|
var v = m;
|
|
1194
|
-
if (!(!
|
|
1195
|
-
var x = "deltaY" in v ?
|
|
1196
|
-
return I.name === v.type && (I.target === v.target || v.target === I.shadowParent) &&
|
|
1194
|
+
if (!(!Re.length || Re[Re.length - 1] !== o)) {
|
|
1195
|
+
var x = "deltaY" in v ? kn(v) : Ke(v), E = n.current.filter(function(I) {
|
|
1196
|
+
return I.name === v.type && (I.target === v.target || v.target === I.shadowParent) && Yo(I.delta, x);
|
|
1197
1197
|
})[0];
|
|
1198
1198
|
if (E && E.should) {
|
|
1199
1199
|
v.cancelable && v.preventDefault();
|
|
1200
1200
|
return;
|
|
1201
1201
|
}
|
|
1202
1202
|
if (!E) {
|
|
1203
|
-
var S = (
|
|
1203
|
+
var S = (s.current.shards || []).map(Mn).filter(Boolean).filter(function(I) {
|
|
1204
1204
|
return I.contains(v.target);
|
|
1205
|
-
}), C = S.length > 0 ? l(v, S[0]) : !
|
|
1205
|
+
}), C = S.length > 0 ? l(v, S[0]) : !s.current.noIsolation;
|
|
1206
1206
|
C && v.cancelable && v.preventDefault();
|
|
1207
1207
|
}
|
|
1208
1208
|
}
|
|
1209
1209
|
}, []), c = p.useCallback(function(m, v, x, E) {
|
|
1210
|
-
var S = { name: m, delta: v, target: x, should: E, shadowParent:
|
|
1210
|
+
var S = { name: m, delta: v, target: x, should: E, shadowParent: ea(x) };
|
|
1211
1211
|
n.current.push(S), setTimeout(function() {
|
|
1212
1212
|
n.current = n.current.filter(function(C) {
|
|
1213
1213
|
return C !== S;
|
|
@@ -1216,59 +1216,59 @@ function Jo(t) {
|
|
|
1216
1216
|
}, []), d = p.useCallback(function(m) {
|
|
1217
1217
|
e.current = Ke(m), i.current = void 0;
|
|
1218
1218
|
}, []), u = p.useCallback(function(m) {
|
|
1219
|
-
c(m.type,
|
|
1219
|
+
c(m.type, kn(m), m.target, l(m, t.lockRef.current));
|
|
1220
1220
|
}, []), h = p.useCallback(function(m) {
|
|
1221
1221
|
c(m.type, Ke(m), m.target, l(m, t.lockRef.current));
|
|
1222
1222
|
}, []);
|
|
1223
1223
|
p.useEffect(function() {
|
|
1224
|
-
return
|
|
1224
|
+
return Re.push(o), t.setCallbacks({
|
|
1225
1225
|
onScrollCapture: u,
|
|
1226
1226
|
onWheelCapture: u,
|
|
1227
1227
|
onTouchMoveCapture: h
|
|
1228
|
-
}), document.addEventListener("wheel", f,
|
|
1229
|
-
|
|
1228
|
+
}), document.addEventListener("wheel", f, Se), document.addEventListener("touchmove", f, Se), document.addEventListener("touchstart", d, Se), function() {
|
|
1229
|
+
Re = Re.filter(function(m) {
|
|
1230
1230
|
return m !== o;
|
|
1231
|
-
}), document.removeEventListener("wheel", f,
|
|
1231
|
+
}), document.removeEventListener("wheel", f, Se), document.removeEventListener("touchmove", f, Se), document.removeEventListener("touchstart", d, Se);
|
|
1232
1232
|
};
|
|
1233
1233
|
}, []);
|
|
1234
1234
|
var g = t.removeScrollBar, b = t.inert;
|
|
1235
1235
|
return p.createElement(
|
|
1236
1236
|
p.Fragment,
|
|
1237
1237
|
null,
|
|
1238
|
-
b ? p.createElement(o, { styles:
|
|
1239
|
-
g ? p.createElement(
|
|
1238
|
+
b ? p.createElement(o, { styles: Qo(r) }) : null,
|
|
1239
|
+
g ? p.createElement(Uo, { gapMode: t.gapMode }) : null
|
|
1240
1240
|
);
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1242
|
+
function ea(t) {
|
|
1243
1243
|
for (var n = null; t !== null; )
|
|
1244
1244
|
t instanceof ShadowRoot && (n = t.host, t = t.host), t = t.parentNode;
|
|
1245
1245
|
return n;
|
|
1246
1246
|
}
|
|
1247
|
-
const
|
|
1248
|
-
var
|
|
1249
|
-
return p.createElement(
|
|
1247
|
+
const ta = Lo(ci, Zo);
|
|
1248
|
+
var hi = p.forwardRef(function(t, n) {
|
|
1249
|
+
return p.createElement(xt, te({}, t, { ref: n, sideCar: ta }));
|
|
1250
1250
|
});
|
|
1251
|
-
|
|
1252
|
-
var
|
|
1251
|
+
hi.classNames = xt.classNames;
|
|
1252
|
+
var na = function(t) {
|
|
1253
1253
|
if (typeof document > "u")
|
|
1254
1254
|
return null;
|
|
1255
1255
|
var n = Array.isArray(t) ? t[0] : t;
|
|
1256
1256
|
return n.ownerDocument.body;
|
|
1257
|
-
},
|
|
1258
|
-
return t && (t.host ||
|
|
1259
|
-
},
|
|
1257
|
+
}, Ne = /* @__PURE__ */ new WeakMap(), Ye = /* @__PURE__ */ new WeakMap(), Qe = {}, Ot = 0, pi = function(t) {
|
|
1258
|
+
return t && (t.host || pi(t.parentNode));
|
|
1259
|
+
}, ia = function(t, n) {
|
|
1260
1260
|
return n.map(function(e) {
|
|
1261
1261
|
if (t.contains(e))
|
|
1262
1262
|
return e;
|
|
1263
|
-
var i =
|
|
1263
|
+
var i = pi(e);
|
|
1264
1264
|
return i && t.contains(i) ? i : (console.error("aria-hidden", e, "in not contained inside", t, ". Doing nothing"), null);
|
|
1265
1265
|
}).filter(function(e) {
|
|
1266
1266
|
return !!e;
|
|
1267
1267
|
});
|
|
1268
|
-
},
|
|
1269
|
-
var r =
|
|
1268
|
+
}, ra = function(t, n, e, i) {
|
|
1269
|
+
var r = ia(n, Array.isArray(t) ? t : [t]);
|
|
1270
1270
|
Qe[e] || (Qe[e] = /* @__PURE__ */ new WeakMap());
|
|
1271
|
-
var o = Qe[e],
|
|
1271
|
+
var o = Qe[e], s = [], l = /* @__PURE__ */ new Set(), f = new Set(r), c = function(u) {
|
|
1272
1272
|
!u || l.has(u) || (l.add(u), c(u.parentNode));
|
|
1273
1273
|
};
|
|
1274
1274
|
r.forEach(c);
|
|
@@ -1278,99 +1278,99 @@ var ta = function(t) {
|
|
|
1278
1278
|
d(h);
|
|
1279
1279
|
else
|
|
1280
1280
|
try {
|
|
1281
|
-
var g = h.getAttribute(i), b = g !== null && g !== "false", m = (
|
|
1282
|
-
|
|
1281
|
+
var g = h.getAttribute(i), b = g !== null && g !== "false", m = (Ne.get(h) || 0) + 1, v = (o.get(h) || 0) + 1;
|
|
1282
|
+
Ne.set(h, m), o.set(h, v), s.push(h), m === 1 && b && Ye.set(h, !0), v === 1 && h.setAttribute(e, "true"), b || h.setAttribute(i, "true");
|
|
1283
1283
|
} catch (x) {
|
|
1284
1284
|
console.error("aria-hidden: cannot operate on ", h, x);
|
|
1285
1285
|
}
|
|
1286
1286
|
});
|
|
1287
1287
|
};
|
|
1288
|
-
return d(n), l.clear(),
|
|
1289
|
-
|
|
1290
|
-
var h =
|
|
1291
|
-
|
|
1292
|
-
}),
|
|
1288
|
+
return d(n), l.clear(), Ot++, function() {
|
|
1289
|
+
s.forEach(function(u) {
|
|
1290
|
+
var h = Ne.get(u) - 1, g = o.get(u) - 1;
|
|
1291
|
+
Ne.set(u, h), o.set(u, g), h || (Ye.has(u) || u.removeAttribute(i), Ye.delete(u)), g || u.removeAttribute(e);
|
|
1292
|
+
}), Ot--, Ot || (Ne = /* @__PURE__ */ new WeakMap(), Ne = /* @__PURE__ */ new WeakMap(), Ye = /* @__PURE__ */ new WeakMap(), Qe = {});
|
|
1293
1293
|
};
|
|
1294
|
-
},
|
|
1294
|
+
}, oa = function(t, n, e) {
|
|
1295
1295
|
e === void 0 && (e = "data-aria-hidden");
|
|
1296
|
-
var i = Array.from(Array.isArray(t) ? t : [t]), r =
|
|
1297
|
-
return r ? (i.push.apply(i, Array.from(r.querySelectorAll("[aria-live]"))),
|
|
1296
|
+
var i = Array.from(Array.isArray(t) ? t : [t]), r = na(t);
|
|
1297
|
+
return r ? (i.push.apply(i, Array.from(r.querySelectorAll("[aria-live]"))), ra(i, r, e, "aria-hidden")) : function() {
|
|
1298
1298
|
return null;
|
|
1299
1299
|
};
|
|
1300
|
-
},
|
|
1300
|
+
}, rn = "Dialog", [gi, ps] = Vr(rn), [aa, J] = gi(rn), vi = (t) => {
|
|
1301
1301
|
const {
|
|
1302
1302
|
__scopeDialog: n,
|
|
1303
1303
|
children: e,
|
|
1304
1304
|
open: i,
|
|
1305
1305
|
defaultOpen: r,
|
|
1306
1306
|
onOpenChange: o,
|
|
1307
|
-
modal:
|
|
1308
|
-
} = t, l = p.useRef(null), f = p.useRef(null), [c = !1, d] =
|
|
1307
|
+
modal: s = !0
|
|
1308
|
+
} = t, l = p.useRef(null), f = p.useRef(null), [c = !1, d] = qr({
|
|
1309
1309
|
prop: i,
|
|
1310
1310
|
defaultProp: r,
|
|
1311
1311
|
onChange: o
|
|
1312
1312
|
});
|
|
1313
|
-
return /* @__PURE__ */
|
|
1314
|
-
|
|
1313
|
+
return /* @__PURE__ */ a(
|
|
1314
|
+
aa,
|
|
1315
1315
|
{
|
|
1316
1316
|
scope: n,
|
|
1317
1317
|
triggerRef: l,
|
|
1318
1318
|
contentRef: f,
|
|
1319
|
-
contentId:
|
|
1320
|
-
titleId:
|
|
1321
|
-
descriptionId:
|
|
1319
|
+
contentId: Rt(),
|
|
1320
|
+
titleId: Rt(),
|
|
1321
|
+
descriptionId: Rt(),
|
|
1322
1322
|
open: c,
|
|
1323
1323
|
onOpenChange: d,
|
|
1324
1324
|
onOpenToggle: p.useCallback(() => d((u) => !u), [d]),
|
|
1325
|
-
modal:
|
|
1325
|
+
modal: s,
|
|
1326
1326
|
children: e
|
|
1327
1327
|
}
|
|
1328
1328
|
);
|
|
1329
1329
|
};
|
|
1330
|
-
|
|
1331
|
-
var
|
|
1330
|
+
vi.displayName = rn;
|
|
1331
|
+
var yi = "DialogTrigger", sa = p.forwardRef(
|
|
1332
1332
|
(t, n) => {
|
|
1333
|
-
const { __scopeDialog: e, ...i } = t, r = J(
|
|
1334
|
-
return /* @__PURE__ */
|
|
1335
|
-
|
|
1333
|
+
const { __scopeDialog: e, ...i } = t, r = J(yi, e), o = we(n, r.triggerRef);
|
|
1334
|
+
return /* @__PURE__ */ a(
|
|
1335
|
+
ae.button,
|
|
1336
1336
|
{
|
|
1337
1337
|
type: "button",
|
|
1338
1338
|
"aria-haspopup": "dialog",
|
|
1339
1339
|
"aria-expanded": r.open,
|
|
1340
1340
|
"aria-controls": r.contentId,
|
|
1341
|
-
"data-state":
|
|
1341
|
+
"data-state": sn(r.open),
|
|
1342
1342
|
...i,
|
|
1343
1343
|
ref: o,
|
|
1344
|
-
onClick:
|
|
1344
|
+
onClick: ce(t.onClick, r.onOpenToggle)
|
|
1345
1345
|
}
|
|
1346
1346
|
);
|
|
1347
1347
|
}
|
|
1348
1348
|
);
|
|
1349
|
-
|
|
1350
|
-
var
|
|
1349
|
+
sa.displayName = yi;
|
|
1350
|
+
var on = "DialogPortal", [la, bi] = gi(on, {
|
|
1351
1351
|
forceMount: void 0
|
|
1352
|
-
}),
|
|
1353
|
-
const { __scopeDialog: n, forceMount: e, children: i, container: r } = t, o = J(
|
|
1354
|
-
return /* @__PURE__ */
|
|
1352
|
+
}), wi = (t) => {
|
|
1353
|
+
const { __scopeDialog: n, forceMount: e, children: i, container: r } = t, o = J(on, n);
|
|
1354
|
+
return /* @__PURE__ */ a(la, { scope: n, forceMount: e, children: p.Children.map(i, (s) => /* @__PURE__ */ a(Ct, { present: e || o.open, children: /* @__PURE__ */ a(ai, { asChild: !0, container: r, children: s }) })) });
|
|
1355
1355
|
};
|
|
1356
|
-
|
|
1357
|
-
var
|
|
1356
|
+
wi.displayName = on;
|
|
1357
|
+
var lt = "DialogOverlay", Ci = p.forwardRef(
|
|
1358
1358
|
(t, n) => {
|
|
1359
|
-
const e =
|
|
1360
|
-
return o.modal ? /* @__PURE__ */
|
|
1359
|
+
const e = bi(lt, t.__scopeDialog), { forceMount: i = e.forceMount, ...r } = t, o = J(lt, t.__scopeDialog);
|
|
1360
|
+
return o.modal ? /* @__PURE__ */ a(Ct, { present: i || o.open, children: /* @__PURE__ */ a(ca, { ...r, ref: n }) }) : null;
|
|
1361
1361
|
}
|
|
1362
1362
|
);
|
|
1363
|
-
|
|
1364
|
-
var
|
|
1363
|
+
Ci.displayName = lt;
|
|
1364
|
+
var ca = p.forwardRef(
|
|
1365
1365
|
(t, n) => {
|
|
1366
|
-
const { __scopeDialog: e, ...i } = t, r = J(
|
|
1366
|
+
const { __scopeDialog: e, ...i } = t, r = J(lt, e);
|
|
1367
1367
|
return (
|
|
1368
1368
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
1369
1369
|
// ie. when `Overlay` and `Content` are siblings
|
|
1370
|
-
/* @__PURE__ */
|
|
1371
|
-
|
|
1370
|
+
/* @__PURE__ */ a(hi, { as: nn, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ a(
|
|
1371
|
+
ae.div,
|
|
1372
1372
|
{
|
|
1373
|
-
"data-state":
|
|
1373
|
+
"data-state": sn(r.open),
|
|
1374
1374
|
...i,
|
|
1375
1375
|
ref: n,
|
|
1376
1376
|
style: { pointerEvents: "auto", ...i.style }
|
|
@@ -1378,85 +1378,85 @@ var la = p.forwardRef(
|
|
|
1378
1378
|
) })
|
|
1379
1379
|
);
|
|
1380
1380
|
}
|
|
1381
|
-
), ge = "DialogContent",
|
|
1381
|
+
), ge = "DialogContent", xi = p.forwardRef(
|
|
1382
1382
|
(t, n) => {
|
|
1383
|
-
const e =
|
|
1384
|
-
return /* @__PURE__ */
|
|
1383
|
+
const e = bi(ge, t.__scopeDialog), { forceMount: i = e.forceMount, ...r } = t, o = J(ge, t.__scopeDialog);
|
|
1384
|
+
return /* @__PURE__ */ a(Ct, { present: i || o.open, children: o.modal ? /* @__PURE__ */ a(da, { ...r, ref: n }) : /* @__PURE__ */ a(ua, { ...r, ref: n }) });
|
|
1385
1385
|
}
|
|
1386
1386
|
);
|
|
1387
|
-
|
|
1388
|
-
var
|
|
1387
|
+
xi.displayName = ge;
|
|
1388
|
+
var da = p.forwardRef(
|
|
1389
1389
|
(t, n) => {
|
|
1390
|
-
const e = J(ge, t.__scopeDialog), i = p.useRef(null), r =
|
|
1390
|
+
const e = J(ge, t.__scopeDialog), i = p.useRef(null), r = we(n, e.contentRef, i);
|
|
1391
1391
|
return p.useEffect(() => {
|
|
1392
1392
|
const o = i.current;
|
|
1393
|
-
if (o) return
|
|
1394
|
-
}, []), /* @__PURE__ */
|
|
1395
|
-
|
|
1393
|
+
if (o) return oa(o);
|
|
1394
|
+
}, []), /* @__PURE__ */ a(
|
|
1395
|
+
Ei,
|
|
1396
1396
|
{
|
|
1397
1397
|
...t,
|
|
1398
1398
|
ref: r,
|
|
1399
1399
|
trapFocus: e.open,
|
|
1400
1400
|
disableOutsidePointerEvents: !0,
|
|
1401
|
-
onCloseAutoFocus:
|
|
1402
|
-
var
|
|
1403
|
-
o.preventDefault(), (
|
|
1401
|
+
onCloseAutoFocus: ce(t.onCloseAutoFocus, (o) => {
|
|
1402
|
+
var s;
|
|
1403
|
+
o.preventDefault(), (s = e.triggerRef.current) == null || s.focus();
|
|
1404
1404
|
}),
|
|
1405
|
-
onPointerDownOutside:
|
|
1406
|
-
const
|
|
1407
|
-
(
|
|
1405
|
+
onPointerDownOutside: ce(t.onPointerDownOutside, (o) => {
|
|
1406
|
+
const s = o.detail.originalEvent, l = s.button === 0 && s.ctrlKey === !0;
|
|
1407
|
+
(s.button === 2 || l) && o.preventDefault();
|
|
1408
1408
|
}),
|
|
1409
|
-
onFocusOutside:
|
|
1409
|
+
onFocusOutside: ce(
|
|
1410
1410
|
t.onFocusOutside,
|
|
1411
1411
|
(o) => o.preventDefault()
|
|
1412
1412
|
)
|
|
1413
1413
|
}
|
|
1414
1414
|
);
|
|
1415
1415
|
}
|
|
1416
|
-
),
|
|
1416
|
+
), ua = p.forwardRef(
|
|
1417
1417
|
(t, n) => {
|
|
1418
1418
|
const e = J(ge, t.__scopeDialog), i = p.useRef(!1), r = p.useRef(!1);
|
|
1419
|
-
return /* @__PURE__ */
|
|
1420
|
-
|
|
1419
|
+
return /* @__PURE__ */ a(
|
|
1420
|
+
Ei,
|
|
1421
1421
|
{
|
|
1422
1422
|
...t,
|
|
1423
1423
|
ref: n,
|
|
1424
1424
|
trapFocus: !1,
|
|
1425
1425
|
disableOutsidePointerEvents: !1,
|
|
1426
1426
|
onCloseAutoFocus: (o) => {
|
|
1427
|
-
var
|
|
1428
|
-
(
|
|
1427
|
+
var s, l;
|
|
1428
|
+
(s = t.onCloseAutoFocus) == null || s.call(t, o), o.defaultPrevented || (i.current || (l = e.triggerRef.current) == null || l.focus(), o.preventDefault()), i.current = !1, r.current = !1;
|
|
1429
1429
|
},
|
|
1430
1430
|
onInteractOutside: (o) => {
|
|
1431
1431
|
var f, c;
|
|
1432
1432
|
(f = t.onInteractOutside) == null || f.call(t, o), o.defaultPrevented || (i.current = !0, o.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
1433
|
-
const
|
|
1434
|
-
((c = e.triggerRef.current) == null ? void 0 : c.contains(
|
|
1433
|
+
const s = o.target;
|
|
1434
|
+
((c = e.triggerRef.current) == null ? void 0 : c.contains(s)) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && r.current && o.preventDefault();
|
|
1435
1435
|
}
|
|
1436
1436
|
}
|
|
1437
1437
|
);
|
|
1438
1438
|
}
|
|
1439
|
-
),
|
|
1439
|
+
), Ei = p.forwardRef(
|
|
1440
1440
|
(t, n) => {
|
|
1441
|
-
const { __scopeDialog: e, trapFocus: i, onOpenAutoFocus: r, onCloseAutoFocus: o, ...
|
|
1442
|
-
return
|
|
1443
|
-
/* @__PURE__ */
|
|
1444
|
-
|
|
1441
|
+
const { __scopeDialog: e, trapFocus: i, onOpenAutoFocus: r, onCloseAutoFocus: o, ...s } = t, l = J(ge, e), f = p.useRef(null), c = we(n, f);
|
|
1442
|
+
return bo(), /* @__PURE__ */ y(he, { children: [
|
|
1443
|
+
/* @__PURE__ */ a(
|
|
1444
|
+
ri,
|
|
1445
1445
|
{
|
|
1446
1446
|
asChild: !0,
|
|
1447
1447
|
loop: !0,
|
|
1448
1448
|
trapped: i,
|
|
1449
1449
|
onMountAutoFocus: r,
|
|
1450
1450
|
onUnmountAutoFocus: o,
|
|
1451
|
-
children: /* @__PURE__ */
|
|
1452
|
-
|
|
1451
|
+
children: /* @__PURE__ */ a(
|
|
1452
|
+
ni,
|
|
1453
1453
|
{
|
|
1454
1454
|
role: "dialog",
|
|
1455
1455
|
id: l.contentId,
|
|
1456
1456
|
"aria-describedby": l.descriptionId,
|
|
1457
1457
|
"aria-labelledby": l.titleId,
|
|
1458
|
-
"data-state":
|
|
1459
|
-
...
|
|
1458
|
+
"data-state": sn(l.open),
|
|
1459
|
+
...s,
|
|
1460
1460
|
ref: c,
|
|
1461
1461
|
onDismiss: () => l.onOpenChange(!1)
|
|
1462
1462
|
}
|
|
@@ -1464,49 +1464,49 @@ var ca = p.forwardRef(
|
|
|
1464
1464
|
}
|
|
1465
1465
|
),
|
|
1466
1466
|
/* @__PURE__ */ y(he, { children: [
|
|
1467
|
-
/* @__PURE__ */
|
|
1468
|
-
/* @__PURE__ */
|
|
1467
|
+
/* @__PURE__ */ a(ha, { titleId: l.titleId }),
|
|
1468
|
+
/* @__PURE__ */ a(ga, { contentRef: f, descriptionId: l.descriptionId })
|
|
1469
1469
|
] })
|
|
1470
1470
|
] });
|
|
1471
1471
|
}
|
|
1472
|
-
),
|
|
1472
|
+
), an = "DialogTitle", fa = p.forwardRef(
|
|
1473
1473
|
(t, n) => {
|
|
1474
|
-
const { __scopeDialog: e, ...i } = t, r = J(
|
|
1475
|
-
return /* @__PURE__ */
|
|
1474
|
+
const { __scopeDialog: e, ...i } = t, r = J(an, e);
|
|
1475
|
+
return /* @__PURE__ */ a(ae.h2, { id: r.titleId, ...i, ref: n });
|
|
1476
1476
|
}
|
|
1477
1477
|
);
|
|
1478
|
-
|
|
1479
|
-
var
|
|
1478
|
+
fa.displayName = an;
|
|
1479
|
+
var Ii = "DialogDescription", ma = p.forwardRef(
|
|
1480
1480
|
(t, n) => {
|
|
1481
|
-
const { __scopeDialog: e, ...i } = t, r = J(
|
|
1482
|
-
return /* @__PURE__ */
|
|
1481
|
+
const { __scopeDialog: e, ...i } = t, r = J(Ii, e);
|
|
1482
|
+
return /* @__PURE__ */ a(ae.p, { id: r.descriptionId, ...i, ref: n });
|
|
1483
1483
|
}
|
|
1484
1484
|
);
|
|
1485
|
-
|
|
1486
|
-
var
|
|
1485
|
+
ma.displayName = Ii;
|
|
1486
|
+
var Si = "DialogClose", Ri = p.forwardRef(
|
|
1487
1487
|
(t, n) => {
|
|
1488
|
-
const { __scopeDialog: e, ...i } = t, r = J(
|
|
1489
|
-
return /* @__PURE__ */
|
|
1490
|
-
|
|
1488
|
+
const { __scopeDialog: e, ...i } = t, r = J(Si, e);
|
|
1489
|
+
return /* @__PURE__ */ a(
|
|
1490
|
+
ae.button,
|
|
1491
1491
|
{
|
|
1492
1492
|
type: "button",
|
|
1493
1493
|
...i,
|
|
1494
1494
|
ref: n,
|
|
1495
|
-
onClick:
|
|
1495
|
+
onClick: ce(t.onClick, () => r.onOpenChange(!1))
|
|
1496
1496
|
}
|
|
1497
1497
|
);
|
|
1498
1498
|
}
|
|
1499
1499
|
);
|
|
1500
|
-
|
|
1501
|
-
function
|
|
1500
|
+
Ri.displayName = Si;
|
|
1501
|
+
function sn(t) {
|
|
1502
1502
|
return t ? "open" : "closed";
|
|
1503
1503
|
}
|
|
1504
|
-
var
|
|
1504
|
+
var Ni = "DialogTitleWarning", [gs, Ti] = Br(Ni, {
|
|
1505
1505
|
contentName: ge,
|
|
1506
|
-
titleName:
|
|
1506
|
+
titleName: an,
|
|
1507
1507
|
docsSlug: "dialog"
|
|
1508
|
-
}),
|
|
1509
|
-
const n = Ni
|
|
1508
|
+
}), ha = ({ titleId: t }) => {
|
|
1509
|
+
const n = Ti(Ni), e = `\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
|
|
1510
1510
|
|
|
1511
1511
|
If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
1512
1512
|
|
|
@@ -1514,58 +1514,58 @@ For more information, see https://radix-ui.com/primitives/docs/components/${n.do
|
|
|
1514
1514
|
return p.useEffect(() => {
|
|
1515
1515
|
t && (document.getElementById(t) || console.error(e));
|
|
1516
1516
|
}, [e, t]), null;
|
|
1517
|
-
},
|
|
1518
|
-
const i = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${
|
|
1517
|
+
}, pa = "DialogDescriptionWarning", ga = ({ contentRef: t, descriptionId: n }) => {
|
|
1518
|
+
const i = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ti(pa).contentName}}.`;
|
|
1519
1519
|
return p.useEffect(() => {
|
|
1520
1520
|
var o;
|
|
1521
1521
|
const r = (o = t.current) == null ? void 0 : o.getAttribute("aria-describedby");
|
|
1522
1522
|
n && r && (document.getElementById(n) || console.warn(i));
|
|
1523
1523
|
}, [i, t, n]), null;
|
|
1524
|
-
},
|
|
1525
|
-
const
|
|
1524
|
+
}, ln = vi, cn = wi, dn = Ci, un = xi, va = Ri;
|
|
1525
|
+
const Li = O((t) => {
|
|
1526
1526
|
const { file: n, onClose: e } = t, i = ne(null), r = N(() => {
|
|
1527
1527
|
var l;
|
|
1528
1528
|
if (!i.current) return;
|
|
1529
|
-
const
|
|
1530
|
-
|
|
1529
|
+
const s = document.createElement("canvas");
|
|
1530
|
+
s.width = i.current.width, s.height = i.current.height, (l = s.getContext("2d")) == null || l.drawImage(i.current, 0, 0, i.current.width, i.current.height), s.toBlob((f) => {
|
|
1531
1531
|
f && navigator.clipboard.write([new ClipboardItem({ "image/png": f })]);
|
|
1532
1532
|
}, "image/png");
|
|
1533
1533
|
}, []), o = N(() => {
|
|
1534
|
-
|
|
1534
|
+
qn(n);
|
|
1535
1535
|
}, [n]);
|
|
1536
|
-
return /* @__PURE__ */
|
|
1537
|
-
|
|
1536
|
+
return /* @__PURE__ */ a(ln, { open: !0, onOpenChange: e, children: /* @__PURE__ */ a(cn, { children: /* @__PURE__ */ a(
|
|
1537
|
+
dn,
|
|
1538
1538
|
{
|
|
1539
1539
|
className: "bg-(--color-background) fixed inset-0 data-[state='open']:fade-in-0 data-[state='open']:zoom-in-95 data-[state='closed']:animate-out data-[state='closed']:fade-out-0 data-[state='closed']:zoom-out-95 data-[state='open']:animate-in",
|
|
1540
1540
|
"data-floating-content": "",
|
|
1541
1541
|
children: /* @__PURE__ */ y(
|
|
1542
|
-
|
|
1542
|
+
un,
|
|
1543
1543
|
{
|
|
1544
1544
|
className: "absolute inset-0 py-12",
|
|
1545
1545
|
"data-floating-content": "",
|
|
1546
|
-
onOpenAutoFocus: (
|
|
1546
|
+
onOpenAutoFocus: (s) => s.preventDefault(),
|
|
1547
1547
|
children: [
|
|
1548
1548
|
/* @__PURE__ */ y(
|
|
1549
|
-
|
|
1549
|
+
bt,
|
|
1550
1550
|
{
|
|
1551
1551
|
className: "flex gap-2 items-center top-0 absolute right-0 p-2",
|
|
1552
1552
|
accentColor: "base",
|
|
1553
1553
|
variant: "ghost",
|
|
1554
1554
|
children: [
|
|
1555
|
-
/* @__PURE__ */ y(
|
|
1556
|
-
/* @__PURE__ */
|
|
1557
|
-
/* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ y(Ee.Root, { children: [
|
|
1556
|
+
/* @__PURE__ */ a(Ee.Trigger, { children: /* @__PURE__ */ a(B, { onClick: r, "aria-label": "copy to clipboard", children: /* @__PURE__ */ a(T, { icon: "RiFileCopyLine" }) }) }),
|
|
1557
|
+
/* @__PURE__ */ a(Ee.Content, { size: "sm", children: "Copy" })
|
|
1558
1558
|
] }),
|
|
1559
|
-
/* @__PURE__ */ y(
|
|
1560
|
-
/* @__PURE__ */
|
|
1561
|
-
/* @__PURE__ */
|
|
1559
|
+
/* @__PURE__ */ y(Ee.Root, { children: [
|
|
1560
|
+
/* @__PURE__ */ a(Ee.Trigger, { children: /* @__PURE__ */ a(B, { onClick: o, "aria-label": "download", children: /* @__PURE__ */ a(T, { icon: "RiDownload2Line" }) }) }),
|
|
1561
|
+
/* @__PURE__ */ a(Ee.Content, { size: "sm", children: "Download" })
|
|
1562
1562
|
] }),
|
|
1563
|
-
/* @__PURE__ */
|
|
1564
|
-
/* @__PURE__ */
|
|
1563
|
+
/* @__PURE__ */ a(Ht, { orientation: "vertical", size: "sm" }),
|
|
1564
|
+
/* @__PURE__ */ a(va, { asChild: !0, children: /* @__PURE__ */ a(B, { onClick: e, "aria-label": "close", children: /* @__PURE__ */ a(T, { icon: "RiCloseLine" }) }) })
|
|
1565
1565
|
]
|
|
1566
1566
|
}
|
|
1567
1567
|
),
|
|
1568
|
-
/* @__PURE__ */
|
|
1568
|
+
/* @__PURE__ */ a("figure", { className: "size-full overflow-hidden p-4 flex justify-center items-center", children: /* @__PURE__ */ a(
|
|
1569
1569
|
"img",
|
|
1570
1570
|
{
|
|
1571
1571
|
ref: i,
|
|
@@ -1580,8 +1580,8 @@ const Ti = O((t) => {
|
|
|
1580
1580
|
}
|
|
1581
1581
|
) }) });
|
|
1582
1582
|
});
|
|
1583
|
-
|
|
1584
|
-
const
|
|
1583
|
+
Li.displayName = "ImageViewer";
|
|
1584
|
+
const ya = O((t) => {
|
|
1585
1585
|
const { children: n } = t, [e, i] = H(null), r = N(() => {
|
|
1586
1586
|
i(null);
|
|
1587
1587
|
}, []), o = N(
|
|
@@ -1589,55 +1589,55 @@ const va = O((t) => {
|
|
|
1589
1589
|
i(f(r));
|
|
1590
1590
|
},
|
|
1591
1591
|
[r]
|
|
1592
|
-
),
|
|
1592
|
+
), s = N(() => {
|
|
1593
1593
|
e && (e.onClose && e.onClose(), r());
|
|
1594
1594
|
}, [r, e]), l = A(() => o, [o]);
|
|
1595
|
-
return /* @__PURE__ */ y(
|
|
1595
|
+
return /* @__PURE__ */ y(Zn.Provider, { value: l, children: [
|
|
1596
1596
|
n,
|
|
1597
|
-
e && /* @__PURE__ */
|
|
1597
|
+
e && /* @__PURE__ */ a(Li, { file: e.file, onClose: s })
|
|
1598
1598
|
] });
|
|
1599
1599
|
});
|
|
1600
|
-
|
|
1600
|
+
ya.displayName = "FileViewerProvider";
|
|
1601
1601
|
const ie = (t) => {
|
|
1602
|
-
const { className: n, label: e, children: i,
|
|
1602
|
+
const { className: n, label: e, children: i, severity: r, inputId: o, labelId: s, image: l } = t, [f, c] = H(void 0), d = tn(), u = r ? ue[r] : "base";
|
|
1603
1603
|
K(() => {
|
|
1604
|
-
|
|
1605
|
-
}, [
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1608
|
-
file:
|
|
1604
|
+
l instanceof Promise ? l.then(c).catch(console.error) : c(l);
|
|
1605
|
+
}, [l]);
|
|
1606
|
+
const h = f ? URL.createObjectURL(f) : void 0, g = N(() => {
|
|
1607
|
+
f && d(() => ({
|
|
1608
|
+
file: f
|
|
1609
1609
|
}));
|
|
1610
|
-
}, [
|
|
1610
|
+
}, [d, f]);
|
|
1611
1611
|
return /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
|
|
1612
|
-
|
|
1612
|
+
f && /* @__PURE__ */ a(
|
|
1613
1613
|
"img",
|
|
1614
1614
|
{
|
|
1615
1615
|
className: "h-[100px] w-full min-w-[300px] cursor-pointer rounded-md object-cover",
|
|
1616
|
-
src:
|
|
1617
|
-
alt:
|
|
1618
|
-
onClick:
|
|
1616
|
+
src: h,
|
|
1617
|
+
alt: f.name,
|
|
1618
|
+
onClick: g
|
|
1619
1619
|
}
|
|
1620
1620
|
),
|
|
1621
|
-
/* @__PURE__ */ y("label", { className:
|
|
1622
|
-
/* @__PURE__ */
|
|
1621
|
+
/* @__PURE__ */ y("label", { className: Ve(n, "flex flex-col gap-1"), htmlFor: o, children: [
|
|
1622
|
+
/* @__PURE__ */ a(ye, { accentColor: u, size: "sm", id: s, weight: "medium", children: e }),
|
|
1623
1623
|
i
|
|
1624
1624
|
] })
|
|
1625
1625
|
] });
|
|
1626
|
-
},
|
|
1627
|
-
const { helpText: n, children: e, severity: i } = t, r = i ?
|
|
1626
|
+
}, Fi = (t) => {
|
|
1627
|
+
const { helpText: n, children: e, severity: i } = t, r = i ? ue[i] : "base";
|
|
1628
1628
|
return /* @__PURE__ */ y("div", { className: "flex flex-col gap-1", children: [
|
|
1629
1629
|
e,
|
|
1630
|
-
/* @__PURE__ */
|
|
1630
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col w-full", children: /* @__PURE__ */ a(ye, { accentColor: r, size: "xs", children: n }) })
|
|
1631
1631
|
] });
|
|
1632
1632
|
}, re = (t) => {
|
|
1633
1633
|
const { children: n, ...e } = t;
|
|
1634
|
-
return /* @__PURE__ */
|
|
1635
|
-
},
|
|
1636
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field:
|
|
1634
|
+
return /* @__PURE__ */ a(Fi, { ...e, children: n });
|
|
1635
|
+
}, ba = [!0, "true"], Di = O((t) => {
|
|
1636
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t);
|
|
1637
1637
|
let [{ helpText: c, label: d }] = U(t);
|
|
1638
1638
|
c = o ? null : c, d = o ? "" : d;
|
|
1639
|
-
const u =
|
|
1640
|
-
return /* @__PURE__ */
|
|
1639
|
+
const u = ba.includes(l.value);
|
|
1640
|
+
return /* @__PURE__ */ a(re, { helpText: c, severity: r, children: /* @__PURE__ */ a(
|
|
1641
1641
|
ie,
|
|
1642
1642
|
{
|
|
1643
1643
|
size: i,
|
|
@@ -1645,32 +1645,33 @@ const ie = (t) => {
|
|
|
1645
1645
|
inputId: n,
|
|
1646
1646
|
labelId: e,
|
|
1647
1647
|
label: d,
|
|
1648
|
-
image: o ? void 0 :
|
|
1649
|
-
className: "
|
|
1650
|
-
children: /* @__PURE__ */
|
|
1651
|
-
|
|
1648
|
+
image: o ? void 0 : s.image,
|
|
1649
|
+
className: "items-center flex-row-reverse justify-end gap-2",
|
|
1650
|
+
children: /* @__PURE__ */ a(
|
|
1651
|
+
at.Root,
|
|
1652
1652
|
{
|
|
1653
1653
|
...f,
|
|
1654
1654
|
...l,
|
|
1655
1655
|
id: n,
|
|
1656
|
-
|
|
1656
|
+
size: "sm",
|
|
1657
|
+
accentColor: "primary",
|
|
1657
1658
|
value: u.toString(),
|
|
1658
1659
|
checked: u,
|
|
1659
1660
|
onCheckedChange: l.onChange,
|
|
1660
1661
|
onChange: void 0,
|
|
1661
1662
|
onBlur: void 0,
|
|
1662
1663
|
variant: "surface",
|
|
1663
|
-
children: /* @__PURE__ */
|
|
1664
|
+
children: /* @__PURE__ */ a(at.Indicator, { children: /* @__PURE__ */ a(T, { icon: "RiCheckLine" }) })
|
|
1664
1665
|
}
|
|
1665
1666
|
)
|
|
1666
1667
|
}
|
|
1667
1668
|
) });
|
|
1668
1669
|
});
|
|
1669
|
-
|
|
1670
|
-
const
|
|
1670
|
+
Di.displayName = "BooleanInput";
|
|
1671
|
+
const wa = {
|
|
1671
1672
|
...Q,
|
|
1672
1673
|
type: "boolean"
|
|
1673
|
-
},
|
|
1674
|
+
}, Te = class Te extends G {
|
|
1674
1675
|
constructor(e) {
|
|
1675
1676
|
super({ ...e, type: "boolean" });
|
|
1676
1677
|
w(this, "onlyValidateAfterTouched", !1);
|
|
@@ -1687,16 +1688,16 @@ const ba = {
|
|
|
1687
1688
|
}
|
|
1688
1689
|
static deserialize(e) {
|
|
1689
1690
|
if (e.type !== "boolean") throw new Error("Type mismatch.");
|
|
1690
|
-
return new
|
|
1691
|
+
return new Te(e);
|
|
1691
1692
|
}
|
|
1692
1693
|
getInput(e) {
|
|
1693
|
-
return /* @__PURE__ */
|
|
1694
|
+
return /* @__PURE__ */ a(Di, { ...e, field: this });
|
|
1694
1695
|
}
|
|
1695
1696
|
};
|
|
1696
|
-
w(
|
|
1697
|
-
let We =
|
|
1698
|
-
const
|
|
1699
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field:
|
|
1697
|
+
w(Te, "fieldTypeName", "Checkbox"), w(Te, "fieldTypeDescription", "Perfect for both optional and required yes/no questions."), w(Te, "Icon", vr);
|
|
1698
|
+
let We = Te;
|
|
1699
|
+
const Ai = O((t) => {
|
|
1700
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t);
|
|
1700
1701
|
let [{ helpText: c, label: d }] = U(t);
|
|
1701
1702
|
c = o ? null : c, d = o ? "" : d;
|
|
1702
1703
|
const u = l.value ? new Date(l.value) : void 0, h = N(
|
|
@@ -1709,7 +1710,7 @@ const Di = O((t) => {
|
|
|
1709
1710
|
},
|
|
1710
1711
|
[l]
|
|
1711
1712
|
);
|
|
1712
|
-
return /* @__PURE__ */
|
|
1713
|
+
return /* @__PURE__ */ a(re, { helpText: c, severity: r, children: /* @__PURE__ */ a(
|
|
1713
1714
|
ie,
|
|
1714
1715
|
{
|
|
1715
1716
|
size: i,
|
|
@@ -1717,9 +1718,9 @@ const Di = O((t) => {
|
|
|
1717
1718
|
inputId: n,
|
|
1718
1719
|
labelId: e,
|
|
1719
1720
|
label: d,
|
|
1720
|
-
image: o ? void 0 :
|
|
1721
|
+
image: o ? void 0 : s.image,
|
|
1721
1722
|
children: /* @__PURE__ */ y(oe.Root, { children: [
|
|
1722
|
-
/* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ a(oe.Trigger, { asChild: !0, children: /* @__PURE__ */ y(
|
|
1723
1724
|
X,
|
|
1724
1725
|
{
|
|
1725
1726
|
...f,
|
|
@@ -1727,6 +1728,7 @@ const Di = O((t) => {
|
|
|
1727
1728
|
type: "button",
|
|
1728
1729
|
accentColor: "base",
|
|
1729
1730
|
variant: "surface",
|
|
1731
|
+
size: "sm",
|
|
1730
1732
|
id: n,
|
|
1731
1733
|
children: [
|
|
1732
1734
|
u ? u.toLocaleString(void 0, {
|
|
@@ -1734,12 +1736,12 @@ const Di = O((t) => {
|
|
|
1734
1736
|
month: "2-digit",
|
|
1735
1737
|
day: "2-digit"
|
|
1736
1738
|
}) : "yyyy-mm-dd",
|
|
1737
|
-
/* @__PURE__ */
|
|
1739
|
+
/* @__PURE__ */ a(T, { icon: "RiArrowDownSLine" })
|
|
1738
1740
|
]
|
|
1739
1741
|
}
|
|
1740
1742
|
) }),
|
|
1741
|
-
/* @__PURE__ */
|
|
1742
|
-
|
|
1743
|
+
/* @__PURE__ */ a(oe.Content, { children: /* @__PURE__ */ a(
|
|
1744
|
+
or,
|
|
1743
1745
|
{
|
|
1744
1746
|
required: !1,
|
|
1745
1747
|
mode: "single",
|
|
@@ -1752,11 +1754,11 @@ const Di = O((t) => {
|
|
|
1752
1754
|
}
|
|
1753
1755
|
) });
|
|
1754
1756
|
});
|
|
1755
|
-
|
|
1756
|
-
const
|
|
1757
|
+
Ai.displayName = "DateInput";
|
|
1758
|
+
const Ca = {
|
|
1757
1759
|
...Q,
|
|
1758
1760
|
type: "date"
|
|
1759
|
-
},
|
|
1761
|
+
}, Le = class Le extends G {
|
|
1760
1762
|
constructor(e) {
|
|
1761
1763
|
super({ ...e, type: "date" });
|
|
1762
1764
|
w(this, "onlyValidateAfterTouched", !1);
|
|
@@ -1769,27 +1771,27 @@ const wa = {
|
|
|
1769
1771
|
}
|
|
1770
1772
|
static deserialize(e) {
|
|
1771
1773
|
if (e.type !== "date") throw new Error("Type mismatch.");
|
|
1772
|
-
return new
|
|
1774
|
+
return new Le(e);
|
|
1773
1775
|
}
|
|
1774
1776
|
getInput(e) {
|
|
1775
|
-
return /* @__PURE__ */
|
|
1777
|
+
return /* @__PURE__ */ a(Ai, { field: this, ...e });
|
|
1776
1778
|
}
|
|
1777
1779
|
};
|
|
1778
|
-
w(
|
|
1779
|
-
let
|
|
1780
|
-
const
|
|
1781
|
-
const { field: n, ...e } = t, [{ value: i }] =
|
|
1780
|
+
w(Le, "fieldTypeName", "Date"), w(Le, "fieldTypeDescription", "Allows specifying a date."), w(Le, "Icon", yr);
|
|
1781
|
+
let zt = Le;
|
|
1782
|
+
const Oi = O((t) => {
|
|
1783
|
+
const { field: n, ...e } = t, [{ value: i }] = Kt(n.options.clonedFieldIdentifier), r = A(() => {
|
|
1782
1784
|
const o = n.options.getFieldToClone(i);
|
|
1783
|
-
return o ?
|
|
1785
|
+
return o ? pn(o) : null;
|
|
1784
1786
|
}, [n.options, i]);
|
|
1785
|
-
return
|
|
1787
|
+
return Pi(r, e);
|
|
1786
1788
|
});
|
|
1787
|
-
|
|
1788
|
-
const
|
|
1789
|
+
Oi.displayName = "FieldInputCloner";
|
|
1790
|
+
const xa = {
|
|
1789
1791
|
...Q,
|
|
1790
1792
|
type: "custom"
|
|
1791
1793
|
};
|
|
1792
|
-
class
|
|
1794
|
+
class ct extends G {
|
|
1793
1795
|
constructor(e, i) {
|
|
1794
1796
|
super({ ...e, type: "custom" });
|
|
1795
1797
|
w(this, "Component");
|
|
@@ -1802,119 +1804,119 @@ class lt extends G {
|
|
|
1802
1804
|
}
|
|
1803
1805
|
getInput(e) {
|
|
1804
1806
|
const i = this.Component;
|
|
1805
|
-
return /* @__PURE__ */
|
|
1807
|
+
return /* @__PURE__ */ a(i, { field: this, ...e });
|
|
1806
1808
|
}
|
|
1807
1809
|
}
|
|
1808
|
-
w(
|
|
1809
|
-
class
|
|
1810
|
+
w(ct, "fieldTypeName", "Custom"), w(ct, "fieldTypeDescription", "Allows re-rendering of field already in the form");
|
|
1811
|
+
class Ea extends ct {
|
|
1810
1812
|
constructor(n) {
|
|
1811
|
-
super(n,
|
|
1813
|
+
super(n, Oi);
|
|
1812
1814
|
}
|
|
1813
1815
|
}
|
|
1814
|
-
const
|
|
1815
|
-
const e = A(() => t.map((i) => /* @__PURE__ */
|
|
1816
|
-
return /* @__PURE__ */
|
|
1817
|
-
},
|
|
1816
|
+
const Pi = (t, n) => A(() => !n || !t ? null : t.getInput(n), [t, n]), dt = (t, n) => {
|
|
1817
|
+
const e = A(() => t.map((i) => /* @__PURE__ */ a("div", { children: i.getInput(n) }, i.getId())), [t, n]);
|
|
1818
|
+
return /* @__PURE__ */ a("div", { className: "flex flex-col gap-2", children: e });
|
|
1819
|
+
}, ut = (t = "", n = []) => ({
|
|
1818
1820
|
type: "section",
|
|
1819
1821
|
fields: n,
|
|
1820
1822
|
identifier: t,
|
|
1821
1823
|
label: null,
|
|
1822
1824
|
condition: null,
|
|
1823
1825
|
conditional: !1
|
|
1824
|
-
}),
|
|
1826
|
+
}), Ia = (t) => {
|
|
1825
1827
|
if (!t) return;
|
|
1826
1828
|
const n = t.fields;
|
|
1827
1829
|
let e = [];
|
|
1828
1830
|
const i = [];
|
|
1829
1831
|
for (const r of n)
|
|
1830
|
-
r.type === "section" ? (e.length > 0 && (i.push(
|
|
1831
|
-
return e.length > 0 && i.push(
|
|
1832
|
+
r.type === "section" ? (e.length > 0 && (i.push(ut(`AUTO_section-${n.indexOf(r)}`, e)), e = []), i.push(r)) : e.push(r);
|
|
1833
|
+
return e.length > 0 && i.push(ut("AUTO_section-last", e)), { ...t, fields: i, description: t.description ?? "" };
|
|
1832
1834
|
};
|
|
1833
|
-
function
|
|
1835
|
+
function _t(t, n, e) {
|
|
1834
1836
|
const i = Array.from(t), [r] = i.splice(n, 1);
|
|
1835
1837
|
if (!r) throw new Error("Could not find field to reorder.");
|
|
1836
1838
|
return i.splice(e, 0, r), i;
|
|
1837
1839
|
}
|
|
1838
|
-
function
|
|
1840
|
+
function ki(t, n, e) {
|
|
1839
1841
|
const i = Array.from(t ?? []);
|
|
1840
1842
|
return i.splice(n, 0, e), i;
|
|
1841
1843
|
}
|
|
1842
|
-
function
|
|
1844
|
+
function ft(t, n) {
|
|
1843
1845
|
const e = Array.from(t);
|
|
1844
1846
|
return e.splice(n, 1), e;
|
|
1845
1847
|
}
|
|
1846
|
-
const
|
|
1848
|
+
const fn = (t, n) => {
|
|
1847
1849
|
const e = /* @__PURE__ */ new Date();
|
|
1848
|
-
return `${
|
|
1849
|
-
},
|
|
1850
|
+
return `${mr(n)}-${e.getTime()}`;
|
|
1851
|
+
}, Mi = (t, n) => {
|
|
1850
1852
|
if (!n) return null;
|
|
1851
1853
|
for (const e of t)
|
|
1852
1854
|
if (e.type === "section") {
|
|
1853
|
-
const i =
|
|
1855
|
+
const i = Mi(e.fields, n);
|
|
1854
1856
|
if (i) return i;
|
|
1855
1857
|
} else if (e.identifier === n)
|
|
1856
1858
|
return e;
|
|
1857
1859
|
return null;
|
|
1858
|
-
},
|
|
1859
|
-
const { label: o } = e,
|
|
1860
|
+
}, zi = (t, n) => t.filter((e, i) => i < n).flatMap((e) => e.fields), mt = (t, n, e, i, r) => {
|
|
1861
|
+
const { label: o } = e, s = {
|
|
1860
1862
|
...e,
|
|
1861
|
-
identifier:
|
|
1863
|
+
identifier: fn(null, o)
|
|
1862
1864
|
}, l = Y(i, t);
|
|
1863
1865
|
if (l === void 0)
|
|
1864
1866
|
throw new Error("Parent path must point to an existing field.");
|
|
1865
1867
|
if (!Array.isArray(l))
|
|
1866
1868
|
throw new Error("Parent path must point to an array.");
|
|
1867
|
-
const f =
|
|
1869
|
+
const f = ki(l, n, s);
|
|
1868
1870
|
r(t, f).then();
|
|
1869
|
-
},
|
|
1871
|
+
}, Sa = (t, n, e) => {
|
|
1870
1872
|
const i = {
|
|
1871
|
-
...
|
|
1873
|
+
...ut(),
|
|
1872
1874
|
label: ""
|
|
1873
1875
|
};
|
|
1874
|
-
|
|
1875
|
-
},
|
|
1876
|
-
const { showError: t } =
|
|
1877
|
-
(i, r, o,
|
|
1876
|
+
mt("fields", t, i, n, e);
|
|
1877
|
+
}, mn = () => {
|
|
1878
|
+
const { showError: t } = Gt(), n = N(
|
|
1879
|
+
(i, r, o, s, l, f) => {
|
|
1878
1880
|
const c = i[r];
|
|
1879
1881
|
if (!c) throw new Error("Could not find section context.");
|
|
1880
1882
|
let d = typeof c.conditionIndex < "u" ? (
|
|
1881
1883
|
// cannot move a section with a condition before the condition's field
|
|
1882
|
-
Math.max(c.conditionIndex + 1,
|
|
1883
|
-
) :
|
|
1884
|
+
Math.max(c.conditionIndex + 1, s)
|
|
1885
|
+
) : s;
|
|
1884
1886
|
for (const u of Object.values(i))
|
|
1885
1887
|
u.conditionIndex === o && (d = Math.min(d, u.index - 1));
|
|
1886
|
-
if (d !==
|
|
1888
|
+
if (d !== s) {
|
|
1887
1889
|
t({
|
|
1888
1890
|
title: "Could not reorder sections",
|
|
1889
1891
|
description: "Sections with conditions must be below the fields they reference."
|
|
1890
1892
|
});
|
|
1891
1893
|
return;
|
|
1892
1894
|
}
|
|
1893
|
-
f("fields",
|
|
1895
|
+
f("fields", _t(l.fields, o, d));
|
|
1894
1896
|
},
|
|
1895
1897
|
[t]
|
|
1896
1898
|
), e = N(
|
|
1897
|
-
(i, r, o,
|
|
1899
|
+
(i, r, o, s, l, f, c) => {
|
|
1898
1900
|
var d;
|
|
1899
|
-
if (!(i != null && i.fields) || !
|
|
1900
|
-
if (i.identifier ===
|
|
1901
|
+
if (!(i != null && i.fields) || !s) throw new Error("Could not find section with fields.");
|
|
1902
|
+
if (i.identifier === s.identifier)
|
|
1901
1903
|
c(
|
|
1902
1904
|
`fields.${r}.fields`,
|
|
1903
|
-
|
|
1905
|
+
_t(i.fields, o, f)
|
|
1904
1906
|
).then();
|
|
1905
1907
|
else {
|
|
1906
1908
|
const u = i.fields[o];
|
|
1907
1909
|
if (!u) throw new Error("Could not find field to reorder.");
|
|
1908
|
-
if (((d =
|
|
1910
|
+
if (((d = s.condition) == null ? void 0 : d.identifier) === u.identifier) {
|
|
1909
1911
|
t({
|
|
1910
1912
|
title: "Could not reorder field",
|
|
1911
1913
|
description: "Field must be above the section whose condition references it."
|
|
1912
1914
|
});
|
|
1913
1915
|
return;
|
|
1914
1916
|
}
|
|
1915
|
-
c(`fields.${r}.fields`,
|
|
1917
|
+
c(`fields.${r}.fields`, ft(i.fields, o)).then(), c(
|
|
1916
1918
|
`fields.${l}.fields`,
|
|
1917
|
-
|
|
1919
|
+
ki(s.fields, f, u)
|
|
1918
1920
|
).then();
|
|
1919
1921
|
}
|
|
1920
1922
|
},
|
|
@@ -1922,7 +1924,7 @@ const un = (t, n) => {
|
|
|
1922
1924
|
);
|
|
1923
1925
|
return { reorderSection: n, reorderField: e };
|
|
1924
1926
|
}, _i = O((t) => {
|
|
1925
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field:
|
|
1927
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t);
|
|
1926
1928
|
let [{ helpText: c, label: d }] = U(t);
|
|
1927
1929
|
c = o ? null : c, d = o ? "" : d;
|
|
1928
1930
|
const u = A(() => Array.isArray(l.value) ? l.value : [], [l.value]), { onChange: h, onBlur: g } = l, b = `${n}-droppable`, { disabled: m } = f, [v, x] = H(""), [E, S] = H(""), C = E || c, I = N(
|
|
@@ -1948,21 +1950,21 @@ const un = (t, n) => {
|
|
|
1948
1950
|
P.key === "Enter" && (P.preventDefault(), R());
|
|
1949
1951
|
},
|
|
1950
1952
|
[R]
|
|
1951
|
-
),
|
|
1953
|
+
), V = N(
|
|
1952
1954
|
(P) => {
|
|
1953
|
-
I(
|
|
1955
|
+
I(ft(u, P));
|
|
1954
1956
|
},
|
|
1955
1957
|
[u, I]
|
|
1956
|
-
),
|
|
1958
|
+
), _ = N(
|
|
1957
1959
|
(P) => {
|
|
1958
1960
|
if (!P.destination) return;
|
|
1959
|
-
const $ = P.source.index,
|
|
1960
|
-
I(
|
|
1961
|
+
const $ = P.source.index, z = P.destination.index;
|
|
1962
|
+
I(_t(u, $, z));
|
|
1961
1963
|
},
|
|
1962
1964
|
[I, u]
|
|
1963
1965
|
);
|
|
1964
|
-
return /* @__PURE__ */
|
|
1965
|
-
/* @__PURE__ */
|
|
1966
|
+
return /* @__PURE__ */ a(Xn, { onDragEnd: _, children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
|
|
1967
|
+
/* @__PURE__ */ a(re, { helpText: C, severity: r, children: /* @__PURE__ */ a(
|
|
1966
1968
|
ie,
|
|
1967
1969
|
{
|
|
1968
1970
|
size: i,
|
|
@@ -1970,10 +1972,10 @@ const un = (t, n) => {
|
|
|
1970
1972
|
inputId: n,
|
|
1971
1973
|
labelId: e,
|
|
1972
1974
|
label: d,
|
|
1973
|
-
image: o ? void 0 :
|
|
1975
|
+
image: o ? void 0 : s.image,
|
|
1974
1976
|
children: (!m || u.length === 0) && /* @__PURE__ */ y("div", { className: "flex gap-2", children: [
|
|
1975
|
-
/* @__PURE__ */
|
|
1976
|
-
|
|
1977
|
+
/* @__PURE__ */ a("div", { className: "grow", children: /* @__PURE__ */ a(de.Root, { accentColor: "base", variant: "surface", size: "sm", children: /* @__PURE__ */ a(
|
|
1978
|
+
de.Field,
|
|
1977
1979
|
{
|
|
1978
1980
|
...f,
|
|
1979
1981
|
...l,
|
|
@@ -1981,64 +1983,65 @@ const un = (t, n) => {
|
|
|
1981
1983
|
onChange: L,
|
|
1982
1984
|
onKeyDown: F,
|
|
1983
1985
|
id: n,
|
|
1984
|
-
placeholder:
|
|
1986
|
+
placeholder: s.placeholder,
|
|
1985
1987
|
onBlur: void 0
|
|
1986
1988
|
}
|
|
1987
1989
|
) }) }),
|
|
1988
|
-
/* @__PURE__ */
|
|
1989
|
-
|
|
1990
|
+
/* @__PURE__ */ a(
|
|
1991
|
+
B,
|
|
1990
1992
|
{
|
|
1993
|
+
size: "sm",
|
|
1991
1994
|
type: "button",
|
|
1992
1995
|
"aria-label": "Add option",
|
|
1993
1996
|
disabled: !!E || m,
|
|
1994
1997
|
onClick: R,
|
|
1995
|
-
children: /* @__PURE__ */
|
|
1998
|
+
children: /* @__PURE__ */ a(T, { icon: "RiAddLine" })
|
|
1996
1999
|
}
|
|
1997
2000
|
)
|
|
1998
2001
|
] })
|
|
1999
2002
|
}
|
|
2000
2003
|
) }),
|
|
2001
|
-
/* @__PURE__ */
|
|
2004
|
+
/* @__PURE__ */ a(Zt, { droppableId: b, children: (P) => /* @__PURE__ */ y(
|
|
2002
2005
|
"div",
|
|
2003
2006
|
{
|
|
2004
2007
|
className: "flex flex-col",
|
|
2005
2008
|
...P.droppableProps,
|
|
2006
2009
|
ref: P.innerRef,
|
|
2007
2010
|
children: [
|
|
2008
|
-
u.map(($,
|
|
2009
|
-
|
|
2011
|
+
u.map(($, z) => /* @__PURE__ */ a(
|
|
2012
|
+
en,
|
|
2010
2013
|
{
|
|
2011
2014
|
draggableId: `${$}-draggable`,
|
|
2012
|
-
index:
|
|
2015
|
+
index: z,
|
|
2013
2016
|
isDragDisabled: m,
|
|
2014
|
-
children: ({ draggableProps: Z, dragHandleProps:
|
|
2015
|
-
|
|
2017
|
+
children: ({ draggableProps: Z, dragHandleProps: Ce, innerRef: je }) => /* @__PURE__ */ y(
|
|
2018
|
+
ot,
|
|
2016
2019
|
{
|
|
2017
|
-
...
|
|
2020
|
+
...Ce,
|
|
2018
2021
|
...Z,
|
|
2019
2022
|
ref: je,
|
|
2020
2023
|
className: "mb-1 flex items-center justify-between gap-2",
|
|
2021
2024
|
accentColor: "base",
|
|
2022
|
-
size: "
|
|
2025
|
+
size: "sm",
|
|
2023
2026
|
variant: "soft",
|
|
2024
2027
|
children: [
|
|
2025
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ a("span", {
|
|
2026
2029
|
// TODO: remove this, its just a saftey check for old compatibility of what was acceptable as a value for multi string
|
|
2027
2030
|
children: typeof $ == "object" && "label" in $ ? $.label : $
|
|
2028
2031
|
}),
|
|
2029
|
-
/* @__PURE__ */
|
|
2030
|
-
|
|
2032
|
+
/* @__PURE__ */ a(
|
|
2033
|
+
B,
|
|
2031
2034
|
{
|
|
2032
|
-
size: "
|
|
2035
|
+
size: "xs",
|
|
2033
2036
|
variant: "ghost",
|
|
2034
2037
|
type: "button",
|
|
2035
2038
|
"aria-label": "Delete option",
|
|
2036
2039
|
accentColor: "base",
|
|
2037
2040
|
disabled: m,
|
|
2038
2041
|
onClick: () => {
|
|
2039
|
-
|
|
2042
|
+
V(z);
|
|
2040
2043
|
},
|
|
2041
|
-
children: /* @__PURE__ */
|
|
2044
|
+
children: /* @__PURE__ */ a(T, { icon: "RiCloseLargeLine" })
|
|
2042
2045
|
}
|
|
2043
2046
|
)
|
|
2044
2047
|
]
|
|
@@ -2054,15 +2057,15 @@ const un = (t, n) => {
|
|
|
2054
2057
|
] }) });
|
|
2055
2058
|
});
|
|
2056
2059
|
_i.displayName = "MultiStringInput";
|
|
2057
|
-
const
|
|
2060
|
+
const Ra = {
|
|
2058
2061
|
...Q,
|
|
2059
2062
|
type: "multi-string",
|
|
2060
2063
|
minimum_length: 0,
|
|
2061
2064
|
maximum_length: null
|
|
2062
|
-
},
|
|
2065
|
+
}, Fe = class Fe extends G {
|
|
2063
2066
|
constructor(e) {
|
|
2064
|
-
const { minimum_length: i, maximum_length: r, placeholder: o, ...
|
|
2065
|
-
super({ ...
|
|
2067
|
+
const { minimum_length: i, maximum_length: r, placeholder: o, ...s } = e;
|
|
2068
|
+
super({ ...s, type: "multi-string" });
|
|
2066
2069
|
w(this, "minLength");
|
|
2067
2070
|
w(this, "maxLength");
|
|
2068
2071
|
w(this, "onlyValidateAfterTouched", !1);
|
|
@@ -2074,7 +2077,7 @@ const Sa = {
|
|
|
2074
2077
|
throw new Error("Expected an array.");
|
|
2075
2078
|
}
|
|
2076
2079
|
getInput(e) {
|
|
2077
|
-
return /* @__PURE__ */
|
|
2080
|
+
return /* @__PURE__ */ a(_i, { field: this, ...e });
|
|
2078
2081
|
}
|
|
2079
2082
|
serialize() {
|
|
2080
2083
|
return {
|
|
@@ -2099,15 +2102,15 @@ const Sa = {
|
|
|
2099
2102
|
}
|
|
2100
2103
|
static deserialize(e) {
|
|
2101
2104
|
if (e.type !== "multi-string") throw new Error("Type mismatch.");
|
|
2102
|
-
return new
|
|
2105
|
+
return new Fe(e);
|
|
2103
2106
|
}
|
|
2104
2107
|
};
|
|
2105
|
-
w(
|
|
2106
|
-
let
|
|
2107
|
-
const
|
|
2108
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field:
|
|
2108
|
+
w(Fe, "fieldTypeName", "Multi-string"), w(Fe, "fieldTypeDescription", "Allows the user to provide multiple unique strings."), w(Fe, "Icon", br);
|
|
2109
|
+
let ht = Fe;
|
|
2110
|
+
const $i = O((t) => {
|
|
2111
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t);
|
|
2109
2112
|
let [{ helpText: c, label: d }] = U(t);
|
|
2110
|
-
return c = o ? null : c, d = o ? "" : d, /* @__PURE__ */
|
|
2113
|
+
return c = o ? null : c, d = o ? "" : d, /* @__PURE__ */ a(re, { helpText: c, severity: r, children: /* @__PURE__ */ a(
|
|
2111
2114
|
ie,
|
|
2112
2115
|
{
|
|
2113
2116
|
size: i,
|
|
@@ -2115,37 +2118,37 @@ const zi = O((t) => {
|
|
|
2115
2118
|
inputId: n,
|
|
2116
2119
|
labelId: e,
|
|
2117
2120
|
label: d,
|
|
2118
|
-
image: o ? void 0 :
|
|
2119
|
-
children: /* @__PURE__ */
|
|
2120
|
-
|
|
2121
|
+
image: o ? void 0 : s.image,
|
|
2122
|
+
children: /* @__PURE__ */ a(de.Root, { accentColor: "base", variant: "surface", size: "sm", children: /* @__PURE__ */ a(
|
|
2123
|
+
de.Field,
|
|
2121
2124
|
{
|
|
2122
2125
|
...f,
|
|
2123
2126
|
...l,
|
|
2124
2127
|
type: "number",
|
|
2125
2128
|
id: n,
|
|
2126
|
-
placeholder:
|
|
2127
|
-
min:
|
|
2128
|
-
max:
|
|
2129
|
-
step:
|
|
2129
|
+
placeholder: s.placeholder,
|
|
2130
|
+
min: s.minimum,
|
|
2131
|
+
max: s.maximum,
|
|
2132
|
+
step: s.integers ? 1 : 0.1
|
|
2130
2133
|
}
|
|
2131
2134
|
) })
|
|
2132
2135
|
}
|
|
2133
2136
|
) });
|
|
2134
2137
|
});
|
|
2135
|
-
|
|
2136
|
-
const
|
|
2138
|
+
$i.displayName = "NumberInput";
|
|
2139
|
+
const Na = {
|
|
2137
2140
|
...Q,
|
|
2138
2141
|
type: "number",
|
|
2139
2142
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
2140
2143
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
2141
2144
|
integers: !1
|
|
2142
|
-
},
|
|
2145
|
+
}, zn = (t) => "fields" in t, ee = class ee extends G {
|
|
2143
2146
|
constructor(e) {
|
|
2144
2147
|
const {
|
|
2145
2148
|
minimum: i = Number.MIN_SAFE_INTEGER,
|
|
2146
2149
|
maximum: r = Number.MAX_SAFE_INTEGER,
|
|
2147
2150
|
integers: o = !1,
|
|
2148
|
-
placeholder:
|
|
2151
|
+
placeholder: s = "Enter a number",
|
|
2149
2152
|
...l
|
|
2150
2153
|
} = e;
|
|
2151
2154
|
super({ ...l, type: "number" });
|
|
@@ -2153,7 +2156,7 @@ const Ra = {
|
|
|
2153
2156
|
w(this, "maximum");
|
|
2154
2157
|
w(this, "integers");
|
|
2155
2158
|
w(this, "placeholder");
|
|
2156
|
-
this.minimum = i, this.maximum = r, this.integers = o, this.placeholder =
|
|
2159
|
+
this.minimum = i, this.maximum = r, this.integers = o, this.placeholder = s;
|
|
2157
2160
|
}
|
|
2158
2161
|
getValueFromChangeEvent(e) {
|
|
2159
2162
|
const i = Number.parseFloat(e.target.value);
|
|
@@ -2222,19 +2225,19 @@ const Ra = {
|
|
|
2222
2225
|
return new ee(e);
|
|
2223
2226
|
}
|
|
2224
2227
|
getInput(e) {
|
|
2225
|
-
return /* @__PURE__ */
|
|
2228
|
+
return /* @__PURE__ */ a($i, { field: this, ...e });
|
|
2226
2229
|
}
|
|
2227
2230
|
};
|
|
2228
|
-
w(ee, "fieldTypeName", "Number"), w(ee, "fieldTypeDescription", "Allows specifying a number within a given range."), w(ee, "Icon",
|
|
2229
|
-
const o =
|
|
2231
|
+
w(ee, "fieldTypeName", "Number"), w(ee, "fieldTypeDescription", "Allows specifying a number within a given range."), w(ee, "Icon", wr), w(ee, "_validateMin", (e) => (i, r) => {
|
|
2232
|
+
const o = zn(r) ? Y(r, e) : r;
|
|
2230
2233
|
return typeof o.maximum == "number" && typeof i == "number" && o.maximum < i ? "Minimum cannot be greater than minimum." : null;
|
|
2231
2234
|
}), w(ee, "_validateMax", (e) => (i, r) => {
|
|
2232
|
-
const o =
|
|
2235
|
+
const o = zn(r) ? Y(r, e) : r;
|
|
2233
2236
|
return typeof o.minimum == "number" && typeof i == "number" && o.minimum > i ? "Maximum cannot be less than minimum." : null;
|
|
2234
2237
|
});
|
|
2235
2238
|
let ve = ee;
|
|
2236
|
-
const
|
|
2237
|
-
const [{ inputId: n, labelId: e, label: i, helpText: r, size: o, severity:
|
|
2239
|
+
const Bi = O((t) => {
|
|
2240
|
+
const [{ inputId: n, labelId: e, label: i, helpText: r, size: o, severity: s, showInputOnly: l, field: f, fieldProps: c }, d] = U(t), [u, h] = H(!1), g = c.value, b = N(
|
|
2238
2241
|
(E) => {
|
|
2239
2242
|
c.onChange({ target: { value: E } }), h(!1);
|
|
2240
2243
|
},
|
|
@@ -2246,39 +2249,50 @@ const $i = O((t) => {
|
|
|
2246
2249
|
}, []), x = N(() => {
|
|
2247
2250
|
h(!1);
|
|
2248
2251
|
}, []);
|
|
2249
|
-
return /* @__PURE__ */
|
|
2252
|
+
return /* @__PURE__ */ a(re, { helpText: r, severity: s, children: /* @__PURE__ */ y(
|
|
2250
2253
|
ie,
|
|
2251
2254
|
{
|
|
2252
2255
|
size: o,
|
|
2253
|
-
severity:
|
|
2256
|
+
severity: s,
|
|
2254
2257
|
inputId: n,
|
|
2255
2258
|
labelId: e,
|
|
2256
2259
|
label: i,
|
|
2257
2260
|
image: l ? void 0 : f.image,
|
|
2258
2261
|
className: "flex-col items-start justify-start gap-1",
|
|
2259
2262
|
children: [
|
|
2260
|
-
/* @__PURE__ */
|
|
2261
|
-
/* @__PURE__ */
|
|
2262
|
-
/* @__PURE__ */
|
|
2263
|
+
/* @__PURE__ */ a(ln, { open: u, onOpenChange: h, children: /* @__PURE__ */ y(cn, { children: [
|
|
2264
|
+
/* @__PURE__ */ a(dn, { className: "light:bg-(--black-a6) fixed inset-0 dark:bg-(--black-a8)" }),
|
|
2265
|
+
/* @__PURE__ */ a(un, { className: "fixed inset-0", children: /* @__PURE__ */ a(Vi, { onQrScan: b, onClose: x }) })
|
|
2263
2266
|
] }) }),
|
|
2264
2267
|
/* @__PURE__ */ y("div", { className: "flex w-max items-center gap-1", children: [
|
|
2265
|
-
/* @__PURE__ */ y(
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2268
|
+
/* @__PURE__ */ y(
|
|
2269
|
+
X,
|
|
2270
|
+
{
|
|
2271
|
+
...d,
|
|
2272
|
+
variant: "soft",
|
|
2273
|
+
onClick: v,
|
|
2274
|
+
type: "button",
|
|
2275
|
+
size: "sm",
|
|
2276
|
+
accentColor: "base",
|
|
2277
|
+
children: [
|
|
2278
|
+
/* @__PURE__ */ a(T, { icon: "RiQrCodeLine" }),
|
|
2279
|
+
"Scan"
|
|
2280
|
+
]
|
|
2281
|
+
}
|
|
2282
|
+
),
|
|
2283
|
+
g && /* @__PURE__ */ a("span", { className: "text-xs text-(--accent-a11)", "data-accent-color": "primary", children: /* @__PURE__ */ a(T, { icon: "RiCheckLine", style: { verticalAlign: "bottom" } }) })
|
|
2270
2284
|
] }),
|
|
2271
|
-
!!g && /* @__PURE__ */
|
|
2272
|
-
/* @__PURE__ */
|
|
2273
|
-
/* @__PURE__ */
|
|
2274
|
-
|
|
2285
|
+
!!g && /* @__PURE__ */ a(Ue, { children: /* @__PURE__ */ y("div", { className: "w-max items-center gap-2", children: [
|
|
2286
|
+
/* @__PURE__ */ a("code", { className: "bg-(--base-a3)", children: g }),
|
|
2287
|
+
/* @__PURE__ */ a(
|
|
2288
|
+
B,
|
|
2275
2289
|
{
|
|
2276
2290
|
accentColor: "base",
|
|
2277
2291
|
variant: "ghost",
|
|
2278
2292
|
"aria-label": "delete",
|
|
2279
2293
|
size: "sm",
|
|
2280
2294
|
onClick: m,
|
|
2281
|
-
children: /* @__PURE__ */
|
|
2295
|
+
children: /* @__PURE__ */ a(T, { icon: "RiCloseLine" })
|
|
2282
2296
|
}
|
|
2283
2297
|
)
|
|
2284
2298
|
] }) })
|
|
@@ -2286,16 +2300,16 @@ const $i = O((t) => {
|
|
|
2286
2300
|
}
|
|
2287
2301
|
) });
|
|
2288
2302
|
});
|
|
2289
|
-
|
|
2303
|
+
Bi.displayName = "QrInput";
|
|
2290
2304
|
const Vi = O((t) => {
|
|
2291
2305
|
const { onQrScan: n, onClose: e } = t, i = ne(null), [r, o] = H(!1);
|
|
2292
2306
|
return K(() => {
|
|
2293
2307
|
if (!i.current) return;
|
|
2294
|
-
const
|
|
2308
|
+
const s = new Ar(
|
|
2295
2309
|
i.current,
|
|
2296
2310
|
(l) => {
|
|
2297
2311
|
const f = l.data;
|
|
2298
|
-
n(f),
|
|
2312
|
+
n(f), s.destroy();
|
|
2299
2313
|
},
|
|
2300
2314
|
{
|
|
2301
2315
|
highlightCodeOutline: !0,
|
|
@@ -2303,22 +2317,22 @@ const Vi = O((t) => {
|
|
|
2303
2317
|
maxScansPerSecond: 1
|
|
2304
2318
|
}
|
|
2305
2319
|
);
|
|
2306
|
-
o(!0),
|
|
2320
|
+
o(!0), s.start().finally(() => {
|
|
2307
2321
|
o(!1);
|
|
2308
2322
|
});
|
|
2309
2323
|
}, [n]), /* @__PURE__ */ y("div", { className: "relative flex h-full w-full flex-col justify-center gap-2 bg-(--color-background)", children: [
|
|
2310
|
-
/* @__PURE__ */
|
|
2324
|
+
/* @__PURE__ */ a("div", { className: "absolute top-0 flex w-full p-2", children: /* @__PURE__ */ a(B, { "aria-label": "close", variant: "soft", accentColor: "base", onClick: e, children: /* @__PURE__ */ a(T, { icon: "RiCloseLine" }) }) }),
|
|
2311
2325
|
/* @__PURE__ */ y("div", { className: "relative max-h-full max-w-full", children: [
|
|
2312
|
-
/* @__PURE__ */
|
|
2313
|
-
r && /* @__PURE__ */
|
|
2326
|
+
/* @__PURE__ */ a("video", { ref: i, style: { width: "100%", height: "100%" } }),
|
|
2327
|
+
r && /* @__PURE__ */ a("div", { className: "absolute inset-0 flex items-center justify-center bg-(--color-background)", children: /* @__PURE__ */ a(yt, {}) })
|
|
2314
2328
|
] })
|
|
2315
2329
|
] });
|
|
2316
2330
|
});
|
|
2317
2331
|
Vi.displayName = "QrScanner";
|
|
2318
|
-
const
|
|
2332
|
+
const Ta = {
|
|
2319
2333
|
...Q,
|
|
2320
2334
|
type: "qr"
|
|
2321
|
-
},
|
|
2335
|
+
}, De = class De extends G {
|
|
2322
2336
|
constructor(e) {
|
|
2323
2337
|
super({ ...e, type: "qr" });
|
|
2324
2338
|
w(this, "onlyValidateAfterTouched", !1);
|
|
@@ -2328,15 +2342,15 @@ const Na = {
|
|
|
2328
2342
|
}
|
|
2329
2343
|
static deserialize(e) {
|
|
2330
2344
|
if (e.type !== "qr") throw new Error("Type mismatch.");
|
|
2331
|
-
return new
|
|
2345
|
+
return new De(e);
|
|
2332
2346
|
}
|
|
2333
2347
|
getInput(e) {
|
|
2334
|
-
return /* @__PURE__ */
|
|
2348
|
+
return /* @__PURE__ */ a(Bi, { ...e, field: this });
|
|
2335
2349
|
}
|
|
2336
2350
|
};
|
|
2337
|
-
w(
|
|
2338
|
-
let
|
|
2339
|
-
class
|
|
2351
|
+
w(De, "fieldTypeName", "QR"), w(De, "fieldTypeDescription", "Used for scanning/reading QR codes."), w(De, "Icon", Cr);
|
|
2352
|
+
let $t = De;
|
|
2353
|
+
class Ui extends G {
|
|
2340
2354
|
constructor(e) {
|
|
2341
2355
|
const { placeholder: i = "", ...r } = e;
|
|
2342
2356
|
super(r);
|
|
@@ -2345,7 +2359,7 @@ class Bi extends G {
|
|
|
2345
2359
|
w(this, "placeholder");
|
|
2346
2360
|
this.placeholder = i;
|
|
2347
2361
|
const o = /* @__PURE__ */ new Set();
|
|
2348
|
-
this.options = e.options.map((
|
|
2362
|
+
this.options = e.options.map((s) => (typeof s == "string" && (s = { label: s, value: s }), o.add(s.label), s)), o.size !== e.options.length && console.error(
|
|
2349
2363
|
`${e.options.length - o.size} duplicate identifiers found in options. This may cause unexpected behavior. Options:`,
|
|
2350
2364
|
e.options
|
|
2351
2365
|
);
|
|
@@ -2361,7 +2375,7 @@ class Bi extends G {
|
|
|
2361
2375
|
const i = e && `${e}.`;
|
|
2362
2376
|
return [
|
|
2363
2377
|
{
|
|
2364
|
-
field: new
|
|
2378
|
+
field: new ht({
|
|
2365
2379
|
label: "Options",
|
|
2366
2380
|
description: "List possible options for the user to select from.",
|
|
2367
2381
|
required: !0,
|
|
@@ -2373,17 +2387,17 @@ class Bi extends G {
|
|
|
2373
2387
|
];
|
|
2374
2388
|
}
|
|
2375
2389
|
}
|
|
2376
|
-
const
|
|
2377
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field:
|
|
2390
|
+
const La = (t) => t ? Array.isArray(t) ? t : [t] : [], ji = O((t) => {
|
|
2391
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t), { onChange: c, onBlur: d } = l;
|
|
2378
2392
|
let [{ helpText: u, label: h }] = U(t);
|
|
2379
2393
|
u = o ? null : u, h = o ? "" : h;
|
|
2380
|
-
const g = A(() =>
|
|
2394
|
+
const g = A(() => La(l.value), [l.value]), b = N(
|
|
2381
2395
|
(m) => {
|
|
2382
2396
|
c(m), d(m);
|
|
2383
2397
|
},
|
|
2384
2398
|
[c, d]
|
|
2385
2399
|
);
|
|
2386
|
-
return /* @__PURE__ */
|
|
2400
|
+
return /* @__PURE__ */ a(re, { helpText: u, severity: r, children: /* @__PURE__ */ a(
|
|
2387
2401
|
ie,
|
|
2388
2402
|
{
|
|
2389
2403
|
size: i,
|
|
@@ -2391,9 +2405,9 @@ const Ta = (t) => t ? Array.isArray(t) ? t : [t] : [], Ui = O((t) => {
|
|
|
2391
2405
|
inputId: n,
|
|
2392
2406
|
labelId: e,
|
|
2393
2407
|
label: h,
|
|
2394
|
-
image: o ? void 0 :
|
|
2408
|
+
image: o ? void 0 : s.image,
|
|
2395
2409
|
children: /* @__PURE__ */ y(M.Root, { children: [
|
|
2396
|
-
/* @__PURE__ */
|
|
2410
|
+
/* @__PURE__ */ a(M.ClickTrigger, { children: /* @__PURE__ */ y(
|
|
2397
2411
|
X,
|
|
2398
2412
|
{
|
|
2399
2413
|
id: n,
|
|
@@ -2401,21 +2415,22 @@ const Ta = (t) => t ? Array.isArray(t) ? t : [t] : [], Ui = O((t) => {
|
|
|
2401
2415
|
name: l.name,
|
|
2402
2416
|
variant: "surface",
|
|
2403
2417
|
type: "button",
|
|
2418
|
+
size: "sm",
|
|
2404
2419
|
accentColor: "base",
|
|
2405
2420
|
...f,
|
|
2406
2421
|
children: [
|
|
2407
|
-
g.length > 0 ? g.join(", ") :
|
|
2408
|
-
/* @__PURE__ */
|
|
2422
|
+
g.length > 0 ? g.join(", ") : s.placeholder,
|
|
2423
|
+
/* @__PURE__ */ a(T, { icon: "RiArrowDownSLine" })
|
|
2409
2424
|
]
|
|
2410
2425
|
}
|
|
2411
2426
|
) }),
|
|
2412
|
-
/* @__PURE__ */
|
|
2413
|
-
/* @__PURE__ */ y(M.SelectAllItem, { allValues:
|
|
2414
|
-
/* @__PURE__ */
|
|
2427
|
+
/* @__PURE__ */ a(M.Content, { children: /* @__PURE__ */ a(M.Scroll, { children: /* @__PURE__ */ y(M.MultiSelectGroup, { values: g, onValuesChange: b, children: [
|
|
2428
|
+
/* @__PURE__ */ y(M.SelectAllItem, { allValues: s.options.map(({ value: m }) => m), children: [
|
|
2429
|
+
/* @__PURE__ */ a(M.SelectAllIndicator, { children: (m) => m ? /* @__PURE__ */ a(T, { icon: "RiSubtractLine" }) : /* @__PURE__ */ a(T, { icon: "RiCheckLine" }) }),
|
|
2415
2430
|
"Select all"
|
|
2416
2431
|
] }),
|
|
2417
|
-
|
|
2418
|
-
/* @__PURE__ */
|
|
2432
|
+
s.options.map((m) => /* @__PURE__ */ y(M.MultiSelectItem, { value: m.value, children: [
|
|
2433
|
+
/* @__PURE__ */ a(M.SelectedIndicator, { children: /* @__PURE__ */ a(T, { icon: "RiCheckLine" }) }),
|
|
2419
2434
|
m.label
|
|
2420
2435
|
] }, m.value))
|
|
2421
2436
|
] }) }) })
|
|
@@ -2423,12 +2438,12 @@ const Ta = (t) => t ? Array.isArray(t) ? t : [t] : [], Ui = O((t) => {
|
|
|
2423
2438
|
}
|
|
2424
2439
|
) });
|
|
2425
2440
|
});
|
|
2426
|
-
|
|
2427
|
-
const
|
|
2441
|
+
ji.displayName = "MultiSelectInput";
|
|
2442
|
+
const Fa = {
|
|
2428
2443
|
...Q,
|
|
2429
2444
|
type: "multi-select",
|
|
2430
2445
|
options: []
|
|
2431
|
-
},
|
|
2446
|
+
}, Ae = class Ae extends Ui {
|
|
2432
2447
|
constructor(n) {
|
|
2433
2448
|
const { placeholder: e = "Select one or more...", ...i } = n;
|
|
2434
2449
|
super({ ...i, placeholder: e, type: "multi-select" });
|
|
@@ -2445,16 +2460,16 @@ const La = {
|
|
|
2445
2460
|
}
|
|
2446
2461
|
static deserialize(n) {
|
|
2447
2462
|
if (n.type !== "multi-select") throw new Error("Type mismatch.");
|
|
2448
|
-
return new
|
|
2463
|
+
return new Ae(n);
|
|
2449
2464
|
}
|
|
2450
2465
|
getInput(n) {
|
|
2451
|
-
return /* @__PURE__ */
|
|
2466
|
+
return /* @__PURE__ */ a(ji, { field: this, ...n });
|
|
2452
2467
|
}
|
|
2453
2468
|
};
|
|
2454
|
-
w(
|
|
2455
|
-
let
|
|
2456
|
-
const
|
|
2457
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field:
|
|
2469
|
+
w(Ae, "fieldTypeName", "Multi-select"), w(Ae, "fieldTypeDescription", "Allows the user to select a multiple options from a list of options."), w(Ae, "Icon", xr);
|
|
2470
|
+
let pt = Ae;
|
|
2471
|
+
const Wi = O((t) => {
|
|
2472
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t), { onChange: c, onBlur: d } = l;
|
|
2458
2473
|
let [{ helpText: u, label: h }] = U(t);
|
|
2459
2474
|
u = o ? null : u, h = o ? "" : h;
|
|
2460
2475
|
const g = N(
|
|
@@ -2462,8 +2477,8 @@ const ji = O((t) => {
|
|
|
2462
2477
|
c(m), d(m);
|
|
2463
2478
|
},
|
|
2464
2479
|
[c, d]
|
|
2465
|
-
), b = A(() =>
|
|
2466
|
-
return /* @__PURE__ */
|
|
2480
|
+
), b = A(() => s.options.find((m) => m.value === l.value), [s.options, l.value]);
|
|
2481
|
+
return /* @__PURE__ */ a(re, { helpText: u, severity: r, children: /* @__PURE__ */ a(
|
|
2467
2482
|
ie,
|
|
2468
2483
|
{
|
|
2469
2484
|
size: i,
|
|
@@ -2471,9 +2486,9 @@ const ji = O((t) => {
|
|
|
2471
2486
|
inputId: n,
|
|
2472
2487
|
labelId: e,
|
|
2473
2488
|
label: h,
|
|
2474
|
-
image: o ? void 0 :
|
|
2489
|
+
image: o ? void 0 : s.image,
|
|
2475
2490
|
children: /* @__PURE__ */ y(M.Root, { children: [
|
|
2476
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ a(M.ClickTrigger, { children: /* @__PURE__ */ y(
|
|
2477
2492
|
X,
|
|
2478
2493
|
{
|
|
2479
2494
|
...l,
|
|
@@ -2483,27 +2498,28 @@ const ji = O((t) => {
|
|
|
2483
2498
|
accentColor: "base",
|
|
2484
2499
|
variant: "surface",
|
|
2485
2500
|
type: "button",
|
|
2501
|
+
size: "sm",
|
|
2486
2502
|
...f,
|
|
2487
2503
|
children: [
|
|
2488
|
-
b ? b.label :
|
|
2489
|
-
/* @__PURE__ */
|
|
2504
|
+
b ? b.label : s.placeholder,
|
|
2505
|
+
/* @__PURE__ */ a(T, { icon: "RiArrowDownSLine" })
|
|
2490
2506
|
]
|
|
2491
2507
|
}
|
|
2492
2508
|
) }),
|
|
2493
|
-
/* @__PURE__ */
|
|
2494
|
-
/* @__PURE__ */
|
|
2509
|
+
/* @__PURE__ */ a(M.Content, { children: /* @__PURE__ */ a(M.Scroll, { children: /* @__PURE__ */ a(M.SelectGroup, { value: l.value, onValueChange: g, children: s.options.map((m) => /* @__PURE__ */ y(M.SelectItem, { value: m.value, children: [
|
|
2510
|
+
/* @__PURE__ */ a(M.SelectedIndicator, { children: /* @__PURE__ */ a(T, { icon: "RiCheckLine" }) }),
|
|
2495
2511
|
m.label
|
|
2496
2512
|
] }, m.value)) }) }) })
|
|
2497
2513
|
] })
|
|
2498
2514
|
}
|
|
2499
2515
|
) });
|
|
2500
2516
|
});
|
|
2501
|
-
|
|
2502
|
-
const
|
|
2517
|
+
Wi.displayName = "SelectInput";
|
|
2518
|
+
const Da = {
|
|
2503
2519
|
...Q,
|
|
2504
2520
|
type: "select",
|
|
2505
2521
|
options: []
|
|
2506
|
-
},
|
|
2522
|
+
}, Oe = class Oe extends Ui {
|
|
2507
2523
|
constructor(n) {
|
|
2508
2524
|
const { placeholder: e = "Select one...", ...i } = n;
|
|
2509
2525
|
super({ ...i, placeholder: e, type: "select" });
|
|
@@ -2516,19 +2532,19 @@ const Fa = {
|
|
|
2516
2532
|
}
|
|
2517
2533
|
static deserialize(n) {
|
|
2518
2534
|
if (n.type !== "select") throw new Error("Type mismatch.");
|
|
2519
|
-
return new
|
|
2535
|
+
return new Oe(n);
|
|
2520
2536
|
}
|
|
2521
2537
|
getInput(n) {
|
|
2522
|
-
return /* @__PURE__ */
|
|
2538
|
+
return /* @__PURE__ */ a(Wi, { field: this, ...n });
|
|
2523
2539
|
}
|
|
2524
2540
|
};
|
|
2525
|
-
w(
|
|
2526
|
-
let
|
|
2541
|
+
w(Oe, "fieldTypeName", "Dropdown"), w(Oe, "fieldTypeDescription", "Allows the user to select a single option from a list of options."), w(Oe, "Icon", Er);
|
|
2542
|
+
let gt = Oe;
|
|
2527
2543
|
const _n = (t) => "fields" in t;
|
|
2528
|
-
class
|
|
2544
|
+
class vt extends G {
|
|
2529
2545
|
constructor(e) {
|
|
2530
|
-
const { minLength: i, maxLength: r, placeholder: o = "", ...
|
|
2531
|
-
super(
|
|
2546
|
+
const { minLength: i, maxLength: r, placeholder: o = "", ...s } = e;
|
|
2547
|
+
super(s);
|
|
2532
2548
|
w(this, "minLength");
|
|
2533
2549
|
w(this, "maxLength");
|
|
2534
2550
|
w(this, "placeholder");
|
|
@@ -2595,22 +2611,22 @@ class gt extends G {
|
|
|
2595
2611
|
* This function returns a function that validates that the value given for "minimum length" (when creating a new field) is less than or
|
|
2596
2612
|
* equal to the value given for "maximum length".
|
|
2597
2613
|
*/
|
|
2598
|
-
w(
|
|
2614
|
+
w(vt, "_validateMin", (e) => (i, r) => {
|
|
2599
2615
|
const o = _n(r) ? Y(r, e) : r;
|
|
2600
2616
|
return typeof o.maximum_length == "number" && typeof i == "number" && o.maximum_length < i ? "Minimum cannot be greater than maximum." : null;
|
|
2601
2617
|
}), /**
|
|
2602
2618
|
* This function returns a function that validates that the value given for "maximum length" (when creating a new field) is greater than or
|
|
2603
2619
|
* equal to the value given for "minimum length".
|
|
2604
2620
|
*/
|
|
2605
|
-
w(
|
|
2621
|
+
w(vt, "_validateMax", (e) => (i, r) => {
|
|
2606
2622
|
if (typeof i != "number") return null;
|
|
2607
2623
|
const { minimum_length: o } = _n(r) ? Y(r, e) : r;
|
|
2608
2624
|
return typeof o != "number" ? null : o > i ? "Maximum cannot be less than minimum." : null;
|
|
2609
2625
|
});
|
|
2610
|
-
const
|
|
2611
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field:
|
|
2626
|
+
const qi = O((t) => {
|
|
2627
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t);
|
|
2612
2628
|
let [{ helpText: c, label: d }] = U(t);
|
|
2613
|
-
return c = o ? null : c, d = o ? "" : d, /* @__PURE__ */
|
|
2629
|
+
return c = o ? null : c, d = o ? "" : d, /* @__PURE__ */ a(re, { helpText: c, severity: r, children: /* @__PURE__ */ a(
|
|
2614
2630
|
ie,
|
|
2615
2631
|
{
|
|
2616
2632
|
size: i,
|
|
@@ -2618,30 +2634,30 @@ const Wi = O((t) => {
|
|
|
2618
2634
|
inputId: n,
|
|
2619
2635
|
labelId: e,
|
|
2620
2636
|
label: d,
|
|
2621
|
-
image: o ? void 0 :
|
|
2622
|
-
children: /* @__PURE__ */
|
|
2623
|
-
|
|
2637
|
+
image: o ? void 0 : s.image,
|
|
2638
|
+
children: /* @__PURE__ */ a(de.Root, { accentColor: "base", variant: "surface", size: "sm", children: /* @__PURE__ */ a(
|
|
2639
|
+
de.Field,
|
|
2624
2640
|
{
|
|
2625
2641
|
...f,
|
|
2626
2642
|
...l,
|
|
2627
|
-
type:
|
|
2643
|
+
type: s.inputType,
|
|
2628
2644
|
id: n,
|
|
2629
|
-
placeholder:
|
|
2645
|
+
placeholder: s.placeholder
|
|
2630
2646
|
}
|
|
2631
2647
|
) })
|
|
2632
2648
|
}
|
|
2633
2649
|
) });
|
|
2634
2650
|
});
|
|
2635
|
-
|
|
2636
|
-
const
|
|
2651
|
+
qi.displayName = "StringInput";
|
|
2652
|
+
const Aa = {
|
|
2637
2653
|
...Q,
|
|
2638
2654
|
type: "string",
|
|
2639
2655
|
maximum_length: Ze,
|
|
2640
2656
|
input_type: "text"
|
|
2641
|
-
},
|
|
2657
|
+
}, Pe = class Pe extends vt {
|
|
2642
2658
|
constructor(e) {
|
|
2643
|
-
const { inputType: i = "text", ...r } = e, o = e.maxLength ? Math.min(Ze, e.maxLength) : Ze,
|
|
2644
|
-
super({ ...r, maxLength: o, minLength:
|
|
2659
|
+
const { inputType: i = "text", ...r } = e, o = e.maxLength ? Math.min(Ze, e.maxLength) : Ze, s = e.minLength ? Math.min(e.minLength, o) : void 0;
|
|
2660
|
+
super({ ...r, maxLength: o, minLength: s, type: "string" });
|
|
2645
2661
|
w(this, "inputType");
|
|
2646
2662
|
this.inputType = i;
|
|
2647
2663
|
}
|
|
@@ -2650,9 +2666,9 @@ const Da = {
|
|
|
2650
2666
|
}
|
|
2651
2667
|
static deserialize(e) {
|
|
2652
2668
|
if (e.type !== "string") throw new Error("Type mismatch.");
|
|
2653
|
-
const { maximum_length: i, minimum_length: r, input_type: o, ...
|
|
2654
|
-
return new
|
|
2655
|
-
...
|
|
2669
|
+
const { maximum_length: i, minimum_length: r, input_type: o, ...s } = e;
|
|
2670
|
+
return new Pe({
|
|
2671
|
+
...s,
|
|
2656
2672
|
maxLength: i,
|
|
2657
2673
|
minLength: r,
|
|
2658
2674
|
inputType: o,
|
|
@@ -2660,15 +2676,15 @@ const Da = {
|
|
|
2660
2676
|
});
|
|
2661
2677
|
}
|
|
2662
2678
|
getInput(e) {
|
|
2663
|
-
return /* @__PURE__ */
|
|
2679
|
+
return /* @__PURE__ */ a(qi, { field: this, ...e });
|
|
2664
2680
|
}
|
|
2665
2681
|
};
|
|
2666
|
-
w(
|
|
2667
|
-
let
|
|
2668
|
-
const
|
|
2669
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field:
|
|
2682
|
+
w(Pe, "fieldTypeName", "Short Text"), w(Pe, "fieldTypeDescription", `Short text fields can hold up to ${Ze} characters on a single line.`), w(Pe, "Icon", Ir);
|
|
2683
|
+
let Bt = Pe;
|
|
2684
|
+
const Hi = O((t) => {
|
|
2685
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t);
|
|
2670
2686
|
let [{ helpText: c, label: d }] = U(t);
|
|
2671
|
-
return c = o ? null : c, d = o ? "" : d, /* @__PURE__ */
|
|
2687
|
+
return c = o ? null : c, d = o ? "" : d, /* @__PURE__ */ a(re, { helpText: c, severity: r, children: /* @__PURE__ */ a(
|
|
2672
2688
|
ie,
|
|
2673
2689
|
{
|
|
2674
2690
|
size: i,
|
|
@@ -2676,29 +2692,30 @@ const qi = O((t) => {
|
|
|
2676
2692
|
inputId: n,
|
|
2677
2693
|
labelId: e,
|
|
2678
2694
|
label: d,
|
|
2679
|
-
image: o ? void 0 :
|
|
2680
|
-
children: /* @__PURE__ */
|
|
2681
|
-
|
|
2695
|
+
image: o ? void 0 : s.image,
|
|
2696
|
+
children: /* @__PURE__ */ a(
|
|
2697
|
+
Un,
|
|
2682
2698
|
{
|
|
2683
2699
|
...f,
|
|
2684
2700
|
...l,
|
|
2685
2701
|
className: "field-sizing-content",
|
|
2686
2702
|
resize: "vertical",
|
|
2687
2703
|
id: n,
|
|
2688
|
-
placeholder:
|
|
2704
|
+
placeholder: s.placeholder,
|
|
2689
2705
|
accentColor: "base",
|
|
2690
|
-
variant: "surface"
|
|
2706
|
+
variant: "surface",
|
|
2707
|
+
size: "sm"
|
|
2691
2708
|
}
|
|
2692
2709
|
)
|
|
2693
2710
|
}
|
|
2694
2711
|
) });
|
|
2695
2712
|
});
|
|
2696
|
-
|
|
2697
|
-
const
|
|
2713
|
+
Hi.displayName = "TextInput";
|
|
2714
|
+
const Oa = {
|
|
2698
2715
|
...Q,
|
|
2699
2716
|
type: "text",
|
|
2700
2717
|
maximum_length: _e
|
|
2701
|
-
},
|
|
2718
|
+
}, ke = class ke extends vt {
|
|
2702
2719
|
constructor(n) {
|
|
2703
2720
|
const e = n.maxLength ? Math.min(_e, n.maxLength) : _e, i = n.minLength ? Math.min(n.minLength, e) : void 0;
|
|
2704
2721
|
super({ ...n, maxLength: e, minLength: i, type: "text" });
|
|
@@ -2709,7 +2726,7 @@ const Aa = {
|
|
|
2709
2726
|
static deserialize(n) {
|
|
2710
2727
|
if (n.type !== "text") throw new Error("Type mismatch.");
|
|
2711
2728
|
const { maximum_length: e, minimum_length: i, ...r } = n;
|
|
2712
|
-
return new
|
|
2729
|
+
return new ke({
|
|
2713
2730
|
...r,
|
|
2714
2731
|
maxLength: e,
|
|
2715
2732
|
minLength: i,
|
|
@@ -2717,17 +2734,17 @@ const Aa = {
|
|
|
2717
2734
|
});
|
|
2718
2735
|
}
|
|
2719
2736
|
getInput(n) {
|
|
2720
|
-
return /* @__PURE__ */
|
|
2737
|
+
return /* @__PURE__ */ a(Hi, { field: this, ...n });
|
|
2721
2738
|
}
|
|
2722
2739
|
};
|
|
2723
|
-
w(
|
|
2724
|
-
let
|
|
2725
|
-
var Je = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, nt = { exports: {} },
|
|
2726
|
-
function
|
|
2727
|
-
return
|
|
2740
|
+
w(ke, "fieldTypeName", "Paragraph"), w(ke, "fieldTypeDescription", `Paragraph fields can hold up to ${_e} characters and can have multiple lines.`), w(ke, "Icon", Sr);
|
|
2741
|
+
let Vt = ke;
|
|
2742
|
+
var Je = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, nt = { exports: {} }, Pa = nt.exports, $n;
|
|
2743
|
+
function ka() {
|
|
2744
|
+
return $n || ($n = 1, function(t, n) {
|
|
2728
2745
|
(function(e, i) {
|
|
2729
2746
|
i();
|
|
2730
|
-
})(
|
|
2747
|
+
})(Pa, function() {
|
|
2731
2748
|
function e(c, d) {
|
|
2732
2749
|
return typeof d > "u" ? d = { autoBom: !1 } : typeof d != "object" && (console.warn("Deprecated: Expected third argument to be a object"), d = { autoBom: !d }), d.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type) ? new Blob(["\uFEFF", c], { type: c.type }) : c;
|
|
2733
2750
|
}
|
|
@@ -2756,9 +2773,9 @@ function Pa() {
|
|
|
2756
2773
|
d.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), c.dispatchEvent(d);
|
|
2757
2774
|
}
|
|
2758
2775
|
}
|
|
2759
|
-
var
|
|
2776
|
+
var s = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof Je == "object" && Je.global === Je ? Je : void 0, l = s.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), f = s.saveAs || (typeof window != "object" || window !== s ? function() {
|
|
2760
2777
|
} : "download" in HTMLAnchorElement.prototype && !l ? function(c, d, u) {
|
|
2761
|
-
var h =
|
|
2778
|
+
var h = s.URL || s.webkitURL, g = document.createElement("a");
|
|
2762
2779
|
d = d || c.name || "download", g.download = d, g.rel = "noopener", typeof c == "string" ? (g.href = c, g.origin === location.origin ? o(g) : r(g.href) ? i(c, d, u) : o(g, g.target = "_blank")) : (g.href = h.createObjectURL(c), setTimeout(function() {
|
|
2763
2780
|
h.revokeObjectURL(g.href);
|
|
2764
2781
|
}, 4e4), setTimeout(function() {
|
|
@@ -2775,7 +2792,7 @@ function Pa() {
|
|
|
2775
2792
|
}
|
|
2776
2793
|
} : function(c, d, u, h) {
|
|
2777
2794
|
if (h = h || open("", "_blank"), h && (h.document.title = h.document.body.innerText = "downloading..."), typeof c == "string") return i(c, d, u);
|
|
2778
|
-
var g = c.type === "application/octet-stream", b = /constructor/i.test(
|
|
2795
|
+
var g = c.type === "application/octet-stream", b = /constructor/i.test(s.HTMLElement) || s.safari, m = /CriOS\/[\d]+/.test(navigator.userAgent);
|
|
2779
2796
|
if ((m || g && b || l) && typeof FileReader < "u") {
|
|
2780
2797
|
var v = new FileReader();
|
|
2781
2798
|
v.onloadend = function() {
|
|
@@ -2783,44 +2800,44 @@ function Pa() {
|
|
|
2783
2800
|
S = m ? S : S.replace(/^data:[^;]*;/, "data:attachment/file;"), h ? h.location.href = S : location = S, h = null;
|
|
2784
2801
|
}, v.readAsDataURL(c);
|
|
2785
2802
|
} else {
|
|
2786
|
-
var x =
|
|
2803
|
+
var x = s.URL || s.webkitURL, E = x.createObjectURL(c);
|
|
2787
2804
|
h ? h.location = E : location.href = E, h = null, setTimeout(function() {
|
|
2788
2805
|
x.revokeObjectURL(E);
|
|
2789
2806
|
}, 4e4);
|
|
2790
2807
|
}
|
|
2791
2808
|
});
|
|
2792
|
-
|
|
2809
|
+
s.saveAs = f.saveAs = f, t.exports = f;
|
|
2793
2810
|
});
|
|
2794
2811
|
}(nt)), nt.exports;
|
|
2795
2812
|
}
|
|
2796
|
-
var
|
|
2797
|
-
const
|
|
2813
|
+
var Ma = ka();
|
|
2814
|
+
const za = O(
|
|
2798
2815
|
qe((t, n) => {
|
|
2799
|
-
const { file: e, alt: i, error: r, rightSlot: o, className:
|
|
2800
|
-
|
|
2816
|
+
const { file: e, alt: i, error: r, rightSlot: o, className: s, truncateLength: l, ...f } = t, c = ne(null), d = ne(null), u = jn(c);
|
|
2817
|
+
dr(() => {
|
|
2801
2818
|
!d.current || !u || (d.current.style.height = `${u.height * 4}px`);
|
|
2802
2819
|
}, [u]);
|
|
2803
2820
|
const h = A(() => {
|
|
2804
2821
|
if (e)
|
|
2805
|
-
return l !== void 0 ?
|
|
2822
|
+
return l !== void 0 ? Xt(e.name, l) : e.name;
|
|
2806
2823
|
}, [e, l]);
|
|
2807
2824
|
return /* @__PURE__ */ y(
|
|
2808
2825
|
"div",
|
|
2809
2826
|
{
|
|
2810
|
-
className:
|
|
2811
|
-
|
|
2827
|
+
className: Ve(
|
|
2828
|
+
s,
|
|
2812
2829
|
"relative flex h-max w-full flex-col gap-0 overflow-hidden rounded-md border items-center border-(--base-a6)"
|
|
2813
2830
|
),
|
|
2814
2831
|
ref: n,
|
|
2815
2832
|
...f,
|
|
2816
2833
|
children: [
|
|
2817
|
-
!e && !r && /* @__PURE__ */
|
|
2818
|
-
/* @__PURE__ */
|
|
2834
|
+
!e && !r && /* @__PURE__ */ a("div", { className: "absolute flex h-full w-full flex-col items-center justify-center", children: /* @__PURE__ */ a(yt, {}) }),
|
|
2835
|
+
/* @__PURE__ */ a(
|
|
2819
2836
|
"div",
|
|
2820
2837
|
{
|
|
2821
2838
|
ref: d,
|
|
2822
2839
|
className: "-m-4 flex max-w-full items-center justify-center overflow-hidden bg-clip-padding",
|
|
2823
|
-
children: e && !r && /* @__PURE__ */
|
|
2840
|
+
children: e && !r && /* @__PURE__ */ a(
|
|
2824
2841
|
"img",
|
|
2825
2842
|
{
|
|
2826
2843
|
className: "max-w-full object-cover",
|
|
@@ -2833,13 +2850,13 @@ const Ma = O(
|
|
|
2833
2850
|
/* @__PURE__ */ y(
|
|
2834
2851
|
"div",
|
|
2835
2852
|
{
|
|
2836
|
-
className:
|
|
2853
|
+
className: Ve("flex h-max w-full items-center gap-1 bg-(--base-2) px-2 py-1", {
|
|
2837
2854
|
"bg-transparent": !e
|
|
2838
2855
|
}),
|
|
2839
2856
|
ref: c,
|
|
2840
2857
|
children: [
|
|
2841
|
-
r ? /* @__PURE__ */
|
|
2842
|
-
r ?? h,
|
|
2858
|
+
r ? /* @__PURE__ */ a(T, { icon: "RiFileWarningLine" }) : e && /* @__PURE__ */ a(wt, { fileType: e.type }),
|
|
2859
|
+
/* @__PURE__ */ a(ye, { className: "truncate", size: "sm", children: r ?? h }),
|
|
2843
2860
|
o
|
|
2844
2861
|
]
|
|
2845
2862
|
}
|
|
@@ -2859,12 +2876,12 @@ const Ma = O(
|
|
|
2859
2876
|
style: "unit",
|
|
2860
2877
|
unit: n[i]
|
|
2861
2878
|
}).format(e);
|
|
2862
|
-
},
|
|
2879
|
+
}, Gi = O((t) => {
|
|
2863
2880
|
var I;
|
|
2864
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, helpText: o, showInputOnly:
|
|
2881
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, helpText: o, showInputOnly: s, field: l, fieldProps: f }, c] = U(t), { onChange: d } = f;
|
|
2865
2882
|
let [{ label: u }] = U(t);
|
|
2866
|
-
u =
|
|
2867
|
-
const h = r ?
|
|
2883
|
+
u = s ? "" : u;
|
|
2884
|
+
const h = r ? ue[r] : void 0, g = ne(null), { value: b } = f, m = A(() => s ? null : o || (l.maxFileSize ? `Maximum file size: ${l.maxFileSize}MB` : null), [l.maxFileSize, o, s]), v = N(() => {
|
|
2868
2885
|
var L;
|
|
2869
2886
|
(L = g.current) == null || L.click();
|
|
2870
2887
|
}, []), x = N(
|
|
@@ -2875,7 +2892,7 @@ const Ma = O(
|
|
|
2875
2892
|
[b, d]
|
|
2876
2893
|
), E = b ? "Select new files" : "Select files", S = b ? "Select new file" : "Select a file", C = l.maxFiles > 1 ? E : S;
|
|
2877
2894
|
return /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
|
|
2878
|
-
/* @__PURE__ */
|
|
2895
|
+
/* @__PURE__ */ a(re, { helpText: m, severity: r, children: /* @__PURE__ */ y(
|
|
2879
2896
|
ie,
|
|
2880
2897
|
{
|
|
2881
2898
|
size: i,
|
|
@@ -2883,25 +2900,27 @@ const Ma = O(
|
|
|
2883
2900
|
inputId: n,
|
|
2884
2901
|
labelId: e,
|
|
2885
2902
|
label: u,
|
|
2886
|
-
image:
|
|
2903
|
+
image: s ? void 0 : l.image,
|
|
2887
2904
|
children: [
|
|
2888
|
-
/* @__PURE__ */
|
|
2905
|
+
/* @__PURE__ */ a("div", { className: "flex gap-2", children: /* @__PURE__ */ y(
|
|
2889
2906
|
X,
|
|
2890
2907
|
{
|
|
2891
2908
|
...c,
|
|
2892
2909
|
className: "w-max",
|
|
2910
|
+
size: "sm",
|
|
2893
2911
|
variant: "soft",
|
|
2912
|
+
accentColor: "base",
|
|
2894
2913
|
onClick: v,
|
|
2895
2914
|
id: "upload-input-upload-button",
|
|
2896
2915
|
type: "button",
|
|
2897
2916
|
children: [
|
|
2898
|
-
/* @__PURE__ */
|
|
2917
|
+
/* @__PURE__ */ a(T, { icon: "RiUpload2Line" }),
|
|
2899
2918
|
" ",
|
|
2900
2919
|
C
|
|
2901
2920
|
]
|
|
2902
2921
|
}
|
|
2903
2922
|
) }),
|
|
2904
|
-
/* @__PURE__ */
|
|
2923
|
+
/* @__PURE__ */ a(
|
|
2905
2924
|
"input",
|
|
2906
2925
|
{
|
|
2907
2926
|
...c,
|
|
@@ -2919,8 +2938,8 @@ const Ma = O(
|
|
|
2919
2938
|
]
|
|
2920
2939
|
}
|
|
2921
2940
|
) }),
|
|
2922
|
-
Array.isArray(b) && b.length > 0 && /* @__PURE__ */
|
|
2923
|
-
|
|
2941
|
+
Array.isArray(b) && b.length > 0 && /* @__PURE__ */ a("div", { className: "flex h-max flex-col gap-2", children: b.map((L, R) => /* @__PURE__ */ a(
|
|
2942
|
+
Xi,
|
|
2924
2943
|
{
|
|
2925
2944
|
field: l,
|
|
2926
2945
|
file: L,
|
|
@@ -2933,21 +2952,21 @@ const Ma = O(
|
|
|
2933
2952
|
)) })
|
|
2934
2953
|
] });
|
|
2935
2954
|
});
|
|
2936
|
-
|
|
2937
|
-
const
|
|
2938
|
-
const { file: n, field: e, onRemove: i, disabled: r } = t, [o,
|
|
2955
|
+
Gi.displayName = "UploadInput";
|
|
2956
|
+
const Xi = O((t) => {
|
|
2957
|
+
const { file: n, field: e, onRemove: i, disabled: r } = t, [o, s] = H(null), l = tn(), f = A(() => o && e.getError([o]), [e, o]), { url: c, name: d } = A(() => {
|
|
2939
2958
|
let m = null, v, x;
|
|
2940
2959
|
return o != null && o.type.startsWith("image/") && (m = URL.createObjectURL(o)), o ? (v = o.name, x = _a(o.size)) : (v = "Downloading...", x = "..."), { url: m, name: v, size: x };
|
|
2941
2960
|
}, [o]);
|
|
2942
2961
|
K(() => {
|
|
2943
|
-
n instanceof Promise ? n.then(
|
|
2962
|
+
n instanceof Promise ? n.then(s).catch(console.error) : s(n);
|
|
2944
2963
|
}, [n]);
|
|
2945
2964
|
const u = N(
|
|
2946
2965
|
(m) => {
|
|
2947
2966
|
if (m.stopPropagation(), !o)
|
|
2948
2967
|
throw new Error("Cannot download a file that is not resolved.");
|
|
2949
2968
|
const v = new Blob([o]);
|
|
2950
|
-
|
|
2969
|
+
Ma.saveAs(v, d);
|
|
2951
2970
|
},
|
|
2952
2971
|
[d, o]
|
|
2953
2972
|
), h = N(
|
|
@@ -2963,14 +2982,14 @@ const Gi = O((t) => {
|
|
|
2963
2982
|
}
|
|
2964
2983
|
}));
|
|
2965
2984
|
}, [r, i, l, o]), b = A(
|
|
2966
|
-
() => /* @__PURE__ */ y(
|
|
2967
|
-
/* @__PURE__ */
|
|
2968
|
-
!r && /* @__PURE__ */
|
|
2985
|
+
() => /* @__PURE__ */ y(bt, { className: "flex grow justify-end", variant: "ghost", accentColor: "base", size: "sm", children: [
|
|
2986
|
+
/* @__PURE__ */ a(B, { "aria-label": `Download ${d}`, onClick: u, disabled: !o, children: /* @__PURE__ */ a(T, { icon: "RiDownload2Line" }) }),
|
|
2987
|
+
!r && /* @__PURE__ */ a(B, { "aria-label": `Remove ${d}`, disabled: r, onClick: h, children: /* @__PURE__ */ a(T, { icon: "RiDeleteBin7Fill" }) })
|
|
2969
2988
|
] }),
|
|
2970
2989
|
[r, h, u, d, o]
|
|
2971
2990
|
);
|
|
2972
|
-
return c ? /* @__PURE__ */
|
|
2973
|
-
|
|
2991
|
+
return c ? /* @__PURE__ */ a(
|
|
2992
|
+
za,
|
|
2974
2993
|
{
|
|
2975
2994
|
className: "cursor-pointer",
|
|
2976
2995
|
onClick: g,
|
|
@@ -2978,19 +2997,19 @@ const Gi = O((t) => {
|
|
|
2978
2997
|
error: f ?? void 0,
|
|
2979
2998
|
rightSlot: b
|
|
2980
2999
|
}
|
|
2981
|
-
) : /* @__PURE__ */
|
|
3000
|
+
) : /* @__PURE__ */ a(Qn, { file: o, error: f ?? void 0, rightSlot: b });
|
|
2982
3001
|
});
|
|
2983
|
-
|
|
2984
|
-
const
|
|
3002
|
+
Xi.displayName = "DisplayFile";
|
|
3003
|
+
const $a = {
|
|
2985
3004
|
...Q,
|
|
2986
3005
|
type: "upload",
|
|
2987
3006
|
extensions: [],
|
|
2988
3007
|
maximum_size: void 0,
|
|
2989
3008
|
maximum_files: 1
|
|
2990
|
-
},
|
|
3009
|
+
}, Me = class Me extends G {
|
|
2991
3010
|
constructor(e) {
|
|
2992
|
-
const { extensions: i, maximum_files: r, maximum_size: o, ...
|
|
2993
|
-
super({ ...
|
|
3011
|
+
const { extensions: i, maximum_files: r, maximum_size: o, ...s } = e;
|
|
3012
|
+
super({ ...s, type: "upload" });
|
|
2994
3013
|
w(this, "extensions");
|
|
2995
3014
|
w(this, "maxFileSize");
|
|
2996
3015
|
w(this, "maxFiles");
|
|
@@ -3032,7 +3051,7 @@ const za = {
|
|
|
3032
3051
|
showDirectly: !1
|
|
3033
3052
|
},
|
|
3034
3053
|
{
|
|
3035
|
-
field: new
|
|
3054
|
+
field: new pt({
|
|
3036
3055
|
label: "Accepted file types",
|
|
3037
3056
|
description: "Types of allowed files to upload. If left blank, all files will be accepted.",
|
|
3038
3057
|
required: !1,
|
|
@@ -3066,11 +3085,11 @@ const za = {
|
|
|
3066
3085
|
}
|
|
3067
3086
|
getFieldValidators() {
|
|
3068
3087
|
const e = super.getFieldValidators(), i = this.maxFileSize ?? it, r = i * 1e3 * 1e3, o = this.maxFiles || 1;
|
|
3069
|
-
return e.push((
|
|
3070
|
-
if (
|
|
3088
|
+
return e.push((s) => {
|
|
3089
|
+
if (s && s.some((l) => l.size > r))
|
|
3071
3090
|
return `Files must be at most ${i}MB.`;
|
|
3072
|
-
}), e.push((
|
|
3073
|
-
if (
|
|
3091
|
+
}), e.push((s) => {
|
|
3092
|
+
if (s && s.length > o)
|
|
3074
3093
|
return `You can only upload ${o} files.`;
|
|
3075
3094
|
}), e;
|
|
3076
3095
|
}
|
|
@@ -3084,54 +3103,54 @@ const za = {
|
|
|
3084
3103
|
}
|
|
3085
3104
|
static deserialize(e) {
|
|
3086
3105
|
if (e.type !== "upload") throw new Error("Type mismatch.");
|
|
3087
|
-
return new
|
|
3106
|
+
return new Me(e);
|
|
3088
3107
|
}
|
|
3089
3108
|
getInput(e) {
|
|
3090
|
-
return /* @__PURE__ */
|
|
3109
|
+
return /* @__PURE__ */ a(Gi, { field: this, ...e });
|
|
3091
3110
|
}
|
|
3092
3111
|
};
|
|
3093
|
-
w(
|
|
3094
|
-
let
|
|
3095
|
-
const
|
|
3096
|
-
date:
|
|
3112
|
+
w(Me, "fieldTypeName", "Upload"), w(Me, "fieldTypeDescription", "Allows a file to be uploaded."), w(Me, "Icon", Rr);
|
|
3113
|
+
let Ut = Me;
|
|
3114
|
+
const hn = {
|
|
3115
|
+
date: zt,
|
|
3097
3116
|
number: ve,
|
|
3098
3117
|
boolean: We,
|
|
3099
|
-
select:
|
|
3100
|
-
string:
|
|
3101
|
-
text:
|
|
3102
|
-
custom:
|
|
3103
|
-
upload:
|
|
3104
|
-
qr:
|
|
3118
|
+
select: gt,
|
|
3119
|
+
string: Bt,
|
|
3120
|
+
text: Vt,
|
|
3121
|
+
custom: ct,
|
|
3122
|
+
upload: Ut,
|
|
3123
|
+
qr: $t,
|
|
3105
3124
|
// TODO: Underscore
|
|
3106
|
-
"multi-string":
|
|
3107
|
-
"multi-select":
|
|
3108
|
-
},
|
|
3109
|
-
date:
|
|
3110
|
-
number:
|
|
3111
|
-
boolean:
|
|
3112
|
-
select:
|
|
3113
|
-
string:
|
|
3114
|
-
text:
|
|
3115
|
-
custom:
|
|
3116
|
-
upload:
|
|
3117
|
-
qr:
|
|
3125
|
+
"multi-string": ht,
|
|
3126
|
+
"multi-select": pt
|
|
3127
|
+
}, Ba = {
|
|
3128
|
+
date: Ca,
|
|
3129
|
+
number: Na,
|
|
3130
|
+
boolean: wa,
|
|
3131
|
+
select: Da,
|
|
3132
|
+
string: Aa,
|
|
3133
|
+
text: Oa,
|
|
3134
|
+
custom: xa,
|
|
3135
|
+
upload: $a,
|
|
3136
|
+
qr: Ta,
|
|
3118
3137
|
// TODO: Underscore
|
|
3119
|
-
"multi-string":
|
|
3120
|
-
"multi-select":
|
|
3121
|
-
}, it = 50, Va = it * 1e3,
|
|
3138
|
+
"multi-string": Ra,
|
|
3139
|
+
"multi-select": Fa
|
|
3140
|
+
}, it = 50, Va = it * 1e3, Ua = Va * 1e3, Ki = (t) => {
|
|
3122
3141
|
const n = t.type;
|
|
3123
|
-
return
|
|
3124
|
-
},
|
|
3125
|
-
function
|
|
3142
|
+
return hn[n].deserialize(t);
|
|
3143
|
+
}, pn = (t) => t.type === "section" ? q.deserialize(t) : Ki(t);
|
|
3144
|
+
function ja(t, n = {}) {
|
|
3126
3145
|
const { readonly: e = !1 } = n;
|
|
3127
3146
|
return {
|
|
3128
3147
|
title: t.title,
|
|
3129
3148
|
description: t.description,
|
|
3130
|
-
fields: t.fields.map((i) =>
|
|
3149
|
+
fields: t.fields.map((i) => pn(i)),
|
|
3131
3150
|
meta: { readonly: e }
|
|
3132
3151
|
};
|
|
3133
3152
|
}
|
|
3134
|
-
function
|
|
3153
|
+
function Yi(t) {
|
|
3135
3154
|
const n = [];
|
|
3136
3155
|
for (const e of t.fields)
|
|
3137
3156
|
if (e instanceof q)
|
|
@@ -3144,28 +3163,28 @@ function Ki(t) {
|
|
|
3144
3163
|
}
|
|
3145
3164
|
return n;
|
|
3146
3165
|
}
|
|
3147
|
-
function
|
|
3148
|
-
const e =
|
|
3166
|
+
function vs(t, n) {
|
|
3167
|
+
const e = Yi(t), i = {};
|
|
3149
3168
|
for (const r of e) {
|
|
3150
3169
|
const o = n[r.identifier] ?? null;
|
|
3151
3170
|
o !== null ? i[r.identifier] = r.decodeJsonToValue(o) : i[r.identifier] = o;
|
|
3152
3171
|
}
|
|
3153
3172
|
return i;
|
|
3154
3173
|
}
|
|
3155
|
-
function
|
|
3156
|
-
const e =
|
|
3174
|
+
function ys(t, n) {
|
|
3175
|
+
const e = Yi(t), i = {};
|
|
3157
3176
|
for (const r of e) {
|
|
3158
3177
|
const o = n[r.identifier];
|
|
3159
3178
|
i[r.identifier] = r.encodeValueToJson(o);
|
|
3160
3179
|
}
|
|
3161
3180
|
return i;
|
|
3162
3181
|
}
|
|
3163
|
-
function
|
|
3182
|
+
function jt(t) {
|
|
3164
3183
|
return Array.isArray(t) && t.some((n) => n instanceof File || n instanceof Promise);
|
|
3165
3184
|
}
|
|
3166
|
-
function
|
|
3185
|
+
function Qi(t, n) {
|
|
3167
3186
|
if (!t) return !0;
|
|
3168
|
-
if (
|
|
3187
|
+
if (jt(n) || jt(t.value)) throw new Error("Conditions do not support file uploads");
|
|
3169
3188
|
const e = Array.isArray(n) ? n.map((r) => typeof r == "string" ? r : r.value) : n, i = Array.isArray(t.value) ? t.value.map((r) => typeof r == "string" ? r : r.value) : t.value;
|
|
3170
3189
|
if (Array.isArray(i) && Array.isArray(e)) {
|
|
3171
3190
|
for (const r of i)
|
|
@@ -3174,34 +3193,37 @@ function Yi(t, n) {
|
|
|
3174
3193
|
}
|
|
3175
3194
|
return i === n;
|
|
3176
3195
|
}
|
|
3177
|
-
const
|
|
3178
|
-
const { field: n, ...e } = t, { label: i, description: r, fields: o, condition:
|
|
3179
|
-
() => c === void 0 ||
|
|
3180
|
-
[
|
|
3196
|
+
const Ji = O((t) => {
|
|
3197
|
+
const { field: n, ...e } = t, { label: i, description: r, fields: o, condition: s } = n, { values: l, setFieldValue: f } = be(), c = s != null && s.identifier ? Y(l, s.identifier) : void 0, d = A(
|
|
3198
|
+
() => c === void 0 || Qi(s, c),
|
|
3199
|
+
[s, c]
|
|
3181
3200
|
);
|
|
3182
3201
|
K(() => {
|
|
3183
3202
|
if (!d)
|
|
3184
3203
|
for (const h of o)
|
|
3185
3204
|
f(h.getId(), "").then();
|
|
3186
3205
|
}, [d, o, f]);
|
|
3187
|
-
const u =
|
|
3188
|
-
return d ? /* @__PURE__ */
|
|
3189
|
-
/* @__PURE__ */ y(
|
|
3190
|
-
/* @__PURE__ */
|
|
3191
|
-
|
|
3206
|
+
const u = dt(o, e);
|
|
3207
|
+
return d ? /* @__PURE__ */ a(Ue, { children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-4", children: [
|
|
3208
|
+
(i || r) && /* @__PURE__ */ y(he, { children: [
|
|
3209
|
+
/* @__PURE__ */ y("div", { className: "flex flex-col", children: [
|
|
3210
|
+
/* @__PURE__ */ a(Wn, { size: "lg", children: i }),
|
|
3211
|
+
/* @__PURE__ */ a(ye, { accentColor: "base", children: r })
|
|
3212
|
+
] }),
|
|
3213
|
+
/* @__PURE__ */ a(Ht, { size: "full" })
|
|
3192
3214
|
] }),
|
|
3193
3215
|
u
|
|
3194
3216
|
] }) }) : null;
|
|
3195
3217
|
});
|
|
3196
|
-
|
|
3197
|
-
const
|
|
3218
|
+
Ji.displayName = "FieldSectionLayout";
|
|
3219
|
+
const ze = class ze extends Jn {
|
|
3198
3220
|
constructor(e) {
|
|
3199
|
-
const { label: i = null, fields: r, condition: o = null, conditional:
|
|
3221
|
+
const { label: i = null, fields: r, condition: o = null, conditional: s, ...l } = e;
|
|
3200
3222
|
super({ ...l, type: "section" });
|
|
3201
3223
|
w(this, "label");
|
|
3202
3224
|
w(this, "fields");
|
|
3203
3225
|
w(this, "condition");
|
|
3204
|
-
this.fields = r, this.condition = o, this.label = i,
|
|
3226
|
+
this.fields = r, this.condition = o, this.label = i, s === !1 && (this.condition = null);
|
|
3205
3227
|
}
|
|
3206
3228
|
static getFieldCreationSchema(e, i = "") {
|
|
3207
3229
|
if (e.length === 0) return [];
|
|
@@ -3217,7 +3239,7 @@ const Me = class Me extends Qn {
|
|
|
3217
3239
|
},
|
|
3218
3240
|
{
|
|
3219
3241
|
// Declare a section that will hold options for the condition (if any).
|
|
3220
|
-
field: new
|
|
3242
|
+
field: new ze({
|
|
3221
3243
|
label: "Conditional settings",
|
|
3222
3244
|
identifier: `${r}conditional-settings`,
|
|
3223
3245
|
// This section will only be rendered if the above "Conditional" field is checked.
|
|
@@ -3229,7 +3251,7 @@ const Me = class Me extends Qn {
|
|
|
3229
3251
|
fields: [
|
|
3230
3252
|
// Declare a select field that will be used to select the field against which we will check the
|
|
3231
3253
|
// condition. This must be selected before the next field is rendered.
|
|
3232
|
-
new
|
|
3254
|
+
new gt({
|
|
3233
3255
|
label: "Field",
|
|
3234
3256
|
description: "The field to use for the condition.",
|
|
3235
3257
|
// The options (for the field against which we will check the condition) are all the labels of
|
|
@@ -3246,7 +3268,7 @@ const Me = class Me extends Qn {
|
|
|
3246
3268
|
// Declare a custom field that will be used to input a value for the condition. The value of the
|
|
3247
3269
|
// conditional field selected in the previous step must be equal to the value the user inputs into
|
|
3248
3270
|
// this field for the section to be rendered.
|
|
3249
|
-
new
|
|
3271
|
+
new Ea({
|
|
3250
3272
|
label: "Value",
|
|
3251
3273
|
identifier: `${r}condition.value`,
|
|
3252
3274
|
required: !0,
|
|
@@ -3254,14 +3276,14 @@ const Me = class Me extends Qn {
|
|
|
3254
3276
|
getFieldToClone(o) {
|
|
3255
3277
|
if (!o)
|
|
3256
3278
|
return null;
|
|
3257
|
-
const
|
|
3258
|
-
return
|
|
3259
|
-
...
|
|
3279
|
+
const s = e.find((l) => l.identifier === o);
|
|
3280
|
+
return s ? {
|
|
3281
|
+
...s,
|
|
3260
3282
|
// Override some options to make it make sense in the context and to make it work with the framework.
|
|
3261
3283
|
label: "Value",
|
|
3262
3284
|
identifier: `${r}condition.value`,
|
|
3263
3285
|
description: "The value to compare against.",
|
|
3264
|
-
required:
|
|
3286
|
+
required: s.type !== "boolean"
|
|
3265
3287
|
} : (console.error("Could not find field with identifier", o), null);
|
|
3266
3288
|
}
|
|
3267
3289
|
})
|
|
@@ -3274,8 +3296,8 @@ const Me = class Me extends Qn {
|
|
|
3274
3296
|
static deserialize(e) {
|
|
3275
3297
|
if (e.type !== "section") throw new Error("Invalid type");
|
|
3276
3298
|
if (!Array.isArray(e.fields)) throw new Error(`Invalid fields: ${e.fields} (not an array)`);
|
|
3277
|
-
const i = e.fields.map(
|
|
3278
|
-
return new
|
|
3299
|
+
const i = e.fields.map(Ki);
|
|
3300
|
+
return new ze({ ...e, fields: i });
|
|
3279
3301
|
}
|
|
3280
3302
|
conditional() {
|
|
3281
3303
|
return this.condition !== null;
|
|
@@ -3292,24 +3314,24 @@ const Me = class Me extends Qn {
|
|
|
3292
3314
|
getErrors(e) {
|
|
3293
3315
|
const i = {};
|
|
3294
3316
|
for (const r of this.fields) {
|
|
3295
|
-
const o = r.getId(),
|
|
3296
|
-
|
|
3317
|
+
const o = r.getId(), s = r.getError(Y(e, o), e);
|
|
3318
|
+
s && Jt(i, r.getId(), s);
|
|
3297
3319
|
}
|
|
3298
3320
|
return i;
|
|
3299
3321
|
}
|
|
3300
3322
|
getInput(e) {
|
|
3301
|
-
return /* @__PURE__ */
|
|
3323
|
+
return /* @__PURE__ */ a(Ji, { field: this, ...e });
|
|
3302
3324
|
}
|
|
3303
3325
|
};
|
|
3304
|
-
w(
|
|
3305
|
-
let q =
|
|
3306
|
-
const me = (t) => Object.keys(t).length > 0,
|
|
3326
|
+
w(ze, "fieldTypeName", "Section"), w(ze, "fieldTypeDescription", "Sections can be useful for grouping fields together. They can also be conditionally shown or hidden.");
|
|
3327
|
+
let q = ze;
|
|
3328
|
+
const me = (t) => Object.keys(t).length > 0, gn = (t, n) => {
|
|
3307
3329
|
const e = {};
|
|
3308
3330
|
for (const i of t.fields)
|
|
3309
3331
|
if (i instanceof q) {
|
|
3310
3332
|
if (i.condition) {
|
|
3311
3333
|
const { identifier: r } = i.condition;
|
|
3312
|
-
if (!
|
|
3334
|
+
if (!Qi(i.condition, Y(n, r)))
|
|
3313
3335
|
continue;
|
|
3314
3336
|
}
|
|
3315
3337
|
Object.assign(e, i.getErrors(n));
|
|
@@ -3317,27 +3339,27 @@ const me = (t) => Object.keys(t).length > 0, pn = (t, n) => {
|
|
|
3317
3339
|
if (!(i instanceof G))
|
|
3318
3340
|
throw new Error("Invalid field type");
|
|
3319
3341
|
const r = i.getId(), o = i.getError(Y(n, r), n);
|
|
3320
|
-
o &&
|
|
3342
|
+
o && Jt(e, r, o);
|
|
3321
3343
|
}
|
|
3322
3344
|
if (me(e)) return e;
|
|
3323
|
-
},
|
|
3324
|
-
(e, i) => i instanceof q ? { ...e, ...
|
|
3345
|
+
}, Wa = [null, void 0], vn = (t, n) => t.reduce(
|
|
3346
|
+
(e, i) => i instanceof q ? { ...e, ...vn(i.fields, n) } : (Wa.includes(Y(e, i.getId())) && Jt(e, i.getId(), ""), e),
|
|
3325
3347
|
// TODO: Had to do this because of this error:
|
|
3326
3348
|
// > Uncaught TypeError: can't define property "description":
|
|
3327
3349
|
// > Object is not extensible"
|
|
3328
3350
|
// This means that we can't mutate `acc` because it's frozen for some
|
|
3329
3351
|
// unknown reason.
|
|
3330
|
-
|
|
3331
|
-
),
|
|
3352
|
+
Or(n)
|
|
3353
|
+
), qa = () => {
|
|
3332
3354
|
throw new Error("onSubmit must be provided if form is not readonly.");
|
|
3333
|
-
},
|
|
3355
|
+
}, Ha = O(
|
|
3334
3356
|
qe((t, n) => {
|
|
3335
3357
|
const {
|
|
3336
3358
|
schema: e,
|
|
3337
3359
|
values: i = {},
|
|
3338
|
-
onSubmit: r =
|
|
3360
|
+
onSubmit: r = qa,
|
|
3339
3361
|
submitText: o = "Submit",
|
|
3340
|
-
cancelText:
|
|
3362
|
+
cancelText: s,
|
|
3341
3363
|
onCancel: l,
|
|
3342
3364
|
onDirty: f,
|
|
3343
3365
|
onDirtyChange: c,
|
|
@@ -3346,51 +3368,51 @@ const me = (t) => Object.keys(t).length > 0, pn = (t, n) => {
|
|
|
3346
3368
|
hideDescription: u,
|
|
3347
3369
|
className: h,
|
|
3348
3370
|
buttonProps: g
|
|
3349
|
-
} = t, { readonly: b } = e.meta, m = A(() => crypto.randomUUID(), []), v =
|
|
3350
|
-
initialValues:
|
|
3371
|
+
} = t, { readonly: b } = e.meta, m = A(() => crypto.randomUUID(), []), v = Yt({
|
|
3372
|
+
initialValues: vn(e.fields, i),
|
|
3351
3373
|
onSubmit: r,
|
|
3352
|
-
validate: (I) =>
|
|
3374
|
+
validate: (I) => gn(e, I),
|
|
3353
3375
|
// only validate the entire form on submit
|
|
3354
3376
|
validateOnBlur: !1,
|
|
3355
3377
|
validateOnChange: !1
|
|
3356
3378
|
}), { dirty: x } = v, E = A(
|
|
3357
|
-
() => typeof e.title == "string" ? /* @__PURE__ */
|
|
3379
|
+
() => typeof e.title == "string" ? /* @__PURE__ */ a(Wn, { size: "md", children: e.title }) : e.title,
|
|
3358
3380
|
[e.title]
|
|
3359
3381
|
), S = A(
|
|
3360
|
-
() => typeof e.description == "string" ? /* @__PURE__ */
|
|
3382
|
+
() => typeof e.description == "string" ? /* @__PURE__ */ a(ye, { accentColor: "base", children: e.description }) : e.description,
|
|
3361
3383
|
[e.description]
|
|
3362
|
-
), C =
|
|
3384
|
+
), C = dt(e.fields, { formId: m, disabled: b });
|
|
3363
3385
|
return K(() => {
|
|
3364
3386
|
x && f && f(), c && c(x);
|
|
3365
|
-
}, [x, f, c]), /* @__PURE__ */
|
|
3387
|
+
}, [x, f, c]), /* @__PURE__ */ a(Qt, { value: v, children: /* @__PURE__ */ y(
|
|
3366
3388
|
"form",
|
|
3367
3389
|
{
|
|
3368
3390
|
id: m,
|
|
3369
3391
|
ref: n,
|
|
3370
|
-
className:
|
|
3392
|
+
className: Ve(h, "flex flex-col gap-2"),
|
|
3371
3393
|
onSubmit: v.handleSubmit,
|
|
3372
3394
|
children: [
|
|
3373
|
-
!d && /* @__PURE__ */
|
|
3395
|
+
!d && /* @__PURE__ */ a(Ue, { children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-1", children: [
|
|
3374
3396
|
E,
|
|
3375
3397
|
!u && S
|
|
3376
3398
|
] }) }),
|
|
3377
3399
|
C,
|
|
3378
3400
|
!b && /* @__PURE__ */ y("div", { className: "flex items-center justify-end gap-2", children: [
|
|
3379
|
-
|
|
3401
|
+
s && /* @__PURE__ */ y(
|
|
3380
3402
|
X,
|
|
3381
3403
|
{
|
|
3382
|
-
accentColor:
|
|
3404
|
+
accentColor: ue.danger,
|
|
3383
3405
|
...g,
|
|
3384
3406
|
type: "button",
|
|
3385
3407
|
onClick: l,
|
|
3386
3408
|
children: [
|
|
3387
|
-
/* @__PURE__ */
|
|
3388
|
-
|
|
3409
|
+
/* @__PURE__ */ a(T, { icon: "RiCloseLine" }),
|
|
3410
|
+
s
|
|
3389
3411
|
]
|
|
3390
3412
|
}
|
|
3391
3413
|
),
|
|
3392
3414
|
/* @__PURE__ */ y(X, { ...g, type: "submit", disabled: !v.isValid, accentColor: "success", children: [
|
|
3393
|
-
/* @__PURE__ */
|
|
3415
|
+
/* @__PURE__ */ a(T, { icon: "RiCheckLine" }),
|
|
3394
3416
|
o
|
|
3395
3417
|
] })
|
|
3396
3418
|
] })
|
|
@@ -3398,10 +3420,10 @@ const me = (t) => Object.keys(t).length > 0, pn = (t, n) => {
|
|
|
3398
3420
|
}
|
|
3399
3421
|
) });
|
|
3400
3422
|
})
|
|
3401
|
-
),
|
|
3402
|
-
const { name: n, render: e } = t, { submitForm: i } =
|
|
3423
|
+
), Be = O((t) => {
|
|
3424
|
+
const { name: n, render: e } = t, { submitForm: i } = be(), [r, o, s] = Kt(n), l = A(() => {
|
|
3403
3425
|
const f = (c) => {
|
|
3404
|
-
|
|
3426
|
+
s.setValue(c, !1);
|
|
3405
3427
|
};
|
|
3406
3428
|
return e({
|
|
3407
3429
|
value: r.value,
|
|
@@ -3411,13 +3433,13 @@ const me = (t) => Object.keys(t).length > 0, pn = (t, n) => {
|
|
|
3411
3433
|
i();
|
|
3412
3434
|
}
|
|
3413
3435
|
});
|
|
3414
|
-
}, [e, r.value, o, i,
|
|
3415
|
-
return /* @__PURE__ */
|
|
3436
|
+
}, [e, r.value, o, i, s]);
|
|
3437
|
+
return /* @__PURE__ */ a(he, { children: l });
|
|
3416
3438
|
});
|
|
3417
|
-
|
|
3418
|
-
const
|
|
3439
|
+
Be.displayName = "PatchField";
|
|
3440
|
+
const bs = O(
|
|
3419
3441
|
qe((t, n) => {
|
|
3420
|
-
const { children: e, schema: i, values: r, onPatch: o, onError:
|
|
3442
|
+
const { children: e, schema: i, values: r, onPatch: o, onError: s, requiresDiff: l = !0, onDirtyChange: f, ...c } = t, d = A(() => vn(i.fields, r), [i.fields, r]), u = N(
|
|
3421
3443
|
(E) => {
|
|
3422
3444
|
const S = {};
|
|
3423
3445
|
for (const C in E) {
|
|
@@ -3435,15 +3457,15 @@ const ys = O(
|
|
|
3435
3457
|
[u, o, l]
|
|
3436
3458
|
), g = N(
|
|
3437
3459
|
(E) => {
|
|
3438
|
-
const S =
|
|
3439
|
-
if (S &&
|
|
3460
|
+
const S = gn(i, E);
|
|
3461
|
+
if (S && s(S), f) {
|
|
3440
3462
|
const C = u(E);
|
|
3441
3463
|
f(me(C));
|
|
3442
3464
|
}
|
|
3443
3465
|
return S;
|
|
3444
3466
|
},
|
|
3445
|
-
[i, f,
|
|
3446
|
-
), b =
|
|
3467
|
+
[i, f, s, u]
|
|
3468
|
+
), b = Yt({
|
|
3447
3469
|
initialValues: d,
|
|
3448
3470
|
onSubmit: h,
|
|
3449
3471
|
validate: g,
|
|
@@ -3458,16 +3480,16 @@ const ys = O(
|
|
|
3458
3480
|
}, [b.values, u, f]), { errors: v, resetForm: x } = b;
|
|
3459
3481
|
return K(() => {
|
|
3460
3482
|
me(v) && x({ values: d, errors: {} });
|
|
3461
|
-
}, [v, d, x]), /* @__PURE__ */
|
|
3483
|
+
}, [v, d, x]), /* @__PURE__ */ a(Qt, { value: b, children: /* @__PURE__ */ a("form", { ...c, ref: n, onSubmit: b.handleSubmit, onChange: m, children: e }) });
|
|
3462
3484
|
})
|
|
3463
|
-
), rt = "form-builder",
|
|
3485
|
+
), rt = "form-builder", Ga = [
|
|
3464
3486
|
["string", "text"],
|
|
3465
3487
|
["select", "multi-select", "upload", "qr"],
|
|
3466
3488
|
["boolean", "date", "number", "multi-string"]
|
|
3467
|
-
],
|
|
3468
|
-
...
|
|
3489
|
+
], Wt = {
|
|
3490
|
+
...hn,
|
|
3469
3491
|
section: q
|
|
3470
|
-
},
|
|
3492
|
+
}, Xa = (t, n) => {
|
|
3471
3493
|
var i;
|
|
3472
3494
|
const e = { ...t };
|
|
3473
3495
|
switch (n.type) {
|
|
@@ -3482,7 +3504,7 @@ const ys = O(
|
|
|
3482
3504
|
case "update":
|
|
3483
3505
|
return n.state;
|
|
3484
3506
|
}
|
|
3485
|
-
},
|
|
3507
|
+
}, Ka = (t, n) => {
|
|
3486
3508
|
if (n)
|
|
3487
3509
|
for (let e = 0; e < t.length; e++) {
|
|
3488
3510
|
const i = t[e];
|
|
@@ -3491,42 +3513,42 @@ const ys = O(
|
|
|
3491
3513
|
if (r.identifier === n) return e;
|
|
3492
3514
|
}
|
|
3493
3515
|
}
|
|
3494
|
-
},
|
|
3516
|
+
}, Bn = (t) => {
|
|
3495
3517
|
var e, i, r;
|
|
3496
3518
|
const n = {};
|
|
3497
3519
|
for (let o = 0; o < t.length; o++) {
|
|
3498
|
-
const
|
|
3499
|
-
if (!
|
|
3520
|
+
const s = t[o];
|
|
3521
|
+
if (!s) throw new Error("Field is undefined.");
|
|
3500
3522
|
const l = o > 0 ? (e = n[t[o - 1].identifier]) == null ? void 0 : e.conditionFields : void 0, f = new Set(l);
|
|
3501
|
-
(i =
|
|
3523
|
+
(i = s.condition) != null && i.identifier && f.add(s.condition.identifier), n[s.identifier] = {
|
|
3502
3524
|
disabled: !1,
|
|
3503
3525
|
conditionFields: f,
|
|
3504
|
-
conditionIndex:
|
|
3526
|
+
conditionIndex: Ka(t, (r = s.condition) == null ? void 0 : r.identifier),
|
|
3505
3527
|
index: o,
|
|
3506
|
-
label:
|
|
3528
|
+
label: s.label
|
|
3507
3529
|
};
|
|
3508
3530
|
}
|
|
3509
3531
|
return n;
|
|
3510
|
-
},
|
|
3511
|
-
const { index: n, type: e, sectionIndex: i, remove: r, duplicate: o, move:
|
|
3532
|
+
}, yn = O((t) => {
|
|
3533
|
+
const { index: n, type: e, sectionIndex: i, remove: r, duplicate: o, move: s, upload: l } = t;
|
|
3512
3534
|
if (e !== "section" && !l)
|
|
3513
3535
|
throw new Error("Upload function prop must be defined for non-section fields.");
|
|
3514
|
-
const { values: f } =
|
|
3536
|
+
const { values: f } = be(), c = ne(null), d = A(() => {
|
|
3515
3537
|
const u = [
|
|
3516
3538
|
{
|
|
3517
|
-
Icon:
|
|
3539
|
+
Icon: Nr,
|
|
3518
3540
|
key: "duplicate",
|
|
3519
3541
|
text: "Duplicate",
|
|
3520
3542
|
buttonProps: { onClick: o }
|
|
3521
3543
|
}
|
|
3522
3544
|
];
|
|
3523
3545
|
return u.push({
|
|
3524
|
-
Icon:
|
|
3546
|
+
Icon: Tr,
|
|
3525
3547
|
key: "delete",
|
|
3526
3548
|
text: "Delete",
|
|
3527
3549
|
buttonProps: { onClick: r }
|
|
3528
3550
|
}), e !== "section" && u.unshift({
|
|
3529
|
-
Icon:
|
|
3551
|
+
Icon: Lr,
|
|
3530
3552
|
key: "upload",
|
|
3531
3553
|
text: "Upload image",
|
|
3532
3554
|
buttonProps: {
|
|
@@ -3536,86 +3558,86 @@ const ys = O(
|
|
|
3536
3558
|
}
|
|
3537
3559
|
}
|
|
3538
3560
|
}), (i === void 0 && n !== f.fields.length - 1 || i !== void 0 && (i < f.fields.length - 1 || n !== f.fields[i].fields.length - 1)) && u.unshift({
|
|
3539
|
-
Icon:
|
|
3561
|
+
Icon: Fr,
|
|
3540
3562
|
key: "moveDown",
|
|
3541
3563
|
text: "Move down",
|
|
3542
3564
|
buttonProps: {
|
|
3543
3565
|
onClick: () => {
|
|
3544
|
-
|
|
3566
|
+
s("down");
|
|
3545
3567
|
}
|
|
3546
3568
|
}
|
|
3547
3569
|
}), (i === void 0 && n !== 0 || i !== void 0 && (i !== 0 || n !== 0)) && u.unshift({
|
|
3548
|
-
Icon:
|
|
3570
|
+
Icon: Dr,
|
|
3549
3571
|
key: "moveUp",
|
|
3550
3572
|
text: "Move up",
|
|
3551
3573
|
buttonProps: {
|
|
3552
3574
|
onClick: () => {
|
|
3553
|
-
|
|
3575
|
+
s("up");
|
|
3554
3576
|
}
|
|
3555
3577
|
}
|
|
3556
3578
|
}), u;
|
|
3557
|
-
}, [o, n,
|
|
3579
|
+
}, [o, n, s, r, i, e, f.fields]);
|
|
3558
3580
|
return /* @__PURE__ */ y(he, { children: [
|
|
3559
|
-
/* @__PURE__ */
|
|
3560
|
-
|
|
3581
|
+
/* @__PURE__ */ a(bt, { className: "mx-2 hidden flex-col gap-0.5 sm:flex", variant: "ghost", accentColor: "base", size: "sm", children: d.map((u) => /* @__PURE__ */ a(
|
|
3582
|
+
B,
|
|
3561
3583
|
{
|
|
3562
3584
|
type: "button",
|
|
3563
|
-
variant: "ghost",
|
|
3564
|
-
accentColor: u.key.startsWith("move") ? "base" : void 0,
|
|
3565
3585
|
"aria-label": u.text,
|
|
3566
3586
|
...u.buttonProps,
|
|
3567
|
-
children: /* @__PURE__ */
|
|
3587
|
+
children: /* @__PURE__ */ a(u.Icon, {})
|
|
3568
3588
|
},
|
|
3569
3589
|
u.key
|
|
3570
3590
|
)) }),
|
|
3571
|
-
/* @__PURE__ */
|
|
3572
|
-
/* @__PURE__ */
|
|
3573
|
-
/* @__PURE__ */
|
|
3591
|
+
/* @__PURE__ */ a("div", { className: "sm:hidden", children: /* @__PURE__ */ y(M.Root, { children: [
|
|
3592
|
+
/* @__PURE__ */ a(M.ClickTrigger, { children: /* @__PURE__ */ a(B, { variant: "ghost", accentColor: "base", "aria-label": "Actions menu", size: "sm", children: /* @__PURE__ */ a(T, { icon: "RiMore2Line" }) }) }),
|
|
3593
|
+
/* @__PURE__ */ a(M.Content, { children: d.map((u) => {
|
|
3574
3594
|
var h;
|
|
3575
3595
|
return /* @__PURE__ */ y(M.Item, { onClick: (h = u.buttonProps) == null ? void 0 : h.onClick, children: [
|
|
3576
|
-
/* @__PURE__ */
|
|
3596
|
+
/* @__PURE__ */ a(u.Icon, {}),
|
|
3577
3597
|
u.text
|
|
3578
3598
|
] }, u.key);
|
|
3579
3599
|
}) })
|
|
3580
3600
|
] }) }),
|
|
3581
|
-
e !== "section" && /* @__PURE__ */
|
|
3601
|
+
e !== "section" && /* @__PURE__ */ a("input", { style: { display: "none" }, ref: c, type: "file", accept: "image/*", onChange: l })
|
|
3582
3602
|
] });
|
|
3583
3603
|
});
|
|
3584
|
-
|
|
3585
|
-
const
|
|
3586
|
-
const i =
|
|
3604
|
+
yn.displayName = "FieldActions";
|
|
3605
|
+
const Zi = (t = () => null) => A(() => Ga.map((n) => n.map((e) => {
|
|
3606
|
+
const i = hn[e], r = i.Icon;
|
|
3587
3607
|
return {
|
|
3588
3608
|
children: i.fieldTypeName,
|
|
3589
|
-
icon: /* @__PURE__ */
|
|
3609
|
+
icon: /* @__PURE__ */ a(r, {}),
|
|
3590
3610
|
value: e,
|
|
3591
3611
|
onSelect: () => {
|
|
3592
3612
|
t(e);
|
|
3593
3613
|
}
|
|
3594
3614
|
};
|
|
3595
|
-
})), [t]), fe = (t) => t.type === "section",
|
|
3615
|
+
})), [t]), fe = (t) => t.type === "section", qt = O((t) => {
|
|
3596
3616
|
const { popoverInputs: n, hasError: e } = t;
|
|
3597
3617
|
return /* @__PURE__ */ y(oe.Root, { children: [
|
|
3598
|
-
/* @__PURE__ */
|
|
3618
|
+
/* @__PURE__ */ a(oe.Trigger, { asChild: !0, children: /* @__PURE__ */ y(
|
|
3599
3619
|
X,
|
|
3600
3620
|
{
|
|
3601
3621
|
variant: "soft",
|
|
3622
|
+
type: "button",
|
|
3602
3623
|
size: "sm",
|
|
3603
3624
|
"aria-label": "settings",
|
|
3604
|
-
|
|
3625
|
+
accentColor: "base",
|
|
3626
|
+
...e && { color: ue.danger },
|
|
3605
3627
|
children: [
|
|
3606
|
-
/* @__PURE__ */
|
|
3607
|
-
/* @__PURE__ */
|
|
3628
|
+
/* @__PURE__ */ a(T, { icon: "RiSettings2Line" }),
|
|
3629
|
+
/* @__PURE__ */ a("span", { children: "Settings" })
|
|
3608
3630
|
]
|
|
3609
3631
|
},
|
|
3610
3632
|
"settings"
|
|
3611
3633
|
) }),
|
|
3612
|
-
/* @__PURE__ */
|
|
3634
|
+
/* @__PURE__ */ a(oe.Content, { size: "sm", children: /* @__PURE__ */ a("div", { className: "flex max-w-[240px] flex-col", children: n }) })
|
|
3613
3635
|
] });
|
|
3614
3636
|
});
|
|
3615
|
-
|
|
3616
|
-
const
|
|
3617
|
-
var He,
|
|
3618
|
-
const { parentPath: n, index: e, initial: i, conditionalSourceFields: r } = t, { values: o, setFieldValue:
|
|
3637
|
+
qt.displayName = "FieldSettingsPopover";
|
|
3638
|
+
const bn = O((t) => {
|
|
3639
|
+
var He, It, wn, Cn, xn;
|
|
3640
|
+
const { parentPath: n, index: e, initial: i, conditionalSourceFields: r } = t, { values: o, setFieldValue: s, errors: l } = be(), f = Zi(), c = tn(), d = ne(null), u = 576, [h, g] = H(
|
|
3619
3641
|
d.current && d.current.getBoundingClientRect().width >= u
|
|
3620
3642
|
);
|
|
3621
3643
|
K(() => {
|
|
@@ -3637,31 +3659,31 @@ const yn = O((t) => {
|
|
|
3637
3659
|
(D) => {
|
|
3638
3660
|
D.stopPropagation();
|
|
3639
3661
|
const { image: k, ...W } = i;
|
|
3640
|
-
|
|
3662
|
+
s(`${n}.${e}`, W).then();
|
|
3641
3663
|
},
|
|
3642
|
-
[e, i, n,
|
|
3664
|
+
[e, i, n, s]
|
|
3643
3665
|
);
|
|
3644
3666
|
K(() => {
|
|
3645
|
-
fe(i) && !i.conditional &&
|
|
3646
|
-
}, [e, i, n,
|
|
3667
|
+
fe(i) && !i.conditional && s(`${n}.${e}.condition`, null).then();
|
|
3668
|
+
}, [e, i, n, s]);
|
|
3647
3669
|
const E = A(
|
|
3648
3670
|
() => {
|
|
3649
3671
|
var D, k;
|
|
3650
|
-
return fe(i) ? (k =
|
|
3672
|
+
return fe(i) ? (k = Mi(o.fields, (D = i.condition) == null ? void 0 : D.identifier)) == null ? void 0 : k.label : void 0;
|
|
3651
3673
|
},
|
|
3652
3674
|
[i, o.fields]
|
|
3653
3675
|
), S = fe(i) ? Array.isArray((He = i.condition) == null ? void 0 : He.value) ? "contains all of" : "equals" : void 0;
|
|
3654
3676
|
let C;
|
|
3655
3677
|
if (fe(i)) {
|
|
3656
|
-
if (
|
|
3678
|
+
if (jt((It = i.condition) == null ? void 0 : It.value))
|
|
3657
3679
|
throw new Error("File values are not supported for conditions.");
|
|
3658
|
-
C = Array.isArray((
|
|
3680
|
+
C = Array.isArray((wn = i.condition) == null ? void 0 : wn.value) ? i.condition.value.map((D) => typeof D == "string" ? D : D.label).join(", ") : (xn = (Cn = i.condition) == null ? void 0 : Cn.value) == null ? void 0 : xn.toString();
|
|
3659
3681
|
}
|
|
3660
3682
|
const I = N((D) => {
|
|
3661
3683
|
D.target.parentNode instanceof HTMLElement && (D.target.parentNode.dataset.replicatedValue = D.target.value);
|
|
3662
3684
|
}, []), L = N((D) => {
|
|
3663
3685
|
D.target.parentNode instanceof HTMLElement && (D.target.parentNode.dataset.replicatedValue = D.target.value);
|
|
3664
|
-
}, []), R = i.type, F =
|
|
3686
|
+
}, []), R = i.type, F = Wt[R], [V, _] = A(() => {
|
|
3665
3687
|
let D = [], k = [];
|
|
3666
3688
|
if (F === q) {
|
|
3667
3689
|
if (r === void 0)
|
|
@@ -3687,92 +3709,93 @@ const yn = O((t) => {
|
|
|
3687
3709
|
]) : k = [...k, ...W.map((j) => j.field)];
|
|
3688
3710
|
}
|
|
3689
3711
|
return [D, k];
|
|
3690
|
-
}, [F, r, n, e, h]), P =
|
|
3712
|
+
}, [F, r, n, e, h]), P = dt(V, {
|
|
3691
3713
|
formId: rt,
|
|
3692
3714
|
disabled: !1,
|
|
3693
3715
|
internal: !0,
|
|
3694
3716
|
...F === q && { size: "sm" }
|
|
3695
|
-
}), $ =
|
|
3717
|
+
}), $ = dt(_, {
|
|
3696
3718
|
formId: rt,
|
|
3697
3719
|
disabled: !1
|
|
3698
3720
|
});
|
|
3699
|
-
let
|
|
3700
|
-
fe(i) &&
|
|
3701
|
-
const Z =
|
|
3721
|
+
let z = _.length > 0;
|
|
3722
|
+
fe(i) && _.length > 0 && (z = i.conditional);
|
|
3723
|
+
const Z = _.some((D) => {
|
|
3702
3724
|
const k = Y(l, F === q ? `${n}.${e}.condition` : D.getId());
|
|
3703
3725
|
return k && (typeof k != "object" || me(k));
|
|
3704
|
-
}),
|
|
3726
|
+
}), Ce = Z ? ue.danger : void 0, je = A(() => pn(i), [i]), Et = Pi(je, { formId: rt, showInputOnly: !1 }), se = A(
|
|
3705
3727
|
() => f.flat().find((D) => D.value === R),
|
|
3706
3728
|
[f, R]
|
|
3707
|
-
),
|
|
3729
|
+
), xe = N(() => {
|
|
3708
3730
|
b && c(() => ({
|
|
3709
3731
|
file: b
|
|
3710
3732
|
}));
|
|
3711
3733
|
}, [c, b]);
|
|
3712
|
-
return /* @__PURE__ */
|
|
3713
|
-
F === q && /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
|
|
3714
|
-
|
|
3715
|
-
/* @__PURE__ */ y("div", { className: "flex items-center gap-4", children: [
|
|
3716
|
-
|
|
3717
|
-
fe(i) && i.conditional && /* @__PURE__ */
|
|
3734
|
+
return /* @__PURE__ */ a("div", { className: "flex grow items-center w-full", ref: d, children: /* @__PURE__ */ y("div", { className: "flex w-full flex-col gap-2", children: [
|
|
3735
|
+
F === q && (V.length > 0 || z) && /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
|
|
3736
|
+
P,
|
|
3737
|
+
z && /* @__PURE__ */ y("div", { className: "flex items-center gap-4", children: [
|
|
3738
|
+
/* @__PURE__ */ a(qt, { popoverInputs: $, hasError: Z }),
|
|
3739
|
+
fe(i) && i.conditional && /* @__PURE__ */ a("span", { className: "text-sm text-(--accent-a11)", "data-accent-color": Ce, children: /* @__PURE__ */ y("em", { children: [
|
|
3718
3740
|
"Display only if ",
|
|
3719
|
-
/* @__PURE__ */
|
|
3741
|
+
/* @__PURE__ */ a("strong", { children: E }),
|
|
3720
3742
|
" ",
|
|
3721
3743
|
S,
|
|
3722
3744
|
" ",
|
|
3723
|
-
/* @__PURE__ */
|
|
3745
|
+
/* @__PURE__ */ a("strong", { children: C })
|
|
3724
3746
|
] }) })
|
|
3725
3747
|
] })
|
|
3726
3748
|
] }),
|
|
3727
3749
|
F !== q && /* @__PURE__ */ y("div", { className: "flex gap-2 w-full justify-between", children: [
|
|
3728
3750
|
/* @__PURE__ */ y("div", { className: "flex gap-2 items-center", children: [
|
|
3729
|
-
/* @__PURE__ */ y(
|
|
3730
|
-
|
|
3731
|
-
|
|
3751
|
+
/* @__PURE__ */ y(ot, { accentColor: "base", variant: "soft", size: "sm", children: [
|
|
3752
|
+
se == null ? void 0 : se.icon,
|
|
3753
|
+
se == null ? void 0 : se.children
|
|
3732
3754
|
] }),
|
|
3733
|
-
/* @__PURE__ */
|
|
3734
|
-
|
|
3755
|
+
/* @__PURE__ */ a(
|
|
3756
|
+
Be,
|
|
3735
3757
|
{
|
|
3736
3758
|
name: `${n}.${e}.required`,
|
|
3737
3759
|
render: ({ setValue: D, value: k }) => /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
|
|
3738
|
-
/* @__PURE__ */
|
|
3739
|
-
/* @__PURE__ */
|
|
3760
|
+
/* @__PURE__ */ a(at.Root, { checked: k, onCheckedChange: D, size: "sm", children: /* @__PURE__ */ a(at.Indicator, { children: /* @__PURE__ */ a(T, { icon: "RiCheckLine" }) }) }),
|
|
3761
|
+
/* @__PURE__ */ a(ye, { size: "sm", accentColor: "base", children: "Required" })
|
|
3740
3762
|
] })
|
|
3741
3763
|
}
|
|
3742
3764
|
)
|
|
3743
3765
|
] }),
|
|
3744
|
-
|
|
3766
|
+
z && /* @__PURE__ */ a(qt, { popoverInputs: $, hasError: Z })
|
|
3745
3767
|
] }),
|
|
3746
3768
|
b && /* @__PURE__ */ y("div", { className: "group relative inline-block w-full min-w-[300px]", children: [
|
|
3747
|
-
/* @__PURE__ */
|
|
3769
|
+
/* @__PURE__ */ a(
|
|
3748
3770
|
"img",
|
|
3749
3771
|
{
|
|
3750
3772
|
className: "h-[100px] w-full min-w-[300px] cursor-pointer rounded-md object-cover",
|
|
3751
3773
|
src: v,
|
|
3752
3774
|
alt: b.name,
|
|
3753
|
-
onClick:
|
|
3775
|
+
onClick: xe
|
|
3754
3776
|
}
|
|
3755
3777
|
),
|
|
3756
|
-
/* @__PURE__ */
|
|
3757
|
-
|
|
3778
|
+
/* @__PURE__ */ a(
|
|
3779
|
+
B,
|
|
3758
3780
|
{
|
|
3759
3781
|
className: "absolute top-2 right-2 hidden group-hover:not-disabled:flex",
|
|
3760
3782
|
variant: "solid",
|
|
3761
|
-
accentColor:
|
|
3783
|
+
accentColor: "base",
|
|
3762
3784
|
"aria-label": "delete",
|
|
3763
3785
|
onClick: x,
|
|
3764
|
-
|
|
3786
|
+
size: "sm",
|
|
3787
|
+
children: /* @__PURE__ */ a(T, { icon: "RiDeleteBin7Fill" })
|
|
3765
3788
|
}
|
|
3766
3789
|
)
|
|
3767
3790
|
] }),
|
|
3768
|
-
/* @__PURE__ */
|
|
3769
|
-
|
|
3791
|
+
/* @__PURE__ */ a(
|
|
3792
|
+
Be,
|
|
3770
3793
|
{
|
|
3771
3794
|
name: `${n}.${e}.label`,
|
|
3772
|
-
render: ({ setValue: D, value: k }) => /* @__PURE__ */
|
|
3795
|
+
render: ({ setValue: D, value: k }) => /* @__PURE__ */ a(
|
|
3773
3796
|
"input",
|
|
3774
3797
|
{
|
|
3775
|
-
className: "bg-transparent outline-none text-
|
|
3798
|
+
className: "bg-transparent outline-none text-sm",
|
|
3776
3799
|
placeholder: R === "section" ? "Enter a section label (optional)" : "Enter your question",
|
|
3777
3800
|
value: k,
|
|
3778
3801
|
onChange: (W) => {
|
|
@@ -3784,14 +3807,14 @@ const yn = O((t) => {
|
|
|
3784
3807
|
)
|
|
3785
3808
|
}
|
|
3786
3809
|
),
|
|
3787
|
-
/* @__PURE__ */
|
|
3788
|
-
|
|
3810
|
+
/* @__PURE__ */ a(
|
|
3811
|
+
Be,
|
|
3789
3812
|
{
|
|
3790
3813
|
name: `${n}.${e}.description`,
|
|
3791
|
-
render: ({ setValue: D, value: k }) => /* @__PURE__ */
|
|
3814
|
+
render: ({ setValue: D, value: k }) => /* @__PURE__ */ a(
|
|
3792
3815
|
"textarea",
|
|
3793
3816
|
{
|
|
3794
|
-
className: "bg-transparent outline-none text-
|
|
3817
|
+
className: "bg-transparent outline-none text-sm field-sizing-content grow",
|
|
3795
3818
|
placeholder: `Enter a ${R === "section" ? "section" : "field"} description (optional)`,
|
|
3796
3819
|
value: k,
|
|
3797
3820
|
onChange: (W) => {
|
|
@@ -3803,19 +3826,19 @@ const yn = O((t) => {
|
|
|
3803
3826
|
)
|
|
3804
3827
|
}
|
|
3805
3828
|
),
|
|
3806
|
-
F !== q &&
|
|
3807
|
-
F !== q && /* @__PURE__ */ y(
|
|
3808
|
-
/* @__PURE__ */
|
|
3809
|
-
|
|
3810
|
-
/* @__PURE__ */
|
|
3811
|
-
|
|
3812
|
-
|
|
3829
|
+
F !== q && V.length > 0 && /* @__PURE__ */ a("div", { className: "w-full", children: P }),
|
|
3830
|
+
F !== q && /* @__PURE__ */ y(Ue, { className: "flex gap-4 bg-(--accent-a2) items-center", children: [
|
|
3831
|
+
/* @__PURE__ */ y(St.Root, { children: [
|
|
3832
|
+
/* @__PURE__ */ a(St.Trigger, { asChild: !0, children: /* @__PURE__ */ a(ot, { icon: !0, size: "sm", variant: "soft", accentColor: "base", children: /* @__PURE__ */ a(T, { icon: "RiEyeLine" }) }) }),
|
|
3833
|
+
/* @__PURE__ */ a(St.Content, { className: "w-[225px]", size: "sm", align: "start", children: "This is a preview of the field as it will be rendered in the form." })
|
|
3834
|
+
] }),
|
|
3835
|
+
/* @__PURE__ */ a("div", { className: "grow", children: Et })
|
|
3813
3836
|
] })
|
|
3814
3837
|
] }) });
|
|
3815
3838
|
});
|
|
3816
|
-
|
|
3817
|
-
const
|
|
3818
|
-
const { field: n, index: e, sectionIndex: i, remove: r } = t, { setFieldValue: o, values:
|
|
3839
|
+
bn.displayName = "FieldBuilder";
|
|
3840
|
+
const er = O((t) => {
|
|
3841
|
+
const { field: n, index: e, sectionIndex: i, remove: r } = t, { setFieldValue: o, values: s } = be(), { reorderField: l } = mn(), { showError: f } = Gt(), c = `fields.${i}.fields`, d = A(
|
|
3819
3842
|
() => ({
|
|
3820
3843
|
index: e,
|
|
3821
3844
|
parentPath: c,
|
|
@@ -3827,13 +3850,13 @@ const Zi = O((t) => {
|
|
|
3827
3850
|
...n,
|
|
3828
3851
|
label: b
|
|
3829
3852
|
};
|
|
3830
|
-
|
|
3831
|
-
}, [n, c, e,
|
|
3853
|
+
mt(c, e + 1, m, s, o);
|
|
3854
|
+
}, [n, c, e, s, o]), h = N(
|
|
3832
3855
|
(b) => {
|
|
3833
|
-
const m = i, v =
|
|
3856
|
+
const m = i, v = s.fields[m];
|
|
3834
3857
|
let x = i, E = b === "up" ? e - 1 : e + 1;
|
|
3835
|
-
b === "up" && e === 0 ? (x = i - 1, E =
|
|
3836
|
-
const S =
|
|
3858
|
+
b === "up" && e === 0 ? (x = i - 1, E = s.fields[x].fields.length) : b === "down" && e === v.fields.length - 1 && (x = i + 1, E = 0);
|
|
3859
|
+
const S = s.fields[x];
|
|
3837
3860
|
l(
|
|
3838
3861
|
v,
|
|
3839
3862
|
m,
|
|
@@ -3844,14 +3867,14 @@ const Zi = O((t) => {
|
|
|
3844
3867
|
o
|
|
3845
3868
|
);
|
|
3846
3869
|
},
|
|
3847
|
-
[i,
|
|
3870
|
+
[i, s.fields, e, l, o]
|
|
3848
3871
|
), g = N(
|
|
3849
3872
|
(b) => {
|
|
3850
3873
|
const { files: m } = b.target;
|
|
3851
3874
|
if (!m || m.length !== 1) return;
|
|
3852
3875
|
const v = m.item(0);
|
|
3853
3876
|
if (v) {
|
|
3854
|
-
if (v.size >
|
|
3877
|
+
if (v.size > Ua) {
|
|
3855
3878
|
f({
|
|
3856
3879
|
title: "File upload error",
|
|
3857
3880
|
description: `The file ${v.name} exceeded the maximum file size`
|
|
@@ -3866,7 +3889,7 @@ const Zi = O((t) => {
|
|
|
3866
3889
|
},
|
|
3867
3890
|
[n, e, c, o, f]
|
|
3868
3891
|
);
|
|
3869
|
-
return /* @__PURE__ */
|
|
3892
|
+
return /* @__PURE__ */ a(en, { draggableId: n.identifier, index: e, children: (b) => /* @__PURE__ */ a(
|
|
3870
3893
|
Ue,
|
|
3871
3894
|
{
|
|
3872
3895
|
ref: b.innerRef,
|
|
@@ -3874,9 +3897,9 @@ const Zi = O((t) => {
|
|
|
3874
3897
|
...b.dragHandleProps,
|
|
3875
3898
|
className: "mb-4",
|
|
3876
3899
|
children: /* @__PURE__ */ y("div", { className: "flex items-center justify-between gap-4 w-full", children: [
|
|
3877
|
-
/* @__PURE__ */
|
|
3878
|
-
/* @__PURE__ */
|
|
3879
|
-
|
|
3900
|
+
/* @__PURE__ */ a(bn, { ...d }),
|
|
3901
|
+
/* @__PURE__ */ a(
|
|
3902
|
+
yn,
|
|
3880
3903
|
{
|
|
3881
3904
|
index: e,
|
|
3882
3905
|
type: n.type,
|
|
@@ -3891,17 +3914,17 @@ const Zi = O((t) => {
|
|
|
3891
3914
|
}
|
|
3892
3915
|
) });
|
|
3893
3916
|
});
|
|
3894
|
-
|
|
3895
|
-
const
|
|
3917
|
+
er.displayName = "FieldWithActions";
|
|
3918
|
+
const tr = O((t) => {
|
|
3896
3919
|
var S;
|
|
3897
|
-
const { field: n, index: e, dropState: i, fieldsOnly: r } = t, o = (S = i[n.identifier]) == null ? void 0 : S.disabled, { setFieldValue:
|
|
3920
|
+
const { field: n, index: e, dropState: i, fieldsOnly: r } = t, o = (S = i[n.identifier]) == null ? void 0 : S.disabled, { setFieldValue: s, values: l } = be(), f = ar(), { reorderSection: c } = mn(), d = N(
|
|
3898
3921
|
(C, I) => {
|
|
3899
3922
|
for (const L of C) {
|
|
3900
3923
|
const R = I.indexOf(L);
|
|
3901
|
-
|
|
3924
|
+
s(`fields.${R}.condition`, null).then(), s(`fields.${R}.conditional`, !1).then();
|
|
3902
3925
|
}
|
|
3903
3926
|
},
|
|
3904
|
-
[
|
|
3927
|
+
[s]
|
|
3905
3928
|
), u = N(
|
|
3906
3929
|
(C) => {
|
|
3907
3930
|
var R;
|
|
@@ -3913,20 +3936,20 @@ const er = O((t) => {
|
|
|
3913
3936
|
return {
|
|
3914
3937
|
removing: I,
|
|
3915
3938
|
affectedSections: L,
|
|
3916
|
-
action: () =>
|
|
3939
|
+
action: () => s(`fields.${e}.fields`, ft(n.fields, C))
|
|
3917
3940
|
};
|
|
3918
3941
|
},
|
|
3919
|
-
[n.fields, l.fields,
|
|
3942
|
+
[n.fields, l.fields, s, e]
|
|
3920
3943
|
), h = N(
|
|
3921
3944
|
(C) => {
|
|
3922
3945
|
const { affectedSections: I, action: L, removing: R } = u(C), F = () => {
|
|
3923
3946
|
L().then(), d(I, l.fields);
|
|
3924
3947
|
};
|
|
3925
3948
|
if (I.length > 0) {
|
|
3926
|
-
const
|
|
3949
|
+
const V = I.map((_) => _.label).join(", ");
|
|
3927
3950
|
f({
|
|
3928
3951
|
title: "Remove condition?",
|
|
3929
|
-
description: `${R.label} is being used as a condition, deleting it will remove the condition from the ${
|
|
3952
|
+
description: `${R.label} is being used as a condition, deleting it will remove the condition from the ${V} section(s).`,
|
|
3930
3953
|
action: "Remove",
|
|
3931
3954
|
onAction: F
|
|
3932
3955
|
});
|
|
@@ -3936,15 +3959,15 @@ const er = O((t) => {
|
|
|
3936
3959
|
},
|
|
3937
3960
|
[u, d, l.fields, f]
|
|
3938
3961
|
), g = N(() => {
|
|
3939
|
-
const I = n.fields.map(($,
|
|
3962
|
+
const I = n.fields.map(($, z) => u(z)).flatMap(($) => $.affectedSections), L = I.length ? "Remove fields and conditions?" : "Remove fields?", R = n.fields.length, F = I.map(($) => $.label).join(", "), V = I.length ? `Deleting this section will remove the ${R} field(s) it contains and will remove the conditions from following sections: ${F}` : `Deleting this section will remove the ${R} field(s) it contains.`, _ = ft(l.fields, e), P = () => s("fields", _);
|
|
3940
3963
|
if (I.length > 0) {
|
|
3941
3964
|
f({
|
|
3942
3965
|
title: L,
|
|
3943
|
-
description:
|
|
3966
|
+
description: V,
|
|
3944
3967
|
action: "Remove",
|
|
3945
3968
|
onAction: () => {
|
|
3946
3969
|
P().then(() => {
|
|
3947
|
-
d(I,
|
|
3970
|
+
d(I, _);
|
|
3948
3971
|
});
|
|
3949
3972
|
}
|
|
3950
3973
|
});
|
|
@@ -3956,42 +3979,42 @@ const er = O((t) => {
|
|
|
3956
3979
|
l.fields,
|
|
3957
3980
|
e,
|
|
3958
3981
|
u,
|
|
3959
|
-
|
|
3982
|
+
s,
|
|
3960
3983
|
f,
|
|
3961
3984
|
d
|
|
3962
3985
|
]), b = N(
|
|
3963
3986
|
(C) => {
|
|
3964
3987
|
const I = C === "up" ? e - 1 : e + 1;
|
|
3965
|
-
c(i, n.identifier, e, I, l,
|
|
3988
|
+
c(i, n.identifier, e, I, l, s);
|
|
3966
3989
|
},
|
|
3967
|
-
[e, c, i, n.identifier, l,
|
|
3990
|
+
[e, c, i, n.identifier, l, s]
|
|
3968
3991
|
), m = A(
|
|
3969
3992
|
() => ({
|
|
3970
3993
|
index: e,
|
|
3971
3994
|
parentPath: "fields",
|
|
3972
3995
|
initial: n,
|
|
3973
|
-
conditionalSourceFields:
|
|
3996
|
+
conditionalSourceFields: zi(l.fields, e)
|
|
3974
3997
|
}),
|
|
3975
3998
|
[n, e, l.fields]
|
|
3976
3999
|
), v = N(() => {
|
|
3977
4000
|
const C = n.label ?? "Untitled section", I = n.fields.map((R) => ({
|
|
3978
4001
|
...R,
|
|
3979
|
-
identifier:
|
|
4002
|
+
identifier: fn(null, R.label)
|
|
3980
4003
|
})), L = { ...n, label: C, fields: I };
|
|
3981
|
-
|
|
3982
|
-
}, [n, e, l,
|
|
4004
|
+
mt("fields", e + 1, L, l, s);
|
|
4005
|
+
}, [n, e, l, s]), x = N(
|
|
3983
4006
|
(C) => {
|
|
3984
|
-
|
|
4007
|
+
mt(
|
|
3985
4008
|
`fields.${e}.fields`,
|
|
3986
4009
|
n.fields.length,
|
|
3987
|
-
|
|
4010
|
+
Ba[C],
|
|
3988
4011
|
l,
|
|
3989
|
-
|
|
4012
|
+
s
|
|
3990
4013
|
);
|
|
3991
4014
|
},
|
|
3992
|
-
[e, n.fields.length, l,
|
|
3993
|
-
), E =
|
|
3994
|
-
return /* @__PURE__ */
|
|
4015
|
+
[e, n.fields.length, l, s]
|
|
4016
|
+
), E = Zi(x);
|
|
4017
|
+
return /* @__PURE__ */ a(en, { draggableId: n.identifier, index: e, children: (C) => /* @__PURE__ */ a(
|
|
3995
4018
|
Ue,
|
|
3996
4019
|
{
|
|
3997
4020
|
ref: C.innerRef,
|
|
@@ -4001,9 +4024,9 @@ const er = O((t) => {
|
|
|
4001
4024
|
className: "mb-4 w-full",
|
|
4002
4025
|
children: /* @__PURE__ */ y("div", { className: "flex items-center justify-between gap-3 w-full", children: [
|
|
4003
4026
|
/* @__PURE__ */ y("div", { className: "flex grow flex-col gap-2 w-full", children: [
|
|
4004
|
-
!r && /* @__PURE__ */
|
|
4005
|
-
/* @__PURE__ */
|
|
4006
|
-
|
|
4027
|
+
!r && /* @__PURE__ */ a(bn, { ...m }),
|
|
4028
|
+
/* @__PURE__ */ a(
|
|
4029
|
+
Zt,
|
|
4007
4030
|
{
|
|
4008
4031
|
droppableId: n.identifier,
|
|
4009
4032
|
type: "SECTION",
|
|
@@ -4015,8 +4038,8 @@ const er = O((t) => {
|
|
|
4015
4038
|
ref: I.innerRef,
|
|
4016
4039
|
...I.droppableProps,
|
|
4017
4040
|
children: [
|
|
4018
|
-
n.fields.map((L, R) => /* @__PURE__ */
|
|
4019
|
-
|
|
4041
|
+
n.fields.map((L, R) => /* @__PURE__ */ a(
|
|
4042
|
+
er,
|
|
4020
4043
|
{
|
|
4021
4044
|
field: L,
|
|
4022
4045
|
index: R,
|
|
@@ -4029,11 +4052,11 @@ const er = O((t) => {
|
|
|
4029
4052
|
)),
|
|
4030
4053
|
I.placeholder,
|
|
4031
4054
|
/* @__PURE__ */ y(M.Root, { children: [
|
|
4032
|
-
/* @__PURE__ */
|
|
4033
|
-
/* @__PURE__ */
|
|
4055
|
+
/* @__PURE__ */ a(M.ClickTrigger, { children: /* @__PURE__ */ y(X, { type: "button", variant: "soft", children: [
|
|
4056
|
+
/* @__PURE__ */ a(T, { icon: "RiAddLine" }),
|
|
4034
4057
|
" Add field"
|
|
4035
4058
|
] }) }),
|
|
4036
|
-
/* @__PURE__ */
|
|
4059
|
+
/* @__PURE__ */ a(M.Content, { children: E.flat().map((L) => /* @__PURE__ */ y(M.Item, { onSelect: L.onSelect, children: [
|
|
4037
4060
|
L.icon,
|
|
4038
4061
|
L.children
|
|
4039
4062
|
] }, L.value)) })
|
|
@@ -4044,8 +4067,8 @@ const er = O((t) => {
|
|
|
4044
4067
|
}
|
|
4045
4068
|
)
|
|
4046
4069
|
] }),
|
|
4047
|
-
!r && /* @__PURE__ */
|
|
4048
|
-
|
|
4070
|
+
!r && /* @__PURE__ */ a(
|
|
4071
|
+
yn,
|
|
4049
4072
|
{
|
|
4050
4073
|
index: e,
|
|
4051
4074
|
type: n.type,
|
|
@@ -4058,14 +4081,14 @@ const er = O((t) => {
|
|
|
4058
4081
|
}
|
|
4059
4082
|
) });
|
|
4060
4083
|
});
|
|
4061
|
-
|
|
4084
|
+
tr.displayName = "FieldSectionWithActions";
|
|
4062
4085
|
const Vn = (t, n) => {
|
|
4063
4086
|
for (const [e, i] of Object.entries(t))
|
|
4064
4087
|
if (i.identifier === n) return [i, e];
|
|
4065
|
-
},
|
|
4066
|
-
const { fieldsOnly: n } = t, { values: e, setFieldValue: i } =
|
|
4088
|
+
}, nr = O((t) => {
|
|
4089
|
+
const { fieldsOnly: n } = t, { values: e, setFieldValue: i } = be(), [r, o] = ur(Xa, e.fields, Bn), { reorderSection: s, reorderField: l } = mn();
|
|
4067
4090
|
K(() => {
|
|
4068
|
-
o({ type: "update", state:
|
|
4091
|
+
o({ type: "update", state: Bn(e.fields) });
|
|
4069
4092
|
}, [o, e.fields]);
|
|
4070
4093
|
const f = N((u) => {
|
|
4071
4094
|
u.type === "SECTION" && o({ type: "hold", fieldId: u.draggableId });
|
|
@@ -4074,7 +4097,7 @@ const Vn = (t, n) => {
|
|
|
4074
4097
|
const { source: h, destination: g, type: b, reason: m, draggableId: v } = u;
|
|
4075
4098
|
if (o({ type: "release" }), !g || m === "CANCEL") return;
|
|
4076
4099
|
if (b === "ROOT") {
|
|
4077
|
-
|
|
4100
|
+
s(r, v, h.index, g.index, e, i);
|
|
4078
4101
|
return;
|
|
4079
4102
|
}
|
|
4080
4103
|
if (b !== "SECTION") throw new Error("Unexpected droppable type.");
|
|
@@ -4089,23 +4112,23 @@ const Vn = (t, n) => {
|
|
|
4089
4112
|
i
|
|
4090
4113
|
);
|
|
4091
4114
|
},
|
|
4092
|
-
[e, l, i,
|
|
4115
|
+
[e, l, i, s, r]
|
|
4093
4116
|
), d = N(
|
|
4094
4117
|
(u) => {
|
|
4095
|
-
|
|
4118
|
+
Sa(u + 1, e, i);
|
|
4096
4119
|
},
|
|
4097
4120
|
[e, i]
|
|
4098
4121
|
);
|
|
4099
|
-
return /* @__PURE__ */
|
|
4122
|
+
return /* @__PURE__ */ a(Xn, { onDragStart: f, onDragEnd: c, children: /* @__PURE__ */ a(Zt, { droppableId: "droppable", type: "ROOT", children: (u) => /* @__PURE__ */ y(
|
|
4100
4123
|
"div",
|
|
4101
4124
|
{
|
|
4102
4125
|
className: "flex flex-col gap-0",
|
|
4103
4126
|
ref: u.innerRef,
|
|
4104
4127
|
...u.droppableProps,
|
|
4105
4128
|
children: [
|
|
4106
|
-
e.fields.map((h, g) => /* @__PURE__ */ y(
|
|
4107
|
-
/* @__PURE__ */
|
|
4108
|
-
|
|
4129
|
+
e.fields.map((h, g) => /* @__PURE__ */ y(fr, { children: [
|
|
4130
|
+
/* @__PURE__ */ a(
|
|
4131
|
+
tr,
|
|
4109
4132
|
{
|
|
4110
4133
|
field: h,
|
|
4111
4134
|
index: g,
|
|
@@ -4124,7 +4147,7 @@ const Vn = (t, n) => {
|
|
|
4124
4147
|
d(g);
|
|
4125
4148
|
},
|
|
4126
4149
|
children: [
|
|
4127
|
-
/* @__PURE__ */
|
|
4150
|
+
/* @__PURE__ */ a(T, { icon: "RiAddLine" }),
|
|
4128
4151
|
" Add section"
|
|
4129
4152
|
]
|
|
4130
4153
|
}
|
|
@@ -4141,7 +4164,7 @@ const Vn = (t, n) => {
|
|
|
4141
4164
|
d(e.fields.length);
|
|
4142
4165
|
},
|
|
4143
4166
|
children: [
|
|
4144
|
-
/* @__PURE__ */
|
|
4167
|
+
/* @__PURE__ */ a(T, { icon: "RiAddLine" }),
|
|
4145
4168
|
" Add section"
|
|
4146
4169
|
]
|
|
4147
4170
|
}
|
|
@@ -4151,39 +4174,39 @@ const Vn = (t, n) => {
|
|
|
4151
4174
|
}
|
|
4152
4175
|
) }) });
|
|
4153
4176
|
});
|
|
4154
|
-
|
|
4155
|
-
const
|
|
4177
|
+
nr.displayName = "FieldsEditor";
|
|
4178
|
+
const Ya = () => {
|
|
4156
4179
|
alert("This is a form preview, your data will not be saved.");
|
|
4157
|
-
},
|
|
4180
|
+
}, ws = O(
|
|
4158
4181
|
qe((t, n) => {
|
|
4159
4182
|
const {
|
|
4160
4183
|
onCancel: e,
|
|
4161
4184
|
onSave: i,
|
|
4162
4185
|
revision: r,
|
|
4163
4186
|
initialTitle: o,
|
|
4164
|
-
showExplainerText:
|
|
4187
|
+
showExplainerText: s = !0,
|
|
4165
4188
|
showFormTitle: l = !0,
|
|
4166
4189
|
fieldsOnly: f = !1,
|
|
4167
4190
|
showTabs: c = !0,
|
|
4168
4191
|
tabsListClassName: d,
|
|
4169
4192
|
hydrateRevisionWithImages: u
|
|
4170
|
-
} = t, { showError: h } =
|
|
4193
|
+
} = t, { showError: h } = Gt(), g = N(
|
|
4171
4194
|
(E) => {
|
|
4172
4195
|
const S = {};
|
|
4173
4196
|
E.title || (S.title = "Title is required."), (!E.fields || E.fields.length === 0) && (S.fields = "At least one field is required.");
|
|
4174
4197
|
let C = [];
|
|
4175
4198
|
for (const [L, R] of E.fields.entries()) {
|
|
4176
|
-
const
|
|
4177
|
-
|
|
4199
|
+
const V = Wt.section.getFieldCreationSchema(
|
|
4200
|
+
zi(E.fields, L),
|
|
4178
4201
|
`fields.${L}`
|
|
4179
|
-
).map((
|
|
4180
|
-
C = [...C, ...
|
|
4181
|
-
for (const [
|
|
4182
|
-
const
|
|
4183
|
-
C = [...C, ...
|
|
4202
|
+
).map((_) => _.field);
|
|
4203
|
+
C = [...C, ...V];
|
|
4204
|
+
for (const [_, P] of R.fields.entries()) {
|
|
4205
|
+
const z = Wt[P.type].getFieldCreationSchema(`fields.${L}.fields.${_}`).map((Z) => Z.field);
|
|
4206
|
+
C = [...C, ...z];
|
|
4184
4207
|
}
|
|
4185
4208
|
}
|
|
4186
|
-
const I =
|
|
4209
|
+
const I = gn(
|
|
4187
4210
|
{
|
|
4188
4211
|
fields: C
|
|
4189
4212
|
},
|
|
@@ -4200,57 +4223,57 @@ const Ka = () => {
|
|
|
4200
4223
|
() => ({
|
|
4201
4224
|
title: o ?? "",
|
|
4202
4225
|
description: "",
|
|
4203
|
-
fields: [{ ...
|
|
4226
|
+
fields: [{ ...ut(fn(null, "")), label: "" }]
|
|
4204
4227
|
}),
|
|
4205
4228
|
[o]
|
|
4206
|
-
), m = r ? u(r) : void 0, v =
|
|
4207
|
-
initialValues:
|
|
4229
|
+
), m = r ? u(r) : void 0, v = Yt({
|
|
4230
|
+
initialValues: Ia(m) ?? b,
|
|
4208
4231
|
validate: g,
|
|
4209
4232
|
onSubmit: i,
|
|
4210
4233
|
validateOnChange: !1,
|
|
4211
4234
|
validateOnBlur: !1
|
|
4212
|
-
}), x = A(() =>
|
|
4213
|
-
return /* @__PURE__ */
|
|
4235
|
+
}), x = A(() => ja(v.values), [v.values]);
|
|
4236
|
+
return /* @__PURE__ */ a(Ie.Root, { ref: n, defaultValue: "edit", children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
|
|
4214
4237
|
c && /* @__PURE__ */ y(
|
|
4215
|
-
|
|
4238
|
+
Ie.List,
|
|
4216
4239
|
{
|
|
4217
|
-
className:
|
|
4240
|
+
className: Ve("sticky top-0 z-[2000] flex bg-(--color-background)", d),
|
|
4218
4241
|
children: [
|
|
4219
|
-
/* @__PURE__ */
|
|
4220
|
-
/* @__PURE__ */
|
|
4242
|
+
/* @__PURE__ */ a(Ie.Trigger, { className: "grow", value: "edit", children: /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
|
|
4243
|
+
/* @__PURE__ */ a(T, { icon: "RiPencilLine" }),
|
|
4221
4244
|
"Edit form"
|
|
4222
4245
|
] }) }),
|
|
4223
|
-
/* @__PURE__ */
|
|
4224
|
-
/* @__PURE__ */
|
|
4246
|
+
/* @__PURE__ */ a(Ie.Trigger, { className: "grow", value: "preview", children: /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
|
|
4247
|
+
/* @__PURE__ */ a(T, { icon: "RiEyeLine" }),
|
|
4225
4248
|
"Preview form"
|
|
4226
4249
|
] }) })
|
|
4227
4250
|
]
|
|
4228
4251
|
}
|
|
4229
4252
|
),
|
|
4230
|
-
/* @__PURE__ */ y(
|
|
4231
|
-
|
|
4253
|
+
/* @__PURE__ */ y(Ie.Content, { value: "edit", children: [
|
|
4254
|
+
s && /* @__PURE__ */ y(ye, { children: [
|
|
4232
4255
|
"Create your form using various field types. Sections can be",
|
|
4233
4256
|
" ",
|
|
4234
|
-
/* @__PURE__ */
|
|
4257
|
+
/* @__PURE__ */ a("strong", { children: "conditionally rendered" }),
|
|
4235
4258
|
" based on",
|
|
4236
4259
|
" ",
|
|
4237
|
-
/* @__PURE__ */
|
|
4260
|
+
/* @__PURE__ */ a("strong", { children: "answers to fields in preceding sections. " })
|
|
4238
4261
|
] }),
|
|
4239
4262
|
/* @__PURE__ */ y("form", { className: "mt-3 flex flex-col gap-2", id: rt, onSubmit: v.handleSubmit, children: [
|
|
4240
|
-
/* @__PURE__ */ y(
|
|
4263
|
+
/* @__PURE__ */ y(Qt, { value: v, children: [
|
|
4241
4264
|
l && /* @__PURE__ */ y(he, { children: [
|
|
4242
|
-
/* @__PURE__ */
|
|
4243
|
-
|
|
4265
|
+
/* @__PURE__ */ a(
|
|
4266
|
+
Be,
|
|
4244
4267
|
{
|
|
4245
4268
|
name: "title",
|
|
4246
|
-
render: ({ setValue: E, value: S, meta: C }) => /* @__PURE__ */
|
|
4247
|
-
|
|
4269
|
+
render: ({ setValue: E, value: S, meta: C }) => /* @__PURE__ */ a(Fi, { severity: "danger", helpText: C.error ?? null, children: /* @__PURE__ */ a(
|
|
4270
|
+
de.Root,
|
|
4248
4271
|
{
|
|
4249
4272
|
variant: "outline",
|
|
4250
|
-
size: "
|
|
4251
|
-
accentColor: C.error ?
|
|
4252
|
-
children: /* @__PURE__ */
|
|
4253
|
-
|
|
4273
|
+
size: "md",
|
|
4274
|
+
accentColor: C.error ? ue.danger : "primary",
|
|
4275
|
+
children: /* @__PURE__ */ a(
|
|
4276
|
+
de.Field,
|
|
4254
4277
|
{
|
|
4255
4278
|
placeholder: "Form title",
|
|
4256
4279
|
value: S,
|
|
@@ -4264,12 +4287,12 @@ const Ka = () => {
|
|
|
4264
4287
|
) })
|
|
4265
4288
|
}
|
|
4266
4289
|
),
|
|
4267
|
-
/* @__PURE__ */
|
|
4268
|
-
|
|
4290
|
+
/* @__PURE__ */ a(
|
|
4291
|
+
Be,
|
|
4269
4292
|
{
|
|
4270
4293
|
name: "description",
|
|
4271
|
-
render: ({ setValue: E, value: S }) => /* @__PURE__ */
|
|
4272
|
-
|
|
4294
|
+
render: ({ setValue: E, value: S }) => /* @__PURE__ */ a(
|
|
4295
|
+
Un,
|
|
4273
4296
|
{
|
|
4274
4297
|
className: "field-sizing-content",
|
|
4275
4298
|
placeholder: "Explain the purpose of this form",
|
|
@@ -4278,97 +4301,98 @@ const Ka = () => {
|
|
|
4278
4301
|
E(C.target.value);
|
|
4279
4302
|
},
|
|
4280
4303
|
resize: "vertical",
|
|
4281
|
-
maxLength: 1e3
|
|
4304
|
+
maxLength: 1e3,
|
|
4305
|
+
size: "md"
|
|
4282
4306
|
}
|
|
4283
4307
|
)
|
|
4284
4308
|
}
|
|
4285
4309
|
)
|
|
4286
4310
|
] }),
|
|
4287
|
-
/* @__PURE__ */
|
|
4288
|
-
/* @__PURE__ */
|
|
4311
|
+
/* @__PURE__ */ a(nr, { fieldsOnly: f }),
|
|
4312
|
+
/* @__PURE__ */ a(
|
|
4289
4313
|
"span",
|
|
4290
4314
|
{
|
|
4291
|
-
"data-accent-color":
|
|
4315
|
+
"data-accent-color": ue.danger,
|
|
4292
4316
|
className: "text-xs text-(--accent-a11)",
|
|
4293
4317
|
children: typeof v.errors.fields == "string" && v.errors.fields
|
|
4294
4318
|
}
|
|
4295
4319
|
)
|
|
4296
4320
|
] }),
|
|
4297
4321
|
/* @__PURE__ */ y("div", { className: "flex items-center justify-end gap-2", children: [
|
|
4298
|
-
e && /* @__PURE__ */
|
|
4299
|
-
/* @__PURE__ */
|
|
4322
|
+
e && /* @__PURE__ */ a(X, { type: "button", variant: "solid", accentColor: "base", onClick: e, children: "Cancel" }),
|
|
4323
|
+
/* @__PURE__ */ a(X, { type: "submit", children: "Save form" })
|
|
4300
4324
|
] })
|
|
4301
4325
|
] })
|
|
4302
4326
|
] }),
|
|
4303
|
-
/* @__PURE__ */
|
|
4327
|
+
/* @__PURE__ */ a(Ie.Content, { value: "preview", children: /* @__PURE__ */ a(Ha, { schema: x, onSubmit: Ya, hideTitle: !l }) })
|
|
4304
4328
|
] }) });
|
|
4305
4329
|
})
|
|
4306
|
-
),
|
|
4307
|
-
async function
|
|
4308
|
-
const r = t.getContext("2d", {}), o = new Image(i.width, i.height),
|
|
4330
|
+
), Qa = Object.values(Hn), Ja = 1;
|
|
4331
|
+
async function Za(t, n, e, i) {
|
|
4332
|
+
const r = t.getContext("2d", {}), o = new Image(i.width, i.height), s = new Image(i.width, i.height), l = new hr();
|
|
4309
4333
|
return o.onload = function() {
|
|
4310
|
-
r.drawImage(o, 0, 0, i.width, i.height),
|
|
4311
|
-
r.drawImage(
|
|
4312
|
-
const f = t.toDataURL("image/jpeg",
|
|
4334
|
+
r.drawImage(o, 0, 0, i.width, i.height), s.src = URL.createObjectURL(e), s.onload = async function() {
|
|
4335
|
+
r.drawImage(s, 0, 0, i.width, i.height);
|
|
4336
|
+
const f = t.toDataURL("image/jpeg", Ja), c = await Gn(f), d = new File([c], n.name, { type: "image/jpeg" });
|
|
4313
4337
|
l.resolve(d);
|
|
4314
4338
|
};
|
|
4315
4339
|
}, o.src = URL.createObjectURL(n), l;
|
|
4316
4340
|
}
|
|
4317
|
-
const
|
|
4318
|
-
const { file: n, onClose: e, onSave: i, onDelete: r, dirty: o, onDirty:
|
|
4341
|
+
const es = O((t) => {
|
|
4342
|
+
const { file: n, onClose: e, onSave: i, onDelete: r, dirty: o, onDirty: s } = t;
|
|
4319
4343
|
n.objectURL || (n.objectURL = URL.createObjectURL(n));
|
|
4320
|
-
const l = ne(null), f = ne(null), [c, d] = H(
|
|
4344
|
+
const l = ne(null), f = ne(null), [c, d] = H(Hn.red), [u, h] = H(null), [g, b] = H(!1), [m, v] = H(!1), x = ne(null), E = jn(x);
|
|
4321
4345
|
K(() => {
|
|
4322
|
-
const
|
|
4323
|
-
|
|
4324
|
-
h({ width:
|
|
4325
|
-
},
|
|
4346
|
+
const z = new Image();
|
|
4347
|
+
z.onload = function() {
|
|
4348
|
+
h({ width: z.naturalWidth, height: z.naturalHeight });
|
|
4349
|
+
}, z.src = URL.createObjectURL(n);
|
|
4326
4350
|
}, [n]), K(() => {
|
|
4327
4351
|
!m && (E != null && E.width) && E.height && v(!0);
|
|
4328
4352
|
}, [E, m]);
|
|
4329
4353
|
const S = N(async () => {
|
|
4330
4354
|
o || e();
|
|
4331
|
-
const
|
|
4332
|
-
if (!
|
|
4355
|
+
const z = l.current;
|
|
4356
|
+
if (!z) return;
|
|
4333
4357
|
if (!u)
|
|
4334
4358
|
throw new Error("Original image size not loaded yet");
|
|
4335
|
-
const Z = await
|
|
4336
|
-
|
|
4337
|
-
const je = await
|
|
4338
|
-
|
|
4339
|
-
const He = await
|
|
4340
|
-
await
|
|
4341
|
-
}, b(!0),
|
|
4359
|
+
const Z = await z.exportImage("png"), Ce = new Image(u.width, u.height);
|
|
4360
|
+
Ce.onload = async function() {
|
|
4361
|
+
const je = await Gn(Z), Et = new File([je], n.name, { type: n.type }), se = f.current, xe = await Za(se, n, Et, u);
|
|
4362
|
+
xe.objectURL = URL.createObjectURL(xe);
|
|
4363
|
+
const He = await En(n);
|
|
4364
|
+
await En(xe) !== He && i(xe), b(!1), e();
|
|
4365
|
+
}, b(!0), Ce.src = Z;
|
|
4342
4366
|
}, [o, n, e, i, u]), C = N(() => {
|
|
4343
4367
|
r(n);
|
|
4344
4368
|
}, [n, r]), I = N(() => {
|
|
4345
4369
|
e();
|
|
4346
4370
|
}, [e]), L = N(() => {
|
|
4347
|
-
|
|
4348
|
-
}, [
|
|
4371
|
+
s(!0);
|
|
4372
|
+
}, [s]), R = N(() => {
|
|
4349
4373
|
l.current && l.current.redo();
|
|
4350
4374
|
}, []), F = N(() => {
|
|
4351
4375
|
l.current && l.current.undo();
|
|
4352
|
-
}, []),
|
|
4353
|
-
l.current && (
|
|
4354
|
-
}, [
|
|
4355
|
-
l.current && l.current.eraseMode(
|
|
4376
|
+
}, []), V = N(() => {
|
|
4377
|
+
l.current && (s(!1), l.current.clearCanvas());
|
|
4378
|
+
}, [s]), _ = N((z) => {
|
|
4379
|
+
l.current && l.current.eraseMode(z);
|
|
4356
4380
|
}, []), P = N(() => {
|
|
4357
4381
|
S();
|
|
4358
4382
|
}, [S]), $ = N(() => {
|
|
4359
|
-
|
|
4383
|
+
qn(n);
|
|
4360
4384
|
}, [n]);
|
|
4361
|
-
return /* @__PURE__ */
|
|
4362
|
-
/* @__PURE__ */
|
|
4363
|
-
|
|
4385
|
+
return /* @__PURE__ */ a(ln, { open: !0, onOpenChange: e, children: /* @__PURE__ */ y(cn, { children: [
|
|
4386
|
+
/* @__PURE__ */ a(
|
|
4387
|
+
dn,
|
|
4364
4388
|
{
|
|
4365
4389
|
className: "bg-(--color-background) fixed inset-0 data-[state='open']:fade-in-0 data-[state='open']:zoom-in-95 data-[state='closed']:animate-out data-[state='closed']:fade-out-0 data-[state='closed']:zoom-out-95 data-[state='open']:animate-in",
|
|
4366
4390
|
"data-floating-content": ""
|
|
4367
4391
|
}
|
|
4368
4392
|
),
|
|
4369
|
-
/* @__PURE__ */ y(
|
|
4370
|
-
/* @__PURE__ */
|
|
4371
|
-
|
|
4393
|
+
/* @__PURE__ */ y(un, { className: "absolute inset-0 py-12", "data-floating-content": "", children: [
|
|
4394
|
+
/* @__PURE__ */ a(
|
|
4395
|
+
bt,
|
|
4372
4396
|
{
|
|
4373
4397
|
className: "flex w-full gap-2 items-center top-0 absolute right-0 p-2",
|
|
4374
4398
|
accentColor: "base",
|
|
@@ -4376,18 +4400,18 @@ const Za = O((t) => {
|
|
|
4376
4400
|
variant: "soft",
|
|
4377
4401
|
children: /* @__PURE__ */ y("div", { className: "grid w-full grid-cols-3", children: [
|
|
4378
4402
|
/* @__PURE__ */ y("div", { className: "flex gap-2", children: [
|
|
4379
|
-
/* @__PURE__ */
|
|
4380
|
-
/* @__PURE__ */
|
|
4403
|
+
/* @__PURE__ */ a(B, { "aria-label": "close", onClick: I, children: /* @__PURE__ */ a(T, { icon: "RiCloseLine" }) }),
|
|
4404
|
+
/* @__PURE__ */ a(B, { "aria-label": `Download ${n.name}`, onClick: $, children: /* @__PURE__ */ a(T, { icon: "RiDownload2Line" }) })
|
|
4381
4405
|
] }),
|
|
4382
4406
|
/* @__PURE__ */ y("div", { className: "flex items-center justify-center gap-2", children: [
|
|
4383
|
-
/* @__PURE__ */
|
|
4384
|
-
|
|
4407
|
+
/* @__PURE__ */ a(
|
|
4408
|
+
Kn,
|
|
4385
4409
|
{
|
|
4386
4410
|
selectedColor: c,
|
|
4387
|
-
allColors:
|
|
4411
|
+
allColors: Qa,
|
|
4388
4412
|
onFinish: d,
|
|
4389
|
-
trigger: /* @__PURE__ */
|
|
4390
|
-
|
|
4413
|
+
trigger: /* @__PURE__ */ a(
|
|
4414
|
+
B,
|
|
4391
4415
|
{
|
|
4392
4416
|
"aria-label": "Markup color picker",
|
|
4393
4417
|
type: "button",
|
|
@@ -4400,28 +4424,28 @@ const Za = O((t) => {
|
|
|
4400
4424
|
)
|
|
4401
4425
|
}
|
|
4402
4426
|
),
|
|
4403
|
-
/* @__PURE__ */
|
|
4404
|
-
|
|
4427
|
+
/* @__PURE__ */ a(
|
|
4428
|
+
sr,
|
|
4405
4429
|
{
|
|
4406
4430
|
defaultPressed: !1,
|
|
4407
4431
|
"aria-label": "erase",
|
|
4408
|
-
onPressedChange:
|
|
4409
|
-
children: /* @__PURE__ */
|
|
4432
|
+
onPressedChange: _,
|
|
4433
|
+
children: /* @__PURE__ */ a(T, { icon: "RiEraserFill" })
|
|
4410
4434
|
}
|
|
4411
4435
|
),
|
|
4412
|
-
/* @__PURE__ */
|
|
4413
|
-
/* @__PURE__ */
|
|
4414
|
-
/* @__PURE__ */
|
|
4415
|
-
/* @__PURE__ */
|
|
4436
|
+
/* @__PURE__ */ a(Ht, { orientation: "vertical", size: "full" }),
|
|
4437
|
+
/* @__PURE__ */ a(B, { "aria-label": "undo", onClick: F, children: /* @__PURE__ */ a(T, { icon: "RiArrowGoBackLine" }) }),
|
|
4438
|
+
/* @__PURE__ */ a(B, { "aria-label": "undo", onClick: R, children: /* @__PURE__ */ a(T, { icon: "RiArrowGoForwardLine" }) }),
|
|
4439
|
+
/* @__PURE__ */ a(B, { "aria-label": "undo all", onClick: V, children: /* @__PURE__ */ a(T, { icon: "RiLoopLeftLine" }) })
|
|
4416
4440
|
] }),
|
|
4417
4441
|
/* @__PURE__ */ y("div", { className: "flex justify-end gap-2", children: [
|
|
4418
|
-
/* @__PURE__ */
|
|
4419
|
-
/* @__PURE__ */
|
|
4442
|
+
/* @__PURE__ */ a(B, { "aria-label": "Save markup", accentColor: "primary", onClick: P, children: /* @__PURE__ */ a(T, { icon: "RiSaveLine" }) }),
|
|
4443
|
+
/* @__PURE__ */ a(B, { "aria-label": "Delete attachment", onClick: C, children: /* @__PURE__ */ a(T, { icon: "RiDeleteBin2Line" }) })
|
|
4420
4444
|
] })
|
|
4421
4445
|
] })
|
|
4422
4446
|
}
|
|
4423
4447
|
),
|
|
4424
|
-
u && /* @__PURE__ */
|
|
4448
|
+
u && /* @__PURE__ */ a(
|
|
4425
4449
|
"canvas",
|
|
4426
4450
|
{
|
|
4427
4451
|
id: "attachment-markup-canvas",
|
|
@@ -4432,7 +4456,7 @@ const Za = O((t) => {
|
|
|
4432
4456
|
}
|
|
4433
4457
|
),
|
|
4434
4458
|
/* @__PURE__ */ y("div", { className: "relative size-full flex items-center justify-center p-4 overflow-hidden", children: [
|
|
4435
|
-
/* @__PURE__ */
|
|
4459
|
+
/* @__PURE__ */ a(
|
|
4436
4460
|
"img",
|
|
4437
4461
|
{
|
|
4438
4462
|
className: "max-w-full max-h-full invisible absolute",
|
|
@@ -4441,8 +4465,8 @@ const Za = O((t) => {
|
|
|
4441
4465
|
src: n.objectURL
|
|
4442
4466
|
}
|
|
4443
4467
|
),
|
|
4444
|
-
g ? /* @__PURE__ */
|
|
4445
|
-
|
|
4468
|
+
g ? /* @__PURE__ */ a(yt, {}) : /* @__PURE__ */ a(
|
|
4469
|
+
Pr,
|
|
4446
4470
|
{
|
|
4447
4471
|
className: "max-w-full max-h-full aspect-square",
|
|
4448
4472
|
backgroundImage: n.objectURL,
|
|
@@ -4456,70 +4480,70 @@ const Za = O((t) => {
|
|
|
4456
4480
|
] })
|
|
4457
4481
|
] }) });
|
|
4458
4482
|
});
|
|
4459
|
-
|
|
4483
|
+
es.displayName = "AttachmentEditor";
|
|
4460
4484
|
export {
|
|
4461
4485
|
G as BaseField,
|
|
4462
|
-
|
|
4486
|
+
Jn as BaseFormElement,
|
|
4463
4487
|
We as BooleanField,
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4488
|
+
Di as BooleanInput,
|
|
4489
|
+
Kn as ColorPicker,
|
|
4490
|
+
zt as DateField,
|
|
4491
|
+
Ai as DateInput,
|
|
4468
4492
|
q as FieldSection,
|
|
4469
4493
|
_r as FileBadge,
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4494
|
+
Qn as FileCard,
|
|
4495
|
+
wt as FileIcon,
|
|
4496
|
+
ws as FormBuilder,
|
|
4497
|
+
Ha as FormRenderer,
|
|
4498
|
+
za as ImageCard,
|
|
4499
|
+
es as ImageMarkup,
|
|
4500
|
+
Li as ImageViewer,
|
|
4501
|
+
ya as ImageViewerProvider,
|
|
4502
|
+
Fi as InputWithHelpText,
|
|
4479
4503
|
ie as InputWithLabel,
|
|
4480
4504
|
re as InputWithLabelAndHelpText,
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4505
|
+
pt as MultiSelectField,
|
|
4506
|
+
ji as MultiSelectInput,
|
|
4507
|
+
ht as MultiStringField,
|
|
4484
4508
|
_i as MultiStringInput,
|
|
4485
4509
|
ve as NumberField,
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4510
|
+
$i as NumberInput,
|
|
4511
|
+
Be as PatchField,
|
|
4512
|
+
bs as PatchFormProvider,
|
|
4513
|
+
$t as QrField,
|
|
4514
|
+
Bi as QrInput,
|
|
4491
4515
|
Vi as QrScanner,
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4516
|
+
kr as SUPPORTED_IMAGE_FILE_TYPES,
|
|
4517
|
+
zr as SUPPORTED_PDF_FILE_TYPES,
|
|
4518
|
+
Mr as SUPPORTED_SPREADSHEET_FILE_EXTENSIONS,
|
|
4519
|
+
gt as SelectField,
|
|
4520
|
+
Wi as SelectInput,
|
|
4521
|
+
Bt as StringField,
|
|
4522
|
+
qi as StringInput,
|
|
4523
|
+
Vt as TextField,
|
|
4524
|
+
Hi as TextInput,
|
|
4525
|
+
vs as decodeFormValues,
|
|
4526
|
+
pn as deserialize,
|
|
4527
|
+
Ki as deserializeField,
|
|
4504
4528
|
Q as emptyBaseField,
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4529
|
+
wa as emptyBooleanField,
|
|
4530
|
+
Ca as emptyDateField,
|
|
4531
|
+
Fa as emptyMultiSelectField,
|
|
4532
|
+
Ra as emptyMultiStringField,
|
|
4533
|
+
Na as emptyNumberField,
|
|
4534
|
+
Ta as emptyQrField,
|
|
4535
|
+
Da as emptySelectField,
|
|
4536
|
+
Aa as emptyStringField,
|
|
4537
|
+
Oa as emptyTextField,
|
|
4538
|
+
ys as encodeFormValues,
|
|
4539
|
+
Yi as flattenFields,
|
|
4540
|
+
ja as formRevisionToSchema,
|
|
4541
|
+
vn as initialFormValues,
|
|
4542
|
+
Qi as isConditionMet,
|
|
4543
|
+
Pi as useFieldInput,
|
|
4544
|
+
dt as useFieldInputs,
|
|
4521
4545
|
U as useFormikInput,
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4546
|
+
tn as useImageViewer,
|
|
4547
|
+
gn as validateForm,
|
|
4548
|
+
jt as valueIsFile
|
|
4525
4549
|
};
|