@nivaro/react 0.3.139 → 0.3.141

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/components/InlineGridField.js +95 -92
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +39 -2
  5. package/dist/shared/components/AudienceConfirmPanel.js +19 -19
  6. package/dist/shared/components/BroadcastView.js +213 -211
  7. package/dist/shared/components/CollectionBrowserView.js +2702 -2671
  8. package/dist/shared/components/ConfigHistory.js +45 -45
  9. package/dist/shared/components/ConformanceView.js +110 -110
  10. package/dist/shared/components/DataTable.js +51 -51
  11. package/dist/shared/components/FilePreviewLightbox.js +26 -25
  12. package/dist/shared/components/ItemEditForm.js +3475 -3458
  13. package/dist/shared/components/LiveCount.js +27 -23
  14. package/dist/shared/components/LiveTraceView.js +62 -61
  15. package/dist/shared/components/PageRenderer.js +422 -410
  16. package/dist/shared/components/ProfileView.js +199 -199
  17. package/dist/shared/components/QualityRulesView.js +70 -70
  18. package/dist/shared/components/QueryTable.js +131 -130
  19. package/dist/shared/components/RecordGraph.js +98 -98
  20. package/dist/shared/components/RecordReadView.js +287 -288
  21. package/dist/shared/components/ReportView.js +1279 -1259
  22. package/dist/shared/components/RowPresence.js +83 -76
  23. package/dist/shared/components/SlaRulesView.js +73 -74
  24. package/dist/shared/components/UnseenDot.js +183 -22
  25. package/dist/shared/components/WidgetSlot.js +73 -73
  26. package/dist/shared/components/ai/AiChart.js +36 -32
  27. package/dist/shared/components/ai/AiMarkdown.js +136 -129
  28. package/dist/shared/components/ai/TaskDo.js +87 -87
  29. package/dist/shared/components/ai/answer-formats.js +37 -30
  30. package/dist/shared/components/ai/call-log/format.js +17 -16
  31. package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
  32. package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
  33. package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
  34. package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
  35. package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
  36. package/dist/shared/components/bulk/bulk-field-options.js +10 -10
  37. package/dist/shared/components/cbv/column-totals.js +53 -51
  38. package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
  39. package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
  40. package/dist/shared/components/command-center/announce.js +7 -6
  41. package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
  42. package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
  43. package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
  44. package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
  45. package/dist/shared/components/delivery-analytics/drill.js +32 -32
  46. package/dist/shared/components/imports/RunDetailSheet.js +1 -1
  47. package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
  48. package/dist/shared/components/integrations/console/EventsView.js +35 -35
  49. package/dist/shared/components/integrations/console/FirefightView.js +15 -14
  50. package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
  51. package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
  52. package/dist/shared/components/integrations/console/SignalCard.js +67 -67
  53. package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
  54. package/dist/shared/components/item-edit/ChangesTray.js +88 -74
  55. package/dist/shared/components/item-edit/FilePickerField.js +123 -123
  56. package/dist/shared/components/item-edit/GroupSection.js +301 -292
  57. package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
  58. package/dist/shared/components/item-edit/InlineGridField.js +45 -36
  59. package/dist/shared/components/item-edit/InlineTableField.js +1390 -1376
  60. package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
  61. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
  62. package/dist/shared/components/item-edit/RecordRecapChanges.js +116 -74
  63. package/dist/shared/components/item-edit/RecordRecapStrip.js +148 -160
  64. package/dist/shared/components/item-edit/summary-layout-request.js +15 -0
  65. package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
  66. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  67. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +226 -157
  68. package/dist/shared/components/layout-editor/settings/WhoSection.js +53 -52
  69. package/dist/shared/components/layout-editor/settings/controls.js +98 -90
  70. package/dist/shared/components/layout-editor/settings/settings-registry.js +8 -0
  71. package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
  72. package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
  73. package/dist/shared/components/ops-report/format.js +37 -36
  74. package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
  75. package/dist/shared/components/panels/RevisionsPanel.js +306 -305
  76. package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
  77. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
  78. package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
  79. package/dist/shared/components/pipeline/TeamsView.js +189 -130
  80. package/dist/shared/components/profile/AgentsPanel.js +6 -6
  81. package/dist/shared/components/profile/DelegationCard.js +13 -12
  82. package/dist/shared/components/profile/PersonActivity.js +48 -48
  83. package/dist/shared/components/profile/PersonExtras.js +107 -107
  84. package/dist/shared/components/profile/PersonWeek.js +9 -9
  85. package/dist/shared/components/queue/QueueBulkBar.js +19 -18
  86. package/dist/shared/components/queue/QueueBulkMove.js +21 -20
  87. package/dist/shared/components/queue/QueueItemSheet.js +136 -131
  88. package/dist/shared/components/queue/QueueWorklist.js +884 -872
  89. package/dist/shared/components/queue/worklist-helpers.js +36 -21
  90. package/dist/shared/components/support/RequestList.js +123 -123
  91. package/dist/shared/components/support/SupportAnalytics.js +29 -29
  92. package/dist/shared/lib/activity-sentence.js +251 -229
  93. package/dist/shared/lib/format-value.js +5 -4
  94. package/dist/shared/lib/layout-resolve.js +64 -48
  95. package/dist/shared/lib/number-format.js +87 -0
  96. package/dist/shared/lib/number-kind.js +133 -0
  97. package/dist/shared/lib/utils.js +24 -20
  98. package/dist/shared/lib/watch-list.js +1 -1
  99. package/dist/shared/lib/widget-value-format.js +26 -12
  100. package/package.json +1 -1
@@ -1,19 +1,19 @@
1
- import { jsx as l, Fragment as oe, jsxs as c } from "react/jsx-runtime";
2
- import { useQueryClient as le, useQueries as ce } from "@tanstack/react-query";
3
- import { Loader2 as K, Send as de, CheckCircle2 as ue, AlertCircle as me, MinusCircle as pe } from "lucide-react";
4
- import { useMemo as U, useState as y } from "react";
1
+ import { jsx as l, Fragment as le, jsxs as c } from "react/jsx-runtime";
2
+ import { useQueryClient as ce, useQueries as de } from "@tanstack/react-query";
3
+ import { Loader2 as U, Send as ue, CheckCircle2 as me, AlertCircle as pe, MinusCircle as he } from "lucide-react";
4
+ import { useMemo as G, useState as y } from "react";
5
5
  import { toast as N } from "sonner";
6
- import { useNivaroClient as he } from "../../context.js";
7
- import { newBulkProgressId as fe, startBulkProgress as be, endBulkProgress as ke } from "../../lib/bulk-progress.js";
8
- import { get as xe, post as G } from "../../lib/commands.js";
9
- import { userErrorMessage as ge } from "../../lib/safe-error.js";
10
- import { cn as H } from "../../lib/utils.js";
11
- import { Popover as ye, PopoverTrigger as we, PopoverContent as ve } from "../ui/popover.js";
12
- import { useAvailableBulkActions as Ne, bulkActionEnabled as $e } from "./BulkActionButtons.js";
13
- function J(a, r, n, d) {
14
- return ((a == null ? void 0 : a[n]) ?? []).some((f) => f.source === "builtin" && f.key === d) && $e(r, n, d);
6
+ import { useNivaroClient as fe } from "../../context.js";
7
+ import { newBulkProgressId as be, startBulkProgress as ke, endBulkProgress as xe } from "../../lib/bulk-progress.js";
8
+ import { get as ge, post as H } from "../../lib/commands.js";
9
+ import { userErrorMessage as ye } from "../../lib/safe-error.js";
10
+ import { formatNumber as $, cn as J } from "../../lib/utils.js";
11
+ import { Popover as we, PopoverTrigger as ve, PopoverContent as Ne } from "../ui/popover.js";
12
+ import { useAvailableBulkActions as $e, bulkActionEnabled as Ce } from "./BulkActionButtons.js";
13
+ function V(a, r, n, d) {
14
+ return ((a == null ? void 0 : a[n]) ?? []).some((f) => f.source === "builtin" && f.key === d) && Ce(r, n, d);
15
15
  }
16
- function Ce(a) {
16
+ function Re(a) {
17
17
  const r = { succeeded: 0, failed: 0, skipped: 0, errors: [], outcomes: [] };
18
18
  for (const { collection: n, data: d } of a) {
19
19
  r.succeeded += d.succeeded ?? 0, r.failed += d.failed ?? 0, r.skipped += d.skipped ?? 0, r.errors.push(...d.errors ?? []);
@@ -22,85 +22,85 @@ function Ce(a) {
22
22
  }
23
23
  return r;
24
24
  }
25
- function Re(a, r) {
25
+ function qe(a, r) {
26
26
  const n = [`${r.succeeded} done`];
27
27
  return r.skipped && n.push(`${r.skipped} skipped`), r.failed && n.push(`${r.failed} failed`), `${a}: ${n.join(" · ")}`;
28
28
  }
29
- function Ie({
29
+ function Te({
30
30
  targets: a,
31
31
  enabledKeys: r,
32
32
  tone: n = "light",
33
33
  disabled: d,
34
34
  onDone: f
35
35
  }) {
36
- const $ = he(), V = le(), C = U(() => [...new Set(a.map((e) => e.collection))], [a]), { data: j } = Ne(C), R = C.filter((e) => J(j, r, e, "push")), O = C.filter(
37
- (e) => J(j, r, e, "retry-push")
38
- ), S = ce({
39
- queries: R.map((e) => ({
36
+ const C = fe(), W = ce(), R = G(() => [...new Set(a.map((e) => e.collection))], [a]), { data: O } = $e(R), q = R.filter((e) => V(O, r, e, "push")), S = R.filter(
37
+ (e) => V(O, r, e, "retry-push")
38
+ ), A = de({
39
+ queries: q.map((e) => ({
40
40
  queryKey: ["bulk-push-actions", e],
41
- queryFn: () => $.request(xe("/item-actions/registered", { collection: e })).then((t) => t.data ?? []).catch(() => []),
41
+ queryFn: () => C.request(ge("/item-actions/registered", { collection: e })).then((t) => t.data ?? []).catch(() => []),
42
42
  staleTime: 5 * 6e4
43
43
  }))
44
- }), W = S.map((e) => e.dataUpdatedAt).join(","), X = U(() => {
44
+ }), X = A.map((e) => e.dataUpdatedAt).join(","), Y = G(() => {
45
45
  const e = /* @__PURE__ */ new Map();
46
- return R.forEach((t, s) => {
46
+ return q.forEach((t, s) => {
47
47
  var i;
48
- for (const o of (((i = S[s]) == null ? void 0 : i.data) ?? []).filter((u) => u.bulk !== !1)) {
48
+ for (const o of (((i = A[s]) == null ? void 0 : i.data) ?? []).filter((u) => u.bulk !== !1)) {
49
49
  const u = e.get(o.id);
50
50
  u ? u.collections.push(t) : e.set(o.id, { ...o, collections: [t] });
51
51
  }
52
52
  }), [...e.values()];
53
- }, [W, R.join(",")]), [Y, A] = y(null), [w, B] = y(""), [M, _] = y(null), [Z, q] = y({}), [D, E] = y({}), ee = (e) => {
53
+ }, [X, q.join(",")]), [Z, B] = y(null), [w, M] = y(""), [_, E] = y(null), [D, P] = y({}), [ee, Q] = y({}), te = (e) => {
54
54
  const [t, ...s] = e.split(":"), i = s.join(":"), o = a.find((u) => u.collection === t && String(u.id) === i);
55
55
  return o != null && o.label ? String(o.label) : `#${i}`;
56
56
  };
57
57
  let k = 0;
58
- const Q = async (e, t) => {
58
+ const F = async (e, t) => {
59
59
  var o;
60
60
  const s = e.kind === "push" ? e.action.collections : e.collections, i = [];
61
61
  for (const u of s) {
62
62
  const b = a.filter((x) => x.collection === u).map((x) => x.id);
63
63
  if (b.length === 0) continue;
64
- const m = !t && e.kind === "push" ? fe() : null;
65
- m && be(m, b);
66
- const p = e.kind === "push" ? await $.request(
67
- G(`/bulk-actions/push${m ? `?progress=${m}` : ""}`, {
64
+ const m = !t && e.kind === "push" ? be() : null;
65
+ m && ke(m, b);
66
+ const p = e.kind === "push" ? await C.request(
67
+ H(`/bulk-actions/push${m ? `?progress=${m}` : ""}`, {
68
68
  collection: u,
69
69
  action_id: e.action.id,
70
70
  ids: b,
71
71
  dry_run: t,
72
72
  ...w.trim() ? { payload: { message: w.trim() } } : {}
73
73
  })
74
- ) : await $.request(
75
- G("/bulk-actions/retry-push", { collection: u, ids: b, dry_run: t })
74
+ ) : await C.request(
75
+ H("/bulk-actions/retry-push", { collection: u, ids: b, dry_run: t })
76
76
  ), h = ((o = p.data) == null ? void 0 : o.background) === !0;
77
- if (m && !h && ke(m), h) {
77
+ if (m && !h && xe(m), h) {
78
78
  k += b.length;
79
79
  continue;
80
80
  }
81
81
  i.push({ collection: u, data: p.data });
82
82
  }
83
- return Ce(i);
84
- }, P = (e) => e.kind === "push" ? `push:${e.action.id}` : "retry-push", v = (e) => e.kind === "push" ? e.action.label : "Retry failed pushes", te = async (e) => {
85
- const t = P(e);
86
- q((s) => ({ ...s, [t]: "loading" }));
83
+ return Re(i);
84
+ }, j = (e) => e.kind === "push" ? `push:${e.action.id}` : "retry-push", v = (e) => e.kind === "push" ? e.action.label : "Retry failed pushes", se = async (e) => {
85
+ const t = j(e);
86
+ P((s) => ({ ...s, [t]: "loading" }));
87
87
  try {
88
- const s = await Q(e, !0);
89
- q((i) => ({ ...i, [t]: s }));
88
+ const s = await F(e, !0);
89
+ P((i) => ({ ...i, [t]: s }));
90
90
  } catch {
91
- q((s) => ({ ...s, [t]: null }));
91
+ P((s) => ({ ...s, [t]: null }));
92
92
  }
93
- }, se = async (e) => {
94
- const t = P(e);
95
- _(t);
93
+ }, ne = async (e) => {
94
+ const t = j(e);
95
+ E(t);
96
96
  try {
97
97
  k = 0;
98
- const s = await Q(e, !1);
99
- if (k === 0 && E((i) => ({ ...i, [t]: s })), k > 0 && N.info(
100
- `${v(e)}: running on ${k} record${k === 1 ? "" : "s"} — each row updates as it finishes, and a notification tells you how it ended.`,
98
+ const s = await F(e, !1);
99
+ if (k === 0 && Q((i) => ({ ...i, [t]: s })), k > 0 && N.info(
100
+ `${v(e)}: running on ${$(k)} record${k === 1 ? "" : "s"} — each row updates as it finishes, and a notification tells you how it ended.`,
101
101
  { duration: 8e3 }
102
102
  ), k === 0 || s.succeeded + s.failed + s.skipped > 0) {
103
- const i = Re(v(e), s);
103
+ const i = qe(v(e), s);
104
104
  s.failed > 0 ? N.warning(i, { duration: 8e3 }) : k === 0 && N.success(i, { duration: 4e3 });
105
105
  }
106
106
  for (const i of [
@@ -111,53 +111,53 @@ function Ie({
111
111
  "integration-obligations",
112
112
  "item-actions"
113
113
  ])
114
- V.invalidateQueries({ queryKey: [i] });
114
+ W.invalidateQueries({ queryKey: [i] });
115
115
  } catch (s) {
116
116
  const i = s.response;
117
- N.error((i == null ? void 0 : i.error) ?? ge(s, `${v(e)} failed`));
117
+ N.error((i == null ? void 0 : i.error) ?? ye(s, `${v(e)} failed`));
118
118
  } finally {
119
- _(null);
119
+ E(null);
120
120
  }
121
- }, F = [
122
- ...X.map((e) => ({ kind: "push", action: e })),
123
- ...O.length > 0 ? [{ kind: "retry", collections: O }] : []
121
+ }, L = [
122
+ ...Y.map((e) => ({ kind: "push", action: e })),
123
+ ...S.length > 0 ? [{ kind: "retry", collections: S }] : []
124
124
  ];
125
- if (F.length === 0) return null;
126
- const ne = (e) => n === "dark" ? H(
125
+ if (L.length === 0) return null;
126
+ const re = (e) => n === "dark" ? J(
127
127
  "inline-flex h-8 items-center gap-1.5 rounded-md border border-white/20 px-3 text-[12.5px] font-medium transition-colors hover:bg-white/10 disabled:opacity-50 dark:border-border dark:hover:bg-muted",
128
128
  e && "bg-white/10"
129
- ) : H(
129
+ ) : J(
130
130
  "inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[12px] font-medium text-slate-600 transition-colors hover:bg-slate-100 disabled:opacity-50 dark:text-slate-300 dark:hover:bg-muted",
131
131
  e && "bg-slate-100 dark:bg-muted"
132
132
  );
133
- return /* @__PURE__ */ l(oe, { children: F.map((e) => {
134
- var L, z, I, T;
135
- const t = P(e), s = v(e), i = e.kind === "push" ? e.action.collections : e.collections, o = a.filter((g) => i.includes(g.collection)).length, u = Y === t, b = M === t, m = e.kind === "push" ? (L = e.action.confirm) == null ? void 0 : L.input : void 0, p = Z[t], h = D[t] ?? null, x = p && p !== "loading" ? p.succeeded : null, re = o > 0 && !b && x !== 0 && (!(m != null && m.required) || w.trim().length > 0), ie = e.kind === "push" ? ((z = e.action.confirm) == null ? void 0 : z.body) ?? `Runs "${e.action.label}" on each selected record, one at a time. Every record is a real request to the partner.` : "Re-sends the latest failed push of each selected record, partner by partner — the same stored request the record’s own Retry button sends.";
133
+ return /* @__PURE__ */ l(le, { children: L.map((e) => {
134
+ var z, I, T, K;
135
+ const t = j(e), s = v(e), i = e.kind === "push" ? e.action.collections : e.collections, o = a.filter((g) => i.includes(g.collection)).length, u = Z === t, b = _ === t, m = e.kind === "push" ? (z = e.action.confirm) == null ? void 0 : z.input : void 0, p = D[t], h = ee[t] ?? null, x = p && p !== "loading" ? p.succeeded : null, ie = o > 0 && !b && x !== 0 && (!(m != null && m.required) || w.trim().length > 0), ae = e.kind === "push" ? ((I = e.action.confirm) == null ? void 0 : I.body) ?? `Runs "${e.action.label}" on each selected record, one at a time. Every record is a real request to the partner.` : "Re-sends the latest failed push of each selected record, partner by partner — the same stored request the record’s own Retry button sends.";
136
136
  return /* @__PURE__ */ c(
137
- ye,
137
+ we,
138
138
  {
139
139
  open: u,
140
140
  onOpenChange: (g) => {
141
- A(g ? t : null), g ? (B(""), E((ae) => ({ ...ae, [t]: null })), te(e)) : h && (f == null || f(h));
141
+ B(g ? t : null), g ? (M(""), Q((oe) => ({ ...oe, [t]: null })), se(e)) : h && (f == null || f(h));
142
142
  },
143
143
  children: [
144
- /* @__PURE__ */ l(we, { asChild: !0, children: /* @__PURE__ */ c(
144
+ /* @__PURE__ */ l(ve, { asChild: !0, children: /* @__PURE__ */ c(
145
145
  "button",
146
146
  {
147
147
  type: "button",
148
- disabled: d || !!M,
148
+ disabled: d || !!_,
149
149
  "data-bulk-push-action": e.kind === "push" ? e.action.id : void 0,
150
150
  "data-bulk-retry-push": e.kind === "retry" ? "" : void 0,
151
151
  title: e.kind === "push" ? `Run ${e.action.label} on the selected records` : "Re-send each selected record’s latest failed push",
152
- className: ne(u),
152
+ className: re(u),
153
153
  children: [
154
- b ? /* @__PURE__ */ l(K, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ l(de, { className: "h-3.5 w-3.5" }),
154
+ b ? /* @__PURE__ */ l(U, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ l(ue, { className: "h-3.5 w-3.5" }),
155
155
  s
156
156
  ]
157
157
  }
158
158
  ) }),
159
159
  /* @__PURE__ */ c(
160
- ve,
160
+ Ne,
161
161
  {
162
162
  align: "center",
163
163
  side: "top",
@@ -174,7 +174,7 @@ function Ie({
174
174
  o === 1 ? "" : "s"
175
175
  ] })
176
176
  ] }),
177
- /* @__PURE__ */ l("p", { className: "mt-1 text-[12px] leading-snug text-slate-600 dark:text-slate-400", children: ie }),
177
+ /* @__PURE__ */ l("p", { className: "mt-1 text-[12px] leading-snug text-slate-600 dark:text-slate-400", children: ae }),
178
178
  !h && (p === "loading" ? /* @__PURE__ */ l("p", { className: "mt-2 text-[11.5px] text-slate-400", "data-bulk-push-preview": "loading", children: "Checking which records this applies to…" }) : p ? /* @__PURE__ */ c(
179
179
  "p",
180
180
  {
@@ -188,7 +188,7 @@ function Ie({
188
188
  e.kind === "push" ? "run" : "be retried",
189
189
  p.skipped + p.failed > 0 && /* @__PURE__ */ c("span", { className: "font-normal text-slate-500 dark:text-slate-400", children: [
190
190
  " · ",
191
- qe(p)
191
+ Pe(p)
192
192
  ] })
193
193
  ]
194
194
  }
@@ -202,21 +202,21 @@ function Ie({
202
202
  "textarea",
203
203
  {
204
204
  value: w,
205
- onChange: (g) => B(g.target.value),
205
+ onChange: (g) => M(g.target.value),
206
206
  placeholder: m.placeholder ?? "Sent with every record",
207
207
  rows: 2,
208
208
  className: "mt-1 w-full resize-none rounded-md border border-slate-200 bg-white px-2 py-1.5 text-[12.5px] focus:border-nvr-cyan focus:outline-none dark:border-border dark:bg-card dark:text-slate-100"
209
209
  }
210
210
  )
211
211
  ] }),
212
- h && /* @__PURE__ */ l(Pe, { result: h, labelFor: ee }),
212
+ h && /* @__PURE__ */ l(je, { result: h, labelFor: te }),
213
213
  /* @__PURE__ */ c("div", { className: "mt-3 flex items-center justify-end gap-2", children: [
214
214
  /* @__PURE__ */ l(
215
215
  "button",
216
216
  {
217
217
  type: "button",
218
218
  onClick: () => {
219
- A(null), h && (f == null || f(h));
219
+ B(null), h && (f == null || f(h));
220
220
  },
221
221
  className: "h-8 rounded-md px-2.5 text-[12.5px] font-medium text-slate-600 hover:bg-muted dark:text-slate-300",
222
222
  children: h ? "Done" : "Close"
@@ -226,11 +226,11 @@ function Ie({
226
226
  "button",
227
227
  {
228
228
  type: "button",
229
- onClick: () => void se(e),
230
- disabled: !re,
229
+ onClick: () => void ne(e),
230
+ disabled: !ie,
231
231
  "data-bulk-push-run": !0,
232
232
  className: "h-8 rounded-md bg-nvr-cyan px-3 text-[12.5px] font-semibold text-[#172940] hover:bg-nvr-cyan-dark disabled:opacity-40",
233
- children: b ? /* @__PURE__ */ l(K, { className: "h-3.5 w-3.5 animate-spin" }) : x != null && x !== o ? `${e.kind === "push" ? ((I = e.action.confirm) == null ? void 0 : I.confirm_label) ?? s : "Retry"} · ${x} of ${o}` : `${e.kind === "push" ? ((T = e.action.confirm) == null ? void 0 : T.confirm_label) ?? s : "Retry"} ${o}`
233
+ children: b ? /* @__PURE__ */ l(U, { className: "h-3.5 w-3.5 animate-spin" }) : x != null && x !== o ? `${e.kind === "push" ? ((T = e.action.confirm) == null ? void 0 : T.confirm_label) ?? s : "Retry"} · ${$(x)} of ${$(o)}` : `${e.kind === "push" ? ((K = e.action.confirm) == null ? void 0 : K.confirm_label) ?? s : "Retry"} ${o}`
234
234
  }
235
235
  )
236
236
  ] })
@@ -243,7 +243,7 @@ function Ie({
243
243
  );
244
244
  }) });
245
245
  }
246
- function qe(a) {
246
+ function Pe(a) {
247
247
  const r = /* @__PURE__ */ new Map();
248
248
  for (const n of a.outcomes) {
249
249
  if (n.outcome === "change") continue;
@@ -252,7 +252,7 @@ function qe(a) {
252
252
  }
253
253
  return [...r.entries()].map(([n, d]) => `${d} ${n}`).join(" · ");
254
254
  }
255
- function Pe({
255
+ function je({
256
256
  result: a,
257
257
  labelFor: r
258
258
  }) {
@@ -262,8 +262,9 @@ function Pe({
262
262
  " done",
263
263
  a.skipped > 0 && ` · ${a.skipped} skipped`,
264
264
  a.failed > 0 && /* @__PURE__ */ c("span", { className: "text-red-600 dark:text-red-400", children: [
265
- " · ",
266
- a.failed,
265
+ " ",
266
+ "· ",
267
+ $(a.failed),
267
268
  " failed"
268
269
  ] })
269
270
  ] }),
@@ -274,7 +275,7 @@ function Pe({
274
275
  "data-outcome": n.outcome,
275
276
  className: "flex items-start gap-1.5 text-[11.5px] leading-snug",
276
277
  children: [
277
- n.outcome === "change" ? /* @__PURE__ */ l(ue, { className: "mt-px h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400" }) : n.outcome === "fail" ? /* @__PURE__ */ l(me, { className: "mt-px h-3.5 w-3.5 shrink-0 text-red-600 dark:text-red-400" }) : /* @__PURE__ */ l(pe, { className: "mt-px h-3.5 w-3.5 shrink-0 text-slate-400" }),
278
+ n.outcome === "change" ? /* @__PURE__ */ l(me, { className: "mt-px h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400" }) : n.outcome === "fail" ? /* @__PURE__ */ l(pe, { className: "mt-px h-3.5 w-3.5 shrink-0 text-red-600 dark:text-red-400" }) : /* @__PURE__ */ l(he, { className: "mt-px h-3.5 w-3.5 shrink-0 text-slate-400" }),
278
279
  /* @__PURE__ */ c("span", { className: "min-w-0", children: [
279
280
  /* @__PURE__ */ l("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: r(n.item) }),
280
281
  n.reason && /* @__PURE__ */ c("span", { className: "break-words text-slate-500 dark:text-slate-400", children: [
@@ -290,7 +291,7 @@ function Pe({
290
291
  ] });
291
292
  }
292
293
  export {
293
- Ie as PushBulkButtons,
294
- Pe as PushResultList,
295
- J as builtinListed
294
+ Te as PushBulkButtons,
295
+ je as PushResultList,
296
+ V as builtinListed
296
297
  };
@@ -1,6 +1,6 @@
1
- import { formSections as s, mergeFormSections as a, HEADER_SECTION_KEY as d } from "../../lib/form-sections.js";
2
- import { titleCase as c } from "../../lib/utils.js";
3
- function b(e, n = {}) {
1
+ import { formSections as s, mergeFormSections as m, HEADER_SECTION_KEY as d } from "../../lib/form-sections.js";
2
+ import { titleCase as c, formatNumber as a } from "../../lib/utils.js";
3
+ function h(e, n = {}) {
4
4
  const r = e.forms.map(
5
5
  (f) => s(f.groups, f.placements, { ungroupedSort: f.ungrouped_sort })
6
6
  );
@@ -15,7 +15,7 @@ function b(e, n = {}) {
15
15
  ]);
16
16
  }
17
17
  const l = [];
18
- for (const f of a(r)) {
18
+ for (const f of m(r)) {
19
19
  const i = f.fields.flatMap((o) => {
20
20
  const t = e.fields[o.field];
21
21
  return t ? [
@@ -33,20 +33,20 @@ function b(e, n = {}) {
33
33
  });
34
34
  i.length && l.push({ key: f.key, label: f.label, options: i });
35
35
  }
36
- return m(l);
36
+ return u(l);
37
37
  }
38
- function m(e) {
38
+ function u(e) {
39
39
  const n = (l) => l.key === d ? "Record header" : l.label.split(" › ").pop() ?? l.label, r = /* @__PURE__ */ new Map();
40
40
  for (const l of e) r.set(n(l), (r.get(n(l)) ?? 0) + 1);
41
41
  return e.map((l) => ({ ...l, label: (r.get(n(l)) ?? 0) > 1 ? l.label : n(l) }));
42
42
  }
43
- function h(e, n) {
43
+ function k(e, n) {
44
44
  const r = [];
45
45
  return e.locked > 0 && r.push(
46
46
  e.writable === 0 && e.offForm === 0 ? e.reason ?? "Locked" : `locked on ${e.locked}`
47
- ), e.offForm > 0 && r.push(`not on the form of ${e.offForm}`), r.length === 0 ? null : e.writable === 0 && e.offForm === 0 ? r[0] : `${e.writable} of ${n} — ${r.join(", ")}`;
47
+ ), e.offForm > 0 && r.push(`not on the form of ${e.offForm}`), r.length === 0 ? null : e.writable === 0 && e.offForm === 0 ? r[0] : `${a(e.writable)} of ${a(n)} — ${r.join(", ")}`;
48
48
  }
49
49
  export {
50
- h as bulkFieldNote,
51
- b as bulkFieldSections
50
+ k as bulkFieldNote,
51
+ h as bulkFieldSections
52
52
  };
@@ -1,4 +1,6 @@
1
1
  import { formatValue as b } from "../../lib/format-value.js";
2
+ import { formatCurrency as S } from "../../lib/number-format.js";
3
+ import { numberKindOf as y, numberCurrencyOf as v } from "../../lib/number-kind.js";
2
4
  const g = [
3
5
  { fn: "sum", label: "Sum", short: "Sum" },
4
6
  { fn: "avg", label: "Average", short: "Avg" },
@@ -6,13 +8,13 @@ const g = [
6
8
  { fn: "max", label: "Maximum", short: "Max" },
7
9
  { fn: "count", label: "Count (filled in)", short: "Count" }
8
10
  ];
9
- function S(e) {
11
+ function O(e) {
10
12
  return typeof e == "string" && g.some((n) => n.fn === e);
11
13
  }
12
- function v(e) {
14
+ function _(e) {
13
15
  return /^[A-Za-z_][A-Za-z0-9_]*$/.test(e);
14
16
  }
15
- function w(e, n) {
17
+ function z(e, n) {
16
18
  const t = /* @__PURE__ */ new Map();
17
19
  for (const r of e) {
18
20
  const o = t.get(r.fn) ?? [];
@@ -24,50 +26,50 @@ function w(e, n) {
24
26
  ...n.conditions ? { conditions: n.conditions } : {}
25
27
  };
26
28
  }
27
- function x(e, n, t) {
28
- var s, l, c;
29
- const r = (c = (l = (s = e == null ? void 0 : e.data) == null ? void 0 : s[0]) == null ? void 0 : l[t]) == null ? void 0 : c[n];
29
+ function C(e, n, t) {
30
+ var s, c, l;
31
+ const r = (l = (c = (s = e == null ? void 0 : e.data) == null ? void 0 : s[0]) == null ? void 0 : c[t]) == null ? void 0 : l[n];
30
32
  if (r == null || r === "") return null;
31
33
  const o = Number(r);
32
34
  return Number.isFinite(o) ? o : null;
33
35
  }
34
- function M(e, n, t) {
35
- return n === "count" ? Math.round(e).toLocaleString("en-US") : (t == null ? void 0 : t.type) === "number" ? b(String(e), t) : (Math.round(e * 100) / 100).toLocaleString("en-US", { maximumFractionDigits: 2 });
36
+ function F(e, n, t, r) {
37
+ return n === "count" ? Math.round(e).toLocaleString("en-US") : (t == null ? void 0 : t.type) === "number" ? b(String(e), t) : r && y(r) === "money" ? S(e, { currency: v(r) ?? "USD" }) : (Math.round(e * 100) / 100).toLocaleString("en-US", { maximumFractionDigits: 2 });
36
38
  }
37
- const p = (e) => `nvr_cbv_totals_${e}`, y = (e) => e === "off" || S(e);
38
- function $(e) {
39
- return _(p(e), v);
39
+ const p = (e) => `nvr_cbv_totals_${e}`, T = (e) => e === "off" || O(e);
40
+ function N(e) {
41
+ return A(p(e), _);
40
42
  }
41
- function j(e, n) {
42
- O(p(e), n);
43
+ function U(e, n) {
44
+ k(p(e), n);
43
45
  }
44
- function _(e, n) {
46
+ function A(e, n) {
45
47
  try {
46
48
  const t = localStorage.getItem(e), r = t ? JSON.parse(t) : null;
47
49
  if (!r || typeof r != "object") return {};
48
50
  const o = r.v === 2 && r.o && typeof r.o == "object" ? r.o : r, s = {};
49
- for (const [l, c] of Object.entries(o)) n(l) && y(c) && (s[l] = c);
51
+ for (const [c, l] of Object.entries(o)) n(c) && T(l) && (s[c] = l);
50
52
  return s;
51
53
  } catch {
52
54
  return {};
53
55
  }
54
56
  }
55
- function O(e, n) {
57
+ function k(e, n) {
56
58
  try {
57
59
  Object.keys(n).length === 0 ? localStorage.removeItem(e) : localStorage.setItem(e, JSON.stringify({ v: 2, o: n }));
58
60
  } catch {
59
61
  }
60
62
  }
61
- function z(e, n) {
63
+ function Z(e, n) {
62
64
  const t = { ...e };
63
65
  for (const [r, o] of Object.entries(n))
64
66
  o === "off" ? delete t[r] : t[r] = o;
65
67
  return t;
66
68
  }
67
- function F(e, n, t) {
69
+ function L(e, n, t) {
68
70
  return { ...e, [n]: t ?? "off" };
69
71
  }
70
- function N(e, n) {
72
+ function E(e, n) {
71
73
  const t = {};
72
74
  for (const [r, o] of Object.entries(e))
73
75
  (o === "off" ? !n[r] : n[r] === o) || (t[r] = o);
@@ -76,8 +78,8 @@ function N(e, n) {
76
78
  function h(e) {
77
79
  return !e.computed_formula || !!e.computed_store;
78
80
  }
79
- const T = /* @__PURE__ */ new Set(["integer", "bigInteger", "biginteger", "decimal", "float"]);
80
- function A(e) {
81
+ const w = /* @__PURE__ */ new Set(["integer", "bigInteger", "biginteger", "decimal", "float"]);
82
+ function x(e) {
81
83
  const n = String(e ?? "").trim();
82
84
  if (!n) return null;
83
85
  let t = 0;
@@ -94,11 +96,11 @@ function A(e) {
94
96
  const f = /^coalesce\s*\(/i.exec(a);
95
97
  if (f) {
96
98
  t += f[0].length;
97
- const d = o(), m = /^\s*,\s*0(?:\.0+)?\s*\)/.exec(n.slice(t));
98
- return !d || !m ? null : (t += m[0].length, d);
99
+ const m = o(), d = /^\s*,\s*0(?:\.0+)?\s*\)/.exec(n.slice(t));
100
+ return !m || !d ? null : (t += d[0].length, m);
99
101
  }
100
102
  return null;
101
- }, s = /* @__PURE__ */ new Map(), l = (a) => {
103
+ }, s = /* @__PURE__ */ new Map(), c = (a) => {
102
104
  let i = !0;
103
105
  for (; ; ) {
104
106
  r();
@@ -107,7 +109,7 @@ function A(e) {
107
109
  n[t] === "-" && (u = u === 1 ? -1 : 1), t++, r();
108
110
  else if (!i) return !1;
109
111
  if (i = !1, n[t] === "(") {
110
- if (t++, !l(u) || (r(), n[t] !== ")")) return !1;
112
+ if (t++, !c(u) || (r(), n[t] !== ")")) return !1;
111
113
  t++;
112
114
  } else {
113
115
  const f = o();
@@ -118,20 +120,20 @@ function A(e) {
118
120
  if (n[t] !== "+" && n[t] !== "-") return !1;
119
121
  }
120
122
  };
121
- if (!l(1) || (r(), t !== n.length)) return null;
122
- const c = [];
123
+ if (!c(1) || (r(), t !== n.length)) return null;
124
+ const l = [];
123
125
  for (const [a, i] of s)
124
- if (i === 1 || i === -1) c.push({ field: a, sign: i });
126
+ if (i === 1 || i === -1) l.push({ field: a, sign: i });
125
127
  else if (i !== 0) return null;
126
- return c.length ? c : null;
128
+ return l.length ? l : null;
127
129
  }
128
- function Z(e, n) {
130
+ function I(e, n) {
129
131
  if (h(e)) return { kind: "server" };
130
132
  if (e.computed_type !== "rollup") {
131
- const t = A(e.computed_formula ?? "");
133
+ const t = x(e.computed_formula ?? "");
132
134
  if (t != null && t.every((r) => {
133
135
  const o = n(r.field);
134
- return !!o && h(o) && T.has(String(o.type ?? ""));
136
+ return !!o && h(o) && w.has(String(o.type ?? ""));
135
137
  }))
136
138
  return { kind: "derived", terms: t };
137
139
  }
@@ -140,7 +142,7 @@ function Z(e, n) {
140
142
  why: e.computed_type === "rollup" ? "Worked out from linked records each time the list is read, so it has no total." : "Calculated each time the list is read from a formula that does more than add and subtract stored columns, so it has no total."
141
143
  };
142
144
  }
143
- function C(e, n) {
145
+ function K(e, n) {
144
146
  let t = 0;
145
147
  for (const r of e) {
146
148
  const o = n(r.field);
@@ -149,28 +151,28 @@ function C(e, n) {
149
151
  }
150
152
  return Math.round(t * 1e6) / 1e6;
151
153
  }
152
- function L(e, n, t) {
154
+ function B(e, n, t) {
153
155
  var s;
154
- const r = ((s = g.find((l) => l.fn === e)) == null ? void 0 : s.label.toLowerCase()) ?? e, o = t == null ? "all matching records" : `all ${t.toLocaleString("en-US")} matching records`;
156
+ const r = ((s = g.find((c) => c.fn === e)) == null ? void 0 : s.label.toLowerCase()) ?? e, o = t == null ? "all matching records" : `all ${t.toLocaleString("en-US")} matching records`;
155
157
  return e === "count" ? `Records with ${n} filled in, across ${o}` : `${r.charAt(0).toUpperCase()}${r.slice(1)} of ${n} across ${o}`;
156
158
  }
157
159
  export {
158
160
  g as TOTAL_FNS,
159
- C as combineTerms,
160
- M as formatTotal,
161
+ K as combineTerms,
162
+ F as formatTotal,
161
163
  h as isStoredField,
162
- S as isTotalFn,
163
- A as linearSumTerms,
164
- $ as loadTotalOverrides,
165
- _ as loadTotalOverridesAt,
166
- N as overridesAfterSave,
167
- x as readTotal,
168
- j as rememberTotalOverrides,
169
- O as rememberTotalOverridesAt,
170
- F as setOverride,
171
- z as shownTotals,
172
- L as totalTip,
173
- w as totalsBatchParams,
174
- v as totalsEligibleKey,
175
- Z as totalsSupport
164
+ O as isTotalFn,
165
+ x as linearSumTerms,
166
+ N as loadTotalOverrides,
167
+ A as loadTotalOverridesAt,
168
+ E as overridesAfterSave,
169
+ C as readTotal,
170
+ U as rememberTotalOverrides,
171
+ k as rememberTotalOverridesAt,
172
+ L as setOverride,
173
+ Z as shownTotals,
174
+ B as totalTip,
175
+ z as totalsBatchParams,
176
+ _ as totalsEligibleKey,
177
+ I as totalsSupport
176
178
  };