@flamingo-stack/openframe-frontend-core 0.0.340 → 0.0.341

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 (93) hide show
  1. package/dist/{chunk-53MGSWCC.js → chunk-2GROEWOK.js} +4 -4
  2. package/dist/{chunk-GGFJ5OQ3.js → chunk-4I46HAN5.js} +4 -4
  3. package/dist/{chunk-DFFOCQFO.cjs → chunk-A37AW6CD.cjs} +5 -5
  4. package/dist/{chunk-DFFOCQFO.cjs.map → chunk-A37AW6CD.cjs.map} +1 -1
  5. package/dist/{chunk-NDHQG4I4.js → chunk-AZ3DTQU5.js} +186 -154
  6. package/dist/chunk-AZ3DTQU5.js.map +1 -0
  7. package/dist/{chunk-HVYR323G.cjs → chunk-BYAXSMET.cjs} +15 -15
  8. package/dist/{chunk-HVYR323G.cjs.map → chunk-BYAXSMET.cjs.map} +1 -1
  9. package/dist/{chunk-TVCBMR3N.cjs → chunk-CJB4NUD6.cjs} +7 -7
  10. package/dist/{chunk-TVCBMR3N.cjs.map → chunk-CJB4NUD6.cjs.map} +1 -1
  11. package/dist/{chunk-W7J46YKF.js → chunk-CUQGK4AD.js} +2 -2
  12. package/dist/{chunk-4K2M2WC4.cjs → chunk-D2ETTYT2.cjs} +26 -26
  13. package/dist/{chunk-4K2M2WC4.cjs.map → chunk-D2ETTYT2.cjs.map} +1 -1
  14. package/dist/{chunk-NC3DJLP5.js → chunk-EPVDWAVJ.js} +4 -4
  15. package/dist/{chunk-SIK5LBUN.cjs → chunk-EYPZ2XLX.cjs} +25 -25
  16. package/dist/{chunk-SIK5LBUN.cjs.map → chunk-EYPZ2XLX.cjs.map} +1 -1
  17. package/dist/{chunk-MNLQMAY3.js → chunk-GCYEJLOQ.js} +2 -2
  18. package/dist/{chunk-ERMMMQET.cjs → chunk-I3CNFZOY.cjs} +351 -319
  19. package/dist/chunk-I3CNFZOY.cjs.map +1 -0
  20. package/dist/{chunk-L6YX6D26.cjs → chunk-I4BWBQXX.cjs} +31 -31
  21. package/dist/{chunk-L6YX6D26.cjs.map → chunk-I4BWBQXX.cjs.map} +1 -1
  22. package/dist/{chunk-573LTCRV.js → chunk-KE2QKKCN.js} +2 -2
  23. package/dist/{chunk-T4SW6GOR.js → chunk-KT4KY6OF.js} +4 -4
  24. package/dist/{chunk-BMSJTLGO.cjs → chunk-LANAE7MY.cjs} +12 -12
  25. package/dist/{chunk-BMSJTLGO.cjs.map → chunk-LANAE7MY.cjs.map} +1 -1
  26. package/dist/{chunk-OVN265XQ.js → chunk-N3GFEIWF.js} +2 -2
  27. package/dist/{chunk-VA3GDVOV.cjs → chunk-NIIN3UH4.cjs} +37 -37
  28. package/dist/{chunk-VA3GDVOV.cjs.map → chunk-NIIN3UH4.cjs.map} +1 -1
  29. package/dist/{chunk-EXFHHZ2C.cjs → chunk-OGTHMZIL.cjs} +9 -9
  30. package/dist/{chunk-EXFHHZ2C.cjs.map → chunk-OGTHMZIL.cjs.map} +1 -1
  31. package/dist/{chunk-KE2PMD6A.js → chunk-OLR534KB.js} +2 -2
  32. package/dist/{chunk-DRO773DG.cjs → chunk-QCREN5A5.cjs} +56 -56
  33. package/dist/{chunk-DRO773DG.cjs.map → chunk-QCREN5A5.cjs.map} +1 -1
  34. package/dist/{chunk-7TENQYAJ.js → chunk-QYF6LEDF.js} +2 -2
  35. package/dist/{chunk-YEB5Z76W.cjs → chunk-R3MVYKEL.cjs} +62 -62
  36. package/dist/{chunk-YEB5Z76W.cjs.map → chunk-R3MVYKEL.cjs.map} +1 -1
  37. package/dist/{chunk-TOMTBXM7.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/index.cjs +2 -2
  41. package/dist/components/chat/index.js +1 -1
  42. package/dist/components/contact/index.cjs +3 -3
  43. package/dist/components/contact/index.js +2 -2
  44. package/dist/components/docs/index.cjs +5 -5
  45. package/dist/components/docs/index.js +4 -4
  46. package/dist/components/embeds/index.cjs +3 -3
  47. package/dist/components/embeds/index.js +2 -2
  48. package/dist/components/faq/index.cjs +3 -3
  49. package/dist/components/faq/index.js +2 -2
  50. package/dist/components/features/index.cjs +2 -2
  51. package/dist/components/features/index.js +1 -1
  52. package/dist/components/help-center-pages/index.cjs +20 -20
  53. package/dist/components/help-center-pages/index.js +11 -11
  54. package/dist/components/index.cjs +121 -121
  55. package/dist/components/index.js +9 -9
  56. package/dist/components/navigation/index.cjs +2 -2
  57. package/dist/components/navigation/index.js +1 -1
  58. package/dist/components/onboarding-guides/index.cjs +5 -5
  59. package/dist/components/onboarding-guides/index.js +4 -4
  60. package/dist/components/related-content/index.cjs +3 -3
  61. package/dist/components/related-content/index.js +2 -2
  62. package/dist/components/tickets/index.cjs +5 -5
  63. package/dist/components/tickets/index.js +4 -4
  64. package/dist/components/ui/index.cjs +2 -2
  65. package/dist/components/ui/index.js +1 -1
  66. package/dist/components/ui/table/table-row.d.ts +1 -1
  67. package/dist/components/ui/table/table-row.d.ts.map +1 -1
  68. package/dist/components/ui/table/table.d.ts +1 -1
  69. package/dist/components/ui/table/table.d.ts.map +1 -1
  70. package/dist/components/ui/table/types.d.ts +16 -0
  71. package/dist/components/ui/table/types.d.ts.map +1 -1
  72. package/dist/components/ui/table/use-table-motion.d.ts +20 -0
  73. package/dist/components/ui/table/use-table-motion.d.ts.map +1 -0
  74. package/dist/index.cjs +2 -2
  75. package/dist/index.js +1 -1
  76. package/package.json +1 -1
  77. package/src/components/ui/table/table-row.tsx +16 -3
  78. package/src/components/ui/table/table.tsx +34 -15
  79. package/src/components/ui/table/types.ts +17 -0
  80. package/src/components/ui/table/use-table-motion.ts +48 -0
  81. package/dist/chunk-ERMMMQET.cjs.map +0 -1
  82. package/dist/chunk-NDHQG4I4.js.map +0 -1
  83. /package/dist/{chunk-53MGSWCC.js.map → chunk-2GROEWOK.js.map} +0 -0
  84. /package/dist/{chunk-GGFJ5OQ3.js.map → chunk-4I46HAN5.js.map} +0 -0
  85. /package/dist/{chunk-W7J46YKF.js.map → chunk-CUQGK4AD.js.map} +0 -0
  86. /package/dist/{chunk-NC3DJLP5.js.map → chunk-EPVDWAVJ.js.map} +0 -0
  87. /package/dist/{chunk-MNLQMAY3.js.map → chunk-GCYEJLOQ.js.map} +0 -0
  88. /package/dist/{chunk-573LTCRV.js.map → chunk-KE2QKKCN.js.map} +0 -0
  89. /package/dist/{chunk-T4SW6GOR.js.map → chunk-KT4KY6OF.js.map} +0 -0
  90. /package/dist/{chunk-OVN265XQ.js.map → chunk-N3GFEIWF.js.map} +0 -0
  91. /package/dist/{chunk-KE2PMD6A.js.map → chunk-OLR534KB.js.map} +0 -0
  92. /package/dist/{chunk-7TENQYAJ.js.map → chunk-QYF6LEDF.js.map} +0 -0
  93. /package/dist/{chunk-TOMTBXM7.js.map → chunk-Y2WHQSF6.js.map} +0 -0
@@ -10985,7 +10985,7 @@ function OnboardingGuideCard({
10985
10985
  }
10986
10986
 
10987
10987
  // src/components/chat/entity-cards/roadmap-card.tsx
10988
- import { useState as useState97 } from "react";
10988
+ import { useState as useState98 } from "react";
10989
10989
  import { ThumbsUp, ThumbsDown } from "lucide-react";
10990
10990
 
10991
10991
  // src/components/chat/entity-cards/roadmap-vote-button.tsx
@@ -11026,7 +11026,7 @@ function RoadmapVoteButton({
11026
11026
  init_button();
11027
11027
 
11028
11028
  // src/components/ui/image-gallery-modal.tsx
11029
- import { useState as useState96, useEffect as useEffect73 } from "react";
11029
+ import { useState as useState97, useEffect as useEffect74 } from "react";
11030
11030
 
11031
11031
  // src/components/ui/allowed-domains-input.tsx
11032
11032
  init_cn();
@@ -35140,7 +35140,7 @@ var ListLoader = (props) => /* @__PURE__ */ jsx274(ContentLoader, { ...props, va
35140
35140
 
35141
35141
  // src/components/ui/table/table.tsx
35142
35142
  init_cn();
35143
- import { useEffect as useEffect66, useRef as useRef48 } from "react";
35143
+ import { useEffect as useEffect67, useRef as useRef48 } from "react";
35144
35144
  init_pagination();
35145
35145
  init_button2();
35146
35146
 
@@ -35653,9 +35653,14 @@ function TableRow({
35653
35653
  compact,
35654
35654
  selectable,
35655
35655
  selected,
35656
- onSelect
35656
+ onSelect,
35657
+ animateRowReorder,
35658
+ motionDiv
35657
35659
  }) {
35658
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] } } } : {};
35659
35664
  const handleRowClick = (e) => {
35660
35665
  const target = e.target;
35661
35666
  if (target.closest("[data-no-row-click]")) {
@@ -35691,8 +35696,9 @@ function TableRow({
35691
35696
  return String(value);
35692
35697
  };
35693
35698
  return /* @__PURE__ */ jsxs226(
35694
- "div",
35699
+ Row,
35695
35700
  {
35701
+ ...motionProps,
35696
35702
  className: cn(
35697
35703
  "relative rounded-[6px] bg-ods-card border border-ods-border overflow-hidden",
35698
35704
  (onClick || isLinkMode) && "cursor-pointer hover:bg-ods-bg-active transition-colors",
@@ -35744,6 +35750,24 @@ function TableRow({
35744
35750
  );
35745
35751
  }
35746
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
+
35747
35771
  // src/components/ui/table/table.tsx
35748
35772
  import { Fragment as Fragment50, jsx as jsx283, jsxs as jsxs227 } from "react/jsx-runtime";
35749
35773
  function injectSyntheticColumns(columns, rowActions, renderRowActions, rowHref) {
@@ -35829,8 +35853,10 @@ function Table({
35829
35853
  paginationClassName,
35830
35854
  infiniteScroll,
35831
35855
  stickyHeader,
35832
- stickyHeaderOffset
35856
+ stickyHeaderOffset,
35857
+ animateRowReorder
35833
35858
  }) {
35859
+ const tableMotion = useTableMotion(Boolean(animateRowReorder));
35834
35860
  const columnsWithActions = injectSyntheticColumns(columns, rowActions, renderRowActions, rowHref);
35835
35861
  const getRowHref = (item) => {
35836
35862
  if (onRowClick || !rowHref) return void 0;
@@ -35877,7 +35903,7 @@ function Table({
35877
35903
  const sentinelRef = useRef48(null);
35878
35904
  const onLoadMoreRef = useRef48(infiniteScroll?.onLoadMore);
35879
35905
  onLoadMoreRef.current = infiniteScroll?.onLoadMore;
35880
- useEffect66(() => {
35906
+ useEffect67(() => {
35881
35907
  if (!infiniteScroll?.hasNextPage || infiniteScroll.isFetchingNextPage) return;
35882
35908
  const sentinel = sentinelRef.current;
35883
35909
  if (!sentinel) return;
@@ -35946,22 +35972,28 @@ function Table({
35946
35972
  hasChevron: Boolean(rowHref)
35947
35973
  }
35948
35974
  ) : data.length === 0 ? /* @__PURE__ */ jsx283(TableEmptyState, { message: emptyMessage }) : /* @__PURE__ */ jsxs227(Fragment50, { children: [
35949
- data.map((item, index) => /* @__PURE__ */ jsx283(
35950
- TableRow,
35951
- {
35952
- item,
35953
- columns: columnsWithActions,
35954
- onClick: onRowClick,
35955
- href: getRowHref(item),
35956
- className: getRowClassName(item, index),
35957
- index,
35958
- compact,
35959
- selectable,
35960
- selected: isRowSelected(item),
35961
- onSelect: handleSelectRow
35962
- },
35963
- getRowKey(item, index)
35964
- )),
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
+ })(),
35965
35997
  infiniteScroll?.isFetchingNextPage && /* @__PURE__ */ jsx283(
35966
35998
  TableCardSkeleton,
35967
35999
  {
@@ -36089,7 +36121,7 @@ import { useMemo as useMemo34 } from "react";
36089
36121
 
36090
36122
  // src/components/ui/query-report-table/query-report-table-header.tsx
36091
36123
  init_cn();
36092
- 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";
36093
36125
  import { jsx as jsx286, jsxs as jsxs229 } from "react/jsx-runtime";
36094
36126
  function QueryReportTableHeader({
36095
36127
  columns,
@@ -36119,7 +36151,7 @@ function QueryReportTableHeader({
36119
36151
  }
36120
36152
  function TruncatedHeaderCell({ value, width }) {
36121
36153
  const textRef = useRef49(null);
36122
- const [isTruncated, setIsTruncated] = useState85(false);
36154
+ const [isTruncated, setIsTruncated] = useState86(false);
36123
36155
  const checkTruncation = useCallback38(() => {
36124
36156
  const el = textRef.current;
36125
36157
  if (el) {
@@ -36148,7 +36180,7 @@ function TruncatedHeaderCell({ value, width }) {
36148
36180
 
36149
36181
  // src/components/ui/query-report-table/query-report-table-row.tsx
36150
36182
  init_cn();
36151
- 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";
36152
36184
  import { jsx as jsx287, jsxs as jsxs230 } from "react/jsx-runtime";
36153
36185
  function QueryReportTableRow({
36154
36186
  row,
@@ -36195,7 +36227,7 @@ function QueryReportTableRow({
36195
36227
  }
36196
36228
  function TruncatedCell({ value, className }) {
36197
36229
  const textRef = useRef50(null);
36198
- const [isTruncated, setIsTruncated] = useState86(false);
36230
+ const [isTruncated, setIsTruncated] = useState87(false);
36199
36231
  const checkTruncation = useCallback39(() => {
36200
36232
  const el = textRef.current;
36201
36233
  if (el) {
@@ -36944,7 +36976,7 @@ function DataTableBody({
36944
36976
  }
36945
36977
 
36946
36978
  // src/components/ui/data-table/data-table-infinite-footer.tsx
36947
- import { useEffect as useEffect67, useRef as useRef52 } from "react";
36979
+ import { useEffect as useEffect68, useRef as useRef52 } from "react";
36948
36980
  import { Fragment as Fragment54, jsx as jsx297, jsxs as jsxs238 } from "react/jsx-runtime";
36949
36981
  function DataTableInfiniteFooter({
36950
36982
  hasNextPage,
@@ -36956,7 +36988,7 @@ function DataTableInfiniteFooter({
36956
36988
  const sentinelRef = useRef52(null);
36957
36989
  const onLoadMoreRef = useRef52(onLoadMore);
36958
36990
  onLoadMoreRef.current = onLoadMore;
36959
- useEffect67(() => {
36991
+ useEffect68(() => {
36960
36992
  if (!hasNextPage || isFetchingNextPage) return;
36961
36993
  const sentinel = sentinelRef.current;
36962
36994
  if (!sentinel) return;
@@ -37590,9 +37622,9 @@ function FilterList({
37590
37622
 
37591
37623
  // src/components/ui/tag-search-input.tsx
37592
37624
  import {
37593
- useEffect as useEffect69,
37625
+ useEffect as useEffect70,
37594
37626
  useRef as useRef54,
37595
- useState as useState88
37627
+ useState as useState89
37596
37628
  } from "react";
37597
37629
  init_cn();
37598
37630
  import { jsx as jsx301, jsxs as jsxs242 } from "react/jsx-runtime";
@@ -37629,8 +37661,8 @@ function TagSearchInput({
37629
37661
  const wrapperRef = useRef54(null);
37630
37662
  const hiddenTagsRef = useRef54(null);
37631
37663
  const hiddenTagsPopupRef = useRef54(null);
37632
- const [showHiddenTags, setShowHiddenTags] = useState88(false);
37633
- useEffect69(() => {
37664
+ const [showHiddenTags, setShowHiddenTags] = useState89(false);
37665
+ useEffect70(() => {
37634
37666
  if (!showHiddenTags) return;
37635
37667
  const handleClick = (e) => {
37636
37668
  const target = e.target;
@@ -37785,7 +37817,7 @@ function TagSearchInput({
37785
37817
  }
37786
37818
 
37787
37819
  // src/components/ui/markdown-editor.tsx
37788
- 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";
37789
37821
  init_cn();
37790
37822
  import { Loader2 as Loader29, Upload as Upload8 } from "lucide-react";
37791
37823
  import { jsx as jsx302, jsxs as jsxs243 } from "react/jsx-runtime";
@@ -37816,7 +37848,7 @@ body .w-md-editor .w-md-editor-bar::after { content: '' !important; display: blo
37816
37848
  body .w-md-editor .w-md-editor-bar:hover::after { border-color: var(--color-text-secondary) !important; }
37817
37849
  `;
37818
37850
  function MarkdownEditorStyles() {
37819
- useEffect70(() => {
37851
+ useEffect71(() => {
37820
37852
  if (document.getElementById(MARKDOWN_EDITOR_STYLE_ID)) return;
37821
37853
  const style = document.createElement("style");
37822
37854
  style.id = MARKDOWN_EDITOR_STYLE_ID;
@@ -37841,10 +37873,10 @@ function MarkdownEditor({
37841
37873
  renderPreview
37842
37874
  }) {
37843
37875
  const fileInputRef = useRef55(null);
37844
- const [isUploading, setIsUploading] = useState89(false);
37845
- const [uploadProgress, setUploadProgress] = useState89("");
37846
- const [defaultExtraCommands, setDefaultExtraCommands] = useState89([]);
37847
- useEffect70(() => {
37876
+ const [isUploading, setIsUploading] = useState90(false);
37877
+ const [uploadProgress, setUploadProgress] = useState90("");
37878
+ const [defaultExtraCommands, setDefaultExtraCommands] = useState90([]);
37879
+ useEffect71(() => {
37848
37880
  import("@uiw/react-md-editor").then((mod) => {
37849
37881
  if (mod.commands?.getExtraCommands) {
37850
37882
  setDefaultExtraCommands(mod.commands.getExtraCommands());
@@ -37967,7 +37999,7 @@ function MarkdownEditor({
37967
37999
  }
37968
38000
  rafRef.current = requestAnimationFrame(scrollLoop);
37969
38001
  }, []);
37970
- useEffect70(() => {
38002
+ useEffect71(() => {
37971
38003
  const wrapper = wrapperRef.current;
37972
38004
  if (!wrapper) return;
37973
38005
  const onMouseMove = (e) => {
@@ -39449,8 +39481,8 @@ function ImageGalleryModal({
39449
39481
  onClose,
39450
39482
  initialIndex = 0
39451
39483
  }) {
39452
- const [selectedImageIndex, setSelectedImageIndex] = useState96(initialIndex);
39453
- useEffect73(() => {
39484
+ const [selectedImageIndex, setSelectedImageIndex] = useState97(initialIndex);
39485
+ useEffect74(() => {
39454
39486
  if (isOpen) {
39455
39487
  setSelectedImageIndex(initialIndex);
39456
39488
  }
@@ -39465,7 +39497,7 @@ function ImageGalleryModal({
39465
39497
  setSelectedImageIndex(selectedImageIndex + 1);
39466
39498
  }
39467
39499
  };
39468
- useEffect73(() => {
39500
+ useEffect74(() => {
39469
39501
  const handleKeyPress = (event) => {
39470
39502
  if (!isOpen) return;
39471
39503
  switch (event.key) {
@@ -39668,7 +39700,7 @@ function RoadmapCard({
39668
39700
  onVote,
39669
39701
  isVoting = false
39670
39702
  }) {
39671
- const [showScreenshots, setShowScreenshots] = useState97(false);
39703
+ const [showScreenshots, setShowScreenshots] = useState98(false);
39672
39704
  const logoUrl = item.icon && item.icon.startsWith("http") ? item.icon : null;
39673
39705
  const iconSrc = logoUrl ? getProxiedImageUrl(logoUrl, { directHttps: true }) || logoUrl : null;
39674
39706
  if (size === "sm") {
@@ -40304,7 +40336,7 @@ function DataRoomDocCardSkeleton({ className }) {
40304
40336
  }
40305
40337
 
40306
40338
  // src/components/chat/entity-cards/program-card.tsx
40307
- import { useState as useState98 } from "react";
40339
+ import { useState as useState99 } from "react";
40308
40340
 
40309
40341
  // node_modules/date-fns/toDate.mjs
40310
40342
  function toDate(argument) {
@@ -41941,8 +41973,8 @@ function getHosts(hosts) {
41941
41973
  return [];
41942
41974
  }
41943
41975
  function MediaGallery({ images, title }) {
41944
- const [selectedImageIndex, setSelectedImageIndex] = useState98(null);
41945
- const [isModalOpen, setIsModalOpen] = useState98(false);
41976
+ const [selectedImageIndex, setSelectedImageIndex] = useState99(null);
41977
+ const [isModalOpen, setIsModalOpen] = useState99(false);
41946
41978
  const openImageModal = (index, event) => {
41947
41979
  if (event) event.stopPropagation();
41948
41980
  setSelectedImageIndex(index);
@@ -43727,7 +43759,7 @@ function useChunkCatchup({
43727
43759
  }
43728
43760
 
43729
43761
  // src/components/chat/hooks/use-jetstream-dialog-subscription.ts
43730
- 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";
43731
43763
  var DEFAULT_INACTIVE_THRESHOLD_MS = 5 * 6e4;
43732
43764
  var DEFAULT_STREAM_NAME = "CHAT_CHUNKS";
43733
43765
  function useJetStreamDialogSubscription({
@@ -43746,57 +43778,57 @@ function useJetStreamDialogSubscription({
43746
43778
  reconnectionBackoff,
43747
43779
  inactiveThresholdMs
43748
43780
  }) {
43749
- const [isConnected, setIsConnected] = useState99(false);
43750
- const [isSubscribed, setIsSubscribed] = useState99(false);
43751
- const [reconnectionCount, setReconnectionCount] = useState99(0);
43752
- 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);
43753
43785
  const clientRef = useRef60(null);
43754
43786
  const subscriptionRef = useRef60(null);
43755
43787
  const highestStreamSeqRef = useRef60(null);
43756
43788
  const onEventRef = useRef60(onEvent);
43757
- useEffect74(() => {
43789
+ useEffect75(() => {
43758
43790
  onEventRef.current = onEvent;
43759
43791
  }, [onEvent]);
43760
43792
  const onConnectRef = useRef60(onConnect);
43761
- useEffect74(() => {
43793
+ useEffect75(() => {
43762
43794
  onConnectRef.current = onConnect;
43763
43795
  }, [onConnect]);
43764
43796
  const onDisconnectRef = useRef60(onDisconnect);
43765
- useEffect74(() => {
43797
+ useEffect75(() => {
43766
43798
  onDisconnectRef.current = onDisconnect;
43767
43799
  }, [onDisconnect]);
43768
43800
  const onSubscribedRef = useRef60(onSubscribed);
43769
- useEffect74(() => {
43801
+ useEffect75(() => {
43770
43802
  onSubscribedRef.current = onSubscribed;
43771
43803
  }, [onSubscribed]);
43772
43804
  const onBeforeReconnectRef = useRef60(onBeforeReconnect);
43773
- useEffect74(() => {
43805
+ useEffect75(() => {
43774
43806
  onBeforeReconnectRef.current = onBeforeReconnect;
43775
43807
  }, [onBeforeReconnect]);
43776
43808
  const getNatsWsUrlRef = useRef60(getNatsWsUrl);
43777
- useEffect74(() => {
43809
+ useEffect75(() => {
43778
43810
  getNatsWsUrlRef.current = getNatsWsUrl;
43779
43811
  }, [getNatsWsUrl]);
43780
43812
  const reconnectionBackoffRef = useRef60(reconnectionBackoff);
43781
- useEffect74(() => {
43813
+ useEffect75(() => {
43782
43814
  reconnectionBackoffRef.current = reconnectionBackoff;
43783
43815
  }, [reconnectionBackoff]);
43784
43816
  const optStartSeqRef = useRef60(optStartSeq);
43785
- useEffect74(() => {
43817
+ useEffect75(() => {
43786
43818
  optStartSeqRef.current = optStartSeq;
43787
43819
  }, [optStartSeq]);
43788
43820
  const inactiveThresholdRef = useRef60(inactiveThresholdMs);
43789
- useEffect74(() => {
43821
+ useEffect75(() => {
43790
43822
  inactiveThresholdRef.current = inactiveThresholdMs;
43791
43823
  }, [inactiveThresholdMs]);
43792
43824
  const hadConnectionBeforeRef = useRef60(false);
43793
43825
  const clientConfigRef = useRef60(clientConfig);
43794
- useEffect74(() => {
43826
+ useEffect75(() => {
43795
43827
  clientConfigRef.current = clientConfig;
43796
43828
  }, [clientConfig]);
43797
43829
  const currentWsUrlRef = useRef60("");
43798
43830
  const wsUrl = getNatsWsUrl();
43799
- useEffect74(() => {
43831
+ useEffect75(() => {
43800
43832
  if (!enabled || !wsUrl) {
43801
43833
  if (currentWsUrlRef.current && clientRef.current) {
43802
43834
  releaseClient(currentWsUrlRef.current);
@@ -43877,7 +43909,7 @@ function useJetStreamDialogSubscription({
43877
43909
  }
43878
43910
  };
43879
43911
  }, [enabled, wsUrl]);
43880
- useEffect74(() => {
43912
+ useEffect75(() => {
43881
43913
  if (!enabled || !dialogId || !isConnected) {
43882
43914
  if (subscriptionRef.current) {
43883
43915
  try {
@@ -43960,7 +43992,7 @@ function useJetStreamDialogSubscription({
43960
43992
  setIsSubscribed(false);
43961
43993
  };
43962
43994
  }, [enabled, dialogId, isConnected, streamName, topic, reconnectionCount]);
43963
- useEffect74(() => {
43995
+ useEffect75(() => {
43964
43996
  highestStreamSeqRef.current = null;
43965
43997
  setCurrentStreamSeq(null);
43966
43998
  }, [dialogId]);
@@ -43968,7 +44000,7 @@ function useJetStreamDialogSubscription({
43968
44000
  }
43969
44001
 
43970
44002
  // src/components/chat/hooks/use-nats-dialog-subscription.ts
43971
- 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";
43972
44004
  function useNatsDialogSubscription({
43973
44005
  enabled,
43974
44006
  dialogId,
@@ -43982,47 +44014,47 @@ function useNatsDialogSubscription({
43982
44014
  clientConfig = {},
43983
44015
  reconnectionBackoff
43984
44016
  }) {
43985
- const [isConnected, setIsConnected] = useState100(false);
43986
- const [isSubscribed, setIsSubscribed] = useState100(false);
43987
- const [reconnectionCount, setReconnectionCount] = useState100(0);
44017
+ const [isConnected, setIsConnected] = useState101(false);
44018
+ const [isSubscribed, setIsSubscribed] = useState101(false);
44019
+ const [reconnectionCount, setReconnectionCount] = useState101(0);
43988
44020
  const clientRef = useRef61(null);
43989
44021
  const subscriptionRefs = useRef61(/* @__PURE__ */ new Map());
43990
44022
  const onEventRef = useRef61(onEvent);
43991
- useEffect75(() => {
44023
+ useEffect76(() => {
43992
44024
  onEventRef.current = onEvent;
43993
44025
  }, [onEvent]);
43994
44026
  const onConnectRef = useRef61(onConnect);
43995
- useEffect75(() => {
44027
+ useEffect76(() => {
43996
44028
  onConnectRef.current = onConnect;
43997
44029
  }, [onConnect]);
43998
44030
  const onDisconnectRef = useRef61(onDisconnect);
43999
- useEffect75(() => {
44031
+ useEffect76(() => {
44000
44032
  onDisconnectRef.current = onDisconnect;
44001
44033
  }, [onDisconnect]);
44002
44034
  const onSubscribedRef = useRef61(onSubscribed);
44003
- useEffect75(() => {
44035
+ useEffect76(() => {
44004
44036
  onSubscribedRef.current = onSubscribed;
44005
44037
  }, [onSubscribed]);
44006
44038
  const onBeforeReconnectRef = useRef61(onBeforeReconnect);
44007
- useEffect75(() => {
44039
+ useEffect76(() => {
44008
44040
  onBeforeReconnectRef.current = onBeforeReconnect;
44009
44041
  }, [onBeforeReconnect]);
44010
44042
  const hadConnectionBeforeRef = useRef61(false);
44011
44043
  const getNatsWsUrlRef = useRef61(getNatsWsUrl);
44012
- useEffect75(() => {
44044
+ useEffect76(() => {
44013
44045
  getNatsWsUrlRef.current = getNatsWsUrl;
44014
44046
  }, [getNatsWsUrl]);
44015
44047
  const reconnectionBackoffRef = useRef61(reconnectionBackoff);
44016
- useEffect75(() => {
44048
+ useEffect76(() => {
44017
44049
  reconnectionBackoffRef.current = reconnectionBackoff;
44018
44050
  }, [reconnectionBackoff]);
44019
44051
  const clientConfigRef = useRef61(clientConfig);
44020
- useEffect75(() => {
44052
+ useEffect76(() => {
44021
44053
  clientConfigRef.current = clientConfig;
44022
44054
  }, [clientConfig]);
44023
44055
  const currentWsUrlRef = useRef61("");
44024
44056
  const wsUrl = getNatsWsUrl();
44025
- useEffect75(() => {
44057
+ useEffect76(() => {
44026
44058
  if (!enabled || !wsUrl) {
44027
44059
  if (currentWsUrlRef.current && clientRef.current) {
44028
44060
  releaseClient(currentWsUrlRef.current);
@@ -44106,12 +44138,12 @@ function useNatsDialogSubscription({
44106
44138
  const topicsKey = topics.join(",");
44107
44139
  const lastSubscribedDialogIdRef = useRef61(null);
44108
44140
  const isConnectedRef = useRef61(isConnected);
44109
- useEffect75(() => {
44141
+ useEffect76(() => {
44110
44142
  isConnectedRef.current = isConnected;
44111
44143
  }, [isConnected]);
44112
44144
  const currentDialogIdRef = useRef61(null);
44113
44145
  const abortControllerRef = useRef61(null);
44114
- useEffect75(() => {
44146
+ useEffect76(() => {
44115
44147
  currentDialogIdRef.current = dialogId;
44116
44148
  if (!enabled || !dialogId) {
44117
44149
  if (subscriptionRefs.current.size > 0) {
@@ -44192,7 +44224,7 @@ function useNatsDialogSubscription({
44192
44224
  abortControllerRef.current = null;
44193
44225
  };
44194
44226
  }, [enabled, dialogId, topicsKey, topics]);
44195
- useEffect75(() => {
44227
+ useEffect76(() => {
44196
44228
  if (!enabled || !currentDialogIdRef.current || !isConnected) {
44197
44229
  return;
44198
44230
  }
@@ -44242,7 +44274,7 @@ function buildNatsWsUrl(apiBaseUrl, options) {
44242
44274
  }
44243
44275
 
44244
44276
  // src/components/chat/hooks/use-realtime-chunk-processor.ts
44245
- 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";
44246
44278
 
44247
44279
  // src/components/chat/utils/chunk-parser.ts
44248
44280
  function normalizeToolCalls(raw) {
@@ -44900,7 +44932,7 @@ function useRealtimeChunkProcessor(options) {
44900
44932
  })
44901
44933
  );
44902
44934
  const hasInitializedWithData = useRef62(false);
44903
- useEffect76(() => {
44935
+ useEffect77(() => {
44904
44936
  if (initialState && !hasInitializedWithData.current) {
44905
44937
  accumulatorRef.current.initializeWithState(initialState);
44906
44938
  if (initialState.escalatedApprovals) {
@@ -44917,7 +44949,7 @@ function useRealtimeChunkProcessor(options) {
44917
44949
  const hasEverStreamedRef = useRef62(false);
44918
44950
  const directModeFlagRef = useRef62(isDirectMode);
44919
44951
  const sawDirectMessageRef = useRef62(false);
44920
- useEffect76(() => {
44952
+ useEffect77(() => {
44921
44953
  directModeFlagRef.current = isDirectMode;
44922
44954
  }, [isDirectMode]);
44923
44955
  const pendingEscalatedRef = useRef62(/* @__PURE__ */ new Map());
@@ -45178,7 +45210,7 @@ function useRealtimeChunkProcessor(options) {
45178
45210
  }
45179
45211
 
45180
45212
  // src/components/chat/hooks/use-slash-commands.ts
45181
- import { useEffect as useEffect77, useState as useState101 } from "react";
45213
+ import { useEffect as useEffect78, useState as useState102 } from "react";
45182
45214
  import { useQuery as useQuery2 } from "@tanstack/react-query";
45183
45215
  async function fetchSlashCommands(prefix, signal, commandsUrl) {
45184
45216
  try {
@@ -45195,9 +45227,9 @@ async function fetchSlashCommands(prefix, signal, commandsUrl) {
45195
45227
  }
45196
45228
  }
45197
45229
  function useSlashCommands(prefix, commandsUrl) {
45198
- const [commands, setCommands] = useState101([]);
45199
- const [loading, setLoading] = useState101(false);
45200
- useEffect77(() => {
45230
+ const [commands, setCommands] = useState102([]);
45231
+ const [loading, setLoading] = useState102(false);
45232
+ useEffect78(() => {
45201
45233
  if (prefix == null) {
45202
45234
  setCommands([]);
45203
45235
  return;
@@ -45297,7 +45329,7 @@ function useEmptyStateConfig(emptyStateUrl, options) {
45297
45329
  }
45298
45330
 
45299
45331
  // src/components/chat/hooks/use-chat-attachments.ts
45300
- 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";
45301
45333
  import { fileTypeFromBlob } from "file-type";
45302
45334
  var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
45303
45335
  var CHAT_ATTACHMENTS_FOLDER = "chat";
@@ -45373,7 +45405,7 @@ function uploadWithProgress(url, file, token, onProgress, signal) {
45373
45405
  function useChatAttachments() {
45374
45406
  const runtime = useRequiredChatRuntime();
45375
45407
  const uploadUrlEndpoint = runtime.endpoints.attachmentUploadUrl;
45376
- const [attachments, setAttachments] = useState102([]);
45408
+ const [attachments, setAttachments] = useState103([]);
45377
45409
  const controllersRef = useRef63(/* @__PURE__ */ new Map());
45378
45410
  const updateOne = useCallback46((id, patch) => {
45379
45411
  setAttachments((prev) => prev.map((a) => a.id === id ? { ...a, ...patch } : a));
@@ -45540,16 +45572,16 @@ function useChatAttachments() {
45540
45572
  }
45541
45573
 
45542
45574
  // src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
45543
- 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";
45544
45576
  import { jsx as jsx326 } from "react/jsx-runtime";
45545
45577
  var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
45546
45578
  function useChatAttachmentImageGallery() {
45547
45579
  const runtime = useRequiredChatRuntime();
45548
45580
  const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
45549
45581
  const panelRef = useRef64(null);
45550
- const [state, setState] = useState103(CLOSED);
45582
+ const [state, setState] = useState104(CLOSED);
45551
45583
  const handleClose = useCallback47(() => setState(CLOSED), []);
45552
- useEffect78(() => {
45584
+ useEffect79(() => {
45553
45585
  const root = panelRef.current;
45554
45586
  if (!root) return;
45555
45587
  const onClick = (ev) => {
@@ -45595,7 +45627,7 @@ function absolutize(prefix) {
45595
45627
  }
45596
45628
 
45597
45629
  // src/components/chat/hooks/use-chat-identity.ts
45598
- 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";
45599
45631
  var ANON_DEFAULTS = {
45600
45632
  authTier: "anon",
45601
45633
  source: null,
@@ -45606,9 +45638,9 @@ function useResolveChatIdentity(enabled) {
45606
45638
  const runtime = useRequiredChatRuntime();
45607
45639
  const url = runtime.endpoints.identityUrl;
45608
45640
  const proxyEmail = getEmbedProxyAuth()?.email ?? null;
45609
- const [data, setData] = useState104(ANON_DEFAULTS);
45610
- const [isLoading, setIsLoading] = useState104(enabled);
45611
- useEffect79(() => {
45641
+ const [data, setData] = useState105(ANON_DEFAULTS);
45642
+ const [isLoading, setIsLoading] = useState105(enabled);
45643
+ useEffect80(() => {
45612
45644
  if (!enabled) return;
45613
45645
  let cancelled = false;
45614
45646
  const ctrl = new AbortController();
@@ -45650,11 +45682,11 @@ function useChatIdentity() {
45650
45682
  }
45651
45683
 
45652
45684
  // src/components/chat/hooks/use-close-on-navigation.ts
45653
- import { useEffect as useEffect80, useRef as useRef65 } from "react";
45685
+ import { useEffect as useEffect81, useRef as useRef65 } from "react";
45654
45686
  function useCloseOnNavigation(close, pathname) {
45655
45687
  const prevPathnameRef = useRef65(null);
45656
45688
  const initializedRef = useRef65(false);
45657
- useEffect80(() => {
45689
+ useEffect81(() => {
45658
45690
  if (!initializedRef.current) {
45659
45691
  initializedRef.current = true;
45660
45692
  prevPathnameRef.current = pathname;
@@ -45668,13 +45700,13 @@ function useCloseOnNavigation(close, pathname) {
45668
45700
  }
45669
45701
 
45670
45702
  // src/components/chat/hooks/use-chat.ts
45671
- 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";
45672
45704
 
45673
45705
  // src/components/chat/hooks/use-sse.ts
45674
- 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";
45675
45707
  function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
45676
- const [isStreaming, setIsStreaming] = useState105(false);
45677
- const [error, setError] = useState105(null);
45708
+ const [isStreaming, setIsStreaming] = useState106(false);
45709
+ const [error, setError] = useState106(null);
45678
45710
  const abortControllerRef = useRef66(null);
45679
45711
  const fallbackStream = useCallback48(async function* () {
45680
45712
  throw new Error(
@@ -45741,12 +45773,12 @@ function useChat({
45741
45773
  initialMessages,
45742
45774
  onMessagesChange
45743
45775
  } = {}) {
45744
- const [messages, setMessages] = useState106(() => initialMessages ?? []);
45745
- const [isTyping, setIsTyping] = useState106(false);
45776
+ const [messages, setMessages] = useState107(() => initialMessages ?? []);
45777
+ const [isTyping, setIsTyping] = useState107(false);
45746
45778
  const currentAssistantSegmentsRef = useRef67([]);
45747
45779
  const onMessagesChangeRef = useRef67(onMessagesChange);
45748
45780
  onMessagesChangeRef.current = onMessagesChange;
45749
- useEffect81(() => {
45781
+ useEffect82(() => {
45750
45782
  onMessagesChangeRef.current?.(messages);
45751
45783
  }, [messages]);
45752
45784
  const {
@@ -46035,7 +46067,7 @@ function useChat({
46035
46067
  }
46036
46068
 
46037
46069
  // src/components/chat/hooks/use-sse-chat-adapter.ts
46038
- 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";
46039
46071
  function createEmptyTurnMeta() {
46040
46072
  return {
46041
46073
  provider: null,
@@ -46370,8 +46402,8 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
46370
46402
  const metaMapRef = useRef68(/* @__PURE__ */ new Map());
46371
46403
  const messagesRef = useRef68(persistedRef.current.messages);
46372
46404
  const sendCountRef = useRef68(persistedRef.current.sendCount);
46373
- const [streamingPhase, setStreamingPhase] = useState107("idle");
46374
- const [metaTick, setMetaTick] = useState107(0);
46405
+ const [streamingPhase, setStreamingPhase] = useState108("idle");
46406
+ const [metaTick, setMetaTick] = useState108(0);
46375
46407
  const bumpMetaTick = useCallback50(() => setMetaTick((t) => t + 1), []);
46376
46408
  const streamFn = useMemo39(
46377
46409
  () => createDocStreamFn(
@@ -46559,7 +46591,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
46559
46591
  }
46560
46592
  }
46561
46593
  }, [chatClearMessages, source, bumpMetaTick]);
46562
- useEffect82(() => {
46594
+ useEffect83(() => {
46563
46595
  if (!isTyping && !isStreaming && streamingPhase !== "idle") {
46564
46596
  setStreamingPhase("idle");
46565
46597
  }
@@ -46641,10 +46673,10 @@ var noopRejectRequest = async (_id, _reason) => {
46641
46673
  // src/components/chat/hooks/use-nats-chat-adapter.ts
46642
46674
  import {
46643
46675
  useCallback as useCallback51,
46644
- useEffect as useEffect83,
46676
+ useEffect as useEffect84,
46645
46677
  useMemo as useMemo40,
46646
46678
  useRef as useRef69,
46647
- useState as useState108
46679
+ useState as useState109
46648
46680
  } from "react";
46649
46681
 
46650
46682
  // src/components/chat/utils/process-historical-messages.ts
@@ -47134,23 +47166,23 @@ function useNatsChatAdapter(config, options = {}) {
47134
47166
  modelLabel = null
47135
47167
  } = config;
47136
47168
  const isManagedMode = fetchDialogs !== void 0;
47137
- const [internalDialogId, setInternalDialogId] = useState108(null);
47169
+ const [internalDialogId, setInternalDialogId] = useState109(null);
47138
47170
  const dialogId = isManagedMode ? internalDialogId : controlledDialogId !== void 0 ? controlledDialogId : null;
47139
- const [messages, setMessages] = useState108([]);
47140
- const [streamingPhase, setStreamingPhase] = useState108("idle");
47141
- const [approvalStatuses, setApprovalStatuses] = useState108({});
47142
- const [dialogs, setDialogs] = useState108([]);
47143
- const [dialogsNextCursor, setDialogsNextCursor] = useState108(null);
47144
- const [isDialogsLoading, setIsDialogsLoading] = useState108(false);
47145
- const [dialogsError, setDialogsError] = useState108(false);
47146
- const [isCreatingDialog, setIsCreatingDialog] = useState108(false);
47147
- const [messagesNextCursor, setMessagesNextCursor] = useState108(null);
47148
- const [isMessagesLoading, setIsMessagesLoading] = useState108(false);
47149
- 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(
47150
47182
  null
47151
47183
  );
47152
- const [liveModel, setLiveModel] = useState108(null);
47153
- const [connectionState, setConnectionState] = useState108("connecting");
47184
+ const [liveModel, setLiveModel] = useState109(null);
47185
+ const [connectionState, setConnectionState] = useState109("connecting");
47154
47186
  const handleApprove = useCallback51(
47155
47187
  async (requestId) => {
47156
47188
  if (!approveRequestCallback) return;
@@ -47291,7 +47323,7 @@ function useNatsChatAdapter(config, options = {}) {
47291
47323
  ]
47292
47324
  );
47293
47325
  const prevDialogIdRef = useRef69(void 0);
47294
- useEffect83(() => {
47326
+ useEffect84(() => {
47295
47327
  if (prevDialogIdRef.current === dialogId) return;
47296
47328
  prevDialogIdRef.current = dialogId;
47297
47329
  historyLoadSeqRef.current += 1;
@@ -47305,7 +47337,7 @@ function useNatsChatAdapter(config, options = {}) {
47305
47337
  if (!active || !dialogId) return;
47306
47338
  void loadDialogHistory(dialogId);
47307
47339
  }, [active, dialogId, loadDialogHistory, resetAccumulator]);
47308
- useEffect83(() => {
47340
+ useEffect84(() => {
47309
47341
  if (!active || !dialogId) return;
47310
47342
  resetChunkTracking();
47311
47343
  startInitialBuffering();
@@ -47327,7 +47359,7 @@ function useNatsChatAdapter(config, options = {}) {
47327
47359
  setConnectionState("connected");
47328
47360
  }
47329
47361
  });
47330
- useEffect83(() => {
47362
+ useEffect84(() => {
47331
47363
  if (!active || !dialogId) {
47332
47364
  setConnectionState("connected");
47333
47365
  return;
@@ -47366,7 +47398,7 @@ function useNatsChatAdapter(config, options = {}) {
47366
47398
  const reloadDialogs = useCallback51(() => {
47367
47399
  void loadDialogsPage();
47368
47400
  }, [loadDialogsPage]);
47369
- useEffect83(() => {
47401
+ useEffect84(() => {
47370
47402
  if (!fetchDialogs) return;
47371
47403
  if (!active) return;
47372
47404
  if (initialDialogsLoadedRef.current) return;
@@ -47946,7 +47978,7 @@ function chatChipClass({ tone, density = "chip", extra }) {
47946
47978
  }
47947
47979
 
47948
47980
  // src/components/chat/embeddable-chat.tsx
47949
- 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";
47950
47982
  import * as DialogPrimitive4 from "@radix-ui/react-dialog";
47951
47983
  import { usePreventScroll } from "@react-aria/overlays";
47952
47984
  import { isIOS } from "@react-aria/utils";
@@ -48027,7 +48059,7 @@ init_button2();
48027
48059
  import { FileText as FileText8, MessageSquare as MessageSquare3 } from "lucide-react";
48028
48060
 
48029
48061
  // src/components/chat/hooks/use-chat-dialog-manager.ts
48030
- 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";
48031
48063
  function useChatDialogManager({
48032
48064
  dialogs,
48033
48065
  activeDialogId,
@@ -48038,8 +48070,8 @@ function useChatDialogManager({
48038
48070
  fetchArchivedDialogs,
48039
48071
  unarchiveDialog
48040
48072
  }) {
48041
- const [renameTarget, setRenameTarget] = useState109(null);
48042
- const [archiveTarget, setArchiveTarget] = useState109(null);
48073
+ const [renameTarget, setRenameTarget] = useState110(null);
48074
+ const [archiveTarget, setArchiveTarget] = useState110(null);
48043
48075
  const handleConfirmRename = useCallback53(
48044
48076
  (name) => {
48045
48077
  if (renameTarget) void renameDialog(renameTarget.id, name);
@@ -48062,10 +48094,10 @@ function useChatDialogManager({
48062
48094
  }
48063
48095
  setArchiveTarget(null);
48064
48096
  }, [archiveTarget, archiveDialog, activeDialogId, clearMessages]);
48065
- const [archiveOpen, setArchiveOpen] = useState109(false);
48066
- const [archivedDialogs, setArchivedDialogs] = useState109([]);
48067
- const [archivedCursor, setArchivedCursor] = useState109(null);
48068
- 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);
48069
48101
  const loadArchivedPage = useCallback53(
48070
48102
  async (cursor) => {
48071
48103
  if (!fetchArchivedDialogs) return;
@@ -48091,10 +48123,10 @@ function useChatDialogManager({
48091
48123
  void loadArchivedPage();
48092
48124
  }, [loadArchivedPage]);
48093
48125
  const closeArchive = useCallback53(() => setArchiveOpen(false), []);
48094
- const [viewingArchivedId, setViewingArchivedId] = useState109(
48126
+ const [viewingArchivedId, setViewingArchivedId] = useState110(
48095
48127
  null
48096
48128
  );
48097
- const [openingDialogId, setOpeningDialogId] = useState109(null);
48129
+ const [openingDialogId, setOpeningDialogId] = useState110(null);
48098
48130
  const handleSelectDialog = useCallback53(
48099
48131
  (id) => {
48100
48132
  setViewingArchivedId(null);
@@ -48113,7 +48145,7 @@ function useChatDialogManager({
48113
48145
  },
48114
48146
  [selectDialog]
48115
48147
  );
48116
- const [restoreTarget, setRestoreTarget] = useState109(null);
48148
+ const [restoreTarget, setRestoreTarget] = useState110(null);
48117
48149
  const handleConfirmRestore = useCallback53(async () => {
48118
48150
  if (restoreTarget) {
48119
48151
  try {
@@ -48364,7 +48396,7 @@ function SourceChips({
48364
48396
  onClose,
48365
48397
  onDiscuss
48366
48398
  }) {
48367
- const [expanded, setExpanded] = useState110(false);
48399
+ const [expanded, setExpanded] = useState111(false);
48368
48400
  if (cited.length === 0) {
48369
48401
  const fallback = uncited.slice(0, FALLBACK_TOP_RETRIEVED);
48370
48402
  if (fallback.length === 0) return null;
@@ -48463,7 +48495,7 @@ function EmbeddableChatInner({
48463
48495
  const commandsUrl = runtime.endpoints.commandsUrl;
48464
48496
  const { attachmentsEnabled, user: identityUser } = useChatIdentity();
48465
48497
  const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
48466
- useEffect84(() => {
48498
+ useEffect85(() => {
48467
48499
  if (process.env.NODE_ENV !== "production") {
48468
48500
  const hasOpen = open !== void 0;
48469
48501
  const hasHandler = onOpenChange !== void 0;
@@ -48479,13 +48511,13 @@ function EmbeddableChatInner({
48479
48511
  defaultProp: defaultOpen ?? false,
48480
48512
  onChange: onOpenChange
48481
48513
  });
48482
- const [autoFocusInput] = useState110(() => {
48514
+ const [autoFocusInput] = useState111(() => {
48483
48515
  if (typeof window === "undefined") return false;
48484
48516
  return !window.matchMedia("(pointer: coarse)").matches;
48485
48517
  });
48486
48518
  usePreventScroll({ isDisabled: !isOpen || shellLess });
48487
48519
  const navigatingAwayRef = useRef71(false);
48488
- useEffect84(() => {
48520
+ useEffect85(() => {
48489
48521
  if (!isOpen) return;
48490
48522
  if (shellLess) return;
48491
48523
  if (typeof window === "undefined") return;
@@ -48555,7 +48587,7 @@ function EmbeddableChatInner({
48555
48587
  }, [mingoState, mingoDialogCapabilities, effectiveModes]);
48556
48588
  const hasMingoMode = !!effectiveModes.mingo || !!mingoState;
48557
48589
  const initialActiveMode = controlledActiveMode ?? defaultActiveMode ?? (effectiveModes.guide ? "guide" : "mingo");
48558
- const [uncontrolledActiveMode, setUncontrolledActiveMode] = useState110(initialActiveMode);
48590
+ const [uncontrolledActiveMode, setUncontrolledActiveMode] = useState111(initialActiveMode);
48559
48591
  const activeMode = controlledActiveMode ?? uncontrolledActiveMode;
48560
48592
  const handleActiveModeChange = useCallback54(
48561
48593
  (next) => {
@@ -48618,15 +48650,15 @@ function EmbeddableChatInner({
48618
48650
  const { panelRef: galleryPanelRef, modal: galleryModal } = useChatAttachmentImageGallery();
48619
48651
  const contextMaxItems = contextPicker?.maxItems ?? 10;
48620
48652
  const contextPickerForMode = activeMode === "mingo" ? contextPicker : void 0;
48621
- const [contextItems, setContextItems] = useState110([]);
48622
- const [contextPickerOpen, setContextPickerOpen] = useState110(false);
48623
- const [mentionQuery, setMentionQuery] = useState110(null);
48653
+ const [contextItems, setContextItems] = useState111([]);
48654
+ const [contextPickerOpen, setContextPickerOpen] = useState111(false);
48655
+ const [mentionQuery, setMentionQuery] = useState111(null);
48624
48656
  const mentionActiveRef = useRef71(false);
48625
- useEffect84(() => {
48657
+ useEffect85(() => {
48626
48658
  mentionActiveRef.current = mentionQuery !== null;
48627
48659
  }, [mentionQuery]);
48628
48660
  const mentionKeysRef = useRef71(/* @__PURE__ */ new Set());
48629
- useEffect84(() => {
48661
+ useEffect85(() => {
48630
48662
  setContextItems([]);
48631
48663
  setMentionQuery(null);
48632
48664
  mentionKeysRef.current.clear();
@@ -48830,7 +48862,7 @@ function EmbeddableChatInner({
48830
48862
  });
48831
48863
  const handleOpen = useCallback54(() => setIsOpen(true), [setIsOpen]);
48832
48864
  useCloseOnNavigation(handleNavigationClose, null);
48833
- useEffect84(() => {
48865
+ useEffect85(() => {
48834
48866
  const handler = (e) => {
48835
48867
  const detail = e.detail;
48836
48868
  if (!detail || detail.source !== source) return;
@@ -48886,7 +48918,7 @@ function EmbeddableChatInner({
48886
48918
  const uncited = sources.filter((s) => !seenOrder.has(s.index));
48887
48919
  return { cited, uncited };
48888
48920
  }, [lastAssistantMsg, chatLoading]);
48889
- const [portalHost, setPortalHost] = useState110(null);
48921
+ const [portalHost, setPortalHost] = useState111(null);
48890
48922
  const body = /* @__PURE__ */ jsxs265(PortalContainerContext.Provider, { value: portalHost, children: [
48891
48923
  /* @__PURE__ */ jsx329(
48892
48924
  "div",
@@ -50130,4 +50162,4 @@ export {
50130
50162
  FAE_AVATAR_DATA_URI,
50131
50163
  assets
50132
50164
  };
50133
- //# sourceMappingURL=chunk-NDHQG4I4.js.map
50165
+ //# sourceMappingURL=chunk-AZ3DTQU5.js.map