@framework-m/desk 0.15.0 → 0.16.0

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.js CHANGED
@@ -5,7 +5,7 @@ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
5
5
  import E from "ajv";
6
6
  import { JSONSchemaBridge as D } from "uniforms-bridge-json-schema";
7
7
  import { BaseForm as O, connectField as k, filterDOMProps as A, useForm as j } from "uniforms";
8
- import { Avatar as M, Button as N, Card as P, DatePicker as F, Drawer as I, Heading as L, Icon as R, Input as z, LocaleSwitcher as B, MProvider as V, MStack as H, MText as U, Modal as ee, Paragraph as W, Popover as te, Select as G, Separator as ne, Skeleton as K, ThemeProvider as re, XStack as q, YStack as J, useTheme as Y } from "@framework-m/ui";
8
+ import { Avatar as M, Button as N, Card as P, DatePicker as F, Drawer as I, Heading as L, Icon as R, Input as z, LocaleSwitcher as B, MProvider as V, MStack as H, MText as U, Modal as ee, Paragraph as W, Popover as te, Select as ne, Separator as G, Skeleton as K, ThemeProvider as re, XStack as q, YStack as J, useTheme as Y } from "@framework-m/ui";
9
9
  import { Authenticated as ie, QS_PARSE_DEPTH as ae, Refine as oe, ResourceContext as se, matchResourceFromRoute as ce, useBreadcrumb as le, useCreate as ue, useDelete as de, useDeleteMany as fe, useGetIdentity as pe, useGo as me, useInvalidate as he, useList as ge, useLogin as _e, useLogout as ve, useMenu as ye, useOne as be, useUpdate as xe, useUpdateMany as Se } from "@refinedev/core";
10
10
  import { Link as Ce, NavLink as X, Navigate as we, Outlet as Te, Route as Z, RouterProvider as Ee, Routes as De, createBrowserRouter as Oe, matchPath as ke, useBlocker as Ae, useLocation as je, useNavigate as Me, useParams as Ne, useSearchParams as Pe } from "react-router";
11
11
  import { I18nextProvider as Fe, initReactI18next as Ie, useTranslation as Le } from "react-i18next";
@@ -913,32 +913,67 @@ function en({ doctype: e, id: t } = {}) {
913
913
  resource: r,
914
914
  id: i ?? "",
915
915
  queryOptions: { enabled: l }
916
- }), d = ue(), f = xe(), { state: m } = Qt(r, i, { enabled: l }), [_, y] = v({}), [b, x] = v([]), [S] = v([]), [C, w] = v(null);
916
+ }), d = ue(), f = xe(), { state: m } = Qt(r, i, { enabled: l }), [y] = Pe(), b = y.get("form"), x = _(b), S = _(i), C = _(r), [w, T] = v(() => {
917
+ if (!l && b) try {
918
+ return JSON.parse(b);
919
+ } catch (e) {
920
+ console.error("Failed to parse form query parameter:", e);
921
+ }
922
+ return {};
923
+ }), [E, D] = v([]), [O] = v([]), [k, A] = v(null);
917
924
  h(() => {
918
- y({}), x([]), w(null);
919
- }, [i, r]);
920
- let T = u?.result ?? u?.query?.data?.data, E = Object.keys(_).length > 0 || !u?.query?.isSuccess ? _ : T ?? {}, D = d.mutation.isPending || f.mutation.isPending, O = Number(E.docstatus), k = O === 1 || O === 2, A = Me(), j = $t("resolveListRoute"), M = p(async (e) => {
925
+ let e = S.current !== i || C.current !== r, t = b !== x.current;
926
+ if (e || t) {
927
+ S.current = i, C.current = r, x.current = b;
928
+ let e = {};
929
+ if (!l && b) try {
930
+ e = JSON.parse(b);
931
+ } catch (e) {
932
+ console.error("Failed to parse form query parameter:", e);
933
+ }
934
+ T(e), D([]), A(null);
935
+ }
936
+ }, [
937
+ i,
938
+ r,
939
+ l,
940
+ b
941
+ ]);
942
+ let j = u?.result ?? u?.query?.data?.data, M = Object.keys(w).length > 0 || !u?.query?.isSuccess ? w : j ?? {}, N = d.mutation.isPending || f.mutation.isPending, P = Number(M.docstatus), F = P === 1 || P === 2, I = Me(), L = $t("resolveListRoute"), R = $t("resolveEditRoute"), z = $t("resolveDetailRoute"), B = p(async (e) => {
921
943
  try {
922
- let { _is_new: t, ...n } = E || {}, a = {
923
- onSuccess: () => {
924
- y({});
925
- let t = i === "singleton" || c?.is_singleton;
926
- if (!e?.preventNavigation && !t) {
944
+ let { _is_new: t, ...n } = M || {}, a = {
945
+ onSuccess: (t) => {
946
+ T({});
947
+ let n = i === "singleton" || c?.is_singleton;
948
+ if (!l && !n) {
949
+ let n = t, i = n?.data?.id ?? n?.id;
950
+ if (i && e?.preventNavigation) {
951
+ let e = R ? R(r, i) : z ? z(r, i) : null;
952
+ I(typeof e == "string" ? e : `/app/${r}/edit/${i}`, { replace: !0 });
953
+ } else {
954
+ if (typeof window < "u" && window.location.hash === "#_editing") {
955
+ let e = window.location.pathname + window.location.search;
956
+ window.history.replaceState(null, "", e);
957
+ }
958
+ let e = L ? L(r) : null;
959
+ I(typeof e == "string" ? e : `/app/${r}/list`);
960
+ }
961
+ } else if (!e?.preventNavigation && !n) {
927
962
  if (typeof window < "u" && window.location.hash === "#_editing") {
928
963
  let e = window.location.pathname + window.location.search;
929
964
  window.history.replaceState(null, "", e);
930
965
  }
931
- let e = j ? j(r) : null;
932
- A(typeof e == "string" ? e : `/app/${r}/list`);
966
+ let e = L ? L(r) : null;
967
+ I(typeof e == "string" ? e : `/app/${r}/list`);
933
968
  }
934
969
  },
935
970
  onError: (e) => {
936
971
  let t = e?.validation_errors || e?.response?.data?.validation_errors || e?.response?.validation_errors;
937
- t && typeof t == "object" ? (w({ details: Object.entries(t).map(([e, t]) => ({
972
+ t && typeof t == "object" ? (A({ details: Object.entries(t).map(([e, t]) => ({
938
973
  dataPath: e === "base" ? "" : `.${e}`,
939
974
  message: String(t),
940
975
  keyword: "custom"
941
- })) }), x([])) : (w(null), x([e?.message || "An error occurred during save."]));
976
+ })) }), D([])) : (A(null), D([e?.message || "An error occurred during save."]));
942
977
  }
943
978
  };
944
979
  l ? f.mutate({
@@ -950,77 +985,77 @@ function en({ doctype: e, id: t } = {}) {
950
985
  values: n
951
986
  }, a);
952
987
  } catch (e) {
953
- x([e.message]);
988
+ D([e.message]);
954
989
  }
955
990
  }, [
956
991
  r,
957
992
  i,
958
993
  l,
959
- E,
960
- A,
961
- j,
994
+ M,
995
+ I,
996
+ L,
962
997
  f,
963
998
  d,
964
999
  c?.is_singleton
965
- ]), N = p(() => {
1000
+ ]), V = p(() => {
966
1001
  if (typeof window < "u" && window.location.hash === "#_editing") {
967
1002
  let e = window.location.pathname + window.location.search;
968
1003
  window.history.replaceState(null, "", e);
969
1004
  }
970
1005
  if (i === "singleton" || c?.is_singleton) {
971
- A("/app/dashboard");
1006
+ I("/app/dashboard");
972
1007
  return;
973
1008
  }
974
- let e = j ? j(r) : null;
975
- A(typeof e == "string" ? e : `/app/${r}/list`);
1009
+ let e = L ? L(r) : null;
1010
+ I(typeof e == "string" ? e : `/app/${r}/list`);
976
1011
  }, [
977
- A,
1012
+ I,
978
1013
  r,
979
- j,
1014
+ L,
980
1015
  i,
981
1016
  c?.is_singleton
982
- ]), P = p(async () => {
1017
+ ]), H = p(async () => {
983
1018
  await u?.query?.refetch?.();
984
1019
  }, [u]);
985
1020
  return {
986
1021
  doctype: r,
987
1022
  id: i,
988
1023
  frm: g(() => ({
989
- doc: E,
1024
+ doc: M,
990
1025
  setDoc: (e) => {
991
- y(typeof e == "function" ? (t) => e(t) : (t) => ({
1026
+ T(typeof e == "function" ? (t) => e(t) : (t) => ({
992
1027
  ...t,
993
1028
  ...e
994
- })), x([]), w(null);
1029
+ })), D([]), A(null);
995
1030
  },
996
- save: M,
997
- cancel: N,
1031
+ save: B,
1032
+ cancel: V,
998
1033
  isEditing: l,
999
- isSaving: D,
1000
- isLocked: k,
1001
- errors: b,
1002
- validationError: C,
1003
- notices: S,
1034
+ isSaving: N,
1035
+ isLocked: F,
1036
+ errors: E,
1037
+ validationError: k,
1038
+ notices: O,
1004
1039
  workflow: m,
1005
- refetch: P
1040
+ refetch: H
1006
1041
  }), [
1007
- E,
1008
1042
  M,
1009
- N,
1043
+ B,
1044
+ V,
1010
1045
  l,
1011
- D,
1046
+ N,
1047
+ F,
1048
+ E,
1012
1049
  k,
1013
- b,
1014
- C,
1015
- S,
1050
+ O,
1016
1051
  m,
1017
- P
1052
+ H
1018
1053
  ]),
1019
1054
  schema: a,
1020
1055
  metaLoading: o || l && u?.query?.isLoading,
1021
1056
  metaError: s,
1022
1057
  docError: u?.query?.error,
1023
- record: T
1058
+ record: j
1024
1059
  };
1025
1060
  }
1026
1061
  //#endregion
@@ -1754,7 +1789,7 @@ function En({ meta: e, uiMeta: t, frm: n, id: r }) {
1754
1789
  collapsible: t.collapsible,
1755
1790
  defaultCollapsed: t.collapsed_by_default,
1756
1791
  columns: t.columns ?? 1,
1757
- children: /* @__PURE__ */ w(Qn, {
1792
+ children: /* @__PURE__ */ w($n, {
1758
1793
  schema: a,
1759
1794
  formData: n.doc,
1760
1795
  onChange: (e) => n.setDoc(e),
@@ -1775,7 +1810,7 @@ function En({ meta: e, uiMeta: t, frm: n, id: r }) {
1775
1810
  collapsible: t.collapsible,
1776
1811
  defaultCollapsed: t.collapsed_by_default,
1777
1812
  columns: t.columns ?? 1,
1778
- children: /* @__PURE__ */ w(Qn, {
1813
+ children: /* @__PURE__ */ w($n, {
1779
1814
  schema: a,
1780
1815
  formData: n.doc,
1781
1816
  onChange: (e) => n.setDoc(e),
@@ -1786,7 +1821,7 @@ function En({ meta: e, uiMeta: t, frm: n, id: r }) {
1786
1821
  }, `${r}-${t.label}-${i}`)
1787
1822
  }, t.label || i);
1788
1823
  })
1789
- }) : /* @__PURE__ */ w(Qn, {
1824
+ }) : /* @__PURE__ */ w($n, {
1790
1825
  schema: Tn(e),
1791
1826
  formData: n.doc,
1792
1827
  onChange: (e) => n.setDoc(e),
@@ -1900,77 +1935,96 @@ var On = (e) => {
1900
1935
  ]), F = g(() => {
1901
1936
  let t = e?.link_filters || b?.link_filters || b?.ui_meta?.link_filters;
1902
1937
  return typeof t == "object" && t ? t : null;
1903
- }, [e, b]), [L, B] = v(i ?? ""), V = _(null);
1904
- h(() => {
1905
- i == null ? B("") : i !== V.current && B(String(i));
1906
- }, [i]);
1907
- let [H, ee] = v([]), [te, G] = v(!1), [ne, K] = v(!1), [re, Y] = v(!1), ie = _(null), ae = _(O), oe = Nt(L, 300), se = Mt(), ce = me(), [le, ue] = v(!1), de = p(async (e) => {
1938
+ }, [e, b]), L = Mt(), B = me(), [V, H] = v(!1), [ee, te] = v(""), [ne, G] = v(""), K = _(null), re = p(async (e) => {
1908
1939
  if (e && (e.preventDefault(), e.stopPropagation()), !(!i || !O)) {
1909
- ue(!0);
1940
+ H(!0);
1910
1941
  try {
1911
- let e = await se(`${rt}/${O}/${i}`, { credentials: "include" });
1942
+ let e = await L(`${rt}/${O}/${i}`, { credentials: "include" });
1912
1943
  if (e.ok) {
1913
1944
  let t = await e.json();
1914
- B(t?.title || t?.name || t?.id || String(i)), V.current = i;
1945
+ G(t?.title || t?.name || t?.id || String(i)), K.current = i;
1915
1946
  }
1916
- } catch {} finally {
1917
- ue(!1);
1947
+ } catch {
1948
+ G(String(i));
1949
+ } finally {
1950
+ H(!1);
1918
1951
  }
1919
1952
  }
1920
1953
  }, [
1921
1954
  i,
1922
1955
  O,
1923
- se
1924
- ]), fe = p(async (e) => {
1956
+ L
1957
+ ]);
1958
+ h(() => {
1959
+ i && O ? i !== K.current && (te(""), G(""), V || re()) : i || (te(""), G(""), K.current = null);
1960
+ }, [
1961
+ i,
1962
+ O,
1963
+ re,
1964
+ V
1965
+ ]), h(() => {
1966
+ i && O && !V && !K.current && re();
1967
+ }, [
1968
+ i,
1969
+ O,
1970
+ V,
1971
+ re
1972
+ ]);
1973
+ let Y = g(() => ee || ne || (i && !V ? String(i) : ""), [
1974
+ ee,
1975
+ ne,
1976
+ i,
1977
+ V
1978
+ ]), [ie, ae] = v([]), [oe, se] = v(!1), [ce, le] = v(!1), [ue, de] = v(!1), fe = _(null), pe = _(O), he = Nt(ee, 300), ge = p(async (e) => {
1925
1979
  if (!O) {
1926
- ee([]);
1980
+ ae([]);
1927
1981
  return;
1928
1982
  }
1929
- K(!0);
1983
+ le(!0);
1930
1984
  try {
1931
1985
  let t = new URLSearchParams();
1932
1986
  e && t.set("q", e), t.set("limit", "10"), F && Object.entries(F).forEach(([e, n]) => {
1933
1987
  t.append(e, String(n));
1934
1988
  });
1935
- let n = await se(`${rt}/${O}?${t}`, { credentials: "include" });
1989
+ let n = await L(`${rt}/${O}?${t}`, { credentials: "include" });
1936
1990
  if (n.ok) {
1937
1991
  let e = await n.json(), t = e?.data || e?.items || e;
1938
- ee((Array.isArray(t) ? t : []).map((e) => ({
1992
+ ae((Array.isArray(t) ? t : []).map((e) => ({
1939
1993
  value: String(e.id),
1940
1994
  label: e.title || e.name || e.id
1941
1995
  })));
1942
1996
  }
1943
1997
  } catch {
1944
- ee([]);
1998
+ ae([]);
1945
1999
  } finally {
1946
- K(!1);
2000
+ le(!1);
1947
2001
  }
1948
2002
  }, [O]);
1949
2003
  h(() => {
1950
- te && fe(oe);
2004
+ oe && ge(he);
1951
2005
  }, [
2006
+ he,
1952
2007
  oe,
1953
- te,
1954
- fe
2008
+ ge
1955
2009
  ]), h(() => {
1956
2010
  if (typeof window > "u") return;
1957
2011
  function e(e) {
1958
- !ie.current || !(ie.current instanceof Element) || ie.current && !ie.current.contains(e.target) && G(!1);
2012
+ !fe.current || !(fe.current instanceof Element) || fe.current && !fe.current.contains(e.target) && se(!1);
1959
2013
  }
1960
2014
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
1961
2015
  }, []), h(() => {
1962
- let e = ae.current;
1963
- e && e !== O && i && (o(void 0), B(""), ee([]), G(!1)), ae.current = O;
2016
+ let e = pe.current;
2017
+ e && e !== O && i && (o(void 0), te(""), ae([]), se(!1)), pe.current = O;
1964
2018
  }, [
1965
2019
  O,
1966
2020
  o,
1967
2021
  i
1968
2022
  ]);
1969
- let pe = (e) => {
1970
- V.current = e.value, B(e.label), o(e.value), G(!1);
1971
- }, he = p((e, t) => {
1972
- V.current = e, B(t), o(e), Y(!1);
1973
- }, [o]);
2023
+ let _e = (e) => {
2024
+ K.current = e.value, te(e.label), G(e.label), o(e.value), se(!1);
2025
+ }, ve = p((e, t) => {
2026
+ K.current = e, te(t), G(t), o(e), de(!1);
2027
+ }, [o]), ye = a || D && !O;
1974
2028
  return /* @__PURE__ */ T(J, {
1975
2029
  gap: "$1",
1976
2030
  marginBottom: m ? 0 : "$3",
@@ -2004,17 +2058,17 @@ var On = (e) => {
2004
2058
  children: [
2005
2059
  /* @__PURE__ */ w(z, {
2006
2060
  id: n,
2007
- value: L,
2008
- disabled: a || D && !O,
2061
+ value: Y,
2062
+ disabled: ye,
2009
2063
  placeholder: k,
2010
2064
  onChangeText: (e) => {
2011
- B(e), !(D && !O) && (G(!0), e || o(void 0));
2065
+ te(e), G(""), !(D && !O) && (se(!0), e || o(void 0));
2012
2066
  },
2013
2067
  onFocus: () => {
2014
- D && !O || (G(!0), fe(L));
2068
+ D && !O || (se(!0), ge(ee));
2015
2069
  },
2016
2070
  flex: 1,
2017
- error: !!u,
2071
+ error: !!u || V && !i,
2018
2072
  paddingRight: i ? 88 : 35,
2019
2073
  size: m ? "sm" : "md",
2020
2074
  backgroundColor: m ? "transparent" : "$background",
@@ -2059,13 +2113,13 @@ var On = (e) => {
2059
2113
  padding: 0,
2060
2114
  width: 24,
2061
2115
  height: 24,
2062
- onPress: de,
2063
- disabled: le,
2116
+ onPress: re,
2117
+ disabled: V || ye,
2064
2118
  title: "Fetch record name",
2065
2119
  children: /* @__PURE__ */ w(R, {
2066
2120
  name: "refresh-cw",
2067
2121
  size: 14,
2068
- color: le ? "$primary" : "$colorMuted"
2122
+ color: V ? "$primary" : "$colorMuted"
2069
2123
  })
2070
2124
  }),
2071
2125
  !a && /* @__PURE__ */ w(N, {
@@ -2076,7 +2130,7 @@ var On = (e) => {
2076
2130
  width: 24,
2077
2131
  height: 24,
2078
2132
  onPress: (e) => {
2079
- e.preventDefault(), e.stopPropagation(), ce({ to: `/app/${O}/detail/${i}` });
2133
+ e.preventDefault(), e.stopPropagation(), B({ to: `/app/${O}/detail/${i}` });
2080
2134
  },
2081
2135
  title: `Open ${O}`,
2082
2136
  children: /* @__PURE__ */ w(R, {
@@ -2093,7 +2147,7 @@ var On = (e) => {
2093
2147
  width: 24,
2094
2148
  height: 24,
2095
2149
  onPress: () => {
2096
- B(""), o(void 0);
2150
+ te(""), o(void 0);
2097
2151
  },
2098
2152
  children: "✕"
2099
2153
  })
@@ -2103,7 +2157,7 @@ var On = (e) => {
2103
2157
  }), O && M && !a && !m && /* @__PURE__ */ w(N, {
2104
2158
  variant: "ghost",
2105
2159
  size: "sm",
2106
- onPress: () => Y(!0),
2160
+ onPress: () => de(!0),
2107
2161
  title: `Create new ${O}`,
2108
2162
  borderWidth: 1,
2109
2163
  borderColor: "$borderColorMuted",
@@ -2126,8 +2180,8 @@ var On = (e) => {
2126
2180
  t("first to load link options.")
2127
2181
  ]
2128
2182
  }),
2129
- te && /* @__PURE__ */ w(J, {
2130
- ref: ie,
2183
+ oe && /* @__PURE__ */ w(J, {
2184
+ ref: fe,
2131
2185
  position: "absolute",
2132
2186
  top: "100%",
2133
2187
  left: 0,
@@ -2138,16 +2192,16 @@ var On = (e) => {
2138
2192
  backgroundColor: "$background",
2139
2193
  marginTop: "$1",
2140
2194
  padding: "$2",
2141
- children: [ne ? /* @__PURE__ */ w(W, {
2195
+ children: [ce ? /* @__PURE__ */ w(W, {
2142
2196
  size: "sm",
2143
2197
  padding: "$2",
2144
2198
  children: t("Loading...")
2145
- }) : H.length === 0 ? /* @__PURE__ */ w(W, {
2199
+ }) : ie.length === 0 ? /* @__PURE__ */ w(W, {
2146
2200
  size: "sm",
2147
2201
  padding: "$2",
2148
2202
  children: t("No results found")
2149
- }) : H.map((e) => /* @__PURE__ */ w(N, {
2150
- onPress: () => pe(e),
2203
+ }) : ie.map((e) => /* @__PURE__ */ w(N, {
2204
+ onPress: () => _e(e),
2151
2205
  variant: "ghost",
2152
2206
  size: "sm",
2153
2207
  justifyContent: "flex-start",
@@ -2157,21 +2211,21 @@ var On = (e) => {
2157
2211
  children: e.label
2158
2212
  }, e.value)), /* @__PURE__ */ w(N, {
2159
2213
  size: "sm",
2160
- onPress: () => G(!1),
2214
+ onPress: () => se(!1),
2161
2215
  marginTop: "$2",
2162
2216
  children: t("Close")
2163
2217
  })]
2164
2218
  })
2165
2219
  }),
2166
2220
  O && M && /* @__PURE__ */ w(I, {
2167
- isOpen: re,
2168
- onClose: () => Y(!1),
2221
+ isOpen: ue,
2222
+ onClose: () => de(!1),
2169
2223
  title: `New ${O}`,
2170
2224
  width: 480,
2171
2225
  children: /* @__PURE__ */ w(Dn, {
2172
2226
  linkedDoctype: O,
2173
- onCreated: he,
2174
- onClose: () => Y(!1)
2227
+ onCreated: ve,
2228
+ onClose: () => de(!1)
2175
2229
  })
2176
2230
  })
2177
2231
  ]
@@ -2350,7 +2404,7 @@ var Nn = (e) => {
2350
2404
  })
2351
2405
  ]
2352
2406
  }),
2353
- /* @__PURE__ */ w(G, {
2407
+ /* @__PURE__ */ w(ne, {
2354
2408
  id: t,
2355
2409
  value: String(i ?? ""),
2356
2410
  options: h,
@@ -2459,7 +2513,7 @@ var Rn = 10, zn = 14, Bn = 10, Vn = 42, Hn = (e) => {
2459
2513
  flex: 1,
2460
2514
  flexBasis: 0,
2461
2515
  minWidth: 120
2462
- }, [S]), G = g(() => V.reduce((e, t) => e + (I(t) === "boolean" ? 80 : 150), 160), [V, S]);
2516
+ }, [S]), ne = g(() => V.reduce((e, t) => e + (I(t) === "boolean" ? 80 : 150), 160), [V, S]);
2463
2517
  return /* @__PURE__ */ T(J, {
2464
2518
  gap: "$2",
2465
2519
  marginTop: "$4",
@@ -2505,7 +2559,7 @@ var Rn = 10, zn = 14, Bn = 10, Vn = 42, Hn = (e) => {
2505
2559
  borderBottomWidth: 1,
2506
2560
  borderBottomColor: "$borderColor",
2507
2561
  minHeight: 60,
2508
- children: /* @__PURE__ */ w(Jn, {
2562
+ children: /* @__PURE__ */ w(Yn, {
2509
2563
  name: `${b}.${e}`,
2510
2564
  disabled: c
2511
2565
  })
@@ -2551,7 +2605,7 @@ var Rn = 10, zn = 14, Bn = 10, Vn = 42, Hn = (e) => {
2551
2605
  backgroundColor: "$backgroundStrong",
2552
2606
  borderBottomWidth: 1,
2553
2607
  borderBottomColor: "$borderColor",
2554
- minWidth: G,
2608
+ minWidth: ne,
2555
2609
  children: [
2556
2610
  /* @__PURE__ */ w(q, {
2557
2611
  width: 40,
@@ -2615,7 +2669,7 @@ var Rn = 10, zn = 14, Bn = 10, Vn = 42, Hn = (e) => {
2615
2669
  hoverStyle: { backgroundColor: "$backgroundHover" },
2616
2670
  alignItems: "center",
2617
2671
  minHeight: Vn,
2618
- minWidth: G,
2672
+ minWidth: ne,
2619
2673
  children: [
2620
2674
  /* @__PURE__ */ w(q, {
2621
2675
  width: 40,
@@ -2642,7 +2696,7 @@ var Rn = 10, zn = 14, Bn = 10, Vn = 42, Hn = (e) => {
2642
2696
  borderRightWidth: 1,
2643
2697
  borderRightColor: "$borderColor",
2644
2698
  alignItems: "center",
2645
- children: /* @__PURE__ */ w(Jn, {
2699
+ children: /* @__PURE__ */ w(Yn, {
2646
2700
  name: `${n}.${e}`,
2647
2701
  label: null,
2648
2702
  compact: !0,
@@ -2886,7 +2940,150 @@ var Wn = (e) => {
2886
2940
  });
2887
2941
  };
2888
2942
  k(Kn);
2889
- var qn = new class {
2943
+ //#endregion
2944
+ //#region src/components/form/fields/TagInputField.tsx
2945
+ function qn(e) {
2946
+ let { name: t, placeholder: n, label: r, value: i = [], onChange: a, field: o, compact: s, required: c, error: l, showInlineError: u, valueKey: d } = e, [f, m] = v(""), h = p((e) => d && typeof e == "object" && e && e[d] !== void 0 ? String(e[d]) : String(e), [d]), g = p((e) => d ? { [d]: e } : e, [d]), _ = p((e, t) => d && typeof e == "object" && e && e[d] !== void 0 ? String(e[d]) === t : String(e) === t, [d]), y = p(() => {
2947
+ let e = f.trim();
2948
+ if (e) {
2949
+ if (!i.some((t) => _(t, e))) {
2950
+ let t = g(e);
2951
+ a([...i, t]);
2952
+ }
2953
+ m("");
2954
+ }
2955
+ }, [
2956
+ f,
2957
+ i,
2958
+ a,
2959
+ g,
2960
+ _
2961
+ ]), b = p((e) => {
2962
+ a(i.filter((t) => !_(t, e)));
2963
+ }, [
2964
+ i,
2965
+ a,
2966
+ _
2967
+ ]), x = o ?? {}, S = x.ui_meta ?? {}, C = r ?? S.label ?? x.label ?? t, E = n ?? S.placeholder ?? `Add ${C}`, D = S.hint, O = p((e) => {
2968
+ e.key === "Enter" || e.key === "Tab" ? (e.preventDefault(), y()) : e.key === "Backspace" && f === "" && i.length > 0 && b(h(i[i.length - 1]));
2969
+ }, [
2970
+ y,
2971
+ b,
2972
+ f,
2973
+ i,
2974
+ h
2975
+ ]);
2976
+ return /* @__PURE__ */ T(J, {
2977
+ gap: "$1",
2978
+ marginBottom: s ? 0 : "$2",
2979
+ flex: s ? 1 : void 0,
2980
+ minWidth: s ? 50 : "100%",
2981
+ alignSelf: "stretch",
2982
+ role: "group",
2983
+ "aria-labelledby": `${t}-label`,
2984
+ children: [
2985
+ C && !s && /* @__PURE__ */ T(U, {
2986
+ id: `${t}-label`,
2987
+ fontWeight: "600",
2988
+ size: "sm",
2989
+ color: "$colorMuted",
2990
+ children: [
2991
+ C,
2992
+ " ",
2993
+ c && /* @__PURE__ */ w(U, {
2994
+ color: "$error",
2995
+ children: "*"
2996
+ })
2997
+ ]
2998
+ }),
2999
+ /* @__PURE__ */ w(q, {
3000
+ flexWrap: "wrap",
3001
+ gap: "$2",
3002
+ children: i.map((e, t) => {
3003
+ let n = h(e);
3004
+ return /* @__PURE__ */ T(N, {
3005
+ size: "sm",
3006
+ variant: "default",
3007
+ borderRadius: "$6",
3008
+ paddingHorizontal: "$3",
3009
+ paddingVertical: "$1",
3010
+ backgroundColor: "$blue1",
3011
+ borderColor: "$blue8",
3012
+ color: "$blue10",
3013
+ onPress: () => b(n),
3014
+ "aria-label": `Remove ${n}`,
3015
+ children: [/* @__PURE__ */ w(U, {
3016
+ fontSize: "$3",
3017
+ color: "$blue10",
3018
+ children: n
3019
+ }), /* @__PURE__ */ w(R, {
3020
+ name: "x",
3021
+ size: 12,
3022
+ color: "$blue10",
3023
+ marginLeft: "$1"
3024
+ })]
3025
+ }, `${n}-${t}`);
3026
+ })
3027
+ }),
3028
+ /* @__PURE__ */ T(q, {
3029
+ gap: "$2",
3030
+ alignItems: "center",
3031
+ children: [
3032
+ " ",
3033
+ /* @__PURE__ */ w(z, {
3034
+ flex: 1,
3035
+ value: f,
3036
+ onChangeText: m,
3037
+ onKeyPress: O,
3038
+ onBlur: y,
3039
+ placeholder: E,
3040
+ "aria-label": `Add new ${C}`,
3041
+ error: !!l,
3042
+ size: "sm",
3043
+ backgroundColor: s ? "transparent" : "$background",
3044
+ borderWidth: +!s,
3045
+ borderRadius: s ? 0 : "$round",
3046
+ borderColor: "$borderColor",
3047
+ opacity: 1,
3048
+ hoverStyle: s ? { backgroundColor: "$backgroundHover" } : void 0,
3049
+ focusStyle: s ? {
3050
+ backgroundColor: "$background",
3051
+ borderWidth: 0,
3052
+ outlineWidth: 0
3053
+ } : { borderColor: "$primary" },
3054
+ minHeight: s ? 40 : 32,
3055
+ paddingHorizontal: s ? 14 : "$md"
3056
+ }),
3057
+ /* @__PURE__ */ w(N, {
3058
+ onPress: y,
3059
+ disabled: !f.trim(),
3060
+ size: "sm",
3061
+ variant: "ghost",
3062
+ "aria-label": `Add ${C}`,
3063
+ children: /* @__PURE__ */ w(R, {
3064
+ name: "plus",
3065
+ size: 16
3066
+ })
3067
+ })
3068
+ ]
3069
+ }),
3070
+ D && !s && /* @__PURE__ */ w(U, {
3071
+ fontSize: "$xs",
3072
+ color: "$colorMuted",
3073
+ paddingTop: "$1",
3074
+ role: "note",
3075
+ children: D
3076
+ }),
3077
+ u && l && /* @__PURE__ */ w(W, {
3078
+ color: "$error",
3079
+ size: "sm",
3080
+ marginTop: "$1",
3081
+ children: typeof l == "string" ? l : l?.message
3082
+ })
3083
+ ]
3084
+ });
3085
+ }
3086
+ var Jn = new class {
2890
3087
  fields = /* @__PURE__ */ new Map();
2891
3088
  register(e, t) {
2892
3089
  this.fields.set(e, t);
@@ -2897,10 +3094,15 @@ var qn = new class {
2897
3094
  clear() {
2898
3095
  this.fields.clear();
2899
3096
  }
2900
- }(), Jn = k((e) => {
2901
- let t = String(e.name ?? "").toLowerCase(), n = e.field ?? {}, r = n.format, i = n.ui_widget || n.ui_meta?.ui_widget || n.ui_meta?.widget, a = typeof e.fieldType == "string" ? e.fieldType : n.ui_meta?.widget, o = typeof a == "string" ? qn.get(a) : void 0;
3097
+ }(), Yn = k((e) => {
3098
+ let t = String(e.name ?? "").toLowerCase(), n = e.field ?? {}, r = n.format, i = n.ui_widget || n.ui_meta?.ui_widget || n.ui_meta?.widget, a = typeof e.fieldType == "string" ? e.fieldType : n.ui_meta?.widget, o = typeof a == "string" ? Jn.get(a) : void 0;
2902
3099
  if (o) return /* @__PURE__ */ w(o, { ...e });
2903
3100
  if (e.fieldType === Array) {
3101
+ if (n.ui_meta?.input_widget === "tag_input") return /* @__PURE__ */ w(qn, {
3102
+ ...e,
3103
+ placeholder: n.ui_meta?.placeholder,
3104
+ valueKey: n.ui_meta?.value_key
3105
+ });
2904
3106
  if (i === "multiselect") {
2905
3107
  let t = n.ui_meta?.hide_label === !0;
2906
3108
  return /* @__PURE__ */ w(Kn, {
@@ -2946,7 +3148,7 @@ var qn = new class {
2946
3148
  });
2947
3149
  }
2948
3150
  return /* @__PURE__ */ w(jn, { ...e });
2949
- }), Yn = () => {
3151
+ }), Xn = () => {
2950
3152
  let { t: e } = $("desk"), { error: t } = j();
2951
3153
  if (!t) return null;
2952
3154
  let n = t.details || [];
@@ -2973,7 +3175,7 @@ var qn = new class {
2973
3175
  //#endregion
2974
3176
  //#region src/components/form/fields/SubmitField.tsx
2975
3177
  A.register("submitText");
2976
- var Xn = ({ value: e, ...t }) => {
3178
+ var Zn = ({ value: e, ...t }) => {
2977
3179
  let { state: n } = j();
2978
3180
  return /* @__PURE__ */ w(N, {
2979
3181
  type: "submit",
@@ -2983,20 +3185,20 @@ var Xn = ({ value: e, ...t }) => {
2983
3185
  ...A(t),
2984
3186
  children: e || "Submit"
2985
3187
  });
2986
- }, Zn = new E({
3188
+ }, Qn = new E({
2987
3189
  allErrors: !0,
2988
3190
  useDefaults: !1,
2989
3191
  strict: !1
2990
3192
  });
2991
- Zn.addKeyword({ keyword: "ui:widget" }), Zn.addKeyword({ keyword: "ui:options" });
2992
- function Qn({ schema: e, formData: t, onChange: n, onSubmit: r, error: i, readonly: a = !1, disabled: o = !1, hideSubmitButton: s = !1, submitText: c = "Submit", columns: l = 1, children: u }) {
3193
+ Qn.addKeyword({ keyword: "ui:widget" }), Qn.addKeyword({ keyword: "ui:options" });
3194
+ function $n({ schema: e, formData: t, onChange: n, onSubmit: r, error: i, readonly: a = !1, disabled: o = !1, hideSubmitButton: s = !1, submitText: c = "Submit", columns: l = 1, children: u }) {
2993
3195
  return /* @__PURE__ */ w(O, {
2994
3196
  schema: g(() => new D({
2995
3197
  schema: e,
2996
3198
  validator: (t) => {
2997
- if (Zn.validate(e, t), Zn.errors) return { details: Zn.errors };
3199
+ if (Qn.validate(e, t), Qn.errors) return { details: Qn.errors };
2998
3200
  }
2999
- }), [e, Zn]),
3201
+ }), [e, Qn]),
3000
3202
  model: t,
3001
3203
  error: i,
3002
3204
  onChange: (e, r) => {
@@ -3021,43 +3223,43 @@ function Qn({ schema: e, formData: t, onChange: n, onSubmit: r, error: i, readon
3021
3223
  children: /* @__PURE__ */ T(J, {
3022
3224
  gap: "$1",
3023
3225
  children: [
3024
- /* @__PURE__ */ w(Yn, {}),
3226
+ /* @__PURE__ */ w(Xn, {}),
3025
3227
  l > 1 ? /* @__PURE__ */ w(q, {
3026
3228
  flexWrap: "wrap",
3027
3229
  marginHorizontal: "$-1.5",
3028
3230
  children: Object.keys(e.properties || {}).map((e) => /* @__PURE__ */ w(J, {
3029
3231
  flexBasis: `${100 / l}%`,
3030
3232
  paddingHorizontal: "$1.5",
3031
- children: /* @__PURE__ */ w(Jn, { name: e })
3233
+ children: /* @__PURE__ */ w(Yn, { name: e })
3032
3234
  }, e))
3033
- }) : Object.keys(e.properties || {}).map((e) => /* @__PURE__ */ w(Jn, { name: e }, e)),
3235
+ }) : Object.keys(e.properties || {}).map((e) => /* @__PURE__ */ w(Yn, { name: e }, e)),
3034
3236
  u,
3035
- !s && /* @__PURE__ */ w(Xn, { value: c })
3237
+ !s && /* @__PURE__ */ w(Zn, { value: c })
3036
3238
  ]
3037
3239
  })
3038
3240
  });
3039
3241
  }
3040
3242
  //#endregion
3041
3243
  //#region src/components/table/AutoTable.tsx
3042
- function $n(e, t, n) {
3244
+ function er(e, t, n) {
3043
3245
  return JSON.stringify({
3044
3246
  resource: e,
3045
3247
  filters: t ?? null,
3046
3248
  sorting: n
3047
3249
  });
3048
3250
  }
3049
- function er(e, t, n) {
3251
+ function tr(e, t, n) {
3050
3252
  return Math.max(t, Math.min(n, e));
3051
3253
  }
3052
- function tr(e) {
3254
+ function nr(e) {
3053
3255
  let t = e.type;
3054
3256
  return Array.isArray(t) ? t.find((e) => e !== "null") ?? "" : typeof t == "string" ? t : "";
3055
3257
  }
3056
- function nr(e, t, n) {
3057
- let r = Math.ceil(t.length * 8.5) + 58, i = tr(n), a = n.format === "date" || n.format === "date-time";
3058
- return e === "name" ? er(Math.max(r, 220), 180, 320) : /(amount|total|rate|qty|quantity|debit|credit|balance)$/i.test(e) ? er(Math.max(r, 136), 120, 220) : /(date|status)$/i.test(e) || a || i === "boolean" ? er(Math.max(r, 132), 118, 220) : er(Math.max(r, 180), 140, 300);
3258
+ function rr(e, t, n) {
3259
+ let r = Math.ceil(t.length * 8.5) + 58, i = nr(n), a = n.format === "date" || n.format === "date-time";
3260
+ return e === "name" ? tr(Math.max(r, 220), 180, 320) : /(amount|total|rate|qty|quantity|debit|credit|balance)$/i.test(e) ? tr(Math.max(r, 136), 120, 220) : /(date|status)$/i.test(e) || a || i === "boolean" ? tr(Math.max(r, 132), 118, 220) : tr(Math.max(r, 180), 140, 300);
3059
3261
  }
3060
- function rr(e, t) {
3262
+ function ir(e, t) {
3061
3263
  let n = [];
3062
3264
  for (let [t, r] of Object.entries(e.properties)) {
3063
3265
  let e = r;
@@ -3074,7 +3276,7 @@ function rr(e, t) {
3074
3276
  enableSorting: !0,
3075
3277
  minSize: 96,
3076
3278
  maxSize: 560,
3077
- size: nr(t, i, e)
3279
+ size: rr(t, i, e)
3078
3280
  });
3079
3281
  }
3080
3282
  return n.push({
@@ -3117,7 +3319,7 @@ function rr(e, t) {
3117
3319
  enableSorting: !0
3118
3320
  }), n;
3119
3321
  }
3120
- function ir({ resource: e, schema: t, filters: n, columns: r, enableSelection: i = !1, onSelectionChange: a, selectedRows: o, onRowClick: s, className: c }) {
3322
+ function ar({ resource: e, schema: t, filters: n, columns: r, enableSelection: i = !1, onSelectionChange: a, selectedRows: o, onRowClick: s, className: c }) {
3121
3323
  let { t: l } = $(), [u, d] = v(() => t?.properties?.modified && !t.properties.modified["x-hidden"] ? [{
3122
3324
  id: "modified",
3123
3325
  desc: !0
@@ -3145,7 +3347,7 @@ function ir({ resource: e, schema: t, filters: n, columns: r, enableSelection: i
3145
3347
  filters: n,
3146
3348
  sorters: C,
3147
3349
  queryOptions: { placeholderData: (e) => e }
3148
- }), O = E?.data ?? [], k = E?.total ?? 0, A = D?.isLoading ?? !1, j = D?.isFetching ?? !1, M = D?.error, F = g(() => $n(e, n, u), [
3350
+ }), O = E?.data ?? [], k = E?.total ?? 0, A = D?.isLoading ?? !1, j = D?.isFetching ?? !1, M = D?.error, F = g(() => er(e, n, u), [
3149
3351
  e,
3150
3352
  n,
3151
3353
  u
@@ -3160,7 +3362,7 @@ function ir({ resource: e, schema: t, filters: n, columns: r, enableSelection: i
3160
3362
  pageIndex: 0
3161
3363
  }));
3162
3364
  }, [F]);
3163
- let L = g(() => r || (t ? rr(t, l) : []), [
3365
+ let L = g(() => r || (t ? ir(t, l) : []), [
3164
3366
  r,
3165
3367
  t,
3166
3368
  l
@@ -3443,7 +3645,7 @@ function ir({ resource: e, schema: t, filters: n, columns: r, enableSelection: i
3443
3645
  }
3444
3646
  //#endregion
3445
3647
  //#region src/components/table/EditableCell.tsx
3446
- function ar({ resource: e, id: t, field: n, value: r, type: i = "text", options: a, disabled: o = !1, onSaveSuccess: s, renderValue: c }) {
3648
+ function or({ resource: e, id: t, field: n, value: r, type: i = "text", options: a, disabled: o = !1, onSaveSuccess: s, renderValue: c }) {
3447
3649
  let [l, u] = v(!1), [d, f] = v(r), [m, g] = v(null), y = _(null), b = xe();
3448
3650
  h(() => {
3449
3651
  l && y.current && (y.current.focus(), y.current instanceof HTMLInputElement && y.current.select());
@@ -3487,7 +3689,7 @@ function ar({ resource: e, id: t, field: n, value: r, type: i = "text", options:
3487
3689
  return l ? /* @__PURE__ */ T(J, {
3488
3690
  position: "relative",
3489
3691
  children: [
3490
- i === "select" ? /* @__PURE__ */ w(G, {
3692
+ i === "select" ? /* @__PURE__ */ w(ne, {
3491
3693
  value: String(d ?? ""),
3492
3694
  onChange: D,
3493
3695
  onBlur: C,
@@ -3561,7 +3763,7 @@ function ar({ resource: e, id: t, field: n, value: r, type: i = "text", options:
3561
3763
  }
3562
3764
  //#endregion
3563
3765
  //#region src/components/feedback/ConfirmDialog.tsx
3564
- function or({ open: e, title: t, message: n, confirmLabel: r = "Confirm", cancelLabel: i = "Cancel", destructive: a = !1, onConfirm: o, onCancel: s }) {
3766
+ function sr({ open: e, title: t, message: n, confirmLabel: r = "Confirm", cancelLabel: i = "Cancel", destructive: a = !1, onConfirm: o, onCancel: s }) {
3565
3767
  let c = g(() => `confirm-dialog-title-${t.toLowerCase().replaceAll(" ", "-")}`, [t]);
3566
3768
  return h(() => {
3567
3769
  if (!e) return;
@@ -3618,7 +3820,7 @@ function or({ open: e, title: t, message: n, confirmLabel: r = "Confirm", cancel
3618
3820
  }
3619
3821
  //#endregion
3620
3822
  //#region src/components/feedback/AlertBanner.tsx
3621
- var sr = {
3823
+ var cr = {
3622
3824
  info: {
3623
3825
  bg: "$backgroundSecondary",
3624
3826
  border: "$borderColor",
@@ -3635,8 +3837,8 @@ var sr = {
3635
3837
  text: "white"
3636
3838
  }
3637
3839
  };
3638
- function cr({ message: e, variant: t = "info", onDismiss: n }) {
3639
- let r = sr[t];
3840
+ function lr({ message: e, variant: t = "info", onDismiss: n }) {
3841
+ let r = cr[t];
3640
3842
  return /* @__PURE__ */ w(P, {
3641
3843
  role: t === "error" ? "alert" : "status",
3642
3844
  backgroundColor: r.bg,
@@ -3669,7 +3871,7 @@ function cr({ message: e, variant: t = "info", onDismiss: n }) {
3669
3871
  }
3670
3872
  //#endregion
3671
3873
  //#region src/components/feedback/SubmittedBanner.tsx
3672
- function lr({ docstatus: e }) {
3874
+ function ur({ docstatus: e }) {
3673
3875
  let { t } = $("desk");
3674
3876
  return e === 1 ? /* @__PURE__ */ w(P, {
3675
3877
  role: "alert",
@@ -3697,7 +3899,7 @@ function lr({ docstatus: e }) {
3697
3899
  }
3698
3900
  //#endregion
3699
3901
  //#region src/components/table/BulkActionsBar.tsx
3700
- function ur({ selectedCount: e, isLoading: t = !1, onDelete: n, onExportJson: r, onExportCsv: i, onBulkUpdate: a, updateFields: o = [], onClear: s }) {
3902
+ function dr({ selectedCount: e, isLoading: t = !1, onDelete: n, onExportJson: r, onExportCsv: i, onBulkUpdate: a, updateFields: o = [], onClear: s }) {
3701
3903
  let { t: c } = $("desk"), [l, u] = v(!1), [d, f] = v(""), [m, h] = v(""), [g, _] = v(!1), y = p(() => {
3702
3904
  d && a && (a(d, m), u(!1), f(""), h(""));
3703
3905
  }, [
@@ -3784,7 +3986,7 @@ function ur({ selectedCount: e, isLoading: t = !1, onDelete: n, onExportJson: r,
3784
3986
  fontSize: "$xs",
3785
3987
  color: "$colorMuted",
3786
3988
  children: c("Select Field")
3787
- }), /* @__PURE__ */ w(G, {
3989
+ }), /* @__PURE__ */ w(ne, {
3788
3990
  size: "sm",
3789
3991
  value: d,
3790
3992
  onChange: (e) => f(e.target.value),
@@ -3801,7 +4003,7 @@ function ur({ selectedCount: e, isLoading: t = !1, onDelete: n, onExportJson: r,
3801
4003
  fontSize: "$xs",
3802
4004
  color: "$colorMuted",
3803
4005
  children: c("New Value")
3804
- }), o.find((e) => e.name === d)?.options ? /* @__PURE__ */ w(G, {
4006
+ }), o.find((e) => e.name === d)?.options ? /* @__PURE__ */ w(ne, {
3805
4007
  size: "sm",
3806
4008
  value: String(m),
3807
4009
  onChange: (e) => h(e.target.value),
@@ -3842,7 +4044,7 @@ function ur({ selectedCount: e, isLoading: t = !1, onDelete: n, onExportJson: r,
3842
4044
  })
3843
4045
  ]
3844
4046
  }),
3845
- /* @__PURE__ */ w(or, {
4047
+ /* @__PURE__ */ w(sr, {
3846
4048
  open: g,
3847
4049
  title: "Confirm bulk delete",
3848
4050
  message: `Are you sure you want to delete ${e} selected document(s)? This action cannot be undone.`,
@@ -3859,7 +4061,7 @@ function ur({ selectedCount: e, isLoading: t = !1, onDelete: n, onExportJson: r,
3859
4061
  }
3860
4062
  //#endregion
3861
4063
  //#region src/components/workflow/StateBadge.tsx
3862
- var dr = {
4064
+ var fr = {
3863
4065
  draft: {
3864
4066
  bg: "#e0e0e0",
3865
4067
  text: "#333"
@@ -3897,13 +4099,13 @@ var dr = {
3897
4099
  text: "#495057"
3898
4100
  }
3899
4101
  };
3900
- function fr(e) {
3901
- return e ? dr[e.toLowerCase().replace(/\s+/g, "_")] ?? dr.default : dr.default;
4102
+ function pr(e) {
4103
+ return e ? fr[e.toLowerCase().replace(/\s+/g, "_")] ?? fr.default : fr.default;
3902
4104
  }
3903
- function pr({ state: e, docstatus: t, className: n, style: r }) {
4105
+ function mr({ state: e, docstatus: t, className: n, style: r }) {
3904
4106
  let i = e ?? (t === 0 ? "Draft" : t === 1 ? "Submitted" : t === 2 ? "Cancelled" : void 0);
3905
4107
  if (!i) return null;
3906
- let a = fr(i);
4108
+ let a = pr(i);
3907
4109
  return /* @__PURE__ */ w(q, {
3908
4110
  className: n,
3909
4111
  alignSelf: "flex-start",
@@ -3923,7 +4125,7 @@ function pr({ state: e, docstatus: t, className: n, style: r }) {
3923
4125
  }
3924
4126
  //#endregion
3925
4127
  //#region src/components/workflow/WorkflowActions.tsx
3926
- var mr = {
4128
+ var hr = {
3927
4129
  submit: {
3928
4130
  bg: "#007bff",
3929
4131
  text: "white",
@@ -3955,11 +4157,11 @@ var mr = {
3955
4157
  hover: "#545b62"
3956
4158
  }
3957
4159
  };
3958
- function hr(e) {
4160
+ function gr(e) {
3959
4161
  let t = e.toLowerCase();
3960
- return t.includes("submit") ? mr.submit : t.includes("approve") ? mr.approve : t.includes("reject") ? mr.reject : t.includes("cancel") ? mr.cancel : t.includes("hold") ? mr.hold : mr.default;
4162
+ return t.includes("submit") ? hr.submit : t.includes("approve") ? hr.approve : t.includes("reject") ? hr.reject : t.includes("cancel") ? hr.cancel : t.includes("hold") ? hr.hold : hr.default;
3961
4163
  }
3962
- function gr({ doctype: e, id: t, showState: n = !0, onActionComplete: r, className: i, style: a }) {
4164
+ function _r({ doctype: e, id: t, showState: n = !0, onActionComplete: r, className: i, style: a }) {
3963
4165
  let { t: o } = $("desk"), { state: s, actions: c, isLoading: l, executeAction: u, isExecuting: d } = Qt(e, t), f = async (e) => {
3964
4166
  try {
3965
4167
  await u(e.name), r?.(e.name);
@@ -3979,12 +4181,12 @@ function gr({ doctype: e, id: t, showState: n = !0, onActionComplete: r, classNa
3979
4181
  gap: "$md",
3980
4182
  style: a,
3981
4183
  children: [
3982
- n && /* @__PURE__ */ w(pr, {
4184
+ n && /* @__PURE__ */ w(mr, {
3983
4185
  state: s.current_state,
3984
4186
  docstatus: s.docstatus
3985
4187
  }),
3986
4188
  p.map((e) => {
3987
- let t = hr(e.name);
4189
+ let t = gr(e.name);
3988
4190
  return /* @__PURE__ */ w(N, {
3989
4191
  onPress: () => f(e),
3990
4192
  disabled: d,
@@ -4006,7 +4208,7 @@ function gr({ doctype: e, id: t, showState: n = !0, onActionComplete: r, classNa
4006
4208
  }
4007
4209
  //#endregion
4008
4210
  //#region src/plugins/registry.ts
4009
- var _r = {
4211
+ var vr = {
4010
4212
  plugins: /* @__PURE__ */ new Map(),
4011
4213
  fields: /* @__PURE__ */ new Map(),
4012
4214
  slots: /* @__PURE__ */ new Map(),
@@ -4014,27 +4216,27 @@ var _r = {
4014
4216
  resources: [],
4015
4217
  theme: void 0
4016
4218
  };
4017
- function vr(e, t, n) {
4018
- let r = _r.slots.get(e) ?? [];
4219
+ function yr(e, t, n) {
4220
+ let r = vr.slots.get(e) ?? [];
4019
4221
  if (r.some((e) => e.component === t && JSON.stringify(e.doctypes) === JSON.stringify(n?.doctypes))) return;
4020
4222
  let i = {
4021
4223
  slot: e,
4022
4224
  component: t,
4023
4225
  ...n
4024
4226
  };
4025
- r.push(i), r.sort((e, t) => (t.priority ?? 0) - (e.priority ?? 0)), _r.slots.set(e, r);
4227
+ r.push(i), r.sort((e, t) => (t.priority ?? 0) - (e.priority ?? 0)), vr.slots.set(e, r);
4026
4228
  }
4027
- function yr(e, t) {
4028
- let n = _r.slots.get(e) ?? [];
4229
+ function br(e, t) {
4230
+ let n = vr.slots.get(e) ?? [];
4029
4231
  return t ? n.filter((e) => !e.doctypes || e.doctypes.includes(t)) : n;
4030
4232
  }
4031
- function br() {
4032
- return _r.resources;
4233
+ function xr() {
4234
+ return vr.resources;
4033
4235
  }
4034
4236
  //#endregion
4035
4237
  //#region src/plugins/Slot.tsx
4036
- function xr({ name: e, doctype: t, data: n, id: r, children: i }) {
4037
- let a = yr(e, t);
4238
+ function Sr({ name: e, doctype: t, data: n, id: r, children: i }) {
4239
+ let a = br(e, t);
4038
4240
  return a.length === 0 ? /* @__PURE__ */ w(C, { children: i }) : /* @__PURE__ */ w(C, { children: a.map((i, a) => {
4039
4241
  let o = i.component;
4040
4242
  return /* @__PURE__ */ w(o, {
@@ -4046,7 +4248,7 @@ function xr({ name: e, doctype: t, data: n, id: r, children: i }) {
4046
4248
  }
4047
4249
  //#endregion
4048
4250
  //#region src/components/audit/DiffViewer.tsx
4049
- function Sr(e) {
4251
+ function Cr(e) {
4050
4252
  if (e === null) return "null";
4051
4253
  if (e === void 0) return "undefined";
4052
4254
  if (typeof e == "object") try {
@@ -4056,7 +4258,7 @@ function Sr(e) {
4056
4258
  }
4057
4259
  return typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" ? `${e}` : typeof e == "symbol" ? e.description ? `Symbol(${e.description})` : "Symbol" : typeof e == "function" ? "[function]" : "[unknown]";
4058
4260
  }
4059
- function Cr({ diff: e }) {
4261
+ function wr({ diff: e }) {
4060
4262
  let { t } = $("desk"), n = e ? Object.entries(e) : [];
4061
4263
  return n.length === 0 ? null : /* @__PURE__ */ T(H, {
4062
4264
  marginTop: "$xs",
@@ -4087,7 +4289,7 @@ function Cr({ diff: e }) {
4087
4289
  })
4088
4290
  ]
4089
4291
  }), n.map(([e, t]) => {
4090
- let n = Sr(t.old), r = Sr(t.new);
4292
+ let n = Cr(t.old), r = Cr(t.new);
4091
4293
  return /* @__PURE__ */ T(q, {
4092
4294
  paddingVertical: "$xs",
4093
4295
  alignItems: "flex-start",
@@ -4114,7 +4316,7 @@ function Cr({ diff: e }) {
4114
4316
  }
4115
4317
  //#endregion
4116
4318
  //#region src/components/audit/AuditTimeline.tsx
4117
- function wr(e) {
4319
+ function Tr(e) {
4118
4320
  if (e.action === "create") return "Document created";
4119
4321
  if (e.action === "submit") return "Document submitted";
4120
4322
  if (e.action === "amend") {
@@ -4123,7 +4325,7 @@ function wr(e) {
4123
4325
  }
4124
4326
  return e.action === "update" ? "Document updated" : e.action === "restore" ? "Document restored" : e.action === "cancel" ? "Document cancelled" : e.action === "in_place_edit" ? "Document edited in place" : e.action;
4125
4327
  }
4126
- function Tr({ doctype: e, id: t }) {
4328
+ function Er({ doctype: e, id: t }) {
4127
4329
  let { t: n } = $("desk"), { entries: r, isLoading: i, error: a } = dn(e, t);
4128
4330
  return /* @__PURE__ */ T(H, {
4129
4331
  marginTop: "$md",
@@ -4159,7 +4361,7 @@ function Tr({ doctype: e, id: t }) {
4159
4361
  flexWrap: "wrap",
4160
4362
  children: [/* @__PURE__ */ w(U, {
4161
4363
  fontWeight: "700",
4162
- children: wr(e)
4364
+ children: Tr(e)
4163
4365
  }), /* @__PURE__ */ w(U, {
4164
4366
  size: "$xs",
4165
4367
  color: "$colorMuted",
@@ -4170,7 +4372,7 @@ function Tr({ doctype: e, id: t }) {
4170
4372
  size: "$xs",
4171
4373
  children: e.user_id
4172
4374
  }),
4173
- e.action === "update" && /* @__PURE__ */ w(Cr, { diff: e.diff })
4375
+ e.action === "update" && /* @__PURE__ */ w(wr, { diff: e.diff })
4174
4376
  ]
4175
4377
  })
4176
4378
  }, e.id))
@@ -4179,8 +4381,8 @@ function Tr({ doctype: e, id: t }) {
4179
4381
  }
4180
4382
  //#endregion
4181
4383
  //#region src/components/list/AsOfDatePicker.tsx
4182
- var Er = "Time travel not available for this DocType";
4183
- function Dr(e) {
4384
+ var Dr = "Time travel not available for this DocType";
4385
+ function Or(e) {
4184
4386
  let t = e.trim();
4185
4387
  if (!t) return;
4186
4388
  let n = t.match(/^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/);
@@ -4188,12 +4390,12 @@ function Dr(e) {
4188
4390
  let [, r, i, a, o] = n;
4189
4391
  return `${r}T${i}:${a}:${o ?? "00"}Z`;
4190
4392
  }
4191
- function Or(e) {
4393
+ function kr(e) {
4192
4394
  if (!e) return "";
4193
4395
  let t = e.match(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2})/);
4194
4396
  return t ? t[1] : "";
4195
4397
  }
4196
- function kr(e) {
4398
+ function Ar(e) {
4197
4399
  if (!e || typeof e != "object") return !1;
4198
4400
  let t = e.metadata;
4199
4401
  if (t && typeof t == "object") {
@@ -4203,10 +4405,10 @@ function kr(e) {
4203
4405
  let n = e.versioning_enabled;
4204
4406
  return typeof n == "boolean" ? n : !1;
4205
4407
  }
4206
- function Ar({ doctype: e, asOf: t, onAsOfChange: n, onError: r }) {
4207
- let { t: i } = $("desk"), { meta: a } = Lt(e ?? ""), [o, s] = v(!1), [c, l] = v(""), u = g(() => kr(a), [a]);
4408
+ function jr({ doctype: e, asOf: t, onAsOfChange: n, onError: r }) {
4409
+ let { t: i } = $("desk"), { meta: a } = Lt(e ?? ""), [o, s] = v(!1), [c, l] = v(""), u = g(() => Ar(a), [a]);
4208
4410
  return h(() => {
4209
- l(Or(t));
4411
+ l(kr(t));
4210
4412
  }, [t]), e ? /* @__PURE__ */ T(q, {
4211
4413
  gap: "$sm",
4212
4414
  alignItems: "center",
@@ -4229,24 +4431,24 @@ function Ar({ doctype: e, asOf: t, onAsOfChange: n, onError: r }) {
4229
4431
  return;
4230
4432
  }
4231
4433
  if (!u) {
4232
- r?.(Er);
4434
+ r?.(Dr);
4233
4435
  return;
4234
4436
  }
4235
- let i = Dr(t);
4437
+ let i = Or(t);
4236
4438
  i && (r?.(null), n?.(i));
4237
4439
  },
4238
4440
  size: "sm"
4239
4441
  }), !u && /* @__PURE__ */ w(U, {
4240
4442
  color: "$error",
4241
4443
  role: "alert",
4242
- children: Er
4444
+ children: Dr
4243
4445
  })]
4244
4446
  })]
4245
4447
  }) : null;
4246
4448
  }
4247
4449
  //#endregion
4248
4450
  //#region src/components/layout/ShellSkeleton.tsx
4249
- var jr = () => /* @__PURE__ */ w(q, {
4451
+ var Mr = () => /* @__PURE__ */ w(q, {
4250
4452
  flex: 1,
4251
4453
  backgroundColor: "$background",
4252
4454
  children: /* @__PURE__ */ T(J, {
@@ -4289,7 +4491,7 @@ var jr = () => /* @__PURE__ */ w(q, {
4289
4491
  }, e))
4290
4492
  })]
4291
4493
  })
4292
- }), Mr = () => /* @__PURE__ */ T(J, {
4494
+ }), Nr = () => /* @__PURE__ */ T(J, {
4293
4495
  padding: "$lg",
4294
4496
  gap: "$md",
4295
4497
  backgroundColor: "$background",
@@ -4334,7 +4536,7 @@ var jr = () => /* @__PURE__ */ w(q, {
4334
4536
  ]
4335
4537
  }, e))
4336
4538
  })]
4337
- }), Nr = () => /* @__PURE__ */ T(q, {
4539
+ }), Pr = () => /* @__PURE__ */ T(q, {
4338
4540
  className: "skeleton-layout",
4339
4541
  height: "100vh",
4340
4542
  width: "100%",
@@ -4444,34 +4646,34 @@ var jr = () => /* @__PURE__ */ w(q, {
4444
4646
  width: "40%",
4445
4647
  height: 24
4446
4648
  })
4447
- }), /* @__PURE__ */ w(jr, {})]
4649
+ }), /* @__PURE__ */ w(Mr, {})]
4448
4650
  })
4449
4651
  ]
4450
- }), Pr = /* @__PURE__ */ new Map(), Fr = /* @__PURE__ */ new Map();
4451
- function Ir(e) {
4452
- Pr.set(e.type, e);
4453
- }
4652
+ }), Fr = /* @__PURE__ */ new Map(), Ir = /* @__PURE__ */ new Map();
4454
4653
  function Lr(e) {
4455
- return Pr.get(e)?.component;
4654
+ Fr.set(e.type, e);
4456
4655
  }
4457
- function Rr() {
4458
- return Array.from(Pr.values());
4656
+ function Rr(e) {
4657
+ return Fr.get(e)?.component;
4459
4658
  }
4460
- function zr(e) {
4461
- return Pr.get(e);
4659
+ function zr() {
4660
+ return Array.from(Fr.values());
4462
4661
  }
4463
- function Br(e, t) {
4464
- Fr.set(e, t);
4662
+ function Br(e) {
4663
+ return Fr.get(e);
4465
4664
  }
4466
- function Vr(e) {
4467
- return Fr.get(e) ?? ["list"];
4665
+ function Vr(e, t) {
4666
+ Ir.set(e, t);
4468
4667
  }
4469
- function Hr(e, t) {
4470
- return Vr(e).includes(t);
4668
+ function Hr(e) {
4669
+ return Ir.get(e) ?? ["list"];
4670
+ }
4671
+ function Ur(e, t) {
4672
+ return Hr(e).includes(t);
4471
4673
  }
4472
4674
  //#endregion
4473
4675
  //#region src/components/feedback/QuickEditModal.tsx
4474
- function Ur({ item: e, resource: t, titleField: n, descField: r, groupField: i, columns: a, onClose: o, onSaved: s }) {
4676
+ function Wr({ item: e, resource: t, titleField: n, descField: r, groupField: i, columns: a, onClose: o, onSaved: s }) {
4475
4677
  let { t: c } = $("desk"), [l, u] = v(String(e[n] ?? e.name)), [d, f] = v(r ? String(e[r] ?? "") : ""), [m, h] = v(String(e[i] ?? a[0]?.id ?? "")), [g, _] = v(!1), { mutate: y } = xe(), b = p(() => {
4476
4678
  _(!0);
4477
4679
  let a = {
@@ -4556,7 +4758,7 @@ function Ur({ item: e, resource: t, titleField: n, descField: r, groupField: i,
4556
4758
  marginBottom: "$xs",
4557
4759
  children: i
4558
4760
  }),
4559
- /* @__PURE__ */ w(G, {
4761
+ /* @__PURE__ */ w(ne, {
4560
4762
  value: m,
4561
4763
  onValueChange: h,
4562
4764
  options: a.map((e) => ({
@@ -4599,16 +4801,16 @@ function Ur({ item: e, resource: t, titleField: n, descField: r, groupField: i,
4599
4801
  }
4600
4802
  //#endregion
4601
4803
  //#region src/views/utils.ts
4602
- function Wr(e) {
4804
+ function Gr(e) {
4603
4805
  return e?.groupField ?? "status";
4604
4806
  }
4605
- function Gr(e) {
4807
+ function Kr(e) {
4606
4808
  return e?.titleField ?? "name";
4607
4809
  }
4608
- function Kr(e) {
4810
+ function qr(e) {
4609
4811
  return e?.descriptionField;
4610
4812
  }
4611
- function qr(e, t, n) {
4813
+ function Jr(e, t, n) {
4612
4814
  if (e?.columns && e.columns.length > 0) return e.columns;
4613
4815
  let r = /* @__PURE__ */ new Set(), i = [], a = [
4614
4816
  "#e0e0e0",
@@ -4651,15 +4853,15 @@ function qr(e, t, n) {
4651
4853
  }
4652
4854
  //#endregion
4653
4855
  //#region src/views/KanbanView.tsx
4654
- function Jr(e) {
4655
- return w(an(e.resource, "KanbanView") || Yr, { ...e });
4856
+ function Yr(e) {
4857
+ return w(an(e.resource, "KanbanView") || Xr, { ...e });
4656
4858
  }
4657
- function Yr({ resource: e, config: t, filters: n }) {
4658
- let { t: r } = $("desk"), i = Wr(t), a = Gr(t), o = Kr(t), [s, c] = v(null), [l, u] = v(null), [d, f] = v(null), { result: m, query: h } = ge({
4859
+ function Xr({ resource: e, config: t, filters: n }) {
4860
+ let { t: r } = $("desk"), i = Gr(t), a = Kr(t), o = qr(t), [s, c] = v(null), [l, u] = v(null), [d, f] = v(null), { result: m, query: h } = ge({
4659
4861
  resource: e,
4660
4862
  pagination: { pageSize: 200 },
4661
4863
  filters: n
4662
- }), _ = m?.data ?? [], y = h?.isLoading ?? !1, { mutate: b } = xe(), x = g(() => qr(t, _, i), [
4864
+ }), _ = m?.data ?? [], y = h?.isLoading ?? !1, { mutate: b } = xe(), x = g(() => Jr(t, _, i), [
4663
4865
  t,
4664
4866
  _,
4665
4867
  i
@@ -4724,7 +4926,7 @@ function Yr({ resource: e, config: t, filters: n }) {
4724
4926
  }, e))
4725
4927
  }, e))
4726
4928
  })]
4727
- }) : /* @__PURE__ */ T(C, { children: [d && /* @__PURE__ */ w(Ur, {
4929
+ }) : /* @__PURE__ */ T(C, { children: [d && /* @__PURE__ */ w(Wr, {
4728
4930
  item: d,
4729
4931
  resource: e,
4730
4932
  titleField: a,
@@ -4843,13 +5045,13 @@ function Yr({ resource: e, config: t, filters: n }) {
4843
5045
  }
4844
5046
  //#endregion
4845
5047
  //#region src/views/CalendarView.tsx
4846
- function Xr(e) {
5048
+ function Zr(e) {
4847
5049
  return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
4848
5050
  }
4849
- function Zr(e) {
4850
- return w(an(e.resource, "CalendarView") || Qr, { ...e });
5051
+ function Qr(e) {
5052
+ return w(an(e.resource, "CalendarView") || $r, { ...e });
4851
5053
  }
4852
- function Qr({ resource: e, config: t, filters: n }) {
5054
+ function $r({ resource: e, config: t, filters: n }) {
4853
5055
  let { t: r } = $("desk"), i = t.startField, a = t.titleField, o = me(), s = $t("resolveDetailRoute"), [c, l] = v("month"), [u, d] = v(/* @__PURE__ */ new Date()), f = u.getFullYear(), p = u.getMonth(), m = u.getDate(), h = u.getDay(), { startDate: _, endDate: y } = g(() => {
4854
5056
  let e, t;
4855
5057
  return c === "month" ? (e = new Date(f, p, 1), t = new Date(f, p + 1, 0)) : c === "week" ? (e = new Date(f, p, m - h), t = new Date(f, p, m + (6 - h))) : (e = new Date(f, p, m), t = new Date(f, p, m)), e.setHours(0, 0, 0, 0), t.setHours(23, 59, 59, 999), {
@@ -4889,7 +5091,7 @@ function Qr({ resource: e, config: t, filters: n }) {
4889
5091
  if (b?.data) for (let t of b.data) {
4890
5092
  let n = t[i];
4891
5093
  if (!n) continue;
4892
- let r = new Date(String(n)), a = isNaN(r.getTime()) ? String(n).split("T")[0] : Xr(r);
5094
+ let r = new Date(String(n)), a = isNaN(r.getTime()) ? String(n).split("T")[0] : Zr(r);
4893
5095
  a && (e[a] || (e[a] = []), e[a].push(t));
4894
5096
  }
4895
5097
  return e;
@@ -5031,7 +5233,7 @@ function Qr({ resource: e, config: t, filters: n }) {
5031
5233
  minHeight: 80
5032
5234
  }, `empty-${t}`)),
5033
5235
  S.map((t) => {
5034
- let n = Xr(t), i = C[n] ?? [], l = n === Xr(/* @__PURE__ */ new Date());
5236
+ let n = Zr(t), i = C[n] ?? [], l = n === Zr(/* @__PURE__ */ new Date());
5035
5237
  return /* @__PURE__ */ T(J, {
5036
5238
  width: M,
5037
5239
  backgroundColor: "$background",
@@ -5083,7 +5285,7 @@ function Qr({ resource: e, config: t, filters: n }) {
5083
5285
  }
5084
5286
  //#endregion
5085
5287
  //#region src/views/GanttView.tsx
5086
- function $r(e, t, n) {
5288
+ function ei(e, t, n) {
5087
5289
  let r = /* @__PURE__ */ new Date(), i = new Date(r.getFullYear(), r.getMonth(), r.getDate()), a = new Date(r.getFullYear(), r.getMonth(), r.getDate());
5088
5290
  for (let r of e) {
5089
5291
  let e = new Date(String(r[t] ?? "")), o = new Date(String(r[n] ?? ""));
@@ -5101,14 +5303,14 @@ function $r(e, t, n) {
5101
5303
  maxDate: a
5102
5304
  };
5103
5305
  }
5104
- function ei(e, t) {
5306
+ function ti(e, t) {
5105
5307
  let n = new Date(e.getFullYear(), e.getMonth(), e.getDate()), r = new Date(t.getFullYear(), t.getMonth(), t.getDate());
5106
5308
  return Math.round((r.getTime() - n.getTime()) / (1e3 * 60 * 60 * 24));
5107
5309
  }
5108
- function ti(e) {
5109
- return w(an(e.resource, "GanttView") || ni, { ...e });
5310
+ function ni(e) {
5311
+ return w(an(e.resource, "GanttView") || ri, { ...e });
5110
5312
  }
5111
- function ni({ resource: e, config: t, filters: n }) {
5313
+ function ri({ resource: e, config: t, filters: n }) {
5112
5314
  let { t: r } = $("desk"), i = t.nameField ?? "name", a = t.startField, o = t.endField, s = t.progressField, c = me(), l = $t("resolveDetailRoute"), { result: u, query: d } = ge({
5113
5315
  resource: e,
5114
5316
  pagination: { pageSize: 100 },
@@ -5125,12 +5327,12 @@ function ni({ resource: e, config: t, filters: n }) {
5125
5327
  maxDate: /* @__PURE__ */ new Date(),
5126
5328
  totalDays: 30
5127
5329
  };
5128
- let { minDate: t, maxDate: n } = $r(e, a, o);
5330
+ let { minDate: t, maxDate: n } = ei(e, a, o);
5129
5331
  return {
5130
5332
  tasks: e,
5131
5333
  minDate: t,
5132
5334
  maxDate: n,
5133
- totalDays: ei(t, n)
5335
+ totalDays: ti(t, n)
5134
5336
  };
5135
5337
  }, [
5136
5338
  u,
@@ -5262,7 +5464,7 @@ function ni({ resource: e, config: t, filters: n }) {
5262
5464
  }, t))
5263
5465
  }),
5264
5466
  f.map((e) => {
5265
- let t = new Date(String(e[a] ?? "")), n = new Date(String(e[o] ?? "")), r = ei(p, t), i = ei(t, n), c = s ? Number(e[s] ?? 0) : 0;
5467
+ let t = new Date(String(e[a] ?? "")), n = new Date(String(e[o] ?? "")), r = ti(p, t), i = ti(t, n), c = s ? Number(e[s] ?? 0) : 0;
5266
5468
  return /* @__PURE__ */ T(J, {
5267
5469
  height: 36,
5268
5470
  position: "relative",
@@ -5304,7 +5506,7 @@ function ni({ resource: e, config: t, filters: n }) {
5304
5506
  }
5305
5507
  //#endregion
5306
5508
  //#region src/views/TreeView.tsx
5307
- function ri({ initialValue: e, onConfirm: t, onCancel: n }) {
5509
+ function ii({ initialValue: e, onConfirm: t, onCancel: n }) {
5308
5510
  let { t: r } = $("desk"), [i, a] = v(e), o = _(null);
5309
5511
  return h(() => {
5310
5512
  o.current?.focus(), o.current?.select();
@@ -5321,7 +5523,7 @@ function ri({ initialValue: e, onConfirm: t, onCancel: n }) {
5321
5523
  "aria-label": r("Rename node")
5322
5524
  });
5323
5525
  }
5324
- function ii({ node: e, depth: t, onRename: n, onAddChild: r, dragNodeId: i, onDragStart: a, onDrop: o, onNodeClick: s }) {
5526
+ function ai({ node: e, depth: t, onRename: n, onAddChild: r, dragNodeId: i, onDragStart: a, onDrop: o, onNodeClick: s }) {
5325
5527
  let { t: c } = $("desk"), [l, u] = v(!1), [d, f] = v(!1), [m, h] = v(!1), g = i === e.id, _ = p((t) => {
5326
5528
  f(!1), t !== e.label && n(e, t);
5327
5529
  }, [e, n]), y = e.children.length > 0, b = "•";
@@ -5380,7 +5582,7 @@ function ii({ node: e, depth: t, onRename: n, onAddChild: r, dragNodeId: i, onDr
5380
5582
  children: b
5381
5583
  })
5382
5584
  }),
5383
- d ? /* @__PURE__ */ w(ri, {
5585
+ d ? /* @__PURE__ */ w(ii, {
5384
5586
  initialValue: e.label,
5385
5587
  onConfirm: _,
5386
5588
  onCancel: () => f(!1)
@@ -5427,7 +5629,7 @@ function ii({ node: e, depth: t, onRename: n, onAddChild: r, dragNodeId: i, onDr
5427
5629
  ]
5428
5630
  }), !l && y && /* @__PURE__ */ w(J, {
5429
5631
  role: "group",
5430
- children: e.children.map((e) => /* @__PURE__ */ w(ii, {
5632
+ children: e.children.map((e) => /* @__PURE__ */ w(ai, {
5431
5633
  node: e,
5432
5634
  depth: t + 1,
5433
5635
  onRename: n,
@@ -5440,10 +5642,10 @@ function ii({ node: e, depth: t, onRename: n, onAddChild: r, dragNodeId: i, onDr
5440
5642
  })]
5441
5643
  });
5442
5644
  }
5443
- function ai(e) {
5444
- return w(an(e.resource, "TreeView") || oi, { ...e });
5645
+ function oi(e) {
5646
+ return w(an(e.resource, "TreeView") || si, { ...e });
5445
5647
  }
5446
- function oi({ resource: e, config: t, filters: n, onNodeClick: r }) {
5648
+ function si({ resource: e, config: t, filters: n, onNodeClick: r }) {
5447
5649
  let { t: i } = $("desk"), a = t?.titleField || "title", o = t?.parentField || "parent_value", [s, c] = v(null), [l, u] = v(!1), d = me(), { result: f, query: m } = ge({
5448
5650
  resource: e,
5449
5651
  pagination: { pageSize: 1e3 },
@@ -5507,7 +5709,10 @@ function oi({ resource: e, config: t, filters: n, onNodeClick: r }) {
5507
5709
  b
5508
5710
  ]), k = p((t) => {
5509
5711
  let n = JSON.stringify({ [o]: t.id });
5510
- d({ to: `/app/${e}/new?form=${encodeURIComponent(n)}` });
5712
+ d({
5713
+ to: `/app/${e}/new`,
5714
+ query: { form: n }
5715
+ });
5511
5716
  }, [
5512
5717
  d,
5513
5718
  e,
@@ -5563,7 +5768,7 @@ function oi({ resource: e, config: t, filters: n, onNodeClick: r }) {
5563
5768
  }),
5564
5769
  l && /* @__PURE__ */ w(J, {
5565
5770
  marginBottom: "$sm",
5566
- children: /* @__PURE__ */ w(ri, {
5771
+ children: /* @__PURE__ */ w(ii, {
5567
5772
  initialValue: "",
5568
5773
  onConfirm: D,
5569
5774
  onCancel: () => u(!1)
@@ -5601,7 +5806,7 @@ function oi({ resource: e, config: t, filters: n, onNodeClick: r }) {
5601
5806
  }) : /* @__PURE__ */ w(J, {
5602
5807
  role: "tree",
5603
5808
  "aria-label": `${e} tree`,
5604
- children: C.map((e) => /* @__PURE__ */ w(ii, {
5809
+ children: C.map((e) => /* @__PURE__ */ w(ai, {
5605
5810
  node: e,
5606
5811
  depth: 0,
5607
5812
  onRename: O,
@@ -5618,7 +5823,7 @@ function oi({ resource: e, config: t, filters: n, onNodeClick: r }) {
5618
5823
  }
5619
5824
  //#endregion
5620
5825
  //#region src/components/list/ListBodyLayout.tsx
5621
- var si = [
5826
+ var ci = [
5622
5827
  {
5623
5828
  label: "Equals",
5624
5829
  value: "eq"
@@ -5640,7 +5845,7 @@ var si = [
5640
5845
  value: "like"
5641
5846
  }
5642
5847
  ];
5643
- function ci(e) {
5848
+ function li(e) {
5644
5849
  switch (e) {
5645
5850
  case "number": return [
5646
5851
  "eq",
@@ -5663,23 +5868,23 @@ function ci(e) {
5663
5868
  ];
5664
5869
  }
5665
5870
  }
5666
- function li(e) {
5871
+ function ui(e) {
5667
5872
  if (e) return String(typeof e == "object" ? e?.target?.value ?? e?.value ?? e : e);
5668
5873
  }
5669
- var ui = {
5874
+ var di = {
5670
5875
  eq: "=",
5671
5876
  gt: ">",
5672
5877
  lt: "<",
5673
5878
  in: "in",
5674
5879
  like: "contains"
5675
5880
  };
5676
- function di(e) {
5881
+ function fi(e) {
5677
5882
  return typeof e.value == "string" && e.value.trim().length > 0;
5678
5883
  }
5679
- function fi(e, t) {
5884
+ function pi(e, t) {
5680
5885
  return t[e.field]?.label ?? e.field;
5681
5886
  }
5682
- function pi(e, t) {
5887
+ function mi(e, t) {
5683
5888
  let n = t[e.field];
5684
5889
  if (n?.type === "boolean") {
5685
5890
  if (e.value === "true") return "True";
@@ -5687,10 +5892,10 @@ function pi(e, t) {
5687
5892
  }
5688
5893
  return n?.options?.find((t) => t.value === e.value)?.label || (e.operator === "in" ? e.value.split(",").map((e) => e.trim()).filter(Boolean).join(", ") : e.value);
5689
5894
  }
5690
- function mi(e, t) {
5691
- return `${fi(e, t)} ${ui[e.operator]} ${pi(e, t)}`;
5895
+ function hi(e, t) {
5896
+ return `${pi(e, t)} ${di[e.operator]} ${mi(e, t)}`;
5692
5897
  }
5693
- function hi(e) {
5898
+ function gi(e) {
5694
5899
  switch (e?.type) {
5695
5900
  case "number": return "number";
5696
5901
  case "date": return "date";
@@ -5698,8 +5903,8 @@ function hi(e) {
5698
5903
  default: return "text";
5699
5904
  }
5700
5905
  }
5701
- function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows: i, setSelectedRows: a, searchQuery: o, setSearchQuery: s, appliedSearchQuery: c, applySearch: l, clearSearch: u, hasPendingSearchChanges: d, filterRows: f, appliedFilterRows: p, filterableFields: m, filterFieldMap: h, addFilterRow: _, removeFilterRow: y, removeAppliedFilterRow: b, clearFilterRows: x, clearAppliedFilters: S, applyFilters: E, hasPendingFilterChanges: D, updateFilterRow: O, listFilterSlotData: k, uiError: A, timeTravelError: j, isDeleteConfirmOpen: M, setIsDeleteConfirmOpen: F, isColumnsMenuOpen: I, setIsColumnsMenuOpen: B, isMobile: V, columnPreferences: W, toggleColumnVisibility: ne, activeView: K, setActiveView: re, handleRowClick: Y, canKanban: ie, canTree: ae, canGantt: oe, title: se, listColumns: ce, tableColumns: le, tableFilters: ue, kanbanGroupField: de, kanbanColumns: fe, kanbanTitleField: pe, kanbanDescriptionField: me, detectedParentField: he, detectedLabelField: ge, ganttConfig: _e, canCalendar: ve, calendarConfig: ye, confirmBulkDelete: be, handleBulkDelete: xe, hasLockedSelection: Se, handleNew: Ce }) {
5702
- let { t: X } = $("desk"), we = A ?? j, [Te, Z] = v(!1), [Ee, De] = v(!1), Oe = o.trim().length > 0, ke = c.trim().length > 0, Ae = g(() => p.filter((e) => di(e)), [p]), je = Ae.slice(0, 3), Me = Ae.slice(3), Ne = [
5906
+ function _i({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows: i, setSelectedRows: a, searchQuery: o, setSearchQuery: s, appliedSearchQuery: c, applySearch: l, clearSearch: u, hasPendingSearchChanges: d, filterRows: f, appliedFilterRows: p, filterableFields: m, filterFieldMap: h, addFilterRow: _, removeFilterRow: y, removeAppliedFilterRow: b, clearFilterRows: x, clearAppliedFilters: S, applyFilters: E, hasPendingFilterChanges: D, updateFilterRow: O, listFilterSlotData: k, uiError: A, timeTravelError: j, isDeleteConfirmOpen: M, setIsDeleteConfirmOpen: F, isColumnsMenuOpen: I, setIsColumnsMenuOpen: B, isMobile: V, columnPreferences: W, toggleColumnVisibility: G, activeView: K, setActiveView: re, handleRowClick: Y, canKanban: ie, canTree: ae, canGantt: oe, title: se, listColumns: ce, tableColumns: le, tableFilters: ue, kanbanGroupField: de, kanbanColumns: fe, kanbanTitleField: pe, kanbanDescriptionField: me, detectedParentField: he, detectedLabelField: ge, ganttConfig: _e, canCalendar: ve, calendarConfig: ye, confirmBulkDelete: be, handleBulkDelete: xe, hasLockedSelection: Se, handleNew: Ce }) {
5907
+ let { t: X } = $("desk"), we = A ?? j, [Te, Z] = v(!1), [Ee, De] = v(!1), Oe = o.trim().length > 0, ke = c.trim().length > 0, Ae = g(() => p.filter((e) => fi(e)), [p]), je = Ae.slice(0, 3), Me = Ae.slice(3), Ne = [
5703
5908
  {
5704
5909
  key: "list",
5705
5910
  label: X("List"),
@@ -5725,7 +5930,7 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
5725
5930
  label: X("Calendar"),
5726
5931
  enabled: ve
5727
5932
  }
5728
- ].filter((e) => e.enabled), Pe = /* @__PURE__ */ T(C, { children: [Ne.length > 1 && /* @__PURE__ */ w(G, {
5933
+ ].filter((e) => e.enabled), Pe = /* @__PURE__ */ T(C, { children: [Ne.length > 1 && /* @__PURE__ */ w(ne, {
5729
5934
  value: K,
5730
5935
  onValueChange: (e) => re(e),
5731
5936
  options: Ne.map((e) => ({
@@ -5748,7 +5953,7 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
5748
5953
  strokeWidth: 2.4
5749
5954
  }), X("New")]
5750
5955
  })] });
5751
- return t ? /* @__PURE__ */ w(Mr, {}) : n ? /* @__PURE__ */ w(H, {
5956
+ return t ? /* @__PURE__ */ w(Nr, {}) : n ? /* @__PURE__ */ w(H, {
5752
5957
  padding: "$xl",
5753
5958
  backgroundColor: "$background",
5754
5959
  minHeight: "100vh",
@@ -5808,7 +6013,7 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
5808
6013
  flexWrap: "wrap",
5809
6014
  justifyContent: V ? "flex-start" : "flex-end",
5810
6015
  width: V ? "100%" : void 0,
5811
- children: [/* @__PURE__ */ w(xr, {
6016
+ children: [/* @__PURE__ */ w(Sr, {
5812
6017
  name: "list-header-actions",
5813
6018
  doctype: e
5814
6019
  }), !V && Pe]
@@ -5986,7 +6191,7 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
5986
6191
  cursor: "pointer",
5987
6192
  accentColor: "#8b5cf6"
5988
6193
  },
5989
- onChange: () => ne(e.field)
6194
+ onChange: () => G(e.field)
5990
6195
  }), /* @__PURE__ */ w(U, {
5991
6196
  fontWeight: "600",
5992
6197
  fontSize: "$sm",
@@ -6014,7 +6219,7 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
6014
6219
  color: "$colorMuted"
6015
6220
  }), !V && X("Reset")]
6016
6221
  }),
6017
- /* @__PURE__ */ w(xr, {
6222
+ /* @__PURE__ */ w(Sr, {
6018
6223
  name: "list-filters",
6019
6224
  doctype: e,
6020
6225
  data: k
@@ -6061,7 +6266,7 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
6061
6266
  ] : [{
6062
6267
  label: X("Choose value"),
6063
6268
  value: ""
6064
- }, ...n?.options ?? []], i = ci(n?.type), a = si.filter((e) => i.includes(e.value));
6269
+ }, ...n?.options ?? []], i = li(n?.type), a = ci.filter((e) => i.includes(e.value));
6065
6270
  return /* @__PURE__ */ T(q, {
6066
6271
  gap: "$sm",
6067
6272
  alignItems: "center",
@@ -6069,13 +6274,13 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
6069
6274
  flexWrap: V ? "wrap" : "nowrap",
6070
6275
  width: "100%",
6071
6276
  children: [
6072
- /* @__PURE__ */ w(G, {
6277
+ /* @__PURE__ */ w(ne, {
6073
6278
  "aria-label": `Filter field ${t + 1}`,
6074
6279
  value: e.field,
6075
6280
  options: m,
6076
6281
  width: V ? "100%" : 160,
6077
6282
  onChange: (t) => {
6078
- let r = li(t) || e.field, i = h[r]?.type, a = ci(i), o = a.includes(e.operator) ? e.operator : a[0];
6283
+ let r = ui(t) || e.field, i = h[r]?.type, a = li(i), o = a.includes(e.operator) ? e.operator : a[0];
6079
6284
  O(e.id, {
6080
6285
  field: r,
6081
6286
  operator: o,
@@ -6083,26 +6288,26 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
6083
6288
  });
6084
6289
  }
6085
6290
  }),
6086
- /* @__PURE__ */ w(G, {
6291
+ /* @__PURE__ */ w(ne, {
6087
6292
  "aria-label": `Filter operator ${t + 1}`,
6088
6293
  value: e.operator,
6089
6294
  options: a,
6090
6295
  width: V ? "100%" : 130,
6091
6296
  onChange: (t) => {
6092
- let n = li(t);
6297
+ let n = ui(t);
6093
6298
  O(e.id, { operator: n || e.operator });
6094
6299
  }
6095
6300
  }),
6096
- n?.type === "select" || n?.type === "boolean" ? /* @__PURE__ */ w(G, {
6301
+ n?.type === "select" || n?.type === "boolean" ? /* @__PURE__ */ w(ne, {
6097
6302
  "aria-label": `Filter value ${t + 1}`,
6098
6303
  value: e.value,
6099
6304
  options: r,
6100
6305
  width: V ? "100%" : 180,
6101
- onChange: (t) => O(e.id, { value: li(t) ?? "" })
6306
+ onChange: (t) => O(e.id, { value: ui(t) ?? "" })
6102
6307
  }) : /* @__PURE__ */ w(z, {
6103
6308
  "aria-label": `Filter value ${t + 1}`,
6104
6309
  placeholder: X("Value"),
6105
- type: hi(n),
6310
+ type: gi(n),
6106
6311
  value: e.value,
6107
6312
  onChangeText: (t) => O(e.id, { value: t }),
6108
6313
  width: V ? "100%" : 180
@@ -6208,12 +6413,12 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
6208
6413
  alignItems: "center",
6209
6414
  children: [/* @__PURE__ */ w(U, {
6210
6415
  fontSize: "$sm",
6211
- children: mi(e, h)
6416
+ children: hi(e, h)
6212
6417
  }), /* @__PURE__ */ w(N, {
6213
6418
  variant: "ghost",
6214
6419
  size: "sm",
6215
6420
  onPress: () => b(e.id),
6216
- "aria-label": `Remove ${fi(e, h)} filter`,
6421
+ "aria-label": `Remove ${pi(e, h)} filter`,
6217
6422
  children: "✕"
6218
6423
  })]
6219
6424
  })
@@ -6237,7 +6442,7 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
6237
6442
  })
6238
6443
  }),
6239
6444
  K === "list" && /* @__PURE__ */ T(C, { children: [
6240
- /* @__PURE__ */ w(xr, {
6445
+ /* @__PURE__ */ w(Sr, {
6241
6446
  name: "list-above-table",
6242
6447
  doctype: e
6243
6448
  }),
@@ -6297,7 +6502,7 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
6297
6502
  flex: 1,
6298
6503
  alignItems: "stretch",
6299
6504
  overflow: "hidden",
6300
- children: /* @__PURE__ */ w(ir, {
6505
+ children: /* @__PURE__ */ w(ar, {
6301
6506
  resource: e,
6302
6507
  schema: r,
6303
6508
  columns: le,
@@ -6310,7 +6515,7 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
6310
6515
  })]
6311
6516
  })
6312
6517
  }),
6313
- /* @__PURE__ */ w(xr, {
6518
+ /* @__PURE__ */ w(Sr, {
6314
6519
  name: "list-below-table",
6315
6520
  doctype: e
6316
6521
  })
@@ -6344,18 +6549,18 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
6344
6549
  justifyContent: "space-between",
6345
6550
  alignItems: "center",
6346
6551
  gap: "$sm",
6347
- children: [/* @__PURE__ */ w(U, { children: mi(e, h) }), /* @__PURE__ */ w(N, {
6552
+ children: [/* @__PURE__ */ w(U, { children: hi(e, h) }), /* @__PURE__ */ w(N, {
6348
6553
  variant: "ghost",
6349
6554
  size: "sm",
6350
6555
  onPress: () => b(e.id),
6351
- "aria-label": `Remove ${fi(e, h)} filter`,
6556
+ "aria-label": `Remove ${pi(e, h)} filter`,
6352
6557
  children: "✕"
6353
6558
  })]
6354
6559
  })
6355
6560
  }, `overflow-filter-${e.id}`))
6356
6561
  })
6357
6562
  }),
6358
- K === "kanban" && ie && de && /* @__PURE__ */ w(Jr, {
6563
+ K === "kanban" && ie && de && /* @__PURE__ */ w(Yr, {
6359
6564
  resource: e,
6360
6565
  config: {
6361
6566
  groupField: de,
@@ -6365,7 +6570,7 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
6365
6570
  },
6366
6571
  filters: ue
6367
6572
  }),
6368
- K === "tree" && ae && he && /* @__PURE__ */ w(ai, {
6573
+ K === "tree" && ae && he && /* @__PURE__ */ w(oi, {
6369
6574
  resource: e,
6370
6575
  config: {
6371
6576
  parentField: he,
@@ -6377,17 +6582,17 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
6377
6582
  filters: ue,
6378
6583
  onNodeClick: Y
6379
6584
  }),
6380
- K === "gantt" && oe && _e && /* @__PURE__ */ w(ti, {
6585
+ K === "gantt" && oe && _e && /* @__PURE__ */ w(ni, {
6381
6586
  resource: e,
6382
6587
  config: _e,
6383
6588
  filters: ue
6384
6589
  }),
6385
- K === "calendar" && ve && ye && /* @__PURE__ */ w(Zr, {
6590
+ K === "calendar" && ve && ye && /* @__PURE__ */ w(Qr, {
6386
6591
  resource: e,
6387
6592
  config: ye,
6388
6593
  filters: ue
6389
6594
  }),
6390
- /* @__PURE__ */ w(or, {
6595
+ /* @__PURE__ */ w(sr, {
6391
6596
  open: M,
6392
6597
  title: "Confirm bulk delete",
6393
6598
  message: `Delete ${i.length} selected item(s)? This cannot be undone.`,
@@ -6404,8 +6609,8 @@ function gi({ doctype: e, metaLoading: t, metaError: n, schema: r, selectedRows:
6404
6609
  }
6405
6610
  //#endregion
6406
6611
  //#region src/components/correction/CorrectionWizard.tsx
6407
- var _i = 10;
6408
- function vi({ doctype: e, id: t, isOpen: n, onClose: r, onSuccess: i, supportsInPlaceEdit: a }) {
6612
+ var vi = 10;
6613
+ function yi({ doctype: e, id: t, isOpen: n, onClose: r, onSuccess: i, supportsInPlaceEdit: a }) {
6409
6614
  let { t: o } = $("desk"), [s, c] = v("amend"), [l, u] = v(""), [d, f] = v(null), { execute: m, isLoading: _, error: y } = cn(e, t);
6410
6615
  h(() => {
6411
6616
  !a && s === "in_place_edit" && c("amend");
@@ -6425,8 +6630,8 @@ function vi({ doctype: e, id: t, isOpen: n, onClose: r, onSuccess: i, supportsIn
6425
6630
  f("Reason is required");
6426
6631
  return;
6427
6632
  }
6428
- if (e.length < _i) {
6429
- f(`Reason must be at least ${_i} characters`);
6633
+ if (e.length < vi) {
6634
+ f(`Reason must be at least ${vi} characters`);
6430
6635
  return;
6431
6636
  }
6432
6637
  f(null);
@@ -6536,7 +6741,7 @@ function vi({ doctype: e, id: t, isOpen: n, onClose: r, onSuccess: i, supportsIn
6536
6741
  }
6537
6742
  //#endregion
6538
6743
  //#region src/components/correction/CorrectButton.tsx
6539
- function yi({ doctype: e, id: t, docstatus: n, supportsInPlaceEdit: r }) {
6744
+ function bi({ doctype: e, id: t, docstatus: n, supportsInPlaceEdit: r }) {
6540
6745
  let { t: i } = $("desk"), [a, o] = v(!1), s = Me(), c = p((t) => {
6541
6746
  let n = t.id;
6542
6747
  (typeof n == "string" || typeof n == "number") && s(`/app/${e}/detail/${n}`), o(!1);
@@ -6545,7 +6750,7 @@ function yi({ doctype: e, id: t, docstatus: n, supportsInPlaceEdit: r }) {
6545
6750
  variant: "ghost",
6546
6751
  onPress: () => o(!0),
6547
6752
  children: i("Correct")
6548
- }), /* @__PURE__ */ w(vi, {
6753
+ }), /* @__PURE__ */ w(yi, {
6549
6754
  doctype: e,
6550
6755
  id: t,
6551
6756
  isOpen: a,
@@ -6556,11 +6761,11 @@ function yi({ doctype: e, id: t, docstatus: n, supportsInPlaceEdit: r }) {
6556
6761
  }
6557
6762
  //#endregion
6558
6763
  //#region src/components/sibling/SiblingPanel.tsx
6559
- function bi(e) {
6764
+ function xi(e) {
6560
6765
  return e && typeof e == "object" && !Array.isArray(e) ? e : {};
6561
6766
  }
6562
- function xi({ sibling: e, parentId: t, onSaved: n }) {
6563
- let { t: r } = $("desk"), i = ue(), a = xe(), { schema: o } = Lt(e.doctype), [s, c] = v(() => bi(e.initial_data));
6767
+ function Si({ sibling: e, parentId: t, onSaved: n }) {
6768
+ let { t: r } = $("desk"), i = ue(), a = xe(), { schema: o } = Lt(e.doctype), [s, c] = v(() => xi(e.initial_data));
6564
6769
  return /* @__PURE__ */ T(P, {
6565
6770
  padding: "$md",
6566
6771
  borderWidth: 1,
@@ -6569,12 +6774,12 @@ function xi({ sibling: e, parentId: t, onSaved: n }) {
6569
6774
  size: "$xs",
6570
6775
  marginBottom: "$sm",
6571
6776
  children: e.label
6572
- }), o ? /* @__PURE__ */ w(Qn, {
6777
+ }), o ? /* @__PURE__ */ w($n, {
6573
6778
  schema: o,
6574
6779
  formData: s,
6575
- onChange: (e) => c(bi(e)),
6780
+ onChange: (e) => c(xi(e)),
6576
6781
  onSubmit: (r) => {
6577
- let o = bi(r), s = o.id, c = typeof s == "string" || typeof s == "number" ? String(s) : void 0;
6782
+ let o = xi(r), s = o.id, c = typeof s == "string" || typeof s == "number" ? String(s) : void 0;
6578
6783
  if (c) {
6579
6784
  a.mutate({
6580
6785
  resource: e.doctype,
@@ -6599,7 +6804,7 @@ function xi({ sibling: e, parentId: t, onSaved: n }) {
6599
6804
  })]
6600
6805
  });
6601
6806
  }
6602
- function Si({ doctype: e, id: t }) {
6807
+ function Ci({ doctype: e, id: t }) {
6603
6808
  let { t: n } = $("desk"), { siblings: r, isLoading: i, error: a, refetch: o } = pn(e);
6604
6809
  if (i) return /* @__PURE__ */ w(H, {
6605
6810
  marginTop: "$md",
@@ -6632,7 +6837,7 @@ function Si({ doctype: e, id: t }) {
6632
6837
  children: [/* @__PURE__ */ w(U, {
6633
6838
  color: "$colorMuted",
6634
6839
  children: n("Right-side metadata overlay")
6635
- }), s.map((e) => /* @__PURE__ */ w(xi, {
6840
+ }), s.map((e) => /* @__PURE__ */ w(Si, {
6636
6841
  sibling: e,
6637
6842
  parentId: t,
6638
6843
  onSaved: o
@@ -6644,7 +6849,7 @@ function Si({ doctype: e, id: t }) {
6644
6849
  children: [/* @__PURE__ */ w(U, {
6645
6850
  color: "$colorMuted",
6646
6851
  children: n("Sibling tabs")
6647
- }), c.map((e) => /* @__PURE__ */ w(xi, {
6852
+ }), c.map((e) => /* @__PURE__ */ w(Si, {
6648
6853
  sibling: e,
6649
6854
  parentId: t,
6650
6855
  onSaved: o
@@ -6655,7 +6860,7 @@ function Si({ doctype: e, id: t }) {
6655
6860
  }
6656
6861
  //#endregion
6657
6862
  //#region src/components/CommandPalette.tsx
6658
- var Ci = [
6863
+ var wi = [
6659
6864
  {
6660
6865
  id: "cmd-dashboard",
6661
6866
  type: "command",
@@ -6678,7 +6883,7 @@ var Ci = [
6678
6883
  description: "Sign out of your account"
6679
6884
  }
6680
6885
  ];
6681
- function wi({ open: e, onClose: t }) {
6886
+ function Ti({ open: e, onClose: t }) {
6682
6887
  let { t: n } = $("desk"), [r, i] = v(""), [a, o] = v(0), [s, c] = v([]), l = _(null), u = me(), d = Mt();
6683
6888
  h(() => {
6684
6889
  async function t() {
@@ -6693,7 +6898,7 @@ function wi({ open: e, onClose: t }) {
6693
6898
  doctype: e.name
6694
6899
  })));
6695
6900
  } catch {
6696
- c(br().map((e) => ({
6901
+ c(xr().map((e) => ({
6697
6902
  id: `doctype-${e.name}`,
6698
6903
  type: "doctype",
6699
6904
  label: e.label ?? e.name,
@@ -6743,7 +6948,7 @@ function wi({ open: e, onClose: t }) {
6743
6948
  ...y,
6744
6949
  ...s.filter((t) => t.label.toLowerCase().includes(e) || t.doctype?.toLowerCase().includes(e)),
6745
6950
  ...m,
6746
- ...Ci.filter((t) => t.label.toLowerCase().includes(e))
6951
+ ...wi.filter((t) => t.label.toLowerCase().includes(e))
6747
6952
  ].slice(0, 10);
6748
6953
  }, [
6749
6954
  s,
@@ -6886,7 +7091,7 @@ function wi({ open: e, onClose: t }) {
6886
7091
  }
6887
7092
  //#endregion
6888
7093
  //#region src/components/menu/index.tsx
6889
- var Ti = () => {
7094
+ var Ei = () => {
6890
7095
  let { t: e } = $("desk"), { mutate: t } = ve(), { menuItems: n } = ye();
6891
7096
  return /* @__PURE__ */ T(J, {
6892
7097
  tag: "nav",
@@ -6924,7 +7129,7 @@ var Ti = () => {
6924
7129
  children: e("Logout")
6925
7130
  })]
6926
7131
  });
6927
- }, Ei = () => {
7132
+ }, Di = () => {
6928
7133
  let { breadcrumbs: e } = le();
6929
7134
  return !e || e.length === 0 ? null : /* @__PURE__ */ w(q, {
6930
7135
  alignItems: "center",
@@ -6954,31 +7159,31 @@ var Ti = () => {
6954
7159
  }, `breadcrumb-${t.label}`);
6955
7160
  })
6956
7161
  });
6957
- }, Di = {
7162
+ }, Oi = {
6958
7163
  "1/3": 1,
6959
7164
  "2/3": 2,
6960
7165
  "1/2": 1,
6961
7166
  auto: 1
6962
- }, Oi = {
7167
+ }, ki = {
6963
7168
  "1/3": "28%",
6964
7169
  "2/3": "60%",
6965
7170
  "1/2": "45%",
6966
7171
  auto: "0"
6967
7172
  };
6968
- function ki({ width: e, children: t }) {
7173
+ function Ai({ width: e, children: t }) {
6969
7174
  return /* @__PURE__ */ w(H, {
6970
- flex: e ? Di[e] : 1,
6971
- minWidth: e ? Oi[e] : "0",
7175
+ flex: e ? Oi[e] : 1,
7176
+ minWidth: e ? ki[e] : "0",
6972
7177
  gap: "$sm",
6973
7178
  children: t
6974
7179
  });
6975
7180
  }
6976
- function Ai({ columns: e, equalColumns: t = 1, children: n }) {
7181
+ function ji({ columns: e, equalColumns: t = 1, children: n }) {
6977
7182
  return e && e.length > 0 ? /* @__PURE__ */ w(q, {
6978
7183
  gap: "$md",
6979
7184
  flexWrap: "wrap",
6980
7185
  flex: 1,
6981
- children: e.map((e, t) => /* @__PURE__ */ w(ki, {
7186
+ children: e.map((e, t) => /* @__PURE__ */ w(Ai, {
6982
7187
  width: e.width,
6983
7188
  children: e.children
6984
7189
  }, t))
@@ -6997,7 +7202,7 @@ function Ai({ columns: e, equalColumns: t = 1, children: n }) {
6997
7202
  }
6998
7203
  //#endregion
6999
7204
  //#region src/components/layout/PageHeader.tsx
7000
- function ji({ title: e, breadcrumb: t, extra: n, children: r, isMobile: i }) {
7205
+ function Mi({ title: e, breadcrumb: t, extra: n, children: r, isMobile: i }) {
7001
7206
  return /* @__PURE__ */ T(J, {
7002
7207
  marginBottom: "$lg",
7003
7208
  gap: "$sm",
@@ -7040,7 +7245,7 @@ function ji({ title: e, breadcrumb: t, extra: n, children: r, isMobile: i }) {
7040
7245
  }
7041
7246
  //#endregion
7042
7247
  //#region src/components/layout/index.tsx
7043
- var Mi = ({ sidebar: e, navbar: t, children: n, isMobile: r = !1 }) => /* @__PURE__ */ T(q, {
7248
+ var Ni = ({ sidebar: e, navbar: t, children: n, isMobile: r = !1 }) => /* @__PURE__ */ T(q, {
7044
7249
  className: "shell-layout",
7045
7250
  flexDirection: r ? "column-reverse" : "row",
7046
7251
  height: "100vh",
@@ -7065,7 +7270,7 @@ var Mi = ({ sidebar: e, navbar: t, children: n, isMobile: r = !1 }) => /* @__PUR
7065
7270
  });
7066
7271
  //#endregion
7067
7272
  //#region src/workspace/WorkspaceSection.tsx
7068
- function Ni({ workspace: e, collapsed: t = !1 }) {
7273
+ function Pi({ workspace: e, collapsed: t = !1 }) {
7069
7274
  let [n, r] = v(!0), i = me(), a = (e) => {
7070
7275
  e.type === "shortcut" ? i({ to: `/app/${e.doctype}/list` }) : e.type === "link" && (e.newTab ? window.open(e.url, "_blank") : e.url.startsWith("/") ? i({ to: e.url }) : window.location.href = e.url);
7071
7276
  };
@@ -7140,16 +7345,16 @@ function Ni({ workspace: e, collapsed: t = !1 }) {
7140
7345
  }
7141
7346
  //#endregion
7142
7347
  //#region src/pages/ListView.tsx
7143
- var Pi = new Set(Pn.filter((e) => e !== "name"));
7144
- function Fi(e) {
7348
+ var Fi = new Set(Pn.filter((e) => e !== "name"));
7349
+ function Ii(e) {
7145
7350
  if (!e || typeof e != "object") return {};
7146
7351
  let t = e.properties;
7147
7352
  return !t || typeof t != "object" ? {} : t;
7148
7353
  }
7149
- function Ii(e) {
7354
+ function Li(e) {
7150
7355
  return !e?.enum || !Array.isArray(e.enum) ? [] : e.enum.filter((e) => typeof e == "string");
7151
7356
  }
7152
- function Li(e) {
7357
+ function Ri(e) {
7153
7358
  if (!e) return !1;
7154
7359
  if (Array.isArray(e.enum) && e.enum.length > 0) return !0;
7155
7360
  let t = String(e.format ?? "").toLowerCase();
@@ -7157,7 +7362,7 @@ function Li(e) {
7157
7362
  let n = typeof e["x-fieldtype"] == "string" ? e["x-fieldtype"].toLowerCase() : "";
7158
7363
  return n === "link" || n === "select";
7159
7364
  }
7160
- function Ri(e) {
7365
+ function zi(e) {
7161
7366
  if (!e) return "text";
7162
7367
  if (Array.isArray(e.enum) && e.enum.length > 0) return "select";
7163
7368
  let t = Array.isArray(e.type) ? e.type[0] : e.type;
@@ -7166,16 +7371,16 @@ function Ri(e) {
7166
7371
  let n = String(e.format ?? "").toLowerCase();
7167
7372
  return n === "date" ? "date" : n === "date-time" ? "datetime" : "text";
7168
7373
  }
7169
- function zi(...e) {
7374
+ function Bi(...e) {
7170
7375
  for (let t of e) if (typeof t == "string" && t.trim()) return t;
7171
7376
  }
7172
- function Bi(e) {
7377
+ function Vi(e) {
7173
7378
  return e.replaceAll("_", " ").split(" ").map((e) => e ? e.charAt(0).toUpperCase() + e.slice(1) : "").join(" ");
7174
7379
  }
7175
- function Vi(e) {
7380
+ function Hi(e) {
7176
7381
  return e ? e["x-hidden"] === !0 || e.ui_meta?.hidden === !0 || e.type === "object" || e.type === "array" : !1;
7177
7382
  }
7178
- function Hi(e, t) {
7383
+ function Ui(e, t) {
7179
7384
  if (t == null || t === "") return "-";
7180
7385
  if (typeof t == "boolean") return t ? "Yes" : "No";
7181
7386
  let n = String(e?.format ?? "").toLowerCase();
@@ -7185,13 +7390,13 @@ function Hi(e, t) {
7185
7390
  }
7186
7391
  return String(t);
7187
7392
  }
7188
- function Ui({ doctype: e, view: t }) {
7189
- let n = Ne(), r = Me(), i = e ?? n.doctype ?? "Task", { data: a } = pe(), o = !!a, s = l(), { schema: c, permissions: u, isLoading: d, error: f } = Lt(i), { uiMeta: m } = Vt(i), [h, _] = v(null), [y, b] = v(null), [x, S] = v([]), C = g(() => Fi(c), [c]), T = g(() => {
7190
- let e = Object.entries(C).filter(([e, t]) => !Pi.has(e) && !Vi(t)).map(([e, t]) => ({
7191
- label: typeof t.title == "string" && t.title.trim() ? t.title : Bi(e),
7393
+ function Wi({ doctype: e, view: t }) {
7394
+ let n = Ne(), r = Me(), i = e ?? n.doctype ?? "Task", { data: a } = pe(), o = !!a, s = l(), { schema: c, permissions: u, isLoading: d, error: f } = Lt(i), { uiMeta: m } = Vt(i), [h, _] = v(null), [y, b] = v(null), [x, S] = v([]), C = g(() => Ii(c), [c]), T = g(() => {
7395
+ let e = Object.entries(C).filter(([e, t]) => !Fi.has(e) && !Hi(t)).map(([e, t]) => ({
7396
+ label: typeof t.title == "string" && t.title.trim() ? t.title : Vi(e),
7192
7397
  value: e,
7193
- type: Ri(t),
7194
- options: Ii(t).map((e) => ({
7398
+ type: zi(t),
7399
+ options: Li(t).map((e) => ({
7195
7400
  label: e,
7196
7401
  value: e
7197
7402
  }))
@@ -7204,17 +7409,17 @@ function Ui({ doctype: e, view: t }) {
7204
7409
  }, [C]), E = g(() => T.reduce((e, t) => (e[t.value] = t, e), {}), [T]), { searchQuery: D, setSearchQuery: O, appliedSearchQuery: k, applySearch: A, clearSearch: j, hasPendingSearchChanges: M, filterRows: N, appliedFilterRows: P, asOfFilter: F, setAsOfFilter: I, tableFilters: L, hasPendingFilterChanges: R, addFilterRow: z, applyFilters: B, updateFilterRow: V, removeFilterRow: H, removeAppliedFilterRow: U, clearFilterRows: ee, clearAppliedFilters: W } = vn(T), te = g(() => {
7205
7410
  let e = m?.additional_views?.tree;
7206
7411
  return e?.parentField ? e.parentField : C.parent_doctype ? "parent_doctype" : C.parent ? "parent" : Object.keys(C).find((e) => e.startsWith("parent_") || e.endsWith("_parent"));
7207
- }, [m, C]), G = g(() => Object.entries(C).filter(([, e]) => Li(e)).map(([e]) => e), [C]), ne = m?.additional_views?.kanban, K = m?.additional_views?.gantt, re = m?.additional_views?.calendar, q = g(() => zi(ne?.groupByField, C.status ? "status" : void 0, C.workflow_state ? "workflow_state" : void 0, G[0]), [
7208
- ne,
7412
+ }, [m, C]), ne = g(() => Object.entries(C).filter(([, e]) => Ri(e)).map(([e]) => e), [C]), G = m?.additional_views?.kanban, K = m?.additional_views?.gantt, re = m?.additional_views?.calendar, q = g(() => Bi(G?.groupByField, C.status ? "status" : void 0, C.workflow_state ? "workflow_state" : void 0, ne[0]), [
7413
+ G,
7209
7414
  C,
7210
- G
7211
- ]), J = !!q, Y = !!te, ie = g(() => zi(K?.startField, C.start_date ? "start_date" : void 0, C.start ? "start" : void 0), [K, C]), ae = g(() => zi(K?.endField, C.due_date ? "due_date" : void 0, C.end_date ? "end_date" : void 0, C.end ? "end" : void 0), [K, C]), oe = g(() => {
7415
+ ne
7416
+ ]), J = !!q, Y = !!te, ie = g(() => Bi(K?.startField, C.start_date ? "start_date" : void 0, C.start ? "start" : void 0), [K, C]), ae = g(() => Bi(K?.endField, C.due_date ? "due_date" : void 0, C.end_date ? "end_date" : void 0, C.end ? "end" : void 0), [K, C]), oe = g(() => {
7212
7417
  if (!(!ie || !ae)) return {
7213
- nameField: zi(K?.nameField, C.title ? "title" : void 0, C.subject ? "subject" : void 0, C.name ? "name" : void 0) ?? "name",
7418
+ nameField: Bi(K?.nameField, C.title ? "title" : void 0, C.subject ? "subject" : void 0, C.name ? "name" : void 0) ?? "name",
7214
7419
  startField: ie,
7215
7420
  endField: ae,
7216
- progressField: zi(K?.progressField, C.progress ? "progress" : void 0),
7217
- parentField: zi(K?.parentField, te)
7421
+ progressField: Bi(K?.progressField, C.progress ? "progress" : void 0),
7422
+ parentField: Bi(K?.parentField, te)
7218
7423
  };
7219
7424
  }, [
7220
7425
  K,
@@ -7222,10 +7427,10 @@ function Ui({ doctype: e, view: t }) {
7222
7427
  ie,
7223
7428
  ae,
7224
7429
  te
7225
- ]), se = !!oe, ce = g(() => zi(re?.startField, C.date ? "date" : void 0, C.start_date ? "start_date" : void 0), [re, C]), le = g(() => {
7430
+ ]), se = !!oe, ce = g(() => Bi(re?.startField, C.date ? "date" : void 0, C.start_date ? "start_date" : void 0), [re, C]), le = g(() => {
7226
7431
  if (ce) return {
7227
7432
  startField: ce,
7228
- titleField: zi(re?.titleField, C.title ? "title" : void 0, C.name ? "name" : void 0) ?? "name"
7433
+ titleField: Bi(re?.titleField, C.title ? "title" : void 0, C.name ? "name" : void 0) ?? "name"
7229
7434
  };
7230
7435
  }, [
7231
7436
  re,
@@ -7235,14 +7440,14 @@ function Ui({ doctype: e, view: t }) {
7235
7440
  let e = m?.list?.columns || m?.list_columns;
7236
7441
  return Array.isArray(e) && e.length > 0 ? e.map((e) => ({
7237
7442
  field: typeof e == "string" ? e : String(e.field ?? ""),
7238
- label: typeof e == "string" ? Bi(e) : String(e.label ?? e.field ?? ""),
7443
+ label: typeof e == "string" ? Vi(e) : String(e.label ?? e.field ?? ""),
7239
7444
  width: typeof e == "object" && e && Number(e.width) || void 0,
7240
7445
  sortable: typeof e == "object" && e ? e.sortable !== !1 : !0
7241
- })).filter((e) => e.field) : Object.keys(C).filter((e) => !Pi.has(e) && !Vi(C[e])).sort((e, t) => e === "name" ? -1 : +(t === "name")).slice(0, 4).map((e) => {
7446
+ })).filter((e) => e.field) : Object.keys(C).filter((e) => !Fi.has(e) && !Hi(C[e])).sort((e, t) => e === "name" ? -1 : +(t === "name")).slice(0, 4).map((e) => {
7242
7447
  let t = C[e];
7243
7448
  return {
7244
7449
  field: e,
7245
- label: typeof t?.title == "string" && t.title || Bi(e),
7450
+ label: typeof t?.title == "string" && t.title || Vi(e),
7246
7451
  width: void 0,
7247
7452
  sortable: !0
7248
7453
  };
@@ -7261,14 +7466,14 @@ function Ui({ doctype: e, view: t }) {
7261
7466
  header: e.label,
7262
7467
  size: e.width,
7263
7468
  enableSorting: e.sortable ?? !0,
7264
- cell: ({ getValue: t }) => Hi(C[e.field], t())
7469
+ cell: ({ getValue: t }) => Ui(C[e.field], t())
7265
7470
  })), [we, C]), Z = g(() => {
7266
7471
  let e = m?.additional_views?.tree;
7267
- return zi(e?.labelField, C.title ? "title" : void 0, C.subject ? "subject" : void 0, C.label ? "label" : void 0, C.name ? "name" : void 0) ?? "name";
7268
- }, [m, C]), Ee = g(() => q ? Ii(C[q]).map((e) => ({
7472
+ return Bi(e?.labelField, C.title ? "title" : void 0, C.subject ? "subject" : void 0, C.label ? "label" : void 0, C.name ? "name" : void 0) ?? "name";
7473
+ }, [m, C]), Ee = g(() => q ? Li(C[q]).map((e) => ({
7269
7474
  id: e,
7270
7475
  title: e.charAt(0).toUpperCase() + e.slice(1).replaceAll("_", " ")
7271
- })) : [], [q, C]), De = zi(ne?.cardTitleField, C.title ? "title" : void 0, C.subject ? "subject" : void 0, C.name ? "name" : void 0, "name"), Oe = zi(ne?.cardSubtitleField, C.description ? "description" : void 0, C.notes ? "notes" : void 0), ke = p(() => {
7476
+ })) : [], [q, C]), De = Bi(G?.cardTitleField, C.title ? "title" : void 0, C.subject ? "subject" : void 0, C.name ? "name" : void 0, "name"), Oe = Bi(G?.cardSubtitleField, C.description ? "description" : void 0, C.notes ? "notes" : void 0), ke = p(() => {
7272
7477
  if (!o) {
7273
7478
  _("Authentication required. Please login first."), r("/login");
7274
7479
  return;
@@ -7302,7 +7507,7 @@ function Ui({ doctype: e, view: t }) {
7302
7507
  Ae,
7303
7508
  i,
7304
7509
  je
7305
- ]), Ie = g(() => Bi(i), [i]), Le = g(() => {
7510
+ ]), Ie = g(() => Vi(i), [i]), Le = g(() => {
7306
7511
  let e = s;
7307
7512
  for (let t of e || []) if (t.resources?.some((e) => e.name === i)) return t.label || t.app_id || "App";
7308
7513
  return "App";
@@ -7310,7 +7515,7 @@ function Ui({ doctype: e, view: t }) {
7310
7515
  let t = Number(e.docstatus);
7311
7516
  return t === 1 || t === 2;
7312
7517
  }), [x]);
7313
- return /* @__PURE__ */ w(gi, {
7518
+ return /* @__PURE__ */ w(_i, {
7314
7519
  doctype: i,
7315
7520
  metaLoading: d,
7316
7521
  metaError: f,
@@ -7384,7 +7589,7 @@ function Ui({ doctype: e, view: t }) {
7384
7589
  }
7385
7590
  //#endregion
7386
7591
  //#region src/components/form/FormToolbar.tsx
7387
- function Wi({ frm: e, submitLabel: t, docstatus: n }) {
7592
+ function Gi({ frm: e, submitLabel: t, docstatus: n }) {
7388
7593
  let { t: r } = $("desk"), i = e.isLocked;
7389
7594
  return /* @__PURE__ */ w(P, {
7390
7595
  style: {
@@ -7440,17 +7645,17 @@ function Wi({ frm: e, submitLabel: t, docstatus: n }) {
7440
7645
  }
7441
7646
  //#endregion
7442
7647
  //#region src/shell/context.ts
7443
- var Gi = f(null);
7648
+ var Ki = f(null);
7444
7649
  //#endregion
7445
7650
  //#region src/hooks/useShell.ts
7446
- function Ki() {
7447
- let e = m(Gi);
7651
+ function qi() {
7652
+ let e = m(Ki);
7448
7653
  if (!e) throw Error("useShell must be used within a ShellProvider");
7449
7654
  return e;
7450
7655
  }
7451
7656
  //#endregion
7452
7657
  //#region src/components/form/FormViewHeader.tsx
7453
- var qi = ({ appName: e, isSingleton: t, doctype: n, id: r, isEditing: i, displayName: a, title: o, frm: s, submitLabel: c, onSave: l, onDiscard: u, isSaving: d, isLocked: f, docstatus: p, showSystemInfo: m, setShowSystemInfo: h, openPrintPreview: g, downloadPrintPdf: _, isMobile: v = !1, onDelete: y }) => {
7658
+ var Ji = ({ appName: e, isSingleton: t, doctype: n, id: r, isEditing: i, displayName: a, title: o, frm: s, submitLabel: c, onSave: l, onDiscard: u, isSaving: d, isLocked: f, docstatus: p, showSystemInfo: m, setShowSystemInfo: h, openPrintPreview: g, downloadPrintPdf: _, isMobile: v = !1, onDelete: y }) => {
7454
7659
  let { t: b } = $("desk");
7455
7660
  return /* @__PURE__ */ T(H, {
7456
7661
  marginBottom: "$lg",
@@ -7540,7 +7745,7 @@ var qi = ({ appName: e, isSingleton: t, doctype: n, id: r, isEditing: i, display
7540
7745
  children: c
7541
7746
  })] })
7542
7747
  }),
7543
- i && s.workflow && /* @__PURE__ */ w(gr, {
7748
+ i && s.workflow && /* @__PURE__ */ w(_r, {
7544
7749
  doctype: n,
7545
7750
  id: r,
7546
7751
  showState: !0,
@@ -7644,21 +7849,21 @@ var qi = ({ appName: e, isSingleton: t, doctype: n, id: r, isEditing: i, display
7644
7849
  s.notices && s.notices.length > 0 && /* @__PURE__ */ w(H, {
7645
7850
  marginBottom: "$md",
7646
7851
  gap: "$sm",
7647
- children: s.notices.map((e, t) => /* @__PURE__ */ w(cr, {
7852
+ children: s.notices.map((e, t) => /* @__PURE__ */ w(lr, {
7648
7853
  message: e,
7649
7854
  variant: "info"
7650
7855
  }, `${e}-${t}`))
7651
7856
  }),
7652
7857
  s.isLocked && /* @__PURE__ */ w(H, {
7653
7858
  marginBottom: "$md",
7654
- children: /* @__PURE__ */ w(lr, { docstatus: Number(s.doc?.docstatus) === 2 ? 2 : 1 })
7859
+ children: /* @__PURE__ */ w(ur, { docstatus: Number(s.doc?.docstatus) === 2 ? 2 : 1 })
7655
7860
  })
7656
7861
  ]
7657
7862
  });
7658
7863
  };
7659
7864
  //#endregion
7660
7865
  //#region src/pages/FormView.tsx
7661
- function Ji({ doctype: e, id: t }) {
7866
+ function Yi({ doctype: e, id: t }) {
7662
7867
  let { doctype: n, id: r, frm: i, schema: a, metaLoading: o, metaError: s, docError: c, record: l } = en({
7663
7868
  doctype: e,
7664
7869
  id: t
@@ -7674,17 +7879,17 @@ function Ji({ doctype: e, id: t }) {
7674
7879
  };
7675
7880
  return u ? /* @__PURE__ */ w(u, {
7676
7881
  ...d,
7677
- children: /* @__PURE__ */ w(Yi, { ...d })
7678
- }) : /* @__PURE__ */ w(Yi, { ...d });
7882
+ children: /* @__PURE__ */ w(Xi, { ...d })
7883
+ }) : /* @__PURE__ */ w(Xi, { ...d });
7679
7884
  }
7680
- function Yi({ doctype: e, id: t, frm: n, meta: r, metaLoading: i, metaError: a, docError: o, record: s }) {
7885
+ function Xi({ doctype: e, id: t, frm: n, meta: r, metaLoading: i, metaError: a, docError: o, record: s }) {
7681
7886
  let { t: c, changeLanguage: u, language: d } = $("desk"), f = {
7682
7887
  isMobile: !1,
7683
7888
  rightSidebarOpen: !1,
7684
7889
  setRightSidebarOpen: () => {}
7685
7890
  };
7686
7891
  try {
7687
- f = Ki();
7892
+ f = qi();
7688
7893
  } catch {}
7689
7894
  let p = [];
7690
7895
  try {
@@ -7698,64 +7903,45 @@ function Yi({ doctype: e, id: t, frm: n, meta: r, metaLoading: i, metaError: a,
7698
7903
  frm: n,
7699
7904
  shell: f,
7700
7905
  apps: p
7701
- }), { mutateAsync: W } = de(), te = Me(), [G] = Pe(), ne = _(!1), K = _(null), re = _(null), [J, Y] = v(!1), ie = _(!1);
7906
+ }), { mutateAsync: W } = de(), te = Me(), [ne] = Pe(), G = _(null), K = _(null), [re, J] = v(!1), Y = _(!1);
7702
7907
  h(() => {
7908
+ G.current = null, K.current = null;
7909
+ }, [
7910
+ t,
7911
+ e,
7912
+ ne.get("form")
7913
+ ]), h(() => {
7703
7914
  if (s) {
7704
7915
  let e = JSON.stringify(s);
7705
- re.current !== e && (re.current = e, K.current = e);
7706
- } else if (n.doc && K.current === null) {
7707
- let e = setTimeout(() => {
7708
- K.current = JSON.stringify(n.doc);
7709
- }, 500);
7710
- return () => clearTimeout(e);
7711
- }
7916
+ K.current !== e && (K.current = e, G.current = e);
7917
+ } else n.doc && G.current === null && (G.current = JSON.stringify(n.doc));
7712
7918
  }, [s, n.doc]), h(() => {
7713
- K.current && n.doc && !n.isSaving && Y(JSON.stringify(n.doc) !== K.current);
7919
+ G.current && n.doc && !n.isSaving && J(JSON.stringify(n.doc) !== G.current);
7714
7920
  }, [n.doc, n.isSaving]), h(() => {
7715
- let e = G.get("lng");
7921
+ let e = ne.get("lng");
7716
7922
  e && u && d !== e && u(e).catch(() => void 0);
7717
- let t;
7718
- if (!I && !ne.current && n.doc) {
7719
- let e = !1, r = { ...n.doc }, i = G.get("form");
7720
- if (i) try {
7721
- let t = JSON.parse(i);
7722
- Object.entries(t).forEach(([t, n]) => {
7723
- (r[t] === void 0 || r[t] === null || r[t] === "") && (r[t] = n, e = !0);
7724
- });
7725
- } catch (e) {
7726
- console.error("Failed to parse form query parameter:", e);
7727
- }
7728
- e && (t = setTimeout(() => {
7729
- n.setDoc(r);
7730
- }, 50)), ne.current = !0;
7731
- }
7732
- return () => {
7733
- t && clearTimeout(t);
7734
- };
7735
7923
  }, [
7736
- I,
7737
- n,
7738
- G,
7924
+ ne,
7739
7925
  u,
7740
7926
  d
7741
7927
  ]), h(() => {
7742
- if (!J || n.isSaving || typeof window > "u" || !window.addEventListener) return;
7928
+ if (!re || n.isSaving || typeof window > "u" || !window.addEventListener) return;
7743
7929
  let e = (e) => {
7744
7930
  e.preventDefault(), e.returnValue = "";
7745
7931
  };
7746
7932
  return window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
7747
- }, [J, n.isSaving]);
7748
- let ae = Ae(({ currentLocation: e, nextLocation: t }) => ie.current || t.state?.bypassBlocker ? !1 : J && !n.isSaving && e.pathname !== t.pathname);
7933
+ }, [re, n.isSaving]);
7934
+ let ie = Ae(({ currentLocation: e, nextLocation: t }) => Y.current || t.state?.bypassBlocker ? !1 : re && !n.isSaving && e.pathname !== t.pathname);
7749
7935
  h(() => {
7750
- ae.state === "blocked" && E(!0);
7751
- }, [ae.state]), h(() => {
7936
+ ie.state === "blocked" && E(!0);
7937
+ }, [ie.state]), h(() => {
7752
7938
  if (typeof window > "u" || !window.addEventListener) return;
7753
7939
  let e = (e) => {
7754
7940
  (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "s" && (e.preventDefault(), !n.isLocked && !n.isSaving && n.save({ preventNavigation: !!k?.auto_save }));
7755
7941
  };
7756
7942
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
7757
7943
  }, [n, k?.auto_save]), h(() => {
7758
- if (k?.auto_save && I && J && !n.isSaving && !n.isLocked && (!s || s.docstatus === 0 || s.docstatus === void 0)) {
7944
+ if (k?.auto_save && I && re && !n.isSaving && !n.isLocked && (!s || s.docstatus === 0 || s.docstatus === void 0)) {
7759
7945
  let e = setTimeout(() => {
7760
7946
  n.save({ preventNavigation: !0 });
7761
7947
  }, 1500);
@@ -7764,27 +7950,27 @@ function Yi({ doctype: e, id: t, frm: n, meta: r, metaLoading: i, metaError: a,
7764
7950
  }, [
7765
7951
  k?.auto_save,
7766
7952
  I,
7767
- J,
7953
+ re,
7768
7954
  n.doc,
7769
7955
  n.isSaving,
7770
7956
  n.isLocked,
7771
7957
  s?.docstatus,
7772
7958
  n
7773
7959
  ]);
7774
- let oe = async () => {
7960
+ let ae = async () => {
7775
7961
  if (t) {
7776
- ie.current = !0, Y(!1);
7962
+ Y.current = !0, J(!1);
7777
7963
  try {
7778
7964
  await W({
7779
7965
  resource: e,
7780
7966
  id: t
7781
7967
  }), x(!1), te(`/app/${e}/list`, { state: { bypassBlocker: !0 } });
7782
7968
  } catch (t) {
7783
- ie.current = !1, x(!1), O(t.message || `Failed to delete ${e}.`);
7969
+ Y.current = !1, x(!1), O(t.message || `Failed to delete ${e}.`);
7784
7970
  }
7785
7971
  }
7786
7972
  };
7787
- return i ? /* @__PURE__ */ w(jr, {}) : a ? /* @__PURE__ */ w(H, {
7973
+ return i ? /* @__PURE__ */ w(Mr, {}) : a ? /* @__PURE__ */ w(H, {
7788
7974
  padding: "$xl",
7789
7975
  backgroundColor: "$background",
7790
7976
  minHeight: "100%",
@@ -7819,7 +8005,7 @@ function Yi({ doctype: e, id: t, frm: n, meta: r, metaLoading: i, metaError: a,
7819
8005
  onTouchEnd: f.isMobile ? (e) => j(e) : void 0,
7820
8006
  paddingBottom: "$0",
7821
8007
  children: [
7822
- /* @__PURE__ */ w(qi, {
8008
+ /* @__PURE__ */ w(Ji, {
7823
8009
  appName: V,
7824
8010
  isSingleton: L,
7825
8011
  doctype: e,
@@ -7831,11 +8017,11 @@ function Yi({ doctype: e, id: t, frm: n, meta: r, metaLoading: i, metaError: a,
7831
8017
  submitLabel: ee,
7832
8018
  onSave: () => n.save({ preventNavigation: !!k?.auto_save }),
7833
8019
  onDiscard: () => {
7834
- if (J) {
8020
+ if (re) {
7835
8021
  E(!0);
7836
8022
  return;
7837
8023
  }
7838
- ie.current = !0, Y(!1), n.cancel();
8024
+ Y.current = !0, J(!1), n.cancel();
7839
8025
  },
7840
8026
  isSaving: n.isSaving,
7841
8027
  isLocked: n.isLocked,
@@ -7863,7 +8049,7 @@ function Yi({ doctype: e, id: t, frm: n, meta: r, metaLoading: i, metaError: a,
7863
8049
  fontSize: "$xs",
7864
8050
  color: "$colorMuted",
7865
8051
  fontWeight: "500",
7866
- children: n.isSaving ? c("Auto-saving...") : c(J ? "Unsaved changes" : "Saved")
8052
+ children: n.isSaving ? c("Auto-saving...") : c(re ? "Unsaved changes" : "Saved")
7867
8053
  })
7868
8054
  }),
7869
8055
  D && /* @__PURE__ */ w(P, {
@@ -7878,7 +8064,7 @@ function Yi({ doctype: e, id: t, frm: n, meta: r, metaLoading: i, metaError: a,
7878
8064
  children: D
7879
8065
  })
7880
8066
  }),
7881
- /* @__PURE__ */ w(xr, {
8067
+ /* @__PURE__ */ w(Sr, {
7882
8068
  name: "form-header",
7883
8069
  doctype: e,
7884
8070
  data: n.doc,
@@ -7899,7 +8085,7 @@ function Yi({ doctype: e, id: t, frm: n, meta: r, metaLoading: i, metaError: a,
7899
8085
  uiMeta: k,
7900
8086
  frm: n,
7901
8087
  id: t
7902
- }), /* @__PURE__ */ w(xr, {
8088
+ }), /* @__PURE__ */ w(Sr, {
7903
8089
  name: "form-footer",
7904
8090
  doctype: e,
7905
8091
  data: n.doc,
@@ -7930,6 +8116,7 @@ function Yi({ doctype: e, id: t, frm: n, meta: r, metaLoading: i, metaError: a,
7930
8116
  flex: 1,
7931
8117
  children: c("System Info")
7932
8118
  }), /* @__PURE__ */ w(N, {
8119
+ "aria-label": "Close system info",
7933
8120
  size: "sm",
7934
8121
  variant: "ghost",
7935
8122
  onPress: () => y(!1),
@@ -7945,17 +8132,17 @@ function Yi({ doctype: e, id: t, frm: n, meta: r, metaLoading: i, metaError: a,
7945
8132
  })]
7946
8133
  })]
7947
8134
  }),
7948
- f.isMobile && /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(Wi, {
8135
+ f.isMobile && /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(Gi, {
7949
8136
  frm: n,
7950
8137
  submitLabel: ee,
7951
8138
  docstatus: s?.docstatus
7952
- }), /* @__PURE__ */ w(xr, {
8139
+ }), /* @__PURE__ */ w(Sr, {
7953
8140
  name: "form-actions",
7954
8141
  doctype: e,
7955
8142
  data: n.doc,
7956
8143
  id: t
7957
8144
  })] }),
7958
- /* @__PURE__ */ w(or, {
8145
+ /* @__PURE__ */ w(sr, {
7959
8146
  open: b,
7960
8147
  title: c("Confirm Delete"),
7961
8148
  message: c("Are you sure you want to delete this document? This action cannot be undone."),
@@ -7963,11 +8150,11 @@ function Yi({ doctype: e, id: t, frm: n, meta: r, metaLoading: i, metaError: a,
7963
8150
  cancelLabel: c("Cancel"),
7964
8151
  destructive: !0,
7965
8152
  onConfirm: () => {
7966
- oe().catch(() => void 0);
8153
+ ae().catch(() => void 0);
7967
8154
  },
7968
8155
  onCancel: () => x(!1)
7969
8156
  }),
7970
- /* @__PURE__ */ w(or, {
8157
+ /* @__PURE__ */ w(sr, {
7971
8158
  open: S,
7972
8159
  title: c("Unsaved Changes"),
7973
8160
  message: c("You have unsaved changes. Are you sure you want to discard them?"),
@@ -7975,10 +8162,10 @@ function Yi({ doctype: e, id: t, frm: n, meta: r, metaLoading: i, metaError: a,
7975
8162
  cancelLabel: c("Cancel"),
7976
8163
  destructive: !0,
7977
8164
  onConfirm: () => {
7978
- E(!1), ie.current = !0, Y(!1), ae.state === "blocked" ? ae.proceed() : n.cancel();
8165
+ E(!1), Y.current = !0, J(!1), ie.state === "blocked" ? ie.proceed() : n.cancel();
7979
8166
  },
7980
8167
  onCancel: () => {
7981
- E(!1), ae.state === "blocked" && ae.reset();
8168
+ E(!1), ie.state === "blocked" && ie.reset();
7982
8169
  }
7983
8170
  })
7984
8171
  ]
@@ -7986,7 +8173,7 @@ function Yi({ doctype: e, id: t, frm: n, meta: r, metaLoading: i, metaError: a,
7986
8173
  }
7987
8174
  //#endregion
7988
8175
  //#region src/pages/loginUtils.ts
7989
- var Xi = {
8176
+ var Zi = {
7990
8177
  google: {
7991
8178
  label: "Continue with Google",
7992
8179
  icon: "G"
@@ -8004,7 +8191,7 @@ var Xi = {
8004
8191
  icon: "RA"
8005
8192
  }
8006
8193
  };
8007
- function Zi() {
8194
+ function Qi() {
8008
8195
  let e = globalThis, t = e.__FRAMEWORK_OAUTH_PROVIDERS__;
8009
8196
  if (Array.isArray(t)) return t;
8010
8197
  let n = e.__FRAMEWORK_CONFIG__?.auth?.oauth?.providers;
@@ -8012,7 +8199,7 @@ function Zi() {
8012
8199
  }
8013
8200
  //#endregion
8014
8201
  //#region src/pages/LoginLogo.tsx
8015
- function Qi({ logo: e }) {
8202
+ function $i({ logo: e }) {
8016
8203
  let { t } = $("desk");
8017
8204
  return e ? typeof e == "string" ? /* @__PURE__ */ w("img", {
8018
8205
  src: e,
@@ -8034,11 +8221,11 @@ function Qi({ logo: e }) {
8034
8221
  }
8035
8222
  //#endregion
8036
8223
  //#region src/pages/LoginPage.tsx
8037
- function $i({ ...e }) {
8038
- return w(on("LoginPage") || ea, { ...e });
8224
+ function ea({ ...e }) {
8225
+ return w(on("LoginPage") || ta, { ...e });
8039
8226
  }
8040
- function ea({ title: e = "Welcome back", logo: t, redirectTo: n }) {
8041
- let { t: r } = $("desk"), [i] = Pe(), a = n ?? i.get("to") ?? void 0, { mutate: o, status: s } = _e(), [c, l] = v(null), [u, d] = v(null), [f, p] = v(""), [m, g] = v(""), [_, y] = v(!1), [b, x] = v(!1), [S, C] = v(!1), { theme: E, toggleTheme: D } = Y(), O = Mt(), k = s === "pending", A = k || S, [j, M] = v(Zi()), F = b ? r("Reset Password") : e === "Welcome back" ? r("Welcome back") : e, I = r(b ? "Enter your email to receive a reset link" : "Sign in to your account");
8227
+ function ta({ title: e = "Welcome back", logo: t, redirectTo: n }) {
8228
+ let { t: r } = $("desk"), [i] = Pe(), a = n ?? i.get("to") ?? void 0, { mutate: o, status: s } = _e(), [c, l] = v(null), [u, d] = v(null), [f, p] = v(""), [m, g] = v(""), [_, y] = v(!1), [b, x] = v(!1), [S, C] = v(!1), { theme: E, toggleTheme: D } = Y(), O = Mt(), k = s === "pending", A = k || S, [j, M] = v(Qi()), F = b ? r("Reset Password") : e === "Welcome back" ? r("Welcome back") : e, I = r(b ? "Enter your email to receive a reset link" : "Sign in to your account");
8042
8229
  h(() => {
8043
8230
  (async () => {
8044
8231
  try {
@@ -8141,7 +8328,7 @@ function ea({ title: e = "Welcome back", logo: t, redirectTo: n }) {
8141
8328
  alignItems: "center",
8142
8329
  marginBottom: "$xl",
8143
8330
  gap: "$md",
8144
- children: [/* @__PURE__ */ w(Qi, { logo: t }), /* @__PURE__ */ T(J, {
8331
+ children: [/* @__PURE__ */ w($i, { logo: t }), /* @__PURE__ */ T(J, {
8145
8332
  alignItems: "center",
8146
8333
  gap: "$xs",
8147
8334
  children: [/* @__PURE__ */ w(L, {
@@ -8168,10 +8355,10 @@ function ea({ title: e = "Welcome back", logo: t, redirectTo: n }) {
8168
8355
  children: [/* @__PURE__ */ w(L, {
8169
8356
  fontSize: "$sm",
8170
8357
  opacity: .7,
8171
- children: Xi[e]?.icon || "ID"
8358
+ children: Zi[e]?.icon || "ID"
8172
8359
  }), /* @__PURE__ */ w(W, {
8173
8360
  fontSize: "$sm",
8174
- children: Xi[e]?.label || r("Continue with {{provider}}", { provider: e })
8361
+ children: Zi[e]?.label || r("Continue with {{provider}}", { provider: e })
8175
8362
  })]
8176
8363
  })
8177
8364
  }, e)), /* @__PURE__ */ T(q, {
@@ -8328,7 +8515,7 @@ function ea({ title: e = "Welcome back", logo: t, redirectTo: n }) {
8328
8515
  }
8329
8516
  //#endregion
8330
8517
  //#region src/shell/adapters/localRealtimeAdapter.ts
8331
- function ta() {
8518
+ function na() {
8332
8519
  let e = "frameworkm-realtime";
8333
8520
  return {
8334
8521
  connect: (t) => {
@@ -8349,7 +8536,7 @@ function ta() {
8349
8536
  }
8350
8537
  //#endregion
8351
8538
  //#region src/shell/hooks/useRealtime.ts
8352
- function na(e, t, n) {
8539
+ function ra(e, t, n) {
8353
8540
  let r = [...e[t] ?? []].filter((e) => e !== n);
8354
8541
  if (r.length > 0) return {
8355
8542
  ...e,
@@ -8358,15 +8545,15 @@ function na(e, t, n) {
8358
8545
  let i = { ...e };
8359
8546
  return delete i[t], i;
8360
8547
  }
8361
- function ra(e) {
8362
- let t = _(e ?? ta()), n = _(null), r = _({}), i = p((e) => {
8548
+ function ia(e) {
8549
+ let t = _(e ?? na()), n = _(null), r = _({}), i = p((e) => {
8363
8550
  let t = r.current, n = t[e.room] ?? [], i = t["*"] ?? [], a = [...n, ...i];
8364
8551
  for (let t of a) t(e);
8365
8552
  }, []);
8366
8553
  return {
8367
8554
  setRealtimeAdapter: p(async (e) => {
8368
8555
  n.current && n.current();
8369
- let r = e ?? ta();
8556
+ let r = e ?? na();
8370
8557
  n.current = await r.connect(i) ?? null, t.current = r;
8371
8558
  }, [i]),
8372
8559
  subscribeRealtime: p((e, t) => {
@@ -8375,7 +8562,7 @@ function ra(e) {
8375
8562
  ...n,
8376
8563
  [e]: [...n[e] ?? [], t]
8377
8564
  }, () => {
8378
- r.current = na(r.current, e, t);
8565
+ r.current = ra(r.current, e, t);
8379
8566
  };
8380
8567
  }, []),
8381
8568
  publishRealtime: p(async (e, n, r) => {
@@ -8391,14 +8578,14 @@ function ra(e) {
8391
8578
  }
8392
8579
  //#endregion
8393
8580
  //#region src/shell/hooks/useOmniSearch.ts
8394
- function ia(e, t) {
8581
+ function aa(e, t) {
8395
8582
  return e.filter((e) => e !== t);
8396
8583
  }
8397
- function aa() {
8584
+ function oa() {
8398
8585
  let [e, t] = v([]);
8399
8586
  return {
8400
8587
  registerOmniSearchProvider: p((e) => (t((t) => [...t, e]), () => {
8401
- t((t) => ia(t, e));
8588
+ t((t) => aa(t, e));
8402
8589
  }), []),
8403
8590
  searchOmni: p(async (t) => {
8404
8591
  let n = t.trim();
@@ -8411,19 +8598,19 @@ function aa() {
8411
8598
  }
8412
8599
  //#endregion
8413
8600
  //#region src/shell/hooks/useSidebarSections.ts
8414
- function oa(e, t) {
8601
+ function sa(e, t) {
8415
8602
  let n = [];
8416
8603
  for (let r of e) r.id !== t.id && n.push(r);
8417
8604
  return n.push(t), n;
8418
8605
  }
8419
- function sa(e, t) {
8606
+ function ca(e, t) {
8420
8607
  let n = [];
8421
8608
  for (let r of e) r.id !== t && n.push(r);
8422
8609
  return n;
8423
8610
  }
8424
- function ca(e = [], t = !1) {
8425
- let [n, r] = v([]), [i, a] = v(t), [o, s] = v(!1), c = Mt(), l = p((e) => (r((t) => oa(t, e)), () => {
8426
- r((t) => sa(t, e.id));
8611
+ function la(e = [], t = !1) {
8612
+ let [n, r] = v([]), [i, a] = v(t), [o, s] = v(!1), c = Mt(), l = p((e) => (r((t) => sa(t, e)), () => {
8613
+ r((t) => ca(t, e.id));
8427
8614
  }), []), u = p((e) => n.filter((t) => t.slot === e).sort((e, t) => (e.order ?? 999) - (t.order ?? 999)), [n]);
8428
8615
  return h(() => {
8429
8616
  s(!1);
@@ -8498,8 +8685,8 @@ function ca(e = [], t = !1) {
8498
8685
  }
8499
8686
  //#endregion
8500
8687
  //#region src/shell/ShellProvider.tsx
8501
- function la({ children: e, isMobile: t = !1, isGuest: n = !1, rightSidebarOpen: r = !1, setRightSidebarOpen: i = () => {}, focusMode: a, setFocusMode: o, realtimeAdapter: s, initialPlugins: c = [] }) {
8502
- let { setRealtimeAdapter: l, subscribeRealtime: u, publishRealtime: d } = ra(s), { registerOmniSearchProvider: f, searchOmni: p } = aa(), { internalIsGuest: m, registerSection: h, getSections: _ } = ca(c, n), v = g(() => ({
8688
+ function ua({ children: e, isMobile: t = !1, isGuest: n = !1, rightSidebarOpen: r = !1, setRightSidebarOpen: i = () => {}, focusMode: a, setFocusMode: o, realtimeAdapter: s, initialPlugins: c = [] }) {
8689
+ let { setRealtimeAdapter: l, subscribeRealtime: u, publishRealtime: d } = ia(s), { registerOmniSearchProvider: f, searchOmni: p } = oa(), { internalIsGuest: m, registerSection: h, getSections: _ } = la(c, n), v = g(() => ({
8503
8690
  isMobile: t,
8504
8691
  isGuest: m,
8505
8692
  rightSidebarOpen: r,
@@ -8529,14 +8716,14 @@ function la({ children: e, isMobile: t = !1, isGuest: n = !1, rightSidebarOpen:
8529
8716
  u,
8530
8717
  d
8531
8718
  ]);
8532
- return /* @__PURE__ */ w(Gi.Provider, {
8719
+ return /* @__PURE__ */ w(Ki.Provider, {
8533
8720
  value: v,
8534
8721
  children: e
8535
8722
  });
8536
8723
  }
8537
8724
  //#endregion
8538
8725
  //#region src/shell/realtime.ts
8539
- function ua(e) {
8726
+ function da(e) {
8540
8727
  let t = null;
8541
8728
  return {
8542
8729
  connect: (n) => {
@@ -8558,11 +8745,11 @@ function ua(e) {
8558
8745
  }
8559
8746
  //#endregion
8560
8747
  //#region ../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js
8561
- var da = /* @__PURE__ */ Q(((e, t) => {
8748
+ var fa = /* @__PURE__ */ Q(((e, t) => {
8562
8749
  t.exports = TypeError;
8563
- })), fa = /* @__PURE__ */ Q(((e, t) => {
8564
- t.exports = {};
8565
8750
  })), pa = /* @__PURE__ */ Q(((e, t) => {
8751
+ t.exports = {};
8752
+ })), ma = /* @__PURE__ */ Q(((e, t) => {
8566
8753
  var n = typeof Map == "function" && Map.prototype, r = Object.getOwnPropertyDescriptor && n ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, i = n && r && typeof r.get == "function" ? r.get : null, a = n && Map.prototype.forEach, o = typeof Set == "function" && Set.prototype, s = Object.getOwnPropertyDescriptor && o ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, c = o && s && typeof s.get == "function" ? s.get : null, l = o && Set.prototype.forEach, u = typeof WeakMap == "function" && WeakMap.prototype ? WeakMap.prototype.has : null, d = typeof WeakSet == "function" && WeakSet.prototype ? WeakSet.prototype.has : null, f = typeof WeakRef == "function" && WeakRef.prototype ? WeakRef.prototype.deref : null, p = Boolean.prototype.valueOf, m = Object.prototype.toString, h = Function.prototype.toString, g = String.prototype.match, _ = String.prototype.slice, v = String.prototype.replace, y = String.prototype.toUpperCase, b = String.prototype.toLowerCase, x = RegExp.prototype.test, S = Array.prototype.concat, C = Array.prototype.join, w = Array.prototype.slice, T = Math.floor, E = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, D = Object.getOwnPropertySymbols, O = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, k = typeof Symbol == "function" && typeof Symbol.iterator == "object", A = typeof Symbol == "function" && Symbol.toStringTag ? Symbol.toStringTag : null, j = Object.prototype.propertyIsEnumerable, M = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(e) {
8567
8754
  return e.__proto__;
8568
8755
  } : null);
@@ -8578,7 +8765,7 @@ var da = /* @__PURE__ */ Q(((e, t) => {
8578
8765
  }
8579
8766
  return v.call(t, n, "$&_");
8580
8767
  }
8581
- var P = fa(), F = P.custom, I = K(F) ? F : null, L = {
8768
+ var P = pa(), F = P.custom, I = K(F) ? F : null, L = {
8582
8769
  __proto__: null,
8583
8770
  double: "\"",
8584
8771
  single: "'"
@@ -8661,9 +8848,9 @@ var da = /* @__PURE__ */ Q(((e, t) => {
8661
8848
  if (se(t)) return he("WeakMap");
8662
8849
  if (ue(t)) return he("WeakSet");
8663
8850
  if (ce(t)) return he("WeakRef");
8664
- if (G(t)) return me(y(Number(t)));
8851
+ if (ne(t)) return me(y(Number(t)));
8665
8852
  if (re(t)) return me(y(E.call(t)));
8666
- if (ne(t)) return me(p.call(t));
8853
+ if (G(t)) return me(p.call(t));
8667
8854
  if (te(t)) return me(y(String(t)));
8668
8855
  if (typeof window < "u" && t === window) return "{ [object Window] }";
8669
8856
  if (typeof globalThis < "u" && t === globalThis || typeof global < "u" && t === global) return "{ [object globalThis] }";
@@ -8698,10 +8885,10 @@ var da = /* @__PURE__ */ Q(((e, t) => {
8698
8885
  function te(e) {
8699
8886
  return Y(e) === "[object String]" && V(e);
8700
8887
  }
8701
- function G(e) {
8888
+ function ne(e) {
8702
8889
  return Y(e) === "[object Number]" && V(e);
8703
8890
  }
8704
- function ne(e) {
8891
+ function G(e) {
8705
8892
  return Y(e) === "[object Boolean]" && V(e);
8706
8893
  }
8707
8894
  function K(e) {
@@ -8863,8 +9050,8 @@ var da = /* @__PURE__ */ Q(((e, t) => {
8863
9050
  if (typeof D == "function") for (var l = 0; l < a.length; l++) j.call(e, a[l]) && r.push("[" + t(a[l]) + "]: " + t(e[a[l]], e));
8864
9051
  return r;
8865
9052
  }
8866
- })), ma = /* @__PURE__ */ Q(((e, t) => {
8867
- var n = pa(), r = da(), i = function(e, t, n) {
9053
+ })), ha = /* @__PURE__ */ Q(((e, t) => {
9054
+ var n = ma(), r = fa(), i = function(e, t, n) {
8868
9055
  for (var r = e, i; (i = r.next) != null; r = i) if (i.key === t) return r.next = i.next, n || (i.next = e.next, e.next = i), i;
8869
9056
  }, a = function(e, t) {
8870
9057
  if (e) {
@@ -8904,52 +9091,52 @@ var da = /* @__PURE__ */ Q(((e, t) => {
8904
9091
  };
8905
9092
  return t;
8906
9093
  };
8907
- })), ha = /* @__PURE__ */ Q(((e, t) => {
8908
- t.exports = Object;
8909
9094
  })), ga = /* @__PURE__ */ Q(((e, t) => {
8910
- t.exports = Error;
9095
+ t.exports = Object;
8911
9096
  })), _a = /* @__PURE__ */ Q(((e, t) => {
8912
- t.exports = EvalError;
9097
+ t.exports = Error;
8913
9098
  })), va = /* @__PURE__ */ Q(((e, t) => {
8914
- t.exports = RangeError;
9099
+ t.exports = EvalError;
8915
9100
  })), ya = /* @__PURE__ */ Q(((e, t) => {
8916
- t.exports = ReferenceError;
9101
+ t.exports = RangeError;
8917
9102
  })), ba = /* @__PURE__ */ Q(((e, t) => {
8918
- t.exports = SyntaxError;
9103
+ t.exports = ReferenceError;
8919
9104
  })), xa = /* @__PURE__ */ Q(((e, t) => {
8920
- t.exports = URIError;
9105
+ t.exports = SyntaxError;
8921
9106
  })), Sa = /* @__PURE__ */ Q(((e, t) => {
8922
- t.exports = Math.abs;
9107
+ t.exports = URIError;
8923
9108
  })), Ca = /* @__PURE__ */ Q(((e, t) => {
8924
- t.exports = Math.floor;
9109
+ t.exports = Math.abs;
8925
9110
  })), wa = /* @__PURE__ */ Q(((e, t) => {
8926
- t.exports = Math.max;
9111
+ t.exports = Math.floor;
8927
9112
  })), Ta = /* @__PURE__ */ Q(((e, t) => {
8928
- t.exports = Math.min;
9113
+ t.exports = Math.max;
8929
9114
  })), Ea = /* @__PURE__ */ Q(((e, t) => {
8930
- t.exports = Math.pow;
9115
+ t.exports = Math.min;
8931
9116
  })), Da = /* @__PURE__ */ Q(((e, t) => {
8932
- t.exports = Math.round;
9117
+ t.exports = Math.pow;
8933
9118
  })), Oa = /* @__PURE__ */ Q(((e, t) => {
9119
+ t.exports = Math.round;
9120
+ })), ka = /* @__PURE__ */ Q(((e, t) => {
8934
9121
  t.exports = Number.isNaN || function(e) {
8935
9122
  return e !== e;
8936
9123
  };
8937
- })), ka = /* @__PURE__ */ Q(((e, t) => {
8938
- var n = Oa();
9124
+ })), Aa = /* @__PURE__ */ Q(((e, t) => {
9125
+ var n = ka();
8939
9126
  t.exports = function(e) {
8940
9127
  return n(e) || e === 0 ? e : e < 0 ? -1 : 1;
8941
9128
  };
8942
- })), Aa = /* @__PURE__ */ Q(((e, t) => {
8943
- t.exports = Object.getOwnPropertyDescriptor;
8944
9129
  })), ja = /* @__PURE__ */ Q(((e, t) => {
8945
- var n = Aa();
9130
+ t.exports = Object.getOwnPropertyDescriptor;
9131
+ })), Ma = /* @__PURE__ */ Q(((e, t) => {
9132
+ var n = ja();
8946
9133
  if (n) try {
8947
9134
  n([], "length");
8948
9135
  } catch {
8949
9136
  n = null;
8950
9137
  }
8951
9138
  t.exports = n;
8952
- })), Ma = /* @__PURE__ */ Q(((e, t) => {
9139
+ })), Na = /* @__PURE__ */ Q(((e, t) => {
8953
9140
  var n = Object.defineProperty || !1;
8954
9141
  if (n) try {
8955
9142
  n({}, "a", { value: 1 });
@@ -8957,7 +9144,7 @@ var da = /* @__PURE__ */ Q(((e, t) => {
8957
9144
  n = !1;
8958
9145
  }
8959
9146
  t.exports = n;
8960
- })), Na = /* @__PURE__ */ Q(((e, t) => {
9147
+ })), Pa = /* @__PURE__ */ Q(((e, t) => {
8961
9148
  t.exports = function() {
8962
9149
  if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function") return !1;
8963
9150
  if (typeof Symbol.iterator == "symbol") return !0;
@@ -8974,16 +9161,16 @@ var da = /* @__PURE__ */ Q(((e, t) => {
8974
9161
  }
8975
9162
  return !0;
8976
9163
  };
8977
- })), Pa = /* @__PURE__ */ Q(((e, t) => {
8978
- var n = typeof Symbol < "u" && Symbol, r = Na();
9164
+ })), Fa = /* @__PURE__ */ Q(((e, t) => {
9165
+ var n = typeof Symbol < "u" && Symbol, r = Pa();
8979
9166
  t.exports = function() {
8980
9167
  return typeof n != "function" || typeof Symbol != "function" || typeof n("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : r();
8981
9168
  };
8982
- })), Fa = /* @__PURE__ */ Q(((e, t) => {
8983
- t.exports = typeof Reflect < "u" && Reflect.getPrototypeOf || null;
8984
9169
  })), Ia = /* @__PURE__ */ Q(((e, t) => {
8985
- t.exports = ha().getPrototypeOf || null;
9170
+ t.exports = typeof Reflect < "u" && Reflect.getPrototypeOf || null;
8986
9171
  })), La = /* @__PURE__ */ Q(((e, t) => {
9172
+ t.exports = ga().getPrototypeOf || null;
9173
+ })), Ra = /* @__PURE__ */ Q(((e, t) => {
8987
9174
  var n = "Function.prototype.bind called on incompatible ", r = Object.prototype.toString, i = Math.max, a = "[object Function]", o = function(e, t) {
8988
9175
  for (var n = [], r = 0; r < e.length; r += 1) n[r] = e[r];
8989
9176
  for (var i = 0; i < t.length; i += 1) n[i + e.length] = t[i];
@@ -9011,26 +9198,26 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9011
9198
  }
9012
9199
  return u;
9013
9200
  };
9014
- })), Ra = /* @__PURE__ */ Q(((e, t) => {
9015
- var n = La();
9016
- t.exports = Function.prototype.bind || n;
9017
9201
  })), za = /* @__PURE__ */ Q(((e, t) => {
9018
- t.exports = Function.prototype.call;
9202
+ var n = Ra();
9203
+ t.exports = Function.prototype.bind || n;
9019
9204
  })), Ba = /* @__PURE__ */ Q(((e, t) => {
9020
- t.exports = Function.prototype.apply;
9205
+ t.exports = Function.prototype.call;
9021
9206
  })), Va = /* @__PURE__ */ Q(((e, t) => {
9022
- t.exports = typeof Reflect < "u" && Reflect && Reflect.apply;
9207
+ t.exports = Function.prototype.apply;
9023
9208
  })), Ha = /* @__PURE__ */ Q(((e, t) => {
9024
- var n = Ra(), r = Ba(), i = za();
9025
- t.exports = Va() || n.call(i, r);
9209
+ t.exports = typeof Reflect < "u" && Reflect && Reflect.apply;
9026
9210
  })), Ua = /* @__PURE__ */ Q(((e, t) => {
9027
- var n = Ra(), r = da(), i = za(), a = Ha();
9211
+ var n = za(), r = Va(), i = Ba();
9212
+ t.exports = Ha() || n.call(i, r);
9213
+ })), Wa = /* @__PURE__ */ Q(((e, t) => {
9214
+ var n = za(), r = fa(), i = Ba(), a = Ua();
9028
9215
  t.exports = function(e) {
9029
9216
  if (e.length < 1 || typeof e[0] != "function") throw new r("a function is required");
9030
9217
  return a(n, i, e);
9031
9218
  };
9032
- })), Wa = /* @__PURE__ */ Q(((e, t) => {
9033
- var n = Ua(), r = ja(), i;
9219
+ })), Ga = /* @__PURE__ */ Q(((e, t) => {
9220
+ var n = Wa(), r = Ma(), i;
9034
9221
  try {
9035
9222
  i = [].__proto__ === Array.prototype;
9036
9223
  } catch (e) {
@@ -9040,8 +9227,8 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9040
9227
  t.exports = a && typeof a.get == "function" ? n([a.get]) : typeof s == "function" ? function(e) {
9041
9228
  return s(e == null ? e : o(e));
9042
9229
  } : !1;
9043
- })), Ga = /* @__PURE__ */ Q(((e, t) => {
9044
- var n = Fa(), r = Ia(), i = Wa();
9230
+ })), Ka = /* @__PURE__ */ Q(((e, t) => {
9231
+ var n = Ia(), r = La(), i = Ga();
9045
9232
  t.exports = n ? function(e) {
9046
9233
  return n(e);
9047
9234
  } : r ? function(e) {
@@ -9050,15 +9237,15 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9050
9237
  } : i ? function(e) {
9051
9238
  return i(e);
9052
9239
  } : null;
9053
- })), Ka = /* @__PURE__ */ Q(((e, t) => {
9054
- var n = Function.prototype.call, r = Object.prototype.hasOwnProperty;
9055
- t.exports = Ra().call(n, r);
9056
9240
  })), qa = /* @__PURE__ */ Q(((e, t) => {
9057
- var n, r = ha(), i = ga(), a = _a(), o = va(), s = ya(), c = ba(), l = da(), u = xa(), d = Sa(), f = Ca(), p = wa(), m = Ta(), h = Ea(), g = Da(), _ = ka(), v = Function, y = function(e) {
9241
+ var n = Function.prototype.call, r = Object.prototype.hasOwnProperty;
9242
+ t.exports = za().call(n, r);
9243
+ })), Ja = /* @__PURE__ */ Q(((e, t) => {
9244
+ var n, r = ga(), i = _a(), a = va(), o = ya(), s = ba(), c = xa(), l = fa(), u = Sa(), d = Ca(), f = wa(), p = Ta(), m = Ea(), h = Da(), g = Oa(), _ = Aa(), v = Function, y = function(e) {
9058
9245
  try {
9059
9246
  return v("\"use strict\"; return (" + e + ").constructor;")();
9060
9247
  } catch {}
9061
- }, b = ja(), x = Ma(), S = function() {
9248
+ }, b = Ma(), x = Na(), S = function() {
9062
9249
  throw new l();
9063
9250
  }, C = b ? function() {
9064
9251
  try {
@@ -9070,7 +9257,7 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9070
9257
  return S;
9071
9258
  }
9072
9259
  }
9073
- }() : S, w = Pa()(), T = Ga(), E = Ia(), D = Fa(), O = Ba(), k = za(), A = {}, j = typeof Uint8Array > "u" || !T ? n : T(Uint8Array), M = {
9260
+ }() : S, w = Fa()(), T = Ka(), E = La(), D = Ia(), O = Va(), k = Ba(), A = {}, j = typeof Uint8Array > "u" || !T ? n : T(Uint8Array), M = {
9074
9261
  __proto__: null,
9075
9262
  "%AggregateError%": typeof AggregateError > "u" ? n : AggregateError,
9076
9263
  "%Array%": Array,
@@ -9260,7 +9447,7 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9260
9447
  "%URIErrorPrototype%": ["URIError", "prototype"],
9261
9448
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
9262
9449
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
9263
- }, F = Ra(), I = Ka(), L = F.call(k, Array.prototype.concat), R = F.call(O, Array.prototype.splice), z = F.call(k, String.prototype.replace), B = F.call(k, String.prototype.slice), V = F.call(k, RegExp.prototype.exec), H = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, U = /\\(\\)?/g, ee = function(e) {
9450
+ }, F = za(), I = qa(), L = F.call(k, Array.prototype.concat), R = F.call(O, Array.prototype.splice), z = F.call(k, String.prototype.replace), B = F.call(k, String.prototype.slice), V = F.call(k, RegExp.prototype.exec), H = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, U = /\\(\\)?/g, ee = function(e) {
9264
9451
  var t = B(e, 0, 1), n = B(e, -1);
9265
9452
  if (t === "%" && n !== "%") throw new c("invalid intrinsic syntax, expected closing `%`");
9266
9453
  if (n === "%" && t !== "%") throw new c("invalid intrinsic syntax, expected opening `%`");
@@ -9305,14 +9492,14 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9305
9492
  }
9306
9493
  return o;
9307
9494
  };
9308
- })), Ja = /* @__PURE__ */ Q(((e, t) => {
9309
- var n = qa(), r = Ua(), i = r([n("%String.prototype.indexOf%")]);
9495
+ })), Ya = /* @__PURE__ */ Q(((e, t) => {
9496
+ var n = Ja(), r = Wa(), i = r([n("%String.prototype.indexOf%")]);
9310
9497
  t.exports = function(e, t) {
9311
9498
  var a = n(e, !!t);
9312
9499
  return typeof a == "function" && i(e, ".prototype.") > -1 ? r([a]) : a;
9313
9500
  };
9314
- })), Ya = /* @__PURE__ */ Q(((e, t) => {
9315
- var n = qa(), r = Ja(), i = pa(), a = da(), o = n("%Map%", !0), s = r("Map.prototype.get", !0), c = r("Map.prototype.set", !0), l = r("Map.prototype.has", !0), u = r("Map.prototype.delete", !0), d = r("Map.prototype.size", !0);
9501
+ })), Xa = /* @__PURE__ */ Q(((e, t) => {
9502
+ var n = Ja(), r = Ya(), i = ma(), a = fa(), o = n("%Map%", !0), s = r("Map.prototype.get", !0), c = r("Map.prototype.set", !0), l = r("Map.prototype.has", !0), u = r("Map.prototype.delete", !0), d = r("Map.prototype.size", !0);
9316
9503
  t.exports = !!o && function() {
9317
9504
  var e, t = {
9318
9505
  assert: function(e) {
@@ -9337,8 +9524,8 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9337
9524
  };
9338
9525
  return t;
9339
9526
  };
9340
- })), Xa = /* @__PURE__ */ Q(((e, t) => {
9341
- var n = qa(), r = Ja(), i = pa(), a = Ya(), o = da(), s = n("%WeakMap%", !0), c = r("WeakMap.prototype.get", !0), l = r("WeakMap.prototype.set", !0), u = r("WeakMap.prototype.has", !0), d = r("WeakMap.prototype.delete", !0);
9527
+ })), Za = /* @__PURE__ */ Q(((e, t) => {
9528
+ var n = Ja(), r = Ya(), i = ma(), a = Xa(), o = fa(), s = n("%WeakMap%", !0), c = r("WeakMap.prototype.get", !0), l = r("WeakMap.prototype.set", !0), u = r("WeakMap.prototype.has", !0), d = r("WeakMap.prototype.delete", !0);
9342
9529
  t.exports = s ? function() {
9343
9530
  var e, t, n = {
9344
9531
  assert: function(e) {
@@ -9362,8 +9549,8 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9362
9549
  };
9363
9550
  return n;
9364
9551
  } : a;
9365
- })), Za = /* @__PURE__ */ Q(((e, t) => {
9366
- var n = da(), r = pa(), i = ma(), a = Ya(), o = Xa() || a || i;
9552
+ })), Qa = /* @__PURE__ */ Q(((e, t) => {
9553
+ var n = fa(), r = ma(), i = ha(), a = Xa(), o = Za() || a || i;
9367
9554
  t.exports = function() {
9368
9555
  var e, t = {
9369
9556
  assert: function(e) {
@@ -9384,7 +9571,7 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9384
9571
  };
9385
9572
  return t;
9386
9573
  };
9387
- })), Qa = /* @__PURE__ */ Q(((e, t) => {
9574
+ })), $a = /* @__PURE__ */ Q(((e, t) => {
9388
9575
  var n = String.prototype.replace, r = /%20/g, i = {
9389
9576
  RFC1738: "RFC1738",
9390
9577
  RFC3986: "RFC3986"
@@ -9402,8 +9589,8 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9402
9589
  RFC1738: i.RFC1738,
9403
9590
  RFC3986: i.RFC3986
9404
9591
  };
9405
- })), $a = /* @__PURE__ */ Q(((e, t) => {
9406
- var n = Qa(), r = Za(), i = Object.prototype.hasOwnProperty, a = Array.isArray, o = r(), s = function(e, t) {
9592
+ })), eo = /* @__PURE__ */ Q(((e, t) => {
9593
+ var n = $a(), r = Qa(), i = Object.prototype.hasOwnProperty, a = Array.isArray, o = r(), s = function(e, t) {
9407
9594
  return o.set(e, t), e;
9408
9595
  }, c = function(e) {
9409
9596
  return o.has(e);
@@ -9554,8 +9741,8 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9554
9741
  },
9555
9742
  merge: m
9556
9743
  };
9557
- })), eo = /* @__PURE__ */ Q(((e, t) => {
9558
- var n = Za(), r = $a(), i = Qa(), a = Object.prototype.hasOwnProperty, o = {
9744
+ })), to = /* @__PURE__ */ Q(((e, t) => {
9745
+ var n = Qa(), r = eo(), i = $a(), a = Object.prototype.hasOwnProperty, o = {
9559
9746
  brackets: function(e) {
9560
9747
  return e + "[]";
9561
9748
  },
@@ -9687,8 +9874,8 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9687
9874
  var y = u.join(i.delimiter), b = i.addQueryPrefix === !0 ? "?" : "";
9688
9875
  return i.charsetSentinel && (i.charset === "iso-8859-1" ? b += "utf8=%26%2310003%3B" + i.delimiter : b += "utf8=%E2%9C%93" + i.delimiter), y.length > 0 ? b + y : "";
9689
9876
  };
9690
- })), to = /* @__PURE__ */ Q(((e, t) => {
9691
- var n = $a(), r = Object.prototype.hasOwnProperty, i = Array.isArray, a = {
9877
+ })), no = /* @__PURE__ */ Q(((e, t) => {
9878
+ var n = eo(), r = Object.prototype.hasOwnProperty, i = Array.isArray, a = {
9692
9879
  allowDots: !1,
9693
9880
  allowEmptyArrays: !1,
9694
9881
  allowPrototypes: !1,
@@ -9831,36 +10018,36 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9831
10018
  }
9832
10019
  return r.allowSparse === !0 ? a : n.compact(a);
9833
10020
  };
9834
- })), no = /* @__PURE__ */ $e((/* @__PURE__ */ Q(((e, t) => {
9835
- var n = eo(), r = to();
10021
+ })), ro = /* @__PURE__ */ $e((/* @__PURE__ */ Q(((e, t) => {
10022
+ var n = to(), r = no();
9836
10023
  t.exports = {
9837
- formats: Qa(),
10024
+ formats: $a(),
9838
10025
  parse: r,
9839
10026
  stringify: n
9840
10027
  };
9841
- })))(), 1), ro = (e) => {
10028
+ })))(), 1), io = (e) => {
9842
10029
  if (e === void 0) return e;
9843
10030
  let t = Number(e);
9844
10031
  return `${t}` === e ? t : e;
9845
- }, io = {
10032
+ }, ao = {
9846
10033
  addQueryPrefix: !0,
9847
10034
  skipNulls: !0,
9848
10035
  arrayFormat: "indices",
9849
10036
  encode: !1,
9850
10037
  encodeValuesOnly: !0
9851
- }, ao = {
10038
+ }, oo = {
9852
10039
  go: () => {
9853
10040
  let { search: e, hash: t } = je(), n = Me();
9854
10041
  return p(({ to: r, type: i, query: a, hash: o, options: { keepQuery: s, keepHash: c } = {} }) => {
9855
10042
  let l = {
9856
- ...s && e && no.default.parse(e, {
10043
+ ...s && e && ro.default.parse(e, {
9857
10044
  ignoreQueryPrefix: !0,
9858
10045
  depth: ae
9859
10046
  }),
9860
10047
  ...a
9861
10048
  };
9862
10049
  l.to &&= encodeURIComponent(`${l.to}`);
9863
- let u = Object.keys(l).length > 0, d = `#${(o || c && t || "").replace(/^#/, "")}`, f = d.length > 1, p = `${r || ""}${u ? no.default.stringify(l, io) : ""}${f ? d : ""}`;
10050
+ let u = Object.keys(l).length > 0, d = `#${(o || c && t || "").replace(/^#/, "")}`, f = d.length > 1, p = `${r || ""}${u ? ro.default.stringify(l, ao) : ""}${f ? d : ""}`;
9864
10051
  if (i === "path") return p;
9865
10052
  n(p, { replace: i === "replace" });
9866
10053
  }, [
@@ -9878,7 +10065,7 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9878
10065
  parse: () => {
9879
10066
  let e = Ne(), { pathname: t, search: n } = je(), { resources: r } = m(se), { resource: i, action: a, matchedRoute: o } = u.useMemo(() => ce(t, r), [r, t]);
9880
10067
  return Object.entries(e).length === 0 && o && (e = ke(o, t)?.params || {}), p(() => {
9881
- let r = no.default.parse(n, {
10068
+ let r = ro.default.parse(n, {
9882
10069
  ignoreQueryPrefix: !0,
9883
10070
  depth: ae
9884
10071
  }), o = {
@@ -9892,8 +10079,8 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9892
10079
  pathname: t,
9893
10080
  params: {
9894
10081
  ...o,
9895
- currentPage: ro(o.currentPage),
9896
- pageSize: ro(o.pageSize),
10082
+ currentPage: io(o.currentPage),
10083
+ pageSize: io(o.pageSize),
9897
10084
  to: o.to ? decodeURIComponent(o.to) : void 0
9898
10085
  }
9899
10086
  };
@@ -9915,7 +10102,7 @@ var da = /* @__PURE__ */ Q(((e, t) => {
9915
10102
  };
9916
10103
  //#endregion
9917
10104
  //#region src/components/layout/Navigation/PrimaryRail.tsx
9918
- function oo({ apps: e, activeAppId: t, onAppSelect: n, isMobile: r = !1 }) {
10105
+ function so({ apps: e, activeAppId: t, onAppSelect: n, isMobile: r = !1 }) {
9919
10106
  let { t: i, language: a, changeLanguage: o } = $("desk"), { data: s } = pe(), { mutate: c } = ve(), { theme: l, setTheme: u } = Y(), { supportedLocales: d } = jt(), f = (e) => {
9920
10107
  let t = {
9921
10108
  en: "English",
@@ -9987,7 +10174,7 @@ function oo({ apps: e, activeAppId: t, onAppSelect: n, isMobile: r = !1 }) {
9987
10174
  children: s?.email || "Not signed in"
9988
10175
  })]
9989
10176
  }),
9990
- /* @__PURE__ */ w(ne, {}),
10177
+ /* @__PURE__ */ w(G, {}),
9991
10178
  /* @__PURE__ */ T(J, {
9992
10179
  padding: "$sm",
9993
10180
  gap: "$sm",
@@ -10009,7 +10196,7 @@ function oo({ apps: e, activeAppId: t, onAppSelect: n, isMobile: r = !1 }) {
10009
10196
  placement: v ? "top-start" : "top-end"
10010
10197
  })]
10011
10198
  }),
10012
- /* @__PURE__ */ w(ne, {}),
10199
+ /* @__PURE__ */ w(G, {}),
10013
10200
  /* @__PURE__ */ T(N, {
10014
10201
  variant: "ghost",
10015
10202
  size: "sm",
@@ -10134,7 +10321,7 @@ function oo({ apps: e, activeAppId: t, onAppSelect: n, isMobile: r = !1 }) {
10134
10321
  }
10135
10322
  //#endregion
10136
10323
  //#region src/components/layout/Navigation/ContextualDrawer.tsx
10137
- function so({ app: e, collapsed: t = !1, onNavigate: n, isMobile: r, onClose: i }) {
10324
+ function co({ app: e, collapsed: t = !1, onNavigate: n, isMobile: r, onClose: i }) {
10138
10325
  let [a, o] = v({});
10139
10326
  if (!e || t) return /* @__PURE__ */ w(J, {
10140
10327
  width: 0,
@@ -10287,7 +10474,7 @@ function so({ app: e, collapsed: t = !1, onNavigate: n, isMobile: r, onClose: i
10287
10474
  }
10288
10475
  //#endregion
10289
10476
  //#region src/components/layout/Navigation/NavigationShell.tsx
10290
- function co({ apps: e, defaultAppId: t, collapsed: n = !1, onNavigate: r, isMobile: i, isGuest: a = !1 }) {
10477
+ function lo({ apps: e, defaultAppId: t, collapsed: n = !1, onNavigate: r, isMobile: i, isGuest: a = !1 }) {
10291
10478
  if (a) return null;
10292
10479
  let [o, s] = v(t || e[0]?.app_id), [c, l] = v(!1), [u, d] = v(n);
10293
10480
  h(() => {
@@ -10298,14 +10485,14 @@ function co({ apps: e, defaultAppId: t, collapsed: n = !1, onNavigate: r, isMobi
10298
10485
  height: i ? "auto" : "100%",
10299
10486
  flexDirection: i ? "column-reverse" : "row",
10300
10487
  overflow: "visible",
10301
- children: [/* @__PURE__ */ w(oo, {
10488
+ children: [/* @__PURE__ */ w(so, {
10302
10489
  apps: e,
10303
10490
  activeAppId: o || "",
10304
10491
  isMobile: i,
10305
10492
  onAppSelect: (e) => {
10306
10493
  i ? (s(e), l(!0)) : e === o ? d(!u) : (s(e), d(!1));
10307
10494
  }
10308
- }), /* @__PURE__ */ w(so, {
10495
+ }), /* @__PURE__ */ w(co, {
10309
10496
  app: f,
10310
10497
  collapsed: i ? !c : u,
10311
10498
  isMobile: i,
@@ -10318,7 +10505,7 @@ function co({ apps: e, defaultAppId: t, collapsed: n = !1, onNavigate: r, isMobi
10318
10505
  }
10319
10506
  //#endregion
10320
10507
  //#region src/components/layout/DefaultLandingPage.tsx
10321
- function lo({ title: e = "Welcome" }) {
10508
+ function uo({ title: e = "Welcome" }) {
10322
10509
  let t = Me(), { theme: n, toggleTheme: r } = Y(), { t: i } = Le("desk");
10323
10510
  return /* @__PURE__ */ T(J, {
10324
10511
  minHeight: "100vh",
@@ -10399,7 +10586,10 @@ Ue.isInitialized || Ue.use(We).use(Ge).use(Ie).init({
10399
10586
  caches: ["localStorage"],
10400
10587
  lookupLocalStorage: "i18nextLng"
10401
10588
  },
10402
- backend: { loadPath: "/locales/{{lng}}/{{ns}}.json" },
10589
+ backend: { loadPath: (() => {
10590
+ let e = globalThis.__FRAMEWORK_CONFIG__;
10591
+ return `${e?.basename ? e.basename.replace(/\/$/, "") : ""}/locales/{{lng}}/{{ns}}.json`;
10592
+ })() },
10403
10593
  nsSeparator: !1,
10404
10594
  interpolation: { escapeValue: !1 },
10405
10595
  react: { useSuspense: !0 }
@@ -10414,10 +10604,10 @@ Ue.isInitialized || Ue.use(We).use(Ge).use(Ie).init({
10414
10604
  ].includes(e.split("-")[0]);
10415
10605
  document.documentElement.dir = t ? "rtl" : "ltr";
10416
10606
  });
10417
- var uo = Ue, fo = ({ isMobile: e }) => {
10607
+ var fo = Ue, po = ({ isMobile: e }) => {
10418
10608
  let t = Me(), { data: n } = pe(), r = l(n?.roles ?? []), i = _(!1);
10419
10609
  u.useEffect(() => {
10420
- n?.locale && !i.current && (i.current = !0, uo.language !== n.locale && uo.changeLanguage(n.locale));
10610
+ n?.locale && !i.current && (i.current = !0, fo.language !== n.locale && fo.changeLanguage(n.locale));
10421
10611
  }, [n]);
10422
10612
  let a = g(() => {
10423
10613
  let e = process.env.INSTALLED_APPS || "", t = e.split(",").map((e) => e.trim()), n = ["core"], i = e ? r.filter((e) => n.includes(e.app_id) || t.includes(e.app_id)) : r;
@@ -10435,7 +10625,7 @@ var uo = Ue, fo = ({ isMobile: e }) => {
10435
10625
  paddingVertical: "$lg",
10436
10626
  backgroundColor: "$background",
10437
10627
  children: /* @__PURE__ */ w(Te, {})
10438
- }), s = /* @__PURE__ */ w(co, {
10628
+ }), s = /* @__PURE__ */ w(lo, {
10439
10629
  apps: a,
10440
10630
  isMobile: e,
10441
10631
  onNavigate: (e) => t(e)
@@ -10451,31 +10641,31 @@ var uo = Ue, fo = ({ isMobile: e }) => {
10451
10641
  overflow: "hidden",
10452
10642
  children: [s, o]
10453
10643
  });
10454
- }, po = () => {
10644
+ }, mo = () => {
10455
10645
  let { pathname: e, search: t } = je(), n = encodeURIComponent(`${e}${t}`);
10456
- return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(Nr, {}), /* @__PURE__ */ w(we, {
10646
+ return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(Pr, {}), /* @__PURE__ */ w(we, {
10457
10647
  to: `/login?to=${n}`,
10458
10648
  replace: !0
10459
10649
  })] });
10460
- }, mo = [], ho = u.createContext(null), go = () => {
10461
- let e = u.useContext(ho);
10650
+ }, ho = [], go = u.createContext(null), _o = () => {
10651
+ let e = u.useContext(go);
10462
10652
  if (!e) return null;
10463
10653
  let { title: t, loginPage: n, children: r, isMobile: i, publicPluginRoutes: a, authenticatedPluginRoutes: o, hasPluginRootRoute: s } = e;
10464
10654
  return /* @__PURE__ */ T(De, { children: [
10465
10655
  a,
10466
10656
  !s && /* @__PURE__ */ w(Z, {
10467
10657
  path: "/",
10468
- element: /* @__PURE__ */ w(lo, { title: t })
10658
+ element: /* @__PURE__ */ w(uo, { title: t })
10469
10659
  }),
10470
10660
  /* @__PURE__ */ w(Z, {
10471
10661
  path: "/login",
10472
- element: n ?? /* @__PURE__ */ w($i, { title: t })
10662
+ element: n ?? /* @__PURE__ */ w(ea, { title: t })
10473
10663
  }),
10474
10664
  /* @__PURE__ */ T(Z, {
10475
10665
  element: /* @__PURE__ */ w(ie, {
10476
- fallback: /* @__PURE__ */ w(po, {}),
10477
- loading: /* @__PURE__ */ w(Nr, {}),
10478
- children: /* @__PURE__ */ w(fo, { isMobile: i })
10666
+ fallback: /* @__PURE__ */ w(mo, {}),
10667
+ loading: /* @__PURE__ */ w(Pr, {}),
10668
+ children: /* @__PURE__ */ w(po, { isMobile: i })
10479
10669
  }, "authenticated-routes"),
10480
10670
  children: [o, /* @__PURE__ */ T(Z, {
10481
10671
  path: "/app",
@@ -10497,35 +10687,35 @@ var uo = Ue, fo = ({ isMobile: e }) => {
10497
10687
  }),
10498
10688
  /* @__PURE__ */ w(Z, {
10499
10689
  path: "list",
10500
- element: /* @__PURE__ */ w(Ui, {})
10690
+ element: /* @__PURE__ */ w(Wi, {})
10501
10691
  }),
10502
10692
  /* @__PURE__ */ w(Z, {
10503
10693
  path: "kanban",
10504
- element: /* @__PURE__ */ w(Ui, { view: "kanban" })
10694
+ element: /* @__PURE__ */ w(Wi, { view: "kanban" })
10505
10695
  }),
10506
10696
  /* @__PURE__ */ w(Z, {
10507
10697
  path: "tree",
10508
- element: /* @__PURE__ */ w(Ui, { view: "tree" })
10698
+ element: /* @__PURE__ */ w(Wi, { view: "tree" })
10509
10699
  }),
10510
10700
  /* @__PURE__ */ w(Z, {
10511
10701
  path: "gantt",
10512
- element: /* @__PURE__ */ w(Ui, { view: "gantt" })
10702
+ element: /* @__PURE__ */ w(Wi, { view: "gantt" })
10513
10703
  }),
10514
10704
  /* @__PURE__ */ w(Z, {
10515
10705
  path: "calendar",
10516
- element: /* @__PURE__ */ w(Ui, { view: "calendar" })
10706
+ element: /* @__PURE__ */ w(Wi, { view: "calendar" })
10517
10707
  }),
10518
10708
  /* @__PURE__ */ w(Z, {
10519
10709
  path: "new",
10520
- element: /* @__PURE__ */ w(Ji, {})
10710
+ element: /* @__PURE__ */ w(Yi, {})
10521
10711
  }),
10522
10712
  /* @__PURE__ */ w(Z, {
10523
10713
  path: "detail/:id",
10524
- element: /* @__PURE__ */ w(Ji, {})
10714
+ element: /* @__PURE__ */ w(Yi, {})
10525
10715
  }),
10526
10716
  /* @__PURE__ */ w(Z, {
10527
10717
  path: "edit/:id",
10528
- element: /* @__PURE__ */ w(Ji, {})
10718
+ element: /* @__PURE__ */ w(Yi, {})
10529
10719
  })
10530
10720
  ]
10531
10721
  })
@@ -10537,17 +10727,17 @@ var uo = Ue, fo = ({ isMobile: e }) => {
10537
10727
  element: /* @__PURE__ */ w(we, { to: "/" })
10538
10728
  })
10539
10729
  ] });
10540
- }, _o = () => /* @__PURE__ */ w(oe, {
10730
+ }, vo = () => /* @__PURE__ */ w(oe, {
10541
10731
  dataProvider: _t,
10542
10732
  authProvider: yt,
10543
- routerProvider: ao,
10733
+ routerProvider: oo,
10544
10734
  liveProvider: Tt,
10545
10735
  options: {
10546
10736
  syncWithLocation: !0,
10547
10737
  warnWhenUnsavedChanges: !1
10548
10738
  },
10549
- children: /* @__PURE__ */ w(At, { children: /* @__PURE__ */ w(go, {}) })
10550
- }), vo = ({ title: n, children: c, initialPlugins: l = mo, defaultFocusMode: d = !1, serviceName: f = "core", loginPage: p }) => {
10739
+ children: /* @__PURE__ */ w(At, { children: /* @__PURE__ */ w(_o, {}) })
10740
+ }), yo = ({ title: n, children: c, initialPlugins: l = ho, defaultFocusMode: d = !1, serviceName: f = "core", loginPage: p }) => {
10551
10741
  let m = g(() => new y({ defaultOptions: { queries: { refetchOnWindowFocus: !1 } } }), []), [h, x] = v(d), [S, C] = v(globalThis.window?.innerWidth ? globalThis.window.innerWidth < 1024 : !1), [T, E] = v(!1);
10552
10742
  u.useEffect(() => {
10553
10743
  let e = () => {
@@ -10653,9 +10843,9 @@ var uo = Ue, fo = ({ isMobile: e }) => {
10653
10843
  };
10654
10844
  }, [D, O]), P = `${globalThis.location?.protocol === "https:" ? "wss:" : "ws:"}//${globalThis.location?.host}/api/v1/stream`, F = g(() => Oe([{
10655
10845
  path: "*",
10656
- element: /* @__PURE__ */ w(_o, {})
10846
+ element: /* @__PURE__ */ w(vo, {})
10657
10847
  }], { basename: et }), []);
10658
- return /* @__PURE__ */ w(ho.Provider, {
10848
+ return /* @__PURE__ */ w(go.Provider, {
10659
10849
  value: {
10660
10850
  title: n,
10661
10851
  loginPage: p,
@@ -10666,18 +10856,18 @@ var uo = Ue, fo = ({ isMobile: e }) => {
10666
10856
  hasPluginRootRoute: N
10667
10857
  },
10668
10858
  children: /* @__PURE__ */ w(Fe, {
10669
- i18n: uo,
10859
+ i18n: fo,
10670
10860
  children: /* @__PURE__ */ w(r, {
10671
10861
  registry: D,
10672
10862
  children: /* @__PURE__ */ w(re, { children: /* @__PURE__ */ w(V, { children: /* @__PURE__ */ w(u.Suspense, {
10673
- fallback: /* @__PURE__ */ w(Nr, {}),
10863
+ fallback: /* @__PURE__ */ w(Pr, {}),
10674
10864
  children: /* @__PURE__ */ w(b, {
10675
10865
  client: m,
10676
- children: /* @__PURE__ */ w(la, {
10866
+ children: /* @__PURE__ */ w(ua, {
10677
10867
  isMobile: S,
10678
10868
  rightSidebarOpen: T,
10679
10869
  setRightSidebarOpen: E,
10680
- realtimeAdapter: ua(P),
10870
+ realtimeAdapter: da(P),
10681
10871
  initialPlugins: l,
10682
10872
  focusMode: h,
10683
10873
  setFocusMode: x,
@@ -10690,6 +10880,6 @@ var uo = Ue, fo = ({ isMobile: e }) => {
10690
10880
  });
10691
10881
  };
10692
10882
  //#endregion
10693
- export { rt as API_URL, cr as AlertBanner, Ar as AsOfDatePicker, Tr as AuditTimeline, Qn as AutoForm, ir as AutoTable, Ei as Breadcrumb, ur as BulkActionsBar, Zr as CalendarView, Ai as ColumnGrid, wi as CommandPalette, or as ConfirmDialog, yi as CorrectButton, vi as CorrectionWizard, Cr as DiffViewer, ar as EditableCell, qn as FieldRegistry, Ji as FormView, vo as FrameworkMShell, ti as GanttView, Jr as KanbanView, Mi as Layout, kn as LinkField, Ui as ListView, $i as LoginPage, it as META_URL, Ti as Menu, ji as PageHeader, qt as SectionField, Gi as ShellContext, la as ShellProvider, Nr as ShellSkeleton, Si as SiblingPanel, xr as Slot, pr as StateBadge, lr as SubmittedBanner, At as SystemConfigProvider, Kt as TabContainer, ai as TreeView, ot as WS_URL, gr as WorkflowActions, Ni as WorkspaceSection, yt as authProvider, Et as closeAllConnections, ua as createWebSocketRealtimeAdapter, _t as frameworkMDataProvider, vt as getAuthConfig, Vr as getDocTypeViews, Rr as getRegisteredViews, Lr as getViewComponent, zr as getViewRegistration, Hr as isViewAvailable, Tt as liveProvider, vr as registerSlot, Ir as registerView, Br as setDocTypeViews, dn as useAuditTimeline, nn as useBulkActions, rn as useCommandPalette, cn as useCorrectionAction, Lt as useDocTypeMeta, Yt as useDocTypes, tn as useInlineEdit, Rt as usePrefetchDocTypeMeta, Ki as useShell, pn as useSiblingDocTypes, jt as useSystemConfig, $ as useTranslation, Qt as useWorkflowActions };
10883
+ export { rt as API_URL, lr as AlertBanner, jr as AsOfDatePicker, Er as AuditTimeline, $n as AutoForm, ar as AutoTable, Di as Breadcrumb, dr as BulkActionsBar, Qr as CalendarView, ji as ColumnGrid, Ti as CommandPalette, sr as ConfirmDialog, bi as CorrectButton, yi as CorrectionWizard, wr as DiffViewer, or as EditableCell, Jn as FieldRegistry, Yi as FormView, yo as FrameworkMShell, ni as GanttView, Yr as KanbanView, Ni as Layout, kn as LinkField, Wi as ListView, ea as LoginPage, it as META_URL, Ei as Menu, Mi as PageHeader, qt as SectionField, Ki as ShellContext, ua as ShellProvider, Pr as ShellSkeleton, Ci as SiblingPanel, Sr as Slot, mr as StateBadge, ur as SubmittedBanner, At as SystemConfigProvider, Kt as TabContainer, oi as TreeView, ot as WS_URL, _r as WorkflowActions, Pi as WorkspaceSection, yt as authProvider, Et as closeAllConnections, da as createWebSocketRealtimeAdapter, _t as frameworkMDataProvider, vt as getAuthConfig, Hr as getDocTypeViews, zr as getRegisteredViews, Rr as getViewComponent, Br as getViewRegistration, Ur as isViewAvailable, Tt as liveProvider, yr as registerSlot, Lr as registerView, Vr as setDocTypeViews, dn as useAuditTimeline, nn as useBulkActions, rn as useCommandPalette, cn as useCorrectionAction, Lt as useDocTypeMeta, Yt as useDocTypes, tn as useInlineEdit, Rt as usePrefetchDocTypeMeta, qi as useShell, pn as useSiblingDocTypes, jt as useSystemConfig, $ as useTranslation, Qt as useWorkflowActions };
10694
10884
 
10695
10885
  //# sourceMappingURL=index.js.map