@flamingo-stack/openframe-frontend-core 0.0.339 → 0.0.340-snapshot.20260630012353

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/{chunk-IK22LSYP.js → chunk-2GROEWOK.js} +4 -4
  2. package/dist/{chunk-I7NP2ZAJ.js → chunk-4I46HAN5.js} +4 -4
  3. package/dist/{chunk-4DXRKAV6.cjs → chunk-A37AW6CD.cjs} +5 -5
  4. package/dist/{chunk-4DXRKAV6.cjs.map → chunk-A37AW6CD.cjs.map} +1 -1
  5. package/dist/{chunk-I54DGTLP.js → chunk-AZ3DTQU5.js} +211 -156
  6. package/dist/chunk-AZ3DTQU5.js.map +1 -0
  7. package/dist/{chunk-7OPVJDX6.cjs → chunk-BYAXSMET.cjs} +15 -15
  8. package/dist/{chunk-7OPVJDX6.cjs.map → chunk-BYAXSMET.cjs.map} +1 -1
  9. package/dist/{chunk-GBE2R7R4.cjs → chunk-CJB4NUD6.cjs} +7 -7
  10. package/dist/{chunk-GBE2R7R4.cjs.map → chunk-CJB4NUD6.cjs.map} +1 -1
  11. package/dist/{chunk-DLXHC6JS.js → chunk-CUQGK4AD.js} +2 -2
  12. package/dist/{chunk-D5BRTQEA.cjs → chunk-D2ETTYT2.cjs} +26 -26
  13. package/dist/{chunk-D5BRTQEA.cjs.map → chunk-D2ETTYT2.cjs.map} +1 -1
  14. package/dist/{chunk-742ZCG3D.js → chunk-EPVDWAVJ.js} +4 -4
  15. package/dist/{chunk-6YWPFPKC.cjs → chunk-EYPZ2XLX.cjs} +25 -25
  16. package/dist/{chunk-6YWPFPKC.cjs.map → chunk-EYPZ2XLX.cjs.map} +1 -1
  17. package/dist/{chunk-HHS3CJ7G.js → chunk-GCYEJLOQ.js} +2 -2
  18. package/dist/{chunk-PNWORHOR.cjs → chunk-I3CNFZOY.cjs} +670 -615
  19. package/dist/chunk-I3CNFZOY.cjs.map +1 -0
  20. package/dist/{chunk-JOLEA7LT.cjs → chunk-I4BWBQXX.cjs} +31 -31
  21. package/dist/{chunk-JOLEA7LT.cjs.map → chunk-I4BWBQXX.cjs.map} +1 -1
  22. package/dist/{chunk-DUJINSKJ.js → chunk-KE2QKKCN.js} +2 -2
  23. package/dist/{chunk-GEJQRRD2.js → chunk-KT4KY6OF.js} +4 -4
  24. package/dist/{chunk-DKK3VRRM.cjs → chunk-LANAE7MY.cjs} +12 -12
  25. package/dist/{chunk-DKK3VRRM.cjs.map → chunk-LANAE7MY.cjs.map} +1 -1
  26. package/dist/{chunk-S5B3ZX6U.js → chunk-N3GFEIWF.js} +2 -2
  27. package/dist/{chunk-J344NBBP.cjs → chunk-NIIN3UH4.cjs} +37 -37
  28. package/dist/{chunk-J344NBBP.cjs.map → chunk-NIIN3UH4.cjs.map} +1 -1
  29. package/dist/{chunk-OJJCWMLT.cjs → chunk-OGTHMZIL.cjs} +9 -9
  30. package/dist/{chunk-OJJCWMLT.cjs.map → chunk-OGTHMZIL.cjs.map} +1 -1
  31. package/dist/{chunk-5A5SLX2F.js → chunk-OLR534KB.js} +2 -2
  32. package/dist/{chunk-FFNTLQZR.cjs → chunk-QCREN5A5.cjs} +56 -56
  33. package/dist/{chunk-FFNTLQZR.cjs.map → chunk-QCREN5A5.cjs.map} +1 -1
  34. package/dist/{chunk-J7VJHE6O.js → chunk-QYF6LEDF.js} +2 -2
  35. package/dist/{chunk-KPR563UC.cjs → chunk-R3MVYKEL.cjs} +62 -62
  36. package/dist/{chunk-KPR563UC.cjs.map → chunk-R3MVYKEL.cjs.map} +1 -1
  37. package/dist/{chunk-YX7RIC4Z.js → chunk-Y2WHQSF6.js} +2 -2
  38. package/dist/components/case-studies/index.cjs +8 -8
  39. package/dist/components/case-studies/index.js +2 -2
  40. package/dist/components/chat/chat-quick-action-row.d.ts +5 -0
  41. package/dist/components/chat/chat-quick-action-row.d.ts.map +1 -1
  42. package/dist/components/chat/guide-welcome.d.ts +6 -1
  43. package/dist/components/chat/guide-welcome.d.ts.map +1 -1
  44. package/dist/components/chat/index.cjs +2 -2
  45. package/dist/components/chat/index.js +1 -1
  46. package/dist/components/contact/index.cjs +3 -3
  47. package/dist/components/contact/index.js +2 -2
  48. package/dist/components/docs/index.cjs +5 -5
  49. package/dist/components/docs/index.js +4 -4
  50. package/dist/components/embeds/index.cjs +3 -3
  51. package/dist/components/embeds/index.js +2 -2
  52. package/dist/components/faq/index.cjs +3 -3
  53. package/dist/components/faq/index.js +2 -2
  54. package/dist/components/features/index.cjs +2 -2
  55. package/dist/components/features/index.js +1 -1
  56. package/dist/components/help-center-pages/index.cjs +20 -20
  57. package/dist/components/help-center-pages/index.js +11 -11
  58. package/dist/components/index.cjs +121 -121
  59. package/dist/components/index.js +9 -9
  60. package/dist/components/navigation/index.cjs +2 -2
  61. package/dist/components/navigation/index.js +1 -1
  62. package/dist/components/onboarding-guides/index.cjs +5 -5
  63. package/dist/components/onboarding-guides/index.js +4 -4
  64. package/dist/components/related-content/index.cjs +3 -3
  65. package/dist/components/related-content/index.js +2 -2
  66. package/dist/components/tickets/index.cjs +5 -5
  67. package/dist/components/tickets/index.js +4 -4
  68. package/dist/components/ui/index.cjs +2 -2
  69. package/dist/components/ui/index.js +1 -1
  70. package/dist/components/ui/table/table-row.d.ts +1 -1
  71. package/dist/components/ui/table/table-row.d.ts.map +1 -1
  72. package/dist/components/ui/table/table.d.ts +1 -1
  73. package/dist/components/ui/table/table.d.ts.map +1 -1
  74. package/dist/components/ui/table/types.d.ts +16 -0
  75. package/dist/components/ui/table/types.d.ts.map +1 -1
  76. package/dist/components/ui/table/use-table-motion.d.ts +20 -0
  77. package/dist/components/ui/table/use-table-motion.d.ts.map +1 -0
  78. package/dist/index.cjs +2 -2
  79. package/dist/index.js +1 -1
  80. package/package.json +1 -1
  81. package/src/components/chat/chat-quick-action-row.tsx +9 -0
  82. package/src/components/chat/embeddable-chat.tsx +24 -3
  83. package/src/components/chat/guide-welcome.tsx +10 -1
  84. package/src/components/ui/table/table-row.tsx +16 -3
  85. package/src/components/ui/table/table.tsx +34 -15
  86. package/src/components/ui/table/types.ts +17 -0
  87. package/src/components/ui/table/use-table-motion.ts +48 -0
  88. package/dist/chunk-I54DGTLP.js.map +0 -1
  89. package/dist/chunk-PNWORHOR.cjs.map +0 -1
  90. /package/dist/{chunk-IK22LSYP.js.map → chunk-2GROEWOK.js.map} +0 -0
  91. /package/dist/{chunk-I7NP2ZAJ.js.map → chunk-4I46HAN5.js.map} +0 -0
  92. /package/dist/{chunk-DLXHC6JS.js.map → chunk-CUQGK4AD.js.map} +0 -0
  93. /package/dist/{chunk-742ZCG3D.js.map → chunk-EPVDWAVJ.js.map} +0 -0
  94. /package/dist/{chunk-HHS3CJ7G.js.map → chunk-GCYEJLOQ.js.map} +0 -0
  95. /package/dist/{chunk-DUJINSKJ.js.map → chunk-KE2QKKCN.js.map} +0 -0
  96. /package/dist/{chunk-GEJQRRD2.js.map → chunk-KT4KY6OF.js.map} +0 -0
  97. /package/dist/{chunk-S5B3ZX6U.js.map → chunk-N3GFEIWF.js.map} +0 -0
  98. /package/dist/{chunk-5A5SLX2F.js.map → chunk-OLR534KB.js.map} +0 -0
  99. /package/dist/{chunk-J7VJHE6O.js.map → chunk-QYF6LEDF.js.map} +0 -0
  100. /package/dist/{chunk-YX7RIC4Z.js.map → chunk-Y2WHQSF6.js.map} +0 -0
@@ -5672,6 +5672,10 @@ function ChipButton({ chip }) {
5672
5672
  {
5673
5673
  type: "button",
5674
5674
  onClick: chip.onSelect,
5675
+ onMouseEnter: chip.onHoverStart,
5676
+ onMouseLeave: chip.onHoverEnd,
5677
+ onFocus: chip.onHoverStart,
5678
+ onBlur: chip.onHoverEnd,
5675
5679
  className: "shrink-0 rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-ods-accent",
5676
5680
  children: /* @__PURE__ */ jsx30(Tag, { variant: chip.variant ?? "outline", icon: chip.icon, label: chip.label })
5677
5681
  }
@@ -6577,6 +6581,8 @@ function GuideWelcome({
6577
6581
  subtitleLoading = false,
6578
6582
  quickActions = [],
6579
6583
  onQuickAction,
6584
+ onQuickActionHover,
6585
+ onQuickActionHoverEnd,
6580
6586
  children,
6581
6587
  className
6582
6588
  }) {
@@ -6603,9 +6609,11 @@ function GuideWelcome({
6603
6609
  () => quickActions.map((action) => ({
6604
6610
  id: action.id,
6605
6611
  label: action.label,
6606
- onSelect: () => onQuickAction?.(action)
6612
+ onSelect: () => onQuickAction?.(action),
6613
+ onHoverStart: () => onQuickActionHover?.(action),
6614
+ onHoverEnd: () => onQuickActionHoverEnd?.()
6607
6615
  })),
6608
- [quickActions, onQuickAction]
6616
+ [quickActions, onQuickAction, onQuickActionHover, onQuickActionHoverEnd]
6609
6617
  );
6610
6618
  return /* @__PURE__ */ jsxs32(
6611
6619
  "div",
@@ -10977,7 +10985,7 @@ function OnboardingGuideCard({
10977
10985
  }
10978
10986
 
10979
10987
  // src/components/chat/entity-cards/roadmap-card.tsx
10980
- import { useState as useState97 } from "react";
10988
+ import { useState as useState98 } from "react";
10981
10989
  import { ThumbsUp, ThumbsDown } from "lucide-react";
10982
10990
 
10983
10991
  // src/components/chat/entity-cards/roadmap-vote-button.tsx
@@ -11018,7 +11026,7 @@ function RoadmapVoteButton({
11018
11026
  init_button();
11019
11027
 
11020
11028
  // src/components/ui/image-gallery-modal.tsx
11021
- import { useState as useState96, useEffect as useEffect73 } from "react";
11029
+ import { useState as useState97, useEffect as useEffect74 } from "react";
11022
11030
 
11023
11031
  // src/components/ui/allowed-domains-input.tsx
11024
11032
  init_cn();
@@ -35132,7 +35140,7 @@ var ListLoader = (props) => /* @__PURE__ */ jsx274(ContentLoader, { ...props, va
35132
35140
 
35133
35141
  // src/components/ui/table/table.tsx
35134
35142
  init_cn();
35135
- import { useEffect as useEffect66, useRef as useRef48 } from "react";
35143
+ import { useEffect as useEffect67, useRef as useRef48 } from "react";
35136
35144
  init_pagination();
35137
35145
  init_button2();
35138
35146
 
@@ -35645,9 +35653,14 @@ function TableRow({
35645
35653
  compact,
35646
35654
  selectable,
35647
35655
  selected,
35648
- onSelect
35656
+ onSelect,
35657
+ animateRowReorder,
35658
+ motionDiv
35649
35659
  }) {
35650
35660
  const isLinkMode = Boolean(href) && !onClick;
35661
+ const animate = Boolean(animateRowReorder && motionDiv);
35662
+ const Row = animate ? motionDiv : "div";
35663
+ const motionProps = animate ? { layout: "position", transition: { layout: { duration: 0.35, ease: [0.22, 1, 0.36, 1] } } } : {};
35651
35664
  const handleRowClick = (e) => {
35652
35665
  const target = e.target;
35653
35666
  if (target.closest("[data-no-row-click]")) {
@@ -35683,8 +35696,9 @@ function TableRow({
35683
35696
  return String(value);
35684
35697
  };
35685
35698
  return /* @__PURE__ */ jsxs226(
35686
- "div",
35699
+ Row,
35687
35700
  {
35701
+ ...motionProps,
35688
35702
  className: cn(
35689
35703
  "relative rounded-[6px] bg-ods-card border border-ods-border overflow-hidden",
35690
35704
  (onClick || isLinkMode) && "cursor-pointer hover:bg-ods-bg-active transition-colors",
@@ -35736,6 +35750,24 @@ function TableRow({
35736
35750
  );
35737
35751
  }
35738
35752
 
35753
+ // src/components/ui/table/use-table-motion.ts
35754
+ import { useEffect as useEffect66, useState as useState85 } from "react";
35755
+ function useTableMotion(enabled) {
35756
+ const [runtime, setRuntime] = useState85(null);
35757
+ useEffect66(() => {
35758
+ if (!enabled || runtime) return;
35759
+ let active = true;
35760
+ import("framer-motion").then((m) => {
35761
+ if (active) setRuntime({ motionDiv: m.motion.div, LayoutGroup: m.LayoutGroup });
35762
+ }).catch(() => {
35763
+ });
35764
+ return () => {
35765
+ active = false;
35766
+ };
35767
+ }, [enabled, runtime]);
35768
+ return enabled ? runtime : null;
35769
+ }
35770
+
35739
35771
  // src/components/ui/table/table.tsx
35740
35772
  import { Fragment as Fragment50, jsx as jsx283, jsxs as jsxs227 } from "react/jsx-runtime";
35741
35773
  function injectSyntheticColumns(columns, rowActions, renderRowActions, rowHref) {
@@ -35821,8 +35853,10 @@ function Table({
35821
35853
  paginationClassName,
35822
35854
  infiniteScroll,
35823
35855
  stickyHeader,
35824
- stickyHeaderOffset
35856
+ stickyHeaderOffset,
35857
+ animateRowReorder
35825
35858
  }) {
35859
+ const tableMotion = useTableMotion(Boolean(animateRowReorder));
35826
35860
  const columnsWithActions = injectSyntheticColumns(columns, rowActions, renderRowActions, rowHref);
35827
35861
  const getRowHref = (item) => {
35828
35862
  if (onRowClick || !rowHref) return void 0;
@@ -35869,7 +35903,7 @@ function Table({
35869
35903
  const sentinelRef = useRef48(null);
35870
35904
  const onLoadMoreRef = useRef48(infiniteScroll?.onLoadMore);
35871
35905
  onLoadMoreRef.current = infiniteScroll?.onLoadMore;
35872
- useEffect66(() => {
35906
+ useEffect67(() => {
35873
35907
  if (!infiniteScroll?.hasNextPage || infiniteScroll.isFetchingNextPage) return;
35874
35908
  const sentinel = sentinelRef.current;
35875
35909
  if (!sentinel) return;
@@ -35938,22 +35972,28 @@ function Table({
35938
35972
  hasChevron: Boolean(rowHref)
35939
35973
  }
35940
35974
  ) : data.length === 0 ? /* @__PURE__ */ jsx283(TableEmptyState, { message: emptyMessage }) : /* @__PURE__ */ jsxs227(Fragment50, { children: [
35941
- data.map((item, index) => /* @__PURE__ */ jsx283(
35942
- TableRow,
35943
- {
35944
- item,
35945
- columns: columnsWithActions,
35946
- onClick: onRowClick,
35947
- href: getRowHref(item),
35948
- className: getRowClassName(item, index),
35949
- index,
35950
- compact,
35951
- selectable,
35952
- selected: isRowSelected(item),
35953
- onSelect: handleSelectRow
35954
- },
35955
- getRowKey(item, index)
35956
- )),
35975
+ (() => {
35976
+ const rows = data.map((item, index) => /* @__PURE__ */ jsx283(
35977
+ TableRow,
35978
+ {
35979
+ item,
35980
+ columns: columnsWithActions,
35981
+ onClick: onRowClick,
35982
+ href: getRowHref(item),
35983
+ className: getRowClassName(item, index),
35984
+ index,
35985
+ compact,
35986
+ selectable,
35987
+ selected: isRowSelected(item),
35988
+ onSelect: handleSelectRow,
35989
+ animateRowReorder,
35990
+ motionDiv: tableMotion?.motionDiv
35991
+ },
35992
+ getRowKey(item, index)
35993
+ ));
35994
+ const LayoutGroup = tableMotion?.LayoutGroup;
35995
+ return animateRowReorder && LayoutGroup ? /* @__PURE__ */ jsx283(LayoutGroup, { children: rows }) : rows;
35996
+ })(),
35957
35997
  infiniteScroll?.isFetchingNextPage && /* @__PURE__ */ jsx283(
35958
35998
  TableCardSkeleton,
35959
35999
  {
@@ -36081,7 +36121,7 @@ import { useMemo as useMemo34 } from "react";
36081
36121
 
36082
36122
  // src/components/ui/query-report-table/query-report-table-header.tsx
36083
36123
  init_cn();
36084
- import { useRef as useRef49, useState as useState85, useCallback as useCallback38 } from "react";
36124
+ import { useRef as useRef49, useState as useState86, useCallback as useCallback38 } from "react";
36085
36125
  import { jsx as jsx286, jsxs as jsxs229 } from "react/jsx-runtime";
36086
36126
  function QueryReportTableHeader({
36087
36127
  columns,
@@ -36111,7 +36151,7 @@ function QueryReportTableHeader({
36111
36151
  }
36112
36152
  function TruncatedHeaderCell({ value, width }) {
36113
36153
  const textRef = useRef49(null);
36114
- const [isTruncated, setIsTruncated] = useState85(false);
36154
+ const [isTruncated, setIsTruncated] = useState86(false);
36115
36155
  const checkTruncation = useCallback38(() => {
36116
36156
  const el = textRef.current;
36117
36157
  if (el) {
@@ -36140,7 +36180,7 @@ function TruncatedHeaderCell({ value, width }) {
36140
36180
 
36141
36181
  // src/components/ui/query-report-table/query-report-table-row.tsx
36142
36182
  init_cn();
36143
- import { useRef as useRef50, useState as useState86, useCallback as useCallback39 } from "react";
36183
+ import { useRef as useRef50, useState as useState87, useCallback as useCallback39 } from "react";
36144
36184
  import { jsx as jsx287, jsxs as jsxs230 } from "react/jsx-runtime";
36145
36185
  function QueryReportTableRow({
36146
36186
  row,
@@ -36187,7 +36227,7 @@ function QueryReportTableRow({
36187
36227
  }
36188
36228
  function TruncatedCell({ value, className }) {
36189
36229
  const textRef = useRef50(null);
36190
- const [isTruncated, setIsTruncated] = useState86(false);
36230
+ const [isTruncated, setIsTruncated] = useState87(false);
36191
36231
  const checkTruncation = useCallback39(() => {
36192
36232
  const el = textRef.current;
36193
36233
  if (el) {
@@ -36936,7 +36976,7 @@ function DataTableBody({
36936
36976
  }
36937
36977
 
36938
36978
  // src/components/ui/data-table/data-table-infinite-footer.tsx
36939
- import { useEffect as useEffect67, useRef as useRef52 } from "react";
36979
+ import { useEffect as useEffect68, useRef as useRef52 } from "react";
36940
36980
  import { Fragment as Fragment54, jsx as jsx297, jsxs as jsxs238 } from "react/jsx-runtime";
36941
36981
  function DataTableInfiniteFooter({
36942
36982
  hasNextPage,
@@ -36948,7 +36988,7 @@ function DataTableInfiniteFooter({
36948
36988
  const sentinelRef = useRef52(null);
36949
36989
  const onLoadMoreRef = useRef52(onLoadMore);
36950
36990
  onLoadMoreRef.current = onLoadMore;
36951
- useEffect67(() => {
36991
+ useEffect68(() => {
36952
36992
  if (!hasNextPage || isFetchingNextPage) return;
36953
36993
  const sentinel = sentinelRef.current;
36954
36994
  if (!sentinel) return;
@@ -37582,9 +37622,9 @@ function FilterList({
37582
37622
 
37583
37623
  // src/components/ui/tag-search-input.tsx
37584
37624
  import {
37585
- useEffect as useEffect69,
37625
+ useEffect as useEffect70,
37586
37626
  useRef as useRef54,
37587
- useState as useState88
37627
+ useState as useState89
37588
37628
  } from "react";
37589
37629
  init_cn();
37590
37630
  import { jsx as jsx301, jsxs as jsxs242 } from "react/jsx-runtime";
@@ -37621,8 +37661,8 @@ function TagSearchInput({
37621
37661
  const wrapperRef = useRef54(null);
37622
37662
  const hiddenTagsRef = useRef54(null);
37623
37663
  const hiddenTagsPopupRef = useRef54(null);
37624
- const [showHiddenTags, setShowHiddenTags] = useState88(false);
37625
- useEffect69(() => {
37664
+ const [showHiddenTags, setShowHiddenTags] = useState89(false);
37665
+ useEffect70(() => {
37626
37666
  if (!showHiddenTags) return;
37627
37667
  const handleClick = (e) => {
37628
37668
  const target = e.target;
@@ -37777,7 +37817,7 @@ function TagSearchInput({
37777
37817
  }
37778
37818
 
37779
37819
  // src/components/ui/markdown-editor.tsx
37780
- import { useRef as useRef55, useCallback as useCallback42, useState as useState89, useEffect as useEffect70 } from "react";
37820
+ import { useRef as useRef55, useCallback as useCallback42, useState as useState90, useEffect as useEffect71 } from "react";
37781
37821
  init_cn();
37782
37822
  import { Loader2 as Loader29, Upload as Upload8 } from "lucide-react";
37783
37823
  import { jsx as jsx302, jsxs as jsxs243 } from "react/jsx-runtime";
@@ -37808,7 +37848,7 @@ body .w-md-editor .w-md-editor-bar::after { content: '' !important; display: blo
37808
37848
  body .w-md-editor .w-md-editor-bar:hover::after { border-color: var(--color-text-secondary) !important; }
37809
37849
  `;
37810
37850
  function MarkdownEditorStyles() {
37811
- useEffect70(() => {
37851
+ useEffect71(() => {
37812
37852
  if (document.getElementById(MARKDOWN_EDITOR_STYLE_ID)) return;
37813
37853
  const style = document.createElement("style");
37814
37854
  style.id = MARKDOWN_EDITOR_STYLE_ID;
@@ -37833,10 +37873,10 @@ function MarkdownEditor({
37833
37873
  renderPreview
37834
37874
  }) {
37835
37875
  const fileInputRef = useRef55(null);
37836
- const [isUploading, setIsUploading] = useState89(false);
37837
- const [uploadProgress, setUploadProgress] = useState89("");
37838
- const [defaultExtraCommands, setDefaultExtraCommands] = useState89([]);
37839
- useEffect70(() => {
37876
+ const [isUploading, setIsUploading] = useState90(false);
37877
+ const [uploadProgress, setUploadProgress] = useState90("");
37878
+ const [defaultExtraCommands, setDefaultExtraCommands] = useState90([]);
37879
+ useEffect71(() => {
37840
37880
  import("@uiw/react-md-editor").then((mod) => {
37841
37881
  if (mod.commands?.getExtraCommands) {
37842
37882
  setDefaultExtraCommands(mod.commands.getExtraCommands());
@@ -37959,7 +37999,7 @@ function MarkdownEditor({
37959
37999
  }
37960
38000
  rafRef.current = requestAnimationFrame(scrollLoop);
37961
38001
  }, []);
37962
- useEffect70(() => {
38002
+ useEffect71(() => {
37963
38003
  const wrapper = wrapperRef.current;
37964
38004
  if (!wrapper) return;
37965
38005
  const onMouseMove = (e) => {
@@ -39441,8 +39481,8 @@ function ImageGalleryModal({
39441
39481
  onClose,
39442
39482
  initialIndex = 0
39443
39483
  }) {
39444
- const [selectedImageIndex, setSelectedImageIndex] = useState96(initialIndex);
39445
- useEffect73(() => {
39484
+ const [selectedImageIndex, setSelectedImageIndex] = useState97(initialIndex);
39485
+ useEffect74(() => {
39446
39486
  if (isOpen) {
39447
39487
  setSelectedImageIndex(initialIndex);
39448
39488
  }
@@ -39457,7 +39497,7 @@ function ImageGalleryModal({
39457
39497
  setSelectedImageIndex(selectedImageIndex + 1);
39458
39498
  }
39459
39499
  };
39460
- useEffect73(() => {
39500
+ useEffect74(() => {
39461
39501
  const handleKeyPress = (event) => {
39462
39502
  if (!isOpen) return;
39463
39503
  switch (event.key) {
@@ -39660,7 +39700,7 @@ function RoadmapCard({
39660
39700
  onVote,
39661
39701
  isVoting = false
39662
39702
  }) {
39663
- const [showScreenshots, setShowScreenshots] = useState97(false);
39703
+ const [showScreenshots, setShowScreenshots] = useState98(false);
39664
39704
  const logoUrl = item.icon && item.icon.startsWith("http") ? item.icon : null;
39665
39705
  const iconSrc = logoUrl ? getProxiedImageUrl(logoUrl, { directHttps: true }) || logoUrl : null;
39666
39706
  if (size === "sm") {
@@ -40296,7 +40336,7 @@ function DataRoomDocCardSkeleton({ className }) {
40296
40336
  }
40297
40337
 
40298
40338
  // src/components/chat/entity-cards/program-card.tsx
40299
- import { useState as useState98 } from "react";
40339
+ import { useState as useState99 } from "react";
40300
40340
 
40301
40341
  // node_modules/date-fns/toDate.mjs
40302
40342
  function toDate(argument) {
@@ -41933,8 +41973,8 @@ function getHosts(hosts) {
41933
41973
  return [];
41934
41974
  }
41935
41975
  function MediaGallery({ images, title }) {
41936
- const [selectedImageIndex, setSelectedImageIndex] = useState98(null);
41937
- const [isModalOpen, setIsModalOpen] = useState98(false);
41976
+ const [selectedImageIndex, setSelectedImageIndex] = useState99(null);
41977
+ const [isModalOpen, setIsModalOpen] = useState99(false);
41938
41978
  const openImageModal = (index, event) => {
41939
41979
  if (event) event.stopPropagation();
41940
41980
  setSelectedImageIndex(index);
@@ -43719,7 +43759,7 @@ function useChunkCatchup({
43719
43759
  }
43720
43760
 
43721
43761
  // src/components/chat/hooks/use-jetstream-dialog-subscription.ts
43722
- import { useEffect as useEffect74, useRef as useRef60, useState as useState99 } from "react";
43762
+ import { useEffect as useEffect75, useRef as useRef60, useState as useState100 } from "react";
43723
43763
  var DEFAULT_INACTIVE_THRESHOLD_MS = 5 * 6e4;
43724
43764
  var DEFAULT_STREAM_NAME = "CHAT_CHUNKS";
43725
43765
  function useJetStreamDialogSubscription({
@@ -43738,57 +43778,57 @@ function useJetStreamDialogSubscription({
43738
43778
  reconnectionBackoff,
43739
43779
  inactiveThresholdMs
43740
43780
  }) {
43741
- const [isConnected, setIsConnected] = useState99(false);
43742
- const [isSubscribed, setIsSubscribed] = useState99(false);
43743
- const [reconnectionCount, setReconnectionCount] = useState99(0);
43744
- const [currentStreamSeq, setCurrentStreamSeq] = useState99(null);
43781
+ const [isConnected, setIsConnected] = useState100(false);
43782
+ const [isSubscribed, setIsSubscribed] = useState100(false);
43783
+ const [reconnectionCount, setReconnectionCount] = useState100(0);
43784
+ const [currentStreamSeq, setCurrentStreamSeq] = useState100(null);
43745
43785
  const clientRef = useRef60(null);
43746
43786
  const subscriptionRef = useRef60(null);
43747
43787
  const highestStreamSeqRef = useRef60(null);
43748
43788
  const onEventRef = useRef60(onEvent);
43749
- useEffect74(() => {
43789
+ useEffect75(() => {
43750
43790
  onEventRef.current = onEvent;
43751
43791
  }, [onEvent]);
43752
43792
  const onConnectRef = useRef60(onConnect);
43753
- useEffect74(() => {
43793
+ useEffect75(() => {
43754
43794
  onConnectRef.current = onConnect;
43755
43795
  }, [onConnect]);
43756
43796
  const onDisconnectRef = useRef60(onDisconnect);
43757
- useEffect74(() => {
43797
+ useEffect75(() => {
43758
43798
  onDisconnectRef.current = onDisconnect;
43759
43799
  }, [onDisconnect]);
43760
43800
  const onSubscribedRef = useRef60(onSubscribed);
43761
- useEffect74(() => {
43801
+ useEffect75(() => {
43762
43802
  onSubscribedRef.current = onSubscribed;
43763
43803
  }, [onSubscribed]);
43764
43804
  const onBeforeReconnectRef = useRef60(onBeforeReconnect);
43765
- useEffect74(() => {
43805
+ useEffect75(() => {
43766
43806
  onBeforeReconnectRef.current = onBeforeReconnect;
43767
43807
  }, [onBeforeReconnect]);
43768
43808
  const getNatsWsUrlRef = useRef60(getNatsWsUrl);
43769
- useEffect74(() => {
43809
+ useEffect75(() => {
43770
43810
  getNatsWsUrlRef.current = getNatsWsUrl;
43771
43811
  }, [getNatsWsUrl]);
43772
43812
  const reconnectionBackoffRef = useRef60(reconnectionBackoff);
43773
- useEffect74(() => {
43813
+ useEffect75(() => {
43774
43814
  reconnectionBackoffRef.current = reconnectionBackoff;
43775
43815
  }, [reconnectionBackoff]);
43776
43816
  const optStartSeqRef = useRef60(optStartSeq);
43777
- useEffect74(() => {
43817
+ useEffect75(() => {
43778
43818
  optStartSeqRef.current = optStartSeq;
43779
43819
  }, [optStartSeq]);
43780
43820
  const inactiveThresholdRef = useRef60(inactiveThresholdMs);
43781
- useEffect74(() => {
43821
+ useEffect75(() => {
43782
43822
  inactiveThresholdRef.current = inactiveThresholdMs;
43783
43823
  }, [inactiveThresholdMs]);
43784
43824
  const hadConnectionBeforeRef = useRef60(false);
43785
43825
  const clientConfigRef = useRef60(clientConfig);
43786
- useEffect74(() => {
43826
+ useEffect75(() => {
43787
43827
  clientConfigRef.current = clientConfig;
43788
43828
  }, [clientConfig]);
43789
43829
  const currentWsUrlRef = useRef60("");
43790
43830
  const wsUrl = getNatsWsUrl();
43791
- useEffect74(() => {
43831
+ useEffect75(() => {
43792
43832
  if (!enabled || !wsUrl) {
43793
43833
  if (currentWsUrlRef.current && clientRef.current) {
43794
43834
  releaseClient(currentWsUrlRef.current);
@@ -43869,7 +43909,7 @@ function useJetStreamDialogSubscription({
43869
43909
  }
43870
43910
  };
43871
43911
  }, [enabled, wsUrl]);
43872
- useEffect74(() => {
43912
+ useEffect75(() => {
43873
43913
  if (!enabled || !dialogId || !isConnected) {
43874
43914
  if (subscriptionRef.current) {
43875
43915
  try {
@@ -43952,7 +43992,7 @@ function useJetStreamDialogSubscription({
43952
43992
  setIsSubscribed(false);
43953
43993
  };
43954
43994
  }, [enabled, dialogId, isConnected, streamName, topic, reconnectionCount]);
43955
- useEffect74(() => {
43995
+ useEffect75(() => {
43956
43996
  highestStreamSeqRef.current = null;
43957
43997
  setCurrentStreamSeq(null);
43958
43998
  }, [dialogId]);
@@ -43960,7 +44000,7 @@ function useJetStreamDialogSubscription({
43960
44000
  }
43961
44001
 
43962
44002
  // src/components/chat/hooks/use-nats-dialog-subscription.ts
43963
- import { useEffect as useEffect75, useRef as useRef61, useState as useState100 } from "react";
44003
+ import { useEffect as useEffect76, useRef as useRef61, useState as useState101 } from "react";
43964
44004
  function useNatsDialogSubscription({
43965
44005
  enabled,
43966
44006
  dialogId,
@@ -43974,47 +44014,47 @@ function useNatsDialogSubscription({
43974
44014
  clientConfig = {},
43975
44015
  reconnectionBackoff
43976
44016
  }) {
43977
- const [isConnected, setIsConnected] = useState100(false);
43978
- const [isSubscribed, setIsSubscribed] = useState100(false);
43979
- const [reconnectionCount, setReconnectionCount] = useState100(0);
44017
+ const [isConnected, setIsConnected] = useState101(false);
44018
+ const [isSubscribed, setIsSubscribed] = useState101(false);
44019
+ const [reconnectionCount, setReconnectionCount] = useState101(0);
43980
44020
  const clientRef = useRef61(null);
43981
44021
  const subscriptionRefs = useRef61(/* @__PURE__ */ new Map());
43982
44022
  const onEventRef = useRef61(onEvent);
43983
- useEffect75(() => {
44023
+ useEffect76(() => {
43984
44024
  onEventRef.current = onEvent;
43985
44025
  }, [onEvent]);
43986
44026
  const onConnectRef = useRef61(onConnect);
43987
- useEffect75(() => {
44027
+ useEffect76(() => {
43988
44028
  onConnectRef.current = onConnect;
43989
44029
  }, [onConnect]);
43990
44030
  const onDisconnectRef = useRef61(onDisconnect);
43991
- useEffect75(() => {
44031
+ useEffect76(() => {
43992
44032
  onDisconnectRef.current = onDisconnect;
43993
44033
  }, [onDisconnect]);
43994
44034
  const onSubscribedRef = useRef61(onSubscribed);
43995
- useEffect75(() => {
44035
+ useEffect76(() => {
43996
44036
  onSubscribedRef.current = onSubscribed;
43997
44037
  }, [onSubscribed]);
43998
44038
  const onBeforeReconnectRef = useRef61(onBeforeReconnect);
43999
- useEffect75(() => {
44039
+ useEffect76(() => {
44000
44040
  onBeforeReconnectRef.current = onBeforeReconnect;
44001
44041
  }, [onBeforeReconnect]);
44002
44042
  const hadConnectionBeforeRef = useRef61(false);
44003
44043
  const getNatsWsUrlRef = useRef61(getNatsWsUrl);
44004
- useEffect75(() => {
44044
+ useEffect76(() => {
44005
44045
  getNatsWsUrlRef.current = getNatsWsUrl;
44006
44046
  }, [getNatsWsUrl]);
44007
44047
  const reconnectionBackoffRef = useRef61(reconnectionBackoff);
44008
- useEffect75(() => {
44048
+ useEffect76(() => {
44009
44049
  reconnectionBackoffRef.current = reconnectionBackoff;
44010
44050
  }, [reconnectionBackoff]);
44011
44051
  const clientConfigRef = useRef61(clientConfig);
44012
- useEffect75(() => {
44052
+ useEffect76(() => {
44013
44053
  clientConfigRef.current = clientConfig;
44014
44054
  }, [clientConfig]);
44015
44055
  const currentWsUrlRef = useRef61("");
44016
44056
  const wsUrl = getNatsWsUrl();
44017
- useEffect75(() => {
44057
+ useEffect76(() => {
44018
44058
  if (!enabled || !wsUrl) {
44019
44059
  if (currentWsUrlRef.current && clientRef.current) {
44020
44060
  releaseClient(currentWsUrlRef.current);
@@ -44098,12 +44138,12 @@ function useNatsDialogSubscription({
44098
44138
  const topicsKey = topics.join(",");
44099
44139
  const lastSubscribedDialogIdRef = useRef61(null);
44100
44140
  const isConnectedRef = useRef61(isConnected);
44101
- useEffect75(() => {
44141
+ useEffect76(() => {
44102
44142
  isConnectedRef.current = isConnected;
44103
44143
  }, [isConnected]);
44104
44144
  const currentDialogIdRef = useRef61(null);
44105
44145
  const abortControllerRef = useRef61(null);
44106
- useEffect75(() => {
44146
+ useEffect76(() => {
44107
44147
  currentDialogIdRef.current = dialogId;
44108
44148
  if (!enabled || !dialogId) {
44109
44149
  if (subscriptionRefs.current.size > 0) {
@@ -44184,7 +44224,7 @@ function useNatsDialogSubscription({
44184
44224
  abortControllerRef.current = null;
44185
44225
  };
44186
44226
  }, [enabled, dialogId, topicsKey, topics]);
44187
- useEffect75(() => {
44227
+ useEffect76(() => {
44188
44228
  if (!enabled || !currentDialogIdRef.current || !isConnected) {
44189
44229
  return;
44190
44230
  }
@@ -44234,7 +44274,7 @@ function buildNatsWsUrl(apiBaseUrl, options) {
44234
44274
  }
44235
44275
 
44236
44276
  // src/components/chat/hooks/use-realtime-chunk-processor.ts
44237
- import { useCallback as useCallback45, useRef as useRef62, useEffect as useEffect76 } from "react";
44277
+ import { useCallback as useCallback45, useRef as useRef62, useEffect as useEffect77 } from "react";
44238
44278
 
44239
44279
  // src/components/chat/utils/chunk-parser.ts
44240
44280
  function normalizeToolCalls(raw) {
@@ -44892,7 +44932,7 @@ function useRealtimeChunkProcessor(options) {
44892
44932
  })
44893
44933
  );
44894
44934
  const hasInitializedWithData = useRef62(false);
44895
- useEffect76(() => {
44935
+ useEffect77(() => {
44896
44936
  if (initialState && !hasInitializedWithData.current) {
44897
44937
  accumulatorRef.current.initializeWithState(initialState);
44898
44938
  if (initialState.escalatedApprovals) {
@@ -44909,7 +44949,7 @@ function useRealtimeChunkProcessor(options) {
44909
44949
  const hasEverStreamedRef = useRef62(false);
44910
44950
  const directModeFlagRef = useRef62(isDirectMode);
44911
44951
  const sawDirectMessageRef = useRef62(false);
44912
- useEffect76(() => {
44952
+ useEffect77(() => {
44913
44953
  directModeFlagRef.current = isDirectMode;
44914
44954
  }, [isDirectMode]);
44915
44955
  const pendingEscalatedRef = useRef62(/* @__PURE__ */ new Map());
@@ -45170,7 +45210,7 @@ function useRealtimeChunkProcessor(options) {
45170
45210
  }
45171
45211
 
45172
45212
  // src/components/chat/hooks/use-slash-commands.ts
45173
- import { useEffect as useEffect77, useState as useState101 } from "react";
45213
+ import { useEffect as useEffect78, useState as useState102 } from "react";
45174
45214
  import { useQuery as useQuery2 } from "@tanstack/react-query";
45175
45215
  async function fetchSlashCommands(prefix, signal, commandsUrl) {
45176
45216
  try {
@@ -45187,9 +45227,9 @@ async function fetchSlashCommands(prefix, signal, commandsUrl) {
45187
45227
  }
45188
45228
  }
45189
45229
  function useSlashCommands(prefix, commandsUrl) {
45190
- const [commands, setCommands] = useState101([]);
45191
- const [loading, setLoading] = useState101(false);
45192
- useEffect77(() => {
45230
+ const [commands, setCommands] = useState102([]);
45231
+ const [loading, setLoading] = useState102(false);
45232
+ useEffect78(() => {
45193
45233
  if (prefix == null) {
45194
45234
  setCommands([]);
45195
45235
  return;
@@ -45289,7 +45329,7 @@ function useEmptyStateConfig(emptyStateUrl, options) {
45289
45329
  }
45290
45330
 
45291
45331
  // src/components/chat/hooks/use-chat-attachments.ts
45292
- import { useCallback as useCallback46, useMemo as useMemo38, useRef as useRef63, useState as useState102 } from "react";
45332
+ import { useCallback as useCallback46, useMemo as useMemo38, useRef as useRef63, useState as useState103 } from "react";
45293
45333
  import { fileTypeFromBlob } from "file-type";
45294
45334
  var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
45295
45335
  var CHAT_ATTACHMENTS_FOLDER = "chat";
@@ -45365,7 +45405,7 @@ function uploadWithProgress(url, file, token, onProgress, signal) {
45365
45405
  function useChatAttachments() {
45366
45406
  const runtime = useRequiredChatRuntime();
45367
45407
  const uploadUrlEndpoint = runtime.endpoints.attachmentUploadUrl;
45368
- const [attachments, setAttachments] = useState102([]);
45408
+ const [attachments, setAttachments] = useState103([]);
45369
45409
  const controllersRef = useRef63(/* @__PURE__ */ new Map());
45370
45410
  const updateOne = useCallback46((id, patch) => {
45371
45411
  setAttachments((prev) => prev.map((a) => a.id === id ? { ...a, ...patch } : a));
@@ -45532,16 +45572,16 @@ function useChatAttachments() {
45532
45572
  }
45533
45573
 
45534
45574
  // src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
45535
- import { useCallback as useCallback47, useEffect as useEffect78, useRef as useRef64, useState as useState103 } from "react";
45575
+ import { useCallback as useCallback47, useEffect as useEffect79, useRef as useRef64, useState as useState104 } from "react";
45536
45576
  import { jsx as jsx326 } from "react/jsx-runtime";
45537
45577
  var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
45538
45578
  function useChatAttachmentImageGallery() {
45539
45579
  const runtime = useRequiredChatRuntime();
45540
45580
  const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
45541
45581
  const panelRef = useRef64(null);
45542
- const [state, setState] = useState103(CLOSED);
45582
+ const [state, setState] = useState104(CLOSED);
45543
45583
  const handleClose = useCallback47(() => setState(CLOSED), []);
45544
- useEffect78(() => {
45584
+ useEffect79(() => {
45545
45585
  const root = panelRef.current;
45546
45586
  if (!root) return;
45547
45587
  const onClick = (ev) => {
@@ -45587,7 +45627,7 @@ function absolutize(prefix) {
45587
45627
  }
45588
45628
 
45589
45629
  // src/components/chat/hooks/use-chat-identity.ts
45590
- import { createContext as createContext12, createElement as createElement2, useContext as useContext12, useEffect as useEffect79, useState as useState104 } from "react";
45630
+ import { createContext as createContext12, createElement as createElement2, useContext as useContext12, useEffect as useEffect80, useState as useState105 } from "react";
45591
45631
  var ANON_DEFAULTS = {
45592
45632
  authTier: "anon",
45593
45633
  source: null,
@@ -45598,9 +45638,9 @@ function useResolveChatIdentity(enabled) {
45598
45638
  const runtime = useRequiredChatRuntime();
45599
45639
  const url = runtime.endpoints.identityUrl;
45600
45640
  const proxyEmail = getEmbedProxyAuth()?.email ?? null;
45601
- const [data, setData] = useState104(ANON_DEFAULTS);
45602
- const [isLoading, setIsLoading] = useState104(enabled);
45603
- useEffect79(() => {
45641
+ const [data, setData] = useState105(ANON_DEFAULTS);
45642
+ const [isLoading, setIsLoading] = useState105(enabled);
45643
+ useEffect80(() => {
45604
45644
  if (!enabled) return;
45605
45645
  let cancelled = false;
45606
45646
  const ctrl = new AbortController();
@@ -45642,11 +45682,11 @@ function useChatIdentity() {
45642
45682
  }
45643
45683
 
45644
45684
  // src/components/chat/hooks/use-close-on-navigation.ts
45645
- import { useEffect as useEffect80, useRef as useRef65 } from "react";
45685
+ import { useEffect as useEffect81, useRef as useRef65 } from "react";
45646
45686
  function useCloseOnNavigation(close, pathname) {
45647
45687
  const prevPathnameRef = useRef65(null);
45648
45688
  const initializedRef = useRef65(false);
45649
- useEffect80(() => {
45689
+ useEffect81(() => {
45650
45690
  if (!initializedRef.current) {
45651
45691
  initializedRef.current = true;
45652
45692
  prevPathnameRef.current = pathname;
@@ -45660,13 +45700,13 @@ function useCloseOnNavigation(close, pathname) {
45660
45700
  }
45661
45701
 
45662
45702
  // src/components/chat/hooks/use-chat.ts
45663
- import { useState as useState106, useCallback as useCallback49, useEffect as useEffect81, useRef as useRef67 } from "react";
45703
+ import { useState as useState107, useCallback as useCallback49, useEffect as useEffect82, useRef as useRef67 } from "react";
45664
45704
 
45665
45705
  // src/components/chat/hooks/use-sse.ts
45666
- import { useState as useState105, useCallback as useCallback48, useRef as useRef66 } from "react";
45706
+ import { useState as useState106, useCallback as useCallback48, useRef as useRef66 } from "react";
45667
45707
  function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
45668
- const [isStreaming, setIsStreaming] = useState105(false);
45669
- const [error, setError] = useState105(null);
45708
+ const [isStreaming, setIsStreaming] = useState106(false);
45709
+ const [error, setError] = useState106(null);
45670
45710
  const abortControllerRef = useRef66(null);
45671
45711
  const fallbackStream = useCallback48(async function* () {
45672
45712
  throw new Error(
@@ -45733,12 +45773,12 @@ function useChat({
45733
45773
  initialMessages,
45734
45774
  onMessagesChange
45735
45775
  } = {}) {
45736
- const [messages, setMessages] = useState106(() => initialMessages ?? []);
45737
- const [isTyping, setIsTyping] = useState106(false);
45776
+ const [messages, setMessages] = useState107(() => initialMessages ?? []);
45777
+ const [isTyping, setIsTyping] = useState107(false);
45738
45778
  const currentAssistantSegmentsRef = useRef67([]);
45739
45779
  const onMessagesChangeRef = useRef67(onMessagesChange);
45740
45780
  onMessagesChangeRef.current = onMessagesChange;
45741
- useEffect81(() => {
45781
+ useEffect82(() => {
45742
45782
  onMessagesChangeRef.current?.(messages);
45743
45783
  }, [messages]);
45744
45784
  const {
@@ -46027,7 +46067,7 @@ function useChat({
46027
46067
  }
46028
46068
 
46029
46069
  // src/components/chat/hooks/use-sse-chat-adapter.ts
46030
- import { useState as useState107, useEffect as useEffect82, useCallback as useCallback50, useMemo as useMemo39, useRef as useRef68 } from "react";
46070
+ import { useState as useState108, useEffect as useEffect83, useCallback as useCallback50, useMemo as useMemo39, useRef as useRef68 } from "react";
46031
46071
  function createEmptyTurnMeta() {
46032
46072
  return {
46033
46073
  provider: null,
@@ -46362,8 +46402,8 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
46362
46402
  const metaMapRef = useRef68(/* @__PURE__ */ new Map());
46363
46403
  const messagesRef = useRef68(persistedRef.current.messages);
46364
46404
  const sendCountRef = useRef68(persistedRef.current.sendCount);
46365
- const [streamingPhase, setStreamingPhase] = useState107("idle");
46366
- const [metaTick, setMetaTick] = useState107(0);
46405
+ const [streamingPhase, setStreamingPhase] = useState108("idle");
46406
+ const [metaTick, setMetaTick] = useState108(0);
46367
46407
  const bumpMetaTick = useCallback50(() => setMetaTick((t) => t + 1), []);
46368
46408
  const streamFn = useMemo39(
46369
46409
  () => createDocStreamFn(
@@ -46551,7 +46591,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
46551
46591
  }
46552
46592
  }
46553
46593
  }, [chatClearMessages, source, bumpMetaTick]);
46554
- useEffect82(() => {
46594
+ useEffect83(() => {
46555
46595
  if (!isTyping && !isStreaming && streamingPhase !== "idle") {
46556
46596
  setStreamingPhase("idle");
46557
46597
  }
@@ -46633,10 +46673,10 @@ var noopRejectRequest = async (_id, _reason) => {
46633
46673
  // src/components/chat/hooks/use-nats-chat-adapter.ts
46634
46674
  import {
46635
46675
  useCallback as useCallback51,
46636
- useEffect as useEffect83,
46676
+ useEffect as useEffect84,
46637
46677
  useMemo as useMemo40,
46638
46678
  useRef as useRef69,
46639
- useState as useState108
46679
+ useState as useState109
46640
46680
  } from "react";
46641
46681
 
46642
46682
  // src/components/chat/utils/process-historical-messages.ts
@@ -47126,23 +47166,23 @@ function useNatsChatAdapter(config, options = {}) {
47126
47166
  modelLabel = null
47127
47167
  } = config;
47128
47168
  const isManagedMode = fetchDialogs !== void 0;
47129
- const [internalDialogId, setInternalDialogId] = useState108(null);
47169
+ const [internalDialogId, setInternalDialogId] = useState109(null);
47130
47170
  const dialogId = isManagedMode ? internalDialogId : controlledDialogId !== void 0 ? controlledDialogId : null;
47131
- const [messages, setMessages] = useState108([]);
47132
- const [streamingPhase, setStreamingPhase] = useState108("idle");
47133
- const [approvalStatuses, setApprovalStatuses] = useState108({});
47134
- const [dialogs, setDialogs] = useState108([]);
47135
- const [dialogsNextCursor, setDialogsNextCursor] = useState108(null);
47136
- const [isDialogsLoading, setIsDialogsLoading] = useState108(false);
47137
- const [dialogsError, setDialogsError] = useState108(false);
47138
- const [isCreatingDialog, setIsCreatingDialog] = useState108(false);
47139
- const [messagesNextCursor, setMessagesNextCursor] = useState108(null);
47140
- const [isMessagesLoading, setIsMessagesLoading] = useState108(false);
47141
- const [dialogTokenUsage, setDialogTokenUsage] = useState108(
47171
+ const [messages, setMessages] = useState109([]);
47172
+ const [streamingPhase, setStreamingPhase] = useState109("idle");
47173
+ const [approvalStatuses, setApprovalStatuses] = useState109({});
47174
+ const [dialogs, setDialogs] = useState109([]);
47175
+ const [dialogsNextCursor, setDialogsNextCursor] = useState109(null);
47176
+ const [isDialogsLoading, setIsDialogsLoading] = useState109(false);
47177
+ const [dialogsError, setDialogsError] = useState109(false);
47178
+ const [isCreatingDialog, setIsCreatingDialog] = useState109(false);
47179
+ const [messagesNextCursor, setMessagesNextCursor] = useState109(null);
47180
+ const [isMessagesLoading, setIsMessagesLoading] = useState109(false);
47181
+ const [dialogTokenUsage, setDialogTokenUsage] = useState109(
47142
47182
  null
47143
47183
  );
47144
- const [liveModel, setLiveModel] = useState108(null);
47145
- const [connectionState, setConnectionState] = useState108("connecting");
47184
+ const [liveModel, setLiveModel] = useState109(null);
47185
+ const [connectionState, setConnectionState] = useState109("connecting");
47146
47186
  const handleApprove = useCallback51(
47147
47187
  async (requestId) => {
47148
47188
  if (!approveRequestCallback) return;
@@ -47283,7 +47323,7 @@ function useNatsChatAdapter(config, options = {}) {
47283
47323
  ]
47284
47324
  );
47285
47325
  const prevDialogIdRef = useRef69(void 0);
47286
- useEffect83(() => {
47326
+ useEffect84(() => {
47287
47327
  if (prevDialogIdRef.current === dialogId) return;
47288
47328
  prevDialogIdRef.current = dialogId;
47289
47329
  historyLoadSeqRef.current += 1;
@@ -47297,7 +47337,7 @@ function useNatsChatAdapter(config, options = {}) {
47297
47337
  if (!active || !dialogId) return;
47298
47338
  void loadDialogHistory(dialogId);
47299
47339
  }, [active, dialogId, loadDialogHistory, resetAccumulator]);
47300
- useEffect83(() => {
47340
+ useEffect84(() => {
47301
47341
  if (!active || !dialogId) return;
47302
47342
  resetChunkTracking();
47303
47343
  startInitialBuffering();
@@ -47319,7 +47359,7 @@ function useNatsChatAdapter(config, options = {}) {
47319
47359
  setConnectionState("connected");
47320
47360
  }
47321
47361
  });
47322
- useEffect83(() => {
47362
+ useEffect84(() => {
47323
47363
  if (!active || !dialogId) {
47324
47364
  setConnectionState("connected");
47325
47365
  return;
@@ -47358,7 +47398,7 @@ function useNatsChatAdapter(config, options = {}) {
47358
47398
  const reloadDialogs = useCallback51(() => {
47359
47399
  void loadDialogsPage();
47360
47400
  }, [loadDialogsPage]);
47361
- useEffect83(() => {
47401
+ useEffect84(() => {
47362
47402
  if (!fetchDialogs) return;
47363
47403
  if (!active) return;
47364
47404
  if (initialDialogsLoadedRef.current) return;
@@ -47938,7 +47978,7 @@ function chatChipClass({ tone, density = "chip", extra }) {
47938
47978
  }
47939
47979
 
47940
47980
  // src/components/chat/embeddable-chat.tsx
47941
- import { useCallback as useCallback54, useEffect as useEffect84, useMemo as useMemo43, useRef as useRef71, useState as useState110 } from "react";
47981
+ import { useCallback as useCallback54, useEffect as useEffect85, useMemo as useMemo43, useRef as useRef71, useState as useState111 } from "react";
47942
47982
  import * as DialogPrimitive4 from "@radix-ui/react-dialog";
47943
47983
  import { usePreventScroll } from "@react-aria/overlays";
47944
47984
  import { isIOS } from "@react-aria/utils";
@@ -48019,7 +48059,7 @@ init_button2();
48019
48059
  import { FileText as FileText8, MessageSquare as MessageSquare3 } from "lucide-react";
48020
48060
 
48021
48061
  // src/components/chat/hooks/use-chat-dialog-manager.ts
48022
- import { useCallback as useCallback53, useMemo as useMemo42, useState as useState109 } from "react";
48062
+ import { useCallback as useCallback53, useMemo as useMemo42, useState as useState110 } from "react";
48023
48063
  function useChatDialogManager({
48024
48064
  dialogs,
48025
48065
  activeDialogId,
@@ -48030,8 +48070,8 @@ function useChatDialogManager({
48030
48070
  fetchArchivedDialogs,
48031
48071
  unarchiveDialog
48032
48072
  }) {
48033
- const [renameTarget, setRenameTarget] = useState109(null);
48034
- const [archiveTarget, setArchiveTarget] = useState109(null);
48073
+ const [renameTarget, setRenameTarget] = useState110(null);
48074
+ const [archiveTarget, setArchiveTarget] = useState110(null);
48035
48075
  const handleConfirmRename = useCallback53(
48036
48076
  (name) => {
48037
48077
  if (renameTarget) void renameDialog(renameTarget.id, name);
@@ -48054,10 +48094,10 @@ function useChatDialogManager({
48054
48094
  }
48055
48095
  setArchiveTarget(null);
48056
48096
  }, [archiveTarget, archiveDialog, activeDialogId, clearMessages]);
48057
- const [archiveOpen, setArchiveOpen] = useState109(false);
48058
- const [archivedDialogs, setArchivedDialogs] = useState109([]);
48059
- const [archivedCursor, setArchivedCursor] = useState109(null);
48060
- const [archivedLoading, setArchivedLoading] = useState109(false);
48097
+ const [archiveOpen, setArchiveOpen] = useState110(false);
48098
+ const [archivedDialogs, setArchivedDialogs] = useState110([]);
48099
+ const [archivedCursor, setArchivedCursor] = useState110(null);
48100
+ const [archivedLoading, setArchivedLoading] = useState110(false);
48061
48101
  const loadArchivedPage = useCallback53(
48062
48102
  async (cursor) => {
48063
48103
  if (!fetchArchivedDialogs) return;
@@ -48083,10 +48123,10 @@ function useChatDialogManager({
48083
48123
  void loadArchivedPage();
48084
48124
  }, [loadArchivedPage]);
48085
48125
  const closeArchive = useCallback53(() => setArchiveOpen(false), []);
48086
- const [viewingArchivedId, setViewingArchivedId] = useState109(
48126
+ const [viewingArchivedId, setViewingArchivedId] = useState110(
48087
48127
  null
48088
48128
  );
48089
- const [openingDialogId, setOpeningDialogId] = useState109(null);
48129
+ const [openingDialogId, setOpeningDialogId] = useState110(null);
48090
48130
  const handleSelectDialog = useCallback53(
48091
48131
  (id) => {
48092
48132
  setViewingArchivedId(null);
@@ -48105,7 +48145,7 @@ function useChatDialogManager({
48105
48145
  },
48106
48146
  [selectDialog]
48107
48147
  );
48108
- const [restoreTarget, setRestoreTarget] = useState109(null);
48148
+ const [restoreTarget, setRestoreTarget] = useState110(null);
48109
48149
  const handleConfirmRestore = useCallback53(async () => {
48110
48150
  if (restoreTarget) {
48111
48151
  try {
@@ -48356,7 +48396,7 @@ function SourceChips({
48356
48396
  onClose,
48357
48397
  onDiscuss
48358
48398
  }) {
48359
- const [expanded, setExpanded] = useState110(false);
48399
+ const [expanded, setExpanded] = useState111(false);
48360
48400
  if (cited.length === 0) {
48361
48401
  const fallback = uncited.slice(0, FALLBACK_TOP_RETRIEVED);
48362
48402
  if (fallback.length === 0) return null;
@@ -48455,7 +48495,7 @@ function EmbeddableChatInner({
48455
48495
  const commandsUrl = runtime.endpoints.commandsUrl;
48456
48496
  const { attachmentsEnabled, user: identityUser } = useChatIdentity();
48457
48497
  const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
48458
- useEffect84(() => {
48498
+ useEffect85(() => {
48459
48499
  if (process.env.NODE_ENV !== "production") {
48460
48500
  const hasOpen = open !== void 0;
48461
48501
  const hasHandler = onOpenChange !== void 0;
@@ -48471,13 +48511,13 @@ function EmbeddableChatInner({
48471
48511
  defaultProp: defaultOpen ?? false,
48472
48512
  onChange: onOpenChange
48473
48513
  });
48474
- const [autoFocusInput] = useState110(() => {
48514
+ const [autoFocusInput] = useState111(() => {
48475
48515
  if (typeof window === "undefined") return false;
48476
48516
  return !window.matchMedia("(pointer: coarse)").matches;
48477
48517
  });
48478
48518
  usePreventScroll({ isDisabled: !isOpen || shellLess });
48479
48519
  const navigatingAwayRef = useRef71(false);
48480
- useEffect84(() => {
48520
+ useEffect85(() => {
48481
48521
  if (!isOpen) return;
48482
48522
  if (shellLess) return;
48483
48523
  if (typeof window === "undefined") return;
@@ -48504,6 +48544,7 @@ function EmbeddableChatInner({
48504
48544
  };
48505
48545
  }, [isOpen, shellLess]);
48506
48546
  const chatInputRef = useRef71(null);
48547
+ const quickActionDraftRef = useRef71(null);
48507
48548
  const slashCommandsProp = useMemo43(
48508
48549
  () => ({
48509
48550
  fetchCommands: (prefix, signal) => fetchSlashCommands(prefix, signal, commandsUrl),
@@ -48546,7 +48587,7 @@ function EmbeddableChatInner({
48546
48587
  }, [mingoState, mingoDialogCapabilities, effectiveModes]);
48547
48588
  const hasMingoMode = !!effectiveModes.mingo || !!mingoState;
48548
48589
  const initialActiveMode = controlledActiveMode ?? defaultActiveMode ?? (effectiveModes.guide ? "guide" : "mingo");
48549
- const [uncontrolledActiveMode, setUncontrolledActiveMode] = useState110(initialActiveMode);
48590
+ const [uncontrolledActiveMode, setUncontrolledActiveMode] = useState111(initialActiveMode);
48550
48591
  const activeMode = controlledActiveMode ?? uncontrolledActiveMode;
48551
48592
  const handleActiveModeChange = useCallback54(
48552
48593
  (next) => {
@@ -48609,15 +48650,15 @@ function EmbeddableChatInner({
48609
48650
  const { panelRef: galleryPanelRef, modal: galleryModal } = useChatAttachmentImageGallery();
48610
48651
  const contextMaxItems = contextPicker?.maxItems ?? 10;
48611
48652
  const contextPickerForMode = activeMode === "mingo" ? contextPicker : void 0;
48612
- const [contextItems, setContextItems] = useState110([]);
48613
- const [contextPickerOpen, setContextPickerOpen] = useState110(false);
48614
- const [mentionQuery, setMentionQuery] = useState110(null);
48653
+ const [contextItems, setContextItems] = useState111([]);
48654
+ const [contextPickerOpen, setContextPickerOpen] = useState111(false);
48655
+ const [mentionQuery, setMentionQuery] = useState111(null);
48615
48656
  const mentionActiveRef = useRef71(false);
48616
- useEffect84(() => {
48657
+ useEffect85(() => {
48617
48658
  mentionActiveRef.current = mentionQuery !== null;
48618
48659
  }, [mentionQuery]);
48619
48660
  const mentionKeysRef = useRef71(/* @__PURE__ */ new Set());
48620
- useEffect84(() => {
48661
+ useEffect85(() => {
48621
48662
  setContextItems([]);
48622
48663
  setMentionQuery(null);
48623
48664
  mentionKeysRef.current.clear();
@@ -48821,7 +48862,7 @@ function EmbeddableChatInner({
48821
48862
  });
48822
48863
  const handleOpen = useCallback54(() => setIsOpen(true), [setIsOpen]);
48823
48864
  useCloseOnNavigation(handleNavigationClose, null);
48824
- useEffect84(() => {
48865
+ useEffect85(() => {
48825
48866
  const handler = (e) => {
48826
48867
  const detail = e.detail;
48827
48868
  if (!detail || detail.source !== source) return;
@@ -48877,7 +48918,7 @@ function EmbeddableChatInner({
48877
48918
  const uncited = sources.filter((s) => !seenOrder.has(s.index));
48878
48919
  return { cited, uncited };
48879
48920
  }, [lastAssistantMsg, chatLoading]);
48880
- const [portalHost, setPortalHost] = useState110(null);
48921
+ const [portalHost, setPortalHost] = useState111(null);
48881
48922
  const body = /* @__PURE__ */ jsxs265(PortalContainerContext.Provider, { value: portalHost, children: [
48882
48923
  /* @__PURE__ */ jsx329(
48883
48924
  "div",
@@ -49032,8 +49073,22 @@ function EmbeddableChatInner({
49032
49073
  ...guideWelcome,
49033
49074
  quickActions: guideWelcome?.quickActions ?? guideSuggestedActions,
49034
49075
  onQuickAction: (action) => {
49076
+ quickActionDraftRef.current = null;
49077
+ chatInputRef.current?.setValue("");
49035
49078
  handleSend(action.prompt ?? action.label);
49036
49079
  },
49080
+ onQuickActionHover: (action) => {
49081
+ if (quickActionDraftRef.current === null) {
49082
+ quickActionDraftRef.current = chatInputRef.current?.getValue() ?? "";
49083
+ }
49084
+ chatInputRef.current?.setValue(action.prompt ?? action.label);
49085
+ },
49086
+ onQuickActionHoverEnd: () => {
49087
+ if (quickActionDraftRef.current !== null) {
49088
+ chatInputRef.current?.setValue(quickActionDraftRef.current);
49089
+ quickActionDraftRef.current = null;
49090
+ }
49091
+ },
49037
49092
  children: (chipCommands.length > 0 || !commandsLoaded) && /* @__PURE__ */ jsxs265("div", { className: "shrink-0 overflow-hidden rounded-md border border-ods-border", children: [
49038
49093
  !commandsLoaded && chipCommands.length === 0 && SKELETON_ROW_VARIANTS.map((variant, i) => /* @__PURE__ */ jsx329(
49039
49094
  MingoOnboardingCardSkeleton,
@@ -50107,4 +50162,4 @@ export {
50107
50162
  FAE_AVATAR_DATA_URI,
50108
50163
  assets
50109
50164
  };
50110
- //# sourceMappingURL=chunk-I54DGTLP.js.map
50165
+ //# sourceMappingURL=chunk-AZ3DTQU5.js.map