@gisce/react-ooui 2.30.0-alpha.6 → 2.30.0-alpha.7

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.
@@ -543,15 +543,15 @@ const Gi = (e) => {
543
543
  async function b() {
544
544
  p(!0);
545
545
  try {
546
- const T = await x();
547
- await I(T);
548
- } catch (T) {
549
- it(T);
546
+ const C = await x();
547
+ await I(C);
548
+ } catch (C) {
549
+ it(C);
550
550
  }
551
551
  p(!1);
552
552
  }
553
553
  async function x() {
554
- const A = (await P.getHandler().search({
554
+ const O = (await P.getHandler().search({
555
555
  params: [["translatable", "=", "1"]],
556
556
  fieldsToRetrieve: ["code", "name"],
557
557
  model: "res.lang"
@@ -559,59 +559,59 @@ const Gi = (e) => {
559
559
  code: V.code,
560
560
  name: V.name
561
561
  }));
562
- return f == null || f(A), A;
562
+ return f == null || f(O), O;
563
563
  }
564
- async function I(T) {
565
- const A = {};
566
- for (const V of T) {
564
+ async function I(C) {
565
+ const O = {};
566
+ for (const V of C) {
567
567
  const F = (await P.getHandler().readObjects({
568
568
  model: r,
569
569
  ids: [o],
570
570
  fieldsToRetrieve: [s],
571
571
  context: { lang: V.code }
572
572
  }))[0];
573
- A[V.code] = F[s] || "";
573
+ O[V.code] = F[s] || "";
574
574
  }
575
- g.current = A, v(A);
575
+ g.current = O, v(O);
576
576
  }
577
577
  function w() {
578
- return u.map((T, A) => /* @__PURE__ */ D(Ne, { style: { paddingBottom: 20 }, children: [
579
- /* @__PURE__ */ i(be, { flex: "8rem", style: { paddingRight: 10 }, children: T.name }),
578
+ return u.map((C, O) => /* @__PURE__ */ D(Ne, { style: { paddingBottom: 20 }, children: [
579
+ /* @__PURE__ */ i(be, { flex: "8rem", style: { paddingRight: 10 }, children: C.name }),
580
580
  /* @__PURE__ */ i(be, { flex: "auto", children: /* @__PURE__ */ i(
581
581
  dl,
582
582
  {
583
583
  rows: 4,
584
- value: y[T.code] || "",
584
+ value: y[C.code] || "",
585
585
  onChange: (V) => {
586
586
  v({
587
587
  ...y,
588
- [T.code]: V.target.value
588
+ [C.code]: V.target.value
589
589
  });
590
590
  },
591
591
  disabled: h
592
592
  }
593
593
  ) })
594
- ] }, A));
594
+ ] }, O));
595
595
  }
596
- async function O() {
596
+ async function A() {
597
597
  m(!0);
598
598
  try {
599
- for (const T of Object.keys(y))
600
- y[T] !== g.current[T] && await P.getHandler().update({
599
+ for (const C of Object.keys(y))
600
+ y[C] !== g.current[C] && await P.getHandler().update({
601
601
  model: r,
602
602
  id: o,
603
- values: { [s]: y[T] },
603
+ values: { [s]: y[C] },
604
604
  context: {
605
- lang: T
605
+ lang: C
606
606
  },
607
607
  fields: {}
608
608
  });
609
- } catch (T) {
610
- it(T);
609
+ } catch (C) {
610
+ it(C);
611
611
  }
612
612
  m(!1), a();
613
613
  }
614
- function C() {
614
+ function T() {
615
615
  return d ? /* @__PURE__ */ i(We, {}) : /* @__PURE__ */ D(ae, { children: [
616
616
  w(),
617
617
  /* @__PURE__ */ i(Ln, {}),
@@ -630,7 +630,7 @@ const Gi = (e) => {
630
630
  {
631
631
  icon: h ? /* @__PURE__ */ i(gt, {}) : /* @__PURE__ */ i(Bn, {}),
632
632
  disabled: h,
633
- onClick: O,
633
+ onClick: A,
634
634
  style: { marginLeft: 15 },
635
635
  type: "primary",
636
636
  children: c("ok")
@@ -651,7 +651,7 @@ const Gi = (e) => {
651
651
  footer: null,
652
652
  destroyOnClose: !0,
653
653
  maskClosable: !1,
654
- children: C()
654
+ children: T()
655
655
  }
656
656
  );
657
657
  };
@@ -1158,19 +1158,19 @@ const Oc = (e) => {
1158
1158
  };
1159
1159
  return s ? /* @__PURE__ */ i(We, {}) : l ? /* @__PURE__ */ i(nt, { className: "mt-10", message: l, type: "error", banner: !0 }) : /* @__PURE__ */ i(Re, { type: "array", ...e, children: /* @__PURE__ */ i(Ac, { ooui: t, views: u }) });
1160
1160
  }, Ac = (e) => {
1161
- const { value: t, views: n, ooui: r, onChange: o } = e, { items: s = [] } = t || {}, [a, l] = S(!1), [c, u] = S(), [f, d] = S(!1), [p, h] = S(), { relation: m, context: y, readOnly: v, summaryField: g, titleField: b } = r, x = s.filter((T) => T.values), I = re(He), { getContext: w } = I || {};
1161
+ const { value: t, views: n, ooui: r, onChange: o } = e, { items: s = [] } = t || {}, [a, l] = S(!1), [c, u] = S(), [f, d] = S(!1), [p, h] = S(), { relation: m, context: y, readOnly: v, summaryField: g, titleField: b } = r, x = s.filter((C) => C.values), I = re(He), { getContext: w } = I || {};
1162
1162
  yt(() => {
1163
- C();
1163
+ T();
1164
1164
  }, [s]);
1165
- const O = (T) => {
1165
+ const A = (C) => {
1166
1166
  o == null || o({
1167
- items: T
1167
+ items: C
1168
1168
  });
1169
1169
  };
1170
- async function C() {
1170
+ async function T() {
1171
1171
  l(!0), u(void 0);
1172
1172
  try {
1173
- const [T] = await eo({
1173
+ const [C] = await eo({
1174
1174
  treeView: {
1175
1175
  fields: n.get("tree").fields,
1176
1176
  arch: n.get("tree").arch
@@ -1183,15 +1183,15 @@ const Oc = (e) => {
1183
1183
  context: { ...w == null ? void 0 : w(), ...y },
1184
1184
  currentView: "form"
1185
1185
  });
1186
- O(T);
1187
- } catch (T) {
1188
- u(T);
1186
+ A(C);
1187
+ } catch (C) {
1188
+ u(C);
1189
1189
  } finally {
1190
1190
  l(!1);
1191
1191
  }
1192
1192
  }
1193
1193
  return c ? /* @__PURE__ */ i(nt, { className: "mt-10", message: c, type: "error", banner: !0 }) : a ? /* @__PURE__ */ i(We, {}) : /* @__PURE__ */ D(ae, { children: [
1194
- /* @__PURE__ */ i(yr, { style: { padding: "1rem" }, children: x.map((T, A) => {
1194
+ /* @__PURE__ */ i(yr, { style: { padding: "1rem" }, children: x.map((C, O) => {
1195
1195
  var V, F;
1196
1196
  return /* @__PURE__ */ i(yr.Item, { children: /* @__PURE__ */ D(
1197
1197
  "div",
@@ -1199,16 +1199,16 @@ const Oc = (e) => {
1199
1199
  style: { display: "inline-block", cursor: "pointer" },
1200
1200
  onClick: () => {
1201
1201
  h(
1202
- x.find((_) => T.id === _.id)
1202
+ x.find((_) => C.id === _.id)
1203
1203
  ), d(!0);
1204
1204
  },
1205
1205
  children: [
1206
- /* @__PURE__ */ i("strong", { children: (V = T.values) == null ? void 0 : V[b] }),
1206
+ /* @__PURE__ */ i("strong", { children: (V = C.values) == null ? void 0 : V[b] }),
1207
1207
  /* @__PURE__ */ i("br", {}),
1208
- ((F = T.values) == null ? void 0 : F[g]) && /* @__PURE__ */ i("span", { children: T.values[g] })
1208
+ ((F = C.values) == null ? void 0 : F[g]) && /* @__PURE__ */ i("span", { children: C.values[g] })
1209
1209
  ]
1210
1210
  }
1211
- ) }, A);
1211
+ ) }, O);
1212
1212
  }) }),
1213
1213
  /* @__PURE__ */ i(
1214
1214
  dn,
@@ -1227,7 +1227,7 @@ const Oc = (e) => {
1227
1227
  d(!1);
1228
1228
  },
1229
1229
  readOnly: v,
1230
- postSaveAction: C
1230
+ postSaveAction: T
1231
1231
  }
1232
1232
  )
1233
1233
  ] });
@@ -1647,18 +1647,18 @@ const Pc = (e) => {
1647
1647
  });
1648
1648
  if (x) {
1649
1649
  const [I, w] = x, {
1650
- actionId: O,
1651
- actionType: C,
1652
- title: T,
1653
- model: A
1650
+ actionId: A,
1651
+ actionType: T,
1652
+ title: C,
1653
+ model: O
1654
1654
  } = g;
1655
1655
  c({
1656
1656
  domain: s == null ? void 0 : s.domain,
1657
- action_id: O,
1658
- action_type: C,
1659
- name: T,
1657
+ action_id: A,
1658
+ action_type: T,
1659
+ name: C,
1660
1660
  res_id: !1,
1661
- res_model: A,
1661
+ res_model: O,
1662
1662
  view_id: I,
1663
1663
  view_type: w,
1664
1664
  overrideUnsettedLimit: !0,
@@ -1895,7 +1895,7 @@ const { getValueForOperator: Eo } = Ri, Nc = (e) => {
1895
1895
  field: u,
1896
1896
  operator: f,
1897
1897
  manualIds: d
1898
- } = e, [p, h] = S(!1), [m, y] = S(), [v, g] = S(0), [b, x] = S(), [I, w] = S(), [O, C] = S(), [T, A] = S(), [V] = Je(
1898
+ } = e, [p, h] = S(!1), [m, y] = S(), [v, g] = S(0), [b, x] = S(), [I, w] = S(), [A, T] = S(), [C, O] = S(), [V] = Je(
1899
1899
  P.getHandler().searchAllIds
1900
1900
  ), [F] = Je(
1901
1901
  P.getHandler().readObjects
@@ -1961,7 +1961,7 @@ const { getValueForOperator: Eo } = Ri, Nc = (e) => {
1961
1961
  });
1962
1962
  }
1963
1963
  async function j() {
1964
- h(!0), A(void 0);
1964
+ h(!0), O(void 0);
1965
1965
  let M, k;
1966
1966
  try {
1967
1967
  const X = await G({ domain: n, isTotal: !1 });
@@ -1991,23 +1991,23 @@ const { getValueForOperator: Eo } = Ri, Nc = (e) => {
1991
1991
  values: { value: X, percent: k },
1992
1992
  context: r
1993
1993
  });
1994
- C(te);
1994
+ T(te);
1995
1995
  } else
1996
- C(l);
1997
- A(void 0);
1996
+ T(l);
1997
+ O(void 0);
1998
1998
  } catch (X) {
1999
- A(JSON.stringify(X));
1999
+ O(JSON.stringify(X));
2000
2000
  }
2001
2001
  h(!1);
2002
2002
  }
2003
- return p ? /* @__PURE__ */ i(bn, {}) : T ? /* @__PURE__ */ i(nt, { className: "mt-10", message: T, type: "error", banner: !0 }) : /* @__PURE__ */ i(
2003
+ return p ? /* @__PURE__ */ i(bn, {}) : C ? /* @__PURE__ */ i(nt, { className: "mt-10", message: C, type: "error", banner: !0 }) : /* @__PURE__ */ i(
2004
2004
  ns,
2005
2005
  {
2006
2006
  value: m,
2007
2007
  totalValue: b,
2008
2008
  percent: v,
2009
2009
  color: I,
2010
- icon: O,
2010
+ icon: A,
2011
2011
  suffix: c,
2012
2012
  showPercent: a
2013
2013
  }
@@ -2027,16 +2027,16 @@ const { getValueForOperator: Eo } = Ri, Nc = (e) => {
2027
2027
  P.getHandler().readObjects
2028
2028
  ), [I] = Je(P.getHandler().search), w = B(async () => {
2029
2029
  u(!0), d(void 0), g(n.type || "line");
2030
- const O = Lc({ ooui: n });
2031
- let C, T;
2030
+ const A = Lc({ ooui: n });
2031
+ let T, C;
2032
2032
  try {
2033
- ({ values: C, fields: T } = await Hc({
2033
+ ({ values: T, fields: C } = await Hc({
2034
2034
  model: t,
2035
2035
  domain: r,
2036
2036
  context: o,
2037
2037
  limit: s,
2038
2038
  order: n.timerange ? n.x.name : null,
2039
- fields: O,
2039
+ fields: A,
2040
2040
  manualIds: l,
2041
2041
  methods: {
2042
2042
  getFields: b,
@@ -2044,12 +2044,12 @@ const { getValueForOperator: Eo } = Ri, Nc = (e) => {
2044
2044
  search: I
2045
2045
  }
2046
2046
  }));
2047
- } catch (A) {
2048
- d("Error fetching graph data values: " + JSON.stringify(A)), u(!1);
2047
+ } catch (O) {
2048
+ d("Error fetching graph data values: " + JSON.stringify(O)), u(!1);
2049
2049
  return;
2050
2050
  }
2051
2051
  try {
2052
- if (!C || !T)
2052
+ if (!T || !C)
2053
2053
  return d("No values or fields returned"), u(!1), {
2054
2054
  loading: c,
2055
2055
  error: f,
@@ -2058,18 +2058,18 @@ const { getValueForOperator: Eo } = Ri, Nc = (e) => {
2058
2058
  evaluatedEntries: m,
2059
2059
  fetchData: w
2060
2060
  };
2061
- y(C);
2062
- const A = Mc({
2061
+ y(T);
2062
+ const O = Mc({
2063
2063
  ooui: n,
2064
- values: C,
2065
- fields: T,
2064
+ values: T,
2065
+ fields: C,
2066
2066
  options: {
2067
2067
  uninformedString: a
2068
2068
  }
2069
2069
  });
2070
- d(void 0), h(A);
2071
- } catch (A) {
2072
- d("Error processing graph data: " + A), u(!1);
2070
+ d(void 0), h(O);
2071
+ } catch (O) {
2072
+ d("Error processing graph data: " + O), u(!1);
2073
2073
  return;
2074
2074
  }
2075
2075
  u(!1);
@@ -2467,19 +2467,19 @@ const Jc = ({
2467
2467
  setTotalItems: x,
2468
2468
  setSelectedRowItems: I,
2469
2469
  selectedRowItems: w,
2470
- searchTreeNameSearch: O,
2471
- setSearchTreeNameSearch: C,
2472
- goToResourceId: T,
2473
- limit: A,
2470
+ searchTreeNameSearch: A,
2471
+ setSearchTreeNameSearch: T,
2472
+ goToResourceId: C,
2473
+ limit: O,
2474
2474
  isActive: V
2475
- } = e, [F, _] = S(!1), [$, R] = S(!1), [G, W] = S(!1), [j, M] = S(!0), [k, X] = S(!0), [te, oe] = S([]), [H, ie] = S(!1), [ee, N] = S([]), [L, E] = S(!1), [de, z] = S(!0), [Y, me] = S(), [ve, $e] = S({}), [Le, Ie] = S(0), [Ee, Ke] = S(), [Fe, ce] = S(!1), [fe, we] = S(
2476
- A !== void 0 ? A : $t
2475
+ } = e, [F, _] = S(!1), [$, R] = S(!1), [G, W] = S(!1), [j, M] = S(!0), [k, X] = S(!0), [te, oe] = S([]), [H, ie] = S(!1), [ee, N] = S([]), [L, E] = S(!1), [de, z] = S(!0), [Y, me] = S(), [ve, ke] = S({}), [Le, Ie] = S(0), [$e, Ke] = S(), [Fe, ce] = S(!1), [fe, we] = S(
2476
+ O !== void 0 ? O : $t
2477
2477
  ), [_e, J] = S(r);
2478
2478
  ue(() => {
2479
2479
  p && p.length > 0 && !h && (m == null || m(0), f == null || f(p[0].id));
2480
2480
  }, [p]), ue(() => {
2481
- we(A !== void 0 ? A : $t);
2482
- }, [A]), ue(() => {
2481
+ we(O !== void 0 ? O : $t);
2482
+ }, [O]), ue(() => {
2483
2483
  s.length === 1 ? me(s[0]) : s.length > 1 && me(
2484
2484
  s.filter(
2485
2485
  (Se) => Se.view_id !== n.view_id
@@ -2539,22 +2539,22 @@ const Jc = ({
2539
2539
  setSorter: g,
2540
2540
  totalItems: b,
2541
2541
  setTotalItems: x,
2542
- searchTreeNameSearch: O,
2543
- setSearchTreeNameSearch: C,
2542
+ searchTreeNameSearch: A,
2543
+ setSearchTreeNameSearch: T,
2544
2544
  setGraphIsLoading: z,
2545
2545
  graphIsLoading: de,
2546
2546
  previousView: Y,
2547
2547
  setPreviousView: me,
2548
- goToResourceId: T,
2548
+ goToResourceId: C,
2549
2549
  searchValues: ve,
2550
- setSearchValues: $e,
2550
+ setSearchValues: ke,
2551
2551
  limit: fe,
2552
2552
  setLimit: we,
2553
2553
  setTitle: J,
2554
2554
  isActive: V,
2555
2555
  setTreeFirstVisibleRow: Ie,
2556
2556
  treeFirstVisibleRow: Le,
2557
- searchQuery: Ee,
2557
+ searchQuery: $e,
2558
2558
  setSearchQuery: Ke,
2559
2559
  isInfiniteTree: Fe,
2560
2560
  setIsInfiniteTree: ce
@@ -3030,21 +3030,21 @@ const Lt = ({
3030
3030
  const { ooui: t } = e;
3031
3031
  return /* @__PURE__ */ i(Re, { type: "array", ...e, children: /* @__PURE__ */ i(gd, { ooui: t }) });
3032
3032
  }, gd = (e) => {
3033
- const { value: t, ooui: n, onChange: r } = e, { items: o = [] } = t || {}, s = o.filter((O) => O.operation !== "pendingRemove").map((O) => O.id), [a, l] = S([]), [c, u] = S(), [f, d] = S(!1), { relation: p, context: h, readOnly: m, field: y } = n, v = re(He), { getContext: g } = v || {};
3033
+ const { value: t, ooui: n, onChange: r } = e, { items: o = [] } = t || {}, s = o.filter((A) => A.operation !== "pendingRemove").map((A) => A.id), [a, l] = S([]), [c, u] = S(), [f, d] = S(!1), { relation: p, context: h, readOnly: m, field: y } = n, v = re(He), { getContext: g } = v || {};
3034
3034
  yt(() => {
3035
3035
  x();
3036
3036
  }, [o]);
3037
- const b = (O) => {
3037
+ const b = (A) => {
3038
3038
  r == null || r({
3039
- items: O
3039
+ items: A
3040
3040
  });
3041
3041
  };
3042
3042
  async function x() {
3043
3043
  d(!0);
3044
- let O = [];
3044
+ let A = [];
3045
3045
  try {
3046
- if (m && (O = [["id", "in", s]]), n.domain) {
3047
- const A = await P.getHandler().evalDomain({
3046
+ if (m && (A = [["id", "in", s]]), n.domain) {
3047
+ const O = await P.getHandler().evalDomain({
3048
3048
  domain: n.domain,
3049
3049
  values: Lt({
3050
3050
  fields: v == null ? void 0 : v.getFields(),
@@ -3053,46 +3053,46 @@ const Lt = ({
3053
3053
  fields: v == null ? void 0 : v.getFields(),
3054
3054
  context: v.getContext()
3055
3055
  });
3056
- O = [...O, ...A];
3056
+ A = [...A, ...O];
3057
3057
  }
3058
- const T = (await P.getHandler().search({
3058
+ const C = (await P.getHandler().search({
3059
3059
  model: p,
3060
- params: O,
3060
+ params: A,
3061
3061
  fieldsToRetrieve: [y],
3062
3062
  context: { ...g == null ? void 0 : g(), ...h }
3063
- })).map((A) => {
3064
- const V = A[y];
3063
+ })).map((O) => {
3064
+ const V = O[y];
3065
3065
  let F = V;
3066
- return Array.isArray(V) && (F = V[1]), { label: F, value: A.id };
3066
+ return Array.isArray(V) && (F = V[1]), { label: F, value: O.id };
3067
3067
  });
3068
- l(T);
3069
- } catch (C) {
3070
- u(C);
3068
+ l(C);
3069
+ } catch (T) {
3070
+ u(T);
3071
3071
  } finally {
3072
3072
  d(!1);
3073
3073
  }
3074
3074
  }
3075
- const I = (O) => {
3076
- const C = o.map((A) => O.includes(A.id) ? A.operation === "pendingRemove" ? {
3077
- ...A,
3075
+ const I = (A) => {
3076
+ const T = o.map((O) => A.includes(O.id) ? O.operation === "pendingRemove" ? {
3077
+ ...O,
3078
3078
  operation: "pendingLink"
3079
- } : A : { id: A.id, operation: "pendingRemove" }), T = C.map((A) => A.id);
3080
- O.filter((A) => !T.includes(A)).forEach((A) => {
3081
- C.push({ id: A, operation: "pendingLink" });
3082
- }), b(C);
3083
- }, w = (O) => {
3084
- const { label: C, closable: T, onClose: A } = O, V = (_) => {
3079
+ } : O : { id: O.id, operation: "pendingRemove" }), C = T.map((O) => O.id);
3080
+ A.filter((O) => !C.includes(O)).forEach((O) => {
3081
+ T.push({ id: O, operation: "pendingLink" });
3082
+ }), b(T);
3083
+ }, w = (A) => {
3084
+ const { label: T, closable: C, onClose: O } = A, V = (_) => {
3085
3085
  _.preventDefault(), _.stopPropagation();
3086
- }, F = vn(C);
3086
+ }, F = vn(T);
3087
3087
  return /* @__PURE__ */ i(
3088
3088
  oo,
3089
3089
  {
3090
3090
  color: F,
3091
3091
  onMouseDown: V,
3092
- closable: T,
3093
- onClose: A,
3092
+ closable: C,
3093
+ onClose: O,
3094
3094
  closeIcon: /* @__PURE__ */ i("span", { style: { color: F }, children: "X" }),
3095
- children: C
3095
+ children: T
3096
3096
  }
3097
3097
  );
3098
3098
  };
@@ -3107,7 +3107,7 @@ const Lt = ({
3107
3107
  options: a,
3108
3108
  onChange: I,
3109
3109
  loading: f,
3110
- filterOption: (O, C) => C.label.toLowerCase().includes(O.toString())
3110
+ filterOption: (A, T) => T.label.toLowerCase().includes(A.toString())
3111
3111
  }
3112
3112
  ) }) });
3113
3113
  }, yd = (e) => {
@@ -3339,21 +3339,21 @@ const Lt = ({
3339
3339
  context: {}
3340
3340
  }
3341
3341
  );
3342
- async function v(C) {
3343
- const { reportData: T, fields: A, values: V, context: F = {} } = C, {
3342
+ async function v(T) {
3343
+ const { reportData: C, fields: O, values: V, context: F = {} } = T, {
3344
3344
  context: _,
3345
3345
  model: $,
3346
3346
  datas: R = {},
3347
3347
  report_name: G,
3348
3348
  type: W
3349
- } = T;
3349
+ } = C;
3350
3350
  if (W !== "ir.actions.report.xml") {
3351
3351
  it(`${W} action not supported`);
3352
3352
  return;
3353
3353
  }
3354
3354
  const { ids: j } = R || {}, M = j || [], k = typeof _ == "string" ? Et({
3355
3355
  context: _,
3356
- fields: A,
3356
+ fields: O,
3357
3357
  values: V
3358
3358
  }) : _;
3359
3359
  try {
@@ -3371,62 +3371,62 @@ const Lt = ({
3371
3371
  s.current = !1, clearInterval(o.current), it(X), l(!1);
3372
3372
  }
3373
3373
  }
3374
- async function g(C) {
3375
- let T;
3374
+ async function g(T) {
3375
+ let C;
3376
3376
  try {
3377
- if (T = await P.getHandler().getReport({
3378
- id: C
3379
- }), T.state && s.current === !0) {
3377
+ if (C = await P.getHandler().getReport({
3378
+ id: T
3379
+ }), C.state && s.current === !0) {
3380
3380
  s.current = !1, clearInterval(o.current), l(!1);
3381
- const A = await Xt(T.result);
3382
- Yn(T.result, A.mime);
3381
+ const O = await Xt(C.result);
3382
+ Yn(C.result, O.mime);
3383
3383
  }
3384
- } catch (A) {
3385
- s.current = !1, clearInterval(o.current), l(!1), it(A.exception || A);
3384
+ } catch (O) {
3385
+ s.current = !1, clearInterval(o.current), l(!1), it(O.exception || O);
3386
3386
  }
3387
3387
  }
3388
3388
  async function b({
3389
- actionData: C,
3390
- fields: T,
3391
- values: A,
3389
+ actionData: T,
3390
+ fields: C,
3391
+ values: O,
3392
3392
  context: V,
3393
3393
  onRefreshParentValues: F
3394
3394
  }) {
3395
- const { type: _ } = C;
3395
+ const { type: _ } = T;
3396
3396
  if (f.current.push(F), _ === "ir.actions.report.xml")
3397
3397
  return await v({
3398
- reportData: C,
3399
- fields: T,
3400
- values: A,
3398
+ reportData: T,
3399
+ fields: C,
3400
+ values: O,
3401
3401
  context: V
3402
3402
  });
3403
3403
  if (_ === "ir.actions.act_window")
3404
- return await x({ actionData: C, fields: T, values: A, context: V });
3404
+ return await x({ actionData: T, fields: C, values: O, context: V });
3405
3405
  if (_ === "ir.actions.act_url")
3406
3406
  window.open(
3407
- md(C.url, { ...A, context: V }),
3407
+ md(T.url, { ...O, context: V }),
3408
3408
  "_blank"
3409
3409
  );
3410
3410
  else
3411
3411
  return it(`${_} action not supported`), {};
3412
3412
  }
3413
3413
  async function x({
3414
- actionData: C,
3415
- fields: T = {},
3416
- values: A = {},
3414
+ actionData: T,
3415
+ fields: C = {},
3416
+ values: O = {},
3417
3417
  context: V = {}
3418
3418
  }) {
3419
3419
  var G;
3420
- let F = C;
3421
- C.res_model || (F = (await P.getHandler().readObjects({
3420
+ let F = T;
3421
+ T.res_model || (F = (await P.getHandler().readObjects({
3422
3422
  model: "ir.actions.act_window",
3423
- ids: [parseInt(C.id)],
3423
+ ids: [parseInt(T.id)],
3424
3424
  context: V
3425
3425
  }))[0]);
3426
3426
  const _ = typeof (F == null ? void 0 : F.context) == "string" ? Et({
3427
3427
  context: F.context,
3428
- fields: T,
3429
- values: { ...A, ...r }
3428
+ fields: C,
3429
+ values: { ...O, ...r }
3430
3430
  }) : F.context, $ = {
3431
3431
  ...V,
3432
3432
  ..._
@@ -3435,10 +3435,10 @@ const Lt = ({
3435
3435
  if (F.domain && (R = await P.getHandler().evalDomain({
3436
3436
  domain: F.domain,
3437
3437
  values: Lt({
3438
- fields: T,
3439
- values: { ...A, ...r }
3438
+ fields: C,
3439
+ values: { ...O, ...r }
3440
3440
  }),
3441
- fields: T,
3441
+ fields: C,
3442
3442
  context: $
3443
3443
  })), F.target === "new") {
3444
3444
  const W = await P.getHandler().getView({
@@ -3474,18 +3474,18 @@ const Lt = ({
3474
3474
  }
3475
3475
  }
3476
3476
  function I({
3477
- domain: C,
3478
- model: T,
3479
- formView: A,
3477
+ domain: T,
3478
+ model: C,
3479
+ formView: O,
3480
3480
  context: V,
3481
3481
  actionData: F
3482
3482
  }) {
3483
- p ? w({ domain: C, model: T, formView: A, context: V, actionData: F }) : (y({ domain: C, model: T, context: V, formView: A, actionData: F }), h(!0));
3483
+ p ? w({ domain: T, model: C, formView: O, context: V, actionData: F }) : (y({ domain: T, model: C, context: V, formView: O, actionData: F }), h(!0));
3484
3484
  }
3485
3485
  async function w({
3486
- domain: C,
3487
- model: T,
3488
- formView: A,
3486
+ domain: T,
3487
+ model: C,
3488
+ formView: O,
3489
3489
  context: V,
3490
3490
  actionData: F
3491
3491
  }) {
@@ -3495,9 +3495,9 @@ const Lt = ({
3495
3495
  context: {},
3496
3496
  formView: void 0,
3497
3497
  actionData: void 0
3498
- }), h(!1), await new Promise((_) => setTimeout(_, 300)), y({ domain: C, model: T, context: V, formView: A, actionData: F }), h(!0);
3498
+ }), h(!1), await new Promise((_) => setTimeout(_, 300)), y({ domain: T, model: C, context: V, formView: O, actionData: F }), h(!0);
3499
3499
  }
3500
- async function O() {
3500
+ async function A() {
3501
3501
  Lo(f.current), f.current = [], h(!1), y({
3502
3502
  domain: void 0,
3503
3503
  model: void 0,
@@ -3536,7 +3536,7 @@ const Lt = ({
3536
3536
  model: m.model,
3537
3537
  formView: m.formView,
3538
3538
  visible: p,
3539
- onSubmitSucceed: O,
3539
+ onSubmitSucceed: A,
3540
3540
  onCancel: () => {
3541
3541
  Lo(f.current), f.current = [], h(!1), y({
3542
3542
  domain: void 0,
@@ -3633,10 +3633,10 @@ function kd(e, t) {
3633
3633
  visible: x = !0,
3634
3634
  rootForm: I = !1,
3635
3635
  defaultValues: w,
3636
- forcedValues: O = {},
3637
- parentWidth: C,
3638
- onMustRefreshParent: T
3639
- } = e, { t: A } = he(), [V, F] = S(!1), [_, $] = S(), [R, G] = S(), [W] = ut.useForm(), [j, M] = S(), [k, X] = S(), te = re(ds), [oe, H] = S(), [ie, ee] = S(!1), N = Q(), L = Q({}), E = Q({}), de = Q(!1), z = Q(!1), Y = Q(!1), ve = (C !== void 0 ? C : oe) < Pd, $e = re(He), { activeId: Le, getPlainValues: Ie } = $e || {}, Ee = Q(!1), Ke = re(
3636
+ forcedValues: A = {},
3637
+ parentWidth: T,
3638
+ onMustRefreshParent: C
3639
+ } = e, { t: O } = he(), [V, F] = S(!1), [_, $] = S(), [R, G] = S(), [W] = ut.useForm(), [j, M] = S(), [k, X] = S(), te = re(ds), [oe, H] = S(), [ie, ee] = S(!1), N = Q(), L = Q({}), E = Q({}), de = Q(!1), z = Q(!1), Y = Q(!1), ve = (T !== void 0 ? T : oe) < Pd, ke = re(He), { activeId: Le, getPlainValues: Ie } = ke || {}, $e = Q(!1), Ke = re(
3640
3640
  lt
3641
3641
  ), {
3642
3642
  setFormIsSaving: Fe = void 0,
@@ -3674,9 +3674,9 @@ function kd(e, t) {
3674
3674
  }), ee(!1));
3675
3675
  }, [ie]);
3676
3676
  const ne = (U, K, se, le) => {
3677
- ce == null || ce(!1), Fe == null || Fe(!1), s == null || s(U, K, se, le), fe == null || fe(U), Ee.current && (T == null || T());
3677
+ ce == null || ce(!1), Fe == null || Fe(!1), s == null || s(U, K, se, le), fe == null || fe(U), $e.current && (C == null || C());
3678
3678
  }, Oe = () => {
3679
- Ee.current && (T == null || T()), Fe == null || Fe(!1), o == null || o();
3679
+ $e.current && (C == null || C()), Fe == null || Fe(!1), o == null || o();
3680
3680
  }, qe = (U) => {
3681
3681
  Fe == null || Fe(!1), u == null || u(U);
3682
3682
  };
@@ -3688,7 +3688,7 @@ function kd(e, t) {
3688
3688
  }
3689
3689
  function q() {
3690
3690
  const U = {
3691
- ...ke(k),
3691
+ ...Pe(k),
3692
3692
  ...Z()
3693
3693
  };
3694
3694
  for (const K in U)
@@ -3704,7 +3704,7 @@ function kd(e, t) {
3704
3704
  }
3705
3705
  function Ae() {
3706
3706
  const U = {
3707
- ...ke(k)
3707
+ ...Pe(k)
3708
3708
  };
3709
3709
  for (const K in U)
3710
3710
  U[K] === void 0 && delete U[K];
@@ -3725,7 +3725,7 @@ function kd(e, t) {
3725
3725
  ...Me
3726
3726
  };
3727
3727
  }
3728
- const Pe = async (U) => {
3728
+ const Ee = async (U) => {
3729
3729
  const K = pe() ? R == null ? void 0 : R.context : {};
3730
3730
  return await P.getHandler().defaultGet({
3731
3731
  model: n,
@@ -3736,10 +3736,10 @@ function kd(e, t) {
3736
3736
  }, Ye = () => Object.keys(
3737
3737
  sr({
3738
3738
  source: L.current,
3739
- target: ke(k),
3739
+ target: Pe(k),
3740
3740
  fields: k
3741
3741
  })
3742
- ).length !== 0, ke = (U) => {
3742
+ ).length !== 0, Pe = (U) => {
3743
3743
  const K = W.getFieldsValue(!0);
3744
3744
  return Wt(K, U);
3745
3745
  }, ot = (U, K) => {
@@ -3756,7 +3756,7 @@ function kd(e, t) {
3756
3756
  try {
3757
3757
  return await W.validateFields(), !1;
3758
3758
  } catch {
3759
- return or.error(A("fillRequiredFields")), !0;
3759
+ return or.error(O("fillRequiredFields")), !0;
3760
3760
  }
3761
3761
  }
3762
3762
  const Be = async () => {
@@ -3785,7 +3785,7 @@ function kd(e, t) {
3785
3785
  }), fn({ fields: se, arch: le, values: K }), we == null || we(!1), ce == null || ce(!1), Te && ee(!0);
3786
3786
  }, xt = async () => new Promise(async (U) => {
3787
3787
  Ye() ? an({
3788
- t: A,
3788
+ t: O,
3789
3789
  onOk: () => {
3790
3790
  Oe == null || Oe(), U(!0);
3791
3791
  },
@@ -3850,30 +3850,30 @@ function kd(e, t) {
3850
3850
  });
3851
3851
  _e == null || _e(Qe);
3852
3852
  } else
3853
- _e == null || _e([]), se = await Pe(U), le = !0;
3853
+ _e == null || _e([]), se = await Ee(U), le = !0;
3854
3854
  return { values: se, defaultGetCalled: le };
3855
3855
  }, go = async (U) => {
3856
3856
  const { callOnSubmitSucceed: K = !0 } = U || {};
3857
3857
  if (pe()) {
3858
3858
  const se = sr({
3859
3859
  source: L.current,
3860
- target: ke(k),
3860
+ target: Pe(k),
3861
3861
  fields: k
3862
3862
  });
3863
3863
  await P.getHandler().update({
3864
3864
  model: n,
3865
3865
  id: pe(),
3866
- values: { ...se, ...O },
3866
+ values: { ...se, ...A },
3867
3867
  fields: k,
3868
3868
  context: {
3869
3869
  ...g,
3870
3870
  ...R == null ? void 0 : R.context
3871
3871
  }
3872
- }), L.current = ke(k);
3872
+ }), L.current = Pe(k);
3873
3873
  } else {
3874
- const se = ke(k), le = await P.getHandler().create({
3874
+ const se = Pe(k), le = await P.getHandler().create({
3875
3875
  model: n,
3876
- values: { ...se, ...O },
3876
+ values: { ...se, ...A },
3877
3877
  fields: k,
3878
3878
  context: {
3879
3879
  ...g,
@@ -3902,12 +3902,12 @@ function kd(e, t) {
3902
3902
  if (!Ye() && pe() && se)
3903
3903
  return z.current = !1, ce == null || ce(!1), Oe == null || Oe(), { succeed: !0, id: pe() };
3904
3904
  if (await St())
3905
- return z.current = !1, Mo(A), { succeed: !1, id: pe() };
3905
+ return z.current = !1, Mo(O), { succeed: !1, id: pe() };
3906
3906
  F(!0), Fe == null || Fe(!0);
3907
3907
  try {
3908
- p === "api" ? await go(U) : await ua(U), d && (N.current = void 0, mt({ values: {}, fields: k, reset: !0 })), await ze({ forceRefresh: !0 }), K = !0, or.success(A("savedRegisters"));
3908
+ p === "api" ? await go(U) : await ua(U), d && (N.current = void 0, mt({ values: {}, fields: k, reset: !0 })), await ze({ forceRefresh: !0 }), K = !0, or.success(O("savedRegisters"));
3909
3909
  } catch (le) {
3910
- z.current = !1, F(!1), Fe == null || Fe(!1), qe == null || qe(le), or.error(A("errorWhileSavingForm")), $(le != null && le.message ? le.message : le);
3910
+ z.current = !1, F(!1), Fe == null || Fe(!1), qe == null || qe(le), or.error(O("errorWhileSavingForm")), $(le != null && le.message ? le.message : le);
3911
3911
  } finally {
3912
3912
  z.current = !1, Fe == null || Fe(!1), F(!1);
3913
3913
  }
@@ -3950,7 +3950,7 @@ function kd(e, t) {
3950
3950
  return;
3951
3951
  const K = sr({
3952
3952
  source: E.current,
3953
- target: ke(k),
3953
+ target: Pe(k),
3954
3954
  fields: k
3955
3955
  }), se = Object.keys(K);
3956
3956
  if (se.length !== 0 && !(cd({
@@ -3986,13 +3986,13 @@ function kd(e, t) {
3986
3986
  fn({
3987
3987
  fields: k,
3988
3988
  arch: j,
3989
- values: ke(k)
3989
+ values: Pe(k)
3990
3990
  });
3991
3991
  return;
3992
3992
  }
3993
3993
  const se = fd({
3994
3994
  values: {
3995
- ...ke(k),
3995
+ ...Pe(k),
3996
3996
  context: {
3997
3997
  ...g,
3998
3998
  ...R == null ? void 0 : R.context
@@ -4009,7 +4009,7 @@ function kd(e, t) {
4009
4009
  });
4010
4010
  if (le.value) {
4011
4011
  const Te = {
4012
- ...ke(k),
4012
+ ...Pe(k),
4013
4013
  ...le.value
4014
4014
  }, Qe = Tc({
4015
4015
  values: Te,
@@ -4039,7 +4039,7 @@ function kd(e, t) {
4039
4039
  fn({
4040
4040
  fields: Te,
4041
4041
  arch: j,
4042
- values: ke(Te)
4042
+ values: Pe(Te)
4043
4043
  }), X(Te);
4044
4044
  }
4045
4045
  };
@@ -4107,7 +4107,7 @@ function kd(e, t) {
4107
4107
  ...K
4108
4108
  },
4109
4109
  onRefreshParentValues: async () => {
4110
- Ee.current = !0, await ze({ forceRefresh: !0 });
4110
+ $e.current = !0, await ze({ forceRefresh: !0 });
4111
4111
  }
4112
4112
  })) || {};
4113
4113
  !I && se && (ne == null || ne(pe(), q(), Ae()));
@@ -4119,7 +4119,7 @@ function kd(e, t) {
4119
4119
  fn({
4120
4120
  fields: k,
4121
4121
  arch: j,
4122
- values: ke(k),
4122
+ values: Pe(k),
4123
4123
  operationInProgress: U
4124
4124
  });
4125
4125
  }
@@ -4133,7 +4133,7 @@ function kd(e, t) {
4133
4133
  return;
4134
4134
  }
4135
4135
  if (await St()) {
4136
- Mo(A);
4136
+ Mo(O);
4137
4137
  return;
4138
4138
  }
4139
4139
  let le = !1;
@@ -4241,23 +4241,23 @@ const cn = pt(kd), dn = (e) => {
4241
4241
  a && w();
4242
4242
  }, [l, a]);
4243
4243
  async function w() {
4244
- const A = await P.getHandler().isShortcutFavorite({
4244
+ const O = await P.getHandler().isShortcutFavorite({
4245
4245
  action_id: g,
4246
4246
  action_type: x,
4247
4247
  view_id: I,
4248
4248
  res_id: b || !1
4249
4249
  });
4250
- m(A !== !1), A !== !1 && v(A);
4250
+ m(O !== !1), O !== !1 && v(O);
4251
4251
  }
4252
- async function O() {
4252
+ async function A() {
4253
4253
  if (h && y)
4254
4254
  await P.getHandler().removeFavourite({
4255
4255
  shortcut_id: y
4256
4256
  });
4257
4257
  else {
4258
- const { action_id: A, res_id: V, action_type: F, view_id: _ } = l;
4258
+ const { action_id: O, res_id: V, action_type: F, view_id: _ } = l;
4259
4259
  await P.getHandler().addFavourite({
4260
- action_id: A,
4260
+ action_id: O,
4261
4261
  action_type: F,
4262
4262
  view_id: _,
4263
4263
  res_id: V || !1
@@ -4265,7 +4265,7 @@ const cn = pt(kd), dn = (e) => {
4265
4265
  }
4266
4266
  m(!h);
4267
4267
  }
4268
- function C() {
4268
+ function T() {
4269
4269
  return /* @__PURE__ */ D(Ne, { align: "middle", children: [
4270
4270
  /* @__PURE__ */ i(be, { children: /* @__PURE__ */ i(
4271
4271
  je,
@@ -4273,17 +4273,17 @@ const cn = pt(kd), dn = (e) => {
4273
4273
  type: h ? "primary" : "default",
4274
4274
  icon: h ? /* @__PURE__ */ i(Ha, { style: { color: "white" } }) : /* @__PURE__ */ i(Ua, {}),
4275
4275
  style: { width: 30 },
4276
- onClick: O
4276
+ onClick: A
4277
4277
  }
4278
4278
  ) }),
4279
4279
  /* @__PURE__ */ i(be, { style: { paddingLeft: 10 }, children: d })
4280
4280
  ] });
4281
4281
  }
4282
- const T = f * 0.95;
4282
+ const C = f * 0.95;
4283
4283
  return /* @__PURE__ */ i(Rd, { setTitle: p, children: /* @__PURE__ */ i(
4284
4284
  at,
4285
4285
  {
4286
- title: a ? C() : d,
4286
+ title: a ? T() : d,
4287
4287
  centered: !0,
4288
4288
  width: f,
4289
4289
  open: t,
@@ -4298,7 +4298,7 @@ const cn = pt(kd), dn = (e) => {
4298
4298
  showFooter: !0,
4299
4299
  insideButtonModal: o,
4300
4300
  onCancel: s,
4301
- parentWidth: T,
4301
+ parentWidth: C,
4302
4302
  ...c
4303
4303
  },
4304
4304
  `${u}-${n}-${g}-${b}-${x}-${I}-${r}`
@@ -4697,11 +4697,11 @@ function ms(e) {
4697
4697
  searchError: d,
4698
4698
  searchValues: p,
4699
4699
  showLimitOptions: h = !0
4700
- } = e, [m, y] = S(), [v, g] = S(), [b, x] = S(!1), I = Q(), { token: w } = iu(), [O] = ut.useForm();
4700
+ } = e, [m, y] = S(), [v, g] = S(), [b, x] = S(!1), I = Q(), { token: w } = iu(), [A] = ut.useForm();
4701
4701
  ue(() => {
4702
- O.setFieldsValue(p);
4702
+ A.setFieldsValue(p);
4703
4703
  }, [p]);
4704
- const C = () => {
4704
+ const T = () => {
4705
4705
  if (!v)
4706
4706
  return;
4707
4707
  const V = b ? v : m, F = V == null ? void 0 : V.rows;
@@ -4710,7 +4710,7 @@ function ms(e) {
4710
4710
  yt(() => {
4711
4711
  x(!1), I.current = new Di(n, t), I.current.parse(), y(I.current._simpleSearchContainer), g(I.current._advancedSearchContainer);
4712
4712
  }, [t, n]);
4713
- const T = C(), A = (V) => {
4713
+ const C = T(), O = (V) => {
4714
4714
  var R;
4715
4715
  const { limit: F, offset: _ } = V;
4716
4716
  delete V.offset, delete V.limit;
@@ -4734,11 +4734,11 @@ function ms(e) {
4734
4734
  {
4735
4735
  className: "p-3 shadow-md",
4736
4736
  style: { borderRadius: w.borderRadius },
4737
- form: O,
4738
- onFinish: A,
4737
+ form: A,
4738
+ onFinish: O,
4739
4739
  initialValues: { offset: a, limit: l },
4740
4740
  children: [
4741
- T,
4741
+ C,
4742
4742
  b && h && /* @__PURE__ */ i(Xd, { onLimitChange: c }),
4743
4743
  /* @__PURE__ */ i(
4744
4744
  Jd,
@@ -4748,7 +4748,7 @@ function ms(e) {
4748
4748
  x(!b);
4749
4749
  },
4750
4750
  onClear: () => {
4751
- O.resetFields(), r();
4751
+ A.resetFields(), r();
4752
4752
  },
4753
4753
  isSearching: s
4754
4754
  }
@@ -4967,7 +4967,7 @@ const du = (e) => /* @__PURE__ */ i(Re, { ...e, children: /* @__PURE__ */ i(hs,
4967
4967
  ), v = B(() => {
4968
4968
  h(), y();
4969
4969
  }, [h, y]), g = B(async () => {
4970
- var O;
4970
+ var A;
4971
4971
  const x = await p({
4972
4972
  model: n,
4973
4973
  type: "form",
@@ -4976,12 +4976,12 @@ const du = (e) => /* @__PURE__ */ i(Re, { ...e, children: /* @__PURE__ */ i(hs,
4976
4976
  s(x);
4977
4977
  const I = mu(x);
4978
4978
  let w = {};
4979
- if (I.length > 0 && (w = { ...(O = await m({
4979
+ if (I.length > 0 && (w = { ...(A = await m({
4980
4980
  model: n,
4981
4981
  ids: [t],
4982
4982
  fieldsToRetrieve: I,
4983
4983
  context: r
4984
- })) == null ? void 0 : O[0] }), w = { ...Wt(w, I), active_id: t }, l(w), !(!x || !x.toolbar))
4984
+ })) == null ? void 0 : A[0] }), w = { ...Wt(w, I), active_id: t }, l(w), !(!x || !x.toolbar))
4985
4985
  return {
4986
4986
  actionItems: x.toolbar.action,
4987
4987
  relateItems: x.toolbar.relate,
@@ -5303,9 +5303,9 @@ const du = (e) => /* @__PURE__ */ i(Re, { ...e, children: /* @__PURE__ */ i(hs,
5303
5303
  childField: x,
5304
5304
  rootTree: I = !1,
5305
5305
  context: w,
5306
- readonly: O,
5307
- onSelectAllRecords: C
5308
- } = e, T = Q(null), [A, V] = S([]), F = Q(!1), [_, $] = S(), { t: R } = he(), G = Q(r), W = re(
5306
+ readonly: A,
5307
+ onSelectAllRecords: T
5308
+ } = e, C = Q(null), [O, V] = S([]), F = Q(!1), [_, $] = S(), { t: R } = he(), G = Q(r), W = re(
5309
5309
  lt
5310
5310
  ), { title: j = void 0, setTitle: M = void 0 } = (I ? W : {}) || {}, k = ye(() => {
5311
5311
  if (_)
@@ -5320,7 +5320,7 @@ const du = (e) => /* @__PURE__ */ i(Re, { ...e, children: /* @__PURE__ */ i(hs,
5320
5320
  ht(t, () => ({
5321
5321
  unselectAll: () => {
5322
5322
  var E;
5323
- (E = T.current) == null || E.unselectAll();
5323
+ (E = C.current) == null || E.unselectAll();
5324
5324
  }
5325
5325
  })), ue(() => {
5326
5326
  const E = Ot(s);
@@ -5334,14 +5334,14 @@ const du = (e) => /* @__PURE__ */ i(Re, { ...e, children: /* @__PURE__ */ i(hs,
5334
5334
  }, [a]), ue(() => {
5335
5335
  G.current = r;
5336
5336
  }, [r]);
5337
- const X = (n - 1) * G.current + 1, te = X - 1 + A.length, oe = o === void 0 ? null : o === 0 ? R("no_results") : R("summary").replace("{from}", X == null ? void 0 : X.toString()).replace("{to}", te == null ? void 0 : te.toString()).replace("{total}", o == null ? void 0 : o.toString()), H = ye(() => {
5337
+ const X = (n - 1) * G.current + 1, te = X - 1 + O.length, oe = o === void 0 ? null : o === 0 ? R("no_results") : R("summary").replace("{from}", X == null ? void 0 : X.toString()).replace("{to}", te == null ? void 0 : te.toString()).replace("{total}", o == null ? void 0 : o.toString()), H = ye(() => {
5338
5338
  if (!f || s.isExpandable)
5339
5339
  return null;
5340
- const E = A == null ? void 0 : A.filter(
5340
+ const E = O == null ? void 0 : O.filter(
5341
5341
  (de) => d && d.includes(de.id)
5342
5342
  ).length;
5343
5343
  return c ? null : o === void 0 ? /* @__PURE__ */ i(We, { className: "pb-4" }) : /* @__PURE__ */ D(Ne, { align: "bottom", className: "pb-4", children: [
5344
- /* @__PURE__ */ i(be, { span: C ? 8 : 12, children: /* @__PURE__ */ i(
5344
+ /* @__PURE__ */ i(be, { span: T ? 8 : 12, children: /* @__PURE__ */ i(
5345
5345
  Da,
5346
5346
  {
5347
5347
  total: o,
@@ -5351,23 +5351,23 @@ const du = (e) => /* @__PURE__ */ i(Re, { ...e, children: /* @__PURE__ */ i(hs,
5351
5351
  onChange: l
5352
5352
  }
5353
5353
  ) }),
5354
- C && /* @__PURE__ */ i(be, { span: 8, className: "text-center", children: /* @__PURE__ */ i(
5354
+ T && /* @__PURE__ */ i(be, { span: 8, className: "text-center", children: /* @__PURE__ */ i(
5355
5355
  lu,
5356
5356
  {
5357
5357
  numberOfVisibleSelectedRows: E,
5358
5358
  numberOfRealSelectedRows: (d == null ? void 0 : d.length) || 0,
5359
- numberOfTotalRows: A.length,
5359
+ numberOfTotalRows: O.length,
5360
5360
  totalRecords: o || 0,
5361
- onSelectAllRecords: C
5361
+ onSelectAllRecords: T
5362
5362
  }
5363
5363
  ) }),
5364
- /* @__PURE__ */ i(be, { span: C ? 8 : 12, className: "text-right", children: oe })
5364
+ /* @__PURE__ */ i(be, { span: T ? 8 : 12, className: "text-right", children: oe })
5365
5365
  ] });
5366
5366
  }, [
5367
- A,
5367
+ O,
5368
5368
  c,
5369
5369
  l,
5370
- C,
5370
+ T,
5371
5371
  n,
5372
5372
  d,
5373
5373
  f,
@@ -5380,24 +5380,24 @@ const du = (e) => /* @__PURE__ */ i(Re, { ...e, children: /* @__PURE__ */ i(hs,
5380
5380
  const E = _.columns.filter((Y) => Y.sum !== void 0).map((Y) => ({ label: Y.sum, field: Y.id }));
5381
5381
  if (!E || E.length === 0)
5382
5382
  return null;
5383
- const de = [], z = (d == null ? void 0 : d.length) > 0 ? A.filter((Y) => d.includes(Y.id)) : A;
5383
+ const de = [], z = (d == null ? void 0 : d.length) > 0 ? O.filter((Y) => d.includes(Y.id)) : O;
5384
5384
  return E.forEach((Y) => {
5385
- const me = z.reduce((ve, $e) => $e[Y.field] && !isNaN($e[Y.field]) ? ve + $e[Y.field] : ve, 0);
5385
+ const me = z.reduce((ve, ke) => ke[Y.field] && !isNaN(ke[Y.field]) ? ve + ke[Y.field] : ve, 0);
5386
5386
  de.push(`${Y.label}: ${Math.round(me * 100) / 100}`);
5387
5387
  }), /* @__PURE__ */ i("div", { className: "p-1 pb-0 pl-2 mt-2 ", children: de.join(", ") });
5388
- }, [A, d, _]), ee = ye(() => {
5388
+ }, [O, d, _]), ee = ye(() => {
5389
5389
  if (_ !== null && k && k.length > 0)
5390
- return su(k, A, 600);
5391
- }, [k, A, _]), N = ye(() => h && (_ != null && _.columns.some((E) => E.sum !== void 0)) ? h - 30 : h, [h, _ == null ? void 0 : _.columns]);
5390
+ return su(k, O, 600);
5391
+ }, [k, O, _]), N = ye(() => h && (_ != null && _.columns.some((E) => E.sum !== void 0)) ? h - 30 : h, [h, _ == null ? void 0 : _.columns]);
5392
5392
  return _ === null || !ee || ((L = ee == null ? void 0 : ee.columns) == null ? void 0 : L.length) === 0 ? /* @__PURE__ */ i(We, { style: { padding: "2rem" } }) : /* @__PURE__ */ D(Vn, { children: [
5393
5393
  H,
5394
5394
  /* @__PURE__ */ i(
5395
5395
  Tl,
5396
5396
  {
5397
- ref: T,
5397
+ ref: C,
5398
5398
  height: N,
5399
5399
  columns: ee.columns,
5400
- dataSource: A,
5400
+ dataSource: O,
5401
5401
  loading: c,
5402
5402
  loadingComponent: /* @__PURE__ */ i(We, {}),
5403
5403
  onRowStyle: (E) => {
@@ -5412,7 +5412,7 @@ const du = (e) => /* @__PURE__ */ i(Re, { ...e, children: /* @__PURE__ */ i(hs,
5412
5412
  onRowSelectionChange: p,
5413
5413
  onChangeSort: v,
5414
5414
  sorter: g,
5415
- readonly: O,
5415
+ readonly: A,
5416
5416
  expandableOpts: b ? {
5417
5417
  expandIcon: Ga,
5418
5418
  collapseIcon: Ka,
@@ -5451,10 +5451,10 @@ const vs = (e) => {
5451
5451
  currentId: x,
5452
5452
  limit: I,
5453
5453
  setLimit: w,
5454
- searchParams: O = [],
5455
- setSearchValues: C,
5456
- clearSelection: T
5457
- } = e, [A, V] = S(!1), [F, _] = S(!1), [$, R] = S(), [G, W] = S(1), [j, M] = S(0), [k, X] = S(), [te, oe] = S([]), [H, ie] = S(void 0), [ee, N] = S(void 0), L = Q(I || $t), E = Q([]), de = B(
5454
+ searchParams: A = [],
5455
+ setSearchValues: T,
5456
+ clearSelection: C
5457
+ } = e, [O, V] = S(!1), [F, _] = S(!1), [$, R] = S(), [G, W] = S(1), [j, M] = S(0), [k, X] = S(), [te, oe] = S([]), [H, ie] = S(void 0), [ee, N] = S(void 0), L = Q(I || $t), E = Q([]), de = B(
5458
5458
  (ce) => {
5459
5459
  v == null || v([...ce]), oe([...ce]);
5460
5460
  },
@@ -5502,7 +5502,7 @@ const vs = (e) => {
5502
5502
  f
5503
5503
  ]), me = B(
5504
5504
  async (ce) => {
5505
- const { params: fe, newOffset: we } = ce || {}, _e = Zt(fe || O, b), { colors: J, status: Ce } = Ot(d), Se = {};
5505
+ const { params: fe, newOffset: we } = ce || {}, _e = Zt(fe || A, b), { colors: J, status: Ce } = Ot(d), Se = {};
5506
5506
  J && (Se.colors = J), Ce && (Se.status = Ce);
5507
5507
  const { totalItems: Ue, results: Me, attrsEvaluated: ne } = await P.getHandler().searchForTree({
5508
5508
  params: _e,
@@ -5543,12 +5543,12 @@ const vs = (e) => {
5543
5543
  h,
5544
5544
  f,
5545
5545
  j,
5546
- O
5546
+ A
5547
5547
  ]
5548
5548
  ), ve = B(
5549
5549
  async (ce) => {
5550
5550
  try {
5551
- V(!0), a == null || a(!0), l && !c.current ? await Y() : await me(ce), T == null || T();
5551
+ V(!0), a == null || a(!0), l && !c.current ? await Y() : await me(ce), C == null || C();
5552
5552
  } catch (fe) {
5553
5553
  R(typeof fe == "string" ? fe : fe.message), V(!1);
5554
5554
  } finally {
@@ -5556,7 +5556,7 @@ const vs = (e) => {
5556
5556
  }
5557
5557
  },
5558
5558
  [
5559
- T,
5559
+ C,
5560
5560
  l,
5561
5561
  Y,
5562
5562
  c,
@@ -5564,7 +5564,7 @@ const vs = (e) => {
5564
5564
  r,
5565
5565
  a
5566
5566
  ]
5567
- ), $e = B(
5567
+ ), ke = B(
5568
5568
  (ce) => {
5569
5569
  if (JSON.stringify(ce) === JSON.stringify(h))
5570
5570
  return;
@@ -5587,16 +5587,16 @@ const vs = (e) => {
5587
5587
  ), Le = B(
5588
5588
  (ce) => {
5589
5589
  const { params: fe, searchValues: we, limit: _e, offset: J } = ce;
5590
- A || (n == null || n(void 0), r == null || r([]), C == null || C(we), o == null || o(fe), s == null || s(!1), _(!0), R(void 0), W(1), _e && (L.current = _e, w == null || w(_e)), J && M(J), ve({
5590
+ O || (n == null || n(void 0), r == null || r([]), T == null || T(we), o == null || o(fe), s == null || s(!1), _(!0), R(void 0), W(1), _e && (L.current = _e, w == null || w(_e)), J && M(J), ve({
5591
5591
  params: fe,
5592
5592
  newOffset: J
5593
5593
  }));
5594
5594
  },
5595
5595
  [
5596
- A,
5596
+ O,
5597
5597
  n,
5598
5598
  r,
5599
- C,
5599
+ T,
5600
5600
  o,
5601
5601
  s,
5602
5602
  ve,
@@ -5607,13 +5607,13 @@ const vs = (e) => {
5607
5607
  V(!0), W(ce), M((ce - 1) * I);
5608
5608
  },
5609
5609
  [V, I, M, W]
5610
- ), Ee = B(() => {
5611
- A || (n == null || n(void 0), o == null || o([]), C == null || C({}), R(void 0), M(0), W(1), w == null || w(I || $t));
5610
+ ), $e = B(() => {
5611
+ O || (n == null || n(void 0), o == null || o([]), T == null || T({}), R(void 0), M(0), W(1), w == null || w(I || $t));
5612
5612
  }, [
5613
- A,
5613
+ O,
5614
5614
  n,
5615
5615
  o,
5616
- C,
5616
+ T,
5617
5617
  w,
5618
5618
  I
5619
5619
  ]), Ke = B(
@@ -5628,16 +5628,16 @@ const vs = (e) => {
5628
5628
  },
5629
5629
  [d, t, u, z, de]
5630
5630
  ), Fe = B(async () => await P.getHandler().searchAllIds({
5631
- params: Zt(O, b),
5631
+ params: Zt(A, b),
5632
5632
  model: t,
5633
5633
  context: u,
5634
5634
  totalItems: k
5635
- }), [t, u, k, O, b]);
5635
+ }), [t, u, k, A, b]);
5636
5636
  return {
5637
5637
  submit: Le,
5638
- clear: Ee,
5638
+ clear: $e,
5639
5639
  fetchResults: ve,
5640
- tableRefreshing: A,
5640
+ tableRefreshing: O,
5641
5641
  searchFilterLoading: F,
5642
5642
  searchError: $,
5643
5643
  page: G,
@@ -5645,7 +5645,7 @@ const vs = (e) => {
5645
5645
  limit: L.current,
5646
5646
  getResults: z,
5647
5647
  requestPageChange: Ie,
5648
- changeSort: $e,
5648
+ changeSort: ke,
5649
5649
  fetchChildrenForRecord: Ke,
5650
5650
  colorsForResults: H,
5651
5651
  statusForResults: ee,
@@ -5667,7 +5667,7 @@ function Du(e, t) {
5667
5667
  rootTree: f = !1,
5668
5668
  parentContext: d = {},
5669
5669
  onChangeSelectedRowKeys: p
5670
- } = e, [h, m] = S(!1), [y, v] = S(!1), g = Q(!1), b = Q(null), [x, I] = S(), [w, O] = S(), [C, T] = S(), [A, V] = S(), [F, _] = S(200), $ = Q(), { height: R } = qn(), G = re(
5670
+ } = e, [h, m] = S(!1), [y, v] = S(!1), g = Q(!1), b = Q(null), [x, I] = S(), [w, A] = S(), [T, C] = S(), [O, V] = S(), [F, _] = S(200), $ = Q(), { height: R } = qn(), G = re(
5671
5671
  ln
5672
5672
  ), { processAction: W } = G || {}, j = re(
5673
5673
  lt
@@ -5688,10 +5688,10 @@ function Du(e, t) {
5688
5688
  setSearchTreeNameSearch: Y = void 0,
5689
5689
  setTreeIsLoading: me = void 0,
5690
5690
  searchValues: ve = {},
5691
- setSearchValues: $e = void 0,
5691
+ setSearchValues: ke = void 0,
5692
5692
  limit: Le = $t,
5693
5693
  setLimit: Ie = void 0
5694
- } = (f ? j : {}) || {}, Ee = B(
5694
+ } = (f ? j : {}) || {}, $e = B(
5695
5695
  (Be) => {
5696
5696
  H == null || H(Be.map((ze) => ({ id: ze }))), p == null || p(Be);
5697
5697
  },
@@ -5717,16 +5717,16 @@ function Du(e, t) {
5717
5717
  } = vs({
5718
5718
  model: x,
5719
5719
  setSearchTreeNameSearch: Y,
5720
- setSelectedRowItems: Ee,
5720
+ setSelectedRowItems: $e,
5721
5721
  setSearchParams: ee,
5722
- setSearchValues: $e,
5722
+ setSearchValues: ke,
5723
5723
  searchParams: ie,
5724
5724
  setSearchVisible: L,
5725
5725
  setTreeIsLoading: me,
5726
5726
  nameSearch: a,
5727
5727
  searchNameGetDoneRef: g,
5728
5728
  context: d,
5729
- formView: C,
5729
+ formView: T,
5730
5730
  treeView: w,
5731
5731
  sorter: E,
5732
5732
  setSorter: de,
@@ -5771,7 +5771,7 @@ function Du(e, t) {
5771
5771
  model: n,
5772
5772
  type: "tree",
5773
5773
  context: d
5774
- })), T(Be), O(ze);
5774
+ })), C(Be), A(ze);
5775
5775
  };
5776
5776
  ue(() => {
5777
5777
  ge();
@@ -5815,24 +5815,24 @@ function Du(e, t) {
5815
5815
  s({
5816
5816
  id: ze,
5817
5817
  model: x,
5818
- formView: C,
5818
+ formView: T,
5819
5819
  treeView: w
5820
5820
  });
5821
5821
  },
5822
- [x, C, s, De, w]
5823
- ), Pe = B(async () => {
5822
+ [x, T, s, De, w]
5823
+ ), Ee = B(async () => {
5824
5824
  const Be = await q();
5825
5825
  H == null || H(Be.map((ze) => ({ id: ze }))), p == null || p(Be);
5826
- }, [q, p, H]), Ye = ye(() => w != null && w.isExpandable ? R - 160 : R - (F + 240), [R, F, w == null ? void 0 : w.isExpandable]), ke = ye(
5826
+ }, [q, p, H]), Ye = ye(() => w != null && w.isExpandable ? R - 160 : R - (F + 240), [R, F, w == null ? void 0 : w.isExpandable]), Pe = ye(
5827
5827
  () => oe == null ? void 0 : oe.map((Be) => Be.id),
5828
5828
  [oe]
5829
- ), ot = B(() => !w || !C ? null : /* @__PURE__ */ D(ae, { children: [
5829
+ ), ot = B(() => !w || !T ? null : /* @__PURE__ */ D(ae, { children: [
5830
5830
  /* @__PURE__ */ i(
5831
5831
  ms,
5832
5832
  {
5833
- fields: { ...C.fields, ...w.fields },
5833
+ fields: { ...T.fields, ...w.fields },
5834
5834
  searchFields: ro([
5835
- C.search_fields,
5835
+ T.search_fields,
5836
5836
  w.search_fields
5837
5837
  ]),
5838
5838
  onClear: Fe,
@@ -5863,24 +5863,24 @@ function Du(e, t) {
5863
5863
  scrollY: l || Ye,
5864
5864
  colorsForResults: qe,
5865
5865
  statusForResults: pe,
5866
- selectedRowKeys: ke,
5867
- onRowSelectionChange: Ee,
5866
+ selectedRowKeys: Pe,
5867
+ onRowSelectionChange: $e,
5868
5868
  sorter: E,
5869
5869
  onChangeSort: ne,
5870
5870
  onFetchChildrenForRecord: w.isExpandable ? Oe : void 0,
5871
5871
  childField: w.field_parent,
5872
5872
  rootTree: f,
5873
- onSelectAllRecords: Pe
5873
+ onSelectAllRecords: Ee
5874
5874
  }
5875
5875
  )
5876
5876
  ] }), [
5877
5877
  Ye,
5878
- Ee,
5878
+ $e,
5879
5879
  ne,
5880
5880
  Fe,
5881
5881
  qe,
5882
5882
  Oe,
5883
- C,
5883
+ T,
5884
5884
  Ue,
5885
5885
  Le,
5886
5886
  Ce,
@@ -5895,8 +5895,8 @@ function Du(e, t) {
5895
5895
  we,
5896
5896
  ve,
5897
5897
  N,
5898
+ Ee,
5898
5899
  Pe,
5899
- ke,
5900
5900
  E,
5901
5901
  pe,
5902
5902
  Ke,
@@ -5904,7 +5904,7 @@ function Du(e, t) {
5904
5904
  rt,
5905
5905
  l,
5906
5906
  w
5907
- ]), bt = A || _e;
5907
+ ]), bt = O || _e;
5908
5908
  return bt ? /* @__PURE__ */ i(nt, { className: "mt-10", message: bt, type: "error", banner: !0 }) : /* @__PURE__ */ i("div", { style: u ? {} : { display: "none" }, children: h ? /* @__PURE__ */ i(We, {}) : ot() });
5909
5909
  }
5910
5910
  const ws = pt(Du), { error: Eu } = at, Nt = (e) => {
@@ -5941,21 +5941,21 @@ const ws = pt(Du), { error: Eu } = at, Nt = (e) => {
5941
5941
  domain: a,
5942
5942
  context: l = {}
5943
5943
  } = e, [c, u] = S(!1), { modalWidth: f, modalHeight: d } = qn(), { t: p } = he(), [h, m] = S([]), [y, v] = S(!1), g = B(
5944
- async (O) => {
5944
+ async (A) => {
5945
5945
  v(!0);
5946
5946
  try {
5947
- await r(O);
5948
- } catch (C) {
5949
- Nt(C);
5947
+ await r(A);
5948
+ } catch (T) {
5949
+ Nt(T);
5950
5950
  }
5951
5951
  v(!1);
5952
5952
  },
5953
5953
  [r]
5954
5954
  ), b = async () => {
5955
- await new Promise((O) => setTimeout(O, 5)), n();
5956
- }, x = async (O) => {
5957
- const { id: C } = O;
5958
- g([C]);
5955
+ await new Promise((A) => setTimeout(A, 5)), n();
5956
+ }, x = async (A) => {
5957
+ const { id: T } = A;
5958
+ g([T]);
5959
5959
  };
5960
5960
  function I() {
5961
5961
  if (h.length === 0) {
@@ -6027,8 +6027,8 @@ const ws = pt(Du), { error: Eu } = at, Nt = (e) => {
6027
6027
  model: o,
6028
6028
  visible: c,
6029
6029
  parentContext: l,
6030
- onSubmitSucceed: (O) => {
6031
- u(!1), b(), g([O]);
6030
+ onSubmitSucceed: (A) => {
6031
+ u(!1), b(), g([A]);
6032
6032
  },
6033
6033
  onCancel: () => {
6034
6034
  u(!1), b();
@@ -6054,16 +6054,16 @@ const ws = pt(Du), { error: Eu } = at, Nt = (e) => {
6054
6054
  context: l,
6055
6055
  id: c,
6056
6056
  domain: u
6057
- } = r, f = o && !a ? { backgroundColor: Ss.colorPrimaryBg } : void 0, [d, p] = S(!1), [h, m] = S(!1), [y, v] = S(!1), [g, b] = S(), x = Q(!1), [I, w] = S(""), O = Q(), C = re(He), { domain: T, getValues: A, getFields: V, getContext: F, elementHasLostFocus: _ } = C || {}, $ = Q([]), [R, G] = S([]), W = t && t[0] || void 0, j = t && t[1] || "";
6057
+ } = r, f = o && !a ? { backgroundColor: Ss.colorPrimaryBg } : void 0, [d, p] = S(!1), [h, m] = S(!1), [y, v] = S(!1), [g, b] = S(), x = Q(!1), [I, w] = S(""), A = Q(), T = re(He), { domain: C, getValues: O, getFields: V, getContext: F, elementHasLostFocus: _ } = T || {}, $ = Q([]), [R, G] = S([]), W = t && t[0] || void 0, j = t && t[1] || "";
6058
6058
  ue(() => {
6059
6059
  !Array.isArray(t) && t && oe(t);
6060
6060
  }, [t]), ue(() => {
6061
- W && j.length === 0 ? oe(W) : W && j.length > 0 ? w(j) : !W && !j && w(O.current || "");
6061
+ W && j.length === 0 ? oe(W) : W && j.length > 0 ? w(j) : !W && !j && w(A.current || "");
6062
6062
  }, [t]);
6063
6063
  const M = (N) => {
6064
6064
  n == null || n(N), _ == null || _();
6065
6065
  }, k = (N) => {
6066
- O.current = N.target.value, M([void 0, ""]);
6066
+ A.current = N.target.value, M([void 0, ""]);
6067
6067
  }, X = async () => {
6068
6068
  if (!y && I !== j) {
6069
6069
  if (await new Promise((N) => setTimeout(N, 100)), x.current) {
@@ -6073,14 +6073,14 @@ const ws = pt(Du), { error: Eu } = at, Nt = (e) => {
6073
6073
  v(!0);
6074
6074
  try {
6075
6075
  if ($.current && $.current.length > 0)
6076
- te(O.current);
6076
+ te(A.current);
6077
6077
  else {
6078
6078
  const N = await P.getHandler().nameSearch({
6079
6079
  model: s,
6080
- payload: O.current,
6080
+ payload: A.current,
6081
6081
  context: { ...F == null ? void 0 : F(), ...l }
6082
6082
  });
6083
- N.length === 1 ? (O.current = void 0, M(N[0])) : te(O.current);
6083
+ N.length === 1 ? (A.current = void 0, M(N[0])) : te(A.current);
6084
6084
  }
6085
6085
  } catch (N) {
6086
6086
  Nt(N);
@@ -6121,13 +6121,13 @@ const ws = pt(Du), { error: Eu } = at, Nt = (e) => {
6121
6121
  domain: u,
6122
6122
  values: Lt({
6123
6123
  fields: V(),
6124
- values: A()
6124
+ values: O()
6125
6125
  }),
6126
6126
  fields: V(),
6127
6127
  context: F()
6128
- })), T && T.length > 0 && ($.current = $.current.concat(
6128
+ })), C && C.length > 0 && ($.current = $.current.concat(
6129
6129
  Br({
6130
- domain: T,
6130
+ domain: C,
6131
6131
  widgetFieldName: c
6132
6132
  })
6133
6133
  )), G($.current);
@@ -6193,7 +6193,7 @@ const ws = pt(Du), { error: Eu } = at, Nt = (e) => {
6193
6193
  visible: d,
6194
6194
  nameSearch: W ? void 0 : g,
6195
6195
  onSelectValues: async (N) => {
6196
- p(!1), oe(N[0]), x.current = !1, O.current = void 0;
6196
+ p(!1), oe(N[0]), x.current = !1, A.current = void 0;
6197
6197
  },
6198
6198
  onCloseModal: () => {
6199
6199
  p(!1), x.current = !1;
@@ -6379,10 +6379,10 @@ const ws = pt(Du), { error: Eu } = at, Nt = (e) => {
6379
6379
  );
6380
6380
  }
6381
6381
  function I() {
6382
- let O = "_";
6383
- return l === 0 ? O = "_" : O = (c + 1).toString(), /* @__PURE__ */ D("span", { className: "pl-1 pr-1", children: [
6382
+ let A = "_";
6383
+ return l === 0 ? A = "_" : A = (c + 1).toString(), /* @__PURE__ */ D("span", { className: "pl-1 pr-1", children: [
6384
6384
  "(",
6385
- O,
6385
+ A,
6386
6386
  "/",
6387
6387
  l,
6388
6388
  ")"
@@ -6471,7 +6471,7 @@ const Uu = (e) => {
6471
6471
  getContext: m,
6472
6472
  domain: y,
6473
6473
  fetchValues: v
6474
- } = f || {}, { t: g } = he(), [b, x] = S(!1), [I, w] = S(!1), [O, C] = S(), [T, A] = S(!1), [V, F] = S(!1), [_, $] = S(), [R, G] = S([]), [W, j] = S(!1), M = Q([]), [k, X] = S(), te = Q(), [oe, H] = S(void 0), {
6474
+ } = f || {}, { t: g } = he(), [b, x] = S(!1), [I, w] = S(!1), [A, T] = S(), [C, O] = S(!1), [V, F] = S(!1), [_, $] = S(), [R, G] = S([]), [W, j] = S(!1), M = Q([]), [k, X] = S(), te = Q(), [oe, H] = S(void 0), {
6475
6475
  readOnly: ie,
6476
6476
  relation: ee,
6477
6477
  context: N,
@@ -6487,7 +6487,7 @@ const Uu = (e) => {
6487
6487
  me();
6488
6488
  }, [s, a]);
6489
6489
  const me = B(() => {
6490
- (a === "form" && s.some((q) => !q.values) || a === "tree" && s.some((q) => !q.treeValues)) && $e();
6490
+ (a === "form" && s.some((q) => !q.values) || a === "tree" && s.some((q) => !q.treeValues)) && ke();
6491
6491
  }, [s, a]);
6492
6492
  ue(() => {
6493
6493
  Ie();
@@ -6498,11 +6498,11 @@ const Uu = (e) => {
6498
6498
  fields: ((ge = o.get("form")) == null ? void 0 : ge.fields) || ((Ae = o.get("tree")) == null ? void 0 : Ae.fields),
6499
6499
  items: Hu(q)
6500
6500
  });
6501
- }, $e = async () => {
6501
+ }, ke = async () => {
6502
6502
  await Le(), c > z.length - 1 && c !== 0 && u(0);
6503
6503
  }, Le = async (q) => {
6504
6504
  var ge, Ae, xe;
6505
- w(!0), x(!1), C(void 0);
6505
+ w(!0), x(!1), T(void 0);
6506
6506
  try {
6507
6507
  const [De, Z] = await eo({
6508
6508
  treeView: {
@@ -6517,9 +6517,9 @@ const Uu = (e) => {
6517
6517
  context: { ...m == null ? void 0 : m(), ...N },
6518
6518
  currentView: q || a
6519
6519
  });
6520
- return te.current || (te.current = De.map((Pe) => Pe.id)), (a || q) === "tree" && Z && H(Z), ve(De), De;
6520
+ return te.current || (te.current = De.map((Ee) => Ee.id)), (a || q) === "tree" && Z && H(Z), ve(De), De;
6521
6521
  } catch (De) {
6522
- C(De);
6522
+ T(De);
6523
6523
  } finally {
6524
6524
  w(!1);
6525
6525
  }
@@ -6540,7 +6540,7 @@ const Uu = (e) => {
6540
6540
  })
6541
6541
  ));
6542
6542
  }
6543
- const Ee = () => {
6543
+ const $e = () => {
6544
6544
  const q = Array.from(o.keys()), ge = q[(q.indexOf(a) + 1) % q.length];
6545
6545
  a === "form" ? fe(() => {
6546
6546
  l(ge);
@@ -6599,14 +6599,14 @@ const Uu = (e) => {
6599
6599
  const { inv_field: q } = r;
6600
6600
  let ge;
6601
6601
  q && d && (ge = { [q]: d }), a === "form" ? fe(() => {
6602
- j(!0), $({ defaultValues: ge }), A(!0);
6603
- }) : (j(!0), $({ defaultValues: ge }), A(!0));
6602
+ j(!0), $({ defaultValues: ge }), O(!0);
6603
+ }) : (j(!0), $({ defaultValues: ge }), O(!0));
6604
6604
  }, J = async () => {
6605
6605
  a === "form" ? fe(() => {
6606
6606
  F(!0);
6607
6607
  }) : F(!0);
6608
6608
  }, Ce = async () => {
6609
- w(!0), x(!1), C(void 0);
6609
+ w(!0), x(!1), T(void 0);
6610
6610
  try {
6611
6611
  if (z[c].id > 0) {
6612
6612
  const q = s.map((ge) => ge.id === z[c].id ? {
@@ -6619,12 +6619,12 @@ const Uu = (e) => {
6619
6619
  s.filter((q) => q.id !== z[c].id)
6620
6620
  );
6621
6621
  } catch (q) {
6622
- C(q);
6622
+ T(q);
6623
6623
  }
6624
6624
  u(0), w(!1);
6625
6625
  }, Se = async () => {
6626
6626
  const q = z.filter((ge) => R.includes(ge.id));
6627
- w(!0), x(!1), C(void 0);
6627
+ w(!0), x(!1), T(void 0);
6628
6628
  try {
6629
6629
  const ge = q.map((xe) => xe.id), Ae = s.filter((xe) => !(ge.includes(xe.id) && xe.id < 0)).map((xe) => ge.includes(xe.id) ? {
6630
6630
  ...xe,
@@ -6632,7 +6632,7 @@ const Uu = (e) => {
6632
6632
  } : xe);
6633
6633
  ve(Ae);
6634
6634
  } catch (ge) {
6635
- C(ge);
6635
+ T(ge);
6636
6636
  }
6637
6637
  u(0), w(!1);
6638
6638
  }, Ue = (q, ge, Ae, xe = !1) => {
@@ -6660,12 +6660,12 @@ const Uu = (e) => {
6660
6660
  treeValues: { ...Ae, id: Z }
6661
6661
  });
6662
6662
  }
6663
- ve(De), W || A(!1);
6663
+ ve(De), W || O(!1);
6664
6664
  }, Me = async (q) => {
6665
6665
  const { id: ge } = q;
6666
6666
  let Ae = s;
6667
6667
  const xe = s.find((De) => De.id === ge);
6668
- (xe == null ? void 0 : xe.values) === void 0 && (Ae = await Le("form")), $(Ae.find((De) => De.id === ge)), j(!1), A(!0);
6668
+ (xe == null ? void 0 : xe.values) === void 0 && (Ae = await Le("form")), $(Ae.find((De) => De.id === ge)), j(!1), O(!0);
6669
6669
  }, ne = async (q) => {
6670
6670
  w(!0);
6671
6671
  const ge = s, Ae = q.filter((xe) => !s.find((De) => De.id === xe));
@@ -6691,7 +6691,7 @@ const Uu = (e) => {
6691
6691
  }
6692
6692
  ve(ge);
6693
6693
  } catch (xe) {
6694
- C(xe);
6694
+ T(xe);
6695
6695
  } finally {
6696
6696
  w(!1);
6697
6697
  }
@@ -6718,12 +6718,12 @@ const Uu = (e) => {
6718
6718
  id: (Ae = z[c]) == null ? void 0 : Ae.id,
6719
6719
  submitMode: "values",
6720
6720
  onFieldsChange: (Z) => {
6721
- var ke;
6722
- const Pe = (ke = z[c]) == null ? void 0 : ke.id, Ye = s.map((ot) => ot.id === Pe ? {
6721
+ var Pe;
6722
+ const Ee = (Pe = z[c]) == null ? void 0 : Pe.id, Ye = s.map((ot) => ot.id === Ee ? {
6723
6723
  ...ot,
6724
6724
  operation: ot.operation === "original" ? "pendingUpdate" : ot.operation,
6725
- values: { ...Z, id: Pe },
6726
- treeValues: { ...Z, id: Pe }
6725
+ values: { ...Z, id: Ee },
6726
+ treeValues: { ...Z, id: Ee }
6727
6727
  } : ot);
6728
6728
  ve(Ye), x(!0);
6729
6729
  },
@@ -6773,8 +6773,8 @@ const Uu = (e) => {
6773
6773
  );
6774
6774
  }
6775
6775
  };
6776
- if (O)
6777
- return /* @__PURE__ */ i(nt, { className: "mt-10", message: O, type: "error", banner: !0 });
6776
+ if (A)
6777
+ return /* @__PURE__ */ i(nt, { className: "mt-10", message: A, type: "error", banner: !0 });
6778
6778
  const pe = W;
6779
6779
  return I ? /* @__PURE__ */ i(We, {}) : /* @__PURE__ */ D(ae, { children: [
6780
6780
  /* @__PURE__ */ i(
@@ -6789,7 +6789,7 @@ const Uu = (e) => {
6789
6789
  currentItemIndex: c,
6790
6790
  onDelete: we,
6791
6791
  onCreateItem: _e,
6792
- onToggleViewMode: Ee,
6792
+ onToggleViewMode: $e,
6793
6793
  onPreviousItem: Ke,
6794
6794
  onNextItem: Fe,
6795
6795
  onSearchItem: J,
@@ -6808,11 +6808,11 @@ const Uu = (e) => {
6808
6808
  submitMode: "2many",
6809
6809
  values: _ == null ? void 0 : _.values,
6810
6810
  defaultValues: _ == null ? void 0 : _.defaultValues,
6811
- visible: T,
6811
+ visible: C,
6812
6812
  onSubmitSucceed: Ue,
6813
6813
  parentContext: { ...m == null ? void 0 : m(), ...N },
6814
6814
  onCancel: () => {
6815
- j(!1), A(!1);
6815
+ j(!1), O(!1);
6816
6816
  },
6817
6817
  readOnly: ie,
6818
6818
  mustClearAfterSave: pe,
@@ -6891,9 +6891,9 @@ const Uu = (e) => {
6891
6891
  d.colors && (y.colors = d.colors), d.status && (y.status = d.status);
6892
6892
  let v = h;
6893
6893
  if (m) {
6894
- const w = Object.keys(m).map((O) => {
6895
- const C = m[O];
6896
- return `${O} ${C}`;
6894
+ const w = Object.keys(m).map((A) => {
6895
+ const T = m[A];
6896
+ return `${A} ${T}`;
6897
6897
  }).join(", ");
6898
6898
  v = await P.getHandler().searchAllIds({
6899
6899
  model: t,
@@ -7111,45 +7111,45 @@ const Xu = ({
7111
7111
  }, [n, e, t, r]), b = B(() => {
7112
7112
  p(!1), v(!1);
7113
7113
  }, []), x = ft(
7114
- (w, O, C, T = !1) => {
7115
- let A;
7116
- if (T)
7117
- A = o.concat({
7114
+ (w, A, T, C = !1) => {
7115
+ let O;
7116
+ if (C)
7117
+ O = o.concat({
7118
7118
  id: w,
7119
7119
  operation: "pendingLink",
7120
- values: { ...C, id: w },
7121
- treeValues: { ...C, id: w }
7120
+ values: { ...T, id: w },
7121
+ treeValues: { ...T, id: w }
7122
7122
  });
7123
7123
  else if (w)
7124
- A = o.map((V) => V.id === w ? {
7124
+ O = o.map((V) => V.id === w ? {
7125
7125
  id: w,
7126
7126
  operation: w > 0 ? "pendingUpdate" : "pendingCreate",
7127
- values: { ...C, id: w },
7128
- treeValues: { ...C, id: w }
7127
+ values: { ...T, id: w },
7128
+ treeValues: { ...T, id: w }
7129
7129
  } : V);
7130
7130
  else {
7131
7131
  const V = Qi(o);
7132
- A = o.concat({
7132
+ O = o.concat({
7133
7133
  id: V,
7134
7134
  operation: "pendingCreate",
7135
- values: { ...C, id: V },
7136
- treeValues: { ...C, id: V }
7135
+ values: { ...T, id: V },
7136
+ treeValues: { ...T, id: V }
7137
7137
  });
7138
7138
  }
7139
- s(A), y || p(!1);
7139
+ s(O), y || p(!1);
7140
7140
  },
7141
7141
  [y, o, s]
7142
7142
  ), I = ft(
7143
7143
  async (w) => {
7144
- const { id: O } = w;
7145
- let C = o;
7146
- const T = o.find((A) => A.id === O);
7147
- (T == null ? void 0 : T.values) === void 0 && (C = await P.getHandler().readObjects({
7144
+ const { id: A } = w;
7145
+ let T = o;
7146
+ const C = o.find((O) => O.id === A);
7147
+ (C == null ? void 0 : C.values) === void 0 && (T = await P.getHandler().readObjects({
7148
7148
  model: c,
7149
7149
  ids: [w.id],
7150
7150
  fields: u.fields,
7151
7151
  context: f
7152
- })), m(C.find((A) => A.id === O)), v(!1), p(!0);
7152
+ })), m(T.find((O) => O.id === A)), v(!1), p(!0);
7153
7153
  },
7154
7154
  [f, u.fields, o, c, a, l]
7155
7155
  );
@@ -7360,7 +7360,7 @@ const Xu = ({
7360
7360
  aggregates: m,
7361
7361
  selectedRowKeys: y = []
7362
7362
  }) => {
7363
- const v = Q(), g = c || v, b = Q({}), x = Q(), I = Q(), w = Q(e), { t: O } = he();
7363
+ const v = Q(), g = c || v, b = Q({}), x = Q(), I = Q(), w = Q(e), { t: A } = he();
7364
7364
  yt(() => {
7365
7365
  var R, G;
7366
7366
  if (w.current = e, I.current === void 0) {
@@ -7369,13 +7369,13 @@ const Xu = ({
7369
7369
  }
7370
7370
  I.current = e, (R = g == null ? void 0 : g.current) == null || R.refresh(), (G = g == null ? void 0 : g.current) == null || G.unselectAll();
7371
7371
  }, [e]);
7372
- const C = yn(() => e.length, [e]), T = yn(() => Zr(
7372
+ const T = yn(() => e.length, [e]), C = yn(() => Zr(
7373
7373
  o,
7374
7374
  {
7375
7375
  ...ao
7376
7376
  },
7377
7377
  s
7378
- ), [s, o]), A = B(
7378
+ ), [s, o]), O = B(
7379
7379
  async ({
7380
7380
  startRow: R,
7381
7381
  endRow: G,
@@ -7420,8 +7420,8 @@ const Xu = ({
7420
7420
  {
7421
7421
  ref: g,
7422
7422
  height: t || rf,
7423
- columns: T,
7424
- onRequestData: A,
7423
+ columns: C,
7424
+ onRequestData: O,
7425
7425
  onRowDoubleClick: n,
7426
7426
  readonly: r,
7427
7427
  onRowStyle: V,
@@ -7432,7 +7432,7 @@ const Xu = ({
7432
7432
  onGetFirstVisibleRowIndex: d,
7433
7433
  selectedRowKeys: y,
7434
7434
  onSelectionCheckboxClicked: p,
7435
- totalRows: C,
7435
+ totalRows: T,
7436
7436
  footer: m && /* @__PURE__ */ i(As, { aggregates: m, isLoading: !1 }),
7437
7437
  hasStatusColumn: o.status !== null,
7438
7438
  statusComponent: (R) => /* @__PURE__ */ i(Lr, { color: R, style: { marginLeft: 7 } }),
@@ -7441,7 +7441,7 @@ const Xu = ({
7441
7441
  return (G = x.current) == null ? void 0 : G[R.id];
7442
7442
  },
7443
7443
  strings: {
7444
- resetTableViewLabel: O("resetTableView")
7444
+ resetTableViewLabel: A("resetTableView")
7445
7445
  }
7446
7446
  }
7447
7447
  );
@@ -7549,11 +7549,11 @@ const Xu = ({
7549
7549
  activeId: b,
7550
7550
  getContext: x,
7551
7551
  fetchValues: I
7552
- } = g || {}, w = s.size > 1, O = ((ce = s.get("form")) == null ? void 0 : ce.fields) !== void 0, C = ye(() => ({ ...x == null ? void 0 : x(), ...m }), [x, m]), T = Wu({
7552
+ } = g || {}, w = s.size > 1, A = ((ce = s.get("form")) == null ? void 0 : ce.fields) !== void 0, T = ye(() => ({ ...x == null ? void 0 : x(), ...m }), [x, m]), C = Wu({
7553
7553
  widgetDomain: y,
7554
7554
  fieldName: v
7555
7555
  }), {
7556
- treeOoui: A,
7556
+ treeOoui: O,
7557
7557
  onTreeFetchRows: V,
7558
7558
  selectedRowKeys: F,
7559
7559
  setSelectedRowKeys: _,
@@ -7563,11 +7563,11 @@ const Xu = ({
7563
7563
  } = Gu({
7564
7564
  treeView: s.get("tree"),
7565
7565
  relation: h,
7566
- context: C,
7566
+ context: T,
7567
7567
  allRowsIds: l.filter((fe) => fe.id !== void 0).map((fe) => fe.id),
7568
7568
  gridRef: t
7569
7569
  }), [, W] = sf({
7570
- ooui: A,
7570
+ ooui: O,
7571
7571
  model: h,
7572
7572
  items: l,
7573
7573
  selectedRowKeys: F
@@ -7593,7 +7593,7 @@ const Xu = ({
7593
7593
  formView: s.get("form"),
7594
7594
  treeView: s.get("tree"),
7595
7595
  relation: h,
7596
- context: C,
7596
+ context: T,
7597
7597
  triggerChange: k
7598
7598
  }), {
7599
7599
  showFormModal: ie,
@@ -7612,21 +7612,21 @@ const Xu = ({
7612
7612
  items: l,
7613
7613
  setCurrentView: u,
7614
7614
  setItemIndex: d,
7615
- context: C,
7615
+ context: T,
7616
7616
  relation: h,
7617
7617
  formView: s.get("form")
7618
7618
  }), {
7619
7619
  showSearchModal: Y,
7620
7620
  onSelectSearchValues: me,
7621
7621
  onCloseSearchModal: ve,
7622
- searchItem: $e
7622
+ searchItem: ke
7623
7623
  } = Qu({
7624
7624
  showFormChangesDialogIfNeeded: oe,
7625
7625
  currentView: c,
7626
7626
  triggerChange: k,
7627
7627
  items: l,
7628
7628
  views: s,
7629
- context: C,
7629
+ context: T,
7630
7630
  relation: h
7631
7631
  }), { showRemoveConfirm: Le } = zu({
7632
7632
  isMany2many: M,
@@ -7640,7 +7640,7 @@ const Xu = ({
7640
7640
  c === "form" ? oe(() => {
7641
7641
  u(we);
7642
7642
  }) : u(we);
7643
- }, Ee = ft(
7643
+ }, $e = ft(
7644
7644
  (fe) => {
7645
7645
  var we;
7646
7646
  (we = s.get("form")) != null && we.fields && z(fe);
@@ -7679,9 +7679,9 @@ const Xu = ({
7679
7679
  onToggleViewMode: Ie,
7680
7680
  onPreviousItem: Ke,
7681
7681
  onNextItem: Fe,
7682
- onSearchItem: $e,
7682
+ onSearchItem: ke,
7683
7683
  selectedRowKeys: F,
7684
- showCreateButton: O,
7684
+ showCreateButton: A,
7685
7685
  showToggleButton: w
7686
7686
  }
7687
7687
  ),
@@ -7693,9 +7693,9 @@ const Xu = ({
7693
7693
  items: l,
7694
7694
  readOnly: p || !1,
7695
7695
  onFetchRecords: V,
7696
- ooui: A,
7697
- context: C,
7698
- onRowDoubleClick: Ee,
7696
+ ooui: O,
7697
+ context: T,
7698
+ onRowDoubleClick: $e,
7699
7699
  onRowSelectionChange: _,
7700
7700
  relation: h,
7701
7701
  onChangeFirstVisibleRowIndex: $,
@@ -7715,7 +7715,7 @@ const Xu = ({
7715
7715
  {
7716
7716
  items: l,
7717
7717
  formView: s.get("form"),
7718
- context: C,
7718
+ context: T,
7719
7719
  relation: h,
7720
7720
  readOnly: p || !1,
7721
7721
  onChange: te
@@ -7732,7 +7732,7 @@ const Xu = ({
7732
7732
  defaultValues: ee == null ? void 0 : ee.defaultValues,
7733
7733
  visible: ie,
7734
7734
  onSubmitSucceed: E,
7735
- parentContext: C,
7735
+ parentContext: T,
7736
7736
  onCancel: L,
7737
7737
  readOnly: p,
7738
7738
  mustClearAfterSave: N,
@@ -7744,9 +7744,9 @@ const Xu = ({
7744
7744
  /* @__PURE__ */ i(
7745
7745
  lo,
7746
7746
  {
7747
- domain: T,
7747
+ domain: C,
7748
7748
  model: h,
7749
- context: C,
7749
+ context: T,
7750
7750
  visible: Y,
7751
7751
  onSelectValues: me,
7752
7752
  onCloseModal: ve
@@ -7758,7 +7758,7 @@ const Xu = ({
7758
7758
  view_id: s.get("graph").view_id,
7759
7759
  model: h,
7760
7760
  domain: [[`${o.inv_field}`, "=", b]],
7761
- context: C,
7761
+ context: T,
7762
7762
  limit: 0
7763
7763
  }
7764
7764
  ),
@@ -7775,25 +7775,25 @@ const Xu = ({
7775
7775
  yt(() => {
7776
7776
  x();
7777
7777
  }, [t]);
7778
- const b = async (O) => o && o[O] ? o[O] : await P.getHandler().getView({
7778
+ const b = async (A) => o && o[A] ? o[A] : await P.getHandler().getView({
7779
7779
  model: r,
7780
- type: O,
7780
+ type: A,
7781
7781
  context: { ...y == null ? void 0 : y(), ...a }
7782
7782
  }), x = async () => {
7783
7783
  u(!0), d(void 0);
7784
7784
  try {
7785
7785
  if (n && n.length > 0) {
7786
- for (const O of n) {
7787
- const C = await b(O);
7788
- p.set(O, C);
7786
+ for (const A of n) {
7787
+ const T = await b(A);
7788
+ p.set(A, T);
7789
7789
  }
7790
7790
  h(p);
7791
7791
  } else {
7792
- const O = await b("form"), C = await b("tree");
7793
- p.set("form", O), p.set("tree", C), h(p);
7792
+ const A = await b("form"), T = await b("tree");
7793
+ p.set("form", A), p.set("tree", T), h(p);
7794
7794
  }
7795
- } catch (O) {
7796
- d(JSON.stringify(O));
7795
+ } catch (A) {
7796
+ d(JSON.stringify(A));
7797
7797
  } finally {
7798
7798
  u(!1);
7799
7799
  }
@@ -7803,14 +7803,14 @@ const Xu = ({
7803
7803
  {
7804
7804
  required: s,
7805
7805
  type: "array",
7806
- validator: async (O, C) => {
7807
- if (!C)
7806
+ validator: async (A, T) => {
7807
+ if (!T)
7808
7808
  throw new Error();
7809
- if (!C.items)
7809
+ if (!T.items)
7810
7810
  throw new Error();
7811
- if (!Array.isArray(C.items))
7811
+ if (!Array.isArray(T.items))
7812
7812
  throw new Error();
7813
- if (C.items.length === 0)
7813
+ if (T.items.length === 0)
7814
7814
  throw new Error();
7815
7815
  },
7816
7816
  ...e,
@@ -8071,10 +8071,10 @@ const { useToken: yf } = Ge, { TextArea: Tr } = ct, vf = (e) => {
8071
8071
  context: t,
8072
8072
  fields: []
8073
8073
  });
8074
- for (const [w, O] of Object.entries(I))
8074
+ for (const [w, A] of Object.entries(I))
8075
8075
  I[w].string = Cf({
8076
8076
  parentTitle: b.string,
8077
- title: O.string
8077
+ title: A.string
8078
8078
  });
8079
8079
  return a.current[v] = I, Go({
8080
8080
  fields: I,
@@ -8092,10 +8092,10 @@ const { useToken: yf } = Ge, { TextArea: Tr } = ct, vf = (e) => {
8092
8092
  predefinedExports: v.map((x) => ({
8093
8093
  ...x,
8094
8094
  fields: x.fields.map((I) => {
8095
- const w = Or(I.key), C = Ar(I.key, a.current)[w];
8096
- return C ? {
8095
+ const w = Or(I.key), T = Ar(I.key, a.current)[w];
8096
+ return T ? {
8097
8097
  key: I.key,
8098
- title: C.string
8098
+ title: T.string
8099
8099
  } : {
8100
8100
  key: I.key
8101
8101
  };
@@ -8374,8 +8374,8 @@ const { useToken: yf } = Ge, { TextArea: Tr } = ct, vf = (e) => {
8374
8374
  r == null || r(x);
8375
8375
  };
8376
8376
  async function y() {
8377
- const x = await Xt(n), I = `data:${x == null ? void 0 : x.mime};base64,${n}`, w = document.createElement("a"), O = d(a), C = d("name");
8378
- w.href = I, w.download = O || C, w.click();
8377
+ const x = await Xt(n), I = `data:${x == null ? void 0 : x.mime};base64,${n}`, w = document.createElement("a"), A = d(a), T = d("name");
8378
+ w.href = I, w.download = A || T, w.click();
8379
8379
  }
8380
8380
  async function v() {
8381
8381
  const x = await Xt(n);
@@ -8815,17 +8815,17 @@ const Bf = () => {
8815
8815
  async (v) => {
8816
8816
  var g;
8817
8817
  try {
8818
- const { params: b, model: x, name_search: I, context: w, order: O } = a, { results: C } = await l({
8818
+ const { params: b, model: x, name_search: I, context: w, order: A } = a, { results: T } = await l({
8819
8819
  params: b,
8820
8820
  model: x,
8821
8821
  context: w,
8822
8822
  limit: 1,
8823
8823
  offset: v,
8824
- order: O,
8824
+ order: A,
8825
8825
  name_search: I,
8826
8826
  skipRead: !0
8827
8827
  });
8828
- return (g = C[0]) == null ? void 0 : g.id;
8828
+ return (g = T[0]) == null ? void 0 : g.id;
8829
8829
  } catch (b) {
8830
8830
  u(b);
8831
8831
  }
@@ -8838,21 +8838,26 @@ const Bf = () => {
8838
8838
  [o, r]
8839
8839
  ), p = B(
8840
8840
  async (v) => {
8841
- var w;
8841
+ var w, A;
8842
8842
  if (!s)
8843
8843
  return;
8844
8844
  const g = v === "next", b = g ? n + 1 : n - 1, x = g ? b < t : b >= 0, I = g ? b === t : b === -1;
8845
8845
  if (x) {
8846
- const O = (w = s[b]) == null ? void 0 : w.id;
8847
- if (O)
8848
- d(b, O);
8846
+ const T = (w = s[b]) == null ? void 0 : w.id;
8847
+ if (T)
8848
+ d(b, T);
8849
8849
  else {
8850
8850
  const C = await f(b);
8851
8851
  C && d(b, C);
8852
8852
  }
8853
8853
  } else if (I) {
8854
- const O = g ? 0 : t - 1, C = await f(O);
8855
- C && d(O, C);
8854
+ const T = g ? 0 : t - 1, C = (A = s[T]) == null ? void 0 : A.id;
8855
+ if (C)
8856
+ d(T, C);
8857
+ else {
8858
+ const O = await f(T);
8859
+ O && d(T, O);
8860
+ }
8856
8861
  }
8857
8862
  },
8858
8863
  [s, n, t, f, d]
@@ -8896,16 +8901,16 @@ function Hf({ toolbar: e }) {
8896
8901
  removingItem: x,
8897
8902
  duplicatingItem: I,
8898
8903
  setDuplicatingItem: w,
8899
- setResults: O,
8900
- formIsLoading: C,
8901
- attachments: T,
8902
- formRef: A,
8904
+ setResults: A,
8905
+ formIsLoading: T,
8906
+ attachments: C,
8907
+ formRef: O,
8903
8908
  setFormHasChanges: V,
8904
8909
  previousView: F,
8905
8910
  setPreviousView: _,
8906
8911
  goToResourceId: $,
8907
8912
  isActive: R
8908
- } = no(!0), { processAction: G } = t || {}, { openRelate: W, openDefaultActionForModel: j } = n || {}, M = d || x || C || I, k = B(
8913
+ } = no(!0), { processAction: G } = t || {}, { openRelate: W, openDefaultActionForModel: j } = n || {}, M = d || x || T || I, k = B(
8909
8914
  (H) => {
8910
8915
  f ? an({ t: r, onOk: H }) : H();
8911
8916
  },
@@ -8915,12 +8920,12 @@ function Hf({ toolbar: e }) {
8915
8920
  b == null || b(!0), await P.getHandler().deleteObjects({
8916
8921
  model: g,
8917
8922
  ids: [p],
8918
- context: A.current.getContext()
8923
+ context: O.current.getContext()
8919
8924
  });
8920
8925
  const H = h == null ? void 0 : h.filter(
8921
8926
  (ee) => ee.id !== p
8922
8927
  );
8923
- O == null || O(H);
8928
+ A == null || A(H);
8924
8929
  const ie = Math.max(0, (y || 0) - 1);
8925
8930
  H != null && H[ie] ? (v == null || v(H[ie].id), m == null || m(ie)) : (v == null || v(void 0), m == null || m(void 0));
8926
8931
  } catch (H) {
@@ -8932,19 +8937,19 @@ function Hf({ toolbar: e }) {
8932
8937
  p,
8933
8938
  y,
8934
8939
  g,
8935
- A,
8940
+ O,
8936
8941
  h,
8937
8942
  v,
8938
8943
  m,
8939
8944
  b,
8940
- O
8945
+ A
8941
8946
  ]), te = B(async () => {
8942
8947
  try {
8943
8948
  w == null || w(!0);
8944
8949
  const H = await P.getHandler().duplicate({
8945
8950
  id: p,
8946
8951
  model: g,
8947
- context: A.current.getContext()
8952
+ context: O.current.getContext()
8948
8953
  });
8949
8954
  H && await ($ == null ? void 0 : $([H]));
8950
8955
  } catch (H) {
@@ -8952,17 +8957,17 @@ function Hf({ toolbar: e }) {
8952
8957
  } finally {
8953
8958
  w == null || w(!1);
8954
8959
  }
8955
- }, [p, g, A, $, w]), oe = B(
8960
+ }, [p, g, O, $, w]), oe = B(
8956
8961
  (H) => {
8957
8962
  G == null || G({
8958
8963
  actionData: H,
8959
- values: A.current.getValues(),
8960
- fields: A.current.getFields(),
8961
- context: A.current.getContext(),
8962
- onRefreshParentValues: () => A.current.fetchValues()
8964
+ values: O.current.getValues(),
8965
+ fields: O.current.getFields(),
8966
+ context: O.current.getContext(),
8967
+ onRefreshParentValues: () => O.current.fetchValues()
8963
8968
  });
8964
8969
  },
8965
- [A, G]
8970
+ [O, G]
8966
8971
  );
8967
8972
  return Dt(
8968
8973
  "pagedown",
@@ -8987,7 +8992,7 @@ function Hf({ toolbar: e }) {
8987
8992
  { enableOnFormTags: !0, preventDefault: !0 },
8988
8993
  [R, F, l, _, c]
8989
8994
  ), l ? /* @__PURE__ */ D(Xe, { wrap: !0, children: [
8990
- C && /* @__PURE__ */ D(ae, { children: [
8995
+ T && /* @__PURE__ */ D(ae, { children: [
8991
8996
  /* @__PURE__ */ i(We, {}),
8992
8997
  jt(),
8993
8998
  jt()
@@ -9047,7 +9052,7 @@ function Hf({ toolbar: e }) {
9047
9052
  icon: /* @__PURE__ */ i(Gn, {}),
9048
9053
  tooltip: r("refresh"),
9049
9054
  disabled: M || p === void 0,
9050
- onClick: () => k(() => A.current.fetchValues())
9055
+ onClick: () => k(() => O.current.fetchValues())
9051
9056
  }
9052
9057
  ),
9053
9058
  jt(),
@@ -9135,8 +9140,8 @@ function Hf({ toolbar: e }) {
9135
9140
  onItemClick: async (H) => {
9136
9141
  H && (await Bt({ onFormSave: u })).succeed && W({
9137
9142
  relateData: H,
9138
- values: A.current.getValues(),
9139
- fields: A.current.getFields(),
9143
+ values: O.current.getValues(),
9144
+ fields: O.current.getFields(),
9140
9145
  action_id: H.id,
9141
9146
  action_type: H.type
9142
9147
  });
@@ -9147,7 +9152,7 @@ function Hf({ toolbar: e }) {
9147
9152
  jf,
9148
9153
  {
9149
9154
  disabled: M,
9150
- attachments: T,
9155
+ attachments: C,
9151
9156
  onAddNewAttachment: async () => {
9152
9157
  const H = await Bt({ onFormSave: u });
9153
9158
  H.succeed && j({
@@ -9556,10 +9561,10 @@ const { useToken: zf } = Ge, { Title: Jf, Text: An } = Rt, Xn = ({
9556
9561
  setSorter: x = void 0,
9557
9562
  setTotalItems: I = void 0,
9558
9563
  setSearchTreeNameSearch: w = void 0,
9559
- setTreeIsLoading: O = void 0,
9560
- limit: C,
9561
- setLimit: T,
9562
- searchParams: A,
9564
+ setTreeIsLoading: A = void 0,
9565
+ limit: T,
9566
+ setLimit: C,
9567
+ searchParams: O,
9563
9568
  searchValues: V,
9564
9569
  setSearchValues: F,
9565
9570
  currentView: _
@@ -9567,18 +9572,18 @@ const { useToken: zf } = Ge, { Title: Jf, Text: An } = Rt, Xn = ({
9567
9572
  ue(() => {
9568
9573
  var X;
9569
9574
  (X = c.current) == null || X.refresh();
9570
- }, [A]), ue(() => {
9575
+ }, [O]), ue(() => {
9571
9576
  t.view_id !== _.view_id && R(!0);
9572
9577
  }, [_]);
9573
9578
  const { clear: G, searchFilterLoading: W, searchError: j, offset: M, tableRefreshing: k } = vs({
9574
9579
  model: r,
9575
9580
  setSearchTreeNameSearch: w,
9576
9581
  setSelectedRowItems: m,
9577
- searchParams: A,
9582
+ searchParams: O,
9578
9583
  setSearchValues: F,
9579
9584
  setSearchParams: y,
9580
9585
  setSearchVisible: g,
9581
- setTreeIsLoading: O,
9586
+ setTreeIsLoading: A,
9582
9587
  context: o,
9583
9588
  formView: a,
9584
9589
  treeView: l,
@@ -9590,8 +9595,8 @@ const { useToken: zf } = Ge, { Title: Jf, Text: An } = Rt, Xn = ({
9590
9595
  domain: s,
9591
9596
  currentId: p,
9592
9597
  setActionViewTotalItems: I,
9593
- limit: C,
9594
- setLimit: T
9598
+ limit: T,
9599
+ setLimit: C
9595
9600
  });
9596
9601
  return !n || !t ? null : /* @__PURE__ */ D(ae, { children: [
9597
9602
  /* @__PURE__ */ i(Xn, { title: t.title || t.name, children: /* @__PURE__ */ i(
@@ -9610,7 +9615,7 @@ const { useToken: zf } = Ge, { Title: Jf, Text: An } = Rt, Xn = ({
9610
9615
  a.search_fields,
9611
9616
  l.search_fields
9612
9617
  ]),
9613
- limit: C,
9618
+ limit: T,
9614
9619
  onClear: G,
9615
9620
  offset: M,
9616
9621
  isSearching: W,
@@ -9630,8 +9635,8 @@ const { useToken: zf } = Ge, { Title: Jf, Text: An } = Rt, Xn = ({
9630
9635
  view_id: t.view_id,
9631
9636
  model: r,
9632
9637
  context: o,
9633
- domain: Zt(A || [], s),
9634
- limit: $ ? C : void 0,
9638
+ domain: Zt(O || [], s),
9639
+ limit: $ ? T : void 0,
9635
9640
  manualIds: $ ? h == null ? void 0 : h.map((X) => X.id) : void 0
9636
9641
  }
9637
9642
  )
@@ -9737,10 +9742,10 @@ function em(e) {
9737
9742
  setPreviousView: x,
9738
9743
  previousView: I,
9739
9744
  results: w,
9740
- limit: O,
9741
- totalItems: C,
9742
- isActive: T,
9743
- isInfiniteTree: A
9745
+ limit: A,
9746
+ totalItems: T,
9747
+ isActive: C,
9748
+ isInfiniteTree: O
9744
9749
  } = re(lt), { parentContext: V = {}, treeExpandable: F, toolbar: _ } = e, $ = Jn(
9745
9750
  sn.FEATURE_ADVANCED_EXPORT
9746
9751
  ), { t: R } = he(), G = re(
@@ -9749,27 +9754,27 @@ function em(e) {
9749
9754
  Dt(
9750
9755
  "ctrl+l,command+l",
9751
9756
  () => {
9752
- T && I && (x == null || x(n), r == null || r(I));
9757
+ C && I && (x == null || x(n), r == null || r(I));
9753
9758
  },
9754
9759
  { enableOnFormTags: !0, preventDefault: !0 },
9755
- [I, n, T]
9760
+ [I, n, C]
9756
9761
  ), Dt(
9757
9762
  "ctrl+f,command+f",
9758
9763
  () => {
9759
- T && (y == null || y(!m));
9764
+ C && (y == null || y(!m));
9760
9765
  },
9761
9766
  { enableOnFormTags: !0, preventDefault: !0 },
9762
9767
  [m]
9763
9768
  ), ue(() => {
9764
9769
  var L;
9765
- if (A && g === void 0) {
9770
+ if (O && g === void 0) {
9766
9771
  if (k.current) {
9767
9772
  k.current = !1;
9768
9773
  return;
9769
9774
  }
9770
9775
  (L = f == null ? void 0 : f.current) == null || L.refreshResults();
9771
9776
  }
9772
- }, [A, g]);
9777
+ }, [O, g]);
9773
9778
  const X = g !== void 0 && g.trim().length > 0;
9774
9779
  function te() {
9775
9780
  Ft({
@@ -9852,7 +9857,7 @@ function em(e) {
9852
9857
  searchText: g,
9853
9858
  onSearch: (L) => {
9854
9859
  var E;
9855
- L && L.trim().length > 0 ? v == null || v(L) : (v == null || v(void 0), A || (E = f == null ? void 0 : f.current) == null || E.refreshResults());
9860
+ L && L.trim().length > 0 ? v == null || v(L) : (v == null || v(void 0), O || (E = f == null ? void 0 : f.current) == null || E.refreshResults());
9856
9861
  }
9857
9862
  }
9858
9863
  ),
@@ -10050,8 +10055,8 @@ function em(e) {
10050
10055
  ((N = f == null ? void 0 : f.current) == null ? void 0 : N.getDomain()) || [],
10051
10056
  h || []
10052
10057
  ),
10053
- limit: O,
10054
- totalRegisters: C || 0,
10058
+ limit: A,
10059
+ totalRegisters: T || 0,
10055
10060
  selectedRegistersToExport: o,
10056
10061
  visibleRegisters: (w == null ? void 0 : w.length) || 0,
10057
10062
  context: V
@@ -10285,29 +10290,29 @@ function Om(e, t, n) {
10285
10290
  if (typeof e != "function")
10286
10291
  throw new TypeError(fm);
10287
10292
  t = Jo(t) || 0, Fr(n) && (f = !!n.leading, d = "maxWait" in n, s = d ? Tm(Jo(n.maxWait) || 0, t) : s, p = "trailing" in n ? !!n.trailing : p);
10288
- function h(O) {
10289
- var C = r, T = o;
10290
- return r = o = void 0, u = O, a = e.apply(T, C), a;
10293
+ function h(A) {
10294
+ var T = r, C = o;
10295
+ return r = o = void 0, u = A, a = e.apply(C, T), a;
10291
10296
  }
10292
- function m(O) {
10293
- return u = O, l = setTimeout(g, t), f ? h(O) : a;
10297
+ function m(A) {
10298
+ return u = A, l = setTimeout(g, t), f ? h(A) : a;
10294
10299
  }
10295
- function y(O) {
10296
- var C = O - c, T = O - u, A = t - C;
10297
- return d ? Im(A, s - T) : A;
10300
+ function y(A) {
10301
+ var T = A - c, C = A - u, O = t - T;
10302
+ return d ? Im(O, s - C) : O;
10298
10303
  }
10299
- function v(O) {
10300
- var C = O - c, T = O - u;
10301
- return c === void 0 || C >= t || C < 0 || d && T >= s;
10304
+ function v(A) {
10305
+ var T = A - c, C = A - u;
10306
+ return c === void 0 || T >= t || T < 0 || d && C >= s;
10302
10307
  }
10303
10308
  function g() {
10304
- var O = lr();
10305
- if (v(O))
10306
- return b(O);
10307
- l = setTimeout(g, y(O));
10309
+ var A = lr();
10310
+ if (v(A))
10311
+ return b(A);
10312
+ l = setTimeout(g, y(A));
10308
10313
  }
10309
- function b(O) {
10310
- return l = void 0, p && r ? h(O) : (r = o = void 0, a);
10314
+ function b(A) {
10315
+ return l = void 0, p && r ? h(A) : (r = o = void 0, a);
10311
10316
  }
10312
10317
  function x() {
10313
10318
  l !== void 0 && clearTimeout(l), u = 0, r = c = o = l = void 0;
@@ -10316,8 +10321,8 @@ function Om(e, t, n) {
10316
10321
  return l === void 0 ? a : b(lr());
10317
10322
  }
10318
10323
  function w() {
10319
- var O = lr(), C = v(O);
10320
- if (r = arguments, o = this, c = O, C) {
10324
+ var A = lr(), T = v(A);
10325
+ if (r = arguments, o = this, c = A, T) {
10321
10326
  if (l === void 0)
10322
10327
  return m(c);
10323
10328
  if (d)
@@ -10436,11 +10441,11 @@ function Vm() {
10436
10441
  for (var w = 0; w < h.length; ++w)
10437
10442
  b.push(String(w));
10438
10443
  else
10439
- for (var O in h)
10440
- !(x && O === "prototype") && t.call(h, O) && b.push(String(O));
10444
+ for (var A in h)
10445
+ !(x && A === "prototype") && t.call(h, A) && b.push(String(A));
10441
10446
  if (s)
10442
- for (var C = d(h), T = 0; T < l.length; ++T)
10443
- !(C && l[T] === "constructor") && t.call(h, l[T]) && b.push(l[T]);
10447
+ for (var T = d(h), C = 0; C < l.length; ++C)
10448
+ !(T && l[C] === "constructor") && t.call(h, l[C]) && b.push(l[C]);
10444
10449
  return b;
10445
10450
  };
10446
10451
  }
@@ -11083,10 +11088,10 @@ const la = /* @__PURE__ */ $s(lh), ch = pt(
11083
11088
  }, [s, o, n]);
11084
11089
  const m = B(
11085
11090
  (I) => {
11086
- var O;
11091
+ var A;
11087
11092
  const w = Rn(
11088
11093
  I,
11089
- (O = l.current) == null ? void 0 : O._advancedSearchContainer
11094
+ (A = l.current) == null ? void 0 : A._advancedSearchContainer
11090
11095
  );
11091
11096
  t({ params: w, values: kr(I) });
11092
11097
  },
@@ -11096,17 +11101,17 @@ const la = /* @__PURE__ */ $s(lh), ch = pt(
11096
11101
  (I = d.current) == null || I.submit();
11097
11102
  }, []), v = B(
11098
11103
  (I) => {
11099
- var C;
11104
+ var T;
11100
11105
  const w = kr(I);
11101
11106
  if (la(w, a)) {
11102
11107
  h([]);
11103
11108
  return;
11104
11109
  }
11105
- const O = Rn(
11110
+ const A = Rn(
11106
11111
  I,
11107
- (C = l.current) == null ? void 0 : C._advancedSearchContainer
11112
+ (T = l.current) == null ? void 0 : T._advancedSearchContainer
11108
11113
  );
11109
- h(O);
11114
+ h(A);
11110
11115
  },
11111
11116
  [a]
11112
11117
  ), g = B(() => {
@@ -11197,10 +11202,10 @@ function ph(e, t) {
11197
11202
  parentContext: u = {},
11198
11203
  onChangeSelectedRowKeys: f,
11199
11204
  nameSearch: d
11200
- } = e, p = Q({}), h = Q(), m = Q(null), y = Q([]), v = bs(), [g, b] = S(!0), [x, I] = S(), { t: w } = he(), O = Q(null), C = nm({
11201
- elementRef: O,
11205
+ } = e, p = Q({}), h = Q(), m = Q(null), y = Q([]), v = bs(), [g, b] = S(!0), [x, I] = S(), { t: w } = he(), A = Q(null), T = nm({
11206
+ elementRef: A,
11202
11207
  offset: fh
11203
- }), { treeView: T, formView: A, loading: V } = tm({
11208
+ }), { treeView: C, formView: O, loading: V } = tm({
11204
11209
  model: n,
11205
11210
  formViewProps: r,
11206
11211
  treeViewProps: o,
@@ -11231,9 +11236,9 @@ function ph(e, t) {
11231
11236
  (E !== void 0 && de.current === void 0 || typeof E == "string" && typeof de.current == "string" && E !== de.current) && (M == null || M([]), te == null || te({}), (Z = m.current) == null || Z.unselectAll(), De()), de.current = E;
11232
11237
  }, [E]);
11233
11238
  const z = ye(() => {
11234
- if (T)
11235
- return Ot(T);
11236
- }, [T]), Y = yn(() => {
11239
+ if (C)
11240
+ return Ot(C);
11241
+ }, [C]), Y = yn(() => {
11237
11242
  if (z)
11238
11243
  return Zr(
11239
11244
  z,
@@ -11243,40 +11248,37 @@ function ph(e, t) {
11243
11248
  u
11244
11249
  );
11245
11250
  }, [z, u]), me = ye(() => rm({
11246
- treeViewId: T == null ? void 0 : T.view_id,
11251
+ treeViewId: C == null ? void 0 : C.view_id,
11247
11252
  model: n
11248
- }), [n, T == null ? void 0 : T.view_id]), {
11253
+ }), [n, C == null ? void 0 : C.view_id]), {
11249
11254
  loading: ve,
11250
- getColumnState: $e,
11255
+ getColumnState: ke,
11251
11256
  updateColumnState: Le
11252
11257
  } = Fs(me), Ie = ye(
11253
11258
  () => Zt(X || [], a),
11254
11259
  [a, X]
11255
- ), Ee = B(() => {
11256
- const Pe = `${JSON.stringify(E ? a : Ie)}-${E}`;
11257
- return Pe !== Ae.current ? (Ae.current = Pe, !0) : !1;
11260
+ ), $e = B(() => {
11261
+ const Ee = `${JSON.stringify(E ? a : Ie)}-${E}`;
11262
+ return Ee !== Ae.current ? (Ae.current = Ee, !0) : !1;
11258
11263
  }, [a, Ie, E]), Ke = B(async () => {
11259
- if (Ee()) {
11260
- I(void 0), L(0), b(!0);
11261
- try {
11262
- const Z = await P.getHandler().searchCount({
11263
- params: E ? a : Ie,
11264
- model: n,
11265
- context: u,
11266
- name_search: E
11267
- });
11268
- I(Z), L(Z);
11269
- } catch (Z) {
11270
- v(Z);
11271
- } finally {
11272
- b(!1);
11273
- }
11264
+ I(void 0), L(0), b(!0);
11265
+ try {
11266
+ const Z = await P.getHandler().searchCount({
11267
+ params: E ? a : Ie,
11268
+ model: n,
11269
+ context: u,
11270
+ name_search: E
11271
+ });
11272
+ I(Z), L(Z);
11273
+ } catch (Z) {
11274
+ v(Z);
11275
+ } finally {
11276
+ b(!1);
11274
11277
  }
11275
11278
  }, [
11276
11279
  a,
11277
11280
  Ie,
11278
11281
  n,
11279
- Ee,
11280
11282
  E,
11281
11283
  u,
11282
11284
  L,
@@ -11284,21 +11286,21 @@ function ph(e, t) {
11284
11286
  ]), Fe = B(
11285
11287
  async ({
11286
11288
  startRow: Z,
11287
- endRow: Pe,
11289
+ endRow: Ee,
11288
11290
  sortFields: Ye
11289
11291
  }) => {
11290
11292
  if (!z)
11291
11293
  return [];
11292
- const ke = {};
11293
- z.colors && (ke.colors = z.colors), z.status && (ke.status = z.status);
11294
+ const Pe = {};
11295
+ z.colors && (Pe.colors = z.colors), z.status && (Pe.status = z.status);
11294
11296
  const ot = E ? a : Ie, bt = Sc(Ye), { results: St, attrsEvaluated: Be } = await P.getHandler().searchForTree({
11295
11297
  params: ot,
11296
- limit: Pe - Z,
11298
+ limit: Ee - Z,
11297
11299
  offset: Z,
11298
11300
  model: n,
11299
- fields: T.field_parent ? { ...T.fields, [T.field_parent]: {} } : T.fields,
11301
+ fields: C.field_parent ? { ...C.fields, [C.field_parent]: {} } : C.fields,
11300
11302
  context: u,
11301
- attrs: ke,
11303
+ attrs: Pe,
11302
11304
  order: bt,
11303
11305
  name_search: E
11304
11306
  }), ze = St.map((mt) => ({ id: mt.id }));
@@ -11308,7 +11310,7 @@ function ph(e, t) {
11308
11310
  name_search: E,
11309
11311
  context: u,
11310
11312
  order: bt
11311
- }), Ee() || xe.current !== bt)
11313
+ }), $e() || xe.current !== bt)
11312
11314
  ie == null || ie(ze);
11313
11315
  else {
11314
11316
  const mt = [...ee || [], ...ze];
@@ -11334,43 +11336,43 @@ function ph(e, t) {
11334
11336
  a,
11335
11337
  Ie,
11336
11338
  n,
11337
- Ee,
11339
+ $e,
11338
11340
  E,
11339
11341
  u,
11340
11342
  ie,
11341
11343
  N,
11342
11344
  L,
11343
11345
  z,
11344
- T
11346
+ C
11345
11347
  ]
11346
11348
  ), ce = B(
11347
11349
  (Z) => {
11348
- R == null || R(Z.map((Pe) => ({ id: Pe }))), f == null || f(Z);
11350
+ R == null || R(Z.map((Ee) => ({ id: Ee }))), f == null || f(Z);
11349
11351
  },
11350
11352
  [f, R]
11351
11353
  ), fe = B(
11352
11354
  async ({
11353
11355
  startRow: Z,
11354
- endRow: Pe,
11356
+ endRow: Ee,
11355
11357
  sortFields: Ye
11356
11358
  }) => {
11357
11359
  try {
11358
11360
  return F == null || F(!0), await Fe({
11359
11361
  startRow: Z,
11360
- endRow: Pe,
11362
+ endRow: Ee,
11361
11363
  sortFields: Ye
11362
11364
  });
11363
- } catch (ke) {
11364
- throw console.error(ke), I(null), L(0), v(ke), ke;
11365
+ } catch (Pe) {
11366
+ throw console.error(Pe), I(null), L(0), v(Pe), Pe;
11365
11367
  } finally {
11366
11368
  F == null || F(!1);
11367
11369
  }
11368
11370
  },
11369
11371
  [Fe, L, F, v]
11370
11372
  ), we = B((Z) => {
11371
- var Pe, Ye, ke, ot;
11372
- if (p.current[(Ye = (Pe = Z.node) == null ? void 0 : Pe.data) == null ? void 0 : Ye.id])
11373
- return { color: p.current[(ot = (ke = Z.node) == null ? void 0 : ke.data) == null ? void 0 : ot.id] };
11373
+ var Ee, Ye, Pe, ot;
11374
+ if (p.current[(Ye = (Ee = Z.node) == null ? void 0 : Ee.data) == null ? void 0 : Ye.id])
11375
+ return { color: p.current[(ot = (Pe = Z.node) == null ? void 0 : Pe.data) == null ? void 0 : ot.id] };
11374
11376
  }, []), _e = ye(() => (j == null ? void 0 : j.map((Z) => Z.id)) || [], [j]), [J, Ce, Se] = Rs({
11375
11377
  ooui: z,
11376
11378
  model: n,
@@ -11382,7 +11384,7 @@ function ph(e, t) {
11382
11384
  }), Ue = B(async () => {
11383
11385
  let Z = !1;
11384
11386
  (j == null ? void 0 : j.length) === 0 ? Z = !0 : Z = !1;
11385
- const Pe = async () => {
11387
+ const Ee = async () => {
11386
11388
  if (E) {
11387
11389
  R == null || R(y.current);
11388
11390
  return;
@@ -11397,7 +11399,7 @@ function ph(e, t) {
11397
11399
  totalItems: x
11398
11400
  }
11399
11401
  );
11400
- R == null || R(Ye.map((ke) => ({ id: ke })));
11402
+ R == null || R(Ye.map((Pe) => ({ id: Pe })));
11401
11403
  };
11402
11404
  Z ? x && x > mh ? Ft({
11403
11405
  confirmMessage: w("confirmSelectAllRegisters").replace(
@@ -11405,8 +11407,8 @@ function ph(e, t) {
11405
11407
  x.toString()
11406
11408
  ),
11407
11409
  t: w,
11408
- onOk: Pe
11409
- }) : Pe() : R == null || R([]);
11410
+ onOk: Ee
11411
+ }) : Ee() : R == null || R([]);
11410
11412
  }, [
11411
11413
  a,
11412
11414
  Ie,
@@ -11419,8 +11421,8 @@ function ph(e, t) {
11419
11421
  x
11420
11422
  ]), Me = B(() => W, [W]), ne = ye(() => Se ? /* @__PURE__ */ i(As, { aggregates: Ce, isLoading: J }) : null, [Ce, J, Se]), Oe = B((Z) => /* @__PURE__ */ i(Lr, { color: Z, style: { marginLeft: 7 } }), []), qe = B(
11421
11423
  (Z) => {
11422
- var Pe;
11423
- return (Pe = h.current) == null ? void 0 : Pe[Z.id];
11424
+ var Ee;
11425
+ return (Ee = h.current) == null ? void 0 : Ee[Z.id];
11424
11426
  },
11425
11427
  []
11426
11428
  ), pe = ye(
@@ -11433,14 +11435,14 @@ function ph(e, t) {
11433
11435
  {
11434
11436
  readonly: !1,
11435
11437
  ref: m,
11436
- height: C,
11438
+ height: T,
11437
11439
  columns: Y,
11438
11440
  onRequestData: fe,
11439
11441
  onRowDoubleClick: s,
11440
11442
  onRowStyle: we,
11441
11443
  onRowSelectionChange: ce,
11442
11444
  onColumnChanged: Le,
11443
- onGetColumnsState: $e,
11445
+ onGetColumnsState: ke,
11444
11446
  onChangeFirstVisibleRowIndex: G,
11445
11447
  onGetFirstVisibleRowIndex: Me,
11446
11448
  selectedRowKeys: _e,
@@ -11453,12 +11455,12 @@ function ph(e, t) {
11453
11455
  strings: pe
11454
11456
  }
11455
11457
  ), [
11456
- C,
11458
+ T,
11457
11459
  ce,
11458
11460
  Y,
11459
11461
  Me,
11460
11462
  ne,
11461
- $e,
11463
+ ke,
11462
11464
  fe,
11463
11465
  s,
11464
11466
  qe,
@@ -11476,8 +11478,8 @@ function ph(e, t) {
11476
11478
  const Z = !la(
11477
11479
  X,
11478
11480
  q.current
11479
- ), Pe = ge.current && !_;
11480
- Z && Pe && De(), q.current = X, ge.current = _;
11481
+ ), Ee = ge.current && !_;
11482
+ Z && Ee && De(), q.current = X, ge.current = _;
11481
11483
  }, [X, _]);
11482
11484
  const De = B(async () => {
11483
11485
  var Z;
@@ -11485,7 +11487,7 @@ function ph(e, t) {
11485
11487
  }, [R, Ke]);
11486
11488
  return ht(t, () => ({
11487
11489
  refreshResults: De,
11488
- getFields: () => T == null ? void 0 : T.fields,
11490
+ getFields: () => C == null ? void 0 : C.fields,
11489
11491
  getDomain: () => a
11490
11492
  })), /* @__PURE__ */ D(Jt, { children: [
11491
11493
  /* @__PURE__ */ i(
@@ -11499,10 +11501,10 @@ function ph(e, t) {
11499
11501
  /* @__PURE__ */ i(
11500
11502
  "div",
11501
11503
  {
11502
- ref: O,
11504
+ ref: A,
11503
11505
  style: {
11504
11506
  overflow: "hidden",
11505
- height: `${C}px`,
11507
+ height: `${T}px`,
11506
11508
  ...l ? {} : { display: "none" }
11507
11509
  },
11508
11510
  children: V || ve || g ? /* @__PURE__ */ i(We, {}) : /* @__PURE__ */ D(Jt, { children: [
@@ -11512,14 +11514,14 @@ function ph(e, t) {
11512
11514
  {
11513
11515
  isOpen: _,
11514
11516
  onClose: () => $ == null ? void 0 : $(!1),
11515
- fields: { ...A == null ? void 0 : A.fields, ...T == null ? void 0 : T.fields },
11517
+ fields: { ...O == null ? void 0 : O.fields, ...C == null ? void 0 : C.fields },
11516
11518
  searchFields: ro([
11517
- A == null ? void 0 : A.search_fields,
11518
- T == null ? void 0 : T.search_fields
11519
+ O == null ? void 0 : O.search_fields,
11520
+ C == null ? void 0 : C.search_fields
11519
11521
  ]),
11520
- onSubmit: ({ params: Z, values: Pe }) => {
11522
+ onSubmit: ({ params: Z, values: Ee }) => {
11521
11523
  var Ye;
11522
- R == null || R([]), (Ye = m.current) == null || Ye.unselectAll(), H == null || H(void 0), M == null || M(Z), te == null || te(Pe), $ == null || $(!1);
11524
+ R == null || R([]), (Ye = m.current) == null || Ye.unselectAll(), H == null || H(void 0), M == null || M(Z), te == null || te(Ee), $ == null || $(!1);
11523
11525
  },
11524
11526
  searchValues: k
11525
11527
  }
@@ -11554,12 +11556,12 @@ const hh = pt(ph), gh = (e) => {
11554
11556
  (x) => {
11555
11557
  const { id: I } = x;
11556
11558
  f(I);
11557
- const w = u.findIndex((C) => C.id === I);
11559
+ const w = u.findIndex((T) => T.id === I);
11558
11560
  v == null || v(y), c(w);
11559
- const O = p.find(
11560
- (C) => C.type === "form"
11561
+ const A = p.find(
11562
+ (T) => T.type === "form"
11561
11563
  );
11562
- d(O);
11564
+ d(A);
11563
11565
  },
11564
11566
  [
11565
11567
  p,
@@ -11735,8 +11737,8 @@ function xh(e, t) {
11735
11737
  action_type: m,
11736
11738
  treeExpandable: y = !1,
11737
11739
  limit: v
11738
- } = e, [g, b] = S(), [x, I] = S([]), [w, O] = S(!0), C = p || void 0, [T, A] = S(
11739
- C
11740
+ } = e, [g, b] = S(), [x, I] = S([]), [w, A] = S(!0), T = p || void 0, [C, O] = S(
11741
+ T
11740
11742
  ), [V, F] = S([]), [_, $] = S(), [R, G] = S([]), [W, j] = S(), [M, k] = S(0), [X, te] = S(!1), [oe, H] = S(!1), [ie, ee] = S(), { t: N } = he(), L = Q(), E = Q(), de = re(
11741
11743
  wt
11742
11744
  ), {
@@ -11744,7 +11746,7 @@ function xh(e, t) {
11744
11746
  setCurrentId: Y,
11745
11747
  tabs: me,
11746
11748
  activeKey: ve,
11747
- openAction: $e,
11749
+ openAction: ke,
11748
11750
  onRemoveTab: Le
11749
11751
  } = de || {};
11750
11752
  Dt(
@@ -11756,9 +11758,9 @@ function xh(e, t) {
11756
11758
  [ve, me, g, _, R]
11757
11759
  );
11758
11760
  function Ie(J) {
11759
- A(J), Y == null || Y(J);
11761
+ O(J), Y == null || Y(J);
11760
11762
  }
11761
- function Ee(J) {
11763
+ function $e(J) {
11762
11764
  b(J);
11763
11765
  const Ce = { action_id: h, action_type: m };
11764
11766
  z == null || z({ ...J, extra: Ce });
@@ -11767,7 +11769,7 @@ function xh(e, t) {
11767
11769
  canWeClose: Fe
11768
11770
  }));
11769
11771
  const Ke = async () => {
11770
- O(!0);
11772
+ A(!0);
11771
11773
  const J = [], Ce = [];
11772
11774
  for (const Me of s) {
11773
11775
  const [ne, Oe] = Me;
@@ -11844,14 +11846,14 @@ function xh(e, t) {
11844
11846
  ), Ue || (it(
11845
11847
  `Error determining the first view to show for model ${r}.
11846
11848
  Please, make sure the view ids on the fields_view_get responses are the same as the ones defined in the action`
11847
- ), Le == null || Le(c)), Ee(Ue), I(J), O(!1);
11849
+ ), Le == null || Le(c)), $e(Ue), I(J), A(!1);
11848
11850
  };
11849
11851
  l({ tabKey: c, canWeClose: Fe }), ue(() => {
11850
11852
  const J = x.find((Se) => Se.type === "tree"), Ce = x.find((Se) => u.id ? Se.type === u.type && Se.view_id === u.id : Se.type === u.type);
11851
- Ee(Ce || J), p ? Y == null || Y(C) : (Ie(void 0), $(void 0)), Ke();
11853
+ $e(Ce || J), p ? Y == null || Y(T) : (Ie(void 0), $(void 0)), Ke();
11852
11854
  }, [r, s, p]), ue(() => {
11853
11855
  if (ve === c) {
11854
- Y == null || Y(T);
11856
+ Y == null || Y(C);
11855
11857
  const J = { action_id: h, action_type: m };
11856
11858
  z == null || z({ ...g, extra: J });
11857
11859
  }
@@ -11892,10 +11894,10 @@ Please, make sure the view ids on the fields_view_get responses are the same as
11892
11894
  const ne = x.find(
11893
11895
  (Oe) => Oe.type === "form"
11894
11896
  );
11895
- Ee(ne);
11897
+ $e(ne);
11896
11898
  } else {
11897
11899
  const ne = s.find((Oe) => Oe[1] === Se);
11898
- $e({
11900
+ ke({
11899
11901
  domain: Ue,
11900
11902
  context: o,
11901
11903
  model: r,
@@ -11917,7 +11919,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
11917
11919
  Qf,
11918
11920
  {
11919
11921
  formRef: L,
11920
- currentId: T,
11922
+ currentId: C,
11921
11923
  visible: g.type === J.type && g.view_id === J.view_id,
11922
11924
  formView: J,
11923
11925
  model: r,
@@ -11948,7 +11950,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
11948
11950
  results: R,
11949
11951
  setCurrentItemIndex: $,
11950
11952
  setCurrentId: Ie,
11951
- setCurrentView: Ee
11953
+ setCurrentView: $e
11952
11954
  },
11953
11955
  `${J.type}-${J.view_id}`
11954
11956
  );
@@ -11979,14 +11981,14 @@ Please, make sure the view ids on the fields_view_get responses are the same as
11979
11981
  });
11980
11982
  }
11981
11983
  function _e() {
11982
- if (T === void 0 && g.type === "form")
11984
+ if (C === void 0 && g.type === "form")
11983
11985
  L.current.clearAndReload();
11984
11986
  else {
11985
11987
  Ie(void 0);
11986
11988
  const J = x.find(
11987
11989
  (Ce) => Ce.type === "form"
11988
11990
  );
11989
- Ee(J);
11991
+ $e(J);
11990
11992
  }
11991
11993
  }
11992
11994
  return w ? /* @__PURE__ */ i(We, {}) : g ? /* @__PURE__ */ D(
@@ -11994,12 +11996,12 @@ Please, make sure the view ids on the fields_view_get responses are the same as
11994
11996
  {
11995
11997
  title: a,
11996
11998
  currentView: g,
11997
- setCurrentView: Ee,
11999
+ setCurrentView: $e,
11998
12000
  availableViews: x,
11999
12001
  formRef: L,
12000
12002
  searchTreeRef: E,
12001
12003
  onNewClicked: _e,
12002
- currentId: T,
12004
+ currentId: C,
12003
12005
  setCurrentId: Ie,
12004
12006
  setCurrentItemIndex: $,
12005
12007
  currentItemIndex: _,
@@ -12074,12 +12076,12 @@ function Ih(e) {
12074
12076
  domain: s = [],
12075
12077
  visible: a = !0,
12076
12078
  parentContext: l = {}
12077
- } = e, [c, u] = S(!1), [f, d] = S(!1), [p, h] = S(), [m, y] = S(), [v, g] = S(), [b, x] = S(1), [I, w] = S(0), O = Q($t), C = Q([]), [T, A] = S(0), [V, F] = S([]), [_, $] = S(void 0), [R, G] = S(), [W, j] = S(), [M, k] = S(), [X, te] = S(!1), oe = Q([]), H = (Y) => {
12078
- te(!0), x(Y), w((Y - 1) * O.current);
12079
+ } = e, [c, u] = S(!1), [f, d] = S(!1), [p, h] = S(), [m, y] = S(), [v, g] = S(), [b, x] = S(1), [I, w] = S(0), A = Q($t), T = Q([]), [C, O] = S(0), [V, F] = S([]), [_, $] = S(void 0), [R, G] = S(), [W, j] = S(), [M, k] = S(), [X, te] = S(!1), oe = Q([]), H = (Y) => {
12080
+ te(!0), x(Y), w((Y - 1) * A.current);
12079
12081
  }, ie = async () => {
12080
- const Y = oe.current.length > 0 ? oe.current : s, me = Zt(C.current, Y), { colors: ve } = Ot(m), { totalItems: $e, results: Le, attrsEvaluated: Ie } = await P.getHandler().searchForTree({
12082
+ const Y = oe.current.length > 0 ? oe.current : s, me = Zt(T.current, Y), { colors: ve } = Ot(m), { totalItems: ke, results: Le, attrsEvaluated: Ie } = await P.getHandler().searchForTree({
12081
12083
  params: me,
12082
- limit: O.current,
12084
+ limit: A.current,
12083
12085
  offset: I,
12084
12086
  model: p,
12085
12087
  fields: m.fields,
@@ -12087,14 +12089,14 @@ function Ih(e) {
12087
12089
  attrs: ve && { colors: ve }
12088
12090
  });
12089
12091
  $(Qt(Ie));
12090
- const Ee = Yt({
12092
+ const $e = Yt({
12091
12093
  resultsToSort: Le,
12092
12094
  sorter: R,
12093
12095
  fields: { ...m.fields, ...v.fields }
12094
12096
  });
12095
- te(!1), F(Ee);
12096
- const Ke = await $e();
12097
- A(Ke);
12097
+ te(!1), F($e);
12098
+ const Ke = await ke();
12099
+ O(Ke);
12098
12100
  }, ee = async () => {
12099
12101
  try {
12100
12102
  te(!0), await ie();
@@ -12119,7 +12121,7 @@ function Ih(e) {
12119
12121
  action: t,
12120
12122
  context: l
12121
12123
  });
12122
- oe.current = Y.domain, g(Y.views.get("form")), y(Y.views.get("tree")), h(Y.model), O.current = Y.limit;
12124
+ oe.current = Y.domain, g(Y.views.get("form")), y(Y.views.get("tree")), h(Y.model), A.current = Y.limit;
12123
12125
  }, E = async () => {
12124
12126
  h(n);
12125
12127
  const Y = await P.getHandler().getView({
@@ -12152,8 +12154,8 @@ function Ih(e) {
12152
12154
  Sn,
12153
12155
  {
12154
12156
  showPagination: !1,
12155
- total: T,
12156
- limit: O.current,
12157
+ total: C,
12158
+ limit: A.current,
12157
12159
  page: b,
12158
12160
  treeView: m,
12159
12161
  results: V,
@@ -12213,26 +12215,26 @@ function Fh(e, t) {
12213
12215
  async function w() {
12214
12216
  u(!0), p(!0), d(void 0);
12215
12217
  try {
12216
- const _ = await O(), $ = await T(_), R = _.fields[gr].relation, G = $[gr].items;
12218
+ const _ = await A(), $ = await C(_), R = _.fields[gr].relation, G = $[gr].items;
12217
12219
  v.current = _.fields;
12218
- const W = await C({
12220
+ const W = await T({
12219
12221
  items: G,
12220
12222
  model: R,
12221
12223
  context: r
12222
- }), j = await A(W);
12224
+ }), j = await O(W);
12223
12225
  d(void 0), l(j), u(!1), p(!1);
12224
12226
  } catch (_) {
12225
12227
  d(JSON.stringify(_));
12226
12228
  }
12227
12229
  }
12228
- async function O() {
12230
+ async function A() {
12229
12231
  return await g({
12230
12232
  model: n,
12231
12233
  type: "form",
12232
12234
  context: r
12233
12235
  });
12234
12236
  }
12235
- async function C({
12237
+ async function T({
12236
12238
  items: _,
12237
12239
  model: $,
12238
12240
  context: R
@@ -12256,7 +12258,7 @@ function Fh(e, t) {
12256
12258
  });
12257
12259
  return G;
12258
12260
  }
12259
- async function T(_) {
12261
+ async function C(_) {
12260
12262
  return (await b({
12261
12263
  model: n,
12262
12264
  ids: [o],
@@ -12264,7 +12266,7 @@ function Fh(e, t) {
12264
12266
  context: r
12265
12267
  }))[0];
12266
12268
  }
12267
- async function A(_) {
12269
+ async function O(_) {
12268
12270
  const $ = [];
12269
12271
  for (const G of _) {
12270
12272
  const { values: W } = G;
@@ -12350,7 +12352,7 @@ function Fh(e, t) {
12350
12352
  ve,
12351
12353
  {
12352
12354
  view_id: oe.filter(
12353
- ($e) => $e[1] === "graph"
12355
+ (ke) => ke[1] === "graph"
12354
12356
  )[0][0],
12355
12357
  model: H,
12356
12358
  context: ie,
@@ -12371,23 +12373,23 @@ function Fh(e, t) {
12371
12373
  (me) => me[1] === "tree"
12372
12374
  )[0][0],
12373
12375
  onRowClicked: (me) => {
12374
- const ve = oe.find(($e) => {
12375
- const [, Le] = $e;
12376
+ const ve = oe.find((ke) => {
12377
+ const [, Le] = ke;
12376
12378
  return Le === "form";
12377
12379
  });
12378
12380
  if (ve) {
12379
- const [$e, Le] = ve, {
12381
+ const [ke, Le] = ve, {
12380
12382
  actionId: Ie,
12381
- actionType: Ee,
12383
+ actionType: $e,
12382
12384
  title: Ke,
12383
12385
  model: Fe
12384
12386
  } = R, ce = {
12385
12387
  action_id: Ie,
12386
- action_type: Ee,
12388
+ action_type: $e,
12387
12389
  name: Ke,
12388
12390
  res_id: me.id,
12389
12391
  res_model: Fe,
12390
- view_id: $e,
12392
+ view_id: ke,
12391
12393
  view_type: Le
12392
12394
  };
12393
12395
  h(ce);
@@ -12424,17 +12426,17 @@ function Fh(e, t) {
12424
12426
  });
12425
12427
  if (Y) {
12426
12428
  const [me, ve] = Y, {
12427
- actionId: $e,
12429
+ actionId: ke,
12428
12430
  actionType: Le,
12429
12431
  title: Ie,
12430
- model: Ee
12432
+ model: $e
12431
12433
  } = R;
12432
12434
  z = {
12433
- action_id: $e,
12435
+ action_id: ke,
12434
12436
  action_type: Le,
12435
12437
  name: Ie,
12436
12438
  res_id: !1,
12437
- res_model: Ee,
12439
+ res_model: $e,
12438
12440
  view_id: me,
12439
12441
  view_type: ve,
12440
12442
  overrideUnsettedLimit: !0
@@ -12458,20 +12460,20 @@ const Rh = pt(Fh), _h = (e) => {
12458
12460
  const { ooui: t } = e;
12459
12461
  return /* @__PURE__ */ i(Re, { type: "array", ...e, children: /* @__PURE__ */ i(Vh, { ooui: t }) });
12460
12462
  }, Vh = (e) => {
12461
- const { value: t, ooui: n, onChange: r } = e, { items: o = [] } = t || {}, s = o.filter((T) => T.operation !== "pendingRemove").map((T) => T.id), [a, l] = S([]), [c, u] = S(), [f, d] = S(!1), { relation: p, context: h, readOnly: m, field: y, columns: v } = n, g = re(He), { getContext: b } = g || {};
12463
+ const { value: t, ooui: n, onChange: r } = e, { items: o = [] } = t || {}, s = o.filter((C) => C.operation !== "pendingRemove").map((C) => C.id), [a, l] = S([]), [c, u] = S(), [f, d] = S(!1), { relation: p, context: h, readOnly: m, field: y, columns: v } = n, g = re(He), { getContext: b } = g || {};
12462
12464
  yt(() => {
12463
12465
  I();
12464
12466
  }, [o]);
12465
- const x = (T) => {
12467
+ const x = (C) => {
12466
12468
  r == null || r({
12467
- items: T
12469
+ items: C
12468
12470
  });
12469
12471
  };
12470
12472
  async function I() {
12471
12473
  d(!0);
12472
- let T = [];
12474
+ let C = [];
12473
12475
  if (n.domain) {
12474
- const A = await P.getHandler().evalDomain({
12476
+ const O = await P.getHandler().evalDomain({
12475
12477
  domain: n.domain,
12476
12478
  values: Lt({
12477
12479
  fields: g == null ? void 0 : g.getFields(),
@@ -12480,12 +12482,12 @@ const Rh = pt(Fh), _h = (e) => {
12480
12482
  fields: g == null ? void 0 : g.getFields(),
12481
12483
  context: g.getContext()
12482
12484
  });
12483
- T = [...T, ...A];
12485
+ C = [...C, ...O];
12484
12486
  }
12485
12487
  try {
12486
12488
  const V = (await P.getHandler().search({
12487
12489
  model: p,
12488
- params: T,
12490
+ params: C,
12489
12491
  fieldsToRetrieve: [y],
12490
12492
  context: { ...b == null ? void 0 : b(), ...h }
12491
12493
  })).map((F) => {
@@ -12494,8 +12496,8 @@ const Rh = pt(Fh), _h = (e) => {
12494
12496
  return Array.isArray(_) && ($ = _[1]), { label: $, value: F.id };
12495
12497
  });
12496
12498
  l(V);
12497
- } catch (A) {
12498
- u(A);
12499
+ } catch (O) {
12500
+ u(O);
12499
12501
  } finally {
12500
12502
  d(!1);
12501
12503
  }
@@ -12503,17 +12505,17 @@ const Rh = pt(Fh), _h = (e) => {
12503
12505
  return /* @__PURE__ */ i(nt, { className: "mt-10", message: c, type: "error", banner: !0 });
12504
12506
  }
12505
12507
  const w = () => {
12506
- C(a.map((T) => T.value));
12507
- }, O = () => {
12508
- C([]);
12509
- }, C = (T) => {
12510
- const A = o.map((F) => T.includes(F.id) ? F.operation == "pendingRemove" ? {
12508
+ T(a.map((C) => C.value));
12509
+ }, A = () => {
12510
+ T([]);
12511
+ }, T = (C) => {
12512
+ const O = o.map((F) => C.includes(F.id) ? F.operation == "pendingRemove" ? {
12511
12513
  ...F,
12512
12514
  operation: "original"
12513
- } : F : { id: F.id, operation: "pendingRemove" }), V = A.map((F) => F.id);
12514
- T.filter((F) => !V.includes(F)).map((F) => {
12515
- A.push({ id: F, operation: "pendingLink" });
12516
- }), x(A);
12515
+ } : F : { id: F.id, operation: "pendingRemove" }), V = O.map((F) => F.id);
12516
+ C.filter((F) => !V.includes(F)).map((F) => {
12517
+ O.push({ id: F, operation: "pendingLink" });
12518
+ }), x(O);
12517
12519
  };
12518
12520
  return f && a.length === 0 ? /* @__PURE__ */ i(We, {}) : /* @__PURE__ */ i(ae, { children: /* @__PURE__ */ D("div", { className: "flex flex-row", children: [
12519
12521
  /* @__PURE__ */ i(
@@ -12521,9 +12523,9 @@ const Rh = pt(Fh), _h = (e) => {
12521
12523
  {
12522
12524
  value: a.length ? s : [],
12523
12525
  disabled: m,
12524
- onChange: C,
12526
+ onChange: T,
12525
12527
  style: { width: "100%" },
12526
- children: /* @__PURE__ */ i(Ne, { children: a.map((T) => /* @__PURE__ */ i(be, { span: Math.floor(24 / v), children: /* @__PURE__ */ i(pn, { value: T.value, children: T.label }) })) })
12528
+ children: /* @__PURE__ */ i(Ne, { children: a.map((C) => /* @__PURE__ */ i(be, { span: Math.floor(24 / v), children: /* @__PURE__ */ i(pn, { value: C.value, children: C.label }) })) })
12527
12529
  }
12528
12530
  ),
12529
12531
  !m && /* @__PURE__ */ D(Xe, { children: [
@@ -12535,7 +12537,7 @@ const Rh = pt(Fh), _h = (e) => {
12535
12537
  children: "Check all"
12536
12538
  }
12537
12539
  ),
12538
- /* @__PURE__ */ i(je, { onClick: O, disabled: s.length === 0, children: "Uncheck all" })
12540
+ /* @__PURE__ */ i(je, { onClick: A, disabled: s.length === 0, children: "Uncheck all" })
12539
12541
  ] })
12540
12542
  ] }) });
12541
12543
  }, Dh = (e) => /* @__PURE__ */ i(Re, { ...e, children: /* @__PURE__ */ i(Eh, { ...e }) }), Eh = (e) => {
@@ -12768,7 +12770,7 @@ function ng(e, t) {
12768
12770
  }));
12769
12771
  function p(I) {
12770
12772
  if (I === r) {
12771
- const w = c.findIndex((O) => O.key === I);
12773
+ const w = c.findIndex((A) => A.key === I);
12772
12774
  c[w - 1] && o(c[w - 1].key), c[w + 1] && o(c[w + 1].key);
12773
12775
  }
12774
12776
  u(c.filter((w) => w.key !== I)), f.current.delete(I);
@@ -12782,10 +12784,10 @@ function ng(e, t) {
12782
12784
  async function m({
12783
12785
  action: I,
12784
12786
  values: w,
12785
- forced_values: O,
12786
- initialViewType: C,
12787
- res_id: T,
12788
- domain: A = []
12787
+ forced_values: A,
12788
+ initialViewType: T,
12789
+ res_id: C,
12790
+ domain: O = []
12789
12791
  }) {
12790
12792
  const V = await P.getHandler().getActionData({
12791
12793
  action: I,
@@ -12828,9 +12830,9 @@ function ng(e, t) {
12828
12830
  }
12829
12831
  }
12830
12832
  let ie;
12831
- if (C) {
12833
+ if (T) {
12832
12834
  const [ee, N] = H.find(
12833
- ([L, E]) => E === C
12835
+ ([L, E]) => E === T
12834
12836
  );
12835
12837
  ie = { id: ee, type: N };
12836
12838
  } else {
@@ -12838,7 +12840,7 @@ function ng(e, t) {
12838
12840
  ie = { id: ee, type: N };
12839
12841
  }
12840
12842
  x({
12841
- domain: [...G, ...A],
12843
+ domain: [...G, ...O],
12842
12844
  context: { ...l, ...R },
12843
12845
  model: W,
12844
12846
  views: H,
@@ -12848,8 +12850,8 @@ function ng(e, t) {
12848
12850
  action_type: F,
12849
12851
  action_id: $,
12850
12852
  values: w,
12851
- forced_values: O,
12852
- res_id: T,
12853
+ forced_values: A,
12854
+ res_id: C,
12853
12855
  treeExpandable: oe,
12854
12856
  limit: te
12855
12857
  });
@@ -12857,30 +12859,30 @@ function ng(e, t) {
12857
12859
  function y({
12858
12860
  title: I,
12859
12861
  content: w,
12860
- key: O,
12861
- action: C
12862
+ key: A,
12863
+ action: T
12862
12864
  }) {
12863
- let T = [...c];
12864
- c.length === 1 && c[0].key === "welcome" && (T = [...c.filter((A) => A.key !== "welcome")]), u([
12865
- ...T,
12865
+ let C = [...c];
12866
+ c.length === 1 && c[0].key === "welcome" && (C = [...c.filter((O) => O.key !== "welcome")]), u([
12867
+ ...C,
12866
12868
  {
12867
12869
  title: I,
12868
- key: O,
12870
+ key: A,
12869
12871
  closable: !0,
12870
12872
  content: w,
12871
- action: C
12873
+ action: T
12872
12874
  }
12873
- ]), o(O);
12875
+ ]), o(A);
12874
12876
  }
12875
12877
  async function v({
12876
12878
  relateData: I,
12877
12879
  fields: w,
12878
- values: O,
12879
- action_id: C,
12880
- action_type: T
12880
+ values: A,
12881
+ action_id: T,
12882
+ action_type: C
12881
12883
  }) {
12882
12884
  const {
12883
- res_model: A,
12885
+ res_model: O,
12884
12886
  context: V,
12885
12887
  domain: F,
12886
12888
  views: _,
@@ -12889,39 +12891,39 @@ function ng(e, t) {
12889
12891
  limit: G
12890
12892
  } = I, [W, j] = _[0], M = { id: W, type: j }, k = Et({
12891
12893
  context: V,
12892
- values: { ...O, ...a },
12894
+ values: { ...A, ...a },
12893
12895
  fields: w
12894
12896
  }), X = F ? await P.getHandler().evalDomain({
12895
12897
  domain: F,
12896
12898
  values: Lt({
12897
12899
  fields: w,
12898
- values: { ...O, ...a }
12900
+ values: { ...A, ...a }
12899
12901
  }),
12900
12902
  fields: w,
12901
12903
  context: { ...l, ...k }
12902
12904
  }) : [];
12903
12905
  x({
12904
- model: A,
12906
+ model: O,
12905
12907
  target: $,
12906
12908
  views: _,
12907
12909
  context: { ...l, ...k },
12908
12910
  domain: X,
12909
12911
  title: R,
12910
12912
  initialView: M,
12911
- action_id: C,
12912
- action_type: T,
12913
+ action_id: T,
12914
+ action_type: C,
12913
12915
  limit: G
12914
12916
  });
12915
12917
  }
12916
12918
  async function g(I) {
12917
12919
  const {
12918
12920
  action_id: w,
12919
- action_type: O,
12920
- res_id: C,
12921
- view_id: T,
12922
- overrideUnsettedLimit: A = !1,
12921
+ action_type: A,
12922
+ res_id: T,
12923
+ view_id: C,
12924
+ overrideUnsettedLimit: O = !1,
12923
12925
  values: V = {}
12924
- } = I, F = `${O},${w}`, _ = await P.getHandler().getActionData({
12926
+ } = I, F = `${A},${w}`, _ = await P.getHandler().getActionData({
12925
12927
  action: F,
12926
12928
  context: l
12927
12929
  }), $ = Et({
@@ -12957,11 +12959,11 @@ function ng(e, t) {
12957
12959
  }
12958
12960
  }
12959
12961
  let H, ie;
12960
- if (T == null) {
12962
+ if (C == null) {
12961
12963
  const N = oe.find((L) => L[0] === void 0);
12962
12964
  H = void 0, ie = N[1];
12963
12965
  } else
12964
- [H, ie] = oe.find((N) => N[0] === void 0 ? !1 : N[0] === T);
12966
+ [H, ie] = oe.find((N) => N[0] === void 0 ? !1 : N[0] === C);
12965
12967
  const ee = { id: H, type: ie };
12966
12968
  x({
12967
12969
  domain: R,
@@ -12972,37 +12974,37 @@ function ng(e, t) {
12972
12974
  target: M,
12973
12975
  initialView: ee,
12974
12976
  action_id: w,
12975
- action_type: O,
12976
- res_id: C,
12977
+ action_type: A,
12978
+ res_id: T,
12977
12979
  treeExpandable: te,
12978
- limit: A && (X === 0 || X === !1) ? $t : X
12980
+ limit: O && (X === 0 || X === !1) ? $t : X
12979
12981
  });
12980
12982
  }
12981
12983
  async function b({
12982
12984
  model: I,
12983
12985
  values: w,
12984
- forced_values: O,
12985
- initialViewType: C,
12986
- res_id: T,
12987
- domain: A
12986
+ forced_values: A,
12987
+ initialViewType: T,
12988
+ res_id: C,
12989
+ domain: O
12988
12990
  }) {
12989
12991
  const V = await P.getHandler().getActionStringForModel(I);
12990
12992
  await m({
12991
12993
  action: V,
12992
12994
  values: w,
12993
- forced_values: O,
12994
- initialViewType: C,
12995
- res_id: T,
12996
- domain: A
12995
+ forced_values: A,
12996
+ initialViewType: T,
12997
+ res_id: C,
12998
+ domain: O
12997
12999
  });
12998
13000
  }
12999
13001
  async function x({
13000
13002
  domain: I,
13001
13003
  context: w,
13002
- model: O,
13003
- views: C,
13004
- title: T,
13005
- target: A,
13004
+ model: A,
13005
+ views: T,
13006
+ title: C,
13007
+ target: O,
13006
13008
  initialView: V,
13007
13009
  action_id: F,
13008
13010
  action_type: _,
@@ -13013,16 +13015,16 @@ function ng(e, t) {
13013
13015
  limit: j
13014
13016
  }) {
13015
13017
  const M = Xr();
13016
- if (A !== "current") {
13018
+ if (O !== "current") {
13017
13019
  const k = await P.getHandler().getView({
13018
- model: O,
13020
+ model: A,
13019
13021
  type: "form",
13020
13022
  id: V.type === "form" ? V.id : void 0,
13021
13023
  context: { ...l, ...w }
13022
13024
  });
13023
13025
  d.current.openActionModal({
13024
13026
  domain: I,
13025
- model: O,
13027
+ model: A,
13026
13028
  formView: k,
13027
13029
  context: { ...l, ...w },
13028
13030
  actionData: {
@@ -13035,7 +13037,7 @@ function ng(e, t) {
13035
13037
  } else {
13036
13038
  const k = V && Array.isArray(V.id) ? { ...V, id: V.id[0] } : V;
13037
13039
  y({
13038
- title: T,
13040
+ title: C,
13039
13041
  action: {
13040
13042
  id: F,
13041
13043
  type: _
@@ -13046,9 +13048,9 @@ function ng(e, t) {
13046
13048
  action_id: F,
13047
13049
  action_type: _,
13048
13050
  tabKey: M,
13049
- title: T,
13050
- views: C,
13051
- model: O,
13051
+ title: C,
13052
+ views: T,
13053
+ model: A,
13052
13054
  context: { ...l, ...w },
13053
13055
  domain: I,
13054
13056
  setCanWeClose: h,
@@ -13231,23 +13233,23 @@ const { useToken: ag } = Ge, iy = (e) => {
13231
13233
  return JSON.stringify(I);
13232
13234
  }, [I]);
13233
13235
  ue(() => {
13234
- C();
13236
+ T();
13235
13237
  }, [w]);
13236
- function O(F) {
13238
+ function A(F) {
13237
13239
  const _ = F;
13238
13240
  (_ == null ? void 0 : _.action_type) !== "ir.actions.wizard" && m(_);
13239
13241
  }
13240
- const C = B(async () => {
13242
+ const T = B(async () => {
13241
13243
  if (!I)
13242
13244
  return;
13243
13245
  const F = await n(I);
13244
13246
  F !== !1 && u(F), l(F !== !1);
13245
13247
  }, [I, n]);
13246
- async function T() {
13248
+ async function C() {
13247
13249
  var F;
13248
13250
  (F = p == null ? void 0 : p.current) == null || F.close(), x == null || x({ model: "ir.ui.view_sc" });
13249
13251
  }
13250
- const A = B(async () => {
13252
+ const O = B(async () => {
13251
13253
  const F = await t();
13252
13254
  return F.length === 0 ? [
13253
13255
  {
@@ -13283,13 +13285,13 @@ const { useToken: ag } = Ge, iy = (e) => {
13283
13285
  res_id: G
13284
13286
  });
13285
13287
  }
13286
- await A(), l(!a);
13288
+ await O(), l(!a);
13287
13289
  }, [
13288
13290
  v,
13289
13291
  b,
13290
13292
  c,
13291
13293
  g,
13292
- A,
13294
+ O,
13293
13295
  a,
13294
13296
  r,
13295
13297
  o,
@@ -13301,7 +13303,7 @@ const { useToken: ag } = Ge, iy = (e) => {
13301
13303
  ref: p,
13302
13304
  isFavourite: a,
13303
13305
  onToggleFavourite: V,
13304
- onItemClick: O,
13306
+ onItemClick: A,
13305
13307
  placement: "bottomRight",
13306
13308
  header: /* @__PURE__ */ D("div", { style: { width: 300, padding: 5, display: "flex" }, children: [
13307
13309
  /* @__PURE__ */ i("div", { style: { paddingLeft: 15, color: "#ccc" }, children: f == null ? void 0 : f("favorites").toUpperCase() }),
@@ -13309,14 +13311,14 @@ const { useToken: ag } = Ge, iy = (e) => {
13309
13311
  ji,
13310
13312
  {
13311
13313
  style: { color: d.colorPrimary, cursor: "pointer" },
13312
- onClick: T
13314
+ onClick: C
13313
13315
  }
13314
13316
  ) }) })
13315
13317
  ] }),
13316
13318
  onOpenChange: (F) => {
13317
13319
  F || s == null || s();
13318
13320
  },
13319
- onRetrieveData: A
13321
+ onRetrieveData: O
13320
13322
  }
13321
13323
  );
13322
13324
  };