@firecms/collection_editor 3.0.0-canary.38 → 3.0.0-canary.39

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/index.es.js CHANGED
@@ -1,9 +1,9 @@
1
- import { jsx as e, jsxs as a, Fragment as j } from "react/jsx-runtime";
2
- import { FieldCaption as X, SearchIconsView as gr, toSnakeCase as Pt, singular as vr, IconForView as ot, ArrayContainer as yr, serializeRegExp as br, useSnackbarController as Ie, resolveEnumValues as Cr, isPropertyBuilder as ne, useCustomizationController as Ae, getFieldConfig as $e, ErrorBoundary as me, PropertyConfigBadge as Ye, unslugify as ut, useNavigationController as Pe, mergeDeep as W, DEFAULT_FIELD_CONFIGS as Gt, isValidRegExp as Pr, getFieldId as Kt, DeleteConfirmationDialog as lt, useLargeLayout as Nr, makePropertiesEditable as pt, resolveEntityView as xr, useSelectionController as wr, EntityCollectionTable as Tr, slugify as kr, useAuthController as _e, randomString as _t, CircularProgressCenter as Nt, removeUndefined as Ft, ErrorView as Wt, removeInitialAndTrailingSlashes as Or, getDefaultPropertiesOrder as Vr } from "@firecms/core";
1
+ import { jsx as e, jsxs as a, Fragment as R } from "react/jsx-runtime";
2
+ import { FieldCaption as X, SearchIconsView as gr, toSnakeCase as Pt, singular as vr, IconForView as ot, ArrayContainer as yr, serializeRegExp as br, useSnackbarController as _e, resolveEnumValues as Cr, isPropertyBuilder as ne, useCustomizationController as Ae, getFieldConfig as $e, ErrorBoundary as me, PropertyConfigBadge as Ye, unslugify as ut, useNavigationController as Ne, mergeDeep as W, DEFAULT_FIELD_CONFIGS as Gt, isValidRegExp as Pr, getFieldId as Kt, DeleteConfirmationDialog as lt, useLargeLayout as Nr, makePropertiesEditable as pt, resolveEntityView as xr, useSelectionController as wr, EntityCollectionTable as Tr, slugify as kr, useAuthController as Te, randomString as _t, CircularProgressCenter as Nt, removeUndefined as Ft, ErrorView as Wt, removeInitialAndTrailingSlashes as Or, getDefaultPropertiesOrder as Vr } from "@firecms/core";
3
3
  import * as je from "react";
4
4
  import Y, { useState as $, useEffect as de, useMemo as Zt, useCallback as Q, useRef as Le, useDeferredValue as Ir, useContext as Jt } from "react";
5
- import ve from "react-fast-compare";
6
- import { useAutoComplete as _r, Container as mt, Typography as O, Tooltip as te, IconButton as oe, Chip as st, TextField as Oe, cn as fe, DebouncedTextField as Z, Autocomplete as Fr, AutocompleteItem as Sr, ExpandablePanel as xt, SettingsIcon as He, Select as be, SelectItem as ee, BooleanSwitchWithLabel as ct, Dialog as Fe, AutoAwesomeIcon as ht, Badge as Er, ListIcon as Ar, Button as z, CircularProgress as De, Paper as Ce, DialogContent as Be, DialogActions as ze, RuleIcon as Dr, FileUploadIcon as Br, MultiSelect as zr, MultiSelectItem as St, Checkbox as Et, cardMixin as Qt, cardClickableMixin as Xt, cardSelectedMixin as er, FunctionsIcon as Mr, RemoveCircleIcon as Rr, defaultBorderMixin as wt, RemoveIcon as Ur, DragHandleIcon as jr, AddIcon as se, SelectGroup as At, InfoLabel as Lr, DeleteIcon as dt, ContentCopyIcon as qr, CodeIcon as $r, Table as Dt, TableBody as Bt, TableRow as bt, TableCell as Ue, Alert as Yr, Icon as et, Card as tr, coolIconKeys as zt, Tabs as Hr, Tab as Ct, ArrowBackIcon as tt, LoadingButton as Mt, DoneIcon as Gr, UndoIcon as Kr, SaveIcon as Wr, Menu as Zr, MoreVertIcon as Jr, MenuItem as Qr, Collapse as Xr } from "@firecms/ui";
5
+ import ye from "react-fast-compare";
6
+ import { useAutoComplete as _r, Container as mt, Typography as O, Tooltip as te, IconButton as oe, Chip as st, TextField as Ve, cn as fe, DebouncedTextField as Z, Autocomplete as Fr, AutocompleteItem as Sr, ExpandablePanel as xt, SettingsIcon as He, Select as Ce, SelectItem as ee, BooleanSwitchWithLabel as ct, Dialog as Fe, AutoAwesomeIcon as ht, Badge as Er, ListIcon as Ar, Button as z, CircularProgress as De, Paper as Pe, DialogContent as Be, DialogActions as ze, RuleIcon as Dr, FileUploadIcon as Br, MultiSelect as zr, MultiSelectItem as St, Checkbox as Et, cardMixin as Qt, cardClickableMixin as Xt, cardSelectedMixin as er, FunctionsIcon as Mr, RemoveCircleIcon as Rr, defaultBorderMixin as wt, RemoveIcon as Ur, DragHandleIcon as jr, AddIcon as se, SelectGroup as At, InfoLabel as Lr, DeleteIcon as dt, ContentCopyIcon as qr, CodeIcon as $r, Table as Dt, TableBody as Bt, TableRow as bt, TableCell as Ue, Alert as Yr, Icon as et, Card as tr, coolIconKeys as zt, Tabs as Hr, Tab as Ct, ArrowBackIcon as tt, LoadingButton as Mt, DoneIcon as Gr, Menu as Kr, MoreVertIcon as Wr, MenuItem as Zr, Collapse as Jr, SaveIcon as Qr, UndoIcon as Xr } from "@firecms/ui";
7
7
  import * as rt from "yup";
8
8
  import { useFormex as K, Field as H, getIn as I, useCreateFormex as Tt, Formex as kt } from "@firecms/formex";
9
9
  import { extractEnumFromValues as ei, buildPropertyFromData as ti, buildEntityPropertiesFromData as ri } from "@firecms/schema_inference";
@@ -26,29 +26,29 @@ function yi({
26
26
  parentCollection: o
27
27
  }) {
28
28
  const d = Y.useRef(null), {
29
- values: u,
30
- setFieldValue: p,
29
+ values: p,
30
+ setFieldValue: u,
31
31
  handleChange: h,
32
32
  touched: m,
33
- errors: s,
34
- setFieldTouched: f,
33
+ errors: c,
34
+ setFieldTouched: g,
35
35
  isSubmitting: v,
36
36
  submitCount: x
37
- } = K(), [y, P] = $(!1), [k, b] = $(!1), C = (c) => {
38
- p("name", c), !I(m, "path") && t && c && p("path", Pt(c)), !I(m, "id") && t && c && p("id", Pt(c)), !I(m, "singularName") && t && c && p("singularName", vr(c));
37
+ } = K(), [y, P] = $(!1), [k, b] = $(!1), C = (s) => {
38
+ u("name", s), !I(m, "path") && t && s && u("path", Pt(s)), !I(m, "id") && t && s && u("id", Pt(s)), !I(m, "singularName") && t && s && u("singularName", vr(s));
39
39
  };
40
40
  de(() => {
41
- s.id && b(!0);
42
- }, [s.id]);
43
- const N = /* @__PURE__ */ e(ot, { collectionOrView: u }), g = l?.filter((c) => !r?.includes(c)), {
41
+ c.id && b(!0);
42
+ }, [c.id]);
43
+ const N = /* @__PURE__ */ e(ot, { collectionOrView: p }), f = l?.filter((s) => !r?.includes(s)), {
44
44
  inputFocused: w,
45
45
  autoCompleteOpen: _,
46
46
  setAutoCompleteOpen: M
47
47
  } = _r({
48
48
  ref: d
49
- }), R = !!o;
49
+ }), U = !!o;
50
50
  let D;
51
- typeof u.customId == "object" ? D = "code_defined" : u.customId === !0 ? D = "true" : u.customId === !1 ? D = "false" : u.customId === "optional" && (D = "optional");
51
+ typeof p.customId == "object" ? D = "code_defined" : p.customId === !0 ? D = "true" : p.customId === !1 ? D = "false" : p.customId === "optional" && (D = "optional");
52
52
  const A = x > 0;
53
53
  return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ a(mt, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
54
54
  /* @__PURE__ */ a("div", { children: [
@@ -57,7 +57,7 @@ function yi({
57
57
  {
58
58
  className: "flex flex-row py-2 pt-3 items-center",
59
59
  children: [
60
- /* @__PURE__ */ e(O, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${u?.name} collection` }),
60
+ /* @__PURE__ */ e(O, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${p?.name} collection` }),
61
61
  /* @__PURE__ */ e(te, { title: "Change icon", children: /* @__PURE__ */ e(
62
62
  oe,
63
63
  {
@@ -77,18 +77,18 @@ function yi({
77
77
  /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-4", children: [
78
78
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
79
79
  /* @__PURE__ */ e(
80
- Oe,
80
+ Ve,
81
81
  {
82
- value: u.name ?? "",
83
- onChange: (c) => C(c.target.value),
82
+ value: p.name ?? "",
83
+ onChange: (s) => C(s.target.value),
84
84
  label: "Name",
85
85
  required: !0,
86
- error: A && !!s.name
86
+ error: A && !!c.name
87
87
  }
88
88
  ),
89
- /* @__PURE__ */ e(X, { error: m.name && !!s.name, children: m.name && s.name ? s.name : "Name of in this collection, usually a plural name (e.g. Products)" })
89
+ /* @__PURE__ */ e(X, { error: m.name && !!c.name, children: m.name && c.name ? c.name : "Name of in this collection, usually a plural name (e.g. Products)" })
90
90
  ] }),
91
- /* @__PURE__ */ a("div", { className: fe("col-span-12 ", R ? "" : "sm:col-span-8"), children: [
91
+ /* @__PURE__ */ a("div", { className: fe("col-span-12 ", U ? "" : "sm:col-span-8"), children: [
92
92
  /* @__PURE__ */ e(
93
93
  H,
94
94
  {
@@ -97,20 +97,20 @@ function yi({
97
97
  label: "Path",
98
98
  disabled: !t,
99
99
  required: !0,
100
- error: A && !!s.path
100
+ error: A && !!c.path
101
101
  }
102
102
  ),
103
- /* @__PURE__ */ e(X, { error: m.path && !!s.path, children: m.path && s.path ? s.path : R ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database" })
103
+ /* @__PURE__ */ e(X, { error: m.path && !!c.path, children: m.path && c.path ? c.path : U ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database" })
104
104
  ] }),
105
- !R && /* @__PURE__ */ a("div", { className: "col-span-12 sm:col-span-4 relative", children: [
105
+ !U && /* @__PURE__ */ a("div", { className: "col-span-12 sm:col-span-4 relative", children: [
106
106
  /* @__PURE__ */ e(
107
- Oe,
107
+ Ve,
108
108
  {
109
- error: A && !!s.group,
109
+ error: A && !!c.group,
110
110
  disabled: v,
111
- value: u.group ?? "",
111
+ value: p.group ?? "",
112
112
  autoComplete: "off",
113
- onChange: (c) => p("group", c.target.value),
113
+ onChange: (s) => u("group", s.target.value),
114
114
  name: "group",
115
115
  inputRef: d,
116
116
  label: "Group"
@@ -119,21 +119,21 @@ function yi({
119
119
  /* @__PURE__ */ e(
120
120
  Fr,
121
121
  {
122
- open: _ && (g ?? []).length > 0,
122
+ open: _ && (f ?? []).length > 0,
123
123
  setOpen: M,
124
- children: g?.map((c, V) => /* @__PURE__ */ e(
124
+ children: f?.map((s, V) => /* @__PURE__ */ e(
125
125
  Sr,
126
126
  {
127
127
  onClick: () => {
128
- M(!1), p("group", c ?? null);
128
+ M(!1), u("group", s ?? null);
129
129
  },
130
- children: /* @__PURE__ */ e("div", { className: "flex-grow", children: c })
130
+ children: /* @__PURE__ */ e("div", { className: "flex-grow", children: s })
131
131
  },
132
- V + "_" + c
132
+ V + "_" + s
133
133
  ))
134
134
  }
135
135
  ),
136
- /* @__PURE__ */ e(X, { children: A && s.group ? s.group : "Group of the collection" })
136
+ /* @__PURE__ */ e(X, { children: A && c.group ? c.group : "Group of the collection" })
137
137
  ] }),
138
138
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
139
139
  xt,
@@ -161,32 +161,32 @@ function yi({
161
161
  as: Z,
162
162
  disabled: !t,
163
163
  label: "Collection id",
164
- error: A && !!s.id
164
+ error: A && !!c.id
165
165
  }
166
166
  ),
167
- /* @__PURE__ */ e(X, { error: m.id && !!s.id, children: m.id && s.id ? s.id : "This id identifies this collection" })
167
+ /* @__PURE__ */ e(X, { error: m.id && !!c.id, children: m.id && c.id ? c.id : "This id identifies this collection" })
168
168
  ] }),
169
169
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
170
170
  /* @__PURE__ */ e(
171
- Oe,
171
+ Ve,
172
172
  {
173
- error: A && !!s.singularName,
173
+ error: A && !!c.singularName,
174
174
  name: "singularName",
175
175
  "aria-describedby": "singularName-helper",
176
- onChange: (c) => (f("singularName", !0), h(c)),
177
- value: u.singularName ?? "",
176
+ onChange: (s) => (g("singularName", !0), h(s)),
177
+ value: p.singularName ?? "",
178
178
  label: "Singular name"
179
179
  }
180
180
  ),
181
- /* @__PURE__ */ e(X, { error: A && !!s.singularName, children: A && s.singularName ? s.singularName : "Optionally define a singular name for your entities" })
181
+ /* @__PURE__ */ e(X, { error: A && !!c.singularName, children: A && c.singularName ? c.singularName : "Optionally define a singular name for your entities" })
182
182
  ] }),
183
183
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
184
184
  /* @__PURE__ */ e(
185
- Oe,
185
+ Ve,
186
186
  {
187
- error: A && !!s.description,
187
+ error: A && !!c.description,
188
188
  name: "description",
189
- value: u.description ?? "",
189
+ value: p.description ?? "",
190
190
  onChange: h,
191
191
  multiline: !0,
192
192
  rows: 2,
@@ -194,41 +194,41 @@ function yi({
194
194
  label: "Description"
195
195
  }
196
196
  ),
197
- /* @__PURE__ */ e(X, { error: A && !!s.description, children: A && s.description ? s.description : "Description of the collection, you can use markdown" })
197
+ /* @__PURE__ */ e(X, { error: A && !!c.description, children: A && c.description ? c.description : "Description of the collection, you can use markdown" })
198
198
  ] }),
199
199
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
200
- be,
200
+ Ce,
201
201
  {
202
202
  name: "defaultSize",
203
203
  label: "Default row size",
204
204
  position: "item-aligned",
205
205
  onChange: h,
206
- value: u.defaultSize ?? "",
207
- renderValue: (c) => c.toUpperCase(),
208
- children: ["xs", "s", "m", "l", "xl"].map((c) => /* @__PURE__ */ e(
206
+ value: p.defaultSize ?? "",
207
+ renderValue: (s) => s.toUpperCase(),
208
+ children: ["xs", "s", "m", "l", "xl"].map((s) => /* @__PURE__ */ e(
209
209
  ee,
210
210
  {
211
- value: c,
212
- children: c.toUpperCase()
211
+ value: s,
212
+ children: s.toUpperCase()
213
213
  },
214
- `size-select-${c}`
214
+ `size-select-${s}`
215
215
  ))
216
216
  }
217
217
  ) }),
218
218
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
219
- be,
219
+ Ce,
220
220
  {
221
221
  name: "customId",
222
222
  label: "Data IDs generation",
223
223
  position: "item-aligned",
224
224
  disabled: D === "code_defined",
225
- onValueChange: (c) => {
226
- if (c === "code_defined")
225
+ onValueChange: (s) => {
226
+ if (s === "code_defined")
227
227
  throw new Error("This should not happen");
228
- c === "true" ? p("customId", !0) : c === "false" ? p("customId", !1) : c === "optional" && p("customId", "optional");
228
+ s === "true" ? u("customId", !0) : s === "false" ? u("customId", !1) : s === "optional" && u("customId", "optional");
229
229
  },
230
230
  value: D ?? "",
231
- renderValue: (c) => c === "code_defined" ? "Code defined" : c === "true" ? "Users must define an ID" : c === "optional" ? "Users can define an ID, but it is not required" : "Document ID is generated automatically",
231
+ renderValue: (s) => s === "code_defined" ? "Code defined" : s === "true" ? "Users must define an ID" : s === "optional" ? "Users can define an ID, but it is not required" : "Document ID is generated automatically",
232
232
  children: [
233
233
  /* @__PURE__ */ e(ee, { value: "false", children: "Document ID is generated automatically" }),
234
234
  /* @__PURE__ */ e(ee, { value: "true", children: "Users must define an ID" }),
@@ -242,8 +242,8 @@ function yi({
242
242
  {
243
243
  position: "start",
244
244
  label: "Collection group",
245
- onValueChange: (c) => p("collectionGroup", c),
246
- value: u.collectionGroup ?? !1
245
+ onValueChange: (s) => u("collectionGroup", s),
246
+ value: p.collectionGroup ?? !1
247
247
  }
248
248
  ),
249
249
  /* @__PURE__ */ e(X, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." })
@@ -254,8 +254,8 @@ function yi({
254
254
  {
255
255
  position: "start",
256
256
  label: "Enable text search for this collection",
257
- onValueChange: (c) => p("textSearchEnabled", c),
258
- value: u.textSearchEnabled ?? !1
257
+ onValueChange: (s) => u("textSearchEnabled", s),
258
+ value: p.textSearchEnabled ?? !1
259
259
  }
260
260
  ),
261
261
  /* @__PURE__ */ e(X, { children: "Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues." })
@@ -275,9 +275,9 @@ function yi({
275
275
  children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
276
276
  gr,
277
277
  {
278
- selectedIcon: u.icon,
279
- onIconSelected: (c) => {
280
- P(!1), p("icon", c);
278
+ selectedIcon: p.icon,
279
+ onIconSelected: (s) => {
280
+ P(!1), u("icon", s);
281
281
  }
282
282
  }
283
283
  ) })
@@ -291,7 +291,7 @@ function he(t) {
291
291
  function bi(t) {
292
292
  return t ? "properties." + t.replaceAll(".", ".properties.") + ".properties" : "properties";
293
293
  }
294
- function ye(t) {
294
+ function be(t) {
295
295
  return t ? "properties." + t.replaceAll(".", ".properties.") + ".propertiesOrder" : "propertiesOrder";
296
296
  }
297
297
  function ae(t, r) {
@@ -310,25 +310,25 @@ function Ci({
310
310
  allowDataInference: o,
311
311
  getData: d
312
312
  }) {
313
- const u = Tt({
313
+ const p = Tt({
314
314
  initialValues: { enumValues: t },
315
315
  validateOnChange: !0,
316
316
  validation: (m) => {
317
- const s = {};
317
+ const c = {};
318
318
  m.enumValues && m.enumValues.forEach((v, x) => {
319
- v?.label || (s.enumValues = s.enumValues ?? [], s.enumValues[x] = s.enumValues[x] ?? {}, s.enumValues[x].label = "You must specify a label for this enum value entry"), v?.id || (s.enumValues = s.enumValues ?? [], s.enumValues[x] = s.enumValues[x] ?? {}, s.enumValues[x].id = "You must specify an ID for this enum value entry");
319
+ v?.label || (c.enumValues = c.enumValues ?? [], c.enumValues[x] = c.enumValues[x] ?? {}, c.enumValues[x].label = "You must specify a label for this enum value entry"), v?.id || (c.enumValues = c.enumValues ?? [], c.enumValues[x] = c.enumValues[x] ?? {}, c.enumValues[x].id = "You must specify an ID for this enum value entry");
320
320
  });
321
- const f = !!(s?.enumValues && Object.keys(s?.enumValues).length > 0);
322
- return n?.(f), s;
321
+ const g = !!(c?.enumValues && Object.keys(c?.enumValues).length > 0);
322
+ return n?.(g), c;
323
323
  }
324
- }), { values: p, errors: h } = u;
324
+ }), { values: u, errors: h } = p;
325
325
  return de(() => {
326
- r && r(p.enumValues);
327
- }, [p.enumValues]), /* @__PURE__ */ e(kt, { value: u, children: /* @__PURE__ */ e(
326
+ r && r(u.enumValues);
327
+ }, [u.enumValues]), /* @__PURE__ */ e(kt, { value: p, children: /* @__PURE__ */ e(
328
328
  Pi,
329
329
  {
330
330
  enumValuesPath: "enumValues",
331
- values: p,
331
+ values: u,
332
332
  errors: h,
333
333
  shouldUpdateId: i,
334
334
  disabled: l,
@@ -347,9 +347,9 @@ function Pi({
347
347
  getData: d
348
348
  }) {
349
349
  const {
350
- setFieldValue: u
351
- } = K(), [p, h] = Y.useState(), [m, s] = Y.useState(), [f, v] = Y.useState(!1), y = Y.useRef(/* @__PURE__ */ new Set()).current, P = (b, C) => {
352
- const N = p === C, g = r?.enumValues && r?.enumValues[b];
350
+ setFieldValue: p
351
+ } = K(), [u, h] = Y.useState(), [m, c] = Y.useState(), [g, v] = Y.useState(!1), y = Y.useRef(/* @__PURE__ */ new Set()).current, P = (b, C) => {
352
+ const N = u === C, f = r?.enumValues && r?.enumValues[b];
353
353
  return /* @__PURE__ */ e(
354
354
  Ni,
355
355
  {
@@ -357,9 +357,9 @@ function Pi({
357
357
  disabled: n,
358
358
  enumValuesPath: i,
359
359
  autoFocus: N,
360
- entryError: g,
360
+ entryError: f,
361
361
  shouldUpdateId: l || N,
362
- onDialogOpen: () => s(b),
362
+ onDialogOpen: () => c(b),
363
363
  inferredEntry: y.has(t.enumValues[b]?.id)
364
364
  },
365
365
  `${C}`
@@ -379,30 +379,30 @@ function Pi({
379
379
  o && /* @__PURE__ */ a(
380
380
  z,
381
381
  {
382
- loading: f,
383
- disabled: n || f,
382
+ loading: g,
383
+ disabled: n || g,
384
384
  variant: "text",
385
385
  size: "small",
386
386
  onClick: async () => {
387
387
  d && (v(!0), d?.().then((b) => {
388
388
  if (!b)
389
389
  return;
390
- const C = b.flat(), N = Array.from(new Set(C)), g = t.enumValues, _ = ei(N).filter((M) => !g?.some((R) => R.id === M.id));
390
+ const C = b.flat(), N = Array.from(new Set(C)), f = t.enumValues, _ = ei(N).filter((M) => !f?.some((U) => U.id === M.id));
391
391
  _.forEach((M) => {
392
392
  y.add(M.id);
393
- }), u(i, [..._, ...g], !0);
393
+ }), p(i, [..._, ...f], !0);
394
394
  }).catch((b) => {
395
395
  console.error(b);
396
396
  }).finally(() => v(!1)));
397
397
  },
398
398
  children: [
399
- f ? /* @__PURE__ */ e(De, { size: "small" }) : /* @__PURE__ */ e(ht, {}),
399
+ g ? /* @__PURE__ */ e(De, { size: "small" }) : /* @__PURE__ */ e(ht, {}),
400
400
  "Infer values from data"
401
401
  ]
402
402
  }
403
403
  )
404
404
  ] }),
405
- /* @__PURE__ */ a(Ce, { className: "p-4 m-1", children: [
405
+ /* @__PURE__ */ a(Pe, { className: "p-4 m-1", children: [
406
406
  /* @__PURE__ */ e(
407
407
  yr,
408
408
  {
@@ -414,7 +414,7 @@ function Pi({
414
414
  buildEntry: P,
415
415
  onInternalIdAdded: h,
416
416
  includeAddButton: !0,
417
- onValueChange: (b) => u(i, b),
417
+ onValueChange: (b) => p(i, b),
418
418
  newDefaultEntry: { id: "", label: "" }
419
419
  }
420
420
  ),
@@ -424,7 +424,7 @@ function Pi({
424
424
  index: m,
425
425
  open: m !== void 0,
426
426
  enumValuesPath: i,
427
- onClose: () => s(void 0)
427
+ onClose: () => c(void 0)
428
428
  }
429
429
  )
430
430
  ] })
@@ -438,19 +438,19 @@ const Ni = Y.memo(
438
438
  autoFocus: l,
439
439
  onDialogOpen: o,
440
440
  disabled: d,
441
- inferredEntry: u,
442
- entryError: p
441
+ inferredEntry: p,
442
+ entryError: u
443
443
  }) {
444
444
  const {
445
445
  values: h,
446
446
  handleChange: m,
447
- errors: s,
448
- setFieldValue: f,
447
+ errors: c,
448
+ setFieldValue: g,
449
449
  touched: v
450
450
  } = K(), x = Y.useRef(!I(h, `${i}[${r}].id`)), y = n || x.current, P = I(h, `${i}[${r}].id`), k = I(h, `${i}[${r}].label`), b = Y.useRef(k);
451
451
  return Y.useEffect(() => {
452
- (b.current === P || !P) && y && f(`${i}[${r}].id`, k), b.current = k;
453
- }, [k]), /* @__PURE__ */ a(j, { children: [
452
+ (b.current === P || !P) && y && g(`${i}[${r}].id`, k), b.current = k;
453
+ }, [k]), /* @__PURE__ */ a(R, { children: [
454
454
  /* @__PURE__ */ a("div", { className: "flex w-full align-center justify-center", children: [
455
455
  /* @__PURE__ */ e(
456
456
  H,
@@ -463,11 +463,11 @@ const Ni = Y.memo(
463
463
  size: "small",
464
464
  autoFocus: l,
465
465
  autoComplete: "off",
466
- endAdornment: u && /* @__PURE__ */ e(ht, { size: "small" }),
467
- error: !!p?.label
466
+ endAdornment: p && /* @__PURE__ */ e(ht, { size: "small" }),
467
+ error: !!u?.label
468
468
  }
469
469
  ),
470
- !d && /* @__PURE__ */ e(Er, { color: "error", invisible: !p?.id, children: /* @__PURE__ */ e(
470
+ !d && /* @__PURE__ */ e(Er, { color: "error", invisible: !u?.id, children: /* @__PURE__ */ e(
471
471
  oe,
472
472
  {
473
473
  size: "small",
@@ -478,26 +478,26 @@ const Ni = Y.memo(
478
478
  }
479
479
  ) })
480
480
  ] }),
481
- p?.label && /* @__PURE__ */ e(
481
+ u?.label && /* @__PURE__ */ e(
482
482
  O,
483
483
  {
484
484
  variant: "caption",
485
485
  className: "ml-3.5 text-red-500 dark:text-red-500",
486
- children: p?.label
486
+ children: u?.label
487
487
  }
488
488
  ),
489
- p?.id && /* @__PURE__ */ e(
489
+ u?.id && /* @__PURE__ */ e(
490
490
  O,
491
491
  {
492
492
  variant: "caption",
493
493
  className: "ml-3.5 text-red-500 dark:text-red-500",
494
- children: p?.id
494
+ children: u?.id
495
495
  }
496
496
  )
497
497
  ] });
498
498
  },
499
499
  function(r, n) {
500
- return r.index === n.index && r.enumValuesPath === n.enumValuesPath && r.shouldUpdateId === n.shouldUpdateId && r.inferredEntry === n.inferredEntry && ve(r.entryError, n.entryError) && r.autoFocus === n.autoFocus;
500
+ return r.index === n.index && r.enumValuesPath === n.enumValuesPath && r.shouldUpdateId === n.shouldUpdateId && r.inferredEntry === n.inferredEntry && ye(r.entryError, n.entryError) && r.autoFocus === n.autoFocus;
501
501
  }
502
502
  );
503
503
  function xi({
@@ -555,7 +555,7 @@ function ce({
555
555
  size: o = "small",
556
556
  allowIndeterminate: d
557
557
  }) {
558
- const u = /* @__PURE__ */ e(
558
+ const p = /* @__PURE__ */ e(
559
559
  ct,
560
560
  {
561
561
  label: n,
@@ -564,32 +564,32 @@ function ce({
564
564
  value: t.value,
565
565
  disabled: l,
566
566
  allowIndeterminate: d,
567
- onValueChange: (p) => r.setFieldValue(t.name, p)
567
+ onValueChange: (u) => r.setFieldValue(t.name, u)
568
568
  }
569
569
  );
570
570
  return i ? /* @__PURE__ */ e(
571
571
  te,
572
572
  {
573
573
  title: i,
574
- children: u
574
+ children: p
575
575
  }
576
- ) : u;
576
+ ) : p;
577
577
  }
578
578
  function Se({ disabled: t }) {
579
579
  const { values: r, handleChange: n } = K(), i = "validation.required", l = "validation.requiredMessage";
580
- return /* @__PURE__ */ a(j, { children: [
580
+ return /* @__PURE__ */ a(R, { children: [
581
581
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
582
582
  H,
583
583
  {
584
584
  name: i,
585
585
  type: "checkbox",
586
- children: ({ field: d, form: u }) => /* @__PURE__ */ e(
586
+ children: ({ field: d, form: p }) => /* @__PURE__ */ e(
587
587
  ce,
588
588
  {
589
589
  disabled: t,
590
590
  label: "Required",
591
591
  tooltip: "You won't be able to save this entity if this value is not set",
592
- form: u,
592
+ form: p,
593
593
  field: d
594
594
  }
595
595
  )
@@ -600,13 +600,13 @@ function Se({ disabled: t }) {
600
600
  {
601
601
  name: "validation.unique",
602
602
  type: "checkbox",
603
- children: ({ field: d, form: u }) => /* @__PURE__ */ e(
603
+ children: ({ field: d, form: p }) => /* @__PURE__ */ e(
604
604
  ce,
605
605
  {
606
606
  disabled: t,
607
607
  label: "Unique",
608
608
  tooltip: "There cannot be multiple entities with the same value",
609
- form: u,
609
+ form: p,
610
610
  field: d
611
611
  }
612
612
  )
@@ -633,16 +633,16 @@ function Ee({
633
633
  min: l,
634
634
  trim: o,
635
635
  uppercase: d,
636
- disabled: u,
637
- showErrors: p
636
+ disabled: p,
637
+ showErrors: u
638
638
  }) {
639
639
  const {
640
640
  values: h,
641
641
  handleChange: m,
642
- errors: s
643
- } = K(), f = "validation.length", v = "validation.min", x = "validation.max", y = "validation.trim", P = "validation.matches", k = "validation.lowercase", b = "validation.uppercase", C = I(s, P), N = I(h, P), g = typeof N == "string" ? N : br(N);
642
+ errors: c
643
+ } = K(), g = "validation.length", v = "validation.min", x = "validation.max", y = "validation.trim", P = "validation.matches", k = "validation.lowercase", b = "validation.uppercase", C = I(c, P), N = I(h, P), f = typeof N == "string" ? N : br(N);
644
644
  return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
645
- /* @__PURE__ */ e(Se, { disabled: u }),
645
+ /* @__PURE__ */ e(Se, { disabled: p }),
646
646
  /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
647
647
  r && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
648
648
  H,
@@ -653,7 +653,7 @@ function Ee({
653
653
  ce,
654
654
  {
655
655
  label: "Lowercase",
656
- disabled: u,
656
+ disabled: p,
657
657
  form: _,
658
658
  field: w
659
659
  }
@@ -669,7 +669,7 @@ function Ee({
669
669
  ce,
670
670
  {
671
671
  label: "Uppercase",
672
- disabled: u,
672
+ disabled: p,
673
673
  form: _,
674
674
  field: w
675
675
  }
@@ -685,7 +685,7 @@ function Ee({
685
685
  ce,
686
686
  {
687
687
  label: "Trim",
688
- disabled: u,
688
+ disabled: p,
689
689
  form: _,
690
690
  field: w
691
691
  }
@@ -697,12 +697,12 @@ function Ee({
697
697
  t && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
698
698
  Z,
699
699
  {
700
- value: I(h, f),
700
+ value: I(h, g),
701
701
  label: "Exact length",
702
- name: f,
702
+ name: g,
703
703
  type: "number",
704
704
  size: "small",
705
- disabled: u,
705
+ disabled: p,
706
706
  onChange: m
707
707
  }
708
708
  ) }),
@@ -714,7 +714,7 @@ function Ee({
714
714
  name: v,
715
715
  type: "number",
716
716
  size: "small",
717
- disabled: u,
717
+ disabled: p,
718
718
  onChange: m
719
719
  }
720
720
  ) }),
@@ -726,7 +726,7 @@ function Ee({
726
726
  name: x,
727
727
  type: "number",
728
728
  size: "small",
729
- disabled: u,
729
+ disabled: p,
730
730
  onChange: m
731
731
  }
732
732
  ) })
@@ -739,8 +739,8 @@ function Ee({
739
739
  as: Z,
740
740
  label: "Matches regex",
741
741
  size: "small",
742
- disabled: u,
743
- value: g,
742
+ disabled: p,
743
+ value: f,
744
744
  error: !!C
745
745
  }
746
746
  ),
@@ -785,7 +785,7 @@ function Ot({
785
785
  ) })
786
786
  ] });
787
787
  }
788
- function Ne({
788
+ function xe({
789
789
  children: t
790
790
  }) {
791
791
  return /* @__PURE__ */ e(
@@ -819,10 +819,10 @@ function Rt({
819
819
  }) {
820
820
  const {
821
821
  values: d,
822
- setFieldError: u,
823
- setFieldValue: p
824
- } = K(), h = Ie(), m = t ? "of.enumValues" : "enumValues", s = I(d, "defaultValue"), f = I(d, m), v = Zt(() => !f || typeof f == "boolean" ? [] : Cr(f) ?? [], [f]);
825
- return /* @__PURE__ */ a(j, { children: [
822
+ setFieldError: p,
823
+ setFieldValue: u
824
+ } = K(), h = _e(), m = t ? "of.enumValues" : "enumValues", c = I(d, "defaultValue"), g = I(d, m), v = Zt(() => !g || typeof g == "boolean" ? [] : Cr(g) ?? [], [g]);
825
+ return /* @__PURE__ */ a(R, { children: [
826
826
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
827
827
  Ci,
828
828
  {
@@ -831,13 +831,13 @@ function Rt({
831
831
  disabled: n,
832
832
  allowDataInference: l,
833
833
  onError: (y) => {
834
- u(m, y ? "This enum property is missing some values" : void 0);
834
+ p(m, y ? "This enum property is missing some values" : void 0);
835
835
  },
836
836
  getData: o ? () => o().then((y) => y.map((P) => d.id && I(P, d.id)).filter(Boolean)) : void 0,
837
837
  onValuesChanged: (y) => {
838
- if (d && (p(m, y), !t)) {
838
+ if (d && (u(m, y), !t)) {
839
839
  const P = y.filter((k) => !!k?.id).map((k) => k.id);
840
- s && !P.includes(s) && (p("defaultValue", void 0), h.open({
840
+ c && !P.includes(c) && (u("defaultValue", void 0), h.open({
841
841
  type: "warning",
842
842
  message: "Default value was cleared"
843
843
  }));
@@ -845,7 +845,7 @@ function Rt({
845
845
  }
846
846
  }
847
847
  ) }),
848
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Ne, { children: [
848
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
849
849
  !t && /* @__PURE__ */ e(
850
850
  Ee,
851
851
  {
@@ -856,15 +856,15 @@ function Rt({
856
856
  t && /* @__PURE__ */ e(Ot, { disabled: n })
857
857
  ] }) }),
858
858
  !t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
859
- be,
859
+ Ce,
860
860
  {
861
861
  disabled: n,
862
862
  position: "item-aligned",
863
863
  onValueChange: (y) => {
864
- p("defaultValue", y);
864
+ u("defaultValue", y);
865
865
  },
866
866
  label: "Default value",
867
- value: s ?? "",
867
+ value: c ?? "",
868
868
  children: v.filter((y) => !!y?.id).map((y) => /* @__PURE__ */ e(
869
869
  ee,
870
870
  {
@@ -892,10 +892,10 @@ function Ut({
892
892
  const {
893
893
  values: i,
894
894
  setFieldValue: l
895
- } = K(), o = t ? "of.storage" : "storage", d = `${o}.acceptedFiles`, u = `${o}.fileName`, p = `${o}.storagePath`, h = `${o}.storeUrl`, m = I(i, u) ?? "{rand}_{file}", s = I(i, p) ?? "/", f = I(i, d), v = Array.isArray(f) ? f : void 0, x = !v || v.length === 0, y = (b) => {
895
+ } = K(), o = t ? "of.storage" : "storage", d = `${o}.acceptedFiles`, p = `${o}.fileName`, u = `${o}.storagePath`, h = `${o}.storeUrl`, m = I(i, p) ?? "{rand}_{file}", c = I(i, u) ?? "/", g = I(i, d), v = Array.isArray(g) ? g : void 0, x = !v || v.length === 0, y = (b) => {
896
896
  b ? b.includes("all") || b.length >= Object.keys(it).length ? l(d, void 0) : x ? l(d, Object.keys(it).filter((C) => !b.includes(C))) : l(d, b) : l(d, void 0);
897
- }, P = typeof m == "function", k = typeof s == "function";
898
- return /* @__PURE__ */ a(j, { children: [
897
+ }, P = typeof m == "function", k = typeof c == "function";
898
+ return /* @__PURE__ */ a(R, { children: [
899
899
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
900
900
  xt,
901
901
  {
@@ -954,7 +954,7 @@ function Ut({
954
954
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
955
955
  H,
956
956
  {
957
- name: u,
957
+ name: p,
958
958
  as: Z,
959
959
  label: "File name",
960
960
  size: "small",
@@ -966,12 +966,12 @@ function Ut({
966
966
  /* @__PURE__ */ e(
967
967
  H,
968
968
  {
969
- name: p,
969
+ name: u,
970
970
  as: Z,
971
971
  label: "Storage path",
972
972
  disabled: k || n,
973
973
  size: "small",
974
- value: k ? "-" : s
974
+ value: k ? "-" : c
975
975
  }
976
976
  ),
977
977
  /* @__PURE__ */ a(O, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: [
@@ -1007,7 +1007,7 @@ function Ut({
1007
1007
  ] })
1008
1008
  }
1009
1009
  ) }),
1010
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Ne, { children: [
1010
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
1011
1011
  !t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Se, { disabled: n }) }),
1012
1012
  t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ot, { disabled: n }) })
1013
1013
  ] }) })
@@ -1041,18 +1041,18 @@ function nr({
1041
1041
  includeEditButton: l,
1042
1042
  selected: o
1043
1043
  }) {
1044
- const { propertyConfigs: d } = Ae(), u = $e(t, d);
1044
+ const { propertyConfigs: d } = Ae(), p = $e(t, d);
1045
1045
  qe(t);
1046
- const p = n ? "border-red-500 dark:border-red-500 border-opacity-100 dark:border-opacity-100 ring-0 dark:ring-0" : o ? "border-primary" : "border-transparent";
1046
+ const u = n ? "border-red-500 dark:border-red-500 border-opacity-100 dark:border-opacity-100 ring-0 dark:ring-0" : o ? "border-primary" : "border-transparent";
1047
1047
  return n && console.log("PropertyFieldPreview", t), /* @__PURE__ */ e(me, { children: /* @__PURE__ */ a(
1048
1048
  "div",
1049
1049
  {
1050
1050
  onClick: r,
1051
1051
  className: "flex flex-row w-full cursor-pointer",
1052
1052
  children: [
1053
- /* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(Ye, { propertyConfig: u }) }),
1053
+ /* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(Ye, { propertyConfig: p }) }),
1054
1054
  /* @__PURE__ */ a(
1055
- Ce,
1055
+ Pe,
1056
1056
  {
1057
1057
  className: fe(
1058
1058
  "border",
@@ -1061,7 +1061,7 @@ function nr({
1061
1061
  r ? Xt : "",
1062
1062
  o ? er : "",
1063
1063
  "flex-grow p-4 border transition-colors duration-200",
1064
- p
1064
+ u
1065
1065
  ),
1066
1066
  children: [
1067
1067
  /* @__PURE__ */ a("div", { className: "w-full flex flex-col", children: [
@@ -1082,7 +1082,7 @@ function nr({
1082
1082
  variant: i ? "body2" : "subtitle1",
1083
1083
  component: "span",
1084
1084
  color: "secondary",
1085
- children: u?.name
1085
+ children: p?.name
1086
1086
  }
1087
1087
  ) }),
1088
1088
  /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
@@ -1129,7 +1129,7 @@ function Ti({
1129
1129
  /* @__PURE__ */ e(Rr, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
1130
1130
  ] }),
1131
1131
  /* @__PURE__ */ e(
1132
- Ce,
1132
+ Pe,
1133
1133
  {
1134
1134
  className: fe(
1135
1135
  "pl-2 w-full flex flex-row gap-4 items-center",
@@ -1203,20 +1203,20 @@ const ft = Y.memo(
1203
1203
  properties: l,
1204
1204
  propertiesOrder: o,
1205
1205
  additionalFields: d,
1206
- errors: u,
1207
- onPropertyMove: p,
1206
+ errors: p,
1207
+ onPropertyMove: u,
1208
1208
  onPropertyRemove: h,
1209
1209
  className: m,
1210
- inferredPropertyKeys: s,
1211
- collectionEditable: f
1210
+ inferredPropertyKeys: c,
1211
+ collectionEditable: g
1212
1212
  }) {
1213
1213
  const v = o ?? Object.keys(l), x = Q((y) => {
1214
1214
  if (!y.destination)
1215
1215
  return;
1216
1216
  const P = y.source.index, k = y.destination.index, b = Array.from(v), [C] = b.splice(P, 1);
1217
- b.splice(k, 0, C), p && p(b, r);
1218
- }, [r, p, v]);
1219
- return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(ii, { onDragEnd: x, children: /* @__PURE__ */ e(ni, { droppableId: `droppable_${r}`, children: (y, P) => /* @__PURE__ */ a(
1217
+ b.splice(k, 0, C), u && u(b, r);
1218
+ }, [r, u, v]);
1219
+ return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(ii, { onDragEnd: x, children: /* @__PURE__ */ e(ni, { droppableId: `droppable_${r}`, children: (y, P) => /* @__PURE__ */ a(
1220
1220
  "div",
1221
1221
  {
1222
1222
  ...y.droppableProps,
@@ -1224,27 +1224,27 @@ const ft = Y.memo(
1224
1224
  className: m,
1225
1225
  children: [
1226
1226
  v && v.map((k, b) => {
1227
- const C = l[k], N = d?.find((g) => g.key === k);
1227
+ const C = l[k], N = d?.find((f) => f.key === k);
1228
1228
  return !C && !N ? (console.warn(`Property ${k} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
1229
1229
  ai,
1230
1230
  {
1231
1231
  draggableId: `array_field_${r}_${k}}`,
1232
1232
  index: b,
1233
- children: (g, w) => /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
1233
+ children: (f, w) => /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
1234
1234
  ki,
1235
1235
  {
1236
1236
  propertyKey: k,
1237
1237
  propertyOrBuilder: C,
1238
1238
  additionalField: N,
1239
- provided: g,
1240
- errors: u,
1239
+ provided: f,
1240
+ errors: p,
1241
1241
  namespace: r,
1242
- inferredPropertyKeys: s,
1243
- onPropertyMove: p,
1242
+ inferredPropertyKeys: c,
1243
+ onPropertyMove: u,
1244
1244
  onPropertyRemove: h,
1245
1245
  onPropertyClick: w.isDragging ? void 0 : i,
1246
1246
  selectedPropertyKey: n,
1247
- collectionEditable: f
1247
+ collectionEditable: g
1248
1248
  }
1249
1249
  ) })
1250
1250
  },
@@ -1258,7 +1258,7 @@ const ft = Y.memo(
1258
1258
  },
1259
1259
  (t, r) => {
1260
1260
  const n = r.selectedPropertyKey?.startsWith(r.namespace ?? ""), i = t.selectedPropertyKey?.startsWith(t.namespace ?? "");
1261
- return n || i ? !1 : ve(t.properties, r.properties) && t.propertiesOrder === r.propertiesOrder && ve(t.additionalFields, r.additionalFields) && ve(t.errors, r.errors) && ve(t.onPropertyClick, r.onPropertyClick) && // equal(prevProps.onPropertyMove, nextProps.onPropertyMove) &&
1261
+ return n || i ? !1 : ye(t.properties, r.properties) && t.propertiesOrder === r.propertiesOrder && ye(t.additionalFields, r.additionalFields) && ye(t.errors, r.errors) && ye(t.onPropertyClick, r.onPropertyClick) && // equal(prevProps.onPropertyMove, nextProps.onPropertyMove) &&
1262
1262
  // equal(prevProps.onPropertyRemove, nextProps.onPropertyRemove) &&
1263
1263
  t.namespace === r.namespace && t.collectionEditable === r.collectionEditable;
1264
1264
  }
@@ -1271,13 +1271,13 @@ function ki({
1271
1271
  provided: l,
1272
1272
  selectedPropertyKey: o,
1273
1273
  errors: d,
1274
- onPropertyClick: u,
1275
- onPropertyMove: p,
1274
+ onPropertyClick: p,
1275
+ onPropertyMove: u,
1276
1276
  onPropertyRemove: h,
1277
1277
  inferredPropertyKeys: m,
1278
- collectionEditable: s
1278
+ collectionEditable: c
1279
1279
  }) {
1280
- const f = m?.includes(r ? `${r}.${t}` : t), v = ae(t, r), y = ir(t, r) in d;
1280
+ const g = m?.includes(r ? `${r}.${t}` : t), v = ae(t, r), y = ir(t, r) in d;
1281
1281
  let P;
1282
1282
  if (typeof n == "object") {
1283
1283
  const C = n;
@@ -1289,14 +1289,14 @@ function ki({
1289
1289
  properties: C.properties,
1290
1290
  propertiesOrder: C.propertiesOrder,
1291
1291
  errors: d,
1292
- onPropertyClick: u,
1293
- onPropertyMove: p,
1292
+ onPropertyClick: p,
1293
+ onPropertyMove: u,
1294
1294
  onPropertyRemove: h,
1295
- collectionEditable: s
1295
+ collectionEditable: c
1296
1296
  }
1297
1297
  ));
1298
1298
  }
1299
- const k = o === v, b = n && (s && !ne(n) || qe(n));
1299
+ const k = o === v, b = n && (c && !ne(n) || qe(n));
1300
1300
  return /* @__PURE__ */ a(
1301
1301
  "div",
1302
1302
  {
@@ -1320,7 +1320,7 @@ function ki({
1320
1320
  nr,
1321
1321
  {
1322
1322
  property: n,
1323
- onClick: u ? () => u(t, r) : void 0,
1323
+ onClick: p ? () => p(t, r) : void 0,
1324
1324
  includeName: !0,
1325
1325
  selected: k,
1326
1326
  hasError: y
@@ -1330,12 +1330,12 @@ function ki({
1330
1330
  {
1331
1331
  name: t,
1332
1332
  property: n,
1333
- onClick: u ? () => u(t, r) : void 0,
1333
+ onClick: p ? () => p(t, r) : void 0,
1334
1334
  selected: k
1335
1335
  }
1336
1336
  ),
1337
1337
  /* @__PURE__ */ a("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
1338
- f && /* @__PURE__ */ e(te, { title: "Inferred property", children: /* @__PURE__ */ e(ht, { size: "small", className: "p-2" }) }),
1338
+ g && /* @__PURE__ */ e(te, { title: "Inferred property", children: /* @__PURE__ */ e(ht, { size: "small", className: "p-2" }) }),
1339
1339
  h && /* @__PURE__ */ e(te, { title: "Remove", children: /* @__PURE__ */ e(
1340
1340
  oe,
1341
1341
  {
@@ -1345,7 +1345,7 @@ function ki({
1345
1345
  children: /* @__PURE__ */ e(Ur, { size: "small" })
1346
1346
  }
1347
1347
  ) }),
1348
- p && /* @__PURE__ */ e(te, { title: "Move", children: /* @__PURE__ */ e(
1348
+ u && /* @__PURE__ */ e(te, { title: "Move", children: /* @__PURE__ */ e(
1349
1349
  oe,
1350
1350
  {
1351
1351
  component: "span",
@@ -1363,28 +1363,28 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1363
1363
  const {
1364
1364
  values: o,
1365
1365
  setFieldValue: d
1366
- } = K(), [u, p] = $(!1), [h, m] = $(), [s, f] = $(), v = o.propertiesOrder ?? Object.keys(o.properties ?? {}), x = ({
1366
+ } = K(), [p, u] = $(!1), [h, m] = $(), [c, g] = $(), v = o.propertiesOrder ?? Object.keys(o.properties ?? {}), x = ({
1367
1367
  id: N,
1368
- property: g
1368
+ property: f
1369
1369
  }) => {
1370
1370
  if (!N)
1371
1371
  throw Error();
1372
1372
  d("properties", {
1373
1373
  ...o.properties ?? {},
1374
- [N]: g
1374
+ [N]: f
1375
1375
  }, !1);
1376
1376
  const w = o.propertiesOrder ?? Object.keys(o.properties ?? {}), _ = w.includes(N) ? w : [...w, N];
1377
- d("propertiesOrder", _, !1), p(!1);
1378
- }, y = Q((N, g) => {
1379
- const w = N ? ae(N, g) : void 0;
1377
+ d("propertiesOrder", _, !1), u(!1);
1378
+ }, y = Q((N, f) => {
1379
+ const w = N ? ae(N, f) : void 0;
1380
1380
  if (!w)
1381
1381
  throw Error("collection editor miss config");
1382
- const _ = he(w), M = ye(g), R = I(o, M) ?? Object.keys(I(o, bi(g)));
1383
- d(_, void 0, !1), d(M, R.filter((D) => D !== N), !1), p(!1), m(void 0), f(void 0);
1384
- }, [d, o]), P = h ? ae(h, s) : void 0, k = P ? I(o.properties, P.replaceAll(".", ".properties.")) : void 0, b = !v || v.length < 1, C = Q((N, g) => {
1385
- d(ye(g), N, !1);
1382
+ const _ = he(w), M = be(f), U = I(o, M) ?? Object.keys(I(o, bi(f)));
1383
+ d(_, void 0, !1), d(M, U.filter((D) => D !== N), !1), u(!1), m(void 0), g(void 0);
1384
+ }, [d, o]), P = h ? ae(h, c) : void 0, k = P ? I(o.properties, P.replaceAll(".", ".properties.")) : void 0, b = !v || v.length < 1, C = Q((N, f) => {
1385
+ d(be(f), N, !1);
1386
1386
  }, []);
1387
- return /* @__PURE__ */ a(j, { children: [
1387
+ return /* @__PURE__ */ a(R, { children: [
1388
1388
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
1389
1389
  /* @__PURE__ */ a("div", { className: "flex justify-between items-end my-4", children: [
1390
1390
  /* @__PURE__ */ e(O, { variant: "subtitle2", children: "Properties in this group" }),
@@ -1393,7 +1393,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1393
1393
  {
1394
1394
  color: "primary",
1395
1395
  variant: "outlined",
1396
- onClick: () => p(!0),
1396
+ onClick: () => u(!0),
1397
1397
  startIcon: /* @__PURE__ */ e(se, {}),
1398
1398
  children: [
1399
1399
  "Add property to ",
@@ -1402,7 +1402,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1402
1402
  }
1403
1403
  )
1404
1404
  ] }),
1405
- /* @__PURE__ */ a(Ce, { className: "p-2 pl-8", children: [
1405
+ /* @__PURE__ */ a(Pe, { className: "p-2 pl-8", children: [
1406
1406
  /* @__PURE__ */ e(
1407
1407
  ft,
1408
1408
  {
@@ -1410,8 +1410,8 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1410
1410
  propertiesOrder: v,
1411
1411
  errors: {},
1412
1412
  collectionEditable: l,
1413
- onPropertyClick: (N, g) => {
1414
- m(N), f(g), p(!0);
1413
+ onPropertyClick: (N, f) => {
1414
+ m(N), g(f), u(!0);
1415
1415
  },
1416
1416
  onPropertyMove: C
1417
1417
  }
@@ -1440,23 +1440,23 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1440
1440
  /* @__PURE__ */ e(X, { children: "Set this flag to true if you want to display the children of this group as individual columns." })
1441
1441
  ] }),
1442
1442
  /* @__PURE__ */ e(
1443
- Ve,
1443
+ Ie,
1444
1444
  {
1445
1445
  inArray: !1,
1446
1446
  forceShowErrors: !1,
1447
- open: u,
1447
+ open: p,
1448
1448
  allowDataInference: n,
1449
1449
  collectionEditable: l,
1450
1450
  onCancel: () => {
1451
- p(!1), m(void 0), f(void 0);
1451
+ u(!1), m(void 0), g(void 0);
1452
1452
  },
1453
1453
  onOkClicked: () => {
1454
- p(!1), m(void 0), f(void 0);
1454
+ u(!1), m(void 0), g(void 0);
1455
1455
  },
1456
1456
  getData: r,
1457
1457
  onDelete: y,
1458
1458
  propertyKey: h,
1459
- propertyNamespace: s,
1459
+ propertyNamespace: c,
1460
1460
  property: k,
1461
1461
  existingProperty: !!h,
1462
1462
  autoUpdateId: !h,
@@ -1478,15 +1478,15 @@ function Vi({
1478
1478
  collectionEditable: d
1479
1479
  }) {
1480
1480
  const {
1481
- values: u,
1482
- handleChange: p,
1481
+ values: p,
1482
+ handleChange: u,
1483
1483
  errors: h,
1484
1484
  setFieldValue: m,
1485
- touched: s
1486
- } = K(), [f, v] = $(!1), x = I(u, "of"), y = I(s, "of") && I(h, "of"), P = ({ id: b, property: C, namespace: N }) => {
1485
+ touched: c
1486
+ } = K(), [g, v] = $(!1), x = I(p, "of"), y = I(c, "of") && I(h, "of"), P = ({ id: b, property: C, namespace: N }) => {
1487
1487
  console.log("onPropertyChanged", b, C, N), m("of", C);
1488
1488
  }, k = x && $e(x, o);
1489
- return /* @__PURE__ */ a(j, { children: [
1489
+ return /* @__PURE__ */ a(R, { children: [
1490
1490
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
1491
1491
  /* @__PURE__ */ e(O, { variant: "subtitle2", children: "Repeat component" }),
1492
1492
  /* @__PURE__ */ e(
@@ -1494,7 +1494,7 @@ function Vi({
1494
1494
  {
1495
1495
  name: "of",
1496
1496
  value: x,
1497
- children: ({}) => /* @__PURE__ */ a(Ce, { className: "p-2 mt-4", children: [
1497
+ children: ({}) => /* @__PURE__ */ a(Pe, { className: "p-2 mt-4", children: [
1498
1498
  x && /* @__PURE__ */ e(
1499
1499
  nr,
1500
1500
  {
@@ -1520,10 +1520,10 @@ function Vi({
1520
1520
  }
1521
1521
  ),
1522
1522
  /* @__PURE__ */ e(
1523
- Ve,
1523
+ Ie,
1524
1524
  {
1525
1525
  inArray: !0,
1526
- open: f,
1526
+ open: g,
1527
1527
  existingProperty: r,
1528
1528
  getData: i,
1529
1529
  autoUpdateId: !r,
@@ -1542,7 +1542,7 @@ function Vi({
1542
1542
  }
1543
1543
  )
1544
1544
  ] }),
1545
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(Ot, { disabled: n }) }) })
1545
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Ot, { disabled: n }) }) })
1546
1546
  ] });
1547
1547
  }
1548
1548
  const Ii = Y.forwardRef(
@@ -1554,13 +1554,13 @@ const Ii = Y.forwardRef(
1554
1554
  isNewProperty: o
1555
1555
  }, d) {
1556
1556
  const {
1557
- errors: u,
1558
- values: p,
1557
+ errors: p,
1558
+ values: u,
1559
1559
  setFieldValue: h,
1560
1560
  setFieldTouched: m,
1561
- touched: s,
1562
- validate: f
1563
- } = K(), v = "name", x = r && I(u, v), y = "id", P = r && I(u, y), k = "description", b = r && I(u, k);
1561
+ touched: c,
1562
+ validate: g
1563
+ } = K(), v = "name", x = r && I(p, v), y = "id", P = r && I(p, y), k = "description", b = r && I(p, k);
1564
1564
  return /* @__PURE__ */ a("div", { className: "flex flex-col gap-2 col-span-12", children: [
1565
1565
  /* @__PURE__ */ a("div", { children: [
1566
1566
  /* @__PURE__ */ e(
@@ -1569,10 +1569,10 @@ const Ii = Y.forwardRef(
1569
1569
  name: v,
1570
1570
  inputRef: d,
1571
1571
  as: Z,
1572
- value: p[v],
1572
+ value: u[v],
1573
1573
  onChange: (C) => {
1574
1574
  const N = C.target.value;
1575
- !I(s, y) && l && h(y, N ? Pt(N) : "", !1), h(v, N, !0), m(v, !0);
1575
+ !I(c, y) && l && h(y, N ? Pt(N) : "", !1), h(v, N, !0), m(v, !0);
1576
1576
  },
1577
1577
  style: { fontSize: 20 },
1578
1578
  placeholder: "Field name",
@@ -1590,10 +1590,10 @@ const Ii = Y.forwardRef(
1590
1590
  name: y,
1591
1591
  as: Z,
1592
1592
  label: "ID",
1593
- value: p[y],
1593
+ value: u[y],
1594
1594
  onChange: (C) => {
1595
1595
  const N = C.target.value;
1596
- !I(s, v) && l && h(v, N ? ut(N) : ""), h(y, N, !0), m(y, !0);
1596
+ !I(c, v) && l && h(v, N ? ut(N) : ""), h(y, N, !0), m(y, !0);
1597
1597
  },
1598
1598
  disabled: n || i,
1599
1599
  required: !0,
@@ -1625,8 +1625,8 @@ function _i({
1625
1625
  showErrors: n
1626
1626
  }) {
1627
1627
  const { values: i, setFieldValue: l } = K();
1628
- return /* @__PURE__ */ a(j, { children: [
1629
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Ne, { children: [
1628
+ return /* @__PURE__ */ a(R, { children: [
1629
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
1630
1630
  t === "text_field" && /* @__PURE__ */ e(
1631
1631
  Ee,
1632
1632
  {
@@ -1679,7 +1679,7 @@ function _i({
1679
1679
  )
1680
1680
  ] }) }),
1681
1681
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
1682
- Oe,
1682
+ Ve,
1683
1683
  {
1684
1684
  name: "defaultValue",
1685
1685
  disabled: r,
@@ -1694,8 +1694,8 @@ function _i({
1694
1694
  }
1695
1695
  function Fi({ disabled: t }) {
1696
1696
  const { values: r } = K(), n = I(r, "defaultValue");
1697
- return /* @__PURE__ */ a(j, { children: [
1698
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) }),
1697
+ return /* @__PURE__ */ a(R, { children: [
1698
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) }),
1699
1699
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
1700
1700
  H,
1701
1701
  {
@@ -1718,7 +1718,7 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1718
1718
  const {
1719
1719
  values: o,
1720
1720
  setFieldValue: d
1721
- } = K(), [u, p] = $(!1), [h, m] = $(), [s, f] = $(), v = ({
1721
+ } = K(), [p, u] = $(!1), [h, m] = $(), [c, g] = $(), v = ({
1722
1722
  id: C,
1723
1723
  property: N
1724
1724
  }) => {
@@ -1728,21 +1728,21 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1728
1728
  ...o.oneOf?.properties ?? {},
1729
1729
  [C]: N
1730
1730
  }, !1);
1731
- const g = o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), w = g.includes(C) ? g : [...g, C];
1732
- d("oneOf.propertiesOrder", w, !1), p(!1);
1733
- }, x = h ? ae(h, s) : void 0, y = x ? I(o.oneOf?.properties, x.replaceAll(".", ".properties.")) : void 0, P = Q((C, N) => {
1734
- const g = C ? ae(C, N) : void 0;
1735
- if (!g)
1731
+ const f = o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), w = f.includes(C) ? f : [...f, C];
1732
+ d("oneOf.propertiesOrder", w, !1), u(!1);
1733
+ }, x = h ? ae(h, c) : void 0, y = x ? I(o.oneOf?.properties, x.replaceAll(".", ".properties.")) : void 0, P = Q((C, N) => {
1734
+ const f = C ? ae(C, N) : void 0;
1735
+ if (!f)
1736
1736
  throw Error("collection editor miss config");
1737
- d(`oneOf.${he(g)}`, void 0, !1);
1738
- const w = `oneOf.${ye(N)}`, _ = I(o, w);
1739
- d(w, _.filter((M) => M !== C), !1), p(!1), m(void 0), f(void 0);
1737
+ d(`oneOf.${he(f)}`, void 0, !1);
1738
+ const w = `oneOf.${be(N)}`, _ = I(o, w);
1739
+ d(w, _.filter((M) => M !== C), !1), u(!1), m(void 0), g(void 0);
1740
1740
  }, [d, o]), k = /* @__PURE__ */ a(
1741
1741
  z,
1742
1742
  {
1743
1743
  autoFocus: !0,
1744
1744
  color: "primary",
1745
- onClick: () => p(!0),
1745
+ onClick: () => u(!0),
1746
1746
  startIcon: /* @__PURE__ */ e(se, {}),
1747
1747
  children: [
1748
1748
  "Add property to ",
@@ -1750,15 +1750,15 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1750
1750
  ]
1751
1751
  }
1752
1752
  ), b = Q((C, N) => {
1753
- d(`oneOf.${ye(N)}`, C, !1);
1753
+ d(`oneOf.${be(N)}`, C, !1);
1754
1754
  }, []);
1755
- return /* @__PURE__ */ a(j, { children: [
1755
+ return /* @__PURE__ */ a(R, { children: [
1756
1756
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
1757
1757
  /* @__PURE__ */ a("div", { className: "flex justify-between items-end mt-8 mb-4", children: [
1758
1758
  /* @__PURE__ */ e(O, { variant: "subtitle2", children: "Properties in this block" }),
1759
1759
  k
1760
1760
  ] }),
1761
- /* @__PURE__ */ a(Ce, { className: "p-2 pl-8", children: [
1761
+ /* @__PURE__ */ a(Pe, { className: "p-2 pl-8", children: [
1762
1762
  /* @__PURE__ */ e(
1763
1763
  ft,
1764
1764
  {
@@ -1767,7 +1767,7 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1767
1767
  errors: {},
1768
1768
  collectionEditable: l,
1769
1769
  onPropertyClick: t ? void 0 : (C, N) => {
1770
- m(C), f(N), p(!0);
1770
+ m(C), g(N), u(!0);
1771
1771
  },
1772
1772
  onPropertyMove: t ? void 0 : b
1773
1773
  }
@@ -1776,23 +1776,23 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1776
1776
  ] })
1777
1777
  ] }),
1778
1778
  !t && /* @__PURE__ */ e(
1779
- Ve,
1779
+ Ie,
1780
1780
  {
1781
1781
  inArray: !1,
1782
1782
  forceShowErrors: !1,
1783
- open: u,
1783
+ open: p,
1784
1784
  getData: r,
1785
1785
  allowDataInference: n,
1786
1786
  onCancel: () => {
1787
- p(!1), m(void 0), f(void 0);
1787
+ u(!1), m(void 0), g(void 0);
1788
1788
  },
1789
1789
  onOkClicked: () => {
1790
- p(!1), m(void 0), f(void 0);
1790
+ u(!1), m(void 0), g(void 0);
1791
1791
  },
1792
1792
  collectionEditable: l,
1793
1793
  onDelete: P,
1794
1794
  propertyKey: h,
1795
- propertyNamespace: s,
1795
+ propertyNamespace: c,
1796
1796
  property: y,
1797
1797
  existingProperty: !!h,
1798
1798
  autoUpdateId: !h,
@@ -1864,12 +1864,12 @@ function Ei({ disabled: t }) {
1864
1864
  {
1865
1865
  name: "validation.positive",
1866
1866
  type: "checkbox",
1867
- children: ({ field: m, form: s }) => /* @__PURE__ */ e(
1867
+ children: ({ field: m, form: c }) => /* @__PURE__ */ e(
1868
1868
  ce,
1869
1869
  {
1870
1870
  label: "Positive value",
1871
1871
  disabled: t,
1872
- form: s,
1872
+ form: c,
1873
1873
  field: m
1874
1874
  }
1875
1875
  )
@@ -1880,12 +1880,12 @@ function Ei({ disabled: t }) {
1880
1880
  {
1881
1881
  name: "validation.negative",
1882
1882
  type: "checkbox",
1883
- children: ({ field: m, form: s }) => /* @__PURE__ */ e(
1883
+ children: ({ field: m, form: c }) => /* @__PURE__ */ e(
1884
1884
  ce,
1885
1885
  {
1886
1886
  label: "Negative value",
1887
1887
  disabled: t,
1888
- form: s,
1888
+ form: c,
1889
1889
  field: m
1890
1890
  }
1891
1891
  )
@@ -1896,12 +1896,12 @@ function Ei({ disabled: t }) {
1896
1896
  {
1897
1897
  name: "validation.integer",
1898
1898
  type: "checkbox",
1899
- children: ({ field: m, form: s }) => /* @__PURE__ */ e(
1899
+ children: ({ field: m, form: c }) => /* @__PURE__ */ e(
1900
1900
  ce,
1901
1901
  {
1902
1902
  label: "Integer value",
1903
1903
  disabled: t,
1904
- form: s,
1904
+ form: c,
1905
1905
  field: m
1906
1906
  }
1907
1907
  )
@@ -1911,10 +1911,10 @@ function Ei({ disabled: t }) {
1911
1911
  }
1912
1912
  function Ai({ disabled: t }) {
1913
1913
  const { values: r, setFieldValue: n } = K();
1914
- return /* @__PURE__ */ a(j, { children: [
1915
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(Ei, { disabled: t }) }) }),
1914
+ return /* @__PURE__ */ a(R, { children: [
1915
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Ei, { disabled: t }) }) }),
1916
1916
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
1917
- Oe,
1917
+ Ve,
1918
1918
  {
1919
1919
  name: "defaultValue",
1920
1920
  disabled: t,
@@ -1939,14 +1939,14 @@ function jt({
1939
1939
  handleChange: o,
1940
1940
  errors: d
1941
1941
  } = K();
1942
- if (!Pe())
1942
+ if (!Ne())
1943
1943
  return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(De, {}) });
1944
- const p = r ? "of.path" : "path", h = I(l, p), m = i && I(d, p);
1945
- return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
1944
+ const u = r ? "of.path" : "path", h = I(l, u), m = i && I(d, u);
1945
+ return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
1946
1946
  H,
1947
1947
  {
1948
- name: p,
1949
- pathPath: p,
1948
+ name: u,
1949
+ pathPath: u,
1950
1950
  type: "select",
1951
1951
  disabled: t && !!h || n,
1952
1952
  value: h,
@@ -1964,15 +1964,15 @@ function Di({
1964
1964
  error: l,
1965
1965
  ...o
1966
1966
  }) {
1967
- const d = Pe();
1967
+ const d = Ne();
1968
1968
  if (!d)
1969
1969
  return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(De, {}) });
1970
- const u = d?.collections ?? [], p = Array.from(new Set(
1971
- Object.values(u).map((m) => m.group).filter(Boolean)
1972
- ).values()), h = u.filter((m) => !m.group);
1973
- return /* @__PURE__ */ a(j, { children: [
1970
+ const p = d?.collections ?? [], u = Array.from(new Set(
1971
+ Object.values(p).map((m) => m.group).filter(Boolean)
1972
+ ).values()), h = p.filter((m) => !m.group);
1973
+ return /* @__PURE__ */ a(R, { children: [
1974
1974
  /* @__PURE__ */ a(
1975
- be,
1975
+ Ce,
1976
1976
  {
1977
1977
  error: !!l,
1978
1978
  disabled: t,
@@ -1982,42 +1982,42 @@ function Di({
1982
1982
  onChange: i,
1983
1983
  label: "Target collection",
1984
1984
  renderValue: (m) => {
1985
- const s = u.find((f) => f.id === m || f.path === m);
1986
- return s ? /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
1987
- /* @__PURE__ */ e(ot, { collectionOrView: s }),
1985
+ const c = p.find((g) => g.id === m || g.path === m);
1986
+ return c ? /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
1987
+ /* @__PURE__ */ e(ot, { collectionOrView: c }),
1988
1988
  /* @__PURE__ */ e(
1989
1989
  O,
1990
1990
  {
1991
1991
  variant: "subtitle2",
1992
1992
  className: "font-medium ml-4",
1993
- children: s?.name.toUpperCase()
1993
+ children: c?.name.toUpperCase()
1994
1994
  }
1995
1995
  )
1996
1996
  ] }) : null;
1997
1997
  },
1998
1998
  ...o,
1999
1999
  children: [
2000
- p.flatMap((m) => /* @__PURE__ */ e(
2000
+ u.flatMap((m) => /* @__PURE__ */ e(
2001
2001
  At,
2002
2002
  {
2003
2003
  label: m || "Views",
2004
- children: u.filter((s) => s.group === m).map((s) => /* @__PURE__ */ e(
2004
+ children: p.filter((c) => c.group === m).map((c) => /* @__PURE__ */ e(
2005
2005
  ee,
2006
2006
  {
2007
- value: s.id ?? s.path,
2007
+ value: c.id ?? c.path,
2008
2008
  children: /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
2009
- /* @__PURE__ */ e(ot, { collectionOrView: s }),
2009
+ /* @__PURE__ */ e(ot, { collectionOrView: c }),
2010
2010
  /* @__PURE__ */ e(
2011
2011
  O,
2012
2012
  {
2013
2013
  variant: "subtitle2",
2014
2014
  className: "font-medium ml-4",
2015
- children: s?.name.toUpperCase()
2015
+ children: c?.name.toUpperCase()
2016
2016
  }
2017
2017
  )
2018
2018
  ] })
2019
2019
  },
2020
- `${s.id ?? s.path}-${m}`
2020
+ `${c.id ?? c.path}-${m}`
2021
2021
  ))
2022
2022
  },
2023
2023
  `group_${m}`
@@ -2052,19 +2052,19 @@ function Bi({ disabled: t }) {
2052
2052
  errors: n,
2053
2053
  touched: i,
2054
2054
  setFieldValue: l
2055
- } = K(), o = "mode", d = I(r, o), u = I(i, o) && I(n, o), p = "autoValue", h = I(r, p), m = I(i, p) && I(n, p);
2056
- return /* @__PURE__ */ a(j, { children: [
2055
+ } = K(), o = "mode", d = I(r, o), p = I(i, o) && I(n, o), u = "autoValue", h = I(r, u), m = I(i, u) && I(n, u);
2056
+ return /* @__PURE__ */ a(R, { children: [
2057
2057
  /* @__PURE__ */ a("div", { className: "flex flex-col col-span-12", children: [
2058
2058
  /* @__PURE__ */ a(
2059
- be,
2059
+ Ce,
2060
2060
  {
2061
2061
  name: o,
2062
2062
  value: d ?? "date",
2063
- error: !!u,
2064
- onValueChange: (s) => l(o, s),
2063
+ error: !!p,
2064
+ onValueChange: (c) => l(o, c),
2065
2065
  label: "Mode",
2066
- renderValue: (s) => {
2067
- switch (s) {
2066
+ renderValue: (c) => {
2067
+ switch (c) {
2068
2068
  case "date_time":
2069
2069
  return "Date/Time";
2070
2070
  case "date":
@@ -2080,16 +2080,16 @@ function Bi({ disabled: t }) {
2080
2080
  ]
2081
2081
  }
2082
2082
  ),
2083
- /* @__PURE__ */ e(X, { error: !!u, children: u }),
2083
+ /* @__PURE__ */ e(X, { error: !!p, children: p }),
2084
2084
  /* @__PURE__ */ a(
2085
- be,
2085
+ Ce,
2086
2086
  {
2087
- name: p,
2087
+ name: u,
2088
2088
  disabled: t,
2089
2089
  value: h ?? "",
2090
- onValueChange: (s) => l(p, s === "none" ? null : s),
2091
- renderValue: (s) => {
2092
- switch (s) {
2090
+ onValueChange: (c) => l(u, c === "none" ? null : c),
2091
+ renderValue: (c) => {
2092
+ switch (c) {
2093
2093
  case "on_create":
2094
2094
  return "On create";
2095
2095
  case "on_update":
@@ -2109,7 +2109,7 @@ function Bi({ disabled: t }) {
2109
2109
  ),
2110
2110
  /* @__PURE__ */ e(X, { error: !!m, children: m ?? "Update this field automatically when creating or updating the entity" })
2111
2111
  ] }),
2112
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) })
2112
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) })
2113
2113
  ] });
2114
2114
  }
2115
2115
  function zi({ disabled: t }) {
@@ -2144,7 +2144,7 @@ function zi({ disabled: t }) {
2144
2144
  ] });
2145
2145
  }
2146
2146
  function Mi({ disabled: t }) {
2147
- return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) }) });
2147
+ return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) }) });
2148
2148
  }
2149
2149
  function ar(t, r, n) {
2150
2150
  let i;
@@ -2397,9 +2397,9 @@ function Ri({
2397
2397
  showErrors: r
2398
2398
  }) {
2399
2399
  const { values: n, setFieldValue: i } = K(), l = I(n, "url");
2400
- return /* @__PURE__ */ a(j, { children: [
2400
+ return /* @__PURE__ */ a(R, { children: [
2401
2401
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
2402
- be,
2402
+ Ce,
2403
2403
  {
2404
2404
  disabled: t,
2405
2405
  position: "item-aligned",
@@ -2428,7 +2428,7 @@ function Ri({
2428
2428
  ]
2429
2429
  }
2430
2430
  ) }),
2431
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
2431
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(
2432
2432
  Ee,
2433
2433
  {
2434
2434
  disabled: t,
@@ -2439,7 +2439,7 @@ function Ri({
2439
2439
  }
2440
2440
  ) }) }),
2441
2441
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2442
- Oe,
2442
+ Ve,
2443
2443
  {
2444
2444
  name: "defaultValue",
2445
2445
  disabled: t,
@@ -2481,12 +2481,12 @@ const Ui = [
2481
2481
  existingProperty: l,
2482
2482
  autoUpdateId: o,
2483
2483
  inArray: d,
2484
- propertyKey: u,
2485
- existingPropertyKeys: p,
2484
+ propertyKey: p,
2485
+ existingPropertyKeys: u,
2486
2486
  propertyNamespace: h,
2487
2487
  property: m,
2488
- onPropertyChanged: s,
2489
- onPropertyChangedImmediate: f = !0,
2488
+ onPropertyChanged: c,
2489
+ onPropertyChangedImmediate: g = !0,
2490
2490
  onDelete: v,
2491
2491
  onError: x,
2492
2492
  initialErrors: y,
@@ -2495,60 +2495,60 @@ const Ui = [
2495
2495
  getController: b,
2496
2496
  getData: C,
2497
2497
  propertyConfigs: N,
2498
- collectionEditable: g
2498
+ collectionEditable: f
2499
2499
  } = r, w = {
2500
2500
  id: "",
2501
2501
  name: ""
2502
- }, _ = !!(m && !qe(m)) && !g, M = Le(m ? {
2503
- id: u,
2504
- previousId: u,
2502
+ }, _ = !!(m && !qe(m)) && !f, M = Le(m ? {
2503
+ id: p,
2504
+ previousId: p,
2505
2505
  property: m
2506
- } : void 0), R = ({
2506
+ } : void 0), U = ({
2507
2507
  id: A,
2508
- property: c
2508
+ property: s
2509
2509
  }) => {
2510
2510
  const V = {
2511
2511
  id: A,
2512
2512
  previousId: M.current?.id,
2513
- property: c,
2513
+ property: s,
2514
2514
  namespace: h
2515
2515
  };
2516
- M.current = V, s?.(V);
2516
+ M.current = V, c?.(V);
2517
2517
  }, D = Tt({
2518
- initialValues: m ? { id: u, ...m } : w,
2518
+ initialValues: m ? { id: p, ...m } : w,
2519
2519
  initialErrors: y,
2520
2520
  validateOnChange: !0,
2521
2521
  validateOnInitialRender: !0,
2522
- onSubmit: (A, c) => {
2522
+ onSubmit: (A, s) => {
2523
2523
  console.debug("onSubmit", A);
2524
2524
  const {
2525
2525
  id: V,
2526
2526
  ...G
2527
2527
  } = A;
2528
- R({
2528
+ U({
2529
2529
  id: V,
2530
2530
  property: { ...G, editable: G.editable ?? !0 }
2531
- }), l || c.resetForm({ values: w });
2531
+ }), l || s.resetForm({ values: w });
2532
2532
  },
2533
2533
  validation: (A) => {
2534
- const c = {};
2534
+ const s = {};
2535
2535
  if (n) {
2536
2536
  if (!A.name)
2537
- c.name = "Required";
2537
+ s.name = "Required";
2538
2538
  else {
2539
2539
  const V = $i(A.name);
2540
- V && (c.name = V);
2540
+ V && (s.name = V);
2541
2541
  }
2542
2542
  if (!A.id)
2543
- c.id = "Required";
2543
+ s.id = "Required";
2544
2544
  else {
2545
- const V = qi(A.id, p);
2546
- V && (c.id = V);
2545
+ const V = qi(A.id, u);
2546
+ V && (s.id = V);
2547
2547
  }
2548
2548
  }
2549
- return A.dataType === "string" && A.validation?.matches && !Pr(A.validation?.matches.toString()) && (c.validation = {
2549
+ return A.dataType === "string" && A.validation?.matches && !Pr(A.validation?.matches.toString()) && (s.validation = {
2550
2550
  matches: "Invalid regular expression"
2551
- }), A.dataType === "reference" && !A.path && (c.path = "You must specify a target collection for the field"), A.propertyConfig === "repeat" && (A.of || (c.of = "You need to specify a repeat field")), A.propertyConfig === "block" && (A.oneOf || (c.oneOf = "You need to specify the properties of this block")), c;
2551
+ }), A.dataType === "reference" && !A.path && (s.path = "You must specify a target collection for the field"), A.propertyConfig === "repeat" && (A.of || (s.of = "You need to specify a repeat field")), A.propertyConfig === "block" && (A.oneOf || (s.oneOf = "You need to specify the properties of this block")), s;
2552
2552
  }
2553
2553
  });
2554
2554
  return de(() => {
@@ -2556,7 +2556,7 @@ const Ui = [
2556
2556
  }, [D, b]), /* @__PURE__ */ e(kt, { value: D, children: /* @__PURE__ */ e(
2557
2557
  ji,
2558
2558
  {
2559
- onPropertyChanged: f ? R : void 0,
2559
+ onPropertyChanged: g ? U : void 0,
2560
2560
  onDelete: v,
2561
2561
  includeIdAndTitle: n,
2562
2562
  propertyNamespace: h,
@@ -2570,14 +2570,14 @@ const Ui = [
2570
2570
  getData: C,
2571
2571
  allowDataInference: k,
2572
2572
  propertyConfigs: N,
2573
- collectionEditable: g,
2573
+ collectionEditable: f,
2574
2574
  ...D
2575
2575
  }
2576
2576
  ) });
2577
2577
  },
2578
2578
  (t, r) => t.getData === r.getData && t.propertyKey === r.propertyKey && t.propertyNamespace === r.propertyNamespace && t.includeIdAndName === r.includeIdAndName && t.autoOpenTypeSelect === r.autoOpenTypeSelect && t.autoUpdateId === r.autoUpdateId && t.existingProperty === r.existingProperty
2579
2579
  );
2580
- function Ve({
2580
+ function Ie({
2581
2581
  open: t,
2582
2582
  onCancel: r,
2583
2583
  onOkClicked: n,
@@ -2586,7 +2586,7 @@ function Ve({
2586
2586
  collectionEditable: o,
2587
2587
  ...d
2588
2588
  }) {
2589
- const u = Le();
2589
+ const p = Le();
2590
2590
  return /* @__PURE__ */ e(
2591
2591
  Fe,
2592
2592
  {
@@ -2599,7 +2599,7 @@ function Ve({
2599
2599
  noValidate: !0,
2600
2600
  autoComplete: "off",
2601
2601
  onSubmit: (h) => {
2602
- h.preventDefault(), h.stopPropagation(), u.current?.handleSubmit(h);
2602
+ h.preventDefault(), h.stopPropagation(), p.current?.handleSubmit(h);
2603
2603
  },
2604
2604
  children: [
2605
2605
  /* @__PURE__ */ e(Be, { children: /* @__PURE__ */ e(
@@ -2612,7 +2612,7 @@ function Ve({
2612
2612
  collectionEditable: o,
2613
2613
  onPropertyChangedImmediate: !1,
2614
2614
  getController: (h) => {
2615
- u.current = h;
2615
+ p.current = h;
2616
2616
  },
2617
2617
  getData: l
2618
2618
  }
@@ -2623,7 +2623,7 @@ function Ve({
2623
2623
  {
2624
2624
  variant: "text",
2625
2625
  onClick: () => {
2626
- r(), u.current?.resetForm();
2626
+ r(), p.current?.resetForm();
2627
2627
  },
2628
2628
  children: "Cancel"
2629
2629
  }
@@ -2652,32 +2652,32 @@ function ji({
2652
2652
  autoUpdateId: l = !1,
2653
2653
  autoOpenTypeSelect: o,
2654
2654
  includeIdAndTitle: d,
2655
- onPropertyChanged: u,
2656
- onDelete: p,
2655
+ onPropertyChanged: p,
2656
+ onDelete: u,
2657
2657
  propertyNamespace: h,
2658
2658
  onError: m,
2659
- showErrors: s,
2660
- disabled: f,
2659
+ showErrors: c,
2660
+ disabled: g,
2661
2661
  inArray: v,
2662
2662
  getData: x,
2663
2663
  allowDataInference: y,
2664
2664
  propertyConfigs: P,
2665
2665
  collectionEditable: k
2666
2666
  }) {
2667
- const [b, C] = $(o), [N, g] = $(!1), [w, _] = $(t?.dataType ? Kt(t) : void 0), M = Object.entries(lr).concat(Object.entries(P)), R = v ? M.filter(([q, L]) => !ne(L.property) && L.property?.dataType !== "array") : M, D = Ir(t), A = Le(null), c = Le(t), V = s && I(r, "selectedWidget");
2667
+ const [b, C] = $(o), [N, f] = $(!1), [w, _] = $(t?.dataType ? Kt(t) : void 0), M = Object.entries(lr).concat(Object.entries(P)), U = v ? M.filter(([q, L]) => !ne(L.property) && L.property?.dataType !== "array") : M, D = Ir(t), A = Le(null), s = Le(t), V = c && I(r, "selectedWidget");
2668
2668
  de(() => {
2669
- if (u && (!d || D.id)) {
2669
+ if (p && (!d || D.id)) {
2670
2670
  const {
2671
2671
  id: q,
2672
2672
  ...L
2673
2673
  } = D;
2674
- ve(D, c.current) || (u({
2674
+ ye(D, s.current) || (p({
2675
2675
  id: q,
2676
2676
  property: L,
2677
2677
  namespace: h
2678
- }), c.current = D);
2678
+ }), s.current = D);
2679
2679
  }
2680
- }, [D, d, u, h]), de(() => {
2680
+ }, [D, d, p, h]), de(() => {
2681
2681
  t?.id && m && m(t?.id, h, r);
2682
2682
  }, [r, m, h, t?.id]);
2683
2683
  const G = (q) => {
@@ -2690,14 +2690,14 @@ function ji({
2690
2690
  _i,
2691
2691
  {
2692
2692
  widgetId: w,
2693
- disabled: f,
2694
- showErrors: s
2693
+ disabled: g,
2694
+ showErrors: c
2695
2695
  }
2696
2696
  ) : w === "url" ? B = /* @__PURE__ */ e(
2697
2697
  Ri,
2698
2698
  {
2699
- disabled: f,
2700
- showErrors: s
2699
+ disabled: g,
2700
+ showErrors: c
2701
2701
  }
2702
2702
  ) : w === "select" || w === "number_select" ? B = /* @__PURE__ */ e(
2703
2703
  Rt,
@@ -2705,38 +2705,38 @@ function ji({
2705
2705
  multiselect: !1,
2706
2706
  allowDataInference: y,
2707
2707
  updateIds: !i,
2708
- disabled: f,
2708
+ disabled: g,
2709
2709
  getData: x,
2710
- showErrors: s
2710
+ showErrors: c
2711
2711
  }
2712
2712
  ) : w === "multi_select" || w === "multi_number_select" ? B = /* @__PURE__ */ e(
2713
2713
  Rt,
2714
2714
  {
2715
2715
  multiselect: !0,
2716
2716
  updateIds: !i,
2717
- disabled: f,
2717
+ disabled: g,
2718
2718
  allowDataInference: y,
2719
2719
  getData: x,
2720
- showErrors: s
2720
+ showErrors: c
2721
2721
  }
2722
2722
  ) : w === "file_upload" ? B = /* @__PURE__ */ e(
2723
2723
  Ut,
2724
2724
  {
2725
2725
  existing: i,
2726
2726
  multiple: !1,
2727
- disabled: f
2727
+ disabled: g
2728
2728
  }
2729
2729
  ) : w === "multi_file_upload" ? B = /* @__PURE__ */ e(
2730
2730
  Ut,
2731
2731
  {
2732
2732
  existing: i,
2733
2733
  multiple: !0,
2734
- disabled: f
2734
+ disabled: g
2735
2735
  }
2736
- ) : w === "switch" ? B = /* @__PURE__ */ e(Fi, { disabled: f }) : w === "number_input" ? B = /* @__PURE__ */ e(Ai, { disabled: f }) : w === "group" ? B = /* @__PURE__ */ e(
2736
+ ) : w === "switch" ? B = /* @__PURE__ */ e(Fi, { disabled: g }) : w === "number_input" ? B = /* @__PURE__ */ e(Ai, { disabled: g }) : w === "group" ? B = /* @__PURE__ */ e(
2737
2737
  Oi,
2738
2738
  {
2739
- disabled: f,
2739
+ disabled: g,
2740
2740
  getData: x,
2741
2741
  allowDataInference: y,
2742
2742
  collectionEditable: k,
@@ -2745,7 +2745,7 @@ function ji({
2745
2745
  ) : w === "block" ? B = /* @__PURE__ */ e(
2746
2746
  Si,
2747
2747
  {
2748
- disabled: f,
2748
+ disabled: g,
2749
2749
  getData: x,
2750
2750
  allowDataInference: y,
2751
2751
  collectionEditable: k,
@@ -2754,32 +2754,32 @@ function ji({
2754
2754
  ) : w === "reference" ? B = /* @__PURE__ */ e(
2755
2755
  jt,
2756
2756
  {
2757
- showErrors: s,
2757
+ showErrors: c,
2758
2758
  existing: i,
2759
2759
  multiple: !1,
2760
- disabled: f
2760
+ disabled: g
2761
2761
  }
2762
- ) : w === "date_time" ? B = /* @__PURE__ */ e(Bi, { disabled: f }) : w === "multi_references" ? B = /* @__PURE__ */ e(
2762
+ ) : w === "date_time" ? B = /* @__PURE__ */ e(Bi, { disabled: g }) : w === "multi_references" ? B = /* @__PURE__ */ e(
2763
2763
  jt,
2764
2764
  {
2765
- showErrors: s,
2765
+ showErrors: c,
2766
2766
  existing: i,
2767
2767
  multiple: !0,
2768
- disabled: f
2768
+ disabled: g
2769
2769
  }
2770
2770
  ) : w === "repeat" ? B = /* @__PURE__ */ e(
2771
2771
  Vi,
2772
2772
  {
2773
- showErrors: s,
2773
+ showErrors: c,
2774
2774
  existing: i,
2775
2775
  getData: x,
2776
2776
  allowDataInference: y,
2777
- disabled: f,
2777
+ disabled: g,
2778
2778
  collectionEditable: k,
2779
2779
  propertyConfigs: P
2780
2780
  }
2781
- ) : w === "key_value" ? B = /* @__PURE__ */ e(Mi, { disabled: f }) : B = null, /* @__PURE__ */ a(j, { children: [
2782
- f && /* @__PURE__ */ a(Lr, { mode: "warn", children: [
2781
+ ) : w === "key_value" ? B = /* @__PURE__ */ e(Mi, { disabled: g }) : B = null, /* @__PURE__ */ a(R, { children: [
2782
+ g && /* @__PURE__ */ a(Lr, { mode: "warn", children: [
2783
2783
  /* @__PURE__ */ e(O, { children: "This property can't be edited" }),
2784
2784
  /* @__PURE__ */ a(O, { variant: "caption", children: [
2785
2785
  "You may not have permission to edit it or it is defined in code with no ",
@@ -2790,7 +2790,7 @@ function ji({
2790
2790
  /* @__PURE__ */ a("div", { className: "flex mt-2 justify-between", children: [
2791
2791
  /* @__PURE__ */ a("div", { className: "w-full flex flex-col gap-2", children: [
2792
2792
  /* @__PURE__ */ e(
2793
- be,
2793
+ Ce,
2794
2794
  {
2795
2795
  error: !!V,
2796
2796
  value: w ?? "",
@@ -2798,7 +2798,7 @@ function ji({
2798
2798
  open: b,
2799
2799
  onOpenChange: C,
2800
2800
  position: "item-aligned",
2801
- disabled: f,
2801
+ disabled: g,
2802
2802
  renderValue: (q) => {
2803
2803
  if (!q)
2804
2804
  return /* @__PURE__ */ e("em", { children: "Select a property widget" });
@@ -2833,7 +2833,7 @@ function ji({
2833
2833
  onValueChange: (q) => {
2834
2834
  G(q);
2835
2835
  },
2836
- children: R.map(([q, L]) => {
2836
+ children: U.map(([q, L]) => {
2837
2837
  const J = L.property, le = i && !ne(J) && J.dataType !== t?.dataType;
2838
2838
  return /* @__PURE__ */ e(
2839
2839
  or,
@@ -2858,13 +2858,13 @@ function ji({
2858
2858
  }
2859
2859
  )
2860
2860
  ] }),
2861
- p && t?.id && /* @__PURE__ */ e(
2861
+ u && t?.id && /* @__PURE__ */ e(
2862
2862
  oe,
2863
2863
  {
2864
2864
  variant: "ghost",
2865
2865
  className: "m-4",
2866
- disabled: f,
2867
- onClick: () => g(!0),
2866
+ disabled: g,
2867
+ onClick: () => f(!0),
2868
2868
  children: /* @__PURE__ */ e(dt, {})
2869
2869
  }
2870
2870
  )
@@ -2873,23 +2873,23 @@ function ji({
2873
2873
  d && /* @__PURE__ */ e(
2874
2874
  Ii,
2875
2875
  {
2876
- showErrors: s,
2876
+ showErrors: c,
2877
2877
  disabledId: i,
2878
2878
  isNewProperty: !i,
2879
- disabled: f,
2879
+ disabled: g,
2880
2880
  autoUpdateId: l,
2881
2881
  ref: A
2882
2882
  }
2883
2883
  ),
2884
2884
  B,
2885
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(zi, { disabled: f }) })
2885
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(zi, { disabled: g }) })
2886
2886
  ] }),
2887
- p && /* @__PURE__ */ e(
2887
+ u && /* @__PURE__ */ e(
2888
2888
  lt,
2889
2889
  {
2890
2890
  open: N,
2891
- onAccept: () => p(t?.id, h),
2892
- onCancel: () => g(!1),
2891
+ onAccept: () => u(t?.id, h),
2892
+ onCancel: () => f(!1),
2893
2893
  title: /* @__PURE__ */ e("div", { children: "Delete this property?" }),
2894
2894
  body: /* @__PURE__ */ a("div", { children: [
2895
2895
  " This will ",
@@ -2917,7 +2917,7 @@ function Hi({
2917
2917
  onOpenChange: r,
2918
2918
  open: n
2919
2919
  }) {
2920
- const i = Ie(), l = t ? `import { EntityCollection } from "firecms";
2920
+ const i = _e(), l = t ? `import { EntityCollection } from "firecms";
2921
2921
 
2922
2922
  const ` + (t?.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + oi.stringify(cr(t), null, " ") : "No collection selected";
2923
2923
  return /* @__PURE__ */ a(
@@ -2953,10 +2953,10 @@ const ` + (t?.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + oi.
2953
2953
  children: ({
2954
2954
  className: o,
2955
2955
  style: d,
2956
- tokens: u,
2957
- getLineProps: p,
2956
+ tokens: p,
2957
+ getLineProps: u,
2958
2958
  getTokenProps: h
2959
- }) => /* @__PURE__ */ e("pre", { style: d, className: "p-4 rounded text-sm", children: u.map((m, s) => /* @__PURE__ */ e("div", { ...p({ line: m }), children: m.map((f, v) => /* @__PURE__ */ e("span", { ...h({ token: f }) }, v)) }, s)) })
2959
+ }) => /* @__PURE__ */ e("pre", { style: d, className: "p-4 rounded text-sm", children: p.map((m, c) => /* @__PURE__ */ e("div", { ...u({ line: m }), children: m.map((g, v) => /* @__PURE__ */ e("span", { ...h({ token: g }) }, v)) }, c)) })
2960
2960
  }
2961
2961
  )
2962
2962
  ] }),
@@ -3019,25 +3019,25 @@ function Gi({
3019
3019
  setDirty: l,
3020
3020
  reservedGroups: o,
3021
3021
  extraIcon: d,
3022
- getUser: u,
3023
- getData: p,
3022
+ getUser: p,
3023
+ getData: u,
3024
3024
  doCollectionInference: h,
3025
3025
  propertyConfigs: m,
3026
- collectionEditable: s
3026
+ collectionEditable: c
3027
3027
  }) {
3028
3028
  const {
3029
- values: f,
3029
+ values: g,
3030
3030
  setFieldValue: v,
3031
3031
  setFieldError: x,
3032
3032
  setFieldTouched: y,
3033
3033
  errors: P,
3034
3034
  dirty: k
3035
- } = K(), b = Ie(), C = Nr(), N = !C, [g, w] = $(), [_, M] = $(), [R, D] = $(), A = _ ? ae(_, R) : void 0, c = A ? I(f.properties, A.replaceAll(".", ".properties.")) : void 0, [V, G] = $(!1), [B, q] = $(!1), [L, J] = $(!1), [le, Me] = $([]), we = Y.useRef(f.propertiesOrder ? { "": f.propertiesOrder } : {});
3035
+ } = K(), b = _e(), C = Nr(), N = !C, [f, w] = $(), [_, M] = $(), [U, D] = $(), A = _ ? ae(_, U) : void 0, s = A ? I(g.properties, A.replaceAll(".", ".properties.")) : void 0, [V, G] = $(!1), [B, q] = $(!1), [L, J] = $(!1), [le, Me] = $([]), we = Y.useRef(g.propertiesOrder ? { "": g.propertiesOrder } : {});
3036
3036
  de(() => {
3037
3037
  l && l(k);
3038
3038
  }, [k]);
3039
3039
  const ue = h ? () => {
3040
- h && (q(!0), h(f).then((F) => {
3040
+ h && (q(!0), h(g).then((F) => {
3041
3041
  if (F && pt(F.properties), !F) {
3042
3042
  b.open({
3043
3043
  type: "error",
@@ -3045,8 +3045,8 @@ function Gi({
3045
3045
  });
3046
3046
  return;
3047
3047
  }
3048
- const U = (F.properties ? Object.keys(F.properties) : []).filter((E) => !f.properties[E]);
3049
- if (U.length === 0) {
3048
+ const j = (F.properties ? Object.keys(F.properties) : []).filter((E) => !g.properties[E]);
3049
+ if (j.length === 0) {
3050
3050
  b.open({
3051
3051
  type: "info",
3052
3052
  message: "No new properties found in existing data"
@@ -3054,43 +3054,43 @@ function Gi({
3054
3054
  return;
3055
3055
  }
3056
3056
  const T = {
3057
- ...U.reduce((E, ie) => (E[ie] = (F.properties ?? {})[ie], E), {}),
3058
- ...f.properties
3057
+ ...j.reduce((E, ie) => (E[ie] = (F.properties ?? {})[ie], E), {}),
3058
+ ...g.properties
3059
3059
  }, S = [
3060
- ...U,
3061
- ...f.propertiesOrder ?? []
3060
+ ...j,
3061
+ ...g.propertiesOrder ?? []
3062
3062
  ];
3063
- v("properties", T, !1), ge(S), Me(U);
3063
+ v("properties", T, !1), ve(S), Me(j);
3064
3064
  }).finally(() => {
3065
3065
  q(!1);
3066
3066
  }));
3067
- } : void 0, re = Q((F) => F ? we.current[F] ?? I(f, ye(F)) : we.current[""], [f]), ge = Q((F, U) => {
3068
- const T = ye(U);
3069
- v(T, F, !1), we.current[U ?? ""] = F;
3070
- }, [v]), Te = Q((F, U) => {
3071
- const T = F ? ae(F, U) : void 0;
3067
+ } : void 0, re = Q((F) => F ? we.current[F] ?? I(g, be(F)) : we.current[""], [g]), ve = Q((F, j) => {
3068
+ const T = be(j);
3069
+ v(T, F, !1), we.current[j ?? ""] = F;
3070
+ }, [v]), ke = Q((F, j) => {
3071
+ const T = F ? ae(F, j) : void 0;
3072
3072
  if (!T)
3073
3073
  throw Error("collection editor miss config");
3074
3074
  v(he(T), void 0, !1);
3075
- const E = re(U).filter((ie) => ie !== F);
3076
- ge(E, U), J(!1), w(void 0), M(void 0), D(void 0);
3077
- }, [re, v, ge]), Ge = (F, U) => {
3078
- v(ye(U), F, !1);
3075
+ const E = re(j).filter((ie) => ie !== F);
3076
+ ve(E, j), J(!1), w(void 0), M(void 0), D(void 0);
3077
+ }, [re, v, ve]), Ge = (F, j) => {
3078
+ v(be(j), F, !1);
3079
3079
  }, gt = ({
3080
3080
  id: F,
3081
- property: U
3081
+ property: j
3082
3082
  }) => {
3083
3083
  if (!F)
3084
3084
  throw Error("Need to include an ID when creating a new property");
3085
3085
  v("properties", {
3086
- ...f.properties ?? {},
3087
- [F]: U
3086
+ ...g.properties ?? {},
3087
+ [F]: j
3088
3088
  }, !1);
3089
- const T = [...f.propertiesOrder ?? Object.keys(f.properties), F];
3090
- ge(T), J(!1), C && (w(T.indexOf(F)), M(F)), D(void 0);
3089
+ const T = [...g.propertiesOrder ?? Object.keys(g.properties), F];
3090
+ ve(T), J(!1), C && (w(T.indexOf(F)), M(F)), D(void 0);
3091
3091
  }, pe = ({
3092
3092
  id: F,
3093
- property: U,
3093
+ property: j,
3094
3094
  previousId: T,
3095
3095
  namespace: S
3096
3096
  }) => {
@@ -3098,38 +3098,38 @@ function Gi({
3098
3098
  if (T && T !== F) {
3099
3099
  console.debug("onPropertyChanged, id change", {
3100
3100
  id: F,
3101
- property: U,
3101
+ property: j,
3102
3102
  previousId: T,
3103
3103
  namespace: S
3104
3104
  });
3105
- const ke = ae(T, S), Vt = he(ke), It = re(S).map((Xe) => Xe === T ? F : Xe).filter((Xe) => Xe !== void 0);
3106
- ge(It, S), F && (w(It.indexOf(F)), M(F)), v(Vt, void 0, !1), y(Vt, !1, !1);
3105
+ const Oe = ae(T, S), Vt = he(Oe), It = re(S).map((Xe) => Xe === T ? F : Xe).filter((Xe) => Xe !== void 0);
3106
+ ve(It, S), F && (w(It.indexOf(F)), M(F)), v(Vt, void 0, !1), y(Vt, !1, !1);
3107
3107
  }
3108
3108
  console.debug("onPropertyChanged", {
3109
3109
  id: F,
3110
- property: U,
3110
+ property: j,
3111
3111
  previousId: T,
3112
3112
  namespace: S,
3113
3113
  propertyPath: ie
3114
- }), ie && (v(ie, U, !1), y(ie, !0, !1));
3115
- }, Ke = Q((F, U, T) => {
3116
- const S = F ? ae(F, U) : void 0;
3114
+ }), ie && (v(ie, j, !1), y(ie, !0, !1));
3115
+ }, Ke = Q((F, j, T) => {
3116
+ const S = F ? ae(F, j) : void 0;
3117
3117
  if (console.debug("onPropertyErrorInternal", {
3118
3118
  id: F,
3119
- namespace: U,
3119
+ namespace: j,
3120
3120
  error: T,
3121
3121
  propertyPath: S
3122
3122
  }), S) {
3123
3123
  const E = T && Object.keys(T).length > 0;
3124
- i(F, U, E ? T : void 0), x(he(S), E ? "Property error" : void 0);
3124
+ i(F, j, E ? T : void 0), x(he(S), E ? "Property error" : void 0);
3125
3125
  }
3126
3126
  }, []), We = () => {
3127
3127
  w(void 0), M(void 0);
3128
- }, Ze = _ && n?.current?.properties ? n.current.properties[_] : void 0, Je = f?.propertiesOrder === void 0 || f.propertiesOrder.length === 0, Re = f.propertiesOrder ? f.propertiesOrder : Object.keys(f.properties), Qe = Zt(() => f.ownerId ? u(f.ownerId) : null, [u, f.ownerId]), vt = Q((F, U) => {
3128
+ }, Ze = _ && n?.current?.properties ? n.current.properties[_] : void 0, Je = g?.propertiesOrder === void 0 || g.propertiesOrder.length === 0, Re = g.propertiesOrder ? g.propertiesOrder : Object.keys(g.properties), Qe = Zt(() => g.ownerId ? p(g.ownerId) : null, [p, g.ownerId]), vt = Q((F, j) => {
3129
3129
  console.debug("CollectionEditor: onPropertyClick", {
3130
3130
  propertyKey: F,
3131
- namespace: U
3132
- }), w(Re.indexOf(F)), M(F), D(U);
3131
+ namespace: j
3132
+ }), w(Re.indexOf(F)), M(F), D(j);
3133
3133
  }, [Re]), yt = /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
3134
3134
  /* @__PURE__ */ a("div", { className: fe(
3135
3135
  "p-4 md:p-8 pb-20 md:pb-20",
@@ -3200,14 +3200,14 @@ function Gi({
3200
3200
  {
3201
3201
  className: "pl-8",
3202
3202
  inferredPropertyKeys: le,
3203
- selectedPropertyKey: _ ? ae(_, R) : void 0,
3204
- properties: f.properties,
3205
- additionalFields: f.additionalFields,
3203
+ selectedPropertyKey: _ ? ae(_, U) : void 0,
3204
+ properties: g.properties,
3205
+ additionalFields: g.additionalFields,
3206
3206
  propertiesOrder: Re,
3207
3207
  onPropertyClick: vt,
3208
3208
  onPropertyMove: Ge,
3209
- onPropertyRemove: r ? Te : void 0,
3210
- collectionEditable: s,
3209
+ onPropertyRemove: r ? ke : void 0,
3210
+ collectionEditable: c,
3211
3211
  errors: P
3212
3212
  }
3213
3213
  ) }),
@@ -3225,11 +3225,11 @@ function Gi({
3225
3225
  )
3226
3226
  ] }),
3227
3227
  !N && /* @__PURE__ */ e("div", { className: "col-span-12 lg:col-span-7 p-4 md:py-8 md:px-4 h-full overflow-auto pb-20 md:pb-20", children: /* @__PURE__ */ a(
3228
- Ce,
3228
+ Pe,
3229
3229
  {
3230
3230
  className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
3231
3231
  children: [
3232
- A && c && !ne(c) && /* @__PURE__ */ e(
3232
+ A && s && !ne(s) && /* @__PURE__ */ e(
3233
3233
  sr,
3234
3234
  {
3235
3235
  inArray: !1,
@@ -3238,20 +3238,20 @@ function Gi({
3238
3238
  allowDataInference: !r,
3239
3239
  autoOpenTypeSelect: !1,
3240
3240
  propertyKey: _,
3241
- propertyNamespace: R,
3242
- property: c,
3241
+ propertyNamespace: U,
3242
+ property: s,
3243
3243
  onPropertyChanged: pe,
3244
- onDelete: Te,
3244
+ onDelete: ke,
3245
3245
  onError: Ke,
3246
3246
  forceShowErrors: t,
3247
3247
  initialErrors: Ze,
3248
- getData: p,
3248
+ getData: u,
3249
3249
  propertyConfigs: m,
3250
- collectionEditable: s
3250
+ collectionEditable: c
3251
3251
  },
3252
- `edit_view_${g}`
3252
+ `edit_view_${f}`
3253
3253
  ),
3254
- !c && /* @__PURE__ */ a("div", { className: "w-full flex flex-col items-center justify-center h-full gap-4", children: [
3254
+ !s && /* @__PURE__ */ a("div", { className: "w-full flex flex-col items-center justify-center h-full gap-4", children: [
3255
3255
  /* @__PURE__ */ e(O, { variant: "label", className: "", children: Je ? "Now you can add your first property" : "Select a property to edit it" }),
3256
3256
  /* @__PURE__ */ a(
3257
3257
  z,
@@ -3265,39 +3265,39 @@ function Gi({
3265
3265
  }
3266
3266
  )
3267
3267
  ] }),
3268
- c && ne(c) && /* @__PURE__ */ e(O, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
3268
+ s && ne(s) && /* @__PURE__ */ e(O, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
3269
3269
  ]
3270
3270
  }
3271
3271
  ) }),
3272
3272
  N && /* @__PURE__ */ e(
3273
- Ve,
3273
+ Ie,
3274
3274
  {
3275
3275
  inArray: !1,
3276
- open: g !== void 0,
3277
- autoUpdateId: !c,
3276
+ open: f !== void 0,
3277
+ autoUpdateId: !s,
3278
3278
  allowDataInference: !r,
3279
3279
  existingProperty: !0,
3280
3280
  autoOpenTypeSelect: !1,
3281
3281
  propertyKey: _,
3282
- propertyNamespace: R,
3283
- property: c,
3282
+ propertyNamespace: U,
3283
+ property: s,
3284
3284
  onPropertyChanged: pe,
3285
- onDelete: Te,
3285
+ onDelete: ke,
3286
3286
  onError: Ke,
3287
3287
  forceShowErrors: t,
3288
3288
  initialErrors: Ze,
3289
- getData: p,
3289
+ getData: u,
3290
3290
  propertyConfigs: m,
3291
- collectionEditable: s,
3291
+ collectionEditable: c,
3292
3292
  onOkClicked: N ? We : void 0
3293
3293
  },
3294
- `edit_view_${g}`
3294
+ `edit_view_${f}`
3295
3295
  )
3296
3296
  ] });
3297
- return /* @__PURE__ */ a(j, { children: [
3297
+ return /* @__PURE__ */ a(R, { children: [
3298
3298
  yt,
3299
3299
  /* @__PURE__ */ e(
3300
- Ve,
3300
+ Ie,
3301
3301
  {
3302
3302
  inArray: !1,
3303
3303
  existingProperty: !1,
@@ -3307,17 +3307,17 @@ function Gi({
3307
3307
  open: L,
3308
3308
  onCancel: () => J(!1),
3309
3309
  onPropertyChanged: gt,
3310
- getData: p,
3310
+ getData: u,
3311
3311
  allowDataInference: !r,
3312
3312
  propertyConfigs: m,
3313
- collectionEditable: s,
3314
- existingPropertyKeys: f.propertiesOrder
3313
+ collectionEditable: c,
3314
+ existingPropertyKeys: g.propertiesOrder
3315
3315
  }
3316
3316
  ),
3317
3317
  /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
3318
3318
  Hi,
3319
3319
  {
3320
- collection: f,
3320
+ collection: g,
3321
3321
  open: V,
3322
3322
  onOpenChange: G
3323
3323
  }
@@ -3394,10 +3394,10 @@ function Zi({
3394
3394
  getUser: l,
3395
3395
  parentCollectionIds: o
3396
3396
  }) {
3397
- const { entityViews: d } = Ae(), [u, p] = Y.useState(), [h, m] = Y.useState(!1), [s, f] = Y.useState(), [v, x] = Y.useState(), {
3397
+ const { entityViews: d } = Ae(), [p, u] = Y.useState(), [h, m] = Y.useState(!1), [c, g] = Y.useState(), [v, x] = Y.useState(), {
3398
3398
  values: y,
3399
3399
  setFieldValue: P
3400
- } = K(), k = t.subcollections ?? [], b = y.entityViews?.filter((g) => typeof g == "string").map((g) => xr(g, d)).filter(Boolean) ?? [], C = t.entityViews?.filter((g) => typeof g != "string") ?? [], N = b.length + C.length;
3400
+ } = K(), k = t.subcollections ?? [], b = y.entityViews?.filter((f) => typeof f == "string").map((f) => xr(f, d)).filter(Boolean) ?? [], C = t.entityViews?.filter((f) => typeof f != "string") ?? [], N = b.length + C.length;
3401
3401
  return /* @__PURE__ */ a("div", { className: "overflow-auto my-auto", children: [
3402
3402
  /* @__PURE__ */ e(mt, { maxWidth: "2xl", className: "flex flex-col gap-4 p-8 m-auto", children: /* @__PURE__ */ a("div", { className: "flex flex-col gap-16", children: [
3403
3403
  /* @__PURE__ */ a("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
@@ -3405,20 +3405,20 @@ function Zi({
3405
3405
  "Subcollections of ",
3406
3406
  y.name
3407
3407
  ] }),
3408
- /* @__PURE__ */ a(Ce, { className: "flex flex-col gap-4 p-2 w-full", children: [
3409
- k && k.length > 0 && /* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ e(Bt, { children: k.map((g) => /* @__PURE__ */ a(
3408
+ /* @__PURE__ */ a(Pe, { className: "flex flex-col gap-4 p-2 w-full", children: [
3409
+ k && k.length > 0 && /* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ e(Bt, { children: k.map((f) => /* @__PURE__ */ a(
3410
3410
  bt,
3411
3411
  {
3412
3412
  onClick: () => x({
3413
3413
  isNewCollection: !1,
3414
- editedCollectionId: g.id
3414
+ editedCollectionId: f.id
3415
3415
  }),
3416
3416
  children: [
3417
3417
  /* @__PURE__ */ e(
3418
3418
  Ue,
3419
3419
  {
3420
3420
  align: "left",
3421
- children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: g.name })
3421
+ children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: f.name })
3422
3422
  }
3423
3423
  ),
3424
3424
  /* @__PURE__ */ e(
@@ -3430,7 +3430,7 @@ function Zi({
3430
3430
  {
3431
3431
  size: "small",
3432
3432
  onClick: (w) => {
3433
- w.preventDefault(), w.stopPropagation(), p(g.id);
3433
+ w.preventDefault(), w.stopPropagation(), u(f.id);
3434
3434
  },
3435
3435
  color: "inherit",
3436
3436
  children: /* @__PURE__ */ e(dt, { size: "small" })
@@ -3440,7 +3440,7 @@ function Zi({
3440
3440
  )
3441
3441
  ]
3442
3442
  },
3443
- g.path
3443
+ f.path
3444
3444
  )) }) }),
3445
3445
  /* @__PURE__ */ e(
3446
3446
  z,
@@ -3471,14 +3471,14 @@ function Zi({
3471
3471
  children: "More info"
3472
3472
  }
3473
3473
  ), children: "Define your own custom views by uploading them with the CLI." }),
3474
- /* @__PURE__ */ e(j, { children: /* @__PURE__ */ a(Ce, { className: "flex flex-col gap-4 p-2 w-full", children: [
3474
+ /* @__PURE__ */ e(R, { children: /* @__PURE__ */ a(Pe, { className: "flex flex-col gap-4 p-2 w-full", children: [
3475
3475
  /* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ a(Bt, { children: [
3476
- b.map((g) => /* @__PURE__ */ a(bt, { children: [
3476
+ b.map((f) => /* @__PURE__ */ a(bt, { children: [
3477
3477
  /* @__PURE__ */ e(
3478
3478
  Ue,
3479
3479
  {
3480
3480
  align: "left",
3481
- children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: g.name })
3481
+ children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: f.name })
3482
3482
  }
3483
3483
  ),
3484
3484
  /* @__PURE__ */ e(
@@ -3490,7 +3490,7 @@ function Zi({
3490
3490
  {
3491
3491
  size: "small",
3492
3492
  onClick: (w) => {
3493
- w.preventDefault(), w.stopPropagation(), f(g.key);
3493
+ w.preventDefault(), w.stopPropagation(), g(f.key);
3494
3494
  },
3495
3495
  color: "inherit",
3496
3496
  children: /* @__PURE__ */ e(dt, { size: "small" })
@@ -3498,20 +3498,20 @@ function Zi({
3498
3498
  ) })
3499
3499
  }
3500
3500
  )
3501
- ] }, g.key)),
3502
- C.map((g) => /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ a(
3501
+ ] }, f.key)),
3502
+ C.map((f) => /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ a(
3503
3503
  Ue,
3504
3504
  {
3505
3505
  align: "left",
3506
3506
  children: [
3507
- /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: g.name }),
3507
+ /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: f.name }),
3508
3508
  /* @__PURE__ */ a(O, { variant: "caption", className: "flex-grow", children: [
3509
3509
  "This view is defined in code with key ",
3510
- /* @__PURE__ */ e("code", { children: g.key })
3510
+ /* @__PURE__ */ e("code", { children: f.key })
3511
3511
  ] })
3512
3512
  ]
3513
3513
  }
3514
- ) }, g.key))
3514
+ ) }, f.key))
3515
3515
  ] }) }),
3516
3516
  /* @__PURE__ */ e(
3517
3517
  z,
@@ -3528,36 +3528,36 @@ function Zi({
3528
3528
  ] })
3529
3529
  ] }) }),
3530
3530
  /* @__PURE__ */ e("div", { style: { height: "52px" } }),
3531
- u && /* @__PURE__ */ e(
3531
+ p && /* @__PURE__ */ e(
3532
3532
  lt,
3533
3533
  {
3534
- open: !!u,
3534
+ open: !!p,
3535
3535
  onAccept: () => {
3536
- const g = {
3537
- id: u,
3536
+ const f = {
3537
+ id: p,
3538
3538
  parentCollectionIds: [...o ?? [], t.id]
3539
3539
  };
3540
- console.debug("Deleting subcollection", g), n.deleteCollection(g), p(void 0);
3540
+ console.debug("Deleting subcollection", f), n.deleteCollection(f), u(void 0);
3541
3541
  },
3542
- onCancel: () => p(void 0),
3543
- title: /* @__PURE__ */ e(j, { children: "Delete this subcollection?" }),
3544
- body: /* @__PURE__ */ a(j, { children: [
3542
+ onCancel: () => u(void 0),
3543
+ title: /* @__PURE__ */ e(R, { children: "Delete this subcollection?" }),
3544
+ body: /* @__PURE__ */ a(R, { children: [
3545
3545
  " This will ",
3546
3546
  /* @__PURE__ */ e("b", { children: "not delete any data" }),
3547
3547
  ", only the collection in the CMS"
3548
3548
  ] })
3549
3549
  }
3550
3550
  ),
3551
- s && /* @__PURE__ */ e(
3551
+ c && /* @__PURE__ */ e(
3552
3552
  lt,
3553
3553
  {
3554
- open: !!s,
3554
+ open: !!c,
3555
3555
  onAccept: () => {
3556
- P("entityViews", y.entityViews?.filter((g) => g !== s)), f(void 0);
3556
+ P("entityViews", y.entityViews?.filter((f) => f !== c)), g(void 0);
3557
3557
  },
3558
- onCancel: () => f(void 0),
3559
- title: /* @__PURE__ */ e(j, { children: "Remove this view?" }),
3560
- body: /* @__PURE__ */ a(j, { children: [
3558
+ onCancel: () => g(void 0),
3559
+ title: /* @__PURE__ */ e(R, { children: "Remove this view?" }),
3560
+ body: /* @__PURE__ */ a(R, { children: [
3561
3561
  "This will ",
3562
3562
  /* @__PURE__ */ e("b", { children: "not delete any data" }),
3563
3563
  ", only the view in the CMS"
@@ -3584,8 +3584,8 @@ function Zi({
3584
3584
  Wi,
3585
3585
  {
3586
3586
  open: h,
3587
- onClose: (g) => {
3588
- g && P("entityViews", [...y.entityViews ?? [], g]), m(!1);
3587
+ onClose: (f) => {
3588
+ f && P("entityViews", [...y.entityViews ?? [], f]), m(!1);
3589
3589
  }
3590
3590
  }
3591
3591
  )
@@ -4020,18 +4020,18 @@ function Ji({
4020
4020
  onContinue: i,
4021
4021
  existingCollectionPaths: l
4022
4022
  }) {
4023
- const [o, d] = $(!1), [u, p] = $();
4023
+ const [o, d] = $(!1), [p, u] = $();
4024
4024
  de(() => {
4025
4025
  r && l && (d(!0), r(t).then((v) => {
4026
4026
  const x = v.filter((y) => !(l ?? []).find((P) => P.trim().toLowerCase() === y.trim().toLowerCase()));
4027
- p(x);
4027
+ u(x);
4028
4028
  }).finally(() => d(!1)));
4029
4029
  }, [l, t, r]);
4030
4030
  const {
4031
4031
  values: h,
4032
4032
  setFieldValue: m,
4033
- setValues: s,
4034
- submitCount: f
4033
+ setValues: c,
4034
+ submitCount: g
4035
4035
  } = K();
4036
4036
  return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ a(mt, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
4037
4037
  /* @__PURE__ */ e(
@@ -4055,8 +4055,8 @@ function Ji({
4055
4055
  }
4056
4056
  ),
4057
4057
  /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
4058
- o && !u && /* @__PURE__ */ e(De, { size: "small" }),
4059
- u?.map((v, x) => /* @__PURE__ */ e(
4058
+ o && !p && /* @__PURE__ */ e(De, { size: "small" }),
4059
+ p?.map((v, x) => /* @__PURE__ */ e(
4060
4060
  st,
4061
4061
  {
4062
4062
  colorScheme: "cyanLighter",
@@ -4068,7 +4068,7 @@ function Ji({
4068
4068
  },
4069
4069
  v
4070
4070
  )),
4071
- !o && (u ?? [])?.length === 0 && /* @__PURE__ */ e(O, { variant: "caption", children: "No suggestions" })
4071
+ !o && (p ?? [])?.length === 0 && /* @__PURE__ */ e(O, { variant: "caption", children: "No suggestions" })
4072
4072
  ] })
4073
4073
  ] }),
4074
4074
  /* @__PURE__ */ a("div", { className: "my-2", children: [
@@ -4088,7 +4088,7 @@ function Ji({
4088
4088
  subtitle: "A collection of products with images, prices and stock",
4089
4089
  icon: /* @__PURE__ */ e(et, { size: "small", iconKey: Lt.icon }),
4090
4090
  onClick: () => {
4091
- s(Lt), i();
4091
+ c(Lt), i();
4092
4092
  }
4093
4093
  }
4094
4094
  ),
@@ -4099,7 +4099,7 @@ function Ji({
4099
4099
  subtitle: "A collection of users with emails, names and roles",
4100
4100
  icon: /* @__PURE__ */ e(et, { size: "small", iconKey: $t.icon }),
4101
4101
  onClick: () => {
4102
- s($t), i();
4102
+ c($t), i();
4103
4103
  }
4104
4104
  }
4105
4105
  ),
@@ -4110,7 +4110,7 @@ function Ji({
4110
4110
  subtitle: "A collection of blog posts with images, authors and complex content",
4111
4111
  icon: /* @__PURE__ */ e(et, { size: "small", iconKey: qt.icon }),
4112
4112
  onClick: () => {
4113
- s(qt), i();
4113
+ c(qt), i();
4114
4114
  }
4115
4115
  }
4116
4116
  ),
@@ -4121,7 +4121,7 @@ function Ji({
4121
4121
  subtitle: "A collection of pages with images, authors and complex content",
4122
4122
  icon: /* @__PURE__ */ e(et, { size: "small", iconKey: Yt.icon }),
4123
4123
  onClick: () => {
4124
- s(Yt), i();
4124
+ c(Yt), i();
4125
4125
  }
4126
4126
  }
4127
4127
  )
@@ -4174,32 +4174,32 @@ function Qi({
4174
4174
  setFieldValue: i,
4175
4175
  setFieldTouched: l,
4176
4176
  values: o
4177
- } = K(), [d, u] = $(void 0), p = Y.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), h = d ? d.id : void 0, m = d || void 0, s = ({
4177
+ } = K(), [d, p] = $(void 0), u = Y.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), h = d ? d.id : void 0, m = d || void 0, c = ({
4178
4178
  id: v,
4179
4179
  property: x,
4180
4180
  previousId: y,
4181
4181
  namespace: P
4182
4182
  }) => {
4183
- const k = v ? ae(v, P) : void 0, b = k ? he(k) : void 0, C = (g) => g ? p.current[g] ?? I(o, ye(g)) : p.current[""], N = (g, w) => {
4184
- const _ = ye(w);
4185
- i(_, g, !1), p.current[w ?? ""] = g;
4183
+ const k = v ? ae(v, P) : void 0, b = k ? he(k) : void 0, C = (f) => f ? u.current[f] ?? I(o, be(f)) : u.current[""], N = (f, w) => {
4184
+ const _ = be(w);
4185
+ i(_, f, !1), u.current[w ?? ""] = f;
4186
4186
  };
4187
4187
  if (y && y !== v) {
4188
- const g = ae(y, P), w = he(g), M = C(P).map((D) => D === y ? v : D).filter((D) => D !== void 0);
4188
+ const f = ae(y, P), w = he(f), M = C(P).map((D) => D === y ? v : D).filter((D) => D !== void 0);
4189
4189
  N(M, P);
4190
- const R = { ...t.headersMapping };
4191
- Object.keys(R).forEach((D) => {
4192
- R[D] === y && (R[D] = v ?? "");
4193
- }), t.setHeadersMapping(R), i(w, void 0, !1), l(w, !1, !1);
4190
+ const U = { ...t.headersMapping };
4191
+ Object.keys(U).forEach((D) => {
4192
+ U[D] === y && (U[D] = v ?? "");
4193
+ }), t.setHeadersMapping(U), i(w, void 0, !1), l(w, !1, !1);
4194
4194
  }
4195
4195
  b && (i(b, x, !1), l(b, !0, !1));
4196
- }, f = async ({
4196
+ }, g = async ({
4197
4197
  id: v,
4198
4198
  importKey: x,
4199
4199
  property: y,
4200
4200
  namespace: P
4201
4201
  }) => {
4202
- const k = v ? ae(v, P) : void 0, b = k ? he(k) : void 0, C = t.importData.map((g) => I(g, x)), N = {
4202
+ const k = v ? ae(v, P) : void 0, b = k ? he(k) : void 0, C = t.importData.map((f) => I(f, x)), N = {
4203
4203
  ...ti(C, y, rr),
4204
4204
  editable: !0
4205
4205
  };
@@ -4227,7 +4227,7 @@ function Qi({
4227
4227
  propertyKey: x,
4228
4228
  onPropertyNameChanged: (P, k) => i(`properties.${P}.name`, k, !1),
4229
4229
  onEditClick: () => {
4230
- !x || !v || u({
4230
+ !x || !v || p({
4231
4231
  ...v,
4232
4232
  id: x,
4233
4233
  editable: !0
@@ -4238,7 +4238,7 @@ function Qi({
4238
4238
  {
4239
4239
  property: v,
4240
4240
  disabled: !1,
4241
- onPropertyChanged: (P) => f({
4241
+ onPropertyChanged: (P) => g({
4242
4242
  ...P,
4243
4243
  importKey: y
4244
4244
  }),
@@ -4252,21 +4252,21 @@ function Qi({
4252
4252
  )
4253
4253
  ] }),
4254
4254
  /* @__PURE__ */ e(
4255
- Ve,
4255
+ Ie,
4256
4256
  {
4257
4257
  open: d !== void 0,
4258
4258
  propertyKey: h,
4259
4259
  property: m,
4260
4260
  inArray: !1,
4261
4261
  autoUpdateId: !1,
4262
- onPropertyChanged: s,
4262
+ onPropertyChanged: c,
4263
4263
  allowDataInference: !1,
4264
4264
  collectionEditable: n,
4265
4265
  onOkClicked: () => {
4266
- u(void 0);
4266
+ p(void 0);
4267
4267
  },
4268
4268
  onCancel: () => {
4269
- u(void 0);
4269
+ p(void 0);
4270
4270
  },
4271
4271
  autoOpenTypeSelect: !1,
4272
4272
  existingProperty: !1,
@@ -4283,17 +4283,17 @@ function Xi({
4283
4283
  propertyConfigs: i,
4284
4284
  disabled: l
4285
4285
  }) {
4286
- const o = t ? Kt(t) : null, d = t ? $e(t, i) : null, [u, p] = $(!1);
4286
+ const o = t ? Kt(t) : null, d = t ? $e(t, i) : null, [p, u] = $(!1);
4287
4287
  return /* @__PURE__ */ e(
4288
4288
  te,
4289
4289
  {
4290
4290
  title: t && d ? `${d?.name} - ${t.dataType}` : void 0,
4291
- open: u ? !1 : void 0,
4291
+ open: p ? !1 : void 0,
4292
4292
  children: /* @__PURE__ */ e(
4293
- be,
4293
+ Ce,
4294
4294
  {
4295
- open: u,
4296
- onOpenChange: p,
4295
+ open: p,
4296
+ onOpenChange: u,
4297
4297
  invisible: !0,
4298
4298
  className: "w-full",
4299
4299
  disabled: l,
@@ -4355,24 +4355,24 @@ function en({ importConfig: t, properties: r, propertiesOrder: n }) {
4355
4355
  }
4356
4356
  function dr(t, r = "") {
4357
4357
  const n = Object.keys(t).reduce((o, d) => {
4358
- const u = t[d], p = kr(d), h = r ? `${r}.${p}` : p;
4359
- if (u.dataType === "map" && u.properties) {
4360
- const f = dr(u.properties, h);
4358
+ const p = t[d], u = kr(d), h = r ? `${r}.${u}` : u;
4359
+ if (p.dataType === "map" && p.properties) {
4360
+ const g = dr(p.properties, h);
4361
4361
  return {
4362
4362
  headersMapping: { ...o.headersMapping, [d]: h },
4363
4363
  properties: {
4364
4364
  ...o.properties,
4365
- [p]: {
4366
- ...u,
4367
- properties: f.properties,
4368
- propertiesOrder: Object.keys(f.properties)
4365
+ [u]: {
4366
+ ...p,
4367
+ properties: g.properties,
4368
+ propertiesOrder: Object.keys(g.properties)
4369
4369
  }
4370
4370
  }
4371
4371
  };
4372
4372
  }
4373
4373
  const m = {
4374
4374
  ...o.properties,
4375
- [p]: u
4375
+ [u]: p
4376
4376
  };
4377
4377
  return {
4378
4378
  headersMapping: { ...o.headersMapping, [d]: h },
@@ -4399,7 +4399,7 @@ function ur(t) {
4399
4399
  fullHeight: !0,
4400
4400
  scrollable: !1,
4401
4401
  maxWidth: "7xl",
4402
- onOpenChange: (u) => u ? void 0 : d(),
4402
+ onOpenChange: (p) => p ? void 0 : d(),
4403
4403
  children: [
4404
4404
  r && /* @__PURE__ */ e(
4405
4405
  tn,
@@ -4423,13 +4423,13 @@ function ur(t) {
4423
4423
  );
4424
4424
  }
4425
4425
  function tn(t) {
4426
- const { propertyConfigs: r } = Ae(), n = Pe(), i = _e(), {
4426
+ const { propertyConfigs: r } = Ae(), n = Ne(), i = Te(), {
4427
4427
  topLevelNavigation: l,
4428
4428
  collections: o
4429
- } = n, d = t.initialValues, u = !d?.path && (t.parentCollectionIds ?? []).length === 0, p = (t.parentCollection ? t.parentCollection.subcollections : o) ?? [], h = p.map((b) => b.path.trim().toLowerCase()), m = p.map((b) => b.id?.trim().toLowerCase()).filter(Boolean), [s, f] = je.useState(), [v, x] = je.useState(!1);
4429
+ } = n, d = t.initialValues, p = !d?.path && (t.parentCollectionIds ?? []).length === 0, u = (t.parentCollection ? t.parentCollection.subcollections : o) ?? [], h = u.map((b) => b.path.trim().toLowerCase()), m = u.map((b) => b.id?.trim().toLowerCase()).filter(Boolean), [c, g] = je.useState(), [v, x] = je.useState(!1);
4430
4430
  if (de(() => {
4431
4431
  try {
4432
- n.initialised && (t.editedCollectionId ? f(n.getCollectionFromPaths([...t.parentCollectionIds ?? [], t.editedCollectionId])) : f(void 0), x(!0));
4432
+ n.initialised && (t.editedCollectionId ? g(n.getCollectionFromPaths([...t.parentCollectionIds ?? [], t.editedCollectionId])) : g(void 0), x(!0));
4433
4433
  } catch (b) {
4434
4434
  console.error(b);
4435
4435
  }
@@ -4437,9 +4437,9 @@ function tn(t) {
4437
4437
  throw Error("Internal: Navigation not ready in collection editor");
4438
4438
  const {
4439
4439
  groups: y
4440
- } = l, P = s ? {
4441
- ...s,
4442
- id: s.id ?? s.path ?? _t(16)
4440
+ } = l, P = c ? {
4441
+ ...c,
4442
+ id: c.id ?? c.path ?? _t(16)
4443
4443
  } : void 0, k = P ? nn(P, r) : {
4444
4444
  id: d?.path ?? _t(16),
4445
4445
  path: d?.path ?? "",
@@ -4457,9 +4457,9 @@ function tn(t) {
4457
4457
  initialValues: k,
4458
4458
  existingPaths: h,
4459
4459
  existingIds: m,
4460
- includeTemplates: u,
4461
- collection: s,
4462
- setCollection: f,
4460
+ includeTemplates: p,
4461
+ collection: c,
4462
+ setCollection: g,
4463
4463
  groups: y,
4464
4464
  propertyConfigs: r
4465
4465
  }
@@ -4473,12 +4473,12 @@ function rn({
4473
4473
  fullPath: l,
4474
4474
  collectionInference: o,
4475
4475
  handleClose: d,
4476
- reservedGroups: u,
4477
- extraView: p,
4476
+ reservedGroups: p,
4477
+ extraView: u,
4478
4478
  handleCancel: h,
4479
4479
  setFormDirty: m,
4480
- pathSuggestions: s,
4481
- getUser: f,
4480
+ pathSuggestions: c,
4481
+ getUser: g,
4482
4482
  parentCollection: v,
4483
4483
  getData: x,
4484
4484
  existingPaths: y,
@@ -4487,23 +4487,23 @@ function rn({
4487
4487
  collection: b,
4488
4488
  setCollection: C,
4489
4489
  initialValues: N,
4490
- propertyConfigs: g,
4490
+ propertyConfigs: f,
4491
4491
  groups: w
4492
4492
  }) {
4493
- const _ = hi(), M = Pe(), R = Ie(), D = Le({}), A = t ? k ? "welcome" : "details" : "properties", [c, V] = $(A), [G, B] = je.useState(), q = (T) => {
4493
+ const _ = hi(), M = Ne(), U = _e(), D = Le({}), A = t ? k ? "welcome" : "details" : "properties", [s, V] = $(A), [G, B] = je.useState(), q = (T) => {
4494
4494
  const S = T.id || T.path;
4495
4495
  return r.saveCollection({
4496
4496
  id: S,
4497
4497
  collectionData: T,
4498
4498
  previousId: n,
4499
4499
  parentCollectionIds: i
4500
- }).then(() => (B(void 0), !0)).catch((E) => (B(E), console.error(E), R.open({
4500
+ }).then(() => (B(void 0), !0)).catch((E) => (B(E), console.error(E), U.open({
4501
4501
  type: "error",
4502
4502
  message: "Error persisting collection: " + (E.message ?? "Details in the console")
4503
4503
  }), !1));
4504
4504
  }, L = Q(() => {
4505
- c === "details" ? _.inUse ? V("import_data_saving") : V(p ? "extra_view" : "properties") : V(c === "welcome" ? "details" : c === "import_data_mapping" ? "import_data_preview" : c === "import_data_preview" ? "details" : c === "extra_view" ? "properties" : "details");
4506
- }, [c, _.inUse, p]), J = Q((T) => {
4505
+ s === "details" ? _.inUse ? V("import_data_saving") : V(u ? "extra_view" : "properties") : V(s === "welcome" ? "details" : s === "import_data_mapping" ? "import_data_preview" : s === "import_data_preview" ? "details" : s === "extra_view" ? "properties" : "details");
4506
+ }, [s, _.inUse, u]), J = Q((T) => {
4507
4507
  if (o)
4508
4508
  return o?.(T.path, T.collectionGroup ?? !1, i ?? []);
4509
4509
  }, [o, i]), le = Q(async (T) => {
@@ -4522,7 +4522,7 @@ function rn({
4522
4522
  values: E
4523
4523
  }), E) : (E.propertiesOrder = Object.keys(E.properties), E);
4524
4524
  } catch (S) {
4525
- return console.error(S), R.open({
4525
+ return console.error(S), U.open({
4526
4526
  type: "error",
4527
4527
  message: "Error inferring collection: " + (S.message ?? "Details in the console")
4528
4528
  }), T;
@@ -4538,7 +4538,7 @@ function rn({
4538
4538
  });
4539
4539
  return;
4540
4540
  }
4541
- c === "welcome" ? (L(), S.resetForm({ values: T })) : c === "details" ? p || _.inUse ? (S.resetForm({ values: T }), L()) : t ? le(T).then((E) => {
4541
+ s === "welcome" ? (L(), S.resetForm({ values: T })) : s === "details" ? u || _.inUse ? (S.resetForm({ values: T }), L()) : t ? le(T).then((E) => {
4542
4542
  S.resetForm({
4543
4543
  values: E ?? T,
4544
4544
  touched: {
@@ -4548,11 +4548,11 @@ function rn({
4548
4548
  });
4549
4549
  }).finally(() => {
4550
4550
  L();
4551
- }) : (S.resetForm({ values: T }), L()) : c === "extra_view" ? (L(), S.resetForm({ values: T })) : c === "import_data_mapping" || c === "import_data_preview" ? L() : c === "properties" ? q(T).then(() => {
4551
+ }) : (S.resetForm({ values: T }), L()) : s === "extra_view" ? (L(), S.resetForm({ values: T })) : s === "import_data_mapping" || s === "import_data_preview" ? L() : s === "properties" ? q(T).then(() => {
4552
4552
  S.resetForm({ values: N }), L(), d(T);
4553
4553
  }) : (L(), S.resetForm({ values: T }));
4554
4554
  } catch (E) {
4555
- R.open({
4555
+ U.open({
4556
4556
  type: "error",
4557
4557
  message: "Error persisting collection: " + (E.message ?? "Details in the console")
4558
4558
  }), console.error(E), S.resetForm({ values: T });
@@ -4560,27 +4560,27 @@ function rn({
4560
4560
  },
4561
4561
  validation: (T) => {
4562
4562
  let S = {};
4563
- const E = (c === "properties" || c === "subcollections" || c === "details") && vi;
4563
+ const E = (s === "properties" || s === "subcollections" || s === "details") && vi;
4564
4564
  if (E)
4565
4565
  try {
4566
4566
  E.validateSync(T, { abortEarly: !1 });
4567
4567
  } catch (ie) {
4568
- ie.inner.forEach((ke) => {
4569
- S[ke.path] = ke.message;
4568
+ ie.inner.forEach((Oe) => {
4569
+ S[Oe.path] = Oe.message;
4570
4570
  });
4571
4571
  }
4572
- if (c === "properties" && (S = { ...S, ...D.current }), c === "details") {
4572
+ if (s === "properties" && (S = { ...S, ...D.current }), s === "details") {
4573
4573
  const ie = Ht(T.path, t, y, T.id);
4574
4574
  ie && (S.path = ie);
4575
- const ke = an(T.id, t, y, P);
4576
- ke && (S.id = ke);
4575
+ const Oe = an(T.id, t, y, P);
4576
+ Oe && (S.id = Oe);
4577
4577
  }
4578
4578
  return S;
4579
4579
  }
4580
4580
  }), {
4581
4581
  values: re,
4582
- setFieldValue: ge,
4583
- isSubmitting: Te,
4582
+ setFieldValue: ve,
4583
+ isSubmitting: ke,
4584
4584
  dirty: Ge,
4585
4585
  submitCount: gt
4586
4586
  } = ue, pe = re.path, Ke = l?.includes("/") ? l?.split("/").slice(0, -1).join("/") + "/" + pe : pe, We = Ht(pe, t, y, re.id), Ze = !We && i ? M.convertIdsToPaths(i) : void 0, Je = We ? void 0 : M.resolveAliasesFrom(Ke), Re = Je && x ? () => x(Je, Ze ?? []) : void 0;
@@ -4590,18 +4590,18 @@ function rn({
4590
4590
  function Qe(T) {
4591
4591
  _.setInUse(!0), ri(T, rr).then((S) => {
4592
4592
  const E = dr(S);
4593
- ge("properties", E.properties), ge("propertiesOrder", Object.keys(E.properties)), _.setIdColumn(E.idColumn), _.setImportData(T), _.setHeadersMapping(E.headersMapping), _.setOriginProperties(E.properties);
4593
+ ve("properties", E.properties), ve("propertiesOrder", Object.keys(E.properties)), _.setIdColumn(E.idColumn), _.setImportData(T), _.setHeadersMapping(E.headersMapping), _.setOriginProperties(E.properties);
4594
4594
  });
4595
4595
  }
4596
4596
  const vt = !!re.name && !!re.id, yt = () => {
4597
4597
  const T = { ...re.properties };
4598
- _.idColumn && delete T[_.idColumn], ge("properties", T), L();
4599
- }, U = b?.editable === void 0 || b?.editable === !0 || t;
4600
- return /* @__PURE__ */ e(Be, { fullHeight: !0, children: /* @__PURE__ */ e(kt, { value: ue, children: /* @__PURE__ */ a(j, { children: [
4598
+ _.idColumn && delete T[_.idColumn], ve("properties", T), L();
4599
+ }, j = b?.editable === void 0 || b?.editable === !0 || t;
4600
+ return /* @__PURE__ */ e(Be, { fullHeight: !0, children: /* @__PURE__ */ e(kt, { value: ue, children: /* @__PURE__ */ a(R, { children: [
4601
4601
  !t && /* @__PURE__ */ a(
4602
4602
  Hr,
4603
4603
  {
4604
- value: c,
4604
+ value: s,
4605
4605
  className: fe(wt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
4606
4606
  onValueChange: (T) => V(T),
4607
4607
  children: [
@@ -4621,9 +4621,9 @@ function rn({
4621
4621
  "flex-grow flex flex-col relative"
4622
4622
  ),
4623
4623
  children: [
4624
- c === "loading" && /* @__PURE__ */ e(Nt, {}),
4625
- c === "extra_view" && pe && p?.View && /* @__PURE__ */ e(p.View, { path: pe }),
4626
- c === "welcome" && /* @__PURE__ */ e(
4624
+ s === "loading" && /* @__PURE__ */ e(Nt, {}),
4625
+ s === "extra_view" && pe && u?.View && /* @__PURE__ */ e(u.View, { path: pe }),
4626
+ s === "welcome" && /* @__PURE__ */ e(
4627
4627
  Ji,
4628
4628
  {
4629
4629
  path: pe,
@@ -4632,18 +4632,18 @@ function rn({
4632
4632
  },
4633
4633
  existingCollectionPaths: y,
4634
4634
  parentCollection: v,
4635
- pathSuggestions: s
4635
+ pathSuggestions: c
4636
4636
  }
4637
4637
  ),
4638
- c === "import_data_mapping" && _ && /* @__PURE__ */ e(
4638
+ s === "import_data_mapping" && _ && /* @__PURE__ */ e(
4639
4639
  Qi,
4640
4640
  {
4641
4641
  importConfig: _,
4642
- collectionEditable: U,
4643
- propertyConfigs: g
4642
+ collectionEditable: j,
4643
+ propertyConfigs: f
4644
4644
  }
4645
4645
  ),
4646
- c === "import_data_preview" && _ && /* @__PURE__ */ e(
4646
+ s === "import_data_preview" && _ && /* @__PURE__ */ e(
4647
4647
  en,
4648
4648
  {
4649
4649
  importConfig: _,
@@ -4651,21 +4651,21 @@ function rn({
4651
4651
  propertiesOrder: re.propertiesOrder
4652
4652
  }
4653
4653
  ),
4654
- c === "import_data_saving" && _ && /* @__PURE__ */ e(
4654
+ s === "import_data_saving" && _ && /* @__PURE__ */ e(
4655
4655
  fi,
4656
4656
  {
4657
4657
  importConfig: _,
4658
4658
  collection: re,
4659
4659
  path: pe,
4660
4660
  onImportSuccess: async (T) => {
4661
- R.open({
4661
+ U.open({
4662
4662
  type: "info",
4663
4663
  message: "Data imported successfully"
4664
4664
  }), await q(re), d(T);
4665
4665
  }
4666
4666
  }
4667
4667
  ),
4668
- c === "details" && /* @__PURE__ */ e(
4668
+ s === "details" && /* @__PURE__ */ e(
4669
4669
  yi,
4670
4670
  {
4671
4671
  existingPaths: y,
@@ -4676,23 +4676,23 @@ function rn({
4676
4676
  isNewCollection: t
4677
4677
  }
4678
4678
  ),
4679
- c === "subcollections" && b && /* @__PURE__ */ e(
4679
+ s === "subcollections" && b && /* @__PURE__ */ e(
4680
4680
  Zi,
4681
4681
  {
4682
4682
  parentCollection: v,
4683
4683
  configController: r,
4684
- getUser: f,
4684
+ getUser: g,
4685
4685
  collectionInference: o,
4686
4686
  parentCollectionIds: i,
4687
4687
  collection: b
4688
4688
  }
4689
4689
  ),
4690
- c === "properties" && /* @__PURE__ */ e(
4690
+ s === "properties" && /* @__PURE__ */ e(
4691
4691
  Gi,
4692
4692
  {
4693
4693
  showErrors: gt > 0,
4694
4694
  isNewCollection: t,
4695
- reservedGroups: u,
4695
+ reservedGroups: p,
4696
4696
  onPropertyError: (T, S, E) => {
4697
4697
  const ie = Ft({
4698
4698
  ...D.current,
@@ -4700,28 +4700,28 @@ function rn({
4700
4700
  }, !0);
4701
4701
  D.current = ie, ue.validate();
4702
4702
  },
4703
- getUser: f,
4703
+ getUser: g,
4704
4704
  getData: Re,
4705
4705
  doCollectionInference: J,
4706
- propertyConfigs: g,
4707
- collectionEditable: U,
4708
- extraIcon: p?.icon && /* @__PURE__ */ e(
4706
+ propertyConfigs: f,
4707
+ collectionEditable: j,
4708
+ extraIcon: u?.icon && /* @__PURE__ */ e(
4709
4709
  oe,
4710
4710
  {
4711
4711
  color: "primary",
4712
4712
  onClick: () => V("extra_view"),
4713
- children: p.icon
4713
+ children: u.icon
4714
4714
  }
4715
4715
  )
4716
4716
  }
4717
4717
  ),
4718
- c !== "welcome" && /* @__PURE__ */ a(
4718
+ s !== "welcome" && /* @__PURE__ */ a(
4719
4719
  ze,
4720
4720
  {
4721
4721
  position: "absolute",
4722
4722
  children: [
4723
4723
  G && /* @__PURE__ */ e(Wt, { error: G }),
4724
- t && k && c === "import_data_mapping" && /* @__PURE__ */ a(
4724
+ t && k && s === "import_data_mapping" && /* @__PURE__ */ a(
4725
4725
  z,
4726
4726
  {
4727
4727
  variant: "text",
@@ -4733,7 +4733,7 @@ function rn({
4733
4733
  ]
4734
4734
  }
4735
4735
  ),
4736
- t && k && c === "import_data_preview" && /* @__PURE__ */ a(
4736
+ t && k && s === "import_data_preview" && /* @__PURE__ */ a(
4737
4737
  z,
4738
4738
  {
4739
4739
  variant: "text",
@@ -4747,7 +4747,7 @@ function rn({
4747
4747
  ]
4748
4748
  }
4749
4749
  ),
4750
- t && k && c === "details" && /* @__PURE__ */ a(
4750
+ t && k && s === "details" && /* @__PURE__ */ a(
4751
4751
  z,
4752
4752
  {
4753
4753
  variant: "text",
@@ -4759,7 +4759,7 @@ function rn({
4759
4759
  ]
4760
4760
  }
4761
4761
  ),
4762
- t && c === "properties" && /* @__PURE__ */ a(
4762
+ t && s === "properties" && /* @__PURE__ */ a(
4763
4763
  z,
4764
4764
  {
4765
4765
  variant: "text",
@@ -4781,7 +4781,7 @@ function rn({
4781
4781
  children: "Cancel"
4782
4782
  }
4783
4783
  ),
4784
- t && c === "import_data_mapping" && /* @__PURE__ */ e(
4784
+ t && s === "import_data_mapping" && /* @__PURE__ */ e(
4785
4785
  z,
4786
4786
  {
4787
4787
  variant: "filled",
@@ -4790,7 +4790,7 @@ function rn({
4790
4790
  children: "Next"
4791
4791
  }
4792
4792
  ),
4793
- t && c === "import_data_preview" && /* @__PURE__ */ e(
4793
+ t && s === "import_data_preview" && /* @__PURE__ */ e(
4794
4794
  z,
4795
4795
  {
4796
4796
  variant: "filled",
@@ -4801,18 +4801,18 @@ function rn({
4801
4801
  children: "Next"
4802
4802
  }
4803
4803
  ),
4804
- t && (c === "details" || c === "properties") && /* @__PURE__ */ a(
4804
+ t && (s === "details" || s === "properties") && /* @__PURE__ */ a(
4805
4805
  Mt,
4806
4806
  {
4807
4807
  variant: "filled",
4808
4808
  color: "primary",
4809
4809
  type: "submit",
4810
- loading: Te,
4811
- disabled: Te || c === "details" && !vt,
4812
- startIcon: c === "properties" ? /* @__PURE__ */ e(Gr, {}) : void 0,
4810
+ loading: ke,
4811
+ disabled: ke || s === "details" && !vt,
4812
+ startIcon: s === "properties" ? /* @__PURE__ */ e(Gr, {}) : void 0,
4813
4813
  children: [
4814
- c === "details" && "Next",
4815
- c === "properties" && "Create collection"
4814
+ s === "details" && "Next",
4815
+ s === "properties" && "Create collection"
4816
4816
  ]
4817
4817
  }
4818
4818
  ),
@@ -4822,7 +4822,7 @@ function rn({
4822
4822
  variant: "filled",
4823
4823
  color: "primary",
4824
4824
  type: "submit",
4825
- loading: Te,
4825
+ loading: ke,
4826
4826
  children: "Update collection"
4827
4827
  }
4828
4828
  )
@@ -4871,47 +4871,47 @@ const Ht = (t, r, n, i) => {
4871
4871
  reservedGroups: l,
4872
4872
  collectionInference: o,
4873
4873
  extraView: d,
4874
- pathSuggestions: u,
4875
- getUser: p,
4874
+ pathSuggestions: p,
4875
+ getUser: u,
4876
4876
  getData: h,
4877
4877
  onAnalyticsEvent: m
4878
4878
  }) {
4879
- const s = Pe(), f = gi(), v = Ie(), { propertyConfigs: x } = Ae(), {
4879
+ const c = Ne(), g = gi(), v = _e(), { propertyConfigs: x } = Ae(), {
4880
4880
  collections: y
4881
- } = s, P = (y ?? []).map((c) => c.path.trim().toLowerCase()), [k, b] = Y.useState();
4881
+ } = c, P = (y ?? []).map((s) => s.path.trim().toLowerCase()), [k, b] = Y.useState();
4882
4882
  de(() => {
4883
- u && u().then((c) => {
4884
- b(c.filter((V) => !P.includes(V.trim().toLowerCase())));
4883
+ p && p().then((s) => {
4884
+ b(s.filter((V) => !P.includes(V.trim().toLowerCase())));
4885
4885
  });
4886
- }, [u]);
4887
- const [C, N] = Y.useState(), [g, w] = Y.useState(), _ = Q(() => ({
4886
+ }, [p]);
4887
+ const [C, N] = Y.useState(), [f, w] = Y.useState(), _ = Q(() => ({
4888
4888
  createCollections: !0,
4889
4889
  editCollections: !0,
4890
4890
  deleteCollections: !0
4891
4891
  }), []), M = Q(({
4892
- id: c,
4892
+ id: s,
4893
4893
  fullPath: V,
4894
4894
  parentCollectionIds: G,
4895
4895
  parentCollection: B
4896
4896
  }) => {
4897
- console.debug("Edit collection", c, V, G, B), m?.("edit_collection", { id: c, fullPath: V }), N({
4898
- editedCollectionId: c,
4897
+ console.debug("Edit collection", s, V, G, B), m?.("edit_collection", { id: s, fullPath: V }), N({
4898
+ editedCollectionId: s,
4899
4899
  fullPath: V,
4900
4900
  parentCollectionIds: G,
4901
4901
  isNewCollection: !1,
4902
4902
  parentCollection: B,
4903
4903
  redirect: !1
4904
4904
  });
4905
- }, []), R = Q(({
4906
- propertyKey: c,
4905
+ }, []), U = Q(({
4906
+ propertyKey: s,
4907
4907
  property: V,
4908
4908
  editedCollectionId: G,
4909
4909
  currentPropertiesOrder: B,
4910
4910
  parentCollectionIds: q,
4911
4911
  collection: L
4912
4912
  }) => {
4913
- console.debug("Edit property", c, V, G, B, q, L), m?.("edit_property", { propertyKey: c, editedCollectionId: G });
4914
- const J = c && c.includes(".") ? c.substring(0, c.lastIndexOf(".")) : void 0, le = c && c.includes(".") ? c.substring(c.lastIndexOf(".") + 1) : c;
4913
+ console.debug("Edit property", s, V, G, B, q, L), m?.("edit_property", { propertyKey: s, editedCollectionId: G });
4914
+ const J = s && s.includes(".") ? s.substring(0, s.lastIndexOf(".")) : void 0, le = s && s.includes(".") ? s.substring(s.lastIndexOf(".") + 1) : s;
4915
4915
  w({
4916
4916
  propertyKey: le,
4917
4917
  property: V,
@@ -4922,27 +4922,27 @@ const Ht = (t, r, n, i) => {
4922
4922
  collectionEditable: L?.editable ?? !1
4923
4923
  });
4924
4924
  }, []), D = Y.useCallback(({
4925
- parentCollectionIds: c,
4925
+ parentCollectionIds: s,
4926
4926
  parentCollection: V,
4927
4927
  initialValues: G,
4928
4928
  redirect: B,
4929
4929
  sourceClick: q
4930
4930
  }) => {
4931
- console.debug("Create collection", { parentCollectionIds: c, parentCollection: V, initialValues: G, redirect: B, sourceClick: q }), m?.("create_collection", { parentCollectionIds: c, parentCollection: V, initialValues: G, redirect: B, sourceClick: q }), N({
4931
+ console.debug("Create collection", { parentCollectionIds: s, parentCollection: V, initialValues: G, redirect: B, sourceClick: q }), m?.("create_collection", { parentCollectionIds: s, parentCollection: V, initialValues: G, redirect: B, sourceClick: q }), N({
4932
4932
  isNewCollection: !0,
4933
- parentCollectionIds: c,
4933
+ parentCollectionIds: s,
4934
4934
  parentCollection: V,
4935
4935
  initialValues: G,
4936
4936
  redirect: B
4937
4937
  });
4938
- }, []), A = u ? (c) => !c && k ? Promise.resolve(k) : u?.(c) : void 0;
4938
+ }, []), A = p ? (s) => !s && k ? Promise.resolve(k) : p?.(s) : void 0;
4939
4939
  return /* @__PURE__ */ e(mr.Provider, { value: n, children: /* @__PURE__ */ a(
4940
4940
  hr.Provider,
4941
4941
  {
4942
4942
  value: {
4943
4943
  editCollection: M,
4944
4944
  createCollection: D,
4945
- editProperty: R,
4945
+ editProperty: U,
4946
4946
  configPermissions: i ?? _,
4947
4947
  rootPathSuggestions: k
4948
4948
  },
@@ -4960,45 +4960,45 @@ const Ht = (t, r, n, i) => {
4960
4960
  reservedGroups: l,
4961
4961
  extraView: d,
4962
4962
  pathSuggestions: A,
4963
- getUser: p,
4964
- handleClose: (c) => {
4965
- if (C?.redirect && c && C?.isNewCollection && !C.parentCollectionIds.length) {
4966
- const V = s.buildUrlCollectionPath(c.id ?? c.path);
4967
- f(V);
4963
+ getUser: u,
4964
+ handleClose: (s) => {
4965
+ if (C?.redirect && s && C?.isNewCollection && !C.parentCollectionIds.length) {
4966
+ const V = c.buildUrlCollectionPath(s.id ?? s.path);
4967
+ g(V);
4968
4968
  }
4969
4969
  N(void 0);
4970
4970
  }
4971
4971
  }
4972
4972
  ),
4973
4973
  /* @__PURE__ */ e(
4974
- Ve,
4974
+ Ie,
4975
4975
  {
4976
- open: !!g,
4976
+ open: !!f,
4977
4977
  includeIdAndName: !0,
4978
- existingProperty: !!g?.propertyKey,
4979
- autoUpdateId: g ? !g?.propertyKey : !1,
4980
- autoOpenTypeSelect: g ? !g?.propertyKey : !1,
4978
+ existingProperty: !!f?.propertyKey,
4979
+ autoUpdateId: f ? !f?.propertyKey : !1,
4980
+ autoOpenTypeSelect: f ? !f?.propertyKey : !1,
4981
4981
  inArray: !1,
4982
- collectionEditable: g?.collectionEditable ?? !1,
4983
- getData: h && g?.editedCollectionId ? () => {
4984
- console.debug("get data for property", g?.editedCollectionId);
4985
- const c = s.resolveAliasesFrom(g.editedCollectionId);
4986
- return h(c, []);
4982
+ collectionEditable: f?.collectionEditable ?? !1,
4983
+ getData: h && f?.editedCollectionId ? () => {
4984
+ console.debug("get data for property", f?.editedCollectionId);
4985
+ const s = c.resolveAliasesFrom(f.editedCollectionId);
4986
+ return h(s, []);
4987
4987
  } : void 0,
4988
4988
  onPropertyChanged: ({
4989
- id: c,
4989
+ id: s,
4990
4990
  property: V
4991
4991
  }) => {
4992
- if (!g || !c)
4992
+ if (!f || !s)
4993
4993
  return;
4994
- const G = !g.propertyKey;
4994
+ const G = !f.propertyKey;
4995
4995
  return n.saveProperty({
4996
- path: g?.editedCollectionId,
4996
+ path: f?.editedCollectionId,
4997
4997
  property: V,
4998
- propertyKey: c,
4999
- newPropertiesOrder: G && g.currentPropertiesOrder ? [...g.currentPropertiesOrder, c] : void 0,
5000
- namespace: g.namespace,
5001
- parentCollectionIds: g.parentCollectionIds
4998
+ propertyKey: s,
4999
+ newPropertiesOrder: G && f.currentPropertiesOrder ? [...f.currentPropertiesOrder, s] : void 0,
5000
+ namespace: f.namespace,
5001
+ parentCollectionIds: f.parentCollectionIds
5002
5002
  }).catch((B) => (console.error(B), v.open({
5003
5003
  type: "error",
5004
5004
  message: "Error persisting property: " + (B.message ?? "Details in the console")
@@ -5006,15 +5006,15 @@ const Ht = (t, r, n, i) => {
5006
5006
  },
5007
5007
  onPropertyChangedImmediate: !1,
5008
5008
  onDelete: () => {
5009
- if (!g?.propertyKey)
5009
+ if (!f?.propertyKey)
5010
5010
  return;
5011
- const c = g?.currentPropertiesOrder?.filter((V) => V !== g?.propertyKey);
5011
+ const s = f?.currentPropertiesOrder?.filter((V) => V !== f?.propertyKey);
5012
5012
  return n.deleteProperty({
5013
- path: g?.editedCollectionId,
5014
- propertyKey: g?.propertyKey,
5015
- namespace: g?.namespace,
5016
- newPropertiesOrder: c,
5017
- parentCollectionIds: g?.parentCollectionIds
5013
+ path: f?.editedCollectionId,
5014
+ propertyKey: f?.propertyKey,
5015
+ namespace: f?.namespace,
5016
+ newPropertiesOrder: s,
5017
+ parentCollectionIds: f?.parentCollectionIds
5018
5018
  }).then(() => {
5019
5019
  w(void 0);
5020
5020
  }).catch((V) => (console.error(V), v.open({
@@ -5035,109 +5035,53 @@ const Ht = (t, r, n, i) => {
5035
5035
  existingPropertyKeys: [],
5036
5036
  allowDataInference: !0,
5037
5037
  propertyConfigs: x,
5038
- property: g?.property,
5039
- propertyKey: g?.propertyKey
5038
+ property: f?.property,
5039
+ propertyKey: f?.propertyKey
5040
5040
  }
5041
5041
  )
5042
5042
  ]
5043
5043
  }
5044
5044
  ) });
5045
5045
  },
5046
- ve
5047
- ), xe = () => Jt(hr), fr = () => Jt(mr);
5046
+ ye
5047
+ ), ge = () => Jt(hr);
5048
5048
  function ln({
5049
5049
  path: t,
5050
5050
  parentCollectionIds: r,
5051
5051
  collection: n,
5052
5052
  tableController: i
5053
5053
  }) {
5054
- const l = _e(), o = Pe(), d = xe(), u = fr(), p = Ie(), h = o.getCollectionFromIds(r), m = d.configPermissions ? d.configPermissions({
5054
+ const l = Te(), o = Ne(), d = ge(), p = o.getCollectionFromIds(r), u = d.configPermissions ? d.configPermissions({
5055
5055
  user: l.user,
5056
5056
  collection: n
5057
5057
  }).editCollections : !0;
5058
- let s = null;
5059
- return (!ve(at(i.filterValues), at(n.initialFilter)) || !ve(at(i.sortBy), at(n.initialSort))) && (s = /* @__PURE__ */ a(j, { children: [
5060
- (n.initialFilter || n.initialSort) && /* @__PURE__ */ e(
5061
- te,
5062
- {
5063
- title: "Reset to default filter and sort",
5064
- children: /* @__PURE__ */ e(
5065
- z,
5066
- {
5067
- color: "primary",
5068
- size: "small",
5069
- variant: "text",
5070
- onClick: () => {
5071
- i.clearFilter?.(), n?.initialFilter && i.setFilterValues?.(n?.initialFilter), n?.initialSort && i.setSortBy?.(n?.initialSort);
5072
- },
5073
- children: /* @__PURE__ */ e(Kr, {})
5074
- }
5075
- )
5076
- }
5077
- ),
5078
- /* @__PURE__ */ e(
5079
- te,
5080
- {
5081
- title: i.sortBy || i.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
5082
- children: /* @__PURE__ */ e(
5083
- z,
5084
- {
5085
- color: "primary",
5086
- size: "small",
5087
- variant: "outlined",
5088
- onClick: () => u?.saveCollection({
5089
- id: n.id,
5090
- parentCollectionIds: r,
5091
- collectionData: W(
5092
- n,
5093
- {
5094
- initialFilter: i.filterValues ?? null,
5095
- initialSort: i.sortBy ?? null
5096
- }
5097
- )
5098
- }).then(() => {
5099
- p.open({
5100
- type: "success",
5101
- message: "Default config saved"
5102
- });
5103
- }),
5104
- children: /* @__PURE__ */ e(Wr, {})
5105
- }
5106
- )
5107
- }
5108
- )
5109
- ] })), /* @__PURE__ */ a(j, { children: [
5110
- m && s,
5111
- /* @__PURE__ */ e(
5112
- te,
5113
- {
5114
- title: m ? "Edit collection" : "You don't have permissions to edit this collection",
5115
- children: /* @__PURE__ */ e(
5116
- oe,
5117
- {
5118
- color: "primary",
5119
- disabled: !m,
5120
- onClick: m ? () => d?.editCollection({ id: n.id, fullPath: t, parentCollectionIds: r, parentCollection: h }) : void 0,
5121
- children: /* @__PURE__ */ e(He, {})
5122
- }
5123
- )
5124
- }
5125
- )
5126
- ] });
5127
- }
5128
- function at(t) {
5129
- return t && Object.keys(t).length === 0 ? t : t ?? null;
5058
+ return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(
5059
+ te,
5060
+ {
5061
+ title: u ? "Edit collection" : "You don't have permissions to edit this collection",
5062
+ children: /* @__PURE__ */ e(
5063
+ oe,
5064
+ {
5065
+ color: "primary",
5066
+ disabled: !u,
5067
+ onClick: u ? () => d?.editCollection({ id: n.id, fullPath: t, parentCollectionIds: r, parentCollection: p }) : void 0,
5068
+ children: /* @__PURE__ */ e(He, {})
5069
+ }
5070
+ )
5071
+ }
5072
+ ) });
5130
5073
  }
5074
+ const fr = () => Jt(mr);
5131
5075
  function sn({
5132
5076
  path: t,
5133
5077
  collection: r
5134
5078
  }) {
5135
- const n = Ie(), i = _e(), l = fr(), o = xe(), d = o.configPermissions({
5079
+ const n = _e(), i = Te(), l = fr(), o = ge(), d = o.configPermissions({
5136
5080
  user: i.user,
5137
5081
  collection: r
5138
- }), u = Q(() => {
5082
+ }), p = Q(() => {
5139
5083
  o?.editCollection({ id: r.id, parentCollectionIds: [] });
5140
- }, [o, t]), [p, h] = $(!1), m = Q(() => {
5084
+ }, [o, t]), [u, h] = $(!1), m = Q(() => {
5141
5085
  l?.deleteCollection({ id: r.id }).then(() => {
5142
5086
  h(!1), n.open({
5143
5087
  message: "Collection deleted",
@@ -5145,14 +5089,14 @@ function sn({
5145
5089
  });
5146
5090
  });
5147
5091
  }, [t, l]);
5148
- return /* @__PURE__ */ a(j, { children: [
5092
+ return /* @__PURE__ */ a(R, { children: [
5149
5093
  /* @__PURE__ */ a("div", { children: [
5150
5094
  d.deleteCollections && /* @__PURE__ */ e(
5151
- Zr,
5095
+ Kr,
5152
5096
  {
5153
- trigger: /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(Jr, { size: "small" }) }),
5154
- children: /* @__PURE__ */ a(Qr, { onClick: (s) => {
5155
- s.preventDefault(), s.stopPropagation(), h(!0);
5097
+ trigger: /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(Wr, { size: "small" }) }),
5098
+ children: /* @__PURE__ */ a(Zr, { onClick: (c) => {
5099
+ c.preventDefault(), c.stopPropagation(), h(!0);
5156
5100
  }, children: [
5157
5101
  /* @__PURE__ */ e(dt, {}),
5158
5102
  "Delete"
@@ -5162,8 +5106,8 @@ function sn({
5162
5106
  d.editCollections && /* @__PURE__ */ e(
5163
5107
  oe,
5164
5108
  {
5165
- onClick: (s) => {
5166
- u();
5109
+ onClick: (c) => {
5110
+ p();
5167
5111
  },
5168
5112
  children: /* @__PURE__ */ e(He, { size: "small" })
5169
5113
  }
@@ -5172,11 +5116,11 @@ function sn({
5172
5116
  /* @__PURE__ */ e(
5173
5117
  lt,
5174
5118
  {
5175
- open: p,
5119
+ open: u,
5176
5120
  onAccept: m,
5177
5121
  onCancel: () => h(!1),
5178
- title: /* @__PURE__ */ e(j, { children: "Delete this collection?" }),
5179
- body: /* @__PURE__ */ a(j, { children: [
5122
+ title: /* @__PURE__ */ e(R, { children: "Delete this collection?" }),
5123
+ body: /* @__PURE__ */ a(R, { children: [
5180
5124
  " This will ",
5181
5125
  /* @__PURE__ */ e("b", { children: "not delete any data" }),
5182
5126
  ", only the collection in the CMS"
@@ -5191,7 +5135,7 @@ function cn({
5191
5135
  }) {
5192
5136
  if (!r.navigation.topLevelNavigation)
5193
5137
  throw Error("Navigation not ready in FireCMSHomePage");
5194
- const n = _e(), i = xe(), l = i.configPermissions ? i.configPermissions({
5138
+ const n = Te(), i = ge(), l = i.configPermissions ? i.configPermissions({
5195
5139
  user: n.user
5196
5140
  }).createCollections : !0;
5197
5141
  return /* @__PURE__ */ e(
@@ -5227,11 +5171,11 @@ function cn({
5227
5171
  );
5228
5172
  }
5229
5173
  function dn({ introMode: t }) {
5230
- const r = _e(), n = Pe(), i = xe(), l = i.configPermissions ? i.configPermissions({
5174
+ const r = Te(), n = Ne(), i = ge(), l = i.configPermissions ? i.configPermissions({
5231
5175
  user: r.user
5232
5176
  }).createCollections : !0, o = i.rootPathSuggestions, d = (o ?? []).length > 3 || (n.collections ?? []).length === 0 && (o ?? []).length > 0;
5233
5177
  return /* @__PURE__ */ e(
5234
- Xr,
5178
+ Jr,
5235
5179
  {
5236
5180
  in: t === "existing_project" || d,
5237
5181
  children: /* @__PURE__ */ a(
@@ -5254,21 +5198,21 @@ function dn({ introMode: t }) {
5254
5198
  {
5255
5199
  className: "flex flex-row gap-1 overflow-scroll no-scrollbar ",
5256
5200
  children: [
5257
- (o ?? []).map((p) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
5201
+ (o ?? []).map((u) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
5258
5202
  st,
5259
5203
  {
5260
5204
  icon: /* @__PURE__ */ e(se, { size: "small" }),
5261
5205
  colorScheme: "cyanLighter",
5262
5206
  onClick: i && l ? () => i.createCollection({
5263
- initialValues: { path: p, name: ut(p) },
5207
+ initialValues: { path: u, name: ut(u) },
5264
5208
  parentCollectionIds: [],
5265
5209
  redirect: !0,
5266
5210
  sourceClick: "root_collection_suggestion"
5267
5211
  }) : void 0,
5268
5212
  size: "small",
5269
- children: p
5213
+ children: u
5270
5214
  }
5271
- ) }, p)),
5215
+ ) }, u)),
5272
5216
  o === void 0 && /* @__PURE__ */ e(De, { size: "small" }),
5273
5217
  o?.length === 0 && /* @__PURE__ */ e(O, { variant: "caption", children: "No suggestions" })
5274
5218
  ]
@@ -5288,7 +5232,7 @@ function un({
5288
5232
  parentCollectionIds: l,
5289
5233
  collection: o
5290
5234
  }) {
5291
- const d = xe();
5235
+ const d = ge();
5292
5236
  return /* @__PURE__ */ e(te, { title: "Edit", children: /* @__PURE__ */ e(
5293
5237
  oe,
5294
5238
  {
@@ -5312,7 +5256,7 @@ function pn({
5312
5256
  parentCollectionIds: r,
5313
5257
  collection: n
5314
5258
  }) {
5315
- const i = _e(), l = xe(), o = l.configPermissions ? l.configPermissions({
5259
+ const i = Te(), l = ge(), o = l.configPermissions ? l.configPermissions({
5316
5260
  user: i.user,
5317
5261
  collection: n
5318
5262
  }).editCollections : !0;
@@ -5333,7 +5277,7 @@ function pn({
5333
5277
  ) });
5334
5278
  }
5335
5279
  function mn() {
5336
- const t = xe();
5280
+ const t = ge();
5337
5281
  return /* @__PURE__ */ e("div", { className: "bg-gray-50 dark:bg-gray-900 min-w-fit rounded", children: /* @__PURE__ */ a(
5338
5282
  z,
5339
5283
  {
@@ -5351,7 +5295,73 @@ function mn() {
5351
5295
  }
5352
5296
  ) });
5353
5297
  }
5354
- function In({
5298
+ function hn({
5299
+ path: t,
5300
+ parentCollectionIds: r,
5301
+ collection: n,
5302
+ tableController: i
5303
+ }) {
5304
+ const l = Te(), o = ge(), d = fr(), p = _e(), u = o.configPermissions ? o.configPermissions({
5305
+ user: l.user,
5306
+ collection: n
5307
+ }).editCollections : !0;
5308
+ let h = null;
5309
+ return (!ye(at(i.filterValues), at(n.initialFilter)) || !ye(at(i.sortBy), at(n.initialSort))) && (h = /* @__PURE__ */ a(R, { children: [
5310
+ /* @__PURE__ */ e(
5311
+ te,
5312
+ {
5313
+ title: i.sortBy || i.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
5314
+ children: /* @__PURE__ */ e(
5315
+ z,
5316
+ {
5317
+ color: "primary",
5318
+ size: "small",
5319
+ variant: "outlined",
5320
+ onClick: () => d?.saveCollection({
5321
+ id: n.id,
5322
+ parentCollectionIds: r,
5323
+ collectionData: W(
5324
+ n,
5325
+ {
5326
+ initialFilter: i.filterValues ?? null,
5327
+ initialSort: i.sortBy ?? null
5328
+ }
5329
+ )
5330
+ }).then(() => {
5331
+ p.open({
5332
+ type: "success",
5333
+ message: "Default config saved"
5334
+ });
5335
+ }),
5336
+ children: /* @__PURE__ */ e(Qr, {})
5337
+ }
5338
+ )
5339
+ }
5340
+ ),
5341
+ (n.initialFilter || n.initialSort) && /* @__PURE__ */ e(
5342
+ te,
5343
+ {
5344
+ title: "Reset to default filter and sort",
5345
+ children: /* @__PURE__ */ e(
5346
+ z,
5347
+ {
5348
+ color: "primary",
5349
+ size: "small",
5350
+ variant: "text",
5351
+ onClick: () => {
5352
+ i.clearFilter?.(), n?.initialFilter && i.setFilterValues?.(n?.initialFilter), n?.initialSort && i.setSortBy?.(n?.initialSort);
5353
+ },
5354
+ children: /* @__PURE__ */ e(Xr, {})
5355
+ }
5356
+ )
5357
+ }
5358
+ )
5359
+ ] })), /* @__PURE__ */ e(R, { children: u && h });
5360
+ }
5361
+ function at(t) {
5362
+ return t && Object.keys(t).length === 0 ? t : t ?? null;
5363
+ }
5364
+ function _n({
5355
5365
  collectionConfigController: t,
5356
5366
  introMode: r,
5357
5367
  configPermissions: n,
@@ -5359,8 +5369,8 @@ function In({
5359
5369
  extraView: l,
5360
5370
  pathSuggestions: o,
5361
5371
  getUser: d,
5362
- collectionInference: u,
5363
- getData: p,
5372
+ collectionInference: p,
5373
+ getData: u,
5364
5374
  onAnalyticsEvent: h
5365
5375
  }) {
5366
5376
  return {
@@ -5371,33 +5381,34 @@ function In({
5371
5381
  props: {
5372
5382
  collectionConfigController: t,
5373
5383
  configPermissions: n,
5374
- collectionInference: u,
5384
+ collectionInference: p,
5375
5385
  reservedGroups: i,
5376
5386
  extraView: l,
5377
5387
  pathSuggestions: o,
5378
5388
  getUser: d,
5379
- getData: p,
5389
+ getData: u,
5380
5390
  onAnalyticsEvent: h
5381
5391
  }
5382
5392
  },
5383
5393
  homePage: {
5384
5394
  additionalActions: /* @__PURE__ */ e(mn, {}),
5385
- additionalChildrenStart: r ? /* @__PURE__ */ e(hn, { introMode: r }) : void 0,
5395
+ additionalChildrenStart: r ? /* @__PURE__ */ e(fn, { introMode: r }) : void 0,
5386
5396
  additionalChildrenEnd: /* @__PURE__ */ e(dn, { introMode: r }),
5387
5397
  CollectionActions: sn,
5388
5398
  AdditionalCards: r ? void 0 : cn
5389
5399
  },
5390
5400
  collectionView: {
5401
+ CollectionActionsStart: hn,
5391
5402
  CollectionActions: ln,
5392
5403
  HeaderAction: un,
5393
5404
  AddColumnComponent: pn
5394
5405
  }
5395
5406
  };
5396
5407
  }
5397
- function hn({ introMode: t }) {
5398
- if (!Pe().topLevelNavigation)
5408
+ function fn({ introMode: t }) {
5409
+ if (!Ne().topLevelNavigation)
5399
5410
  throw Error("Navigation not ready in FireCMSHomePage");
5400
- const n = _e(), i = xe(), l = i.configPermissions ? i.configPermissions({
5411
+ const n = Te(), i = ge(), l = i.configPermissions ? i.configPermissions({
5401
5412
  user: n.user
5402
5413
  }).createCollections : !0;
5403
5414
  return /* @__PURE__ */ a("div", { className: "mt-8 flex flex-col mt-8 p-2", children: [
@@ -5421,8 +5432,8 @@ function hn({ introMode: t }) {
5421
5432
  )
5422
5433
  ] });
5423
5434
  }
5424
- function _n({ path: t }) {
5425
- const r = Pe(), n = fn(t), i = r.getParentCollectionIds(t), l = xe();
5435
+ function Fn({ path: t }) {
5436
+ const r = Ne(), n = gn(t), i = r.getParentCollectionIds(t), l = ge();
5426
5437
  return /* @__PURE__ */ a("div", { className: "p-1 flex flex-col items-center", children: [
5427
5438
  /* @__PURE__ */ e(Wt, { error: "No collection for path: " + n }),
5428
5439
  /* @__PURE__ */ e(
@@ -5444,21 +5455,21 @@ function _n({ path: t }) {
5444
5455
  )
5445
5456
  ] });
5446
5457
  }
5447
- function fn(t) {
5458
+ function gn(t) {
5448
5459
  const r = t.split("/");
5449
5460
  return r[r.length - 1];
5450
5461
  }
5451
5462
  export {
5452
- _n as MissingReferenceWidget,
5463
+ Fn as MissingReferenceWidget,
5453
5464
  qe as editableProperty,
5454
5465
  ae as getFullId,
5455
5466
  ir as getFullIdPath,
5456
5467
  he as idToPropertiesPath,
5457
- ye as namespaceToPropertiesOrderPath,
5468
+ be as namespaceToPropertiesOrderPath,
5458
5469
  bi as namespaceToPropertiesPath,
5459
5470
  wi as removeNonEditableProperties,
5460
- xe as useCollectionEditorController,
5461
- In as useCollectionEditorPlugin,
5471
+ ge as useCollectionEditorController,
5472
+ _n as useCollectionEditorPlugin,
5462
5473
  fr as useCollectionsConfigController
5463
5474
  };
5464
5475
  //# sourceMappingURL=index.es.js.map