@firecms/collection_editor 3.0.0-alpha.37 → 3.0.0-alpha.38

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,7 +1,7 @@
1
1
  import { jsxs as n, Fragment as D, jsx as e } from "react/jsx-runtime";
2
2
  import * as _e from "react";
3
3
  import U, { useState as K, useCallback as J, useEffect as pe, useMemo as $t, useRef as Ge, useDeferredValue as ha, useContext as Lt } from "react";
4
- import { iconKeys as Kt, debounce as ga, SearchBar as fa, Tooltip as oe, IconButton as ce, Icon as lt, coolIconKeys as kt, Typography as O, getIconForView as ct, useAutoComplete as ba, Container as ht, Chip as dt, TextField as Te, cn as xe, DebouncedTextField as H, Autocomplete as ya, AutocompleteItem as va, ExpandablePanel as Ct, SettingsIcon as Je, Select as Se, SelectItem as ee, BooleanSwitchWithLabel as Yt, Dialog as Fe, toSnakeCase as Gt, singular as wa, ListIcon as _a, Button as E, CircularProgress as Qe, AutoAwesomeIcon as gt, Paper as qe, FormikArrayContainer as ka, DialogContent as Be, DialogActions as Me, SwitchControl as he, serializeRegExp as xa, isValidRegExp as Ca, RuleIcon as Oa, useSnackbarController as Re, resolveEnumValues as Pa, FileUploadIcon as Na, MultiSelect as Sa, MultiSelectItem as At, Checkbox as zt, isPropertyBuilder as re, useFireCMSContext as Ue, getFieldConfig as We, ErrorBoundary as Pe, FieldConfigBadge as Ze, cardMixin as Ht, cardClickableMixin as Jt, cardSelectedMixin as Qt, FunctionsIcon as qa, RemoveCircleIcon as Aa, defaultBorderMixin as Ot, RemoveIcon as za, DragHandleIcon as Ta, AddIcon as Ae, useNavigationContext as $e, SelectGroup as Tt, mergeDeep as Y, getFieldId as Wt, DEFAULT_FIELD_CONFIGS as xt, InfoLabel as Zt, DeleteIcon as pt, DeleteConfirmationDialog as mt, ContentCopyIcon as Va, useLargeLayout as Ia, makePropertiesEditable as Xe, resolveEntityView as Fa, Table as Vt, TableBody as It, TableRow as yt, TableCell as Ye, unslugify as Pt, Card as Xt, useSelectionController as ja, EntityCollectionTable as Ea, slugify as Da, useAuthController as Le, CircularProgressCenter as Ft, Tabs as Ba, Tab as vt, removeUndefined as Ma, ErrorView as ea, ArrowBackIcon as ot, LoadingButton as jt, DoneIcon as Ra, SaveIcon as Ua, Menu as $a, MoreVertIcon as La, MenuItem as Ka, Collapse as Ya, getDefaultPropertiesOrder as Ga, joinCollectionLists as Ha } from "@firecms/core";
4
+ import { iconKeys as Kt, debounce as ga, SearchBar as fa, Tooltip as oe, IconButton as ce, Icon as lt, coolIconKeys as kt, Typography as C, getIconForView as ct, useAutoComplete as ba, Container as ht, Chip as dt, TextField as Te, cn as xe, DebouncedTextField as H, Autocomplete as ya, AutocompleteItem as va, ExpandablePanel as Ct, SettingsIcon as Je, Select as Se, SelectItem as ee, BooleanSwitchWithLabel as Yt, Dialog as Fe, toSnakeCase as Gt, singular as wa, ListIcon as _a, Button as E, CircularProgress as Qe, AutoAwesomeIcon as gt, Paper as qe, FormikArrayContainer as ka, DialogContent as Be, DialogActions as Me, SwitchControl as he, serializeRegExp as xa, isValidRegExp as Ca, RuleIcon as Oa, useSnackbarController as Re, resolveEnumValues as Pa, FileUploadIcon as Na, MultiSelect as Sa, MultiSelectItem as At, Checkbox as zt, isPropertyBuilder as re, useFireCMSContext as Ue, getFieldConfig as We, ErrorBoundary as Pe, FieldConfigBadge as Ze, cardMixin as Ht, cardClickableMixin as Jt, cardSelectedMixin as Qt, FunctionsIcon as qa, RemoveCircleIcon as Aa, defaultBorderMixin as Ot, RemoveIcon as za, DragHandleIcon as Ta, AddIcon as Ae, useNavigationContext as $e, SelectGroup as Tt, mergeDeep as Y, getFieldId as Wt, DEFAULT_FIELD_CONFIGS as xt, InfoLabel as Zt, DeleteIcon as pt, DeleteConfirmationDialog as mt, ContentCopyIcon as Va, useLargeLayout as Ia, makePropertiesEditable as Xe, resolveEntityView as Fa, Table as Vt, TableBody as It, TableRow as yt, TableCell as Ye, unslugify as Pt, Card as Xt, useSelectionController as ja, EntityCollectionTable as Ea, slugify as Da, useAuthController as Le, CircularProgressCenter as Ft, Tabs as Ba, Tab as vt, removeUndefined as Ma, ErrorView as ea, ArrowBackIcon as ot, LoadingButton as jt, DoneIcon as Ra, SaveIcon as Ua, Menu as $a, MoreVertIcon as La, MenuItem as Ka, Collapse as Ya, getDefaultPropertiesOrder as Ga, joinCollectionLists as Ha } from "@firecms/core";
5
5
  import ut from "react-fast-compare";
6
6
  import { useFormikContext as $, Field as ye, getIn as P, Formik as Nt, FastField as le, Form as Ja } from "formik";
7
7
  import * as wt from "yup";
@@ -10,7 +10,7 @@ import { extractEnumFromValues as Wa, buildPropertyFromData as Za, buildEntityPr
10
10
  import { DragDropContext as ei, Droppable as ti, Draggable as ai } from "@hello-pangea/dnd";
11
11
  import ii from "json5";
12
12
  import { Highlight as ri, themes as oi } from "prism-react-renderer";
13
- import { ImportFileUpload as ni, DataNewPropertiesMapping as si, ImportNewPropertyFieldPreview as li, getInferenceType as ta, getPropertiesMapping as ci, convertDataToEntity as di, useImportConfig as pi, ImportSaveInProgress as mi } from "@firecms/data_import";
13
+ import { ImportFileUpload as ni, DataNewPropertiesMapping as si, ImportNewPropertyFieldPreview as li, getInferenceType as ta, getPropertiesMapping as ci, convertDataToEntity as di, useImportConfig as pi, ImportSaveInProgress as mi } from "@firecms/data_import_export";
14
14
  import { useNavigate as ui } from "react-router";
15
15
  const hi = wt.object().shape({
16
16
  name: wt.string().required("Required"),
@@ -1976,13 +1976,13 @@ process.env.NODE_ENV !== "production" && Object.keys(aa).forEach((t) => {
1976
1976
  Kt.includes(t) || console.warn(`The icon ${t} no longer exists. Remove it from \`synonyms\``);
1977
1977
  });
1978
1978
  function fi({ selectedIcon: t = "", onIconSelected: a }) {
1979
- const [r, i] = _e.useState(null), [s, o] = _e.useState(""), l = _e.useMemo(
1979
+ const [i, r] = _e.useState(null), [s, o] = _e.useState(""), l = _e.useMemo(
1980
1980
  () => ga((p) => {
1981
1981
  if (!p || p === "")
1982
- i(null);
1982
+ r(null);
1983
1983
  else {
1984
1984
  const u = St.search(p);
1985
- i(u.map((c) => c.key));
1985
+ r(u.map((c) => c.key));
1986
1986
  }
1987
1987
  }, gi),
1988
1988
  []
@@ -1999,7 +1999,7 @@ function fi({ selectedIcon: t = "", onIconSelected: a }) {
1999
1999
  placeholder: "Search for more icons…"
2000
2000
  }
2001
2001
  ),
2002
- /* @__PURE__ */ e("div", { className: "flex max-w-full flex-wrap mt-4", children: (r === null ? kt : r).map((p) => /* @__PURE__ */ e(oe, { title: p, children: /* @__PURE__ */ e(
2002
+ /* @__PURE__ */ e("div", { className: "flex max-w-full flex-wrap mt-4", children: (i === null ? kt : i).map((p) => /* @__PURE__ */ e(oe, { title: p, children: /* @__PURE__ */ e(
2003
2003
  ce,
2004
2004
  {
2005
2005
  shape: "square",
@@ -2015,13 +2015,13 @@ function ie({
2015
2015
  error: t,
2016
2016
  children: a
2017
2017
  }) {
2018
- return a ? /* @__PURE__ */ e(O, { variant: "caption", color: t ? "error" : "secondary", className: "ml-3.5 mt-0.5", children: a }) : null;
2018
+ return a ? /* @__PURE__ */ e(C, { variant: "caption", color: t ? "error" : "secondary", className: "ml-3.5 mt-0.5", children: a }) : null;
2019
2019
  }
2020
2020
  function bi({
2021
2021
  isNewCollection: t,
2022
2022
  reservedGroups: a,
2023
- existingPaths: r,
2024
- existingAliases: i,
2023
+ existingPaths: i,
2024
+ existingAliases: r,
2025
2025
  groups: s,
2026
2026
  parentCollection: o
2027
2027
  }) {
@@ -2034,17 +2034,17 @@ function bi({
2034
2034
  setFieldTouched: b,
2035
2035
  isSubmitting: g,
2036
2036
  submitCount: y
2037
- } = $(), [C, k] = K(!1), x = (f) => {
2037
+ } = $(), [O, k] = K(!1), x = (f) => {
2038
2038
  p("name", f), !P(c, "path") && t && f && p("path", Gt(f)), !P(c, "singularName") && t && f && p("singularName", wa(f));
2039
2039
  }, h = ct(d), _ = J((f) => {
2040
2040
  let z;
2041
- return f || (z = "You must specify a path in the database for this collection"), t && i?.includes(f.trim().toLowerCase()) && (z = "There is already a collection which uses this path as an alias"), t && r?.includes(f.trim().toLowerCase()) && !d.alias && (z = "There is already a collection with the specified path. If you want to have multiple collections referring to the same database path, you need to define an alias in at least one of the collections"), z;
2042
- }, [t, i, r, d.alias]), v = J((f) => {
2041
+ return f || (z = "You must specify a path in the database for this collection"), t && r?.includes(f.trim().toLowerCase()) && (z = "There is already a collection which uses this path as an alias"), t && i?.includes(f.trim().toLowerCase()) && !d.alias && (z = "There is already a collection with the specified path. If you want to have multiple collections referring to the same database path, you need to define an alias in at least one of the collections"), z;
2042
+ }, [t, r, i, d.alias]), v = J((f) => {
2043
2043
  if (!f)
2044
2044
  return;
2045
2045
  let z;
2046
- return t && r?.includes(f.trim().toLowerCase()) && (z = "There is already a collection that uses this value as a path"), t && i?.includes(f.trim().toLowerCase()) && (z = "There is already a collection which uses this alias"), z;
2047
- }, [t, r, i]), w = s?.filter((f) => !a?.includes(f)), {
2046
+ return t && i?.includes(f.trim().toLowerCase()) && (z = "There is already a collection that uses this value as a path"), t && r?.includes(f.trim().toLowerCase()) && (z = "There is already a collection which uses this alias"), z;
2047
+ }, [t, i, r]), w = s?.filter((f) => !a?.includes(f)), {
2048
2048
  inputFocused: V,
2049
2049
  autoCompleteOpen: I,
2050
2050
  setAutoCompleteOpen: A
@@ -2059,7 +2059,7 @@ function bi({
2059
2059
  {
2060
2060
  className: "flex flex-row py-2 pt-3 items-center",
2061
2061
  children: [
2062
- /* @__PURE__ */ e(O, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${d?.name} collection` }),
2062
+ /* @__PURE__ */ e(C, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${d?.name} collection` }),
2063
2063
  /* @__PURE__ */ e(oe, { title: "Change icon", children: /* @__PURE__ */ e(
2064
2064
  ce,
2065
2065
  {
@@ -2071,7 +2071,7 @@ function bi({
2071
2071
  ]
2072
2072
  }
2073
2073
  ),
2074
- o && /* @__PURE__ */ e(dt, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(O, { variant: "caption", children: [
2074
+ o && /* @__PURE__ */ e(dt, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(C, { variant: "caption", children: [
2075
2075
  "This is a subcollection of ",
2076
2076
  /* @__PURE__ */ e("b", { children: o.name })
2077
2077
  ] }) })
@@ -2144,7 +2144,7 @@ function bi({
2144
2144
  title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
2145
2145
  /* @__PURE__ */ e(Je, {}),
2146
2146
  /* @__PURE__ */ e(
2147
- O,
2147
+ C,
2148
2148
  {
2149
2149
  variant: "subtitle2",
2150
2150
  className: "ml-2",
@@ -2258,7 +2258,7 @@ function bi({
2258
2258
  /* @__PURE__ */ e(
2259
2259
  Fe,
2260
2260
  {
2261
- open: C,
2261
+ open: O,
2262
2262
  onOpenChange: k,
2263
2263
  maxWidth: "xl",
2264
2264
  fullWidth: !0,
@@ -2290,8 +2290,8 @@ function se(t, a) {
2290
2290
  const vi = U.memo(
2291
2291
  function({
2292
2292
  enumValues: a,
2293
- onValuesChanged: r,
2294
- onError: i,
2293
+ onValuesChanged: i,
2294
+ onError: r,
2295
2295
  updateIds: s,
2296
2296
  disabled: o,
2297
2297
  allowDataInference: l,
@@ -2308,9 +2308,9 @@ const vi = U.memo(
2308
2308
  values: p,
2309
2309
  errors: u
2310
2310
  }) => (pe(() => {
2311
- r && r(p.enumValues);
2311
+ i && i(p.enumValues);
2312
2312
  }, [p.enumValues]), pe(() => {
2313
- i && i(!!(u?.enumValues ?? !1));
2313
+ r && r(!!(u?.enumValues ?? !1));
2314
2314
  }, [u]), /* @__PURE__ */ e(
2315
2315
  wi,
2316
2316
  {
@@ -2326,33 +2326,33 @@ const vi = U.memo(
2326
2326
  }
2327
2327
  );
2328
2328
  },
2329
- function(a, r) {
2330
- return a.enumValues.length === r.enumValues.length && a.onValuesChanged === r.onValuesChanged && a.getData === r.getData;
2329
+ function(a, i) {
2330
+ return a.enumValues.length === i.enumValues.length && a.onValuesChanged === i.onValuesChanged && a.getData === i.getData;
2331
2331
  }
2332
2332
  );
2333
2333
  function wi({
2334
2334
  values: t,
2335
2335
  errors: a,
2336
- disabled: r,
2337
- enumValuesPath: i,
2336
+ disabled: i,
2337
+ enumValuesPath: r,
2338
2338
  shouldUpdateId: s,
2339
2339
  allowDataInference: o,
2340
2340
  getData: l
2341
2341
  }) {
2342
2342
  const {
2343
2343
  setFieldValue: d
2344
- } = $(), [p, u] = U.useState(), [c, m] = U.useState(), [b, g] = U.useState(!1), C = U.useRef(/* @__PURE__ */ new Set()).current, k = (h, _) => {
2344
+ } = $(), [p, u] = U.useState(), [c, m] = U.useState(), [b, g] = U.useState(!1), O = U.useRef(/* @__PURE__ */ new Set()).current, k = (h, _) => {
2345
2345
  const v = p === _;
2346
2346
  return /* @__PURE__ */ e(
2347
2347
  _i,
2348
2348
  {
2349
2349
  index: h,
2350
- disabled: r,
2351
- enumValuesPath: i,
2350
+ disabled: i,
2351
+ enumValuesPath: r,
2352
2352
  autoFocus: v,
2353
2353
  shouldUpdateId: s || v,
2354
2354
  onDialogOpen: () => m(h),
2355
- inferredEntry: C.has(t.enumValues[h]?.id)
2355
+ inferredEntry: O.has(t.enumValues[h]?.id)
2356
2356
  },
2357
2357
  `${_}`
2358
2358
  );
@@ -2361,7 +2361,7 @@ function wi({
2361
2361
  /* @__PURE__ */ n("div", { className: "ml-3.5 flex flex-row items-center", children: [
2362
2362
  /* @__PURE__ */ e(_a, {}),
2363
2363
  /* @__PURE__ */ e(
2364
- O,
2364
+ C,
2365
2365
  {
2366
2366
  variant: "subtitle2",
2367
2367
  className: "ml-2 grow",
@@ -2372,7 +2372,7 @@ function wi({
2372
2372
  E,
2373
2373
  {
2374
2374
  loading: b,
2375
- disabled: r || b,
2375
+ disabled: i || b,
2376
2376
  variant: "text",
2377
2377
  size: "small",
2378
2378
  onClick: async () => {
@@ -2381,8 +2381,8 @@ function wi({
2381
2381
  return;
2382
2382
  const _ = h.flat(), v = Array.from(new Set(_)), w = t.enumValues, I = Wa(v).filter((A) => !w?.some((N) => N.id === A.id));
2383
2383
  I.forEach((A) => {
2384
- C.add(A.id);
2385
- }), d(i, [...I, ...w]);
2384
+ O.add(A.id);
2385
+ }), d(r, [...I, ...w]);
2386
2386
  }).catch((h) => {
2387
2387
  console.error(h);
2388
2388
  }).finally(() => g(!1)));
@@ -2400,9 +2400,9 @@ function wi({
2400
2400
  {
2401
2401
  value: t.enumValues,
2402
2402
  addLabel: "Add enum value",
2403
- name: i,
2403
+ name: r,
2404
2404
  buildEntry: k,
2405
- disabled: r,
2405
+ disabled: i,
2406
2406
  onInternalIdAdded: u,
2407
2407
  small: !0,
2408
2408
  setFieldValue: d,
@@ -2414,7 +2414,7 @@ function wi({
2414
2414
  {
2415
2415
  index: c,
2416
2416
  open: c !== void 0,
2417
- enumValuesPath: i,
2417
+ enumValuesPath: r,
2418
2418
  onClose: () => m(void 0)
2419
2419
  }
2420
2420
  )
@@ -2424,8 +2424,8 @@ function wi({
2424
2424
  const _i = U.memo(
2425
2425
  function({
2426
2426
  index: a,
2427
- shouldUpdateId: r,
2428
- enumValuesPath: i,
2427
+ shouldUpdateId: i,
2428
+ enumValuesPath: r,
2429
2429
  autoFocus: s,
2430
2430
  onDialogOpen: o,
2431
2431
  disabled: l,
@@ -2437,14 +2437,14 @@ const _i = U.memo(
2437
2437
  errors: c,
2438
2438
  setFieldValue: m,
2439
2439
  touched: b
2440
- } = $(), g = U.useRef(!P(p, `${i}[${a}].id`)), y = r || g.current, C = P(p, `${i}[${a}].id`), k = P(p, `${i}[${a}].label`), x = P(c, `${i}[${a}].label`), h = U.useRef(k);
2440
+ } = $(), g = U.useRef(!P(p, `${r}[${a}].id`)), y = i || g.current, O = P(p, `${r}[${a}].id`), k = P(p, `${r}[${a}].label`), x = P(c, `${r}[${a}].label`), h = U.useRef(k);
2441
2441
  return U.useEffect(() => {
2442
- (h.current === C || !C) && y && m(`${i}[${a}].id`, k), h.current = k;
2442
+ (h.current === O || !O) && y && m(`${r}[${a}].id`, k), h.current = k;
2443
2443
  }, [k]), /* @__PURE__ */ n("div", { className: "flex w-full align-center justify-center", children: [
2444
2444
  /* @__PURE__ */ e(
2445
2445
  le,
2446
2446
  {
2447
- name: `${i}[${a}].label`,
2447
+ name: `${r}[${a}].label`,
2448
2448
  as: H,
2449
2449
  className: "flex-grow",
2450
2450
  required: !0,
@@ -2469,15 +2469,15 @@ const _i = U.memo(
2469
2469
  )
2470
2470
  ] });
2471
2471
  },
2472
- function(a, r) {
2473
- return a.index === r.index && a.enumValuesPath === r.enumValuesPath && a.shouldUpdateId === r.shouldUpdateId && a.inferredEntry === r.inferredEntry && a.autoFocus === r.autoFocus;
2472
+ function(a, i) {
2473
+ return a.index === i.index && a.enumValuesPath === i.enumValuesPath && a.shouldUpdateId === i.shouldUpdateId && a.inferredEntry === i.inferredEntry && a.autoFocus === i.autoFocus;
2474
2474
  }
2475
2475
  );
2476
2476
  function ki({
2477
2477
  index: t,
2478
2478
  open: a,
2479
- onClose: r,
2480
- enumValuesPath: i
2479
+ onClose: i,
2480
+ enumValuesPath: r
2481
2481
  }) {
2482
2482
  const {
2483
2483
  values: s,
@@ -2485,20 +2485,20 @@ function ki({
2485
2485
  errors: l,
2486
2486
  setFieldValue: d,
2487
2487
  touched: p
2488
- } = $(), u = t !== void 0 ? P(l, `${i}[${t}].id`) : void 0;
2488
+ } = $(), u = t !== void 0 ? P(l, `${r}[${t}].id`) : void 0;
2489
2489
  return /* @__PURE__ */ n(
2490
2490
  Fe,
2491
2491
  {
2492
2492
  maxWidth: "md",
2493
2493
  "aria-labelledby": "enum-edit-dialog",
2494
2494
  open: a,
2495
- onOpenChange: (c) => c ? void 0 : r(),
2495
+ onOpenChange: (c) => c ? void 0 : i(),
2496
2496
  children: [
2497
2497
  /* @__PURE__ */ e(Be, { children: t !== void 0 && /* @__PURE__ */ n("div", { children: [
2498
2498
  /* @__PURE__ */ e(
2499
2499
  le,
2500
2500
  {
2501
- name: `${i}[${t}]id`,
2501
+ name: `${r}[${t}]id`,
2502
2502
  as: H,
2503
2503
  required: !0,
2504
2504
  validate: Ci,
@@ -2515,7 +2515,7 @@ function ki({
2515
2515
  {
2516
2516
  autoFocus: !0,
2517
2517
  variant: "outlined",
2518
- onClick: r,
2518
+ onClick: i,
2519
2519
  color: "primary",
2520
2520
  children: "Ok"
2521
2521
  }
@@ -2533,14 +2533,14 @@ function Ci(t) {
2533
2533
  return t || (a = "You must specify an ID"), a;
2534
2534
  }
2535
2535
  function je({ disabled: t }) {
2536
- const { values: a, handleChange: r } = $(), i = "validation.required", s = "validation.requiredMessage";
2536
+ const { values: a, handleChange: i } = $(), r = "validation.required", s = "validation.requiredMessage";
2537
2537
  return /* @__PURE__ */ n(D, { children: [
2538
2538
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2539
2539
  le,
2540
2540
  {
2541
2541
  type: "checkbox",
2542
2542
  disabled: t,
2543
- name: i,
2543
+ name: r,
2544
2544
  label: "Required",
2545
2545
  tooltip: "You won't be able to save this entity if this value is not set",
2546
2546
  component: he
@@ -2557,7 +2557,7 @@ function je({ disabled: t }) {
2557
2557
  component: he
2558
2558
  }
2559
2559
  ) }),
2560
- P(a, i) && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2560
+ P(a, r) && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2561
2561
  H,
2562
2562
  {
2563
2563
  disabled: t,
@@ -2565,7 +2565,7 @@ function je({ disabled: t }) {
2565
2565
  label: "Required message",
2566
2566
  name: s,
2567
2567
  size: "small",
2568
- onChange: r
2568
+ onChange: i
2569
2569
  }
2570
2570
  ) })
2571
2571
  ] });
@@ -2573,8 +2573,8 @@ function je({ disabled: t }) {
2573
2573
  function De({
2574
2574
  length: t,
2575
2575
  lowercase: a,
2576
- matches: r,
2577
- max: i,
2576
+ matches: i,
2577
+ max: r,
2578
2578
  min: s,
2579
2579
  trim: o,
2580
2580
  uppercase: l,
@@ -2585,7 +2585,7 @@ function De({
2585
2585
  values: u,
2586
2586
  handleChange: c,
2587
2587
  errors: m
2588
- } = $(), b = "validation.length", g = "validation.min", y = "validation.max", C = "validation.trim", k = "validation.matches", x = "validation.lowercase", h = "validation.uppercase", _ = P(m, k), v = P(u, k), w = typeof v == "string" ? v : xa(v);
2588
+ } = $(), b = "validation.length", g = "validation.min", y = "validation.max", O = "validation.trim", k = "validation.matches", x = "validation.lowercase", h = "validation.uppercase", _ = P(m, k), v = P(u, k), w = typeof v == "string" ? v : xa(v);
2589
2589
  return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
2590
2590
  /* @__PURE__ */ e(je, { disabled: d }),
2591
2591
  /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
@@ -2613,7 +2613,7 @@ function De({
2613
2613
  le,
2614
2614
  {
2615
2615
  type: "checkbox",
2616
- name: C,
2616
+ name: O,
2617
2617
  label: "Trim",
2618
2618
  disabled: d,
2619
2619
  component: he
@@ -2645,7 +2645,7 @@ function De({
2645
2645
  onChange: c
2646
2646
  }
2647
2647
  ) }),
2648
- i && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2648
+ r && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2649
2649
  H,
2650
2650
  {
2651
2651
  value: P(u, y),
@@ -2658,7 +2658,7 @@ function De({
2658
2658
  }
2659
2659
  ) })
2660
2660
  ] }),
2661
- r && /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2661
+ i && /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2662
2662
  /* @__PURE__ */ e(
2663
2663
  le,
2664
2664
  {
@@ -2679,19 +2679,19 @@ function De({
2679
2679
  function qt({
2680
2680
  max: t = !0,
2681
2681
  min: a = !0,
2682
- disabled: r
2682
+ disabled: i
2683
2683
  }) {
2684
2684
  const {
2685
- values: i,
2685
+ values: r,
2686
2686
  handleChange: s
2687
2687
  } = $(), o = "validation.min", l = "validation.max";
2688
2688
  return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
2689
- /* @__PURE__ */ e(je, { disabled: r }),
2689
+ /* @__PURE__ */ e(je, { disabled: i }),
2690
2690
  a && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2691
2691
  H,
2692
2692
  {
2693
- value: P(i, o),
2694
- disabled: r,
2693
+ value: P(r, o),
2694
+ disabled: i,
2695
2695
  label: "Min length",
2696
2696
  name: o,
2697
2697
  type: "number",
@@ -2702,8 +2702,8 @@ function qt({
2702
2702
  t && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2703
2703
  H,
2704
2704
  {
2705
- value: P(i, l),
2706
- disabled: r,
2705
+ value: P(r, l),
2706
+ disabled: i,
2707
2707
  label: "Max length",
2708
2708
  name: l,
2709
2709
  type: "number",
@@ -2725,7 +2725,7 @@ function ze({
2725
2725
  title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
2726
2726
  /* @__PURE__ */ e(Oa, {}),
2727
2727
  /* @__PURE__ */ e(
2728
- O,
2728
+ C,
2729
2729
  {
2730
2730
  variant: "subtitle2",
2731
2731
  className: "ml-2",
@@ -2740,8 +2740,8 @@ function ze({
2740
2740
  function Et({
2741
2741
  multiselect: t,
2742
2742
  updateIds: a,
2743
- disabled: r,
2744
- showErrors: i,
2743
+ disabled: i,
2744
+ showErrors: r,
2745
2745
  allowDataInference: s,
2746
2746
  getData: o
2747
2747
  }) {
@@ -2752,14 +2752,14 @@ function Et({
2752
2752
  touched: u,
2753
2753
  setFieldError: c,
2754
2754
  setFieldValue: m
2755
- } = $(), b = Re(), g = t ? "of.enumValues" : "enumValues", y = P(l, "defaultValue"), C = P(l, g), k = $t(() => !C || typeof C == "boolean" ? [] : Pa(C) ?? [], [C]);
2755
+ } = $(), b = Re(), g = t ? "of.enumValues" : "enumValues", y = P(l, "defaultValue"), O = P(l, g), k = $t(() => !O || typeof O == "boolean" ? [] : Pa(O) ?? [], [O]);
2756
2756
  return /* @__PURE__ */ n(D, { children: [
2757
2757
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2758
2758
  vi,
2759
2759
  {
2760
2760
  enumValues: k,
2761
2761
  updateIds: a,
2762
- disabled: r,
2762
+ disabled: i,
2763
2763
  allowDataInference: s,
2764
2764
  onError: (h) => {
2765
2765
  c(g, h ? "" : void 0);
@@ -2780,16 +2780,16 @@ function Et({
2780
2780
  !t && /* @__PURE__ */ e(
2781
2781
  De,
2782
2782
  {
2783
- disabled: r,
2784
- showErrors: i
2783
+ disabled: i,
2784
+ showErrors: r
2785
2785
  }
2786
2786
  ),
2787
- t && /* @__PURE__ */ e(qt, { disabled: r })
2787
+ t && /* @__PURE__ */ e(qt, { disabled: i })
2788
2788
  ] }) }),
2789
2789
  !t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2790
2790
  Se,
2791
2791
  {
2792
- disabled: r,
2792
+ disabled: i,
2793
2793
  position: "item-aligned",
2794
2794
  onValueChange: (h) => {
2795
2795
  m("defaultValue", h);
@@ -2818,12 +2818,12 @@ const nt = {
2818
2818
  function Dt({
2819
2819
  multiple: t,
2820
2820
  existing: a,
2821
- disabled: r
2821
+ disabled: i
2822
2822
  }) {
2823
2823
  const {
2824
- values: i,
2824
+ values: r,
2825
2825
  setFieldValue: s
2826
- } = $(), o = t ? "of.storage" : "storage", l = `${o}.acceptedFiles`, d = `${o}.fileName`, p = `${o}.storagePath`, u = `${o}.storeUrl`, c = P(i, d) ?? "{rand}_{file}", m = P(i, p) ?? "/", b = P(i, l), g = Array.isArray(b) ? b : void 0, y = !g || g.length === 0, C = (h) => {
2826
+ } = $(), o = t ? "of.storage" : "storage", l = `${o}.acceptedFiles`, d = `${o}.fileName`, p = `${o}.storagePath`, u = `${o}.storeUrl`, c = P(r, d) ?? "{rand}_{file}", m = P(r, p) ?? "/", b = P(r, l), g = Array.isArray(b) ? b : void 0, y = !g || g.length === 0, O = (h) => {
2827
2827
  h ? h.includes("all") || h.length >= Object.keys(nt).length ? s(l, void 0) : y ? s(l, Object.keys(nt).filter((_) => !h.includes(_))) : s(l, h) : s(l, void 0);
2828
2828
  }, k = typeof c == "function", x = typeof m == "function";
2829
2829
  return /* @__PURE__ */ n(D, { children: [
@@ -2833,7 +2833,7 @@ function Dt({
2833
2833
  title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
2834
2834
  /* @__PURE__ */ e(Na, {}),
2835
2835
  /* @__PURE__ */ e(
2836
- O,
2836
+ C,
2837
2837
  {
2838
2838
  variant: "subtitle2",
2839
2839
  className: "ml-2",
@@ -2845,10 +2845,10 @@ function Dt({
2845
2845
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
2846
2846
  Sa,
2847
2847
  {
2848
- disabled: r,
2848
+ disabled: i,
2849
2849
  name: l,
2850
2850
  value: g ?? [],
2851
- onMultiValueChange: C,
2851
+ onMultiValueChange: O,
2852
2852
  label: y ? void 0 : "Allowed file types",
2853
2853
  renderValues: (h) => !h || h.length === 0 ? "All file types allowed" : h.map((_) => nt[_]).filter((_) => !!_).join(", "),
2854
2854
  children: [
@@ -2889,7 +2889,7 @@ function Dt({
2889
2889
  as: H,
2890
2890
  label: "File name",
2891
2891
  size: "small",
2892
- disabled: k || r,
2892
+ disabled: k || i,
2893
2893
  value: k ? "-" : c
2894
2894
  }
2895
2895
  ) }),
@@ -2900,12 +2900,12 @@ function Dt({
2900
2900
  name: p,
2901
2901
  as: H,
2902
2902
  label: "Storage path",
2903
- disabled: x || r,
2903
+ disabled: x || i,
2904
2904
  size: "small",
2905
2905
  value: x ? "-" : m
2906
2906
  }
2907
2907
  ),
2908
- /* @__PURE__ */ n(O, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: [
2908
+ /* @__PURE__ */ n(C, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: [
2909
2909
  /* @__PURE__ */ e("p", { children: "You can use the following placeholders in the file name and storage path values:" }),
2910
2910
  /* @__PURE__ */ n("ul", { children: [
2911
2911
  /* @__PURE__ */ e("li", { children: "{file} - Full name of the uploaded file" }),
@@ -2923,19 +2923,19 @@ function Dt({
2923
2923
  type: "checkbox",
2924
2924
  name: u,
2925
2925
  label: "Save URL instead of storage path",
2926
- disabled: a || r,
2926
+ disabled: a || i,
2927
2927
  component: he
2928
2928
  }
2929
2929
  ),
2930
2930
  /* @__PURE__ */ e("br", {}),
2931
- /* @__PURE__ */ e(O, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: "Turn this setting on, if you prefer to save the download URL of the uploaded file instead of the storage path. You can only change this prop upon creation." })
2931
+ /* @__PURE__ */ e(C, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: "Turn this setting on, if you prefer to save the download URL of the uploaded file instead of the storage path. You can only change this prop upon creation." })
2932
2932
  ] })
2933
2933
  ] })
2934
2934
  }
2935
2935
  ) }),
2936
2936
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(ze, { children: [
2937
- !t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(je, { disabled: r }) }),
2938
- t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(qt, { disabled: r }) })
2937
+ !t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(je, { disabled: i }) }),
2938
+ t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(qt, { disabled: i }) })
2939
2939
  ] }) })
2940
2940
  ] });
2941
2941
  }
@@ -2948,22 +2948,22 @@ function He(t) {
2948
2948
  }
2949
2949
  }
2950
2950
  function Oi(t) {
2951
- return Object.entries(t).filter(([a, r]) => He(r)).map(([a, r]) => {
2952
- const i = r;
2953
- if (He(i))
2954
- return i.dataType === "map" && i.properties ? {
2951
+ return Object.entries(t).filter(([a, i]) => He(i)).map(([a, i]) => {
2952
+ const r = i;
2953
+ if (He(r))
2954
+ return r.dataType === "map" && r.properties ? {
2955
2955
  [a]: {
2956
- ...i,
2957
- properties: Oi(i.properties)
2956
+ ...r,
2957
+ properties: Oi(r.properties)
2958
2958
  }
2959
- } : { [a]: i };
2960
- }).filter((a) => !!a).reduce((a, r) => ({ ...a, ...r }), {});
2959
+ } : { [a]: r };
2960
+ }).filter((a) => !!a).reduce((a, i) => ({ ...a, ...i }), {});
2961
2961
  }
2962
2962
  function ia({
2963
2963
  property: t,
2964
2964
  onClick: a,
2965
- hasError: r,
2966
- includeName: i,
2965
+ hasError: i,
2966
+ includeName: r,
2967
2967
  includeEditButton: s,
2968
2968
  selected: o
2969
2969
  }) {
@@ -2984,12 +2984,12 @@ function ia({
2984
2984
  a ? Jt : "",
2985
2985
  o ? Qt : "",
2986
2986
  "flex-grow p-4 border transition-colors duration-200",
2987
- r ? "border-red-500" : o ? "border-blue-500" : "border-transparent"
2987
+ i ? "border-red-500" : o ? "border-blue-500" : "border-transparent"
2988
2988
  ),
2989
2989
  children: [
2990
2990
  /* @__PURE__ */ n("div", { className: "w-full flex flex-col", children: [
2991
- i && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
2992
- O,
2991
+ r && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
2992
+ C,
2993
2993
  {
2994
2994
  variant: "body1",
2995
2995
  component: "span",
@@ -2999,17 +2999,17 @@ function ia({
2999
2999
  ) }),
3000
3000
  /* @__PURE__ */ n("div", { className: "flex flex-row items-center", children: [
3001
3001
  /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3002
- O,
3002
+ C,
3003
3003
  {
3004
3004
  className: "flex-grow pr-2",
3005
- variant: i ? "body2" : "subtitle1",
3005
+ variant: r ? "body2" : "subtitle1",
3006
3006
  component: "span",
3007
3007
  color: "secondary",
3008
3008
  children: d?.name
3009
3009
  }
3010
3010
  ) }),
3011
3011
  /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3012
- O,
3012
+ C,
3013
3013
  {
3014
3014
  variant: "body2",
3015
3015
  component: "span",
@@ -3019,7 +3019,7 @@ function ia({
3019
3019
  ) })
3020
3020
  ] })
3021
3021
  ] }),
3022
- s && /* @__PURE__ */ e(O, { variant: "button", children: "EDIT" })
3022
+ s && /* @__PURE__ */ e(C, { variant: "button", children: "EDIT" })
3023
3023
  ]
3024
3024
  }
3025
3025
  )
@@ -3030,14 +3030,14 @@ function ia({
3030
3030
  function Pi({
3031
3031
  name: t,
3032
3032
  selected: a,
3033
- onClick: r,
3034
- property: i
3033
+ onClick: i,
3034
+ property: r
3035
3035
  }) {
3036
- const { propertyConfigs: s } = Ue(), o = !re(i) && i ? We(i, s) : void 0;
3036
+ const { propertyConfigs: s } = Ue(), o = !re(r) && r ? We(r, s) : void 0;
3037
3037
  return /* @__PURE__ */ n(
3038
3038
  "div",
3039
3039
  {
3040
- onClick: r,
3040
+ onClick: i,
3041
3041
  className: "flex flex-row w-full cursor-pointer",
3042
3042
  children: [
3043
3043
  /* @__PURE__ */ n("div", { className: "relative m-4", children: [
@@ -3057,24 +3057,24 @@ function Pi({
3057
3057
  className: xe(
3058
3058
  "pl-2 w-full flex flex-row gap-4 items-center",
3059
3059
  Ht,
3060
- r ? Jt : "",
3060
+ i ? Jt : "",
3061
3061
  a ? Qt : "",
3062
3062
  "flex-grow p-4 border transition-colors duration-200",
3063
3063
  a ? "border-blue-500" : "border-transparent"
3064
3064
  ),
3065
3065
  children: /* @__PURE__ */ n("div", { className: "w-full flex flex-col", children: [
3066
3066
  /* @__PURE__ */ e(
3067
- O,
3067
+ C,
3068
3068
  {
3069
3069
  variant: "body1",
3070
3070
  component: "span",
3071
3071
  className: "flex-grow pr-2",
3072
- children: i?.name ? i.name : t
3072
+ children: r?.name ? r.name : t
3073
3073
  }
3074
3074
  ),
3075
3075
  /* @__PURE__ */ n("div", { className: "flex flex-row items-center", children: [
3076
3076
  o && /* @__PURE__ */ e(
3077
- O,
3077
+ C,
3078
3078
  {
3079
3079
  className: "flex-grow pr-2",
3080
3080
  variant: "body2",
@@ -3083,17 +3083,17 @@ function Pi({
3083
3083
  children: o?.name
3084
3084
  }
3085
3085
  ),
3086
- i && !re(i) && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3087
- O,
3086
+ r && !re(r) && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3087
+ C,
3088
3088
  {
3089
3089
  variant: "body2",
3090
3090
  component: "span",
3091
3091
  color: "disabled",
3092
- children: i.dataType
3092
+ children: r.dataType
3093
3093
  }
3094
3094
  ) }),
3095
- i && re(i) && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3096
- O,
3095
+ r && re(r) && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3096
+ C,
3097
3097
  {
3098
3098
  variant: "body2",
3099
3099
  component: "span",
@@ -3101,8 +3101,8 @@ function Pi({
3101
3101
  children: "This property is defined as a property builder in code"
3102
3102
  }
3103
3103
  ) }),
3104
- !i && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3105
- O,
3104
+ !r && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3105
+ C,
3106
3106
  {
3107
3107
  variant: "body2",
3108
3108
  component: "span",
@@ -3121,8 +3121,8 @@ function Pi({
3121
3121
  function ft({
3122
3122
  namespace: t,
3123
3123
  selectedPropertyKey: a,
3124
- onPropertyClick: r,
3125
- properties: i,
3124
+ onPropertyClick: i,
3125
+ properties: r,
3126
3126
  propertiesOrder: s,
3127
3127
  additionalFields: o,
3128
3128
  errors: l,
@@ -3132,13 +3132,13 @@ function ft({
3132
3132
  inferredPropertyKeys: c,
3133
3133
  collectionEditable: m
3134
3134
  }) {
3135
- const b = s ?? Object.keys(i), g = J((y) => {
3135
+ const b = s ?? Object.keys(r), g = J((y) => {
3136
3136
  if (!y.destination)
3137
3137
  return;
3138
- const C = y.source.index, k = y.destination.index, x = Array.from(b), [h] = x.splice(C, 1);
3138
+ const O = y.source.index, k = y.destination.index, x = Array.from(b), [h] = x.splice(O, 1);
3139
3139
  x.splice(k, 0, h), d && d(x, t);
3140
3140
  }, [t, d, b]);
3141
- return /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(ei, { onDragEnd: g, children: /* @__PURE__ */ e(ti, { droppableId: `droppable_${t}`, children: (y, C) => /* @__PURE__ */ n(
3141
+ return /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(ei, { onDragEnd: g, children: /* @__PURE__ */ e(ti, { droppableId: `droppable_${t}`, children: (y, O) => /* @__PURE__ */ n(
3142
3142
  "div",
3143
3143
  {
3144
3144
  ...y.droppableProps,
@@ -3146,7 +3146,7 @@ function ft({
3146
3146
  className: u,
3147
3147
  children: [
3148
3148
  b && b.map((k, x) => {
3149
- const h = i[k], _ = o?.find((v) => v.key === k);
3149
+ const h = r[k], _ = o?.find((v) => v.key === k);
3150
3150
  return !h && !_ ? (console.warn(`Property ${k} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
3151
3151
  ai,
3152
3152
  {
@@ -3164,7 +3164,7 @@ function ft({
3164
3164
  inferredPropertyKeys: c,
3165
3165
  onPropertyMove: d,
3166
3166
  onPropertyRemove: p,
3167
- onPropertyClick: w.isDragging ? void 0 : r,
3167
+ onPropertyClick: w.isDragging ? void 0 : i,
3168
3168
  selectedPropertyKey: a,
3169
3169
  collectionEditable: m
3170
3170
  }
@@ -3181,8 +3181,8 @@ function ft({
3181
3181
  function Ni({
3182
3182
  propertyKey: t,
3183
3183
  namespace: a,
3184
- propertyOrBuilder: r,
3185
- additionalField: i,
3184
+ propertyOrBuilder: i,
3185
+ additionalField: r,
3186
3186
  provided: s,
3187
3187
  selectedPropertyKey: o,
3188
3188
  errors: l,
@@ -3194,8 +3194,8 @@ function Ni({
3194
3194
  }) {
3195
3195
  const b = c?.includes(a ? `${a}.${t}` : t), g = se(t, a);
3196
3196
  let y;
3197
- if (typeof r == "object") {
3198
- const h = r;
3197
+ if (typeof i == "object") {
3198
+ const h = i;
3199
3199
  h.dataType === "map" && h.properties && (y = /* @__PURE__ */ e(
3200
3200
  ft,
3201
3201
  {
@@ -3211,7 +3211,7 @@ function Ni({
3211
3211
  }
3212
3212
  ));
3213
3213
  }
3214
- const C = g ? P(l, ke(g)) : !1, k = o === g, x = r && (m && !re(r) || He(r));
3214
+ const O = g ? P(l, ke(g)) : !1, k = o === g, x = i && (m && !re(i) || He(i));
3215
3215
  return /* @__PURE__ */ n(
3216
3216
  "div",
3217
3217
  {
@@ -3231,20 +3231,20 @@ function Ni({
3231
3231
  }
3232
3232
  }
3233
3233
  ),
3234
- !re(r) && !i && x ? /* @__PURE__ */ e(
3234
+ !re(i) && !r && x ? /* @__PURE__ */ e(
3235
3235
  ia,
3236
3236
  {
3237
- property: r,
3237
+ property: i,
3238
3238
  onClick: d ? () => d(t, a) : void 0,
3239
3239
  includeName: !0,
3240
3240
  selected: k,
3241
- hasError: C
3241
+ hasError: O
3242
3242
  }
3243
3243
  ) : /* @__PURE__ */ e(
3244
3244
  Pi,
3245
3245
  {
3246
3246
  name: t,
3247
- property: r,
3247
+ property: i,
3248
3248
  onClick: d ? () => d(t, a) : void 0,
3249
3249
  selected: k
3250
3250
  }
@@ -3274,7 +3274,7 @@ function Ni({
3274
3274
  }
3275
3275
  );
3276
3276
  }
3277
- function Si({ disabled: t, getData: a, allowDataInference: r, propertyConfigs: i, collectionEditable: s }) {
3277
+ function Si({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r, collectionEditable: s }) {
3278
3278
  const {
3279
3279
  values: o,
3280
3280
  setFieldValue: l
@@ -3288,7 +3288,7 @@ function Si({ disabled: t, getData: a, allowDataInference: r, propertyConfigs: i
3288
3288
  ...o.properties ?? {},
3289
3289
  [w]: V
3290
3290
  }, !1), l("propertiesOrder", [...g, w], !1), p(!1);
3291
- }, [o.properties, g]), C = J((w, V) => {
3291
+ }, [o.properties, g]), O = J((w, V) => {
3292
3292
  const I = w ? se(w, V) : void 0;
3293
3293
  if (!I)
3294
3294
  throw Error("collection editor miss config");
@@ -3312,7 +3312,7 @@ function Si({ disabled: t, getData: a, allowDataInference: r, propertyConfigs: i
3312
3312
  return /* @__PURE__ */ n(D, { children: [
3313
3313
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3314
3314
  /* @__PURE__ */ n("div", { className: "flex justify-between items-end my-4", children: [
3315
- /* @__PURE__ */ e(O, { variant: "subtitle2", children: "Properties in this group" }),
3315
+ /* @__PURE__ */ e(C, { variant: "subtitle2", children: "Properties in this group" }),
3316
3316
  h
3317
3317
  ] }),
3318
3318
  /* @__PURE__ */ n(qe, { className: "p-2 pl-8", children: [
@@ -3330,7 +3330,7 @@ function Si({ disabled: t, getData: a, allowDataInference: r, propertyConfigs: i
3330
3330
  }
3331
3331
  ),
3332
3332
  _ && /* @__PURE__ */ e(
3333
- O,
3333
+ C,
3334
3334
  {
3335
3335
  variant: "label",
3336
3336
  className: "h-full flex items-center justify-center p-4",
@@ -3358,7 +3358,7 @@ function Si({ disabled: t, getData: a, allowDataInference: r, propertyConfigs: i
3358
3358
  inArray: !1,
3359
3359
  forceShowErrors: !1,
3360
3360
  open: d,
3361
- allowDataInference: r,
3361
+ allowDataInference: i,
3362
3362
  collectionEditable: s,
3363
3363
  onCancel: () => {
3364
3364
  p(!1), c(void 0), b(void 0);
@@ -3367,7 +3367,7 @@ function Si({ disabled: t, getData: a, allowDataInference: r, propertyConfigs: i
3367
3367
  p(!1), c(void 0), b(void 0);
3368
3368
  },
3369
3369
  getData: a,
3370
- onDelete: C,
3370
+ onDelete: O,
3371
3371
  propertyKey: u,
3372
3372
  propertyNamespace: m,
3373
3373
  property: x,
@@ -3376,7 +3376,7 @@ function Si({ disabled: t, getData: a, allowDataInference: r, propertyConfigs: i
3376
3376
  autoOpenTypeSelect: !u,
3377
3377
  onPropertyChanged: y,
3378
3378
  existingPropertyKeys: u ? void 0 : g,
3379
- propertyConfigs: i
3379
+ propertyConfigs: r
3380
3380
  }
3381
3381
  )
3382
3382
  ] });
@@ -3384,8 +3384,8 @@ function Si({ disabled: t, getData: a, allowDataInference: r, propertyConfigs: i
3384
3384
  function qi({
3385
3385
  showErrors: t,
3386
3386
  existing: a,
3387
- disabled: r,
3388
- getData: i,
3387
+ disabled: i,
3388
+ getData: r,
3389
3389
  allowDataInference: s,
3390
3390
  propertyConfigs: o,
3391
3391
  collectionEditable: l
@@ -3396,12 +3396,12 @@ function qi({
3396
3396
  errors: u,
3397
3397
  setFieldValue: c,
3398
3398
  touched: m
3399
- } = $(), [b, g] = K(!1), y = P(d, "of"), C = P(m, "of") && P(u, "of"), k = J(({ id: h, property: _, namespace: v }) => {
3399
+ } = $(), [b, g] = K(!1), y = P(d, "of"), O = P(m, "of") && P(u, "of"), k = J(({ id: h, property: _, namespace: v }) => {
3400
3400
  c("of", _);
3401
3401
  }, []), x = y && We(y, o);
3402
3402
  return /* @__PURE__ */ n(D, { children: [
3403
3403
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3404
- /* @__PURE__ */ e(O, { variant: "subtitle2", children: "Repeat component" }),
3404
+ /* @__PURE__ */ e(C, { variant: "subtitle2", children: "Repeat component" }),
3405
3405
  /* @__PURE__ */ e(
3406
3406
  ye,
3407
3407
  {
@@ -3413,19 +3413,19 @@ function qi({
3413
3413
  ia,
3414
3414
  {
3415
3415
  property: y,
3416
- onClick: r ? void 0 : () => g(!0),
3416
+ onClick: i ? void 0 : () => g(!0),
3417
3417
  includeName: !1,
3418
3418
  includeEditButton: !0,
3419
3419
  selected: !1,
3420
3420
  hasError: !1
3421
3421
  }
3422
3422
  ),
3423
- !r && !y && /* @__PURE__ */ n(
3423
+ !i && !y && /* @__PURE__ */ n(
3424
3424
  E,
3425
3425
  {
3426
3426
  variant: "text",
3427
3427
  size: "large",
3428
- color: C ? "error" : "primary",
3428
+ color: O ? "error" : "primary",
3429
3429
  onClick: () => g(!0),
3430
3430
  children: [
3431
3431
  "Edit ",
@@ -3439,7 +3439,7 @@ function qi({
3439
3439
  inArray: !0,
3440
3440
  open: b,
3441
3441
  existingProperty: a,
3442
- getData: i,
3442
+ getData: r,
3443
3443
  autoUpdateId: !a,
3444
3444
  autoOpenTypeSelect: !a,
3445
3445
  onOkClicked: () => g(!1),
@@ -3456,14 +3456,14 @@ function qi({
3456
3456
  }
3457
3457
  )
3458
3458
  ] }),
3459
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(qt, { disabled: r }) }) })
3459
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(qt, { disabled: i }) }) })
3460
3460
  ] });
3461
3461
  }
3462
3462
  const Ai = U.forwardRef(
3463
3463
  function({
3464
3464
  showErrors: a,
3465
- disabledId: r,
3466
- existingPropertyKeys: i,
3465
+ disabledId: i,
3466
+ existingPropertyKeys: r,
3467
3467
  disabled: s,
3468
3468
  isNewProperty: o
3469
3469
  }, l) {
@@ -3495,8 +3495,8 @@ const Ai = U.forwardRef(
3495
3495
  name: c,
3496
3496
  as: Te,
3497
3497
  label: "ID",
3498
- validate: (y) => Ti(y, i),
3499
- disabled: r || s,
3498
+ validate: (y) => Ti(y, r),
3499
+ disabled: i || s,
3500
3500
  required: !0,
3501
3501
  size: "small",
3502
3502
  error: !!m
@@ -3521,8 +3521,8 @@ const Ai = U.forwardRef(
3521
3521
  }
3522
3522
  ), zi = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
3523
3523
  function Ti(t, a) {
3524
- let r;
3525
- return t || (r = "You must specify an id for the field"), t && !t.match(zi) && (r = "The id can only contain letters, numbers and underscores (_), and not start with a number"), t && a && a.includes(t) && (r = "There is another field with this ID already"), r;
3524
+ let i;
3525
+ return t || (i = "You must specify an id for the field"), t && !t.match(zi) && (i = "The id can only contain letters, numbers and underscores (_), and not start with a number"), t && a && a.includes(t) && (i = "There is another field with this ID already"), i;
3526
3526
  }
3527
3527
  function Vi(t) {
3528
3528
  let a;
@@ -3531,9 +3531,9 @@ function Vi(t) {
3531
3531
  function Ii({
3532
3532
  widgetId: t,
3533
3533
  disabled: a,
3534
- showErrors: r
3534
+ showErrors: i
3535
3535
  }) {
3536
- const { values: i, setFieldValue: s } = $();
3536
+ const { values: r, setFieldValue: s } = $();
3537
3537
  return /* @__PURE__ */ n(D, { children: [
3538
3538
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(ze, { children: [
3539
3539
  t === "text_field" && /* @__PURE__ */ e(
@@ -3547,7 +3547,7 @@ function Ii({
3547
3547
  min: !0,
3548
3548
  trim: !0,
3549
3549
  uppercase: !0,
3550
- showErrors: r
3550
+ showErrors: i
3551
3551
  }
3552
3552
  ),
3553
3553
  t === "multiline" && /* @__PURE__ */ e(
@@ -3560,7 +3560,7 @@ function Ii({
3560
3560
  min: !0,
3561
3561
  trim: !0,
3562
3562
  uppercase: !0,
3563
- showErrors: r
3563
+ showErrors: i
3564
3564
  }
3565
3565
  ),
3566
3566
  t === "markdown" && /* @__PURE__ */ e(
@@ -3573,7 +3573,7 @@ function Ii({
3573
3573
  min: !0,
3574
3574
  trim: !0,
3575
3575
  uppercase: !0,
3576
- showErrors: r
3576
+ showErrors: i
3577
3577
  }
3578
3578
  ),
3579
3579
  t === "email" && /* @__PURE__ */ e(
@@ -3583,7 +3583,7 @@ function Ii({
3583
3583
  max: !0,
3584
3584
  min: !0,
3585
3585
  trim: !0,
3586
- showErrors: r
3586
+ showErrors: i
3587
3587
  }
3588
3588
  )
3589
3589
  ] }) }),
@@ -3596,13 +3596,13 @@ function Ii({
3596
3596
  s("defaultValue", o.target.value === "" ? void 0 : o.target.value);
3597
3597
  },
3598
3598
  label: "Default value",
3599
- value: P(i, "defaultValue") ?? ""
3599
+ value: P(r, "defaultValue") ?? ""
3600
3600
  }
3601
3601
  ) })
3602
3602
  ] });
3603
3603
  }
3604
3604
  function Fi({ disabled: t }) {
3605
- const { values: a } = $(), r = P(a, "defaultValue");
3605
+ const { values: a } = $(), i = P(a, "defaultValue");
3606
3606
  return /* @__PURE__ */ n(D, { children: [
3607
3607
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(je, { disabled: t }) }) }),
3608
3608
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
@@ -3610,7 +3610,7 @@ function Fi({ disabled: t }) {
3610
3610
  {
3611
3611
  type: "checkbox",
3612
3612
  name: "defaultValue",
3613
- label: r == null ? "Default value not set" : "Default value is " + r.toString(),
3613
+ label: i == null ? "Default value not set" : "Default value is " + i.toString(),
3614
3614
  disabled: t,
3615
3615
  allowIndeterminate: !0,
3616
3616
  component: he
@@ -3618,7 +3618,7 @@ function Fi({ disabled: t }) {
3618
3618
  ) })
3619
3619
  ] });
3620
3620
  }
3621
- function ji({ disabled: t, getData: a, allowDataInference: r, propertyConfigs: i, collectionEditable: s }) {
3621
+ function ji({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r, collectionEditable: s }) {
3622
3622
  const {
3623
3623
  values: o,
3624
3624
  setFieldValue: l
@@ -3632,7 +3632,7 @@ function ji({ disabled: t, getData: a, allowDataInference: r, propertyConfigs: i
3632
3632
  ...o.oneOf?.properties ?? {},
3633
3633
  [_]: v
3634
3634
  }, !1), l("oneOf.propertiesOrder", [...o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), _], !1), p(!1);
3635
- }, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), y = u ? se(u, m) : void 0, C = y ? P(o.oneOf?.properties, y.replaceAll(".", ".properties.")) : void 0, k = J((_, v) => {
3635
+ }, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), y = u ? se(u, m) : void 0, O = y ? P(o.oneOf?.properties, y.replaceAll(".", ".properties.")) : void 0, k = J((_, v) => {
3636
3636
  const w = _ ? se(_, v) : void 0;
3637
3637
  if (!w)
3638
3638
  throw Error("collection editor miss config");
@@ -3657,7 +3657,7 @@ function ji({ disabled: t, getData: a, allowDataInference: r, propertyConfigs: i
3657
3657
  return /* @__PURE__ */ n(D, { children: [
3658
3658
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3659
3659
  /* @__PURE__ */ n("div", { className: "flex justify-between items-end mt-8 mb-4", children: [
3660
- /* @__PURE__ */ e(O, { variant: "subtitle2", children: "Properties in this block" }),
3660
+ /* @__PURE__ */ e(C, { variant: "subtitle2", children: "Properties in this block" }),
3661
3661
  x
3662
3662
  ] }),
3663
3663
  /* @__PURE__ */ n(qe, { className: "p-2 pl-8", children: [
@@ -3684,7 +3684,7 @@ function ji({ disabled: t, getData: a, allowDataInference: r, propertyConfigs: i
3684
3684
  forceShowErrors: !1,
3685
3685
  open: d,
3686
3686
  getData: a,
3687
- allowDataInference: r,
3687
+ allowDataInference: i,
3688
3688
  onCancel: () => {
3689
3689
  p(!1), c(void 0), b(void 0);
3690
3690
  },
@@ -3695,13 +3695,13 @@ function ji({ disabled: t, getData: a, allowDataInference: r, propertyConfigs: i
3695
3695
  onDelete: k,
3696
3696
  propertyKey: u,
3697
3697
  propertyNamespace: m,
3698
- property: C,
3698
+ property: O,
3699
3699
  existingProperty: !!u,
3700
3700
  autoUpdateId: !u,
3701
3701
  autoOpenTypeSelect: !u,
3702
3702
  onPropertyChanged: g,
3703
3703
  existingPropertyKeys: u ? void 0 : o.oneOf?.propertiesOrder,
3704
- propertyConfigs: i
3704
+ propertyConfigs: r
3705
3705
  }
3706
3706
  )
3707
3707
  ] });
@@ -3709,20 +3709,20 @@ function ji({ disabled: t, getData: a, allowDataInference: r, propertyConfigs: i
3709
3709
  function Ei({ disabled: t }) {
3710
3710
  const {
3711
3711
  values: a,
3712
- handleChange: r
3713
- } = $(), i = "validation.min", s = "validation.max", o = "validation.lessThan", l = "validation.moreThan", d = "validation.positive", p = "validation.negative", u = "validation.integer";
3712
+ handleChange: i
3713
+ } = $(), r = "validation.min", s = "validation.max", o = "validation.lessThan", l = "validation.moreThan", d = "validation.positive", p = "validation.negative", u = "validation.integer";
3714
3714
  return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
3715
3715
  /* @__PURE__ */ e(je, { disabled: t }),
3716
3716
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3717
3717
  H,
3718
3718
  {
3719
- value: P(a, i),
3719
+ value: P(a, r),
3720
3720
  label: "Min value",
3721
- name: i,
3721
+ name: r,
3722
3722
  type: "number",
3723
3723
  size: "small",
3724
3724
  disabled: t,
3725
- onChange: r
3725
+ onChange: i
3726
3726
  }
3727
3727
  ) }),
3728
3728
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
@@ -3734,7 +3734,7 @@ function Ei({ disabled: t }) {
3734
3734
  type: "number",
3735
3735
  size: "small",
3736
3736
  disabled: t,
3737
- onChange: r
3737
+ onChange: i
3738
3738
  }
3739
3739
  ) }),
3740
3740
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
@@ -3746,7 +3746,7 @@ function Ei({ disabled: t }) {
3746
3746
  type: "number",
3747
3747
  size: "small",
3748
3748
  disabled: t,
3749
- onChange: r
3749
+ onChange: i
3750
3750
  }
3751
3751
  ) }),
3752
3752
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
@@ -3758,7 +3758,7 @@ function Ei({ disabled: t }) {
3758
3758
  type: "number",
3759
3759
  size: "small",
3760
3760
  disabled: t,
3761
- onChange: r
3761
+ onChange: i
3762
3762
  }
3763
3763
  ) }),
3764
3764
  /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
@@ -3794,7 +3794,7 @@ function Ei({ disabled: t }) {
3794
3794
  ] });
3795
3795
  }
3796
3796
  function Di({ disabled: t }) {
3797
- const { values: a, setFieldValue: r } = $();
3797
+ const { values: a, setFieldValue: i } = $();
3798
3798
  return /* @__PURE__ */ n(D, { children: [
3799
3799
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Ei, { disabled: t }) }) }),
3800
3800
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
@@ -3803,8 +3803,8 @@ function Di({ disabled: t }) {
3803
3803
  name: "defaultValue",
3804
3804
  disabled: t,
3805
3805
  type: "number",
3806
- onChange: (i) => {
3807
- r("defaultValue", i.target.value === "" ? void 0 : parseFloat(i.target.value));
3806
+ onChange: (r) => {
3807
+ i("defaultValue", r.target.value === "" ? void 0 : parseFloat(r.target.value));
3808
3808
  },
3809
3809
  label: "Default value",
3810
3810
  value: P(a, "defaultValue") ?? ""
@@ -3815,8 +3815,8 @@ function Di({ disabled: t }) {
3815
3815
  function Bt({
3816
3816
  existing: t,
3817
3817
  multiple: a,
3818
- disabled: r,
3819
- showErrors: i
3818
+ disabled: i,
3819
+ showErrors: r
3820
3820
  }) {
3821
3821
  const {
3822
3822
  values: s,
@@ -3828,7 +3828,7 @@ function Bt({
3828
3828
  } = $();
3829
3829
  if (!$e())
3830
3830
  return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Qe, {}) });
3831
- const m = a ? "of.path" : "path", b = P(s, m), g = i && P(l, m);
3831
+ const m = a ? "of.path" : "path", b = P(s, m), g = r && P(l, m);
3832
3832
  return console.log("pathError", l, g), /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3833
3833
  ye,
3834
3834
  {
@@ -3837,7 +3837,7 @@ function Bt({
3837
3837
  pathPath: m,
3838
3838
  type: "select",
3839
3839
  validate: Bi,
3840
- disabled: t || r,
3840
+ disabled: t || i,
3841
3841
  value: b,
3842
3842
  error: g,
3843
3843
  handleChange: o,
@@ -3852,8 +3852,8 @@ function Bi(t) {
3852
3852
  function Mi({
3853
3853
  disabled: t,
3854
3854
  pathPath: a,
3855
- value: r,
3856
- handleChange: i,
3855
+ value: i,
3856
+ handleChange: r,
3857
3857
  error: s,
3858
3858
  ...o
3859
3859
  }) {
@@ -3870,10 +3870,10 @@ function Mi({
3870
3870
  {
3871
3871
  error: !!s,
3872
3872
  disabled: t,
3873
- value: r ?? "",
3873
+ value: i ?? "",
3874
3874
  position: "item-aligned",
3875
3875
  name: a,
3876
- onChange: i,
3876
+ onChange: r,
3877
3877
  label: "Target collection",
3878
3878
  renderValue: (c) => {
3879
3879
  const m = d.find((g) => g.alias === c || g.path === c);
@@ -3883,7 +3883,7 @@ function Mi({
3883
3883
  return /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
3884
3884
  b,
3885
3885
  /* @__PURE__ */ e(
3886
- O,
3886
+ C,
3887
3887
  {
3888
3888
  variant: "subtitle2",
3889
3889
  className: "font-medium ml-4",
@@ -3907,7 +3907,7 @@ function Mi({
3907
3907
  children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
3908
3908
  b,
3909
3909
  /* @__PURE__ */ e(
3910
- O,
3910
+ C,
3911
3911
  {
3912
3912
  variant: "subtitle2",
3913
3913
  className: "font-medium ml-4",
@@ -3931,7 +3931,7 @@ function Mi({
3931
3931
  children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
3932
3932
  m,
3933
3933
  /* @__PURE__ */ e(
3934
- O,
3934
+ C,
3935
3935
  {
3936
3936
  variant: "subtitle2",
3937
3937
  className: "font-medium ml-4",
@@ -3952,10 +3952,10 @@ function Mi({
3952
3952
  function Ri({ disabled: t }) {
3953
3953
  const {
3954
3954
  values: a,
3955
- errors: r,
3956
- touched: i,
3955
+ errors: i,
3956
+ touched: r,
3957
3957
  setFieldValue: s
3958
- } = $(), o = "mode", l = P(a, o), d = P(i, o) && P(r, o), p = "autoValue", u = P(a, p), c = P(i, p) && P(r, p);
3958
+ } = $(), o = "mode", l = P(a, o), d = P(r, o) && P(i, o), p = "autoValue", u = P(a, p), c = P(r, p) && P(i, p);
3959
3959
  return /* @__PURE__ */ n(D, { children: [
3960
3960
  /* @__PURE__ */ n("div", { className: "flex flex-col col-span-12", children: [
3961
3961
  /* @__PURE__ */ n(
@@ -4044,9 +4044,9 @@ function Ui({ disabled: t }) {
4044
4044
  function $i({ disabled: t }) {
4045
4045
  return /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(je, { disabled: t }) }) }) });
4046
4046
  }
4047
- function ra(t, a, r) {
4048
- let i;
4049
- return a === "text_field" ? i = Y(
4047
+ function ra(t, a, i) {
4048
+ let r;
4049
+ return a === "text_field" ? r = Y(
4050
4050
  t,
4051
4051
  {
4052
4052
  dataType: "string",
@@ -4059,7 +4059,7 @@ function ra(t, a, r) {
4059
4059
  url: void 0,
4060
4060
  enumValues: void 0
4061
4061
  }
4062
- ) : a === "multiline" ? i = Y(
4062
+ ) : a === "multiline" ? r = Y(
4063
4063
  t,
4064
4064
  {
4065
4065
  dataType: "string",
@@ -4072,7 +4072,7 @@ function ra(t, a, r) {
4072
4072
  url: void 0,
4073
4073
  enumValues: void 0
4074
4074
  }
4075
- ) : a === "markdown" ? i = Y(
4075
+ ) : a === "markdown" ? r = Y(
4076
4076
  t,
4077
4077
  {
4078
4078
  dataType: "string",
@@ -4084,7 +4084,7 @@ function ra(t, a, r) {
4084
4084
  email: void 0,
4085
4085
  url: void 0
4086
4086
  }
4087
- ) : a === "url" ? i = Y(
4087
+ ) : a === "url" ? r = Y(
4088
4088
  t,
4089
4089
  {
4090
4090
  dataType: "string",
@@ -4097,7 +4097,7 @@ function ra(t, a, r) {
4097
4097
  url: !0,
4098
4098
  enumValues: void 0
4099
4099
  }
4100
- ) : a === "email" ? i = Y(
4100
+ ) : a === "email" ? r = Y(
4101
4101
  t,
4102
4102
  {
4103
4103
  dataType: "string",
@@ -4110,7 +4110,7 @@ function ra(t, a, r) {
4110
4110
  url: void 0,
4111
4111
  enumValues: void 0
4112
4112
  }
4113
- ) : a === "select" ? i = Y(
4113
+ ) : a === "select" ? r = Y(
4114
4114
  t,
4115
4115
  {
4116
4116
  dataType: "string",
@@ -4123,7 +4123,7 @@ function ra(t, a, r) {
4123
4123
  url: void 0,
4124
4124
  enumValues: t.enumValues ?? []
4125
4125
  }
4126
- ) : a === "multi_select" ? i = Y(
4126
+ ) : a === "multi_select" ? r = Y(
4127
4127
  t,
4128
4128
  {
4129
4129
  dataType: "array",
@@ -4134,7 +4134,7 @@ function ra(t, a, r) {
4134
4134
  enumValues: t.of?.enumValues ?? []
4135
4135
  }
4136
4136
  }
4137
- ) : a === "number_input" ? i = Y(
4137
+ ) : a === "number_input" ? r = Y(
4138
4138
  t,
4139
4139
  {
4140
4140
  dataType: "number",
@@ -4142,7 +4142,7 @@ function ra(t, a, r) {
4142
4142
  editable: t.editable !== void 0 ? t.editable : !0,
4143
4143
  enumValues: void 0
4144
4144
  }
4145
- ) : a === "number_select" ? i = Y(
4145
+ ) : a === "number_select" ? r = Y(
4146
4146
  t,
4147
4147
  {
4148
4148
  dataType: "number",
@@ -4150,7 +4150,7 @@ function ra(t, a, r) {
4150
4150
  editable: t.editable !== void 0 ? t.editable : !0,
4151
4151
  enumValues: t.enumValues ?? []
4152
4152
  }
4153
- ) : a === "multi_number_select" ? i = Y(
4153
+ ) : a === "multi_number_select" ? r = Y(
4154
4154
  t,
4155
4155
  {
4156
4156
  dataType: "array",
@@ -4161,7 +4161,7 @@ function ra(t, a, r) {
4161
4161
  enumValues: t.of?.enumValues ?? []
4162
4162
  }
4163
4163
  }
4164
- ) : a === "file_upload" ? i = Y(
4164
+ ) : a === "file_upload" ? r = Y(
4165
4165
  t,
4166
4166
  {
4167
4167
  dataType: "string",
@@ -4171,7 +4171,7 @@ function ra(t, a, r) {
4171
4171
  storagePath: "/"
4172
4172
  }
4173
4173
  }
4174
- ) : a === "multi_file_upload" ? i = Y(
4174
+ ) : a === "multi_file_upload" ? r = Y(
4175
4175
  t,
4176
4176
  {
4177
4177
  dataType: "array",
@@ -4184,7 +4184,7 @@ function ra(t, a, r) {
4184
4184
  }
4185
4185
  }
4186
4186
  }
4187
- ) : a === "group" ? i = Y(
4187
+ ) : a === "group" ? r = Y(
4188
4188
  t,
4189
4189
  {
4190
4190
  dataType: "map",
@@ -4193,7 +4193,7 @@ function ra(t, a, r) {
4193
4193
  keyValue: !1,
4194
4194
  properties: t.properties ?? {}
4195
4195
  }
4196
- ) : a === "key_value" ? i = Y(
4196
+ ) : a === "key_value" ? r = Y(
4197
4197
  t,
4198
4198
  {
4199
4199
  dataType: "map",
@@ -4202,14 +4202,14 @@ function ra(t, a, r) {
4202
4202
  keyValue: !0,
4203
4203
  properties: void 0
4204
4204
  }
4205
- ) : a === "reference" ? i = Y(
4205
+ ) : a === "reference" ? r = Y(
4206
4206
  t,
4207
4207
  {
4208
4208
  dataType: "reference",
4209
4209
  propertyConfig: "reference",
4210
4210
  editable: t.editable !== void 0 ? t.editable : !0
4211
4211
  }
4212
- ) : a === "multi_references" ? i = Y(
4212
+ ) : a === "multi_references" ? r = Y(
4213
4213
  t,
4214
4214
  {
4215
4215
  dataType: "array",
@@ -4219,14 +4219,14 @@ function ra(t, a, r) {
4219
4219
  dataType: "reference"
4220
4220
  }
4221
4221
  }
4222
- ) : a === "switch" ? i = Y(
4222
+ ) : a === "switch" ? r = Y(
4223
4223
  t,
4224
4224
  {
4225
4225
  dataType: "boolean",
4226
4226
  propertyConfig: "switch",
4227
4227
  editable: t.editable !== void 0 ? t.editable : !0
4228
4228
  }
4229
- ) : a === "date_time" ? i = Y(
4229
+ ) : a === "date_time" ? r = Y(
4230
4230
  t,
4231
4231
  {
4232
4232
  dataType: "date",
@@ -4234,14 +4234,14 @@ function ra(t, a, r) {
4234
4234
  editable: t.editable !== void 0 ? t.editable : !0,
4235
4235
  mode: "date_time"
4236
4236
  }
4237
- ) : a === "repeat" ? i = Y(
4237
+ ) : a === "repeat" ? r = Y(
4238
4238
  t,
4239
4239
  {
4240
4240
  dataType: "array",
4241
4241
  propertyConfig: "repeat",
4242
4242
  editable: t.editable !== void 0 ? t.editable : !0
4243
4243
  }
4244
- ) : a === "block" ? i = Y(
4244
+ ) : a === "block" ? r = Y(
4245
4245
  t,
4246
4246
  {
4247
4247
  dataType: "array",
@@ -4251,12 +4251,12 @@ function ra(t, a, r) {
4251
4251
  properties: {}
4252
4252
  }
4253
4253
  }
4254
- ) : a && r[a] && (i = {
4255
- ...r[a].property,
4254
+ ) : a && i[a] && (r = {
4255
+ ...i[a].property,
4256
4256
  propertyConfig: a
4257
- }), i;
4257
+ }), r;
4258
4258
  }
4259
- function oa({ value: t, optionDisabled: a, propertyConfig: r, existing: i }) {
4259
+ function oa({ value: t, optionDisabled: a, propertyConfig: i, existing: r }) {
4260
4260
  return /* @__PURE__ */ e(
4261
4261
  ee,
4262
4262
  {
@@ -4271,16 +4271,16 @@ function oa({ value: t, optionDisabled: a, propertyConfig: r, existing: i }) {
4271
4271
  a ? "w-full" : ""
4272
4272
  ),
4273
4273
  children: [
4274
- /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Ze, { propertyConfig: r }) }),
4274
+ /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Ze, { propertyConfig: i }) }),
4275
4275
  /* @__PURE__ */ n("div", { children: [
4276
- /* @__PURE__ */ e("div", { children: r.name }),
4276
+ /* @__PURE__ */ e("div", { children: i.name }),
4277
4277
  /* @__PURE__ */ e(
4278
- O,
4278
+ C,
4279
4279
  {
4280
4280
  variant: "caption",
4281
4281
  color: "disabled",
4282
4282
  className: "max-w-sm",
4283
- children: i && a ? "You can only switch to widgets that use the same data type" : r.description
4283
+ children: r && a ? "You can only switch to widgets that use the same data type" : i.description
4284
4284
  }
4285
4285
  )
4286
4286
  ] })
@@ -4294,7 +4294,7 @@ function Li({
4294
4294
  disabled: t,
4295
4295
  showErrors: a
4296
4296
  }) {
4297
- const { values: r, setFieldValue: i } = $(), s = P(r, "url");
4297
+ const { values: i, setFieldValue: r } = $(), s = P(i, "url");
4298
4298
  return /* @__PURE__ */ n(D, { children: [
4299
4299
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
4300
4300
  Se,
@@ -4302,7 +4302,7 @@ function Li({
4302
4302
  disabled: t,
4303
4303
  position: "item-aligned",
4304
4304
  onValueChange: (o) => {
4305
- o === "[NONE]" ? i("url", !0) : i("url", o);
4305
+ o === "[NONE]" ? r("url", !0) : r("url", o);
4306
4306
  },
4307
4307
  label: "Preview type",
4308
4308
  renderValue: (o) => {
@@ -4342,10 +4342,10 @@ function Li({
4342
4342
  name: "defaultValue",
4343
4343
  disabled: t,
4344
4344
  onChange: (o) => {
4345
- i("defaultValue", o.target.value === "" ? void 0 : o.target.value);
4345
+ r("defaultValue", o.target.value === "" ? void 0 : o.target.value);
4346
4346
  },
4347
4347
  label: "Default value",
4348
- value: P(r, "defaultValue") ?? ""
4348
+ value: P(i, "defaultValue") ?? ""
4349
4349
  }
4350
4350
  ) })
4351
4351
  ] });
@@ -4353,8 +4353,8 @@ function Li({
4353
4353
  const na = U.memo(
4354
4354
  function({
4355
4355
  includeIdAndName: a = !0,
4356
- autoOpenTypeSelect: r,
4357
- existingProperty: i,
4356
+ autoOpenTypeSelect: i,
4357
+ existingProperty: r,
4358
4358
  autoUpdateId: s,
4359
4359
  inArray: o,
4360
4360
  propertyKey: l,
@@ -4366,7 +4366,7 @@ const na = U.memo(
4366
4366
  onError: b,
4367
4367
  initialErrors: g,
4368
4368
  forceShowErrors: y,
4369
- existingPropertyKeys: C,
4369
+ existingPropertyKeys: O,
4370
4370
  allowDataInference: k,
4371
4371
  getHelpers: x,
4372
4372
  getData: h,
@@ -4406,7 +4406,7 @@ const na = U.memo(
4406
4406
  A({
4407
4407
  id: f,
4408
4408
  property: { ...z, editable: z.editable ?? !0 }
4409
- }), i || F.resetForm({ values: w });
4409
+ }), r || F.resetForm({ values: w });
4410
4410
  },
4411
4411
  children: (N) => (pe(() => {
4412
4412
  x?.(N);
@@ -4419,11 +4419,11 @@ const na = U.memo(
4419
4419
  propertyNamespace: d,
4420
4420
  onError: b,
4421
4421
  showErrors: y || N.submitCount > 0,
4422
- existing: i,
4422
+ existing: r,
4423
4423
  autoUpdateId: s,
4424
4424
  inArray: o,
4425
- autoOpenTypeSelect: r,
4426
- existingPropertyKeys: C,
4425
+ autoOpenTypeSelect: i,
4426
+ existingPropertyKeys: O,
4427
4427
  disabled: V,
4428
4428
  getData: h,
4429
4429
  allowDataInference: k,
@@ -4441,8 +4441,8 @@ const na = U.memo(
4441
4441
  function Ie({
4442
4442
  open: t,
4443
4443
  onCancel: a,
4444
- onOkClicked: r,
4445
- onPropertyChanged: i,
4444
+ onOkClicked: i,
4445
+ onPropertyChanged: r,
4446
4446
  getData: s,
4447
4447
  collectionEditable: o,
4448
4448
  ...l
@@ -4460,7 +4460,7 @@ function Ie({
4460
4460
  {
4461
4461
  ...l,
4462
4462
  onPropertyChanged: (u) => {
4463
- i?.(u), r?.();
4463
+ r?.(u), i?.();
4464
4464
  },
4465
4465
  collectionEditable: o,
4466
4466
  onPropertyChangedImmediate: !1,
@@ -4498,8 +4498,8 @@ function Ie({
4498
4498
  function Ki({
4499
4499
  values: t,
4500
4500
  errors: a,
4501
- touched: r,
4502
- setValues: i,
4501
+ touched: i,
4502
+ setValues: r,
4503
4503
  setFieldValue: s,
4504
4504
  existing: o,
4505
4505
  autoUpdateId: l = !1,
@@ -4511,17 +4511,17 @@ function Ki({
4511
4511
  onError: b,
4512
4512
  showErrors: g,
4513
4513
  disabled: y,
4514
- inArray: C,
4514
+ inArray: O,
4515
4515
  existingPropertyKeys: k,
4516
4516
  getData: x,
4517
4517
  allowDataInference: h,
4518
4518
  propertyConfigs: _,
4519
4519
  collectionEditable: v
4520
4520
  }) {
4521
- const [w, V] = K(d), [I, A] = K(!1), [N, F] = K(t?.dataType ? Wt(t) : void 0), f = Object.entries(xt).concat(Object.entries(_)), z = C ? f.filter(([W, ae]) => !re(ae.property) && ae.property?.dataType !== "array") : f, Q = ha(t), S = Ge(null), M = Ge(t), ge = "id", Ce = g && P(a, "selectedWidget");
4521
+ const [w, V] = K(d), [I, A] = K(!1), [N, F] = K(t?.dataType ? Wt(t) : void 0), f = Object.entries(xt).concat(Object.entries(_)), z = O ? f.filter(([W, ae]) => !re(ae.property) && ae.property?.dataType !== "array") : f, Q = ha(t), S = Ge(null), M = Ge(t), ge = "id", Ce = g && P(a, "selectedWidget");
4522
4522
  pe(() => {
4523
- !P(r, ge) && l && t?.name && s(ge, Gt(t.name));
4524
- }, [l, r, t?.name]), pe(() => {
4523
+ !P(i, ge) && l && t?.name && s(ge, Gt(t.name));
4524
+ }, [l, i, t?.name]), pe(() => {
4525
4525
  if (u && (!p || Q.id)) {
4526
4526
  const {
4527
4527
  id: W,
@@ -4537,7 +4537,7 @@ function Ki({
4537
4537
  t?.id && b && Object.keys(a).length > 0 && b(t?.id, m, a);
4538
4538
  }, [a, b, m, t?.id]);
4539
4539
  const te = (W) => {
4540
- F(W), i(ra(t, W, _)), setTimeout(() => {
4540
+ F(W), r(ra(t, W, _)), setTimeout(() => {
4541
4541
  S.current?.focus();
4542
4542
  }, 0);
4543
4543
  };
@@ -4636,8 +4636,8 @@ function Ki({
4636
4636
  }
4637
4637
  ) : N === "key_value" ? R = /* @__PURE__ */ e($i, { disabled: y }) : R = null, /* @__PURE__ */ n(D, { children: [
4638
4638
  y && /* @__PURE__ */ n(Zt, { mode: "warn", children: [
4639
- /* @__PURE__ */ e(O, { children: "This property can't be edited" }),
4640
- /* @__PURE__ */ n(O, { variant: "caption", children: [
4639
+ /* @__PURE__ */ e(C, { children: "This property can't be edited" }),
4640
+ /* @__PURE__ */ n(C, { variant: "caption", children: [
4641
4641
  "You may not have permission to edit it or it is defined in code with no ",
4642
4642
  /* @__PURE__ */ e("code", { children: "editable" }),
4643
4643
  " flag"
@@ -4648,7 +4648,6 @@ function Ki({
4648
4648
  /* @__PURE__ */ e(
4649
4649
  Se,
4650
4650
  {
4651
- className: "w-full",
4652
4651
  error: !!Ce,
4653
4652
  value: N ?? "",
4654
4653
  placeholder: "Select a property widget",
@@ -4675,7 +4674,7 @@ function Ki({
4675
4674
  /* @__PURE__ */ n("div", { className: "flex flex-col items-start text-base text-left", children: [
4676
4675
  /* @__PURE__ */ e("div", { children: X.name }),
4677
4676
  /* @__PURE__ */ e(
4678
- O,
4677
+ C,
4679
4678
  {
4680
4679
  variant: "caption",
4681
4680
  color: "disabled",
@@ -4706,7 +4705,7 @@ function Ki({
4706
4705
  }
4707
4706
  ),
4708
4707
  Ce && /* @__PURE__ */ e(
4709
- O,
4708
+ C,
4710
4709
  {
4711
4710
  variant: "caption",
4712
4711
  className: "ml-3.5",
@@ -4758,23 +4757,23 @@ function Ki({
4758
4757
  ] });
4759
4758
  }
4760
4759
  function Yi(t) {
4761
- return (t.slice(0, 1).toLowerCase() + t.slice(1)).replace(/([-_ ]){1,}/g, " ").split(/[-_ ]/).reduce((a, r) => a + r[0].toUpperCase() + r.substring(1));
4760
+ return (t.slice(0, 1).toLowerCase() + t.slice(1)).replace(/([-_ ]){1,}/g, " ").split(/[-_ ]/).reduce((a, i) => a + i[0].toUpperCase() + i.substring(1));
4762
4761
  }
4763
- function Gi({ collection: t, onOpenChange: a, open: r }) {
4764
- const i = Re(), s = "const " + Yi(t.name) + "Collection = " + ii.stringify(sa(t), null, " ");
4762
+ function Gi({ collection: t, onOpenChange: a, open: i }) {
4763
+ const r = Re(), s = "const " + Yi(t.name) + "Collection = " + ii.stringify(sa(t), null, " ");
4765
4764
  return /* @__PURE__ */ n(
4766
4765
  Fe,
4767
4766
  {
4768
- open: r,
4767
+ open: i,
4769
4768
  onOpenChange: a,
4770
4769
  maxWidth: "4xl",
4771
4770
  children: [
4772
4771
  /* @__PURE__ */ n(Be, { children: [
4773
- /* @__PURE__ */ n(O, { variant: "h6", className: "my-4", children: [
4772
+ /* @__PURE__ */ n(C, { variant: "h6", className: "my-4", children: [
4774
4773
  "Code for ",
4775
4774
  t.name
4776
4775
  ] }),
4777
- /* @__PURE__ */ n(O, { variant: "body2", className: "my-4 mb-8", children: [
4776
+ /* @__PURE__ */ n(C, { variant: "body2", className: "my-4 mb-8", children: [
4778
4777
  "If you want to customise the collection in code, you can add this collection code to your CMS app configuration. More info in the ",
4779
4778
  /* @__PURE__ */ e(
4780
4779
  "a",
@@ -4802,7 +4801,7 @@ function Gi({ collection: t, onOpenChange: a, open: r }) {
4802
4801
  {
4803
4802
  variant: "text",
4804
4803
  size: "small",
4805
- onClick: (o) => (o.stopPropagation(), o.preventDefault(), i.open({
4804
+ onClick: (o) => (o.stopPropagation(), o.preventDefault(), r.open({
4806
4805
  type: "success",
4807
4806
  message: "Copied}"
4808
4807
  }), navigator.clipboard.writeText(s)),
@@ -4819,14 +4818,14 @@ function Gi({ collection: t, onOpenChange: a, open: r }) {
4819
4818
  );
4820
4819
  }
4821
4820
  function sa(t) {
4822
- const a = (r) => {
4823
- const i = {
4824
- ...r
4821
+ const a = (i) => {
4822
+ const r = {
4823
+ ...i
4825
4824
  };
4826
- return delete i.fromBuilder, delete i.resolved, delete i.propertiesOrder, delete i.editable, i.type === "map" ? {
4827
- ...i,
4828
- properties: i.properties.map(a)
4829
- } : i;
4825
+ return delete r.fromBuilder, delete r.resolved, delete r.propertiesOrder, delete r.editable, r.type === "map" ? {
4826
+ ...r,
4827
+ properties: r.properties.map(a)
4828
+ } : r;
4830
4829
  };
4831
4830
  return {
4832
4831
  name: t.name,
@@ -4841,17 +4840,17 @@ function sa(t) {
4841
4840
  customId: t.customId,
4842
4841
  initialFilter: t.initialFilter,
4843
4842
  initialSort: t.initialSort,
4844
- properties: Object.entries(t.properties).map(([r, i]) => ({
4845
- [r]: a(i)
4846
- })).reduce((r, i) => ({ ...r, ...i }), {}),
4843
+ properties: Object.entries(t.properties).map(([i, r]) => ({
4844
+ [i]: a(r)
4845
+ })).reduce((i, r) => ({ ...i, ...r }), {}),
4847
4846
  subcollections: (t.subcollections ?? []).map(sa)
4848
4847
  };
4849
4848
  }
4850
4849
  function Hi({
4851
4850
  showErrors: t,
4852
4851
  isNewCollection: a,
4853
- propertyErrorsRef: r,
4854
- onPropertyError: i,
4852
+ propertyErrorsRef: i,
4853
+ onPropertyError: r,
4855
4854
  setDirty: s,
4856
4855
  reservedGroups: o,
4857
4856
  extraIcon: l,
@@ -4865,7 +4864,7 @@ function Hi({
4865
4864
  values: b,
4866
4865
  setFieldValue: g,
4867
4866
  setFieldError: y,
4868
- setFieldTouched: C,
4867
+ setFieldTouched: O,
4869
4868
  errors: k,
4870
4869
  dirty: x
4871
4870
  } = $(), h = Re(), _ = Ia("lg"), v = !_, [w, V] = K(), [I, A] = K(), [N, F] = K(), f = I ? se(I, N) : void 0, z = f ? P(b.properties, f.replaceAll(".", ".properties.")) : void 0, [Q, S] = K(!1), [M, ge] = K(!1), [Ce, te] = K(!1), [R, W] = K([]), ae = U.useRef(b.propertiesOrder ? { "": b.propertiesOrder } : {});
@@ -4940,9 +4939,9 @@ function Hi({
4940
4939
  const ne = T ? se(T, de) : void 0, ve = ne ? ke(ne) : void 0;
4941
4940
  if (G && G !== T) {
4942
4941
  const it = se(G, de), Z = ke(it), we = ue(de).map((rt) => rt === G ? T : rt).filter((rt) => rt !== void 0);
4943
- fe(we, de), T && (V(we.indexOf(T)), A(T)), g(Z, void 0, !1), C(Z, !1, !1);
4942
+ fe(we, de), T && (V(we.indexOf(T)), A(T)), g(Z, void 0, !1), O(Z, !1, !1);
4944
4943
  }
4945
- ve && (g(ve, j, !1), C(ve, !0, !1));
4944
+ ve && (g(ve, j, !1), O(ve, !0, !1));
4946
4945
  }, tt = (T, j, G) => {
4947
4946
  const de = T ? se(T, j) : void 0;
4948
4947
  if (console.warn("onPropertyErrorInternal", {
@@ -4952,11 +4951,11 @@ function Hi({
4952
4951
  propertyPath: de
4953
4952
  }), de) {
4954
4953
  const ne = G && Object.keys(G).length > 0;
4955
- i(T, j, ne ? G : void 0), y(ke(de), ne ? "Property error" : void 0);
4954
+ r(T, j, ne ? G : void 0), y(ke(de), ne ? "Property error" : void 0);
4956
4955
  }
4957
4956
  }, q = () => {
4958
4957
  V(void 0), A(void 0);
4959
- }, B = I && r?.current?.properties ? r.current.properties[I] : void 0, L = b?.propertiesOrder === void 0 || b.propertiesOrder.length === 0, Ke = b.propertiesOrder ? b.propertiesOrder : Object.keys(b.properties), at = $t(() => d(b.ownerId), [d, b.ownerId]), Ve = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
4958
+ }, B = I && i?.current?.properties ? i.current.properties[I] : void 0, L = b?.propertiesOrder === void 0 || b.propertiesOrder.length === 0, Ke = b.propertiesOrder ? b.propertiesOrder : Object.keys(b.properties), at = $t(() => d(b.ownerId), [d, b.ownerId]), Ve = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
4960
4959
  /* @__PURE__ */ n("div", { className: xe(
4961
4960
  "p-4 md:p-8 pb-20 md:pb-20",
4962
4961
  "col-span-12 lg:col-span-5 h-full overflow-auto",
@@ -4979,7 +4978,7 @@ function Hi({
4979
4978
  }
4980
4979
  ),
4981
4980
  at && /* @__PURE__ */ n(
4982
- O,
4981
+ C,
4983
4982
  {
4984
4983
  variant: "body2",
4985
4984
  className: "ml-2",
@@ -5070,8 +5069,8 @@ function Hi({
5070
5069
  },
5071
5070
  `edit_view_${w}`
5072
5071
  ),
5073
- !z && /* @__PURE__ */ e(O, { variant: "label", className: "flex items-center justify-center h-full", children: L ? "Now you can add your first property" : "Select a property to edit it" }),
5074
- z && re(z) && /* @__PURE__ */ e(O, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
5072
+ !z && /* @__PURE__ */ e(C, { variant: "label", className: "flex items-center justify-center h-full", children: L ? "Now you can add your first property" : "Select a property to edit it" }),
5073
+ z && re(z) && /* @__PURE__ */ e(C, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
5075
5074
  ]
5076
5075
  }
5077
5076
  ) }),
@@ -5133,25 +5132,25 @@ function Hi({
5133
5132
  function Ji({
5134
5133
  open: t,
5135
5134
  handleOk: a,
5136
- handleCancel: r,
5137
- body: i,
5135
+ handleCancel: i,
5136
+ body: r,
5138
5137
  title: s
5139
5138
  }) {
5140
5139
  return /* @__PURE__ */ n(
5141
5140
  Fe,
5142
5141
  {
5143
5142
  open: t,
5144
- onOpenChange: (o) => o ? r() : a(),
5143
+ onOpenChange: (o) => o ? i() : a(),
5145
5144
  "aria-labelledby": "alert-dialog-title",
5146
5145
  "aria-describedby": "alert-dialog-description",
5147
5146
  children: [
5148
5147
  /* @__PURE__ */ n(Be, { children: [
5149
- /* @__PURE__ */ e(O, { variant: "h6", children: s ?? "Unsaved changes" }),
5150
- i && /* @__PURE__ */ e(O, { children: i }),
5151
- /* @__PURE__ */ e(O, { children: "Are you sure?" })
5148
+ /* @__PURE__ */ e(C, { variant: "h6", children: s ?? "Unsaved changes" }),
5149
+ r && /* @__PURE__ */ e(C, { children: r }),
5150
+ /* @__PURE__ */ e(C, { children: "Are you sure?" })
5152
5151
  ] }),
5153
5152
  /* @__PURE__ */ n(Me, { children: [
5154
- /* @__PURE__ */ e(E, { variant: "text", onClick: r, autoFocus: !0, children: " Cancel " }),
5153
+ /* @__PURE__ */ e(E, { variant: "text", onClick: i, autoFocus: !0, children: " Cancel " }),
5155
5154
  /* @__PURE__ */ e(E, { onClick: a, children: " Ok " })
5156
5155
  ] })
5157
5156
  ]
@@ -5160,7 +5159,7 @@ function Ji({
5160
5159
  }
5161
5160
  function Qi({ open: t, onClose: a }) {
5162
5161
  const {
5163
- entityViews: r
5162
+ entityViews: i
5164
5163
  } = Ue();
5165
5164
  return /* @__PURE__ */ n(
5166
5165
  Fe,
@@ -5169,22 +5168,23 @@ function Qi({ open: t, onClose: a }) {
5169
5168
  open: t,
5170
5169
  children: [
5171
5170
  /* @__PURE__ */ n(Be, { children: [
5172
- /* @__PURE__ */ e(O, { variant: "h6", children: "Select view" }),
5173
- r?.map((i) => /* @__PURE__ */ n(
5171
+ /* @__PURE__ */ e(C, { variant: "h6", children: "Select view" }),
5172
+ i?.map((r) => /* @__PURE__ */ n(
5174
5173
  E,
5175
5174
  {
5176
- onClick: () => a(i.key),
5175
+ onClick: () => a(r.key),
5177
5176
  fullWidth: !0,
5178
5177
  variant: "text",
5179
5178
  children: [
5180
- i.name,
5179
+ r.name,
5181
5180
  " (",
5182
- i.key,
5181
+ r.key,
5183
5182
  ")"
5184
5183
  ]
5185
5184
  },
5186
- i.key
5187
- ))
5185
+ r.key
5186
+ )),
5187
+ (i ?? []).length === 0 && /* @__PURE__ */ e(C, { variant: "body2", children: "No custom views defined" })
5188
5188
  ] }),
5189
5189
  /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(E, { onClick: () => a(), children: "Cancel" }) })
5190
5190
  ]
@@ -5194,21 +5194,21 @@ function Qi({ open: t, onClose: a }) {
5194
5194
  function Wi({
5195
5195
  collection: t,
5196
5196
  parentCollection: a,
5197
- configController: r,
5198
- collectionInference: i,
5197
+ configController: i,
5198
+ collectionInference: r,
5199
5199
  getUser: s,
5200
5200
  parentPathSegments: o
5201
5201
  }) {
5202
5202
  const { entityViews: l } = Ue(), [d, p] = U.useState(), [u, c] = U.useState(!1), [m, b] = U.useState(), [g, y] = U.useState(), {
5203
- values: C,
5203
+ values: O,
5204
5204
  setFieldValue: k
5205
- } = $(), x = t.subcollections ?? [], h = C.entityViews?.filter((w) => typeof w == "string").map((w) => Fa(w, l)).filter(Boolean) ?? [], _ = t.entityViews?.filter((w) => typeof w != "string") ?? [], v = h.length + _.length;
5205
+ } = $(), x = t.subcollections ?? [], h = O.entityViews?.filter((w) => typeof w == "string").map((w) => Fa(w, l)).filter(Boolean) ?? [], _ = t.entityViews?.filter((w) => typeof w != "string") ?? [], v = h.length + _.length;
5206
5206
  return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto", children: [
5207
5207
  /* @__PURE__ */ e(ht, { maxWidth: "2xl", className: "flex flex-col gap-4 p-8 m-auto", children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-16", children: [
5208
5208
  /* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
5209
- /* @__PURE__ */ n(O, { variant: "h5", children: [
5209
+ /* @__PURE__ */ n(C, { variant: "h5", children: [
5210
5210
  "Subcollections of ",
5211
- C.name
5211
+ O.name
5212
5212
  ] }),
5213
5213
  x && x.length > 0 && /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Vt, { children: /* @__PURE__ */ e(It, { children: x.map((w) => /* @__PURE__ */ n(
5214
5214
  yt,
@@ -5222,7 +5222,7 @@ function Wi({
5222
5222
  Ye,
5223
5223
  {
5224
5224
  align: "left",
5225
- children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: w.name })
5225
+ children: /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: w.name })
5226
5226
  }
5227
5227
  ),
5228
5228
  /* @__PURE__ */ e(
@@ -5261,14 +5261,14 @@ function Wi({
5261
5261
  )
5262
5262
  ] }),
5263
5263
  /* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
5264
- /* @__PURE__ */ e(O, { variant: "h5", children: "Custom views" }),
5264
+ /* @__PURE__ */ e(C, { variant: "h5", children: "Custom views" }),
5265
5265
  v > 0 && /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Vt, { children: /* @__PURE__ */ n(It, { children: [
5266
5266
  h.map((w) => /* @__PURE__ */ n(yt, { children: [
5267
5267
  /* @__PURE__ */ e(
5268
5268
  Ye,
5269
5269
  {
5270
5270
  align: "left",
5271
- children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: w.name })
5271
+ children: /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: w.name })
5272
5272
  }
5273
5273
  ),
5274
5274
  /* @__PURE__ */ e(
@@ -5294,8 +5294,8 @@ function Wi({
5294
5294
  {
5295
5295
  align: "left",
5296
5296
  children: [
5297
- /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: w.name }),
5298
- /* @__PURE__ */ n(O, { variant: "caption", className: "flex-grow", children: [
5297
+ /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: w.name }),
5298
+ /* @__PURE__ */ n(C, { variant: "caption", className: "flex-grow", children: [
5299
5299
  "This view is defined in code with key ",
5300
5300
  /* @__PURE__ */ e("code", { children: w.key })
5301
5301
  ] })
@@ -5325,7 +5325,7 @@ function Wi({
5325
5325
  {
5326
5326
  open: !!d,
5327
5327
  onAccept: () => {
5328
- r.deleteCollection({
5328
+ i.deleteCollection({
5329
5329
  path: d,
5330
5330
  parentPathSegments: [...o ?? [], t.path]
5331
5331
  }), p(void 0);
@@ -5344,7 +5344,7 @@ function Wi({
5344
5344
  {
5345
5345
  open: !!m,
5346
5346
  onAccept: () => {
5347
- k("entityViews", C.entityViews?.filter((w) => w !== m)), b(void 0);
5347
+ k("entityViews", O.entityViews?.filter((w) => w !== m)), b(void 0);
5348
5348
  },
5349
5349
  onCancel: () => b(void 0),
5350
5350
  title: /* @__PURE__ */ e(D, { children: "Remove this view?" }),
@@ -5359,10 +5359,10 @@ function Wi({
5359
5359
  ca,
5360
5360
  {
5361
5361
  open: !!g,
5362
- configController: r,
5362
+ configController: i,
5363
5363
  parentCollection: t,
5364
- collectionInference: i,
5365
- parentPathSegments: [...o ?? [], C.path],
5364
+ collectionInference: r,
5365
+ parentPathSegments: [...o ?? [], O.path],
5366
5366
  isNewCollection: !1,
5367
5367
  ...g,
5368
5368
  getUser: s,
@@ -5376,7 +5376,7 @@ function Wi({
5376
5376
  {
5377
5377
  open: u,
5378
5378
  onClose: (w) => {
5379
- w && (console.log("selectedViewKey", w), k("entityViews", [...C.entityViews ?? [], w])), c(!1);
5379
+ w && (console.log("selectedViewKey", w), k("entityViews", [...O.entityViews ?? [], w])), c(!1);
5380
5380
  }
5381
5381
  }
5382
5382
  )
@@ -5611,8 +5611,8 @@ const Mt = {
5611
5611
  function Zi({
5612
5612
  path: t,
5613
5613
  pathSuggestions: a,
5614
- parentCollection: r,
5615
- onContinue: i,
5614
+ parentCollection: i,
5615
+ onContinue: r,
5616
5616
  collections: s
5617
5617
  }) {
5618
5618
  const [o, l] = K(!1), [d, p] = K();
@@ -5629,7 +5629,7 @@ function Zi({
5629
5629
  handleChange: b,
5630
5630
  touched: g,
5631
5631
  errors: y,
5632
- setFieldTouched: C,
5632
+ setFieldTouched: O,
5633
5633
  isSubmitting: k,
5634
5634
  submitCount: x
5635
5635
  } = $();
@@ -5638,16 +5638,16 @@ function Zi({
5638
5638
  "div",
5639
5639
  {
5640
5640
  className: "flex flex-row py-2 pt-3 items-center",
5641
- children: /* @__PURE__ */ e(O, { variant: "h4", className: "flex-grow", children: "New collection" })
5641
+ children: /* @__PURE__ */ e(C, { variant: "h4", className: "flex-grow", children: "New collection" })
5642
5642
  }
5643
5643
  ),
5644
- r && /* @__PURE__ */ e(dt, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(O, { variant: "caption", children: [
5644
+ i && /* @__PURE__ */ e(dt, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(C, { variant: "caption", children: [
5645
5645
  "This is a subcollection of ",
5646
- /* @__PURE__ */ e("b", { children: r.name })
5646
+ /* @__PURE__ */ e("b", { children: i.name })
5647
5647
  ] }) }),
5648
5648
  /* @__PURE__ */ n("div", { className: "my-2", children: [
5649
5649
  /* @__PURE__ */ e(
5650
- O,
5650
+ C,
5651
5651
  {
5652
5652
  variant: "caption",
5653
5653
  color: "secondary",
@@ -5661,19 +5661,19 @@ function Zi({
5661
5661
  {
5662
5662
  colorScheme: "cyanLighter",
5663
5663
  onClick: () => {
5664
- c("name", Pt(h)), c("path", h), c("properties", void 0), i();
5664
+ c("name", Pt(h)), c("path", h), c("properties", void 0), r();
5665
5665
  },
5666
5666
  size: "small",
5667
5667
  children: h
5668
5668
  },
5669
5669
  h
5670
5670
  )),
5671
- !o && d?.length === 0 && /* @__PURE__ */ e(O, { variant: "caption", children: "No suggestions" })
5671
+ !o && d?.length === 0 && /* @__PURE__ */ e(C, { variant: "caption", children: "No suggestions" })
5672
5672
  ] })
5673
5673
  ] }),
5674
5674
  /* @__PURE__ */ n("div", { className: "my-2", children: [
5675
5675
  /* @__PURE__ */ e(
5676
- O,
5676
+ C,
5677
5677
  {
5678
5678
  variant: "caption",
5679
5679
  color: "secondary",
@@ -5688,7 +5688,7 @@ function Zi({
5688
5688
  subtitle: "A collection of products with images, prices and stock",
5689
5689
  icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: Mt.icon }),
5690
5690
  onClick: () => {
5691
- m(Mt), i();
5691
+ m(Mt), r();
5692
5692
  }
5693
5693
  }
5694
5694
  ),
@@ -5699,7 +5699,7 @@ function Zi({
5699
5699
  subtitle: "A collection of blog posts with images, authors and complex content",
5700
5700
  icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: Rt.icon }),
5701
5701
  onClick: () => {
5702
- m(Rt), i();
5702
+ m(Rt), r();
5703
5703
  }
5704
5704
  }
5705
5705
  ),
@@ -5710,15 +5710,15 @@ function Zi({
5710
5710
  subtitle: "A collection of users with emails, names and roles",
5711
5711
  icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: Ut.icon }),
5712
5712
  onClick: () => {
5713
- m(Ut), i();
5713
+ m(Ut), r();
5714
5714
  }
5715
5715
  }
5716
5716
  )
5717
5717
  ] })
5718
5718
  ] }),
5719
- !r && /* @__PURE__ */ n("div", { children: [
5719
+ !i && /* @__PURE__ */ n("div", { children: [
5720
5720
  /* @__PURE__ */ e(
5721
- O,
5721
+ C,
5722
5722
  {
5723
5723
  variant: "caption",
5724
5724
  color: "secondary",
@@ -5726,21 +5726,21 @@ function Zi({
5726
5726
  children: "● Create a collection from a file (csv, json, xls, xslx...)"
5727
5727
  }
5728
5728
  ),
5729
- /* @__PURE__ */ e(ni, { onDataAdded: (h) => i(h) })
5729
+ /* @__PURE__ */ e(ni, { onDataAdded: (h) => r(h) })
5730
5730
  ] }),
5731
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(E, { variant: "text", onClick: () => i(), className: "my-2", children: "Continue from scratch" }) })
5731
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(E, { variant: "text", onClick: () => r(), className: "my-2", children: "Continue from scratch" }) })
5732
5732
  ] }) });
5733
5733
  }
5734
5734
  function _t({
5735
5735
  title: t,
5736
5736
  subtitle: a,
5737
- icon: r,
5738
- onClick: i
5737
+ icon: i,
5738
+ onClick: r
5739
5739
  }) {
5740
5740
  return /* @__PURE__ */ e(oe, { title: a, children: /* @__PURE__ */ n(
5741
5741
  Xt,
5742
5742
  {
5743
- onClick: i,
5743
+ onClick: r,
5744
5744
  className: xe(
5745
5745
  "my-2 rounded-md border mx-0 p-6 px-4 focus:outline-none transition ease-in-out duration-150 flex flex-row gap-4 items-center",
5746
5746
  "text-gray-700 dark:text-gray-300",
@@ -5750,12 +5750,12 @@ function _t({
5750
5750
  "border-gray-400 dark:border-gray-600 "
5751
5751
  ),
5752
5752
  children: [
5753
- r,
5753
+ i,
5754
5754
  /* @__PURE__ */ e(
5755
5755
  "div",
5756
5756
  {
5757
5757
  className: "flex flex-col items-start",
5758
- children: /* @__PURE__ */ e(O, { variant: "subtitle1", children: t })
5758
+ children: /* @__PURE__ */ e(C, { variant: "subtitle1", children: t })
5759
5759
  }
5760
5760
  )
5761
5761
  ]
@@ -5789,49 +5789,49 @@ const Xi = [
5789
5789
  function tr({
5790
5790
  importConfig: t,
5791
5791
  propertyConfigs: a,
5792
- collectionEditable: r
5792
+ collectionEditable: i
5793
5793
  }) {
5794
5794
  const {
5795
- setFieldValue: i,
5795
+ setFieldValue: r,
5796
5796
  setFieldTouched: s,
5797
5797
  values: o
5798
5798
  } = $(), [l, d] = K(void 0), p = U.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), u = l ? l.id : void 0, c = l || void 0, m = ({
5799
5799
  id: g,
5800
5800
  property: y,
5801
- previousId: C,
5801
+ previousId: O,
5802
5802
  namespace: k
5803
5803
  }) => {
5804
5804
  const x = g ? se(g, k) : void 0, h = x ? ke(x) : void 0, _ = (w) => w ? p.current[w] ?? P(o, Ne(w)) : p.current[""], v = (w, V) => {
5805
5805
  const I = Ne(V);
5806
- i(I, w, !1), p.current[V ?? ""] = w;
5806
+ r(I, w, !1), p.current[V ?? ""] = w;
5807
5807
  };
5808
- if (C && C !== g) {
5809
- const w = se(C, k), V = ke(w), A = _(k).map((F) => F === C ? g : F).filter((F) => F !== void 0);
5808
+ if (O && O !== g) {
5809
+ const w = se(O, k), V = ke(w), A = _(k).map((F) => F === O ? g : F).filter((F) => F !== void 0);
5810
5810
  v(A, k);
5811
5811
  const N = { ...t.headersMapping };
5812
5812
  Object.keys(N).forEach((F) => {
5813
- N[F] === C && (N[F] = g ?? "");
5814
- }), t.setHeadersMapping(N), i(V, void 0, !1), s(V, !1, !1);
5813
+ N[F] === O && (N[F] = g ?? "");
5814
+ }), t.setHeadersMapping(N), r(V, void 0, !1), s(V, !1, !1);
5815
5815
  }
5816
- h && (i(h, y, !1), s(h, !0, !1));
5816
+ h && (r(h, y, !1), s(h, !0, !1));
5817
5817
  }, b = async ({
5818
5818
  id: g,
5819
5819
  importKey: y,
5820
- property: C,
5820
+ property: O,
5821
5821
  namespace: k
5822
5822
  }) => {
5823
5823
  const x = g ? se(g, k) : void 0, h = x ? ke(x) : void 0, _ = t.importData.map((w) => P(w, y)), v = {
5824
- ...Za(_, C, ta),
5824
+ ...Za(_, O, ta),
5825
5825
  editable: !0
5826
5826
  };
5827
5827
  h && (v ? (console.log("updating inferredNewProperty", {
5828
- property: C,
5828
+ property: O,
5829
5829
  inferredNewProperty: v
5830
- }), i(h, v, !1)) : i(h, C, !1), s(h, !0, !1));
5830
+ }), r(h, v, !1)) : r(h, O, !1), s(h, !0, !1));
5831
5831
  };
5832
5832
  return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto bg-gray-50 dark:bg-gray-900", children: [
5833
5833
  /* @__PURE__ */ n(ht, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
5834
- /* @__PURE__ */ e(O, { variant: "h6", className: "mt-4", children: "Data property mapping" }),
5834
+ /* @__PURE__ */ e(C, { variant: "h6", className: "mt-4", children: "Data property mapping" }),
5835
5835
  /* @__PURE__ */ e(
5836
5836
  si,
5837
5837
  {
@@ -5843,13 +5843,13 @@ function tr({
5843
5843
  buildPropertyView: ({
5844
5844
  property: g,
5845
5845
  propertyKey: y,
5846
- importKey: C
5846
+ importKey: O
5847
5847
  }) => /* @__PURE__ */ e(
5848
5848
  li,
5849
5849
  {
5850
5850
  property: g,
5851
5851
  propertyKey: y,
5852
- onPropertyNameChanged: (k, x) => i(`properties.${k}.name`, x, !1),
5852
+ onPropertyNameChanged: (k, x) => r(`properties.${k}.name`, x, !1),
5853
5853
  onEditClick: () => {
5854
5854
  !y || !g || d({
5855
5855
  ...g,
@@ -5864,7 +5864,7 @@ function tr({
5864
5864
  disabled: !1,
5865
5865
  onPropertyChanged: (k) => b({
5866
5866
  ...k,
5867
- importKey: C
5867
+ importKey: O
5868
5868
  }),
5869
5869
  propertyKey: y,
5870
5870
  propertyConfigs: a
@@ -5885,7 +5885,7 @@ function tr({
5885
5885
  autoUpdateId: !1,
5886
5886
  onPropertyChanged: m,
5887
5887
  allowDataInference: !1,
5888
- collectionEditable: r,
5888
+ collectionEditable: i,
5889
5889
  onOkClicked: () => {
5890
5890
  d(void 0);
5891
5891
  },
@@ -5903,11 +5903,11 @@ function tr({
5903
5903
  function ar({
5904
5904
  property: t,
5905
5905
  onPropertyChanged: a,
5906
- propertyKey: r,
5907
- propertyConfigs: i,
5906
+ propertyKey: i,
5907
+ propertyConfigs: r,
5908
5908
  disabled: s
5909
5909
  }) {
5910
- const o = t ? Wt(t) : null, l = t ? We(t, i) : null, [d, p] = K(!1);
5910
+ const o = t ? Wt(t) : null, l = t ? We(t, r) : null, [d, p] = K(!1);
5911
5911
  return /* @__PURE__ */ e(
5912
5912
  oe,
5913
5913
  {
@@ -5927,11 +5927,11 @@ function ar({
5927
5927
  position: "item-aligned",
5928
5928
  renderValue: (u) => l ? /* @__PURE__ */ e(Ze, { propertyConfig: l }) : null,
5929
5929
  onValueChange: (u) => {
5930
- const c = ra(t, u, i);
5931
- r && (a({
5932
- id: r,
5930
+ const c = ra(t, u, r);
5931
+ i && (a({
5932
+ id: i,
5933
5933
  property: c,
5934
- previousId: r,
5934
+ previousId: i,
5935
5935
  namespace: void 0
5936
5936
  }), console.log("newSelectedWidgetId", u));
5937
5937
  },
@@ -5950,18 +5950,18 @@ function ar({
5950
5950
  }
5951
5951
  );
5952
5952
  }
5953
- function ir({ importConfig: t, properties: a, propertiesOrder: r }) {
5953
+ function ir({ importConfig: t, properties: a, propertiesOrder: i }) {
5954
5954
  pe(() => {
5955
5955
  const s = ci(t.originProperties, a), o = t.importData.map((l) => di(l, t.idColumn, t.headersMapping, a, s, "TEMP_PATH"));
5956
5956
  t.setEntities(o), console.log("res", { propertiesMapping: s, mappedData: o });
5957
5957
  }, []);
5958
- const i = ja();
5958
+ const r = ja();
5959
5959
  return /* @__PURE__ */ e(
5960
5960
  Ea,
5961
5961
  {
5962
5962
  title: /* @__PURE__ */ n("div", { children: [
5963
- /* @__PURE__ */ e(O, { variant: "subtitle2", children: "Imported data preview" }),
5964
- /* @__PURE__ */ e(O, { variant: "caption", children: "Entities with the same id will be overwritten" })
5963
+ /* @__PURE__ */ e(C, { variant: "subtitle2", children: "Imported data preview" }),
5964
+ /* @__PURE__ */ e(C, { variant: "caption", children: "Entities with the same id will be overwritten" })
5965
5965
  ] }),
5966
5966
  tableController: {
5967
5967
  data: t.entities,
@@ -5971,14 +5971,14 @@ function ir({ importConfig: t, properties: a, propertiesOrder: r }) {
5971
5971
  endAdornment: /* @__PURE__ */ e("div", { className: "h-12" }),
5972
5972
  filterable: !1,
5973
5973
  sortable: !1,
5974
- selectionController: i,
5975
- displayedColumnIds: r.map((s) => ({ key: s, disabled: !1 })),
5974
+ selectionController: r,
5975
+ displayedColumnIds: i.map((s) => ({ key: s, disabled: !1 })),
5976
5976
  properties: a
5977
5977
  }
5978
5978
  );
5979
5979
  }
5980
5980
  function la(t, a = "") {
5981
- const r = Object.keys(t).reduce((o, l) => {
5981
+ const i = Object.keys(t).reduce((o, l) => {
5982
5982
  const d = t[l], p = Da(l), u = a ? `${a}.${p}` : p;
5983
5983
  if (d.dataType === "map" && d.properties) {
5984
5984
  const b = la(d.properties, u);
@@ -6002,19 +6002,19 @@ function la(t, a = "") {
6002
6002
  headersMapping: { ...o.headersMapping, [l]: u },
6003
6003
  properties: c
6004
6004
  };
6005
- }, { headersMapping: {}, properties: {} }), i = Object.keys(r.headersMapping)?.[0];
6005
+ }, { headersMapping: {}, properties: {} }), r = Object.keys(i.headersMapping)?.[0];
6006
6006
  let s;
6007
- return (i?.includes("id") || i?.includes("key")) && (s = i), {
6008
- ...r,
6007
+ return (r?.includes("id") || r?.includes("key")) && (s = r), {
6008
+ ...i,
6009
6009
  idColumn: s
6010
6010
  };
6011
6011
  }
6012
6012
  function ca(t) {
6013
- const a = t.open, [r, i] = _e.useState(!1), [s, o] = _e.useState(!1), l = J(() => {
6014
- r ? o(!0) : t.handleClose(void 0);
6015
- }, [r, t.handleClose]);
6013
+ const a = t.open, [i, r] = _e.useState(!1), [s, o] = _e.useState(!1), l = J(() => {
6014
+ i ? o(!0) : t.handleClose(void 0);
6015
+ }, [i, t.handleClose]);
6016
6016
  return pe(() => {
6017
- a || (i(!1), o(!1));
6017
+ a || (r(!1), o(!1));
6018
6018
  }, [a]), /* @__PURE__ */ n(
6019
6019
  Fe,
6020
6020
  {
@@ -6030,7 +6030,7 @@ function ca(t) {
6030
6030
  {
6031
6031
  ...t,
6032
6032
  handleCancel: l,
6033
- setFormDirty: i
6033
+ setFormDirty: r
6034
6034
  }
6035
6035
  ),
6036
6036
  /* @__PURE__ */ e(
@@ -6049,8 +6049,8 @@ function ca(t) {
6049
6049
  function rr({
6050
6050
  isNewCollection: t,
6051
6051
  initialValues: a,
6052
- configController: r,
6053
- editedCollectionPath: i,
6052
+ configController: i,
6053
+ editedCollectionPath: r,
6054
6054
  parentPathSegments: s,
6055
6055
  fullPath: o,
6056
6056
  collectionInference: l,
@@ -6062,7 +6062,7 @@ function rr({
6062
6062
  pathSuggestions: b,
6063
6063
  getUser: g,
6064
6064
  parentCollection: y,
6065
- getData: C
6065
+ getData: O
6066
6066
  }) {
6067
6067
  const { propertyConfigs: k } = Ue(), x = $e(), {
6068
6068
  topLevelNavigation: h,
@@ -6075,17 +6075,17 @@ function rr({
6075
6075
  } = h, F = Re(), f = Le(), z = Ge({}), Q = t ? v ? "welcome" : "details" : "properties", [S, M] = K(Q), [ge, Ce] = _e.useState(), [te, R] = _e.useState(), [W, ae] = _e.useState(!1), [me, ue] = _e.useState();
6076
6076
  pe(() => {
6077
6077
  try {
6078
- x.initialised && (R(i ? x.getCollectionFromPaths([...s ?? [], i]) : void 0), ae(!0));
6078
+ x.initialised && (R(r ? x.getCollectionFromPaths([...s ?? [], r]) : void 0), ae(!0));
6079
6079
  } catch (q) {
6080
6080
  console.error(q), ue(me);
6081
6081
  }
6082
- }, [x.getCollectionFromPaths, i, me, x.initialised]);
6082
+ }, [x.getCollectionFromPaths, r, me, x.initialised]);
6083
6083
  const fe = (q) => {
6084
6084
  const B = q.alias || q.path;
6085
- return r.saveCollection({
6085
+ return i.saveCollection({
6086
6086
  path: B,
6087
6087
  collectionData: q,
6088
- previousPath: i,
6088
+ previousPath: r,
6089
6089
  parentPathSegments: s
6090
6090
  }).then(() => (Ce(void 0), !0)).catch((L) => (Ce(L), console.error(L), F.open({
6091
6091
  type: "error",
@@ -6170,7 +6170,7 @@ function rr({
6170
6170
  dirty: Ke,
6171
6171
  submitCount: at
6172
6172
  }) => {
6173
- const Ve = q.path ?? i, T = o?.includes("/") ? o?.split("/").slice(0, -1).join("/") + "/" + Ve : Ve, j = x.resolveAliasesFrom(T), G = j && C ? () => C(j) : void 0;
6173
+ const Ve = q.path ?? r, T = o?.includes("/") ? o?.split("/").slice(0, -1).join("/") + "/" + Ve : Ve, j = x.resolveAliasesFrom(T), G = j && O ? () => O(j) : void 0;
6174
6174
  pe(() => {
6175
6175
  m(Ke);
6176
6176
  }, [Ke]);
@@ -6267,7 +6267,7 @@ function rr({
6267
6267
  Wi,
6268
6268
  {
6269
6269
  parentCollection: y,
6270
- configController: r,
6270
+ configController: i,
6271
6271
  getUser: g,
6272
6272
  collectionInference: l,
6273
6273
  parentPathSegments: s,
@@ -6424,31 +6424,31 @@ function rr({
6424
6424
  ) });
6425
6425
  }
6426
6426
  function or(t, a) {
6427
- const { properties: r, ...i } = t, s = {};
6428
- return Object.keys(r).forEach((o) => {
6429
- s[o] = da(r[o], a);
6430
- }), { ...i, properties: s };
6427
+ const { properties: i, ...r } = t, s = {};
6428
+ return Object.keys(i).forEach((o) => {
6429
+ s[o] = da(i[o], a);
6430
+ }), { ...r, properties: s };
6431
6431
  }
6432
6432
  function da(t, a) {
6433
- let r = t;
6434
- if (a && typeof r == "object" && r.propertyConfig) {
6435
- const i = a[r.propertyConfig];
6436
- if (i && re(i.property))
6437
- r = i.property;
6438
- else if (i && (r = Y(i.property, r)), !re(r) && r.dataType === "map" && r.properties) {
6433
+ let i = t;
6434
+ if (a && typeof i == "object" && i.propertyConfig) {
6435
+ const r = a[i.propertyConfig];
6436
+ if (r && re(r.property))
6437
+ i = r.property;
6438
+ else if (r && (i = Y(r.property, i)), !re(i) && i.dataType === "map" && i.properties) {
6439
6439
  const s = {};
6440
- Object.keys(r.properties).forEach((o) => {
6441
- s[o] = da(r.properties[o], a);
6442
- }), r = { ...r, properties: s };
6440
+ Object.keys(i.properties).forEach((o) => {
6441
+ s[o] = da(i.properties[o], a);
6442
+ }), i = { ...i, properties: s };
6443
6443
  }
6444
6444
  }
6445
- return r;
6445
+ return i;
6446
6446
  }
6447
6447
  const pa = U.createContext({}), ma = U.createContext({}), nr = U.memo(
6448
6448
  function({
6449
6449
  children: a,
6450
- collectionConfigController: r,
6451
- configPermissions: i,
6450
+ collectionConfigController: i,
6451
+ configPermissions: r,
6452
6452
  reservedGroups: s,
6453
6453
  collectionInference: o,
6454
6454
  extraView: l,
@@ -6458,10 +6458,10 @@ const pa = U.createContext({}), ma = U.createContext({}), nr = U.memo(
6458
6458
  }) {
6459
6459
  const c = $e(), m = ui(), b = Re(), { propertyConfigs: g } = Ue(), {
6460
6460
  collections: y
6461
- } = c, C = y.map((f) => f.path.trim().toLowerCase()), [k, x] = U.useState();
6461
+ } = c, O = y.map((f) => f.path.trim().toLowerCase()), [k, x] = U.useState();
6462
6462
  pe(() => {
6463
6463
  d && d().then((f) => {
6464
- x(f.filter((z) => !C.includes(z.trim().toLowerCase())));
6464
+ x(f.filter((z) => !O.includes(z.trim().toLowerCase())));
6465
6465
  });
6466
6466
  }, [d]);
6467
6467
  const [h, _] = U.useState(), [v, w] = U.useState(), V = J(() => ({
@@ -6514,14 +6514,14 @@ const pa = U.createContext({}), ma = U.createContext({}), nr = U.memo(
6514
6514
  redirect: S
6515
6515
  });
6516
6516
  }, []), F = d ? (f) => !f && k ? Promise.resolve(k) : d?.(f) : void 0;
6517
- return /* @__PURE__ */ e(pa.Provider, { value: r, children: /* @__PURE__ */ n(
6517
+ return /* @__PURE__ */ e(pa.Provider, { value: i, children: /* @__PURE__ */ n(
6518
6518
  ma.Provider,
6519
6519
  {
6520
6520
  value: {
6521
6521
  editCollection: I,
6522
6522
  createCollection: N,
6523
6523
  editProperty: A,
6524
- configPermissions: i ?? V,
6524
+ configPermissions: r ?? V,
6525
6525
  rootPathSuggestions: k
6526
6526
  },
6527
6527
  children: [
@@ -6530,7 +6530,7 @@ const pa = U.createContext({}), ma = U.createContext({}), nr = U.memo(
6530
6530
  ca,
6531
6531
  {
6532
6532
  open: !!h,
6533
- configController: r,
6533
+ configController: i,
6534
6534
  isNewCollection: !1,
6535
6535
  collectionInference: o,
6536
6536
  ...h,
@@ -6569,7 +6569,7 @@ const pa = U.createContext({}), ma = U.createContext({}), nr = U.memo(
6569
6569
  if (!v || !f)
6570
6570
  return;
6571
6571
  const Q = !v.propertyKey;
6572
- return r.saveProperty({
6572
+ return i.saveProperty({
6573
6573
  path: v?.editedCollectionPath,
6574
6574
  property: z,
6575
6575
  propertyKey: f,
@@ -6586,7 +6586,7 @@ const pa = U.createContext({}), ma = U.createContext({}), nr = U.memo(
6586
6586
  if (!v?.propertyKey)
6587
6587
  return;
6588
6588
  const f = v?.currentPropertiesOrder?.filter((z) => z !== v?.propertyKey);
6589
- return r.deleteProperty({
6589
+ return i.deleteProperty({
6590
6590
  path: v?.editedCollectionPath,
6591
6591
  propertyKey: v?.propertyKey,
6592
6592
  namespace: v?.namespace,
@@ -6625,18 +6625,18 @@ const pa = U.createContext({}), ma = U.createContext({}), nr = U.memo(
6625
6625
  function sr({
6626
6626
  path: t,
6627
6627
  parentPathSegments: a,
6628
- collection: r,
6629
- tableController: i
6628
+ collection: i,
6629
+ tableController: r
6630
6630
  }) {
6631
6631
  const s = Le(), o = $e(), l = Ee(), d = ua(), p = Re(), u = o.getCollectionFromPaths(a), c = l.configPermissions ? l.configPermissions({
6632
6632
  user: s.user,
6633
- collection: r
6633
+ collection: i
6634
6634
  }).editCollections : !0;
6635
6635
  let m = null;
6636
- return (!ut(st(i.filterValues), st(r.initialFilter)) || !ut(st(i.sortBy), st(r.initialSort))) && (m = /* @__PURE__ */ e(
6636
+ return (!ut(st(r.filterValues), st(i.initialFilter)) || !ut(st(r.sortBy), st(i.initialSort))) && (m = /* @__PURE__ */ e(
6637
6637
  oe,
6638
6638
  {
6639
- title: i.sortBy || i.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
6639
+ title: r.sortBy || r.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
6640
6640
  children: /* @__PURE__ */ e(
6641
6641
  E,
6642
6642
  {
@@ -6644,13 +6644,13 @@ function sr({
6644
6644
  size: "small",
6645
6645
  variant: "outlined",
6646
6646
  onClick: () => d?.saveCollection({
6647
- path: r.path,
6647
+ path: i.path,
6648
6648
  parentPathSegments: a,
6649
6649
  collectionData: Y(
6650
- r,
6650
+ i,
6651
6651
  {
6652
- initialFilter: i.filterValues ?? null,
6653
- initialSort: i.sortBy ?? null
6652
+ initialFilter: r.filterValues ?? null,
6653
+ initialSort: r.sortBy ?? null
6654
6654
  }
6655
6655
  )
6656
6656
  }).then(() => {
@@ -6674,7 +6674,7 @@ function sr({
6674
6674
  {
6675
6675
  color: "primary",
6676
6676
  disabled: !c,
6677
- onClick: c ? () => l?.editCollection({ path: r.path, fullPath: t, parentPathSegments: a, parentCollection: u }) : void 0,
6677
+ onClick: c ? () => l?.editCollection({ path: i.path, fullPath: t, parentPathSegments: a, parentCollection: u }) : void 0,
6678
6678
  children: /* @__PURE__ */ e(Je, {})
6679
6679
  }
6680
6680
  )
@@ -6689,14 +6689,14 @@ function lr({
6689
6689
  path: t,
6690
6690
  collection: a
6691
6691
  }) {
6692
- const r = Le(), i = ua(), s = Ee(), o = s.configPermissions({
6693
- user: r.user,
6692
+ const i = Le(), r = ua(), s = Ee(), o = s.configPermissions({
6693
+ user: i.user,
6694
6694
  collection: a
6695
6695
  }), l = J(() => {
6696
6696
  s?.editCollection({ path: t, parentPathSegments: [] });
6697
6697
  }, [s, t]), [d, p] = K(!1), u = J(() => {
6698
- i?.deleteCollection({ path: t });
6699
- }, [t, i]);
6698
+ r?.deleteCollection({ path: t });
6699
+ }, [t, r]);
6700
6700
  return /* @__PURE__ */ n(D, { children: [
6701
6701
  /* @__PURE__ */ n("div", { children: [
6702
6702
  o.deleteCollections && /* @__PURE__ */ e(
@@ -6743,14 +6743,14 @@ function cr({
6743
6743
  }) {
6744
6744
  if (!a.navigation.topLevelNavigation)
6745
6745
  throw Error("Navigation not ready in FireCMSHomePage");
6746
- const r = Le(), i = Ee(), s = i.configPermissions ? i.configPermissions({
6747
- user: r.user
6746
+ const i = Le(), r = Ee(), s = r.configPermissions ? r.configPermissions({
6747
+ user: i.user
6748
6748
  }).createCollections : !0;
6749
6749
  return /* @__PURE__ */ e(
6750
6750
  Xt,
6751
6751
  {
6752
6752
  className: xe("h-full p-4 min-h-[124px]"),
6753
- onClick: i && s ? () => i.createCollection({
6753
+ onClick: r && s ? () => r.createCollection({
6754
6754
  initialValues: t ? { group: t } : void 0,
6755
6755
  parentPathSegments: [],
6756
6756
  redirect: !0
@@ -6760,9 +6760,9 @@ function cr({
6760
6760
  {
6761
6761
  className: "flex flex-col items-start h-full w-full items-center justify-center h-full w-full flex-grow flex-col",
6762
6762
  children: [
6763
- /* @__PURE__ */ e(Ae, { color: "primary" }),
6763
+ /* @__PURE__ */ e(Ae, { color: "primary", size: "large" }),
6764
6764
  /* @__PURE__ */ e(
6765
- O,
6765
+ C,
6766
6766
  {
6767
6767
  color: "primary",
6768
6768
  variant: "caption",
@@ -6770,7 +6770,7 @@ function cr({
6770
6770
  children: "Add new collection".toUpperCase()
6771
6771
  }
6772
6772
  ),
6773
- !s && /* @__PURE__ */ e(O, { variant: "caption", children: "You don't have permissions to create collections" })
6773
+ !s && /* @__PURE__ */ e(C, { variant: "caption", children: "You don't have permissions to create collections" })
6774
6774
  ]
6775
6775
  }
6776
6776
  )
@@ -6778,9 +6778,9 @@ function cr({
6778
6778
  );
6779
6779
  }
6780
6780
  function dr() {
6781
- const t = Le(), a = $e(), r = Ee(), i = r.configPermissions ? r.configPermissions({
6781
+ const t = Le(), a = $e(), i = Ee(), r = i.configPermissions ? i.configPermissions({
6782
6782
  user: t.user
6783
- }).createCollections : !0, s = r.rootPathSuggestions ?? [], o = s.length > 3 || a.collections.length === 0 && s.length > 0;
6783
+ }).createCollections : !0, s = i.rootPathSuggestions ?? [], o = s.length > 3 || a.collections.length === 0 && s.length > 0;
6784
6784
  return /* @__PURE__ */ e(
6785
6785
  Ya,
6786
6786
  {
@@ -6790,7 +6790,7 @@ function dr() {
6790
6790
  {
6791
6791
  className: "flex flex-col gap-1 p-2 my-4",
6792
6792
  children: [
6793
- /* @__PURE__ */ e(O, { variant: "body2", color: "secondary", children: "Create a collection from your data:" }),
6793
+ /* @__PURE__ */ e(C, { variant: "body2", color: "secondary", children: "Create a collection from your data:" }),
6794
6794
  /* @__PURE__ */ e(
6795
6795
  "div",
6796
6796
  {
@@ -6800,7 +6800,7 @@ function dr() {
6800
6800
  {
6801
6801
  icon: /* @__PURE__ */ e(Ae, { size: "small" }),
6802
6802
  colorScheme: "cyanLighter",
6803
- onClick: r && i ? () => r.createCollection({
6803
+ onClick: i && r ? () => i.createCollection({
6804
6804
  initialValues: { path: l, name: Pt(l) },
6805
6805
  parentPathSegments: [],
6806
6806
  redirect: !0
@@ -6820,8 +6820,8 @@ function dr() {
6820
6820
  function pr({
6821
6821
  propertyKey: t,
6822
6822
  onHover: a,
6823
- property: r,
6824
- fullPath: i,
6823
+ property: i,
6824
+ fullPath: r,
6825
6825
  parentPathSegments: s,
6826
6826
  collection: o
6827
6827
  }) {
@@ -6833,8 +6833,8 @@ function pr({
6833
6833
  onClick: () => {
6834
6834
  l.editProperty({
6835
6835
  propertyKey: t,
6836
- property: r,
6837
- editedCollectionPath: i,
6836
+ property: i,
6837
+ editedCollectionPath: r,
6838
6838
  parentPathSegments: s,
6839
6839
  collection: o
6840
6840
  });
@@ -6847,11 +6847,11 @@ function pr({
6847
6847
  function mr({
6848
6848
  fullPath: t,
6849
6849
  parentPathSegments: a,
6850
- collection: r
6850
+ collection: i
6851
6851
  }) {
6852
- const i = Le(), s = Ee(), o = s.configPermissions ? s.configPermissions({
6853
- user: i.user,
6854
- collection: r
6852
+ const r = Le(), s = Ee(), o = s.configPermissions ? s.configPermissions({
6853
+ user: r.user,
6854
+ collection: i
6855
6855
  }).editCollections : !0;
6856
6856
  return /* @__PURE__ */ e(oe, { title: o ? "Add new property" : "You don't have permission to add new properties", children: /* @__PURE__ */ e(
6857
6857
  "div",
@@ -6861,8 +6861,8 @@ function mr({
6861
6861
  s.editProperty({
6862
6862
  editedCollectionPath: t,
6863
6863
  parentPathSegments: a,
6864
- currentPropertiesOrder: Ga(r),
6865
- collection: r
6864
+ currentPropertiesOrder: Ga(i),
6865
+ collection: i
6866
6866
  });
6867
6867
  },
6868
6868
  children: /* @__PURE__ */ e(Ae, { color: "inherit" })
@@ -6872,8 +6872,8 @@ function mr({
6872
6872
  function Pr({
6873
6873
  collectionConfigController: t,
6874
6874
  configPermissions: a,
6875
- reservedGroups: r,
6876
- extraView: i,
6875
+ reservedGroups: i,
6876
+ extraView: r,
6877
6877
  pathSuggestions: s,
6878
6878
  getUser: o,
6879
6879
  collectionInference: l,
@@ -6901,8 +6901,8 @@ function Pr({
6901
6901
  collectionConfigController: t,
6902
6902
  configPermissions: a,
6903
6903
  collectionInference: l,
6904
- reservedGroups: r,
6905
- extraView: i,
6904
+ reservedGroups: i,
6905
+ extraView: r,
6906
6906
  pathSuggestions: s,
6907
6907
  getUser: o,
6908
6908
  getData: d
@@ -6920,7 +6920,7 @@ function Pr({
6920
6920
  };
6921
6921
  }
6922
6922
  function Nr({ path: t }) {
6923
- const a = hr(t), r = ur(t), i = Ee();
6923
+ const a = hr(t), i = ur(t), r = Ee();
6924
6924
  return /* @__PURE__ */ n("div", { className: "p-1 flex flex-col items-center", children: [
6925
6925
  /* @__PURE__ */ e(ea, { error: "No collection for path: " + a }),
6926
6926
  /* @__PURE__ */ e(
@@ -6930,9 +6930,9 @@ function Nr({ path: t }) {
6930
6930
  variant: "outlined",
6931
6931
  size: "small",
6932
6932
  onClick: () => {
6933
- i.createCollection({
6933
+ r.createCollection({
6934
6934
  initialValues: { path: a, name: Pt(a) },
6935
- parentPathSegments: r,
6935
+ parentPathSegments: i,
6936
6936
  redirect: !1
6937
6937
  });
6938
6938
  },
@@ -6943,7 +6943,7 @@ function Nr({ path: t }) {
6943
6943
  }
6944
6944
  function ur(t) {
6945
6945
  const a = t.split("/");
6946
- return a.filter((r, i) => i % 2 === 0 && i !== a.length - 1);
6946
+ return a.filter((i, r) => r % 2 === 0 && r !== a.length - 1);
6947
6947
  }
6948
6948
  function hr(t) {
6949
6949
  const a = t.split("/");