@ai-matrx/records-ui 0.115.98 → 0.115.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -10513,12 +10513,25 @@ function shownAsOf(field2) {
10513
10513
  const options = raw.options;
10514
10514
  return options && typeof options === "object" && Object.keys(options).length > 0 ? { id, options } : { id };
10515
10515
  }
10516
+ var YEAR_NAMES = /(^|[\s_-])(year|founded|established|incorporated|vintage)([\s_-]|$)/i;
10517
+ function isYearField(field2) {
10518
+ return YEAR_NAMES.test(String(field2.label ?? "")) || YEAR_NAMES.test(field2.key);
10519
+ }
10520
+ function isYearValue(value) {
10521
+ return typeof value === "number" && Number.isInteger(value) && value >= 1e3 && value <= 2999;
10522
+ }
10523
+ function ungroupedForYears(field2, format) {
10524
+ if (format.id !== "number" || !isYearField(field2)) return format;
10525
+ const options = format.options ?? {};
10526
+ if (options["useGrouping"] !== void 0) return format;
10527
+ return { ...format, options: { ...options, useGrouping: false } };
10528
+ }
10516
10529
  function formatForField(field2) {
10517
10530
  const shownAs = shownAsOf(field2);
10518
10531
  if (newerKindOf3(field2) === "rating" && (!shownAs || shownAs.id === "rating")) {
10519
10532
  return { id: "rating", options: { ...shownAs?.options ?? {}, ratingMax: ratingMaxOf(field2) } };
10520
10533
  }
10521
- if (shownAs) return shownAs;
10534
+ if (shownAs) return ungroupedForYears(field2, shownAs);
10522
10535
  const stamp = dateFormatFor(field2);
10523
10536
  if (stamp && editorKindFor(field2) !== "datetime") return stamp;
10524
10537
  switch (editorKindFor(field2)) {
@@ -10538,7 +10551,7 @@ function formatForField(field2) {
10538
10551
  case "phone":
10539
10552
  return { id: "phone" };
10540
10553
  case "number":
10541
- return { id: "number" };
10554
+ return ungroupedForYears(field2, { id: "number" });
10542
10555
  default:
10543
10556
  return void 0;
10544
10557
  }
@@ -13686,7 +13699,7 @@ function Scalar({ value, keyName, dense }) {
13686
13699
  const date = dateWords(text);
13687
13700
  if (date) return /* @__PURE__ */ jsx43("span", { title: text, children: date });
13688
13701
  if (!dense && ui.renderText && text.length > 40 && MARKDOWN.test(text)) return /* @__PURE__ */ jsx43("div", { className: "min-w-0", children: ui.renderText(text, "cell") });
13689
- return /* @__PURE__ */ jsx43("span", { className: cn28(dense ? "line-clamp-2" : "whitespace-pre-wrap", "[overflow-wrap:anywhere]"), children: text });
13702
+ return /* @__PURE__ */ jsx43("span", { className: cn28(dense ? "line-clamp-2 break-words" : "whitespace-pre-wrap [overflow-wrap:anywhere]"), children: text });
13690
13703
  }
13691
13704
  var TABLE_ROWS = 8;
13692
13705
  var TABLE_COLUMNS = 12;
@@ -13698,7 +13711,7 @@ function RecordsTable({ items }) {
13698
13711
  return /* @__PURE__ */ jsxs38("div", { className: "min-w-0", "data-records-structured": "table", children: [
13699
13712
  /* @__PURE__ */ jsx43("div", { className: "max-w-full overflow-x-auto rounded-md border border-border", children: /* @__PURE__ */ jsxs38("table", { className: "w-full border-collapse text-xs", children: [
13700
13713
  /* @__PURE__ */ jsx43("thead", { className: "bg-muted/60 text-left", children: /* @__PURE__ */ jsx43("tr", { children: pictureFirst.map((k) => /* @__PURE__ */ jsx43("th", { scope: "col", className: "whitespace-nowrap px-2 py-1 font-medium text-muted-foreground", children: keyWords(k) }, k)) }) }),
13701
- /* @__PURE__ */ jsx43("tbody", { children: shown5.map((item, i) => /* @__PURE__ */ jsx43("tr", { className: "border-t border-border/60 align-top", children: pictureFirst.map((k) => /* @__PURE__ */ jsx43("td", { className: "max-w-[18rem] px-2 py-1", children: k in item ? /* @__PURE__ */ jsx43(Nested, { value: item[k], keyName: k, dense: true }) : /* @__PURE__ */ jsx43("span", { className: "text-muted-foreground", children: "\u2014" }) }, k)) }, i)) })
13714
+ /* @__PURE__ */ jsx43("tbody", { children: shown5.map((item, i) => /* @__PURE__ */ jsx43("tr", { className: "border-t border-border/60 align-top", children: pictureFirst.map((k) => /* @__PURE__ */ jsx43("td", { className: "min-w-[7rem] max-w-[18rem] px-2 py-1", children: k in item ? /* @__PURE__ */ jsx43(Nested, { value: item[k], keyName: k, dense: true }) : /* @__PURE__ */ jsx43("span", { className: "text-muted-foreground", children: "\u2014" }) }, k)) }, i)) })
13702
13715
  ] }) }),
13703
13716
  items.length > TABLE_ROWS ? /* @__PURE__ */ jsx43(Button23, { type: "button", variant: "ghost", size: "sm", className: "mt-1 h-6 px-2 text-xs", onClick: (e) => {
13704
13717
  stop(e);
@@ -13756,6 +13769,9 @@ function Row({ label, keyName, value, depth, gutter }) {
13756
13769
  }
13757
13770
  );
13758
13771
  }
13772
+ function recordsCount(data) {
13773
+ return Array.isArray(data) && data.length > 0 && data.every(isPlainObject2) ? plural2(data.length, "item", "items") : "";
13774
+ }
13759
13775
  function rawTextOf(s) {
13760
13776
  return s.raw ?? JSON.stringify(s.data, null, 2);
13761
13777
  }
@@ -13767,7 +13783,7 @@ function StructuredValueView({ structured, label, className }) {
13767
13783
  const text = rawTextOf(structured);
13768
13784
  return /* @__PURE__ */ jsxs38("div", { className: cn28("flex min-w-0 flex-col gap-1.5 whitespace-normal", className), "data-records-structured-view": "", children: [
13769
13785
  /* @__PURE__ */ jsxs38("div", { className: "flex min-w-0 items-center gap-1", onClick: stop, children: [
13770
- /* @__PURE__ */ jsx43("span", { className: "min-w-0 flex-1 truncate text-xs text-muted-foreground", children: structuredSummary(structured.data) }),
13786
+ /* @__PURE__ */ jsx43("span", { className: "min-w-0 flex-1 truncate text-xs text-muted-foreground", children: recordsCount(structured.data) }),
13771
13787
  savable ? /* @__PURE__ */ jsx43(Button23, { type: "button", variant: "ghost", size: "sm", className: "h-6 px-2 text-xs", onClick: () => setSaving(true), "data-records-structured-save": "", children: "Save as table" }) : null,
13772
13788
  /* @__PURE__ */ jsx43(
13773
13789
  Button23,
@@ -14054,13 +14070,14 @@ function scalarText(field2, value, labels, stillWaitingFor) {
14054
14070
  }
14055
14071
  const shownAs = shownAsOf(field2);
14056
14072
  if (shownAs) {
14057
- const said2 = formatFieldValue3(value, shownAs);
14073
+ const said2 = formatFieldValue3(value, shownAs.id === "number" && isYearField(field2) && isYearValue(value) ? formatForField(field2) ?? shownAs : shownAs);
14058
14074
  if (said2.ok && !said2.empty) return said2.text;
14059
14075
  }
14060
14076
  if (typeof value === "number") {
14061
14077
  if (kind2 === "percent") return `${value}%`;
14062
14078
  if (kind2 === "currency") return field2.unit ? `${field2.unit}${value.toLocaleString()}` : value.toLocaleString();
14063
- return field2.unit ? `${value.toLocaleString()} ${field2.unit}` : value.toLocaleString();
14079
+ const plain2 = isYearField(field2) && isYearValue(value) ? String(value) : value.toLocaleString();
14080
+ return field2.unit ? `${plain2} ${field2.unit}` : plain2;
14064
14081
  }
14065
14082
  if (kind2 === "datetime" || systemStampOf(field2) === "created_time" || systemStampOf(field2) === "modified_time") {
14066
14083
  const said2 = dateText(field2, value);
@@ -27991,7 +28008,7 @@ function RecordActionMenu({ tableId, row, name, onOpenRecord, onChanged, childre
27991
28008
  // src/gridOpen.tsx
27992
28009
  import { openOutbound as openOutbound3 } from "@ai-matrx/kit/outbound";
27993
28010
  import { Fragment as Fragment30, jsx as jsx88, jsxs as jsxs82 } from "react/jsx-runtime";
27994
- var TITLE_OWN_CONTROLS = 'input, textarea, select, button, a[href], [role="button"], [role="combobox"], [contenteditable="true"], [contenteditable=""], [data-matrx-cell-control]';
28011
+ var TITLE_OWN_CONTROLS = 'input, textarea, select, button, a[href], [role="combobox"], [contenteditable="true"], [contenteditable=""]';
27995
28012
  function openRecordLabel(name) {
27996
28013
  return `Open ${name}`;
27997
28014
  }
@@ -28073,7 +28090,7 @@ function withOpenRecord(columns, onOpen, nameOf3, place = "end", hrefOf, navigat
28073
28090
  if (!titleTarget(event)) return;
28074
28091
  openFrom(row, event);
28075
28092
  },
28076
- onDoubleClick: (event) => {
28093
+ onDoubleClickCapture: (event) => {
28077
28094
  if (!titleTarget(event)) return;
28078
28095
  event.stopPropagation();
28079
28096
  openFrom(row, event);
@@ -33659,7 +33676,7 @@ import {
33659
33676
  SelectValue as SelectValue12,
33660
33677
  Switch as Switch4
33661
33678
  } from "@ai-matrx/design-system";
33662
- import { Fragment as Fragment40, jsx as jsx109, jsxs as jsxs98 } from "react/jsx-runtime";
33679
+ import { jsx as jsx109, jsxs as jsxs98 } from "react/jsx-runtime";
33663
33680
  var ROW_CONTROL_WORDS = {
33664
33681
  block: "New rows",
33665
33682
  shownToByDefault: "Shown to by default",
@@ -33681,11 +33698,24 @@ function ShownToSelect({
33681
33698
  value,
33682
33699
  allowed,
33683
33700
  label,
33701
+ prefix,
33684
33702
  onChange,
33685
33703
  testId
33686
33704
  }) {
33687
33705
  return /* @__PURE__ */ jsxs98(Select14, { value, onValueChange: (next) => isShownTo(next) ? onChange(next) : void 0, children: [
33688
- /* @__PURE__ */ jsx109(SelectTrigger12, { size: "sm", "aria-label": label, className: "h-7 min-w-[8rem] text-xs", "data-testid": testId, children: /* @__PURE__ */ jsx109(SelectValue12, {}) }),
33706
+ /* @__PURE__ */ jsxs98(
33707
+ SelectTrigger12,
33708
+ {
33709
+ size: "sm",
33710
+ "aria-label": label,
33711
+ className: prefix ? "h-7 w-auto gap-1 whitespace-nowrap border-transparent bg-transparent px-2 text-xs shadow-none hover:bg-accent" : "h-7 min-w-[8rem] text-xs",
33712
+ "data-testid": testId,
33713
+ children: [
33714
+ prefix ? /* @__PURE__ */ jsx109("span", { className: "text-muted-foreground", children: prefix }) : null,
33715
+ /* @__PURE__ */ jsx109(SelectValue12, {})
33716
+ ]
33717
+ }
33718
+ ),
33689
33719
  /* @__PURE__ */ jsx109(SelectContent12, { children: allowed.map((word) => /* @__PURE__ */ jsx109(SelectItem12, { value: word, children: SHOWN_TO_LABEL[word] }, word)) })
33690
33720
  ] });
33691
33721
  }
@@ -33796,14 +33826,14 @@ function RowShownTo({ recordId, tableId }) {
33796
33826
  if (!c || c.shown_to.is_child || !isShownTo(c.shown_to.effective)) return null;
33797
33827
  const effective = c.shown_to.effective;
33798
33828
  const allowed = c.shown_to.allowed.filter(isShownTo);
33799
- return /* @__PURE__ */ jsxs98("span", { className: "flex items-center gap-1.5", "data-testid": "row-shown-to", children: [
33800
- /* @__PURE__ */ jsx109("span", { className: "text-muted-foreground", children: ROW_CONTROL_WORDS.shownTo }),
33829
+ return /* @__PURE__ */ jsxs98("span", { className: "inline-flex shrink-0 items-center", "data-testid": "row-shown-to", children: [
33801
33830
  c.shown_to.can_change ? /* @__PURE__ */ jsx109(
33802
33831
  ShownToSelect,
33803
33832
  {
33804
33833
  value: effective,
33805
33834
  allowed: allowed.includes(effective) ? allowed : [...allowed, effective],
33806
33835
  label: ROW_CONTROL_WORDS.shownTo,
33836
+ prefix: ROW_CONTROL_WORDS.shownTo,
33807
33837
  testId: "row-shown-to-select",
33808
33838
  onChange: async (next) => {
33809
33839
  const answer = await client.recordRowControlsSet({ record_id: recordId, controls: { shown_to: next } });
@@ -33813,10 +33843,21 @@ function RowShownTo({ recordId, tableId }) {
33813
33843
  } else setError(answer.error);
33814
33844
  }
33815
33845
  }
33816
- ) : /* @__PURE__ */ jsxs98(Fragment40, { children: [
33817
- /* @__PURE__ */ jsx109("span", { "data-testid": "row-shown-to-text", children: SHOWN_TO_LABEL[effective] }),
33818
- /* @__PURE__ */ jsx109("span", { className: "max-w-[18rem] text-[11px] text-muted-foreground", "data-testid": "row-shown-to-who", children: ROW_CONTROL_WORDS.whoMayChangeRow })
33819
- ] }),
33846
+ ) : (
33847
+ // Read-only: the same words in a quiet chip; who may change it is its tooltip, never a sentence in the row.
33848
+ /* @__PURE__ */ jsxs98(
33849
+ "span",
33850
+ {
33851
+ className: "inline-flex h-7 items-center gap-1 whitespace-nowrap rounded px-2 text-xs",
33852
+ title: ROW_CONTROL_WORDS.whoMayChangeRow,
33853
+ children: [
33854
+ /* @__PURE__ */ jsx109("span", { className: "text-muted-foreground", children: ROW_CONTROL_WORDS.shownTo }),
33855
+ /* @__PURE__ */ jsx109("span", { "data-testid": "row-shown-to-text", children: SHOWN_TO_LABEL[effective] }),
33856
+ /* @__PURE__ */ jsx109("span", { className: "sr-only", "data-testid": "row-shown-to-who", children: ROW_CONTROL_WORDS.whoMayChangeRow })
33857
+ ]
33858
+ }
33859
+ )
33860
+ ),
33820
33861
  error ? /* @__PURE__ */ jsx109(RefusalNotice, { error }) : null
33821
33862
  ] });
33822
33863
  }
@@ -34009,7 +34050,7 @@ function ColumnsAtOnce({
34009
34050
  }
34010
34051
 
34011
34052
  // src/TableSettings.tsx
34012
- import { Fragment as Fragment41, jsx as jsx111, jsxs as jsxs100 } from "react/jsx-runtime";
34053
+ import { Fragment as Fragment40, jsx as jsx111, jsxs as jsxs100 } from "react/jsx-runtime";
34013
34054
  function TableSettings(props) {
34014
34055
  const ui = useRecordsUi();
34015
34056
  const client = useRecordsClient60();
@@ -34023,7 +34064,7 @@ function TableSettings(props) {
34023
34064
  [props.tableId, client, slots]
34024
34065
  );
34025
34066
  const panel = /* @__PURE__ */ jsx111(SettingsAgentSlotsContext.Provider, { value: slots, children: /* @__PURE__ */ jsx111(TableSettingsPanel, { ...props }) });
34026
- return ui.settingsAgent ? /* @__PURE__ */ jsx111(Fragment41, { children: ui.settingsAgent({ tableId: props.tableId, agent, children: panel }) }) : panel;
34067
+ return ui.settingsAgent ? /* @__PURE__ */ jsx111(Fragment40, { children: ui.settingsAgent({ tableId: props.tableId, agent, children: panel }) }) : panel;
34027
34068
  }
34028
34069
  function TableSettingsPanel({
34029
34070
  tableId,
@@ -34179,7 +34220,7 @@ function TableSettingsPanel({
34179
34220
  table.data ? /* @__PURE__ */ jsx111(TableFoundationSwitch, { tableId, table: table.data }) : null,
34180
34221
  table.data ? /* @__PURE__ */ jsx111(TableAccessLevel, { tableId, fields: fields.data ?? [] }) : null,
34181
34222
  /* @__PURE__ */ jsx111(Separator8, {}),
34182
- levelHasShownTo2(table.data?.level) ? /* @__PURE__ */ jsxs100(Fragment41, { children: [
34223
+ levelHasShownTo2(table.data?.level) ? /* @__PURE__ */ jsxs100(Fragment40, { children: [
34183
34224
  /* @__PURE__ */ jsx111(NewRowsDefaults, { tableId }),
34184
34225
  /* @__PURE__ */ jsx111(Separator8, {})
34185
34226
  ] }) : null,
@@ -34238,7 +34279,7 @@ function TableSettingsPanel({
34238
34279
  /* @__PURE__ */ jsx111(Separator8, {}),
34239
34280
  /* @__PURE__ */ jsxs100("div", { className: "flex flex-col gap-1", children: [
34240
34281
  /* @__PURE__ */ jsx111("span", { className: "font-medium", children: "This table" }),
34241
- askingToDelete ? /* @__PURE__ */ jsxs100(Fragment41, { children: [
34282
+ askingToDelete ? /* @__PURE__ */ jsxs100(Fragment40, { children: [
34242
34283
  /* @__PURE__ */ jsx111("p", { className: "text-muted-foreground", "data-archive-confirm": "table", children: archiveConfirmSentence(table.data ? `the table \u201C${tableName(table.data)}\u201D` : "this table") }),
34243
34284
  /* @__PURE__ */ jsx111("p", { className: "text-muted-foreground", "data-archive-state": "", children: tableArchiveSentence({
34244
34285
  progress: archive.progress,
@@ -34248,10 +34289,10 @@ function TableSettingsPanel({
34248
34289
  slowedDown: archive.slowedDown,
34249
34290
  passesHere: archive.passes
34250
34291
  }) }),
34251
- /* @__PURE__ */ jsx111("div", { className: "flex gap-1", children: archive.running ? /* @__PURE__ */ jsxs100(Fragment41, { children: [
34292
+ /* @__PURE__ */ jsx111("div", { className: "flex gap-1", children: archive.running ? /* @__PURE__ */ jsxs100(Fragment40, { children: [
34252
34293
  /* @__PURE__ */ jsx111(Button68, { size: "sm", variant: "destructive", disabled: true, children: "Archiving\u2026" }),
34253
34294
  /* @__PURE__ */ jsx111(Button68, { size: "sm", variant: "ghost", onClick: () => archive.stop(), children: "Stop" })
34254
- ] }) : /* @__PURE__ */ jsxs100(Fragment41, { children: [
34295
+ ] }) : /* @__PURE__ */ jsxs100(Fragment40, { children: [
34255
34296
  /* @__PURE__ */ jsx111(Button68, { size: "sm", variant: "destructive", onClick: () => void startArchive(), children: archive.interrupted || archive.progress?.in_progress ? "Carry on archiving" : "Archive this table" }),
34256
34297
  /* @__PURE__ */ jsx111(Button68, { size: "sm", variant: "ghost", onClick: () => setAskingToDelete(false), children: "Keep it" })
34257
34298
  ] }) })
@@ -34603,7 +34644,7 @@ init_host();
34603
34644
  import { copyText as copyText6 } from "@ai-matrx/kit/clipboard";
34604
34645
  import { useEffect as useEffect76, useState as useState94 } from "react";
34605
34646
  import { Button as Button70, Popover as Popover15, PopoverContent as PopoverContent15, PopoverTrigger as PopoverTrigger15 } from "@ai-matrx/design-system";
34606
- import { Fragment as Fragment42, jsx as jsx115, jsxs as jsxs104 } from "react/jsx-runtime";
34647
+ import { Fragment as Fragment41, jsx as jsx115, jsxs as jsxs104 } from "react/jsx-runtime";
34607
34648
  function useCanShare() {
34608
34649
  return typeof useRecordsUi().share === "function";
34609
34650
  }
@@ -34631,7 +34672,7 @@ function ShareControl({
34631
34672
  const mayShare = may ?? asked4.share;
34632
34673
  if (!host.share) return null;
34633
34674
  if (!mayShare) return whyNot ? /* @__PURE__ */ jsx115(ShareForSomebodyElse, { kind: kind2, whyNot, size, variant, className }) : null;
34634
- return /* @__PURE__ */ jsxs104(Fragment42, { children: [
34675
+ return /* @__PURE__ */ jsxs104(Fragment41, { children: [
34635
34676
  /* @__PURE__ */ jsx115(
34636
34677
  Button70,
34637
34678
  {
@@ -34700,7 +34741,7 @@ import { tableShapeChanged as tableShapeChanged12, useFieldMutation as useFieldM
34700
34741
  init_recordVersions();
34701
34742
  init_Refusal();
34702
34743
  init_writeOnTheWinningVersion();
34703
- import { Fragment as Fragment43, jsx as jsx116, jsxs as jsxs105 } from "react/jsx-runtime";
34744
+ import { Fragment as Fragment42, jsx as jsx116, jsxs as jsxs105 } from "react/jsx-runtime";
34704
34745
  var BODY_NAMES = /^(notes?|page|body|content|page content|details|description)$/i;
34705
34746
  function bodyFieldOf(fields) {
34706
34747
  const rich2 = fields.filter((field2) => newerKindOf6(field2) === "rich_text");
@@ -34771,7 +34812,7 @@ function BodyEditor({ tableId, recordId, field: field2 }) {
34771
34812
  };
34772
34813
  if (!record.data) return null;
34773
34814
  const readOnly = !may.write;
34774
- return /* @__PURE__ */ jsxs105(Fragment43, { children: [
34815
+ return /* @__PURE__ */ jsxs105(Fragment42, { children: [
34775
34816
  /* @__PURE__ */ jsx116("div", { className: "flex h-4 items-center justify-end text-[11px] text-muted-foreground", "data-record-body-state": saving.phase, children: saving.phase === "saving" ? "Saving\u2026" : saving.phase === "saved" ? "Saved" : null }),
34776
34817
  host.editRichText ? host.editRichText({ value: stored, onChange, readOnly, placeholder: `Write in ${field2.label || BODY_COLUMN_NAME}\u2026` }) : stored.trim() !== "" ? /* @__PURE__ */ jsx116(SafeMarkdown, { text: stored }) : null,
34777
34818
  saving.phase === "refused" ? /* @__PURE__ */ jsx116(RefusalNotice, { error: saving.error }) : null
@@ -34805,7 +34846,7 @@ function AddBody({ tableId }) {
34805
34846
  // src/Peek.tsx
34806
34847
  init_parity();
34807
34848
  import { humanizeIdentifier as humanizeIdentifier14 } from "@ai-matrx/kit/text-case";
34808
- import { Fragment as Fragment44, jsx as jsx117, jsxs as jsxs106 } from "react/jsx-runtime";
34849
+ import { Fragment as Fragment43, jsx as jsx117, jsxs as jsxs106 } from "react/jsx-runtime";
34809
34850
  function drawnBelowOnPage(field2, bodyKey) {
34810
34851
  return field2.key === bodyKey || editorKindFor(field2) === "relation";
34811
34852
  }
@@ -34841,54 +34882,76 @@ function Peek({ tableId, recordId, onClose, className, onPage = false }) {
34841
34882
  const title = document2 ? recordNameIn(table.data, document2) : "";
34842
34883
  const bodyKey = onPage ? bodyFieldOf(fields.data ?? [])?.key : void 0;
34843
34884
  const shownFields = (fields.data ?? []).filter((field2) => !onPage || !drawnBelowOnPage(field2, bodyKey));
34844
- const askOpenBelow = onPage && !host.talkToRecord && Boolean(host.chat);
34845
34885
  const href = host.hrefForRecord && table.data ? host.hrefForRecord({ table: table.data, recordId }) : void 0;
34886
+ const canAsk = Boolean(host.talkToRecord) || Boolean(host.chat);
34887
+ const whyNotWrite = !may.write && may.known ? may.why("write") : null;
34888
+ const shownTo = /* @__PURE__ */ jsx117(RowShownTo, { recordId, tableId });
34889
+ const share = organizationId ? /* @__PURE__ */ jsx117(ShareControl, { kind: "record", organizationId, subjectId: recordId, name: title, may: may.share, className: "h-7 px-2 text-xs" }) : null;
34890
+ const ask2 = canAsk ? /* @__PURE__ */ jsx117(
34891
+ Button72,
34892
+ {
34893
+ size: "sm",
34894
+ variant: talking ? "secondary" : "ghost",
34895
+ className: "h-7 px-2 text-xs",
34896
+ title: "Ask about this record",
34897
+ "aria-pressed": host.talkToRecord ? void 0 : talking,
34898
+ ...onPage ? { "data-record-ask": talking ? "shown" : "", "data-record-ask-open": "" } : {},
34899
+ onClick: () => host.talkToRecord ? host.talkToRecord({ tableId, recordId, title: title || "this record" }) : setTalking((t) => !t),
34900
+ children: "Ask"
34901
+ }
34902
+ ) : null;
34903
+ const alchemy = /* @__PURE__ */ jsx117(
34904
+ AlchemyMenu3,
34905
+ {
34906
+ label: title || "Record",
34907
+ sourceId: `record:${recordId}`,
34908
+ size: "xs",
34909
+ human: () => (fields.data ?? []).map((field2) => `${fieldName(field2)}: ${String(document2?.[field2.key] ?? "")}`).join("\n"),
34910
+ json: () => document2 ?? {},
34911
+ ...host.talkToRecord ? {
34912
+ // AGT-N-9: the same act, in the menu every surface on the platform
34913
+ // already carries, for the person who goes looking there first.
34914
+ referenceActions: [
34915
+ {
34916
+ id: "talk-to-this-record",
34917
+ label: "Talk to this record",
34918
+ run: () => host.talkToRecord?.({ tableId, recordId, title: title || "this record" })
34919
+ }
34920
+ ]
34921
+ } : {}
34922
+ }
34923
+ );
34846
34924
  return /* @__PURE__ */ jsxs106("div", { className: cn57("flex min-w-0 flex-col gap-2 text-xs", className), children: [
34847
- /* @__PURE__ */ jsx117("h3", { className: cn57("break-words font-medium leading-snug", onPage ? "text-2xl font-semibold" : "text-sm"), "data-records-peek-title": "", title, children: record.loading && !document2 ? /* @__PURE__ */ jsx117(Skeleton14, { className: "h-4 w-40" }) : title }),
34848
- /* @__PURE__ */ jsxs106("div", { className: "flex flex-wrap items-center gap-2", children: [
34849
- /* @__PURE__ */ jsx117(
34850
- AlchemyMenu3,
34851
- {
34852
- label: title || "Record",
34853
- sourceId: `record:${recordId}`,
34854
- size: "xs",
34855
- human: () => (fields.data ?? []).map((field2) => `${fieldName(field2)}: ${String(document2?.[field2.key] ?? "")}`).join("\n"),
34856
- json: () => document2 ?? {},
34857
- ...host.talkToRecord ? {
34858
- // AGT-N-9: the same act, in the menu every surface on the platform
34859
- // already carries, for the person who goes looking there first.
34860
- referenceActions: [
34861
- {
34862
- id: "talk-to-this-record",
34863
- label: "Talk to this record",
34864
- run: () => host.talkToRecord?.({ tableId, recordId, title: title || "this record" })
34865
- }
34866
- ]
34867
- } : {}
34868
- }
34869
- ),
34870
- href && !onPage ? /* @__PURE__ */ jsx117("a", { className: "text-primary underline-offset-2 hover:underline", href, children: "Open" }) : null,
34871
- host.talkToRecord ? /* @__PURE__ */ jsx117(
34872
- Button72,
34873
- {
34874
- size: "sm",
34875
- variant: "outline",
34876
- onClick: () => host.talkToRecord?.({ tableId, recordId, title: title || "this record" }),
34877
- children: "Talk to this record"
34878
- }
34879
- ) : host.chat && !askOpenBelow ? /* @__PURE__ */ jsx117(Button72, { size: "sm", variant: talking ? "ghost" : "outline", onClick: () => setTalking((t) => !t), children: talking ? "Close chat" : "Talk to this record" }) : null,
34880
- organizationId ? /* @__PURE__ */ jsx117(ShareControl, { kind: "record", organizationId, subjectId: recordId, name: title, may: may.share }) : null,
34881
- /* @__PURE__ */ jsx117(RowShownTo, { recordId, tableId }),
34882
- !may.write && may.known && may.why("write") ? (
34883
- // Absent AND explained: no Edit button, and one sentence saying what
34884
- // it would take and who can give it.
34885
- /* @__PURE__ */ jsx117("span", { className: "max-w-[18rem] text-[11px] text-muted-foreground", children: may.why("write") })
34886
- ) : null,
34887
- onClose ? /* @__PURE__ */ jsx117(Button72, { size: "sm", variant: "ghost", className: "ml-auto", onClick: onClose, "aria-label": "Close", children: "\xD7" }) : null
34925
+ onPage ? (
34926
+ // THE PAGE'S TITLE LINE: the whole name (wrapped, never cut) and its actions to the right; on a
34927
+ // narrow column the actions take the line under it, left-aligned with the name.
34928
+ /* @__PURE__ */ jsxs106("div", { className: "@container", "data-records-peek-head": "page", children: [
34929
+ /* @__PURE__ */ jsxs106("div", { className: "flex flex-col gap-2 @xl:flex-row @xl:items-start @xl:gap-4", children: [
34930
+ /* @__PURE__ */ jsx117("h1", { className: "min-w-0 flex-1 break-words text-2xl font-semibold leading-tight", "data-records-peek-title": "", title, children: record.loading && !document2 ? /* @__PURE__ */ jsx117(Skeleton14, { className: "h-7 w-56" }) : title }),
34931
+ /* @__PURE__ */ jsxs106("div", { className: "flex min-h-7 shrink-0 flex-wrap items-center gap-1 @xl:mt-0.5 @xl:justify-end", "data-records-peek-actions": "", children: [
34932
+ shownTo,
34933
+ share,
34934
+ ask2,
34935
+ alchemy
34936
+ ] })
34937
+ ] }),
34938
+ whyNotWrite ? /* @__PURE__ */ jsx117("p", { className: "mt-1 text-[11px] text-muted-foreground", children: whyNotWrite }) : null
34939
+ ] })
34940
+ ) : /* @__PURE__ */ jsxs106(Fragment43, { children: [
34941
+ /* @__PURE__ */ jsx117("h3", { className: "break-words text-sm font-medium leading-snug", "data-records-peek-title": "", title, children: record.loading && !document2 ? /* @__PURE__ */ jsx117(Skeleton14, { className: "h-4 w-40" }) : title }),
34942
+ /* @__PURE__ */ jsxs106("div", { className: "flex min-h-7 flex-wrap items-center gap-1", "data-records-peek-actions": "", children: [
34943
+ alchemy,
34944
+ href ? /* @__PURE__ */ jsx117("a", { className: "inline-flex h-7 items-center rounded px-2 text-xs text-primary underline-offset-2 hover:underline", href, children: "Open" }) : null,
34945
+ share,
34946
+ ask2,
34947
+ shownTo,
34948
+ onClose ? /* @__PURE__ */ jsx117(Button72, { size: "sm", variant: "ghost", className: "ml-auto h-7 w-7 p-0", onClick: onClose, "aria-label": "Close", children: "\xD7" }) : null
34949
+ ] }),
34950
+ whyNotWrite ? /* @__PURE__ */ jsx117("p", { className: "text-[11px] text-muted-foreground", children: whyNotWrite }) : null
34888
34951
  ] }),
34889
34952
  /* @__PURE__ */ jsx117(Separator9, {}),
34890
- talking && host.chat ? /* @__PURE__ */ jsxs106(Fragment44, { children: [
34891
- /* @__PURE__ */ jsx117(RecordChat, { tableId, recordId, className: "min-h-[22rem]" }),
34953
+ talking && host.chat ? /* @__PURE__ */ jsxs106(Fragment43, { children: [
34954
+ /* @__PURE__ */ jsx117("section", { "data-record-ask": onPage ? "open" : void 0, className: "min-w-0", children: /* @__PURE__ */ jsx117(RecordChat, { tableId, recordId, className: "min-h-[22rem]" }) }),
34892
34955
  /* @__PURE__ */ jsx117(Separator9, {})
34893
34956
  ] }) : null,
34894
34957
  fields.data && document2 && may.write ? /* @__PURE__ */ jsx117(
@@ -34903,7 +34966,7 @@ function Peek({ tableId, recordId, onClose, className, onPage = false }) {
34903
34966
  whyNot: may.why("write") ?? void 0,
34904
34967
  reload: () => record.reload(),
34905
34968
  className: cn57("grid grid-cols-[minmax(6rem,12rem)_1fr] gap-x-3 gap-y-0.5", onPage && "text-sm"),
34906
- renderLabel: (field2) => /* @__PURE__ */ jsxs106(Fragment44, { children: [
34969
+ renderLabel: (field2) => /* @__PURE__ */ jsxs106(Fragment43, { children: [
34907
34970
  fieldName(field2),
34908
34971
  /* @__PURE__ */ jsx117(ProvenanceBadge, { document: document2, fieldKey: field2.key }),
34909
34972
  /* @__PURE__ */ jsx117(ValueAlternates, { recordId, field: field2, document: document2, canWrite: may.write, onChosen: () => record.reload() })
@@ -34935,11 +34998,11 @@ function Peek({ tableId, recordId, onClose, className, onPage = false }) {
34935
34998
  }
34936
34999
  ),
34937
35000
  onPage ? null : /* @__PURE__ */ jsx117(ReverseLinksSections, { tableId, recordId }),
34938
- record.data?.computedUnavailable ? /* @__PURE__ */ jsxs106(Fragment44, { children: [
35001
+ record.data?.computedUnavailable ? /* @__PURE__ */ jsxs106(Fragment43, { children: [
34939
35002
  /* @__PURE__ */ jsx117(Separator9, {}),
34940
35003
  /* @__PURE__ */ jsx117("p", { className: "text-muted-foreground", children: "Nothing here can say which columns the system worked out for itself: that part of the record is not readable from your seat. Everything above is the record as it stands." })
34941
35004
  ] }) : null,
34942
- computedShown.length ? /* @__PURE__ */ jsxs106(Fragment44, { children: [
35005
+ computedShown.length ? /* @__PURE__ */ jsxs106(Fragment43, { children: [
34943
35006
  /* @__PURE__ */ jsx117(Separator9, {}),
34944
35007
  /* @__PURE__ */ jsxs106("div", { className: "flex flex-col gap-1", children: [
34945
35008
  /* @__PURE__ */ jsx117("span", { className: "font-medium", children: "Worked out by the system" }),
@@ -35169,7 +35232,7 @@ import { useRecordsClient as useRecordsClient67 } from "@ai-matrx/records/react"
35169
35232
  init_plainWords();
35170
35233
  init_recordVersions();
35171
35234
  import { Button as Button73 } from "@ai-matrx/design-system";
35172
- import { Fragment as Fragment45, jsx as jsx118, jsxs as jsxs107 } from "react/jsx-runtime";
35235
+ import { Fragment as Fragment44, jsx as jsx118, jsxs as jsxs107 } from "react/jsx-runtime";
35173
35236
  async function moveRecordValue(client, recordId, patch, expectedVersion) {
35174
35237
  const written = await (0, recordVersions_exports.updateRecordAt)(client, { record_id: recordId, patch, version: expectedVersion });
35175
35238
  return written.ok ? { ok: true, version: typeof written.data === "number" ? written.data : null } : { ok: false, error: written.error };
@@ -35323,7 +35386,7 @@ function useRecordMoves({
35323
35386
  versions.refresh([id]);
35324
35387
  onMoved?.();
35325
35388
  }, [versions, stale, onMoved]);
35326
- const notice = /* @__PURE__ */ jsxs107(Fragment45, { children: [
35389
+ const notice = /* @__PURE__ */ jsxs107(Fragment44, { children: [
35327
35390
  /* @__PURE__ */ jsx118(UndoNotice, { undo }),
35328
35391
  stale ? /* @__PURE__ */ jsxs107(
35329
35392
  "p",
@@ -35389,7 +35452,7 @@ init_names();
35389
35452
  // src/CardDates.tsx
35390
35453
  init_names();
35391
35454
  init_parity();
35392
- import { Fragment as Fragment46, jsx as jsx119, jsxs as jsxs108 } from "react/jsx-runtime";
35455
+ import { Fragment as Fragment45, jsx as jsx119, jsxs as jsxs108 } from "react/jsx-runtime";
35393
35456
  function cardDateFields(all, titleField, hiddenFields) {
35394
35457
  const hidden = new Set(hiddenFields ?? []);
35395
35458
  return all.filter(
@@ -35404,7 +35467,7 @@ function CardDates({ record, fields }) {
35404
35467
  return value !== null && value !== void 0 && value !== "";
35405
35468
  });
35406
35469
  if (held.length === 0) return null;
35407
- return /* @__PURE__ */ jsx119(Fragment46, { children: held.map((field2) => /* @__PURE__ */ jsxs108(
35470
+ return /* @__PURE__ */ jsx119(Fragment45, { children: held.map((field2) => /* @__PURE__ */ jsxs108(
35408
35471
  "span",
35409
35472
  {
35410
35473
  className: "mt-0.5 flex min-w-0 items-baseline gap-1 text-[11px] text-muted-foreground",
@@ -36353,7 +36416,7 @@ function lookupTargets(all) {
36353
36416
  }
36354
36417
 
36355
36418
  // src/CalendarView.tsx
36356
- import { Fragment as Fragment47, jsx as jsx122, jsxs as jsxs111 } from "react/jsx-runtime";
36419
+ import { Fragment as Fragment46, jsx as jsx122, jsxs as jsxs111 } from "react/jsx-runtime";
36357
36420
  var DRAG_TYPE = "application/x-records-card";
36358
36421
  var NONE = "__none__";
36359
36422
  var HOUR_PX = 44;
@@ -36828,7 +36891,7 @@ function CalendarView({
36828
36891
  ] })
36829
36892
  ] })
36830
36893
  ] });
36831
- const pickers = all.length > 0 ? /* @__PURE__ */ jsxs111(Fragment47, { children: [
36894
+ const pickers = all.length > 0 ? /* @__PURE__ */ jsxs111(Fragment46, { children: [
36832
36895
  otherDates.length > 0 || endUnusual ? picker("End", endField?.key ?? null, otherDates, (key) => {
36833
36896
  setEndPick(key);
36834
36897
  onEndFieldChange?.(key);
@@ -36840,7 +36903,7 @@ function CalendarView({
36840
36903
  ] }) : null;
36841
36904
  const toolbar = /* @__PURE__ */ jsxs111("div", { className: "flex flex-wrap items-center gap-2", children: [
36842
36905
  /* @__PURE__ */ jsx122(Button75, { size: "sm", variant: "outline", onClick: () => setAnchor(today), children: "Today" }),
36843
- mode !== "list" ? /* @__PURE__ */ jsxs111(Fragment47, { children: [
36906
+ mode !== "list" ? /* @__PURE__ */ jsxs111(Fragment46, { children: [
36844
36907
  /* @__PURE__ */ jsx122(Button75, { size: "sm", variant: "ghost", "aria-label": "Previous", onClick: () => step2(-1), children: "\u2039" }),
36845
36908
  /* @__PURE__ */ jsx122(Button75, { size: "sm", variant: "ghost", "aria-label": "Next", onClick: () => step2(1), children: "\u203A" }),
36846
36909
  /* @__PURE__ */ jsx122("h3", { className: "text-sm font-medium", "data-calendar-heading": "", children: heading })
@@ -36883,7 +36946,7 @@ function CalendarView({
36883
36946
  card: (p, key) => listCard(p, key),
36884
36947
  bar: (p, key) => /* @__PURE__ */ jsxs111("div", { ...dragSource(p.row), className: "relative h-full", children: [
36885
36948
  cardFace(p.row, null, "h-full"),
36886
- endField && canMove(p.row) ? /* @__PURE__ */ jsxs111(Fragment47, { children: [
36949
+ endField && canMove(p.row) ? /* @__PURE__ */ jsxs111(Fragment46, { children: [
36887
36950
  /* @__PURE__ */ jsx122("span", { role: "separator", "aria-label": "Drag to change the start", "data-calendar-edge": "start", className: "absolute inset-y-0 left-0 w-1.5 cursor-ew-resize", onPointerDown: beginStretch(p.row, p, "start") }),
36888
36951
  /* @__PURE__ */ jsx122("span", { role: "separator", "aria-label": "Drag to change the end", "data-calendar-edge": "end", className: "absolute inset-y-0 right-0 w-1.5 cursor-ew-resize", onPointerDown: beginStretch(p.row, p, "end") })
36889
36952
  ] }) : null
@@ -36920,7 +36983,7 @@ function CalendarView({
36920
36983
  today,
36921
36984
  timeDrop,
36922
36985
  onSlotPointerDown: creates ? beginSelect : void 0,
36923
- overlay: (d) => /* @__PURE__ */ jsxs111(Fragment47, { children: [
36986
+ overlay: (d) => /* @__PURE__ */ jsxs111(Fragment46, { children: [
36924
36987
  ghost && ghost.day === d && ghost.minute !== null ? /* @__PURE__ */ jsx122(
36925
36988
  "div",
36926
36989
  {
@@ -37320,7 +37383,7 @@ function taskListDay(day2, withYear) {
37320
37383
  }
37321
37384
 
37322
37385
  // src/TimelineView.tsx
37323
- import { Fragment as Fragment48, jsx as jsx123, jsxs as jsxs112 } from "react/jsx-runtime";
37386
+ import { Fragment as Fragment47, jsx as jsx123, jsxs as jsxs112 } from "react/jsx-runtime";
37324
37387
  var TIMELINE_ZOOMS = ["day", "week", "month", "quarter"];
37325
37388
  var ZOOM_LABEL = { day: "Day", week: "Week", month: "Month", quarter: "Quarter" };
37326
37389
  var PX_PER_DAY = { day: 96, week: 32, month: 10, quarter: 4 };
@@ -38023,7 +38086,7 @@ function TimelineView({
38023
38086
  startTime ? /* @__PURE__ */ jsx123("span", { className: "mr-1 tabular-nums text-[10px] opacity-75", "data-timeline-time": "", children: startTime }) : null,
38024
38087
  title
38025
38088
  ] })
38026
- ) : /* @__PURE__ */ jsxs112(Fragment48, { children: [
38089
+ ) : /* @__PURE__ */ jsxs112(Fragment47, { children: [
38027
38090
  startTime ? /* @__PURE__ */ jsx123("span", { className: "shrink-0 tabular-nums text-[10px] opacity-75", "data-timeline-time": "", children: startTime }) : null,
38028
38091
  /* @__PURE__ */ jsx123("span", { className: "min-w-0 truncate", children: title }),
38029
38092
  /* @__PURE__ */ jsx123(CardFieldsInline, { row: p.row, fields: cardFields })
@@ -38054,7 +38117,7 @@ function TimelineView({
38054
38117
  ] })
38055
38118
  ] })
38056
38119
  ] });
38057
- const settings = /* @__PURE__ */ jsxs112(Fragment48, { children: [
38120
+ const settings = /* @__PURE__ */ jsxs112(Fragment47, { children: [
38058
38121
  dates.length > 1 || !startField || !dates.some((f) => f.key === startChosen) ? picker("Start", startChosen, dates, (key) => setting({ startKey: key }), { none: false }) : null,
38059
38122
  endCandidates.length > 0 || endField && !endCandidates.includes(endField) ? picker("End", endChosen, endCandidates, (key) => setting({ endKey: key }), { kept: layoutKept }) : null,
38060
38123
  groupCandidates.length > 0 ? picker("Group by", groupChosen, groupCandidates, (key) => setting({ groupKey: key })) : null,
@@ -38073,7 +38136,7 @@ function TimelineView({
38073
38136
  /* @__PURE__ */ jsx123(DropdownMenuTrigger8, { asChild: true, children: /* @__PURE__ */ jsx123(Button76, { size: "sm", variant: "outline", className: ganttOn ? "bg-secondary" : void 0, title: "Gantt options", "data-timeline-gantt-menu": "", children: "Gantt" }) }),
38074
38137
  /* @__PURE__ */ jsxs112(DropdownMenuContent8, { align: "end", className: "min-w-48", children: [
38075
38138
  /* @__PURE__ */ jsx123(DropdownMenuCheckboxItem2, { checked: ganttOn, onCheckedChange: (on) => setGantt({ mode: on === true }), children: "Gantt view" }),
38076
- ganttOn ? /* @__PURE__ */ jsxs112(Fragment48, { children: [
38139
+ ganttOn ? /* @__PURE__ */ jsxs112(Fragment47, { children: [
38077
38140
  /* @__PURE__ */ jsx123(DropdownMenuSeparator4, {}),
38078
38141
  depField ? /* @__PURE__ */ jsx123(DropdownMenuCheckboxItem2, { checked: g.critical === true, onCheckedChange: (on) => setGantt({ critical: on === true }), children: "Critical path" }) : /* @__PURE__ */ jsx123(DropdownMenuItem7, { onSelect: () => void addDependencyField(), children: "Add dependencies" }),
38079
38142
  /* @__PURE__ */ jsx123(DropdownMenuItem7, { disabled: ganttBusy, onSelect: () => void saveBaseline(), children: "Save baseline" }),
@@ -38480,7 +38543,7 @@ import { useEffect as useEffect86, useState as useState104 } from "react";
38480
38543
  import { useOptionalRecordsClient as useOptionalRecordsClient18 } from "@ai-matrx/records/react";
38481
38544
  init_host();
38482
38545
  init_parity();
38483
- import { Fragment as Fragment49, jsx as jsx125 } from "react/jsx-runtime";
38546
+ import { Fragment as Fragment48, jsx as jsx125 } from "react/jsx-runtime";
38484
38547
  function isImageAddress(value) {
38485
38548
  return typeof value === "string" && /^(https?:\/\/|\/|data:image\/)/i.test(value.trim());
38486
38549
  }
@@ -38526,7 +38589,7 @@ function FileCover({ recordId }) {
38526
38589
  if (!host.fileImage) {
38527
38590
  return /* @__PURE__ */ jsx125("span", { className: "flex h-full w-full items-center justify-center p-1 text-center text-[10px] text-muted-foreground", children: COVER_NOT_DRAWN });
38528
38591
  }
38529
- return /* @__PURE__ */ jsx125(Fragment49, { children: host.fileImage({ fileId: read.fileId, alt: read.name }) });
38592
+ return /* @__PURE__ */ jsx125(Fragment48, { children: host.fileImage({ fileId: read.fileId, alt: read.name }) });
38530
38593
  }
38531
38594
 
38532
38595
  // src/board.ts
@@ -39344,7 +39407,7 @@ function ChartLegendContent({
39344
39407
  }
39345
39408
 
39346
39409
  // src/ChartBlock.tsx
39347
- import { Fragment as Fragment50, jsx as jsx129, jsxs as jsxs117 } from "react/jsx-runtime";
39410
+ import { Fragment as Fragment49, jsx as jsx129, jsxs as jsxs117 } from "react/jsx-runtime";
39348
39411
  var priorKey = (key) => `prior__${key}`;
39349
39412
  function Trend({ pct, aimingUp, className }) {
39350
39413
  if (pct === null || pct === void 0) return null;
@@ -39511,7 +39574,7 @@ function ChartBlock({ block, subject, tableName: tableName2, className, centerVa
39511
39574
  ] }),
39512
39575
  block.compare_refused ? /* @__PURE__ */ jsx129("p", { className: "px-1 text-xs text-muted-foreground", children: block.compare_refused }) : null,
39513
39576
  !block.refused && targetNote(target) ? /* @__PURE__ */ jsx129("p", { className: "px-1 text-xs text-muted-foreground", children: targetNote(target) }) : null,
39514
- block.refused ? /* @__PURE__ */ jsx129(RefusalNotice, { error: asRefusal2(block) }) : needs ? /* @__PURE__ */ jsx129("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: needs }) : kind2 === "stuck" ? /* @__PURE__ */ jsx129(StuckList, { rows: block.rows ?? [] }) : points.length === 0 ? /* @__PURE__ */ jsx129("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: "The store answered this question with no groups at all, so there is nothing to draw yet." }) : /* @__PURE__ */ jsx129(Fragment50, { children: kind2 === "number" ? /* @__PURE__ */ jsx129(BigNumber, { points, measure: primary, onDrill: drill, block }) : kind2 === "table" ? /* @__PURE__ */ jsx129(GroupTable, { points, series, onDrill: drill }) : /* @__PURE__ */ jsxs117(Fragment50, { children: [
39577
+ block.refused ? /* @__PURE__ */ jsx129(RefusalNotice, { error: asRefusal2(block) }) : needs ? /* @__PURE__ */ jsx129("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: needs }) : kind2 === "stuck" ? /* @__PURE__ */ jsx129(StuckList, { rows: block.rows ?? [] }) : points.length === 0 ? /* @__PURE__ */ jsx129("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: "The store answered this question with no groups at all, so there is nothing to draw yet." }) : /* @__PURE__ */ jsx129(Fragment49, { children: kind2 === "number" ? /* @__PURE__ */ jsx129(BigNumber, { points, measure: primary, onDrill: drill, block }) : kind2 === "table" ? /* @__PURE__ */ jsx129(GroupTable, { points, series, onDrill: drill }) : /* @__PURE__ */ jsxs117(Fragment49, { children: [
39515
39578
  /* @__PURE__ */ jsx129(
39516
39579
  Drawing,
39517
39580
  {
@@ -39542,7 +39605,7 @@ function BigNumber({
39542
39605
  const windows = block.compare ?? null;
39543
39606
  const target = block.target ?? null;
39544
39607
  const priorTotal = block.totals?.prior;
39545
- const body = /* @__PURE__ */ jsxs117(Fragment50, { children: [
39608
+ const body = /* @__PURE__ */ jsxs117(Fragment49, { children: [
39546
39609
  /* @__PURE__ */ jsxs117("span", { className: "flex items-baseline gap-2", children: [
39547
39610
  /* @__PURE__ */ jsx129("span", { className: "text-2xl font-semibold tabular-nums", children: pretty(total) }),
39548
39611
  windows ? /* @__PURE__ */ jsx129(Trend, { pct: block.totals?.change_pct, aimingUp: !!target, className: "text-sm" }) : null
@@ -39586,7 +39649,7 @@ function Values({
39586
39649
  aimingUp
39587
39650
  }) {
39588
39651
  return /* @__PURE__ */ jsx129("ul", { className: "flex flex-wrap gap-x-2 gap-y-0.5", children: points.map((point, at) => {
39589
- const text = /* @__PURE__ */ jsxs117(Fragment50, { children: [
39652
+ const text = /* @__PURE__ */ jsxs117(Fragment49, { children: [
39590
39653
  /* @__PURE__ */ jsx129(
39591
39654
  "span",
39592
39655
  {
@@ -39815,10 +39878,10 @@ function Drawing({
39815
39878
  margin: { top: 6, right: 6, bottom: 0, left: 0 },
39816
39879
  children: [
39817
39880
  /* @__PURE__ */ jsx129(CartesianGrid, { vertical: horizontal, horizontal: !horizontal }),
39818
- horizontal ? /* @__PURE__ */ jsxs117(Fragment50, { children: [
39881
+ horizontal ? /* @__PURE__ */ jsxs117(Fragment49, { children: [
39819
39882
  /* @__PURE__ */ jsx129(XAxis, { type: "number", ...axis }),
39820
39883
  /* @__PURE__ */ jsx129(YAxis, { type: "category", dataKey: "label", width: 96, ...axis, tick: /* @__PURE__ */ jsx129(WrappedTick, { across: true, perLine: 15 }) })
39821
- ] }) : /* @__PURE__ */ jsxs117(Fragment50, { children: [
39884
+ ] }) : /* @__PURE__ */ jsxs117(Fragment49, { children: [
39822
39885
  /* @__PURE__ */ jsx129(XAxis, { dataKey: "label", ...axis, interval: 0, height: 40, tick: /* @__PURE__ */ jsx129(WrappedTick, { perLine: Math.max(6, Math.floor(width / Math.max(points.length, 1) / 6)) }) }),
39823
39886
  /* @__PURE__ */ jsx129(YAxis, { width: 44, ...axis })
39824
39887
  ] }),
@@ -39952,7 +40015,7 @@ function ChartLayout({ view, fields, filter, onChange, remembered }) {
39952
40015
  }
39953
40016
 
39954
40017
  // src/ViewSwitcher.tsx
39955
- import { Fragment as Fragment51, jsx as jsx131, jsxs as jsxs119 } from "react/jsx-runtime";
40018
+ import { Fragment as Fragment50, jsx as jsx131, jsxs as jsxs119 } from "react/jsx-runtime";
39956
40019
  var NO_FIELDS2 = [];
39957
40020
  function useViewRecords(view, pageSize = 200, filter, viewId) {
39958
40021
  const client = useRecordsClient71();
@@ -40933,7 +40996,7 @@ function MaybeRecordActionMenu({
40933
40996
  children,
40934
40997
  ...rest
40935
40998
  }) {
40936
- if (!tableId) return /* @__PURE__ */ jsx131(Fragment51, { children });
40999
+ if (!tableId) return /* @__PURE__ */ jsx131(Fragment50, { children });
40937
41000
  return /* @__PURE__ */ jsx131(RecordActionMenu, { tableId, ...rest, children });
40938
41001
  }
40939
41002
  function GallerySizeControl({
@@ -41105,7 +41168,7 @@ function RecordCard({
41105
41168
  },
41106
41169
  title: withheld ?? label,
41107
41170
  ...withheld && field2 ? { "data-records-withheld": field2.key } : {},
41108
- children: dates && dates.length > 0 || fields && fields.length > 0 || parentName ? /* @__PURE__ */ jsxs119(Fragment51, { children: [
41171
+ children: dates && dates.length > 0 || fields && fields.length > 0 || parentName ? /* @__PURE__ */ jsxs119(Fragment50, { children: [
41109
41172
  /* @__PURE__ */ jsx131("span", { className: "block truncate", children: label }),
41110
41173
  parentName ? /* @__PURE__ */ jsx131("span", { className: "block truncate text-muted-foreground", "data-records-card-parent": parentId ?? "", children: `Sub-item of ${parentName}` }) : null,
41111
41174
  dates && dates.length > 0 ? /* @__PURE__ */ jsx131(CardDates, { record, fields: dates }) : null,
@@ -41614,7 +41677,7 @@ function settingsToCopy(source, target) {
41614
41677
  // src/ViewBar.tsx
41615
41678
  init_objectActions();
41616
41679
  init_objectActionIcons();
41617
- import { Fragment as Fragment52, jsx as jsx134, jsxs as jsxs122 } from "react/jsx-runtime";
41680
+ import { Fragment as Fragment51, jsx as jsx134, jsxs as jsxs122 } from "react/jsx-runtime";
41618
41681
  var SAVED_VIEWS_UNAVAILABLE = "Saved views are not available in this organization right now, so the layout you pick here is not being kept. Everything else on this table works as usual.";
41619
41682
  var VIEW_CHIP_BOX = "h-8 w-32 shrink-0";
41620
41683
  function seedIsSatisfied(seed, views) {
@@ -41983,7 +42046,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
41983
42046
  ]
41984
42047
  }
41985
42048
  ),
41986
- rights.admin ? /* @__PURE__ */ jsxs122(Fragment52, { children: [
42049
+ rights.admin ? /* @__PURE__ */ jsxs122(Fragment51, { children: [
41987
42050
  /* @__PURE__ */ jsx134(ControlButton, { variant: "quiet", className: "shrink-0 normal-case", "data-view-section-rename": "", onClick: () => setRenamingSection({ from: group.name, draft: group.name }), children: "Rename" }),
41988
42051
  /* @__PURE__ */ jsx134(ControlButton, { variant: "danger", className: "shrink-0 normal-case", "data-view-section-delete": "", title: "The views stay; they leave the section", onClick: () => void renameSection(group.name, null), children: "Delete" })
41989
42052
  ] }) : null
@@ -42001,7 +42064,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
42001
42064
  setOpen(false);
42002
42065
  },
42003
42066
  title: /* @__PURE__ */ jsx134("span", { title: view.ruleId ? "Membership is this view's Rule" : "The whole table", children: view.name }),
42004
- end: /* @__PURE__ */ jsxs122(Fragment52, { children: [
42067
+ end: /* @__PURE__ */ jsxs122(Fragment51, { children: [
42005
42068
  view.presentation?.locked === true ? /* @__PURE__ */ jsx134(Badge16, { variant: "neutral", className: "shrink-0 px-1.5 py-0 text-[10px]", "data-view-locked": "", title: VIEW_LOCKED_REASON, children: "Locked" }) : null,
42006
42069
  view.personal ? /* @__PURE__ */ jsx134(Badge16, { variant: "neutral", className: "shrink-0 px-1.5 py-0 text-[10px]", "data-view-personal": "", title: "Only you see this view", children: "Personal" }) : null,
42007
42070
  view.isDefault ? /* @__PURE__ */ jsx134(Badge16, { variant: "neutral", className: "shrink-0 px-1.5 py-0 text-[10px]", "data-view-default": "", children: "Default" }) : null
@@ -42116,7 +42179,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
42116
42179
  ...(views ?? []).length > 1 ? { copySettings: () => setCopying(true) } : {}
42117
42180
  }, current.presentation?.locked === true, current.personal === true);
42118
42181
  const reasons = viewActionReasons(actions);
42119
- return /* @__PURE__ */ jsxs122(Fragment52, { children: [
42182
+ return /* @__PURE__ */ jsxs122(Fragment51, { children: [
42120
42183
  reasons.map((reason) => /* @__PURE__ */ jsx134("p", { className: "truncate px-2 py-1 text-xs text-muted-foreground", "data-view-actions-reason": "", title: reason, children: reason }, reason)),
42121
42184
  actions.map((action3) => /* @__PURE__ */ jsx134(
42122
42185
  Tile2,
@@ -42267,7 +42330,7 @@ import { useRecordsClient as useRecordsClient76, useTable as useTable24 } from "
42267
42330
  import { Badge as Badge18, BasicInput as BasicInput22, BasicTextarea as BasicTextarea9, Button as Button83, Skeleton as Skeleton19, cn as cn69 } from "@ai-matrx/design-system";
42268
42331
  import { Select as Select20 } from "@ai-matrx/design-system/controls";
42269
42332
  import { humanizeIdentifier as humanizeIdentifier16 } from "@ai-matrx/kit/text-case";
42270
- import { Fragment as Fragment53, jsx as jsx136, jsxs as jsxs124 } from "react/jsx-runtime";
42333
+ import { Fragment as Fragment52, jsx as jsx136, jsxs as jsxs124 } from "react/jsx-runtime";
42271
42334
  var DUE_WORD = DUE_STATE_LABEL;
42272
42335
  var REQUIRES_WORD = CHECKLIST_REQUIREMENT_LABEL;
42273
42336
  var NO_TEMPLATES = "No checklists yet.";
@@ -42278,6 +42341,7 @@ function ChecklistRunner({
42278
42341
  runId,
42279
42342
  includeClosed = false,
42280
42343
  offerToStart,
42344
+ quietWhenEmpty = false,
42281
42345
  className
42282
42346
  }) {
42283
42347
  const client = useRecordsClient76();
@@ -42403,6 +42467,10 @@ function ChecklistRunner({
42403
42467
  [runs, activeId]
42404
42468
  );
42405
42469
  if (table.error) return /* @__PURE__ */ jsx136(RefusalNotice, { error: table.error, className });
42470
+ if (quietWhenEmpty && !runId) {
42471
+ const startable = mayStart && rights.write && (templates?.length ?? 0) > 0;
42472
+ if (runs === null || runs.length === 0 && !startable && !error && !said2) return null;
42473
+ }
42406
42474
  if (runs === null && steps === null && !runId) {
42407
42475
  return /* @__PURE__ */ jsx136(Skeleton19, { shape: "block", height: "sm", className });
42408
42476
  }
@@ -42429,7 +42497,7 @@ function ChecklistRunner({
42429
42497
  ] }),
42430
42498
  error ? /* @__PURE__ */ jsx136(RefusalNotice, { error }) : null,
42431
42499
  said2 ? /* @__PURE__ */ jsx136("p", { className: "text-xs text-muted-foreground", children: said2 }) : null,
42432
- active === null && runs !== null && runs.length === 0 ? /* @__PURE__ */ jsx136("p", { className: "text-xs text-muted-foreground", "data-testid": "checklist-empty", children: mayStart && templates && templates.length === 0 ? NO_TEMPLATES : NOTHING_RUNNING }) : null,
42500
+ !quietWhenEmpty && active === null && runs !== null && runs.length === 0 ? /* @__PURE__ */ jsx136("p", { className: "text-xs text-muted-foreground", "data-testid": "checklist-empty", children: mayStart && templates && templates.length === 0 ? NO_TEMPLATES : NOTHING_RUNNING }) : null,
42433
42501
  steps === null ? null : steps.length === 0 && active ? /* @__PURE__ */ jsx136("p", { className: "text-xs text-muted-foreground", children: "No steps to show." }) : /* @__PURE__ */ jsx136("ol", { className: "flex min-h-0 flex-col gap-1.5 overflow-y-auto", "data-testid": "checklist-steps", children: (steps ?? []).map((step2) => /* @__PURE__ */ jsx136(
42434
42502
  StepRow,
42435
42503
  {
@@ -42737,7 +42805,7 @@ function ChecklistsPanel({ tableId, onOpenRecord, className }) {
42737
42805
  /* @__PURE__ */ jsxs124("p", { className: "mt-1 text-xs", children: [
42738
42806
  /* @__PURE__ */ jsx136("span", { className: "font-medium", children: t.steps }),
42739
42807
  " steps",
42740
- t.roles > 0 ? /* @__PURE__ */ jsxs124(Fragment53, { children: [
42808
+ t.roles > 0 ? /* @__PURE__ */ jsxs124(Fragment52, { children: [
42741
42809
  " \xB7 ",
42742
42810
  /* @__PURE__ */ jsx136("span", { className: "font-medium", children: t.roles }),
42743
42811
  " roles"
@@ -42762,7 +42830,7 @@ function ChecklistsPanel({ tableId, onOpenRecord, className }) {
42762
42830
  }
42763
42831
  ) : null
42764
42832
  ] }, t.template_id)) }),
42765
- runs && runs.length > 0 ? /* @__PURE__ */ jsxs124(Fragment53, { children: [
42833
+ runs && runs.length > 0 ? /* @__PURE__ */ jsxs124(Fragment52, { children: [
42766
42834
  /* @__PURE__ */ jsx136("h4", { className: "text-xs font-medium text-muted-foreground", children: "Runs" }),
42767
42835
  /* @__PURE__ */ jsx136("ul", { className: "flex flex-col gap-1.5", "data-testid": "checklist-runs", children: runs.map((run) => /* @__PURE__ */ jsxs124("li", { className: "rounded border p-2 text-xs", children: [
42768
42836
  /* @__PURE__ */ jsxs124("div", { className: "flex items-center gap-2", children: [
@@ -43056,7 +43124,7 @@ function roleKey(said2) {
43056
43124
 
43057
43125
  // src/ActionInbox.tsx
43058
43126
  init_enumLabels();
43059
- import { Fragment as Fragment54, jsx as jsx137, jsxs as jsxs125 } from "react/jsx-runtime";
43127
+ import { Fragment as Fragment53, jsx as jsx137, jsxs as jsxs125 } from "react/jsx-runtime";
43060
43128
  var ACTION_KINDS = ["approval", "assignment", "proposal"];
43061
43129
  var KIND_WORD2 = WORK_INBOX_KIND_LABEL;
43062
43130
  var DUE_WORD2 = DUE_STATE_LABEL;
@@ -43688,7 +43756,7 @@ function ActionInbox({
43688
43756
  /* @__PURE__ */ jsxs125("div", { className: "flex flex-col gap-0.5", "data-testid": "inbox-closed", children: [
43689
43757
  /* @__PURE__ */ jsxs125("p", { className: "text-[11px] text-muted-foreground", children: [
43690
43758
  item.state === "withdrawn" ? item.decided_by_name ? `Withdrawn when ${item.decided_by_name} archived it` : "Withdrawn when what it would change was archived" : `${WORK_APPROVAL_STATE_LABEL[item.state] ?? item.state}${item.decided_by_name ? ` by ${item.decided_by_name}` : ""}`,
43691
- item.decided_at ? /* @__PURE__ */ jsxs125(Fragment54, { children: [
43759
+ item.decided_at ? /* @__PURE__ */ jsxs125(Fragment53, { children: [
43692
43760
  " \xB7 ",
43693
43761
  /* @__PURE__ */ jsx137("time", { dateTime: item.decided_at, children: whenWords2(item.decided_at) })
43694
43762
  ] }) : null
@@ -43878,7 +43946,7 @@ function ActionInbox({
43878
43946
  onSteps,
43879
43947
  actions: (stepId) => {
43880
43948
  const title = items?.find((i) => i.item_id === stepId)?.title ?? "this step";
43881
- return /* @__PURE__ */ jsxs125(Fragment54, { children: [
43949
+ return /* @__PURE__ */ jsxs125(Fragment53, { children: [
43882
43950
  snoozing === stepId ? snoozeChoices().map((c) => /* @__PURE__ */ jsx137(
43883
43951
  Button84,
43884
43952
  {
@@ -43959,7 +44027,7 @@ import { Button as Button85, Skeleton as Skeleton21, cn as cn71 } from "@ai-matr
43959
44027
  import { Button as ControlButton2, Field as ControlField } from "@ai-matrx/design-system/controls";
43960
44028
  import { humanizeIdentifier as humanizeIdentifier17 } from "@ai-matrx/kit/text-case";
43961
44029
  init_names();
43962
- import { Fragment as Fragment55, jsx as jsx138, jsxs as jsxs126 } from "react/jsx-runtime";
44030
+ import { Fragment as Fragment54, jsx as jsx138, jsxs as jsxs126 } from "react/jsx-runtime";
43963
44031
  function endOfDayIso(day2, zone = getPersonTimeZone()) {
43964
44032
  const [y, m, d] = day2.split("-").map(Number);
43965
44033
  if (!zone) return new Date(y, m - 1, d, 23, 59, 59, 999).toISOString();
@@ -44103,7 +44171,7 @@ function AsOfReading({
44103
44171
  }
44104
44172
  return /* @__PURE__ */ jsx138("dl", { className: cn71(box, "grid grid-cols-[minmax(5rem,9rem)_1fr] content-start gap-x-3 gap-y-0.5 p-2 text-[11px]"), "data-records-as-of-reading": "", children: rows.map(({ field: field2, was, now, differs }) => /* @__PURE__ */ jsxs126("div", { className: "contents", "data-as-of-field": field2.key, "data-as-of-differs": differs ? "" : void 0, children: [
44105
44173
  /* @__PURE__ */ jsx138("dt", { className: "truncate text-muted-foreground", title: fieldName(field2) || humanizeIdentifier17(field2.key), children: fieldName(field2) || humanizeIdentifier17(field2.key) }),
44106
- /* @__PURE__ */ jsx138("dd", { className: cn71("min-w-0 truncate", differs && "rounded bg-amber-500/10 px-1"), children: differs ? /* @__PURE__ */ jsxs126(Fragment55, { children: [
44174
+ /* @__PURE__ */ jsx138("dd", { className: cn71("min-w-0 truncate", differs && "rounded bg-amber-500/10 px-1"), children: differs ? /* @__PURE__ */ jsxs126(Fragment54, { children: [
44107
44175
  /* @__PURE__ */ jsx138("span", { className: "font-medium", children: isEmpty2(was) ? "nothing" : scalarText(field2, was) }),
44108
44176
  /* @__PURE__ */ jsx138("span", { className: "mx-1 text-muted-foreground", children: "\u2192" }),
44109
44177
  /* @__PURE__ */ jsx138("span", { className: "text-muted-foreground", children: isEmpty2(now) ? "nothing" : scalarText(field2, now) }),
@@ -44213,7 +44281,7 @@ function MigrationLog({ entries, readError, canUndo, whyNotUndo, onUndone, class
44213
44281
  }
44214
44282
 
44215
44283
  // src/HistoryPanel.tsx
44216
- import { Fragment as Fragment56, jsx as jsx140, jsxs as jsxs128 } from "react/jsx-runtime";
44284
+ import { Fragment as Fragment55, jsx as jsx140, jsxs as jsxs128 } from "react/jsx-runtime";
44217
44285
  function HistoryPanel({ tableId, recordId, onAskAboutField, className }) {
44218
44286
  usePeopleTick();
44219
44287
  const client = useRecordsClient80();
@@ -44229,6 +44297,7 @@ function HistoryPanel({ tableId, recordId, onAskAboutField, className }) {
44229
44297
  const [said2, setSaid] = useState118(null);
44230
44298
  const listRef = useRef56(null);
44231
44299
  const [asOf, setAsOf] = useState118(null);
44300
+ const [lookingBack, setLookingBack] = useState118(false);
44232
44301
  const today = useRecord4(recordId, false, { tableId });
44233
44302
  const changed2 = useRecordChangeRevision(recordId);
44234
44303
  const shape = useMigrationLog(recordId);
@@ -44321,15 +44390,33 @@ function HistoryPanel({ tableId, recordId, onAskAboutField, className }) {
44321
44390
  await load();
44322
44391
  }
44323
44392
  return /* @__PURE__ */ jsxs128("section", { className: cn73("flex min-h-0 flex-col gap-2", className), children: [
44324
- /* @__PURE__ */ jsxs128("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
44393
+ /* @__PURE__ */ jsxs128("div", { className: "flex h-7 items-center gap-2", children: [
44325
44394
  /* @__PURE__ */ jsx140("h3", { className: "text-sm font-medium", children: "History" }),
44326
44395
  /* @__PURE__ */ jsxs128("span", { className: "text-xs text-muted-foreground", children: [
44327
44396
  entries.length,
44328
44397
  " ",
44329
44398
  entries.length === 1 ? "version" : "versions"
44330
44399
  ] }),
44331
- /* @__PURE__ */ jsx140(AsOfControl, { value: asOf, onChange: setAsOf, className: "ml-auto" })
44400
+ /* @__PURE__ */ jsx140(
44401
+ Button87,
44402
+ {
44403
+ size: "sm",
44404
+ variant: lookingBack || asOf ? "secondary" : "ghost",
44405
+ className: "ml-auto h-7 px-2 text-xs",
44406
+ "aria-expanded": lookingBack || asOf !== null,
44407
+ "data-records-as-of-open": "",
44408
+ title: "See this record as it stood on a day",
44409
+ onClick: () => {
44410
+ if (lookingBack || asOf) {
44411
+ setLookingBack(false);
44412
+ setAsOf(null);
44413
+ } else setLookingBack(true);
44414
+ },
44415
+ children: "As of\u2026"
44416
+ }
44417
+ )
44332
44418
  ] }),
44419
+ lookingBack || asOf ? /* @__PURE__ */ jsx140(AsOfControl, { value: asOf, onChange: setAsOf, className: "self-end" }) : null,
44333
44420
  asOf ? /* @__PURE__ */ jsx140(AsOfReading, { recordId, asOf, fields: fields.data ?? [], today: today.data?.document }) : null,
44334
44421
  said2 ? /* @__PURE__ */ jsx140("p", { role: "status", className: "text-xs text-muted-foreground", children: said2 }) : null,
44335
44422
  asOf ? null : entries.length === 0 ? /* @__PURE__ */ jsx140("p", { className: "text-xs text-muted-foreground", children: "Nothing has been recorded about this record yet." }) : /* @__PURE__ */ jsx140(
@@ -44339,7 +44426,7 @@ function HistoryPanel({ tableId, recordId, onAskAboutField, className }) {
44339
44426
  role: "listbox",
44340
44427
  "aria-label": "Versions of this record, newest first",
44341
44428
  "data-records-history-list": "",
44342
- className: "flex max-h-[9.25rem] min-h-0 flex-col divide-y overflow-y-auto rounded border",
44429
+ className: "flex max-h-[13.5rem] min-h-0 flex-col overflow-y-auto",
44343
44430
  onKeyDown: (event) => {
44344
44431
  const at = entries.findIndex((e) => e.version === open);
44345
44432
  if (event.key === "ArrowDown" || event.key === "ArrowUp") {
@@ -44410,102 +44497,109 @@ function VersionRow({
44410
44497
  const canUndo = canRestore && entry.operation !== "insert" && entry.version > 1 && entry.changes.length > 0;
44411
44498
  const undoMine = undo.phase !== "idle" && undo.version === entry.version;
44412
44499
  const undoConfirming = undoMine && undo.phase === "confirm" ? undo : null;
44413
- return /* @__PURE__ */ jsxs128("li", { className: "flex flex-col", children: [
44500
+ return (
44501
+ // The timeline's rule (the li's ::before, from the first dot to the last) and its dot.
44414
44502
  /* @__PURE__ */ jsxs128(
44415
- "div",
44503
+ "li",
44416
44504
  {
44417
- role: "option",
44418
- "aria-selected": expanded,
44419
- "data-version": entry.version,
44420
- tabIndex: 0,
44421
- className: "flex cursor-pointer items-baseline gap-2 px-2 py-1.5 text-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
44422
- onClick: onToggle,
44423
- onKeyDown: (event) => {
44424
- if (event.key === "Enter" || event.key === " ") {
44425
- event.preventDefault();
44426
- onToggle();
44427
- }
44428
- if ((event.key === "r" || event.key === "R") && canRestore) {
44429
- event.preventDefault();
44430
- onRestore(null);
44431
- }
44432
- },
44505
+ className: "relative flex flex-col pl-5 before:absolute before:bottom-0 before:left-[7px] before:top-0 before:w-px before:bg-border first:before:top-3 last:before:bottom-auto last:before:h-3 only:before:hidden",
44506
+ "data-records-history-version": "",
44433
44507
  children: [
44434
- /* @__PURE__ */ jsxs128("span", { className: "w-8 shrink-0 tabular-nums text-muted-foreground", children: [
44435
- "v",
44436
- entry.version
44437
- ] }),
44438
- /* @__PURE__ */ jsx140("span", { className: "shrink-0 font-medium", children: operationWords(entry.operation_label) }),
44439
- /* @__PURE__ */ jsx140(Who, { actor: entry.actor }),
44440
- /* @__PURE__ */ jsxs128("span", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
44441
- /* @__PURE__ */ jsx140(
44442
- "span",
44443
- {
44444
- className: "min-w-0 truncate text-muted-foreground",
44445
- title: entry.changes.length === 0 ? "nothing about the values changed" : entry.changes.map((c) => c.label).join(", "),
44446
- children: entry.changes.length === 0 ? "nothing about the values changed" : entry.changes.map((c) => c.label).join(", ")
44447
- }
44448
- ),
44449
- entry.undoable ? /* @__PURE__ */ jsx140(Badge20, { variant: "secondary", className: "min-w-0 shrink truncate text-[10px]", title: "part of a bigger change", children: "part of a bigger change" }) : null
44450
- ] }),
44451
- /* @__PURE__ */ jsx140(
44452
- "span",
44508
+ /* @__PURE__ */ jsx140("span", { "aria-hidden": "true", className: "absolute left-[4px] top-[9px] size-[7px] rounded-full border border-background bg-muted-foreground" }),
44509
+ /* @__PURE__ */ jsxs128(
44510
+ "div",
44453
44511
  {
44454
- className: "min-w-28 shrink-0 whitespace-nowrap text-right text-muted-foreground",
44455
- title: new Date(entry.occurred_at).toLocaleString(),
44456
- children: whenText(entry.occurred_at)
44512
+ role: "option",
44513
+ "aria-selected": expanded,
44514
+ "data-version": entry.version,
44515
+ tabIndex: 0,
44516
+ className: "flex cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-xs hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring aria-selected:bg-accent/50",
44517
+ onClick: onToggle,
44518
+ onKeyDown: (event) => {
44519
+ if (event.key === "Enter" || event.key === " ") {
44520
+ event.preventDefault();
44521
+ onToggle();
44522
+ }
44523
+ if ((event.key === "r" || event.key === "R") && canRestore) {
44524
+ event.preventDefault();
44525
+ onRestore(null);
44526
+ }
44527
+ },
44528
+ children: [
44529
+ /* @__PURE__ */ jsxs128("span", { className: "flex min-w-0 items-baseline gap-1.5", children: [
44530
+ /* @__PURE__ */ jsx140(Who, { actor: entry.actor }),
44531
+ /* @__PURE__ */ jsx140("span", { className: "shrink-0 text-muted-foreground", children: verbWords(operationWords(entry.operation_label)) }),
44532
+ entry.undoable ? /* @__PURE__ */ jsx140(Badge20, { variant: "secondary", className: "min-w-0 shrink truncate text-[10px]", title: "part of a bigger change", children: "part of a bigger change" }) : null,
44533
+ /* @__PURE__ */ jsxs128("span", { className: "ml-auto flex shrink-0 items-baseline gap-1.5 whitespace-nowrap text-muted-foreground", children: [
44534
+ /* @__PURE__ */ jsxs128("span", { className: "tabular-nums", children: [
44535
+ "v",
44536
+ entry.version
44537
+ ] }),
44538
+ /* @__PURE__ */ jsx140("span", { "aria-hidden": "true", children: "\xB7" }),
44539
+ /* @__PURE__ */ jsx140("span", { title: new Date(entry.occurred_at).toLocaleString(), children: whenText(entry.occurred_at) })
44540
+ ] })
44541
+ ] }),
44542
+ /* @__PURE__ */ jsx140(
44543
+ "span",
44544
+ {
44545
+ className: "min-w-0 truncate text-muted-foreground",
44546
+ title: entry.changes.length === 0 ? "nothing about the values changed" : entry.changes.map((c) => c.label).join(", "),
44547
+ children: changeSummary(entry)
44548
+ }
44549
+ )
44550
+ ]
44457
44551
  }
44458
- )
44552
+ ),
44553
+ expanded ? /* @__PURE__ */ jsxs128("div", { className: "flex flex-col gap-1.5 border-t bg-muted/30 px-2 py-2", children: [
44554
+ entry.changes.length === 0 ? /* @__PURE__ */ jsx140("p", { className: "text-[11px] text-muted-foreground", children: "This version changed the record without changing any of its values." }) : /* @__PURE__ */ jsx140("ul", { className: "flex flex-col gap-1", children: entry.changes.map((change) => /* @__PURE__ */ jsx140(
44555
+ ChangeLine,
44556
+ {
44557
+ change,
44558
+ field: byKey.get(change.key),
44559
+ canRestore: canUndo,
44560
+ onRestore: () => onUndo(change.key),
44561
+ ...onAskAboutField ? { onAskAboutField } : {}
44562
+ },
44563
+ change.key
44564
+ )) }),
44565
+ undoConfirming ? /* @__PURE__ */ jsx140(ConfirmUndo, { lines: undoConfirming.lines, onConfirm: onUndoConfirm, onCancel: onUndoCancel }) : undoMine && undo.phase === "writing" ? /* @__PURE__ */ jsx140("p", { className: "text-[11px] text-muted-foreground", children: "Undoing\u2026" }) : canRestore && !confirming && !(mine && pending.phase === "writing") ? canUndo ? /* @__PURE__ */ jsx140("div", { className: "flex", children: /* @__PURE__ */ jsx140(
44566
+ Button87,
44567
+ {
44568
+ size: "sm",
44569
+ variant: "secondary",
44570
+ className: "h-6 px-2 text-[11px]",
44571
+ disabled: undoMine,
44572
+ onClick: () => onUndo(null),
44573
+ children: undoMine ? "Working out what would change\u2026" : "Undo this change"
44574
+ }
44575
+ ) }) : null : null,
44576
+ canRestore && !undoMine ? confirming ? /* @__PURE__ */ jsx140(
44577
+ ConfirmRestore,
44578
+ {
44579
+ preview: confirming.preview,
44580
+ busy: false,
44581
+ onConfirm: () => onConfirm(confirming.fieldKey),
44582
+ onCancel
44583
+ }
44584
+ ) : mine && pending.phase === "writing" ? /* @__PURE__ */ jsx140("p", { className: "text-[11px] text-muted-foreground", children: "Putting it back\u2026" }) : /* @__PURE__ */ jsx140("div", { className: "flex", children: /* @__PURE__ */ jsx140(
44585
+ Button87,
44586
+ {
44587
+ size: "sm",
44588
+ variant: "secondary",
44589
+ className: "h-6 px-2 text-[11px]",
44590
+ disabled: mine,
44591
+ onClick: () => onRestore(null),
44592
+ children: mine ? "Working out what would change\u2026" : "Put the record back to this version"
44593
+ }
44594
+ ) }) : (
44595
+ // Absent AND explained: never a greyed button, never silence.
44596
+ /* @__PURE__ */ jsx140("p", { className: "text-[11px] text-muted-foreground", children: whyNotRestore })
44597
+ )
44598
+ ] }) : null
44459
44599
  ]
44460
44600
  }
44461
- ),
44462
- expanded ? /* @__PURE__ */ jsxs128("div", { className: "flex flex-col gap-1.5 border-t bg-muted/30 px-2 py-2", children: [
44463
- entry.changes.length === 0 ? /* @__PURE__ */ jsx140("p", { className: "text-[11px] text-muted-foreground", children: "This version changed the record without changing any of its values." }) : /* @__PURE__ */ jsx140("ul", { className: "flex flex-col gap-1", children: entry.changes.map((change) => /* @__PURE__ */ jsx140(
44464
- ChangeLine,
44465
- {
44466
- change,
44467
- field: byKey.get(change.key),
44468
- canRestore: canUndo,
44469
- onRestore: () => onUndo(change.key),
44470
- ...onAskAboutField ? { onAskAboutField } : {}
44471
- },
44472
- change.key
44473
- )) }),
44474
- undoConfirming ? /* @__PURE__ */ jsx140(ConfirmUndo, { lines: undoConfirming.lines, onConfirm: onUndoConfirm, onCancel: onUndoCancel }) : undoMine && undo.phase === "writing" ? /* @__PURE__ */ jsx140("p", { className: "text-[11px] text-muted-foreground", children: "Undoing\u2026" }) : canRestore && !confirming && !(mine && pending.phase === "writing") ? canUndo ? /* @__PURE__ */ jsx140("div", { className: "flex", children: /* @__PURE__ */ jsx140(
44475
- Button87,
44476
- {
44477
- size: "sm",
44478
- variant: "secondary",
44479
- className: "h-6 px-2 text-[11px]",
44480
- disabled: undoMine,
44481
- onClick: () => onUndo(null),
44482
- children: undoMine ? "Working out what would change\u2026" : "Undo this change"
44483
- }
44484
- ) }) : null : null,
44485
- canRestore && !undoMine ? confirming ? /* @__PURE__ */ jsx140(
44486
- ConfirmRestore,
44487
- {
44488
- preview: confirming.preview,
44489
- busy: false,
44490
- onConfirm: () => onConfirm(confirming.fieldKey),
44491
- onCancel
44492
- }
44493
- ) : mine && pending.phase === "writing" ? /* @__PURE__ */ jsx140("p", { className: "text-[11px] text-muted-foreground", children: "Putting it back\u2026" }) : /* @__PURE__ */ jsx140("div", { className: "flex", children: /* @__PURE__ */ jsx140(
44494
- Button87,
44495
- {
44496
- size: "sm",
44497
- variant: "secondary",
44498
- className: "h-6 px-2 text-[11px]",
44499
- disabled: mine,
44500
- onClick: () => onRestore(null),
44501
- children: mine ? "Working out what would change\u2026" : "Put the record back to this version"
44502
- }
44503
- ) }) : (
44504
- // Absent AND explained: never a greyed button, never silence.
44505
- /* @__PURE__ */ jsx140("p", { className: "text-[11px] text-muted-foreground", children: whyNotRestore })
44506
- )
44507
- ] }) : null
44508
- ] });
44601
+ )
44602
+ );
44509
44603
  }
44510
44604
  function Who({ actor }) {
44511
44605
  const name = actor.name ?? (actor.kind === "system" ? "the platform" : "somebody");
@@ -44523,7 +44617,7 @@ function Who({ actor }) {
44523
44617
  ] }) : null
44524
44618
  ] });
44525
44619
  }
44526
- return /* @__PURE__ */ jsxs128("span", { className: "shrink-0 text-muted-foreground", children: [
44620
+ return /* @__PURE__ */ jsxs128("span", { className: "min-w-0 truncate font-medium text-foreground", children: [
44527
44621
  name,
44528
44622
  actor.kind === "system" ? /* @__PURE__ */ jsx140(Badge20, { variant: "outline", className: "ml-1 text-[10px]", children: "automatic" }) : null
44529
44623
  ] });
@@ -44604,7 +44698,7 @@ function ConfirmUndo({
44604
44698
  "?"
44605
44699
  ] }) : /* @__PURE__ */ jsx140("p", { className: "text-[11px] text-muted-foreground", children: "It is saved as a new version. Nothing in the history is erased, and later edits to other fields stay." }),
44606
44700
  /* @__PURE__ */ jsxs128("div", { className: "flex flex-wrap gap-1", children: [
44607
- conflicts.length ? /* @__PURE__ */ jsxs128(Fragment56, { children: [
44701
+ conflicts.length ? /* @__PURE__ */ jsxs128(Fragment55, { children: [
44608
44702
  clean.length ? /* @__PURE__ */ jsx140(Button87, { size: "sm", className: "h-6 px-2 text-[11px]", onClick: () => onConfirm(false), children: "Undo the rest, keep newer edits" }) : null,
44609
44703
  /* @__PURE__ */ jsx140(
44610
44704
  Button87,
@@ -44647,6 +44741,17 @@ function ConfirmRestore({
44647
44741
  ] })
44648
44742
  ] });
44649
44743
  }
44744
+ function verbWords(words2) {
44745
+ return words2 ? words2.charAt(0).toLowerCase() + words2.slice(1) : words2;
44746
+ }
44747
+ function changeSummary(entry) {
44748
+ const labels = entry.changes.map((c) => c.label);
44749
+ if (labels.length === 0) return "nothing about the values changed";
44750
+ const shown5 = labels.slice(0, 3).join(", ");
44751
+ const more = labels.length - 3;
44752
+ const list = more > 0 ? `${shown5} and ${more} more` : shown5;
44753
+ return entry.operation === "insert" ? `${labels.length} ${labels.length === 1 ? "value" : "values"}: ${list}` : list;
44754
+ }
44650
44755
  function whenText(at) {
44651
44756
  const then = new Date(at);
44652
44757
  const age = Date.now() - then.getTime();
@@ -44928,7 +45033,7 @@ import {
44928
45033
  } from "@ai-matrx/records/react";
44929
45034
  import { Badge as Badge22, Button as Button89, Skeleton as Skeleton24, cn as cn75 } from "@ai-matrx/design-system";
44930
45035
  import { humanizeIdentifier as humanizeIdentifier21 } from "@ai-matrx/kit/text-case";
44931
- import { Fragment as Fragment57, jsx as jsx142, jsxs as jsxs130 } from "react/jsx-runtime";
45036
+ import { Fragment as Fragment56, jsx as jsx142, jsxs as jsxs130 } from "react/jsx-runtime";
44932
45037
  function FieldHistoryPanel({
44933
45038
  tableId,
44934
45039
  fieldKey,
@@ -45031,7 +45136,7 @@ function FieldHistoryPanel({
45031
45136
  /* @__PURE__ */ jsx142("span", { className: "mx-1 text-muted-foreground", children: "\u2192" }),
45032
45137
  /* @__PURE__ */ jsx142("strong", { className: "font-medium", children: say(row.after, void 0) })
45033
45138
  ] }),
45034
- /* @__PURE__ */ jsx142("span", { className: "shrink-0 text-muted-foreground", children: row.actor.kind === "agent" ? /* @__PURE__ */ jsxs130(Fragment57, { children: [
45139
+ /* @__PURE__ */ jsx142("span", { className: "shrink-0 text-muted-foreground", children: row.actor.kind === "agent" ? /* @__PURE__ */ jsxs130(Fragment56, { children: [
45035
45140
  /* @__PURE__ */ jsx142(Badge22, { variant: "outline", className: "mr-1 text-[10px]", children: "agent" }),
45036
45141
  "for ",
45037
45142
  row.actor.on_behalf_of?.name ?? "a person",
@@ -45232,7 +45337,7 @@ import { useCallback as useCallback50, useEffect as useEffect104, useMemo as use
45232
45337
  import { useRecordsClient as useRecordsClient83, useTables as useTables4 } from "@ai-matrx/records/react";
45233
45338
  import { BasicInput as BasicInput23, Button as Button91, Checkbox as Checkbox14, Label as Label20, Separator as Separator10, Skeleton as Skeleton26, cn as cn77 } from "@ai-matrx/design-system";
45234
45339
  import { Select as Select21 } from "@ai-matrx/design-system/controls";
45235
- import { Fragment as Fragment58, jsx as jsx144, jsxs as jsxs132 } from "react/jsx-runtime";
45340
+ import { Fragment as Fragment57, jsx as jsx144, jsxs as jsxs132 } from "react/jsx-runtime";
45236
45341
  var RESTATING_REPLACES = "Saving replaces what this portal shows: a table you untick stops being visible to every client the moment you save. Who is invited is not touched.";
45237
45342
  function PortalBuilder({ tableId, portalId, onSaved, onClose, className }) {
45238
45343
  const client = useRecordsClient83();
@@ -45452,7 +45557,7 @@ function PortalBuilder({ tableId, portalId, onSaved, onClose, className }) {
45452
45557
  ),
45453
45558
  /* @__PURE__ */ jsx144("span", { className: "text-xs text-muted-foreground", children: "One record in this table is one client. Their sign-in is a one-time link emailed to them \u2014 a portal never holds a password." })
45454
45559
  ] }),
45455
- clientTableId ? /* @__PURE__ */ jsxs132(Fragment58, { children: [
45560
+ clientTableId ? /* @__PURE__ */ jsxs132(Fragment57, { children: [
45456
45561
  /* @__PURE__ */ jsx144(Separator10, {}),
45457
45562
  /* @__PURE__ */ jsxs132("div", { className: "flex flex-col gap-2", children: [
45458
45563
  /* @__PURE__ */ jsx144(Label20, { className: "text-xs font-medium", children: "What they can see" }),
@@ -45559,7 +45664,7 @@ function PortalBuilder({ tableId, portalId, onSaved, onClose, className }) {
45559
45664
  " yet."
45560
45665
  ] }) : null
45561
45666
  ] }) : null,
45562
- savedId ? /* @__PURE__ */ jsxs132(Fragment58, { children: [
45667
+ savedId ? /* @__PURE__ */ jsxs132(Fragment57, { children: [
45563
45668
  /* @__PURE__ */ jsx144(Separator10, {}),
45564
45669
  /* @__PURE__ */ jsxs132("div", { className: "flex flex-col gap-2", children: [
45565
45670
  /* @__PURE__ */ jsx144(Label20, { className: "text-xs font-medium", children: "Invite a client" }),
@@ -45937,7 +46042,7 @@ function PortalLookEditor({ card, onSaved, className }) {
45937
46042
  init_Refusal();
45938
46043
  init_host();
45939
46044
  init_names();
45940
- import { Fragment as Fragment59, jsx as jsx147, jsxs as jsxs135 } from "react/jsx-runtime";
46045
+ import { Fragment as Fragment58, jsx as jsx147, jsxs as jsxs135 } from "react/jsx-runtime";
45941
46046
  var PORTAL_NOT_HERE_LINE = "The link named a portal this table is not part of \u2014 it may have been archived, or it shows other tables. The portals this table is in are listed here.";
45942
46047
  function revokeConsequence(person, portalTitle) {
45943
46048
  const who = person.client ? `${person.email} (${person.client})` : person.email;
@@ -46047,7 +46152,7 @@ function PortalsPanel({ tableId, activePortalId, className }) {
46047
46152
  buildLabel: elsewhere > 0 ? "Build a new portal" : "Build the portal",
46048
46153
  children: [
46049
46154
  "A portal is how one of your clients signs in and sees the records that name them \u2014 their jobs, their invoices \u2014 and nothing else.",
46050
- elsewhere > 0 ? /* @__PURE__ */ jsxs135(Fragment59, { children: [
46155
+ elsewhere > 0 ? /* @__PURE__ */ jsxs135(Fragment58, { children: [
46051
46156
  " ",
46052
46157
  "This table is not in",
46053
46158
  " ",
@@ -46175,7 +46280,7 @@ function ArchivePortalControl({
46175
46280
  if (said2) {
46176
46281
  return /* @__PURE__ */ jsx147("span", { className: "text-xs text-muted-foreground", "data-testid": "portal-archived-said", children: said2 });
46177
46282
  }
46178
- return /* @__PURE__ */ jsxs135(Fragment59, { children: [
46283
+ return /* @__PURE__ */ jsxs135(Fragment58, { children: [
46179
46284
  /* @__PURE__ */ jsx147(
46180
46285
  Button93,
46181
46286
  {
@@ -46223,7 +46328,7 @@ function ArchivePortalControl({
46223
46328
  function CopyLink({ url, what }) {
46224
46329
  const [copied, setCopied] = useState124(false);
46225
46330
  const [shown5, setShown] = useState124(false);
46226
- return /* @__PURE__ */ jsxs135(Fragment59, { children: [
46331
+ return /* @__PURE__ */ jsxs135(Fragment58, { children: [
46227
46332
  /* @__PURE__ */ jsx147(
46228
46333
  Button93,
46229
46334
  {
@@ -46366,13 +46471,13 @@ function PortalCardView({
46366
46471
  ] })
46367
46472
  ] }, exposed.table_id))
46368
46473
  ] }),
46369
- look ? /* @__PURE__ */ jsxs135(Fragment59, { children: [
46474
+ look ? /* @__PURE__ */ jsxs135(Fragment58, { children: [
46370
46475
  /* @__PURE__ */ jsx147(Separator11, {}),
46371
46476
  look
46372
46477
  ] }) : null,
46373
46478
  /* @__PURE__ */ jsx147(Separator11, {}),
46374
46479
  /* @__PURE__ */ jsx147(People, { card, onRevoke, onPreview, origin }),
46375
- invite ? /* @__PURE__ */ jsxs135(Fragment59, { children: [
46480
+ invite ? /* @__PURE__ */ jsxs135(Fragment58, { children: [
46376
46481
  /* @__PURE__ */ jsx147(Separator11, {}),
46377
46482
  invite
46378
46483
  ] }) : null
@@ -46571,7 +46676,7 @@ function Invite({ card, onInvited }) {
46571
46676
  /* @__PURE__ */ jsx147("p", { className: "text-xs text-muted-foreground", children: "Pick the client they are, and say where to send their sign-in link. They get nothing until they follow it." }),
46572
46677
  error ? /* @__PURE__ */ jsx147(RefusalNotice, { error }) : null,
46573
46678
  said2 ? /* @__PURE__ */ jsx147("p", { className: "text-xs text-muted-foreground", children: said2 }) : null,
46574
- rows === null ? /* @__PURE__ */ jsx147(Skeleton27, { className: "h-9 w-full" }) : /* @__PURE__ */ jsxs135(Fragment59, { children: [
46679
+ rows === null ? /* @__PURE__ */ jsx147(Skeleton27, { className: "h-9 w-full" }) : /* @__PURE__ */ jsxs135(Fragment58, { children: [
46575
46680
  /* @__PURE__ */ jsx147(
46576
46681
  BasicInput25,
46577
46682
  {
@@ -46764,7 +46869,7 @@ function scheduleWords(schedule, tz) {
46764
46869
  }
46765
46870
 
46766
46871
  // src/DigestScheduler.tsx
46767
- import { Fragment as Fragment60, jsx as jsx149, jsxs as jsxs137 } from "react/jsx-runtime";
46872
+ import { Fragment as Fragment59, jsx as jsx149, jsxs as jsxs137 } from "react/jsx-runtime";
46768
46873
  var WEEKDAYS = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"];
46769
46874
  var CADENCE_WORDS = {
46770
46875
  instant: "the moment something arrives",
@@ -47019,7 +47124,7 @@ function DigestScheduler({
47019
47124
  ] }),
47020
47125
  /* @__PURE__ */ jsxs137("div", { className: "flex flex-col gap-1.5", children: [
47021
47126
  /* @__PURE__ */ jsx149(Label21, { className: "text-xs font-medium", children: "Who to send it to" }),
47022
- members === null ? /* @__PURE__ */ jsx149(Skeleton28, { className: "h-8 w-full" }) : members.length === 0 ? /* @__PURE__ */ jsx149("p", { className: "text-xs text-muted-foreground", children: "Nobody else is offered here, so this will be addressed to you. Who the people are is the platform's answer and this screen reaches it through its host's `members` port, which is not bound here." }) : /* @__PURE__ */ jsxs137(Fragment60, { children: [
47127
+ members === null ? /* @__PURE__ */ jsx149(Skeleton28, { className: "h-8 w-full" }) : members.length === 0 ? /* @__PURE__ */ jsx149("p", { className: "text-xs text-muted-foreground", children: "Nobody else is offered here, so this will be addressed to you. Who the people are is the platform's answer and this screen reaches it through its host's `members` port, which is not bound here." }) : /* @__PURE__ */ jsxs137(Fragment59, { children: [
47023
47128
  /* @__PURE__ */ jsx149("div", { className: "flex flex-wrap gap-x-4 gap-y-1.5", children: members.map((m) => /* @__PURE__ */ jsxs137("label", { className: "flex items-center gap-1.5 text-xs", children: [
47024
47129
  /* @__PURE__ */ jsx149(
47025
47130
  Checkbox15,
@@ -47061,7 +47166,7 @@ function DigestScheduler({
47061
47166
  ),
47062
47167
  /* @__PURE__ */ jsx149("span", { className: "text-xs text-muted-foreground", children: "A send inside these hours waits until they end \u2014 it is never dropped." })
47063
47168
  ] }) : null,
47064
- outcomes ? /* @__PURE__ */ jsxs137(Fragment60, { children: [
47169
+ outcomes ? /* @__PURE__ */ jsxs137(Fragment59, { children: [
47065
47170
  /* @__PURE__ */ jsx149(Separator12, {}),
47066
47171
  /* @__PURE__ */ jsx149("div", { className: "flex flex-col gap-1.5", children: outcomes.map((o) => /* @__PURE__ */ jsx149("div", { className: "text-xs", children: o.ruleId ? /* @__PURE__ */ jsxs137("span", { children: [
47067
47172
  o.who,
@@ -47589,7 +47694,7 @@ import {
47589
47694
  FORM_EMBEDS,
47590
47695
  formEmbedSnippet
47591
47696
  } from "@ai-matrx/records/forms";
47592
- import { Fragment as Fragment61, jsx as jsx152, jsxs as jsxs140 } from "react/jsx-runtime";
47697
+ import { Fragment as Fragment60, jsx as jsx152, jsxs as jsxs140 } from "react/jsx-runtime";
47593
47698
  function freshEndingId(taken) {
47594
47699
  if (!taken.includes("ending")) return "ending";
47595
47700
  let n = 2;
@@ -47638,7 +47743,7 @@ function EndingsEditor({
47638
47743
  /* @__PURE__ */ jsx152(BasicTextarea10, { className: "col-span-2", rows: 2, "aria-label": "Ending message", placeholder: "Message", value: e.body ?? "", onChange: (ev) => patch(i, { body: ev.target.value || null }) }),
47639
47744
  /* @__PURE__ */ jsx152(BasicInput28, { type: "url", "aria-label": "Ending page", placeholder: "Then go to (optional) https://", value: e.redirectUrl ?? "", onChange: (ev) => patch(i, { redirectUrl: ev.target.value || null }) }),
47640
47745
  /* @__PURE__ */ jsx152(BasicInput28, { "aria-label": "Ending button", placeholder: "Continue", value: e.buttonLabel ?? "", onChange: (ev) => patch(i, { buttonLabel: ev.target.value || null }) }),
47641
- scored ? /* @__PURE__ */ jsxs140(Fragment61, { children: [
47746
+ scored ? /* @__PURE__ */ jsxs140(Fragment60, { children: [
47642
47747
  /* @__PURE__ */ jsx152(BasicInput28, { inputMode: "decimal", "aria-label": "Lowest score", placeholder: "From score", value: e.scoreMin ?? "", onChange: (ev) => patch(i, { scoreMin: numberOrNull(ev.target.value) }) }),
47643
47748
  /* @__PURE__ */ jsx152(BasicInput28, { inputMode: "decimal", "aria-label": "Highest score", placeholder: "To score", value: e.scoreMax ?? "", onChange: (ev) => patch(i, { scoreMax: numberOrNull(ev.target.value) }) })
47644
47749
  ] }) : null,
@@ -47844,7 +47949,7 @@ init_plainWords();
47844
47949
  init_names();
47845
47950
  import { answerRefusal, formRoutes, pipeAnswers, submissionStamp } from "@ai-matrx/records/forms";
47846
47951
  import { humanizeIdentifier as humanizeIdentifier22 } from "@ai-matrx/kit/text-case";
47847
- import { Fragment as Fragment62, jsx as jsx153, jsxs as jsxs141 } from "react/jsx-runtime";
47952
+ import { Fragment as Fragment61, jsx as jsx153, jsxs as jsxs141 } from "react/jsx-runtime";
47848
47953
  function authored(host, text, where) {
47849
47954
  return host.renderText ? host.renderText(text, where) : text;
47850
47955
  }
@@ -48418,7 +48523,7 @@ function ThankYou({
48418
48523
  ),
48419
48524
  ending?.pictureUrl ? /* @__PURE__ */ jsx153("img", { src: ending.pictureUrl, alt: "", className: "mb-3 max-h-48 w-full rounded-md object-cover" }) : null,
48420
48525
  /* @__PURE__ */ jsx153("h2", { className: "text-2xl font-semibold", "data-records-form-ending": ending?.id ?? "", children: title || "Thank you" }),
48421
- body ? /* @__PURE__ */ jsxs141(Fragment62, { children: [
48526
+ body ? /* @__PURE__ */ jsxs141(Fragment61, { children: [
48422
48527
  done === "preview" ? /* @__PURE__ */ jsx153("p", { className: "mt-2 text-xs uppercase tracking-wide text-muted-foreground", children: "After a real send, people read:" }) : null,
48423
48528
  /* @__PURE__ */ jsx153("p", { className: "mt-2 text-base text-muted-foreground", children: authored(host, body, "form-thank-you") })
48424
48529
  ] }) : null,
@@ -48474,7 +48579,7 @@ function Question({
48474
48579
  field2.unit ? /* @__PURE__ */ jsx153("span", { className: "text-sm text-foreground/70", children: field2.unit }) : null
48475
48580
  ] }),
48476
48581
  question.help ? /* @__PURE__ */ jsx153("p", { className: cn85("text-muted-foreground", large ? "text-base" : "text-sm"), children: authored(host, question.help, "form-help") }) : null,
48477
- isAttachment && !upload ? /* @__PURE__ */ jsx153("p", { className: "w-fit rounded border border-dashed px-2 py-0.5 text-xs text-muted-foreground", title: NO_UPLOAD_REASON, children: "File upload unavailable here" }) : isAttachment ? /* @__PURE__ */ jsxs141(Fragment62, { children: [
48582
+ isAttachment && !upload ? /* @__PURE__ */ jsx153("p", { className: "w-fit rounded border border-dashed px-2 py-0.5 text-xs text-muted-foreground", title: NO_UPLOAD_REASON, children: "File upload unavailable here" }) : isAttachment ? /* @__PURE__ */ jsxs141(Fragment61, { children: [
48478
48583
  /* @__PURE__ */ jsx153(
48479
48584
  "input",
48480
48585
  {
@@ -48523,7 +48628,7 @@ import {
48523
48628
  formLookDocument
48524
48629
  } from "@ai-matrx/records/forms";
48525
48630
  import { OutboundLink as OutboundLink8 } from "@ai-matrx/kit/outbound-react";
48526
- import { Fragment as Fragment63, jsx as jsx154, jsxs as jsxs142 } from "react/jsx-runtime";
48631
+ import { Fragment as Fragment62, jsx as jsx154, jsxs as jsxs142 } from "react/jsx-runtime";
48527
48632
  function freshFormName(base2, taken) {
48528
48633
  const names2 = new Set(taken.map((n) => n.trim().toLowerCase()));
48529
48634
  if (!names2.has(base2.toLowerCase())) return base2;
@@ -48924,7 +49029,7 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
48924
49029
  }
48925
49030
  )
48926
49031
  ] }) : null,
48927
- !draft ? /* @__PURE__ */ jsx154("p", { className: "text-xs text-muted-foreground", children: (fields.data ?? []).length === 0 ? "No fields yet" : "No form yet" }) : /* @__PURE__ */ jsxs142(Fragment63, { children: [
49032
+ !draft ? /* @__PURE__ */ jsx154("p", { className: "text-xs text-muted-foreground", children: (fields.data ?? []).length === 0 ? "No fields yet" : "No form yet" }) : /* @__PURE__ */ jsxs142(Fragment62, { children: [
48928
49033
  /* @__PURE__ */ jsx154(
48929
49034
  PublishRow,
48930
49035
  {
@@ -49178,7 +49283,7 @@ function PublishRow({
49178
49283
  children: busy ? "\u2026" : open ? "Unpublish" : unsaved ? "Save and publish" : "Publish"
49179
49284
  }
49180
49285
  ) : null,
49181
- state2 !== "draft" ? /* @__PURE__ */ jsxs142(Fragment63, { children: [
49286
+ state2 !== "draft" ? /* @__PURE__ */ jsxs142(Fragment62, { children: [
49182
49287
  /* @__PURE__ */ jsx154(
49183
49288
  OutboundLink8,
49184
49289
  {
@@ -50884,7 +50989,7 @@ function pageById(pages, id) {
50884
50989
 
50885
50990
  // src/DashboardCanvas.tsx
50886
50991
  init_parity();
50887
- import { Fragment as Fragment64, jsx as jsx161, jsxs as jsxs149 } from "react/jsx-runtime";
50992
+ import { Fragment as Fragment63, jsx as jsx161, jsxs as jsxs149 } from "react/jsx-runtime";
50888
50993
  function DashboardCanvas({ tableId, activeDashboardId, filter, createOnMount, onCreated, className }) {
50889
50994
  const client = useRecordsClient95();
50890
50995
  const host = useRecordsUi();
@@ -51147,7 +51252,7 @@ function DashboardCanvas({ tableId, activeDashboardId, filter, createOnMount, on
51147
51252
  children: scheduling ? "Done" : "Send on a schedule"
51148
51253
  }
51149
51254
  ),
51150
- rights.admin && askingToRemove === board.id ? /* @__PURE__ */ jsxs149(Fragment64, { children: [
51255
+ rights.admin && askingToRemove === board.id ? /* @__PURE__ */ jsxs149(Fragment63, { children: [
51151
51256
  /* @__PURE__ */ jsx161("span", { className: "text-xs text-destructive", children: archiveConfirmSentence(`the dashboard \u201C${board.name}\u201D`) }),
51152
51257
  /* @__PURE__ */ jsx161(Button105, { size: "sm", variant: "destructive", onClick: () => void remove(board), children: "Remove it" }),
51153
51258
  /* @__PURE__ */ jsx161(Button105, { size: "sm", variant: "ghost", onClick: () => setAskingToRemove(null), children: "Keep it" })
@@ -51195,7 +51300,7 @@ function DashboardCanvas({ tableId, activeDashboardId, filter, createOnMount, on
51195
51300
  /* @__PURE__ */ jsx161(Button105, { size: "sm", disabled: !host.onReask || asking || question.trim() === "", onClick: () => void reask(), children: asking ? "Asking" : "Ask" })
51196
51301
  ] }) }) : null,
51197
51302
  notKept ? /* @__PURE__ */ jsx161("p", { role: "status", "data-records-dashboard-not-kept": "", className: "text-xs text-amber-700 dark:text-amber-400", children: notKept }) : null,
51198
- !board ? /* @__PURE__ */ jsx161("p", { className: "text-xs text-muted-foreground", children: rights.admin ? "No dashboards yet." : rights.why("structure") }) : run === null ? /* @__PURE__ */ jsx161(Skeleton37, { className: "h-64 w-full" }) : run.blocks.length === 0 ? /* @__PURE__ */ jsx161("p", { className: "text-xs text-muted-foreground", children: "No charts yet." }) : /* @__PURE__ */ jsxs149(Fragment64, { children: [
51303
+ !board ? /* @__PURE__ */ jsx161("p", { className: "text-xs text-muted-foreground", children: rights.admin ? "No dashboards yet." : rights.why("structure") }) : run === null ? /* @__PURE__ */ jsx161(Skeleton37, { className: "h-64 w-full" }) : run.blocks.length === 0 ? /* @__PURE__ */ jsx161("p", { className: "text-xs text-muted-foreground", children: "No charts yet." }) : /* @__PURE__ */ jsxs149(Fragment63, { children: [
51199
51304
  /* @__PURE__ */ jsx161(
51200
51305
  DashboardGrid,
51201
51306
  {
@@ -51209,7 +51314,7 @@ function DashboardCanvas({ tableId, activeDashboardId, filter, createOnMount, on
51209
51314
  id: board.blocks[index]?.id ?? block.id ?? `block-${index}`,
51210
51315
  title: block.title,
51211
51316
  span: board.blocks[index]?.span ?? block.span,
51212
- body: /* @__PURE__ */ jsxs149(Fragment64, { children: [
51317
+ body: /* @__PURE__ */ jsxs149(Fragment63, { children: [
51213
51318
  spansTables ? /* @__PURE__ */ jsx161(ChartOfTable, { block, subject: tableId, table: board.blocks[index]?.subject ?? block.table_id ?? tableId }) : /* @__PURE__ */ jsx161(ChartBlock, { block, subject: tableId }),
51214
51319
  rights.admin && board.blocks[index] ? /* @__PURE__ */ jsx161(
51215
51320
  BlockSettingsMenu,
@@ -51315,7 +51420,7 @@ function GroupingPicker({
51315
51420
  return /* @__PURE__ */ jsx161("span", { className: "text-muted-foreground", children: "No columns to group by." });
51316
51421
  }
51317
51422
  const known = choices.some((c) => c.field.key === current);
51318
- return /* @__PURE__ */ jsxs149(Fragment64, { children: [
51423
+ return /* @__PURE__ */ jsxs149(Fragment63, { children: [
51319
51424
  /* @__PURE__ */ jsx161("label", { className: "text-muted-foreground", htmlFor: `block-group-${block.title}`, children: "Group by" }),
51320
51425
  /* @__PURE__ */ jsxs149(Select27, { value: known ? current : "", onValueChange: onPick, children: [
51321
51426
  /* @__PURE__ */ jsx161(
@@ -51412,7 +51517,7 @@ function CompareControl({
51412
51517
  // that has one does not lose it by being shown.
51413
51518
  (k) => k !== "range" || current === "range"
51414
51519
  );
51415
- return /* @__PURE__ */ jsxs149(Fragment64, { children: [
51520
+ return /* @__PURE__ */ jsxs149(Fragment63, { children: [
51416
51521
  /* @__PURE__ */ jsxs149(
51417
51522
  Select27,
51418
51523
  {
@@ -51474,7 +51579,7 @@ function TargetControl({
51474
51579
  if (draft.trim() === "" || !Number.isFinite(n) || n === savedValue) return;
51475
51580
  onChange({ value: n, label: label && saved === "value" ? label : "Target", ...per ? { per } : {} });
51476
51581
  }
51477
- return /* @__PURE__ */ jsxs149(Fragment64, { children: [
51582
+ return /* @__PURE__ */ jsxs149(Fragment63, { children: [
51478
51583
  /* @__PURE__ */ jsxs149(
51479
51584
  Select27,
51480
51585
  {
@@ -51544,7 +51649,7 @@ __reExport(question_exports, questions_star);
51544
51649
  import * as questions_star from "@ai-matrx/records/questions";
51545
51650
 
51546
51651
  // src/QuestionPanel.tsx
51547
- import { Fragment as Fragment65, jsx as jsx162, jsxs as jsxs150 } from "react/jsx-runtime";
51652
+ import { Fragment as Fragment64, jsx as jsx162, jsxs as jsxs150 } from "react/jsx-runtime";
51548
51653
  var OP_LABEL = { count: "Count", sum: "Sum", avg: "Average", min: "Smallest", max: "Largest" };
51549
51654
  var BUCKETS = [
51550
51655
  { value: "", label: "Exact date" },
@@ -51795,7 +51900,7 @@ function QuestionPanel({ tableId, activeQuestionId, draft, className }) {
51795
51900
  }
51796
51901
  ) : /* @__PURE__ */ jsx162("span", { className: "text-muted-foreground", children: "Now" })
51797
51902
  ] }),
51798
- spec.group ? /* @__PURE__ */ jsxs150(Fragment65, { children: [
51903
+ spec.group ? /* @__PURE__ */ jsxs150(Fragment64, { children: [
51799
51904
  /* @__PURE__ */ jsx162(Label27, { className: "pt-1.5 text-xs text-muted-foreground", children: "Sort" }),
51800
51905
  /* @__PURE__ */ jsxs150("div", { className: "flex flex-wrap items-center gap-1.5", children: [
51801
51906
  /* @__PURE__ */ jsx162(
@@ -52320,7 +52425,7 @@ init_names();
52320
52425
  init_host();
52321
52426
  init_Refusal();
52322
52427
  init_refusals();
52323
- import { Fragment as Fragment66, jsx as jsx163, jsxs as jsxs151 } from "react/jsx-runtime";
52428
+ import { Fragment as Fragment65, jsx as jsx163, jsxs as jsxs151 } from "react/jsx-runtime";
52324
52429
  function askExampleFor(fields) {
52325
52430
  const by = fields.find(isChoiceField);
52326
52431
  return by ? `count by ${fieldName(by)}` : "count";
@@ -52388,14 +52493,14 @@ function TableAsk({ tableId, onOpenInQuestions, viewId }) {
52388
52493
  ),
52389
52494
  /* @__PURE__ */ jsxs151("div", { className: said2.kind === "idle" ? "hidden" : "flex min-h-32 flex-col gap-2", "data-table-ask-slot": "", children: [
52390
52495
  said2.kind === "not-read" ? /* @__PURE__ */ jsx163("p", { className: "text-muted-foreground", role: "status", "data-table-ask-not-read": "", children: said2.why }) : null,
52391
- said2.kind === "asking" ? /* @__PURE__ */ jsxs151(Fragment66, { children: [
52496
+ said2.kind === "asking" ? /* @__PURE__ */ jsxs151(Fragment65, { children: [
52392
52497
  /* @__PURE__ */ jsx163("p", { className: "truncate text-muted-foreground", children: said2.reads }),
52393
52498
  /* @__PURE__ */ jsx163(Skeleton39, { className: "h-24 w-full", "data-table-ask-pending": "" })
52394
52499
  ] }) : null,
52395
52500
  said2.kind === "agent-failed" ? /* @__PURE__ */ jsx163("div", { "data-table-ask-failed": "", children: /* @__PURE__ */ jsx163(RefusalNotice, { error: said2.error }) }) : null,
52396
52501
  said2.kind === "agent-answer" ? /* @__PURE__ */ jsx163(AgentAnswer, { tableId, answer: said2.answer, fields: all, costPoints: said2.costPoints }) : null,
52397
52502
  said2.kind === "refused" ? /* @__PURE__ */ jsx163(RefusalNotice, { error: said2.error }) : null,
52398
- said2.kind === "answer" ? /* @__PURE__ */ jsxs151(Fragment66, { children: [
52503
+ said2.kind === "answer" ? /* @__PURE__ */ jsxs151(Fragment65, { children: [
52399
52504
  /* @__PURE__ */ jsx163("p", { className: "truncate text-muted-foreground", title: said2.reads, "data-table-ask-reads": "", children: said2.reads }),
52400
52505
  /* @__PURE__ */ jsx163("div", { className: "max-h-64 overflow-y-auto", "data-table-ask-answer": "", children: /* @__PURE__ */ jsx163(QuestionAnswerView, { tableId, spec: said2.spec, answer: said2.answer, fields: all }) }),
52401
52506
  onOpenInQuestions ? /* @__PURE__ */ jsx163(
@@ -52619,7 +52724,7 @@ function RecordStepper({ neighbors, onStep, expanded, onToggleExpand }) {
52619
52724
  }
52620
52725
 
52621
52726
  // src/PageCanvas.tsx
52622
- import { Fragment as Fragment67, jsx as jsx165, jsxs as jsxs153 } from "react/jsx-runtime";
52727
+ import { Fragment as Fragment66, jsx as jsx165, jsxs as jsxs153 } from "react/jsx-runtime";
52623
52728
  var InterfaceDoorContext = createContext10(null);
52624
52729
  var InterfaceDoorProvider = InterfaceDoorContext.Provider;
52625
52730
  function useInterfaceDoor() {
@@ -52887,7 +52992,7 @@ function AppletBlockView({ block }) {
52887
52992
  const host = useRecordsUi();
52888
52993
  if (!host.applets) return /* @__PURE__ */ jsx165(BlockNote, { children: "Applets open inside AI Matrx." });
52889
52994
  if (!block.app_id) return /* @__PURE__ */ jsx165(BlockNote, { children: "Choose an applet." });
52890
- return /* @__PURE__ */ jsx165(Fragment67, { children: host.applets.render(block.app_id) });
52995
+ return /* @__PURE__ */ jsx165(Fragment66, { children: host.applets.render(block.app_id) });
52891
52996
  }
52892
52997
  function AppletPick({ value, onChange }) {
52893
52998
  const host = useRecordsUi();
@@ -53251,7 +53356,7 @@ function ActionButton2({ block, recordId }) {
53251
53356
  else setError(ran.error);
53252
53357
  }
53253
53358
  return /* @__PURE__ */ jsxs153("div", { className: "flex flex-wrap items-center gap-2", "data-records-page-button": block.id, children: [
53254
- asking ? /* @__PURE__ */ jsxs153(Fragment67, { children: [
53359
+ asking ? /* @__PURE__ */ jsxs153(Fragment66, { children: [
53255
53360
  /* @__PURE__ */ jsx165("span", { className: "text-xs", children: `${label}?` }),
53256
53361
  /* @__PURE__ */ jsx165(Button109, { size: "sm", onClick: () => void runIt(), children: label }),
53257
53362
  /* @__PURE__ */ jsx165(Button109, { size: "sm", variant: "ghost", onClick: () => setAsking(false), children: "Cancel" })
@@ -53357,7 +53462,7 @@ function BlockSettings2({
53357
53462
  },
53358
53463
  `url-${block.url}`
53359
53464
  ) : null,
53360
- block.kind === "record" ? /* @__PURE__ */ jsxs153(Fragment67, { children: [
53465
+ block.kind === "record" ? /* @__PURE__ */ jsxs153(Fragment66, { children: [
53361
53466
  /* @__PURE__ */ jsx165(PickOne, { label: "Follows list", placeholder: "Choose a list", value: block.source, options: listOptions, onChange: (source) => onChange({ ...block, source }), className: "h-7 w-36" }),
53362
53467
  lists.find((l) => l.id === block.source) ? /* @__PURE__ */ jsx165(
53363
53468
  FieldGroupsEditor,
@@ -53368,7 +53473,7 @@ function BlockSettings2({
53368
53473
  }
53369
53474
  ) : null
53370
53475
  ] }) : null,
53371
- block.kind === "button" ? /* @__PURE__ */ jsxs153(Fragment67, { children: [
53476
+ block.kind === "button" ? /* @__PURE__ */ jsxs153(Fragment66, { children: [
53372
53477
  /* @__PURE__ */ jsx165(
53373
53478
  PickOne,
53374
53479
  {
@@ -53385,11 +53490,11 @@ function BlockSettings2({
53385
53490
  ),
53386
53491
  /* @__PURE__ */ jsx165(ActionPicker, { tableId: block.table_id, value: block.action_id, onChange: (action_id) => onChange({ ...block, action_id }) })
53387
53492
  ] }) : null,
53388
- block.kind === "form" ? /* @__PURE__ */ jsxs153(Fragment67, { children: [
53493
+ block.kind === "form" ? /* @__PURE__ */ jsxs153(Fragment66, { children: [
53389
53494
  /* @__PURE__ */ jsx165(TablePick, { value: block.table_id, onChange: (table_id) => onChange({ ...block, table_id, form_id: "" }) }),
53390
53495
  /* @__PURE__ */ jsx165(FormPicker, { tableId: block.table_id, value: block.form_id, onChange: (form_id) => onChange({ ...block, form_id }) })
53391
53496
  ] }) : null,
53392
- block.kind === "filter" ? /* @__PURE__ */ jsxs153(Fragment67, { children: [
53497
+ block.kind === "filter" ? /* @__PURE__ */ jsxs153(Fragment66, { children: [
53393
53498
  /* @__PURE__ */ jsx165(TablePick, { value: block.table_id, onChange: (table_id) => onChange({ ...block, table_id, field: "" }) }),
53394
53499
  /* @__PURE__ */ jsx165(FieldPick, { tableId: block.table_id, want: "choice", label: "Filter column", value: block.field, onChange: (field2) => onChange({ ...block, field: field2 }) })
53395
53500
  ] }) : null,
@@ -53416,7 +53521,7 @@ function ScopeSettings({
53416
53521
  };
53417
53522
  }, [client, block.table_id]);
53418
53523
  const shown5 = block.columns && block.columns.length > 0 ? block.columns : shownColumns(all, void 0).map((f) => f.key);
53419
- return /* @__PURE__ */ jsxs153(Fragment67, { children: [
53524
+ return /* @__PURE__ */ jsxs153(Fragment66, { children: [
53420
53525
  /* @__PURE__ */ jsx165(
53421
53526
  TablePick,
53422
53527
  {
@@ -53427,7 +53532,7 @@ function ScopeSettings({
53427
53532
  }
53428
53533
  }
53429
53534
  ),
53430
- block.kind === "layout" ? /* @__PURE__ */ jsxs153(Fragment67, { children: [
53535
+ block.kind === "layout" ? /* @__PURE__ */ jsxs153(Fragment66, { children: [
53431
53536
  /* @__PURE__ */ jsx165(
53432
53537
  PickOne,
53433
53538
  {
@@ -53439,7 +53544,7 @@ function ScopeSettings({
53439
53544
  }
53440
53545
  ),
53441
53546
  block.layout === "kanban" ? /* @__PURE__ */ jsx165(FieldPick, { tableId: block.table_id, want: "choice", label: "Group by", value: block.group_field ?? "", onChange: (group_field) => onChange({ ...block, group_field }) }) : null,
53442
- block.layout === "calendar" || block.layout === "timeline" ? /* @__PURE__ */ jsxs153(Fragment67, { children: [
53547
+ block.layout === "calendar" || block.layout === "timeline" ? /* @__PURE__ */ jsxs153(Fragment66, { children: [
53443
53548
  /* @__PURE__ */ jsx165(FieldPick, { tableId: block.table_id, want: "date", label: "Date", value: block.date_field ?? "", onChange: (date_field) => onChange({ ...block, date_field }) }),
53444
53549
  /* @__PURE__ */ jsx165(FieldPick, { tableId: block.table_id, want: "date", label: "Ends", allowNone: "No end", value: block.end_field ?? "", onChange: (end_field) => onChange({ ...block, end_field: end_field || null }) })
53445
53550
  ] }) : null,
@@ -53566,7 +53671,7 @@ function ListSettings({ block, onChange }) {
53566
53671
  };
53567
53672
  }, [client, block.table_id]);
53568
53673
  const shown5 = block.columns && block.columns.length > 0 ? block.columns : [...all].sort((a, b) => (a.sort ?? 100) - (b.sort ?? 100)).slice(0, DEFAULT_COLUMNS).map((f) => f.key);
53569
- return /* @__PURE__ */ jsxs153(Fragment67, { children: [
53674
+ return /* @__PURE__ */ jsxs153(Fragment66, { children: [
53570
53675
  /* @__PURE__ */ jsx165(
53571
53676
  TablePick,
53572
53677
  {
@@ -53599,7 +53704,7 @@ function ListSettings({ block, onChange }) {
53599
53704
  onChange: (me_field) => onChange({ ...block, me_field: me_field || null })
53600
53705
  }
53601
53706
  ),
53602
- block.me_field ? /* @__PURE__ */ jsxs153(Fragment67, { children: [
53707
+ block.me_field ? /* @__PURE__ */ jsxs153(Fragment66, { children: [
53603
53708
  /* @__PURE__ */ jsxs153("label", { className: "flex items-center gap-1", children: [
53604
53709
  /* @__PURE__ */ jsx165(Checkbox19, { checked: block.me_default === true, onCheckedChange: (on) => onChange({ ...block, me_default: on === true }), "aria-label": "Starts on Assigned to me" }),
53605
53710
  "Starts on"
@@ -53652,7 +53757,7 @@ function FormPicker({ tableId, value, onChange }) {
53652
53757
  return /* @__PURE__ */ jsx165(PickOne, { label: "Form", placeholder: "Choose a form", value, options, onChange: (v) => onChange(v), className: "h-7 w-40" });
53653
53758
  }
53654
53759
  function ChartSettings({ chart, onChange }) {
53655
- return /* @__PURE__ */ jsxs153(Fragment67, { children: [
53760
+ return /* @__PURE__ */ jsxs153(Fragment66, { children: [
53656
53761
  /* @__PURE__ */ jsx165(TablePick, { value: chart.subject, onChange: (subject) => onChange({ ...chart, subject, groupBy: [] }) }),
53657
53762
  /* @__PURE__ */ jsx165(
53658
53763
  PickOne,
@@ -53702,7 +53807,7 @@ function escapeText(text) {
53702
53807
  }
53703
53808
 
53704
53809
  // src/PageScreen.tsx
53705
- import { Fragment as Fragment68, jsx as jsx166, jsxs as jsxs154 } from "react/jsx-runtime";
53810
+ import { Fragment as Fragment67, jsx as jsx166, jsxs as jsxs154 } from "react/jsx-runtime";
53706
53811
  var EDIT_LEVELS = /* @__PURE__ */ new Set(["edit_content", "editor", "admin", "owner"]);
53707
53812
  function PageScreen({
53708
53813
  pageId,
@@ -53902,7 +54007,7 @@ function PageScreen({
53902
54007
  className: "h-8 w-40"
53903
54008
  }
53904
54009
  ),
53905
- /* @__PURE__ */ jsx166("span", { className: "ml-auto flex items-center gap-1", children: askingToArchive ? /* @__PURE__ */ jsxs154(Fragment68, { children: [
54010
+ /* @__PURE__ */ jsx166("span", { className: "ml-auto flex items-center gap-1", children: askingToArchive ? /* @__PURE__ */ jsxs154(Fragment67, { children: [
53906
54011
  /* @__PURE__ */ jsx166("span", { className: "text-destructive", children: archiveConfirmSentence(`the page \u201C${page.name}\u201D`) }),
53907
54012
  /* @__PURE__ */ jsx166(Button110, { size: "sm", variant: "destructive", onClick: () => void archive(), children: "Archive it" }),
53908
54013
  /* @__PURE__ */ jsx166(Button110, { size: "sm", variant: "ghost", onClick: () => setAskingToArchive(false), children: "Keep it" })
@@ -53932,7 +54037,7 @@ import { BasicInput as BasicInput37, Button as Button111, Skeleton as Skeleton42
53932
54037
  init_PickOne();
53933
54038
  init_Refusal();
53934
54039
  init_host();
53935
- import { Fragment as Fragment69, jsx as jsx167, jsxs as jsxs155 } from "react/jsx-runtime";
54040
+ import { Fragment as Fragment68, jsx as jsx167, jsxs as jsxs155 } from "react/jsx-runtime";
53936
54041
  var INTERFACE_COLOR_CLASS = {
53937
54042
  blue: "bg-blue-500 text-white",
53938
54043
  green: "bg-emerald-500 text-white",
@@ -54056,7 +54161,7 @@ function InterfaceScreen({
54056
54161
  const savePage = (nextPage) => void save(withDraftPage(shape, nextPage));
54057
54162
  const actions = /* @__PURE__ */ jsxs155("span", { className: "flex flex-wrap items-center gap-1", children: [
54058
54163
  builder ? /* @__PURE__ */ jsx167(Button111, { size: "sm", variant: editing ? "secondary" : "ghost", "aria-pressed": editing, onClick: () => setEditing((v) => !v), "data-records-interface-edit": "", children: editing ? "Done" : "Edit" }) : null,
54059
- changed2 ? /* @__PURE__ */ jsxs155(Fragment69, { children: [
54164
+ changed2 ? /* @__PURE__ */ jsxs155(Fragment68, { children: [
54060
54165
  /* @__PURE__ */ jsx167(Button111, { size: "sm", onClick: () => void save(publish(shape, (/* @__PURE__ */ new Date()).toISOString(), viewerUserId ?? null)), "data-records-interface-publish": "", children: "Publish" }),
54061
54166
  shape.published ? /* @__PURE__ */ jsx167(Button111, { size: "sm", variant: "ghost", onClick: () => void save(clearUnpublished(shape)), "data-records-interface-clear": "", children: "Clear changes" }) : null
54062
54167
  ] }) : null,
@@ -54155,7 +54260,7 @@ function InterfaceScreen({
54155
54260
  className: "h-8 w-28"
54156
54261
  }
54157
54262
  ),
54158
- page ? /* @__PURE__ */ jsxs155(Fragment69, { children: [
54263
+ page ? /* @__PURE__ */ jsxs155(Fragment68, { children: [
54159
54264
  /* @__PURE__ */ jsx167(
54160
54265
  BasicInput37,
54161
54266
  {
@@ -54201,7 +54306,7 @@ function InterfaceScreen({
54201
54306
  }
54202
54307
  ) : null
54203
54308
  ] }) : null,
54204
- /* @__PURE__ */ jsx167("span", { className: "ml-auto flex items-center gap-1", children: askingToArchive ? /* @__PURE__ */ jsxs155(Fragment69, { children: [
54309
+ /* @__PURE__ */ jsx167("span", { className: "ml-auto flex items-center gap-1", children: askingToArchive ? /* @__PURE__ */ jsxs155(Fragment68, { children: [
54205
54310
  /* @__PURE__ */ jsx167("span", { className: "text-destructive", children: archiveConfirmSentence(`the interface \u201C${read.name}\u201D`) }),
54206
54311
  /* @__PURE__ */ jsx167(
54207
54312
  Button111,
@@ -54252,7 +54357,7 @@ import { Badge as Badge26, Button as Button112, Skeleton as Skeleton43, cn as cn
54252
54357
  init_Refusal();
54253
54358
  init_host();
54254
54359
  import { FORM_STATE_WORDS as FORM_STATE_WORDS2 } from "@ai-matrx/records/forms";
54255
- import { Fragment as Fragment70, jsx as jsx168, jsxs as jsxs156 } from "react/jsx-runtime";
54360
+ import { Fragment as Fragment69, jsx as jsx168, jsxs as jsxs156 } from "react/jsx-runtime";
54256
54361
  var FORM_NOT_HERE_LINE = "The link named a form this table does not have \u2014 it may have been removed, or it belongs to another table. The forms this table does have are listed here.";
54257
54362
  var WHAT_A_FORM_IS = "A form asks for this table's own fields, and its answers land here as ordinary records stamped with the form they came through.";
54258
54363
  var NO_ADMIN2 = "This table has no forms. Making one needs the admin level on it, because a form decides what people with no account may add here.";
@@ -54388,12 +54493,12 @@ function FormsPanel({ tableId, activeFormId, className }) {
54388
54493
  /* @__PURE__ */ jsxs156("p", { className: "mt-1.5 text-xs", children: [
54389
54494
  /* @__PURE__ */ jsx168("span", { className: "font-medium", children: form.in_table }),
54390
54495
  " in the table",
54391
- form.held > 0 ? /* @__PURE__ */ jsxs156(Fragment70, { children: [
54496
+ form.held > 0 ? /* @__PURE__ */ jsxs156(Fragment69, { children: [
54392
54497
  " \xB7 ",
54393
54498
  /* @__PURE__ */ jsx168("span", { className: "font-medium", children: form.held }),
54394
54499
  " waiting for someone"
54395
54500
  ] }) : null,
54396
- form.rejected > 0 ? /* @__PURE__ */ jsxs156(Fragment70, { children: [
54501
+ form.rejected > 0 ? /* @__PURE__ */ jsxs156(Fragment69, { children: [
54397
54502
  " \xB7 ",
54398
54503
  /* @__PURE__ */ jsx168("span", { className: "font-medium", children: form.rejected }),
54399
54504
  " turned away"
@@ -54834,7 +54939,7 @@ function CaptureRun({ sheetId, face: given, className }) {
54834
54939
  }
54835
54940
 
54836
54941
  // src/CaptureSheet.tsx
54837
- import { Fragment as Fragment71, jsx as jsx170, jsxs as jsxs158 } from "react/jsx-runtime";
54942
+ import { Fragment as Fragment70, jsx as jsx170, jsxs as jsxs158 } from "react/jsx-runtime";
54838
54943
  var CAPTURE_MODES = ["reading", "photo", "voice"];
54839
54944
  var IN_MEMORY_QUEUE_REASON = "Anything you capture while offline is held only in this page until it can be sent, and it is lost if you close the tab. Keep this page open until you are back on a connection. It is said here rather than discovered later.";
54840
54945
  function mintClientKey() {
@@ -55011,7 +55116,7 @@ function AdHocCaptureSheet({
55011
55116
  " ",
55012
55117
  /* @__PURE__ */ jsx170("code", { children: "attachmentField" }),
55013
55118
  "."
55014
- ] }) : /* @__PURE__ */ jsxs158(Fragment71, { children: [
55119
+ ] }) : /* @__PURE__ */ jsxs158(Fragment70, { children: [
55015
55120
  /* @__PURE__ */ jsx170(
55016
55121
  "input",
55017
55122
  {
@@ -55290,7 +55395,7 @@ import { useCallback as useCallback69, useEffect as useEffect127, useState as us
55290
55395
  import { useRecordsClient as useRecordsClient106 } from "@ai-matrx/records/react";
55291
55396
  import { Button as Button116, Input as Input10, Skeleton as Skeleton48, Textarea as Textarea9, cn as cn102 } from "@ai-matrx/design-system";
55292
55397
  import { useTable as useTable39 } from "@ai-matrx/records/react";
55293
- import { Fragment as Fragment72, jsx as jsx173, jsxs as jsxs161 } from "react/jsx-runtime";
55398
+ import { Fragment as Fragment71, jsx as jsx173, jsxs as jsxs161 } from "react/jsx-runtime";
55294
55399
  function EmbedFrame({
55295
55400
  tableId,
55296
55401
  formId,
@@ -55374,7 +55479,7 @@ function EmbedFrame({
55374
55479
  " will not pass."
55375
55480
  ] })
55376
55481
  ] }),
55377
- !secret ? /* @__PURE__ */ jsx173(Button116, { size: "sm", className: "self-start", disabled: busy || parsed.length === 0, onClick: () => void issue(), children: busy ? "Issuing\u2026" : "Issue embed" }) : /* @__PURE__ */ jsxs161(Fragment72, { children: [
55482
+ !secret ? /* @__PURE__ */ jsx173(Button116, { size: "sm", className: "self-start", disabled: busy || parsed.length === 0, onClick: () => void issue(), children: busy ? "Issuing\u2026" : "Issue embed" }) : /* @__PURE__ */ jsxs161(Fragment71, { children: [
55378
55483
  /* @__PURE__ */ jsx173("p", { className: "rounded border px-2 py-1 text-xs text-muted-foreground", children: "Copy this now. Only its digest is stored, so nobody \u2014 including us \u2014 can show it to you again; if it is lost, issue a new one and replace the old." }),
55379
55484
  /* @__PURE__ */ jsx173(Textarea9, { "aria-label": "Embed snippet", readOnly: true, rows: 3, className: "font-mono text-[11px]", value: snippet ?? "" }),
55380
55485
  /* @__PURE__ */ jsxs161("div", { className: "flex gap-2", children: [
@@ -55433,7 +55538,7 @@ init_names();
55433
55538
  import {
55434
55539
  Badge as Badge27,
55435
55540
  BottomSheet,
55436
- Button as Button123,
55541
+ Button as Button122,
55437
55542
  DropdownMenu as DropdownMenu10,
55438
55543
  DropdownMenuContent as DropdownMenuContent10,
55439
55544
  DropdownMenuItem as DropdownMenuItem8,
@@ -55798,13 +55903,13 @@ function GridShortcutsHelp() {
55798
55903
  }
55799
55904
 
55800
55905
  // src/RecordPanel.tsx
55801
- import { Fragment as Fragment73, useState as useState150 } from "react";
55802
- import { Button as Button118, Separator as Separator13 } from "@ai-matrx/design-system";
55906
+ import { Fragment as Fragment72, useState as useState150 } from "react";
55907
+ import { Separator as Separator13 } from "@ai-matrx/design-system";
55803
55908
  import { useFields as useFields37, useRecord as useRecord5 } from "@ai-matrx/records/react";
55804
55909
  init_host();
55805
55910
  init_names();
55806
55911
  init_parity();
55807
- import { Fragment as Fragment74, jsx as jsx176, jsxs as jsxs164 } from "react/jsx-runtime";
55912
+ import { Fragment as Fragment73, jsx as jsx176, jsxs as jsxs164 } from "react/jsx-runtime";
55808
55913
  function RecordPanel({ tableId, recordId, onClose, onAskAboutField, onPage = false, neighbors, onStep, expanded, onToggleExpand }) {
55809
55914
  const host = useRecordsUi();
55810
55915
  const [asking, setAsking] = useState150(null);
@@ -55834,12 +55939,18 @@ function RecordPanel({ tableId, recordId, onClose, onAskAboutField, onPage = fal
55834
55939
  children: [
55835
55940
  neighbors && onStep ? /* @__PURE__ */ jsx176(RecordStepper, { neighbors, onStep: (to) => onStep(to), expanded, onToggleExpand }) : null,
55836
55941
  /* @__PURE__ */ jsx176(Peek, { tableId, recordId, onPage, ...onClose ? { onClose } : {} }),
55837
- onPage ? /* @__PURE__ */ jsxs164(Fragment74, { children: [
55942
+ onPage ? /* @__PURE__ */ jsxs164(Fragment73, { children: [
55838
55943
  /* @__PURE__ */ jsx176(RecordBody, { tableId, recordId }),
55839
55944
  /* @__PURE__ */ jsx176(LinkedLists, { tableId, recordId }),
55840
- /* @__PURE__ */ jsx176(ReverseLinksSections, { tableId, recordId }),
55841
- /* @__PURE__ */ jsx176(RecordAsk, { tableId, recordId })
55945
+ /* @__PURE__ */ jsx176(ReverseLinksSections, { tableId, recordId })
55946
+ ] }) : null,
55947
+ host.recordSections ? /* @__PURE__ */ jsxs164(Fragment72, { children: [
55948
+ /* @__PURE__ */ jsx176(Separator13, {}),
55949
+ host.recordSections({ tableId, recordId })
55842
55950
  ] }) : null,
55951
+ /* @__PURE__ */ jsx176(ChecklistRunner, { tableId, recordId, quietWhenEmpty: true, className: "border-t pt-3" }),
55952
+ /* @__PURE__ */ jsx176(Separator13, {}),
55953
+ /* @__PURE__ */ jsx176(CommentThread, { tableId, recordId }),
55843
55954
  /* @__PURE__ */ jsx176(Separator13, {}),
55844
55955
  /* @__PURE__ */ jsx176(
55845
55956
  HistoryPanel,
@@ -55849,15 +55960,7 @@ function RecordPanel({ tableId, recordId, onClose, onAskAboutField, onPage = fal
55849
55960
  onAskAboutField: (fieldKey) => onAskAboutField ? onAskAboutField(fieldKey) : setAsking(fieldKey)
55850
55961
  }
55851
55962
  ),
55852
- !onAskAboutField && asking ? /* @__PURE__ */ jsx176(FieldHistoryPanel, { tableId, fieldKey: asking, recordId, onClose: () => setAsking(null) }) : null,
55853
- host.recordSections ? /* @__PURE__ */ jsxs164(Fragment73, { children: [
55854
- /* @__PURE__ */ jsx176(Separator13, {}),
55855
- host.recordSections({ tableId, recordId })
55856
- ] }) : null,
55857
- /* @__PURE__ */ jsx176(Separator13, {}),
55858
- /* @__PURE__ */ jsx176(ChecklistRunner, { tableId, recordId }),
55859
- /* @__PURE__ */ jsx176(Separator13, {}),
55860
- /* @__PURE__ */ jsx176(CommentThread, { tableId, recordId })
55963
+ !onAskAboutField && asking ? /* @__PURE__ */ jsx176(FieldHistoryPanel, { tableId, fieldKey: asking, recordId, onClose: () => setAsking(null) }) : null
55861
55964
  ]
55862
55965
  }
55863
55966
  );
@@ -55909,15 +56012,6 @@ function LinkedLists({ tableId, recordId }) {
55909
56012
  })
55910
56013
  ] });
55911
56014
  }
55912
- function RecordAsk({ tableId, recordId }) {
55913
- const host = useRecordsUi();
55914
- const [open, setOpen] = useState150(false);
55915
- if (!host.chat) return null;
55916
- return /* @__PURE__ */ jsxs164("section", { className: "flex min-w-0 flex-col gap-1.5", "data-record-ask": open ? "open" : "", children: [
55917
- /* @__PURE__ */ jsx176(Separator13, {}),
55918
- open ? /* @__PURE__ */ jsx176(RecordChat, { tableId, recordId, className: "min-h-[22rem]" }) : /* @__PURE__ */ jsx176(Button118, { size: "sm", variant: "outline", className: "self-start", onClick: () => setOpen(true), "data-record-ask-open": "", children: "Ask about this record" })
55919
- ] });
55920
- }
55921
56015
 
55922
56016
  // src/TablePage.tsx
55923
56017
  init_BookingSlots();
@@ -55927,7 +56021,7 @@ init_Refusal();
55927
56021
  // src/breakDown.tsx
55928
56022
  import { useMemo as useMemo82, useState as useState151 } from "react";
55929
56023
  import {
55930
- Button as Button119,
56024
+ Button as Button118,
55931
56025
  Dialog as Dialog21,
55932
56026
  DialogContent as DialogContent21,
55933
56027
  DialogHeader as DialogHeader21,
@@ -55974,7 +56068,7 @@ function BreakDownDialog({
55974
56068
  /* @__PURE__ */ jsx177(SelectContent20, { children: dimensions.map((d) => /* @__PURE__ */ jsx177(SelectItem20, { value: d.key, children: d.label }, d.key)) })
55975
56069
  ] }),
55976
56070
  /* @__PURE__ */ jsx177(
55977
- Button119,
56071
+ Button118,
55978
56072
  {
55979
56073
  type: "button",
55980
56074
  "data-break-down-apply": "",
@@ -55996,7 +56090,7 @@ init_names();
55996
56090
  import { copyText as copyText14 } from "@ai-matrx/kit/clipboard";
55997
56091
  import { useCallback as useCallback70, useMemo as useMemo83, useState as useState152 } from "react";
55998
56092
  import { useContentTransferCapabilities as useContentTransferCapabilities2 } from "@ai-matrx/alchemy/react/workspace";
55999
- import { Button as Button120, Dialog as Dialog22, DialogContent as DialogContent22, DialogHeader as DialogHeader22, DialogTitle as DialogTitle22 } from "@ai-matrx/design-system";
56093
+ import { Button as Button119, Dialog as Dialog22, DialogContent as DialogContent22, DialogHeader as DialogHeader22, DialogTitle as DialogTitle22 } from "@ai-matrx/design-system";
56000
56094
  import { jsx as jsx178, jsxs as jsxs166 } from "react/jsx-runtime";
56001
56095
  function tableReferenceChoices(tableId, name) {
56002
56096
  return [
@@ -56044,7 +56138,7 @@ function TableReferenceDialog({
56044
56138
  /* @__PURE__ */ jsx178(DialogHeader22, { children: /* @__PURE__ */ jsx178(DialogTitle22, { children: "Get reference" }) }),
56045
56139
  /* @__PURE__ */ jsx178("div", { className: "flex flex-col gap-2", children: choices.map((choice) => /* @__PURE__ */ jsxs166("div", { className: "flex items-center justify-between gap-3 rounded-md border px-3 py-2", children: [
56046
56140
  /* @__PURE__ */ jsx178("span", { className: "text-sm", children: choice.label }),
56047
- /* @__PURE__ */ jsx178(Button120, { size: "sm", variant: "outline", onClick: () => void copy(choice), "data-table-reference-copy": choice.id, children: copied === choice.id ? "Copied" : "Copy" })
56141
+ /* @__PURE__ */ jsx178(Button119, { size: "sm", variant: "outline", onClick: () => void copy(choice), "data-table-reference-copy": choice.id, children: copied === choice.id ? "Copied" : "Copy" })
56048
56142
  ] }, choice.id)) })
56049
56143
  ] }) });
56050
56144
  }
@@ -56055,8 +56149,8 @@ init_plainWords();
56055
56149
  import { formatCount as formatCount8 } from "@ai-matrx/kit/format";
56056
56150
  import { useState as useState153 } from "react";
56057
56151
  import { tableShapeChanged as tableShapeChanged14, useRecordsClient as useRecordsClient107 } from "@ai-matrx/records/react";
56058
- import { Button as Button121, Dialog as Dialog23, DialogContent as DialogContent23, DialogFooter as DialogFooter13, DialogHeader as DialogHeader23, DialogTitle as DialogTitle23, ErrorBox as ErrorBox8, Input as Input11, Switch as Switch7 } from "@ai-matrx/design-system";
56059
- import { Fragment as Fragment75, jsx as jsx179, jsxs as jsxs167 } from "react/jsx-runtime";
56152
+ import { Button as Button120, Dialog as Dialog23, DialogContent as DialogContent23, DialogFooter as DialogFooter13, DialogHeader as DialogHeader23, DialogTitle as DialogTitle23, ErrorBox as ErrorBox8, Input as Input11, Switch as Switch7 } from "@ai-matrx/design-system";
56153
+ import { Fragment as Fragment74, jsx as jsx179, jsxs as jsxs167 } from "react/jsx-runtime";
56060
56154
  function copyNameFor(name) {
56061
56155
  return `${name.trim() || "Table"} (copy)`;
56062
56156
  }
@@ -56148,16 +56242,16 @@ function TableDuplicateDialog({ tableId, name, organizationId, open, onOpenChang
56148
56242
  phase.kind === "refused" ? /* @__PURE__ */ jsx179(ErrorBox8, { children: phase.sentence }) : null,
56149
56243
  problem && typed2 !== "" ? /* @__PURE__ */ jsx179("p", { className: "text-xs text-muted-foreground", children: problem }) : null
56150
56244
  ] }),
56151
- /* @__PURE__ */ jsx179(DialogFooter13, { children: phase.kind === "done" ? /* @__PURE__ */ jsx179(Button121, { onClick: () => openCopy(phase.copy), "data-table-duplicate-open": "", children: "Open the copy" }) : /* @__PURE__ */ jsxs167(Fragment75, { children: [
56152
- /* @__PURE__ */ jsx179(Button121, { variant: "ghost", disabled: copying, onClick: () => close(false), children: "Cancel" }),
56153
- /* @__PURE__ */ jsx179(Button121, { disabled: copying || problem !== null, onClick: () => void go(), children: copying ? "Duplicating\u2026" : "Duplicate" })
56245
+ /* @__PURE__ */ jsx179(DialogFooter13, { children: phase.kind === "done" ? /* @__PURE__ */ jsx179(Button120, { onClick: () => openCopy(phase.copy), "data-table-duplicate-open": "", children: "Open the copy" }) : /* @__PURE__ */ jsxs167(Fragment74, { children: [
56246
+ /* @__PURE__ */ jsx179(Button120, { variant: "ghost", disabled: copying, onClick: () => close(false), children: "Cancel" }),
56247
+ /* @__PURE__ */ jsx179(Button120, { disabled: copying || problem !== null, onClick: () => void go(), children: copying ? "Duplicating\u2026" : "Duplicate" })
56154
56248
  ] }) })
56155
56249
  ] }) });
56156
56250
  }
56157
56251
 
56158
56252
  // src/ViewFilter.tsx
56159
56253
  import { useEffect as useEffect129, useMemo as useMemo84, useState as useState154 } from "react";
56160
- import { Button as Button122, Popover as Popover20, PopoverContent as PopoverContent20, PopoverTrigger as PopoverTrigger20 } from "@ai-matrx/design-system";
56254
+ import { Button as Button121, Popover as Popover20, PopoverContent as PopoverContent20, PopoverTrigger as PopoverTrigger20 } from "@ai-matrx/design-system";
56161
56255
  import { useFields as useFields38, useOptionalRecordsClient as useOptionalRecordsClient23 } from "@ai-matrx/records/react";
56162
56256
  import { jsx as jsx180, jsxs as jsxs168 } from "react/jsx-runtime";
56163
56257
  function conditionCount(expr) {
@@ -56226,7 +56320,7 @@ function ViewFilter({ tableId, view, onApply, className }) {
56226
56320
  },
56227
56321
  children: [
56228
56322
  /* @__PURE__ */ jsx180(PopoverTrigger20, { asChild: true, children: /* @__PURE__ */ jsx180(
56229
- Button122,
56323
+ Button121,
56230
56324
  {
56231
56325
  size: "sm",
56232
56326
  variant: open || count > 0 ? "secondary" : "ghost",
@@ -56259,7 +56353,7 @@ function ViewFilter({ tableId, view, onApply, className }) {
56259
56353
  ) }),
56260
56354
  view.ruleId ? null : /* @__PURE__ */ jsxs168("div", { className: "flex items-center gap-1", children: [
56261
56355
  changed2 ? /* @__PURE__ */ jsx180(
56262
- Button122,
56356
+ Button121,
56263
56357
  {
56264
56358
  size: "sm",
56265
56359
  "data-testid": "view-filter-apply",
@@ -56271,7 +56365,7 @@ function ViewFilter({ tableId, view, onApply, className }) {
56271
56365
  }
56272
56366
  ) : null,
56273
56367
  count > 0 || draft ? /* @__PURE__ */ jsx180(
56274
- Button122,
56368
+ Button121,
56275
56369
  {
56276
56370
  size: "sm",
56277
56371
  variant: "ghost",
@@ -56284,7 +56378,7 @@ function ViewFilter({ tableId, view, onApply, className }) {
56284
56378
  children: "Clear filter"
56285
56379
  }
56286
56380
  ) : null,
56287
- /* @__PURE__ */ jsx180(Button122, { size: "sm", variant: "ghost", onClick: () => {
56381
+ /* @__PURE__ */ jsx180(Button121, { size: "sm", variant: "ghost", onClick: () => {
56288
56382
  setDraft(saved);
56289
56383
  setOpen(false);
56290
56384
  }, children: "Cancel" })
@@ -56599,7 +56693,7 @@ function useSlotScroll(slot) {
56599
56693
  // src/TablePage.tsx
56600
56694
  import { isUuidShape as isUuidShape10 } from "@ai-matrx/kit/uuid";
56601
56695
  import { openOutbound as openOutbound4 } from "@ai-matrx/kit/outbound";
56602
- import { Fragment as Fragment76, jsx as jsx182, jsxs as jsxs170 } from "react/jsx-runtime";
56696
+ import { Fragment as Fragment75, jsx as jsx182, jsxs as jsxs170 } from "react/jsx-runtime";
56603
56697
  var RAIL_TITLE = {
56604
56698
  settings: "Table settings",
56605
56699
  inbox: "Inbox",
@@ -56715,7 +56809,7 @@ function TableNotHere({
56715
56809
  refusal3 ? /* @__PURE__ */ jsx182(RefusalNotice, { error: refusal3 }) : null,
56716
56810
  /* @__PURE__ */ jsxs170("div", { className: "flex gap-2", children: [
56717
56811
  /* @__PURE__ */ jsx182(
56718
- Button123,
56812
+ Button122,
56719
56813
  {
56720
56814
  size: "sm",
56721
56815
  disabled: restoring,
@@ -56733,14 +56827,14 @@ function TableNotHere({
56733
56827
  children: restoring ? "Bringing it back\u2026" : "Bring it back"
56734
56828
  }
56735
56829
  ),
56736
- onLeave ? /* @__PURE__ */ jsx182(Button123, { size: "sm", variant: "outline", onClick: onLeave, children: leaveLabel }) : null
56830
+ onLeave ? /* @__PURE__ */ jsx182(Button122, { size: "sm", variant: "outline", onClick: onLeave, children: leaveLabel }) : null
56737
56831
  ] })
56738
56832
  ] });
56739
56833
  }
56740
56834
  return /* @__PURE__ */ jsxs170("div", { className: cn104("flex flex-col items-start gap-2 rounded-md border border-dashed p-6", className), children: [
56741
56835
  /* @__PURE__ */ jsx182("p", { className: "text-sm font-medium", children: "This table is not here" }),
56742
56836
  /* @__PURE__ */ jsx182("p", { className: "max-w-prose text-xs text-muted-foreground", children: TABLE_NOT_REACHABLE }),
56743
- onLeave ? /* @__PURE__ */ jsx182(Button123, { size: "sm", variant: "outline", onClick: onLeave, children: leaveLabel }) : null
56837
+ onLeave ? /* @__PURE__ */ jsx182(Button122, { size: "sm", variant: "outline", onClick: onLeave, children: leaveLabel }) : null
56744
56838
  ] });
56745
56839
  }
56746
56840
  var TABLE_NOT_REACHABLE = (
@@ -57283,10 +57377,10 @@ function TablePage({
57283
57377
  children: VIEW_LAYOUTS.map((option) => /* @__PURE__ */ jsx182(DropdownMenuRadioItem3, { value: option, children: LAYOUT_LABEL[option] }, option))
57284
57378
  }
57285
57379
  );
57286
- const sheetExtras = controlsInSheet && main === "records" && shownLayout === "grid" ? /* @__PURE__ */ jsxs170(Fragment76, { children: [
57380
+ const sheetExtras = controlsInSheet && main === "records" && shownLayout === "grid" ? /* @__PURE__ */ jsxs170(Fragment75, { children: [
57287
57381
  /* @__PURE__ */ jsx182("div", { className: "flex items-center gap-2 text-xs", "data-table-sheet-filter": "", "data-matrx-table-tools-keep-open": "", children: /* @__PURE__ */ jsx182(ViewFilter, { tableId, view: shown5, onApply: (where) => void patchView({ where }) }) }),
57288
57382
  /* @__PURE__ */ jsx182("div", { role: "group", "aria-label": "Layout", className: "flex flex-wrap gap-1 pt-1", "data-table-sheet-layout": "", children: VIEW_LAYOUTS.map((option) => /* @__PURE__ */ jsx182(
57289
- Button123,
57383
+ Button122,
57290
57384
  {
57291
57385
  size: "sm",
57292
57386
  variant: layoutShowing === option ? "secondary" : "ghost",
@@ -57297,7 +57391,7 @@ function TablePage({
57297
57391
  },
57298
57392
  option
57299
57393
  )) }),
57300
- rights.share && canShare ? /* @__PURE__ */ jsx182(Button123, { size: "sm", variant: "ghost", className: "h-8", onClick: () => setShareAsked((n) => n + 1), "data-table-sheet-share": "", children: "Share\u2026" }) : null
57394
+ rights.share && canShare ? /* @__PURE__ */ jsx182(Button122, { size: "sm", variant: "ghost", className: "h-8", onClick: () => setShareAsked((n) => n + 1), "data-table-sheet-share": "", children: "Share\u2026" }) : null
57301
57395
  ] }) : void 0;
57302
57396
  const go = (pressed) => {
57303
57397
  if (!surfaceChosen(surface, pressed)) press(pressed);
@@ -57503,7 +57597,7 @@ function TablePage({
57503
57597
  return () => window.removeEventListener("keydown", onKey);
57504
57598
  }, [recordsUi]);
57505
57599
  const openedFromMenu = openedEntry ? { ...openedEntry, label: actions.find((a) => a.id === openedEntry.id)?.label ?? openedEntry.key } : null;
57506
- const pageActions = /* @__PURE__ */ jsxs170(Fragment76, { children: [
57600
+ const pageActions = /* @__PURE__ */ jsxs170(Fragment75, { children: [
57507
57601
  publicReadOnly ? /* @__PURE__ */ jsx182(Badge27, { variant: "neutral", className: "shrink-0", "data-public-read-only": "", children: PUBLIC_READ_ONLY }, "public-read-only") : null,
57508
57602
  !phone && rights.read && table.data ? /* @__PURE__ */ jsx182(
57509
57603
  TableAsk,
@@ -57531,20 +57625,20 @@ function TablePage({
57531
57625
  },
57532
57626
  `share-${shareAsked}`
57533
57627
  ) }, "share") : null,
57534
- phone ? /* @__PURE__ */ jsxs170(Fragment76, { children: [
57628
+ phone ? /* @__PURE__ */ jsxs170(Fragment75, { children: [
57535
57629
  !chooserInline && !chooserCompact && !embedded ? /* @__PURE__ */ jsxs170(DropdownMenu10, { children: [
57536
- /* @__PURE__ */ jsx182(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsx182(Button123, { size: "sm", variant: "ghost", "aria-label": "Layout", title: "Layout", "data-table-layout-menu": "", children: "Layout" }) }),
57630
+ /* @__PURE__ */ jsx182(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsx182(Button122, { size: "sm", variant: "ghost", "aria-label": "Layout", title: "Layout", "data-table-layout-menu": "", children: "Layout" }) }),
57537
57631
  /* @__PURE__ */ jsx182(DropdownMenuContent10, { align: "end", className: "w-56", children: layoutRadio })
57538
57632
  ] }, "phone-layout") : null,
57539
57633
  phoneTableActions(actions)
57540
57634
  ] }) : /* @__PURE__ */ jsxs170(DropdownMenu10, { children: [
57541
- /* @__PURE__ */ jsx182(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsx182(Button123, { size: "sm", variant: "ghost", "aria-label": "Table menu", title: "Table menu", "data-table-menu": "", children: /* @__PURE__ */ jsxs170("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "currentColor", "aria-hidden": "true", children: [
57635
+ /* @__PURE__ */ jsx182(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsx182(Button122, { size: "sm", variant: "ghost", "aria-label": "Table menu", title: "Table menu", "data-table-menu": "", children: /* @__PURE__ */ jsxs170("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "currentColor", "aria-hidden": "true", children: [
57542
57636
  /* @__PURE__ */ jsx182("circle", { cx: "5", cy: "12", r: "1.75" }),
57543
57637
  /* @__PURE__ */ jsx182("circle", { cx: "12", cy: "12", r: "1.75" }),
57544
57638
  /* @__PURE__ */ jsx182("circle", { cx: "19", cy: "12", r: "1.75" })
57545
57639
  ] }) }) }),
57546
57640
  /* @__PURE__ */ jsxs170(DropdownMenuContent10, { align: "end", className: "w-64", "data-table-menu-content": "", ...renameMenuProps, children: [
57547
- !chooserInline && !chooserCompact && !embedded ? /* @__PURE__ */ jsxs170(Fragment76, { children: [
57641
+ !chooserInline && !chooserCompact && !embedded ? /* @__PURE__ */ jsxs170(Fragment75, { children: [
57548
57642
  /* @__PURE__ */ jsx182(DropdownMenuLabel3, { className: "text-xs text-muted-foreground", children: "Layout" }),
57549
57643
  layoutRadio,
57550
57644
  /* @__PURE__ */ jsx182(DropdownMenuSeparator5, {})
@@ -57605,18 +57699,18 @@ function TablePage({
57605
57699
  rights.structure && table.data ? /* @__PURE__ */ jsx182(TableRenameDialog, { tableId, name: table.data.name, open: renameOpen, onOpenChange: setRenameOpen }, "rename") : null
57606
57700
  ] });
57607
57701
  const headerNode = header && !embedded ? header({ actions: table.data ? pageActions : null, tableName: table.data?.name ?? null }) : null;
57608
- if (table.error) return /* @__PURE__ */ jsxs170(Fragment76, { children: [
57702
+ if (table.error) return /* @__PURE__ */ jsxs170(Fragment75, { children: [
57609
57703
  headerNode,
57610
57704
  /* @__PURE__ */ jsx182(RefusalNotice, { error: table.error })
57611
57705
  ] });
57612
57706
  if (table.loading && !table.data) {
57613
- return /* @__PURE__ */ jsxs170(Fragment76, { children: [
57707
+ return /* @__PURE__ */ jsxs170(Fragment75, { children: [
57614
57708
  headerNode,
57615
57709
  /* @__PURE__ */ jsx182(TablePageSkeleton, { layout: skeletonFace, embedded, tableId, ...className ? { className } : {} })
57616
57710
  ] });
57617
57711
  }
57618
57712
  if (!table.data) {
57619
- return /* @__PURE__ */ jsxs170(Fragment76, { children: [
57713
+ return /* @__PURE__ */ jsxs170(Fragment75, { children: [
57620
57714
  headerNode,
57621
57715
  /* @__PURE__ */ jsx182(TableNotHere, { tableId, onLeave, leaveLabel, className })
57622
57716
  ] });
@@ -57629,11 +57723,11 @@ function TablePage({
57629
57723
  headerNode,
57630
57724
  /* @__PURE__ */ jsx182("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col gap-2", children: structure.hidden || !structure.settled ? (
57631
57725
  /* THE TOOLBAR ROW'S HEIGHT IS KEPT (min-h-8), so the sentence lands exactly where the bar was. */
57632
- /* @__PURE__ */ jsxs170(Fragment76, { children: [
57726
+ /* @__PURE__ */ jsxs170(Fragment75, { children: [
57633
57727
  /* @__PURE__ */ jsx182("div", { className: TABLE_TOOLBAR_ROW_CLASS, "data-table-toolbar": "", "aria-hidden": "true" }),
57634
57728
  structure.hidden ? /* @__PURE__ */ jsx182(StructureLocked, {}) : /* @__PURE__ */ jsx182(RecordsSkeleton, { layout: skeletonFace, embedded })
57635
57729
  ] })
57636
- ) : /* @__PURE__ */ jsxs170(Fragment76, { children: [
57730
+ ) : /* @__PURE__ */ jsxs170(Fragment75, { children: [
57637
57731
  /* @__PURE__ */ jsx182(ImportNotice, { tableId, epoch: importEpoch, onOpenImport: () => setRail("import") }),
57638
57732
  /* @__PURE__ */ jsxs170(
57639
57733
  "div",
@@ -57702,7 +57796,7 @@ function TablePage({
57702
57796
  viewsEpoch
57703
57797
  ),
57704
57798
  chooserInline ? /* @__PURE__ */ jsx182("div", { className: "flex shrink-0 items-center gap-0.5", role: "group", "aria-label": "Layout", "data-toolbar-fit": "chooser", children: VIEW_LAYOUTS.map((option) => /* @__PURE__ */ jsx182(
57705
- Button123,
57799
+ Button122,
57706
57800
  {
57707
57801
  size: "sm",
57708
57802
  variant: layoutShowing === option ? "secondary" : "ghost",
@@ -57717,7 +57811,7 @@ function TablePage({
57717
57811
  with the record panel open): the chooser folds to ONE button naming the layout that is
57718
57812
  showing — it never leaves the row. */
57719
57813
  /* @__PURE__ */ jsx182("span", { className: "flex shrink-0 items-center", "data-toolbar-fit": "chooser", "data-layout-chooser-compact": "", children: /* @__PURE__ */ jsxs170(DropdownMenu10, { children: [
57720
- /* @__PURE__ */ jsx182(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsxs170(Button123, { size: "sm", variant: "outline", className: "h-8 gap-1 px-2 text-xs", "aria-label": `Layout: ${layoutShowingLabel ?? "none"}`, children: [
57814
+ /* @__PURE__ */ jsx182(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsxs170(Button122, { size: "sm", variant: "outline", className: "h-8 gap-1 px-2 text-xs", "aria-label": `Layout: ${layoutShowingLabel ?? "none"}`, children: [
57721
57815
  layoutShowingLabel ?? "Layout",
57722
57816
  /* @__PURE__ */ jsx182("svg", { viewBox: "0 0 24 24", className: "h-3.5 w-3.5 opacity-70", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: /* @__PURE__ */ jsx182("path", { d: "m6 9 6 6 6-6" }) })
57723
57817
  ] }) }),
@@ -57730,7 +57824,7 @@ function TablePage({
57730
57824
  main === "records" && !(controlsInSheet && shownLayout === "grid") ? /* @__PURE__ */ jsx182(ViewFilter, { tableId, view: shown5, onApply: (where) => void patchView({ where }) }) : null,
57731
57825
  lookShowing && main === "records" && !namingLook ? /* @__PURE__ */ jsxs170("span", { className: "flex shrink-0 items-center gap-1", "data-view-look": "", "data-view-look-folded": "", "data-toolbar-fit": "look", children: [
57732
57826
  /* @__PURE__ */ jsx182(
57733
- Button123,
57827
+ Button122,
57734
57828
  {
57735
57829
  size: "sm",
57736
57830
  variant: "outline",
@@ -57746,7 +57840,7 @@ function TablePage({
57746
57840
  }
57747
57841
  ),
57748
57842
  /* @__PURE__ */ jsxs170(DropdownMenu10, { children: [
57749
- /* @__PURE__ */ jsx182(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsxs170(Button123, { size: "sm", variant: "outline", className: "relative h-8 w-8 shrink-0 px-0", title: LOOK_WORDS.folded, "aria-label": LOOK_WORDS.folded, "data-view-look-menu": "", children: [
57843
+ /* @__PURE__ */ jsx182(DropdownMenuTrigger10, { asChild: true, children: /* @__PURE__ */ jsxs170(Button122, { size: "sm", variant: "outline", className: "relative h-8 w-8 shrink-0 px-0", title: LOOK_WORDS.folded, "aria-label": LOOK_WORDS.folded, "data-view-look-menu": "", children: [
57750
57844
  /* @__PURE__ */ jsx182(LookGlyph, {}),
57751
57845
  /* @__PURE__ */ jsx182("span", { "aria-hidden": "true", className: "absolute right-1 top-1 h-1.5 w-1.5 rounded-full bg-primary" })
57752
57846
  ] }) }),
@@ -57761,13 +57855,13 @@ function TablePage({
57761
57855
  shrank on a narrow row, the look arriving on a sort pushed every control after it.
57762
57856
  A row too narrow for it scrolls sideways, as the row already does. */
57763
57857
  /* @__PURE__ */ jsxs170("span", { "aria-hidden": "true", className: "invisible flex shrink-0 items-center gap-1 overflow-hidden", "data-view-look-place": "", "data-toolbar-fit-gives": "", children: [
57764
- /* @__PURE__ */ jsx182(Button123, { size: "sm", variant: "outline", className: "h-8 w-8 shrink-0 px-0", tabIndex: -1, children: /* @__PURE__ */ jsx182(LookGlyph, {}) }),
57765
- /* @__PURE__ */ jsx182(Button123, { size: "sm", variant: "outline", className: "h-8 w-8 shrink-0 px-0", tabIndex: -1 })
57858
+ /* @__PURE__ */ jsx182(Button122, { size: "sm", variant: "outline", className: "h-8 w-8 shrink-0 px-0", tabIndex: -1, children: /* @__PURE__ */ jsx182(LookGlyph, {}) }),
57859
+ /* @__PURE__ */ jsx182(Button122, { size: "sm", variant: "outline", className: "h-8 w-8 shrink-0 px-0", tabIndex: -1 })
57766
57860
  ] })
57767
57861
  ) : lookShowing && main === "records" ? /* @__PURE__ */ jsxs170("span", { className: "flex shrink-0 items-center gap-1", "data-view-look": "", "data-toolbar-fit": "look", title: LOOK_WORDS.yours, children: [
57768
57862
  /* @__PURE__ */ jsx182("span", { className: "sr-only", children: LOOK_WORDS.yours }),
57769
57863
  /* @__PURE__ */ jsx182("span", { "aria-hidden": "true", className: "h-1.5 w-1.5 shrink-0 rounded-full bg-primary" }),
57770
- lookSavable ? /* @__PURE__ */ jsx182(Button123, { size: "sm", variant: "outline", className: "h-8 px-2 text-xs", onClick: () => void saveLookToView(), "data-view-look-save": "", children: LOOK_WORDS.saveToView }) : null,
57864
+ lookSavable ? /* @__PURE__ */ jsx182(Button122, { size: "sm", variant: "outline", className: "h-8 px-2 text-xs", onClick: () => void saveLookToView(), "data-view-look-save": "", children: LOOK_WORDS.saveToView }) : null,
57771
57865
  rights.write ? namingLook ? /* @__PURE__ */ jsxs170(
57772
57866
  "form",
57773
57867
  {
@@ -57788,11 +57882,11 @@ function TablePage({
57788
57882
  placeholder: "View name"
57789
57883
  }
57790
57884
  ),
57791
- /* @__PURE__ */ jsx182(Button123, { size: "sm", type: "submit", className: "h-8 px-2 text-xs", disabled: lookName.trim() === "", children: "Save" })
57885
+ /* @__PURE__ */ jsx182(Button122, { size: "sm", type: "submit", className: "h-8 px-2 text-xs", disabled: lookName.trim() === "", children: "Save" })
57792
57886
  ]
57793
57887
  }
57794
- ) : /* @__PURE__ */ jsx182(Button123, { size: "sm", variant: "ghost", className: "h-8 px-2 text-xs", onClick: () => setNamingLook(true), "data-view-look-save-new": "", children: LOOK_WORDS.saveAsNew }) : null,
57795
- /* @__PURE__ */ jsx182(Button123, { size: "sm", variant: "ghost", className: "h-8 px-2 text-xs", onClick: () => void resetLook(), "data-view-look-reset": "", children: LOOK_WORDS.reset })
57888
+ ) : /* @__PURE__ */ jsx182(Button122, { size: "sm", variant: "ghost", className: "h-8 px-2 text-xs", onClick: () => setNamingLook(true), "data-view-look-save-new": "", children: LOOK_WORDS.saveAsNew }) : null,
57889
+ /* @__PURE__ */ jsx182(Button122, { size: "sm", variant: "ghost", className: "h-8 px-2 text-xs", onClick: () => void resetLook(), "data-view-look-reset": "", children: LOOK_WORDS.reset })
57796
57890
  ] }) : null,
57797
57891
  /* @__PURE__ */ jsx182(
57798
57892
  "div",
@@ -57816,9 +57910,9 @@ function TablePage({
57816
57910
  "data-clipped": slotClipped
57817
57911
  }
57818
57912
  ),
57819
- rights.write && view && main === "records" && shownLayout !== "grid" ? /* @__PURE__ */ jsx182(Button123, { size: "sm", className: "shrink-0", onClick: () => show("new-record"), children: "New record" }) : null,
57913
+ rights.write && view && main === "records" && shownLayout !== "grid" ? /* @__PURE__ */ jsx182(Button122, { size: "sm", className: "shrink-0", onClick: () => show("new-record"), children: "New record" }) : null,
57820
57914
  openedFromMenu ? /* @__PURE__ */ jsx182(
57821
- Button123,
57915
+ Button122,
57822
57916
  {
57823
57917
  size: "sm",
57824
57918
  variant: "secondary",
@@ -57840,9 +57934,9 @@ function TablePage({
57840
57934
  {
57841
57935
  error: viewSaveRefused.error,
57842
57936
  actions: /* @__PURE__ */ jsxs170("span", { className: "flex flex-wrap gap-1 pt-0.5", "data-view-save-refused": "", children: [
57843
- /* @__PURE__ */ jsx182(Button123, { size: "sm", variant: "outline", onClick: () => void patchView(viewSaveRefused.patch), children: "Try again" }),
57937
+ /* @__PURE__ */ jsx182(Button122, { size: "sm", variant: "outline", onClick: () => void patchView(viewSaveRefused.patch), children: "Try again" }),
57844
57938
  /* @__PURE__ */ jsx182(
57845
- Button123,
57939
+ Button122,
57846
57940
  {
57847
57941
  size: "sm",
57848
57942
  variant: "ghost",
@@ -58103,10 +58197,10 @@ import { formatCount as formatCount9 } from "@ai-matrx/kit/format";
58103
58197
  import { TapTargetSearchGroup as TapTargetSearchGroup2, TooltipProvider } from "@ai-matrx/design-system";
58104
58198
  import { MatrxTableCardShowMore as MatrxTableCardShowMore3 } from "@ai-matrx/design-system/data-table";
58105
58199
  import { useEffect as useEffect132, useMemo as useMemo86, useRef as useRef69, useState as useState157 } from "react";
58106
- import { Button as Button124, ErrorBox as ErrorBox9, Input as Input13, cn as cn105 } from "@ai-matrx/design-system";
58200
+ import { Button as Button123, ErrorBox as ErrorBox9, Input as Input13, cn as cn105 } from "@ai-matrx/design-system";
58107
58201
  import { SEED_FRESH_MS, useRecordsClient as useRecordsClient109, useSeededAnswerAt } from "@ai-matrx/records/react";
58108
58202
  init_plainWords();
58109
- import { Fragment as Fragment77, jsx as jsx183, jsxs as jsxs171 } from "react/jsx-runtime";
58203
+ import { Fragment as Fragment76, jsx as jsx183, jsxs as jsxs171 } from "react/jsx-runtime";
58110
58204
  var entityTitleColumn = entityNameColumn;
58111
58205
  function shown4(v) {
58112
58206
  if (v === null || v === void 0 || v === "") return "";
@@ -58295,11 +58389,11 @@ function EntityTablePageBody({
58295
58389
  presentation === "page" ? /* @__PURE__ */ jsx183("h2", { className: "truncate text-base font-semibold", children: entity.label ?? (entity.loading ? "Loading\u2026" : "Table") }) : null,
58296
58390
  presentation === "page" ? /* @__PURE__ */ jsx183("span", { className: "text-xs tabular-nums text-muted-foreground", children: entity.loading || entity.total === null ? "" : formatCount9(entity.total) }) : null,
58297
58391
  /* @__PURE__ */ jsxs171("span", { className: "ml-auto flex items-center gap-1", children: [
58298
- boardable ? /* @__PURE__ */ jsxs171(Fragment77, { children: [
58299
- /* @__PURE__ */ jsx183(Button124, { size: "sm", variant: layout === "grid" ? "secondary" : "ghost", "aria-pressed": layout === "grid", onClick: () => choose("grid"), children: "Table" }),
58300
- /* @__PURE__ */ jsx183(Button124, { size: "sm", variant: layout === "board" ? "secondary" : "ghost", "aria-pressed": layout === "board", onClick: () => choose("board"), children: "Board" })
58392
+ boardable ? /* @__PURE__ */ jsxs171(Fragment76, { children: [
58393
+ /* @__PURE__ */ jsx183(Button123, { size: "sm", variant: layout === "grid" ? "secondary" : "ghost", "aria-pressed": layout === "grid", onClick: () => choose("grid"), children: "Table" }),
58394
+ /* @__PURE__ */ jsx183(Button123, { size: "sm", variant: layout === "board" ? "secondary" : "ghost", "aria-pressed": layout === "board", onClick: () => choose("board"), children: "Board" })
58301
58395
  ] }) : null,
58302
- entity.creatable && naming === null ? /* @__PURE__ */ jsx183(Button124, { size: "sm", variant: "ghost", onClick: () => {
58396
+ entity.creatable && naming === null ? /* @__PURE__ */ jsx183(Button123, { size: "sm", variant: "ghost", onClick: () => {
58303
58397
  setAddRefused(null);
58304
58398
  setNaming("");
58305
58399
  }, children: "New page" }) : null,
@@ -58334,7 +58428,7 @@ function EntityTablePageBody({
58334
58428
  ] })
58335
58429
  ] }) : null,
58336
58430
  addRefused ? /* @__PURE__ */ jsx183(ErrorBox9, { className: "rounded border border-destructive/40 px-1.5 py-1 text-xs text-destructive", message: addRefused, operation: "Add a row", origin: "records-ui/entityViews" }) : null,
58337
- entity.error ? /* @__PURE__ */ jsx183("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: `This table could not be read: ${entity.error}` }) : layout === "board" && boardable ? /* @__PURE__ */ jsx183(EntityBoard, { entity, groupBy, onOpenRecord }) : /* @__PURE__ */ jsxs171(Fragment77, { children: [
58431
+ entity.error ? /* @__PURE__ */ jsx183("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: `This table could not be read: ${entity.error}` }) : layout === "board" && boardable ? /* @__PURE__ */ jsx183(EntityBoard, { entity, groupBy, onOpenRecord }) : /* @__PURE__ */ jsxs171(Fragment76, { children: [
58338
58432
  presentation === "embedded" && searchBox ? /* @__PURE__ */ jsx183("div", { className: "flex min-w-0 items-center justify-end", "data-records-entity-search": "", children: /* @__PURE__ */ jsx183(TooltipProvider, { children: /* @__PURE__ */ jsx183(
58339
58433
  TapTargetSearchGroup2,
58340
58434
  {
@@ -58398,7 +58492,7 @@ init_names();
58398
58492
  import { useEffect as useEffect133, useMemo as useMemo87 } from "react";
58399
58493
  import { isEntityReferenceConfig } from "@ai-matrx/records";
58400
58494
  import { useFields as useFields40, useTable as useTable41 } from "@ai-matrx/records/react";
58401
- import { BasicInput as BasicInput38, Button as Button125, CreatablePicker as CreatablePicker3, cn as cn106 } from "@ai-matrx/design-system";
58495
+ import { BasicInput as BasicInput38, Button as Button124, CreatablePicker as CreatablePicker3, cn as cn106 } from "@ai-matrx/design-system";
58402
58496
  import { jsx as jsx185, jsxs as jsxs172 } from "react/jsx-runtime";
58403
58497
  var DATA_BINDING_SHAPES = [
58404
58498
  { value: "collection", label: "The whole table" },
@@ -58534,7 +58628,7 @@ function BindingDetails({
58534
58628
  const setTemplate = (next) => onChange({ ...binding, transform: { join: "\n", ...binding.transform, name: "list", template: next } });
58535
58629
  return /* @__PURE__ */ jsxs172("div", { className: "flex flex-col gap-2", children: [
58536
58630
  /* @__PURE__ */ jsx185("div", { className: "flex flex-wrap gap-1", role: "radiogroup", "aria-label": "What to read", children: DATA_BINDING_SHAPES.map((s) => /* @__PURE__ */ jsx185(
58537
- Button125,
58631
+ Button124,
58538
58632
  {
58539
58633
  type: "button",
58540
58634
  size: "sm",
@@ -58584,7 +58678,7 @@ function BindingDetails({
58584
58678
  }
58585
58679
  ),
58586
58680
  !disabled && /* @__PURE__ */ jsx185("div", { className: "flex flex-wrap gap-1", children: fieldList.flatMap(bindingPlaceholdersFor).map((p) => /* @__PURE__ */ jsx185(
58587
- Button125,
58681
+ Button124,
58588
58682
  {
58589
58683
  type: "button",
58590
58684
  size: "sm",
@@ -58618,7 +58712,7 @@ function BindingDetails({
58618
58712
  /* @__PURE__ */ jsxs172("div", { className: "flex flex-wrap items-center gap-1", role: "radiogroup", "aria-label": "If nothing is found", children: [
58619
58713
  /* @__PURE__ */ jsx185("span", { className: "text-xs text-muted-foreground", children: "If nothing is found" }),
58620
58714
  DATA_BINDING_MISSING.map((m) => /* @__PURE__ */ jsx185(
58621
- Button125,
58715
+ Button124,
58622
58716
  {
58623
58717
  type: "button",
58624
58718
  size: "sm",
@@ -58638,13 +58732,13 @@ function BindingDetails({
58638
58732
  // src/PickedSummaries.tsx
58639
58733
  import { useFields as useFields41, useRecord as useRecord6, useTable as useTable42 } from "@ai-matrx/records/react";
58640
58734
  init_names();
58641
- import { Fragment as Fragment78, jsx as jsx186, jsxs as jsxs173 } from "react/jsx-runtime";
58735
+ import { Fragment as Fragment77, jsx as jsx186, jsxs as jsxs173 } from "react/jsx-runtime";
58642
58736
  function TableNameText({ dataSource, tableId }) {
58643
58737
  const tables = useTablesAnywhere(dataSource);
58644
- if (!tableId) return /* @__PURE__ */ jsx186(Fragment78, { children: "\u2014" });
58645
- if (tables.loading) return /* @__PURE__ */ jsx186(Fragment78, { children: "\u2026" });
58646
- if (tables.error) return /* @__PURE__ */ jsx186(Fragment78, { children: "Couldn't load the table's name" });
58647
- return /* @__PURE__ */ jsx186(Fragment78, { children: tables.rows.find((t) => t.table_id === tableId)?.table_name ?? "\u2014" });
58738
+ if (!tableId) return /* @__PURE__ */ jsx186(Fragment77, { children: "\u2014" });
58739
+ if (tables.loading) return /* @__PURE__ */ jsx186(Fragment77, { children: "\u2026" });
58740
+ if (tables.error) return /* @__PURE__ */ jsx186(Fragment77, { children: "Couldn't load the table's name" });
58741
+ return /* @__PURE__ */ jsx186(Fragment77, { children: tables.rows.find((t) => t.table_id === tableId)?.table_name ?? "\u2014" });
58648
58742
  }
58649
58743
  function ColumnValuesText({
58650
58744
  dataSource,
@@ -58652,15 +58746,15 @@ function ColumnValuesText({
58652
58746
  tableId,
58653
58747
  value
58654
58748
  }) {
58655
- if (!tableId) return /* @__PURE__ */ jsx186(Fragment78, { children: "\u2014" });
58749
+ if (!tableId) return /* @__PURE__ */ jsx186(Fragment77, { children: "\u2014" });
58656
58750
  return /* @__PURE__ */ jsx186(
58657
58751
  TableScope,
58658
58752
  {
58659
58753
  dataSource,
58660
58754
  userId,
58661
58755
  tableId,
58662
- fallback: /* @__PURE__ */ jsx186(Fragment78, { children: "\u2026" }),
58663
- unavailable: /* @__PURE__ */ jsx186(Fragment78, { children: "Couldn't load this table's columns" }),
58756
+ fallback: /* @__PURE__ */ jsx186(Fragment77, { children: "\u2026" }),
58757
+ unavailable: /* @__PURE__ */ jsx186(Fragment77, { children: "Couldn't load this table's columns" }),
58664
58758
  children: /* @__PURE__ */ jsx186(RecordLabelProvider, { children: /* @__PURE__ */ jsx186(ColumnValuesWords, { tableId, value }) })
58665
58759
  }
58666
58760
  );
@@ -58668,8 +58762,8 @@ function ColumnValuesText({
58668
58762
  function ColumnValuesWords({ tableId, value }) {
58669
58763
  const fields = useFields41(tableId);
58670
58764
  const labels = useRecordLabels(fields.data ?? void 0);
58671
- if (fields.loading) return /* @__PURE__ */ jsx186(Fragment78, { children: "\u2026" });
58672
- if (fields.error) return /* @__PURE__ */ jsx186(Fragment78, { children: "Couldn't load this table's columns" });
58765
+ if (fields.loading) return /* @__PURE__ */ jsx186(Fragment77, { children: "\u2026" });
58766
+ if (fields.error) return /* @__PURE__ */ jsx186(Fragment77, { children: "Couldn't load this table's columns" });
58673
58767
  const parts = [];
58674
58768
  for (const [key, stored] of Object.entries(value)) {
58675
58769
  if (key.startsWith("_")) continue;
@@ -58683,7 +58777,7 @@ function ColumnValuesWords({ tableId, value }) {
58683
58777
  ] }, key)
58684
58778
  );
58685
58779
  }
58686
- return parts.length ? /* @__PURE__ */ jsx186(Fragment78, { children: parts }) : /* @__PURE__ */ jsx186(Fragment78, { children: "\u2014" });
58780
+ return parts.length ? /* @__PURE__ */ jsx186(Fragment77, { children: parts }) : /* @__PURE__ */ jsx186(Fragment77, { children: "\u2014" });
58687
58781
  }
58688
58782
  function RecordNameText({
58689
58783
  dataSource,
@@ -58691,15 +58785,15 @@ function RecordNameText({
58691
58785
  tableId,
58692
58786
  recordId
58693
58787
  }) {
58694
- if (!tableId || !recordId) return /* @__PURE__ */ jsx186(Fragment78, { children: "\u2014" });
58788
+ if (!tableId || !recordId) return /* @__PURE__ */ jsx186(Fragment77, { children: "\u2014" });
58695
58789
  return /* @__PURE__ */ jsx186(
58696
58790
  TableScope,
58697
58791
  {
58698
58792
  dataSource,
58699
58793
  userId,
58700
58794
  tableId,
58701
- fallback: /* @__PURE__ */ jsx186(Fragment78, { children: "\u2026" }),
58702
- unavailable: /* @__PURE__ */ jsx186(Fragment78, { children: "Couldn't load this record" }),
58795
+ fallback: /* @__PURE__ */ jsx186(Fragment77, { children: "\u2026" }),
58796
+ unavailable: /* @__PURE__ */ jsx186(Fragment77, { children: "Couldn't load this record" }),
58703
58797
  children: /* @__PURE__ */ jsx186(RecordNameWords, { tableId, recordId })
58704
58798
  }
58705
58799
  );
@@ -58707,16 +58801,16 @@ function RecordNameText({
58707
58801
  function RecordNameWords({ tableId, recordId }) {
58708
58802
  const table = useTable42(tableId);
58709
58803
  const record = useRecord6(recordId);
58710
- if (record.loading || table.loading) return /* @__PURE__ */ jsx186(Fragment78, { children: "\u2026" });
58711
- if (record.error) return /* @__PURE__ */ jsx186(Fragment78, { children: "Couldn't load this record" });
58712
- if (!record.data) return /* @__PURE__ */ jsx186(Fragment78, { children: "A record you cannot open" });
58713
- return /* @__PURE__ */ jsx186(Fragment78, { children: recordName(record.data.document, table.data?.title_field ?? null) });
58804
+ if (record.loading || table.loading) return /* @__PURE__ */ jsx186(Fragment77, { children: "\u2026" });
58805
+ if (record.error) return /* @__PURE__ */ jsx186(Fragment77, { children: "Couldn't load this record" });
58806
+ if (!record.data) return /* @__PURE__ */ jsx186(Fragment77, { children: "A record you cannot open" });
58807
+ return /* @__PURE__ */ jsx186(Fragment77, { children: recordName(record.data.document, table.data?.title_field ?? null) });
58714
58808
  }
58715
58809
 
58716
58810
  // src/HeldChangeDecision.tsx
58717
58811
  import { useEffect as useEffect134, useState as useState158 } from "react";
58718
58812
  import { RecordsProvider as RecordsProvider3, useRecordsClient as useRecordsClient110 } from "@ai-matrx/records/react";
58719
- import { Button as Button126 } from "@ai-matrx/design-system";
58813
+ import { Button as Button125 } from "@ai-matrx/design-system";
58720
58814
  init_Refusal();
58721
58815
  import { jsx as jsx187, jsxs as jsxs174 } from "react/jsx-runtime";
58722
58816
  function HeldChangeDecision({ dataSource, userId, organizationId, approvalId, onDecided, approveLabel }) {
@@ -58756,8 +58850,8 @@ function Decision({
58756
58850
  if (may === null) return /* @__PURE__ */ jsx187("p", { className: "text-xs text-muted-foreground", children: "Checking who can decide\u2026" });
58757
58851
  return /* @__PURE__ */ jsxs174("div", { className: "flex flex-col gap-1.5", children: [
58758
58852
  may ? /* @__PURE__ */ jsxs174("div", { className: "flex gap-2", children: [
58759
- /* @__PURE__ */ jsx187(Button126, { type: "button", size: "sm", disabled: busy !== null, onClick: () => void decide(true), children: busy === "approve" ? "Approving\u2026" : approveLabel }),
58760
- /* @__PURE__ */ jsx187(Button126, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void decide(false), children: busy === "refuse" ? "Refusing\u2026" : "Refuse" })
58853
+ /* @__PURE__ */ jsx187(Button125, { type: "button", size: "sm", disabled: busy !== null, onClick: () => void decide(true), children: busy === "approve" ? "Approving\u2026" : approveLabel }),
58854
+ /* @__PURE__ */ jsx187(Button125, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void decide(false), children: busy === "refuse" ? "Refusing\u2026" : "Refuse" })
58761
58855
  ] }) : !error && /* @__PURE__ */ jsx187("p", { className: "text-xs text-muted-foreground", children: "An owner or admin of this organization decides this." }),
58762
58856
  error ? /* @__PURE__ */ jsx187(RefusalLine, { error }) : null
58763
58857
  ] });
@@ -58769,7 +58863,7 @@ init_newTableColumns();
58769
58863
  // src/CalendarLinks.tsx
58770
58864
  init_Refusal();
58771
58865
  import { useCallback as useCallback72, useEffect as useEffect135, useState as useState159 } from "react";
58772
- import { Button as Button127 } from "@ai-matrx/design-system";
58866
+ import { Button as Button126 } from "@ai-matrx/design-system";
58773
58867
  import { jsx as jsx188, jsxs as jsxs175 } from "react/jsx-runtime";
58774
58868
  var day = (iso) => iso ? new Date(iso).toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" }) : null;
58775
58869
  function CalendarLinks({ port }) {
@@ -58814,7 +58908,7 @@ function CalendarLinks({ port }) {
58814
58908
  ] }),
58815
58909
  /* @__PURE__ */ jsxs175("div", { className: "flex shrink-0 gap-2", children: [
58816
58910
  /* @__PURE__ */ jsx188(
58817
- Button127,
58911
+ Button126,
58818
58912
  {
58819
58913
  size: "sm",
58820
58914
  variant: "outline",
@@ -58828,7 +58922,7 @@ function CalendarLinks({ port }) {
58828
58922
  }
58829
58923
  ),
58830
58924
  /* @__PURE__ */ jsx188(
58831
- Button127,
58925
+ Button126,
58832
58926
  {
58833
58927
  size: "sm",
58834
58928
  variant: "outline",