@declarion/react 0.40.1 → 0.40.3

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.
Files changed (2) hide show
  1. package/dist-lib/index.js +412 -400
  2. package/package.json +1 -1
package/dist-lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as e, r as t, s as n, t as r } from "./DynamicIcon-DeRpAaXm.js";
2
- import { $n as i, $t as a, A as o, At as s, B as c, Bn as l, Bt as u, C as d, Cn as f, Ct as p, D as m, Dn as h, En as g, Et as _, F as v, Fn as y, Ft as b, G as x, Gn as S, Gt as C, Hn as w, Ht as T, I as E, In as ee, It as te, J as ne, Jn as re, Jt as ie, K as D, Kn as ae, L as oe, Ln as se, Lt as ce, M as le, Mn as O, Mt as k, N as A, Nt as j, O as ue, On as de, P as fe, Pt as pe, Qn as me, Qt as he, R as ge, Rn as M, Rt as _e, S as ve, Sn as ye, St as be, Tn as N, Un as xe, Ut as Se, Vn as P, Vt as Ce, Wn as we, Wt as Te, X as Ee, Xn as F, Xt as De, Y as Oe, Yn as ke, Yt as Ae, Zn as je, Zt as Me, _ as Ne, _n as Pe, _t as Fe, a as I, an as Ie, ar as Le, at as Re, bn as ze, c as Be, cn as Ve, cr as L, dn as He, dt as Ue, en as We, er as Ge, fn as Ke, gn as qe, gt as R, h as Je, ht as Ye, i as Xe, in as Ze, ir as Qe, it as z, j as $e, jn as B, jt as et, k as tt, kn as nt, l as rt, ln as it, lt as at, m as ot, mn as st, mt as ct, n as lt, nn as ut, nr as dt, nt as ft, o as V, or as H, ot as pt, pn as mt, pt as ht, q as gt, qn as _t, qt as vt, r as yt, rn as bt, rr as xt, rt as St, s as Ct, sn as wt, sr as U, t as Tt, tn as Et, tr as W, un as Dt, ut as Ot, v as kt, vn as At, vt as jt, w as Mt, wn as Nt, wt as Pt, x as Ft, xn as It, xt as Lt, y as Rt, yn as zt, yt as Bt, z as Vt, zn as Ht, zt as Ut } from "./useCurrentScreen-C33VZcNn.js";
2
+ import { $n as i, $t as a, A as o, At as s, B as c, Bn as l, Bt as u, C as d, Cn as f, Ct as p, D as m, Dn as h, En as g, Et as _, F as v, Fn as y, Ft as b, G as x, Gn as S, Gt as C, Hn as w, Ht as T, I as E, In as ee, It as te, J as ne, Jn as re, Jt as ie, K as D, Kn as ae, L as oe, Ln as se, Lt as ce, M as le, Mn as O, Mt as k, N as A, Nt as j, O as ue, On as de, P as fe, Pt as pe, Qn as me, Qt as he, R as ge, Rn as M, Rt as _e, S as ve, Sn as ye, St as be, Tn as N, Un as xe, Ut as Se, Vn as P, Vt as Ce, Wn as we, Wt as Te, X as Ee, Xn as F, Xt as De, Y as Oe, Yn as ke, Yt as Ae, Zn as je, Zt as Me, _ as Ne, _n as Pe, _t as Fe, a as Ie, an as I, ar as Le, at as Re, bn as ze, c as Be, cn as Ve, cr as L, dn as He, dt as Ue, en as We, er as Ge, fn as Ke, gn as qe, gt as Je, h as R, ht as Ye, i as Xe, in as Ze, ir as Qe, it as z, j as $e, jn as et, jt as tt, k as B, kn as nt, l as rt, ln as it, lt as at, m as ot, mn as st, mt as ct, n as lt, nn as ut, nr as dt, nt as ft, o as pt, or as V, ot as H, pn as mt, pt as ht, q as gt, qn as _t, qt as vt, r as yt, rn as bt, rr as xt, rt as St, s as Ct, sn as wt, sr as U, t as Tt, tn as Et, tr as W, un as Dt, ut as Ot, v as kt, vn as At, vt as jt, w as Mt, wn as Nt, wt as Pt, x as Ft, xn as It, xt as Lt, y as Rt, yn as zt, yt as Bt, z as Vt, zn as Ht, zt as Ut } from "./useCurrentScreen-C33VZcNn.js";
3
3
  import { A as Wt, B as Gt, C as Kt, D as qt, E as Jt, F as Yt, I as Xt, L as Zt, M as Qt, N as $t, O as en, P as tn, R as nn, S as rn, T as an, V as on, _ as sn, a as cn, b as ln, c as un, d as dn, f as fn, g as pn, h as mn, i as hn, j as gn, k as _n, l as vn, m as yn, n as bn, p as xn, r as Sn, s as Cn, t as wn, u as Tn, v as En, w as Dn, x as On, y as kn, z as An } from "./RefreshControl-DG2kMABB.js";
4
4
  import { $ as jn, A as Mn, B as Nn, C as Pn, D as Fn, E as In, F as Ln, H as Rn, I as zn, J as Bn, K as Vn, M as Hn, N as Un, Q as Wn, S as Gn, T as Kn, U as qn, V as Jn, W as Yn, X as Xn, Y as Zn, Z as Qn, _ as $n, a as er, b as tr, c as nr, ct as rr, d as ir, dt as ar, et as or, f as sr, ft as G, g as cr, h as lr, i as ur, it as dr, j as fr, k as pr, l as mr, lt as hr, m as gr, mt as _r, n as vr, nt as yr, o as br, ot as xr, p as Sr, pt as Cr, q as wr, r as Tr, rt as Er, s as Dr, st as Or, t as kr, tt as Ar, u as jr, ut as Mr, v as Nr, x as Pr, y as Fr, z as Ir } from "./registry-DbZX1hy8.js";
5
5
  import { C as Lr, S as Rr, _ as zr, a as Br, b as Vr, d as Hr, f as Ur, g as Wr, h as Gr, i as Kr, l as qr, m as Jr, n as Yr, o as Xr, p as Zr, r as Qr, s as $r, t as ei, u as ti, v as ni, w as ri, x as ii, y as ai } from "./useProperties-BgAEk8X9.js";
@@ -351,7 +351,7 @@ function Zi() {
351
351
  }
352
352
  }, c = e.parentOrigin ? Yi(e.parentOrigin, {
353
353
  onAuth: (e) => {
354
- Ie(e), o.current || i();
354
+ I(e), o.current || i();
355
355
  },
356
356
  onNavigate: (n) => {
357
357
  let r = () => {
@@ -487,7 +487,7 @@ function sa() {
487
487
  //#endregion
488
488
  //#region src/embed/EmbedLocationReporter.tsx
489
489
  function ca() {
490
- let e = ct(), t = vi(), { data: n } = et(), r = Y(null), i = e.enabled && e.navigationMode === "self";
490
+ let e = ct(), t = vi(), { data: n } = tt(), r = Y(null), i = e.enabled && e.navigationMode === "self";
491
491
  return q(() => {
492
492
  if (!i) return;
493
493
  let a = `${t.pathname}${t.search}`;
@@ -646,7 +646,7 @@ function ua() {
646
646
  //#endregion
647
647
  //#region src/components/layout/Sidebar.tsx
648
648
  function da({ activeArea: e }) {
649
- let { data: t } = et(), r = vi(), i = dr(), a = G((e) => e.sidebar), o = G((e) => e.set), s = a === "collapsed", [c, l] = X({}), u = en(), d = u?.app_name ?? "", f = u?.app_logo, p = u?.version_label ?? "", m = J(() => fa(t?.navigation ?? [], e), [t?.navigation, e]), h = (e) => e ? r.pathname === e || r.pathname.startsWith(e + "/") : !1, g = (e, n) => {
649
+ let { data: t } = tt(), r = vi(), i = dr(), a = G((e) => e.sidebar), o = G((e) => e.set), s = a === "collapsed", [c, l] = X({}), u = en(), d = u?.app_name ?? "", f = u?.app_logo, p = u?.version_label ?? "", m = J(() => fa(t?.navigation ?? [], e), [t?.navigation, e]), h = (e) => e ? r.pathname === e || r.pathname.startsWith(e + "/") : !1, g = (e, n) => {
650
650
  if (!e.screen) return;
651
651
  let r = t?.screens[e.screen];
652
652
  r && i(r.route, {
@@ -1707,12 +1707,12 @@ function Oa({ breadcrumbs: e, onCrumbClick: t, onOpenNav: r, navButtonRef: i, sh
1707
1707
  gap: 4,
1708
1708
  flexWrap: "wrap"
1709
1709
  },
1710
- children: [/* @__PURE__ */ Q(H, {
1710
+ children: [/* @__PURE__ */ Q(V, {
1711
1711
  tone: "violet",
1712
1712
  size: "xs",
1713
1713
  dot: !0,
1714
1714
  children: b.role
1715
- }), /* @__PURE__ */ $(H, {
1715
+ }), /* @__PURE__ */ $(V, {
1716
1716
  tone: "slate",
1717
1717
  size: "xs",
1718
1718
  children: [
@@ -4548,7 +4548,7 @@ function Qo() {
4548
4548
  var $o = "default";
4549
4549
  function es() {
4550
4550
  sa(), kn();
4551
- let { isAuthenticated: e, isLoading: t, user: n, activeTenant: r } = k(), i = ct(), a = bi(), o = dr(), s = K((e) => o(e, { topLevel: !0 }), [o]), c = vi(), { data: l } = et(), u = W(), d = G((e) => e.sidebar), f = G((e) => e.tabsPosition), p = G((e) => e.aiSurface), m = G((e) => e.colorScheme), h = G((e) => e.set), g = G((e) => e.hydrateFromBranding), { branding: _ } = qt(), v = mn(), y = Mr((e) => e.tabs), b = Mr((e) => e.activeTabId), x = Mr((e) => e.closeTabs), S = Mr((e) => e.switchTab), C = Mr((e) => e.setScope), w = Mr((e) => e.hydrate), [T, E] = X($o), [ee, te] = X(!1), [ne, re] = X("default"), [ie, D] = X(!1), [ae, oe] = X(!1), [se, ce] = X(!1), le = Y(null), O = Y(null), [A, j] = X(null), ue = p !== "off" && v.isVisible("show_command_palette"), de = p === "panel" || p === "both", fe = p === "command" || p === "both", pe = en(), me = pe?.ai_name?.trim() ?? "", he = u.category === "phone" || u.category === "tablet", ge = v.isVisible("show_topbar"), M = !he && v.isVisible("show_rail"), _e = !he && v.isVisible("show_sidebar"), ve = !he && v.isVisible("show_tabs"), ye = he && v.isVisible("show_sidebar"), be = he && v.isVisible("show_tabs"), N = v.isVisible("show_tenant_switcher"), xe = v.isVisible("show_breadcrumbs"), Se = v.isVisible("show_theme_toggle"), P = K((e = "default") => {
4551
+ let { isAuthenticated: e, isLoading: t, user: n, activeTenant: r } = k(), i = ct(), a = bi(), o = dr(), s = K((e) => o(e, { topLevel: !0 }), [o]), c = vi(), { data: l } = tt(), u = W(), d = G((e) => e.sidebar), f = G((e) => e.tabsPosition), p = G((e) => e.aiSurface), m = G((e) => e.colorScheme), h = G((e) => e.set), g = G((e) => e.hydrateFromBranding), { branding: _ } = qt(), v = mn(), y = Mr((e) => e.tabs), b = Mr((e) => e.activeTabId), x = Mr((e) => e.closeTabs), S = Mr((e) => e.switchTab), C = Mr((e) => e.setScope), w = Mr((e) => e.hydrate), [T, E] = X($o), [ee, te] = X(!1), [ne, re] = X("default"), [ie, D] = X(!1), [ae, oe] = X(!1), [se, ce] = X(!1), le = Y(null), O = Y(null), [A, j] = X(null), ue = p !== "off" && v.isVisible("show_command_palette"), de = p === "panel" || p === "both", fe = p === "command" || p === "both", pe = en(), me = pe?.ai_name?.trim() ?? "", he = u.category === "phone" || u.category === "tablet", ge = v.isVisible("show_topbar"), M = !he && v.isVisible("show_rail"), _e = !he && v.isVisible("show_sidebar"), ve = !he && v.isVisible("show_tabs"), ye = he && v.isVisible("show_sidebar"), be = he && v.isVisible("show_tabs"), N = v.isVisible("show_tenant_switcher"), xe = v.isVisible("show_breadcrumbs"), Se = v.isVisible("show_theme_toggle"), P = K((e = "default") => {
4552
4552
  ue && (re(e), te(!0));
4553
4553
  }, [ue]), Ce = K((e) => {
4554
4554
  if (e.length === 0) return;
@@ -5707,7 +5707,7 @@ var ks = "Invalid email or password.", As = "You do not have access to that page
5707
5707
  }
5708
5708
  };
5709
5709
  function Ms() {
5710
- let e = bi(), [t] = wi(), { login: r, isLoginPending: i, isAuthenticated: a } = ga(), { data: o } = $t(), { data: s } = et(), [c, l] = X(""), [u, d] = X(""), [f, p] = X(!0), m = Dt(t.get("next") || t.get("redirect")), h = t.get("sso_error"), g = Ds(o?.parameters), { data: _ } = Ai({
5710
+ let e = bi(), [t] = wi(), { login: r, isLoginPending: i, isAuthenticated: a } = ga(), { data: o } = $t(), { data: s } = tt(), [c, l] = X(""), [u, d] = X(""), [f, p] = X(!0), m = Dt(t.get("next") || t.get("redirect")), h = t.get("sso_error"), g = Ds(o?.parameters), { data: _ } = Ai({
5711
5711
  queryKey: ["check-setup"],
5712
5712
  queryFn: pe
5713
5713
  }), { data: v } = Ai({
@@ -6519,7 +6519,7 @@ function Ks() {
6519
6519
  //#endregion
6520
6520
  //#region src/components/pages/NotFoundPage.tsx
6521
6521
  function qs() {
6522
- let e = ct(), t = Re(), n = vi(), r = pt();
6522
+ let e = ct(), t = Re(), n = vi(), r = H();
6523
6523
  return q(() => {
6524
6524
  e.enabled && r(n.pathname, "not_found");
6525
6525
  }, [
@@ -7043,7 +7043,7 @@ function ic({ carrierEntityCode: e, carrierScope: t, rowId: r, title: i = "Param
7043
7043
  value: i,
7044
7044
  structure: e.structure
7045
7045
  }),
7046
- r && /* @__PURE__ */ Q(H, {
7046
+ r && /* @__PURE__ */ Q(V, {
7047
7047
  tone: "violet",
7048
7048
  size: "xs",
7049
7049
  children: "overridden"
@@ -7236,18 +7236,18 @@ function sc() {
7236
7236
  flexWrap: "wrap"
7237
7237
  },
7238
7238
  children: [
7239
- /* @__PURE__ */ Q(H, {
7239
+ /* @__PURE__ */ Q(V, {
7240
7240
  tone: "violet",
7241
7241
  size: "xs",
7242
7242
  dot: !0,
7243
7243
  children: b
7244
7244
  }),
7245
- /* @__PURE__ */ Q(H, {
7245
+ /* @__PURE__ */ Q(V, {
7246
7246
  tone: "slate",
7247
7247
  size: "xs",
7248
7248
  children: x
7249
7249
  }),
7250
- t?.is_active && /* @__PURE__ */ Q(H, {
7250
+ t?.is_active && /* @__PURE__ */ Q(V, {
7251
7251
  tone: "emerald",
7252
7252
  size: "xs",
7253
7253
  dot: !0,
@@ -7358,7 +7358,7 @@ function sc() {
7358
7358
  icon: /* @__PURE__ */ Q(n.shield, { size: 13 }),
7359
7359
  label: "Two-factor authentication",
7360
7360
  hint: "Authenticator app recommended",
7361
- action: /* @__PURE__ */ Q(H, {
7361
+ action: /* @__PURE__ */ Q(V, {
7362
7362
  tone: "slate",
7363
7363
  size: "xs",
7364
7364
  children: "Not set up"
@@ -7399,7 +7399,7 @@ function sc() {
7399
7399
  children: [
7400
7400
  /* @__PURE__ */ Q(zi, {
7401
7401
  label: "Role",
7402
- children: /* @__PURE__ */ Q(H, {
7402
+ children: /* @__PURE__ */ Q(V, {
7403
7403
  tone: "violet",
7404
7404
  size: "xs",
7405
7405
  dot: !0,
@@ -7748,7 +7748,7 @@ function uc() {
7748
7748
  }
7749
7749
  }
7750
7750
  function dc({ userId: e }) {
7751
- let { data: t } = et();
7751
+ let { data: t } = tt();
7752
7752
  return /* @__PURE__ */ Q(ic, {
7753
7753
  carrierEntityCode: "profile",
7754
7754
  carrierScope: t?.entities.profile?.params_scope ?? "profile",
@@ -7756,7 +7756,7 @@ function dc({ userId: e }) {
7756
7756
  });
7757
7757
  }
7758
7758
  function fc({ userId: e }) {
7759
- let { data: t } = et();
7759
+ let { data: t } = tt();
7760
7760
  if (!e || !t) return null;
7761
7761
  let n = t.entities.profile;
7762
7762
  return n ? /* @__PURE__ */ Q(Mn, {
@@ -7973,11 +7973,11 @@ function hc(e) {
7973
7973
  gap: 6,
7974
7974
  alignItems: "center"
7975
7975
  },
7976
- children: [/* @__PURE__ */ Q(H, {
7976
+ children: [/* @__PURE__ */ Q(V, {
7977
7977
  tone: mc(e.source),
7978
7978
  size: "xs",
7979
7979
  children: e.source
7980
- }), r && /* @__PURE__ */ Q(H, {
7980
+ }), r && /* @__PURE__ */ Q(V, {
7981
7981
  tone: "violet",
7982
7982
  size: "xs",
7983
7983
  dot: !0,
@@ -8325,7 +8325,7 @@ function Cc({ active: e, onClick: t, children: n, capitalize: r }) {
8325
8325
  //#endregion
8326
8326
  //#region src/components/pages/AdminCatalogPage.tsx
8327
8327
  function wc() {
8328
- let { data: e } = et(), [t, n] = X("handlers"), r = W().isPhone;
8328
+ let { data: e } = tt(), [t, n] = X("handlers"), r = W().isPhone;
8329
8329
  return e ? /* @__PURE__ */ $("div", {
8330
8330
  style: {
8331
8331
  display: "flex",
@@ -8486,17 +8486,17 @@ function Ec({ code: e, handler: t, entity: n }) {
8486
8486
  justifyContent: o ? "flex-start" : "flex-end"
8487
8487
  },
8488
8488
  children: [
8489
- /* @__PURE__ */ Q(H, {
8489
+ /* @__PURE__ */ Q(V, {
8490
8490
  tone: "slate",
8491
8491
  size: "xs",
8492
8492
  children: t.type
8493
8493
  }),
8494
- n && /* @__PURE__ */ Q(H, {
8494
+ n && /* @__PURE__ */ Q(V, {
8495
8495
  tone: "violet",
8496
8496
  size: "xs",
8497
8497
  children: n
8498
8498
  }),
8499
- t.success_event && /* @__PURE__ */ $(H, {
8499
+ t.success_event && /* @__PURE__ */ $(V, {
8500
8500
  tone: "emerald",
8501
8501
  size: "xs",
8502
8502
  children: ["event: ", t.success_event]
@@ -8560,17 +8560,17 @@ function Dc({ code: e, param: t }) {
8560
8560
  },
8561
8561
  children: e
8562
8562
  }),
8563
- /* @__PURE__ */ Q(H, {
8563
+ /* @__PURE__ */ Q(V, {
8564
8564
  tone: "slate",
8565
8565
  size: "xs",
8566
8566
  children: t.type || "string"
8567
8567
  }),
8568
- t.required && /* @__PURE__ */ Q(H, {
8568
+ t.required && /* @__PURE__ */ Q(V, {
8569
8569
  tone: "rose",
8570
8570
  size: "xs",
8571
8571
  children: "required"
8572
8572
  }),
8573
- t.hidden && /* @__PURE__ */ Q(H, {
8573
+ t.hidden && /* @__PURE__ */ Q(V, {
8574
8574
  tone: "slate",
8575
8575
  size: "xs",
8576
8576
  children: "hidden"
@@ -8710,7 +8710,7 @@ function kc({ code: e, action: t }) {
8710
8710
  children: [
8711
8711
  (() => {
8712
8712
  let e = t.handler ? "handler" : t.association ? "association" : t.widget ? "widget" : t.href ? "href" : null;
8713
- return e ? /* @__PURE__ */ Q(H, {
8713
+ return e ? /* @__PURE__ */ Q(V, {
8714
8714
  tone: "slate",
8715
8715
  size: "xs",
8716
8716
  children: e
@@ -8730,7 +8730,7 @@ function kc({ code: e, action: t }) {
8730
8730
  display: "flex",
8731
8731
  gap: 4
8732
8732
  },
8733
- children: t.visibility.map((e) => /* @__PURE__ */ Q(H, {
8733
+ children: t.visibility.map((e) => /* @__PURE__ */ Q(V, {
8734
8734
  tone: "slate",
8735
8735
  size: "xs",
8736
8736
  children: e
@@ -10409,7 +10409,7 @@ function hl({ title: e, description: t, toolbarActions: r, screenActionLayout: i
10409
10409
  i,
10410
10410
  a,
10411
10411
  g
10412
- ]), v = J(() => Rt(_, g, void 0, Je, "Select one or more rows first"), [_, g]), y = J(() => {
10412
+ ]), v = J(() => Rt(_, g, void 0, R, "Select one or more rows first"), [_, g]), y = J(() => {
10413
10413
  if (o.length === 0) return [];
10414
10414
  let e = /* @__PURE__ */ new Map();
10415
10415
  for (let t of s) e.set(c(t), t);
@@ -10807,7 +10807,7 @@ function Ol(e) {
10807
10807
  let n = e.original.$statuses?.find((e) => e.group_code === t);
10808
10808
  if (!n) return ci("span", { className: "text-sm text-muted-foreground" }, "-");
10809
10809
  let r = i.get(n.status_code);
10810
- return ci(H, {
10810
+ return ci(V, {
10811
10811
  tone: r?.color ?? "slate",
10812
10812
  size: "xs"
10813
10813
  }, N(r?.name) || n.status_code);
@@ -10840,7 +10840,7 @@ function Ol(e) {
10840
10840
  enableSorting: !1,
10841
10841
  cell: ({ row: e }) => {
10842
10842
  let t = e.original.$evidence?.verdict ?? "unverified";
10843
- return ci(H, {
10843
+ return ci(V, {
10844
10844
  tone: Sn(t),
10845
10845
  size: "xs",
10846
10846
  dot: !0
@@ -11275,7 +11275,7 @@ function Il({ views: e, activeViewId: t, isDirty: r, onSelect: i, onSave: a, onS
11275
11275
  //#endregion
11276
11276
  //#region src/hooks/useScreen.ts
11277
11277
  function Ll(e) {
11278
- let { data: t } = et();
11278
+ let { data: t } = tt();
11279
11279
  if (!(!t || !e)) return t.screens[e];
11280
11280
  }
11281
11281
  //#endregion
@@ -11509,7 +11509,7 @@ function Ql({ screenCode: e }) {
11509
11509
  return /* @__PURE__ */ Q(A, { children: /* @__PURE__ */ Q($l, { screenCode: e }) });
11510
11510
  }
11511
11511
  function $l({ screenCode: e }) {
11512
- let t = dr(), r = ji(), [i, a] = wi(), { data: s } = et(), c = o(), [l, u] = Fc("selection", Zl, { scope: "path" }), [d, p] = X(!1), [m, h] = X(!1), [g, _] = X(!1), [b, x] = X(!1), S = Y(null), [C, w] = X(null), T = Y(null);
11512
+ let t = dr(), r = ji(), [i, a] = wi(), { data: s } = tt(), c = o(), [l, u] = Fc("selection", Zl, { scope: "path" }), [d, p] = X(!1), [m, h] = X(!1), [g, _] = X(!1), [b, x] = X(!1), S = Y(null), [C, w] = X(null), T = Y(null);
11513
11513
  q(() => () => {
11514
11514
  T.current && clearTimeout(T.current.timer);
11515
11515
  }, []);
@@ -11549,41 +11549,62 @@ function $l({ screenCode: e }) {
11549
11549
  O?.export?.enabled
11550
11550
  ]), xe = !!A?.soft_delete, Se = xe && (ie?.permissions ?? []).some((e) => e === "feature:view_deleted" || e === "feature:*" || e === "*"), P = Se && i.get("include_deleted") === "true", Ce = ct(), { openTab: we, updateTabSearch: Te, findTabByPathname: De } = Mr();
11551
11551
  Gr(O, A, i.toString()), zr(O?.route);
11552
- let Ae = parseInt(i.get("page") ?? "1", 10), je = (() => {
11552
+ let Ae = K((e) => {
11553
+ if (!O?.route || !A || Ce.enabled) return;
11554
+ let t = De(O.route);
11555
+ if (t) {
11556
+ Te(t.id, e);
11557
+ return;
11558
+ }
11559
+ we({
11560
+ pathname: O.route,
11561
+ search: e,
11562
+ title: N(O.display?.name) || N(A.display.name_plural),
11563
+ icon: O.display?.icon || A.display.icon,
11564
+ closable: !0
11565
+ });
11566
+ }, [
11567
+ O,
11568
+ A,
11569
+ Ce.enabled,
11570
+ De,
11571
+ Te,
11572
+ we
11573
+ ]), je = parseInt(i.get("page") ?? "1", 10), Me = (() => {
11553
11574
  let e = parseInt(i.get("per_page") ?? "", 10);
11554
11575
  return !Number.isFinite(e) || e <= 0 || e > 1e3 ? 200 : e;
11555
- })(), Me = i.get("search") ?? "", Ne = i.get("sort") ?? O?.sort_default ?? "", I = J(() => tr(Ne), [Ne]), Ie = J(() => {
11576
+ })(), Ne = i.get("search") ?? "", Ie = i.get("sort") ?? O?.sort_default ?? "", I = J(() => tr(Ie), [Ie]), Re = J(() => {
11556
11577
  let e = /* @__PURE__ */ new Map();
11557
11578
  for (let t of I) t.nulls && e.set(t.field, t.nulls);
11558
11579
  return e;
11559
- }, [I]), Re = J(() => Pn(Ne), [Ne]), Be = J(() => ll(O, A, s?.entities), [
11580
+ }, [I]), Be = J(() => Pn(Ie), [Ie]), Ve = J(() => ll(O, A, s?.entities), [
11560
11581
  O,
11561
11582
  A,
11562
11583
  s?.entities
11563
- ]), Ve = gt(Me, 300), He = W(), Ue = yn("list"), We = i.get("view"), Ge = J(() => ae.find((e) => e.id === We), [ae, We]), Ke = J(() => {
11564
- let e = O?.responsive?.[He.category]?.presentation;
11565
- return e === "table" || e === "cards" ? e : He.category === "phone" ? "cards" : "table";
11566
- }, [O?.responsive, He.category]), R = J(() => {
11584
+ ]), He = gt(Ne, 300), Ue = W(), We = yn("list"), Ge = i.get("view"), Ke = J(() => ae.find((e) => e.id === Ge), [ae, Ge]), Je = J(() => {
11585
+ let e = O?.responsive?.[Ue.category]?.presentation;
11586
+ return e === "table" || e === "cards" ? e : Ue.category === "phone" ? "cards" : "table";
11587
+ }, [O?.responsive, Ue.category]), R = J(() => {
11567
11588
  let e = i.get("columns");
11568
11589
  return e ? e.split(",").filter(Boolean) : O?.default_columns ?? O?.columns ?? [];
11569
11590
  }, [
11570
11591
  i,
11571
11592
  O?.default_columns,
11572
11593
  O?.columns
11573
- ]), Je = J(() => Dr({
11594
+ ]), Ye = J(() => Dr({
11574
11595
  entity: A,
11575
11596
  screen: O,
11576
- savedViewColumns: Ge?.columns
11597
+ savedViewColumns: Ke?.columns
11577
11598
  }), [
11578
11599
  A,
11579
11600
  O,
11580
- Ge?.columns
11581
- ]), Ye = J(() => nr({
11601
+ Ke?.columns
11602
+ ]), Xe = J(() => nr({
11582
11603
  entity: A,
11583
11604
  screen: O,
11584
- presentation: Ke,
11605
+ presentation: Je,
11585
11606
  visibleColumns: R,
11586
- card: Je,
11607
+ card: Ye,
11587
11608
  rowActions: M,
11588
11609
  toolbarActions: he,
11589
11610
  bulkActions: ge,
@@ -11592,54 +11613,54 @@ function $l({ screenCode: e }) {
11592
11613
  }), [
11593
11614
  A,
11594
11615
  O,
11595
- Ke,
11596
- R,
11597
11616
  Je,
11617
+ R,
11618
+ Ye,
11598
11619
  M,
11599
11620
  he,
11600
11621
  ge,
11601
11622
  I,
11602
11623
  s?.screens
11603
- ]), Xe = Ye.expandFields, Ze = Ye.selectFields, $e = {
11604
- page: Ae,
11605
- per_page: je,
11606
- sort: Re,
11607
- search: Ve || void 0,
11624
+ ]), Ze = Xe.expandFields, $e = Xe.selectFields, et = {
11625
+ page: je,
11626
+ per_page: Me,
11627
+ sort: Be,
11628
+ search: He || void 0,
11608
11629
  filters: E.length > 0 ? E : void 0,
11609
11630
  include_deleted: P || void 0,
11610
- expand: Xe,
11611
- select: Ze,
11631
+ expand: Ze,
11632
+ select: $e,
11612
11633
  preview: !0,
11613
11634
  screen: O?.fixed_filters ? e : void 0
11614
- }, B = A?.list_pagination === "cursor", { data: tt, isLoading: nt, isFetching: rt, isError: it, error: at, refetch: ot } = Ee(j, $e, !B), { data: st, isLoading: lt, isError: ut } = Oe(j, $e, !B), dt = {
11615
- sort: Re,
11635
+ }, B = A?.list_pagination === "cursor", { data: nt, isLoading: rt, isFetching: it, isError: at, error: ot, refetch: st } = Ee(j, et, !B), { data: lt, isLoading: ut, isError: dt } = Oe(j, et, !B), pt = {
11636
+ sort: Be,
11616
11637
  filters: E.length > 0 ? E : void 0,
11617
- search: Ve || void 0,
11618
- select: Ze,
11619
- expand: Xe,
11638
+ search: He || void 0,
11639
+ select: $e,
11640
+ expand: Ze,
11620
11641
  includeDeleted: P || void 0,
11621
11642
  screen: O?.fixed_filters ? e : void 0,
11622
11643
  preview: !0,
11623
- limit: je
11624
- }, V = ii(j, dt, B);
11625
- ln(ne(j, $e), !B), ln(ai(j, dt), B);
11626
- let pt = B ? V.isLoading : nt, mt = B ? V.isFetching : rt, ht = B ? V.isError : it, vt = B ? V.error : at, yt = B ? V.total : st?.meta?.total, bt = B ? V.countMode : st?.meta?.count_mode, xt = B ? V.isLoading : lt, St = !B && ut, Ct = Ul(pt, `${j ?? ""}|${i.toString()}`), wt = K(() => {
11627
- j && r.cancelQueries({ queryKey: ["entity-data", j] }), B ? V.refetch() : ot();
11644
+ limit: Me
11645
+ }, H = ii(j, pt, B);
11646
+ ln(ne(j, et), !B), ln(ai(j, pt), B);
11647
+ let mt = B ? H.isLoading : rt, ht = B ? H.isFetching : it, vt = B ? H.isError : at, yt = B ? H.error : ot, bt = B ? H.total : lt?.meta?.total, xt = B ? H.countMode : lt?.meta?.count_mode, St = B ? H.isLoading : ut, Ct = !B && dt, wt = Ul(mt, `${j ?? ""}|${i.toString()}`), Tt = K(() => {
11648
+ j && r.cancelQueries({ queryKey: ["entity-data", j] }), B ? H.refetch() : st();
11628
11649
  }, [
11629
11650
  j,
11630
11651
  r,
11631
- ot,
11652
+ st,
11632
11653
  B,
11633
- V
11634
- ]), Tt = zn((e) => e.degradedEntities), Et = Ln(A?.realtime, Tt, j ?? ""), Dt = pr(j ?? ""), Ot = In("view"), kt = pr("view"), At = J(() => I.map((e) => ({
11654
+ H
11655
+ ]), Et = zn((e) => e.degradedEntities), Dt = Ln(A?.realtime, Et, j ?? ""), Ot = pr(j ?? ""), kt = In("view"), At = pr("view"), jt = J(() => I.map((e) => ({
11635
11656
  id: e.field,
11636
11657
  desc: e.dir === "desc"
11637
- })), [I]), jt = J(() => A?.fields.names().find((e) => A.fields.get(e)?.primary) ?? "id", [A]), Nt = K((e) => A ? Jl(A, e) : y(e[jt]), [A, jt]), Pt = B ? V.refs : tt?.$refs, Ft = Y(Pt);
11638
- Ft.current = Pt;
11639
- let Rt = J(() => {
11658
+ })), [I]), Nt = J(() => A?.fields.names().find((e) => A.fields.get(e)?.primary) ?? "id", [A]), Pt = K((e) => A ? Jl(A, e) : y(e[Nt]), [A, Nt]), Ft = B ? H.refs : nt?.$refs, Rt = Y(Ft);
11659
+ Rt.current = Ft;
11660
+ let zt = J(() => {
11640
11661
  let e = /* @__PURE__ */ new Map();
11641
11662
  if (!A) return e;
11642
- for (let t of Je.renderFields) {
11663
+ for (let t of Ye.renderFields) {
11643
11664
  if (t.startsWith("$") || A.files?.get(t)) continue;
11644
11665
  let n = A.fields.get(t);
11645
11666
  n && e.set(t, le({
@@ -11649,23 +11670,23 @@ function $l({ screenCode: e }) {
11649
11670
  entity: A,
11650
11671
  entities: s?.entities,
11651
11672
  screens: s?.screens,
11652
- refs: () => Ft.current,
11673
+ refs: () => Rt.current,
11653
11674
  locale: c
11654
11675
  }));
11655
11676
  }
11656
11677
  return e;
11657
11678
  }, [
11658
11679
  A,
11659
- Je.renderFields,
11680
+ Ye.renderFields,
11660
11681
  s?.entities,
11661
11682
  s?.screens,
11662
- Ft,
11683
+ Rt,
11663
11684
  c
11664
- ]), { labelFor: zt, refs: Bt } = fl(Be, E, Pt, s?.entities), [Vt, Ht] = X(null), Ut = O?.on_row_click === "peek" && O.quick_peek?.enabled !== !1 && He.category !== "phone", Wt = J(() => !O || !A ? !1 : qe(O, "_", A, s?.screens) !== null, [
11685
+ ]), { labelFor: Bt, refs: Vt } = fl(Ve, E, Ft, s?.entities), [Ht, Ut] = X(null), Wt = O?.on_row_click === "peek" && O.quick_peek?.enabled !== !1 && Ue.category !== "phone", Gt = J(() => !O || !A ? !1 : qe(O, "_", A, s?.screens) !== null, [
11665
11686
  O,
11666
11687
  A,
11667
11688
  s?.screens
11668
- ]), Gt = J(() => Ol({
11689
+ ]), Kt = J(() => Ol({
11669
11690
  visibleCols: R,
11670
11691
  entity: A,
11671
11692
  screen: O,
@@ -11676,13 +11697,13 @@ function $l({ screenCode: e }) {
11676
11697
  hasExplicitRowActions: _e,
11677
11698
  canUpdate: fe,
11678
11699
  canDelete: pe,
11679
- peekEnabled: Ut,
11680
- hasDetailTarget: Wt,
11700
+ peekEnabled: Wt,
11701
+ hasDetailTarget: Gt,
11681
11702
  userLocale: c,
11682
11703
  tabNavigate: t,
11683
- refsRef: Ft,
11704
+ refsRef: Rt,
11684
11705
  rowSelectionKey: Jl,
11685
- setPeekRow: Ht
11706
+ setPeekRow: Ut
11686
11707
  }), [
11687
11708
  O,
11688
11709
  A,
@@ -11692,46 +11713,46 @@ function $l({ screenCode: e }) {
11692
11713
  M,
11693
11714
  _e,
11694
11715
  j,
11695
- Ut,
11696
11716
  Wt,
11717
+ Gt,
11697
11718
  s,
11698
11719
  c,
11699
11720
  fe,
11700
11721
  pe,
11701
- Ft
11702
- ]), Kt = J(() => B ? V.rows : tt?.data ?? [], [
11722
+ Rt
11723
+ ]), qt = J(() => B ? H.rows : nt?.data ?? [], [
11703
11724
  B,
11704
- V.rows,
11705
- tt?.data
11706
- ]), qt = tt?.meta, Jt = J(() => {
11707
- if (!(B || yt === void 0 || je <= 0)) return Math.max(1, Math.ceil(yt / je));
11725
+ H.rows,
11726
+ nt?.data
11727
+ ]), Jt = nt?.meta, Yt = J(() => {
11728
+ if (!(B || bt === void 0 || Me <= 0)) return Math.max(1, Math.ceil(bt / Me));
11708
11729
  }, [
11709
11730
  B,
11710
- yt,
11711
- je
11712
- ]), Yt = B ? V.hasMore : qt?.has_more ?? (Jt !== void 0 && Ae < Jt), { widths: Xt, prune: Zt, setWidths: Qt, resetWidths: $t, resizeEduShown: en, markResizeEduShown: tn } = Jn(e), [nn, rn] = X(() => Xt);
11731
+ bt,
11732
+ Me
11733
+ ]), Xt = B ? H.hasMore : Jt?.has_more ?? (Yt !== void 0 && je < Yt), { widths: Zt, prune: Qt, setWidths: $t, resetWidths: en, resizeEduShown: tn, markResizeEduShown: nn } = Jn(e), [rn, an] = X(() => Zt);
11713
11734
  q(() => {
11714
- rn(Xt);
11715
- }, [Xt]);
11716
- let an = J(() => O?.columns ?? [], [O?.columns]);
11735
+ an(Zt);
11736
+ }, [Zt]);
11737
+ let on = J(() => O?.columns ?? [], [O?.columns]);
11717
11738
  q(() => {
11718
- an.length > 0 && Zt(an);
11719
- }, [an, Zt]);
11720
- let on = K((e) => {
11739
+ on.length > 0 && Qt(on);
11740
+ }, [on, Qt]);
11741
+ let sn = K((e) => {
11721
11742
  if (e.length === 0) return;
11722
11743
  let t = new URLSearchParams(i);
11723
11744
  t.set("columns", e.join(",")), a(t);
11724
- }, [i, a]), sn = K(() => {
11745
+ }, [i, a]), un = K(() => {
11725
11746
  let e = new URLSearchParams(i);
11726
11747
  e.delete("columns"), a(e);
11727
- }, [i, a]), un = K((e, t) => {
11748
+ }, [i, a]), pn = K((e, t) => {
11728
11749
  let n = R.indexOf(e);
11729
11750
  if (n === -1) return;
11730
11751
  let r = t === "up" ? n - 1 : n + 1;
11731
11752
  if (r < 0 || r >= R.length) return;
11732
11753
  let i = [...R];
11733
- [i[n], i[r]] = [i[r], i[n]], on(i);
11734
- }, [R, on]), pn = K((e) => {
11754
+ [i[n], i[r]] = [i[r], i[n]], sn(i);
11755
+ }, [R, sn]), mn = K((e) => {
11735
11756
  let t = new URLSearchParams(i), n = ql(i);
11736
11757
  e.id ? (n.set("view", e.id), e.filters && Array.isArray(e.filters) && e.filters.length > 0 && n.set("filters", JSON.stringify(e.filters)), e.columns && e.columns.length > 0 && n.set("columns", e.columns.join(",")), e.sort && n.set("sort", e.sort), n.set("page", "1")) : typeof window < "u" && window.sessionStorage?.setItem(se, "1"), a(n);
11737
11758
  let r = t.get("view"), o = r ? ae.find((e) => e.id === r) : void 0, s = (o?.columns?.length ? o.columns : O?.default_columns ?? O?.columns ?? []).join(",");
@@ -11746,88 +11767,92 @@ function $l({ screenCode: e }) {
11746
11767
  ae,
11747
11768
  O?.default_columns,
11748
11769
  O?.columns
11749
- ]), mn = Ii({
11750
- data: Kt,
11751
- columns: Gt,
11770
+ ]), gn = K((e) => {
11771
+ let t = e.slice(0, 5), n = new URLSearchParams(i);
11772
+ t.length === 0 ? n.delete("sort") : n.set("sort", Gn(t)), n.set("page", "1"), Ae(n.toString()), a(n);
11773
+ }, [
11774
+ i,
11775
+ Ae,
11776
+ a
11777
+ ]), _n = Ii({
11778
+ data: qt,
11779
+ columns: Kt,
11752
11780
  getCoreRowModel: Fi(),
11753
11781
  manualSorting: !0,
11754
11782
  manualPagination: !0,
11755
11783
  enableColumnResizing: !0,
11756
11784
  columnResizeMode: "onChange",
11757
- onColumnSizingChange: rn,
11785
+ onColumnSizingChange: an,
11758
11786
  state: {
11759
- sorting: At,
11787
+ sorting: jt,
11760
11788
  rowSelection: l,
11761
- columnSizing: nn
11789
+ columnSizing: rn
11762
11790
  },
11763
11791
  onSortingChange: (e) => {
11764
- let t = (typeof e == "function" ? e(At) : e).slice(0, 5), n = new URLSearchParams(i);
11765
- if (t.length === 0) n.delete("sort");
11766
- else {
11767
- let e = t.map((e) => {
11768
- let t = Ie.get(e.id);
11769
- return {
11770
- field: e.id,
11771
- dir: e.desc ? "desc" : "asc",
11772
- ...t ? { nulls: t } : {}
11773
- };
11774
- });
11775
- n.set("sort", Gn(e));
11792
+ let t = (typeof e == "function" ? e(jt) : e).slice(0, 5);
11793
+ if (t.length === 0) {
11794
+ gn([]);
11795
+ return;
11776
11796
  }
11777
- n.set("page", "1"), a(n);
11797
+ let n = t.map((e) => {
11798
+ let t = Re.get(e.id);
11799
+ return {
11800
+ field: e.id,
11801
+ dir: e.desc ? "desc" : "asc",
11802
+ ...t ? { nulls: t } : {}
11803
+ };
11804
+ });
11805
+ gn(n);
11778
11806
  },
11779
11807
  onRowSelectionChange: u,
11780
- getRowId: Nt,
11781
- rowCount: yt ?? Kt.length
11782
- }), gn = mn.getState().columnSizingInfo.isResizingColumn, _n = Y(!1);
11808
+ getRowId: Pt,
11809
+ rowCount: bt ?? qt.length
11810
+ }), bn = _n.getState().columnSizingInfo.isResizingColumn, xn = Y(!1);
11783
11811
  q(() => {
11784
- let e = !!_n.current && !gn;
11785
- _n.current = gn, e && (Qt(mn.getState().columnSizing), en || (tn(), z.info("Column width saved on this device", "Widths are personal and never shared. Column order, sort and filters can be saved into a view.")));
11812
+ let e = !!xn.current && !bn;
11813
+ xn.current = bn, e && ($t(_n.getState().columnSizing), tn || (nn(), z.info("Column width saved on this device", "Widths are personal and never shared. Column order, sort and filters can be saved into a view.")));
11786
11814
  }, [
11787
- gn,
11788
- Qt,
11789
- en,
11815
+ bn,
11816
+ $t,
11790
11817
  tn,
11791
- mn
11818
+ nn,
11819
+ _n
11792
11820
  ]);
11793
- let bn = bl(mn), xn = mn.getTotalSize(), Sn = J(() => Object.keys(l).filter((e) => l[e]), [l]), Cn = J(() => Yl(A, Kt, Sn), [
11821
+ let Sn = bl(_n), Cn = _n.getTotalSize(), wn = J(() => Object.keys(l).filter((e) => l[e]), [l]), En = J(() => Yl(A, qt, wn), [
11794
11822
  A,
11795
- Kt,
11796
- Sn
11797
- ]), wn = K((e) => {
11798
- let t = e.slice(0, 5), n = new URLSearchParams(i);
11799
- t.length === 0 ? n.delete("sort") : n.set("sort", Gn(t)), n.set("page", "1"), a(n);
11800
- }, [i, a]), En = K((e, t, n) => {
11801
- wn([{
11823
+ qt,
11824
+ wn
11825
+ ]), Dn = K((e, t, n) => {
11826
+ gn([{
11802
11827
  field: e,
11803
11828
  dir: t,
11804
11829
  ...n ? { nulls: n } : {}
11805
11830
  }]);
11806
- }, [wn]), Dn = K((e) => {
11807
- wn(Fr(I, e));
11808
- }, [I, wn]), On = K((e, t, n) => {
11809
- wn(Nr(I, {
11831
+ }, [gn]), On = K((e) => {
11832
+ gn(Fr(I, e));
11833
+ }, [I, gn]), kn = K((e, t, n) => {
11834
+ gn(Nr(I, {
11810
11835
  field: e,
11811
11836
  dir: t,
11812
11837
  ...n ? { nulls: n } : {}
11813
11838
  }));
11814
- }, [I, wn]), kn = K((e) => {
11815
- wn(Pr(I, e));
11816
- }, [I, wn]), An = K(() => {
11817
- wn([]);
11818
- }, [wn]);
11839
+ }, [I, gn]), An = K((e) => {
11840
+ gn(Pr(I, e));
11841
+ }, [I, gn]), jn = K(() => {
11842
+ gn([]);
11843
+ }, [gn]);
11819
11844
  q(() => {
11820
- mt || u((e) => {
11845
+ ht || u((e) => {
11821
11846
  let t = Object.keys(e);
11822
11847
  if (t.length === 0) return e;
11823
- let n = new Set(Kt.map((e) => Nt(e))), r = {}, i = !1;
11848
+ let n = new Set(qt.map((e) => Pt(e))), r = {}, i = !1;
11824
11849
  for (let a of t) n.has(a) ? r[a] = e[a] : i = !0;
11825
11850
  return i ? r : e;
11826
11851
  });
11827
11852
  }, [
11828
- Kt,
11829
- mt,
11830
- Nt,
11853
+ qt,
11854
+ ht,
11855
+ Pt,
11831
11856
  u
11832
11857
  ]), q(() => {
11833
11858
  let e = (e) => {
@@ -11840,61 +11865,61 @@ function $l({ screenCode: e }) {
11840
11865
  };
11841
11866
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
11842
11867
  }, []);
11843
- let jn = Y(null), { rows: Mn } = mn.getRowModel(), Nn = Y(null), Fn = Nl({
11868
+ let Mn = Y(null), { rows: Nn } = _n.getRowModel(), Fn = Y(null), Rn = Nl({
11844
11869
  visibleCols: R,
11845
- onReorder: on,
11846
- scrollElRef: jn,
11847
- theadRef: Nn
11848
- }), Rn = G((e) => e.density), Hn = G((e) => e.zebra), Un = vn(), Wn = Li({
11849
- count: Mn.length,
11850
- getScrollElement: () => jn.current,
11851
- estimateSize: () => Ke === "cards" ? 142 : 48,
11870
+ onReorder: sn,
11871
+ scrollElRef: Mn,
11872
+ theadRef: Fn
11873
+ }), Hn = G((e) => e.density), Un = G((e) => e.zebra), Wn = vn(), Xn = Li({
11874
+ count: Nn.length,
11875
+ getScrollElement: () => Mn.current,
11876
+ estimateSize: () => Je === "cards" ? 142 : 48,
11852
11877
  overscan: 10,
11853
- initialOffset: Un
11878
+ initialOffset: Wn
11854
11879
  });
11855
11880
  Tn({
11856
- virtualizer: Wn,
11857
- scrollElementRef: jn,
11858
- rowKeys: J(() => Mn.map((e) => e.id), [Mn])
11881
+ virtualizer: Xn,
11882
+ scrollElementRef: Mn,
11883
+ rowKeys: J(() => Nn.map((e) => e.id), [Nn])
11859
11884
  }), q(() => {
11860
- Wn.measure();
11861
- }, [Rn, Wn]), q(() => {
11862
- Wn.measure();
11885
+ Xn.measure();
11886
+ }, [Hn, Xn]), q(() => {
11887
+ Xn.measure();
11863
11888
  }, [
11864
- He.width,
11865
- He.height,
11866
- Ke,
11867
- Wn
11889
+ Ue.width,
11890
+ Ue.height,
11891
+ Je,
11892
+ Xn
11868
11893
  ]);
11869
- let Xn = K((e) => {
11894
+ let Qn = K((e) => {
11870
11895
  a((t) => {
11871
11896
  let n = new URLSearchParams(t);
11872
11897
  return e ? n.set("search", e) : n.delete("search"), n.set("page", "1"), n;
11873
11898
  });
11874
- }, [a]), Qn = K(() => {
11899
+ }, [a]), $n = K(() => {
11875
11900
  a((e) => {
11876
11901
  let t = new URLSearchParams(e);
11877
11902
  return t.get("include_deleted") ? t.delete("include_deleted") : t.set("include_deleted", "true"), t.set("page", "1"), t;
11878
11903
  });
11879
- }, [a]), $n = K((e) => {
11904
+ }, [a]), er = K((e) => {
11880
11905
  a((t) => {
11881
11906
  let n = new URLSearchParams(t);
11882
11907
  return n.set("page", String(e)), n;
11883
11908
  });
11884
11909
  }, [a]);
11885
11910
  q(() => {
11886
- Jt !== void 0 && Ae > Jt && $n(Jt);
11911
+ Yt !== void 0 && je > Yt && er(Yt);
11887
11912
  }, [
11888
- Jt,
11889
- Ae,
11890
- $n
11913
+ Yt,
11914
+ je,
11915
+ er
11891
11916
  ]);
11892
- let er = K((e) => {
11917
+ let rr = K((e) => {
11893
11918
  a((t) => {
11894
11919
  let n = new URLSearchParams(t);
11895
11920
  return n.set("per_page", String(e)), n.set("page", "1"), n;
11896
11921
  });
11897
- }, [a]), rr = K((e, n) => {
11922
+ }, [a]), ir = K((e, n) => {
11898
11923
  if (!A || !O) return;
11899
11924
  let r = It(A, e), a = de(A, r), o = Pe(O, A, s?.screens, r);
11900
11925
  if (!o) return;
@@ -11904,17 +11929,7 @@ function $l({ screenCode: e }) {
11904
11929
  r.set("edit", "true"), o = `${e}?${r.toString()}`;
11905
11930
  }
11906
11931
  let c = f(e, A) ?? N(A.display.name), l = O.display?.icon || A.display.icon;
11907
- if (O.route && !Ce.enabled) {
11908
- let e = i.toString(), t = De(O.route);
11909
- t ? Te(t.id, e) : we({
11910
- pathname: O.route,
11911
- search: e,
11912
- title: N(O.display?.name) || N(A.display.name_plural),
11913
- icon: l,
11914
- closable: !0
11915
- });
11916
- }
11917
- t(o, {
11932
+ Ae(i.toString()), t(o, {
11918
11933
  title: c,
11919
11934
  icon: l
11920
11935
  });
@@ -11922,26 +11937,23 @@ function $l({ screenCode: e }) {
11922
11937
  A,
11923
11938
  O,
11924
11939
  s,
11925
- Ce.enabled,
11926
- De,
11927
- we,
11928
11940
  i,
11929
11941
  t,
11930
- Te
11931
- ]), ir = K((e, t) => {
11942
+ Ae
11943
+ ]), ar = K((e, t) => {
11932
11944
  if (e.target.closest("a, button, input, select, [role='button'], [role='menuitem']")) return;
11933
- if (!Ut || !A) {
11934
- rr(t);
11945
+ if (!Wt || !A) {
11946
+ ir(t);
11935
11947
  return;
11936
11948
  }
11937
11949
  let n = Jl(A, t);
11938
11950
  if (Uc(T.current, n) === "double") {
11939
- clearTimeout(T.current.timer), T.current = null, Ht(null), rr(t);
11951
+ clearTimeout(T.current.timer), T.current = null, Ut(null), ir(t);
11940
11952
  return;
11941
11953
  }
11942
11954
  T.current && clearTimeout(T.current.timer);
11943
11955
  let r = setTimeout(() => {
11944
- T.current = null, Ht(t);
11956
+ T.current = null, Ut(t);
11945
11957
  }, 250);
11946
11958
  T.current = {
11947
11959
  rowId: n,
@@ -11949,9 +11961,9 @@ function $l({ screenCode: e }) {
11949
11961
  };
11950
11962
  }, [
11951
11963
  A,
11952
- Ut,
11953
- rr
11954
- ]), ar = J(() => !Ut || !A || !Vt ? [] : mr(A, O, s?.screens).map((e) => {
11964
+ Wt,
11965
+ ir
11966
+ ]), or = J(() => !Wt || !A || !Ht ? [] : mr(A, O, s?.screens).map((e) => {
11955
11967
  if (A.files?.get(e)) return {
11956
11968
  key: e,
11957
11969
  label: Bn(A, e, s?.entities),
@@ -11967,19 +11979,19 @@ function $l({ screenCode: e }) {
11967
11979
  readOnly: !n
11968
11980
  };
11969
11981
  }), [
11970
- Ut,
11971
- Vt,
11982
+ Wt,
11983
+ Ht,
11972
11984
  A,
11973
11985
  O,
11974
11986
  s?.entities,
11975
11987
  s?.screens,
11976
11988
  fe
11977
- ]), or = J(() => A?.actions ? A.actions : {}, [A?.actions]), sr = K(async (e, t, n) => {
11978
- let r = A?.fields.names().find((e) => A.fields.get(e)?.primary), i = r && Vt ? [y(Vt[r])] : void 0;
11989
+ ]), sr = J(() => A?.actions ? A.actions : {}, [A?.actions]), cr = K(async (e, t, n) => {
11990
+ let r = A?.fields.names().find((e) => A.fields.get(e)?.primary), i = r && Ht ? [y(Ht[r])] : void 0;
11979
11991
  return Lt(t.entity ? `${t.entity}.${e}` : e, Fe(n, i));
11980
- }, [A, Vt]);
11992
+ }, [A, Ht]);
11981
11993
  if (!O || !A) return null;
11982
- let cr = A.display, lr = N(O.display?.name) || N(cr.name), ur = O.display?.icon || cr.icon, fr = N(O.display?.description) || N(cr.description), hr = He.category === "phone", gr = Ke === "cards", _r = !hr || g || Me !== "", vr = (e) => {
11994
+ let lr = A.display, ur = N(O.display?.name) || N(lr.name), fr = O.display?.icon || lr.icon, hr = N(O.display?.description) || N(lr.description), gr = Ue.category === "phone", _r = Je === "cards", vr = !gr || g || Ne !== "", yr = (e) => {
11983
11995
  if (e.startsWith("$status.")) {
11984
11996
  let t = e.slice(8), n = A.status_groups?.[t];
11985
11997
  return n ? N(n.name) || t : e;
@@ -11989,19 +12001,19 @@ function $l({ screenCode: e }) {
11989
12001
  return n ? N(n.name) || t : e;
11990
12002
  }
11991
12003
  return Bn(A, e, s?.entities);
11992
- }, yr = (O.columns ?? []).filter((e) => Kl(e, A)), br = Cn.map((e) => de(A, e)), xr = [];
11993
- if (Sn.length > 0) {
12004
+ }, br = (O.columns ?? []).filter((e) => Kl(e, A)), xr = En.map((e) => de(A, e)), Sr = [];
12005
+ if (wn.length > 0) {
11994
12006
  let e = /* @__PURE__ */ new Map();
11995
- for (let t of Kt) e.set(Nt(t), t);
11996
- xr = Sn.map((t) => e.get(t)).filter((e) => e !== void 0);
12007
+ for (let t of qt) e.set(Pt(t), t);
12008
+ Sr = wn.map((t) => e.get(t)).filter((e) => e !== void 0);
11997
12009
  }
11998
- let Sr = {
12010
+ let Cr = {
11999
12011
  entity: A,
12000
12012
  entityCode: j ?? "",
12001
12013
  screen: O,
12002
12014
  screenRoute: O.route,
12003
- selectedRows: xr,
12004
- selectedIds: br,
12015
+ selectedRows: Sr,
12016
+ selectedIds: xr,
12005
12017
  locale: c,
12006
12018
  tabNavigate: (e, n) => t(e, {
12007
12019
  title: n?.title,
@@ -12009,21 +12021,21 @@ function $l({ screenCode: e }) {
12009
12021
  search: n?.search
12010
12022
  }),
12011
12023
  runActionApi: (e, t) => Lt(e, t)
12012
- }, Cr = (e, t) => {
12024
+ }, Tr = (e, t) => {
12013
12025
  let n = xe && e.original[A.soft_delete] != null, r = e.getIsSelected();
12014
12026
  return /* @__PURE__ */ $("tr", {
12015
12027
  "data-index": t,
12016
- "data-row-stripe": Hn && t % 2 == 1 ? "" : void 0,
12028
+ "data-row-stripe": Un && t % 2 == 1 ? "" : void 0,
12017
12029
  "aria-selected": r,
12018
- ref: (e) => Wn.measureElement(e),
12030
+ ref: (e) => Xn.measureElement(e),
12019
12031
  style: {
12020
12032
  height: "var(--row-h)",
12021
- cursor: Wt || Ut ? "pointer" : "default",
12033
+ cursor: Gt || Wt ? "pointer" : "default",
12022
12034
  opacity: n ? .5 : 1,
12023
12035
  fontStyle: n ? "italic" : "normal",
12024
12036
  transition: "background-color 120ms"
12025
12037
  },
12026
- onClick: Wt || Ut ? (t) => ir(t, e.original) : void 0,
12038
+ onClick: Gt || Wt ? (t) => ar(t, e.original) : void 0,
12027
12039
  onContextMenu: (t) => {
12028
12040
  t.preventDefault(), w({
12029
12041
  x: t.clientX,
@@ -12036,7 +12048,7 @@ function $l({ screenCode: e }) {
12036
12048
  style: { borderBottom: "1px solid var(--divider)" }
12037
12049
  })]
12038
12050
  }, e.id);
12039
- }, Tr = (e) => {
12051
+ }, Er = (e) => {
12040
12052
  if (e.startsWith("$status.")) {
12041
12053
  let t = e.slice(8), n = A.status_groups?.[t];
12042
12054
  return n ? N(n.name) || t : e;
@@ -12046,7 +12058,7 @@ function $l({ screenCode: e }) {
12046
12058
  return n ? N(n.name) || t : e;
12047
12059
  }
12048
12060
  return Bn(A, e, s?.entities);
12049
- }, Er = (e, t) => {
12061
+ }, Or = (e, t) => {
12050
12062
  if (e.startsWith("$status.")) {
12051
12063
  let n = e.slice(8), r = t.$statuses;
12052
12064
  return Array.isArray(r) && r.some((e) => e.group_code === n);
@@ -12057,7 +12069,7 @@ function $l({ screenCode: e }) {
12057
12069
  }
12058
12070
  let n = Vn(A, t, e);
12059
12071
  return n != null && y(n) !== "";
12060
- }, Or = (e, t) => {
12072
+ }, kr = (e, t) => {
12061
12073
  if (e.startsWith("$status.")) {
12062
12074
  let n = e.slice(8), r = A.status_groups?.[n], i = t.$statuses, a = Array.isArray(i) ? i.find((e) => e.group_code === n) : void 0;
12063
12075
  if (!r || !a) return /* @__PURE__ */ Q("span", {
@@ -12065,7 +12077,7 @@ function $l({ screenCode: e }) {
12065
12077
  children: "-"
12066
12078
  });
12067
12079
  let o = r.statuses.find((e) => e.code === a.status_code);
12068
- return /* @__PURE__ */ Q(H, {
12080
+ return /* @__PURE__ */ Q(V, {
12069
12081
  tone: o?.color ?? "slate",
12070
12082
  size: "xs",
12071
12083
  children: N(o?.name) || a.status_code
@@ -12085,10 +12097,10 @@ function $l({ screenCode: e }) {
12085
12097
  record: t,
12086
12098
  mode: "display",
12087
12099
  surface: "list",
12088
- refs: Ft.current,
12100
+ refs: Rt.current,
12089
12101
  locale: c
12090
12102
  });
12091
- let n = Rt.get(e);
12103
+ let n = zt.get(e);
12092
12104
  if (!n) {
12093
12105
  let n = t[e];
12094
12106
  return y(n) || /* @__PURE__ */ Q("span", {
@@ -12097,12 +12109,12 @@ function $l({ screenCode: e }) {
12097
12109
  });
12098
12110
  }
12099
12111
  return n(t[e], t);
12100
- }, kr = (e, n) => {
12101
- let r = e.original, i = xe && r[A.soft_delete] != null, a = e.getIsSelected(), o = Hn && n % 2 == 1, s = Wt || Ut, l = (Je.titleUsesDisplay ? f(r, A) ?? (Je.titleField ? null : Nt(r)) : null) || (Je.titleField ? Or(Je.titleField, r) : Nt(r)), u = Je.badgeFields.filter((e) => !Je.hideEmptyFields || Er(e, r)), d = Je.bodyFields.filter((e) => !Je.hideEmptyFields || Er(e, r)), p = Je.metaFields.filter((e) => !Je.hideEmptyFields || Er(e, r));
12112
+ }, Ar = (e, n) => {
12113
+ let r = e.original, i = xe && r[A.soft_delete] != null, a = e.getIsSelected(), o = Un && n % 2 == 1, s = Gt || Wt, l = (Ye.titleUsesDisplay ? f(r, A) ?? (Ye.titleField ? null : Pt(r)) : null) || (Ye.titleField ? kr(Ye.titleField, r) : Pt(r)), u = Ye.badgeFields.filter((e) => !Ye.hideEmptyFields || Or(e, r)), d = Ye.bodyFields.filter((e) => !Ye.hideEmptyFields || Or(e, r)), p = Ye.metaFields.filter((e) => !Ye.hideEmptyFields || Or(e, r));
12102
12114
  return /* @__PURE__ */ Q("div", {
12103
12115
  "data-index": n,
12104
12116
  "data-testid": "list-card",
12105
- ref: (e) => Wn.measureElement(e),
12117
+ ref: (e) => Xn.measureElement(e),
12106
12118
  style: {
12107
12119
  padding: "6px 10px",
12108
12120
  boxSizing: "border-box"
@@ -12125,14 +12137,14 @@ function $l({ screenCode: e }) {
12125
12137
  cursor: s ? "pointer" : "default"
12126
12138
  },
12127
12139
  tabIndex: s ? 0 : void 0,
12128
- onClick: s ? (e) => ir(e, r) : void 0,
12140
+ onClick: s ? (e) => ar(e, r) : void 0,
12129
12141
  onKeyDown: s ? (e) => {
12130
12142
  if (e.key === "Enter") {
12131
- if (e.preventDefault(), Ut) {
12132
- Ht(r);
12143
+ if (e.preventDefault(), Wt) {
12144
+ Ut(r);
12133
12145
  return;
12134
12146
  }
12135
- rr(r);
12147
+ ir(r);
12136
12148
  }
12137
12149
  } : void 0,
12138
12150
  onContextMenu: (e) => {
@@ -12175,7 +12187,7 @@ function $l({ screenCode: e }) {
12175
12187
  overflowWrap: "anywhere"
12176
12188
  },
12177
12189
  children: l
12178
- }), Je.subtitleField && /* @__PURE__ */ Q("div", {
12190
+ }), Ye.subtitleField && /* @__PURE__ */ Q("div", {
12179
12191
  style: {
12180
12192
  marginTop: 3,
12181
12193
  fontSize: 12.5,
@@ -12183,7 +12195,7 @@ function $l({ screenCode: e }) {
12183
12195
  color: "var(--text-3)",
12184
12196
  overflowWrap: "anywhere"
12185
12197
  },
12186
- children: Or(Je.subtitleField, r)
12198
+ children: kr(Ye.subtitleField, r)
12187
12199
  })]
12188
12200
  })
12189
12201
  }),
@@ -12199,7 +12211,7 @@ function $l({ screenCode: e }) {
12199
12211
  display: "inline-flex",
12200
12212
  minWidth: 0
12201
12213
  },
12202
- children: Or(e, r)
12214
+ children: kr(e, r)
12203
12215
  }, e))
12204
12216
  }),
12205
12217
  d.length > 0 && /* @__PURE__ */ Q("dl", {
@@ -12215,7 +12227,7 @@ function $l({ screenCode: e }) {
12215
12227
  style: { display: "contents" },
12216
12228
  children: [/* @__PURE__ */ Q("dt", {
12217
12229
  style: { color: "var(--text-3)" },
12218
- children: Tr(e)
12230
+ children: Er(e)
12219
12231
  }), /* @__PURE__ */ Q("dd", {
12220
12232
  style: {
12221
12233
  margin: 0,
@@ -12223,7 +12235,7 @@ function $l({ screenCode: e }) {
12223
12235
  minWidth: 0,
12224
12236
  overflowWrap: "anywhere"
12225
12237
  },
12226
- children: Or(e, r)
12238
+ children: kr(e, r)
12227
12239
  })]
12228
12240
  }, e))
12229
12241
  }),
@@ -12242,9 +12254,9 @@ function $l({ screenCode: e }) {
12242
12254
  overflowWrap: "anywhere"
12243
12255
  },
12244
12256
  children: [
12245
- Tr(e),
12257
+ Er(e),
12246
12258
  ": ",
12247
- Or(e, r)
12259
+ kr(e, r)
12248
12260
  ]
12249
12261
  }, e))
12250
12262
  })
@@ -12252,16 +12264,16 @@ function $l({ screenCode: e }) {
12252
12264
  }),
12253
12265
  /* @__PURE__ */ Q(Tl, {
12254
12266
  row: r,
12255
- rowId: Nt(r),
12267
+ rowId: Pt(r),
12256
12268
  screen: O,
12257
12269
  fullScreen: O,
12258
12270
  entity: A,
12259
12271
  entityCode: j,
12260
12272
  rowActions: M,
12261
12273
  tabNavigate: t,
12262
- peekAllowed: Ut,
12263
- hasDetailTarget: Wt,
12264
- onPeek: Ht,
12274
+ peekAllowed: Wt,
12275
+ hasDetailTarget: Gt,
12276
+ onPeek: Ut,
12265
12277
  locale: c
12266
12278
  })
12267
12279
  ]
@@ -12278,23 +12290,23 @@ function $l({ screenCode: e }) {
12278
12290
  children: [
12279
12291
  /* @__PURE__ */ $(Z, { children: [
12280
12292
  /* @__PURE__ */ Q(hl, {
12281
- title: lr,
12282
- description: fr,
12293
+ title: ur,
12294
+ description: hr,
12283
12295
  toolbarActions: he,
12284
12296
  screenActionLayout: O.action_layout,
12285
12297
  entityActionLayout: A.action_layout,
12286
- selectedIds: Sn,
12287
- data: Kt,
12288
- rowKey: Nt,
12298
+ selectedIds: wn,
12299
+ data: qt,
12300
+ rowKey: Pt,
12289
12301
  onActionSuccess: () => u({}),
12290
- widgetContext: Sr
12302
+ widgetContext: Cr
12291
12303
  }),
12292
12304
  /* @__PURE__ */ $("div", {
12293
12305
  style: {
12294
12306
  display: "flex",
12295
12307
  alignItems: "center",
12296
- gap: hr ? 6 : 8,
12297
- padding: hr ? "0 calc(12px + var(--safe-area-right)) 10px calc(12px + var(--safe-area-left))" : "0 20px 10px",
12308
+ gap: gr ? 6 : 8,
12309
+ padding: gr ? "0 calc(12px + var(--safe-area-right)) 10px calc(12px + var(--safe-area-left))" : "0 20px 10px",
12298
12310
  flexWrap: "wrap"
12299
12311
  },
12300
12312
  children: [
@@ -12302,19 +12314,19 @@ function $l({ screenCode: e }) {
12302
12314
  views: ae,
12303
12315
  activeViewId: i.get("view"),
12304
12316
  isDirty: !1,
12305
- onSelect: pn,
12317
+ onSelect: mn,
12306
12318
  onSaveAs: () => h(!0)
12307
12319
  }),
12308
- _r ? /* @__PURE__ */ $("div", {
12320
+ vr ? /* @__PURE__ */ $("div", {
12309
12321
  style: {
12310
12322
  position: "relative",
12311
- width: hr ? "100%" : 260,
12312
- order: hr ? -1 : 0
12323
+ width: gr ? "100%" : 260,
12324
+ order: gr ? -1 : 0
12313
12325
  },
12314
12326
  children: [/* @__PURE__ */ Q(_t, {
12315
- value: Me,
12316
- onChange: Xn,
12317
- placeholder: `Search ${lr.toLowerCase()}…`,
12327
+ value: Ne,
12328
+ onChange: Qn,
12329
+ placeholder: `Search ${ur.toLowerCase()}…`,
12318
12330
  prefix: /* @__PURE__ */ Q(n.search, { size: 13 })
12319
12331
  }), /* @__PURE__ */ Q("span", {
12320
12332
  style: {
@@ -12328,26 +12340,26 @@ function $l({ screenCode: e }) {
12328
12340
  })]
12329
12341
  }) : /* @__PURE__ */ Q(U, {
12330
12342
  icon: /* @__PURE__ */ Q(n.search, { size: 14 }),
12331
- title: `Search ${lr.toLowerCase()}`,
12343
+ title: `Search ${ur.toLowerCase()}`,
12332
12344
  onClick: () => _(!0)
12333
12345
  }),
12334
12346
  /* @__PURE__ */ $(L, {
12335
12347
  icon: /* @__PURE__ */ Q(n.filter, { size: 13 }),
12336
12348
  onClick: () => p(!0),
12337
12349
  active: ee > 0,
12338
- children: ["Filters", ee > 0 && /* @__PURE__ */ Q(H, {
12350
+ children: ["Filters", ee > 0 && /* @__PURE__ */ Q(V, {
12339
12351
  tone: "violet",
12340
12352
  size: "xs",
12341
12353
  style: { marginLeft: 4 },
12342
12354
  children: ee
12343
12355
  })]
12344
12356
  }),
12345
- gr && /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ $(L, {
12357
+ _r && /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ $(L, {
12346
12358
  ref: S,
12347
12359
  icon: /* @__PURE__ */ Q(n.sort, { size: 13 }),
12348
12360
  onClick: () => x((e) => !e),
12349
12361
  active: b || I.length > 0,
12350
- children: ["Sort", I.length > 0 && /* @__PURE__ */ Q(H, {
12362
+ children: ["Sort", I.length > 0 && /* @__PURE__ */ Q(V, {
12351
12363
  tone: "slate",
12352
12364
  size: "xs",
12353
12365
  style: { marginLeft: 4 },
@@ -12371,7 +12383,7 @@ function $l({ screenCode: e }) {
12371
12383
  },
12372
12384
  children: "Sort by"
12373
12385
  }),
12374
- yr.map((e) => {
12386
+ br.map((e) => {
12375
12387
  let t = I.find((t) => t.field === e);
12376
12388
  return /* @__PURE__ */ Q(F, {
12377
12389
  icon: t ? t.dir === "desc" ? /* @__PURE__ */ Q(n.arrowDown, { size: 12 }) : /* @__PURE__ */ Q(n.arrowUp, { size: 12 }) : /* @__PURE__ */ Q("span", { style: {
@@ -12380,32 +12392,32 @@ function $l({ screenCode: e }) {
12380
12392
  } }),
12381
12393
  active: !!t,
12382
12394
  onClick: () => {
12383
- En(e, t?.dir === "asc" ? "desc" : "asc", void 0), x(!1);
12395
+ Dn(e, t?.dir === "asc" ? "desc" : "asc", void 0), x(!1);
12384
12396
  },
12385
- children: vr(e)
12397
+ children: yr(e)
12386
12398
  }, e);
12387
12399
  }),
12388
12400
  I.length > 0 && /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q(F, { divider: !0 }), /* @__PURE__ */ Q(F, {
12389
12401
  icon: /* @__PURE__ */ Q(n.x, { size: 12 }),
12390
12402
  onClick: () => {
12391
- An(), x(!1);
12403
+ jn(), x(!1);
12392
12404
  },
12393
12405
  children: "Clear sort"
12394
12406
  })] })
12395
12407
  ]
12396
12408
  })] }),
12397
- !gr && /* @__PURE__ */ Q(Pl, {
12409
+ !_r && /* @__PURE__ */ Q(Pl, {
12398
12410
  availableColumns: O.columns ?? [],
12399
12411
  visibleColumns: R,
12400
12412
  onToggle: (e) => {
12401
12413
  let t = R.includes(e) ? R.filter((t) => t !== e) : [...R, e];
12402
- on(t);
12414
+ sn(t);
12403
12415
  },
12404
- onMove: un,
12405
- onReset: sn,
12406
- onShowAll: () => on(O.columns ?? []),
12407
- onResetWidths: $t,
12408
- columnLabel: vr
12416
+ onMove: pn,
12417
+ onReset: un,
12418
+ onShowAll: () => sn(O.columns ?? []),
12419
+ onResetWidths: en,
12420
+ columnLabel: yr
12409
12421
  }),
12410
12422
  /* @__PURE__ */ Q("span", { style: {
12411
12423
  width: 1,
@@ -12415,26 +12427,26 @@ function $l({ screenCode: e }) {
12415
12427
  /* @__PURE__ */ Q(U, {
12416
12428
  icon: /* @__PURE__ */ Q(n.grid, { size: 14 }),
12417
12429
  title: "Density",
12418
- active: Rn !== "compact",
12430
+ active: Hn !== "compact",
12419
12431
  onClick: () => {
12420
- let e = Rn === "compact" ? "comfortable" : Rn === "comfortable" ? "cozy" : "compact";
12432
+ let e = Hn === "compact" ? "comfortable" : Hn === "comfortable" ? "cozy" : "compact";
12421
12433
  G.getState().setMany({ density: e });
12422
12434
  }
12423
12435
  }),
12424
12436
  /* @__PURE__ */ Q(U, {
12425
- icon: mt ? /* @__PURE__ */ Q("span", {
12437
+ icon: ht ? /* @__PURE__ */ Q("span", {
12426
12438
  "data-testid": "refresh-spinner",
12427
12439
  style: { display: "inline-flex" },
12428
12440
  children: /* @__PURE__ */ Q(ke, { size: 14 })
12429
12441
  }) : /* @__PURE__ */ Q(n.refresh, { size: 14 }),
12430
12442
  title: "Refresh",
12431
- disabled: pt || mt,
12432
- onClick: wt
12443
+ disabled: mt || ht,
12444
+ onClick: Tt
12433
12445
  }),
12434
- Et && /* @__PURE__ */ Q("span", {
12446
+ Dt && /* @__PURE__ */ Q("span", {
12435
12447
  "data-testid": "live-indicator",
12436
12448
  title: "This view updates automatically in realtime.",
12437
- children: /* @__PURE__ */ Q(H, {
12449
+ children: /* @__PURE__ */ Q(V, {
12438
12450
  tone: "emerald",
12439
12451
  size: "xs",
12440
12452
  dot: !0,
@@ -12446,22 +12458,22 @@ function $l({ screenCode: e }) {
12446
12458
  kind: "ghost",
12447
12459
  size: "sm",
12448
12460
  icon: Q(P ? n.eyeOff : n.eye, { size: 12 }),
12449
- onClick: Qn,
12461
+ onClick: $n,
12450
12462
  active: P,
12451
12463
  children: P ? "Hide deleted" : "Show deleted"
12452
12464
  }),
12453
12465
  j && A && /* @__PURE__ */ Q(fn, {
12454
12466
  entityCode: j,
12455
12467
  scope: "list",
12456
- selectedIds: Sn,
12468
+ selectedIds: wn,
12457
12469
  viewState: {
12458
12470
  screenCode: e,
12459
12471
  jsonFilters: E,
12460
- search: Ve,
12461
- sort: Re,
12472
+ search: He,
12473
+ sort: Be,
12462
12474
  includeDeleted: P || void 0,
12463
- page: Ae,
12464
- perPage: je
12475
+ page: je,
12476
+ perPage: Me
12465
12477
  },
12466
12478
  locale: c,
12467
12479
  capability: A.documents,
@@ -12474,16 +12486,16 @@ function $l({ screenCode: e }) {
12474
12486
  viewState: {
12475
12487
  screenCode: e,
12476
12488
  jsonFilters: E,
12477
- search: Ve,
12478
- sort: Re,
12489
+ search: He,
12490
+ sort: Be,
12479
12491
  includeDeleted: P || void 0,
12480
- page: Ae,
12481
- perPage: je
12492
+ page: je,
12493
+ perPage: Me
12482
12494
  },
12483
12495
  visibleColumns: R,
12484
- selectedRowPKs: Cn,
12485
- totalRows: yt,
12486
- pageSize: je,
12496
+ selectedRowPKs: En,
12497
+ totalRows: bt,
12498
+ pageSize: Me,
12487
12499
  locale: c
12488
12500
  })
12489
12501
  ]
@@ -12492,7 +12504,7 @@ function $l({ screenCode: e }) {
12492
12504
  style: { padding: "0 20px 10px" },
12493
12505
  children: /* @__PURE__ */ Q(Jc, {
12494
12506
  filters: E,
12495
- resolveValue: zt,
12507
+ resolveValue: Bt,
12496
12508
  onRemove: (e) => te(Zr(E, e)),
12497
12509
  onClearAll: re,
12498
12510
  onChipClick: () => p(!0),
@@ -12511,7 +12523,7 @@ function $l({ screenCode: e }) {
12511
12523
  })
12512
12524
  })
12513
12525
  ] }),
12514
- pt && Ct ? /* @__PURE__ */ Q("div", {
12526
+ mt && wt ? /* @__PURE__ */ Q("div", {
12515
12527
  style: { padding: "0 20px" },
12516
12528
  children: /* @__PURE__ */ Q(Ic, {
12517
12529
  icon: "alert-circle",
@@ -12520,34 +12532,34 @@ function $l({ screenCode: e }) {
12520
12532
  action: /* @__PURE__ */ Q(L, {
12521
12533
  kind: "primary",
12522
12534
  size: "sm",
12523
- onClick: wt,
12535
+ onClick: Tt,
12524
12536
  children: "Retry"
12525
12537
  })
12526
12538
  })
12527
- }) : pt ? /* @__PURE__ */ Q(Kn, { cols: O.columns?.length ?? 4 }) : ht ? /* @__PURE__ */ Q("div", {
12539
+ }) : mt ? /* @__PURE__ */ Q(Kn, { cols: O.columns?.length ?? 4 }) : vt ? /* @__PURE__ */ Q("div", {
12528
12540
  style: { padding: "0 20px" },
12529
12541
  children: /* @__PURE__ */ Q(Ic, {
12530
12542
  icon: "alert-circle",
12531
12543
  title: "Failed to load data",
12532
- description: Wl(vt),
12544
+ description: Wl(yt),
12533
12545
  action: /* @__PURE__ */ Q(L, {
12534
12546
  kind: "primary",
12535
12547
  size: "sm",
12536
- onClick: wt,
12548
+ onClick: Tt,
12537
12549
  children: "Retry"
12538
12550
  })
12539
12551
  })
12540
- }) : Kt.length === 0 ? /* @__PURE__ */ Q("div", {
12552
+ }) : qt.length === 0 ? /* @__PURE__ */ Q("div", {
12541
12553
  style: { padding: "0 20px" },
12542
12554
  children: (() => {
12543
- let e = !!Ve || ee > 0, t = cr.empty_state, n = N(t?.title), r = N(t?.body), i = ft(t?.learn_more_url), a = e ? "No results found" : n || `No ${N(cr.name_plural).toLowerCase() || lr.toLowerCase()} yet`, o = ue && he.some(({ code: e }) => e === "__new" || e === "__create"), s;
12555
+ let e = !!He || ee > 0, t = lr.empty_state, n = N(t?.title), r = N(t?.body), i = ft(t?.learn_more_url), a = e ? "No results found" : n || `No ${N(lr.name_plural).toLowerCase() || ur.toLowerCase()} yet`, o = ue && he.some(({ code: e }) => e === "__new" || e === "__create"), s;
12544
12556
  return s = e ? "Try adjusting your search or filters" : r ? /* @__PURE__ */ $(Z, { children: [r, i && /* @__PURE__ */ $(Z, { children: [" ", /* @__PURE__ */ Q("a", {
12545
12557
  href: i,
12546
12558
  target: "_blank",
12547
12559
  rel: "noopener noreferrer",
12548
12560
  children: "Learn more"
12549
- })] })] }) : o ? `Create your first ${N(cr.name).toLowerCase()} to get started` : void 0, /* @__PURE__ */ Q(Ic, {
12550
- icon: ur,
12561
+ })] })] }) : o ? `Create your first ${N(lr.name).toLowerCase()} to get started` : void 0, /* @__PURE__ */ Q(Ic, {
12562
+ icon: fr,
12551
12563
  title: a,
12552
12564
  description: s
12553
12565
  });
@@ -12573,22 +12585,22 @@ function $l({ screenCode: e }) {
12573
12585
  minHeight: 0
12574
12586
  },
12575
12587
  children: [/* @__PURE__ */ Q("div", {
12576
- ref: jn,
12588
+ ref: Mn,
12577
12589
  "data-testid": "list-scroll",
12578
- "data-presentation": Ke,
12590
+ "data-presentation": Je,
12579
12591
  style: {
12580
12592
  overflow: "auto",
12581
12593
  flex: 1,
12582
12594
  minHeight: 0
12583
12595
  },
12584
- children: Ke === "cards" ? /* @__PURE__ */ Q("div", {
12596
+ children: Je === "cards" ? /* @__PURE__ */ Q("div", {
12585
12597
  style: {
12586
- height: Wn.getTotalSize(),
12598
+ height: Xn.getTotalSize(),
12587
12599
  width: "100%",
12588
12600
  position: "relative",
12589
12601
  boxSizing: "border-box"
12590
12602
  },
12591
- children: Wn.getVirtualItems().map((e) => /* @__PURE__ */ Q("div", {
12603
+ children: Xn.getVirtualItems().map((e) => /* @__PURE__ */ Q("div", {
12592
12604
  style: {
12593
12605
  position: "absolute",
12594
12606
  top: 0,
@@ -12597,23 +12609,23 @@ function $l({ screenCode: e }) {
12597
12609
  transform: `translateY(${e.start}px)`,
12598
12610
  boxSizing: "border-box"
12599
12611
  },
12600
- children: kr(Mn[e.index], e.index)
12601
- }, Mn[e.index]?.id ?? e.key))
12612
+ children: Ar(Nn[e.index], e.index)
12613
+ }, Nn[e.index]?.id ?? e.key))
12602
12614
  }) : /* @__PURE__ */ $("table", {
12603
12615
  "data-virtual-rows": "true",
12604
12616
  style: {
12605
- ...bn,
12617
+ ...Sn,
12606
12618
  tableLayout: "fixed",
12607
12619
  width: "100%",
12608
- minWidth: xn,
12620
+ minWidth: Cn,
12609
12621
  borderCollapse: "separate",
12610
12622
  borderSpacing: 0,
12611
12623
  fontSize: 12.5,
12612
12624
  color: "var(--text)"
12613
12625
  },
12614
12626
  children: [/* @__PURE__ */ Q("thead", {
12615
- ref: Nn,
12616
- children: mn.getHeaderGroups().map((e) => /* @__PURE__ */ $("tr", {
12627
+ ref: Fn,
12628
+ children: _n.getHeaderGroups().map((e) => /* @__PURE__ */ $("tr", {
12617
12629
  style: {
12618
12630
  height: 32,
12619
12631
  background: "var(--surface-2)"
@@ -12621,16 +12633,16 @@ function $l({ screenCode: e }) {
12621
12633
  children: [e.headers.map((e) => {
12622
12634
  let t = Kl(e.id, A), r = e.column.getIsSorted(), i = e.id === "_select", a = e.id === "_actions", o = r ? I.findIndex((t) => t.field === e.id) + 1 : 0, s = I.length > 1 && o > 0, c = o > 0, l = I.length < 5, u = t ? e.column.getToggleSortingHandler() : void 0, d = t ? (t) => {
12623
12635
  if (t.shiftKey) {
12624
- t.preventDefault(), Dn(e.id);
12636
+ t.preventDefault(), On(e.id);
12625
12637
  return;
12626
12638
  }
12627
12639
  u?.(t);
12628
- } : void 0, f = !i && !a, p = f ? R.indexOf(e.id) : -1, m = Fn.dragColId === e.id, h = Fn.isDragging && p !== -1 && Fn.dropIndex === p, g = Fn.isDragging && p !== -1 && p === R.length - 1 && Fn.dropIndex === R.length;
12640
+ } : void 0, f = !i && !a, p = f ? R.indexOf(e.id) : -1, m = Rn.dragColId === e.id, h = Rn.isDragging && p !== -1 && Rn.dropIndex === p, g = Rn.isDragging && p !== -1 && p === R.length - 1 && Rn.dropIndex === R.length;
12629
12641
  return /* @__PURE__ */ $("th", {
12630
12642
  "data-col-id": f ? e.id : void 0,
12631
- onMouseDown: f ? (t) => Fn.onHeaderMouseDown(e.id, t) : void 0,
12643
+ onMouseDown: f ? (t) => Rn.onHeaderMouseDown(e.id, t) : void 0,
12632
12644
  onClick: (e) => {
12633
- Fn.consumeDragSuppression() || d?.(e);
12645
+ Rn.consumeDragSuppression() || d?.(e);
12634
12646
  },
12635
12647
  style: {
12636
12648
  padding: i ? "0 6px 0 12px" : a ? "0 6px" : "0 10px",
@@ -12673,7 +12685,7 @@ function $l({ screenCode: e }) {
12673
12685
  children: [r === "asc" ? /* @__PURE__ */ Q(n.arrowUp, { size: 11 }) : r === "desc" ? /* @__PURE__ */ Q(n.arrowDown, { size: 11 }) : /* @__PURE__ */ Q(n.sort, {
12674
12686
  size: 11,
12675
12687
  style: { opacity: .35 }
12676
- }), r && Ie.get(e.id) === "first" ? /* @__PURE__ */ Q("span", {
12688
+ }), r && Re.get(e.id) === "first" ? /* @__PURE__ */ Q("span", {
12677
12689
  "aria-hidden": "true",
12678
12690
  style: {
12679
12691
  width: 4,
@@ -12698,13 +12710,13 @@ function $l({ screenCode: e }) {
12698
12710
  /* @__PURE__ */ Q(Bl, {
12699
12711
  field: e.id,
12700
12712
  activeDir: r,
12701
- activeNulls: Ie.get(e.id),
12713
+ activeNulls: Re.get(e.id),
12702
12714
  inMultiSort: c,
12703
12715
  canAppend: l,
12704
- onApply: (t, n) => En(e.id, t, n),
12705
- onAppend: (t, n) => On(e.id, t, n),
12706
- onClearColumn: () => kn(e.id),
12707
- onClearAll: An
12716
+ onApply: (t, n) => Dn(e.id, t, n),
12717
+ onAppend: (t, n) => kn(e.id, t, n),
12718
+ onClearColumn: () => An(e.id),
12719
+ onClearAll: jn
12708
12720
  })
12709
12721
  ]
12710
12722
  }) : Pi(e.column.columnDef.header, e.getContext()), e.column.getCanResize() && /* @__PURE__ */ Q("div", {
@@ -12751,16 +12763,16 @@ function $l({ screenCode: e }) {
12751
12763
  })]
12752
12764
  }, e.id))
12753
12765
  }), /* @__PURE__ */ Q(zl, {
12754
- virtualItems: Wn.getVirtualItems(),
12755
- topPad: Wn.getVirtualItems()[0]?.start ?? 0,
12756
- bottomPad: Wn.getTotalSize() - (Wn.getVirtualItems().at(-1)?.end ?? 0),
12757
- colSpan: Gt.length + 1,
12758
- rows: Mn,
12759
- renderRow: Cr,
12760
- isResizing: !!gn
12766
+ virtualItems: Xn.getVirtualItems(),
12767
+ topPad: Xn.getVirtualItems()[0]?.start ?? 0,
12768
+ bottomPad: Xn.getTotalSize() - (Xn.getVirtualItems().at(-1)?.end ?? 0),
12769
+ colSpan: Kt.length + 1,
12770
+ rows: Nn,
12771
+ renderRow: Tr,
12772
+ isResizing: !!bn
12761
12773
  })]
12762
12774
  })
12763
- }), (qt || B) && /* @__PURE__ */ $("div", {
12775
+ }), (Jt || B) && /* @__PURE__ */ $("div", {
12764
12776
  style: {
12765
12777
  display: "flex",
12766
12778
  alignItems: "center",
@@ -12772,7 +12784,7 @@ function $l({ screenCode: e }) {
12772
12784
  gap: 12
12773
12785
  },
12774
12786
  children: [
12775
- Ue.isVisible("show_count") && /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q("span", {
12787
+ We.isVisible("show_count") && /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q("span", {
12776
12788
  className: "num",
12777
12789
  "data-testid": "list-footer-count",
12778
12790
  style: {
@@ -12780,20 +12792,20 @@ function $l({ screenCode: e }) {
12780
12792
  alignItems: "center",
12781
12793
  gap: 5
12782
12794
  },
12783
- children: yt === void 0 ? xt && !St ? /* @__PURE__ */ Q("span", {
12795
+ children: bt === void 0 ? St && !Ct ? /* @__PURE__ */ Q("span", {
12784
12796
  "data-testid": "list-footer-count-pending",
12785
12797
  style: { display: "inline-flex" },
12786
12798
  children: /* @__PURE__ */ Q(ke, { size: 11 })
12787
12799
  }) : /* @__PURE__ */ $(Z, { children: [
12788
- Kt.length,
12800
+ qt.length,
12789
12801
  " ",
12790
- Kt.length === 1 ? "record" : "records"
12802
+ qt.length === 1 ? "record" : "records"
12791
12803
  ] }) : /* @__PURE__ */ $(Z, { children: [
12792
- Kt.length,
12804
+ qt.length,
12793
12805
  " of ",
12794
- qc(yt, bt ?? "exact"),
12806
+ qc(bt, xt ?? "exact"),
12795
12807
  " ",
12796
- yt === 1 ? "record" : "records"
12808
+ bt === 1 ? "record" : "records"
12797
12809
  ] })
12798
12810
  }), /* @__PURE__ */ Q("span", { children: "·" })] }),
12799
12811
  /* @__PURE__ */ $("span", { children: [
@@ -12805,15 +12817,15 @@ function $l({ screenCode: e }) {
12805
12817
  color: "var(--text-2)",
12806
12818
  fontWeight: 500
12807
12819
  },
12808
- children: Sn.length
12820
+ children: wn.length
12809
12821
  })
12810
12822
  ] }),
12811
12823
  /* @__PURE__ */ Q("div", { style: { flex: 1 } }),
12812
12824
  /* @__PURE__ */ Q("span", { children: "Rows per page" }),
12813
12825
  /* @__PURE__ */ Q("select", {
12814
12826
  "aria-label": "Rows per page",
12815
- value: je,
12816
- onChange: (e) => er(parseInt(e.target.value, 10)),
12827
+ value: Me,
12828
+ onChange: (e) => rr(parseInt(e.target.value, 10)),
12817
12829
  style: {
12818
12830
  fontSize: 11.5,
12819
12831
  padding: "2px 4px",
@@ -12828,12 +12840,12 @@ function $l({ screenCode: e }) {
12828
12840
  children: e
12829
12841
  }, e))
12830
12842
  }),
12831
- B ? V.hasMore && /* @__PURE__ */ $("button", {
12843
+ B ? H.hasMore && /* @__PURE__ */ $("button", {
12832
12844
  type: "button",
12833
12845
  className: "num",
12834
12846
  "data-testid": "list-footer-load-more",
12835
- onClick: () => void V.fetchNextPage(),
12836
- disabled: V.isFetchingNextPage,
12847
+ onClick: () => void H.fetchNextPage(),
12848
+ disabled: H.isFetchingNextPage,
12837
12849
  style: {
12838
12850
  display: "inline-flex",
12839
12851
  alignItems: "center",
@@ -12843,10 +12855,10 @@ function $l({ screenCode: e }) {
12843
12855
  border: "1px solid var(--border)",
12844
12856
  borderRadius: 4,
12845
12857
  color: "var(--text-2)",
12846
- cursor: V.isFetchingNextPage ? "default" : "pointer"
12858
+ cursor: H.isFetchingNextPage ? "default" : "pointer"
12847
12859
  },
12848
- children: [V.isFetchingNextPage ? /* @__PURE__ */ Q(ke, { size: 11 }) : null, "Load more"]
12849
- }) : (Yt || Ae > 1) && /* @__PURE__ */ $("div", {
12860
+ children: [H.isFetchingNextPage ? /* @__PURE__ */ Q(ke, { size: 11 }) : null, "Load more"]
12861
+ }) : (Xt || je > 1) && /* @__PURE__ */ $("div", {
12850
12862
  style: {
12851
12863
  display: "flex",
12852
12864
  alignItems: "center",
@@ -12856,23 +12868,23 @@ function $l({ screenCode: e }) {
12856
12868
  /* @__PURE__ */ Q(U, {
12857
12869
  size: 22,
12858
12870
  icon: /* @__PURE__ */ Q(n.left, { size: 12 }),
12859
- onClick: () => $n(Ae - 1),
12860
- disabled: Ae <= 1
12871
+ onClick: () => er(je - 1),
12872
+ disabled: je <= 1
12861
12873
  }),
12862
12874
  /* @__PURE__ */ $("span", {
12863
12875
  className: "num",
12864
12876
  style: { padding: "0 6px" },
12865
12877
  children: [
12866
12878
  "Page ",
12867
- Ae,
12868
- Jt === void 0 ? "" : ` of ${Jt}`
12879
+ je,
12880
+ Yt === void 0 ? "" : ` of ${Yt}`
12869
12881
  ]
12870
12882
  }),
12871
12883
  /* @__PURE__ */ Q(U, {
12872
12884
  size: 22,
12873
12885
  icon: /* @__PURE__ */ Q(n.right, { size: 12 }),
12874
- onClick: () => $n(Ae + 1),
12875
- disabled: Jt === void 0 ? !Yt : Ae >= Jt
12886
+ onClick: () => er(je + 1),
12887
+ disabled: Yt === void 0 ? !Xt : je >= Yt
12876
12888
  })
12877
12889
  ]
12878
12890
  })
@@ -12885,35 +12897,35 @@ function $l({ screenCode: e }) {
12885
12897
  onClose: () => p(!1),
12886
12898
  filters: E,
12887
12899
  onApply: te,
12888
- availableFields: Be,
12900
+ availableFields: Ve,
12889
12901
  defaultFilters: O?.default_filters,
12890
- refs: Bt
12902
+ refs: Vt
12891
12903
  }),
12892
12904
  /* @__PURE__ */ Q(ml, {
12893
12905
  open: m,
12894
- pending: Ot.isPending || kt.isPending,
12906
+ pending: kt.isPending || At.isPending,
12895
12907
  onClose: () => h(!1),
12896
- overwriteViewName: Ge && Ge.source === "personal" ? N(Ge.name) : null,
12908
+ overwriteViewName: Ke && Ke.source === "personal" ? N(Ke.name) : null,
12897
12909
  onOverwrite: async () => {
12898
- !Ge?.id || Ge.source !== "personal" || (await kt.mutateAsync({
12899
- pkValues: Ge.id,
12910
+ !Ke?.id || Ke.source !== "personal" || (await At.mutateAsync({
12911
+ pkValues: Ke.id,
12900
12912
  data: {
12901
12913
  filters: E,
12902
12914
  columns: R,
12903
- sort: Re ?? null
12915
+ sort: Be ?? null
12904
12916
  }
12905
12917
  }), await r.invalidateQueries({ queryKey: ["entity-data", "view"] }), h(!1));
12906
12918
  },
12907
12919
  onSave: async (t) => {
12908
12920
  if (!ie?.id || !D?.id) return;
12909
- let n = await Ot.mutateAsync({
12921
+ let n = await kt.mutateAsync({
12910
12922
  tenant_id: D.id,
12911
12923
  screen_code: e,
12912
12924
  user_id: ie.id,
12913
12925
  name: { en: t },
12914
12926
  filters: E,
12915
12927
  columns: R,
12916
- ...Re ? { sort: Re } : {},
12928
+ ...Be ? { sort: Be } : {},
12917
12929
  is_shared: !1,
12918
12930
  is_default: !1
12919
12931
  }), o = y(n.data.id);
@@ -12925,23 +12937,23 @@ function $l({ screenCode: e }) {
12925
12937
  h(!1);
12926
12938
  }
12927
12939
  }),
12928
- Sn.length > 0 && /* @__PURE__ */ Q(gl, {
12929
- selectedIds: Sn,
12940
+ wn.length > 0 && /* @__PURE__ */ Q(gl, {
12941
+ selectedIds: wn,
12930
12942
  floatbarActions: ge,
12931
12943
  screenActionLayout: O.action_layout,
12932
12944
  entityActionLayout: A.action_layout,
12933
- data: Kt,
12934
- rowKey: Nt,
12945
+ data: qt,
12946
+ rowKey: Pt,
12935
12947
  entityCode: j,
12936
12948
  onClear: () => u({}),
12937
12949
  onActionSuccess: () => u({}),
12938
- widgetContext: Sr
12950
+ widgetContext: Cr
12939
12951
  }),
12940
12952
  C && A && O && /* @__PURE__ */ Q(kl, {
12941
12953
  x: C.x,
12942
12954
  y: C.y,
12943
12955
  row: C.row,
12944
- rowId: Nt(C.row),
12956
+ rowId: Pt(C.row),
12945
12957
  screen: O,
12946
12958
  fullScreen: O,
12947
12959
  entity: A,
@@ -12949,58 +12961,58 @@ function $l({ screenCode: e }) {
12949
12961
  rowActions: M,
12950
12962
  tabNavigate: t,
12951
12963
  locale: c,
12952
- peekAllowed: Ut,
12953
- hasDetailTarget: Wt,
12954
- onPeek: Ht,
12964
+ peekAllowed: Wt,
12965
+ hasDetailTarget: Gt,
12966
+ onPeek: Ut,
12955
12967
  onClose: () => w(null)
12956
12968
  }),
12957
- Ut && Vt && A && /* @__PURE__ */ Q(Vc, {
12969
+ Wt && Ht && A && /* @__PURE__ */ Q(Vc, {
12958
12970
  entity: A,
12959
12971
  entityCode: j,
12960
- record: Vt,
12972
+ record: Ht,
12961
12973
  title: (() => {
12962
12974
  let e = O.columns?.find((e) => !e.startsWith("$status.") && !e.startsWith("$property."));
12963
- return e ? y(Vt[e] ?? N(A.display.name)) : N(A.display.name);
12975
+ return e ? y(Ht[e] ?? N(A.display.name)) : N(A.display.name);
12964
12976
  })(),
12965
12977
  recordId: (() => {
12966
12978
  let e = A.fields.names()?.find((e) => A.fields.get(e)?.primary);
12967
- return e ? y(Vt[e]) : void 0;
12979
+ return e ? y(Ht[e]) : void 0;
12968
12980
  })(),
12969
- fields: ar,
12981
+ fields: or,
12970
12982
  screen: O,
12971
- actions: or,
12983
+ actions: sr,
12972
12984
  screenActionLayout: O.action_layout,
12973
12985
  entityActionLayout: A.action_layout,
12974
- executeAction: sr,
12986
+ executeAction: cr,
12975
12987
  onClose: () => {
12976
- if (A && Vt) {
12988
+ if (A && Ht) {
12977
12989
  let e = A.fields.names()?.find((e) => A.fields.get(e)?.primary);
12978
- e && hn(y(Vt[e]));
12990
+ e && hn(y(Ht[e]));
12979
12991
  }
12980
- Ht(null);
12992
+ Ut(null);
12981
12993
  },
12982
12994
  onOpen: (e) => {
12983
- let t = Vt;
12984
- Ht(null), rr(t, { draft: e });
12995
+ let t = Ht;
12996
+ Ut(null), ir(t, { draft: e });
12985
12997
  },
12986
12998
  onSave: (e) => {
12987
- Ht(e);
12999
+ Ut(e);
12988
13000
  let t = A.fields.names()?.find((e) => A.fields.get(e)?.primary);
12989
13001
  if (!t) return;
12990
13002
  let n = y(e[t]), r = {};
12991
13003
  for (let t of A.fields.names()) {
12992
- let n = Vn(A, e, t), i = Vn(A, Vt, t), a = Zn(A, t, n), o = Zn(A, t, i);
13004
+ let n = Vn(A, e, t), i = Vn(A, Ht, t), a = Zn(A, t, n), o = Zn(A, t, i);
12993
13005
  (a === "" ? null : a) !== (o === "" || o === void 0 ? null : o) && (r[t] = a);
12994
13006
  }
12995
13007
  let i = qn({
12996
13008
  entity: A,
12997
13009
  formData: e,
12998
- record: Vt,
13010
+ record: Ht,
12999
13011
  isNew: !1
13000
13012
  });
13001
13013
  if (Object.keys(i).length > 0 && (r.$files = i), Object.keys(r).length === 0) return;
13002
13014
  let a = Yn(i);
13003
- Dt.mutate({
13015
+ Ot.mutate({
13004
13016
  pkValues: n,
13005
13017
  data: r
13006
13018
  }, { onSuccess: () => {
@@ -13218,7 +13230,7 @@ function Du(e) {
13218
13230
  }
13219
13231
  }
13220
13232
  function Ou() {
13221
- let { data: e } = et();
13233
+ let { data: e } = tt();
13222
13234
  return {
13223
13235
  routes: J(() => {
13224
13236
  if (!e) return [];
@@ -13273,7 +13285,7 @@ function Ou() {
13273
13285
  };
13274
13286
  }
13275
13287
  function ku() {
13276
- let t = k((e) => e.initialize), n = k((e) => e.isLoading), r = k((e) => e.isAuthenticated), { data: i, isLoading: a } = et(), { data: o, isLoading: s } = $t(), { branding: c, isLoading: l } = qt(), { routes: u, defaultRoute: d } = Ou(), f = ct(), p = typeof window < "u" && window.self !== window.top && !f.enabled;
13288
+ let t = k((e) => e.initialize), n = k((e) => e.isLoading), r = k((e) => e.isAuthenticated), { data: i, isLoading: a } = tt(), { data: o, isLoading: s } = $t(), { branding: c, isLoading: l } = qt(), { routes: u, defaultRoute: d } = Ou(), f = ct(), p = typeof window < "u" && window.self !== window.top && !f.enabled;
13277
13289
  q(() => {
13278
13290
  f.enabled || p || t();
13279
13291
  }, [
@@ -13503,7 +13515,7 @@ function Lu(e, t = {}) {
13503
13515
  //#endregion
13504
13516
  //#region src/hooks/useLiveObject.ts
13505
13517
  function Ru(e, t) {
13506
- let n = er(e, t), { data: r } = et(), i = zn((e) => e.degradedEntities), a = n.data?.data ? tt(n.data.data) : void 0, o = e ? Ln(r?.entities?.[e]?.realtime, i, e) : !1;
13518
+ let n = er(e, t), { data: r } = tt(), i = zn((e) => e.degradedEntities), a = n.data?.data ? B(n.data.data) : void 0, o = e ? Ln(r?.entities?.[e]?.realtime, i, e) : !1;
13507
13519
  return {
13508
13520
  ...n,
13509
13521
  object: a,
@@ -13681,7 +13693,7 @@ function Ju({ title: e, description: t, backTo: r, actions: i }) {
13681
13693
  //#endregion
13682
13694
  //#region src/components/shared/ObjectActionBar.tsx
13683
13695
  function Yu({ entity: e, object: t, slot: n, screen: r, select: i, onAfterRun: a }) {
13684
- let { data: s } = et(), { run: c, isRunning: l } = Xe(), u = Re(), f = dr(), p = o(), h = vi(), g = s?.entities?.[e], _ = J(() => Zu(s, e, r, h.pathname), [
13696
+ let { data: s } = tt(), { run: c, isRunning: l } = Xe(), u = Re(), f = dr(), p = o(), h = vi(), g = s?.entities?.[e], _ = J(() => Zu(s, e, r, h.pathname), [
13685
13697
  s,
13686
13698
  e,
13687
13699
  r,
@@ -13741,7 +13753,7 @@ function Yu({ entity: e, object: t, slot: n, screen: r, select: i, onAfterRun: a
13741
13753
  };
13742
13754
  }
13743
13755
  function Xu({ entity: e, object: t, slot: n, screen: r, select: i, extraActions: a, onAfterRun: o }) {
13744
- let { data: s } = et(), { nodes: c, run: l, widgetContext: u } = Yu({
13756
+ let { data: s } = tt(), { nodes: c, run: l, widgetContext: u } = Yu({
13745
13757
  entity: e,
13746
13758
  object: t,
13747
13759
  slot: n,
@@ -14022,7 +14034,7 @@ function od({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
14022
14034
  },
14023
14035
  children: e.val
14024
14036
  }),
14025
- /* @__PURE__ */ Q(H, {
14037
+ /* @__PURE__ */ Q(V, {
14026
14038
  tone: e.tone,
14027
14039
  size: "xs",
14028
14040
  children: e.delta
@@ -14261,7 +14273,7 @@ function ud() {
14261
14273
  gap: 6
14262
14274
  },
14263
14275
  children: [
14264
- /* @__PURE__ */ Q(H, {
14276
+ /* @__PURE__ */ Q(V, {
14265
14277
  tone: e.color,
14266
14278
  size: "xs",
14267
14279
  children: e.key
@@ -14317,12 +14329,12 @@ function ud() {
14317
14329
  marginTop: 6,
14318
14330
  flexWrap: "wrap"
14319
14331
  },
14320
- children: [e.priority && e.priority !== "-" && /* @__PURE__ */ Q(H, {
14332
+ children: [e.priority && e.priority !== "-" && /* @__PURE__ */ Q(V, {
14321
14333
  tone: cd[e.priority] ?? "slate",
14322
14334
  size: "xs",
14323
14335
  dot: !0,
14324
14336
  children: e.priority
14325
- }), e.score !== void 0 && /* @__PURE__ */ $(H, {
14337
+ }), e.score !== void 0 && /* @__PURE__ */ $(V, {
14326
14338
  tone: "slate",
14327
14339
  size: "xs",
14328
14340
  children: ["Score ", e.score]
@@ -14488,7 +14500,7 @@ function md() {
14488
14500
  padding: "0 10px",
14489
14501
  borderBottom: "1px solid var(--divider)"
14490
14502
  },
14491
- children: /* @__PURE__ */ Q(H, {
14503
+ children: /* @__PURE__ */ Q(V, {
14492
14504
  tone: fd[e.status],
14493
14505
  size: "xs",
14494
14506
  dot: !0,
@@ -14829,4 +14841,4 @@ function vd(e) {
14829
14841
  return t ? `${t}${n}` : "";
14830
14842
  }
14831
14843
  //#endregion
14832
- export { Bu as ACTION_DATA_CURSOR_KEY, zu as ACTION_DATA_KEY, R as ActionBatchError, yt as ActionRunnerProvider, Do as AgentChatPanel, _d as AgentConversationDrawer, bo as AgentElicitForm, gd as AgentVisualHints, Mu as App, Mu as Declarion, ms as AuthShell, on as Avatar, Nu as Batch, je as BoolToggle, Ri as BrandGlyph, Ea as Breadcrumbs, L as Btn, Ke as CURSOR_LOCALE_CHANGED, mt as CURSOR_SEMANTICS_MISMATCH, Js as ChangePasswordDialog, Bi as Check, dt as Chip, Qn as CircleImage, Cr as ClassifiedFieldLocked, Pl as ColumnPicker, Ra as CommandPalette, la as ConfirmDialog, Tt as CurrentScreenProvider, me as DEFAULT_RESPONSIVE_BREAKPOINTS, se as DateInput, Qe as Dropdown, r as DynamicIcon, Ic as EmptyState, Rr as EntityClient, M as FieldLabel, A as FileDraftScope, Jc as FilterChips, Qc as FilterDrawer, Ls as Forgot, od as HomeStub, xt as HoverCard, n as Icon, U as IconBtn, Ma as ImpersonationBanner, Na as ImpersonationFrame, hd as ImpersonationStartModal, nn as InfoTooltip, nd as InlineEditCell, md as JobsStub, Ht as JsonField, Le as Kbd, I as MULTIPLE_VALUES, F as MenuItem, l as MultiSelect, Br as NO_VALUE_OPS, Xr as OP_LABELS, Xu as ObjectActionBar, ee as OrderedMap, On as PAGE_STATE_TTL_PARAM, Ju as PageHeader, P as PasswordInput, H as Pill, ud as PipelineStub, xc as Preferences, sc as Profile, V as PropertyGridEditor, Hc as QEField, w as QuickEditCell, Vc as QuickPeek, Ui as Rail, Zt as RecordIdBadge, Lr as RefCache, x as RefCombobox, xe as RefField, wn as RefreshControl, Ws as Reset, i as ResponsiveModeProvider, zi as RowField, Cn as SCROLL_STATE_KEY, _r as SectionCard, we as Select, da as Sidebar, Ms as SignIn, Fs as SignUp, tu as SmartDetailPage, Ql as SmartListPage, ru as SmartRecordListPage, ke as Spinner, Wn as SquareImage, ka as TabStrip, S as TagsInput, Ca as TenantChip, ae as TextArea, _t as TextInput, An as Tooltip, Oa as TopBar, Gs as TwoFA, E as UploadError, re as ViewField, Il as ViewSwitcher, Xn as WideBanner, Vu as actionDataQueryKey, Ha as approveInvocation, Fe as buildActionBody, qe as buildDetailHrefFromId, Pe as buildEntityDetailHref, Be as buildMassEditTargets, At as buildRowDetailHref, fa as buildSections, Wa as cancelConversation, Dn as canonicalUrl, jr as classificationTier, y as coerceDisplayString, $r as countActiveFilters, za as createConversation, Uu as cursorActionDataQueryKey, ai as cursorEntityDataQueryKey, Vr as cursorEntityStableKey, Bt as deleteObject, Ct as detectCommonValue, oe as discardFile, ri as entityClient, ne as entityDataQueryKey, Sa as envTone, Lt as executeAction, It as extractPkValues, ir as fieldAccessInfo, sr as fieldClassification, ye as fieldDisplayName, Sr as fieldRequiredPermission, ge as formatBytes, qc as formatCount, Gc as formatEstimatedCount, Kc as formatExactCount, Ar as getFileWidget, t as getIcon, jn as getImageCropper, kr as getLayoutWidget, Nt as getPrimaryKeyFields, yr as hasFileWidget, vr as hasLayoutWidget, Hr as hasOrGroups, st as isCursorStaleError, gr as isFieldReadable, lr as isFieldSoDProtected, cr as isFieldWritable, Ga as listConversations, qa as listPendingInvocations, Ja as loadHistory, N as loc, ur as objectQueryKey, Ur as parseFiltersFromURL, rt as parseTargetFilter, g as pkValuePartsToId, h as pkValuesFromId, de as pkValuesToDetailId, nt as pkValuesToId, Er as registerFileWidget, Tr as registerLayoutWidget, uu as registerScreen, Ua as rejectInvocation, Ka as rerunMessageTurn, B as resolveDetailRoute, Ge as resolveViewportCategory, _ as restoreObject, Va as sendElicitResponse, Ba as sendMessage, Jr as setFiltersInURL, e as setIconRegistry, or as setImageCropper, Vt as uploadFile, Hu as useActionData, Xe as useActionRunner, yo as useAgentConversation, Lu as useAllEntityData, ga as useAuth, Gu as useColumns, In as useCreateObject, lt as useCurrentScreen, Wu as useCursorActionData, ii as useCursorEntityData, gt as useDebounce, Fn as useDeleteObject, ei as useDeleteProperty, fe as useDraftRegistration, gn as useEffectiveParam, D as useEntity, Oe as useEntityCount, Ee as useEntityData, v as useFileDraftScope, Lc as useFilters, _a as useImpersonation, Ru as useLiveObject, _i as useLocation, yi as useNavigate, er as useObject, Yu as useObjectActions, Fc as usePageState, rn as usePageStateTtl, Qt as useParam, Si as useParams, un as usePlainScrollRestoration, $t as usePublicParams, ln as useRegisterRetainedQuery, tn as useResolvedParam, W as useResponsiveMode, vn as useSavedScrollOffset, et as useSchema, Ll as useScreen, $n as useScreenBack, qu as useScreenTab, Ci as useSearchParams, Yr as useSetProperty, Qr as useSetStatus, dr as useTabNavigate, zr as useTabSearchMirror, Mr as useTabStore, pr as useUpdateObject, Rl as useViews, Tn as useVirtualScrollRestoration, c as validateClientSide };
14844
+ export { Bu as ACTION_DATA_CURSOR_KEY, zu as ACTION_DATA_KEY, Je as ActionBatchError, yt as ActionRunnerProvider, Do as AgentChatPanel, _d as AgentConversationDrawer, bo as AgentElicitForm, gd as AgentVisualHints, Mu as App, Mu as Declarion, ms as AuthShell, on as Avatar, Nu as Batch, je as BoolToggle, Ri as BrandGlyph, Ea as Breadcrumbs, L as Btn, Ke as CURSOR_LOCALE_CHANGED, mt as CURSOR_SEMANTICS_MISMATCH, Js as ChangePasswordDialog, Bi as Check, dt as Chip, Qn as CircleImage, Cr as ClassifiedFieldLocked, Pl as ColumnPicker, Ra as CommandPalette, la as ConfirmDialog, Tt as CurrentScreenProvider, me as DEFAULT_RESPONSIVE_BREAKPOINTS, se as DateInput, Qe as Dropdown, r as DynamicIcon, Ic as EmptyState, Rr as EntityClient, M as FieldLabel, A as FileDraftScope, Jc as FilterChips, Qc as FilterDrawer, Ls as Forgot, od as HomeStub, xt as HoverCard, n as Icon, U as IconBtn, Ma as ImpersonationBanner, Na as ImpersonationFrame, hd as ImpersonationStartModal, nn as InfoTooltip, nd as InlineEditCell, md as JobsStub, Ht as JsonField, Le as Kbd, Ie as MULTIPLE_VALUES, F as MenuItem, l as MultiSelect, Br as NO_VALUE_OPS, Xr as OP_LABELS, Xu as ObjectActionBar, ee as OrderedMap, On as PAGE_STATE_TTL_PARAM, Ju as PageHeader, P as PasswordInput, V as Pill, ud as PipelineStub, xc as Preferences, sc as Profile, pt as PropertyGridEditor, Hc as QEField, w as QuickEditCell, Vc as QuickPeek, Ui as Rail, Zt as RecordIdBadge, Lr as RefCache, x as RefCombobox, xe as RefField, wn as RefreshControl, Ws as Reset, i as ResponsiveModeProvider, zi as RowField, Cn as SCROLL_STATE_KEY, _r as SectionCard, we as Select, da as Sidebar, Ms as SignIn, Fs as SignUp, tu as SmartDetailPage, Ql as SmartListPage, ru as SmartRecordListPage, ke as Spinner, Wn as SquareImage, ka as TabStrip, S as TagsInput, Ca as TenantChip, ae as TextArea, _t as TextInput, An as Tooltip, Oa as TopBar, Gs as TwoFA, E as UploadError, re as ViewField, Il as ViewSwitcher, Xn as WideBanner, Vu as actionDataQueryKey, Ha as approveInvocation, Fe as buildActionBody, qe as buildDetailHrefFromId, Pe as buildEntityDetailHref, Be as buildMassEditTargets, At as buildRowDetailHref, fa as buildSections, Wa as cancelConversation, Dn as canonicalUrl, jr as classificationTier, y as coerceDisplayString, $r as countActiveFilters, za as createConversation, Uu as cursorActionDataQueryKey, ai as cursorEntityDataQueryKey, Vr as cursorEntityStableKey, Bt as deleteObject, Ct as detectCommonValue, oe as discardFile, ri as entityClient, ne as entityDataQueryKey, Sa as envTone, Lt as executeAction, It as extractPkValues, ir as fieldAccessInfo, sr as fieldClassification, ye as fieldDisplayName, Sr as fieldRequiredPermission, ge as formatBytes, qc as formatCount, Gc as formatEstimatedCount, Kc as formatExactCount, Ar as getFileWidget, t as getIcon, jn as getImageCropper, kr as getLayoutWidget, Nt as getPrimaryKeyFields, yr as hasFileWidget, vr as hasLayoutWidget, Hr as hasOrGroups, st as isCursorStaleError, gr as isFieldReadable, lr as isFieldSoDProtected, cr as isFieldWritable, Ga as listConversations, qa as listPendingInvocations, Ja as loadHistory, N as loc, ur as objectQueryKey, Ur as parseFiltersFromURL, rt as parseTargetFilter, g as pkValuePartsToId, h as pkValuesFromId, de as pkValuesToDetailId, nt as pkValuesToId, Er as registerFileWidget, Tr as registerLayoutWidget, uu as registerScreen, Ua as rejectInvocation, Ka as rerunMessageTurn, et as resolveDetailRoute, Ge as resolveViewportCategory, _ as restoreObject, Va as sendElicitResponse, Ba as sendMessage, Jr as setFiltersInURL, e as setIconRegistry, or as setImageCropper, Vt as uploadFile, Hu as useActionData, Xe as useActionRunner, yo as useAgentConversation, Lu as useAllEntityData, ga as useAuth, Gu as useColumns, In as useCreateObject, lt as useCurrentScreen, Wu as useCursorActionData, ii as useCursorEntityData, gt as useDebounce, Fn as useDeleteObject, ei as useDeleteProperty, fe as useDraftRegistration, gn as useEffectiveParam, D as useEntity, Oe as useEntityCount, Ee as useEntityData, v as useFileDraftScope, Lc as useFilters, _a as useImpersonation, Ru as useLiveObject, _i as useLocation, yi as useNavigate, er as useObject, Yu as useObjectActions, Fc as usePageState, rn as usePageStateTtl, Qt as useParam, Si as useParams, un as usePlainScrollRestoration, $t as usePublicParams, ln as useRegisterRetainedQuery, tn as useResolvedParam, W as useResponsiveMode, vn as useSavedScrollOffset, tt as useSchema, Ll as useScreen, $n as useScreenBack, qu as useScreenTab, Ci as useSearchParams, Yr as useSetProperty, Qr as useSetStatus, dr as useTabNavigate, zr as useTabSearchMirror, Mr as useTabStore, pr as useUpdateObject, Rl as useViews, Tn as useVirtualScrollRestoration, c as validateClientSide };