@firecms/collection_editor 3.0.0-alpha.50 → 3.0.0-alpha.52

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,18 +1,18 @@
1
- import { jsxs as n, Fragment as M, jsx as e } from "react/jsx-runtime";
2
- import * as we from "react";
3
- import L, { useState as $, useEffect as pe, useMemo as Yt, useCallback as X, useRef as He, useDeferredValue as fa, useContext as Gt } from "react";
4
- import { iconKeys as Ht, debounce as ba, SearchBar as ya, Tooltip as re, IconButton as ne, Icon as lt, coolIconKeys as xt, Typography as C, getIconForView as ct, useAutoComplete as va, Container as ht, Chip as dt, TextField as Te, cn as ke, DebouncedTextField as H, Autocomplete as wa, AutocompleteItem as _a, ExpandablePanel as Pt, SettingsIcon as Qe, Select as Se, SelectItem as ee, BooleanSwitchWithLabel as Jt, Dialog as Ee, toSnakeCase as Ct, singular as ka, ListIcon as xa, Button as B, CircularProgress as We, AutoAwesomeIcon as gt, Paper as qe, FormikArrayContainer as Ca, DialogContent as $e, DialogActions as Le, SwitchControl as he, serializeRegExp as Oa, isValidRegExp as Pa, RuleIcon as Na, useSnackbarController as De, resolveEnumValues as Sa, FileUploadIcon as qa, MultiSelect as Aa, MultiSelectItem as Tt, Checkbox as Vt, isPropertyBuilder as oe, useFireCMSContext as Ke, getFieldConfig as Ze, ErrorBoundary as Pe, FieldConfigBadge as Xe, cardMixin as Qt, cardClickableMixin as Wt, cardSelectedMixin as Zt, FunctionsIcon as za, RemoveCircleIcon as Ta, defaultBorderMixin as Nt, RemoveIcon as Va, DragHandleIcon as Ia, AddIcon as Ae, useNavigationController as Be, SelectGroup as It, mergeDeep as Y, getFieldId as Xt, DEFAULT_FIELD_CONFIGS as Ot, InfoLabel as ea, DeleteIcon as pt, DeleteConfirmationDialog as mt, ContentCopyIcon as Fa, useLargeLayout as ja, CodeIcon as Ea, makePropertiesEditable as et, resolveEntityView as Da, Table as Ft, TableBody as jt, TableRow as wt, TableCell as Ge, unslugify as St, Card as ta, useSelectionController as Ba, EntityCollectionTable as Ma, slugify as Ra, useAuthController as Ye, randomString as Et, CircularProgressCenter as Dt, Tabs as Ua, Tab as _t, removeUndefined as $a, ErrorView as aa, ArrowBackIcon as rt, LoadingButton as Bt, DoneIcon as La, SaveIcon as Ka, Menu as Ya, MoreVertIcon as Ga, MenuItem as Ha, Collapse as Ja, getDefaultPropertiesOrder as Qa, joinCollectionLists as Wa } from "@firecms/core";
1
+ import { jsxs as n, Fragment as $, jsx as e } from "react/jsx-runtime";
2
+ import * as _e from "react";
3
+ import K, { useState as L, useEffect as pe, useMemo as Kt, useCallback as Z, useRef as He, useDeferredValue as ba, useContext as Yt } from "react";
4
+ import { iconKeys as Gt, debounce as ya, SearchBar as va, Tooltip as re, IconButton as ne, Icon as lt, coolIconKeys as xt, Typography as C, getIconForView as ct, useAutoComplete as wa, Container as ht, Chip as dt, TextField as Te, cn as xe, DebouncedTextField as J, Autocomplete as _a, AutocompleteItem as ka, ExpandablePanel as Ot, SettingsIcon as Qe, Select as Se, SelectItem as ee, BooleanSwitchWithLabel as Ht, Dialog as Ee, toSnakeCase as Ct, singular as xa, ListIcon as Ca, Button as U, CircularProgress as We, AutoAwesomeIcon as gt, Paper as qe, FormikArrayContainer as Oa, DialogContent as $e, DialogActions as Le, SwitchControl as he, serializeRegExp as Na, isValidRegExp as Pa, RuleIcon as Sa, useSnackbarController as De, resolveEnumValues as qa, FileUploadIcon as Aa, MultiSelect as za, MultiSelectItem as zt, Checkbox as Tt, isPropertyBuilder as oe, useFireCMSContext as Ke, getFieldConfig as Ze, ErrorBoundary as Ne, FieldConfigBadge as Xe, cardMixin as Jt, cardClickableMixin as Qt, cardSelectedMixin as Wt, FunctionsIcon as Ta, RemoveCircleIcon as Va, defaultBorderMixin as Nt, RemoveIcon as Ia, DragHandleIcon as Fa, AddIcon as Ae, useNavigationController as Be, SelectGroup as Vt, mergeDeep as G, DEFAULT_FIELD_CONFIGS as Zt, getFieldId as Xt, InfoLabel as ea, DeleteIcon as pt, DeleteConfirmationDialog as mt, ContentCopyIcon as ja, useLargeLayout as Ea, CodeIcon as Da, makePropertiesEditable as et, resolveEntityView as Ba, Table as It, TableBody as Ft, TableRow as wt, TableCell as Ge, unslugify as Pt, Card as ta, useSelectionController as Ma, EntityCollectionTable as Ra, slugify as Ua, useAuthController as Ye, randomString as jt, CircularProgressCenter as Et, Tabs as $a, Tab as _t, removeUndefined as La, ErrorView as aa, ArrowBackIcon as rt, LoadingButton as Dt, DoneIcon as Ka, SaveIcon as Ya, Menu as Ga, MoreVertIcon as Ha, MenuItem as Ja, Collapse as Qa, getDefaultPropertiesOrder as Wa, joinCollectionLists as Za } from "@firecms/core";
5
5
  import ut from "react-fast-compare";
6
- import { useFormikContext as K, Field as be, getIn as P, Formik as qt, FastField as de, Form as Za } from "formik";
6
+ import { useFormikContext as Y, Field as ye, getIn as P, Formik as St, FastField as de, Form as Xa } from "formik";
7
7
  import * as ot from "yup";
8
- import * as Xa from "js-search";
9
- import { extractEnumFromValues as ei, buildPropertyFromData as ti, buildEntityPropertiesFromData as ai } from "@firecms/schema_inference";
10
- import { DragDropContext as ii, Droppable as ri, Draggable as oi } from "@hello-pangea/dnd";
11
- import ni from "json5";
12
- import { Highlight as si, themes as li } from "prism-react-renderer";
13
- import { ImportFileUpload as ci, DataNewPropertiesMapping as di, ImportNewPropertyFieldPreview as pi, getInferenceType as ia, getPropertiesMapping as mi, convertDataToEntity as ui, useImportConfig as hi, ImportSaveInProgress as gi } from "@firecms/data_import_export";
14
- import { useNavigate as fi } from "react-router";
15
- const bi = ot.object().shape({
8
+ import * as ei from "js-search";
9
+ import { extractEnumFromValues as ti, buildPropertyFromData as ai, buildEntityPropertiesFromData as ii } from "@firecms/schema_inference";
10
+ import { DragDropContext as ri, Droppable as oi, Draggable as ni } from "@hello-pangea/dnd";
11
+ import si from "json5";
12
+ import { Highlight as li, themes as ci } from "prism-react-renderer";
13
+ import { ImportFileUpload as di, DataNewPropertiesMapping as pi, ImportNewPropertyFieldPreview as mi, getInferenceType as ia, getPropertiesMapping as ui, convertDataToEntity as hi, useImportConfig as gi, ImportSaveInProgress as fi } from "@firecms/data_import_export";
14
+ import { useNavigate as bi } from "react-router";
15
+ const yi = ot.object().shape({
16
16
  id: ot.string().required("Required"),
17
17
  name: ot.string().required("Required"),
18
18
  path: ot.string().required("Required")
@@ -1965,34 +1965,34 @@ const bi = ot.object().shape({
1965
1965
  zoom_in_map: "arrows destination location maps move place stop",
1966
1966
  zoom_out: "find glass look magnifier magnifying minus negative scale search see size smaller",
1967
1967
  zoom_out_map: "arrows destination location maps move place stop"
1968
- }, At = new Xa.Search("key");
1969
- At.addIndex("synonyms");
1970
- At.addDocuments(Ht.map((t) => ({
1968
+ }, qt = new ei.Search("key");
1969
+ qt.addIndex("synonyms");
1970
+ qt.addDocuments(Gt.map((t) => ({
1971
1971
  key: t,
1972
1972
  // @ts-ignore
1973
1973
  synonyms: ra[t] ?? []
1974
1974
  })));
1975
- const yi = 220;
1975
+ const vi = 220;
1976
1976
  process.env.NODE_ENV !== "production" && Object.keys(ra).forEach((t) => {
1977
- Ht.includes(t) || console.warn(`The icon ${t} no longer exists. Remove it from \`synonyms\``);
1977
+ Gt.includes(t) || console.warn(`The icon ${t} no longer exists. Remove it from \`synonyms\``);
1978
1978
  });
1979
- function vi({ selectedIcon: t = "", onIconSelected: a }) {
1980
- const [i, r] = we.useState(null), [s, o] = we.useState(""), l = we.useMemo(
1981
- () => ba((m) => {
1979
+ function wi({ selectedIcon: t = "", onIconSelected: a }) {
1980
+ const [i, r] = _e.useState(null), [s, o] = _e.useState(""), l = _e.useMemo(
1981
+ () => ya((m) => {
1982
1982
  if (!m || m === "")
1983
1983
  r(null);
1984
1984
  else {
1985
- const u = At.search(m);
1986
- r(u.map((c) => c.key));
1985
+ const u = qt.search(m);
1986
+ r(u.map((d) => d.key));
1987
1987
  }
1988
- }, yi),
1988
+ }, vi),
1989
1989
  []
1990
1990
  );
1991
- return we.useEffect(() => (l(s), () => {
1991
+ return _e.useEffect(() => (l(s), () => {
1992
1992
  l.clear();
1993
- }), [s, l]), /* @__PURE__ */ n(M, { children: [
1993
+ }), [s, l]), /* @__PURE__ */ n($, { children: [
1994
1994
  /* @__PURE__ */ e(
1995
- ya,
1995
+ va,
1996
1996
  {
1997
1997
  autoFocus: !0,
1998
1998
  className: "w-full sticky top-0 z-10",
@@ -2018,7 +2018,7 @@ function ie({
2018
2018
  }) {
2019
2019
  return a ? /* @__PURE__ */ e(C, { variant: "caption", color: t ? "error" : "secondary", className: "ml-3.5 mt-0.5", children: a }) : null;
2020
2020
  }
2021
- function wi({
2021
+ function _i({
2022
2022
  isNewCollection: t,
2023
2023
  reservedGroups: a,
2024
2024
  existingPaths: i,
@@ -2026,29 +2026,29 @@ function wi({
2026
2026
  groups: s,
2027
2027
  parentCollection: o
2028
2028
  }) {
2029
- const l = L.useRef(null), {
2029
+ const l = K.useRef(null), {
2030
2030
  values: p,
2031
2031
  setFieldValue: m,
2032
2032
  handleChange: u,
2033
- touched: c,
2034
- errors: d,
2035
- setFieldTouched: f,
2033
+ touched: d,
2034
+ errors: c,
2035
+ setFieldTouched: y,
2036
2036
  isSubmitting: g,
2037
2037
  submitCount: b
2038
- } = K(), [O, k] = $(!1), [x, h] = $(!1), _ = (v) => {
2039
- m("name", v), !P(c, "path") && t && v && m("path", Ct(v)), !P(c, "id") && t && v && m("id", Ct(v)), !P(c, "singularName") && t && v && m("singularName", ka(v));
2038
+ } = Y(), [O, w] = L(!1), [k, f] = L(!1), v = (S) => {
2039
+ m("name", S), !P(d, "path") && t && S && m("path", Ct(S)), !P(d, "id") && t && S && m("id", Ct(S)), !P(d, "singularName") && t && S && m("singularName", xa(S));
2040
2040
  };
2041
2041
  pe(() => {
2042
- d.id && h(!0);
2043
- }, [d.id]);
2044
- const y = ct(p), w = s?.filter((v) => !a?.includes(v)), {
2045
- inputFocused: q,
2046
- autoCompleteOpen: F,
2047
- setAutoCompleteOpen: A
2048
- } = va({
2042
+ c.id && f(!0);
2043
+ }, [c.id]);
2044
+ const _ = ct(p), h = s?.filter((S) => !a?.includes(S)), {
2045
+ inputFocused: A,
2046
+ autoCompleteOpen: E,
2047
+ setAutoCompleteOpen: z
2048
+ } = wa({
2049
2049
  ref: l
2050
- }), S = !!o;
2051
- let E;
2050
+ }), q = !!o;
2051
+ let B;
2052
2052
  return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(ht, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
2053
2053
  /* @__PURE__ */ n("div", { children: [
2054
2054
  /* @__PURE__ */ n(
@@ -2061,8 +2061,8 @@ function wi({
2061
2061
  ne,
2062
2062
  {
2063
2063
  shape: "square",
2064
- onClick: () => k(!0),
2065
- children: y
2064
+ onClick: () => w(!0),
2065
+ children: _
2066
2066
  }
2067
2067
  ) })
2068
2068
  ]
@@ -2079,66 +2079,66 @@ function wi({
2079
2079
  Te,
2080
2080
  {
2081
2081
  value: p.name ?? "",
2082
- onChange: (v) => _(v.target.value),
2082
+ onChange: (S) => v(S.target.value),
2083
2083
  label: "Name",
2084
2084
  required: !0,
2085
- error: c.name && !!d.name
2085
+ error: d.name && !!c.name
2086
2086
  }
2087
2087
  ),
2088
- /* @__PURE__ */ e(ie, { error: c.name && !!d.name, children: c.name && d.name ? d.name : "Name of in this collection, usually a plural name (e.g. Products)" })
2088
+ /* @__PURE__ */ e(ie, { error: d.name && !!c.name, children: d.name && c.name ? c.name : "Name of in this collection, usually a plural name (e.g. Products)" })
2089
2089
  ] }),
2090
- /* @__PURE__ */ n("div", { className: ke("col-span-12 ", S ? "" : "sm:col-span-8"), children: [
2090
+ /* @__PURE__ */ n("div", { className: xe("col-span-12 ", q ? "" : "sm:col-span-8"), children: [
2091
2091
  /* @__PURE__ */ e(
2092
- be,
2092
+ ye,
2093
2093
  {
2094
2094
  name: "path",
2095
- as: H,
2095
+ as: J,
2096
2096
  label: "Path",
2097
2097
  disabled: !t,
2098
2098
  required: !0,
2099
- error: c.path && !!d.path
2099
+ error: d.path && !!c.path
2100
2100
  }
2101
2101
  ),
2102
- /* @__PURE__ */ e(ie, { error: c.path && !!d.path, children: c.path && d.path ? d.path : "Path that this collection is stored in, in the database" })
2102
+ /* @__PURE__ */ e(ie, { error: d.path && !!c.path, children: d.path && c.path ? c.path : "Path that this collection is stored in, in the database" })
2103
2103
  ] }),
2104
- !S && /* @__PURE__ */ n("div", { className: "col-span-12 sm:col-span-4 relative", children: [
2104
+ !q && /* @__PURE__ */ n("div", { className: "col-span-12 sm:col-span-4 relative", children: [
2105
2105
  /* @__PURE__ */ e(
2106
2106
  Te,
2107
2107
  {
2108
- error: c.group && !!d.group,
2108
+ error: d.group && !!c.group,
2109
2109
  disabled: g,
2110
2110
  value: p.group ?? "",
2111
2111
  autoComplete: "off",
2112
- onChange: (v) => m("group", v.target.value),
2112
+ onChange: (S) => m("group", S.target.value),
2113
2113
  name: "group",
2114
2114
  inputRef: l,
2115
2115
  label: "Group"
2116
2116
  }
2117
2117
  ),
2118
2118
  /* @__PURE__ */ e(
2119
- wa,
2119
+ _a,
2120
2120
  {
2121
- open: F && (w ?? []).length > 0,
2122
- setOpen: A,
2123
- children: w?.map((v, V) => /* @__PURE__ */ e(
2124
- _a,
2121
+ open: E && (h ?? []).length > 0,
2122
+ setOpen: z,
2123
+ children: h?.map((S, N) => /* @__PURE__ */ e(
2124
+ ka,
2125
2125
  {
2126
2126
  onClick: () => {
2127
- A(!1), m("group", v ?? null);
2127
+ z(!1), m("group", S ?? null);
2128
2128
  },
2129
- children: /* @__PURE__ */ e("div", { className: "flex-grow", children: v })
2129
+ children: /* @__PURE__ */ e("div", { className: "flex-grow", children: S })
2130
2130
  },
2131
- V + "_" + v
2131
+ N + "_" + S
2132
2132
  ))
2133
2133
  }
2134
2134
  ),
2135
- /* @__PURE__ */ e(ie, { children: c.group && d.group ? d.group : "Group of the collection" })
2135
+ /* @__PURE__ */ e(ie, { children: d.group && c.group ? c.group : "Group of the collection" })
2136
2136
  ] }),
2137
2137
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2138
- Pt,
2138
+ Ot,
2139
2139
  {
2140
- expanded: x,
2141
- onExpandedChange: h,
2140
+ expanded: k,
2141
+ onExpandedChange: f,
2142
2142
  title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
2143
2143
  /* @__PURE__ */ e(Qe, {}),
2144
2144
  /* @__PURE__ */ e(
@@ -2156,21 +2156,21 @@ function wi({
2156
2156
  /* @__PURE__ */ e(
2157
2157
  Te,
2158
2158
  {
2159
- error: c.singularName && !!d.singularName,
2159
+ error: d.singularName && !!c.singularName,
2160
2160
  id: "singularName",
2161
2161
  "aria-describedby": "singularName-helper",
2162
- onChange: (v) => (f("singularName", !0), u(v)),
2162
+ onChange: (S) => (y("singularName", !0), u(S)),
2163
2163
  value: p.singularName ?? "",
2164
2164
  label: "Singular name"
2165
2165
  }
2166
2166
  ),
2167
- /* @__PURE__ */ e(ie, { error: c.singularName && !!d.singularName, children: c.singularName && d.singularName ? d.singularName : "Optionally define a singular name for your entities" })
2167
+ /* @__PURE__ */ e(ie, { error: d.singularName && !!c.singularName, children: d.singularName && c.singularName ? c.singularName : "Optionally define a singular name for your entities" })
2168
2168
  ] }),
2169
2169
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2170
2170
  /* @__PURE__ */ e(
2171
2171
  Te,
2172
2172
  {
2173
- error: c.description && !!d.description,
2173
+ error: d.description && !!c.description,
2174
2174
  id: "description",
2175
2175
  value: p.description ?? "",
2176
2176
  onChange: u,
@@ -2180,20 +2180,20 @@ function wi({
2180
2180
  label: "Description"
2181
2181
  }
2182
2182
  ),
2183
- /* @__PURE__ */ e(ie, { error: c.description && !!d.description, children: c.description && d.description ? d.description : "Description of the collection, you can use markdown" })
2183
+ /* @__PURE__ */ e(ie, { error: d.description && !!c.description, children: d.description && c.description ? c.description : "Description of the collection, you can use markdown" })
2184
2184
  ] }),
2185
2185
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2186
2186
  /* @__PURE__ */ e(
2187
- be,
2187
+ ye,
2188
2188
  {
2189
2189
  name: "id",
2190
- as: H,
2190
+ as: J,
2191
2191
  disabled: !t,
2192
2192
  label: "Collection id",
2193
- error: c.id && !!d.id
2193
+ error: d.id && !!c.id
2194
2194
  }
2195
2195
  ),
2196
- /* @__PURE__ */ e(ie, { error: c.id && !!d.id, children: c.id && d.id ? d.id : "This id identifies this collection" })
2196
+ /* @__PURE__ */ e(ie, { error: d.id && !!c.id, children: d.id && c.id ? c.id : "This id identifies this collection" })
2197
2197
  ] }),
2198
2198
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2199
2199
  Se,
@@ -2203,14 +2203,14 @@ function wi({
2203
2203
  position: "item-aligned",
2204
2204
  onChange: u,
2205
2205
  value: p.defaultSize ?? "",
2206
- renderValue: (v) => v.toUpperCase(),
2207
- children: ["xs", "s", "m", "l", "xl"].map((v) => /* @__PURE__ */ e(
2206
+ renderValue: (S) => S.toUpperCase(),
2207
+ children: ["xs", "s", "m", "l", "xl"].map((S) => /* @__PURE__ */ e(
2208
2208
  ee,
2209
2209
  {
2210
- value: v,
2211
- children: v.toUpperCase()
2210
+ value: S,
2211
+ children: S.toUpperCase()
2212
2212
  },
2213
- `size-select-${v}`
2213
+ `size-select-${S}`
2214
2214
  ))
2215
2215
  }
2216
2216
  ) }),
@@ -2220,14 +2220,14 @@ function wi({
2220
2220
  name: "customId",
2221
2221
  label: "Data IDs generation",
2222
2222
  position: "item-aligned",
2223
- disabled: E === "code_defined",
2224
- onValueChange: (v) => {
2225
- if (v === "code_defined")
2223
+ disabled: B === "code_defined",
2224
+ onValueChange: (S) => {
2225
+ if (S === "code_defined")
2226
2226
  throw new Error("This should not happen");
2227
- v === "true" ? m("customId", !0) : v === "false" ? m("customId", !1) : v === "optional" && m("customId", "optional");
2227
+ S === "true" ? m("customId", !0) : S === "false" ? m("customId", !1) : S === "optional" && m("customId", "optional");
2228
2228
  },
2229
2229
  value: "",
2230
- renderValue: (v) => v === "code_defined" ? "Code defined" : v === "true" ? "Users must define an ID" : v === "optional" ? "Users can define an ID, but it is not required" : "Document ID is generated automatically",
2230
+ renderValue: (S) => S === "code_defined" ? "Code defined" : S === "true" ? "Users must define an ID" : S === "optional" ? "Users can define an ID, but it is not required" : "Document ID is generated automatically",
2231
2231
  children: [
2232
2232
  /* @__PURE__ */ e(ee, { value: "false", children: "Document ID is generated automatically" }),
2233
2233
  /* @__PURE__ */ e(ee, { value: "true", children: "Users must define an ID" }),
@@ -2237,11 +2237,11 @@ function wi({
2237
2237
  ) }),
2238
2238
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2239
2239
  /* @__PURE__ */ e(
2240
- Jt,
2240
+ Ht,
2241
2241
  {
2242
2242
  position: "start",
2243
2243
  label: "Collection group",
2244
- onValueChange: (v) => m("collectionGroup", v),
2244
+ onValueChange: (S) => m("collectionGroup", S),
2245
2245
  value: p.collectionGroup ?? !1
2246
2246
  }
2247
2247
  ),
@@ -2256,15 +2256,15 @@ function wi({
2256
2256
  Ee,
2257
2257
  {
2258
2258
  open: O,
2259
- onOpenChange: k,
2259
+ onOpenChange: w,
2260
2260
  maxWidth: "xl",
2261
2261
  fullWidth: !0,
2262
2262
  children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
2263
- vi,
2263
+ wi,
2264
2264
  {
2265
2265
  selectedIcon: p.icon,
2266
- onIconSelected: (v) => {
2267
- k(!1), m("icon", v);
2266
+ onIconSelected: (S) => {
2267
+ w(!1), m("icon", S);
2268
2268
  }
2269
2269
  }
2270
2270
  ) })
@@ -2272,19 +2272,19 @@ function wi({
2272
2272
  )
2273
2273
  ] }) });
2274
2274
  }
2275
- function _e(t) {
2275
+ function ke(t) {
2276
2276
  return "properties." + t.replaceAll(".", ".properties.");
2277
2277
  }
2278
- function _i(t) {
2278
+ function ki(t) {
2279
2279
  return t ? "properties." + t.replaceAll(".", ".properties.") + ".properties" : "properties";
2280
2280
  }
2281
- function Ne(t) {
2281
+ function Pe(t) {
2282
2282
  return t ? "properties." + t.replaceAll(".", ".properties.") + ".propertiesOrder" : "propertiesOrder";
2283
2283
  }
2284
2284
  function ce(t, a) {
2285
2285
  return a ? `${a}.${t}` : t;
2286
2286
  }
2287
- const ki = L.memo(
2287
+ const xi = K.memo(
2288
2288
  function({
2289
2289
  enumValues: a,
2290
2290
  onValuesChanged: i,
@@ -2295,7 +2295,7 @@ const ki = L.memo(
2295
2295
  getData: p
2296
2296
  }) {
2297
2297
  return /* @__PURE__ */ e(
2298
- qt,
2298
+ St,
2299
2299
  {
2300
2300
  initialValues: { enumValues: a },
2301
2301
  validateOnMount: !0,
@@ -2309,7 +2309,7 @@ const ki = L.memo(
2309
2309
  }, [m.enumValues]), pe(() => {
2310
2310
  r && r(!!(u?.enumValues ?? !1));
2311
2311
  }, [u]), /* @__PURE__ */ e(
2312
- xi,
2312
+ Ci,
2313
2313
  {
2314
2314
  enumValuesPath: "enumValues",
2315
2315
  values: m,
@@ -2327,7 +2327,7 @@ const ki = L.memo(
2327
2327
  return a.enumValues.length === i.enumValues.length && a.onValuesChanged === i.onValuesChanged && a.getData === i.getData;
2328
2328
  }
2329
2329
  );
2330
- function xi({
2330
+ function Ci({
2331
2331
  values: t,
2332
2332
  errors: a,
2333
2333
  disabled: i,
@@ -2338,25 +2338,25 @@ function xi({
2338
2338
  }) {
2339
2339
  const {
2340
2340
  setFieldValue: p
2341
- } = K(), [m, u] = L.useState(), [c, d] = L.useState(), [f, g] = L.useState(!1), O = L.useRef(/* @__PURE__ */ new Set()).current, k = (h, _) => {
2342
- const y = m === _;
2341
+ } = Y(), [m, u] = K.useState(), [d, c] = K.useState(), [y, g] = K.useState(!1), O = K.useRef(/* @__PURE__ */ new Set()).current, w = (f, v) => {
2342
+ const _ = m === v;
2343
2343
  return /* @__PURE__ */ e(
2344
- Ci,
2344
+ Oi,
2345
2345
  {
2346
- index: h,
2346
+ index: f,
2347
2347
  disabled: i,
2348
2348
  enumValuesPath: r,
2349
- autoFocus: y,
2350
- shouldUpdateId: s || y,
2351
- onDialogOpen: () => d(h),
2352
- inferredEntry: O.has(t.enumValues[h]?.id)
2349
+ autoFocus: _,
2350
+ shouldUpdateId: s || _,
2351
+ onDialogOpen: () => c(f),
2352
+ inferredEntry: O.has(t.enumValues[f]?.id)
2353
2353
  },
2354
- `${_}`
2354
+ `${v}`
2355
2355
  );
2356
2356
  };
2357
2357
  return /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2358
2358
  /* @__PURE__ */ n("div", { className: "ml-3.5 flex flex-row items-center", children: [
2359
- /* @__PURE__ */ e(xa, {}),
2359
+ /* @__PURE__ */ e(Ca, {}),
2360
2360
  /* @__PURE__ */ e(
2361
2361
  C,
2362
2362
  {
@@ -2366,26 +2366,26 @@ function xi({
2366
2366
  }
2367
2367
  ),
2368
2368
  o && /* @__PURE__ */ n(
2369
- B,
2369
+ U,
2370
2370
  {
2371
- loading: f,
2372
- disabled: i || f,
2371
+ loading: y,
2372
+ disabled: i || y,
2373
2373
  variant: "text",
2374
2374
  size: "small",
2375
2375
  onClick: async () => {
2376
- l && (g(!0), l?.().then((h) => {
2377
- if (!h)
2376
+ l && (g(!0), l?.().then((f) => {
2377
+ if (!f)
2378
2378
  return;
2379
- const _ = h.flat(), y = Array.from(new Set(_)), w = t.enumValues, F = ei(y).filter((A) => !w?.some((S) => S.id === A.id));
2380
- F.forEach((A) => {
2381
- O.add(A.id);
2382
- }), p(r, [...F, ...w]);
2383
- }).catch((h) => {
2384
- console.error(h);
2379
+ const v = f.flat(), _ = Array.from(new Set(v)), h = t.enumValues, E = ti(_).filter((z) => !h?.some((q) => q.id === z.id));
2380
+ E.forEach((z) => {
2381
+ O.add(z.id);
2382
+ }), p(r, [...E, ...h]);
2383
+ }).catch((f) => {
2384
+ console.error(f);
2385
2385
  }).finally(() => g(!1)));
2386
2386
  },
2387
2387
  children: [
2388
- f ? /* @__PURE__ */ e(We, { size: "small" }) : /* @__PURE__ */ e(gt, {}),
2388
+ y ? /* @__PURE__ */ e(We, { size: "small" }) : /* @__PURE__ */ e(gt, {}),
2389
2389
  "Infer values from data"
2390
2390
  ]
2391
2391
  }
@@ -2393,12 +2393,12 @@ function xi({
2393
2393
  ] }),
2394
2394
  /* @__PURE__ */ n(qe, { className: "p-4 m-1", children: [
2395
2395
  /* @__PURE__ */ e(
2396
- Ca,
2396
+ Oa,
2397
2397
  {
2398
2398
  value: t.enumValues,
2399
2399
  addLabel: "Add enum value",
2400
2400
  name: r,
2401
- buildEntry: k,
2401
+ buildEntry: w,
2402
2402
  disabled: i,
2403
2403
  onInternalIdAdded: u,
2404
2404
  small: !0,
@@ -2407,18 +2407,18 @@ function xi({
2407
2407
  }
2408
2408
  ),
2409
2409
  /* @__PURE__ */ e(
2410
- Oi,
2410
+ Ni,
2411
2411
  {
2412
- index: c,
2413
- open: c !== void 0,
2412
+ index: d,
2413
+ open: d !== void 0,
2414
2414
  enumValuesPath: r,
2415
- onClose: () => d(void 0)
2415
+ onClose: () => c(void 0)
2416
2416
  }
2417
2417
  )
2418
2418
  ] })
2419
2419
  ] });
2420
2420
  }
2421
- const Ci = L.memo(
2421
+ const Oi = K.memo(
2422
2422
  function({
2423
2423
  index: a,
2424
2424
  shouldUpdateId: i,
@@ -2431,18 +2431,18 @@ const Ci = L.memo(
2431
2431
  const {
2432
2432
  values: m,
2433
2433
  handleChange: u,
2434
- errors: c,
2435
- setFieldValue: d,
2436
- touched: f
2437
- } = K(), g = L.useRef(!P(m, `${r}[${a}].id`)), b = i || g.current, O = P(m, `${r}[${a}].id`), k = P(m, `${r}[${a}].label`), x = P(c, `${r}[${a}].label`), h = L.useRef(k);
2438
- return L.useEffect(() => {
2439
- (h.current === O || !O) && b && d(`${r}[${a}].id`, k), h.current = k;
2440
- }, [k]), /* @__PURE__ */ n("div", { className: "flex w-full align-center justify-center", children: [
2434
+ errors: d,
2435
+ setFieldValue: c,
2436
+ touched: y
2437
+ } = Y(), g = K.useRef(!P(m, `${r}[${a}].id`)), b = i || g.current, O = P(m, `${r}[${a}].id`), w = P(m, `${r}[${a}].label`), k = P(d, `${r}[${a}].label`), f = K.useRef(w);
2438
+ return K.useEffect(() => {
2439
+ (f.current === O || !O) && b && c(`${r}[${a}].id`, w), f.current = w;
2440
+ }, [w]), /* @__PURE__ */ n("div", { className: "flex w-full align-center justify-center", children: [
2441
2441
  /* @__PURE__ */ e(
2442
2442
  de,
2443
2443
  {
2444
2444
  name: `${r}[${a}].label`,
2445
- as: H,
2445
+ as: J,
2446
2446
  className: "flex-grow",
2447
2447
  required: !0,
2448
2448
  disabled: l,
@@ -2451,7 +2451,7 @@ const Ci = L.memo(
2451
2451
  autoFocus: s,
2452
2452
  autoComplete: "off",
2453
2453
  endAdornment: p && /* @__PURE__ */ e(gt, { size: "small" }),
2454
- error: !!x
2454
+ error: !!k
2455
2455
  }
2456
2456
  ),
2457
2457
  !l && /* @__PURE__ */ e(
@@ -2470,7 +2470,7 @@ const Ci = L.memo(
2470
2470
  return a.index === i.index && a.enumValuesPath === i.enumValuesPath && a.shouldUpdateId === i.shouldUpdateId && a.inferredEntry === i.inferredEntry && a.autoFocus === i.autoFocus;
2471
2471
  }
2472
2472
  );
2473
- function Oi({
2473
+ function Ni({
2474
2474
  index: t,
2475
2475
  open: a,
2476
2476
  onClose: i,
@@ -2482,23 +2482,23 @@ function Oi({
2482
2482
  errors: l,
2483
2483
  setFieldValue: p,
2484
2484
  touched: m
2485
- } = K(), u = t !== void 0 ? P(l, `${r}[${t}].id`) : void 0;
2485
+ } = Y(), u = t !== void 0 ? P(l, `${r}[${t}].id`) : void 0;
2486
2486
  return /* @__PURE__ */ n(
2487
2487
  Ee,
2488
2488
  {
2489
2489
  maxWidth: "md",
2490
2490
  "aria-labelledby": "enum-edit-dialog",
2491
2491
  open: a,
2492
- onOpenChange: (c) => c ? void 0 : i(),
2492
+ onOpenChange: (d) => d ? void 0 : i(),
2493
2493
  children: [
2494
2494
  /* @__PURE__ */ e($e, { children: t !== void 0 && /* @__PURE__ */ n("div", { children: [
2495
2495
  /* @__PURE__ */ e(
2496
2496
  de,
2497
2497
  {
2498
2498
  name: `${r}[${t}]id`,
2499
- as: H,
2499
+ as: J,
2500
2500
  required: !0,
2501
- validate: Ni,
2501
+ validate: Si,
2502
2502
  label: "ID",
2503
2503
  size: "small",
2504
2504
  autoComplete: "off",
@@ -2508,7 +2508,7 @@ function Oi({
2508
2508
  /* @__PURE__ */ e(ie, { error: !!u, children: u ?? "Value saved in the data source" })
2509
2509
  ] }) }),
2510
2510
  /* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(
2511
- B,
2511
+ U,
2512
2512
  {
2513
2513
  autoFocus: !0,
2514
2514
  variant: "outlined",
@@ -2525,13 +2525,13 @@ function Pi(t) {
2525
2525
  let a;
2526
2526
  return t || (a = "You must specify a label"), a;
2527
2527
  }
2528
- function Ni(t) {
2528
+ function Si(t) {
2529
2529
  let a;
2530
2530
  return t || (a = "You must specify an ID"), a;
2531
2531
  }
2532
2532
  function Me({ disabled: t }) {
2533
- const { values: a, handleChange: i } = K(), r = "validation.required", s = "validation.requiredMessage";
2534
- return /* @__PURE__ */ n(M, { children: [
2533
+ const { values: a, handleChange: i } = Y(), r = "validation.required", s = "validation.requiredMessage";
2534
+ return /* @__PURE__ */ n($, { children: [
2535
2535
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2536
2536
  de,
2537
2537
  {
@@ -2555,7 +2555,7 @@ function Me({ disabled: t }) {
2555
2555
  }
2556
2556
  ) }),
2557
2557
  P(a, r) && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2558
- H,
2558
+ J,
2559
2559
  {
2560
2560
  disabled: t,
2561
2561
  value: P(a, s),
@@ -2580,9 +2580,9 @@ function Ue({
2580
2580
  }) {
2581
2581
  const {
2582
2582
  values: u,
2583
- handleChange: c,
2584
- errors: d
2585
- } = K(), f = "validation.length", g = "validation.min", b = "validation.max", O = "validation.trim", k = "validation.matches", x = "validation.lowercase", h = "validation.uppercase", _ = P(d, k), y = P(u, k), w = typeof y == "string" ? y : Oa(y);
2583
+ handleChange: d,
2584
+ errors: c
2585
+ } = Y(), y = "validation.length", g = "validation.min", b = "validation.max", O = "validation.trim", w = "validation.matches", k = "validation.lowercase", f = "validation.uppercase", v = P(c, w), _ = P(u, w), h = typeof _ == "string" ? _ : Na(_);
2586
2586
  return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
2587
2587
  /* @__PURE__ */ e(Me, { disabled: p }),
2588
2588
  /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
@@ -2590,7 +2590,7 @@ function Ue({
2590
2590
  de,
2591
2591
  {
2592
2592
  type: "checkbox",
2593
- name: x,
2593
+ name: k,
2594
2594
  label: "Lowercase",
2595
2595
  disabled: p,
2596
2596
  component: he
@@ -2600,7 +2600,7 @@ function Ue({
2600
2600
  de,
2601
2601
  {
2602
2602
  type: "checkbox",
2603
- name: h,
2603
+ name: f,
2604
2604
  label: "Uppercase",
2605
2605
  disabled: p,
2606
2606
  component: he
@@ -2619,19 +2619,19 @@ function Ue({
2619
2619
  ] }),
2620
2620
  /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
2621
2621
  t && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2622
- H,
2622
+ J,
2623
2623
  {
2624
- value: P(u, f),
2624
+ value: P(u, y),
2625
2625
  label: "Exact length",
2626
- name: f,
2626
+ name: y,
2627
2627
  type: "number",
2628
2628
  size: "small",
2629
2629
  disabled: p,
2630
- onChange: c
2630
+ onChange: d
2631
2631
  }
2632
2632
  ) }),
2633
2633
  s && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2634
- H,
2634
+ J,
2635
2635
  {
2636
2636
  value: P(u, g),
2637
2637
  label: "Min length",
@@ -2639,11 +2639,11 @@ function Ue({
2639
2639
  type: "number",
2640
2640
  size: "small",
2641
2641
  disabled: p,
2642
- onChange: c
2642
+ onChange: d
2643
2643
  }
2644
2644
  ) }),
2645
2645
  r && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2646
- H,
2646
+ J,
2647
2647
  {
2648
2648
  value: P(u, b),
2649
2649
  label: "Max length",
@@ -2651,7 +2651,7 @@ function Ue({
2651
2651
  type: "number",
2652
2652
  size: "small",
2653
2653
  disabled: p,
2654
- onChange: c
2654
+ onChange: d
2655
2655
  }
2656
2656
  ) })
2657
2657
  ] }),
@@ -2659,21 +2659,21 @@ function Ue({
2659
2659
  /* @__PURE__ */ e(
2660
2660
  de,
2661
2661
  {
2662
- name: k,
2663
- as: H,
2664
- validate: (q) => q && !Pa(q),
2662
+ name: w,
2663
+ as: J,
2664
+ validate: (A) => A && !Pa(A),
2665
2665
  label: "Matches regex",
2666
2666
  size: "small",
2667
2667
  disabled: p,
2668
- value: w,
2669
- error: !!_
2668
+ value: h,
2669
+ error: !!v
2670
2670
  }
2671
2671
  ),
2672
- /* @__PURE__ */ e(ie, { error: !!_, children: _ ? "Not a valid regexp" : "e.g. /^\\d+$/ for digits only" })
2672
+ /* @__PURE__ */ e(ie, { error: !!v, children: v ? "Not a valid regexp" : "e.g. /^\\d+$/ for digits only" })
2673
2673
  ] })
2674
2674
  ] });
2675
2675
  }
2676
- function zt({
2676
+ function At({
2677
2677
  max: t = !0,
2678
2678
  min: a = !0,
2679
2679
  disabled: i
@@ -2681,11 +2681,11 @@ function zt({
2681
2681
  const {
2682
2682
  values: r,
2683
2683
  handleChange: s
2684
- } = K(), o = "validation.min", l = "validation.max";
2684
+ } = Y(), o = "validation.min", l = "validation.max";
2685
2685
  return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
2686
2686
  /* @__PURE__ */ e(Me, { disabled: i }),
2687
2687
  a && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2688
- H,
2688
+ J,
2689
2689
  {
2690
2690
  value: P(r, o),
2691
2691
  disabled: i,
@@ -2697,7 +2697,7 @@ function zt({
2697
2697
  }
2698
2698
  ) }),
2699
2699
  t && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2700
- H,
2700
+ J,
2701
2701
  {
2702
2702
  value: P(r, l),
2703
2703
  disabled: i,
@@ -2714,13 +2714,13 @@ function ze({
2714
2714
  children: t
2715
2715
  }) {
2716
2716
  return /* @__PURE__ */ e(
2717
- Pt,
2717
+ Ot,
2718
2718
  {
2719
2719
  initiallyExpanded: !1,
2720
2720
  asField: !0,
2721
2721
  className: "p-4",
2722
2722
  title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
2723
- /* @__PURE__ */ e(Na, {}),
2723
+ /* @__PURE__ */ e(Sa, {}),
2724
2724
  /* @__PURE__ */ e(
2725
2725
  C,
2726
2726
  {
@@ -2734,7 +2734,7 @@ function ze({
2734
2734
  }
2735
2735
  );
2736
2736
  }
2737
- function Mt({
2737
+ function Bt({
2738
2738
  multiselect: t,
2739
2739
  updateIds: a,
2740
2740
  disabled: i,
@@ -2747,25 +2747,25 @@ function Mt({
2747
2747
  handleChange: p,
2748
2748
  errors: m,
2749
2749
  touched: u,
2750
- setFieldError: c,
2751
- setFieldValue: d
2752
- } = K(), f = De(), g = t ? "of.enumValues" : "enumValues", b = P(l, "defaultValue"), O = P(l, g), k = Yt(() => !O || typeof O == "boolean" ? [] : Sa(O) ?? [], [O]);
2753
- return /* @__PURE__ */ n(M, { children: [
2750
+ setFieldError: d,
2751
+ setFieldValue: c
2752
+ } = Y(), y = De(), g = t ? "of.enumValues" : "enumValues", b = P(l, "defaultValue"), O = P(l, g), w = Kt(() => !O || typeof O == "boolean" ? [] : qa(O) ?? [], [O]);
2753
+ return /* @__PURE__ */ n($, { children: [
2754
2754
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2755
- ki,
2755
+ xi,
2756
2756
  {
2757
- enumValues: k,
2757
+ enumValues: w,
2758
2758
  updateIds: a,
2759
2759
  disabled: i,
2760
2760
  allowDataInference: s,
2761
- onError: (h) => {
2762
- c(g, h ? "" : void 0);
2761
+ onError: (f) => {
2762
+ d(g, f ? "" : void 0);
2763
2763
  },
2764
- getData: o ? () => o().then((h) => h.map((_) => l.id && P(_, l.id)).filter(Boolean)) : void 0,
2765
- onValuesChanged: (h) => {
2766
- if (l && (d(g, h), !t)) {
2767
- const _ = h.filter((y) => !!y?.id).map((y) => y.id);
2768
- b && !_.includes(b) && (d("defaultValue", void 0), f.open({
2764
+ getData: o ? () => o().then((f) => f.map((v) => l.id && P(v, l.id)).filter(Boolean)) : void 0,
2765
+ onValuesChanged: (f) => {
2766
+ if (l && (c(g, f), !t)) {
2767
+ const v = f.filter((_) => !!_?.id).map((_) => _.id);
2768
+ b && !v.includes(b) && (c("defaultValue", void 0), y.open({
2769
2769
  type: "warning",
2770
2770
  message: "Default value was cleared"
2771
2771
  }));
@@ -2781,25 +2781,25 @@ function Mt({
2781
2781
  showErrors: r
2782
2782
  }
2783
2783
  ),
2784
- t && /* @__PURE__ */ e(zt, { disabled: i })
2784
+ t && /* @__PURE__ */ e(At, { disabled: i })
2785
2785
  ] }) }),
2786
2786
  !t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2787
2787
  Se,
2788
2788
  {
2789
2789
  disabled: i,
2790
2790
  position: "item-aligned",
2791
- onValueChange: (h) => {
2792
- d("defaultValue", h);
2791
+ onValueChange: (f) => {
2792
+ c("defaultValue", f);
2793
2793
  },
2794
2794
  label: "Default value",
2795
2795
  value: b ?? "",
2796
- children: k.filter((h) => !!h?.id).map((h) => /* @__PURE__ */ e(
2796
+ children: w.filter((f) => !!f?.id).map((f) => /* @__PURE__ */ e(
2797
2797
  ee,
2798
2798
  {
2799
- value: h.id?.toString(),
2800
- children: h.label
2799
+ value: f.id?.toString(),
2800
+ children: f.label
2801
2801
  },
2802
- h.id
2802
+ f.id
2803
2803
  ))
2804
2804
  }
2805
2805
  ) })
@@ -2812,7 +2812,7 @@ const nt = {
2812
2812
  "application/*": "Files (pdf, zip, csv, excel...)",
2813
2813
  "text/*": "Text files"
2814
2814
  };
2815
- function Rt({
2815
+ function Mt({
2816
2816
  multiple: t,
2817
2817
  existing: a,
2818
2818
  disabled: i
@@ -2820,15 +2820,15 @@ function Rt({
2820
2820
  const {
2821
2821
  values: r,
2822
2822
  setFieldValue: s
2823
- } = K(), o = t ? "of.storage" : "storage", l = `${o}.acceptedFiles`, p = `${o}.fileName`, m = `${o}.storagePath`, u = `${o}.storeUrl`, c = P(r, p) ?? "{rand}_{file}", d = P(r, m) ?? "/", f = P(r, l), g = Array.isArray(f) ? f : void 0, b = !g || g.length === 0, O = (h) => {
2824
- h ? h.includes("all") || h.length >= Object.keys(nt).length ? s(l, void 0) : b ? s(l, Object.keys(nt).filter((_) => !h.includes(_))) : s(l, h) : s(l, void 0);
2825
- }, k = typeof c == "function", x = typeof d == "function";
2826
- return /* @__PURE__ */ n(M, { children: [
2823
+ } = Y(), o = t ? "of.storage" : "storage", l = `${o}.acceptedFiles`, p = `${o}.fileName`, m = `${o}.storagePath`, u = `${o}.storeUrl`, d = P(r, p) ?? "{rand}_{file}", c = P(r, m) ?? "/", y = P(r, l), g = Array.isArray(y) ? y : void 0, b = !g || g.length === 0, O = (f) => {
2824
+ f ? f.includes("all") || f.length >= Object.keys(nt).length ? s(l, void 0) : b ? s(l, Object.keys(nt).filter((v) => !f.includes(v))) : s(l, f) : s(l, void 0);
2825
+ }, w = typeof d == "function", k = typeof c == "function";
2826
+ return /* @__PURE__ */ n($, { children: [
2827
2827
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2828
- Pt,
2828
+ Ot,
2829
2829
  {
2830
2830
  title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
2831
- /* @__PURE__ */ e(qa, {}),
2831
+ /* @__PURE__ */ e(Aa, {}),
2832
2832
  /* @__PURE__ */ e(
2833
2833
  C,
2834
2834
  {
@@ -2840,66 +2840,66 @@ function Rt({
2840
2840
  ] }),
2841
2841
  children: /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 p-4", children: [
2842
2842
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
2843
- Aa,
2843
+ za,
2844
2844
  {
2845
2845
  disabled: i,
2846
2846
  name: l,
2847
2847
  value: g ?? [],
2848
2848
  onMultiValueChange: O,
2849
2849
  label: b ? void 0 : "Allowed file types",
2850
- renderValues: (h) => !h || h.length === 0 ? "All file types allowed" : h.map((_) => nt[_]).filter((_) => !!_).join(", "),
2850
+ renderValues: (f) => !f || f.length === 0 ? "All file types allowed" : f.map((v) => nt[v]).filter((v) => !!v).join(", "),
2851
2851
  children: [
2852
- /* @__PURE__ */ n(Tt, { value: "all", className: "flex items-center gap-2", children: [
2852
+ /* @__PURE__ */ n(zt, { value: "all", className: "flex items-center gap-2", children: [
2853
2853
  /* @__PURE__ */ e(
2854
- Vt,
2854
+ Tt,
2855
2855
  {
2856
2856
  checked: !g
2857
2857
  }
2858
2858
  ),
2859
2859
  "All"
2860
2860
  ] }, "all"),
2861
- Object.entries(nt).map(([h, _]) => /* @__PURE__ */ n(Tt, { value: h, className: "flex items-center gap-2", children: [
2861
+ Object.entries(nt).map(([f, v]) => /* @__PURE__ */ n(zt, { value: f, className: "flex items-center gap-2", children: [
2862
2862
  /* @__PURE__ */ e(
2863
- Vt,
2863
+ Tt,
2864
2864
  {
2865
- checked: b || g.indexOf(h) > -1
2865
+ checked: b || g.indexOf(f) > -1
2866
2866
  }
2867
2867
  ),
2868
- /* @__PURE__ */ e("div", { className: "flex-grow", children: _ }),
2868
+ /* @__PURE__ */ e("div", { className: "flex-grow", children: v }),
2869
2869
  /* @__PURE__ */ e(
2870
- B,
2870
+ U,
2871
2871
  {
2872
2872
  size: "small",
2873
2873
  variant: "outlined",
2874
- onClick: (y) => (y.preventDefault(), y.stopPropagation(), s(l, [h])),
2874
+ onClick: (_) => (_.preventDefault(), _.stopPropagation(), s(l, [f])),
2875
2875
  children: "Only"
2876
2876
  }
2877
2877
  )
2878
- ] }, h))
2878
+ ] }, f))
2879
2879
  ]
2880
2880
  }
2881
2881
  ) }),
2882
2882
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2883
- be,
2883
+ ye,
2884
2884
  {
2885
2885
  name: p,
2886
- as: H,
2886
+ as: J,
2887
2887
  label: "File name",
2888
2888
  size: "small",
2889
- disabled: k || i,
2890
- value: k ? "-" : c
2889
+ disabled: w || i,
2890
+ value: w ? "-" : d
2891
2891
  }
2892
2892
  ) }),
2893
2893
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2894
2894
  /* @__PURE__ */ e(
2895
- be,
2895
+ ye,
2896
2896
  {
2897
2897
  name: m,
2898
- as: H,
2898
+ as: J,
2899
2899
  label: "Storage path",
2900
- disabled: x || i,
2900
+ disabled: k || i,
2901
2901
  size: "small",
2902
- value: x ? "-" : d
2902
+ value: k ? "-" : c
2903
2903
  }
2904
2904
  ),
2905
2905
  /* @__PURE__ */ n(C, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: [
@@ -2915,7 +2915,7 @@ function Rt({
2915
2915
  ] })
2916
2916
  ] }),
2917
2917
  /* @__PURE__ */ e(
2918
- be,
2918
+ ye,
2919
2919
  {
2920
2920
  type: "checkbox",
2921
2921
  name: u,
@@ -2932,7 +2932,7 @@ function Rt({
2932
2932
  ) }),
2933
2933
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(ze, { children: [
2934
2934
  !t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Me, { disabled: i }) }),
2935
- t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(zt, { disabled: i }) })
2935
+ t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(At, { disabled: i }) })
2936
2936
  ] }) })
2937
2937
  ] });
2938
2938
  }
@@ -2944,14 +2944,14 @@ function Je(t) {
2944
2944
  return a.dataType === "array" && typeof a.of == "function" || a.dataType === "array" && Array.isArray(a.of) ? !1 : !!a.editable;
2945
2945
  }
2946
2946
  }
2947
- function Si(t) {
2947
+ function qi(t) {
2948
2948
  return Object.entries(t).filter(([a, i]) => Je(i)).map(([a, i]) => {
2949
2949
  const r = i;
2950
2950
  if (Je(r))
2951
2951
  return r.dataType === "map" && r.properties ? {
2952
2952
  [a]: {
2953
2953
  ...r,
2954
- properties: Si(r.properties)
2954
+ properties: qi(r.properties)
2955
2955
  }
2956
2956
  } : { [a]: r };
2957
2957
  }).filter((a) => !!a).reduce((a, i) => ({ ...a, ...i }), {});
@@ -2965,7 +2965,7 @@ function oa({
2965
2965
  selected: o
2966
2966
  }) {
2967
2967
  const { propertyConfigs: l } = Ke(), p = Ze(t, l);
2968
- return Je(t), /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ n(
2968
+ return Je(t), /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ n(
2969
2969
  "div",
2970
2970
  {
2971
2971
  onClick: a,
@@ -2975,17 +2975,17 @@ function oa({
2975
2975
  /* @__PURE__ */ n(
2976
2976
  qe,
2977
2977
  {
2978
- className: ke(
2978
+ className: xe(
2979
2979
  "pl-2 w-full flex flex-row gap-4 items-center",
2980
- Qt,
2981
- a ? Wt : "",
2982
- o ? Zt : "",
2980
+ Jt,
2981
+ a ? Qt : "",
2982
+ o ? Wt : "",
2983
2983
  "flex-grow p-4 border transition-colors duration-200",
2984
2984
  i ? "border-red-500" : o ? "border-blue-500" : "border-transparent"
2985
2985
  ),
2986
2986
  children: [
2987
2987
  /* @__PURE__ */ n("div", { className: "w-full flex flex-col", children: [
2988
- r && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
2988
+ r && /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
2989
2989
  C,
2990
2990
  {
2991
2991
  variant: "body1",
@@ -2995,7 +2995,7 @@ function oa({
2995
2995
  }
2996
2996
  ) }),
2997
2997
  /* @__PURE__ */ n("div", { className: "flex flex-row items-center", children: [
2998
- /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
2998
+ /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
2999
2999
  C,
3000
3000
  {
3001
3001
  className: "flex-grow pr-2",
@@ -3005,7 +3005,7 @@ function oa({
3005
3005
  children: p?.name
3006
3006
  }
3007
3007
  ) }),
3008
- /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3008
+ /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
3009
3009
  C,
3010
3010
  {
3011
3011
  variant: "body2",
@@ -3024,7 +3024,7 @@ function oa({
3024
3024
  }
3025
3025
  ) });
3026
3026
  }
3027
- function qi({
3027
+ function Ai({
3028
3028
  name: t,
3029
3029
  selected: a,
3030
3030
  onClick: i,
@@ -3043,19 +3043,19 @@ function qi({
3043
3043
  "div",
3044
3044
  {
3045
3045
  className: "h-8 w-8 p-1 rounded-full shadow text-white bg-gray-500",
3046
- children: /* @__PURE__ */ e(za, { color: "inherit", size: "medium" })
3046
+ children: /* @__PURE__ */ e(Ta, { color: "inherit", size: "medium" })
3047
3047
  }
3048
3048
  ),
3049
- /* @__PURE__ */ e(Ta, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
3049
+ /* @__PURE__ */ e(Va, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
3050
3050
  ] }),
3051
3051
  /* @__PURE__ */ e(
3052
3052
  qe,
3053
3053
  {
3054
- className: ke(
3054
+ className: xe(
3055
3055
  "pl-2 w-full flex flex-row gap-4 items-center",
3056
- Qt,
3057
- i ? Wt : "",
3058
- a ? Zt : "",
3056
+ Jt,
3057
+ i ? Qt : "",
3058
+ a ? Wt : "",
3059
3059
  "flex-grow p-4 border transition-colors duration-200",
3060
3060
  a ? "border-blue-500" : "border-transparent"
3061
3061
  ),
@@ -3080,7 +3080,7 @@ function qi({
3080
3080
  children: o?.name
3081
3081
  }
3082
3082
  ),
3083
- r && !oe(r) && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3083
+ r && !oe(r) && /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
3084
3084
  C,
3085
3085
  {
3086
3086
  variant: "body2",
@@ -3089,7 +3089,7 @@ function qi({
3089
3089
  children: r.dataType
3090
3090
  }
3091
3091
  ) }),
3092
- r && oe(r) && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3092
+ r && oe(r) && /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
3093
3093
  C,
3094
3094
  {
3095
3095
  variant: "body2",
@@ -3098,7 +3098,7 @@ function qi({
3098
3098
  children: "This property is defined as a property builder in code"
3099
3099
  }
3100
3100
  ) }),
3101
- !r && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3101
+ !r && /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
3102
3102
  C,
3103
3103
  {
3104
3104
  variant: "body2",
@@ -3126,48 +3126,48 @@ function ft({
3126
3126
  onPropertyMove: p,
3127
3127
  onPropertyRemove: m,
3128
3128
  className: u,
3129
- inferredPropertyKeys: c,
3130
- collectionEditable: d
3129
+ inferredPropertyKeys: d,
3130
+ collectionEditable: c
3131
3131
  }) {
3132
- const f = s ?? Object.keys(r), g = X((b) => {
3132
+ const y = s ?? Object.keys(r), g = Z((b) => {
3133
3133
  if (!b.destination)
3134
3134
  return;
3135
- const O = b.source.index, k = b.destination.index, x = Array.from(f), [h] = x.splice(O, 1);
3136
- x.splice(k, 0, h), p && p(x, t);
3137
- }, [t, p, f]);
3138
- return /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(ii, { onDragEnd: g, children: /* @__PURE__ */ e(ri, { droppableId: `droppable_${t}`, children: (b, O) => /* @__PURE__ */ n(
3135
+ const O = b.source.index, w = b.destination.index, k = Array.from(y), [f] = k.splice(O, 1);
3136
+ k.splice(w, 0, f), p && p(k, t);
3137
+ }, [t, p, y]);
3138
+ return /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(ri, { onDragEnd: g, children: /* @__PURE__ */ e(oi, { droppableId: `droppable_${t}`, children: (b, O) => /* @__PURE__ */ n(
3139
3139
  "div",
3140
3140
  {
3141
3141
  ...b.droppableProps,
3142
3142
  ref: b.innerRef,
3143
3143
  className: u,
3144
3144
  children: [
3145
- f && f.map((k, x) => {
3146
- const h = r[k], _ = o?.find((y) => y.key === k);
3147
- return !h && !_ ? (console.warn(`Property ${k} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
3148
- oi,
3145
+ y && y.map((w, k) => {
3146
+ const f = r[w], v = o?.find((_) => _.key === w);
3147
+ return !f && !v ? (console.warn(`Property ${w} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
3148
+ ni,
3149
3149
  {
3150
- draggableId: `array_field_${t}_${k}}`,
3151
- index: x,
3152
- children: (y, w) => /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3153
- Ai,
3150
+ draggableId: `array_field_${t}_${w}}`,
3151
+ index: k,
3152
+ children: (_, h) => /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
3153
+ zi,
3154
3154
  {
3155
- propertyKey: k,
3156
- propertyOrBuilder: h,
3157
- additionalField: _,
3158
- provided: y,
3155
+ propertyKey: w,
3156
+ propertyOrBuilder: f,
3157
+ additionalField: v,
3158
+ provided: _,
3159
3159
  errors: l,
3160
3160
  namespace: t,
3161
- inferredPropertyKeys: c,
3161
+ inferredPropertyKeys: d,
3162
3162
  onPropertyMove: p,
3163
3163
  onPropertyRemove: m,
3164
- onPropertyClick: w.isDragging ? void 0 : i,
3164
+ onPropertyClick: h.isDragging ? void 0 : i,
3165
3165
  selectedPropertyKey: a,
3166
- collectionEditable: d
3166
+ collectionEditable: c
3167
3167
  }
3168
3168
  ) })
3169
3169
  },
3170
- `array_field_${t}_${k}}`
3170
+ `array_field_${t}_${w}}`
3171
3171
  );
3172
3172
  }).filter(Boolean),
3173
3173
  b.placeholder
@@ -3175,7 +3175,7 @@ function ft({
3175
3175
  }
3176
3176
  ) }) }) });
3177
3177
  }
3178
- function Ai({
3178
+ function zi({
3179
3179
  propertyKey: t,
3180
3180
  namespace: a,
3181
3181
  propertyOrBuilder: i,
@@ -3186,29 +3186,29 @@ function Ai({
3186
3186
  onPropertyClick: p,
3187
3187
  onPropertyMove: m,
3188
3188
  onPropertyRemove: u,
3189
- inferredPropertyKeys: c,
3190
- collectionEditable: d
3189
+ inferredPropertyKeys: d,
3190
+ collectionEditable: c
3191
3191
  }) {
3192
- const f = c?.includes(a ? `${a}.${t}` : t), g = ce(t, a);
3192
+ const y = d?.includes(a ? `${a}.${t}` : t), g = ce(t, a);
3193
3193
  let b;
3194
3194
  if (typeof i == "object") {
3195
- const h = i;
3196
- h.dataType === "map" && h.properties && (b = /* @__PURE__ */ e(
3195
+ const f = i;
3196
+ f.dataType === "map" && f.properties && (b = /* @__PURE__ */ e(
3197
3197
  ft,
3198
3198
  {
3199
3199
  selectedPropertyKey: o,
3200
3200
  namespace: g,
3201
- properties: h.properties,
3202
- propertiesOrder: h.propertiesOrder,
3201
+ properties: f.properties,
3202
+ propertiesOrder: f.propertiesOrder,
3203
3203
  errors: l,
3204
3204
  onPropertyClick: p,
3205
3205
  onPropertyMove: m,
3206
3206
  onPropertyRemove: u,
3207
- collectionEditable: d
3207
+ collectionEditable: c
3208
3208
  }
3209
3209
  ));
3210
3210
  }
3211
- const O = g ? P(l, _e(g)) : !1, k = o === g, x = i && (d && !oe(i) || Je(i));
3211
+ const O = g ? P(l, ke(g)) : !1, w = o === g, k = i && (c && !oe(i) || Je(i));
3212
3212
  return /* @__PURE__ */ n(
3213
3213
  "div",
3214
3214
  {
@@ -3228,33 +3228,33 @@ function Ai({
3228
3228
  }
3229
3229
  }
3230
3230
  ),
3231
- !oe(i) && !r && x ? /* @__PURE__ */ e(
3231
+ !oe(i) && !r && k ? /* @__PURE__ */ e(
3232
3232
  oa,
3233
3233
  {
3234
3234
  property: i,
3235
3235
  onClick: p ? () => p(t, a) : void 0,
3236
3236
  includeName: !0,
3237
- selected: k,
3237
+ selected: w,
3238
3238
  hasError: O
3239
3239
  }
3240
3240
  ) : /* @__PURE__ */ e(
3241
- qi,
3241
+ Ai,
3242
3242
  {
3243
3243
  name: t,
3244
3244
  property: i,
3245
3245
  onClick: p ? () => p(t, a) : void 0,
3246
- selected: k
3246
+ selected: w
3247
3247
  }
3248
3248
  ),
3249
3249
  /* @__PURE__ */ n("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
3250
- f && /* @__PURE__ */ e(re, { title: "Inferred property", children: /* @__PURE__ */ e(gt, { size: "small", className: "p-2" }) }),
3250
+ y && /* @__PURE__ */ e(re, { title: "Inferred property", children: /* @__PURE__ */ e(gt, { size: "small", className: "p-2" }) }),
3251
3251
  u && /* @__PURE__ */ e(re, { title: "Remove", children: /* @__PURE__ */ e(
3252
3252
  ne,
3253
3253
  {
3254
3254
  size: "small",
3255
3255
  color: "inherit",
3256
3256
  onClick: () => u(t, a),
3257
- children: /* @__PURE__ */ e(Va, { size: "small" })
3257
+ children: /* @__PURE__ */ e(Ia, { size: "small" })
3258
3258
  }
3259
3259
  ) }),
3260
3260
  m && /* @__PURE__ */ e(re, { title: "Move", children: /* @__PURE__ */ e(
@@ -3262,7 +3262,7 @@ function Ai({
3262
3262
  {
3263
3263
  component: "span",
3264
3264
  size: "small",
3265
- children: /* @__PURE__ */ e(Ia, { size: "small" })
3265
+ children: /* @__PURE__ */ e(Fa, { size: "small" })
3266
3266
  }
3267
3267
  ) })
3268
3268
  ] }),
@@ -3271,28 +3271,28 @@ function Ai({
3271
3271
  }
3272
3272
  );
3273
3273
  }
3274
- function zi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r, collectionEditable: s }) {
3274
+ function Ti({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r, collectionEditable: s }) {
3275
3275
  const {
3276
3276
  values: o,
3277
3277
  setFieldValue: l
3278
- } = K(), [p, m] = $(!1), [u, c] = $(), [d, f] = $(), g = o.propertiesOrder ?? Object.keys(o.properties ?? {}), b = X(({
3279
- id: w,
3280
- property: q
3278
+ } = Y(), [p, m] = L(!1), [u, d] = L(), [c, y] = L(), g = o.propertiesOrder ?? Object.keys(o.properties ?? {}), b = Z(({
3279
+ id: h,
3280
+ property: A
3281
3281
  }) => {
3282
- if (!w)
3282
+ if (!h)
3283
3283
  throw Error();
3284
3284
  l("properties", {
3285
3285
  ...o.properties ?? {},
3286
- [w]: q
3287
- }, !1), l("propertiesOrder", [...g, w], !1), m(!1);
3288
- }, [o.properties, g]), O = X((w, q) => {
3289
- const F = w ? ce(w, q) : void 0;
3290
- if (!F)
3286
+ [h]: A
3287
+ }, !1), l("propertiesOrder", [...g, h], !1), m(!1);
3288
+ }, [o.properties, g]), O = Z((h, A) => {
3289
+ const E = h ? ce(h, A) : void 0;
3290
+ if (!E)
3291
3291
  throw Error("collection editor miss config");
3292
- const A = _e(F), S = Ne(q), E = P(o, S) ?? Object.keys(P(o, _i(q)));
3293
- l(A, void 0, !1), l(S, E.filter((v) => v !== w), !1), m(!1), c(void 0), f(void 0);
3294
- }, [l, o]), k = u ? ce(u, d) : void 0, x = k ? P(o.properties, k.replaceAll(".", ".properties.")) : void 0, h = /* @__PURE__ */ n(
3295
- B,
3292
+ const z = ke(E), q = Pe(A), B = P(o, q) ?? Object.keys(P(o, ki(A)));
3293
+ l(z, void 0, !1), l(q, B.filter((S) => S !== h), !1), m(!1), d(void 0), y(void 0);
3294
+ }, [l, o]), w = u ? ce(u, c) : void 0, k = w ? P(o.properties, w.replaceAll(".", ".properties.")) : void 0, f = /* @__PURE__ */ n(
3295
+ U,
3296
3296
  {
3297
3297
  color: "primary",
3298
3298
  variant: "outlined",
@@ -3303,14 +3303,14 @@ function zi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3303
3303
  o.name ?? "this group"
3304
3304
  ]
3305
3305
  }
3306
- ), _ = !g || g.length < 1, y = X((w, q) => {
3307
- l(Ne(q), w, !1);
3306
+ ), v = !g || g.length < 1, _ = Z((h, A) => {
3307
+ l(Pe(A), h, !1);
3308
3308
  }, []);
3309
- return /* @__PURE__ */ n(M, { children: [
3309
+ return /* @__PURE__ */ n($, { children: [
3310
3310
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3311
3311
  /* @__PURE__ */ n("div", { className: "flex justify-between items-end my-4", children: [
3312
3312
  /* @__PURE__ */ e(C, { variant: "subtitle2", children: "Properties in this group" }),
3313
- h
3313
+ f
3314
3314
  ] }),
3315
3315
  /* @__PURE__ */ n(qe, { className: "p-2 pl-8", children: [
3316
3316
  /* @__PURE__ */ e(
@@ -3320,13 +3320,13 @@ function zi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3320
3320
  propertiesOrder: g,
3321
3321
  errors: {},
3322
3322
  collectionEditable: s,
3323
- onPropertyClick: (w, q) => {
3324
- c(w), f(q), m(!0);
3323
+ onPropertyClick: (h, A) => {
3324
+ d(h), y(A), m(!0);
3325
3325
  },
3326
- onPropertyMove: y
3326
+ onPropertyMove: _
3327
3327
  }
3328
3328
  ),
3329
- _ && /* @__PURE__ */ e(
3329
+ v && /* @__PURE__ */ e(
3330
3330
  C,
3331
3331
  {
3332
3332
  variant: "label",
@@ -3338,12 +3338,12 @@ function zi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3338
3338
  ] }),
3339
3339
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3340
3340
  /* @__PURE__ */ e(
3341
- Jt,
3341
+ Ht,
3342
3342
  {
3343
3343
  position: "start",
3344
3344
  size: "small",
3345
3345
  label: "Spread children as columns",
3346
- onValueChange: (w) => l("spreadChildren", w),
3346
+ onValueChange: (h) => l("spreadChildren", h),
3347
3347
  value: o.spreadChildren ?? !1
3348
3348
  }
3349
3349
  ),
@@ -3358,16 +3358,16 @@ function zi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3358
3358
  allowDataInference: i,
3359
3359
  collectionEditable: s,
3360
3360
  onCancel: () => {
3361
- m(!1), c(void 0), f(void 0);
3361
+ m(!1), d(void 0), y(void 0);
3362
3362
  },
3363
3363
  onOkClicked: () => {
3364
- m(!1), c(void 0), f(void 0);
3364
+ m(!1), d(void 0), y(void 0);
3365
3365
  },
3366
3366
  getData: a,
3367
3367
  onDelete: O,
3368
3368
  propertyKey: u,
3369
- propertyNamespace: d,
3370
- property: x,
3369
+ propertyNamespace: c,
3370
+ property: k,
3371
3371
  existingProperty: !!u,
3372
3372
  autoUpdateId: !u,
3373
3373
  autoOpenTypeSelect: !u,
@@ -3378,7 +3378,7 @@ function zi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3378
3378
  )
3379
3379
  ] });
3380
3380
  }
3381
- function Ti({
3381
+ function Vi({
3382
3382
  showErrors: t,
3383
3383
  existing: a,
3384
3384
  disabled: i,
@@ -3391,20 +3391,20 @@ function Ti({
3391
3391
  values: p,
3392
3392
  handleChange: m,
3393
3393
  errors: u,
3394
- setFieldValue: c,
3395
- touched: d
3396
- } = K(), [f, g] = $(!1), b = P(p, "of"), O = P(d, "of") && P(u, "of"), k = X(({ id: h, property: _, namespace: y }) => {
3397
- c("of", _);
3398
- }, []), x = b && Ze(b, o);
3399
- return /* @__PURE__ */ n(M, { children: [
3394
+ setFieldValue: d,
3395
+ touched: c
3396
+ } = Y(), [y, g] = L(!1), b = P(p, "of"), O = P(c, "of") && P(u, "of"), w = Z(({ id: f, property: v, namespace: _ }) => {
3397
+ d("of", v);
3398
+ }, []), k = b && Ze(b, o);
3399
+ return /* @__PURE__ */ n($, { children: [
3400
3400
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3401
3401
  /* @__PURE__ */ e(C, { variant: "subtitle2", children: "Repeat component" }),
3402
3402
  /* @__PURE__ */ e(
3403
- be,
3403
+ ye,
3404
3404
  {
3405
3405
  name: "of",
3406
3406
  value: b,
3407
- validate: (h) => h?.dataType ? void 0 : "You need to specify a repeat field",
3407
+ validate: (f) => f?.dataType ? void 0 : "You need to specify a repeat field",
3408
3408
  children: () => /* @__PURE__ */ n(qe, { className: "p-2 mt-4", children: [
3409
3409
  b && /* @__PURE__ */ e(
3410
3410
  oa,
@@ -3418,7 +3418,7 @@ function Ti({
3418
3418
  }
3419
3419
  ),
3420
3420
  !i && !b && /* @__PURE__ */ n(
3421
- B,
3421
+ U,
3422
3422
  {
3423
3423
  variant: "text",
3424
3424
  size: "large",
@@ -3426,7 +3426,7 @@ function Ti({
3426
3426
  onClick: () => g(!0),
3427
3427
  children: [
3428
3428
  "Edit ",
3429
- `${x ? x.name : "repeat component"}`
3429
+ `${k ? k.name : "repeat component"}`
3430
3430
  ]
3431
3431
  }
3432
3432
  ),
@@ -3434,7 +3434,7 @@ function Ti({
3434
3434
  je,
3435
3435
  {
3436
3436
  inArray: !0,
3437
- open: f,
3437
+ open: y,
3438
3438
  existingProperty: a,
3439
3439
  getData: r,
3440
3440
  autoUpdateId: !a,
@@ -3443,7 +3443,7 @@ function Ti({
3443
3443
  allowDataInference: s,
3444
3444
  property: b,
3445
3445
  includeIdAndName: !1,
3446
- onPropertyChanged: k,
3446
+ onPropertyChanged: w,
3447
3447
  forceShowErrors: t,
3448
3448
  propertyConfigs: o,
3449
3449
  collectionEditable: l
@@ -3453,10 +3453,10 @@ function Ti({
3453
3453
  }
3454
3454
  )
3455
3455
  ] }),
3456
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(zt, { disabled: i }) }) })
3456
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(At, { disabled: i }) }) })
3457
3457
  ] });
3458
3458
  }
3459
- const Vi = L.forwardRef(
3459
+ const Ii = K.forwardRef(
3460
3460
  function({
3461
3461
  showErrors: a,
3462
3462
  disabledId: i,
@@ -3466,17 +3466,17 @@ const Vi = L.forwardRef(
3466
3466
  }, l) {
3467
3467
  const {
3468
3468
  errors: p
3469
- } = K(), m = "name", u = a && P(p, m), c = "id", d = a && P(p, c), f = "description", g = a && P(p, f);
3469
+ } = Y(), m = "name", u = a && P(p, m), d = "id", c = a && P(p, d), y = "description", g = a && P(p, y);
3470
3470
  return /* @__PURE__ */ n("div", { className: "flex flex-col gap-2 col-span-12", children: [
3471
3471
  /* @__PURE__ */ n("div", { children: [
3472
3472
  /* @__PURE__ */ e(
3473
- be,
3473
+ ye,
3474
3474
  {
3475
3475
  inputRef: l,
3476
3476
  name: m,
3477
- as: H,
3477
+ as: J,
3478
3478
  style: { fontSize: 20 },
3479
- validate: ji,
3479
+ validate: Ei,
3480
3480
  placeholder: "Field name",
3481
3481
  required: !0,
3482
3482
  disabled: s,
@@ -3487,26 +3487,26 @@ const Vi = L.forwardRef(
3487
3487
  ] }),
3488
3488
  /* @__PURE__ */ n("div", { children: [
3489
3489
  /* @__PURE__ */ e(
3490
- be,
3490
+ ye,
3491
3491
  {
3492
- name: c,
3492
+ name: d,
3493
3493
  as: Te,
3494
3494
  label: "ID",
3495
- validate: (b) => Fi(b, r),
3495
+ validate: (b) => ji(b, r),
3496
3496
  disabled: i || s,
3497
3497
  required: !0,
3498
3498
  size: "small",
3499
- error: !!d
3499
+ error: !!c
3500
3500
  }
3501
3501
  ),
3502
- /* @__PURE__ */ e(ie, { error: !!d, children: d })
3502
+ /* @__PURE__ */ e(ie, { error: !!c, children: c })
3503
3503
  ] }),
3504
3504
  /* @__PURE__ */ n("div", { children: [
3505
3505
  /* @__PURE__ */ e(
3506
- be,
3506
+ ye,
3507
3507
  {
3508
- name: f,
3509
- as: H,
3508
+ name: y,
3509
+ as: J,
3510
3510
  label: "Description",
3511
3511
  disabled: s,
3512
3512
  error: !!g
@@ -3516,22 +3516,22 @@ const Vi = L.forwardRef(
3516
3516
  ] })
3517
3517
  ] });
3518
3518
  }
3519
- ), Ii = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
3520
- function Fi(t, a) {
3519
+ ), Fi = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
3520
+ function ji(t, a) {
3521
3521
  let i;
3522
- return t || (i = "You must specify an id for the field"), t && !t.match(Ii) && (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;
3522
+ return t || (i = "You must specify an id for the field"), t && !t.match(Fi) && (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;
3523
3523
  }
3524
- function ji(t) {
3524
+ function Ei(t) {
3525
3525
  let a;
3526
3526
  return t || (a = "You must specify a title for the field"), a;
3527
3527
  }
3528
- function Ei({
3528
+ function Di({
3529
3529
  widgetId: t,
3530
3530
  disabled: a,
3531
3531
  showErrors: i
3532
3532
  }) {
3533
- const { values: r, setFieldValue: s } = K();
3534
- return /* @__PURE__ */ n(M, { children: [
3533
+ const { values: r, setFieldValue: s } = Y();
3534
+ return /* @__PURE__ */ n($, { children: [
3535
3535
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(ze, { children: [
3536
3536
  t === "text_field" && /* @__PURE__ */ e(
3537
3537
  Ue,
@@ -3598,9 +3598,9 @@ function Ei({
3598
3598
  ) })
3599
3599
  ] });
3600
3600
  }
3601
- function Di({ disabled: t }) {
3602
- const { values: a } = K(), i = P(a, "defaultValue");
3603
- return /* @__PURE__ */ n(M, { children: [
3601
+ function Bi({ disabled: t }) {
3602
+ const { values: a } = Y(), i = P(a, "defaultValue");
3603
+ return /* @__PURE__ */ n($, { children: [
3604
3604
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Me, { disabled: t }) }) }),
3605
3605
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3606
3606
  de,
@@ -3615,29 +3615,29 @@ function Di({ disabled: t }) {
3615
3615
  ) })
3616
3616
  ] });
3617
3617
  }
3618
- function Bi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r, collectionEditable: s }) {
3618
+ function Mi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r, collectionEditable: s }) {
3619
3619
  const {
3620
3620
  values: o,
3621
3621
  setFieldValue: l
3622
- } = K(), [p, m] = $(!1), [u, c] = $(), [d, f] = $(), g = X(({
3623
- id: _,
3624
- property: y
3622
+ } = Y(), [p, m] = L(!1), [u, d] = L(), [c, y] = L(), g = Z(({
3623
+ id: v,
3624
+ property: _
3625
3625
  }) => {
3626
- if (!_)
3626
+ if (!v)
3627
3627
  throw Error();
3628
3628
  l("oneOf.properties", {
3629
3629
  ...o.oneOf?.properties ?? {},
3630
- [_]: y
3631
- }, !1), l("oneOf.propertiesOrder", [...o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), _], !1), m(!1);
3632
- }, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), b = u ? ce(u, d) : void 0, O = b ? P(o.oneOf?.properties, b.replaceAll(".", ".properties.")) : void 0, k = X((_, y) => {
3633
- const w = _ ? ce(_, y) : void 0;
3634
- if (!w)
3630
+ [v]: _
3631
+ }, !1), l("oneOf.propertiesOrder", [...o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), v], !1), m(!1);
3632
+ }, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), b = u ? ce(u, c) : void 0, O = b ? P(o.oneOf?.properties, b.replaceAll(".", ".properties.")) : void 0, w = Z((v, _) => {
3633
+ const h = v ? ce(v, _) : void 0;
3634
+ if (!h)
3635
3635
  throw Error("collection editor miss config");
3636
- l(`oneOf.${_e(w)}`, void 0, !1);
3637
- const q = `oneOf.${Ne(y)}`, F = P(o, q);
3638
- l(q, F.filter((A) => A !== _), !1), m(!1), c(void 0), f(void 0);
3639
- }, [l, o]), x = /* @__PURE__ */ n(
3640
- B,
3636
+ l(`oneOf.${ke(h)}`, void 0, !1);
3637
+ const A = `oneOf.${Pe(_)}`, E = P(o, A);
3638
+ l(A, E.filter((z) => z !== v), !1), m(!1), d(void 0), y(void 0);
3639
+ }, [l, o]), k = /* @__PURE__ */ n(
3640
+ U,
3641
3641
  {
3642
3642
  autoFocus: !0,
3643
3643
  color: "primary",
@@ -3648,14 +3648,14 @@ function Bi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3648
3648
  o.name ?? "this block"
3649
3649
  ]
3650
3650
  }
3651
- ), h = X((_, y) => {
3652
- l(`oneOf.${Ne(y)}`, _, !1);
3651
+ ), f = Z((v, _) => {
3652
+ l(`oneOf.${Pe(_)}`, v, !1);
3653
3653
  }, []);
3654
- return /* @__PURE__ */ n(M, { children: [
3654
+ return /* @__PURE__ */ n($, { children: [
3655
3655
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3656
3656
  /* @__PURE__ */ n("div", { className: "flex justify-between items-end mt-8 mb-4", children: [
3657
3657
  /* @__PURE__ */ e(C, { variant: "subtitle2", children: "Properties in this block" }),
3658
- x
3658
+ k
3659
3659
  ] }),
3660
3660
  /* @__PURE__ */ n(qe, { className: "p-2 pl-8", children: [
3661
3661
  /* @__PURE__ */ e(
@@ -3665,10 +3665,10 @@ function Bi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3665
3665
  propertiesOrder: o.oneOf?.propertiesOrder,
3666
3666
  errors: {},
3667
3667
  collectionEditable: s,
3668
- onPropertyClick: t ? void 0 : (_, y) => {
3669
- c(_), f(y), m(!0);
3668
+ onPropertyClick: t ? void 0 : (v, _) => {
3669
+ d(v), y(_), m(!0);
3670
3670
  },
3671
- onPropertyMove: t ? void 0 : h
3671
+ onPropertyMove: t ? void 0 : f
3672
3672
  }
3673
3673
  ),
3674
3674
  !t && !o.oneOf?.propertiesOrder?.length && /* @__PURE__ */ e("div", { className: "h-full flex items-center justify-center p-4", children: "Add the first property to this block" })
@@ -3683,15 +3683,15 @@ function Bi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3683
3683
  getData: a,
3684
3684
  allowDataInference: i,
3685
3685
  onCancel: () => {
3686
- m(!1), c(void 0), f(void 0);
3686
+ m(!1), d(void 0), y(void 0);
3687
3687
  },
3688
3688
  onOkClicked: () => {
3689
- m(!1), c(void 0), f(void 0);
3689
+ m(!1), d(void 0), y(void 0);
3690
3690
  },
3691
3691
  collectionEditable: s,
3692
- onDelete: k,
3692
+ onDelete: w,
3693
3693
  propertyKey: u,
3694
- propertyNamespace: d,
3694
+ propertyNamespace: c,
3695
3695
  property: O,
3696
3696
  existingProperty: !!u,
3697
3697
  autoUpdateId: !u,
@@ -3703,15 +3703,15 @@ function Bi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3703
3703
  )
3704
3704
  ] });
3705
3705
  }
3706
- function Mi({ disabled: t }) {
3706
+ function Ri({ disabled: t }) {
3707
3707
  const {
3708
3708
  values: a,
3709
3709
  handleChange: i
3710
- } = K(), r = "validation.min", s = "validation.max", o = "validation.lessThan", l = "validation.moreThan", p = "validation.positive", m = "validation.negative", u = "validation.integer";
3710
+ } = Y(), r = "validation.min", s = "validation.max", o = "validation.lessThan", l = "validation.moreThan", p = "validation.positive", m = "validation.negative", u = "validation.integer";
3711
3711
  return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
3712
3712
  /* @__PURE__ */ e(Me, { disabled: t }),
3713
3713
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3714
- H,
3714
+ J,
3715
3715
  {
3716
3716
  value: P(a, r),
3717
3717
  label: "Min value",
@@ -3723,7 +3723,7 @@ function Mi({ disabled: t }) {
3723
3723
  }
3724
3724
  ) }),
3725
3725
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3726
- H,
3726
+ J,
3727
3727
  {
3728
3728
  value: P(a, s),
3729
3729
  label: "Max value",
@@ -3735,7 +3735,7 @@ function Mi({ disabled: t }) {
3735
3735
  }
3736
3736
  ) }),
3737
3737
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3738
- H,
3738
+ J,
3739
3739
  {
3740
3740
  value: P(a, o),
3741
3741
  label: "Less than",
@@ -3747,7 +3747,7 @@ function Mi({ disabled: t }) {
3747
3747
  }
3748
3748
  ) }),
3749
3749
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3750
- H,
3750
+ J,
3751
3751
  {
3752
3752
  value: P(a, l),
3753
3753
  label: "More than",
@@ -3790,10 +3790,10 @@ function Mi({ disabled: t }) {
3790
3790
  ) })
3791
3791
  ] });
3792
3792
  }
3793
- function Ri({ disabled: t }) {
3794
- const { values: a, setFieldValue: i } = K();
3795
- return /* @__PURE__ */ n(M, { children: [
3796
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Mi, { disabled: t }) }) }),
3793
+ function Ui({ disabled: t }) {
3794
+ const { values: a, setFieldValue: i } = Y();
3795
+ return /* @__PURE__ */ n($, { children: [
3796
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Ri, { disabled: t }) }) }),
3797
3797
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3798
3798
  Te,
3799
3799
  {
@@ -3809,7 +3809,7 @@ function Ri({ disabled: t }) {
3809
3809
  ) })
3810
3810
  ] });
3811
3811
  }
3812
- function Ut({
3812
+ function Rt({
3813
3813
  existing: t,
3814
3814
  multiple: a,
3815
3815
  disabled: i,
@@ -3822,31 +3822,31 @@ function Ut({
3822
3822
  touched: p,
3823
3823
  setFieldError: m,
3824
3824
  setFieldValue: u
3825
- } = K();
3825
+ } = Y();
3826
3826
  if (!Be())
3827
3827
  return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(We, {}) });
3828
- const d = a ? "of.path" : "path", f = P(s, d), g = r && P(l, d);
3829
- return console.log("pathError", l, g), /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3830
- be,
3828
+ const c = a ? "of.path" : "path", y = P(s, c), g = r && P(l, c);
3829
+ return console.log("pathError", l, g), /* @__PURE__ */ e($, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3830
+ ye,
3831
3831
  {
3832
3832
  required: !0,
3833
- name: d,
3834
- pathPath: d,
3833
+ name: c,
3834
+ pathPath: c,
3835
3835
  type: "select",
3836
- validate: Ui,
3836
+ validate: $i,
3837
3837
  disabled: t || i,
3838
- value: f,
3838
+ value: y,
3839
3839
  error: g,
3840
3840
  handleChange: o,
3841
- component: $i
3841
+ component: Li
3842
3842
  }
3843
3843
  ) }) });
3844
3844
  }
3845
- function Ui(t) {
3845
+ function $i(t) {
3846
3846
  let a;
3847
3847
  return t || (a = "You must specify a target collection for the field"), a;
3848
3848
  }
3849
- function $i({
3849
+ function Li({
3850
3850
  disabled: t,
3851
3851
  pathPath: a,
3852
3852
  value: i,
@@ -3859,9 +3859,9 @@ function $i({
3859
3859
  if (!l)
3860
3860
  return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(We, {}) });
3861
3861
  const p = l?.collections ?? [], m = Array.from(new Set(
3862
- Object.values(p).map((c) => c.group).filter(Boolean)
3863
- ).values()), u = p.filter((c) => !c.group);
3864
- return /* @__PURE__ */ n(M, { children: [
3862
+ Object.values(p).map((d) => d.group).filter(Boolean)
3863
+ ).values()), u = p.filter((d) => !d.group);
3864
+ return /* @__PURE__ */ n($, { children: [
3865
3865
  /* @__PURE__ */ n(
3866
3866
  Se,
3867
3867
  {
@@ -3872,72 +3872,72 @@ function $i({
3872
3872
  name: a,
3873
3873
  onChange: r,
3874
3874
  label: "Target collection",
3875
- renderValue: (c) => {
3876
- const d = p.find((g) => g.id === c || g.path === c);
3877
- if (!d)
3875
+ renderValue: (d) => {
3876
+ const c = p.find((g) => g.id === d || g.path === d);
3877
+ if (!c)
3878
3878
  return null;
3879
- const f = ct(d);
3879
+ const y = ct(c);
3880
3880
  return /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
3881
- f,
3881
+ y,
3882
3882
  /* @__PURE__ */ e(
3883
3883
  C,
3884
3884
  {
3885
3885
  variant: "subtitle2",
3886
3886
  className: "font-medium ml-4",
3887
- children: d?.name.toUpperCase()
3887
+ children: c?.name.toUpperCase()
3888
3888
  }
3889
3889
  )
3890
3890
  ] });
3891
3891
  },
3892
3892
  ...o,
3893
3893
  children: [
3894
- m.flatMap((c) => /* @__PURE__ */ e(
3895
- It,
3894
+ m.flatMap((d) => /* @__PURE__ */ e(
3895
+ Vt,
3896
3896
  {
3897
- label: c || "Views",
3898
- children: p.filter((d) => d.group === c).map((d) => {
3899
- const f = ct(d);
3897
+ label: d || "Views",
3898
+ children: p.filter((c) => c.group === d).map((c) => {
3899
+ const y = ct(c);
3900
3900
  return /* @__PURE__ */ e(
3901
3901
  ee,
3902
3902
  {
3903
- value: d.id ?? d.path,
3903
+ value: c.id ?? c.path,
3904
3904
  children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
3905
- f,
3905
+ y,
3906
3906
  /* @__PURE__ */ e(
3907
3907
  C,
3908
3908
  {
3909
3909
  variant: "subtitle2",
3910
3910
  className: "font-medium ml-4",
3911
- children: d?.name.toUpperCase()
3911
+ children: c?.name.toUpperCase()
3912
3912
  }
3913
3913
  )
3914
3914
  ] })
3915
3915
  },
3916
- `${d.id ?? d.path}-${c}`
3916
+ `${c.id ?? c.path}-${d}`
3917
3917
  );
3918
3918
  })
3919
3919
  },
3920
- `group_${c}`
3920
+ `group_${d}`
3921
3921
  )),
3922
- u && /* @__PURE__ */ e(It, { label: "Views", children: u.map((c) => {
3923
- const d = ct(c);
3922
+ u && /* @__PURE__ */ e(Vt, { label: "Views", children: u.map((d) => {
3923
+ const c = ct(d);
3924
3924
  return /* @__PURE__ */ e(
3925
3925
  ee,
3926
3926
  {
3927
- value: c.id ?? c.path,
3927
+ value: d.id ?? d.path,
3928
3928
  children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
3929
- d,
3929
+ c,
3930
3930
  /* @__PURE__ */ e(
3931
3931
  C,
3932
3932
  {
3933
3933
  variant: "subtitle2",
3934
3934
  className: "font-medium ml-4",
3935
- children: c?.name.toUpperCase()
3935
+ children: d?.name.toUpperCase()
3936
3936
  }
3937
3937
  )
3938
3938
  ] })
3939
3939
  },
3940
- c.id ?? c.path
3940
+ d.id ?? d.path
3941
3941
  );
3942
3942
  }) })
3943
3943
  ]
@@ -3946,14 +3946,14 @@ function $i({
3946
3946
  /* @__PURE__ */ e(ie, { children: "You can only edit the reference collection upon field creation." })
3947
3947
  ] });
3948
3948
  }
3949
- function Li({ disabled: t }) {
3949
+ function Ki({ disabled: t }) {
3950
3950
  const {
3951
3951
  values: a,
3952
3952
  errors: i,
3953
3953
  touched: r,
3954
3954
  setFieldValue: s
3955
- } = K(), o = "mode", l = P(a, o), p = P(r, o) && P(i, o), m = "autoValue", u = P(a, m), c = P(r, m) && P(i, m);
3956
- return /* @__PURE__ */ n(M, { children: [
3955
+ } = Y(), o = "mode", l = P(a, o), p = P(r, o) && P(i, o), m = "autoValue", u = P(a, m), d = P(r, m) && P(i, m);
3956
+ return /* @__PURE__ */ n($, { children: [
3957
3957
  /* @__PURE__ */ n("div", { className: "flex flex-col col-span-12", children: [
3958
3958
  /* @__PURE__ */ n(
3959
3959
  Se,
@@ -3961,10 +3961,10 @@ function Li({ disabled: t }) {
3961
3961
  name: o,
3962
3962
  value: l ?? "date",
3963
3963
  error: !!p,
3964
- onValueChange: (d) => s(o, d),
3964
+ onValueChange: (c) => s(o, c),
3965
3965
  label: "Mode",
3966
- renderValue: (d) => {
3967
- switch (d) {
3966
+ renderValue: (c) => {
3967
+ switch (c) {
3968
3968
  case "date_time":
3969
3969
  return "Date/Time";
3970
3970
  case "date":
@@ -3987,9 +3987,9 @@ function Li({ disabled: t }) {
3987
3987
  name: m,
3988
3988
  disabled: t,
3989
3989
  value: u ?? "",
3990
- onValueChange: (d) => s(m, d),
3991
- renderValue: (d) => {
3992
- switch (d) {
3990
+ onValueChange: (c) => s(m, c),
3991
+ renderValue: (c) => {
3992
+ switch (c) {
3993
3993
  case "on_create":
3994
3994
  return "On create";
3995
3995
  case "on_update":
@@ -3998,7 +3998,7 @@ function Li({ disabled: t }) {
3998
3998
  return "None";
3999
3999
  }
4000
4000
  },
4001
- error: !!c,
4001
+ error: !!d,
4002
4002
  label: "Automatic value",
4003
4003
  children: [
4004
4004
  /* @__PURE__ */ e(ee, { value: "", children: " None " }),
@@ -4007,13 +4007,13 @@ function Li({ disabled: t }) {
4007
4007
  ]
4008
4008
  }
4009
4009
  ),
4010
- /* @__PURE__ */ e(ie, { error: !!c, children: c ?? "Update this field automatically when creating or updating the entity" })
4010
+ /* @__PURE__ */ e(ie, { error: !!d, children: d ?? "Update this field automatically when creating or updating the entity" })
4011
4011
  ] }),
4012
4012
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Me, { disabled: t }) }) })
4013
4013
  ] });
4014
4014
  }
4015
- function Ki({ disabled: t }) {
4016
- return K(), /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
4015
+ function Yi({ disabled: t }) {
4016
+ return Y(), /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
4017
4017
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
4018
4018
  de,
4019
4019
  {
@@ -4038,12 +4038,12 @@ function Ki({ disabled: t }) {
4038
4038
  ) })
4039
4039
  ] });
4040
4040
  }
4041
- function Yi({ disabled: t }) {
4042
- return /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Me, { disabled: t }) }) }) });
4041
+ function Gi({ disabled: t }) {
4042
+ return /* @__PURE__ */ e($, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Me, { disabled: t }) }) }) });
4043
4043
  }
4044
4044
  function na(t, a, i) {
4045
4045
  let r;
4046
- return a === "text_field" ? r = Y(
4046
+ return a === "text_field" ? r = G(
4047
4047
  t,
4048
4048
  {
4049
4049
  dataType: "string",
@@ -4056,7 +4056,7 @@ function na(t, a, i) {
4056
4056
  url: void 0,
4057
4057
  enumValues: void 0
4058
4058
  }
4059
- ) : a === "multiline" ? r = Y(
4059
+ ) : a === "multiline" ? r = G(
4060
4060
  t,
4061
4061
  {
4062
4062
  dataType: "string",
@@ -4069,7 +4069,7 @@ function na(t, a, i) {
4069
4069
  url: void 0,
4070
4070
  enumValues: void 0
4071
4071
  }
4072
- ) : a === "markdown" ? r = Y(
4072
+ ) : a === "markdown" ? r = G(
4073
4073
  t,
4074
4074
  {
4075
4075
  dataType: "string",
@@ -4081,7 +4081,7 @@ function na(t, a, i) {
4081
4081
  email: void 0,
4082
4082
  url: void 0
4083
4083
  }
4084
- ) : a === "url" ? r = Y(
4084
+ ) : a === "url" ? r = G(
4085
4085
  t,
4086
4086
  {
4087
4087
  dataType: "string",
@@ -4094,7 +4094,7 @@ function na(t, a, i) {
4094
4094
  url: !0,
4095
4095
  enumValues: void 0
4096
4096
  }
4097
- ) : a === "email" ? r = Y(
4097
+ ) : a === "email" ? r = G(
4098
4098
  t,
4099
4099
  {
4100
4100
  dataType: "string",
@@ -4107,7 +4107,7 @@ function na(t, a, i) {
4107
4107
  url: void 0,
4108
4108
  enumValues: void 0
4109
4109
  }
4110
- ) : a === "select" ? r = Y(
4110
+ ) : a === "select" ? r = G(
4111
4111
  t,
4112
4112
  {
4113
4113
  dataType: "string",
@@ -4120,7 +4120,7 @@ function na(t, a, i) {
4120
4120
  url: void 0,
4121
4121
  enumValues: t.enumValues ?? []
4122
4122
  }
4123
- ) : a === "multi_select" ? r = Y(
4123
+ ) : a === "multi_select" ? r = G(
4124
4124
  t,
4125
4125
  {
4126
4126
  dataType: "array",
@@ -4131,7 +4131,7 @@ function na(t, a, i) {
4131
4131
  enumValues: t.of?.enumValues ?? []
4132
4132
  }
4133
4133
  }
4134
- ) : a === "number_input" ? r = Y(
4134
+ ) : a === "number_input" ? r = G(
4135
4135
  t,
4136
4136
  {
4137
4137
  dataType: "number",
@@ -4139,7 +4139,7 @@ function na(t, a, i) {
4139
4139
  editable: t.editable !== void 0 ? t.editable : !0,
4140
4140
  enumValues: void 0
4141
4141
  }
4142
- ) : a === "number_select" ? r = Y(
4142
+ ) : a === "number_select" ? r = G(
4143
4143
  t,
4144
4144
  {
4145
4145
  dataType: "number",
@@ -4147,7 +4147,7 @@ function na(t, a, i) {
4147
4147
  editable: t.editable !== void 0 ? t.editable : !0,
4148
4148
  enumValues: t.enumValues ?? []
4149
4149
  }
4150
- ) : a === "multi_number_select" ? r = Y(
4150
+ ) : a === "multi_number_select" ? r = G(
4151
4151
  t,
4152
4152
  {
4153
4153
  dataType: "array",
@@ -4158,7 +4158,7 @@ function na(t, a, i) {
4158
4158
  enumValues: t.of?.enumValues ?? []
4159
4159
  }
4160
4160
  }
4161
- ) : a === "file_upload" ? r = Y(
4161
+ ) : a === "file_upload" ? r = G(
4162
4162
  t,
4163
4163
  {
4164
4164
  dataType: "string",
@@ -4168,7 +4168,7 @@ function na(t, a, i) {
4168
4168
  storagePath: "/"
4169
4169
  }
4170
4170
  }
4171
- ) : a === "multi_file_upload" ? r = Y(
4171
+ ) : a === "multi_file_upload" ? r = G(
4172
4172
  t,
4173
4173
  {
4174
4174
  dataType: "array",
@@ -4181,7 +4181,7 @@ function na(t, a, i) {
4181
4181
  }
4182
4182
  }
4183
4183
  }
4184
- ) : a === "group" ? r = Y(
4184
+ ) : a === "group" ? r = G(
4185
4185
  t,
4186
4186
  {
4187
4187
  dataType: "map",
@@ -4190,7 +4190,7 @@ function na(t, a, i) {
4190
4190
  keyValue: !1,
4191
4191
  properties: t.properties ?? {}
4192
4192
  }
4193
- ) : a === "key_value" ? r = Y(
4193
+ ) : a === "key_value" ? r = G(
4194
4194
  t,
4195
4195
  {
4196
4196
  dataType: "map",
@@ -4199,14 +4199,14 @@ function na(t, a, i) {
4199
4199
  keyValue: !0,
4200
4200
  properties: void 0
4201
4201
  }
4202
- ) : a === "reference" ? r = Y(
4202
+ ) : a === "reference" ? r = G(
4203
4203
  t,
4204
4204
  {
4205
4205
  dataType: "reference",
4206
4206
  propertyConfig: "reference",
4207
4207
  editable: t.editable !== void 0 ? t.editable : !0
4208
4208
  }
4209
- ) : a === "multi_references" ? r = Y(
4209
+ ) : a === "multi_references" ? r = G(
4210
4210
  t,
4211
4211
  {
4212
4212
  dataType: "array",
@@ -4216,14 +4216,14 @@ function na(t, a, i) {
4216
4216
  dataType: "reference"
4217
4217
  }
4218
4218
  }
4219
- ) : a === "switch" ? r = Y(
4219
+ ) : a === "switch" ? r = G(
4220
4220
  t,
4221
4221
  {
4222
4222
  dataType: "boolean",
4223
4223
  propertyConfig: "switch",
4224
4224
  editable: t.editable !== void 0 ? t.editable : !0
4225
4225
  }
4226
- ) : a === "date_time" ? r = Y(
4226
+ ) : a === "date_time" ? r = G(
4227
4227
  t,
4228
4228
  {
4229
4229
  dataType: "date",
@@ -4231,14 +4231,14 @@ function na(t, a, i) {
4231
4231
  editable: t.editable !== void 0 ? t.editable : !0,
4232
4232
  mode: "date_time"
4233
4233
  }
4234
- ) : a === "repeat" ? r = Y(
4234
+ ) : a === "repeat" ? r = G(
4235
4235
  t,
4236
4236
  {
4237
4237
  dataType: "array",
4238
4238
  propertyConfig: "repeat",
4239
4239
  editable: t.editable !== void 0 ? t.editable : !0
4240
4240
  }
4241
- ) : a === "block" ? r = Y(
4241
+ ) : a === "block" ? r = G(
4242
4242
  t,
4243
4243
  {
4244
4244
  dataType: "array",
@@ -4263,7 +4263,7 @@ function sa({ value: t, optionDisabled: a, propertyConfig: i, existing: r }) {
4263
4263
  children: /* @__PURE__ */ n(
4264
4264
  "div",
4265
4265
  {
4266
- className: ke(
4266
+ className: xe(
4267
4267
  "flex flex-row items-center text-base min-h-[52px]",
4268
4268
  a ? "w-full" : ""
4269
4269
  ),
@@ -4287,12 +4287,12 @@ function sa({ value: t, optionDisabled: a, propertyConfig: i, existing: r }) {
4287
4287
  }
4288
4288
  );
4289
4289
  }
4290
- function Gi({
4290
+ function Hi({
4291
4291
  disabled: t,
4292
4292
  showErrors: a
4293
4293
  }) {
4294
- const { values: i, setFieldValue: r } = K(), s = P(i, "url");
4295
- return /* @__PURE__ */ n(M, { children: [
4294
+ const { values: i, setFieldValue: r } = Y(), s = P(i, "url");
4295
+ return /* @__PURE__ */ n($, { children: [
4296
4296
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
4297
4297
  Se,
4298
4298
  {
@@ -4347,7 +4347,28 @@ function Gi({
4347
4347
  ) })
4348
4348
  ] });
4349
4349
  }
4350
- const la = L.memo(
4350
+ const Ji = [
4351
+ "text_field",
4352
+ "multiline",
4353
+ "markdown",
4354
+ "url",
4355
+ "email",
4356
+ "select",
4357
+ "multi_select",
4358
+ "number_input",
4359
+ "number_select",
4360
+ "multi_number_select",
4361
+ "file_upload",
4362
+ "multi_file_upload",
4363
+ "reference",
4364
+ "multi_references",
4365
+ "switch",
4366
+ "date_time",
4367
+ "group",
4368
+ "key_value",
4369
+ "repeat",
4370
+ "block"
4371
+ ], la = Object.entries(Zt).filter(([t]) => Ji.includes(t)).map(([t, a]) => ({ [t]: a })).reduce((t, a) => ({ ...t, ...a }), {}), ca = K.memo(
4351
4372
  function({
4352
4373
  includeIdAndName: a = !0,
4353
4374
  autoOpenTypeSelect: i,
@@ -4358,75 +4379,75 @@ const la = L.memo(
4358
4379
  propertyNamespace: p,
4359
4380
  property: m,
4360
4381
  onPropertyChanged: u,
4361
- onPropertyChangedImmediate: c = !0,
4362
- onDelete: d,
4363
- onError: f,
4382
+ onPropertyChangedImmediate: d = !0,
4383
+ onDelete: c,
4384
+ onError: y,
4364
4385
  initialErrors: g,
4365
4386
  forceShowErrors: b,
4366
4387
  existingPropertyKeys: O,
4367
- allowDataInference: k,
4368
- getHelpers: x,
4369
- getData: h,
4370
- propertyConfigs: _,
4371
- collectionEditable: y
4388
+ allowDataInference: w,
4389
+ getHelpers: k,
4390
+ getData: f,
4391
+ propertyConfigs: v,
4392
+ collectionEditable: _
4372
4393
  }) {
4373
- const w = {
4394
+ const h = {
4374
4395
  id: "",
4375
4396
  name: ""
4376
- }, q = !!(m && !Je(m)) && !y, F = He(m ? {
4397
+ }, A = !!(m && !Je(m)) && !_, E = He(m ? {
4377
4398
  id: l,
4378
4399
  previousId: l,
4379
4400
  property: m
4380
- } : void 0), A = ({
4381
- id: S,
4382
- property: E
4401
+ } : void 0), z = ({
4402
+ id: q,
4403
+ property: B
4383
4404
  }) => {
4384
- const v = {
4385
- id: S,
4386
- previousId: F.current?.id,
4387
- property: E,
4405
+ const S = {
4406
+ id: q,
4407
+ previousId: E.current?.id,
4408
+ property: B,
4388
4409
  namespace: p
4389
4410
  };
4390
- F.current = v, u?.(v);
4411
+ E.current = S, u?.(S);
4391
4412
  };
4392
4413
  return /* @__PURE__ */ e(
4393
- qt,
4414
+ St,
4394
4415
  {
4395
4416
  initialErrors: g,
4396
- initialValues: m ? { id: l, ...m } : w,
4397
- onSubmit: (S, E) => {
4398
- console.log("Submitting property", S);
4417
+ initialValues: m ? { id: l, ...m } : h,
4418
+ onSubmit: (q, B) => {
4419
+ console.log("Submitting property", q);
4399
4420
  const {
4400
- id: v,
4401
- ...V
4402
- } = S;
4403
- A({
4404
- id: v,
4405
- property: { ...V, editable: V.editable ?? !0 }
4406
- }), r || E.resetForm({ values: w });
4421
+ id: S,
4422
+ ...N
4423
+ } = q;
4424
+ z({
4425
+ id: S,
4426
+ property: { ...N, editable: N.editable ?? !0 }
4427
+ }), r || B.resetForm({ values: h });
4407
4428
  },
4408
- children: (S) => (pe(() => {
4409
- x?.(S);
4410
- }, [S]), /* @__PURE__ */ e(
4411
- Hi,
4429
+ children: (q) => (pe(() => {
4430
+ k?.(q);
4431
+ }, [q]), /* @__PURE__ */ e(
4432
+ Qi,
4412
4433
  {
4413
- onPropertyChanged: c ? A : void 0,
4414
- onDelete: d,
4434
+ onPropertyChanged: d ? z : void 0,
4435
+ onDelete: c,
4415
4436
  includeIdAndTitle: a,
4416
4437
  propertyNamespace: p,
4417
- onError: f,
4418
- showErrors: b || S.submitCount > 0,
4438
+ onError: y,
4439
+ showErrors: b || q.submitCount > 0,
4419
4440
  existing: r,
4420
4441
  autoUpdateId: s,
4421
4442
  inArray: o,
4422
4443
  autoOpenTypeSelect: i,
4423
4444
  existingPropertyKeys: O,
4424
- disabled: q,
4425
- getData: h,
4426
- allowDataInference: k,
4427
- propertyConfigs: _,
4428
- collectionEditable: y,
4429
- ...S
4445
+ disabled: A,
4446
+ getData: f,
4447
+ allowDataInference: w,
4448
+ propertyConfigs: v,
4449
+ collectionEditable: _,
4450
+ ...q
4430
4451
  }
4431
4452
  ))
4432
4453
  },
@@ -4453,7 +4474,7 @@ function je({
4453
4474
  fullWidth: !0,
4454
4475
  children: [
4455
4476
  /* @__PURE__ */ e($e, { children: /* @__PURE__ */ e(
4456
- la,
4477
+ ca,
4457
4478
  {
4458
4479
  ...l,
4459
4480
  onPropertyChanged: (u) => {
@@ -4469,7 +4490,7 @@ function je({
4469
4490
  ) }),
4470
4491
  /* @__PURE__ */ n(Le, { children: [
4471
4492
  a && /* @__PURE__ */ e(
4472
- B,
4493
+ U,
4473
4494
  {
4474
4495
  variant: "text",
4475
4496
  onClick: () => {
@@ -4479,7 +4500,7 @@ function je({
4479
4500
  }
4480
4501
  ),
4481
4502
  /* @__PURE__ */ e(
4482
- B,
4503
+ U,
4483
4504
  {
4484
4505
  variant: "outlined",
4485
4506
  color: "primary",
@@ -4492,7 +4513,7 @@ function je({
4492
4513
  }
4493
4514
  );
4494
4515
  }
4495
- function Hi({
4516
+ function Qi({
4496
4517
  values: t,
4497
4518
  errors: a,
4498
4519
  touched: i,
@@ -4503,135 +4524,135 @@ function Hi({
4503
4524
  autoOpenTypeSelect: p,
4504
4525
  includeIdAndTitle: m,
4505
4526
  onPropertyChanged: u,
4506
- onDelete: c,
4507
- propertyNamespace: d,
4508
- onError: f,
4527
+ onDelete: d,
4528
+ propertyNamespace: c,
4529
+ onError: y,
4509
4530
  showErrors: g,
4510
4531
  disabled: b,
4511
4532
  inArray: O,
4512
- existingPropertyKeys: k,
4513
- getData: x,
4514
- allowDataInference: h,
4515
- propertyConfigs: _,
4516
- collectionEditable: y
4533
+ existingPropertyKeys: w,
4534
+ getData: k,
4535
+ allowDataInference: f,
4536
+ propertyConfigs: v,
4537
+ collectionEditable: _
4517
4538
  }) {
4518
- const [w, q] = $(p), [F, A] = $(!1), [S, E] = $(t?.dataType ? Xt(t) : void 0), v = Object.entries(Ot).concat(Object.entries(_)), V = O ? v.filter(([W, te]) => !oe(te.property) && te.property?.dataType !== "array") : v, J = fa(t), N = He(null), R = He(t), ge = "id", xe = g && P(a, "selectedWidget");
4539
+ const [h, A] = L(p), [E, z] = L(!1), [q, B] = L(t?.dataType ? Xt(t) : void 0), S = Object.entries(la).concat(Object.entries(v)), N = O ? S.filter(([Q, te]) => !oe(te.property) && te.property?.dataType !== "array") : S, j = ba(t), x = He(null), I = He(t), ge = "id", fe = g && P(a, "selectedWidget");
4519
4540
  pe(() => {
4520
4541
  !P(i, ge) && l && t?.name && s(ge, Ct(t.name));
4521
4542
  }, [l, i, t?.name]), pe(() => {
4522
- if (u && (!m || J.id)) {
4543
+ if (u && (!m || j.id)) {
4523
4544
  const {
4524
- id: W,
4545
+ id: Q,
4525
4546
  ...te
4526
- } = J;
4527
- ut(J, R.current) || (u({
4528
- id: W,
4547
+ } = j;
4548
+ ut(j, I.current) || (u({
4549
+ id: Q,
4529
4550
  property: te,
4530
- namespace: d
4531
- }), R.current = J);
4551
+ namespace: c
4552
+ }), I.current = j);
4532
4553
  }
4533
- }, [J, m, u, d]), pe(() => {
4534
- t?.id && f && Object.keys(a).length > 0 && f(t?.id, d, a);
4535
- }, [a, f, d, t?.id]);
4536
- const Q = (W) => {
4537
- E(W), r(na(t, W, _)), setTimeout(() => {
4538
- N.current?.focus();
4554
+ }, [j, m, u, c]), pe(() => {
4555
+ t?.id && y && Object.keys(a).length > 0 && y(t?.id, c, a);
4556
+ }, [a, y, c, t?.id]);
4557
+ const X = (Q) => {
4558
+ B(Q), r(na(t, Q, v)), setTimeout(() => {
4559
+ x.current?.focus();
4539
4560
  }, 0);
4540
4561
  };
4541
- let U;
4542
- return S === "text_field" || S === "multiline" || S === "markdown" || S === "email" ? U = /* @__PURE__ */ e(
4543
- Ei,
4562
+ let M;
4563
+ return q === "text_field" || q === "multiline" || q === "markdown" || q === "email" ? M = /* @__PURE__ */ e(
4564
+ Di,
4544
4565
  {
4545
- widgetId: S,
4566
+ widgetId: q,
4546
4567
  disabled: b,
4547
4568
  showErrors: g
4548
4569
  }
4549
- ) : S === "url" ? U = /* @__PURE__ */ e(
4550
- Gi,
4570
+ ) : q === "url" ? M = /* @__PURE__ */ e(
4571
+ Hi,
4551
4572
  {
4552
4573
  disabled: b,
4553
4574
  showErrors: g
4554
4575
  }
4555
- ) : S === "select" || S === "number_select" ? U = /* @__PURE__ */ e(
4556
- Mt,
4576
+ ) : q === "select" || q === "number_select" ? M = /* @__PURE__ */ e(
4577
+ Bt,
4557
4578
  {
4558
4579
  multiselect: !1,
4559
- allowDataInference: h,
4580
+ allowDataInference: f,
4560
4581
  updateIds: !o,
4561
4582
  disabled: b,
4562
- getData: x,
4583
+ getData: k,
4563
4584
  showErrors: g
4564
4585
  }
4565
- ) : S === "multi_select" || S === "multi_number_select" ? U = /* @__PURE__ */ e(
4566
- Mt,
4586
+ ) : q === "multi_select" || q === "multi_number_select" ? M = /* @__PURE__ */ e(
4587
+ Bt,
4567
4588
  {
4568
4589
  multiselect: !0,
4569
4590
  updateIds: !o,
4570
4591
  disabled: b,
4571
- allowDataInference: h,
4572
- getData: x,
4592
+ allowDataInference: f,
4593
+ getData: k,
4573
4594
  showErrors: g
4574
4595
  }
4575
- ) : S === "file_upload" ? U = /* @__PURE__ */ e(
4576
- Rt,
4596
+ ) : q === "file_upload" ? M = /* @__PURE__ */ e(
4597
+ Mt,
4577
4598
  {
4578
4599
  existing: o,
4579
4600
  multiple: !1,
4580
4601
  disabled: b
4581
4602
  }
4582
- ) : S === "multi_file_upload" ? U = /* @__PURE__ */ e(
4583
- Rt,
4603
+ ) : q === "multi_file_upload" ? M = /* @__PURE__ */ e(
4604
+ Mt,
4584
4605
  {
4585
4606
  existing: o,
4586
4607
  multiple: !0,
4587
4608
  disabled: b
4588
4609
  }
4589
- ) : S === "switch" ? U = /* @__PURE__ */ e(Di, { disabled: b }) : S === "number_input" ? U = /* @__PURE__ */ e(Ri, { disabled: b }) : S === "group" ? U = /* @__PURE__ */ e(
4590
- zi,
4610
+ ) : q === "switch" ? M = /* @__PURE__ */ e(Bi, { disabled: b }) : q === "number_input" ? M = /* @__PURE__ */ e(Ui, { disabled: b }) : q === "group" ? M = /* @__PURE__ */ e(
4611
+ Ti,
4591
4612
  {
4592
4613
  disabled: b,
4593
- getData: x,
4594
- allowDataInference: h,
4595
- collectionEditable: y,
4596
- propertyConfigs: _
4614
+ getData: k,
4615
+ allowDataInference: f,
4616
+ collectionEditable: _,
4617
+ propertyConfigs: v
4597
4618
  }
4598
- ) : S === "block" ? U = /* @__PURE__ */ e(
4599
- Bi,
4619
+ ) : q === "block" ? M = /* @__PURE__ */ e(
4620
+ Mi,
4600
4621
  {
4601
4622
  disabled: b,
4602
- getData: x,
4603
- allowDataInference: h,
4604
- collectionEditable: y,
4605
- propertyConfigs: _
4623
+ getData: k,
4624
+ allowDataInference: f,
4625
+ collectionEditable: _,
4626
+ propertyConfigs: v
4606
4627
  }
4607
- ) : S === "reference" ? U = /* @__PURE__ */ e(
4608
- Ut,
4628
+ ) : q === "reference" ? M = /* @__PURE__ */ e(
4629
+ Rt,
4609
4630
  {
4610
4631
  showErrors: g,
4611
4632
  existing: o,
4612
4633
  multiple: !1,
4613
4634
  disabled: b
4614
4635
  }
4615
- ) : S === "date_time" ? U = /* @__PURE__ */ e(Li, { disabled: b }) : S === "multi_references" ? U = /* @__PURE__ */ e(
4616
- Ut,
4636
+ ) : q === "date_time" ? M = /* @__PURE__ */ e(Ki, { disabled: b }) : q === "multi_references" ? M = /* @__PURE__ */ e(
4637
+ Rt,
4617
4638
  {
4618
4639
  showErrors: g,
4619
4640
  existing: o,
4620
4641
  multiple: !0,
4621
4642
  disabled: b
4622
4643
  }
4623
- ) : S === "repeat" ? U = /* @__PURE__ */ e(
4624
- Ti,
4644
+ ) : q === "repeat" ? M = /* @__PURE__ */ e(
4645
+ Vi,
4625
4646
  {
4626
4647
  showErrors: g,
4627
4648
  existing: o,
4628
- getData: x,
4629
- allowDataInference: h,
4649
+ getData: k,
4650
+ allowDataInference: f,
4630
4651
  disabled: b,
4631
- collectionEditable: y,
4632
- propertyConfigs: _
4652
+ collectionEditable: _,
4653
+ propertyConfigs: v
4633
4654
  }
4634
- ) : S === "key_value" ? U = /* @__PURE__ */ e(Yi, { disabled: b }) : U = null, /* @__PURE__ */ n(M, { children: [
4655
+ ) : q === "key_value" ? M = /* @__PURE__ */ e(Gi, { disabled: b }) : M = null, /* @__PURE__ */ n($, { children: [
4635
4656
  b && /* @__PURE__ */ n(ea, { mode: "warn", children: [
4636
4657
  /* @__PURE__ */ e(C, { children: "This property can't be edited" }),
4637
4658
  /* @__PURE__ */ n(C, { variant: "caption", children: [
@@ -4645,26 +4666,26 @@ function Hi({
4645
4666
  /* @__PURE__ */ e(
4646
4667
  Se,
4647
4668
  {
4648
- error: !!xe,
4649
- value: S ?? "",
4669
+ error: !!fe,
4670
+ value: q ?? "",
4650
4671
  placeholder: "Select a property widget",
4651
- open: w,
4652
- onOpenChange: q,
4672
+ open: h,
4673
+ onOpenChange: A,
4653
4674
  position: "item-aligned",
4654
4675
  disabled: b,
4655
- renderValue: (W) => {
4656
- if (!W)
4676
+ renderValue: (Q) => {
4677
+ if (!Q)
4657
4678
  return /* @__PURE__ */ e("em", { children: "Select a property widget" });
4658
- const te = W, me = Ot[te] ?? _[te], ue = me.property, fe = ue && !oe(ue) ? Ze(ue, _) : void 0, ye = oe(ue) || o && ue.dataType !== t?.dataType, Ce = fe ? Y(fe, me) : me;
4679
+ const te = Q, me = Zt[te] ?? v[te], ue = me.property, be = ue && !oe(ue) ? Ze(ue, v) : void 0, ve = oe(ue) || o && ue.dataType !== t?.dataType, Ce = be ? G(be, me) : me;
4659
4680
  return /* @__PURE__ */ n(
4660
4681
  "div",
4661
4682
  {
4662
4683
  onClick: (ae) => {
4663
- ye && (ae.stopPropagation(), ae.preventDefault());
4684
+ ve && (ae.stopPropagation(), ae.preventDefault());
4664
4685
  },
4665
- className: ke(
4686
+ className: xe(
4666
4687
  "flex items-center",
4667
- ye ? "w-full pointer-events-none opacity-50" : ""
4688
+ ve ? "w-full pointer-events-none opacity-50" : ""
4668
4689
  ),
4669
4690
  children: [
4670
4691
  /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Xe, { propertyConfig: Ce }) }),
@@ -4675,7 +4696,7 @@ function Hi({
4675
4696
  {
4676
4697
  variant: "caption",
4677
4698
  color: "disabled",
4678
- children: ye ? "You can only switch to widgets that use the same data type" : Ce.description
4699
+ children: ve ? "You can only switch to widgets that use the same data type" : Ce.description
4679
4700
  }
4680
4701
  )
4681
4702
  ] })
@@ -4683,25 +4704,25 @@ function Hi({
4683
4704
  }
4684
4705
  );
4685
4706
  },
4686
- onValueChange: (W) => {
4687
- Q(W);
4707
+ onValueChange: (Q) => {
4708
+ X(Q);
4688
4709
  },
4689
- children: V.map(([W, te]) => {
4710
+ children: N.map(([Q, te]) => {
4690
4711
  const me = te.property, ue = o && !oe(me) && me.dataType !== t?.dataType;
4691
4712
  return /* @__PURE__ */ e(
4692
4713
  sa,
4693
4714
  {
4694
- value: W,
4715
+ value: Q,
4695
4716
  optionDisabled: ue,
4696
4717
  propertyConfig: te,
4697
4718
  existing: o
4698
4719
  },
4699
- W
4720
+ Q
4700
4721
  );
4701
4722
  })
4702
4723
  }
4703
4724
  ),
4704
- xe && /* @__PURE__ */ e(
4725
+ fe && /* @__PURE__ */ e(
4705
4726
  C,
4706
4727
  {
4707
4728
  variant: "caption",
@@ -4711,38 +4732,38 @@ function Hi({
4711
4732
  }
4712
4733
  )
4713
4734
  ] }),
4714
- c && t?.id && /* @__PURE__ */ e(
4735
+ d && t?.id && /* @__PURE__ */ e(
4715
4736
  ne,
4716
4737
  {
4717
4738
  variant: "ghost",
4718
4739
  className: "m-4",
4719
4740
  disabled: b,
4720
- onClick: () => A(!0),
4741
+ onClick: () => z(!0),
4721
4742
  children: /* @__PURE__ */ e(pt, {})
4722
4743
  }
4723
4744
  )
4724
4745
  ] }),
4725
4746
  /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-y-12 mt-8 mb-8", children: [
4726
4747
  m && /* @__PURE__ */ e(
4727
- Vi,
4748
+ Ii,
4728
4749
  {
4729
4750
  showErrors: g,
4730
4751
  disabledId: o,
4731
4752
  isNewProperty: !o,
4732
- existingPropertyKeys: k,
4753
+ existingPropertyKeys: w,
4733
4754
  disabled: b,
4734
- ref: N
4755
+ ref: x
4735
4756
  }
4736
4757
  ),
4737
- U,
4738
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ki, { disabled: b }) })
4758
+ M,
4759
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Yi, { disabled: b }) })
4739
4760
  ] }),
4740
- c && /* @__PURE__ */ e(
4761
+ d && /* @__PURE__ */ e(
4741
4762
  mt,
4742
4763
  {
4743
- open: F,
4744
- onAccept: () => c(t?.id, d),
4745
- onCancel: () => A(!1),
4764
+ open: E,
4765
+ onAccept: () => d(t?.id, c),
4766
+ onCancel: () => z(!1),
4746
4767
  title: /* @__PURE__ */ e("div", { children: "Delete this property?" }),
4747
4768
  body: /* @__PURE__ */ n("div", { children: [
4748
4769
  " This will ",
@@ -4753,13 +4774,13 @@ function Hi({
4753
4774
  )
4754
4775
  ] });
4755
4776
  }
4756
- function Ji(t) {
4777
+ function Wi(t) {
4757
4778
  return (t.slice(0, 1).toLowerCase() + t.slice(1)).replace(/([-_ ]){1,}/g, " ").split(/[-_ ]/).reduce((a, i) => a + i[0].toUpperCase() + i.substring(1));
4758
4779
  }
4759
- function Qi({ collection: t, onOpenChange: a, open: i }) {
4780
+ function Zi({ collection: t, onOpenChange: a, open: i }) {
4760
4781
  const r = De(), s = `import { EntityCollection } from "firecms";
4761
4782
 
4762
- const ` + Ji(t.name) + "Collection:EntityCollection = " + ni.stringify(ca(t), null, " ");
4783
+ const ` + Wi(t.name) + "Collection:EntityCollection = " + si.stringify(da(t), null, " ");
4763
4784
  return /* @__PURE__ */ n(
4764
4785
  Ee,
4765
4786
  {
@@ -4785,18 +4806,18 @@ const ` + Ji(t.name) + "Collection:EntityCollection = " + ni.stringify(ca(t), nu
4785
4806
  "."
4786
4807
  ] }),
4787
4808
  /* @__PURE__ */ e(
4788
- si,
4809
+ li,
4789
4810
  {
4790
- theme: li.vsDark,
4811
+ theme: ci.vsDark,
4791
4812
  code: s,
4792
4813
  language: "typescript",
4793
- children: ({ className: o, style: l, tokens: p, getLineProps: m, getTokenProps: u }) => /* @__PURE__ */ e("pre", { style: l, className: "p-4 rounded text-sm", children: p.map((c, d) => /* @__PURE__ */ e("div", { ...m({ line: c }), children: c.map((f, g) => /* @__PURE__ */ e("span", { ...u({ token: f }) }, g)) }, d)) })
4814
+ children: ({ className: o, style: l, tokens: p, getLineProps: m, getTokenProps: u }) => /* @__PURE__ */ e("pre", { style: l, className: "p-4 rounded text-sm", children: p.map((d, c) => /* @__PURE__ */ e("div", { ...m({ line: d }), children: d.map((y, g) => /* @__PURE__ */ e("span", { ...u({ token: y }) }, g)) }, c)) })
4794
4815
  }
4795
4816
  )
4796
4817
  ] }),
4797
4818
  /* @__PURE__ */ n(Le, { children: [
4798
4819
  /* @__PURE__ */ n(
4799
- B,
4820
+ U,
4800
4821
  {
4801
4822
  variant: "text",
4802
4823
  size: "small",
@@ -4805,18 +4826,18 @@ const ` + Ji(t.name) + "Collection:EntityCollection = " + ni.stringify(ca(t), nu
4805
4826
  message: "Copied"
4806
4827
  }), navigator.clipboard.writeText(s)),
4807
4828
  children: [
4808
- /* @__PURE__ */ e(Fa, { size: "small" }),
4829
+ /* @__PURE__ */ e(ja, { size: "small" }),
4809
4830
  "Copy to clipboard"
4810
4831
  ]
4811
4832
  }
4812
4833
  ),
4813
- /* @__PURE__ */ e(B, { onClick: () => a(!1), children: "Close" })
4834
+ /* @__PURE__ */ e(U, { onClick: () => a(!1), children: "Close" })
4814
4835
  ] })
4815
4836
  ]
4816
4837
  }
4817
4838
  );
4818
4839
  }
4819
- function ca(t) {
4840
+ function da(t) {
4820
4841
  const a = (i) => {
4821
4842
  const r = {
4822
4843
  ...i
@@ -4842,10 +4863,10 @@ function ca(t) {
4842
4863
  properties: Object.entries(t.properties).map(([i, r]) => ({
4843
4864
  [i]: a(r)
4844
4865
  })).reduce((i, r) => ({ ...i, ...r }), {}),
4845
- subcollections: (t.subcollections ?? []).map(ca)
4866
+ subcollections: (t.subcollections ?? []).map(da)
4846
4867
  };
4847
4868
  }
4848
- function Wi({
4869
+ function Xi({
4849
4870
  showErrors: t,
4850
4871
  isNewCollection: a,
4851
4872
  propertyErrorsRef: i,
@@ -4856,124 +4877,124 @@ function Wi({
4856
4877
  getUser: p,
4857
4878
  getData: m,
4858
4879
  doCollectionInference: u,
4859
- propertyConfigs: c,
4860
- collectionEditable: d
4880
+ propertyConfigs: d,
4881
+ collectionEditable: c
4861
4882
  }) {
4862
4883
  const {
4863
- values: f,
4884
+ values: y,
4864
4885
  setFieldValue: g,
4865
4886
  setFieldError: b,
4866
4887
  setFieldTouched: O,
4867
- errors: k,
4868
- dirty: x
4869
- } = K(), h = De(), _ = ja("lg"), y = !_, [w, q] = $(), [F, A] = $(), [S, E] = $(), v = F ? ce(F, S) : void 0, V = v ? P(f.properties, v.replaceAll(".", ".properties.")) : void 0, [J, N] = $(!1), [R, ge] = $(!1), [xe, Q] = $(!1), [U, W] = $([]), te = L.useRef(f.propertiesOrder ? { "": f.propertiesOrder } : {});
4888
+ errors: w,
4889
+ dirty: k
4890
+ } = Y(), f = De(), v = Ea("lg"), _ = !v, [h, A] = L(), [E, z] = L(), [q, B] = L(), S = E ? ce(E, q) : void 0, N = S ? P(y.properties, S.replaceAll(".", ".properties.")) : void 0, [j, x] = L(!1), [I, ge] = L(!1), [fe, X] = L(!1), [M, Q] = L([]), te = K.useRef(y.propertiesOrder ? { "": y.propertiesOrder } : {});
4870
4891
  pe(() => {
4871
- s && s(x);
4872
- }, [x]);
4892
+ s && s(k);
4893
+ }, [k]);
4873
4894
  const me = u ? () => {
4874
- u && (ge(!0), u(f).then((z) => {
4875
- if (z && et(z.properties), !z) {
4876
- h.open({
4895
+ u && (ge(!0), u(y).then((T) => {
4896
+ if (T && et(T.properties), !T) {
4897
+ f.open({
4877
4898
  type: "error",
4878
4899
  message: "Could not infer properties from data"
4879
4900
  });
4880
4901
  return;
4881
4902
  }
4882
- const j = (z.properties ? Object.keys(z.properties) : []).filter((le) => !f.properties[le]);
4883
- if (j.length === 0) {
4884
- h.open({
4903
+ const D = (T.properties ? Object.keys(T.properties) : []).filter((le) => !y.properties[le]);
4904
+ if (D.length === 0) {
4905
+ f.open({
4885
4906
  type: "info",
4886
4907
  message: "No new properties found in existing data"
4887
4908
  });
4888
4909
  return;
4889
4910
  }
4890
- const G = {
4891
- ...j.reduce((le, ve) => (le[ve] = (z.properties ?? {})[ve], le), {}),
4892
- ...f.properties
4911
+ const H = {
4912
+ ...D.reduce((le, we) => (le[we] = (T.properties ?? {})[we], le), {}),
4913
+ ...y.properties
4893
4914
  }, se = [
4894
- ...j,
4895
- ...f.propertiesOrder ?? []
4915
+ ...D,
4916
+ ...y.propertiesOrder ?? []
4896
4917
  ];
4897
- g("properties", G, !1), fe(se), W(j);
4918
+ g("properties", H, !1), be(se), Q(D);
4898
4919
  }).finally(() => {
4899
4920
  ge(!1);
4900
4921
  }));
4901
- } : void 0, ue = (z) => z ? te.current[z] ?? P(f, Ne(z)) : te.current[""], fe = (z, j) => {
4902
- const G = Ne(j);
4903
- g(G, z, !1), te.current[j ?? ""] = z;
4904
- }, ye = (z, j) => {
4905
- const G = z ? ce(z, j) : void 0;
4906
- if (!G)
4922
+ } : void 0, ue = (T) => T ? te.current[T] ?? P(y, Pe(T)) : te.current[""], be = (T, D) => {
4923
+ const H = Pe(D);
4924
+ g(H, T, !1), te.current[D ?? ""] = T;
4925
+ }, ve = (T, D) => {
4926
+ const H = T ? ce(T, D) : void 0;
4927
+ if (!H)
4907
4928
  throw Error("collection editor miss config");
4908
- g(_e(G), void 0, !1);
4909
- const le = ue(j).filter((ve) => ve !== z);
4910
- fe(le, j), Q(!1), q(void 0), A(void 0), E(void 0);
4911
- }, Ce = (z, j) => {
4912
- g(Ne(j), z, !1);
4929
+ g(ke(H), void 0, !1);
4930
+ const le = ue(D).filter((we) => we !== T);
4931
+ be(le, D), X(!1), A(void 0), z(void 0), B(void 0);
4932
+ }, Ce = (T, D) => {
4933
+ g(Pe(D), T, !1);
4913
4934
  }, ae = ({
4914
- id: z,
4915
- property: j
4935
+ id: T,
4936
+ property: D
4916
4937
  }) => {
4917
4938
  if (console.log("onPropertyCreated", {
4918
- id: z,
4919
- property: j
4920
- }), !z)
4939
+ id: T,
4940
+ property: D
4941
+ }), !T)
4921
4942
  throw Error("Need to include an ID when creating a new property");
4922
4943
  g("properties", {
4923
- ...f.properties ?? {},
4924
- [z]: j
4944
+ ...y.properties ?? {},
4945
+ [T]: D
4925
4946
  }, !1);
4926
- const G = [...f.propertiesOrder ?? Object.keys(f.properties), z];
4947
+ const H = [...y.propertiesOrder ?? Object.keys(y.properties), T];
4927
4948
  console.log("onPropertyCreated", {
4928
- id: z,
4929
- property: j,
4930
- newPropertiesOrder: G
4931
- }), fe(G), Q(!1), _ && (q(G.indexOf(z)), A(z)), E(void 0);
4949
+ id: T,
4950
+ property: D,
4951
+ newPropertiesOrder: H
4952
+ }), be(H), X(!1), v && (A(H.indexOf(T)), z(T)), B(void 0);
4932
4953
  }, Ve = ({
4933
- id: z,
4934
- property: j,
4935
- previousId: G,
4954
+ id: T,
4955
+ property: D,
4956
+ previousId: H,
4936
4957
  namespace: se
4937
4958
  }) => {
4938
- const le = z ? ce(z, se) : void 0, ve = le ? _e(le) : void 0;
4939
- if (G && G !== z) {
4940
- const yt = ce(G, se), it = _e(yt), Z = ue(se).map((Ie) => Ie === G ? z : Ie).filter((Ie) => Ie !== void 0);
4941
- fe(Z, se), z && (q(Z.indexOf(z)), A(z)), g(it, void 0, !1), O(it, !1, !1);
4959
+ const le = T ? ce(T, se) : void 0, we = le ? ke(le) : void 0;
4960
+ if (H && H !== T) {
4961
+ const yt = ce(H, se), it = ke(yt), W = ue(se).map((Ie) => Ie === H ? T : Ie).filter((Ie) => Ie !== void 0);
4962
+ be(W, se), T && (A(W.indexOf(T)), z(T)), g(it, void 0, !1), O(it, !1, !1);
4942
4963
  }
4943
- ve && (g(ve, j, !1), O(ve, !0, !1));
4944
- }, tt = (z, j, G) => {
4945
- const se = z ? ce(z, j) : void 0;
4964
+ we && (g(we, D, !1), O(we, !0, !1));
4965
+ }, tt = (T, D, H) => {
4966
+ const se = T ? ce(T, D) : void 0;
4946
4967
  if (console.warn("onPropertyErrorInternal", {
4947
- id: z,
4948
- namespace: j,
4949
- error: G,
4968
+ id: T,
4969
+ namespace: D,
4970
+ error: H,
4950
4971
  propertyPath: se
4951
4972
  }), se) {
4952
- const le = G && Object.keys(G).length > 0;
4953
- r(z, j, le ? G : void 0), b(_e(se), le ? "Property error" : void 0);
4973
+ const le = H && Object.keys(H).length > 0;
4974
+ r(T, D, le ? H : void 0), b(ke(se), le ? "Property error" : void 0);
4954
4975
  }
4955
4976
  }, bt = () => {
4956
- q(void 0), A(void 0);
4957
- }, T = F && i?.current?.properties ? i.current.properties[F] : void 0, I = f?.propertiesOrder === void 0 || f.propertiesOrder.length === 0, D = f.propertiesOrder ? f.propertiesOrder : Object.keys(f.properties), Oe = Yt(() => p(f.ownerId), [p, f.ownerId]), at = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
4958
- /* @__PURE__ */ n("div", { className: ke(
4977
+ A(void 0), z(void 0);
4978
+ }, V = E && i?.current?.properties ? i.current.properties[E] : void 0, F = y?.propertiesOrder === void 0 || y.propertiesOrder.length === 0, R = y.propertiesOrder ? y.propertiesOrder : Object.keys(y.properties), Oe = Kt(() => p(y.ownerId), [p, y.ownerId]), at = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
4979
+ /* @__PURE__ */ n("div", { className: xe(
4959
4980
  "p-4 md:p-8 pb-20 md:pb-20",
4960
4981
  "col-span-12 lg:col-span-5 h-full overflow-auto",
4961
- !y && "border-r " + Nt
4982
+ !_ && "border-r " + Nt
4962
4983
  ), children: [
4963
4984
  /* @__PURE__ */ n("div", { className: "flex my-2", children: [
4964
4985
  /* @__PURE__ */ n("div", { className: "flex-grow mb-4", children: [
4965
4986
  /* @__PURE__ */ e(
4966
- be,
4987
+ ye,
4967
4988
  {
4968
4989
  name: "name",
4969
- as: H,
4990
+ as: J,
4970
4991
  invisible: !0,
4971
4992
  className: "-ml-1",
4972
4993
  inputClassName: "text-2xl font-headers",
4973
4994
  placeholder: "Collection name",
4974
4995
  size: "small",
4975
4996
  required: !0,
4976
- error: !!k?.name
4997
+ error: !!w?.name
4977
4998
  }
4978
4999
  ),
4979
5000
  Oe && /* @__PURE__ */ n(
@@ -4995,119 +5016,119 @@ function Wi({
4995
5016
  ne,
4996
5017
  {
4997
5018
  variant: "filled",
4998
- disabled: R,
4999
- onClick: () => N(!0),
5000
- children: /* @__PURE__ */ e(Ea, {})
5019
+ disabled: I,
5020
+ onClick: () => x(!0),
5021
+ children: /* @__PURE__ */ e(Da, {})
5001
5022
  }
5002
5023
  ) }),
5003
5024
  me && /* @__PURE__ */ e(re, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
5004
5025
  ne,
5005
5026
  {
5006
5027
  variant: "filled",
5007
- disabled: R,
5028
+ disabled: I,
5008
5029
  onClick: me,
5009
- children: R ? /* @__PURE__ */ e(We, { size: "small" }) : /* @__PURE__ */ e(gt, {})
5030
+ children: I ? /* @__PURE__ */ e(We, { size: "small" }) : /* @__PURE__ */ e(gt, {})
5010
5031
  }
5011
5032
  ) }),
5012
5033
  /* @__PURE__ */ e(re, { title: "Add new property", children: /* @__PURE__ */ e(
5013
- B,
5034
+ U,
5014
5035
  {
5015
5036
  variant: "outlined",
5016
- onClick: () => Q(!0),
5037
+ onClick: () => X(!0),
5017
5038
  children: /* @__PURE__ */ e(Ae, {})
5018
5039
  }
5019
5040
  ) })
5020
5041
  ] })
5021
5042
  ] }),
5022
- /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
5043
+ /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
5023
5044
  ft,
5024
5045
  {
5025
5046
  className: "pl-8",
5026
- onPropertyClick: (z, j) => {
5027
- q(D.indexOf(z)), A(z), E(j);
5047
+ onPropertyClick: (T, D) => {
5048
+ A(R.indexOf(T)), z(T), B(D);
5028
5049
  },
5029
- inferredPropertyKeys: U,
5030
- selectedPropertyKey: F ? ce(F, S) : void 0,
5031
- properties: f.properties,
5032
- additionalFields: f.additionalFields,
5033
- propertiesOrder: D,
5050
+ inferredPropertyKeys: M,
5051
+ selectedPropertyKey: E ? ce(E, q) : void 0,
5052
+ properties: y.properties,
5053
+ additionalFields: y.additionalFields,
5054
+ propertiesOrder: R,
5034
5055
  onPropertyMove: Ce,
5035
- onPropertyRemove: a ? ye : void 0,
5036
- collectionEditable: d,
5037
- errors: t ? k : {}
5056
+ onPropertyRemove: a ? ve : void 0,
5057
+ collectionEditable: c,
5058
+ errors: t ? w : {}
5038
5059
  }
5039
5060
  ) }),
5040
5061
  /* @__PURE__ */ e(
5041
- B,
5062
+ U,
5042
5063
  {
5043
5064
  className: "mt-8 w-full",
5044
5065
  color: "primary",
5045
5066
  variant: "outlined",
5046
5067
  size: "large",
5047
- onClick: () => Q(!0),
5068
+ onClick: () => X(!0),
5048
5069
  startIcon: /* @__PURE__ */ e(Ae, {}),
5049
5070
  children: "Add new property"
5050
5071
  }
5051
5072
  )
5052
5073
  ] }),
5053
- !y && /* @__PURE__ */ e("div", { className: "col-span-12 lg:col-span-7 ml-2 p-4 md:p-8 h-full overflow-auto pb-20 md:pb-20", children: /* @__PURE__ */ n(
5074
+ !_ && /* @__PURE__ */ e("div", { className: "col-span-12 lg:col-span-7 ml-2 p-4 md:p-8 h-full overflow-auto pb-20 md:pb-20", children: /* @__PURE__ */ n(
5054
5075
  qe,
5055
5076
  {
5056
5077
  className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
5057
5078
  children: [
5058
- v && V && !oe(V) && /* @__PURE__ */ e(
5059
- la,
5079
+ S && N && !oe(N) && /* @__PURE__ */ e(
5080
+ ca,
5060
5081
  {
5061
5082
  inArray: !1,
5062
5083
  existingProperty: !a,
5063
5084
  autoUpdateId: !1,
5064
5085
  allowDataInference: !a,
5065
5086
  autoOpenTypeSelect: !1,
5066
- propertyKey: F,
5067
- propertyNamespace: S,
5068
- property: V,
5087
+ propertyKey: E,
5088
+ propertyNamespace: q,
5089
+ property: N,
5069
5090
  onPropertyChanged: Ve,
5070
- onDelete: ye,
5091
+ onDelete: ve,
5071
5092
  onError: tt,
5072
5093
  forceShowErrors: t,
5073
- initialErrors: T,
5094
+ initialErrors: V,
5074
5095
  getData: m,
5075
- propertyConfigs: c,
5076
- collectionEditable: d
5096
+ propertyConfigs: d,
5097
+ collectionEditable: c
5077
5098
  },
5078
- `edit_view_${w}`
5099
+ `edit_view_${h}`
5079
5100
  ),
5080
- !V && /* @__PURE__ */ e(C, { variant: "label", className: "flex items-center justify-center h-full", children: I ? "Now you can add your first property" : "Select a property to edit it" }),
5081
- V && oe(V) && /* @__PURE__ */ e(C, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
5101
+ !N && /* @__PURE__ */ e(C, { variant: "label", className: "flex items-center justify-center h-full", children: F ? "Now you can add your first property" : "Select a property to edit it" }),
5102
+ N && oe(N) && /* @__PURE__ */ e(C, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
5082
5103
  ]
5083
5104
  }
5084
5105
  ) }),
5085
- y && /* @__PURE__ */ e(
5106
+ _ && /* @__PURE__ */ e(
5086
5107
  je,
5087
5108
  {
5088
5109
  inArray: !1,
5089
- open: w !== void 0,
5110
+ open: h !== void 0,
5090
5111
  autoUpdateId: a,
5091
5112
  allowDataInference: !a,
5092
5113
  existingProperty: !0,
5093
5114
  autoOpenTypeSelect: !1,
5094
- propertyKey: F,
5095
- propertyNamespace: S,
5096
- property: V,
5115
+ propertyKey: E,
5116
+ propertyNamespace: q,
5117
+ property: N,
5097
5118
  onPropertyChanged: Ve,
5098
- onDelete: ye,
5119
+ onDelete: ve,
5099
5120
  onError: tt,
5100
5121
  forceShowErrors: t,
5101
- initialErrors: T,
5122
+ initialErrors: V,
5102
5123
  getData: m,
5103
- propertyConfigs: c,
5104
- collectionEditable: d,
5105
- onOkClicked: y ? bt : void 0
5124
+ propertyConfigs: d,
5125
+ collectionEditable: c,
5126
+ onOkClicked: _ ? bt : void 0
5106
5127
  },
5107
- `edit_view_${w}`
5128
+ `edit_view_${h}`
5108
5129
  )
5109
5130
  ] });
5110
- return /* @__PURE__ */ n(M, { children: [
5131
+ return /* @__PURE__ */ n($, { children: [
5111
5132
  at,
5112
5133
  /* @__PURE__ */ e(
5113
5134
  je,
@@ -5117,27 +5138,27 @@ function Wi({
5117
5138
  autoOpenTypeSelect: !0,
5118
5139
  autoUpdateId: !0,
5119
5140
  forceShowErrors: t,
5120
- open: xe,
5121
- onCancel: () => Q(!1),
5141
+ open: fe,
5142
+ onCancel: () => X(!1),
5122
5143
  onPropertyChanged: ae,
5123
5144
  getData: m,
5124
5145
  allowDataInference: !a,
5125
- propertyConfigs: c,
5126
- collectionEditable: d,
5127
- existingPropertyKeys: f.propertiesOrder
5146
+ propertyConfigs: d,
5147
+ collectionEditable: c,
5148
+ existingPropertyKeys: y.propertiesOrder
5128
5149
  }
5129
5150
  ),
5130
5151
  /* @__PURE__ */ e(
5131
- Qi,
5152
+ Zi,
5132
5153
  {
5133
- collection: f,
5134
- open: J,
5135
- onOpenChange: N
5154
+ collection: y,
5155
+ open: j,
5156
+ onOpenChange: x
5136
5157
  }
5137
5158
  )
5138
5159
  ] });
5139
5160
  }
5140
- function Zi({
5161
+ function er({
5141
5162
  open: t,
5142
5163
  handleOk: a,
5143
5164
  handleCancel: i,
@@ -5158,14 +5179,14 @@ function Zi({
5158
5179
  /* @__PURE__ */ e(C, { children: "Are you sure?" })
5159
5180
  ] }),
5160
5181
  /* @__PURE__ */ n(Le, { children: [
5161
- /* @__PURE__ */ e(B, { variant: "text", onClick: i, autoFocus: !0, children: " Cancel " }),
5162
- /* @__PURE__ */ e(B, { onClick: a, children: " Ok " })
5182
+ /* @__PURE__ */ e(U, { variant: "text", onClick: i, autoFocus: !0, children: " Cancel " }),
5183
+ /* @__PURE__ */ e(U, { onClick: a, children: " Ok " })
5163
5184
  ] })
5164
5185
  ]
5165
5186
  }
5166
5187
  );
5167
5188
  }
5168
- function Xi({ open: t, onClose: a }) {
5189
+ function tr({ open: t, onClose: a }) {
5169
5190
  const {
5170
5191
  entityViews: i
5171
5192
  } = Ke();
@@ -5178,7 +5199,7 @@ function Xi({ open: t, onClose: a }) {
5178
5199
  /* @__PURE__ */ n($e, { children: [
5179
5200
  /* @__PURE__ */ e(C, { variant: "h6", children: "Select view" }),
5180
5201
  i?.map((r) => /* @__PURE__ */ n(
5181
- B,
5202
+ U,
5182
5203
  {
5183
5204
  onClick: () => a(r.key),
5184
5205
  fullWidth: !0,
@@ -5194,12 +5215,12 @@ function Xi({ open: t, onClose: a }) {
5194
5215
  )),
5195
5216
  (i ?? []).length === 0 && /* @__PURE__ */ e(C, { variant: "body2", children: "No custom views defined" })
5196
5217
  ] }),
5197
- /* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(B, { onClick: () => a(), children: "Cancel" }) })
5218
+ /* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(U, { onClick: () => a(), children: "Cancel" }) })
5198
5219
  ]
5199
5220
  }
5200
5221
  );
5201
5222
  }
5202
- function er({
5223
+ function ar({
5203
5224
  collection: t,
5204
5225
  parentCollection: a,
5205
5226
  configController: i,
@@ -5207,10 +5228,10 @@ function er({
5207
5228
  getUser: s,
5208
5229
  parentCollectionIds: o
5209
5230
  }) {
5210
- const { entityViews: l } = Ke(), [p, m] = L.useState(), [u, c] = L.useState(!1), [d, f] = L.useState(), [g, b] = L.useState(), {
5231
+ const { entityViews: l } = Ke(), [p, m] = K.useState(), [u, d] = K.useState(!1), [c, y] = K.useState(), [g, b] = K.useState(), {
5211
5232
  values: O,
5212
- setFieldValue: k
5213
- } = K(), x = t.subcollections ?? [], h = O.entityViews?.filter((w) => typeof w == "string").map((w) => Da(w, l)).filter(Boolean) ?? [], _ = t.entityViews?.filter((w) => typeof w != "string") ?? [], y = h.length + _.length;
5233
+ setFieldValue: w
5234
+ } = Y(), k = t.subcollections ?? [], f = O.entityViews?.filter((h) => typeof h == "string").map((h) => Ba(h, l)).filter(Boolean) ?? [], v = t.entityViews?.filter((h) => typeof h != "string") ?? [], _ = f.length + v.length;
5214
5235
  return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto", children: [
5215
5236
  /* @__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: [
5216
5237
  /* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
@@ -5218,19 +5239,19 @@ function er({
5218
5239
  "Subcollections of ",
5219
5240
  O.name
5220
5241
  ] }),
5221
- x && x.length > 0 && /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Ft, { children: /* @__PURE__ */ e(jt, { children: x.map((w) => /* @__PURE__ */ n(
5242
+ k && k.length > 0 && /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(It, { children: /* @__PURE__ */ e(Ft, { children: k.map((h) => /* @__PURE__ */ n(
5222
5243
  wt,
5223
5244
  {
5224
5245
  onClick: () => b({
5225
5246
  isNewCollection: !1,
5226
- editedCollectionPath: w.path
5247
+ editedCollectionPath: h.path
5227
5248
  }),
5228
5249
  children: [
5229
5250
  /* @__PURE__ */ e(
5230
5251
  Ge,
5231
5252
  {
5232
5253
  align: "left",
5233
- children: /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: w.name })
5254
+ children: /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: h.name })
5234
5255
  }
5235
5256
  ),
5236
5257
  /* @__PURE__ */ e(
@@ -5241,8 +5262,8 @@ function er({
5241
5262
  ne,
5242
5263
  {
5243
5264
  size: "small",
5244
- onClick: (q) => {
5245
- q.preventDefault(), q.stopPropagation(), m(w.path);
5265
+ onClick: (A) => {
5266
+ A.preventDefault(), A.stopPropagation(), m(h.path);
5246
5267
  },
5247
5268
  color: "inherit",
5248
5269
  children: /* @__PURE__ */ e(pt, { size: "small" })
@@ -5252,10 +5273,10 @@ function er({
5252
5273
  )
5253
5274
  ]
5254
5275
  },
5255
- w.path
5276
+ h.path
5256
5277
  )) }) }) }),
5257
5278
  /* @__PURE__ */ e(
5258
- B,
5279
+ U,
5259
5280
  {
5260
5281
  onClick: () => {
5261
5282
  b({
@@ -5270,13 +5291,13 @@ function er({
5270
5291
  ] }),
5271
5292
  /* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
5272
5293
  /* @__PURE__ */ e(C, { variant: "h5", children: "Custom views" }),
5273
- y > 0 && /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Ft, { children: /* @__PURE__ */ n(jt, { children: [
5274
- h.map((w) => /* @__PURE__ */ n(wt, { children: [
5294
+ _ > 0 && /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(It, { children: /* @__PURE__ */ n(Ft, { children: [
5295
+ f.map((h) => /* @__PURE__ */ n(wt, { children: [
5275
5296
  /* @__PURE__ */ e(
5276
5297
  Ge,
5277
5298
  {
5278
5299
  align: "left",
5279
- children: /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: w.name })
5300
+ children: /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: h.name })
5280
5301
  }
5281
5302
  ),
5282
5303
  /* @__PURE__ */ e(
@@ -5287,8 +5308,8 @@ function er({
5287
5308
  ne,
5288
5309
  {
5289
5310
  size: "small",
5290
- onClick: (q) => {
5291
- q.preventDefault(), q.stopPropagation(), f(w.key);
5311
+ onClick: (A) => {
5312
+ A.preventDefault(), A.stopPropagation(), y(h.key);
5292
5313
  },
5293
5314
  color: "inherit",
5294
5315
  children: /* @__PURE__ */ e(pt, { size: "small" })
@@ -5296,30 +5317,30 @@ function er({
5296
5317
  ) })
5297
5318
  }
5298
5319
  )
5299
- ] }, w.key)),
5300
- _.map((w) => /* @__PURE__ */ e(wt, { children: /* @__PURE__ */ n(
5320
+ ] }, h.key)),
5321
+ v.map((h) => /* @__PURE__ */ e(wt, { children: /* @__PURE__ */ n(
5301
5322
  Ge,
5302
5323
  {
5303
5324
  align: "left",
5304
5325
  children: [
5305
- /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: w.name }),
5326
+ /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: h.name }),
5306
5327
  /* @__PURE__ */ n(C, { variant: "caption", className: "flex-grow", children: [
5307
5328
  "This view is defined in code with key ",
5308
- /* @__PURE__ */ e("code", { children: w.key })
5329
+ /* @__PURE__ */ e("code", { children: h.key })
5309
5330
  ] })
5310
5331
  ]
5311
5332
  }
5312
- ) }, w.key))
5333
+ ) }, h.key))
5313
5334
  ] }) }) }) }),
5314
- y === 0 && /* @__PURE__ */ n(ea, { children: [
5335
+ _ === 0 && /* @__PURE__ */ n(ea, { children: [
5315
5336
  /* @__PURE__ */ e("b", { children: "COMING SOON" }),
5316
5337
  " Define your own custom views by uploading it with the CLI"
5317
5338
  ] }),
5318
5339
  /* @__PURE__ */ e(
5319
- B,
5340
+ U,
5320
5341
  {
5321
5342
  onClick: () => {
5322
- c(!0);
5343
+ d(!0);
5323
5344
  },
5324
5345
  variant: "outlined",
5325
5346
  startIcon: /* @__PURE__ */ e(Ae, {}),
@@ -5340,24 +5361,24 @@ function er({
5340
5361
  }), m(void 0);
5341
5362
  },
5342
5363
  onCancel: () => m(void 0),
5343
- title: /* @__PURE__ */ e(M, { children: "Delete this subcollection?" }),
5344
- body: /* @__PURE__ */ n(M, { children: [
5364
+ title: /* @__PURE__ */ e($, { children: "Delete this subcollection?" }),
5365
+ body: /* @__PURE__ */ n($, { children: [
5345
5366
  " This will ",
5346
5367
  /* @__PURE__ */ e("b", { children: "not delete any data" }),
5347
5368
  ", only the collection in the CMS"
5348
5369
  ] })
5349
5370
  }
5350
5371
  ),
5351
- d && /* @__PURE__ */ e(
5372
+ c && /* @__PURE__ */ e(
5352
5373
  mt,
5353
5374
  {
5354
- open: !!d,
5375
+ open: !!c,
5355
5376
  onAccept: () => {
5356
- k("entityViews", O.entityViews?.filter((w) => w !== d)), f(void 0);
5377
+ w("entityViews", O.entityViews?.filter((h) => h !== c)), y(void 0);
5357
5378
  },
5358
- onCancel: () => f(void 0),
5359
- title: /* @__PURE__ */ e(M, { children: "Remove this view?" }),
5360
- body: /* @__PURE__ */ n(M, { children: [
5379
+ onCancel: () => y(void 0),
5380
+ title: /* @__PURE__ */ e($, { children: "Remove this view?" }),
5381
+ body: /* @__PURE__ */ n($, { children: [
5361
5382
  "This will ",
5362
5383
  /* @__PURE__ */ e("b", { children: "not delete any data" }),
5363
5384
  ", only the view in the CMS"
@@ -5365,7 +5386,7 @@ function er({
5365
5386
  }
5366
5387
  ),
5367
5388
  /* @__PURE__ */ e(
5368
- pa,
5389
+ ma,
5369
5390
  {
5370
5391
  open: !!g,
5371
5392
  configController: i,
@@ -5381,17 +5402,17 @@ function er({
5381
5402
  }
5382
5403
  ),
5383
5404
  /* @__PURE__ */ e(
5384
- Xi,
5405
+ tr,
5385
5406
  {
5386
5407
  open: u,
5387
- onClose: (w) => {
5388
- w && (console.log("selectedViewKey", w), k("entityViews", [...O.entityViews ?? [], w])), c(!1);
5408
+ onClose: (h) => {
5409
+ h && (console.log("selectedViewKey", h), w("entityViews", [...O.entityViews ?? [], h])), d(!1);
5389
5410
  }
5390
5411
  }
5391
5412
  )
5392
5413
  ] });
5393
5414
  }
5394
- const $t = {
5415
+ const Ut = {
5395
5416
  id: "products",
5396
5417
  path: "products",
5397
5418
  name: "Products",
@@ -5476,7 +5497,7 @@ const $t = {
5476
5497
  autoValue: "on_create"
5477
5498
  }
5478
5499
  })
5479
- }, Lt = {
5500
+ }, $t = {
5480
5501
  id: "blog",
5481
5502
  path: "blog",
5482
5503
  name: "Blog",
@@ -5588,7 +5609,7 @@ const $t = {
5588
5609
  initialFilter: {
5589
5610
  status: ["==", "published"]
5590
5611
  }
5591
- }, Kt = {
5612
+ }, Lt = {
5592
5613
  id: "users",
5593
5614
  path: "users",
5594
5615
  name: "Users",
@@ -5620,31 +5641,31 @@ const $t = {
5620
5641
  }
5621
5642
  })
5622
5643
  };
5623
- function tr({
5644
+ function ir({
5624
5645
  path: t,
5625
5646
  pathSuggestions: a,
5626
5647
  parentCollection: i,
5627
5648
  onContinue: r,
5628
5649
  collections: s
5629
5650
  }) {
5630
- const [o, l] = $(!1), [p, m] = $();
5651
+ const [o, l] = L(!1), [p, m] = L();
5631
5652
  pe(() => {
5632
- a && s && (l(!0), a(t).then((h) => {
5633
- const _ = h.filter((y) => !s.find((w) => w.path.trim().toLowerCase() === y.trim().toLowerCase()));
5634
- m(_);
5653
+ a && s && (l(!0), a(t).then((f) => {
5654
+ const v = f.filter((_) => !s.find((h) => h.path.trim().toLowerCase() === _.trim().toLowerCase()));
5655
+ m(v);
5635
5656
  }).finally(() => l(!1)));
5636
5657
  }, [s, t, a]);
5637
5658
  const {
5638
5659
  values: u,
5639
- setFieldValue: c,
5640
- setValues: d,
5641
- handleChange: f,
5660
+ setFieldValue: d,
5661
+ setValues: c,
5662
+ handleChange: y,
5642
5663
  touched: g,
5643
5664
  errors: b,
5644
5665
  setFieldTouched: O,
5645
- isSubmitting: k,
5646
- submitCount: x
5647
- } = K();
5666
+ isSubmitting: w,
5667
+ submitCount: k
5668
+ } = Y();
5648
5669
  return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(ht, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
5649
5670
  /* @__PURE__ */ e(
5650
5671
  "div",
@@ -5668,17 +5689,17 @@ function tr({
5668
5689
  ),
5669
5690
  /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
5670
5691
  o && !p && /* @__PURE__ */ e(We, { size: "small" }),
5671
- p?.map((h, _) => /* @__PURE__ */ e(
5692
+ p?.map((f, v) => /* @__PURE__ */ e(
5672
5693
  dt,
5673
5694
  {
5674
5695
  colorScheme: "cyanLighter",
5675
5696
  onClick: () => {
5676
- c("name", St(h)), c("path", h), c("properties", void 0), r();
5697
+ d("name", Pt(f)), d("path", f), d("properties", void 0), r();
5677
5698
  },
5678
5699
  size: "small",
5679
- children: h
5700
+ children: f
5680
5701
  },
5681
- h
5702
+ f
5682
5703
  )),
5683
5704
  !o && p?.length === 0 && /* @__PURE__ */ e(C, { variant: "caption", children: "No suggestions" })
5684
5705
  ] })
@@ -5698,9 +5719,9 @@ function tr({
5698
5719
  {
5699
5720
  title: "Products",
5700
5721
  subtitle: "A collection of products with images, prices and stock",
5701
- icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: $t.icon }),
5722
+ icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: Ut.icon }),
5702
5723
  onClick: () => {
5703
- d($t), r();
5724
+ c(Ut), r();
5704
5725
  }
5705
5726
  }
5706
5727
  ),
@@ -5709,9 +5730,9 @@ function tr({
5709
5730
  {
5710
5731
  title: "Blog posts",
5711
5732
  subtitle: "A collection of blog posts with images, authors and complex content",
5712
- icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: Lt.icon }),
5733
+ icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: $t.icon }),
5713
5734
  onClick: () => {
5714
- d(Lt), r();
5735
+ c($t), r();
5715
5736
  }
5716
5737
  }
5717
5738
  ),
@@ -5720,9 +5741,9 @@ function tr({
5720
5741
  {
5721
5742
  title: "Users",
5722
5743
  subtitle: "A collection of users with emails, names and roles",
5723
- icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: Kt.icon }),
5744
+ icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: Lt.icon }),
5724
5745
  onClick: () => {
5725
- d(Kt), r();
5746
+ c(Lt), r();
5726
5747
  }
5727
5748
  }
5728
5749
  )
@@ -5738,9 +5759,9 @@ function tr({
5738
5759
  children: "● Create a collection from a file (csv, json, xls, xslx...)"
5739
5760
  }
5740
5761
  ),
5741
- /* @__PURE__ */ e(ci, { onDataAdded: (h) => r(h) })
5762
+ /* @__PURE__ */ e(di, { onDataAdded: (f) => r(f) })
5742
5763
  ] }),
5743
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(B, { variant: "text", onClick: () => r(), className: "my-2", children: "Continue from scratch" }) })
5764
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(U, { variant: "text", onClick: () => r(), className: "my-2", children: "Continue from scratch" }) })
5744
5765
  ] }) });
5745
5766
  }
5746
5767
  function kt({
@@ -5753,7 +5774,7 @@ function kt({
5753
5774
  ta,
5754
5775
  {
5755
5776
  onClick: r,
5756
- className: ke(
5777
+ className: xe(
5757
5778
  "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",
5758
5779
  "text-gray-700 dark:text-gray-300",
5759
5780
  "hover:border-blue-600 hover:text-blue-600 dark:hover:text-blue-400 focus:ring-blue-400 hover:ring-1 hover:ring-primary",
@@ -5774,30 +5795,6 @@ function kt({
5774
5795
  }
5775
5796
  ) });
5776
5797
  }
5777
- const ar = [
5778
- "text_field",
5779
- "multiline",
5780
- "markdown",
5781
- "url",
5782
- "email",
5783
- "select",
5784
- "multi_select",
5785
- "number_input",
5786
- "number_select",
5787
- "multi_number_select",
5788
- "file_upload",
5789
- "multi_file_upload",
5790
- "group",
5791
- "key_value",
5792
- "reference",
5793
- "multi_references",
5794
- "switch",
5795
- "date_time",
5796
- "repeat",
5797
- "block"
5798
- ], ir = Object.entries(Ot).filter(
5799
- ([t]) => ar.includes(t)
5800
- );
5801
5798
  function rr({
5802
5799
  importConfig: t,
5803
5800
  propertyConfigs: a,
@@ -5807,45 +5804,45 @@ function rr({
5807
5804
  setFieldValue: r,
5808
5805
  setFieldTouched: s,
5809
5806
  values: o
5810
- } = K(), [l, p] = $(void 0), m = L.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), u = l ? l.id : void 0, c = l || void 0, d = ({
5807
+ } = Y(), [l, p] = L(void 0), m = K.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), u = l ? l.id : void 0, d = l || void 0, c = ({
5811
5808
  id: g,
5812
5809
  property: b,
5813
5810
  previousId: O,
5814
- namespace: k
5811
+ namespace: w
5815
5812
  }) => {
5816
- const x = g ? ce(g, k) : void 0, h = x ? _e(x) : void 0, _ = (w) => w ? m.current[w] ?? P(o, Ne(w)) : m.current[""], y = (w, q) => {
5817
- const F = Ne(q);
5818
- r(F, w, !1), m.current[q ?? ""] = w;
5813
+ const k = g ? ce(g, w) : void 0, f = k ? ke(k) : void 0, v = (h) => h ? m.current[h] ?? P(o, Pe(h)) : m.current[""], _ = (h, A) => {
5814
+ const E = Pe(A);
5815
+ r(E, h, !1), m.current[A ?? ""] = h;
5819
5816
  };
5820
5817
  if (O && O !== g) {
5821
- const w = ce(O, k), q = _e(w), A = _(k).map((E) => E === O ? g : E).filter((E) => E !== void 0);
5822
- y(A, k);
5823
- const S = { ...t.headersMapping };
5824
- Object.keys(S).forEach((E) => {
5825
- S[E] === O && (S[E] = g ?? "");
5826
- }), t.setHeadersMapping(S), r(q, void 0, !1), s(q, !1, !1);
5818
+ const h = ce(O, w), A = ke(h), z = v(w).map((B) => B === O ? g : B).filter((B) => B !== void 0);
5819
+ _(z, w);
5820
+ const q = { ...t.headersMapping };
5821
+ Object.keys(q).forEach((B) => {
5822
+ q[B] === O && (q[B] = g ?? "");
5823
+ }), t.setHeadersMapping(q), r(A, void 0, !1), s(A, !1, !1);
5827
5824
  }
5828
- h && (r(h, b, !1), s(h, !0, !1));
5829
- }, f = async ({
5825
+ f && (r(f, b, !1), s(f, !0, !1));
5826
+ }, y = async ({
5830
5827
  id: g,
5831
5828
  importKey: b,
5832
5829
  property: O,
5833
- namespace: k
5830
+ namespace: w
5834
5831
  }) => {
5835
- const x = g ? ce(g, k) : void 0, h = x ? _e(x) : void 0, _ = t.importData.map((w) => P(w, b)), y = {
5836
- ...ti(_, O, ia),
5832
+ const k = g ? ce(g, w) : void 0, f = k ? ke(k) : void 0, v = t.importData.map((h) => P(h, b)), _ = {
5833
+ ...ai(v, O, ia),
5837
5834
  editable: !0
5838
5835
  };
5839
- h && (y ? (console.log("updating inferredNewProperty", {
5836
+ f && (_ ? (console.log("updating inferredNewProperty", {
5840
5837
  property: O,
5841
- inferredNewProperty: y
5842
- }), r(h, y, !1)) : r(h, O, !1), s(h, !0, !1));
5838
+ inferredNewProperty: _
5839
+ }), r(f, _, !1)) : r(f, O, !1), s(f, !0, !1));
5843
5840
  };
5844
5841
  return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto bg-gray-50 dark:bg-gray-900", children: [
5845
5842
  /* @__PURE__ */ n(ht, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
5846
5843
  /* @__PURE__ */ e(C, { variant: "h6", className: "mt-4", children: "Data property mapping" }),
5847
5844
  /* @__PURE__ */ e(
5848
- di,
5845
+ pi,
5849
5846
  {
5850
5847
  headersMapping: t.headersMapping,
5851
5848
  idColumn: t.idColumn,
@@ -5857,11 +5854,11 @@ function rr({
5857
5854
  propertyKey: b,
5858
5855
  importKey: O
5859
5856
  }) => /* @__PURE__ */ e(
5860
- pi,
5857
+ mi,
5861
5858
  {
5862
5859
  property: g,
5863
5860
  propertyKey: b,
5864
- onPropertyNameChanged: (k, x) => r(`properties.${k}.name`, x, !1),
5861
+ onPropertyNameChanged: (w, k) => r(`properties.${w}.name`, k, !1),
5865
5862
  onEditClick: () => {
5866
5863
  !b || !g || p({
5867
5864
  ...g,
@@ -5874,8 +5871,8 @@ function rr({
5874
5871
  {
5875
5872
  property: g,
5876
5873
  disabled: !1,
5877
- onPropertyChanged: (k) => f({
5878
- ...k,
5874
+ onPropertyChanged: (w) => y({
5875
+ ...w,
5879
5876
  importKey: O
5880
5877
  }),
5881
5878
  propertyKey: b,
@@ -5892,10 +5889,10 @@ function rr({
5892
5889
  {
5893
5890
  open: l !== void 0,
5894
5891
  propertyKey: u,
5895
- property: c,
5892
+ property: d,
5896
5893
  inArray: !1,
5897
5894
  autoUpdateId: !1,
5898
- onPropertyChanged: d,
5895
+ onPropertyChanged: c,
5899
5896
  allowDataInference: !1,
5900
5897
  collectionEditable: i,
5901
5898
  onOkClicked: () => {
@@ -5919,7 +5916,7 @@ function or({
5919
5916
  propertyConfigs: r,
5920
5917
  disabled: s
5921
5918
  }) {
5922
- const o = t ? Xt(t) : null, l = t ? Ze(t, r) : null, [p, m] = $(!1);
5919
+ const o = t ? Xt(t) : null, l = t ? Ze(t, r) : null, [p, m] = L(!1);
5923
5920
  return /* @__PURE__ */ e(
5924
5921
  re,
5925
5922
  {
@@ -5939,20 +5936,20 @@ function or({
5939
5936
  position: "item-aligned",
5940
5937
  renderValue: (u) => l ? /* @__PURE__ */ e(Xe, { propertyConfig: l }) : null,
5941
5938
  onValueChange: (u) => {
5942
- const c = na(t, u, r);
5939
+ const d = na(t, u, r);
5943
5940
  i && (a({
5944
5941
  id: i,
5945
- property: c,
5942
+ property: d,
5946
5943
  previousId: i,
5947
5944
  namespace: void 0
5948
5945
  }), console.log("newSelectedWidgetId", u));
5949
5946
  },
5950
- children: ir.map(([u, c]) => /* @__PURE__ */ e(
5947
+ children: Object.entries(la).map(([u, d]) => /* @__PURE__ */ e(
5951
5948
  sa,
5952
5949
  {
5953
5950
  value: u,
5954
5951
  optionDisabled: !1,
5955
- propertyConfig: c,
5952
+ propertyConfig: d,
5956
5953
  existing: !1
5957
5954
  },
5958
5955
  u
@@ -5964,12 +5961,12 @@ function or({
5964
5961
  }
5965
5962
  function nr({ importConfig: t, properties: a, propertiesOrder: i }) {
5966
5963
  pe(() => {
5967
- const s = mi(t.originProperties, a), o = t.importData.map((l) => ui(l, t.idColumn, t.headersMapping, a, s, "TEMP_PATH"));
5964
+ const s = ui(t.originProperties, a), o = t.importData.map((l) => hi(l, t.idColumn, t.headersMapping, a, s, "TEMP_PATH"));
5968
5965
  t.setEntities(o), console.log("res", { propertiesMapping: s, mappedData: o });
5969
5966
  }, []);
5970
- const r = Ba();
5967
+ const r = Ma();
5971
5968
  return /* @__PURE__ */ e(
5972
- Ma,
5969
+ Ra,
5973
5970
  {
5974
5971
  title: /* @__PURE__ */ n("div", { children: [
5975
5972
  /* @__PURE__ */ e(C, { variant: "subtitle2", children: "Imported data preview" }),
@@ -5989,30 +5986,30 @@ function nr({ importConfig: t, properties: a, propertiesOrder: i }) {
5989
5986
  }
5990
5987
  );
5991
5988
  }
5992
- function da(t, a = "") {
5989
+ function pa(t, a = "") {
5993
5990
  const i = Object.keys(t).reduce((o, l) => {
5994
- const p = t[l], m = Ra(l), u = a ? `${a}.${m}` : m;
5991
+ const p = t[l], m = Ua(l), u = a ? `${a}.${m}` : m;
5995
5992
  if (p.dataType === "map" && p.properties) {
5996
- const f = da(p.properties, u);
5993
+ const y = pa(p.properties, u);
5997
5994
  return {
5998
5995
  headersMapping: { ...o.headersMapping, [l]: u },
5999
5996
  properties: {
6000
5997
  ...o.properties,
6001
5998
  [m]: {
6002
5999
  ...p,
6003
- properties: f.properties,
6004
- propertiesOrder: Object.keys(f.properties)
6000
+ properties: y.properties,
6001
+ propertiesOrder: Object.keys(y.properties)
6005
6002
  }
6006
6003
  }
6007
6004
  };
6008
6005
  }
6009
- const c = {
6006
+ const d = {
6010
6007
  ...o.properties,
6011
6008
  [m]: p
6012
6009
  };
6013
6010
  return {
6014
6011
  headersMapping: { ...o.headersMapping, [l]: u },
6015
- properties: c
6012
+ properties: d
6016
6013
  };
6017
6014
  }, { headersMapping: {}, properties: {} }), r = Object.keys(i.headersMapping)?.[0];
6018
6015
  let s;
@@ -6021,8 +6018,8 @@ function da(t, a = "") {
6021
6018
  idColumn: s
6022
6019
  };
6023
6020
  }
6024
- function pa(t) {
6025
- const a = t.open, [i, r] = we.useState(!1), [s, o] = we.useState(!1), l = X(() => {
6021
+ function ma(t) {
6022
+ const a = t.open, [i, r] = _e.useState(!1), [s, o] = _e.useState(!1), l = Z(() => {
6026
6023
  i ? o(!0) : t.handleClose(void 0);
6027
6024
  }, [i, t.handleClose]);
6028
6025
  return pe(() => {
@@ -6046,7 +6043,7 @@ function pa(t) {
6046
6043
  }
6047
6044
  ),
6048
6045
  /* @__PURE__ */ e(
6049
- Zi,
6046
+ er,
6050
6047
  {
6051
6048
  open: s,
6052
6049
  handleOk: () => t.handleClose(void 0),
@@ -6069,89 +6066,89 @@ function sr({
6069
6066
  handleClose: p,
6070
6067
  reservedGroups: m,
6071
6068
  extraView: u,
6072
- handleCancel: c,
6073
- setFormDirty: d,
6074
- pathSuggestions: f,
6069
+ handleCancel: d,
6070
+ setFormDirty: c,
6071
+ pathSuggestions: y,
6075
6072
  getUser: g,
6076
6073
  parentCollection: b,
6077
6074
  getData: O
6078
6075
  }) {
6079
- const { propertyConfigs: k } = Ke(), x = Be(), {
6080
- topLevelNavigation: h,
6081
- collections: _
6082
- } = x, y = !a?.path && (s ?? []).length === 0, w = (b ? b.subcollections : _) ?? [], q = w.map((T) => T.path.trim().toLowerCase()), F = w.map((T) => T.id?.trim().toLowerCase()).filter(Boolean), A = hi();
6083
- if (!h)
6076
+ const { propertyConfigs: w } = Ke(), k = Be(), {
6077
+ topLevelNavigation: f,
6078
+ collections: v
6079
+ } = k, _ = !a?.path && (s ?? []).length === 0, h = (b ? b.subcollections : v) ?? [], A = h.map((V) => V.path.trim().toLowerCase()), E = h.map((V) => V.id?.trim().toLowerCase()).filter(Boolean), z = gi();
6080
+ if (!f)
6084
6081
  throw Error("Internal: Navigation not ready in collection editor");
6085
6082
  const {
6086
- groups: S
6087
- } = h, E = De(), v = Ye(), V = He({}), J = t ? y ? "welcome" : "details" : "properties", [N, R] = $(J), [ge, xe] = we.useState(), [Q, U] = we.useState(), [W, te] = we.useState(!1), [me, ue] = we.useState();
6083
+ groups: q
6084
+ } = f, B = De(), S = Ye(), N = He({}), j = t ? _ ? "welcome" : "details" : "properties", [x, I] = L(j), [ge, fe] = _e.useState(), [X, M] = _e.useState(), [Q, te] = _e.useState(!1), [me, ue] = _e.useState();
6088
6085
  pe(() => {
6089
6086
  try {
6090
- x.initialised && (U(r ? x.getCollectionFromPaths([...s ?? [], r]) : void 0), te(!0));
6091
- } catch (T) {
6092
- console.error(T), ue(me);
6087
+ k.initialised && (M(r ? k.getCollectionFromPaths([...s ?? [], r]) : void 0), te(!0));
6088
+ } catch (V) {
6089
+ console.error(V), ue(me);
6093
6090
  }
6094
- }, [x.getCollectionFromPaths, r, me, x.initialised]);
6095
- const fe = (T) => {
6096
- const I = T.id || T.path;
6091
+ }, [k.getCollectionFromPaths, r, me, k.initialised]);
6092
+ const be = (V) => {
6093
+ const F = V.id || V.path;
6097
6094
  return i.saveCollection({
6098
- id: I,
6099
- collectionData: T,
6095
+ id: F,
6096
+ collectionData: V,
6100
6097
  previousPath: r,
6101
6098
  parentCollectionIds: s
6102
- }).then(() => (xe(void 0), !0)).catch((D) => (xe(D), console.error(D), E.open({
6099
+ }).then(() => (fe(void 0), !0)).catch((R) => (fe(R), console.error(R), B.open({
6103
6100
  type: "error",
6104
- message: "Error persisting collection: " + (D.message ?? "Details in the console")
6101
+ message: "Error persisting collection: " + (R.message ?? "Details in the console")
6105
6102
  }), !1));
6106
- }, ye = Q ? {
6107
- ...Q,
6108
- id: Q.id ?? Q.path ?? Et(16)
6109
- } : void 0, Ce = ye ? lr(ye, k) : {
6110
- id: a?.path ?? Et(16),
6103
+ }, ve = X ? {
6104
+ ...X,
6105
+ id: X.id ?? X.path ?? jt(16)
6106
+ } : void 0, Ce = ve ? lr(ve, w) : {
6107
+ id: a?.path ?? jt(16),
6111
6108
  path: a?.path ?? "",
6112
6109
  name: a?.name ?? "",
6113
6110
  group: a?.group ?? "",
6114
6111
  properties: {},
6115
6112
  propertiesOrder: [],
6116
6113
  icon: xt[Math.floor(Math.random() * xt.length)],
6117
- ownerId: v.user?.uid ?? ""
6118
- }, ae = X(() => {
6119
- N === "details" ? A.inUse ? R("import_data_saving") : R(u ? "extra_view" : "properties") : R(N === "welcome" ? "details" : N === "import_data_mapping" ? "import_data_preview" : N === "import_data_preview" ? "details" : N === "extra_view" ? "properties" : "details");
6120
- }, [N, A.inUse, u]), Ve = X((T) => {
6114
+ ownerId: S.user?.uid ?? ""
6115
+ }, ae = Z(() => {
6116
+ x === "details" ? z.inUse ? I("import_data_saving") : I(u ? "extra_view" : "properties") : I(x === "welcome" ? "details" : x === "import_data_mapping" ? "import_data_preview" : x === "import_data_preview" ? "details" : x === "extra_view" ? "properties" : "details");
6117
+ }, [x, z.inUse, u]), Ve = Z((V) => {
6121
6118
  if (l)
6122
- return l?.(T.path, T.collectionGroup ?? !1, s ?? []);
6123
- }, [l, s]), tt = X(async (T) => {
6119
+ return l?.(V.path, V.collectionGroup ?? !1, s ?? []);
6120
+ }, [l, s]), tt = Z(async (V) => {
6124
6121
  try {
6125
6122
  if (!Ve)
6126
- return U(T), Promise.resolve(T);
6127
- R("loading");
6128
- const I = await Ve?.(T);
6129
- if (!I)
6130
- return U(T), Promise.resolve(T);
6131
- const D = {
6132
- ...T ?? {}
6123
+ return M(V), Promise.resolve(V);
6124
+ I("loading");
6125
+ const F = await Ve?.(V);
6126
+ if (!F)
6127
+ return M(V), Promise.resolve(V);
6128
+ const R = {
6129
+ ...V ?? {}
6133
6130
  };
6134
- return Object.keys(I.properties ?? {}).length > 0 && (D.properties = I.properties, D.propertiesOrder = I.propertiesOrder), D.propertiesOrder ? (U(D), console.log("Inferred collection", {
6135
- newCollection: T ?? {},
6136
- values: D
6137
- }), D) : (D.propertiesOrder = Object.keys(D.properties), D);
6138
- } catch (I) {
6139
- return console.error(I), E.open({
6131
+ return Object.keys(F.properties ?? {}).length > 0 && (R.properties = F.properties, R.propertiesOrder = F.propertiesOrder), R.propertiesOrder ? (M(R), console.log("Inferred collection", {
6132
+ newCollection: V ?? {},
6133
+ values: R
6134
+ }), R) : (R.propertiesOrder = Object.keys(R.properties), R);
6135
+ } catch (F) {
6136
+ return console.error(F), B.open({
6140
6137
  type: "error",
6141
- message: "Error inferring collection: " + (I.message ?? "Details in the console")
6142
- }), T;
6138
+ message: "Error inferring collection: " + (F.message ?? "Details in the console")
6139
+ }), V;
6143
6140
  }
6144
- }, [s, Ve]), bt = (T, I) => {
6141
+ }, [s, Ve]), bt = (V, F) => {
6145
6142
  try {
6146
- if (console.log("Submitting collection", T), !t) {
6147
- fe(T).then(() => {
6148
- I.resetForm({ values: Ce }), p(T);
6143
+ if (console.log("Submitting collection", V), !t) {
6144
+ be(V).then(() => {
6145
+ F.resetForm({ values: Ce }), p(V);
6149
6146
  });
6150
6147
  return;
6151
6148
  }
6152
- N === "welcome" ? (ae(), I.resetForm({ values: T })) : N === "details" ? u || A.inUse ? (I.resetForm({ values: T }), ae()) : t ? tt(T).then((D) => {
6153
- I.resetForm({
6154
- values: D ?? T,
6149
+ x === "welcome" ? (ae(), F.resetForm({ values: V })) : x === "details" ? u || z.inUse ? (F.resetForm({ values: V }), ae()) : t ? tt(V).then((R) => {
6150
+ F.resetForm({
6151
+ values: R ?? V,
6155
6152
  touched: {
6156
6153
  path: !0,
6157
6154
  name: !0
@@ -6159,65 +6156,65 @@ function sr({
6159
6156
  });
6160
6157
  }).finally(() => {
6161
6158
  ae();
6162
- }) : (I.resetForm({ values: T }), ae()) : N === "extra_view" ? (ae(), I.resetForm({ values: T })) : N === "import_data_mapping" || N === "import_data_preview" ? ae() : N === "properties" ? fe(T).then(() => {
6163
- I.resetForm({ values: Ce }), ae(), p(T);
6164
- }) : (ae(), I.resetForm({ values: T }));
6165
- } catch (D) {
6166
- E.open({
6159
+ }) : (F.resetForm({ values: V }), ae()) : x === "extra_view" ? (ae(), F.resetForm({ values: V })) : x === "import_data_mapping" || x === "import_data_preview" ? ae() : x === "properties" ? be(V).then(() => {
6160
+ F.resetForm({ values: Ce }), ae(), p(V);
6161
+ }) : (ae(), F.resetForm({ values: V }));
6162
+ } catch (R) {
6163
+ B.open({
6167
6164
  type: "error",
6168
- message: "Error persisting collection: " + (D.message ?? "Details in the console")
6169
- }), console.error(D), I.resetForm({ values: T });
6165
+ message: "Error persisting collection: " + (R.message ?? "Details in the console")
6166
+ }), console.error(R), F.resetForm({ values: V });
6170
6167
  }
6171
6168
  };
6172
- return !t && (!x.initialised || !W) ? /* @__PURE__ */ e(Dt, {}) : /* @__PURE__ */ e($e, { fullHeight: !0, children: /* @__PURE__ */ e(
6173
- qt,
6169
+ return !t && (!k.initialised || !Q) ? /* @__PURE__ */ e(Et, {}) : /* @__PURE__ */ e($e, { fullHeight: !0, children: /* @__PURE__ */ e(
6170
+ St,
6174
6171
  {
6175
6172
  initialValues: Ce,
6176
- validationSchema: (N === "properties" || N === "subcollections" || N === "details") && bi,
6177
- validate: (T) => {
6178
- if (N === "properties")
6179
- return V.current;
6180
- const I = {};
6181
- if (N === "details") {
6182
- const D = cr(T.path, t, q, T.id);
6183
- D && (I.path = D);
6184
- const Oe = dr(T.id, t, q, F);
6185
- Oe && (I.id = Oe);
6173
+ validationSchema: (x === "properties" || x === "subcollections" || x === "details") && yi,
6174
+ validate: (V) => {
6175
+ if (x === "properties")
6176
+ return N.current;
6177
+ const F = {};
6178
+ if (x === "details") {
6179
+ const R = cr(V.path, t, A, V.id);
6180
+ R && (F.path = R);
6181
+ const Oe = dr(V.id, t, A, E);
6182
+ Oe && (F.id = Oe);
6186
6183
  }
6187
- return I;
6184
+ return F;
6188
6185
  },
6189
6186
  onSubmit: bt,
6190
- children: (T) => {
6187
+ children: (V) => {
6191
6188
  const {
6192
- values: I,
6193
- setFieldValue: D,
6189
+ values: F,
6190
+ setFieldValue: R,
6194
6191
  isSubmitting: Oe,
6195
6192
  dirty: at,
6196
- submitCount: z
6197
- } = T, j = I.path ?? r, G = o?.includes("/") ? o?.split("/").slice(0, -1).join("/") + "/" + j : j, se = x.resolveAliasesFrom(G), le = se && O ? () => O(se) : void 0;
6193
+ submitCount: T
6194
+ } = V, D = F.path ?? r, H = o?.includes("/") ? o?.split("/").slice(0, -1).join("/") + "/" + D : D, se = k.resolveAliasesFrom(H), le = se && O ? () => O(se) : void 0;
6198
6195
  pe(() => {
6199
- d(at);
6196
+ c(at);
6200
6197
  }, [at]);
6201
- function ve(Z) {
6202
- A.setInUse(!0), ai(Z, ia).then((Ie) => {
6203
- const Fe = da(Ie);
6204
- D("properties", Fe.properties), D("propertiesOrder", Object.keys(Fe.properties)), A.setIdColumn(Fe.idColumn), A.setImportData(Z), A.setHeadersMapping(Fe.headersMapping), A.setOriginProperties(Fe.properties);
6198
+ function we(W) {
6199
+ z.setInUse(!0), ii(W, ia).then((Ie) => {
6200
+ const Fe = pa(Ie);
6201
+ R("properties", Fe.properties), R("propertiesOrder", Object.keys(Fe.properties)), z.setIdColumn(Fe.idColumn), z.setImportData(W), z.setHeadersMapping(Fe.headersMapping), z.setOriginProperties(Fe.properties);
6205
6202
  });
6206
6203
  }
6207
- const yt = !!I.name && !!I.id, it = () => {
6208
- const Z = { ...I.properties };
6209
- A.idColumn && delete Z[A.idColumn], D("properties", Z), ae(), console.log("onImportMappingComplete", {
6210
- importConfig: A,
6211
- properties: Z
6204
+ const yt = !!F.name && !!F.id, it = () => {
6205
+ const W = { ...F.properties };
6206
+ z.idColumn && delete W[z.idColumn], R("properties", W), ae(), console.log("onImportMappingComplete", {
6207
+ importConfig: z,
6208
+ properties: W
6212
6209
  });
6213
- }, vt = Q?.editable || t;
6214
- return /* @__PURE__ */ n(M, { children: [
6210
+ }, vt = X?.editable || t;
6211
+ return /* @__PURE__ */ n($, { children: [
6215
6212
  !t && /* @__PURE__ */ n(
6216
- Ua,
6213
+ $a,
6217
6214
  {
6218
- value: N,
6219
- className: ke(Nt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
6220
- onValueChange: (Z) => R(Z),
6215
+ value: x,
6216
+ className: xe(Nt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
6217
+ onValueChange: (W) => I(W),
6221
6218
  children: [
6222
6219
  /* @__PURE__ */ e(_t, { value: "details", children: "Details" }),
6223
6220
  /* @__PURE__ */ e(_t, { value: "properties", children: "Properties" }),
@@ -6226,130 +6223,130 @@ function sr({
6226
6223
  }
6227
6224
  ),
6228
6225
  /* @__PURE__ */ n(
6229
- Za,
6226
+ Xa,
6230
6227
  {
6231
6228
  noValidate: !0,
6232
- className: ke(
6229
+ className: xe(
6233
6230
  t ? "h-full" : "h-[calc(100%-48px)]",
6234
6231
  "flex-grow flex flex-col relative"
6235
6232
  ),
6236
6233
  children: [
6237
- N === "loading" && /* @__PURE__ */ e(Dt, {}),
6238
- N === "extra_view" && j && u?.View && /* @__PURE__ */ e(u.View, { path: j }),
6239
- N === "welcome" && /* @__PURE__ */ e(
6240
- tr,
6234
+ x === "loading" && /* @__PURE__ */ e(Et, {}),
6235
+ x === "extra_view" && D && u?.View && /* @__PURE__ */ e(u.View, { path: D }),
6236
+ x === "welcome" && /* @__PURE__ */ e(
6237
+ ir,
6241
6238
  {
6242
- path: j,
6243
- onContinue: (Z) => {
6244
- Z ? (ve(Z), R("import_data_mapping")) : R("details");
6239
+ path: D,
6240
+ onContinue: (W) => {
6241
+ W ? (we(W), I("import_data_mapping")) : I("details");
6245
6242
  },
6246
- collections: _,
6243
+ collections: v,
6247
6244
  parentCollection: b,
6248
- pathSuggestions: f
6245
+ pathSuggestions: y
6249
6246
  }
6250
6247
  ),
6251
- N === "import_data_mapping" && A && /* @__PURE__ */ e(
6248
+ x === "import_data_mapping" && z && /* @__PURE__ */ e(
6252
6249
  rr,
6253
6250
  {
6254
- importConfig: A,
6251
+ importConfig: z,
6255
6252
  collectionEditable: vt,
6256
- propertyConfigs: k
6253
+ propertyConfigs: w
6257
6254
  }
6258
6255
  ),
6259
- N === "import_data_preview" && A && /* @__PURE__ */ e(
6256
+ x === "import_data_preview" && z && /* @__PURE__ */ e(
6260
6257
  nr,
6261
6258
  {
6262
- importConfig: A,
6263
- properties: I.properties,
6264
- propertiesOrder: I.propertiesOrder
6259
+ importConfig: z,
6260
+ properties: F.properties,
6261
+ propertiesOrder: F.propertiesOrder
6265
6262
  }
6266
6263
  ),
6267
- N === "import_data_saving" && A && /* @__PURE__ */ e(
6268
- gi,
6264
+ x === "import_data_saving" && z && /* @__PURE__ */ e(
6265
+ fi,
6269
6266
  {
6270
- importConfig: A,
6271
- collection: I,
6272
- onImportSuccess: (Z) => {
6273
- p(Z), E.open({
6267
+ importConfig: z,
6268
+ collection: F,
6269
+ onImportSuccess: (W) => {
6270
+ p(W), B.open({
6274
6271
  type: "info",
6275
6272
  message: "Data imported successfully"
6276
6273
  });
6277
6274
  }
6278
6275
  }
6279
6276
  ),
6280
- N === "details" && /* @__PURE__ */ e(
6281
- wi,
6277
+ x === "details" && /* @__PURE__ */ e(
6278
+ _i,
6282
6279
  {
6283
- existingPaths: q,
6284
- existingIds: F,
6285
- groups: S,
6280
+ existingPaths: A,
6281
+ existingIds: E,
6282
+ groups: q,
6286
6283
  parentCollection: b,
6287
6284
  isNewCollection: t
6288
6285
  }
6289
6286
  ),
6290
- N === "subcollections" && Q && /* @__PURE__ */ e(
6291
- er,
6287
+ x === "subcollections" && X && /* @__PURE__ */ e(
6288
+ ar,
6292
6289
  {
6293
6290
  parentCollection: b,
6294
6291
  configController: i,
6295
6292
  getUser: g,
6296
6293
  collectionInference: l,
6297
6294
  parentCollectionIds: s,
6298
- collection: Q
6295
+ collection: X
6299
6296
  }
6300
6297
  ),
6301
- N === "properties" && /* @__PURE__ */ e(
6302
- Wi,
6298
+ x === "properties" && /* @__PURE__ */ e(
6299
+ Xi,
6303
6300
  {
6304
- showErrors: z > 0,
6301
+ showErrors: T > 0,
6305
6302
  isNewCollection: t,
6306
6303
  reservedGroups: m,
6307
- onPropertyError: (Z, Ie, Fe) => {
6308
- V.current = $a({
6309
- ...V.current,
6310
- [Z]: Fe
6304
+ onPropertyError: (W, Ie, Fe) => {
6305
+ N.current = La({
6306
+ ...N.current,
6307
+ [W]: Fe
6311
6308
  }, !0);
6312
6309
  },
6313
6310
  getUser: g,
6314
6311
  getData: le,
6315
6312
  doCollectionInference: Ve,
6316
- propertyConfigs: k,
6313
+ propertyConfigs: w,
6317
6314
  collectionEditable: vt,
6318
6315
  extraIcon: u?.icon && /* @__PURE__ */ e(
6319
6316
  ne,
6320
6317
  {
6321
6318
  color: "primary",
6322
- onClick: () => R("extra_view"),
6319
+ onClick: () => I("extra_view"),
6323
6320
  children: u.icon
6324
6321
  }
6325
6322
  )
6326
6323
  }
6327
6324
  ),
6328
- N !== "welcome" && /* @__PURE__ */ n(
6325
+ x !== "welcome" && /* @__PURE__ */ n(
6329
6326
  Le,
6330
6327
  {
6331
6328
  position: "absolute",
6332
6329
  children: [
6333
6330
  ge && /* @__PURE__ */ e(aa, { error: ge }),
6334
- t && y && N === "import_data_mapping" && /* @__PURE__ */ n(
6335
- B,
6331
+ t && _ && x === "import_data_mapping" && /* @__PURE__ */ n(
6332
+ U,
6336
6333
  {
6337
6334
  variant: "text",
6338
6335
  type: "button",
6339
- onClick: () => (A.setInUse(!1), R("welcome")),
6336
+ onClick: () => (z.setInUse(!1), I("welcome")),
6340
6337
  children: [
6341
6338
  /* @__PURE__ */ e(rt, {}),
6342
6339
  "Back"
6343
6340
  ]
6344
6341
  }
6345
6342
  ),
6346
- t && y && N === "import_data_preview" && /* @__PURE__ */ n(
6347
- B,
6343
+ t && _ && x === "import_data_preview" && /* @__PURE__ */ n(
6344
+ U,
6348
6345
  {
6349
6346
  variant: "text",
6350
6347
  type: "button",
6351
6348
  onClick: () => {
6352
- fe(I), R("import_data_mapping");
6349
+ be(F), I("import_data_mapping");
6353
6350
  },
6354
6351
  children: [
6355
6352
  /* @__PURE__ */ e(rt, {}),
@@ -6357,24 +6354,24 @@ function sr({
6357
6354
  ]
6358
6355
  }
6359
6356
  ),
6360
- t && y && N === "details" && /* @__PURE__ */ n(
6361
- B,
6357
+ t && _ && x === "details" && /* @__PURE__ */ n(
6358
+ U,
6362
6359
  {
6363
6360
  variant: "text",
6364
6361
  type: "button",
6365
- onClick: () => R("welcome"),
6362
+ onClick: () => I("welcome"),
6366
6363
  children: [
6367
6364
  /* @__PURE__ */ e(rt, {}),
6368
6365
  "Back"
6369
6366
  ]
6370
6367
  }
6371
6368
  ),
6372
- t && N === "properties" && /* @__PURE__ */ n(
6373
- B,
6369
+ t && x === "properties" && /* @__PURE__ */ n(
6370
+ U,
6374
6371
  {
6375
6372
  variant: "text",
6376
6373
  type: "button",
6377
- onClick: () => R("details"),
6374
+ onClick: () => I("details"),
6378
6375
  children: [
6379
6376
  /* @__PURE__ */ e(rt, {}),
6380
6377
  "Back"
@@ -6382,17 +6379,17 @@ function sr({
6382
6379
  }
6383
6380
  ),
6384
6381
  /* @__PURE__ */ e(
6385
- B,
6382
+ U,
6386
6383
  {
6387
6384
  variant: "text",
6388
6385
  onClick: () => {
6389
- c();
6386
+ d();
6390
6387
  },
6391
6388
  children: "Cancel"
6392
6389
  }
6393
6390
  ),
6394
- t && N === "import_data_mapping" && /* @__PURE__ */ e(
6395
- B,
6391
+ t && x === "import_data_mapping" && /* @__PURE__ */ e(
6392
+ U,
6396
6393
  {
6397
6394
  variant: "filled",
6398
6395
  color: "primary",
@@ -6400,8 +6397,8 @@ function sr({
6400
6397
  children: "Next"
6401
6398
  }
6402
6399
  ),
6403
- t && N === "import_data_preview" && /* @__PURE__ */ e(
6404
- B,
6400
+ t && x === "import_data_preview" && /* @__PURE__ */ e(
6401
+ U,
6405
6402
  {
6406
6403
  variant: "filled",
6407
6404
  color: "primary",
@@ -6411,23 +6408,23 @@ function sr({
6411
6408
  children: "Next"
6412
6409
  }
6413
6410
  ),
6414
- t && (N === "details" || N === "properties") && /* @__PURE__ */ n(
6415
- Bt,
6411
+ t && (x === "details" || x === "properties") && /* @__PURE__ */ n(
6412
+ Dt,
6416
6413
  {
6417
6414
  variant: "filled",
6418
6415
  color: "primary",
6419
6416
  type: "submit",
6420
6417
  loading: Oe,
6421
- disabled: Oe || N === "details" && !yt,
6422
- startIcon: N === "properties" ? /* @__PURE__ */ e(La, {}) : void 0,
6418
+ disabled: Oe || x === "details" && !yt,
6419
+ startIcon: x === "properties" ? /* @__PURE__ */ e(Ka, {}) : void 0,
6423
6420
  children: [
6424
- N === "details" && "Next",
6425
- N === "properties" && "Create collection"
6421
+ x === "details" && "Next",
6422
+ x === "properties" && "Create collection"
6426
6423
  ]
6427
6424
  }
6428
6425
  ),
6429
6426
  !t && /* @__PURE__ */ e(
6430
- Bt,
6427
+ Dt,
6431
6428
  {
6432
6429
  variant: "filled",
6433
6430
  color: "primary",
@@ -6450,19 +6447,19 @@ function sr({
6450
6447
  function lr(t, a) {
6451
6448
  const { properties: i, ...r } = t, s = {};
6452
6449
  return Object.keys(i).forEach((o) => {
6453
- s[o] = ma(i[o], a);
6450
+ s[o] = ua(i[o], a);
6454
6451
  }), { ...r, properties: s };
6455
6452
  }
6456
- function ma(t, a) {
6453
+ function ua(t, a) {
6457
6454
  let i = t;
6458
6455
  if (a && typeof i == "object" && i.propertyConfig) {
6459
6456
  const r = a[i.propertyConfig];
6460
6457
  if (r && oe(r.property))
6461
6458
  i = r.property;
6462
- else if (r && (i = Y(r.property, i)), !oe(i) && i.dataType === "map" && i.properties) {
6459
+ else if (r && (i = G(r.property, i)), !oe(i) && i.dataType === "map" && i.properties) {
6463
6460
  const s = {};
6464
6461
  Object.keys(i.properties).forEach((o) => {
6465
- s[o] = ma(i.properties[o], a);
6462
+ s[o] = ua(i.properties[o], a);
6466
6463
  }), i = { ...i, properties: s };
6467
6464
  }
6468
6465
  }
@@ -6476,7 +6473,7 @@ const cr = (t, a, i, r) => {
6476
6473
  return;
6477
6474
  let s;
6478
6475
  return a && i?.includes(t.trim().toLowerCase()) && (s = "There is already a collection that uses this value as a path"), a && r?.includes(t.trim().toLowerCase()) && (s = "There is already a collection which uses this id"), s;
6479
- }, ua = L.createContext({}), ha = L.createContext({}), pr = L.memo(
6476
+ }, ha = K.createContext({}), ga = K.createContext({}), pr = K.memo(
6480
6477
  function({
6481
6478
  children: a,
6482
6479
  collectionConfigController: i,
@@ -6486,95 +6483,97 @@ const cr = (t, a, i, r) => {
6486
6483
  extraView: l,
6487
6484
  pathSuggestions: p,
6488
6485
  getUser: m,
6489
- getData: u
6486
+ getData: u,
6487
+ onAnalyticsEvent: d
6490
6488
  }) {
6491
- const c = Be(), d = fi(), f = De(), { propertyConfigs: g } = Ke(), {
6492
- collections: b
6493
- } = c, O = b.map((v) => v.path.trim().toLowerCase()), [k, x] = L.useState();
6489
+ const c = Be(), y = bi(), g = De(), { propertyConfigs: b } = Ke(), {
6490
+ collections: O
6491
+ } = c, w = O.map((N) => N.path.trim().toLowerCase()), [k, f] = K.useState();
6494
6492
  pe(() => {
6495
- p && p().then((v) => {
6496
- x(v.filter((V) => !O.includes(V.trim().toLowerCase())));
6493
+ p && p().then((N) => {
6494
+ f(N.filter((j) => !w.includes(j.trim().toLowerCase())));
6497
6495
  });
6498
6496
  }, [p]);
6499
- const [h, _] = L.useState(), [y, w] = L.useState(), q = X(() => ({
6497
+ const [v, _] = K.useState(), [h, A] = K.useState(), E = Z(() => ({
6500
6498
  createCollections: !0,
6501
6499
  editCollections: !0,
6502
6500
  deleteCollections: !0
6503
- }), []), F = X(({
6504
- path: v,
6505
- fullPath: V,
6506
- parentCollectionIds: J,
6507
- parentCollection: N
6501
+ }), []), z = Z(({
6502
+ path: N,
6503
+ fullPath: j,
6504
+ parentCollectionIds: x,
6505
+ parentCollection: I
6508
6506
  }) => {
6509
- _({
6510
- editedCollectionPath: v,
6511
- fullPath: V,
6512
- parentCollectionIds: J,
6507
+ console.debug("edit collection", N, j, x, I), d?.("edit_collection", { path: N, fullPath: j }), _({
6508
+ editedCollectionPath: N,
6509
+ fullPath: j,
6510
+ parentCollectionIds: x,
6513
6511
  isNewCollection: !1,
6514
- parentCollection: N,
6512
+ parentCollection: I,
6515
6513
  redirect: !1
6516
6514
  });
6517
- }, []), A = X(({
6518
- propertyKey: v,
6519
- property: V,
6520
- editedCollectionPath: J,
6521
- currentPropertiesOrder: N,
6522
- parentCollectionIds: R,
6523
- collection: ge
6515
+ }, []), q = Z(({
6516
+ propertyKey: N,
6517
+ property: j,
6518
+ editedCollectionPath: x,
6519
+ currentPropertiesOrder: I,
6520
+ parentCollectionIds: ge,
6521
+ collection: fe
6524
6522
  }) => {
6525
- const xe = v && v.includes(".") ? v.substring(0, v.lastIndexOf(".")) : void 0, Q = v && v.includes(".") ? v.substring(v.lastIndexOf(".") + 1) : v;
6526
- console.log("edit property", Q, ge), w({
6527
- propertyKey: Q,
6528
- property: V,
6529
- namespace: xe,
6530
- currentPropertiesOrder: N,
6531
- editedCollectionPath: J,
6532
- parentCollectionIds: R,
6533
- collectionEditable: ge?.editable ?? !1
6523
+ console.debug("edit property", N, j, x, I, ge, fe), d?.("edit_property", { propertyKey: N, editedCollectionPath: x });
6524
+ const X = N && N.includes(".") ? N.substring(0, N.lastIndexOf(".")) : void 0, M = N && N.includes(".") ? N.substring(N.lastIndexOf(".") + 1) : N;
6525
+ console.log("edit property", M, fe), A({
6526
+ propertyKey: M,
6527
+ property: j,
6528
+ namespace: X,
6529
+ currentPropertiesOrder: I,
6530
+ editedCollectionPath: x,
6531
+ parentCollectionIds: ge,
6532
+ collectionEditable: fe?.editable ?? !1
6534
6533
  });
6535
- }, []), S = L.useCallback(({
6536
- parentCollectionIds: v,
6537
- parentCollection: V,
6538
- initialValues: J,
6539
- redirect: N
6534
+ }, []), B = K.useCallback(({
6535
+ parentCollectionIds: N,
6536
+ parentCollection: j,
6537
+ initialValues: x,
6538
+ redirect: I
6540
6539
  }) => {
6541
- _({
6540
+ console.debug("create collection", N, j, x, I), d?.("create_collection", { parentCollectionIds: N, parentCollection: j, initialValues: x, redirect: I }), _({
6542
6541
  isNewCollection: !0,
6543
- parentCollectionIds: v,
6544
- parentCollection: V,
6545
- initialValues: J,
6546
- redirect: N
6542
+ parentCollectionIds: N,
6543
+ parentCollection: j,
6544
+ initialValues: x,
6545
+ redirect: I
6547
6546
  });
6548
- }, []), E = p ? (v) => !v && k ? Promise.resolve(k) : p?.(v) : void 0;
6549
- return /* @__PURE__ */ e(ua.Provider, { value: i, children: /* @__PURE__ */ n(
6550
- ha.Provider,
6547
+ }, []), S = p ? (N) => !N && k ? Promise.resolve(k) : p?.(N) : void 0;
6548
+ return /* @__PURE__ */ e(ha.Provider, { value: i, children: /* @__PURE__ */ n(
6549
+ ga.Provider,
6551
6550
  {
6552
6551
  value: {
6553
- editCollection: F,
6554
- createCollection: S,
6555
- editProperty: A,
6556
- configPermissions: r ?? q,
6552
+ editCollection: z,
6553
+ createCollection: B,
6554
+ editProperty: q,
6555
+ configPermissions: r ?? E,
6557
6556
  rootPathSuggestions: k
6558
6557
  },
6559
6558
  children: [
6560
6559
  a,
6561
6560
  /* @__PURE__ */ e(
6562
- pa,
6561
+ ma,
6563
6562
  {
6564
- open: !!h,
6563
+ open: !!v,
6565
6564
  configController: i,
6566
6565
  isNewCollection: !1,
6567
6566
  collectionInference: o,
6568
- ...h,
6567
+ ...v,
6569
6568
  getData: u,
6570
6569
  reservedGroups: s,
6571
6570
  extraView: l,
6572
- pathSuggestions: E,
6571
+ pathSuggestions: S,
6573
6572
  getUser: m,
6574
- handleClose: (v) => {
6575
- if (h?.redirect && v && h?.isNewCollection && !h.parentCollectionIds.length) {
6576
- const V = c.buildUrlCollectionPath(v.id ?? v.path);
6577
- d(V);
6573
+ handleClose: (N) => {
6574
+ if (v?.redirect && N && v?.isNewCollection && !v.parentCollectionIds.length) {
6575
+ const j = c.buildUrlCollectionPath(N.id ?? N.path);
6576
+ y(j);
6578
6577
  }
6579
6578
  _(void 0);
6580
6579
  }
@@ -6583,69 +6582,69 @@ const cr = (t, a, i, r) => {
6583
6582
  /* @__PURE__ */ e(
6584
6583
  je,
6585
6584
  {
6586
- open: !!y,
6585
+ open: !!h,
6587
6586
  includeIdAndName: !0,
6588
- existingProperty: !!y?.propertyKey,
6589
- autoUpdateId: y ? !y?.propertyKey : !1,
6590
- autoOpenTypeSelect: y ? !y?.propertyKey : !1,
6587
+ existingProperty: !!h?.propertyKey,
6588
+ autoUpdateId: h ? !h?.propertyKey : !1,
6589
+ autoOpenTypeSelect: h ? !h?.propertyKey : !1,
6591
6590
  inArray: !1,
6592
- collectionEditable: y?.collectionEditable ?? !1,
6593
- getData: u && y?.editedCollectionPath ? () => {
6594
- const v = c.resolveAliasesFrom(y.editedCollectionPath);
6595
- return u(v);
6591
+ collectionEditable: h?.collectionEditable ?? !1,
6592
+ getData: u && h?.editedCollectionPath ? () => {
6593
+ const N = c.resolveAliasesFrom(h.editedCollectionPath);
6594
+ return u(N);
6596
6595
  } : void 0,
6597
6596
  onPropertyChanged: ({
6598
- id: v,
6599
- property: V
6597
+ id: N,
6598
+ property: j
6600
6599
  }) => {
6601
- if (!y || !v)
6600
+ if (!h || !N)
6602
6601
  return;
6603
- const J = !y.propertyKey;
6602
+ const x = !h.propertyKey;
6604
6603
  return i.saveProperty({
6605
- path: y?.editedCollectionPath,
6606
- property: V,
6607
- propertyKey: v,
6608
- newPropertiesOrder: J && y.currentPropertiesOrder ? [...y.currentPropertiesOrder, v] : void 0,
6609
- namespace: y.namespace,
6610
- parentCollectionIds: y.parentCollectionIds
6611
- }).catch((N) => (console.error(N), f.open({
6604
+ path: h?.editedCollectionPath,
6605
+ property: j,
6606
+ propertyKey: N,
6607
+ newPropertiesOrder: x && h.currentPropertiesOrder ? [...h.currentPropertiesOrder, N] : void 0,
6608
+ namespace: h.namespace,
6609
+ parentCollectionIds: h.parentCollectionIds
6610
+ }).catch((I) => (console.error(I), g.open({
6612
6611
  type: "error",
6613
- message: "Error persisting property: " + (N.message ?? "Details in the console")
6612
+ message: "Error persisting property: " + (I.message ?? "Details in the console")
6614
6613
  }), !1));
6615
6614
  },
6616
6615
  onPropertyChangedImmediate: !1,
6617
6616
  onDelete: () => {
6618
- if (!y?.propertyKey)
6617
+ if (!h?.propertyKey)
6619
6618
  return;
6620
- const v = y?.currentPropertiesOrder?.filter((V) => V !== y?.propertyKey);
6619
+ const N = h?.currentPropertiesOrder?.filter((j) => j !== h?.propertyKey);
6621
6620
  return i.deleteProperty({
6622
- path: y?.editedCollectionPath,
6623
- propertyKey: y?.propertyKey,
6624
- namespace: y?.namespace,
6625
- newPropertiesOrder: v,
6626
- parentCollectionIds: y?.parentCollectionIds
6621
+ path: h?.editedCollectionPath,
6622
+ propertyKey: h?.propertyKey,
6623
+ namespace: h?.namespace,
6624
+ newPropertiesOrder: N,
6625
+ parentCollectionIds: h?.parentCollectionIds
6627
6626
  }).then(() => {
6628
- w(void 0);
6629
- }).catch((V) => (console.error(V), f.open({
6627
+ A(void 0);
6628
+ }).catch((j) => (console.error(j), g.open({
6630
6629
  type: "error",
6631
- message: "Error deleting property: " + (V.message ?? "Details in the console")
6630
+ message: "Error deleting property: " + (j.message ?? "Details in the console")
6632
6631
  }), !1));
6633
6632
  },
6634
6633
  onError: () => {
6635
6634
  },
6636
6635
  onOkClicked: () => {
6637
- w(void 0);
6636
+ A(void 0);
6638
6637
  },
6639
6638
  onCancel: () => {
6640
- w(void 0);
6639
+ A(void 0);
6641
6640
  },
6642
6641
  initialErrors: {},
6643
6642
  forceShowErrors: !1,
6644
6643
  existingPropertyKeys: [],
6645
6644
  allowDataInference: !0,
6646
- propertyConfigs: g,
6647
- property: y?.property,
6648
- propertyKey: y?.propertyKey
6645
+ propertyConfigs: b,
6646
+ property: h?.property,
6647
+ propertyKey: h?.propertyKey
6649
6648
  }
6650
6649
  )
6651
6650
  ]
@@ -6653,24 +6652,24 @@ const cr = (t, a, i, r) => {
6653
6652
  ) });
6654
6653
  },
6655
6654
  ut
6656
- ), Re = () => Gt(ha), ga = () => Gt(ua);
6655
+ ), Re = () => Yt(ga), fa = () => Yt(ha);
6657
6656
  function mr({
6658
6657
  path: t,
6659
6658
  parentCollectionIds: a,
6660
6659
  collection: i,
6661
6660
  tableController: r
6662
6661
  }) {
6663
- const s = Ye(), o = Be(), l = Re(), p = ga(), m = De(), u = o.getCollectionFromIds(a), c = l.configPermissions ? l.configPermissions({
6662
+ const s = Ye(), o = Be(), l = Re(), p = fa(), m = De(), u = o.getCollectionFromIds(a), d = l.configPermissions ? l.configPermissions({
6664
6663
  user: s.user,
6665
6664
  collection: i
6666
6665
  }).editCollections : !0;
6667
- let d = null;
6668
- return (!ut(st(r.filterValues), st(i.initialFilter)) || !ut(st(r.sortBy), st(i.initialSort))) && (d = /* @__PURE__ */ e(
6666
+ let c = null;
6667
+ return (!ut(st(r.filterValues), st(i.initialFilter)) || !ut(st(r.sortBy), st(i.initialSort))) && (c = /* @__PURE__ */ e(
6669
6668
  re,
6670
6669
  {
6671
6670
  title: r.sortBy || r.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
6672
6671
  children: /* @__PURE__ */ e(
6673
- B,
6672
+ U,
6674
6673
  {
6675
6674
  color: "primary",
6676
6675
  size: "small",
@@ -6678,7 +6677,7 @@ function mr({
6678
6677
  onClick: () => p?.saveCollection({
6679
6678
  id: i.path,
6680
6679
  parentCollectionIds: a,
6681
- collectionData: Y(
6680
+ collectionData: G(
6682
6681
  i,
6683
6682
  {
6684
6683
  initialFilter: r.filterValues ?? null,
@@ -6691,22 +6690,22 @@ function mr({
6691
6690
  message: "Default config saved"
6692
6691
  });
6693
6692
  }),
6694
- children: /* @__PURE__ */ e(Ka, {})
6693
+ children: /* @__PURE__ */ e(Ya, {})
6695
6694
  }
6696
6695
  )
6697
6696
  }
6698
- )), /* @__PURE__ */ n(M, { children: [
6699
- c && d,
6697
+ )), /* @__PURE__ */ n($, { children: [
6698
+ d && c,
6700
6699
  /* @__PURE__ */ e(
6701
6700
  re,
6702
6701
  {
6703
- title: c ? "Edit collection" : "You don't have permissions to edit this collection",
6702
+ title: d ? "Edit collection" : "You don't have permissions to edit this collection",
6704
6703
  children: /* @__PURE__ */ e(
6705
6704
  ne,
6706
6705
  {
6707
6706
  color: "primary",
6708
- disabled: !c,
6709
- onClick: c ? () => l?.editCollection({ path: i.path, fullPath: t, parentCollectionIds: a, parentCollection: u }) : void 0,
6707
+ disabled: !d,
6708
+ onClick: d ? () => l?.editCollection({ path: i.path, fullPath: t, parentCollectionIds: a, parentCollection: u }) : void 0,
6710
6709
  children: /* @__PURE__ */ e(Qe, {})
6711
6710
  }
6712
6711
  )
@@ -6721,12 +6720,12 @@ function ur({
6721
6720
  path: t,
6722
6721
  collection: a
6723
6722
  }) {
6724
- const i = De(), r = Ye(), s = ga(), o = Re(), l = o.configPermissions({
6723
+ const i = De(), r = Ye(), s = fa(), o = Re(), l = o.configPermissions({
6725
6724
  user: r.user,
6726
6725
  collection: a
6727
- }), p = X(() => {
6726
+ }), p = Z(() => {
6728
6727
  o?.editCollection({ path: t, parentCollectionIds: [] });
6729
- }, [o, t]), [m, u] = $(!1), c = X(() => {
6728
+ }, [o, t]), [m, u] = L(!1), d = Z(() => {
6730
6729
  s?.deleteCollection({ path: t }).then(() => {
6731
6730
  u(!1), i.open({
6732
6731
  message: "Collection deleted",
@@ -6734,14 +6733,14 @@ function ur({
6734
6733
  });
6735
6734
  });
6736
6735
  }, [t, s]);
6737
- return /* @__PURE__ */ n(M, { children: [
6736
+ return /* @__PURE__ */ n($, { children: [
6738
6737
  /* @__PURE__ */ n("div", { children: [
6739
6738
  l.deleteCollections && /* @__PURE__ */ e(
6740
- Ya,
6739
+ Ga,
6741
6740
  {
6742
- trigger: /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(Ga, { size: "small" }) }),
6743
- children: /* @__PURE__ */ n(Ha, { onClick: (d) => {
6744
- d.preventDefault(), d.stopPropagation(), u(!0);
6741
+ trigger: /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(Ha, { size: "small" }) }),
6742
+ children: /* @__PURE__ */ n(Ja, { onClick: (c) => {
6743
+ c.preventDefault(), c.stopPropagation(), u(!0);
6745
6744
  }, children: [
6746
6745
  /* @__PURE__ */ e(pt, {}),
6747
6746
  "Delete"
@@ -6751,7 +6750,7 @@ function ur({
6751
6750
  l.editCollections && /* @__PURE__ */ e(
6752
6751
  ne,
6753
6752
  {
6754
- onClick: (d) => {
6753
+ onClick: (c) => {
6755
6754
  p();
6756
6755
  },
6757
6756
  children: /* @__PURE__ */ e(Qe, { size: "small" })
@@ -6762,10 +6761,10 @@ function ur({
6762
6761
  mt,
6763
6762
  {
6764
6763
  open: m,
6765
- onAccept: c,
6764
+ onAccept: d,
6766
6765
  onCancel: () => u(!1),
6767
- title: /* @__PURE__ */ e(M, { children: "Delete this collection?" }),
6768
- body: /* @__PURE__ */ n(M, { children: [
6766
+ title: /* @__PURE__ */ e($, { children: "Delete this collection?" }),
6767
+ body: /* @__PURE__ */ n($, { children: [
6769
6768
  " This will ",
6770
6769
  /* @__PURE__ */ e("b", { children: "not delete any data" }),
6771
6770
  ", only the collection in the CMS"
@@ -6786,7 +6785,7 @@ function hr({
6786
6785
  return /* @__PURE__ */ e(
6787
6786
  ta,
6788
6787
  {
6789
- className: ke("h-full p-4 min-h-[124px]"),
6788
+ className: xe("h-full p-4 min-h-[124px]"),
6790
6789
  onClick: r && s ? () => r.createCollection({
6791
6790
  initialValues: t ? { group: t } : void 0,
6792
6791
  parentCollectionIds: [],
@@ -6819,7 +6818,7 @@ function gr() {
6819
6818
  user: t.user
6820
6819
  }).createCollections : !0, s = i.rootPathSuggestions ?? [], o = s.length > 3 || a.collections.length === 0 && s.length > 0;
6821
6820
  return /* @__PURE__ */ e(
6822
- Ja,
6821
+ Qa,
6823
6822
  {
6824
6823
  in: o,
6825
6824
  children: /* @__PURE__ */ n(
@@ -6838,7 +6837,7 @@ function gr() {
6838
6837
  icon: /* @__PURE__ */ e(Ae, { size: "small" }),
6839
6838
  colorScheme: "cyanLighter",
6840
6839
  onClick: i && r ? () => i.createCollection({
6841
- initialValues: { path: l, name: St(l) },
6840
+ initialValues: { path: l, name: Pt(l) },
6842
6841
  parentCollectionIds: [],
6843
6842
  redirect: !0
6844
6843
  }) : void 0,
@@ -6898,7 +6897,7 @@ function br({
6898
6897
  s.editProperty({
6899
6898
  editedCollectionPath: t,
6900
6899
  parentCollectionIds: a,
6901
- currentPropertiesOrder: Qa(i),
6900
+ currentPropertiesOrder: Wa(i),
6902
6901
  collection: i
6903
6902
  });
6904
6903
  },
@@ -6915,14 +6914,15 @@ function Ar({
6915
6914
  pathSuggestions: o,
6916
6915
  getUser: l,
6917
6916
  collectionInference: p,
6918
- getData: m
6917
+ getData: m,
6918
+ onAnalyticsEvent: u
6919
6919
  }) {
6920
- const u = X(
6920
+ const d = Z(
6921
6921
  (c) => {
6922
- const d = (g) => {
6923
- et(g.properties), g.subcollections?.forEach(d);
6924
- }, f = t.collections ?? [];
6925
- return f.forEach(d), Wa(c, f, [], a);
6922
+ const y = (b) => {
6923
+ et(b.properties), b.subcollections?.forEach(y);
6924
+ }, g = t.collections ?? [];
6925
+ return g.forEach(y), Za(c, g, [], a);
6926
6926
  },
6927
6927
  [t.collections, a]
6928
6928
  );
@@ -6930,7 +6930,7 @@ function Ar({
6930
6930
  name: "Collection Editor",
6931
6931
  loading: t.loading,
6932
6932
  collections: {
6933
- injectCollections: u,
6933
+ injectCollections: d,
6934
6934
  CollectionActions: mr
6935
6935
  },
6936
6936
  provider: {
@@ -6943,7 +6943,8 @@ function Ar({
6943
6943
  extraView: s,
6944
6944
  pathSuggestions: o,
6945
6945
  getUser: l,
6946
- getData: m
6946
+ getData: m,
6947
+ onAnalyticsEvent: u
6947
6948
  }
6948
6949
  },
6949
6950
  homePage: {
@@ -6962,14 +6963,14 @@ function zr({ path: t }) {
6962
6963
  return /* @__PURE__ */ n("div", { className: "p-1 flex flex-col items-center", children: [
6963
6964
  /* @__PURE__ */ e(aa, { error: "No collection for path: " + i }),
6964
6965
  /* @__PURE__ */ e(
6965
- B,
6966
+ U,
6966
6967
  {
6967
6968
  className: "mx-2",
6968
6969
  variant: "outlined",
6969
6970
  size: "small",
6970
6971
  onClick: () => {
6971
6972
  s.createCollection({
6972
- initialValues: { path: i, name: St(i) },
6973
+ initialValues: { path: i, name: Pt(i) },
6973
6974
  parentCollectionIds: r,
6974
6975
  redirect: !1
6975
6976
  });
@@ -6987,12 +6988,12 @@ export {
6987
6988
  zr as MissingReferenceWidget,
6988
6989
  Je as editableProperty,
6989
6990
  ce as getFullId,
6990
- _e as idToPropertiesPath,
6991
- Ne as namespaceToPropertiesOrderPath,
6992
- _i as namespaceToPropertiesPath,
6993
- Si as removeNonEditableProperties,
6991
+ ke as idToPropertiesPath,
6992
+ Pe as namespaceToPropertiesOrderPath,
6993
+ ki as namespaceToPropertiesPath,
6994
+ qi as removeNonEditableProperties,
6994
6995
  Re as useCollectionEditorController,
6995
6996
  Ar as useCollectionEditorPlugin,
6996
- ga as useCollectionsConfigController
6997
+ fa as useCollectionsConfigController
6997
6998
  };
6998
6999
  //# sourceMappingURL=index.es.js.map