@declarion/react 0.28.0 → 0.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist-lib/index.js +614 -607
  2. package/package.json +1 -1
package/dist-lib/index.js CHANGED
@@ -12152,11 +12152,11 @@ function mu(e, t, n) {
12152
12152
  }
12153
12153
  //#endregion
12154
12154
  //#region src/lib/scroll-restoration.ts
12155
- var hu = "scroll", gu = 120, _u = 600;
12156
- function vu(e, t) {
12155
+ var hu = "scroll", gu = 120, _u = 24, vu = 600;
12156
+ function yu(e, t) {
12157
12157
  return Number.isFinite(e) ? Math.max(0, Math.min(e, Number.isFinite(t) && t > 0 ? t : 0)) : 0;
12158
12158
  }
12159
- function yu(e, t, n) {
12159
+ function bu(e, t, n) {
12160
12160
  let r = Number.isFinite(e) ? e : 0;
12161
12161
  if (t) {
12162
12162
  let e = n[t.index];
@@ -12172,18 +12172,18 @@ function yu(e, t, n) {
12172
12172
  offset: r
12173
12173
  };
12174
12174
  }
12175
- function bu(e, t, n, r) {
12175
+ function xu(e, t, n, r) {
12176
12176
  if (!e) return null;
12177
12177
  if (e.key) {
12178
12178
  let i = t.indexOf(e.key);
12179
12179
  if (i >= 0) {
12180
12180
  let t = n(i);
12181
- if (t !== void 0) return vu(t + e.delta, r);
12181
+ if (t !== void 0) return yu(t + e.delta, r);
12182
12182
  }
12183
12183
  }
12184
- return vu(e.offset, r);
12184
+ return yu(e.offset, r);
12185
12185
  }
12186
- function xu(e = hu) {
12186
+ function Su(e = hu) {
12187
12187
  let t = wn(), n = Y(null);
12188
12188
  if (n.current === null) {
12189
12189
  let r = Go(t), i = mi.getState().read(r, e);
@@ -12191,7 +12191,7 @@ function xu(e = hu) {
12191
12191
  }
12192
12192
  return n.current;
12193
12193
  }
12194
- function Su(e) {
12194
+ function Cu(e) {
12195
12195
  let t = 0, n = null, r = () => {
12196
12196
  n = null, t = Date.now(), e();
12197
12197
  };
@@ -12208,7 +12208,7 @@ function Su(e) {
12208
12208
  }
12209
12209
  };
12210
12210
  }
12211
- function Cu(e) {
12211
+ function wu(e) {
12212
12212
  let { virtualizer: t, scrollElementRef: n, rowKeys: r } = e, i = e.stateKey ?? "scroll", a = e.enabled ?? !0, o = Go(wn()), s = Y(t);
12213
12213
  s.current = t;
12214
12214
  let c = Y(r);
@@ -12228,28 +12228,35 @@ function Cu(e) {
12228
12228
  });
12229
12229
  return;
12230
12230
  }
12231
- let c = bu(t, r, (t) => e.getOffsetForIndex(t, "start")?.[0], e.getTotalSize());
12232
- c !== null && e.scrollToOffset(c, {
12233
- align: "start",
12234
- behavior: "auto"
12235
- });
12231
+ let u = 0, d = 0, f = NaN, p = () => {
12232
+ let e = s.current;
12233
+ if (!e) return;
12234
+ let n = xu(t, c.current, (t) => e.getOffsetForIndex(t, "start")?.[0], e.getTotalSize());
12235
+ n !== null && (Number.isNaN(f) || Math.abs(n - f) > 1) && (e.scrollToOffset(n, {
12236
+ align: "start",
12237
+ behavior: "auto"
12238
+ }), f = n, d++ < _u && (u = requestAnimationFrame(p)));
12239
+ };
12240
+ return p(), () => {
12241
+ u && cancelAnimationFrame(u);
12242
+ };
12236
12243
  }, [
12237
12244
  a,
12238
12245
  o,
12239
12246
  r,
12240
12247
  i
12241
- ]), wu(n, a, o, i, (e) => {
12248
+ ]), Tu(n, a, o, i, (e) => {
12242
12249
  let t = s.current;
12243
12250
  if (!t) return null;
12244
12251
  let n = e.scrollTop, r = n > 0 ? n : t.scrollOffset ?? 0;
12245
- return yu(r, t.getVirtualItemForOffset(r), c.current);
12252
+ return bu(r, t.getVirtualItemForOffset(r), c.current);
12246
12253
  });
12247
12254
  }
12248
- function wu(e, t, n, r, i) {
12255
+ function Tu(e, t, n, r, i) {
12249
12256
  let a = Y(i);
12250
12257
  a.current = i, q(() => {
12251
12258
  if (!t) return;
12252
- let i = 0, o = _u, s = null, c = null, l = (e) => {
12259
+ let i = 0, o = vu, s = null, c = null, l = (e) => {
12253
12260
  let t = a.current(e);
12254
12261
  t && mi.getState().set(n, r, t);
12255
12262
  }, u = () => c?.trigger(), d = () => {
@@ -12258,7 +12265,7 @@ function wu(e, t, n, r, i) {
12258
12265
  o-- > 0 && (i = requestAnimationFrame(d));
12259
12266
  return;
12260
12267
  }
12261
- s = t, c = Su(() => l(t)), t.addEventListener("scroll", u, { passive: !0 });
12268
+ s = t, c = Cu(() => l(t)), t.addEventListener("scroll", u, { passive: !0 });
12262
12269
  };
12263
12270
  return d(), () => {
12264
12271
  i && cancelAnimationFrame(i), s && s.removeEventListener("scroll", u), c?.flush();
@@ -12270,11 +12277,11 @@ function wu(e, t, n, r, i) {
12270
12277
  r
12271
12278
  ]);
12272
12279
  }
12273
- function Tu(e) {
12280
+ function Eu(e) {
12274
12281
  let { scrollElementRef: t } = e, n = e.stateKey ?? "scroll", r = e.enabled ?? !0, i = Go(wn()), a = Y(null);
12275
12282
  q(() => {
12276
12283
  if (!r || a.current === i) return;
12277
- let e = 0, o = _u, s = () => {
12284
+ let e = 0, o = vu, s = () => {
12278
12285
  let r = t.current;
12279
12286
  if (!r) {
12280
12287
  o-- > 0 && (e = requestAnimationFrame(s));
@@ -12292,7 +12299,7 @@ function Tu(e) {
12292
12299
  i,
12293
12300
  n,
12294
12301
  t
12295
- ]), wu(t, r, i, n, (e) => ({
12302
+ ]), Tu(t, r, i, n, (e) => ({
12296
12303
  key: "",
12297
12304
  delta: 0,
12298
12305
  offset: e.scrollTop
@@ -12300,7 +12307,7 @@ function Tu(e) {
12300
12307
  }
12301
12308
  //#endregion
12302
12309
  //#region src/components/shared/EmptyState.tsx
12303
- function Eu({ icon: e, title: t, description: n, action: i }) {
12310
+ function Du({ icon: e, title: t, description: n, action: i }) {
12304
12311
  return /* @__PURE__ */ $("div", {
12305
12312
  style: {
12306
12313
  display: "flex",
@@ -12352,41 +12359,41 @@ function Eu({ icon: e, title: t, description: n, action: i }) {
12352
12359
  }
12353
12360
  //#endregion
12354
12361
  //#region src/lib/safe-url.ts
12355
- var Du = [
12362
+ var Ou = [
12356
12363
  "http:",
12357
12364
  "https:",
12358
12365
  "mailto:"
12359
- ], Ou = /[\u0000-\u001f\u007f]/g;
12360
- function ku(e) {
12366
+ ], ku = /[\u0000-\u001f\u007f]/g;
12367
+ function Au(e) {
12361
12368
  if (!e) return;
12362
12369
  let t = e.trim();
12363
12370
  if (!t) return;
12364
- let n = t.replace(Ou, "");
12371
+ let n = t.replace(ku, "");
12365
12372
  if (!n || n.startsWith("//")) return;
12366
12373
  let r = n.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/);
12367
12374
  if (r) {
12368
12375
  let e = r[1].toLowerCase() + ":";
12369
- if (!Du.includes(e)) return;
12376
+ if (!Ou.includes(e)) return;
12370
12377
  }
12371
12378
  return n;
12372
12379
  }
12373
12380
  //#endregion
12374
12381
  //#region src/components/shared/LoadingSkeleton.tsx
12375
- var Au = {
12382
+ var ju = {
12376
12383
  display: "block",
12377
12384
  background: "linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 40%, var(--surface-3) 80%)",
12378
12385
  backgroundSize: "200% 100%",
12379
12386
  borderRadius: 6,
12380
12387
  animation: "declarion-shimmer 1.2s ease-in-out infinite"
12381
12388
  };
12382
- function ju({ height: e, width: t }) {
12389
+ function Mu({ height: e, width: t }) {
12383
12390
  return /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q("style", { children: "@keyframes declarion-shimmer{from{background-position:200% 0}to{background-position:-200% 0}}" }), /* @__PURE__ */ Q("span", { style: {
12384
- ...Au,
12391
+ ...ju,
12385
12392
  height: e,
12386
12393
  width: t ?? "100%"
12387
12394
  } })] });
12388
12395
  }
12389
- function Mu({ rows: e = 8, cols: t = 4 }) {
12396
+ function Nu({ rows: e = 8, cols: t = 4 }) {
12390
12397
  return /* @__PURE__ */ $("div", {
12391
12398
  style: {
12392
12399
  padding: 16,
@@ -12401,7 +12408,7 @@ function Mu({ rows: e = 8, cols: t = 4 }) {
12401
12408
  },
12402
12409
  children: Array.from({ length: t }).map((e, t) => /* @__PURE__ */ Q("div", {
12403
12410
  style: { flex: 1 },
12404
- children: /* @__PURE__ */ Q(ju, { height: 14 })
12411
+ children: /* @__PURE__ */ Q(Mu, { height: 14 })
12405
12412
  }, t))
12406
12413
  }), Array.from({ length: e }).map((e, n) => /* @__PURE__ */ Q("div", {
12407
12414
  style: {
@@ -12410,12 +12417,12 @@ function Mu({ rows: e = 8, cols: t = 4 }) {
12410
12417
  },
12411
12418
  children: Array.from({ length: t }).map((e, t) => /* @__PURE__ */ Q("div", {
12412
12419
  style: { flex: 1 },
12413
- children: /* @__PURE__ */ Q(ju, { height: 28 })
12420
+ children: /* @__PURE__ */ Q(Mu, { height: 28 })
12414
12421
  }, t))
12415
12422
  }, n))]
12416
12423
  });
12417
12424
  }
12418
- function Nu() {
12425
+ function Pu() {
12419
12426
  return /* @__PURE__ */ $("div", {
12420
12427
  style: {
12421
12428
  padding: 20,
@@ -12424,7 +12431,7 @@ function Nu() {
12424
12431
  gap: 16
12425
12432
  },
12426
12433
  children: [
12427
- /* @__PURE__ */ Q(ju, {
12434
+ /* @__PURE__ */ Q(Mu, {
12428
12435
  height: 12,
12429
12436
  width: 160
12430
12437
  }),
@@ -12435,11 +12442,11 @@ function Nu() {
12435
12442
  gap: 12
12436
12443
  },
12437
12444
  children: [/* @__PURE__ */ Q("span", { style: {
12438
- ...Au,
12445
+ ...ju,
12439
12446
  width: 32,
12440
12447
  height: 32,
12441
12448
  borderRadius: 8
12442
- } }), /* @__PURE__ */ Q(ju, {
12449
+ } }), /* @__PURE__ */ Q(Mu, {
12443
12450
  height: 22,
12444
12451
  width: 240
12445
12452
  })]
@@ -12456,7 +12463,7 @@ function Nu() {
12456
12463
  padding: "11px 14px",
12457
12464
  borderBottom: "1px solid var(--divider)"
12458
12465
  },
12459
- children: /* @__PURE__ */ Q(ju, {
12466
+ children: /* @__PURE__ */ Q(Mu, {
12460
12467
  height: 13,
12461
12468
  width: 150
12462
12469
  })
@@ -12472,12 +12479,12 @@ function Nu() {
12472
12479
  display: "flex",
12473
12480
  gap: 16
12474
12481
  },
12475
- children: [/* @__PURE__ */ Q(ju, {
12482
+ children: [/* @__PURE__ */ Q(Mu, {
12476
12483
  height: 13,
12477
12484
  width: 110
12478
12485
  }), /* @__PURE__ */ Q("div", {
12479
12486
  style: { flex: 1 },
12480
- children: /* @__PURE__ */ Q(ju, { height: 13 })
12487
+ children: /* @__PURE__ */ Q(Mu, { height: 13 })
12481
12488
  })]
12482
12489
  }, t))
12483
12490
  })]
@@ -12487,7 +12494,7 @@ function Nu() {
12487
12494
  }
12488
12495
  //#endregion
12489
12496
  //#region src/hooks/useTabSearchMirror.ts
12490
- function Pu(e) {
12497
+ function Fu(e) {
12491
12498
  let t = ot(), [n] = jn();
12492
12499
  q(() => {
12493
12500
  if (!e || t.enabled) return;
@@ -12501,7 +12508,7 @@ function Pu(e) {
12501
12508
  }
12502
12509
  //#endregion
12503
12510
  //#region src/hooks/useRegisterScreenTab.ts
12504
- function Fu(e, t, n, r) {
12511
+ function Iu(e, t, n, r) {
12505
12512
  let i = ot();
12506
12513
  q(() => {
12507
12514
  !e || i.enabled || Dr.getState().openTab({
@@ -12518,13 +12525,13 @@ function Fu(e, t, n, r) {
12518
12525
  i.enabled
12519
12526
  ]);
12520
12527
  }
12521
- function Iu(e, t, n) {
12528
+ function Lu(e, t, n) {
12522
12529
  let r = e?.route, i = t ? G(e?.display?.name) || G(t.display.name_plural) : "", a = e?.display?.icon || t?.display.icon;
12523
- Fu(t ? r : void 0, i, a, n);
12530
+ Iu(t ? r : void 0, i, a, n);
12524
12531
  }
12525
12532
  //#endregion
12526
12533
  //#region src/lib/filters.ts
12527
- var Lu = /* @__PURE__ */ new Set([
12534
+ var Ru = /* @__PURE__ */ new Set([
12528
12535
  "is_empty",
12529
12536
  "is_not_empty",
12530
12537
  "today",
@@ -12534,7 +12541,7 @@ var Lu = /* @__PURE__ */ new Set([
12534
12541
  "last_30_days",
12535
12542
  "last_hour",
12536
12543
  "last_24_hours"
12537
- ]), Ru = {
12544
+ ]), zu = {
12538
12545
  eq: "is",
12539
12546
  not_eq: "is not",
12540
12547
  gt: ">",
@@ -12556,7 +12563,7 @@ var Lu = /* @__PURE__ */ new Set([
12556
12563
  last_hour: "last hour",
12557
12564
  last_24_hours: "last 24 hours"
12558
12565
  };
12559
- function zu(e) {
12566
+ function Bu(e) {
12560
12567
  let t = e.get("filters");
12561
12568
  if (!t) return [];
12562
12569
  try {
@@ -12566,27 +12573,27 @@ function zu(e) {
12566
12573
  return [];
12567
12574
  }
12568
12575
  }
12569
- function Bu(e, t) {
12576
+ function Vu(e, t) {
12570
12577
  e.length === 0 ? t.delete("filters") : t.set("filters", JSON.stringify(e));
12571
12578
  }
12572
- function Vu(e) {
12579
+ function Hu(e) {
12573
12580
  return e.some((e) => e.or != null);
12574
12581
  }
12575
- function Hu(e) {
12582
+ function Uu(e) {
12576
12583
  let t = [];
12577
12584
  for (let n of e) if (!(!n || typeof n != "object")) {
12578
- if (n.field && n.op && t.push(n), n.or) for (let e of n.or) t.push(...Hu(e));
12579
- n.and && t.push(...Hu(n.and));
12585
+ if (n.field && n.op && t.push(n), n.or) for (let e of n.or) t.push(...Uu(e));
12586
+ n.and && t.push(...Uu(n.and));
12580
12587
  }
12581
12588
  return t;
12582
12589
  }
12583
- function Uu(e) {
12584
- return Hu(e).length;
12590
+ function Wu(e) {
12591
+ return Uu(e).length;
12585
12592
  }
12586
- function Wu(e, t) {
12593
+ function Gu(e, t) {
12587
12594
  if (!e.field || !e.op) return "";
12588
- let n = Ru[e.op] || e.op;
12589
- if (Lu.has(e.op)) return `${n}`;
12595
+ let n = zu[e.op] || e.op;
12596
+ if (Ru.has(e.op)) return `${n}`;
12590
12597
  let r = e.field, i = (e) => {
12591
12598
  if (t) {
12592
12599
  let n = t(r, e);
@@ -12596,18 +12603,18 @@ function Wu(e, t) {
12596
12603
  };
12597
12604
  return `${n} ${Array.isArray(e.value) ? e.value.map(i).join(", ") : i(e.value)}`;
12598
12605
  }
12599
- function Gu(e, t) {
12606
+ function Ku(e, t) {
12600
12607
  return {
12601
12608
  field: e,
12602
12609
  op: "eq",
12603
12610
  value: t
12604
12611
  };
12605
12612
  }
12606
- function Ku(e, t) {
12613
+ function qu(e, t) {
12607
12614
  let n = [];
12608
12615
  for (let r of e) if (r.field !== t) {
12609
12616
  if (r.or) {
12610
- let e = r.or.map((e) => Ku(e, t)).filter((e) => e.length > 0);
12617
+ let e = r.or.map((e) => qu(e, t)).filter((e) => e.length > 0);
12611
12618
  e.length > 0 && n.push({
12612
12619
  ...r,
12613
12620
  or: e
@@ -12615,7 +12622,7 @@ function Ku(e, t) {
12615
12622
  continue;
12616
12623
  }
12617
12624
  if (r.and) {
12618
- let e = Ku(r.and, t);
12625
+ let e = qu(r.and, t);
12619
12626
  e.length > 0 && n.push({
12620
12627
  ...r,
12621
12628
  and: e
@@ -12628,14 +12635,14 @@ function Ku(e, t) {
12628
12635
  }
12629
12636
  //#endregion
12630
12637
  //#region src/hooks/useFilters.ts
12631
- function qu() {
12632
- let [e, t] = jn(), n = J(() => zu(e), [e]);
12638
+ function Ju() {
12639
+ let [e, t] = jn(), n = J(() => Bu(e), [e]);
12633
12640
  return {
12634
12641
  filters: n,
12635
- activeCount: J(() => Uu(n), [n]),
12642
+ activeCount: J(() => Wu(n), [n]),
12636
12643
  setFilters: K((n) => {
12637
12644
  let r = new URLSearchParams(e);
12638
- Bu(n, r), r.set("page", "1"), t(r);
12645
+ Vu(n, r), r.set("page", "1"), t(r);
12639
12646
  }, [e, t]),
12640
12647
  clearFilters: K(() => {
12641
12648
  let n = new URLSearchParams(e);
@@ -12645,17 +12652,17 @@ function qu() {
12645
12652
  }
12646
12653
  //#endregion
12647
12654
  //#region src/components/list/PeekFieldCell.tsx
12648
- var Ju = /* @__PURE__ */ new Set([
12655
+ var Yu = /* @__PURE__ */ new Set([
12649
12656
  "enum",
12650
12657
  "bool",
12651
12658
  "ref"
12652
12659
  ]);
12653
- function Yu(e) {
12660
+ function Xu(e) {
12654
12661
  let t = e.display?.widget;
12655
- return t && Ju.has(t) ? !0 : Ju.has(e.type);
12662
+ return t && Yu.has(t) ? !0 : Yu.has(e.type);
12656
12663
  }
12657
- function Xu({ field: e, fieldName: t, label: r, value: i, record: a, refs: o, readOnly: s, onCommit: c }) {
12658
- let l = mt(), [u, d] = X(!1), [f, p] = X(i), m = Yu(e);
12664
+ function Zu({ field: e, fieldName: t, label: r, value: i, record: a, refs: o, readOnly: s, onCommit: c }) {
12665
+ let l = mt(), [u, d] = X(!1), [f, p] = X(i), m = Xu(e);
12659
12666
  q(() => {
12660
12667
  u || p(i);
12661
12668
  }, [i, u]);
@@ -12785,7 +12792,7 @@ function Xu({ field: e, fieldName: t, label: r, value: i, record: a, refs: o, re
12785
12792
  }
12786
12793
  //#endregion
12787
12794
  //#region src/components/list/QuickPeek.tsx
12788
- function Zu(e, t = 12) {
12795
+ function Qu(e, t = 12) {
12789
12796
  let i = e.display?.icon;
12790
12797
  if (!i) return null;
12791
12798
  let a = n[i];
@@ -12794,7 +12801,7 @@ function Zu(e, t = 12) {
12794
12801
  size: t
12795
12802
  });
12796
12803
  }
12797
- function Qu({ entity: e, entityCode: t, record: r, title: i, recordId: a, avatarName: o, fields: c, refs: l, screen: u, actions: d, executeAction: f, onClose: p, onOpen: m, onSave: h }) {
12804
+ function $u({ entity: e, entityCode: t, record: r, title: i, recordId: a, avatarName: o, fields: c, refs: l, screen: u, actions: d, executeAction: f, onClose: p, onOpen: m, onSave: h }) {
12798
12805
  let g = mt(), [_, v] = X({ ...r }), [y, b] = X(!1), [S, C] = X(!1), w = Y(null), { run: T } = lt();
12799
12806
  q(() => {
12800
12807
  v({ ...r }), b(!1);
@@ -12926,7 +12933,7 @@ function Qu({ entity: e, entityCode: t, record: r, title: i, recordId: a, avatar
12926
12933
  /* @__PURE__ */ Q(x, { children: "Esc" }),
12927
12934
  " to close."
12928
12935
  ]
12929
- }), c.map((n) => /* @__PURE__ */ Q($u, {
12936
+ }), c.map((n) => /* @__PURE__ */ Q(ed, {
12930
12937
  label: n.label,
12931
12938
  children: n.kind === "file" ? No({
12932
12939
  entity: e,
@@ -12938,7 +12945,7 @@ function Qu({ entity: e, entityCode: t, record: r, title: i, recordId: a, avatar
12938
12945
  refs: l,
12939
12946
  disabled: n.readOnly,
12940
12947
  locale: g
12941
- }) : /* @__PURE__ */ Q(Xu, {
12948
+ }) : /* @__PURE__ */ Q(Zu, {
12942
12949
  field: n.field,
12943
12950
  fieldName: n.key,
12944
12951
  label: n.label,
@@ -12994,7 +13001,7 @@ function Qu({ entity: e, entityCode: t, record: r, title: i, recordId: a, avatar
12994
13001
  width: 220,
12995
13002
  align: "end",
12996
13003
  children: O.map(({ code: e, action: t }) => /* @__PURE__ */ Q(s, {
12997
- icon: Zu(t),
13004
+ icon: Qu(t),
12998
13005
  danger: t.destructive,
12999
13006
  onClick: () => {
13000
13007
  C(!1), k({
@@ -13008,7 +13015,7 @@ function Qu({ entity: e, entityCode: t, record: r, title: i, recordId: a, avatar
13008
13015
  }),
13009
13016
  D && /* @__PURE__ */ Q(R, {
13010
13017
  kind: "default",
13011
- icon: Zu(D.action, 13),
13018
+ icon: Qu(D.action, 13),
13012
13019
  onClick: () => k(D),
13013
13020
  children: G(D.action.display?.name) || D.code
13014
13021
  }),
@@ -13023,7 +13030,7 @@ function Qu({ entity: e, entityCode: t, record: r, title: i, recordId: a, avatar
13023
13030
  ]
13024
13031
  })] });
13025
13032
  }
13026
- function $u({ label: e, children: t }) {
13033
+ function ed({ label: e, children: t }) {
13027
13034
  return /* @__PURE__ */ $("div", {
13028
13035
  style: {
13029
13036
  display: "grid",
@@ -13044,24 +13051,24 @@ function $u({ label: e, children: t }) {
13044
13051
  }
13045
13052
  //#endregion
13046
13053
  //#region src/components/list/peekDraftStore.ts
13047
- var ed = /* @__PURE__ */ new Map();
13048
- function td(e, t) {
13049
- ed.set(e, t);
13050
- }
13051
- function nd(e) {
13052
- let t = ed.get(e);
13053
- return t === void 0 ? null : (ed.delete(e), t);
13054
+ var td = /* @__PURE__ */ new Map();
13055
+ function nd(e, t) {
13056
+ td.set(e, t);
13054
13057
  }
13055
13058
  function rd(e) {
13056
- ed.delete(e);
13059
+ let t = td.get(e);
13060
+ return t === void 0 ? null : (td.delete(e), t);
13061
+ }
13062
+ function id(e) {
13063
+ td.delete(e);
13057
13064
  }
13058
13065
  //#endregion
13059
13066
  //#region src/lib/sort.ts
13060
- var id = {
13067
+ var ad = {
13061
13068
  nulls_first: "first",
13062
13069
  nulls_last: "last"
13063
13070
  };
13064
- function ad(e) {
13071
+ function od(e) {
13065
13072
  if (!e) return [];
13066
13073
  let t = [];
13067
13074
  for (let n of e.split(",")) {
@@ -13074,14 +13081,14 @@ function ad(e) {
13074
13081
  dir: r[1]?.trim().toLowerCase() === "desc" ? "desc" : "asc"
13075
13082
  }, o = r[2]?.trim().toLowerCase();
13076
13083
  if (o) {
13077
- let e = id[o];
13084
+ let e = ad[o];
13078
13085
  e && (a.nulls = e);
13079
13086
  }
13080
13087
  t.push(a);
13081
13088
  }
13082
13089
  return t;
13083
13090
  }
13084
- function od(e) {
13091
+ function sd(e) {
13085
13092
  if (!e) return;
13086
13093
  let t = [];
13087
13094
  for (let n of e.split(",")) {
@@ -13092,30 +13099,30 @@ function od(e) {
13092
13099
  }
13093
13100
  return t.length > 0 ? t.join(",") : void 0;
13094
13101
  }
13095
- function sd(e) {
13102
+ function cd(e) {
13096
13103
  return e.map((e) => {
13097
13104
  let t = `${e.field}:${e.dir}`;
13098
13105
  return e.nulls === "first" ? `${t}:nulls_first` : e.nulls === "last" ? `${t}:nulls_last` : t;
13099
13106
  }).join(",");
13100
13107
  }
13101
- function cd(e, t) {
13108
+ function ld(e, t) {
13102
13109
  let n = e.findIndex((e) => e.field === t);
13103
13110
  return n >= 0 ? [...e.slice(0, n), ...e.slice(n + 1)] : e.length >= 5 ? e : [...e, {
13104
13111
  field: t,
13105
13112
  dir: "asc"
13106
13113
  }];
13107
13114
  }
13108
- function ld(e, t) {
13115
+ function ud(e, t) {
13109
13116
  let n = e.filter((e) => e.field !== t.field);
13110
13117
  return n.length >= 5 ? e : [...n, t];
13111
13118
  }
13112
- function ud(e, t) {
13119
+ function dd(e, t) {
13113
13120
  let n = e.findIndex((e) => e.field === t);
13114
13121
  return n < 0 ? e : [...e.slice(0, n), ...e.slice(n + 1)];
13115
13122
  }
13116
13123
  //#endregion
13117
13124
  //#region src/lib/format-count.ts
13118
- var dd = [
13125
+ var fd = [
13119
13126
  {
13120
13127
  value: 1e9,
13121
13128
  suffix: "B"
@@ -13129,27 +13136,27 @@ var dd = [
13129
13136
  suffix: "K"
13130
13137
  }
13131
13138
  ];
13132
- function fd(e) {
13139
+ function pd(e) {
13133
13140
  if (!Number.isFinite(e) || e < 0) return "~0";
13134
13141
  let t = Math.round(e);
13135
13142
  if (t < 1e3) return `~${t}`;
13136
- for (let { value: e, suffix: n } of dd) {
13143
+ for (let { value: e, suffix: n } of fd) {
13137
13144
  if (t < e) continue;
13138
13145
  let r = t / e;
13139
13146
  return `~${(r < 10 ? r.toFixed(1) : Math.round(r).toString()).replace(/\.0$/, "")}${n}`;
13140
13147
  }
13141
13148
  return `~${t.toLocaleString()}`;
13142
13149
  }
13143
- function pd(e) {
13150
+ function md(e) {
13144
13151
  return !Number.isFinite(e) || e < 0 ? "0" : Math.round(e).toLocaleString();
13145
13152
  }
13146
- function md(e, t) {
13147
- return t === "estimated" ? fd(e) : pd(e);
13153
+ function hd(e, t) {
13154
+ return t === "estimated" ? pd(e) : md(e);
13148
13155
  }
13149
13156
  //#endregion
13150
13157
  //#region src/components/filters/FilterChips.tsx
13151
- function hd({ filters: e, onRemove: t, onClearAll: r, onChipClick: i, fieldLabel: a = (e) => e, resolveValue: o }) {
13152
- return e.length === 0 ? null : Vu(e) ? /* @__PURE__ */ $("div", {
13158
+ function gd({ filters: e, onRemove: t, onClearAll: r, onChipClick: i, fieldLabel: a = (e) => e, resolveValue: o }) {
13159
+ return e.length === 0 ? null : Hu(e) ? /* @__PURE__ */ $("div", {
13153
13160
  style: {
13154
13161
  display: "flex",
13155
13162
  alignItems: "center",
@@ -13187,14 +13194,14 @@ function hd({ filters: e, onRemove: t, onClearAll: r, onChipClick: i, fieldLabel
13187
13194
  children: a(e.field)
13188
13195
  }),
13189
13196
  " ",
13190
- /* @__PURE__ */ Q(_d, {
13197
+ /* @__PURE__ */ Q(vd, {
13191
13198
  node: e,
13192
13199
  resolveValue: o
13193
13200
  })
13194
13201
  ] }, t))
13195
13202
  })]
13196
13203
  }, t))
13197
- }, n) : e.field && e.op ? /* @__PURE__ */ Q(gd, {
13204
+ }, n) : e.field && e.op ? /* @__PURE__ */ Q(_d, {
13198
13205
  node: e,
13199
13206
  fieldLabel: a,
13200
13207
  resolveValue: o,
@@ -13215,7 +13222,7 @@ function hd({ filters: e, onRemove: t, onClearAll: r, onChipClick: i, fieldLabel
13215
13222
  flexWrap: "wrap",
13216
13223
  paddingBottom: 12
13217
13224
  },
13218
- children: [Hu(e).map((e, n) => /* @__PURE__ */ Q(gd, {
13225
+ children: [Uu(e).map((e, n) => /* @__PURE__ */ Q(_d, {
13219
13226
  node: e,
13220
13227
  fieldLabel: a,
13221
13228
  resolveValue: o,
@@ -13230,7 +13237,7 @@ function hd({ filters: e, onRemove: t, onClearAll: r, onChipClick: i, fieldLabel
13230
13237
  })]
13231
13238
  });
13232
13239
  }
13233
- function gd({ node: e, fieldLabel: t, resolveValue: r, onRemove: i, onClick: a }) {
13240
+ function _d({ node: e, fieldLabel: t, resolveValue: r, onRemove: i, onClick: a }) {
13234
13241
  return /* @__PURE__ */ Q(L, {
13235
13242
  tone: "slate",
13236
13243
  icon: /* @__PURE__ */ Q(n.filter, { size: 11 }),
@@ -13244,7 +13251,7 @@ function gd({ node: e, fieldLabel: t, resolveValue: r, onRemove: i, onClick: a }
13244
13251
  " ",
13245
13252
  /* @__PURE__ */ Q("span", {
13246
13253
  style: { fontWeight: 600 },
13247
- children: /* @__PURE__ */ Q(_d, {
13254
+ children: /* @__PURE__ */ Q(vd, {
13248
13255
  node: e,
13249
13256
  resolveValue: r
13250
13257
  })
@@ -13252,18 +13259,18 @@ function gd({ node: e, fieldLabel: t, resolveValue: r, onRemove: i, onClick: a }
13252
13259
  ] })
13253
13260
  });
13254
13261
  }
13255
- function _d({ node: e, resolveValue: t }) {
13256
- let n = e.op, r = Ru[n] || n;
13257
- return Lu.has(n) ? /* @__PURE__ */ Q(Z, { children: r }) : t ? /* @__PURE__ */ $(Z, { children: [
13262
+ function vd({ node: e, resolveValue: t }) {
13263
+ let n = e.op, r = zu[n] || n;
13264
+ return Ru.has(n) ? /* @__PURE__ */ Q(Z, { children: r }) : t ? /* @__PURE__ */ $(Z, { children: [
13258
13265
  r,
13259
13266
  " ",
13260
13267
  (Array.isArray(e.value) ? e.value : [e.value]).map((n, r) => {
13261
13268
  let i = t(e.field, n);
13262
- return /* @__PURE__ */ $(ln, { children: [r > 0 ? ", " : "", /* @__PURE__ */ Q("span", { children: i.status === "loading" ? /* @__PURE__ */ Q(vd, {}) : i.label ?? i.raw })] }, r);
13269
+ return /* @__PURE__ */ $(ln, { children: [r > 0 ? ", " : "", /* @__PURE__ */ Q("span", { children: i.status === "loading" ? /* @__PURE__ */ Q(yd, {}) : i.label ?? i.raw })] }, r);
13263
13270
  })
13264
- ] }) : /* @__PURE__ */ Q(Z, { children: Wu(e) });
13271
+ ] }) : /* @__PURE__ */ Q(Z, { children: Gu(e) });
13265
13272
  }
13266
- function vd() {
13273
+ function yd() {
13267
13274
  return /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q("style", { children: "@keyframes declarion-shimmer{from{background-position:200% 0}to{background-position:-200% 0}}" }), /* @__PURE__ */ Q("span", {
13268
13275
  "aria-label": "loading",
13269
13276
  style: {
@@ -13280,7 +13287,7 @@ function vd() {
13280
13287
  }
13281
13288
  //#endregion
13282
13289
  //#region src/components/filters/FilterDrawer.tsx
13283
- function yd({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, defaultFilters: o, refs: s }) {
13290
+ function bd({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, defaultFilters: o, refs: s }) {
13284
13291
  let [c, l] = X(r), [u, d] = X(!1);
13285
13292
  if (q(() => {
13286
13293
  if (e) {
@@ -13302,7 +13309,7 @@ function yd({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, d
13302
13309
  o,
13303
13310
  a
13304
13311
  ]), !e) return null;
13305
- let f = Vu(c), p = new Set(c.filter((e) => e.field).map((e) => e.field)), m = (e) => {
13312
+ let f = Hu(c), p = new Set(c.filter((e) => e.field).map((e) => e.field)), m = (e) => {
13306
13313
  let t = a.find((t) => t.code === e);
13307
13314
  if (!t) return;
13308
13315
  let n = t.operators[0] || "eq";
@@ -13388,7 +13395,7 @@ function yd({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, d
13388
13395
  if (!e.or) {
13389
13396
  if (!e.field || !e.op) return null;
13390
13397
  let n = a.find((t) => t.code === e.field);
13391
- return n ? /* @__PURE__ */ Q(Td, {
13398
+ return n ? /* @__PURE__ */ Q(Ed, {
13392
13399
  node: e,
13393
13400
  meta: n,
13394
13401
  refs: s,
@@ -13396,7 +13403,7 @@ function yd({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, d
13396
13403
  onRemove: () => g(t)
13397
13404
  }, `${e.field}-${t}`) : null;
13398
13405
  }
13399
- return /* @__PURE__ */ Q(Ed, {
13406
+ return /* @__PURE__ */ Q(Dd, {
13400
13407
  groups: e.or,
13401
13408
  availableFields: a,
13402
13409
  refs: s,
@@ -13408,7 +13415,7 @@ function yd({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, d
13408
13415
  }) : c.map((e, t) => {
13409
13416
  if (!e.field || !e.op) return null;
13410
13417
  let n = a.find((t) => t.code === e.field);
13411
- return n ? /* @__PURE__ */ Q(Td, {
13418
+ return n ? /* @__PURE__ */ Q(Ed, {
13412
13419
  node: e,
13413
13420
  meta: n,
13414
13421
  refs: s,
@@ -13422,7 +13429,7 @@ function yd({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, d
13422
13429
  gap: 6,
13423
13430
  paddingTop: 6
13424
13431
  },
13425
- children: u ? /* @__PURE__ */ Q(Dd, {
13432
+ children: u ? /* @__PURE__ */ Q(Od, {
13426
13433
  fields: a,
13427
13434
  activeFields: p,
13428
13435
  onSelect: m,
@@ -13467,7 +13474,7 @@ function yd({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, d
13467
13474
  /* @__PURE__ */ Q(R, {
13468
13475
  kind: "primary",
13469
13476
  onClick: () => {
13470
- i(xd(c)), t();
13477
+ i(Sd(c)), t();
13471
13478
  },
13472
13479
  children: "Apply"
13473
13480
  })
@@ -13476,14 +13483,14 @@ function yd({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, d
13476
13483
  ]
13477
13484
  })] });
13478
13485
  }
13479
- function bd(e) {
13486
+ function xd(e) {
13480
13487
  return e == null || e === "" ? !1 : Array.isArray(e) ? e.length > 0 : !0;
13481
13488
  }
13482
- function xd(e) {
13489
+ function Sd(e) {
13483
13490
  let t = [];
13484
13491
  for (let n of e) {
13485
13492
  if (n.or) {
13486
- let e = n.or.map(xd).filter((e) => e.length > 0);
13493
+ let e = n.or.map(Sd).filter((e) => e.length > 0);
13487
13494
  e.length > 0 && t.push({
13488
13495
  ...n,
13489
13496
  or: e
@@ -13491,18 +13498,18 @@ function xd(e) {
13491
13498
  continue;
13492
13499
  }
13493
13500
  if (n.and) {
13494
- let e = xd(n.and);
13501
+ let e = Sd(n.and);
13495
13502
  e.length > 0 && t.push({
13496
13503
  ...n,
13497
13504
  and: e
13498
13505
  });
13499
13506
  continue;
13500
13507
  }
13501
- !n.field || !n.op || !Lu.has(n.op) && !bd(n.value) || t.push(n);
13508
+ !n.field || !n.op || !Ru.has(n.op) && !xd(n.value) || t.push(n);
13502
13509
  }
13503
13510
  return t;
13504
13511
  }
13505
- function Sd(e) {
13512
+ function Cd(e) {
13506
13513
  return !e || e.length === 0 ? [] : [
13507
13514
  {
13508
13515
  value: "",
@@ -13520,8 +13527,8 @@ function Sd(e) {
13520
13527
  }
13521
13528
  ];
13522
13529
  }
13523
- var Cd = "__custom__";
13524
- function wd({ meta: e, value: t, onUpdate: n }) {
13530
+ var wd = "__custom__";
13531
+ function Td({ meta: e, value: t, onUpdate: n }) {
13525
13532
  let r = e.specialValues ?? [], i = U(t), [a, o] = X(!r.some((e) => e.code === i) && i !== "");
13526
13533
  return a ? /* @__PURE__ */ Q(h, {
13527
13534
  "aria-label": `${e.label} filter value`,
@@ -13537,21 +13544,21 @@ function wd({ meta: e, value: t, onUpdate: n }) {
13537
13544
  value: "",
13538
13545
  label: "Select…"
13539
13546
  },
13540
- ...Sd(r),
13547
+ ...Cd(r),
13541
13548
  {
13542
- value: Cd,
13549
+ value: wd,
13543
13550
  label: "Custom value…"
13544
13551
  }
13545
13552
  ],
13546
13553
  onChange: (e) => {
13547
- e === Cd ? (o(!0), n({ value: "" })) : n({ value: e });
13554
+ e === wd ? (o(!0), n({ value: "" })) : n({ value: e });
13548
13555
  }
13549
13556
  });
13550
13557
  }
13551
- function Td({ node: e, meta: t, refs: r, onUpdate: i, onRemove: a }) {
13552
- let o = Lu.has(e.op), s = t.operators.map((e) => ({
13558
+ function Ed({ node: e, meta: t, refs: r, onUpdate: i, onRemove: a }) {
13559
+ let o = Ru.has(e.op), s = t.operators.map((e) => ({
13553
13560
  value: e,
13554
- label: Ru[e] || e
13561
+ label: zu[e] || e
13555
13562
  }));
13556
13563
  return /* @__PURE__ */ $("div", {
13557
13564
  style: {
@@ -13590,13 +13597,13 @@ function Td({ node: e, meta: t, refs: r, onUpdate: i, onRemove: a }) {
13590
13597
  }) : t.options ? /* @__PURE__ */ Q(Ft, {
13591
13598
  "aria-label": `${t.label} filter value`,
13592
13599
  value: U(e.value),
13593
- options: [...Sd(t.specialValues), ...t.options.map((e) => ({
13600
+ options: [...Cd(t.specialValues), ...t.options.map((e) => ({
13594
13601
  value: e.value,
13595
13602
  label: e.label
13596
13603
  }))],
13597
13604
  onChange: (e) => i({ value: e }),
13598
13605
  placeholder: "Select…"
13599
- }) : t.specialValues && t.specialValues.length > 0 ? /* @__PURE__ */ Q(wd, {
13606
+ }) : t.specialValues && t.specialValues.length > 0 ? /* @__PURE__ */ Q(Td, {
13600
13607
  meta: t,
13601
13608
  value: e.value,
13602
13609
  onUpdate: i
@@ -13615,7 +13622,7 @@ function Td({ node: e, meta: t, refs: r, onUpdate: i, onRemove: a }) {
13615
13622
  ]
13616
13623
  });
13617
13624
  }
13618
- function Ed({ groups: e, availableFields: t, refs: r, onChange: i }) {
13625
+ function Dd({ groups: e, availableFields: t, refs: r, onChange: i }) {
13619
13626
  return /* @__PURE__ */ $("div", {
13620
13627
  style: {
13621
13628
  display: "flex",
@@ -13670,7 +13677,7 @@ function Ed({ groups: e, availableFields: t, refs: r, onChange: i }) {
13670
13677
  }),
13671
13678
  a.map((n, a) => {
13672
13679
  let s = t.find((e) => e.code === n.field);
13673
- return s ? /* @__PURE__ */ Q(Td, {
13680
+ return s ? /* @__PURE__ */ Q(Ed, {
13674
13681
  node: n,
13675
13682
  meta: s,
13676
13683
  refs: r,
@@ -13708,7 +13715,7 @@ function Ed({ groups: e, availableFields: t, refs: r, onChange: i }) {
13708
13715
  })]
13709
13716
  });
13710
13717
  }
13711
- function Dd({ fields: e, activeFields: t, onSelect: r, onCancel: i }) {
13718
+ function Od({ fields: e, activeFields: t, onSelect: r, onCancel: i }) {
13712
13719
  let [a, o] = X(""), s = e.filter((e) => !t.has(e.code) && (a === "" || e.label.toLowerCase().includes(a.toLowerCase()) || e.code.toLowerCase().includes(a.toLowerCase())));
13713
13720
  return /* @__PURE__ */ $("div", {
13714
13721
  style: {
@@ -13782,7 +13789,7 @@ function Dd({ fields: e, activeFields: t, onSelect: r, onCancel: i }) {
13782
13789
  }
13783
13790
  //#endregion
13784
13791
  //#region src/components/pages/list/filter-meta.ts
13785
- function Od(e, t, n) {
13792
+ function kd(e, t, n) {
13786
13793
  if (!e || !t) return [];
13787
13794
  let r = e.filters ?? t.fields.names(), i = [];
13788
13795
  for (let a of r) {
@@ -13826,7 +13833,7 @@ function Od(e, t, n) {
13826
13833
  }
13827
13834
  let r = t.fields.get(a);
13828
13835
  if (!r) continue;
13829
- let o = bt(r, a, n), s = kd(r.type), c = r.values?.map((e) => ({
13836
+ let o = bt(r, a, n), s = Ad(r.type), c = r.values?.map((e) => ({
13830
13837
  value: e.code,
13831
13838
  label: G(e.name) || e.code,
13832
13839
  color: e.color
@@ -13843,7 +13850,7 @@ function Od(e, t, n) {
13843
13850
  }
13844
13851
  return i;
13845
13852
  }
13846
- function kd(e) {
13853
+ function Ad(e) {
13847
13854
  switch (e) {
13848
13855
  case "string":
13849
13856
  case "text":
@@ -13931,11 +13938,11 @@ function kd(e) {
13931
13938
  }
13932
13939
  //#endregion
13933
13940
  //#region src/components/pages/list/use-filter-value-labels.ts
13934
- var Ad = 200;
13935
- function jd(e, t, n, r) {
13936
- let i = new Map(e.map((e) => [e.code, e])), a = Md(i, t, n, r), o = In({ queries: a.map((e) => {
13941
+ var jd = 200;
13942
+ function Md(e, t, n, r) {
13943
+ let i = new Map(e.map((e) => [e.code, e])), a = Nd(i, t, n, r), o = In({ queries: a.map((e) => {
13937
13944
  let t = {
13938
- per_page: Ad,
13945
+ per_page: jd,
13939
13946
  filters: [{
13940
13947
  field: e.lookupField,
13941
13948
  op: "in",
@@ -14010,9 +14017,9 @@ function jd(e, t, n, r) {
14010
14017
  refs: s
14011
14018
  };
14012
14019
  }
14013
- function Md(e, t, n, r) {
14020
+ function Nd(e, t, n, r) {
14014
14021
  let i = /* @__PURE__ */ new Map();
14015
- for (let a of Hu(t)) {
14022
+ for (let a of Uu(t)) {
14016
14023
  if (!a.field) continue;
14017
14024
  let t = e.get(a.field);
14018
14025
  if (!t || t.type !== "ref" || !t.ref?.entity) continue;
@@ -14035,7 +14042,7 @@ function Md(e, t, n, r) {
14035
14042
  }
14036
14043
  //#endregion
14037
14044
  //#region src/components/pages/list/SaveViewDialog.tsx
14038
- function Nd({ open: e, pending: t, onClose: n, onSave: r }) {
14045
+ function Pd({ open: e, pending: t, onClose: n, onSave: r }) {
14039
14046
  let [i, a] = X("");
14040
14047
  if (q(() => {
14041
14048
  e && a("");
@@ -14132,7 +14139,7 @@ function Nd({ open: e, pending: t, onClose: n, onSave: r }) {
14132
14139
  }
14133
14140
  //#endregion
14134
14141
  //#region src/hooks/useScreenBack.ts
14135
- function Pd(e) {
14142
+ function Fd(e) {
14136
14143
  let t = En(), n = ot(), r = dt(), i = jr((e) => e.depth), { data: a } = gt(), o = e?.fallback, s = Dr((e) => {
14137
14144
  let t = e.tabs.find((t) => t.id === e.activeTabId);
14138
14145
  return t ? t.returnTo : void 0;
@@ -14180,8 +14187,8 @@ function Pd(e) {
14180
14187
  }
14181
14188
  //#endregion
14182
14189
  //#region src/components/pages/list/ListHeader.tsx
14183
- function Fd({ title: e, total: t, countMode: r, countPending: i, loaded: a, toolbarActions: o, screenActionLayout: s, entityActionLayout: c, selectedIds: l, data: u, rowKey: d, onActionSuccess: f, widgetContext: p }) {
14184
- let { run: m } = lt(), h = Pd(), g = J(() => {
14190
+ function Id({ title: e, total: t, countMode: r, countPending: i, loaded: a, toolbarActions: o, screenActionLayout: s, entityActionLayout: c, selectedIds: l, data: u, rowKey: d, onActionSuccess: f, widgetContext: p }) {
14191
+ let { run: m } = lt(), h = Fd(), g = J(() => {
14185
14192
  let e = {};
14186
14193
  for (let { code: t, action: n } of o) e[t] = n;
14187
14194
  return e;
@@ -14251,7 +14258,7 @@ function Fd({ title: e, total: t, countMode: r, countPending: i, loaded: a, tool
14251
14258
  "data-testid": "list-count-pending",
14252
14259
  style: { display: "inline-flex" },
14253
14260
  children: /* @__PURE__ */ Q(nt, { size: 10 })
14254
- }) : a : md(t, r ?? "exact")
14261
+ }) : a : hd(t, r ?? "exact")
14255
14262
  ]
14256
14263
  })]
14257
14264
  })
@@ -14280,7 +14287,7 @@ function Fd({ title: e, total: t, countMode: r, countPending: i, loaded: a, tool
14280
14287
  }
14281
14288
  //#endregion
14282
14289
  //#region src/components/pages/list/ListBulkBar.tsx
14283
- function Id({ selectedIds: e, floatbarActions: t, screenActionLayout: r, entityActionLayout: i, data: a, rowKey: o, entityCode: s, onClear: c, onActionSuccess: l, widgetContext: u }) {
14290
+ function Ld({ selectedIds: e, floatbarActions: t, screenActionLayout: r, entityActionLayout: i, data: a, rowKey: o, entityCode: s, onClear: c, onActionSuccess: l, widgetContext: u }) {
14284
14291
  let { run: d } = lt(), f = Rn(), p = J(() => {
14285
14292
  let e = {};
14286
14293
  for (let { code: n, action: r } of t) e[n] = r;
@@ -14378,7 +14385,7 @@ function Id({ selectedIds: e, floatbarActions: t, screenActionLayout: r, entityA
14378
14385
  }
14379
14386
  //#endregion
14380
14387
  //#region src/components/pages/list/DataCell.tsx
14381
- function Ld({ cell: e, isRowSelected: t }) {
14388
+ function Rd({ cell: e, isRowSelected: t }) {
14382
14389
  let n = e.column.id === "_select", r = e.column.id === "_actions", i = e.column.columnDef.cell, a = typeof i == "function" ? i(e.getContext()) : i;
14383
14390
  return /* @__PURE__ */ Q("td", {
14384
14391
  title: typeof a == "string" ? a : void 0,
@@ -14403,33 +14410,33 @@ function Ld({ cell: e, isRowSelected: t }) {
14403
14410
  }
14404
14411
  //#endregion
14405
14412
  //#region src/lib/field-classification.ts
14406
- function Rd(e, t) {
14413
+ function zd(e, t) {
14407
14414
  let n = e?.field_access?.[t];
14408
14415
  return n ? n.read === "granted" : !0;
14409
14416
  }
14410
- function zd(e, t) {
14417
+ function Bd(e, t) {
14411
14418
  let n = e?.field_access?.[t];
14412
14419
  return n ? n.write === "granted" : !0;
14413
14420
  }
14414
- function Bd(e, t) {
14421
+ function Vd(e, t) {
14415
14422
  return e?.field_access?.[t]?.classification;
14416
14423
  }
14417
- function Vd(e, t) {
14424
+ function Hd(e, t) {
14418
14425
  return e?.field_access?.[t]?.required_permission;
14419
14426
  }
14420
- function Hd(e, t, n) {
14421
- let r = Bd(t, n);
14427
+ function Ud(e, t, n) {
14428
+ let r = Vd(t, n);
14422
14429
  if (r) return e?.classifications?.[r];
14423
14430
  }
14424
- function Ud(e, t, n) {
14425
- return !!Hd(e, t, n)?.sod_protected;
14431
+ function Wd(e, t, n) {
14432
+ return !!Ud(e, t, n)?.sod_protected;
14426
14433
  }
14427
- function Wd(e, t) {
14434
+ function Gd(e, t) {
14428
14435
  return e?.field_access?.[t];
14429
14436
  }
14430
14437
  //#endregion
14431
14438
  //#region src/components/pages/list/RowActionsCell.tsx
14432
- function Gd({ row: e, rowId: t, screen: r, fullScreen: i, entity: a, entityCode: o, hasDefaultEditAction: s, hasDefaultDeleteAction: c, rowActions: l, tabNavigate: u, onPeek: d, locale: f }) {
14439
+ function Kd({ row: e, rowId: t, screen: r, fullScreen: i, entity: a, entityCode: o, hasDefaultEditAction: s, hasDefaultDeleteAction: c, rowActions: l, tabNavigate: u, onPeek: d, locale: f }) {
14433
14440
  let { run: p } = lt(), m = J(() => ({
14434
14441
  entity: a,
14435
14442
  entityCode: o ?? "",
@@ -14505,8 +14512,8 @@ function Gd({ row: e, rowId: t, screen: r, fullScreen: i, entity: a, entityCode:
14505
14512
  }
14506
14513
  //#endregion
14507
14514
  //#region src/components/pages/list/columns.ts
14508
- function Kd(e, t, r) {
14509
- let i = Wd(t, r);
14515
+ function qd(e, t, r) {
14516
+ let i = Gd(t, r);
14510
14517
  if (!i || i.read !== "denied") return e;
14511
14518
  let a = i.required_permission ? `Locked column: requires "${i.required_permission}"` : `Locked column: ${i.classification} classification`;
14512
14519
  return fn("span", {
@@ -14515,7 +14522,7 @@ function Kd(e, t, r) {
14515
14522
  className: "inline-flex items-center gap-1"
14516
14523
  }, fn(n.lock, { size: 12 }), e);
14517
14524
  }
14518
- function qd(e) {
14525
+ function Jd(e) {
14519
14526
  let { visibleCols: t, entity: n, screen: r, schema: i, entityCode: a, rowActions: o, hasBatchActions: s, hasExplicitRowActions: c, canUpdate: l, canDelete: u, peekEnabled: d, userLocale: f, tabNavigate: p, refsRef: m, rowSelectionKey: h, setPeekRow: g } = e;
14520
14527
  if (t.length === 0 || !n) return [];
14521
14528
  let _ = [];
@@ -14558,7 +14565,7 @@ function qd(e) {
14558
14565
  if (!r) continue;
14559
14566
  _.push({
14560
14567
  id: e,
14561
- header: () => Kd(G(r.name) || t, n, t),
14568
+ header: () => qd(G(r.name) || t, n, t),
14562
14569
  size: 150,
14563
14570
  enableSorting: !1,
14564
14571
  cell: ({ row: e }) => {
@@ -14572,7 +14579,7 @@ function qd(e) {
14572
14579
  _.push({
14573
14580
  id: e,
14574
14581
  accessorFn: (t) => t.$files?.[e] ?? null,
14575
- header: () => Kd(Mo(n, e, i?.entities), n, e),
14582
+ header: () => qd(Mo(n, e, i?.entities), n, e),
14576
14583
  size: 150,
14577
14584
  cell: ({ row: t }) => No({
14578
14585
  entity: n,
@@ -14602,7 +14609,7 @@ function qd(e) {
14602
14609
  _.push({
14603
14610
  id: e,
14604
14611
  accessorKey: e,
14605
- header: () => Kd(r, n, e),
14612
+ header: () => qd(r, n, e),
14606
14613
  enableSorting: t.type !== "json",
14607
14614
  size: o ?? 150,
14608
14615
  cell: ({ getValue: e, row: t }) => s(e(), t.original)
@@ -14613,7 +14620,7 @@ function qd(e) {
14613
14620
  id: "_actions",
14614
14621
  header: "",
14615
14622
  size: 40,
14616
- cell: ({ row: e }) => fn(Gd, {
14623
+ cell: ({ row: e }) => fn(Kd, {
14617
14624
  row: e.original,
14618
14625
  rowId: h(n, e.original),
14619
14626
  screen: r,
@@ -14631,7 +14638,7 @@ function qd(e) {
14631
14638
  }
14632
14639
  //#endregion
14633
14640
  //#region src/components/columns/ColumnPicker.tsx
14634
- function Jd({ availableColumns: e, visibleColumns: t, onToggle: r, onReset: i, onShowAll: a, columnLabel: o = (e) => e }) {
14641
+ function Yd({ availableColumns: e, visibleColumns: t, onToggle: r, onReset: i, onShowAll: a, columnLabel: o = (e) => e }) {
14635
14642
  let c = Y(null), [l, u] = X(!1);
14636
14643
  return /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q(R, {
14637
14644
  ref: c,
@@ -14681,7 +14688,7 @@ function Jd({ availableColumns: e, visibleColumns: t, onToggle: r, onReset: i, o
14681
14688
  }
14682
14689
  //#endregion
14683
14690
  //#region src/components/views/ViewSwitcher.tsx
14684
- var Yd = {
14691
+ var Xd = {
14685
14692
  display: "flex",
14686
14693
  alignItems: "center",
14687
14694
  gap: 6,
@@ -14695,7 +14702,7 @@ var Yd = {
14695
14702
  color: "var(--text-2)",
14696
14703
  fontFamily: "inherit"
14697
14704
  };
14698
- function Xd({ views: e, activeViewId: t, isDirty: r, onSelect: i, onSave: a, onSaveAs: o }) {
14705
+ function Zd({ views: e, activeViewId: t, isDirty: r, onSelect: i, onSave: a, onSaveAs: o }) {
14699
14706
  let c = Y(null), [l, u] = X(!1), d = e.find((e) => e.id === t), f = e.filter((e) => e.source === "system"), p = e.filter((e) => e.source === "personal"), m = e.filter((e) => e.source === "shared"), h = d ? G(d.name) : "Default view", g = (e) => /* @__PURE__ */ Q("div", {
14700
14707
  style: {
14701
14708
  padding: "6px 8px 4px",
@@ -14718,7 +14725,7 @@ function Xd({ views: e, activeViewId: t, isDirty: r, onSelect: i, onSave: a, onS
14718
14725
  ref: c,
14719
14726
  type: "button",
14720
14727
  onClick: () => u((e) => !e),
14721
- style: Yd,
14728
+ style: Xd,
14722
14729
  children: [
14723
14730
  /* @__PURE__ */ Q(n.star, { size: 12 }),
14724
14731
  /* @__PURE__ */ Q("span", { children: h }),
@@ -14797,14 +14804,14 @@ function Xd({ views: e, activeViewId: t, isDirty: r, onSelect: i, onSave: a, onS
14797
14804
  }
14798
14805
  //#endregion
14799
14806
  //#region src/hooks/useScreen.ts
14800
- function Zd(e) {
14807
+ function Qd(e) {
14801
14808
  let { data: t } = gt();
14802
14809
  if (!(!t || !e)) return t.screens[e];
14803
14810
  }
14804
14811
  //#endregion
14805
14812
  //#region src/hooks/useViews.ts
14806
- function Qd(e, t) {
14807
- let n = Zd(e), { data: r } = ee("view", {
14813
+ function $d(e, t) {
14814
+ let n = Qd(e), { data: r } = ee("view", {
14808
14815
  filters: [{
14809
14816
  field: "screen_code",
14810
14817
  op: "eq",
@@ -14853,7 +14860,7 @@ function Qd(e, t) {
14853
14860
  }
14854
14861
  //#endregion
14855
14862
  //#region src/components/pages/SmartListPage.tsx
14856
- var $d = /* @__PURE__ */ new Set([
14863
+ var ef = /* @__PURE__ */ new Set([
14857
14864
  "string",
14858
14865
  "text",
14859
14866
  "email",
@@ -14879,16 +14886,16 @@ var $d = /* @__PURE__ */ new Set([
14879
14886
  "enum",
14880
14887
  "status"
14881
14888
  ]);
14882
- function ef(e) {
14889
+ function tf(e) {
14883
14890
  let t = [];
14884
14891
  for (let [n, r] of e.fields) {
14885
14892
  if (r.primary || r.auto || r.ref || r.array || r.structure || r.display?.is_listable === !1) continue;
14886
14893
  let e = (r.type || "").toLowerCase(), i = !!(r.enum || r.values);
14887
- if (!(!$d.has(e) && !i) && (t.push(n), t.length >= 8)) break;
14894
+ if (!(!ef.has(e) && !i) && (t.push(n), t.length >= 8)) break;
14888
14895
  }
14889
14896
  return t;
14890
14897
  }
14891
- function tf({ field: e, activeDir: t, activeNulls: r, inMultiSort: i, canAppend: a, onApply: o, onAppend: c, onClearColumn: l, onClearAll: u }) {
14898
+ function nf({ field: e, activeDir: t, activeNulls: r, inMultiSort: i, canAppend: a, onApply: o, onAppend: c, onClearColumn: l, onClearAll: u }) {
14892
14899
  let d = Y(null), [f, p] = X(!1), m = [
14893
14900
  {
14894
14901
  label: "Sort ascending, empty last",
@@ -14987,7 +14994,7 @@ function tf({ field: e, activeDir: t, activeNulls: r, inMultiSort: i, canAppend:
14987
14994
  ]
14988
14995
  })] });
14989
14996
  }
14990
- var nf = 1e4, rf = [
14997
+ var rf = 1e4, af = [
14991
14998
  25,
14992
14999
  50,
14993
15000
  100,
@@ -14995,7 +15002,7 @@ var nf = 1e4, rf = [
14995
15002
  500,
14996
15003
  1e3
14997
15004
  ];
14998
- function af(e, t) {
15005
+ function of(e, t) {
14999
15006
  let [n, r] = X(!1);
15000
15007
  return q(() => {
15001
15008
  if (!e) {
@@ -15003,14 +15010,14 @@ function af(e, t) {
15003
15010
  return;
15004
15011
  }
15005
15012
  r(!1);
15006
- let t = window.setTimeout(() => r(!0), nf);
15013
+ let t = window.setTimeout(() => r(!0), rf);
15007
15014
  return () => window.clearTimeout(t);
15008
15015
  }, [e, t]), n;
15009
15016
  }
15010
- function of(e) {
15017
+ function sf(e) {
15011
15018
  return e instanceof N ? `${e.code}: ${e.message}` : e instanceof Error && e.message ? e.message : "Something went wrong. Please try again.";
15012
15019
  }
15013
- var sf = /* @__PURE__ */ new Set([
15020
+ var cf = /* @__PURE__ */ new Set([
15014
15021
  "secret",
15015
15022
  "password",
15016
15023
  "json",
@@ -15018,13 +15025,13 @@ var sf = /* @__PURE__ */ new Set([
15018
15025
  "int_array",
15019
15026
  "uuid_array"
15020
15027
  ]);
15021
- function cf(e, t) {
15028
+ function lf(e, t) {
15022
15029
  if (e === "_actions" || e === "_select" || e.startsWith("$property.") || e.startsWith("$refs.")) return !1;
15023
15030
  if (e.startsWith("$status.")) return !0;
15024
15031
  let n = t?.fields.get(e);
15025
- return n ? !sf.has(n.type) : !1;
15032
+ return n ? !cf.has(n.type) : !1;
15026
15033
  }
15027
- function lf(e) {
15034
+ function uf(e) {
15028
15035
  let t = new URLSearchParams(), n = e.get("search");
15029
15036
  n && t.set("search", n);
15030
15037
  for (let n of At) {
@@ -15033,20 +15040,20 @@ function lf(e) {
15033
15040
  }
15034
15041
  return t;
15035
15042
  }
15036
- function uf(e, t) {
15043
+ function df(e, t) {
15037
15044
  return at(e, ut(e, t));
15038
15045
  }
15039
- function df(e, t, n) {
15046
+ function ff(e, t, n) {
15040
15047
  if (!e || n.length === 0) return [];
15041
15048
  let r = new Set(n);
15042
- return t.filter((t) => r.has(uf(e, t))).map((t) => ut(e, t));
15043
- }
15044
- var ff = {};
15045
- function pf({ screenCode: e }) {
15046
- return /* @__PURE__ */ Q(We, { children: /* @__PURE__ */ Q(mf, { screenCode: e }) });
15049
+ return t.filter((t) => r.has(df(e, t))).map((t) => ut(e, t));
15047
15050
  }
15051
+ var pf = {};
15048
15052
  function mf({ screenCode: e }) {
15049
- let t = ni(), r = Rn(), [a, c] = jn(), { data: l } = gt(), u = mt(), [d, f] = X(null), [p, m] = mu("selection", ff, { scope: "path" }), [g, _] = X(!1), [v, y] = X(!1), [b, S] = X(null), { filters: C, activeCount: w, setFilters: T, clearFilters: E } = qu(), D = ct((e) => e.user), k = ct((e) => e.activeTenant), A = Qd(e, D?.id), j = jt(), M = `dcl:smartlist:default-view-cleared:${e}`, N = Y(!1);
15053
+ return /* @__PURE__ */ Q(We, { children: /* @__PURE__ */ Q(hf, { screenCode: e }) });
15054
+ }
15055
+ function hf({ screenCode: e }) {
15056
+ let t = ni(), r = Rn(), [a, c] = jn(), { data: l } = gt(), u = mt(), [d, f] = X(null), [p, m] = mu("selection", pf, { scope: "path" }), [g, _] = X(!1), [v, y] = X(!1), [b, S] = X(null), { filters: C, activeCount: w, setFilters: T, clearFilters: E } = Ju(), D = ct((e) => e.user), k = ct((e) => e.activeTenant), A = $d(e, D?.id), j = jt(), M = `dcl:smartlist:default-view-cleared:${e}`, N = Y(!1);
15050
15057
  q(() => {
15051
15058
  if (N.current || !A || A.length === 0) return;
15052
15059
  if (a.get("view")) {
@@ -15060,7 +15067,7 @@ function mf({ screenCode: e }) {
15060
15067
  let e = A.find((e) => e.source === "personal" && e.is_default);
15061
15068
  if (!e || !e.id) return;
15062
15069
  N.current = !0;
15063
- let t = lf(a);
15070
+ let t = uf(a);
15064
15071
  t.set("view", e.id), e.filters && Array.isArray(e.filters) && e.filters.length > 0 && t.set("filters", JSON.stringify(e.filters)), e.columns && e.columns.length > 0 && t.set("columns", e.columns.join(",")), e.sort && t.set("sort", e.sort), c(t, { replace: !0 });
15065
15072
  }, [
15066
15073
  A,
@@ -15081,15 +15088,15 @@ function mf({ screenCode: e }) {
15081
15088
  I?.export?.enabled,
15082
15089
  P?.export?.enabled
15083
15090
  ]), ue = !!I?.soft_delete, de = ue && (D?.permissions ?? []).some((e) => e === "feature:view_deleted" || e === "feature:*" || e === "*"), pe = de && a.get("include_deleted") === "true", me = ot(), { openTab: he, updateTabSearch: ge, findTabByPathname: _e } = Dr();
15084
- Iu(P, I, a.toString()), Pu(P?.route);
15091
+ Lu(P, I, a.toString()), Fu(P?.route);
15085
15092
  let z = parseInt(a.get("page") ?? "1", 10), ve = (() => {
15086
15093
  let e = parseInt(a.get("per_page") ?? "", 10);
15087
15094
  return !Number.isFinite(e) || e <= 0 || e > 1e3 ? 200 : e;
15088
- })(), be = a.get("search") ?? "", xe = a.get("sort") ?? P?.sort_default ?? "", Se = J(() => ad(xe), [xe]), Ce = J(() => {
15095
+ })(), be = a.get("search") ?? "", xe = a.get("sort") ?? P?.sort_default ?? "", Se = J(() => od(xe), [xe]), Ce = J(() => {
15089
15096
  let e = /* @__PURE__ */ new Map();
15090
15097
  for (let t of Se) t.nulls && e.set(t.field, t.nulls);
15091
15098
  return e;
15092
- }, [Se]), B = J(() => od(xe), [xe]), we = J(() => Od(P, I, l?.entities), [
15099
+ }, [Se]), B = J(() => sd(xe), [xe]), we = J(() => kd(P, I, l?.entities), [
15093
15100
  P,
15094
15101
  I,
15095
15102
  l?.entities
@@ -15129,7 +15136,7 @@ function mf({ screenCode: e }) {
15129
15136
  limit: ve
15130
15137
  }, Ve = hs(L, Be, V);
15131
15138
  $o(o(L, Ae), !V), $o(ms(L, Be), V);
15132
- let He = V ? Ve.isLoading : Me, Ue = V ? Ve.isFetching : Ne, We = V ? Ve.isError : Pe, Ge = V ? Ve.error : Fe, Ke = V ? Ve.total : Le?.meta?.total, qe = V ? Ve.countMode : Le?.meta?.count_mode, Je = V ? Ve.isLoading : Re, Ye = V ? !1 : ze, Ze = af(He, `${L ?? ""}|${a.toString()}`), $e = K(() => {
15139
+ let He = V ? Ve.isLoading : Me, Ue = V ? Ve.isFetching : Ne, We = V ? Ve.isError : Pe, Ge = V ? Ve.error : Fe, Ke = V ? Ve.total : Le?.meta?.total, qe = V ? Ve.countMode : Le?.meta?.count_mode, Je = V ? Ve.isLoading : Re, Ye = V ? !1 : ze, Ze = of(He, `${L ?? ""}|${a.toString()}`), $e = K(() => {
15133
15140
  L && r.cancelQueries({ queryKey: ["entity-data", L] }), V ? Ve.refetch() : Ie();
15134
15141
  }, [
15135
15142
  L,
@@ -15140,9 +15147,9 @@ function mf({ screenCode: e }) {
15140
15147
  ]), et = gs((e) => e.degradedEntities), rt = _s(I?.realtime, et, L ?? ""), it = wc(L ?? ""), W = Cc(L ?? ""), st = Sc("view"), lt = J(() => Se.map((e) => ({
15141
15148
  id: e.field,
15142
15149
  desc: e.dir === "desc"
15143
- })), [Se]), dt = J(() => I?.fields.names().find((e) => I.fields.get(e)?.primary) ?? "id", [I]), ft = K((e) => I ? uf(I, e) : U(e[dt]), [I, dt]), pt = V ? Ve.refs : je?.$refs, ht = Y(pt);
15150
+ })), [Se]), dt = J(() => I?.fields.names().find((e) => I.fields.get(e)?.primary) ?? "id", [I]), ft = K((e) => I ? df(I, e) : U(e[dt]), [I, dt]), pt = V ? Ve.refs : je?.$refs, ht = Y(pt);
15144
15151
  ht.current = pt;
15145
- let { labelFor: _t, refs: vt } = jd(we, C, pt, l?.entities), [yt, xt] = X(null), St = P?.on_row_click === "peek" && P.quick_peek?.enabled !== !1, Ct = J(() => qd({
15152
+ let { labelFor: _t, refs: vt } = Md(we, C, pt, l?.entities), [yt, xt] = X(null), St = P?.on_row_click === "peek" && P.quick_peek?.enabled !== !1, Ct = J(() => Jd({
15146
15153
  visibleCols: De,
15147
15154
  entity: I,
15148
15155
  screen: P,
@@ -15157,7 +15164,7 @@ function mf({ screenCode: e }) {
15157
15164
  userLocale: u,
15158
15165
  tabNavigate: t,
15159
15166
  refsRef: ht,
15160
- rowSelectionKey: uf,
15167
+ rowSelectionKey: df,
15161
15168
  setPeekRow: xt
15162
15169
  }), [
15163
15170
  P,
@@ -15206,20 +15213,20 @@ function mf({ screenCode: e }) {
15206
15213
  ...t ? { nulls: t } : {}
15207
15214
  };
15208
15215
  });
15209
- n.set("sort", sd(e));
15216
+ n.set("sort", cd(e));
15210
15217
  }
15211
15218
  n.set("page", "1"), c(n);
15212
15219
  },
15213
15220
  onRowSelectionChange: m,
15214
15221
  getRowId: ft,
15215
15222
  rowCount: Ke ?? wt.length
15216
- }), At = J(() => Object.keys(p).filter((e) => p[e]), [p]), Mt = J(() => df(I, wt, At), [
15223
+ }), At = J(() => Object.keys(p).filter((e) => p[e]), [p]), Mt = J(() => ff(I, wt, At), [
15217
15224
  I,
15218
15225
  wt,
15219
15226
  At
15220
15227
  ]), Nt = K((e) => {
15221
15228
  let t = e.slice(0, 5), n = new URLSearchParams(a);
15222
- t.length === 0 ? n.delete("sort") : n.set("sort", sd(t)), n.set("page", "1"), c(n);
15229
+ t.length === 0 ? n.delete("sort") : n.set("sort", cd(t)), n.set("page", "1"), c(n);
15223
15230
  }, [a, c]), Pt = K((e, t, n) => {
15224
15231
  Nt([{
15225
15232
  field: e,
@@ -15227,15 +15234,15 @@ function mf({ screenCode: e }) {
15227
15234
  ...n ? { nulls: n } : {}
15228
15235
  }]);
15229
15236
  }, [Nt]), Ft = K((e) => {
15230
- Nt(cd(Se, e));
15237
+ Nt(ld(Se, e));
15231
15238
  }, [Se, Nt]), It = K((e, t, n) => {
15232
- Nt(ld(Se, {
15239
+ Nt(ud(Se, {
15233
15240
  field: e,
15234
15241
  dir: t,
15235
15242
  ...n ? { nulls: n } : {}
15236
15243
  }));
15237
15244
  }, [Se, Nt]), Lt = K((e) => {
15238
- Nt(ud(Se, e));
15245
+ Nt(dd(Se, e));
15239
15246
  }, [Se, Nt]), Rt = K(() => {
15240
15247
  Nt([]);
15241
15248
  }, [Nt]);
@@ -15263,14 +15270,14 @@ function mf({ screenCode: e }) {
15263
15270
  };
15264
15271
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
15265
15272
  }, []);
15266
- let zt = Y(null), { rows: Bt } = kt.getRowModel(), Vt = H((e) => e.density), Ht = H((e) => e.zebra), Wt = xu(), Gt = qn({
15273
+ let zt = Y(null), { rows: Bt } = kt.getRowModel(), Vt = H((e) => e.density), Ht = H((e) => e.zebra), Wt = Su(), Gt = qn({
15267
15274
  count: Bt.length,
15268
15275
  getScrollElement: () => zt.current,
15269
15276
  estimateSize: () => 48,
15270
15277
  overscan: 10,
15271
15278
  initialOffset: Wt
15272
15279
  });
15273
- Cu({
15280
+ wu({
15274
15281
  virtualizer: Gt,
15275
15282
  scrollElementRef: zt,
15276
15283
  rowKeys: J(() => Bt.map((e) => e.id), [Bt])
@@ -15314,7 +15321,7 @@ function mf({ screenCode: e }) {
15314
15321
  let r = ut(I, e), i = at(I, r), o = fe(P, I, l?.screens, r);
15315
15322
  if (!o) return;
15316
15323
  if (n?.draft) {
15317
- td(i, n.draft);
15324
+ nd(i, n.draft);
15318
15325
  let [e, t] = o.split("?", 2), r = new URLSearchParams(t ?? "");
15319
15326
  r.set("edit", "true"), o = `${e}?${r.toString()}`;
15320
15327
  }
@@ -15367,8 +15374,8 @@ function mf({ screenCode: e }) {
15367
15374
  }
15368
15375
  }
15369
15376
  };
15370
- i(e), n = r.filter((e) => I.fields.get(e) || I.files?.get(e)), n.length === 0 && (n = ef(I));
15371
- } else n = ef(I);
15377
+ i(e), n = r.filter((e) => I.fields.get(e) || I.files?.get(e)), n.length === 0 && (n = tf(I));
15378
+ } else n = tf(I);
15372
15379
  return n.map((e) => {
15373
15380
  if (I.files?.get(e)) return {
15374
15381
  key: e,
@@ -15466,7 +15473,7 @@ function mf({ screenCode: e }) {
15466
15473
  row: e.original
15467
15474
  });
15468
15475
  },
15469
- children: e.getVisibleCells().map((t) => /* @__PURE__ */ Q(Ld, {
15476
+ children: e.getVisibleCells().map((t) => /* @__PURE__ */ Q(Rd, {
15470
15477
  cell: t,
15471
15478
  isRowSelected: e.getIsSelected()
15472
15479
  }, t.id))
@@ -15481,7 +15488,7 @@ function mf({ screenCode: e }) {
15481
15488
  },
15482
15489
  children: [
15483
15490
  /* @__PURE__ */ $(Z, { children: [
15484
- /* @__PURE__ */ Q(Fd, {
15491
+ /* @__PURE__ */ Q(Id, {
15485
15492
  title: an,
15486
15493
  total: Ke,
15487
15494
  countMode: qe,
@@ -15505,13 +15512,13 @@ function mf({ screenCode: e }) {
15505
15512
  flexWrap: "wrap"
15506
15513
  },
15507
15514
  children: [
15508
- /* @__PURE__ */ Q(Xd, {
15515
+ /* @__PURE__ */ Q(Zd, {
15509
15516
  views: A,
15510
15517
  activeViewId: a.get("view"),
15511
15518
  isDirty: !1,
15512
15519
  onSelect: (e) => {
15513
15520
  if (!e.id) {
15514
- typeof window < "u" && window.sessionStorage?.setItem(M, "1"), c(lf(a));
15521
+ typeof window < "u" && window.sessionStorage?.setItem(M, "1"), c(uf(a));
15515
15522
  return;
15516
15523
  }
15517
15524
  let t = new URLSearchParams(a);
@@ -15551,7 +15558,7 @@ function mf({ screenCode: e }) {
15551
15558
  children: w
15552
15559
  })]
15553
15560
  }),
15554
- /* @__PURE__ */ Q(Jd, {
15561
+ /* @__PURE__ */ Q(Yd, {
15555
15562
  availableColumns: P.columns ?? [],
15556
15563
  visibleColumns: De,
15557
15564
  onToggle: (e) => {
@@ -15644,10 +15651,10 @@ function mf({ screenCode: e }) {
15644
15651
  }),
15645
15652
  C.length > 0 && /* @__PURE__ */ Q("div", {
15646
15653
  style: { padding: "0 20px 10px" },
15647
- children: /* @__PURE__ */ Q(hd, {
15654
+ children: /* @__PURE__ */ Q(gd, {
15648
15655
  filters: C,
15649
15656
  resolveValue: _t,
15650
- onRemove: (e) => T(Ku(C, e)),
15657
+ onRemove: (e) => T(qu(C, e)),
15651
15658
  onClearAll: E,
15652
15659
  onChipClick: () => _(!0),
15653
15660
  fieldLabel: (e) => {
@@ -15667,7 +15674,7 @@ function mf({ screenCode: e }) {
15667
15674
  ] }),
15668
15675
  He && Ze ? /* @__PURE__ */ Q("div", {
15669
15676
  style: { padding: "0 20px" },
15670
- children: /* @__PURE__ */ Q(Eu, {
15677
+ children: /* @__PURE__ */ Q(Du, {
15671
15678
  icon: "alert-circle",
15672
15679
  title: "Still loading data",
15673
15680
  description: "This table is taking longer than expected. Retry the request or check network and server health.",
@@ -15678,12 +15685,12 @@ function mf({ screenCode: e }) {
15678
15685
  children: "Retry"
15679
15686
  })
15680
15687
  })
15681
- }) : He ? /* @__PURE__ */ Q(Mu, { cols: P.columns?.length ?? 4 }) : We ? /* @__PURE__ */ Q("div", {
15688
+ }) : He ? /* @__PURE__ */ Q(Nu, { cols: P.columns?.length ?? 4 }) : We ? /* @__PURE__ */ Q("div", {
15682
15689
  style: { padding: "0 20px" },
15683
- children: /* @__PURE__ */ Q(Eu, {
15690
+ children: /* @__PURE__ */ Q(Du, {
15684
15691
  icon: "alert-circle",
15685
15692
  title: "Failed to load data",
15686
- description: of(Ge),
15693
+ description: sf(Ge),
15687
15694
  action: /* @__PURE__ */ Q(R, {
15688
15695
  kind: "primary",
15689
15696
  size: "sm",
@@ -15694,13 +15701,13 @@ function mf({ screenCode: e }) {
15694
15701
  }) : wt.length === 0 ? /* @__PURE__ */ Q("div", {
15695
15702
  style: { padding: "0 20px" },
15696
15703
  children: (() => {
15697
- let e = !!Ee || w > 0, t = rn.empty_state, n = G(t?.title), r = G(t?.body), i = ku(t?.learn_more_url), a = e ? "No results found" : n || `No ${G(rn.name_plural).toLowerCase() || an.toLowerCase()} yet`, o;
15704
+ let e = !!Ee || w > 0, t = rn.empty_state, n = G(t?.title), r = G(t?.body), i = Au(t?.learn_more_url), a = e ? "No results found" : n || `No ${G(rn.name_plural).toLowerCase() || an.toLowerCase()} yet`, o;
15698
15705
  return o = e ? "Try adjusting your search or filters" : r ? /* @__PURE__ */ $(Z, { children: [r, i && /* @__PURE__ */ $(Z, { children: [" ", /* @__PURE__ */ Q("a", {
15699
15706
  href: i,
15700
15707
  target: "_blank",
15701
15708
  rel: "noopener noreferrer",
15702
15709
  children: "Learn more"
15703
- })] })] }) : te ? `Create your first ${G(rn.name).toLowerCase()} to get started` : void 0, /* @__PURE__ */ Q(Eu, {
15710
+ })] })] }) : te ? `Create your first ${G(rn.name).toLowerCase()} to get started` : void 0, /* @__PURE__ */ Q(Du, {
15704
15711
  icon: on,
15705
15712
  title: a,
15706
15713
  description: o
@@ -15748,7 +15755,7 @@ function mf({ screenCode: e }) {
15748
15755
  background: "var(--surface-2)"
15749
15756
  },
15750
15757
  children: e.headers.map((e) => {
15751
- let t = cf(e.id, I), r = e.column.getIsSorted(), i = e.id === "_select", a = e.id === "_actions", o = r ? Se.findIndex((t) => t.field === e.id) + 1 : 0, s = Se.length > 1 && o > 0, c = o > 0, l = Se.length < 5, u = t ? e.column.getToggleSortingHandler() : void 0;
15758
+ let t = lf(e.id, I), r = e.column.getIsSorted(), i = e.id === "_select", a = e.id === "_actions", o = r ? Se.findIndex((t) => t.field === e.id) + 1 : 0, s = Se.length > 1 && o > 0, c = o > 0, l = Se.length < 5, u = t ? e.column.getToggleSortingHandler() : void 0;
15752
15759
  return /* @__PURE__ */ Q("th", {
15753
15760
  onClick: t ? (t) => {
15754
15761
  if (t.shiftKey) {
@@ -15818,7 +15825,7 @@ function mf({ screenCode: e }) {
15818
15825
  },
15819
15826
  children: o
15820
15827
  }) : null,
15821
- /* @__PURE__ */ Q(tf, {
15828
+ /* @__PURE__ */ Q(nf, {
15822
15829
  field: e.id,
15823
15830
  activeDir: r,
15824
15831
  activeNulls: Ce.get(e.id),
@@ -15874,7 +15881,7 @@ function mf({ screenCode: e }) {
15874
15881
  " ",
15875
15882
  wt.length === 1 ? "record" : "records"
15876
15883
  ] }) : /* @__PURE__ */ $(Z, { children: [
15877
- md(Ke, qe ?? "exact"),
15884
+ hd(Ke, qe ?? "exact"),
15878
15885
  " ",
15879
15886
  Ke === 1 ? "record" : "records"
15880
15887
  ] })
@@ -15907,7 +15914,7 @@ function mf({ screenCode: e }) {
15907
15914
  color: "var(--text-2)",
15908
15915
  cursor: "pointer"
15909
15916
  },
15910
- children: rf.map((e) => /* @__PURE__ */ Q("option", {
15917
+ children: af.map((e) => /* @__PURE__ */ Q("option", {
15911
15918
  value: e,
15912
15919
  children: e
15913
15920
  }, e))
@@ -15964,7 +15971,7 @@ function mf({ screenCode: e }) {
15964
15971
  })]
15965
15972
  })
15966
15973
  }),
15967
- /* @__PURE__ */ Q(yd, {
15974
+ /* @__PURE__ */ Q(bd, {
15968
15975
  open: g,
15969
15976
  onClose: () => _(!1),
15970
15977
  filters: C,
@@ -15973,7 +15980,7 @@ function mf({ screenCode: e }) {
15973
15980
  defaultFilters: P?.default_filters,
15974
15981
  refs: vt
15975
15982
  }),
15976
- /* @__PURE__ */ Q(Nd, {
15983
+ /* @__PURE__ */ Q(Pd, {
15977
15984
  open: v,
15978
15985
  pending: st.isPending,
15979
15986
  onClose: () => y(!1),
@@ -16006,7 +16013,7 @@ function mf({ screenCode: e }) {
16006
16013
  onConfirm: nn,
16007
16014
  destructive: !0
16008
16015
  }),
16009
- At.length > 0 && /* @__PURE__ */ Q(Id, {
16016
+ At.length > 0 && /* @__PURE__ */ Q(Ld, {
16010
16017
  selectedIds: At,
16011
16018
  floatbarActions: oe,
16012
16019
  screenActionLayout: P.action_layout,
@@ -16072,7 +16079,7 @@ function mf({ screenCode: e }) {
16072
16079
  }
16073
16080
  })]
16074
16081
  }),
16075
- St && yt && I && /* @__PURE__ */ Q(Qu, {
16082
+ St && yt && I && /* @__PURE__ */ Q($u, {
16076
16083
  entity: I,
16077
16084
  entityCode: L,
16078
16085
  record: yt,
@@ -16091,7 +16098,7 @@ function mf({ screenCode: e }) {
16091
16098
  onClose: () => {
16092
16099
  if (I && yt) {
16093
16100
  let e = I.fields.names()?.find((e) => I.fields.get(e)?.primary);
16094
- e && rd(U(yt[e]));
16101
+ e && id(U(yt[e]));
16095
16102
  }
16096
16103
  xt(null);
16097
16104
  },
@@ -16129,15 +16136,15 @@ function mf({ screenCode: e }) {
16129
16136
  }
16130
16137
  //#endregion
16131
16138
  //#region src/hooks/useEntityItem.ts
16132
- function hf(e, t) {
16139
+ function gf(e, t) {
16133
16140
  return [
16134
16141
  "entity-item",
16135
16142
  e,
16136
16143
  t === void 0 || t === "new" ? void 0 : typeof t == "string" ? t : Object.keys(t).sort().map((e) => [e, t[e]])
16137
16144
  ];
16138
16145
  }
16139
- function gf(e, t) {
16140
- let n = hf(e, t), r = n[2];
16146
+ function _f(e, t) {
16147
+ let n = gf(e, t), r = n[2];
16141
16148
  return Ln({
16142
16149
  queryKey: n,
16143
16150
  queryFn: () => C(e, t),
@@ -16146,7 +16153,7 @@ function gf(e, t) {
16146
16153
  }
16147
16154
  //#endregion
16148
16155
  //#region src/components/shared/AssociationTabs.tsx
16149
- function _f({ entityCode: e, recordId: t, associations: n, schema: i }) {
16156
+ function vf({ entityCode: e, recordId: t, associations: n, schema: i }) {
16150
16157
  let a = J(() => Object.entries(n), [n]), [o, s] = X(0);
16151
16158
  if (a.length === 0) return null;
16152
16159
  let [c, l] = a[o];
@@ -16189,7 +16196,7 @@ function _f({ entityCode: e, recordId: t, associations: n, schema: i }) {
16189
16196
  }),
16190
16197
  collapsible: !1,
16191
16198
  padding: "0",
16192
- children: /* @__PURE__ */ Q(vf, {
16199
+ children: /* @__PURE__ */ Q(yf, {
16193
16200
  entityCode: e,
16194
16201
  recordId: t,
16195
16202
  assocKey: c,
@@ -16198,7 +16205,7 @@ function _f({ entityCode: e, recordId: t, associations: n, schema: i }) {
16198
16205
  })
16199
16206
  });
16200
16207
  }
16201
- function vf({ entityCode: e, recordId: t, assocKey: r, association: i, schema: a }) {
16208
+ function yf({ entityCode: e, recordId: t, assocKey: r, association: i, schema: a }) {
16202
16209
  let o = ni(), s = mt(), c = `${e}.${r}`, { data: l, isLoading: u } = Ln({
16203
16210
  queryKey: [
16204
16211
  "association",
@@ -16311,12 +16318,12 @@ function vf({ entityCode: e, recordId: t, assocKey: r, association: i, schema: a
16311
16318
  }
16312
16319
  //#endregion
16313
16320
  //#region src/lib/size-value.ts
16314
- var yf = /^(\d+)px$/;
16315
- function bf(e) {
16321
+ var bf = /^(\d+)px$/;
16322
+ function xf(e) {
16316
16323
  if (e == null || e === "") return null;
16317
16324
  if (e === "auto") return { kind: "auto" };
16318
16325
  if (e === "fill") return { kind: "fill" };
16319
- let t = yf.exec(e);
16326
+ let t = bf.exec(e);
16320
16327
  if (t) {
16321
16328
  let e = parseInt(t[1], 10);
16322
16329
  return e > 0 ? {
@@ -16332,7 +16339,7 @@ function bf(e) {
16332
16339
  }
16333
16340
  //#endregion
16334
16341
  //#region src/components/detail-layout/LayoutRow.tsx
16335
- function xf({ config: e, ctx: t }) {
16342
+ function Sf({ config: e, ctx: t }) {
16336
16343
  let { items: n, gap: r = 0, resizable: i = !1, stack_below: a } = e, o = a === "never" ? 0 : a ?? 768, [s, c] = X(!1), l = Y(null);
16337
16344
  q(() => {
16338
16345
  if (o === 0) return;
@@ -16344,7 +16351,7 @@ function xf({ config: e, ctx: t }) {
16344
16351
  return t.observe(e), () => t.disconnect();
16345
16352
  }, [o]);
16346
16353
  let [u, d] = X(null), f = Y(null), p = K(() => n.map((t) => {
16347
- let n = bf(t.width ?? t.column?.width ?? t.row?.width ?? e.width);
16354
+ let n = xf(t.width ?? t.column?.width ?? t.row?.width ?? e.width);
16348
16355
  return n && n.kind === "weight" ? n.value : 1;
16349
16356
  }), [n, e.width]), m = K((e, t) => {
16350
16357
  t.preventDefault();
@@ -16363,7 +16370,7 @@ function xf({ config: e, ctx: t }) {
16363
16370
  f.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
16364
16371
  };
16365
16372
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
16366
- }, [u, p]), h = u ?? p(), g = e.height ? Cf(e.height) : void 0;
16373
+ }, [u, p]), h = u ?? p(), g = e.height ? wf(e.height) : void 0;
16367
16374
  return /* @__PURE__ */ Q("div", {
16368
16375
  ref: l,
16369
16376
  className: Rr("flex", s && "flex-col"),
@@ -16373,10 +16380,10 @@ function xf({ config: e, ctx: t }) {
16373
16380
  },
16374
16381
  children: n.map((r, a) => /* @__PURE__ */ $("div", {
16375
16382
  className: Rr("min-w-0 flex items-stretch", s && "w-full"),
16376
- style: s ? void 0 : Sf(r.width ?? r.column?.width ?? r.row?.width ?? e.width, h[a], r.min_width, r.max_width),
16383
+ style: s ? void 0 : Cf(r.width ?? r.column?.width ?? r.row?.width ?? e.width, h[a], r.min_width, r.max_width),
16377
16384
  children: [/* @__PURE__ */ Q("div", {
16378
16385
  className: Rr("flex-1 min-w-0 flex flex-col", g && "overflow-y-auto overflow-x-hidden"),
16379
- children: /* @__PURE__ */ Q(nm, {
16386
+ children: /* @__PURE__ */ Q(rm, {
16380
16387
  node: r,
16381
16388
  ctx: t
16382
16389
  })
@@ -16387,17 +16394,17 @@ function xf({ config: e, ctx: t }) {
16387
16394
  }, a))
16388
16395
  });
16389
16396
  }
16390
- function Sf(e, t, n, r) {
16391
- let i = bf(e), a;
16397
+ function Cf(e, t, n, r) {
16398
+ let i = xf(e), a;
16392
16399
  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", {
16393
16400
  flex: a,
16394
16401
  minWidth: n,
16395
16402
  maxWidth: r
16396
16403
  };
16397
16404
  }
16398
- function Cf(e) {
16405
+ function wf(e) {
16399
16406
  if (!e) return;
16400
- let t = bf(e);
16407
+ let t = xf(e);
16401
16408
  if (t?.kind === "px") return {
16402
16409
  height: `${t.value}px`,
16403
16410
  overflow: "hidden"
@@ -16409,12 +16416,12 @@ function Cf(e) {
16409
16416
  }
16410
16417
  //#endregion
16411
16418
  //#region src/components/detail-layout/LayoutColumn.tsx
16412
- function wf({ config: e, ctx: t }) {
16419
+ function Tf({ config: e, ctx: t }) {
16413
16420
  let { items: n, gap: r = 12 } = e;
16414
16421
  return /* @__PURE__ */ Q("div", {
16415
16422
  className: "flex flex-col h-full",
16416
16423
  style: { gap: r ? `${r}px` : void 0 },
16417
- children: n.map((e, n) => /* @__PURE__ */ Q(nm, {
16424
+ children: n.map((e, n) => /* @__PURE__ */ Q(rm, {
16418
16425
  node: e,
16419
16426
  ctx: t
16420
16427
  }, n))
@@ -16422,11 +16429,11 @@ function wf({ config: e, ctx: t }) {
16422
16429
  }
16423
16430
  //#endregion
16424
16431
  //#region src/components/detail-layout/blockMeta.ts
16425
- function Tf(e) {
16432
+ function Ef(e) {
16426
16433
  return e.children ?? e.associated;
16427
16434
  }
16428
- function Ef(e, t) {
16429
- let n = Tf(e);
16435
+ function Df(e, t) {
16436
+ let n = Ef(e);
16430
16437
  if (n) {
16431
16438
  if (e.label) return G(e.label);
16432
16439
  let r = t.entity.children?.find((e) => e.entity === n);
@@ -16436,9 +16443,9 @@ function Ef(e, t) {
16436
16443
  }
16437
16444
  return e.section ? G(e.section.name) : "Tab";
16438
16445
  }
16439
- function Df(e, t) {
16446
+ function Of(e, t) {
16440
16447
  if (e.icon) return e.icon;
16441
- let n = Tf(e);
16448
+ let n = Ef(e);
16442
16449
  if (n) {
16443
16450
  let e = t.entity.children?.find((e) => e.entity === n);
16444
16451
  if (e?.display?.icon) return e.display.icon;
@@ -16448,7 +16455,7 @@ function Df(e, t) {
16448
16455
  }
16449
16456
  //#endregion
16450
16457
  //#region src/components/detail-layout/LayoutTabs.tsx
16451
- function Of({ config: e, ctx: t }) {
16458
+ function kf({ config: e, ctx: t }) {
16452
16459
  let { items: n } = e, [i, a] = X(0);
16453
16460
  return n.length === 0 ? null : /* @__PURE__ */ $("div", {
16454
16461
  style: {
@@ -16470,7 +16477,7 @@ function Of({ config: e, ctx: t }) {
16470
16477
  overflowX: "auto"
16471
16478
  },
16472
16479
  children: n.map((e, n) => {
16473
- let o = Ef(e, t), s = Df(e, t), c = n === i;
16480
+ let o = Df(e, t), s = Of(e, t), c = n === i;
16474
16481
  return /* @__PURE__ */ $("button", {
16475
16482
  role: "tab",
16476
16483
  "aria-selected": c,
@@ -16520,7 +16527,7 @@ function Of({ config: e, ctx: t }) {
16520
16527
  }), /* @__PURE__ */ Q("div", {
16521
16528
  role: "tabpanel",
16522
16529
  style: { padding: 14 },
16523
- children: /* @__PURE__ */ Q(nm, {
16530
+ children: /* @__PURE__ */ Q(rm, {
16524
16531
  node: n[i],
16525
16532
  ctx: {
16526
16533
  ...t,
@@ -16532,7 +16539,7 @@ function Of({ config: e, ctx: t }) {
16532
16539
  }
16533
16540
  //#endregion
16534
16541
  //#region src/components/detail-layout/SectionBlock.tsx
16535
- function kf({ config: e, ctx: t }) {
16542
+ function Af({ config: e, ctx: t }) {
16536
16543
  let { name: n, items: i, collapsed: a = !1, columns: o, icon: s, badge: c, emphasis: l } = e, u = {
16537
16544
  ...t,
16538
16545
  withinCard: !0,
@@ -16552,7 +16559,7 @@ function kf({ config: e, ctx: t }) {
16552
16559
  badge: f,
16553
16560
  emphasis: l,
16554
16561
  headingLevel: t.withinCard ? 3 : 2,
16555
- children: /* @__PURE__ */ Q(tm, {
16562
+ children: /* @__PURE__ */ Q(nm, {
16556
16563
  nodes: i,
16557
16564
  ctx: u
16558
16565
  })
@@ -16560,37 +16567,37 @@ function kf({ config: e, ctx: t }) {
16560
16567
  }
16561
16568
  //#endregion
16562
16569
  //#region src/lib/child-config.ts
16563
- function Af(e, t, n) {
16564
- let r = e.display, i = jf(n?.mode, r?.mode, "table"), a = i === "timeline" ? 50 : 20, o = {
16570
+ function jf(e, t, n) {
16571
+ let r = e.display, i = Mf(n?.mode, r?.mode, "table"), a = i === "timeline" ? 50 : 20, o = {
16565
16572
  entity: e.entity,
16566
16573
  foreign_key: e.foreign_key,
16567
- name: jf(n?.label, r?.name, Nf(t)),
16568
- icon: jf(n?.icon, r?.icon, t.display.icon) ?? "",
16574
+ name: Mf(n?.label, r?.name, Pf(t)),
16575
+ icon: Mf(n?.icon, r?.icon, t.display.icon) ?? "",
16569
16576
  mode: i,
16570
- columns: jf(n?.columns, r?.columns, Ff(t, e.foreign_key)),
16571
- sort: jf(n?.sort, r?.sort, Pf(t)),
16572
- limit: jf(n?.limit, r?.limit, a),
16573
- editable: jf(n?.editable, r?.editable, !0),
16574
- interaction: jf(n?.interaction, r?.interaction, Mf(t))
16575
- }, s = jf(n?.position_field, r?.position_field, void 0);
16577
+ columns: Mf(n?.columns, r?.columns, If(t, e.foreign_key)),
16578
+ sort: Mf(n?.sort, r?.sort, Ff(t)),
16579
+ limit: Mf(n?.limit, r?.limit, a),
16580
+ editable: Mf(n?.editable, r?.editable, !0),
16581
+ interaction: Mf(n?.interaction, r?.interaction, Nf(t))
16582
+ }, s = Mf(n?.position_field, r?.position_field, void 0);
16576
16583
  s && (o.position_field = s, o.sort = s + ":asc");
16577
16584
  let c = n?.timeline ?? r?.timeline;
16578
- o.mode === "timeline" ? o.timeline = If(c ?? {}, t) : c && (o.timeline = c);
16585
+ o.mode === "timeline" ? o.timeline = Lf(c ?? {}, t) : c && (o.timeline = c);
16579
16586
  let l = n?.cards ?? r?.cards;
16580
16587
  l && (o.cards = l);
16581
16588
  let u = n?.quick_add ?? e.quick_add;
16582
16589
  return u && (o.quick_add = u), o;
16583
16590
  }
16584
- function jf(e, t, n) {
16591
+ function Mf(e, t, n) {
16585
16592
  return e ?? t ?? n;
16586
16593
  }
16587
- function Mf(e) {
16594
+ function Nf(e) {
16588
16595
  return Et(e, "update") ? "inline_edit" : "readonly";
16589
16596
  }
16590
- function Nf(e) {
16597
+ function Pf(e) {
16591
16598
  return e.display.name_plural && Object.keys(e.display.name_plural).length > 0 ? e.display.name_plural : e.display.name;
16592
16599
  }
16593
- function Pf(e) {
16600
+ function Ff(e) {
16594
16601
  if (e.fields.get("created_at")?.type === "timestamp") return "created_at:desc";
16595
16602
  if (e.fields.get("updated_at")?.type === "timestamp") return "updated_at:desc";
16596
16603
  for (let t of e.fields.names()) {
@@ -16601,10 +16608,10 @@ function Pf(e) {
16601
16608
  let n = e.fields.get(t);
16602
16609
  if (n && n.type === "date") return t + ":desc";
16603
16610
  }
16604
- let t = Hf(e);
16611
+ let t = Uf(e);
16605
16612
  return t ? t + ":asc" : "";
16606
16613
  }
16607
- function Ff(e, t) {
16614
+ function If(e, t) {
16608
16615
  let n = new Set(Array.isArray(t) ? t : [t]), r = [];
16609
16616
  for (let t of e.fields.names()) {
16610
16617
  if (r.length >= 6) break;
@@ -16613,11 +16620,11 @@ function Ff(e, t) {
16613
16620
  }
16614
16621
  return r;
16615
16622
  }
16616
- function If(e, t) {
16623
+ function Lf(e, t) {
16617
16624
  let n = { ...e };
16618
- return n.time_field ||= zf(t), n.type_field ||= Bf(t, "enum"), n.summary_field ||= Vf(t, "string", "text", "rich_text"), n.content_field ||= Vf(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 ||= Lf(t), n.intent_field ||= Rf(t), n;
16625
+ return n.time_field ||= Bf(t), n.type_field ||= Vf(t, "enum"), n.summary_field ||= Hf(t, "string", "text", "rich_text"), n.content_field ||= Hf(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 ||= Rf(t), n.intent_field ||= zf(t), n;
16619
16626
  }
16620
- function Lf(e) {
16627
+ function Rf(e) {
16621
16628
  let t = e.fields.get("direction");
16622
16629
  if (t && t.type === "enum") return "direction";
16623
16630
  for (let t of [
@@ -16630,11 +16637,11 @@ function Lf(e) {
16630
16637
  if (n && n.type === "bool") return t;
16631
16638
  }
16632
16639
  }
16633
- function Rf(e) {
16640
+ function zf(e) {
16634
16641
  let t = e.fields.get("intent");
16635
16642
  if (t && t.type === "enum") return "intent";
16636
16643
  }
16637
- function zf(e) {
16644
+ function Bf(e) {
16638
16645
  for (let t of e.fields.names()) {
16639
16646
  let n = e.fields.get(t);
16640
16647
  if (n && n.type === "timestamp" && !n.auto) return t;
@@ -16646,13 +16653,13 @@ function zf(e) {
16646
16653
  if (n && n.type === "timestamp") return t;
16647
16654
  }
16648
16655
  }
16649
- function Bf(e, t) {
16656
+ function Vf(e, t) {
16650
16657
  for (let n of e.fields.names()) {
16651
16658
  let r = e.fields.get(n);
16652
16659
  if (r && r.type === t) return n;
16653
16660
  }
16654
16661
  }
16655
- function Vf(e, ...t) {
16662
+ function Hf(e, ...t) {
16656
16663
  for (let n of e.fields.names()) {
16657
16664
  let r = e.fields.get(n);
16658
16665
  if (r) {
@@ -16660,16 +16667,16 @@ function Vf(e, ...t) {
16660
16667
  }
16661
16668
  }
16662
16669
  }
16663
- function Hf(e) {
16670
+ function Uf(e) {
16664
16671
  let t = Ae(e);
16665
16672
  return t.length > 0 ? t[0] : void 0;
16666
16673
  }
16667
- function Uf(e, t) {
16674
+ function Wf(e, t) {
16668
16675
  return e.children?.find((e) => e.entity === t);
16669
16676
  }
16670
16677
  //#endregion
16671
16678
  //#region src/lib/quick-add.ts
16672
- function Wf(e, t, n, r) {
16679
+ function Gf(e, t, n, r) {
16673
16680
  let i = {
16674
16681
  ...t ?? {},
16675
16682
  ...e
@@ -16681,7 +16688,7 @@ function Wf(e, t, n, r) {
16681
16688
  } else i[n] = Array.isArray(r) ? r[0] : r;
16682
16689
  return i;
16683
16690
  }
16684
- function Gf(e, t) {
16691
+ function Kf(e, t) {
16685
16692
  for (let n of t) {
16686
16693
  let t = e[n];
16687
16694
  if (t == null || t === "") return !1;
@@ -16690,7 +16697,7 @@ function Gf(e, t) {
16690
16697
  }
16691
16698
  //#endregion
16692
16699
  //#region src/components/detail-layout/useQuickAdd.ts
16693
- function Kf(e, t, n, r) {
16700
+ function qf(e, t, n, r) {
16694
16701
  let [i, a] = X(() => {
16695
16702
  let t = e.quick_add, n = r.entities[e.entity], i = {};
16696
16703
  if (t?.fields) for (let e of t.fields) t.defaults?.[e] == null ? n?.fields.get(e)?.type === "timestamp" && (i[e] = b()) : i[e] = t.defaults[e];
@@ -16742,9 +16749,9 @@ function Kf(e, t, n, r) {
16742
16749
  e.entity
16743
16750
  ] });
16744
16751
  }
16745
- }), f = e.quick_add, p = r.entities[e.entity], m = Gf(i, f?.fields.filter((e) => p?.fields.get(e)?.required) ?? []);
16752
+ }), f = e.quick_add, p = r.entities[e.entity], m = Kf(i, f?.fields.filter((e) => p?.fields.get(e)?.required) ?? []);
16746
16753
  function h(t) {
16747
- t.preventDefault(), f && s(Wf(i, f.defaults, e.foreign_key, n));
16754
+ t.preventDefault(), f && s(Gf(i, f.defaults, e.foreign_key, n));
16748
16755
  }
16749
16756
  function g(e, t) {
16750
16757
  u && d(), a((n) => ({
@@ -16765,8 +16772,8 @@ function Kf(e, t, n, r) {
16765
16772
  }
16766
16773
  //#endregion
16767
16774
  //#region src/components/detail-layout/QuickAddForm.tsx
16768
- function qf({ config: e, parentEntity: t, parentId: r, schema: i }) {
16769
- let { values: a, quickAdd: o, childEntity: s, isPending: c, error: l, isReady: u, handleSubmit: d, handleFieldChange: f } = Kf(e, t, r, i), p = mt();
16775
+ function Jf({ config: e, parentEntity: t, parentId: r, schema: i }) {
16776
+ let { values: a, quickAdd: o, childEntity: s, isPending: c, error: l, isReady: u, handleSubmit: d, handleFieldChange: f } = qf(e, t, r, i), p = mt();
16770
16777
  return !o || o.fields.length === 0 || !s ? null : /* @__PURE__ */ $("form", {
16771
16778
  onSubmit: d,
16772
16779
  style: {
@@ -16825,10 +16832,10 @@ function qf({ config: e, parentEntity: t, parentId: r, schema: i }) {
16825
16832
  }
16826
16833
  //#endregion
16827
16834
  //#region src/components/detail-layout/ChildrenTable.tsx
16828
- function Jf({ config: e, parentEntity: t, parentId: r, schema: i }) {
16835
+ function Yf({ config: e, parentEntity: t, parentId: r, schema: i }) {
16829
16836
  let a = i.entities[e.entity], o = mt(), s = gs((e) => e.degradedEntities), { data: c, isLoading: l, isError: u, isFetching: d, refetch: f } = ts(t, r, e.entity, e.foreign_key, e.sort, e.limit), p = c?.data ?? [], m = c?.$refs, h = Y(m);
16830
16837
  h.current = m;
16831
- let g = e.columns, _ = e.interaction === "navigate", v = g[0], y = _ && a ? Ue(void 0, a, i.screens) : null, b = a ? Hf(a) : void 0, x = J(() => {
16838
+ let g = e.columns, _ = e.interaction === "navigate", v = g[0], y = _ && a ? Ue(void 0, a, i.screens) : null, b = a ? Uf(a) : void 0, x = J(() => {
16832
16839
  let e = /* @__PURE__ */ new Map();
16833
16840
  if (!a) return e;
16834
16841
  for (let t of g) {
@@ -16860,7 +16867,7 @@ function Jf({ config: e, parentEntity: t, parentId: r, schema: i }) {
16860
16867
  },
16861
16868
  children: "Entity not found."
16862
16869
  });
16863
- let S = /* @__PURE__ */ Q(qf, {
16870
+ let S = /* @__PURE__ */ Q(Jf, {
16864
16871
  config: e,
16865
16872
  parentEntity: t,
16866
16873
  parentId: r,
@@ -16978,7 +16985,7 @@ function Jf({ config: e, parentEntity: t, parentId: r, schema: i }) {
16978
16985
  }
16979
16986
  //#endregion
16980
16987
  //#region src/components/detail-layout/ChildrenList.tsx
16981
- function Yf({ config: e, parentEntity: t, parentId: n, schema: r }) {
16988
+ function Xf({ config: e, parentEntity: t, parentId: n, schema: r }) {
16982
16989
  let i = r.entities[e.entity], a = mt(), { data: o, isLoading: s, isError: c } = ts(t, n, e.entity, e.foreign_key, e.sort, e.limit), l = o?.data ?? [], u = o?.$refs, d = e.columns;
16983
16990
  if (!i) return /* @__PURE__ */ Q("div", {
16984
16991
  style: {
@@ -16988,7 +16995,7 @@ function Yf({ config: e, parentEntity: t, parentId: n, schema: r }) {
16988
16995
  },
16989
16996
  children: "Entity not found."
16990
16997
  });
16991
- let f = /* @__PURE__ */ Q(qf, {
16998
+ let f = /* @__PURE__ */ Q(Jf, {
16992
16999
  config: e,
16993
17000
  parentEntity: t,
16994
17001
  parentId: n,
@@ -17098,7 +17105,7 @@ function Yf({ config: e, parentEntity: t, parentId: n, schema: r }) {
17098
17105
  }
17099
17106
  //#endregion
17100
17107
  //#region src/components/detail-layout/ChildrenCards.tsx
17101
- function Xf({ config: e, parentEntity: t, parentId: n, schema: r }) {
17108
+ function Zf({ config: e, parentEntity: t, parentId: n, schema: r }) {
17102
17109
  let i = r.entities[e.entity], a = mt(), { data: o, isLoading: s, isError: c } = ts(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;
17103
17110
  if (!i) return /* @__PURE__ */ Q("div", {
17104
17111
  style: {
@@ -17112,7 +17119,7 @@ function Xf({ config: e, parentEntity: t, parentId: n, schema: r }) {
17112
17119
  display: "grid",
17113
17120
  gridTemplateColumns: `repeat(auto-fill, minmax(${h >= 4 ? 180 : 240}px, 1fr))`,
17114
17121
  gap: 12
17115
- }, _ = /* @__PURE__ */ Q(qf, {
17122
+ }, _ = /* @__PURE__ */ Q(Jf, {
17116
17123
  config: e,
17117
17124
  parentEntity: t,
17118
17125
  parentId: n,
@@ -17241,9 +17248,9 @@ function Xf({ config: e, parentEntity: t, parentId: n, schema: r }) {
17241
17248
  }
17242
17249
  //#endregion
17243
17250
  //#region src/hooks/useTimelineData.ts
17244
- var Zf = 50;
17245
- function Qf(e, t, n, r, i, a) {
17246
- let o = Array.isArray(r) ? r : [r], s = Array.isArray(r) ? Fe(t, o.length) : [t], c = a ?? Zf, l = Pn({
17251
+ var Qf = 50;
17252
+ function $f(e, t, n, r, i, a) {
17253
+ let o = Array.isArray(r) ? r : [r], s = Array.isArray(r) ? Fe(t, o.length) : [t], c = a ?? Qf, l = Pn({
17247
17254
  queryKey: [
17248
17255
  es,
17249
17256
  e,
@@ -17279,15 +17286,15 @@ function Qf(e, t, n, r, i, a) {
17279
17286
  }
17280
17287
  //#endregion
17281
17288
  //#region src/components/detail-layout/TimelineComposer.tsx
17282
- var $f = "quick_entry", ep = 100, tp = 240, np = 800, rp = 80;
17283
- function ip({ config: e, parentEntity: t, parentId: r, schema: i }) {
17284
- let { values: a, quickAdd: o, childEntity: s, isPending: c, error: l, isReady: u, handleSubmit: d, handleFieldChange: f } = Kf(e, t, r, i), p = mt(), [m, h] = X(tp), g = Y(null), _ = Y(null), [v, y] = X(np);
17289
+ var ep = "quick_entry", tp = 100, np = 240, rp = 800, ip = 80;
17290
+ function ap({ config: e, parentEntity: t, parentId: r, schema: i }) {
17291
+ let { values: a, quickAdd: o, childEntity: s, isPending: c, error: l, isReady: u, handleSubmit: d, handleFieldChange: f } = qf(e, t, r, i), p = mt(), [m, h] = X(np), g = Y(null), _ = Y(null), [v, y] = X(rp);
17285
17292
  q(() => {
17286
17293
  let e = _.current?.parentElement;
17287
17294
  if (!e) return;
17288
17295
  let t = () => {
17289
- let t = Math.max(ep, e.clientHeight - rp);
17290
- y(Math.min(np, t));
17296
+ let t = Math.max(tp, e.clientHeight - ip);
17297
+ y(Math.min(rp, t));
17291
17298
  };
17292
17299
  t();
17293
17300
  let n = new ResizeObserver(t);
@@ -17309,7 +17316,7 @@ function ip({ config: e, parentEntity: t, parentId: r, schema: i }) {
17309
17316
  t && (t.querySelector("textarea, input, select, [contenteditable]") ?? t).focus();
17310
17317
  }
17311
17318
  }), []);
17312
- q(() => He($f, C), [C]);
17319
+ q(() => He(ep, C), [C]);
17313
17320
  let w = K((e) => {
17314
17321
  e.preventDefault(), g.current = {
17315
17322
  startY: e.clientY,
@@ -17318,7 +17325,7 @@ function ip({ config: e, parentEntity: t, parentId: r, schema: i }) {
17318
17325
  let t = (e) => {
17319
17326
  if (!g.current) return;
17320
17327
  let t = g.current.startY - e.clientY;
17321
- h(Math.min(v, Math.max(ep, g.current.startHeight + t)));
17328
+ h(Math.min(v, Math.max(tp, g.current.startHeight + t)));
17322
17329
  }, n = () => {
17323
17330
  g.current = null, document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
17324
17331
  };
@@ -17477,19 +17484,19 @@ function ip({ config: e, parentEntity: t, parentId: r, schema: i }) {
17477
17484
  }
17478
17485
  //#endregion
17479
17486
  //#region src/components/detail-layout/ChildrenTimeline.tsx
17480
- var ap = 80, op = 200;
17481
- function sp(e, t) {
17482
- if (cp(t)) {
17487
+ var op = 80, sp = 200;
17488
+ function cp(e, t) {
17489
+ if (lp(t)) {
17483
17490
  let e = t.id;
17484
17491
  return e == null ? "" : U(e);
17485
17492
  }
17486
17493
  return T(ut(e, t));
17487
17494
  }
17488
- function cp(e) {
17495
+ function lp(e) {
17489
17496
  return e.__optimistic === !0;
17490
17497
  }
17491
- function lp({ config: e, parentEntity: t, parentId: n, schema: r }) {
17492
- let i = r.entities[e.entity], { rows: a, refs: o, fetchNextPage: s, hasOlder: c, isFetchingOlder: l, isLoading: u, isError: d } = Qf(t, n, e.entity, e.foreign_key, e.timeline?.time_field, e.limit), f = e.timeline, p = f?.scroll ?? !1, m = (e.sort ?? "").endsWith(":asc"), h = J(() => m ? [...a].reverse() : a, [a, m]), g = f?.auto_scroll ?? "none", _ = Y(null), v = Y(null), y = Y(!1), b = Y(0), x = Y(null), S = Y(null), C = Y(!0), w = Y(null);
17498
+ function up({ config: e, parentEntity: t, parentId: n, schema: r }) {
17499
+ let i = r.entities[e.entity], { rows: a, refs: o, fetchNextPage: s, hasOlder: c, isFetchingOlder: l, isLoading: u, isError: d } = $f(t, n, e.entity, e.foreign_key, e.timeline?.time_field, e.limit), f = e.timeline, p = f?.scroll ?? !1, m = (e.sort ?? "").endsWith(":asc"), h = J(() => m ? [...a].reverse() : a, [a, m]), g = f?.auto_scroll ?? "none", _ = Y(null), v = Y(null), y = Y(!1), b = Y(0), x = Y(null), S = Y(null), C = Y(!0), w = Y(null);
17493
17500
  q(() => {
17494
17501
  y.current = !1, b.current = 0, x.current = null, S.current = null, C.current = !0, w.current = null;
17495
17502
  }, [n]), hn(() => {
@@ -17503,7 +17510,7 @@ function lp({ config: e, parentEntity: t, parentId: n, schema: r }) {
17503
17510
  b.current = h.length;
17504
17511
  return;
17505
17512
  }
17506
- let t = sp(i, h[0]), n = sp(i, h[h.length - 1]), r = !y.current, a = h.length > b.current && b.current > 0, o = a && (m && t !== x.current && n === S.current || !m && n !== S.current && t === x.current), s = a && !o;
17513
+ let t = cp(i, h[0]), n = cp(i, h[h.length - 1]), r = !y.current, a = h.length > b.current && b.current > 0, o = a && (m && t !== x.current && n === S.current || !m && n !== S.current && t === x.current), s = a && !o;
17507
17514
  if (r) m && g === "bottom" && (e.scrollTop = e.scrollHeight), y.current = !0;
17508
17515
  else if (o && w.current) {
17509
17516
  let t = w.current;
@@ -17518,7 +17525,7 @@ function lp({ config: e, parentEntity: t, parentId: n, schema: r }) {
17518
17525
  ]);
17519
17526
  let T = K(() => {
17520
17527
  let e = _.current;
17521
- e && (C.current = e.scrollHeight - e.scrollTop - e.clientHeight < ap);
17528
+ e && (C.current = e.scrollHeight - e.scrollTop - e.clientHeight < op);
17522
17529
  }, []);
17523
17530
  q(() => {
17524
17531
  let e = v.current;
@@ -17527,7 +17534,7 @@ function lp({ config: e, parentEntity: t, parentId: n, schema: r }) {
17527
17534
  for (let t of e) t.isIntersecting && c && !l && s();
17528
17535
  }, {
17529
17536
  root: _.current ?? null,
17530
- rootMargin: `${op}px 0px 0px 0px`,
17537
+ rootMargin: `${sp}px 0px 0px 0px`,
17531
17538
  threshold: 0
17532
17539
  });
17533
17540
  return t.observe(e), () => t.disconnect();
@@ -17598,8 +17605,8 @@ function lp({ config: e, parentEntity: t, parentId: n, schema: r }) {
17598
17605
  })] });
17599
17606
  else {
17600
17607
  let a = (a, s) => {
17601
- let c = sp(i, a) || String(s);
17602
- return /* @__PURE__ */ Q(up, {
17608
+ let c = cp(i, a) || String(s);
17609
+ return /* @__PURE__ */ Q(dp, {
17603
17610
  row: a,
17604
17611
  rowId: c,
17605
17612
  childEntity: i,
@@ -17614,16 +17621,16 @@ function lp({ config: e, parentEntity: t, parentId: n, schema: r }) {
17614
17621
  onCancelEdit: () => D(null),
17615
17622
  onSaved: () => D(null),
17616
17623
  schema: r,
17617
- optimistic: cp(a)
17624
+ optimistic: lp(a)
17618
17625
  }, c);
17619
17626
  }, s = f?.time_field, c;
17620
17627
  if (s) {
17621
17628
  let e = [];
17622
17629
  h.forEach((t, n) => {
17623
- let r = t[s], i = dp(r), a = e[e.length - 1];
17630
+ let r = t[s], i = fp(r), a = e[e.length - 1];
17624
17631
  !a || a.key !== i ? e.push({
17625
17632
  key: i,
17626
- label: fp(r),
17633
+ label: pp(r),
17627
17634
  rows: [{
17628
17635
  row: t,
17629
17636
  idx: n
@@ -17638,7 +17645,7 @@ function lp({ config: e, parentEntity: t, parentId: n, schema: r }) {
17638
17645
  flexDirection: "column",
17639
17646
  gap: 8
17640
17647
  },
17641
- children: [/* @__PURE__ */ Q(pp, {
17648
+ children: [/* @__PURE__ */ Q(mp, {
17642
17649
  label: e.label,
17643
17650
  count: e.rows.length
17644
17651
  }), e.rows.map(({ row: e, idx: t }) => a(e, t))]
@@ -17688,7 +17695,7 @@ function lp({ config: e, parentEntity: t, parentId: n, schema: r }) {
17688
17695
  },
17689
17696
  children: M
17690
17697
  }),
17691
- /* @__PURE__ */ Q(ip, {
17698
+ /* @__PURE__ */ Q(ap, {
17692
17699
  config: e,
17693
17700
  parentEntity: t,
17694
17701
  parentId: n,
@@ -17702,14 +17709,14 @@ function lp({ config: e, parentEntity: t, parentId: n, schema: r }) {
17702
17709
  gap: 8
17703
17710
  },
17704
17711
  children: M
17705
- }), /* @__PURE__ */ Q(ip, {
17712
+ }), /* @__PURE__ */ Q(ap, {
17706
17713
  config: e,
17707
17714
  parentEntity: t,
17708
17715
  parentId: n,
17709
17716
  schema: r
17710
17717
  })] });
17711
17718
  }
17712
- function up({ row: e, rowId: t, childEntity: r, entityCode: a, parentEntity: o, parentId: s, timeline: c, editableFields: l, refs: u, isEditing: d, onStartEdit: f, onCancelEdit: p, onSaved: m, schema: h, optimistic: g = !1 }) {
17719
+ function dp({ row: e, rowId: t, childEntity: r, entityCode: a, parentEntity: o, parentId: s, timeline: c, editableFields: l, refs: u, isEditing: d, onStartEdit: f, onCancelEdit: p, onSaved: m, schema: h, optimistic: g = !1 }) {
17713
17720
  let _ = Rn(), v = mt(), [y, b] = X({}), x = K(() => {
17714
17721
  _.invalidateQueries({ queryKey: [
17715
17722
  es,
@@ -17856,7 +17863,7 @@ function up({ row: e, rowId: t, childEntity: r, entityCode: a, parentEntity: o,
17856
17863
  locale: v
17857
17864
  })
17858
17865
  }),
17859
- M && e[M] != null && r.fields.get(M) && /* @__PURE__ */ Q(mp, {
17866
+ M && e[M] != null && r.fields.get(M) && /* @__PURE__ */ Q(hp, {
17860
17867
  value: e[M],
17861
17868
  field: r.fields.get(M)
17862
17869
  }),
@@ -17942,12 +17949,12 @@ function up({ row: e, rowId: t, childEntity: r, entityCode: a, parentEntity: o,
17942
17949
  ]
17943
17950
  });
17944
17951
  }
17945
- function dp(e) {
17952
+ function fp(e) {
17946
17953
  if (e == null) return "";
17947
17954
  let t = new Date(U(e));
17948
17955
  return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`;
17949
17956
  }
17950
- function fp(e) {
17957
+ function pp(e) {
17951
17958
  if (e == null) return "—";
17952
17959
  let t = new Date(U(e));
17953
17960
  if (Number.isNaN(t.getTime())) return "—";
@@ -17960,7 +17967,7 @@ function fp(e) {
17960
17967
  day: "numeric"
17961
17968
  });
17962
17969
  }
17963
- function pp({ label: e, count: t }) {
17970
+ function mp({ label: e, count: t }) {
17964
17971
  return /* @__PURE__ */ $("div", {
17965
17972
  style: {
17966
17973
  position: "sticky",
@@ -17997,8 +18004,8 @@ function pp({ label: e, count: t }) {
17997
18004
  ]
17998
18005
  });
17999
18006
  }
18000
- function mp({ value: e, field: t }) {
18001
- let r = hp(e, t);
18007
+ function hp({ value: e, field: t }) {
18008
+ let r = gp(e, t);
18002
18009
  return r === null ? null : /* @__PURE__ */ $("span", {
18003
18010
  style: {
18004
18011
  display: "inline-flex",
@@ -18014,7 +18021,7 @@ function mp({ value: e, field: t }) {
18014
18021
  children: [Q(r ? n.arrowUp : n.arrowDown, { size: 10 }), r ? "Out" : "In"]
18015
18022
  });
18016
18023
  }
18017
- function hp(e, t) {
18024
+ function gp(e, t) {
18018
18025
  if (t.type === "bool") return e === !0;
18019
18026
  if (typeof e == "string") {
18020
18027
  let t = e.toLowerCase();
@@ -18025,7 +18032,7 @@ function hp(e, t) {
18025
18032
  }
18026
18033
  //#endregion
18027
18034
  //#region src/components/detail-layout/EditableChildrenTable.tsx
18028
- function gp({ config: e, childEntity: t, schema: r, rows: i, onChange: a, validationErrors: o, refs: s }) {
18035
+ function _p({ config: e, childEntity: t, schema: r, rows: i, onChange: a, validationErrors: o, refs: s }) {
18029
18036
  let c = mt(), l = Y(null), u = e.columns, d = new Set(Array.isArray(e.foreign_key) ? e.foreign_key : [e.foreign_key]), f = u.filter((n) => {
18030
18037
  if (d.has(n) || e.position_field && n === e.position_field) return !1;
18031
18038
  let r = t.fields.get(n);
@@ -18193,11 +18200,11 @@ function gp({ config: e, childEntity: t, schema: r, rows: i, onChange: a, valida
18193
18200
  }
18194
18201
  //#endregion
18195
18202
  //#region src/components/detail-layout/ChildrenBlock.tsx
18196
- var _p = pn(() => import("./DraggableChildrenTable-D4WoV6ck.js").then((e) => ({ default: e.DraggableChildrenTable })));
18197
- function vp({ node: e, ctx: t }) {
18203
+ var vp = pn(() => import("./DraggableChildrenTable-D4WoV6ck.js").then((e) => ({ default: e.DraggableChildrenTable })));
18204
+ function yp({ node: e, ctx: t }) {
18198
18205
  let n = e.children;
18199
18206
  if (!n || t.isNew && t.mode !== "edit") return null;
18200
- let i = Uf(t.entity, n);
18207
+ let i = Wf(t.entity, n);
18201
18208
  if (!i) return /* @__PURE__ */ $("div", {
18202
18209
  className: "text-sm text-muted-foreground py-2",
18203
18210
  children: ["Unknown child relation: ", n]
@@ -18207,7 +18214,7 @@ function vp({ node: e, ctx: t }) {
18207
18214
  className: "text-sm text-muted-foreground py-2",
18208
18215
  children: ["Entity not found: ", i.entity]
18209
18216
  });
18210
- let o = Af(i, a, e), s = Ef(e, t), c = Df(e, t), l = (e) => o.mode === "timeline" || t.withinCard ? e : /* @__PURE__ */ Q(Zn, {
18217
+ let o = jf(i, a, e), s = Df(e, t), c = Of(e, t), l = (e) => o.mode === "timeline" || t.withinCard ? e : /* @__PURE__ */ Q(Zn, {
18211
18218
  title: s,
18212
18219
  icon: c ? /* @__PURE__ */ Q(r, {
18213
18220
  name: c,
@@ -18216,9 +18223,9 @@ function vp({ node: e, ctx: t }) {
18216
18223
  children: e
18217
18224
  });
18218
18225
  if (t.mode === "edit" && o.editable && o.interaction !== "navigate" && o.interaction !== "readonly" && Et(a, "update") && o.mode === "table" && t.pendingChildren !== void 0 && t.onChildrenChange) {
18219
- let e = t.pendingChildren[n] ?? [], r = t.childValidationErrors?.[n], i = o.position_field ? _p : gp;
18226
+ let e = t.pendingChildren[n] ?? [], r = t.childValidationErrors?.[n], i = o.position_field ? vp : _p;
18220
18227
  return l(/* @__PURE__ */ Q(un, {
18221
- fallback: /* @__PURE__ */ Q(Mu, {}),
18228
+ fallback: /* @__PURE__ */ Q(Nu, {}),
18222
18229
  children: /* @__PURE__ */ Q(i, {
18223
18230
  config: o,
18224
18231
  childEntity: a,
@@ -18238,33 +18245,33 @@ function vp({ node: e, ctx: t }) {
18238
18245
  schema: t.schema
18239
18246
  };
18240
18247
  switch (o.mode) {
18241
- case "list": return l(/* @__PURE__ */ Q(Yf, { ...u }));
18242
- case "cards": return l(/* @__PURE__ */ Q(Xf, { ...u }));
18243
- case "timeline": return l(/* @__PURE__ */ Q(lp, { ...u }));
18244
- default: return l(/* @__PURE__ */ Q(Jf, { ...u }));
18248
+ case "list": return l(/* @__PURE__ */ Q(Xf, { ...u }));
18249
+ case "cards": return l(/* @__PURE__ */ Q(Zf, { ...u }));
18250
+ case "timeline": return l(/* @__PURE__ */ Q(up, { ...u }));
18251
+ default: return l(/* @__PURE__ */ Q(Yf, { ...u }));
18245
18252
  }
18246
18253
  }
18247
18254
  //#endregion
18248
18255
  //#region src/components/detail-layout/FieldRow.tsx
18249
- var yp = 150, bp = 560, xp = "20px", Sp = 4, Cp = /* @__PURE__ */ new Set([
18256
+ var bp = 150, xp = 560, Sp = "20px", Cp = 4, wp = /* @__PURE__ */ new Set([
18250
18257
  "text",
18251
18258
  "rich_text",
18252
18259
  "json",
18253
18260
  "structure",
18254
18261
  "multilang_text"
18255
- ]), wp = dn({ columns: 2 });
18256
- function Tp({ columns: e = 2, children: t }) {
18262
+ ]), Tp = dn({ columns: 2 });
18263
+ function Ep({ columns: e = 2, children: t }) {
18257
18264
  let n = Y(null), [r, i] = X(!1);
18258
18265
  q(() => {
18259
18266
  let t = n.current;
18260
18267
  if (!t || e === 1 || typeof ResizeObserver > "u") return;
18261
18268
  let r = new ResizeObserver(([e]) => {
18262
- i(e.contentRect.width < bp);
18269
+ i(e.contentRect.width < xp);
18263
18270
  });
18264
18271
  return r.observe(t), () => r.disconnect();
18265
18272
  }, [e]);
18266
18273
  let a = e === 1 || r ? 1 : e;
18267
- return /* @__PURE__ */ Q(wp.Provider, {
18274
+ return /* @__PURE__ */ Q(Tp.Provider, {
18268
18275
  value: { columns: a },
18269
18276
  children: /* @__PURE__ */ Q("div", {
18270
18277
  ref: n,
@@ -18278,8 +18285,8 @@ function Tp({ columns: e = 2, children: t }) {
18278
18285
  })
18279
18286
  });
18280
18287
  }
18281
- function Ep({ label: e, children: t, span: r = !1, required: i, error: a, hint: o, actions: s, copyValue: c, mode: l = "display", htmlFor: u, labelId: d, "data-testid": f }) {
18282
- let p = mn(wp), m = r || p.columns === 1, h = !!a;
18288
+ function Dp({ label: e, children: t, span: r = !1, required: i, error: a, hint: o, actions: s, copyValue: c, mode: l = "display", htmlFor: u, labelId: d, "data-testid": f }) {
18289
+ let p = mn(Tp), m = r || p.columns === 1, h = !!a;
18283
18290
  return /* @__PURE__ */ $("div", {
18284
18291
  className: "detail-row",
18285
18292
  "data-error": h || void 0,
@@ -18294,11 +18301,11 @@ function Ep({ label: e, children: t, span: r = !1, required: i, error: a, hint:
18294
18301
  },
18295
18302
  children: [/* @__PURE__ */ $("div", {
18296
18303
  style: {
18297
- width: m ? "auto" : yp,
18304
+ width: m ? "auto" : bp,
18298
18305
  flexShrink: 0,
18299
- paddingTop: m ? 0 : Sp,
18306
+ paddingTop: m ? 0 : Cp,
18300
18307
  fontSize: 12,
18301
- lineHeight: xp,
18308
+ lineHeight: Sp,
18302
18309
  fontWeight: 500,
18303
18310
  color: "var(--text-3)",
18304
18311
  display: "flex",
@@ -18340,10 +18347,10 @@ function Ep({ label: e, children: t, span: r = !1, required: i, error: a, hint:
18340
18347
  flex: 1,
18341
18348
  minWidth: 0,
18342
18349
  fontSize: 13,
18343
- lineHeight: xp,
18350
+ lineHeight: Sp,
18344
18351
  color: "var(--text)",
18345
18352
  overflowWrap: "anywhere",
18346
- paddingTop: l === "display" && !m ? Sp : 0
18353
+ paddingTop: l === "display" && !m ? Cp : 0
18347
18354
  },
18348
18355
  children: h && l === "edit" ? /* @__PURE__ */ Q("div", {
18349
18356
  style: {
@@ -18382,14 +18389,14 @@ function Ep({ label: e, children: t, span: r = !1, required: i, error: a, hint:
18382
18389
  }
18383
18390
  //#endregion
18384
18391
  //#region src/components/detail-layout/FieldsBlock.tsx
18385
- function Dp({ fields: e, ctx: t }) {
18392
+ function Op({ fields: e, ctx: t }) {
18386
18393
  let { entity: n, entityCode: r, record: i, mode: a, onFieldChange: o, schema: s } = t, c = mt(), l = t.columns ?? 2, u = l === 1 && e.length === 1;
18387
- return /* @__PURE__ */ Q(Tp, {
18394
+ return /* @__PURE__ */ Q(Ep, {
18388
18395
  columns: l,
18389
18396
  children: e.map((e) => {
18390
- let l = e.name, d = `${r ?? "field"}-${l}`, f = `${d}-label`, p = n.fields.get(l), m = !!(p?.auto || p?.readonly || p?.source), h = Wd(n, l), g = h?.read === "denied", _ = h?.write === "denied", v = a === "display" ? g : _ || g, y = m || a === "edit" && _ ? "display" : a, b = v ? /* @__PURE__ */ Q(rr, {
18397
+ let l = e.name, d = `${r ?? "field"}-${l}`, f = `${d}-label`, p = n.fields.get(l), m = !!(p?.auto || p?.readonly || p?.source), h = Gd(n, l), g = h?.read === "denied", _ = h?.write === "denied", v = a === "display" ? g : _ || g, y = m || a === "edit" && _ ? "display" : a, b = v ? /* @__PURE__ */ Q(rr, {
18391
18398
  tier: h.classification,
18392
- tierDef: Hd(s, n, l),
18399
+ tierDef: Ud(s, n, l),
18393
18400
  requiredPermission: h?.required_permission,
18394
18401
  locale: c,
18395
18402
  variant: y === "edit" ? "input" : "value"
@@ -18415,11 +18422,11 @@ function Dp({ fields: e, ctx: t }) {
18415
18422
  row: i,
18416
18423
  variant: "ghost",
18417
18424
  size: "icon"
18418
- }, t)) }) : void 0, S = !!p && Cp.has(p.type), C = i?.[l], w = y === "display" && (p?.copyable || p?.type === "uuid") && C != null && C !== "" ? U(C) : void 0;
18425
+ }, t)) }) : void 0, S = !!p && wp.has(p.type), C = i?.[l], w = y === "display" && (p?.copyable || p?.type === "uuid") && C != null && C !== "" ? U(C) : void 0;
18419
18426
  return u ? /* @__PURE__ */ Q("div", {
18420
18427
  style: { gridColumn: "1 / -1" },
18421
18428
  children: b
18422
- }, l) : /* @__PURE__ */ Q(Ep, {
18429
+ }, l) : /* @__PURE__ */ Q(Dp, {
18423
18430
  label: Mo(n, l, s.entities),
18424
18431
  htmlFor: y === "edit" ? d : void 0,
18425
18432
  labelId: f,
@@ -18436,7 +18443,7 @@ function Dp({ fields: e, ctx: t }) {
18436
18443
  }
18437
18444
  //#endregion
18438
18445
  //#region src/components/detail-layout/PropertiesBlock.tsx
18439
- var Op = /* @__PURE__ */ new Set([
18446
+ var kp = /* @__PURE__ */ new Set([
18440
18447
  "string",
18441
18448
  "text",
18442
18449
  "int",
@@ -18444,16 +18451,16 @@ var Op = /* @__PURE__ */ new Set([
18444
18451
  "decimal",
18445
18452
  "email",
18446
18453
  "url"
18447
- ]), kp = 500;
18448
- function Ap({ node: e, ctx: t }) {
18454
+ ]), Ap = 500;
18455
+ function jp({ node: e, ctx: t }) {
18449
18456
  let { entity: n, objectProperties: r, onSetProperty: i, isNew: a, mode: o, refs: s } = t, c = n.properties ?? {};
18450
18457
  if (a) return null;
18451
18458
  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]]);
18452
- return u.length === 0 ? null : /* @__PURE__ */ Q(Tp, {
18459
+ return u.length === 0 ? null : /* @__PURE__ */ Q(Ep, {
18453
18460
  columns: 2,
18454
18461
  children: u.map(([e, a]) => {
18455
18462
  let c = r?.find((t) => t.property_code === e), l = Re(a), u = a.readonly || !i ? "display" : o;
18456
- return /* @__PURE__ */ Q(jp, {
18463
+ return /* @__PURE__ */ Q(Mp, {
18457
18464
  propCode: e,
18458
18465
  prop: a,
18459
18466
  field: l,
@@ -18467,25 +18474,25 @@ function Ap({ node: e, ctx: t }) {
18467
18474
  })
18468
18475
  });
18469
18476
  }
18470
- function jp({ propCode: e, prop: t, field: n, value: r, mode: i, onSetProperty: a, refs: o, entity: s, schema: c }) {
18477
+ function Mp({ propCode: e, prop: t, field: n, value: r, mode: i, onSetProperty: a, refs: o, entity: s, schema: c }) {
18471
18478
  let l = mt(), u = Y(null);
18472
18479
  q(() => () => {
18473
18480
  u.current && clearTimeout(u.current);
18474
18481
  }, []);
18475
18482
  let d = K((n) => {
18476
- a && (Op.has(t.type) ? (u.current && clearTimeout(u.current), u.current = setTimeout(() => a(e, n), kp)) : a(e, n));
18483
+ a && (kp.has(t.type) ? (u.current && clearTimeout(u.current), u.current = setTimeout(() => a(e, n), Ap)) : a(e, n));
18477
18484
  }, [
18478
18485
  e,
18479
18486
  t.type,
18480
18487
  a
18481
- ]), f = Wd(s, e), p = f?.read === "denied", m = f?.write === "denied", h = i === "display" ? p : m || p, g = i === "edit" && m ? "display" : i;
18482
- return /* @__PURE__ */ Q(Ep, {
18488
+ ]), f = Gd(s, e), p = f?.read === "denied", m = f?.write === "denied", h = i === "display" ? p : m || p, g = i === "edit" && m ? "display" : i;
18489
+ return /* @__PURE__ */ Q(Dp, {
18483
18490
  label: G(t.display?.name ?? t.name),
18484
18491
  mode: g,
18485
- span: Cp.has(t.type),
18492
+ span: wp.has(t.type),
18486
18493
  children: h ? /* @__PURE__ */ Q(rr, {
18487
18494
  tier: f.classification,
18488
- tierDef: Hd(c, s, e),
18495
+ tierDef: Ud(c, s, e),
18489
18496
  requiredPermission: f?.required_permission,
18490
18497
  locale: l,
18491
18498
  variant: g === "edit" ? "input" : "value"
@@ -18502,7 +18509,7 @@ function jp({ propCode: e, prop: t, field: n, value: r, mode: i, onSetProperty:
18502
18509
  }
18503
18510
  //#endregion
18504
18511
  //#region src/components/shared/StatusStepper.tsx
18505
- function Mp({ stages: e, current: t, selectable: r, onSelect: i, compact: a = !1 }) {
18512
+ function Np({ stages: e, current: t, selectable: r, onSelect: i, compact: a = !1 }) {
18506
18513
  let o = e.findIndex((e) => e.code === t);
18507
18514
  return /* @__PURE__ */ Q("div", {
18508
18515
  role: "list",
@@ -18569,7 +18576,7 @@ function Mp({ stages: e, current: t, selectable: r, onSelect: i, compact: a = !1
18569
18576
  }
18570
18577
  //#endregion
18571
18578
  //#region src/components/shared/StatusGroupsDisplay.tsx
18572
- function Np({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r, mode: i = "edit" }) {
18579
+ function Pp({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r, mode: i = "edit" }) {
18573
18580
  return /* @__PURE__ */ Q("div", {
18574
18581
  style: {
18575
18582
  display: "flex",
@@ -18601,7 +18608,7 @@ function Np({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
18601
18608
  opacity: r ? .6 : 1,
18602
18609
  pointerEvents: r ? "none" : "auto"
18603
18610
  },
18604
- children: /* @__PURE__ */ Q(Mp, {
18611
+ children: /* @__PURE__ */ Q(Np, {
18605
18612
  stages: a.statuses.map((e) => ({
18606
18613
  code: e.code,
18607
18614
  label: G(e.name)
@@ -18686,43 +18693,43 @@ function Np({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
18686
18693
  }
18687
18694
  //#endregion
18688
18695
  //#region src/components/detail-layout/StatusesBlock.tsx
18689
- var Pp = () => {};
18690
- function Fp({ node: e, ctx: t }) {
18696
+ var Fp = () => {};
18697
+ function Ip({ node: e, ctx: t }) {
18691
18698
  let { entity: n, objectStatuses: r, onSetStatus: i, isStatusPending: a, isNew: o } = t, s = n.status_groups ?? {};
18692
18699
  if (o) return null;
18693
18700
  let c = e.statuses === !0 ? !0 : e.statuses, l = Object.fromEntries(Object.entries(s).filter(([e]) => c === !0 || c.includes(e)));
18694
- return Object.keys(l).length === 0 ? null : /* @__PURE__ */ Q(Np, {
18701
+ return Object.keys(l).length === 0 ? null : /* @__PURE__ */ Q(Pp, {
18695
18702
  statusGroups: l,
18696
18703
  objectStatuses: r,
18697
- onSetStatus: i ?? Pp,
18704
+ onSetStatus: i ?? Fp,
18698
18705
  isPending: a ?? !1,
18699
18706
  mode: t.mode
18700
18707
  });
18701
18708
  }
18702
18709
  //#endregion
18703
18710
  //#region src/components/detail-layout/widgets/registry.ts
18704
- var Ip = /* @__PURE__ */ new Map();
18705
- function Lp(e, t) {
18706
- Ip.set(e, t);
18707
- }
18708
- function Rp(e) {
18709
- return Ip.get(e);
18711
+ var Lp = /* @__PURE__ */ new Map();
18712
+ function Rp(e, t) {
18713
+ Lp.set(e, t);
18710
18714
  }
18711
18715
  function zp(e) {
18712
- return Ip.has(e);
18716
+ return Lp.get(e);
18717
+ }
18718
+ function Bp(e) {
18719
+ return Lp.has(e);
18713
18720
  }
18714
18721
  //#endregion
18715
18722
  //#region src/components/detail-layout/widgets/canonicalizeJson.ts
18716
- function Bp(e) {
18717
- if (Array.isArray(e)) return e.map(Bp);
18723
+ function Vp(e) {
18724
+ if (Array.isArray(e)) return e.map(Vp);
18718
18725
  if (typeof e == "object" && e) {
18719
18726
  let t = e, n = {};
18720
- for (let e of Object.keys(t).sort()) n[e] = Bp(t[e]);
18727
+ for (let e of Object.keys(t).sort()) n[e] = Vp(t[e]);
18721
18728
  return n;
18722
18729
  }
18723
18730
  return e;
18724
18731
  }
18725
- function Vp(e) {
18732
+ function Hp(e) {
18726
18733
  switch (typeof e) {
18727
18734
  case "string": return e;
18728
18735
  case "number":
@@ -18734,17 +18741,17 @@ function Vp(e) {
18734
18741
  default: return "";
18735
18742
  }
18736
18743
  }
18737
- function Hp(e) {
18744
+ function Up(e) {
18738
18745
  if (e == null) return "";
18739
18746
  try {
18740
- return JSON.stringify(Bp(e), null, 2) ?? Vp(e);
18747
+ return JSON.stringify(Vp(e), null, 2) ?? Hp(e);
18741
18748
  } catch {
18742
- return Vp(e);
18749
+ return Hp(e);
18743
18750
  }
18744
18751
  }
18745
18752
  //#endregion
18746
18753
  //#region src/components/shared/ErrorBoundary.tsx
18747
- var Up = class extends cn {
18754
+ var Wp = class extends cn {
18748
18755
  constructor(e) {
18749
18756
  super(e), this.state = {
18750
18757
  hasError: !1,
@@ -18809,29 +18816,29 @@ var Up = class extends cn {
18809
18816
  })
18810
18817
  }) : this.props.children;
18811
18818
  }
18812
- }, Wp = "Audit change diff", Gp = pn(() => import("./MonacoJson-DVjwsaBK.js").then((e) => ({ default: e.MonacoJsonDiff }))), Kp = pn(() => import("./MonacoJson-DVjwsaBK.js").then((e) => ({ default: e.MonacoJsonSource }))), qp = pn(() => import("./JsonEditor-KelPV-OQ.js").then((e) => ({ default: e.JsonEditor })));
18813
- function Jp() {
18819
+ }, Gp = "Audit change diff", Kp = pn(() => import("./MonacoJson-DVjwsaBK.js").then((e) => ({ default: e.MonacoJsonDiff }))), qp = pn(() => import("./MonacoJson-DVjwsaBK.js").then((e) => ({ default: e.MonacoJsonSource }))), Jp = pn(() => import("./JsonEditor-KelPV-OQ.js").then((e) => ({ default: e.JsonEditor })));
18820
+ function Yp() {
18814
18821
  return /* @__PURE__ */ Q("div", {
18815
18822
  className: "flex h-full w-full items-center justify-center text-sm text-muted-foreground",
18816
18823
  children: "Loading editor…"
18817
18824
  });
18818
18825
  }
18819
- function Yp({ before: e, after: t }) {
18826
+ function Xp({ before: e, after: t }) {
18820
18827
  return /* @__PURE__ */ Q(un, {
18821
- fallback: /* @__PURE__ */ Q(Jp, {}),
18828
+ fallback: /* @__PURE__ */ Q(Yp, {}),
18822
18829
  children: /* @__PURE__ */ $("div", {
18823
18830
  className: "flex h-full w-full gap-2",
18824
18831
  role: "group",
18825
- "aria-label": Wp,
18832
+ "aria-label": Gp,
18826
18833
  children: [/* @__PURE__ */ Q("div", {
18827
18834
  className: "min-w-0 flex-1",
18828
- children: /* @__PURE__ */ Q(qp, {
18835
+ children: /* @__PURE__ */ Q(Jp, {
18829
18836
  value: e,
18830
18837
  readOnly: !0
18831
18838
  })
18832
18839
  }), /* @__PURE__ */ Q("div", {
18833
18840
  className: "min-w-0 flex-1",
18834
- children: /* @__PURE__ */ Q(qp, {
18841
+ children: /* @__PURE__ */ Q(Jp, {
18835
18842
  value: t,
18836
18843
  readOnly: !0
18837
18844
  })
@@ -18839,7 +18846,7 @@ function Yp({ before: e, after: t }) {
18839
18846
  })
18840
18847
  });
18841
18848
  }
18842
- function Xp({ mode: e, onChange: t }) {
18849
+ function Zp({ mode: e, onChange: t }) {
18843
18850
  return /* @__PURE__ */ $("div", {
18844
18851
  className: "inline-flex gap-1",
18845
18852
  role: "group",
@@ -18859,13 +18866,13 @@ function Xp({ mode: e, onChange: t }) {
18859
18866
  })]
18860
18867
  });
18861
18868
  }
18862
- function Zp({ values: e, options: t }) {
18863
- let n = e.before, r = e.after, [i, a] = X(t?.default_mode === "source" ? "source" : "diff"), o = Hp(n), s = Hp(r);
18869
+ function Qp({ values: e, options: t }) {
18870
+ let n = e.before, r = e.after, [i, a] = X(t?.default_mode === "source" ? "source" : "diff"), o = Up(n), s = Up(r);
18864
18871
  return /* @__PURE__ */ $("div", {
18865
18872
  className: "flex flex-col gap-2",
18866
18873
  children: [/* @__PURE__ */ $("div", {
18867
18874
  className: "flex items-center justify-between",
18868
- children: [/* @__PURE__ */ Q(Xp, {
18875
+ children: [/* @__PURE__ */ Q(Zp, {
18869
18876
  mode: i,
18870
18877
  onChange: a
18871
18878
  }), o === s && /* @__PURE__ */ Q("span", {
@@ -18876,25 +18883,25 @@ function Zp({ values: e, options: t }) {
18876
18883
  }), /* @__PURE__ */ Q("div", {
18877
18884
  className: "h-[480px] w-full overflow-hidden rounded border",
18878
18885
  role: "group",
18879
- "aria-label": Wp,
18880
- children: /* @__PURE__ */ Q(Up, {
18881
- fallback: /* @__PURE__ */ Q(Yp, {
18886
+ "aria-label": Gp,
18887
+ children: /* @__PURE__ */ Q(Wp, {
18888
+ fallback: /* @__PURE__ */ Q(Xp, {
18882
18889
  before: n,
18883
18890
  after: r
18884
18891
  }),
18885
18892
  children: /* @__PURE__ */ Q(un, {
18886
- fallback: /* @__PURE__ */ Q(Jp, {}),
18887
- children: i === "diff" ? /* @__PURE__ */ Q(Gp, {
18893
+ fallback: /* @__PURE__ */ Q(Yp, {}),
18894
+ children: i === "diff" ? /* @__PURE__ */ Q(Kp, {
18888
18895
  before: o,
18889
18896
  after: s
18890
18897
  }) : /* @__PURE__ */ $("div", {
18891
18898
  className: "flex h-full w-full gap-2",
18892
18899
  children: [/* @__PURE__ */ Q("div", {
18893
18900
  className: "min-w-0 flex-1",
18894
- children: /* @__PURE__ */ Q(Kp, { value: o })
18901
+ children: /* @__PURE__ */ Q(qp, { value: o })
18895
18902
  }), /* @__PURE__ */ Q("div", {
18896
18903
  className: "min-w-0 flex-1",
18897
- children: /* @__PURE__ */ Q(Kp, { value: s })
18904
+ children: /* @__PURE__ */ Q(qp, { value: s })
18898
18905
  })]
18899
18906
  })
18900
18907
  })
@@ -18904,15 +18911,15 @@ function Zp({ values: e, options: t }) {
18904
18911
  }
18905
18912
  //#endregion
18906
18913
  //#region src/components/detail-layout/widgets/builtins.ts
18907
- var Qp = !1;
18908
- function $p() {
18909
- Qp ||= (Lp("json_diff", Zp), !0);
18914
+ var $p = !1;
18915
+ function em() {
18916
+ $p ||= (Rp("json_diff", Qp), !0);
18910
18917
  }
18911
18918
  //#endregion
18912
18919
  //#region src/components/detail-layout/widgets/WidgetHost.tsx
18913
- $p();
18914
- function em({ config: e, ctx: t }) {
18915
- let n = Rp(e.type);
18920
+ em();
18921
+ function tm({ config: e, ctx: t }) {
18922
+ let n = zp(e.type);
18916
18923
  if (!n) return /* @__PURE__ */ Q("span", {
18917
18924
  className: "text-sm text-muted-foreground",
18918
18925
  children: `unknown widget: ${e.type}`
@@ -18929,49 +18936,49 @@ function em({ config: e, ctx: t }) {
18929
18936
  }
18930
18937
  //#endregion
18931
18938
  //#region src/components/detail-layout/LayoutRenderer.tsx
18932
- function tm({ nodes: e, ctx: t }) {
18933
- return /* @__PURE__ */ Q(Z, { children: e.map((e, n) => /* @__PURE__ */ Q(nm, {
18939
+ function nm({ nodes: e, ctx: t }) {
18940
+ return /* @__PURE__ */ Q(Z, { children: e.map((e, n) => /* @__PURE__ */ Q(rm, {
18934
18941
  node: e,
18935
18942
  ctx: t
18936
18943
  }, n)) });
18937
18944
  }
18938
- function nm({ node: e, ctx: t }) {
18939
- return e.row ? /* @__PURE__ */ Q(xf, {
18945
+ function rm({ node: e, ctx: t }) {
18946
+ return e.row ? /* @__PURE__ */ Q(Sf, {
18940
18947
  config: e.row,
18941
18948
  ctx: t
18942
- }) : e.column ? /* @__PURE__ */ Q(wf, {
18949
+ }) : e.column ? /* @__PURE__ */ Q(Tf, {
18943
18950
  config: e.column,
18944
18951
  node: e,
18945
18952
  ctx: t
18946
- }) : e.tabs ? /* @__PURE__ */ Q(Of, {
18953
+ }) : e.tabs ? /* @__PURE__ */ Q(kf, {
18947
18954
  config: e.tabs,
18948
18955
  ctx: t
18949
- }) : e.section ? /* @__PURE__ */ Q(kf, {
18956
+ }) : e.section ? /* @__PURE__ */ Q(Af, {
18950
18957
  config: e.section,
18951
18958
  ctx: t
18952
- }) : e.children ? /* @__PURE__ */ Q(vp, {
18959
+ }) : e.children ? /* @__PURE__ */ Q(yp, {
18953
18960
  node: e,
18954
18961
  ctx: t
18955
18962
  }) : e.associated ? /* @__PURE__ */ Q(jl, {
18956
18963
  node: e,
18957
18964
  ctx: t
18958
- }) : e.fields ? /* @__PURE__ */ Q(Dp, {
18965
+ }) : e.fields ? /* @__PURE__ */ Q(Op, {
18959
18966
  fields: e.fields,
18960
18967
  ctx: t
18961
- }) : e.properties == null ? e.statuses == null ? e.widget ? /* @__PURE__ */ Q(em, {
18968
+ }) : e.properties == null ? e.statuses == null ? e.widget ? /* @__PURE__ */ Q(tm, {
18962
18969
  config: e.widget,
18963
18970
  ctx: t
18964
- }) : null : /* @__PURE__ */ Q(Fp, {
18971
+ }) : null : /* @__PURE__ */ Q(Ip, {
18965
18972
  node: e,
18966
18973
  ctx: t
18967
- }) : /* @__PURE__ */ Q(Ap, {
18974
+ }) : /* @__PURE__ */ Q(jp, {
18968
18975
  node: e,
18969
18976
  ctx: t
18970
18977
  });
18971
18978
  }
18972
18979
  //#endregion
18973
18980
  //#region src/components/detail-layout/ErrorSummary.tsx
18974
- function rm({ errors: e, onJump: t }) {
18981
+ function im({ errors: e, onJump: t }) {
18975
18982
  if (e.length === 0) return null;
18976
18983
  let r = e.length !== 1;
18977
18984
  return /* @__PURE__ */ $("div", {
@@ -19058,7 +19065,7 @@ function rm({ errors: e, onJump: t }) {
19058
19065
  }
19059
19066
  //#endregion
19060
19067
  //#region src/components/shared/HighlightsStrip.tsx
19061
- function im({ items: e }) {
19068
+ function am({ items: e }) {
19062
19069
  return e.length === 0 ? null : /* @__PURE__ */ Q("div", {
19063
19070
  style: {
19064
19071
  display: "flex",
@@ -19094,7 +19101,7 @@ function im({ items: e }) {
19094
19101
  }
19095
19102
  //#endregion
19096
19103
  //#region src/components/detail-layout/DetailHighlights.tsx
19097
- function am({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectStatuses: a, schema: o, locale: s }) {
19104
+ function om({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectStatuses: a, schema: o, locale: s }) {
19098
19105
  let c = e.highlights;
19099
19106
  if (!c || c.length === 0) return null;
19100
19107
  let l = [];
@@ -19135,15 +19142,15 @@ function am({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
19135
19142
  continue;
19136
19143
  }
19137
19144
  }
19138
- return l.length === 0 ? null : /* @__PURE__ */ Q(im, { items: l });
19145
+ return l.length === 0 ? null : /* @__PURE__ */ Q(am, { items: l });
19139
19146
  }
19140
19147
  //#endregion
19141
19148
  //#region src/components/shared/AuditMetaStrip.tsx
19142
- function om(e) {
19149
+ function sm(e) {
19143
19150
  return e.by != null || e.at != null;
19144
19151
  }
19145
- function sm({ lines: e }) {
19146
- let t = e.filter(om);
19152
+ function cm({ lines: e }) {
19153
+ let t = e.filter(sm);
19147
19154
  return t.length === 0 ? null : /* @__PURE__ */ Q("div", {
19148
19155
  style: {
19149
19156
  display: "flex",
@@ -19156,10 +19163,10 @@ function sm({ lines: e }) {
19156
19163
  fontSize: 11.5,
19157
19164
  color: "var(--text-3)"
19158
19165
  },
19159
- children: t.map((e, t) => /* @__PURE__ */ Q(cm, { line: e }, t))
19166
+ children: t.map((e, t) => /* @__PURE__ */ Q(lm, { line: e }, t))
19160
19167
  });
19161
19168
  }
19162
- function cm({ line: e }) {
19169
+ function lm({ line: e }) {
19163
19170
  return /* @__PURE__ */ $("div", {
19164
19171
  style: {
19165
19172
  display: "flex",
@@ -19201,7 +19208,7 @@ function cm({ line: e }) {
19201
19208
  }
19202
19209
  //#endregion
19203
19210
  //#region src/components/detail-layout/DetailAuditStrip.tsx
19204
- function lm({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a, locale: o }) {
19211
+ function um({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a, locale: o }) {
19205
19212
  let s = e.audit;
19206
19213
  if (s?.enabled === !1) return null;
19207
19214
  let c = (e) => {
@@ -19220,7 +19227,7 @@ function lm({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
19220
19227
  locale: o
19221
19228
  });
19222
19229
  };
19223
- return /* @__PURE__ */ Q(sm, { lines: s?.lines && s.lines.length > 0 ? s.lines.map((e) => ({
19230
+ return /* @__PURE__ */ Q(cm, { lines: s?.lines && s.lines.length > 0 ? s.lines.map((e) => ({
19224
19231
  label: G(e.label),
19225
19232
  at: c(e.at),
19226
19233
  by: c(e.by)
@@ -19236,7 +19243,7 @@ function lm({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
19236
19243
  }
19237
19244
  //#endregion
19238
19245
  //#region src/components/shared/RecordHeader.tsx
19239
- function um({ icon: e, avatarName: t, title: r, recordId: i, highlights: a, mode: o, dirty: s = !1, showBack: c = !1, onBack: l, right: u }) {
19246
+ function dm({ icon: e, avatarName: t, title: r, recordId: i, highlights: a, mode: o, dirty: s = !1, showBack: c = !1, onBack: l, right: u }) {
19240
19247
  return /* @__PURE__ */ $("div", {
19241
19248
  style: {
19242
19249
  display: "flex",
@@ -19353,7 +19360,7 @@ function um({ icon: e, avatarName: t, title: r, recordId: i, highlights: a, mode
19353
19360
  }
19354
19361
  //#endregion
19355
19362
  //#region src/lib/children-validation.ts
19356
- function dm(e, t, n) {
19363
+ function fm(e, t, n) {
19357
19364
  let r = [];
19358
19365
  for (let [i, a] of e.fields) {
19359
19366
  if (!a.required || a.auto || n && a.primary || e.tenant_key && i === e.tenant_key || a.default !== void 0 && a.default !== null) continue;
@@ -19362,17 +19369,17 @@ function dm(e, t, n) {
19362
19369
  }
19363
19370
  return r;
19364
19371
  }
19365
- var fm = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
19366
- function pm(e, t) {
19372
+ var pm = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
19373
+ function mm(e, t) {
19367
19374
  let n = [];
19368
19375
  for (let [r, i] of e.fields) {
19369
19376
  if (i.type !== "email") continue;
19370
19377
  let e = t[r];
19371
- typeof e == "string" && e !== "" && !fm.test(e) && n.push(r);
19378
+ typeof e == "string" && e !== "" && !pm.test(e) && n.push(r);
19372
19379
  }
19373
19380
  return n;
19374
19381
  }
19375
- function mm(e, t) {
19382
+ function hm(e, t) {
19376
19383
  let n = /* @__PURE__ */ new Set();
19377
19384
  for (let r of Object.values(t.entities)) if (r.children) {
19378
19385
  for (let t of r.children) if (t.entity === e && t.foreign_key) {
@@ -19382,13 +19389,13 @@ function mm(e, t) {
19382
19389
  }
19383
19390
  return n;
19384
19391
  }
19385
- function hm(e, t) {
19392
+ function gm(e, t) {
19386
19393
  if (!e || !t) return {};
19387
19394
  let n = {};
19388
19395
  for (let [r, i] of Object.entries(e)) {
19389
19396
  let e = t.entities[r];
19390
19397
  if (!e) continue;
19391
- let a = mm(r, t), o = [];
19398
+ let a = hm(r, t), o = [];
19392
19399
  for (let [t, n] of e.fields) e.tenant_key && t === e.tenant_key || n.required && !n.auto && !n.primary && !a.has(t) && o.push(t);
19393
19400
  if (o.length !== 0) for (let e of i) {
19394
19401
  if (e._deleted) continue;
@@ -19404,21 +19411,21 @@ function hm(e, t) {
19404
19411
  }
19405
19412
  //#endregion
19406
19413
  //#region src/components/pages/SmartDetailPage.tsx
19407
- var gm = () => {};
19408
- function _m(e, t) {
19414
+ var _m = () => {};
19415
+ function vm(e, t) {
19409
19416
  return e.length === t.length ? JSON.stringify(e) === JSON.stringify(t) : !1;
19410
19417
  }
19411
- function vm(e, t) {
19418
+ function ym(e, t) {
19412
19419
  if (e) {
19413
19420
  let n = kt(ut(e, t));
19414
19421
  if (n.replace(/^\|+|\|+$/g, "")) return n;
19415
19422
  }
19416
19423
  return t.id == null ? crypto.randomUUID() : U(t.id);
19417
19424
  }
19418
- function ym({ screenCode: e }) {
19419
- return /* @__PURE__ */ Q(We, { children: /* @__PURE__ */ Q(bm, { screenCode: e }) });
19420
- }
19421
19425
  function bm({ screenCode: e }) {
19426
+ return /* @__PURE__ */ Q(We, { children: /* @__PURE__ */ Q(xm, { screenCode: e }) });
19427
+ }
19428
+ function xm({ screenCode: e }) {
19422
19429
  let { id: t } = kn(), r = Ve(), [i, a] = jn(), { data: o } = gt(), s = ct((e) => e.user), c = jt(), l = o?.screens[e], u = l?.entity ? o?.entities[l.entity] : void 0, d = l?.entity, f = Et(u, "create"), p = Et(u, "update"), m = Et(u, "delete"), h = Et(u, "restore"), g = (() => {
19423
19430
  if (!u || !u.singleton || !u.prefilter) return;
19424
19431
  let e = Ae(u);
@@ -19442,8 +19449,8 @@ function bm({ screenCode: e }) {
19442
19449
  u
19443
19450
  ]), S = J(() => {
19444
19451
  if (x) return typeof x == "string" ? x : kt(x);
19445
- }, [x]), { data: C, isLoading: w, error: T } = gf(d, x);
19446
- $o(hf(d, x), !y);
19452
+ }, [x]), { data: C, isLoading: w, error: T } = _f(d, x);
19453
+ $o(gf(d, x), !y);
19447
19454
  let E = Sc(d ?? ""), D = Cc(d ?? ""), O = wc(d ?? ""), k = Tc(d ?? ""), A = Object.keys(u?.status_groups ?? {}).length > 0, j = C?.data, M = j?.$statuses, P = j?.$properties, I = i.get("edit") === "true", [ee, L] = X(y || I), [te, ne] = X({}), [re, ie] = X({}), [ae, oe] = X({}), [se, le] = X(void 0), [ue, de] = X(!1), [fe, pe] = X(void 0), [R, me] = X({ show: !1 }), [he, ge] = X(!1), _e = y ? f : p, z = ee && _e, ve = ot();
19448
19455
  wt(z && !y, ve.enabled);
19449
19456
  let [ye, be] = X(() => {
@@ -19473,7 +19480,7 @@ function bm({ screenCode: e }) {
19473
19480
  Ee.current = we, e && e !== we && ee && de(!0);
19474
19481
  }, [ee, we]);
19475
19482
  let De = !!u?.soft_delete, Oe = De && B != null && B[u.soft_delete] != null, ke = wn(), V = Y(null);
19476
- Tu({ scrollElementRef: V });
19483
+ Eu({ scrollElementRef: V });
19477
19484
  let Me = !y && T instanceof N && T.status === 404, Ne = Y(null);
19478
19485
  q(() => {
19479
19486
  if (!Me) return;
@@ -19525,7 +19532,7 @@ function bm({ screenCode: e }) {
19525
19532
  q(() => {
19526
19533
  if (!(!I || !B || !u || !p)) {
19527
19534
  if (ee || L(!0), Object.keys(te).length === 0) {
19528
- let e = v ? nd(v) : null;
19535
+ let e = v ? rd(v) : null;
19529
19536
  e && Ho(Vo({
19530
19537
  entity: u,
19531
19538
  formData: e,
@@ -19556,7 +19563,7 @@ function bm({ screenCode: e }) {
19556
19563
  let e = o?.entities[n];
19557
19564
  t[n] = r.map((t) => ({
19558
19565
  ...t,
19559
- _key: vm(e, t)
19566
+ _key: ym(e, t)
19560
19567
  }));
19561
19568
  }
19562
19569
  le(t), pe(e);
@@ -19598,7 +19605,7 @@ function bm({ screenCode: e }) {
19598
19605
  if (!l?.route) return "/";
19599
19606
  let e = l.route.split("/");
19600
19607
  return e.pop(), e.join("/") || "/";
19601
- }, [l]), Ue = J(() => !o?.screens || !He || He === "/" ? !1 : Object.values(o.screens).some((e) => e.route === He), [o, He]), H = Pd({ fallback: K(() => {
19608
+ }, [l]), Ue = J(() => !o?.screens || !He || He === "/" ? !1 : Object.values(o.screens).some((e) => e.route === He), [o, He]), H = Fd({ fallback: K(() => {
19602
19609
  if (!Ue) {
19603
19610
  r("/");
19604
19611
  return;
@@ -19613,8 +19620,8 @@ function bm({ screenCode: e }) {
19613
19620
  ]) }), We = !_ && (H.hasOriginBack || H.allowFallbackBack && !!Ue), U = mt(), Ge = J(() => {
19614
19621
  if (!u) return {};
19615
19622
  let e = {};
19616
- for (let t of dm(u, te, y)) Re.has(t) && (e[t] = "Required");
19617
- for (let t of pm(u, te)) Re.has(t) && (e[t] = "Invalid email address");
19623
+ for (let t of fm(u, te, y)) Re.has(t) && (e[t] = "Required");
19624
+ for (let t of mm(u, te)) Re.has(t) && (e[t] = "Invalid email address");
19618
19625
  return e;
19619
19626
  }, [
19620
19627
  u,
@@ -19655,7 +19662,7 @@ function bm({ screenCode: e }) {
19655
19662
  let { _key: t, _deleted: n, _dirty: r, ...i } = e;
19656
19663
  return i;
19657
19664
  }), i = fe?.[e] ?? [];
19658
- (y || !_m(r, i)) && (t[e] = r);
19665
+ (y || !vm(r, i)) && (t[e] = r);
19659
19666
  }
19660
19667
  Object.keys(t).length > 0 && (e.$children = t);
19661
19668
  }
@@ -19725,9 +19732,9 @@ function bm({ screenCode: e }) {
19725
19732
  y,
19726
19733
  h,
19727
19734
  k
19728
- ]), Qe = J(() => hm(se, o), [se, o]), $e = Object.keys(Qe).length > 0;
19735
+ ]), Qe = J(() => gm(se, o), [se, o]), $e = Object.keys(Qe).length > 0;
19729
19736
  if (!l || !u) return null;
19730
- if (!y && w) return /* @__PURE__ */ Q(Nu, {});
19737
+ if (!y && w) return /* @__PURE__ */ Q(Pu, {});
19731
19738
  if (!y && !B || Me) return /* @__PURE__ */ $("div", {
19732
19739
  style: { padding: 24 },
19733
19740
  children: [/* @__PURE__ */ $("div", {
@@ -19812,7 +19819,7 @@ function bm({ screenCode: e }) {
19812
19819
  onChildrenChange: z ? Je : void 0,
19813
19820
  childValidationErrors: z ? Qe : void 0,
19814
19821
  fieldErrors: z && he ? Ge : void 0
19815
- }, W = l.sidebar && l.sidebar.length > 0, st = !y && B ? /* @__PURE__ */ Q(am, {
19822
+ }, W = l.sidebar && l.sidebar.length > 0, st = !y && B ? /* @__PURE__ */ Q(om, {
19816
19823
  screen: l,
19817
19824
  entity: u,
19818
19825
  entityCode: d,
@@ -19821,7 +19828,7 @@ function bm({ screenCode: e }) {
19821
19828
  objectStatuses: M,
19822
19829
  schema: o,
19823
19830
  locale: U
19824
- }) : void 0, lt = /* @__PURE__ */ Q(xm, {
19831
+ }) : void 0, lt = /* @__PURE__ */ Q(Sm, {
19825
19832
  title: rt,
19826
19833
  recordId: v,
19827
19834
  editing: z,
@@ -19875,7 +19882,7 @@ function bm({ screenCode: e }) {
19875
19882
  fontSize: 12.5
19876
19883
  },
19877
19884
  children: [/* @__PURE__ */ Q(n.warning, { size: 14 }), /* @__PURE__ */ Q("span", { children: "This record changed on the server while you were viewing or editing it." })]
19878
- }), pt = z && he && Ke && /* @__PURE__ */ Q(rm, {
19885
+ }), pt = z && he && Ke && /* @__PURE__ */ Q(im, {
19879
19886
  errors: Object.entries(Ge).map(([e, t]) => {
19880
19887
  let n = u.fields.get(e);
19881
19888
  return {
@@ -19893,28 +19900,28 @@ function bm({ screenCode: e }) {
19893
19900
  }
19894
19901
  }), ht = A && !y && !(l.items && l.items.length > 0) && /* @__PURE__ */ Q("div", {
19895
19902
  className: "mb-4",
19896
- children: /* @__PURE__ */ Q(Np, {
19903
+ children: /* @__PURE__ */ Q(Pp, {
19897
19904
  statusGroups: u.status_groups ?? {},
19898
19905
  objectStatuses: at.objectStatuses,
19899
19906
  onSetStatus: p && z ? (e, t) => ie((n) => ({
19900
19907
  ...n,
19901
19908
  [e]: t
19902
- })) : gm,
19909
+ })) : _m,
19903
19910
  isPending: !1,
19904
19911
  mode: z ? "edit" : "display"
19905
19912
  })
19906
19913
  }), _t = /* @__PURE__ */ $(Z, { children: [
19907
- l.items && l.items.length > 0 && (B || y) && o && /* @__PURE__ */ Q(tm, {
19914
+ l.items && l.items.length > 0 && (B || y) && o && /* @__PURE__ */ Q(nm, {
19908
19915
  nodes: l.items,
19909
19916
  ctx: at
19910
19917
  }),
19911
- !y && v && d && u.associations && Object.keys(u.associations).length > 0 && o && /* @__PURE__ */ Q(_f, {
19918
+ !y && v && d && u.associations && Object.keys(u.associations).length > 0 && o && /* @__PURE__ */ Q(vf, {
19912
19919
  entityCode: d,
19913
19920
  recordId: S ?? v ?? "",
19914
19921
  associations: u.associations,
19915
19922
  schema: o
19916
19923
  }),
19917
- !y && B && o && /* @__PURE__ */ Q(lm, {
19924
+ !y && B && o && /* @__PURE__ */ Q(um, {
19918
19925
  screen: l,
19919
19926
  entity: u,
19920
19927
  entityCode: d,
@@ -19995,7 +20002,7 @@ function bm({ screenCode: e }) {
19995
20002
  height: "100%",
19996
20003
  width: `${ye}px`
19997
20004
  },
19998
- children: (B || y) && o && /* @__PURE__ */ Q(tm, {
20005
+ children: (B || y) && o && /* @__PURE__ */ Q(nm, {
19999
20006
  nodes: l.sidebar,
20000
20007
  ctx: at
20001
20008
  })
@@ -20030,7 +20037,7 @@ function bm({ screenCode: e }) {
20030
20037
  ]
20031
20038
  });
20032
20039
  }
20033
- function xm({ title: e, recordId: t, editing: i, isNew: a, isRecordDeleted: o, dirty: s, isSaving: c, hasChildErrors: l, hasFieldErrors: u, canRestore: d, entity: f, screen: p, globalActions: m, entityCode: h, record: g, id: _, listRoute: v, listRouteExists: y, highlights: b, showBack: x, onBack: S, onCancelEdit: C, onSave: w, onRestore: T, isRestoring: E }) {
20040
+ function Sm({ title: e, recordId: t, editing: i, isNew: a, isRecordDeleted: o, dirty: s, isSaving: c, hasChildErrors: l, hasFieldErrors: u, canRestore: d, entity: f, screen: p, globalActions: m, entityCode: h, record: g, id: _, listRoute: v, listRouteExists: y, highlights: b, showBack: x, onBack: S, onCancelEdit: C, onSave: w, onRestore: T, isRestoring: E }) {
20034
20041
  let { run: D } = lt(), O = ni(), k = Ve(), A = mt(), j = p?.action_layout ?? null, M = f?.action_layout ?? null, N = j ?? M, P = zc(N ? qc(N, f?.actions, m, "detail") : Zc(f?.actions, "detail"), f?.actions, m, g ?? {}, []), F = J(() => {
20035
20042
  if (!f) return;
20036
20043
  let e = _ ? [_] : [];
@@ -20097,7 +20104,7 @@ function xm({ title: e, recordId: t, editing: i, isNew: a, isRecordDeleted: o, d
20097
20104
  reservedRightWidth: 0,
20098
20105
  widgetContext: F
20099
20106
  }) : null;
20100
- return /* @__PURE__ */ Q(um, {
20107
+ return /* @__PURE__ */ Q(dm, {
20101
20108
  icon: f?.display.icon ? /* @__PURE__ */ Q(r, {
20102
20109
  name: f.display.icon,
20103
20110
  size: 16
@@ -20114,7 +20121,7 @@ function xm({ title: e, recordId: t, editing: i, isNew: a, isRecordDeleted: o, d
20114
20121
  }
20115
20122
  //#endregion
20116
20123
  //#region src/api/status.ts
20117
- async function Sm(e, t, n, r, i) {
20124
+ async function Cm(e, t, n, r, i) {
20118
20125
  let a = {
20119
20126
  status_group_code: n,
20120
20127
  status_code: r
@@ -20129,10 +20136,10 @@ async function Sm(e, t, n, r, i) {
20129
20136
  }
20130
20137
  //#endregion
20131
20138
  //#region src/hooks/useObjectStatus.ts
20132
- function Cm(e, t) {
20139
+ function wm(e, t) {
20133
20140
  let n = Rn();
20134
20141
  return Fn({
20135
- mutationFn: ({ groupCode: n, statusCode: r, note: i }) => Sm(e, t, n, r, i),
20142
+ mutationFn: ({ groupCode: n, statusCode: r, note: i }) => Cm(e, t, n, r, i),
20136
20143
  onSuccess: () => {
20137
20144
  n.invalidateQueries({ queryKey: ["entity-item", e] });
20138
20145
  },
@@ -20143,7 +20150,7 @@ function Cm(e, t) {
20143
20150
  }
20144
20151
  //#endregion
20145
20152
  //#region src/api/properties.ts
20146
- async function wm(e, t, n, r) {
20153
+ async function Tm(e, t, n, r) {
20147
20154
  let i = (await ye(`${e}.__update`, {
20148
20155
  object_ids: [t],
20149
20156
  entity: e,
@@ -20154,7 +20161,7 @@ async function wm(e, t, n, r) {
20154
20161
  })).result?.rows?.[0]?.$properties ?? [];
20155
20162
  return i.find((e) => e.property_code === n) ?? i[0];
20156
20163
  }
20157
- async function Tm(e, t, n) {
20164
+ async function Em(e, t, n) {
20158
20165
  await ye(`${e}.__update`, {
20159
20166
  object_ids: [t],
20160
20167
  entity: e,
@@ -20166,10 +20173,10 @@ async function Tm(e, t, n) {
20166
20173
  }
20167
20174
  //#endregion
20168
20175
  //#region src/hooks/useProperties.ts
20169
- function Em(e, t) {
20176
+ function Dm(e, t) {
20170
20177
  let n = Rn();
20171
20178
  return Fn({
20172
- mutationFn: ({ propertyCode: n, value: r }) => wm(e, t, n, r),
20179
+ mutationFn: ({ propertyCode: n, value: r }) => Tm(e, t, n, r),
20173
20180
  onSuccess: () => {
20174
20181
  n.invalidateQueries({ queryKey: ["entity-item", e] });
20175
20182
  },
@@ -20178,10 +20185,10 @@ function Em(e, t) {
20178
20185
  }
20179
20186
  });
20180
20187
  }
20181
- function Dm(e, t) {
20188
+ function Om(e, t) {
20182
20189
  let n = Rn();
20183
20190
  return Fn({
20184
- mutationFn: (n) => Tm(e, t, n),
20191
+ mutationFn: (n) => Em(e, t, n),
20185
20192
  onSuccess: () => {
20186
20193
  n.invalidateQueries({ queryKey: ["entity-item", e] });
20187
20194
  },
@@ -20192,11 +20199,11 @@ function Dm(e, t) {
20192
20199
  }
20193
20200
  //#endregion
20194
20201
  //#region src/components/pages/SmartRecordListPage.tsx
20195
- function Om({ screenCode: e }) {
20202
+ function km({ screenCode: e }) {
20196
20203
  let [t, r] = jn(), { data: i } = gt(), a = i?.screens[e], o = a?.entity ? i?.entities[a.entity] : void 0, s = a?.entity;
20197
- Iu(a, o, t.toString()), Pu(a?.route);
20198
- let c = Pd(), l = t.get("selected") ?? null, u = t.get("search") ?? "", d = tt(u, 300), f = t.get("sort") ?? a?.sort_default ?? "", p = J(() => {
20199
- let e = zu(t);
20204
+ Lu(a, o, t.toString()), Fu(a?.route);
20205
+ let c = Fd(), l = t.get("selected") ?? null, u = t.get("search") ?? "", d = tt(u, 300), f = t.get("sort") ?? a?.sort_default ?? "", p = J(() => {
20206
+ let e = Bu(t);
20200
20207
  return e.length > 0 ? e : void 0;
20201
20208
  }, [t]), m = o?.list_pagination === "cursor", { data: g, isLoading: _ } = ee(s, {
20202
20209
  page: 1,
@@ -20221,8 +20228,8 @@ function Om({ screenCode: e }) {
20221
20228
  }, { replace: !0 });
20222
20229
  }, [r]), T = K((e, t) => {
20223
20230
  r((n) => {
20224
- let r = new URLSearchParams(n), i = zu(n), a;
20225
- return a = t && t !== "__all__" ? [...Ku(i, e), Gu(e, t)] : Ku(i, e), Bu(a, r), r;
20231
+ let r = new URLSearchParams(n), i = Bu(n), a;
20232
+ return a = t && t !== "__all__" ? [...qu(i, e), Ku(e, t)] : qu(i, e), Vu(a, r), r;
20226
20233
  }, { replace: !0 });
20227
20234
  }, [r]), E = a?.list_resizable ?? !1, D = Y(null), [O, k] = X(null), A = Y(!1), j = a?.list_width;
20228
20235
  q(() => {
@@ -20384,7 +20391,7 @@ function Om({ screenCode: e }) {
20384
20391
  color: "var(--text-3)"
20385
20392
  },
20386
20393
  children: "No records found"
20387
- }) : /* @__PURE__ */ $(Z, { children: [y.map((e) => /* @__PURE__ */ Q(km, {
20394
+ }) : /* @__PURE__ */ $(Z, { children: [y.map((e) => /* @__PURE__ */ Q(Am, {
20388
20395
  record: e,
20389
20396
  entity: o,
20390
20397
  columns: P,
@@ -20429,7 +20436,7 @@ function Om({ screenCode: e }) {
20429
20436
  minWidth: 0,
20430
20437
  overflow: "hidden"
20431
20438
  },
20432
- children: l ? /* @__PURE__ */ Q(Am, {
20439
+ children: l ? /* @__PURE__ */ Q(jm, {
20433
20440
  entityCode: s,
20434
20441
  recordId: l,
20435
20442
  items: a.items,
@@ -20456,7 +20463,7 @@ function Om({ screenCode: e }) {
20456
20463
  ]
20457
20464
  });
20458
20465
  }
20459
- function km({ record: e, entity: t, columns: n, refs: r, isSelected: i, onClick: a }) {
20466
+ function Am({ record: e, entity: t, columns: n, refs: r, isSelected: i, onClick: a }) {
20460
20467
  let o = mt(), s = n[0], c = n[1], l = n.slice(2, 4);
20461
20468
  return /* @__PURE__ */ $("button", {
20462
20469
  onClick: a,
@@ -20543,8 +20550,8 @@ function km({ record: e, entity: t, columns: n, refs: r, isSelected: i, onClick:
20543
20550
  })]
20544
20551
  });
20545
20552
  }
20546
- function Am({ entityCode: e, recordId: t, items: n, schema: r, entity: i }) {
20547
- return /* @__PURE__ */ Q(We, { children: /* @__PURE__ */ Q(jm, {
20553
+ function jm({ entityCode: e, recordId: t, items: n, schema: r, entity: i }) {
20554
+ return /* @__PURE__ */ Q(We, { children: /* @__PURE__ */ Q(Mm, {
20548
20555
  entityCode: e,
20549
20556
  recordId: t,
20550
20557
  items: n,
@@ -20552,8 +20559,8 @@ function Am({ entityCode: e, recordId: t, items: n, schema: r, entity: i }) {
20552
20559
  entity: i
20553
20560
  }) });
20554
20561
  }
20555
- function jm({ entityCode: e, recordId: t, items: r, schema: a, entity: o }) {
20556
- let s = Et(o, "update"), { data: c, isLoading: l } = gf(e, J(() => t ? qe(o, t) : void 0, [t, o])), u = Cc(e), d = jt(), [f, p] = X(!1), [m, h] = X({}), g = c?.data, _ = g?.$statuses, v = g?.$properties, y = Cm(e, t), b = Em(e, t), x = J(() => {
20562
+ function Mm({ entityCode: e, recordId: t, items: r, schema: a, entity: o }) {
20563
+ let s = Et(o, "update"), { data: c, isLoading: l } = _f(e, J(() => t ? qe(o, t) : void 0, [t, o])), u = Cc(e), d = jt(), [f, p] = X(!1), [m, h] = X({}), g = c?.data, _ = g?.$statuses, v = g?.$properties, y = wm(e, t), b = Dm(e, t), x = J(() => {
20557
20564
  let e = /* @__PURE__ */ new Set();
20558
20565
  for (let [t, n] of o.fields) !n.auto && !n.primary && e.add(t);
20559
20566
  for (let [t] of o.files ?? []) e.add(t);
@@ -20607,7 +20614,7 @@ function jm({ entityCode: e, recordId: t, items: r, schema: a, entity: o }) {
20607
20614
  [e]: t
20608
20615
  }));
20609
20616
  }, []);
20610
- if (l) return /* @__PURE__ */ Q(Nu, {});
20617
+ if (l) return /* @__PURE__ */ Q(Pu, {});
20611
20618
  if (!g) return null;
20612
20619
  let E = Xe(g, o), D = o.display?.display_field, O = E ? void 0 : D ? g[D] : g[o.fields.names()[0]], k = E || (O != null && typeof O != "object" ? U(O) : G(o.display.name)), A = g?.$refs, j = {
20613
20620
  schema: a,
@@ -20698,7 +20705,7 @@ function jm({ entityCode: e, recordId: t, items: r, schema: a, entity: o }) {
20698
20705
  flexDirection: "column",
20699
20706
  gap: 12
20700
20707
  },
20701
- children: r && r.length > 0 ? /* @__PURE__ */ Q(tm, {
20708
+ children: r && r.length > 0 ? /* @__PURE__ */ Q(nm, {
20702
20709
  nodes: r,
20703
20710
  ctx: j
20704
20711
  }) : /* @__PURE__ */ $("p", {
@@ -20717,7 +20724,7 @@ function jm({ entityCode: e, recordId: t, items: r, schema: a, entity: o }) {
20717
20724
  }
20718
20725
  //#endregion
20719
20726
  //#region src/hooks/useVersionWatcher.ts
20720
- function Mm() {
20727
+ function Nm() {
20721
20728
  let e = Rn();
20722
20729
  q(() => {
20723
20730
  let t = !1, n = null, r = 6e4, a = r, o = 0, s = 0;
@@ -20772,40 +20779,40 @@ function Mm() {
20772
20779
  }
20773
20780
  //#endregion
20774
20781
  //#region src/lib/capabilityPrefetch.ts
20775
- var Nm = [
20782
+ var Pm = [
20776
20783
  () => import("./MarkdownRenderer-CwlNQju5.js"),
20777
20784
  () => import("./JsonEditor-KelPV-OQ.js"),
20778
20785
  () => import("./Grid-CsK_TuK_.js"),
20779
20786
  () => import("./DraggableChildrenTable-D4WoV6ck.js")
20780
20787
  ];
20781
- function Pm() {
20782
- for (let e of Nm) e().catch(() => {});
20788
+ function Fm() {
20789
+ for (let e of Pm) e().catch(() => {});
20783
20790
  }
20784
- var Fm = !1;
20785
- function Im() {
20786
- if (Fm) return;
20787
- Fm = !0;
20791
+ var Im = !1;
20792
+ function Lm() {
20793
+ if (Im) return;
20794
+ Im = !0;
20788
20795
  let e = globalThis.requestIdleCallback;
20789
- typeof e == "function" ? e(Pm) : setTimeout(Pm, 0);
20796
+ typeof e == "function" ? e(Fm) : setTimeout(Fm, 0);
20790
20797
  }
20791
20798
  //#endregion
20792
20799
  //#region src/stores/screen-registry.ts
20793
- var Lm = /* @__PURE__ */ new Map();
20794
- function Rm(e, t) {
20795
- Lm.set(e, t);
20800
+ var Rm = /* @__PURE__ */ new Map();
20801
+ function zm(e, t) {
20802
+ Rm.set(e, t);
20796
20803
  }
20797
- function zm(e) {
20798
- return Lm.get(e);
20804
+ function Bm(e) {
20805
+ return Rm.get(e);
20799
20806
  }
20800
20807
  //#endregion
20801
20808
  //#region src/app.tsx
20802
- Rm("Profile", Vl);
20803
- var Bm = "declarion-managed-favicon", Vm = new Mn({ defaultOptions: { queries: {
20809
+ zm("Profile", Vl);
20810
+ var Vm = "declarion-managed-favicon", Hm = new Mn({ defaultOptions: { queries: {
20804
20811
  staleTime: 300 * 1e3,
20805
20812
  retry: 1
20806
20813
  } } });
20807
- Zo(Vm, ci);
20808
- function Hm(e) {
20814
+ Zo(Hm, ci);
20815
+ function Um(e) {
20809
20816
  if (typeof window > "u") return null;
20810
20817
  try {
20811
20818
  let t = new URL(e, window.location.origin);
@@ -20814,7 +20821,7 @@ function Hm(e) {
20814
20821
  return null;
20815
20822
  }
20816
20823
  }
20817
- function Um() {
20824
+ function Wm() {
20818
20825
  let { data: e } = gt();
20819
20826
  return {
20820
20827
  routes: J(() => {
@@ -20826,29 +20833,29 @@ function Um() {
20826
20833
  if ((i ? e.entities?.[i] : void 0)?.singleton) continue;
20827
20834
  t.push(/* @__PURE__ */ Q(bn, {
20828
20835
  path: r.route,
20829
- element: /* @__PURE__ */ Q(Up, { children: /* @__PURE__ */ Q(pf, { screenCode: n }) })
20836
+ element: /* @__PURE__ */ Q(Wp, { children: /* @__PURE__ */ Q(mf, { screenCode: n }) })
20830
20837
  }, n));
20831
20838
  continue;
20832
20839
  }
20833
20840
  if (r.type === "detail") {
20834
20841
  t.push(/* @__PURE__ */ Q(bn, {
20835
20842
  path: r.route,
20836
- element: /* @__PURE__ */ Q(Up, { children: /* @__PURE__ */ Q(ym, { screenCode: n }) })
20843
+ element: /* @__PURE__ */ Q(Wp, { children: /* @__PURE__ */ Q(bm, { screenCode: n }) })
20837
20844
  }, n));
20838
20845
  continue;
20839
20846
  }
20840
20847
  if (r.type === "record_list") {
20841
20848
  t.push(/* @__PURE__ */ Q(bn, {
20842
20849
  path: r.route,
20843
- element: /* @__PURE__ */ Q(Up, { children: /* @__PURE__ */ Q(Om, { screenCode: n }) })
20850
+ element: /* @__PURE__ */ Q(Wp, { children: /* @__PURE__ */ Q(km, { screenCode: n }) })
20844
20851
  }, n));
20845
20852
  continue;
20846
20853
  }
20847
20854
  if (r.type === "custom") {
20848
- let e = r.component ? zm(r.component) : void 0;
20855
+ let e = r.component ? Bm(r.component) : void 0;
20849
20856
  e && t.push(/* @__PURE__ */ Q(bn, {
20850
20857
  path: r.route,
20851
- element: /* @__PURE__ */ Q(Up, { children: /* @__PURE__ */ Q(e, {}) })
20858
+ element: /* @__PURE__ */ Q(Wp, { children: /* @__PURE__ */ Q(e, {}) })
20852
20859
  }, n));
20853
20860
  }
20854
20861
  }
@@ -20857,8 +20864,8 @@ function Um() {
20857
20864
  defaultRoute: J(() => Vs(e), [e])
20858
20865
  };
20859
20866
  }
20860
- function Wm() {
20861
- let t = ct((e) => e.initialize), n = ct((e) => e.isLoading), r = ct((e) => e.isAuthenticated), { data: i, isLoading: a } = gt(), { data: o, isLoading: s } = Ii(), { routes: c, defaultRoute: l } = Um(), u = ot(), d = typeof window < "u" && window.self !== window.top && !u.enabled;
20867
+ function Gm() {
20868
+ let t = ct((e) => e.initialize), n = ct((e) => e.isLoading), r = ct((e) => e.isAuthenticated), { data: i, isLoading: a } = gt(), { data: o, isLoading: s } = Ii(), { routes: c, defaultRoute: l } = Wm(), u = ot(), d = typeof window < "u" && window.self !== window.top && !u.enabled;
20862
20869
  q(() => {
20863
20870
  u.enabled || d || t();
20864
20871
  }, [
@@ -20870,7 +20877,7 @@ function Wm() {
20870
20877
  q(() => {
20871
20878
  e(f ?? {});
20872
20879
  }, [f]), q(() => {
20873
- Im();
20880
+ Lm();
20874
20881
  }, []);
20875
20882
  let p = o?.branding;
20876
20883
  q(() => {
@@ -20879,7 +20886,7 @@ function Wm() {
20879
20886
  e && (document.title = e);
20880
20887
  }, [p?.app_name]), q(() => {
20881
20888
  if (typeof document > "u") return;
20882
- let e = p?.app_logo, t = ir(e) ? Hm(e.trim()) : null, n = document.getElementById(Bm);
20889
+ let e = p?.app_logo, t = ir(e) ? Um(e.trim()) : null, n = document.getElementById(Vm);
20883
20890
  if (!t) {
20884
20891
  n && n.remove();
20885
20892
  return;
@@ -20887,7 +20894,7 @@ function Wm() {
20887
20894
  if (!n) {
20888
20895
  document.querySelectorAll("link[rel=\"icon\"], link[rel=\"shortcut icon\"]").forEach((e) => e.remove());
20889
20896
  let e = document.createElement("link");
20890
- e.id = Bm, e.rel = "icon", e.href = t, document.head.appendChild(e);
20897
+ e.id = Vm, e.rel = "icon", e.href = t, document.head.appendChild(e);
20891
20898
  return;
20892
20899
  }
20893
20900
  n.href !== t && (n.href = t);
@@ -20900,7 +20907,7 @@ function Wm() {
20900
20907
  t && t.remove();
20901
20908
  return;
20902
20909
  }
20903
- let n = Hm(m);
20910
+ let n = Um(m);
20904
20911
  if (!n) {
20905
20912
  t && t.remove(), console.error(`[declarion] branding.css_url rejected: ${m}. Only same-origin, relative URLs are allowed (e.g. /crm-brand.css).`);
20906
20913
  return;
@@ -20975,12 +20982,12 @@ function Wm() {
20975
20982
  })
20976
20983
  ] });
20977
20984
  }
20978
- function Gm() {
20979
- Mm();
20985
+ function Km() {
20986
+ Nm();
20980
20987
  let e = H((e) => e.toastPosition);
20981
20988
  return /* @__PURE__ */ $(gn, { children: [
20982
20989
  /* @__PURE__ */ Q(Nr, {}),
20983
- /* @__PURE__ */ Q(Wm, {}),
20990
+ /* @__PURE__ */ Q(Gm, {}),
20984
20991
  /* @__PURE__ */ Q(zn, {
20985
20992
  position: e,
20986
20993
  toastOptions: { unstyled: !0 },
@@ -20991,20 +20998,20 @@ function Gm() {
20991
20998
  })
20992
20999
  ] });
20993
21000
  }
20994
- function Km() {
20995
- return /* @__PURE__ */ Q(Up, { children: /* @__PURE__ */ Q(Nn, {
20996
- client: Vm,
20997
- children: /* @__PURE__ */ Q(Ie, { children: /* @__PURE__ */ Q(Gm, {}) })
21001
+ function qm() {
21002
+ return /* @__PURE__ */ Q(Wp, { children: /* @__PURE__ */ Q(Nn, {
21003
+ client: Hm,
21004
+ children: /* @__PURE__ */ Q(Ie, { children: /* @__PURE__ */ Q(Km, {}) })
20998
21005
  }) });
20999
21006
  }
21000
21007
  //#endregion
21001
21008
  //#region src/api/batch.ts
21002
- var qm = class {
21009
+ var Jm = class {
21003
21010
  ops = [];
21004
21011
  call(e, t) {
21005
21012
  return this.ops.push({
21006
21013
  action: e,
21007
- params: Jm(t)
21014
+ params: Ym(t)
21008
21015
  }), this;
21009
21016
  }
21010
21017
  upsert(e, t, n = "upsert", r = []) {
@@ -21026,13 +21033,13 @@ var qm = class {
21026
21033
  return this.ops;
21027
21034
  }
21028
21035
  };
21029
- function Jm(e) {
21036
+ function Ym(e) {
21030
21037
  return e == null ? null : typeof e == "object" && !Array.isArray(e) ? e : { value: e };
21031
21038
  }
21032
21039
  //#endregion
21033
21040
  //#region src/hooks/useAllEntityData.ts
21034
- var Ym = 1e3, Xm = 20;
21035
- function Zm(e, t = {}) {
21041
+ var Xm = 1e3, Zm = 20;
21042
+ function Qm(e, t = {}) {
21036
21043
  return Ln({
21037
21044
  queryKey: [
21038
21045
  "entity-data-all",
@@ -21043,7 +21050,7 @@ function Zm(e, t = {}) {
21043
21050
  queryFn: async ({ signal: n }) => {
21044
21051
  let r = {
21045
21052
  ...t,
21046
- per_page: Ym,
21053
+ per_page: Xm,
21047
21054
  count: "with"
21048
21055
  }, i;
21049
21056
  try {
@@ -21056,7 +21063,7 @@ function Zm(e, t = {}) {
21056
21063
  }
21057
21064
  let a = i.meta.total_pages ?? 1;
21058
21065
  if (a <= 1) return i;
21059
- if (a > Xm) throw Error(`useAllEntityData: entity "${e}" spans ${a} pages (limit ${Xm}); it is not a bounded entity. Use useEntityData with server-side pagination instead.`);
21066
+ if (a > Zm) throw Error(`useAllEntityData: entity "${e}" spans ${a} pages (limit ${Zm}); it is not a bounded entity. Use useEntityData with server-side pagination instead.`);
21060
21067
  let o = await Promise.all(Array.from({ length: a - 1 }, (t, i) => M(e, {
21061
21068
  ...r,
21062
21069
  page: i + 2
@@ -21079,30 +21086,30 @@ function Zm(e, t = {}) {
21079
21086
  }
21080
21087
  //#endregion
21081
21088
  //#region src/hooks/useActionData.ts
21082
- var Qm = "action-data", $m = "action-data-cursor";
21083
- function eh(e, t) {
21089
+ var $m = "action-data", eh = "action-data-cursor";
21090
+ function th(e, t) {
21084
21091
  return [
21085
- Qm,
21092
+ $m,
21086
21093
  e,
21087
21094
  t
21088
21095
  ];
21089
21096
  }
21090
- function th(e, t, n = !0) {
21097
+ function nh(e, t, n = !0) {
21091
21098
  return Ln({
21092
- queryKey: eh(e, t),
21099
+ queryKey: th(e, t),
21093
21100
  queryFn: async () => (await ye(e, t)).result,
21094
21101
  enabled: !!e && n
21095
21102
  });
21096
21103
  }
21097
- function nh(e, t) {
21104
+ function rh(e, t) {
21098
21105
  return [
21099
- $m,
21106
+ eh,
21100
21107
  e,
21101
21108
  t
21102
21109
  ];
21103
21110
  }
21104
- function rh(e, t, n = !0) {
21105
- let r = nh(e, t), i = Pn({
21111
+ function ih(e, t, n = !0) {
21112
+ let r = rh(e, t), i = Pn({
21106
21113
  queryKey: r,
21107
21114
  queryFn: async ({ pageParam: n }) => (await ye(e, n ? {
21108
21115
  ...t,
@@ -21130,7 +21137,7 @@ function rh(e, t, n = !0) {
21130
21137
  }
21131
21138
  //#endregion
21132
21139
  //#region src/hooks/useColumns.ts
21133
- function ih(e, t) {
21140
+ function ah(e, t) {
21134
21141
  let [n, r] = jn(), i = J(() => {
21135
21142
  let r = n.get("columns");
21136
21143
  return r ? r.split(",").filter(Boolean).filter((t) => e.includes(t)) : t.length > 0 ? t : e;
@@ -21140,7 +21147,7 @@ function ih(e, t) {
21140
21147
  t
21141
21148
  ]), a = K((e) => {
21142
21149
  let i = new URLSearchParams(n);
21143
- e.length === 0 || ah(e, t) ? i.delete("columns") : i.set("columns", e.join(",")), r(i);
21150
+ e.length === 0 || oh(e, t) ? i.delete("columns") : i.set("columns", e.join(",")), r(i);
21144
21151
  }, [
21145
21152
  n,
21146
21153
  r,
@@ -21166,19 +21173,19 @@ function ih(e, t) {
21166
21173
  }, [i, a])
21167
21174
  };
21168
21175
  }
21169
- function ah(e, t) {
21176
+ function oh(e, t) {
21170
21177
  return e.length === t.length ? e.every((e, n) => e === t[n]) : !1;
21171
21178
  }
21172
21179
  //#endregion
21173
21180
  //#region src/hooks/useScreenTab.ts
21174
- function oh(e) {
21181
+ function sh(e) {
21175
21182
  let t = wn(), [n] = jn(), r = e?.route ?? t.pathname, i = Y(n.toString());
21176
- Fu(r, e?.title ?? r, e?.icon, i.current), Pu(r);
21183
+ Iu(r, e?.title ?? r, e?.icon, i.current), Fu(r);
21177
21184
  }
21178
21185
  //#endregion
21179
21186
  //#region src/components/shared/PageHeader.tsx
21180
- function sh({ title: e, backTo: t, actions: r }) {
21181
- let i = ot(), a = Ve(), { hasOriginBack: o, goBack: s } = Pd({ fallback: K(() => {
21187
+ function ch({ title: e, backTo: t, actions: r }) {
21188
+ let i = ot(), a = Ve(), { hasOriginBack: o, goBack: s } = Fd({ fallback: K(() => {
21182
21189
  if (t) {
21183
21190
  if (!i.enabled) {
21184
21191
  let e = Dr.getState().findTabByPathname(t);
@@ -21235,7 +21242,7 @@ function sh({ title: e, backTo: t, actions: r }) {
21235
21242
  }
21236
21243
  //#endregion
21237
21244
  //#region src/components/list/RowMenu.tsx
21238
- function ch({ x: e, y: t, onClose: r, onPeek: i, onOpen: a, onEditInline: o, onDuplicate: c, onCopyLink: l, onDelete: u, actions: d }) {
21245
+ function lh({ x: e, y: t, onClose: r, onPeek: i, onOpen: a, onEditInline: o, onDuplicate: c, onCopyLink: l, onDelete: u, actions: d }) {
21239
21246
  let f = (e) => () => {
21240
21247
  r(), e?.();
21241
21248
  }, p = i || a || o || c || l, m = d && d.length > 0;
@@ -21313,7 +21320,7 @@ function ch({ x: e, y: t, onClose: r, onPeek: i, onOpen: a, onEditInline: o, onD
21313
21320
  }
21314
21321
  //#endregion
21315
21322
  //#region src/components/list/InlineEditCell.tsx
21316
- var lh = {
21323
+ var uh = {
21317
21324
  padding: "4px 6px",
21318
21325
  margin: "-4px -6px",
21319
21326
  borderRadius: 4,
@@ -21324,7 +21331,7 @@ var lh = {
21324
21331
  alignItems: "center",
21325
21332
  gap: 4
21326
21333
  };
21327
- function uh({ value: e, onSave: t, type: r = "text", options: a, trigger: o = "always", label: s, placeholder: c }) {
21334
+ function dh({ value: e, onSave: t, type: r = "text", options: a, trigger: o = "always", label: s, placeholder: c }) {
21328
21335
  let [l, u] = X(e), [d, f] = X(e), [p, m] = X(!1), [g, _] = X(e), v = Y(null);
21329
21336
  q(() => {
21330
21337
  u(e), f(e), _(e);
@@ -21396,7 +21403,7 @@ function uh({ value: e, onSave: t, type: r = "text", options: a, trigger: o = "a
21396
21403
  onMouseLeave: (e) => {
21397
21404
  e.currentTarget.style.borderColor = "transparent";
21398
21405
  },
21399
- style: lh,
21406
+ style: uh,
21400
21407
  children: d ?? /* @__PURE__ */ Q("span", {
21401
21408
  style: { color: "var(--text-4)" },
21402
21409
  children: "Click to edit"
@@ -21405,7 +21412,7 @@ function uh({ value: e, onSave: t, type: r = "text", options: a, trigger: o = "a
21405
21412
  }
21406
21413
  //#endregion
21407
21414
  //#region src/components/pages/home/HomeStub.tsx
21408
- var dh = [
21415
+ var fh = [
21409
21416
  {
21410
21417
  id: "a1",
21411
21418
  title: "James Gallagher moved to Discovery",
@@ -21421,7 +21428,7 @@ var dh = [
21421
21428
  title: "Refill enrichment job completed (32 leads)",
21422
21429
  when: "10:00 AM"
21423
21430
  }
21424
- ], fh = [
21431
+ ], ph = [
21425
21432
  {
21426
21433
  label: "Open leads",
21427
21434
  val: "127",
@@ -21446,7 +21453,7 @@ var dh = [
21446
21453
  delta: "2 failed",
21447
21454
  tone: "amber"
21448
21455
  }
21449
- ], ph = [
21456
+ ], mh = [
21450
21457
  [
21451
21458
  "leads",
21452
21459
  "Leads",
@@ -21478,7 +21485,7 @@ var dh = [
21478
21485
  "entity"
21479
21486
  ]
21480
21487
  ];
21481
- function mh({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLabel: r = "Acme · production" }) {
21488
+ function hh({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLabel: r = "Acme · production" }) {
21482
21489
  return /* @__PURE__ */ Q("div", {
21483
21490
  style: {
21484
21491
  padding: "22px 24px",
@@ -21522,7 +21529,7 @@ function mh({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
21522
21529
  gap: 10,
21523
21530
  margin: "16px 0"
21524
21531
  },
21525
- children: fh.map((e) => /* @__PURE__ */ $("div", {
21532
+ children: ph.map((e) => /* @__PURE__ */ $("div", {
21526
21533
  style: {
21527
21534
  padding: 14,
21528
21535
  background: "var(--surface)",
@@ -21570,7 +21577,7 @@ function mh({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
21570
21577
  gridTemplateColumns: "repeat(3,1fr)",
21571
21578
  gap: 8
21572
21579
  },
21573
- children: ph.map(([t, r, i]) => {
21580
+ children: mh.map(([t, r, i]) => {
21574
21581
  let a = n[i];
21575
21582
  return /* @__PURE__ */ $("button", {
21576
21583
  onClick: () => e?.(t),
@@ -21615,7 +21622,7 @@ function mh({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
21615
21622
  flexDirection: "column",
21616
21623
  gap: 8
21617
21624
  },
21618
- children: dh.slice(0, 3).map((e) => /* @__PURE__ */ $("div", {
21625
+ children: fh.slice(0, 3).map((e) => /* @__PURE__ */ $("div", {
21619
21626
  style: {
21620
21627
  fontSize: 12,
21621
21628
  color: "var(--text-2)"
@@ -21644,19 +21651,19 @@ function mh({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
21644
21651
  }
21645
21652
  //#endregion
21646
21653
  //#region src/components/pages/pipeline/Pipeline.tsx
21647
- var hh = {
21654
+ var gh = {
21648
21655
  "1-New": { color: "slate" },
21649
21656
  "2-Contacted": { color: "sky" },
21650
21657
  "3-Qualified": { color: "violet" },
21651
21658
  "4-Proposal": { color: "amber" },
21652
21659
  "5-Won": { color: "emerald" },
21653
21660
  "6-Lost": { color: "rose" }
21654
- }, gh = {
21661
+ }, _h = {
21655
21662
  P0: "rose",
21656
21663
  P1: "amber",
21657
21664
  P2: "sky",
21658
21665
  P3: "slate"
21659
- }, _h = [
21666
+ }, vh = [
21660
21667
  {
21661
21668
  id: "l1",
21662
21669
  contact: "James Gallagher",
@@ -21722,11 +21729,11 @@ var hh = {
21722
21729
  score: 58
21723
21730
  }
21724
21731
  ];
21725
- function vh() {
21726
- let e = Object.entries(hh).map(([e, t]) => ({
21732
+ function yh() {
21733
+ let e = Object.entries(gh).map(([e, t]) => ({
21727
21734
  key: e,
21728
21735
  color: t.color,
21729
- leads: _h.filter((t) => t.pipeline === e)
21736
+ leads: vh.filter((t) => t.pipeline === e)
21730
21737
  }));
21731
21738
  return /* @__PURE__ */ $("div", {
21732
21739
  style: {
@@ -21757,7 +21764,7 @@ function vh() {
21757
21764
  fontSize: 12,
21758
21765
  color: "var(--text-3)"
21759
21766
  },
21760
- children: [_h.length, " leads · $2.4M pipeline"]
21767
+ children: [vh.length, " leads · $2.4M pipeline"]
21761
21768
  })]
21762
21769
  }), /* @__PURE__ */ Q("div", {
21763
21770
  style: {
@@ -21843,7 +21850,7 @@ function vh() {
21843
21850
  flexWrap: "wrap"
21844
21851
  },
21845
21852
  children: [e.priority && e.priority !== "-" && /* @__PURE__ */ Q(O, {
21846
- tone: gh[e.priority] ?? "slate",
21853
+ tone: _h[e.priority] ?? "slate",
21847
21854
  size: "xs",
21848
21855
  dot: !0,
21849
21856
  children: e.priority
@@ -21862,7 +21869,7 @@ function vh() {
21862
21869
  }
21863
21870
  //#endregion
21864
21871
  //#region src/components/pages/jobs/Jobs.tsx
21865
- var yh = [
21872
+ var bh = [
21866
21873
  {
21867
21874
  id: "job_91a4",
21868
21875
  name: "reparse_leads_with_llm",
@@ -21906,12 +21913,12 @@ var yh = [
21906
21913
  worker: "wk-us-01",
21907
21914
  took: "2m 02s"
21908
21915
  }
21909
- ], bh = {
21916
+ ], xh = {
21910
21917
  running: "sky",
21911
21918
  success: "emerald",
21912
21919
  queued: "slate",
21913
21920
  failed: "rose"
21914
- }, xh = [
21921
+ }, Sh = [
21915
21922
  "ID",
21916
21923
  "Name",
21917
21924
  "Status",
@@ -21921,7 +21928,7 @@ var yh = [
21921
21928
  "Worker",
21922
21929
  ""
21923
21930
  ];
21924
- function Sh() {
21931
+ function Ch() {
21925
21932
  return /* @__PURE__ */ $("div", {
21926
21933
  style: {
21927
21934
  padding: "14px 20px",
@@ -21970,7 +21977,7 @@ function Sh() {
21970
21977
  background: "var(--surface-2)",
21971
21978
  color: "var(--text-3)"
21972
21979
  },
21973
- children: xh.map((e, t) => /* @__PURE__ */ Q("th", {
21980
+ children: Sh.map((e, t) => /* @__PURE__ */ Q("th", {
21974
21981
  style: {
21975
21982
  padding: "0 10px",
21976
21983
  textAlign: "left",
@@ -21982,7 +21989,7 @@ function Sh() {
21982
21989
  },
21983
21990
  children: e
21984
21991
  }, e || `_h${t}`))
21985
- }) }), /* @__PURE__ */ Q("tbody", { children: yh.map((e) => /* @__PURE__ */ $("tr", {
21992
+ }) }), /* @__PURE__ */ Q("tbody", { children: bh.map((e) => /* @__PURE__ */ $("tr", {
21986
21993
  style: { height: 32 },
21987
21994
  children: [
21988
21995
  /* @__PURE__ */ Q("td", {
@@ -22014,7 +22021,7 @@ function Sh() {
22014
22021
  borderBottom: "1px solid var(--divider)"
22015
22022
  },
22016
22023
  children: /* @__PURE__ */ Q(O, {
22017
- tone: bh[e.status],
22024
+ tone: xh[e.status],
22018
22025
  size: "xs",
22019
22026
  dot: !0,
22020
22027
  children: e.status
@@ -22044,7 +22051,7 @@ function Sh() {
22044
22051
  display: "block",
22045
22052
  height: "100%",
22046
22053
  width: `${e.progress}%`,
22047
- background: `var(--pill-${bh[e.status]})`
22054
+ background: `var(--pill-${xh[e.status]})`
22048
22055
  } })
22049
22056
  }), /* @__PURE__ */ $("span", {
22050
22057
  className: "mono num",
@@ -22099,7 +22106,7 @@ function Sh() {
22099
22106
  }
22100
22107
  //#endregion
22101
22108
  //#region src/components/layout/ImpersonationStartModal.tsx
22102
- function Ch({ open: e, targetUserId: t, targetUserLabel: n, onClose: r, onStarted: i }) {
22109
+ function wh({ open: e, targetUserId: t, targetUserLabel: n, onClose: r, onStarted: i }) {
22103
22110
  let { start: a, isStarting: o } = _i(), { value: s } = Ri("impersonation.require_reason_min_length", 10), [c, l] = X(""), [u, d] = X("");
22104
22111
  if (!e) return null;
22105
22112
  let f = c.trim(), p = f.length >= s;
@@ -22259,7 +22266,7 @@ function Ch({ open: e, targetUserId: t, targetUserLabel: n, onClose: r, onStarte
22259
22266
  }
22260
22267
  //#endregion
22261
22268
  //#region src/components/agents/AgentVisualHints.tsx
22262
- function wh({ turn: e, navigate: t }) {
22269
+ function Th({ turn: e, navigate: t }) {
22263
22270
  return q(() => {
22264
22271
  for (let n of e.hints) switch (n.kind) {
22265
22272
  case "navigate":
@@ -22298,7 +22305,7 @@ function wh({ turn: e, navigate: t }) {
22298
22305
  }
22299
22306
  //#endregion
22300
22307
  //#region src/components/agents/AgentConversationDrawer.tsx
22301
- function Th({ open: e, onClose: t, conversations: r, activeId: i, onSelect: a, onNew: o, onRefresh: s }) {
22308
+ function Eh({ open: e, onClose: t, conversations: r, activeId: i, onSelect: a, onNew: o, onRefresh: s }) {
22302
22309
  return q(() => {
22303
22310
  e && s();
22304
22311
  }, [e, s]), e ? /* @__PURE__ */ $("aside", {
@@ -22325,7 +22332,7 @@ function Th({ open: e, onClose: t, conversations: r, activeId: i, onSelect: a, o
22325
22332
  className: `block w-full px-4 py-3 text-left border-b border-divider hover:bg-surface ${e.id === i ? "bg-surface" : ""}`,
22326
22333
  children: [/* @__PURE__ */ Q("div", {
22327
22334
  className: "text-sm font-medium truncate",
22328
- children: e.title || e.context ? Eh(e.context) : "Untitled"
22335
+ children: e.title || e.context ? Dh(e.context) : "Untitled"
22329
22336
  }), /* @__PURE__ */ $("div", {
22330
22337
  className: "text-xs text-muted-foreground",
22331
22338
  children: [
@@ -22348,10 +22355,10 @@ function Th({ open: e, onClose: t, conversations: r, activeId: i, onSelect: a, o
22348
22355
  ]
22349
22356
  }) : null;
22350
22357
  }
22351
- function Eh(e) {
22358
+ function Dh(e) {
22352
22359
  if (!e) return "";
22353
22360
  let t = e.entity ? U(e.entity) : "", n = e.pk ? `:${U(e.pk).slice(0, 6)}` : "";
22354
22361
  return t ? `${t}${n}` : "";
22355
22362
  }
22356
22363
  //#endregion
22357
- export { $m as ACTION_DATA_CURSOR_KEY, Qm as ACTION_DATA_KEY, pe as ActionBatchError, Tt as ActionRunnerProvider, Ma as AgentChatPanel, Th as AgentConversationDrawer, Ta as AgentElicitForm, wh as AgentVisualHints, Km as App, Km as Declarion, Ls as AuthShell, Jn as Avatar, qm as Batch, $e as BoolToggle, Yn as BrandGlyph, Ei as Breadcrumbs, R as Btn, vt as CURSOR_LOCALE_CHANGED, j as CURSOR_SEMANTICS_MISMATCH, _c as ChangePasswordDialog, nr as Check, L as Chip, oo as CircleImage, rr as ClassifiedFieldLocked, Jd as ColumnPicker, Wi as CommandPalette, qr as ConfirmDialog, Mt as DateInput, le as Dropdown, r as DynamicIcon, Eu as EmptyState, ss as EntityClient, Vt as FieldLabel, We as FileDraftScope, hd as FilterChips, yd as FilterDrawer, oc as Forgot, mh as HomeStub, re as HoverCard, n as Icon, F as IconBtn, Mi as ImpersonationBanner, zi as ImpersonationFrame, Ch as ImpersonationStartModal, uh as InlineEditCell, Sh as JobsStub, Me as JsonField, x as Kbd, ke as MULTIPLE_VALUES, s as MenuItem, Lu as NO_VALUE_OPS, Ru as OP_LABELS, qo as PAGE_STATE_TTL_PARAM, sh as PageHeader, Rt as PasswordInput, O as Pill, vh as PipelineStub, Zl as Preferences, Vl as Profile, ft as PropertyGridEditor, $u as QEField, ge as QuickEditCell, Qu as QuickPeek, sr as Rail, er as RecordIdBadge, as as RefCache, f as RefField, pc as Reset, tr as RowField, ch as RowMenu, hu as SCROLL_STATE_KEY, Zn as SectionCard, Ft as Select, ri as Sidebar, tc as SignIn, ic as SignUp, ym as SmartDetailPage, pf as SmartListPage, Om as SmartRecordListPage, nt as Spinner, ao as SquareImage, ki as TabStrip, z as TagsInput, Ci as TenantChip, v as TextArea, h as TextInput, Oi as TopBar, mc as TwoFA, Bt as UploadError, oe as ViewField, Xd as ViewSwitcher, so as WideBanner, eh as actionDataQueryKey, Ji as approveInvocation, Ut as buildActionBody, Te as buildDetailHrefFromId, fe as buildEntityDetailHref, Pe as buildMassEditTargets, a as buildRowDetailHref, ii as buildSections, Xi as cancelConversation, Go as canonicalUrl, Hd as classificationTier, U as coerceDisplayString, Uu as countActiveFilters, Gi as createConversation, nh as cursorActionDataQueryKey, ms as cursorEntityDataQueryKey, ps as cursorEntityStableKey, xe as deleteEntity, St as detectCommonValue, je as discardFile, ds as entityClient, o as entityDataQueryKey, hf as entityItemQueryKey, Si as envTone, ye as executeAction, ut as extractPkValues, Wd as fieldAccessInfo, Bd as fieldClassification, bt as fieldDisplayName, Vd as fieldRequiredPermission, Lt as formatBytes, md as formatCount, fd as formatEstimatedCount, pd as formatExactCount, uo as getFileWidget, t as getIcon, Ya as getImageCropper, Rp as getLayoutWidget, Ae as getPrimaryKeyFields, fo as hasFileWidget, zp as hasLayoutWidget, Vu as hasOrGroups, we as isCursorStaleError, Rd as isFieldReadable, Ud as isFieldSoDProtected, zd as isFieldWritable, Zi as listConversations, $i as listPendingInvocations, ea as loadHistory, G as loc, zu as parseFiltersFromURL, it as parseTargetFilter, Ct as pkValuePartsToId, Fe as pkValuesFromId, at as pkValuesToDetailId, kt as pkValuesToId, lo as registerFileWidget, Lp as registerLayoutWidget, Rm as registerScreen, Yi as rejectInvocation, Qi as rerunMessageTurn, Ue as resolveDetailRoute, A as restoreEntity, qi as sendElicitResponse, Ki as sendMessage, Bu as setFiltersInURL, e as setIconRegistry, Ja as setImageCropper, he as uploadFile, th as useActionData, lt as useActionRunner, wa as useAgentConversation, Zm as useAllEntityData, gi as useAuth, ih as useColumns, Sc as useCreateEntity, rh as useCursorActionData, hs as useCursorEntityData, tt as useDebounce, wc as useDeleteEntity, Dm as useDeleteProperty, Ee as useDraftRegistration, ne as useEntity, Qe as useEntityCount, ee as useEntityData, gf as useEntityItem, jt as useFileDraftScope, qu as useFilters, _i as useImpersonation, Cn as useLocation, Tn as useNavigate, mu as usePageState, Jo as usePageStateTtl, Ri as useParam, On as useParams, Tu as usePlainScrollRestoration, Ii as usePublicParams, $o as useRegisterRetainedQuery, Li as useResolvedParam, xu as useSavedScrollOffset, gt as useSchema, Zd as useScreen, Pd as useScreenBack, oh as useScreenTab, An as useSearchParams, Em as useSetProperty, Cm as useSetStatus, ni as useTabNavigate, Pu as useTabSearchMirror, Dr as useTabStore, Cc as useUpdateEntity, Qd as useViews, Cu as useVirtualScrollRestoration, d as validateClientSide };
22364
+ export { eh as ACTION_DATA_CURSOR_KEY, $m as ACTION_DATA_KEY, pe as ActionBatchError, Tt as ActionRunnerProvider, Ma as AgentChatPanel, Eh as AgentConversationDrawer, Ta as AgentElicitForm, Th as AgentVisualHints, qm as App, qm as Declarion, Ls as AuthShell, Jn as Avatar, Jm as Batch, $e as BoolToggle, Yn as BrandGlyph, Ei as Breadcrumbs, R as Btn, vt as CURSOR_LOCALE_CHANGED, j as CURSOR_SEMANTICS_MISMATCH, _c as ChangePasswordDialog, nr as Check, L as Chip, oo as CircleImage, rr as ClassifiedFieldLocked, Yd as ColumnPicker, Wi as CommandPalette, qr as ConfirmDialog, Mt as DateInput, le as Dropdown, r as DynamicIcon, Du as EmptyState, ss as EntityClient, Vt as FieldLabel, We as FileDraftScope, gd as FilterChips, bd as FilterDrawer, oc as Forgot, hh as HomeStub, re as HoverCard, n as Icon, F as IconBtn, Mi as ImpersonationBanner, zi as ImpersonationFrame, wh as ImpersonationStartModal, dh as InlineEditCell, Ch as JobsStub, Me as JsonField, x as Kbd, ke as MULTIPLE_VALUES, s as MenuItem, Ru as NO_VALUE_OPS, zu as OP_LABELS, qo as PAGE_STATE_TTL_PARAM, ch as PageHeader, Rt as PasswordInput, O as Pill, yh as PipelineStub, Zl as Preferences, Vl as Profile, ft as PropertyGridEditor, ed as QEField, ge as QuickEditCell, $u as QuickPeek, sr as Rail, er as RecordIdBadge, as as RefCache, f as RefField, pc as Reset, tr as RowField, lh as RowMenu, hu as SCROLL_STATE_KEY, Zn as SectionCard, Ft as Select, ri as Sidebar, tc as SignIn, ic as SignUp, bm as SmartDetailPage, mf as SmartListPage, km as SmartRecordListPage, nt as Spinner, ao as SquareImage, ki as TabStrip, z as TagsInput, Ci as TenantChip, v as TextArea, h as TextInput, Oi as TopBar, mc as TwoFA, Bt as UploadError, oe as ViewField, Zd as ViewSwitcher, so as WideBanner, th as actionDataQueryKey, Ji as approveInvocation, Ut as buildActionBody, Te as buildDetailHrefFromId, fe as buildEntityDetailHref, Pe as buildMassEditTargets, a as buildRowDetailHref, ii as buildSections, Xi as cancelConversation, Go as canonicalUrl, Ud as classificationTier, U as coerceDisplayString, Wu as countActiveFilters, Gi as createConversation, rh as cursorActionDataQueryKey, ms as cursorEntityDataQueryKey, ps as cursorEntityStableKey, xe as deleteEntity, St as detectCommonValue, je as discardFile, ds as entityClient, o as entityDataQueryKey, gf as entityItemQueryKey, Si as envTone, ye as executeAction, ut as extractPkValues, Gd as fieldAccessInfo, Vd as fieldClassification, bt as fieldDisplayName, Hd as fieldRequiredPermission, Lt as formatBytes, hd as formatCount, pd as formatEstimatedCount, md as formatExactCount, uo as getFileWidget, t as getIcon, Ya as getImageCropper, zp as getLayoutWidget, Ae as getPrimaryKeyFields, fo as hasFileWidget, Bp as hasLayoutWidget, Hu as hasOrGroups, we as isCursorStaleError, zd as isFieldReadable, Wd as isFieldSoDProtected, Bd as isFieldWritable, Zi as listConversations, $i as listPendingInvocations, ea as loadHistory, G as loc, Bu as parseFiltersFromURL, it as parseTargetFilter, Ct as pkValuePartsToId, Fe as pkValuesFromId, at as pkValuesToDetailId, kt as pkValuesToId, lo as registerFileWidget, Rp as registerLayoutWidget, zm as registerScreen, Yi as rejectInvocation, Qi as rerunMessageTurn, Ue as resolveDetailRoute, A as restoreEntity, qi as sendElicitResponse, Ki as sendMessage, Vu as setFiltersInURL, e as setIconRegistry, Ja as setImageCropper, he as uploadFile, nh as useActionData, lt as useActionRunner, wa as useAgentConversation, Qm as useAllEntityData, gi as useAuth, ah as useColumns, Sc as useCreateEntity, ih as useCursorActionData, hs as useCursorEntityData, tt as useDebounce, wc as useDeleteEntity, Om as useDeleteProperty, Ee as useDraftRegistration, ne as useEntity, Qe as useEntityCount, ee as useEntityData, _f as useEntityItem, jt as useFileDraftScope, Ju as useFilters, _i as useImpersonation, Cn as useLocation, Tn as useNavigate, mu as usePageState, Jo as usePageStateTtl, Ri as useParam, On as useParams, Eu as usePlainScrollRestoration, Ii as usePublicParams, $o as useRegisterRetainedQuery, Li as useResolvedParam, Su as useSavedScrollOffset, gt as useSchema, Qd as useScreen, Fd as useScreenBack, sh as useScreenTab, An as useSearchParams, Dm as useSetProperty, wm as useSetStatus, ni as useTabNavigate, Fu as useTabSearchMirror, Dr as useTabStore, Cc as useUpdateEntity, $d as useViews, wu as useVirtualScrollRestoration, d as validateClientSide };