reachat 2.1.0-alpha.2 → 2.1.0-alpha.20
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/AppBar/AppBar.d.ts +1 -1
- package/dist/{CSVFileRenderer-CpB8ngRc.js → CSVFileRenderer-B7eSDub6.js} +15 -14
- package/dist/CSVFileRenderer-B7eSDub6.js.map +1 -0
- package/dist/Chat.d.ts +3 -3
- package/dist/ChatBubble/ChatBubble.d.ts +1 -1
- package/dist/ChatContext.d.ts +2 -2
- package/dist/ChatInput/ChatInput.d.ts +16 -0
- package/dist/ChatInput/FileInput.d.ts +5 -1
- package/dist/{DefaultFileRenderer-DEgyNAd4.js → DefaultFileRenderer-CszY8p_0.js} +2 -2
- package/dist/DefaultFileRenderer-CszY8p_0.js.map +1 -0
- package/dist/ImageFileRenderer-C8tVW3I8.js.map +1 -1
- package/dist/Markdown/CodeHighlighter.d.ts +4 -0
- package/dist/Markdown/Markdown.d.ts +5 -0
- package/dist/Markdown/Table.d.ts +1 -1
- package/dist/Markdown/index.d.ts +2 -2
- package/dist/Markdown/plugins/remarkCve.d.ts +2 -1
- package/dist/PDFFileRenderer-BBn2EVrV.js +16 -0
- package/dist/PDFFileRenderer-BBn2EVrV.js.map +1 -0
- package/dist/SessionMessages/SessionEmpty.d.ts +1 -4
- package/dist/SessionMessages/SessionMessage/MessageFile/renderers/index.d.ts +1 -1
- package/dist/SessionMessages/SessionMessage/MessageFiles.d.ts +1 -1
- package/dist/SessionMessages/SessionMessage/MessageQuestion.d.ts +4 -0
- package/dist/SessionMessages/SessionMessage/MessageSources.d.ts +1 -1
- package/dist/SessionMessages/SessionMessage/SessionMessage.d.ts +4 -0
- package/dist/SessionMessages/SessionMessage/index.d.ts +2 -2
- package/dist/SessionMessages/SessionMessages.d.ts +14 -1
- package/dist/SessionMessages/index.d.ts +2 -2
- package/dist/SessionsList/index.d.ts +2 -2
- package/dist/docs.json +216 -20
- package/dist/{index-DVFyp_Cz.js → index-DNefh8rs.js} +1332 -1269
- package/dist/index-DNefh8rs.js.map +1 -0
- package/dist/index.css +6358 -727
- package/dist/index.d.ts +7 -6
- package/dist/index.js +32 -31
- package/dist/index.umd.cjs +1317 -1246
- package/dist/index.umd.cjs.map +1 -1
- package/dist/stories/Changelog.mdx +1 -1
- package/dist/stories/Chat.stories.tsx +28 -23
- package/dist/stories/ChatBubble.stories.tsx +3 -3
- package/dist/stories/Companion.stories.tsx +6 -6
- package/dist/stories/Console.stories.tsx +23 -23
- package/dist/stories/Integration.stories.tsx +2 -2
- package/dist/stories/Intro.mdx +1 -1
- package/dist/stories/Markdown.stories.tsx +318 -0
- package/dist/stories/assets/logo.svg +38 -19
- package/dist/stories/assets/paperclip.svg +4 -1
- package/dist/stories/assets/search.svg +5 -1
- package/dist/stories/examples.ts +20 -13
- package/dist/theme.d.ts +21 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +63 -47
- package/dist/CSVFileRenderer-CpB8ngRc.js.map +0 -1
- package/dist/DefaultFileRenderer-DEgyNAd4.js.map +0 -1
- package/dist/PDFFileRenderer-DQdFS2l6.js +0 -9
- package/dist/PDFFileRenderer-DQdFS2l6.js.map +0 -1
- package/dist/index-DVFyp_Cz.js.map +0 -1
|
@@ -1,28 +1,300 @@
|
|
|
1
|
-
import { jsxs, Fragment
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { cn, ConnectedOverlay, Button, Textarea, IconButton, Ellipsis, Card, Divider, useInfinityList, DateFormat, ListItem, List } from "reablocks";
|
|
3
|
+
import { AnimatePresence, motion } from "motion/react";
|
|
2
4
|
import * as React from "react";
|
|
3
|
-
import { createContext,
|
|
4
|
-
import { Button, cn, Textarea, Ellipsis, DateFormat, IconButton, Card, Divider, useInfinityList, ListItem, List, ConnectedOverlay } from "reablocks";
|
|
5
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
6
|
-
import { motion, AnimatePresence } from "motion/react";
|
|
7
|
-
import ReactMarkdown from "react-markdown";
|
|
8
|
-
import { Prism } from "react-syntax-highlighter";
|
|
9
|
-
import rehypeKatex from "rehype-katex";
|
|
10
|
-
import { findAndReplace } from "mdast-util-find-and-replace";
|
|
5
|
+
import { createContext, useState, useCallback, useEffect, useMemo, memo, useRef, useContext, forwardRef, useImperativeHandle, lazy, Suspense } from "react";
|
|
11
6
|
import { useHotkeys } from "reakeys";
|
|
12
7
|
import remarkGfm from "remark-gfm";
|
|
13
|
-
import remarkYoutube from "remark-youtube";
|
|
14
8
|
import remarkMath from "remark-math";
|
|
15
|
-
import
|
|
9
|
+
import remarkYoutube from "remark-youtube";
|
|
16
10
|
import { offset } from "@floating-ui/react";
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
import { Prism } from "react-syntax-highlighter";
|
|
12
|
+
import ReactMarkdown from "react-markdown";
|
|
13
|
+
import rehypeKatex from "rehype-katex";
|
|
14
|
+
import { findAndReplace } from "mdast-util-find-and-replace";
|
|
15
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
16
|
+
import { isToday, isYesterday, isThisWeek, differenceInYears, format } from "date-fns";
|
|
17
|
+
const chatTheme = {
|
|
18
|
+
base: "text-content-text-neutral-base",
|
|
19
|
+
console: "flex w-full gap-4 h-full",
|
|
20
|
+
companion: "w-full h-full overflow-hidden",
|
|
21
|
+
empty: "text-center flex-1",
|
|
22
|
+
appbar: "flex p-5",
|
|
23
|
+
sessions: {
|
|
24
|
+
base: "overflow-auto",
|
|
25
|
+
console: "min-w-[150px] w-[30%] max-w-[300px] bg-gradient-neutral-200 p-5 rounded-3xl",
|
|
26
|
+
companion: "w-full h-full",
|
|
27
|
+
group: "text-xs text-content-text-neutral-3 mt-4 hover:bg-transparent mb-1",
|
|
28
|
+
create: "relative mb-4 rounded-[10px] text-white",
|
|
29
|
+
session: {
|
|
30
|
+
base: "group my-1 rounded-[10px] p-2 text-content-text-neutral-1 border border-transparent",
|
|
31
|
+
active: "border-select-menu-items-color-item-stroke-row-hover [&_button]:opacity-100!",
|
|
32
|
+
delete: "[&>svg]:w-4 [&>svg]:h-4 opacity-0 group-hover:opacity-50!"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
messages: {
|
|
36
|
+
base: "",
|
|
37
|
+
console: "flex flex-col mx-5 flex-1 overflow-hidden",
|
|
38
|
+
companion: "flex w-full h-full",
|
|
39
|
+
back: "self-start pl-0 my-2 ",
|
|
40
|
+
inner: "flex-1 h-full flex flex-col",
|
|
41
|
+
title: "text-base font-bold",
|
|
42
|
+
date: "text-xs whitespace-nowrap text-content-text-neutral-2",
|
|
43
|
+
content: "mt-2 flex-1 overflow-auto",
|
|
44
|
+
header: "flex justify-between items-center gap-2",
|
|
45
|
+
showMore: "mb-4",
|
|
46
|
+
message: {
|
|
47
|
+
base: "mt-4 mb-4 flex flex-col p-0 rounded-sm border-none bg-transparent",
|
|
48
|
+
question: "relative font-semibold mb-4 px-4 py-4 pb-2 rounded-3xl rounded-br-none text-typography border bg-(--background-neutral-raised-5) border-(--stroke-neutral-5)",
|
|
49
|
+
response: "relative data-[compact=false]:px-4 text-content-text-neutral-base",
|
|
50
|
+
overlay: "overflow-y-hidden max-h-[350px] after:content-[''] after:absolute after:inset-x-0 after:bottom-0 after:h-16 after:bg-linear-to-b after:from-transparent after:to-effects-shadows-base-2-xl",
|
|
51
|
+
cursor: "inline-block w-1 h-4 bg-current",
|
|
52
|
+
expand: "absolute bottom-0 right-1 z-10",
|
|
53
|
+
files: {
|
|
54
|
+
base: "mb-2 flex flex-wrap gap-3 ",
|
|
55
|
+
file: {
|
|
56
|
+
base: "flex items-center gap-2 border border-stroke-neutral-4 px-3 py-2 rounded-lg cursor-pointer",
|
|
57
|
+
name: "text-sm text-content-text-neutral-4"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
sources: {
|
|
61
|
+
base: "my-4 flex flex-wrap gap-3",
|
|
62
|
+
source: {
|
|
63
|
+
base: "flex gap-2 border border-stroke-neutral-4 px-4 py-2 rounded-lg cursor-pointer",
|
|
64
|
+
companion: "flex-1 px-3 py-1.5",
|
|
65
|
+
image: "max-w-10 max-h-10 rounded-md w-full h-fit self-center",
|
|
66
|
+
title: "text-md block",
|
|
67
|
+
url: "text-sm text-buttons-colors-link-primary-text-resting underline"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
markdown: {
|
|
71
|
+
hr: "my-4 border-t border-stroke-neutral-4",
|
|
72
|
+
copy: "sticky py-1 [&>svg]:w-4 [&>svg]:h-4 opacity-50",
|
|
73
|
+
p: "mb-2",
|
|
74
|
+
a: "text-buttons-colors-link-primary-text-resting underline",
|
|
75
|
+
table: "table-auto w-full m-2",
|
|
76
|
+
th: "px-4 py-2 text-left font-bold border-b border-stroke-neutral-4",
|
|
77
|
+
td: "px-4 py-2",
|
|
78
|
+
code: "m-2 rounded-b relative",
|
|
79
|
+
inlineCode: "bg-gradient-neutral-200 p-1 rounded",
|
|
80
|
+
toolbar: "text-xs flex items-center justify-between px-2 py-1 rounded-t sticky top-0 backdrop-blur-md bg-gradient-neutral-500/50",
|
|
81
|
+
li: "mb-2 ml-6",
|
|
82
|
+
ul: "mb-4 list-disc",
|
|
83
|
+
ol: "mb-4 list-decimal",
|
|
84
|
+
h1: "text-4xl font-bold mb-4 mt-6",
|
|
85
|
+
h2: "text-3xl font-bold mb-3 mt-5",
|
|
86
|
+
h3: "text-2xl font-bold mb-3 mt-4",
|
|
87
|
+
h4: "text-xl font-bold mb-2 mt-3",
|
|
88
|
+
h5: "text-lg font-bold mb-2 mt-2",
|
|
89
|
+
h6: "text-base font-bold mb-2 mt-2"
|
|
90
|
+
},
|
|
91
|
+
csvPreview: {
|
|
92
|
+
base: "flex flex-col gap-2",
|
|
93
|
+
header: {
|
|
94
|
+
base: "flex justify-between items-center gap-4",
|
|
95
|
+
icon: "csv-icon flex items-center",
|
|
96
|
+
actions: "csv-actions flex items-center gap-6"
|
|
97
|
+
},
|
|
98
|
+
tableContainer: "flex justify-between",
|
|
99
|
+
dialog: {
|
|
100
|
+
base: "fixed inset-0 bg-background-neutral-canvas-base/70 flex justify-center items-center z-50",
|
|
101
|
+
container: "bg-background-neutral-canvas-base rounded-md w-11/12 h-5/6 overflow-auto"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
footer: {
|
|
105
|
+
base: "mt-3 flex gap-1.5",
|
|
106
|
+
copy: "p-3 rounded-[10px] [&>svg]:size-4 opacity-50 hover:opacity-100!",
|
|
107
|
+
upvote: "p-3 rounded-[10px] [&>svg]:size-4 opacity-50 hover:opacity-100!",
|
|
108
|
+
downvote: "p-3 rounded-[10px] [&>svg]:size-4 opacity-50 hover:opacity-100!",
|
|
109
|
+
refresh: "p-3 rounded-[10px] [&>svg]:size-4 opacity-50 hover:opacity-100!"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
input: {
|
|
114
|
+
base: "flex mt-4 relative",
|
|
115
|
+
upload: "px-5 py-2 size-10 text-content-text-neutral-2 hover:text-content-text-neutral-base",
|
|
116
|
+
input: "w-full border rounded-3xl px-3 py-2 pr-16 after:hidden after:mx-10! [&>textarea]:w-full [&>textarea]:flex-none [&>textarea]:outline-none [&>textarea]:resize-none",
|
|
117
|
+
actions: {
|
|
118
|
+
base: "absolute flex gap-2 items-center right-2 inset-y-1/2 -translate-y-1/2 z-10",
|
|
119
|
+
send: "px-3 py-3 hover:bg-primary-hover rounded-full size-8",
|
|
120
|
+
stop: "px-2 py-2 bg-content-assets-semantic-error-base text-white rounded-full hover:bg-content-assets-semantic-error-1 size-8"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
const AppBar = ({ content, theme = chatTheme }) => {
|
|
125
|
+
return /* @__PURE__ */ jsx("div", { className: cn(theme.appbar), children: content });
|
|
126
|
+
};
|
|
19
127
|
const ChatContext = createContext({
|
|
20
128
|
sessions: [],
|
|
21
129
|
activeSessionId: null
|
|
22
130
|
});
|
|
23
|
-
const
|
|
131
|
+
const useDimensions = () => {
|
|
132
|
+
const [ref, setRef] = useState(null);
|
|
133
|
+
const [width, setWidth] = useState(void 0);
|
|
134
|
+
const observe = useCallback((element) => {
|
|
135
|
+
if (element) setRef(element);
|
|
136
|
+
}, []);
|
|
137
|
+
useEffect(() => {
|
|
138
|
+
if (!ref) return;
|
|
139
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
140
|
+
for (const entry of entries) {
|
|
141
|
+
setWidth(entry.contentRect.width);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
resizeObserver.observe(ref);
|
|
145
|
+
return () => {
|
|
146
|
+
resizeObserver.disconnect();
|
|
147
|
+
};
|
|
148
|
+
}, [ref]);
|
|
149
|
+
return { width, observe };
|
|
150
|
+
};
|
|
151
|
+
const Chat = ({
|
|
152
|
+
children,
|
|
153
|
+
viewType = "console",
|
|
154
|
+
sessions,
|
|
155
|
+
onSelectSession,
|
|
156
|
+
onDeleteSession,
|
|
157
|
+
onSendMessage,
|
|
158
|
+
onStopMessage,
|
|
159
|
+
onFileUpload,
|
|
160
|
+
isLoading,
|
|
161
|
+
activeSessionId,
|
|
162
|
+
theme = chatTheme,
|
|
163
|
+
onNewSession,
|
|
164
|
+
remarkPlugins = [remarkGfm, remarkYoutube, remarkMath],
|
|
165
|
+
disabled,
|
|
166
|
+
style,
|
|
167
|
+
className
|
|
168
|
+
}) => {
|
|
169
|
+
const [internalActiveSessionID, setInternalActiveSessionID] = useState(activeSessionId);
|
|
170
|
+
const { width, observe } = useDimensions();
|
|
171
|
+
const isCompact = viewType === "companion" || width && width < 767;
|
|
172
|
+
useEffect(() => {
|
|
173
|
+
setInternalActiveSessionID(activeSessionId);
|
|
174
|
+
}, [activeSessionId]);
|
|
175
|
+
const handleSelectSession = useCallback(
|
|
176
|
+
(sessionId) => {
|
|
177
|
+
setInternalActiveSessionID(sessionId);
|
|
178
|
+
onSelectSession?.(sessionId);
|
|
179
|
+
},
|
|
180
|
+
[onSelectSession]
|
|
181
|
+
);
|
|
182
|
+
const handleDeleteSession = useCallback(
|
|
183
|
+
(sessionId) => {
|
|
184
|
+
setInternalActiveSessionID(void 0);
|
|
185
|
+
onDeleteSession?.(sessionId);
|
|
186
|
+
},
|
|
187
|
+
[onDeleteSession]
|
|
188
|
+
);
|
|
189
|
+
const handleCreateNewSession = useCallback(() => {
|
|
190
|
+
setInternalActiveSessionID(void 0);
|
|
191
|
+
onNewSession?.();
|
|
192
|
+
}, [onNewSession]);
|
|
193
|
+
useHotkeys([
|
|
194
|
+
{
|
|
195
|
+
name: "Create new session",
|
|
196
|
+
category: "Chat",
|
|
197
|
+
keys: "meta+shift+s",
|
|
198
|
+
callback: (event) => {
|
|
199
|
+
event.preventDefault();
|
|
200
|
+
handleCreateNewSession();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
]);
|
|
204
|
+
const activeSession = useMemo(
|
|
205
|
+
() => sessions.find((session) => session.id === internalActiveSessionID),
|
|
206
|
+
[sessions, internalActiveSessionID]
|
|
207
|
+
);
|
|
208
|
+
const contextValue = useMemo(
|
|
209
|
+
() => ({
|
|
210
|
+
sessions,
|
|
211
|
+
activeSession,
|
|
212
|
+
remarkPlugins,
|
|
213
|
+
theme,
|
|
214
|
+
disabled,
|
|
215
|
+
isLoading,
|
|
216
|
+
isCompact,
|
|
217
|
+
viewType,
|
|
218
|
+
activeSessionId: internalActiveSessionID,
|
|
219
|
+
selectSession: handleSelectSession,
|
|
220
|
+
deleteSession: handleDeleteSession,
|
|
221
|
+
createSession: handleCreateNewSession,
|
|
222
|
+
sendMessage: onSendMessage,
|
|
223
|
+
stopMessage: onStopMessage,
|
|
224
|
+
fileUpload: onFileUpload
|
|
225
|
+
}),
|
|
226
|
+
[
|
|
227
|
+
isLoading,
|
|
228
|
+
isCompact,
|
|
229
|
+
viewType,
|
|
230
|
+
disabled,
|
|
231
|
+
theme,
|
|
232
|
+
remarkPlugins,
|
|
233
|
+
sessions,
|
|
234
|
+
activeSession,
|
|
235
|
+
internalActiveSessionID,
|
|
236
|
+
handleSelectSession,
|
|
237
|
+
handleDeleteSession,
|
|
238
|
+
handleCreateNewSession,
|
|
239
|
+
onSendMessage,
|
|
240
|
+
onStopMessage,
|
|
241
|
+
onFileUpload
|
|
242
|
+
]
|
|
243
|
+
);
|
|
244
|
+
return /* @__PURE__ */ jsx(ChatContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: /* @__PURE__ */ jsx(
|
|
245
|
+
"div",
|
|
246
|
+
{
|
|
247
|
+
ref: observe,
|
|
248
|
+
className: cn(className, theme.base, {
|
|
249
|
+
[theme.companion]: isCompact,
|
|
250
|
+
[theme.console]: !isCompact
|
|
251
|
+
}),
|
|
252
|
+
style,
|
|
253
|
+
children
|
|
254
|
+
}
|
|
255
|
+
) }) });
|
|
256
|
+
};
|
|
257
|
+
const ChatBubble = memo(
|
|
258
|
+
({
|
|
259
|
+
children,
|
|
260
|
+
bubbleContent,
|
|
261
|
+
position = "right-end",
|
|
262
|
+
modifiers = [offset({ mainAxis: 0, crossAxis: -40 })],
|
|
263
|
+
className
|
|
264
|
+
}) => {
|
|
265
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
266
|
+
const ref = useRef(null);
|
|
267
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
268
|
+
/* @__PURE__ */ jsx(
|
|
269
|
+
ConnectedOverlay,
|
|
270
|
+
{
|
|
271
|
+
placement: position,
|
|
272
|
+
modifiers,
|
|
273
|
+
reference: ref.current,
|
|
274
|
+
open: isOpen,
|
|
275
|
+
onOpen: () => setIsOpen(true),
|
|
276
|
+
onClose: () => setIsOpen(false),
|
|
277
|
+
content: () => /* @__PURE__ */ jsx(Fragment, { children })
|
|
278
|
+
}
|
|
279
|
+
),
|
|
280
|
+
/* @__PURE__ */ jsx(
|
|
281
|
+
"div",
|
|
282
|
+
{
|
|
283
|
+
ref,
|
|
284
|
+
className,
|
|
285
|
+
onClick: () => setIsOpen((prev) => !prev),
|
|
286
|
+
children: bubbleContent
|
|
287
|
+
}
|
|
288
|
+
)
|
|
289
|
+
] });
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
const SvgSend = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M15.3451 0.654003C15.0011 0.310003 14.5001 0.191003 14.0401 0.339003L1.11712 4.493C0.626116 4.651 0.286116 5.067 0.230116 5.58C0.174116 6.092 0.417116 6.572 0.862116 6.831L5.43812 9.5L9.39112 5.546C9.68412 5.253 10.1591 5.253 10.4521 5.546C10.7451 5.839 10.7451 6.314 10.4521 6.607L6.49812 10.561L9.16712 15.137C9.40211 15.539 9.81712 15.776 10.2741 15.776C10.3221 15.776 10.3711 15.773 10.4201 15.768C10.9321 15.712 11.3491 15.372 11.5061 14.882L15.6611 1.96C15.8091 1.497 15.6881 0.997003 15.3451 0.654003Z", fill: "currentColor" }));
|
|
293
|
+
const SvgStop = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 50 50", width: "24px", height: "24px", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M 25 2 C 12.309534 2 2 12.309534 2 25 C 2 37.690466 12.309534 48 25 48 C 37.690466 48 48 37.690466 48 25 C 48 12.309534 37.690466 2 25 2 z M 25 4 C 36.609534 4 46 13.390466 46 25 C 46 36.609534 36.609534 46 25 46 C 13.390466 46 4 36.609534 4 25 C 4 13.390466 13.390466 4 25 4 z M 32.990234 15.986328 A 1.0001 1.0001 0 0 0 32.292969 16.292969 L 25 23.585938 L 17.707031 16.292969 A 1.0001 1.0001 0 0 0 16.990234 15.990234 A 1.0001 1.0001 0 0 0 16.292969 17.707031 L 23.585938 25 L 16.292969 32.292969 A 1.0001 1.0001 0 1 0 17.707031 33.707031 L 25 26.414062 L 32.292969 33.707031 A 1.0001 1.0001 0 1 0 33.707031 32.292969 L 26.414062 25 L 33.707031 17.707031 A 1.0001 1.0001 0 0 0 32.990234 15.986328 z", fill: "currentColor" }));
|
|
294
|
+
const SvgPaperclip = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", width: "24px", height: "24px", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M25.3,56.007c-3.409,0-6.818-1.297-9.414-3.893c-2.595-2.596-3.893-6.005-3.893-9.415c0-3.409,1.298-6.819,3.893-9.414 l20.4-20.4c1.847-1.847,4.302-2.864,6.914-2.864c2.611,0,5.067,1.017,6.914,2.864c3.812,3.813,3.812,10.016,0,13.829l-20.4,20.4 c-2.438,2.439-6.385,2.441-8.828,0c-2.434-2.435-2.434-6.395,0-8.829l13.7-13.7c0.781-0.781,2.047-0.781,2.828,0 c0.781,0.781,0.781,2.047,0,2.828l-13.7,13.7c-0.874,0.875-0.874,2.297,0.001,3.172c0.847,0.846,2.324,0.846,3.171,0l20.4-20.4 c2.252-2.253,2.252-5.919,0-8.172c-1.092-1.091-2.543-1.692-4.086-1.692c-1.544,0-2.994,0.601-4.086,1.692l-20.4,20.4 c-1.815,1.816-2.723,4.201-2.723,6.586c0,2.385,0.908,4.77,2.723,6.586c1.816,1.815,4.201,2.723,6.586,2.723 c2.385,0,4.771-0.907,6.586-2.723l12.7-12.7c0.781-0.781,2.047-0.781,2.828,0c0.781,0.781,0.781,2.047,0,2.828l-12.7,12.7 C32.119,54.709,28.71,56.007,25.3,56.007z", fill: "currentColor" }));
|
|
24
295
|
const FileInput = ({
|
|
25
296
|
allowedFiles,
|
|
297
|
+
multiple,
|
|
26
298
|
onFileUpload,
|
|
27
299
|
isLoading,
|
|
28
300
|
disabled,
|
|
@@ -38,6 +310,7 @@ const FileInput = ({
|
|
|
38
310
|
ref: fileInputRef,
|
|
39
311
|
className: "hidden",
|
|
40
312
|
accept: allowedFiles.join(","),
|
|
313
|
+
multiple,
|
|
41
314
|
onChange: (e) => {
|
|
42
315
|
onFileUpload(e);
|
|
43
316
|
if (fileInputRef.current) {
|
|
@@ -53,10 +326,7 @@ const FileInput = ({
|
|
|
53
326
|
variant: "text",
|
|
54
327
|
disabled: isLoading || disabled,
|
|
55
328
|
className: cn(theme.input.upload),
|
|
56
|
-
onClick: () =>
|
|
57
|
-
var _a;
|
|
58
|
-
return (_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
59
|
-
},
|
|
329
|
+
onClick: () => fileInputRef.current?.click(),
|
|
60
330
|
children: attachIcon
|
|
61
331
|
}
|
|
62
332
|
)
|
|
@@ -65,8 +335,10 @@ const FileInput = ({
|
|
|
65
335
|
const ChatInput = forwardRef(
|
|
66
336
|
({
|
|
67
337
|
allowedFiles,
|
|
338
|
+
allowMultipleFiles = false,
|
|
68
339
|
placeholder,
|
|
69
340
|
defaultValue,
|
|
341
|
+
className,
|
|
70
342
|
message,
|
|
71
343
|
sendIcon = /* @__PURE__ */ jsx(SvgSend, {}),
|
|
72
344
|
stopIcon = /* @__PURE__ */ jsx(SvgStop, {}),
|
|
@@ -92,24 +364,27 @@ const ChatInput = forwardRef(
|
|
|
92
364
|
inputRef.current.focus();
|
|
93
365
|
}
|
|
94
366
|
}, [activeSessionId, inputRef]);
|
|
367
|
+
const handleSendMessage = () => {
|
|
368
|
+
if (internalMessage.trim()) {
|
|
369
|
+
sendMessage?.(internalMessage);
|
|
370
|
+
setInternalMessage("");
|
|
371
|
+
}
|
|
372
|
+
};
|
|
95
373
|
useImperativeHandle(ref, () => ({
|
|
96
374
|
focus: () => {
|
|
97
|
-
|
|
98
|
-
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
375
|
+
inputRef.current?.focus();
|
|
99
376
|
},
|
|
100
377
|
send: () => {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
378
|
+
handleSendMessage();
|
|
379
|
+
},
|
|
380
|
+
setValue: (value) => {
|
|
381
|
+
setInternalMessage(value);
|
|
382
|
+
onMessageChange?.(value);
|
|
383
|
+
},
|
|
384
|
+
getValue: () => {
|
|
385
|
+
return internalMessage;
|
|
105
386
|
}
|
|
106
387
|
}));
|
|
107
|
-
const handleSendMessage = () => {
|
|
108
|
-
if (internalMessage.trim()) {
|
|
109
|
-
sendMessage == null ? void 0 : sendMessage(internalMessage);
|
|
110
|
-
setInternalMessage("");
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
388
|
const handleKeyPress = (e) => {
|
|
114
389
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
115
390
|
e.preventDefault();
|
|
@@ -117,20 +392,26 @@ const ChatInput = forwardRef(
|
|
|
117
392
|
}
|
|
118
393
|
};
|
|
119
394
|
const handleFileUpload = (event) => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
395
|
+
const files = event.target.files;
|
|
396
|
+
if (files && fileUpload) {
|
|
397
|
+
if (allowMultipleFiles) {
|
|
398
|
+
Array.from(files).forEach((file) => fileUpload(file));
|
|
399
|
+
} else {
|
|
400
|
+
const file = files[0];
|
|
401
|
+
if (file) {
|
|
402
|
+
fileUpload(file);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
124
405
|
}
|
|
125
406
|
};
|
|
126
407
|
const handleMessageChange = useCallback(
|
|
127
408
|
(event) => {
|
|
128
409
|
setInternalMessage(event.target.value);
|
|
129
|
-
onMessageChange
|
|
410
|
+
onMessageChange?.(event.target.value);
|
|
130
411
|
},
|
|
131
412
|
[onMessageChange]
|
|
132
413
|
);
|
|
133
|
-
return /* @__PURE__ */ jsxs("div", { className: cn(theme.input.base), children: [
|
|
414
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(theme.input.base, className), children: [
|
|
134
415
|
/* @__PURE__ */ jsx(
|
|
135
416
|
Textarea,
|
|
136
417
|
{
|
|
@@ -147,10 +428,11 @@ const ChatInput = forwardRef(
|
|
|
147
428
|
}
|
|
148
429
|
),
|
|
149
430
|
/* @__PURE__ */ jsxs("div", { className: cn(theme.input.actions.base), children: [
|
|
150
|
-
|
|
431
|
+
allowedFiles?.length > 0 && /* @__PURE__ */ jsx(
|
|
151
432
|
FileInput,
|
|
152
433
|
{
|
|
153
434
|
allowedFiles,
|
|
435
|
+
multiple: allowMultipleFiles,
|
|
154
436
|
onFileUpload: handleFileUpload,
|
|
155
437
|
isLoading,
|
|
156
438
|
disabled,
|
|
@@ -181,1084 +463,1020 @@ const ChatInput = forwardRef(
|
|
|
181
463
|
] });
|
|
182
464
|
}
|
|
183
465
|
);
|
|
184
|
-
const
|
|
185
|
-
children
|
|
186
|
-
}) => {
|
|
187
|
-
const { theme } = useContext(ChatContext);
|
|
188
|
-
return /* @__PURE__ */ jsx("div", { className: cn(theme.empty), children });
|
|
189
|
-
};
|
|
190
|
-
const SessionMessagesHeader = ({ children }) => {
|
|
191
|
-
const { activeSession, theme } = useContext(ChatContext);
|
|
192
|
-
const Comp = children ? Slot : "header";
|
|
193
|
-
if (!activeSession) {
|
|
194
|
-
return null;
|
|
195
|
-
}
|
|
196
|
-
return /* @__PURE__ */ jsx(Comp, { className: cn(theme.messages.header), children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
197
|
-
/* @__PURE__ */ jsx("h2", { className: cn(theme.messages.title), children: /* @__PURE__ */ jsx(Ellipsis, { limit: 125, value: activeSession.title }) }),
|
|
198
|
-
/* @__PURE__ */ jsx(
|
|
199
|
-
DateFormat,
|
|
200
|
-
{
|
|
201
|
-
className: cn(theme.messages.date),
|
|
202
|
-
date: activeSession.createdAt
|
|
203
|
-
}
|
|
204
|
-
)
|
|
205
|
-
] }) });
|
|
206
|
-
};
|
|
207
|
-
const SvgBack = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-chevron-left", ...props }, /* @__PURE__ */ React.createElement("path", { d: "m15 18-6-6 6-6" }));
|
|
208
|
-
const SessionMessagePanel = ({
|
|
209
|
-
children,
|
|
210
|
-
allowBack = true
|
|
211
|
-
}) => {
|
|
212
|
-
const { activeSessionId, theme, isCompact, selectSession, viewType } = useContext(ChatContext);
|
|
213
|
-
const isVisible = isCompact && activeSessionId || viewType === "chat" || !isCompact;
|
|
214
|
-
return isVisible && /* @__PURE__ */ jsx(
|
|
215
|
-
motion.div,
|
|
216
|
-
{
|
|
217
|
-
initial: { translateX: "200%" },
|
|
218
|
-
animate: {
|
|
219
|
-
translateX: "0%",
|
|
220
|
-
transition: {
|
|
221
|
-
type: "tween",
|
|
222
|
-
ease: "linear",
|
|
223
|
-
duration: 0.2,
|
|
224
|
-
when: "beforeChildren"
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
exit: { translateX: "200%" },
|
|
228
|
-
className: cn(theme.messages.base, {
|
|
229
|
-
[theme.messages.companion]: isCompact,
|
|
230
|
-
[theme.messages.console]: !isCompact
|
|
231
|
-
}),
|
|
232
|
-
children: /* @__PURE__ */ jsxs("div", { className: cn(theme.messages.inner), children: [
|
|
233
|
-
allowBack && isCompact && viewType !== "chat" && /* @__PURE__ */ jsxs(
|
|
234
|
-
Button,
|
|
235
|
-
{
|
|
236
|
-
variant: "text",
|
|
237
|
-
size: "small",
|
|
238
|
-
onClick: () => selectSession(null),
|
|
239
|
-
className: cn(theme.messages.back),
|
|
240
|
-
children: [
|
|
241
|
-
/* @__PURE__ */ jsx(SvgBack, {}),
|
|
242
|
-
"Back"
|
|
243
|
-
]
|
|
244
|
-
}
|
|
245
|
-
),
|
|
246
|
-
children
|
|
247
|
-
] })
|
|
248
|
-
}
|
|
249
|
-
);
|
|
250
|
-
};
|
|
251
|
-
const SvgCopy = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-copy", ...props }, /* @__PURE__ */ React.createElement("rect", { width: 14, height: 14, x: 8, y: 8, rx: 2, ry: 2 }), /* @__PURE__ */ React.createElement("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" }));
|
|
466
|
+
const SvgCopy = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M1.75 6C2.164 6 2.5 6.336 2.5 6.75V13.25C2.5 13.939 3.061 14.5 3.75 14.5H12.25C12.664 14.5 13 14.836 13 15.25C13 15.664 12.664 16 12.25 16H3.75C2.233 16 1 14.767 1 13.25V6.75C1 6.336 1.336 6 1.75 6ZM14.25 2C15.7688 2 17 3.23122 17 4.75V10.25C17 11.7688 15.7688 13 14.25 13H6.75C5.23122 13 4 11.7688 4 10.25V4.75C4 3.23122 5.23122 2 6.75 2H14.25Z", fill: "currentColor" }));
|
|
252
467
|
const dark = {
|
|
253
468
|
'code[class*="language-"]': {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
469
|
+
background: "#11111f",
|
|
470
|
+
color: "#e2e8f0",
|
|
471
|
+
textShadow: "0 1px rgba(0, 0, 0, 0.3)",
|
|
472
|
+
fontFamily: '"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',
|
|
473
|
+
direction: "ltr",
|
|
474
|
+
textAlign: "left",
|
|
475
|
+
whiteSpace: "pre",
|
|
476
|
+
wordSpacing: "normal",
|
|
477
|
+
wordBreak: "normal",
|
|
478
|
+
lineHeight: "1.5",
|
|
479
|
+
MozTabSize: "2",
|
|
480
|
+
OTabSize: "2",
|
|
481
|
+
tabSize: "2",
|
|
482
|
+
WebkitHyphens: "none",
|
|
483
|
+
MozHyphens: "none",
|
|
484
|
+
msHyphens: "none",
|
|
485
|
+
hyphens: "none"
|
|
271
486
|
},
|
|
272
487
|
'pre[class*="language-"]': {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
488
|
+
background: "#11111f",
|
|
489
|
+
color: "#e2e8f0",
|
|
490
|
+
textShadow: "0 1px rgba(0, 0, 0, 0.3)",
|
|
491
|
+
fontFamily: '"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',
|
|
492
|
+
direction: "ltr",
|
|
493
|
+
textAlign: "left",
|
|
494
|
+
whiteSpace: "pre",
|
|
495
|
+
wordSpacing: "normal",
|
|
496
|
+
wordBreak: "normal",
|
|
497
|
+
lineHeight: "1.5",
|
|
498
|
+
MozTabSize: "2",
|
|
499
|
+
OTabSize: "2",
|
|
500
|
+
tabSize: "2",
|
|
501
|
+
WebkitHyphens: "none",
|
|
502
|
+
MozHyphens: "none",
|
|
503
|
+
msHyphens: "none",
|
|
504
|
+
hyphens: "none",
|
|
505
|
+
padding: "1em",
|
|
506
|
+
margin: "0",
|
|
507
|
+
overflow: "auto"
|
|
293
508
|
},
|
|
294
509
|
'code[class*="language-"]::-moz-selection': {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
510
|
+
background: "#1e293b",
|
|
511
|
+
color: "inherit",
|
|
512
|
+
textShadow: "none"
|
|
298
513
|
},
|
|
299
514
|
'code[class*="language-"] *::-moz-selection': {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
515
|
+
background: "#1e293b",
|
|
516
|
+
color: "inherit",
|
|
517
|
+
textShadow: "none"
|
|
303
518
|
},
|
|
304
519
|
'pre[class*="language-"] *::-moz-selection': {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
520
|
+
background: "#1e293b",
|
|
521
|
+
color: "inherit",
|
|
522
|
+
textShadow: "none"
|
|
308
523
|
},
|
|
309
524
|
'code[class*="language-"]::selection': {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
525
|
+
background: "#1e293b",
|
|
526
|
+
color: "inherit",
|
|
527
|
+
textShadow: "none"
|
|
313
528
|
},
|
|
314
529
|
'code[class*="language-"] *::selection': {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
530
|
+
background: "#1e293b",
|
|
531
|
+
color: "inherit",
|
|
532
|
+
textShadow: "none"
|
|
318
533
|
},
|
|
319
534
|
'pre[class*="language-"] *::selection': {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
535
|
+
background: "#1e293b",
|
|
536
|
+
color: "inherit",
|
|
537
|
+
textShadow: "none"
|
|
323
538
|
},
|
|
324
539
|
':not(pre) > code[class*="language-"]': {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
540
|
+
padding: "0.2em 0.3em",
|
|
541
|
+
borderRadius: "0.3em",
|
|
542
|
+
whiteSpace: "normal"
|
|
328
543
|
},
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
544
|
+
comment: {
|
|
545
|
+
color: "#64748b",
|
|
546
|
+
fontStyle: "italic"
|
|
332
547
|
},
|
|
333
|
-
|
|
334
|
-
|
|
548
|
+
prolog: {
|
|
549
|
+
color: "#64748b"
|
|
335
550
|
},
|
|
336
|
-
|
|
337
|
-
|
|
551
|
+
cdata: {
|
|
552
|
+
color: "#64748b"
|
|
338
553
|
},
|
|
339
|
-
|
|
340
|
-
|
|
554
|
+
doctype: {
|
|
555
|
+
color: "#e2e8f0"
|
|
341
556
|
},
|
|
342
|
-
|
|
343
|
-
|
|
557
|
+
punctuation: {
|
|
558
|
+
color: "#e2e8f0"
|
|
344
559
|
},
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
560
|
+
entity: {
|
|
561
|
+
color: "#3b82f6",
|
|
562
|
+
cursor: "help"
|
|
348
563
|
},
|
|
349
564
|
"attr-name": {
|
|
350
|
-
|
|
565
|
+
color: "#f59e0b"
|
|
351
566
|
},
|
|
352
567
|
"class-name": {
|
|
353
|
-
|
|
568
|
+
color: "#f59e0b"
|
|
354
569
|
},
|
|
355
|
-
|
|
356
|
-
|
|
570
|
+
boolean: {
|
|
571
|
+
color: "#3b82f6"
|
|
357
572
|
},
|
|
358
|
-
|
|
359
|
-
|
|
573
|
+
constant: {
|
|
574
|
+
color: "#3b82f6"
|
|
360
575
|
},
|
|
361
|
-
|
|
362
|
-
|
|
576
|
+
number: {
|
|
577
|
+
color: "#3b82f6"
|
|
363
578
|
},
|
|
364
|
-
|
|
365
|
-
|
|
579
|
+
atrule: {
|
|
580
|
+
color: "#f59e0b"
|
|
366
581
|
},
|
|
367
|
-
|
|
368
|
-
|
|
582
|
+
keyword: {
|
|
583
|
+
color: "#f472b6"
|
|
369
584
|
},
|
|
370
|
-
|
|
371
|
-
|
|
585
|
+
property: {
|
|
586
|
+
color: "#3b82f6"
|
|
372
587
|
},
|
|
373
|
-
|
|
374
|
-
|
|
588
|
+
tag: {
|
|
589
|
+
color: "#3b82f6"
|
|
375
590
|
},
|
|
376
|
-
|
|
377
|
-
|
|
591
|
+
symbol: {
|
|
592
|
+
color: "#3b82f6"
|
|
378
593
|
},
|
|
379
|
-
|
|
380
|
-
|
|
594
|
+
deleted: {
|
|
595
|
+
color: "#ef4444"
|
|
381
596
|
},
|
|
382
|
-
|
|
383
|
-
|
|
597
|
+
important: {
|
|
598
|
+
color: "#f472b6"
|
|
384
599
|
},
|
|
385
|
-
|
|
386
|
-
|
|
600
|
+
selector: {
|
|
601
|
+
color: "#10b981"
|
|
387
602
|
},
|
|
388
|
-
|
|
389
|
-
|
|
603
|
+
string: {
|
|
604
|
+
color: "#10b981"
|
|
390
605
|
},
|
|
391
|
-
|
|
392
|
-
|
|
606
|
+
char: {
|
|
607
|
+
color: "#10b981"
|
|
393
608
|
},
|
|
394
|
-
|
|
395
|
-
|
|
609
|
+
builtin: {
|
|
610
|
+
color: "#10b981"
|
|
396
611
|
},
|
|
397
|
-
|
|
398
|
-
|
|
612
|
+
inserted: {
|
|
613
|
+
color: "#10b981"
|
|
399
614
|
},
|
|
400
|
-
|
|
401
|
-
|
|
615
|
+
regex: {
|
|
616
|
+
color: "#10b981"
|
|
402
617
|
},
|
|
403
618
|
"attr-value": {
|
|
404
|
-
|
|
619
|
+
color: "#10b981"
|
|
405
620
|
},
|
|
406
621
|
"attr-value > .token.punctuation": {
|
|
407
|
-
|
|
622
|
+
color: "#10b981"
|
|
408
623
|
},
|
|
409
|
-
|
|
410
|
-
|
|
624
|
+
variable: {
|
|
625
|
+
color: "#60a5fa"
|
|
411
626
|
},
|
|
412
|
-
|
|
413
|
-
|
|
627
|
+
operator: {
|
|
628
|
+
color: "#60a5fa"
|
|
414
629
|
},
|
|
415
|
-
|
|
416
|
-
|
|
630
|
+
function: {
|
|
631
|
+
color: "#60a5fa"
|
|
417
632
|
},
|
|
418
|
-
|
|
419
|
-
|
|
633
|
+
url: {
|
|
634
|
+
color: "#60a5fa"
|
|
420
635
|
},
|
|
421
636
|
"attr-value > .token.punctuation.attr-equals": {
|
|
422
|
-
|
|
637
|
+
color: "#e2e8f0"
|
|
423
638
|
},
|
|
424
639
|
"special-attr > .token.attr-value > .token.value.css": {
|
|
425
|
-
|
|
640
|
+
color: "#e2e8f0"
|
|
426
641
|
},
|
|
427
642
|
".language-css .token.selector": {
|
|
428
|
-
|
|
643
|
+
color: "#3b82f6"
|
|
429
644
|
},
|
|
430
645
|
".language-css .token.property": {
|
|
431
|
-
|
|
646
|
+
color: "#e2e8f0"
|
|
432
647
|
},
|
|
433
648
|
".language-css .token.function": {
|
|
434
|
-
|
|
649
|
+
color: "#60a5fa"
|
|
435
650
|
},
|
|
436
651
|
".language-css .token.url > .token.function": {
|
|
437
|
-
|
|
652
|
+
color: "#60a5fa"
|
|
438
653
|
},
|
|
439
654
|
".language-css .token.url > .token.string.url": {
|
|
440
|
-
|
|
655
|
+
color: "#10b981"
|
|
441
656
|
},
|
|
442
657
|
".language-css .token.important": {
|
|
443
|
-
|
|
658
|
+
color: "#f472b6"
|
|
444
659
|
},
|
|
445
660
|
".language-css .token.atrule .token.rule": {
|
|
446
|
-
|
|
661
|
+
color: "#f472b6"
|
|
447
662
|
},
|
|
448
663
|
".language-javascript .token.operator": {
|
|
449
|
-
|
|
664
|
+
color: "#f472b6"
|
|
450
665
|
},
|
|
451
666
|
".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation": {
|
|
452
|
-
|
|
667
|
+
color: "#ef4444"
|
|
453
668
|
},
|
|
454
669
|
".language-json .token.operator": {
|
|
455
|
-
|
|
670
|
+
color: "#e2e8f0"
|
|
456
671
|
},
|
|
457
672
|
".language-json .token.null.keyword": {
|
|
458
|
-
|
|
673
|
+
color: "#3b82f6"
|
|
459
674
|
},
|
|
460
675
|
".language-markdown .token.url": {
|
|
461
|
-
|
|
676
|
+
color: "#e2e8f0"
|
|
462
677
|
},
|
|
463
678
|
".language-markdown .token.url > .token.operator": {
|
|
464
|
-
|
|
679
|
+
color: "#e2e8f0"
|
|
465
680
|
},
|
|
466
681
|
".language-markdown .token.url-reference.url > .token.string": {
|
|
467
|
-
|
|
682
|
+
color: "#e2e8f0"
|
|
468
683
|
},
|
|
469
684
|
".language-markdown .token.url > .token.content": {
|
|
470
|
-
|
|
685
|
+
color: "#60a5fa"
|
|
471
686
|
},
|
|
472
687
|
".language-markdown .token.url > .token.url": {
|
|
473
|
-
|
|
688
|
+
color: "#60a5fa"
|
|
474
689
|
},
|
|
475
690
|
".language-markdown .token.url-reference.url": {
|
|
476
|
-
|
|
691
|
+
color: "#60a5fa"
|
|
477
692
|
},
|
|
478
693
|
".language-markdown .token.blockquote.punctuation": {
|
|
479
|
-
|
|
480
|
-
|
|
694
|
+
color: "#64748b",
|
|
695
|
+
fontStyle: "italic"
|
|
481
696
|
},
|
|
482
697
|
".language-markdown .token.hr.punctuation": {
|
|
483
|
-
|
|
484
|
-
|
|
698
|
+
color: "#64748b",
|
|
699
|
+
fontStyle: "italic"
|
|
485
700
|
},
|
|
486
701
|
".language-markdown .token.code-snippet": {
|
|
487
|
-
|
|
702
|
+
color: "#10b981"
|
|
488
703
|
},
|
|
489
704
|
".language-markdown .token.bold .token.content": {
|
|
490
|
-
|
|
705
|
+
color: "#f59e0b"
|
|
491
706
|
},
|
|
492
707
|
".language-markdown .token.italic .token.content": {
|
|
493
|
-
|
|
708
|
+
color: "#f472b6"
|
|
494
709
|
},
|
|
495
710
|
".language-markdown .token.strike .token.content": {
|
|
496
|
-
|
|
711
|
+
color: "#3b82f6"
|
|
497
712
|
},
|
|
498
713
|
".language-markdown .token.strike .token.punctuation": {
|
|
499
|
-
|
|
714
|
+
color: "#3b82f6"
|
|
500
715
|
},
|
|
501
716
|
".language-markdown .token.list.punctuation": {
|
|
502
|
-
|
|
717
|
+
color: "#3b82f6"
|
|
503
718
|
},
|
|
504
719
|
".language-markdown .token.title.important > .token.punctuation": {
|
|
505
|
-
|
|
720
|
+
color: "#3b82f6"
|
|
506
721
|
},
|
|
507
|
-
|
|
508
|
-
|
|
722
|
+
bold: {
|
|
723
|
+
fontWeight: "bold"
|
|
509
724
|
},
|
|
510
|
-
|
|
511
|
-
|
|
725
|
+
italic: {
|
|
726
|
+
fontStyle: "italic"
|
|
512
727
|
},
|
|
513
|
-
|
|
514
|
-
|
|
728
|
+
namespace: {
|
|
729
|
+
Opacity: "0.8"
|
|
515
730
|
},
|
|
516
731
|
"token.tab:not(:empty):before": {
|
|
517
|
-
|
|
518
|
-
|
|
732
|
+
color: "#64748b",
|
|
733
|
+
textShadow: "none"
|
|
519
734
|
},
|
|
520
735
|
"token.cr:before": {
|
|
521
|
-
|
|
522
|
-
|
|
736
|
+
color: "#64748b",
|
|
737
|
+
textShadow: "none"
|
|
523
738
|
},
|
|
524
739
|
"token.lf:before": {
|
|
525
|
-
|
|
526
|
-
|
|
740
|
+
color: "#64748b",
|
|
741
|
+
textShadow: "none"
|
|
527
742
|
},
|
|
528
743
|
"token.space:before": {
|
|
529
|
-
|
|
530
|
-
|
|
744
|
+
color: "#64748b",
|
|
745
|
+
textShadow: "none"
|
|
531
746
|
},
|
|
532
747
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item": {
|
|
533
|
-
|
|
748
|
+
marginRight: "0.4em"
|
|
534
749
|
},
|
|
535
750
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button": {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
751
|
+
background: "#1e293b",
|
|
752
|
+
color: "#94a3b8",
|
|
753
|
+
padding: "0.1em 0.4em",
|
|
754
|
+
borderRadius: "0.3em"
|
|
540
755
|
},
|
|
541
756
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a": {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
757
|
+
background: "#1e293b",
|
|
758
|
+
color: "#94a3b8",
|
|
759
|
+
padding: "0.1em 0.4em",
|
|
760
|
+
borderRadius: "0.3em"
|
|
546
761
|
},
|
|
547
762
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span": {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
763
|
+
background: "#1e293b",
|
|
764
|
+
color: "#94a3b8",
|
|
765
|
+
padding: "0.1em 0.4em",
|
|
766
|
+
borderRadius: "0.3em"
|
|
552
767
|
},
|
|
553
768
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover": {
|
|
554
|
-
|
|
555
|
-
|
|
769
|
+
background: "#3b82f6",
|
|
770
|
+
color: "#ffffff"
|
|
556
771
|
},
|
|
557
772
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus": {
|
|
558
|
-
|
|
559
|
-
|
|
773
|
+
background: "#3b82f6",
|
|
774
|
+
color: "#ffffff"
|
|
560
775
|
},
|
|
561
776
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover": {
|
|
562
|
-
|
|
563
|
-
|
|
777
|
+
background: "#3b82f6",
|
|
778
|
+
color: "#ffffff"
|
|
564
779
|
},
|
|
565
780
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus": {
|
|
566
|
-
|
|
567
|
-
|
|
781
|
+
background: "#3b82f6",
|
|
782
|
+
color: "#ffffff"
|
|
568
783
|
},
|
|
569
784
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover": {
|
|
570
|
-
|
|
571
|
-
|
|
785
|
+
background: "#3b82f6",
|
|
786
|
+
color: "#ffffff"
|
|
572
787
|
},
|
|
573
788
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus": {
|
|
574
|
-
|
|
575
|
-
|
|
789
|
+
background: "#3b82f6",
|
|
790
|
+
color: "#ffffff"
|
|
576
791
|
},
|
|
577
792
|
".line-highlight.line-highlight": {
|
|
578
|
-
|
|
793
|
+
background: "rgba(59, 130, 246, 0.08)"
|
|
579
794
|
},
|
|
580
795
|
".line-highlight.line-highlight:before": {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
796
|
+
background: "#1e293b",
|
|
797
|
+
color: "#e2e8f0",
|
|
798
|
+
padding: "0.1em 0.6em",
|
|
799
|
+
borderRadius: "0.3em",
|
|
800
|
+
boxShadow: "0 2px 0 0 rgba(0, 0, 0, 0.2)"
|
|
586
801
|
},
|
|
587
802
|
".line-highlight.line-highlight[data-end]:after": {
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
803
|
+
background: "#1e293b",
|
|
804
|
+
color: "#e2e8f0",
|
|
805
|
+
padding: "0.1em 0.6em",
|
|
806
|
+
borderRadius: "0.3em",
|
|
807
|
+
boxShadow: "0 2px 0 0 rgba(0, 0, 0, 0.2)"
|
|
593
808
|
},
|
|
594
809
|
"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before": {
|
|
595
|
-
|
|
810
|
+
backgroundColor: "rgba(59, 130, 246, 0.08)"
|
|
596
811
|
},
|
|
597
812
|
".line-numbers.line-numbers .line-numbers-rows": {
|
|
598
|
-
|
|
813
|
+
borderRightColor: "#1e293b"
|
|
599
814
|
},
|
|
600
815
|
".command-line .command-line-prompt": {
|
|
601
|
-
|
|
816
|
+
borderRightColor: "#1e293b"
|
|
602
817
|
},
|
|
603
818
|
".line-numbers .line-numbers-rows > span:before": {
|
|
604
|
-
|
|
819
|
+
color: "#64748b"
|
|
605
820
|
},
|
|
606
821
|
".command-line .command-line-prompt > span:before": {
|
|
607
|
-
|
|
822
|
+
color: "#64748b"
|
|
608
823
|
},
|
|
609
824
|
".rainbow-braces .token.token.punctuation.brace-level-1": {
|
|
610
|
-
|
|
825
|
+
color: "#3b82f6"
|
|
611
826
|
},
|
|
612
827
|
".rainbow-braces .token.token.punctuation.brace-level-5": {
|
|
613
|
-
|
|
828
|
+
color: "#3b82f6"
|
|
614
829
|
},
|
|
615
830
|
".rainbow-braces .token.token.punctuation.brace-level-9": {
|
|
616
|
-
|
|
831
|
+
color: "#3b82f6"
|
|
617
832
|
},
|
|
618
833
|
".rainbow-braces .token.token.punctuation.brace-level-2": {
|
|
619
|
-
|
|
834
|
+
color: "#10b981"
|
|
620
835
|
},
|
|
621
836
|
".rainbow-braces .token.token.punctuation.brace-level-6": {
|
|
622
|
-
|
|
837
|
+
color: "#10b981"
|
|
623
838
|
},
|
|
624
839
|
".rainbow-braces .token.token.punctuation.brace-level-10": {
|
|
625
|
-
|
|
840
|
+
color: "#10b981"
|
|
626
841
|
},
|
|
627
842
|
".rainbow-braces .token.token.punctuation.brace-level-3": {
|
|
628
|
-
|
|
843
|
+
color: "#60a5fa"
|
|
629
844
|
},
|
|
630
845
|
".rainbow-braces .token.token.punctuation.brace-level-7": {
|
|
631
|
-
|
|
846
|
+
color: "#60a5fa"
|
|
632
847
|
},
|
|
633
848
|
".rainbow-braces .token.token.punctuation.brace-level-11": {
|
|
634
|
-
|
|
849
|
+
color: "#60a5fa"
|
|
635
850
|
},
|
|
636
851
|
".rainbow-braces .token.token.punctuation.brace-level-4": {
|
|
637
|
-
|
|
852
|
+
color: "#f472b6"
|
|
638
853
|
},
|
|
639
854
|
".rainbow-braces .token.token.punctuation.brace-level-8": {
|
|
640
|
-
|
|
855
|
+
color: "#f472b6"
|
|
641
856
|
},
|
|
642
857
|
".rainbow-braces .token.token.punctuation.brace-level-12": {
|
|
643
|
-
|
|
858
|
+
color: "#f472b6"
|
|
644
859
|
},
|
|
645
860
|
"pre.diff-highlight > code .token.token.deleted:not(.prefix)": {
|
|
646
|
-
|
|
861
|
+
backgroundColor: "rgba(239, 68, 68, 0.15)"
|
|
647
862
|
},
|
|
648
863
|
"pre > code.diff-highlight .token.token.deleted:not(.prefix)": {
|
|
649
|
-
|
|
864
|
+
backgroundColor: "rgba(239, 68, 68, 0.15)"
|
|
650
865
|
},
|
|
651
866
|
"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection": {
|
|
652
|
-
|
|
867
|
+
backgroundColor: "rgba(239, 68, 68, 0.25)"
|
|
653
868
|
},
|
|
654
869
|
"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection": {
|
|
655
|
-
|
|
870
|
+
backgroundColor: "rgba(239, 68, 68, 0.25)"
|
|
656
871
|
},
|
|
657
872
|
"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection": {
|
|
658
|
-
|
|
873
|
+
backgroundColor: "rgba(239, 68, 68, 0.25)"
|
|
659
874
|
},
|
|
660
875
|
"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection": {
|
|
661
|
-
|
|
876
|
+
backgroundColor: "rgba(239, 68, 68, 0.25)"
|
|
662
877
|
},
|
|
663
878
|
"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection": {
|
|
664
|
-
|
|
879
|
+
backgroundColor: "rgba(239, 68, 68, 0.25)"
|
|
665
880
|
},
|
|
666
881
|
"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection": {
|
|
667
|
-
|
|
882
|
+
backgroundColor: "rgba(239, 68, 68, 0.25)"
|
|
668
883
|
},
|
|
669
884
|
"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection": {
|
|
670
|
-
|
|
885
|
+
backgroundColor: "rgba(239, 68, 68, 0.25)"
|
|
671
886
|
},
|
|
672
887
|
"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection": {
|
|
673
|
-
|
|
888
|
+
backgroundColor: "rgba(239, 68, 68, 0.25)"
|
|
674
889
|
},
|
|
675
890
|
"pre.diff-highlight > code .token.token.inserted:not(.prefix)": {
|
|
676
|
-
|
|
891
|
+
backgroundColor: "rgba(16, 185, 129, 0.15)"
|
|
677
892
|
},
|
|
678
893
|
"pre > code.diff-highlight .token.token.inserted:not(.prefix)": {
|
|
679
|
-
|
|
894
|
+
backgroundColor: "rgba(16, 185, 129, 0.15)"
|
|
680
895
|
},
|
|
681
896
|
"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection": {
|
|
682
|
-
|
|
897
|
+
backgroundColor: "rgba(16, 185, 129, 0.25)"
|
|
683
898
|
},
|
|
684
899
|
"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection": {
|
|
685
|
-
|
|
900
|
+
backgroundColor: "rgba(16, 185, 129, 0.25)"
|
|
686
901
|
},
|
|
687
902
|
"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection": {
|
|
688
|
-
|
|
903
|
+
backgroundColor: "rgba(16, 185, 129, 0.25)"
|
|
689
904
|
},
|
|
690
905
|
"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection": {
|
|
691
|
-
|
|
906
|
+
backgroundColor: "rgba(16, 185, 129, 0.25)"
|
|
692
907
|
},
|
|
693
908
|
"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection": {
|
|
694
|
-
|
|
909
|
+
backgroundColor: "rgba(16, 185, 129, 0.25)"
|
|
695
910
|
},
|
|
696
911
|
"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection": {
|
|
697
|
-
|
|
912
|
+
backgroundColor: "rgba(16, 185, 129, 0.25)"
|
|
698
913
|
},
|
|
699
914
|
"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection": {
|
|
700
|
-
|
|
915
|
+
backgroundColor: "rgba(16, 185, 129, 0.25)"
|
|
701
916
|
},
|
|
702
917
|
"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection": {
|
|
703
|
-
|
|
918
|
+
backgroundColor: "rgba(16, 185, 129, 0.25)"
|
|
704
919
|
},
|
|
705
920
|
".prism-previewer.prism-previewer:before": {
|
|
706
|
-
|
|
921
|
+
borderColor: "#11111f"
|
|
707
922
|
},
|
|
708
923
|
".prism-previewer-gradient.prism-previewer-gradient div": {
|
|
709
|
-
|
|
710
|
-
|
|
924
|
+
borderColor: "#11111f",
|
|
925
|
+
borderRadius: "0.3em"
|
|
711
926
|
},
|
|
712
927
|
".prism-previewer-color.prism-previewer-color:before": {
|
|
713
|
-
|
|
928
|
+
borderRadius: "0.3em"
|
|
714
929
|
},
|
|
715
930
|
".prism-previewer-easing.prism-previewer-easing:before": {
|
|
716
|
-
|
|
931
|
+
borderRadius: "0.3em"
|
|
717
932
|
},
|
|
718
933
|
".prism-previewer.prism-previewer:after": {
|
|
719
|
-
|
|
934
|
+
borderTopColor: "#11111f"
|
|
720
935
|
},
|
|
721
936
|
".prism-previewer-flipped.prism-previewer-flipped.after": {
|
|
722
|
-
|
|
937
|
+
borderBottomColor: "#11111f"
|
|
723
938
|
},
|
|
724
939
|
".prism-previewer-angle.prism-previewer-angle:before": {
|
|
725
|
-
|
|
940
|
+
background: "#1e293b"
|
|
726
941
|
},
|
|
727
942
|
".prism-previewer-time.prism-previewer-time:before": {
|
|
728
|
-
|
|
943
|
+
background: "#1e293b"
|
|
729
944
|
},
|
|
730
945
|
".prism-previewer-easing.prism-previewer-easing": {
|
|
731
|
-
|
|
946
|
+
background: "#1e293b"
|
|
732
947
|
},
|
|
733
948
|
".prism-previewer-angle.prism-previewer-angle circle": {
|
|
734
|
-
|
|
735
|
-
|
|
949
|
+
stroke: "#e2e8f0",
|
|
950
|
+
strokeOpacity: "1"
|
|
736
951
|
},
|
|
737
952
|
".prism-previewer-time.prism-previewer-time circle": {
|
|
738
|
-
|
|
739
|
-
|
|
953
|
+
stroke: "#e2e8f0",
|
|
954
|
+
strokeOpacity: "1"
|
|
740
955
|
},
|
|
741
956
|
".prism-previewer-easing.prism-previewer-easing circle": {
|
|
742
|
-
|
|
743
|
-
|
|
957
|
+
stroke: "#e2e8f0",
|
|
958
|
+
fill: "transparent"
|
|
744
959
|
},
|
|
745
960
|
".prism-previewer-easing.prism-previewer-easing path": {
|
|
746
|
-
|
|
961
|
+
stroke: "#e2e8f0"
|
|
747
962
|
},
|
|
748
963
|
".prism-previewer-easing.prism-previewer-easing line": {
|
|
749
|
-
|
|
964
|
+
stroke: "#e2e8f0"
|
|
750
965
|
}
|
|
751
966
|
};
|
|
752
967
|
const light = {
|
|
753
968
|
'code[class*="language-"]': {
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
969
|
+
background: "#fff",
|
|
970
|
+
color: "#1e293b",
|
|
971
|
+
textShadow: "none",
|
|
972
|
+
fontFamily: '"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',
|
|
973
|
+
direction: "ltr",
|
|
974
|
+
textAlign: "left",
|
|
975
|
+
whiteSpace: "pre",
|
|
976
|
+
wordSpacing: "normal",
|
|
977
|
+
wordBreak: "normal",
|
|
978
|
+
lineHeight: "1.5",
|
|
979
|
+
MozTabSize: "2",
|
|
980
|
+
OTabSize: "2",
|
|
981
|
+
tabSize: "2",
|
|
982
|
+
WebkitHyphens: "none",
|
|
983
|
+
MozHyphens: "none",
|
|
984
|
+
msHyphens: "none",
|
|
985
|
+
hyphens: "none"
|
|
771
986
|
},
|
|
772
987
|
'pre[class*="language-"]': {
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
988
|
+
background: "#fff",
|
|
989
|
+
color: "#1e293b",
|
|
990
|
+
textShadow: "none",
|
|
991
|
+
fontFamily: '"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',
|
|
992
|
+
direction: "ltr",
|
|
993
|
+
textAlign: "left",
|
|
994
|
+
whiteSpace: "pre",
|
|
995
|
+
wordSpacing: "normal",
|
|
996
|
+
wordBreak: "normal",
|
|
997
|
+
lineHeight: "1.5",
|
|
998
|
+
MozTabSize: "2",
|
|
999
|
+
OTabSize: "2",
|
|
1000
|
+
tabSize: "2",
|
|
1001
|
+
WebkitHyphens: "none",
|
|
1002
|
+
MozHyphens: "none",
|
|
1003
|
+
msHyphens: "none",
|
|
1004
|
+
hyphens: "none",
|
|
1005
|
+
padding: "1em",
|
|
1006
|
+
margin: "0.5em 0",
|
|
1007
|
+
overflow: "auto",
|
|
1008
|
+
borderRadius: "0.3em",
|
|
1009
|
+
border: "1px solid #e2e8f0"
|
|
795
1010
|
},
|
|
796
1011
|
'code[class*="language-"]::-moz-selection': {
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
1012
|
+
background: "#e2e8f0",
|
|
1013
|
+
color: "inherit",
|
|
1014
|
+
textShadow: "none"
|
|
800
1015
|
},
|
|
801
1016
|
'code[class*="language-"] *::-moz-selection': {
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
1017
|
+
background: "#e2e8f0",
|
|
1018
|
+
color: "inherit",
|
|
1019
|
+
textShadow: "none"
|
|
805
1020
|
},
|
|
806
1021
|
'pre[class*="language-"] *::-moz-selection': {
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
1022
|
+
background: "#e2e8f0",
|
|
1023
|
+
color: "inherit",
|
|
1024
|
+
textShadow: "none"
|
|
810
1025
|
},
|
|
811
1026
|
'code[class*="language-"]::selection': {
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
1027
|
+
background: "#e2e8f0",
|
|
1028
|
+
color: "inherit",
|
|
1029
|
+
textShadow: "none"
|
|
815
1030
|
},
|
|
816
1031
|
'code[class*="language-"] *::selection': {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
1032
|
+
background: "#e2e8f0",
|
|
1033
|
+
color: "inherit",
|
|
1034
|
+
textShadow: "none"
|
|
820
1035
|
},
|
|
821
1036
|
'pre[class*="language-"] *::selection': {
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
1037
|
+
background: "#e2e8f0",
|
|
1038
|
+
color: "inherit",
|
|
1039
|
+
textShadow: "none"
|
|
825
1040
|
},
|
|
826
1041
|
':not(pre) > code[class*="language-"]': {
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
1042
|
+
padding: "0.2em 0.3em",
|
|
1043
|
+
borderRadius: "0.3em",
|
|
1044
|
+
whiteSpace: "normal",
|
|
1045
|
+
background: "#f1f5f9"
|
|
831
1046
|
},
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
1047
|
+
comment: {
|
|
1048
|
+
color: "#64748b",
|
|
1049
|
+
fontStyle: "italic"
|
|
835
1050
|
},
|
|
836
|
-
|
|
837
|
-
|
|
1051
|
+
prolog: {
|
|
1052
|
+
color: "#64748b"
|
|
838
1053
|
},
|
|
839
|
-
|
|
840
|
-
|
|
1054
|
+
cdata: {
|
|
1055
|
+
color: "#64748b"
|
|
841
1056
|
},
|
|
842
|
-
|
|
843
|
-
|
|
1057
|
+
doctype: {
|
|
1058
|
+
color: "#1e293b"
|
|
844
1059
|
},
|
|
845
|
-
|
|
846
|
-
|
|
1060
|
+
punctuation: {
|
|
1061
|
+
color: "#64748b"
|
|
847
1062
|
},
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
1063
|
+
entity: {
|
|
1064
|
+
color: "#3b82f6",
|
|
1065
|
+
cursor: "help"
|
|
851
1066
|
},
|
|
852
1067
|
"attr-name": {
|
|
853
|
-
|
|
1068
|
+
color: "#ea580c"
|
|
854
1069
|
},
|
|
855
1070
|
"class-name": {
|
|
856
|
-
|
|
1071
|
+
color: "#ea580c"
|
|
857
1072
|
},
|
|
858
|
-
|
|
859
|
-
|
|
1073
|
+
boolean: {
|
|
1074
|
+
color: "#3b82f6"
|
|
860
1075
|
},
|
|
861
|
-
|
|
862
|
-
|
|
1076
|
+
constant: {
|
|
1077
|
+
color: "#3b82f6"
|
|
863
1078
|
},
|
|
864
|
-
|
|
865
|
-
|
|
1079
|
+
number: {
|
|
1080
|
+
color: "#3b82f6"
|
|
866
1081
|
},
|
|
867
|
-
|
|
868
|
-
|
|
1082
|
+
atrule: {
|
|
1083
|
+
color: "#ea580c"
|
|
869
1084
|
},
|
|
870
|
-
|
|
871
|
-
|
|
1085
|
+
keyword: {
|
|
1086
|
+
color: "#9333ea"
|
|
872
1087
|
},
|
|
873
|
-
|
|
874
|
-
|
|
1088
|
+
property: {
|
|
1089
|
+
color: "#3b82f6"
|
|
875
1090
|
},
|
|
876
|
-
|
|
877
|
-
|
|
1091
|
+
tag: {
|
|
1092
|
+
color: "#3b82f6"
|
|
878
1093
|
},
|
|
879
|
-
|
|
880
|
-
|
|
1094
|
+
symbol: {
|
|
1095
|
+
color: "#3b82f6"
|
|
881
1096
|
},
|
|
882
|
-
|
|
883
|
-
|
|
1097
|
+
deleted: {
|
|
1098
|
+
color: "#dc2626"
|
|
884
1099
|
},
|
|
885
|
-
|
|
886
|
-
|
|
1100
|
+
important: {
|
|
1101
|
+
color: "#9333ea"
|
|
887
1102
|
},
|
|
888
|
-
|
|
889
|
-
|
|
1103
|
+
selector: {
|
|
1104
|
+
color: "#16a34a"
|
|
890
1105
|
},
|
|
891
|
-
|
|
892
|
-
|
|
1106
|
+
string: {
|
|
1107
|
+
color: "#16a34a"
|
|
893
1108
|
},
|
|
894
|
-
|
|
895
|
-
|
|
1109
|
+
char: {
|
|
1110
|
+
color: "#16a34a"
|
|
896
1111
|
},
|
|
897
|
-
|
|
898
|
-
|
|
1112
|
+
builtin: {
|
|
1113
|
+
color: "#16a34a"
|
|
899
1114
|
},
|
|
900
|
-
|
|
901
|
-
|
|
1115
|
+
inserted: {
|
|
1116
|
+
color: "#16a34a"
|
|
902
1117
|
},
|
|
903
|
-
|
|
904
|
-
|
|
1118
|
+
regex: {
|
|
1119
|
+
color: "#16a34a"
|
|
905
1120
|
},
|
|
906
1121
|
"attr-value": {
|
|
907
|
-
|
|
1122
|
+
color: "#16a34a"
|
|
908
1123
|
},
|
|
909
1124
|
"attr-value > .token.punctuation": {
|
|
910
|
-
|
|
1125
|
+
color: "#16a34a"
|
|
911
1126
|
},
|
|
912
|
-
|
|
913
|
-
|
|
1127
|
+
variable: {
|
|
1128
|
+
color: "#3b82f6"
|
|
914
1129
|
},
|
|
915
|
-
|
|
916
|
-
|
|
1130
|
+
operator: {
|
|
1131
|
+
color: "#3b82f6"
|
|
917
1132
|
},
|
|
918
|
-
|
|
919
|
-
|
|
1133
|
+
function: {
|
|
1134
|
+
color: "#3b82f6"
|
|
920
1135
|
},
|
|
921
|
-
|
|
922
|
-
|
|
1136
|
+
url: {
|
|
1137
|
+
color: "#3b82f6"
|
|
923
1138
|
},
|
|
924
1139
|
"attr-value > .token.punctuation.attr-equals": {
|
|
925
|
-
|
|
1140
|
+
color: "#64748b"
|
|
926
1141
|
},
|
|
927
1142
|
"special-attr > .token.attr-value > .token.value.css": {
|
|
928
|
-
|
|
1143
|
+
color: "#1e293b"
|
|
929
1144
|
},
|
|
930
1145
|
".language-css .token.selector": {
|
|
931
|
-
|
|
1146
|
+
color: "#3b82f6"
|
|
932
1147
|
},
|
|
933
1148
|
".language-css .token.property": {
|
|
934
|
-
|
|
1149
|
+
color: "#1e293b"
|
|
935
1150
|
},
|
|
936
1151
|
".language-css .token.function": {
|
|
937
|
-
|
|
1152
|
+
color: "#3b82f6"
|
|
938
1153
|
},
|
|
939
1154
|
".language-css .token.url > .token.function": {
|
|
940
|
-
|
|
1155
|
+
color: "#3b82f6"
|
|
941
1156
|
},
|
|
942
1157
|
".language-css .token.url > .token.string.url": {
|
|
943
|
-
|
|
1158
|
+
color: "#16a34a"
|
|
944
1159
|
},
|
|
945
1160
|
".language-css .token.important": {
|
|
946
|
-
|
|
1161
|
+
color: "#9333ea"
|
|
947
1162
|
},
|
|
948
1163
|
".language-css .token.atrule .token.rule": {
|
|
949
|
-
|
|
1164
|
+
color: "#9333ea"
|
|
950
1165
|
},
|
|
951
1166
|
".language-javascript .token.operator": {
|
|
952
|
-
|
|
1167
|
+
color: "#9333ea"
|
|
953
1168
|
},
|
|
954
1169
|
".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation": {
|
|
955
|
-
|
|
1170
|
+
color: "#dc2626"
|
|
956
1171
|
},
|
|
957
1172
|
".language-json .token.operator": {
|
|
958
|
-
|
|
1173
|
+
color: "#1e293b"
|
|
959
1174
|
},
|
|
960
1175
|
".language-json .token.null.keyword": {
|
|
961
|
-
|
|
1176
|
+
color: "#3b82f6"
|
|
962
1177
|
},
|
|
963
1178
|
".language-markdown .token.url": {
|
|
964
|
-
|
|
1179
|
+
color: "#1e293b"
|
|
965
1180
|
},
|
|
966
1181
|
".language-markdown .token.url > .token.operator": {
|
|
967
|
-
|
|
1182
|
+
color: "#1e293b"
|
|
968
1183
|
},
|
|
969
1184
|
".language-markdown .token.url-reference.url > .token.string": {
|
|
970
|
-
|
|
1185
|
+
color: "#1e293b"
|
|
971
1186
|
},
|
|
972
1187
|
".language-markdown .token.url > .token.content": {
|
|
973
|
-
|
|
1188
|
+
color: "#3b82f6"
|
|
974
1189
|
},
|
|
975
1190
|
".language-markdown .token.url > .token.url": {
|
|
976
|
-
|
|
1191
|
+
color: "#3b82f6"
|
|
977
1192
|
},
|
|
978
1193
|
".language-markdown .token.url-reference.url": {
|
|
979
|
-
|
|
1194
|
+
color: "#3b82f6"
|
|
980
1195
|
},
|
|
981
1196
|
".language-markdown .token.blockquote.punctuation": {
|
|
982
|
-
|
|
983
|
-
|
|
1197
|
+
color: "#64748b",
|
|
1198
|
+
fontStyle: "italic"
|
|
984
1199
|
},
|
|
985
1200
|
".language-markdown .token.hr.punctuation": {
|
|
986
|
-
|
|
987
|
-
|
|
1201
|
+
color: "#64748b",
|
|
1202
|
+
fontStyle: "italic"
|
|
988
1203
|
},
|
|
989
1204
|
".language-markdown .token.code-snippet": {
|
|
990
|
-
|
|
1205
|
+
color: "#16a34a"
|
|
991
1206
|
},
|
|
992
1207
|
".language-markdown .token.bold .token.content": {
|
|
993
|
-
|
|
1208
|
+
color: "#ea580c"
|
|
994
1209
|
},
|
|
995
1210
|
".language-markdown .token.italic .token.content": {
|
|
996
|
-
|
|
1211
|
+
color: "#9333ea"
|
|
997
1212
|
},
|
|
998
1213
|
".language-markdown .token.strike .token.content": {
|
|
999
|
-
|
|
1214
|
+
color: "#3b82f6"
|
|
1000
1215
|
},
|
|
1001
1216
|
".language-markdown .token.strike .token.punctuation": {
|
|
1002
|
-
|
|
1217
|
+
color: "#3b82f6"
|
|
1003
1218
|
},
|
|
1004
1219
|
".language-markdown .token.list.punctuation": {
|
|
1005
|
-
|
|
1220
|
+
color: "#3b82f6"
|
|
1006
1221
|
},
|
|
1007
1222
|
".language-markdown .token.title.important > .token.punctuation": {
|
|
1008
|
-
|
|
1223
|
+
color: "#3b82f6"
|
|
1009
1224
|
},
|
|
1010
|
-
|
|
1011
|
-
|
|
1225
|
+
bold: {
|
|
1226
|
+
fontWeight: "bold"
|
|
1012
1227
|
},
|
|
1013
|
-
|
|
1014
|
-
|
|
1228
|
+
italic: {
|
|
1229
|
+
fontStyle: "italic"
|
|
1015
1230
|
},
|
|
1016
|
-
|
|
1017
|
-
|
|
1231
|
+
namespace: {
|
|
1232
|
+
Opacity: "0.8"
|
|
1018
1233
|
},
|
|
1019
1234
|
"token.tab:not(:empty):before": {
|
|
1020
|
-
|
|
1235
|
+
color: "#94a3b8"
|
|
1021
1236
|
},
|
|
1022
1237
|
"token.cr:before": {
|
|
1023
|
-
|
|
1238
|
+
color: "#94a3b8"
|
|
1024
1239
|
},
|
|
1025
1240
|
"token.lf:before": {
|
|
1026
|
-
|
|
1241
|
+
color: "#94a3b8"
|
|
1027
1242
|
},
|
|
1028
1243
|
"token.space:before": {
|
|
1029
|
-
|
|
1244
|
+
color: "#94a3b8"
|
|
1030
1245
|
},
|
|
1031
1246
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item": {
|
|
1032
|
-
|
|
1247
|
+
marginRight: "0.4em"
|
|
1033
1248
|
},
|
|
1034
1249
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button": {
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1250
|
+
background: "#f1f5f9",
|
|
1251
|
+
color: "#475569",
|
|
1252
|
+
padding: "0.1em 0.4em",
|
|
1253
|
+
borderRadius: "0.3em"
|
|
1039
1254
|
},
|
|
1040
1255
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a": {
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1256
|
+
background: "#f1f5f9",
|
|
1257
|
+
color: "#475569",
|
|
1258
|
+
padding: "0.1em 0.4em",
|
|
1259
|
+
borderRadius: "0.3em"
|
|
1045
1260
|
},
|
|
1046
1261
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span": {
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1262
|
+
background: "#f1f5f9",
|
|
1263
|
+
color: "#475569",
|
|
1264
|
+
padding: "0.1em 0.4em",
|
|
1265
|
+
borderRadius: "0.3em"
|
|
1051
1266
|
},
|
|
1052
1267
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover": {
|
|
1053
|
-
|
|
1054
|
-
|
|
1268
|
+
background: "#3b82f6",
|
|
1269
|
+
color: "#ffffff"
|
|
1055
1270
|
},
|
|
1056
1271
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus": {
|
|
1057
|
-
|
|
1058
|
-
|
|
1272
|
+
background: "#3b82f6",
|
|
1273
|
+
color: "#ffffff"
|
|
1059
1274
|
},
|
|
1060
1275
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover": {
|
|
1061
|
-
|
|
1062
|
-
|
|
1276
|
+
background: "#3b82f6",
|
|
1277
|
+
color: "#ffffff"
|
|
1063
1278
|
},
|
|
1064
1279
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus": {
|
|
1065
|
-
|
|
1066
|
-
|
|
1280
|
+
background: "#3b82f6",
|
|
1281
|
+
color: "#ffffff"
|
|
1067
1282
|
},
|
|
1068
1283
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover": {
|
|
1069
|
-
|
|
1070
|
-
|
|
1284
|
+
background: "#3b82f6",
|
|
1285
|
+
color: "#ffffff"
|
|
1071
1286
|
},
|
|
1072
1287
|
"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus": {
|
|
1073
|
-
|
|
1074
|
-
|
|
1288
|
+
background: "#3b82f6",
|
|
1289
|
+
color: "#ffffff"
|
|
1075
1290
|
},
|
|
1076
1291
|
".line-highlight.line-highlight": {
|
|
1077
|
-
|
|
1292
|
+
background: "rgba(59, 130, 246, 0.08)"
|
|
1078
1293
|
},
|
|
1079
1294
|
".line-highlight.line-highlight:before": {
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1295
|
+
background: "#f1f5f9",
|
|
1296
|
+
color: "#1e293b",
|
|
1297
|
+
padding: "0.1em 0.6em",
|
|
1298
|
+
borderRadius: "0.3em",
|
|
1299
|
+
boxShadow: "0 2px 0 0 rgba(0, 0, 0, 0.1)"
|
|
1085
1300
|
},
|
|
1086
1301
|
".line-highlight.line-highlight[data-end]:after": {
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1302
|
+
background: "#f1f5f9",
|
|
1303
|
+
color: "#1e293b",
|
|
1304
|
+
padding: "0.1em 0.6em",
|
|
1305
|
+
borderRadius: "0.3em",
|
|
1306
|
+
boxShadow: "0 2px 0 0 rgba(0, 0, 0, 0.1)"
|
|
1092
1307
|
},
|
|
1093
1308
|
"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before": {
|
|
1094
|
-
|
|
1309
|
+
backgroundColor: "rgba(59, 130, 246, 0.08)"
|
|
1095
1310
|
},
|
|
1096
1311
|
".line-numbers.line-numbers .line-numbers-rows": {
|
|
1097
|
-
|
|
1312
|
+
borderRightColor: "#e2e8f0"
|
|
1098
1313
|
},
|
|
1099
1314
|
".command-line .command-line-prompt": {
|
|
1100
|
-
|
|
1315
|
+
borderRightColor: "#e2e8f0"
|
|
1101
1316
|
},
|
|
1102
1317
|
".line-numbers .line-numbers-rows > span:before": {
|
|
1103
|
-
|
|
1318
|
+
color: "#94a3b8"
|
|
1104
1319
|
},
|
|
1105
1320
|
".command-line .command-line-prompt > span:before": {
|
|
1106
|
-
|
|
1321
|
+
color: "#94a3b8"
|
|
1107
1322
|
},
|
|
1108
1323
|
".rainbow-braces .token.token.punctuation.brace-level-1": {
|
|
1109
|
-
|
|
1324
|
+
color: "#3b82f6"
|
|
1110
1325
|
},
|
|
1111
1326
|
".rainbow-braces .token.token.punctuation.brace-level-5": {
|
|
1112
|
-
|
|
1327
|
+
color: "#3b82f6"
|
|
1113
1328
|
},
|
|
1114
1329
|
".rainbow-braces .token.token.punctuation.brace-level-9": {
|
|
1115
|
-
|
|
1330
|
+
color: "#3b82f6"
|
|
1116
1331
|
},
|
|
1117
1332
|
".rainbow-braces .token.token.punctuation.brace-level-2": {
|
|
1118
|
-
|
|
1333
|
+
color: "#16a34a"
|
|
1119
1334
|
},
|
|
1120
1335
|
".rainbow-braces .token.token.punctuation.brace-level-6": {
|
|
1121
|
-
|
|
1336
|
+
color: "#16a34a"
|
|
1122
1337
|
},
|
|
1123
1338
|
".rainbow-braces .token.token.punctuation.brace-level-10": {
|
|
1124
|
-
|
|
1339
|
+
color: "#16a34a"
|
|
1125
1340
|
},
|
|
1126
1341
|
".rainbow-braces .token.token.punctuation.brace-level-3": {
|
|
1127
|
-
|
|
1342
|
+
color: "#ea580c"
|
|
1128
1343
|
},
|
|
1129
1344
|
".rainbow-braces .token.token.punctuation.brace-level-7": {
|
|
1130
|
-
|
|
1345
|
+
color: "#ea580c"
|
|
1131
1346
|
},
|
|
1132
1347
|
".rainbow-braces .token.token.punctuation.brace-level-11": {
|
|
1133
|
-
|
|
1348
|
+
color: "#ea580c"
|
|
1134
1349
|
},
|
|
1135
1350
|
".rainbow-braces .token.token.punctuation.brace-level-4": {
|
|
1136
|
-
|
|
1351
|
+
color: "#9333ea"
|
|
1137
1352
|
},
|
|
1138
1353
|
".rainbow-braces .token.token.punctuation.brace-level-8": {
|
|
1139
|
-
|
|
1354
|
+
color: "#9333ea"
|
|
1140
1355
|
},
|
|
1141
1356
|
".rainbow-braces .token.token.punctuation.brace-level-12": {
|
|
1142
|
-
|
|
1357
|
+
color: "#9333ea"
|
|
1143
1358
|
},
|
|
1144
1359
|
"pre.diff-highlight > code .token.token.deleted:not(.prefix)": {
|
|
1145
|
-
|
|
1360
|
+
backgroundColor: "rgba(220, 38, 38, 0.15)"
|
|
1146
1361
|
},
|
|
1147
1362
|
"pre > code.diff-highlight .token.token.deleted:not(.prefix)": {
|
|
1148
|
-
|
|
1363
|
+
backgroundColor: "rgba(220, 38, 38, 0.15)"
|
|
1149
1364
|
},
|
|
1150
1365
|
"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection": {
|
|
1151
|
-
|
|
1366
|
+
backgroundColor: "rgba(220, 38, 38, 0.25)"
|
|
1152
1367
|
},
|
|
1153
1368
|
"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection": {
|
|
1154
|
-
|
|
1369
|
+
backgroundColor: "rgba(220, 38, 38, 0.25)"
|
|
1155
1370
|
},
|
|
1156
1371
|
"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection": {
|
|
1157
|
-
|
|
1372
|
+
backgroundColor: "rgba(220, 38, 38, 0.25)"
|
|
1158
1373
|
},
|
|
1159
1374
|
"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection": {
|
|
1160
|
-
|
|
1375
|
+
backgroundColor: "rgba(220, 38, 38, 0.25)"
|
|
1161
1376
|
},
|
|
1162
1377
|
"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection": {
|
|
1163
|
-
|
|
1378
|
+
backgroundColor: "rgba(220, 38, 38, 0.25)"
|
|
1164
1379
|
},
|
|
1165
1380
|
"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection": {
|
|
1166
|
-
|
|
1381
|
+
backgroundColor: "rgba(220, 38, 38, 0.25)"
|
|
1167
1382
|
},
|
|
1168
1383
|
"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection": {
|
|
1169
|
-
|
|
1384
|
+
backgroundColor: "rgba(220, 38, 38, 0.25)"
|
|
1170
1385
|
},
|
|
1171
1386
|
"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection": {
|
|
1172
|
-
|
|
1387
|
+
backgroundColor: "rgba(220, 38, 38, 0.25)"
|
|
1173
1388
|
},
|
|
1174
1389
|
"pre.diff-highlight > code .token.token.inserted:not(.prefix)": {
|
|
1175
|
-
|
|
1390
|
+
backgroundColor: "rgba(22, 163, 74, 0.15)"
|
|
1176
1391
|
},
|
|
1177
1392
|
"pre > code.diff-highlight .token.token.inserted:not(.prefix)": {
|
|
1178
|
-
|
|
1393
|
+
backgroundColor: "rgba(22, 163, 74, 0.15)"
|
|
1179
1394
|
},
|
|
1180
1395
|
"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection": {
|
|
1181
|
-
|
|
1396
|
+
backgroundColor: "rgba(22, 163, 74, 0.25)"
|
|
1182
1397
|
},
|
|
1183
1398
|
"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection": {
|
|
1184
|
-
|
|
1399
|
+
backgroundColor: "rgba(22, 163, 74, 0.25)"
|
|
1185
1400
|
},
|
|
1186
1401
|
"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection": {
|
|
1187
|
-
|
|
1402
|
+
backgroundColor: "rgba(22, 163, 74, 0.25)"
|
|
1188
1403
|
},
|
|
1189
1404
|
"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection": {
|
|
1190
|
-
|
|
1405
|
+
backgroundColor: "rgba(22, 163, 74, 0.25)"
|
|
1191
1406
|
},
|
|
1192
1407
|
"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection": {
|
|
1193
|
-
|
|
1408
|
+
backgroundColor: "rgba(22, 163, 74, 0.25)"
|
|
1194
1409
|
},
|
|
1195
1410
|
"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection": {
|
|
1196
|
-
|
|
1411
|
+
backgroundColor: "rgba(22, 163, 74, 0.25)"
|
|
1197
1412
|
},
|
|
1198
1413
|
"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection": {
|
|
1199
|
-
|
|
1414
|
+
backgroundColor: "rgba(22, 163, 74, 0.25)"
|
|
1200
1415
|
},
|
|
1201
1416
|
"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection": {
|
|
1202
|
-
|
|
1417
|
+
backgroundColor: "rgba(22, 163, 74, 0.25)"
|
|
1203
1418
|
},
|
|
1204
1419
|
".prism-previewer.prism-previewer:before": {
|
|
1205
|
-
|
|
1420
|
+
borderColor: "#fff"
|
|
1206
1421
|
},
|
|
1207
1422
|
".prism-previewer-gradient.prism-previewer-gradient div": {
|
|
1208
|
-
|
|
1209
|
-
|
|
1423
|
+
borderColor: "#fff",
|
|
1424
|
+
borderRadius: "0.3em"
|
|
1210
1425
|
},
|
|
1211
1426
|
".prism-previewer-color.prism-previewer-color:before": {
|
|
1212
|
-
|
|
1427
|
+
borderRadius: "0.3em"
|
|
1213
1428
|
},
|
|
1214
1429
|
".prism-previewer-easing.prism-previewer-easing:before": {
|
|
1215
|
-
|
|
1430
|
+
borderRadius: "0.3em"
|
|
1216
1431
|
},
|
|
1217
1432
|
".prism-previewer.prism-previewer:after": {
|
|
1218
|
-
|
|
1433
|
+
borderTopColor: "#fff"
|
|
1219
1434
|
},
|
|
1220
1435
|
".prism-previewer-flipped.prism-previewer-flipped.after": {
|
|
1221
|
-
|
|
1436
|
+
borderBottomColor: "#fff"
|
|
1222
1437
|
},
|
|
1223
1438
|
".prism-previewer-angle.prism-previewer-angle:before": {
|
|
1224
|
-
|
|
1439
|
+
background: "#f1f5f9"
|
|
1225
1440
|
},
|
|
1226
1441
|
".prism-previewer-time.prism-previewer-time:before": {
|
|
1227
|
-
|
|
1442
|
+
background: "#f1f5f9"
|
|
1228
1443
|
},
|
|
1229
1444
|
".prism-previewer-easing.prism-previewer-easing": {
|
|
1230
|
-
|
|
1445
|
+
background: "#f1f5f9"
|
|
1231
1446
|
},
|
|
1232
1447
|
".prism-previewer-angle.prism-previewer-angle circle": {
|
|
1233
|
-
|
|
1234
|
-
|
|
1448
|
+
stroke: "#1e293b",
|
|
1449
|
+
strokeOpacity: "1"
|
|
1235
1450
|
},
|
|
1236
1451
|
".prism-previewer-time.prism-previewer-time circle": {
|
|
1237
|
-
|
|
1238
|
-
|
|
1452
|
+
stroke: "#1e293b",
|
|
1453
|
+
strokeOpacity: "1"
|
|
1239
1454
|
},
|
|
1240
1455
|
".prism-previewer-easing.prism-previewer-easing circle": {
|
|
1241
|
-
|
|
1242
|
-
|
|
1456
|
+
stroke: "#1e293b",
|
|
1457
|
+
fill: "transparent"
|
|
1243
1458
|
},
|
|
1244
1459
|
".prism-previewer-easing.prism-previewer-easing path": {
|
|
1245
|
-
|
|
1460
|
+
stroke: "#1e293b"
|
|
1246
1461
|
},
|
|
1247
1462
|
".prism-previewer-easing.prism-previewer-easing line": {
|
|
1248
|
-
|
|
1463
|
+
stroke: "#1e293b"
|
|
1249
1464
|
}
|
|
1250
1465
|
};
|
|
1251
1466
|
const CodeHighlighter = ({
|
|
1252
1467
|
className,
|
|
1253
1468
|
children,
|
|
1469
|
+
inlineClassName,
|
|
1254
1470
|
copyClassName,
|
|
1255
1471
|
copyIcon = /* @__PURE__ */ jsx(SvgCopy, {}),
|
|
1256
1472
|
language,
|
|
1257
1473
|
toolbarClassName,
|
|
1258
|
-
theme = dark
|
|
1474
|
+
theme = dark,
|
|
1475
|
+
...props
|
|
1259
1476
|
}) => {
|
|
1260
|
-
const match = language
|
|
1477
|
+
const match = language?.match(/language-(\w+)/);
|
|
1261
1478
|
const lang = match ? match[1] : "text";
|
|
1479
|
+
const isInline = !match;
|
|
1262
1480
|
const handleCopy = (text) => {
|
|
1263
1481
|
navigator.clipboard.writeText(text).then(() => {
|
|
1264
1482
|
console.log("Text copied to clipboard");
|
|
@@ -1266,6 +1484,9 @@ const CodeHighlighter = ({
|
|
|
1266
1484
|
console.error("Could not copy text: ", err);
|
|
1267
1485
|
});
|
|
1268
1486
|
};
|
|
1487
|
+
if (isInline) {
|
|
1488
|
+
return /* @__PURE__ */ jsx("code", { className: cn(inlineClassName), ...props, children });
|
|
1489
|
+
}
|
|
1269
1490
|
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
1270
1491
|
/* @__PURE__ */ jsxs("div", { className: cn(toolbarClassName), children: [
|
|
1271
1492
|
/* @__PURE__ */ jsx("div", { children: lang }),
|
|
@@ -1274,21 +1495,14 @@ const CodeHighlighter = ({
|
|
|
1274
1495
|
{
|
|
1275
1496
|
className: cn(copyClassName),
|
|
1276
1497
|
size: "small",
|
|
1277
|
-
variant: "
|
|
1498
|
+
variant: "ghost",
|
|
1278
1499
|
title: "Copy code",
|
|
1279
1500
|
onClick: () => handleCopy(children),
|
|
1280
1501
|
children: copyIcon
|
|
1281
1502
|
}
|
|
1282
1503
|
)
|
|
1283
1504
|
] }),
|
|
1284
|
-
/* @__PURE__ */ jsx(
|
|
1285
|
-
Prism,
|
|
1286
|
-
{
|
|
1287
|
-
language: lang,
|
|
1288
|
-
style: theme,
|
|
1289
|
-
children
|
|
1290
|
-
}
|
|
1291
|
-
)
|
|
1505
|
+
/* @__PURE__ */ jsx(Prism, { language: lang, style: theme, children })
|
|
1292
1506
|
] });
|
|
1293
1507
|
};
|
|
1294
1508
|
const TableComponent = ({ children, ...props }) => /* @__PURE__ */ jsx("table", { ...props, children });
|
|
@@ -1297,81 +1511,164 @@ const TableDataCell = ({ children, ...props }) => /* @__PURE__ */ jsx("td", { ..
|
|
|
1297
1511
|
const Markdown = ({
|
|
1298
1512
|
children,
|
|
1299
1513
|
remarkPlugins,
|
|
1300
|
-
rehypePlugins = [rehypeKatex]
|
|
1301
|
-
|
|
1514
|
+
rehypePlugins = [rehypeKatex],
|
|
1515
|
+
theme
|
|
1516
|
+
}) => /* @__PURE__ */ jsx(
|
|
1517
|
+
ReactMarkdown,
|
|
1518
|
+
{
|
|
1519
|
+
remarkPlugins,
|
|
1520
|
+
rehypePlugins,
|
|
1521
|
+
components: {
|
|
1522
|
+
code: ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
1523
|
+
CodeHighlighter,
|
|
1524
|
+
{
|
|
1525
|
+
...props,
|
|
1526
|
+
language: cn(className),
|
|
1527
|
+
inlineClassName: cn(theme.messages.message.markdown.inlineCode),
|
|
1528
|
+
className: cn(theme.messages.message.markdown.code, className),
|
|
1529
|
+
copyClassName: cn(theme.messages.message.markdown.copy),
|
|
1530
|
+
toolbarClassName: cn(theme.messages.message.markdown.toolbar)
|
|
1531
|
+
}
|
|
1532
|
+
),
|
|
1533
|
+
table: (props) => /* @__PURE__ */ jsx(
|
|
1534
|
+
TableComponent,
|
|
1535
|
+
{
|
|
1536
|
+
...props,
|
|
1537
|
+
className: cn(theme.messages.message.markdown.table)
|
|
1538
|
+
}
|
|
1539
|
+
),
|
|
1540
|
+
th: (props) => /* @__PURE__ */ jsx(
|
|
1541
|
+
TableHeaderCell,
|
|
1542
|
+
{
|
|
1543
|
+
...props,
|
|
1544
|
+
className: cn(theme.messages.message.markdown.th)
|
|
1545
|
+
}
|
|
1546
|
+
),
|
|
1547
|
+
td: (props) => /* @__PURE__ */ jsx(
|
|
1548
|
+
TableDataCell,
|
|
1549
|
+
{
|
|
1550
|
+
...props,
|
|
1551
|
+
className: cn(theme.messages.message.markdown.td)
|
|
1552
|
+
}
|
|
1553
|
+
),
|
|
1554
|
+
a: (props) => /* @__PURE__ */ jsx("a", { ...props, className: cn(theme.messages.message.markdown.a) }),
|
|
1555
|
+
hr: (props) => /* @__PURE__ */ jsx("hr", { ...props, className: cn(theme.messages.message.markdown.hr) }),
|
|
1556
|
+
p: (props) => /* @__PURE__ */ jsx("p", { ...props, className: cn(theme.messages.message.markdown.p) }),
|
|
1557
|
+
li: (props) => /* @__PURE__ */ jsx("li", { ...props, className: cn(theme.messages.message.markdown.li) }),
|
|
1558
|
+
ul: (props) => /* @__PURE__ */ jsx("ul", { ...props, className: cn(theme.messages.message.markdown.ul) }),
|
|
1559
|
+
ol: (props) => /* @__PURE__ */ jsx("ol", { ...props, className: cn(theme.messages.message.markdown.ol) }),
|
|
1560
|
+
h1: (props) => /* @__PURE__ */ jsx("h1", { ...props, className: cn(theme.messages.message.markdown.h1) }),
|
|
1561
|
+
h2: (props) => /* @__PURE__ */ jsx("h2", { ...props, className: cn(theme.messages.message.markdown.h2) }),
|
|
1562
|
+
h3: (props) => /* @__PURE__ */ jsx("h3", { ...props, className: cn(theme.messages.message.markdown.h3) }),
|
|
1563
|
+
h4: (props) => /* @__PURE__ */ jsx("h4", { ...props, className: cn(theme.messages.message.markdown.h4) }),
|
|
1564
|
+
h5: (props) => /* @__PURE__ */ jsx("h5", { ...props, className: cn(theme.messages.message.markdown.h5) }),
|
|
1565
|
+
h6: (props) => /* @__PURE__ */ jsx("h6", { ...props, className: cn(theme.messages.message.markdown.h6) })
|
|
1566
|
+
},
|
|
1567
|
+
children
|
|
1568
|
+
}
|
|
1569
|
+
);
|
|
1570
|
+
const CVE_REGEX = /(CVE-(19|20)\d{2}-\d{4,7})/gi;
|
|
1571
|
+
const remarkCve = () => {
|
|
1572
|
+
return (tree) => {
|
|
1573
|
+
findAndReplace(tree, [[CVE_REGEX, replaceCve]], {
|
|
1574
|
+
ignore: ["link", "linkReference"]
|
|
1575
|
+
});
|
|
1576
|
+
};
|
|
1577
|
+
};
|
|
1578
|
+
function replaceCve(value) {
|
|
1579
|
+
return {
|
|
1580
|
+
type: "link",
|
|
1581
|
+
url: `https://cve.mitre.org/cgi-bin/cvename.cgi?name=${value}`,
|
|
1582
|
+
children: [{ type: "text", value: value.trim() }]
|
|
1583
|
+
};
|
|
1584
|
+
}
|
|
1585
|
+
const SessionEmpty = ({ children }) => {
|
|
1302
1586
|
const { theme } = useContext(ChatContext);
|
|
1303
|
-
return /* @__PURE__ */ jsx(
|
|
1304
|
-
ReactMarkdown,
|
|
1305
|
-
{
|
|
1306
|
-
remarkPlugins,
|
|
1307
|
-
rehypePlugins,
|
|
1308
|
-
components: {
|
|
1309
|
-
code: ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
1310
|
-
CodeHighlighter,
|
|
1311
|
-
{
|
|
1312
|
-
...props,
|
|
1313
|
-
language: className,
|
|
1314
|
-
className: cn(theme.messages.message.markdown.code, className),
|
|
1315
|
-
copyClassName: cn(theme.messages.message.markdown.copy),
|
|
1316
|
-
toolbarClassName: cn(theme.messages.message.markdown.toolbar)
|
|
1317
|
-
}
|
|
1318
|
-
),
|
|
1319
|
-
table: (props) => /* @__PURE__ */ jsx(
|
|
1320
|
-
TableComponent,
|
|
1321
|
-
{
|
|
1322
|
-
...props,
|
|
1323
|
-
className: cn(theme.messages.message.markdown.table)
|
|
1324
|
-
}
|
|
1325
|
-
),
|
|
1326
|
-
th: (props) => /* @__PURE__ */ jsx(
|
|
1327
|
-
TableHeaderCell,
|
|
1328
|
-
{
|
|
1329
|
-
...props,
|
|
1330
|
-
className: cn(theme.messages.message.markdown.th)
|
|
1331
|
-
}
|
|
1332
|
-
),
|
|
1333
|
-
td: (props) => /* @__PURE__ */ jsx(
|
|
1334
|
-
TableDataCell,
|
|
1335
|
-
{
|
|
1336
|
-
...props,
|
|
1337
|
-
className: cn(theme.messages.message.markdown.td)
|
|
1338
|
-
}
|
|
1339
|
-
),
|
|
1340
|
-
a: (props) => /* @__PURE__ */ jsx("a", { ...props, className: cn(theme.messages.message.markdown.a) }),
|
|
1341
|
-
p: (props) => /* @__PURE__ */ jsx("p", { ...props, className: cn(theme.messages.message.markdown.p) }),
|
|
1342
|
-
li: (props) => /* @__PURE__ */ jsx("li", { ...props, className: cn(theme.messages.message.markdown.li) }),
|
|
1343
|
-
ul: (props) => /* @__PURE__ */ jsx("ul", { ...props, className: cn(theme.messages.message.markdown.ul) }),
|
|
1344
|
-
ol: (props) => /* @__PURE__ */ jsx("ol", { ...props, className: cn(theme.messages.message.markdown.ol) })
|
|
1345
|
-
},
|
|
1346
|
-
children
|
|
1347
|
-
}
|
|
1348
|
-
);
|
|
1587
|
+
return /* @__PURE__ */ jsx("div", { className: cn(theme.empty), children });
|
|
1349
1588
|
};
|
|
1350
|
-
const
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1589
|
+
const SvgRefresh = (props) => /* @__PURE__ */ React.createElement("svg", { width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M1.75 8.25098C2.16399 8.25098 2.49998 8.58699 2.5 9.00098C2.5 12.585 5.416 15.501 9 15.501C11.149 15.501 13.1291 14.4262 14.3301 12.6992L12.8701 12.9014C12.4591 12.9484 12.0814 12.6698 12.0244 12.2598C11.9685 11.8498 12.2541 11.4711 12.665 11.4141L15.6094 11.0068L15.6104 11.0078C16.0172 10.951 16.3981 11.2386 16.4551 11.6484L16.8633 14.5928C16.9203 15.0038 16.6327 15.3825 16.2227 15.4395C16.1878 15.4444 16.153 15.4463 16.1191 15.4463C15.7501 15.4463 15.429 15.1738 15.377 14.7988L15.2598 13.9551C13.7628 15.842 11.4739 17.001 9 17.001C4.589 17.001 1 13.412 1 9.00098C1.00002 8.58699 1.33601 8.25098 1.75 8.25098ZM9.00098 1C13.412 1 17.001 4.589 17.001 9C17.001 9.414 16.665 9.75 16.251 9.75C15.837 9.75 15.501 9.414 15.501 9C15.501 5.416 12.585 2.5 9.00098 2.5C6.84502 2.5 4.87188 3.57384 3.67188 5.30078L5.12988 5.09863C5.53788 5.04563 5.91859 5.32923 5.97559 5.74023C6.03148 6.15017 5.7459 6.52895 5.33496 6.58594L2.39062 6.99316C2.35579 6.99812 2.32095 6.99999 2.28711 7C1.91811 7 1.59692 6.72754 1.54492 6.35254L1.13672 3.4082C1.07972 2.9972 1.36734 2.61852 1.77734 2.56152C2.18818 2.50179 2.56607 2.79129 2.62305 3.20215L2.73926 4.04199C4.23526 2.15508 6.52006 1 9 1H9.00098Z", fill: "currentColor" }));
|
|
1590
|
+
const SvgThumbsDown = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M11.25 1.25H4.5C3.8775 1.25 3.345 1.625 3.12 2.165L0.855 7.4525C0.7875 7.625 0.75 7.805 0.75 8V9.5C0.75 10.325 1.425 11 2.25 11H6.9825L6.27 14.4275L6.2475 14.6675C6.2475 14.975 6.375 15.26 6.5775 15.4625L7.3725 16.25L12.315 11.3075C12.585 11.0375 12.75 10.6625 12.75 10.25V2.75C12.75 1.925 12.075 1.25 11.25 1.25ZM11.25 10.25L7.995 13.505L9 9.5H2.25V8L4.5 2.75H11.25V10.25ZM14.25 1.25H17.25V10.25H14.25V1.25Z", fill: "currentColor" }));
|
|
1591
|
+
const SvgThumbsUp = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M6.75 15.75H13.5C14.1225 15.75 14.655 15.375 14.88 14.835L17.145 9.5475C17.2125 9.375 17.25 9.195 17.25 9V7.5C17.25 6.675 16.575 6 15.75 6H11.0175L11.73 2.5725L11.7525 2.3325C11.7525 2.025 11.625 1.74 11.4225 1.5375L10.6275 0.75L5.685 5.6925C5.415 5.9625 5.25 6.3375 5.25 6.75V14.25C5.25 15.075 5.925 15.75 6.75 15.75ZM6.75 6.75L10.005 3.495L9 7.5H15.75V9L13.5 14.25H6.75V6.75ZM0.75 6.75H3.75V15.75H0.75V6.75Z", fill: "currentColor" }));
|
|
1592
|
+
const MessageActions = ({
|
|
1593
|
+
children,
|
|
1594
|
+
...props
|
|
1595
|
+
}) => {
|
|
1596
|
+
const { theme } = useContext(ChatContext);
|
|
1597
|
+
const {
|
|
1598
|
+
question,
|
|
1599
|
+
response,
|
|
1600
|
+
copyIcon = /* @__PURE__ */ jsx(SvgCopy, {}),
|
|
1601
|
+
thumbsUpIcon = /* @__PURE__ */ jsx(SvgThumbsUp, {}),
|
|
1602
|
+
thumbsDownIcon = /* @__PURE__ */ jsx(SvgThumbsDown, {}),
|
|
1603
|
+
refreshIcon = /* @__PURE__ */ jsx(SvgRefresh, {}),
|
|
1604
|
+
onCopy,
|
|
1605
|
+
onUpvote,
|
|
1606
|
+
onDownvote,
|
|
1607
|
+
onRefresh
|
|
1608
|
+
} = props;
|
|
1609
|
+
const Comp = children ? Slot : "div";
|
|
1610
|
+
const handleCopy = (text) => {
|
|
1611
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
1612
|
+
console.log("Text copied to clipboard");
|
|
1613
|
+
}).catch((err) => {
|
|
1614
|
+
console.error("Could not copy text: ", err);
|
|
1615
|
+
});
|
|
1357
1616
|
};
|
|
1358
|
-
|
|
1359
|
-
|
|
1617
|
+
return (copyIcon || thumbsDownIcon || thumbsUpIcon || refreshIcon) && /* @__PURE__ */ jsx(Comp, { className: cn(theme.messages.message.footer.base), children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1618
|
+
copyIcon && /* @__PURE__ */ jsx(
|
|
1619
|
+
IconButton,
|
|
1360
1620
|
{
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1621
|
+
variant: "ghost",
|
|
1622
|
+
disablePadding: true,
|
|
1623
|
+
title: "Copy question and response",
|
|
1624
|
+
className: cn(theme.messages.message.footer.copy),
|
|
1625
|
+
onClick: onCopy ? onCopy : () => handleCopy(`${question}
|
|
1626
|
+
${response}`),
|
|
1627
|
+
children: copyIcon
|
|
1366
1628
|
}
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1629
|
+
),
|
|
1630
|
+
thumbsUpIcon && /* @__PURE__ */ jsx(
|
|
1631
|
+
IconButton,
|
|
1632
|
+
{
|
|
1633
|
+
variant: "ghost",
|
|
1634
|
+
disablePadding: true,
|
|
1635
|
+
title: "Upvote",
|
|
1636
|
+
className: cn(theme.messages.message.footer.upvote),
|
|
1637
|
+
onClick: onUpvote,
|
|
1638
|
+
children: thumbsUpIcon
|
|
1639
|
+
}
|
|
1640
|
+
),
|
|
1641
|
+
thumbsDownIcon && /* @__PURE__ */ jsx(
|
|
1642
|
+
IconButton,
|
|
1643
|
+
{
|
|
1644
|
+
variant: "ghost",
|
|
1645
|
+
disablePadding: true,
|
|
1646
|
+
title: "Downvote",
|
|
1647
|
+
className: cn(theme.messages.message.footer.downvote),
|
|
1648
|
+
onClick: onDownvote,
|
|
1649
|
+
children: thumbsDownIcon
|
|
1650
|
+
}
|
|
1651
|
+
),
|
|
1652
|
+
refreshIcon && /* @__PURE__ */ jsx(
|
|
1653
|
+
IconButton,
|
|
1654
|
+
{
|
|
1655
|
+
variant: "ghost",
|
|
1656
|
+
disablePadding: true,
|
|
1657
|
+
title: "Refresh",
|
|
1658
|
+
className: cn(theme.messages.message.footer.refresh),
|
|
1659
|
+
onClick: onRefresh,
|
|
1660
|
+
children: refreshIcon
|
|
1661
|
+
}
|
|
1662
|
+
)
|
|
1663
|
+
] }) });
|
|
1664
|
+
};
|
|
1370
1665
|
const SvgFile = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, viewBox: "0 0 16 16", fill: "currentColor", ...props }, /* @__PURE__ */ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2.7036 1.37034C3.04741 1.02653 3.51373 0.833374 3.99996 0.833374H9.33329H9.33331C9.47275 0.833374 9.59885 0.890449 9.68954 0.98251L13.6843 4.97722C13.7763 5.0679 13.8333 5.19398 13.8333 5.33337L13.8333 5.3379V13.3334C13.8333 13.8196 13.6401 14.2859 13.2963 14.6297C12.9525 14.9736 12.4862 15.1667 12 15.1667H3.99996C3.51373 15.1667 3.04741 14.9736 2.7036 14.6297C2.35978 14.2859 2.16663 13.8196 2.16663 13.3334V2.66671C2.16663 2.18048 2.35978 1.71416 2.7036 1.37034ZM3.99996 1.83337H8.83331V5.33337C8.83331 5.60952 9.05717 5.83337 9.33331 5.83337H12.8333V13.3334C12.8333 13.5544 12.7455 13.7663 12.5892 13.9226C12.4329 14.0789 12.221 14.1667 12 14.1667H3.99996C3.77895 14.1667 3.56698 14.0789 3.4107 13.9226C3.25442 13.7663 3.16663 13.5544 3.16663 13.3334V2.66671C3.16663 2.44569 3.25442 2.23373 3.4107 2.07745C3.56698 1.92117 3.77895 1.83337 3.99996 1.83337ZM9.83331 2.5405L12.1262 4.83337H9.83331V2.5405ZM5.33331 8.16663C5.05717 8.16663 4.83331 8.39048 4.83331 8.66663C4.83331 8.94277 5.05717 9.16663 5.33331 9.16663H10.6666C10.9428 9.16663 11.1666 8.94277 11.1666 8.66663C11.1666 8.39048 10.9428 8.16663 10.6666 8.16663H5.33331ZM4.83331 11.3334C4.83331 11.0572 5.05717 10.8334 5.33331 10.8334H10.6666C10.9428 10.8334 11.1666 11.0572 11.1666 11.3334C11.1666 11.6095 10.9428 11.8334 10.6666 11.8334H5.33331C5.05717 11.8334 4.83331 11.6095 4.83331 11.3334ZM5.33331 5.5C5.05717 5.5 4.83331 5.72386 4.83331 6C4.83331 6.27614 5.05717 6.5 5.33331 6.5H6.66665C6.94279 6.5 7.16665 6.27614 7.16665 6C7.16665 5.72386 6.94279 5.5 6.66665 5.5H5.33331Z" }));
|
|
1371
|
-
const DefaultFileRenderer = lazy(
|
|
1372
|
-
|
|
1666
|
+
const DefaultFileRenderer = lazy(
|
|
1667
|
+
() => import("./DefaultFileRenderer-CszY8p_0.js")
|
|
1668
|
+
);
|
|
1669
|
+
const CSVFileRenderer = lazy(() => import("./CSVFileRenderer-B7eSDub6.js"));
|
|
1373
1670
|
const ImageFileRenderer = lazy(() => import("./ImageFileRenderer-C8tVW3I8.js"));
|
|
1374
|
-
const PDFFileRenderer = lazy(() => import("./PDFFileRenderer-
|
|
1671
|
+
const PDFFileRenderer = lazy(() => import("./PDFFileRenderer-BBn2EVrV.js"));
|
|
1375
1672
|
const FILE_TYPE_RENDERER_MAP = {
|
|
1376
1673
|
"image/": ImageFileRenderer,
|
|
1377
1674
|
"text/csv": CSVFileRenderer,
|
|
@@ -1386,16 +1683,10 @@ const MessageFile = ({
|
|
|
1386
1683
|
}) => {
|
|
1387
1684
|
const { theme } = useContext(ChatContext);
|
|
1388
1685
|
const FileRenderer = useMemo(() => {
|
|
1389
|
-
const Renderer = Object.keys(FILE_TYPE_RENDERER_MAP).find((key) => type
|
|
1686
|
+
const Renderer = Object.keys(FILE_TYPE_RENDERER_MAP).find((key) => type?.startsWith(key)) ?? "default";
|
|
1390
1687
|
return FILE_TYPE_RENDERER_MAP[Renderer] || DefaultFileRenderer;
|
|
1391
1688
|
}, [type]);
|
|
1392
|
-
return /* @__PURE__ */ jsx(
|
|
1393
|
-
"div",
|
|
1394
|
-
{
|
|
1395
|
-
className: cn(theme.messages.message.files.file.base),
|
|
1396
|
-
children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsx(FileRenderer, { name, url, fileIcon, limit }) })
|
|
1397
|
-
}
|
|
1398
|
-
);
|
|
1689
|
+
return /* @__PURE__ */ jsx("div", { className: cn(theme.messages.message.files.file.base), children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsx(FileRenderer, { name, url, fileIcon, limit }) }) });
|
|
1399
1690
|
};
|
|
1400
1691
|
const MessageFiles = ({ files, children }) => {
|
|
1401
1692
|
const { theme } = useContext(ChatContext);
|
|
@@ -1406,7 +1697,7 @@ const MessageFiles = ({ files, children }) => {
|
|
|
1406
1697
|
}
|
|
1407
1698
|
const { imageFiles, otherFiles } = files.reduce(
|
|
1408
1699
|
(acc, file) => {
|
|
1409
|
-
if (file.type
|
|
1700
|
+
if (file.type?.startsWith("image/")) {
|
|
1410
1701
|
acc.imageFiles.push(file);
|
|
1411
1702
|
} else {
|
|
1412
1703
|
acc.otherFiles.push(file);
|
|
@@ -1466,30 +1757,60 @@ const MessageFiles = ({ files, children }) => {
|
|
|
1466
1757
|
};
|
|
1467
1758
|
const MessageQuestion = ({
|
|
1468
1759
|
children,
|
|
1760
|
+
previewLineClamp = 3,
|
|
1469
1761
|
...props
|
|
1470
1762
|
}) => {
|
|
1471
1763
|
const { theme, remarkPlugins } = useContext(ChatContext);
|
|
1472
1764
|
const { question, files } = props;
|
|
1473
1765
|
const Comp = children ? Slot : "div";
|
|
1474
|
-
const [
|
|
1475
|
-
const
|
|
1766
|
+
const [truncated, setTruncated] = useState(false);
|
|
1767
|
+
const [showAll, setShowAll] = useState(false);
|
|
1768
|
+
const ref = useRef(null);
|
|
1769
|
+
const calculateTruncation = useCallback(() => {
|
|
1770
|
+
const el = ref.current;
|
|
1771
|
+
setTruncated(el.scrollHeight > el.clientHeight);
|
|
1772
|
+
}, []);
|
|
1773
|
+
useEffect(() => {
|
|
1774
|
+
const el = ref.current;
|
|
1775
|
+
if (!el || previewLineClamp === false) return;
|
|
1776
|
+
calculateTruncation();
|
|
1777
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
1778
|
+
calculateTruncation();
|
|
1779
|
+
});
|
|
1780
|
+
resizeObserver.observe(el);
|
|
1781
|
+
window.addEventListener("resize", calculateTruncation);
|
|
1782
|
+
return () => {
|
|
1783
|
+
resizeObserver.disconnect();
|
|
1784
|
+
window.removeEventListener("resize", calculateTruncation);
|
|
1785
|
+
};
|
|
1786
|
+
}, [calculateTruncation, previewLineClamp]);
|
|
1476
1787
|
return /* @__PURE__ */ jsx(
|
|
1477
1788
|
Comp,
|
|
1478
1789
|
{
|
|
1479
1790
|
className: cn(theme.messages.message.question, {
|
|
1480
|
-
[theme.messages.message.overlay]:
|
|
1791
|
+
[theme.messages.message.overlay]: truncated
|
|
1481
1792
|
}),
|
|
1482
1793
|
...props,
|
|
1483
1794
|
children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1484
1795
|
/* @__PURE__ */ jsx(MessageFiles, { files }),
|
|
1485
|
-
/* @__PURE__ */ jsx(
|
|
1486
|
-
|
|
1796
|
+
/* @__PURE__ */ jsx(
|
|
1797
|
+
"div",
|
|
1798
|
+
{
|
|
1799
|
+
ref,
|
|
1800
|
+
className: cn({
|
|
1801
|
+
[`line-clamp-${previewLineClamp}`]: !showAll && typeof previewLineClamp === "number",
|
|
1802
|
+
"line-clamp-none": showAll || previewLineClamp === false
|
|
1803
|
+
}),
|
|
1804
|
+
children: /* @__PURE__ */ jsx(Markdown, { remarkPlugins, theme, children: question })
|
|
1805
|
+
}
|
|
1806
|
+
),
|
|
1807
|
+
truncated && !showAll && /* @__PURE__ */ jsx(
|
|
1487
1808
|
Button,
|
|
1488
1809
|
{
|
|
1489
1810
|
variant: "link",
|
|
1490
1811
|
size: "small",
|
|
1491
1812
|
className: theme.messages.message.expand,
|
|
1492
|
-
onClick: () =>
|
|
1813
|
+
onClick: () => setShowAll(true),
|
|
1493
1814
|
children: "Show more"
|
|
1494
1815
|
}
|
|
1495
1816
|
)
|
|
@@ -1510,7 +1831,7 @@ const MessageResponse = ({
|
|
|
1510
1831
|
"data-compact": isCompact,
|
|
1511
1832
|
className: cn(theme.messages.message.response),
|
|
1512
1833
|
children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1513
|
-
/* @__PURE__ */ jsx(Markdown, { remarkPlugins, children: response }),
|
|
1834
|
+
/* @__PURE__ */ jsx(Markdown, { remarkPlugins, theme, children: response }),
|
|
1514
1835
|
isLoading && /* @__PURE__ */ jsx(
|
|
1515
1836
|
motion.div,
|
|
1516
1837
|
{
|
|
@@ -1527,7 +1848,12 @@ const MessageResponse = ({
|
|
|
1527
1848
|
}
|
|
1528
1849
|
);
|
|
1529
1850
|
};
|
|
1530
|
-
const MessageSource = ({
|
|
1851
|
+
const MessageSource = ({
|
|
1852
|
+
title,
|
|
1853
|
+
url,
|
|
1854
|
+
image,
|
|
1855
|
+
limit = 50
|
|
1856
|
+
}) => {
|
|
1531
1857
|
const { theme, isCompact } = useContext(ChatContext);
|
|
1532
1858
|
return /* @__PURE__ */ jsxs(
|
|
1533
1859
|
"figure",
|
|
@@ -1541,10 +1867,26 @@ const MessageSource = ({ title, url, image, limit = 50 }) => {
|
|
|
1541
1867
|
}
|
|
1542
1868
|
},
|
|
1543
1869
|
children: [
|
|
1544
|
-
image && /* @__PURE__ */ jsx(
|
|
1870
|
+
image && /* @__PURE__ */ jsx(
|
|
1871
|
+
"img",
|
|
1872
|
+
{
|
|
1873
|
+
src: image,
|
|
1874
|
+
alt: title,
|
|
1875
|
+
className: cn(theme.messages.message.sources.source.image)
|
|
1876
|
+
}
|
|
1877
|
+
),
|
|
1545
1878
|
(title || url) && /* @__PURE__ */ jsxs("figcaption", { children: [
|
|
1546
1879
|
title && /* @__PURE__ */ jsx("span", { className: cn(theme.messages.message.sources.source.title), children: /* @__PURE__ */ jsx(Ellipsis, { value: title, limit }) }),
|
|
1547
|
-
url && /* @__PURE__ */ jsx(
|
|
1880
|
+
url && /* @__PURE__ */ jsx(
|
|
1881
|
+
"a",
|
|
1882
|
+
{
|
|
1883
|
+
href: url,
|
|
1884
|
+
target: "_blank",
|
|
1885
|
+
rel: "noopener noreferrer",
|
|
1886
|
+
className: cn(theme.messages.message.sources.source.url),
|
|
1887
|
+
children: url
|
|
1888
|
+
}
|
|
1889
|
+
)
|
|
1548
1890
|
] })
|
|
1549
1891
|
]
|
|
1550
1892
|
}
|
|
@@ -1561,493 +1903,65 @@ const MessageSources = ({
|
|
|
1561
1903
|
}
|
|
1562
1904
|
return sources && sources.length > 0 && /* @__PURE__ */ jsx("div", { className: cn(theme.messages.message.sources.base), children: sources.map((source, index) => /* @__PURE__ */ jsx(Comp, { ...source, children }, index)) });
|
|
1563
1905
|
};
|
|
1564
|
-
const
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1906
|
+
const messageVariants = {
|
|
1907
|
+
hidden: {
|
|
1908
|
+
opacity: 0,
|
|
1909
|
+
y: 20
|
|
1910
|
+
},
|
|
1911
|
+
visible: {
|
|
1912
|
+
opacity: 1,
|
|
1913
|
+
y: 0,
|
|
1914
|
+
transition: {
|
|
1915
|
+
duration: 0.3
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
};
|
|
1919
|
+
const SessionMessage = ({
|
|
1920
|
+
className,
|
|
1921
|
+
conversation,
|
|
1922
|
+
isLast,
|
|
1923
|
+
children
|
|
1924
|
+
}) => {
|
|
1925
|
+
const { theme, isLoading } = useContext(ChatContext);
|
|
1926
|
+
return /* @__PURE__ */ jsxs(motion.div, { variants: messageVariants, children: [
|
|
1927
|
+
/* @__PURE__ */ jsx(Card, { className: cn(theme.messages.message.base, className), children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1928
|
+
/* @__PURE__ */ jsx(
|
|
1929
|
+
MessageQuestion,
|
|
1930
|
+
{
|
|
1931
|
+
question: conversation.question,
|
|
1932
|
+
files: conversation.files
|
|
1933
|
+
}
|
|
1934
|
+
),
|
|
1935
|
+
/* @__PURE__ */ jsx(
|
|
1936
|
+
MessageResponse,
|
|
1937
|
+
{
|
|
1938
|
+
response: conversation.response,
|
|
1939
|
+
isLoading: isLast && isLoading
|
|
1940
|
+
}
|
|
1941
|
+
),
|
|
1942
|
+
/* @__PURE__ */ jsx(MessageSources, { sources: conversation.sources }),
|
|
1943
|
+
/* @__PURE__ */ jsx(
|
|
1944
|
+
MessageActions,
|
|
1945
|
+
{
|
|
1946
|
+
question: conversation.question,
|
|
1947
|
+
response: conversation.response
|
|
1948
|
+
}
|
|
1949
|
+
)
|
|
1950
|
+
] }) }),
|
|
1951
|
+
!isLast && /* @__PURE__ */ jsx(Divider, {})
|
|
1952
|
+
] }, conversation.id);
|
|
1953
|
+
};
|
|
1954
|
+
const SvgBack = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 50 50", width: "24px", height: "24px", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M 34.980469 3.992188 C 34.71875 3.996094 34.472656 4.105469 34.292969 4.292969 L 14.292969 24.292969 C 13.902344 24.683594 13.902344 25.316406 14.292969 25.707031 L 34.292969 45.707031 C 34.542969 45.96875 34.917969 46.074219 35.265625 45.980469 C 35.617188 45.890625 35.890625 45.617188 35.980469 45.265625 C 36.074219 44.917969 35.96875 44.542969 35.707031 44.292969 L 16.414063 25 L 35.707031 5.707031 C 36.003906 5.417969 36.089844 4.980469 35.929688 4.601563 C 35.769531 4.21875 35.394531 3.976563 34.980469 3.992188 Z", fill: "currentColor" }));
|
|
1955
|
+
const SessionMessagePanel = ({
|
|
1568
1956
|
children,
|
|
1569
|
-
|
|
1957
|
+
allowBack = true
|
|
1570
1958
|
}) => {
|
|
1571
|
-
const { theme } = useContext(ChatContext);
|
|
1572
|
-
const
|
|
1573
|
-
|
|
1574
|
-
response,
|
|
1575
|
-
copyIcon = /* @__PURE__ */ jsx(SvgCopy, {}),
|
|
1576
|
-
thumbsUpIcon = /* @__PURE__ */ jsx(SvgThumbsUp, {}),
|
|
1577
|
-
thumbsDownIcon = /* @__PURE__ */ jsx(SvgThumbsDown, {}),
|
|
1578
|
-
refreshIcon = /* @__PURE__ */ jsx(SvgRefresh, {}),
|
|
1579
|
-
onCopy,
|
|
1580
|
-
onUpvote,
|
|
1581
|
-
onDownvote,
|
|
1582
|
-
onRefresh
|
|
1583
|
-
} = props;
|
|
1584
|
-
const Comp = children ? Slot : "div";
|
|
1585
|
-
const handleCopy = (text) => {
|
|
1586
|
-
navigator.clipboard.writeText(text).then(() => {
|
|
1587
|
-
console.log("Text copied to clipboard");
|
|
1588
|
-
}).catch((err) => {
|
|
1589
|
-
console.error("Could not copy text: ", err);
|
|
1590
|
-
});
|
|
1591
|
-
};
|
|
1592
|
-
return (copyIcon || thumbsDownIcon || thumbsUpIcon || refreshIcon) && /* @__PURE__ */ jsx(Comp, { className: cn(theme.messages.message.footer.base), children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1593
|
-
copyIcon && /* @__PURE__ */ jsx(
|
|
1594
|
-
IconButton,
|
|
1595
|
-
{
|
|
1596
|
-
variant: "text",
|
|
1597
|
-
disablePadding: true,
|
|
1598
|
-
title: "Copy question and response",
|
|
1599
|
-
className: cn(theme.messages.message.footer.copy),
|
|
1600
|
-
onClick: onCopy ? onCopy : () => handleCopy(`${question}
|
|
1601
|
-
${response}`),
|
|
1602
|
-
children: copyIcon
|
|
1603
|
-
}
|
|
1604
|
-
),
|
|
1605
|
-
thumbsUpIcon && /* @__PURE__ */ jsx(
|
|
1606
|
-
IconButton,
|
|
1607
|
-
{
|
|
1608
|
-
variant: "text",
|
|
1609
|
-
disablePadding: true,
|
|
1610
|
-
title: "Upvote",
|
|
1611
|
-
className: cn(theme.messages.message.footer.upvote),
|
|
1612
|
-
onClick: onUpvote,
|
|
1613
|
-
children: thumbsUpIcon
|
|
1614
|
-
}
|
|
1615
|
-
),
|
|
1616
|
-
thumbsDownIcon && /* @__PURE__ */ jsx(
|
|
1617
|
-
IconButton,
|
|
1618
|
-
{
|
|
1619
|
-
variant: "text",
|
|
1620
|
-
disablePadding: true,
|
|
1621
|
-
title: "Downvote",
|
|
1622
|
-
className: cn(theme.messages.message.footer.downvote),
|
|
1623
|
-
onClick: onDownvote,
|
|
1624
|
-
children: thumbsDownIcon
|
|
1625
|
-
}
|
|
1626
|
-
),
|
|
1627
|
-
refreshIcon && /* @__PURE__ */ jsx(
|
|
1628
|
-
IconButton,
|
|
1629
|
-
{
|
|
1630
|
-
variant: "text",
|
|
1631
|
-
disablePadding: true,
|
|
1632
|
-
title: "Refresh",
|
|
1633
|
-
className: cn(theme.messages.message.footer.refresh),
|
|
1634
|
-
onClick: onRefresh,
|
|
1635
|
-
children: refreshIcon
|
|
1636
|
-
}
|
|
1637
|
-
)
|
|
1638
|
-
] }) });
|
|
1639
|
-
};
|
|
1640
|
-
const messageVariants = {
|
|
1641
|
-
hidden: {
|
|
1642
|
-
opacity: 0,
|
|
1643
|
-
y: 20
|
|
1644
|
-
},
|
|
1645
|
-
visible: {
|
|
1646
|
-
opacity: 1,
|
|
1647
|
-
y: 0,
|
|
1648
|
-
transition: {
|
|
1649
|
-
duration: 0.3
|
|
1650
|
-
}
|
|
1651
|
-
}
|
|
1652
|
-
};
|
|
1653
|
-
const SessionMessage = ({
|
|
1654
|
-
conversation,
|
|
1655
|
-
isLast,
|
|
1656
|
-
children
|
|
1657
|
-
}) => {
|
|
1658
|
-
const { theme, isLoading } = useContext(ChatContext);
|
|
1659
|
-
return /* @__PURE__ */ jsxs(motion.div, { variants: messageVariants, children: [
|
|
1660
|
-
/* @__PURE__ */ jsx(Card, { className: cn(theme.messages.message.base), children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1661
|
-
/* @__PURE__ */ jsx(MessageQuestion, { question: conversation.question, files: conversation.files }),
|
|
1662
|
-
/* @__PURE__ */ jsx(
|
|
1663
|
-
MessageResponse,
|
|
1664
|
-
{
|
|
1665
|
-
response: conversation.response,
|
|
1666
|
-
isLoading: isLast && isLoading
|
|
1667
|
-
}
|
|
1668
|
-
),
|
|
1669
|
-
/* @__PURE__ */ jsx(MessageSources, { sources: conversation.sources }),
|
|
1670
|
-
/* @__PURE__ */ jsx(
|
|
1671
|
-
MessageActions,
|
|
1672
|
-
{
|
|
1673
|
-
question: conversation.question,
|
|
1674
|
-
response: conversation.response
|
|
1675
|
-
}
|
|
1676
|
-
)
|
|
1677
|
-
] }) }),
|
|
1678
|
-
!isLast && /* @__PURE__ */ jsx(Divider, {})
|
|
1679
|
-
] }, conversation.id);
|
|
1680
|
-
};
|
|
1681
|
-
const containerVariants = {
|
|
1682
|
-
hidden: {},
|
|
1683
|
-
visible: {
|
|
1684
|
-
transition: {
|
|
1685
|
-
staggerChildren: 0.07,
|
|
1686
|
-
when: "beforeChildren"
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
};
|
|
1690
|
-
const SessionMessages = ({
|
|
1691
|
-
children,
|
|
1692
|
-
newSessionContent,
|
|
1693
|
-
limit = 10,
|
|
1694
|
-
showMoreText = "Show more"
|
|
1695
|
-
}) => {
|
|
1696
|
-
const { activeSession, theme } = useContext(ChatContext);
|
|
1697
|
-
const contentRef = useRef(null);
|
|
1698
|
-
const [isAnimating, setIsAnimating] = useState(true);
|
|
1699
|
-
useEffect(() => {
|
|
1700
|
-
if (contentRef.current) {
|
|
1701
|
-
requestAnimationFrame(
|
|
1702
|
-
() => contentRef.current.scrollTop = contentRef.current.scrollHeight
|
|
1703
|
-
);
|
|
1704
|
-
}
|
|
1705
|
-
}, [activeSession, isAnimating]);
|
|
1706
|
-
function handleShowMore() {
|
|
1707
|
-
showNext(limit);
|
|
1708
|
-
requestAnimationFrame(() => contentRef.current.scrollTop = 0);
|
|
1709
|
-
}
|
|
1710
|
-
const reversedConvos = useMemo(
|
|
1711
|
-
() => [...(activeSession == null ? void 0 : activeSession.conversations) ?? []].reverse(),
|
|
1712
|
-
[activeSession]
|
|
1713
|
-
);
|
|
1714
|
-
const { data, hasMore, showNext } = useInfinityList({
|
|
1715
|
-
items: reversedConvos,
|
|
1716
|
-
size: limit
|
|
1717
|
-
});
|
|
1718
|
-
const reReversedConvo = useMemo(() => [...data].reverse(), [data]);
|
|
1719
|
-
const convosToRender = limit ? reReversedConvo : activeSession == null ? void 0 : activeSession.conversations;
|
|
1720
|
-
if (!activeSession) {
|
|
1721
|
-
return /* @__PURE__ */ jsx(SessionEmpty, { children: newSessionContent });
|
|
1722
|
-
}
|
|
1723
|
-
return /* @__PURE__ */ jsxs("div", { className: cn(theme.messages.content), ref: contentRef, children: [
|
|
1724
|
-
hasMore && /* @__PURE__ */ jsx(
|
|
1725
|
-
Button,
|
|
1726
|
-
{
|
|
1727
|
-
variant: "outline",
|
|
1728
|
-
className: cn(theme.messages.showMore),
|
|
1729
|
-
fullWidth: true,
|
|
1730
|
-
onClick: handleShowMore,
|
|
1731
|
-
children: showMoreText
|
|
1732
|
-
}
|
|
1733
|
-
),
|
|
1734
|
-
/* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsx(
|
|
1735
|
-
motion.div,
|
|
1736
|
-
{
|
|
1737
|
-
variants: containerVariants,
|
|
1738
|
-
initial: "hidden",
|
|
1739
|
-
animate: "visible",
|
|
1740
|
-
onAnimationComplete: () => {
|
|
1741
|
-
requestAnimationFrame(() => setIsAnimating(false));
|
|
1742
|
-
},
|
|
1743
|
-
children: children ? children(convosToRender) : convosToRender.map((conversation, index) => /* @__PURE__ */ jsx(
|
|
1744
|
-
SessionMessage,
|
|
1745
|
-
{
|
|
1746
|
-
conversation,
|
|
1747
|
-
isLast: index === conversation.length - 1
|
|
1748
|
-
},
|
|
1749
|
-
conversation.id
|
|
1750
|
-
))
|
|
1751
|
-
},
|
|
1752
|
-
activeSession == null ? void 0 : activeSession.id
|
|
1753
|
-
) })
|
|
1754
|
-
] });
|
|
1755
|
-
};
|
|
1756
|
-
const chatTheme = {
|
|
1757
|
-
base: "dark:text-white text-gray-500",
|
|
1758
|
-
console: "flex w-full gap-4 h-full",
|
|
1759
|
-
companion: "w-full h-full overflow-hidden",
|
|
1760
|
-
empty: "text-center flex-1",
|
|
1761
|
-
appbar: "flex p-5",
|
|
1762
|
-
sessions: {
|
|
1763
|
-
base: "overflow-auto",
|
|
1764
|
-
console: "min-w-[150px] w-[30%] max-w-[300px] dark:bg-[#11111F] bg-[#F2F3F7] p-5 rounded-3xl",
|
|
1765
|
-
companion: "w-full h-full",
|
|
1766
|
-
group: "text-xs dart:text-gray-400 text-gray-700 mt-4 hover:bg-transparent mb-1",
|
|
1767
|
-
create: "relative mb-4 rounded-[10px] text-white",
|
|
1768
|
-
session: {
|
|
1769
|
-
base: [
|
|
1770
|
-
"group my-1 rounded-[10px] p-2 text-gray-500 border border-transparent hover:bg-gray-300 hover:border-gray-400 [&_svg]:text-gray-500",
|
|
1771
|
-
"dark:text-typography dark:text-gray-400 dark:hover:bg-gray-800/50 dark:hover:border-gray-700/50 dark:[&_svg]:text-gray-200"
|
|
1772
|
-
].join(" "),
|
|
1773
|
-
active: [
|
|
1774
|
-
"border border-gray-300 hover:border-gray-400 text-gray-700 bg-gray-200 hover:bg-gray-300 ",
|
|
1775
|
-
"dark:text-gray-500 dark:bg-gray-800/70 dark:border-gray-700/50 dark:text-white dark:border-gray-700/70 dark:hover:bg-gray-800/50",
|
|
1776
|
-
"[&_button]:opacity-100!"
|
|
1777
|
-
].join(" "),
|
|
1778
|
-
delete: "[&>svg]:w-4 [&>svg]:h-4 opacity-0 group-hover:opacity-50!"
|
|
1779
|
-
}
|
|
1780
|
-
},
|
|
1781
|
-
messages: {
|
|
1782
|
-
base: "",
|
|
1783
|
-
console: "flex flex-col mx-5 flex-1 overflow-hidden",
|
|
1784
|
-
companion: "flex w-full h-full",
|
|
1785
|
-
back: "self-start p-0 my-2",
|
|
1786
|
-
inner: "flex-1 h-full flex flex-col",
|
|
1787
|
-
title: ["text-base font-bold text-gray-500", "dark:text-gray-200"].join(
|
|
1788
|
-
" "
|
|
1789
|
-
),
|
|
1790
|
-
date: "text-xs whitespace-nowrap text-gray-400",
|
|
1791
|
-
content: [
|
|
1792
|
-
"mt-2 flex-1 overflow-auto [&_hr]:bg-gray-200",
|
|
1793
|
-
"dark:[&_hr]:bg-gray-800/60"
|
|
1794
|
-
].join(" "),
|
|
1795
|
-
header: "flex justify-between items-center gap-2",
|
|
1796
|
-
showMore: "mb-4",
|
|
1797
|
-
message: {
|
|
1798
|
-
base: "mt-4 mb-4 flex flex-col p-0 rounded-sm border-none bg-transparent",
|
|
1799
|
-
question: [
|
|
1800
|
-
"relative font-semibold mb-4 px-4 py-4 pb-2 rounded-3xl rounded-br-none text-typography border bg-gray-200 border-gray-300 text-gray-900",
|
|
1801
|
-
"dark:bg-gray-900/60 dark:border-gray-700/50 dark:text-gray-100"
|
|
1802
|
-
].join(" "),
|
|
1803
|
-
response: [
|
|
1804
|
-
"relative data-[compact=false]:px-4 text-gray-900",
|
|
1805
|
-
"dark:text-gray-100"
|
|
1806
|
-
].join(" "),
|
|
1807
|
-
overlay: "overflow-y-hidden max-h-[350px] after:content-[''] after:absolute after:inset-x-0 after:bottom-0 after:h-16 after:bg-linear-to-b after:from-transparent dark:after:to-gray-900 after:to-gray-200",
|
|
1808
|
-
cursor: "inline-block w-1 h-4 bg-current",
|
|
1809
|
-
expand: "absolute bottom-1 right-1 z-10",
|
|
1810
|
-
files: {
|
|
1811
|
-
base: "mb-2 flex flex-wrap gap-3 ",
|
|
1812
|
-
file: {
|
|
1813
|
-
base: [
|
|
1814
|
-
"flex items-center gap-2 border border-gray-300 px-3 py-2 rounded-lg cursor-pointer",
|
|
1815
|
-
"dark:border-gray-700"
|
|
1816
|
-
].join(" "),
|
|
1817
|
-
name: ["text-sm text-gray-500", "dark:text-gray-200"].join(" ")
|
|
1818
|
-
}
|
|
1819
|
-
},
|
|
1820
|
-
sources: {
|
|
1821
|
-
base: "my-4 flex flex-wrap gap-3",
|
|
1822
|
-
source: {
|
|
1823
|
-
base: [
|
|
1824
|
-
"flex gap-2 border border-gray-200 px-4 py-2 rounded-lg cursor-pointer",
|
|
1825
|
-
"dark:border-gray-700"
|
|
1826
|
-
].join(" "),
|
|
1827
|
-
companion: "flex-1 px-3 py-1.5",
|
|
1828
|
-
image: "max-w-10 max-h-10 rounded-md w-full h-fit self-center",
|
|
1829
|
-
title: "text-md block",
|
|
1830
|
-
url: "text-sm text-blue-400 underline"
|
|
1831
|
-
}
|
|
1832
|
-
},
|
|
1833
|
-
markdown: {
|
|
1834
|
-
copy: "sticky py-1 [&>svg]:w-4 [&>svg]:h-4 opacity-50",
|
|
1835
|
-
p: "mb-2",
|
|
1836
|
-
a: "text-blue-400 underline",
|
|
1837
|
-
table: "table-auto w-full m-2",
|
|
1838
|
-
th: "px-4 py-2 text-left font-bold border-b border-gray-500",
|
|
1839
|
-
td: "px-4 py-2",
|
|
1840
|
-
code: "m-2 rounded-b relative",
|
|
1841
|
-
toolbar: "text-xs dark:bg-gray-700/50 flex items-center justify-between px-2 py-1 rounded-t sticky top-0 backdrop-blur-md bg-gray-200 ",
|
|
1842
|
-
li: "mb-2 ml-6",
|
|
1843
|
-
ul: "mb-4 list-disc",
|
|
1844
|
-
ol: "mb-4 list-decimal"
|
|
1845
|
-
},
|
|
1846
|
-
footer: {
|
|
1847
|
-
base: "mt-3 flex gap-1.5",
|
|
1848
|
-
copy: [
|
|
1849
|
-
"p-3 rounded-[10px] [&>svg]:w-4 [&>svg]:h-4 opacity-50 hover:opacity-100! hover:bg-gray-200 hover:text-gray-500",
|
|
1850
|
-
"dark:hover:bg-gray-800 dark:hover:text-white text-gray-400"
|
|
1851
|
-
].join(" "),
|
|
1852
|
-
upvote: "p-3 rounded-[10px] [&>svg]:w-4 [&>svg]:h-4 opacity-50 hover:opacity-100! hover:bg-gray-700/40 hover:text-white text-gray-400",
|
|
1853
|
-
downvote: "p-3 rounded-[10px] [&>svg]:w-4 [&>svg]:h-4 opacity-50 hover:opacity-100! hover:bg-gray-700/40 hover:text-white text-gray-400",
|
|
1854
|
-
refresh: "p-3 rounded-[10px] [&>svg]:w-4 [&>svg]:h-4 opacity-50 hover:opacity-100! hover:bg-gray-700/40 hover:text-white text-gray-400"
|
|
1855
|
-
}
|
|
1856
|
-
}
|
|
1857
|
-
},
|
|
1858
|
-
input: {
|
|
1859
|
-
base: "flex mt-4 relative",
|
|
1860
|
-
upload: ["px-5 py-2 text-gray-400 size-10", "dark:gray-500"].join(" "),
|
|
1861
|
-
input: [
|
|
1862
|
-
"w-full border rounded-3xl px-3 py-2 pr-16 text-gray-500 border-gray-200 hover:bg-blue-100 hover:border-blue-500 after:hidden after:mx-10! bg-white [&>textarea]:w-full [&>textarea]:flex-none",
|
|
1863
|
-
"dark:border-gray-700/50 dark:text-gray-200 dark:bg-gray-950 dark:hover:bg-blue-950/40"
|
|
1864
|
-
].join(" "),
|
|
1865
|
-
actions: {
|
|
1866
|
-
base: "absolute flex gap-2 items-center right-5 inset-y-1/2 -translate-y-1/2 z-10",
|
|
1867
|
-
send: [
|
|
1868
|
-
"px-3 py-3 hover:bg-primary-hover rounded-full bg-gray-200 hover:bg-gray-300 text-gray-500",
|
|
1869
|
-
"dark:text-white light:text-gray-500 dark:bg-gray-800 dark:hover:bg-gray-700"
|
|
1870
|
-
].join(" "),
|
|
1871
|
-
stop: "px-2 py-2 bg-red-500 text-white rounded-full hover:bg-red-700 "
|
|
1872
|
-
}
|
|
1873
|
-
}
|
|
1874
|
-
};
|
|
1875
|
-
const useDimensions = () => {
|
|
1876
|
-
const [ref, setRef] = useState(null);
|
|
1877
|
-
const [width, setWidth] = useState(void 0);
|
|
1878
|
-
const observe = useCallback((element) => {
|
|
1879
|
-
if (element) setRef(element);
|
|
1880
|
-
}, []);
|
|
1881
|
-
useEffect(() => {
|
|
1882
|
-
if (!ref) return;
|
|
1883
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
1884
|
-
for (let entry of entries) {
|
|
1885
|
-
setWidth(entry.contentRect.width);
|
|
1886
|
-
}
|
|
1887
|
-
});
|
|
1888
|
-
resizeObserver.observe(ref);
|
|
1889
|
-
return () => {
|
|
1890
|
-
resizeObserver.disconnect();
|
|
1891
|
-
};
|
|
1892
|
-
}, [ref]);
|
|
1893
|
-
return { width, observe };
|
|
1894
|
-
};
|
|
1895
|
-
const Chat = ({
|
|
1896
|
-
children,
|
|
1897
|
-
viewType = "console",
|
|
1898
|
-
sessions,
|
|
1899
|
-
onSelectSession,
|
|
1900
|
-
onDeleteSession,
|
|
1901
|
-
onSendMessage,
|
|
1902
|
-
onStopMessage,
|
|
1903
|
-
onFileUpload,
|
|
1904
|
-
isLoading,
|
|
1905
|
-
activeSessionId,
|
|
1906
|
-
theme = chatTheme,
|
|
1907
|
-
onNewSession,
|
|
1908
|
-
remarkPlugins = [remarkGfm, remarkYoutube, remarkMath],
|
|
1909
|
-
disabled,
|
|
1910
|
-
style,
|
|
1911
|
-
className
|
|
1912
|
-
}) => {
|
|
1913
|
-
const [internalActiveSessionID, setInternalActiveSessionID] = useState(activeSessionId);
|
|
1914
|
-
const { width, observe } = useDimensions();
|
|
1915
|
-
const isCompact = viewType === "companion" || width && width < 767;
|
|
1916
|
-
useEffect(() => {
|
|
1917
|
-
setInternalActiveSessionID(activeSessionId);
|
|
1918
|
-
}, [activeSessionId]);
|
|
1919
|
-
const handleSelectSession = useCallback(
|
|
1920
|
-
(sessionId) => {
|
|
1921
|
-
setInternalActiveSessionID(sessionId);
|
|
1922
|
-
onSelectSession == null ? void 0 : onSelectSession(sessionId);
|
|
1923
|
-
},
|
|
1924
|
-
[onSelectSession]
|
|
1925
|
-
);
|
|
1926
|
-
const handleDeleteSession = useCallback(
|
|
1927
|
-
(sessionId) => {
|
|
1928
|
-
setInternalActiveSessionID(void 0);
|
|
1929
|
-
onDeleteSession == null ? void 0 : onDeleteSession(sessionId);
|
|
1930
|
-
},
|
|
1931
|
-
[onDeleteSession]
|
|
1932
|
-
);
|
|
1933
|
-
const handleCreateNewSession = useCallback(() => {
|
|
1934
|
-
setInternalActiveSessionID(void 0);
|
|
1935
|
-
onNewSession == null ? void 0 : onNewSession();
|
|
1936
|
-
}, [onNewSession]);
|
|
1937
|
-
useHotkeys([
|
|
1938
|
-
{
|
|
1939
|
-
name: "Create new session",
|
|
1940
|
-
category: "Chat",
|
|
1941
|
-
keys: "meta+shift+s",
|
|
1942
|
-
callback: (event) => {
|
|
1943
|
-
event.preventDefault();
|
|
1944
|
-
handleCreateNewSession();
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
]);
|
|
1948
|
-
const activeSession = useMemo(
|
|
1949
|
-
() => sessions.find((session) => session.id === internalActiveSessionID),
|
|
1950
|
-
[sessions, internalActiveSessionID]
|
|
1951
|
-
);
|
|
1952
|
-
const contextValue = useMemo(
|
|
1953
|
-
() => ({
|
|
1954
|
-
sessions,
|
|
1955
|
-
activeSession,
|
|
1956
|
-
remarkPlugins,
|
|
1957
|
-
theme,
|
|
1958
|
-
disabled,
|
|
1959
|
-
isLoading,
|
|
1960
|
-
isCompact,
|
|
1961
|
-
viewType,
|
|
1962
|
-
activeSessionId: internalActiveSessionID,
|
|
1963
|
-
selectSession: handleSelectSession,
|
|
1964
|
-
deleteSession: handleDeleteSession,
|
|
1965
|
-
createSession: handleCreateNewSession,
|
|
1966
|
-
sendMessage: onSendMessage,
|
|
1967
|
-
stopMessage: onStopMessage,
|
|
1968
|
-
fileUpload: onFileUpload
|
|
1969
|
-
}),
|
|
1970
|
-
[
|
|
1971
|
-
isLoading,
|
|
1972
|
-
isCompact,
|
|
1973
|
-
viewType,
|
|
1974
|
-
disabled,
|
|
1975
|
-
theme,
|
|
1976
|
-
remarkPlugins,
|
|
1977
|
-
sessions,
|
|
1978
|
-
activeSession,
|
|
1979
|
-
internalActiveSessionID,
|
|
1980
|
-
handleSelectSession,
|
|
1981
|
-
handleDeleteSession,
|
|
1982
|
-
handleCreateNewSession,
|
|
1983
|
-
onSendMessage,
|
|
1984
|
-
onStopMessage,
|
|
1985
|
-
onFileUpload
|
|
1986
|
-
]
|
|
1987
|
-
);
|
|
1988
|
-
return /* @__PURE__ */ jsx(ChatContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: /* @__PURE__ */ jsx(
|
|
1989
|
-
"div",
|
|
1990
|
-
{
|
|
1991
|
-
ref: observe,
|
|
1992
|
-
className: cn(className, theme.base, {
|
|
1993
|
-
[theme.companion]: isCompact,
|
|
1994
|
-
[theme.console]: !isCompact
|
|
1995
|
-
}),
|
|
1996
|
-
style,
|
|
1997
|
-
children
|
|
1998
|
-
}
|
|
1999
|
-
) }) });
|
|
2000
|
-
};
|
|
2001
|
-
const SvgTrash = (props) => /* @__PURE__ */ React.createElement("svg", { width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("g", { id: "Delete" }, /* @__PURE__ */ React.createElement("path", { id: "Vector", d: "M5.97905 1.16666C5.90859 1.16576 5.83895 1.18189 5.77605 1.21368C5.71316 1.24547 5.65888 1.29199 5.61783 1.34926C5.57677 1.40654 5.55016 1.47288 5.54025 1.54265C5.53034 1.61242 5.53743 1.68355 5.56092 1.75H4.27007C3.7342 1.75 3.2324 2.01817 2.93535 2.46435L2.24492 3.5H2.18738C2.12941 3.49918 2.07185 3.50989 2.01805 3.5315C1.96425 3.55312 1.91529 3.58522 1.874 3.62593C1.83271 3.66663 1.79993 3.71514 1.77755 3.76863C1.75518 3.82211 1.74365 3.87952 1.74365 3.9375C1.74365 3.99548 1.75518 4.05288 1.77755 4.10636C1.79993 4.15985 1.83271 4.20836 1.874 4.24907C1.91529 4.28977 1.96425 4.32187 2.01805 4.34349C2.07185 4.3651 2.12941 4.37582 2.18738 4.375H2.41012C2.44765 4.38067 2.48576 4.38143 2.52348 4.37727L3.24468 11.1084C3.33169 11.9199 4.02367 12.5417 4.83973 12.5417H9.15947C9.97553 12.5417 10.6675 11.9199 10.7545 11.1084L11.4763 4.37727C11.5133 4.38124 11.5506 4.38047 11.5874 4.375H11.8124C11.8704 4.37582 11.9279 4.3651 11.9817 4.34349C12.0355 4.32187 12.0845 4.28977 12.1258 4.24907C12.1671 4.20836 12.1998 4.15985 12.2222 4.10636C12.2446 4.05288 12.2561 3.99548 12.2561 3.9375C12.2561 3.87952 12.2446 3.82211 12.2222 3.76863C12.1998 3.71514 12.1671 3.66663 12.1258 3.62593C12.0845 3.58522 12.0355 3.55312 11.9817 3.5315C11.9279 3.50989 11.8704 3.49918 11.8124 3.5H11.7548L11.0644 2.46435C10.7671 2.01841 10.2654 1.75 9.7297 1.75H8.43885C8.46234 1.68355 8.46943 1.61242 8.45952 1.54265C8.44961 1.47288 8.423 1.40654 8.38194 1.34926C8.34089 1.29199 8.2866 1.24547 8.22371 1.21368C8.16082 1.18189 8.09118 1.16576 8.02072 1.16666H5.97905ZM4.27007 2.625H9.7297C9.97394 2.625 10.2009 2.74639 10.3364 2.9497L10.7033 3.5H3.29651L3.66338 2.9497L3.66395 2.94913C3.79913 2.74608 4.02543 2.625 4.27007 2.625ZM3.40361 4.375H10.5962L9.88465 11.015C9.8445 11.3894 9.53575 11.6667 9.15947 11.6667H4.83973C4.46345 11.6667 4.15527 11.3894 4.11512 11.015L3.40361 4.375Z", fill: "currentColor" })));
|
|
2002
|
-
const SvgChat = (props) => /* @__PURE__ */ React.createElement("svg", { width: 16, height: 17, viewBox: "0 0 16 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M8 3C4.55375 3 1.75 5.23753 1.75 7.98828C1.75 9.70653 2.83659 11.2762 4.62109 12.188C4.11184 13.0465 3.62587 13.7378 3.62012 13.7461C3.50687 13.9071 3.49862 14.1196 3.59912 14.2891C3.69012 14.4418 3.8543 14.5342 4.0293 14.5342C4.0483 14.5342 4.06743 14.533 4.08643 14.5308C4.15168 14.5233 5.66214 14.3364 7.50439 12.9604C7.67239 12.9712 7.8385 12.9766 8 12.9766C11.4462 12.9766 14.25 10.739 14.25 7.98828C14.25 5.23753 11.4462 3 8 3ZM8 4C10.8948 4 13.25 5.78903 13.25 7.98828C13.25 10.1875 10.8948 11.9766 8 11.9766C7.8055 11.9766 7.60225 11.968 7.396 11.9497C7.271 11.9382 7.1454 11.9752 7.0459 12.0527C6.3589 12.5855 5.72033 12.9308 5.20508 13.1528C5.38383 12.8648 5.57691 12.5418 5.76416 12.2061C5.83416 12.0813 5.84705 11.9324 5.7998 11.7974C5.75255 11.6624 5.64983 11.5542 5.51758 11.5C3.81033 10.7993 2.75 9.45328 2.75 7.98828C2.75 5.78903 5.10525 4 8 4ZM5.5 7.25C5.08575 7.25 4.75 7.58575 4.75 8C4.75 8.41425 5.08575 8.75 5.5 8.75C5.91425 8.75 6.25 8.41425 6.25 8C6.25 7.58575 5.91425 7.25 5.5 7.25ZM8 7.25C7.58575 7.25 7.25 7.58575 7.25 8C7.25 8.41425 7.58575 8.75 8 8.75C8.41425 8.75 8.75 8.41425 8.75 8C8.75 7.58575 8.41425 7.25 8 7.25ZM10.5 7.25C10.0857 7.25 9.75 7.58575 9.75 8C9.75 8.41425 10.0857 8.75 10.5 8.75C10.9143 8.75 11.25 8.41425 11.25 8C11.25 7.58575 10.9143 7.25 10.5 7.25Z", fill: "currentColor" }));
|
|
2003
|
-
const SessionListItem = ({
|
|
2004
|
-
children,
|
|
2005
|
-
session,
|
|
2006
|
-
deletable = true,
|
|
2007
|
-
limit = 100,
|
|
2008
|
-
deleteIcon = /* @__PURE__ */ jsx(SvgTrash, {}),
|
|
2009
|
-
chatIcon = /* @__PURE__ */ jsx(SvgChat, { className: "mr-2" })
|
|
2010
|
-
}) => {
|
|
2011
|
-
const { activeSessionId, selectSession, deleteSession, theme } = useContext(ChatContext);
|
|
2012
|
-
const Comp = children ? Slot : ListItem;
|
|
2013
|
-
return /* @__PURE__ */ jsx(
|
|
2014
|
-
Comp,
|
|
2015
|
-
{
|
|
2016
|
-
dense: true,
|
|
2017
|
-
disableGutters: true,
|
|
2018
|
-
active: session.id === activeSessionId,
|
|
2019
|
-
className: cn(theme.sessions.session.base, {
|
|
2020
|
-
[theme.sessions.session.active]: session.id === activeSessionId
|
|
2021
|
-
}),
|
|
2022
|
-
onClick: () => selectSession == null ? void 0 : selectSession(session.id),
|
|
2023
|
-
start: chatIcon,
|
|
2024
|
-
end: /* @__PURE__ */ jsx(Fragment, { children: deletable && /* @__PURE__ */ jsx(
|
|
2025
|
-
IconButton,
|
|
2026
|
-
{
|
|
2027
|
-
size: "small",
|
|
2028
|
-
variant: "text",
|
|
2029
|
-
onClick: (e) => {
|
|
2030
|
-
e.stopPropagation();
|
|
2031
|
-
deleteSession(session.id);
|
|
2032
|
-
},
|
|
2033
|
-
className: cn(theme.sessions.session.delete),
|
|
2034
|
-
children: deleteIcon
|
|
2035
|
-
}
|
|
2036
|
-
) }),
|
|
2037
|
-
children: children || /* @__PURE__ */ jsx(Ellipsis, { value: session.title, limit })
|
|
2038
|
-
}
|
|
2039
|
-
);
|
|
2040
|
-
};
|
|
2041
|
-
const SessionsList = ({
|
|
2042
|
-
children,
|
|
2043
|
-
templates
|
|
2044
|
-
}) => {
|
|
2045
|
-
const { theme, isCompact, activeSessionId, createSession } = useContext(ChatContext);
|
|
2046
|
-
const isVisible = isCompact && !activeSessionId;
|
|
2047
|
-
return (!isCompact || isVisible) && /* @__PURE__ */ jsxs(
|
|
1959
|
+
const { activeSessionId, theme, isCompact, selectSession, viewType } = useContext(ChatContext);
|
|
1960
|
+
const isVisible = isCompact && activeSessionId || viewType === "chat" || !isCompact;
|
|
1961
|
+
return isVisible && /* @__PURE__ */ jsx(
|
|
2048
1962
|
motion.div,
|
|
2049
1963
|
{
|
|
2050
|
-
initial: { translateX: "
|
|
1964
|
+
initial: { translateX: "200%" },
|
|
2051
1965
|
animate: {
|
|
2052
1966
|
translateX: "0%",
|
|
2053
1967
|
transition: {
|
|
@@ -2057,29 +1971,133 @@ const SessionsList = ({
|
|
|
2057
1971
|
when: "beforeChildren"
|
|
2058
1972
|
}
|
|
2059
1973
|
},
|
|
2060
|
-
exit: { translateX: "
|
|
2061
|
-
className: cn(theme.
|
|
2062
|
-
[theme.
|
|
2063
|
-
[theme.
|
|
1974
|
+
exit: { translateX: "200%" },
|
|
1975
|
+
className: cn(theme.messages.base, {
|
|
1976
|
+
[theme.messages.companion]: isCompact,
|
|
1977
|
+
[theme.messages.console]: !isCompact
|
|
2064
1978
|
}),
|
|
1979
|
+
children: /* @__PURE__ */ jsxs("div", { className: cn(theme.messages.inner), children: [
|
|
1980
|
+
allowBack && isCompact && viewType !== "chat" && /* @__PURE__ */ jsxs(
|
|
1981
|
+
Button,
|
|
1982
|
+
{
|
|
1983
|
+
variant: "text",
|
|
1984
|
+
size: "small",
|
|
1985
|
+
onClick: () => selectSession(null),
|
|
1986
|
+
className: cn(theme.messages.back),
|
|
1987
|
+
children: [
|
|
1988
|
+
/* @__PURE__ */ jsx(SvgBack, {}),
|
|
1989
|
+
"Back"
|
|
1990
|
+
]
|
|
1991
|
+
}
|
|
1992
|
+
),
|
|
1993
|
+
children
|
|
1994
|
+
] })
|
|
1995
|
+
}
|
|
1996
|
+
);
|
|
1997
|
+
};
|
|
1998
|
+
const containerVariants = {
|
|
1999
|
+
hidden: {},
|
|
2000
|
+
visible: {
|
|
2001
|
+
transition: {
|
|
2002
|
+
staggerChildren: 0.07,
|
|
2003
|
+
when: "beforeChildren"
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
};
|
|
2007
|
+
const SessionMessages = ({
|
|
2008
|
+
children,
|
|
2009
|
+
newSessionContent,
|
|
2010
|
+
limit = 10,
|
|
2011
|
+
className,
|
|
2012
|
+
showMoreText = "Show more",
|
|
2013
|
+
autoScroll = true,
|
|
2014
|
+
onScroll
|
|
2015
|
+
}) => {
|
|
2016
|
+
const { activeSession, theme } = useContext(ChatContext);
|
|
2017
|
+
const contentRef = useRef(null);
|
|
2018
|
+
const [isAnimating, setIsAnimating] = useState(true);
|
|
2019
|
+
useEffect(() => {
|
|
2020
|
+
if (contentRef.current && autoScroll) {
|
|
2021
|
+
requestAnimationFrame(
|
|
2022
|
+
() => contentRef.current.scrollTop = contentRef.current.scrollHeight
|
|
2023
|
+
);
|
|
2024
|
+
}
|
|
2025
|
+
}, [activeSession, autoScroll, isAnimating]);
|
|
2026
|
+
function handleShowMore() {
|
|
2027
|
+
showNext(limit);
|
|
2028
|
+
requestAnimationFrame(() => contentRef.current.scrollTop = 0);
|
|
2029
|
+
}
|
|
2030
|
+
const reversedConvos = useMemo(
|
|
2031
|
+
() => [...activeSession?.conversations ?? []].reverse(),
|
|
2032
|
+
[activeSession]
|
|
2033
|
+
);
|
|
2034
|
+
const { data, hasMore, showNext } = useInfinityList({
|
|
2035
|
+
items: reversedConvos,
|
|
2036
|
+
size: limit
|
|
2037
|
+
});
|
|
2038
|
+
const reReversedConvo = useMemo(() => [...data].reverse(), [data]);
|
|
2039
|
+
const convosToRender = limit ? reReversedConvo : activeSession?.conversations;
|
|
2040
|
+
if (!activeSession) {
|
|
2041
|
+
return /* @__PURE__ */ jsx(SessionEmpty, { children: newSessionContent });
|
|
2042
|
+
}
|
|
2043
|
+
return /* @__PURE__ */ jsxs(
|
|
2044
|
+
"div",
|
|
2045
|
+
{
|
|
2046
|
+
className: cn(theme.messages.content, className),
|
|
2047
|
+
ref: contentRef,
|
|
2048
|
+
onScrollCapture: onScroll,
|
|
2065
2049
|
children: [
|
|
2066
|
-
/* @__PURE__ */ jsx(
|
|
2067
|
-
|
|
2068
|
-
SessionListItem,
|
|
2050
|
+
hasMore && /* @__PURE__ */ jsx(
|
|
2051
|
+
Button,
|
|
2069
2052
|
{
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
chatIcon: template.icon,
|
|
2076
|
-
deletable: false
|
|
2053
|
+
variant: "outline",
|
|
2054
|
+
className: cn(theme.messages.showMore),
|
|
2055
|
+
fullWidth: true,
|
|
2056
|
+
onClick: handleShowMore,
|
|
2057
|
+
children: showMoreText
|
|
2077
2058
|
}
|
|
2078
|
-
)
|
|
2059
|
+
),
|
|
2060
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsx(
|
|
2061
|
+
motion.div,
|
|
2062
|
+
{
|
|
2063
|
+
variants: containerVariants,
|
|
2064
|
+
initial: "hidden",
|
|
2065
|
+
animate: "visible",
|
|
2066
|
+
onAnimationComplete: () => {
|
|
2067
|
+
requestAnimationFrame(() => setIsAnimating(false));
|
|
2068
|
+
},
|
|
2069
|
+
children: children ? children(convosToRender) : convosToRender.map((conversation, index) => /* @__PURE__ */ jsx(
|
|
2070
|
+
SessionMessage,
|
|
2071
|
+
{
|
|
2072
|
+
conversation,
|
|
2073
|
+
isLast: index === conversation.length - 1
|
|
2074
|
+
},
|
|
2075
|
+
conversation.id
|
|
2076
|
+
))
|
|
2077
|
+
},
|
|
2078
|
+
activeSession?.id
|
|
2079
|
+
) })
|
|
2079
2080
|
]
|
|
2080
2081
|
}
|
|
2081
2082
|
);
|
|
2082
2083
|
};
|
|
2084
|
+
const SessionMessagesHeader = ({ children }) => {
|
|
2085
|
+
const { activeSession, theme } = useContext(ChatContext);
|
|
2086
|
+
const Comp = children ? Slot : "header";
|
|
2087
|
+
if (!activeSession) {
|
|
2088
|
+
return null;
|
|
2089
|
+
}
|
|
2090
|
+
return /* @__PURE__ */ jsx(Comp, { className: cn(theme.messages.header), children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2091
|
+
/* @__PURE__ */ jsx("h2", { className: cn(theme.messages.title), children: /* @__PURE__ */ jsx(Ellipsis, { limit: 125, value: activeSession.title }) }),
|
|
2092
|
+
/* @__PURE__ */ jsx(
|
|
2093
|
+
DateFormat,
|
|
2094
|
+
{
|
|
2095
|
+
className: cn(theme.messages.date),
|
|
2096
|
+
date: activeSession.createdAt
|
|
2097
|
+
}
|
|
2098
|
+
)
|
|
2099
|
+
] }) });
|
|
2100
|
+
};
|
|
2083
2101
|
const SvgPlus = (props) => /* @__PURE__ */ React.createElement("svg", { width: 17, height: 17, viewBox: "0 0 17 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("g", { id: "add" }, /* @__PURE__ */ React.createElement("path", { id: "Vector", d: "M13.1667 9.16658H9.16671V13.1666H7.83337V9.16658H3.83337V7.83325H7.83337V3.83325H9.16671V7.83325H13.1667V9.16658Z", fill: "currentColor" })));
|
|
2084
2102
|
const NewSessionButton = ({
|
|
2085
2103
|
children,
|
|
@@ -2164,6 +2182,46 @@ function groupSessionsByDate(sessions) {
|
|
|
2164
2182
|
)
|
|
2165
2183
|
}));
|
|
2166
2184
|
}
|
|
2185
|
+
const SvgChat = (props) => /* @__PURE__ */ React.createElement("svg", { width: 16, height: 17, viewBox: "0 0 16 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M8 3C4.55375 3 1.75 5.23753 1.75 7.98828C1.75 9.70653 2.83659 11.2762 4.62109 12.188C4.11184 13.0465 3.62587 13.7378 3.62012 13.7461C3.50687 13.9071 3.49862 14.1196 3.59912 14.2891C3.69012 14.4418 3.8543 14.5342 4.0293 14.5342C4.0483 14.5342 4.06743 14.533 4.08643 14.5308C4.15168 14.5233 5.66214 14.3364 7.50439 12.9604C7.67239 12.9712 7.8385 12.9766 8 12.9766C11.4462 12.9766 14.25 10.739 14.25 7.98828C14.25 5.23753 11.4462 3 8 3ZM8 4C10.8948 4 13.25 5.78903 13.25 7.98828C13.25 10.1875 10.8948 11.9766 8 11.9766C7.8055 11.9766 7.60225 11.968 7.396 11.9497C7.271 11.9382 7.1454 11.9752 7.0459 12.0527C6.3589 12.5855 5.72033 12.9308 5.20508 13.1528C5.38383 12.8648 5.57691 12.5418 5.76416 12.2061C5.83416 12.0813 5.84705 11.9324 5.7998 11.7974C5.75255 11.6624 5.64983 11.5542 5.51758 11.5C3.81033 10.7993 2.75 9.45328 2.75 7.98828C2.75 5.78903 5.10525 4 8 4ZM5.5 7.25C5.08575 7.25 4.75 7.58575 4.75 8C4.75 8.41425 5.08575 8.75 5.5 8.75C5.91425 8.75 6.25 8.41425 6.25 8C6.25 7.58575 5.91425 7.25 5.5 7.25ZM8 7.25C7.58575 7.25 7.25 7.58575 7.25 8C7.25 8.41425 7.58575 8.75 8 8.75C8.41425 8.75 8.75 8.41425 8.75 8C8.75 7.58575 8.41425 7.25 8 7.25ZM10.5 7.25C10.0857 7.25 9.75 7.58575 9.75 8C9.75 8.41425 10.0857 8.75 10.5 8.75C10.9143 8.75 11.25 8.41425 11.25 8C11.25 7.58575 10.9143 7.25 10.5 7.25Z", fill: "currentColor" }));
|
|
2186
|
+
const SvgTrash = (props) => /* @__PURE__ */ React.createElement("svg", { width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("g", { id: "Delete" }, /* @__PURE__ */ React.createElement("path", { id: "Vector", d: "M5.97905 1.16666C5.90859 1.16576 5.83895 1.18189 5.77605 1.21368C5.71316 1.24547 5.65888 1.29199 5.61783 1.34926C5.57677 1.40654 5.55016 1.47288 5.54025 1.54265C5.53034 1.61242 5.53743 1.68355 5.56092 1.75H4.27007C3.7342 1.75 3.2324 2.01817 2.93535 2.46435L2.24492 3.5H2.18738C2.12941 3.49918 2.07185 3.50989 2.01805 3.5315C1.96425 3.55312 1.91529 3.58522 1.874 3.62593C1.83271 3.66663 1.79993 3.71514 1.77755 3.76863C1.75518 3.82211 1.74365 3.87952 1.74365 3.9375C1.74365 3.99548 1.75518 4.05288 1.77755 4.10636C1.79993 4.15985 1.83271 4.20836 1.874 4.24907C1.91529 4.28977 1.96425 4.32187 2.01805 4.34349C2.07185 4.3651 2.12941 4.37582 2.18738 4.375H2.41012C2.44765 4.38067 2.48576 4.38143 2.52348 4.37727L3.24468 11.1084C3.33169 11.9199 4.02367 12.5417 4.83973 12.5417H9.15947C9.97553 12.5417 10.6675 11.9199 10.7545 11.1084L11.4763 4.37727C11.5133 4.38124 11.5506 4.38047 11.5874 4.375H11.8124C11.8704 4.37582 11.9279 4.3651 11.9817 4.34349C12.0355 4.32187 12.0845 4.28977 12.1258 4.24907C12.1671 4.20836 12.1998 4.15985 12.2222 4.10636C12.2446 4.05288 12.2561 3.99548 12.2561 3.9375C12.2561 3.87952 12.2446 3.82211 12.2222 3.76863C12.1998 3.71514 12.1671 3.66663 12.1258 3.62593C12.0845 3.58522 12.0355 3.55312 11.9817 3.5315C11.9279 3.50989 11.8704 3.49918 11.8124 3.5H11.7548L11.0644 2.46435C10.7671 2.01841 10.2654 1.75 9.7297 1.75H8.43885C8.46234 1.68355 8.46943 1.61242 8.45952 1.54265C8.44961 1.47288 8.423 1.40654 8.38194 1.34926C8.34089 1.29199 8.2866 1.24547 8.22371 1.21368C8.16082 1.18189 8.09118 1.16576 8.02072 1.16666H5.97905ZM4.27007 2.625H9.7297C9.97394 2.625 10.2009 2.74639 10.3364 2.9497L10.7033 3.5H3.29651L3.66338 2.9497L3.66395 2.94913C3.79913 2.74608 4.02543 2.625 4.27007 2.625ZM3.40361 4.375H10.5962L9.88465 11.015C9.8445 11.3894 9.53575 11.6667 9.15947 11.6667H4.83973C4.46345 11.6667 4.15527 11.3894 4.11512 11.015L3.40361 4.375Z", fill: "currentColor" })));
|
|
2187
|
+
const SessionListItem = ({
|
|
2188
|
+
children,
|
|
2189
|
+
session,
|
|
2190
|
+
deletable = true,
|
|
2191
|
+
limit = 100,
|
|
2192
|
+
deleteIcon = /* @__PURE__ */ jsx(SvgTrash, {}),
|
|
2193
|
+
chatIcon = /* @__PURE__ */ jsx(SvgChat, { className: "mr-2" })
|
|
2194
|
+
}) => {
|
|
2195
|
+
const { activeSessionId, selectSession, deleteSession, theme } = useContext(ChatContext);
|
|
2196
|
+
const Comp = children ? Slot : ListItem;
|
|
2197
|
+
return /* @__PURE__ */ jsx(
|
|
2198
|
+
Comp,
|
|
2199
|
+
{
|
|
2200
|
+
dense: true,
|
|
2201
|
+
disableGutters: true,
|
|
2202
|
+
active: session.id === activeSessionId,
|
|
2203
|
+
className: cn(theme.sessions.session.base, {
|
|
2204
|
+
[theme.sessions.session.active]: session.id === activeSessionId
|
|
2205
|
+
}),
|
|
2206
|
+
onClick: () => selectSession?.(session.id),
|
|
2207
|
+
start: chatIcon,
|
|
2208
|
+
end: /* @__PURE__ */ jsx(Fragment, { children: deletable && /* @__PURE__ */ jsx(
|
|
2209
|
+
IconButton,
|
|
2210
|
+
{
|
|
2211
|
+
size: "small",
|
|
2212
|
+
variant: "ghost",
|
|
2213
|
+
onClick: (e) => {
|
|
2214
|
+
e.stopPropagation();
|
|
2215
|
+
deleteSession(session.id);
|
|
2216
|
+
},
|
|
2217
|
+
className: cn(theme.sessions.session.delete),
|
|
2218
|
+
children: deleteIcon
|
|
2219
|
+
}
|
|
2220
|
+
) }),
|
|
2221
|
+
children: children || /* @__PURE__ */ jsx(Ellipsis, { value: session.title, limit })
|
|
2222
|
+
}
|
|
2223
|
+
);
|
|
2224
|
+
};
|
|
2167
2225
|
const SessionsGroup = ({
|
|
2168
2226
|
heading,
|
|
2169
2227
|
children
|
|
@@ -2185,80 +2243,85 @@ const SessionsGroup = ({
|
|
|
2185
2243
|
const SessionGroups = ({ children }) => {
|
|
2186
2244
|
const { sessions } = useContext(ChatContext);
|
|
2187
2245
|
const groups = useMemo(() => groupSessionsByDate(sessions), [sessions]);
|
|
2188
|
-
return /* @__PURE__ */ jsx(Fragment, { children: children ? children(groups) : groups.map(({ heading, sessions: sessions2 }) => /* @__PURE__ */ jsx(SessionsGroup, { heading, children: sessions2.map((session) => /* @__PURE__ */ jsx(SessionListItem, { session }, session.id)) })) });
|
|
2189
|
-
};
|
|
2190
|
-
const AppBar = ({ content, theme = chatTheme }) => {
|
|
2191
|
-
return /* @__PURE__ */ jsx("div", { className: cn(theme.appbar), children: content });
|
|
2246
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children ? children(groups) : groups.map(({ heading, sessions: sessions2 }) => /* @__PURE__ */ jsx(SessionsGroup, { heading, children: sessions2.map((session) => /* @__PURE__ */ jsx(SessionListItem, { session }, session.id)) }, heading)) });
|
|
2192
2247
|
};
|
|
2193
|
-
const
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
open: isOpen,
|
|
2211
|
-
onOpen: () => setIsOpen(true),
|
|
2212
|
-
onClose: () => setIsOpen(false),
|
|
2213
|
-
content: () => /* @__PURE__ */ jsx(Fragment, { children })
|
|
2214
|
-
}
|
|
2215
|
-
),
|
|
2216
|
-
/* @__PURE__ */ jsx(
|
|
2217
|
-
"div",
|
|
2218
|
-
{
|
|
2219
|
-
ref,
|
|
2220
|
-
className,
|
|
2221
|
-
onClick: () => setIsOpen((prev) => !prev),
|
|
2222
|
-
children: bubbleContent
|
|
2248
|
+
const SessionsList = ({
|
|
2249
|
+
children,
|
|
2250
|
+
templates
|
|
2251
|
+
}) => {
|
|
2252
|
+
const { theme, isCompact, activeSessionId, createSession } = useContext(ChatContext);
|
|
2253
|
+
const isVisible = isCompact && !activeSessionId;
|
|
2254
|
+
return (!isCompact || isVisible) && /* @__PURE__ */ jsxs(
|
|
2255
|
+
motion.div,
|
|
2256
|
+
{
|
|
2257
|
+
initial: { translateX: "-100%" },
|
|
2258
|
+
animate: {
|
|
2259
|
+
translateX: "0%",
|
|
2260
|
+
transition: {
|
|
2261
|
+
type: "tween",
|
|
2262
|
+
ease: "linear",
|
|
2263
|
+
duration: 0.2,
|
|
2264
|
+
when: "beforeChildren"
|
|
2223
2265
|
}
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2266
|
+
},
|
|
2267
|
+
exit: { translateX: "-100%" },
|
|
2268
|
+
className: cn(theme.sessions.base, {
|
|
2269
|
+
[theme.sessions.companion]: isCompact,
|
|
2270
|
+
[theme.sessions.console]: !isCompact
|
|
2271
|
+
}),
|
|
2272
|
+
children: [
|
|
2273
|
+
/* @__PURE__ */ jsx(List, { children }),
|
|
2274
|
+
templates && !activeSessionId && /* @__PURE__ */ jsx("div", { className: "mt-4", children: templates.map((template) => /* @__PURE__ */ jsx("div", { onClick: () => createSession?.(), children: /* @__PURE__ */ jsx(
|
|
2275
|
+
SessionListItem,
|
|
2276
|
+
{
|
|
2277
|
+
session: {
|
|
2278
|
+
id: template.id,
|
|
2279
|
+
title: template.title,
|
|
2280
|
+
conversations: []
|
|
2281
|
+
},
|
|
2282
|
+
chatIcon: template.icon,
|
|
2283
|
+
deletable: false
|
|
2284
|
+
}
|
|
2285
|
+
) }, template.id)) })
|
|
2286
|
+
]
|
|
2287
|
+
}
|
|
2288
|
+
);
|
|
2289
|
+
};
|
|
2228
2290
|
export {
|
|
2229
2291
|
AppBar as A,
|
|
2230
|
-
|
|
2231
|
-
|
|
2292
|
+
chatTheme as B,
|
|
2293
|
+
ChatContext as C,
|
|
2294
|
+
groupSessionsByDate as D,
|
|
2232
2295
|
FileInput as F,
|
|
2233
|
-
|
|
2296
|
+
Markdown as M,
|
|
2234
2297
|
NewSessionButton as N,
|
|
2235
2298
|
SvgFile as S,
|
|
2236
2299
|
TableComponent as T,
|
|
2237
2300
|
SvgCopy as a,
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2301
|
+
Chat as b,
|
|
2302
|
+
ChatBubble as c,
|
|
2303
|
+
ChatInput as d,
|
|
2304
|
+
CodeHighlighter as e,
|
|
2305
|
+
TableHeaderCell as f,
|
|
2306
|
+
TableDataCell as g,
|
|
2307
|
+
dark as h,
|
|
2308
|
+
SessionEmpty as i,
|
|
2309
|
+
MessageActions as j,
|
|
2310
|
+
MessageFile as k,
|
|
2311
|
+
light as l,
|
|
2312
|
+
MessageFiles as m,
|
|
2313
|
+
MessageQuestion as n,
|
|
2314
|
+
MessageResponse as o,
|
|
2315
|
+
MessageSource as p,
|
|
2316
|
+
MessageSources as q,
|
|
2317
|
+
remarkCve as r,
|
|
2318
|
+
SessionMessage as s,
|
|
2319
|
+
SessionMessagePanel as t,
|
|
2320
|
+
SessionMessages as u,
|
|
2321
|
+
SessionMessagesHeader as v,
|
|
2322
|
+
SessionGroups as w,
|
|
2323
|
+
SessionListItem as x,
|
|
2324
|
+
SessionsGroup as y,
|
|
2325
|
+
SessionsList as z
|
|
2263
2326
|
};
|
|
2264
|
-
//# sourceMappingURL=index-
|
|
2327
|
+
//# sourceMappingURL=index-DNefh8rs.js.map
|