@ai-matrx/records-ui 0.116.74 → 0.116.75

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.cjs CHANGED
@@ -4742,7 +4742,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
4742
4742
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("th", { className: "px-2 py-1 text-left font-medium", children: source ? "The row" : "The row in your file" })
4743
4743
  ] }) }),
4744
4744
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tbody", { children: runRows.rows.map((row, i) => {
4745
- const source2 = row.source ?? {};
4745
+ const refusedRowSource = row.source ?? {};
4746
4746
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("tr", { className: "border-t align-top", children: [
4747
4747
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("td", { className: "px-2 py-1", children: typeof row.row === "number" ? lineInYourFile(row.row) : String(row.row ?? "") }),
4748
4748
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("td", { className: "px-2 py-1", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
@@ -4755,7 +4755,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
4755
4755
  )
4756
4756
  }
4757
4757
  ) }),
4758
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("td", { className: "max-w-96 px-2 py-1 text-muted-foreground", children: Object.entries(source2).map(([k, v]) => `${k}: ${String(v ?? "")}`).join(" \xB7 ") })
4758
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("td", { className: "max-w-96 px-2 py-1 text-muted-foreground", children: Object.entries(refusedRowSource).map(([k, v]) => `${k}: ${String(v ?? "")}`).join(" \xB7 ") })
4759
4759
  ] }, `${r.import_id}-${String(row.row ?? i)}`);
4760
4760
  }) })
4761
4761
  ] }) })
@@ -5965,7 +5965,7 @@ function BookingBuilder({ tableId, bookingId, onSaved, onClose, startNew, classN
5965
5965
  onValueChange: (v) => setLead(Number(v)),
5966
5966
  options: [0, 60, 120, 240, 1440].map((n) => ({
5967
5967
  value: String(n),
5968
- label: n === 0 ? "Right away" : n === 1440 ? "A day from now" : `${(0, import_format2.formatDurationMinutes)(n, { style: "long" })} from now`
5968
+ label: n === 0 ? "Right away" : n === 1440 ? "A day from now" : `${(0, import_format3.formatDurationMinutes)(n, { style: "long" })} from now`
5969
5969
  }))
5970
5970
  }
5971
5971
  )
@@ -6234,7 +6234,7 @@ function asksWhoTheyAre(askable) {
6234
6234
  return kind2 === "email" || kind2 === "phone";
6235
6235
  });
6236
6236
  }
6237
- var import_clipboard, import_design_system36, import_react64, import_react65, import_format2, import_records21, import_design_system37, import_controls2, import_jsx_runtime43, STORE_ANSWERS_THESE, DAYS, LENGTHS, WORKING_WEEK;
6237
+ var import_clipboard, import_design_system36, import_react64, import_react65, import_format3, import_records21, import_design_system37, import_controls2, import_jsx_runtime43, STORE_ANSWERS_THESE, DAYS, LENGTHS, WORKING_WEEK;
6238
6238
  var init_BookingBuilder = __esm({
6239
6239
  "src/BookingBuilder.tsx"() {
6240
6240
  "use strict";
@@ -6243,7 +6243,7 @@ var init_BookingBuilder = __esm({
6243
6243
  import_design_system36 = require("@ai-matrx/design-system");
6244
6244
  import_react64 = require("react");
6245
6245
  import_react65 = require("@ai-matrx/records/react");
6246
- import_format2 = require("@ai-matrx/kit/format");
6246
+ import_format3 = require("@ai-matrx/kit/format");
6247
6247
  import_records21 = require("@ai-matrx/records");
6248
6248
  import_design_system37 = require("@ai-matrx/design-system");
6249
6249
  import_controls2 = require("@ai-matrx/design-system/controls");
@@ -8164,6 +8164,7 @@ __export(src_exports, {
8164
8164
  FIELD_TYPE_CATALOGUE: () => FIELD_TYPE_CATALOGUE,
8165
8165
  FIELD_TYPE_CHOICES: () => FIELD_TYPE_CHOICES,
8166
8166
  FIELD_TYPE_GROUPS: () => FIELD_TYPE_GROUPS,
8167
+ FILL_OFF_REASON: () => FILL_OFF_REASON,
8167
8168
  FOOTER_WORDS: () => FOOTER_WORDS,
8168
8169
  FORMULA_OP_JOINS: () => FORMULA_OP_JOINS,
8169
8170
  FORMULA_OP_LABEL: () => FORMULA_OP_LABEL,
@@ -8503,6 +8504,7 @@ __export(src_exports, {
8503
8504
  fieldTypeChoice: () => fieldTypeChoice,
8504
8505
  fieldTypeLabel: () => fieldTypeLabel,
8505
8506
  fieldsForNewColumns: () => fieldsForNewColumns,
8507
+ fillEstimateWords: () => fillEstimateWords,
8506
8508
  filterTargets: () => filterTargets,
8507
8509
  fitTransform: () => fitTransform,
8508
8510
  flatWhere: () => question_exports.flatWhere,
@@ -11845,6 +11847,7 @@ async function forgetWrittenWords(client, tableId, key, written) {
11845
11847
  }
11846
11848
 
11847
11849
  // src/FieldRetype.tsx
11850
+ var import_format2 = require("@ai-matrx/kit/format");
11848
11851
  var import_jsx_runtime15 = require("react/jsx-runtime");
11849
11852
  var RETYPE_PREVIEW_DEBOUNCE_MS = 300;
11850
11853
  function scheduleRetypePreview(ask2, ms = RETYPE_PREVIEW_DEBOUNCE_MS) {
@@ -12068,7 +12071,7 @@ function FieldRetype({ field: field2, tableId, onRetyped }) {
12068
12071
  ] }) : null,
12069
12072
  to && preview && limitedHeld !== null ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { className: "text-[11px] text-muted-foreground", "data-records-retype-preview": "", "data-records-retype-limited": "", children: [
12070
12073
  "About ",
12071
- limitedHeld.toLocaleString(),
12074
+ (0, import_format2.formatCount)(limitedHeld),
12072
12075
  " values to change to ",
12073
12076
  to.label.toLowerCase(),
12074
12077
  "; any that do not fit are kept aside with their records, with the reason \u2014 nothing is deleted."
@@ -18200,19 +18203,19 @@ init_names();
18200
18203
  var import_text_case7 = require("@ai-matrx/kit/text-case");
18201
18204
 
18202
18205
  // src/archiveWords.ts
18203
- var import_format3 = require("@ai-matrx/kit/format");
18206
+ var import_format4 = require("@ai-matrx/kit/format");
18204
18207
  function archiveConfirmSentence(what) {
18205
18208
  const subject = what.trim() || "it";
18206
18209
  return `This archives ${subject}. It leaves this list, and you can restore it from the Archived view.`;
18207
18210
  }
18208
- var recordsWord = (n) => `${(0, import_format3.formatCount)(n)} record${n === 1 ? "" : "s"}`;
18211
+ var recordsWord = (n) => `${(0, import_format4.formatCount)(n)} record${n === 1 ? "" : "s"}`;
18209
18212
  function tableArchiveSentence(s) {
18210
18213
  const p = s.progress;
18211
18214
  if (!p) return "Every record in it goes with it.";
18212
18215
  const done = p.total - p.remaining;
18213
- const sofar = `${(0, import_format3.formatCount)(done)} of ${recordsWord(p.total)} ${done === 1 ? "is" : "are"} put away`;
18216
+ const sofar = `${(0, import_format4.formatCount)(done)} of ${recordsWord(p.total)} ${done === 1 ? "is" : "are"} put away`;
18214
18217
  if (s.running) {
18215
- return `Archiving \u2014 ${(0, import_format3.formatCount)(done)} of ${recordsWord(p.total)} put away.${s.slowedDown ? " Busy, so it is taking smaller passes; it will still finish." : ""}`;
18218
+ return `Archiving \u2014 ${(0, import_format4.formatCount)(done)} of ${recordsWord(p.total)} put away.${s.slowedDown ? " Busy, so it is taking smaller passes; it will still finish." : ""}`;
18216
18219
  }
18217
18220
  if (p.in_progress && !s.failed && !(s.passesHere ?? 0)) {
18218
18221
  return `Archiving this table was started and not finished: ${sofar}. Carry on and it picks up where it stopped.`;
@@ -21627,7 +21630,7 @@ var import_react98 = require("@ai-matrx/records/react");
21627
21630
  init_host();
21628
21631
 
21629
21632
  // src/whoChanged.ts
21630
- var import_format4 = require("@ai-matrx/kit/format");
21633
+ var import_format5 = require("@ai-matrx/kit/format");
21631
21634
  var import_global_slot2 = require("@ai-matrx/kit/global-slot");
21632
21635
  var import_text_case8 = require("@ai-matrx/kit/text-case");
21633
21636
  var displayZone = (0, import_global_slot2.globalSlot)("ai-matrx.design-system.display-time-zone", () => ({ zone: null }));
@@ -21648,7 +21651,7 @@ function whenWords(at, now = /* @__PURE__ */ new Date()) {
21648
21651
  const then = new Date(at);
21649
21652
  const age = now.getTime() - then.getTime();
21650
21653
  if (!Number.isFinite(age)) return "at an unknown time";
21651
- if (age < 30 * 864e5) return (0, import_format4.formatRelativeTime)(then, { style: "intl", now: now.getTime() });
21654
+ if (age < 30 * 864e5) return (0, import_format5.formatRelativeTime)(then, { style: "intl", now: now.getTime() });
21652
21655
  return then.toLocaleDateString(void 0, displayZone.zone ? { timeZone: displayZone.zone } : void 0);
21653
21656
  }
21654
21657
  var OPERATION_WORDS = {
@@ -23430,10 +23433,10 @@ function useTableDecorations(tableId, revision) {
23430
23433
  // src/emptyState.tsx
23431
23434
  var import_records38 = require("@ai-matrx/records");
23432
23435
  var import_design_system60 = require("@ai-matrx/design-system");
23433
- var import_format5 = require("@ai-matrx/kit/format");
23436
+ var import_format6 = require("@ai-matrx/kit/format");
23434
23437
  var import_jsx_runtime71 = require("react/jsx-runtime");
23435
23438
  function lockedRowsWords(count) {
23436
- return `${(0, import_format5.formatCount)(count)} ${count === 1 ? "record" : "records"} you can't open`;
23439
+ return `${(0, import_format6.formatCount)(count)} ${count === 1 ? "record" : "records"} you can't open`;
23437
23440
  }
23438
23441
  function questionIsAsked(args) {
23439
23442
  if ((args.search ?? "").trim() !== "") return true;
@@ -23564,14 +23567,14 @@ var import_react148 = require("react");
23564
23567
  var import_react149 = require("@ai-matrx/records/react");
23565
23568
  var import_design_system80 = require("@ai-matrx/design-system");
23566
23569
  var import_data_table10 = require("@ai-matrx/design-system/data-table");
23567
- var import_format8 = require("@ai-matrx/kit/format");
23570
+ var import_format9 = require("@ai-matrx/kit/format");
23568
23571
 
23569
23572
  // src/pointsCost.ts
23570
- var import_format6 = require("@ai-matrx/kit/format");
23573
+ var import_format7 = require("@ai-matrx/kit/format");
23571
23574
  function costInPoints(cents, rate) {
23572
23575
  if (cents === null || cents === void 0 || !Number.isFinite(cents)) return null;
23573
- const points = (0, import_format6.usdToPoints)(cents / 100, { rate: rate ?? null });
23574
- return points === null ? null : (0, import_format6.formatPoints)(points);
23576
+ const points = (0, import_format7.usdToPoints)(cents / 100, { rate: rate ?? null });
23577
+ return points === null ? null : (0, import_format7.formatPoints)(points);
23575
23578
  }
23576
23579
 
23577
23580
  // src/Enrich.tsx
@@ -23579,13 +23582,85 @@ var import_react109 = require("react");
23579
23582
  var import_react110 = require("@ai-matrx/records/react");
23580
23583
  var import_records39 = require("@ai-matrx/records");
23581
23584
  var import_design_system61 = require("@ai-matrx/design-system");
23582
- var import_format7 = require("@ai-matrx/kit/format");
23585
+ var import_format8 = require("@ai-matrx/kit/format");
23583
23586
  init_Refusal();
23584
23587
  init_refusals();
23585
23588
  init_host();
23586
23589
  init_parity();
23590
+ var import_text_case10 = require("@ai-matrx/kit/text-case");
23591
+
23592
+ // src/valueSource.ts
23593
+ var import_uuid8 = require("@ai-matrx/kit/uuid");
23594
+ var import_text_case9 = require("@ai-matrx/kit/text-case");
23595
+ var ISO_MOMENT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/;
23596
+ function readable(value) {
23597
+ if (typeof value !== "string") return null;
23598
+ const t = value.trim();
23599
+ if (!t || (0, import_uuid8.isUuidShape)(t) || ISO_MOMENT.test(t)) return null;
23600
+ return t;
23601
+ }
23602
+ function sourceModelName(source) {
23603
+ if (!source) return null;
23604
+ return readable(source.model_name) ?? readable(source.model);
23605
+ }
23606
+ function readNames(read, nameOf3) {
23607
+ if (!Array.isArray(read)) return [];
23608
+ const out = [];
23609
+ for (const item of read) {
23610
+ const key = typeof item === "string" ? item : item && typeof item === "object" ? item.field ?? item.key ?? item.url : null;
23611
+ if (typeof key !== "string" || !key.trim()) continue;
23612
+ if (/^https?:\/\//.test(key)) out.push(key);
23613
+ else if (!(0, import_uuid8.isUuidShape)(key)) out.push(nameOf3(key) ?? (0, import_text_case9.humanizeIdentifier)(key));
23614
+ }
23615
+ return [...new Set(out)];
23616
+ }
23617
+ function sourceWords(source, nameOf3 = () => void 0) {
23618
+ if (!source || typeof source !== "object") return null;
23619
+ const kind2 = typeof source.kind === "string" ? source.kind : null;
23620
+ if (kind2 === "enrichment" || kind2 === "agent" || kind2 === "ai") {
23621
+ const model = sourceModelName(source);
23622
+ const read = readNames(source.read, nameOf3);
23623
+ const sure = typeof source.confidence === "number" ? `${Math.round(source.confidence * 100)}% sure` : null;
23624
+ const asked4 = readable(source.instruction);
23625
+ let s = `Filled in by ${model ? model : "a model"}`;
23626
+ if (read.length > 0) s += ` from ${read.join(", ")}`;
23627
+ if (sure) s += `, ${sure}`;
23628
+ s += ".";
23629
+ if (asked4) s += ` Asked: \u201C${asked4}\u201D`;
23630
+ return s;
23631
+ }
23632
+ if (kind2 === "import") {
23633
+ const file = readable(source.file) ?? readable(source.file_name) ?? readable(source.name);
23634
+ const format = readable(source.format);
23635
+ const row = typeof source.row === "number" ? `, row ${source.row}` : "";
23636
+ return `Imported from ${file ? `\u201C${file}\u201D` : format ? `a ${format.toUpperCase()} file` : "a file"}${row}.`;
23637
+ }
23638
+ if (kind2 === "form") return "Answered on a form.";
23639
+ if (kind2 === "capture") return "Captured on a device.";
23640
+ if (kind2 === "move") return "Moved here from an older table.";
23641
+ if (kind2 === "follow") return "Carried over when this record moved.";
23642
+ const note = readable(source.note);
23643
+ if (kind2) return `${(0, import_text_case9.humanizeIdentifier)(kind2)}${note ? `: ${note}` : ""}.`;
23644
+ return note;
23645
+ }
23646
+
23647
+ // src/Enrich.tsx
23587
23648
  init_plainWords();
23588
23649
  var import_jsx_runtime73 = require("react/jsx-runtime");
23650
+ function fillEstimateWords(args) {
23651
+ const each = args.perRowCents ?? args.previewPerRowCents;
23652
+ if (each !== null) {
23653
+ const total = costInPoints(each * args.count, args.rate);
23654
+ if (total !== null) return `about ${total}`;
23655
+ }
23656
+ if (args.estimate === "asking") return null;
23657
+ if (args.estimate && args.estimate.basis !== "none" && args.estimate.costCents !== null) {
23658
+ const total = costInPoints(args.estimate.costCents, args.rate);
23659
+ if (total !== null) return `about ${total}${args.estimate.extraReads ? " or more" : ""}`;
23660
+ }
23661
+ return "no estimate";
23662
+ }
23663
+ var FILL_OFF_REASON = "Switch it on to fill";
23589
23664
  var NO_ENRICH_REASON = "Having an agent fill this column is not switched on here yet, so this panel does not offer it rather than offering something that cannot happen. Everything else on this panel works. It is on our list, not yours.";
23590
23665
  function cellState(cell2) {
23591
23666
  if (!cell2 || !cell2.agent_owned) return "none";
@@ -23595,7 +23670,7 @@ function cellState(cell2) {
23595
23670
  return "none";
23596
23671
  }
23597
23672
  function ago(at) {
23598
- return at ? (0, import_format7.formatRelativeTime)(at, { style: "intl", fallback: "" }) : "";
23673
+ return at ? (0, import_format8.formatRelativeTime)(at, { style: "intl", fallback: "" }) : "";
23599
23674
  }
23600
23675
  function EnrichBadge({ cell: cell2, onPin, className }) {
23601
23676
  const state2 = cellState(cell2);
@@ -23628,15 +23703,14 @@ function EnrichBadge({ cell: cell2, onPin, className }) {
23628
23703
  ago(cell2.written_at),
23629
23704
  "."
23630
23705
  ] }) : null,
23631
- source.model ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("p", { className: "text-muted-foreground", children: [
23632
- String(source.model),
23633
- source.model_version ? ` (${String(source.model_version)})` : "",
23706
+ source.model || typeof source.confidence === "number" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("p", { className: "text-muted-foreground", children: [
23707
+ sourceModelName(source) ?? "A model",
23634
23708
  typeof source.confidence === "number" ? ` \xB7 ${Math.round(source.confidence * 100)}% sure` : ""
23635
23709
  ] }) : null,
23636
23710
  source.note ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("p", { className: "text-muted-foreground", children: String(source.note) }) : null,
23637
23711
  read.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { children: [
23638
23712
  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("p", { className: "text-muted-foreground", children: "What it read" }),
23639
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("ul", { className: "list-inside list-disc", children: read.slice(0, 4).map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("li", { className: "truncate", children: String(r.title ?? r.url ?? "") }, i)) })
23713
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("ul", { className: "list-inside list-disc", children: read.slice(0, 4).map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("li", { className: "truncate", children: r.title ? String(r.title) : /^https?:\/\//.test(String(r.url ?? "")) ? String(r.url) : (0, import_text_case10.humanizeIdentifier)(String(r.url ?? "")) }, i)) })
23640
23714
  ] }) : null,
23641
23715
  alternates.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { children: [
23642
23716
  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("p", { className: "text-muted-foreground", children: state2 === "unsure" ? "What it considered" : "What it nearly said instead" }),
@@ -23714,6 +23788,8 @@ function EnrichPanel({ tableId, fieldId, className }) {
23714
23788
  const [preview, setPreview] = (0, import_react109.useState)(null);
23715
23789
  const [fillN, setFillN] = (0, import_react109.useState)({});
23716
23790
  const [confirming, setConfirming] = (0, import_react109.useState)(null);
23791
+ const [estimate, setEstimate] = (0, import_react109.useState)(null);
23792
+ const [previewCost, setPreviewCost] = (0, import_react109.useState)({});
23717
23793
  const [draft, setDraft] = (0, import_react109.useState)({});
23718
23794
  const load = (0, import_react109.useCallback)(async () => {
23719
23795
  const answered = await client.enrichments({ table_id: tableId });
@@ -23780,6 +23856,10 @@ function EnrichPanel({ tableId, fieldId, className }) {
23780
23856
  });
23781
23857
  setBusy(null);
23782
23858
  setOutcome({ ...answered, fieldId: row.field_id });
23859
+ const asked4 = answered.wouldWrite?.length ?? 0;
23860
+ if (previewOnly && answered.ok && typeof answered.costCents === "number" && answered.costCents > 0 && asked4 > 0) {
23861
+ setPreviewCost((prev) => ({ ...prev, [row.field_id]: answered.costCents / asked4 }));
23862
+ }
23783
23863
  if (!previewOnly) await load();
23784
23864
  },
23785
23865
  [host, load, tableId]
@@ -23788,12 +23868,17 @@ function EnrichPanel({ tableId, fieldId, className }) {
23788
23868
  (row, count) => {
23789
23869
  if (count > FILL_TRY_MAX) {
23790
23870
  setConfirming({ fieldId: row.field_id, count });
23871
+ if (row.cost_per_row_cents === null && previewCost[row.field_id] === void 0 && host.estimateFill) {
23872
+ const key = `${row.field_id}:${count}`;
23873
+ setEstimate({ key, value: "asking" });
23874
+ void host.estimateFill({ tableId, fieldId: row.field_id, rows: count }).then((value) => setEstimate((prev) => prev?.key === key ? { key, value } : prev)).catch(() => setEstimate((prev) => prev?.key === key ? { key, value: null } : prev));
23875
+ }
23791
23876
  return;
23792
23877
  }
23793
23878
  setConfirming(null);
23794
23879
  void runIt(row, false, count);
23795
23880
  },
23796
- [runIt]
23881
+ [runIt, previewCost, host, tableId]
23797
23882
  );
23798
23883
  if (error) return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(RefusalNotice, { error, className });
23799
23884
  if (rows === null) return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_design_system61.Skeleton, { className: (0, import_design_system61.cn)("h-40 w-full", className) });
@@ -24064,6 +24149,7 @@ function EnrichPanel({ tableId, fieldId, className }) {
24064
24149
  size: "sm",
24065
24150
  variant: "outline",
24066
24151
  disabled: busy === row.field_id || !row.enabled || fillCountFrom(fillN[row.field_id] ?? FILL_N_DEFAULT) === null,
24152
+ title: row.enabled ? void 0 : FILL_OFF_REASON,
24067
24153
  "data-enrich-fill-rows": "",
24068
24154
  onClick: () => {
24069
24155
  const n = fillCountFrom(fillN[row.field_id] ?? FILL_N_DEFAULT);
@@ -24081,6 +24167,7 @@ function EnrichPanel({ tableId, fieldId, className }) {
24081
24167
  {
24082
24168
  size: "sm",
24083
24169
  disabled: busy === row.field_id || !row.enabled,
24170
+ title: row.enabled ? void 0 : FILL_OFF_REASON,
24084
24171
  "data-enrich-fill-due": "",
24085
24172
  onClick: () => startFill(row, dueRowsEstimate(row)),
24086
24173
  children: "Fill in what is due"
@@ -24088,13 +24175,37 @@ function EnrichPanel({ tableId, fieldId, className }) {
24088
24175
  )
24089
24176
  ] }) : null
24090
24177
  ] }) : null,
24178
+ rights.admin && host.enrich && !row.enabled ? (
24179
+ // WHY FILL IS GREY, said where it is (CD-AI-04): the column is off, and the one fix is right here.
24180
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("p", { className: "flex items-center gap-2 text-xs text-muted-foreground", "data-enrich-fill-off": "", children: [
24181
+ FILL_OFF_REASON,
24182
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
24183
+ import_design_system61.Button,
24184
+ {
24185
+ size: "sm",
24186
+ variant: "outline",
24187
+ className: "h-7",
24188
+ disabled: busy === row.field_id,
24189
+ "data-enrich-turn-on": "",
24190
+ onClick: () => void save(row, { enabled: true }),
24191
+ children: "Turn on"
24192
+ }
24193
+ )
24194
+ ] })
24195
+ ) : null,
24091
24196
  confirming && confirming.fieldId === row.field_id ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "space-y-2 rounded border p-2 text-xs", role: "alertdialog", "data-enrich-confirm": "", children: [
24092
24197
  /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("p", { children: [
24093
24198
  `Fill ${confirming.count} rows`,
24094
24199
  (() => {
24095
- const each = row.cost_per_row_cents === null ? null : Number(row.cost_per_row_cents);
24096
- const total = each === null ? null : costInPoints(each * confirming.count, host.pointsRate);
24097
- return total !== null ? ` \xB7 about ${total}` : " \xB7 no estimate yet, it has not run";
24200
+ const key = `${row.field_id}:${confirming.count}`;
24201
+ const words2 = fillEstimateWords({
24202
+ count: confirming.count,
24203
+ perRowCents: row.cost_per_row_cents === null ? null : Number(row.cost_per_row_cents),
24204
+ previewPerRowCents: previewCost[row.field_id] ?? null,
24205
+ estimate: estimate?.key === key ? estimate.value : null,
24206
+ rate: host.pointsRate
24207
+ });
24208
+ return words2 === null ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_design_system61.Skeleton, { className: "ml-1 inline-block h-3 w-16 align-middle" }) : ` \xB7 ${words2}`;
24098
24209
  })()
24099
24210
  ] }),
24100
24211
  /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex gap-2", children: [
@@ -28350,7 +28461,7 @@ function useMergedGridControls(args) {
28350
28461
  filterOptions: options.map((o) => {
28351
28462
  const spellings = [...new Set([o.id, o.key, o.label].filter((x) => typeof x === "string" && x !== ""))];
28352
28463
  const n = counted ? spellings.reduce((sum, word) => sum + (counted.get(word) ?? 0), 0) : null;
28353
- return { value: holdsKeys ? o.key : o.id, label: n === null ? o.label : `${o.label} (${(0, import_format8.formatCount)(n)})` };
28464
+ return { value: holdsKeys ? o.key : o.id, label: n === null ? o.label : `${o.label} (${(0, import_format9.formatCount)(n)})` };
28354
28465
  })
28355
28466
  };
28356
28467
  },
@@ -29122,7 +29233,7 @@ init_Refusal();
29122
29233
  init_host();
29123
29234
  init_recordVersions();
29124
29235
  init_names();
29125
- var import_text_case9 = require("@ai-matrx/kit/text-case");
29236
+ var import_text_case11 = require("@ai-matrx/kit/text-case");
29126
29237
 
29127
29238
  // src/StandardRecordForm.tsx
29128
29239
  var import_react152 = require("react");
@@ -29908,7 +30019,7 @@ function CustomRecordForm({
29908
30019
  Object.entries(said2.conflict.contested_fields).map(([key, theirs]) => {
29909
30020
  const column = (fields.data ?? []).find((f) => f.key === key);
29910
30021
  return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("p", { className: "text-[11px]", children: [
29911
- column ? fieldName(column) : (0, import_text_case9.humanizeIdentifier)(key),
30022
+ column ? fieldName(column) : (0, import_text_case11.humanizeIdentifier)(key),
29912
30023
  ": yours",
29913
30024
  " ",
29914
30025
  /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("strong", { children: asWords(draft[key]) }),
@@ -30826,7 +30937,7 @@ var BACK_LINK_COLUMN_PX = KIND_COLUMN_PX.relation;
30826
30937
  // src/gridColumns.tsx
30827
30938
  init_parity();
30828
30939
  init_names();
30829
- var import_text_case10 = require("@ai-matrx/kit/text-case");
30940
+ var import_text_case12 = require("@ai-matrx/kit/text-case");
30830
30941
  init_choiceLooks();
30831
30942
  var import_jsx_runtime98 = require("react/jsx-runtime");
30832
30943
  function workedOutFrom(field2) {
@@ -30880,7 +30991,7 @@ function pasteOntoFieldsOnly(plan, fields) {
30880
30991
  }
30881
30992
  function columnLabel(fields, columnId2) {
30882
30993
  const field2 = fields.find((f) => f.key === columnId2);
30883
- return field2 ? fieldName(field2) : (0, import_text_case10.humanizeIdentifier)(columnId2);
30994
+ return field2 ? fieldName(field2) : (0, import_text_case12.humanizeIdentifier)(columnId2);
30884
30995
  }
30885
30996
  function AddFieldButton({ onClick }) {
30886
30997
  return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
@@ -31553,7 +31664,7 @@ function withSubItems(columns, tree, collapsed, onToggle, onAddSubItem) {
31553
31664
 
31554
31665
  // src/Grid.tsx
31555
31666
  init_names();
31556
- var import_text_case12 = require("@ai-matrx/kit/text-case");
31667
+ var import_text_case14 = require("@ai-matrx/kit/text-case");
31557
31668
 
31558
31669
  // src/PastePreview.tsx
31559
31670
  var import_react164 = require("react");
@@ -32035,7 +32146,7 @@ var import_records45 = require("@ai-matrx/records");
32035
32146
  var import_react168 = require("@ai-matrx/records/react");
32036
32147
  var import_design_system89 = require("@ai-matrx/design-system");
32037
32148
  var import_controls4 = require("@ai-matrx/design-system/controls");
32038
- var import_text_case11 = require("@ai-matrx/kit/text-case");
32149
+ var import_text_case13 = require("@ai-matrx/kit/text-case");
32039
32150
  init_Refusal();
32040
32151
  init_names();
32041
32152
  var import_jsx_runtime103 = require("react/jsx-runtime");
@@ -32181,7 +32292,7 @@ function AsOfReading({
32181
32292
  ] });
32182
32293
  }
32183
32294
  return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("dl", { className: (0, import_design_system89.cn)(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__ */ (0, import_jsx_runtime103.jsxs)("div", { className: "contents", "data-as-of-field": field2.key, "data-as-of-differs": differs ? "" : void 0, children: [
32184
- /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("dt", { className: "truncate text-muted-foreground", title: fieldName(field2) || (0, import_text_case11.humanizeIdentifier)(field2.key), children: fieldName(field2) || (0, import_text_case11.humanizeIdentifier)(field2.key) }),
32295
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("dt", { className: "truncate text-muted-foreground", title: fieldName(field2) || (0, import_text_case13.humanizeIdentifier)(field2.key), children: fieldName(field2) || (0, import_text_case13.humanizeIdentifier)(field2.key) }),
32185
32296
  /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("dd", { className: (0, import_design_system89.cn)("min-w-0 truncate", differs && "rounded bg-amber-500/10 px-1"), children: differs ? /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(import_jsx_runtime103.Fragment, { children: [
32186
32297
  /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "font-medium", children: isEmpty2(was) ? "nothing" : scalarText(field2, was) }),
32187
32298
  /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "mx-1 text-muted-foreground", children: "\u2192" }),
@@ -32436,6 +32547,7 @@ function withNewRowValues(preset, data) {
32436
32547
  // src/loadAll.tsx
32437
32548
  var import_react175 = require("react");
32438
32549
  var import_design_system92 = require("@ai-matrx/design-system");
32550
+ var import_format10 = require("@ai-matrx/kit/format");
32439
32551
  var import_jsx_runtime108 = require("react/jsx-runtime");
32440
32552
  var LOAD_ALL_AFTER = 1e3;
32441
32553
  var LOAD_ALL_CHUNK = 500;
@@ -32492,17 +32604,17 @@ function LoadAllLine({
32492
32604
  onLoad,
32493
32605
  onBack
32494
32606
  }) {
32495
- const n = total.toLocaleString();
32607
+ const n = (0, import_format10.formatCount)(total);
32496
32608
  return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "flex items-center gap-2 px-2 py-1 text-xs text-muted-foreground", "data-records-load-all": "", children: state2.rows ? /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
32497
32609
  /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("span", { role: "status", children: [
32498
32610
  "All ",
32499
- state2.rows.length.toLocaleString(),
32611
+ (0, import_format10.formatCount)(state2.rows.length),
32500
32612
  " loaded"
32501
32613
  ] }),
32502
32614
  /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_design_system92.Button, { size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: onBack, "data-records-load-all-back": "", children: "Back to pages" })
32503
32615
  ] }) : state2.loading ? /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("span", { role: "status", "data-records-load-all-progress": "", children: [
32504
32616
  "Loading ",
32505
- state2.loaded.toLocaleString(),
32617
+ (0, import_format10.formatCount)(state2.loaded),
32506
32618
  " of ",
32507
32619
  n
32508
32620
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
@@ -34586,7 +34698,7 @@ function GridBody({
34586
34698
  const field2 = (fields.data ?? []).find((f) => f.key === write.key);
34587
34699
  const name = changedRecordName(table.data, rows.find((r) => r.id === write.rowId)?.document ?? {}, write.key, write.after);
34588
34700
  undo.push({
34589
- label: `Changed ${field2 ? fieldName(field2) : (0, import_text_case12.humanizeIdentifier)(write.key)} on ${name}`,
34701
+ label: `Changed ${field2 ? fieldName(field2) : (0, import_text_case14.humanizeIdentifier)(write.key)} on ${name}`,
34590
34702
  cells: [{ rowId: write.rowId, key: write.key, before: write.before ?? null, after: write.after ?? null, version: write.version }]
34591
34703
  });
34592
34704
  rowMove.noteWrite(write.rowId, write.key);
@@ -35917,7 +36029,7 @@ function GridBody({
35917
36029
  key: sortedKeys[0],
35918
36030
  name: (() => {
35919
36031
  const first = (toolbarFields ?? []).find((f) => f.key === sortedKeys[0]);
35920
- return first ? fieldName(first) : (0, import_text_case12.humanizeIdentifier)(sortedKeys[0]);
36032
+ return first ? fieldName(first) : (0, import_text_case14.humanizeIdentifier)(sortedKeys[0]);
35921
36033
  })()
35922
36034
  } : null,
35923
36035
  onChange: changeLayout,
@@ -36079,7 +36191,7 @@ function GridBody({
36079
36191
  const labelOfField = (0, import_react192.useCallback)(
36080
36192
  (key) => {
36081
36193
  const held = (fields.data ?? []).find((f) => f.key === key);
36082
- return held ? fieldName(held) : (0, import_text_case12.humanizeIdentifier)(key);
36194
+ return held ? fieldName(held) : (0, import_text_case14.humanizeIdentifier)(key);
36083
36195
  },
36084
36196
  [fields.data]
36085
36197
  );
@@ -36743,7 +36855,7 @@ var import_design_system105 = require("@ai-matrx/design-system");
36743
36855
  // src/recordInPlace.tsx
36744
36856
  var import_react196 = require("react");
36745
36857
  var import_react197 = require("@ai-matrx/records/react");
36746
- var import_text_case13 = require("@ai-matrx/kit/text-case");
36858
+ var import_text_case15 = require("@ai-matrx/kit/text-case");
36747
36859
  init_recordVersions();
36748
36860
  init_names();
36749
36861
  var import_jsx_runtime119 = require("react/jsx-runtime");
@@ -36789,7 +36901,7 @@ function RecordFieldsInPlace({
36789
36901
  const field2 = fields.find((f) => f.key === write.key);
36790
36902
  const name = table.data && document2 ? recordNameIn(table.data, document2) : "this record";
36791
36903
  undo.push({
36792
- label: `Changed ${field2 ? fieldName(field2) : (0, import_text_case13.humanizeIdentifier)(write.key)} on ${name || "this record"}`,
36904
+ label: `Changed ${field2 ? fieldName(field2) : (0, import_text_case15.humanizeIdentifier)(write.key)} on ${name || "this record"}`,
36793
36905
  cells: [{ rowId: write.rowId, key: write.key, before: write.before ?? null, after: write.after ?? null, version: write.version }]
36794
36906
  });
36795
36907
  };
@@ -36845,11 +36957,11 @@ init_Refusal();
36845
36957
  var import_react198 = require("react");
36846
36958
  var import_records51 = require("@ai-matrx/records");
36847
36959
  var import_react199 = require("@ai-matrx/records/react");
36848
- var import_text_case14 = require("@ai-matrx/kit/text-case");
36960
+ var import_text_case16 = require("@ai-matrx/kit/text-case");
36849
36961
  var import_design_system100 = require("@ai-matrx/design-system");
36850
36962
  init_Refusal();
36851
36963
  var import_jsx_runtime120 = require("react/jsx-runtime");
36852
- function sourceWords(document2, pointer) {
36964
+ function sourceWords2(document2, pointer) {
36853
36965
  if (!pointer) return null;
36854
36966
  const source = document2?._sources?.[pointer];
36855
36967
  if (!source) return null;
@@ -36862,7 +36974,7 @@ function sourceObjectWords(source) {
36862
36974
  if (typeof named === "string" && named !== "") return named;
36863
36975
  const kind2 = source["kind"];
36864
36976
  if (kind2 === "record") return "Merged record";
36865
- return typeof kind2 === "string" && kind2 !== "" ? (0, import_text_case14.humanizeIdentifier)(kind2) : null;
36977
+ return typeof kind2 === "string" && kind2 !== "" ? (0, import_text_case16.humanizeIdentifier)(kind2) : null;
36866
36978
  }
36867
36979
  function shown3(field2, value) {
36868
36980
  return value === null || value === void 0 || value === "" ? "nothing" : scalarText(field2, value);
@@ -36907,7 +37019,7 @@ function ValueAlternates({
36907
37019
  onChosen();
36908
37020
  }
36909
37021
  const actor = read?.actor;
36910
- const currentFrom = sourceWords(document2, envelope?.src) ?? sourceObjectWords(read?.source) ?? (typeof actor === "string" ? actor : null);
37022
+ const currentFrom = sourceWords2(document2, envelope?.src) ?? sourceObjectWords(read?.source) ?? (typeof actor === "string" ? actor : null);
36911
37023
  return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_design_system100.Popover, { open, onOpenChange: (next) => void opened(next), children: [
36912
37024
  /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_design_system100.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
36913
37025
  "button",
@@ -36930,7 +37042,7 @@ function ValueAlternates({
36930
37042
  /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("span", { className: "flex min-w-0 flex-1 flex-col", children: [
36931
37043
  /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "truncate font-medium", children: shown3(field2, alt.value) }),
36932
37044
  /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("span", { className: "truncate text-[11px] text-muted-foreground", children: [
36933
- sourceWords(document2, alt.src) ?? sourceObjectWords(alt.source) ?? "Unknown source",
37045
+ sourceWords2(document2, alt.src) ?? sourceObjectWords(alt.source) ?? "Unknown source",
36934
37046
  " \xB7 rank ",
36935
37047
  alt.rank
36936
37048
  ] })
@@ -37428,7 +37540,7 @@ function AddBody({ tableId }) {
37428
37540
 
37429
37541
  // src/Peek.tsx
37430
37542
  init_parity();
37431
- var import_text_case15 = require("@ai-matrx/kit/text-case");
37543
+ var import_text_case17 = require("@ai-matrx/kit/text-case");
37432
37544
  var import_field_formats16 = require("@ai-matrx/design-system/field-formats");
37433
37545
  var import_jsx_runtime125 = require("react/jsx-runtime");
37434
37546
  function drawnBelowOnPage(field2, bodyKey) {
@@ -37603,7 +37715,7 @@ function computedLinesWorthShowing(rows, document2) {
37603
37715
  );
37604
37716
  }
37605
37717
  function computedInPlainWords(row, field2) {
37606
- const name = field2 ? fieldName(field2) : (0, import_text_case15.humanizeIdentifier)(row.field_key);
37718
+ const name = field2 ? fieldName(field2) : (0, import_text_case17.humanizeIdentifier)(row.field_key);
37607
37719
  const shown5 = row.value === null || row.value === void 0 || row.value === "" ? "nothing" : field2 ? scalarText(field2, row.value) : String(row.value);
37608
37720
  const when = new Date(row.computed_at);
37609
37721
  const at = Number.isNaN(when.getTime()) ? "" : ` on ${when.toLocaleDateString(void 0, (0, import_field_formats16.momentZoneOptions)(when))}`;
@@ -37698,7 +37810,7 @@ function RecordStepper({ neighbors, onStep, expanded, onToggleExpand, full, onTo
37698
37810
  }
37699
37811
 
37700
37812
  // src/HistoryPanel.tsx
37701
- var import_uuid8 = require("@ai-matrx/kit/uuid");
37813
+ var import_uuid9 = require("@ai-matrx/kit/uuid");
37702
37814
  var import_react212 = require("react");
37703
37815
  init_recordVersions();
37704
37816
 
@@ -37738,16 +37850,16 @@ function undoPatch(lines, replaceLaterEdits) {
37738
37850
  // src/HistoryPanel.tsx
37739
37851
  var import_react213 = require("@ai-matrx/records/react");
37740
37852
  var import_design_system108 = require("@ai-matrx/design-system");
37741
- var import_format9 = require("@ai-matrx/kit/format");
37853
+ var import_format11 = require("@ai-matrx/kit/format");
37742
37854
  init_Refusal();
37743
37855
  init_host();
37744
- var import_text_case17 = require("@ai-matrx/kit/text-case");
37856
+ var import_text_case19 = require("@ai-matrx/kit/text-case");
37745
37857
 
37746
37858
  // src/MigrationLog.tsx
37747
37859
  var import_react210 = require("react");
37748
37860
  var import_react211 = require("@ai-matrx/records/react");
37749
37861
  var import_design_system107 = require("@ai-matrx/design-system");
37750
- var import_text_case16 = require("@ai-matrx/kit/text-case");
37862
+ var import_text_case18 = require("@ai-matrx/kit/text-case");
37751
37863
  init_Refusal();
37752
37864
  init_plainWords();
37753
37865
  var import_jsx_runtime127 = require("react/jsx-runtime");
@@ -37764,7 +37876,7 @@ var VERB_WORDS = {
37764
37876
  delete: "Removed"
37765
37877
  };
37766
37878
  function migrationWords(verb) {
37767
- return VERB_WORDS[verb] ?? (0, import_text_case16.humanizeIdentifier)(verb);
37879
+ return VERB_WORDS[verb] ?? (0, import_text_case18.humanizeIdentifier)(verb);
37768
37880
  }
37769
37881
  function useMigrationLog(recordId) {
37770
37882
  const client = (0, import_react211.useRecordsClient)();
@@ -38117,6 +38229,7 @@ function VersionRow({
38117
38229
  {
38118
38230
  change,
38119
38231
  field: byKey.get(change.key),
38232
+ nameOf: (key) => byKey.get(key)?.name ?? byKey.get(key)?.label,
38120
38233
  canRestore: canUndo,
38121
38234
  onRestore: () => onUndo(change.key),
38122
38235
  ...onAskAboutField ? { onAskAboutField } : {}
@@ -38188,11 +38301,12 @@ function ChangeLine({
38188
38301
  field: field2,
38189
38302
  canRestore,
38190
38303
  onRestore,
38191
- onAskAboutField
38304
+ onAskAboutField,
38305
+ nameOf: nameOf3
38192
38306
  }) {
38193
38307
  usePeopleTick();
38194
38308
  return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("li", { "data-change-key": change.key, className: "flex items-baseline gap-2 text-[11px]", children: [
38195
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { className: "w-24 shrink-0 truncate font-medium", title: change.label, children: change.label || (0, import_text_case17.humanizeIdentifier)(change.key) }),
38309
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { className: "w-24 shrink-0 truncate font-medium", title: change.label, children: change.label || (0, import_text_case19.humanizeIdentifier)(change.key) }),
38196
38310
  /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("span", { className: "min-w-0 flex-1 truncate", children: [
38197
38311
  /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { className: "text-muted-foreground line-through", children: say(change.before, field2) }),
38198
38312
  /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { className: "mx-1 text-muted-foreground", children: "\u2192" }),
@@ -38202,14 +38316,7 @@ function ChangeLine({
38202
38316
  "rule v",
38203
38317
  change.rule.rule_version
38204
38318
  ] }) : null,
38205
- change.source ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
38206
- "span",
38207
- {
38208
- className: "shrink-0 text-muted-foreground",
38209
- title: Object.entries(change.source).map(([k, v]) => `${(0, import_text_case17.humanizeIdentifier)(k)}: ${String(v)}`).join(" \xB7 "),
38210
- children: "evidence"
38211
- }
38212
- ) : null,
38319
+ change.source && sourceWords(change.source, nameOf3) ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { className: "shrink-0 text-muted-foreground", title: sourceWords(change.source, nameOf3) ?? void 0, "data-change-source": "", children: "evidence" }) : null,
38213
38320
  onAskAboutField ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
38214
38321
  import_design_system108.Button,
38215
38322
  {
@@ -38317,7 +38424,7 @@ function whenText(at) {
38317
38424
  const then = new Date(at);
38318
38425
  const age = Date.now() - then.getTime();
38319
38426
  if (Number.isNaN(age)) return "\u2014";
38320
- if (age < 864e5) return (0, import_format9.formatRelativeTime)(then, { style: "intl" });
38427
+ if (age < 864e5) return (0, import_format11.formatRelativeTime)(then, { style: "intl" });
38321
38428
  if (age < 7 * 864e5) {
38322
38429
  return then.toLocaleString(void 0, { weekday: "short", hour: "numeric", minute: "2-digit", ...(0, import_field_formats17.momentZoneOptions)(then) });
38323
38430
  }
@@ -38326,7 +38433,7 @@ function whenText(at) {
38326
38433
  function say(value, field2) {
38327
38434
  if (value === null || value === void 0 || value === "") return "nothing";
38328
38435
  if (field2) return scalarText(field2, value);
38329
- const ids = (Array.isArray(value) ? value : [value]).filter(import_uuid8.isUuidShape);
38436
+ const ids = (Array.isArray(value) ? value : [value]).filter(import_uuid9.isUuidShape);
38330
38437
  if (ids.length > 0 && ids.length === (Array.isArray(value) ? value.length : 1)) {
38331
38438
  return ids.map((id) => knownPerson(id) ?? PERSON_NOT_IN_ORGANIZATION).join(", ");
38332
38439
  }
@@ -38399,7 +38506,7 @@ function FormulaHistoryList({ recordId, fieldKey, label, onClose, className }) {
38399
38506
 
38400
38507
  // src/FieldHistoryPanel.tsx
38401
38508
  init_host();
38402
- var import_text_case18 = require("@ai-matrx/kit/text-case");
38509
+ var import_text_case20 = require("@ai-matrx/kit/text-case");
38403
38510
  var import_jsx_runtime130 = require("react/jsx-runtime");
38404
38511
  var COMPUTED_FIELD_TYPES = /* @__PURE__ */ new Set(["formula", "rollup", "lookup"]);
38405
38512
  function FieldHistoryPanel(props) {
@@ -38411,7 +38518,7 @@ function FieldHistoryPanel(props) {
38411
38518
  {
38412
38519
  recordId: props.recordId,
38413
38520
  fieldKey: props.fieldKey,
38414
- label: field2.label || (0, import_text_case18.humanizeIdentifier)(props.fieldKey),
38521
+ label: field2.label || (0, import_text_case20.humanizeIdentifier)(props.fieldKey),
38415
38522
  onClose: props.onClose,
38416
38523
  className: props.className
38417
38524
  }
@@ -38452,7 +38559,7 @@ function FieldValueHistory({
38452
38559
  (0, import_react216.useEffect)(() => {
38453
38560
  void load();
38454
38561
  }, [load]);
38455
- const label = (fields.data ?? []).find((f) => f.key === fieldKey)?.label || (0, import_text_case18.humanizeIdentifier)(fieldKey);
38562
+ const label = (fields.data ?? []).find((f) => f.key === fieldKey)?.label || (0, import_text_case20.humanizeIdentifier)(fieldKey);
38456
38563
  if (error) return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(RefusalNotice, { error, className });
38457
38564
  if (!rows || fields.loading && !fields.data || table.loading && !table.data) return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_design_system110.Skeleton, { className: (0, import_design_system110.cn)("h-40 w-full", className) });
38458
38565
  async function start(row, back = false) {
@@ -38588,7 +38695,7 @@ var import_controls6 = require("@ai-matrx/design-system/controls");
38588
38695
  init_Refusal();
38589
38696
  init_BuiltOnArchive();
38590
38697
  init_host();
38591
- var import_text_case19 = require("@ai-matrx/kit/text-case");
38698
+ var import_text_case21 = require("@ai-matrx/kit/text-case");
38592
38699
  init_enumLabels();
38593
38700
  var import_jsx_runtime131 = require("react/jsx-runtime");
38594
38701
  var DUE_WORD = DUE_STATE_LABEL;
@@ -38822,7 +38929,7 @@ function StepRow({
38822
38929
  /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "flex items-center gap-2", children: [
38823
38930
  /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "w-5 shrink-0 text-right text-[11px] tabular-nums text-muted-foreground", children: step2.step_order }),
38824
38931
  /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: (0, import_design_system111.cn)("min-w-0 flex-1 truncate text-xs", step2.finished && "line-through"), children: step2.title }),
38825
- step2.role ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_design_system111.Badge, { variant: "outline", className: "text-[10px]", children: step2.assignee_name ?? (0, import_text_case19.humanizeIdentifier)(step2.role) }) : null,
38932
+ step2.role ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_design_system111.Badge, { variant: "outline", className: "text-[10px]", children: step2.assignee_name ?? (0, import_text_case21.humanizeIdentifier)(step2.role) }) : null,
38826
38933
  step2.due_state && step2.due_state !== "undated" ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
38827
38934
  import_design_system111.Badge,
38828
38935
  {
@@ -39383,13 +39490,13 @@ function roleKey(said2) {
39383
39490
  }
39384
39491
 
39385
39492
  // src/CommentThread.tsx
39386
- var import_uuid9 = require("@ai-matrx/kit/uuid");
39493
+ var import_uuid10 = require("@ai-matrx/kit/uuid");
39387
39494
  var import_react220 = require("react");
39388
39495
  var import_react221 = require("@ai-matrx/records/react");
39389
39496
  var import_design_system112 = require("@ai-matrx/design-system");
39390
39497
  init_Refusal();
39391
39498
  init_host();
39392
- var import_text_case20 = require("@ai-matrx/kit/text-case");
39499
+ var import_text_case22 = require("@ai-matrx/kit/text-case");
39393
39500
  var import_jsx_runtime132 = require("react/jsx-runtime");
39394
39501
  function CommentThread({ tableId, recordId, fieldKey, className }) {
39395
39502
  const client = (0, import_react221.useRecordsClient)();
@@ -39450,7 +39557,7 @@ function CommentThread({ tableId, recordId, fieldKey, className }) {
39450
39557
  const shown5 = fieldKey ? thread.comments.filter((c) => c.field_key === fieldKey) : thread.comments;
39451
39558
  const roots = shown5.filter((c) => !c.parent_comment_id);
39452
39559
  const repliesOf = (id) => shown5.filter((c) => c.parent_comment_id === id);
39453
- const fieldLabel = fieldKey ? (fields.data ?? []).find((f) => f.key === fieldKey)?.label || (0, import_text_case20.humanizeIdentifier)(fieldKey) : null;
39560
+ const fieldLabel = fieldKey ? (fields.data ?? []).find((f) => f.key === fieldKey)?.label || (0, import_text_case22.humanizeIdentifier)(fieldKey) : null;
39454
39561
  async function post() {
39455
39562
  if (draft.trim() === "") return;
39456
39563
  setBusy(true);
@@ -39602,7 +39709,7 @@ function Line({
39602
39709
  onReply,
39603
39710
  onResolve
39604
39711
  }) {
39605
- const about = comment.field_key ? fields.find((f) => f.key === comment.field_key)?.label || (0, import_text_case20.humanizeIdentifier)(comment.field_key) : null;
39712
+ const about = comment.field_key ? fields.find((f) => f.key === comment.field_key)?.label || (0, import_text_case22.humanizeIdentifier)(comment.field_key) : null;
39606
39713
  return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex flex-col gap-0.5", children: [
39607
39714
  /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex items-baseline gap-2 text-[11px] text-muted-foreground", children: [
39608
39715
  /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "truncate font-medium text-foreground", children: comment.created_by_name }),
@@ -39620,7 +39727,7 @@ function Line({
39620
39727
  /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "whitespace-pre-wrap text-xs", children: comment.body }),
39621
39728
  comment.mentions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("p", { className: "text-[10px] text-muted-foreground", children: [
39622
39729
  "Told: ",
39623
- comment.mentions.map((m) => (0, import_uuid9.isUuidShape)(m.name) ? PERSON_NOT_IN_ORGANIZATION : m.name).join(", ")
39730
+ comment.mentions.map((m) => (0, import_uuid10.isUuidShape)(m.name) ? PERSON_NOT_IN_ORGANIZATION : m.name).join(", ")
39624
39731
  ] }) : null
39625
39732
  ] });
39626
39733
  }
@@ -40094,7 +40201,7 @@ var import_core21 = require("@ai-matrx/records/core");
40094
40201
  init_host();
40095
40202
 
40096
40203
  // src/viewExport.ts
40097
- var import_format10 = require("@ai-matrx/kit/format");
40204
+ var import_format12 = require("@ai-matrx/kit/format");
40098
40205
  var VIEW_EXPORT_PAGE = 500;
40099
40206
  var VIEW_EXPORT_CEILING = 5e3;
40100
40207
  function viewColumns(fields, presentation) {
@@ -40141,7 +40248,7 @@ async function readViewRows(client, tableId, fields, view, ceiling = VIEW_EXPORT
40141
40248
  }
40142
40249
  }
40143
40250
  function cutWords(written) {
40144
- return `First ${(0, import_format10.formatCount)(written, { locale: "en-US" })} rows only`;
40251
+ return `First ${(0, import_format12.formatCount)(written, { locale: "en-US" })} rows only`;
40145
40252
  }
40146
40253
 
40147
40254
  // src/ExportMenu.tsx
@@ -42080,7 +42187,7 @@ var import_react293 = require("@ai-matrx/records/react");
42080
42187
  var import_records62 = require("@ai-matrx/records");
42081
42188
  var import_design_system141 = require("@ai-matrx/design-system");
42082
42189
  var import_data_table23 = require("@ai-matrx/design-system/data-table");
42083
- var import_format12 = require("@ai-matrx/kit/format");
42190
+ var import_format15 = require("@ai-matrx/kit/format");
42084
42191
 
42085
42192
  // src/recordMoves.tsx
42086
42193
  var import_react260 = require("react");
@@ -45994,7 +46101,7 @@ var import_recharts = require("recharts");
45994
46101
  var import_records59 = require("@ai-matrx/records");
45995
46102
  var import_core22 = require("@ai-matrx/records/core");
45996
46103
  var import_design_system136 = require("@ai-matrx/design-system");
45997
- var import_format11 = require("@ai-matrx/kit/format");
46104
+ var import_format13 = require("@ai-matrx/kit/format");
45998
46105
  init_Refusal();
45999
46106
  init_host();
46000
46107
 
@@ -46311,19 +46418,19 @@ function useLinkGroupNamer(block, tableId) {
46311
46418
  // src/measureWords.ts
46312
46419
  var import_react280 = require("react");
46313
46420
  var import_react281 = require("@ai-matrx/records/react");
46314
- var import_text_case21 = require("@ai-matrx/kit/text-case");
46421
+ var import_text_case23 = require("@ai-matrx/kit/text-case");
46315
46422
  init_names();
46316
46423
  var OP_WORD = { sum: "Total", avg: "Average", min: "Lowest", max: "Highest" };
46317
46424
  function measureWords(key, fields) {
46318
46425
  if (key === "count") return "How many";
46319
46426
  const at = key.indexOf("_");
46320
- if (at < 0) return (0, import_text_case21.humanizeIdentifier)(key);
46427
+ if (at < 0) return (0, import_text_case23.humanizeIdentifier)(key);
46321
46428
  const op2 = key.slice(0, at);
46322
46429
  const column = key.slice(at + 1);
46323
46430
  const field2 = fields?.find((f) => f.key === column);
46324
- const name = field2 ? fieldName(field2) : (0, import_text_case21.humanizeIdentifier)(column);
46431
+ const name = field2 ? fieldName(field2) : (0, import_text_case23.humanizeIdentifier)(column);
46325
46432
  const word = OP_WORD[op2];
46326
- return word ? `${word} ${name.charAt(0).toLowerCase()}${name.slice(1)}` : `${(0, import_text_case21.humanizeIdentifier)(op2)} ${name}`;
46433
+ return word ? `${word} ${name.charAt(0).toLowerCase()}${name.slice(1)}` : `${(0, import_text_case23.humanizeIdentifier)(op2)} ${name}`;
46327
46434
  }
46328
46435
  function useMeasureFields(key, tableId) {
46329
46436
  const client = (0, import_react281.useOptionalRecordsClient)();
@@ -46743,7 +46850,7 @@ function BigNumber({
46743
46850
  /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("span", { className: "text-2xl font-semibold tabular-nums", children: total === null ? "\u2013" : pretty2(total) }),
46744
46851
  windows ? /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Trend, { pct: block.totals?.change_pct, aimingUp: !!target, className: "text-sm" }) : null
46745
46852
  ] }),
46746
- /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("span", { className: "text-xs text-muted-foreground", children: windows && typeof priorTotal === "number" ? `${windowName(windows.window, windows.period)} \xB7 ${pretty2(priorTotal)} in ${windowName(windows.prior_window, windows.period)}` : `from ${(0, import_format11.formatCount)(records)} ${records === 1 ? "record" : "records"}` })
46853
+ /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("span", { className: "text-xs text-muted-foreground", children: windows && typeof priorTotal === "number" ? `${windowName(windows.window, windows.period)} \xB7 ${pretty2(priorTotal)} in ${windowName(windows.prior_window, windows.period)}` : `from ${(0, import_format13.formatCount)(records)} ${records === 1 ? "record" : "records"}` })
46747
46854
  ] });
46748
46855
  const ring = target && typeof target.progress === "number" && typeof target.value === "number" ? /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)("span", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
46749
46856
  /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)("span", { className: "text-right text-xs text-muted-foreground", children: [
@@ -46870,7 +46977,7 @@ var DONUT_LEGEND_MAX_PX = 264;
46870
46977
  function compactTickPlain(value) {
46871
46978
  if (typeof value !== "number" || !Number.isFinite(value)) return String(value ?? "");
46872
46979
  if (Math.abs(value) < 1e3 && !Number.isInteger(value)) return String(Math.round(value * 10) / 10);
46873
- return (0, import_format11.formatCount)(value, { style: "compact" });
46980
+ return (0, import_format13.formatCount)(value, { style: "compact" });
46874
46981
  }
46875
46982
  function wrapTickWords(label, perLine, maxLines = 3) {
46876
46983
  const words2 = label.split(/\s+/).filter(Boolean).map((w) => w.length > perLine ? `${w.slice(0, perLine - 1)}\u2026` : w);
@@ -47478,6 +47585,7 @@ var import_skeleton2 = require("@ai-matrx/design-system/skeleton");
47478
47585
  init_host();
47479
47586
  init_names();
47480
47587
  init_Refusal();
47588
+ var import_format14 = require("@ai-matrx/kit/format");
47481
47589
  var import_jsx_runtime163 = require("react/jsx-runtime");
47482
47590
  var PIVOT_BOX = "min-h-[16rem]";
47483
47591
  function defaultPivotRows(fields) {
@@ -47647,7 +47755,7 @@ function PivotLayout({ view, fields, filter, onChange, remembered }) {
47647
47755
  ] }) }),
47648
47756
  table.cut ? /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("p", { className: "text-xs text-muted-foreground", "data-records-pivot-cut": "", children: [
47649
47757
  "First ",
47650
- PIVOT_CELL_LIMIT.toLocaleString(),
47758
+ (0, import_format14.formatCount)(PIVOT_CELL_LIMIT),
47651
47759
  " cells only. Narrow the filter to see the rest."
47652
47760
  ] }) : null
47653
47761
  ] })
@@ -49037,9 +49145,9 @@ function ViewPager({ shown: shown5, total, locked = 0, onMore, step: step2 }) {
49037
49145
  return /* @__PURE__ */ (0, import_jsx_runtime166.jsxs)("p", { className: "flex items-center gap-2 text-xs text-muted-foreground", "data-view-pager": "", children: [
49038
49146
  /* @__PURE__ */ (0, import_jsx_runtime166.jsxs)("span", { children: [
49039
49147
  "Showing ",
49040
- (0, import_format12.formatCount)(shown5),
49148
+ (0, import_format15.formatCount)(shown5),
49041
49149
  " of ",
49042
- (0, import_format12.formatCount)(total),
49150
+ (0, import_format15.formatCount)(total),
49043
49151
  " records."
49044
49152
  ] }),
49045
49153
  /* @__PURE__ */ (0, import_jsx_runtime166.jsxs)(import_design_system141.Button, { size: "sm", variant: "outline", onClick: onMore, children: [
@@ -50555,7 +50663,7 @@ var import_react303 = require("react");
50555
50663
  var import_react304 = require("@ai-matrx/records/react");
50556
50664
  var import_design_system146 = require("@ai-matrx/design-system");
50557
50665
  var import_data_table24 = require("@ai-matrx/design-system/data-table");
50558
- var import_format13 = require("@ai-matrx/kit/format");
50666
+ var import_format16 = require("@ai-matrx/kit/format");
50559
50667
  init_Refusal();
50560
50668
  init_enumLabels();
50561
50669
  var import_field_formats19 = require("@ai-matrx/design-system/field-formats");
@@ -51140,7 +51248,7 @@ function ActionInbox({
51140
51248
  size: "sm",
51141
51249
  variant: "ghost",
51142
51250
  className: "h-6 px-2 text-[11px]",
51143
- title: (0, import_format13.formatAbsoluteDate)(c.until),
51251
+ title: (0, import_format16.formatAbsoluteDate)(c.until),
51144
51252
  onClick: () => void snooze(item.item_id, item.title, c.until),
51145
51253
  children: [
51146
51254
  c.label,
@@ -51182,7 +51290,7 @@ function ActionInbox({
51182
51290
  /* @__PURE__ */ (0, import_jsx_runtime171.jsx)("span", { className: "font-medium", children: held[item.item_id].approve ? "Approved" : "Declined" }),
51183
51291
  /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)("span", { className: "text-[11px] text-muted-foreground tabular-nums", children: [
51184
51292
  "\xB7 made in ",
51185
- (0, import_format13.formatDurationMs)(Math.max(0, Math.ceil((held[item.item_id].until - Date.now()) / 1e3) * 1e3), { style: "compact" })
51293
+ (0, import_format16.formatDurationMs)(Math.max(0, Math.ceil((held[item.item_id].until - Date.now()) / 1e3) * 1e3), { style: "compact" })
51186
51294
  ] }),
51187
51295
  /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(import_design_system146.Button, { size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: () => undoHold(held[item.item_id].hold), children: "Undo" })
51188
51296
  ] })
@@ -54150,7 +54258,7 @@ init_host();
54150
54258
  var import_forms2 = require("@ai-matrx/records/forms");
54151
54259
  init_plainWords();
54152
54260
  init_names();
54153
- var import_text_case22 = require("@ai-matrx/kit/text-case");
54261
+ var import_text_case24 = require("@ai-matrx/kit/text-case");
54154
54262
  var import_jsx_runtime182 = require("react/jsx-runtime");
54155
54263
  function authored(host, text, where) {
54156
54264
  return host.renderText ? host.renderText(text, where) : text;
@@ -54299,7 +54407,7 @@ function FormStage({
54299
54407
  // THE FORM'S OWN WORDS FIRST (MAKE-HOME W5). Unwritten, the Field's display name
54300
54408
  // (`fieldName`: a machine-key label is written the way a person writes it), and with no
54301
54409
  // Field at all the key humanized — a stranger never reads `full_name`.
54302
- ask: q.ask?.trim() || (field2 ? fieldName(field2) : (0, import_text_case22.humanizeIdentifier)(q.field)),
54410
+ ask: q.ask?.trim() || (field2 ? fieldName(field2) : (0, import_text_case24.humanizeIdentifier)(q.field)),
54303
54411
  help: q.help ?? null,
54304
54412
  required: q.required ?? field2?.required ?? false,
54305
54413
  field: field2,
@@ -58912,7 +59020,7 @@ var import_react341 = require("react");
58912
59020
  var import_react342 = require("@ai-matrx/records/react");
58913
59021
  var import_core26 = require("@ai-matrx/records/core");
58914
59022
  var import_download3 = require("@ai-matrx/kit/download");
58915
- var import_format14 = require("@ai-matrx/kit/format");
59023
+ var import_format17 = require("@ai-matrx/kit/format");
58916
59024
  var import_design_system169 = require("@ai-matrx/design-system");
58917
59025
  init_plainWords();
58918
59026
  init_parity();
@@ -59460,7 +59568,7 @@ function NumberBlockView({ block, viewerUserId, extra }) {
59460
59568
  }
59461
59569
  return /* @__PURE__ */ (0, import_jsx_runtime193.jsxs)(import_jsx_runtime193.Fragment, { children: [
59462
59570
  title,
59463
- /* @__PURE__ */ (0, import_jsx_runtime193.jsx)("p", { className: "text-3xl font-semibold tabular-nums", "data-records-page-number": block.id, children: (0, import_format14.formatCount)(read.total) })
59571
+ /* @__PURE__ */ (0, import_jsx_runtime193.jsx)("p", { className: "text-3xl font-semibold tabular-nums", "data-records-page-number": block.id, children: (0, import_format17.formatCount)(read.total) })
59464
59572
  ] });
59465
59573
  }
59466
59574
  function ChartThroughNote({ title, children }) {
@@ -61852,7 +61960,7 @@ var import_records73 = require("@ai-matrx/records");
61852
61960
  var import_react371 = require("@ai-matrx/records/react");
61853
61961
  var import_design_system185 = require("@ai-matrx/design-system");
61854
61962
  init_names();
61855
- var import_text_case23 = require("@ai-matrx/kit/text-case");
61963
+ var import_text_case25 = require("@ai-matrx/kit/text-case");
61856
61964
 
61857
61965
  // src/calendarFeed.ts
61858
61966
  function webcalUrl(httpsUrl) {
@@ -62314,7 +62422,7 @@ function TableReferenceDialog({
62314
62422
  }
62315
62423
 
62316
62424
  // src/TableDuplicate.tsx
62317
- var import_format15 = require("@ai-matrx/kit/format");
62425
+ var import_format18 = require("@ai-matrx/kit/format");
62318
62426
  var import_react364 = require("react");
62319
62427
  var import_react365 = require("@ai-matrx/records/react");
62320
62428
  var import_design_system182 = require("@ai-matrx/design-system");
@@ -62325,7 +62433,7 @@ function copyNameFor(name) {
62325
62433
  return `${name.trim() || "Table"} (copy)`;
62326
62434
  }
62327
62435
  function duplicateProgressWords(p) {
62328
- if (p.records && p.records.total > 0) return `Copying records \xB7 ${(0, import_format15.formatCount)(p.records.done)} of ${(0, import_format15.formatCount)(p.records.total)}`;
62436
+ if (p.records && p.records.total > 0) return `Copying records \xB7 ${(0, import_format18.formatCount)(p.records.done)} of ${(0, import_format18.formatCount)(p.records.total)}`;
62329
62437
  if (p.views.total > 0 && p.step === "views") return `Copying views \xB7 ${p.views.done} of ${p.views.total}`;
62330
62438
  return "Copying columns\u2026";
62331
62439
  }
@@ -62382,7 +62490,7 @@ function TableDuplicateDialog({ tableId, name, organizationId, open, onOpenChang
62382
62490
  " columns, ",
62383
62491
  phase.copy.copied.views,
62384
62492
  " views",
62385
- phase.copy.copied.withRecords ? `, ${(0, import_format15.formatCount)(phase.copy.copied.records)} records` : "",
62493
+ phase.copy.copied.withRecords ? `, ${(0, import_format18.formatCount)(phase.copy.copied.records)} records` : "",
62386
62494
  "."
62387
62495
  ] }),
62388
62496
  phase.copy.notCopied.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
@@ -62958,7 +63066,7 @@ function useSlotScroll(slot) {
62958
63066
  }
62959
63067
 
62960
63068
  // src/TablePage.tsx
62961
- var import_uuid10 = require("@ai-matrx/kit/uuid");
63069
+ var import_uuid11 = require("@ai-matrx/kit/uuid");
62962
63070
  var import_outbound4 = require("@ai-matrx/kit/outbound");
62963
63071
  var import_jsx_runtime210 = require("react/jsx-runtime");
62964
63072
  var RAIL_TITLE = {
@@ -63031,7 +63139,7 @@ function RailFrame({
63031
63139
  function filterInWords(filter, fields) {
63032
63140
  const nameOf3 = (key) => {
63033
63141
  const field2 = fields.find((f) => f.key === key);
63034
- return field2 ? fieldName(field2) : (0, import_text_case23.humanizeIdentifier)(key);
63142
+ return field2 ? fieldName(field2) : (0, import_text_case25.humanizeIdentifier)(key);
63035
63143
  };
63036
63144
  const parts = Object.keys(filter).map((key) => {
63037
63145
  const value = filter[key];
@@ -63207,7 +63315,7 @@ function openingView(activeView, activeDashboardId) {
63207
63315
  }
63208
63316
  function savedViewFromParam(activeView) {
63209
63317
  const word = typeof activeView === "string" ? activeView.trim() : "";
63210
- return (0, import_uuid10.isUuidShape)(word) ? word.toLowerCase() : null;
63318
+ return (0, import_uuid11.isUuidShape)(word) ? word.toLowerCase() : null;
63211
63319
  }
63212
63320
  function addressForView(view, layout) {
63213
63321
  return view && !view.isDefault ? view.id : layout;
@@ -64300,11 +64408,11 @@ function TablePage({
64300
64408
  }
64301
64409
  ) : null,
64302
64410
  lookRefused ? /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(RefusalNotice, { error: lookRefused }) : null,
64303
- main === "dashboards" ? /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(DashboardCanvas, { tableId, activeDashboardId: activeDashboardId ?? null }) : main === "form" ? /* @__PURE__ */ (0, import_jsx_runtime210.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto", "data-table-form-view": "", children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(FormsPanel, { tableId, activeFormId: formFromLink && activeItemId && (0, import_uuid10.isUuidShape)(activeItemId) ? activeItemId : null, asView: true }) }) : main === "questions" ? /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
64411
+ main === "dashboards" ? /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(DashboardCanvas, { tableId, activeDashboardId: activeDashboardId ?? null }) : main === "form" ? /* @__PURE__ */ (0, import_jsx_runtime210.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto", "data-table-form-view": "", children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(FormsPanel, { tableId, activeFormId: formFromLink && activeItemId && (0, import_uuid11.isUuidShape)(activeItemId) ? activeItemId : null, asView: true }) }) : main === "questions" ? /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
64304
64412
  QuestionPanel,
64305
64413
  {
64306
64414
  tableId,
64307
- activeQuestionId: questionsFromLink && activeItemId && (0, import_uuid10.isUuidShape)(activeItemId) ? activeItemId : null,
64415
+ activeQuestionId: questionsFromLink && activeItemId && (0, import_uuid11.isUuidShape)(activeItemId) ? activeItemId : null,
64308
64416
  draft: questionDraft
64309
64417
  }
64310
64418
  ) : main === "archived" ? (
@@ -64543,7 +64651,7 @@ function usePublicReadOnly(client, organizationId, tableId, table, rights) {
64543
64651
  }
64544
64652
 
64545
64653
  // src/entityViews.tsx
64546
- var import_format16 = require("@ai-matrx/kit/format");
64654
+ var import_format19 = require("@ai-matrx/kit/format");
64547
64655
  var import_design_system186 = require("@ai-matrx/design-system");
64548
64656
  var import_data_table26 = require("@ai-matrx/design-system/data-table");
64549
64657
  var import_react372 = require("react");
@@ -64738,7 +64846,7 @@ function EntityTablePageBody({
64738
64846
  return /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)("div", { className: (0, import_design_system187.cn)("flex min-w-0 flex-col gap-2", className), "data-records-entity-page": source.token, children: [
64739
64847
  presentation === "page" || boardable || entity.creatable ? /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
64740
64848
  presentation === "page" ? /* @__PURE__ */ (0, import_jsx_runtime211.jsx)("h2", { className: "truncate text-base font-semibold", children: entity.label ?? (entity.loading ? "Loading\u2026" : "Table") }) : null,
64741
- presentation === "page" ? /* @__PURE__ */ (0, import_jsx_runtime211.jsx)("span", { className: "text-xs tabular-nums text-muted-foreground", children: entity.loading || entity.total === null ? "" : (0, import_format16.formatCount)(entity.total) }) : null,
64849
+ presentation === "page" ? /* @__PURE__ */ (0, import_jsx_runtime211.jsx)("span", { className: "text-xs tabular-nums text-muted-foreground", children: entity.loading || entity.total === null ? "" : (0, import_format19.formatCount)(entity.total) }) : null,
64742
64850
  /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)("span", { className: "ml-auto flex items-center gap-1", children: [
64743
64851
  boardable ? /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(import_jsx_runtime211.Fragment, { children: [
64744
64852
  /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(import_design_system187.Button, { size: "sm", variant: layout === "grid" ? "secondary" : "ghost", "aria-pressed": layout === "grid", onClick: () => choose("grid"), children: "Table" }),