@levo-so/studio 0.1.107 → 0.1.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/{BillingStep-CJqmdIz2.js → BillingStep-DZeqbtfs.js} +1 -1
  2. package/{Button-DujHjtOV.js → Button-BMUB23Y7.js} +527 -91
  3. package/CollectionField-xa-jed3_.js +232 -0
  4. package/{DateTimeWidget-CbpvxQ9s.js → DateTimeWidget-DWbn_kXp.js} +4 -3
  5. package/{EntryCard-Drnobf4s.js → EntryCard-BNZ-0_Kv.js} +7 -4
  6. package/{LoginCard-B9HKjZEk.js → LoginCard-B1XlZfEU.js} +3 -3
  7. package/{LoginForm-DpgxFh89.js → LoginForm-NmDPe72V.js} +17 -17
  8. package/{LoginModal-CaqsScly.js → LoginModal-CVd08mNx.js} +2 -2
  9. package/{MessageCard-DojQRKnf.js → MessageCard-C2fU_Bo_.js} +2 -2
  10. package/{ModalManager-CaBZKQR2.js → ModalManager-Dqq7D60M.js} +1 -1
  11. package/{PendingApprovalCard-CrdOrMRu.js → PendingApprovalCard-CXOEpAbg.js} +3 -3
  12. package/{PhoneWidget-BxW2gL28.js → PhoneWidget-CtNIit2w.js} +4 -3
  13. package/{PopupRenderer-CV5HY1dP-hICGc5AG.js → PopupRenderer-SSn97BLs-DQfvcymq.js} +256 -260
  14. package/ProfileCard-CzL5uB2z.js +102 -0
  15. package/{RichTextWidget-DCzgJ9EA.js → RichTextWidget-DkRrKQqN.js} +4 -3
  16. package/{Toolbar-B5UZer_x.js → Toolbar-C3WDkSnO.js} +4 -4
  17. package/{VerifyButton-DFAg6STD.js → VerifyButton-TNkt-SDu.js} +1 -1
  18. package/{bookingCard-BgApvrcj.js → bookingCard-61Yx6JO-.js} +2 -2
  19. package/collection.d.ts +14 -6
  20. package/collection.js +8 -7
  21. package/dist-Cfv-YjpI.js +3469 -0
  22. package/getFieldValidations-CSkSV2hW.js +90 -0
  23. package/index.d.ts +235 -16
  24. package/index.js +1743 -1405
  25. package/{nodeAlignment-DKCIjzlR.js → nodeAlignment-BC_Uferw.js} +5 -5
  26. package/package.json +4 -4
  27. package/studio.css +1 -1
  28. package/{utils-CUqS5dMC.js → utils-BJLmuC5w.js} +1 -1
  29. package/widgets-K6ECnoJJ.js +335 -0
  30. package/CollectionField-BPl8E9MW.js +0 -318
  31. package/CollectionFormBuilder-BvFtiZeH.js +0 -3668
  32. package/dist-DZbXWctg.js +0 -97
  33. /package/{Beams-DboMUgCv.js → Beams-WJN38XSv.js} +0 -0
  34. /package/{CollectionInput-DcNJT5Pg.js → CollectionInput-CpNGIXJx.js} +0 -0
  35. /package/{Dots-a8xSboDv.js → Dots-DggLz5I7.js} +0 -0
  36. /package/{Gradient-NacpoDCM.js → Gradient-BSWJAu0a.js} +0 -0
  37. /package/{Grid-BJQvxnks.js → Grid-BFKl0MUt.js} +0 -0
  38. /package/{MessageFooter-C4qC8cem.js → MessageFooter-4qIEK91O.js} +0 -0
  39. /package/{Popover-DOvRAGzc.js → Popover-O1poOHk2.js} +0 -0
  40. /package/{Tooltip-CJINDx93.js → Tooltip-NEMQqPyr.js} +0 -0
  41. /package/{Waves-DUuT_IFr.js → Waves-BPEgTYoO.js} +0 -0
  42. /package/{authentication-ClOFcry8.js → authentication-hnV1BI8s.js} +0 -0
  43. /package/{card-E2LKF9nT.js → card-5ooLmYSr.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { E as e } from "./CollectionFormBuilder-BvFtiZeH.js";
1
+ import { v as e } from "./widgets-K6ECnoJJ.js";
2
2
  //#region ../../libraries/react-collection/dist/utils.js
3
3
  var t = (t) => Object.entries(e).find(([e, n]) => Object.keys(n).includes(t))?.[0];
4
4
  //#endregion
@@ -0,0 +1,335 @@
1
+ import e from "react";
2
+ import { FieldInterfaces as t, FieldInterfacesList as n, defaultByKinds as r, formatsByInterface as i, interfaceKinds as a, operatorsByKind as o } from "@levo-so/core";
3
+ import s from "dayjs";
4
+ import { Snowflake as c } from "@theinternetfolks/snowflake";
5
+ import { isPossiblePhoneNumber as l } from "react-phone-number-input";
6
+ import * as u from "yup";
7
+ //#region ../../libraries/react-collection/dist/constants/fileUploadPresets.js
8
+ var d = [
9
+ "pdf",
10
+ "xls",
11
+ "xlsx",
12
+ "doc",
13
+ "docx",
14
+ "csv"
15
+ ], f = [
16
+ "svg",
17
+ "png",
18
+ "jpg",
19
+ "jpeg",
20
+ "webp",
21
+ "gif",
22
+ "avif"
23
+ ], p = ["mpeg", "mp4"], m = [
24
+ "mp3",
25
+ "ogg",
26
+ "oga"
27
+ ], h = {
28
+ audio: {
29
+ "audio/mpeg": [".mp3"],
30
+ "audio/ogg": [".oga"]
31
+ },
32
+ document: {
33
+ "application/pdf": [".pdf"],
34
+ "application/msword": [".doc"],
35
+ "application/vnd.ms-excel": [".xls"],
36
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [".xlsx"],
37
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": [".docx"],
38
+ "text/csv": [".csv"]
39
+ },
40
+ image: {
41
+ "image/jpeg": [".jpeg", ".jpg"],
42
+ "image/png": [".png"],
43
+ "image/gif": [".gif"],
44
+ "image/svg+xml": [".svg"],
45
+ "image/webp": [".webp"],
46
+ "image/avif": [".avif"]
47
+ },
48
+ video: {
49
+ "video/mp4": [".mp4"],
50
+ "video/mpeg": [".mpeg"]
51
+ }
52
+ }, g = {
53
+ audio: m,
54
+ document: d,
55
+ image: f,
56
+ video: p
57
+ };
58
+ [
59
+ ...g.audio,
60
+ ...g.document,
61
+ ...g.image,
62
+ ...g.video
63
+ ], {
64
+ ...h.audio,
65
+ ...h.document,
66
+ ...h.image,
67
+ ...h.video
68
+ };
69
+ //#endregion
70
+ //#region ../../libraries/react-collection/dist/utils/logic.js
71
+ var _ = (e) => e.combinator !== void 0, v = (e) => e == null ? !0 : typeof e == "string" ? e === "" : Array.isArray(e) ? e.length === 0 : !1, y = (e, t) => {
72
+ if (t == null) return t;
73
+ if (e === "date") {
74
+ if (t instanceof Date || typeof t == "string" || typeof t == "number") {
75
+ let e = s(t);
76
+ if (e.isValid()) return e.valueOf();
77
+ }
78
+ return NaN;
79
+ }
80
+ if (e === "number") {
81
+ if (typeof t == "number") return t;
82
+ if (typeof t == "string" && t !== "") {
83
+ let e = Number(t);
84
+ if (!Number.isNaN(e)) return e;
85
+ }
86
+ return NaN;
87
+ }
88
+ return t;
89
+ }, b = (e, t) => e === "collection" && t && typeof t == "object" && !Array.isArray(t) && "_id" in t ? t._id : t, x = (e, t, n) => y(e, b(e, t)) === y(e, b(e, n)), S = (e, t) => e ? o[e]?.includes(t) ?? !1 : !1, C = (e, t) => {
90
+ if (_(e)) {
91
+ e.conditions.forEach((e) => {
92
+ C(e, t);
93
+ });
94
+ return;
95
+ }
96
+ t.add(e.source);
97
+ }, w = (e, t) => {
98
+ if (!t?.length) return {};
99
+ let n = /* @__PURE__ */ new Set();
100
+ for (let e of t) C(e.when, n);
101
+ let r = {};
102
+ for (let t of e.sections) for (let e of t.fields) n.has(e.key) && (r[e.key] = e.kind);
103
+ return r;
104
+ }, T = (e, t) => _(e) ? e.conditions.some((e) => T(e, t)) : t[e.source] === void 0, E = (e, t) => {
105
+ if (_(e)) {
106
+ for (let n of e.conditions) {
107
+ let e = E(n, t);
108
+ if (e) return e;
109
+ }
110
+ return null;
111
+ }
112
+ return S(t[e.source], e.operator) ? null : e;
113
+ }, D = (e, t, n) => {
114
+ let r = n[e.source], i = t[e.source];
115
+ switch (e.operator) {
116
+ case "is_empty": return v(i);
117
+ case "is_not_empty": return !v(i);
118
+ case "equals": return x(r, i, e.value);
119
+ case "not": return !x(r, i, e.value);
120
+ case "gt":
121
+ case "gte":
122
+ case "lt":
123
+ case "lte": {
124
+ let t = y(r, i), n = y(r, e.value);
125
+ if (typeof t != "number" || typeof n != "number" || Number.isNaN(t) || Number.isNaN(n)) return !1;
126
+ switch (e.operator) {
127
+ case "gt": return t > n;
128
+ case "gte": return t >= n;
129
+ case "lt": return t < n;
130
+ case "lte": return t <= n;
131
+ default: return !1;
132
+ }
133
+ }
134
+ case "contains":
135
+ case "not_contains":
136
+ if (r === "array-string" || r === "array-number" || r === "collection") {
137
+ if (!Array.isArray(i)) return e.operator === "not_contains";
138
+ let t = i.some((t) => x(r, t, e.value));
139
+ return e.operator === "contains" ? t : !t;
140
+ }
141
+ if (typeof i == "string" && typeof e.value == "string") {
142
+ let t = i.includes(e.value);
143
+ return e.operator === "contains" ? t : !t;
144
+ }
145
+ return e.operator === "not_contains";
146
+ case "starts_with":
147
+ case "not_starts_with":
148
+ case "ends_with":
149
+ case "not_ends_with":
150
+ if (typeof i != "string" || typeof e.value != "string") return !1;
151
+ switch (e.operator) {
152
+ case "starts_with": return i.startsWith(e.value);
153
+ case "not_starts_with": return !i.startsWith(e.value);
154
+ case "ends_with": return i.endsWith(e.value);
155
+ case "not_ends_with": return !i.endsWith(e.value);
156
+ default: return !1;
157
+ }
158
+ }
159
+ }, O = (e, t, n) => _(e) ? e.conditions.length === 0 ? !1 : e.combinator === "AND" ? e.conditions.every((e) => O(e, t, n)) : e.conditions.some((e) => O(e, t, n)) : D(e, t, n), k = ({ logic: e, formValues: t, sourceKinds: n }) => {
160
+ if (!e?.length) return { visible: !0 };
161
+ let r = !e.some((e) => e.action === "show");
162
+ for (let { action: r, when: i } of e) if (r && !T(i, n) && !E(i, n) && O(i, t, n)) return { visible: r === "show" };
163
+ return { visible: r };
164
+ }, A = (e, t, n) => {
165
+ if (t.hidden) return !0;
166
+ if (!t.logic?.length || !e) return !1;
167
+ let r = w(e, t.logic);
168
+ return !k({
169
+ logic: t.logic,
170
+ formValues: n,
171
+ sourceKinds: r
172
+ }).visible;
173
+ }, j = (e, t) => e?.sections?.[0]?.id === t.id, M = (e, t, n) => {
174
+ if (j(e, t) || !t.logic?.length || !e) return !0;
175
+ let r = w(e, t.logic);
176
+ return k({
177
+ logic: t.logic,
178
+ formValues: n,
179
+ sourceKinds: r
180
+ }).visible;
181
+ }, N = (e) => {
182
+ let t = [];
183
+ for (let n of Object.keys(e)) for (let r of e?.[n] || []) t.push({
184
+ message: r,
185
+ name: n
186
+ });
187
+ return t;
188
+ }, P = (e) => e ? l(e) : !1, F = (e, t) => {
189
+ let n = [];
190
+ for (let [r, i] of Object.entries(t)) {
191
+ let t = e?.[r], a = u.string();
192
+ for (let e of i) if (typeof e == "string") switch (e) {
193
+ case "required":
194
+ a = a.required(`The ${r} field is required`);
195
+ break;
196
+ case "email":
197
+ a = a.email("The email address is not valid");
198
+ break;
199
+ case "phone_number":
200
+ a = a.test("phone", "The phone number has incorrect format", (e) => e ? P(e) : !0);
201
+ break;
202
+ case "url":
203
+ a = a.url("The URL is not valid");
204
+ break;
205
+ case "data_uri":
206
+ a = a.test("data_uri", "The field does not have a valid file", (e) => typeof e == "string" ? e.startsWith("data:") && e.includes(",") : !1);
207
+ break;
208
+ }
209
+ else if (typeof e == "object" && e) {
210
+ let t = e;
211
+ "max" in e && t.max?.[0] && (a = a.max(Number(t.max[0]))), "min" in e && t.min?.[0] && (a = a.min(Number(t.min[0])));
212
+ }
213
+ try {
214
+ a.validateSync(t);
215
+ } catch (e) {
216
+ e instanceof u.ValidationError && n.push({
217
+ message: e.message,
218
+ name: r
219
+ });
220
+ }
221
+ }
222
+ return n.length > 0 ? {
223
+ status: !1,
224
+ errors: n
225
+ } : { status: !0 };
226
+ }, I = (e, n) => {
227
+ let r = {};
228
+ for (let n of e.sections) for (let e of n.fields) {
229
+ let n = [];
230
+ switch (e.required && n.push("required"), e.max !== void 0 && e.max !== null && n.push({ max: [e.max] }), e.min !== void 0 && e.min !== null && n.push({ min: [e.min] }), e.field_interface) {
231
+ case t.EmailWidget:
232
+ n.push("email");
233
+ break;
234
+ case t.PhoneWidget:
235
+ n.push("phone_number");
236
+ break;
237
+ case t.URLWidget:
238
+ n.push("url");
239
+ break;
240
+ default: break;
241
+ }
242
+ r[e.key] = n;
243
+ }
244
+ let { errors: i } = F(n, r), a = {};
245
+ return i && i.map((e) => {
246
+ a[e.name] = e.message;
247
+ }), a;
248
+ }, L = (e) => {
249
+ let n = {};
250
+ for (let i of e) {
251
+ if (i.kind === "collection") {
252
+ let e = i.options?.current_have_many_connected, t = i.options?.connected_have_many_current;
253
+ e && t ? n[i.key] = r.collection.m2m : n[i.key] = r.collection.m2o;
254
+ } else n[i.key] = r?.[i?.kind];
255
+ i?.field_interface === t.RecordWidget && i?.fields?.length && (n[i.key] = L(i.fields));
256
+ }
257
+ return n;
258
+ }, R = (e) => {
259
+ if (!e?.sections) return {};
260
+ let t = {};
261
+ for (let n of e.sections) n?.fields && n?.fields?.length > 0 && (t = {
262
+ ...t,
263
+ ...L(n.fields)
264
+ });
265
+ return t;
266
+ }, z = (e) => e === void 0 ? null : e, B = (e, t) => {
267
+ if (!e?.sections) return {};
268
+ let n = {};
269
+ for (let r of e.sections) {
270
+ let e = L(r.fields ?? []);
271
+ for (let i of r.fields) {
272
+ let r = z(t?.[i?.key]);
273
+ Array.isArray(r) && r?.length > 0 && Array.isArray(i?.values) && i?.values?.length > 0 && !i?.options?.custom_input && (r = r?.filter((e) => i?.values?.includes(e))), n[i.key] = r ?? z(i?.default_value) ?? e[i.key];
274
+ }
275
+ }
276
+ return n;
277
+ }, V = (e, o) => {
278
+ let s = { ...e }, l = null;
279
+ if ((s.field_interface === t.ArrayWidget && o !== t.ArrayWidget || s.field_interface === t.RecordWidget && o !== t.RecordWidget) && (s.fields = []), (o !== t.MultiDropdownWidget || o !== t.DropdownWidget || o !== t.RadioWidget || o !== t.CheckboxWidget) && s.field_interface !== t.MultiDropdownWidget && s.field_interface !== t.DropdownWidget && s.field_interface !== t.RadioWidget && s.field_interface !== t.CheckboxWidget && s.values?.length !== 0 && (s.values = []), (o === t.MultiDropdownWidget && s.field_interface !== t.MultiDropdownWidget || o === t.DropdownWidget && s.field_interface !== t.DropdownWidget || o === t.RadioWidget && s.field_interface !== t.RadioWidget || o === t.CheckboxWidget && s.field_interface !== t.CheckboxWidget) && (s.values = [""], l = `${s.id}-option-0`), [t.RecordWidget, t.ArrayWidget].includes(o) && (l = `field-${c.generate()}`, s.kind = o === t.RecordWidget ? "record" : "group", s.fields = [...s?.fields || [], {
280
+ id: l,
281
+ key: "title",
282
+ label: "Title",
283
+ helper_text: "",
284
+ kind: "string",
285
+ field_interface: t.TextWidget,
286
+ default_value: "",
287
+ options: {},
288
+ fields: [],
289
+ hidden: !1,
290
+ readonly: !1,
291
+ required: !1,
292
+ unique: !1,
293
+ min: null,
294
+ max: null,
295
+ formats: i[o] || [],
296
+ values: [],
297
+ editable: !0
298
+ }]), s.kind = a[o] || "string", !s.default_value) if (s.kind === "collection") {
299
+ let e = s.options?.current_have_many_connected, t = s.options?.connected_have_many_current;
300
+ e && t ? s.default_value = r.collection.m2m : s.default_value = r.collection.m2o;
301
+ } else s.default_value = r[s.kind] || null;
302
+ return o !== t.CollectionWidget && n.includes(o) && (s.field_interface = o), {
303
+ field: s,
304
+ fieldFocused: l
305
+ };
306
+ }, H = (e, t, n) => {
307
+ let r = {}, i = n !== void 0;
308
+ if (t) for (let a of t?.sections ?? []) {
309
+ let o = i ? !M(t, a, e) : !1;
310
+ for (let s of a?.fields) {
311
+ if (i && (o || A(t, s, e))) {
312
+ r[s?.key] = n[s?.key];
313
+ continue;
314
+ }
315
+ if (s.field_interface === "CollectionWidget") {
316
+ let t = e?.[s?.key];
317
+ t && typeof t == "object" && (Array.isArray(t) ? r[s?.key] = t?.filter((e) => e) : r[s?.key] = t._id);
318
+ } else r[s?.key] = e?.[s?.key];
319
+ }
320
+ }
321
+ return r;
322
+ }, U = (e) => e.every((e) => {
323
+ let { field_interface: t = "", key: n = "", hidden: r } = e;
324
+ return !t || !n || r;
325
+ }), W = (e, t) => {
326
+ if (Array.isArray(e) && e.length > 0) {
327
+ let n = 0;
328
+ for (let r of e) n += 1, r?.param && t && t(r?.param, {
329
+ type: "server_error",
330
+ message: r?.message
331
+ }, { shouldFocus: n === 0 });
332
+ }
333
+ }, G = (t) => e.memo(t);
334
+ //#endregion
335
+ export { g as _, P as a, L as c, V as d, H as f, k as g, w as h, U as i, I as l, A as m, W as n, z as o, M as p, B as r, R as s, G as t, N as u, h as v };
@@ -1,318 +0,0 @@
1
- import { c as e } from "react/compiler-runtime";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import r, { clsx as i } from "clsx";
4
- import { createRuntimeFn as a } from "@vanilla-extract/recipes/createRuntimeFn";
5
- import { FieldInterfaces as o } from "@levo-so/core";
6
- import { isValidPhoneNumber as s } from "react-phone-number-input";
7
- import * as c from "yup";
8
- import { Separator as l } from "@base-ui/react/separator";
9
- //#region ../../libraries/react-collection/dist/utils/getFieldValidations.js
10
- var u = (e, t) => {
11
- let n = (e?.label || e?.key || "")?.replace(/_/g, " ");
12
- if (n?.endsWith("Id") && (n = n?.replace("Id", "")), n.includes(".")) {
13
- let [e] = n.split(".");
14
- e && (n = e);
15
- }
16
- let r = (t) => {
17
- let r = t;
18
- return e.max !== void 0 && e.max !== null && e.max !== "" && (r = r.max(Number(e.max), `The ${n} value is too large (max ${e.max})`)), e.min !== void 0 && e.min !== null && e.min !== "" && (r = r.min(Number(e.min), `The ${n} value is too small (min ${e.min})`)), r;
19
- }, i;
20
- switch (e.field_interface) {
21
- case o.NumberWidget:
22
- i = r(c.number());
23
- break;
24
- case o.ArrayWidget:
25
- i = r(c.array().typeError("The field must be an array"));
26
- break;
27
- case o.RecordWidget:
28
- i = c.object();
29
- break;
30
- case o.EmailWidget:
31
- i = r(c.string().email("The email address is not valid"));
32
- break;
33
- case o.PhoneWidget:
34
- i = r(c.string().test("phone", "The phone number has incorrect format", (e) => {
35
- if (e) try {
36
- return s(e);
37
- } catch {
38
- return !1;
39
- }
40
- return !0;
41
- }));
42
- break;
43
- case o.URLWidget:
44
- i = r(c.string().matches(/^(?:https?:\/\/)?(?:[a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+(?:\.[a-zA-Z]{2,})+(?:\/[^\s?#]*)?(?:\?[^\s]*)?$/, "The URL is not valid"));
45
- break;
46
- case o.ImageUploadWidget:
47
- case o.FileUploadWidget:
48
- case o.GeocoderWidget:
49
- i = c.object();
50
- break;
51
- case o.MultiImageUploadWidget:
52
- case o.MultiFileUploadWidget:
53
- case o.MultiGeocoderWidget:
54
- i = c.array().of(c.object());
55
- break;
56
- case o.JSONWidget:
57
- case o.DropdownWidget:
58
- i = c.string();
59
- break;
60
- case o.MultiTextWidget:
61
- case o.MultiDropdownWidget:
62
- case o.CheckboxWidget:
63
- i = c.array().of(c.string());
64
- break;
65
- case o.ToggleCheckboxWidget:
66
- i = c.boolean();
67
- break;
68
- case o.CollectionWidget:
69
- i = e.options.current_have_many_connected ? c.array() : c.object();
70
- break;
71
- default:
72
- i = r(c.string());
73
- break;
74
- }
75
- if (e.options?.validationsPresets && Array.isArray(e.options.validationsPresets)) {
76
- let t = e.options.validationsPresets;
77
- (e.field_interface === o.TextWidget || e.field_interface === o.TextareaWidget) && (t.includes("exclude_special_chars") && (i = i.matches(/^[a-zA-Z0-9\s]*$/, "Special characters are not allowed")), t.includes("exclude_numbers") && (i = i.matches(/^[^0-9]*$/, "Numbers are not allowed")));
78
- }
79
- return {
80
- required: {
81
- value: !!e?.required,
82
- message: `The ${n} field is required`
83
- },
84
- validate: (n) => {
85
- if (e?.options?.disableValidation || n === "" || n == null) return !0;
86
- try {
87
- return i.validateSync(n), t ? t(n) : !0;
88
- } catch (e) {
89
- return e instanceof c.ValidationError ? e.message : !0;
90
- }
91
- }
92
- };
93
- }, d = "_1ompjs11", f = "_1d7f2b80", p = (n) => {
94
- let i = e(8), a, o;
95
- i[0] === n ? (a = i[1], o = i[2]) : ({className: a, ...o} = n, i[0] = n, i[1] = a, i[2] = o);
96
- let s;
97
- i[3] === a ? s = i[4] : (s = r(f, a), i[3] = a, i[4] = s);
98
- let c;
99
- return i[5] !== o || i[6] !== s ? (c = /* @__PURE__ */ t("label", {
100
- "data-slot": "label",
101
- className: s,
102
- ...o
103
- }), i[5] = o, i[6] = s, i[7] = c) : c = i[7], c;
104
- };
105
- //#endregion
106
- //#region ../../libraries/react-collection/dist/components/collectionLabel/CollectionLabel.js
107
- function m(r) {
108
- let i = e(6), { label: a, isRequired: o, htmlFor: s } = r;
109
- if (!a) return null;
110
- let c;
111
- i[0] === o ? c = i[1] : (c = o && /* @__PURE__ */ t("span", {
112
- className: "_1ompjs10",
113
- children: "*"
114
- }), i[0] = o, i[1] = c);
115
- let l;
116
- return i[2] !== s || i[3] !== a || i[4] !== c ? (l = /* @__PURE__ */ n(p, {
117
- htmlFor: s,
118
- className: d,
119
- children: [a, c]
120
- }), i[2] = s, i[3] = a, i[4] = c, i[5] = l) : l = i[5], l;
121
- }
122
- //#endregion
123
- //#region ../../libraries/levocn/dist/ui/field/Field.cssm.js
124
- var h = "_11sljvf0", g = "_11sljvf2", _ = a({
125
- defaultClassName: "_11sljvf3",
126
- variantClassNames: { orientation: {
127
- vertical: "_11sljvf4",
128
- horizontal: "_11sljvf5"
129
- } },
130
- defaultVariants: { orientation: "vertical" },
131
- compoundVariants: []
132
- }), v = "_11sljvf6", y = "_11sljvf7", b = "_11sljvf9", x = "_11sljvfc", S = "_11sljvfd", C = a({
133
- defaultClassName: "d292um0",
134
- variantClassNames: { orientation: {
135
- horizontal: "d292um1",
136
- vertical: "d292um2"
137
- } },
138
- defaultVariants: {},
139
- compoundVariants: []
140
- });
141
- //#endregion
142
- //#region ../../libraries/levocn/dist/ui/separator/Separator.js
143
- function w(n) {
144
- let i = e(11), a, o, s;
145
- i[0] === n ? (a = i[1], o = i[2], s = i[3]) : ({className: a, orientation: s, ...o} = n, i[0] = n, i[1] = a, i[2] = o, i[3] = s);
146
- let c = s === void 0 ? "horizontal" : s, u;
147
- i[4] !== a || i[5] !== c ? (u = r(C({ orientation: c }), a), i[4] = a, i[5] = c, i[6] = u) : u = i[6];
148
- let d;
149
- return i[7] !== c || i[8] !== o || i[9] !== u ? (d = /* @__PURE__ */ t(l, {
150
- "data-slot": "separator",
151
- orientation: c,
152
- className: u,
153
- ...o
154
- }), i[7] = c, i[8] = o, i[9] = u, i[10] = d) : d = i[10], d;
155
- }
156
- //#endregion
157
- //#region ../../libraries/levocn/dist/ui/field/Field.js
158
- function T(n) {
159
- let r = e(8), a, o;
160
- r[0] === n ? (a = r[1], o = r[2]) : ({className: a, ...o} = n, r[0] = n, r[1] = a, r[2] = o);
161
- let s;
162
- r[3] === a ? s = r[4] : (s = i(h, a), r[3] = a, r[4] = s);
163
- let c;
164
- return r[5] !== o || r[6] !== s ? (c = /* @__PURE__ */ t("fieldset", {
165
- "data-slot": "field-set",
166
- className: s,
167
- ...o
168
- }), r[5] = o, r[6] = s, r[7] = c) : c = r[7], c;
169
- }
170
- function E(n) {
171
- let r = e(8), a, o;
172
- r[0] === n ? (a = r[1], o = r[2]) : ({className: a, ...o} = n, r[0] = n, r[1] = a, r[2] = o);
173
- let s;
174
- r[3] === a ? s = r[4] : (s = i(g, a), r[3] = a, r[4] = s);
175
- let c;
176
- return r[5] !== o || r[6] !== s ? (c = /* @__PURE__ */ t("div", {
177
- "data-slot": "field-group",
178
- className: s,
179
- ...o
180
- }), r[5] = o, r[6] = s, r[7] = c) : c = r[7], c;
181
- }
182
- function D(n) {
183
- let r = e(11), a, o, s;
184
- r[0] === n ? (a = r[1], o = r[2], s = r[3]) : ({className: a, orientation: s, ...o} = n, r[0] = n, r[1] = a, r[2] = o, r[3] = s);
185
- let c = s === void 0 ? "vertical" : s, l;
186
- r[4] !== a || r[5] !== c ? (l = i(_({ orientation: c }), a), r[4] = a, r[5] = c, r[6] = l) : l = r[6];
187
- let u;
188
- return r[7] !== c || r[8] !== o || r[9] !== l ? (u = /* @__PURE__ */ t("div", {
189
- role: "group",
190
- "data-slot": "field",
191
- "data-orientation": c,
192
- className: l,
193
- ...o
194
- }), r[7] = c, r[8] = o, r[9] = l, r[10] = u) : u = r[10], u;
195
- }
196
- function O(n) {
197
- let r = e(8), a, o;
198
- r[0] === n ? (a = r[1], o = r[2]) : ({className: a, ...o} = n, r[0] = n, r[1] = a, r[2] = o);
199
- let s;
200
- r[3] === a ? s = r[4] : (s = i(v, a), r[3] = a, r[4] = s);
201
- let c;
202
- return r[5] !== o || r[6] !== s ? (c = /* @__PURE__ */ t("div", {
203
- "data-slot": "field-content",
204
- className: s,
205
- ...o
206
- }), r[5] = o, r[6] = s, r[7] = c) : c = r[7], c;
207
- }
208
- function k(n) {
209
- let r = e(8), a, o;
210
- r[0] === n ? (a = r[1], o = r[2]) : ({className: a, ...o} = n, r[0] = n, r[1] = a, r[2] = o);
211
- let s;
212
- r[3] === a ? s = r[4] : (s = i(y, a), r[3] = a, r[4] = s);
213
- let c;
214
- return r[5] !== o || r[6] !== s ? (c = /* @__PURE__ */ t(p, {
215
- "data-slot": "field-label",
216
- className: s,
217
- ...o
218
- }), r[5] = o, r[6] = s, r[7] = c) : c = r[7], c;
219
- }
220
- function A(n) {
221
- let r = e(8), a, o;
222
- r[0] === n ? (a = r[1], o = r[2]) : ({className: a, ...o} = n, r[0] = n, r[1] = a, r[2] = o);
223
- let s;
224
- r[3] === a ? s = r[4] : (s = i(b, a), r[3] = a, r[4] = s);
225
- let c;
226
- return r[5] !== o || r[6] !== s ? (c = /* @__PURE__ */ t("p", {
227
- "data-slot": "field-description",
228
- className: s,
229
- ...o
230
- }), r[5] = o, r[6] = s, r[7] = c) : c = r[7], c;
231
- }
232
- function j(n) {
233
- let r = e(15), a, o, s, c;
234
- r[0] === n ? (a = r[1], o = r[2], s = r[3], c = r[4]) : ({className: o, children: a, errors: s, ...c} = n, r[0] = n, r[1] = a, r[2] = o, r[3] = s, r[4] = c);
235
- let l;
236
- bb0: {
237
- if (a) {
238
- l = a;
239
- break bb0;
240
- }
241
- if (!s?.length) {
242
- l = null;
243
- break bb0;
244
- }
245
- let e;
246
- r[5] === s ? e = r[6] : (e = [...new Map(s.map(N)).values()], r[5] = s, r[6] = e);
247
- let n = e;
248
- if (n.length === 1) {
249
- l = n[0]?.message;
250
- break bb0;
251
- }
252
- let i;
253
- r[7] === n ? i = r[8] : (i = /* @__PURE__ */ t("ul", {
254
- className: S,
255
- children: n.map(M)
256
- }), r[7] = n, r[8] = i), l = i;
257
- }
258
- let u = l;
259
- if (!u) return null;
260
- let d;
261
- r[9] === o ? d = r[10] : (d = i(x, o), r[9] = o, r[10] = d);
262
- let f;
263
- return r[11] !== u || r[12] !== c || r[13] !== d ? (f = /* @__PURE__ */ t("div", {
264
- role: "alert",
265
- "data-slot": "field-error",
266
- className: d,
267
- ...c,
268
- children: u
269
- }), r[11] = u, r[12] = c, r[13] = d, r[14] = f) : f = r[14], f;
270
- }
271
- function M(e, n) {
272
- return e?.message && /* @__PURE__ */ t("li", { children: e.message }, n);
273
- }
274
- function N(e) {
275
- return [e?.message, e];
276
- }
277
- //#endregion
278
- //#region ../../libraries/react-collection/dist/components/collectionField/CollectionField.js
279
- function P(i) {
280
- let a = e(21), { label: o, error: s, helperText: c, topHelperText: l, isRequired: u, readOnly: d, htmlFor: f, className: p, children: h, ref: g } = i, _ = d && "_1ompjs14", v;
281
- a[0] !== p || a[1] !== _ ? (v = r(_, p), a[0] = p, a[1] = _, a[2] = v) : v = a[2];
282
- let y;
283
- a[3] !== f || a[4] !== u || a[5] !== o ? (y = /* @__PURE__ */ t(m, {
284
- label: o,
285
- isRequired: u,
286
- htmlFor: f
287
- }), a[3] = f, a[4] = u, a[5] = o, a[6] = y) : y = a[6];
288
- let b;
289
- a[7] === l ? b = a[8] : (b = !!l && /* @__PURE__ */ t(A, {
290
- className: "_1ompjs12",
291
- children: l
292
- }), a[7] = l, a[8] = b);
293
- let x;
294
- a[9] === s ? x = a[10] : (x = !!s && /* @__PURE__ */ t(j, {
295
- className: "_1ompjs13",
296
- children: s
297
- }), a[9] = s, a[10] = x);
298
- let S;
299
- a[11] === c ? S = a[12] : (S = !!c && /* @__PURE__ */ t(A, {
300
- className: "_1ompjs12",
301
- children: c
302
- }), a[11] = c, a[12] = S);
303
- let C;
304
- return a[13] !== h || a[14] !== g || a[15] !== v || a[16] !== y || a[17] !== b || a[18] !== x || a[19] !== S ? (C = /* @__PURE__ */ n(D, {
305
- ref: g,
306
- orientation: "vertical",
307
- className: v,
308
- children: [
309
- y,
310
- b,
311
- h,
312
- x,
313
- S
314
- ]
315
- }), a[13] = h, a[14] = g, a[15] = v, a[16] = y, a[17] = b, a[18] = x, a[19] = S, a[20] = C) : C = a[20], C;
316
- }
317
- //#endregion
318
- export { D as a, E as c, p as d, u as f, T as i, w as l, j as n, A as o, k as r, O as s, P as t, m as u };