@swisper.ai/web-chat-ui 0.3.0 → 0.3.2
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/README.md +2 -1
- package/dist/components/chat-reasoning/chat-reasoning.d.ts +194 -0
- package/dist/components/chat-reasoning/chat-reasoning.d.ts.map +1 -0
- package/dist/components/chat-reasoning/chat-reasoning.stories.d.ts +38 -0
- package/dist/components/chat-reasoning/chat-reasoning.stories.d.ts.map +1 -0
- package/dist/components/chat-reasoning/index.d.ts +2 -0
- package/dist/components/chat-reasoning/index.d.ts.map +1 -0
- package/dist/components/chat-thinking-process/chat-thinking-process.d.ts +55 -18
- package/dist/components/chat-thinking-process/chat-thinking-process.d.ts.map +1 -1
- package/dist/components/chat-thinking-process/chat-thinking-process.stories.d.ts +11 -6
- package/dist/components/chat-thinking-process/chat-thinking-process.stories.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/docs/agent.stories.d.ts.map +1 -1
- package/dist/docs/chatbot-panel.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.es.js +1371 -883
- package/dist/index.es.js.map +1 -1
- package/package.json +4 -3
- package/src/components/chat-message/__stories__/tool-steps.tsx +44 -20
- package/src/components/chat-reasoning/__stories__/fixtures.ts +144 -0
- package/src/components/chat-reasoning/chat-reasoning.json +241 -0
- package/src/components/chat-reasoning/chat-reasoning.stories.tsx +462 -0
- package/src/components/chat-reasoning/chat-reasoning.tsx +1042 -0
- package/src/components/chat-reasoning/index.ts +51 -0
- package/src/components/chat-thinking-process/chat-thinking-process.json +23 -14
- package/src/components/chat-thinking-process/chat-thinking-process.stories.tsx +115 -25
- package/src/components/chat-thinking-process/chat-thinking-process.tsx +93 -10
- package/src/components/index.ts +1 -0
- package/src/docs/agent.stories.tsx +28 -23
- package/src/docs/chatbot-panel.tsx +48 -22
- package/src/docs/chatbot.mdx +5 -4
package/dist/index.es.js
CHANGED
|
@@ -1,61 +1,62 @@
|
|
|
1
|
-
import { Button as e, Card as t, CardAction as n, CardDescription as r, CardIcon as i, CardTitle as a, Chip as o, Collapsible as s, CollapsibleChevron as c, CollapsibleContent as l, CollapsibleTrigger as u, Divider as d, EmptyState as f, EmptyStateActionRow as p, EmptyStateDescription as m, EmptyStateIcon as h, EmptyStateTitle as g, IconButton as _, List as v, ListItem as y, ListItemAction as b, ListItemTitle as x, ListItemTrigger as S, Menu as
|
|
1
|
+
import { Button as e, Card as t, CardAction as n, CardDescription as r, CardIcon as i, CardTitle as a, Chip as o, Collapsible as s, CollapsibleChevron as c, CollapsibleContent as l, CollapsibleTrigger as u, Divider as d, EmptyState as f, EmptyStateActionRow as p, EmptyStateDescription as m, EmptyStateIcon as h, EmptyStateTitle as g, IconButton as _, List as v, ListItem as y, ListItemAction as b, ListItemTitle as x, ListItemTrigger as S, Menu as ee, MenuList as te, MenuProvider as ne, MenuTrigger as C, Panel as w, PanelActionButton as T, PanelActionCloseButton as re, PanelBody as ie, PanelContent as E, PanelFooter as ae, PanelHeader as D, PanelProvider as oe, PanelTitle as O, Popover as se, PopoverContent as ce, PopoverTrigger as le, ScrollArea as ue, SelectField as k, Skeleton as de, Tooltip as A, Typography as j, listItemVariants as fe, panelBodyPadding as pe, useIsResolution as me } from "@swisper.ai/ui";
|
|
2
2
|
import { cn as M, useElementMeasure as he } from "@swisper.ai/web-core";
|
|
3
|
-
import { Children as
|
|
4
|
-
import { Fragment as
|
|
3
|
+
import ge, { Children as _e, cloneElement as ve, createContext as N, forwardRef as P, isValidElement as ye, memo as be, useCallback as F, useContext as I, useEffect as L, useId as xe, useImperativeHandle as Se, useLayoutEffect as R, useMemo as z, useRef as B, useState as V } from "react";
|
|
4
|
+
import { Fragment as Ce, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
5
5
|
import { Slot as W } from "@radix-ui/react-slot";
|
|
6
|
-
import { CodeNode as
|
|
7
|
-
import { $isLinkNode as
|
|
8
|
-
import { $createListItemNode as
|
|
9
|
-
import { LexicalComposer as
|
|
10
|
-
import { ContentEditable as
|
|
11
|
-
import { LexicalErrorBoundary as
|
|
12
|
-
import { HistoryPlugin as
|
|
13
|
-
import { RichTextPlugin as
|
|
14
|
-
import { $createHeadingNode as
|
|
15
|
-
import { useLexicalComposerContext as
|
|
16
|
-
import { $convertFromMarkdownString as
|
|
17
|
-
import { $addUpdateTag as
|
|
18
|
-
import { OnChangePlugin as
|
|
19
|
-
import { createPortal as
|
|
20
|
-
import { useVirtualizer as
|
|
21
|
-
import * as
|
|
22
|
-
import { nanoid as
|
|
23
|
-
import { AttachmentsIcon as
|
|
24
|
-
import
|
|
25
|
-
import { Streamdown as
|
|
26
|
-
import
|
|
6
|
+
import { CodeNode as we } from "@lexical/code";
|
|
7
|
+
import { $isLinkNode as Te, LinkNode as Ee, TOGGLE_LINK_COMMAND as De } from "@lexical/link";
|
|
8
|
+
import { $createListItemNode as Oe, $createListNode as ke, ListItemNode as Ae, ListNode as je } from "@lexical/list";
|
|
9
|
+
import { LexicalComposer as Me } from "@lexical/react/LexicalComposer";
|
|
10
|
+
import { ContentEditable as Ne } from "@lexical/react/LexicalContentEditable";
|
|
11
|
+
import { LexicalErrorBoundary as Pe } from "@lexical/react/LexicalErrorBoundary";
|
|
12
|
+
import { HistoryPlugin as Fe } from "@lexical/react/LexicalHistoryPlugin";
|
|
13
|
+
import { RichTextPlugin as Ie } from "@lexical/react/LexicalRichTextPlugin";
|
|
14
|
+
import { $createHeadingNode as Le, HeadingNode as Re, QuoteNode as ze } from "@lexical/rich-text";
|
|
15
|
+
import { useLexicalComposerContext as Be } from "@lexical/react/LexicalComposerContext";
|
|
16
|
+
import { $convertFromMarkdownString as Ve, $convertToMarkdownString as He, TRANSFORMERS as Ue, TRANSFORMERS as We } from "@lexical/markdown";
|
|
17
|
+
import { $addUpdateTag as Ge, $createParagraphNode as Ke, $createRangeSelection as qe, $createTextNode as Je, $getPreviousSelection as Ye, $getRoot as G, $getSelection as K, $insertNodes as Xe, $isElementNode as Ze, $isParagraphNode as Qe, $isRangeSelection as q, $isTextNode as J, $selectAll as $e, $setSelection as et, $setState as tt, COMMAND_PRIORITY_CRITICAL as nt, COMMAND_PRIORITY_EDITOR as rt, COMMAND_PRIORITY_LOW as it, DecoratorNode as at, ElementNode as ot, FORMAT_ELEMENT_COMMAND as st, FORMAT_TEXT_COMMAND as ct, PASTE_COMMAND as lt, SELECTION_CHANGE_COMMAND as ut, SKIP_DOM_SELECTION_TAG as dt, SKIP_SELECTION_FOCUS_TAG as ft, createCommand as pt, createState as mt, isHTMLElement as ht, setNodeIndentFromDOM as gt } from "lexical";
|
|
18
|
+
import { OnChangePlugin as _t } from "@lexical/react/LexicalOnChangePlugin";
|
|
19
|
+
import { createPortal as vt } from "react-dom";
|
|
20
|
+
import { useVirtualizer as yt } from "@tanstack/react-virtual";
|
|
21
|
+
import * as bt from "@radix-ui/react-scroll-area";
|
|
22
|
+
import { nanoid as xt } from "nanoid";
|
|
23
|
+
import { AttachmentsIcon as St, ChevronDownIcon as Ct, ChevronUpIcon as wt, CloseIcon as Tt, CodeIcon as Et, DeleteIcon as Dt, DocIcon as Ot, DraftIcon as kt, FormatAlignCenterIcon as At, FormatAlignLeftIcon as jt, FormatAlignRightIcon as Mt, FormatBoldIcon as Nt, FormatCleanIcon as Pt, FormatColorIcon as Ft, FormatItalicIcon as It, FormatUnderlineIcon as Lt, ImageIcon as Rt, LinkOffIcon as zt, LinkOnIcon as Bt, MoreHorizontalIcon as Vt, OpenInFullIcon as Ht, PdfIcon as Ut, PptIcon as Wt, SignalReadIcon as Gt, SignalUnreadIcon as Kt, SnoozeIcon as qt, XlsIcon as Jt } from "@swisper.ai/icons";
|
|
24
|
+
import Yt from "mime";
|
|
25
|
+
import { Streamdown as Xt, defaultRehypePlugins as Zt, defaultRemarkPlugins as Qt } from "streamdown";
|
|
26
|
+
import $t, { defaultSchema as en } from "rehype-sanitize";
|
|
27
27
|
import "katex/dist/katex.min.css";
|
|
28
|
-
import { MessageScroller as
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import { $
|
|
28
|
+
import { MessageScroller as tn, useMessageScroller as nn, useMessageScrollerScrollable as rn } from "@shadcn/react/message-scroller";
|
|
29
|
+
import { AnimatePresence as an, motion as on, useIsPresent as sn, useReducedMotion as cn } from "motion/react";
|
|
30
|
+
import { TablePlugin as ln } from "@lexical/react/LexicalTablePlugin";
|
|
31
|
+
import { TableCellNode as un, TableNode as dn, TableRowNode as fn } from "@lexical/table";
|
|
32
|
+
import { $generateHtmlFromNodes as pn, $generateNodesFromDOM as mn } from "@lexical/html";
|
|
33
|
+
import { EditorRefPlugin as hn } from "@lexical/react/LexicalEditorRefPlugin";
|
|
34
|
+
import { $getNearestBlockElementAncestorOrThrow as gn, mergeRegister as _n } from "@lexical/utils";
|
|
35
|
+
import { $forEachSelectedTextNode as vn, $getSelectionStyleValueForProperty as yn, $isAtNodeEnd as bn, $patchStyleText as xn } from "@lexical/selection";
|
|
35
36
|
import "@lexical/react/LexicalDecoratorBlockNode";
|
|
36
|
-
import
|
|
37
|
-
import { cva as
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import { unified as
|
|
41
|
-
import { visit as
|
|
42
|
-
import { createParser as
|
|
37
|
+
import Sn from "inline-style-parser";
|
|
38
|
+
import { cva as Cn } from "class-variance-authority";
|
|
39
|
+
import wn from "remark-gfm";
|
|
40
|
+
import Tn from "remark-parse";
|
|
41
|
+
import { unified as En } from "unified";
|
|
42
|
+
import { visit as Dn } from "unist-util-visit";
|
|
43
|
+
import { createParser as On } from "eventsource-parser";
|
|
43
44
|
//#region src/components/chat-card/context.tsx
|
|
44
|
-
var
|
|
45
|
+
var kn = N(null);
|
|
45
46
|
function Y() {
|
|
46
|
-
let e = I(
|
|
47
|
+
let e = I(kn);
|
|
47
48
|
if (!e) throw Error("[web-chat-ui] useChatCardContext() called outside ChatCard. Wrap this component in <ChatCard>, or the provider and the caller resolved two copies of the package.");
|
|
48
49
|
return e;
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
-
return /* @__PURE__ */ H(
|
|
51
|
+
function An({ value: e, children: t }) {
|
|
52
|
+
return /* @__PURE__ */ H(kn.Provider, {
|
|
52
53
|
value: e,
|
|
53
54
|
children: t
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
//#endregion
|
|
57
58
|
//#region src/components/chat-card/components/chat-card-header.tsx
|
|
58
|
-
function
|
|
59
|
+
function jn({ className: e, children: t, hoverAreaClassName: n, ...r }) {
|
|
59
60
|
let { isCollapsible: i, level: a } = Y(), o = /* @__PURE__ */ H("div", {
|
|
60
61
|
"data-slot": "chat-card-header-hover-area",
|
|
61
62
|
className: M("w-full", "flex flex-row items-start", "gap-card-header-gap", a === 1 && "px-card-header-hover-area rounded-card-header", a === 1 && i && "hover:bg-layout-accent-low-background-hover-base", a === 1 && "group-hover/chat-card:bg-layout-accent-low-background-hover-base", !i && "cursor-default", n),
|
|
@@ -74,7 +75,7 @@ function Tn({ className: e, children: t, hoverAreaClassName: n, ...r }) {
|
|
|
74
75
|
}) : o
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
+
function Mn({ className: e, children: t, ...n }) {
|
|
78
79
|
let { level: r } = Y();
|
|
79
80
|
return /* @__PURE__ */ H("div", {
|
|
80
81
|
"data-slot": "chat-card-icon",
|
|
@@ -85,7 +86,7 @@ function En({ className: e, children: t, ...n }) {
|
|
|
85
86
|
children: t
|
|
86
87
|
});
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
+
function Nn({ className: e, children: t, ...n }) {
|
|
89
90
|
let { level: r } = Y();
|
|
90
91
|
return /* @__PURE__ */ H("div", {
|
|
91
92
|
"data-slot": "chat-card-header-content",
|
|
@@ -96,7 +97,7 @@ function Dn({ className: e, children: t, ...n }) {
|
|
|
96
97
|
children: t
|
|
97
98
|
});
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
+
function Pn({ className: e, children: t, ...n }) {
|
|
100
101
|
return /* @__PURE__ */ H(j, {
|
|
101
102
|
"data-testid": "chat-card-title",
|
|
102
103
|
variant: "body-medium",
|
|
@@ -105,7 +106,7 @@ function On({ className: e, children: t, ...n }) {
|
|
|
105
106
|
children: t
|
|
106
107
|
});
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
+
function Fn({ className: e, children: t, ...n }) {
|
|
109
110
|
return /* @__PURE__ */ H(j, {
|
|
110
111
|
"data-testid": "chat-card-sub-title",
|
|
111
112
|
variant: "body-small-high",
|
|
@@ -114,7 +115,7 @@ function kn({ className: e, children: t, ...n }) {
|
|
|
114
115
|
children: t
|
|
115
116
|
});
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
+
function In({ className: e, children: t, ...n }) {
|
|
118
119
|
let { level: r } = Y();
|
|
119
120
|
return /* @__PURE__ */ H("div", {
|
|
120
121
|
role: "group",
|
|
@@ -126,7 +127,7 @@ function An({ className: e, children: t, ...n }) {
|
|
|
126
127
|
children: t
|
|
127
128
|
});
|
|
128
129
|
}
|
|
129
|
-
function
|
|
130
|
+
function Ln({ className: e, children: t, shouldPreventCollapse: n = !0, tooltip: r, onClick: i, ...a }) {
|
|
130
131
|
function o(e) {
|
|
131
132
|
n && e.stopPropagation(), i?.(e);
|
|
132
133
|
}
|
|
@@ -144,9 +145,9 @@ function jn({ className: e, children: t, shouldPreventCollapse: n = !0, tooltip:
|
|
|
144
145
|
children: s
|
|
145
146
|
}) : s;
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
+
function Rn({ className: e, ...t }) {
|
|
148
149
|
let { isCollapsible: n } = Y();
|
|
149
|
-
if (n) return /* @__PURE__ */ H(
|
|
150
|
+
if (n) return /* @__PURE__ */ H(Ln, {
|
|
150
151
|
"data-slot": "chat-card-collapsible-button",
|
|
151
152
|
shouldPreventCollapse: !1,
|
|
152
153
|
isSemantic: !1,
|
|
@@ -157,7 +158,7 @@ function Mn({ className: e, ...t }) {
|
|
|
157
158
|
}
|
|
158
159
|
//#endregion
|
|
159
160
|
//#region src/components/chat-card/components/chat-card-body.tsx
|
|
160
|
-
function
|
|
161
|
+
function zn({ className: e, children: t, ...n }) {
|
|
161
162
|
return /* @__PURE__ */ H("figure", {
|
|
162
163
|
"data-slot": "chat-card-media",
|
|
163
164
|
"data-testid": "chat-card-media",
|
|
@@ -166,7 +167,7 @@ function Nn({ className: e, children: t, ...n }) {
|
|
|
166
167
|
children: t
|
|
167
168
|
});
|
|
168
169
|
}
|
|
169
|
-
function
|
|
170
|
+
function Bn({ className: e, children: t, asChild: n = !1, ...r }) {
|
|
170
171
|
let i = n ? W : "div";
|
|
171
172
|
return /* @__PURE__ */ H(l, {
|
|
172
173
|
"data-slot": "chat-card-body",
|
|
@@ -177,7 +178,7 @@ function Pn({ className: e, children: t, asChild: n = !1, ...r }) {
|
|
|
177
178
|
children: /* @__PURE__ */ H(i, { children: t })
|
|
178
179
|
});
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
+
function Vn({ className: e, children: t, asChild: n = !1, hasPadding: r = !0, hasHeaderPadding: i = !0, ...a }) {
|
|
181
182
|
let { level: o } = Y();
|
|
182
183
|
return /* @__PURE__ */ H(n ? W : "div", {
|
|
183
184
|
"data-slot": "chat-card-content",
|
|
@@ -190,7 +191,7 @@ function Fn({ className: e, children: t, asChild: n = !1, hasPadding: r = !0, ha
|
|
|
190
191
|
children: t
|
|
191
192
|
});
|
|
192
193
|
}
|
|
193
|
-
function
|
|
194
|
+
function Hn({ className: e, children: t, ...n }) {
|
|
194
195
|
let { level: r } = Y();
|
|
195
196
|
return /* @__PURE__ */ H("div", {
|
|
196
197
|
"data-slot": "chat-card-preview",
|
|
@@ -203,7 +204,7 @@ function In({ className: e, children: t, ...n }) {
|
|
|
203
204
|
}
|
|
204
205
|
//#endregion
|
|
205
206
|
//#region src/components/chat-card/components/chat-card-footer.tsx
|
|
206
|
-
function
|
|
207
|
+
function Un({ className: e, children: t, ...n }) {
|
|
207
208
|
let { level: r } = Y();
|
|
208
209
|
return /* @__PURE__ */ H("footer", {
|
|
209
210
|
"data-slot": "chat-card-footer",
|
|
@@ -213,7 +214,7 @@ function Ln({ className: e, children: t, ...n }) {
|
|
|
213
214
|
children: t
|
|
214
215
|
});
|
|
215
216
|
}
|
|
216
|
-
function
|
|
217
|
+
function Wn({ className: e, children: t }) {
|
|
217
218
|
return /* @__PURE__ */ H("div", {
|
|
218
219
|
"data-slot": "chat-card-footer-notes",
|
|
219
220
|
"data-testid": "chat-card-footer-notes",
|
|
@@ -221,7 +222,7 @@ function Rn({ className: e, children: t }) {
|
|
|
221
222
|
children: t
|
|
222
223
|
});
|
|
223
224
|
}
|
|
224
|
-
function
|
|
225
|
+
function Gn({ className: e, children: t }) {
|
|
225
226
|
return /* @__PURE__ */ H("div", {
|
|
226
227
|
"data-slot": "chat-card-footer-price",
|
|
227
228
|
"data-testid": "chat-card-footer-price",
|
|
@@ -229,7 +230,7 @@ function zn({ className: e, children: t }) {
|
|
|
229
230
|
children: t
|
|
230
231
|
});
|
|
231
232
|
}
|
|
232
|
-
function
|
|
233
|
+
function Kn({ className: e, children: t, ...n }) {
|
|
233
234
|
return /* @__PURE__ */ H("div", {
|
|
234
235
|
role: "group",
|
|
235
236
|
"data-slot": "chat-card-footer-actions",
|
|
@@ -241,7 +242,7 @@ function Bn({ className: e, children: t, ...n }) {
|
|
|
241
242
|
}
|
|
242
243
|
//#endregion
|
|
243
244
|
//#region src/components/chat-card/components/chat-card-form.tsx
|
|
244
|
-
var
|
|
245
|
+
var qn = P(function({ className: e, children: t, asChild: n, ...r }, i) {
|
|
245
246
|
return /* @__PURE__ */ H(n ? W : "form", {
|
|
246
247
|
ref: i,
|
|
247
248
|
"data-slot": "chat-card-form",
|
|
@@ -251,8 +252,8 @@ var Vn = P(function({ className: e, children: t, asChild: n, ...r }, i) {
|
|
|
251
252
|
children: t
|
|
252
253
|
});
|
|
253
254
|
});
|
|
254
|
-
|
|
255
|
-
function
|
|
255
|
+
qn.displayName = "ChatCardForm";
|
|
256
|
+
function Jn({ className: e, children: t }) {
|
|
256
257
|
return /* @__PURE__ */ H("ul", {
|
|
257
258
|
"data-slot": "chat-card-attributes",
|
|
258
259
|
"data-testid": "chat-card-attributes",
|
|
@@ -260,7 +261,7 @@ function Hn({ className: e, children: t }) {
|
|
|
260
261
|
children: t
|
|
261
262
|
});
|
|
262
263
|
}
|
|
263
|
-
function
|
|
264
|
+
function Yn({ className: e, children: t, ...n }) {
|
|
264
265
|
return /* @__PURE__ */ H("li", {
|
|
265
266
|
"data-slot": "chat-card-attribute",
|
|
266
267
|
"data-testid": "chat-card-attribute-item",
|
|
@@ -269,7 +270,7 @@ function Un({ className: e, children: t, ...n }) {
|
|
|
269
270
|
children: t
|
|
270
271
|
});
|
|
271
272
|
}
|
|
272
|
-
function
|
|
273
|
+
function Xn({ className: e, children: t, hasPadding: n = !1, ...r }) {
|
|
273
274
|
return /* @__PURE__ */ H(o, {
|
|
274
275
|
variant: "outlined",
|
|
275
276
|
size: "md",
|
|
@@ -282,7 +283,7 @@ function Wn({ className: e, children: t, hasPadding: n = !1, ...r }) {
|
|
|
282
283
|
children: t
|
|
283
284
|
});
|
|
284
285
|
}
|
|
285
|
-
function
|
|
286
|
+
function Zn({ className: e, children: t, asChild: n = !1, ...r }) {
|
|
286
287
|
return /* @__PURE__ */ H(n ? W : j, {
|
|
287
288
|
"data-testid": "chat-card-attribute-value",
|
|
288
289
|
variant: "body-sm",
|
|
@@ -293,7 +294,7 @@ function Gn({ className: e, children: t, asChild: n = !1, ...r }) {
|
|
|
293
294
|
}
|
|
294
295
|
//#endregion
|
|
295
296
|
//#region src/components/chat-card/chat-card.tsx
|
|
296
|
-
var
|
|
297
|
+
var Qn = P(function({ className: e, variant: t = "default", level: n = 1, children: r, fullWidth: i = !1, defaultOpen: a = !0, open: o, isRounded: c = !0, isCollapsible: l = !0, isSelected: u = !1, onOpenChange: d, onClick: f, ...p }, m) {
|
|
297
298
|
let h = o !== void 0, [g, _] = V(a), v = h ? o : g, y = F((e) => {
|
|
298
299
|
h || _(e), d?.(e);
|
|
299
300
|
}, [h, d]), b = z(() => ({
|
|
@@ -308,7 +309,7 @@ var Kn = P(function({ className: e, variant: t = "default", level: n = 1, childr
|
|
|
308
309
|
function x(e) {
|
|
309
310
|
f?.(e), !e.defaultPrevented && l && !v && y(!0);
|
|
310
311
|
}
|
|
311
|
-
return /* @__PURE__ */ H(
|
|
312
|
+
return /* @__PURE__ */ H(An, {
|
|
312
313
|
value: b,
|
|
313
314
|
children: /* @__PURE__ */ H(s, {
|
|
314
315
|
isDisabled: !l,
|
|
@@ -335,10 +336,10 @@ var Kn = P(function({ className: e, variant: t = "default", level: n = 1, childr
|
|
|
335
336
|
})
|
|
336
337
|
});
|
|
337
338
|
});
|
|
338
|
-
|
|
339
|
+
Qn.displayName = "ChatCard";
|
|
339
340
|
//#endregion
|
|
340
341
|
//#region src/components/chat-card/hooks.ts
|
|
341
|
-
function
|
|
342
|
+
function $n({ isEditable: e, defaultEditing: t = !1 }) {
|
|
342
343
|
let [n, r] = V(t);
|
|
343
344
|
function i() {
|
|
344
345
|
return e ? !0 : (console.warn("Chat card is not editable"), !1);
|
|
@@ -362,25 +363,25 @@ function qn({ isEditable: e, defaultEditing: t = !1 }) {
|
|
|
362
363
|
}
|
|
363
364
|
//#endregion
|
|
364
365
|
//#region src/components/chat-card/contexts.tsx
|
|
365
|
-
var
|
|
366
|
-
function
|
|
367
|
-
let e = I(
|
|
366
|
+
var er = N(null);
|
|
367
|
+
function tr() {
|
|
368
|
+
let e = I(er);
|
|
368
369
|
if (!e) throw Error("\"useEditableChatCardContext\" must be used within a EditableChatCardContextProvider");
|
|
369
370
|
return e;
|
|
370
371
|
}
|
|
371
|
-
function
|
|
372
|
-
let r =
|
|
372
|
+
function nr({ children: e, defaultEditing: t = !1, isEditable: n = !1 }) {
|
|
373
|
+
let r = $n({
|
|
373
374
|
isEditable: n,
|
|
374
375
|
defaultEditing: t
|
|
375
376
|
});
|
|
376
|
-
return /* @__PURE__ */ H(
|
|
377
|
+
return /* @__PURE__ */ H(er.Provider, {
|
|
377
378
|
value: r,
|
|
378
379
|
children: e
|
|
379
380
|
});
|
|
380
381
|
}
|
|
381
382
|
//#endregion
|
|
382
383
|
//#region src/components/chat-card-container/chat-card-container.tsx
|
|
383
|
-
function
|
|
384
|
+
function rr({ children: e, variant: t = "fixed", inline: n = !1, className: r, ...i }) {
|
|
384
385
|
return /* @__PURE__ */ H("div", {
|
|
385
386
|
"data-slot": "chat-card-container",
|
|
386
387
|
"data-testid": "chat-card-container",
|
|
@@ -393,20 +394,20 @@ function Zn({ children: e, variant: t = "fixed", inline: n = !1, className: r, .
|
|
|
393
394
|
}
|
|
394
395
|
//#endregion
|
|
395
396
|
//#region src/components/chat-container/chat-container.tsx
|
|
396
|
-
var
|
|
397
|
+
var ir = "var(--spacing-chat-area)", ar = {
|
|
397
398
|
prompt: "--type-window-height",
|
|
398
399
|
welcome: "--welcome-screen-box-height"
|
|
399
400
|
};
|
|
400
|
-
function
|
|
401
|
+
function or(e) {
|
|
401
402
|
return e === "unset" ? "unset" : `${e}px`;
|
|
402
403
|
}
|
|
403
|
-
var
|
|
404
|
-
function
|
|
405
|
-
let e = I(
|
|
404
|
+
var sr = N(null);
|
|
405
|
+
function cr() {
|
|
406
|
+
let e = I(sr);
|
|
406
407
|
if (!e) throw Error("[web-chat-ui] ChatContainer slot rendered outside a ChatContainer. ChatContainerPrompt and ChatContainerWelcome report their measured height up to the container, so one must be mounted above them. If it is mounted, check the slot is not rendered through a portal that escapes the provider.");
|
|
407
408
|
return e;
|
|
408
409
|
}
|
|
409
|
-
function
|
|
410
|
+
function lr({ asChild: e = !1, children: t, className: n, contentWidth: r = ir, style: i, ...a }) {
|
|
410
411
|
let o = e ? W : "section", { ref: s, width: c, height: l } = he(), [u, d] = V({
|
|
411
412
|
prompt: "unset",
|
|
412
413
|
welcome: "unset"
|
|
@@ -419,8 +420,8 @@ function rr({ asChild: e = !1, children: t, className: n, contentWidth: r = Qn,
|
|
|
419
420
|
"--chat-window-width": c === "unset" ? "100%" : `${c}px`,
|
|
420
421
|
"--chat-window-height": l === "unset" ? "100%" : `${l}px`,
|
|
421
422
|
"--message-list-content-width": `min(${r}, var(--chat-window-width))`,
|
|
422
|
-
[
|
|
423
|
-
[
|
|
423
|
+
[ar.prompt]: or(u.prompt),
|
|
424
|
+
[ar.welcome]: or(u.welcome),
|
|
424
425
|
...i
|
|
425
426
|
}), [
|
|
426
427
|
c,
|
|
@@ -429,7 +430,7 @@ function rr({ asChild: e = !1, children: t, className: n, contentWidth: r = Qn,
|
|
|
429
430
|
u,
|
|
430
431
|
i
|
|
431
432
|
]);
|
|
432
|
-
return /* @__PURE__ */ H(
|
|
433
|
+
return /* @__PURE__ */ H(sr.Provider, {
|
|
433
434
|
value: p,
|
|
434
435
|
children: /* @__PURE__ */ H(o, {
|
|
435
436
|
ref: s,
|
|
@@ -442,16 +443,16 @@ function rr({ asChild: e = !1, children: t, className: n, contentWidth: r = Qn,
|
|
|
442
443
|
})
|
|
443
444
|
});
|
|
444
445
|
}
|
|
445
|
-
function
|
|
446
|
-
let { setSlotHeight: t } =
|
|
446
|
+
function ur(e) {
|
|
447
|
+
let { setSlotHeight: t } = cr(), { ref: n, height: r } = he();
|
|
447
448
|
return R(() => (t(e, r), () => t(e, "unset")), [
|
|
448
449
|
e,
|
|
449
450
|
r,
|
|
450
451
|
t
|
|
451
452
|
]), n;
|
|
452
453
|
}
|
|
453
|
-
function
|
|
454
|
-
let i =
|
|
454
|
+
function dr({ asChild: e = !1, children: t, className: n, ...r }) {
|
|
455
|
+
let i = ur("prompt");
|
|
455
456
|
return /* @__PURE__ */ H(e ? W : "div", {
|
|
456
457
|
ref: i,
|
|
457
458
|
"data-slot": "chat-container-prompt",
|
|
@@ -461,8 +462,8 @@ function ar({ asChild: e = !1, children: t, className: n, ...r }) {
|
|
|
461
462
|
children: t
|
|
462
463
|
});
|
|
463
464
|
}
|
|
464
|
-
function
|
|
465
|
-
let i =
|
|
465
|
+
function fr({ asChild: e = !1, children: t, className: n, ...r }) {
|
|
466
|
+
let i = ur("welcome");
|
|
466
467
|
return /* @__PURE__ */ H(e ? W : "div", {
|
|
467
468
|
ref: i,
|
|
468
469
|
"data-slot": "chat-container-welcome",
|
|
@@ -474,8 +475,8 @@ function or({ asChild: e = !1, children: t, className: n, ...r }) {
|
|
|
474
475
|
}
|
|
475
476
|
//#endregion
|
|
476
477
|
//#region src/components/chat-input/plugins/auto-focus-plugin.tsx
|
|
477
|
-
function
|
|
478
|
-
let [r] =
|
|
478
|
+
function pr({ defaultSelection: e = "rootEnd", autoFocus: t, isDisabled: n }) {
|
|
479
|
+
let [r] = Be();
|
|
479
480
|
return L(() => {
|
|
480
481
|
t && !n && r.focus(() => {
|
|
481
482
|
let e = document.activeElement, t = r.getRootElement();
|
|
@@ -490,36 +491,36 @@ function sr({ defaultSelection: e = "rootEnd", autoFocus: t, isDisabled: n }) {
|
|
|
490
491
|
}
|
|
491
492
|
//#endregion
|
|
492
493
|
//#region src/components/chat-input/transformers.ts
|
|
493
|
-
var
|
|
494
|
+
var mr = Ue, hr = Ue;
|
|
494
495
|
//#endregion
|
|
495
496
|
//#region src/components/chat-input/plugins/hooks.ts
|
|
496
|
-
function
|
|
497
|
-
let [e] =
|
|
497
|
+
function gr() {
|
|
498
|
+
let [e] = Be();
|
|
498
499
|
return e;
|
|
499
500
|
}
|
|
500
501
|
//#endregion
|
|
501
502
|
//#region src/components/chat-input/plugins/utils.ts
|
|
502
|
-
function
|
|
503
|
+
function _r() {
|
|
503
504
|
return G().getTextContent();
|
|
504
505
|
}
|
|
505
|
-
function
|
|
506
|
+
function vr() {
|
|
506
507
|
let e = G().getLastDescendant();
|
|
507
508
|
if (e && J(e)) {
|
|
508
|
-
let t =
|
|
509
|
-
t.anchor.set(e.getKey(), n, "text"), t.focus.set(e.getKey(), n, "text"),
|
|
509
|
+
let t = qe(), n = e.getTextContentSize();
|
|
510
|
+
t.anchor.set(e.getKey(), n, "text"), t.focus.set(e.getKey(), n, "text"), et(t);
|
|
510
511
|
} else {
|
|
511
|
-
|
|
512
|
+
$e();
|
|
512
513
|
let e = K();
|
|
513
514
|
if (q(e)) {
|
|
514
515
|
let t = e.focus.getNode(), n = J(t) ? t.getTextContentSize() : 0;
|
|
515
|
-
e.anchor.set(e.focus.key, e.focus.offset, e.focus.type), e.focus.set(e.focus.key, n, e.focus.type),
|
|
516
|
+
e.anchor.set(e.focus.key, e.focus.offset, e.focus.type), e.focus.set(e.focus.key, n, e.focus.type), et(e);
|
|
516
517
|
}
|
|
517
518
|
}
|
|
518
519
|
}
|
|
519
520
|
//#endregion
|
|
520
521
|
//#region src/components/chat-input/plugins/controlled-value-plugin.tsx
|
|
521
|
-
function
|
|
522
|
-
let n =
|
|
522
|
+
function yr({ value: e, emittedValuesRef: t }) {
|
|
523
|
+
let n = gr(), r = B();
|
|
523
524
|
return L(() => {
|
|
524
525
|
if (!n || e === r.current) return;
|
|
525
526
|
if (r.current = e, t && e !== void 0) {
|
|
@@ -528,9 +529,9 @@ function pr({ value: e, emittedValuesRef: t }) {
|
|
|
528
529
|
}
|
|
529
530
|
let i = "";
|
|
530
531
|
n.getEditorState().read(() => {
|
|
531
|
-
i =
|
|
532
|
+
i = He(mr);
|
|
532
533
|
}), e !== void 0 && e !== i && n.update(() => {
|
|
533
|
-
|
|
534
|
+
Ge(dt), Ve(e ?? "", hr), vr();
|
|
534
535
|
}, { discrete: !0 });
|
|
535
536
|
}, [
|
|
536
537
|
n,
|
|
@@ -540,8 +541,8 @@ function pr({ value: e, emittedValuesRef: t }) {
|
|
|
540
541
|
}
|
|
541
542
|
//#endregion
|
|
542
543
|
//#region src/components/chat-input/plugins/disabled-plugin.tsx
|
|
543
|
-
function
|
|
544
|
-
let n =
|
|
544
|
+
function br({ isDisabled: e, isReadOnly: t }) {
|
|
545
|
+
let n = gr();
|
|
545
546
|
return L(() => {
|
|
546
547
|
n.setEditable(!e && !t);
|
|
547
548
|
}, [
|
|
@@ -552,8 +553,8 @@ function mr({ isDisabled: e, isReadOnly: t }) {
|
|
|
552
553
|
}
|
|
553
554
|
//#endregion
|
|
554
555
|
//#region src/components/chat-input/plugins/focus-plugin.tsx
|
|
555
|
-
function
|
|
556
|
-
let t =
|
|
556
|
+
function xr({ onFocusChange: e }) {
|
|
557
|
+
let t = gr();
|
|
557
558
|
return L(() => {
|
|
558
559
|
if (!e) return;
|
|
559
560
|
let n = t.getRootElement();
|
|
@@ -571,29 +572,29 @@ function hr({ onFocusChange: e }) {
|
|
|
571
572
|
}
|
|
572
573
|
//#endregion
|
|
573
574
|
//#region src/components/chat-input/plugins/has-value-plugin.tsx
|
|
574
|
-
function
|
|
575
|
+
function Sr(e) {
|
|
575
576
|
let t = !1;
|
|
576
577
|
return e.getEditorState().read(() => {
|
|
577
|
-
t =
|
|
578
|
+
t = _r().length > 0;
|
|
578
579
|
}), t;
|
|
579
580
|
}
|
|
580
|
-
function
|
|
581
|
-
let r =
|
|
581
|
+
function Cr(e, t, n) {
|
|
582
|
+
let r = Sr(e);
|
|
582
583
|
n.current !== r && (n.current = r, t?.(r));
|
|
583
584
|
}
|
|
584
|
-
function
|
|
585
|
-
let t =
|
|
585
|
+
function wr({ onHasValueChange: e }) {
|
|
586
|
+
let t = gr(), n = B();
|
|
586
587
|
return L(() => {
|
|
587
|
-
if (t) return
|
|
588
|
-
|
|
588
|
+
if (t) return Cr(t, e, n), t.registerUpdateListener(() => {
|
|
589
|
+
Cr(t, e, n);
|
|
589
590
|
});
|
|
590
591
|
}, [t, e]), null;
|
|
591
592
|
}
|
|
592
593
|
//#endregion
|
|
593
594
|
//#region src/components/chat-input/plugins/markdown-plain-paste-plugin.tsx
|
|
594
|
-
function
|
|
595
|
-
let e =
|
|
596
|
-
return L(() => e.registerCommand(
|
|
595
|
+
function Tr() {
|
|
596
|
+
let e = gr();
|
|
597
|
+
return L(() => e.registerCommand(lt, (t) => {
|
|
597
598
|
let { clipboardData: n } = t;
|
|
598
599
|
if (!n) return !1;
|
|
599
600
|
let r = n.getData("text/plain");
|
|
@@ -605,46 +606,46 @@ function yr() {
|
|
|
605
606
|
}
|
|
606
607
|
let t = G();
|
|
607
608
|
t.clear(), r.split(/\r?\n/).forEach((e) => {
|
|
608
|
-
let n =
|
|
609
|
-
e.length > 0 && n.append(
|
|
609
|
+
let n = Ke();
|
|
610
|
+
e.length > 0 && n.append(Je(e)), t.append(n);
|
|
610
611
|
});
|
|
611
612
|
}), !0) : !1;
|
|
612
|
-
},
|
|
613
|
+
}, nt), [e]), null;
|
|
613
614
|
}
|
|
614
615
|
//#endregion
|
|
615
616
|
//#region src/components/chat-input/plugins/value-plugin.tsx
|
|
616
|
-
var
|
|
617
|
-
function
|
|
617
|
+
var Er = 50;
|
|
618
|
+
function Dr({ onChange: e, emittedValuesRef: t }) {
|
|
618
619
|
let n = F((n, r, i) => {
|
|
619
620
|
if (!i.has("focus") && e) try {
|
|
620
621
|
n.read(() => {
|
|
621
|
-
let n =
|
|
622
|
-
t && (t.current.push(n), t.current.splice(0, t.current.length -
|
|
622
|
+
let n = He(mr);
|
|
623
|
+
t && (t.current.push(n), t.current.splice(0, t.current.length - Er)), e(n);
|
|
623
624
|
});
|
|
624
625
|
} catch (e) {
|
|
625
626
|
console.error("ValuePlugin error:", e);
|
|
626
627
|
}
|
|
627
628
|
}, [e, t]);
|
|
628
|
-
return /* @__PURE__ */ H(
|
|
629
|
+
return /* @__PURE__ */ H(_t, { onChange: n });
|
|
629
630
|
}
|
|
630
631
|
//#endregion
|
|
631
632
|
//#region src/components/chat-input/chat-input.tsx
|
|
632
|
-
var
|
|
633
|
-
function
|
|
634
|
-
let e = I(
|
|
633
|
+
var Or = N(null);
|
|
634
|
+
function kr() {
|
|
635
|
+
let e = I(Or);
|
|
635
636
|
if (!e) throw Error("\"useChatInputContext\" must be used within a ChatInputContextProvider");
|
|
636
637
|
return e;
|
|
637
638
|
}
|
|
638
|
-
var
|
|
639
|
+
var Ar = {
|
|
639
640
|
namespace: "chat-input",
|
|
640
641
|
editable: !0,
|
|
641
642
|
nodes: [
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
643
|
+
Re,
|
|
644
|
+
ze,
|
|
645
|
+
je,
|
|
646
|
+
Ae,
|
|
647
|
+
we,
|
|
648
|
+
Ee
|
|
648
649
|
],
|
|
649
650
|
theme: {
|
|
650
651
|
paragraph: "m-0 min-h-[26px]",
|
|
@@ -657,7 +658,7 @@ var wr = {
|
|
|
657
658
|
onError: (e) => {
|
|
658
659
|
console.error("ChatInput Lexical error:", e);
|
|
659
660
|
}
|
|
660
|
-
},
|
|
661
|
+
}, jr = P(function({ className: e, children: t, initialConfig: n = Ar, ...r }, i) {
|
|
661
662
|
let [a, o] = V(!1), [s, c] = V(!1), [l, u] = V(!1), d = z(() => ({
|
|
662
663
|
hasError: a,
|
|
663
664
|
hasValue: s,
|
|
@@ -670,9 +671,9 @@ var wr = {
|
|
|
670
671
|
s,
|
|
671
672
|
l
|
|
672
673
|
]);
|
|
673
|
-
return /* @__PURE__ */ H(
|
|
674
|
+
return /* @__PURE__ */ H(Or.Provider, {
|
|
674
675
|
value: d,
|
|
675
|
-
children: /* @__PURE__ */ H(
|
|
676
|
+
children: /* @__PURE__ */ H(Me, {
|
|
676
677
|
initialConfig: n,
|
|
677
678
|
children: /* @__PURE__ */ H("div", {
|
|
678
679
|
ref: i,
|
|
@@ -689,8 +690,8 @@ var wr = {
|
|
|
689
690
|
})
|
|
690
691
|
});
|
|
691
692
|
});
|
|
692
|
-
|
|
693
|
-
var
|
|
693
|
+
jr.displayName = "ChatInput";
|
|
694
|
+
var Mr = P(function({ className: e, children: t, ...n }, r) {
|
|
694
695
|
return /* @__PURE__ */ H(j, {
|
|
695
696
|
ref: r,
|
|
696
697
|
variant: "body",
|
|
@@ -703,9 +704,9 @@ var Er = P(function({ className: e, children: t, ...n }, r) {
|
|
|
703
704
|
})
|
|
704
705
|
});
|
|
705
706
|
});
|
|
706
|
-
|
|
707
|
-
var
|
|
708
|
-
let { setHasValue: p, setIsFocused: m } =
|
|
707
|
+
Mr.displayName = "ChatInputPlaceholder";
|
|
708
|
+
var Nr = P(function({ className: e, style: t, placeholderClassName: n, placeholder: r = "Input your message...", children: i, value: a, autoFocus: o = !0, isDisabled: s = !1, isReadOnly: c = !1, onChange: l, onKeyDown: u, ...d }, f) {
|
|
709
|
+
let { setHasValue: p, setIsFocused: m } = kr(), h = c && !s, g = B([]);
|
|
709
710
|
return /* @__PURE__ */ U("div", {
|
|
710
711
|
"data-slot": "chat-input-textarea",
|
|
711
712
|
"data-testid": "chat-input-textarea",
|
|
@@ -717,38 +718,38 @@ var Dr = P(function({ className: e, style: t, placeholderClassName: n, placehold
|
|
|
717
718
|
style: t,
|
|
718
719
|
...d,
|
|
719
720
|
children: [
|
|
720
|
-
/* @__PURE__ */ H(
|
|
721
|
-
contentEditable: /* @__PURE__ */ H(
|
|
721
|
+
/* @__PURE__ */ H(Ie, {
|
|
722
|
+
contentEditable: /* @__PURE__ */ H(Ne, {
|
|
722
723
|
ref: f,
|
|
723
724
|
"data-slot": "chat-input-editable",
|
|
724
725
|
className: M("min-h-[26px]!", "overflow-y-auto text-wrap outline-none", e),
|
|
725
726
|
"aria-label": "Chat input",
|
|
726
727
|
"aria-placeholder": r,
|
|
727
|
-
placeholder: /* @__PURE__ */ H(
|
|
728
|
+
placeholder: /* @__PURE__ */ H(Mr, {
|
|
728
729
|
className: n,
|
|
729
730
|
children: r
|
|
730
731
|
}),
|
|
731
732
|
onKeyDown: u
|
|
732
733
|
}),
|
|
733
|
-
ErrorBoundary:
|
|
734
|
+
ErrorBoundary: Pe
|
|
734
735
|
}),
|
|
735
|
-
/* @__PURE__ */ H(
|
|
736
|
-
/* @__PURE__ */ H(
|
|
736
|
+
/* @__PURE__ */ H(Fe, {}),
|
|
737
|
+
/* @__PURE__ */ H(br, {
|
|
737
738
|
isDisabled: s,
|
|
738
739
|
isReadOnly: c
|
|
739
740
|
}),
|
|
740
|
-
/* @__PURE__ */ H(
|
|
741
|
+
/* @__PURE__ */ H(yr, {
|
|
741
742
|
value: a,
|
|
742
743
|
emittedValuesRef: g
|
|
743
744
|
}),
|
|
744
|
-
/* @__PURE__ */ H(
|
|
745
|
+
/* @__PURE__ */ H(Dr, {
|
|
745
746
|
onChange: l,
|
|
746
747
|
emittedValuesRef: g
|
|
747
748
|
}),
|
|
748
|
-
/* @__PURE__ */ H(
|
|
749
|
-
/* @__PURE__ */ H(
|
|
750
|
-
/* @__PURE__ */ H(
|
|
751
|
-
/* @__PURE__ */ H(
|
|
749
|
+
/* @__PURE__ */ H(Tr, {}),
|
|
750
|
+
/* @__PURE__ */ H(wr, { onHasValueChange: p }),
|
|
751
|
+
/* @__PURE__ */ H(xr, { onFocusChange: m }),
|
|
752
|
+
/* @__PURE__ */ H(pr, {
|
|
752
753
|
autoFocus: o,
|
|
753
754
|
isDisabled: s || c
|
|
754
755
|
}),
|
|
@@ -756,16 +757,16 @@ var Dr = P(function({ className: e, style: t, placeholderClassName: n, placehold
|
|
|
756
757
|
]
|
|
757
758
|
});
|
|
758
759
|
});
|
|
759
|
-
|
|
760
|
+
Nr.displayName = "ChatInputTextarea";
|
|
760
761
|
//#endregion
|
|
761
762
|
//#region src/components/chat-list/chat-list.tsx
|
|
762
|
-
var
|
|
763
|
-
function
|
|
764
|
-
let e = I(
|
|
763
|
+
var Pr = N(null);
|
|
764
|
+
function Fr() {
|
|
765
|
+
let e = I(Pr);
|
|
765
766
|
if (!e) throw Error("\"useChatListContext\" must be used within a ChatList");
|
|
766
767
|
return e;
|
|
767
768
|
}
|
|
768
|
-
function
|
|
769
|
+
function Ir({ children: e, className: t, loadedCount: n, totalCount: r, hasMore: i, isLoading: a = !1, isLoadingMore: o = !1, hasError: s = !1, onLoadMore: c, getItemKey: l, "aria-label": u = "Chat list" }) {
|
|
769
770
|
let d = B(null), f = B(null), [p, m] = V(0), [h, g] = V(null), [, _] = V(0), v = F((e) => {
|
|
770
771
|
d.current = e, _((e) => e + 1);
|
|
771
772
|
}, []), y = F(() => {
|
|
@@ -802,7 +803,7 @@ function Ar({ children: e, className: t, loadedCount: n, totalCount: r, hasMore:
|
|
|
802
803
|
y,
|
|
803
804
|
h
|
|
804
805
|
]);
|
|
805
|
-
return /* @__PURE__ */ H(
|
|
806
|
+
return /* @__PURE__ */ H(Pr.Provider, {
|
|
806
807
|
value: S,
|
|
807
808
|
children: /* @__PURE__ */ H("div", {
|
|
808
809
|
"data-slot": "chat-list",
|
|
@@ -818,10 +819,10 @@ function Ar({ children: e, className: t, loadedCount: n, totalCount: r, hasMore:
|
|
|
818
819
|
})
|
|
819
820
|
});
|
|
820
821
|
}
|
|
821
|
-
var
|
|
822
|
-
function
|
|
823
|
-
let { isLoading: i, loadedCount: a, skeletonContainer: o } =
|
|
824
|
-
return !(i && a === 0) || !o ? null :
|
|
822
|
+
var Lr = ["w-2/3", "w-1/2"], Rr = ["w-full", "w-4/5"];
|
|
823
|
+
function zr({ children: e, rows: t = 16, className: n, rowClassName: r }) {
|
|
824
|
+
let { isLoading: i, loadedCount: a, skeletonContainer: o } = Fr();
|
|
825
|
+
return !(i && a === 0) || !o ? null : vt(/* @__PURE__ */ H("div", {
|
|
825
826
|
"data-slot": "chat-list-skeleton",
|
|
826
827
|
"data-testid": "chat-list-skeleton",
|
|
827
828
|
role: "status",
|
|
@@ -833,16 +834,16 @@ function Nr({ children: e, rows: t = 16, className: n, rowClassName: r }) {
|
|
|
833
834
|
className: M("flex shrink-0 flex-col gap-4 px-12 py-8", r),
|
|
834
835
|
children: [/* @__PURE__ */ H("div", {
|
|
835
836
|
className: "flex h-20 items-center",
|
|
836
|
-
children: /* @__PURE__ */ H(de, { className: M("h-12",
|
|
837
|
+
children: /* @__PURE__ */ H(de, { className: M("h-12", Lr[t % 2]) })
|
|
837
838
|
}), /* @__PURE__ */ H("div", {
|
|
838
839
|
className: "flex h-16 items-center",
|
|
839
|
-
children: /* @__PURE__ */ H(de, { className: M("h-10",
|
|
840
|
+
children: /* @__PURE__ */ H(de, { className: M("h-10", Rr[t % 2]) })
|
|
840
841
|
})]
|
|
841
842
|
}, t))
|
|
842
843
|
}), o);
|
|
843
844
|
}
|
|
844
|
-
function
|
|
845
|
-
let { isEmpty: n } =
|
|
845
|
+
function Br({ children: e, className: t }) {
|
|
846
|
+
let { isEmpty: n } = Fr();
|
|
846
847
|
return n ? /* @__PURE__ */ H("div", {
|
|
847
848
|
"data-slot": "chat-list-empty-state",
|
|
848
849
|
"data-testid": "chat-list-empty-state",
|
|
@@ -853,8 +854,8 @@ function Pr({ children: e, className: t }) {
|
|
|
853
854
|
children: e
|
|
854
855
|
}) : null;
|
|
855
856
|
}
|
|
856
|
-
function
|
|
857
|
-
let { hasError: i, loadedCount: a } =
|
|
857
|
+
function Vr({ children: e, error: t, className: n, messageClassName: r }) {
|
|
858
|
+
let { hasError: i, loadedCount: a } = Fr();
|
|
858
859
|
return i && a === 0 ? /* @__PURE__ */ H("div", {
|
|
859
860
|
"data-slot": "chat-list-error",
|
|
860
861
|
"data-testid": "chat-list-error",
|
|
@@ -869,29 +870,29 @@ function Fr({ children: e, error: t, className: n, messageClassName: r }) {
|
|
|
869
870
|
})
|
|
870
871
|
}) : null;
|
|
871
872
|
}
|
|
872
|
-
function
|
|
873
|
-
let { loadMoreContentRef: t, bumpLoadMore: n } =
|
|
873
|
+
function Hr({ children: e }) {
|
|
874
|
+
let { loadMoreContentRef: t, bumpLoadMore: n } = Fr();
|
|
874
875
|
return t.current = e ?? null, R(() => (n(), () => {
|
|
875
876
|
t.current = null, n();
|
|
876
877
|
}), [n, t]), null;
|
|
877
878
|
}
|
|
878
879
|
//#endregion
|
|
879
880
|
//#region src/components/chat-list/chat-list-items.tsx
|
|
880
|
-
var
|
|
881
|
-
let { loadedCount: s, hasMore: c, isLoading: l, isLoadingMore: u, onLoadMore: d, getItemKey: f, scrollElementRef: p, setScrollElement: m, loadMoreContentRef: h, loadMoreVersion: g, setSkeletonContainer: _ } =
|
|
881
|
+
var Ur = "chat-list-load-more", Wr = be(function({ children: e, className: t, listClassName: n, rowClassName: r, estimateSize: i = 54, overscan: a = 6, gap: o = 4 }) {
|
|
882
|
+
let { loadedCount: s, hasMore: c, isLoading: l, isLoadingMore: u, onLoadMore: d, getItemKey: f, scrollElementRef: p, setScrollElement: m, loadMoreContentRef: h, loadMoreVersion: g, setSkeletonContainer: _ } = Fr(), v = g >= 0 ? h.current : null, y = l && s === 0, b = c ? s + 1 : s, x = F((e) => e >= s ? Ur : f(e), [f, s]), S = yt({
|
|
882
883
|
count: y ? 0 : b,
|
|
883
884
|
getScrollElement: () => p.current,
|
|
884
885
|
estimateSize: () => i,
|
|
885
886
|
overscan: a,
|
|
886
887
|
gap: o,
|
|
887
888
|
getItemKey: x
|
|
888
|
-
}),
|
|
889
|
+
}), ee = S.getVirtualItems();
|
|
889
890
|
return L(() => {
|
|
890
891
|
if (y) return;
|
|
891
|
-
let [e] = [...
|
|
892
|
+
let [e] = [...ee].reverse();
|
|
892
893
|
e && e.index >= s - 1 && c && !u && d?.();
|
|
893
894
|
}, [
|
|
894
|
-
|
|
895
|
+
ee,
|
|
895
896
|
s,
|
|
896
897
|
c,
|
|
897
898
|
u,
|
|
@@ -902,18 +903,18 @@ var Lr = "chat-list-load-more", Rr = ye(function({ children: e, className: t, li
|
|
|
902
903
|
"data-slot": "chat-list-items",
|
|
903
904
|
"data-testid": "chat-list-items",
|
|
904
905
|
className: M("flex min-h-0 flex-1 flex-col overflow-hidden", t)
|
|
905
|
-
}) : /* @__PURE__ */ H(
|
|
906
|
+
}) : /* @__PURE__ */ H(ue, {
|
|
906
907
|
ref: m,
|
|
907
908
|
"data-slot": "chat-list-items",
|
|
908
909
|
"data-testid": "chat-list-items",
|
|
909
910
|
className: M("min-h-0 flex-1", "overflow-auto", t),
|
|
910
|
-
children: /* @__PURE__ */ H(
|
|
911
|
+
children: /* @__PURE__ */ H(te, {
|
|
911
912
|
"data-slot": "chat-list-items-list",
|
|
912
913
|
role: "list",
|
|
913
914
|
"aria-label": "Chats",
|
|
914
915
|
className: M("table relative w-full transform-gpu table-fixed", "space-y-[4px]", n),
|
|
915
916
|
style: { height: `${S.getTotalSize()}px` },
|
|
916
|
-
children:
|
|
917
|
+
children: ee.map((t) => {
|
|
917
918
|
let n = t.index >= s;
|
|
918
919
|
return /* @__PURE__ */ H("li", {
|
|
919
920
|
"data-slot": "chat-list-items-row",
|
|
@@ -936,7 +937,7 @@ var Lr = "chat-list-load-more", Rr = ye(function({ children: e, className: t, li
|
|
|
936
937
|
})
|
|
937
938
|
})
|
|
938
939
|
});
|
|
939
|
-
}),
|
|
940
|
+
}), Gr = P(function({ children: e, className: t, asChild: n = !1, isSelected: r = !1, ...i }, a) {
|
|
940
941
|
return /* @__PURE__ */ H(n ? W : "div", {
|
|
941
942
|
ref: a,
|
|
942
943
|
"data-slot": "chat-list-item",
|
|
@@ -948,16 +949,16 @@ var Lr = "chat-list-load-more", Rr = ye(function({ children: e, className: t, li
|
|
|
948
949
|
children: e
|
|
949
950
|
});
|
|
950
951
|
});
|
|
951
|
-
|
|
952
|
+
Gr.displayName = "ChatListItem";
|
|
952
953
|
//#endregion
|
|
953
954
|
//#region src/components/chat-prompt-box/chat-prompt-box-context.tsx
|
|
954
|
-
var
|
|
955
|
-
function
|
|
956
|
-
let e = I(
|
|
955
|
+
var Kr = N(null);
|
|
956
|
+
function qr() {
|
|
957
|
+
let e = I(Kr);
|
|
957
958
|
if (!e) throw Error("\"useChatPromptBoxContext\" must be used within a ChatPromptBox");
|
|
958
959
|
return e;
|
|
959
960
|
}
|
|
960
|
-
function
|
|
961
|
+
function Jr({ children: e, reportInputHeight: t, resetCompact: n }) {
|
|
961
962
|
let r = B(null), i = F((e) => {
|
|
962
963
|
r.current = e;
|
|
963
964
|
}, []), a = F(() => {
|
|
@@ -977,15 +978,15 @@ function Hr({ children: e, reportInputHeight: t, resetCompact: n }) {
|
|
|
977
978
|
a,
|
|
978
979
|
o
|
|
979
980
|
]);
|
|
980
|
-
return /* @__PURE__ */ H(
|
|
981
|
+
return /* @__PURE__ */ H(Kr.Provider, {
|
|
981
982
|
value: s,
|
|
982
983
|
children: e
|
|
983
984
|
});
|
|
984
985
|
}
|
|
985
986
|
//#endregion
|
|
986
987
|
//#region src/components/chat-prompt-box/chat-prompt-box-focus-plugin.tsx
|
|
987
|
-
function
|
|
988
|
-
let e =
|
|
988
|
+
function Yr() {
|
|
989
|
+
let e = gr(), { registerFocusInput: t, unregisterFocusInput: n } = qr();
|
|
989
990
|
return L(() => (t(() => {
|
|
990
991
|
e.focus();
|
|
991
992
|
}), () => {
|
|
@@ -998,32 +999,32 @@ function Ur() {
|
|
|
998
999
|
}
|
|
999
1000
|
//#endregion
|
|
1000
1001
|
//#region src/components/chat-prompt-box/chat-prompt-box.tsx
|
|
1001
|
-
var
|
|
1002
|
-
function
|
|
1003
|
-
return e instanceof HTMLElement && !!e.closest(
|
|
1002
|
+
var Xr = 40, Zr = "button, a, input, select, textarea, [role=\"button\"]";
|
|
1003
|
+
function Qr(e) {
|
|
1004
|
+
return e instanceof HTMLElement && !!e.closest(Zr);
|
|
1004
1005
|
}
|
|
1005
|
-
var
|
|
1006
|
+
var $r = P(function(e, t) {
|
|
1006
1007
|
let [n, r] = V(!0), i = F((e) => {
|
|
1007
|
-
e >
|
|
1008
|
+
e > Xr && r(!1);
|
|
1008
1009
|
}, []), a = F(() => {
|
|
1009
1010
|
r(!0);
|
|
1010
1011
|
}, []);
|
|
1011
|
-
return /* @__PURE__ */ H(
|
|
1012
|
+
return /* @__PURE__ */ H(Jr, {
|
|
1012
1013
|
reportInputHeight: i,
|
|
1013
1014
|
resetCompact: a,
|
|
1014
|
-
children: /* @__PURE__ */ H(
|
|
1015
|
+
children: /* @__PURE__ */ H(ei, {
|
|
1015
1016
|
ref: t,
|
|
1016
1017
|
"data-compact": n,
|
|
1017
1018
|
...e
|
|
1018
1019
|
})
|
|
1019
1020
|
});
|
|
1020
1021
|
});
|
|
1021
|
-
|
|
1022
|
-
var
|
|
1023
|
-
let { focusInput: o } =
|
|
1024
|
-
|
|
1022
|
+
$r.displayName = "ChatPromptBox";
|
|
1023
|
+
var ei = P(function({ className: e, innerClassName: t, children: n, onMouseDown: r, ...i }, a) {
|
|
1024
|
+
let { focusInput: o } = qr(), s = F((e) => {
|
|
1025
|
+
Qr(e.target) || o(), r?.(e);
|
|
1025
1026
|
}, [o, r]);
|
|
1026
|
-
return /* @__PURE__ */ U(
|
|
1027
|
+
return /* @__PURE__ */ U(jr, {
|
|
1027
1028
|
ref: a,
|
|
1028
1029
|
"data-slot": "chat-prompt-box",
|
|
1029
1030
|
className: M("group/chat-prompt-box", "relative overflow-hidden", "cursor-text", "p-px", "rounded-[16px]", "bg-transparent", "hover:bg-promptbox-background-border-base", "data-[focused=true]:bg-promptbox-background-border-base", e),
|
|
@@ -1033,12 +1034,12 @@ var Jr = P(function({ className: e, innerClassName: t, children: n, onMouseDown:
|
|
|
1033
1034
|
"data-slot": "chat-prompt-box-inner",
|
|
1034
1035
|
className: M("rounded-[15px]", "p-[4px]", "bg-[#171A20]", "group-hover/chat-prompt-box:bg-[#252931]", "group-data-[focused=true]/chat-prompt-box:bg-[linear-gradient(var(--color-promptbox-background-hover),var(--color-promptbox-background-hover)),var(--color-promptbox-background-base)]", "group-data-[focused=true]/chat-prompt-box:group-hover/chat-prompt-box:bg-[linear-gradient(var(--color-promptbox-background-hover),var(--color-promptbox-background-hover)),var(--color-promptbox-background-base)]", t),
|
|
1035
1036
|
children: n
|
|
1036
|
-
}), /* @__PURE__ */ H(
|
|
1037
|
+
}), /* @__PURE__ */ H(ti, {})]
|
|
1037
1038
|
});
|
|
1038
1039
|
});
|
|
1039
|
-
|
|
1040
|
-
function
|
|
1041
|
-
return /* @__PURE__ */ U(
|
|
1040
|
+
ei.displayName = "ChatPromptBoxContainer";
|
|
1041
|
+
function ti() {
|
|
1042
|
+
return /* @__PURE__ */ U(Ce, { children: [/* @__PURE__ */ H("div", {
|
|
1042
1043
|
"data-slot": "chat-prompt-box-glow-top",
|
|
1043
1044
|
className: M("absolute left-1/2 top-[-40px]", "translate-x-[-50%]", "pointer-events-none", "w-[380px] h-[72px]", "opacity-0 group-data-[focused=true]/chat-prompt-box:opacity-50"),
|
|
1044
1045
|
style: {
|
|
@@ -1054,7 +1055,7 @@ function Yr() {
|
|
|
1054
1055
|
}
|
|
1055
1056
|
})] });
|
|
1056
1057
|
}
|
|
1057
|
-
function
|
|
1058
|
+
function ni({ className: e, children: t, ...n }) {
|
|
1058
1059
|
return /* @__PURE__ */ H("div", {
|
|
1059
1060
|
"data-slot": "chat-prompt-box-toolbar",
|
|
1060
1061
|
"data-testid": "chat-prompt-box-toolbar",
|
|
@@ -1063,7 +1064,7 @@ function Xr({ className: e, children: t, ...n }) {
|
|
|
1063
1064
|
children: t
|
|
1064
1065
|
});
|
|
1065
1066
|
}
|
|
1066
|
-
function
|
|
1067
|
+
function ri({ className: e, children: t, ...n }) {
|
|
1067
1068
|
return /* @__PURE__ */ H("div", {
|
|
1068
1069
|
"data-slot": "chat-prompt-box-content",
|
|
1069
1070
|
"data-testid": "chat-prompt-box-content",
|
|
@@ -1072,8 +1073,8 @@ function Zr({ className: e, children: t, ...n }) {
|
|
|
1072
1073
|
children: t
|
|
1073
1074
|
});
|
|
1074
1075
|
}
|
|
1075
|
-
var
|
|
1076
|
-
let { reportInputHeight: o, resetCompact: s } =
|
|
1076
|
+
var ii = P(function({ className: e, textareaClassName: t, placeholderClassName: n, children: r, ...i }, a) {
|
|
1077
|
+
let { reportInputHeight: o, resetCompact: s } = qr(), { hasValue: c } = kr(), { ref: l, height: u } = he();
|
|
1077
1078
|
R(() => {
|
|
1078
1079
|
typeof u == "number" && o(u);
|
|
1079
1080
|
}, [u, o]), R(() => () => {
|
|
@@ -1088,17 +1089,17 @@ var Qr = P(function({ className: e, textareaClassName: t, placeholderClassName:
|
|
|
1088
1089
|
"data-slot": "chat-prompt-box-input",
|
|
1089
1090
|
"data-testid": "chat-prompt-box-input",
|
|
1090
1091
|
className: M("min-h-[40px]", "inline-flex justify-center items-center", "group-data-[compact=false]/chat-prompt-box:items-start", "group-data-[compact=false]/chat-prompt-box:min-h-[48px]", "order-2 grow min-w-0 flex-1", "[&>div]:flex-1 [&>div]:min-w-0", e),
|
|
1091
|
-
children: /* @__PURE__ */ U(
|
|
1092
|
+
children: /* @__PURE__ */ U(Nr, {
|
|
1092
1093
|
ref: d,
|
|
1093
1094
|
className: M("max-h-[72px]!", t),
|
|
1094
1095
|
placeholderClassName: M("leading-[24px]!", n),
|
|
1095
1096
|
...i,
|
|
1096
|
-
children: [/* @__PURE__ */ H(
|
|
1097
|
+
children: [/* @__PURE__ */ H(Yr, {}), r]
|
|
1097
1098
|
})
|
|
1098
1099
|
});
|
|
1099
1100
|
});
|
|
1100
|
-
|
|
1101
|
-
function
|
|
1101
|
+
ii.displayName = "ChatPromptBoxInput";
|
|
1102
|
+
function ai({ className: e, children: t, ...n }) {
|
|
1102
1103
|
return /* @__PURE__ */ H("div", {
|
|
1103
1104
|
"data-slot": "chat-prompt-box-actions-left",
|
|
1104
1105
|
"data-testid": "chat-prompt-box-actions-left",
|
|
@@ -1108,7 +1109,7 @@ function $r({ className: e, children: t, ...n }) {
|
|
|
1108
1109
|
children: t
|
|
1109
1110
|
});
|
|
1110
1111
|
}
|
|
1111
|
-
function
|
|
1112
|
+
function oi({ className: e, children: t, ...n }) {
|
|
1112
1113
|
return /* @__PURE__ */ H("div", {
|
|
1113
1114
|
"data-slot": "chat-prompt-box-actions-right",
|
|
1114
1115
|
"data-testid": "chat-prompt-box-actions-right",
|
|
@@ -1120,7 +1121,7 @@ function ei({ className: e, children: t, ...n }) {
|
|
|
1120
1121
|
}
|
|
1121
1122
|
//#endregion
|
|
1122
1123
|
//#region src/components/chat-message/chat-message.tsx
|
|
1123
|
-
function
|
|
1124
|
+
function si({ children: e, className: t, isQuestion: n }) {
|
|
1124
1125
|
return /* @__PURE__ */ H("div", {
|
|
1125
1126
|
"data-slot": "chat-message",
|
|
1126
1127
|
"data-question": n,
|
|
@@ -1128,7 +1129,7 @@ function ti({ children: e, className: t, isQuestion: n }) {
|
|
|
1128
1129
|
children: e
|
|
1129
1130
|
});
|
|
1130
1131
|
}
|
|
1131
|
-
function
|
|
1132
|
+
function ci({ children: e, className: t }) {
|
|
1132
1133
|
return /* @__PURE__ */ H("div", {
|
|
1133
1134
|
"data-slot": "chat-message-content",
|
|
1134
1135
|
"data-bubble": !0,
|
|
@@ -1136,7 +1137,7 @@ function ni({ children: e, className: t }) {
|
|
|
1136
1137
|
children: e
|
|
1137
1138
|
});
|
|
1138
1139
|
}
|
|
1139
|
-
function
|
|
1140
|
+
function li({ children: e, className: t }) {
|
|
1140
1141
|
return /* @__PURE__ */ H("div", {
|
|
1141
1142
|
"data-slot": "chat-message-actions",
|
|
1142
1143
|
className: M("transition-opacity duration-300", "md:opacity-0 group-hover/message:opacity-100", t),
|
|
@@ -1145,20 +1146,20 @@ function ri({ children: e, className: t }) {
|
|
|
1145
1146
|
}
|
|
1146
1147
|
//#endregion
|
|
1147
1148
|
//#region src/contexts/chat-context/utils.ts
|
|
1148
|
-
function
|
|
1149
|
-
return `__${
|
|
1149
|
+
function ui() {
|
|
1150
|
+
return `__${xt()}__`;
|
|
1150
1151
|
}
|
|
1151
1152
|
//#endregion
|
|
1152
1153
|
//#region src/contexts/chat-context/chat-context.tsx
|
|
1153
|
-
var
|
|
1154
|
+
var di = N(null);
|
|
1154
1155
|
function X() {
|
|
1155
|
-
let e = I(
|
|
1156
|
+
let e = I(di);
|
|
1156
1157
|
if (!e) throw Error("\"useChatContext\" must be used within a ChatProvider");
|
|
1157
1158
|
return e;
|
|
1158
1159
|
}
|
|
1159
|
-
function
|
|
1160
|
-
let [n, r] = V(
|
|
1161
|
-
let e =
|
|
1160
|
+
function fi({ children: e, chatId: t }) {
|
|
1161
|
+
let [n, r] = V(ui()), [i, a] = V(void 0), o = B(/* @__PURE__ */ new Set()), s = t || n, c = s === n, l = F(() => {
|
|
1162
|
+
let e = ui();
|
|
1162
1163
|
return r(e), e;
|
|
1163
1164
|
}, [r]), u = F((e) => {
|
|
1164
1165
|
a(e);
|
|
@@ -1191,20 +1192,20 @@ function oi({ children: e, chatId: t }) {
|
|
|
1191
1192
|
u,
|
|
1192
1193
|
d
|
|
1193
1194
|
]);
|
|
1194
|
-
return /* @__PURE__ */ H(
|
|
1195
|
+
return /* @__PURE__ */ H(di.Provider, {
|
|
1195
1196
|
value: f,
|
|
1196
1197
|
children: e
|
|
1197
1198
|
});
|
|
1198
1199
|
}
|
|
1199
1200
|
//#endregion
|
|
1200
1201
|
//#region src/contexts/chat-conversation-context/chat-conversation-context.tsx
|
|
1201
|
-
var
|
|
1202
|
-
function
|
|
1203
|
-
let e = I(
|
|
1202
|
+
var pi = 3, mi = 250, hi = N(null);
|
|
1203
|
+
function gi() {
|
|
1204
|
+
let e = I(hi);
|
|
1204
1205
|
if (!e) throw Error("\"useChatConversationContext\" must be used within a ChatConversationProvider");
|
|
1205
1206
|
return e;
|
|
1206
1207
|
}
|
|
1207
|
-
function
|
|
1208
|
+
function _i({ children: e, chatId: t, debug: n = !1 }) {
|
|
1208
1209
|
let [r, i] = V(!0), [a, o] = V({
|
|
1209
1210
|
isAtBottom: !0,
|
|
1210
1211
|
isSmoothScroll: !1,
|
|
@@ -1212,8 +1213,8 @@ function di({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1212
1213
|
isProgrammaticScroll: !1,
|
|
1213
1214
|
userScrollIntent: !1,
|
|
1214
1215
|
scrollStrategy: "lastItem"
|
|
1215
|
-
}), s = B(null), c = B(null), l = B(null), u = B(null), d = B(null), f = B(null), p = B(0), m = B(!0), h = B(!1), g = B(!1), _ = B(!1), v = B(!1), y = B(null), b = B(null), x = B("lastItem"), S = B(0),
|
|
1216
|
-
|
|
1216
|
+
}), s = B(null), c = B(null), l = B(null), u = B(null), d = B(null), f = B(null), p = B(0), m = B(!0), h = B(!1), g = B(!1), _ = B(!1), v = B(!1), y = B(null), b = B(null), x = B("lastItem"), S = B(0), ee = B(() => {}), te = B(() => {}), ne = B(() => {}), C = B(() => {});
|
|
1217
|
+
C.current = F(() => {
|
|
1217
1218
|
n && o({
|
|
1218
1219
|
isAtBottom: m.current,
|
|
1219
1220
|
isSmoothScroll: h.current,
|
|
@@ -1223,37 +1224,37 @@ function di({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1223
1224
|
scrollStrategy: x.current
|
|
1224
1225
|
});
|
|
1225
1226
|
}, [n]);
|
|
1226
|
-
let
|
|
1227
|
+
let w = F(() => {
|
|
1227
1228
|
u.current?.disconnect(), u.current = null;
|
|
1228
1229
|
}, []);
|
|
1229
|
-
|
|
1230
|
-
let
|
|
1230
|
+
ne.current = w;
|
|
1231
|
+
let T = F(() => {
|
|
1231
1232
|
f.current?.disconnect(), f.current = null;
|
|
1232
|
-
}, []),
|
|
1233
|
+
}, []), re = F(() => {
|
|
1233
1234
|
d.current?.disconnect(), d.current = null;
|
|
1234
|
-
}, []),
|
|
1235
|
+
}, []), ie = B(() => {}), E = F(() => {
|
|
1235
1236
|
requestAnimationFrame(() => {
|
|
1236
1237
|
requestAnimationFrame(() => {
|
|
1237
|
-
_.current = !1,
|
|
1238
|
+
_.current = !1, ie.current(), C.current();
|
|
1238
1239
|
});
|
|
1239
1240
|
});
|
|
1240
|
-
}, []), ie = F(() => {
|
|
1241
|
-
y.current &&= (clearTimeout(y.current), null), v.current && (v.current = !1, w.current());
|
|
1242
|
-
}, []), O = F(() => {
|
|
1243
|
-
v.current = !0, y.current && clearTimeout(y.current), y.current = setTimeout(() => {
|
|
1244
|
-
y.current = null, v.current = !1, w.current();
|
|
1245
|
-
}, ci), w.current();
|
|
1246
1241
|
}, []), ae = F(() => {
|
|
1247
|
-
|
|
1248
|
-
}, []),
|
|
1249
|
-
|
|
1242
|
+
y.current &&= (clearTimeout(y.current), null), v.current && (v.current = !1, C.current());
|
|
1243
|
+
}, []), D = F(() => {
|
|
1244
|
+
v.current = !0, y.current && clearTimeout(y.current), y.current = setTimeout(() => {
|
|
1245
|
+
y.current = null, v.current = !1, C.current();
|
|
1246
|
+
}, mi), C.current();
|
|
1250
1247
|
}, []), oe = F(() => {
|
|
1248
|
+
x.current = "lastItem", ne.current(), C.current();
|
|
1249
|
+
}, []), O = F((e) => {
|
|
1250
|
+
g.current !== e && (g.current = e, e && ie.current(), C.current());
|
|
1251
|
+
}, []), se = F(() => {
|
|
1251
1252
|
if (g.current) return;
|
|
1252
|
-
_.current = !0,
|
|
1253
|
+
_.current = !0, C.current();
|
|
1253
1254
|
let e = h.current ? "smooth" : "instant";
|
|
1254
1255
|
h.current = !0, requestAnimationFrame(() => {
|
|
1255
1256
|
if (g.current) {
|
|
1256
|
-
|
|
1257
|
+
E();
|
|
1257
1258
|
return;
|
|
1258
1259
|
}
|
|
1259
1260
|
x.current === "lastItem" ? l.current?.scrollIntoView({
|
|
@@ -1263,59 +1264,59 @@ function di({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1263
1264
|
}) : s.current?.scrollTo({
|
|
1264
1265
|
top: s.current.scrollHeight,
|
|
1265
1266
|
behavior: e
|
|
1266
|
-
}),
|
|
1267
|
+
}), E(), C.current();
|
|
1267
1268
|
});
|
|
1268
|
-
}, [
|
|
1269
|
-
|
|
1270
|
-
let
|
|
1269
|
+
}, [E]);
|
|
1270
|
+
ee.current = se;
|
|
1271
|
+
let ce = F(() => {
|
|
1271
1272
|
let e = s.current;
|
|
1272
1273
|
if (!e) return;
|
|
1273
1274
|
let t = e.scrollHeight;
|
|
1274
|
-
t - e.clientHeight - e.scrollTop <= 1 && t === S.current || (S.current = t, _.current = !0,
|
|
1275
|
+
t - e.clientHeight - e.scrollTop <= 1 && t === S.current || (S.current = t, _.current = !0, C.current(), requestAnimationFrame(() => {
|
|
1275
1276
|
e.scrollTo({
|
|
1276
1277
|
top: t,
|
|
1277
1278
|
behavior: "instant"
|
|
1278
|
-
}), S.current = e.scrollHeight,
|
|
1279
|
+
}), S.current = e.scrollHeight, E(), C.current();
|
|
1279
1280
|
}));
|
|
1280
|
-
}, [
|
|
1281
|
+
}, [E]), le = F(() => {
|
|
1281
1282
|
let e = s.current;
|
|
1282
1283
|
if (!e) return;
|
|
1283
1284
|
let t = e.scrollHeight - e.clientHeight - e.scrollTop <= 1;
|
|
1284
|
-
(t || g.current) && (m.current = t, i(t), x.current === "end" && t &&
|
|
1285
|
-
}, [
|
|
1286
|
-
|
|
1287
|
-
let
|
|
1288
|
-
|
|
1285
|
+
(t || g.current) && (m.current = t, i(t), x.current === "end" && t && ce(), C.current());
|
|
1286
|
+
}, [ce]);
|
|
1287
|
+
ie.current = le;
|
|
1288
|
+
let ue = F(() => {
|
|
1289
|
+
re();
|
|
1289
1290
|
let e = s.current;
|
|
1290
1291
|
if (!e) return;
|
|
1291
1292
|
let t = new ResizeObserver(() => {
|
|
1292
|
-
|
|
1293
|
+
ie.current();
|
|
1293
1294
|
});
|
|
1294
1295
|
t.observe(e), d.current = t;
|
|
1295
|
-
}, [
|
|
1296
|
-
if (
|
|
1296
|
+
}, [re]), k = F((e) => {
|
|
1297
|
+
if (w(), x.current !== "end") return;
|
|
1297
1298
|
let t = new ResizeObserver(() => {
|
|
1298
|
-
x.current === "end" &&
|
|
1299
|
+
x.current === "end" && ce();
|
|
1299
1300
|
});
|
|
1300
1301
|
t.observe(e), u.current = t;
|
|
1301
|
-
}, [
|
|
1302
|
-
|
|
1302
|
+
}, [w, ce]);
|
|
1303
|
+
te.current = k;
|
|
1303
1304
|
let de = F(() => {
|
|
1304
1305
|
if (!v.current || x.current === "end") return;
|
|
1305
|
-
x.current = "end",
|
|
1306
|
+
x.current = "end", ae();
|
|
1306
1307
|
let e = l.current;
|
|
1307
|
-
e &&
|
|
1308
|
-
}, [
|
|
1308
|
+
e && te.current(e), C.current();
|
|
1309
|
+
}, [ae]), A = F((e) => {
|
|
1309
1310
|
if (!e && !g.current) {
|
|
1310
|
-
|
|
1311
|
+
C.current();
|
|
1311
1312
|
return;
|
|
1312
1313
|
}
|
|
1313
1314
|
if (m.current = e, i(e), _.current) {
|
|
1314
|
-
|
|
1315
|
+
C.current();
|
|
1315
1316
|
return;
|
|
1316
1317
|
}
|
|
1317
|
-
e && (
|
|
1318
|
-
}, [de,
|
|
1318
|
+
e && (O(!1), de()), C.current();
|
|
1319
|
+
}, [de, O]), j = F((e) => {
|
|
1319
1320
|
if (e.target !== s.current) return;
|
|
1320
1321
|
let t = e.target, n = b.current ?? t.scrollTop, r = t.scrollTop;
|
|
1321
1322
|
if (b.current = r, _.current || !v.current) return;
|
|
@@ -1324,24 +1325,24 @@ function di({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1324
1325
|
x.current !== "end" && A(!0);
|
|
1325
1326
|
return;
|
|
1326
1327
|
}
|
|
1327
|
-
i && (
|
|
1328
|
+
i && (O(!0), oe());
|
|
1328
1329
|
}, [
|
|
1329
|
-
|
|
1330
|
+
oe,
|
|
1330
1331
|
A,
|
|
1331
|
-
|
|
1332
|
+
O
|
|
1332
1333
|
]), fe = F((e) => {
|
|
1333
1334
|
let t = s.current;
|
|
1334
|
-
e.deltaY < 0 && t && t.scrollHeight > t.clientHeight && (
|
|
1335
|
+
e.deltaY < 0 && t && t.scrollHeight > t.clientHeight && (O(!0), oe()), D();
|
|
1335
1336
|
}, [
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1337
|
+
oe,
|
|
1338
|
+
D,
|
|
1339
|
+
O
|
|
1339
1340
|
]), pe = F(() => {
|
|
1340
|
-
|
|
1341
|
-
}, [
|
|
1342
|
-
|
|
1343
|
-
}, [
|
|
1344
|
-
|
|
1341
|
+
D();
|
|
1342
|
+
}, [D]), me = F(() => {
|
|
1343
|
+
D();
|
|
1344
|
+
}, [D]), M = F(() => {
|
|
1345
|
+
T();
|
|
1345
1346
|
let e = s.current, t = c.current;
|
|
1346
1347
|
if (!e || !t) return;
|
|
1347
1348
|
let n = new IntersectionObserver(([e]) => {
|
|
@@ -1351,80 +1352,80 @@ function di({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1351
1352
|
threshold: 0
|
|
1352
1353
|
});
|
|
1353
1354
|
n.observe(t), f.current = n;
|
|
1354
|
-
}, [
|
|
1355
|
-
s.current && (s.current.removeEventListener("scroll", j), s.current.removeEventListener("wheel", fe), s.current.removeEventListener("touchstart", pe), s.current.removeEventListener("pointerdown", me),
|
|
1355
|
+
}, [T, A]), he = F((e) => {
|
|
1356
|
+
s.current && (s.current.removeEventListener("scroll", j), s.current.removeEventListener("wheel", fe), s.current.removeEventListener("touchstart", pe), s.current.removeEventListener("pointerdown", me), re()), s.current = e, e ? (b.current = e.scrollTop, S.current = e.scrollHeight, e.addEventListener("scroll", j, { passive: !0 }), e.addEventListener("wheel", fe, { passive: !0 }), e.addEventListener("touchstart", pe, { passive: !0 }), e.addEventListener("pointerdown", me), M(), ue(), le()) : (ae(), T(), re());
|
|
1356
1357
|
}, [
|
|
1357
1358
|
M,
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1359
|
+
ue,
|
|
1360
|
+
ae,
|
|
1361
|
+
T,
|
|
1362
|
+
re,
|
|
1362
1363
|
me,
|
|
1363
1364
|
j,
|
|
1364
1365
|
pe,
|
|
1365
1366
|
fe,
|
|
1366
|
-
|
|
1367
|
+
le
|
|
1367
1368
|
]), ge = F((e) => {
|
|
1368
|
-
c.current = e, e ? M() :
|
|
1369
|
-
}, [M,
|
|
1369
|
+
c.current = e, e ? M() : T();
|
|
1370
|
+
}, [M, T]), _e = F((e) => {
|
|
1370
1371
|
let t = l.current;
|
|
1371
1372
|
if (e === null) {
|
|
1372
|
-
|
|
1373
|
+
w(), l.current = null, C.current();
|
|
1373
1374
|
return;
|
|
1374
1375
|
}
|
|
1375
1376
|
if (e === t) {
|
|
1376
|
-
x.current === "end" &&
|
|
1377
|
+
x.current === "end" && k(e);
|
|
1377
1378
|
return;
|
|
1378
1379
|
}
|
|
1379
|
-
|
|
1380
|
+
w(), l.current = e, O(!1), m.current = !0, i(!0), x.current = "lastItem", e && k(e), C.current();
|
|
1380
1381
|
}, [
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
]),
|
|
1385
|
-
if (p.current = e, e <
|
|
1382
|
+
k,
|
|
1383
|
+
w,
|
|
1384
|
+
O
|
|
1385
|
+
]), ve = F((e) => {
|
|
1386
|
+
if (p.current = e, e < pi) x.current = "lastItem", w();
|
|
1386
1387
|
else if (x.current === "end") {
|
|
1387
1388
|
let e = l.current;
|
|
1388
|
-
e &&
|
|
1389
|
+
e && k(e);
|
|
1389
1390
|
}
|
|
1390
|
-
|
|
1391
|
-
}, [
|
|
1392
|
-
|
|
1393
|
-
}, [
|
|
1394
|
-
|
|
1391
|
+
C.current();
|
|
1392
|
+
}, [k, w]), N = F(() => {
|
|
1393
|
+
O(!1), p.current < pi && (x.current = "lastItem", w()), C.current();
|
|
1394
|
+
}, [w, O]), P = F(() => {
|
|
1395
|
+
N(), D(), de(), _.current = !0, C.current();
|
|
1395
1396
|
let e = h.current ? "smooth" : "instant";
|
|
1396
1397
|
h.current = !0, requestAnimationFrame(() => {
|
|
1397
1398
|
s.current?.scrollTo({
|
|
1398
1399
|
top: s.current.scrollHeight,
|
|
1399
1400
|
behavior: e
|
|
1400
|
-
}),
|
|
1401
|
+
}), E(), C.current();
|
|
1401
1402
|
});
|
|
1402
1403
|
}, [
|
|
1403
1404
|
de,
|
|
1405
|
+
E,
|
|
1404
1406
|
D,
|
|
1405
|
-
|
|
1406
|
-
P
|
|
1407
|
+
N
|
|
1407
1408
|
]), ye = F(() => {
|
|
1408
|
-
|
|
1409
|
-
}, [
|
|
1409
|
+
se();
|
|
1410
|
+
}, [se]), be = z(() => ({
|
|
1410
1411
|
viewportRef: he,
|
|
1411
1412
|
bottomTriggerRef: ge,
|
|
1412
1413
|
lastItemRef: _e,
|
|
1413
1414
|
isAtBottom: r,
|
|
1414
|
-
setMessageCount:
|
|
1415
|
-
scrollBottom:
|
|
1415
|
+
setMessageCount: ve,
|
|
1416
|
+
scrollBottom: P,
|
|
1416
1417
|
scrollToLatest: ye
|
|
1417
1418
|
}), [
|
|
1418
1419
|
he,
|
|
1419
1420
|
ge,
|
|
1420
1421
|
_e,
|
|
1421
1422
|
r,
|
|
1422
|
-
N,
|
|
1423
1423
|
ve,
|
|
1424
|
+
P,
|
|
1424
1425
|
ye
|
|
1425
1426
|
]);
|
|
1426
|
-
return /* @__PURE__ */ U(
|
|
1427
|
-
value:
|
|
1427
|
+
return /* @__PURE__ */ U(hi.Provider, {
|
|
1428
|
+
value: be,
|
|
1428
1429
|
children: [n && /* @__PURE__ */ H("code", {
|
|
1429
1430
|
className: "absolute top-0 left-0 z-50 w-full bg-red-500/90 p-8 text-white pointer-events-none",
|
|
1430
1431
|
children: JSON.stringify(a, null, 2)
|
|
@@ -1433,17 +1434,17 @@ function di({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1433
1434
|
}
|
|
1434
1435
|
//#endregion
|
|
1435
1436
|
//#region src/components/chat-messages/chat-messages.tsx
|
|
1436
|
-
var
|
|
1437
|
-
function
|
|
1438
|
-
let e = I(
|
|
1437
|
+
var vi = N(null), yi = N(!1);
|
|
1438
|
+
function bi() {
|
|
1439
|
+
let e = I(vi);
|
|
1439
1440
|
if (!e) throw Error("\"ChatMessagesList\" must be used within a ChatMessages");
|
|
1440
1441
|
return e;
|
|
1441
1442
|
}
|
|
1442
|
-
function
|
|
1443
|
-
let { setMessageCount: i } =
|
|
1443
|
+
function xi({ children: e, className: t, messageCount: n = 0, gap: r = 16 }) {
|
|
1444
|
+
let { setMessageCount: i } = gi(), a = z(() => ({ messageCount: n }), [n]);
|
|
1444
1445
|
return R(() => {
|
|
1445
1446
|
i(n);
|
|
1446
|
-
}, [n, i]), /* @__PURE__ */ H(
|
|
1447
|
+
}, [n, i]), /* @__PURE__ */ H(vi.Provider, {
|
|
1447
1448
|
value: a,
|
|
1448
1449
|
children: /* @__PURE__ */ H("div", {
|
|
1449
1450
|
"data-slot": "chat-messages",
|
|
@@ -1454,14 +1455,14 @@ function hi({ children: e, className: t, messageCount: n = 0, gap: r = 16 }) {
|
|
|
1454
1455
|
})
|
|
1455
1456
|
});
|
|
1456
1457
|
}
|
|
1457
|
-
function
|
|
1458
|
-
let { viewportRef: a, bottomTriggerRef: o, scrollToLatest: s } =
|
|
1458
|
+
function Si({ children: e, className: t, scrollAreaClassName: n, viewportClassName: r, bottomTriggerClassName: i }) {
|
|
1459
|
+
let { viewportRef: a, bottomTriggerRef: o, scrollToLatest: s } = gi(), { messageCount: c } = bi(), l = z(() => Array.from({ length: c }, (e, t) => t), [c]), u = c - 1;
|
|
1459
1460
|
return R(() => {
|
|
1460
1461
|
s();
|
|
1461
|
-
}, [c, s]), /* @__PURE__ */ U(
|
|
1462
|
+
}, [c, s]), /* @__PURE__ */ U(bt.Root, {
|
|
1462
1463
|
"data-slot": "chat-messages-scroll-area",
|
|
1463
1464
|
className: M("min-h-0 flex-1", "relative group/scroll-area", "overflow-y-hidden", "transform-gpu", n),
|
|
1464
|
-
children: [/* @__PURE__ */ H(
|
|
1465
|
+
children: [/* @__PURE__ */ H(bt.Viewport, {
|
|
1465
1466
|
ref: a,
|
|
1466
1467
|
"data-slot": "chat-messages-viewport",
|
|
1467
1468
|
className: M("@container-[size]", "will-change-scroll h-full w-full", r),
|
|
@@ -1473,7 +1474,7 @@ function gi({ children: e, className: t, scrollAreaClassName: n, viewportClassNa
|
|
|
1473
1474
|
"aria-label": "Message list",
|
|
1474
1475
|
"aria-atomic": "false",
|
|
1475
1476
|
className: M("m-0 flex flex-col gap-(--chat-messages-gap) p-0", t),
|
|
1476
|
-
children: [l.map((t) => /* @__PURE__ */ H(
|
|
1477
|
+
children: [l.map((t) => /* @__PURE__ */ H(Ci, {
|
|
1477
1478
|
index: t,
|
|
1478
1479
|
isLast: t === u,
|
|
1479
1480
|
children: e
|
|
@@ -1484,20 +1485,20 @@ function gi({ children: e, className: t, scrollAreaClassName: n, viewportClassNa
|
|
|
1484
1485
|
"aria-hidden": "true"
|
|
1485
1486
|
})]
|
|
1486
1487
|
})
|
|
1487
|
-
}), /* @__PURE__ */ H(
|
|
1488
|
+
}), /* @__PURE__ */ H(Ti, { orientation: "vertical" })]
|
|
1488
1489
|
});
|
|
1489
1490
|
}
|
|
1490
|
-
var
|
|
1491
|
+
var Ci = be(function({ children: e, index: t, isLast: n }) {
|
|
1491
1492
|
return /* @__PURE__ */ H("li", {
|
|
1492
1493
|
"data-slot": "chat-messages-row",
|
|
1493
|
-
children: /* @__PURE__ */ H(
|
|
1494
|
+
children: /* @__PURE__ */ H(yi.Provider, {
|
|
1494
1495
|
value: n,
|
|
1495
1496
|
children: e(t)
|
|
1496
1497
|
})
|
|
1497
1498
|
});
|
|
1498
1499
|
});
|
|
1499
|
-
function
|
|
1500
|
-
let r = I(
|
|
1500
|
+
function wi({ children: e, className: t, ...n }) {
|
|
1501
|
+
let r = I(yi), { lastItemRef: i } = gi();
|
|
1501
1502
|
return /* @__PURE__ */ H("div", {
|
|
1502
1503
|
ref: r ? i : void 0,
|
|
1503
1504
|
"data-slot": "chat-message-list-group",
|
|
@@ -1507,20 +1508,20 @@ function vi({ children: e, className: t, ...n }) {
|
|
|
1507
1508
|
children: e
|
|
1508
1509
|
});
|
|
1509
1510
|
}
|
|
1510
|
-
function
|
|
1511
|
-
return /* @__PURE__ */ H(
|
|
1511
|
+
function Ti({ className: e, orientation: t = "vertical", ...n }) {
|
|
1512
|
+
return /* @__PURE__ */ H(bt.ScrollAreaScrollbar, {
|
|
1512
1513
|
"data-slot": "scroll-area-scrollbar",
|
|
1513
1514
|
orientation: t,
|
|
1514
1515
|
className: M("opacity-0 group-hover/scroll-area:opacity-100", "rounded-[8px]", "bg-scrollbar-track hover:bg-scrollbar-track-hover", "transition-opacity duration-200 ease-in-out", "flextouch-none select-none transition-colors", t === "vertical" && "h-full w-scrollbar border-l border-l-transparent px-4 py-[12px]", t === "horizontal" && "h-scrollbar w-full border-t border-t-transparent px-[12px] py-4", e),
|
|
1515
1516
|
...n,
|
|
1516
|
-
children: /* @__PURE__ */ H(
|
|
1517
|
+
children: /* @__PURE__ */ H(bt.ScrollAreaThumb, {
|
|
1517
1518
|
"data-slot": "scroll-area-thumb",
|
|
1518
1519
|
className: M("relative flex-1 rounded-full", "bg-scrollbar-thumb hover:bg-scrollbar-thumb-hover", t === "vertical" && "w-scrollbar-thumb!", t === "horizontal" && "h-scrollbar-thumb!")
|
|
1519
1520
|
})
|
|
1520
1521
|
});
|
|
1521
1522
|
}
|
|
1522
|
-
var
|
|
1523
|
-
let { isAtBottom: i, scrollBottom: a } =
|
|
1523
|
+
var Ei = be(function({ className: e, buttonClassName: t, tooltip: n, children: r }) {
|
|
1524
|
+
let { isAtBottom: i, scrollBottom: a } = gi();
|
|
1524
1525
|
return /* @__PURE__ */ H("div", {
|
|
1525
1526
|
"data-slot": "chat-messages-scroll-button",
|
|
1526
1527
|
"data-testid": "chat-message-history-scroll-button",
|
|
@@ -1537,14 +1538,14 @@ var bi = ye(function({ className: e, buttonClassName: t, tooltip: n, children: r
|
|
|
1537
1538
|
onClick: () => a(),
|
|
1538
1539
|
tabIndex: -1,
|
|
1539
1540
|
"aria-label": n,
|
|
1540
|
-
children: r || /* @__PURE__ */ H(
|
|
1541
|
+
children: r || /* @__PURE__ */ H(Ct, {})
|
|
1541
1542
|
})
|
|
1542
1543
|
})
|
|
1543
1544
|
});
|
|
1544
1545
|
});
|
|
1545
1546
|
//#endregion
|
|
1546
1547
|
//#region src/components/chat-message-attachment-card/chat-message-attachment-card.tsx
|
|
1547
|
-
function
|
|
1548
|
+
function Di({ className: e, children: t, isPreview: n, isInteractive: r = !0 }) {
|
|
1548
1549
|
return /* @__PURE__ */ H("div", {
|
|
1549
1550
|
role: "group",
|
|
1550
1551
|
"data-slot": "chat-message-attachment-card",
|
|
@@ -1555,7 +1556,7 @@ function xi({ className: e, children: t, isPreview: n, isInteractive: r = !0 })
|
|
|
1555
1556
|
children: t
|
|
1556
1557
|
});
|
|
1557
1558
|
}
|
|
1558
|
-
function
|
|
1559
|
+
function Oi({ className: e, children: t }) {
|
|
1559
1560
|
return /* @__PURE__ */ H("div", {
|
|
1560
1561
|
"data-slot": "chat-message-attachment-card-content",
|
|
1561
1562
|
"data-testid": "chat-message-attachment-card-content",
|
|
@@ -1563,7 +1564,7 @@ function Si({ className: e, children: t }) {
|
|
|
1563
1564
|
children: t
|
|
1564
1565
|
});
|
|
1565
1566
|
}
|
|
1566
|
-
function
|
|
1567
|
+
function ki({ className: e, children: t }) {
|
|
1567
1568
|
return /* @__PURE__ */ H(j, {
|
|
1568
1569
|
variant: "body-sm",
|
|
1569
1570
|
"data-slot": "chat-message-attachment-card-title",
|
|
@@ -1572,7 +1573,7 @@ function Ci({ className: e, children: t }) {
|
|
|
1572
1573
|
children: t
|
|
1573
1574
|
});
|
|
1574
1575
|
}
|
|
1575
|
-
function
|
|
1576
|
+
function Ai({ className: e, imageClassName: t, previewSrc: n }) {
|
|
1576
1577
|
return /* @__PURE__ */ H("figure", {
|
|
1577
1578
|
"data-slot": "chat-message-attachment-card-preview",
|
|
1578
1579
|
"data-testid": "chat-message-attachment-card-preview",
|
|
@@ -1585,7 +1586,7 @@ function wi({ className: e, imageClassName: t, previewSrc: n }) {
|
|
|
1585
1586
|
})
|
|
1586
1587
|
});
|
|
1587
1588
|
}
|
|
1588
|
-
function
|
|
1589
|
+
function ji({ className: e, buttonClassName: t, onDelete: n }) {
|
|
1589
1590
|
return /* @__PURE__ */ H("div", {
|
|
1590
1591
|
role: "group",
|
|
1591
1592
|
"data-slot": "chat-message-attachment-card-actions",
|
|
@@ -1597,40 +1598,40 @@ function Ti({ className: e, buttonClassName: t, onDelete: n }) {
|
|
|
1597
1598
|
onClick: n,
|
|
1598
1599
|
size: "xs",
|
|
1599
1600
|
className: M("size-[24px]", "text-icon-button-tertiary-icon", t),
|
|
1600
|
-
children: /* @__PURE__ */ H(
|
|
1601
|
+
children: /* @__PURE__ */ H(Tt, {})
|
|
1601
1602
|
})
|
|
1602
1603
|
});
|
|
1603
1604
|
}
|
|
1604
1605
|
//#endregion
|
|
1605
1606
|
//#region src/components/chat-message-attachment-card/chat-message-attachment-card-icon.tsx
|
|
1606
|
-
var
|
|
1607
|
+
var Mi = {
|
|
1607
1608
|
spreadsheet: {
|
|
1608
|
-
component:
|
|
1609
|
+
component: Jt,
|
|
1609
1610
|
className: "bg-data-d"
|
|
1610
1611
|
},
|
|
1611
1612
|
pdf: {
|
|
1612
|
-
component:
|
|
1613
|
+
component: Ut,
|
|
1613
1614
|
className: "bg-data-a"
|
|
1614
1615
|
},
|
|
1615
1616
|
presentation: {
|
|
1616
|
-
component:
|
|
1617
|
+
component: Wt,
|
|
1617
1618
|
className: "bg-data-e"
|
|
1618
1619
|
},
|
|
1619
1620
|
document: {
|
|
1620
|
-
component:
|
|
1621
|
+
component: Ot,
|
|
1621
1622
|
className: "bg-data-c"
|
|
1622
1623
|
},
|
|
1623
1624
|
code: {
|
|
1624
|
-
component:
|
|
1625
|
+
component: Et,
|
|
1625
1626
|
className: "bg-data-f"
|
|
1626
1627
|
},
|
|
1627
1628
|
unknown: {
|
|
1628
|
-
component:
|
|
1629
|
+
component: kt,
|
|
1629
1630
|
className: "bg-data-f"
|
|
1630
1631
|
}
|
|
1631
1632
|
};
|
|
1632
|
-
function
|
|
1633
|
-
let { component: r, className: i } =
|
|
1633
|
+
function Ni({ icon: e, className: t, ...n }) {
|
|
1634
|
+
let { component: r, className: i } = Mi[e];
|
|
1634
1635
|
return /* @__PURE__ */ H("span", {
|
|
1635
1636
|
"data-slot": "chat-message-attachment-card-icon",
|
|
1636
1637
|
"data-testid": "chat-attachment-icon",
|
|
@@ -1641,7 +1642,7 @@ function Di({ icon: e, className: t, ...n }) {
|
|
|
1641
1642
|
}
|
|
1642
1643
|
//#endregion
|
|
1643
1644
|
//#region src/components/chat-message-attachment-card/utils.ts
|
|
1644
|
-
var
|
|
1645
|
+
var Pi = {
|
|
1645
1646
|
"application/pdf": "pdf",
|
|
1646
1647
|
"application/vnd.ms-excel": "spreadsheet",
|
|
1647
1648
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "spreadsheet",
|
|
@@ -1654,29 +1655,29 @@ var Oi = {
|
|
|
1654
1655
|
"application/rtf": "document",
|
|
1655
1656
|
"application/vnd.oasis.opendocument.text": "document"
|
|
1656
1657
|
};
|
|
1657
|
-
function
|
|
1658
|
-
let t =
|
|
1659
|
-
return t ? t in
|
|
1658
|
+
function Fi(e) {
|
|
1659
|
+
let t = Yt.getType(e.name);
|
|
1660
|
+
return t ? t in Pi ? Pi[t] : t.startsWith("text/") || t.includes("javascript") || t.includes("json") ? "code" : "unknown" : "unknown";
|
|
1660
1661
|
}
|
|
1661
1662
|
//#endregion
|
|
1662
1663
|
//#region src/components/markdown-viewer/utils.ts
|
|
1663
|
-
function
|
|
1664
|
+
function Ii(e) {
|
|
1664
1665
|
return e.startsWith("swi-");
|
|
1665
1666
|
}
|
|
1666
1667
|
//#endregion
|
|
1667
1668
|
//#region src/components/markdown-viewer/hooks.ts
|
|
1668
|
-
function
|
|
1669
|
-
let t = z(() => Object.keys(e).filter((e) =>
|
|
1669
|
+
function Li({ customComponents: e }) {
|
|
1670
|
+
let t = z(() => Object.keys(e).filter((e) => Ii(e) ? !0 : (console.warn(`[MarkdownViewer] Invalid custom component tag: ${e}`), !1)), [e]);
|
|
1670
1671
|
return {
|
|
1671
1672
|
components: e,
|
|
1672
|
-
remarkPlugins: z(() => [...Object.values(
|
|
1673
|
-
rehypePlugins: z(() => [...Object.values(
|
|
1674
|
-
...
|
|
1675
|
-
tagNames: [...
|
|
1673
|
+
remarkPlugins: z(() => [...Object.values(Qt)], []),
|
|
1674
|
+
rehypePlugins: z(() => [...Object.values(Zt), [$t, {
|
|
1675
|
+
...en,
|
|
1676
|
+
tagNames: [...en?.tagNames || [], ...t],
|
|
1676
1677
|
protocols: {
|
|
1677
|
-
...
|
|
1678
|
+
...en?.protocols,
|
|
1678
1679
|
href: [
|
|
1679
|
-
...
|
|
1680
|
+
...en?.protocols?.href ?? [],
|
|
1680
1681
|
"swisper",
|
|
1681
1682
|
"swisper://"
|
|
1682
1683
|
]
|
|
@@ -1686,9 +1687,9 @@ function ji({ customComponents: e }) {
|
|
|
1686
1687
|
}
|
|
1687
1688
|
//#endregion
|
|
1688
1689
|
//#region src/components/markdown-viewer/markdown-viewer.tsx
|
|
1689
|
-
function
|
|
1690
|
-
let { components: a, remarkPlugins: o, rehypePlugins: s } =
|
|
1691
|
-
return /* @__PURE__ */ H(
|
|
1690
|
+
function Ri({ markdown: e, className: t, isStreaming: n = !1, hasCaret: r = !1, customComponents: i = {} }) {
|
|
1691
|
+
let { components: a, remarkPlugins: o, rehypePlugins: s } = Li({ customComponents: i });
|
|
1692
|
+
return /* @__PURE__ */ H(Xt, {
|
|
1692
1693
|
className: t,
|
|
1693
1694
|
caret: r ? "block" : void 0,
|
|
1694
1695
|
isAnimating: n,
|
|
@@ -1698,13 +1699,13 @@ function Mi({ markdown: e, className: t, isStreaming: n = !1, hasCaret: r = !1,
|
|
|
1698
1699
|
linkSafety: { enabled: !1 },
|
|
1699
1700
|
remend: { handlers: [{
|
|
1700
1701
|
name: "swi-tag-filter",
|
|
1701
|
-
handle:
|
|
1702
|
+
handle: zi,
|
|
1702
1703
|
priority: 0
|
|
1703
1704
|
}] },
|
|
1704
1705
|
children: e
|
|
1705
1706
|
});
|
|
1706
1707
|
}
|
|
1707
|
-
function
|
|
1708
|
+
function zi(e, t = "|") {
|
|
1708
1709
|
let [n, r] = /<swi-(\w+)([^>]*)$/gm.exec(e) ?? [];
|
|
1709
1710
|
if (e.endsWith("<swi-")) return e + ">";
|
|
1710
1711
|
if (n) return e.replace(n, `<swi-${r}>`);
|
|
@@ -1725,9 +1726,9 @@ function Ni(e, t = "|") {
|
|
|
1725
1726
|
}
|
|
1726
1727
|
//#endregion
|
|
1727
1728
|
//#region src/components/chat-message-response/chat-message-response.tsx
|
|
1728
|
-
function
|
|
1729
|
+
function Bi({ message: e, isStreaming: t }) {
|
|
1729
1730
|
let n = z(() => ({}), []);
|
|
1730
|
-
return /* @__PURE__ */ H(
|
|
1731
|
+
return /* @__PURE__ */ H(Ri, {
|
|
1731
1732
|
hasCaret: !1,
|
|
1732
1733
|
markdown: e,
|
|
1733
1734
|
isStreaming: t,
|
|
@@ -1736,7 +1737,7 @@ function Pi({ message: e, isStreaming: t }) {
|
|
|
1736
1737
|
}
|
|
1737
1738
|
//#endregion
|
|
1738
1739
|
//#region src/components/chat-message-toolbar/chat-message-toolbar.tsx
|
|
1739
|
-
function
|
|
1740
|
+
function Vi({ children: e, className: t, reverse: n = !1, ...r }) {
|
|
1740
1741
|
return /* @__PURE__ */ H("div", {
|
|
1741
1742
|
"data-slot": "chat-message-toolbar",
|
|
1742
1743
|
"data-testid": "chat-message-toolbar",
|
|
@@ -1746,7 +1747,7 @@ function Fi({ children: e, className: t, reverse: n = !1, ...r }) {
|
|
|
1746
1747
|
children: e
|
|
1747
1748
|
});
|
|
1748
1749
|
}
|
|
1749
|
-
function
|
|
1750
|
+
function Hi({ children: e, className: t, ...n }) {
|
|
1750
1751
|
return /* @__PURE__ */ H("div", {
|
|
1751
1752
|
"data-slot": "chat-message-toolbar-actions",
|
|
1752
1753
|
"data-testid": "chat-message-toolbar-actions",
|
|
@@ -1756,7 +1757,7 @@ function Ii({ children: e, className: t, ...n }) {
|
|
|
1756
1757
|
children: e
|
|
1757
1758
|
});
|
|
1758
1759
|
}
|
|
1759
|
-
var
|
|
1760
|
+
var Ui = P(function({ children: e, className: t, tooltip: n, ...r }, i) {
|
|
1760
1761
|
let a = /* @__PURE__ */ H(_, {
|
|
1761
1762
|
ref: i,
|
|
1762
1763
|
variant: "tertiary",
|
|
@@ -1772,8 +1773,8 @@ var Li = P(function({ children: e, className: t, tooltip: n, ...r }, i) {
|
|
|
1772
1773
|
children: a
|
|
1773
1774
|
}) : a;
|
|
1774
1775
|
});
|
|
1775
|
-
|
|
1776
|
-
function
|
|
1776
|
+
Ui.displayName = "ChatMessageToolbarActionButton";
|
|
1777
|
+
function Wi({ className: e, children: t, ...n }) {
|
|
1777
1778
|
return /* @__PURE__ */ H("div", {
|
|
1778
1779
|
"data-slot": "chat-message-toolbar-timestamp",
|
|
1779
1780
|
className: M("text-action-active", e),
|
|
@@ -1783,26 +1784,26 @@ function Ri({ className: e, children: t, ...n }) {
|
|
|
1783
1784
|
}
|
|
1784
1785
|
//#endregion
|
|
1785
1786
|
//#region src/components/chat-notification-card/utils.ts
|
|
1786
|
-
function
|
|
1787
|
+
function Gi(e) {
|
|
1787
1788
|
return new Date(Date.now() + e * 60 * 1e3);
|
|
1788
1789
|
}
|
|
1789
|
-
var
|
|
1790
|
-
function
|
|
1790
|
+
var Ki = 60, qi = 1440, Ji = 6e4;
|
|
1791
|
+
function Yi(e, t) {
|
|
1791
1792
|
return `${e} ${t}${e === 1 ? "" : "s"}`;
|
|
1792
1793
|
}
|
|
1793
|
-
function
|
|
1794
|
-
let r = Math.max(0, Math.ceil((e.getTime() - n.getTime()) /
|
|
1795
|
-
return i > 0 && s.push(
|
|
1794
|
+
function Xi(e, t = "in", n = /* @__PURE__ */ new Date()) {
|
|
1795
|
+
let r = Math.max(0, Math.ceil((e.getTime() - n.getTime()) / Ji)), i = Math.floor(r / qi), a = Math.floor(r % qi / Ki), o = r % Ki, s = [];
|
|
1796
|
+
return i > 0 && s.push(Yi(i, "day")), a > 0 && s.push(Yi(a, "hour")), s.push(Yi(o, "minute")), [t, ...s].filter(Boolean).join(" ");
|
|
1796
1797
|
}
|
|
1797
1798
|
//#endregion
|
|
1798
1799
|
//#region src/components/chat-notification-card/chat-notification-card.tsx
|
|
1799
|
-
var
|
|
1800
|
-
function
|
|
1801
|
-
let e = I(
|
|
1800
|
+
var Zi = N(null);
|
|
1801
|
+
function Qi() {
|
|
1802
|
+
let e = I(Zi);
|
|
1802
1803
|
if (!e) throw Error("\"useChatNotificationCardContext\" must be used within a ChatNotificationCard");
|
|
1803
1804
|
return e;
|
|
1804
1805
|
}
|
|
1805
|
-
function
|
|
1806
|
+
function $i({ children: e, variant: t = "default", className: n, overlayClassName: r, defaultExpanded: i = !1, expanded: a, onExpandedChange: o, onClick: s }) {
|
|
1806
1807
|
let [c, l] = V(i), u = a ?? c, d = F((e) => {
|
|
1807
1808
|
a === void 0 && l(e), o?.(e);
|
|
1808
1809
|
}, [a, o]), f = F(() => {
|
|
@@ -1816,7 +1817,7 @@ function qi({ children: e, variant: t = "default", className: n, overlayClassNam
|
|
|
1816
1817
|
d,
|
|
1817
1818
|
f
|
|
1818
1819
|
]);
|
|
1819
|
-
return /* @__PURE__ */ H(
|
|
1820
|
+
return /* @__PURE__ */ H(Zi.Provider, {
|
|
1820
1821
|
value: p,
|
|
1821
1822
|
children: /* @__PURE__ */ U("div", {
|
|
1822
1823
|
role: "alert",
|
|
@@ -1834,7 +1835,7 @@ function qi({ children: e, variant: t = "default", className: n, overlayClassNam
|
|
|
1834
1835
|
})
|
|
1835
1836
|
});
|
|
1836
1837
|
}
|
|
1837
|
-
function
|
|
1838
|
+
function ea({ children: e, className: t }) {
|
|
1838
1839
|
return /* @__PURE__ */ H("header", {
|
|
1839
1840
|
"data-slot": "chat-notification-card-head",
|
|
1840
1841
|
"data-testid": "chat-notification-card-head",
|
|
@@ -1842,7 +1843,7 @@ function Ji({ children: e, className: t }) {
|
|
|
1842
1843
|
children: e
|
|
1843
1844
|
});
|
|
1844
1845
|
}
|
|
1845
|
-
function
|
|
1846
|
+
function ta({ children: e, className: t }) {
|
|
1846
1847
|
return /* @__PURE__ */ H("div", {
|
|
1847
1848
|
"data-slot": "chat-notification-card-header",
|
|
1848
1849
|
"data-testid": "chat-notification-card-header",
|
|
@@ -1850,7 +1851,7 @@ function Yi({ children: e, className: t }) {
|
|
|
1850
1851
|
children: e
|
|
1851
1852
|
});
|
|
1852
1853
|
}
|
|
1853
|
-
function
|
|
1854
|
+
function na({ children: e, className: t }) {
|
|
1854
1855
|
return /* @__PURE__ */ H("div", {
|
|
1855
1856
|
"data-slot": "chat-notification-card-header-icon",
|
|
1856
1857
|
"data-testid": "chat-notification-card-header-icon",
|
|
@@ -1858,7 +1859,7 @@ function Xi({ children: e, className: t }) {
|
|
|
1858
1859
|
children: e
|
|
1859
1860
|
});
|
|
1860
1861
|
}
|
|
1861
|
-
function
|
|
1862
|
+
function ra({ children: e, className: t }) {
|
|
1862
1863
|
return /* @__PURE__ */ H("div", {
|
|
1863
1864
|
"data-slot": "chat-notification-card-header-title",
|
|
1864
1865
|
"data-testid": "chat-notification-card-header-title",
|
|
@@ -1866,7 +1867,7 @@ function Zi({ children: e, className: t }) {
|
|
|
1866
1867
|
children: e
|
|
1867
1868
|
});
|
|
1868
1869
|
}
|
|
1869
|
-
function
|
|
1870
|
+
function ia({ children: e, className: t }) {
|
|
1870
1871
|
return /* @__PURE__ */ H(j, {
|
|
1871
1872
|
variant: "body-sm",
|
|
1872
1873
|
fontWeight: "semibold",
|
|
@@ -1877,13 +1878,13 @@ function Qi({ children: e, className: t }) {
|
|
|
1877
1878
|
children: /* @__PURE__ */ H("span", { children: e })
|
|
1878
1879
|
});
|
|
1879
1880
|
}
|
|
1880
|
-
var
|
|
1881
|
+
var aa = {
|
|
1881
1882
|
low: "info",
|
|
1882
1883
|
medium: "warning",
|
|
1883
1884
|
high: "error"
|
|
1884
1885
|
};
|
|
1885
|
-
function
|
|
1886
|
-
let i =
|
|
1886
|
+
function oa({ children: e, priority: t = "medium", className: n, ...r }) {
|
|
1887
|
+
let i = aa[t];
|
|
1887
1888
|
return t === "low" ? null : /* @__PURE__ */ H(o, {
|
|
1888
1889
|
"data-slot": "chat-notification-card-header-status",
|
|
1889
1890
|
"data-testid": "chat-notification-card-header-status",
|
|
@@ -1896,7 +1897,7 @@ function ea({ children: e, priority: t = "medium", className: n, ...r }) {
|
|
|
1896
1897
|
children: e
|
|
1897
1898
|
});
|
|
1898
1899
|
}
|
|
1899
|
-
function
|
|
1900
|
+
function sa({ children: e, className: t }) {
|
|
1900
1901
|
return /* @__PURE__ */ H("div", {
|
|
1901
1902
|
"data-slot": "chat-notification-card-actions",
|
|
1902
1903
|
"data-testid": "chat-notification-card-actions",
|
|
@@ -1905,7 +1906,7 @@ function ta({ children: e, className: t }) {
|
|
|
1905
1906
|
children: e
|
|
1906
1907
|
});
|
|
1907
1908
|
}
|
|
1908
|
-
function
|
|
1909
|
+
function ca({ children: e, className: t }) {
|
|
1909
1910
|
return /* @__PURE__ */ H(j, {
|
|
1910
1911
|
variant: "caption",
|
|
1911
1912
|
"data-slot": "chat-notification-card-timestamp",
|
|
@@ -1915,7 +1916,7 @@ function na({ children: e, className: t }) {
|
|
|
1915
1916
|
children: /* @__PURE__ */ H("span", { children: e })
|
|
1916
1917
|
});
|
|
1917
1918
|
}
|
|
1918
|
-
function
|
|
1919
|
+
function la({ children: e, className: t }) {
|
|
1919
1920
|
function n(e) {
|
|
1920
1921
|
e.stopPropagation();
|
|
1921
1922
|
}
|
|
@@ -1932,7 +1933,7 @@ function ra({ children: e, className: t }) {
|
|
|
1932
1933
|
children: e
|
|
1933
1934
|
});
|
|
1934
1935
|
}
|
|
1935
|
-
var
|
|
1936
|
+
var ua = P(function({ className: e, isRead: t = !1, onRead: n, ...r }, i) {
|
|
1936
1937
|
function a() {
|
|
1937
1938
|
n?.(!t);
|
|
1938
1939
|
}
|
|
@@ -1946,11 +1947,11 @@ var ia = P(function({ className: e, isRead: t = !1, onRead: n, ...r }, i) {
|
|
|
1946
1947
|
className: e,
|
|
1947
1948
|
onClick: a,
|
|
1948
1949
|
...r,
|
|
1949
|
-
children: H(t ?
|
|
1950
|
+
children: H(t ? Kt : Gt, {})
|
|
1950
1951
|
});
|
|
1951
1952
|
});
|
|
1952
|
-
|
|
1953
|
-
var
|
|
1953
|
+
ua.displayName = "ChatNotificationCardReadActionButton";
|
|
1954
|
+
var da = P(function({ className: t, labelClassName: n, cancelLabelClassName: r, snoozeUntilDate: i, cancelLabel: a = "Cancel", formatDate: o = Xi, onCancel: s, onClick: c, onMouseEnter: l, onMouseLeave: u, ...d }, f) {
|
|
1954
1955
|
let [p, m] = V(!1), h = i && i > /* @__PURE__ */ new Date();
|
|
1955
1956
|
L(() => {
|
|
1956
1957
|
h || m(!1);
|
|
@@ -1969,7 +1970,7 @@ var aa = P(function({ className: t, labelClassName: n, cancelLabelClassName: r,
|
|
|
1969
1970
|
"data-slot": "chat-notification-card-snooze-button",
|
|
1970
1971
|
"data-snoozed": "true",
|
|
1971
1972
|
"data-hover": p,
|
|
1972
|
-
startIcon: H(p ?
|
|
1973
|
+
startIcon: H(p ? Tt : qt, {}),
|
|
1973
1974
|
variant: "tertiary",
|
|
1974
1975
|
size: "md",
|
|
1975
1976
|
onMouseEnter: g,
|
|
@@ -1996,11 +1997,11 @@ var aa = P(function({ className: t, labelClassName: n, cancelLabelClassName: r,
|
|
|
1996
1997
|
className: M("group/snooze-button", t),
|
|
1997
1998
|
onClick: c,
|
|
1998
1999
|
...d,
|
|
1999
|
-
children: /* @__PURE__ */ H(
|
|
2000
|
+
children: /* @__PURE__ */ H(qt, {})
|
|
2000
2001
|
});
|
|
2001
2002
|
});
|
|
2002
|
-
|
|
2003
|
-
var
|
|
2003
|
+
da.displayName = "ChatNotificationCardSnoozeButton";
|
|
2004
|
+
var fa = P(function({ className: e, ...t }, n) {
|
|
2004
2005
|
return /* @__PURE__ */ H(_, {
|
|
2005
2006
|
ref: n,
|
|
2006
2007
|
"data-slot": "chat-notification-card-delete-button",
|
|
@@ -2009,11 +2010,11 @@ var oa = P(function({ className: e, ...t }, n) {
|
|
|
2009
2010
|
variant: "tertiary",
|
|
2010
2011
|
className: e,
|
|
2011
2012
|
...t,
|
|
2012
|
-
children: /* @__PURE__ */ H(
|
|
2013
|
+
children: /* @__PURE__ */ H(Dt, {})
|
|
2013
2014
|
});
|
|
2014
2015
|
});
|
|
2015
|
-
|
|
2016
|
-
var
|
|
2016
|
+
fa.displayName = "ChatNotificationCardDeleteButton";
|
|
2017
|
+
var pa = P(function({ className: e, ...t }, n) {
|
|
2017
2018
|
return /* @__PURE__ */ H(_, {
|
|
2018
2019
|
ref: n,
|
|
2019
2020
|
"data-slot": "chat-notification-card-close-button",
|
|
@@ -2022,19 +2023,19 @@ var sa = P(function({ className: e, ...t }, n) {
|
|
|
2022
2023
|
variant: "tertiary",
|
|
2023
2024
|
className: e,
|
|
2024
2025
|
...t,
|
|
2025
|
-
children: /* @__PURE__ */ H(
|
|
2026
|
+
children: /* @__PURE__ */ H(Tt, {})
|
|
2026
2027
|
});
|
|
2027
2028
|
});
|
|
2028
|
-
|
|
2029
|
-
function
|
|
2029
|
+
pa.displayName = "ChatNotificationCardCloseButton";
|
|
2030
|
+
function ma({ children: e, className: t }) {
|
|
2030
2031
|
return /* @__PURE__ */ U("div", {
|
|
2031
2032
|
"data-slot": "chat-notification-card-content",
|
|
2032
2033
|
"data-testid": "chat-notification-card-content",
|
|
2033
2034
|
className: M("flex flex-col items-start text-left gap-4", "relative pr-[40px]", t),
|
|
2034
|
-
children: [e, /* @__PURE__ */ H(
|
|
2035
|
+
children: [e, /* @__PURE__ */ H(va, {})]
|
|
2035
2036
|
});
|
|
2036
2037
|
}
|
|
2037
|
-
function
|
|
2038
|
+
function ha({ children: e, className: t }) {
|
|
2038
2039
|
return /* @__PURE__ */ H(j, {
|
|
2039
2040
|
variant: "body-sm",
|
|
2040
2041
|
fontWeight: "semibold",
|
|
@@ -2045,7 +2046,7 @@ function la({ children: e, className: t }) {
|
|
|
2045
2046
|
children: /* @__PURE__ */ H("span", { children: e })
|
|
2046
2047
|
});
|
|
2047
2048
|
}
|
|
2048
|
-
function
|
|
2049
|
+
function ga({ children: e, className: t }) {
|
|
2049
2050
|
return /* @__PURE__ */ H(j, {
|
|
2050
2051
|
variant: "body-sm",
|
|
2051
2052
|
"data-slot": "chat-notification-card-content-description",
|
|
@@ -2055,7 +2056,7 @@ function ua({ children: e, className: t }) {
|
|
|
2055
2056
|
children: /* @__PURE__ */ H("div", { children: e })
|
|
2056
2057
|
});
|
|
2057
2058
|
}
|
|
2058
|
-
function
|
|
2059
|
+
function _a({ children: e, className: t }) {
|
|
2059
2060
|
return /* @__PURE__ */ H("div", {
|
|
2060
2061
|
"data-slot": "chat-notification-card-content-actions",
|
|
2061
2062
|
"data-testid": "chat-notification-card-content-actions",
|
|
@@ -2064,8 +2065,8 @@ function da({ children: e, className: t }) {
|
|
|
2064
2065
|
children: e
|
|
2065
2066
|
});
|
|
2066
2067
|
}
|
|
2067
|
-
var
|
|
2068
|
-
let { isExpanded: a, toggleExpanded: o } =
|
|
2068
|
+
var va = P(function({ className: e, onMouseDown: t, onClick: n, ...r }, i) {
|
|
2069
|
+
let { isExpanded: a, toggleExpanded: o } = Qi();
|
|
2069
2070
|
function s(e) {
|
|
2070
2071
|
e.stopPropagation(), t?.(e);
|
|
2071
2072
|
}
|
|
@@ -2083,30 +2084,30 @@ var fa = P(function({ className: e, onMouseDown: t, onClick: n, ...r }, i) {
|
|
|
2083
2084
|
onMouseDown: s,
|
|
2084
2085
|
onClick: c,
|
|
2085
2086
|
...r,
|
|
2086
|
-
children: H(a ?
|
|
2087
|
+
children: H(a ? wt : Ct, {})
|
|
2087
2088
|
});
|
|
2088
2089
|
});
|
|
2089
|
-
|
|
2090
|
-
var
|
|
2090
|
+
va.displayName = "ChatNotificationCardExpandButton";
|
|
2091
|
+
var ya = na, ba = ga, xa = ca;
|
|
2091
2092
|
//#endregion
|
|
2092
2093
|
//#region src/components/chat-notification-popup/chat-notification-popup.tsx
|
|
2093
|
-
function
|
|
2094
|
-
return /* @__PURE__ */ H(
|
|
2094
|
+
function Sa({ children: e, ...t }) {
|
|
2095
|
+
return /* @__PURE__ */ H(se, {
|
|
2095
2096
|
...t,
|
|
2096
2097
|
children: e
|
|
2097
2098
|
});
|
|
2098
2099
|
}
|
|
2099
|
-
var
|
|
2100
|
-
return /* @__PURE__ */ H(
|
|
2100
|
+
var Ca = P(function({ children: e, ...t }, n) {
|
|
2101
|
+
return /* @__PURE__ */ H(le, {
|
|
2101
2102
|
ref: n,
|
|
2102
2103
|
"data-slot": "chat-notification-popup-trigger",
|
|
2103
2104
|
...t,
|
|
2104
2105
|
children: e
|
|
2105
2106
|
});
|
|
2106
2107
|
});
|
|
2107
|
-
|
|
2108
|
-
var
|
|
2109
|
-
return /* @__PURE__ */ H(
|
|
2108
|
+
Ca.displayName = "ChatNotificationPopupTrigger";
|
|
2109
|
+
var wa = P(function({ children: e, className: t, ...n }, r) {
|
|
2110
|
+
return /* @__PURE__ */ H(ce, {
|
|
2110
2111
|
ref: r,
|
|
2111
2112
|
"data-slot": "chat-notification-popup-content",
|
|
2112
2113
|
className: M("md:w-[467px]", t),
|
|
@@ -2114,10 +2115,10 @@ var va = P(function({ children: e, className: t, ...n }, r) {
|
|
|
2114
2115
|
children: e
|
|
2115
2116
|
});
|
|
2116
2117
|
});
|
|
2117
|
-
|
|
2118
|
+
wa.displayName = "ChatNotificationPopupContent";
|
|
2118
2119
|
//#endregion
|
|
2119
2120
|
//#region src/components/chat-reply/chat-reply.tsx
|
|
2120
|
-
function
|
|
2121
|
+
function Ta({ className: e, children: t, hasPadding: n = !0 }) {
|
|
2121
2122
|
return /* @__PURE__ */ H("ul", {
|
|
2122
2123
|
"data-testid": "chat-replies",
|
|
2123
2124
|
"data-slot": "chat-replies",
|
|
@@ -2126,7 +2127,7 @@ function ya({ className: e, children: t, hasPadding: n = !0 }) {
|
|
|
2126
2127
|
children: t
|
|
2127
2128
|
});
|
|
2128
2129
|
}
|
|
2129
|
-
function
|
|
2130
|
+
function Ea({ className: e, children: t, isMultiline: n = !1, ...r }) {
|
|
2130
2131
|
return /* @__PURE__ */ H("li", {
|
|
2131
2132
|
"data-testid": "chat-reply",
|
|
2132
2133
|
"data-slot": "chat-reply",
|
|
@@ -2136,7 +2137,7 @@ function ba({ className: e, children: t, isMultiline: n = !1, ...r }) {
|
|
|
2136
2137
|
children: t
|
|
2137
2138
|
});
|
|
2138
2139
|
}
|
|
2139
|
-
function
|
|
2140
|
+
function Da({ className: e, children: t, ...n }) {
|
|
2140
2141
|
return /* @__PURE__ */ H(o, {
|
|
2141
2142
|
variant: "outlined",
|
|
2142
2143
|
size: "sm",
|
|
@@ -2148,7 +2149,7 @@ function xa({ className: e, children: t, ...n }) {
|
|
|
2148
2149
|
children: t
|
|
2149
2150
|
});
|
|
2150
2151
|
}
|
|
2151
|
-
function
|
|
2152
|
+
function Oa({ className: e, children: t, asChild: n = !1, ...r }) {
|
|
2152
2153
|
return /* @__PURE__ */ H(j, {
|
|
2153
2154
|
"data-testid": "chat-reply-value",
|
|
2154
2155
|
"data-slot": "chat-reply-value",
|
|
@@ -2161,13 +2162,13 @@ function Sa({ className: e, children: t, asChild: n = !1, ...r }) {
|
|
|
2161
2162
|
}
|
|
2162
2163
|
//#endregion
|
|
2163
2164
|
//#region src/components/chat-suggestion/chat-suggestion.tsx
|
|
2164
|
-
var
|
|
2165
|
-
function
|
|
2166
|
-
let e = I(
|
|
2165
|
+
var ka = N(null);
|
|
2166
|
+
function Aa() {
|
|
2167
|
+
let e = I(ka);
|
|
2167
2168
|
if (!e) throw Error("\"useChatSuggestionContext\" must be used within a ChatSuggestion");
|
|
2168
2169
|
return e;
|
|
2169
2170
|
}
|
|
2170
|
-
var
|
|
2171
|
+
var ja = P(function({ children: e, className: t, hasLoop: n = !0, ...r }, i) {
|
|
2171
2172
|
return /* @__PURE__ */ H(v, {
|
|
2172
2173
|
asChild: !0,
|
|
2173
2174
|
hasLoop: n,
|
|
@@ -2177,17 +2178,17 @@ var Ta = P(function({ children: e, className: t, hasLoop: n = !0, ...r }, i) {
|
|
|
2177
2178
|
"data-slot": "chat-suggestions",
|
|
2178
2179
|
"data-testid": "chat-suggestions",
|
|
2179
2180
|
className: M("m-0 p-0 list-none flex flex-col items-stretch gap-0", t),
|
|
2180
|
-
children:
|
|
2181
|
+
children: _e.map(e, (e, t) => ye(e) ? ve(e, { index: t }) : e)
|
|
2181
2182
|
})
|
|
2182
2183
|
});
|
|
2183
2184
|
});
|
|
2184
|
-
|
|
2185
|
-
var
|
|
2185
|
+
ja.displayName = "ChatSuggestions";
|
|
2186
|
+
var Ma = P(function({ index: e, children: t, className: n, triggerClassName: r, onHover: i, onMouseEnter: a, ...o }, s) {
|
|
2186
2187
|
let c = z(() => ({ index: e }), [e]);
|
|
2187
2188
|
function l(e) {
|
|
2188
2189
|
a?.(e), i?.();
|
|
2189
2190
|
}
|
|
2190
|
-
return /* @__PURE__ */ H(
|
|
2191
|
+
return /* @__PURE__ */ H(ka.Provider, {
|
|
2191
2192
|
value: c,
|
|
2192
2193
|
children: /* @__PURE__ */ U(y, {
|
|
2193
2194
|
ref: s,
|
|
@@ -2199,9 +2200,9 @@ var Ea = P(function({ index: e, children: t, className: n, triggerClassName: r,
|
|
|
2199
2200
|
})
|
|
2200
2201
|
});
|
|
2201
2202
|
});
|
|
2202
|
-
|
|
2203
|
-
function
|
|
2204
|
-
let { index: r = 0 } =
|
|
2203
|
+
Ma.displayName = "ChatSuggestion";
|
|
2204
|
+
function Na({ children: e, className: t, innerClassName: n }) {
|
|
2205
|
+
let { index: r = 0 } = Aa();
|
|
2205
2206
|
return /* @__PURE__ */ H("span", {
|
|
2206
2207
|
"aria-hidden": "true",
|
|
2207
2208
|
"data-slot": "chat-suggestion-label-icon",
|
|
@@ -2220,7 +2221,7 @@ function Da({ children: e, className: t, innerClassName: n }) {
|
|
|
2220
2221
|
})
|
|
2221
2222
|
});
|
|
2222
2223
|
}
|
|
2223
|
-
function
|
|
2224
|
+
function Pa({ children: e, className: t, isMultiline: n = !0 }) {
|
|
2224
2225
|
return /* @__PURE__ */ H(j, {
|
|
2225
2226
|
variant: "body-small-low",
|
|
2226
2227
|
"data-slot": "chat-suggestion-label",
|
|
@@ -2230,7 +2231,7 @@ function Oa({ children: e, className: t, isMultiline: n = !0 }) {
|
|
|
2230
2231
|
children: /* @__PURE__ */ H(x, { children: e })
|
|
2231
2232
|
});
|
|
2232
2233
|
}
|
|
2233
|
-
function
|
|
2234
|
+
function Fa({ children: e, className: t }) {
|
|
2234
2235
|
return /* @__PURE__ */ H("div", {
|
|
2235
2236
|
role: "group",
|
|
2236
2237
|
"data-slot": "chat-suggestion-actions",
|
|
@@ -2238,7 +2239,7 @@ function ka({ children: e, className: t }) {
|
|
|
2238
2239
|
children: e
|
|
2239
2240
|
});
|
|
2240
2241
|
}
|
|
2241
|
-
var
|
|
2242
|
+
var Ia = P(function({ className: e, children: t, ...n }, r) {
|
|
2242
2243
|
return /* @__PURE__ */ H(b, {
|
|
2243
2244
|
ref: r,
|
|
2244
2245
|
className: M("pointer-events-auto", e),
|
|
@@ -2246,30 +2247,30 @@ var Aa = P(function({ className: e, children: t, ...n }, r) {
|
|
|
2246
2247
|
children: t
|
|
2247
2248
|
});
|
|
2248
2249
|
});
|
|
2249
|
-
|
|
2250
|
+
Ia.displayName = "ChatSuggestionAction";
|
|
2250
2251
|
//#endregion
|
|
2251
2252
|
//#region src/components/chat-thread/chat-thread.tsx
|
|
2252
|
-
function
|
|
2253
|
+
function La(e, t) {
|
|
2253
2254
|
let n = P((t, n) => e({
|
|
2254
2255
|
...t,
|
|
2255
2256
|
ref: n
|
|
2256
2257
|
}));
|
|
2257
2258
|
return n.displayName = t, n;
|
|
2258
2259
|
}
|
|
2259
|
-
var
|
|
2260
|
-
function
|
|
2260
|
+
var Ra = La(tn.Viewport, "ChatThreadViewportPrimitive"), za = La(tn.Content, "ChatThreadContentPrimitive"), Ba = La(tn.Item, "ChatThreadItemPrimitive");
|
|
2261
|
+
function Va(e, t) {
|
|
2261
2262
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
2262
2263
|
}
|
|
2263
|
-
var
|
|
2264
|
+
var Ha = 12, Ua = "--chat-thread-group-min-height", Wa = {
|
|
2264
2265
|
scrollToEnd: () => !1,
|
|
2265
2266
|
scrollToMessage: () => !1,
|
|
2266
2267
|
scrollToStart: () => !1
|
|
2267
|
-
},
|
|
2268
|
-
function
|
|
2269
|
-
return I(
|
|
2268
|
+
}, Ga = N(null);
|
|
2269
|
+
function Ka() {
|
|
2270
|
+
return I(Ga) ?? Wa;
|
|
2270
2271
|
}
|
|
2271
|
-
function
|
|
2272
|
-
let { scrollToEnd: t, scrollToMessage: n, scrollToStart: r } =
|
|
2272
|
+
function qa({ children: e }) {
|
|
2273
|
+
let { scrollToEnd: t, scrollToMessage: n, scrollToStart: r } = nn(), i = z(() => ({
|
|
2273
2274
|
scrollToEnd: t,
|
|
2274
2275
|
scrollToMessage: n,
|
|
2275
2276
|
scrollToStart: r
|
|
@@ -2278,27 +2279,27 @@ function Va({ children: e }) {
|
|
|
2278
2279
|
n,
|
|
2279
2280
|
r
|
|
2280
2281
|
]);
|
|
2281
|
-
return /* @__PURE__ */ H(
|
|
2282
|
+
return /* @__PURE__ */ H(Ga.Provider, {
|
|
2282
2283
|
value: i,
|
|
2283
2284
|
children: e
|
|
2284
2285
|
});
|
|
2285
2286
|
}
|
|
2286
|
-
var
|
|
2287
|
-
function
|
|
2288
|
-
let t = I(
|
|
2287
|
+
var Ja = N(null);
|
|
2288
|
+
function Ya(e) {
|
|
2289
|
+
let t = I(Ja);
|
|
2289
2290
|
if (!t) throw Error(`[web-chat-ui] <${e}> must be rendered inside <ChatThreadProvider>`);
|
|
2290
2291
|
return t;
|
|
2291
2292
|
}
|
|
2292
|
-
function
|
|
2293
|
+
function Xa(e, t, n) {
|
|
2293
2294
|
return {
|
|
2294
2295
|
id: e,
|
|
2295
2296
|
conversationId: t ?? null,
|
|
2296
2297
|
knownGroupIds: n.length === 0 ? null : new Set(n)
|
|
2297
2298
|
};
|
|
2298
2299
|
}
|
|
2299
|
-
function
|
|
2300
|
-
let [u, d] = V(() =>
|
|
2301
|
-
(u.conversationId !== (t ?? null) || u.knownGroupIds === null != (n.length === 0)) && d(
|
|
2300
|
+
function Za({ children: e, conversationId: t, groupIds: n, isStreaming: r = !1, scrollMode: i = "anchor", autoScroll: a = i === "follow" || !r, defaultScrollPosition: o = "end", scrollPreviousItemPeek: s = 0, scrollMargin: c = Ha, ...l }) {
|
|
2301
|
+
let [u, d] = V(() => Xa(0, t, n));
|
|
2302
|
+
(u.conversationId !== (t ?? null) || u.knownGroupIds === null != (n.length === 0)) && d(Xa(u.id + 1, t, n));
|
|
2302
2303
|
let { knownGroupIds: f } = u, p = z(() => ({
|
|
2303
2304
|
isStreaming: r,
|
|
2304
2305
|
scrollMargin: c,
|
|
@@ -2310,23 +2311,23 @@ function Ga({ children: e, conversationId: t, groupIds: n, isStreaming: r = !1,
|
|
|
2310
2311
|
i,
|
|
2311
2312
|
f
|
|
2312
2313
|
]);
|
|
2313
|
-
return /* @__PURE__ */ H(
|
|
2314
|
+
return /* @__PURE__ */ H(tn.Provider, {
|
|
2314
2315
|
autoScroll: a,
|
|
2315
2316
|
scrollPreviousItemPeek: s,
|
|
2316
2317
|
scrollMargin: c,
|
|
2317
2318
|
defaultScrollPosition: o,
|
|
2318
2319
|
...l,
|
|
2319
|
-
children: /* @__PURE__ */ U(
|
|
2320
|
+
children: /* @__PURE__ */ U(Ja.Provider, {
|
|
2320
2321
|
value: p,
|
|
2321
|
-
children: [i === "follow" && /* @__PURE__ */ H(
|
|
2322
|
+
children: [i === "follow" && /* @__PURE__ */ H(Qa, {
|
|
2322
2323
|
groupIds: n,
|
|
2323
2324
|
knownGroupIds: f
|
|
2324
|
-
}), /* @__PURE__ */ H(
|
|
2325
|
+
}), /* @__PURE__ */ H(qa, { children: e })]
|
|
2325
2326
|
})
|
|
2326
2327
|
}, u.id);
|
|
2327
2328
|
}
|
|
2328
|
-
function
|
|
2329
|
-
let { scrollToEnd: n } =
|
|
2329
|
+
function Qa({ groupIds: e, knownGroupIds: t }) {
|
|
2330
|
+
let { scrollToEnd: n } = nn(), r = e.at(-1);
|
|
2330
2331
|
return R(() => {
|
|
2331
2332
|
r === void 0 || t === null || t.has(r) || n({ behavior: "auto" });
|
|
2332
2333
|
}, [
|
|
@@ -2335,13 +2336,13 @@ function Ka({ groupIds: e, knownGroupIds: t }) {
|
|
|
2335
2336
|
n
|
|
2336
2337
|
]), null;
|
|
2337
2338
|
}
|
|
2338
|
-
var
|
|
2339
|
-
let { isStreaming: h, scrollMargin: g, scrollMode: _ } =
|
|
2340
|
-
y.current = e,
|
|
2339
|
+
var $a = P(function({ children: e, className: t, viewportClassName: n, contentClassName: r, viewportRef: i, contentRef: a, scrollButton: o = !0, scrollButtonClassName: s, scrollButtonTooltip: c, isLoading: l = !1, hasError: u = !1, error: d, renderError: f, ...p }, m) {
|
|
2340
|
+
let { isStreaming: h, scrollMargin: g, scrollMode: _ } = Ya("ChatThread"), v = _ === "anchor", y = B(null), b = B(null), x = F((e) => {
|
|
2341
|
+
y.current = e, Va(i, e), Va(m, e?.parentElement ?? null);
|
|
2341
2342
|
}, [i, m]), S = F((e) => {
|
|
2342
|
-
b.current = e,
|
|
2343
|
+
b.current = e, Va(a, e);
|
|
2343
2344
|
}, [a]);
|
|
2344
|
-
return
|
|
2345
|
+
return eo(y, b, g, v), /* @__PURE__ */ U(tn.Root, {
|
|
2345
2346
|
"data-slot": "chat-thread",
|
|
2346
2347
|
"data-testid": "chat-thread",
|
|
2347
2348
|
"data-scroll-mode": _,
|
|
@@ -2351,7 +2352,7 @@ var qa = P(function({ children: e, className: t, viewportClassName: n, contentCl
|
|
|
2351
2352
|
className: M("relative flex flex-col flex-1 min-h-0 overflow-hidden", t),
|
|
2352
2353
|
...p,
|
|
2353
2354
|
children: [
|
|
2354
|
-
/* @__PURE__ */ H(
|
|
2355
|
+
/* @__PURE__ */ H(Ra, {
|
|
2355
2356
|
ref: x,
|
|
2356
2357
|
"data-slot": "chat-thread-viewport",
|
|
2357
2358
|
"aria-label": "Chat message history",
|
|
@@ -2361,7 +2362,7 @@ var qa = P(function({ children: e, className: t, viewportClassName: n, contentCl
|
|
|
2361
2362
|
scrollbarWidth: "thin",
|
|
2362
2363
|
scrollbarColor: "var(--color-scrollbar-thumb) transparent"
|
|
2363
2364
|
},
|
|
2364
|
-
children: /* @__PURE__ */ H(
|
|
2365
|
+
children: /* @__PURE__ */ H(za, {
|
|
2365
2366
|
ref: S,
|
|
2366
2367
|
"data-slot": "chat-thread-content",
|
|
2367
2368
|
"aria-busy": h,
|
|
@@ -2370,29 +2371,29 @@ var qa = P(function({ children: e, className: t, viewportClassName: n, contentCl
|
|
|
2370
2371
|
children: e
|
|
2371
2372
|
})
|
|
2372
2373
|
}),
|
|
2373
|
-
u && !l && /* @__PURE__ */ H(
|
|
2374
|
+
u && !l && /* @__PURE__ */ H(ao, {
|
|
2374
2375
|
error: d,
|
|
2375
2376
|
children: f?.(d)
|
|
2376
2377
|
}),
|
|
2377
|
-
o && /* @__PURE__ */ H(
|
|
2378
|
+
o && /* @__PURE__ */ H(io, {
|
|
2378
2379
|
className: s,
|
|
2379
2380
|
tooltip: c
|
|
2380
2381
|
})
|
|
2381
2382
|
]
|
|
2382
2383
|
});
|
|
2383
2384
|
});
|
|
2384
|
-
|
|
2385
|
-
function
|
|
2385
|
+
$a.displayName = "ChatThread";
|
|
2386
|
+
function eo(e, t, n, r) {
|
|
2386
2387
|
R(() => {
|
|
2387
2388
|
let i = e.current, a = t.current;
|
|
2388
2389
|
if (!i || !a) return;
|
|
2389
2390
|
if (!r) {
|
|
2390
|
-
a.style.removeProperty(
|
|
2391
|
+
a.style.removeProperty(Ua);
|
|
2391
2392
|
return;
|
|
2392
2393
|
}
|
|
2393
2394
|
let o = () => {
|
|
2394
2395
|
let { paddingTop: e, paddingBottom: t } = window.getComputedStyle(a), r = i.clientHeight - (Number.parseFloat(e) || 0) - (Number.parseFloat(t) || 0) - n;
|
|
2395
|
-
a.style.setProperty(
|
|
2396
|
+
a.style.setProperty(Ua, `${Math.max(0, r)}px`);
|
|
2396
2397
|
};
|
|
2397
2398
|
if (o(), typeof ResizeObserver > "u") return;
|
|
2398
2399
|
let s = new ResizeObserver(o);
|
|
@@ -2404,9 +2405,9 @@ function Ja(e, t, n, r) {
|
|
|
2404
2405
|
r
|
|
2405
2406
|
]);
|
|
2406
2407
|
}
|
|
2407
|
-
var
|
|
2408
|
-
let { knownGroupIds: a, scrollMode: o } =
|
|
2409
|
-
return /* @__PURE__ */ H(
|
|
2408
|
+
var to = P(function({ groupId: e, className: t, children: n, ...r }, i) {
|
|
2409
|
+
let { knownGroupIds: a, scrollMode: o } = Ya("ChatThreadGroup"), s = o === "anchor" && a !== null && !a.has(e);
|
|
2410
|
+
return /* @__PURE__ */ H(Ba, {
|
|
2410
2411
|
ref: i,
|
|
2411
2412
|
messageId: `chat-thread-group-${e}`,
|
|
2412
2413
|
scrollAnchor: s,
|
|
@@ -2417,8 +2418,8 @@ var Ya = P(function({ groupId: e, className: t, children: n, ...r }, i) {
|
|
|
2417
2418
|
children: n
|
|
2418
2419
|
});
|
|
2419
2420
|
});
|
|
2420
|
-
|
|
2421
|
-
var
|
|
2421
|
+
to.displayName = "ChatThreadGroup";
|
|
2422
|
+
var no = P(function({ messageId: e, children: t, ...n }, r) {
|
|
2422
2423
|
return /* @__PURE__ */ H("div", {
|
|
2423
2424
|
ref: r,
|
|
2424
2425
|
"data-slot": "chat-thread-question",
|
|
@@ -2428,8 +2429,8 @@ var Xa = P(function({ messageId: e, children: t, ...n }, r) {
|
|
|
2428
2429
|
children: t
|
|
2429
2430
|
});
|
|
2430
2431
|
});
|
|
2431
|
-
|
|
2432
|
-
var
|
|
2432
|
+
no.displayName = "ChatThreadQuestion";
|
|
2433
|
+
var ro = P(function({ messageId: e, children: t, ...n }, r) {
|
|
2433
2434
|
return /* @__PURE__ */ H("div", {
|
|
2434
2435
|
ref: r,
|
|
2435
2436
|
"data-slot": "chat-thread-answer",
|
|
@@ -2439,16 +2440,16 @@ var Za = P(function({ messageId: e, children: t, ...n }, r) {
|
|
|
2439
2440
|
children: t
|
|
2440
2441
|
});
|
|
2441
2442
|
});
|
|
2442
|
-
|
|
2443
|
-
function
|
|
2444
|
-
let { end: n } =
|
|
2443
|
+
ro.displayName = "ChatThreadAnswer";
|
|
2444
|
+
function io({ className: e, tooltip: t }) {
|
|
2445
|
+
let { end: n } = rn();
|
|
2445
2446
|
return /* @__PURE__ */ H("div", {
|
|
2446
2447
|
"data-slot": "chat-thread-scroll-button",
|
|
2447
2448
|
"data-testid": "chat-message-history-scroll-button",
|
|
2448
2449
|
"data-hidden": !n,
|
|
2449
2450
|
"aria-hidden": !n || void 0,
|
|
2450
2451
|
className: M("absolute", "px-[12px]", "bottom-0", "right-0 -translate-x-[12px]", "md:right-auto md:left-1/2 md:-translate-x-1/2", "-translate-y-[12px]", "flex items-center justify-center", "transition-opacity duration-200 ease-in-out", "data-[hidden=true]:pointer-events-none", "data-[hidden=true]:opacity-0 data-[hidden=false]:opacity-100", e),
|
|
2451
|
-
children: /* @__PURE__ */ H(
|
|
2452
|
+
children: /* @__PURE__ */ H(tn.Button, {
|
|
2452
2453
|
direction: "end",
|
|
2453
2454
|
render: ({ inert: e, children: n, ...r }) => /* @__PURE__ */ H(A, {
|
|
2454
2455
|
tooltip: t,
|
|
@@ -2461,13 +2462,13 @@ function Qa({ className: e, tooltip: t }) {
|
|
|
2461
2462
|
size: "md",
|
|
2462
2463
|
tabIndex: -1,
|
|
2463
2464
|
"aria-label": t,
|
|
2464
|
-
children: /* @__PURE__ */ H(
|
|
2465
|
+
children: /* @__PURE__ */ H(Ct, {})
|
|
2465
2466
|
})
|
|
2466
2467
|
})
|
|
2467
2468
|
})
|
|
2468
2469
|
});
|
|
2469
2470
|
}
|
|
2470
|
-
function
|
|
2471
|
+
function ao({ children: e, error: t, className: n }) {
|
|
2471
2472
|
return /* @__PURE__ */ H("div", {
|
|
2472
2473
|
"data-slot": "chat-thread-error-state",
|
|
2473
2474
|
"data-testid": "chat-message-history-error-state",
|
|
@@ -2483,7 +2484,7 @@ function $a({ children: e, error: t, className: n }) {
|
|
|
2483
2484
|
}
|
|
2484
2485
|
//#endregion
|
|
2485
2486
|
//#region src/components/chat-artifact/chat-artifact.tsx
|
|
2486
|
-
function
|
|
2487
|
+
function oo({ asChild: e = !1, className: n, children: r, ...i }) {
|
|
2487
2488
|
return /* @__PURE__ */ H(t, {
|
|
2488
2489
|
asChild: !0,
|
|
2489
2490
|
children: /* @__PURE__ */ H(e ? W : "button", {
|
|
@@ -2496,7 +2497,7 @@ function eo({ asChild: e = !1, className: n, children: r, ...i }) {
|
|
|
2496
2497
|
})
|
|
2497
2498
|
});
|
|
2498
2499
|
}
|
|
2499
|
-
function
|
|
2500
|
+
function so({ className: e, children: t }) {
|
|
2500
2501
|
return /* @__PURE__ */ H(i, {
|
|
2501
2502
|
"data-slot": "chat-artifact-icon",
|
|
2502
2503
|
"data-testid": "chat-artifact-icon",
|
|
@@ -2504,7 +2505,7 @@ function to({ className: e, children: t }) {
|
|
|
2504
2505
|
children: t
|
|
2505
2506
|
});
|
|
2506
2507
|
}
|
|
2507
|
-
function
|
|
2508
|
+
function co({ className: e, children: t }) {
|
|
2508
2509
|
return /* @__PURE__ */ H("div", {
|
|
2509
2510
|
"data-slot": "chat-artifact-content",
|
|
2510
2511
|
"data-testid": "chat-artifact-content",
|
|
@@ -2512,7 +2513,7 @@ function no({ className: e, children: t }) {
|
|
|
2512
2513
|
children: t
|
|
2513
2514
|
});
|
|
2514
2515
|
}
|
|
2515
|
-
function
|
|
2516
|
+
function lo({ className: e, children: t }) {
|
|
2516
2517
|
return /* @__PURE__ */ H(a, {
|
|
2517
2518
|
"data-slot": "chat-artifact-title",
|
|
2518
2519
|
"data-testid": "chat-artifact-title",
|
|
@@ -2520,7 +2521,7 @@ function ro({ className: e, children: t }) {
|
|
|
2520
2521
|
children: t
|
|
2521
2522
|
});
|
|
2522
2523
|
}
|
|
2523
|
-
function
|
|
2524
|
+
function uo({ className: e, children: t }) {
|
|
2524
2525
|
return /* @__PURE__ */ H(r, {
|
|
2525
2526
|
"data-slot": "chat-artifact-caption",
|
|
2526
2527
|
"data-testid": "chat-artifact-caption",
|
|
@@ -2528,7 +2529,7 @@ function io({ className: e, children: t }) {
|
|
|
2528
2529
|
children: t
|
|
2529
2530
|
});
|
|
2530
2531
|
}
|
|
2531
|
-
function
|
|
2532
|
+
function fo({ className: e, children: t }) {
|
|
2532
2533
|
return /* @__PURE__ */ H(n, {
|
|
2533
2534
|
role: "group",
|
|
2534
2535
|
"data-slot": "chat-artifact-actions",
|
|
@@ -2540,10 +2541,10 @@ function ao({ className: e, children: t }) {
|
|
|
2540
2541
|
}
|
|
2541
2542
|
//#endregion
|
|
2542
2543
|
//#region src/components/canvas-shell/canvas-shell.tsx
|
|
2543
|
-
function
|
|
2544
|
-
return /* @__PURE__ */ H(
|
|
2544
|
+
function po({ className: e, children: t, ...n }) {
|
|
2545
|
+
return /* @__PURE__ */ H(oe, {
|
|
2545
2546
|
isCollapsible: !1,
|
|
2546
|
-
children: /* @__PURE__ */ H(
|
|
2547
|
+
children: /* @__PURE__ */ H(w, {
|
|
2547
2548
|
"data-slot": "canvas-shell",
|
|
2548
2549
|
className: e,
|
|
2549
2550
|
...n,
|
|
@@ -2551,8 +2552,8 @@ function oo({ className: e, children: t, ...n }) {
|
|
|
2551
2552
|
})
|
|
2552
2553
|
});
|
|
2553
2554
|
}
|
|
2554
|
-
function
|
|
2555
|
-
return /* @__PURE__ */ H(
|
|
2555
|
+
function mo({ className: e, children: t, hasBorder: n = !0, ...r }) {
|
|
2556
|
+
return /* @__PURE__ */ H(D, {
|
|
2556
2557
|
"data-slot": "canvas-shell-header",
|
|
2557
2558
|
hasBorder: n,
|
|
2558
2559
|
className: e,
|
|
@@ -2560,64 +2561,64 @@ function so({ className: e, children: t, hasBorder: n = !0, ...r }) {
|
|
|
2560
2561
|
children: t
|
|
2561
2562
|
});
|
|
2562
2563
|
}
|
|
2563
|
-
function
|
|
2564
|
-
return /* @__PURE__ */ H(
|
|
2564
|
+
function ho({ className: e, children: t, ...n }) {
|
|
2565
|
+
return /* @__PURE__ */ H(O, {
|
|
2565
2566
|
"data-slot": "canvas-shell-title",
|
|
2566
2567
|
className: e,
|
|
2567
2568
|
...n,
|
|
2568
2569
|
children: t
|
|
2569
2570
|
});
|
|
2570
2571
|
}
|
|
2571
|
-
function
|
|
2572
|
-
return /* @__PURE__ */ H(
|
|
2572
|
+
function go({ className: e, children: t, ...n }) {
|
|
2573
|
+
return /* @__PURE__ */ H(re, {
|
|
2573
2574
|
"data-slot": "canvas-shell-close-trigger",
|
|
2574
2575
|
className: e,
|
|
2575
2576
|
...n,
|
|
2576
2577
|
children: t
|
|
2577
2578
|
});
|
|
2578
2579
|
}
|
|
2579
|
-
function
|
|
2580
|
-
return /* @__PURE__ */ H(
|
|
2580
|
+
function _o({ className: e, children: t, isFullScreen: n, labels: r, ...i }) {
|
|
2581
|
+
return /* @__PURE__ */ H(T, {
|
|
2581
2582
|
"data-slot": "canvas-shell-full-screen-trigger",
|
|
2582
2583
|
"aria-pressed": n,
|
|
2583
2584
|
"aria-label": n ? r?.exit ?? "Exit full screen" : r?.enter ?? "Full screen",
|
|
2584
2585
|
className: M("max-md:hidden", e),
|
|
2585
2586
|
...i,
|
|
2586
|
-
children: t || /* @__PURE__ */ H(
|
|
2587
|
+
children: t || /* @__PURE__ */ H(Ht, {})
|
|
2587
2588
|
});
|
|
2588
2589
|
}
|
|
2589
|
-
function
|
|
2590
|
+
function vo({ className: e, children: t, menuClassName: n, onOpenChange: r, ...i }) {
|
|
2590
2591
|
let [a, o] = V(!1);
|
|
2591
2592
|
function s(e) {
|
|
2592
2593
|
o(e), r?.(e);
|
|
2593
2594
|
}
|
|
2594
|
-
return /* @__PURE__ */ U(
|
|
2595
|
+
return /* @__PURE__ */ U(ne, {
|
|
2595
2596
|
modal: !1,
|
|
2596
2597
|
onOpenChange: s,
|
|
2597
|
-
children: [/* @__PURE__ */ H(
|
|
2598
|
+
children: [/* @__PURE__ */ H(C, {
|
|
2598
2599
|
asChild: !0,
|
|
2599
|
-
children: /* @__PURE__ */ H(
|
|
2600
|
+
children: /* @__PURE__ */ H(T, {
|
|
2600
2601
|
"data-slot": "canvas-shell-options-button",
|
|
2601
2602
|
isActive: a,
|
|
2602
2603
|
"aria-label": "More options",
|
|
2603
2604
|
className: e,
|
|
2604
2605
|
...i,
|
|
2605
|
-
children: /* @__PURE__ */ H(
|
|
2606
|
+
children: /* @__PURE__ */ H(Vt, {})
|
|
2606
2607
|
})
|
|
2607
|
-
}), /* @__PURE__ */ H(
|
|
2608
|
+
}), /* @__PURE__ */ H(ee, {
|
|
2608
2609
|
className: M("w-[200px]", n),
|
|
2609
2610
|
children: t
|
|
2610
2611
|
})]
|
|
2611
2612
|
});
|
|
2612
2613
|
}
|
|
2613
|
-
var
|
|
2614
|
-
function
|
|
2615
|
-
return /* @__PURE__ */ H(
|
|
2614
|
+
var yo = pe;
|
|
2615
|
+
function bo({ className: e, children: t, bodyClassName: n, hasPadding: r = !0, hasScroll: i = !0, ...a }) {
|
|
2616
|
+
return /* @__PURE__ */ H(E, {
|
|
2616
2617
|
"data-slot": "canvas-shell-content",
|
|
2617
2618
|
"data-has-scroll": i,
|
|
2618
2619
|
className: e,
|
|
2619
2620
|
...a,
|
|
2620
|
-
children: /* @__PURE__ */ H(
|
|
2621
|
+
children: /* @__PURE__ */ H(ie, {
|
|
2621
2622
|
"data-slot": "canvas-shell-content-body",
|
|
2622
2623
|
hasPadding: r,
|
|
2623
2624
|
hasScroll: i,
|
|
@@ -2626,8 +2627,8 @@ function mo({ className: e, children: t, bodyClassName: n, hasPadding: r = !0, h
|
|
|
2626
2627
|
})
|
|
2627
2628
|
});
|
|
2628
2629
|
}
|
|
2629
|
-
function
|
|
2630
|
-
return /* @__PURE__ */ H(
|
|
2630
|
+
function xo({ className: e, children: t, ...n }) {
|
|
2631
|
+
return /* @__PURE__ */ H(ae, {
|
|
2631
2632
|
"data-slot": "canvas-shell-footer",
|
|
2632
2633
|
className: e,
|
|
2633
2634
|
...n,
|
|
@@ -2636,7 +2637,7 @@ function ho({ className: e, children: t, ...n }) {
|
|
|
2636
2637
|
}
|
|
2637
2638
|
//#endregion
|
|
2638
2639
|
//#region src/components/new-chat-trigger/new-chat-trigger.tsx
|
|
2639
|
-
var
|
|
2640
|
+
var So = P(({ asChild: e = !1, children: t, onClick: n, ...r }, i) => {
|
|
2640
2641
|
let { goToNewChat: a } = X(), o = e ? W : "button";
|
|
2641
2642
|
function s(e) {
|
|
2642
2643
|
n?.(e), a();
|
|
@@ -2649,10 +2650,467 @@ var go = P(({ asChild: e = !1, children: t, onClick: n, ...r }, i) => {
|
|
|
2649
2650
|
children: t
|
|
2650
2651
|
});
|
|
2651
2652
|
});
|
|
2652
|
-
|
|
2653
|
+
So.displayName = "NewChatTrigger";
|
|
2654
|
+
//#endregion
|
|
2655
|
+
//#region src/components/chat-reasoning/chat-reasoning.tsx
|
|
2656
|
+
var Co = N({ status: "done" }), wo = 1e3, To = {
|
|
2657
|
+
duration: .28,
|
|
2658
|
+
ease: [
|
|
2659
|
+
.4,
|
|
2660
|
+
0,
|
|
2661
|
+
.2,
|
|
2662
|
+
1
|
|
2663
|
+
]
|
|
2664
|
+
}, Eo = {
|
|
2665
|
+
duration: .24,
|
|
2666
|
+
ease: [
|
|
2667
|
+
.2,
|
|
2668
|
+
0,
|
|
2669
|
+
0,
|
|
2670
|
+
1
|
|
2671
|
+
]
|
|
2672
|
+
}, Do = { duration: .35 }, Oo = "\n@keyframes chat-reasoning-shimmer {\n from { background-position: 100% 0; }\n to { background-position: 0% 0; }\n}\n@keyframes chat-reasoning-symbol-turn {\n 0% { transform: rotate(0deg); }\n 55%, 100% { transform: rotate(90deg); }\n}\n@keyframes chat-reasoning-symbol-fade {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.55; }\n}\n@keyframes chat-reasoning-pulse-dot {\n from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ct-reasoning-mark-colour-dot-live) 45%, transparent); }\n to { box-shadow: 0 0 0 6px transparent; }\n}\n@keyframes chat-reasoning-pulse-tile {\n from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--st-colour-layout-foreground-light) 35%, transparent); }\n to { box-shadow: 0 0 0 5px transparent; }\n}\n@keyframes chat-reasoning-open {\n from { height: 0; }\n to { height: var(--radix-collapsible-content-height); }\n}\n@keyframes chat-reasoning-close {\n from { height: var(--radix-collapsible-content-height); }\n to { height: 0; }\n}\n[data-slot='chat-reasoning'][data-status='running'][data-state='closed'] [data-slot='chat-reasoning-trigger-label-line'],\n[data-slot='chat-reasoning-step'][data-live='true'] [data-slot='chat-reasoning-step-text-content'] {\n background-image: linear-gradient(90deg, var(--ct-reasoning-row-colour-shimmer-base) 0%, var(--ct-reasoning-row-colour-shimmer-base) 40%, var(--ct-reasoning-row-colour-shimmer-highlight) 50%, var(--ct-reasoning-row-colour-shimmer-base) 60%, var(--ct-reasoning-row-colour-shimmer-base) 100%);\n background-size: 300% 100%;\n background-clip: text;\n -webkit-background-clip: text;\n color: transparent;\n animation: chat-reasoning-shimmer 2.2s linear infinite;\n}\n[data-slot='chat-reasoning-step'][data-live='true'] [data-slot='chat-reasoning-step-icon-dot'] {\n animation: chat-reasoning-pulse-dot 1.4s ease-out infinite;\n}\n[data-slot='chat-reasoning-step'][data-live='true'] [data-slot='chat-reasoning-step-icon-logo'],\n[data-slot='chat-reasoning-step'][data-live='true'] [data-slot='chat-reasoning-step-icon-web'] {\n animation: chat-reasoning-pulse-tile 1.6s ease-out infinite;\n}\n@media (prefers-reduced-motion: reduce) {\n [data-slot='chat-reasoning'] [data-slot='chat-reasoning-trigger-label-line'],\n [data-slot='chat-reasoning'] [data-slot='chat-reasoning-step-text-content'] {\n background: none;\n color: inherit;\n animation: none;\n }\n [data-slot='chat-reasoning'] [data-slot^='chat-reasoning-step-icon-'] {\n animation: none;\n }\n}\n";
|
|
2673
|
+
function ko(e, t) {
|
|
2674
|
+
if (t !== void 0) return t;
|
|
2675
|
+
if (typeof e == "string" || typeof e == "number") return String(e);
|
|
2676
|
+
}
|
|
2677
|
+
var Ao = P(function({ children: e, className: t, defaultOpen: n = !1, status: r = "done", ...i }, a) {
|
|
2678
|
+
let o = z(() => ({ status: r }), [r]);
|
|
2679
|
+
return /* @__PURE__ */ H(Co.Provider, {
|
|
2680
|
+
value: o,
|
|
2681
|
+
children: /* @__PURE__ */ H(s, {
|
|
2682
|
+
defaultOpen: n,
|
|
2683
|
+
asChild: !0,
|
|
2684
|
+
...i,
|
|
2685
|
+
children: /* @__PURE__ */ U("div", {
|
|
2686
|
+
ref: a,
|
|
2687
|
+
"data-slot": "chat-reasoning",
|
|
2688
|
+
"data-testid": "chat-reasoning",
|
|
2689
|
+
"data-status": r,
|
|
2690
|
+
className: M("group/reasoning @container flex w-full min-w-0 flex-col", "rounded-reasoning-window-base border border-transparent", "data-[state=open]:border-reasoning-window-border", t),
|
|
2691
|
+
children: [e, /* @__PURE__ */ H("style", { children: Oo })]
|
|
2692
|
+
})
|
|
2693
|
+
})
|
|
2694
|
+
});
|
|
2695
|
+
});
|
|
2696
|
+
Ao.displayName = "ChatReasoning";
|
|
2697
|
+
var jo = P(function({ children: e, className: t, ...n }, r) {
|
|
2698
|
+
return /* @__PURE__ */ H(u, {
|
|
2699
|
+
ref: r,
|
|
2700
|
+
"data-slot": "chat-reasoning-trigger",
|
|
2701
|
+
"data-testid": "chat-reasoning-trigger",
|
|
2702
|
+
className: M("group/reasoning-trigger flex w-full min-w-0 items-center text-left", "min-h-reasoning-row-height-desktop gap-reasoning-row-spacing-gap-base", "px-reasoning-row-spacing-padding-horizontal-base py-reasoning-row-spacing-padding-vertical-desktop", "@max-md:min-h-reasoning-row-height-mobile @max-md:py-reasoning-row-spacing-padding-vertical-mobile", "rounded-reasoning-row-base group-data-[state=open]/reasoning:rounded-b-none", "outline outline-transparent", "hover:bg-reasoning-row-background-hover hover:outline-reasoning-row-background-hover", "group-data-[state=open]/reasoning:hover:outline-transparent", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-focus-visible", t),
|
|
2703
|
+
...n,
|
|
2704
|
+
children: e
|
|
2705
|
+
});
|
|
2706
|
+
});
|
|
2707
|
+
jo.displayName = "ChatReasoningTrigger";
|
|
2708
|
+
function Mo({ children: e, className: t, ...n }) {
|
|
2709
|
+
return /* @__PURE__ */ H("span", {
|
|
2710
|
+
"aria-hidden": !0,
|
|
2711
|
+
"data-slot": "chat-reasoning-trigger-symbol-wrapper",
|
|
2712
|
+
className: "flex shrink-0 items-center self-stretch",
|
|
2713
|
+
children: /* @__PURE__ */ H("span", {
|
|
2714
|
+
"data-slot": "chat-reasoning-trigger-symbol",
|
|
2715
|
+
"data-testid": "chat-reasoning-trigger-symbol",
|
|
2716
|
+
className: M("flex size-16 items-center justify-center", "text-reasoning-row-text group-data-[status=done]/reasoning:text-reasoning-row-icon", "[&>svg]:size-16", t),
|
|
2717
|
+
...n,
|
|
2718
|
+
children: e
|
|
2719
|
+
})
|
|
2720
|
+
});
|
|
2721
|
+
}
|
|
2722
|
+
var No = "M0 8.65206C0 9.06414 0.0550629 9.47298 0.16195 9.87046C0.500425 11.1181 1.39277 12.1742 2.61225 12.768L6.3954 14.6126L10.185 12.7648C11.3203 12.2115 12.1851 11.2397 12.5592 10.1008C12.7131 9.63197 12.7908 9.14526 12.7908 8.65206V0H0V8.65206Z", Po = "M1.15237 8.97959L2.73841 7.38436C3.25351 7.69767 3.84598 7.86764 4.46289 7.86764C5.07979 7.86764 5.67227 7.69767 6.18737 7.38436L7.77137 8.97754L8.92374 7.81849L7.33771 6.22326C7.9709 5.1584 7.9709 3.81914 7.33771 2.75634L8.92374 1.1611L7.77137 0.00204784L6.18737 1.59523C5.67227 1.28192 5.07979 1.11195 4.46289 1.11195C3.84598 1.11195 3.25351 1.28192 2.73841 1.59523L1.15237 0L0 1.15905L1.584 2.75224C1.27249 3.27033 1.10351 3.86624 1.10351 4.48672C1.10351 5.10721 1.27249 5.70312 1.584 6.22121L0 7.81439L1.15237 8.97345V8.97959ZM3.2413 3.26419C3.56705 2.93654 4.00072 2.75634 4.46289 2.75634C4.92506 2.75634 5.35873 2.93654 5.68448 3.26419C6.3584 3.94201 6.3584 5.04373 5.68448 5.72155C5.35873 6.04919 4.92506 6.23145 4.46289 6.23145C4.00072 6.23145 3.56705 6.05124 3.2413 5.72155C2.91554 5.39185 2.73433 4.95772 2.73433 4.49287C2.73433 4.02802 2.9135 3.59184 3.2413 3.26419Z";
|
|
2723
|
+
function Fo({ className: e, ...t }) {
|
|
2724
|
+
let n = `chat-reasoning-symbol-${xe().replace(/:/g, "")}`;
|
|
2725
|
+
return /* @__PURE__ */ U("svg", {
|
|
2726
|
+
"aria-hidden": !0,
|
|
2727
|
+
viewBox: "0 0 16 16",
|
|
2728
|
+
width: "16",
|
|
2729
|
+
height: "16",
|
|
2730
|
+
fill: "none",
|
|
2731
|
+
"data-slot": "chat-reasoning-trigger-symbol-swisper",
|
|
2732
|
+
"data-testid": "chat-reasoning-trigger-symbol-swisper",
|
|
2733
|
+
className: M("motion-reduce:group-data-[status=running]/reasoning:animate-[chat-reasoning-symbol-fade_1.6s_ease-in-out_infinite]", e),
|
|
2734
|
+
...t,
|
|
2735
|
+
children: [/* @__PURE__ */ U("mask", {
|
|
2736
|
+
id: n,
|
|
2737
|
+
maskUnits: "userSpaceOnUse",
|
|
2738
|
+
x: "0",
|
|
2739
|
+
y: "0",
|
|
2740
|
+
width: "16",
|
|
2741
|
+
height: "16",
|
|
2742
|
+
children: [/* @__PURE__ */ H("rect", {
|
|
2743
|
+
width: "16",
|
|
2744
|
+
height: "16",
|
|
2745
|
+
fill: "white"
|
|
2746
|
+
}), /* @__PURE__ */ H("g", {
|
|
2747
|
+
transform: "translate(3.5384 3.5783)",
|
|
2748
|
+
children: /* @__PURE__ */ H("path", {
|
|
2749
|
+
d: Po,
|
|
2750
|
+
fill: "black",
|
|
2751
|
+
className: M("[transform-box:fill-box] [transform-origin:center]", "motion-safe:group-data-[status=running]/reasoning:animate-[chat-reasoning-symbol-turn_1.1s_cubic-bezier(0.65,0,0.35,1)_infinite]")
|
|
2752
|
+
})
|
|
2753
|
+
})]
|
|
2754
|
+
}), /* @__PURE__ */ H("g", {
|
|
2755
|
+
mask: `url(#${n})`,
|
|
2756
|
+
children: /* @__PURE__ */ H("path", {
|
|
2757
|
+
d: No,
|
|
2758
|
+
transform: "translate(1.6044 1.3328)",
|
|
2759
|
+
fill: "currentColor"
|
|
2760
|
+
})
|
|
2761
|
+
})]
|
|
2762
|
+
});
|
|
2763
|
+
}
|
|
2764
|
+
function Io(e, t, n) {
|
|
2765
|
+
let [r, i] = V({
|
|
2766
|
+
key: e,
|
|
2767
|
+
content: t
|
|
2768
|
+
}), a = B(Date.now());
|
|
2769
|
+
return L(() => {
|
|
2770
|
+
if (e === r.key) {
|
|
2771
|
+
t !== r.content && i({
|
|
2772
|
+
key: e,
|
|
2773
|
+
content: t
|
|
2774
|
+
});
|
|
2775
|
+
return;
|
|
2776
|
+
}
|
|
2777
|
+
let o = n ? Math.max(0, wo - (Date.now() - a.current)) : 0, s = setTimeout(() => {
|
|
2778
|
+
a.current = Date.now(), i({
|
|
2779
|
+
key: e,
|
|
2780
|
+
content: t
|
|
2781
|
+
});
|
|
2782
|
+
}, o);
|
|
2783
|
+
return () => clearTimeout(s);
|
|
2784
|
+
}, [
|
|
2785
|
+
e,
|
|
2786
|
+
t,
|
|
2787
|
+
n,
|
|
2788
|
+
r.key,
|
|
2789
|
+
r.content
|
|
2790
|
+
]), r;
|
|
2791
|
+
}
|
|
2792
|
+
function Lo({ children: e }) {
|
|
2793
|
+
let t = sn(), n = cn();
|
|
2794
|
+
return /* @__PURE__ */ H(on.span, {
|
|
2795
|
+
"aria-hidden": !t,
|
|
2796
|
+
"data-slot": "chat-reasoning-trigger-label-line",
|
|
2797
|
+
className: "truncate [grid-area:1/1]",
|
|
2798
|
+
initial: !n && {
|
|
2799
|
+
y: 10,
|
|
2800
|
+
opacity: 0
|
|
2801
|
+
},
|
|
2802
|
+
animate: {
|
|
2803
|
+
y: 0,
|
|
2804
|
+
opacity: 1
|
|
2805
|
+
},
|
|
2806
|
+
exit: n ? {
|
|
2807
|
+
opacity: 0,
|
|
2808
|
+
transition: { duration: 0 }
|
|
2809
|
+
} : {
|
|
2810
|
+
y: -10,
|
|
2811
|
+
opacity: 0
|
|
2812
|
+
},
|
|
2813
|
+
transition: To,
|
|
2814
|
+
children: e
|
|
2815
|
+
});
|
|
2816
|
+
}
|
|
2817
|
+
function Ro({ children: e, className: t, contentKey: n, ...r }) {
|
|
2818
|
+
let { status: i } = I(Co), a = Io(ko(e, n), e, i === "running");
|
|
2819
|
+
return /* @__PURE__ */ H(j, {
|
|
2820
|
+
asChild: !0,
|
|
2821
|
+
variant: "body-small-low",
|
|
2822
|
+
"data-slot": "chat-reasoning-trigger-label",
|
|
2823
|
+
"data-testid": "chat-reasoning-trigger-label",
|
|
2824
|
+
className: M("grid min-w-0 flex-1 overflow-hidden", "text-reasoning-row-text group-hover/reasoning-trigger:text-reasoning-row-text-hover", t),
|
|
2825
|
+
children: /* @__PURE__ */ H("span", {
|
|
2826
|
+
"aria-live": "polite",
|
|
2827
|
+
...r,
|
|
2828
|
+
children: /* @__PURE__ */ H(an, {
|
|
2829
|
+
initial: !1,
|
|
2830
|
+
children: /* @__PURE__ */ H(Lo, { children: a.content }, a.key ?? "line")
|
|
2831
|
+
})
|
|
2832
|
+
})
|
|
2833
|
+
});
|
|
2834
|
+
}
|
|
2835
|
+
function zo({ className: e, ...t }) {
|
|
2836
|
+
return /* @__PURE__ */ H(c, {
|
|
2837
|
+
"data-slot": "chat-reasoning-trigger-arrow",
|
|
2838
|
+
"data-testid": "chat-reasoning-trigger-arrow",
|
|
2839
|
+
className: M("size-20 items-center justify-center text-reasoning-row-icon", "duration-200 motion-reduce:transition-none [&_svg]:size-20", e),
|
|
2840
|
+
...t
|
|
2841
|
+
});
|
|
2842
|
+
}
|
|
2843
|
+
function Bo({ children: e, className: t, ...n }) {
|
|
2844
|
+
return /* @__PURE__ */ H(l, {
|
|
2845
|
+
"data-slot": "chat-reasoning-steps",
|
|
2846
|
+
"data-testid": "chat-reasoning-steps",
|
|
2847
|
+
className: () => M("overflow-hidden", "data-[state=open]:animate-[chat-reasoning-open_260ms_cubic-bezier(0.4,0,0.2,1)]", "data-[state=closed]:animate-[chat-reasoning-close_260ms_cubic-bezier(0.4,0,0.2,1)]", "motion-reduce:animate-none", t),
|
|
2848
|
+
...n,
|
|
2849
|
+
children: /* @__PURE__ */ H("div", {
|
|
2850
|
+
className: "flex flex-col gap-reasoning-window-spacing-gap-steps py-reasoning-window-spacing-padding-vertical-base",
|
|
2851
|
+
children: e
|
|
2852
|
+
})
|
|
2853
|
+
});
|
|
2854
|
+
}
|
|
2855
|
+
function Vo({ children: e, className: t }) {
|
|
2856
|
+
let { status: n } = I(Co), r = cn(), i = n === "running" && !r;
|
|
2857
|
+
return /* @__PURE__ */ H(on.div, {
|
|
2858
|
+
className: t,
|
|
2859
|
+
initial: i ? {
|
|
2860
|
+
height: 0,
|
|
2861
|
+
opacity: 0,
|
|
2862
|
+
overflow: "hidden"
|
|
2863
|
+
} : !1,
|
|
2864
|
+
animate: {
|
|
2865
|
+
height: "auto",
|
|
2866
|
+
opacity: 1,
|
|
2867
|
+
transitionEnd: { overflow: "visible" }
|
|
2868
|
+
},
|
|
2869
|
+
transition: Eo,
|
|
2870
|
+
children: e
|
|
2871
|
+
});
|
|
2872
|
+
}
|
|
2873
|
+
function Ho({ children: e, className: t, isLive: n = !1, ...r }) {
|
|
2874
|
+
return /* @__PURE__ */ H(Vo, { children: /* @__PURE__ */ H("div", {
|
|
2875
|
+
"data-slot": "chat-reasoning-step",
|
|
2876
|
+
"data-testid": "chat-reasoning-step",
|
|
2877
|
+
"data-live": n,
|
|
2878
|
+
className: M("group/reasoning-step flex flex-col", "pr-reasoning-step-spacing-padding-right-base py-reasoning-step-spacing-padding-vertical-base", t),
|
|
2879
|
+
...r,
|
|
2880
|
+
children: e
|
|
2881
|
+
}) });
|
|
2882
|
+
}
|
|
2883
|
+
function Uo({ children: e, className: t, ...n }) {
|
|
2884
|
+
return /* @__PURE__ */ H("div", {
|
|
2885
|
+
"data-slot": "chat-reasoning-step-head",
|
|
2886
|
+
"data-testid": "chat-reasoning-step-head",
|
|
2887
|
+
className: M("relative flex items-start", "before:absolute before:top-reasoning-step-spacing-trunk-offset-base before:bottom-0 before:left-[17.5px] before:hidden", "before:w-reasoning-tree-line-base before:bg-reasoning-tree-line", "group-has-[[data-slot=chat-reasoning-step-notes]]/reasoning-step:before:block", "group-has-[[data-slot=chat-reasoning-step-notes]]/reasoning-step:pb-reasoning-step-notes-gap-base", t),
|
|
2888
|
+
...n,
|
|
2889
|
+
children: e
|
|
2890
|
+
});
|
|
2891
|
+
}
|
|
2892
|
+
function Wo({ children: e, className: t, ...n }) {
|
|
2893
|
+
return /* @__PURE__ */ H("span", {
|
|
2894
|
+
"data-slot": "chat-reasoning-step-icon-wrapper",
|
|
2895
|
+
className: "relative flex min-h-reasoning-step-text-height-base w-reasoning-step-mark-column-base shrink-0 items-center justify-center",
|
|
2896
|
+
children: /* @__PURE__ */ H("span", {
|
|
2897
|
+
"data-slot": "chat-reasoning-step-icon",
|
|
2898
|
+
"data-testid": "chat-reasoning-step-icon",
|
|
2899
|
+
className: M("flex size-reasoning-mark-ring-base items-center justify-center", t),
|
|
2900
|
+
...n,
|
|
2901
|
+
children: e
|
|
2902
|
+
})
|
|
2903
|
+
});
|
|
2904
|
+
}
|
|
2905
|
+
function Go({ className: e, ...t }) {
|
|
2906
|
+
return /* @__PURE__ */ H("span", {
|
|
2907
|
+
"aria-hidden": !0,
|
|
2908
|
+
"data-slot": "chat-reasoning-step-icon-dot",
|
|
2909
|
+
"data-testid": "chat-reasoning-step-icon-dot",
|
|
2910
|
+
className: M("size-reasoning-mark-dot rounded-full bg-reasoning-mark-dot", "group-data-[live=true]/reasoning-step:size-reasoning-mark-dot-live", "group-data-[live=true]/reasoning-step:bg-reasoning-mark-dot-live", e),
|
|
2911
|
+
...t
|
|
2912
|
+
});
|
|
2913
|
+
}
|
|
2914
|
+
function Ko({ children: e, className: t, ...n }) {
|
|
2915
|
+
return /* @__PURE__ */ H("span", {
|
|
2916
|
+
"data-slot": "chat-reasoning-step-icon-logo",
|
|
2917
|
+
"data-testid": "chat-reasoning-step-icon-logo",
|
|
2918
|
+
className: M("flex size-reasoning-mark-ring-base items-center justify-center rounded-reasoning-mark-logo", "group-data-[live=true]/reasoning-step:bg-reasoning-mark-ring", "[&>img]:size-16 [&>svg]:size-16", t),
|
|
2919
|
+
...n,
|
|
2920
|
+
children: e
|
|
2921
|
+
});
|
|
2922
|
+
}
|
|
2923
|
+
function qo({ children: e, className: t, ...n }) {
|
|
2924
|
+
return /* @__PURE__ */ H("span", {
|
|
2925
|
+
"data-slot": "chat-reasoning-step-icon-web",
|
|
2926
|
+
"data-testid": "chat-reasoning-step-icon-web",
|
|
2927
|
+
className: M("flex size-reasoning-mark-ring-base items-center justify-center rounded-reasoning-mark-web", "text-reasoning-source-icon", "group-data-[live=true]/reasoning-step:bg-reasoning-mark-ring", "group-data-[live=true]/reasoning-step:text-reasoning-mark-icon-live", "[&>img]:size-16 [&>svg]:size-16", t),
|
|
2928
|
+
...n,
|
|
2929
|
+
children: e
|
|
2930
|
+
});
|
|
2931
|
+
}
|
|
2932
|
+
function Jo({ children: e, className: t, contentKey: n, ...r }) {
|
|
2933
|
+
let i = cn();
|
|
2934
|
+
return /* @__PURE__ */ H(j, {
|
|
2935
|
+
asChild: !0,
|
|
2936
|
+
variant: "body-small-low",
|
|
2937
|
+
"data-slot": "chat-reasoning-step-text",
|
|
2938
|
+
"data-testid": "chat-reasoning-step-text",
|
|
2939
|
+
className: M("flex min-h-reasoning-step-text-height-base min-w-0 flex-1 items-center", "text-reasoning-step-text", t),
|
|
2940
|
+
children: /* @__PURE__ */ H("span", {
|
|
2941
|
+
...r,
|
|
2942
|
+
children: /* @__PURE__ */ H(an, {
|
|
2943
|
+
initial: !1,
|
|
2944
|
+
children: /* @__PURE__ */ H(on.span, {
|
|
2945
|
+
"data-slot": "chat-reasoning-step-text-content",
|
|
2946
|
+
initial: !i && { opacity: 0 },
|
|
2947
|
+
animate: { opacity: 1 },
|
|
2948
|
+
transition: Do,
|
|
2949
|
+
children: e
|
|
2950
|
+
}, ko(e, n) ?? "text")
|
|
2951
|
+
})
|
|
2952
|
+
})
|
|
2953
|
+
});
|
|
2954
|
+
}
|
|
2955
|
+
function Yo({ children: e, className: t, ...n }) {
|
|
2956
|
+
return /* @__PURE__ */ H("div", {
|
|
2957
|
+
"data-slot": "chat-reasoning-step-notes",
|
|
2958
|
+
"data-testid": "chat-reasoning-step-notes",
|
|
2959
|
+
className: M("flex flex-col", t),
|
|
2960
|
+
...n,
|
|
2961
|
+
children: e
|
|
2962
|
+
});
|
|
2963
|
+
}
|
|
2964
|
+
var Xo = "absolute left-[17.5px] bg-reasoning-tree-line";
|
|
2965
|
+
function Zo() {
|
|
2966
|
+
return /* @__PURE__ */ U("span", {
|
|
2967
|
+
"aria-hidden": !0,
|
|
2968
|
+
className: "relative w-reasoning-step-mark-column-base shrink-0",
|
|
2969
|
+
children: [
|
|
2970
|
+
/* @__PURE__ */ H("span", { className: M(Xo, "top-0 bottom-0 w-reasoning-tree-line-base", "group-last/reasoning-note:bottom-auto group-last/reasoning-note:h-[5px]") }),
|
|
2971
|
+
/* @__PURE__ */ H("span", { className: M(Xo, "top-[10.5px] h-reasoning-tree-line-base w-reasoning-tree-branch-base", "group-last/reasoning-note:hidden") }),
|
|
2972
|
+
/* @__PURE__ */ H("span", { className: M("absolute top-[4.5px] left-[17.5px] hidden h-[7px] w-reasoning-tree-branch-base", "rounded-bl-reasoning-tree-base border-b border-l border-reasoning-tree-line", "group-last/reasoning-note:block") })
|
|
2973
|
+
]
|
|
2974
|
+
});
|
|
2975
|
+
}
|
|
2976
|
+
function Qo() {
|
|
2977
|
+
return /* @__PURE__ */ U("span", {
|
|
2978
|
+
"aria-hidden": !0,
|
|
2979
|
+
className: "relative w-reasoning-step-mark-column-base shrink-0",
|
|
2980
|
+
children: [
|
|
2981
|
+
/* @__PURE__ */ H("span", { className: M(Xo, "top-0 bottom-0 w-reasoning-tree-line-base", "group-last/reasoning-note:bottom-auto group-last/reasoning-note:h-[11px]") }),
|
|
2982
|
+
/* @__PURE__ */ H("span", { className: M(Xo, "top-[16.5px] h-reasoning-tree-line-base w-reasoning-tree-branch-base", "group-last/reasoning-note:hidden") }),
|
|
2983
|
+
/* @__PURE__ */ H("span", { className: M("absolute top-[10.5px] left-[17.5px] hidden h-[7px] w-reasoning-tree-branch-base", "rounded-bl-reasoning-tree-base border-b border-l border-reasoning-tree-line", "group-last/reasoning-note:block") })
|
|
2984
|
+
]
|
|
2985
|
+
});
|
|
2986
|
+
}
|
|
2987
|
+
function $o({ children: e, className: t, ...n }) {
|
|
2988
|
+
return /* @__PURE__ */ H(Vo, {
|
|
2989
|
+
className: "group/reasoning-note",
|
|
2990
|
+
children: /* @__PURE__ */ U("div", {
|
|
2991
|
+
"data-slot": "chat-reasoning-step-note",
|
|
2992
|
+
"data-testid": "chat-reasoning-step-note",
|
|
2993
|
+
className: M("flex items-stretch", t),
|
|
2994
|
+
...n,
|
|
2995
|
+
children: [/* @__PURE__ */ H(Zo, {}), /* @__PURE__ */ H(j, {
|
|
2996
|
+
asChild: !0,
|
|
2997
|
+
variant: "caption-md",
|
|
2998
|
+
fontWeight: "normal",
|
|
2999
|
+
className: M("min-w-0 flex-1 leading-none text-reasoning-note-text [text-box:trim-both_cap_alphabetic]", "pt-reasoning-note-spacing-padding-top-base pb-reasoning-note-spacing-padding-bottom-base"),
|
|
3000
|
+
children: /* @__PURE__ */ H("span", { children: e })
|
|
3001
|
+
})]
|
|
3002
|
+
})
|
|
3003
|
+
});
|
|
3004
|
+
}
|
|
3005
|
+
function es({ children: e, className: t, ...n }) {
|
|
3006
|
+
return /* @__PURE__ */ H(Vo, {
|
|
3007
|
+
className: "group/reasoning-note",
|
|
3008
|
+
children: /* @__PURE__ */ U("div", {
|
|
3009
|
+
"data-slot": "chat-reasoning-step-note-pages",
|
|
3010
|
+
"data-testid": "chat-reasoning-step-note-pages",
|
|
3011
|
+
className: M("flex items-stretch", t),
|
|
3012
|
+
...n,
|
|
3013
|
+
children: [/* @__PURE__ */ H(Qo, {}), /* @__PURE__ */ H("div", {
|
|
3014
|
+
className: "min-w-0 flex-1 py-reasoning-note-pages-spacing-padding-vertical-base",
|
|
3015
|
+
children: /* @__PURE__ */ H("div", {
|
|
3016
|
+
className: "flex flex-col py-reasoning-note-pages-spacing-padding-list-base",
|
|
3017
|
+
children: e
|
|
3018
|
+
})
|
|
3019
|
+
})]
|
|
3020
|
+
})
|
|
3021
|
+
});
|
|
3022
|
+
}
|
|
3023
|
+
var ts = P(function({ children: e, className: t, asChild: n = !1, ...r }, i) {
|
|
3024
|
+
return /* @__PURE__ */ H(n ? W : "div", {
|
|
3025
|
+
ref: i,
|
|
3026
|
+
"data-slot": "chat-reasoning-step-note-page-row",
|
|
3027
|
+
"data-testid": "chat-reasoning-step-note-page-row",
|
|
3028
|
+
className: M("group/reasoning-page-row flex min-w-0 items-center", "gap-reasoning-page-row-spacing-gap-base rounded-reasoning-page-row-base", "px-reasoning-page-row-spacing-padding-horizontal-base py-reasoning-page-row-spacing-padding-vertical-base", "hover:bg-reasoning-page-row-background-hover", "focus-visible:bg-reasoning-page-row-background-focus focus-visible:outline-2 focus-visible:outline-reasoning-page-row-border-focus", t),
|
|
3029
|
+
...r,
|
|
3030
|
+
children: e
|
|
3031
|
+
});
|
|
3032
|
+
});
|
|
3033
|
+
ts.displayName = "ChatReasoningStepNotePageRow";
|
|
3034
|
+
function ns({ children: e, className: t, ...n }) {
|
|
3035
|
+
return /* @__PURE__ */ H("span", {
|
|
3036
|
+
"data-slot": "chat-reasoning-step-note-page-icon",
|
|
3037
|
+
"data-testid": "chat-reasoning-step-note-page-icon",
|
|
3038
|
+
className: "flex size-reasoning-source-box-medium shrink-0 items-center justify-center",
|
|
3039
|
+
children: /* @__PURE__ */ H(j, {
|
|
3040
|
+
asChild: !0,
|
|
3041
|
+
variant: "caption-md",
|
|
3042
|
+
fontWeight: "normal",
|
|
3043
|
+
className: M("flex size-reasoning-source-favicon-medium items-center justify-center overflow-hidden", "rounded-reasoning-source-favicon bg-reasoning-source-favicon-background", "leading-none text-reasoning-source-favicon-letter", "[&>img]:size-full [&>img]:object-cover", t),
|
|
3044
|
+
children: /* @__PURE__ */ H("span", {
|
|
3045
|
+
...n,
|
|
3046
|
+
children: e
|
|
3047
|
+
})
|
|
3048
|
+
})
|
|
3049
|
+
});
|
|
3050
|
+
}
|
|
3051
|
+
function rs({ children: e, className: t, ...n }) {
|
|
3052
|
+
return /* @__PURE__ */ H(j, {
|
|
3053
|
+
asChild: !0,
|
|
3054
|
+
variant: "caption-md",
|
|
3055
|
+
fontWeight: "normal",
|
|
3056
|
+
"data-slot": "chat-reasoning-step-note-page-title",
|
|
3057
|
+
"data-testid": "chat-reasoning-step-note-page-title",
|
|
3058
|
+
className: M("min-w-0 flex-1 truncate leading-none text-reasoning-page-row-title", "group-hover/reasoning-page-row:text-reasoning-page-row-title-hover", t),
|
|
3059
|
+
children: /* @__PURE__ */ H("span", {
|
|
3060
|
+
...n,
|
|
3061
|
+
children: e
|
|
3062
|
+
})
|
|
3063
|
+
});
|
|
3064
|
+
}
|
|
3065
|
+
function is({ children: e, className: t, ...n }) {
|
|
3066
|
+
return /* @__PURE__ */ H(j, {
|
|
3067
|
+
asChild: !0,
|
|
3068
|
+
variant: "caption-md",
|
|
3069
|
+
fontWeight: "normal",
|
|
3070
|
+
"data-slot": "chat-reasoning-step-note-page-domain",
|
|
3071
|
+
"data-testid": "chat-reasoning-step-note-page-domain",
|
|
3072
|
+
className: M("shrink-0 leading-none whitespace-nowrap text-reasoning-page-row-domain", "group-hover/reasoning-page-row:text-reasoning-page-row-domain-hover", "group-focus-visible/reasoning-page-row:text-reasoning-page-row-domain-focus", t),
|
|
3073
|
+
children: /* @__PURE__ */ H("span", {
|
|
3074
|
+
...n,
|
|
3075
|
+
children: e
|
|
3076
|
+
})
|
|
3077
|
+
});
|
|
3078
|
+
}
|
|
3079
|
+
function as({ children: e, className: t, ...n }) {
|
|
3080
|
+
return /* @__PURE__ */ H(Vo, { children: /* @__PURE__ */ H("div", {
|
|
3081
|
+
"data-slot": "chat-reasoning-end",
|
|
3082
|
+
"data-testid": "chat-reasoning-end",
|
|
3083
|
+
className: M("flex items-start", "pr-reasoning-end-row-spacing-padding-right-base py-reasoning-end-row-spacing-padding-vertical-base", t),
|
|
3084
|
+
...n,
|
|
3085
|
+
children: e
|
|
3086
|
+
}) });
|
|
3087
|
+
}
|
|
3088
|
+
function os({ children: e, className: t, ...n }) {
|
|
3089
|
+
return /* @__PURE__ */ H("span", {
|
|
3090
|
+
"aria-hidden": !0,
|
|
3091
|
+
"data-slot": "chat-reasoning-end-icon",
|
|
3092
|
+
"data-testid": "chat-reasoning-end-icon",
|
|
3093
|
+
className: M("flex shrink-0 items-center justify-center text-reasoning-end-row-icon", "h-reasoning-end-row-mark-column-height-base w-reasoning-end-row-mark-column-base", "[&>svg]:size-reasoning-end-row-icon-base", t),
|
|
3094
|
+
...n,
|
|
3095
|
+
children: e
|
|
3096
|
+
});
|
|
3097
|
+
}
|
|
3098
|
+
function ss({ children: e, className: t, ...n }) {
|
|
3099
|
+
return /* @__PURE__ */ H(j, {
|
|
3100
|
+
asChild: !0,
|
|
3101
|
+
variant: "body-small-low",
|
|
3102
|
+
"data-slot": "chat-reasoning-end-text",
|
|
3103
|
+
"data-testid": "chat-reasoning-end-text",
|
|
3104
|
+
className: M("flex min-h-reasoning-end-row-text-height-base min-w-0 flex-1 items-center", "text-reasoning-end-row-text", t),
|
|
3105
|
+
children: /* @__PURE__ */ H("span", {
|
|
3106
|
+
...n,
|
|
3107
|
+
children: e
|
|
3108
|
+
})
|
|
3109
|
+
});
|
|
3110
|
+
}
|
|
2653
3111
|
//#endregion
|
|
2654
3112
|
//#region src/components/chat-thinking-process/chat-thinking-process.tsx
|
|
2655
|
-
var
|
|
3113
|
+
var cs = P(function({ children: e, className: t, defaultOpen: n = !1, isStreaming: r = !1, ...i }, a) {
|
|
2656
3114
|
return /* @__PURE__ */ H(s, {
|
|
2657
3115
|
defaultOpen: n,
|
|
2658
3116
|
asChild: !0,
|
|
@@ -2667,8 +3125,8 @@ var _o = P(function({ children: e, className: t, defaultOpen: n = !1, isStreamin
|
|
|
2667
3125
|
})
|
|
2668
3126
|
});
|
|
2669
3127
|
});
|
|
2670
|
-
|
|
2671
|
-
function
|
|
3128
|
+
cs.displayName = "ChatThinkingProcess";
|
|
3129
|
+
function ls({ children: e, className: t, ...n }) {
|
|
2672
3130
|
return /* @__PURE__ */ U(u, {
|
|
2673
3131
|
"data-slot": "chat-thinking-process-trigger",
|
|
2674
3132
|
"data-testid": "chat-thinking-process-trigger",
|
|
@@ -2677,7 +3135,7 @@ function vo({ children: e, className: t, ...n }) {
|
|
|
2677
3135
|
children: [e, /* @__PURE__ */ H("style", { children: "\n @keyframes shimmer {\n 100% {\n mask-position: left;\n }\n }\n " })]
|
|
2678
3136
|
});
|
|
2679
3137
|
}
|
|
2680
|
-
function
|
|
3138
|
+
function us({ children: e, className: t, ...n }) {
|
|
2681
3139
|
return /* @__PURE__ */ H("span", {
|
|
2682
3140
|
"data-slot": "chat-thinking-process-trigger-icon",
|
|
2683
3141
|
"data-testid": "chat-thinking-process-trigger-icon",
|
|
@@ -2686,7 +3144,7 @@ function yo({ children: e, className: t, ...n }) {
|
|
|
2686
3144
|
children: e
|
|
2687
3145
|
});
|
|
2688
3146
|
}
|
|
2689
|
-
function
|
|
3147
|
+
function ds({ children: e, className: t, ...n }) {
|
|
2690
3148
|
return /* @__PURE__ */ H(j, {
|
|
2691
3149
|
asChild: !0,
|
|
2692
3150
|
variant: "body-small-low",
|
|
@@ -2699,7 +3157,7 @@ function bo({ children: e, className: t, ...n }) {
|
|
|
2699
3157
|
})
|
|
2700
3158
|
});
|
|
2701
3159
|
}
|
|
2702
|
-
function
|
|
3160
|
+
function fs({ className: e, ...t }) {
|
|
2703
3161
|
return /* @__PURE__ */ H(c, {
|
|
2704
3162
|
"data-slot": "chat-thinking-process-trigger-arrow",
|
|
2705
3163
|
"data-testid": "chat-thinking-process-trigger-arrow",
|
|
@@ -2707,21 +3165,51 @@ function xo({ className: e, ...t }) {
|
|
|
2707
3165
|
...t
|
|
2708
3166
|
});
|
|
2709
3167
|
}
|
|
2710
|
-
function
|
|
2711
|
-
|
|
3168
|
+
function ps({ children: e, className: t, itemsClassName: n, previewClassName: r, hasLastMessagePreview: i = !0, ...a }) {
|
|
3169
|
+
let { lastItemContent: o, lastItemIndex: s } = z(() => {
|
|
3170
|
+
let t = ge.Children.toArray(e);
|
|
3171
|
+
return {
|
|
3172
|
+
lastItemContent: t.at(-1),
|
|
3173
|
+
lastItemIndex: String(t.length)
|
|
3174
|
+
};
|
|
3175
|
+
}, [e]);
|
|
3176
|
+
return /* @__PURE__ */ U("div", {
|
|
2712
3177
|
"data-slot": "chat-thinking-process-content",
|
|
2713
3178
|
"data-testid": "chat-thinking-process-content",
|
|
3179
|
+
"data-preview": i,
|
|
2714
3180
|
className: M("pl-[28px]", t),
|
|
2715
|
-
children: /* @__PURE__ */ H(
|
|
3181
|
+
children: [i && o && /* @__PURE__ */ H(an, {
|
|
3182
|
+
mode: "wait",
|
|
3183
|
+
children: /* @__PURE__ */ H(ms, {
|
|
3184
|
+
contentId: s,
|
|
3185
|
+
className: r,
|
|
3186
|
+
children: o
|
|
3187
|
+
})
|
|
3188
|
+
}), /* @__PURE__ */ H(l, {
|
|
2716
3189
|
"data-slot": "chat-thinking-process-content-items",
|
|
2717
3190
|
"data-testid": "chat-thinking-process-content-items",
|
|
2718
3191
|
className: M("flex flex-col gap-4 pt-2", n),
|
|
2719
|
-
...
|
|
3192
|
+
...a,
|
|
2720
3193
|
children: e
|
|
2721
|
-
})
|
|
3194
|
+
})]
|
|
2722
3195
|
});
|
|
2723
3196
|
}
|
|
2724
|
-
function
|
|
3197
|
+
function ms({ children: e, className: t, contentId: n }) {
|
|
3198
|
+
return /* @__PURE__ */ H(on.div, {
|
|
3199
|
+
"data-slot": "chat-thinking-process-content-preview",
|
|
3200
|
+
"data-testid": "chat-thinking-process-content-preview",
|
|
3201
|
+
initial: { opacity: 0 },
|
|
3202
|
+
animate: { opacity: .7 },
|
|
3203
|
+
exit: { opacity: 0 },
|
|
3204
|
+
transition: {
|
|
3205
|
+
duration: .25,
|
|
3206
|
+
ease: "easeOut"
|
|
3207
|
+
},
|
|
3208
|
+
className: M("group-data-[streaming=false]/thinking-process:hidden", "group-data-[state=open]/thinking-process:hidden", "pt-2", t),
|
|
3209
|
+
children: e
|
|
3210
|
+
}, n);
|
|
3211
|
+
}
|
|
3212
|
+
function hs({ children: e, className: t, ...n }) {
|
|
2725
3213
|
return /* @__PURE__ */ H(j, {
|
|
2726
3214
|
asChild: !0,
|
|
2727
3215
|
variant: "body-small-low",
|
|
@@ -2734,7 +3222,7 @@ function Co({ children: e, className: t, ...n }) {
|
|
|
2734
3222
|
})
|
|
2735
3223
|
});
|
|
2736
3224
|
}
|
|
2737
|
-
function
|
|
3225
|
+
function gs({ children: e, className: t, ...n }) {
|
|
2738
3226
|
return /* @__PURE__ */ H("span", {
|
|
2739
3227
|
"data-slot": "chat-thinking-process-content-item-icon",
|
|
2740
3228
|
"data-testid": "chat-thinking-process-content-item-icon",
|
|
@@ -2745,14 +3233,14 @@ function wo({ children: e, className: t, ...n }) {
|
|
|
2745
3233
|
}
|
|
2746
3234
|
//#endregion
|
|
2747
3235
|
//#region src/components/deprecated-empty-state.ts
|
|
2748
|
-
var
|
|
3236
|
+
var _s = f, vs = h, ys = g, bs = m, xs = p, Ss = {
|
|
2749
3237
|
paragraph: "editor-paragraph",
|
|
2750
3238
|
text: {
|
|
2751
3239
|
bold: "editor-text-bold",
|
|
2752
3240
|
italic: "editor-text-italic",
|
|
2753
3241
|
underline: "editor-text-underline"
|
|
2754
3242
|
}
|
|
2755
|
-
},
|
|
3243
|
+
}, Cs = class e extends at {
|
|
2756
3244
|
__src;
|
|
2757
3245
|
__altText;
|
|
2758
3246
|
static getType() {
|
|
@@ -2790,7 +3278,7 @@ var To = f, Eo = h, Do = g, Oo = m, ko = p, Ao = {
|
|
|
2790
3278
|
return { img: () => ({
|
|
2791
3279
|
conversion: (e) => {
|
|
2792
3280
|
let t = e.getAttribute("src") || "", n = e.getAttribute("alt") || "";
|
|
2793
|
-
return t ? { node:
|
|
3281
|
+
return t ? { node: ws(t, n) } : null;
|
|
2794
3282
|
},
|
|
2795
3283
|
priority: 0
|
|
2796
3284
|
}) };
|
|
@@ -2805,21 +3293,21 @@ var To = f, Eo = h, Do = g, Oo = m, ko = p, Ao = {
|
|
|
2805
3293
|
};
|
|
2806
3294
|
}
|
|
2807
3295
|
static importJSON(e) {
|
|
2808
|
-
return
|
|
3296
|
+
return ws(e.src, e.altText);
|
|
2809
3297
|
}
|
|
2810
3298
|
isInline() {
|
|
2811
3299
|
return !1;
|
|
2812
3300
|
}
|
|
2813
3301
|
};
|
|
2814
|
-
function
|
|
2815
|
-
return new
|
|
3302
|
+
function ws(e, t) {
|
|
3303
|
+
return new Cs(e, t);
|
|
2816
3304
|
}
|
|
2817
|
-
function
|
|
2818
|
-
return e instanceof
|
|
3305
|
+
function Ts(e) {
|
|
3306
|
+
return e instanceof Cs;
|
|
2819
3307
|
}
|
|
2820
3308
|
//#endregion
|
|
2821
3309
|
//#region src/components/rich-text-area/transformers.ts
|
|
2822
|
-
function
|
|
3310
|
+
function Es(e) {
|
|
2823
3311
|
let t = /font-size\s*:\s*([^;]+)/i, n = /font-family\s*:\s*([^;]+)/i, r = /(?<![\w-])color\s*:\s*([^;]+)/i, i = t.exec(e), a = n.exec(e), o = r.exec(e);
|
|
2824
3312
|
return {
|
|
2825
3313
|
fontSize: i ? i[1].trim() : null,
|
|
@@ -2827,7 +3315,7 @@ function Po(e) {
|
|
|
2827
3315
|
color: o ? o[1].trim() : null
|
|
2828
3316
|
};
|
|
2829
3317
|
}
|
|
2830
|
-
var
|
|
3318
|
+
var Ds = {
|
|
2831
3319
|
type: "text-match",
|
|
2832
3320
|
trigger: "",
|
|
2833
3321
|
regExp: /./,
|
|
@@ -2835,126 +3323,126 @@ var Fo = {
|
|
|
2835
3323
|
dependencies: [],
|
|
2836
3324
|
export: (e) => {
|
|
2837
3325
|
if (!J(e)) return null;
|
|
2838
|
-
let t = e.getStyle() ?? "", n = e.getTextContent(), r =
|
|
3326
|
+
let t = e.getStyle() ?? "", n = e.getTextContent(), r = Es(t);
|
|
2839
3327
|
if (r.fontSize || r.fontFamily || r.color) {
|
|
2840
3328
|
let e = "";
|
|
2841
3329
|
return r.fontSize && (e += `font-size: ${r.fontSize};`), r.fontFamily && (e += `font-family: ${r.fontFamily};`), r.color && (e += `color: ${r.color};`), `<span style="${e}">${n}</span>`;
|
|
2842
3330
|
}
|
|
2843
3331
|
return null;
|
|
2844
3332
|
}
|
|
2845
|
-
},
|
|
3333
|
+
}, Os = {
|
|
2846
3334
|
type: "text-match",
|
|
2847
3335
|
trigger: "",
|
|
2848
3336
|
regExp: /<span\s+style="([^"]+)">(.+?)<\/span>/,
|
|
2849
3337
|
importRegExp: /<span\s+style="([^"]+)">(.+?)<\/span>/,
|
|
2850
3338
|
dependencies: [],
|
|
2851
3339
|
replace: (e, t) => {
|
|
2852
|
-
let [, n, r] = t, i =
|
|
3340
|
+
let [, n, r] = t, i = Je(r);
|
|
2853
3341
|
return i.setFormat(e.getFormat()), i.setStyle(n), e.replace(i), i;
|
|
2854
3342
|
}
|
|
2855
|
-
},
|
|
3343
|
+
}, ks = {
|
|
2856
3344
|
type: "text-match",
|
|
2857
3345
|
trigger: "",
|
|
2858
3346
|
regExp: /<ins>(.*?)<\/ins>/,
|
|
2859
3347
|
importRegExp: /<ins>(.*?)<\/ins>/,
|
|
2860
3348
|
dependencies: [],
|
|
2861
3349
|
replace: (e, t) => {
|
|
2862
|
-
let n =
|
|
3350
|
+
let n = Je(t[1]);
|
|
2863
3351
|
return n.setFormat(e.getFormat()), n.hasFormat("underline") || n.toggleFormat("underline"), e.replace(n), n;
|
|
2864
3352
|
},
|
|
2865
3353
|
export: (e) => !J(e) || !e.hasFormat("underline") ? null : `<ins>${e.getTextContent()}</ins>`
|
|
2866
|
-
},
|
|
3354
|
+
}, As = (e) => {
|
|
2867
3355
|
let t = /text-align:\s*(\w+)/i.exec(e);
|
|
2868
3356
|
return t ? t[1].trim() : null;
|
|
2869
|
-
},
|
|
3357
|
+
}, js = {
|
|
2870
3358
|
type: "element",
|
|
2871
3359
|
dependencies: [],
|
|
2872
3360
|
regExp: /<div\s+style="([^"]+)">(.*?)<\/div>/,
|
|
2873
3361
|
replace: (e, t, n) => {
|
|
2874
|
-
let r =
|
|
3362
|
+
let r = As(n[1]);
|
|
2875
3363
|
if (!r) return !1;
|
|
2876
3364
|
if (!n[2]) return;
|
|
2877
3365
|
let i = t[0];
|
|
2878
3366
|
J(i) && i.setTextContent(n[2]), e.setFormat(r), e.append(...t);
|
|
2879
3367
|
},
|
|
2880
3368
|
export: (e, t) => {
|
|
2881
|
-
if (!
|
|
3369
|
+
if (!Qe(e)) return null;
|
|
2882
3370
|
let n = e.getFormatType();
|
|
2883
3371
|
return !n || n === "left" ? null : `<div style="text-align: ${n}">${t(e)}</div>`;
|
|
2884
3372
|
}
|
|
2885
|
-
},
|
|
3373
|
+
}, Ms = {
|
|
2886
3374
|
type: "text-match",
|
|
2887
3375
|
trigger: "",
|
|
2888
3376
|
regExp: /./,
|
|
2889
3377
|
importRegExp: /./,
|
|
2890
|
-
dependencies: [
|
|
2891
|
-
export: (e) =>
|
|
2892
|
-
},
|
|
3378
|
+
dependencies: [Cs],
|
|
3379
|
+
export: (e) => Ts(e) ? `<img src="${e.__src}" alt="${e.__altText}" />` : null
|
|
3380
|
+
}, Ns = {
|
|
2893
3381
|
type: "text-match",
|
|
2894
3382
|
trigger: "",
|
|
2895
3383
|
regExp: /<img\s+src="([^"]+)"\s+alt="([^"]*)"[^>]*\/?>/,
|
|
2896
3384
|
importRegExp: /<img\s+src="([^"]+)"\s+alt="([^"]*)"[^>]*\/?>/,
|
|
2897
|
-
dependencies: [
|
|
3385
|
+
dependencies: [Cs],
|
|
2898
3386
|
replace: (e, t) => {
|
|
2899
|
-
let [, n, r] = t, i =
|
|
3387
|
+
let [, n, r] = t, i = ws(n, r);
|
|
2900
3388
|
e.replace(i);
|
|
2901
3389
|
}
|
|
2902
|
-
},
|
|
2903
|
-
...
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
],
|
|
2909
|
-
...
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
3390
|
+
}, Ps = [
|
|
3391
|
+
...We,
|
|
3392
|
+
Ds,
|
|
3393
|
+
ks,
|
|
3394
|
+
js,
|
|
3395
|
+
Ms
|
|
3396
|
+
], Fs = [
|
|
3397
|
+
...We,
|
|
3398
|
+
Os,
|
|
3399
|
+
ks,
|
|
3400
|
+
js,
|
|
3401
|
+
Ns
|
|
2914
3402
|
];
|
|
2915
3403
|
//#endregion
|
|
2916
3404
|
//#region src/components/rich-text-area/html-config.ts
|
|
2917
|
-
function
|
|
3405
|
+
function Is(e) {
|
|
2918
3406
|
let t = e.nodeName.toLowerCase();
|
|
2919
3407
|
if (t !== "h1" && t !== "h2" && t !== "h3" && t !== "h4" && t !== "h5" && t !== "h6") return null;
|
|
2920
|
-
let n =
|
|
3408
|
+
let n = Le(t), r = e.getAttribute("style") ?? "";
|
|
2921
3409
|
if (n.setStyle(r), e.style) {
|
|
2922
3410
|
let t = e.style.textAlign;
|
|
2923
|
-
(t === "left" || t === "right" || t === "center" || t === "justify" || t === "start" || t === "end") && n.setFormat(t),
|
|
3411
|
+
(t === "left" || t === "right" || t === "center" || t === "justify" || t === "start" || t === "end") && n.setFormat(t), gt(e, n);
|
|
2924
3412
|
}
|
|
2925
3413
|
return { node: n };
|
|
2926
3414
|
}
|
|
2927
|
-
function
|
|
3415
|
+
function Ls(e) {
|
|
2928
3416
|
if (e.getAttribute("__lexicallisttype") === "check" || e.classList.contains("contains-task-list")) return !0;
|
|
2929
|
-
for (let t of e.childNodes) if (
|
|
3417
|
+
for (let t of e.childNodes) if (ht(t) && t.hasAttribute("aria-checked")) return !0;
|
|
2930
3418
|
return !1;
|
|
2931
3419
|
}
|
|
2932
|
-
function
|
|
3420
|
+
function Rs(e) {
|
|
2933
3421
|
let t = e.nodeName.toLowerCase(), n = null;
|
|
2934
3422
|
if (t === "ol") {
|
|
2935
3423
|
let t = e.start;
|
|
2936
|
-
n =
|
|
2937
|
-
} else t === "ul" && (n =
|
|
3424
|
+
n = ke("number", t);
|
|
3425
|
+
} else t === "ul" && (n = Ls(e) ? ke("check") : ke("bullet"));
|
|
2938
3426
|
if (!n) return null;
|
|
2939
3427
|
let r = e.getAttribute("style") ?? "";
|
|
2940
3428
|
return n.setStyle(r), { node: n };
|
|
2941
3429
|
}
|
|
2942
|
-
function
|
|
3430
|
+
function zs(e) {
|
|
2943
3431
|
if (e.classList.contains("task-list-item")) {
|
|
2944
3432
|
for (let t of e.children) if (t.tagName === "INPUT") {
|
|
2945
3433
|
let n = t;
|
|
2946
3434
|
if (n.getAttribute("type") === "checkbox") {
|
|
2947
|
-
let t = n.hasAttribute("checked"), r =
|
|
3435
|
+
let t = n.hasAttribute("checked"), r = Oe(t), i = e.getAttribute("style") ?? "";
|
|
2948
3436
|
return r.setStyle(i), { node: r };
|
|
2949
3437
|
}
|
|
2950
3438
|
}
|
|
2951
3439
|
}
|
|
2952
|
-
let t = e.getAttribute("aria-checked"), n =
|
|
3440
|
+
let t = e.getAttribute("aria-checked"), n = Oe(t === "true" || t !== "false" && void 0), r = e.getAttribute("style") ?? "";
|
|
2953
3441
|
return n.setStyle(r), { node: n };
|
|
2954
3442
|
}
|
|
2955
3443
|
var Z = 4;
|
|
2956
|
-
function
|
|
2957
|
-
let { color: t, fontSize: n, fontFamily: r } =
|
|
3444
|
+
function Bs(e) {
|
|
3445
|
+
let { color: t, fontSize: n, fontFamily: r } = Es(e.getAttribute("style") ?? "");
|
|
2958
3446
|
if (!t && !n && !r) return null;
|
|
2959
3447
|
let i = e.style;
|
|
2960
3448
|
return {
|
|
@@ -2968,59 +3456,59 @@ function Jo(e) {
|
|
|
2968
3456
|
node: null
|
|
2969
3457
|
};
|
|
2970
3458
|
}
|
|
2971
|
-
var
|
|
3459
|
+
var Vs = {
|
|
2972
3460
|
h1: () => ({
|
|
2973
|
-
conversion:
|
|
3461
|
+
conversion: Is,
|
|
2974
3462
|
priority: Z
|
|
2975
3463
|
}),
|
|
2976
3464
|
h2: () => ({
|
|
2977
|
-
conversion:
|
|
3465
|
+
conversion: Is,
|
|
2978
3466
|
priority: Z
|
|
2979
3467
|
}),
|
|
2980
3468
|
h3: () => ({
|
|
2981
|
-
conversion:
|
|
3469
|
+
conversion: Is,
|
|
2982
3470
|
priority: Z
|
|
2983
3471
|
}),
|
|
2984
3472
|
h4: () => ({
|
|
2985
|
-
conversion:
|
|
3473
|
+
conversion: Is,
|
|
2986
3474
|
priority: Z
|
|
2987
3475
|
}),
|
|
2988
3476
|
h5: () => ({
|
|
2989
|
-
conversion:
|
|
3477
|
+
conversion: Is,
|
|
2990
3478
|
priority: Z
|
|
2991
3479
|
}),
|
|
2992
3480
|
h6: () => ({
|
|
2993
|
-
conversion:
|
|
3481
|
+
conversion: Is,
|
|
2994
3482
|
priority: Z
|
|
2995
3483
|
}),
|
|
2996
3484
|
ul: () => ({
|
|
2997
|
-
conversion:
|
|
3485
|
+
conversion: Rs,
|
|
2998
3486
|
priority: Z
|
|
2999
3487
|
}),
|
|
3000
3488
|
ol: () => ({
|
|
3001
|
-
conversion:
|
|
3489
|
+
conversion: Rs,
|
|
3002
3490
|
priority: Z
|
|
3003
3491
|
}),
|
|
3004
3492
|
li: () => ({
|
|
3005
|
-
conversion:
|
|
3493
|
+
conversion: zs,
|
|
3006
3494
|
priority: Z
|
|
3007
3495
|
}),
|
|
3008
3496
|
span: () => ({
|
|
3009
|
-
conversion:
|
|
3497
|
+
conversion: Bs,
|
|
3010
3498
|
priority: Z
|
|
3011
3499
|
})
|
|
3012
3500
|
};
|
|
3013
|
-
function
|
|
3501
|
+
function Hs(e) {
|
|
3014
3502
|
return (t, n) => {
|
|
3015
3503
|
let r = e.prototype.exportDOM.call(n, t), i = n.getStyle();
|
|
3016
3504
|
return r.element && i && r.element.setAttribute("style", i), r;
|
|
3017
3505
|
};
|
|
3018
3506
|
}
|
|
3019
|
-
var
|
|
3020
|
-
[
|
|
3021
|
-
[
|
|
3022
|
-
[
|
|
3023
|
-
]),
|
|
3507
|
+
var Us = /* @__PURE__ */ new Map([
|
|
3508
|
+
[Re, Hs(Re)],
|
|
3509
|
+
[je, Hs(je)],
|
|
3510
|
+
[Ae, Hs(Ae)]
|
|
3511
|
+
]), Ws = class e extends ot {
|
|
3024
3512
|
static getType() {
|
|
3025
3513
|
return "div-block";
|
|
3026
3514
|
}
|
|
@@ -3037,7 +3525,7 @@ var Zo = /* @__PURE__ */ new Map([
|
|
|
3037
3525
|
}
|
|
3038
3526
|
static importDOM() {
|
|
3039
3527
|
return { div: () => ({
|
|
3040
|
-
conversion:
|
|
3528
|
+
conversion: Gs,
|
|
3041
3529
|
priority: 4
|
|
3042
3530
|
}) };
|
|
3043
3531
|
}
|
|
@@ -3049,7 +3537,7 @@ var Zo = /* @__PURE__ */ new Map([
|
|
|
3049
3537
|
} : e;
|
|
3050
3538
|
}
|
|
3051
3539
|
static importJSON(e) {
|
|
3052
|
-
let t =
|
|
3540
|
+
let t = Ks().updateFromJSON(e);
|
|
3053
3541
|
return e.style !== void 0 && t.setStyle(e.style), t;
|
|
3054
3542
|
}
|
|
3055
3543
|
updateFromJSON(e) {
|
|
@@ -3062,32 +3550,32 @@ var Zo = /* @__PURE__ */ new Map([
|
|
|
3062
3550
|
if (this.getNextSibling() !== null) return this.selectNext(), this.remove(), !0;
|
|
3063
3551
|
if (this.getPreviousSibling() !== null) return this.selectPrevious(), this.remove(), !0;
|
|
3064
3552
|
} else {
|
|
3065
|
-
let e =
|
|
3553
|
+
let e = Ke();
|
|
3066
3554
|
return e.setFormat(this.getFormatType()), e.setStyle(this.getStyle()), e.setIndent(this.getIndent()), e.setDirection(this.getDirection()), t.forEach((t) => e.append(t)), this.replace(e), !0;
|
|
3067
3555
|
}
|
|
3068
3556
|
return !1;
|
|
3069
3557
|
}
|
|
3070
3558
|
};
|
|
3071
|
-
function
|
|
3072
|
-
let t =
|
|
3559
|
+
function Gs(e) {
|
|
3560
|
+
let t = Ks(), n = e.getAttribute("style") ?? "";
|
|
3073
3561
|
if (t.setStyle(n), e.style) {
|
|
3074
3562
|
let n = e.style.textAlign;
|
|
3075
|
-
(n === "left" || n === "right" || n === "center" || n === "justify" || n === "start" || n === "end") && t.setFormat(n),
|
|
3563
|
+
(n === "left" || n === "right" || n === "center" || n === "justify" || n === "start" || n === "end") && t.setFormat(n), gt(e, t);
|
|
3076
3564
|
}
|
|
3077
3565
|
return { node: t };
|
|
3078
3566
|
}
|
|
3079
|
-
function
|
|
3080
|
-
return new
|
|
3567
|
+
function Ks() {
|
|
3568
|
+
return new Ws();
|
|
3081
3569
|
}
|
|
3082
3570
|
//#endregion
|
|
3083
3571
|
//#region src/components/rich-text-area/plugins/value-plugin.tsx
|
|
3084
|
-
var
|
|
3085
|
-
function
|
|
3572
|
+
var qs = 50;
|
|
3573
|
+
function Js({ onChange: e, source: t = "markdown", emittedValuesRef: n }) {
|
|
3086
3574
|
let r = F((r, i, a) => {
|
|
3087
3575
|
if (!a.has("focus") && e) try {
|
|
3088
3576
|
r.read(() => {
|
|
3089
|
-
let r = t === "html" ?
|
|
3090
|
-
n && (n.current.push(r), n.current.splice(0, n.current.length -
|
|
3577
|
+
let r = t === "html" ? pn(i) : He(Ps);
|
|
3578
|
+
n && (n.current.push(r), n.current.splice(0, n.current.length - qs)), e(r);
|
|
3091
3579
|
});
|
|
3092
3580
|
} catch {}
|
|
3093
3581
|
}, [
|
|
@@ -3095,16 +3583,16 @@ function ns({ onChange: e, source: t = "markdown", emittedValuesRef: n }) {
|
|
|
3095
3583
|
t,
|
|
3096
3584
|
n
|
|
3097
3585
|
]);
|
|
3098
|
-
return /* @__PURE__ */ H(
|
|
3586
|
+
return /* @__PURE__ */ H(_t, { onChange: r });
|
|
3099
3587
|
}
|
|
3100
3588
|
//#endregion
|
|
3101
3589
|
//#region src/components/rich-text-area/hooks.ts
|
|
3102
3590
|
function Q() {
|
|
3103
|
-
let [e] =
|
|
3591
|
+
let [e] = Be();
|
|
3104
3592
|
return e;
|
|
3105
3593
|
}
|
|
3106
|
-
function
|
|
3107
|
-
let [e] =
|
|
3594
|
+
function Ys() {
|
|
3595
|
+
let [e] = Be();
|
|
3108
3596
|
return F(() => {
|
|
3109
3597
|
let t = "";
|
|
3110
3598
|
return e.getEditorState().read(() => {
|
|
@@ -3114,7 +3602,7 @@ function rs() {
|
|
|
3114
3602
|
}
|
|
3115
3603
|
//#endregion
|
|
3116
3604
|
//#region src/components/rich-text-area/plugins/disabled-plugin.tsx
|
|
3117
|
-
function
|
|
3605
|
+
function Xs({ isDisabled: e }) {
|
|
3118
3606
|
let t = Q();
|
|
3119
3607
|
return L(() => {
|
|
3120
3608
|
t.setEditable(!e);
|
|
@@ -3122,50 +3610,50 @@ function is({ isDisabled: e }) {
|
|
|
3122
3610
|
}
|
|
3123
3611
|
//#endregion
|
|
3124
3612
|
//#region src/components/rich-text-area/plugins/controlled-plugin.tsx
|
|
3125
|
-
function
|
|
3613
|
+
function Zs({ controlledRef: e }) {
|
|
3126
3614
|
let t = B(null);
|
|
3127
|
-
return
|
|
3615
|
+
return Se(e, () => ({ focus: () => {
|
|
3128
3616
|
Promise.resolve().then(() => {
|
|
3129
3617
|
t.current?.focus();
|
|
3130
3618
|
});
|
|
3131
|
-
} }), []), /* @__PURE__ */ H(
|
|
3619
|
+
} }), []), /* @__PURE__ */ H(hn, { editorRef: t });
|
|
3132
3620
|
}
|
|
3133
3621
|
//#endregion
|
|
3134
3622
|
//#region src/components/rich-text-area/utils/index.ts
|
|
3135
|
-
function
|
|
3623
|
+
function Qs(e) {
|
|
3136
3624
|
let t = e.getRootElement();
|
|
3137
3625
|
t && (t.scrollTop = t.scrollHeight);
|
|
3138
3626
|
}
|
|
3139
|
-
function
|
|
3627
|
+
function $s() {
|
|
3140
3628
|
let e = G().getLastDescendant();
|
|
3141
3629
|
if (e && J(e)) {
|
|
3142
|
-
let t =
|
|
3143
|
-
t.anchor.set(e.getKey(), n, "text"), t.focus.set(e.getKey(), n, "text"),
|
|
3630
|
+
let t = qe(), n = e.getTextContentSize();
|
|
3631
|
+
t.anchor.set(e.getKey(), n, "text"), t.focus.set(e.getKey(), n, "text"), et(t);
|
|
3144
3632
|
} else {
|
|
3145
|
-
|
|
3633
|
+
$e();
|
|
3146
3634
|
let e = K();
|
|
3147
3635
|
if (q(e)) {
|
|
3148
3636
|
let t = e.focus.getNode(), n = J(t) ? t.getTextContentSize() : 0;
|
|
3149
|
-
e.anchor.set(e.focus.key, e.focus.offset, e.focus.type), e.focus.set(e.focus.key, n, e.focus.type),
|
|
3637
|
+
e.anchor.set(e.focus.key, e.focus.offset, e.focus.type), e.focus.set(e.focus.key, n, e.focus.type), et(e);
|
|
3150
3638
|
}
|
|
3151
3639
|
}
|
|
3152
3640
|
}
|
|
3153
|
-
function
|
|
3641
|
+
function ec(e, t) {
|
|
3154
3642
|
let n = new DOMParser().parseFromString(t, "text/html");
|
|
3155
|
-
return
|
|
3643
|
+
return mn(e, n).map((e) => {
|
|
3156
3644
|
if (J(e)) {
|
|
3157
|
-
let t =
|
|
3645
|
+
let t = Ke();
|
|
3158
3646
|
return t.append(e), t;
|
|
3159
3647
|
}
|
|
3160
3648
|
return e;
|
|
3161
3649
|
});
|
|
3162
3650
|
}
|
|
3163
|
-
function
|
|
3651
|
+
function tc(e, t) {
|
|
3164
3652
|
let n = G();
|
|
3165
|
-
n.clear(),
|
|
3653
|
+
n.clear(), ec(e, t).forEach((e) => n.append(e));
|
|
3166
3654
|
}
|
|
3167
|
-
function
|
|
3168
|
-
let n = K(), r =
|
|
3655
|
+
function nc(e, t) {
|
|
3656
|
+
let n = K(), r = ec(e, t);
|
|
3169
3657
|
if (q(n)) n.insertNodes(r);
|
|
3170
3658
|
else {
|
|
3171
3659
|
let e = G();
|
|
@@ -3174,7 +3662,7 @@ function us(e, t) {
|
|
|
3174
3662
|
}
|
|
3175
3663
|
//#endregion
|
|
3176
3664
|
//#region src/components/rich-text-area/plugins/controlled-value-plugin.tsx
|
|
3177
|
-
function
|
|
3665
|
+
function rc({ value: e, source: t = "markdown", emittedValuesRef: n }) {
|
|
3178
3666
|
let r = Q(), i = B(), a = B(!!e?.trim()), o = me("desktop");
|
|
3179
3667
|
return L(() => {
|
|
3180
3668
|
if (!r || e === i.current) return;
|
|
@@ -3184,20 +3672,20 @@ function ds({ value: e, source: t = "markdown", emittedValuesRef: n }) {
|
|
|
3184
3672
|
}
|
|
3185
3673
|
let s = "";
|
|
3186
3674
|
if (r.getEditorState().read(() => {
|
|
3187
|
-
s = t === "html" ?
|
|
3675
|
+
s = t === "html" ? pn(r) : He(Ps);
|
|
3188
3676
|
}), e !== void 0 && e !== s) {
|
|
3189
3677
|
if (e === "") {
|
|
3190
3678
|
r.update(() => {
|
|
3191
|
-
|
|
3679
|
+
Ge(dt), t === "html" ? G().clear() : Ve("", Fs), $s();
|
|
3192
3680
|
}, { discrete: !0 }), Promise.resolve().then(() => {
|
|
3193
3681
|
o ? r.focus() : r.blur();
|
|
3194
3682
|
});
|
|
3195
3683
|
return;
|
|
3196
3684
|
}
|
|
3197
3685
|
r.update(() => {
|
|
3198
|
-
|
|
3686
|
+
Ge(dt), t === "html" ? tc(r, e) : Ve(e, Fs), $s();
|
|
3199
3687
|
}), a.current && (a.current = !1, Promise.resolve().then(() => {
|
|
3200
|
-
requestAnimationFrame(() =>
|
|
3688
|
+
requestAnimationFrame(() => Qs(r));
|
|
3201
3689
|
})), o && Promise.resolve().then(() => {
|
|
3202
3690
|
r.focus();
|
|
3203
3691
|
});
|
|
@@ -3212,7 +3700,7 @@ function ds({ value: e, source: t = "markdown", emittedValuesRef: n }) {
|
|
|
3212
3700
|
}
|
|
3213
3701
|
//#endregion
|
|
3214
3702
|
//#region src/components/rich-text-area/plugins/blur-plugin.tsx
|
|
3215
|
-
function
|
|
3703
|
+
function ic({ onBlur: e }) {
|
|
3216
3704
|
let t = Q();
|
|
3217
3705
|
return L(() => {
|
|
3218
3706
|
if (!e) return;
|
|
@@ -3228,7 +3716,7 @@ function fs({ onBlur: e }) {
|
|
|
3228
3716
|
}
|
|
3229
3717
|
//#endregion
|
|
3230
3718
|
//#region src/components/rich-text-area/plugins/focus-plugin.tsx
|
|
3231
|
-
function
|
|
3719
|
+
function ac({ onFocusChange: e }) {
|
|
3232
3720
|
let t = Q();
|
|
3233
3721
|
return L(() => {
|
|
3234
3722
|
if (!e) return;
|
|
@@ -3247,68 +3735,68 @@ function ps({ onFocusChange: e }) {
|
|
|
3247
3735
|
}
|
|
3248
3736
|
//#endregion
|
|
3249
3737
|
//#region src/components/rich-text-area/plugins/image-drop-plugin.tsx
|
|
3250
|
-
var
|
|
3738
|
+
var oc = pt("INSERT_IMAGE_COMMAND"), sc = "helvetiq:insert-image", cc = class extends CustomEvent {
|
|
3251
3739
|
constructor(e) {
|
|
3252
|
-
super(
|
|
3740
|
+
super(sc, { detail: e });
|
|
3253
3741
|
}
|
|
3254
3742
|
};
|
|
3255
|
-
function
|
|
3743
|
+
function lc() {
|
|
3256
3744
|
let e = Q();
|
|
3257
|
-
return L(() => e.registerCommand(
|
|
3258
|
-
let e =
|
|
3259
|
-
|
|
3260
|
-
}), !0),
|
|
3745
|
+
return L(() => e.registerCommand(oc, (t) => (e.update(() => {
|
|
3746
|
+
let e = ws(t.src, t.altText);
|
|
3747
|
+
Xe([e]);
|
|
3748
|
+
}), !0), rt), [e]), L(() => {
|
|
3261
3749
|
if (!e.getRootElement()) return;
|
|
3262
3750
|
function t(t) {
|
|
3263
3751
|
let n = t;
|
|
3264
|
-
e.dispatchCommand(
|
|
3752
|
+
e.dispatchCommand(oc, n.detail);
|
|
3265
3753
|
}
|
|
3266
|
-
return document.addEventListener(
|
|
3267
|
-
document.removeEventListener(
|
|
3754
|
+
return document.addEventListener(sc, t), () => {
|
|
3755
|
+
document.removeEventListener(sc, t);
|
|
3268
3756
|
};
|
|
3269
3757
|
}, [e]), null;
|
|
3270
3758
|
}
|
|
3271
3759
|
//#endregion
|
|
3272
3760
|
//#region src/components/rich-text-area/plugins/html-paste-plugin.tsx
|
|
3273
|
-
var
|
|
3761
|
+
var uc = pt("PASTE_HTML_COMMAND"), dc = pt("INSERT_HTML_COMMAND"), fc = "helvetiq:paste-html", pc = "helvetiq:insert-html", mc = class extends CustomEvent {
|
|
3274
3762
|
constructor(e) {
|
|
3275
|
-
super(
|
|
3763
|
+
super(fc, { detail: e });
|
|
3276
3764
|
}
|
|
3277
|
-
},
|
|
3765
|
+
}, hc = class extends CustomEvent {
|
|
3278
3766
|
constructor(e) {
|
|
3279
|
-
super(
|
|
3767
|
+
super(pc, { detail: e });
|
|
3280
3768
|
}
|
|
3281
3769
|
};
|
|
3282
|
-
function
|
|
3770
|
+
function gc() {
|
|
3283
3771
|
let e = Q();
|
|
3284
|
-
return L(() => e.registerCommand(
|
|
3772
|
+
return L(() => e.registerCommand(uc, (t) => (e.update(() => {
|
|
3285
3773
|
let n = G();
|
|
3286
3774
|
n.clear();
|
|
3287
|
-
let r = new DOMParser().parseFromString(t.html, "text/html"), i =
|
|
3775
|
+
let r = new DOMParser().parseFromString(t.html, "text/html"), i = mn(e, r);
|
|
3288
3776
|
n.append(...i);
|
|
3289
|
-
}), !0),
|
|
3290
|
-
let n = new DOMParser().parseFromString(t.html, "text/html"), r =
|
|
3291
|
-
|
|
3292
|
-
}), !0),
|
|
3777
|
+
}), !0), rt), [e]), L(() => e.registerCommand(dc, (t) => (e.update(() => {
|
|
3778
|
+
let n = new DOMParser().parseFromString(t.html, "text/html"), r = mn(e, n);
|
|
3779
|
+
Xe(r);
|
|
3780
|
+
}), !0), rt), [e]), L(() => {
|
|
3293
3781
|
if (!e.getRootElement()) return;
|
|
3294
3782
|
function t(t) {
|
|
3295
3783
|
let n = t;
|
|
3296
|
-
e.dispatchCommand(
|
|
3784
|
+
e.dispatchCommand(uc, n.detail);
|
|
3297
3785
|
}
|
|
3298
3786
|
function n(t) {
|
|
3299
3787
|
let n = t;
|
|
3300
|
-
e.dispatchCommand(
|
|
3788
|
+
e.dispatchCommand(dc, n.detail);
|
|
3301
3789
|
}
|
|
3302
|
-
return document.addEventListener(
|
|
3303
|
-
document.removeEventListener(
|
|
3790
|
+
return document.addEventListener(fc, t), document.addEventListener(pc, n), () => {
|
|
3791
|
+
document.removeEventListener(fc, t), document.removeEventListener(pc, n);
|
|
3304
3792
|
};
|
|
3305
3793
|
}, [e]), null;
|
|
3306
3794
|
}
|
|
3307
3795
|
//#endregion
|
|
3308
3796
|
//#region src/components/rich-text-area/plugins/markdown-plain-paste-plugin.tsx
|
|
3309
|
-
function
|
|
3797
|
+
function _c() {
|
|
3310
3798
|
let e = Q();
|
|
3311
|
-
return L(() => e.registerCommand(
|
|
3799
|
+
return L(() => e.registerCommand(lt, (t) => {
|
|
3312
3800
|
let { clipboardData: n } = t;
|
|
3313
3801
|
if (!n) return !1;
|
|
3314
3802
|
let r = n.getData("text/plain");
|
|
@@ -3320,18 +3808,18 @@ function Ts() {
|
|
|
3320
3808
|
}
|
|
3321
3809
|
let t = G();
|
|
3322
3810
|
t.clear(), r.split(/\r?\n/).forEach((e) => {
|
|
3323
|
-
let n =
|
|
3324
|
-
e.length > 0 && n.append(
|
|
3811
|
+
let n = Ke();
|
|
3812
|
+
e.length > 0 && n.append(Je(e)), t.append(n);
|
|
3325
3813
|
});
|
|
3326
3814
|
}), !0) : !1;
|
|
3327
|
-
},
|
|
3815
|
+
}, nt), [e]), null;
|
|
3328
3816
|
}
|
|
3329
3817
|
//#endregion
|
|
3330
3818
|
//#region src/components/rich-text-area/plugins/file-attachment-plugin.tsx
|
|
3331
|
-
var
|
|
3332
|
-
function
|
|
3819
|
+
var vc = pt("ATTACH_FILE_COMMAND");
|
|
3820
|
+
function yc({ acceptedFiles: e = [], isMultiple: t = !1, onFileAttach: n }) {
|
|
3333
3821
|
let r = Q(), i = B(null);
|
|
3334
|
-
L(() => r.registerCommand(
|
|
3822
|
+
L(() => r.registerCommand(vc, () => (i.current?.click(), !0), rt), [r]);
|
|
3335
3823
|
function a(e) {
|
|
3336
3824
|
let r = Array.from(e.target.files ?? []);
|
|
3337
3825
|
if (t) n?.(r);
|
|
@@ -3353,45 +3841,45 @@ function Ds({ acceptedFiles: e = [], isMultiple: t = !1, onFileAttach: n }) {
|
|
|
3353
3841
|
}
|
|
3354
3842
|
//#endregion
|
|
3355
3843
|
//#region src/components/rich-text-area/styled.tsx
|
|
3356
|
-
var
|
|
3844
|
+
var bc = P(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ H("div", {
|
|
3357
3845
|
ref: r,
|
|
3358
3846
|
className: M("w-full resize-none border-none outline-none bg-transparent font-[inherit] text-[inherit] flex items-center [&_.editor-paragraph]:m-0 [&_.editor-paragraph]:min-h-[26px] [&_.editor-text-bold]:font-bold [&_.editor-text-italic]:italic [&_.editor-text-underline]:underline", e),
|
|
3359
3847
|
...n,
|
|
3360
3848
|
children: t
|
|
3361
3849
|
}));
|
|
3362
|
-
|
|
3850
|
+
bc.displayName = "Wrapper";
|
|
3363
3851
|
//#endregion
|
|
3364
3852
|
//#region src/components/rich-text-area/rich-text-area.tsx
|
|
3365
|
-
var
|
|
3853
|
+
var xc = {
|
|
3366
3854
|
namespace: "helvetiq",
|
|
3367
|
-
theme:
|
|
3855
|
+
theme: Ss,
|
|
3368
3856
|
editable: !0,
|
|
3369
3857
|
nodes: [
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
Se,
|
|
3858
|
+
je,
|
|
3859
|
+
Ae,
|
|
3860
|
+
Re,
|
|
3861
|
+
ze,
|
|
3375
3862
|
we,
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3863
|
+
Ee,
|
|
3864
|
+
Cs,
|
|
3865
|
+
Ws,
|
|
3866
|
+
dn,
|
|
3867
|
+
un,
|
|
3868
|
+
fn
|
|
3381
3869
|
],
|
|
3382
3870
|
html: {
|
|
3383
|
-
import:
|
|
3384
|
-
export:
|
|
3871
|
+
import: Vs,
|
|
3872
|
+
export: Us
|
|
3385
3873
|
},
|
|
3386
3874
|
onError: (e) => {
|
|
3387
3875
|
console.error("Lexical error:", e);
|
|
3388
3876
|
}
|
|
3389
3877
|
};
|
|
3390
|
-
function
|
|
3878
|
+
function Sc({ children: e, name: t, value: n, source: r = "markdown", className: i, containerClassName: a, placeholderClassName: o, placeholder: s = "", isDisabled: c = !1, onChange: l, onBlur: u, onKeyDown: d, onFocusChange: f, forwardedRef: p, ...m }) {
|
|
3391
3879
|
let h = B([]);
|
|
3392
|
-
return /* @__PURE__ */ H(
|
|
3393
|
-
initialConfig:
|
|
3394
|
-
children: /* @__PURE__ */ U(
|
|
3880
|
+
return /* @__PURE__ */ H(Me, {
|
|
3881
|
+
initialConfig: xc,
|
|
3882
|
+
children: /* @__PURE__ */ U(bc, {
|
|
3395
3883
|
"data-slot": "rich-text-area",
|
|
3396
3884
|
"data-testid": "rich-text-area",
|
|
3397
3885
|
"aria-disabled": c,
|
|
@@ -3399,8 +3887,8 @@ function As({ children: e, name: t, value: n, source: r = "markdown", className:
|
|
|
3399
3887
|
className: M("relative size-full overflow-hidden", "data-[disabled=true]:opacity-80", "data-[disabled=true]:cursor-not-allowed data-[disabled=true]:select-none", a),
|
|
3400
3888
|
...m,
|
|
3401
3889
|
children: [
|
|
3402
|
-
/* @__PURE__ */ H(
|
|
3403
|
-
contentEditable: /* @__PURE__ */ H(
|
|
3890
|
+
/* @__PURE__ */ H(Ie, {
|
|
3891
|
+
contentEditable: /* @__PURE__ */ H(Ne, {
|
|
3404
3892
|
"data-slot": "rich-text-area-editable",
|
|
3405
3893
|
className: M("relative inset-0 overflow-y-auto", i),
|
|
3406
3894
|
"data-name": t,
|
|
@@ -3420,38 +3908,38 @@ function As({ children: e, name: t, value: n, source: r = "markdown", className:
|
|
|
3420
3908
|
minHeight: "20px"
|
|
3421
3909
|
}
|
|
3422
3910
|
}),
|
|
3423
|
-
ErrorBoundary:
|
|
3911
|
+
ErrorBoundary: Pe
|
|
3424
3912
|
}),
|
|
3425
|
-
/* @__PURE__ */ H(
|
|
3426
|
-
/* @__PURE__ */ H(
|
|
3913
|
+
/* @__PURE__ */ H(Xs, { isDisabled: c }),
|
|
3914
|
+
/* @__PURE__ */ H(rc, {
|
|
3427
3915
|
value: n,
|
|
3428
3916
|
source: r,
|
|
3429
3917
|
emittedValuesRef: h
|
|
3430
3918
|
}),
|
|
3431
|
-
/* @__PURE__ */ H(
|
|
3919
|
+
/* @__PURE__ */ H(Js, {
|
|
3432
3920
|
onChange: l,
|
|
3433
3921
|
source: r,
|
|
3434
3922
|
emittedValuesRef: h
|
|
3435
3923
|
}),
|
|
3436
|
-
/* @__PURE__ */ H(
|
|
3437
|
-
/* @__PURE__ */ H(
|
|
3438
|
-
/* @__PURE__ */ H(
|
|
3439
|
-
/* @__PURE__ */ H(
|
|
3440
|
-
/* @__PURE__ */ H(
|
|
3441
|
-
r === "markdown" && /* @__PURE__ */ H(
|
|
3924
|
+
/* @__PURE__ */ H(ic, { onBlur: u }),
|
|
3925
|
+
/* @__PURE__ */ H(Fe, {}),
|
|
3926
|
+
/* @__PURE__ */ H(Zs, { controlledRef: p ?? null }),
|
|
3927
|
+
/* @__PURE__ */ H(ac, { onFocusChange: f }),
|
|
3928
|
+
/* @__PURE__ */ H(ln, {}),
|
|
3929
|
+
r === "markdown" && /* @__PURE__ */ H(_c, {}),
|
|
3442
3930
|
e
|
|
3443
3931
|
]
|
|
3444
3932
|
})
|
|
3445
3933
|
});
|
|
3446
3934
|
}
|
|
3447
|
-
var
|
|
3935
|
+
var Cc = P((e, t) => /* @__PURE__ */ H(Sc, {
|
|
3448
3936
|
...e,
|
|
3449
3937
|
forwardedRef: t
|
|
3450
3938
|
}));
|
|
3451
|
-
|
|
3939
|
+
Cc.displayName = "RichTextArea";
|
|
3452
3940
|
//#endregion
|
|
3453
3941
|
//#region src/components/rich-text-field/constants.ts
|
|
3454
|
-
var
|
|
3942
|
+
var wc = "Arial, sans-serif", Tc = [
|
|
3455
3943
|
{
|
|
3456
3944
|
value: "Arial, sans-serif",
|
|
3457
3945
|
label: "Arial"
|
|
@@ -3488,7 +3976,7 @@ var Ms = "Arial, sans-serif", Ns = [
|
|
|
3488
3976
|
value: "\"Brush Script MT\", cursive",
|
|
3489
3977
|
label: "Brush Script MT"
|
|
3490
3978
|
}
|
|
3491
|
-
],
|
|
3979
|
+
], Ec = wc, Dc = [
|
|
3492
3980
|
{
|
|
3493
3981
|
label: "10",
|
|
3494
3982
|
value: "10"
|
|
@@ -3517,11 +4005,11 @@ var Ms = "Arial, sans-serif", Ns = [
|
|
|
3517
4005
|
label: "48",
|
|
3518
4006
|
value: "48"
|
|
3519
4007
|
}
|
|
3520
|
-
],
|
|
4008
|
+
], Oc = "left", kc = "#000000";
|
|
3521
4009
|
//#endregion
|
|
3522
4010
|
//#region src/components/rich-text-field/components/toolbar-select.tsx
|
|
3523
|
-
function
|
|
3524
|
-
return /* @__PURE__ */ H(
|
|
4011
|
+
function Ac({ className: e, selectItemClassName: t, ...n }) {
|
|
4012
|
+
return /* @__PURE__ */ H(k, {
|
|
3525
4013
|
fullWidth: !1,
|
|
3526
4014
|
size: "small",
|
|
3527
4015
|
className: M(e),
|
|
@@ -3531,44 +4019,44 @@ function Rs({ className: e, selectItemClassName: t, ...n }) {
|
|
|
3531
4019
|
}
|
|
3532
4020
|
//#endregion
|
|
3533
4021
|
//#region src/components/rich-text-field/components/alignment-select.tsx
|
|
3534
|
-
function
|
|
4022
|
+
function jc(e) {
|
|
3535
4023
|
return e === "center" || e === "right" ? e : e === "end" ? "right" : "left";
|
|
3536
4024
|
}
|
|
3537
|
-
var
|
|
4025
|
+
var Mc = {
|
|
3538
4026
|
left: {
|
|
3539
4027
|
label: "Left",
|
|
3540
|
-
icon: /* @__PURE__ */ H(
|
|
4028
|
+
icon: /* @__PURE__ */ H(jt, { fontSize: "inherit" })
|
|
3541
4029
|
},
|
|
3542
4030
|
center: {
|
|
3543
4031
|
label: "Center",
|
|
3544
|
-
icon: /* @__PURE__ */ H(
|
|
4032
|
+
icon: /* @__PURE__ */ H(At, { fontSize: "inherit" })
|
|
3545
4033
|
},
|
|
3546
4034
|
right: {
|
|
3547
4035
|
label: "Right",
|
|
3548
|
-
icon: /* @__PURE__ */ H(
|
|
4036
|
+
icon: /* @__PURE__ */ H(Mt, { fontSize: "inherit" })
|
|
3549
4037
|
}
|
|
3550
4038
|
};
|
|
3551
|
-
function
|
|
3552
|
-
let t = Q(), [n, r] = V(
|
|
4039
|
+
function Nc({ className: e }) {
|
|
4040
|
+
let t = Q(), [n, r] = V(Oc), i = z(() => Object.entries(Mc).map(([e, { label: t, icon: n }]) => ({
|
|
3553
4041
|
value: e,
|
|
3554
4042
|
label: t,
|
|
3555
4043
|
icon: n
|
|
3556
4044
|
})), []), a = F(() => {
|
|
3557
4045
|
let e = K();
|
|
3558
4046
|
if (q(e)) {
|
|
3559
|
-
let t = e.anchor.getNode(), n = t.getParent(), i =
|
|
3560
|
-
|
|
4047
|
+
let t = e.anchor.getNode(), n = t.getParent(), i = Ze(t) ? t : n;
|
|
4048
|
+
Ze(i) && r(jc(i.getFormatType() || "left"));
|
|
3561
4049
|
}
|
|
3562
4050
|
}, []);
|
|
3563
|
-
L(() =>
|
|
4051
|
+
L(() => _n(t.registerUpdateListener(({ editorState: e }) => {
|
|
3564
4052
|
e.read(() => {
|
|
3565
4053
|
a();
|
|
3566
4054
|
});
|
|
3567
|
-
}), t.registerCommand(
|
|
4055
|
+
}), t.registerCommand(ut, () => (a(), !1), it)), [t, a]);
|
|
3568
4056
|
function o(e) {
|
|
3569
|
-
t.dispatchCommand(
|
|
4057
|
+
t.dispatchCommand(st, e);
|
|
3570
4058
|
}
|
|
3571
|
-
return /* @__PURE__ */ H(
|
|
4059
|
+
return /* @__PURE__ */ H(Ac, {
|
|
3572
4060
|
shouldShowOnlyIcon: !0,
|
|
3573
4061
|
options: i,
|
|
3574
4062
|
value: n,
|
|
@@ -3591,91 +4079,91 @@ function $({ className: e, children: t, isActive: n, isDisabled: r = !1, ...i })
|
|
|
3591
4079
|
}
|
|
3592
4080
|
//#endregion
|
|
3593
4081
|
//#region src/components/rich-text-field/components/attachment-button.tsx
|
|
3594
|
-
function
|
|
4082
|
+
function Pc(e) {
|
|
3595
4083
|
let t = Q();
|
|
3596
4084
|
function n() {
|
|
3597
|
-
t.dispatchCommand(
|
|
4085
|
+
t.dispatchCommand(vc, void 0);
|
|
3598
4086
|
}
|
|
3599
4087
|
return /* @__PURE__ */ H($, {
|
|
3600
4088
|
"data-testid": "attachment-button",
|
|
3601
4089
|
"aria-label": "Add Attachment",
|
|
3602
4090
|
onClick: n,
|
|
3603
4091
|
...e,
|
|
3604
|
-
children: /* @__PURE__ */ H(
|
|
4092
|
+
children: /* @__PURE__ */ H(St, {})
|
|
3605
4093
|
});
|
|
3606
4094
|
}
|
|
3607
4095
|
//#endregion
|
|
3608
4096
|
//#region src/components/rich-text-field/utils.ts
|
|
3609
|
-
function
|
|
4097
|
+
function Fc(e) {
|
|
3610
4098
|
let t;
|
|
3611
|
-
for (let n of
|
|
3612
|
-
return t ||
|
|
4099
|
+
for (let n of Sn(e, { silent: !0 })) n.type === "declaration" && n.value && (t ||= {}, t[n.property] = n.value);
|
|
4100
|
+
return t || Ic;
|
|
3613
4101
|
}
|
|
3614
|
-
var
|
|
3615
|
-
function
|
|
3616
|
-
return typeof e == "string" ?
|
|
4102
|
+
var Ic = Object.freeze({});
|
|
4103
|
+
function Lc(e) {
|
|
4104
|
+
return typeof e == "string" ? Fc(e) : Ic;
|
|
3617
4105
|
}
|
|
3618
|
-
function
|
|
4106
|
+
function Rc(e) {
|
|
3619
4107
|
let t = [];
|
|
3620
4108
|
for (let [n, r] of Object.entries(e)) n && r && t.push(`${n}: ${r};`);
|
|
3621
4109
|
return t.sort().join(" ");
|
|
3622
4110
|
}
|
|
3623
|
-
function
|
|
4111
|
+
function zc(e, t) {
|
|
3624
4112
|
return e === t || !e && !t;
|
|
3625
4113
|
}
|
|
3626
|
-
function
|
|
4114
|
+
function Bc(e, t) {
|
|
3627
4115
|
if (e === t) return !0;
|
|
3628
|
-
for (let n in e) if (!(n in t &&
|
|
4116
|
+
for (let n in e) if (!(n in t && zc(e[n], t[n]))) return !1;
|
|
3629
4117
|
for (let n in t) if (!(n in e)) return !1;
|
|
3630
4118
|
return !0;
|
|
3631
4119
|
}
|
|
3632
|
-
var
|
|
3633
|
-
isEqual:
|
|
3634
|
-
parse:
|
|
3635
|
-
unparse:
|
|
4120
|
+
var Vc = mt("style", {
|
|
4121
|
+
isEqual: Bc,
|
|
4122
|
+
parse: Lc,
|
|
4123
|
+
unparse: Rc
|
|
3636
4124
|
});
|
|
3637
|
-
function
|
|
3638
|
-
return
|
|
4125
|
+
function Hc(e, t) {
|
|
4126
|
+
return tt(e, Vc, t);
|
|
3639
4127
|
}
|
|
3640
|
-
function
|
|
3641
|
-
return e ===
|
|
4128
|
+
function Uc(e, t) {
|
|
4129
|
+
return e === Ic || e === t ? t : {
|
|
3642
4130
|
...e,
|
|
3643
4131
|
...t
|
|
3644
4132
|
};
|
|
3645
4133
|
}
|
|
3646
|
-
|
|
3647
|
-
function
|
|
4134
|
+
pt("PATCH_TEXT_STYLE_COMMAND");
|
|
4135
|
+
function Wc(e) {
|
|
3648
4136
|
let t = K();
|
|
3649
4137
|
if (!t) {
|
|
3650
|
-
let e =
|
|
4138
|
+
let e = Ye();
|
|
3651
4139
|
if (!e) return !1;
|
|
3652
|
-
t = e.clone(),
|
|
4140
|
+
t = e.clone(), et(t);
|
|
3653
4141
|
}
|
|
3654
|
-
let n = typeof e == "function" ? e : (t) =>
|
|
4142
|
+
let n = typeof e == "function" ? e : (t) => Uc(t, e);
|
|
3655
4143
|
if (q(t) && t.isCollapsed()) {
|
|
3656
4144
|
let e = t.focus.getNode();
|
|
3657
|
-
J(e) &&
|
|
3658
|
-
} else
|
|
4145
|
+
J(e) && Hc(e, n);
|
|
4146
|
+
} else vn((e) => Hc(e, n));
|
|
3659
4147
|
return !0;
|
|
3660
4148
|
}
|
|
3661
|
-
function
|
|
4149
|
+
function Gc(e) {
|
|
3662
4150
|
let t = e.anchor, n = e.focus, r = e.anchor.getNode(), i = e.focus.getNode();
|
|
3663
|
-
return r === i ? r : e.isBackward() ?
|
|
4151
|
+
return r === i ? r : e.isBackward() ? bn(n) ? r : i : bn(t) ? r : i;
|
|
3664
4152
|
}
|
|
3665
|
-
var
|
|
4153
|
+
var Kc = (e, t, n, r) => {
|
|
3666
4154
|
e.update(() => {
|
|
3667
|
-
if (r &&
|
|
4155
|
+
if (r && Ge(dt), e.isEditable()) {
|
|
3668
4156
|
let e = K();
|
|
3669
|
-
e !== null &&
|
|
4157
|
+
e !== null && xn(e, { "font-size": t + "px" });
|
|
3670
4158
|
}
|
|
3671
4159
|
});
|
|
3672
|
-
},
|
|
3673
|
-
function
|
|
3674
|
-
let e = I(
|
|
4160
|
+
}, qc = (e) => e.startsWith("http") ? e : `https://${e}`, Jc = N(null);
|
|
4161
|
+
function Yc() {
|
|
4162
|
+
let e = I(Jc);
|
|
3675
4163
|
if (!e) throw Error("\"useRichTextFieldContext\" must be used within a RichTextFieldContextProvider");
|
|
3676
4164
|
return e;
|
|
3677
4165
|
}
|
|
3678
|
-
function
|
|
4166
|
+
function Xc(e) {
|
|
3679
4167
|
let t = e.trim(), n = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t);
|
|
3680
4168
|
if (n) {
|
|
3681
4169
|
let e = n[1];
|
|
@@ -3690,49 +4178,49 @@ function ic(e) {
|
|
|
3690
4178
|
let e = (e) => Math.max(0, Math.min(255, e)), [t, n, i] = r.slice(1, 4).map((t) => e(Number.parseInt(t, 10))), a = (e) => e.toString(16).padStart(2, "0");
|
|
3691
4179
|
return `#${a(t)}${a(n)}${a(i)}`;
|
|
3692
4180
|
}
|
|
3693
|
-
return
|
|
4181
|
+
return kc;
|
|
3694
4182
|
}
|
|
3695
|
-
function
|
|
3696
|
-
let t = Q(), [n, r] = V(
|
|
4183
|
+
function Zc({ children: e }) {
|
|
4184
|
+
let t = Q(), [n, r] = V(Ec), [i, a] = V("16"), [o, s] = V(!1), [c, l] = V(!1), [u, d] = V(!1), [f, p] = V(kc), [m, h] = V(!1), g = F(() => {
|
|
3697
4185
|
let e = K();
|
|
3698
4186
|
if (q(e)) {
|
|
3699
|
-
r(
|
|
3700
|
-
let t =
|
|
4187
|
+
r(yn(e, "font-family", Ec));
|
|
4188
|
+
let t = yn(e, "font-size", "16px");
|
|
3701
4189
|
a(t ? t.replace("px", "") : "16"), s(e.hasFormat("bold")), l(e.hasFormat("italic")), d(e.hasFormat("underline"));
|
|
3702
|
-
let n =
|
|
3703
|
-
p(
|
|
3704
|
-
let i =
|
|
4190
|
+
let n = yn(e, "color", "#000000") || "#000000";
|
|
4191
|
+
p(Xc(n));
|
|
4192
|
+
let i = Gc(e), o = i.getParent(), c = Te(o) || Te(i);
|
|
3705
4193
|
h(c);
|
|
3706
4194
|
}
|
|
3707
4195
|
}, []);
|
|
3708
|
-
L(() =>
|
|
4196
|
+
L(() => _n(t.registerUpdateListener(({ editorState: e }) => {
|
|
3709
4197
|
e.read(() => {
|
|
3710
4198
|
g();
|
|
3711
4199
|
});
|
|
3712
|
-
}), t.registerCommand(
|
|
4200
|
+
}), t.registerCommand(ut, () => (g(), !1), it)), [t, g]);
|
|
3713
4201
|
let _ = F((e) => {
|
|
3714
4202
|
t.update(() => {
|
|
3715
|
-
|
|
4203
|
+
Ge(ft);
|
|
3716
4204
|
let t = K();
|
|
3717
|
-
t !== null &&
|
|
4205
|
+
t !== null && xn(t, { "font-family": e });
|
|
3718
4206
|
});
|
|
3719
4207
|
}, [t]), v = F((e) => {
|
|
3720
|
-
|
|
4208
|
+
Kc(t, e, null, !1);
|
|
3721
4209
|
}, [t]), y = F(() => {
|
|
3722
|
-
t.dispatchCommand(
|
|
4210
|
+
t.dispatchCommand(ct, "bold");
|
|
3723
4211
|
}, [t]), b = F(() => {
|
|
3724
|
-
t.dispatchCommand(
|
|
4212
|
+
t.dispatchCommand(ct, "italic");
|
|
3725
4213
|
}, [t]), x = F(() => {
|
|
3726
|
-
t.dispatchCommand(
|
|
4214
|
+
t.dispatchCommand(ct, "underline");
|
|
3727
4215
|
}, [t]), S = F((e) => {
|
|
3728
4216
|
t.update(() => {
|
|
3729
|
-
|
|
4217
|
+
Ge(ft);
|
|
3730
4218
|
let t = K();
|
|
3731
|
-
t !== null &&
|
|
4219
|
+
t !== null && xn(t, { color: e });
|
|
3732
4220
|
});
|
|
3733
|
-
}, [t]),
|
|
3734
|
-
m ? (h(!1), t.dispatchCommand(
|
|
3735
|
-
}, [m, h]),
|
|
4221
|
+
}, [t]), ee = F(() => {
|
|
4222
|
+
m ? (h(!1), t.dispatchCommand(De, null)) : (h(!0), t.dispatchCommand(De, qc("https://")));
|
|
4223
|
+
}, [m, h]), te = z(() => ({
|
|
3736
4224
|
fontFamily: n,
|
|
3737
4225
|
fontSize: i,
|
|
3738
4226
|
textColor: f,
|
|
@@ -3746,7 +4234,7 @@ function ac({ children: e }) {
|
|
|
3746
4234
|
onBold: y,
|
|
3747
4235
|
onItalic: b,
|
|
3748
4236
|
onUnderline: x,
|
|
3749
|
-
onLink:
|
|
4237
|
+
onLink: ee
|
|
3750
4238
|
}), [
|
|
3751
4239
|
n,
|
|
3752
4240
|
i,
|
|
@@ -3761,35 +4249,35 @@ function ac({ children: e }) {
|
|
|
3761
4249
|
y,
|
|
3762
4250
|
b,
|
|
3763
4251
|
x,
|
|
3764
|
-
|
|
4252
|
+
ee
|
|
3765
4253
|
]);
|
|
3766
|
-
return /* @__PURE__ */ H(
|
|
3767
|
-
value:
|
|
4254
|
+
return /* @__PURE__ */ H(Jc.Provider, {
|
|
4255
|
+
value: te,
|
|
3768
4256
|
children: e
|
|
3769
4257
|
});
|
|
3770
4258
|
}
|
|
3771
4259
|
//#endregion
|
|
3772
4260
|
//#region src/components/rich-text-field/components/bold-button.tsx
|
|
3773
|
-
function
|
|
3774
|
-
let { isBold: t, onBold: n } =
|
|
4261
|
+
function Qc({ ...e }) {
|
|
4262
|
+
let { isBold: t, onBold: n } = Yc();
|
|
3775
4263
|
return /* @__PURE__ */ H($, {
|
|
3776
4264
|
"data-testid": "bold-button",
|
|
3777
4265
|
"aria-label": "Format Bold",
|
|
3778
4266
|
isActive: t,
|
|
3779
4267
|
onClick: n,
|
|
3780
4268
|
...e,
|
|
3781
|
-
children: /* @__PURE__ */ H(
|
|
4269
|
+
children: /* @__PURE__ */ H(Nt, {})
|
|
3782
4270
|
});
|
|
3783
4271
|
}
|
|
3784
4272
|
//#endregion
|
|
3785
4273
|
//#region src/components/rich-text-field/components/clean-format-button.tsx
|
|
3786
|
-
function
|
|
4274
|
+
function $c({ ...e }) {
|
|
3787
4275
|
let t = Q(), n = F(() => {
|
|
3788
4276
|
t.update(() => {
|
|
3789
4277
|
let e = K();
|
|
3790
4278
|
if (q(e)) {
|
|
3791
|
-
|
|
3792
|
-
for (let t of e.extract()) J(t) && (t.setFormat(0), t.setStyle(""),
|
|
4279
|
+
Wc(() => Ic);
|
|
4280
|
+
for (let t of e.extract()) J(t) && (t.setFormat(0), t.setStyle(""), gn(t).setFormat(""));
|
|
3793
4281
|
}
|
|
3794
4282
|
});
|
|
3795
4283
|
}, [t]);
|
|
@@ -3798,47 +4286,47 @@ function sc({ ...e }) {
|
|
|
3798
4286
|
"aria-label": "Reset Formatting",
|
|
3799
4287
|
onClick: n,
|
|
3800
4288
|
...e,
|
|
3801
|
-
children: /* @__PURE__ */ H(
|
|
4289
|
+
children: /* @__PURE__ */ H(Pt, {})
|
|
3802
4290
|
});
|
|
3803
4291
|
}
|
|
3804
4292
|
//#endregion
|
|
3805
4293
|
//#region src/components/rich-text-field/components/image-button.tsx
|
|
3806
|
-
function
|
|
4294
|
+
function el({ ...e }) {
|
|
3807
4295
|
return /* @__PURE__ */ H($, {
|
|
3808
4296
|
"data-testid": "image-button",
|
|
3809
4297
|
"aria-label": "Add Image",
|
|
3810
4298
|
...e,
|
|
3811
|
-
children: /* @__PURE__ */ H(
|
|
4299
|
+
children: /* @__PURE__ */ H(Rt, {})
|
|
3812
4300
|
});
|
|
3813
4301
|
}
|
|
3814
4302
|
//#endregion
|
|
3815
4303
|
//#region src/components/rich-text-field/components/italic-button.tsx
|
|
3816
|
-
function
|
|
3817
|
-
let { isItalic: t, onItalic: n } =
|
|
4304
|
+
function tl({ ...e }) {
|
|
4305
|
+
let { isItalic: t, onItalic: n } = Yc();
|
|
3818
4306
|
return /* @__PURE__ */ H($, {
|
|
3819
4307
|
"data-testid": "italic-button",
|
|
3820
4308
|
"aria-label": "Format Italics",
|
|
3821
4309
|
isActive: t,
|
|
3822
4310
|
onClick: n,
|
|
3823
4311
|
...e,
|
|
3824
|
-
children: /* @__PURE__ */ H(
|
|
4312
|
+
children: /* @__PURE__ */ H(It, {})
|
|
3825
4313
|
});
|
|
3826
4314
|
}
|
|
3827
4315
|
//#endregion
|
|
3828
4316
|
//#region src/components/rich-text-field/components/link-button.tsx
|
|
3829
|
-
function
|
|
4317
|
+
function nl({ isActive: e, ...t }) {
|
|
3830
4318
|
return /* @__PURE__ */ H($, {
|
|
3831
4319
|
"data-testid": "link-button",
|
|
3832
4320
|
"aria-label": "Add Link",
|
|
3833
4321
|
...t,
|
|
3834
|
-
children: H(e ?
|
|
4322
|
+
children: H(e ? Bt : zt, {})
|
|
3835
4323
|
});
|
|
3836
4324
|
}
|
|
3837
4325
|
//#endregion
|
|
3838
4326
|
//#region src/components/rich-text-field/components/size-select.tsx
|
|
3839
|
-
function
|
|
3840
|
-
let { fontSize: t, onFontSize: n } =
|
|
3841
|
-
return /* @__PURE__ */ H(
|
|
4327
|
+
function rl({ className: e }) {
|
|
4328
|
+
let { fontSize: t, onFontSize: n } = Yc(), r = z(() => [...Dc], []);
|
|
4329
|
+
return /* @__PURE__ */ H(Ac, {
|
|
3842
4330
|
"data-testid": "size-select",
|
|
3843
4331
|
options: r,
|
|
3844
4332
|
value: t,
|
|
@@ -3848,8 +4336,8 @@ function dc({ className: e }) {
|
|
|
3848
4336
|
}
|
|
3849
4337
|
//#endregion
|
|
3850
4338
|
//#region src/components/rich-text-field/components/text-color-button.tsx
|
|
3851
|
-
function
|
|
3852
|
-
let { textColor: n, onTextColor: r } =
|
|
4339
|
+
function il({ wrapperClassName: e, ...t }) {
|
|
4340
|
+
let { textColor: n, onTextColor: r } = Yc(), i = n === kc;
|
|
3853
4341
|
function a(e) {
|
|
3854
4342
|
r(e.target.value);
|
|
3855
4343
|
}
|
|
@@ -3862,7 +4350,7 @@ function fc({ wrapperClassName: e, ...t }) {
|
|
|
3862
4350
|
...t,
|
|
3863
4351
|
children: /* @__PURE__ */ H("span", {
|
|
3864
4352
|
style: i ? {} : { color: n },
|
|
3865
|
-
children: /* @__PURE__ */ H(
|
|
4353
|
+
children: /* @__PURE__ */ H(Ft, {})
|
|
3866
4354
|
})
|
|
3867
4355
|
}), /* @__PURE__ */ H("input", {
|
|
3868
4356
|
type: "color",
|
|
@@ -3883,9 +4371,9 @@ function fc({ wrapperClassName: e, ...t }) {
|
|
|
3883
4371
|
}
|
|
3884
4372
|
//#endregion
|
|
3885
4373
|
//#region src/components/rich-text-field/components/typography-select.tsx
|
|
3886
|
-
function
|
|
3887
|
-
let { fontFamily: t, onFontFamily: n } =
|
|
3888
|
-
return /* @__PURE__ */ H(
|
|
4374
|
+
function al({ className: e }) {
|
|
4375
|
+
let { fontFamily: t, onFontFamily: n } = Yc(), r = z(() => [...Tc], []);
|
|
4376
|
+
return /* @__PURE__ */ H(Ac, {
|
|
3889
4377
|
"data-testid": "typography-select",
|
|
3890
4378
|
options: r,
|
|
3891
4379
|
value: t,
|
|
@@ -3895,37 +4383,37 @@ function pc({ className: e }) {
|
|
|
3895
4383
|
}
|
|
3896
4384
|
//#endregion
|
|
3897
4385
|
//#region src/components/rich-text-field/components/underline-button.tsx
|
|
3898
|
-
function
|
|
3899
|
-
let { isUnderline: t, onUnderline: n } =
|
|
4386
|
+
function ol({ ...e }) {
|
|
4387
|
+
let { isUnderline: t, onUnderline: n } = Yc();
|
|
3900
4388
|
return /* @__PURE__ */ H($, {
|
|
3901
4389
|
"data-testid": "underline-button",
|
|
3902
4390
|
"aria-label": "Format Underline",
|
|
3903
4391
|
isActive: t,
|
|
3904
4392
|
onClick: n,
|
|
3905
4393
|
...e,
|
|
3906
|
-
children: /* @__PURE__ */ H(
|
|
4394
|
+
children: /* @__PURE__ */ H(Lt, {})
|
|
3907
4395
|
});
|
|
3908
4396
|
}
|
|
3909
4397
|
//#endregion
|
|
3910
4398
|
//#region src/components/rich-text-field/components/formatting-toolbar-plugin.tsx
|
|
3911
|
-
var
|
|
3912
|
-
/* @__PURE__ */ H(
|
|
3913
|
-
/* @__PURE__ */ H(
|
|
4399
|
+
var sl = ({ hasAttachments: e }) => /* @__PURE__ */ U(Ce, { children: [
|
|
4400
|
+
/* @__PURE__ */ H(al, {}),
|
|
4401
|
+
/* @__PURE__ */ H(rl, {}),
|
|
3914
4402
|
/* @__PURE__ */ H(d, { orientation: "vertical" }),
|
|
3915
|
-
/* @__PURE__ */ H(
|
|
3916
|
-
/* @__PURE__ */ H(
|
|
3917
|
-
/* @__PURE__ */ H(
|
|
3918
|
-
/* @__PURE__ */ H(
|
|
4403
|
+
/* @__PURE__ */ H(Qc, {}),
|
|
4404
|
+
/* @__PURE__ */ H(tl, {}),
|
|
4405
|
+
/* @__PURE__ */ H(ol, {}),
|
|
4406
|
+
/* @__PURE__ */ H(il, {}),
|
|
3919
4407
|
/* @__PURE__ */ H(d, { orientation: "vertical" }),
|
|
3920
|
-
/* @__PURE__ */ H(
|
|
3921
|
-
/* @__PURE__ */ H(
|
|
3922
|
-
/* @__PURE__ */ H(
|
|
4408
|
+
/* @__PURE__ */ H(nl, { isDisabled: !0 }),
|
|
4409
|
+
/* @__PURE__ */ H(Pc, { isDisabled: !e }),
|
|
4410
|
+
/* @__PURE__ */ H(el, { isDisabled: !0 }),
|
|
3923
4411
|
/* @__PURE__ */ H(d, { orientation: "vertical" }),
|
|
3924
|
-
/* @__PURE__ */ H(
|
|
4412
|
+
/* @__PURE__ */ H(Nc, {}),
|
|
3925
4413
|
/* @__PURE__ */ H(d, { orientation: "vertical" }),
|
|
3926
|
-
/* @__PURE__ */ H(
|
|
4414
|
+
/* @__PURE__ */ H($c, {})
|
|
3927
4415
|
] });
|
|
3928
|
-
function
|
|
4416
|
+
function cl({ className: e, children: t = sl, hasAttachments: n = !1 }) {
|
|
3929
4417
|
return /* @__PURE__ */ H("div", {
|
|
3930
4418
|
"data-testid": "formatting-toolbar",
|
|
3931
4419
|
"data-slot": "rich-text-field-toolbar",
|
|
@@ -3935,9 +4423,9 @@ function gc({ className: e, children: t = hc, hasAttachments: n = !1 }) {
|
|
|
3935
4423
|
}
|
|
3936
4424
|
//#endregion
|
|
3937
4425
|
//#region src/components/rich-text-field/rich-text-field.tsx
|
|
3938
|
-
var
|
|
4426
|
+
var ll = P(({ children: e, className: t, placeholderClassName: n, containerClassName: r, toolbarPlacement: i = "top", toolbarChildren: a, toolbarClassName: o, isMultipleAttachments: s, enableAttachments: c, acceptedFiles: l, onFileAttach: u, ...d }, f) => {
|
|
3939
4427
|
let p = i === "top";
|
|
3940
|
-
return /* @__PURE__ */ U(
|
|
4428
|
+
return /* @__PURE__ */ U(Cc, {
|
|
3941
4429
|
ref: f,
|
|
3942
4430
|
"data-testid": "rich-text-field",
|
|
3943
4431
|
"data-slot": "rich-text-field",
|
|
@@ -3946,21 +4434,21 @@ var _c = P(({ children: e, className: t, placeholderClassName: n, containerClass
|
|
|
3946
4434
|
containerClassName: M("h-rich-text-field-height", "rounded-rich-text-field-toolbar", p ? "pt-rich-text-field-toolbar-height" : "pb-rich-text-field-toolbar-height", r),
|
|
3947
4435
|
className: M("p-rich-text-field-editor-padding", "bg-rich-text-field-background", "size-full", t),
|
|
3948
4436
|
...d,
|
|
3949
|
-
children: [/* @__PURE__ */ H(
|
|
4437
|
+
children: [/* @__PURE__ */ H(Zc, { children: /* @__PURE__ */ H(cl, {
|
|
3950
4438
|
hasAttachments: c,
|
|
3951
4439
|
className: M("absolute right-0 w-full", p ? "top-0" : "bottom-0", o),
|
|
3952
4440
|
children: a
|
|
3953
|
-
}) }), /* @__PURE__ */ H(
|
|
4441
|
+
}) }), /* @__PURE__ */ H(yc, {
|
|
3954
4442
|
acceptedFiles: l,
|
|
3955
4443
|
onFileAttach: u,
|
|
3956
4444
|
isMultiple: s
|
|
3957
4445
|
})]
|
|
3958
4446
|
});
|
|
3959
4447
|
});
|
|
3960
|
-
|
|
4448
|
+
ll.displayName = "RichTextField";
|
|
3961
4449
|
//#endregion
|
|
3962
4450
|
//#region src/components/topmenu/topmenu.tsx
|
|
3963
|
-
var
|
|
4451
|
+
var ul = Cn("flex shrink-0 items-center justify-end", {
|
|
3964
4452
|
variants: {
|
|
3965
4453
|
size: {
|
|
3966
4454
|
md: ["px-[4px]", "rounded-overlay-tools-wrapper bg-overlay-tools-background-base"],
|
|
@@ -3985,7 +4473,7 @@ var vc = _n("flex shrink-0 items-center justify-end", {
|
|
|
3985
4473
|
hasBorder: !0
|
|
3986
4474
|
}
|
|
3987
4475
|
});
|
|
3988
|
-
function
|
|
4476
|
+
function dl({ className: e, children: t, ...n }) {
|
|
3989
4477
|
return /* @__PURE__ */ H("div", {
|
|
3990
4478
|
"data-slot": "topmenu",
|
|
3991
4479
|
role: "group",
|
|
@@ -3994,11 +4482,11 @@ function yc({ className: e, children: t, ...n }) {
|
|
|
3994
4482
|
children: t
|
|
3995
4483
|
});
|
|
3996
4484
|
}
|
|
3997
|
-
function
|
|
4485
|
+
function fl({ className: e, size: t, hasBorder: n, children: r, ...i }) {
|
|
3998
4486
|
return /* @__PURE__ */ H("div", {
|
|
3999
4487
|
"data-slot": "topmenu-actions",
|
|
4000
4488
|
"data-size": t ?? "lg",
|
|
4001
|
-
className: M(
|
|
4489
|
+
className: M(ul({
|
|
4002
4490
|
size: t,
|
|
4003
4491
|
hasBorder: n
|
|
4004
4492
|
}), e),
|
|
@@ -4008,42 +4496,42 @@ function bc({ className: e, size: t, hasBorder: n, children: r, ...i }) {
|
|
|
4008
4496
|
}
|
|
4009
4497
|
//#endregion
|
|
4010
4498
|
//#region src/domain/actions/constants.ts
|
|
4011
|
-
var
|
|
4499
|
+
var pl = "swisper";
|
|
4012
4500
|
//#endregion
|
|
4013
4501
|
//#region src/domain/actions/utils/index.ts
|
|
4014
|
-
function
|
|
4015
|
-
let n = `${
|
|
4502
|
+
function ml(e, t) {
|
|
4503
|
+
let n = `${pl}://action/${e}`;
|
|
4016
4504
|
return t ? `${n}?${new URLSearchParams(t).toString()}` : n;
|
|
4017
4505
|
}
|
|
4018
|
-
function
|
|
4019
|
-
return `[${t}](${
|
|
4506
|
+
function hl({ action: e, label: t, params: n }) {
|
|
4507
|
+
return `[${t}](${ml(e, n)})`;
|
|
4020
4508
|
}
|
|
4021
|
-
function
|
|
4509
|
+
function gl(e) {
|
|
4022
4510
|
if (!e?.startsWith("swisper://")) return !1;
|
|
4023
4511
|
let t = new URL(e);
|
|
4024
4512
|
return t.protocol === "swisper:" && t.hostname === "action" && t.pathname.startsWith("/") && t.pathname.split("/").length === 2;
|
|
4025
4513
|
}
|
|
4026
|
-
function
|
|
4514
|
+
function _l(e) {
|
|
4027
4515
|
let t;
|
|
4028
4516
|
try {
|
|
4029
4517
|
t = new URL(e);
|
|
4030
4518
|
} catch {
|
|
4031
4519
|
return null;
|
|
4032
4520
|
}
|
|
4033
|
-
return
|
|
4521
|
+
return gl(e) ? {
|
|
4034
4522
|
option: t.pathname.replace("/", ""),
|
|
4035
4523
|
payload: Object.fromEntries(t.searchParams.entries())
|
|
4036
4524
|
} : null;
|
|
4037
4525
|
}
|
|
4038
|
-
function
|
|
4526
|
+
function vl(e) {
|
|
4039
4527
|
for (let t of e) if (t.type === "text" && typeof t.value == "string") return t.value;
|
|
4040
4528
|
return null;
|
|
4041
4529
|
}
|
|
4042
|
-
function
|
|
4043
|
-
let t =
|
|
4044
|
-
return
|
|
4530
|
+
function yl(e) {
|
|
4531
|
+
let t = En().use(Tn).use(wn).parse(e), n = null;
|
|
4532
|
+
return Dn(t, (e) => {
|
|
4045
4533
|
if (e.type !== "link") return;
|
|
4046
|
-
let t =
|
|
4534
|
+
let t = _l(e.url), r = vl(e.children);
|
|
4047
4535
|
if (t && r) {
|
|
4048
4536
|
n = {
|
|
4049
4537
|
label: r,
|
|
@@ -4057,23 +4545,23 @@ function Dc(e) {
|
|
|
4057
4545
|
}
|
|
4058
4546
|
//#endregion
|
|
4059
4547
|
//#region src/domain/actions/hooks/index.ts
|
|
4060
|
-
function
|
|
4061
|
-
return z(() => e.map((e) =>
|
|
4548
|
+
function bl(e) {
|
|
4549
|
+
return z(() => e.map((e) => yl(e) || { label: e }).filter((e) => e !== null), [e]);
|
|
4062
4550
|
}
|
|
4063
4551
|
//#endregion
|
|
4064
4552
|
//#region src/hooks/use-chat-stream-message.ts
|
|
4065
|
-
function
|
|
4553
|
+
function xl(e) {
|
|
4066
4554
|
return JSON.parse(e);
|
|
4067
4555
|
}
|
|
4068
|
-
function
|
|
4556
|
+
function Sl(e) {
|
|
4069
4557
|
return e instanceof Error ? e.name === "AbortError" || e.name === "TimeoutError" : !1;
|
|
4070
4558
|
}
|
|
4071
|
-
function
|
|
4559
|
+
function Cl(e, t) {
|
|
4072
4560
|
return e instanceof Error ? e : Error(t);
|
|
4073
4561
|
}
|
|
4074
|
-
function
|
|
4562
|
+
function wl() {
|
|
4075
4563
|
return { streamMessage: F(async ({ stream: e, abortController: t, timeout: n = 2e4, tokenParser: r, onChunkReceived: i, onAbort: a, onFinish: o, onError: s }) => {
|
|
4076
|
-
let c = r ??
|
|
4564
|
+
let c = r ?? xl, l, u = !1, d = () => {
|
|
4077
4565
|
l !== void 0 && (clearTimeout(l), l = void 0);
|
|
4078
4566
|
}, f = (e) => {
|
|
4079
4567
|
u || (u = !0, d(), a?.(e));
|
|
@@ -4084,7 +4572,7 @@ function Mc() {
|
|
|
4084
4572
|
}, n));
|
|
4085
4573
|
};
|
|
4086
4574
|
try {
|
|
4087
|
-
let n = "", r = new TextDecoder("utf-8"), a =
|
|
4575
|
+
let n = "", r = new TextDecoder("utf-8"), a = On({
|
|
4088
4576
|
onEvent(e) {
|
|
4089
4577
|
try {
|
|
4090
4578
|
n += e.data;
|
|
@@ -4100,7 +4588,7 @@ function Mc() {
|
|
|
4100
4588
|
}
|
|
4101
4589
|
});
|
|
4102
4590
|
for (t?.signal.addEventListener("abort", () => {
|
|
4103
|
-
let e =
|
|
4591
|
+
let e = Cl(t.signal.reason, "Stream aborted");
|
|
4104
4592
|
f(e);
|
|
4105
4593
|
}, { once: !0 }), p(); !u;) {
|
|
4106
4594
|
let { value: t, done: n } = await e.read(), i = r.decode(t, { stream: !0 });
|
|
@@ -4109,8 +4597,8 @@ function Mc() {
|
|
|
4109
4597
|
d(), !u && !t?.signal.aborted && o?.(n);
|
|
4110
4598
|
} catch (e) {
|
|
4111
4599
|
let n = e;
|
|
4112
|
-
if (u || t?.signal.aborted ||
|
|
4113
|
-
u || f(
|
|
4600
|
+
if (u || t?.signal.aborted || Sl(n)) {
|
|
4601
|
+
u || f(Cl(n, "Stream aborted"));
|
|
4114
4602
|
return;
|
|
4115
4603
|
}
|
|
4116
4604
|
t?.abort(n), console.error("Error while reading stream:", n), s?.(n);
|
|
@@ -4119,7 +4607,7 @@ function Mc() {
|
|
|
4119
4607
|
}
|
|
4120
4608
|
//#endregion
|
|
4121
4609
|
//#region src/hooks/use-on-chat-changed.ts
|
|
4122
|
-
function
|
|
4610
|
+
function Tl(e) {
|
|
4123
4611
|
let { chatId: t, isNewChat: n } = X(), r = B(n), i = B(t), a = B(e);
|
|
4124
4612
|
a.current = e, r.current = n, L(() => {
|
|
4125
4613
|
i.current !== t && (a.current({
|
|
@@ -4131,19 +4619,19 @@ function Nc(e) {
|
|
|
4131
4619
|
}
|
|
4132
4620
|
//#endregion
|
|
4133
4621
|
//#region src/hooks/use-current-chat-id.ts
|
|
4134
|
-
function
|
|
4622
|
+
function El() {
|
|
4135
4623
|
let { chatId: e } = X();
|
|
4136
4624
|
return e;
|
|
4137
4625
|
}
|
|
4138
4626
|
//#endregion
|
|
4139
4627
|
//#region src/hooks/use-is-current-chat-new.ts
|
|
4140
|
-
function
|
|
4628
|
+
function Dl() {
|
|
4141
4629
|
let { isNewChat: e } = X();
|
|
4142
4630
|
return e;
|
|
4143
4631
|
}
|
|
4144
4632
|
//#endregion
|
|
4145
4633
|
//#region src/hooks/use-loaded-chat-ids.ts
|
|
4146
|
-
function
|
|
4634
|
+
function Ol() {
|
|
4147
4635
|
let { loadedChatIdsRef: e } = X();
|
|
4148
4636
|
return {
|
|
4149
4637
|
getIsChatLoaded: F((t) => e.current?.has(t) ?? !1, []),
|
|
@@ -4157,7 +4645,7 @@ function Ic() {
|
|
|
4157
4645
|
}
|
|
4158
4646
|
//#endregion
|
|
4159
4647
|
//#region src/hooks/use-chat-prompt-placeholder.ts
|
|
4160
|
-
function
|
|
4648
|
+
function kl() {
|
|
4161
4649
|
let { promptPlaceholder: e, setPromptPlaceholder: t, clearPromptPlaceholder: n } = X();
|
|
4162
4650
|
return {
|
|
4163
4651
|
promptPlaceholder: e,
|
|
@@ -4166,6 +4654,6 @@ function Lc() {
|
|
|
4166
4654
|
};
|
|
4167
4655
|
}
|
|
4168
4656
|
//#endregion
|
|
4169
|
-
export {
|
|
4657
|
+
export { tc as $replaceEditorHTMLContent, nc as $replaceEditorSelectionHTMLContent, $s as $setSelectionToEnd, Nc as AlignmentSelect, Pc as AttachmentButton, Qc as BoldButton, pl as CHAT_ACTION_PROTOCOL, po as CanvasShell, go as CanvasShellCloseTrigger, bo as CanvasShellContent, xo as CanvasShellFooter, _o as CanvasShellFullScreenTrigger, mo as CanvasShellHeader, vo as CanvasShellOptionsButton, ho as CanvasShellTitle, oo as ChatArtifact, fo as ChatArtifactActions, uo as ChatArtifactCaption, co as ChatArtifactContent, so as ChatArtifactIcon, lo as ChatArtifactTitle, Qn as ChatCard, Ln as ChatCardActionButton, In as ChatCardActions, Yn as ChatCardAttribute, Xn as ChatCardAttributeLabel, Zn as ChatCardAttributeValue, Jn as ChatCardAttributes, Bn as ChatCardBody, Rn as ChatCardCollapsibleButton, rr as ChatCardContainer, Vn as ChatCardContent, Un as ChatCardFooter, Kn as ChatCardFooterActions, Wn as ChatCardFooterNotes, Gn as ChatCardFooterPrice, qn as ChatCardForm, jn as ChatCardHeader, Nn as ChatCardHeaderContent, Mn as ChatCardIcon, zn as ChatCardMedia, Hn as ChatCardPreview, Fn as ChatCardSubTitle, Pn as ChatCardTitle, lr as ChatContainer, dr as ChatContainerPrompt, fr as ChatContainerWelcome, _i as ChatConversationProvider, jr as ChatInput, Nr as ChatInputTextarea, Ir as ChatList, Br as ChatListEmptyState, Vr as ChatListError, Gr as ChatListItem, Wr as ChatListItems, Hr as ChatListLoadMore, zr as ChatListSkeleton, si as ChatMessage, li as ChatMessageActions, Di as ChatMessageAttachmentCard, ji as ChatMessageAttachmentCardActions, Oi as ChatMessageAttachmentCardContent, Ni as ChatMessageAttachmentCardIcon, Ai as ChatMessageAttachmentCardPreview, ki as ChatMessageAttachmentCardTitle, ci as ChatMessageContent, wi as ChatMessageListGroup, Bi as ChatMessageResponse, Vi as ChatMessageToolbar, Ui as ChatMessageToolbarActionButton, Hi as ChatMessageToolbarActions, Wi as ChatMessageToolbarTimestamp, xi as ChatMessages, Si as ChatMessagesList, Ei as ChatMessagesScrollButton, $i as ChatNotificationCard, sa as ChatNotificationCardActions, la as ChatNotificationCardButtons, pa as ChatNotificationCardCloseButton, ma as ChatNotificationCardContent, _a as ChatNotificationCardContentActions, ga as ChatNotificationCardContentDescription, ha as ChatNotificationCardContentTitle, fa as ChatNotificationCardDeleteButton, ba as ChatNotificationCardDescription, va as ChatNotificationCardExpandButton, ea as ChatNotificationCardHead, ta as ChatNotificationCardHeader, na as ChatNotificationCardHeaderIcon, oa as ChatNotificationCardHeaderStatus, ra as ChatNotificationCardHeaderTitle, ia as ChatNotificationCardHeaderTitleLabel, ya as ChatNotificationCardIcon, ua as ChatNotificationCardReadActionButton, da as ChatNotificationCardSnoozeButton, xa as ChatNotificationCardTimeStamp, ca as ChatNotificationCardTimestamp, Sa as ChatNotificationPopup, wa as ChatNotificationPopupContent, Ca as ChatNotificationPopupTrigger, $r as ChatPromptBox, ai as ChatPromptBoxActionsLeft, oi as ChatPromptBoxActionsRight, ri as ChatPromptBoxContent, ii as ChatPromptBoxInput, ni as ChatPromptBoxToolbar, fi as ChatProvider, Ao as ChatReasoning, as as ChatReasoningEnd, os as ChatReasoningEndIcon, ss as ChatReasoningEndText, Ho as ChatReasoningStep, Uo as ChatReasoningStepHead, Wo as ChatReasoningStepIcon, Go as ChatReasoningStepIconDot, Ko as ChatReasoningStepIconLogo, qo as ChatReasoningStepIconWeb, $o as ChatReasoningStepNote, is as ChatReasoningStepNotePageDomain, ns as ChatReasoningStepNotePageIcon, ts as ChatReasoningStepNotePageRow, rs as ChatReasoningStepNotePageTitle, es as ChatReasoningStepNotePages, Yo as ChatReasoningStepNotes, Jo as ChatReasoningStepText, Bo as ChatReasoningSteps, jo as ChatReasoningTrigger, zo as ChatReasoningTriggerArrow, Ro as ChatReasoningTriggerLabel, Mo as ChatReasoningTriggerSymbol, Fo as ChatReasoningTriggerSymbolSwisper, Ta as ChatReplies, Ea as ChatReply, Da as ChatReplyLabel, Oa as ChatReplyValue, Ma as ChatSuggestion, Ia as ChatSuggestionAction, Fa as ChatSuggestionActions, Pa as ChatSuggestionLabel, Na as ChatSuggestionLabelIcon, ja as ChatSuggestions, cs as ChatThinkingProcess, ps as ChatThinkingProcessContent, hs as ChatThinkingProcessContentItem, gs as ChatThinkingProcessContentItemIcon, ls as ChatThinkingProcessTrigger, fs as ChatThinkingProcessTriggerArrow, us as ChatThinkingProcessTriggerIcon, ds as ChatThinkingProcessTriggerLabel, $a as ChatThread, ro as ChatThreadAnswer, ao as ChatThreadErrorState, to as ChatThreadGroup, Za as ChatThreadProvider, no as ChatThreadQuestion, $c as CleanFormatButton, nr as EditableChatCardContextProvider, _s as EmptyState, xs as EmptyStateActionRow, bs as EmptyStateDescription, vs as EmptyStateIcon, ys as EmptyStateTitle, cl as FormattingToolbarPlugin, gc as HtmlPastePlugin, dc as INSERT_HTML_COMMAND, pc as INSERT_HTML_EVENT, oc as INSERT_IMAGE_COMMAND, sc as INSERT_IMAGE_EVENT_NAME, cc as ImageAddedEvent, el as ImageButton, lc as ImageDropPlugin, hc as InsertHtmlEvent, tl as ItalicButton, nl as LinkButton, Ri as MarkdownViewer, So as NewChatTrigger, uc as PASTE_HTML_COMMAND, fc as PASTE_HTML_EVENT, mc as PasteHtmlEvent, Cc as RichTextArea, ll as RichTextField, rl as SizeSelect, il as TextColorButton, $ as ToolbarButton, dl as TopMenu, fl as TopMenuActions, al as TypographySelect, ol as UnderlineButton, yo as canvasShellContentPadding, hl as createChatActionLink, yl as extractChatActionFromLink, Xi as formatSnoozeDate, Fi as getAttachmentIcon, Gi as getSnoozeUntilDate, gl as isChatActionURL, Qs as scrollRichTextAreaToBottom, bl as useChatActions, X as useChatContext, gi as useChatConversationContext, kr as useChatInputContext, Fr as useChatListContext, Ol as useChatLoadedIds, Qi as useChatNotificationCardContext, kl as useChatPromptPlaceholder, wl as useChatStreamMessage, Aa as useChatSuggestionContext, Ka as useChatThread, rn as useChatThreadScrollable, El as useCurrentChatId, $n as useEditChatCard, tr as useEditableChatCardContext, Dl as useIsCurrentChatNew, Tl as useOnChatChanged, Q as useRichTextAreaEditor, Ys as useRichTextAreaSelectedText };
|
|
4170
4658
|
|
|
4171
4659
|
//# sourceMappingURL=index.es.js.map
|