@adoptai/genui-components 0.1.32 → 0.1.45

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 (175) hide show
  1. package/README.md +5 -0
  2. package/dist/builders/BuilderForm.d.ts +16 -1
  3. package/dist/builders/BuilderForm.d.ts.map +1 -1
  4. package/dist/builders/EscalationCard.d.ts +6 -1
  5. package/dist/builders/EscalationCard.d.ts.map +1 -1
  6. package/dist/builders/FieldRenderer.d.ts +5 -1
  7. package/dist/builders/FieldRenderer.d.ts.map +1 -1
  8. package/dist/builders/FormBuilder.d.ts +7 -1
  9. package/dist/builders/FormBuilder.d.ts.map +1 -1
  10. package/dist/builders/StepperBuilder.d.ts +6 -1
  11. package/dist/builders/StepperBuilder.d.ts.map +1 -1
  12. package/dist/builders/fields.d.ts +5 -1
  13. package/dist/builders/fields.d.ts.map +1 -1
  14. package/dist/builders/resolver.d.ts +11 -0
  15. package/dist/builders/resolver.d.ts.map +1 -1
  16. package/dist/composites/aging-report/resolver.cjs +1 -1
  17. package/dist/composites/aging-report/resolver.cjs.map +1 -1
  18. package/dist/composites/aging-report/resolver.js +1 -1
  19. package/dist/composites/aging-report/resolver.js.map +1 -1
  20. package/dist/composites/alert/resolver.cjs +87 -0
  21. package/dist/composites/alert/resolver.cjs.map +1 -1
  22. package/dist/composites/alert/resolver.js +87 -0
  23. package/dist/composites/alert/resolver.js.map +1 -1
  24. package/dist/composites/audit-trail/resolver.cjs +86 -0
  25. package/dist/composites/audit-trail/resolver.cjs.map +1 -1
  26. package/dist/composites/audit-trail/resolver.js +86 -0
  27. package/dist/composites/audit-trail/resolver.js.map +1 -1
  28. package/dist/composites/balance-sheet/resolver.cjs +1 -1
  29. package/dist/composites/balance-sheet/resolver.cjs.map +1 -1
  30. package/dist/composites/balance-sheet/resolver.js +1 -1
  31. package/dist/composites/balance-sheet/resolver.js.map +1 -1
  32. package/dist/composites/cited-answer/resolver.cjs +86 -0
  33. package/dist/composites/cited-answer/resolver.cjs.map +1 -1
  34. package/dist/composites/cited-answer/resolver.js +86 -0
  35. package/dist/composites/cited-answer/resolver.js.map +1 -1
  36. package/dist/composites/compliance-checklist/resolver.cjs +86 -0
  37. package/dist/composites/compliance-checklist/resolver.cjs.map +1 -1
  38. package/dist/composites/compliance-checklist/resolver.js +86 -0
  39. package/dist/composites/compliance-checklist/resolver.js.map +1 -1
  40. package/dist/composites/connect-integration/resolver.cjs +465 -0
  41. package/dist/composites/connect-integration/resolver.cjs.map +1 -0
  42. package/dist/composites/connect-integration/resolver.js +463 -0
  43. package/dist/composites/connect-integration/resolver.js.map +1 -0
  44. package/dist/composites/document-preview/resolver.cjs +86 -0
  45. package/dist/composites/document-preview/resolver.cjs.map +1 -1
  46. package/dist/composites/document-preview/resolver.js +86 -0
  47. package/dist/composites/document-preview/resolver.js.map +1 -1
  48. package/dist/composites/download-card/resolver.cjs +86 -0
  49. package/dist/composites/download-card/resolver.cjs.map +1 -1
  50. package/dist/composites/download-card/resolver.js +86 -0
  51. package/dist/composites/download-card/resolver.js.map +1 -1
  52. package/dist/composites/engagement-pipeline/resolver.cjs +86 -0
  53. package/dist/composites/engagement-pipeline/resolver.cjs.map +1 -1
  54. package/dist/composites/engagement-pipeline/resolver.js +86 -0
  55. package/dist/composites/engagement-pipeline/resolver.js.map +1 -1
  56. package/dist/composites/entity-card-grid/resolver.cjs +2 -2
  57. package/dist/composites/entity-card-grid/resolver.cjs.map +1 -1
  58. package/dist/composites/entity-card-grid/resolver.js +2 -2
  59. package/dist/composites/entity-card-grid/resolver.js.map +1 -1
  60. package/dist/composites/general-ledger/resolver.cjs +1 -0
  61. package/dist/composites/general-ledger/resolver.cjs.map +1 -1
  62. package/dist/composites/general-ledger/resolver.d.ts.map +1 -1
  63. package/dist/composites/general-ledger/resolver.js +1 -0
  64. package/dist/composites/general-ledger/resolver.js.map +1 -1
  65. package/dist/composites/income-statement/resolver.cjs +1 -1
  66. package/dist/composites/income-statement/resolver.cjs.map +1 -1
  67. package/dist/composites/income-statement/resolver.js +1 -1
  68. package/dist/composites/income-statement/resolver.js.map +1 -1
  69. package/dist/composites/integrations-list/resolver.cjs +511 -0
  70. package/dist/composites/integrations-list/resolver.cjs.map +1 -0
  71. package/dist/composites/integrations-list/resolver.js +509 -0
  72. package/dist/composites/integrations-list/resolver.js.map +1 -0
  73. package/dist/composites/invoice-detail/resolver.cjs +86 -0
  74. package/dist/composites/invoice-detail/resolver.cjs.map +1 -1
  75. package/dist/composites/invoice-detail/resolver.js +86 -0
  76. package/dist/composites/invoice-detail/resolver.js.map +1 -1
  77. package/dist/composites/job-tracker/resolver.cjs +86 -0
  78. package/dist/composites/job-tracker/resolver.cjs.map +1 -1
  79. package/dist/composites/job-tracker/resolver.js +86 -0
  80. package/dist/composites/job-tracker/resolver.js.map +1 -1
  81. package/dist/composites/key-value-list/resolver.cjs +114 -3
  82. package/dist/composites/key-value-list/resolver.cjs.map +1 -1
  83. package/dist/composites/key-value-list/resolver.d.ts.map +1 -1
  84. package/dist/composites/key-value-list/resolver.js +114 -3
  85. package/dist/composites/key-value-list/resolver.js.map +1 -1
  86. package/dist/composites/legal-test-result/resolver.cjs +86 -0
  87. package/dist/composites/legal-test-result/resolver.cjs.map +1 -1
  88. package/dist/composites/legal-test-result/resolver.js +86 -0
  89. package/dist/composites/legal-test-result/resolver.js.map +1 -1
  90. package/dist/composites/news-feed/resolver.cjs +86 -0
  91. package/dist/composites/news-feed/resolver.cjs.map +1 -1
  92. package/dist/composites/news-feed/resolver.js +86 -0
  93. package/dist/composites/news-feed/resolver.js.map +1 -1
  94. package/dist/composites/pipeline-preview/resolver.cjs +926 -0
  95. package/dist/composites/pipeline-preview/resolver.cjs.map +1 -0
  96. package/dist/composites/pipeline-preview/resolver.js +924 -0
  97. package/dist/composites/pipeline-preview/resolver.js.map +1 -0
  98. package/dist/composites/provenance-chain/resolver.cjs +86 -0
  99. package/dist/composites/provenance-chain/resolver.cjs.map +1 -1
  100. package/dist/composites/provenance-chain/resolver.js +86 -0
  101. package/dist/composites/provenance-chain/resolver.js.map +1 -1
  102. package/dist/composites/reconciliation-view/resolver.cjs +90 -32
  103. package/dist/composites/reconciliation-view/resolver.cjs.map +1 -1
  104. package/dist/composites/reconciliation-view/resolver.d.ts.map +1 -1
  105. package/dist/composites/reconciliation-view/resolver.js +91 -33
  106. package/dist/composites/reconciliation-view/resolver.js.map +1 -1
  107. package/dist/composites/stacked-breakdown/resolver.cjs +13 -2
  108. package/dist/composites/stacked-breakdown/resolver.cjs.map +1 -1
  109. package/dist/composites/stacked-breakdown/resolver.d.ts.map +1 -1
  110. package/dist/composites/stacked-breakdown/resolver.js +13 -2
  111. package/dist/composites/stacked-breakdown/resolver.js.map +1 -1
  112. package/dist/composites/stat-grid/resolver.cjs +169 -5
  113. package/dist/composites/stat-grid/resolver.cjs.map +1 -1
  114. package/dist/composites/stat-grid/resolver.d.ts.map +1 -1
  115. package/dist/composites/stat-grid/resolver.js +170 -6
  116. package/dist/composites/stat-grid/resolver.js.map +1 -1
  117. package/dist/composites/status-card/resolver.cjs +86 -0
  118. package/dist/composites/status-card/resolver.cjs.map +1 -1
  119. package/dist/composites/status-card/resolver.js +86 -0
  120. package/dist/composites/status-card/resolver.js.map +1 -1
  121. package/dist/composites/tabs-panel/resolver.cjs +86 -0
  122. package/dist/composites/tabs-panel/resolver.cjs.map +1 -1
  123. package/dist/composites/tabs-panel/resolver.js +86 -0
  124. package/dist/composites/tabs-panel/resolver.js.map +1 -1
  125. package/dist/composites/transaction-feed/resolver.cjs +86 -0
  126. package/dist/composites/transaction-feed/resolver.cjs.map +1 -1
  127. package/dist/composites/transaction-feed/resolver.js +86 -0
  128. package/dist/composites/transaction-feed/resolver.js.map +1 -1
  129. package/dist/composites/trial-balance/resolver.cjs +1 -1
  130. package/dist/composites/trial-balance/resolver.cjs.map +1 -1
  131. package/dist/composites/trial-balance/resolver.js +1 -1
  132. package/dist/composites/trial-balance/resolver.js.map +1 -1
  133. package/dist/composites/variance-analysis/resolver.cjs +1 -1
  134. package/dist/composites/variance-analysis/resolver.cjs.map +1 -1
  135. package/dist/composites/variance-analysis/resolver.js +1 -1
  136. package/dist/composites/variance-analysis/resolver.js.map +1 -1
  137. package/dist/composites/workflow-stepper/resolver.cjs +976 -0
  138. package/dist/composites/workflow-stepper/resolver.cjs.map +1 -0
  139. package/dist/composites/workflow-stepper/resolver.d.ts +20 -0
  140. package/dist/composites/workflow-stepper/resolver.d.ts.map +1 -0
  141. package/dist/composites/workflow-stepper/resolver.js +969 -0
  142. package/dist/composites/workflow-stepper/resolver.js.map +1 -0
  143. package/dist/index.cjs +1268 -275
  144. package/dist/index.cjs.map +1 -1
  145. package/dist/index.d.ts +7 -0
  146. package/dist/index.d.ts.map +1 -1
  147. package/dist/index.js +1105 -120
  148. package/dist/index.js.map +1 -1
  149. package/dist/renderer.cjs +1153 -211
  150. package/dist/renderer.cjs.map +1 -1
  151. package/dist/renderer.js +1015 -73
  152. package/dist/renderer.js.map +1 -1
  153. package/dist/resolver.cjs +1152 -210
  154. package/dist/resolver.cjs.map +1 -1
  155. package/dist/resolver.d.ts.map +1 -1
  156. package/dist/resolver.js +1015 -73
  157. package/dist/resolver.js.map +1 -1
  158. package/dist/schemas/index.cjs +75 -1
  159. package/dist/schemas/index.cjs.map +1 -1
  160. package/dist/schemas/index.d.ts +122 -0
  161. package/dist/schemas/index.d.ts.map +1 -1
  162. package/dist/schemas/index.js +75 -1
  163. package/dist/schemas/index.js.map +1 -1
  164. package/dist/schemas/workflow-stepper.d.ts +122 -0
  165. package/dist/schemas/workflow-stepper.d.ts.map +1 -0
  166. package/dist/shared/FitText.d.ts +22 -0
  167. package/dist/shared/FitText.d.ts.map +1 -0
  168. package/dist/shared/InteractionContext.d.ts +20 -0
  169. package/dist/shared/InteractionContext.d.ts.map +1 -0
  170. package/dist/shared/Markdown.d.ts +2 -1
  171. package/dist/shared/Markdown.d.ts.map +1 -1
  172. package/dist/shared/styles.d.ts +14 -0
  173. package/dist/shared/styles.d.ts.map +1 -0
  174. package/dist/tool-definitions.json +114 -3
  175. package/package.json +2 -2
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var React33 = require('react');
4
+ var React41 = require('react');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var dagre = require('@dagrejs/dagre');
7
7
  var reactDom = require('react-dom');
@@ -37,7 +37,7 @@ function _interopNamespace(e) {
37
37
  return Object.freeze(n);
38
38
  }
39
39
 
40
- var React33__default = /*#__PURE__*/_interopDefault(React33);
40
+ var React41__default = /*#__PURE__*/_interopDefault(React41);
41
41
  var dagre__default = /*#__PURE__*/_interopDefault(dagre);
42
42
  var XLSX__namespace = /*#__PURE__*/_interopNamespace(XLSX);
43
43
  var Papa__default = /*#__PURE__*/_interopDefault(Papa);
@@ -111,14 +111,14 @@ var init_theme = __esm({
111
111
  }
112
112
  });
113
113
  function GenUIThemeProvider({ colors, children }) {
114
- const merged = React33.useMemo(
114
+ const merged = React41.useMemo(
115
115
  () => colors ? __spreadValues(__spreadValues({}, exports.DEFAULT_TOKENS), colors) : exports.DEFAULT_TOKENS,
116
116
  [colors]
117
117
  );
118
118
  return /* @__PURE__ */ jsxRuntime.jsx(GenUIThemeContext.Provider, { value: merged, children });
119
119
  }
120
120
  function useTheme() {
121
- return React33.useContext(GenUIThemeContext);
121
+ return React41.useContext(GenUIThemeContext);
122
122
  }
123
123
  exports.DEFAULT_TOKENS = void 0; var GenUIThemeContext;
124
124
  var init_ThemeContext = __esm({
@@ -134,7 +134,7 @@ var init_ThemeContext = __esm({
134
134
  SECONDARY: exports.SECONDARY,
135
135
  CHART_PALETTE: [...exports.CHART_PALETTE]
136
136
  };
137
- GenUIThemeContext = React33.createContext(exports.DEFAULT_TOKENS);
137
+ GenUIThemeContext = React41.createContext(exports.DEFAULT_TOKENS);
138
138
  }
139
139
  });
140
140
  function renderInline(text) {
@@ -235,6 +235,24 @@ function renderInline(text) {
235
235
  }
236
236
  return parts;
237
237
  }
238
+ function parseTableRow(line) {
239
+ let s = line.trim();
240
+ if (s.startsWith("|")) s = s.slice(1);
241
+ if (s.endsWith("|") && !s.endsWith("\\|")) s = s.slice(0, -1);
242
+ return s.split(new RegExp("(?<!\\\\)\\|")).map((c) => c.trim().replace(/\\\|/g, "|"));
243
+ }
244
+ function isTableSeparator(line) {
245
+ if (!line.includes("-")) return false;
246
+ const cells = parseTableRow(line);
247
+ return cells.length > 0 && cells.every((c) => /^:?-{1,}:?$/.test(c));
248
+ }
249
+ function alignFromSeparator(cell) {
250
+ const left = cell.startsWith(":");
251
+ const right = cell.endsWith(":");
252
+ if (left && right) return "center";
253
+ if (right) return "right";
254
+ return "left";
255
+ }
238
256
  function MarkdownBlock({ content }) {
239
257
  var _a;
240
258
  const lines = content.split("\n");
@@ -365,6 +383,74 @@ function MarkdownBlock({ content }) {
365
383
  );
366
384
  continue;
367
385
  }
386
+ if (trimmed.includes("|") && i + 1 < lines.length && isTableSeparator(lines[i + 1])) {
387
+ const headers = parseTableRow(trimmed);
388
+ const aligns = parseTableRow(lines[i + 1]).map(alignFromSeparator);
389
+ i += 2;
390
+ const rows = [];
391
+ while (i < lines.length) {
392
+ const li = lines[i].trim();
393
+ if (!li || !li.includes("|")) break;
394
+ rows.push(parseTableRow(li));
395
+ i++;
396
+ }
397
+ const colAlign = (idx) => {
398
+ var _a2;
399
+ return (_a2 = aligns[idx]) != null ? _a2 : "left";
400
+ };
401
+ elements.push(
402
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { margin: "6px 0 10px 0", overflowX: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
403
+ "table",
404
+ {
405
+ style: {
406
+ borderCollapse: "collapse",
407
+ width: "100%",
408
+ fontSize: "12px",
409
+ lineHeight: 1.4
410
+ },
411
+ children: [
412
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: headers.map((h, idx) => /* @__PURE__ */ jsxRuntime.jsx(
413
+ "th",
414
+ {
415
+ style: {
416
+ textAlign: colAlign(idx),
417
+ padding: "6px 10px",
418
+ borderBottom: `1px solid ${exports.BORDER}`,
419
+ background: exports.PAPER,
420
+ fontWeight: 600,
421
+ color: exports.MUTED,
422
+ fontSize: "10px",
423
+ textTransform: "uppercase",
424
+ letterSpacing: "0.04em",
425
+ whiteSpace: "nowrap"
426
+ },
427
+ children: renderInline(h)
428
+ },
429
+ idx
430
+ )) }) }),
431
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: rows.map((cells, rIdx) => /* @__PURE__ */ jsxRuntime.jsx("tr", { children: headers.map((_, cIdx) => {
432
+ var _a2;
433
+ return /* @__PURE__ */ jsxRuntime.jsx(
434
+ "td",
435
+ {
436
+ style: {
437
+ textAlign: colAlign(cIdx),
438
+ padding: "6px 10px",
439
+ borderBottom: `1px solid ${exports.BORDER}`,
440
+ color: "var(--foreground)",
441
+ verticalAlign: "top"
442
+ },
443
+ children: renderInline((_a2 = cells[cIdx]) != null ? _a2 : "")
444
+ },
445
+ cIdx
446
+ );
447
+ }) }, rIdx)) })
448
+ ]
449
+ }
450
+ ) }, key++)
451
+ );
452
+ continue;
453
+ }
368
454
  elements.push(
369
455
  /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "0 0 8px 0", lineHeight: 1.65 }, children: renderInline(trimmed) }, key++)
370
456
  );
@@ -778,11 +864,11 @@ async function getMermaid(t) {
778
864
  }
779
865
  function MermaidFallback({ diagram, title }) {
780
866
  const tokens = useTheme();
781
- const [svg, setSvg] = React33.useState("");
782
- const [err, setErr] = React33.useState(false);
783
- const [full, setFull] = React33.useState(false);
784
- const idRef = React33.useRef(0);
785
- React33.useEffect(() => {
867
+ const [svg, setSvg] = React41.useState("");
868
+ const [err, setErr] = React41.useState(false);
869
+ const [full, setFull] = React41.useState(false);
870
+ const idRef = React41.useRef(0);
871
+ React41.useEffect(() => {
786
872
  const id = ++renderSeq;
787
873
  idRef.current = id;
788
874
  setErr(false);
@@ -851,7 +937,7 @@ function FullscreenModalInner({ nodes, edges, title, onClose }) {
851
937
  ] }) });
852
938
  }
853
939
  function FullscreenModal({ nodes, edges, title, onClose }) {
854
- React33.useEffect(() => {
940
+ React41.useEffect(() => {
855
941
  const h = (e) => {
856
942
  if (e.key === "Escape") onClose();
857
943
  };
@@ -864,8 +950,8 @@ function FullscreenModal({ nodes, edges, title, onClose }) {
864
950
  );
865
951
  }
866
952
  function usePrefersReducedMotion() {
867
- const [reduced, setReduced] = React33.useState(false);
868
- React33.useEffect(() => {
953
+ const [reduced, setReduced] = React41.useState(false);
954
+ React41.useEffect(() => {
869
955
  var _a;
870
956
  if (typeof matchMedia === "undefined") return;
871
957
  const mq = matchMedia("(prefers-reduced-motion: reduce)");
@@ -909,9 +995,9 @@ function topoOrder(nodeIds, edges) {
909
995
  }
910
996
  function useAutoplay(order, enabled) {
911
997
  const reduced = usePrefersReducedMotion();
912
- const [step, setStep] = React33.useState(0);
998
+ const [step, setStep] = React41.useState(0);
913
999
  const key = order.join("|");
914
- React33.useEffect(() => {
1000
+ React41.useEffect(() => {
915
1001
  if (!enabled || reduced || order.length === 0) {
916
1002
  setStep(0);
917
1003
  return;
@@ -933,7 +1019,7 @@ function useAutoplay(order, enabled) {
933
1019
  timer = setTimeout(tick, 850);
934
1020
  return () => clearTimeout(timer);
935
1021
  }, [enabled, reduced, key]);
936
- return React33.useMemo(() => {
1022
+ return React41.useMemo(() => {
937
1023
  const m = {};
938
1024
  order.forEach((id, i) => {
939
1025
  m[id] = i < step ? "done" : i === step ? "active" : "pending";
@@ -955,13 +1041,13 @@ function resolveStates(nodes, nodeStates) {
955
1041
  }
956
1042
  function Inner({ diagram, title, autoplay, nodeStates }) {
957
1043
  const tokens = useTheme();
958
- const [full, setFull] = React33.useState(false);
959
- const [focused, setFocused] = React33.useState(false);
960
- const [boxW, setBoxW] = React33.useState(640);
961
- const containerRef = React33.useRef(null);
962
- const parsed = React33.useMemo(() => parseMermaidFlow(diagram), [diagram]);
963
- const layout = React33.useMemo(() => parsed ? computeLayout(parsed) : null, [parsed]);
964
- const themedEdges = React33.useMemo(
1044
+ const [full, setFull] = React41.useState(false);
1045
+ const [focused, setFocused] = React41.useState(false);
1046
+ const [boxW, setBoxW] = React41.useState(640);
1047
+ const containerRef = React41.useRef(null);
1048
+ const parsed = React41.useMemo(() => parseMermaidFlow(diagram), [diagram]);
1049
+ const layout = React41.useMemo(() => parsed ? computeLayout(parsed) : null, [parsed]);
1050
+ const themedEdges = React41.useMemo(
965
1051
  () => {
966
1052
  var _a;
967
1053
  return ((_a = layout == null ? void 0 : layout.edges) != null ? _a : []).map((e) => __spreadProps(__spreadValues({}, e), {
@@ -973,7 +1059,7 @@ function Inner({ diagram, title, autoplay, nodeStates }) {
973
1059
  },
974
1060
  [layout, tokens.ACCENT, tokens.MUTED]
975
1061
  );
976
- const order = React33.useMemo(
1062
+ const order = React41.useMemo(
977
1063
  () => {
978
1064
  var _a, _b;
979
1065
  return topoOrder(((_a = layout == null ? void 0 : layout.nodes) != null ? _a : []).map((n) => n.id), (_b = layout == null ? void 0 : layout.edges) != null ? _b : []);
@@ -981,19 +1067,19 @@ function Inner({ diagram, title, autoplay, nodeStates }) {
981
1067
  [layout]
982
1068
  );
983
1069
  const autoStatus = useAutoplay(order, !!autoplay);
984
- const staticStatus = React33.useMemo(() => {
1070
+ const staticStatus = React41.useMemo(() => {
985
1071
  var _a;
986
1072
  return resolveStates((_a = layout == null ? void 0 : layout.nodes) != null ? _a : [], nodeStates);
987
1073
  }, [layout, nodeStates]);
988
1074
  const statusMap = autoplay ? autoStatus : staticStatus;
989
- const displayNodes = React33.useMemo(
1075
+ const displayNodes = React41.useMemo(
990
1076
  () => {
991
1077
  var _a;
992
1078
  return ((_a = layout == null ? void 0 : layout.nodes) != null ? _a : []).map((n) => __spreadProps(__spreadValues({}, n), { data: __spreadProps(__spreadValues({}, n.data), { status: statusMap[n.id] }) }));
993
1079
  },
994
1080
  [layout, statusMap]
995
1081
  );
996
- const displayEdges = React33.useMemo(
1082
+ const displayEdges = React41.useMemo(
997
1083
  () => themedEdges.map((e) => {
998
1084
  const ss = statusMap[e.source];
999
1085
  const ts = statusMap[e.target];
@@ -1013,13 +1099,13 @@ function Inner({ diagram, title, autoplay, nodeStates }) {
1013
1099
  const [nodes, setNodes, onNC] = react.useNodesState(displayNodes);
1014
1100
  const [edges, setEdges, onEC] = react.useEdgesState(displayEdges);
1015
1101
  const rf = react.useReactFlow();
1016
- React33.useEffect(() => {
1102
+ React41.useEffect(() => {
1017
1103
  setNodes(displayNodes);
1018
1104
  }, [displayNodes, setNodes]);
1019
- React33.useEffect(() => {
1105
+ React41.useEffect(() => {
1020
1106
  setEdges(displayEdges);
1021
1107
  }, [displayEdges, setEdges]);
1022
- React33.useEffect(() => {
1108
+ React41.useEffect(() => {
1023
1109
  const id = requestAnimationFrame(() => {
1024
1110
  try {
1025
1111
  rf.fitView({ padding: 0.1 });
@@ -1028,14 +1114,14 @@ function Inner({ diagram, title, autoplay, nodeStates }) {
1028
1114
  });
1029
1115
  return () => cancelAnimationFrame(id);
1030
1116
  }, [layout, rf]);
1031
- const handleClickOutside = React33.useCallback((e) => {
1117
+ const handleClickOutside = React41.useCallback((e) => {
1032
1118
  if (containerRef.current && !containerRef.current.contains(e.target)) setFocused(false);
1033
1119
  }, []);
1034
- React33.useEffect(() => {
1120
+ React41.useEffect(() => {
1035
1121
  document.addEventListener("mousedown", handleClickOutside);
1036
1122
  return () => document.removeEventListener("mousedown", handleClickOutside);
1037
1123
  }, [handleClickOutside]);
1038
- React33.useEffect(() => {
1124
+ React41.useEffect(() => {
1039
1125
  const el = containerRef.current;
1040
1126
  if (!el) return;
1041
1127
  let raf = 0;
@@ -1194,15 +1280,15 @@ __export(PdfViewer_exports, {
1194
1280
  PdfViewer: () => PdfViewer
1195
1281
  });
1196
1282
  function PdfViewer({ url, base64, onLoadSuccess }) {
1197
- const [numPages, setNumPages] = React33.useState(0);
1198
- const [currentPage, setCurrentPage] = React33.useState(1);
1199
- const [loading, setLoading] = React33.useState(true);
1200
- const handleLoad = React33.useCallback(({ numPages: n }) => {
1283
+ const [numPages, setNumPages] = React41.useState(0);
1284
+ const [currentPage, setCurrentPage] = React41.useState(1);
1285
+ const [loading, setLoading] = React41.useState(true);
1286
+ const handleLoad = React41.useCallback(({ numPages: n }) => {
1201
1287
  setNumPages(n);
1202
1288
  setLoading(false);
1203
1289
  onLoadSuccess == null ? void 0 : onLoadSuccess(n);
1204
1290
  }, [onLoadSuccess]);
1205
- React33.useEffect(() => {
1291
+ React41.useEffect(() => {
1206
1292
  if (numPages <= 1) return;
1207
1293
  const handler = (e) => {
1208
1294
  var _a;
@@ -1298,13 +1384,13 @@ __export(ExcelViewer_exports, {
1298
1384
  ExcelViewer: () => ExcelViewer
1299
1385
  });
1300
1386
  function ExcelViewer({ url, base64, onLoadSuccess }) {
1301
- const [sheetNames, setSheetNames] = React33.useState([]);
1302
- const [activeSheet, setActiveSheet] = React33.useState(0);
1303
- const [data, setData] = React33.useState([]);
1304
- const [loading, setLoading] = React33.useState(true);
1305
- const [error, setError] = React33.useState(null);
1306
- const wbRef = React33.useRef(null);
1307
- React33.useEffect(() => {
1387
+ const [sheetNames, setSheetNames] = React41.useState([]);
1388
+ const [activeSheet, setActiveSheet] = React41.useState(0);
1389
+ const [data, setData] = React41.useState([]);
1390
+ const [loading, setLoading] = React41.useState(true);
1391
+ const [error, setError] = React41.useState(null);
1392
+ const wbRef = React41.useRef(null);
1393
+ React41.useEffect(() => {
1308
1394
  let cancelled = false;
1309
1395
  setLoading(true);
1310
1396
  setError(null);
@@ -1362,7 +1448,7 @@ function ExcelViewer({ url, base64, onLoadSuccess }) {
1362
1448
  const rows = XLSX__namespace.utils.sheet_to_json(wbRef.current.Sheets[wbRef.current.SheetNames[idx]], { header: 1 });
1363
1449
  setData(rows);
1364
1450
  };
1365
- React33.useEffect(() => {
1451
+ React41.useEffect(() => {
1366
1452
  if (sheetNames.length <= 1) return;
1367
1453
  const handler = (e) => {
1368
1454
  var _a;
@@ -1487,10 +1573,10 @@ __export(CsvViewer_exports, {
1487
1573
  });
1488
1574
  function CsvViewer({ url, base64, delimiter, maxRows }) {
1489
1575
  const { BORDER: BORDER4, MUTED: MUTED2, PAPER: PAPER2 } = useTheme();
1490
- const [rows, setRows] = React33.useState([]);
1491
- const [loading, setLoading] = React33.useState(true);
1492
- const [error, setError] = React33.useState(null);
1493
- React33.useEffect(() => {
1576
+ const [rows, setRows] = React41.useState([]);
1577
+ const [loading, setLoading] = React41.useState(true);
1578
+ const [error, setError] = React41.useState(null);
1579
+ React41.useEffect(() => {
1494
1580
  let cancelled = false;
1495
1581
  setLoading(true);
1496
1582
  setError(null);
@@ -1609,10 +1695,10 @@ __export(TextViewer_exports, {
1609
1695
  });
1610
1696
  function TextViewer({ url, base64, markdown = false, maxLines }) {
1611
1697
  const { MUTED: MUTED2 } = useTheme();
1612
- const [text, setText] = React33.useState("");
1613
- const [loading, setLoading] = React33.useState(true);
1614
- const [error, setError] = React33.useState(null);
1615
- React33.useEffect(() => {
1698
+ const [text, setText] = React41.useState("");
1699
+ const [loading, setLoading] = React41.useState(true);
1700
+ const [error, setError] = React41.useState(null);
1701
+ React41.useEffect(() => {
1616
1702
  let cancelled = false;
1617
1703
  setLoading(true);
1618
1704
  setError(null);
@@ -1710,10 +1796,10 @@ function sanitize(html) {
1710
1796
  }
1711
1797
  function DocxViewer({ url, base64 }) {
1712
1798
  const { MUTED: MUTED2, BORDER: BORDER4 } = useTheme();
1713
- const [html, setHtml] = React33.useState("");
1714
- const [loading, setLoading] = React33.useState(true);
1715
- const [error, setError] = React33.useState(null);
1716
- React33.useEffect(() => {
1799
+ const [html, setHtml] = React41.useState("");
1800
+ const [loading, setLoading] = React41.useState(true);
1801
+ const [error, setError] = React41.useState(null);
1802
+ React41.useEffect(() => {
1717
1803
  let cancelled = false;
1718
1804
  setLoading(true);
1719
1805
  setError(null);
@@ -5156,6 +5242,79 @@ var pipelinePreviewTool = {
5156
5242
  required: ["type", "name", "steps"]
5157
5243
  }
5158
5244
  };
5245
+ var workflowStepperSchema = zod.z.object({
5246
+ type: zod.z.literal("workflow-stepper"),
5247
+ id: zod.z.string().optional(),
5248
+ title: zod.z.string(),
5249
+ period: zod.z.string().optional(),
5250
+ badge: zod.z.string().optional(),
5251
+ active_step: zod.z.string().optional(),
5252
+ steps: zod.z.array(
5253
+ zod.z.object({
5254
+ id: zod.z.string(),
5255
+ n: zod.z.number().int().positive().optional(),
5256
+ title: zod.z.string(),
5257
+ sub: zod.z.string().optional(),
5258
+ status: zod.z.enum(["done", "active", "review", "pending", "failed"]),
5259
+ assignees: zod.z.array(
5260
+ zod.z.object({
5261
+ name: zod.z.string(),
5262
+ kind: zod.z.enum(["agent", "human"]),
5263
+ initials: zod.z.string().max(3).optional(),
5264
+ color: zod.z.string().optional(),
5265
+ role: zod.z.string().optional()
5266
+ })
5267
+ ).max(6).optional()
5268
+ })
5269
+ ).min(2).max(12)
5270
+ });
5271
+ var workflowStepperTool = {
5272
+ name: "render_workflow_stepper",
5273
+ description: "Render a recurring-process workflow stepper \u2014 a horizontal strip of sequential step cards (e.g. a monthly close pipeline) with per-step status (done/active/review/pending/failed) and human + agent assignee avatars. Use for org processes with named steps and owners, NOT for generic progress bars or project phase summaries.",
5274
+ input_schema: {
5275
+ type: "object",
5276
+ properties: {
5277
+ type: { type: "string", enum: ["workflow-stepper"] },
5278
+ id: { type: "string", description: "Stable id for update-in-place rendering" },
5279
+ title: { type: "string", description: "Process name, e.g. 'Monthly Close'" },
5280
+ period: { type: "string", description: "Period label, e.g. 'Period 04 \xB7 FY2026'" },
5281
+ badge: { type: "string", description: "Framework/compliance badge, e.g. 'SOX controlled'" },
5282
+ active_step: { type: "string", description: "Id of the currently active step" },
5283
+ steps: {
5284
+ type: "array",
5285
+ minItems: 2,
5286
+ maxItems: 12,
5287
+ items: {
5288
+ type: "object",
5289
+ properties: {
5290
+ id: { type: "string" },
5291
+ n: { type: "number", description: "Step number; defaults to index + 1" },
5292
+ title: { type: "string" },
5293
+ sub: { type: "string", description: "Short status caption, e.g. '7 accounts \xB7 2 exceptions'" },
5294
+ status: { type: "string", enum: ["done", "active", "review", "pending", "failed"] },
5295
+ assignees: {
5296
+ type: "array",
5297
+ maxItems: 6,
5298
+ items: {
5299
+ type: "object",
5300
+ properties: {
5301
+ name: { type: "string" },
5302
+ kind: { type: "string", enum: ["agent", "human"] },
5303
+ initials: { type: "string" },
5304
+ color: { type: "string" },
5305
+ role: { type: "string" }
5306
+ },
5307
+ required: ["name", "kind"]
5308
+ }
5309
+ }
5310
+ },
5311
+ required: ["id", "title", "status"]
5312
+ }
5313
+ }
5314
+ },
5315
+ required: ["type", "title", "steps"]
5316
+ }
5317
+ };
5159
5318
 
5160
5319
  // src/schemas/buildRenderUITool.ts
5161
5320
  function buildRenderUITool(selectedSchemas) {
@@ -5273,7 +5432,8 @@ var schemaRegistry = {
5273
5432
  "scatter-chart": { schema: scatterChartSchema, tool: scatterChartTool },
5274
5433
  "connect-integration": { schema: connectIntegrationSchema, tool: connectIntegrationTool },
5275
5434
  "integrations-list": { schema: integrationsListSchema, tool: integrationsListTool },
5276
- "pipeline-preview": { schema: pipelinePreviewSchema, tool: pipelinePreviewTool }
5435
+ "pipeline-preview": { schema: pipelinePreviewSchema, tool: pipelinePreviewTool },
5436
+ "workflow-stepper": { schema: workflowStepperSchema, tool: workflowStepperTool }
5277
5437
  };
5278
5438
 
5279
5439
  // src/shared/ColumnSettingsPanel.tsx
@@ -5325,16 +5485,16 @@ init_theme();
5325
5485
  var DOT_COLOR = "#aaaaaa";
5326
5486
  var DOT_HOVER = "#555555";
5327
5487
  function ComponentActions({ children, onDownloadCSV, columnConfig, filename = "component" }) {
5328
- const [open, setOpen] = React33.useState(false);
5329
- const [view, setView] = React33.useState("main");
5330
- const contentRef = React33.useRef(null);
5331
- const menuRef = React33.useRef(null);
5332
- const btnRef = React33.useRef(null);
5333
- const close = React33.useCallback(() => {
5488
+ const [open, setOpen] = React41.useState(false);
5489
+ const [view, setView] = React41.useState("main");
5490
+ const contentRef = React41.useRef(null);
5491
+ const menuRef = React41.useRef(null);
5492
+ const btnRef = React41.useRef(null);
5493
+ const close = React41.useCallback(() => {
5334
5494
  setOpen(false);
5335
5495
  setView("main");
5336
5496
  }, []);
5337
- React33.useEffect(() => {
5497
+ React41.useEffect(() => {
5338
5498
  if (!open) return;
5339
5499
  const handler = (e) => {
5340
5500
  var _a, _b;
@@ -5345,7 +5505,7 @@ function ComponentActions({ children, onDownloadCSV, columnConfig, filename = "c
5345
5505
  document.addEventListener("mousedown", handler);
5346
5506
  return () => document.removeEventListener("mousedown", handler);
5347
5507
  }, [open, close]);
5348
- const handleDownloadPNG = React33.useCallback(async () => {
5508
+ const handleDownloadPNG = React41.useCallback(async () => {
5349
5509
  if (!contentRef.current) return;
5350
5510
  try {
5351
5511
  const url = await htmlToImage.toPng(contentRef.current, { backgroundColor: "white", pixelRatio: 2 });
@@ -5357,7 +5517,7 @@ function ComponentActions({ children, onDownloadCSV, columnConfig, filename = "c
5357
5517
  }
5358
5518
  close();
5359
5519
  }, [filename, close]);
5360
- const handleCSV = React33.useCallback(() => {
5520
+ const handleCSV = React41.useCallback(() => {
5361
5521
  onDownloadCSV == null ? void 0 : onDownloadCSV();
5362
5522
  close();
5363
5523
  }, [onDownloadCSV, close]);
@@ -5469,12 +5629,12 @@ function MenuButton({ label, onClick }) {
5469
5629
  );
5470
5630
  }
5471
5631
  function useColumnVisibility(columns) {
5472
- const [hidden, setHidden] = React33.useState(/* @__PURE__ */ new Set());
5473
- const visibleColumns = React33.useMemo(
5632
+ const [hidden, setHidden] = React41.useState(/* @__PURE__ */ new Set());
5633
+ const visibleColumns = React41.useMemo(
5474
5634
  () => columns.filter((c) => !hidden.has(c.key)),
5475
5635
  [columns, hidden]
5476
5636
  );
5477
- const toggle = React33.useCallback((key) => {
5637
+ const toggle = React41.useCallback((key) => {
5478
5638
  setHidden((prev) => {
5479
5639
  const next = new Set(prev);
5480
5640
  if (next.has(key)) next.delete(key);
@@ -5482,8 +5642,8 @@ function useColumnVisibility(columns) {
5482
5642
  return next;
5483
5643
  });
5484
5644
  }, []);
5485
- const showAll = React33.useCallback(() => setHidden(/* @__PURE__ */ new Set()), []);
5486
- const hideAll = React33.useCallback(
5645
+ const showAll = React41.useCallback(() => setHidden(/* @__PURE__ */ new Set()), []);
5646
+ const hideAll = React41.useCallback(
5487
5647
  () => setHidden(new Set(columns.map((c) => c.key))),
5488
5648
  [columns]
5489
5649
  );
@@ -5733,6 +5893,61 @@ function AlertResolver(p) {
5733
5893
 
5734
5894
  // src/composites/stat-grid/resolver.tsx
5735
5895
  init_Markdown();
5896
+ function FitText({ children, max = 22, min = 13, title, className, style }) {
5897
+ const ref = React41.useRef(null);
5898
+ const [size, setSize] = React41.useState(max);
5899
+ React41.useLayoutEffect(() => {
5900
+ const el = ref.current;
5901
+ if (!el) return void 0;
5902
+ const fit = () => {
5903
+ let s = max;
5904
+ el.style.fontSize = `${s}px`;
5905
+ while (s > min && el.scrollWidth > el.clientWidth + 1) {
5906
+ s -= 1;
5907
+ el.style.fontSize = `${s}px`;
5908
+ }
5909
+ setSize(s);
5910
+ };
5911
+ fit();
5912
+ if (typeof ResizeObserver === "undefined") return void 0;
5913
+ const ro = new ResizeObserver(fit);
5914
+ ro.observe(el);
5915
+ return () => ro.disconnect();
5916
+ }, [children, max, min]);
5917
+ return /* @__PURE__ */ jsxRuntime.jsx(
5918
+ "span",
5919
+ {
5920
+ ref,
5921
+ title,
5922
+ className,
5923
+ style: __spreadValues({
5924
+ display: "block",
5925
+ minWidth: 0,
5926
+ maxWidth: "100%",
5927
+ whiteSpace: "nowrap",
5928
+ overflow: "hidden",
5929
+ textOverflow: "ellipsis",
5930
+ fontSize: `${size}px`
5931
+ }, style),
5932
+ children
5933
+ }
5934
+ );
5935
+ }
5936
+
5937
+ // src/shared/styles.ts
5938
+ var TRUNCATE = {
5939
+ minWidth: 0,
5940
+ overflow: "hidden",
5941
+ textOverflow: "ellipsis",
5942
+ whiteSpace: "nowrap"
5943
+ };
5944
+ var NUMERIC_CELL = {
5945
+ fontVariantNumeric: "tabular-nums",
5946
+ whiteSpace: "nowrap",
5947
+ textAlign: "right"
5948
+ };
5949
+
5950
+ // src/composites/stat-grid/resolver.tsx
5736
5951
  init_ThemeContext();
5737
5952
  var changeColor = (type) => {
5738
5953
  if (type === "positive") return "#15803d";
@@ -5743,15 +5958,28 @@ var cardStyle = {
5743
5958
  border: "1px solid #dedede",
5744
5959
  borderRadius: "0.75rem",
5745
5960
  background: "white",
5746
- padding: "14px"
5961
+ padding: "14px",
5962
+ // Let the card shrink inside the grid track so big values can't push it
5963
+ // wider than its column.
5964
+ minWidth: 0,
5965
+ overflow: "hidden"
5747
5966
  };
5748
5967
  function StatGridResolver(p) {
5749
5968
  var _a;
5750
5969
  const { MUTED: MUTED2 } = useTheme();
5751
- return /* @__PURE__ */ jsxRuntime.jsx(ComponentActions, { filename: "stat-grid", children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "100%", display: "grid", gap: "10px", gridTemplateColumns: "repeat(auto-fill, minmax(140px, 1fr))" }, children: ((_a = p.stats) != null ? _a : []).map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { style: cardStyle, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "4px", padding: "4px 0" }, children: [
5752
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "11.5px", color: MUTED2, letterSpacing: "0.02em", textTransform: "uppercase", margin: 0 }, children: stat.label }),
5753
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontFamily: "var(--font-serif)", fontSize: "22px", fontWeight: 600, color: "var(--foreground)", letterSpacing: "-0.01em", lineHeight: 1.1, fontVariantNumeric: "tabular-nums", margin: 0 }, children: stat.value }),
5754
- stat.change && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "12px", fontWeight: 500, color: changeColor(stat.changeType), fontVariantNumeric: "tabular-nums", margin: 0 }, children: stat.change }),
5970
+ return /* @__PURE__ */ jsxRuntime.jsx(ComponentActions, { filename: "stat-grid", children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "100%", display: "grid", gap: "10px", gridTemplateColumns: "repeat(auto-fill, minmax(min(140px, 100%), 1fr))" }, children: ((_a = p.stats) != null ? _a : []).map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { style: cardStyle, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "4px", padding: "4px 0", minWidth: 0 }, children: [
5971
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: __spreadValues({ fontSize: "11.5px", color: MUTED2, letterSpacing: "0.02em", textTransform: "uppercase", margin: 0 }, TRUNCATE), children: stat.label }),
5972
+ /* @__PURE__ */ jsxRuntime.jsx(
5973
+ FitText,
5974
+ {
5975
+ max: 22,
5976
+ min: 13,
5977
+ title: typeof stat.value === "string" ? stat.value : void 0,
5978
+ style: { fontFamily: "var(--font-serif)", fontWeight: 600, color: "var(--foreground)", letterSpacing: "-0.01em", lineHeight: 1.1, fontVariantNumeric: "tabular-nums" },
5979
+ children: stat.value
5980
+ }
5981
+ ),
5982
+ stat.change && /* @__PURE__ */ jsxRuntime.jsx("p", { style: __spreadValues({ fontSize: "12px", fontWeight: 500, color: changeColor(stat.changeType), fontVariantNumeric: "tabular-nums", margin: 0 }, TRUNCATE), children: stat.change }),
5755
5983
  stat.description && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "11.5px", color: "#888888", lineHeight: 1.4, margin: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(Markdown, { inline: true, content: stat.description }) })
5756
5984
  ] }) }, i)) }) });
5757
5985
  }
@@ -5760,7 +5988,7 @@ init_ThemeContext();
5760
5988
  function TabsPanelResolver(p) {
5761
5989
  var _a;
5762
5990
  const { BORDER: BORDER4, MUTED: MUTED2, PAPER: PAPER2, ACCENT: ACCENT2 } = useTheme();
5763
- const [activeIdx, setActiveIdx] = React33.useState(0);
5991
+ const [activeIdx, setActiveIdx] = React41.useState(0);
5764
5992
  const activeTab = p.tabs[activeIdx];
5765
5993
  return /* @__PURE__ */ jsxRuntime.jsx(ComponentActions, { filename: "tabs-panel", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: "0" }, children: [
5766
5994
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -5918,17 +6146,17 @@ function SparklineTableResolver(p) {
5918
6146
  // src/composites/heatmap-table/resolver.tsx
5919
6147
  init_theme();
5920
6148
  init_ThemeContext();
5921
- function heatColor(z58) {
5922
- const clamped = Math.max(-3, Math.min(3, z58));
6149
+ function heatColor(z59) {
6150
+ const clamped = Math.max(-3, Math.min(3, z59));
5923
6151
  const abs = Math.abs(clamped);
5924
6152
  const lightness = 95 - abs * 8;
5925
6153
  const hue = clamped >= 0 ? 142 : 0;
5926
6154
  return `hsl(${hue} 60% ${lightness}%)`;
5927
6155
  }
5928
- function heatTextColor(z58) {
5929
- const abs = Math.abs(z58);
5930
- if (abs > 2) return z58 >= 0 ? "#14532d" : "#7f1d1d";
5931
- if (abs > 1) return z58 >= 0 ? "#166534" : "#991b1b";
6156
+ function heatTextColor(z59) {
6157
+ const abs = Math.abs(z59);
6158
+ if (abs > 2) return z59 >= 0 ? "#14532d" : "#7f1d1d";
6159
+ if (abs > 1) return z59 >= 0 ? "#166534" : "#991b1b";
5932
6160
  return "var(--foreground)";
5933
6161
  }
5934
6162
  var th2 = {
@@ -6026,7 +6254,7 @@ var thStyle2 = {
6026
6254
  function ScreenerTableResolver(p) {
6027
6255
  var _a, _b, _c, _d, _e, _f;
6028
6256
  const { ACCENT: ACCENT2, BORDER: BORDER4, MUTED: MUTED2, PAPER: PAPER2 } = useTheme();
6029
- const [activeFilters, setActiveFilters] = React33.useState(new Set((_a = p.activeFilters) != null ? _a : []));
6257
+ const [activeFilters, setActiveFilters] = React41.useState(new Set((_a = p.activeFilters) != null ? _a : []));
6030
6258
  const { visibleColumns, hidden, toggle, showAll, hideAll, allColumns } = useColumnVisibility((_b = p.columns) != null ? _b : []);
6031
6259
  const toggleFilter = (f) => setActiveFilters((prev) => {
6032
6260
  const next = new Set(prev);
@@ -6096,7 +6324,7 @@ var th3 = {
6096
6324
  };
6097
6325
  function GroupRows({ group, columns, depth }) {
6098
6326
  var _a, _b;
6099
- const [open, setOpen] = React33.useState(true);
6327
+ const [open, setOpen] = React41.useState(true);
6100
6328
  const indent = depth * 14;
6101
6329
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6102
6330
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -6201,7 +6429,7 @@ var dotColor = {
6201
6429
  function NewsFeedResolver(p) {
6202
6430
  var _a, _b;
6203
6431
  const { ACCENT: ACCENT2, MUTED: MUTED2 } = useTheme();
6204
- const [filter, setFilter] = React33.useState(null);
6432
+ const [filter, setFilter] = React41.useState(null);
6205
6433
  const sentiments = ["positive", "neutral", "negative"].filter(
6206
6434
  (s) => {
6207
6435
  var _a2;
@@ -6243,9 +6471,9 @@ function NewsFeedResolver(p) {
6243
6471
  ] }) });
6244
6472
  }
6245
6473
  function useSeriesToggle(seriesKeys) {
6246
- const [hidden, setHidden] = React33.useState(/* @__PURE__ */ new Set());
6247
- const isVisible = React33.useCallback((key) => !hidden.has(key), [hidden]);
6248
- const toggle = React33.useCallback((key) => {
6474
+ const [hidden, setHidden] = React41.useState(/* @__PURE__ */ new Set());
6475
+ const isVisible = React41.useCallback((key) => !hidden.has(key), [hidden]);
6476
+ const toggle = React41.useCallback((key) => {
6249
6477
  setHidden((prev) => {
6250
6478
  const next = new Set(prev);
6251
6479
  if (next.has(key)) next.delete(key);
@@ -6253,7 +6481,7 @@ function useSeriesToggle(seriesKeys) {
6253
6481
  return next;
6254
6482
  });
6255
6483
  }, []);
6256
- const showAll = React33.useCallback(() => setHidden(/* @__PURE__ */ new Set()), []);
6484
+ const showAll = React41.useCallback(() => setHidden(/* @__PURE__ */ new Set()), []);
6257
6485
  return { hidden, isVisible, toggle, showAll, allKeys: seriesKeys };
6258
6486
  }
6259
6487
 
@@ -6548,7 +6776,7 @@ function WaterfallChartResolver(p) {
6548
6776
  ] }) });
6549
6777
  }
6550
6778
  init_ThemeContext();
6551
- var FlowGraph2 = React33__default.default.lazy(
6779
+ var FlowGraph2 = React41__default.default.lazy(
6552
6780
  () => Promise.resolve().then(() => (init_FlowGraph(), FlowGraph_exports)).then((m) => ({ default: m.FlowGraph }))
6553
6781
  );
6554
6782
  function FlowCanvasRenderer({
@@ -6589,7 +6817,7 @@ function FlowCanvasRenderer({
6589
6817
  overflow: "hidden",
6590
6818
  background: "#ffffff",
6591
6819
  position: "relative"
6592
- }, diagram ? {} : { height: "320px" }), children: diagram ? /* @__PURE__ */ jsxRuntime.jsx(React33.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(FlowGraph2, { diagram, title, autoplay, nodeStates }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
6820
+ }, diagram ? {} : { height: "320px" }), children: diagram ? /* @__PURE__ */ jsxRuntime.jsx(React41.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(FlowGraph2, { diagram, title, autoplay, nodeStates }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
6593
6821
  position: "absolute",
6594
6822
  inset: 0,
6595
6823
  display: "flex",
@@ -6801,7 +7029,7 @@ function TrialBalanceResolver(p) {
6801
7029
  color: balanced ? "#15803d" : "#dc2626"
6802
7030
  }, children: balanced ? "\u2713 Balanced" : "\u2717 Unbalanced" })
6803
7031
  ] }),
6804
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { overflowX: "auto", borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.05)" }, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "380px" }, children: [
7032
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { overflowX: "auto", minWidth: 0, borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.05)" }, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "380px" }, children: [
6805
7033
  /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: ["Code", "Account", "Debit", "Credit"].map((h, i) => /* @__PURE__ */ jsxRuntime.jsx("th", { style: {
6806
7034
  fontSize: "11px",
6807
7035
  fontWeight: 500,
@@ -6822,7 +7050,7 @@ function TrialBalanceResolver(p) {
6822
7050
  gDebit += a.debit;
6823
7051
  gCredit += a.credit;
6824
7052
  });
6825
- return /* @__PURE__ */ jsxRuntime.jsxs(React33__default.default.Fragment, { children: [
7053
+ return /* @__PURE__ */ jsxRuntime.jsxs(React41__default.default.Fragment, { children: [
6826
7054
  /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 4, style: {
6827
7055
  padding: "8px 12px",
6828
7056
  fontSize: "12px",
@@ -6979,7 +7207,7 @@ function AgingReportResolver(p) {
6979
7207
  p.asOfDate
6980
7208
  ] })
6981
7209
  ] }),
6982
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { overflowX: "auto", borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.04)" }, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
7210
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { overflowX: "auto", minWidth: 0, borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.04)" }, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
6983
7211
  /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
6984
7212
  /* @__PURE__ */ jsxRuntime.jsx("th", { style: { fontSize: "11px", fontWeight: 500, color: MUTED2, padding: "8px 12px", textAlign: "left", borderBottom: `1px solid ${BORDER4}`, background: PAPER2, textTransform: "uppercase", letterSpacing: "0.02em" }, children: "Entity" }),
6985
7213
  buckets.map((b, i) => /* @__PURE__ */ jsxRuntime.jsx("th", { style: { fontSize: "11px", fontWeight: 500, color: MUTED2, padding: "8px 12px", textAlign: "right", borderBottom: `1px solid ${BORDER4}`, background: PAPER2, textTransform: "uppercase", letterSpacing: "0.02em", whiteSpace: "nowrap" }, children: b }, i)),
@@ -7036,7 +7264,7 @@ function VarianceAnalysisResolver(p) {
7036
7264
  p.title && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontFamily: "var(--font-serif)", fontSize: "15px", fontWeight: 600, color: "var(--foreground)", letterSpacing: "-0.005em" }, children: p.title }),
7037
7265
  p.period && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: MUTED2 }, children: p.period })
7038
7266
  ] }),
7039
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { overflowX: "auto", borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.05)" }, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "480px" }, children: [
7267
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { overflowX: "auto", minWidth: 0, borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.05)" }, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "480px" }, children: [
7040
7268
  /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: ["Line Item", "Budget", "Actual", "Variance $", "Variance %", ""].map((h, i) => /* @__PURE__ */ jsxRuntime.jsx("th", { style: {
7041
7269
  fontSize: "11px",
7042
7270
  fontWeight: 500,
@@ -7154,6 +7382,8 @@ function StackedBreakdownResolver(p) {
7154
7382
  alignItems: "center",
7155
7383
  gap: "6px",
7156
7384
  fontSize: "12px",
7385
+ maxWidth: "100%",
7386
+ minWidth: 0,
7157
7387
  color: isVisible(cat.name) ? MUTED2 : "#b3b3b3",
7158
7388
  cursor: "pointer",
7159
7389
  userSelect: "none",
@@ -7165,12 +7395,13 @@ function StackedBreakdownResolver(p) {
7165
7395
  width: "10px",
7166
7396
  height: "10px",
7167
7397
  borderRadius: "2px",
7398
+ flexShrink: 0,
7168
7399
  background: (_a2 = cat.color) != null ? _a2 : PALETTE2[ci % PALETTE2.length],
7169
7400
  display: "inline-block",
7170
7401
  opacity: isVisible(cat.name) ? 1 : 0.3,
7171
7402
  transition: "opacity 0.15s"
7172
7403
  } }),
7173
- cat.name
7404
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: TRUNCATE, title: cat.name, children: cat.name })
7174
7405
  ]
7175
7406
  },
7176
7407
  cat.name
@@ -7192,7 +7423,7 @@ function StackedBreakdownResolver(p) {
7192
7423
  ((_b2 = p.periods) != null ? _b2 : []).map((_, pi) => {
7193
7424
  var _a3, _b3;
7194
7425
  const v = pi < ((_a3 = cat.values) != null ? _a3 : []).length ? ((_b3 = cat.values) != null ? _b3 : [])[pi] : 0;
7195
- return /* @__PURE__ */ jsxRuntime.jsx("td", { style: { padding: "6px 12px", fontSize: "13px", textAlign: "right", fontVariantNumeric: "tabular-nums", borderBottom: `1px solid #f2f2f2`, color: v < 0 ? "#dc2626" : void 0 }, children: v < 0 ? `(${fmt5(Math.abs(v), p.currency)})` : fmt5(v, p.currency) }, pi);
7426
+ return /* @__PURE__ */ jsxRuntime.jsx("td", { style: { padding: "6px 12px", fontSize: "13px", textAlign: "right", fontVariantNumeric: "tabular-nums", whiteSpace: "nowrap", borderBottom: `1px solid #f2f2f2`, color: v < 0 ? "#dc2626" : void 0 }, children: v < 0 ? `(${fmt5(Math.abs(v), p.currency)})` : fmt5(v, p.currency) }, pi);
7196
7427
  })
7197
7428
  ] }, cat.name);
7198
7429
  }),
@@ -7356,7 +7587,7 @@ function ItemRow({ item }) {
7356
7587
  ] });
7357
7588
  }
7358
7589
  function Section({ section }) {
7359
- const [open, setOpen] = React33.useState(true);
7590
+ const [open, setOpen] = React41.useState(true);
7360
7591
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
7361
7592
  /* @__PURE__ */ jsxRuntime.jsxs(
7362
7593
  "button",
@@ -7478,7 +7709,7 @@ function ReconciliationViewResolver(p) {
7478
7709
  const { BORDER: BORDER4, MUTED: MUTED2, PAPER: PAPER2, ACCENT: ACCENT2 } = useTheme();
7479
7710
  const sourceA = (_a = p.sourceA) != null ? _a : { label: "Source A" };
7480
7711
  const sourceB = (_b = p.sourceB) != null ? _b : { label: "Source B" };
7481
- const [activeTab, setActiveTab] = React33.useState("matched");
7712
+ const [activeTab, setActiveTab] = React41.useState("matched");
7482
7713
  const balanceA = (_d = (_c = p.summary) == null ? void 0 : _c.balanceA) != null ? _d : 0;
7483
7714
  const balanceB = (_f = (_e = p.summary) == null ? void 0 : _e.balanceB) != null ? _f : 0;
7484
7715
  const difference = (_h = (_g = p.summary) == null ? void 0 : _g.difference) != null ? _h : balanceA - balanceB;
@@ -7565,7 +7796,7 @@ function ReconciliationViewResolver(p) {
7565
7796
  {
7566
7797
  style: {
7567
7798
  display: "grid",
7568
- gridTemplateColumns: "repeat(auto-fit, minmax(90px, 1fr))",
7799
+ gridTemplateColumns: "repeat(auto-fit, minmax(min(120px, 100%), 1fr))",
7569
7800
  gap: "0",
7570
7801
  marginBottom: "14px",
7571
7802
  borderRadius: "10px",
@@ -7573,31 +7804,28 @@ function ReconciliationViewResolver(p) {
7573
7804
  overflow: "hidden"
7574
7805
  },
7575
7806
  children: [
7576
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "10px 12px", background: PAPER2 }, children: [
7807
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "10px 12px", background: PAPER2, minWidth: 0 }, children: [
7577
7808
  /* @__PURE__ */ jsxRuntime.jsx(
7578
7809
  "div",
7579
7810
  {
7580
- style: {
7811
+ style: __spreadValues({
7581
7812
  fontSize: "10px",
7582
7813
  fontWeight: 500,
7583
7814
  color: MUTED2,
7584
7815
  textTransform: "uppercase",
7585
7816
  letterSpacing: "0.04em",
7586
7817
  marginBottom: "4px"
7587
- },
7818
+ }, TRUNCATE),
7588
7819
  children: sourceA.label
7589
7820
  }
7590
7821
  ),
7591
7822
  /* @__PURE__ */ jsxRuntime.jsx(
7592
- "div",
7823
+ FitText,
7593
7824
  {
7594
- style: {
7595
- fontSize: "15px",
7596
- fontWeight: 600,
7597
- color: "var(--foreground)",
7598
- fontVariantNumeric: "tabular-nums",
7599
- letterSpacing: "-0.01em"
7600
- },
7825
+ max: 15,
7826
+ min: 11,
7827
+ title: fmt6(balanceA, p.currency),
7828
+ style: { fontWeight: 600, color: "var(--foreground)", fontVariantNumeric: "tabular-nums", letterSpacing: "-0.01em" },
7601
7829
  children: fmt6(balanceA, p.currency)
7602
7830
  }
7603
7831
  )
@@ -7609,33 +7837,31 @@ function ReconciliationViewResolver(p) {
7609
7837
  padding: "10px 12px",
7610
7838
  background: PAPER2,
7611
7839
  borderLeft: `1px solid ${BORDER4}`,
7612
- borderRight: `1px solid ${BORDER4}`
7840
+ borderRight: `1px solid ${BORDER4}`,
7841
+ minWidth: 0
7613
7842
  },
7614
7843
  children: [
7615
7844
  /* @__PURE__ */ jsxRuntime.jsx(
7616
7845
  "div",
7617
7846
  {
7618
- style: {
7847
+ style: __spreadValues({
7619
7848
  fontSize: "10px",
7620
7849
  fontWeight: 500,
7621
7850
  color: MUTED2,
7622
7851
  textTransform: "uppercase",
7623
7852
  letterSpacing: "0.04em",
7624
7853
  marginBottom: "4px"
7625
- },
7854
+ }, TRUNCATE),
7626
7855
  children: sourceB.label
7627
7856
  }
7628
7857
  ),
7629
7858
  /* @__PURE__ */ jsxRuntime.jsx(
7630
- "div",
7859
+ FitText,
7631
7860
  {
7632
- style: {
7633
- fontSize: "15px",
7634
- fontWeight: 600,
7635
- color: "var(--foreground)",
7636
- fontVariantNumeric: "tabular-nums",
7637
- letterSpacing: "-0.01em"
7638
- },
7861
+ max: 15,
7862
+ min: 11,
7863
+ title: fmt6(balanceB, p.currency),
7864
+ style: { fontWeight: 600, color: "var(--foreground)", fontVariantNumeric: "tabular-nums", letterSpacing: "-0.01em" },
7639
7865
  children: fmt6(balanceB, p.currency)
7640
7866
  }
7641
7867
  )
@@ -7647,7 +7873,8 @@ function ReconciliationViewResolver(p) {
7647
7873
  {
7648
7874
  style: {
7649
7875
  padding: "10px 12px",
7650
- background: difference === 0 ? "#f0fdf4" : "#fef2f2"
7876
+ background: difference === 0 ? "#f0fdf4" : "#fef2f2",
7877
+ minWidth: 0
7651
7878
  },
7652
7879
  children: [
7653
7880
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -7687,15 +7914,12 @@ function ReconciliationViewResolver(p) {
7687
7914
  }
7688
7915
  ),
7689
7916
  /* @__PURE__ */ jsxRuntime.jsx(
7690
- "div",
7917
+ FitText,
7691
7918
  {
7692
- style: {
7693
- fontSize: "15px",
7694
- fontWeight: 700,
7695
- color: difference === 0 ? MATCH_GREEN : DIFF_RED,
7696
- fontVariantNumeric: "tabular-nums",
7697
- letterSpacing: "-0.01em"
7698
- },
7919
+ max: 15,
7920
+ min: 11,
7921
+ title: fmt6(difference, p.currency),
7922
+ style: { fontWeight: 700, color: difference === 0 ? MATCH_GREEN : DIFF_RED, fontVariantNumeric: "tabular-nums", letterSpacing: "-0.01em" },
7699
7923
  children: fmt6(difference, p.currency)
7700
7924
  }
7701
7925
  )
@@ -8128,7 +8352,7 @@ function ChangesView({ changes }) {
8128
8352
  }
8129
8353
  function EventCard({ event }) {
8130
8354
  var _a;
8131
- const [showChanges, setShowChanges] = React33.useState(false);
8355
+ const [showChanges, setShowChanges] = React41.useState(false);
8132
8356
  const ac = (_a = actionConfig[event.action]) != null ? _a : actionConfig.commented;
8133
8357
  const hasChanges = event.changes && event.changes.length > 0;
8134
8358
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "12px", position: "relative" }, children: [
@@ -8186,23 +8410,23 @@ function AuditTrailResolver(p) {
8186
8410
  }
8187
8411
  init_Markdown();
8188
8412
  function useFullscreen(ref) {
8189
- const [isFullscreen, setIsFullscreen] = React33.useState(false);
8190
- React33.useEffect(() => {
8413
+ const [isFullscreen, setIsFullscreen] = React41.useState(false);
8414
+ React41.useEffect(() => {
8191
8415
  const handler = () => {
8192
8416
  setIsFullscreen(!!document.fullscreenElement);
8193
8417
  };
8194
8418
  document.addEventListener("fullscreenchange", handler);
8195
8419
  return () => document.removeEventListener("fullscreenchange", handler);
8196
8420
  }, []);
8197
- const enter = React33.useCallback(() => {
8421
+ const enter = React41.useCallback(() => {
8198
8422
  var _a, _b;
8199
8423
  (_b = (_a = ref.current) == null ? void 0 : _a.requestFullscreen) == null ? void 0 : _b.call(_a);
8200
8424
  }, [ref]);
8201
- const exit = React33.useCallback(() => {
8425
+ const exit = React41.useCallback(() => {
8202
8426
  var _a;
8203
8427
  if (document.fullscreenElement) (_a = document.exitFullscreen) == null ? void 0 : _a.call(document);
8204
8428
  }, []);
8205
- const toggle = React33.useCallback(() => {
8429
+ const toggle = React41.useCallback(() => {
8206
8430
  if (isFullscreen) exit();
8207
8431
  else enter();
8208
8432
  }, [isFullscreen, enter, exit]);
@@ -8212,10 +8436,10 @@ function useFullscreen(ref) {
8212
8436
  // src/composites/document-preview/resolver.tsx
8213
8437
  init_theme();
8214
8438
  init_ThemeContext();
8215
- var PdfViewer2 = React33__default.default.lazy(
8439
+ var PdfViewer2 = React41__default.default.lazy(
8216
8440
  () => Promise.resolve().then(() => (init_PdfViewer(), PdfViewer_exports)).then((m) => ({ default: m.PdfViewer }))
8217
8441
  );
8218
- var ExcelViewer2 = React33__default.default.lazy(
8442
+ var ExcelViewer2 = React41__default.default.lazy(
8219
8443
  () => Promise.resolve().then(() => (init_ExcelViewer(), ExcelViewer_exports)).then((m) => ({ default: m.ExcelViewer }))
8220
8444
  );
8221
8445
  var highlightColors = {
@@ -8265,8 +8489,8 @@ function DownloadIcon() {
8265
8489
  function DocumentPreviewResolver(p) {
8266
8490
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
8267
8491
  const { BORDER: BORDER4, MUTED: MUTED2, PAPER: PAPER2, ACCENT: ACCENT2 } = useTheme();
8268
- const [currentPage, setCurrentPage] = React33.useState(0);
8269
- const containerRef = React33.useRef(null);
8492
+ const [currentPage, setCurrentPage] = React41.useState(0);
8493
+ const containerRef = React41.useRef(null);
8270
8494
  const { isFullscreen, toggle } = useFullscreen(containerRef);
8271
8495
  const hasRealFile = !!(((_a = p.source) == null ? void 0 : _a.url) || ((_b = p.source) == null ? void 0 : _b.base64));
8272
8496
  const isPdf = p.documentType === "pdf";
@@ -8274,9 +8498,9 @@ function DocumentPreviewResolver(p) {
8274
8498
  const totalPages = ((_c = p.pages) != null ? _c : []).length;
8275
8499
  const page = p.pages[currentPage];
8276
8500
  const pageHighlights = ((_d = p.highlights) != null ? _d : []).filter((h) => h.pageIndex === currentPage);
8277
- const handlePdfLoad = React33.useCallback(() => {
8501
+ const handlePdfLoad = React41.useCallback(() => {
8278
8502
  }, []);
8279
- const handleExcelLoad = React33.useCallback(() => {
8503
+ const handleExcelLoad = React41.useCallback(() => {
8280
8504
  }, []);
8281
8505
  return /* @__PURE__ */ jsxRuntime.jsx(ComponentActions, { filename: (_e = p.title) != null ? _e : "document-preview", children: /* @__PURE__ */ jsxRuntime.jsxs(
8282
8506
  "div",
@@ -8389,7 +8613,7 @@ function DocumentPreviewResolver(p) {
8389
8613
  display: "flex",
8390
8614
  flexDirection: "column"
8391
8615
  }, children: [
8392
- hasRealFile && isPdf ? /* @__PURE__ */ jsxRuntime.jsx(React33.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(PdfViewer2, { url: (_q = p.source) == null ? void 0 : _q.url, base64: (_r = p.source) == null ? void 0 : _r.base64, onLoadSuccess: handlePdfLoad }) }) : hasRealFile && isExcel ? /* @__PURE__ */ jsxRuntime.jsx(React33.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(ExcelViewer2, { url: (_s = p.source) == null ? void 0 : _s.url, base64: (_t = p.source) == null ? void 0 : _t.base64, onLoadSuccess: handleExcelLoad }) }) : (page == null ? void 0 : page.imageUrl) ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: page.imageUrl, alt: page.label, style: { maxWidth: "100%", borderRadius: "4px" } }) }) : (page == null ? void 0 : page.content) ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontFamily: "var(--font-sans, system-ui)", fontSize: "13px", color: "var(--foreground)", lineHeight: 1.6, margin: 0, padding: "20px" }, children: /* @__PURE__ */ jsxRuntime.jsx(Markdown, { content: page.content }) }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: "120px", color: MUTED2, fontSize: "13px" }, children: [
8616
+ hasRealFile && isPdf ? /* @__PURE__ */ jsxRuntime.jsx(React41.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(PdfViewer2, { url: (_q = p.source) == null ? void 0 : _q.url, base64: (_r = p.source) == null ? void 0 : _r.base64, onLoadSuccess: handlePdfLoad }) }) : hasRealFile && isExcel ? /* @__PURE__ */ jsxRuntime.jsx(React41.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(ExcelViewer2, { url: (_s = p.source) == null ? void 0 : _s.url, base64: (_t = p.source) == null ? void 0 : _t.base64, onLoadSuccess: handleExcelLoad }) }) : (page == null ? void 0 : page.imageUrl) ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: page.imageUrl, alt: page.label, style: { maxWidth: "100%", borderRadius: "4px" } }) }) : (page == null ? void 0 : page.content) ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontFamily: "var(--font-sans, system-ui)", fontSize: "13px", color: "var(--foreground)", lineHeight: 1.6, margin: 0, padding: "20px" }, children: /* @__PURE__ */ jsxRuntime.jsx(Markdown, { content: page.content }) }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: "120px", color: MUTED2, fontSize: "13px" }, children: [
8393
8617
  "No content available for ",
8394
8618
  (_u = page == null ? void 0 : page.label) != null ? _u : "this page"
8395
8619
  ] }),
@@ -8452,7 +8676,7 @@ function ConfidenceBar({ confidence, height = 6 }) {
8452
8676
  }
8453
8677
  function StepCard({ step, isLast }) {
8454
8678
  var _a;
8455
- const [expanded, setExpanded] = React33.useState(false);
8679
+ const [expanded, setExpanded] = React41.useState(false);
8456
8680
  const cfg = stepTypeConfig[step.stepType];
8457
8681
  const detail = (_a = step.detail) != null ? _a : "";
8458
8682
  const isLong = detail.length > 100;
@@ -8957,7 +9181,7 @@ function ExampleRow({ example }) {
8957
9181
  );
8958
9182
  }
8959
9183
  function PartSection({ part, defaultOpen }) {
8960
- const [open, setOpen] = React33.useState(defaultOpen);
9184
+ const [open, setOpen] = React41.useState(defaultOpen);
8961
9185
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
8962
9186
  /* @__PURE__ */ jsxRuntime.jsxs(
8963
9187
  "button",
@@ -9087,7 +9311,7 @@ function EngagementPipelineResolver(p) {
9087
9311
  const defaultActive = phases.findIndex(
9088
9312
  (ph) => ph.status === "in-progress" || ph.status === "blocked"
9089
9313
  );
9090
- const [activeIdx, setActiveIdx] = React33.useState(defaultActive >= 0 ? defaultActive : 0);
9314
+ const [activeIdx, setActiveIdx] = React41.useState(defaultActive >= 0 ? defaultActive : 0);
9091
9315
  const activePhase = phases[activeIdx];
9092
9316
  return /* @__PURE__ */ jsxRuntime.jsx(ComponentActions, { filename: (_b = p.title) != null ? _b : "engagement-pipeline", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: "12px" }, children: [
9093
9317
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
@@ -9171,7 +9395,7 @@ function EngagementPipelineResolver(p) {
9171
9395
  const color = (_a2 = statusColor2[phase.status]) != null ? _a2 : "#d6d3d1";
9172
9396
  const isCurrent = i === activeIdx;
9173
9397
  const size = isCurrent ? 28 : 20;
9174
- return /* @__PURE__ */ jsxRuntime.jsxs(React33__default.default.Fragment, { children: [
9398
+ return /* @__PURE__ */ jsxRuntime.jsxs(React41__default.default.Fragment, { children: [
9175
9399
  i > 0 && /* @__PURE__ */ jsxRuntime.jsx(
9176
9400
  "div",
9177
9401
  {
@@ -9478,7 +9702,7 @@ function Avatar({ name, avatar, hovered }) {
9478
9702
  function EntityCardGridResolver(p) {
9479
9703
  var _a, _b;
9480
9704
  const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2 } = useTheme();
9481
- const [hoveredId, setHoveredId] = React33.useState(null);
9705
+ const [hoveredId, setHoveredId] = React41.useState(null);
9482
9706
  return /* @__PURE__ */ jsxRuntime.jsx(ComponentActions, { filename: (_a = p.title) != null ? _a : "entity-card-grid", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: "10px" }, children: [
9483
9707
  p.title && /* @__PURE__ */ jsxRuntime.jsx(
9484
9708
  "p",
@@ -9499,7 +9723,7 @@ function EntityCardGridResolver(p) {
9499
9723
  {
9500
9724
  style: {
9501
9725
  display: "grid",
9502
- gridTemplateColumns: `repeat(auto-fit, minmax(220px, 1fr))`,
9726
+ gridTemplateColumns: `repeat(auto-fit, minmax(min(220px, 100%), 1fr))`,
9503
9727
  gap: "12px",
9504
9728
  width: "100%"
9505
9729
  },
@@ -9590,7 +9814,7 @@ function EntityCardGridResolver(p) {
9590
9814
  {
9591
9815
  style: {
9592
9816
  display: "grid",
9593
- gridTemplateColumns: item.fields.length > 2 ? "repeat(auto-fit, minmax(90px, 1fr))" : "1fr",
9817
+ gridTemplateColumns: item.fields.length > 2 ? "repeat(auto-fit, minmax(min(90px, 100%), 1fr))" : "1fr",
9594
9818
  gap: "6px 12px",
9595
9819
  borderTop: `1px solid ${BORDER4}`,
9596
9820
  paddingTop: "8px"
@@ -9734,7 +9958,7 @@ function StepRow({ step }) {
9734
9958
  function JobTrackerResolver(p) {
9735
9959
  var _a, _b, _c, _d, _e, _f, _g;
9736
9960
  const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2, PAPER: PAPER2 } = useTheme();
9737
- const [stepsOpen, setStepsOpen] = React33.useState(true);
9961
+ const [stepsOpen, setStepsOpen] = React41.useState(true);
9738
9962
  const barColor = (_a = statusColors2[p.status]) != null ? _a : MUTED2;
9739
9963
  const badge = (_b = statusBadgeConfig[p.status]) != null ? _b : statusBadgeConfig.queued;
9740
9964
  const progress = (_c = p.progress) != null ? _c : p.status === "completed" ? 100 : 0;
@@ -10174,7 +10398,7 @@ function CitationCard({
10174
10398
  );
10175
10399
  }
10176
10400
  function FollowUpItem({ text }) {
10177
- const [hovered, setHovered] = React33.useState(false);
10401
+ const [hovered, setHovered] = React41.useState(false);
10178
10402
  return /* @__PURE__ */ jsxRuntime.jsxs(
10179
10403
  "span",
10180
10404
  {
@@ -10199,7 +10423,7 @@ function CitationMarker({
10199
10423
  index,
10200
10424
  onClick
10201
10425
  }) {
10202
- const [hovered, setHovered] = React33.useState(false);
10426
+ const [hovered, setHovered] = React41.useState(false);
10203
10427
  return /* @__PURE__ */ jsxRuntime.jsx(
10204
10428
  "sup",
10205
10429
  {
@@ -10228,7 +10452,7 @@ function CitationMarker({
10228
10452
  function CitedAnswerResolver(p) {
10229
10453
  var _a, _b, _c, _d, _e;
10230
10454
  const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2, SECONDARY: SECONDARY2 } = useTheme();
10231
- const [expandedIds, setExpandedIds] = React33.useState(/* @__PURE__ */ new Set());
10455
+ const [expandedIds, setExpandedIds] = React41.useState(/* @__PURE__ */ new Set());
10232
10456
  const toggleCitation = (id) => {
10233
10457
  setExpandedIds((prev) => {
10234
10458
  const next = new Set(prev);
@@ -10532,7 +10756,7 @@ function TransactionFeedResolver(p) {
10532
10756
  var _a, _b, _c, _d, _e;
10533
10757
  const { BORDER: BORDER4, MUTED: MUTED2 } = useTheme();
10534
10758
  const currency = (_a = p.currency) != null ? _a : "USD";
10535
- const [hoveredIndex, setHoveredIndex] = React33.useState(null);
10759
+ const [hoveredIndex, setHoveredIndex] = React41.useState(null);
10536
10760
  const hasBalance = ((_b = p.transactions) != null ? _b : []).some((tx) => tx.balance != null);
10537
10761
  const totalInflows = p.transactions.filter((tx) => tx.amount > 0 && tx.status !== "reversed").reduce((sum, tx) => sum + tx.amount, 0);
10538
10762
  const totalOutflows = p.transactions.filter((tx) => tx.amount < 0 && tx.status !== "reversed").reduce((sum, tx) => sum + tx.amount, 0);
@@ -10689,7 +10913,7 @@ function formatDate2(dateStr) {
10689
10913
  }
10690
10914
  function FileRow({ item }) {
10691
10915
  var _a;
10692
- const [hovered, setHovered] = React33.useState(false);
10916
+ const [hovered, setHovered] = React41.useState(false);
10693
10917
  const cfg = getDocConfig(item.docType);
10694
10918
  return /* @__PURE__ */ jsxRuntime.jsxs(
10695
10919
  "div",
@@ -10765,8 +10989,8 @@ function FileRow({ item }) {
10765
10989
  );
10766
10990
  }
10767
10991
  function GroupSection({ groupName, items }) {
10768
- const [open, setOpen] = React33.useState(true);
10769
- const [headerHovered, setHeaderHovered] = React33.useState(false);
10992
+ const [open, setOpen] = React41.useState(true);
10993
+ const [headerHovered, setHeaderHovered] = React41.useState(false);
10770
10994
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10771
10995
  /* @__PURE__ */ jsxRuntime.jsxs(
10772
10996
  "button",
@@ -10955,15 +11179,15 @@ function isExpirySoon(expiresAt) {
10955
11179
 
10956
11180
  // src/shared/viewers/PreviewHost.tsx
10957
11181
  init_ThemeContext();
10958
- var PdfViewer3 = React33.lazy(
11182
+ var PdfViewer3 = React41.lazy(
10959
11183
  () => Promise.resolve().then(() => (init_PdfViewer(), PdfViewer_exports)).then((m) => ({ default: m.PdfViewer }))
10960
11184
  );
10961
- var ExcelViewer3 = React33.lazy(
11185
+ var ExcelViewer3 = React41.lazy(
10962
11186
  () => Promise.resolve().then(() => (init_ExcelViewer(), ExcelViewer_exports)).then((m) => ({ default: m.ExcelViewer }))
10963
11187
  );
10964
- var CsvViewer2 = React33.lazy(() => Promise.resolve().then(() => (init_CsvViewer(), CsvViewer_exports)).then((m) => ({ default: m.CsvViewer })));
10965
- var TextViewer2 = React33.lazy(() => Promise.resolve().then(() => (init_TextViewer(), TextViewer_exports)).then((m) => ({ default: m.TextViewer })));
10966
- var DocxViewer2 = React33.lazy(() => Promise.resolve().then(() => (init_DocxViewer(), DocxViewer_exports)).then((m) => ({ default: m.DocxViewer })));
11188
+ var CsvViewer2 = React41.lazy(() => Promise.resolve().then(() => (init_CsvViewer(), CsvViewer_exports)).then((m) => ({ default: m.CsvViewer })));
11189
+ var TextViewer2 = React41.lazy(() => Promise.resolve().then(() => (init_TextViewer(), TextViewer_exports)).then((m) => ({ default: m.TextViewer })));
11190
+ var DocxViewer2 = React41.lazy(() => Promise.resolve().then(() => (init_DocxViewer(), DocxViewer_exports)).then((m) => ({ default: m.DocxViewer })));
10967
11191
  var PEEK_ROWS = 20;
10968
11192
  var PEEK_LINES = 40;
10969
11193
  function PreviewHost({ kind, source, mode = "full" }) {
@@ -10993,7 +11217,7 @@ function PreviewHost({ kind, source, mode = "full" }) {
10993
11217
  default:
10994
11218
  return null;
10995
11219
  }
10996
- return /* @__PURE__ */ jsxRuntime.jsx(React33.Suspense, { fallback, children: viewer });
11220
+ return /* @__PURE__ */ jsxRuntime.jsx(React41.Suspense, { fallback, children: viewer });
10997
11221
  }
10998
11222
 
10999
11223
  // src/shared/PreviewModal.tsx
@@ -11009,7 +11233,7 @@ function PreviewModal({
11009
11233
  onDownload
11010
11234
  }) {
11011
11235
  const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2 } = useTheme();
11012
- React33.useEffect(() => {
11236
+ React41.useEffect(() => {
11013
11237
  if (!open) return;
11014
11238
  const onKey = (e) => {
11015
11239
  if (e.key === "Escape") onClose();
@@ -11182,17 +11406,17 @@ function FileCard({
11182
11406
  previewDisabled = false
11183
11407
  }) {
11184
11408
  const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2 } = useTheme();
11185
- const [cardHover, setCardHover] = React33.useState(false);
11186
- const [btnHover, setBtnHover] = React33.useState(false);
11187
- const [pvHover, setPvHover] = React33.useState(false);
11409
+ const [cardHover, setCardHover] = React41.useState(false);
11410
+ const [btnHover, setBtnHover] = React41.useState(false);
11411
+ const [pvHover, setPvHover] = React41.useState(false);
11188
11412
  const previewKind = previewKindFor(fileType, filename);
11189
11413
  const canPreview = !previewDisabled && previewKind !== null && (!!previewUrl || !!fetchPreviewBlob);
11190
- const [peekOpen, setPeekOpen] = React33.useState(false);
11191
- const [modalOpen, setModalOpen] = React33.useState(false);
11192
- const [source, setSource] = React33.useState(previewUrl ? { url: previewUrl } : null);
11193
- const [pvLoading, setPvLoading] = React33.useState(false);
11194
- const [pvError, setPvError] = React33.useState(null);
11195
- const ensureSource = React33.useCallback(async () => {
11414
+ const [peekOpen, setPeekOpen] = React41.useState(false);
11415
+ const [modalOpen, setModalOpen] = React41.useState(false);
11416
+ const [source, setSource] = React41.useState(previewUrl ? { url: previewUrl } : null);
11417
+ const [pvLoading, setPvLoading] = React41.useState(false);
11418
+ const [pvError, setPvError] = React41.useState(null);
11419
+ const ensureSource = React41.useCallback(async () => {
11196
11420
  if (source) return source;
11197
11421
  if (previewUrl) {
11198
11422
  const s = { url: previewUrl };
@@ -11214,7 +11438,7 @@ function FileCard({
11214
11438
  setPvLoading(false);
11215
11439
  }
11216
11440
  }, [source, previewUrl, fetchPreviewBlob]);
11217
- const togglePeek = React33.useCallback(async () => {
11441
+ const togglePeek = React41.useCallback(async () => {
11218
11442
  if (peekOpen) {
11219
11443
  setPeekOpen(false);
11220
11444
  return;
@@ -11222,7 +11446,7 @@ function FileCard({
11222
11446
  setPeekOpen(true);
11223
11447
  await ensureSource();
11224
11448
  }, [peekOpen, ensureSource]);
11225
- const openModal = React33.useCallback(async () => {
11449
+ const openModal = React41.useCallback(async () => {
11226
11450
  const s = await ensureSource();
11227
11451
  if (s) setModalOpen(true);
11228
11452
  }, [ensureSource]);
@@ -11337,7 +11561,7 @@ function FileCard({
11337
11561
  whiteSpace: "nowrap"
11338
11562
  },
11339
11563
  children: [
11340
- metaTokens.map((t, i) => /* @__PURE__ */ jsxRuntime.jsxs(React33__default.default.Fragment, { children: [
11564
+ metaTokens.map((t, i) => /* @__PURE__ */ jsxRuntime.jsxs(React41__default.default.Fragment, { children: [
11341
11565
  i > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#c4c4c4" }, children: "\xB7" }),
11342
11566
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: t })
11343
11567
  ] }, i)),
@@ -11681,7 +11905,7 @@ function ServiceCard({ item, isHovered, onHover, onLeave: onLeave2 }) {
11681
11905
  function OpsDashboardResolver(p) {
11682
11906
  var _a, _b, _c;
11683
11907
  const { BORDER: BORDER4, MUTED: MUTED2 } = useTheme();
11684
- const [hoveredId, setHoveredId] = React33.useState(null);
11908
+ const [hoveredId, setHoveredId] = React41.useState(null);
11685
11909
  const hasRunning = ((_a = p.items) != null ? _a : []).some((item) => item.state === "running");
11686
11910
  return /* @__PURE__ */ jsxRuntime.jsxs(ComponentActions, { filename: (_b = p.title) != null ? _b : "ops-dashboard", children: [
11687
11911
  hasRunning && /* @__PURE__ */ jsxRuntime.jsx("style", { children: PULSE_KEYFRAMES }),
@@ -11734,8 +11958,8 @@ function formatDate3(value) {
11734
11958
  }
11735
11959
  }
11736
11960
  function CopyButton({ value, rowHovered }) {
11737
- const [copied, setCopied] = React33.useState(false);
11738
- const [btnHovered, setBtnHovered] = React33.useState(false);
11961
+ const [copied, setCopied] = React41.useState(false);
11962
+ const [btnHovered, setBtnHovered] = React41.useState(false);
11739
11963
  const handleCopy = () => {
11740
11964
  navigator.clipboard.writeText(value).then(() => {
11741
11965
  setCopied(true);
@@ -11821,13 +12045,13 @@ function ValueCell({ item }) {
11821
12045
  )
11822
12046
  ] });
11823
12047
  case "currency":
11824
- return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "13px", fontWeight: 600, fontVariantNumeric: "tabular-nums", marginLeft: "auto" }, children: item.value });
12048
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { title: item.value, style: __spreadValues({ fontSize: "13px", fontWeight: 600, fontVariantNumeric: "tabular-nums", marginLeft: "auto" }, TRUNCATE), children: item.value });
11825
12049
  default:
11826
- return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "13px", color: "var(--foreground)" }, children: /* @__PURE__ */ jsxRuntime.jsx(Markdown, { inline: true, content: item.value }) });
12050
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "13px", color: "var(--foreground)", minWidth: 0, overflowWrap: "anywhere" }, children: /* @__PURE__ */ jsxRuntime.jsx(Markdown, { inline: true, content: item.value }) });
11827
12051
  }
11828
12052
  }
11829
12053
  function KVRow({ item, isLast, index }) {
11830
- const [hovered, setHovered] = React33.useState(false);
12054
+ const [hovered, setHovered] = React41.useState(false);
11831
12055
  const altBg = index % 2 === 1 ? "#fcfcfc" : "white";
11832
12056
  return /* @__PURE__ */ jsxRuntime.jsxs(
11833
12057
  "div",
@@ -11856,7 +12080,7 @@ function KVRow({ item, isLast, index }) {
11856
12080
  children: item.key
11857
12081
  }
11858
12082
  ),
11859
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { flex: 1, display: "flex", alignItems: "center", gap: "6px" }, children: /* @__PURE__ */ jsxRuntime.jsx(ValueCell, { item }) }),
12083
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { flex: 1, minWidth: 0, display: "flex", alignItems: "center", gap: "6px" }, children: /* @__PURE__ */ jsxRuntime.jsx(ValueCell, { item }) }),
11860
12084
  item.copyable && /* @__PURE__ */ jsxRuntime.jsx(CopyButton, { value: item.value, rowHovered: hovered })
11861
12085
  ]
11862
12086
  }
@@ -11912,7 +12136,7 @@ function KeyValueListResolver(p) {
11912
12136
  var _a3;
11913
12137
  return sum + ((_a3 = g.items) != null ? _a3 : []).length;
11914
12138
  }, 0);
11915
- return /* @__PURE__ */ jsxRuntime.jsxs(React33__default.default.Fragment, { children: [
12139
+ return /* @__PURE__ */ jsxRuntime.jsxs(React41__default.default.Fragment, { children: [
11916
12140
  /* @__PURE__ */ jsxRuntime.jsxs(
11917
12141
  "div",
11918
12142
  {
@@ -12048,7 +12272,7 @@ function BalanceSheetResolver(p) {
12048
12272
  color: balanced ? "#15803d" : "#dc2626"
12049
12273
  }, children: balanced ? "\u2713 A = L + E" : "\u2717 Out of Balance" })
12050
12274
  ] }),
12051
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { overflowX: "auto", borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.04)" }, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "380px" }, children: [
12275
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { overflowX: "auto", minWidth: 0, borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.04)" }, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "380px" }, children: [
12052
12276
  /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
12053
12277
  /* @__PURE__ */ jsxRuntime.jsx("th", { style: {
12054
12278
  fontSize: "11px",
@@ -12090,7 +12314,7 @@ function BalanceSheetResolver(p) {
12090
12314
  /* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
12091
12315
  ((_p = p.sections) != null ? _p : []).map((section) => {
12092
12316
  var _a2;
12093
- return /* @__PURE__ */ jsxRuntime.jsxs(React33__default.default.Fragment, { children: [
12317
+ return /* @__PURE__ */ jsxRuntime.jsxs(React41__default.default.Fragment, { children: [
12094
12318
  /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan, style: {
12095
12319
  padding: "8px 12px",
12096
12320
  fontSize: "12px",
@@ -12103,7 +12327,7 @@ function BalanceSheetResolver(p) {
12103
12327
  }, children: (_a2 = categoryLabels2[section.category]) != null ? _a2 : section.category }) }),
12104
12328
  section.subsections.map((sub, si) => {
12105
12329
  var _a3;
12106
- return /* @__PURE__ */ jsxRuntime.jsxs(React33__default.default.Fragment, { children: [
12330
+ return /* @__PURE__ */ jsxRuntime.jsxs(React41__default.default.Fragment, { children: [
12107
12331
  /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan, style: {
12108
12332
  padding: "6px 10px 6px 24px",
12109
12333
  fontSize: "12px",
@@ -12265,7 +12489,7 @@ function IncomeStatementResolver(p) {
12265
12489
  ].filter(Boolean).join(" \xB7 ") })
12266
12490
  ] }),
12267
12491
  p.title && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontFamily: "var(--font-serif)", fontSize: "15px", fontWeight: 400, color: "var(--foreground)", letterSpacing: "-0.01em", margin: 0 }, children: p.title }),
12268
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { overflowX: "auto", borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.05)" }, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "380px" }, children: [
12492
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { overflowX: "auto", minWidth: 0, borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.05)" }, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "380px" }, children: [
12269
12493
  /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
12270
12494
  /* @__PURE__ */ jsxRuntime.jsx("th", { style: {
12271
12495
  fontSize: "11px",
@@ -12279,7 +12503,7 @@ function IncomeStatementResolver(p) {
12279
12503
  textAlign: "left",
12280
12504
  whiteSpace: "nowrap"
12281
12505
  }, children: "\xA0" }),
12282
- periods.map((period) => /* @__PURE__ */ jsxRuntime.jsxs(React33__default.default.Fragment, { children: [
12506
+ periods.map((period) => /* @__PURE__ */ jsxRuntime.jsxs(React41__default.default.Fragment, { children: [
12283
12507
  /* @__PURE__ */ jsxRuntime.jsx("th", { style: {
12284
12508
  fontSize: "11px",
12285
12509
  fontWeight: 500,
@@ -12310,7 +12534,7 @@ function IncomeStatementResolver(p) {
12310
12534
  sections.map((section, si) => {
12311
12535
  var _a2;
12312
12536
  const isSubtotal = section.sectionType === "subtotal";
12313
- return /* @__PURE__ */ jsxRuntime.jsxs(React33__default.default.Fragment, { children: [
12537
+ return /* @__PURE__ */ jsxRuntime.jsxs(React41__default.default.Fragment, { children: [
12314
12538
  /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: colCount, style: {
12315
12539
  padding: "8px 12px",
12316
12540
  fontSize: "12px",
@@ -12341,7 +12565,7 @@ function IncomeStatementResolver(p) {
12341
12565
  var _a4;
12342
12566
  const val = (_a4 = amounts[pi]) != null ? _a4 : 0;
12343
12567
  const isNeg = val < 0;
12344
- return /* @__PURE__ */ jsxRuntime.jsxs(React33__default.default.Fragment, { children: [
12568
+ return /* @__PURE__ */ jsxRuntime.jsxs(React41__default.default.Fragment, { children: [
12345
12569
  /* @__PURE__ */ jsxRuntime.jsx("td", { style: {
12346
12570
  padding: "6px 10px",
12347
12571
  fontSize: "13px",
@@ -12376,7 +12600,7 @@ function IncomeStatementResolver(p) {
12376
12600
  var _a2;
12377
12601
  const val = (_a2 = grossProfit[pi]) != null ? _a2 : 0;
12378
12602
  const isNeg = val < 0;
12379
- return /* @__PURE__ */ jsxRuntime.jsxs(React33__default.default.Fragment, { children: [
12603
+ return /* @__PURE__ */ jsxRuntime.jsxs(React41__default.default.Fragment, { children: [
12380
12604
  /* @__PURE__ */ jsxRuntime.jsx("td", { style: {
12381
12605
  padding: "8px 10px",
12382
12606
  fontSize: "12px",
@@ -12411,7 +12635,7 @@ function IncomeStatementResolver(p) {
12411
12635
  var _a2;
12412
12636
  const val = (_a2 = operatingIncome[pi]) != null ? _a2 : 0;
12413
12637
  const isNeg = val < 0;
12414
- return /* @__PURE__ */ jsxRuntime.jsxs(React33__default.default.Fragment, { children: [
12638
+ return /* @__PURE__ */ jsxRuntime.jsxs(React41__default.default.Fragment, { children: [
12415
12639
  /* @__PURE__ */ jsxRuntime.jsx("td", { style: {
12416
12640
  padding: "8px 10px",
12417
12641
  fontSize: "12px",
@@ -12445,7 +12669,7 @@ function IncomeStatementResolver(p) {
12445
12669
  var _a2;
12446
12670
  const val = (_a2 = netIncome[pi]) != null ? _a2 : 0;
12447
12671
  const isNeg = val < 0;
12448
- return /* @__PURE__ */ jsxRuntime.jsxs(React33__default.default.Fragment, { children: [
12672
+ return /* @__PURE__ */ jsxRuntime.jsxs(React41__default.default.Fragment, { children: [
12449
12673
  /* @__PURE__ */ jsxRuntime.jsx("td", { style: {
12450
12674
  padding: "10px 10px",
12451
12675
  fontSize: "13px",
@@ -12665,7 +12889,7 @@ function CashFlowStatementResolver(p) {
12665
12889
  /* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
12666
12890
  activities.map((activity, ai) => {
12667
12891
  var _a2, _b2, _c2;
12668
- return /* @__PURE__ */ jsxRuntime.jsxs(React33__default.default.Fragment, { children: [
12892
+ return /* @__PURE__ */ jsxRuntime.jsxs(React41__default.default.Fragment, { children: [
12669
12893
  ai > 0 && /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx(
12670
12894
  "td",
12671
12895
  {
@@ -13048,6 +13272,7 @@ function GeneralLedgerResolver(p) {
13048
13272
  {
13049
13273
  style: {
13050
13274
  overflowX: "auto",
13275
+ minWidth: 0,
13051
13276
  borderRadius: "0.75rem",
13052
13277
  border: `1px solid ${BORDER4}`,
13053
13278
  boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.04)"
@@ -15077,8 +15302,8 @@ var PRIORITY_STYLES = {
15077
15302
  function EscalationCardResolver(p) {
15078
15303
  var _a, _b, _c, _d;
15079
15304
  const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2, ACCENT_SOFT: ACCENT_SOFT2 } = useTheme();
15080
- const [cardHovered, setCardHovered] = React33.useState(false);
15081
- const [btnHovered, setBtnHovered] = React33.useState(false);
15305
+ const [cardHovered, setCardHovered] = React41.useState(false);
15306
+ const [btnHovered, setBtnHovered] = React41.useState(false);
15082
15307
  const priorityStyle = p.priority ? PRIORITY_STYLES[p.priority] : null;
15083
15308
  const railColor = (_a = priorityStyle == null ? void 0 : priorityStyle.color) != null ? _a : ACCENT2;
15084
15309
  const iconBg = (_b = priorityStyle == null ? void 0 : priorityStyle.bg) != null ? _b : "#fff2ec";
@@ -15925,9 +16150,9 @@ var CONNECTED_GREEN = "#15803d";
15925
16150
  function ConnectIntegrationResolver(p) {
15926
16151
  var _a;
15927
16152
  const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2, ACCENT_SOFT: ACCENT_SOFT2 } = useTheme();
15928
- const [cardHovered, setCardHovered] = React33.useState(false);
15929
- const [btnHovered, setBtnHovered] = React33.useState(false);
15930
- const [imgFailed, setImgFailed] = React33.useState(false);
16153
+ const [cardHovered, setCardHovered] = React41.useState(false);
16154
+ const [btnHovered, setBtnHovered] = React41.useState(false);
16155
+ const [imgFailed, setImgFailed] = React41.useState(false);
15931
16156
  const name = (p.integrationName || "Integration").trim();
15932
16157
  const initial = name.charAt(0).toUpperCase();
15933
16158
  const iconSrc = p.iconUrl || brandIconUrl(name);
@@ -16089,9 +16314,9 @@ function IntegrationsListResolver(p) {
16089
16314
  var _a, _b;
16090
16315
  const { BORDER: BORDER4, MUTED: MUTED2, PAPER: PAPER2, ACCENT: ACCENT2, ACCENT_SOFT: ACCENT_SOFT2 } = useTheme();
16091
16316
  const integrations = Array.isArray(p.integrations) ? p.integrations : [];
16092
- const [rowHover, setRowHover] = React33.useState(null);
16093
- const [btnHover, setBtnHover] = React33.useState(null);
16094
- const [failed, setFailed] = React33.useState({});
16317
+ const [rowHover, setRowHover] = React41.useState(null);
16318
+ const [btnHover, setBtnHover] = React41.useState(null);
16319
+ const [failed, setFailed] = React41.useState({});
16095
16320
  const connectedCount = integrations.filter((i) => i.status === "connected").length;
16096
16321
  return /* @__PURE__ */ jsxRuntime.jsx(ComponentActions, { filename: (_a = p.title) != null ? _a : "integrations", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: "11px" }, children: [
16097
16322
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [
@@ -16574,13 +16799,13 @@ var ellipsis = {
16574
16799
  function PipelinePreviewResolver(p) {
16575
16800
  var _a, _b, _c, _d, _e, _f, _g;
16576
16801
  const { MUTED: MUTED2, PAPER: PAPER2, BORDER: BORDER4, ACCENT: ACCENT2, ACCENT_SOFT: ACCENT_SOFT2 } = useTheme();
16577
- const [btnHovered, setBtnHovered] = React33.useState(false);
16802
+ const [btnHovered, setBtnHovered] = React41.useState(false);
16578
16803
  const stateCfg = STATE_CONFIG[(_a = p.state) != null ? _a : "draft"];
16579
16804
  const destinations = (_b = p.destinations) != null ? _b : [];
16580
16805
  const steps = (_c = p.steps) != null ? _c : [];
16581
16806
  const workstreams = (_d = p.workstreams) != null ? _d : [];
16582
16807
  const scheduleLabel = p.schedule ? p.schedule.type === "manual" ? "Manual" : (_f = (_e = p.schedule.label) != null ? _e : p.schedule.cron) != null ? _f : "Scheduled" : null;
16583
- const { nodes, edges, viewBox, vbW, vbH } = React33.useMemo(() => {
16808
+ const { nodes, edges, viewBox, vbW, vbH } = React41.useMemo(() => {
16584
16809
  const res = layoutGraph(steps);
16585
16810
  const b = layoutBounds(res.nodes);
16586
16811
  const pad = 24;
@@ -16594,7 +16819,7 @@ function PipelinePreviewResolver(p) {
16594
16819
  vbH: h
16595
16820
  };
16596
16821
  }, [steps]);
16597
- const nodeMap = React33.useMemo(() => {
16822
+ const nodeMap = React41.useMemo(() => {
16598
16823
  const m = {};
16599
16824
  nodes.forEach((n) => m[n.id] = n);
16600
16825
  return m;
@@ -16962,6 +17187,729 @@ function PipelinePreviewResolver(p) {
16962
17187
  )
16963
17188
  ] }) });
16964
17189
  }
17190
+ init_ThemeContext();
17191
+ var DEFAULT_INTERACTION = {
17192
+ selectedStepId: null,
17193
+ onStepSelect: void 0
17194
+ };
17195
+ var GenUIInteractionContext = React41.createContext(DEFAULT_INTERACTION);
17196
+ function GenUIInteractionProvider({ value, children }) {
17197
+ return /* @__PURE__ */ jsxRuntime.jsx(GenUIInteractionContext.Provider, { value, children });
17198
+ }
17199
+ function useGenUIInteraction() {
17200
+ return React41.useContext(GenUIInteractionContext);
17201
+ }
17202
+ var STATUS_COLORS3 = {
17203
+ done: "#15803d",
17204
+ active: "",
17205
+ // filled from theme ACCENT at render time
17206
+ review: "#f59e0b",
17207
+ pending: "#9ca3af",
17208
+ failed: "#dc2626"
17209
+ };
17210
+ var STATUS_LABELS = {
17211
+ done: "Complete",
17212
+ active: "In progress",
17213
+ review: "In review",
17214
+ pending: "Pending",
17215
+ failed: "Failed"
17216
+ };
17217
+ var HUMAN_PALETTE = ["#2563eb", "#0f766e", "#7c3aed", "#b45309", "#be185d", "#4d7c0f"];
17218
+ function hashColor(name) {
17219
+ let h = 0;
17220
+ for (let i = 0; i < name.length; i++) h = h * 31 + name.charCodeAt(i) | 0;
17221
+ return HUMAN_PALETTE[Math.abs(h) % HUMAN_PALETTE.length];
17222
+ }
17223
+ function initialsOf(a) {
17224
+ var _a, _b, _c, _d;
17225
+ if (a.initials) return a.initials.slice(0, 2).toUpperCase();
17226
+ const parts = a.name.trim().split(/\s+/);
17227
+ return (((_b = (_a = parts[0]) == null ? void 0 : _a[0]) != null ? _b : "") + ((_d = (_c = parts[1]) == null ? void 0 : _c[0]) != null ? _d : "")).toUpperCase() || "?";
17228
+ }
17229
+ function SparkMark({ size, color }) {
17230
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
17231
+ "path",
17232
+ {
17233
+ d: "M12 2C12 2 12.8 6.5 14.5 9.5C16.2 12.5 20 13 20 13C20 13 16.2 13.5 14.5 16.5C12.8 19.5 12 24 12 24C12 24 11.2 19.5 9.5 16.5C7.8 13.5 4 13 4 13C4 13 7.8 12.5 9.5 9.5C11.2 6.5 12 2 12 2Z",
17234
+ fill: color
17235
+ }
17236
+ ) });
17237
+ }
17238
+ function AvatarStack({ assignees, accent }) {
17239
+ const shown = assignees.slice(0, 4);
17240
+ const overflow = assignees.length - shown.length;
17241
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [
17242
+ shown.map((a, i) => {
17243
+ const isAgent = a.kind === "agent";
17244
+ const bg = isAgent ? `${accent}1f` : a.color || hashColor(a.name);
17245
+ return /* @__PURE__ */ jsxRuntime.jsx(
17246
+ "div",
17247
+ {
17248
+ title: `${a.name}${a.role ? ` \xB7 ${a.role}` : isAgent ? " \xB7 agent" : ""}`,
17249
+ style: {
17250
+ width: 20,
17251
+ height: 20,
17252
+ borderRadius: "50%",
17253
+ flexShrink: 0,
17254
+ marginLeft: i === 0 ? 0 : -7,
17255
+ zIndex: shown.length - i,
17256
+ display: "flex",
17257
+ alignItems: "center",
17258
+ justifyContent: "center",
17259
+ background: bg,
17260
+ border: "1.5px solid white",
17261
+ boxShadow: isAgent ? `inset 0 0 0 1px ${accent}59` : "none"
17262
+ },
17263
+ children: isAgent ? /* @__PURE__ */ jsxRuntime.jsx(SparkMark, { size: 11, color: accent }) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 8, fontWeight: 700, color: "white", letterSpacing: "0.02em" }, children: initialsOf(a) })
17264
+ },
17265
+ `${a.name}-${i}`
17266
+ );
17267
+ }),
17268
+ overflow > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
17269
+ "span",
17270
+ {
17271
+ style: {
17272
+ marginLeft: -7,
17273
+ zIndex: 0,
17274
+ width: 20,
17275
+ height: 20,
17276
+ borderRadius: "50%",
17277
+ background: "#f2f2f2",
17278
+ border: "1.5px solid white",
17279
+ display: "flex",
17280
+ alignItems: "center",
17281
+ justifyContent: "center",
17282
+ fontSize: 8,
17283
+ fontWeight: 700,
17284
+ color: "#777777"
17285
+ },
17286
+ children: [
17287
+ "+",
17288
+ overflow
17289
+ ]
17290
+ }
17291
+ )
17292
+ ] });
17293
+ }
17294
+ function IndexDot({ step, index, accent }) {
17295
+ var _a;
17296
+ const n = (_a = step.n) != null ? _a : index + 1;
17297
+ const base = {
17298
+ width: 18,
17299
+ height: 18,
17300
+ borderRadius: "50%",
17301
+ flexShrink: 0,
17302
+ display: "flex",
17303
+ alignItems: "center",
17304
+ justifyContent: "center",
17305
+ fontSize: 10,
17306
+ fontWeight: 700,
17307
+ lineHeight: 1
17308
+ };
17309
+ if (step.status === "done") {
17310
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "#15803d", color: "white" }), children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 10 }, children: "\u2713" }) });
17311
+ }
17312
+ if (step.status === "failed") {
17313
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "#dc2626", color: "white" }), children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 10 }, children: "!" }) });
17314
+ }
17315
+ if (step.status === "active") {
17316
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: accent, color: "white" }), children: n });
17317
+ }
17318
+ if (step.status === "review") {
17319
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "white", border: "1.5px solid #f59e0b", color: "#b45309" }), children: n });
17320
+ }
17321
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "#f2f2f2", color: "#9ca3af" }), children: n });
17322
+ }
17323
+ var CARD_MIN = 132;
17324
+ var CARD_GAP = 16;
17325
+ var AUTO_COMPACT_BELOW = 360;
17326
+ function useContainerWidth(ref) {
17327
+ const [w, setW] = React41__default.default.useState(0);
17328
+ React41__default.default.useLayoutEffect(() => {
17329
+ const el = ref.current;
17330
+ if (!el || typeof ResizeObserver === "undefined") return;
17331
+ const ro = new ResizeObserver((entries) => {
17332
+ var _a;
17333
+ const cr = (_a = entries[0]) == null ? void 0 : _a.contentRect;
17334
+ if (cr) setW(cr.width);
17335
+ });
17336
+ ro.observe(el);
17337
+ setW(el.getBoundingClientRect().width);
17338
+ return () => ro.disconnect();
17339
+ }, [ref]);
17340
+ return w;
17341
+ }
17342
+ var KEYFRAMES = `
17343
+ @keyframes wfsPulse{0%,100%{opacity:1}50%{opacity:.35}}
17344
+ @keyframes wfsLampPulse{0%,100%{box-shadow:0 0 0 0 var(--wfs-accent,#6366f1)73}50%{box-shadow:0 0 0 4px transparent}}
17345
+ @keyframes wfsRise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
17346
+ @keyframes wfsShimmer{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}
17347
+ .wfs-rise{animation:wfsRise 0.32s cubic-bezier(0.22,1,0.36,1) both}
17348
+ @media (prefers-reduced-motion: reduce){
17349
+ .wfs-anim,.wfs-rise,.wfs-shim{animation:none !important}
17350
+ .wfs-rise{opacity:1 !important;transform:none !important}
17351
+ }`;
17352
+ function ProgressMeter({
17353
+ done,
17354
+ total,
17355
+ accent,
17356
+ muted,
17357
+ loading
17358
+ }) {
17359
+ const pct = total > 0 ? Math.round(done / total * 100) : 0;
17360
+ return /* @__PURE__ */ jsxRuntime.jsxs(
17361
+ "div",
17362
+ {
17363
+ "data-testid": "workflow-stepper-progress",
17364
+ style: { display: "flex", alignItems: "center", gap: 8, padding: "0 2px 6px" },
17365
+ children: [
17366
+ /* @__PURE__ */ jsxRuntime.jsx(
17367
+ "span",
17368
+ {
17369
+ style: {
17370
+ fontSize: 10.5,
17371
+ fontWeight: 600,
17372
+ color: muted,
17373
+ fontVariantNumeric: "tabular-nums",
17374
+ letterSpacing: "0.01em",
17375
+ whiteSpace: "nowrap"
17376
+ },
17377
+ children: loading ? "\u2014" : `${done} / ${total} \xB7 ${pct}%`
17378
+ }
17379
+ ),
17380
+ /* @__PURE__ */ jsxRuntime.jsx(
17381
+ "span",
17382
+ {
17383
+ style: {
17384
+ flex: 1,
17385
+ height: 3,
17386
+ borderRadius: 3,
17387
+ background: "#eceff4",
17388
+ overflow: "hidden",
17389
+ minWidth: 40
17390
+ },
17391
+ children: /* @__PURE__ */ jsxRuntime.jsx(
17392
+ "span",
17393
+ {
17394
+ className: loading ? "wfs-shim" : void 0,
17395
+ style: {
17396
+ display: "block",
17397
+ height: "100%",
17398
+ width: loading ? "100%" : `${pct}%`,
17399
+ borderRadius: 3,
17400
+ background: loading ? `linear-gradient(90deg, #eceff4, ${accent}55, #eceff4)` : accent,
17401
+ backgroundSize: loading ? "200px 100%" : void 0,
17402
+ animation: loading ? "wfsShimmer 1.1s linear infinite" : void 0,
17403
+ transition: "width 0.45s cubic-bezier(0.22,1,0.36,1)"
17404
+ }
17405
+ }
17406
+ )
17407
+ }
17408
+ )
17409
+ ]
17410
+ }
17411
+ );
17412
+ }
17413
+ function WorkflowStepperRenderer({
17414
+ data,
17415
+ selectedStep = null,
17416
+ onSelectStep,
17417
+ density = "auto",
17418
+ loading = false,
17419
+ loadingSteps = 6,
17420
+ showProgress = true
17421
+ }) {
17422
+ var _a, _b, _c, _d, _e, _f;
17423
+ const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2 } = useTheme();
17424
+ const steps = (_a = data.steps) != null ? _a : [];
17425
+ const activeStepId = (_d = (_c = data.active_step) != null ? _c : (_b = steps.find((s) => s.status === "active")) == null ? void 0 : _b.id) != null ? _d : null;
17426
+ const interactive = typeof onSelectStep === "function";
17427
+ const statusColor3 = (s) => s === "active" ? ACCENT2 : STATUS_COLORS3[s];
17428
+ const doneCount = steps.filter((s) => s.status === "done").length;
17429
+ const rootRef = React41__default.default.useRef(null);
17430
+ const containerW = useContainerWidth(rootRef);
17431
+ let resolved = density === "auto" ? "full" : density;
17432
+ if (density === "auto" && containerW > 0) {
17433
+ const needed = steps.length * CARD_MIN + Math.max(0, steps.length - 1) * CARD_GAP;
17434
+ resolved = containerW < AUTO_COMPACT_BELOW || needed > containerW * 1.6 ? "compact" : "full";
17435
+ }
17436
+ const scrollerRef = React41__default.default.useRef(null);
17437
+ React41__default.default.useEffect(() => {
17438
+ if (resolved !== "full" || loading) return;
17439
+ const sc = scrollerRef.current;
17440
+ if (!sc) return;
17441
+ const el = sc.querySelector(
17442
+ `[data-testid="workflow-stepper-step-${selectedStep != null ? selectedStep : activeStepId}"]`
17443
+ );
17444
+ if (el && sc.scrollWidth > sc.clientWidth) {
17445
+ el.scrollIntoView({ inline: "center", block: "nearest", behavior: "smooth" });
17446
+ }
17447
+ }, [resolved, loading, selectedStep, activeStepId]);
17448
+ const [edges, setEdges] = React41__default.default.useState({
17449
+ left: false,
17450
+ right: false
17451
+ });
17452
+ const updateEdges = React41__default.default.useCallback(() => {
17453
+ const sc = scrollerRef.current;
17454
+ if (!sc) return;
17455
+ const max = sc.scrollWidth - sc.clientWidth;
17456
+ const sl = sc.scrollLeft;
17457
+ const left = sl > 1;
17458
+ const right = sl < max - 1;
17459
+ setEdges((prev) => prev.left === left && prev.right === right ? prev : { left, right });
17460
+ }, []);
17461
+ React41__default.default.useLayoutEffect(() => {
17462
+ if (resolved !== "full" || loading) return;
17463
+ updateEdges();
17464
+ const sc = scrollerRef.current;
17465
+ if (!sc || typeof ResizeObserver === "undefined") return;
17466
+ const ro = new ResizeObserver(updateEdges);
17467
+ ro.observe(sc);
17468
+ return () => ro.disconnect();
17469
+ }, [resolved, loading, steps.length, updateEdges]);
17470
+ const edgeMask = edges.left || edges.right ? `linear-gradient(90deg, ${edges.left ? "transparent 0, #000 14px" : "#000 0"}, ${edges.right ? "#000 calc(100% - 14px), transparent 100%" : "#000 100%"})` : void 0;
17471
+ const themeStyle = { ["--wfs-accent"]: ACCENT2 };
17472
+ if (loading) {
17473
+ const ghosts = Array.from({ length: Math.max(2, loadingSteps) });
17474
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-testid": "workflow-stepper-loading", style: __spreadValues({ width: "100%", minWidth: 0 }, themeStyle), children: [
17475
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: KEYFRAMES }),
17476
+ showProgress && /* @__PURE__ */ jsxRuntime.jsx(ProgressMeter, { done: 0, total: 0, accent: ACCENT2, muted: MUTED2, loading: true }),
17477
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", alignItems: "stretch", gap: CARD_GAP, padding: "2px 2px 6px", overflow: "hidden" }, children: ghosts.map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
17478
+ "div",
17479
+ {
17480
+ className: "wfs-shim",
17481
+ "aria-hidden": "true",
17482
+ style: {
17483
+ flex: "0 1 168px",
17484
+ minWidth: CARD_MIN,
17485
+ height: 84,
17486
+ borderRadius: 10,
17487
+ border: `1px solid ${BORDER4}`,
17488
+ background: `linear-gradient(90deg, #f4f6f9, #eceff4 40%, #f4f6f9 80%)`,
17489
+ backgroundSize: "200px 100%",
17490
+ animation: "wfsShimmer 1.1s linear infinite",
17491
+ animationDelay: `${i * 0.08}s`
17492
+ }
17493
+ },
17494
+ i
17495
+ )) })
17496
+ ] });
17497
+ }
17498
+ if (resolved === "compact") {
17499
+ const activeStep = (_e = steps.find((s) => s.id === activeStepId)) != null ? _e : null;
17500
+ return /* @__PURE__ */ jsxRuntime.jsxs(
17501
+ "div",
17502
+ {
17503
+ ref: rootRef,
17504
+ "data-testid": "workflow-stepper-compact",
17505
+ style: __spreadValues({ width: "100%", minWidth: 0 }, themeStyle),
17506
+ children: [
17507
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: KEYFRAMES }),
17508
+ showProgress && /* @__PURE__ */ jsxRuntime.jsx(ProgressMeter, { done: doneCount, total: steps.length, accent: ACCENT2, muted: MUTED2 }),
17509
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, minWidth: 0 }, children: [
17510
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", alignItems: "center", flexShrink: 0 }, children: steps.map((s, i) => {
17511
+ const sel = selectedStep === s.id;
17512
+ const act = s.status === "active";
17513
+ const done = s.status === "done";
17514
+ const reached = s.status !== "pending";
17515
+ const clickable = interactive && reached;
17516
+ const size = act ? 11 : done ? 9 : 8;
17517
+ return /* @__PURE__ */ jsxRuntime.jsxs(React41__default.default.Fragment, { children: [
17518
+ i > 0 && /* @__PURE__ */ jsxRuntime.jsx(
17519
+ "span",
17520
+ {
17521
+ "aria-hidden": "true",
17522
+ style: {
17523
+ width: 14,
17524
+ height: 1.5,
17525
+ borderRadius: 1,
17526
+ background: steps[i - 1].status === "done" ? "#15803d" : "#e5e7eb",
17527
+ transition: "background 0.36s ease-out"
17528
+ }
17529
+ }
17530
+ ),
17531
+ /* @__PURE__ */ jsxRuntime.jsx(
17532
+ "button",
17533
+ {
17534
+ type: "button",
17535
+ disabled: interactive && !reached,
17536
+ "aria-disabled": interactive && !reached ? true : void 0,
17537
+ title: `${s.title} \xB7 ${STATUS_LABELS[s.status]}`,
17538
+ onClick: clickable ? () => onSelectStep == null ? void 0 : onSelectStep(sel ? null : s.id) : void 0,
17539
+ "data-testid": `workflow-stepper-step-${s.id}`,
17540
+ "data-status": s.status,
17541
+ "data-reached": reached || void 0,
17542
+ className: act ? "wfs-anim" : void 0,
17543
+ style: {
17544
+ position: "relative",
17545
+ width: size,
17546
+ height: size,
17547
+ padding: 0,
17548
+ borderRadius: "50%",
17549
+ background: statusColor3(s.status),
17550
+ flexShrink: 0,
17551
+ // border-box so the selected 2px border can't grow the dot
17552
+ // and reflow the rail.
17553
+ boxSizing: "border-box",
17554
+ opacity: reached ? 1 : 0.55,
17555
+ border: sel ? `2px solid ${ACCENT2}` : done ? "none" : "1px solid rgba(255,255,255,0.6)",
17556
+ boxShadow: sel ? "0 0 0 2px #fff" : "none",
17557
+ cursor: clickable ? "pointer" : "default",
17558
+ transition: "width 0.15s, height 0.15s",
17559
+ animation: act ? "wfsLampPulse 1.8s ease-in-out infinite" : "none"
17560
+ }
17561
+ }
17562
+ )
17563
+ ] }, s.id);
17564
+ }) }),
17565
+ activeStep && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17566
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", style: { width: 1, height: 16, background: "#e6eaf1", flexShrink: 0 } }),
17567
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: 7, minWidth: 0 }, children: [
17568
+ /* @__PURE__ */ jsxRuntime.jsx(
17569
+ "span",
17570
+ {
17571
+ "aria-hidden": "true",
17572
+ style: {
17573
+ width: 17,
17574
+ height: 17,
17575
+ borderRadius: "50%",
17576
+ flexShrink: 0,
17577
+ display: "flex",
17578
+ alignItems: "center",
17579
+ justifyContent: "center",
17580
+ fontSize: 9.5,
17581
+ fontWeight: 700,
17582
+ lineHeight: 1,
17583
+ background: activeStep.status === "done" ? "#15803d" : activeStep.status === "review" ? "#fff" : activeStep.status === "failed" ? "#dc2626" : ACCENT2,
17584
+ color: activeStep.status === "review" ? "#b45309" : "#fff",
17585
+ border: activeStep.status === "review" ? "1.5px solid #f59e0b" : "none"
17586
+ },
17587
+ children: activeStep.status === "done" ? "\u2713" : activeStep.status === "failed" ? "!" : (_f = activeStep.n) != null ? _f : steps.findIndex((x) => x.id === activeStep.id) + 1
17588
+ }
17589
+ ),
17590
+ /* @__PURE__ */ jsxRuntime.jsxs(
17591
+ "span",
17592
+ {
17593
+ style: {
17594
+ fontSize: 12.5,
17595
+ fontWeight: 650,
17596
+ color: "var(--foreground)",
17597
+ letterSpacing: "-0.01em",
17598
+ whiteSpace: "nowrap",
17599
+ overflow: "hidden",
17600
+ textOverflow: "ellipsis",
17601
+ minWidth: 0
17602
+ },
17603
+ children: [
17604
+ activeStep.title,
17605
+ activeStep.sub ? /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: 400, color: MUTED2 }, children: [
17606
+ " \xB7 ",
17607
+ activeStep.sub
17608
+ ] }) : null
17609
+ ]
17610
+ }
17611
+ )
17612
+ ] })
17613
+ ] })
17614
+ ] })
17615
+ ]
17616
+ }
17617
+ );
17618
+ }
17619
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: rootRef, "data-testid": "workflow-stepper", style: __spreadValues({ width: "100%", minWidth: 0 }, themeStyle), children: [
17620
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: KEYFRAMES }),
17621
+ showProgress && /* @__PURE__ */ jsxRuntime.jsx(ProgressMeter, { done: doneCount, total: steps.length, accent: ACCENT2, muted: MUTED2 }),
17622
+ /* @__PURE__ */ jsxRuntime.jsxs(
17623
+ "div",
17624
+ {
17625
+ ref: scrollerRef,
17626
+ className: "wfs-scroller",
17627
+ onScroll: updateEdges,
17628
+ style: {
17629
+ display: "flex",
17630
+ alignItems: "stretch",
17631
+ overflowX: "auto",
17632
+ scrollSnapType: "x proximity",
17633
+ padding: "2px 2px 4px",
17634
+ // Thin, always-styled scrollbar (Firefox + Windows/desktop WebKit
17635
+ // where overlay scrollbars aren't available). macOS/mobile show
17636
+ // overlay scrollbars on scroll; harmless either way.
17637
+ scrollbarWidth: "thin",
17638
+ scrollbarColor: "#c2c9d6 transparent",
17639
+ // Edge fade ONLY on the side(s) with hidden content — never when the
17640
+ // row isn't scrollable, so the last card's right edge stays crisp.
17641
+ maskImage: edgeMask,
17642
+ WebkitMaskImage: edgeMask
17643
+ },
17644
+ children: [
17645
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
17646
+ .wfs-scroller::-webkit-scrollbar{height:8px}
17647
+ .wfs-scroller::-webkit-scrollbar-track{background:transparent}
17648
+ .wfs-scroller::-webkit-scrollbar-thumb{background:#c2c9d6;border-radius:8px;border:2px solid transparent;background-clip:padding-box}
17649
+ .wfs-scroller:hover::-webkit-scrollbar-thumb{background:#aab2c2;background-clip:padding-box}
17650
+ ` }),
17651
+ steps.map((step, i) => {
17652
+ var _a2;
17653
+ const isSelected = selectedStep === step.id;
17654
+ const isActive = step.status === "active";
17655
+ const reached = step.status !== "pending";
17656
+ const clickable = interactive && reached;
17657
+ const color = statusColor3(step.status);
17658
+ const humans = ((_a2 = step.assignees) != null ? _a2 : []).filter((a) => a.kind === "human");
17659
+ const roleCaption = humans.map((h) => h.role).filter(Boolean).slice(0, 2).join(" \xB7 ");
17660
+ return /* @__PURE__ */ jsxRuntime.jsxs(React41__default.default.Fragment, { children: [
17661
+ i > 0 && /* @__PURE__ */ jsxRuntime.jsx(
17662
+ "div",
17663
+ {
17664
+ style: {
17665
+ width: CARD_GAP,
17666
+ flexShrink: 0,
17667
+ display: "flex",
17668
+ alignItems: "center"
17669
+ },
17670
+ "aria-hidden": "true",
17671
+ children: /* @__PURE__ */ jsxRuntime.jsx(
17672
+ "div",
17673
+ {
17674
+ style: {
17675
+ width: "100%",
17676
+ height: 1.5,
17677
+ borderRadius: 1,
17678
+ // Fill sweep: completed rails wash green left→right.
17679
+ background: steps[i - 1].status === "done" ? "linear-gradient(90deg, #15803d, #15803d)" : "#e5e7eb",
17680
+ backgroundSize: "100% 100%",
17681
+ transition: "background 0.36s ease-out"
17682
+ }
17683
+ }
17684
+ )
17685
+ }
17686
+ ),
17687
+ /* @__PURE__ */ jsxRuntime.jsxs(
17688
+ "div",
17689
+ {
17690
+ role: clickable ? "button" : void 0,
17691
+ tabIndex: clickable ? 0 : void 0,
17692
+ "aria-disabled": interactive && !reached ? true : void 0,
17693
+ className: "wfs-rise",
17694
+ "data-testid": `workflow-stepper-step-${step.id}`,
17695
+ "data-status": step.status,
17696
+ "data-selected": isSelected || void 0,
17697
+ "data-reached": reached || void 0,
17698
+ onClick: clickable ? () => onSelectStep == null ? void 0 : onSelectStep(isSelected ? null : step.id) : void 0,
17699
+ onKeyDown: clickable ? (e) => {
17700
+ if (e.key === "Enter" || e.key === " ") {
17701
+ e.preventDefault();
17702
+ onSelectStep == null ? void 0 : onSelectStep(isSelected ? null : step.id);
17703
+ }
17704
+ } : void 0,
17705
+ onMouseEnter: clickable ? (e) => {
17706
+ e.currentTarget.style.transform = "translateY(-1px)";
17707
+ e.currentTarget.style.boxShadow = "0 3px 10px rgba(15,23,42,0.08)";
17708
+ } : void 0,
17709
+ onMouseLeave: clickable ? (e) => {
17710
+ e.currentTarget.style.transform = "none";
17711
+ e.currentTarget.style.boxShadow = "0 1px 2px rgba(0,0,0,0.04)";
17712
+ } : void 0,
17713
+ style: {
17714
+ position: "relative",
17715
+ flex: "0 1 168px",
17716
+ minWidth: CARD_MIN,
17717
+ maxWidth: 208,
17718
+ scrollSnapAlign: "center",
17719
+ borderRadius: 10,
17720
+ boxSizing: "border-box",
17721
+ // Selection changes border COLOR only (constant 1px width) so
17722
+ // the card never reflows the row on click.
17723
+ border: `1px solid ${isSelected ? ACCENT2 : BORDER4}`,
17724
+ background: isSelected ? `${ACCENT2}0d` : "white",
17725
+ boxShadow: "0 1px 2px rgba(0,0,0,0.04)",
17726
+ padding: "10px 11px",
17727
+ display: "flex",
17728
+ flexDirection: "column",
17729
+ gap: 7,
17730
+ cursor: clickable ? "pointer" : "default",
17731
+ opacity: reached ? 1 : 0.62,
17732
+ transition: "border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.12s",
17733
+ animationDelay: `${Math.min(i, 10) * 0.04}s`,
17734
+ overflow: "hidden"
17735
+ },
17736
+ children: [
17737
+ isActive && !isSelected && /* @__PURE__ */ jsxRuntime.jsx(
17738
+ "span",
17739
+ {
17740
+ style: {
17741
+ position: "absolute",
17742
+ left: 0,
17743
+ top: 6,
17744
+ bottom: 6,
17745
+ width: 2,
17746
+ borderRadius: 2,
17747
+ background: ACCENT2
17748
+ }
17749
+ }
17750
+ ),
17751
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
17752
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
17753
+ /* @__PURE__ */ jsxRuntime.jsx(IndexDot, { step, index: i, accent: ACCENT2 }),
17754
+ /* @__PURE__ */ jsxRuntime.jsx(
17755
+ "span",
17756
+ {
17757
+ className: isActive ? "wfs-anim" : void 0,
17758
+ style: {
17759
+ width: 6,
17760
+ height: 6,
17761
+ borderRadius: "50%",
17762
+ background: color,
17763
+ animation: isActive ? "wfsLampPulse 1.8s ease-in-out infinite" : "none"
17764
+ }
17765
+ }
17766
+ )
17767
+ ] }),
17768
+ /* @__PURE__ */ jsxRuntime.jsx(
17769
+ "span",
17770
+ {
17771
+ style: {
17772
+ fontSize: 9,
17773
+ fontWeight: 600,
17774
+ letterSpacing: "0.05em",
17775
+ textTransform: "uppercase",
17776
+ color
17777
+ },
17778
+ children: STATUS_LABELS[step.status]
17779
+ }
17780
+ )
17781
+ ] }),
17782
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 0 }, children: [
17783
+ /* @__PURE__ */ jsxRuntime.jsx(
17784
+ "div",
17785
+ {
17786
+ style: {
17787
+ fontSize: 12.5,
17788
+ fontWeight: 600,
17789
+ color: "var(--foreground)",
17790
+ lineHeight: 1.25,
17791
+ letterSpacing: "-0.01em",
17792
+ overflow: "hidden",
17793
+ textOverflow: "ellipsis",
17794
+ whiteSpace: "nowrap"
17795
+ },
17796
+ children: step.title
17797
+ }
17798
+ ),
17799
+ step.sub && /* @__PURE__ */ jsxRuntime.jsx(
17800
+ "div",
17801
+ {
17802
+ style: {
17803
+ fontSize: 10.5,
17804
+ color: MUTED2,
17805
+ marginTop: 2,
17806
+ overflow: "hidden",
17807
+ textOverflow: "ellipsis",
17808
+ whiteSpace: "nowrap"
17809
+ },
17810
+ children: step.sub
17811
+ }
17812
+ )
17813
+ ] }),
17814
+ /* @__PURE__ */ jsxRuntime.jsxs(
17815
+ "div",
17816
+ {
17817
+ style: {
17818
+ display: "flex",
17819
+ alignItems: "center",
17820
+ justifyContent: "space-between",
17821
+ marginTop: "auto",
17822
+ minHeight: 20
17823
+ },
17824
+ children: [
17825
+ step.assignees && step.assignees.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(AvatarStack, { assignees: step.assignees, accent: ACCENT2 }) : /* @__PURE__ */ jsxRuntime.jsx("span", {}),
17826
+ roleCaption && /* @__PURE__ */ jsxRuntime.jsx(
17827
+ "span",
17828
+ {
17829
+ style: {
17830
+ fontSize: 9,
17831
+ color: "#9ca3af",
17832
+ fontWeight: 500,
17833
+ textAlign: "right",
17834
+ maxWidth: 76,
17835
+ lineHeight: 1.2,
17836
+ overflow: "hidden"
17837
+ },
17838
+ children: roleCaption
17839
+ }
17840
+ )
17841
+ ]
17842
+ }
17843
+ )
17844
+ ]
17845
+ }
17846
+ )
17847
+ ] }, step.id);
17848
+ })
17849
+ ]
17850
+ }
17851
+ )
17852
+ ] });
17853
+ }
17854
+ function WorkflowStepperResolver(p) {
17855
+ var _a;
17856
+ const { selectedStepId, onStepSelect } = useGenUIInteraction();
17857
+ return /* @__PURE__ */ jsxRuntime.jsx(ComponentActions, { filename: (_a = p.title) != null ? _a : "workflow-stepper", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: 10 }, children: [
17858
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }, children: [
17859
+ /* @__PURE__ */ jsxRuntime.jsx(
17860
+ "p",
17861
+ {
17862
+ style: {
17863
+ fontFamily: "var(--font-serif)",
17864
+ fontSize: "15px",
17865
+ fontWeight: 400,
17866
+ color: "var(--foreground)",
17867
+ letterSpacing: "-0.01em",
17868
+ margin: 0
17869
+ },
17870
+ children: p.title
17871
+ }
17872
+ ),
17873
+ p.period && /* @__PURE__ */ jsxRuntime.jsx(
17874
+ "span",
17875
+ {
17876
+ style: {
17877
+ fontSize: 11,
17878
+ fontWeight: 600,
17879
+ padding: "2px 8px",
17880
+ borderRadius: 9999,
17881
+ background: "#f2f2f2",
17882
+ color: "#777777",
17883
+ fontVariantNumeric: "tabular-nums"
17884
+ },
17885
+ children: p.period
17886
+ }
17887
+ ),
17888
+ p.badge && /* @__PURE__ */ jsxRuntime.jsx(
17889
+ "span",
17890
+ {
17891
+ style: {
17892
+ fontSize: 11,
17893
+ fontWeight: 600,
17894
+ padding: "2px 8px",
17895
+ borderRadius: 9999,
17896
+ border: "1px solid #dedede",
17897
+ color: "#777777"
17898
+ },
17899
+ children: p.badge
17900
+ }
17901
+ )
17902
+ ] }),
17903
+ /* @__PURE__ */ jsxRuntime.jsx(
17904
+ WorkflowStepperRenderer,
17905
+ {
17906
+ data: p,
17907
+ selectedStep: selectedStepId,
17908
+ onSelectStep: onStepSelect
17909
+ }
17910
+ )
17911
+ ] }) });
17912
+ }
16965
17913
  function resolveUI(rawPayload) {
16966
17914
  const payload = coercePayload(rawPayload);
16967
17915
  switch (payload.type) {
@@ -17077,6 +18025,8 @@ function resolveUI(rawPayload) {
17077
18025
  return /* @__PURE__ */ jsxRuntime.jsx(IntegrationsListResolver, __spreadValues({}, payload));
17078
18026
  case "pipeline-preview":
17079
18027
  return /* @__PURE__ */ jsxRuntime.jsx(PipelinePreviewResolver, __spreadValues({}, payload));
18028
+ case "workflow-stepper":
18029
+ return /* @__PURE__ */ jsxRuntime.jsx(WorkflowStepperResolver, __spreadValues({}, payload));
17080
18030
  default: {
17081
18031
  return /* @__PURE__ */ jsxRuntime.jsx(
17082
18032
  "div",
@@ -17118,7 +18068,7 @@ function InlineSpinner() {
17118
18068
  }
17119
18069
  function GenUIRenderer({ payload }) {
17120
18070
  return /* @__PURE__ */ jsxRuntime.jsx(
17121
- React33.Suspense,
18071
+ React41.Suspense,
17122
18072
  {
17123
18073
  fallback: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", padding: "8px 0" }, children: [
17124
18074
  /* @__PURE__ */ jsxRuntime.jsx(InlineSpinner, {}),
@@ -17204,7 +18154,7 @@ var INPUT_ERROR = { borderColor: "#dc2626" };
17204
18154
  var SELECT_EXTRA = { cursor: "pointer" };
17205
18155
  function useInputBase() {
17206
18156
  const { BORDER: BORDER4 } = useTheme();
17207
- return React33.useMemo(() => ({
18157
+ return React41.useMemo(() => ({
17208
18158
  font: "inherit",
17209
18159
  fontSize: "13px",
17210
18160
  padding: "7px 10px",
@@ -17285,7 +18235,7 @@ function SelectField({ field, value, onChange, disabled, error }) {
17285
18235
  }
17286
18236
  function MultiSelectField({ field, value, onChange, disabled }) {
17287
18237
  const { MUTED: MUTED2, ACCENT: ACCENT2, BORDER: BORDER4 } = useTheme();
17288
- const [hovered, setHovered] = React33.useState(null);
18238
+ const [hovered, setHovered] = React41.useState(null);
17289
18239
  const options = field.options || [];
17290
18240
  const selected = Array.isArray(value) ? value : [];
17291
18241
  const toggle = (optValue) => {
@@ -17400,10 +18350,10 @@ function DocGlyph({ color }) {
17400
18350
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 2v6h6" })
17401
18351
  ] });
17402
18352
  }
17403
- function FileUploadField({ field, value, onChange, disabled, onFileUpload, error }) {
18353
+ function FileUploadField({ field, value, onChange, disabled, onFileUpload, error, dense }) {
17404
18354
  const { MUTED: MUTED2, ACCENT: ACCENT2, BORDER: BORDER4, PAPER: PAPER2 } = useTheme();
17405
- const keyRef = React33__default.default.useRef(0);
17406
- const [entries, setEntries] = React33.useState(() => {
18355
+ const keyRef = React41__default.default.useRef(0);
18356
+ const [entries, setEntries] = React41.useState(() => {
17407
18357
  const arr = Array.isArray(value) ? value : value && typeof value === "object" ? [value] : [];
17408
18358
  return arr.map((item) => {
17409
18359
  var _a, _b;
@@ -17411,11 +18361,11 @@ function FileUploadField({ field, value, onChange, disabled, onFileUpload, error
17411
18361
  return { key: keyRef.current += 1, name: (_b = (_a = r.filename) != null ? _a : r.name) != null ? _b : "file", size: r.size, status: "done", result: r };
17412
18362
  });
17413
18363
  });
17414
- const entriesRef = React33__default.default.useRef(entries);
18364
+ const entriesRef = React41__default.default.useRef(entries);
17415
18365
  entriesRef.current = entries;
17416
- const [dragOver, setDragOver] = React33.useState(false);
17417
- const inputRef = React33__default.default.useRef(null);
17418
- React33__default.default.useEffect(() => {
18366
+ const [dragOver, setDragOver] = React41.useState(false);
18367
+ const inputRef = React41__default.default.useRef(null);
18368
+ React41__default.default.useEffect(() => {
17419
18369
  ensureFileUploadKeyframes();
17420
18370
  }, []);
17421
18371
  const interactive = !disabled;
@@ -17459,6 +18409,7 @@ function FileUploadField({ field, value, onChange, disabled, onFileUpload, error
17459
18409
  const removeEntry = (key) => commit(entriesRef.current.filter((e) => e.key !== key));
17460
18410
  const borderColor = dragOver ? ACCENT2 : error ? "#dc2626" : BORDER4;
17461
18411
  const hasFiles = entries.length > 0;
18412
+ const denseRow = !!dense && !hasFiles;
17462
18413
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
17463
18414
  /* @__PURE__ */ jsxRuntime.jsxs(
17464
18415
  "div",
@@ -17480,12 +18431,12 @@ function FileUploadField({ field, value, onChange, disabled, onFileUpload, error
17480
18431
  onDrop: handleDrop,
17481
18432
  style: {
17482
18433
  display: "flex",
17483
- flexDirection: "column",
18434
+ flexDirection: denseRow ? "row" : "column",
17484
18435
  alignItems: "center",
17485
- justifyContent: "center",
17486
- gap: hasFiles ? "4px" : "7px",
17487
- padding: hasFiles ? "12px 14px" : "18px 14px",
17488
- textAlign: "center",
18436
+ justifyContent: denseRow ? "flex-start" : "center",
18437
+ gap: denseRow ? "9px" : hasFiles ? "4px" : "7px",
18438
+ padding: denseRow ? "9px 12px" : hasFiles ? "12px 14px" : "18px 14px",
18439
+ textAlign: denseRow ? "left" : "center",
17489
18440
  border: `1.5px dashed ${borderColor}`,
17490
18441
  borderRadius: "0.75rem",
17491
18442
  background: dragOver ? `${ACCENT2}0d` : PAPER2,
@@ -17498,11 +18449,11 @@ function FileUploadField({ field, value, onChange, disabled, onFileUpload, error
17498
18449
  },
17499
18450
  children: [
17500
18451
  /* @__PURE__ */ jsxRuntime.jsx(UploadGlyph, { color: dragOver ? ACCENT2 : MUTED2 }),
17501
- /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: "12.5px", color: "var(--foreground)" }, children: [
18452
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: denseRow ? "12px" : "12.5px", color: "var(--foreground)" }, children: [
17502
18453
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: ACCENT2, fontWeight: 600 }, children: hasFiles ? "Add more files" : "Click to upload" }),
17503
18454
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: MUTED2 }, children: " or drag and drop" })
17504
18455
  ] }),
17505
- !hasFiles && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: MUTED2 }, children: hint }),
18456
+ !hasFiles && !denseRow && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: MUTED2 }, children: hint }),
17506
18457
  /* @__PURE__ */ jsxRuntime.jsx("input", { ref: inputRef, type: "file", multiple: true, accept, onChange: handleInput, disabled: !interactive, style: { display: "none" }, tabIndex: -1 })
17507
18458
  ]
17508
18459
  }
@@ -17540,7 +18491,7 @@ var FIELD_REGISTRY = {
17540
18491
  checkbox: CheckboxField,
17541
18492
  file_upload: FileUploadField
17542
18493
  };
17543
- function FieldRenderer({ field, value, onChange, disabled, error, onFileUpload }) {
18494
+ function FieldRenderer({ field, value, onChange, disabled, error, onFileUpload, dense }) {
17544
18495
  const { MUTED: MUTED2 } = useTheme();
17545
18496
  const FieldComp = FIELD_REGISTRY[field.field_type] || FIELD_REGISTRY.text;
17546
18497
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "3px" }, children: [
@@ -17548,12 +18499,12 @@ function FieldRenderer({ field, value, onChange, disabled, error, onFileUpload }
17548
18499
  field.label,
17549
18500
  field.required && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#dc2626", marginLeft: "2px" }, children: "*" })
17550
18501
  ] }),
17551
- field.description && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "11px", color: MUTED2, lineHeight: 1.4 }, children: field.description }),
17552
- /* @__PURE__ */ jsxRuntime.jsx(FieldComp, { field, value, onChange, disabled, error, onFileUpload: field.field_type === "file_upload" ? onFileUpload : void 0 }),
18502
+ field.description && !dense && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "11px", color: MUTED2, lineHeight: 1.4 }, children: field.description }),
18503
+ /* @__PURE__ */ jsxRuntime.jsx(FieldComp, { field, value, onChange, disabled, error, dense, onFileUpload: field.field_type === "file_upload" ? onFileUpload : void 0 }),
17553
18504
  error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "11px", color: "#dc2626", fontWeight: 500, marginTop: "1px" }, children: error })
17554
18505
  ] });
17555
18506
  }
17556
- var SlotErrorBoundary = class extends React33__default.default.Component {
18507
+ var SlotErrorBoundary = class extends React41__default.default.Component {
17557
18508
  constructor(props) {
17558
18509
  super(props);
17559
18510
  this.state = { hasError: false };
@@ -17599,7 +18550,7 @@ function BuilderRecap({ builder, state }) {
17599
18550
  return String(value);
17600
18551
  };
17601
18552
  const decisionField = (b) => (b.fields || []).find((f) => f.field_type === "select") || (b.fields || [])[0];
17602
- const rows = React33.useMemo(
18553
+ const rows = React41.useMemo(
17603
18554
  () => blocks.map((b) => {
17604
18555
  const df = decisionField(b);
17605
18556
  const decision = df ? display(df, state.getValue(b.id, df.name)) : "";
@@ -17609,7 +18560,7 @@ function BuilderRecap({ builder, state }) {
17609
18560
  // eslint-disable-next-line react-hooks/exhaustive-deps
17610
18561
  [blocks, state.values]
17611
18562
  );
17612
- const counts = React33.useMemo(() => {
18563
+ const counts = React41.useMemo(() => {
17613
18564
  const m = /* @__PURE__ */ new Map();
17614
18565
  for (const r of rows) {
17615
18566
  const k = r.decision || "\u2014";
@@ -17732,20 +18683,21 @@ function S3(t) {
17732
18683
  }
17733
18684
  };
17734
18685
  }
17735
- function FormBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUpload }) {
18686
+ function FormBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUpload, dense, hideActions }) {
17736
18687
  var _a;
17737
18688
  const t = useTheme();
17738
- const S4 = React33.useMemo(() => makeStyles(t), [t]);
18689
+ const S4 = React41.useMemo(() => makeStyles(t), [t]);
17739
18690
  const block = builder.blocks[0];
17740
18691
  if (!block) return null;
17741
18692
  if (disabled) return /* @__PURE__ */ jsxRuntime.jsx(BuilderRecap, { builder, state });
17742
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S4.card, children: [
17743
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [
18693
+ const containerStyle = dense ? { display: "flex", flexDirection: "column", gap: "12px" } : S4.card;
18694
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle, children: [
18695
+ dense ? builder.description && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "12px", color: t.MUTED, lineHeight: 1.45, margin: 0 }, children: builder.description }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [
17744
18696
  /* @__PURE__ */ jsxRuntime.jsx("p", { style: S4.title, children: builder.title }),
17745
18697
  builder.description && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "12px", color: t.MUTED, lineHeight: 1.45, margin: 0 }, children: builder.description })
17746
18698
  ] }),
17747
18699
  ((_a = block.context) == null ? void 0 : _a.type) && /* @__PURE__ */ jsxRuntime.jsx(ContextSlot, { payload: block.context }),
17748
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: (block.fields || []).map((field) => /* @__PURE__ */ jsxRuntime.jsx(
18700
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: dense ? "8px" : "12px" }, children: (block.fields || []).map((field) => /* @__PURE__ */ jsxRuntime.jsx(
17749
18701
  FieldRenderer,
17750
18702
  {
17751
18703
  field,
@@ -17753,15 +18705,16 @@ function FormBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUploa
17753
18705
  onChange: (v) => state.setFieldValue(block.id, field.name, v),
17754
18706
  disabled,
17755
18707
  error: state.getError(block.id, field.name),
18708
+ dense,
17756
18709
  onFileUpload
17757
18710
  },
17758
18711
  `${block.id}:${field.name}`
17759
18712
  )) }),
17760
- !disabled ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", paddingTop: "4px" }, children: [
18713
+ hideActions ? null : /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", paddingTop: "4px" }, children: [
17761
18714
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 } }),
17762
18715
  onCancel && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onCancel, style: S4.cancelBtn, children: builder.cancel_label || "Cancel" }),
17763
18716
  /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onSubmit, style: S4.submitBtn, children: builder.submit_label || "Submit" })
17764
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "11px", fontWeight: 600, color: t.MUTED, textAlign: "center", padding: "4px 0" }, children: "Submitted" })
18717
+ ] })
17765
18718
  ] });
17766
18719
  }
17767
18720
  function makeStyles(t) {
@@ -17818,10 +18771,10 @@ function makeStyles(t) {
17818
18771
 
17819
18772
  // src/builders/StepperBuilder.tsx
17820
18773
  init_ThemeContext();
17821
- function StepperBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUpload }) {
18774
+ function StepperBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUpload, dense }) {
17822
18775
  var _a;
17823
18776
  const t = useTheme();
17824
- const S4 = React33.useMemo(() => makeStyles2(t), [t]);
18777
+ const S4 = React41.useMemo(() => makeStyles2(t), [t]);
17825
18778
  const { blocks } = builder;
17826
18779
  const total = blocks.length;
17827
18780
  const idx = Math.min(Math.max(state.currentBlock, 0), Math.max(total - 1, 0));
@@ -17834,14 +18787,16 @@ function StepperBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUp
17834
18787
  if (state.validateBlock(idx)) state.setCurrentBlock(idx + 1);
17835
18788
  };
17836
18789
  const handleBack = () => state.setCurrentBlock(Math.max(idx - 1, 0));
17837
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: disabled ? __spreadValues(__spreadValues({}, S4.card), S4.inert) : S4.card, children: [
18790
+ const cardStyle2 = dense ? { display: "flex", flexDirection: "column", height: "100%", minHeight: 0, width: "100%", minWidth: 0, boxSizing: "border-box", overflow: "hidden" } : S4.card;
18791
+ const headerStyle = dense ? { flexShrink: 0, padding: "0 0 10px" } : S4.header;
18792
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: cardStyle2, children: [
17838
18793
  /* @__PURE__ */ jsxRuntime.jsx("style", { children: "@keyframes agStepFade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}" }),
17839
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S4.header, children: [
17840
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [
18794
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: headerStyle, children: [
18795
+ !dense && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [
17841
18796
  /* @__PURE__ */ jsxRuntime.jsx("p", { style: S4.title, children: builder.title }),
17842
18797
  builder.description && /* @__PURE__ */ jsxRuntime.jsx("p", { style: S4.subtitle, children: builder.description })
17843
18798
  ] }),
17844
- !disabled && total > 1 && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "6px", marginTop: "10px" }, children: [
18799
+ !disabled && total > 1 && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "6px", marginTop: dense ? 0 : "10px" }, children: [
17845
18800
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "baseline", justifyContent: "space-between", gap: "10px" }, children: [
17846
18801
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: S4.currentTitle, children: (block == null ? void 0 : block.title) || `Step ${idx + 1}` }),
17847
18802
  /* @__PURE__ */ jsxRuntime.jsxs("span", { style: S4.stepCount, children: [
@@ -17854,7 +18809,7 @@ function StepperBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUp
17854
18809
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: S4.progressTrack, role: "progressbar", "aria-valuenow": pct, "aria-valuemin": 0, "aria-valuemax": 100, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: __spreadProps(__spreadValues({}, S4.progressFill), { width: `${pct}%` }) }) })
17855
18810
  ] })
17856
18811
  ] }),
17857
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: S4.body, children: block && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "12px", animation: "agStepFade 0.22s ease" }, children: [
18812
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: dense ? __spreadProps(__spreadValues({}, S4.body), { padding: "12px 0" }) : S4.body, children: block && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "12px", animation: "agStepFade 0.22s ease" }, children: [
17858
18813
  block.description && /* @__PURE__ */ jsxRuntime.jsx("div", { style: S4.blockDesc, children: block.description }),
17859
18814
  ((_a = block.context) == null ? void 0 : _a.type) && /* @__PURE__ */ jsxRuntime.jsx(ContextSlot, { payload: block.context }),
17860
18815
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: (block.fields || []).map((field) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -17865,12 +18820,13 @@ function StepperBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUp
17865
18820
  onChange: (v) => state.setFieldValue(block.id, field.name, v),
17866
18821
  disabled,
17867
18822
  error: state.getError(block.id, field.name),
18823
+ dense,
17868
18824
  onFileUpload
17869
18825
  },
17870
18826
  `${block.id}:${field.name}`
17871
18827
  )) })
17872
18828
  ] }, idx) }),
17873
- !disabled ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S4.footer, children: [
18829
+ !disabled ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: dense ? __spreadProps(__spreadValues({}, S4.footer), { borderTop: "none", background: "transparent", padding: "10px 0 0" }) : S4.footer, children: [
17874
18830
  !isFirst && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: handleBack, style: S4.cancelBtn, children: "Back" }),
17875
18831
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 } }),
17876
18832
  onCancel && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onCancel, style: S4.cancelBtn, children: builder.cancel_label || "Cancel" }),
@@ -17994,21 +18950,22 @@ function makeStyles2(t) {
17994
18950
 
17995
18951
  // src/builders/EscalationCard.tsx
17996
18952
  init_ThemeContext();
17997
- function EscalationCard({ builder, state, onSubmit, disabled, onFileUpload }) {
18953
+ function EscalationCard({ builder, state, onSubmit, disabled, onFileUpload, hideActions, dense }) {
17998
18954
  var _a;
17999
18955
  const t = useTheme();
18000
- const S4 = React33.useMemo(() => makeStyles3(t), [t]);
18956
+ const S4 = React41.useMemo(() => makeStyles3(t), [t]);
18001
18957
  const block = builder.blocks[0];
18002
18958
  if (!block) return null;
18003
18959
  if (disabled) return /* @__PURE__ */ jsxRuntime.jsx(BuilderRecap, { builder, state });
18004
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S4.card, children: [
18005
- builder.description && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "13px", color: "var(--foreground)", lineHeight: 1.45, margin: 0 }, children: builder.description }),
18960
+ const containerStyle = dense ? { display: "flex", flexDirection: "column", gap: "10px" } : S4.card;
18961
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle, children: [
18962
+ builder.description && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: dense ? "12px" : "13px", color: dense ? t.MUTED : "var(--foreground)", lineHeight: 1.45, margin: 0 }, children: builder.description }),
18006
18963
  ((_a = block.context) == null ? void 0 : _a.type) && /* @__PURE__ */ jsxRuntime.jsx(ContextSlot, { payload: block.context }),
18007
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: (block.fields || []).map((field) => /* @__PURE__ */ jsxRuntime.jsx(FieldRenderer, { field, value: state.getValue(block.id, field.name), onChange: (v) => state.setFieldValue(block.id, field.name, v), disabled, error: state.getError(block.id, field.name), onFileUpload }, `${block.id}:${field.name}`)) }),
18008
- !disabled ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", paddingTop: "2px" }, children: [
18964
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: dense ? "8px" : "10px" }, children: (block.fields || []).map((field) => /* @__PURE__ */ jsxRuntime.jsx(FieldRenderer, { field, value: state.getValue(block.id, field.name), onChange: (v) => state.setFieldValue(block.id, field.name, v), disabled, error: state.getError(block.id, field.name), onFileUpload, dense }, `${block.id}:${field.name}`)) }),
18965
+ disabled ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "11px", fontWeight: 600, color: t.MUTED, textAlign: "center", padding: "2px 0" }, children: "Submitted" }) : hideActions ? null : /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", paddingTop: "2px" }, children: [
18009
18966
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 } }),
18010
18967
  /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onSubmit, style: S4.continueBtn, children: builder.submit_label || "Continue" })
18011
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "11px", fontWeight: 600, color: t.MUTED, textAlign: "center", padding: "2px 0" }, children: "Submitted" })
18968
+ ] })
18012
18969
  ] });
18013
18970
  }
18014
18971
  function makeStyles3(t) {
@@ -18048,7 +19005,7 @@ function fieldKey(blockId, name) {
18048
19005
  }
18049
19006
  function useBuilderState(blocks) {
18050
19007
  const isMultiBlock = blocks.length > 1;
18051
- const [values, setValues] = React33.useState(() => {
19008
+ const [values, setValues] = React41.useState(() => {
18052
19009
  const init = {};
18053
19010
  for (const block of blocks) {
18054
19011
  for (const field of block.fields || []) {
@@ -18057,17 +19014,17 @@ function useBuilderState(blocks) {
18057
19014
  }
18058
19015
  return init;
18059
19016
  });
18060
- const [errors, setErrors] = React33.useState({});
18061
- const [currentBlock, setCurrentBlock] = React33.useState(0);
18062
- const getValue = React33.useCallback(
19017
+ const [errors, setErrors] = React41.useState({});
19018
+ const [currentBlock, setCurrentBlock] = React41.useState(0);
19019
+ const getValue = React41.useCallback(
18063
19020
  (blockId, name) => values[fieldKey(blockId, name)],
18064
19021
  [values]
18065
19022
  );
18066
- const getError = React33.useCallback(
19023
+ const getError = React41.useCallback(
18067
19024
  (blockId, name) => errors[fieldKey(blockId, name)],
18068
19025
  [errors]
18069
19026
  );
18070
- const setFieldValue = React33.useCallback((blockId, name, value) => {
19027
+ const setFieldValue = React41.useCallback((blockId, name, value) => {
18071
19028
  const k = fieldKey(blockId, name);
18072
19029
  setValues((prev) => __spreadProps(__spreadValues({}, prev), { [k]: value }));
18073
19030
  setErrors((prev) => {
@@ -18077,7 +19034,7 @@ function useBuilderState(blocks) {
18077
19034
  return next;
18078
19035
  });
18079
19036
  }, []);
18080
- const validateBlock = React33.useCallback(
19037
+ const validateBlock = React41.useCallback(
18081
19038
  (blockIdx) => {
18082
19039
  const block = blocks[blockIdx];
18083
19040
  if (!block) return true;
@@ -18111,7 +19068,7 @@ function useBuilderState(blocks) {
18111
19068
  },
18112
19069
  [blocks, values]
18113
19070
  );
18114
- const validateAll = React33.useCallback(() => {
19071
+ const validateAll = React41.useCallback(() => {
18115
19072
  let firstFailing = -1;
18116
19073
  const allErrors = {};
18117
19074
  for (let i = 0; i < blocks.length; i++) {
@@ -18142,24 +19099,47 @@ function useBuilderState(blocks) {
18142
19099
  isMultiBlock
18143
19100
  };
18144
19101
  }
18145
- function BuilderFormResolver({ builder, onSubmit, onCancel, disabled, onFileUpload }) {
19102
+ function BuilderFormResolver({
19103
+ builder,
19104
+ onSubmit,
19105
+ onCancel,
19106
+ disabled,
19107
+ onFileUpload,
19108
+ onChange,
19109
+ submitRef,
19110
+ hideActions,
19111
+ dense
19112
+ }) {
18146
19113
  const state = useBuilderState(builder.blocks);
18147
19114
  const kind = builder.builder_kind || "form";
18148
- const handleSubmit = React33.useCallback(() => {
18149
- if (disabled) return;
18150
- if (!state.validateAll()) return;
19115
+ const buildSubmission = React41.useCallback(() => {
18151
19116
  const blocks = (builder.blocks || []).map((b) => ({
18152
19117
  id: b.id,
18153
19118
  title: b.title,
18154
19119
  values: Object.fromEntries((b.fields || []).map((f) => [f.name, state.getValue(b.id, f.name)]))
18155
19120
  }));
18156
- const submission = __spreadValues({
19121
+ return __spreadValues({
18157
19122
  builder_id: builder.builder_id,
18158
19123
  builder_kind: kind,
18159
19124
  blocks
18160
19125
  }, blocks.length === 1 ? { values: blocks[0].values } : {});
18161
- onSubmit(submission);
18162
- }, [disabled, state, onSubmit, builder, kind]);
19126
+ }, [builder, kind, state.getValue]);
19127
+ const handleSubmit = React41.useCallback(() => {
19128
+ if (disabled) return;
19129
+ if (!state.validateAll()) return;
19130
+ onSubmit(buildSubmission());
19131
+ }, [disabled, state.validateAll, onSubmit, buildSubmission]);
19132
+ React41.useEffect(() => {
19133
+ if (!onChange) return;
19134
+ onChange(buildSubmission());
19135
+ }, [onChange, state.values]);
19136
+ React41.useEffect(() => {
19137
+ if (!submitRef) return;
19138
+ submitRef.current = handleSubmit;
19139
+ return () => {
19140
+ submitRef.current = null;
19141
+ };
19142
+ }, [submitRef, handleSubmit]);
18163
19143
  switch (kind) {
18164
19144
  case "stepper":
18165
19145
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -18170,7 +19150,8 @@ function BuilderFormResolver({ builder, onSubmit, onCancel, disabled, onFileUplo
18170
19150
  onSubmit: handleSubmit,
18171
19151
  onCancel,
18172
19152
  disabled,
18173
- onFileUpload
19153
+ onFileUpload,
19154
+ dense
18174
19155
  }
18175
19156
  );
18176
19157
  case "escalation":
@@ -18181,7 +19162,9 @@ function BuilderFormResolver({ builder, onSubmit, onCancel, disabled, onFileUplo
18181
19162
  state,
18182
19163
  onSubmit: handleSubmit,
18183
19164
  disabled,
18184
- onFileUpload
19165
+ onFileUpload,
19166
+ hideActions,
19167
+ dense
18185
19168
  }
18186
19169
  );
18187
19170
  default:
@@ -18193,13 +19176,15 @@ function BuilderFormResolver({ builder, onSubmit, onCancel, disabled, onFileUplo
18193
19176
  onSubmit: handleSubmit,
18194
19177
  onCancel,
18195
19178
  disabled,
18196
- onFileUpload
19179
+ onFileUpload,
19180
+ dense,
19181
+ hideActions
18197
19182
  }
18198
19183
  );
18199
19184
  }
18200
19185
  }
18201
19186
  function resolveBuilder(payload, callbacks) {
18202
- return React33__default.default.createElement(BuilderFormResolver, __spreadValues({
19187
+ return React41__default.default.createElement(BuilderFormResolver, __spreadValues({
18203
19188
  builder: payload
18204
19189
  }, callbacks));
18205
19190
  }
@@ -18219,14 +19204,17 @@ exports.ComparativeBarChartResolver = ComparativeBarChartResolver;
18219
19204
  exports.ComplianceChecklistResolver = ComplianceChecklistResolver;
18220
19205
  exports.ComponentActions = ComponentActions;
18221
19206
  exports.ContextSlot = ContextSlot;
19207
+ exports.DEFAULT_INTERACTION = DEFAULT_INTERACTION;
18222
19208
  exports.DataTableResolver = DataTableResolver;
18223
19209
  exports.DocumentPreviewResolver = DocumentPreviewResolver;
18224
19210
  exports.EngagementPipelineResolver = EngagementPipelineResolver;
18225
19211
  exports.FIELD_REGISTRY = FIELD_REGISTRY;
18226
19212
  exports.FieldRenderer = FieldRenderer;
18227
19213
  exports.FileCard = FileCard;
19214
+ exports.FitText = FitText;
18228
19215
  exports.FlowCanvasRenderer = FlowCanvasRenderer;
18229
19216
  exports.FlowCanvasResolver = FlowCanvasResolver;
19217
+ exports.GenUIInteractionProvider = GenUIInteractionProvider;
18230
19218
  exports.GenUIRenderer = GenUIRenderer;
18231
19219
  exports.GenUIThemeProvider = GenUIThemeProvider;
18232
19220
  exports.GroupedTableResolver = GroupedTableResolver;
@@ -18234,6 +19222,7 @@ exports.HeatmapTableResolver = HeatmapTableResolver;
18234
19222
  exports.JournalEntryResolver = JournalEntryResolver;
18235
19223
  exports.LegalTestResultResolver = LegalTestResultResolver;
18236
19224
  exports.Markdown = Markdown;
19225
+ exports.NUMERIC_CELL = NUMERIC_CELL;
18237
19226
  exports.NewsFeedResolver = NewsFeedResolver;
18238
19227
  exports.PreviewHost = PreviewHost;
18239
19228
  exports.PreviewModal = PreviewModal;
@@ -18245,10 +19234,13 @@ exports.SparklineTableResolver = SparklineTableResolver;
18245
19234
  exports.StackedBreakdownResolver = StackedBreakdownResolver;
18246
19235
  exports.StatGridResolver = StatGridResolver;
18247
19236
  exports.StatusCardResolver = StatusCardResolver;
19237
+ exports.TRUNCATE = TRUNCATE;
18248
19238
  exports.TabsPanelResolver = TabsPanelResolver;
18249
19239
  exports.TrialBalanceResolver = TrialBalanceResolver;
18250
19240
  exports.VarianceAnalysisResolver = VarianceAnalysisResolver;
18251
19241
  exports.WaterfallChartResolver = WaterfallChartResolver;
19242
+ exports.WorkflowStepperRenderer = WorkflowStepperRenderer;
19243
+ exports.WorkflowStepperResolver = WorkflowStepperResolver;
18252
19244
  exports.buildRenderUITool = buildRenderUITool;
18253
19245
  exports.builderBlockSchema = builderBlockSchema;
18254
19246
  exports.builderFieldSchema = builderFieldSchema;
@@ -18264,6 +19256,7 @@ exports.resolveBuilder = resolveBuilder;
18264
19256
  exports.resolveUI = resolveUI;
18265
19257
  exports.schemaRegistry = schemaRegistry;
18266
19258
  exports.useBuilderState = useBuilderState;
19259
+ exports.useGenUIInteraction = useGenUIInteraction;
18267
19260
  exports.useTheme = useTheme;
18268
19261
  exports.validateBuilderPayload = validateBuilderPayload;
18269
19262
  exports.validatePayload = validatePayload;