@declarion/react 0.1.78 → 0.1.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist-lib/index.js CHANGED
@@ -6392,7 +6392,7 @@ function Zi({ tool: e, onApprove: t, onReject: n }) {
6392
6392
  }
6393
6393
  //#endregion
6394
6394
  //#region src/types/fieldType.ts
6395
- var Qi = /* @__PURE__ */ "bool.bytes.date.decimal.email.enum.float.int.int_array.json.multilang.multilang_text.password.phone.ref.rich_text.secret.string.string_array.structure.tags.text.time.timestamp.url.uuid".split(".");
6395
+ var Qi = /* @__PURE__ */ "bool.bytes.date.decimal.email.enum.float.int.int_array.json.multilang.multilang_text.password.phone.ref.rich_text.secret.string.string_array.structure.tags.text.time.timestamp.url.uuid.uuid_array".split(".");
6396
6396
  //#endregion
6397
6397
  //#region src/components/shared/CopyButton.tsx
6398
6398
  function $i({ value: e, title: t, size: n = "icon" }) {
@@ -10449,6 +10449,7 @@ var Ml = {
10449
10449
  tags: ea,
10450
10450
  string_array: za,
10451
10451
  int_array: Va,
10452
+ uuid_array: za,
10452
10453
  multilang: Oa,
10453
10454
  multilang_text: Aa,
10454
10455
  structure: ja,
@@ -15125,7 +15126,24 @@ function _f(e, t, n, r, i) {
15125
15126
  }
15126
15127
  return a;
15127
15128
  }
15128
- function vf(e, t) {
15129
+ function vf(e) {
15130
+ return e.visibility?.includes("list_floatbar") ?? !1;
15131
+ }
15132
+ function yf(e, t, n, r, i) {
15133
+ return e.map((e) => {
15134
+ if (e.kind === "group") return {
15135
+ ...e,
15136
+ items: yf(e.items, t, n, r, i)
15137
+ };
15138
+ let a = mf(e.code, t, n);
15139
+ return a && r(a) ? {
15140
+ ...e,
15141
+ enabled: !1,
15142
+ reason: i
15143
+ } : e;
15144
+ });
15145
+ }
15146
+ function bf(e, t) {
15129
15147
  return e ? Object.entries(e).filter(([, e]) => e.visibility?.includes(t)).sort(([e, t], [n, r]) => {
15130
15148
  let i = t.position ?? 0, a = r.position ?? 0;
15131
15149
  return i === a ? e < n ? -1 : +(e > n) : i - a;
@@ -15138,19 +15156,19 @@ function vf(e, t) {
15138
15156
  }
15139
15157
  //#endregion
15140
15158
  //#region src/components/shared/ResponsiveActionBar.tsx
15141
- function yf(e, t) {
15159
+ function xf(e, t) {
15142
15160
  return e.replace(/\$\{([^}]+)\}/g, (e, n) => Object.prototype.hasOwnProperty.call(t, n) ? t[n] : e);
15143
15161
  }
15144
- function bf(e) {
15162
+ function Sf(e) {
15145
15163
  return e.widget ? "widget" : e.href ? "href" : e.handler ? "handler" : e.association ? "association" : e.ui_steps && e.ui_steps.length > 0 ? "ui_steps" : "unknown";
15146
15164
  }
15147
- function xf(e) {
15165
+ function Cf(e) {
15148
15166
  if (!e) return "";
15149
15167
  let t = e.id;
15150
15168
  return typeof t == "string" ? t : t == null ? "" : String(t);
15151
15169
  }
15152
- function Sf(e, t, n, r, i) {
15153
- let a = bf(t), o = xf(n), s = r?.entityCode ?? "";
15170
+ function wf(e, t, n, r, i) {
15171
+ let a = Sf(t), o = Cf(n), s = r?.entityCode ?? "";
15154
15172
  if (i?.({
15155
15173
  code: e,
15156
15174
  entity: s,
@@ -15158,7 +15176,7 @@ function Sf(e, t, n, r, i) {
15158
15176
  rowId: o
15159
15177
  }), a === "widget") return console.warn(`[ResponsiveActionBar] widget "${t.widget}" requested for action "${e}" but the widget registry ships in Phase 2; falling back to onRun.`), !1;
15160
15178
  if (a === "href" && r) {
15161
- let e = yf(t.href ?? "", {
15179
+ let e = xf(t.href ?? "", {
15162
15180
  entity: s,
15163
15181
  id: o
15164
15182
  }), n = e.indexOf("?");
@@ -15166,27 +15184,27 @@ function Sf(e, t, n, r, i) {
15166
15184
  }
15167
15185
  return a === "handler" || a === "association" || a === "ui_steps" || a === "unknown" && console.warn(`[ResponsiveActionBar] no dispatch mode set on action "${e}" (none of handler/association/widget/href/ui_steps).`), !1;
15168
15186
  }
15169
- function Cf(e) {
15187
+ function Tf(e) {
15170
15188
  let t = 0;
15171
- for (let n of e) n.kind === "action" ? t++ : t += Cf(n.items);
15189
+ for (let n of e) n.kind === "action" ? t++ : t += Tf(n.items);
15172
15190
  return t;
15173
15191
  }
15174
- function wf(e, t, n) {
15192
+ function Ef(e, t, n) {
15175
15193
  let r = [], i = [];
15176
- for (let a of e) a.kind === "action" && Ef(a.code, t, n)?.destructive ? i.push(a) : r.push(a);
15194
+ for (let a of e) a.kind === "action" && Of(a.code, t, n)?.destructive ? i.push(a) : r.push(a);
15177
15195
  return {
15178
15196
  normal: r,
15179
15197
  destructive: i
15180
15198
  };
15181
15199
  }
15182
- function Tf(e, t, n) {
15200
+ function Df(e, t, n) {
15183
15201
  let r = [], i = [], a = [];
15184
15202
  for (let o of e) {
15185
15203
  if (o.kind !== "action") {
15186
15204
  i.push(o);
15187
15205
  continue;
15188
15206
  }
15189
- let e = Ef(o.code, t, n), s = e?.destructive === !0, c = e?.display?.primary === !0;
15207
+ let e = Of(o.code, t, n), s = e?.destructive === !0, c = e?.display?.primary === !0;
15190
15208
  if (s && c) {
15191
15209
  console.warn(`[ResponsiveActionBar] action "${o.code}" declares both primary and destructive; treating as destructive.`), a.push(o);
15192
15210
  continue;
@@ -15207,25 +15225,25 @@ function Tf(e, t, n) {
15207
15225
  destructive: a
15208
15226
  };
15209
15227
  }
15210
- function Ef(e, t, n) {
15228
+ function Of(e, t, n) {
15211
15229
  if (t && e in t) return t[e];
15212
15230
  if (n && e in n) return n[e];
15213
15231
  }
15214
- function Df(e, t, n) {
15215
- return X(Ef(e, t, n)?.display?.name) || e;
15232
+ function kf(e, t, n) {
15233
+ return X(Of(e, t, n)?.display?.name) || e;
15216
15234
  }
15217
- function Of(e, t, n) {
15218
- return Ef(e, t, n)?.display?.icon || void 0;
15235
+ function Af(e, t, n) {
15236
+ return Of(e, t, n)?.display?.icon || void 0;
15219
15237
  }
15220
- function kf(e) {
15238
+ function jf(e) {
15221
15239
  return `action-tooltip-${e}`;
15222
15240
  }
15223
- function Af({ leaf: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, measureRef: o, style: c, row: l, widgetContext: u, onActionClick: d }) {
15224
- let f = Ef(e.code, t, n), p = Df(e.code, t, n), m = Of(e.code, t, n), h = f?.destructive ?? !1, g = !h && f?.display?.primary === !0, _ = !e.enabled, v = _ ? kf(e.code) : void 0, y = s(async () => {
15241
+ function Mf({ leaf: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, measureRef: o, style: c, row: l, widgetContext: u, onActionClick: d }) {
15242
+ let f = Of(e.code, t, n), p = kf(e.code, t, n), m = Af(e.code, t, n), h = f?.destructive ?? !1, g = !h && f?.display?.primary === !0, _ = !e.enabled, v = _ ? jf(e.code) : void 0, y = s(async () => {
15225
15243
  if (!(!f || _ || i)) {
15226
15244
  a(!0);
15227
15245
  try {
15228
- Sf(e.code, f, l, u, d) || await Promise.resolve(r(e.code, f));
15246
+ wf(e.code, f, l, u, d) || await Promise.resolve(r(e.code, f));
15229
15247
  } finally {
15230
15248
  a(!1);
15231
15249
  }
@@ -15269,7 +15287,7 @@ function Af({ leaf: e, entityActions: t, globalActions: n, onRun: r, loading: i,
15269
15287
  children: p
15270
15288
  })] });
15271
15289
  }
15272
- function jf({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, measureRef: o, style: c }) {
15290
+ function Nf({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, measureRef: o, style: c }) {
15273
15291
  let l = f(null), [u, d] = p(!1), m = e.name ? X(e.name) : "Actions";
15274
15292
  return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(U, {
15275
15293
  ref: s((e) => {
@@ -15296,7 +15314,7 @@ function jf({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
15296
15314
  children: /* @__PURE__ */ L("div", {
15297
15315
  role: "menu",
15298
15316
  "aria-label": m,
15299
- children: e.items.map((e) => e.kind === "action" ? /* @__PURE__ */ L(Mf, {
15317
+ children: e.items.map((e) => e.kind === "action" ? /* @__PURE__ */ L(Pf, {
15300
15318
  leaf: e,
15301
15319
  entityActions: t,
15302
15320
  globalActions: n,
@@ -15305,7 +15323,7 @@ function jf({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
15305
15323
  },
15306
15324
  loading: i === e.code,
15307
15325
  onLoadingChange: (t) => a(t ? e.code : null)
15308
- }, e.code) : /* @__PURE__ */ L(Nf, {
15326
+ }, e.code) : /* @__PURE__ */ L(Ff, {
15309
15327
  group: e,
15310
15328
  entityActions: t,
15311
15329
  globalActions: n,
@@ -15318,8 +15336,8 @@ function jf({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
15318
15336
  })
15319
15337
  })] });
15320
15338
  }
15321
- function Mf({ leaf: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: s, onActionClick: c }) {
15322
- let l = Ef(e.code, t, n), u = Df(e.code, t, n), d = Of(e.code, t, n), f = l?.destructive ?? !1, p = !e.enabled, m = p ? kf(e.code) : void 0, h = i ? /* @__PURE__ */ L(J, { size: 12 }) : d ? /* @__PURE__ */ L(wr, {
15339
+ function Pf({ leaf: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: s, onActionClick: c }) {
15340
+ let l = Of(e.code, t, n), u = kf(e.code, t, n), d = Af(e.code, t, n), f = l?.destructive ?? !1, p = !e.enabled, m = p ? jf(e.code) : void 0, h = i ? /* @__PURE__ */ L(J, { size: 12 }) : d ? /* @__PURE__ */ L(wr, {
15323
15341
  name: d,
15324
15342
  size: 12
15325
15343
  }) : null;
@@ -15343,7 +15361,7 @@ function Mf({ leaf: e, entityActions: t, globalActions: n, onRun: r, loading: i,
15343
15361
  if (!(!l || p || i)) {
15344
15362
  a(!0);
15345
15363
  try {
15346
- Sf(e.code, l, o, s, c) || r(e.code, l);
15364
+ wf(e.code, l, o, s, c) || r(e.code, l);
15347
15365
  } finally {
15348
15366
  a(!1);
15349
15367
  }
@@ -15378,7 +15396,7 @@ function Mf({ leaf: e, entityActions: t, globalActions: n, onRun: r, loading: i,
15378
15396
  })]
15379
15397
  })] });
15380
15398
  }
15381
- function Nf({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: s, onActionClick: c }) {
15399
+ function Ff({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: s, onActionClick: c }) {
15382
15400
  let l = e.name ? X(e.name) : void 0;
15383
15401
  return /* @__PURE__ */ R(I, { children: [l && /* @__PURE__ */ L("div", {
15384
15402
  style: {
@@ -15390,7 +15408,7 @@ function Nf({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
15390
15408
  letterSpacing: "0.05em"
15391
15409
  },
15392
15410
  children: l
15393
- }), e.items.map((e) => e.kind === "action" ? /* @__PURE__ */ L(Mf, {
15411
+ }), e.items.map((e) => e.kind === "action" ? /* @__PURE__ */ L(Pf, {
15394
15412
  leaf: e,
15395
15413
  entityActions: t,
15396
15414
  globalActions: n,
@@ -15400,7 +15418,7 @@ function Nf({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
15400
15418
  row: o,
15401
15419
  widgetContext: s,
15402
15420
  onActionClick: c
15403
- }, e.code) : /* @__PURE__ */ L(Nf, {
15421
+ }, e.code) : /* @__PURE__ */ L(Ff, {
15404
15422
  group: e,
15405
15423
  entityActions: t,
15406
15424
  globalActions: n,
@@ -15412,10 +15430,10 @@ function Nf({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
15412
15430
  onActionClick: c
15413
15431
  }, e.icon ?? "nested"))] });
15414
15432
  }
15415
- function Pf({ layout: e, entityActions: t, globalActions: n, onRun: r, trailingNormalItems: i, trailingDestructiveItems: a, row: o, widgetContext: s, onActionClick: c }) {
15433
+ function If({ layout: e, entityActions: t, globalActions: n, onRun: r, trailingNormalItems: i, trailingDestructiveItems: a, row: o, widgetContext: s, onActionClick: c }) {
15416
15434
  let l = f(null), [u, d] = p(!1), [m, h] = p(null), g = i != null && i !== !1, _ = a != null && a !== !1;
15417
- if (Cf(e) === 0 && !g && !_) return null;
15418
- let { normal: v, destructive: y } = wf(e, t, n), b = y.length > 0 || _;
15435
+ if (Tf(e) === 0 && !g && !_) return null;
15436
+ let { normal: v, destructive: y } = Ef(e, t, n), b = y.length > 0 || _;
15419
15437
  return /* @__PURE__ */ R("div", {
15420
15438
  style: {
15421
15439
  display: "inline-flex",
@@ -15437,7 +15455,7 @@ function Pf({ layout: e, entityActions: t, globalActions: n, onRun: r, trailingN
15437
15455
  role: "menu",
15438
15456
  "aria-label": "Row actions",
15439
15457
  children: [
15440
- v.map((e) => e.kind === "action" ? /* @__PURE__ */ L(Mf, {
15458
+ v.map((e) => e.kind === "action" ? /* @__PURE__ */ L(Pf, {
15441
15459
  leaf: e,
15442
15460
  entityActions: t,
15443
15461
  globalActions: n,
@@ -15449,7 +15467,7 @@ function Pf({ layout: e, entityActions: t, globalActions: n, onRun: r, trailingN
15449
15467
  row: o,
15450
15468
  widgetContext: s,
15451
15469
  onActionClick: c
15452
- }, e.code) : /* @__PURE__ */ L(Nf, {
15470
+ }, e.code) : /* @__PURE__ */ L(Ff, {
15453
15471
  group: e,
15454
15472
  entityActions: t,
15455
15473
  globalActions: n,
@@ -15464,7 +15482,7 @@ function Pf({ layout: e, entityActions: t, globalActions: n, onRun: r, trailingN
15464
15482
  }, e.icon ?? "group")),
15465
15483
  g && i,
15466
15484
  b && /* @__PURE__ */ L(q, { divider: !0 }),
15467
- y.map((e) => /* @__PURE__ */ L(Mf, {
15485
+ y.map((e) => /* @__PURE__ */ L(Pf, {
15468
15486
  leaf: e,
15469
15487
  entityActions: t,
15470
15488
  globalActions: n,
@@ -15483,16 +15501,16 @@ function Pf({ layout: e, entityActions: t, globalActions: n, onRun: r, trailingN
15483
15501
  })]
15484
15502
  });
15485
15503
  }
15486
- var Ff = 90, If = 80;
15487
- function Lf(e, t, n, r, i, a, o) {
15488
- let { primary: s, regular: c, destructive: l } = Tf(e, i, a), u = s.length > 0 ? s.reduce((e, t) => e + (r.get(Rf(t)) ?? 0), 0) : 0, d = l.length > 0 ? l.reduce((e, t) => e + (r.get(Rf(t)) ?? If), 0) : 0, f = t - n - u - d, p = 0, m = [], h = [], g = !1;
15504
+ var Lf = 90, Rf = 80;
15505
+ function zf(e, t, n, r, i, a, o) {
15506
+ let { primary: s, regular: c, destructive: l } = Df(e, i, a), u = s.length > 0 ? s.reduce((e, t) => e + (r.get(Bf(t)) ?? 0), 0) : 0, d = l.length > 0 ? l.reduce((e, t) => e + (r.get(Bf(t)) ?? Rf), 0) : 0, f = t - n - u - d, p = 0, m = [], h = [], g = !1;
15489
15507
  for (let e of c) {
15490
- let t = r.get(Rf(e)) ?? 0;
15508
+ let t = r.get(Bf(e)) ?? 0;
15491
15509
  if (o) {
15492
15510
  o(e) ? (m.push(e), p += t) : (h.push(e), g = !0);
15493
15511
  continue;
15494
15512
  }
15495
- let n = c.length - m.length - h.length - 1 > 0 || h.length > 0 ? Ff : 0;
15513
+ let n = c.length - m.length - h.length - 1 > 0 || h.length > 0 ? Lf : 0;
15496
15514
  p + t + n <= f ? (m.push(e), p += t) : (h.push(e), g = !0);
15497
15515
  }
15498
15516
  return {
@@ -15502,10 +15520,10 @@ function Lf(e, t, n, r, i, a, o) {
15502
15520
  destructiveInline: l
15503
15521
  };
15504
15522
  }
15505
- function Rf(e) {
15523
+ function Bf(e) {
15506
15524
  return e.kind === "action" ? `action:${e.code}` : `group:${e.name ? X(e.name) : ""}`;
15507
15525
  }
15508
- function zf({ layout: e, entityActions: t, globalActions: n, onRun: r, reservedRightWidth: i = 0, measurementOverride: a, ariaLabel: o = "Actions", row: c, widgetContext: m, onActionClick: h }) {
15526
+ function Vf({ layout: e, entityActions: t, globalActions: n, onRun: r, reservedRightWidth: i = 0, measurementOverride: a, ariaLabel: o = "Actions", row: c, widgetContext: m, onActionClick: h }) {
15509
15527
  let g = f(null), _ = f(null), [v, y] = p(0), [b, x] = p(/* @__PURE__ */ new Map()), [S, C] = p(!1), [w, T] = p(null), [E, D] = p(() => typeof document < "u" && document.documentElement.dir === "rtl");
15510
15528
  l(() => {
15511
15529
  if (typeof MutationObserver > "u") return;
@@ -15517,7 +15535,7 @@ function zf({ layout: e, entityActions: t, globalActions: n, onRun: r, reservedR
15517
15535
  attributeFilter: ["dir", "lang"]
15518
15536
  }), () => e.disconnect();
15519
15537
  }, []);
15520
- let O = f(null), [k, A] = p(!1), j = Cf(e), M = !!a, N = s(() => {
15538
+ let O = f(null), [k, A] = p(!1), j = Tf(e), M = !!a, N = s(() => {
15521
15539
  if (M || !_.current) return;
15522
15540
  let e = Array.from(_.current.children), t = /* @__PURE__ */ new Map();
15523
15541
  e.forEach((e) => {
@@ -15536,7 +15554,7 @@ function zf({ layout: e, entityActions: t, globalActions: n, onRun: r, reservedR
15536
15554
  });
15537
15555
  return () => cancelAnimationFrame(e);
15538
15556
  }, [
15539
- d(() => JSON.stringify(e.map((e) => Rf(e))), [e]),
15557
+ d(() => JSON.stringify(e.map((e) => Bf(e))), [e]),
15540
15558
  N,
15541
15559
  M
15542
15560
  ]), l(() => {
@@ -15563,7 +15581,7 @@ function zf({ layout: e, entityActions: t, globalActions: n, onRun: r, reservedR
15563
15581
  });
15564
15582
  return t.observe(e), y(e.getBoundingClientRect().width), () => t.disconnect();
15565
15583
  }, [M]);
15566
- let P = d(() => M ? Lf(e, 2 ** 53 - 1, i, b, t, n, a) : S ? v === 0 ? Lf(e, 2 ** 53 - 1, i, b, t, n, a) : Lf(e, v, i, b, t, n, a) : {
15584
+ let P = d(() => M ? zf(e, 2 ** 53 - 1, i, b, t, n, a) : S ? v === 0 ? zf(e, 2 ** 53 - 1, i, b, t, n, a) : zf(e, v, i, b, t, n, a) : {
15567
15585
  primaryInline: [],
15568
15586
  inline: [],
15569
15587
  overflow: [],
@@ -15607,9 +15625,9 @@ function zf({ layout: e, entityActions: t, globalActions: n, onRun: r, reservedR
15607
15625
  left: 0
15608
15626
  },
15609
15627
  children: e.map((e) => {
15610
- let r = Rf(e);
15628
+ let r = Bf(e);
15611
15629
  if (e.kind === "action") {
15612
- let i = Ef(e.code, t, n), a = Df(e.code, t, n), o = Of(e.code, t, n);
15630
+ let i = Of(e.code, t, n), a = kf(e.code, t, n), o = Af(e.code, t, n);
15613
15631
  return /* @__PURE__ */ L(U, {
15614
15632
  "data-node-key": r,
15615
15633
  icon: o ? /* @__PURE__ */ L(wr, {
@@ -15631,7 +15649,7 @@ function zf({ layout: e, entityActions: t, globalActions: n, onRun: r, reservedR
15631
15649
  }
15632
15650
  })
15633
15651
  }),
15634
- P.primaryInline.map((e) => /* @__PURE__ */ L(Af, {
15652
+ P.primaryInline.map((e) => /* @__PURE__ */ L(Mf, {
15635
15653
  leaf: e,
15636
15654
  entityActions: t,
15637
15655
  globalActions: n,
@@ -15641,10 +15659,10 @@ function zf({ layout: e, entityActions: t, globalActions: n, onRun: r, reservedR
15641
15659
  row: c,
15642
15660
  widgetContext: m,
15643
15661
  onActionClick: h
15644
- }, Rf(e))),
15662
+ }, Bf(e))),
15645
15663
  P.inline.map((e) => {
15646
- let i = Rf(e);
15647
- return e.kind === "action" ? /* @__PURE__ */ L(Af, {
15664
+ let i = Bf(e);
15665
+ return e.kind === "action" ? /* @__PURE__ */ L(Mf, {
15648
15666
  leaf: e,
15649
15667
  entityActions: t,
15650
15668
  globalActions: n,
@@ -15654,7 +15672,7 @@ function zf({ layout: e, entityActions: t, globalActions: n, onRun: r, reservedR
15654
15672
  row: c,
15655
15673
  widgetContext: m,
15656
15674
  onActionClick: h
15657
- }, i) : /* @__PURE__ */ L(jf, {
15675
+ }, i) : /* @__PURE__ */ L(Nf, {
15658
15676
  group: e,
15659
15677
  entityActions: t,
15660
15678
  globalActions: n,
@@ -15680,7 +15698,7 @@ function zf({ layout: e, entityActions: t, globalActions: n, onRun: r, reservedR
15680
15698
  children: /* @__PURE__ */ L("div", {
15681
15699
  role: "menu",
15682
15700
  "aria-label": "More actions",
15683
- children: P.overflow.map((e) => e.kind === "action" ? /* @__PURE__ */ L(Mf, {
15701
+ children: P.overflow.map((e) => e.kind === "action" ? /* @__PURE__ */ L(Pf, {
15684
15702
  leaf: e,
15685
15703
  entityActions: t,
15686
15704
  globalActions: n,
@@ -15692,7 +15710,7 @@ function zf({ layout: e, entityActions: t, globalActions: n, onRun: r, reservedR
15692
15710
  row: c,
15693
15711
  widgetContext: m,
15694
15712
  onActionClick: h
15695
- }, e.code) : /* @__PURE__ */ L(Nf, {
15713
+ }, e.code) : /* @__PURE__ */ L(Ff, {
15696
15714
  group: e,
15697
15715
  entityActions: t,
15698
15716
  globalActions: n,
@@ -15701,10 +15719,10 @@ function zf({ layout: e, entityActions: t, globalActions: n, onRun: r, reservedR
15701
15719
  },
15702
15720
  loading: w,
15703
15721
  onLoadingChange: T
15704
- }, Rf(e)))
15722
+ }, Bf(e)))
15705
15723
  })
15706
15724
  })] }),
15707
- P.destructiveInline.map((e) => /* @__PURE__ */ L(Af, {
15725
+ P.destructiveInline.map((e) => /* @__PURE__ */ L(Mf, {
15708
15726
  leaf: e,
15709
15727
  entityActions: t,
15710
15728
  globalActions: n,
@@ -15714,18 +15732,18 @@ function zf({ layout: e, entityActions: t, globalActions: n, onRun: r, reservedR
15714
15732
  row: c,
15715
15733
  widgetContext: m,
15716
15734
  onActionClick: h
15717
- }, Rf(e)))
15735
+ }, Bf(e)))
15718
15736
  ]
15719
15737
  });
15720
15738
  }
15721
- function Bf({ layout: e, rowSelection: t = [], ...n }) {
15739
+ function Hf({ layout: e, rowSelection: t = [], ...n }) {
15722
15740
  let r = t.length > 0;
15723
15741
  return /* @__PURE__ */ R("div", {
15724
15742
  style: { position: "relative" },
15725
15743
  children: [/* @__PURE__ */ L("div", {
15726
15744
  "aria-hidden": r ? "true" : void 0,
15727
15745
  style: { display: r ? "none" : void 0 },
15728
- children: /* @__PURE__ */ L(zf, {
15746
+ children: /* @__PURE__ */ L(Vf, {
15729
15747
  layout: e,
15730
15748
  rowSelection: [],
15731
15749
  ...n
@@ -15733,7 +15751,7 @@ function Bf({ layout: e, rowSelection: t = [], ...n }) {
15733
15751
  }), /* @__PURE__ */ L("div", {
15734
15752
  "aria-hidden": r ? void 0 : "true",
15735
15753
  style: { display: r ? void 0 : "none" },
15736
- children: /* @__PURE__ */ L(zf, {
15754
+ children: /* @__PURE__ */ L(Vf, {
15737
15755
  layout: e,
15738
15756
  rowSelection: t,
15739
15757
  ...n
@@ -15741,9 +15759,9 @@ function Bf({ layout: e, rowSelection: t = [], ...n }) {
15741
15759
  })]
15742
15760
  });
15743
15761
  }
15744
- function Vf({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth: i = 0, kind: a = "toolbar", measurementOverride: o, entityActions: s, globalActions: c, ariaLabel: l = "Actions", trailingNormalItems: u, trailingDestructiveItems: d, widgetContext: f, onActionClick: p }) {
15745
- let m = Cf(e);
15746
- return a === "row" ? /* @__PURE__ */ L(Pf, {
15762
+ function Uf({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth: i = 0, kind: a = "toolbar", measurementOverride: o, entityActions: s, globalActions: c, ariaLabel: l = "Actions", trailingNormalItems: u, trailingDestructiveItems: d, widgetContext: f, onActionClick: p }) {
15763
+ let m = Tf(e);
15764
+ return a === "row" ? /* @__PURE__ */ L(If, {
15747
15765
  layout: e,
15748
15766
  entityActions: s,
15749
15767
  globalActions: c,
@@ -15753,7 +15771,7 @@ function Vf({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth:
15753
15771
  row: t,
15754
15772
  widgetContext: f,
15755
15773
  onActionClick: p
15756
- }) : m === 0 ? null : L(a === "toolbar" ? Bf : zf, {
15774
+ }) : m === 0 ? null : L(a === "toolbar" ? Hf : Vf, {
15757
15775
  layout: e,
15758
15776
  row: t,
15759
15777
  rowSelection: n,
@@ -15769,7 +15787,7 @@ function Vf({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth:
15769
15787
  }
15770
15788
  //#endregion
15771
15789
  //#region src/lib/filters.ts
15772
- var Hf = new Set([
15790
+ var Wf = new Set([
15773
15791
  "is_empty",
15774
15792
  "is_not_empty",
15775
15793
  "today",
@@ -15779,7 +15797,7 @@ var Hf = new Set([
15779
15797
  "last_30_days",
15780
15798
  "last_hour",
15781
15799
  "last_24_hours"
15782
- ]), Uf = {
15800
+ ]), Gf = {
15783
15801
  eq: "is",
15784
15802
  not_eq: "is not",
15785
15803
  gt: ">",
@@ -15801,7 +15819,7 @@ var Hf = new Set([
15801
15819
  last_hour: "last hour",
15802
15820
  last_24_hours: "last 24 hours"
15803
15821
  };
15804
- function Wf(e) {
15822
+ function Kf(e) {
15805
15823
  let t = e.get("filters");
15806
15824
  if (!t) return [];
15807
15825
  try {
@@ -15811,35 +15829,35 @@ function Wf(e) {
15811
15829
  return [];
15812
15830
  }
15813
15831
  }
15814
- function Gf(e, t) {
15832
+ function qf(e, t) {
15815
15833
  e.length === 0 ? t.delete("filters") : t.set("filters", JSON.stringify(e));
15816
15834
  }
15817
- function Kf(e) {
15835
+ function Jf(e) {
15818
15836
  return e.some((e) => e.or != null);
15819
15837
  }
15820
- function qf(e) {
15838
+ function Yf(e) {
15821
15839
  let t = [];
15822
15840
  for (let n of e) {
15823
- if (n.field && n.op && t.push(n), n.or) for (let e of n.or) t.push(...qf(e));
15824
- n.and && t.push(...qf(n.and));
15841
+ if (n.field && n.op && t.push(n), n.or) for (let e of n.or) t.push(...Yf(e));
15842
+ n.and && t.push(...Yf(n.and));
15825
15843
  }
15826
15844
  return t;
15827
15845
  }
15828
- function Jf(e) {
15829
- return qf(e).length;
15846
+ function Xf(e) {
15847
+ return Yf(e).length;
15830
15848
  }
15831
- function Yf(e, t) {
15849
+ function Zf(e, t) {
15832
15850
  return {
15833
15851
  field: e,
15834
15852
  op: "eq",
15835
15853
  value: t
15836
15854
  };
15837
15855
  }
15838
- function Xf(e, t) {
15856
+ function Qf(e, t) {
15839
15857
  let n = [];
15840
15858
  for (let r of e) if (r.field !== t) {
15841
15859
  if (r.or) {
15842
- let e = r.or.map((e) => Xf(e, t)).filter((e) => e.length > 0);
15860
+ let e = r.or.map((e) => Qf(e, t)).filter((e) => e.length > 0);
15843
15861
  e.length > 0 && n.push({
15844
15862
  ...r,
15845
15863
  or: e
@@ -15847,7 +15865,7 @@ function Xf(e, t) {
15847
15865
  continue;
15848
15866
  }
15849
15867
  if (r.and) {
15850
- let e = Xf(r.and, t);
15868
+ let e = Qf(r.and, t);
15851
15869
  e.length > 0 && n.push({
15852
15870
  ...r,
15853
15871
  and: e
@@ -15860,14 +15878,14 @@ function Xf(e, t) {
15860
15878
  }
15861
15879
  //#endregion
15862
15880
  //#region src/hooks/useFilters.ts
15863
- function Zf() {
15864
- let [e, t] = D(), n = d(() => Wf(e), [e]);
15881
+ function $f() {
15882
+ let [e, t] = D(), n = d(() => Kf(e), [e]);
15865
15883
  return {
15866
15884
  filters: n,
15867
- activeCount: d(() => Jf(n), [n]),
15885
+ activeCount: d(() => Xf(n), [n]),
15868
15886
  setFilters: s((n) => {
15869
15887
  let r = new URLSearchParams(e);
15870
- Gf(n, r), r.set("page", "1"), t(r);
15888
+ qf(n, r), r.set("page", "1"), t(r);
15871
15889
  }, [e, t]),
15872
15890
  clearFilters: s(() => {
15873
15891
  let n = new URLSearchParams(e);
@@ -15877,17 +15895,17 @@ function Zf() {
15877
15895
  }
15878
15896
  //#endregion
15879
15897
  //#region src/components/list/PeekFieldCell.tsx
15880
- var Qf = new Set([
15898
+ var ep = new Set([
15881
15899
  "enum",
15882
15900
  "bool",
15883
15901
  "ref"
15884
15902
  ]);
15885
- function $f(e) {
15903
+ function tp(e) {
15886
15904
  let t = e.display?.widget;
15887
- return t && Qf.has(t) ? !0 : Qf.has(e.type);
15905
+ return t && ep.has(t) ? !0 : ep.has(e.type);
15888
15906
  }
15889
- function ep({ field: e, fieldName: t, label: n, value: r, record: i, refs: a, readOnly: o, onCommit: c }) {
15890
- let u = Fl(), [d, f] = p(!1), [m, h] = p(r), g = $f(e);
15907
+ function np({ field: e, fieldName: t, label: n, value: r, record: i, refs: a, readOnly: o, onCommit: c }) {
15908
+ let u = Fl(), [d, f] = p(!1), [m, h] = p(r), g = tp(e);
15891
15909
  l(() => {
15892
15910
  d || h(r);
15893
15911
  }, [r, d]);
@@ -16017,7 +16035,7 @@ function ep({ field: e, fieldName: t, label: n, value: r, record: i, refs: a, re
16017
16035
  }
16018
16036
  //#endregion
16019
16037
  //#region src/components/list/QuickPeek.tsx
16020
- function tp(e, t = 12) {
16038
+ function rp(e, t = 12) {
16021
16039
  let n = e.display?.icon;
16022
16040
  if (!n) return null;
16023
16041
  let r = H[n];
@@ -16026,7 +16044,7 @@ function tp(e, t = 12) {
16026
16044
  size: t
16027
16045
  });
16028
16046
  }
16029
- function np({ entity: e, entityCode: t, record: n, title: r, recordId: i, avatarName: a, fields: o, refs: s, screen: c, actions: u, executeAction: m, onClose: h, onOpen: g, onSave: _ }) {
16047
+ function ip({ entity: e, entityCode: t, record: n, title: r, recordId: i, avatarName: a, fields: o, refs: s, screen: c, actions: u, executeAction: m, onClose: h, onOpen: g, onSave: _ }) {
16030
16048
  let v = Fl(), [y, b] = p({ ...n }), [x, S] = p(!1), [C, w] = p(!1), T = f(null), { run: E } = xu();
16031
16049
  l(() => {
16032
16050
  b({ ...n }), S(!1);
@@ -16158,7 +16176,7 @@ function np({ entity: e, entityCode: t, record: n, title: r, recordId: i, avatar
16158
16176
  /* @__PURE__ */ L(ke, { children: "Esc" }),
16159
16177
  " to close."
16160
16178
  ]
16161
- }), o.map((n) => /* @__PURE__ */ L(rp, {
16179
+ }), o.map((n) => /* @__PURE__ */ L(ap, {
16162
16180
  label: n.label,
16163
16181
  children: n.kind === "file" ? ys({
16164
16182
  entity: e,
@@ -16170,7 +16188,7 @@ function np({ entity: e, entityCode: t, record: n, title: r, recordId: i, avatar
16170
16188
  refs: s,
16171
16189
  disabled: n.readOnly,
16172
16190
  locale: v
16173
- }) : /* @__PURE__ */ L(ep, {
16191
+ }) : /* @__PURE__ */ L(np, {
16174
16192
  field: n.field,
16175
16193
  fieldName: n.key,
16176
16194
  label: n.label,
@@ -16226,7 +16244,7 @@ function np({ entity: e, entityCode: t, record: n, title: r, recordId: i, avatar
16226
16244
  width: 220,
16227
16245
  align: "end",
16228
16246
  children: k.map(({ code: e, action: t }) => /* @__PURE__ */ L(q, {
16229
- icon: tp(t),
16247
+ icon: rp(t),
16230
16248
  danger: t.destructive,
16231
16249
  onClick: () => {
16232
16250
  w(!1), A({
@@ -16240,7 +16258,7 @@ function np({ entity: e, entityCode: t, record: n, title: r, recordId: i, avatar
16240
16258
  }),
16241
16259
  O && /* @__PURE__ */ L(U, {
16242
16260
  kind: "default",
16243
- icon: tp(O.action, 13),
16261
+ icon: rp(O.action, 13),
16244
16262
  onClick: () => A(O),
16245
16263
  children: X(O.action.display?.name) || O.code
16246
16264
  }),
@@ -16255,7 +16273,7 @@ function np({ entity: e, entityCode: t, record: n, title: r, recordId: i, avatar
16255
16273
  ]
16256
16274
  })] });
16257
16275
  }
16258
- function rp({ label: e, children: t }) {
16276
+ function ap({ label: e, children: t }) {
16259
16277
  return /* @__PURE__ */ R("div", {
16260
16278
  style: {
16261
16279
  display: "grid",
@@ -16276,21 +16294,21 @@ function rp({ label: e, children: t }) {
16276
16294
  }
16277
16295
  //#endregion
16278
16296
  //#region src/components/list/peekDraftStore.ts
16279
- var ip = /* @__PURE__ */ new Map();
16280
- function ap(e, t) {
16281
- ip.set(e, t);
16297
+ var op = /* @__PURE__ */ new Map();
16298
+ function sp(e, t) {
16299
+ op.set(e, t);
16282
16300
  }
16283
- function op(e) {
16284
- let t = ip.get(e);
16285
- return t === void 0 ? null : (ip.delete(e), t);
16301
+ function cp(e) {
16302
+ let t = op.get(e);
16303
+ return t === void 0 ? null : (op.delete(e), t);
16286
16304
  }
16287
- function sp(e) {
16288
- ip.delete(e);
16305
+ function lp(e) {
16306
+ op.delete(e);
16289
16307
  }
16290
16308
  //#endregion
16291
16309
  //#region src/components/filters/FilterChips.tsx
16292
- function cp({ filters: e, onRemove: t, onClearAll: n, onChipClick: r, fieldLabel: i = (e) => e }) {
16293
- return e.length === 0 ? null : Kf(e) ? /* @__PURE__ */ R("div", {
16310
+ function up({ filters: e, onRemove: t, onClearAll: n, onChipClick: r, fieldLabel: i = (e) => e }) {
16311
+ return e.length === 0 ? null : Jf(e) ? /* @__PURE__ */ R("div", {
16294
16312
  style: {
16295
16313
  display: "flex",
16296
16314
  alignItems: "center",
@@ -16321,10 +16339,10 @@ function cp({ filters: e, onRemove: t, onClearAll: n, onChipClick: r, fieldLabel
16321
16339
  }), /* @__PURE__ */ L(K, {
16322
16340
  tone: "slate",
16323
16341
  onClick: r,
16324
- children: e.filter((e) => e.field && e.op).map((e) => `${i(e.field)} ${up(e)}`).join(" AND ")
16342
+ children: e.filter((e) => e.field && e.op).map((e) => `${i(e.field)} ${fp(e)}`).join(" AND ")
16325
16343
  })]
16326
16344
  }, t))
16327
- }, n) : e.field && e.op ? /* @__PURE__ */ L(lp, {
16345
+ }, n) : e.field && e.op ? /* @__PURE__ */ L(dp, {
16328
16346
  node: e,
16329
16347
  fieldLabel: i,
16330
16348
  onRemove: () => t(e.field),
@@ -16344,7 +16362,7 @@ function cp({ filters: e, onRemove: t, onClearAll: n, onChipClick: r, fieldLabel
16344
16362
  flexWrap: "wrap",
16345
16363
  paddingBottom: 12
16346
16364
  },
16347
- children: [qf(e).map((e, n) => /* @__PURE__ */ L(lp, {
16365
+ children: [Yf(e).map((e, n) => /* @__PURE__ */ L(dp, {
16348
16366
  node: e,
16349
16367
  fieldLabel: i,
16350
16368
  onRemove: () => t(e.field),
@@ -16358,7 +16376,7 @@ function cp({ filters: e, onRemove: t, onClearAll: n, onChipClick: r, fieldLabel
16358
16376
  })]
16359
16377
  });
16360
16378
  }
16361
- function lp({ node: e, fieldLabel: t, onRemove: n, onClick: r }) {
16379
+ function dp({ node: e, fieldLabel: t, onRemove: n, onClick: r }) {
16362
16380
  return /* @__PURE__ */ L(K, {
16363
16381
  tone: "slate",
16364
16382
  icon: /* @__PURE__ */ L(H.filter, { size: 11 }),
@@ -16372,24 +16390,24 @@ function lp({ node: e, fieldLabel: t, onRemove: n, onClick: r }) {
16372
16390
  " ",
16373
16391
  /* @__PURE__ */ L("span", {
16374
16392
  style: { fontWeight: 600 },
16375
- children: up(e)
16393
+ children: fp(e)
16376
16394
  })
16377
16395
  ] })
16378
16396
  });
16379
16397
  }
16380
- function up(e) {
16398
+ function fp(e) {
16381
16399
  if (!e.op) return "";
16382
- let t = Uf[e.op] || e.op;
16383
- return Hf.has(e.op) ? t : `${t} ${Array.isArray(e.value) ? e.value.join(", ") : String(e.value ?? "")}`;
16400
+ let t = Gf[e.op] || e.op;
16401
+ return Wf.has(e.op) ? t : `${t} ${Array.isArray(e.value) ? e.value.join(", ") : String(e.value ?? "")}`;
16384
16402
  }
16385
16403
  //#endregion
16386
16404
  //#region src/components/filters/FilterDrawer.tsx
16387
- function dp({ open: e, onClose: t, filters: n, onApply: r, availableFields: i }) {
16405
+ function pp({ open: e, onClose: t, filters: n, onApply: r, availableFields: i }) {
16388
16406
  let [a, o] = p(n), [s, c] = p(!1);
16389
16407
  if (l(() => {
16390
16408
  e && o(n);
16391
16409
  }, [e, n]), !e) return null;
16392
- let u = Kf(a), d = new Set(a.filter((e) => e.field).map((e) => e.field)), f = (e) => {
16410
+ let u = Jf(a), d = new Set(a.filter((e) => e.field).map((e) => e.field)), f = (e) => {
16393
16411
  let t = i.find((t) => t.code === e);
16394
16412
  if (!t) return;
16395
16413
  let n = t.operators[0] || "eq";
@@ -16475,14 +16493,14 @@ function dp({ open: e, onClose: t, filters: n, onApply: r, availableFields: i })
16475
16493
  if (!e.or) {
16476
16494
  if (!e.field || !e.op) return null;
16477
16495
  let n = i.find((t) => t.code === e.field);
16478
- return n ? /* @__PURE__ */ L(fp, {
16496
+ return n ? /* @__PURE__ */ L(mp, {
16479
16497
  node: e,
16480
16498
  meta: n,
16481
16499
  onUpdate: (e) => m(t, e),
16482
16500
  onRemove: () => h(t)
16483
16501
  }, `${e.field}-${t}`) : null;
16484
16502
  }
16485
- return /* @__PURE__ */ L(pp, {
16503
+ return /* @__PURE__ */ L(hp, {
16486
16504
  groups: e.or,
16487
16505
  availableFields: i,
16488
16506
  onChange: (e) => {
@@ -16493,7 +16511,7 @@ function dp({ open: e, onClose: t, filters: n, onApply: r, availableFields: i })
16493
16511
  }) : a.map((e, t) => {
16494
16512
  if (!e.field || !e.op) return null;
16495
16513
  let n = i.find((t) => t.code === e.field);
16496
- return n ? /* @__PURE__ */ L(fp, {
16514
+ return n ? /* @__PURE__ */ L(mp, {
16497
16515
  node: e,
16498
16516
  meta: n,
16499
16517
  onUpdate: (e) => m(t, e),
@@ -16506,7 +16524,7 @@ function dp({ open: e, onClose: t, filters: n, onApply: r, availableFields: i })
16506
16524
  gap: 6,
16507
16525
  paddingTop: 6
16508
16526
  },
16509
- children: s ? /* @__PURE__ */ L(mp, {
16527
+ children: s ? /* @__PURE__ */ L(gp, {
16510
16528
  fields: i,
16511
16529
  activeFields: d,
16512
16530
  onSelect: f,
@@ -16569,10 +16587,10 @@ function dp({ open: e, onClose: t, filters: n, onApply: r, availableFields: i })
16569
16587
  ]
16570
16588
  })] });
16571
16589
  }
16572
- function fp({ node: e, meta: t, onUpdate: n, onRemove: r }) {
16573
- let i = Hf.has(e.op), a = t.operators.map((e) => ({
16590
+ function mp({ node: e, meta: t, onUpdate: n, onRemove: r }) {
16591
+ let i = Wf.has(e.op), a = t.operators.map((e) => ({
16574
16592
  value: e,
16575
- label: Uf[e] || e
16593
+ label: Gf[e] || e
16576
16594
  }));
16577
16595
  return /* @__PURE__ */ R("div", {
16578
16596
  style: {
@@ -16624,7 +16642,7 @@ function fp({ node: e, meta: t, onUpdate: n, onRemove: r }) {
16624
16642
  ]
16625
16643
  });
16626
16644
  }
16627
- function pp({ groups: e, availableFields: t, onChange: n }) {
16645
+ function hp({ groups: e, availableFields: t, onChange: n }) {
16628
16646
  return /* @__PURE__ */ R("div", {
16629
16647
  style: {
16630
16648
  display: "flex",
@@ -16679,7 +16697,7 @@ function pp({ groups: e, availableFields: t, onChange: n }) {
16679
16697
  }),
16680
16698
  r.map((r, a) => {
16681
16699
  let o = t.find((e) => e.code === r.field);
16682
- return o ? /* @__PURE__ */ L(fp, {
16700
+ return o ? /* @__PURE__ */ L(mp, {
16683
16701
  node: r,
16684
16702
  meta: o,
16685
16703
  onUpdate: (t) => {
@@ -16716,7 +16734,7 @@ function pp({ groups: e, availableFields: t, onChange: n }) {
16716
16734
  })]
16717
16735
  });
16718
16736
  }
16719
- function mp({ fields: e, activeFields: t, onSelect: n, onCancel: r }) {
16737
+ function gp({ fields: e, activeFields: t, onSelect: n, onCancel: r }) {
16720
16738
  let [i, a] = p(""), o = e.filter((e) => !t.has(e.code) && (i === "" || e.label.toLowerCase().includes(i.toLowerCase()) || e.code.toLowerCase().includes(i.toLowerCase())));
16721
16739
  return /* @__PURE__ */ R("div", {
16722
16740
  style: {
@@ -16790,7 +16808,7 @@ function mp({ fields: e, activeFields: t, onSelect: n, onCancel: r }) {
16790
16808
  }
16791
16809
  //#endregion
16792
16810
  //#region src/components/columns/ColumnPicker.tsx
16793
- function hp({ availableColumns: e, visibleColumns: t, onToggle: n, onReset: r, onShowAll: i, columnLabel: a = (e) => e }) {
16811
+ function _p({ availableColumns: e, visibleColumns: t, onToggle: n, onReset: r, onShowAll: i, columnLabel: a = (e) => e }) {
16794
16812
  let o = f(null), [s, c] = p(!1);
16795
16813
  return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(U, {
16796
16814
  ref: o,
@@ -16840,7 +16858,7 @@ function hp({ availableColumns: e, visibleColumns: t, onToggle: n, onReset: r, o
16840
16858
  }
16841
16859
  //#endregion
16842
16860
  //#region src/components/views/ViewSwitcher.tsx
16843
- var gp = {
16861
+ var vp = {
16844
16862
  display: "flex",
16845
16863
  alignItems: "center",
16846
16864
  gap: 6,
@@ -16854,7 +16872,7 @@ var gp = {
16854
16872
  color: "var(--text-2)",
16855
16873
  fontFamily: "inherit"
16856
16874
  };
16857
- function _p({ views: e, activeViewId: t, isDirty: n, onSelect: r, onSave: i, onSaveAs: a }) {
16875
+ function yp({ views: e, activeViewId: t, isDirty: n, onSelect: r, onSave: i, onSaveAs: a }) {
16858
16876
  let o = f(null), [s, c] = p(!1), l = e.find((e) => e.id === t), u = e.filter((e) => e.source === "system"), d = e.filter((e) => e.source === "personal"), m = e.filter((e) => e.source === "shared"), h = l ? X(l.name) : "Default view", g = (e) => /* @__PURE__ */ L("div", {
16859
16877
  style: {
16860
16878
  padding: "6px 8px 4px",
@@ -16877,7 +16895,7 @@ function _p({ views: e, activeViewId: t, isDirty: n, onSelect: r, onSave: i, onS
16877
16895
  ref: o,
16878
16896
  type: "button",
16879
16897
  onClick: () => c(!s),
16880
- style: gp,
16898
+ style: vp,
16881
16899
  children: [
16882
16900
  /* @__PURE__ */ L(H.star, { size: 12 }),
16883
16901
  /* @__PURE__ */ L("span", { children: h }),
@@ -16956,14 +16974,14 @@ function _p({ views: e, activeViewId: t, isDirty: n, onSelect: r, onSave: i, onS
16956
16974
  }
16957
16975
  //#endregion
16958
16976
  //#region src/hooks/useScreen.ts
16959
- function vp(e) {
16977
+ function bp(e) {
16960
16978
  let { data: t } = jn();
16961
16979
  if (!(!t || !e)) return t.screens[e];
16962
16980
  }
16963
16981
  //#endregion
16964
16982
  //#region src/hooks/useViews.ts
16965
- function yp(e, t) {
16966
- let n = vp(e), { data: r } = xa("view", {
16983
+ function xp(e, t) {
16984
+ let n = bp(e), { data: r } = xa("view", {
16967
16985
  filters: [{
16968
16986
  field: "screen_code",
16969
16987
  op: "eq",
@@ -17012,7 +17030,7 @@ function yp(e, t) {
17012
17030
  }
17013
17031
  //#endregion
17014
17032
  //#region src/components/pages/SmartListPage.tsx
17015
- var bp = new Set([
17033
+ var Sp = new Set([
17016
17034
  "string",
17017
17035
  "text",
17018
17036
  "email",
@@ -17038,16 +17056,16 @@ var bp = new Set([
17038
17056
  "enum",
17039
17057
  "status"
17040
17058
  ]);
17041
- function xp(e) {
17059
+ function Cp(e) {
17042
17060
  let t = [];
17043
17061
  for (let [n, r] of e.fields) {
17044
17062
  if (r.primary || r.auto || r.ref || r.array || r.structure || r.display?.is_listable === !1) continue;
17045
17063
  let e = (r.type || "").toLowerCase(), i = !!(r.enum || r.values);
17046
- if (!(!bp.has(e) && !i) && (t.push(n), t.length >= 8)) break;
17064
+ if (!(!Sp.has(e) && !i) && (t.push(n), t.length >= 8)) break;
17047
17065
  }
17048
17066
  return t;
17049
17067
  }
17050
- var Sp = 1e4, Cp = [
17068
+ var wp = 1e4, Tp = [
17051
17069
  25,
17052
17070
  50,
17053
17071
  100,
@@ -17055,7 +17073,7 @@ var Sp = 1e4, Cp = [
17055
17073
  500,
17056
17074
  1e3
17057
17075
  ];
17058
- function wp(e, t) {
17076
+ function Ep(e, t) {
17059
17077
  let [n, r] = p(!1);
17060
17078
  return l(() => {
17061
17079
  if (!e) {
@@ -17063,31 +17081,31 @@ function wp(e, t) {
17063
17081
  return;
17064
17082
  }
17065
17083
  r(!1);
17066
- let t = window.setTimeout(() => r(!0), Sp);
17084
+ let t = window.setTimeout(() => r(!0), wp);
17067
17085
  return () => window.clearTimeout(t);
17068
17086
  }, [e, t]), n;
17069
17087
  }
17070
- function Tp(e) {
17088
+ function Dp(e) {
17071
17089
  return e instanceof Pt && e.code === "REQUEST_TIMEOUT" ? "Request timed out" : "Failed to load data";
17072
17090
  }
17073
- function Ep(e) {
17091
+ function Op(e) {
17074
17092
  return e instanceof Pt ? e.code === "REQUEST_TIMEOUT" ? "The table request took too long. Retry the request or check network and server health." : `${e.code}: ${e.message}` : e instanceof Error && e.message ? e.message : "Something went wrong. Please try again.";
17075
17093
  }
17076
- function Dp(e, t) {
17094
+ function kp(e, t) {
17077
17095
  return bt(e, _t(e, t));
17078
17096
  }
17079
- function Op(e, t, n) {
17097
+ function Ap(e, t, n) {
17080
17098
  if (!e || n.length === 0) return [];
17081
17099
  let r = new Set(n);
17082
- return t.filter((t) => r.has(Dp(e, t))).map((t) => _t(e, t));
17100
+ return t.filter((t) => r.has(kp(e, t))).map((t) => _t(e, t));
17083
17101
  }
17084
- function kp(e, t, n, r) {
17102
+ function jp(e, t, n, r) {
17085
17103
  return Ct(e, t, n, r);
17086
17104
  }
17087
- function Ap({ screenCode: e }) {
17088
- return /* @__PURE__ */ L(No, { children: /* @__PURE__ */ L(Mp, { screenCode: e }) });
17105
+ function Mp({ screenCode: e }) {
17106
+ return /* @__PURE__ */ L(No, { children: /* @__PURE__ */ L(Pp, { screenCode: e }) });
17089
17107
  }
17090
- function jp({ cell: e, isRowSelected: t }) {
17108
+ function Np({ cell: e, isRowSelected: t }) {
17091
17109
  let n = e.column.id === "_select", r = e.column.id === "_actions", i = e.column.columnDef.cell, a = typeof i == "function" ? i(e.getContext()) : i;
17092
17110
  return /* @__PURE__ */ L("td", {
17093
17111
  title: typeof a == "string" ? a : void 0,
@@ -17110,8 +17128,8 @@ function jp({ cell: e, isRowSelected: t }) {
17110
17128
  children: a
17111
17129
  });
17112
17130
  }
17113
- function Mp({ screenCode: e }) {
17114
- let t = rr(), n = N(), [r, i] = D(), { data: a } = jn(), o = Fl(), [c, u] = p(null), [m, h] = p({}), [g, _] = p(!1), [v, y] = p(!1), [b, x] = p(null), { filters: S, activeCount: C, setFilters: w, clearFilters: T } = Zf(), E = An((e) => e.user), O = An((e) => e.activeTenant), k = yp(e, E?.id), A = Po(), j = a?.screens[e], M = j?.entity ? a?.entities[j.entity] : void 0, P = j?.entity, ee = ht(M, "create"), z = ht(M, "update"), te = ht(M, "delete"), ne = a?.actions, re = d(() => af(M?.actions, j?.actions, "list_toolbar", ne), [
17131
+ function Pp({ screenCode: e }) {
17132
+ let t = rr(), n = N(), [r, i] = D(), { data: a } = jn(), o = Fl(), [c, u] = p(null), [m, h] = p({}), [g, _] = p(!1), [v, y] = p(!1), [b, x] = p(null), { filters: S, activeCount: C, setFilters: w, clearFilters: T } = $f(), E = An((e) => e.user), O = An((e) => e.activeTenant), k = xp(e, E?.id), A = Po(), j = a?.screens[e], M = j?.entity ? a?.entities[j.entity] : void 0, P = j?.entity, ee = ht(M, "create"), z = ht(M, "update"), te = ht(M, "delete"), ne = a?.actions, re = d(() => af(M?.actions, j?.actions, "list_toolbar", ne), [
17115
17133
  M?.actions,
17116
17134
  j?.actions,
17117
17135
  ne
@@ -17177,7 +17195,7 @@ function Mp({ screenCode: e }) {
17177
17195
  select: xe,
17178
17196
  preview: !0,
17179
17197
  screen: j?.fixed_filters ? e : void 0
17180
- }), Ae = wp(Ce, `${P ?? ""}|${r.toString()}`), je = s(() => {
17198
+ }), Ae = Ep(Ce, `${P ?? ""}|${r.toString()}`), je = s(() => {
17181
17199
  P && n.cancelQueries({ queryKey: ["entity-data", P] }), V();
17182
17200
  }, [
17183
17201
  P,
@@ -17190,7 +17208,7 @@ function Mp({ screenCode: e }) {
17190
17208
  id: e,
17191
17209
  desc: t === "desc"
17192
17210
  }];
17193
- }, [_e]), Ie = d(() => M?.fields.names().find((e) => M.fields.get(e)?.primary) ?? "id", [M]), Le = s((e) => M ? Dp(M, e) : String(e[Ie] ?? ""), [M, Ie]), Re = Se?.$refs, ze = f(Re);
17211
+ }, [_e]), Ie = d(() => M?.fields.names().find((e) => M.fields.get(e)?.primary) ?? "id", [M]), Le = s((e) => M ? kp(M, e) : String(e[Ie] ?? ""), [M, Ie]), Re = Se?.$refs, ze = f(Re);
17194
17212
  ze.current = Re;
17195
17213
  let [K, Be] = p(null), Ve = j?.on_row_click === "peek" && j.quick_peek?.enabled !== !1, He = d(() => {
17196
17214
  if (ye.length === 0 || !M) return [];
@@ -17302,9 +17320,9 @@ function Mp({ screenCode: e }) {
17302
17320
  id: "_actions",
17303
17321
  header: "",
17304
17322
  size: 40,
17305
- cell: ({ row: e }) => /* @__PURE__ */ L(Ip, {
17323
+ cell: ({ row: e }) => /* @__PURE__ */ L(Rp, {
17306
17324
  row: e.original,
17307
- rowId: Dp(M, e.original),
17325
+ rowId: kp(M, e.original),
17308
17326
  screen: j,
17309
17327
  fullScreen: j,
17310
17328
  entity: M,
@@ -17354,7 +17372,7 @@ function Mp({ screenCode: e }) {
17354
17372
  onRowSelectionChange: h,
17355
17373
  getRowId: Le,
17356
17374
  rowCount: We?.total ?? 0
17357
- }), J = d(() => Object.keys(m).filter((e) => m[e]), [m]), qe = d(() => Op(M, Ue, J), [
17375
+ }), J = d(() => Object.keys(m).filter((e) => m[e]), [m]), qe = d(() => Ap(M, Ue, J), [
17358
17376
  M,
17359
17377
  Ue,
17360
17378
  J
@@ -17406,7 +17424,7 @@ function Mp({ screenCode: e }) {
17406
17424
  let n = new URLSearchParams(t);
17407
17425
  return n.set("per_page", String(e)), n.set("page", "1"), n;
17408
17426
  });
17409
- }, [i]), rt = d(() => !j || !M ? !1 : kp(j, "_", M, a?.screens) !== null, [
17427
+ }, [i]), rt = d(() => !j || !M ? !1 : jp(j, "_", M, a?.screens) !== null, [
17410
17428
  j,
17411
17429
  M,
17412
17430
  a?.screens
@@ -17415,7 +17433,7 @@ function Mp({ screenCode: e }) {
17415
17433
  let r = _t(M, e), i = bt(M, r), o = wt(j, M, a?.screens, r);
17416
17434
  if (!o) return;
17417
17435
  if (n?.draft) {
17418
- ap(i, n.draft);
17436
+ sp(i, n.draft);
17419
17437
  let [e, t] = o.split("?", 2), r = new URLSearchParams(t ?? "");
17420
17438
  r.set("edit", "true"), o = `${e}?${r.toString()}`;
17421
17439
  }
@@ -17453,8 +17471,8 @@ function Mp({ screenCode: e }) {
17453
17471
  }
17454
17472
  }
17455
17473
  };
17456
- i(e), n = r.filter((e) => M.fields.get(e) || M.files?.get(e)), n.length === 0 && (n = xp(M));
17457
- } else n = xp(M);
17474
+ i(e), n = r.filter((e) => M.fields.get(e) || M.files?.get(e)), n.length === 0 && (n = Cp(M));
17475
+ } else n = Cp(M);
17458
17476
  return n.map((e) => {
17459
17477
  if (M.files?.get(e)) return {
17460
17478
  key: e,
@@ -17521,7 +17539,7 @@ function Mp({ screenCode: e }) {
17521
17539
  },
17522
17540
  children: [
17523
17541
  /* @__PURE__ */ R(I, { children: [
17524
- /* @__PURE__ */ L(Lp, {
17542
+ /* @__PURE__ */ L(zp, {
17525
17543
  title: ft,
17526
17544
  total: We?.total,
17527
17545
  loaded: Ue.length,
@@ -17543,7 +17561,7 @@ function Mp({ screenCode: e }) {
17543
17561
  flexWrap: "wrap"
17544
17562
  },
17545
17563
  children: [
17546
- /* @__PURE__ */ L(_p, {
17564
+ /* @__PURE__ */ L(yp, {
17547
17565
  views: k,
17548
17566
  activeViewId: r.get("view"),
17549
17567
  isDirty: !1,
@@ -17590,7 +17608,7 @@ function Mp({ screenCode: e }) {
17590
17608
  children: C
17591
17609
  })]
17592
17610
  }),
17593
- /* @__PURE__ */ L(hp, {
17611
+ /* @__PURE__ */ L(_p, {
17594
17612
  availableColumns: j.columns ?? [],
17595
17613
  visibleColumns: ye,
17596
17614
  onToggle: (e) => {
@@ -17663,9 +17681,9 @@ function Mp({ screenCode: e }) {
17663
17681
  }),
17664
17682
  S.length > 0 && /* @__PURE__ */ L("div", {
17665
17683
  style: { padding: "0 20px 10px" },
17666
- children: /* @__PURE__ */ L(cp, {
17684
+ children: /* @__PURE__ */ L(up, {
17667
17685
  filters: S,
17668
- onRemove: (e) => w(Xf(S, e)),
17686
+ onRemove: (e) => w(Qf(S, e)),
17669
17687
  onClearAll: T,
17670
17688
  onChipClick: () => _(!0),
17671
17689
  fieldLabel: (e) => {
@@ -17700,8 +17718,8 @@ function Mp({ screenCode: e }) {
17700
17718
  style: { padding: "0 20px" },
17701
17719
  children: /* @__PURE__ */ L(Wd, {
17702
17720
  icon: "alert-circle",
17703
- title: Tp(Oe),
17704
- description: Ep(Oe),
17721
+ title: Dp(Oe),
17722
+ description: Op(Oe),
17705
17723
  action: /* @__PURE__ */ L(U, {
17706
17724
  kind: "primary",
17707
17725
  size: "sm",
@@ -17838,7 +17856,7 @@ function Mp({ screenCode: e }) {
17838
17856
  row: t.original
17839
17857
  });
17840
17858
  },
17841
- children: t.getVisibleCells().map((e) => /* @__PURE__ */ L(jp, {
17859
+ children: t.getVisibleCells().map((e) => /* @__PURE__ */ L(Np, {
17842
17860
  cell: e,
17843
17861
  isRowSelected: t.getIsSelected()
17844
17862
  }, e.id))
@@ -17898,7 +17916,7 @@ function Mp({ screenCode: e }) {
17898
17916
  color: "var(--text-2)",
17899
17917
  cursor: "pointer"
17900
17918
  },
17901
- children: Cp.map((e) => /* @__PURE__ */ L("option", {
17919
+ children: Tp.map((e) => /* @__PURE__ */ L("option", {
17902
17920
  value: e,
17903
17921
  children: e
17904
17922
  }, e))
@@ -17938,14 +17956,14 @@ function Mp({ screenCode: e }) {
17938
17956
  })]
17939
17957
  })
17940
17958
  }),
17941
- /* @__PURE__ */ L(dp, {
17959
+ /* @__PURE__ */ L(pp, {
17942
17960
  open: g,
17943
17961
  onClose: () => _(!1),
17944
17962
  filters: S,
17945
17963
  onApply: w,
17946
- availableFields: Pp(j, M, a?.entities)
17964
+ availableFields: Ip(j, M, a?.entities)
17947
17965
  }),
17948
- /* @__PURE__ */ L(Np, {
17966
+ /* @__PURE__ */ L(Fp, {
17949
17967
  open: v,
17950
17968
  pending: Pe.isPending,
17951
17969
  onClose: () => y(!1),
@@ -17978,7 +17996,7 @@ function Mp({ screenCode: e }) {
17978
17996
  onConfirm: ut,
17979
17997
  destructive: !0
17980
17998
  }),
17981
- J.length > 0 && /* @__PURE__ */ L(Rp, {
17999
+ J.length > 0 && /* @__PURE__ */ L(Bp, {
17982
18000
  selectedIds: J,
17983
18001
  floatbarActions: ie,
17984
18002
  screenActionLayout: j.action_layout,
@@ -18044,7 +18062,7 @@ function Mp({ screenCode: e }) {
18044
18062
  }
18045
18063
  })]
18046
18064
  }),
18047
- Ve && K && M && /* @__PURE__ */ L(np, {
18065
+ Ve && K && M && /* @__PURE__ */ L(ip, {
18048
18066
  entity: M,
18049
18067
  entityCode: P,
18050
18068
  record: K,
@@ -18063,7 +18081,7 @@ function Mp({ screenCode: e }) {
18063
18081
  onClose: () => {
18064
18082
  if (M && K) {
18065
18083
  let e = M.fields.names()?.find((e) => M.fields.get(e)?.primary);
18066
- e && sp(String(K[e] ?? ""));
18084
+ e && lp(String(K[e] ?? ""));
18067
18085
  }
18068
18086
  Be(null);
18069
18087
  },
@@ -18099,7 +18117,7 @@ function Mp({ screenCode: e }) {
18099
18117
  ]
18100
18118
  });
18101
18119
  }
18102
- function Np({ open: e, pending: t, onClose: n, onSave: r }) {
18120
+ function Fp({ open: e, pending: t, onClose: n, onSave: r }) {
18103
18121
  let [i, a] = p("");
18104
18122
  if (l(() => {
18105
18123
  e && a("");
@@ -18194,7 +18212,7 @@ function Np({ open: e, pending: t, onClose: n, onSave: r }) {
18194
18212
  ]
18195
18213
  })] });
18196
18214
  }
18197
- function Pp(e, t, n) {
18215
+ function Ip(e, t, n) {
18198
18216
  if (!e || !t) return [];
18199
18217
  let r = e.filters ?? t.fields.names(), i = [];
18200
18218
  for (let e of r) {
@@ -18238,7 +18256,7 @@ function Pp(e, t, n) {
18238
18256
  }
18239
18257
  let r = t.fields.get(e);
18240
18258
  if (!r) continue;
18241
- let a = pt(r, e, n), o = Fp(r.type), s = r.values?.map((e) => ({
18259
+ let a = pt(r, e, n), o = Lp(r.type), s = r.values?.map((e) => ({
18242
18260
  value: e.code,
18243
18261
  label: X(e.name) || e.code,
18244
18262
  color: e.color
@@ -18253,7 +18271,7 @@ function Pp(e, t, n) {
18253
18271
  }
18254
18272
  return i;
18255
18273
  }
18256
- function Fp(e) {
18274
+ function Lp(e) {
18257
18275
  switch (e) {
18258
18276
  case "string":
18259
18277
  case "text":
@@ -18339,7 +18357,7 @@ function Fp(e) {
18339
18357
  ];
18340
18358
  }
18341
18359
  }
18342
- function Ip({ row: e, rowId: t, screen: n, fullScreen: r, entity: i, entityCode: a, hasDefaultEditAction: o, hasDefaultDeleteAction: c, rowActions: l, tabNavigate: u, onPeek: f, locale: p }) {
18360
+ function Rp({ row: e, rowId: t, screen: n, fullScreen: r, entity: i, entityCode: a, hasDefaultEditAction: o, hasDefaultDeleteAction: c, rowActions: l, tabNavigate: u, onPeek: f, locale: p }) {
18343
18361
  let { run: m } = xu(), h = d(() => ({
18344
18362
  entity: i,
18345
18363
  entityCode: a ?? "",
@@ -18366,7 +18384,7 @@ function Ip({ row: e, rowId: t, screen: n, fullScreen: r, entity: i, entityCode:
18366
18384
  return e;
18367
18385
  }, [l]), _ = d(() => {
18368
18386
  let e = n.action_layout ?? null, t = i.action_layout ?? null;
18369
- return _f((e ?? t) || vf(g, "list_row"), g, void 0, "list_row");
18387
+ return _f((e ?? t) || bf(g, "list_row"), g, void 0, "list_row");
18370
18388
  }, [
18371
18389
  n,
18372
18390
  i,
@@ -18406,7 +18424,7 @@ function Ip({ row: e, rowId: t, screen: n, fullScreen: r, entity: i, entityCode:
18406
18424
  e.stopPropagation(), f();
18407
18425
  },
18408
18426
  title: "Peek"
18409
- }), (v.length > 0 || b) && /* @__PURE__ */ L(Vf, {
18427
+ }), (v.length > 0 || b) && /* @__PURE__ */ L(Uf, {
18410
18428
  layout: v,
18411
18429
  row: e,
18412
18430
  kind: "row",
@@ -18417,16 +18435,16 @@ function Ip({ row: e, rowId: t, screen: n, fullScreen: r, entity: i, entityCode:
18417
18435
  })]
18418
18436
  });
18419
18437
  }
18420
- function Lp({ title: e, total: t, loaded: n, toolbarActions: r, screenActionLayout: i, entityActionLayout: a, selectedIds: o, data: s, rowKey: c, onActionSuccess: l, widgetContext: u }) {
18438
+ function zp({ title: e, total: t, loaded: n, toolbarActions: r, screenActionLayout: i, entityActionLayout: a, selectedIds: o, data: s, rowKey: c, onActionSuccess: l, widgetContext: u }) {
18421
18439
  let { run: f } = xu(), p = d(() => {
18422
18440
  let e = {};
18423
18441
  for (let { code: t, action: n } of r) e[t] = n;
18424
18442
  return e;
18425
- }, [r]), m = d(() => _f((i ?? a) || vf(p, "list_toolbar"), p, void 0, "list_toolbar"), [
18443
+ }, [r]), m = d(() => _f((i ?? a) || bf(p, "list_toolbar"), p, void 0, "list_toolbar"), [
18426
18444
  i,
18427
18445
  a,
18428
18446
  p
18429
- ]);
18447
+ ]), h = d(() => yf(m, p, void 0, vf, "Select one or more rows first"), [m, p]), g = d(() => _f(m, p, void 0, "list_toolbar", { excludeIf: vf }), [m, p]), _ = o.length > 0 ? g : h;
18430
18448
  return /* @__PURE__ */ R("div", {
18431
18449
  style: {
18432
18450
  display: "flex",
@@ -18464,8 +18482,8 @@ function Lp({ title: e, total: t, loaded: n, toolbarActions: r, screenActionLayo
18464
18482
  ]
18465
18483
  })]
18466
18484
  })
18467
- }), o.length === 0 && m.length > 0 && /* @__PURE__ */ L(Vf, {
18468
- layout: m,
18485
+ }), _.length > 0 && /* @__PURE__ */ L(Uf, {
18486
+ layout: _,
18469
18487
  kind: "toolbar",
18470
18488
  entityActions: p,
18471
18489
  onRun: (e, t) => {
@@ -18489,12 +18507,12 @@ function Lp({ title: e, total: t, loaded: n, toolbarActions: r, screenActionLayo
18489
18507
  })]
18490
18508
  });
18491
18509
  }
18492
- function Rp({ selectedIds: e, floatbarActions: t, screenActionLayout: n, entityActionLayout: r, data: i, rowKey: a, entityCode: o, onClear: s, onActionSuccess: c, widgetContext: l }) {
18510
+ function Bp({ selectedIds: e, floatbarActions: t, screenActionLayout: n, entityActionLayout: r, data: i, rowKey: a, entityCode: o, onClear: s, onActionSuccess: c, widgetContext: l }) {
18493
18511
  let { run: u } = xu(), f = N(), p = d(() => {
18494
18512
  let e = {};
18495
18513
  for (let { code: n, action: r } of t) e[n] = r;
18496
18514
  return e;
18497
- }, [t]), m = d(() => _f((n ?? r) || vf(p, "list_floatbar"), p, void 0, "list_floatbar"), [
18515
+ }, [t]), m = d(() => _f((n ?? r) || bf(p, "list_floatbar"), p, void 0, "list_floatbar"), [
18498
18516
  n,
18499
18517
  r,
18500
18518
  p
@@ -18543,7 +18561,7 @@ function Rp({ selectedIds: e, floatbarActions: t, screenActionLayout: n, entityA
18543
18561
  children: e.length
18544
18562
  }), "selected"]
18545
18563
  }),
18546
- /* @__PURE__ */ L(Vf, {
18564
+ /* @__PURE__ */ L(Uf, {
18547
18565
  layout: g,
18548
18566
  kind: "toolbar",
18549
18567
  entityActions: p,
@@ -18586,7 +18604,7 @@ function Rp({ selectedIds: e, floatbarActions: t, screenActionLayout: n, entityA
18586
18604
  }
18587
18605
  //#endregion
18588
18606
  //#region src/hooks/useEntityItem.ts
18589
- function zp(e, t) {
18607
+ function Vp(e, t) {
18590
18608
  let n = t === void 0 || t === "new" ? void 0 : typeof t == "string" ? t : Object.keys(t).sort().map((e) => [e, t[e]]);
18591
18609
  return M({
18592
18610
  queryKey: [
@@ -18600,7 +18618,7 @@ function zp(e, t) {
18600
18618
  }
18601
18619
  //#endregion
18602
18620
  //#region src/components/shared/AssociationTabs.tsx
18603
- function Bp({ entityCode: e, recordId: t, associations: n, schema: r }) {
18621
+ function Hp({ entityCode: e, recordId: t, associations: n, schema: r }) {
18604
18622
  let i = d(() => Object.entries(n), [n]), [a, o] = p(0);
18605
18623
  if (i.length === 0) return null;
18606
18624
  let [s, c] = i[a];
@@ -18643,7 +18661,7 @@ function Bp({ entityCode: e, recordId: t, associations: n, schema: r }) {
18643
18661
  }),
18644
18662
  collapsible: !1,
18645
18663
  padding: "0",
18646
- children: /* @__PURE__ */ L(Vp, {
18664
+ children: /* @__PURE__ */ L(Up, {
18647
18665
  entityCode: e,
18648
18666
  recordId: t,
18649
18667
  assocKey: s,
@@ -18652,7 +18670,7 @@ function Bp({ entityCode: e, recordId: t, associations: n, schema: r }) {
18652
18670
  })
18653
18671
  });
18654
18672
  }
18655
- function Vp({ entityCode: e, recordId: t, assocKey: n, association: r, schema: i }) {
18673
+ function Up({ entityCode: e, recordId: t, assocKey: n, association: r, schema: i }) {
18656
18674
  let a = rr(), o = Fl(), s = `${e}.${n}`, { data: c, isLoading: l } = M({
18657
18675
  queryKey: [
18658
18676
  "association",
@@ -18784,12 +18802,12 @@ function Vp({ entityCode: e, recordId: t, assocKey: n, association: r, schema: i
18784
18802
  }
18785
18803
  //#endregion
18786
18804
  //#region src/lib/size-value.ts
18787
- var Hp = /^(\d+)px$/;
18788
- function Up(e) {
18805
+ var Wp = /^(\d+)px$/;
18806
+ function Gp(e) {
18789
18807
  if (e == null || e === "") return null;
18790
18808
  if (e === "auto") return { kind: "auto" };
18791
18809
  if (e === "fill") return { kind: "fill" };
18792
- let t = Hp.exec(e);
18810
+ let t = Wp.exec(e);
18793
18811
  if (t) {
18794
18812
  let e = parseInt(t[1], 10);
18795
18813
  return e > 0 ? {
@@ -18805,7 +18823,7 @@ function Up(e) {
18805
18823
  }
18806
18824
  //#endregion
18807
18825
  //#region src/components/detail-layout/LayoutRow.tsx
18808
- function Wp({ config: e, ctx: t }) {
18826
+ function Kp({ config: e, ctx: t }) {
18809
18827
  let { items: n, gap: r = 0, resizable: i = !1, stack_below: a } = e, o = a === "never" ? 0 : a ?? 768, [c, u] = p(!1), d = f(null);
18810
18828
  l(() => {
18811
18829
  if (o === 0) return;
@@ -18817,7 +18835,7 @@ function Wp({ config: e, ctx: t }) {
18817
18835
  return t.observe(e), () => t.disconnect();
18818
18836
  }, [o]);
18819
18837
  let [m, h] = p(null), g = f(null), _ = s(() => n.map((t) => {
18820
- let n = Up(t.width ?? t.column?.width ?? t.row?.width ?? e.width);
18838
+ let n = Gp(t.width ?? t.column?.width ?? t.row?.width ?? e.width);
18821
18839
  return n && n.kind === "weight" ? n.value : 1;
18822
18840
  }), [n, e.width]), v = s((e, t) => {
18823
18841
  t.preventDefault();
@@ -18836,7 +18854,7 @@ function Wp({ config: e, ctx: t }) {
18836
18854
  g.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
18837
18855
  };
18838
18856
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
18839
- }, [m, _]), y = m ?? _(), b = e.height ? Kp(e.height) : void 0;
18857
+ }, [m, _]), y = m ?? _(), b = e.height ? Jp(e.height) : void 0;
18840
18858
  return /* @__PURE__ */ L("div", {
18841
18859
  ref: d,
18842
18860
  className: ir("flex", c && "flex-col"),
@@ -18846,10 +18864,10 @@ function Wp({ config: e, ctx: t }) {
18846
18864
  },
18847
18865
  children: n.map((r, a) => /* @__PURE__ */ R("div", {
18848
18866
  className: ir("min-w-0 flex items-stretch", c && "w-full"),
18849
- style: c ? void 0 : Gp(r.width ?? r.column?.width ?? r.row?.width ?? e.width, y[a], r.min_width, r.max_width),
18867
+ style: c ? void 0 : qp(r.width ?? r.column?.width ?? r.row?.width ?? e.width, y[a], r.min_width, r.max_width),
18850
18868
  children: [/* @__PURE__ */ L("div", {
18851
18869
  className: ir("flex-1 min-w-0 flex flex-col", b && "overflow-y-auto overflow-x-hidden"),
18852
- children: /* @__PURE__ */ L(dh, {
18870
+ children: /* @__PURE__ */ L(ph, {
18853
18871
  node: r,
18854
18872
  ctx: t
18855
18873
  })
@@ -18860,17 +18878,17 @@ function Wp({ config: e, ctx: t }) {
18860
18878
  }, a))
18861
18879
  });
18862
18880
  }
18863
- function Gp(e, t, n, r) {
18864
- let i = Up(e), a;
18881
+ function qp(e, t, n, r) {
18882
+ let i = Gp(e), a;
18865
18883
  return a = !i || i.kind === "weight" ? `${t} 1 0%` : i.kind === "px" ? `0 0 ${i.value}px` : i.kind === "fill" ? "1 1 0%" : "0 0 auto", {
18866
18884
  flex: a,
18867
18885
  minWidth: n,
18868
18886
  maxWidth: r
18869
18887
  };
18870
18888
  }
18871
- function Kp(e) {
18889
+ function Jp(e) {
18872
18890
  if (!e) return;
18873
- let t = Up(e);
18891
+ let t = Gp(e);
18874
18892
  if (t?.kind === "px") return {
18875
18893
  height: `${t.value}px`,
18876
18894
  overflow: "hidden"
@@ -18882,12 +18900,12 @@ function Kp(e) {
18882
18900
  }
18883
18901
  //#endregion
18884
18902
  //#region src/components/detail-layout/LayoutColumn.tsx
18885
- function qp({ config: e, ctx: t }) {
18903
+ function Yp({ config: e, ctx: t }) {
18886
18904
  let { items: n, gap: r = 12 } = e;
18887
18905
  return /* @__PURE__ */ L("div", {
18888
18906
  className: "flex flex-col h-full",
18889
18907
  style: { gap: r ? `${r}px` : void 0 },
18890
- children: n.map((e, n) => /* @__PURE__ */ L(dh, {
18908
+ children: n.map((e, n) => /* @__PURE__ */ L(ph, {
18891
18909
  node: e,
18892
18910
  ctx: t
18893
18911
  }, n))
@@ -18895,7 +18913,7 @@ function qp({ config: e, ctx: t }) {
18895
18913
  }
18896
18914
  //#endregion
18897
18915
  //#region src/components/detail-layout/LayoutTabs.tsx
18898
- function Jp(e, t) {
18916
+ function Xp(e, t) {
18899
18917
  if (e.children) {
18900
18918
  if (e.label) return X(e.label);
18901
18919
  let n = t.entity.children?.find((t) => t.entity === e.children);
@@ -18905,7 +18923,7 @@ function Jp(e, t) {
18905
18923
  }
18906
18924
  return e.section ? X(e.section.name) : "Tab";
18907
18925
  }
18908
- function Yp(e, t) {
18926
+ function Zp(e, t) {
18909
18927
  if (e.icon) return e.icon;
18910
18928
  if (e.children) {
18911
18929
  let n = t.entity.children?.find((t) => t.entity === e.children);
@@ -18914,7 +18932,7 @@ function Yp(e, t) {
18914
18932
  if (r) return r.display.icon;
18915
18933
  }
18916
18934
  }
18917
- function Xp({ config: e, ctx: t }) {
18935
+ function Qp({ config: e, ctx: t }) {
18918
18936
  let { items: n } = e, [r, i] = p(0);
18919
18937
  return n.length === 0 ? null : /* @__PURE__ */ L(Be, {
18920
18938
  title: /* @__PURE__ */ L("div", {
@@ -18928,7 +18946,7 @@ function Xp({ config: e, ctx: t }) {
18928
18946
  overflowX: "auto"
18929
18947
  },
18930
18948
  children: n.map((e, n) => {
18931
- let a = Jp(e, t), o = Yp(e, t), s = n === r;
18949
+ let a = Xp(e, t), o = Zp(e, t), s = n === r;
18932
18950
  return /* @__PURE__ */ R("button", {
18933
18951
  onClick: (e) => {
18934
18952
  e.stopPropagation(), i(n);
@@ -18957,7 +18975,7 @@ function Xp({ config: e, ctx: t }) {
18957
18975
  }),
18958
18976
  collapsible: !1,
18959
18977
  padding: "14px",
18960
- children: /* @__PURE__ */ L(dh, {
18978
+ children: /* @__PURE__ */ L(ph, {
18961
18979
  node: n[r],
18962
18980
  ctx: t
18963
18981
  }, r)
@@ -18965,7 +18983,7 @@ function Xp({ config: e, ctx: t }) {
18965
18983
  }
18966
18984
  //#endregion
18967
18985
  //#region src/components/detail-layout/SectionBlock.tsx
18968
- function Zp({ config: e, ctx: t }) {
18986
+ function $p({ config: e, ctx: t }) {
18969
18987
  let { name: n, items: r, collapsed: i = !1, columns: a, icon: o, badge: s } = e, c = a ? {
18970
18988
  ...t,
18971
18989
  columns: a
@@ -18979,7 +18997,7 @@ function Zp({ config: e, ctx: t }) {
18979
18997
  defaultOpen: !i,
18980
18998
  icon: u,
18981
18999
  badge: d,
18982
- children: /* @__PURE__ */ L(uh, {
19000
+ children: /* @__PURE__ */ L(fh, {
18983
19001
  nodes: r,
18984
19002
  ctx: c
18985
19003
  })
@@ -18987,37 +19005,37 @@ function Zp({ config: e, ctx: t }) {
18987
19005
  }
18988
19006
  //#endregion
18989
19007
  //#region src/lib/child-config.ts
18990
- function Qp(e, t, n) {
18991
- let r = e.display, i = $p(n?.mode, r?.mode, "table"), a = i === "timeline" ? 50 : 20, o = {
19008
+ function em(e, t, n) {
19009
+ let r = e.display, i = tm(n?.mode, r?.mode, "table"), a = i === "timeline" ? 50 : 20, o = {
18992
19010
  entity: e.entity,
18993
19011
  foreign_key: e.foreign_key,
18994
- name: $p(n?.label, r?.name, tm(t)),
18995
- icon: $p(n?.icon, r?.icon, t.display.icon) ?? "",
19012
+ name: tm(n?.label, r?.name, rm(t)),
19013
+ icon: tm(n?.icon, r?.icon, t.display.icon) ?? "",
18996
19014
  mode: i,
18997
- columns: $p(n?.columns, r?.columns, rm(t, e.foreign_key)),
18998
- sort: $p(n?.sort, r?.sort, nm(t)),
18999
- limit: $p(n?.limit, r?.limit, a),
19000
- editable: $p(n?.editable, r?.editable, !0),
19001
- interaction: $p(n?.interaction, r?.interaction, em(t))
19002
- }, s = $p(n?.position_field, r?.position_field, void 0);
19015
+ columns: tm(n?.columns, r?.columns, am(t, e.foreign_key)),
19016
+ sort: tm(n?.sort, r?.sort, im(t)),
19017
+ limit: tm(n?.limit, r?.limit, a),
19018
+ editable: tm(n?.editable, r?.editable, !0),
19019
+ interaction: tm(n?.interaction, r?.interaction, nm(t))
19020
+ }, s = tm(n?.position_field, r?.position_field, void 0);
19003
19021
  s && (o.position_field = s, o.sort = s + ":asc");
19004
19022
  let c = n?.timeline ?? r?.timeline;
19005
- o.mode === "timeline" ? o.timeline = im(c ?? {}, t) : c && (o.timeline = c);
19023
+ o.mode === "timeline" ? o.timeline = om(c ?? {}, t) : c && (o.timeline = c);
19006
19024
  let l = n?.cards ?? r?.cards;
19007
19025
  l && (o.cards = l);
19008
19026
  let u = n?.quick_add ?? e.quick_add;
19009
19027
  return u && (o.quick_add = u), o;
19010
19028
  }
19011
- function $p(e, t, n) {
19029
+ function tm(e, t, n) {
19012
19030
  return e ?? t ?? n;
19013
19031
  }
19014
- function em(e) {
19032
+ function nm(e) {
19015
19033
  return ht(e, "update") ? "inline_edit" : "readonly";
19016
19034
  }
19017
- function tm(e) {
19035
+ function rm(e) {
19018
19036
  return e.display.name_plural && Object.keys(e.display.name_plural).length > 0 ? e.display.name_plural : e.display.name;
19019
19037
  }
19020
- function nm(e) {
19038
+ function im(e) {
19021
19039
  if (e.fields.get("created_at")?.type === "timestamp") return "created_at:desc";
19022
19040
  if (e.fields.get("updated_at")?.type === "timestamp") return "updated_at:desc";
19023
19041
  for (let t of e.fields.names()) {
@@ -19028,10 +19046,10 @@ function nm(e) {
19028
19046
  let n = e.fields.get(t);
19029
19047
  if (n && n.type === "date") return t + ":desc";
19030
19048
  }
19031
- let t = um(e);
19049
+ let t = fm(e);
19032
19050
  return t ? t + ":asc" : "";
19033
19051
  }
19034
- function rm(e, t) {
19052
+ function am(e, t) {
19035
19053
  let n = new Set(Array.isArray(t) ? t : [t]), r = [];
19036
19054
  for (let t of e.fields.names()) {
19037
19055
  if (r.length >= 6) break;
@@ -19040,11 +19058,11 @@ function rm(e, t) {
19040
19058
  }
19041
19059
  return r;
19042
19060
  }
19043
- function im(e, t) {
19061
+ function om(e, t) {
19044
19062
  let n = { ...e };
19045
- return n.time_field ||= sm(t), n.type_field ||= cm(t, "enum"), n.summary_field ||= lm(t, "string", "text", "rich_text"), n.content_field ||= lm(t, "rich_text", "text"), n.summary_field && n.content_field && n.summary_field === n.content_field && (n.summary_field = void 0), n.author_field || t.fields.get("created_by") && (n.author_field = "created_by"), n.direction_field ||= am(t), n.intent_field ||= om(t), n;
19063
+ return n.time_field ||= lm(t), n.type_field ||= um(t, "enum"), n.summary_field ||= dm(t, "string", "text", "rich_text"), n.content_field ||= dm(t, "rich_text", "text"), n.summary_field && n.content_field && n.summary_field === n.content_field && (n.summary_field = void 0), n.author_field || t.fields.get("created_by") && (n.author_field = "created_by"), n.direction_field ||= sm(t), n.intent_field ||= cm(t), n;
19046
19064
  }
19047
- function am(e) {
19065
+ function sm(e) {
19048
19066
  let t = e.fields.get("direction");
19049
19067
  if (t && t.type === "enum") return "direction";
19050
19068
  for (let t of [
@@ -19057,11 +19075,11 @@ function am(e) {
19057
19075
  if (n && n.type === "bool") return t;
19058
19076
  }
19059
19077
  }
19060
- function om(e) {
19078
+ function cm(e) {
19061
19079
  let t = e.fields.get("intent");
19062
19080
  if (t && t.type === "enum") return "intent";
19063
19081
  }
19064
- function sm(e) {
19082
+ function lm(e) {
19065
19083
  for (let t of e.fields.names()) {
19066
19084
  let n = e.fields.get(t);
19067
19085
  if (n && n.type === "timestamp" && !n.auto) return t;
@@ -19073,13 +19091,13 @@ function sm(e) {
19073
19091
  if (n && n.type === "timestamp") return t;
19074
19092
  }
19075
19093
  }
19076
- function cm(e, t) {
19094
+ function um(e, t) {
19077
19095
  for (let n of e.fields.names()) {
19078
19096
  let r = e.fields.get(n);
19079
19097
  if (r && r.type === t) return n;
19080
19098
  }
19081
19099
  }
19082
- function lm(e, ...t) {
19100
+ function dm(e, ...t) {
19083
19101
  for (let n of e.fields.names()) {
19084
19102
  let r = e.fields.get(n);
19085
19103
  if (r) {
@@ -19087,16 +19105,16 @@ function lm(e, ...t) {
19087
19105
  }
19088
19106
  }
19089
19107
  }
19090
- function um(e) {
19108
+ function fm(e) {
19091
19109
  let t = gt(e);
19092
19110
  return t.length > 0 ? t[0] : void 0;
19093
19111
  }
19094
- function dm(e, t) {
19112
+ function pm(e, t) {
19095
19113
  return e.children?.find((e) => e.entity === t);
19096
19114
  }
19097
19115
  //#endregion
19098
19116
  //#region src/lib/quick-add.ts
19099
- function fm(e, t, n, r) {
19117
+ function mm(e, t, n, r) {
19100
19118
  let i = {
19101
19119
  ...t ?? {},
19102
19120
  ...e
@@ -19108,7 +19126,7 @@ function fm(e, t, n, r) {
19108
19126
  } else i[n] = Array.isArray(r) ? r[0] : r;
19109
19127
  return i;
19110
19128
  }
19111
- function pm(e, t) {
19129
+ function hm(e, t) {
19112
19130
  for (let n of t) {
19113
19131
  let t = e[n];
19114
19132
  if (t == null || t === "") return !1;
@@ -19117,7 +19135,7 @@ function pm(e, t) {
19117
19135
  }
19118
19136
  //#endregion
19119
19137
  //#region src/components/detail-layout/useQuickAdd.ts
19120
- function mm(e, t, n, r) {
19138
+ function gm(e, t, n, r) {
19121
19139
  let [i, a] = p(() => {
19122
19140
  let t = e.quick_add, n = r.entities[e.entity], i = {};
19123
19141
  if (t?.fields) for (let e of t.fields) t.defaults?.[e] == null ? n?.fields.get(e)?.type === "timestamp" && (i[e] = ca()) : i[e] = t.defaults[e];
@@ -19169,9 +19187,9 @@ function mm(e, t, n, r) {
19169
19187
  e.entity
19170
19188
  ] });
19171
19189
  }
19172
- }), d = e.quick_add, f = r.entities[e.entity], m = pm(i, d?.fields.filter((e) => f?.fields.get(e)?.required) ?? []);
19190
+ }), d = e.quick_add, f = r.entities[e.entity], m = hm(i, d?.fields.filter((e) => f?.fields.get(e)?.required) ?? []);
19173
19191
  function h(t) {
19174
- t.preventDefault(), d && s(fm(i, d.defaults, e.foreign_key, n));
19192
+ t.preventDefault(), d && s(mm(i, d.defaults, e.foreign_key, n));
19175
19193
  }
19176
19194
  function g(e, t) {
19177
19195
  l && u(), a((n) => ({
@@ -19192,8 +19210,8 @@ function mm(e, t, n, r) {
19192
19210
  }
19193
19211
  //#endregion
19194
19212
  //#region src/components/detail-layout/QuickAddForm.tsx
19195
- function hm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19196
- let { values: i, quickAdd: a, childEntity: o, isPending: s, error: c, isReady: l, handleSubmit: u, handleFieldChange: d } = mm(e, t, n, r), f = Fl();
19213
+ function _m({ config: e, parentEntity: t, parentId: n, schema: r }) {
19214
+ let { values: i, quickAdd: a, childEntity: o, isPending: s, error: c, isReady: l, handleSubmit: u, handleFieldChange: d } = gm(e, t, n, r), f = Fl();
19197
19215
  return !a || a.fields.length === 0 || !o ? null : /* @__PURE__ */ R("form", {
19198
19216
  onSubmit: u,
19199
19217
  style: {
@@ -19252,10 +19270,10 @@ function hm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19252
19270
  }
19253
19271
  //#endregion
19254
19272
  //#region src/components/detail-layout/ChildrenTable.tsx
19255
- function gm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19273
+ function vm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19256
19274
  let i = r.entities[e.entity], a = rr(), o = Fl(), { data: s, isLoading: c, isError: l } = Du(t, n, e.entity, e.foreign_key, e.sort, e.limit), u = s?.data ?? [], p = s?.$refs, m = f(p);
19257
19275
  m.current = p;
19258
- let h = e.columns, g = e.interaction === "navigate", _ = h[0], v = g && i ? St(void 0, i, r.screens) : null, y = i ? um(i) : void 0, b = d(() => {
19276
+ let h = e.columns, g = e.interaction === "navigate", _ = h[0], v = g && i ? St(void 0, i, r.screens) : null, y = i ? fm(i) : void 0, b = d(() => {
19259
19277
  let e = /* @__PURE__ */ new Map();
19260
19278
  if (!i) return e;
19261
19279
  for (let t of h) {
@@ -19287,7 +19305,7 @@ function gm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19287
19305
  },
19288
19306
  children: "Entity not found."
19289
19307
  });
19290
- let x = /* @__PURE__ */ L(hm, {
19308
+ let x = /* @__PURE__ */ L(_m, {
19291
19309
  config: e,
19292
19310
  parentEntity: t,
19293
19311
  parentId: n,
@@ -19385,7 +19403,7 @@ function gm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19385
19403
  }
19386
19404
  //#endregion
19387
19405
  //#region src/components/detail-layout/ChildrenList.tsx
19388
- function _m({ config: e, parentEntity: t, parentId: n, schema: r }) {
19406
+ function ym({ config: e, parentEntity: t, parentId: n, schema: r }) {
19389
19407
  let i = r.entities[e.entity], a = Fl(), { data: o, isLoading: s, isError: c } = Du(t, n, e.entity, e.foreign_key, e.sort, e.limit), l = o?.data ?? [], u = o?.$refs, d = e.columns;
19390
19408
  if (!i) return /* @__PURE__ */ L("div", {
19391
19409
  style: {
@@ -19395,7 +19413,7 @@ function _m({ config: e, parentEntity: t, parentId: n, schema: r }) {
19395
19413
  },
19396
19414
  children: "Entity not found."
19397
19415
  });
19398
- let f = /* @__PURE__ */ L(hm, {
19416
+ let f = /* @__PURE__ */ L(_m, {
19399
19417
  config: e,
19400
19418
  parentEntity: t,
19401
19419
  parentId: n,
@@ -19505,7 +19523,7 @@ function _m({ config: e, parentEntity: t, parentId: n, schema: r }) {
19505
19523
  }
19506
19524
  //#endregion
19507
19525
  //#region src/components/detail-layout/ChildrenCards.tsx
19508
- function vm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19526
+ function bm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19509
19527
  let i = r.entities[e.entity], a = Fl(), { data: o, isLoading: s, isError: c } = Du(t, n, e.entity, e.foreign_key, e.sort, e.limit), l = o?.data ?? [], u = o?.$refs, d = e.columns, f = e.cards, p = f?.header_field ?? d[0], m = f?.badge_field, h = f?.columns_count ?? 3;
19510
19528
  if (!i) return /* @__PURE__ */ L("div", {
19511
19529
  style: {
@@ -19519,7 +19537,7 @@ function vm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19519
19537
  display: "grid",
19520
19538
  gridTemplateColumns: `repeat(auto-fill, minmax(${h >= 4 ? 180 : 240}px, 1fr))`,
19521
19539
  gap: 12
19522
- }, _ = /* @__PURE__ */ L(hm, {
19540
+ }, _ = /* @__PURE__ */ L(_m, {
19523
19541
  config: e,
19524
19542
  parentEntity: t,
19525
19543
  parentId: n,
@@ -19648,9 +19666,9 @@ function vm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19648
19666
  }
19649
19667
  //#endregion
19650
19668
  //#region src/hooks/useTimelineData.ts
19651
- var ym = 50;
19652
- function bm(e, t, n, r, i, a) {
19653
- let o = Array.isArray(r) ? r : [r], s = Array.isArray(r) ? xt(t, o.length) : [t], c = a ?? ym, l = A({
19669
+ var xm = 50;
19670
+ function Sm(e, t, n, r, i, a) {
19671
+ let o = Array.isArray(r) ? r : [r], s = Array.isArray(r) ? xt(t, o.length) : [t], c = a ?? xm, l = A({
19654
19672
  queryKey: [
19655
19673
  Eu,
19656
19674
  e,
@@ -19686,15 +19704,15 @@ function bm(e, t, n, r, i, a) {
19686
19704
  }
19687
19705
  //#endregion
19688
19706
  //#region src/components/detail-layout/TimelineComposer.tsx
19689
- var xm = "quick_entry", Sm = 100, Cm = 240, wm = 800, Tm = 80;
19690
- function Em({ config: e, parentEntity: t, parentId: n, schema: r }) {
19691
- let { values: i, quickAdd: a, childEntity: o, isPending: c, error: u, isReady: m, handleSubmit: h, handleFieldChange: g } = mm(e, t, n, r), _ = Fl(), [v, y] = p(Cm), b = f(null), x = f(null), [S, C] = p(wm);
19707
+ var Cm = "quick_entry", wm = 100, Tm = 240, Em = 800, Dm = 80;
19708
+ function Om({ config: e, parentEntity: t, parentId: n, schema: r }) {
19709
+ let { values: i, quickAdd: a, childEntity: o, isPending: c, error: u, isReady: m, handleSubmit: h, handleFieldChange: g } = gm(e, t, n, r), _ = Fl(), [v, y] = p(Tm), b = f(null), x = f(null), [S, C] = p(Em);
19692
19710
  l(() => {
19693
19711
  let e = x.current?.parentElement;
19694
19712
  if (!e) return;
19695
19713
  let t = () => {
19696
- let t = Math.max(Sm, e.clientHeight - Tm);
19697
- C(Math.min(wm, t));
19714
+ let t = Math.max(wm, e.clientHeight - Dm);
19715
+ C(Math.min(Em, t));
19698
19716
  };
19699
19717
  t();
19700
19718
  let n = new ResizeObserver(t);
@@ -19716,7 +19734,7 @@ function Em({ config: e, parentEntity: t, parentId: n, schema: r }) {
19716
19734
  t && (t.querySelector("textarea, input, select, [contenteditable]") ?? t).focus();
19717
19735
  }
19718
19736
  }), []);
19719
- l(() => Ll(xm, D), [D]);
19737
+ l(() => Ll(Cm, D), [D]);
19720
19738
  let O = s((e) => {
19721
19739
  e.preventDefault(), b.current = {
19722
19740
  startY: e.clientY,
@@ -19725,7 +19743,7 @@ function Em({ config: e, parentEntity: t, parentId: n, schema: r }) {
19725
19743
  let t = (e) => {
19726
19744
  if (!b.current) return;
19727
19745
  let t = b.current.startY - e.clientY;
19728
- y(Math.min(S, Math.max(Sm, b.current.startHeight + t)));
19746
+ y(Math.min(S, Math.max(wm, b.current.startHeight + t)));
19729
19747
  }, n = () => {
19730
19748
  b.current = null, document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
19731
19749
  };
@@ -19860,16 +19878,16 @@ function Em({ config: e, parentEntity: t, parentId: n, schema: r }) {
19860
19878
  }
19861
19879
  //#endregion
19862
19880
  //#region src/components/detail-layout/ChildrenTimeline.tsx
19863
- var Dm = 80, Om = 200;
19864
- function km(e) {
19881
+ var km = 80, Am = 200;
19882
+ function jm(e) {
19865
19883
  let t = e.id;
19866
19884
  return t == null ? "" : String(t);
19867
19885
  }
19868
- function Am(e) {
19886
+ function Mm(e) {
19869
19887
  return e.__optimistic === !0;
19870
19888
  }
19871
- function jm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19872
- let i = r.entities[e.entity], { rows: a, refs: o, fetchNextPage: c, hasOlder: m, isFetchingOlder: h, isLoading: g, isError: _ } = bm(t, n, e.entity, e.foreign_key, e.timeline?.time_field, e.limit), v = e.timeline, y = v?.scroll ?? !1, b = (e.sort ?? "").endsWith(":asc"), x = d(() => b ? [...a].reverse() : a, [a, b]), S = v?.auto_scroll ?? "none", C = f(null), w = f(null), T = f(!1), E = f(0), D = f(null), O = f(null), k = f(!0), A = f(null);
19889
+ function Nm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19890
+ let i = r.entities[e.entity], { rows: a, refs: o, fetchNextPage: c, hasOlder: m, isFetchingOlder: h, isLoading: g, isError: _ } = Sm(t, n, e.entity, e.foreign_key, e.timeline?.time_field, e.limit), v = e.timeline, y = v?.scroll ?? !1, b = (e.sort ?? "").endsWith(":asc"), x = d(() => b ? [...a].reverse() : a, [a, b]), S = v?.auto_scroll ?? "none", C = f(null), w = f(null), T = f(!1), E = f(0), D = f(null), O = f(null), k = f(!0), A = f(null);
19873
19891
  l(() => {
19874
19892
  T.current = !1, E.current = 0, D.current = null, O.current = null, k.current = !0, A.current = null;
19875
19893
  }, [n]), u(() => {
@@ -19883,7 +19901,7 @@ function jm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19883
19901
  E.current = x.length;
19884
19902
  return;
19885
19903
  }
19886
- let t = km(x[0]), n = km(x[x.length - 1]), r = !T.current, i = x.length > E.current && E.current > 0, a = i && (b && t !== D.current && n === O.current || !b && n !== O.current && t === D.current), o = i && !a;
19904
+ let t = jm(x[0]), n = jm(x[x.length - 1]), r = !T.current, i = x.length > E.current && E.current > 0, a = i && (b && t !== D.current && n === O.current || !b && n !== O.current && t === D.current), o = i && !a;
19887
19905
  if (r) b && S === "bottom" && (e.scrollTop = e.scrollHeight), T.current = !0;
19888
19906
  else if (a && A.current) {
19889
19907
  let t = A.current;
@@ -19897,7 +19915,7 @@ function jm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19897
19915
  ]);
19898
19916
  let j = s(() => {
19899
19917
  let e = C.current;
19900
- e && (k.current = e.scrollHeight - e.scrollTop - e.clientHeight < Dm);
19918
+ e && (k.current = e.scrollHeight - e.scrollTop - e.clientHeight < km);
19901
19919
  }, []);
19902
19920
  l(() => {
19903
19921
  let e = w.current;
@@ -19906,7 +19924,7 @@ function jm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19906
19924
  for (let t of e) t.isIntersecting && m && !h && c();
19907
19925
  }, {
19908
19926
  root: C.current ?? null,
19909
- rootMargin: `${Om}px 0px 0px 0px`,
19927
+ rootMargin: `${Am}px 0px 0px 0px`,
19910
19928
  threshold: 0
19911
19929
  });
19912
19930
  return t.observe(e), () => t.disconnect();
@@ -19976,8 +19994,8 @@ function jm({ config: e, parentEntity: t, parentId: n, schema: r }) {
19976
19994
  z,
19977
19995
  ee,
19978
19996
  x.map((a, s) => {
19979
- let c = km(a) || String(s), l = Am(a);
19980
- return /* @__PURE__ */ L(Mm, {
19997
+ let c = jm(a) || String(s), l = Mm(a);
19998
+ return /* @__PURE__ */ L(Pm, {
19981
19999
  row: a,
19982
20000
  rowId: c,
19983
20001
  childEntity: i,
@@ -20033,7 +20051,7 @@ function jm({ config: e, parentEntity: t, parentId: n, schema: r }) {
20033
20051
  },
20034
20052
  children: te
20035
20053
  }),
20036
- /* @__PURE__ */ L(Em, {
20054
+ /* @__PURE__ */ L(Om, {
20037
20055
  config: e,
20038
20056
  parentEntity: t,
20039
20057
  parentId: n,
@@ -20047,14 +20065,14 @@ function jm({ config: e, parentEntity: t, parentId: n, schema: r }) {
20047
20065
  gap: 8
20048
20066
  },
20049
20067
  children: te
20050
- }), /* @__PURE__ */ L(Em, {
20068
+ }), /* @__PURE__ */ L(Om, {
20051
20069
  config: e,
20052
20070
  parentEntity: t,
20053
20071
  parentId: n,
20054
20072
  schema: r
20055
20073
  })] });
20056
20074
  }
20057
- function Mm({ row: e, rowId: t, childEntity: n, entityCode: r, parentEntity: i, parentId: a, timeline: o, editableFields: c, refs: l, isEditing: u, onStartEdit: d, onCancelEdit: f, onSaved: m, schema: h, optimistic: g = !1 }) {
20075
+ function Pm({ row: e, rowId: t, childEntity: n, entityCode: r, parentEntity: i, parentId: a, timeline: o, editableFields: c, refs: l, isEditing: u, onStartEdit: d, onCancelEdit: f, onSaved: m, schema: h, optimistic: g = !1 }) {
20058
20076
  let _ = N(), v = Fl(), [y, b] = p({}), x = s(() => {
20059
20077
  _.invalidateQueries({ queryKey: [
20060
20078
  Eu,
@@ -20195,7 +20213,7 @@ function Mm({ row: e, rowId: t, childEntity: n, entityCode: r, parentEntity: i,
20195
20213
  locale: v
20196
20214
  })
20197
20215
  }),
20198
- M && e[M] != null && n.fields.get(M) && /* @__PURE__ */ L(Nm, {
20216
+ M && e[M] != null && n.fields.get(M) && /* @__PURE__ */ L(Fm, {
20199
20217
  value: e[M],
20200
20218
  field: n.fields.get(M)
20201
20219
  }),
@@ -20281,8 +20299,8 @@ function Mm({ row: e, rowId: t, childEntity: n, entityCode: r, parentEntity: i,
20281
20299
  ]
20282
20300
  });
20283
20301
  }
20284
- function Nm({ value: e, field: t }) {
20285
- let n = Pm(e, t);
20302
+ function Fm({ value: e, field: t }) {
20303
+ let n = Im(e, t);
20286
20304
  return n === null ? null : /* @__PURE__ */ L(G, {
20287
20305
  tone: "slate",
20288
20306
  size: "xs",
@@ -20296,7 +20314,7 @@ function Nm({ value: e, field: t }) {
20296
20314
  })
20297
20315
  });
20298
20316
  }
20299
- function Pm(e, t) {
20317
+ function Im(e, t) {
20300
20318
  if (t.type === "bool") return e === !0;
20301
20319
  if (typeof e == "string") {
20302
20320
  let t = e.toLowerCase();
@@ -20307,7 +20325,7 @@ function Pm(e, t) {
20307
20325
  }
20308
20326
  //#endregion
20309
20327
  //#region src/components/detail-layout/EditableChildrenTable.tsx
20310
- function Fm({ config: e, childEntity: t, schema: n, rows: r, onChange: i, validationErrors: a, refs: o }) {
20328
+ function Lm({ config: e, childEntity: t, schema: n, rows: r, onChange: i, validationErrors: a, refs: o }) {
20311
20329
  let c = Fl(), l = f(null), u = e.columns, d = new Set(Array.isArray(e.foreign_key) ? e.foreign_key : [e.foreign_key]), p = u.filter((n) => {
20312
20330
  if (d.has(n) || e.position_field && n === e.position_field) return !1;
20313
20331
  let r = t.fields.get(n);
@@ -20490,7 +20508,7 @@ function Fm({ config: e, childEntity: t, schema: n, rows: r, onChange: i, valida
20490
20508
  }
20491
20509
  //#endregion
20492
20510
  //#region src/components/detail-layout/DraggableChildrenTable.tsx
20493
- function Im({ config: e, childEntity: t, schema: n, rows: r, onChange: i, validationErrors: a, refs: o }) {
20511
+ function Rm({ config: e, childEntity: t, schema: n, rows: r, onChange: i, validationErrors: a, refs: o }) {
20494
20512
  let c = f(null), l = e.position_field, u = e.columns, p = he(me(fe, { activationConstraint: { distance: 5 } })), m = new Set(Array.isArray(e.foreign_key) ? e.foreign_key : [e.foreign_key]), h = u.filter((e) => {
20495
20513
  if (m.has(e) || e === l) return !1;
20496
20514
  let n = t.fields.get(e);
@@ -20629,7 +20647,7 @@ function Im({ config: e, childEntity: t, schema: n, rows: r, onChange: i, valida
20629
20647
  ] }) }), /* @__PURE__ */ L(ge, {
20630
20648
  items: v,
20631
20649
  strategy: be,
20632
- children: /* @__PURE__ */ L("tbody", { children: r.map((e) => /* @__PURE__ */ L(Lm, {
20650
+ children: /* @__PURE__ */ L("tbody", { children: r.map((e) => /* @__PURE__ */ L(zm, {
20633
20651
  row: e,
20634
20652
  columns: _,
20635
20653
  editableColumns: h,
@@ -20655,7 +20673,7 @@ function Im({ config: e, childEntity: t, schema: n, rows: r, onChange: i, valida
20655
20673
  })
20656
20674
  })] });
20657
20675
  }
20658
- function Lm({ row: e, columns: t, editableColumns: n, displayOnlyColumns: r, childEntity: i, validationErrors: a, refs: o, onCellChange: s, onDelete: c, onUndoDelete: l }) {
20676
+ function zm({ row: e, columns: t, editableColumns: n, displayOnlyColumns: r, childEntity: i, validationErrors: a, refs: o, onCellChange: s, onDelete: c, onUndoDelete: l }) {
20659
20677
  let u = Fl(), d = !!e._deleted, f = a?.[e._key], { attributes: p, listeners: m, setNodeRef: h, transform: g, transition: _, isDragging: v } = ye({
20660
20678
  id: e._key,
20661
20679
  disabled: d
@@ -20762,10 +20780,10 @@ function Lm({ row: e, columns: t, editableColumns: n, displayOnlyColumns: r, chi
20762
20780
  }
20763
20781
  //#endregion
20764
20782
  //#region src/components/detail-layout/ChildrenBlock.tsx
20765
- function Rm({ node: e, ctx: t }) {
20783
+ function Bm({ node: e, ctx: t }) {
20766
20784
  let n = e.children;
20767
20785
  if (!n || t.isNew && t.mode !== "edit") return null;
20768
- let r = dm(t.entity, n);
20786
+ let r = pm(t.entity, n);
20769
20787
  if (!r) return /* @__PURE__ */ R("div", {
20770
20788
  className: "text-sm text-muted-foreground py-2",
20771
20789
  children: ["Unknown child relation: ", n]
@@ -20775,10 +20793,10 @@ function Rm({ node: e, ctx: t }) {
20775
20793
  className: "text-sm text-muted-foreground py-2",
20776
20794
  children: ["Entity not found: ", r.entity]
20777
20795
  });
20778
- let a = Qp(r, i, e);
20796
+ let a = em(r, i, e);
20779
20797
  if (t.mode === "edit" && a.editable && a.interaction !== "navigate" && a.interaction !== "readonly" && ht(i, "update") && a.mode === "table" && t.pendingChildren !== void 0 && t.onChildrenChange) {
20780
20798
  let e = t.pendingChildren[n] ?? [], r = t.childValidationErrors?.[n];
20781
- return /* @__PURE__ */ L(a.position_field ? Im : Fm, {
20799
+ return /* @__PURE__ */ L(a.position_field ? Rm : Lm, {
20782
20800
  config: a,
20783
20801
  childEntity: i,
20784
20802
  schema: t.schema,
@@ -20796,16 +20814,16 @@ function Rm({ node: e, ctx: t }) {
20796
20814
  schema: t.schema
20797
20815
  };
20798
20816
  switch (a.mode) {
20799
- case "table": return /* @__PURE__ */ L(gm, { ...o });
20800
- case "list": return /* @__PURE__ */ L(_m, { ...o });
20801
- case "cards": return /* @__PURE__ */ L(vm, { ...o });
20802
- case "timeline": return /* @__PURE__ */ L(jm, { ...o });
20803
- default: return /* @__PURE__ */ L(gm, { ...o });
20817
+ case "table": return /* @__PURE__ */ L(vm, { ...o });
20818
+ case "list": return /* @__PURE__ */ L(ym, { ...o });
20819
+ case "cards": return /* @__PURE__ */ L(bm, { ...o });
20820
+ case "timeline": return /* @__PURE__ */ L(Nm, { ...o });
20821
+ default: return /* @__PURE__ */ L(vm, { ...o });
20804
20822
  }
20805
20823
  }
20806
20824
  //#endregion
20807
20825
  //#region src/hooks/useAssociatedData.ts
20808
- function zm(e, t, n, r, i, a, o, s) {
20826
+ function Vm(e, t, n, r, i, a, o, s) {
20809
20827
  return A({
20810
20828
  queryKey: [
20811
20829
  Eu,
@@ -20837,7 +20855,7 @@ function zm(e, t, n, r, i, a, o, s) {
20837
20855
  }
20838
20856
  //#endregion
20839
20857
  //#region src/components/shared/ActionConfirmDialog.tsx
20840
- function Bm({ open: e, onOpenChange: t, actionName: n, message: r, onConfirm: i, isPending: a }) {
20858
+ function Hm({ open: e, onOpenChange: t, actionName: n, message: r, onConfirm: i, isPending: a }) {
20841
20859
  return e ? /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("div", {
20842
20860
  onClick: () => !a && t(!1),
20843
20861
  style: {
@@ -20938,7 +20956,7 @@ function Bm({ open: e, onOpenChange: t, actionName: n, message: r, onConfirm: i,
20938
20956
  }
20939
20957
  //#endregion
20940
20958
  //#region src/components/shared/ActionResultDialog.tsx
20941
- function Vm({ open: e, onClose: t, display: n }) {
20959
+ function Um({ open: e, onClose: t, display: n }) {
20942
20960
  return e ? /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("div", { style: {
20943
20961
  position: "fixed",
20944
20962
  inset: 0,
@@ -21020,7 +21038,7 @@ function Vm({ open: e, onClose: t, display: n }) {
21020
21038
  gap: 12,
21021
21039
  overflowY: "auto"
21022
21040
  },
21023
- children: n.fields.map((e, t) => /* @__PURE__ */ L(Hm, { field: e }, t))
21041
+ children: n.fields.map((e, t) => /* @__PURE__ */ L(Wm, { field: e }, t))
21024
21042
  }),
21025
21043
  /* @__PURE__ */ R("div", {
21026
21044
  style: {
@@ -21040,7 +21058,7 @@ function Vm({ open: e, onClose: t, display: n }) {
21040
21058
  ]
21041
21059
  })] }) : null;
21042
21060
  }
21043
- function Hm({ field: e }) {
21061
+ function Wm({ field: e }) {
21044
21062
  return /* @__PURE__ */ R("div", {
21045
21063
  style: {
21046
21064
  display: "flex",
@@ -21084,7 +21102,7 @@ function Hm({ field: e }) {
21084
21102
  }
21085
21103
  //#endregion
21086
21104
  //#region src/components/shared/ActionButton.tsx
21087
- function Um({ actionCode: e, action: t, entityCode: n, objectIds: r = [], row: i, variant: a = "outline", size: o = "default", onSuccess: c, onBatchStart: l, onBatchError: u, onBatchPartial: d }) {
21105
+ function Gm({ actionCode: e, action: t, entityCode: n, objectIds: r = [], row: i, variant: a = "outline", size: o = "default", onSuccess: c, onBatchStart: l, onBatchError: u, onBatchPartial: d }) {
21088
21106
  let [f, m] = p(!1), [h, g] = p(!1), [_, v] = p(!1), [y, b] = p(null), x = Hd(n), { data: S } = jn(), C = rr(), w = sf(t), T = of(t), E = !!t.confirmation && Object.keys(t.confirmation).length > 0, D = i ? $d(t.conditions, i) : !0, O = s(async () => {
21089
21107
  if (!(!t.association || r.length === 0)) {
21090
21108
  v(!0);
@@ -21227,7 +21245,7 @@ function Um({ actionCode: e, action: t, entityCode: n, objectIds: r = [], row: i
21227
21245
  isPending: x.isPending,
21228
21246
  row: i
21229
21247
  }),
21230
- E && /* @__PURE__ */ L(Bm, {
21248
+ E && /* @__PURE__ */ L(Hm, {
21231
21249
  open: h,
21232
21250
  onOpenChange: g,
21233
21251
  actionName: z,
@@ -21235,7 +21253,7 @@ function Um({ actionCode: e, action: t, entityCode: n, objectIds: r = [], row: i
21235
21253
  onConfirm: P,
21236
21254
  isPending: x.isPending
21237
21255
  }),
21238
- y && /* @__PURE__ */ L(Vm, {
21256
+ y && /* @__PURE__ */ L(Um, {
21239
21257
  open: !!y,
21240
21258
  onClose: () => {
21241
21259
  b(null), c?.();
@@ -21246,7 +21264,7 @@ function Um({ actionCode: e, action: t, entityCode: n, objectIds: r = [], row: i
21246
21264
  }
21247
21265
  //#endregion
21248
21266
  //#region src/components/shared/RowActionsKebab.tsx
21249
- function Wm({ actions: e, objectIds: t, row: n, onSuccess: r, preMenu: i, divider: a, size: o = 22, align: s = "end" }) {
21267
+ function Km({ actions: e, objectIds: t, row: n, onSuccess: r, preMenu: i, divider: a, size: o = 22, align: s = "end" }) {
21250
21268
  let c = f(null), [l, u] = p(!1), { run: d } = xu();
21251
21269
  if (!i && e.length === 0) return null;
21252
21270
  let m = (e) => () => {
@@ -21301,7 +21319,7 @@ function Wm({ actions: e, objectIds: t, row: n, onSuccess: r, preMenu: i, divide
21301
21319
  }
21302
21320
  //#endregion
21303
21321
  //#region src/components/detail-layout/AssociatedToolbar.tsx
21304
- function Gm({ entity: e, searchable: t, filterFields: n, searchValue: r, onSearchChange: i, filters: a, onFilterChange: o, allEntities: s }) {
21322
+ function qm({ entity: e, searchable: t, filterFields: n, searchValue: r, onSearchChange: i, filters: a, onFilterChange: o, allEntities: s }) {
21305
21323
  let c = t === !0, l = n && n.length > 0;
21306
21324
  return !c && !l ? null : /* @__PURE__ */ R("div", {
21307
21325
  style: {
@@ -21325,7 +21343,7 @@ function Gm({ entity: e, searchable: t, filterFields: n, searchValue: r, onSearc
21325
21343
  let n = e.fields.get(t);
21326
21344
  if (!n) return null;
21327
21345
  let r = a[t] ?? "__all__", i = pt(n, t, s);
21328
- return n.type === "ref" && n.ref?.entity ? /* @__PURE__ */ L(Km, {
21346
+ return n.type === "ref" && n.ref?.entity ? /* @__PURE__ */ L(Jm, {
21329
21347
  field: n,
21330
21348
  label: i,
21331
21349
  value: r,
@@ -21348,7 +21366,7 @@ function Gm({ entity: e, searchable: t, filterFields: n, searchValue: r, onSearc
21348
21366
  })]
21349
21367
  });
21350
21368
  }
21351
- function Km({ field: e, label: t, value: n, onChange: r }) {
21369
+ function Jm({ field: e, label: t, value: n, onChange: r }) {
21352
21370
  let i = Sa(e.ref?.entity), a = e.display?.ref_display_field ?? i?.display?.display_field, o = d(() => i ? [...i.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [i]), { data: s } = xa(e.ref?.entity, {
21353
21371
  per_page: 200,
21354
21372
  sort: a ? `${a}:asc` : void 0
@@ -21381,7 +21399,7 @@ function Km({ field: e, label: t, value: n, onChange: r }) {
21381
21399
  }
21382
21400
  //#endregion
21383
21401
  //#region src/components/detail-layout/AssociatedBlock.tsx
21384
- function qm(e) {
21402
+ function Ym(e) {
21385
21403
  if (!e) return [];
21386
21404
  let t = [];
21387
21405
  for (let [n, r] of Object.entries(e)) (r.visibility ?? []).includes("list_row") && (r.association || t.push({
@@ -21390,7 +21408,7 @@ function qm(e) {
21390
21408
  }));
21391
21409
  return t;
21392
21410
  }
21393
- function Jm(e, t, n) {
21411
+ function Xm(e, t, n) {
21394
21412
  if (!e) return [];
21395
21413
  let r = [];
21396
21414
  for (let [i, a] of Object.entries(e)) {
@@ -21416,7 +21434,7 @@ function Jm(e, t, n) {
21416
21434
  }
21417
21435
  return r;
21418
21436
  }
21419
- function Ym({ node: e, ctx: t }) {
21437
+ function Zm({ node: e, ctx: t }) {
21420
21438
  let n = e.associated;
21421
21439
  if (!n || t.isNew) return null;
21422
21440
  let r = t.schema.entities[n];
@@ -21445,7 +21463,7 @@ function Ym({ node: e, ctx: t }) {
21445
21463
  }
21446
21464
  }
21447
21465
  }
21448
- return a ? /* @__PURE__ */ L(Xm, {
21466
+ return a ? /* @__PURE__ */ L(Qm, {
21449
21467
  node: e,
21450
21468
  ctx: t,
21451
21469
  assocCode: n,
@@ -21465,12 +21483,12 @@ function Ym({ node: e, ctx: t }) {
21465
21483
  ]
21466
21484
  });
21467
21485
  }
21468
- function Xm({ node: e, ctx: t, assocCode: n, assocEntity: r, fkField: i }) {
21486
+ function Qm({ node: e, ctx: t, assocCode: n, assocEntity: r, fkField: i }) {
21469
21487
  let a = e.columns && e.columns.length > 0 ? e.columns.filter((e) => e === i ? !1 : !!r.fields.get(e)) : r.fields.names().filter((e) => {
21470
21488
  if (e === i) return !1;
21471
21489
  let t = r.fields.get(e);
21472
21490
  return !(!t || t.primary || t.display?.is_listable === !1);
21473
- }), o = ht(r, "update"), c = e.interaction ?? (o ? "navigate" : "readonly"), l = c === "inline_edit" && o && e.editable !== !1, u = X(r.display?.name_plural) || X(r.display?.name) || n, f = e.searchable === !0 || e.filters && e.filters.length > 0, m = d(() => Jm(r.actions, i, t.recordId), [
21491
+ }), o = ht(r, "update"), c = e.interaction ?? (o ? "navigate" : "readonly"), l = c === "inline_edit" && o && e.editable !== !1, u = X(r.display?.name_plural) || X(r.display?.name) || n, f = e.searchable === !0 || e.filters && e.filters.length > 0, m = d(() => Xm(r.actions, i, t.recordId), [
21474
21492
  r.actions,
21475
21493
  i,
21476
21494
  t.recordId
@@ -21478,7 +21496,7 @@ function Xm({ node: e, ctx: t, assocCode: n, assocEntity: r, fkField: i }) {
21478
21496
  let e = {};
21479
21497
  for (let { code: t, action: n } of m) e[t] = n;
21480
21498
  return e;
21481
- }, [m]), g = d(() => lf(r.action_layout ?? null ?? vf(h, "list_toolbar"), h, void 0, {}, []), [r.action_layout, h]), { run: _ } = xu(), v = N(), y = s(() => {
21499
+ }, [m]), g = d(() => lf(r.action_layout ?? null ?? bf(h, "list_toolbar"), h, void 0, {}, []), [r.action_layout, h]), { run: _ } = xu(), v = N(), y = s(() => {
21482
21500
  v.invalidateQueries({ predicate: (e) => {
21483
21501
  let t = e.queryKey;
21484
21502
  return t[0] === "entity-children" && t[3] === n;
@@ -21526,13 +21544,13 @@ function Xm({ node: e, ctx: t, assocCode: n, assocEntity: r, fkField: i }) {
21526
21544
  alignItems: "center",
21527
21545
  gap: 6
21528
21546
  },
21529
- children: [r.action_layout ? g.length > 0 && /* @__PURE__ */ L(Vf, {
21547
+ children: [r.action_layout ? g.length > 0 && /* @__PURE__ */ L(Uf, {
21530
21548
  kind: "toolbar",
21531
21549
  layout: g,
21532
21550
  entityActions: h,
21533
21551
  onRun: b,
21534
21552
  ariaLabel: `${u} toolbar actions`
21535
- }) : m.map(({ code: e, action: t }) => /* @__PURE__ */ L(Um, {
21553
+ }) : m.map(({ code: e, action: t }) => /* @__PURE__ */ L(Gm, {
21536
21554
  actionCode: e,
21537
21555
  action: t,
21538
21556
  entityCode: n,
@@ -21547,7 +21565,7 @@ function Xm({ node: e, ctx: t, assocCode: n, assocEntity: r, fkField: i }) {
21547
21565
  children: "Add row"
21548
21566
  })]
21549
21567
  })]
21550
- }), f ? /* @__PURE__ */ L(Qm, {
21568
+ }), f ? /* @__PURE__ */ L(eh, {
21551
21569
  entityCode: n,
21552
21570
  entity: r,
21553
21571
  parentEntity: t.entityCode,
@@ -21561,7 +21579,7 @@ function Xm({ node: e, ctx: t, assocCode: n, assocEntity: r, fkField: i }) {
21561
21579
  filterFields: e.filters,
21562
21580
  sort: e.sort,
21563
21581
  startDraftSignal: x
21564
- }) : /* @__PURE__ */ L(Zm, {
21582
+ }) : /* @__PURE__ */ L($m, {
21565
21583
  entityCode: n,
21566
21584
  entity: r,
21567
21585
  parentEntity: t.entityCode,
@@ -21575,9 +21593,9 @@ function Xm({ node: e, ctx: t, assocCode: n, assocEntity: r, fkField: i }) {
21575
21593
  startDraftSignal: x
21576
21594
  })] });
21577
21595
  }
21578
- function Zm({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: c, ctx: l, sort: u, startDraftSignal: d }) {
21596
+ function $m({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: c, ctx: l, sort: u, startDraftSignal: d }) {
21579
21597
  let f = N(), { data: p, isLoading: m, isError: h } = Du(n, r, e, i, u), g = p?.data ?? [], _ = p?.$refs;
21580
- return /* @__PURE__ */ L($m, {
21598
+ return /* @__PURE__ */ L(th, {
21581
21599
  entityCode: e,
21582
21600
  entity: t,
21583
21601
  parentId: r,
@@ -21606,7 +21624,7 @@ function Zm({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
21606
21624
  startDraftSignal: d
21607
21625
  });
21608
21626
  }
21609
- function Qm({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: c, ctx: u, searchable: m, filterFields: h, sort: g, startDraftSignal: _ }) {
21627
+ function eh({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: c, ctx: u, searchable: m, filterFields: h, sort: g, startDraftSignal: _ }) {
21610
21628
  let v = N(), [y, b] = p(""), [x, S] = p(""), [C, w] = p({}), T = f(void 0);
21611
21629
  l(() => (T.current && clearTimeout(T.current), T.current = setTimeout(() => {
21612
21630
  S(y);
@@ -21624,7 +21642,7 @@ function Qm({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
21624
21642
  [e]: t
21625
21643
  };
21626
21644
  });
21627
- }, []), D = d(() => Object.keys(C).length > 0 ? C : void 0, [C]), { data: O, isLoading: k, isError: A, hasNextPage: j, fetchNextPage: M, isFetchingNextPage: P } = zm(n, r, e, i, g, void 0, x || void 0, D), { rows: F, refs: I } = d(() => {
21645
+ }, []), D = d(() => Object.keys(C).length > 0 ? C : void 0, [C]), { data: O, isLoading: k, isError: A, hasNextPage: j, fetchNextPage: M, isFetchingNextPage: P } = Vm(n, r, e, i, g, void 0, x || void 0, D), { rows: F, refs: I } = d(() => {
21628
21646
  if (!O?.pages) return {
21629
21647
  rows: [],
21630
21648
  refs: void 0
@@ -21646,7 +21664,7 @@ function Qm({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
21646
21664
  } });
21647
21665
  }, [v, e]);
21648
21666
  return /* @__PURE__ */ R("div", { children: [
21649
- /* @__PURE__ */ L(Gm, {
21667
+ /* @__PURE__ */ L(qm, {
21650
21668
  entity: t,
21651
21669
  searchable: m,
21652
21670
  filterFields: h,
@@ -21656,7 +21674,7 @@ function Qm({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
21656
21674
  onFilterChange: E,
21657
21675
  allEntities: u.schema.entities
21658
21676
  }),
21659
- /* @__PURE__ */ L($m, {
21677
+ /* @__PURE__ */ L(th, {
21660
21678
  entityCode: e,
21661
21679
  entity: t,
21662
21680
  parentId: r,
@@ -21685,7 +21703,7 @@ function Qm({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
21685
21703
  })
21686
21704
  ] });
21687
21705
  }
21688
- function $m({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i, editable: a, interaction: o, ctx: c, rows: u, refs: m, isLoading: h, isError: g, invalidateQuery: _, startDraftSignal: v }) {
21706
+ function th({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i, editable: a, interaction: o, ctx: c, rows: u, refs: m, isLoading: h, isError: g, invalidateQuery: _, startDraftSignal: v }) {
21689
21707
  let y = rr(), b = i.find((e) => e !== r), x = d(() => o === "navigate" ? St(void 0, t, c.schema.screens) : null, [
21690
21708
  o,
21691
21709
  t,
@@ -21699,7 +21717,7 @@ function $m({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
21699
21717
  r,
21700
21718
  t.fields,
21701
21719
  a
21702
- ]), C = d(() => qm(t.actions), [t.actions]), [w, T] = p(null), [E, D] = p({}), O = f(E);
21720
+ ]), C = d(() => Ym(t.actions), [t.actions]), [w, T] = p(null), [E, D] = p({}), O = f(E);
21703
21721
  O.current = E;
21704
21722
  let k = f({});
21705
21723
  l(() => {
@@ -21896,7 +21914,7 @@ function $m({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
21896
21914
  } })
21897
21915
  ] }) }), /* @__PURE__ */ R("tbody", { children: [u.map((n) => {
21898
21916
  let r = String(n.id ?? ""), o = z.has(r), s = E[r], c = x && r ? x.replace(/:\w+/, r) : void 0, l = X(t.display?.name) || e, u = t.display?.icon;
21899
- return /* @__PURE__ */ L(eh, {
21917
+ return /* @__PURE__ */ L(nh, {
21900
21918
  rowId: r,
21901
21919
  row: n,
21902
21920
  entity: t,
@@ -21926,7 +21944,7 @@ function $m({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
21926
21944
  entityCode: e,
21927
21945
  onRowActionSuccess: _
21928
21946
  }, r);
21929
- }), A && /* @__PURE__ */ L(th, {
21947
+ }), A && /* @__PURE__ */ L(rh, {
21930
21948
  draftRow: A,
21931
21949
  entity: t,
21932
21950
  columns: i,
@@ -21957,7 +21975,7 @@ function $m({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
21957
21975
  })
21958
21976
  ] });
21959
21977
  }
21960
- function eh({ rowId: e, row: t, entity: n, columns: r, editableColumns: i, editable: a, isDeleting: o, activeCell: s, setActiveCell: c, rowState: l, onCellChange: u, onDeleteClick: f, refs: p, identityCol: m, href: h, onNavigate: g, rowActions: _, onRowActionSuccess: v }) {
21978
+ function nh({ rowId: e, row: t, entity: n, columns: r, editableColumns: i, editable: a, isDeleting: o, activeCell: s, setActiveCell: c, rowState: l, onCellChange: u, onDeleteClick: f, refs: p, identityCol: m, href: h, onNavigate: g, rowActions: _, onRowActionSuccess: v }) {
21961
21979
  let y = Fl(), b = d(() => !l || Object.keys(l.buffer).length === 0 ? t : {
21962
21980
  ...t,
21963
21981
  ...l.buffer
@@ -22061,7 +22079,7 @@ function eh({ rowId: e, row: t, entity: n, columns: r, editableColumns: i, edita
22061
22079
  borderBottom: "1px solid var(--divider)",
22062
22080
  verticalAlign: "middle"
22063
22081
  },
22064
- children: /* @__PURE__ */ L(Wm, {
22082
+ children: /* @__PURE__ */ L(Km, {
22065
22083
  actions: _,
22066
22084
  objectIds: [e],
22067
22085
  row: b,
@@ -22071,7 +22089,7 @@ function eh({ rowId: e, row: t, entity: n, columns: r, editableColumns: i, edita
22071
22089
  ]
22072
22090
  });
22073
22091
  }
22074
- function th({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
22092
+ function rh({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
22075
22093
  let d = Fl(), f = a.find((e) => e.startsWith("_error:")), p = new Set(a.filter((e) => !e.startsWith("_error:"))), m = {
22076
22094
  padding: "6px 12px",
22077
22095
  borderBottom: "1px solid var(--divider)",
@@ -22156,7 +22174,7 @@ function th({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
22156
22174
  }
22157
22175
  //#endregion
22158
22176
  //#region src/components/detail-layout/FieldsBlock.tsx
22159
- function nh({ fields: e, ctx: t }) {
22177
+ function ih({ fields: e, ctx: t }) {
22160
22178
  let { entity: n, entityCode: r, record: i, mode: a, onFieldChange: o, schema: s } = t, c = Fl(), l = t.columns ?? 2, u = l === 1 && e.length === 1;
22161
22179
  return /* @__PURE__ */ L("div", {
22162
22180
  className: ir("grid gap-x-6 gap-y-3", l === 1 ? "grid-cols-1" : "grid-cols-1 md:grid-cols-2"),
@@ -22189,7 +22207,7 @@ function nh({ fields: e, ctx: t }) {
22189
22207
  children: f
22190
22208
  }), p && /* @__PURE__ */ L("div", {
22191
22209
  className: "flex items-center gap-1 shrink-0",
22192
- children: e.actions.map((e, t) => /* @__PURE__ */ L(Um, {
22210
+ children: e.actions.map((e, t) => /* @__PURE__ */ L(Gm, {
22193
22211
  actionCode: `${d}.action[${t}]`,
22194
22212
  action: e,
22195
22213
  entityCode: r,
@@ -22206,7 +22224,7 @@ function nh({ fields: e, ctx: t }) {
22206
22224
  }
22207
22225
  //#endregion
22208
22226
  //#region src/components/detail-layout/PropertiesBlock.tsx
22209
- var rh = new Set([
22227
+ var ah = new Set([
22210
22228
  "string",
22211
22229
  "text",
22212
22230
  "int",
@@ -22214,8 +22232,8 @@ var rh = new Set([
22214
22232
  "decimal",
22215
22233
  "email",
22216
22234
  "url"
22217
- ]), ih = 500;
22218
- function ah({ node: e, ctx: t }) {
22235
+ ]), oh = 500;
22236
+ function sh({ node: e, ctx: t }) {
22219
22237
  let { entity: n, objectProperties: r, onSetProperty: i, isNew: a, mode: o, refs: s } = t, c = n.properties ?? {};
22220
22238
  if (a) return null;
22221
22239
  let l = e.properties === !0 ? !0 : e.properties, u = l === !0 ? Object.entries(c).sort(([e], [t]) => e.localeCompare(t)) : l.filter((e) => c[e] != null).map((e) => [e, c[e]]);
@@ -22223,7 +22241,7 @@ function ah({ node: e, ctx: t }) {
22223
22241
  className: "grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-3",
22224
22242
  children: u.map(([e, t]) => {
22225
22243
  let n = r?.find((t) => t.property_code === e), a = mt(t), c = t.readonly || !i ? "display" : o;
22226
- return /* @__PURE__ */ L(oh, {
22244
+ return /* @__PURE__ */ L(ch, {
22227
22245
  propCode: e,
22228
22246
  prop: t,
22229
22247
  field: a,
@@ -22235,13 +22253,13 @@ function ah({ node: e, ctx: t }) {
22235
22253
  })
22236
22254
  });
22237
22255
  }
22238
- function oh({ propCode: e, prop: t, field: n, value: r, mode: i, onSetProperty: a, refs: o }) {
22256
+ function ch({ propCode: e, prop: t, field: n, value: r, mode: i, onSetProperty: a, refs: o }) {
22239
22257
  let c = Fl(), u = f(null);
22240
22258
  l(() => () => {
22241
22259
  u.current && clearTimeout(u.current);
22242
22260
  }, []);
22243
22261
  let d = s((n) => {
22244
- a && (rh.has(t.type) ? (u.current && clearTimeout(u.current), u.current = setTimeout(() => a(e, n), ih)) : a(e, n));
22262
+ a && (ah.has(t.type) ? (u.current && clearTimeout(u.current), u.current = setTimeout(() => a(e, n), oh)) : a(e, n));
22245
22263
  }, [
22246
22264
  e,
22247
22265
  t.type,
@@ -22268,7 +22286,7 @@ function oh({ propCode: e, prop: t, field: n, value: r, mode: i, onSetProperty:
22268
22286
  }
22269
22287
  //#endregion
22270
22288
  //#region src/components/shared/StatusGroupsDisplay.tsx
22271
- function sh({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r, mode: i = "edit" }) {
22289
+ function lh({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r, mode: i = "edit" }) {
22272
22290
  return /* @__PURE__ */ L("div", {
22273
22291
  style: {
22274
22292
  display: "flex",
@@ -22350,61 +22368,61 @@ function sh({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
22350
22368
  }
22351
22369
  //#endregion
22352
22370
  //#region src/components/detail-layout/StatusesBlock.tsx
22353
- var ch = () => {};
22354
- function lh({ node: e, ctx: t }) {
22371
+ var uh = () => {};
22372
+ function dh({ node: e, ctx: t }) {
22355
22373
  let { entity: n, objectStatuses: r, onSetStatus: i, isStatusPending: a, isNew: o } = t, s = n.status_groups ?? {};
22356
22374
  if (o) return null;
22357
22375
  let c = e.statuses === !0 ? !0 : e.statuses, l = Object.fromEntries(Object.entries(s).filter(([e]) => c === !0 || c.includes(e)));
22358
- return Object.keys(l).length === 0 ? null : /* @__PURE__ */ L(sh, {
22376
+ return Object.keys(l).length === 0 ? null : /* @__PURE__ */ L(lh, {
22359
22377
  statusGroups: l,
22360
22378
  objectStatuses: r,
22361
- onSetStatus: i ?? ch,
22379
+ onSetStatus: i ?? uh,
22362
22380
  isPending: a ?? !1,
22363
22381
  mode: t.mode
22364
22382
  });
22365
22383
  }
22366
22384
  //#endregion
22367
22385
  //#region src/components/detail-layout/LayoutRenderer.tsx
22368
- function uh({ nodes: e, ctx: t }) {
22369
- return /* @__PURE__ */ L(I, { children: e.map((e, n) => /* @__PURE__ */ L(dh, {
22386
+ function fh({ nodes: e, ctx: t }) {
22387
+ return /* @__PURE__ */ L(I, { children: e.map((e, n) => /* @__PURE__ */ L(ph, {
22370
22388
  node: e,
22371
22389
  ctx: t
22372
22390
  }, n)) });
22373
22391
  }
22374
- function dh({ node: e, ctx: t }) {
22375
- return e.row ? /* @__PURE__ */ L(Wp, {
22392
+ function ph({ node: e, ctx: t }) {
22393
+ return e.row ? /* @__PURE__ */ L(Kp, {
22376
22394
  config: e.row,
22377
22395
  ctx: t
22378
- }) : e.column ? /* @__PURE__ */ L(qp, {
22396
+ }) : e.column ? /* @__PURE__ */ L(Yp, {
22379
22397
  config: e.column,
22380
22398
  node: e,
22381
22399
  ctx: t
22382
- }) : e.tabs ? /* @__PURE__ */ L(Xp, {
22400
+ }) : e.tabs ? /* @__PURE__ */ L(Qp, {
22383
22401
  config: e.tabs,
22384
22402
  ctx: t
22385
- }) : e.section ? /* @__PURE__ */ L(Zp, {
22403
+ }) : e.section ? /* @__PURE__ */ L($p, {
22386
22404
  config: e.section,
22387
22405
  ctx: t
22388
- }) : e.children ? /* @__PURE__ */ L(Rm, {
22406
+ }) : e.children ? /* @__PURE__ */ L(Bm, {
22389
22407
  node: e,
22390
22408
  ctx: t
22391
- }) : e.associated ? /* @__PURE__ */ L(Ym, {
22409
+ }) : e.associated ? /* @__PURE__ */ L(Zm, {
22392
22410
  node: e,
22393
22411
  ctx: t
22394
- }) : e.fields ? /* @__PURE__ */ L(nh, {
22412
+ }) : e.fields ? /* @__PURE__ */ L(ih, {
22395
22413
  fields: e.fields,
22396
22414
  ctx: t
22397
- }) : e.properties == null ? e.statuses == null ? null : /* @__PURE__ */ L(lh, {
22415
+ }) : e.properties == null ? e.statuses == null ? null : /* @__PURE__ */ L(dh, {
22398
22416
  node: e,
22399
22417
  ctx: t
22400
- }) : /* @__PURE__ */ L(ah, {
22418
+ }) : /* @__PURE__ */ L(sh, {
22401
22419
  node: e,
22402
22420
  ctx: t
22403
22421
  });
22404
22422
  }
22405
22423
  //#endregion
22406
22424
  //#region src/lib/children-validation.ts
22407
- function fh(e, t, n) {
22425
+ function mh(e, t, n) {
22408
22426
  let r = [];
22409
22427
  for (let [i, a] of e.fields) {
22410
22428
  if (!a.required || a.auto || n && a.primary || a.default !== void 0 && a.default !== null) continue;
@@ -22413,7 +22431,7 @@ function fh(e, t, n) {
22413
22431
  }
22414
22432
  return r;
22415
22433
  }
22416
- function ph(e, t) {
22434
+ function hh(e, t) {
22417
22435
  let n = /* @__PURE__ */ new Set();
22418
22436
  for (let r of Object.values(t.entities)) if (r.children) {
22419
22437
  for (let t of r.children) if (t.entity === e && t.foreign_key) {
@@ -22423,13 +22441,13 @@ function ph(e, t) {
22423
22441
  }
22424
22442
  return n;
22425
22443
  }
22426
- function mh(e, t) {
22444
+ function gh(e, t) {
22427
22445
  if (!e || !t) return {};
22428
22446
  let n = {};
22429
22447
  for (let [r, i] of Object.entries(e)) {
22430
22448
  let e = t.entities[r];
22431
22449
  if (!e) continue;
22432
- let a = ph(r, t), o = [];
22450
+ let a = hh(r, t), o = [];
22433
22451
  for (let [t, n] of e.fields) n.required && !n.auto && !n.primary && !a.has(t) && o.push(t);
22434
22452
  if (o.length !== 0) for (let e of i) {
22435
22453
  if (e._deleted) continue;
@@ -22445,14 +22463,14 @@ function mh(e, t) {
22445
22463
  }
22446
22464
  //#endregion
22447
22465
  //#region src/components/pages/SmartDetailPage.tsx
22448
- var hh = () => {};
22449
- function gh(e, t) {
22466
+ var _h = () => {};
22467
+ function vh(e, t) {
22450
22468
  return e.length === t.length ? JSON.stringify(e) === JSON.stringify(t) : !1;
22451
22469
  }
22452
- function _h({ screenCode: e }) {
22453
- return /* @__PURE__ */ L(No, { children: /* @__PURE__ */ L(vh, { screenCode: e }) });
22470
+ function yh({ screenCode: e }) {
22471
+ return /* @__PURE__ */ L(No, { children: /* @__PURE__ */ L(bh, { screenCode: e }) });
22454
22472
  }
22455
- function vh({ screenCode: e }) {
22473
+ function bh({ screenCode: e }) {
22456
22474
  let { id: t } = T(), n = C(), [r, i] = D(), { data: a } = jn(), o = An((e) => e.user), c = Po(), u = a?.screens[e], m = u?.entity ? a?.entities[u.entity] : void 0, h = u?.entity, g = ht(m, "create"), _ = ht(m, "update"), v = ht(m, "delete"), y = ht(m, "restore"), b = (() => {
22457
22475
  if (!m || !m.singleton || !m.prefilter) return;
22458
22476
  let e = gt(m);
@@ -22476,7 +22494,7 @@ function vh({ screenCode: e }) {
22476
22494
  m
22477
22495
  ]), k = d(() => {
22478
22496
  if (O) return typeof O == "string" ? O : yt(O);
22479
- }, [O]), { data: A, isLoading: j } = zp(h, O), M = Rd(h ?? ""), N = zd(h ?? ""), P = Bd(h ?? ""), ee = Vd(h ?? ""), z = Object.keys(m?.status_groups ?? {}).length > 0, te = A?.data, ne = te?.$statuses, re = te?.$properties, ie = r.get("edit") === "true", [ae, oe] = p(E || ie), [se, ce] = p({}), [le, ue] = p({}), [de, fe] = p({}), [pe, me] = p(void 0), [he, ge] = p(!1), [_e, ve] = p(void 0), [ye, be] = p({ show: !1 }), xe = E ? g : _, Se = ae && xe, [Ce, we] = p(() => {
22497
+ }, [O]), { data: A, isLoading: j } = Vp(h, O), M = Rd(h ?? ""), N = zd(h ?? ""), P = Bd(h ?? ""), ee = Vd(h ?? ""), z = Object.keys(m?.status_groups ?? {}).length > 0, te = A?.data, ne = te?.$statuses, re = te?.$properties, ie = r.get("edit") === "true", [ae, oe] = p(E || ie), [se, ce] = p({}), [le, ue] = p({}), [de, fe] = p({}), [pe, me] = p(void 0), [he, ge] = p(!1), [_e, ve] = p(void 0), [ye, be] = p({ show: !1 }), xe = E ? g : _, Se = ae && xe, [Ce, we] = p(() => {
22480
22498
  let e = parseInt(u?.sidebar_width || "380", 10);
22481
22499
  return isNaN(e) ? 380 : e;
22482
22500
  }), Te = f(null), Ee = f(null), De = s((e) => {
@@ -22545,7 +22563,7 @@ function vh({ screenCode: e }) {
22545
22563
  l(() => {
22546
22564
  if (!(!ie || !B || !m || !_ || Pe.size === 0)) {
22547
22565
  if (ae || oe(!0), Object.keys(se).length === 0) {
22548
- let e = w ? op(w) : null;
22566
+ let e = w ? cp(w) : null;
22549
22567
  e && Os(Ds({
22550
22568
  entity: m,
22551
22569
  formData: e,
@@ -22635,7 +22653,7 @@ function vh({ screenCode: e }) {
22635
22653
  let { _key: t, _deleted: n, _dirty: r, ...i } = e;
22636
22654
  return i;
22637
22655
  }), i = _e?.[e] ?? [];
22638
- (E || !gh(r, i)) && (t[e] = r);
22656
+ (E || !vh(r, i)) && (t[e] = r);
22639
22657
  }
22640
22658
  Object.keys(t).length > 0 && (e.$children = t);
22641
22659
  }
@@ -22647,7 +22665,7 @@ function vh({ screenCode: e }) {
22647
22665
  oe(!1), ge(!1), ue({}), fe({}), me(void 0), ve(void 0);
22648
22666
  };
22649
22667
  if (m && E) {
22650
- let t = fh(m, e, !0);
22668
+ let t = mh(m, e, !0);
22651
22669
  if (t.length > 0) {
22652
22670
  F.error(`Missing required field${t.length === 1 ? "" : "s"}: ${t.join(", ")}`, { duration: Infinity });
22653
22671
  return;
@@ -22708,7 +22726,7 @@ function vh({ screenCode: e }) {
22708
22726
  E,
22709
22727
  y,
22710
22728
  ee
22711
- ]), He = d(() => mh(pe, a), [pe, a]), Ue = Object.keys(He).length > 0;
22729
+ ]), He = d(() => gh(pe, a), [pe, a]), Ue = Object.keys(He).length > 0;
22712
22730
  if (!u || !m) return null;
22713
22731
  if (!E && j) return /* @__PURE__ */ L(Zd, {});
22714
22732
  if (!E && !B) return /* @__PURE__ */ R("div", {
@@ -22794,7 +22812,7 @@ function vh({ screenCode: e }) {
22794
22812
  pendingChildren: Se ? pe : void 0,
22795
22813
  onChildrenChange: Se ? K : void 0,
22796
22814
  childValidationErrors: Se ? He : void 0
22797
- }, Je = u.sidebar && u.sidebar.length > 0, Y = /* @__PURE__ */ L(yh, {
22815
+ }, Je = u.sidebar && u.sidebar.length > 0, Y = /* @__PURE__ */ L(xh, {
22798
22816
  title: Ke,
22799
22817
  recordId: w,
22800
22818
  editing: Se,
@@ -22848,22 +22866,22 @@ function vh({ screenCode: e }) {
22848
22866
  children: [/* @__PURE__ */ L(H.warning, { size: 14 }), /* @__PURE__ */ L("span", { children: "This record changed on the server while you were viewing or editing it." })]
22849
22867
  }), Ze = z && !E && !(u.items && u.items.length > 0) && /* @__PURE__ */ L("div", {
22850
22868
  className: "mb-4",
22851
- children: /* @__PURE__ */ L(sh, {
22869
+ children: /* @__PURE__ */ L(lh, {
22852
22870
  statusGroups: m.status_groups ?? {},
22853
22871
  objectStatuses: qe.objectStatuses,
22854
22872
  onSetStatus: _ && Se ? (e, t) => ue((n) => ({
22855
22873
  ...n,
22856
22874
  [e]: t
22857
- })) : hh,
22875
+ })) : _h,
22858
22876
  isPending: !1,
22859
22877
  mode: Se ? "edit" : "display"
22860
22878
  })
22861
22879
  }), Qe = /* @__PURE__ */ R(I, { children: [
22862
- u.items && u.items.length > 0 && (B || E) && a && /* @__PURE__ */ L(uh, {
22880
+ u.items && u.items.length > 0 && (B || E) && a && /* @__PURE__ */ L(fh, {
22863
22881
  nodes: u.items,
22864
22882
  ctx: qe
22865
22883
  }),
22866
- !E && w && h && m.associations && Object.keys(m.associations).length > 0 && a && /* @__PURE__ */ L(Bp, {
22884
+ !E && w && h && m.associations && Object.keys(m.associations).length > 0 && a && /* @__PURE__ */ L(Hp, {
22867
22885
  entityCode: h,
22868
22886
  recordId: k ?? w ?? "",
22869
22887
  associations: m.associations,
@@ -22951,7 +22969,7 @@ function vh({ screenCode: e }) {
22951
22969
  height: "100%",
22952
22970
  width: `${Ce}px`
22953
22971
  },
22954
- children: (B || E) && a && /* @__PURE__ */ L(uh, {
22972
+ children: (B || E) && a && /* @__PURE__ */ L(fh, {
22955
22973
  nodes: u.sidebar,
22956
22974
  ctx: qe
22957
22975
  })
@@ -22984,8 +23002,8 @@ function vh({ screenCode: e }) {
22984
23002
  ]
22985
23003
  });
22986
23004
  }
22987
- function yh({ title: e, recordId: t, editing: n, isNew: r, isSingletonByCaller: i, isRecordDeleted: a, dirty: o, isSaving: s, hasChildErrors: c, canRestore: l, entity: u, screen: f, globalActions: p, entityCode: m, record: h, id: g, listRoute: _, listRouteExists: v, onBack: y, onCancelEdit: b, onSave: x, onRestore: S, isRestoring: w }) {
22988
- let { run: T } = xu(), E = rr(), D = C(), O = Fl(), k = f?.action_layout ?? null, A = u?.action_layout ?? null, j = k ?? A, M = lf(j ? _f(j, u?.actions, p, "detail") : vf(u?.actions, "detail"), u?.actions, p, h ?? {}, []), N = d(() => {
23005
+ function xh({ title: e, recordId: t, editing: n, isNew: r, isSingletonByCaller: i, isRecordDeleted: a, dirty: o, isSaving: s, hasChildErrors: c, canRestore: l, entity: u, screen: f, globalActions: p, entityCode: m, record: h, id: g, listRoute: _, listRouteExists: v, onBack: y, onCancelEdit: b, onSave: x, onRestore: S, isRestoring: w }) {
23006
+ let { run: T } = xu(), E = rr(), D = C(), O = Fl(), k = f?.action_layout ?? null, A = u?.action_layout ?? null, j = k ?? A, M = lf(j ? _f(j, u?.actions, p, "detail") : bf(u?.actions, "detail"), u?.actions, p, h ?? {}, []), N = d(() => {
22989
23007
  if (!u) return;
22990
23008
  let e = g ? [g] : [];
22991
23009
  return {
@@ -23098,7 +23116,7 @@ function yh({ title: e, recordId: t, editing: n, isNew: r, isSingletonByCaller:
23098
23116
  title: c ? "Fix errors in child rows" : void 0,
23099
23117
  children: s ? "Saving…" : "Save"
23100
23118
  })
23101
- ] }) : /* @__PURE__ */ L(I, { children: !r && g && M.length > 0 && /* @__PURE__ */ L(Vf, {
23119
+ ] }) : /* @__PURE__ */ L(I, { children: !r && g && M.length > 0 && /* @__PURE__ */ L(Uf, {
23102
23120
  layout: M,
23103
23121
  row: h,
23104
23122
  onRun: (e, t) => {
@@ -23126,7 +23144,7 @@ function yh({ title: e, recordId: t, editing: n, isNew: r, isSingletonByCaller:
23126
23144
  }
23127
23145
  //#endregion
23128
23146
  //#region src/api/status.ts
23129
- async function bh(e, t, n, r, i) {
23147
+ async function Sh(e, t, n, r, i) {
23130
23148
  let a = {
23131
23149
  status_group_code: n,
23132
23150
  status_code: r
@@ -23143,10 +23161,10 @@ async function bh(e, t, n, r, i) {
23143
23161
  }
23144
23162
  //#endregion
23145
23163
  //#region src/hooks/useObjectStatus.ts
23146
- function xh(e, t) {
23164
+ function Ch(e, t) {
23147
23165
  let n = N();
23148
23166
  return j({
23149
- mutationFn: ({ groupCode: n, statusCode: r, note: i }) => bh(e, t, n, r, i),
23167
+ mutationFn: ({ groupCode: n, statusCode: r, note: i }) => Sh(e, t, n, r, i),
23150
23168
  onSuccess: () => {
23151
23169
  n.invalidateQueries({ queryKey: ["entity-item", e] });
23152
23170
  },
@@ -23157,7 +23175,7 @@ function xh(e, t) {
23157
23175
  }
23158
23176
  //#endregion
23159
23177
  //#region src/api/properties.ts
23160
- async function Sh(e, t, n, r) {
23178
+ async function wh(e, t, n, r) {
23161
23179
  let i = (await cn(`/api/data/${e}`, {
23162
23180
  method: "PATCH",
23163
23181
  body: JSON.stringify([{
@@ -23170,7 +23188,7 @@ async function Sh(e, t, n, r) {
23170
23188
  }))[0]?.$properties ?? [];
23171
23189
  return i.find((e) => e.property_code === n) ?? i[0];
23172
23190
  }
23173
- async function Ch(e, t, n) {
23191
+ async function Th(e, t, n) {
23174
23192
  await cn(`/api/data/${e}`, {
23175
23193
  method: "PATCH",
23176
23194
  body: JSON.stringify([{
@@ -23184,10 +23202,10 @@ async function Ch(e, t, n) {
23184
23202
  }
23185
23203
  //#endregion
23186
23204
  //#region src/hooks/useProperties.ts
23187
- function wh(e, t) {
23205
+ function Eh(e, t) {
23188
23206
  let n = N();
23189
23207
  return j({
23190
- mutationFn: ({ propertyCode: n, value: r }) => Sh(e, t, n, r),
23208
+ mutationFn: ({ propertyCode: n, value: r }) => wh(e, t, n, r),
23191
23209
  onSuccess: () => {
23192
23210
  n.invalidateQueries({ queryKey: ["entity-item", e] });
23193
23211
  },
@@ -23196,10 +23214,10 @@ function wh(e, t) {
23196
23214
  }
23197
23215
  });
23198
23216
  }
23199
- function Th(e, t) {
23217
+ function Dh(e, t) {
23200
23218
  let n = N();
23201
23219
  return j({
23202
- mutationFn: (n) => Ch(e, t, n),
23220
+ mutationFn: (n) => Th(e, t, n),
23203
23221
  onSuccess: () => {
23204
23222
  n.invalidateQueries({ queryKey: ["entity-item", e] });
23205
23223
  },
@@ -23210,7 +23228,7 @@ function Th(e, t) {
23210
23228
  }
23211
23229
  //#endregion
23212
23230
  //#region src/components/pages/SmartRecordListPage.tsx
23213
- function Eh({ screenCode: e }) {
23231
+ function Oh({ screenCode: e }) {
23214
23232
  let [t, n] = D(), { data: r } = jn(), i = r?.screens[e], a = i?.entity ? r?.entities[i.entity] : void 0, o = i?.entity, { openTab: c } = nr();
23215
23233
  l(() => {
23216
23234
  if (i?.route && a) {
@@ -23254,8 +23272,8 @@ function Eh({ screenCode: e }) {
23254
23272
  }, { replace: !0 });
23255
23273
  }, [n]), T = s((e, t) => {
23256
23274
  n((n) => {
23257
- let r = new URLSearchParams(n), i = Wf(n), a;
23258
- return a = t && t !== "__all__" ? [...Xf(i, e), Yf(e, t)] : Xf(i, e), Gf(a, r), r;
23275
+ let r = new URLSearchParams(n), i = Kf(n), a;
23276
+ return a = t && t !== "__all__" ? [...Qf(i, e), Zf(e, t)] : Qf(i, e), qf(a, r), r;
23259
23277
  }, { replace: !0 });
23260
23278
  }, [n]), E = i?.list_resizable ?? !1, O = f(null), [k, A] = p(null), j = f(!1), M = i?.list_width;
23261
23279
  l(() => {
@@ -23398,7 +23416,7 @@ function Eh({ screenCode: e }) {
23398
23416
  color: "var(--text-3)"
23399
23417
  },
23400
23418
  children: "No records found"
23401
- }) : b.map((e) => /* @__PURE__ */ L(Dh, {
23419
+ }) : b.map((e) => /* @__PURE__ */ L(kh, {
23402
23420
  record: e,
23403
23421
  entity: a,
23404
23422
  columns: F,
@@ -23427,7 +23445,7 @@ function Eh({ screenCode: e }) {
23427
23445
  minWidth: 0,
23428
23446
  overflow: "hidden"
23429
23447
  },
23430
- children: u ? /* @__PURE__ */ L(Oh, {
23448
+ children: u ? /* @__PURE__ */ L(Ah, {
23431
23449
  entityCode: o,
23432
23450
  recordId: u,
23433
23451
  items: i.items,
@@ -23454,7 +23472,7 @@ function Eh({ screenCode: e }) {
23454
23472
  ]
23455
23473
  });
23456
23474
  }
23457
- function Dh({ record: e, entity: t, columns: n, refs: r, isSelected: i, onClick: a }) {
23475
+ function kh({ record: e, entity: t, columns: n, refs: r, isSelected: i, onClick: a }) {
23458
23476
  let o = Fl(), s = n[0], c = n[1], l = n.slice(2, 4);
23459
23477
  return /* @__PURE__ */ R("button", {
23460
23478
  onClick: a,
@@ -23541,8 +23559,8 @@ function Dh({ record: e, entity: t, columns: n, refs: r, isSelected: i, onClick:
23541
23559
  })]
23542
23560
  });
23543
23561
  }
23544
- function Oh({ entityCode: e, recordId: t, items: n, schema: r, entity: i }) {
23545
- return /* @__PURE__ */ L(No, { children: /* @__PURE__ */ L(kh, {
23562
+ function Ah({ entityCode: e, recordId: t, items: n, schema: r, entity: i }) {
23563
+ return /* @__PURE__ */ L(No, { children: /* @__PURE__ */ L(jh, {
23546
23564
  entityCode: e,
23547
23565
  recordId: t,
23548
23566
  items: n,
@@ -23550,8 +23568,8 @@ function Oh({ entityCode: e, recordId: t, items: n, schema: r, entity: i }) {
23550
23568
  entity: i
23551
23569
  }) });
23552
23570
  }
23553
- function kh({ entityCode: e, recordId: t, items: n, schema: r, entity: i }) {
23554
- let a = ht(i, "update"), { data: o, isLoading: c } = zp(e, t), l = zd(e), u = Po(), [f, m] = p(!1), [h, g] = p({}), _ = o?.data, v = _?.$statuses, y = _?.$properties, b = xh(e, t), x = wh(e, t), S = d(() => {
23571
+ function jh({ entityCode: e, recordId: t, items: n, schema: r, entity: i }) {
23572
+ let a = ht(i, "update"), { data: o, isLoading: c } = Vp(e, t), l = zd(e), u = Po(), [f, m] = p(!1), [h, g] = p({}), _ = o?.data, v = _?.$statuses, y = _?.$properties, b = Ch(e, t), x = Eh(e, t), S = d(() => {
23555
23573
  let e = /* @__PURE__ */ new Set();
23556
23574
  for (let [t, n] of i.fields) !n.auto && !n.primary && e.add(t);
23557
23575
  for (let [t] of i.files ?? []) e.add(t);
@@ -23696,7 +23714,7 @@ function kh({ entityCode: e, recordId: t, items: n, schema: r, entity: i }) {
23696
23714
  flexDirection: "column",
23697
23715
  gap: 12
23698
23716
  },
23699
- children: n && n.length > 0 ? /* @__PURE__ */ L(uh, {
23717
+ children: n && n.length > 0 ? /* @__PURE__ */ L(fh, {
23700
23718
  nodes: n,
23701
23719
  ctx: M
23702
23720
  }) : /* @__PURE__ */ R("p", {
@@ -23715,7 +23733,7 @@ function kh({ entityCode: e, recordId: t, items: n, schema: r, entity: i }) {
23715
23733
  }
23716
23734
  //#endregion
23717
23735
  //#region src/components/shared/ErrorBoundary.tsx
23718
- var Ah = class extends e {
23736
+ var Mh = class extends e {
23719
23737
  constructor(e) {
23720
23738
  super(e), this.state = {
23721
23739
  hasError: !1,
@@ -23783,7 +23801,7 @@ var Ah = class extends e {
23783
23801
  };
23784
23802
  //#endregion
23785
23803
  //#region src/hooks/useVersionWatcher.ts
23786
- function jh() {
23804
+ function Nh() {
23787
23805
  let e = N();
23788
23806
  l(() => {
23789
23807
  let t = !1, n = null, r = 6e4, i = r, a = 0, o = 0;
@@ -23839,21 +23857,21 @@ function jh() {
23839
23857
  }
23840
23858
  //#endregion
23841
23859
  //#region src/stores/screen-registry.ts
23842
- var Mh = /* @__PURE__ */ new Map();
23843
- function Nh(e, t) {
23844
- Mh.set(e, t);
23860
+ var Ph = /* @__PURE__ */ new Map();
23861
+ function Fh(e, t) {
23862
+ Ph.set(e, t);
23845
23863
  }
23846
- function Ph(e) {
23847
- return Mh.get(e);
23864
+ function Ih(e) {
23865
+ return Ph.get(e);
23848
23866
  }
23849
23867
  //#endregion
23850
23868
  //#region src/app.tsx
23851
- Nh("Profile", fd);
23852
- var Fh = "declarion-managed-favicon", Ih = new O({ defaultOptions: { queries: {
23869
+ Fh("Profile", fd);
23870
+ var Lh = "declarion-managed-favicon", Rh = new O({ defaultOptions: { queries: {
23853
23871
  staleTime: 300 * 1e3,
23854
23872
  retry: 1
23855
23873
  } } });
23856
- function Lh(e) {
23874
+ function zh(e) {
23857
23875
  if (typeof window > "u") return null;
23858
23876
  try {
23859
23877
  let t = new URL(e, window.location.origin);
@@ -23862,7 +23880,7 @@ function Lh(e) {
23862
23880
  return null;
23863
23881
  }
23864
23882
  }
23865
- function Rh() {
23883
+ function Bh() {
23866
23884
  let { data: e } = jn();
23867
23885
  return {
23868
23886
  routes: d(() => {
@@ -23874,29 +23892,29 @@ function Rh() {
23874
23892
  if ((i ? e.entities?.[i] : void 0)?.singleton) continue;
23875
23893
  t.push(/* @__PURE__ */ L(v, {
23876
23894
  path: r.route,
23877
- element: /* @__PURE__ */ L(Ah, { children: /* @__PURE__ */ L(Ap, { screenCode: n }) })
23895
+ element: /* @__PURE__ */ L(Mh, { children: /* @__PURE__ */ L(Mp, { screenCode: n }) })
23878
23896
  }, n));
23879
23897
  continue;
23880
23898
  }
23881
23899
  if (r.type === "detail") {
23882
23900
  t.push(/* @__PURE__ */ L(v, {
23883
23901
  path: r.route,
23884
- element: /* @__PURE__ */ L(Ah, { children: /* @__PURE__ */ L(_h, { screenCode: n }) })
23902
+ element: /* @__PURE__ */ L(Mh, { children: /* @__PURE__ */ L(yh, { screenCode: n }) })
23885
23903
  }, n));
23886
23904
  continue;
23887
23905
  }
23888
23906
  if (r.type === "record_list") {
23889
23907
  t.push(/* @__PURE__ */ L(v, {
23890
23908
  path: r.route,
23891
- element: /* @__PURE__ */ L(Ah, { children: /* @__PURE__ */ L(Eh, { screenCode: n }) })
23909
+ element: /* @__PURE__ */ L(Mh, { children: /* @__PURE__ */ L(Oh, { screenCode: n }) })
23892
23910
  }, n));
23893
23911
  continue;
23894
23912
  }
23895
23913
  if (r.type === "custom") {
23896
- let e = r.component ? Ph(r.component) : void 0;
23914
+ let e = r.component ? Ih(r.component) : void 0;
23897
23915
  e && t.push(/* @__PURE__ */ L(v, {
23898
23916
  path: r.route,
23899
- element: /* @__PURE__ */ L(Ah, { children: /* @__PURE__ */ L(e, {}) })
23917
+ element: /* @__PURE__ */ L(Mh, { children: /* @__PURE__ */ L(e, {}) })
23900
23918
  }, n));
23901
23919
  }
23902
23920
  }
@@ -23927,8 +23945,8 @@ function Rh() {
23927
23945
  }, [e])
23928
23946
  };
23929
23947
  }
23930
- function zh() {
23931
- let e = An((e) => e.initialize), t = An((e) => e.isLoading), { data: n, isLoading: r } = jn(), { data: i, isLoading: a } = Ar(), { routes: o, defaultRoute: s } = Rh();
23948
+ function Vh() {
23949
+ let e = An((e) => e.initialize), t = An((e) => e.isLoading), { data: n, isLoading: r } = jn(), { data: i, isLoading: a } = Ar(), { routes: o, defaultRoute: s } = Bh();
23932
23950
  l(() => {
23933
23951
  e();
23934
23952
  }, [e]);
@@ -23939,7 +23957,7 @@ function zh() {
23939
23957
  e && (document.title = e);
23940
23958
  }, [c?.app_name]), l(() => {
23941
23959
  if (typeof document > "u") return;
23942
- let e = c?.app_logo, t = Dt(e) ? Lh(e.trim()) : null, n = document.getElementById(Fh);
23960
+ let e = c?.app_logo, t = Dt(e) ? zh(e.trim()) : null, n = document.getElementById(Lh);
23943
23961
  if (!t) {
23944
23962
  n && n.remove();
23945
23963
  return;
@@ -23947,7 +23965,7 @@ function zh() {
23947
23965
  if (!n) {
23948
23966
  document.querySelectorAll("link[rel=\"icon\"], link[rel=\"shortcut icon\"]").forEach((e) => e.remove());
23949
23967
  let e = document.createElement("link");
23950
- e.id = Fh, e.rel = "icon", e.href = t, document.head.appendChild(e);
23968
+ e.id = Lh, e.rel = "icon", e.href = t, document.head.appendChild(e);
23951
23969
  return;
23952
23970
  }
23953
23971
  n.href !== t && (n.href = t);
@@ -23960,7 +23978,7 @@ function zh() {
23960
23978
  t && t.remove();
23961
23979
  return;
23962
23980
  }
23963
- let n = Lh(u);
23981
+ let n = zh(u);
23964
23982
  if (!n) {
23965
23983
  t && t.remove(), console.error(`[declarion] branding.css_url rejected: ${u}. Only same-origin, relative URLs are allowed (e.g. /crm-brand.css).`);
23966
23984
  return;
@@ -24033,32 +24051,32 @@ function zh() {
24033
24051
  })
24034
24052
  ] });
24035
24053
  }
24036
- function Bh() {
24037
- return jh(), /* @__PURE__ */ R(m, { children: [/* @__PURE__ */ L(zh, {}), /* @__PURE__ */ L(P, {
24054
+ function Hh() {
24055
+ return Nh(), /* @__PURE__ */ R(m, { children: [/* @__PURE__ */ L(Vh, {}), /* @__PURE__ */ L(P, {
24038
24056
  richColors: !0,
24039
24057
  position: "top-right",
24040
24058
  toastOptions: { className: "select-text" }
24041
24059
  })] });
24042
24060
  }
24043
- function Vh() {
24044
- return /* @__PURE__ */ L(Ah, { children: /* @__PURE__ */ L(k, {
24045
- client: Ih,
24046
- children: /* @__PURE__ */ L(Bh, {})
24061
+ function Uh() {
24062
+ return /* @__PURE__ */ L(Mh, { children: /* @__PURE__ */ L(k, {
24063
+ client: Rh,
24064
+ children: /* @__PURE__ */ L(Hh, {})
24047
24065
  }) });
24048
24066
  }
24049
24067
  //#endregion
24050
24068
  //#region src/api/entities.ts
24051
- function Hh(e, t) {
24069
+ function Wh(e, t) {
24052
24070
  return e.$statuses?.find((e) => e.group_code === t);
24053
24071
  }
24054
- function Uh(e, t) {
24072
+ function Gh(e, t) {
24055
24073
  return e.$properties?.find((e) => e.property_code === t);
24056
24074
  }
24057
- function Wh(e) {
24075
+ function Kh(e) {
24058
24076
  let t = { ...e };
24059
- return t.$status = (e) => Hh(t, e), t.$property = (e) => Uh(t, e), t;
24077
+ return t.$status = (e) => Wh(t, e), t.$property = (e) => Gh(t, e), t;
24060
24078
  }
24061
- var Gh = class {
24079
+ var qh = class {
24062
24080
  cache = {};
24063
24081
  merge(e) {
24064
24082
  if (e) for (let t of Object.keys(e)) {
@@ -24080,24 +24098,24 @@ var Gh = class {
24080
24098
  this.cache = {};
24081
24099
  }
24082
24100
  };
24083
- function Kh(e, t) {
24101
+ function Jh(e, t) {
24084
24102
  let n = new URL(`/api/data/${e}`, window.location.origin);
24085
24103
  return t.select && t.select.length > 0 && n.searchParams.set("select", t.select.join(",")), t.expand && t.expand.length > 0 && n.searchParams.set("expand", t.expand.join(",")), t.sort && n.searchParams.set("sort", t.sort), t.search && n.searchParams.set("search", t.search), t.limit && n.searchParams.set("limit", String(t.limit)), t.after && n.searchParams.set("after", t.after), t.include_deleted && n.searchParams.set("include_deleted", "true"), t.filters && t.filters.length > 0 && n.searchParams.set("filters", JSON.stringify(t.filters)), n.pathname + n.search;
24086
24104
  }
24087
- var qh = class {
24105
+ var Yh = class {
24088
24106
  entity;
24089
24107
  refs;
24090
24108
  constructor(e, t) {
24091
- this.entity = e, this.refs = t ?? new Gh();
24109
+ this.entity = e, this.refs = t ?? new qh();
24092
24110
  }
24093
24111
  async get(e) {
24094
24112
  let t = new URLSearchParams({ id: e });
24095
- return Wh((await cn(`/api/data/${this.entity}?${t.toString()}`)).data);
24113
+ return Kh((await cn(`/api/data/${this.entity}?${t.toString()}`)).data);
24096
24114
  }
24097
24115
  async list(e = {}) {
24098
- let t = await cn(Kh(this.entity, e));
24116
+ let t = await cn(Jh(this.entity, e));
24099
24117
  return this.refs.merge(t.$refs), {
24100
- data: t.data.map((e) => Wh(e)),
24118
+ data: t.data.map((e) => Kh(e)),
24101
24119
  meta: t.meta,
24102
24120
  $refs: this.refs.all()
24103
24121
  };
@@ -24109,7 +24127,7 @@ var qh = class {
24109
24127
  return (await cn(`/api/data/${this.entity}`, {
24110
24128
  method: "POST",
24111
24129
  body: JSON.stringify(e)
24112
- })).map((e) => Wh(e));
24130
+ })).map((e) => Kh(e));
24113
24131
  }
24114
24132
  async update(e, t) {
24115
24133
  return (await this.updateMany([{
@@ -24121,7 +24139,7 @@ var qh = class {
24121
24139
  return (await cn(`/api/data/${this.entity}`, {
24122
24140
  method: "PATCH",
24123
24141
  body: JSON.stringify(e)
24124
- })).map((e) => Wh(e));
24142
+ })).map((e) => Kh(e));
24125
24143
  }
24126
24144
  async delete(e) {
24127
24145
  await this.deleteMany([e]);
@@ -24149,20 +24167,20 @@ var qh = class {
24149
24167
  return (await cn(`/api/data/${this.entity}?unique_fields=${n}`, {
24150
24168
  method: "POST",
24151
24169
  body: JSON.stringify(e)
24152
- })).map((e) => Wh(e));
24170
+ })).map((e) => Kh(e));
24153
24171
  }
24154
24172
  };
24155
- function Jh(e, t) {
24156
- return new qh(e, t);
24173
+ function Xh(e, t) {
24174
+ return new Yh(e, t);
24157
24175
  }
24158
24176
  //#endregion
24159
24177
  //#region src/api/batch.ts
24160
- var Yh = class {
24178
+ var Zh = class {
24161
24179
  ops = [];
24162
24180
  call(e, t) {
24163
24181
  return this.ops.push({
24164
24182
  action: e,
24165
- params: Xh(t)
24183
+ params: Qh(t)
24166
24184
  }), this;
24167
24185
  }
24168
24186
  upsert(e, t, n = "upsert", r = []) {
@@ -24184,12 +24202,12 @@ var Yh = class {
24184
24202
  return this.ops;
24185
24203
  }
24186
24204
  };
24187
- function Xh(e) {
24205
+ function Qh(e) {
24188
24206
  return e == null ? null : typeof e == "object" && !Array.isArray(e) ? e : { value: e };
24189
24207
  }
24190
24208
  //#endregion
24191
24209
  //#region src/hooks/useColumns.ts
24192
- function Zh(e, t) {
24210
+ function $h(e, t) {
24193
24211
  let [n, r] = D(), i = d(() => {
24194
24212
  let r = n.get("columns");
24195
24213
  return r ? r.split(",").filter(Boolean).filter((t) => e.includes(t)) : t.length > 0 ? t : e;
@@ -24199,7 +24217,7 @@ function Zh(e, t) {
24199
24217
  t
24200
24218
  ]), a = s((e) => {
24201
24219
  let i = new URLSearchParams(n);
24202
- e.length === 0 || Qh(e, t) ? i.delete("columns") : i.set("columns", e.join(",")), r(i);
24220
+ e.length === 0 || eg(e, t) ? i.delete("columns") : i.set("columns", e.join(",")), r(i);
24203
24221
  }, [
24204
24222
  n,
24205
24223
  r,
@@ -24225,12 +24243,12 @@ function Zh(e, t) {
24225
24243
  }, [i, a])
24226
24244
  };
24227
24245
  }
24228
- function Qh(e, t) {
24246
+ function eg(e, t) {
24229
24247
  return e.length === t.length ? e.every((e, n) => e === t[n]) : !1;
24230
24248
  }
24231
24249
  //#endregion
24232
24250
  //#region src/components/shared/PageHeader.tsx
24233
- function $h({ title: e, backTo: t, actions: n }) {
24251
+ function tg({ title: e, backTo: t, actions: n }) {
24234
24252
  let r = C(), { switchTab: i, findTabByPathname: a } = nr();
24235
24253
  function o() {
24236
24254
  if (!t) return;
@@ -24281,7 +24299,7 @@ function $h({ title: e, backTo: t, actions: n }) {
24281
24299
  }
24282
24300
  //#endregion
24283
24301
  //#region src/components/list/BulkBar.tsx
24284
- function eg({ count: e, actions: t, onClear: n, onDelete: r, onExport: i }) {
24302
+ function ng({ count: e, actions: t, onClear: n, onDelete: r, onExport: i }) {
24285
24303
  let [a, o] = p(!1), s = f(null), c = t.filter((e) => e.primary), l = t.filter((e) => !e.primary);
24286
24304
  return /* @__PURE__ */ R("div", {
24287
24305
  style: {
@@ -24347,7 +24365,7 @@ function eg({ count: e, actions: t, onClear: n, onDelete: r, onExport: i }) {
24347
24365
  background: "var(--inverted-overlay)",
24348
24366
  margin: "0 4px"
24349
24367
  } }),
24350
- c.map((e) => /* @__PURE__ */ L(tg, {
24368
+ c.map((e) => /* @__PURE__ */ L(rg, {
24351
24369
  icon: e.icon,
24352
24370
  label: e.label,
24353
24371
  onClick: e.onRun
@@ -24411,7 +24429,7 @@ function eg({ count: e, actions: t, onClear: n, onDelete: r, onExport: i }) {
24411
24429
  ]
24412
24430
  });
24413
24431
  }
24414
- function tg({ icon: e, label: t, onClick: n }) {
24432
+ function rg({ icon: e, label: t, onClick: n }) {
24415
24433
  return /* @__PURE__ */ R("button", {
24416
24434
  onClick: n,
24417
24435
  style: {
@@ -24435,7 +24453,7 @@ function tg({ icon: e, label: t, onClick: n }) {
24435
24453
  }
24436
24454
  //#endregion
24437
24455
  //#region src/components/list/RowMenu.tsx
24438
- function ng({ x: e, y: t, onClose: n, onPeek: r, onOpen: i, onEditInline: a, onDuplicate: o, onCopyLink: s, onDelete: c, actions: l }) {
24456
+ function ig({ x: e, y: t, onClose: n, onPeek: r, onOpen: i, onEditInline: a, onDuplicate: o, onCopyLink: s, onDelete: c, actions: l }) {
24439
24457
  let u = (e) => () => {
24440
24458
  n(), e && e();
24441
24459
  }, d = r || i || a || o || s, f = l && l.length > 0;
@@ -24513,23 +24531,23 @@ function ng({ x: e, y: t, onClose: n, onPeek: r, onOpen: i, onEditInline: a, onD
24513
24531
  }
24514
24532
  //#endregion
24515
24533
  //#region src/components/list/resolveActions.ts
24516
- var rg = "list_toolbar", ig = "list_floatbar";
24517
- function ag(e) {
24534
+ var ag = "list_toolbar", og = "list_floatbar";
24535
+ function sg(e) {
24518
24536
  return !1;
24519
24537
  }
24520
- function og(e) {
24538
+ function cg(e) {
24521
24539
  let { actions: t, screen: n, selectionCount: r } = e, i = e.hasPermission ?? (() => !0), a = e.maxPrimary ?? 2, o = [];
24522
24540
  for (let [e, n] of Object.entries(t)) (n.visibility ?? []).includes("list_toolbar") && i(e) && o.push({
24523
24541
  code: e,
24524
24542
  action: n
24525
24543
  });
24526
- let s = new Map(o.map((e) => [e.code, e])), c = o.filter((e) => !ag(e.action)), l, u = n?.primary_actions;
24544
+ let s = new Map(o.map((e) => [e.code, e])), c = o.filter((e) => !sg(e.action)), l, u = n?.primary_actions;
24527
24545
  if (u && u.length > 0) {
24528
24546
  let e = new Set(c.map((e) => e.code));
24529
24547
  l = u.filter((t) => s.has(t) && e.has(t)).slice(0, a).map((e) => s.get(e));
24530
24548
  } else l = c.filter((e) => (e.action.position ?? 0) <= 10).slice(0, a);
24531
24549
  let d = [], f = [];
24532
- for (let e of o) ag(e.action) ? f.push(e) : d.push(e);
24550
+ for (let e of o) sg(e.action) ? f.push(e) : d.push(e);
24533
24551
  return {
24534
24552
  primary: l,
24535
24553
  global: d,
@@ -24537,7 +24555,7 @@ function og(e) {
24537
24555
  selectionCount: r
24538
24556
  };
24539
24557
  }
24540
- function sg(e) {
24558
+ function lg(e) {
24541
24559
  let { actions: t, screen: n } = e, r = e.hasPermission ?? (() => !0), i = e.maxPrimary ?? 2, a = [];
24542
24560
  for (let [e, n] of Object.entries(t)) (n.visibility ?? []).includes("list_floatbar") && r(e) && a.push({
24543
24561
  code: e,
@@ -24551,7 +24569,7 @@ function sg(e) {
24551
24569
  }
24552
24570
  //#endregion
24553
24571
  //#region src/components/list/ListPage.tsx
24554
- function cg(e, t = 12) {
24572
+ function ug(e, t = 12) {
24555
24573
  let n = e.display?.icon;
24556
24574
  if (!n) return null;
24557
24575
  let r = H[n];
@@ -24560,8 +24578,8 @@ function cg(e, t = 12) {
24560
24578
  size: t
24561
24579
  });
24562
24580
  }
24563
- function lg({ title: e, singular: t, total: n, shown: r, selectionCount: i, clearSelection: a, onNewRecord: o, screen: s, actions: c, hasPermission: l, executeAction: u, children: m, onBulkDelete: h, onBulkExport: g, onToolbarExport: _, onManageActions: v }) {
24564
- let y = f(null), [b, x] = p(!1), { run: S } = xu(), C = d(() => og({
24581
+ function dg({ title: e, singular: t, total: n, shown: r, selectionCount: i, clearSelection: a, onNewRecord: o, screen: s, actions: c, hasPermission: l, executeAction: u, children: m, onBulkDelete: h, onBulkExport: g, onToolbarExport: _, onManageActions: v }) {
24582
+ let y = f(null), [b, x] = p(!1), { run: S } = xu(), C = d(() => cg({
24565
24583
  actions: c,
24566
24584
  screen: s,
24567
24585
  selectionCount: i,
@@ -24571,7 +24589,7 @@ function lg({ title: e, singular: t, total: n, shown: r, selectionCount: i, clea
24571
24589
  s,
24572
24590
  i,
24573
24591
  l
24574
- ]), w = d(() => sg({
24592
+ ]), w = d(() => lg({
24575
24593
  actions: c,
24576
24594
  screen: s,
24577
24595
  selectionCount: i,
@@ -24592,7 +24610,7 @@ function lg({ title: e, singular: t, total: n, shown: r, selectionCount: i, clea
24592
24610
  }, E = d(() => w.entries.map(({ code: e, action: t }) => ({
24593
24611
  id: e,
24594
24612
  label: X(t.display?.name) || e,
24595
- icon: cg(t),
24613
+ icon: ug(t),
24596
24614
  primary: w.primaryCodes.has(e),
24597
24615
  destructive: t.destructive,
24598
24616
  onRun: () => T({
@@ -24649,7 +24667,7 @@ function lg({ title: e, singular: t, total: n, shown: r, selectionCount: i, clea
24649
24667
  }),
24650
24668
  C.primary.map((e) => /* @__PURE__ */ L(U, {
24651
24669
  kind: "default",
24652
- icon: cg(e.action, 13),
24670
+ icon: ug(e.action, 13),
24653
24671
  onClick: () => T(e, !1),
24654
24672
  children: X(e.action.display?.name) || e.code
24655
24673
  }, e.code)),
@@ -24672,9 +24690,9 @@ function lg({ title: e, singular: t, total: n, shown: r, selectionCount: i, clea
24672
24690
  width: 240,
24673
24691
  align: "end",
24674
24692
  children: [
24675
- C.global.length > 0 && /* @__PURE__ */ L(ug, { children: "Global" }),
24693
+ C.global.length > 0 && /* @__PURE__ */ L(fg, { children: "Global" }),
24676
24694
  C.global.map((e) => /* @__PURE__ */ L(q, {
24677
- icon: cg(e.action),
24695
+ icon: ug(e.action),
24678
24696
  danger: e.action.destructive,
24679
24697
  onClick: () => {
24680
24698
  x(!1), T(e, !1);
@@ -24714,7 +24732,7 @@ function lg({ title: e, singular: t, total: n, shown: r, selectionCount: i, clea
24714
24732
  pointerEvents: i === 0 ? "none" : "auto"
24715
24733
  },
24716
24734
  children: /* @__PURE__ */ L(q, {
24717
- icon: cg(e.action),
24735
+ icon: ug(e.action),
24718
24736
  danger: e.action.destructive,
24719
24737
  onClick: () => {
24720
24738
  x(!1), T(e, !0);
@@ -24758,7 +24776,7 @@ function lg({ title: e, singular: t, total: n, shown: r, selectionCount: i, clea
24758
24776
  ]
24759
24777
  }),
24760
24778
  m,
24761
- i > 0 && /* @__PURE__ */ L(eg, {
24779
+ i > 0 && /* @__PURE__ */ L(ng, {
24762
24780
  count: i,
24763
24781
  actions: E,
24764
24782
  onClear: a,
@@ -24768,7 +24786,7 @@ function lg({ title: e, singular: t, total: n, shown: r, selectionCount: i, clea
24768
24786
  ]
24769
24787
  });
24770
24788
  }
24771
- function ug({ children: e }) {
24789
+ function fg({ children: e }) {
24772
24790
  return /* @__PURE__ */ L("div", {
24773
24791
  style: {
24774
24792
  padding: "6px 8px 4px",
@@ -24783,7 +24801,7 @@ function ug({ children: e }) {
24783
24801
  }
24784
24802
  //#endregion
24785
24803
  //#region src/components/list/InlineEditCell.tsx
24786
- var dg = {
24804
+ var pg = {
24787
24805
  padding: "4px 6px",
24788
24806
  margin: "-4px -6px",
24789
24807
  borderRadius: 4,
@@ -24794,7 +24812,7 @@ var dg = {
24794
24812
  alignItems: "center",
24795
24813
  gap: 4
24796
24814
  };
24797
- function fg({ value: e, onSave: t, type: n = "text", options: r, trigger: i = "always", label: a, placeholder: o }) {
24815
+ function mg({ value: e, onSave: t, type: n = "text", options: r, trigger: i = "always", label: a, placeholder: o }) {
24798
24816
  let [s, c] = p(e), [u, d] = p(e), [m, h] = p(!1), [g, _] = p(e), v = f(null);
24799
24817
  l(() => {
24800
24818
  c(e), d(e), _(e);
@@ -24866,7 +24884,7 @@ function fg({ value: e, onSave: t, type: n = "text", options: r, trigger: i = "a
24866
24884
  onMouseLeave: (e) => {
24867
24885
  e.currentTarget.style.borderColor = "transparent";
24868
24886
  },
24869
- style: dg,
24887
+ style: pg,
24870
24888
  children: u ?? /* @__PURE__ */ L("span", {
24871
24889
  style: { color: "var(--text-4)" },
24872
24890
  children: "Click to edit"
@@ -24875,7 +24893,7 @@ function fg({ value: e, onSave: t, type: n = "text", options: r, trigger: i = "a
24875
24893
  }
24876
24894
  //#endregion
24877
24895
  //#region src/components/pages/home/HomeStub.tsx
24878
- var pg = [
24896
+ var hg = [
24879
24897
  {
24880
24898
  id: "a1",
24881
24899
  title: "James Gallagher moved to Discovery",
@@ -24891,7 +24909,7 @@ var pg = [
24891
24909
  title: "Refill enrichment job completed (32 leads)",
24892
24910
  when: "10:00 AM"
24893
24911
  }
24894
- ], mg = [
24912
+ ], gg = [
24895
24913
  {
24896
24914
  label: "Open leads",
24897
24915
  val: "127",
@@ -24916,7 +24934,7 @@ var pg = [
24916
24934
  delta: "2 failed",
24917
24935
  tone: "amber"
24918
24936
  }
24919
- ], hg = [
24937
+ ], _g = [
24920
24938
  [
24921
24939
  "leads",
24922
24940
  "Leads",
@@ -24948,7 +24966,7 @@ var pg = [
24948
24966
  "entity"
24949
24967
  ]
24950
24968
  ];
24951
- function gg({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLabel: n = "Acme · production" }) {
24969
+ function vg({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLabel: n = "Acme · production" }) {
24952
24970
  return /* @__PURE__ */ L("div", {
24953
24971
  style: {
24954
24972
  padding: "22px 24px",
@@ -24992,7 +25010,7 @@ function gg({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
24992
25010
  gap: 10,
24993
25011
  margin: "16px 0"
24994
25012
  },
24995
- children: mg.map((e) => /* @__PURE__ */ R("div", {
25013
+ children: gg.map((e) => /* @__PURE__ */ R("div", {
24996
25014
  style: {
24997
25015
  padding: 14,
24998
25016
  background: "var(--surface)",
@@ -25040,7 +25058,7 @@ function gg({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
25040
25058
  gridTemplateColumns: "repeat(3,1fr)",
25041
25059
  gap: 8
25042
25060
  },
25043
- children: hg.map(([t, n, r]) => {
25061
+ children: _g.map(([t, n, r]) => {
25044
25062
  let a = H[r];
25045
25063
  return /* @__PURE__ */ R("button", {
25046
25064
  onClick: () => e?.(t),
@@ -25085,7 +25103,7 @@ function gg({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
25085
25103
  flexDirection: "column",
25086
25104
  gap: 8
25087
25105
  },
25088
- children: pg.slice(0, 3).map((e) => /* @__PURE__ */ R("div", {
25106
+ children: hg.slice(0, 3).map((e) => /* @__PURE__ */ R("div", {
25089
25107
  style: {
25090
25108
  fontSize: 12,
25091
25109
  color: "var(--text-2)"
@@ -25114,19 +25132,19 @@ function gg({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
25114
25132
  }
25115
25133
  //#endregion
25116
25134
  //#region src/components/pages/pipeline/Pipeline.tsx
25117
- var _g = {
25135
+ var yg = {
25118
25136
  "1-New": { color: "slate" },
25119
25137
  "2-Contacted": { color: "sky" },
25120
25138
  "3-Qualified": { color: "violet" },
25121
25139
  "4-Proposal": { color: "amber" },
25122
25140
  "5-Won": { color: "emerald" },
25123
25141
  "6-Lost": { color: "rose" }
25124
- }, vg = {
25142
+ }, bg = {
25125
25143
  P0: "rose",
25126
25144
  P1: "amber",
25127
25145
  P2: "sky",
25128
25146
  P3: "slate"
25129
- }, yg = [
25147
+ }, xg = [
25130
25148
  {
25131
25149
  id: "l1",
25132
25150
  contact: "James Gallagher",
@@ -25192,11 +25210,11 @@ var _g = {
25192
25210
  score: 58
25193
25211
  }
25194
25212
  ];
25195
- function bg() {
25196
- let e = Object.entries(_g).map(([e, t]) => ({
25213
+ function Sg() {
25214
+ let e = Object.entries(yg).map(([e, t]) => ({
25197
25215
  key: e,
25198
25216
  color: t.color,
25199
- leads: yg.filter((t) => t.pipeline === e)
25217
+ leads: xg.filter((t) => t.pipeline === e)
25200
25218
  }));
25201
25219
  return /* @__PURE__ */ R("div", {
25202
25220
  style: {
@@ -25227,7 +25245,7 @@ function bg() {
25227
25245
  fontSize: 12,
25228
25246
  color: "var(--text-3)"
25229
25247
  },
25230
- children: [yg.length, " leads · $2.4M pipeline"]
25248
+ children: [xg.length, " leads · $2.4M pipeline"]
25231
25249
  })]
25232
25250
  }), /* @__PURE__ */ L("div", {
25233
25251
  style: {
@@ -25313,7 +25331,7 @@ function bg() {
25313
25331
  flexWrap: "wrap"
25314
25332
  },
25315
25333
  children: [e.priority && e.priority !== "-" && /* @__PURE__ */ L(G, {
25316
- tone: vg[e.priority] ?? "slate",
25334
+ tone: bg[e.priority] ?? "slate",
25317
25335
  size: "xs",
25318
25336
  dot: !0,
25319
25337
  children: e.priority
@@ -25332,7 +25350,7 @@ function bg() {
25332
25350
  }
25333
25351
  //#endregion
25334
25352
  //#region src/components/pages/jobs/Jobs.tsx
25335
- var xg = [
25353
+ var Cg = [
25336
25354
  {
25337
25355
  id: "job_91a4",
25338
25356
  name: "reparse_leads_with_llm",
@@ -25376,12 +25394,12 @@ var xg = [
25376
25394
  worker: "wk-us-01",
25377
25395
  took: "2m 02s"
25378
25396
  }
25379
- ], Sg = {
25397
+ ], wg = {
25380
25398
  running: "sky",
25381
25399
  success: "emerald",
25382
25400
  queued: "slate",
25383
25401
  failed: "rose"
25384
- }, Cg = [
25402
+ }, Tg = [
25385
25403
  "ID",
25386
25404
  "Name",
25387
25405
  "Status",
@@ -25391,7 +25409,7 @@ var xg = [
25391
25409
  "Worker",
25392
25410
  ""
25393
25411
  ];
25394
- function wg() {
25412
+ function Eg() {
25395
25413
  return /* @__PURE__ */ R("div", {
25396
25414
  style: {
25397
25415
  padding: "14px 20px",
@@ -25440,7 +25458,7 @@ function wg() {
25440
25458
  background: "var(--surface-2)",
25441
25459
  color: "var(--text-3)"
25442
25460
  },
25443
- children: Cg.map((e, t) => /* @__PURE__ */ L("th", {
25461
+ children: Tg.map((e, t) => /* @__PURE__ */ L("th", {
25444
25462
  style: {
25445
25463
  padding: "0 10px",
25446
25464
  textAlign: "left",
@@ -25452,7 +25470,7 @@ function wg() {
25452
25470
  },
25453
25471
  children: e
25454
25472
  }, e || `_h${t}`))
25455
- }) }), /* @__PURE__ */ L("tbody", { children: xg.map((e) => /* @__PURE__ */ R("tr", {
25473
+ }) }), /* @__PURE__ */ L("tbody", { children: Cg.map((e) => /* @__PURE__ */ R("tr", {
25456
25474
  style: { height: 32 },
25457
25475
  children: [
25458
25476
  /* @__PURE__ */ L("td", {
@@ -25484,7 +25502,7 @@ function wg() {
25484
25502
  borderBottom: "1px solid var(--divider)"
25485
25503
  },
25486
25504
  children: /* @__PURE__ */ L(G, {
25487
- tone: Sg[e.status],
25505
+ tone: wg[e.status],
25488
25506
  size: "xs",
25489
25507
  dot: !0,
25490
25508
  children: e.status
@@ -25514,7 +25532,7 @@ function wg() {
25514
25532
  display: "block",
25515
25533
  height: "100%",
25516
25534
  width: `${e.progress}%`,
25517
- background: `var(--pill-${Sg[e.status]})`
25535
+ background: `var(--pill-${wg[e.status]})`
25518
25536
  } })
25519
25537
  }), /* @__PURE__ */ R("span", {
25520
25538
  className: "mono num",
@@ -25569,7 +25587,7 @@ function wg() {
25569
25587
  }
25570
25588
  //#endregion
25571
25589
  //#region src/components/layout/ImpersonationStartModal.tsx
25572
- function Tg({ open: e, targetUserId: t, targetUserLabel: n, onClose: r, onStarted: i }) {
25590
+ function Dg({ open: e, targetUserId: t, targetUserLabel: n, onClose: r, onStarted: i }) {
25573
25591
  let { start: a, isStarting: o } = fr(), { value: s } = Mr("impersonation.require_reason_min_length", 10), [c, l] = p(""), [u, d] = p("");
25574
25592
  if (!e) return null;
25575
25593
  let f = c.trim(), m = f.length >= s;
@@ -25729,7 +25747,7 @@ function Tg({ open: e, targetUserId: t, targetUserLabel: n, onClose: r, onStarte
25729
25747
  }
25730
25748
  //#endregion
25731
25749
  //#region src/components/agents/AgentVisualHints.tsx
25732
- function Eg({ turn: e, navigate: t }) {
25750
+ function Og({ turn: e, navigate: t }) {
25733
25751
  return l(() => {
25734
25752
  for (let n of e.hints) switch (n.kind) {
25735
25753
  case "navigate":
@@ -25768,7 +25786,7 @@ function Eg({ turn: e, navigate: t }) {
25768
25786
  }
25769
25787
  //#endregion
25770
25788
  //#region src/components/agents/AgentConversationDrawer.tsx
25771
- function Dg({ open: e, onClose: t, conversations: n, activeId: r, onSelect: i, onNew: a, onRefresh: o }) {
25789
+ function kg({ open: e, onClose: t, conversations: n, activeId: r, onSelect: i, onNew: a, onRefresh: o }) {
25772
25790
  return l(() => {
25773
25791
  e && o();
25774
25792
  }, [e, o]), e ? /* @__PURE__ */ R("aside", {
@@ -25795,7 +25813,7 @@ function Dg({ open: e, onClose: t, conversations: n, activeId: r, onSelect: i, o
25795
25813
  className: `block w-full px-4 py-3 text-left border-b border-divider hover:bg-surface ${e.id === r ? "bg-surface" : ""}`,
25796
25814
  children: [/* @__PURE__ */ L("div", {
25797
25815
  className: "text-sm font-medium truncate",
25798
- children: e.title || e.context ? Og(e.context) : "Untitled"
25816
+ children: e.title || e.context ? Ag(e.context) : "Untitled"
25799
25817
  }), /* @__PURE__ */ R("div", {
25800
25818
  className: "text-xs text-muted-foreground",
25801
25819
  children: [
@@ -25818,12 +25836,12 @@ function Dg({ open: e, onClose: t, conversations: n, activeId: r, onSelect: i, o
25818
25836
  ]
25819
25837
  }) : null;
25820
25838
  }
25821
- function Og(e) {
25839
+ function Ag(e) {
25822
25840
  if (!e) return "";
25823
25841
  let t = e.entity ? String(e.entity) : "", n = e.pk ? `:${String(e.pk).slice(0, 6)}` : "";
25824
25842
  return t ? `${t}${n}` : "";
25825
25843
  }
25826
25844
  //#endregion
25827
- export { Kr as ActionBatchError, Cu as ActionRunnerProvider, Ri as AgentChatPanel, Dg as AgentConversationDrawer, ji as AgentElicitForm, Eg as AgentVisualHints, Vh as App, Vh as Declarion, Gu as AuthShell, Ae as Avatar, Yh as Batch, Ge as BoolToggle, je as BrandGlyph, xr as Breadcrumbs, U as Btn, eg as BulkBar, ld as ChangePasswordDialog, Ke as Check, K as Chip, Yo as CircleImage, hp as ColumnPicker, Ir as CommandPalette, Qd as ConfirmDialog, Ze as DateInput, Me as Dropdown, wr as DynamicIcon, Wd as EmptyState, qh as EntityClient, qe as FieldLabel, No as FileDraftScope, cp as FilterChips, dp as FilterDrawer, Qu as Forgot, gg as HomeStub, ze as HoverCard, H as Icon, W as IconBtn, Er as ImpersonationBanner, Nr as ImpersonationFrame, Tg as ImpersonationStartModal, fg as InlineEditCell, wg as JobsStub, rt as JsonField, ke as Kbd, nu as MULTIPLE_VALUES, q as MenuItem, Hf as NO_VALUE_OPS, Uf as OP_LABELS, $h as PageHeader, tt as PasswordInput, G as Pill, bg as PipelineStub, xd as Preferences, fd as Profile, ru as PropertyGridEditor, rp as QEField, ot as QuickEditCell, np as QuickPeek, At as Rail, Ue as RecordIdBadge, Gh as RefCache, it as RefField, ad as Reset, We as RowField, ng as RowMenu, Be as SectionCard, Xe as Select, lg as ShellListPage, or as Sidebar, Yu as SignIn, Xu as SignUp, _h as SmartDetailPage, Ap as SmartListPage, Eh as SmartRecordListPage, J as Spinner, Jo as SquareImage, Tr as TabStrip, nt as TagsInput, vr as TenantChip, Ye as TextArea, Y as TextInput, Cr as TopBar, od as TwoFA, no as UploadError, ig as VISIBILITY_LIST_BULK_BAR, rg as VISIBILITY_LIST_TOOLBAR, at as ViewField, _p as ViewSwitcher, Xo as WideBanner, ei as approveInvocation, Jr as buildActionBody, Ct as buildDetailHrefFromId, wt as buildEntityDetailHref, Ql as buildMassEditTargets, Tt as buildRowDetailHref, sr as buildSections, ni as cancelConversation, Jf as countActiveFilters, Zr as createConversation, Oe as cx, Hr as deleteEntity, cu as detectCommonValue, fo as discardFile, Jh as entityClient, _r as envTone, Yr as executeAction, _t as extractPkValues, pt as fieldDisplayName, ho as formatBytes, eo as getFileWidget, yo as getImageCropper, gt as getPrimaryKeyFields, to as hasFileWidget, Kf as hasOrGroups, ri as listConversations, ai as listPendingInvocations, oi as loadHistory, X as loc, Wf as parseFiltersFromURL, Zl as parseTargetFilter, vt as pkValuePartsToId, xt as pkValuesFromId, bt as pkValuesToDetailId, yt as pkValuesToId, $a as registerFileWidget, Nh as registerScreen, ti as rejectInvocation, ii as rerunMessageTurn, sg as resolveBulkBarActions, St as resolveDetailRoute, og as resolveToolbarActions, Wr as restoreEntity, $r as sendElicitResponse, Qr as sendMessage, Gf as setFiltersInURL, vo as setImageCropper, ro as uploadFile, xu as useActionRunner, Ai as useAgentConversation, dr as useAuth, Zh as useColumns, Rd as useCreateEntity, Ud as useDebounce, Bd as useDeleteEntity, Th as useDeleteProperty, Fo as useDraftRegistration, Sa as useEntity, xa as useEntityData, zp as useEntityItem, Po as useFileDraftScope, Zf as useFilters, fr as useImpersonation, b as useLocation, S as useNavigate, Mr as useParam, w as useParams, Ar as usePublicParams, jr as useResolvedParam, jn as useSchema, vp as useScreen, E as useSearchParams, wh as useSetProperty, xh as useSetStatus, rr as useTabNavigate, nr as useTabStore, zd as useUpdateEntity, yp as useViews, po as validateClientSide };
25845
+ export { Kr as ActionBatchError, Cu as ActionRunnerProvider, Ri as AgentChatPanel, kg as AgentConversationDrawer, ji as AgentElicitForm, Og as AgentVisualHints, Uh as App, Uh as Declarion, Gu as AuthShell, Ae as Avatar, Zh as Batch, Ge as BoolToggle, je as BrandGlyph, xr as Breadcrumbs, U as Btn, ng as BulkBar, ld as ChangePasswordDialog, Ke as Check, K as Chip, Yo as CircleImage, _p as ColumnPicker, Ir as CommandPalette, Qd as ConfirmDialog, Ze as DateInput, Me as Dropdown, wr as DynamicIcon, Wd as EmptyState, Yh as EntityClient, qe as FieldLabel, No as FileDraftScope, up as FilterChips, pp as FilterDrawer, Qu as Forgot, vg as HomeStub, ze as HoverCard, H as Icon, W as IconBtn, Er as ImpersonationBanner, Nr as ImpersonationFrame, Dg as ImpersonationStartModal, mg as InlineEditCell, Eg as JobsStub, rt as JsonField, ke as Kbd, nu as MULTIPLE_VALUES, q as MenuItem, Wf as NO_VALUE_OPS, Gf as OP_LABELS, tg as PageHeader, tt as PasswordInput, G as Pill, Sg as PipelineStub, xd as Preferences, fd as Profile, ru as PropertyGridEditor, ap as QEField, ot as QuickEditCell, ip as QuickPeek, At as Rail, Ue as RecordIdBadge, qh as RefCache, it as RefField, ad as Reset, We as RowField, ig as RowMenu, Be as SectionCard, Xe as Select, dg as ShellListPage, or as Sidebar, Yu as SignIn, Xu as SignUp, yh as SmartDetailPage, Mp as SmartListPage, Oh as SmartRecordListPage, J as Spinner, Jo as SquareImage, Tr as TabStrip, nt as TagsInput, vr as TenantChip, Ye as TextArea, Y as TextInput, Cr as TopBar, od as TwoFA, no as UploadError, og as VISIBILITY_LIST_BULK_BAR, ag as VISIBILITY_LIST_TOOLBAR, at as ViewField, yp as ViewSwitcher, Xo as WideBanner, ei as approveInvocation, Jr as buildActionBody, Ct as buildDetailHrefFromId, wt as buildEntityDetailHref, Ql as buildMassEditTargets, Tt as buildRowDetailHref, sr as buildSections, ni as cancelConversation, Xf as countActiveFilters, Zr as createConversation, Oe as cx, Hr as deleteEntity, cu as detectCommonValue, fo as discardFile, Xh as entityClient, _r as envTone, Yr as executeAction, _t as extractPkValues, pt as fieldDisplayName, ho as formatBytes, eo as getFileWidget, yo as getImageCropper, gt as getPrimaryKeyFields, to as hasFileWidget, Jf as hasOrGroups, ri as listConversations, ai as listPendingInvocations, oi as loadHistory, X as loc, Kf as parseFiltersFromURL, Zl as parseTargetFilter, vt as pkValuePartsToId, xt as pkValuesFromId, bt as pkValuesToDetailId, yt as pkValuesToId, $a as registerFileWidget, Fh as registerScreen, ti as rejectInvocation, ii as rerunMessageTurn, lg as resolveBulkBarActions, St as resolveDetailRoute, cg as resolveToolbarActions, Wr as restoreEntity, $r as sendElicitResponse, Qr as sendMessage, qf as setFiltersInURL, vo as setImageCropper, ro as uploadFile, xu as useActionRunner, Ai as useAgentConversation, dr as useAuth, $h as useColumns, Rd as useCreateEntity, Ud as useDebounce, Bd as useDeleteEntity, Dh as useDeleteProperty, Fo as useDraftRegistration, Sa as useEntity, xa as useEntityData, Vp as useEntityItem, Po as useFileDraftScope, $f as useFilters, fr as useImpersonation, b as useLocation, S as useNavigate, Mr as useParam, w as useParams, Ar as usePublicParams, jr as useResolvedParam, jn as useSchema, bp as useScreen, E as useSearchParams, Eh as useSetProperty, Ch as useSetStatus, rr as useTabNavigate, nr as useTabStore, zd as useUpdateEntity, xp as useViews, po as validateClientSide };
25828
25846
 
25829
25847
  //# sourceMappingURL=index.js.map