@flamingo-stack/openframe-frontend-core 0.0.223 → 0.0.224
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-4WBVMIKQ.cjs → chunk-7JGR67H2.cjs} +24 -24
- package/dist/{chunk-4WBVMIKQ.cjs.map → chunk-7JGR67H2.cjs.map} +1 -1
- package/dist/{chunk-ENDUMC7Z.cjs → chunk-AENTBOSN.cjs} +118 -70
- package/dist/chunk-AENTBOSN.cjs.map +1 -0
- package/dist/{chunk-4VHWSAQR.js → chunk-BNYPQCKL.js} +304 -256
- package/dist/chunk-BNYPQCKL.js.map +1 -0
- package/dist/{chunk-GYYGA24C.js → chunk-LEHEHEVW.js} +2 -2
- package/dist/{chunk-TA6Z2AKD.js → chunk-OAOLVEYW.js} +2 -2
- package/dist/{chunk-7TKYFZ3L.cjs → chunk-SZCTY3YF.cjs} +7 -7
- package/dist/{chunk-7TKYFZ3L.cjs.map → chunk-SZCTY3YF.cjs.map} +1 -1
- package/dist/{chunk-ISWWP2BH.js → chunk-V6ME2VMU.js} +2 -2
- package/dist/{chunk-ABBU7QOM.cjs → chunk-WIAQRCJ5.cjs} +10 -10
- package/dist/{chunk-ABBU7QOM.cjs.map → chunk-WIAQRCJ5.cjs.map} +1 -1
- package/dist/{chunk-WOKB6RJ7.js → chunk-YEOM52ZR.js} +2 -2
- package/dist/{chunk-KXLTWANQ.cjs → chunk-ZCHTRQBO.cjs} +9 -9
- package/dist/{chunk-KXLTWANQ.cjs.map → chunk-ZCHTRQBO.cjs.map} +1 -1
- package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-chat-card-item.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-unified-chat.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/chat/types/unified-chat-state.types.d.ts +10 -0
- package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/index.cjs +77 -77
- package/dist/components/index.js +4 -4
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/onboarding-guides/index.cjs +25 -25
- package/dist/components/onboarding-guides/index.js +3 -3
- package/dist/components/tickets/index.cjs +64 -64
- package/dist/components/tickets/index.js +4 -4
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/components/ui/simple-markdown-renderer.d.ts +9 -1
- package/dist/components/ui/simple-markdown-renderer.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/chat/chat-message-enhanced.tsx +67 -14
- package/src/components/chat/embeddable-chat.tsx +51 -13
- package/src/components/chat/hooks/use-chat-card-item.ts +17 -1
- package/src/components/chat/hooks/use-unified-chat.ts +41 -29
- package/src/components/chat/types/unified-chat-state.types.ts +11 -0
- package/src/components/navigation/app-layout-drawer.tsx +4 -4
- package/src/components/ui/simple-markdown-renderer.tsx +12 -2
- package/dist/chunk-4VHWSAQR.js.map +0 -1
- package/dist/chunk-ENDUMC7Z.cjs.map +0 -1
- /package/dist/{chunk-GYYGA24C.js.map → chunk-LEHEHEVW.js.map} +0 -0
- /package/dist/{chunk-TA6Z2AKD.js.map → chunk-OAOLVEYW.js.map} +0 -0
- /package/dist/{chunk-ISWWP2BH.js.map → chunk-V6ME2VMU.js.map} +0 -0
- /package/dist/{chunk-WOKB6RJ7.js.map → chunk-YEOM52ZR.js.map} +0 -0
|
@@ -953,7 +953,7 @@ init_cn();
|
|
|
953
953
|
import { forwardRef as forwardRef4, useState as useState5 } from "react";
|
|
954
954
|
|
|
955
955
|
// src/components/ui/simple-markdown-renderer.tsx
|
|
956
|
-
import { useEffect, useState as useState4, useRef, useMemo, useCallback } from "react";
|
|
956
|
+
import { useEffect, useState as useState4, useRef, useMemo, useCallback, memo } from "react";
|
|
957
957
|
import ReactMarkdown, { defaultUrlTransform } from "react-markdown";
|
|
958
958
|
import remarkGfm from "remark-gfm";
|
|
959
959
|
import remarkBreaks from "remark-breaks";
|
|
@@ -1350,7 +1350,7 @@ function resolveTextSizeConfig(config) {
|
|
|
1350
1350
|
if ("preset" in config) return { ...TEXT_SIZE_PRESETS[config.preset], ...config.overrides };
|
|
1351
1351
|
return { ...defaultSizes, ...config };
|
|
1352
1352
|
}
|
|
1353
|
-
var
|
|
1353
|
+
var SimpleMarkdownRendererImpl = ({
|
|
1354
1354
|
content,
|
|
1355
1355
|
className = "",
|
|
1356
1356
|
sectionIds,
|
|
@@ -1614,6 +1614,7 @@ var SimpleMarkdownRenderer = ({
|
|
|
1614
1614
|
) }) })
|
|
1615
1615
|
] });
|
|
1616
1616
|
};
|
|
1617
|
+
var SimpleMarkdownRenderer = memo(SimpleMarkdownRendererImpl);
|
|
1617
1618
|
|
|
1618
1619
|
// src/components/chat/thinking-display.tsx
|
|
1619
1620
|
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
@@ -3726,7 +3727,7 @@ ChatInput.displayName = "ChatInput";
|
|
|
3726
3727
|
|
|
3727
3728
|
// src/components/chat/chat-message-enhanced.tsx
|
|
3728
3729
|
init_cn();
|
|
3729
|
-
import React9, { forwardRef as forwardRef12, memo as
|
|
3730
|
+
import React9, { forwardRef as forwardRef12, memo as memo3, useMemo as useMemo5, useRef as useRef5 } from "react";
|
|
3730
3731
|
|
|
3731
3732
|
// src/components/chat/tool-execution-display.tsx
|
|
3732
3733
|
init_cn();
|
|
@@ -3875,6 +3876,9 @@ var ChatMessageEnhanced = forwardRef12(
|
|
|
3875
3876
|
[hasMarkerSupport]
|
|
3876
3877
|
);
|
|
3877
3878
|
const segments = useMemo5(() => normalizeContent(content), [content]);
|
|
3879
|
+
const renderedCardNodeCache = useRef5(
|
|
3880
|
+
/* @__PURE__ */ new Map()
|
|
3881
|
+
);
|
|
3878
3882
|
const renderingPlan = useMemo5(() => {
|
|
3879
3883
|
if (!hasMarkerSupport) return null;
|
|
3880
3884
|
const refs = chatRefs ?? {};
|
|
@@ -3882,7 +3886,9 @@ var ChatMessageEnhanced = forwardRef12(
|
|
|
3882
3886
|
const inlineByKey = /* @__PURE__ */ new Map();
|
|
3883
3887
|
const partsBySegment = /* @__PURE__ */ new Map();
|
|
3884
3888
|
if (!render) return { inlineByKey, partsBySegment };
|
|
3885
|
-
const
|
|
3889
|
+
const cache = renderedCardNodeCache.current;
|
|
3890
|
+
const usedKeys = /* @__PURE__ */ new Set();
|
|
3891
|
+
const emittedBlockKeys = /* @__PURE__ */ new Set();
|
|
3886
3892
|
segments.forEach((segment, segIdx) => {
|
|
3887
3893
|
if (segment.type !== "text") return;
|
|
3888
3894
|
const text = segment.text;
|
|
@@ -3894,31 +3900,40 @@ var ChatMessageEnhanced = forwardRef12(
|
|
|
3894
3900
|
const cardType = match2[1];
|
|
3895
3901
|
const cardId = match2[2];
|
|
3896
3902
|
const key = `${cardType}:${cardId}`;
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3903
|
+
usedKeys.add(key);
|
|
3904
|
+
const refMatch = refs[key];
|
|
3905
|
+
let entry = cache.get(key);
|
|
3906
|
+
if (!entry || entry.refMatch !== refMatch || entry.render !== render) {
|
|
3900
3907
|
const refForRender = refMatch ?? {
|
|
3901
3908
|
type: cardType,
|
|
3902
3909
|
id: cardId,
|
|
3903
3910
|
title: cardId,
|
|
3904
3911
|
url: null
|
|
3905
3912
|
};
|
|
3906
|
-
|
|
3907
|
-
|
|
3913
|
+
entry = { refMatch, render, node: render(refForRender) };
|
|
3914
|
+
cache.set(key, entry);
|
|
3908
3915
|
}
|
|
3916
|
+
const rendered = entry.node;
|
|
3909
3917
|
if (React9.isValidElement(rendered) && rendered.type === BlockCard) {
|
|
3910
3918
|
const props2 = rendered.props;
|
|
3911
3919
|
const markerEnd = match2.index + match2[0].length;
|
|
3912
3920
|
parts.push({ kind: "text", text: text.slice(cursor, markerEnd) });
|
|
3913
|
-
|
|
3921
|
+
if (!emittedBlockKeys.has(key)) {
|
|
3922
|
+
emittedBlockKeys.add(key);
|
|
3923
|
+
parts.push({ kind: "block", key, node: props2.children });
|
|
3924
|
+
}
|
|
3914
3925
|
cursor = markerEnd;
|
|
3915
|
-
const refMatch = refs[key];
|
|
3916
3926
|
inlineByKey.set(
|
|
3917
3927
|
key,
|
|
3918
3928
|
props2.inline != null ? props2.inline : /* @__PURE__ */ jsx22("span", { className: "text-ods-text-primary font-medium", children: refMatch?.title ?? cardId })
|
|
3919
3929
|
);
|
|
3920
3930
|
} else if (rendered != null) {
|
|
3921
|
-
|
|
3931
|
+
parts.push({ kind: "text", text: text.slice(cursor, match2.index) });
|
|
3932
|
+
if (!emittedBlockKeys.has(key)) {
|
|
3933
|
+
emittedBlockKeys.add(key);
|
|
3934
|
+
parts.push({ kind: "block", key, node: rendered });
|
|
3935
|
+
}
|
|
3936
|
+
cursor = match2.index + match2[0].length;
|
|
3922
3937
|
}
|
|
3923
3938
|
}
|
|
3924
3939
|
if (cursor < text.length) {
|
|
@@ -3928,6 +3943,11 @@ var ChatMessageEnhanced = forwardRef12(
|
|
|
3928
3943
|
partsBySegment.set(segIdx, parts);
|
|
3929
3944
|
}
|
|
3930
3945
|
});
|
|
3946
|
+
if (cache.size > usedKeys.size) {
|
|
3947
|
+
for (const k of cache.keys()) {
|
|
3948
|
+
if (!usedKeys.has(k)) cache.delete(k);
|
|
3949
|
+
}
|
|
3950
|
+
}
|
|
3931
3951
|
return { inlineByKey, partsBySegment };
|
|
3932
3952
|
}, [hasMarkerSupport, chatRefs, renderEntityCard, segments]);
|
|
3933
3953
|
const cardComponentOverrides = useMemo5(() => {
|
|
@@ -4113,7 +4133,7 @@ var ChatMessageEnhanced = forwardRef12(
|
|
|
4113
4133
|
}
|
|
4114
4134
|
);
|
|
4115
4135
|
ChatMessageEnhanced.displayName = "ChatMessageEnhanced";
|
|
4116
|
-
var MemoizedChatMessageEnhanced =
|
|
4136
|
+
var MemoizedChatMessageEnhanced = memo3(ChatMessageEnhanced, (prevProps, nextProps) => {
|
|
4117
4137
|
return prevProps.role === nextProps.role && prevProps.content === nextProps.content && prevProps.name === nextProps.name && prevProps.avatar === nextProps.avatar && prevProps.isTyping === nextProps.isTyping && prevProps.timestamp?.getTime() === nextProps.timestamp?.getTime() && prevProps.showAvatar === nextProps.showAvatar && prevProps.assistantType === nextProps.assistantType && prevProps.authorType === nextProps.authorType && prevProps.assistantIcon === nextProps.assistantIcon && prevProps.className === nextProps.className && // Reference equality on chatRefs is sufficient — the host's hooks should
|
|
4118
4138
|
// re-use the same Record instance per turn; mutations create a new map.
|
|
4119
4139
|
// Without this check, a parent re-render with a new (but equivalent)
|
|
@@ -4124,7 +4144,7 @@ MemoizedChatMessageEnhanced.displayName = "MemoizedChatMessageEnhanced";
|
|
|
4124
4144
|
|
|
4125
4145
|
// src/components/chat/chat-message-list.tsx
|
|
4126
4146
|
init_cn();
|
|
4127
|
-
import { useRef as
|
|
4147
|
+
import { useRef as useRef6, useEffect as useEffect6, useLayoutEffect as useLayoutEffect3, useImperativeHandle as useImperativeHandle2, forwardRef as forwardRef13 } from "react";
|
|
4128
4148
|
import { useStickToBottom } from "use-stick-to-bottom";
|
|
4129
4149
|
|
|
4130
4150
|
// src/components/chat/chat-message-skeleton.tsx
|
|
@@ -4349,13 +4369,13 @@ var ChatMessageList = forwardRef13(
|
|
|
4349
4369
|
resize: "smooth",
|
|
4350
4370
|
initial: false
|
|
4351
4371
|
});
|
|
4352
|
-
const sentinelRef =
|
|
4353
|
-
const onLoadMoreRef =
|
|
4372
|
+
const sentinelRef = useRef6(null);
|
|
4373
|
+
const onLoadMoreRef = useRef6(onLoadMore);
|
|
4354
4374
|
onLoadMoreRef.current = onLoadMore;
|
|
4355
|
-
const isFetchingRef =
|
|
4375
|
+
const isFetchingRef = useRef6(isFetchingNextPage);
|
|
4356
4376
|
isFetchingRef.current = isFetchingNextPage;
|
|
4357
|
-
const prevRenderRef =
|
|
4358
|
-
const prependRef =
|
|
4377
|
+
const prevRenderRef = useRef6({ dialogId: void 0, messageCount: 0, lastMessageId: void 0 });
|
|
4378
|
+
const prependRef = useRef6({ firstMessageId: void 0, firstMessageContent: void 0, scrollHeight: 0 });
|
|
4359
4379
|
useEffect6(() => {
|
|
4360
4380
|
if (!autoScroll) return;
|
|
4361
4381
|
const dialogChanged = dialogId !== prevRenderRef.current.dialogId;
|
|
@@ -4424,8 +4444,8 @@ var ChatMessageList = forwardRef13(
|
|
|
4424
4444
|
prependRef.current.firstMessageContent = currentFirstContent;
|
|
4425
4445
|
}
|
|
4426
4446
|
}, [messages, scrollRef]);
|
|
4427
|
-
const messageElsRef =
|
|
4428
|
-
const refCallbacksRef =
|
|
4447
|
+
const messageElsRef = useRef6(/* @__PURE__ */ new Map());
|
|
4448
|
+
const refCallbacksRef = useRef6(/* @__PURE__ */ new Map());
|
|
4429
4449
|
const getRegisterMessageEl = (id) => {
|
|
4430
4450
|
let cb = refCallbacksRef.current.get(id);
|
|
4431
4451
|
if (cb) return cb;
|
|
@@ -4440,13 +4460,13 @@ var ChatMessageList = forwardRef13(
|
|
|
4440
4460
|
refCallbacksRef.current.set(id, cb);
|
|
4441
4461
|
return cb;
|
|
4442
4462
|
};
|
|
4443
|
-
const scrolledIdsRef =
|
|
4463
|
+
const scrolledIdsRef = useRef6(null);
|
|
4444
4464
|
if (scrolledIdsRef.current === null) {
|
|
4445
4465
|
scrolledIdsRef.current = new Set(
|
|
4446
4466
|
messages.filter((m) => hasNonEmptyContent(m.content)).map((m) => m.id)
|
|
4447
4467
|
);
|
|
4448
4468
|
}
|
|
4449
|
-
const anchorWatcherRef =
|
|
4469
|
+
const anchorWatcherRef = useRef6(null);
|
|
4450
4470
|
useLayoutEffect3(() => {
|
|
4451
4471
|
if (!autoScroll) return;
|
|
4452
4472
|
const last = messages[messages.length - 1];
|
|
@@ -6198,7 +6218,7 @@ function ChatPanelHeader({
|
|
|
6198
6218
|
}
|
|
6199
6219
|
|
|
6200
6220
|
// src/components/chat/chat-attachment-bar.tsx
|
|
6201
|
-
import { useEffect as useEffect12, useRef as
|
|
6221
|
+
import { useEffect as useEffect12, useRef as useRef11, useState as useState17 } from "react";
|
|
6202
6222
|
init_button2();
|
|
6203
6223
|
init_cn();
|
|
6204
6224
|
|
|
@@ -6276,7 +6296,7 @@ function ChatAttachmentAddButton({
|
|
|
6276
6296
|
disabled = false,
|
|
6277
6297
|
size = "default"
|
|
6278
6298
|
}) {
|
|
6279
|
-
const fileInputRef =
|
|
6299
|
+
const fileInputRef = useRef11(null);
|
|
6280
6300
|
const compact = size === "compact";
|
|
6281
6301
|
const boxClass = compact ? "h-6 w-6" : "h-7 w-7";
|
|
6282
6302
|
if (!attachmentsEnabled) {
|
|
@@ -6757,7 +6777,7 @@ function ChatArchivePage({
|
|
|
6757
6777
|
// src/components/chat/chat-sidebar.tsx
|
|
6758
6778
|
init_cn();
|
|
6759
6779
|
init_button2();
|
|
6760
|
-
import { forwardRef as forwardRef22, useRef as
|
|
6780
|
+
import { forwardRef as forwardRef22, useRef as useRef12, useEffect as useEffect13 } from "react";
|
|
6761
6781
|
|
|
6762
6782
|
// src/components/chat/chat-sidebar-skeleton.tsx
|
|
6763
6783
|
init_cn();
|
|
@@ -6873,11 +6893,11 @@ DialogListItem.displayName = "DialogListItem";
|
|
|
6873
6893
|
var ChatSidebar = forwardRef22(
|
|
6874
6894
|
({ className, onNewChat, onDialogSelect, dialogs = [], activeDialogId, isLoading, isCreatingDialog, children, hasNextPage, isFetchingNextPage, onLoadMore, ...props }, ref) => {
|
|
6875
6895
|
const showEmptyState = dialogs.length === 0 && !children;
|
|
6876
|
-
const scrollContainerRef =
|
|
6877
|
-
const loadMoreRef =
|
|
6878
|
-
const onLoadMoreRef =
|
|
6896
|
+
const scrollContainerRef = useRef12(null);
|
|
6897
|
+
const loadMoreRef = useRef12(null);
|
|
6898
|
+
const onLoadMoreRef = useRef12(onLoadMore);
|
|
6879
6899
|
onLoadMoreRef.current = onLoadMore;
|
|
6880
|
-
const isFetchingRef =
|
|
6900
|
+
const isFetchingRef = useRef12(isFetchingNextPage);
|
|
6881
6901
|
isFetchingRef.current = isFetchingNextPage;
|
|
6882
6902
|
useEffect13(() => {
|
|
6883
6903
|
const scrollContainer = scrollContainerRef.current;
|
|
@@ -7646,7 +7666,7 @@ var TabsContent = React25.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
7646
7666
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
7647
7667
|
|
|
7648
7668
|
// src/components/features/video.tsx
|
|
7649
|
-
import { useEffect as useEffect15, useMemo as useMemo8, useRef as
|
|
7669
|
+
import { useEffect as useEffect15, useMemo as useMemo8, useRef as useRef13, useState as useState19 } from "react";
|
|
7650
7670
|
import MuxPlayer from "@mux/mux-player-react";
|
|
7651
7671
|
|
|
7652
7672
|
// src/utils/fetch-priority.ts
|
|
@@ -7822,7 +7842,7 @@ function YouTubeFacadeInner({
|
|
|
7822
7842
|
minimalControls
|
|
7823
7843
|
}) {
|
|
7824
7844
|
const [activated, setActivated] = useState19(false);
|
|
7825
|
-
const iframeRef =
|
|
7845
|
+
const iframeRef = useRef13(null);
|
|
7826
7846
|
const { embedUrl, posterJpg, posterWebp } = useMemo8(() => {
|
|
7827
7847
|
const params = new URLSearchParams({
|
|
7828
7848
|
autoplay: "1",
|
|
@@ -9985,7 +10005,7 @@ import {
|
|
|
9985
10005
|
useEffect as useEffect16,
|
|
9986
10006
|
useImperativeHandle as useImperativeHandle3,
|
|
9987
10007
|
useMemo as useMemo11,
|
|
9988
|
-
useRef as
|
|
10008
|
+
useRef as useRef15,
|
|
9989
10009
|
useState as useState22
|
|
9990
10010
|
} from "react";
|
|
9991
10011
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
@@ -10090,8 +10110,8 @@ function AutocompleteInner(props, ref) {
|
|
|
10090
10110
|
};
|
|
10091
10111
|
const [isOpen, setIsOpen] = useState22(false);
|
|
10092
10112
|
const [highlightedIndex, setHighlightedIndex] = useState22(-1);
|
|
10093
|
-
const containerRef =
|
|
10094
|
-
const hiddenTagsPopupRef =
|
|
10113
|
+
const containerRef = useRef15(null);
|
|
10114
|
+
const hiddenTagsPopupRef = useRef15(null);
|
|
10095
10115
|
const isInvalid = invalid || !!error;
|
|
10096
10116
|
useImperativeHandle3(ref, () => containerRef.current);
|
|
10097
10117
|
const selectedOptions = useMemo11(() => {
|
|
@@ -10109,7 +10129,7 @@ function AutocompleteInner(props, ref) {
|
|
|
10109
10129
|
const hiddenTags = multiple ? selectedOptions.slice(visibleCount) : [];
|
|
10110
10130
|
const hiddenTagsCount = multiple ? selectedOptions.length - visibleCount : 0;
|
|
10111
10131
|
const [showHiddenTags, setShowHiddenTags] = useState22(false);
|
|
10112
|
-
const hiddenTagsRef =
|
|
10132
|
+
const hiddenTagsRef = useRef15(null);
|
|
10113
10133
|
useEffect16(() => {
|
|
10114
10134
|
if (!showHiddenTags) return;
|
|
10115
10135
|
const handleClick = (e) => {
|
|
@@ -11484,7 +11504,7 @@ init_cn();
|
|
|
11484
11504
|
import React39 from "react";
|
|
11485
11505
|
|
|
11486
11506
|
// src/components/ui/progress-bar.tsx
|
|
11487
|
-
import { useEffect as useEffect17, useRef as
|
|
11507
|
+
import { useEffect as useEffect17, useRef as useRef16, useState as useState24 } from "react";
|
|
11488
11508
|
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
11489
11509
|
var ProgressBar = ({
|
|
11490
11510
|
progress,
|
|
@@ -11500,7 +11520,7 @@ var ProgressBar = ({
|
|
|
11500
11520
|
const isMdUp = useMdUp() ?? true;
|
|
11501
11521
|
const effectiveSegmentWidth = isMdUp ? segmentWidth : mobileSegmentWidth;
|
|
11502
11522
|
const effectiveHeight = isMdUp ? height : mobileHeight;
|
|
11503
|
-
const containerRef =
|
|
11523
|
+
const containerRef = useRef16(null);
|
|
11504
11524
|
const [segmentCount, setSegmentCount] = useState24(0);
|
|
11505
11525
|
useEffect17(() => {
|
|
11506
11526
|
if (!containerRef.current) return;
|
|
@@ -13658,7 +13678,7 @@ function TabContent({
|
|
|
13658
13678
|
// src/components/ui/tab-navigation.tsx
|
|
13659
13679
|
init_next_navigation();
|
|
13660
13680
|
init_cn();
|
|
13661
|
-
import { useState as useState30, useEffect as useEffect22, useMemo as useMemo13, useRef as
|
|
13681
|
+
import { useState as useState30, useEffect as useEffect22, useMemo as useMemo13, useRef as useRef19, useCallback as useCallback12 } from "react";
|
|
13662
13682
|
import { Fragment as Fragment16, jsx as jsx104, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
13663
13683
|
function TabNavigation({
|
|
13664
13684
|
activeTab: controlledActiveTab,
|
|
@@ -13710,7 +13730,7 @@ function TabNavigation({
|
|
|
13710
13730
|
controlledOnTabChange?.(tabId);
|
|
13711
13731
|
}
|
|
13712
13732
|
};
|
|
13713
|
-
const scrollRef =
|
|
13733
|
+
const scrollRef = useRef19(null);
|
|
13714
13734
|
const [canScrollLeft, setCanScrollLeft] = useState30(false);
|
|
13715
13735
|
const [canScrollRight, setCanScrollRight] = useState30(false);
|
|
13716
13736
|
const updateScrollShadows = useCallback12(() => {
|
|
@@ -13869,7 +13889,7 @@ var Progress = React58.forwardRef(({ className, value, indicatorClassName, ...pr
|
|
|
13869
13889
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
13870
13890
|
|
|
13871
13891
|
// src/components/ui/release-changelog-section.tsx
|
|
13872
|
-
import { useState as useState31, useRef as
|
|
13892
|
+
import { useState as useState31, useRef as useRef20, useEffect as useEffect23 } from "react";
|
|
13873
13893
|
import { ChevronDown as ChevronDown5 } from "lucide-react";
|
|
13874
13894
|
import { jsx as jsx107, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
13875
13895
|
var PREVIEW_COLLAPSED_HEIGHT = 120;
|
|
@@ -13886,7 +13906,7 @@ function ReleaseChangelogSection({
|
|
|
13886
13906
|
}) {
|
|
13887
13907
|
const [collapsed, setCollapsed] = useState31(collapsible ? defaultCollapsed : false);
|
|
13888
13908
|
const [previewExpanded, setPreviewExpanded] = useState31(false);
|
|
13889
|
-
const previewContentRef =
|
|
13909
|
+
const previewContentRef = useRef20(null);
|
|
13890
13910
|
useEffect23(() => {
|
|
13891
13911
|
setPreviewExpanded(false);
|
|
13892
13912
|
}, [entries.length]);
|
|
@@ -14021,7 +14041,7 @@ function StatusIndicator({ status, label, href }) {
|
|
|
14021
14041
|
}
|
|
14022
14042
|
|
|
14023
14043
|
// src/components/ui/hover-dropdown.tsx
|
|
14024
|
-
import { useState as useState32, useRef as
|
|
14044
|
+
import { useState as useState32, useRef as useRef21, useCallback as useCallback13 } from "react";
|
|
14025
14045
|
import { Fragment as Fragment17, jsx as jsx109, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
14026
14046
|
function DefaultAnchor({
|
|
14027
14047
|
href,
|
|
@@ -14039,8 +14059,8 @@ function HoverDropdown({
|
|
|
14039
14059
|
renderAnchor
|
|
14040
14060
|
}) {
|
|
14041
14061
|
const [open, setOpen] = useState32(false);
|
|
14042
|
-
const timeoutRef =
|
|
14043
|
-
const containerRef =
|
|
14062
|
+
const timeoutRef = useRef21(void 0);
|
|
14063
|
+
const containerRef = useRef21(null);
|
|
14044
14064
|
const show = useCallback13(() => {
|
|
14045
14065
|
clearTimeout(timeoutRef.current);
|
|
14046
14066
|
setOpen(true);
|
|
@@ -18019,7 +18039,7 @@ function FeatureList({
|
|
|
18019
18039
|
|
|
18020
18040
|
// src/components/ui/truncate-text.tsx
|
|
18021
18041
|
init_cn();
|
|
18022
|
-
import { useEffect as useEffect26, useRef as
|
|
18042
|
+
import { useEffect as useEffect26, useRef as useRef23, useState as useState36 } from "react";
|
|
18023
18043
|
import { jsx as jsx139 } from "react/jsx-runtime";
|
|
18024
18044
|
var VARIANT_CLASS = {
|
|
18025
18045
|
h1: "text-h1",
|
|
@@ -18050,7 +18070,7 @@ function TruncateText({
|
|
|
18050
18070
|
tone = "primary",
|
|
18051
18071
|
mono = false
|
|
18052
18072
|
}) {
|
|
18053
|
-
const ref =
|
|
18073
|
+
const ref = useRef23(null);
|
|
18054
18074
|
const [isTruncated, setIsTruncated] = useState36(false);
|
|
18055
18075
|
const isMultiLine = lines > 1;
|
|
18056
18076
|
useEffect26(() => {
|
|
@@ -19123,7 +19143,7 @@ var ErrorBoundary = class extends Component {
|
|
|
19123
19143
|
|
|
19124
19144
|
// src/components/features/figma-prototype-viewer.tsx
|
|
19125
19145
|
init_cn();
|
|
19126
|
-
import { useState as useState42, useRef as
|
|
19146
|
+
import { useState as useState42, useRef as useRef24, useEffect as useEffect31, useCallback as useCallback15, useMemo as useMemo16 } from "react";
|
|
19127
19147
|
|
|
19128
19148
|
// src/components/features/section-selector.tsx
|
|
19129
19149
|
init_cn();
|
|
@@ -19492,10 +19512,10 @@ var FigmaPrototypeViewer = ({
|
|
|
19492
19512
|
}) => {
|
|
19493
19513
|
const clientId = process.env.NEXT_PUBLIC_FIGMA_CLIENT_ID || "UTQPwZHR9OZp68TTGPFFi5";
|
|
19494
19514
|
const showDebugPanel = process.env.NEXT_PUBLIC_FIGMA_DEBUG === "true";
|
|
19495
|
-
const iframeRef =
|
|
19496
|
-
const containerRef =
|
|
19497
|
-
const navTimerRef =
|
|
19498
|
-
const touchTimerRef =
|
|
19515
|
+
const iframeRef = useRef24(null);
|
|
19516
|
+
const containerRef = useRef24(null);
|
|
19517
|
+
const navTimerRef = useRef24(null);
|
|
19518
|
+
const touchTimerRef = useRef24(null);
|
|
19499
19519
|
const [screenWidth, setScreenWidth] = useState42(
|
|
19500
19520
|
typeof window !== "undefined" ? window.innerWidth : DESKTOP_BREAKPOINT
|
|
19501
19521
|
);
|
|
@@ -19786,7 +19806,7 @@ var FigmaPrototypeViewer = ({
|
|
|
19786
19806
|
|
|
19787
19807
|
// src/components/features/filters-dropdown.tsx
|
|
19788
19808
|
init_cn();
|
|
19789
|
-
import { useEffect as useEffect32, useRef as
|
|
19809
|
+
import { useEffect as useEffect32, useRef as useRef25, useState as useState43 } from "react";
|
|
19790
19810
|
import { jsx as jsx156, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
19791
19811
|
var FilterCheckbox = ({ checked, disabled = false, className }) => {
|
|
19792
19812
|
return /* @__PURE__ */ jsx156(
|
|
@@ -19823,9 +19843,9 @@ var FiltersDropdown = ({
|
|
|
19823
19843
|
const [isVisible, setIsVisible] = useState43(false);
|
|
19824
19844
|
const [isMobile, setIsMobile] = useState43(false);
|
|
19825
19845
|
const [actualPlacement, setActualPlacement] = useState43(placement);
|
|
19826
|
-
const dropdownRef =
|
|
19827
|
-
const triggerRef =
|
|
19828
|
-
const containerRef =
|
|
19846
|
+
const dropdownRef = useRef25(null);
|
|
19847
|
+
const triggerRef = useRef25(null);
|
|
19848
|
+
const containerRef = useRef25(null);
|
|
19829
19849
|
useEffect32(() => {
|
|
19830
19850
|
if (isOpen) {
|
|
19831
19851
|
setShouldRender(true);
|
|
@@ -20230,7 +20250,7 @@ function useLoading() {
|
|
|
20230
20250
|
}
|
|
20231
20251
|
|
|
20232
20252
|
// src/components/features/media-gallery-manager.tsx
|
|
20233
|
-
import { useState as useState45, useRef as
|
|
20253
|
+
import { useState as useState45, useRef as useRef26, useCallback as useCallback16 } from "react";
|
|
20234
20254
|
import {
|
|
20235
20255
|
Upload,
|
|
20236
20256
|
Image as ImageIcon2,
|
|
@@ -20250,7 +20270,7 @@ function MediaGalleryManager({
|
|
|
20250
20270
|
modalTitle = "Media Gallery",
|
|
20251
20271
|
className = ""
|
|
20252
20272
|
}) {
|
|
20253
|
-
const fileInputRef =
|
|
20273
|
+
const fileInputRef = useRef26(null);
|
|
20254
20274
|
const [deletingIndex, setDeletingIndex] = useState45(null);
|
|
20255
20275
|
const [draggedIndex, setDraggedIndex] = useState45(null);
|
|
20256
20276
|
const handleFileSelect = useCallback16(async (event) => {
|
|
@@ -20462,7 +20482,7 @@ function OSTypeBadgeGroup({
|
|
|
20462
20482
|
}
|
|
20463
20483
|
|
|
20464
20484
|
// src/components/features/parallax-image-showcase.tsx
|
|
20465
|
-
import { useEffect as useEffect34, useState as useState46, useRef as
|
|
20485
|
+
import { useEffect as useEffect34, useState as useState46, useRef as useRef27 } from "react";
|
|
20466
20486
|
import { motion, useScroll, useTransform, useMotionValue, useSpring } from "framer-motion";
|
|
20467
20487
|
import { jsx as jsx163, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
20468
20488
|
var ParallaxImageShowcase = ({
|
|
@@ -20481,7 +20501,7 @@ var ParallaxImageShowcase = ({
|
|
|
20481
20501
|
const mouseXSpring = useSpring(mouseX, springConfig);
|
|
20482
20502
|
const mouseYSpring = useSpring(mouseY, springConfig);
|
|
20483
20503
|
const [componentRect, setComponentRect] = useState46(null);
|
|
20484
|
-
const componentRef =
|
|
20504
|
+
const componentRef = useRef27(null);
|
|
20485
20505
|
useEffect34(() => {
|
|
20486
20506
|
const updateRect = () => {
|
|
20487
20507
|
if (componentRef.current) {
|
|
@@ -21008,7 +21028,7 @@ function PushButtonSelector({
|
|
|
21008
21028
|
}
|
|
21009
21029
|
|
|
21010
21030
|
// src/components/features/release-media-manager.tsx
|
|
21011
|
-
import { useState as useState47, useRef as
|
|
21031
|
+
import { useState as useState47, useRef as useRef28 } from "react";
|
|
21012
21032
|
import { Trash2 as Trash24, Plus as Plus5, Image as ImageIcon3, Video as Video6, Upload as Upload2, Loader2 as Loader24, GripVertical as GripVertical2 } from "lucide-react";
|
|
21013
21033
|
import { jsx as jsx167, jsxs as jsxs131 } from "react/jsx-runtime";
|
|
21014
21034
|
function ReleaseMediaManager({
|
|
@@ -21017,7 +21037,7 @@ function ReleaseMediaManager({
|
|
|
21017
21037
|
onUpload,
|
|
21018
21038
|
className = ""
|
|
21019
21039
|
}) {
|
|
21020
|
-
const fileInputRef =
|
|
21040
|
+
const fileInputRef = useRef28(null);
|
|
21021
21041
|
const [uploadingIndex, setUploadingIndex] = useState47(null);
|
|
21022
21042
|
const handleFileSelect = async (event) => {
|
|
21023
21043
|
const file = event.target.files?.[0];
|
|
@@ -23523,7 +23543,7 @@ function ViewToggle({
|
|
|
23523
23543
|
|
|
23524
23544
|
// src/components/features/policy-configuration-panel.tsx
|
|
23525
23545
|
init_cn();
|
|
23526
|
-
import { useRef as
|
|
23546
|
+
import { useRef as useRef29, useEffect as useEffect36, useState as useState52 } from "react";
|
|
23527
23547
|
import { ChevronDown as ChevronDown8 } from "lucide-react";
|
|
23528
23548
|
init_button2();
|
|
23529
23549
|
|
|
@@ -23705,7 +23725,7 @@ var PolicyRow = ({ policy, categoryId, editMode, onPermissionChange }) => {
|
|
|
23705
23725
|
};
|
|
23706
23726
|
var useAnimatedHeight = (isExpanded) => {
|
|
23707
23727
|
const [height, setHeight] = useState52(0);
|
|
23708
|
-
const contentRef =
|
|
23728
|
+
const contentRef = useRef29(null);
|
|
23709
23729
|
useEffect36(() => {
|
|
23710
23730
|
if (contentRef.current) {
|
|
23711
23731
|
const contentHeight = contentRef.current.scrollHeight;
|
|
@@ -23862,7 +23882,7 @@ PolicyConfigurationPanel.displayName = "PolicyConfigurationPanel";
|
|
|
23862
23882
|
init_button2();
|
|
23863
23883
|
|
|
23864
23884
|
// src/components/ui/phone-input.tsx
|
|
23865
|
-
import { useCallback as useCallback18, useEffect as useEffect37, useMemo as useMemo17, useRef as
|
|
23885
|
+
import { useCallback as useCallback18, useEffect as useEffect37, useMemo as useMemo17, useRef as useRef30, useState as useState53 } from "react";
|
|
23866
23886
|
import { jsx as jsx194, jsxs as jsxs153 } from "react/jsx-runtime";
|
|
23867
23887
|
function PhoneInput({
|
|
23868
23888
|
value,
|
|
@@ -23880,7 +23900,7 @@ function PhoneInput({
|
|
|
23880
23900
|
[countryCode, priority, others]
|
|
23881
23901
|
);
|
|
23882
23902
|
const [isInvalid, setIsInvalid] = useState53(false);
|
|
23883
|
-
const debounceRef =
|
|
23903
|
+
const debounceRef = useRef30(null);
|
|
23884
23904
|
const digitCount = useCallback18((val) => val.replace(/[^0-9]/g, "").length, []);
|
|
23885
23905
|
const runValidation = useCallback18((phone) => {
|
|
23886
23906
|
if (!phone || digitCount(phone) === 0) {
|
|
@@ -24361,7 +24381,7 @@ function useOptionalNotifications() {
|
|
|
24361
24381
|
|
|
24362
24382
|
// src/components/features/notifications/notification-drawer.tsx
|
|
24363
24383
|
import * as DialogPrimitive3 from "@radix-ui/react-dialog";
|
|
24364
|
-
import { useEffect as useEffect41, useRef as
|
|
24384
|
+
import { useEffect as useEffect41, useRef as useRef32 } from "react";
|
|
24365
24385
|
init_button();
|
|
24366
24386
|
init_cn();
|
|
24367
24387
|
|
|
@@ -24535,9 +24555,9 @@ function DrawerScrollList({
|
|
|
24535
24555
|
loadMore,
|
|
24536
24556
|
loadMoreRootMargin
|
|
24537
24557
|
}) {
|
|
24538
|
-
const scrollRef =
|
|
24539
|
-
const sentinelRef =
|
|
24540
|
-
const loadMoreRef =
|
|
24558
|
+
const scrollRef = useRef32(null);
|
|
24559
|
+
const sentinelRef = useRef32(null);
|
|
24560
|
+
const loadMoreRef = useRef32(loadMore);
|
|
24541
24561
|
loadMoreRef.current = loadMore;
|
|
24542
24562
|
useEffect41(() => {
|
|
24543
24563
|
if (!loadMore || !hasMore || isLoadingMore) return;
|
|
@@ -25539,15 +25559,15 @@ function SortableRow({
|
|
|
25539
25559
|
|
|
25540
25560
|
// src/components/navigation/header.tsx
|
|
25541
25561
|
init_next_link();
|
|
25542
|
-
import React88, { useEffect as useEffect44, useRef as
|
|
25562
|
+
import React88, { useEffect as useEffect44, useRef as useRef35, useState as useState58 } from "react";
|
|
25543
25563
|
init_button2();
|
|
25544
25564
|
import { Fragment as Fragment32, jsx as jsx206, jsxs as jsxs162 } from "react/jsx-runtime";
|
|
25545
25565
|
function Header2({ config, platform }) {
|
|
25546
25566
|
const [show, setShow] = useState58(true);
|
|
25547
25567
|
const [lastScrollY, setLastScrollY] = useState58(0);
|
|
25548
25568
|
const [openDropdowns, setOpenDropdowns] = useState58({});
|
|
25549
|
-
const dropdownRefs =
|
|
25550
|
-
const triggerRefs =
|
|
25569
|
+
const dropdownRefs = useRef35({});
|
|
25570
|
+
const triggerRefs = useRef35({});
|
|
25551
25571
|
useEffect44(() => {
|
|
25552
25572
|
const handleClickOutside = (event) => {
|
|
25553
25573
|
const target = event.target;
|
|
@@ -25866,12 +25886,12 @@ function ClientOnlyHeader({ config, skeleton }) {
|
|
|
25866
25886
|
}
|
|
25867
25887
|
|
|
25868
25888
|
// src/components/navigation/mobile-nav-panel.tsx
|
|
25869
|
-
import { useEffect as useEffect46, useRef as
|
|
25889
|
+
import { useEffect as useEffect46, useRef as useRef36 } from "react";
|
|
25870
25890
|
init_button2();
|
|
25871
25891
|
import { X as X10 } from "lucide-react";
|
|
25872
25892
|
import { Fragment as Fragment33, jsx as jsx209, jsxs as jsxs164 } from "react/jsx-runtime";
|
|
25873
25893
|
function MobileNavPanel({ isOpen, config }) {
|
|
25874
|
-
const panelRef =
|
|
25894
|
+
const panelRef = useRef36(null);
|
|
25875
25895
|
useEffect46(() => {
|
|
25876
25896
|
if (isOpen) {
|
|
25877
25897
|
document.body.style.overflow = "hidden";
|
|
@@ -26209,7 +26229,7 @@ function SlidingSidebar({ config }) {
|
|
|
26209
26229
|
}
|
|
26210
26230
|
|
|
26211
26231
|
// src/components/navigation/sticky-section-nav.tsx
|
|
26212
|
-
import { useEffect as useEffect48, useState as useState61, useCallback as useCallback23, useRef as
|
|
26232
|
+
import { useEffect as useEffect48, useState as useState61, useCallback as useCallback23, useRef as useRef37 } from "react";
|
|
26213
26233
|
import { jsx as jsx211, jsxs as jsxs166 } from "react/jsx-runtime";
|
|
26214
26234
|
function StickySectionNav({
|
|
26215
26235
|
sections,
|
|
@@ -26271,7 +26291,7 @@ function StickySectionNav({
|
|
|
26271
26291
|
}
|
|
26272
26292
|
function useSectionNavigation(sections, options) {
|
|
26273
26293
|
const [activeSection, setActiveSection] = useState61(sections[0]?.id || "");
|
|
26274
|
-
const isScrollingFromClick =
|
|
26294
|
+
const isScrollingFromClick = useRef37(false);
|
|
26275
26295
|
const { offset: offset2 = 100 } = options || {};
|
|
26276
26296
|
const handleSectionClick = useCallback23((sectionId) => {
|
|
26277
26297
|
const targetElement = document.getElementById(sectionId);
|
|
@@ -27477,7 +27497,7 @@ function AppLayoutDrawerResizeHandle({
|
|
|
27477
27497
|
onSize(maxSize);
|
|
27478
27498
|
}
|
|
27479
27499
|
};
|
|
27480
|
-
const trackPosition = side === "right" ? "right-full top-4 bottom-4 w-
|
|
27500
|
+
const trackPosition = side === "right" ? "right-full top-4 bottom-4 w-6 items-center justify-end pr-1" : side === "left" ? "left-full top-4 bottom-4 w-6 items-center justify-start pl-1" : side === "bottom" ? "bottom-full left-4 right-4 h-6 justify-center items-end pb-1" : "top-full left-4 right-4 h-6 justify-center items-start pt-1";
|
|
27481
27501
|
const cursorClass = isHorizontal ? "cursor-col-resize" : "cursor-row-resize";
|
|
27482
27502
|
const gripClass = isHorizontal ? "h-10 w-1" : "w-10 h-1";
|
|
27483
27503
|
return /* @__PURE__ */ jsx223(
|
|
@@ -28048,7 +28068,7 @@ ScriptArguments.displayName = "ScriptArguments";
|
|
|
28048
28068
|
|
|
28049
28069
|
// src/components/shared/onboarding/onboarding-walkthrough.tsx
|
|
28050
28070
|
init_button2();
|
|
28051
|
-
import React97, { useRef as
|
|
28071
|
+
import React97, { useRef as useRef39, useCallback as useCallback28 } from "react";
|
|
28052
28072
|
|
|
28053
28073
|
// src/components/shared/onboarding/onboarding-step-card.tsx
|
|
28054
28074
|
import React96 from "react";
|
|
@@ -28172,10 +28192,10 @@ function OnboardingWalkthrough({
|
|
|
28172
28192
|
allStepsComplete,
|
|
28173
28193
|
markMultipleComplete
|
|
28174
28194
|
} = useOnboardingState(storageKey);
|
|
28175
|
-
const hasAutoMarkedRef =
|
|
28176
|
-
const autoMarkingInProgressRef =
|
|
28177
|
-
const lastCompletionStatusRef =
|
|
28178
|
-
const actionInProgressRef =
|
|
28195
|
+
const hasAutoMarkedRef = useRef39(false);
|
|
28196
|
+
const autoMarkingInProgressRef = useRef39(false);
|
|
28197
|
+
const lastCompletionStatusRef = useRef39(null);
|
|
28198
|
+
const actionInProgressRef = useRef39(/* @__PURE__ */ new Set());
|
|
28179
28199
|
React97.useEffect(() => {
|
|
28180
28200
|
if (isLoadingCompletion) {
|
|
28181
28201
|
hasAutoMarkedRef.current = false;
|
|
@@ -28860,7 +28880,7 @@ var ListLoader = (props) => /* @__PURE__ */ jsx240(ContentLoader, { ...props, va
|
|
|
28860
28880
|
|
|
28861
28881
|
// src/components/ui/table/table.tsx
|
|
28862
28882
|
init_cn();
|
|
28863
|
-
import { useEffect as useEffect52, useRef as
|
|
28883
|
+
import { useEffect as useEffect52, useRef as useRef41 } from "react";
|
|
28864
28884
|
init_pagination();
|
|
28865
28885
|
init_button2();
|
|
28866
28886
|
|
|
@@ -29611,8 +29631,8 @@ function Table({
|
|
|
29611
29631
|
};
|
|
29612
29632
|
const allSelected = selectedRows.length > 0 && selectedRows.length === data.length;
|
|
29613
29633
|
const someSelected = selectedRows.length > 0 && selectedRows.length < data.length;
|
|
29614
|
-
const sentinelRef =
|
|
29615
|
-
const onLoadMoreRef =
|
|
29634
|
+
const sentinelRef = useRef41(null);
|
|
29635
|
+
const onLoadMoreRef = useRef41(infiniteScroll?.onLoadMore);
|
|
29616
29636
|
onLoadMoreRef.current = infiniteScroll?.onLoadMore;
|
|
29617
29637
|
useEffect52(() => {
|
|
29618
29638
|
if (!infiniteScroll?.hasNextPage || infiniteScroll.isFetchingNextPage) return;
|
|
@@ -29826,7 +29846,7 @@ import { useMemo as useMemo25 } from "react";
|
|
|
29826
29846
|
|
|
29827
29847
|
// src/components/ui/query-report-table/query-report-table-header.tsx
|
|
29828
29848
|
init_cn();
|
|
29829
|
-
import { useRef as
|
|
29849
|
+
import { useRef as useRef42, useState as useState66, useCallback as useCallback29 } from "react";
|
|
29830
29850
|
import { jsx as jsx252, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
29831
29851
|
function QueryReportTableHeader({
|
|
29832
29852
|
columns,
|
|
@@ -29855,7 +29875,7 @@ function QueryReportTableHeader({
|
|
|
29855
29875
|
);
|
|
29856
29876
|
}
|
|
29857
29877
|
function TruncatedHeaderCell({ value, width }) {
|
|
29858
|
-
const textRef =
|
|
29878
|
+
const textRef = useRef42(null);
|
|
29859
29879
|
const [isTruncated, setIsTruncated] = useState66(false);
|
|
29860
29880
|
const checkTruncation = useCallback29(() => {
|
|
29861
29881
|
const el = textRef.current;
|
|
@@ -29885,7 +29905,7 @@ function TruncatedHeaderCell({ value, width }) {
|
|
|
29885
29905
|
|
|
29886
29906
|
// src/components/ui/query-report-table/query-report-table-row.tsx
|
|
29887
29907
|
init_cn();
|
|
29888
|
-
import { useRef as
|
|
29908
|
+
import { useRef as useRef43, useState as useState67, useCallback as useCallback30 } from "react";
|
|
29889
29909
|
import { jsx as jsx253, jsxs as jsxs203 } from "react/jsx-runtime";
|
|
29890
29910
|
function QueryReportTableRow({
|
|
29891
29911
|
row,
|
|
@@ -29931,7 +29951,7 @@ function QueryReportTableRow({
|
|
|
29931
29951
|
);
|
|
29932
29952
|
}
|
|
29933
29953
|
function TruncatedCell({ value, className }) {
|
|
29934
|
-
const textRef =
|
|
29954
|
+
const textRef = useRef43(null);
|
|
29935
29955
|
const [isTruncated, setIsTruncated] = useState67(false);
|
|
29936
29956
|
const checkTruncation = useCallback30(() => {
|
|
29937
29957
|
const el = textRef.current;
|
|
@@ -30450,7 +30470,7 @@ function DataTableEmpty({
|
|
|
30450
30470
|
// src/components/ui/data-table/data-table-row.tsx
|
|
30451
30471
|
init_next_link();
|
|
30452
30472
|
init_cn();
|
|
30453
|
-
import { memo as
|
|
30473
|
+
import { memo as memo4, useCallback as useCallback32, useRef as useRef44 } from "react";
|
|
30454
30474
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
30455
30475
|
|
|
30456
30476
|
// src/components/ui/data-table/data-table-skeleton.tsx
|
|
@@ -30531,7 +30551,7 @@ function DataTableRowImpl({
|
|
|
30531
30551
|
className
|
|
30532
30552
|
}) {
|
|
30533
30553
|
const isLinkMode = Boolean(href) && !onClick;
|
|
30534
|
-
const containerRef =
|
|
30554
|
+
const containerRef = useRef44(null);
|
|
30535
30555
|
const handleClick = useCallback32(
|
|
30536
30556
|
(e) => {
|
|
30537
30557
|
const target = e.target;
|
|
@@ -30601,7 +30621,7 @@ function DataTableRowImpl({
|
|
|
30601
30621
|
}
|
|
30602
30622
|
);
|
|
30603
30623
|
}
|
|
30604
|
-
var DataTableRow =
|
|
30624
|
+
var DataTableRow = memo4(DataTableRowImpl);
|
|
30605
30625
|
function CellContent({ children }) {
|
|
30606
30626
|
if (typeof children === "string" || typeof children === "number") {
|
|
30607
30627
|
return /* @__PURE__ */ jsx261("span", { className: "text-h4 text-ods-text-primary truncate", title: String(children), children });
|
|
@@ -30680,7 +30700,7 @@ function DataTableBody({
|
|
|
30680
30700
|
}
|
|
30681
30701
|
|
|
30682
30702
|
// src/components/ui/data-table/data-table-infinite-footer.tsx
|
|
30683
|
-
import { useEffect as useEffect53, useRef as
|
|
30703
|
+
import { useEffect as useEffect53, useRef as useRef45 } from "react";
|
|
30684
30704
|
import { Fragment as Fragment44, jsx as jsx263, jsxs as jsxs211 } from "react/jsx-runtime";
|
|
30685
30705
|
function DataTableInfiniteFooter({
|
|
30686
30706
|
hasNextPage,
|
|
@@ -30689,8 +30709,8 @@ function DataTableInfiniteFooter({
|
|
|
30689
30709
|
skeletonRows = 3,
|
|
30690
30710
|
rootMargin = "200px"
|
|
30691
30711
|
}) {
|
|
30692
|
-
const sentinelRef =
|
|
30693
|
-
const onLoadMoreRef =
|
|
30712
|
+
const sentinelRef = useRef45(null);
|
|
30713
|
+
const onLoadMoreRef = useRef45(onLoadMore);
|
|
30694
30714
|
onLoadMoreRef.current = onLoadMore;
|
|
30695
30715
|
useEffect53(() => {
|
|
30696
30716
|
if (!hasNextPage || isFetchingNextPage) return;
|
|
@@ -31324,7 +31344,7 @@ function FilterList({
|
|
|
31324
31344
|
// src/components/ui/tag-search-input.tsx
|
|
31325
31345
|
import {
|
|
31326
31346
|
useEffect as useEffect55,
|
|
31327
|
-
useRef as
|
|
31347
|
+
useRef as useRef47,
|
|
31328
31348
|
useState as useState69
|
|
31329
31349
|
} from "react";
|
|
31330
31350
|
init_cn();
|
|
@@ -31359,9 +31379,9 @@ function TagSearchInput({
|
|
|
31359
31379
|
limitTags,
|
|
31360
31380
|
placeholder: currentPlaceholder
|
|
31361
31381
|
});
|
|
31362
|
-
const wrapperRef =
|
|
31363
|
-
const hiddenTagsRef =
|
|
31364
|
-
const hiddenTagsPopupRef =
|
|
31382
|
+
const wrapperRef = useRef47(null);
|
|
31383
|
+
const hiddenTagsRef = useRef47(null);
|
|
31384
|
+
const hiddenTagsPopupRef = useRef47(null);
|
|
31365
31385
|
const [showHiddenTags, setShowHiddenTags] = useState69(false);
|
|
31366
31386
|
useEffect55(() => {
|
|
31367
31387
|
if (!showHiddenTags) return;
|
|
@@ -31518,7 +31538,7 @@ function TagSearchInput({
|
|
|
31518
31538
|
}
|
|
31519
31539
|
|
|
31520
31540
|
// src/components/ui/markdown-editor.tsx
|
|
31521
|
-
import { useRef as
|
|
31541
|
+
import { useRef as useRef48, useCallback as useCallback33, useState as useState70, useEffect as useEffect56 } from "react";
|
|
31522
31542
|
init_cn();
|
|
31523
31543
|
import { Loader2 as Loader28, Upload as Upload8 } from "lucide-react";
|
|
31524
31544
|
import { jsx as jsx268, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
@@ -31573,7 +31593,7 @@ function MarkdownEditor({
|
|
|
31573
31593
|
onFileUploaded,
|
|
31574
31594
|
renderPreview
|
|
31575
31595
|
}) {
|
|
31576
|
-
const fileInputRef =
|
|
31596
|
+
const fileInputRef = useRef48(null);
|
|
31577
31597
|
const [isUploading, setIsUploading] = useState70(false);
|
|
31578
31598
|
const [uploadProgress, setUploadProgress] = useState70("");
|
|
31579
31599
|
const [defaultExtraCommands, setDefaultExtraCommands] = useState70([]);
|
|
@@ -31666,11 +31686,11 @@ function MarkdownEditor({
|
|
|
31666
31686
|
}
|
|
31667
31687
|
} : null;
|
|
31668
31688
|
const extraCommands = uploadCommand ? [...defaultExtraCommands, uploadCommand] : defaultExtraCommands;
|
|
31669
|
-
const wrapperRef =
|
|
31670
|
-
const isDraggingRef =
|
|
31671
|
-
const mouseYRef =
|
|
31672
|
-
const rafRef =
|
|
31673
|
-
const scrollParentRef =
|
|
31689
|
+
const wrapperRef = useRef48(null);
|
|
31690
|
+
const isDraggingRef = useRef48(false);
|
|
31691
|
+
const mouseYRef = useRef48(0);
|
|
31692
|
+
const rafRef = useRef48(0);
|
|
31693
|
+
const scrollParentRef = useRef48(window);
|
|
31674
31694
|
const EDGE_ZONE = 60;
|
|
31675
31695
|
const MAX_SCROLL_SPEED = 15;
|
|
31676
31696
|
const findScrollParent = useCallback33((el) => {
|
|
@@ -36261,7 +36281,7 @@ function useChatCardItem(type, id) {
|
|
|
36261
36281
|
queryKey: ["chat-card-item", type, id],
|
|
36262
36282
|
queryFn: async () => {
|
|
36263
36283
|
if (!url) return null;
|
|
36264
|
-
const res = await
|
|
36284
|
+
const res = await embedAuthedFetch(url);
|
|
36265
36285
|
if (!res.ok) return null;
|
|
36266
36286
|
const data = await res.json();
|
|
36267
36287
|
const items = extractItems(data);
|
|
@@ -36273,7 +36293,16 @@ function useChatCardItem(type, id) {
|
|
|
36273
36293
|
// is opened and closed frequently, and re-fetching every time the
|
|
36274
36294
|
// user toggles back to the tab is wasteful (the row's id-keyed
|
|
36275
36295
|
// payload is effectively immutable).
|
|
36276
|
-
refetchOnWindowFocus: false
|
|
36296
|
+
refetchOnWindowFocus: false,
|
|
36297
|
+
// The id-keyed payload is effectively immutable, and a fetch-mode card
|
|
36298
|
+
// inside a STREAMING assistant message re-mounts on every chunk as the
|
|
36299
|
+
// surrounding markdown re-parses. Without a staleTime that meant a fresh
|
|
36300
|
+
// network fetch + loading-skeleton flash on every single chunk. Treat the
|
|
36301
|
+
// row as fresh for 5 min (matches the public pages) and keep it cached
|
|
36302
|
+
// long after unmount so remounts resolve synchronously from cache — no
|
|
36303
|
+
// refetch, no skeleton flash.
|
|
36304
|
+
staleTime: 5 * 60 * 1e3,
|
|
36305
|
+
gcTime: 30 * 60 * 1e3
|
|
36277
36306
|
});
|
|
36278
36307
|
return {
|
|
36279
36308
|
item: query.data ?? void 0,
|
|
@@ -37590,7 +37619,7 @@ function transformWebinarToProgram(webinar) {
|
|
|
37590
37619
|
}
|
|
37591
37620
|
|
|
37592
37621
|
// src/components/chat/hooks/use-chunk-catchup.ts
|
|
37593
|
-
import { useCallback as useCallback35, useRef as
|
|
37622
|
+
import { useCallback as useCallback35, useRef as useRef51 } from "react";
|
|
37594
37623
|
function makeSeqKey(messageType, chunkType, sequenceId) {
|
|
37595
37624
|
return `${messageType}:${chunkType}:${sequenceId}`;
|
|
37596
37625
|
}
|
|
@@ -37612,20 +37641,20 @@ function useChunkCatchup({
|
|
|
37612
37641
|
chatTypes = [CHAT_TYPE.CLIENT],
|
|
37613
37642
|
fetchChunks
|
|
37614
37643
|
}) {
|
|
37615
|
-
const processedSequenceKeys =
|
|
37616
|
-
const lastSequenceId =
|
|
37617
|
-
const fetchingInProgress =
|
|
37618
|
-
const lastFetchParams =
|
|
37619
|
-
const chunkBuffer =
|
|
37620
|
-
const bufferUntilInitialCatchupComplete =
|
|
37621
|
-
const hasCompletedInitialCatchup =
|
|
37622
|
-
const dialogIdRef =
|
|
37644
|
+
const processedSequenceKeys = useRef51(/* @__PURE__ */ new Set());
|
|
37645
|
+
const lastSequenceId = useRef51(null);
|
|
37646
|
+
const fetchingInProgress = useRef51(false);
|
|
37647
|
+
const lastFetchParams = useRef51(null);
|
|
37648
|
+
const chunkBuffer = useRef51([]);
|
|
37649
|
+
const bufferUntilInitialCatchupComplete = useRef51(false);
|
|
37650
|
+
const hasCompletedInitialCatchup = useRef51(false);
|
|
37651
|
+
const dialogIdRef = useRef51(dialogId);
|
|
37623
37652
|
dialogIdRef.current = dialogId;
|
|
37624
|
-
const chatTypesRef =
|
|
37653
|
+
const chatTypesRef = useRef51(chatTypes);
|
|
37625
37654
|
chatTypesRef.current = chatTypes;
|
|
37626
|
-
const fetchChunksRef =
|
|
37655
|
+
const fetchChunksRef = useRef51(fetchChunks);
|
|
37627
37656
|
fetchChunksRef.current = fetchChunks;
|
|
37628
|
-
const onChunkReceivedRef =
|
|
37657
|
+
const onChunkReceivedRef = useRef51(onChunkReceived);
|
|
37629
37658
|
onChunkReceivedRef.current = onChunkReceived;
|
|
37630
37659
|
const processChunk = useCallback35((chunk, messageType, forceProcess = false) => {
|
|
37631
37660
|
if (bufferUntilInitialCatchupComplete.current && !forceProcess) {
|
|
@@ -37802,7 +37831,7 @@ function useChunkCatchup({
|
|
|
37802
37831
|
}
|
|
37803
37832
|
|
|
37804
37833
|
// src/components/chat/hooks/use-jetstream-dialog-subscription.ts
|
|
37805
|
-
import { useEffect as useEffect61, useRef as
|
|
37834
|
+
import { useEffect as useEffect61, useRef as useRef52, useState as useState80 } from "react";
|
|
37806
37835
|
var DEFAULT_INACTIVE_THRESHOLD_MS = 5 * 6e4;
|
|
37807
37836
|
var DEFAULT_STREAM_NAME = "CHAT_CHUNKS";
|
|
37808
37837
|
function useJetStreamDialogSubscription({
|
|
@@ -37825,51 +37854,51 @@ function useJetStreamDialogSubscription({
|
|
|
37825
37854
|
const [isSubscribed, setIsSubscribed] = useState80(false);
|
|
37826
37855
|
const [reconnectionCount, setReconnectionCount] = useState80(0);
|
|
37827
37856
|
const [currentStreamSeq, setCurrentStreamSeq] = useState80(null);
|
|
37828
|
-
const clientRef =
|
|
37829
|
-
const subscriptionRef =
|
|
37830
|
-
const highestStreamSeqRef =
|
|
37831
|
-
const onEventRef =
|
|
37857
|
+
const clientRef = useRef52(null);
|
|
37858
|
+
const subscriptionRef = useRef52(null);
|
|
37859
|
+
const highestStreamSeqRef = useRef52(null);
|
|
37860
|
+
const onEventRef = useRef52(onEvent);
|
|
37832
37861
|
useEffect61(() => {
|
|
37833
37862
|
onEventRef.current = onEvent;
|
|
37834
37863
|
}, [onEvent]);
|
|
37835
|
-
const onConnectRef =
|
|
37864
|
+
const onConnectRef = useRef52(onConnect);
|
|
37836
37865
|
useEffect61(() => {
|
|
37837
37866
|
onConnectRef.current = onConnect;
|
|
37838
37867
|
}, [onConnect]);
|
|
37839
|
-
const onDisconnectRef =
|
|
37868
|
+
const onDisconnectRef = useRef52(onDisconnect);
|
|
37840
37869
|
useEffect61(() => {
|
|
37841
37870
|
onDisconnectRef.current = onDisconnect;
|
|
37842
37871
|
}, [onDisconnect]);
|
|
37843
|
-
const onSubscribedRef =
|
|
37872
|
+
const onSubscribedRef = useRef52(onSubscribed);
|
|
37844
37873
|
useEffect61(() => {
|
|
37845
37874
|
onSubscribedRef.current = onSubscribed;
|
|
37846
37875
|
}, [onSubscribed]);
|
|
37847
|
-
const onBeforeReconnectRef =
|
|
37876
|
+
const onBeforeReconnectRef = useRef52(onBeforeReconnect);
|
|
37848
37877
|
useEffect61(() => {
|
|
37849
37878
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
37850
37879
|
}, [onBeforeReconnect]);
|
|
37851
|
-
const getNatsWsUrlRef =
|
|
37880
|
+
const getNatsWsUrlRef = useRef52(getNatsWsUrl);
|
|
37852
37881
|
useEffect61(() => {
|
|
37853
37882
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
37854
37883
|
}, [getNatsWsUrl]);
|
|
37855
|
-
const reconnectionBackoffRef =
|
|
37884
|
+
const reconnectionBackoffRef = useRef52(reconnectionBackoff);
|
|
37856
37885
|
useEffect61(() => {
|
|
37857
37886
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
37858
37887
|
}, [reconnectionBackoff]);
|
|
37859
|
-
const optStartSeqRef =
|
|
37888
|
+
const optStartSeqRef = useRef52(optStartSeq);
|
|
37860
37889
|
useEffect61(() => {
|
|
37861
37890
|
optStartSeqRef.current = optStartSeq;
|
|
37862
37891
|
}, [optStartSeq]);
|
|
37863
|
-
const inactiveThresholdRef =
|
|
37892
|
+
const inactiveThresholdRef = useRef52(inactiveThresholdMs);
|
|
37864
37893
|
useEffect61(() => {
|
|
37865
37894
|
inactiveThresholdRef.current = inactiveThresholdMs;
|
|
37866
37895
|
}, [inactiveThresholdMs]);
|
|
37867
|
-
const hadConnectionBeforeRef =
|
|
37868
|
-
const clientConfigRef =
|
|
37896
|
+
const hadConnectionBeforeRef = useRef52(false);
|
|
37897
|
+
const clientConfigRef = useRef52(clientConfig);
|
|
37869
37898
|
useEffect61(() => {
|
|
37870
37899
|
clientConfigRef.current = clientConfig;
|
|
37871
37900
|
}, [clientConfig]);
|
|
37872
|
-
const currentWsUrlRef =
|
|
37901
|
+
const currentWsUrlRef = useRef52("");
|
|
37873
37902
|
const wsUrl = getNatsWsUrl();
|
|
37874
37903
|
useEffect61(() => {
|
|
37875
37904
|
if (!enabled || !wsUrl) {
|
|
@@ -38043,7 +38072,7 @@ function useJetStreamDialogSubscription({
|
|
|
38043
38072
|
}
|
|
38044
38073
|
|
|
38045
38074
|
// src/components/chat/hooks/use-nats-dialog-subscription.ts
|
|
38046
|
-
import { useEffect as useEffect62, useRef as
|
|
38075
|
+
import { useEffect as useEffect62, useRef as useRef53, useState as useState81 } from "react";
|
|
38047
38076
|
function useNatsDialogSubscription({
|
|
38048
38077
|
enabled,
|
|
38049
38078
|
dialogId,
|
|
@@ -38060,42 +38089,42 @@ function useNatsDialogSubscription({
|
|
|
38060
38089
|
const [isConnected, setIsConnected] = useState81(false);
|
|
38061
38090
|
const [isSubscribed, setIsSubscribed] = useState81(false);
|
|
38062
38091
|
const [reconnectionCount, setReconnectionCount] = useState81(0);
|
|
38063
|
-
const clientRef =
|
|
38064
|
-
const subscriptionRefs =
|
|
38065
|
-
const onEventRef =
|
|
38092
|
+
const clientRef = useRef53(null);
|
|
38093
|
+
const subscriptionRefs = useRef53(/* @__PURE__ */ new Map());
|
|
38094
|
+
const onEventRef = useRef53(onEvent);
|
|
38066
38095
|
useEffect62(() => {
|
|
38067
38096
|
onEventRef.current = onEvent;
|
|
38068
38097
|
}, [onEvent]);
|
|
38069
|
-
const onConnectRef =
|
|
38098
|
+
const onConnectRef = useRef53(onConnect);
|
|
38070
38099
|
useEffect62(() => {
|
|
38071
38100
|
onConnectRef.current = onConnect;
|
|
38072
38101
|
}, [onConnect]);
|
|
38073
|
-
const onDisconnectRef =
|
|
38102
|
+
const onDisconnectRef = useRef53(onDisconnect);
|
|
38074
38103
|
useEffect62(() => {
|
|
38075
38104
|
onDisconnectRef.current = onDisconnect;
|
|
38076
38105
|
}, [onDisconnect]);
|
|
38077
|
-
const onSubscribedRef =
|
|
38106
|
+
const onSubscribedRef = useRef53(onSubscribed);
|
|
38078
38107
|
useEffect62(() => {
|
|
38079
38108
|
onSubscribedRef.current = onSubscribed;
|
|
38080
38109
|
}, [onSubscribed]);
|
|
38081
|
-
const onBeforeReconnectRef =
|
|
38110
|
+
const onBeforeReconnectRef = useRef53(onBeforeReconnect);
|
|
38082
38111
|
useEffect62(() => {
|
|
38083
38112
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
38084
38113
|
}, [onBeforeReconnect]);
|
|
38085
|
-
const hadConnectionBeforeRef =
|
|
38086
|
-
const getNatsWsUrlRef =
|
|
38114
|
+
const hadConnectionBeforeRef = useRef53(false);
|
|
38115
|
+
const getNatsWsUrlRef = useRef53(getNatsWsUrl);
|
|
38087
38116
|
useEffect62(() => {
|
|
38088
38117
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
38089
38118
|
}, [getNatsWsUrl]);
|
|
38090
|
-
const reconnectionBackoffRef =
|
|
38119
|
+
const reconnectionBackoffRef = useRef53(reconnectionBackoff);
|
|
38091
38120
|
useEffect62(() => {
|
|
38092
38121
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
38093
38122
|
}, [reconnectionBackoff]);
|
|
38094
|
-
const clientConfigRef =
|
|
38123
|
+
const clientConfigRef = useRef53(clientConfig);
|
|
38095
38124
|
useEffect62(() => {
|
|
38096
38125
|
clientConfigRef.current = clientConfig;
|
|
38097
38126
|
}, [clientConfig]);
|
|
38098
|
-
const currentWsUrlRef =
|
|
38127
|
+
const currentWsUrlRef = useRef53("");
|
|
38099
38128
|
const wsUrl = getNatsWsUrl();
|
|
38100
38129
|
useEffect62(() => {
|
|
38101
38130
|
if (!enabled || !wsUrl) {
|
|
@@ -38175,13 +38204,13 @@ function useNatsDialogSubscription({
|
|
|
38175
38204
|
};
|
|
38176
38205
|
}, [enabled, wsUrl]);
|
|
38177
38206
|
const topicsKey = topics.join(",");
|
|
38178
|
-
const lastSubscribedDialogIdRef =
|
|
38179
|
-
const isConnectedRef =
|
|
38207
|
+
const lastSubscribedDialogIdRef = useRef53(null);
|
|
38208
|
+
const isConnectedRef = useRef53(isConnected);
|
|
38180
38209
|
useEffect62(() => {
|
|
38181
38210
|
isConnectedRef.current = isConnected;
|
|
38182
38211
|
}, [isConnected]);
|
|
38183
|
-
const currentDialogIdRef =
|
|
38184
|
-
const abortControllerRef =
|
|
38212
|
+
const currentDialogIdRef = useRef53(null);
|
|
38213
|
+
const abortControllerRef = useRef53(null);
|
|
38185
38214
|
useEffect62(() => {
|
|
38186
38215
|
currentDialogIdRef.current = dialogId;
|
|
38187
38216
|
if (!enabled || !dialogId) {
|
|
@@ -38313,7 +38342,7 @@ function buildNatsWsUrl(apiBaseUrl, options) {
|
|
|
38313
38342
|
}
|
|
38314
38343
|
|
|
38315
38344
|
// src/components/chat/hooks/use-realtime-chunk-processor.ts
|
|
38316
|
-
import { useCallback as useCallback36, useRef as
|
|
38345
|
+
import { useCallback as useCallback36, useRef as useRef54, useEffect as useEffect63 } from "react";
|
|
38317
38346
|
|
|
38318
38347
|
// src/components/chat/utils/chunk-parser.ts
|
|
38319
38348
|
function normalizeToolCalls(raw) {
|
|
@@ -38946,13 +38975,13 @@ function useRealtimeChunkProcessor(options) {
|
|
|
38946
38975
|
// get the new batch UI; pass `false` explicitly to fall back to legacy.
|
|
38947
38976
|
batchApprovalsEnabled = true
|
|
38948
38977
|
} = options;
|
|
38949
|
-
const accumulatorRef =
|
|
38978
|
+
const accumulatorRef = useRef54(
|
|
38950
38979
|
createMessageSegmentAccumulator({
|
|
38951
38980
|
onApprove: callbacks.onApprove,
|
|
38952
38981
|
onReject: callbacks.onReject
|
|
38953
38982
|
})
|
|
38954
38983
|
);
|
|
38955
|
-
const hasInitializedWithData =
|
|
38984
|
+
const hasInitializedWithData = useRef54(false);
|
|
38956
38985
|
useEffect63(() => {
|
|
38957
38986
|
if (initialState && !hasInitializedWithData.current) {
|
|
38958
38987
|
accumulatorRef.current.initializeWithState(initialState);
|
|
@@ -38966,9 +38995,9 @@ function useRealtimeChunkProcessor(options) {
|
|
|
38966
38995
|
hasInitializedWithData.current = true;
|
|
38967
38996
|
}
|
|
38968
38997
|
}, [initialState, callbacks]);
|
|
38969
|
-
const isInStreamRef =
|
|
38970
|
-
const hasEverStreamedRef =
|
|
38971
|
-
const pendingEscalatedRef =
|
|
38998
|
+
const isInStreamRef = useRef54(false);
|
|
38999
|
+
const hasEverStreamedRef = useRef54(false);
|
|
39000
|
+
const pendingEscalatedRef = useRef54(/* @__PURE__ */ new Map());
|
|
38972
39001
|
const processChunk = useCallback36(
|
|
38973
39002
|
(chunk) => {
|
|
38974
39003
|
if (!enableThinking && chunk && typeof chunk === "object" && chunk.type === MESSAGE_TYPE.THINKING) {
|
|
@@ -39268,7 +39297,7 @@ function useSlashCommandRegistry(commandsUrl, options) {
|
|
|
39268
39297
|
}
|
|
39269
39298
|
|
|
39270
39299
|
// src/components/chat/hooks/use-chat-attachments.ts
|
|
39271
|
-
import { useCallback as useCallback37, useMemo as useMemo30, useRef as
|
|
39300
|
+
import { useCallback as useCallback37, useMemo as useMemo30, useRef as useRef55, useState as useState83 } from "react";
|
|
39272
39301
|
import { fileTypeFromBlob } from "file-type";
|
|
39273
39302
|
var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
|
|
39274
39303
|
var CHAT_ATTACHMENTS_FOLDER = "chat";
|
|
@@ -39345,7 +39374,7 @@ function useChatAttachments() {
|
|
|
39345
39374
|
const runtime = useRequiredChatRuntime();
|
|
39346
39375
|
const uploadUrlEndpoint = runtime.endpoints.attachmentUploadUrl;
|
|
39347
39376
|
const [attachments, setAttachments] = useState83([]);
|
|
39348
|
-
const controllersRef =
|
|
39377
|
+
const controllersRef = useRef55(/* @__PURE__ */ new Map());
|
|
39349
39378
|
const updateOne = useCallback37((id, patch) => {
|
|
39350
39379
|
setAttachments((prev) => prev.map((a) => a.id === id ? { ...a, ...patch } : a));
|
|
39351
39380
|
}, []);
|
|
@@ -39434,7 +39463,7 @@ function useChatAttachments() {
|
|
|
39434
39463
|
},
|
|
39435
39464
|
[uploadUrlEndpoint, updateOne]
|
|
39436
39465
|
);
|
|
39437
|
-
const attachmentsRef =
|
|
39466
|
+
const attachmentsRef = useRef55([]);
|
|
39438
39467
|
attachmentsRef.current = attachments;
|
|
39439
39468
|
const addFiles = useCallback37(
|
|
39440
39469
|
(files) => {
|
|
@@ -39511,13 +39540,13 @@ function useChatAttachments() {
|
|
|
39511
39540
|
}
|
|
39512
39541
|
|
|
39513
39542
|
// src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
|
|
39514
|
-
import { useCallback as useCallback38, useEffect as useEffect65, useRef as
|
|
39543
|
+
import { useCallback as useCallback38, useEffect as useEffect65, useRef as useRef56, useState as useState84 } from "react";
|
|
39515
39544
|
import { jsx as jsx293 } from "react/jsx-runtime";
|
|
39516
39545
|
var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
|
|
39517
39546
|
function useChatAttachmentImageGallery() {
|
|
39518
39547
|
const runtime = useRequiredChatRuntime();
|
|
39519
39548
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
39520
|
-
const panelRef =
|
|
39549
|
+
const panelRef = useRef56(null);
|
|
39521
39550
|
const [state, setState] = useState84(CLOSED);
|
|
39522
39551
|
const handleClose = useCallback38(() => setState(CLOSED), []);
|
|
39523
39552
|
useEffect65(() => {
|
|
@@ -39618,10 +39647,10 @@ function useChatIdentity() {
|
|
|
39618
39647
|
}
|
|
39619
39648
|
|
|
39620
39649
|
// src/components/chat/hooks/use-close-on-navigation.ts
|
|
39621
|
-
import { useEffect as useEffect67, useRef as
|
|
39650
|
+
import { useEffect as useEffect67, useRef as useRef57 } from "react";
|
|
39622
39651
|
function useCloseOnNavigation(close, pathname) {
|
|
39623
|
-
const prevPathnameRef =
|
|
39624
|
-
const initializedRef =
|
|
39652
|
+
const prevPathnameRef = useRef57(null);
|
|
39653
|
+
const initializedRef = useRef57(false);
|
|
39625
39654
|
useEffect67(() => {
|
|
39626
39655
|
if (!initializedRef.current) {
|
|
39627
39656
|
initializedRef.current = true;
|
|
@@ -39636,14 +39665,14 @@ function useCloseOnNavigation(close, pathname) {
|
|
|
39636
39665
|
}
|
|
39637
39666
|
|
|
39638
39667
|
// src/components/chat/hooks/use-chat.ts
|
|
39639
|
-
import { useState as useState87, useCallback as useCallback40, useEffect as useEffect68, useRef as
|
|
39668
|
+
import { useState as useState87, useCallback as useCallback40, useEffect as useEffect68, useRef as useRef59 } from "react";
|
|
39640
39669
|
|
|
39641
39670
|
// src/components/chat/hooks/use-sse.ts
|
|
39642
|
-
import { useState as useState86, useCallback as useCallback39, useRef as
|
|
39671
|
+
import { useState as useState86, useCallback as useCallback39, useRef as useRef58 } from "react";
|
|
39643
39672
|
function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
39644
39673
|
const [isStreaming, setIsStreaming] = useState86(false);
|
|
39645
39674
|
const [error, setError] = useState86(null);
|
|
39646
|
-
const abortControllerRef =
|
|
39675
|
+
const abortControllerRef = useRef58(null);
|
|
39647
39676
|
const fallbackStream = useCallback39(async function* () {
|
|
39648
39677
|
throw new Error(
|
|
39649
39678
|
"[useSSE] No streamFn provided and `useMock: true` is no longer wired into the lib. Supply a `streamFn` (see `createDocStreamFn` in use-embedded-chat) or migrate the mock to your host code."
|
|
@@ -39711,8 +39740,8 @@ function useChat({
|
|
|
39711
39740
|
} = {}) {
|
|
39712
39741
|
const [messages, setMessages] = useState87(() => initialMessages ?? []);
|
|
39713
39742
|
const [isTyping, setIsTyping] = useState87(false);
|
|
39714
|
-
const currentAssistantSegmentsRef =
|
|
39715
|
-
const onMessagesChangeRef =
|
|
39743
|
+
const currentAssistantSegmentsRef = useRef59([]);
|
|
39744
|
+
const onMessagesChangeRef = useRef59(onMessagesChange);
|
|
39716
39745
|
onMessagesChangeRef.current = onMessagesChange;
|
|
39717
39746
|
useEffect68(() => {
|
|
39718
39747
|
onMessagesChangeRef.current?.(messages);
|
|
@@ -40003,7 +40032,7 @@ function useChat({
|
|
|
40003
40032
|
}
|
|
40004
40033
|
|
|
40005
40034
|
// src/components/chat/hooks/use-sse-chat-adapter.ts
|
|
40006
|
-
import { useState as useState88, useEffect as useEffect69, useCallback as useCallback41, useMemo as useMemo31, useRef as
|
|
40035
|
+
import { useState as useState88, useEffect as useEffect69, useCallback as useCallback41, useMemo as useMemo31, useRef as useRef60 } from "react";
|
|
40007
40036
|
function createEmptyTurnMeta() {
|
|
40008
40037
|
return {
|
|
40009
40038
|
provider: null,
|
|
@@ -40324,20 +40353,20 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
40324
40353
|
const runtime = useRequiredChatRuntime();
|
|
40325
40354
|
const source = runtime.source || DEFAULT_CHAT_SOURCE;
|
|
40326
40355
|
const tableIdForDocumentType = options?.tableIdForDocumentType ?? defaultTableIdForDocumentType;
|
|
40327
|
-
const persistedRef =
|
|
40356
|
+
const persistedRef = useRef60(null);
|
|
40328
40357
|
if (persistedRef.current === null) {
|
|
40329
40358
|
pruneStaleChatStorage(source);
|
|
40330
40359
|
persistedRef.current = loadPersistedChat(source) || { messages: [], sources: [], sendCount: 0 };
|
|
40331
40360
|
}
|
|
40332
|
-
const sourcesMapRef =
|
|
40361
|
+
const sourcesMapRef = useRef60(
|
|
40333
40362
|
new Map(persistedRef.current.sources)
|
|
40334
40363
|
);
|
|
40335
|
-
const refsMapRef =
|
|
40364
|
+
const refsMapRef = useRef60(
|
|
40336
40365
|
new Map(persistedRef.current.refs ?? [])
|
|
40337
40366
|
);
|
|
40338
|
-
const metaMapRef =
|
|
40339
|
-
const messagesRef =
|
|
40340
|
-
const sendCountRef =
|
|
40367
|
+
const metaMapRef = useRef60(/* @__PURE__ */ new Map());
|
|
40368
|
+
const messagesRef = useRef60(persistedRef.current.messages);
|
|
40369
|
+
const sendCountRef = useRef60(persistedRef.current.sendCount);
|
|
40341
40370
|
const [streamingPhase, setStreamingPhase] = useState88("idle");
|
|
40342
40371
|
const [metaTick, setMetaTick] = useState88(0);
|
|
40343
40372
|
const bumpMetaTick = useCallback41(() => setMetaTick((t) => t + 1), []);
|
|
@@ -40611,7 +40640,7 @@ import {
|
|
|
40611
40640
|
useCallback as useCallback42,
|
|
40612
40641
|
useEffect as useEffect70,
|
|
40613
40642
|
useMemo as useMemo32,
|
|
40614
|
-
useRef as
|
|
40643
|
+
useRef as useRef61,
|
|
40615
40644
|
useState as useState89
|
|
40616
40645
|
} from "react";
|
|
40617
40646
|
|
|
@@ -41145,9 +41174,9 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
41145
41174
|
},
|
|
41146
41175
|
[rejectRequestCallback]
|
|
41147
41176
|
);
|
|
41148
|
-
const handleApproveRef =
|
|
41177
|
+
const handleApproveRef = useRef61(handleApprove);
|
|
41149
41178
|
handleApproveRef.current = handleApprove;
|
|
41150
|
-
const handleRejectRef =
|
|
41179
|
+
const handleRejectRef = useRef61(handleReject);
|
|
41151
41180
|
handleRejectRef.current = handleReject;
|
|
41152
41181
|
const accumApprove = useCallback42((requestId) => {
|
|
41153
41182
|
if (!requestId) return;
|
|
@@ -41157,7 +41186,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
41157
41186
|
if (!requestId) return;
|
|
41158
41187
|
return handleRejectRef.current(requestId);
|
|
41159
41188
|
}, []);
|
|
41160
|
-
const callbacksRef =
|
|
41189
|
+
const callbacksRef = useRef61({
|
|
41161
41190
|
onSegmentsUpdate: (segments) => {
|
|
41162
41191
|
setMessages((prev) => updateTrailingAssistant(prev, segments));
|
|
41163
41192
|
},
|
|
@@ -41196,7 +41225,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
41196
41225
|
onChunkReceived: (chunk) => processChunk(chunk),
|
|
41197
41226
|
fetchChunks
|
|
41198
41227
|
});
|
|
41199
|
-
const historyLoadSeqRef =
|
|
41228
|
+
const historyLoadSeqRef = useRef61(0);
|
|
41200
41229
|
const loadDialogHistory = useCallback42(
|
|
41201
41230
|
async (id, cursor) => {
|
|
41202
41231
|
if (!fetchDialogMessages) return;
|
|
@@ -41251,7 +41280,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
41251
41280
|
accumReject
|
|
41252
41281
|
]
|
|
41253
41282
|
);
|
|
41254
|
-
const prevDialogIdRef =
|
|
41283
|
+
const prevDialogIdRef = useRef61(void 0);
|
|
41255
41284
|
useEffect70(() => {
|
|
41256
41285
|
if (prevDialogIdRef.current === dialogId) return;
|
|
41257
41286
|
prevDialogIdRef.current = dialogId;
|
|
@@ -41295,7 +41324,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
41295
41324
|
}
|
|
41296
41325
|
setConnectionState("connecting");
|
|
41297
41326
|
}, [active, dialogId]);
|
|
41298
|
-
const initialDialogsLoadedRef =
|
|
41327
|
+
const initialDialogsLoadedRef = useRef61(false);
|
|
41299
41328
|
const loadDialogsPage = useCallback42(
|
|
41300
41329
|
async (cursor) => {
|
|
41301
41330
|
if (!fetchDialogs) return;
|
|
@@ -41568,7 +41597,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
41568
41597
|
}
|
|
41569
41598
|
|
|
41570
41599
|
// src/components/chat/hooks/use-unified-chat.ts
|
|
41571
|
-
import { useCallback as useCallback43, useMemo as useMemo33, useRef as
|
|
41600
|
+
import { useCallback as useCallback43, useMemo as useMemo33, useRef as useRef62 } from "react";
|
|
41572
41601
|
var EMPTY_SSE_OPTIONS = {};
|
|
41573
41602
|
function createDisabledNatsConfig() {
|
|
41574
41603
|
return {
|
|
@@ -41583,7 +41612,7 @@ function createDisabledNatsConfig() {
|
|
|
41583
41612
|
}
|
|
41584
41613
|
function useUnifiedChat(options) {
|
|
41585
41614
|
const { modes, activeMode, mingoStateOverride } = options;
|
|
41586
|
-
const disabledNatsRef =
|
|
41615
|
+
const disabledNatsRef = useRef62(null);
|
|
41587
41616
|
if (disabledNatsRef.current === null) {
|
|
41588
41617
|
disabledNatsRef.current = createDisabledNatsConfig();
|
|
41589
41618
|
}
|
|
@@ -41597,62 +41626,64 @@ function useUnifiedChat(options) {
|
|
|
41597
41626
|
{ active: natsActive }
|
|
41598
41627
|
);
|
|
41599
41628
|
const activeState = activeMode === "guide" ? sseState : mingoStateOverride ?? natsState;
|
|
41600
|
-
const
|
|
41629
|
+
const activeStateRef = useRef62(activeState);
|
|
41630
|
+
activeStateRef.current = activeState;
|
|
41631
|
+
const stopMessage = useCallback43(() => activeStateRef.current.stopMessage(), []);
|
|
41601
41632
|
const clearMessages = useCallback43(
|
|
41602
|
-
() =>
|
|
41603
|
-
[
|
|
41633
|
+
() => activeStateRef.current.clearMessages(),
|
|
41634
|
+
[]
|
|
41604
41635
|
);
|
|
41605
41636
|
const sendMessage = useCallback43(
|
|
41606
|
-
(text, opts) =>
|
|
41607
|
-
[
|
|
41637
|
+
(text, opts) => activeStateRef.current.sendMessage(text, opts),
|
|
41638
|
+
[]
|
|
41608
41639
|
);
|
|
41609
41640
|
const discussRef = useCallback43(
|
|
41610
|
-
(ref) =>
|
|
41611
|
-
[
|
|
41641
|
+
(ref) => activeStateRef.current.discussRef(ref),
|
|
41642
|
+
[]
|
|
41612
41643
|
);
|
|
41613
41644
|
const displayRef = useCallback43(
|
|
41614
|
-
(ref) =>
|
|
41615
|
-
[
|
|
41645
|
+
(ref) => activeStateRef.current.displayRef(ref),
|
|
41646
|
+
[]
|
|
41616
41647
|
);
|
|
41617
41648
|
const selectDialog = useCallback43(
|
|
41618
|
-
(id) =>
|
|
41619
|
-
[
|
|
41649
|
+
(id) => activeStateRef.current.selectDialog(id),
|
|
41650
|
+
[]
|
|
41620
41651
|
);
|
|
41621
41652
|
const startNewDialog = useCallback43(
|
|
41622
|
-
() =>
|
|
41623
|
-
[
|
|
41653
|
+
() => activeStateRef.current.startNewDialog(),
|
|
41654
|
+
[]
|
|
41624
41655
|
);
|
|
41625
41656
|
const deleteDialog = useCallback43(
|
|
41626
|
-
(id) =>
|
|
41627
|
-
[
|
|
41657
|
+
(id) => activeStateRef.current.deleteDialog(id),
|
|
41658
|
+
[]
|
|
41628
41659
|
);
|
|
41629
41660
|
const renameDialog = useCallback43(
|
|
41630
|
-
(id, title) =>
|
|
41631
|
-
[
|
|
41661
|
+
(id, title) => activeStateRef.current.renameDialog(id, title),
|
|
41662
|
+
[]
|
|
41632
41663
|
);
|
|
41633
41664
|
const archiveDialog = useCallback43(
|
|
41634
|
-
(id) =>
|
|
41635
|
-
[
|
|
41665
|
+
(id) => activeStateRef.current.archiveDialog(id),
|
|
41666
|
+
[]
|
|
41636
41667
|
);
|
|
41637
41668
|
const loadMoreDialogs = useCallback43(
|
|
41638
|
-
() =>
|
|
41639
|
-
[
|
|
41669
|
+
() => activeStateRef.current.loadMoreDialogs(),
|
|
41670
|
+
[]
|
|
41640
41671
|
);
|
|
41641
41672
|
const reloadDialogs = useCallback43(
|
|
41642
|
-
() =>
|
|
41643
|
-
[
|
|
41673
|
+
() => activeStateRef.current.reloadDialogs(),
|
|
41674
|
+
[]
|
|
41644
41675
|
);
|
|
41645
41676
|
const loadMoreMessages = useCallback43(
|
|
41646
|
-
() =>
|
|
41647
|
-
[
|
|
41677
|
+
() => activeStateRef.current.loadMoreMessages(),
|
|
41678
|
+
[]
|
|
41648
41679
|
);
|
|
41649
41680
|
const approveRequest = useCallback43(
|
|
41650
|
-
(requestId) =>
|
|
41651
|
-
[
|
|
41681
|
+
(requestId) => activeStateRef.current.approveRequest(requestId),
|
|
41682
|
+
[]
|
|
41652
41683
|
);
|
|
41653
41684
|
const rejectRequest = useCallback43(
|
|
41654
|
-
(requestId, reason) =>
|
|
41655
|
-
[
|
|
41685
|
+
(requestId, reason) => activeStateRef.current.rejectRequest(requestId, reason),
|
|
41686
|
+
[]
|
|
41656
41687
|
);
|
|
41657
41688
|
return useMemo33(
|
|
41658
41689
|
() => ({
|
|
@@ -41787,7 +41818,7 @@ function chatChipClass({ tone, density = "chip", extra }) {
|
|
|
41787
41818
|
}
|
|
41788
41819
|
|
|
41789
41820
|
// src/components/chat/embeddable-chat.tsx
|
|
41790
|
-
import { useCallback as useCallback45, useEffect as useEffect71, useMemo as useMemo35, useRef as
|
|
41821
|
+
import { useCallback as useCallback45, useEffect as useEffect71, useMemo as useMemo35, useRef as useRef63, useState as useState91 } from "react";
|
|
41791
41822
|
import * as DialogPrimitive5 from "@radix-ui/react-dialog";
|
|
41792
41823
|
import { usePreventScroll } from "@react-aria/overlays";
|
|
41793
41824
|
import { isIOS } from "@react-aria/utils";
|
|
@@ -42315,7 +42346,7 @@ function EmbeddableChatInner({
|
|
|
42315
42346
|
return !window.matchMedia("(pointer: coarse)").matches;
|
|
42316
42347
|
});
|
|
42317
42348
|
usePreventScroll({ isDisabled: !isOpen || shellLess });
|
|
42318
|
-
const navigatingAwayRef =
|
|
42349
|
+
const navigatingAwayRef = useRef63(false);
|
|
42319
42350
|
useEffect71(() => {
|
|
42320
42351
|
if (!isOpen) return;
|
|
42321
42352
|
if (shellLess) return;
|
|
@@ -42342,7 +42373,7 @@ function EmbeddableChatInner({
|
|
|
42342
42373
|
window.scrollTo(0, scrollY);
|
|
42343
42374
|
};
|
|
42344
42375
|
}, [isOpen, shellLess]);
|
|
42345
|
-
const chatInputRef =
|
|
42376
|
+
const chatInputRef = useRef63(null);
|
|
42346
42377
|
const slashCommandsProp = useMemo35(
|
|
42347
42378
|
() => ({
|
|
42348
42379
|
fetchCommands: (prefix, signal) => fetchSlashCommands(prefix, signal, commandsUrl),
|
|
@@ -42455,26 +42486,49 @@ function EmbeddableChatInner({
|
|
|
42455
42486
|
}),
|
|
42456
42487
|
[discussRef, displayRef, resolvedBaseRoute, chipBasePlatform, extras]
|
|
42457
42488
|
);
|
|
42458
|
-
const
|
|
42459
|
-
() =>
|
|
42460
|
-
|
|
42461
|
-
role: m.role,
|
|
42462
|
-
// Host-supplied per-message name/avatar win (e.g. the signed-in user's
|
|
42463
|
-
// full name + photo on a `user` bubble); fall back to the role default
|
|
42464
|
-
// when the host doesn't provide them.
|
|
42465
|
-
name: m.name ?? (m.role === "assistant" ? "Mingo" : "You"),
|
|
42466
|
-
avatar: m.avatar ?? null,
|
|
42467
|
-
// Forward the host's authorType so user bubbles get the same accent
|
|
42468
|
-
// name color as the standalone /mingo page (user → 'admin').
|
|
42469
|
-
...m.authorType ? { authorType: m.authorType } : {},
|
|
42470
|
-
content: m.segments && m.segments.length > 0 ? m.segments : m.content,
|
|
42471
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
42472
|
-
assistantType: m.role === "assistant" ? "mingo" : void 0,
|
|
42473
|
-
...m.chatRefs ? { chatRefs: m.chatRefs } : {},
|
|
42474
|
-
...m.scrollAnchor ? { scrollAnchor: m.scrollAnchor } : {}
|
|
42475
|
-
})),
|
|
42476
|
-
[rawMessages]
|
|
42489
|
+
const mingoAssistantIcon = useMemo35(
|
|
42490
|
+
() => /* @__PURE__ */ jsx296(MingoIcon, { className: "h-6 w-6", cornerColor: "var(--ods-flamingo-cyan-base)" }),
|
|
42491
|
+
[]
|
|
42477
42492
|
);
|
|
42493
|
+
const timestampCacheRef = useRef63(/* @__PURE__ */ new Map());
|
|
42494
|
+
const messages = useMemo35(() => {
|
|
42495
|
+
const cache = timestampCacheRef.current;
|
|
42496
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
42497
|
+
const mapped = rawMessages.map((m) => {
|
|
42498
|
+
seenIds.add(m.id);
|
|
42499
|
+
let timestamp;
|
|
42500
|
+
if (m.timestamp != null) {
|
|
42501
|
+
timestamp = new Date(m.timestamp);
|
|
42502
|
+
} else {
|
|
42503
|
+
const cached = cache.get(m.id);
|
|
42504
|
+
timestamp = cached ?? /* @__PURE__ */ new Date();
|
|
42505
|
+
if (!cached) cache.set(m.id, timestamp);
|
|
42506
|
+
}
|
|
42507
|
+
return {
|
|
42508
|
+
id: m.id,
|
|
42509
|
+
role: m.role,
|
|
42510
|
+
// Host-supplied per-message name/avatar win (e.g. the signed-in user's
|
|
42511
|
+
// full name + photo on a `user` bubble); fall back to the role default
|
|
42512
|
+
// when the host doesn't provide them.
|
|
42513
|
+
name: m.name ?? (m.role === "assistant" ? "Mingo" : "You"),
|
|
42514
|
+
avatar: m.avatar ?? null,
|
|
42515
|
+
// Forward the host's authorType so user bubbles get the same accent
|
|
42516
|
+
// name color as the standalone /mingo page (user → 'admin').
|
|
42517
|
+
...m.authorType ? { authorType: m.authorType } : {},
|
|
42518
|
+
content: m.segments && m.segments.length > 0 ? m.segments : m.content,
|
|
42519
|
+
timestamp,
|
|
42520
|
+
assistantType: m.role === "assistant" ? "mingo" : void 0,
|
|
42521
|
+
...m.chatRefs ? { chatRefs: m.chatRefs } : {},
|
|
42522
|
+
...m.scrollAnchor ? { scrollAnchor: m.scrollAnchor } : {}
|
|
42523
|
+
};
|
|
42524
|
+
});
|
|
42525
|
+
if (cache.size > seenIds.size) {
|
|
42526
|
+
for (const id of cache.keys()) {
|
|
42527
|
+
if (!seenIds.has(id)) cache.delete(id);
|
|
42528
|
+
}
|
|
42529
|
+
}
|
|
42530
|
+
return mapped;
|
|
42531
|
+
}, [rawMessages]);
|
|
42478
42532
|
const handleSend = useCallback45(
|
|
42479
42533
|
(text) => {
|
|
42480
42534
|
let augmentedText = text;
|
|
@@ -42661,13 +42715,7 @@ function EmbeddableChatInner({
|
|
|
42661
42715
|
isTyping: chatLoading,
|
|
42662
42716
|
autoScroll: true,
|
|
42663
42717
|
assistantType: "mingo",
|
|
42664
|
-
assistantIcon:
|
|
42665
|
-
MingoIcon,
|
|
42666
|
-
{
|
|
42667
|
-
className: "h-6 w-6",
|
|
42668
|
-
cornerColor: "var(--ods-flamingo-cyan-base)"
|
|
42669
|
-
}
|
|
42670
|
-
),
|
|
42718
|
+
assistantIcon: mingoAssistantIcon,
|
|
42671
42719
|
renderEntityCard,
|
|
42672
42720
|
NavLinkAnchor: NavLinkAnchorViaRuntime,
|
|
42673
42721
|
className: "flex-1",
|
|
@@ -43250,6 +43298,14 @@ export {
|
|
|
43250
43298
|
CampaignCardAdminSkeleton,
|
|
43251
43299
|
GenericEntityCard,
|
|
43252
43300
|
GenericEntityCardSkeleton,
|
|
43301
|
+
getAppType,
|
|
43302
|
+
getEmbedProxyAuth,
|
|
43303
|
+
getPersistedProxyEmail,
|
|
43304
|
+
setEmbedProxyAuth,
|
|
43305
|
+
clearEmbedProxyAuth,
|
|
43306
|
+
applyProxyAuth,
|
|
43307
|
+
setEmbedAuthAdapter,
|
|
43308
|
+
embedAuthedFetch,
|
|
43253
43309
|
useChatCardItem,
|
|
43254
43310
|
SOURCE_ICON_NAMES,
|
|
43255
43311
|
getSourceIconName,
|
|
@@ -43291,14 +43347,6 @@ export {
|
|
|
43291
43347
|
MessageSegmentAccumulator,
|
|
43292
43348
|
createMessageSegmentAccumulator,
|
|
43293
43349
|
useRealtimeChunkProcessor,
|
|
43294
|
-
getAppType,
|
|
43295
|
-
getEmbedProxyAuth,
|
|
43296
|
-
getPersistedProxyEmail,
|
|
43297
|
-
setEmbedProxyAuth,
|
|
43298
|
-
clearEmbedProxyAuth,
|
|
43299
|
-
applyProxyAuth,
|
|
43300
|
-
setEmbedAuthAdapter,
|
|
43301
|
-
embedAuthedFetch,
|
|
43302
43350
|
fetchSlashCommands,
|
|
43303
43351
|
useSlashCommands,
|
|
43304
43352
|
useSlashCommandRegistry,
|
|
@@ -43670,4 +43718,4 @@ export {
|
|
|
43670
43718
|
LogsList,
|
|
43671
43719
|
assets
|
|
43672
43720
|
};
|
|
43673
|
-
//# sourceMappingURL=chunk-
|
|
43721
|
+
//# sourceMappingURL=chunk-BNYPQCKL.js.map
|