@deepagents/react-genai 7.44.0 → 7.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1062 -944
- package/dist/index.js.map +1 -1
- package/dist/lib/chat/agent-context.d.ts.map +1 -1
- package/dist/lib/chat/chat-manager.d.ts +8 -1
- package/dist/lib/chat/chat-manager.d.ts.map +1 -1
- package/dist/lib/chat/citations.d.ts +8 -1
- package/dist/lib/chat/citations.d.ts.map +1 -1
- package/dist/lib/chat/markdown-paragraph.d.ts +2 -1
- package/dist/lib/chat/markdown-paragraph.d.ts.map +1 -1
- package/dist/lib/chat/message-parts.d.ts +3 -2
- package/dist/lib/chat/message-parts.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/messages-context.d.ts +7 -0
- package/dist/lib/chat/trajectory/messages-context.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/segments/index.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/trajectories/messages-shell.d.ts +3 -1
- package/dist/lib/chat/trajectory/trajectories/messages-shell.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/trajectories/messages.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/trajectories/user-message.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/trajectory-segments.d.ts.map +1 -1
- package/dist/lib/components/CitationPill.d.ts +9 -1
- package/dist/lib/components/CitationPill.d.ts.map +1 -1
- package/dist/lib/components/InteractiveResponse.d.ts.map +1 -1
- package/dist/lib/elements/Response.d.ts +1 -1
- package/dist/lib/elements/Response.d.ts.map +1 -1
- package/dist/lib/elements/normalize-streamdown-children.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -10,44 +10,44 @@ import { useStickToBottom as ie } from "use-stick-to-bottom";
|
|
|
10
10
|
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
11
11
|
import { assertNoReservedAttributes as ae, defineElements as oe, toDescriptor as se } from "@deepagents/elements";
|
|
12
12
|
import { z as P } from "zod";
|
|
13
|
-
import { Alert as ce, AlertDescription as le, AlertTitle as ue, Attachment as de, AttachmentGroup as fe, AttachmentMedia as pe, Badge as me, Button as he, Card as ge, CardAction as _e, CardContent as ve, CardDescription as ye, CardFooter as be, CardHeader as xe, CardTitle as Se, CodeBlock as Ce, CodeBlockActions as we, CodeBlockContent as Te, CodeBlockLine as Ee, Collapsible as F, CollapsibleContent as I, CollapsibleTrigger as L,
|
|
14
|
-
import { AlertCircle as
|
|
15
|
-
import { toString as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { Block as
|
|
20
|
-
import { unified as
|
|
21
|
-
import { SKIP as
|
|
22
|
-
import { TheButton as
|
|
23
|
-
import { createPortal as
|
|
24
|
-
import { Composer as R, PersistedPromptText as
|
|
25
|
-
import { get as
|
|
26
|
-
import { formatCompactNumber as
|
|
13
|
+
import { Alert as ce, AlertDescription as le, AlertTitle as ue, Attachment as de, AttachmentGroup as fe, AttachmentMedia as pe, Badge as me, Button as he, Card as ge, CardAction as _e, CardContent as ve, CardDescription as ye, CardFooter as be, CardHeader as xe, CardTitle as Se, CodeBlock as Ce, CodeBlockActions as we, CodeBlockContent as Te, CodeBlockLine as Ee, Collapsible as F, CollapsibleContent as I, CollapsibleTrigger as L, Popover as De, PopoverContent as Oe, PopoverDescription as ke, PopoverHeader as Ae, PopoverTitle as je, PopoverTrigger as Me, buttonVariants as Ne, useHighlightedCode as Pe } from "@zukhruf/shadcn";
|
|
14
|
+
import { AlertCircle as Fe, BanIcon as Ie, Braces as Le, Check as Re, CheckCircleIcon as ze, CheckIcon as Be, ChevronDown as Ve, ChevronDownIcon as He, ChevronRight as Ue, CircleIcon as We, ClockIcon as Ge, Copy as Ke, CopyIcon as qe, Lightbulb as Je, ListPlus as Ye, Loader as Xe, Loader2Icon as Ze, MicIcon as Qe, Paperclip as $e, Plus as et, RefreshCw as tt, SquareIcon as nt, Trash2 as rt, WrenchIcon as it, XCircleIcon as at, XIcon as ot } from "lucide-react";
|
|
15
|
+
import { toString as st } from "mdast-util-to-string";
|
|
16
|
+
import ct from "remark-directive";
|
|
17
|
+
import lt from "remark-gfm";
|
|
18
|
+
import ut from "remark-parse";
|
|
19
|
+
import { Block as dt, Streamdown as ft, TableCopyDropdown as pt, TableDownloadDropdown as mt, defaultRemarkPlugins as ht, detectTextDirection as gt, parseMarkdownIntoBlocks as _t } from "streamdown";
|
|
20
|
+
import { unified as vt } from "unified";
|
|
21
|
+
import { SKIP as yt, visit as bt } from "unist-util-visit";
|
|
22
|
+
import { TheButton as xt, useClock as St } from "@zukhruf/ui";
|
|
23
|
+
import { createPortal as Ct } from "react-dom";
|
|
24
|
+
import { Composer as R, PersistedPromptText as wt, useComposer as Tt, useComposerDictation as Et } from "@deepagents/react-input/browser";
|
|
25
|
+
import { get as Dt } from "lodash-es";
|
|
26
|
+
import { formatCompactNumber as Ot, formatNullableNumber as kt } from "@deepagents/react-formatters";
|
|
27
27
|
//#region src/lib/chat/prefill.ts
|
|
28
|
-
var
|
|
29
|
-
function
|
|
28
|
+
var At = "pending-chat-prefill";
|
|
29
|
+
function jt() {
|
|
30
30
|
try {
|
|
31
|
-
let e = sessionStorage.getItem(
|
|
31
|
+
let e = sessionStorage.getItem(At);
|
|
32
32
|
return e ? JSON.parse(e) : null;
|
|
33
33
|
} catch {
|
|
34
|
-
return sessionStorage.removeItem(
|
|
34
|
+
return sessionStorage.removeItem(At), null;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
sessionStorage.setItem(
|
|
37
|
+
function Mt(e) {
|
|
38
|
+
sessionStorage.setItem(At, JSON.stringify(e));
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
sessionStorage.removeItem(
|
|
40
|
+
function Nt() {
|
|
41
|
+
sessionStorage.removeItem(At);
|
|
42
42
|
}
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/lib/chat/chat-manager.ts
|
|
45
|
-
function
|
|
45
|
+
function Pt(e) {
|
|
46
46
|
let t = D(e.metadata) ? e.metadata.persistedPrompt : void 0;
|
|
47
47
|
if (typeof t != "string") throw Error(`Message ${e.id} has no persistedPrompt: send it with useAgent().submit.`);
|
|
48
48
|
return t;
|
|
49
49
|
}
|
|
50
|
-
var
|
|
50
|
+
var Ft = class {
|
|
51
51
|
chat;
|
|
52
52
|
uploadFile;
|
|
53
53
|
submissions = new v();
|
|
@@ -59,7 +59,10 @@ var kt = class {
|
|
|
59
59
|
this.chat = e;
|
|
60
60
|
}
|
|
61
61
|
initialize(e) {
|
|
62
|
-
|
|
62
|
+
let t = new AbortController();
|
|
63
|
+
return queueMicrotask(() => {
|
|
64
|
+
t.signal.aborted || this.consumePrefill(e);
|
|
65
|
+
}), () => t.abort();
|
|
63
66
|
}
|
|
64
67
|
submit(e) {
|
|
65
68
|
this.chat.clearError();
|
|
@@ -110,14 +113,14 @@ var kt = class {
|
|
|
110
113
|
}
|
|
111
114
|
resetChat(e) {
|
|
112
115
|
let t = crypto.randomUUID();
|
|
113
|
-
e &&
|
|
116
|
+
e && Mt({
|
|
114
117
|
prompt: e,
|
|
115
118
|
targetChatId: t
|
|
116
119
|
}), this.onResetChat(t);
|
|
117
120
|
}
|
|
118
121
|
consumePrefill(e) {
|
|
119
|
-
let t =
|
|
120
|
-
!t || t.targetChatId !== e || (
|
|
122
|
+
let t = jt();
|
|
123
|
+
!t || t.targetChatId !== e || (Nt(), this.submit({
|
|
121
124
|
prompt: t.prompt,
|
|
122
125
|
persistedPrompt: t.prompt
|
|
123
126
|
}));
|
|
@@ -144,7 +147,7 @@ var kt = class {
|
|
|
144
147
|
};
|
|
145
148
|
//#endregion
|
|
146
149
|
//#region src/lib/chat/client-tool-output.ts
|
|
147
|
-
async function
|
|
150
|
+
async function It(e, t, n) {
|
|
148
151
|
let r = t?.[n.toolName];
|
|
149
152
|
n.toolName.startsWith("render") && r?.static === !1 && r.requiresUserInput !== !0 && await e.addToolOutput({
|
|
150
153
|
toolCallId: n.toolCallId,
|
|
@@ -155,7 +158,7 @@ async function At(e, t, n) {
|
|
|
155
158
|
}
|
|
156
159
|
//#endregion
|
|
157
160
|
//#region src/lib/chat/chat.tsx
|
|
158
|
-
function
|
|
161
|
+
function Lt(t) {
|
|
159
162
|
let n = e({
|
|
160
163
|
id: t.chatId,
|
|
161
164
|
messages: t.initialMessages,
|
|
@@ -165,22 +168,22 @@ function jt(t) {
|
|
|
165
168
|
resume: t.resume,
|
|
166
169
|
onData: t.onData,
|
|
167
170
|
onFinish: t.onFinish,
|
|
168
|
-
sendAutomaticallyWhen:
|
|
171
|
+
sendAutomaticallyWhen: Rt,
|
|
169
172
|
onToolCall(e) {
|
|
170
173
|
let { toolCall: r } = e;
|
|
171
|
-
|
|
174
|
+
It(n, t.registry, r);
|
|
172
175
|
}
|
|
173
176
|
});
|
|
174
177
|
return n;
|
|
175
178
|
}
|
|
176
|
-
function
|
|
179
|
+
function Rt(e) {
|
|
177
180
|
return E(e) || T(e);
|
|
178
181
|
}
|
|
179
|
-
function
|
|
182
|
+
function zt(e) {
|
|
180
183
|
let t = O(2), n;
|
|
181
|
-
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ M(
|
|
184
|
+
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ M(Bt, { ...e }), t[0] = e, t[1] = n), n;
|
|
182
185
|
}
|
|
183
|
-
function
|
|
186
|
+
function Bt(e) {
|
|
184
187
|
let t = O(13), n;
|
|
185
188
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = { initial: "smooth" }, t[0] = n) : n = t[0];
|
|
186
189
|
let { scrollRef: r, contentRef: i } = ie(n), { hasSubmitted: a } = V(), o;
|
|
@@ -203,7 +206,7 @@ function Pt(e) {
|
|
|
203
206
|
children: l
|
|
204
207
|
}), t[9] = r, t[10] = o, t[11] = l, t[12] = u) : u = t[12], u;
|
|
205
208
|
}
|
|
206
|
-
function
|
|
209
|
+
function Vt(e) {
|
|
207
210
|
let t = O(12), { hasSubmitted: n } = V(), r;
|
|
208
211
|
t[0] !== n || t[1] !== e.className ? (r = k(n ? k("bg-background sticky top-0 z-10 shrink-0 space-y-1 backdrop-blur-md", e.className) : "relative flex justify-center py-4"), t[0] = n, t[1] = e.className, t[2] = r) : r = t[2];
|
|
209
212
|
let i;
|
|
@@ -232,8 +235,8 @@ function Ft(e) {
|
|
|
232
235
|
children: s
|
|
233
236
|
}), t[9] = r, t[10] = s, t[11] = c) : c = t[11], c;
|
|
234
237
|
}
|
|
235
|
-
|
|
236
|
-
function
|
|
238
|
+
Vt.displayName = "AgentHeader.Root";
|
|
239
|
+
function Ht(e) {
|
|
237
240
|
let t = O(6), { hasSubmitted: n } = V(), r;
|
|
238
241
|
t[0] !== n || t[1] !== e.children || t[2] !== e.icon ? (r = !n && /* @__PURE__ */ M(A.div, {
|
|
239
242
|
exit: { opacity: 0 },
|
|
@@ -249,8 +252,8 @@ function It(e) {
|
|
|
249
252
|
children: r
|
|
250
253
|
}), t[4] = r, t[5] = i), i;
|
|
251
254
|
}
|
|
252
|
-
|
|
253
|
-
function
|
|
255
|
+
Ht.displayName = "AgentHeader.Hero";
|
|
256
|
+
function Ut(e) {
|
|
254
257
|
let t = O(2), n;
|
|
255
258
|
return t[0] === e.children ? n = t[1] : (n = /* @__PURE__ */ M(A.h2, {
|
|
256
259
|
layout: "position",
|
|
@@ -258,8 +261,8 @@ function Lt(e) {
|
|
|
258
261
|
children: e.children
|
|
259
262
|
}), t[0] = e.children, t[1] = n), n;
|
|
260
263
|
}
|
|
261
|
-
|
|
262
|
-
function
|
|
264
|
+
Ut.displayName = "AgentHeader.Title";
|
|
265
|
+
function Wt(e) {
|
|
263
266
|
let t = O(5), { hasSubmitted: n } = V(), r;
|
|
264
267
|
t[0] !== n || t[1] !== e.children ? (r = n && !!e.children && /* @__PURE__ */ M(A.p, {
|
|
265
268
|
initial: { opacity: 0 },
|
|
@@ -271,15 +274,15 @@ function Rt(e) {
|
|
|
271
274
|
let i;
|
|
272
275
|
return t[3] === r ? i = t[4] : (i = /* @__PURE__ */ M(te, { children: r }), t[3] = r, t[4] = i), i;
|
|
273
276
|
}
|
|
274
|
-
|
|
275
|
-
var
|
|
276
|
-
Root:
|
|
277
|
-
Hero:
|
|
278
|
-
Title:
|
|
279
|
-
Description:
|
|
280
|
-
},
|
|
281
|
-
function
|
|
282
|
-
let p =
|
|
277
|
+
Wt.displayName = "AgentHeader.Description";
|
|
278
|
+
var Gt = {
|
|
279
|
+
Root: Vt,
|
|
280
|
+
Hero: Ht,
|
|
281
|
+
Title: Ut,
|
|
282
|
+
Description: Wt
|
|
283
|
+
}, Kt = o(void 0), qt = o("ready"), Jt = o(void 0), Yt = o(null), Xt = o(void 0);
|
|
284
|
+
function Zt({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry: i, initialMessages: a, transport: o, resume: s, onData: c, onFinish: l, onResetChat: f }) {
|
|
285
|
+
let p = Lt({
|
|
283
286
|
chatId: e,
|
|
284
287
|
transport: o,
|
|
285
288
|
registry: i,
|
|
@@ -293,14 +296,12 @@ function Gt({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry
|
|
|
293
296
|
}, [f]);
|
|
294
297
|
let x = u((e) => {
|
|
295
298
|
b.current(e);
|
|
296
|
-
}, []), [S] = g(() => new
|
|
299
|
+
}, []), [S] = g(() => new Ft({
|
|
297
300
|
chat: p,
|
|
298
301
|
uploadFile: o.uploadFile.bind(o),
|
|
299
302
|
onResetChat: x
|
|
300
303
|
}));
|
|
301
|
-
S.bind(p), d(() =>
|
|
302
|
-
S.initialize(e);
|
|
303
|
-
}, [S, e]);
|
|
304
|
+
S.bind(p), d(() => S.initialize(e), [S, e]);
|
|
304
305
|
let C = m(() => ({
|
|
305
306
|
clearChat: () => S.clearChat(),
|
|
306
307
|
resetChat: (e) => S.resetChat(e),
|
|
@@ -328,15 +329,15 @@ function Gt({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry
|
|
|
328
329
|
p.error,
|
|
329
330
|
p.experimental_queuedMessages
|
|
330
331
|
]), E = !!n || p.messages.length > 0, D = m(() => ({ hasSubmitted: E }), [E]);
|
|
331
|
-
return /* @__PURE__ */ M(
|
|
332
|
+
return /* @__PURE__ */ M(Yt, {
|
|
332
333
|
value: S,
|
|
333
|
-
children: /* @__PURE__ */ M(
|
|
334
|
+
children: /* @__PURE__ */ M(Kt, {
|
|
334
335
|
value: w,
|
|
335
|
-
children: /* @__PURE__ */ M(
|
|
336
|
+
children: /* @__PURE__ */ M(qt, {
|
|
336
337
|
value: p.status,
|
|
337
|
-
children: /* @__PURE__ */ M(
|
|
338
|
+
children: /* @__PURE__ */ M(Jt, {
|
|
338
339
|
value: T,
|
|
339
|
-
children: /* @__PURE__ */ M(
|
|
340
|
+
children: /* @__PURE__ */ M(Xt, {
|
|
340
341
|
value: D,
|
|
341
342
|
children: t
|
|
342
343
|
})
|
|
@@ -346,45 +347,53 @@ function Gt({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry
|
|
|
346
347
|
});
|
|
347
348
|
}
|
|
348
349
|
function z() {
|
|
349
|
-
let e = l(
|
|
350
|
+
let e = l(Kt);
|
|
350
351
|
if (e === void 0) throw Error("useAgent must be used within an AgentProvider");
|
|
351
352
|
return e;
|
|
352
353
|
}
|
|
353
354
|
function B() {
|
|
354
|
-
return { status: l(
|
|
355
|
+
return { status: l(qt) };
|
|
355
356
|
}
|
|
356
357
|
function V() {
|
|
357
|
-
let e = l(
|
|
358
|
+
let e = l(Xt);
|
|
358
359
|
if (e === void 0) throw Error("useAgentMeta must be used within an AgentProvider");
|
|
359
360
|
return e;
|
|
360
361
|
}
|
|
361
362
|
function H() {
|
|
362
|
-
let e = l(
|
|
363
|
+
let e = l(Jt);
|
|
363
364
|
if (e === void 0) throw Error("useAgentMessages must be used within an AgentProvider");
|
|
364
365
|
return e;
|
|
365
366
|
}
|
|
366
|
-
function
|
|
367
|
-
let e = l(
|
|
367
|
+
function Qt() {
|
|
368
|
+
let e = l(Yt);
|
|
368
369
|
if (!e) throw Error("useChatManager must be used within an AgentProvider");
|
|
369
370
|
return e;
|
|
370
371
|
}
|
|
371
372
|
//#endregion
|
|
372
373
|
//#region src/lib/chat/citations.ts
|
|
373
|
-
function
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
374
|
+
function $t(e) {
|
|
375
|
+
return (e ?? []).filter((e) => e.source.sourceType === "url");
|
|
376
|
+
}
|
|
377
|
+
function en(e) {
|
|
378
|
+
let t = /* @__PURE__ */ new Set(), n = [], r = (e, r) => {
|
|
379
|
+
t.has(e) || (t.add(e), n.push({
|
|
380
|
+
url: e,
|
|
381
|
+
title: r
|
|
382
|
+
}));
|
|
383
|
+
};
|
|
384
|
+
for (let t of e) for (let e of t.parts) {
|
|
385
|
+
if (e.type === "text") for (let { source: t } of $t(e.citations)) r(t.url, t.title);
|
|
386
|
+
e.type === "source-url" && r(e.url, e.title);
|
|
387
|
+
}
|
|
379
388
|
return n;
|
|
380
389
|
}
|
|
381
|
-
function
|
|
390
|
+
function tn(e, t) {
|
|
382
391
|
let n = e.findIndex((e) => e.url === t);
|
|
383
392
|
return n === -1 ? null : n + 1;
|
|
384
393
|
}
|
|
385
394
|
//#endregion
|
|
386
395
|
//#region src/lib/chat/read-only-transport.ts
|
|
387
|
-
var
|
|
396
|
+
var nn = class {
|
|
388
397
|
sendMessages() {
|
|
389
398
|
return Promise.reject(/* @__PURE__ */ Error("This chat is read-only: it has no transport to send messages through."));
|
|
390
399
|
}
|
|
@@ -394,19 +403,19 @@ var Yt = class {
|
|
|
394
403
|
};
|
|
395
404
|
//#endregion
|
|
396
405
|
//#region src/lib/chat/tool-abort.ts
|
|
397
|
-
function
|
|
406
|
+
function rn(e, t) {
|
|
398
407
|
return t === "streaming" || t === "submitted" ? !1 : e === "input-streaming" || e === "input-available";
|
|
399
408
|
}
|
|
400
|
-
function
|
|
401
|
-
return
|
|
409
|
+
function an(e, t) {
|
|
410
|
+
return rn(e.state, t);
|
|
402
411
|
}
|
|
403
|
-
function
|
|
412
|
+
function on(e) {
|
|
404
413
|
let t = O(3), { status: n } = B(), r;
|
|
405
|
-
return t[0] !== e || t[1] !== n ? (r =
|
|
414
|
+
return t[0] !== e || t[1] !== n ? (r = an(e, n), t[0] = e, t[1] = n, t[2] = r) : r = t[2], r;
|
|
406
415
|
}
|
|
407
416
|
//#endregion
|
|
408
417
|
//#region src/lib/chat/tools-schema.ts
|
|
409
|
-
function
|
|
418
|
+
function sn(e) {
|
|
410
419
|
return Object.entries(e).reduce((e, [t, n]) => (n.static || (e[t] = {
|
|
411
420
|
inputSchema: P.toJSONSchema(n.inputSchema, {
|
|
412
421
|
io: "input",
|
|
@@ -431,31 +440,31 @@ function U(e) {
|
|
|
431
440
|
}
|
|
432
441
|
//#endregion
|
|
433
442
|
//#region src/lib/chat/trajectory/compact-disclosure.tsx
|
|
434
|
-
function
|
|
443
|
+
function cn(e) {
|
|
435
444
|
let t = O(4), { className: n } = e, r;
|
|
436
445
|
t[0] === n ? r = t[1] : (r = k("size-3.5 shrink-0 transition-transform group-data-[panel-open]:rotate-90", n), t[0] = n, t[1] = r);
|
|
437
446
|
let i;
|
|
438
|
-
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ M(
|
|
447
|
+
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ M(Ue, {
|
|
439
448
|
"aria-hidden": !0,
|
|
440
449
|
className: r
|
|
441
450
|
}), t[2] = r, t[3] = i), i;
|
|
442
451
|
}
|
|
443
|
-
function
|
|
452
|
+
function ln(e) {
|
|
444
453
|
return k("group hover:bg-muted/30 flex min-h-7 w-full gap-2 rounded-sm py-1 text-left transition-colors", e);
|
|
445
454
|
}
|
|
446
455
|
//#endregion
|
|
447
456
|
//#region src/lib/chat/trajectory/IndexProgressSegment.tsx
|
|
448
|
-
var
|
|
457
|
+
var un = "data-text2sql-index-progress", dn = {
|
|
449
458
|
initial: "instant",
|
|
450
459
|
resize: "instant"
|
|
451
460
|
};
|
|
452
|
-
function
|
|
453
|
-
return e.type ===
|
|
461
|
+
function fn(e) {
|
|
462
|
+
return e.type === un;
|
|
454
463
|
}
|
|
455
|
-
function
|
|
456
|
-
return e.parts.filter(
|
|
464
|
+
function pn(e) {
|
|
465
|
+
return e.parts.filter(fn).map((e) => e.data);
|
|
457
466
|
}
|
|
458
|
-
function
|
|
467
|
+
function mn(e) {
|
|
459
468
|
let t = /* @__PURE__ */ new Map(), n = "running", r, i, a = (e, n) => {
|
|
460
469
|
let r = t.get(e) ?? {
|
|
461
470
|
name: e,
|
|
@@ -517,11 +526,11 @@ function sn(e) {
|
|
|
517
526
|
errorMessage: i
|
|
518
527
|
};
|
|
519
528
|
}
|
|
520
|
-
function
|
|
529
|
+
function hn(e) {
|
|
521
530
|
let t = O(2), n;
|
|
522
|
-
return t[0] === e ? n = t[1] : (n =
|
|
531
|
+
return t[0] === e ? n = t[1] : (n = mn(e), t[0] = e, t[1] = n), n;
|
|
523
532
|
}
|
|
524
|
-
function
|
|
533
|
+
function gn(e) {
|
|
525
534
|
let t = O(7), { status: n, resetKey: r, controlledOpen: i, onOpenChange: a } = e, o = `${r}:${n}`, [s, c] = g(null), l = i ?? (s?.key === o ? s.open : n === "running"), u;
|
|
526
535
|
t[0] !== i || t[1] !== o || t[2] !== a ? (u = (e) => {
|
|
527
536
|
i === void 0 && c({
|
|
@@ -535,20 +544,20 @@ function ln(e) {
|
|
|
535
544
|
handleOpenChange: d
|
|
536
545
|
}, t[4] = d, t[5] = l, t[6] = f) : f = t[6], f;
|
|
537
546
|
}
|
|
538
|
-
function
|
|
547
|
+
function _n(e, t) {
|
|
539
548
|
return e.length === 0 ? !0 : t.status !== "complete" || t.adapters.length === 0 ? !1 : t.adapters.every((e) => e.status === "cache-hit");
|
|
540
549
|
}
|
|
541
|
-
function
|
|
550
|
+
function vn(e) {
|
|
542
551
|
return e.filter((e) => e.type === "index:start").length;
|
|
543
552
|
}
|
|
544
|
-
function
|
|
553
|
+
function yn(e) {
|
|
545
554
|
return e.filter((e) => [
|
|
546
555
|
"adapter:start",
|
|
547
556
|
"adapter:cache-hit",
|
|
548
557
|
"adapter:cache-miss"
|
|
549
558
|
].includes(e.type)).length;
|
|
550
559
|
}
|
|
551
|
-
function
|
|
560
|
+
function bn(e) {
|
|
552
561
|
let t = (e.totalAdapters ?? e.adapters.length) > 1;
|
|
553
562
|
if (e.status === "error") {
|
|
554
563
|
let n = e.adapters.find((e) => e.status === "error");
|
|
@@ -564,7 +573,7 @@ function pn(e) {
|
|
|
564
573
|
}
|
|
565
574
|
return e.adapters.length === 0 || !t ? ["Schema indexed"] : ["Schema indexed", `${e.adapters.length} adapters`];
|
|
566
575
|
}
|
|
567
|
-
function
|
|
576
|
+
function xn(e) {
|
|
568
577
|
if (e.status === "error") return [
|
|
569
578
|
"Failed",
|
|
570
579
|
e.name,
|
|
@@ -588,18 +597,18 @@ function mn(e) {
|
|
|
588
597
|
"queued"
|
|
589
598
|
];
|
|
590
599
|
}
|
|
591
|
-
function
|
|
600
|
+
function Sn(e) {
|
|
592
601
|
return ["Failed", e.errorMessage ?? "unknown error"];
|
|
593
602
|
}
|
|
594
|
-
var
|
|
595
|
-
function
|
|
596
|
-
let t = l(
|
|
603
|
+
var Cn = o(null);
|
|
604
|
+
function wn(e) {
|
|
605
|
+
let t = l(Cn);
|
|
597
606
|
if (!t) throw Error(`<IndexProgress.${e}> must be used inside <IndexProgress.Root>`);
|
|
598
607
|
return t;
|
|
599
608
|
}
|
|
600
|
-
function
|
|
601
|
-
let t = O(21), { events: n, open: r, onOpenChange: i, children: a, className: o } = e, s =
|
|
602
|
-
t[0] === n ? l = t[1] : (l =
|
|
609
|
+
function Tn(e) {
|
|
610
|
+
let t = O(21), { events: n, open: r, onOpenChange: i, children: a, className: o } = e, s = hn(n), c = s.status, l;
|
|
611
|
+
t[0] === n ? l = t[1] : (l = vn(n), t[0] = n, t[1] = l);
|
|
603
612
|
let u;
|
|
604
613
|
t[2] !== r || t[3] !== i || t[4] !== s.status || t[5] !== l ? (u = {
|
|
605
614
|
status: c,
|
|
@@ -607,8 +616,8 @@ function vn(e) {
|
|
|
607
616
|
controlledOpen: r,
|
|
608
617
|
onOpenChange: i
|
|
609
618
|
}, t[2] = r, t[3] = i, t[4] = s.status, t[5] = l, t[6] = u) : u = t[6];
|
|
610
|
-
let { isOpen: d, handleOpenChange: f } =
|
|
611
|
-
if (
|
|
619
|
+
let { isOpen: d, handleOpenChange: f } = gn(u);
|
|
620
|
+
if (_n(n, s)) return null;
|
|
612
621
|
let p;
|
|
613
622
|
t[7] !== n || t[8] !== s ? (p = {
|
|
614
623
|
state: s,
|
|
@@ -626,14 +635,14 @@ function vn(e) {
|
|
|
626
635
|
children: a
|
|
627
636
|
}), t[12] = a, t[13] = f, t[14] = d, t[15] = s.status, t[16] = h, t[17] = g) : g = t[17];
|
|
628
637
|
let _;
|
|
629
|
-
return t[18] !== p || t[19] !== g ? (_ = /* @__PURE__ */ M(
|
|
638
|
+
return t[18] !== p || t[19] !== g ? (_ = /* @__PURE__ */ M(Cn, {
|
|
630
639
|
value: p,
|
|
631
640
|
children: g
|
|
632
641
|
}), t[18] = p, t[19] = g, t[20] = _) : _ = t[20], _;
|
|
633
642
|
}
|
|
634
|
-
function
|
|
635
|
-
let t = O(13), { className: n } = e, { state: r } =
|
|
636
|
-
t[0] === n ? i = t[1] : (i =
|
|
643
|
+
function En(e) {
|
|
644
|
+
let t = O(13), { className: n } = e, { state: r } = wn("Trigger"), i;
|
|
645
|
+
t[0] === n ? i = t[1] : (i = Dn(n), t[0] = n, t[1] = i);
|
|
637
646
|
let a;
|
|
638
647
|
t[2] === i ? a = t[3] : (a = /* @__PURE__ */ M("button", {
|
|
639
648
|
type: "button",
|
|
@@ -641,28 +650,28 @@ function yn(e) {
|
|
|
641
650
|
className: i
|
|
642
651
|
}), t[2] = i, t[3] = a);
|
|
643
652
|
let o;
|
|
644
|
-
t[4] === r ? o = t[5] : (o =
|
|
653
|
+
t[4] === r ? o = t[5] : (o = bn(r), t[4] = r, t[5] = o);
|
|
645
654
|
let s = r.status === "running", c;
|
|
646
|
-
t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ M(
|
|
655
|
+
t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ M(On, {
|
|
647
656
|
segments: o,
|
|
648
657
|
isRunning: s
|
|
649
658
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8];
|
|
650
659
|
let l;
|
|
651
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ M(
|
|
660
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ M(An, {}), t[9] = l) : l = t[9];
|
|
652
661
|
let u;
|
|
653
662
|
return t[10] !== a || t[11] !== c ? (u = /* @__PURE__ */ N(L, {
|
|
654
663
|
render: a,
|
|
655
664
|
children: [c, l]
|
|
656
665
|
}), t[10] = a, t[11] = c, t[12] = u) : u = t[12], u;
|
|
657
666
|
}
|
|
658
|
-
function
|
|
659
|
-
return
|
|
667
|
+
function Dn(e) {
|
|
668
|
+
return ln(k("items-baseline px-1", e));
|
|
660
669
|
}
|
|
661
|
-
function
|
|
670
|
+
function On(e) {
|
|
662
671
|
let t = O(8), { segments: n, isRunning: r } = e, i = n.length - 1, a;
|
|
663
672
|
if (t[0] !== i || t[1] !== n) {
|
|
664
673
|
let e;
|
|
665
|
-
t[3] === i ? e = t[4] : (e = (e, t) => /* @__PURE__ */ M(
|
|
674
|
+
t[3] === i ? e = t[4] : (e = (e, t) => /* @__PURE__ */ M(kn, {
|
|
666
675
|
segment: e,
|
|
667
676
|
index: t,
|
|
668
677
|
isLast: t === i
|
|
@@ -676,7 +685,7 @@ function xn(e) {
|
|
|
676
685
|
children: a
|
|
677
686
|
}), t[5] = r, t[6] = a, t[7] = o) : o = t[7], o;
|
|
678
687
|
}
|
|
679
|
-
function
|
|
688
|
+
function kn(e) {
|
|
680
689
|
let t = O(11), { segment: n, index: r, isLast: i } = e, o;
|
|
681
690
|
t[0] === r ? o = t[1] : (o = r > 0 && /* @__PURE__ */ M("span", {
|
|
682
691
|
"aria-hidden": !0,
|
|
@@ -693,11 +702,11 @@ function Sn(e) {
|
|
|
693
702
|
let d;
|
|
694
703
|
return t[8] !== o || t[9] !== u ? (d = /* @__PURE__ */ N(a, { children: [o, u] }), t[8] = o, t[9] = u, t[10] = d) : d = t[10], d;
|
|
695
704
|
}
|
|
696
|
-
function
|
|
705
|
+
function An() {
|
|
697
706
|
let e = O(1), t;
|
|
698
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
707
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(cn, { className: "text-muted-foreground/60 size-3" }), e[0] = t) : t = e[0], t;
|
|
699
708
|
}
|
|
700
|
-
function
|
|
709
|
+
function jn(e) {
|
|
701
710
|
let t = O(3), { className: n, children: r } = e, i;
|
|
702
711
|
return t[0] !== r || t[1] !== n ? (i = /* @__PURE__ */ M(I, {
|
|
703
712
|
"data-slot": "index-progress-content",
|
|
@@ -705,7 +714,7 @@ function wn(e) {
|
|
|
705
714
|
children: r
|
|
706
715
|
}), t[0] = r, t[1] = n, t[2] = i) : i = t[2], i;
|
|
707
716
|
}
|
|
708
|
-
function
|
|
717
|
+
function Mn(e) {
|
|
709
718
|
let t = O(11), { event: n } = e, r;
|
|
710
719
|
t[0] === n.type ? r = t[1] : (r = /* @__PURE__ */ M("span", {
|
|
711
720
|
className: "text-muted-foreground/50 w-40 shrink-0 truncate",
|
|
@@ -735,7 +744,7 @@ function Tn(e) {
|
|
|
735
744
|
]
|
|
736
745
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o) : o = t[10], o;
|
|
737
746
|
}
|
|
738
|
-
function
|
|
747
|
+
function Nn(e) {
|
|
739
748
|
let t = O(2), n;
|
|
740
749
|
if (t[0] !== e) {
|
|
741
750
|
let r = /* @__PURE__ */ new Map(), i = [];
|
|
@@ -750,25 +759,25 @@ function En(e) {
|
|
|
750
759
|
} else n = t[1];
|
|
751
760
|
return n;
|
|
752
761
|
}
|
|
753
|
-
function
|
|
754
|
-
let t = O(8), { className: n } = e, { events: r } =
|
|
762
|
+
function Pn(e) {
|
|
763
|
+
let t = O(8), { className: n } = e, { events: r } = wn("EventLog"), i = Nn(r), a;
|
|
755
764
|
t[0] === n ? a = t[1] : (a = k("mt-2 ml-4 max-h-64 overflow-y-auto font-mono text-[11px]", n), t[0] = n, t[1] = a);
|
|
756
765
|
let o = a;
|
|
757
766
|
if (i.byAdapter.size <= 1) {
|
|
758
767
|
let e;
|
|
759
|
-
return t[2] !== o || t[3] !== r ? (e = /* @__PURE__ */ M(
|
|
768
|
+
return t[2] !== o || t[3] !== r ? (e = /* @__PURE__ */ M(In, {
|
|
760
769
|
events: r,
|
|
761
770
|
className: o
|
|
762
771
|
}), t[2] = o, t[3] = r, t[4] = e) : e = t[4], e;
|
|
763
772
|
}
|
|
764
773
|
let s;
|
|
765
|
-
return t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ M(
|
|
774
|
+
return t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ M(Rn, {
|
|
766
775
|
groupedEvents: i,
|
|
767
776
|
className: o
|
|
768
777
|
}), t[5] = o, t[6] = i, t[7] = s) : s = t[7], s;
|
|
769
778
|
}
|
|
770
|
-
function
|
|
771
|
-
let t = O(8), { className: n, contentClassName: r, children: i } = e, { scrollRef: a, contentRef: o } = ie(
|
|
779
|
+
function Fn(e) {
|
|
780
|
+
let t = O(8), { className: n, contentClassName: r, children: i } = e, { scrollRef: a, contentRef: o } = ie(dn), s;
|
|
772
781
|
t[0] !== i || t[1] !== r || t[2] !== o ? (s = /* @__PURE__ */ M("div", {
|
|
773
782
|
ref: o,
|
|
774
783
|
"data-slot": "index-progress-event-log",
|
|
@@ -782,56 +791,56 @@ function On(e) {
|
|
|
782
791
|
children: s
|
|
783
792
|
}), t[4] = n, t[5] = a, t[6] = s, t[7] = c) : c = t[7], c;
|
|
784
793
|
}
|
|
785
|
-
function
|
|
794
|
+
function In(e) {
|
|
786
795
|
let t = O(7), { events: n, className: r } = e, i;
|
|
787
|
-
t[0] === n ? i = t[1] : (i = n.map(
|
|
796
|
+
t[0] === n ? i = t[1] : (i = n.map(Ln), t[0] = n, t[1] = i);
|
|
788
797
|
let a;
|
|
789
798
|
t[2] === i ? a = t[3] : (a = /* @__PURE__ */ M("ul", {
|
|
790
799
|
className: "space-y-0.5",
|
|
791
800
|
children: i
|
|
792
801
|
}), t[2] = i, t[3] = a);
|
|
793
802
|
let o;
|
|
794
|
-
return t[4] !== r || t[5] !== a ? (o = /* @__PURE__ */ M(
|
|
803
|
+
return t[4] !== r || t[5] !== a ? (o = /* @__PURE__ */ M(Fn, {
|
|
795
804
|
className: r,
|
|
796
805
|
children: a
|
|
797
806
|
}), t[4] = r, t[5] = a, t[6] = o) : o = t[6], o;
|
|
798
807
|
}
|
|
799
|
-
function
|
|
800
|
-
return /* @__PURE__ */ M(
|
|
808
|
+
function Ln(e, t) {
|
|
809
|
+
return /* @__PURE__ */ M(Mn, { event: e }, `${e.type}-${t}`);
|
|
801
810
|
}
|
|
802
|
-
function
|
|
811
|
+
function Rn(e) {
|
|
803
812
|
let t = O(8), { groupedEvents: n, className: r } = e, i;
|
|
804
813
|
t[0] === n.globalEvents ? i = t[1] : (i = n.globalEvents.length > 0 && /* @__PURE__ */ M("ul", {
|
|
805
814
|
className: "space-y-0.5",
|
|
806
|
-
children: n.globalEvents.map(
|
|
815
|
+
children: n.globalEvents.map(Bn)
|
|
807
816
|
}), t[0] = n.globalEvents, t[1] = i);
|
|
808
817
|
let a;
|
|
809
|
-
t[2] === n.byAdapter ? a = t[3] : (a = Array.from(n.byAdapter.entries()).map(
|
|
818
|
+
t[2] === n.byAdapter ? a = t[3] : (a = Array.from(n.byAdapter.entries()).map(zn), t[2] = n.byAdapter, t[3] = a);
|
|
810
819
|
let o;
|
|
811
|
-
return t[4] !== r || t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(
|
|
820
|
+
return t[4] !== r || t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(Fn, {
|
|
812
821
|
className: r,
|
|
813
822
|
contentClassName: "space-y-2",
|
|
814
823
|
children: [i, a]
|
|
815
824
|
}), t[4] = r, t[5] = i, t[6] = a, t[7] = o) : o = t[7], o;
|
|
816
825
|
}
|
|
817
|
-
function
|
|
826
|
+
function zn(e) {
|
|
818
827
|
let [t, n] = e;
|
|
819
|
-
return /* @__PURE__ */ M(
|
|
828
|
+
return /* @__PURE__ */ M(Vn, {
|
|
820
829
|
name: t,
|
|
821
830
|
events: n
|
|
822
831
|
}, t);
|
|
823
832
|
}
|
|
824
|
-
function
|
|
825
|
-
return /* @__PURE__ */ M(
|
|
833
|
+
function Bn(e, t) {
|
|
834
|
+
return /* @__PURE__ */ M(Mn, { event: e }, `${e.type}-${t}`);
|
|
826
835
|
}
|
|
827
|
-
function
|
|
836
|
+
function Vn(e) {
|
|
828
837
|
let t = O(9), { name: n, events: r } = e, i;
|
|
829
838
|
t[0] === n ? i = t[1] : (i = /* @__PURE__ */ M("div", {
|
|
830
839
|
className: "text-foreground/90",
|
|
831
840
|
children: n
|
|
832
841
|
}), t[0] = n, t[1] = i);
|
|
833
842
|
let a;
|
|
834
|
-
t[2] === r ? a = t[3] : (a = r.map(
|
|
843
|
+
t[2] === r ? a = t[3] : (a = r.map(Hn), t[2] = r, t[3] = a);
|
|
835
844
|
let o;
|
|
836
845
|
t[4] === a ? o = t[5] : (o = /* @__PURE__ */ M("ul", {
|
|
837
846
|
className: "space-y-0.5",
|
|
@@ -843,21 +852,21 @@ function Pn(e) {
|
|
|
843
852
|
children: [i, o]
|
|
844
853
|
}), t[6] = i, t[7] = o, t[8] = s) : s = t[8], s;
|
|
845
854
|
}
|
|
846
|
-
function
|
|
847
|
-
return /* @__PURE__ */ M(
|
|
855
|
+
function Hn(e, t) {
|
|
856
|
+
return /* @__PURE__ */ M(Mn, { event: e }, `${e.type}-${t}`);
|
|
848
857
|
}
|
|
849
|
-
function
|
|
850
|
-
let t = O(22), { events: n, className: r, showCacheHits: i } = e, a = i !== void 0 && i, o =
|
|
851
|
-
t[0] === s.globalEvents ? c = t[1] : (c = s.globalEvents.filter(
|
|
858
|
+
function Un(e) {
|
|
859
|
+
let t = O(22), { events: n, className: r, showCacheHits: i } = e, a = i !== void 0 && i, o = hn(n), s = Nn(n), c;
|
|
860
|
+
t[0] === s.globalEvents ? c = t[1] : (c = s.globalEvents.filter(Wn), t[0] = s.globalEvents, t[1] = c);
|
|
852
861
|
let l = c;
|
|
853
|
-
if (n.length === 0 || !a &&
|
|
862
|
+
if (n.length === 0 || !a && _n(n, o)) return null;
|
|
854
863
|
if (o.adapters.length === 0) {
|
|
855
864
|
let e;
|
|
856
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M(
|
|
865
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M(En, {}), t[2] = e) : e = t[2];
|
|
857
866
|
let i;
|
|
858
|
-
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M(
|
|
867
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M(jn, { children: /* @__PURE__ */ M(Pn, {}) }), t[3] = i) : i = t[3];
|
|
859
868
|
let a;
|
|
860
|
-
return t[4] !== r || t[5] !== n ? (a = /* @__PURE__ */ N(
|
|
869
|
+
return t[4] !== r || t[5] !== n ? (a = /* @__PURE__ */ N(Tn, {
|
|
861
870
|
events: n,
|
|
862
871
|
className: r,
|
|
863
872
|
children: [e, i]
|
|
@@ -868,13 +877,13 @@ function In(e) {
|
|
|
868
877
|
let f;
|
|
869
878
|
if (t[9] !== s.byAdapter || t[10] !== o.adapters) {
|
|
870
879
|
let e;
|
|
871
|
-
t[12] === s.byAdapter ? e = t[13] : (e = (e) => /* @__PURE__ */ M(
|
|
880
|
+
t[12] === s.byAdapter ? e = t[13] : (e = (e) => /* @__PURE__ */ M(Gn, {
|
|
872
881
|
adapter: e,
|
|
873
882
|
events: s.byAdapter.get(e.name) ?? []
|
|
874
883
|
}, e.name), t[12] = s.byAdapter, t[13] = e), f = o.adapters.map(e), t[9] = s.byAdapter, t[10] = o.adapters, t[11] = f;
|
|
875
884
|
} else f = t[11];
|
|
876
885
|
let p;
|
|
877
|
-
t[14] !== l || t[15] !== o ? (p = l.length > 0 && /* @__PURE__ */ M(
|
|
886
|
+
t[14] !== l || t[15] !== o ? (p = l.length > 0 && /* @__PURE__ */ M(qn, {
|
|
878
887
|
state: o,
|
|
879
888
|
events: l
|
|
880
889
|
}), t[14] = l, t[15] = o, t[16] = p) : p = t[16];
|
|
@@ -886,32 +895,32 @@ function In(e) {
|
|
|
886
895
|
children: [f, p]
|
|
887
896
|
}), t[17] = o.status, t[18] = d, t[19] = f, t[20] = p, t[21] = m) : m = t[21], m;
|
|
888
897
|
}
|
|
889
|
-
function
|
|
898
|
+
function Wn(e) {
|
|
890
899
|
return e.type === "index:error";
|
|
891
900
|
}
|
|
892
|
-
function
|
|
901
|
+
function Gn(e) {
|
|
893
902
|
let t = O(22), { adapter: n, events: r } = e, i = n.status, a;
|
|
894
|
-
t[0] === r ? a = t[1] : (a =
|
|
903
|
+
t[0] === r ? a = t[1] : (a = yn(r), t[0] = r, t[1] = a);
|
|
895
904
|
let o;
|
|
896
905
|
t[2] !== n.status || t[3] !== a ? (o = {
|
|
897
906
|
status: i,
|
|
898
907
|
resetKey: a
|
|
899
908
|
}, t[2] = n.status, t[3] = a, t[4] = o) : o = t[4];
|
|
900
|
-
let { isOpen: s, handleOpenChange: c } =
|
|
909
|
+
let { isOpen: s, handleOpenChange: c } = gn(o), l = n.status, u;
|
|
901
910
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ M("button", {
|
|
902
911
|
type: "button",
|
|
903
912
|
"data-slot": "index-progress-adapter-trigger",
|
|
904
|
-
className:
|
|
913
|
+
className: Dn()
|
|
905
914
|
}), t[5] = u) : u = t[5];
|
|
906
915
|
let d;
|
|
907
|
-
t[6] === n ? d = t[7] : (d =
|
|
916
|
+
t[6] === n ? d = t[7] : (d = xn(n), t[6] = n, t[7] = d);
|
|
908
917
|
let f = n.status === "running", p;
|
|
909
|
-
t[8] !== d || t[9] !== f ? (p = /* @__PURE__ */ M(
|
|
918
|
+
t[8] !== d || t[9] !== f ? (p = /* @__PURE__ */ M(On, {
|
|
910
919
|
segments: d,
|
|
911
920
|
isRunning: f
|
|
912
921
|
}), t[8] = d, t[9] = f, t[10] = p) : p = t[10];
|
|
913
922
|
let m;
|
|
914
|
-
t[11] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(
|
|
923
|
+
t[11] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(An, {}), t[11] = m) : m = t[11];
|
|
915
924
|
let h;
|
|
916
925
|
t[12] === p ? h = t[13] : (h = /* @__PURE__ */ N(L, {
|
|
917
926
|
render: u,
|
|
@@ -920,7 +929,7 @@ function Rn(e) {
|
|
|
920
929
|
let g;
|
|
921
930
|
t[14] === r ? g = t[15] : (g = /* @__PURE__ */ M(I, {
|
|
922
931
|
"data-slot": "index-progress-adapter-content",
|
|
923
|
-
children: /* @__PURE__ */ M(
|
|
932
|
+
children: /* @__PURE__ */ M(Kn, { events: r })
|
|
924
933
|
}), t[14] = r, t[15] = g);
|
|
925
934
|
let _;
|
|
926
935
|
return t[16] !== n.status || t[17] !== c || t[18] !== s || t[19] !== h || t[20] !== g ? (_ = /* @__PURE__ */ N(F, {
|
|
@@ -932,36 +941,36 @@ function Rn(e) {
|
|
|
932
941
|
children: [h, g]
|
|
933
942
|
}), t[16] = n.status, t[17] = c, t[18] = s, t[19] = h, t[20] = g, t[21] = _) : _ = t[21], _;
|
|
934
943
|
}
|
|
935
|
-
function
|
|
944
|
+
function Kn(e) {
|
|
936
945
|
let t = O(2), { events: n } = e;
|
|
937
946
|
if (n.length === 0) return null;
|
|
938
947
|
let r;
|
|
939
|
-
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M(
|
|
948
|
+
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M(In, {
|
|
940
949
|
events: n,
|
|
941
950
|
className: "mt-2 ml-4 max-h-64 overflow-y-auto font-mono text-[11px]"
|
|
942
951
|
}), t[0] = n, t[1] = r), r;
|
|
943
952
|
}
|
|
944
|
-
function
|
|
953
|
+
function qn(e) {
|
|
945
954
|
let t = O(20), { state: n, events: r } = e, i;
|
|
946
955
|
t[0] !== r.length || t[1] !== n.status ? (i = {
|
|
947
956
|
status: n.status,
|
|
948
957
|
resetKey: r.length
|
|
949
958
|
}, t[0] = r.length, t[1] = n.status, t[2] = i) : i = t[2];
|
|
950
|
-
let { isOpen: a, handleOpenChange: o } =
|
|
959
|
+
let { isOpen: a, handleOpenChange: o } = gn(i), s = n.status, c;
|
|
951
960
|
t[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ M("button", {
|
|
952
961
|
type: "button",
|
|
953
962
|
"data-slot": "index-progress-global-error-trigger",
|
|
954
|
-
className:
|
|
963
|
+
className: Dn()
|
|
955
964
|
}), t[3] = c) : c = t[3];
|
|
956
965
|
let l;
|
|
957
|
-
t[4] === n ? l = t[5] : (l =
|
|
966
|
+
t[4] === n ? l = t[5] : (l = Sn(n), t[4] = n, t[5] = l);
|
|
958
967
|
let u = n.status === "running", d;
|
|
959
|
-
t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ M(
|
|
968
|
+
t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ M(On, {
|
|
960
969
|
segments: l,
|
|
961
970
|
isRunning: u
|
|
962
971
|
}), t[6] = l, t[7] = u, t[8] = d) : d = t[8];
|
|
963
972
|
let f;
|
|
964
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(
|
|
973
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(An, {}), t[9] = f) : f = t[9];
|
|
965
974
|
let p;
|
|
966
975
|
t[10] === d ? p = t[11] : (p = /* @__PURE__ */ N(L, {
|
|
967
976
|
render: c,
|
|
@@ -970,7 +979,7 @@ function Bn(e) {
|
|
|
970
979
|
let m;
|
|
971
980
|
t[12] === r ? m = t[13] : (m = /* @__PURE__ */ M(I, {
|
|
972
981
|
"data-slot": "index-progress-global-error-content",
|
|
973
|
-
children: /* @__PURE__ */ M(
|
|
982
|
+
children: /* @__PURE__ */ M(Kn, { events: r })
|
|
974
983
|
}), t[12] = r, t[13] = m);
|
|
975
984
|
let h;
|
|
976
985
|
return t[14] !== o || t[15] !== a || t[16] !== n.status || t[17] !== p || t[18] !== m ? (h = /* @__PURE__ */ N(F, {
|
|
@@ -982,46 +991,66 @@ function Bn(e) {
|
|
|
982
991
|
children: [p, m]
|
|
983
992
|
}), t[14] = o, t[15] = a, t[16] = n.status, t[17] = p, t[18] = m, t[19] = h) : h = t[19], h;
|
|
984
993
|
}
|
|
985
|
-
var
|
|
986
|
-
Root:
|
|
987
|
-
Trigger:
|
|
988
|
-
Content:
|
|
989
|
-
EventLog:
|
|
990
|
-
PerAdapter:
|
|
991
|
-
},
|
|
994
|
+
var Jn = {
|
|
995
|
+
Root: Tn,
|
|
996
|
+
Trigger: En,
|
|
997
|
+
Content: jn,
|
|
998
|
+
EventLog: Pn,
|
|
999
|
+
PerAdapter: Un
|
|
1000
|
+
}, Yn = o(void 0), Xn = o(void 0);
|
|
992
1001
|
function W() {
|
|
993
|
-
let e = l(
|
|
1002
|
+
let e = l(Yn);
|
|
994
1003
|
if (!e) throw Error("useMessagesContext must be used within <Messages>");
|
|
995
1004
|
return e;
|
|
996
1005
|
}
|
|
997
1006
|
function G() {
|
|
998
|
-
let e = l(
|
|
1007
|
+
let e = l(Yn), { status: t } = B();
|
|
999
1008
|
return e?.status ?? t;
|
|
1000
1009
|
}
|
|
1001
1010
|
function K() {
|
|
1002
|
-
let e = l(
|
|
1011
|
+
let e = l(Xn);
|
|
1003
1012
|
if (!e) throw Error("useMessageItem must be used within <Messages.Item>");
|
|
1004
1013
|
return e;
|
|
1005
1014
|
}
|
|
1006
1015
|
//#endregion
|
|
1007
1016
|
//#region src/lib/components/CitationPill.tsx
|
|
1008
|
-
function
|
|
1009
|
-
|
|
1010
|
-
|
|
1017
|
+
function Zn({ source: e, index: t, labels: n = {
|
|
1018
|
+
source: `Source ${t}`,
|
|
1019
|
+
open: "Open the source"
|
|
1020
|
+
}, children: r }) {
|
|
1021
|
+
let i = URL.parse(e.url)?.hostname ?? e.url;
|
|
1022
|
+
return /* @__PURE__ */ M("sup", {
|
|
1011
1023
|
className: "ml-0.5 inline-block",
|
|
1012
|
-
children: /* @__PURE__ */ M(
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1024
|
+
children: /* @__PURE__ */ N(De, { children: [/* @__PURE__ */ M(Me, {
|
|
1025
|
+
openOnHover: !0,
|
|
1026
|
+
"aria-label": n.source,
|
|
1027
|
+
className: "text-primary bg-primary/10 hover:bg-primary/20 focus-visible:ring-ring focus-visible:ring-offset-background inline-block rounded px-1 font-mono text-[10px] leading-tight transition-colors focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:outline-none",
|
|
1028
|
+
children: t
|
|
1029
|
+
}), /* @__PURE__ */ N(Oe, {
|
|
1030
|
+
className: "w-72 gap-2 text-sm",
|
|
1031
|
+
children: [
|
|
1032
|
+
/* @__PURE__ */ N(Ae, { children: [/* @__PURE__ */ M(je, {
|
|
1033
|
+
dir: "auto",
|
|
1034
|
+
children: e.title ?? i
|
|
1035
|
+
}), e.title ? /* @__PURE__ */ M(ke, {
|
|
1036
|
+
dir: "auto",
|
|
1037
|
+
children: i
|
|
1038
|
+
}) : null] }),
|
|
1039
|
+
r,
|
|
1040
|
+
/* @__PURE__ */ M("a", {
|
|
1041
|
+
href: e.url,
|
|
1042
|
+
target: "_blank",
|
|
1043
|
+
rel: "noopener noreferrer",
|
|
1044
|
+
className: "text-primary underline",
|
|
1045
|
+
children: n.open
|
|
1046
|
+
})
|
|
1047
|
+
]
|
|
1048
|
+
})] })
|
|
1049
|
+
});
|
|
1021
1050
|
}
|
|
1022
1051
|
//#endregion
|
|
1023
1052
|
//#region src/lib/ui/TablePanel.tsx
|
|
1024
|
-
function
|
|
1053
|
+
function Qn(e) {
|
|
1025
1054
|
let t = O(10), n, r, i;
|
|
1026
1055
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({ref: i, className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
1027
1056
|
let a;
|
|
@@ -1035,8 +1064,8 @@ function Gn(e) {
|
|
|
1035
1064
|
...r
|
|
1036
1065
|
}), t[6] = r, t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
1037
1066
|
}
|
|
1038
|
-
|
|
1039
|
-
function
|
|
1067
|
+
Qn.displayName = "TablePanel.Root";
|
|
1068
|
+
function $n(e) {
|
|
1040
1069
|
let t = O(8), n, r;
|
|
1041
1070
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1042
1071
|
let i;
|
|
@@ -1048,7 +1077,7 @@ function Kn(e) {
|
|
|
1048
1077
|
...r
|
|
1049
1078
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1050
1079
|
}
|
|
1051
|
-
function
|
|
1080
|
+
function er(e) {
|
|
1052
1081
|
let t = O(8), n, r;
|
|
1053
1082
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1054
1083
|
let i;
|
|
@@ -1060,7 +1089,7 @@ function qn(e) {
|
|
|
1060
1089
|
...r
|
|
1061
1090
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1062
1091
|
}
|
|
1063
|
-
function
|
|
1092
|
+
function tr(e) {
|
|
1064
1093
|
let t = O(8), n, r;
|
|
1065
1094
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1066
1095
|
let i;
|
|
@@ -1072,7 +1101,7 @@ function Jn(e) {
|
|
|
1072
1101
|
...r
|
|
1073
1102
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1074
1103
|
}
|
|
1075
|
-
function
|
|
1104
|
+
function nr(e) {
|
|
1076
1105
|
let t = O(8), n, r;
|
|
1077
1106
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1078
1107
|
let i;
|
|
@@ -1084,7 +1113,7 @@ function Yn(e) {
|
|
|
1084
1113
|
...r
|
|
1085
1114
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1086
1115
|
}
|
|
1087
|
-
function
|
|
1116
|
+
function rr(e) {
|
|
1088
1117
|
let t = O(8), n, r;
|
|
1089
1118
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1090
1119
|
let i;
|
|
@@ -1096,7 +1125,7 @@ function Xn(e) {
|
|
|
1096
1125
|
...r
|
|
1097
1126
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1098
1127
|
}
|
|
1099
|
-
function
|
|
1128
|
+
function ir(e) {
|
|
1100
1129
|
let t = O(8), n, r;
|
|
1101
1130
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1102
1131
|
let i;
|
|
@@ -1108,66 +1137,77 @@ function Zn(e) {
|
|
|
1108
1137
|
...r
|
|
1109
1138
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1110
1139
|
}
|
|
1111
|
-
var q = Object.assign(
|
|
1112
|
-
Header:
|
|
1113
|
-
Heading:
|
|
1114
|
-
Title:
|
|
1115
|
-
Description:
|
|
1116
|
-
Actions:
|
|
1117
|
-
Content:
|
|
1118
|
-
}),
|
|
1119
|
-
function
|
|
1120
|
-
return e.replace(
|
|
1140
|
+
var q = Object.assign(Qn, {
|
|
1141
|
+
Header: $n,
|
|
1142
|
+
Heading: er,
|
|
1143
|
+
Title: tr,
|
|
1144
|
+
Description: nr,
|
|
1145
|
+
Actions: rr,
|
|
1146
|
+
Content: ir
|
|
1147
|
+
}), ar = /<\w[\w-]*(?:"(?:\\.|[^"])*"|[^>"])*>/g, or = /\b([\w-]+)="((?:\\.|[^"])*)"/g;
|
|
1148
|
+
function sr(e) {
|
|
1149
|
+
return e.replace(ar, (e) => e.replace(or, (e, t, n) => `${t}="${n.replace(/\\"/g, """)}"`));
|
|
1121
1150
|
}
|
|
1122
|
-
function
|
|
1151
|
+
function cr(e, t) {
|
|
1123
1152
|
if (typeof e != "string") return e;
|
|
1124
|
-
let n =
|
|
1125
|
-
return n = n.replace(/\/>(\s*)</g, (e, t, n, r) => !t.includes("\n") &&
|
|
1153
|
+
let n = sr(hr(e, dr(t))).replace(/<(\w[\w-]*)((?:\s+[\w-]+="[^"]*")+)\s*(\/?>)/g, (e, t, n, r) => `<${t}${n.replace(/\s+/g, " ").replace(/"([^"]*)"/g, (e, t) => `"${t.replace(/\*/g, "*")}"`)}${r}`);
|
|
1154
|
+
return n = n.replace(/\/>(\s*)</g, (e, t, n, r) => !t.includes("\n") && ur(r, n) ? e : "/>\n\n<"), gr(n, t);
|
|
1126
1155
|
}
|
|
1127
|
-
var
|
|
1128
|
-
function
|
|
1156
|
+
var lr = /<\w[\w-]*(?:"(?:\\.|[^"])*"|[^>"])*>|<\/[\w-]+\s*>/g;
|
|
1157
|
+
function ur(e, t) {
|
|
1129
1158
|
let n = e.lastIndexOf("\n", t - 1) + 1, r = e.indexOf("\n", t);
|
|
1130
|
-
return e.slice(n, r < 0 ? e.length : r).replace(
|
|
1159
|
+
return e.slice(n, r < 0 ? e.length : r).replace(lr, "").trim() !== "";
|
|
1131
1160
|
}
|
|
1132
|
-
function
|
|
1133
|
-
let
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1161
|
+
function dr(e) {
|
|
1162
|
+
let t = e?.length ? new Set(e) : null;
|
|
1163
|
+
return t ? (e) => t.has(e) : (e) => e.includes("-");
|
|
1164
|
+
}
|
|
1165
|
+
var fr = /<([\w-]+)((?:\s+[\w-]+=(?:[“”][^“”]*[“”]|[‘’][^‘’]*[‘’]|"[^"]*"|'[^']*'))+)\s*(\/?>)/g, pr = /([\w-]+)=(?:[“”]([^“”]*)[“”]|[‘’]([^‘’]*)[‘’])/g;
|
|
1166
|
+
function mr(e) {
|
|
1167
|
+
return e.replace(pr, (e, t, n, r) => `${t}="${(n ?? r ?? "").replace(/"/g, """)}"`);
|
|
1168
|
+
}
|
|
1169
|
+
function hr(e, t) {
|
|
1170
|
+
return e.replace(fr, (e, n, r, i) => t(n) ? `<${n}${mr(r)}${i}` : e);
|
|
1171
|
+
}
|
|
1172
|
+
function gr(e, t, n = !1) {
|
|
1173
|
+
let r = dr(t), i = "", a = 0;
|
|
1174
|
+
for (; a < e.length;) {
|
|
1175
|
+
if (e[a] !== "<" || e[a + 1] === "/") {
|
|
1176
|
+
i += e[a++];
|
|
1137
1177
|
continue;
|
|
1138
1178
|
}
|
|
1139
|
-
let
|
|
1140
|
-
for (;
|
|
1141
|
-
let s = e.slice(
|
|
1142
|
-
if (!s || !
|
|
1143
|
-
|
|
1179
|
+
let o = a + 1;
|
|
1180
|
+
for (; o < e.length && /[\w-]/.test(e[o]);) o++;
|
|
1181
|
+
let s = e.slice(a + 1, o);
|
|
1182
|
+
if (!s || !r(s)) {
|
|
1183
|
+
i += e[a++];
|
|
1144
1184
|
continue;
|
|
1145
1185
|
}
|
|
1146
|
-
let c =
|
|
1186
|
+
let c = _r(e, a);
|
|
1147
1187
|
if (c < 0) {
|
|
1148
|
-
|
|
1188
|
+
i += e[a++];
|
|
1149
1189
|
continue;
|
|
1150
1190
|
}
|
|
1151
1191
|
if (e[c - 1] === "/") {
|
|
1152
|
-
let t = e.slice(
|
|
1153
|
-
n ?
|
|
1192
|
+
let t = e.slice(a, c + 1);
|
|
1193
|
+
n ? i += "<div>" + t + "</div>" : ur(e, a) ? i += "<span>" + t.slice(0, -2).trimEnd() + "></" + s + "></span>" : (i += t, e[c + 1] === "\n" && c + 2 < e.length && e[c + 2] !== "\n" && (i += "\n")), a = c + 1;
|
|
1154
1194
|
continue;
|
|
1155
1195
|
}
|
|
1156
|
-
let l =
|
|
1196
|
+
let l = vr(e, c + 1, s);
|
|
1157
1197
|
if (!l) {
|
|
1158
1198
|
if (n) {
|
|
1159
|
-
let n = e.slice(
|
|
1160
|
-
return
|
|
1199
|
+
let n = e.slice(a, c + 1), r = gr(e.slice(c + 1), t, !0);
|
|
1200
|
+
return i += "<div>" + n + r + "</" + s + "></div>", i;
|
|
1161
1201
|
}
|
|
1162
|
-
|
|
1202
|
+
i += e.slice(a, c + 1), a = c + 1;
|
|
1163
1203
|
continue;
|
|
1164
1204
|
}
|
|
1165
|
-
let u = e.slice(
|
|
1166
|
-
n ?
|
|
1205
|
+
let u = e.slice(a, c + 1), d = e.slice(c + 1, l.start), f = e.slice(l.start, l.end), p = gr(d, t, !0);
|
|
1206
|
+
n ? i += "<div>" + u + p + f + "</div>" : i = yr(i) + "<div>" + u + p + f + "</div>", a = l.end;
|
|
1167
1207
|
}
|
|
1168
|
-
return
|
|
1208
|
+
return i;
|
|
1169
1209
|
}
|
|
1170
|
-
function
|
|
1210
|
+
function _r(e, t) {
|
|
1171
1211
|
let n = t + 1;
|
|
1172
1212
|
for (; n < e.length;) {
|
|
1173
1213
|
if (e[n] === "\"") for (n++; n < e.length && e[n] !== "\"";) n++;
|
|
@@ -1176,14 +1216,14 @@ function ar(e, t) {
|
|
|
1176
1216
|
}
|
|
1177
1217
|
return -1;
|
|
1178
1218
|
}
|
|
1179
|
-
function
|
|
1219
|
+
function vr(e, t, n) {
|
|
1180
1220
|
let r = 1, i = t, a = "<" + n, o = "</" + n;
|
|
1181
1221
|
for (; i < e.length;) {
|
|
1182
1222
|
let t = e.indexOf("<", i);
|
|
1183
1223
|
if (t < 0) return null;
|
|
1184
1224
|
if (e.startsWith(o, t) && !/[\w-]/.test(e[t + o.length] || "")) {
|
|
1185
1225
|
if (r--, r === 0) {
|
|
1186
|
-
let n =
|
|
1226
|
+
let n = _r(e, t);
|
|
1187
1227
|
return n < 0 ? null : {
|
|
1188
1228
|
start: t,
|
|
1189
1229
|
end: n + 1
|
|
@@ -1192,25 +1232,25 @@ function or(e, t, n) {
|
|
|
1192
1232
|
let n = e.indexOf(">", t + o.length);
|
|
1193
1233
|
i = n < 0 ? t + 1 : n + 1;
|
|
1194
1234
|
} else if (e.startsWith(a, t) && !/[\w-]/.test(e[t + a.length] || "")) {
|
|
1195
|
-
let n =
|
|
1235
|
+
let n = _r(e, t);
|
|
1196
1236
|
n >= 0 && e[n - 1] !== "/" && r++, i = n < 0 ? t + 1 : n + 1;
|
|
1197
1237
|
} else if (/[a-zA-Z/]/.test(e[t + 1] || "")) {
|
|
1198
|
-
let n =
|
|
1238
|
+
let n = _r(e, t);
|
|
1199
1239
|
i = n < 0 ? t + 1 : n + 1;
|
|
1200
1240
|
} else i = t + 1;
|
|
1201
1241
|
}
|
|
1202
1242
|
return null;
|
|
1203
1243
|
}
|
|
1204
|
-
function
|
|
1244
|
+
function yr(e) {
|
|
1205
1245
|
return e.length === 0 ? "\n\n" : e.endsWith("\n\n") ? e : e.endsWith("\n") ? e + "\n" : e + "\n\n";
|
|
1206
1246
|
}
|
|
1207
1247
|
//#endregion
|
|
1208
1248
|
//#region src/lib/elements/table-panel-extension.tsx
|
|
1209
|
-
var
|
|
1249
|
+
var br = "response-table-panel", xr = ["title", "description"], Sr = k(Ne({
|
|
1210
1250
|
variant: "ghost",
|
|
1211
1251
|
size: "icon-sm"
|
|
1212
|
-
})),
|
|
1213
|
-
let t =
|
|
1252
|
+
})), Cr = vt().use(ut).use(lt).use(ct), wr = (e) => {
|
|
1253
|
+
let t = _t(e), n = Dr(e);
|
|
1214
1254
|
if (n.length === 0) return t;
|
|
1215
1255
|
let r = 0, i = t.map((e) => {
|
|
1216
1256
|
let t = {
|
|
@@ -1225,49 +1265,49 @@ var cr = "response-table-panel", lr = ["title", "description"], ur = k(De({
|
|
|
1225
1265
|
}
|
|
1226
1266
|
return t.reduce((e, t, n) => (a.has(n) && e.length > 0 ? e[e.length - 1] += t : e.push(t), e), []);
|
|
1227
1267
|
};
|
|
1228
|
-
function
|
|
1268
|
+
function Tr(e) {
|
|
1229
1269
|
return e?.type === "leafDirective" && "name" in e && e.name === "table";
|
|
1230
1270
|
}
|
|
1231
|
-
function
|
|
1271
|
+
function Er(e, t) {
|
|
1232
1272
|
if (t === void 0) return;
|
|
1233
1273
|
let n = e[t - 1];
|
|
1234
|
-
return
|
|
1274
|
+
return Tr(n) ? n : void 0;
|
|
1235
1275
|
}
|
|
1236
|
-
function
|
|
1276
|
+
function Dr(e) {
|
|
1237
1277
|
let t = [];
|
|
1238
|
-
return
|
|
1278
|
+
return bt(Cr.parse(e), "table", (e, n, r) => {
|
|
1239
1279
|
if (!r) return;
|
|
1240
|
-
let i =
|
|
1280
|
+
let i = Er(r.children, n)?.position?.start.offset, a = e.position?.end.offset;
|
|
1241
1281
|
i !== void 0 && a !== void 0 && t.push({
|
|
1242
1282
|
start: i,
|
|
1243
1283
|
end: a
|
|
1244
1284
|
});
|
|
1245
1285
|
}), t;
|
|
1246
1286
|
}
|
|
1247
|
-
function
|
|
1287
|
+
function Or(e, t) {
|
|
1248
1288
|
return e.attributes?.[t]?.trim() || void 0;
|
|
1249
1289
|
}
|
|
1250
|
-
function
|
|
1251
|
-
let t =
|
|
1252
|
-
if (
|
|
1290
|
+
function kr(e) {
|
|
1291
|
+
let t = Cr.parse(e), n = !1;
|
|
1292
|
+
if (bt(t, "leafDirective", (e, t, r) => {
|
|
1253
1293
|
let i = t === void 0 ? void 0 : r?.children[t + 1];
|
|
1254
1294
|
if (e.name !== "table" || i?.type !== "table") return;
|
|
1255
1295
|
n = !0;
|
|
1256
|
-
let a = [
|
|
1296
|
+
let a = [Or(e, "title"), Or(e, "description")].filter(Boolean).join(" ");
|
|
1257
1297
|
e.children = a ? [{
|
|
1258
1298
|
type: "text",
|
|
1259
1299
|
value: a
|
|
1260
1300
|
}] : [];
|
|
1261
|
-
}), n) return
|
|
1301
|
+
}), n) return gt(st(t, { includeHtml: !1 }));
|
|
1262
1302
|
}
|
|
1263
|
-
function
|
|
1303
|
+
function Ar(e) {
|
|
1264
1304
|
let t = O(2), n;
|
|
1265
|
-
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ M(
|
|
1305
|
+
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ M(dt, { ...e }), t[0] = e, t[1] = n), n;
|
|
1266
1306
|
}
|
|
1267
|
-
function
|
|
1307
|
+
function jr(e) {
|
|
1268
1308
|
function t(t) {
|
|
1269
1309
|
let n = O(6), r;
|
|
1270
|
-
n[0] !== t.content || n[1] !== t.dir ? (r =
|
|
1310
|
+
n[0] !== t.content || n[1] !== t.dir ? (r = kr(t.content) ?? t.dir, n[0] = t.content, n[1] = t.dir, n[2] = r) : r = n[2];
|
|
1271
1311
|
let i = r, a;
|
|
1272
1312
|
return n[3] !== i || n[4] !== t ? (a = /* @__PURE__ */ M(e, {
|
|
1273
1313
|
...t,
|
|
@@ -1276,54 +1316,54 @@ function yr(e) {
|
|
|
1276
1316
|
}
|
|
1277
1317
|
return t.displayName = "DirectionAwareTableBlock", t;
|
|
1278
1318
|
}
|
|
1279
|
-
function
|
|
1280
|
-
let n = t &&
|
|
1319
|
+
function Mr(e, t) {
|
|
1320
|
+
let n = t && Or(t, "title"), r = t && Or(t, "description"), i = {
|
|
1281
1321
|
...n ? { title: n } : {},
|
|
1282
1322
|
...r ? { description: r } : {}
|
|
1283
1323
|
};
|
|
1284
1324
|
return {
|
|
1285
1325
|
type: "tablePanel",
|
|
1286
1326
|
data: {
|
|
1287
|
-
hName:
|
|
1327
|
+
hName: br,
|
|
1288
1328
|
...Object.keys(i).length > 0 ? { hProperties: i } : {}
|
|
1289
1329
|
},
|
|
1290
1330
|
children: [e]
|
|
1291
1331
|
};
|
|
1292
1332
|
}
|
|
1293
|
-
function
|
|
1333
|
+
function Nr() {
|
|
1294
1334
|
return (e) => {
|
|
1295
|
-
|
|
1335
|
+
bt(e, "table", (e, t, n) => {
|
|
1296
1336
|
if (t === void 0 || !n) return;
|
|
1297
|
-
let r =
|
|
1298
|
-
return n.children.splice(i, a,
|
|
1337
|
+
let r = Er(n.children, t), i = r ? t - 1 : t, a = r ? 2 : 1;
|
|
1338
|
+
return n.children.splice(i, a, Mr(e, r)), [yt, i + 1];
|
|
1299
1339
|
});
|
|
1300
1340
|
};
|
|
1301
1341
|
}
|
|
1302
|
-
var
|
|
1303
|
-
...Object.values(
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
],
|
|
1342
|
+
var Pr = [
|
|
1343
|
+
...Object.values(ht),
|
|
1344
|
+
ct,
|
|
1345
|
+
Nr
|
|
1346
|
+
], Fr = t.createContext({
|
|
1307
1347
|
actions: null,
|
|
1308
1348
|
controls: !0
|
|
1309
1349
|
});
|
|
1310
|
-
function
|
|
1350
|
+
function Ir(e, t) {
|
|
1311
1351
|
if (e === !1) return !1;
|
|
1312
1352
|
if (e === !0 || e === void 0) return !0;
|
|
1313
1353
|
let n = e.table;
|
|
1314
1354
|
return n === !1 ? !1 : n === !0 || n === void 0 || n[t] !== !1;
|
|
1315
1355
|
}
|
|
1316
|
-
function
|
|
1356
|
+
function Lr(e) {
|
|
1317
1357
|
return e === !1 ? !1 : e === !0 || e === void 0 ? { table: !1 } : {
|
|
1318
1358
|
...e,
|
|
1319
1359
|
table: !1
|
|
1320
1360
|
};
|
|
1321
1361
|
}
|
|
1322
|
-
function
|
|
1323
|
-
let n = O(21), { children: r, className: i, title: a, description: o } = e, { actions: s, controls: c } = t.use(
|
|
1324
|
-
n[0] === c ? l = n[1] : (l =
|
|
1362
|
+
function Rr(e) {
|
|
1363
|
+
let n = O(21), { children: r, className: i, title: a, description: o } = e, { actions: s, controls: c } = t.use(Fr), l;
|
|
1364
|
+
n[0] === c ? l = n[1] : (l = Ir(c, "copy"), n[0] = c, n[1] = l);
|
|
1325
1365
|
let u = l, d;
|
|
1326
|
-
n[2] === c ? d = n[3] : (d =
|
|
1366
|
+
n[2] === c ? d = n[3] : (d = Ir(c, "download"), n[2] = c, n[3] = d);
|
|
1327
1367
|
let f = d, p = !!(a || o), m = !!(u || f || s);
|
|
1328
1368
|
if (!r) return null;
|
|
1329
1369
|
let h;
|
|
@@ -1337,8 +1377,8 @@ function Er(e) {
|
|
|
1337
1377
|
})] }), m && /* @__PURE__ */ N(q.Actions, {
|
|
1338
1378
|
"data-copy-exclude": "assistant-snapshot",
|
|
1339
1379
|
children: [
|
|
1340
|
-
u && /* @__PURE__ */ M(
|
|
1341
|
-
f && /* @__PURE__ */ M(
|
|
1380
|
+
u && /* @__PURE__ */ M(pt, { className: Sr }),
|
|
1381
|
+
f && /* @__PURE__ */ M(mt, { className: Sr }),
|
|
1342
1382
|
s
|
|
1343
1383
|
]
|
|
1344
1384
|
})]
|
|
@@ -1357,31 +1397,31 @@ function Er(e) {
|
|
|
1357
1397
|
children: [g, v]
|
|
1358
1398
|
}), n[17] = h, n[18] = g, n[19] = v, n[20] = y) : y = n[20], y;
|
|
1359
1399
|
}
|
|
1360
|
-
function
|
|
1400
|
+
function zr(e) {
|
|
1361
1401
|
let t = O(43), n, r, i, a, o, s, c, l, u, d;
|
|
1362
1402
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5], s = t[6], c = t[7], l = t[8], u = t[9], d = t[10]) : ({allowedTags: r, BlockComponent: n, children: i, components: a, controls: o, dir: s, mode: c, remarkPlugins: u, tableActions: d, ...l} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o, t[6] = s, t[7] = c, t[8] = l, t[9] = u, t[10] = d);
|
|
1363
1403
|
let f;
|
|
1364
1404
|
bb0: {
|
|
1365
1405
|
if (!u) {
|
|
1366
|
-
f =
|
|
1406
|
+
f = Pr;
|
|
1367
1407
|
break bb0;
|
|
1368
1408
|
}
|
|
1369
1409
|
let e;
|
|
1370
1410
|
t[11] === u ? e = t[12] : (e = [
|
|
1371
1411
|
...u,
|
|
1372
|
-
|
|
1373
|
-
|
|
1412
|
+
ct,
|
|
1413
|
+
Nr
|
|
1374
1414
|
], t[11] = u, t[12] = e), f = e;
|
|
1375
1415
|
}
|
|
1376
1416
|
let p = f, m;
|
|
1377
1417
|
t[13] === r ? m = t[14] : (m = {
|
|
1378
1418
|
...r,
|
|
1379
|
-
[
|
|
1419
|
+
[br]: xr
|
|
1380
1420
|
}, t[13] = r, t[14] = m);
|
|
1381
1421
|
let h = m, g;
|
|
1382
1422
|
t[15] === a ? g = t[16] : (g = {
|
|
1383
1423
|
...a,
|
|
1384
|
-
[
|
|
1424
|
+
[br]: Rr
|
|
1385
1425
|
}, t[15] = a, t[16] = g);
|
|
1386
1426
|
let _ = g, v;
|
|
1387
1427
|
t[17] !== o || t[18] !== d ? (v = {
|
|
@@ -1394,8 +1434,8 @@ function Dr(e) {
|
|
|
1394
1434
|
b = n;
|
|
1395
1435
|
break bb1;
|
|
1396
1436
|
}
|
|
1397
|
-
let e = n ??
|
|
1398
|
-
t[20] === e ? r = t[21] : (r =
|
|
1437
|
+
let e = n ?? Ar, r;
|
|
1438
|
+
t[20] === e ? r = t[21] : (r = jr(e), t[20] = e, t[21] = r), b = r;
|
|
1399
1439
|
}
|
|
1400
1440
|
let x = b, S;
|
|
1401
1441
|
bb2: {
|
|
@@ -1404,34 +1444,34 @@ function Dr(e) {
|
|
|
1404
1444
|
break bb2;
|
|
1405
1445
|
}
|
|
1406
1446
|
let e;
|
|
1407
|
-
t[22] !== i || t[23] !== s ? (e =
|
|
1447
|
+
t[22] !== i || t[23] !== s ? (e = kr(i) ?? s, t[22] = i, t[23] = s, t[24] = e) : e = t[24], S = e;
|
|
1408
1448
|
}
|
|
1409
1449
|
let C = S, w;
|
|
1410
|
-
t[25] === o ? w = t[26] : (w =
|
|
1450
|
+
t[25] === o ? w = t[26] : (w = Lr(o), t[25] = o, t[26] = w);
|
|
1411
1451
|
let T;
|
|
1412
|
-
t[27] !== i || t[28] !== h ? (T =
|
|
1452
|
+
t[27] !== i || t[28] !== h ? (T = cr(i, Object.keys(h)), t[27] = i, t[28] = h, t[29] = T) : T = t[29];
|
|
1413
1453
|
let E;
|
|
1414
|
-
t[30] !== c || t[31] !== l || t[32] !== C || t[33] !== w || t[34] !== T || t[35] !== h || t[36] !== x || t[37] !== _ || t[38] !== p ? (E = /* @__PURE__ */ M(
|
|
1454
|
+
t[30] !== c || t[31] !== l || t[32] !== C || t[33] !== w || t[34] !== T || t[35] !== h || t[36] !== x || t[37] !== _ || t[38] !== p ? (E = /* @__PURE__ */ M(ft, {
|
|
1415
1455
|
allowedTags: h,
|
|
1416
1456
|
BlockComponent: x,
|
|
1417
1457
|
components: _,
|
|
1418
1458
|
controls: w,
|
|
1419
1459
|
dir: C,
|
|
1420
1460
|
mode: c,
|
|
1421
|
-
parseMarkdownIntoBlocksFn:
|
|
1461
|
+
parseMarkdownIntoBlocksFn: wr,
|
|
1422
1462
|
remarkPlugins: p,
|
|
1423
1463
|
...l,
|
|
1424
1464
|
children: T
|
|
1425
1465
|
}), t[30] = c, t[31] = l, t[32] = C, t[33] = w, t[34] = T, t[35] = h, t[36] = x, t[37] = _, t[38] = p, t[39] = E) : E = t[39];
|
|
1426
1466
|
let D;
|
|
1427
|
-
return t[40] !== E || t[41] !== y ? (D = /* @__PURE__ */ M(
|
|
1467
|
+
return t[40] !== E || t[41] !== y ? (D = /* @__PURE__ */ M(Fr, {
|
|
1428
1468
|
value: y,
|
|
1429
1469
|
children: E
|
|
1430
1470
|
}), t[40] = E, t[41] = y, t[42] = D) : D = t[42], D;
|
|
1431
1471
|
}
|
|
1432
1472
|
//#endregion
|
|
1433
1473
|
//#region src/lib/elements/Response.tsx
|
|
1434
|
-
var
|
|
1474
|
+
var Br = class extends t.Component {
|
|
1435
1475
|
state = {
|
|
1436
1476
|
hasError: !1,
|
|
1437
1477
|
error: null
|
|
@@ -1454,16 +1494,17 @@ var Or = class extends t.Component {
|
|
|
1454
1494
|
let i;
|
|
1455
1495
|
t[3] === n ? i = t[4] : (i = k("size-full space-y-2 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", n), t[3] = n, t[4] = i);
|
|
1456
1496
|
let a;
|
|
1457
|
-
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ M(
|
|
1497
|
+
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ M(Br, { children: /* @__PURE__ */ M(zr, {
|
|
1458
1498
|
className: i,
|
|
1499
|
+
dir: "auto",
|
|
1459
1500
|
...r
|
|
1460
1501
|
}) }), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1461
1502
|
});
|
|
1462
1503
|
J.displayName = "Response";
|
|
1463
1504
|
//#endregion
|
|
1464
1505
|
//#region src/lib/ui/use-copy-feedback.ts
|
|
1465
|
-
function
|
|
1466
|
-
let t = O(9), n = e === void 0 ? 2e3 : e, r =
|
|
1506
|
+
function Vr(e) {
|
|
1507
|
+
let t = O(9), n = e === void 0 ? 2e3 : e, r = St(), [i, a] = g(!1), o = h(null), s, c;
|
|
1467
1508
|
t[0] === r ? (s = t[1], c = t[2]) : (s = () => () => {
|
|
1468
1509
|
o.current && r.clearTimeout(o.current);
|
|
1469
1510
|
}, c = [r], t[0] = r, t[1] = s, t[2] = c), d(s, c);
|
|
@@ -1476,13 +1517,13 @@ function kr(e) {
|
|
|
1476
1517
|
}
|
|
1477
1518
|
//#endregion
|
|
1478
1519
|
//#region src/lib/elements/code-block.tsx
|
|
1479
|
-
var
|
|
1520
|
+
var Hr = o({ code: "" }), Ur = (e) => {
|
|
1480
1521
|
let t = O(24), n, r, i, a, o, s;
|
|
1481
1522
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5], s = t[6]) : ({code: r, language: i, showLineNumbers: o, wrap: s, children: n, ...a} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o, t[6] = s);
|
|
1482
|
-
let c = o !== void 0 && o, l = s !== void 0 && s, u =
|
|
1523
|
+
let c = o !== void 0 && o, l = s !== void 0 && s, u = Pe(r, i), d;
|
|
1483
1524
|
t[7] === r ? d = t[8] : (d = { code: r }, t[7] = r, t[8] = d);
|
|
1484
1525
|
let f;
|
|
1485
|
-
t[9] === u ? f = t[10] : (f = u.map(
|
|
1526
|
+
t[9] === u ? f = t[10] : (f = u.map(Gr), t[9] = u, t[10] = f);
|
|
1486
1527
|
let p;
|
|
1487
1528
|
t[11] !== c || t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(Te, {
|
|
1488
1529
|
lineNumbers: c,
|
|
@@ -1498,12 +1539,12 @@ var Ar = o({ code: "" }), jr = (e) => {
|
|
|
1498
1539
|
children: [p, m]
|
|
1499
1540
|
}), t[17] = a, t[18] = p, t[19] = m, t[20] = h) : h = t[20];
|
|
1500
1541
|
let g;
|
|
1501
|
-
return t[21] !== d || t[22] !== h ? (g = /* @__PURE__ */ M(
|
|
1542
|
+
return t[21] !== d || t[22] !== h ? (g = /* @__PURE__ */ M(Hr, {
|
|
1502
1543
|
value: d,
|
|
1503
1544
|
children: h
|
|
1504
1545
|
}), t[21] = d, t[22] = h, t[23] = g) : g = t[23], g;
|
|
1505
|
-
},
|
|
1506
|
-
let [o, s] =
|
|
1546
|
+
}, Wr = ({ onCopy: e, onError: t, timeout: n = 2e3, children: r, className: i, ...a }) => {
|
|
1547
|
+
let [o, s] = Vr(n), { code: c } = l(Hr), u = async () => {
|
|
1507
1548
|
if (typeof window > "u" || !navigator.clipboard.writeText) {
|
|
1508
1549
|
t?.(/* @__PURE__ */ Error("Clipboard API not available"));
|
|
1509
1550
|
return;
|
|
@@ -1513,7 +1554,7 @@ var Ar = o({ code: "" }), jr = (e) => {
|
|
|
1513
1554
|
} catch (e) {
|
|
1514
1555
|
t?.(e instanceof Error ? e : Error(String(e)));
|
|
1515
1556
|
}
|
|
1516
|
-
}, d = o ?
|
|
1557
|
+
}, d = o ? Be : qe;
|
|
1517
1558
|
return /* @__PURE__ */ M(he, {
|
|
1518
1559
|
className: k("shrink-0", i),
|
|
1519
1560
|
onClick: () => void u(),
|
|
@@ -1523,12 +1564,12 @@ var Ar = o({ code: "" }), jr = (e) => {
|
|
|
1523
1564
|
children: r ?? /* @__PURE__ */ M(d, {})
|
|
1524
1565
|
});
|
|
1525
1566
|
};
|
|
1526
|
-
function
|
|
1567
|
+
function Gr(e, t) {
|
|
1527
1568
|
return /* @__PURE__ */ M(Ee, { children: e }, t);
|
|
1528
1569
|
}
|
|
1529
1570
|
//#endregion
|
|
1530
1571
|
//#region src/lib/elements/Tool.tsx
|
|
1531
|
-
var
|
|
1572
|
+
var Kr = (e) => {
|
|
1532
1573
|
let t = O(8), n, r;
|
|
1533
1574
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1534
1575
|
let i;
|
|
@@ -1538,17 +1579,17 @@ var Pr = (e) => {
|
|
|
1538
1579
|
className: i,
|
|
1539
1580
|
...r
|
|
1540
1581
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1541
|
-
},
|
|
1582
|
+
}, qr = (e) => /* @__PURE__ */ N(me, {
|
|
1542
1583
|
className: "gap-1.5 rounded-full text-xs",
|
|
1543
1584
|
variant: "secondary",
|
|
1544
1585
|
children: [{
|
|
1545
|
-
"input-streaming": /* @__PURE__ */ M(
|
|
1546
|
-
"input-available": /* @__PURE__ */ M(
|
|
1547
|
-
"approval-requested": /* @__PURE__ */ M(
|
|
1548
|
-
"approval-responded": /* @__PURE__ */ M(
|
|
1549
|
-
"output-available": /* @__PURE__ */ M(
|
|
1550
|
-
"output-error": /* @__PURE__ */ M(
|
|
1551
|
-
"output-denied": /* @__PURE__ */ M(
|
|
1586
|
+
"input-streaming": /* @__PURE__ */ M(We, { className: "size-4" }),
|
|
1587
|
+
"input-available": /* @__PURE__ */ M(Ge, { className: "size-4 animate-pulse" }),
|
|
1588
|
+
"approval-requested": /* @__PURE__ */ M(Ge, { className: "size-4 text-yellow-600" }),
|
|
1589
|
+
"approval-responded": /* @__PURE__ */ M(ze, { className: "size-4 text-blue-600" }),
|
|
1590
|
+
"output-available": /* @__PURE__ */ M(ze, { className: "size-4 text-green-600" }),
|
|
1591
|
+
"output-error": /* @__PURE__ */ M(at, { className: "size-4 text-red-600" }),
|
|
1592
|
+
"output-denied": /* @__PURE__ */ M(at, { className: "size-4 text-orange-600" })
|
|
1552
1593
|
}[e], {
|
|
1553
1594
|
"input-streaming": "Pending",
|
|
1554
1595
|
"input-available": "Running",
|
|
@@ -1558,13 +1599,13 @@ var Pr = (e) => {
|
|
|
1558
1599
|
"output-error": "Error",
|
|
1559
1600
|
"output-denied": "Denied"
|
|
1560
1601
|
}[e]]
|
|
1561
|
-
}),
|
|
1602
|
+
}), Jr = (e) => {
|
|
1562
1603
|
let t = O(23), n, r, i, a;
|
|
1563
1604
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({className: n, title: a, part: r, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a);
|
|
1564
1605
|
let o;
|
|
1565
1606
|
t[5] === n ? o = t[6] : (o = k("group flex w-full items-center justify-between gap-4 p-3", n), t[5] = n, t[6] = o);
|
|
1566
1607
|
let s;
|
|
1567
|
-
t[7] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(
|
|
1608
|
+
t[7] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(it, { className: "text-muted-foreground size-4" }), t[7] = s) : s = t[7];
|
|
1568
1609
|
let c;
|
|
1569
1610
|
t[8] !== r || t[9] !== a ? (c = a ?? b(r), t[8] = r, t[9] = a, t[10] = c) : c = t[10];
|
|
1570
1611
|
let l;
|
|
@@ -1573,7 +1614,7 @@ var Pr = (e) => {
|
|
|
1573
1614
|
children: c
|
|
1574
1615
|
}), t[11] = c, t[12] = l);
|
|
1575
1616
|
let u;
|
|
1576
|
-
t[13] === r.state ? u = t[14] : (u =
|
|
1617
|
+
t[13] === r.state ? u = t[14] : (u = qr(r.state), t[13] = r.state, t[14] = u);
|
|
1577
1618
|
let d;
|
|
1578
1619
|
t[15] !== l || t[16] !== u ? (d = /* @__PURE__ */ N("div", {
|
|
1579
1620
|
className: "flex items-center gap-2",
|
|
@@ -1584,14 +1625,14 @@ var Pr = (e) => {
|
|
|
1584
1625
|
]
|
|
1585
1626
|
}), t[15] = l, t[16] = u, t[17] = d) : d = t[17];
|
|
1586
1627
|
let f;
|
|
1587
|
-
t[18] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(
|
|
1628
|
+
t[18] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(He, { className: "text-muted-foreground size-4 transition-transform group-data-[panel-open]:rotate-180" }), t[18] = f) : f = t[18];
|
|
1588
1629
|
let p;
|
|
1589
1630
|
return t[19] !== i || t[20] !== o || t[21] !== d ? (p = /* @__PURE__ */ N(L, {
|
|
1590
1631
|
className: o,
|
|
1591
1632
|
...i,
|
|
1592
1633
|
children: [d, f]
|
|
1593
1634
|
}), t[19] = i, t[20] = o, t[21] = d, t[22] = p) : p = t[22], p;
|
|
1594
|
-
},
|
|
1635
|
+
}, Yr = (e) => {
|
|
1595
1636
|
let t = O(8), n, r;
|
|
1596
1637
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1597
1638
|
let i;
|
|
@@ -1601,7 +1642,7 @@ var Pr = (e) => {
|
|
|
1601
1642
|
className: i,
|
|
1602
1643
|
...r
|
|
1603
1644
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1604
|
-
},
|
|
1645
|
+
}, Xr = (e) => {
|
|
1605
1646
|
let t = O(15), n, r, i;
|
|
1606
1647
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, input: r, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
1607
1648
|
let a;
|
|
@@ -1616,7 +1657,7 @@ var Pr = (e) => {
|
|
|
1616
1657
|
let c;
|
|
1617
1658
|
t[9] === s ? c = t[10] : (c = /* @__PURE__ */ M("div", {
|
|
1618
1659
|
className: "bg-muted/50 rounded-md",
|
|
1619
|
-
children: /* @__PURE__ */ M(
|
|
1660
|
+
children: /* @__PURE__ */ M(Ur, {
|
|
1620
1661
|
code: s,
|
|
1621
1662
|
language: "json"
|
|
1622
1663
|
})
|
|
@@ -1627,7 +1668,7 @@ var Pr = (e) => {
|
|
|
1627
1668
|
...i,
|
|
1628
1669
|
children: [o, c]
|
|
1629
1670
|
}), t[11] = i, t[12] = a, t[13] = c, t[14] = l) : l = t[14], l;
|
|
1630
|
-
},
|
|
1671
|
+
}, Zr = (e) => {
|
|
1631
1672
|
let t = O(24), n, r, i, a;
|
|
1632
1673
|
if (t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({className: n, output: i, errorText: r, ...a} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a), !(i || r)) return null;
|
|
1633
1674
|
let o;
|
|
@@ -1642,7 +1683,7 @@ var Pr = (e) => {
|
|
|
1642
1683
|
let d;
|
|
1643
1684
|
t[11] === r ? d = t[12] : (d = r && /* @__PURE__ */ M("div", { children: r }), t[11] = r, t[12] = d);
|
|
1644
1685
|
let f;
|
|
1645
|
-
t[13] === i ? f = t[14] : (f =
|
|
1686
|
+
t[13] === i ? f = t[14] : (f = Qr(i), t[13] = i, t[14] = f);
|
|
1646
1687
|
let p;
|
|
1647
1688
|
t[15] !== u || t[16] !== d || t[17] !== f ? (p = /* @__PURE__ */ N("div", {
|
|
1648
1689
|
className: u,
|
|
@@ -1655,27 +1696,27 @@ var Pr = (e) => {
|
|
|
1655
1696
|
children: [c, p]
|
|
1656
1697
|
}), t[19] = a, t[20] = o, t[21] = c, t[22] = p, t[23] = m) : m = t[23], m;
|
|
1657
1698
|
};
|
|
1658
|
-
function
|
|
1659
|
-
return typeof e == "string" ? /* @__PURE__ */ M(
|
|
1699
|
+
function Qr(e) {
|
|
1700
|
+
return typeof e == "string" ? /* @__PURE__ */ M(Ur, {
|
|
1660
1701
|
code: e,
|
|
1661
1702
|
language: "json"
|
|
1662
|
-
}) : s(e) ? /* @__PURE__ */ M("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ M(
|
|
1703
|
+
}) : s(e) ? /* @__PURE__ */ M("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ M(Ur, {
|
|
1663
1704
|
code: JSON.stringify(e, null, 2),
|
|
1664
1705
|
language: "json"
|
|
1665
1706
|
}) : typeof e == "number" || typeof e == "bigint" ? /* @__PURE__ */ M("div", { children: e }) : /* @__PURE__ */ M("div", {});
|
|
1666
1707
|
}
|
|
1667
1708
|
//#endregion
|
|
1668
1709
|
//#region src/lib/components/tool-debug.tsx
|
|
1669
|
-
function
|
|
1710
|
+
function $r(e) {
|
|
1670
1711
|
let t = O(20), { part: n } = e, r;
|
|
1671
1712
|
t[0] === n ? r = t[1] : (r = b(n), t[0] = n, t[1] = r);
|
|
1672
1713
|
let i = `Executing ${r}`, a;
|
|
1673
|
-
t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M(
|
|
1714
|
+
t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M(Jr, {
|
|
1674
1715
|
title: i,
|
|
1675
1716
|
part: n
|
|
1676
1717
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4];
|
|
1677
1718
|
let o;
|
|
1678
|
-
t[5] === n.input ? o = t[6] : (o = /* @__PURE__ */ M(
|
|
1719
|
+
t[5] === n.input ? o = t[6] : (o = /* @__PURE__ */ M(Xr, { input: n.input }), t[5] = n.input, t[6] = o);
|
|
1679
1720
|
let s;
|
|
1680
1721
|
t[7] === n.output ? s = t[8] : (s = typeof n.output == "string" ? n.output : JSON.stringify(n.output, null, 2), t[7] = n.output, t[8] = s);
|
|
1681
1722
|
let c;
|
|
@@ -1684,26 +1725,26 @@ function Vr(e) {
|
|
|
1684
1725
|
children: s
|
|
1685
1726
|
}), t[9] = s, t[10] = c);
|
|
1686
1727
|
let l;
|
|
1687
|
-
t[11] !== n.errorText || t[12] !== c ? (l = /* @__PURE__ */ M(
|
|
1728
|
+
t[11] !== n.errorText || t[12] !== c ? (l = /* @__PURE__ */ M(Zr, {
|
|
1688
1729
|
output: c,
|
|
1689
1730
|
errorText: n.errorText
|
|
1690
1731
|
}), t[11] = n.errorText, t[12] = c, t[13] = l) : l = t[13];
|
|
1691
1732
|
let u;
|
|
1692
|
-
t[14] !== o || t[15] !== l ? (u = /* @__PURE__ */ N(
|
|
1733
|
+
t[14] !== o || t[15] !== l ? (u = /* @__PURE__ */ N(Yr, { children: [o, l] }), t[14] = o, t[15] = l, t[16] = u) : u = t[16];
|
|
1693
1734
|
let d;
|
|
1694
|
-
return t[17] !== a || t[18] !== u ? (d = /* @__PURE__ */ N(
|
|
1735
|
+
return t[17] !== a || t[18] !== u ? (d = /* @__PURE__ */ N(Kr, {
|
|
1695
1736
|
"data-copy-exclude": "assistant-snapshot",
|
|
1696
1737
|
children: [a, u]
|
|
1697
1738
|
}), t[17] = a, t[18] = u, t[19] = d) : d = t[19], d;
|
|
1698
1739
|
}
|
|
1699
|
-
function
|
|
1740
|
+
function ei(e) {
|
|
1700
1741
|
let t = O(18), { part: n } = e, r = `Executing ${n.toolName}`, i;
|
|
1701
|
-
t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
1742
|
+
t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(Jr, {
|
|
1702
1743
|
title: r,
|
|
1703
1744
|
part: n
|
|
1704
1745
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
1705
1746
|
let a;
|
|
1706
|
-
t[3] === n.input ? a = t[4] : (a = /* @__PURE__ */ M(
|
|
1747
|
+
t[3] === n.input ? a = t[4] : (a = /* @__PURE__ */ M(Xr, { input: n.input }), t[3] = n.input, t[4] = a);
|
|
1707
1748
|
let o;
|
|
1708
1749
|
t[5] === n.output ? o = t[6] : (o = typeof n.output == "string" ? n.output : JSON.stringify(n.output, null, 2), t[5] = n.output, t[6] = o);
|
|
1709
1750
|
let s;
|
|
@@ -1712,49 +1753,49 @@ function Hr(e) {
|
|
|
1712
1753
|
children: o
|
|
1713
1754
|
}), t[7] = o, t[8] = s);
|
|
1714
1755
|
let c;
|
|
1715
|
-
t[9] !== n.errorText || t[10] !== s ? (c = /* @__PURE__ */ M(
|
|
1756
|
+
t[9] !== n.errorText || t[10] !== s ? (c = /* @__PURE__ */ M(Zr, {
|
|
1716
1757
|
output: s,
|
|
1717
1758
|
errorText: n.errorText
|
|
1718
1759
|
}), t[9] = n.errorText, t[10] = s, t[11] = c) : c = t[11];
|
|
1719
1760
|
let l;
|
|
1720
|
-
t[12] !== a || t[13] !== c ? (l = /* @__PURE__ */ N(
|
|
1761
|
+
t[12] !== a || t[13] !== c ? (l = /* @__PURE__ */ N(Yr, { children: [a, c] }), t[12] = a, t[13] = c, t[14] = l) : l = t[14];
|
|
1721
1762
|
let u;
|
|
1722
|
-
return t[15] !== i || t[16] !== l ? (u = /* @__PURE__ */ N(
|
|
1763
|
+
return t[15] !== i || t[16] !== l ? (u = /* @__PURE__ */ N(Kr, {
|
|
1723
1764
|
"data-copy-exclude": "assistant-snapshot",
|
|
1724
1765
|
children: [i, l]
|
|
1725
1766
|
}), t[15] = i, t[16] = l, t[17] = u) : u = t[17], u;
|
|
1726
1767
|
}
|
|
1727
1768
|
//#endregion
|
|
1728
1769
|
//#region src/lib/copy/copy-image.ts
|
|
1729
|
-
var
|
|
1770
|
+
var ti = "data-copy-exclude", ni = {
|
|
1730
1771
|
image: "image",
|
|
1731
1772
|
assistantSnapshot: "assistant-snapshot"
|
|
1732
1773
|
};
|
|
1733
|
-
function
|
|
1774
|
+
function ri(e) {
|
|
1734
1775
|
return typeof e == "object" && !!e && "getAttribute" in e && typeof e.getAttribute == "function";
|
|
1735
1776
|
}
|
|
1736
|
-
function
|
|
1737
|
-
if (!
|
|
1738
|
-
let n = e.getAttribute(
|
|
1777
|
+
function ii(e, t) {
|
|
1778
|
+
if (!ri(e)) return !1;
|
|
1779
|
+
let n = e.getAttribute(ti);
|
|
1739
1780
|
return n ? n.split(/\s+/).includes(t) : !1;
|
|
1740
1781
|
}
|
|
1741
|
-
function
|
|
1742
|
-
return !
|
|
1782
|
+
function ai(e, t) {
|
|
1783
|
+
return !ii(e, t);
|
|
1743
1784
|
}
|
|
1744
|
-
function
|
|
1785
|
+
function oi({ clipboard: e, ClipboardItem: t }) {
|
|
1745
1786
|
return typeof e?.write == "function" && typeof t == "function" ? "image" : typeof e?.writeText == "function" ? "text" : "none";
|
|
1746
1787
|
}
|
|
1747
1788
|
//#endregion
|
|
1748
1789
|
//#region src/lib/copy/snapshot-context.ts
|
|
1749
|
-
var
|
|
1790
|
+
var si = o(!1);
|
|
1750
1791
|
//#endregion
|
|
1751
1792
|
//#region src/lib/copy/snapshot-render.tsx
|
|
1752
|
-
function
|
|
1793
|
+
function ci() {
|
|
1753
1794
|
return new Promise((e) => {
|
|
1754
1795
|
requestAnimationFrame(() => e());
|
|
1755
1796
|
});
|
|
1756
1797
|
}
|
|
1757
|
-
function
|
|
1798
|
+
function li(e) {
|
|
1758
1799
|
let t = O(9), { contentRef: n, children: r, width: i, padding: a, className: o } = e, s = i === void 0 ? 1120 : i, c = a === void 0 ? 24 : a, l = o === void 0 ? "bg-background text-foreground flex flex-col gap-3" : o;
|
|
1759
1800
|
if (typeof document > "u") return null;
|
|
1760
1801
|
let u;
|
|
@@ -1772,10 +1813,10 @@ function Zr(e) {
|
|
|
1772
1813
|
boxSizing: "border-box"
|
|
1773
1814
|
}, t[1] = c, t[2] = s, t[3] = d) : d = t[3];
|
|
1774
1815
|
let f;
|
|
1775
|
-
return t[4] !== r || t[5] !== l || t[6] !== n || t[7] !== d ? (f =
|
|
1816
|
+
return t[4] !== r || t[5] !== l || t[6] !== n || t[7] !== d ? (f = Ct(/* @__PURE__ */ M("div", {
|
|
1776
1817
|
"aria-hidden": "true",
|
|
1777
1818
|
style: u,
|
|
1778
|
-
children: /* @__PURE__ */ M(
|
|
1819
|
+
children: /* @__PURE__ */ M(si, {
|
|
1779
1820
|
value: !0,
|
|
1780
1821
|
children: /* @__PURE__ */ M("div", {
|
|
1781
1822
|
ref: n,
|
|
@@ -1788,14 +1829,14 @@ function Zr(e) {
|
|
|
1788
1829
|
}
|
|
1789
1830
|
//#endregion
|
|
1790
1831
|
//#region src/lib/copy/use-copy-element-as-image.ts
|
|
1791
|
-
function
|
|
1832
|
+
function ui(e) {
|
|
1792
1833
|
let t = getComputedStyle(e).backgroundColor;
|
|
1793
1834
|
if (t !== "rgba(0, 0, 0, 0)") return t;
|
|
1794
1835
|
let n = getComputedStyle(document.body).backgroundColor;
|
|
1795
1836
|
return n === "rgba(0, 0, 0, 0)" ? void 0 : n;
|
|
1796
1837
|
}
|
|
1797
|
-
function
|
|
1798
|
-
let r =
|
|
1838
|
+
function di({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
1839
|
+
let r = St(), [i, a] = g(!1), [o, s] = g(null), c = h(null), l = u(() => {
|
|
1799
1840
|
c.current !== null && (r.clearTimeout(c.current), c.current = null);
|
|
1800
1841
|
}, [r]), f = u((e) => {
|
|
1801
1842
|
l(), s(e), c.current = r.setTimeout(() => {
|
|
@@ -1811,9 +1852,9 @@ function $r({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1811
1852
|
}), !0), [n, f]), m = u(async () => {
|
|
1812
1853
|
if (!e.current) throw Error("Nothing is ready to copy yet.");
|
|
1813
1854
|
let { toBlob: n } = await import("html-to-image"), r = await n(e.current, {
|
|
1814
|
-
backgroundColor:
|
|
1855
|
+
backgroundColor: ui(e.current),
|
|
1815
1856
|
pixelRatio: 2,
|
|
1816
|
-
filter: (e) =>
|
|
1857
|
+
filter: (e) => ai(e, t)
|
|
1817
1858
|
});
|
|
1818
1859
|
if (!r) throw Error("Unable to render the image for copying.");
|
|
1819
1860
|
await navigator.clipboard.write([new ClipboardItem({ [r.type]: r })]), f({
|
|
@@ -1829,7 +1870,7 @@ function $r({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1829
1870
|
copy: u(async () => {
|
|
1830
1871
|
a(!0), s(null);
|
|
1831
1872
|
try {
|
|
1832
|
-
let e =
|
|
1873
|
+
let e = oi({
|
|
1833
1874
|
clipboard: typeof navigator > "u" ? void 0 : navigator.clipboard,
|
|
1834
1875
|
ClipboardItem: typeof window > "u" ? void 0 : window.ClipboardItem
|
|
1835
1876
|
});
|
|
@@ -1864,29 +1905,29 @@ function $r({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1864
1905
|
}
|
|
1865
1906
|
//#endregion
|
|
1866
1907
|
//#region src/lib/copy/assistant-snapshot.tsx
|
|
1867
|
-
function
|
|
1908
|
+
function fi(e) {
|
|
1868
1909
|
return e.parts.filter(C).map((e) => e.text).join("\n");
|
|
1869
1910
|
}
|
|
1870
1911
|
function Y() {
|
|
1871
|
-
return l(
|
|
1912
|
+
return l(si);
|
|
1872
1913
|
}
|
|
1873
|
-
function
|
|
1914
|
+
function pi(e) {
|
|
1874
1915
|
let t = O(30), { message: n, renderContent: r, className: i } = e, a = h(null), [o, s] = g(!1), c;
|
|
1875
|
-
t[0] === n ? c = t[1] : (c =
|
|
1916
|
+
t[0] === n ? c = t[1] : (c = fi(n), t[0] = n, t[1] = c);
|
|
1876
1917
|
let l = c, u;
|
|
1877
1918
|
t[2] === l ? u = t[3] : (u = {
|
|
1878
1919
|
elementRef: a,
|
|
1879
|
-
excludeMode:
|
|
1920
|
+
excludeMode: ni.assistantSnapshot,
|
|
1880
1921
|
fallbackText: l
|
|
1881
1922
|
}, t[2] = l, t[3] = u);
|
|
1882
|
-
let { copy: d, feedback: f, isCopying: p } =
|
|
1923
|
+
let { copy: d, feedback: f, isCopying: p } = di(u), m;
|
|
1883
1924
|
t[4] !== d || t[5] !== o ? (m = async () => {
|
|
1884
|
-
o || s(!0), await
|
|
1925
|
+
o || s(!0), await ci(), await d();
|
|
1885
1926
|
}, t[4] = d, t[5] = o, t[6] = m) : m = t[6];
|
|
1886
1927
|
let _ = m, v = "Copy snapshot";
|
|
1887
1928
|
p ? v = "Copying snapshot" : f?.kind === "success" && (v = f.mode === "image" ? "Copied snapshot" : "Copied text");
|
|
1888
1929
|
let y;
|
|
1889
|
-
t[7] !== r || t[8] !== o ? (y = o && /* @__PURE__ */ M(
|
|
1930
|
+
t[7] !== r || t[8] !== o ? (y = o && /* @__PURE__ */ M(li, {
|
|
1890
1931
|
contentRef: a,
|
|
1891
1932
|
children: r()
|
|
1892
1933
|
}), t[7] = r, t[8] = o, t[9] = y) : y = t[9];
|
|
@@ -1900,9 +1941,9 @@ function ti(e) {
|
|
|
1900
1941
|
let S;
|
|
1901
1942
|
t[14] === _ ? S = t[15] : (S = () => void _(), t[14] = _, t[15] = S);
|
|
1902
1943
|
let C;
|
|
1903
|
-
t[16] === f?.kind ? C = t[17] : (C = f?.kind === "success" ? /* @__PURE__ */ M(
|
|
1944
|
+
t[16] === f?.kind ? C = t[17] : (C = f?.kind === "success" ? /* @__PURE__ */ M(Re, { className: "size-4" }) : /* @__PURE__ */ M(Ke, { className: "size-4" }), t[16] = f?.kind, t[17] = C);
|
|
1904
1945
|
let w;
|
|
1905
|
-
t[18] !== p || t[19] !== v || t[20] !== S || t[21] !== C ? (w = /* @__PURE__ */ M(
|
|
1946
|
+
t[18] !== p || t[19] !== v || t[20] !== S || t[21] !== C ? (w = /* @__PURE__ */ M(xt, {
|
|
1906
1947
|
type: "button",
|
|
1907
1948
|
size: "icon-sm",
|
|
1908
1949
|
variant: "ghost",
|
|
@@ -1922,59 +1963,68 @@ function ti(e) {
|
|
|
1922
1963
|
}
|
|
1923
1964
|
//#endregion
|
|
1924
1965
|
//#region src/lib/tools/helpers.ts
|
|
1925
|
-
function
|
|
1966
|
+
function mi(e) {
|
|
1926
1967
|
return w(e) && e.toolMetadata?.kind === "subagent";
|
|
1927
1968
|
}
|
|
1928
|
-
function
|
|
1969
|
+
function hi(e) {
|
|
1929
1970
|
let t = e.toolMetadata?.displayName;
|
|
1930
1971
|
return typeof t == "string" ? t : "Subagent";
|
|
1931
1972
|
}
|
|
1932
|
-
function
|
|
1973
|
+
function gi(e, t) {
|
|
1933
1974
|
let n = y(e);
|
|
1934
1975
|
return {
|
|
1935
1976
|
toolKey: n,
|
|
1936
1977
|
toolEntry: t?.[n]
|
|
1937
1978
|
};
|
|
1938
1979
|
}
|
|
1939
|
-
function
|
|
1980
|
+
function _i(e, t) {
|
|
1940
1981
|
return e?.static === !1 && !!e?.requiresUserInput && t === "input-available";
|
|
1941
1982
|
}
|
|
1942
1983
|
//#endregion
|
|
1943
1984
|
//#region src/lib/chat/markdown-paragraph.tsx
|
|
1944
|
-
var
|
|
1945
|
-
function
|
|
1985
|
+
var vi = /* @__PURE__ */ new Set(/* @__PURE__ */ "a.abbr.b.bdi.bdo.br.cite.code.data.del.dfn.em.i.ins.kbd.mark.q.s.samp.small.span.strong.sub.sup.time.u.var.wbr".split("."));
|
|
1986
|
+
function yi(e) {
|
|
1946
1987
|
if (!n.isValidElement(e)) return !1;
|
|
1947
1988
|
let t = typeof e.type == "string" ? e.type : e.props.node?.tagName;
|
|
1948
|
-
return t === void 0 || !
|
|
1989
|
+
return t === void 0 || !vi.has(t);
|
|
1949
1990
|
}
|
|
1950
|
-
function
|
|
1951
|
-
let t = O(
|
|
1952
|
-
if (!
|
|
1991
|
+
function bi(e) {
|
|
1992
|
+
let t = O(6), { children: r, dir: i } = e, a = n.Children.toArray(r);
|
|
1993
|
+
if (!a.some(yi)) {
|
|
1953
1994
|
let e;
|
|
1954
|
-
return t[0]
|
|
1995
|
+
return t[0] !== r || t[1] !== i ? (e = /* @__PURE__ */ M("p", {
|
|
1996
|
+
dir: i,
|
|
1997
|
+
children: r
|
|
1998
|
+
}), t[0] = r, t[1] = i, t[2] = e) : e = t[2], e;
|
|
1955
1999
|
}
|
|
1956
|
-
if (
|
|
1957
|
-
let
|
|
1958
|
-
return t[
|
|
2000
|
+
if (a.every(yi)) return r;
|
|
2001
|
+
let o;
|
|
2002
|
+
return t[3] !== r || t[4] !== i ? (o = /* @__PURE__ */ M("div", {
|
|
2003
|
+
dir: i,
|
|
2004
|
+
children: r
|
|
2005
|
+
}), t[3] = r, t[4] = i, t[5] = o) : o = t[5], o;
|
|
1959
2006
|
}
|
|
1960
2007
|
//#endregion
|
|
1961
2008
|
//#region src/lib/components/InteractiveResponse.tsx
|
|
1962
|
-
var
|
|
1963
|
-
|
|
1964
|
-
|
|
2009
|
+
var xi = { p: ({ children: e, dir: t }) => /* @__PURE__ */ M(bi, {
|
|
2010
|
+
dir: t,
|
|
2011
|
+
children: e
|
|
2012
|
+
}) };
|
|
2013
|
+
function Si(e) {
|
|
2014
|
+
let t = { ...xi }, n = {};
|
|
1965
2015
|
for (let r of e) ae(r), t[r.name] = r.component, n[r.name] = r.allowedAttributes;
|
|
1966
2016
|
return {
|
|
1967
2017
|
components: t,
|
|
1968
2018
|
allowedTags: n
|
|
1969
2019
|
};
|
|
1970
2020
|
}
|
|
1971
|
-
function
|
|
2021
|
+
function Ci(e) {
|
|
1972
2022
|
let t = O(10), n, r;
|
|
1973
2023
|
t[0] === e ? (n = t[1], r = t[2]) : ({elements: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1974
2024
|
let i;
|
|
1975
2025
|
t[3] === n ? i = t[4] : (i = n ?? [], t[3] = n, t[4] = i);
|
|
1976
2026
|
let a;
|
|
1977
|
-
t[5] === i ? a = t[6] : (a =
|
|
2027
|
+
t[5] === i ? a = t[6] : (a = Si(i), t[5] = i, t[6] = a);
|
|
1978
2028
|
let o = a, s;
|
|
1979
2029
|
return t[7] !== r || t[8] !== o ? (s = /* @__PURE__ */ M(J, {
|
|
1980
2030
|
...o,
|
|
@@ -1983,7 +2033,7 @@ function di(e) {
|
|
|
1983
2033
|
}
|
|
1984
2034
|
//#endregion
|
|
1985
2035
|
//#region src/lib/renderers/render-part.tsx
|
|
1986
|
-
function
|
|
2036
|
+
function wi(e) {
|
|
1987
2037
|
let t = O(22), { part: n } = e, { addToolApprovalResponse: r } = H();
|
|
1988
2038
|
if (n.state !== "approval-requested") return null;
|
|
1989
2039
|
let i;
|
|
@@ -2036,21 +2086,21 @@ function fi(e) {
|
|
|
2036
2086
|
children: [l, f]
|
|
2037
2087
|
}), t[18] = o, t[19] = l, t[20] = f, t[21] = p) : p = t[21], p;
|
|
2038
2088
|
}
|
|
2039
|
-
function
|
|
2089
|
+
function Ti(e) {
|
|
2040
2090
|
let t = O(25), { part: n } = e, { registry: r } = z();
|
|
2041
2091
|
if (n.input === void 0) {
|
|
2042
2092
|
let e;
|
|
2043
|
-
return t[0] !== n.errorText || t[1] !== n.output || t[2] !== n.state ? (e = n.state === "output-error" ? /* @__PURE__ */ M(
|
|
2093
|
+
return t[0] !== n.errorText || t[1] !== n.output || t[2] !== n.state ? (e = n.state === "output-error" ? /* @__PURE__ */ M(Zr, {
|
|
2044
2094
|
output: n.output,
|
|
2045
2095
|
errorText: n.errorText
|
|
2046
|
-
}) : /* @__PURE__ */ M(
|
|
2096
|
+
}) : /* @__PURE__ */ M(Xe, { className: "size-4 animate-spin" }), t[0] = n.errorText, t[1] = n.output, t[2] = n.state, t[3] = e) : e = t[3], e;
|
|
2047
2097
|
}
|
|
2048
2098
|
let i;
|
|
2049
|
-
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(
|
|
2099
|
+
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(wi, { part: n }), t[4] = n, t[5] = i);
|
|
2050
2100
|
let a = i;
|
|
2051
2101
|
if (!r) return a;
|
|
2052
2102
|
let o;
|
|
2053
|
-
t[6] !== n || t[7] !== r ? (o =
|
|
2103
|
+
t[6] !== n || t[7] !== r ? (o = gi(n, r), t[6] = n, t[7] = r, t[8] = o) : o = t[8];
|
|
2054
2104
|
let { toolEntry: s } = o;
|
|
2055
2105
|
if (s) {
|
|
2056
2106
|
let e = s.component, i;
|
|
@@ -2075,8 +2125,8 @@ function pi(e) {
|
|
|
2075
2125
|
}
|
|
2076
2126
|
//#endregion
|
|
2077
2127
|
//#region src/lib/chat/message-parts.tsx
|
|
2078
|
-
var
|
|
2079
|
-
function
|
|
2128
|
+
var Ei = { animation: "slideUp" };
|
|
2129
|
+
function Di(e) {
|
|
2080
2130
|
let t = O(3), { filename: n, url: r } = e, i = n ?? "Attached image", a;
|
|
2081
2131
|
return t[0] !== i || t[1] !== r ? (a = /* @__PURE__ */ M("img", {
|
|
2082
2132
|
src: r,
|
|
@@ -2084,7 +2134,7 @@ function hi(e) {
|
|
|
2084
2134
|
className: "max-h-64 rounded-md border object-contain"
|
|
2085
2135
|
}), t[0] = i, t[1] = r, t[2] = a) : a = t[2], a;
|
|
2086
2136
|
}
|
|
2087
|
-
function
|
|
2137
|
+
function Oi(e) {
|
|
2088
2138
|
let t = O(16), { filename: n, mediaType: r, url: i } = e, a = n || "Untitled", o;
|
|
2089
2139
|
t[0] !== r || t[1] !== a || t[2] !== i ? (o = i?.startsWith("data:") ? null : i && r.startsWith("video/") ? /* @__PURE__ */ M("video", {
|
|
2090
2140
|
controls: !0,
|
|
@@ -2130,62 +2180,125 @@ function gi(e) {
|
|
|
2130
2180
|
children: [s, d]
|
|
2131
2181
|
}), t[13] = s, t[14] = d, t[15] = f) : f = t[15], f;
|
|
2132
2182
|
}
|
|
2133
|
-
function
|
|
2183
|
+
function ki(e) {
|
|
2134
2184
|
let t = O(4), { filename: n, mediaType: r, url: i } = e, a;
|
|
2135
|
-
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(
|
|
2185
|
+
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(Di, {
|
|
2136
2186
|
filename: n,
|
|
2137
2187
|
url: i
|
|
2138
|
-
}) : /* @__PURE__ */ M(
|
|
2188
|
+
}) : /* @__PURE__ */ M(Oi, {
|
|
2139
2189
|
filename: n,
|
|
2140
2190
|
mediaType: r,
|
|
2141
2191
|
url: i
|
|
2142
2192
|
}), t[0] = n, t[1] = r, t[2] = i, t[3] = a) : a = t[3], a;
|
|
2143
2193
|
}
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
animated: mi,
|
|
2151
|
-
isAnimating: c,
|
|
2152
|
-
children: n
|
|
2153
|
-
}), t[2] = r, t[3] = c, t[4] = n, t[5] = l) : l = t[5];
|
|
2154
|
-
let u;
|
|
2155
|
-
return t[6] !== s || t[7] !== l ? (u = /* @__PURE__ */ M("div", {
|
|
2156
|
-
className: s,
|
|
2157
|
-
children: l
|
|
2158
|
-
}), t[6] = s, t[7] = l, t[8] = u) : u = t[8], u;
|
|
2194
|
+
var Ai = "genai-citation";
|
|
2195
|
+
function ji(e, t) {
|
|
2196
|
+
return t.map((t, n) => ({
|
|
2197
|
+
at: t.endIndex ?? e.length,
|
|
2198
|
+
order: n
|
|
2199
|
+
})).sort((e, t) => t.at - e.at || t.order - e.order).reduce((e, { at: t, order: n }) => `${e.slice(0, t)}<${Ai} citation="${n}" />${e.slice(t)}`, e);
|
|
2159
2200
|
}
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2201
|
+
var Mi = o(null);
|
|
2202
|
+
function Ni(e) {
|
|
2203
|
+
let t = O(16), n = l(Mi), r = n?.citations[Number(e.citation)];
|
|
2204
|
+
if (!n || !r) return null;
|
|
2205
|
+
let i;
|
|
2206
|
+
t[0] !== r.source.url || t[1] !== n.sources ? (i = tn(n.sources, r.source.url), t[0] = r.source.url, t[1] = n.sources, t[2] = i) : i = t[2];
|
|
2207
|
+
let a = i;
|
|
2208
|
+
if (a === null) return null;
|
|
2209
|
+
if (n.HostCitation) {
|
|
2210
|
+
let e;
|
|
2211
|
+
return t[3] !== r || t[4] !== n.HostCitation || t[5] !== a ? (e = /* @__PURE__ */ M(n.HostCitation, {
|
|
2212
|
+
citation: r,
|
|
2213
|
+
index: a
|
|
2214
|
+
}), t[3] = r, t[4] = n.HostCitation, t[5] = a, t[6] = e) : e = t[6], e;
|
|
2215
|
+
}
|
|
2216
|
+
let o;
|
|
2217
|
+
t[7] !== r.source.title || t[8] !== r.source.url ? (o = {
|
|
2218
|
+
url: r.source.url,
|
|
2219
|
+
title: r.source.title
|
|
2220
|
+
}, t[7] = r.source.title, t[8] = r.source.url, t[9] = o) : o = t[9];
|
|
2221
|
+
let s;
|
|
2222
|
+
t[10] === r.citedText ? s = t[11] : (s = r.citedText ? /* @__PURE__ */ M("blockquote", {
|
|
2223
|
+
dir: "auto",
|
|
2224
|
+
children: r.citedText
|
|
2225
|
+
}) : null, t[10] = r.citedText, t[11] = s);
|
|
2226
|
+
let c;
|
|
2227
|
+
return t[12] !== a || t[13] !== o || t[14] !== s ? (c = /* @__PURE__ */ M(Zn, {
|
|
2228
|
+
source: o,
|
|
2229
|
+
index: a,
|
|
2230
|
+
children: s
|
|
2231
|
+
}), t[12] = a, t[13] = o, t[14] = s, t[15] = c) : c = t[15], c;
|
|
2232
|
+
}
|
|
2233
|
+
var Pi = {
|
|
2234
|
+
name: Ai,
|
|
2235
|
+
allowedAttributes: ["citation"],
|
|
2236
|
+
component: Ni
|
|
2237
|
+
};
|
|
2238
|
+
function Fi(e) {
|
|
2239
|
+
let t = O(27), { text: n, citations: r, elements: i, className: a } = e, { status: o } = B(), s = Y(), { messages: c, citation: l } = W(), u;
|
|
2240
|
+
t[0] === r ? u = t[1] : (u = $t(r), t[0] = r, t[1] = u);
|
|
2241
|
+
let d = u, f;
|
|
2242
|
+
t[2] === c ? f = t[3] : (f = en(c), t[2] = c, t[3] = f);
|
|
2243
|
+
let p;
|
|
2244
|
+
t[4] !== l || t[5] !== f || t[6] !== d ? (p = {
|
|
2245
|
+
citations: d,
|
|
2246
|
+
sources: f,
|
|
2247
|
+
HostCitation: l
|
|
2248
|
+
}, t[4] = l, t[5] = f, t[6] = d, t[7] = p) : p = t[7];
|
|
2249
|
+
let m = p, h = d.length > 0, g;
|
|
2250
|
+
t[8] !== i || t[9] !== h ? (g = h ? [...i ?? [], Pi] : i, t[8] = i, t[9] = h, t[10] = g) : g = t[10];
|
|
2251
|
+
let _ = g, v;
|
|
2252
|
+
t[11] === a ? v = t[12] : (v = k("text-sm", a), t[11] = a, t[12] = v);
|
|
2253
|
+
let y = !s && o === "streaming", b;
|
|
2254
|
+
t[13] !== h || t[14] !== n || t[15] !== d ? (b = h ? ji(n, d) : n, t[13] = h, t[14] = n, t[15] = d, t[16] = b) : b = t[16];
|
|
2255
|
+
let x;
|
|
2256
|
+
t[17] !== y || t[18] !== b || t[19] !== _ ? (x = /* @__PURE__ */ M(Ci, {
|
|
2257
|
+
elements: _,
|
|
2258
|
+
animated: Ei,
|
|
2259
|
+
isAnimating: y,
|
|
2260
|
+
children: b
|
|
2261
|
+
}), t[17] = y, t[18] = b, t[19] = _, t[20] = x) : x = t[20];
|
|
2262
|
+
let S;
|
|
2263
|
+
t[21] !== v || t[22] !== x ? (S = /* @__PURE__ */ M("div", {
|
|
2264
|
+
className: v,
|
|
2265
|
+
children: x
|
|
2266
|
+
}), t[21] = v, t[22] = x, t[23] = S) : S = t[23];
|
|
2267
|
+
let C;
|
|
2268
|
+
return t[24] !== m || t[25] !== S ? (C = /* @__PURE__ */ M(Mi, {
|
|
2269
|
+
value: m,
|
|
2270
|
+
children: S
|
|
2271
|
+
}), t[24] = m, t[25] = S, t[26] = C) : C = t[26], C;
|
|
2272
|
+
}
|
|
2273
|
+
function Ii(e) {
|
|
2274
|
+
let t = O(8), { part: n } = e, r = Li(), i;
|
|
2275
|
+
t[0] !== n || t[1] !== r ? (i = r && /* @__PURE__ */ M($r, { part: n }), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
2163
2276
|
let a;
|
|
2164
|
-
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(
|
|
2277
|
+
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(Ti, { part: n }), t[3] = n, t[4] = a);
|
|
2165
2278
|
let o;
|
|
2166
2279
|
return t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(j, { children: [i, a] }), t[5] = i, t[6] = a, t[7] = o) : o = t[7], o;
|
|
2167
2280
|
}
|
|
2168
|
-
function
|
|
2281
|
+
function Li() {
|
|
2169
2282
|
let { debugMode: e } = z(), t = Y();
|
|
2170
2283
|
return !!e && !t;
|
|
2171
2284
|
}
|
|
2172
2285
|
//#endregion
|
|
2173
2286
|
//#region src/lib/chat/trajectory/tool-label.tsx
|
|
2174
|
-
function
|
|
2287
|
+
function Ri(e) {
|
|
2175
2288
|
return !!e && e !== "output-available";
|
|
2176
2289
|
}
|
|
2177
|
-
function
|
|
2290
|
+
function zi(e) {
|
|
2178
2291
|
let t = O(5), { label: n, part: r, state: i } = e, a = Y(), o;
|
|
2179
|
-
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !
|
|
2292
|
+
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !Ri(i), t[0] = a, t[1] = n, t[2] = r, t[3] = i, t[4] = o) : o = t[4], o;
|
|
2180
2293
|
}
|
|
2181
|
-
function
|
|
2294
|
+
function Bi(e) {
|
|
2182
2295
|
let t = O(18), { label: n, part: r } = e, i = n.icon, a = n.actions, o;
|
|
2183
2296
|
t[0] !== n || t[1] !== r ? (o = {
|
|
2184
2297
|
label: n,
|
|
2185
2298
|
part: r,
|
|
2186
2299
|
state: r.state
|
|
2187
2300
|
}, t[0] = n, t[1] = r, t[2] = o) : o = t[2];
|
|
2188
|
-
let s =
|
|
2301
|
+
let s = zi(o), c;
|
|
2189
2302
|
t[3] !== i || t[4] !== n.isError ? (c = i && /* @__PURE__ */ M(i, { className: k("size-3.5", n.isError ? "text-destructive" : "text-muted-foreground") }), t[3] = i, t[4] = n.isError, t[5] = c) : c = t[5];
|
|
2190
2303
|
let l;
|
|
2191
2304
|
t[6] === n.name ? l = t[7] : (l = /* @__PURE__ */ M("span", {
|
|
@@ -2205,7 +2318,7 @@ function Ci(e) {
|
|
|
2205
2318
|
children: [u, d]
|
|
2206
2319
|
}), t[15] = u, t[16] = d, t[17] = f) : f = t[17], f;
|
|
2207
2320
|
}
|
|
2208
|
-
function
|
|
2321
|
+
function Vi(e) {
|
|
2209
2322
|
let t = O(3), { name: n, value: r } = e, i;
|
|
2210
2323
|
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ N("span", {
|
|
2211
2324
|
"data-slot": "tool-arg",
|
|
@@ -2217,15 +2330,15 @@ function wi(e) {
|
|
|
2217
2330
|
]
|
|
2218
2331
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2219
2332
|
}
|
|
2220
|
-
function
|
|
2333
|
+
function Hi(e) {
|
|
2221
2334
|
let t = O(23), { label: n, state: r, part: i, children: a } = e, o = n.actions, s;
|
|
2222
2335
|
t[0] !== n || t[1] !== i || t[2] !== r ? (s = {
|
|
2223
2336
|
label: n,
|
|
2224
2337
|
part: i,
|
|
2225
2338
|
state: r
|
|
2226
2339
|
}, t[0] = n, t[1] = i, t[2] = r, t[3] = s) : s = t[3];
|
|
2227
|
-
let c =
|
|
2228
|
-
t[4] === n.args ? l = t[5] : (l = n.args ? Object.entries(n.args).map(
|
|
2340
|
+
let c = zi(s), l;
|
|
2341
|
+
t[4] === n.args ? l = t[5] : (l = n.args ? Object.entries(n.args).map(Ui) : "...", t[4] = n.args, t[5] = l);
|
|
2229
2342
|
let u;
|
|
2230
2343
|
t[6] !== a || t[7] !== n.name || t[8] !== l ? (u = /* @__PURE__ */ N("span", {
|
|
2231
2344
|
className: "text-muted-foreground min-w-0 truncate font-mono text-xs [&>[data-slot=tool-arg]+[data-slot=tool-arg]]:before:mr-1 [&>[data-slot=tool-arg]+[data-slot=tool-arg]]:before:content-[',']",
|
|
@@ -2258,26 +2371,27 @@ function Ti(e) {
|
|
|
2258
2371
|
children: [f, p]
|
|
2259
2372
|
}), t[20] = f, t[21] = p, t[22] = m) : m = t[22], m;
|
|
2260
2373
|
}
|
|
2261
|
-
function
|
|
2374
|
+
function Ui(e) {
|
|
2262
2375
|
let [t, n] = e;
|
|
2263
|
-
return /* @__PURE__ */ M(
|
|
2376
|
+
return /* @__PURE__ */ M(Vi, {
|
|
2264
2377
|
name: t,
|
|
2265
2378
|
value: n
|
|
2266
2379
|
}, t);
|
|
2267
2380
|
}
|
|
2268
2381
|
//#endregion
|
|
2269
2382
|
//#region src/lib/chat/trajectory/segments/index.tsx
|
|
2270
|
-
function
|
|
2383
|
+
function Wi(e) {
|
|
2271
2384
|
return e.type === "text" && e.providerMetadata?.openai?.phase === "commentary";
|
|
2272
2385
|
}
|
|
2273
|
-
function
|
|
2386
|
+
function Gi(e) {
|
|
2274
2387
|
let t = O(9), { segment: n, elements: r, className: i } = e, a;
|
|
2275
2388
|
if (t[0] !== i || t[1] !== r || t[2] !== n.parts) {
|
|
2276
2389
|
let e;
|
|
2277
2390
|
t[4] !== i || t[5] !== r ? (e = (e) => {
|
|
2278
2391
|
let { part: t, idx: n } = e;
|
|
2279
|
-
return t.type === "text" ? /* @__PURE__ */ M(
|
|
2392
|
+
return t.type === "text" ? /* @__PURE__ */ M(Fi, {
|
|
2280
2393
|
text: t.text,
|
|
2394
|
+
citations: t.citations,
|
|
2281
2395
|
elements: r,
|
|
2282
2396
|
className: i
|
|
2283
2397
|
}, `${n}-text`) : null;
|
|
@@ -2286,27 +2400,27 @@ function Oi(e) {
|
|
|
2286
2400
|
let o;
|
|
2287
2401
|
return t[7] === a ? o = t[8] : (o = /* @__PURE__ */ M(j, { children: a }), t[7] = a, t[8] = o), o;
|
|
2288
2402
|
}
|
|
2289
|
-
function
|
|
2403
|
+
function Ki(e) {
|
|
2290
2404
|
let t = O(4), { segment: n } = e, { part: r } = n;
|
|
2291
2405
|
if (r.type !== "file") return null;
|
|
2292
2406
|
let i;
|
|
2293
|
-
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(
|
|
2407
|
+
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(ki, {
|
|
2294
2408
|
filename: r.filename,
|
|
2295
2409
|
mediaType: r.mediaType,
|
|
2296
2410
|
url: r.url
|
|
2297
2411
|
}), t[0] = r.filename, t[1] = r.mediaType, t[2] = r.url, t[3] = i) : i = t[3], i;
|
|
2298
2412
|
}
|
|
2299
|
-
function
|
|
2300
|
-
let t = O(9), { segment: n } = e, { messages: r } =
|
|
2301
|
-
t[0] === r ? i = t[1] : (i =
|
|
2413
|
+
function qi(e) {
|
|
2414
|
+
let t = O(9), { segment: n } = e, { messages: r } = W(), i;
|
|
2415
|
+
t[0] === r ? i = t[1] : (i = en(r), t[0] = r, t[1] = i);
|
|
2302
2416
|
let a = i, o;
|
|
2303
2417
|
if (t[2] !== n.parts || t[3] !== a) {
|
|
2304
2418
|
let e;
|
|
2305
2419
|
t[5] === a ? e = t[6] : (e = (e) => {
|
|
2306
2420
|
let { part: t, idx: n } = e;
|
|
2307
2421
|
if (t.type !== "source-url") return null;
|
|
2308
|
-
let r =
|
|
2309
|
-
return r === null ? null : /* @__PURE__ */ M(
|
|
2422
|
+
let r = tn(a, t.url);
|
|
2423
|
+
return r === null ? null : /* @__PURE__ */ M(Zn, {
|
|
2310
2424
|
source: {
|
|
2311
2425
|
url: t.url,
|
|
2312
2426
|
title: t.title
|
|
@@ -2318,7 +2432,7 @@ function Ai(e) {
|
|
|
2318
2432
|
let s;
|
|
2319
2433
|
return t[7] === o ? s = t[8] : (s = /* @__PURE__ */ M("span", { children: o }), t[7] = o, t[8] = s), s;
|
|
2320
2434
|
}
|
|
2321
|
-
function
|
|
2435
|
+
function Ji(e) {
|
|
2322
2436
|
let t = O(3), { segment: n } = e, r = G();
|
|
2323
2437
|
if (Y()) return null;
|
|
2324
2438
|
let { part: i } = n;
|
|
@@ -2327,31 +2441,31 @@ function ji(e) {
|
|
|
2327
2441
|
return t[0] !== i.text || t[1] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
2328
2442
|
className: "text-muted-foreground text-xs",
|
|
2329
2443
|
children: /* @__PURE__ */ M(J, {
|
|
2330
|
-
animated:
|
|
2444
|
+
animated: Ei,
|
|
2331
2445
|
isAnimating: a,
|
|
2332
2446
|
children: i.text
|
|
2333
2447
|
})
|
|
2334
2448
|
}), t[0] = i.text, t[1] = a, t[2] = o) : o = t[2], o;
|
|
2335
2449
|
}
|
|
2336
|
-
function
|
|
2450
|
+
function Yi(e) {
|
|
2337
2451
|
let t = O(2), { segment: n } = e;
|
|
2338
|
-
if (!
|
|
2452
|
+
if (!Li()) return null;
|
|
2339
2453
|
let { part: r } = n;
|
|
2340
2454
|
if (r.type !== "dynamic-tool") return null;
|
|
2341
2455
|
let i;
|
|
2342
|
-
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ M(
|
|
2456
|
+
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ M(ei, { part: r }), t[0] = r, t[1] = i), i;
|
|
2343
2457
|
}
|
|
2344
|
-
var
|
|
2345
|
-
function
|
|
2346
|
-
let e = l(
|
|
2458
|
+
var Xi = o(null), Zi = o(null);
|
|
2459
|
+
function Qi() {
|
|
2460
|
+
let e = l(Xi);
|
|
2347
2461
|
if (!e) throw Error("Segment.Tool* parts must be rendered within Segment.Tool");
|
|
2348
2462
|
return e;
|
|
2349
2463
|
}
|
|
2350
|
-
function
|
|
2464
|
+
function $i(e) {
|
|
2351
2465
|
let t = O(29), { segment: n, children: r } = e, i = z(), a = G(), { part: o } = n;
|
|
2352
2466
|
if (!S(o)) return null;
|
|
2353
2467
|
let s, c, l, u;
|
|
2354
|
-
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} =
|
|
2468
|
+
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} = gi(o, i.registry), c = _i(u, o.state), s = !c && an(o, a), l = u?.label?.(o), t[0] = i.registry, t[1] = a, t[2] = o, t[3] = s, t[4] = c, t[5] = l, t[6] = u) : (s = t[3], c = t[4], l = t[5], u = t[6]);
|
|
2355
2469
|
let d = l, f;
|
|
2356
2470
|
t[7] !== s || t[8] !== d || t[9] !== o ? (f = s ? {
|
|
2357
2471
|
...d ?? { name: y(o) },
|
|
@@ -2373,37 +2487,37 @@ function Ii(e) {
|
|
|
2373
2487
|
aborted: s
|
|
2374
2488
|
}, t[17] = s, t[18] = p, t[19] = o.state, t[20] = g) : g = t[20];
|
|
2375
2489
|
let _;
|
|
2376
|
-
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(
|
|
2490
|
+
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(ta, {}), t[21] = r, t[22] = _);
|
|
2377
2491
|
let v;
|
|
2378
|
-
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(
|
|
2492
|
+
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(Zi, {
|
|
2379
2493
|
value: g,
|
|
2380
2494
|
children: _
|
|
2381
2495
|
}), t[23] = g, t[24] = _, t[25] = v) : v = t[25];
|
|
2382
2496
|
let b;
|
|
2383
|
-
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M(
|
|
2497
|
+
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M(Xi, {
|
|
2384
2498
|
value: h,
|
|
2385
2499
|
children: v
|
|
2386
2500
|
}), t[26] = h, t[27] = v, t[28] = b) : b = t[28], b;
|
|
2387
2501
|
}
|
|
2388
|
-
function
|
|
2389
|
-
let e = O(2), { part: t, activeClientInput: n } =
|
|
2502
|
+
function ea() {
|
|
2503
|
+
let e = O(2), { part: t, activeClientInput: n } = Qi();
|
|
2390
2504
|
if (n) return null;
|
|
2391
2505
|
let r;
|
|
2392
|
-
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(
|
|
2506
|
+
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(Ii, { part: t }), e[0] = t, e[1] = r), r;
|
|
2393
2507
|
}
|
|
2394
|
-
function
|
|
2395
|
-
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } =
|
|
2508
|
+
function ta(e) {
|
|
2509
|
+
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } = Qi();
|
|
2396
2510
|
if (!i) {
|
|
2397
2511
|
let e;
|
|
2398
2512
|
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M("div", {
|
|
2399
2513
|
className: "min-w-0 flex-1",
|
|
2400
|
-
children: /* @__PURE__ */ M(
|
|
2514
|
+
children: /* @__PURE__ */ M(ea, {})
|
|
2401
2515
|
}), t[0] = e) : e = t[0], e;
|
|
2402
2516
|
}
|
|
2403
2517
|
let o;
|
|
2404
2518
|
t[1] !== n || t[2] !== i || t[3] !== r ? (o = /* @__PURE__ */ M(L, {
|
|
2405
2519
|
className: "cursor-pointer",
|
|
2406
|
-
children: /* @__PURE__ */ M(
|
|
2520
|
+
children: /* @__PURE__ */ M(Hi, {
|
|
2407
2521
|
label: i,
|
|
2408
2522
|
state: r.state,
|
|
2409
2523
|
part: r,
|
|
@@ -2413,7 +2527,7 @@ function Ri(e) {
|
|
|
2413
2527
|
let s;
|
|
2414
2528
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(I, {
|
|
2415
2529
|
className: "mb-2",
|
|
2416
|
-
children: /* @__PURE__ */ M(
|
|
2530
|
+
children: /* @__PURE__ */ M(ea, {})
|
|
2417
2531
|
}), t[5] = s) : s = t[5];
|
|
2418
2532
|
let c;
|
|
2419
2533
|
return t[6] !== a || t[7] !== o ? (c = /* @__PURE__ */ N(F, {
|
|
@@ -2423,63 +2537,63 @@ function Ri(e) {
|
|
|
2423
2537
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2424
2538
|
}
|
|
2425
2539
|
var X = {
|
|
2426
|
-
Text:
|
|
2427
|
-
File:
|
|
2428
|
-
Source:
|
|
2429
|
-
Reasoning:
|
|
2430
|
-
DynamicTool:
|
|
2431
|
-
Tool:
|
|
2432
|
-
ToolDisclosure:
|
|
2433
|
-
ToolContent:
|
|
2540
|
+
Text: Gi,
|
|
2541
|
+
File: Ki,
|
|
2542
|
+
Source: qi,
|
|
2543
|
+
Reasoning: Ji,
|
|
2544
|
+
DynamicTool: Yi,
|
|
2545
|
+
Tool: $i,
|
|
2546
|
+
ToolDisclosure: ta,
|
|
2547
|
+
ToolContent: ea
|
|
2434
2548
|
};
|
|
2435
2549
|
//#endregion
|
|
2436
2550
|
//#region src/lib/chat/trajectory/trajectory-segments.ts
|
|
2437
|
-
function
|
|
2551
|
+
function na(e) {
|
|
2438
2552
|
return S(e) ? "tool" : e.type === "dynamic-tool" ? "dynamic-tool" : e.type === "reasoning" && "text" in e && e.text ? "reasoning" : null;
|
|
2439
2553
|
}
|
|
2440
|
-
function
|
|
2554
|
+
function ra(e, t) {
|
|
2441
2555
|
return e.kind === "text" || e.kind === "file" || e.kind === "source" ? !1 : e.kind === "reasoning" || e.kind !== "dynamic-tool" || !!t;
|
|
2442
2556
|
}
|
|
2443
|
-
function
|
|
2557
|
+
function ia(e, t, n) {
|
|
2444
2558
|
let r = e[t + 1];
|
|
2445
|
-
return !!r &&
|
|
2559
|
+
return !!r && ra(r, n);
|
|
2446
2560
|
}
|
|
2447
|
-
function
|
|
2448
|
-
let t = [];
|
|
2449
|
-
for (let
|
|
2450
|
-
let
|
|
2451
|
-
if (
|
|
2452
|
-
kind:
|
|
2453
|
-
part:
|
|
2454
|
-
idx:
|
|
2561
|
+
function aa(e) {
|
|
2562
|
+
let t = [], n = new Set(e.flatMap((e) => e.type === "text" ? $t(e.citations).map(({ source: e }) => e.url) : []));
|
|
2563
|
+
for (let r = 0; r < e.length; r++) {
|
|
2564
|
+
let i = e[r], a = na(i);
|
|
2565
|
+
if (a) t.push({
|
|
2566
|
+
kind: a,
|
|
2567
|
+
part: i,
|
|
2568
|
+
idx: r
|
|
2455
2569
|
});
|
|
2456
|
-
else if (
|
|
2570
|
+
else if (i.type === "text") {
|
|
2457
2571
|
let e = t[t.length - 1];
|
|
2458
2572
|
e && e.kind === "text" ? e.parts.push({
|
|
2459
|
-
part:
|
|
2460
|
-
idx:
|
|
2573
|
+
part: i,
|
|
2574
|
+
idx: r
|
|
2461
2575
|
}) : t.push({
|
|
2462
2576
|
kind: "text",
|
|
2463
2577
|
parts: [{
|
|
2464
|
-
part:
|
|
2465
|
-
idx:
|
|
2578
|
+
part: i,
|
|
2579
|
+
idx: r
|
|
2466
2580
|
}]
|
|
2467
2581
|
});
|
|
2468
|
-
} else if (
|
|
2582
|
+
} else if (i.type === "file") t.push({
|
|
2469
2583
|
kind: "file",
|
|
2470
|
-
part:
|
|
2471
|
-
idx:
|
|
2584
|
+
part: i,
|
|
2585
|
+
idx: r
|
|
2472
2586
|
});
|
|
2473
|
-
else if (
|
|
2587
|
+
else if (i.type === "source-url" && !n.has(i.url)) {
|
|
2474
2588
|
let e = t[t.length - 1];
|
|
2475
2589
|
e && e.kind === "source" ? e.parts.push({
|
|
2476
|
-
part:
|
|
2477
|
-
idx:
|
|
2590
|
+
part: i,
|
|
2591
|
+
idx: r
|
|
2478
2592
|
}) : t.push({
|
|
2479
2593
|
kind: "source",
|
|
2480
2594
|
parts: [{
|
|
2481
|
-
part:
|
|
2482
|
-
idx:
|
|
2595
|
+
part: i,
|
|
2596
|
+
idx: r
|
|
2483
2597
|
}]
|
|
2484
2598
|
});
|
|
2485
2599
|
}
|
|
@@ -2491,7 +2605,7 @@ function Z(e, t) {
|
|
|
2491
2605
|
}
|
|
2492
2606
|
//#endregion
|
|
2493
2607
|
//#region src/lib/chat/trajectory/nested-trajectory.tsx
|
|
2494
|
-
function
|
|
2608
|
+
function oa(e, t) {
|
|
2495
2609
|
let n = `${Z(e, t)}:${e.kind}`;
|
|
2496
2610
|
if (e.kind === "text") return `${n}:${e.parts.map(({ part: e }) => e.type === "text" ? e.text : "").join("")}`;
|
|
2497
2611
|
if (e.kind === "reasoning" && e.part.type === "reasoning") return `${n}:${e.part.text}`;
|
|
@@ -2501,10 +2615,10 @@ function Ui(e, t) {
|
|
|
2501
2615
|
}
|
|
2502
2616
|
return e.kind === "file" && e.part.type === "file" ? `${n}:${e.part.url}:${e.part.mediaType}:${e.part.filename ?? ""}` : n;
|
|
2503
2617
|
}
|
|
2504
|
-
function
|
|
2618
|
+
function sa(e, t, n) {
|
|
2505
2619
|
return e.kind === "file" || e.kind === "source" ? !0 : e.kind === "tool" || e.kind === "dynamic-tool" ? w(e.part) ? e.part.state === "output-error" || e.part.state === "output-available" && e.part.preliminary !== !0 : !1 : t < n - 1;
|
|
2506
2620
|
}
|
|
2507
|
-
var
|
|
2621
|
+
var ca = c(function(e) {
|
|
2508
2622
|
let t = O(8), { segment: n } = e;
|
|
2509
2623
|
if (n.kind === "tool") {
|
|
2510
2624
|
let e;
|
|
@@ -2526,13 +2640,13 @@ var Gi = c(function(e) {
|
|
|
2526
2640
|
return t[6] === n ? e = t[7] : (e = /* @__PURE__ */ M(X.File, { segment: n }), t[6] = n, t[7] = e), e;
|
|
2527
2641
|
}
|
|
2528
2642
|
return null;
|
|
2529
|
-
},
|
|
2530
|
-
function
|
|
2643
|
+
}, la);
|
|
2644
|
+
function la(e, t) {
|
|
2531
2645
|
return e.complete && t.complete && e.cacheKey === t.cacheKey;
|
|
2532
2646
|
}
|
|
2533
|
-
function
|
|
2647
|
+
function ua(e) {
|
|
2534
2648
|
let t = O(11), { parts: n, className: r } = e, i;
|
|
2535
|
-
t[0] === n ? i = t[1] : (i =
|
|
2649
|
+
t[0] === n ? i = t[1] : (i = aa(n), t[0] = n, t[1] = i);
|
|
2536
2650
|
let a = i;
|
|
2537
2651
|
if (a.length === 0) return null;
|
|
2538
2652
|
let o;
|
|
@@ -2542,10 +2656,10 @@ function qi(e) {
|
|
|
2542
2656
|
let e;
|
|
2543
2657
|
t[6] === a.length ? e = t[7] : (e = (e, t) => {
|
|
2544
2658
|
let n = `${Z(e, t)}-${e.kind}`;
|
|
2545
|
-
return /* @__PURE__ */ M(
|
|
2659
|
+
return /* @__PURE__ */ M(ca, {
|
|
2546
2660
|
segment: e,
|
|
2547
|
-
cacheKey:
|
|
2548
|
-
complete:
|
|
2661
|
+
cacheKey: oa(e, t),
|
|
2662
|
+
complete: sa(e, t, a.length)
|
|
2549
2663
|
}, n);
|
|
2550
2664
|
}, t[6] = a.length, t[7] = e), s = a.map(e), t[4] = a, t[5] = s;
|
|
2551
2665
|
} else s = t[5];
|
|
@@ -2577,13 +2691,13 @@ function Q(e) {
|
|
|
2577
2691
|
}
|
|
2578
2692
|
//#endregion
|
|
2579
2693
|
//#region src/lib/chat/trajectory/trajectories/message-actions.tsx
|
|
2580
|
-
function
|
|
2694
|
+
function da() {
|
|
2581
2695
|
let { index: e } = K(), { messages: t } = W(), n = G();
|
|
2582
2696
|
return !(e === t.length - 1 && (n === "submitted" || n === "streaming" || n === "error"));
|
|
2583
2697
|
}
|
|
2584
|
-
function
|
|
2698
|
+
function fa(e) {
|
|
2585
2699
|
let t = O(5), { className: n, children: r } = e;
|
|
2586
|
-
if (!
|
|
2700
|
+
if (!da() || i.toArray(r).length === 0) return null;
|
|
2587
2701
|
let a;
|
|
2588
2702
|
t[0] === n ? a = t[1] : (a = k("mt-1 flex items-center gap-0.5", n), t[0] = n, t[1] = a);
|
|
2589
2703
|
let o;
|
|
@@ -2593,13 +2707,13 @@ function Yi(e) {
|
|
|
2593
2707
|
children: r
|
|
2594
2708
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
2595
2709
|
}
|
|
2596
|
-
function
|
|
2597
|
-
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] =
|
|
2710
|
+
function pa(e) {
|
|
2711
|
+
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] = Vr(), o = i ? "Copied" : "Copy message", s;
|
|
2598
2712
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2599
2713
|
let c;
|
|
2600
|
-
t[2] !== a || t[3] !== r ? (c = () => void a(
|
|
2714
|
+
t[2] !== a || t[3] !== r ? (c = () => void a(fi(r)), t[2] = a, t[3] = r, t[4] = c) : c = t[4];
|
|
2601
2715
|
let l;
|
|
2602
|
-
t[5] === i ? l = t[6] : (l = M(i ?
|
|
2716
|
+
t[5] === i ? l = t[6] : (l = M(i ? Re : Ke, { className: "size-3.5" }), t[5] = i, t[6] = l);
|
|
2603
2717
|
let u;
|
|
2604
2718
|
return t[7] !== o || t[8] !== s || t[9] !== c || t[10] !== l ? (u = /* @__PURE__ */ M(Q, {
|
|
2605
2719
|
"aria-label": o,
|
|
@@ -2608,13 +2722,13 @@ function Xi(e) {
|
|
|
2608
2722
|
icon: l
|
|
2609
2723
|
}), t[7] = o, t[8] = s, t[9] = c, t[10] = l, t[11] = u) : u = t[11], u;
|
|
2610
2724
|
}
|
|
2611
|
-
function
|
|
2725
|
+
function ma(e) {
|
|
2612
2726
|
let t = O(9), { className: n } = e, { message: r } = K(), { regenerate: i } = H(), a;
|
|
2613
2727
|
t[0] === n ? a = t[1] : (a = k("p-1.5", n), t[0] = n, t[1] = a);
|
|
2614
2728
|
let o;
|
|
2615
2729
|
t[2] !== r.id || t[3] !== i ? (o = () => void i({ messageId: r.id }), t[2] = r.id, t[3] = i, t[4] = o) : o = t[4];
|
|
2616
2730
|
let s;
|
|
2617
|
-
t[5] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(
|
|
2731
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(tt, { className: "size-3.5" }), t[5] = s) : s = t[5];
|
|
2618
2732
|
let c;
|
|
2619
2733
|
return t[6] !== a || t[7] !== o ? (c = /* @__PURE__ */ M(Q, {
|
|
2620
2734
|
"aria-label": "Regenerate response",
|
|
@@ -2623,13 +2737,13 @@ function Zi(e) {
|
|
|
2623
2737
|
icon: s
|
|
2624
2738
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2625
2739
|
}
|
|
2626
|
-
function
|
|
2627
|
-
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] =
|
|
2740
|
+
function ha(e) {
|
|
2741
|
+
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] = Vr(), o = i ? "Copied" : "Copy debug JSON", s;
|
|
2628
2742
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2629
2743
|
let c;
|
|
2630
2744
|
t[2] !== a || t[3] !== r ? (c = () => void a(JSON.stringify(r, null, 2)), t[2] = a, t[3] = r, t[4] = c) : c = t[4];
|
|
2631
2745
|
let l;
|
|
2632
|
-
t[5] === i ? l = t[6] : (l = M(i ?
|
|
2746
|
+
t[5] === i ? l = t[6] : (l = M(i ? Re : Le, { className: "size-3.5" }), t[5] = i, t[6] = l);
|
|
2633
2747
|
let u;
|
|
2634
2748
|
return t[7] !== o || t[8] !== s || t[9] !== c || t[10] !== l ? (u = /* @__PURE__ */ M(Q, {
|
|
2635
2749
|
"aria-label": o,
|
|
@@ -2640,7 +2754,7 @@ function Qi(e) {
|
|
|
2640
2754
|
}
|
|
2641
2755
|
//#endregion
|
|
2642
2756
|
//#region src/lib/chat/trajectory/trajectories/messages-error.tsx
|
|
2643
|
-
function
|
|
2757
|
+
function ga(e) {
|
|
2644
2758
|
let t = O(7), { onTryAgain: n, error: r } = e, i = r instanceof Error ? r.message : "An error occurred. Please try again.", a;
|
|
2645
2759
|
t[0] === i ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
2646
2760
|
className: "text-destructive text-sm",
|
|
@@ -2666,43 +2780,44 @@ function $i(e) {
|
|
|
2666
2780
|
})
|
|
2667
2781
|
}), t[4] = a, t[5] = o, t[6] = s) : s = t[6], s;
|
|
2668
2782
|
}
|
|
2669
|
-
function
|
|
2783
|
+
function _a(e) {
|
|
2670
2784
|
let t = O(3), { error: n, onRetry: r } = e;
|
|
2671
2785
|
if (!n || !r) return null;
|
|
2672
2786
|
let i;
|
|
2673
|
-
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
2787
|
+
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(ga, {
|
|
2674
2788
|
onTryAgain: r,
|
|
2675
2789
|
error: n
|
|
2676
2790
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2677
2791
|
}
|
|
2678
2792
|
//#endregion
|
|
2679
2793
|
//#region src/lib/chat/trajectory/trajectories/messages-shell.tsx
|
|
2680
|
-
function
|
|
2681
|
-
let t = O(
|
|
2682
|
-
t[0] !==
|
|
2794
|
+
function va(e) {
|
|
2795
|
+
let t = O(15), { messages: n, className: r, elements: i, citation: a, status: o, children: s } = e, c;
|
|
2796
|
+
t[0] !== a || t[1] !== i || t[2] !== n || t[3] !== o ? (c = {
|
|
2683
2797
|
messages: n,
|
|
2684
2798
|
elements: i,
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
t[6] === o ? u = t[7] : (u = /* @__PURE__ */ M("div", {
|
|
2691
|
-
className: "flex h-full min-h-0 flex-1 flex-col",
|
|
2692
|
-
children: o
|
|
2693
|
-
}), t[6] = o, t[7] = u);
|
|
2799
|
+
citation: a,
|
|
2800
|
+
status: o
|
|
2801
|
+
}, t[0] = a, t[1] = i, t[2] = n, t[3] = o, t[4] = c) : c = t[4];
|
|
2802
|
+
let l = c, u;
|
|
2803
|
+
t[5] === r ? u = t[6] : (u = k("flex h-full flex-col", r), t[5] = r, t[6] = u);
|
|
2694
2804
|
let d;
|
|
2695
|
-
t[
|
|
2696
|
-
className:
|
|
2697
|
-
children:
|
|
2698
|
-
}), t[
|
|
2805
|
+
t[7] === s ? d = t[8] : (d = /* @__PURE__ */ M("div", {
|
|
2806
|
+
className: "flex h-full min-h-0 flex-1 flex-col",
|
|
2807
|
+
children: s
|
|
2808
|
+
}), t[7] = s, t[8] = d);
|
|
2699
2809
|
let f;
|
|
2700
|
-
|
|
2701
|
-
|
|
2810
|
+
t[9] !== u || t[10] !== d ? (f = /* @__PURE__ */ M("div", {
|
|
2811
|
+
className: u,
|
|
2702
2812
|
children: d
|
|
2703
|
-
}), t[
|
|
2813
|
+
}), t[9] = u, t[10] = d, t[11] = f) : f = t[11];
|
|
2814
|
+
let p;
|
|
2815
|
+
return t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(Yn, {
|
|
2816
|
+
value: l,
|
|
2817
|
+
children: f
|
|
2818
|
+
}), t[12] = f, t[13] = l, t[14] = p) : p = t[14], p;
|
|
2704
2819
|
}
|
|
2705
|
-
function
|
|
2820
|
+
function ya(e) {
|
|
2706
2821
|
let t = O(5), { className: n, children: r } = e, i;
|
|
2707
2822
|
t[0] === n ? i = t[1] : (i = k("flex flex-col gap-4", n), t[0] = n, t[1] = i);
|
|
2708
2823
|
let a;
|
|
@@ -2711,7 +2826,7 @@ function na(e) {
|
|
|
2711
2826
|
children: r
|
|
2712
2827
|
}), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
|
|
2713
2828
|
}
|
|
2714
|
-
function
|
|
2829
|
+
function ba(e) {
|
|
2715
2830
|
let t = O(9), { message: n, index: r, className: i, children: a } = e, o;
|
|
2716
2831
|
t[0] !== r || t[1] !== n ? (o = {
|
|
2717
2832
|
message: n,
|
|
@@ -2723,14 +2838,14 @@ function ra(e) {
|
|
|
2723
2838
|
children: a
|
|
2724
2839
|
}), t[3] = a, t[4] = i, t[5] = c) : c = t[5];
|
|
2725
2840
|
let l;
|
|
2726
|
-
return t[6] !== c || t[7] !== s ? (l = /* @__PURE__ */ M(
|
|
2841
|
+
return t[6] !== c || t[7] !== s ? (l = /* @__PURE__ */ M(Xn, {
|
|
2727
2842
|
value: s,
|
|
2728
2843
|
children: c
|
|
2729
2844
|
}), t[6] = c, t[7] = s, t[8] = l) : l = t[8], l;
|
|
2730
2845
|
}
|
|
2731
2846
|
//#endregion
|
|
2732
2847
|
//#region src/lib/components/PendingToolInput.tsx
|
|
2733
|
-
function
|
|
2848
|
+
function xa() {
|
|
2734
2849
|
let e = O(5), { registry: t } = z(), n = H().messages, r;
|
|
2735
2850
|
if (e[0] !== n || e[1] !== t) {
|
|
2736
2851
|
bb0: {
|
|
@@ -2738,7 +2853,7 @@ function ia() {
|
|
|
2738
2853
|
r = null;
|
|
2739
2854
|
break bb0;
|
|
2740
2855
|
}
|
|
2741
|
-
let i = n.findLast(
|
|
2856
|
+
let i = n.findLast(Sa);
|
|
2742
2857
|
if (!i) {
|
|
2743
2858
|
r = null;
|
|
2744
2859
|
break bb0;
|
|
@@ -2757,12 +2872,12 @@ function ia() {
|
|
|
2757
2872
|
} else r = e[2];
|
|
2758
2873
|
return r;
|
|
2759
2874
|
}
|
|
2760
|
-
function
|
|
2875
|
+
function Sa(e) {
|
|
2761
2876
|
let { role: t } = e;
|
|
2762
2877
|
return t === "assistant";
|
|
2763
2878
|
}
|
|
2764
|
-
function
|
|
2765
|
-
let t = O(10), { children: n, className: i } = e, a =
|
|
2879
|
+
function Ca(e) {
|
|
2880
|
+
let t = O(10), { children: n, className: i } = e, a = xa(), o = a?.entry.component, s = a ? "hidden" : "visible", c;
|
|
2766
2881
|
t[0] !== n || t[1] !== s ? (c = /* @__PURE__ */ M(r, {
|
|
2767
2882
|
mode: s,
|
|
2768
2883
|
children: n
|
|
@@ -2777,12 +2892,12 @@ function oa(e) {
|
|
|
2777
2892
|
}
|
|
2778
2893
|
//#endregion
|
|
2779
2894
|
//#region src/lib/chat/trajectory/trajectories/thinking-hint.ts
|
|
2780
|
-
function
|
|
2895
|
+
function wa(e, t) {
|
|
2781
2896
|
if (e === "error" || e === "ready" || !t) return null;
|
|
2782
2897
|
if (t.role !== "assistant") return "Thinking...";
|
|
2783
2898
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2784
2899
|
let n = t.parts[e];
|
|
2785
|
-
if (C(n) &&
|
|
2900
|
+
if (C(n) && Wi(n) && n.text) return n.text;
|
|
2786
2901
|
}
|
|
2787
2902
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2788
2903
|
let n = t.parts[e];
|
|
@@ -2806,7 +2921,7 @@ function sa(e, t) {
|
|
|
2806
2921
|
}
|
|
2807
2922
|
//#endregion
|
|
2808
2923
|
//#region src/lib/chat/trajectory/trajectories/timeline-dot.tsx
|
|
2809
|
-
function
|
|
2924
|
+
function Ta(e) {
|
|
2810
2925
|
let t = O(5), { isLast: n } = e, r = n !== void 0 && n, i;
|
|
2811
2926
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M("span", { className: "bg-muted-foreground/50 z-10 mt-1 size-2 shrink-0 rounded-full" }), t[0] = i) : i = t[0];
|
|
2812
2927
|
let a;
|
|
@@ -2819,7 +2934,7 @@ function ca(e) {
|
|
|
2819
2934
|
}
|
|
2820
2935
|
//#endregion
|
|
2821
2936
|
//#region src/lib/chat/trajectory/trajectories/timeline-item.tsx
|
|
2822
|
-
function
|
|
2937
|
+
function Ea(e) {
|
|
2823
2938
|
let t = O(6), { marker: n, children: r, className: i } = e, a;
|
|
2824
2939
|
t[0] === i ? a = t[1] : (a = k("relative z-0 flex gap-3 pl-5", i), t[0] = i, t[1] = a);
|
|
2825
2940
|
let o;
|
|
@@ -2830,15 +2945,15 @@ function la(e) {
|
|
|
2830
2945
|
}
|
|
2831
2946
|
//#endregion
|
|
2832
2947
|
//#region src/lib/chat/trajectory/trajectories/trajectory-thinking.tsx
|
|
2833
|
-
function
|
|
2834
|
-
let e = O(6), t = G(), { messages: n } = W(), r =
|
|
2835
|
-
e[0] !== t || e[1] !== i ? (a =
|
|
2948
|
+
function Da() {
|
|
2949
|
+
let e = O(6), t = G(), { messages: n } = W(), r = xa(), i = n[n.length - 1], a;
|
|
2950
|
+
e[0] !== t || e[1] !== i ? (a = wa(t, i), e[0] = t, e[1] = i, e[2] = a) : a = e[2];
|
|
2836
2951
|
let o = a;
|
|
2837
2952
|
if (!o || r) return null;
|
|
2838
2953
|
let s;
|
|
2839
|
-
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(
|
|
2954
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(Ta, { isLast: !0 }), e[3] = s) : s = e[3];
|
|
2840
2955
|
let c;
|
|
2841
|
-
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(
|
|
2956
|
+
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(Ea, {
|
|
2842
2957
|
className: "mt-2",
|
|
2843
2958
|
marker: s,
|
|
2844
2959
|
children: /* @__PURE__ */ M("span", {
|
|
@@ -2859,7 +2974,7 @@ var $ = [
|
|
|
2859
2974
|
"reasoningTokens",
|
|
2860
2975
|
"cachedInputTokens",
|
|
2861
2976
|
"totalTokens"
|
|
2862
|
-
],
|
|
2977
|
+
], Oa = {
|
|
2863
2978
|
inputTokens: [["inputTokens"], ["raw", "prompt_tokens"]],
|
|
2864
2979
|
outputTokens: [["outputTokens"], ["raw", "completion_tokens"]],
|
|
2865
2980
|
reasoningTokens: [
|
|
@@ -2883,7 +2998,7 @@ var $ = [
|
|
|
2883
2998
|
],
|
|
2884
2999
|
totalTokens: [["totalTokens"], ["raw", "total_tokens"]]
|
|
2885
3000
|
};
|
|
2886
|
-
function
|
|
3001
|
+
function ka(e) {
|
|
2887
3002
|
if (typeof e == "number" && Number.isFinite(e) && e >= 0) return e;
|
|
2888
3003
|
if (typeof e == "string" && e.trim().length > 0) {
|
|
2889
3004
|
let t = Number(e);
|
|
@@ -2891,7 +3006,7 @@ function fa(e) {
|
|
|
2891
3006
|
}
|
|
2892
3007
|
return null;
|
|
2893
3008
|
}
|
|
2894
|
-
function
|
|
3009
|
+
function Aa(e) {
|
|
2895
3010
|
if (!e || typeof e != "object") return null;
|
|
2896
3011
|
let t = {
|
|
2897
3012
|
inputTokens: null,
|
|
@@ -2900,8 +3015,8 @@ function pa(e) {
|
|
|
2900
3015
|
cachedInputTokens: null,
|
|
2901
3016
|
totalTokens: null
|
|
2902
3017
|
};
|
|
2903
|
-
for (let n of $) for (let r of
|
|
2904
|
-
let i =
|
|
3018
|
+
for (let n of $) for (let r of Oa[n]) {
|
|
3019
|
+
let i = ka(Dt(e, r));
|
|
2905
3020
|
if (i !== null) {
|
|
2906
3021
|
t[n] = i;
|
|
2907
3022
|
break;
|
|
@@ -2909,10 +3024,10 @@ function pa(e) {
|
|
|
2909
3024
|
}
|
|
2910
3025
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
2911
3026
|
}
|
|
2912
|
-
function
|
|
2913
|
-
return D(e) ?
|
|
3027
|
+
function ja(e) {
|
|
3028
|
+
return D(e) ? Aa(e.totalUsage ?? e.usage) : null;
|
|
2914
3029
|
}
|
|
2915
|
-
function
|
|
3030
|
+
function Ma(e, t) {
|
|
2916
3031
|
let n = {
|
|
2917
3032
|
inputTokens: null,
|
|
2918
3033
|
outputTokens: null,
|
|
@@ -2934,7 +3049,7 @@ function ha(e, t) {
|
|
|
2934
3049
|
}
|
|
2935
3050
|
return $.some((e) => n[e] !== null) ? n : null;
|
|
2936
3051
|
}
|
|
2937
|
-
function
|
|
3052
|
+
function Na(e) {
|
|
2938
3053
|
if (e.length === 0) return null;
|
|
2939
3054
|
let t = {
|
|
2940
3055
|
inputTokens: null,
|
|
@@ -2953,32 +3068,32 @@ function ga(e) {
|
|
|
2953
3068
|
}
|
|
2954
3069
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
2955
3070
|
}
|
|
2956
|
-
function
|
|
3071
|
+
function Pa(e) {
|
|
2957
3072
|
let t = {}, n = [], r = null, i = null;
|
|
2958
3073
|
for (let a of e) {
|
|
2959
3074
|
if (a.role !== "assistant") continue;
|
|
2960
|
-
let e = D(a.metadata) ? a.metadata : void 0, o =
|
|
3075
|
+
let e = D(a.metadata) ? a.metadata : void 0, o = Aa(e?.usage), s = Aa(e?.totalUsage), c = o ?? (s ? Ma(s, r) : null);
|
|
2961
3076
|
c && (t[a.id] = c, n.push(c)), s && (i = s, r = s);
|
|
2962
3077
|
}
|
|
2963
3078
|
return {
|
|
2964
3079
|
assistantUsageByMessageId: t,
|
|
2965
|
-
chatUsageSummary: i ??
|
|
3080
|
+
chatUsageSummary: i ?? Na(n)
|
|
2966
3081
|
};
|
|
2967
3082
|
}
|
|
2968
|
-
function
|
|
3083
|
+
function Fa() {
|
|
2969
3084
|
let e = O(2), t = H(), n;
|
|
2970
|
-
return e[0] === t.messages ? n = e[1] : (n =
|
|
3085
|
+
return e[0] === t.messages ? n = e[1] : (n = Pa(t.messages), e[0] = t.messages, e[1] = n), n;
|
|
2971
3086
|
}
|
|
2972
|
-
function
|
|
2973
|
-
return
|
|
3087
|
+
function Ia(e) {
|
|
3088
|
+
return kt(e);
|
|
2974
3089
|
}
|
|
2975
|
-
function
|
|
2976
|
-
let t = [`↑ ${
|
|
2977
|
-
return e.totalTokens !== null && t.push(`· ${
|
|
3090
|
+
function La(e) {
|
|
3091
|
+
let t = [`↑ ${Ot(e.inputTokens)}`, `↓ ${Ot(e.outputTokens)}`];
|
|
3092
|
+
return e.totalTokens !== null && t.push(`· ${kt(e.totalTokens)} tokens`), e.cachedInputTokens !== null && e.cachedInputTokens > 0 && t.push(`(${Ot(e.cachedInputTokens)} cached)`), t.join(" ");
|
|
2978
3093
|
}
|
|
2979
3094
|
//#endregion
|
|
2980
3095
|
//#region src/lib/chat/zukhruf-chat-transport.ts
|
|
2981
|
-
var
|
|
3096
|
+
var Ra = "x-upload-filename", za = P.strictObject({
|
|
2982
3097
|
path: P.string().startsWith("/"),
|
|
2983
3098
|
name: P.string().min(1),
|
|
2984
3099
|
mediaType: P.enum([
|
|
@@ -2996,19 +3111,19 @@ var xa = "x-upload-filename", Sa = P.strictObject({
|
|
|
2996
3111
|
]),
|
|
2997
3112
|
size: P.int().nonnegative(),
|
|
2998
3113
|
url: P.url()
|
|
2999
|
-
}),
|
|
3114
|
+
}), Ba = class extends _ {
|
|
3000
3115
|
sessionsApi;
|
|
3001
3116
|
request;
|
|
3002
3117
|
constructor({ api: e, fetch: t = (e, t) => globalThis.fetch(e, t), tools: n = {}, elements: r = [] }) {
|
|
3003
|
-
let i =
|
|
3118
|
+
let i = Wa(e), a = r.map(se);
|
|
3004
3119
|
super({
|
|
3005
3120
|
api: i,
|
|
3006
3121
|
fetch: async (e, n) => {
|
|
3007
3122
|
let r = await t(e, n);
|
|
3008
3123
|
if ((n?.method ?? "GET").toUpperCase() !== "POST" || !r.ok) return r;
|
|
3009
3124
|
let i = await r.json();
|
|
3010
|
-
if (!
|
|
3011
|
-
let a =
|
|
3125
|
+
if (!Ga(i)) throw Error("Zukhruf returned an invalid accepted-turn response");
|
|
3126
|
+
let a = Wa(String(e)), o = decodeURIComponent(a.slice(a.lastIndexOf("/") + 1));
|
|
3012
3127
|
if (i.sessionId !== o) throw Error("Zukhruf returned a different session ID");
|
|
3013
3128
|
let s = n?.signal;
|
|
3014
3129
|
return s?.addEventListener("abort", () => {
|
|
@@ -3023,7 +3138,7 @@ var xa = "x-upload-filename", Sa = P.strictObject({
|
|
|
3023
3138
|
let o = t[t.length - 1];
|
|
3024
3139
|
if (!o) throw Error("A message is required");
|
|
3025
3140
|
return {
|
|
3026
|
-
api:
|
|
3141
|
+
api: Va(i, e),
|
|
3027
3142
|
body: {
|
|
3028
3143
|
sessionId: e,
|
|
3029
3144
|
message: o,
|
|
@@ -3034,50 +3149,50 @@ var xa = "x-upload-filename", Sa = P.strictObject({
|
|
|
3034
3149
|
};
|
|
3035
3150
|
},
|
|
3036
3151
|
prepareReconnectToStreamRequest: ({ headers: e, id: t }) => ({
|
|
3037
|
-
api: `${
|
|
3152
|
+
api: `${Va(i, t)}/stream`,
|
|
3038
3153
|
headers: e
|
|
3039
3154
|
})
|
|
3040
3155
|
}), this.sessionsApi = i, this.request = t;
|
|
3041
3156
|
}
|
|
3042
3157
|
async uploadFile(e, t) {
|
|
3043
|
-
let n = await this.request(`${
|
|
3158
|
+
let n = await this.request(`${Va(this.sessionsApi, e)}/uploads`, {
|
|
3044
3159
|
method: "POST",
|
|
3045
3160
|
headers: {
|
|
3046
3161
|
"content-type": t.type,
|
|
3047
|
-
[
|
|
3162
|
+
[Ra]: encodeURIComponent(t.name)
|
|
3048
3163
|
},
|
|
3049
3164
|
body: t
|
|
3050
3165
|
});
|
|
3051
|
-
if (!n.ok) throw Error(await
|
|
3052
|
-
let r =
|
|
3166
|
+
if (!n.ok) throw Error(await Ha(n, t));
|
|
3167
|
+
let r = za.safeParse(await n.json());
|
|
3053
3168
|
if (!r.success) throw Error("Zukhruf returned an invalid upload response");
|
|
3054
3169
|
return r.data;
|
|
3055
3170
|
}
|
|
3056
3171
|
};
|
|
3057
|
-
function
|
|
3172
|
+
function Va(e, t) {
|
|
3058
3173
|
return `${e}/${encodeURIComponent(t)}`;
|
|
3059
3174
|
}
|
|
3060
|
-
async function
|
|
3061
|
-
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r =
|
|
3175
|
+
async function Ha(e, t) {
|
|
3176
|
+
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r = Ua(await e.json().catch((e) => {
|
|
3062
3177
|
if (e instanceof SyntaxError) return null;
|
|
3063
3178
|
throw e;
|
|
3064
3179
|
}));
|
|
3065
3180
|
return r ? `${n}: ${r}` : n;
|
|
3066
3181
|
}
|
|
3067
|
-
function
|
|
3182
|
+
function Ua(e) {
|
|
3068
3183
|
if (typeof e != "object" || !e) return null;
|
|
3069
3184
|
let t = "cause" in e && typeof e.cause == "object" && e.cause !== null ? e.cause : null;
|
|
3070
3185
|
return [t && "code" in t && typeof t.code == "string" ? t.code : null, t && "detail" in t && typeof t.detail == "string" ? t.detail : "error" in e && typeof e.error == "string" ? e.error : null].filter((e) => e !== null).join(" — ") || null;
|
|
3071
3186
|
}
|
|
3072
|
-
function
|
|
3187
|
+
function Wa(e) {
|
|
3073
3188
|
return e.replace(/\/$/, "");
|
|
3074
3189
|
}
|
|
3075
|
-
function
|
|
3190
|
+
function Ga(e) {
|
|
3076
3191
|
return typeof e == "object" && !!e && "ok" in e && e.ok === !0 && "sessionId" in e && typeof e.sessionId == "string" && "turnId" in e && typeof e.turnId == "string";
|
|
3077
3192
|
}
|
|
3078
3193
|
//#endregion
|
|
3079
3194
|
//#region src/lib/chat/trajectory/trajectories/collapsible-disclosure.tsx
|
|
3080
|
-
function
|
|
3195
|
+
function Ka(e) {
|
|
3081
3196
|
let t = O(24), { label: n, open: r, onOpenChange: i, children: a, className: o, triggerClassName: s, contentClassName: c, chevronClassName: l } = e, u;
|
|
3082
3197
|
t[0] === s ? u = t[1] : (u = k("flex items-center font-mono", s), t[0] = s, t[1] = u);
|
|
3083
3198
|
let d;
|
|
@@ -3088,7 +3203,7 @@ function ka(e) {
|
|
|
3088
3203
|
let f = r && "rotate-180", p;
|
|
3089
3204
|
t[4] !== l || t[5] !== f ? (p = k("size-4 transition-transform", l, f), t[4] = l, t[5] = f, t[6] = p) : p = t[6];
|
|
3090
3205
|
let m;
|
|
3091
|
-
t[7] === p ? m = t[8] : (m = /* @__PURE__ */ M(
|
|
3206
|
+
t[7] === p ? m = t[8] : (m = /* @__PURE__ */ M(Ve, { className: p }), t[7] = p, t[8] = m);
|
|
3092
3207
|
let h;
|
|
3093
3208
|
t[9] === n ? h = t[10] : (h = /* @__PURE__ */ M("span", { children: n }), t[9] = n, t[10] = h);
|
|
3094
3209
|
let g;
|
|
@@ -3111,19 +3226,19 @@ function ka(e) {
|
|
|
3111
3226
|
}
|
|
3112
3227
|
//#endregion
|
|
3113
3228
|
//#region src/lib/chat/trajectory/trajectories/user-message.tsx
|
|
3114
|
-
function
|
|
3229
|
+
function qa(e) {
|
|
3115
3230
|
let t = O(7), { metadata: n } = e;
|
|
3116
3231
|
if (!n) return null;
|
|
3117
3232
|
let r, i, a;
|
|
3118
3233
|
if (t[0] !== n) {
|
|
3119
3234
|
a = Symbol.for("react.early_return_sentinel");
|
|
3120
3235
|
bb0: {
|
|
3121
|
-
let e =
|
|
3236
|
+
let e = ja(n);
|
|
3122
3237
|
if (!e) {
|
|
3123
3238
|
a = null;
|
|
3124
3239
|
break bb0;
|
|
3125
3240
|
}
|
|
3126
|
-
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i =
|
|
3241
|
+
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i = La(e);
|
|
3127
3242
|
}
|
|
3128
3243
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a;
|
|
3129
3244
|
} else r = t[1], i = t[2], a = t[3];
|
|
@@ -3134,27 +3249,27 @@ function Aa(e) {
|
|
|
3134
3249
|
children: i
|
|
3135
3250
|
}), t[4] = r, t[5] = i, t[6] = o) : o = t[6], o;
|
|
3136
3251
|
}
|
|
3137
|
-
function
|
|
3252
|
+
function Ja(e, t) {
|
|
3138
3253
|
return D(e.metadata) ? e.metadata[t] : void 0;
|
|
3139
3254
|
}
|
|
3140
|
-
function
|
|
3141
|
-
let t =
|
|
3255
|
+
function Ya(e) {
|
|
3256
|
+
let t = Ja(e, "reminders");
|
|
3142
3257
|
return Array.isArray(t) ? t.filter((e) => {
|
|
3143
3258
|
if (!e || typeof e != "object") return !1;
|
|
3144
3259
|
let t = e;
|
|
3145
3260
|
return typeof t.id == "string" && t.id.length > 0 && typeof t.text == "string" && t.text.trim().length > 0;
|
|
3146
3261
|
}) : [];
|
|
3147
3262
|
}
|
|
3148
|
-
function
|
|
3149
|
-
let t =
|
|
3263
|
+
function Xa(e) {
|
|
3264
|
+
let t = Ja(e, "uploads");
|
|
3150
3265
|
return Array.isArray(t) ? t.flatMap((e) => {
|
|
3151
|
-
let t =
|
|
3266
|
+
let t = za.safeParse(e);
|
|
3152
3267
|
return t.success ? [t.data] : [];
|
|
3153
3268
|
}) : [];
|
|
3154
3269
|
}
|
|
3155
|
-
function
|
|
3270
|
+
function Za(e) {
|
|
3156
3271
|
let t = O(7), { text: n } = e, [r, i] = g(!1), a;
|
|
3157
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i(
|
|
3272
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i(Qa), t[0] = a) : a = t[0];
|
|
3158
3273
|
let o = !r && "line-clamp-3", s;
|
|
3159
3274
|
t[1] === o ? s = t[2] : (s = k("hover:text-foreground w-full cursor-pointer text-left whitespace-pre-wrap", o), t[1] = o, t[2] = s);
|
|
3160
3275
|
let c;
|
|
@@ -3166,21 +3281,21 @@ function Pa(e) {
|
|
|
3166
3281
|
children: n
|
|
3167
3282
|
}) }), t[3] = r, t[4] = s, t[5] = n, t[6] = c) : c = t[6], c;
|
|
3168
3283
|
}
|
|
3169
|
-
function
|
|
3284
|
+
function Qa(e) {
|
|
3170
3285
|
return !e;
|
|
3171
3286
|
}
|
|
3172
|
-
function
|
|
3287
|
+
function $a(e) {
|
|
3173
3288
|
let t = O(8), { reminders: n } = e, [r, i] = g(!1);
|
|
3174
3289
|
if (n.length === 0) return null;
|
|
3175
3290
|
let a = `${n.length} reminder${n.length === 1 ? "" : "s"} attached`, o;
|
|
3176
|
-
t[0] === n ? o = t[1] : (o = n.map(
|
|
3291
|
+
t[0] === n ? o = t[1] : (o = n.map(eo), t[0] = n, t[1] = o);
|
|
3177
3292
|
let s;
|
|
3178
3293
|
t[2] === o ? s = t[3] : (s = /* @__PURE__ */ M("ul", {
|
|
3179
3294
|
className: "border-ink-12 text-muted-foreground space-y-1 border-l pl-3 text-xs",
|
|
3180
3295
|
children: o
|
|
3181
3296
|
}), t[2] = o, t[3] = s);
|
|
3182
3297
|
let c;
|
|
3183
|
-
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(
|
|
3298
|
+
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(Ka, {
|
|
3184
3299
|
label: a,
|
|
3185
3300
|
open: r,
|
|
3186
3301
|
onOpenChange: i,
|
|
@@ -3191,10 +3306,10 @@ function Ia(e) {
|
|
|
3191
3306
|
children: s
|
|
3192
3307
|
}), t[4] = a, t[5] = r, t[6] = s, t[7] = c) : c = t[7], c;
|
|
3193
3308
|
}
|
|
3194
|
-
function
|
|
3195
|
-
return /* @__PURE__ */ M(
|
|
3309
|
+
function eo(e) {
|
|
3310
|
+
return /* @__PURE__ */ M(Za, { text: e.text }, e.id);
|
|
3196
3311
|
}
|
|
3197
|
-
function
|
|
3312
|
+
function to(e) {
|
|
3198
3313
|
let t = O(19), { upload: n } = e;
|
|
3199
3314
|
if (n.mediaType.startsWith("video/")) {
|
|
3200
3315
|
let e;
|
|
@@ -3260,17 +3375,17 @@ function Ra(e) {
|
|
|
3260
3375
|
})
|
|
3261
3376
|
}), t[16] = n.name, t[17] = n.url, t[18] = r) : r = t[18], r;
|
|
3262
3377
|
}
|
|
3263
|
-
function
|
|
3378
|
+
function no(e) {
|
|
3264
3379
|
let t = O(13), { message: n } = e, r, i, a, o, s, c;
|
|
3265
3380
|
if (t[0] !== n) {
|
|
3266
3381
|
c = Symbol.for("react.early_return_sentinel");
|
|
3267
3382
|
bb0: {
|
|
3268
|
-
let e =
|
|
3383
|
+
let e = Xa(n);
|
|
3269
3384
|
if (e.length === 0) {
|
|
3270
3385
|
c = null;
|
|
3271
3386
|
break bb0;
|
|
3272
3387
|
}
|
|
3273
|
-
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(
|
|
3388
|
+
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(ro);
|
|
3274
3389
|
}
|
|
3275
3390
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a, t[4] = o, t[5] = s, t[6] = c;
|
|
3276
3391
|
} else r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], c = t[6];
|
|
@@ -3283,23 +3398,23 @@ function za(e) {
|
|
|
3283
3398
|
children: s
|
|
3284
3399
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o, t[11] = s, t[12] = l) : l = t[12], l;
|
|
3285
3400
|
}
|
|
3286
|
-
function
|
|
3401
|
+
function ro(e) {
|
|
3287
3402
|
return /* @__PURE__ */ M("div", {
|
|
3288
3403
|
role: "listitem",
|
|
3289
3404
|
"data-slot": "attachment",
|
|
3290
|
-
children: /* @__PURE__ */ M(
|
|
3405
|
+
children: /* @__PURE__ */ M(to, { upload: e })
|
|
3291
3406
|
}, e.path);
|
|
3292
3407
|
}
|
|
3293
|
-
function
|
|
3408
|
+
function io(e) {
|
|
3294
3409
|
let t = O(10), { body: n, reminders: r, metadata: i } = e, a;
|
|
3295
3410
|
t[0] === n ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
3296
3411
|
className: "flex-1 space-y-3",
|
|
3297
3412
|
children: n
|
|
3298
3413
|
}), t[0] = n, t[1] = a);
|
|
3299
3414
|
let o;
|
|
3300
|
-
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(
|
|
3415
|
+
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M($a, { reminders: r }), t[2] = r, t[3] = o);
|
|
3301
3416
|
let s;
|
|
3302
|
-
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(
|
|
3417
|
+
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(qa, { metadata: i }), t[4] = i, t[5] = s);
|
|
3303
3418
|
let c;
|
|
3304
3419
|
return t[6] !== a || t[7] !== o || t[8] !== s ? (c = /* @__PURE__ */ N("div", {
|
|
3305
3420
|
className: "bg-secondary flex max-w-[80%] flex-col gap-3 rounded-lg p-3",
|
|
@@ -3310,13 +3425,13 @@ function Va(e) {
|
|
|
3310
3425
|
]
|
|
3311
3426
|
}), t[6] = a, t[7] = o, t[8] = s, t[9] = c) : c = t[9], c;
|
|
3312
3427
|
}
|
|
3313
|
-
function
|
|
3428
|
+
function ao(e) {
|
|
3314
3429
|
let t = O(28), { message: n } = e;
|
|
3315
|
-
|
|
3430
|
+
Ja(n, "reminders");
|
|
3316
3431
|
let r;
|
|
3317
3432
|
t[0] === n ? r = t[1] : (r = ee(n), t[0] = n, t[1] = r);
|
|
3318
3433
|
let i;
|
|
3319
|
-
t[2] === n ? i = t[3] : (i =
|
|
3434
|
+
t[2] === n ? i = t[3] : (i = Ya(n), t[2] = n, t[3] = i);
|
|
3320
3435
|
let a;
|
|
3321
3436
|
t[4] !== r || t[5] !== i ? (a = {
|
|
3322
3437
|
message: r,
|
|
@@ -3324,34 +3439,36 @@ function Ha(e) {
|
|
|
3324
3439
|
}, t[4] = r, t[5] = i, t[6] = a) : a = t[6];
|
|
3325
3440
|
let { message: o, reminders: s } = a, c;
|
|
3326
3441
|
if (t[7] !== n) {
|
|
3327
|
-
let e =
|
|
3442
|
+
let e = Ja(n, "alias");
|
|
3328
3443
|
c = typeof e == "string" && e.trim().length > 0 ? e : void 0, t[7] = n, t[8] = c;
|
|
3329
3444
|
} else c = t[8];
|
|
3330
3445
|
let l = c;
|
|
3331
3446
|
if (l) {
|
|
3332
3447
|
let e;
|
|
3333
3448
|
t[9] === l ? e = t[10] : (e = /* @__PURE__ */ M("div", {
|
|
3449
|
+
dir: "auto",
|
|
3334
3450
|
className: "text-sm whitespace-pre-wrap",
|
|
3335
3451
|
children: l
|
|
3336
3452
|
}), t[9] = l, t[10] = e);
|
|
3337
3453
|
let n;
|
|
3338
|
-
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(
|
|
3454
|
+
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(io, {
|
|
3339
3455
|
reminders: s,
|
|
3340
3456
|
body: e
|
|
3341
3457
|
}), t[11] = s, t[12] = e, t[13] = n) : n = t[13], n;
|
|
3342
3458
|
}
|
|
3343
3459
|
let u;
|
|
3344
|
-
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(
|
|
3460
|
+
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(no, { message: o }), t[14] = o, t[15] = u);
|
|
3345
3461
|
let d = o.metadata, f;
|
|
3346
3462
|
if (t[16] !== o.id || t[17] !== o.parts) {
|
|
3347
3463
|
let e;
|
|
3348
3464
|
t[19] === o.id ? e = t[20] : (e = (e, t) => e.type === "text" ? /* @__PURE__ */ M("div", {
|
|
3465
|
+
dir: "auto",
|
|
3349
3466
|
className: "text-sm whitespace-pre-wrap",
|
|
3350
|
-
children: /* @__PURE__ */ M(
|
|
3467
|
+
children: /* @__PURE__ */ M(wt, { text: e.text })
|
|
3351
3468
|
}, `${o.id}-${t}-text`) : null, t[19] = o.id, t[20] = e), f = o.parts.map(e), t[16] = o.id, t[17] = o.parts, t[18] = f;
|
|
3352
3469
|
} else f = t[18];
|
|
3353
3470
|
let p;
|
|
3354
|
-
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(
|
|
3471
|
+
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(io, {
|
|
3355
3472
|
reminders: s,
|
|
3356
3473
|
metadata: d,
|
|
3357
3474
|
body: f
|
|
@@ -3362,11 +3479,11 @@ function Ha(e) {
|
|
|
3362
3479
|
children: [u, p]
|
|
3363
3480
|
}), t[25] = u, t[26] = p, t[27] = m) : m = t[27], m;
|
|
3364
3481
|
}
|
|
3365
|
-
var
|
|
3482
|
+
var oo = c(function(e) {
|
|
3366
3483
|
let t = O(7), { className: n } = e, { message: r } = K(), i;
|
|
3367
3484
|
t[0] === n ? i = t[1] : (i = k("flex justify-end", n), t[0] = n, t[1] = i);
|
|
3368
3485
|
let a;
|
|
3369
|
-
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(
|
|
3486
|
+
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(ao, { message: r }), t[2] = r, t[3] = a);
|
|
3370
3487
|
let o;
|
|
3371
3488
|
return t[4] !== i || t[5] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
3372
3489
|
className: i,
|
|
@@ -3375,20 +3492,20 @@ var Ua = c(function(e) {
|
|
|
3375
3492
|
});
|
|
3376
3493
|
//#endregion
|
|
3377
3494
|
//#region src/lib/chat/trajectory/trajectories/compact-messages.tsx
|
|
3378
|
-
function
|
|
3379
|
-
return e.kind === "tool" ? !
|
|
3495
|
+
function so(e) {
|
|
3496
|
+
return e.kind === "tool" ? !mi(e.part) : e.kind === "dynamic-tool" || e.kind === "reasoning";
|
|
3380
3497
|
}
|
|
3381
|
-
function
|
|
3498
|
+
function co(e, t) {
|
|
3382
3499
|
return e.kind === "tool" ? !0 : e.kind === "reasoning" || e.kind === "dynamic-tool" ? !!t : !1;
|
|
3383
3500
|
}
|
|
3384
|
-
function
|
|
3385
|
-
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !
|
|
3501
|
+
function lo(e) {
|
|
3502
|
+
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !Wi(e));
|
|
3386
3503
|
}
|
|
3387
|
-
function
|
|
3504
|
+
function uo(e, t) {
|
|
3388
3505
|
let n = [];
|
|
3389
3506
|
for (let r = 0; r < e.length; r++) {
|
|
3390
3507
|
let i = e[r];
|
|
3391
|
-
if (!
|
|
3508
|
+
if (!so(i)) {
|
|
3392
3509
|
n.push({
|
|
3393
3510
|
kind: "segment",
|
|
3394
3511
|
segment: i,
|
|
@@ -3397,25 +3514,25 @@ function qa(e, t) {
|
|
|
3397
3514
|
continue;
|
|
3398
3515
|
}
|
|
3399
3516
|
let a = [], o = r;
|
|
3400
|
-
for (; r < e.length &&
|
|
3517
|
+
for (; r < e.length && so(e[r]);) {
|
|
3401
3518
|
let n = e[r];
|
|
3402
|
-
|
|
3519
|
+
co(n, t) && a.push({ segment: n }), r++;
|
|
3403
3520
|
}
|
|
3404
3521
|
r--, a.length > 0 && n.push({
|
|
3405
3522
|
kind: "group",
|
|
3406
3523
|
items: a,
|
|
3407
|
-
hasLaterText: e.slice(r + 1).some((e) =>
|
|
3524
|
+
hasLaterText: e.slice(r + 1).some((e) => lo(e)),
|
|
3408
3525
|
firstIndex: o
|
|
3409
3526
|
});
|
|
3410
3527
|
}
|
|
3411
3528
|
return n;
|
|
3412
3529
|
}
|
|
3413
|
-
function
|
|
3530
|
+
function fo(e) {
|
|
3414
3531
|
if (e.kind !== "tool" && e.kind !== "dynamic-tool") return;
|
|
3415
3532
|
let { part: t } = e;
|
|
3416
3533
|
return w(t) ? t.state : void 0;
|
|
3417
3534
|
}
|
|
3418
|
-
function
|
|
3535
|
+
function po({ groupStatus: e, labelCount: t }) {
|
|
3419
3536
|
return e === "running" ? {
|
|
3420
3537
|
title: "text-info",
|
|
3421
3538
|
detail: "text-info/80",
|
|
@@ -3438,20 +3555,20 @@ function Ya({ groupStatus: e, labelCount: t }) {
|
|
|
3438
3555
|
chevron: "text-muted-foreground"
|
|
3439
3556
|
};
|
|
3440
3557
|
}
|
|
3441
|
-
function
|
|
3558
|
+
function mo(e) {
|
|
3442
3559
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
3443
3560
|
}
|
|
3444
|
-
function
|
|
3561
|
+
function ho(e, t = 80) {
|
|
3445
3562
|
let n = e.replace(/\s+/g, " ").trim();
|
|
3446
3563
|
return n.length <= t ? n : `${n.slice(0, t - 3).trimEnd()}...`;
|
|
3447
3564
|
}
|
|
3448
|
-
function
|
|
3449
|
-
if (typeof e == "string") return
|
|
3565
|
+
function go(e) {
|
|
3566
|
+
if (typeof e == "string") return ho(e, 48);
|
|
3450
3567
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
3451
3568
|
if (Array.isArray(e)) return `${e.length} items`;
|
|
3452
3569
|
}
|
|
3453
|
-
function
|
|
3454
|
-
if (!
|
|
3570
|
+
function _o(e) {
|
|
3571
|
+
if (!mo(e)) return;
|
|
3455
3572
|
let t = [
|
|
3456
3573
|
"command",
|
|
3457
3574
|
"query",
|
|
@@ -3463,13 +3580,13 @@ function $a(e) {
|
|
|
3463
3580
|
"checks"
|
|
3464
3581
|
], n = [...t.filter((t) => t in e).map((t) => [t, e[t]]), ...Object.entries(e).filter(([e]) => !t.includes(e))], r = {};
|
|
3465
3582
|
for (let [e, t] of n) {
|
|
3466
|
-
let n =
|
|
3583
|
+
let n = go(t);
|
|
3467
3584
|
if (n && (r[e] = n, Object.keys(r).length >= 2)) break;
|
|
3468
3585
|
}
|
|
3469
3586
|
return Object.keys(r).length > 0 ? r : void 0;
|
|
3470
3587
|
}
|
|
3471
|
-
function
|
|
3472
|
-
if (
|
|
3588
|
+
function vo(e) {
|
|
3589
|
+
if (mo(e)) for (let t of [
|
|
3473
3590
|
"reasoning",
|
|
3474
3591
|
"thoughts",
|
|
3475
3592
|
"thought",
|
|
@@ -3477,36 +3594,36 @@ function eo(e) {
|
|
|
3477
3594
|
"detail"
|
|
3478
3595
|
]) {
|
|
3479
3596
|
let n = e[t];
|
|
3480
|
-
if (typeof n == "string" && n.trim().length > 0) return
|
|
3597
|
+
if (typeof n == "string" && n.trim().length > 0) return ho(n);
|
|
3481
3598
|
}
|
|
3482
3599
|
}
|
|
3483
|
-
function
|
|
3600
|
+
function yo(e) {
|
|
3484
3601
|
if (e.kind !== "reasoning") return;
|
|
3485
3602
|
let { part: t } = e;
|
|
3486
|
-
if (t.type === "reasoning") return
|
|
3603
|
+
if (t.type === "reasoning") return ho(t.text, 96);
|
|
3487
3604
|
}
|
|
3488
|
-
function
|
|
3605
|
+
function bo(e, t) {
|
|
3489
3606
|
if (e.kind === "reasoning") return {
|
|
3490
3607
|
kind: "reasoning",
|
|
3491
3608
|
name: "reasoning",
|
|
3492
|
-
detail:
|
|
3609
|
+
detail: yo(e)
|
|
3493
3610
|
};
|
|
3494
3611
|
if (e.kind === "dynamic-tool" && e.part.type === "dynamic-tool") {
|
|
3495
3612
|
let t = e.part;
|
|
3496
3613
|
return {
|
|
3497
3614
|
kind: "dynamic-tool",
|
|
3498
3615
|
name: t.toolName || "Tool",
|
|
3499
|
-
args:
|
|
3500
|
-
detail:
|
|
3616
|
+
args: _o(t.input),
|
|
3617
|
+
detail: vo(t.input)
|
|
3501
3618
|
};
|
|
3502
3619
|
}
|
|
3503
3620
|
if (e.kind === "tool" && S(e.part)) {
|
|
3504
|
-
let n = e.part, { toolEntry: r, toolKey: i } =
|
|
3621
|
+
let n = e.part, { toolEntry: r, toolKey: i } = gi(n, t), a = r?.label?.(n);
|
|
3505
3622
|
return {
|
|
3506
3623
|
kind: "tool",
|
|
3507
3624
|
name: a?.name ?? i,
|
|
3508
|
-
args: a?.args ??
|
|
3509
|
-
detail: a?.detail ??
|
|
3625
|
+
args: a?.args ?? _o(n.input),
|
|
3626
|
+
detail: a?.detail ?? vo(n.input),
|
|
3510
3627
|
isError: a?.isError
|
|
3511
3628
|
};
|
|
3512
3629
|
}
|
|
@@ -3515,54 +3632,54 @@ function no(e, t) {
|
|
|
3515
3632
|
name: "Step"
|
|
3516
3633
|
};
|
|
3517
3634
|
}
|
|
3518
|
-
function
|
|
3635
|
+
function xo(e) {
|
|
3519
3636
|
if (!e) return;
|
|
3520
3637
|
let t = Object.entries(e).filter((e) => typeof e[1] == "string" && e[1].trim().length > 0);
|
|
3521
|
-
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${
|
|
3638
|
+
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${ho(t, 36)}`).join(", ");
|
|
3522
3639
|
}
|
|
3523
|
-
function
|
|
3524
|
-
let t =
|
|
3640
|
+
function So(e) {
|
|
3641
|
+
let t = xo(e.args);
|
|
3525
3642
|
return t ? `${e.name}(${t})` : e.name;
|
|
3526
3643
|
}
|
|
3527
|
-
function
|
|
3644
|
+
function Co(e) {
|
|
3528
3645
|
return e === "output-available" || e === "output-error" || e === "output-denied";
|
|
3529
3646
|
}
|
|
3530
|
-
function
|
|
3531
|
-
return !!e && !
|
|
3647
|
+
function wo(e) {
|
|
3648
|
+
return !!e && !Co(e);
|
|
3532
3649
|
}
|
|
3533
|
-
function
|
|
3534
|
-
return
|
|
3650
|
+
function To(e, t) {
|
|
3651
|
+
return rn(e, t);
|
|
3535
3652
|
}
|
|
3536
|
-
function
|
|
3537
|
-
return e.some(({ segment: e }) =>
|
|
3538
|
-
let t =
|
|
3653
|
+
function Eo({ items: e, labels: t, status: n, hasLaterText: r }) {
|
|
3654
|
+
return e.some(({ segment: e }) => To(fo(e), n)) ? "aborted" : !r && (n === "streaming" || n === "submitted") ? "running" : t.some((e) => e.isError) || e.some(({ segment: e }) => {
|
|
3655
|
+
let t = fo(e);
|
|
3539
3656
|
return t === "output-error" || t === "output-denied";
|
|
3540
|
-
}) ? "error" : e.some(({ segment: e }) =>
|
|
3657
|
+
}) ? "error" : e.some(({ segment: e }) => wo(fo(e))) || !r && t.every((e) => e.kind === "reasoning") && (n === "streaming" || n === "submitted") ? "running" : "complete";
|
|
3541
3658
|
}
|
|
3542
|
-
function
|
|
3659
|
+
function Do(e) {
|
|
3543
3660
|
return e && `${e[0].toUpperCase()}${e.slice(1)}`;
|
|
3544
3661
|
}
|
|
3545
|
-
function
|
|
3662
|
+
function Oo(e) {
|
|
3546
3663
|
return e.filter((e) => e.kind !== "reasoning").length;
|
|
3547
3664
|
}
|
|
3548
|
-
function
|
|
3549
|
-
let n =
|
|
3665
|
+
function ko(e, t) {
|
|
3666
|
+
let n = Oo(e);
|
|
3550
3667
|
if (n !== 0) return `${t === "running" || t === "aborted" ? "running" : "ran"} ${n} ${n === 1 ? "tool" : "tools"}`;
|
|
3551
3668
|
}
|
|
3552
|
-
function
|
|
3553
|
-
let n =
|
|
3554
|
-
if (n) return
|
|
3669
|
+
function Ao(e, t) {
|
|
3670
|
+
let n = ko(e, t);
|
|
3671
|
+
if (n) return Do(t === "error" ? `${n} with issues` : t === "aborted" ? `cancelled after ${n}` : n);
|
|
3555
3672
|
}
|
|
3556
|
-
function
|
|
3673
|
+
function jo(e, t, n) {
|
|
3557
3674
|
let r = e.length === 1 ? e[0] : void 0;
|
|
3558
3675
|
if (t === "running") return n || (r?.kind === "reasoning" ? `Reasoning${r.detail ? ` ${r.detail}` : ""}` : e.every((e) => e.kind === "reasoning") ? "Reasoning" : "Working...");
|
|
3559
3676
|
if (r) {
|
|
3560
|
-
let e =
|
|
3677
|
+
let e = So(r);
|
|
3561
3678
|
return t === "error" ? `Failed ${e}` : t === "aborted" ? `Cancelled ${e}` : r.kind === "reasoning" ? `Reasoned${r.detail ? ` ${r.detail}` : ""}` : `Called ${e}`;
|
|
3562
3679
|
}
|
|
3563
|
-
return e.every((e) => e.kind === "reasoning") ? "Reasoned" :
|
|
3680
|
+
return e.every((e) => e.kind === "reasoning") ? "Reasoned" : Ao(e, t) ?? "Ran tools";
|
|
3564
3681
|
}
|
|
3565
|
-
function
|
|
3682
|
+
function Mo(e, t) {
|
|
3566
3683
|
if (t !== "running") {
|
|
3567
3684
|
if (e.length === 1) {
|
|
3568
3685
|
let t = e[0];
|
|
@@ -3571,28 +3688,28 @@ function ho(e, t) {
|
|
|
3571
3688
|
return Array.from(new Set([...e].sort((e, t) => e.kind === "reasoning" && t.kind !== "reasoning" ? 1 : e.kind !== "reasoning" && t.kind === "reasoning" ? -1 : 0).map((e) => e.name))).slice(0, 3).join(", ") || void 0;
|
|
3572
3689
|
}
|
|
3573
3690
|
}
|
|
3574
|
-
function
|
|
3691
|
+
function No(e) {
|
|
3575
3692
|
let t;
|
|
3576
3693
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
3577
3694
|
let r = e[n].segment;
|
|
3578
3695
|
if (r.kind === "dynamic-tool" && r.part.type === "dynamic-tool") {
|
|
3579
|
-
let e =
|
|
3696
|
+
let e = vo(r.part.input);
|
|
3580
3697
|
if (e) return e;
|
|
3581
3698
|
}
|
|
3582
3699
|
if (r.kind === "tool" && S(r.part)) {
|
|
3583
|
-
let e =
|
|
3700
|
+
let e = vo(r.part.input);
|
|
3584
3701
|
if (e) return e;
|
|
3585
3702
|
}
|
|
3586
|
-
r.kind === "reasoning" && (t ??=
|
|
3703
|
+
r.kind === "reasoning" && (t ??= yo(r));
|
|
3587
3704
|
}
|
|
3588
3705
|
return t;
|
|
3589
3706
|
}
|
|
3590
|
-
function
|
|
3591
|
-
return !e || e.role !== "assistant" ? !1 :
|
|
3707
|
+
function Po(e, t) {
|
|
3708
|
+
return !e || e.role !== "assistant" ? !1 : uo(aa(e.parts), t).some((e) => e.kind === "group" && !e.hasLaterText);
|
|
3592
3709
|
}
|
|
3593
|
-
function
|
|
3710
|
+
function Fo() {
|
|
3594
3711
|
let e = O(8), { message: t } = K(), { debugMode: n } = z(), r;
|
|
3595
|
-
e[0] === t.parts ? r = e[1] : (r =
|
|
3712
|
+
e[0] === t.parts ? r = e[1] : (r = aa(t.parts), e[0] = t.parts, e[1] = r);
|
|
3596
3713
|
let i = r, a;
|
|
3597
3714
|
if (e[2] !== n || e[3] !== t.id || e[4] !== i) {
|
|
3598
3715
|
let r;
|
|
@@ -3602,29 +3719,29 @@ function vo() {
|
|
|
3602
3719
|
} : {
|
|
3603
3720
|
...e,
|
|
3604
3721
|
key: `${t.id}-${Z(e.segment, e.segmentIndex)}-${e.segment.kind}`
|
|
3605
|
-
}, e[6] = t.id, e[7] = r), a =
|
|
3722
|
+
}, e[6] = t.id, e[7] = r), a = uo(i, n).map(r), e[2] = n, e[3] = t.id, e[4] = i, e[5] = a;
|
|
3606
3723
|
} else a = e[5];
|
|
3607
3724
|
return a;
|
|
3608
3725
|
}
|
|
3609
|
-
var
|
|
3610
|
-
function
|
|
3611
|
-
let e = l(
|
|
3726
|
+
var Io = o(null);
|
|
3727
|
+
function Lo() {
|
|
3728
|
+
let e = l(Io);
|
|
3612
3729
|
if (!e) throw Error("CompactTrajectory group parts must be rendered within CompactTrajectory.Group");
|
|
3613
3730
|
return e;
|
|
3614
3731
|
}
|
|
3615
|
-
function
|
|
3732
|
+
function Ro(e) {
|
|
3616
3733
|
let t = O(21), { group: n, children: r } = e, { registry: i } = z(), { message: a } = K(), o = G(), [s, c] = g(!n.hasLaterText), l, u, d;
|
|
3617
3734
|
if (t[0] !== n.hasLaterText || t[1] !== n.items || t[2] !== i || t[3] !== o) {
|
|
3618
3735
|
let e;
|
|
3619
3736
|
t[7] === i ? e = t[8] : (e = (e) => {
|
|
3620
3737
|
let { segment: t } = e;
|
|
3621
|
-
return
|
|
3622
|
-
}, t[7] = i, t[8] = e), u = n.items.map(e), l =
|
|
3738
|
+
return bo(t, i);
|
|
3739
|
+
}, t[7] = i, t[8] = e), u = n.items.map(e), l = Eo({
|
|
3623
3740
|
items: n.items,
|
|
3624
3741
|
labels: u,
|
|
3625
3742
|
status: o,
|
|
3626
3743
|
hasLaterText: n.hasLaterText
|
|
3627
|
-
}), d =
|
|
3744
|
+
}), d = po({
|
|
3628
3745
|
groupStatus: l,
|
|
3629
3746
|
labelCount: u.length
|
|
3630
3747
|
}), t[0] = n.hasLaterText, t[1] = n.items, t[2] = i, t[3] = o, t[4] = l, t[5] = u, t[6] = d;
|
|
@@ -3645,16 +3762,16 @@ function xo(e) {
|
|
|
3645
3762
|
children: r
|
|
3646
3763
|
}), t[15] = r, t[16] = s, t[17] = m) : m = t[17];
|
|
3647
3764
|
let h;
|
|
3648
|
-
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(
|
|
3765
|
+
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(Io, {
|
|
3649
3766
|
value: p,
|
|
3650
3767
|
children: m
|
|
3651
3768
|
}), t[18] = p, t[19] = m, t[20] = h) : h = t[20], h;
|
|
3652
3769
|
}
|
|
3653
|
-
function
|
|
3770
|
+
function zo(e) {
|
|
3654
3771
|
let t = O(3), { children: n } = e, r;
|
|
3655
3772
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M("button", {
|
|
3656
3773
|
type: "button",
|
|
3657
|
-
className:
|
|
3774
|
+
className: ln("items-start")
|
|
3658
3775
|
}), t[0] = r) : r = t[0];
|
|
3659
3776
|
let i;
|
|
3660
3777
|
return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ M(L, {
|
|
@@ -3665,11 +3782,11 @@ function So(e) {
|
|
|
3665
3782
|
})
|
|
3666
3783
|
}), t[1] = n, t[2] = i), i;
|
|
3667
3784
|
}
|
|
3668
|
-
function
|
|
3669
|
-
let e = O(12), { items: t, labels: n, groupStatus: r, tone: i } =
|
|
3670
|
-
e[0] !== r || e[1] !== t || e[2] !== n ? (a =
|
|
3785
|
+
function Bo() {
|
|
3786
|
+
let e = O(12), { items: t, labels: n, groupStatus: r, tone: i } = Lo(), a;
|
|
3787
|
+
e[0] !== r || e[1] !== t || e[2] !== n ? (a = jo(n, r, No(t)), e[0] = r, e[1] = t, e[2] = n, e[3] = a) : a = e[3];
|
|
3671
3788
|
let o = a, s;
|
|
3672
|
-
e[4] !== r || e[5] !== n ? (s =
|
|
3789
|
+
e[4] !== r || e[5] !== n ? (s = Mo(n, r), e[4] = r, e[5] = n, e[6] = s) : s = e[6];
|
|
3673
3790
|
let c = s, l;
|
|
3674
3791
|
return e[7] !== c || e[8] !== r || e[9] !== o || e[10] !== i ? (l = {
|
|
3675
3792
|
title: o,
|
|
@@ -3678,8 +3795,8 @@ function Co() {
|
|
|
3678
3795
|
groupStatus: r
|
|
3679
3796
|
}, e[7] = c, e[8] = r, e[9] = o, e[10] = i, e[11] = l) : l = e[11], l;
|
|
3680
3797
|
}
|
|
3681
|
-
function
|
|
3682
|
-
let t = O(9), { title: n, suffix: r, children: i } = e, { title: a, tone: o, groupStatus: s } =
|
|
3798
|
+
function Vo(e) {
|
|
3799
|
+
let t = O(9), { title: n, suffix: r, children: i } = e, { title: a, tone: o, groupStatus: s } = Bo(), c = n ?? a, l = r ? `${c} · ${r}` : c, u = s === "running", d = s === "running" ? "text-info" : o.title, f;
|
|
3683
3800
|
t[0] === d ? f = t[1] : (f = k("max-w-full min-w-0 truncate", d), t[0] = d, t[1] = f);
|
|
3684
3801
|
let p;
|
|
3685
3802
|
t[2] !== u || t[3] !== f || t[4] !== l ? (p = /* @__PURE__ */ M(U, {
|
|
@@ -3694,12 +3811,12 @@ function wo(e) {
|
|
|
3694
3811
|
children: [p, i]
|
|
3695
3812
|
}), t[6] = i, t[7] = p, t[8] = m) : m = t[8], m;
|
|
3696
3813
|
}
|
|
3697
|
-
function
|
|
3698
|
-
let e = O(2), { tone: t } =
|
|
3699
|
-
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(
|
|
3814
|
+
function Ho() {
|
|
3815
|
+
let e = O(2), { tone: t } = Lo(), n;
|
|
3816
|
+
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(cn, { className: t.chevron }), e[0] = t.chevron, e[1] = n), n;
|
|
3700
3817
|
}
|
|
3701
|
-
function
|
|
3702
|
-
let t = O(5), { detail: n } = e, { title: r, detail: i, tone: a } =
|
|
3818
|
+
function Uo(e) {
|
|
3819
|
+
let t = O(5), { detail: n } = e, { title: r, detail: i, tone: a } = Bo();
|
|
3703
3820
|
if (n === null) return null;
|
|
3704
3821
|
let o = n ?? i;
|
|
3705
3822
|
if (!o || o === r) return null;
|
|
@@ -3711,8 +3828,8 @@ function Eo(e) {
|
|
|
3711
3828
|
children: o
|
|
3712
3829
|
}), t[2] = o, t[3] = s, t[4] = c) : c = t[4], c;
|
|
3713
3830
|
}
|
|
3714
|
-
function
|
|
3715
|
-
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } =
|
|
3831
|
+
function Wo(e) {
|
|
3832
|
+
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } = Lo(), o = a === "running", s;
|
|
3716
3833
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (s = {
|
|
3717
3834
|
initial: "instant",
|
|
3718
3835
|
resize: "instant"
|
|
@@ -3736,11 +3853,11 @@ function Do(e) {
|
|
|
3736
3853
|
children: h
|
|
3737
3854
|
}), t[10] = u, t[11] = f, t[12] = h, t[13] = g) : g = t[13], g;
|
|
3738
3855
|
}
|
|
3739
|
-
function
|
|
3856
|
+
function Go(e) {
|
|
3740
3857
|
let t = O(19), { item: n, textClassName: r } = e, i = r === void 0 ? "my-4" : r, { elements: a } = W(), { segment: o } = n;
|
|
3741
3858
|
if (o.kind === "text") {
|
|
3742
3859
|
let e;
|
|
3743
|
-
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(
|
|
3860
|
+
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(Ko), t[0] = o.parts, t[1] = e);
|
|
3744
3861
|
let n = e;
|
|
3745
3862
|
if (n.length === 0) return null;
|
|
3746
3863
|
let r;
|
|
@@ -3777,59 +3894,59 @@ function Oo(e) {
|
|
|
3777
3894
|
}
|
|
3778
3895
|
return null;
|
|
3779
3896
|
}
|
|
3780
|
-
function
|
|
3897
|
+
function Ko(e) {
|
|
3781
3898
|
let { part: t } = e;
|
|
3782
|
-
return !
|
|
3783
|
-
}
|
|
3784
|
-
var
|
|
3785
|
-
Group:
|
|
3786
|
-
GroupTrigger:
|
|
3787
|
-
GroupTitle:
|
|
3788
|
-
GroupChevron:
|
|
3789
|
-
GroupDetail:
|
|
3790
|
-
GroupContent:
|
|
3791
|
-
Segment:
|
|
3899
|
+
return !Wi(t);
|
|
3900
|
+
}
|
|
3901
|
+
var qo = {
|
|
3902
|
+
Group: Ro,
|
|
3903
|
+
GroupTrigger: zo,
|
|
3904
|
+
GroupTitle: Vo,
|
|
3905
|
+
GroupChevron: Ho,
|
|
3906
|
+
GroupDetail: Uo,
|
|
3907
|
+
GroupContent: Wo,
|
|
3908
|
+
Segment: Go
|
|
3792
3909
|
};
|
|
3793
|
-
function
|
|
3910
|
+
function Jo() {
|
|
3794
3911
|
let e = O(1), t = G(), { messages: n } = W(), { debugMode: r } = z(), i = n[n.length - 1];
|
|
3795
|
-
if (t !== "ready" && t !== "error" &&
|
|
3912
|
+
if (t !== "ready" && t !== "error" && Po(i, r)) return null;
|
|
3796
3913
|
let a;
|
|
3797
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(
|
|
3914
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(Da, {}), e[0] = a) : a = e[0], a;
|
|
3798
3915
|
}
|
|
3799
|
-
var
|
|
3800
|
-
Root:
|
|
3801
|
-
List:
|
|
3802
|
-
Item:
|
|
3803
|
-
UserBubble:
|
|
3916
|
+
var Yo = {
|
|
3917
|
+
Root: va,
|
|
3918
|
+
List: ya,
|
|
3919
|
+
Item: ba,
|
|
3920
|
+
UserBubble: oo,
|
|
3804
3921
|
AssistantContent: c(function(e) {
|
|
3805
|
-
let t = O(5), { className: n } = e, r =
|
|
3806
|
-
t[0] === r ? i = t[1] : (i = r.map(
|
|
3922
|
+
let t = O(5), { className: n } = e, r = Fo(), i;
|
|
3923
|
+
t[0] === r ? i = t[1] : (i = r.map(Xo), t[0] = r, t[1] = i);
|
|
3807
3924
|
let a;
|
|
3808
3925
|
return t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M("div", {
|
|
3809
3926
|
className: n,
|
|
3810
3927
|
children: i
|
|
3811
3928
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
3812
3929
|
}),
|
|
3813
|
-
Actions:
|
|
3814
|
-
CopyAction:
|
|
3815
|
-
RegenerateAction:
|
|
3816
|
-
CopyDebugJsonAction:
|
|
3817
|
-
Thinking:
|
|
3818
|
-
Error:
|
|
3930
|
+
Actions: fa,
|
|
3931
|
+
CopyAction: pa,
|
|
3932
|
+
RegenerateAction: ma,
|
|
3933
|
+
CopyDebugJsonAction: ha,
|
|
3934
|
+
Thinking: Jo,
|
|
3935
|
+
Error: _a
|
|
3819
3936
|
};
|
|
3820
|
-
function
|
|
3821
|
-
return e.kind === "group" ? /* @__PURE__ */ N(
|
|
3937
|
+
function Xo(e) {
|
|
3938
|
+
return e.kind === "group" ? /* @__PURE__ */ N(Ro, {
|
|
3822
3939
|
group: e,
|
|
3823
|
-
children: [/* @__PURE__ */ N(
|
|
3824
|
-
}, e.key) : /* @__PURE__ */ M(
|
|
3940
|
+
children: [/* @__PURE__ */ N(zo, { children: [/* @__PURE__ */ M(Vo, { children: /* @__PURE__ */ M(Ho, {}) }), /* @__PURE__ */ M(Uo, {})] }), /* @__PURE__ */ M(Wo, {})]
|
|
3941
|
+
}, e.key) : /* @__PURE__ */ M(Go, { item: e }, e.key);
|
|
3825
3942
|
}
|
|
3826
3943
|
//#endregion
|
|
3827
3944
|
//#region src/lib/chat/trajectory/trajectories/messages.tsx
|
|
3828
|
-
function
|
|
3945
|
+
function Zo(e) {
|
|
3829
3946
|
let t = O(8), { message: n, className: r } = e, i;
|
|
3830
3947
|
t[0] === r ? i = t[1] : (i = k("text-destructive/90 bg-destructive/10 flex items-start gap-2 rounded-md px-3 py-2 text-sm", r), t[0] = r, t[1] = i);
|
|
3831
3948
|
let a;
|
|
3832
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(
|
|
3949
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(Fe, { className: "text-destructive mt-0.5 size-4 shrink-0" }), t[2] = a) : a = t[2];
|
|
3833
3950
|
let o;
|
|
3834
3951
|
t[3] === n ? o = t[4] : (o = /* @__PURE__ */ M("span", { children: n }), t[3] = n, t[4] = o);
|
|
3835
3952
|
let s;
|
|
@@ -3838,13 +3955,13 @@ function Po(e) {
|
|
|
3838
3955
|
children: [a, o]
|
|
3839
3956
|
}), t[5] = i, t[6] = o, t[7] = s) : s = t[7], s;
|
|
3840
3957
|
}
|
|
3841
|
-
function
|
|
3958
|
+
function Qo(e) {
|
|
3842
3959
|
let t = O(15), { part: n } = e, r = z(), i, a;
|
|
3843
3960
|
if (t[0] !== r.registry || t[1] !== n) {
|
|
3844
3961
|
a = Symbol.for("react.early_return_sentinel");
|
|
3845
3962
|
bb0: {
|
|
3846
|
-
let { toolEntry: e } =
|
|
3847
|
-
if (e &&
|
|
3963
|
+
let { toolEntry: e } = gi(n, r.registry);
|
|
3964
|
+
if (e && _i(e, n.state)) {
|
|
3848
3965
|
let t = e.label?.(n);
|
|
3849
3966
|
if (!t) {
|
|
3850
3967
|
a = null;
|
|
@@ -3877,14 +3994,14 @@ function Fo(e) {
|
|
|
3877
3994
|
} else i = t[2], a = t[3];
|
|
3878
3995
|
if (a !== Symbol.for("react.early_return_sentinel")) return a;
|
|
3879
3996
|
let o = i, s;
|
|
3880
|
-
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(
|
|
3997
|
+
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(Bi, {
|
|
3881
3998
|
label: o,
|
|
3882
3999
|
part: n
|
|
3883
4000
|
}), t[4] = o, t[5] = n, t[6] = s) : s = t[6];
|
|
3884
4001
|
let c;
|
|
3885
|
-
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(
|
|
4002
|
+
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(Zo, { message: o.detail }), t[7] = o, t[8] = c);
|
|
3886
4003
|
let l;
|
|
3887
|
-
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(
|
|
4004
|
+
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(Ii, { part: n }), t[9] = n, t[10] = l);
|
|
3888
4005
|
let u;
|
|
3889
4006
|
return t[11] !== s || t[12] !== c || t[13] !== l ? (u = /* @__PURE__ */ N(j, { children: [
|
|
3890
4007
|
s,
|
|
@@ -3892,7 +4009,7 @@ function Fo(e) {
|
|
|
3892
4009
|
l
|
|
3893
4010
|
] }), t[11] = s, t[12] = c, t[13] = l, t[14] = u) : u = t[14], u;
|
|
3894
4011
|
}
|
|
3895
|
-
function
|
|
4012
|
+
function $o(e) {
|
|
3896
4013
|
let t = O(5), { part: n } = e, [r, i] = g(!1), a;
|
|
3897
4014
|
t[0] === n.text ? a = t[1] : (a = /* @__PURE__ */ M(J, {
|
|
3898
4015
|
mode: "static",
|
|
@@ -3902,7 +4019,7 @@ function Io(e) {
|
|
|
3902
4019
|
return t[2] !== r || t[3] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
3903
4020
|
"data-copy-exclude": "assistant-snapshot",
|
|
3904
4021
|
className: "bg-muted/30 prose max-w-auto prose-sm text-muted-foreground border-border mb-4 w-full min-w-full rounded-lg p-3",
|
|
3905
|
-
children: /* @__PURE__ */ M(
|
|
4022
|
+
children: /* @__PURE__ */ M(Ka, {
|
|
3906
4023
|
label: "Reasoning",
|
|
3907
4024
|
open: r,
|
|
3908
4025
|
onOpenChange: i,
|
|
@@ -3913,45 +4030,46 @@ function Io(e) {
|
|
|
3913
4030
|
})
|
|
3914
4031
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
3915
4032
|
}
|
|
3916
|
-
function
|
|
3917
|
-
let t = O(
|
|
4033
|
+
function es(e) {
|
|
4034
|
+
let t = O(16), { part: n } = e, { elements: r } = W(), i = Li();
|
|
3918
4035
|
if (n.type === "text") {
|
|
3919
|
-
if (
|
|
4036
|
+
if (Wi(n)) return null;
|
|
3920
4037
|
let e;
|
|
3921
|
-
return t[0] !== r || t[1] !== n.text ? (e = /* @__PURE__ */ M(
|
|
4038
|
+
return t[0] !== r || t[1] !== n.citations || t[2] !== n.text ? (e = /* @__PURE__ */ M(Fi, {
|
|
3922
4039
|
text: n.text,
|
|
4040
|
+
citations: n.citations,
|
|
3923
4041
|
elements: r
|
|
3924
|
-
}), t[0] = r, t[1] = n.
|
|
4042
|
+
}), t[0] = r, t[1] = n.citations, t[2] = n.text, t[3] = e) : e = t[3], e;
|
|
3925
4043
|
}
|
|
3926
4044
|
if (n.type === "dynamic-tool") {
|
|
3927
4045
|
let e;
|
|
3928
|
-
return t[
|
|
4046
|
+
return t[4] !== i || t[5] !== n ? (e = i ? /* @__PURE__ */ M(ei, { part: n }) : null, t[4] = i, t[5] = n, t[6] = e) : e = t[6], e;
|
|
3929
4047
|
}
|
|
3930
4048
|
if (S(n)) {
|
|
3931
4049
|
let e;
|
|
3932
|
-
return t[
|
|
4050
|
+
return t[7] === n ? e = t[8] : (e = /* @__PURE__ */ M(Qo, { part: n }), t[7] = n, t[8] = e), e;
|
|
3933
4051
|
}
|
|
3934
4052
|
if (n.type === "reasoning" && n.text) {
|
|
3935
4053
|
let e;
|
|
3936
|
-
return t[
|
|
4054
|
+
return t[9] !== i || t[10] !== n ? (e = i ? /* @__PURE__ */ M($o, { part: n }) : null, t[9] = i, t[10] = n, t[11] = e) : e = t[11], e;
|
|
3937
4055
|
}
|
|
3938
4056
|
if (n.type === "file") {
|
|
3939
4057
|
let e;
|
|
3940
|
-
return t[
|
|
4058
|
+
return t[12] !== n.filename || t[13] !== n.mediaType || t[14] !== n.url ? (e = /* @__PURE__ */ M(ki, {
|
|
3941
4059
|
filename: n.filename,
|
|
3942
4060
|
mediaType: n.mediaType,
|
|
3943
4061
|
url: n.url
|
|
3944
|
-
}), t[
|
|
4062
|
+
}), t[12] = n.filename, t[13] = n.mediaType, t[14] = n.url, t[15] = e) : e = t[15], e;
|
|
3945
4063
|
}
|
|
3946
4064
|
return null;
|
|
3947
4065
|
}
|
|
3948
|
-
var
|
|
4066
|
+
var ts = c(function(e) {
|
|
3949
4067
|
let t = O(10), { className: n } = e, { message: r } = K(), i;
|
|
3950
4068
|
t[0] === n ? i = t[1] : (i = k("flex-1 space-y-3", n), t[0] = n, t[1] = i);
|
|
3951
4069
|
let a;
|
|
3952
4070
|
if (t[2] !== r.id || t[3] !== r.parts) {
|
|
3953
4071
|
let e;
|
|
3954
|
-
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(
|
|
4072
|
+
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(es, { part: e }, `${r.id}-${t}`), t[5] = r.id, t[6] = e), a = r.parts.map(e), t[2] = r.id, t[3] = r.parts, t[4] = a;
|
|
3955
4073
|
} else a = t[4];
|
|
3956
4074
|
let o;
|
|
3957
4075
|
return t[7] !== i || t[8] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
@@ -3959,9 +4077,9 @@ var Ro = c(function(e) {
|
|
|
3959
4077
|
children: a
|
|
3960
4078
|
}), t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
3961
4079
|
});
|
|
3962
|
-
function
|
|
4080
|
+
function ns(e) {
|
|
3963
4081
|
let t = O(9), { className: n, label: r } = e, i;
|
|
3964
|
-
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(
|
|
4082
|
+
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(rs).pop() || "Thinking...", t[0] = r, t[1] = i);
|
|
3965
4083
|
let a = i, o;
|
|
3966
4084
|
t[2] === n ? o = t[3] : (o = k("flex items-start", n), t[2] = n, t[3] = o);
|
|
3967
4085
|
let s;
|
|
@@ -3976,33 +4094,33 @@ function zo(e) {
|
|
|
3976
4094
|
children: s
|
|
3977
4095
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8], c;
|
|
3978
4096
|
}
|
|
3979
|
-
function
|
|
4097
|
+
function rs(e) {
|
|
3980
4098
|
return e.trim();
|
|
3981
4099
|
}
|
|
3982
|
-
function
|
|
4100
|
+
function is() {
|
|
3983
4101
|
let e = O(5), t = G(), { messages: n } = W(), r = n[n.length - 1], i;
|
|
3984
|
-
e[0] !== t || e[1] !== r ? (i =
|
|
4102
|
+
e[0] !== t || e[1] !== r ? (i = wa(t, r), e[0] = t, e[1] = r, e[2] = i) : i = e[2];
|
|
3985
4103
|
let a = i;
|
|
3986
4104
|
if (!a) return null;
|
|
3987
4105
|
let o;
|
|
3988
|
-
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(
|
|
4106
|
+
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(ns, {
|
|
3989
4107
|
label: a,
|
|
3990
4108
|
className: "mt-2"
|
|
3991
4109
|
}), e[3] = a, e[4] = o), o;
|
|
3992
4110
|
}
|
|
3993
|
-
var
|
|
3994
|
-
Root:
|
|
3995
|
-
List:
|
|
3996
|
-
Item:
|
|
3997
|
-
UserBubble:
|
|
3998
|
-
AssistantContent:
|
|
3999
|
-
Thinking:
|
|
4000
|
-
Error:
|
|
4001
|
-
Actions:
|
|
4002
|
-
CopyAction:
|
|
4003
|
-
RegenerateAction:
|
|
4004
|
-
CopyDebugJsonAction:
|
|
4005
|
-
},
|
|
4111
|
+
var as = {
|
|
4112
|
+
Root: va,
|
|
4113
|
+
List: ya,
|
|
4114
|
+
Item: ba,
|
|
4115
|
+
UserBubble: oo,
|
|
4116
|
+
AssistantContent: ts,
|
|
4117
|
+
Thinking: is,
|
|
4118
|
+
Error: _a,
|
|
4119
|
+
Actions: fa,
|
|
4120
|
+
CopyAction: pa,
|
|
4121
|
+
RegenerateAction: ma,
|
|
4122
|
+
CopyDebugJsonAction: ha
|
|
4123
|
+
}, os = {
|
|
4006
4124
|
braille: {
|
|
4007
4125
|
frames: [
|
|
4008
4126
|
"⠋",
|
|
@@ -4069,10 +4187,10 @@ var Ho = {
|
|
|
4069
4187
|
interval: 100
|
|
4070
4188
|
}
|
|
4071
4189
|
};
|
|
4072
|
-
function
|
|
4190
|
+
function ss(e) {
|
|
4073
4191
|
let t = O(15), n, r, i;
|
|
4074
4192
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, variant: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
4075
|
-
let a = i === void 0 ? "braille" : i, o =
|
|
4193
|
+
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } = os[a], [l, u] = g(0), f, p;
|
|
4076
4194
|
t[4] !== o || t[5] !== s.length || t[6] !== c ? (f = () => {
|
|
4077
4195
|
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
4078
4196
|
let e = o.setInterval(() => {
|
|
@@ -4097,9 +4215,9 @@ function Wo(e) {
|
|
|
4097
4215
|
}
|
|
4098
4216
|
//#endregion
|
|
4099
4217
|
//#region src/lib/chat/trajectory/trajectories/timeline.tsx
|
|
4100
|
-
function
|
|
4218
|
+
function cs(e) {
|
|
4101
4219
|
let t = O(11), { Icon: n, isLast: r, isLoading: i, aborted: a, state: o, isError: s } = e, c;
|
|
4102
|
-
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(
|
|
4220
|
+
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(ss, { className: "text-muted-foreground z-10 shrink-0 text-sm" }) : a ? /* @__PURE__ */ M(Ie, { className: "text-destructive z-10 size-3.5 shrink-0" }) : /* @__PURE__ */ M(n, { className: k("z-10 size-3.5 shrink-0", o === "output-error" || s ? "text-destructive" : "text-muted-foreground") }), t[0] = n, t[1] = a, t[2] = s, t[3] = i, t[4] = o, t[5] = c) : c = t[5];
|
|
4103
4221
|
let l;
|
|
4104
4222
|
t[6] === r ? l = t[7] : (l = !r && /* @__PURE__ */ M("span", { className: "bg-border w-px flex-1" }), t[6] = r, t[7] = l);
|
|
4105
4223
|
let u;
|
|
@@ -4108,16 +4226,16 @@ function Go(e) {
|
|
|
4108
4226
|
children: [c, l]
|
|
4109
4227
|
}), t[8] = c, t[9] = l, t[10] = u) : u = t[10], u;
|
|
4110
4228
|
}
|
|
4111
|
-
function
|
|
4112
|
-
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(
|
|
4113
|
-
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(
|
|
4229
|
+
function ls(e) {
|
|
4230
|
+
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(Zi), c = r ?? s?.label, u = i ?? s?.state, d = a ?? s?.aborted ?? !1, f = c?.icon, p = !!u && !d && u !== "output-available" && u !== "output-error", m;
|
|
4231
|
+
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(cs, {
|
|
4114
4232
|
Icon: f,
|
|
4115
4233
|
isLast: n,
|
|
4116
4234
|
isLoading: p,
|
|
4117
4235
|
aborted: d,
|
|
4118
4236
|
state: u,
|
|
4119
4237
|
isError: c?.isError ?? !1
|
|
4120
|
-
}) : /* @__PURE__ */ M(
|
|
4238
|
+
}) : /* @__PURE__ */ M(Ta, { isLast: n }), t[0] = f, t[1] = d, t[2] = c?.isError, t[3] = u, t[4] = n, t[5] = p, t[6] = m) : m = t[6];
|
|
4121
4239
|
let h = m, g = n ? "" : "pb-3.5", _;
|
|
4122
4240
|
t[7] === g ? _ = t[8] : (_ = k("min-w-0 flex-1", g), t[7] = g, t[8] = _);
|
|
4123
4241
|
let v;
|
|
@@ -4126,16 +4244,16 @@ function Ko(e) {
|
|
|
4126
4244
|
children: o
|
|
4127
4245
|
}), t[9] = o, t[10] = _, t[11] = v) : v = t[11];
|
|
4128
4246
|
let y;
|
|
4129
|
-
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(
|
|
4247
|
+
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(Ea, {
|
|
4130
4248
|
marker: h,
|
|
4131
4249
|
children: v
|
|
4132
4250
|
}), t[12] = h, t[13] = v, t[14] = y) : y = t[14], y;
|
|
4133
4251
|
}
|
|
4134
|
-
function
|
|
4252
|
+
function us(e) {
|
|
4135
4253
|
let t = O(10), { label: n, state: r, part: i, defaultOpen: a, children: o } = e, s = a !== void 0 && a, c;
|
|
4136
4254
|
t[0] !== n || t[1] !== i || t[2] !== r ? (c = /* @__PURE__ */ M(L, {
|
|
4137
4255
|
className: "cursor-pointer",
|
|
4138
|
-
children: /* @__PURE__ */ M(
|
|
4256
|
+
children: /* @__PURE__ */ M(Hi, {
|
|
4139
4257
|
label: n,
|
|
4140
4258
|
state: r,
|
|
4141
4259
|
part: i
|
|
@@ -4150,17 +4268,17 @@ function qo(e) {
|
|
|
4150
4268
|
children: [c, l]
|
|
4151
4269
|
}), t[6] = s, t[7] = c, t[8] = l, t[9] = u) : u = t[9], u;
|
|
4152
4270
|
}
|
|
4153
|
-
var
|
|
4154
|
-
Item:
|
|
4155
|
-
Disclosure:
|
|
4156
|
-
},
|
|
4157
|
-
Root:
|
|
4158
|
-
List:
|
|
4159
|
-
Item:
|
|
4160
|
-
UserBubble:
|
|
4271
|
+
var ds = {
|
|
4272
|
+
Item: ls,
|
|
4273
|
+
Disclosure: us
|
|
4274
|
+
}, fs = {
|
|
4275
|
+
Root: va,
|
|
4276
|
+
List: ya,
|
|
4277
|
+
Item: ba,
|
|
4278
|
+
UserBubble: oo,
|
|
4161
4279
|
AssistantContent: c(function(e) {
|
|
4162
|
-
let t = O(12), { className: n } = e, { message: r } = K(), { elements: i } = W(), { debugMode: a } = z(), o =
|
|
4163
|
-
t[0] === r.parts ? c = t[1] : (c =
|
|
4280
|
+
let t = O(12), { className: n } = e, { message: r } = K(), { elements: i } = W(), { debugMode: a } = z(), o = Li(), s = Y(), c;
|
|
4281
|
+
t[0] === r.parts ? c = t[1] : (c = aa(r.parts), t[0] = r.parts, t[1] = c);
|
|
4164
4282
|
let l = c, u;
|
|
4165
4283
|
t[2] !== a || t[3] !== i || t[4] !== s || t[5] !== r.id || t[6] !== l || t[7] !== o ? (u = l.map((e, t) => {
|
|
4166
4284
|
let n = `${r.id}-${Z(e, t)}-${e.kind}`;
|
|
@@ -4173,33 +4291,33 @@ var Jo = {
|
|
|
4173
4291
|
if (e.kind === "source") return /* @__PURE__ */ M(X.Source, { segment: e }, n);
|
|
4174
4292
|
if (e.kind === "dynamic-tool") {
|
|
4175
4293
|
if (!o) return null;
|
|
4176
|
-
let r = !
|
|
4177
|
-
return /* @__PURE__ */ M(
|
|
4294
|
+
let r = !ia(l, t, !0);
|
|
4295
|
+
return /* @__PURE__ */ M(ds.Item, {
|
|
4178
4296
|
isLast: r,
|
|
4179
4297
|
children: /* @__PURE__ */ M(X.DynamicTool, { segment: e })
|
|
4180
4298
|
}, n);
|
|
4181
4299
|
}
|
|
4182
4300
|
if (e.kind === "reasoning") {
|
|
4183
4301
|
if (s || e.part.type !== "reasoning") return null;
|
|
4184
|
-
let r = !
|
|
4302
|
+
let r = !ia(l, t, a), i = {
|
|
4185
4303
|
name: "Reasoning",
|
|
4186
|
-
icon:
|
|
4304
|
+
icon: Je,
|
|
4187
4305
|
args: { text: [...e.part.text].slice(0, 60).join("") }
|
|
4188
4306
|
};
|
|
4189
|
-
return /* @__PURE__ */ M(
|
|
4307
|
+
return /* @__PURE__ */ M(ds.Item, {
|
|
4190
4308
|
isLast: r,
|
|
4191
4309
|
label: i,
|
|
4192
|
-
children: /* @__PURE__ */ M(
|
|
4310
|
+
children: /* @__PURE__ */ M(ds.Disclosure, {
|
|
4193
4311
|
label: i,
|
|
4194
4312
|
children: /* @__PURE__ */ M(X.Reasoning, { segment: e })
|
|
4195
4313
|
})
|
|
4196
4314
|
}, n);
|
|
4197
4315
|
}
|
|
4198
4316
|
if (e.kind === "tool") {
|
|
4199
|
-
let r = !
|
|
4317
|
+
let r = !ia(l, t, a);
|
|
4200
4318
|
return /* @__PURE__ */ M(X.Tool, {
|
|
4201
4319
|
segment: e,
|
|
4202
|
-
children: /* @__PURE__ */ M(
|
|
4320
|
+
children: /* @__PURE__ */ M(ds.Item, {
|
|
4203
4321
|
isLast: r,
|
|
4204
4322
|
children: /* @__PURE__ */ M(X.ToolDisclosure, {})
|
|
4205
4323
|
})
|
|
@@ -4213,16 +4331,16 @@ var Jo = {
|
|
|
4213
4331
|
children: u
|
|
4214
4332
|
}), t[9] = n, t[10] = u, t[11] = d) : d = t[11], d;
|
|
4215
4333
|
}),
|
|
4216
|
-
Actions:
|
|
4217
|
-
CopyAction:
|
|
4218
|
-
RegenerateAction:
|
|
4219
|
-
CopyDebugJsonAction:
|
|
4220
|
-
Thinking:
|
|
4221
|
-
Error:
|
|
4334
|
+
Actions: fa,
|
|
4335
|
+
CopyAction: pa,
|
|
4336
|
+
RegenerateAction: ma,
|
|
4337
|
+
CopyDebugJsonAction: ha,
|
|
4338
|
+
Thinking: Da,
|
|
4339
|
+
Error: _a
|
|
4222
4340
|
};
|
|
4223
4341
|
//#endregion
|
|
4224
4342
|
//#region src/lib/components/ChatComposer.tsx
|
|
4225
|
-
function
|
|
4343
|
+
function ps(e) {
|
|
4226
4344
|
let t = O(9), n, r;
|
|
4227
4345
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4228
4346
|
let { hasSubmitted: i } = V(), a;
|
|
@@ -4234,7 +4352,7 @@ function Xo(e) {
|
|
|
4234
4352
|
...r
|
|
4235
4353
|
}), t[5] = i, t[6] = r, t[7] = a, t[8] = o) : o = t[8], o;
|
|
4236
4354
|
}
|
|
4237
|
-
function
|
|
4355
|
+
function ms(e) {
|
|
4238
4356
|
let t = O(8), n, r;
|
|
4239
4357
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4240
4358
|
let i;
|
|
@@ -4245,7 +4363,7 @@ function Zo(e) {
|
|
|
4245
4363
|
...r
|
|
4246
4364
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4247
4365
|
}
|
|
4248
|
-
function
|
|
4366
|
+
function hs(e) {
|
|
4249
4367
|
let t = O(8), n, r;
|
|
4250
4368
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4251
4369
|
let i;
|
|
@@ -4256,7 +4374,7 @@ function Qo(e) {
|
|
|
4256
4374
|
...r
|
|
4257
4375
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4258
4376
|
}
|
|
4259
|
-
function
|
|
4377
|
+
function gs(e) {
|
|
4260
4378
|
let t = O(8), n, r;
|
|
4261
4379
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4262
4380
|
let i;
|
|
@@ -4267,7 +4385,7 @@ function $o(e) {
|
|
|
4267
4385
|
...r
|
|
4268
4386
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4269
4387
|
}
|
|
4270
|
-
function
|
|
4388
|
+
function _s(e) {
|
|
4271
4389
|
let t = O(8), n, r;
|
|
4272
4390
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4273
4391
|
let i;
|
|
@@ -4278,7 +4396,7 @@ function es(e) {
|
|
|
4278
4396
|
...r
|
|
4279
4397
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4280
4398
|
}
|
|
4281
|
-
function
|
|
4399
|
+
function vs(e) {
|
|
4282
4400
|
let t = O(8), n, r;
|
|
4283
4401
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4284
4402
|
let i;
|
|
@@ -4289,9 +4407,9 @@ function ts(e) {
|
|
|
4289
4407
|
...r
|
|
4290
4408
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4291
4409
|
}
|
|
4292
|
-
function
|
|
4410
|
+
function ys(e) {
|
|
4293
4411
|
let t = O(3), n;
|
|
4294
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ M(Q, { icon: /* @__PURE__ */ M(
|
|
4412
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ M(Q, { icon: /* @__PURE__ */ M($e, { className: "size-4" }) }), t[0] = n) : n = t[0];
|
|
4295
4413
|
let r;
|
|
4296
4414
|
return t[1] === e ? r = t[2] : (r = /* @__PURE__ */ M(R.AttachFiles, {
|
|
4297
4415
|
"aria-label": "Attach files",
|
|
@@ -4299,9 +4417,9 @@ function ns(e) {
|
|
|
4299
4417
|
...e
|
|
4300
4418
|
}), t[1] = e, t[2] = r), r;
|
|
4301
4419
|
}
|
|
4302
|
-
function
|
|
4303
|
-
let e = O(6), { actions: t, meta: n } =
|
|
4304
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M(
|
|
4420
|
+
function bs() {
|
|
4421
|
+
let e = O(6), { actions: t, meta: n } = Tt("ChatComposer.CommandButton"), r;
|
|
4422
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M(et, { className: "size-4" }), e[0] = r) : r = e[0];
|
|
4305
4423
|
let i = n.activePopup?.trigger === "/", a;
|
|
4306
4424
|
e[1] === t ? a = e[2] : (a = (e) => {
|
|
4307
4425
|
e.stopPropagation(), t.toggleSlashMenu();
|
|
@@ -4315,7 +4433,7 @@ function rs() {
|
|
|
4315
4433
|
onClick: a
|
|
4316
4434
|
}), e[3] = i, e[4] = a, e[5] = o) : o = e[5], o;
|
|
4317
4435
|
}
|
|
4318
|
-
function
|
|
4436
|
+
function xs(e) {
|
|
4319
4437
|
switch (e) {
|
|
4320
4438
|
case "permission-denied": return "Allow microphone access to use dictation";
|
|
4321
4439
|
case "no-microphone": return "Connect a microphone to use dictation";
|
|
@@ -4324,31 +4442,31 @@ function is(e) {
|
|
|
4324
4442
|
case "transcription-failed": return "Unable to transcribe audio";
|
|
4325
4443
|
}
|
|
4326
4444
|
}
|
|
4327
|
-
function
|
|
4445
|
+
function Ss(e) {
|
|
4328
4446
|
switch (e.status) {
|
|
4329
4447
|
case "unavailable": return e.reason === "blocked" ? "Allow microphone access in your browser settings to use dictation" : "Dictation is not available in this browser";
|
|
4330
4448
|
case "idle": return "Start dictation";
|
|
4331
4449
|
case "starting": return "Starting dictation";
|
|
4332
4450
|
case "recording": return "Stop dictation";
|
|
4333
4451
|
case "finishing": return "Transcribing…";
|
|
4334
|
-
case "failed": return
|
|
4452
|
+
case "failed": return xs(e.error.code);
|
|
4335
4453
|
}
|
|
4336
4454
|
}
|
|
4337
|
-
function
|
|
4455
|
+
function Cs(e) {
|
|
4338
4456
|
switch (e.status) {
|
|
4339
|
-
case "recording": return /* @__PURE__ */ M(
|
|
4457
|
+
case "recording": return /* @__PURE__ */ M(nt, { className: "size-4 fill-current" });
|
|
4340
4458
|
case "starting":
|
|
4341
|
-
case "finishing": return /* @__PURE__ */ M(
|
|
4459
|
+
case "finishing": return /* @__PURE__ */ M(Ze, { className: "size-4 animate-spin" });
|
|
4342
4460
|
case "unavailable":
|
|
4343
4461
|
case "idle":
|
|
4344
|
-
case "failed": return /* @__PURE__ */ M(
|
|
4462
|
+
case "failed": return /* @__PURE__ */ M(Qe, { className: "size-4" });
|
|
4345
4463
|
}
|
|
4346
4464
|
}
|
|
4347
|
-
function
|
|
4348
|
-
let e = O(20), { status: t } = B(), { state: n } =
|
|
4349
|
-
e[0] === n ? r = e[1] : (r =
|
|
4465
|
+
function ws() {
|
|
4466
|
+
let e = O(20), { status: t } = B(), { state: n } = Et("ChatComposer.Dictate"), r;
|
|
4467
|
+
e[0] === n ? r = e[1] : (r = Ss(n), e[0] = n, e[1] = r);
|
|
4350
4468
|
let i = r, a = n.status === "starting" || n.status === "recording" || n.status === "finishing", o = t === "streaming" || t === "submitted", s;
|
|
4351
|
-
e[2] === n ? s = e[3] : (s =
|
|
4469
|
+
e[2] === n ? s = e[3] : (s = Cs(n), e[2] = n, e[3] = s);
|
|
4352
4470
|
let c;
|
|
4353
4471
|
e[4] !== i || e[5] !== s ? (c = /* @__PURE__ */ M(Q, {
|
|
4354
4472
|
icon: s,
|
|
@@ -4362,7 +4480,7 @@ function ss() {
|
|
|
4362
4480
|
}), e[7] = o, e[8] = c, e[9] = l) : l = e[9];
|
|
4363
4481
|
let u;
|
|
4364
4482
|
e[10] !== a || e[11] !== n.status ? (u = a ? /* @__PURE__ */ M(R.CancelDictation, { render: /* @__PURE__ */ M(Q, {
|
|
4365
|
-
icon: /* @__PURE__ */ M(
|
|
4483
|
+
icon: /* @__PURE__ */ M(ot, { className: "size-4" }),
|
|
4366
4484
|
"aria-label": n.status === "finishing" ? "Cancel transcription" : "Cancel dictation"
|
|
4367
4485
|
}) }) : null, e[10] = a, e[11] = n.status, e[12] = u) : u = e[12];
|
|
4368
4486
|
let d;
|
|
@@ -4378,22 +4496,22 @@ function ss() {
|
|
|
4378
4496
|
d
|
|
4379
4497
|
] }), e[16] = l, e[17] = u, e[18] = d, e[19] = f) : f = e[19], f;
|
|
4380
4498
|
}
|
|
4381
|
-
var
|
|
4382
|
-
Provider:
|
|
4383
|
-
Root:
|
|
4499
|
+
var Ts = {
|
|
4500
|
+
Provider: ps,
|
|
4501
|
+
Root: ms,
|
|
4384
4502
|
Popup: R.Popup,
|
|
4385
|
-
Content:
|
|
4386
|
-
Attachments:
|
|
4387
|
-
Editor:
|
|
4503
|
+
Content: hs,
|
|
4504
|
+
Attachments: _s,
|
|
4505
|
+
Editor: gs,
|
|
4388
4506
|
Error: R.Error,
|
|
4389
|
-
Toolbar:
|
|
4390
|
-
CommandButton:
|
|
4391
|
-
AttachFiles:
|
|
4392
|
-
Dictate:
|
|
4507
|
+
Toolbar: vs,
|
|
4508
|
+
CommandButton: bs,
|
|
4509
|
+
AttachFiles: ys,
|
|
4510
|
+
Dictate: ws
|
|
4393
4511
|
};
|
|
4394
4512
|
//#endregion
|
|
4395
4513
|
//#region src/lib/components/ChatTextarea.tsx
|
|
4396
|
-
function
|
|
4514
|
+
function Es(e) {
|
|
4397
4515
|
let t = O(10), n, r, i;
|
|
4398
4516
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, ref: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
4399
4517
|
let a;
|
|
@@ -4410,7 +4528,7 @@ function ls(e) {
|
|
|
4410
4528
|
}
|
|
4411
4529
|
//#endregion
|
|
4412
4530
|
//#region src/lib/components/queue.tsx
|
|
4413
|
-
function
|
|
4531
|
+
function Ds(e) {
|
|
4414
4532
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4415
4533
|
t[0] === r ? i = t[1] : (i = k("border-border flex flex-col border-b px-2 py-1.5", r), t[0] = r, t[1] = i);
|
|
4416
4534
|
let a;
|
|
@@ -4419,7 +4537,7 @@ function us(e) {
|
|
|
4419
4537
|
children: n
|
|
4420
4538
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4421
4539
|
}
|
|
4422
|
-
function
|
|
4540
|
+
function Os(e) {
|
|
4423
4541
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4424
4542
|
t[0] === r ? i = t[1] : (i = k("flex items-center gap-2 px-2 py-1.5", r), t[0] = r, t[1] = i);
|
|
4425
4543
|
let a;
|
|
@@ -4428,28 +4546,28 @@ function ds(e) {
|
|
|
4428
4546
|
children: n
|
|
4429
4547
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4430
4548
|
}
|
|
4431
|
-
function
|
|
4549
|
+
function ks(e) {
|
|
4432
4550
|
let t = O(4), { className: n } = e, r;
|
|
4433
4551
|
t[0] === n ? r = t[1] : (r = k("text-muted-foreground size-3.5 shrink-0", n), t[0] = n, t[1] = r);
|
|
4434
4552
|
let i;
|
|
4435
|
-
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ M(
|
|
4553
|
+
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ M(Ye, { className: r }), t[2] = r, t[3] = i), i;
|
|
4436
4554
|
}
|
|
4437
|
-
function
|
|
4555
|
+
function As(e) {
|
|
4438
4556
|
let t = O(7), { children: n, className: r } = e, i;
|
|
4439
4557
|
t[0] === r ? i = t[1] : (i = k("min-w-0 flex-1 truncate text-sm", r), t[0] = r, t[1] = i);
|
|
4440
4558
|
let a;
|
|
4441
|
-
t[2] === n ? a = t[3] : (a = typeof n == "string" ? /* @__PURE__ */ M(
|
|
4559
|
+
t[2] === n ? a = t[3] : (a = typeof n == "string" ? /* @__PURE__ */ M(wt, { text: n }) : n, t[2] = n, t[3] = a);
|
|
4442
4560
|
let o;
|
|
4443
4561
|
return t[4] !== i || t[5] !== a ? (o = /* @__PURE__ */ M("span", {
|
|
4444
4562
|
className: i,
|
|
4445
4563
|
children: a
|
|
4446
4564
|
}), t[4] = i, t[5] = a, t[6] = o) : o = t[6], o;
|
|
4447
4565
|
}
|
|
4448
|
-
function
|
|
4566
|
+
function js(e) {
|
|
4449
4567
|
let t = O(6), { onClick: n, className: r } = e, i;
|
|
4450
4568
|
t[0] === r ? i = t[1] : (i = k("text-muted-foreground hover:text-foreground shrink-0 rounded p-1 transition-colors", r), t[0] = r, t[1] = i);
|
|
4451
4569
|
let a;
|
|
4452
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(
|
|
4570
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(rt, { className: "size-3.5" }), t[2] = a) : a = t[2];
|
|
4453
4571
|
let o;
|
|
4454
4572
|
return t[3] !== n || t[4] !== i ? (o = /* @__PURE__ */ M("button", {
|
|
4455
4573
|
type: "button",
|
|
@@ -4459,13 +4577,13 @@ function ms(e) {
|
|
|
4459
4577
|
children: a
|
|
4460
4578
|
}), t[3] = n, t[4] = i, t[5] = o) : o = t[5], o;
|
|
4461
4579
|
}
|
|
4462
|
-
var
|
|
4463
|
-
Root:
|
|
4464
|
-
Item:
|
|
4465
|
-
Icon:
|
|
4466
|
-
Text:
|
|
4467
|
-
Remove:
|
|
4468
|
-
},
|
|
4580
|
+
var Ms = {
|
|
4581
|
+
Root: Ds,
|
|
4582
|
+
Item: Os,
|
|
4583
|
+
Icon: ks,
|
|
4584
|
+
Text: As,
|
|
4585
|
+
Remove: js
|
|
4586
|
+
}, Ns = {
|
|
4469
4587
|
normal: {
|
|
4470
4588
|
d: "m5 12 7-7 7 7",
|
|
4471
4589
|
translateY: 0
|
|
@@ -4479,7 +4597,7 @@ var hs = {
|
|
|
4479
4597
|
],
|
|
4480
4598
|
transition: { duration: .4 }
|
|
4481
4599
|
}
|
|
4482
|
-
},
|
|
4600
|
+
}, Ps = {
|
|
4483
4601
|
normal: { d: "M12 19V5" },
|
|
4484
4602
|
animate: {
|
|
4485
4603
|
d: [
|
|
@@ -4489,7 +4607,7 @@ var hs = {
|
|
|
4489
4607
|
],
|
|
4490
4608
|
transition: { duration: .4 }
|
|
4491
4609
|
}
|
|
4492
|
-
},
|
|
4610
|
+
}, Fs = (e) => {
|
|
4493
4611
|
let t = O(30), n, r, i, a, o, s;
|
|
4494
4612
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5], s = t[6]) : ({ref: o, onMouseEnter: r, onMouseLeave: i, className: n, size: s, ...a} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o, t[6] = s);
|
|
4495
4613
|
let c = s === void 0 ? 20 : s, l = ne(), u = h(!1), d;
|
|
@@ -4511,11 +4629,11 @@ var hs = {
|
|
|
4511
4629
|
t[17] === l ? (y = t[18], b = t[19]) : (y = /* @__PURE__ */ M(A.path, {
|
|
4512
4630
|
animate: l,
|
|
4513
4631
|
d: "m5 12 7-7 7 7",
|
|
4514
|
-
variants:
|
|
4632
|
+
variants: Ns
|
|
4515
4633
|
}), b = /* @__PURE__ */ M(A.path, {
|
|
4516
4634
|
animate: l,
|
|
4517
4635
|
d: "M12 19V5",
|
|
4518
|
-
variants:
|
|
4636
|
+
variants: Ps
|
|
4519
4637
|
}), t[17] = l, t[18] = y, t[19] = b);
|
|
4520
4638
|
let x;
|
|
4521
4639
|
t[20] !== c || t[21] !== y || t[22] !== b ? (x = /* @__PURE__ */ N("svg", {
|
|
@@ -4539,10 +4657,10 @@ var hs = {
|
|
|
4539
4657
|
children: x
|
|
4540
4658
|
}), t[24] = m, t[25] = _, t[26] = a, t[27] = v, t[28] = x, t[29] = S) : S = t[29], S;
|
|
4541
4659
|
};
|
|
4542
|
-
|
|
4660
|
+
Fs.displayName = "ArrowUpIcon";
|
|
4543
4661
|
//#endregion
|
|
4544
4662
|
//#region src/lib/components/SubmitButton.tsx
|
|
4545
|
-
var
|
|
4663
|
+
var Is = {
|
|
4546
4664
|
duration: .15,
|
|
4547
4665
|
ease: [
|
|
4548
4666
|
0,
|
|
@@ -4550,7 +4668,7 @@ var ys = {
|
|
|
4550
4668
|
.2,
|
|
4551
4669
|
1
|
|
4552
4670
|
]
|
|
4553
|
-
},
|
|
4671
|
+
}, Ls = {
|
|
4554
4672
|
duration: .12,
|
|
4555
4673
|
ease: [
|
|
4556
4674
|
0,
|
|
@@ -4559,7 +4677,7 @@ var ys = {
|
|
|
4559
4677
|
1
|
|
4560
4678
|
]
|
|
4561
4679
|
};
|
|
4562
|
-
function
|
|
4680
|
+
function Rs(e) {
|
|
4563
4681
|
let t = O(40), n, r, i, a;
|
|
4564
4682
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({variant: a, className: n, disabled: r, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a);
|
|
4565
4683
|
let o = re(), s = a === "stop", c;
|
|
@@ -4599,7 +4717,7 @@ function xs(e) {
|
|
|
4599
4717
|
scale: .7
|
|
4600
4718
|
}, t[21] = o, t[22] = v);
|
|
4601
4719
|
let y;
|
|
4602
|
-
t[23] === s ? y = t[24] : (y = M(s ?
|
|
4720
|
+
t[23] === s ? y = t[24] : (y = M(s ? Vs : Bs, {}), t[23] = s, t[24] = y);
|
|
4603
4721
|
let b;
|
|
4604
4722
|
t[25] !== v || t[26] !== y || t[27] !== h || t[28] !== g ? (b = /* @__PURE__ */ M(te, {
|
|
4605
4723
|
initial: !1,
|
|
@@ -4607,7 +4725,7 @@ function xs(e) {
|
|
|
4607
4725
|
initial: g,
|
|
4608
4726
|
animate: _,
|
|
4609
4727
|
exit: v,
|
|
4610
|
-
transition:
|
|
4728
|
+
transition: Ls,
|
|
4611
4729
|
className: "absolute flex items-center justify-center",
|
|
4612
4730
|
children: y
|
|
4613
4731
|
}, h)
|
|
@@ -4617,7 +4735,7 @@ function xs(e) {
|
|
|
4617
4735
|
initial: c,
|
|
4618
4736
|
animate: l,
|
|
4619
4737
|
exit: u,
|
|
4620
|
-
transition:
|
|
4738
|
+
transition: Is,
|
|
4621
4739
|
whileHover: d,
|
|
4622
4740
|
whileTap: f,
|
|
4623
4741
|
"aria-label": p,
|
|
@@ -4627,7 +4745,7 @@ function xs(e) {
|
|
|
4627
4745
|
children: b
|
|
4628
4746
|
}), t[30] = r, t[31] = i, t[32] = c, t[33] = b, t[34] = u, t[35] = d, t[36] = f, t[37] = p, t[38] = m, t[39] = x) : x = t[39], x;
|
|
4629
4747
|
}
|
|
4630
|
-
function
|
|
4748
|
+
function zs(e) {
|
|
4631
4749
|
let t = O(2), { children: n } = e, r;
|
|
4632
4750
|
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M("svg", {
|
|
4633
4751
|
width: "20",
|
|
@@ -4638,13 +4756,13 @@ function Ss(e) {
|
|
|
4638
4756
|
children: n
|
|
4639
4757
|
}), t[0] = n, t[1] = r), r;
|
|
4640
4758
|
}
|
|
4641
|
-
function
|
|
4759
|
+
function Bs() {
|
|
4642
4760
|
let e = O(1), t;
|
|
4643
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4761
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(Fs, {}), e[0] = t) : t = e[0], t;
|
|
4644
4762
|
}
|
|
4645
|
-
function
|
|
4763
|
+
function Vs() {
|
|
4646
4764
|
let e = O(1), t;
|
|
4647
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4765
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(zs, { children: /* @__PURE__ */ M("rect", {
|
|
4648
4766
|
x: "5",
|
|
4649
4767
|
y: "5",
|
|
4650
4768
|
width: "10",
|
|
@@ -4654,18 +4772,18 @@ function ws() {
|
|
|
4654
4772
|
}
|
|
4655
4773
|
//#endregion
|
|
4656
4774
|
//#region src/lib/components/tool-error.tsx
|
|
4657
|
-
function
|
|
4775
|
+
function Hs(e) {
|
|
4658
4776
|
let t = O(25), { title: n, detail: r, detailLabel: i, part: a, error: o } = e, s = n === void 0 ? "Failed to render tool" : n, c = i === void 0 ? "View details" : i, l = H(), u;
|
|
4659
|
-
t[0] === o.issues ? u = t[1] : (u = o.issues.map(
|
|
4777
|
+
t[0] === o.issues ? u = t[1] : (u = o.issues.map(Us).join("\n"), t[0] = o.issues, t[1] = u);
|
|
4660
4778
|
let d = u, f;
|
|
4661
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(
|
|
4779
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(Fe, { className: "size-5" }), t[2] = f) : f = t[2];
|
|
4662
4780
|
let p;
|
|
4663
4781
|
t[3] === s ? p = t[4] : (p = /* @__PURE__ */ M(xe, { children: /* @__PURE__ */ N(Se, {
|
|
4664
4782
|
className: "text-destructive flex items-center gap-2",
|
|
4665
4783
|
children: [f, s]
|
|
4666
4784
|
}) }), t[3] = s, t[4] = p);
|
|
4667
4785
|
let m, h;
|
|
4668
|
-
t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(
|
|
4786
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(Fe, { className: "size-4" }), h = /* @__PURE__ */ M(ue, { children: "Error" }), t[5] = m, t[6] = h) : (m = t[5], h = t[6]);
|
|
4669
4787
|
let g;
|
|
4670
4788
|
t[7] === d ? g = t[8] : (g = /* @__PURE__ */ N(ce, {
|
|
4671
4789
|
variant: "destructive",
|
|
@@ -4706,7 +4824,7 @@ function Ts(e) {
|
|
|
4706
4824
|
});
|
|
4707
4825
|
}, t[15] = l, t[16] = a, t[17] = y) : y = t[17];
|
|
4708
4826
|
let x;
|
|
4709
|
-
t[18] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ M(
|
|
4827
|
+
t[18] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ M(tt, { className: "size-4" }), t[18] = x) : x = t[18];
|
|
4710
4828
|
let S;
|
|
4711
4829
|
t[19] === y ? S = t[20] : (S = /* @__PURE__ */ M(be, { children: /* @__PURE__ */ N(he, {
|
|
4712
4830
|
variant: "outline",
|
|
@@ -4724,71 +4842,71 @@ function Ts(e) {
|
|
|
4724
4842
|
]
|
|
4725
4843
|
}), t[21] = v, t[22] = S, t[23] = p, t[24] = C) : C = t[24], C;
|
|
4726
4844
|
}
|
|
4727
|
-
function
|
|
4845
|
+
function Us(e) {
|
|
4728
4846
|
return `${e.path.join(".")}: ${e.message}`;
|
|
4729
4847
|
}
|
|
4730
4848
|
//#endregion
|
|
4731
4849
|
//#region src/lib/components/Tip/TipProvider.tsx
|
|
4732
|
-
var
|
|
4733
|
-
function
|
|
4734
|
-
return l(
|
|
4850
|
+
var Ws = o("");
|
|
4851
|
+
function Gs() {
|
|
4852
|
+
return l(Ws);
|
|
4735
4853
|
}
|
|
4736
|
-
var
|
|
4737
|
-
function
|
|
4854
|
+
var Ks = "tips:history", qs = "tips:session";
|
|
4855
|
+
function Js() {
|
|
4738
4856
|
try {
|
|
4739
|
-
return JSON.parse(localStorage.getItem(
|
|
4857
|
+
return JSON.parse(localStorage.getItem(Ks) ?? "{}");
|
|
4740
4858
|
} catch (e) {
|
|
4741
|
-
if (
|
|
4859
|
+
if (Zs(e)) return {};
|
|
4742
4860
|
throw e;
|
|
4743
4861
|
}
|
|
4744
4862
|
}
|
|
4745
|
-
function
|
|
4863
|
+
function Ys(e, t) {
|
|
4746
4864
|
try {
|
|
4747
|
-
let n =
|
|
4748
|
-
n[e] = t, localStorage.setItem(
|
|
4865
|
+
let n = Js();
|
|
4866
|
+
n[e] = t, localStorage.setItem(Ks, JSON.stringify(n));
|
|
4749
4867
|
} catch (e) {
|
|
4750
|
-
if (!
|
|
4868
|
+
if (!Zs(e)) throw e;
|
|
4751
4869
|
}
|
|
4752
4870
|
}
|
|
4753
|
-
function
|
|
4871
|
+
function Xs(e) {
|
|
4754
4872
|
try {
|
|
4755
|
-
let t = localStorage.getItem(
|
|
4873
|
+
let t = localStorage.getItem(qs), n = t ? JSON.parse(t) : {
|
|
4756
4874
|
id: "",
|
|
4757
4875
|
n: 0
|
|
4758
4876
|
};
|
|
4759
|
-
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(
|
|
4877
|
+
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(qs, JSON.stringify(n))), n.n;
|
|
4760
4878
|
} catch (e) {
|
|
4761
|
-
if (
|
|
4879
|
+
if (Zs(e)) return 0;
|
|
4762
4880
|
throw e;
|
|
4763
4881
|
}
|
|
4764
4882
|
}
|
|
4765
|
-
function
|
|
4883
|
+
function Zs(e) {
|
|
4766
4884
|
return e instanceof SyntaxError || e instanceof DOMException && (e.name === "QuotaExceededError" || e.name === "SecurityError");
|
|
4767
4885
|
}
|
|
4768
|
-
function
|
|
4886
|
+
function Qs(e, t, n) {
|
|
4769
4887
|
let r = n[e];
|
|
4770
4888
|
return r == null ? Infinity : t - r;
|
|
4771
4889
|
}
|
|
4772
|
-
async function
|
|
4773
|
-
let r =
|
|
4890
|
+
async function $s(e, t, n) {
|
|
4891
|
+
let r = Js(), i = await Promise.all(e.map((e) => e.isRelevant(t))), a = e.filter((e, t) => i[t]);
|
|
4774
4892
|
if (a.length === 0) return null;
|
|
4775
|
-
let o = a.filter((e) =>
|
|
4776
|
-
s.sort((e, t) =>
|
|
4893
|
+
let o = a.filter((e) => Qs(e.id, n, r) >= e.cooldownSessions), s = o.length > 0 ? o : a;
|
|
4894
|
+
s.sort((e, t) => Qs(t.id, n, r) - Qs(e.id, n, r));
|
|
4777
4895
|
let c = s[0], l = await c.content(t);
|
|
4778
4896
|
return {
|
|
4779
4897
|
id: c.id,
|
|
4780
4898
|
text: l
|
|
4781
4899
|
};
|
|
4782
4900
|
}
|
|
4783
|
-
function
|
|
4901
|
+
function ec(e) {
|
|
4784
4902
|
let t = O(13), { tips: n, streaming: r, chatId: i, context: a, children: o } = e, s;
|
|
4785
|
-
t[0] === i ? s = t[1] : (s = () =>
|
|
4903
|
+
t[0] === i ? s = t[1] : (s = () => Xs(i), t[0] = i, t[1] = s);
|
|
4786
4904
|
let [c] = g(s), [l, u] = g(""), [p, m] = g(r), [_, v] = g(0);
|
|
4787
|
-
r !== p && (m(r), r && v(
|
|
4905
|
+
r !== p && (m(r), r && v(tc));
|
|
4788
4906
|
let y = h(!1), b;
|
|
4789
4907
|
t[2] !== a || t[3] !== c || t[4] !== n ? (b = () => {
|
|
4790
|
-
y.current || (y.current = !0,
|
|
4791
|
-
e && (u(e.text),
|
|
4908
|
+
y.current || (y.current = !0, $s(n, a, c).then((e) => {
|
|
4909
|
+
e && (u(e.text), Ys(e.id, c));
|
|
4792
4910
|
}).finally(() => {
|
|
4793
4911
|
y.current = !1;
|
|
4794
4912
|
}));
|
|
@@ -4800,17 +4918,17 @@ function Ls(e) {
|
|
|
4800
4918
|
let C;
|
|
4801
4919
|
t[8] === _ ? C = t[9] : (C = [_], t[8] = _, t[9] = C), d(S, C);
|
|
4802
4920
|
let w;
|
|
4803
|
-
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(
|
|
4921
|
+
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(Ws, {
|
|
4804
4922
|
value: l,
|
|
4805
4923
|
children: o
|
|
4806
4924
|
}), t[10] = o, t[11] = l, t[12] = w) : w = t[12], w;
|
|
4807
4925
|
}
|
|
4808
|
-
function
|
|
4926
|
+
function tc(e) {
|
|
4809
4927
|
return e + 1;
|
|
4810
4928
|
}
|
|
4811
|
-
function
|
|
4929
|
+
function nc(e) {
|
|
4812
4930
|
let t = O(6), { tips: n, context: r, children: i } = e, { chatId: a } = z(), { status: o } = B(), s = o === "streaming" || o === "submitted", c = a ?? "", l;
|
|
4813
|
-
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(
|
|
4931
|
+
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(ec, {
|
|
4814
4932
|
tips: n,
|
|
4815
4933
|
streaming: s,
|
|
4816
4934
|
chatId: c,
|
|
@@ -4820,25 +4938,25 @@ function zs(e) {
|
|
|
4820
4938
|
}
|
|
4821
4939
|
//#endregion
|
|
4822
4940
|
//#region src/lib/components/Tip/TipLine.tsx
|
|
4823
|
-
var
|
|
4824
|
-
function
|
|
4825
|
-
let t = O(13), { className: n } = e, r =
|
|
4941
|
+
var rc = 1.5;
|
|
4942
|
+
function ic(e) {
|
|
4943
|
+
let t = O(13), { className: n } = e, r = St(), i = Gs(), [a, o] = g(i), [s, c] = g(!1);
|
|
4826
4944
|
i !== a && (o(i), i && c(!0));
|
|
4827
4945
|
let l, u;
|
|
4828
4946
|
t[0] !== r || t[1] !== s ? (l = () => {
|
|
4829
4947
|
if (!s) return;
|
|
4830
|
-
let e = r.setTimeout(() => c(!1),
|
|
4948
|
+
let e = r.setTimeout(() => c(!1), rc * 1e3);
|
|
4831
4949
|
return () => r.clearTimeout(e);
|
|
4832
4950
|
}, u = [r, s], t[0] = r, t[1] = s, t[2] = l, t[3] = u) : (l = t[2], u = t[3]), d(l, u);
|
|
4833
4951
|
let f;
|
|
4834
4952
|
t[4] === n ? f = t[5] : (f = k("flex items-center justify-center gap-1.5 px-3 text-xs", n), t[4] = n, t[5] = f);
|
|
4835
4953
|
let p;
|
|
4836
|
-
t[6] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ M(
|
|
4954
|
+
t[6] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ M(Je, { className: "size-3 shrink-0" }), t[6] = p) : p = t[6];
|
|
4837
4955
|
let m;
|
|
4838
4956
|
t[7] !== s || t[8] !== i ? (m = /* @__PURE__ */ N(U, {
|
|
4839
4957
|
as: "span",
|
|
4840
4958
|
enabled: s,
|
|
4841
|
-
duration:
|
|
4959
|
+
duration: rc,
|
|
4842
4960
|
children: ["Tip: ", i]
|
|
4843
4961
|
}), t[7] = s, t[8] = i, t[9] = m) : m = t[9];
|
|
4844
4962
|
let h;
|
|
@@ -4849,7 +4967,7 @@ function Vs(e) {
|
|
|
4849
4967
|
}
|
|
4850
4968
|
//#endregion
|
|
4851
4969
|
//#region src/lib/hooks/use-async-generator.ts
|
|
4852
|
-
function
|
|
4970
|
+
function ac() {
|
|
4853
4971
|
let [e, t] = g({
|
|
4854
4972
|
loading: !1,
|
|
4855
4973
|
error: null
|
|
@@ -4879,7 +4997,7 @@ function Hs() {
|
|
|
4879
4997
|
}
|
|
4880
4998
|
//#endregion
|
|
4881
4999
|
//#region src/lib/hooks/use-auto-resize-textarea.ts
|
|
4882
|
-
function
|
|
5000
|
+
function oc(e) {
|
|
4883
5001
|
let t = O(16), { minHeight: n, maxHeight: r, value: i } = e, a = h(null), o;
|
|
4884
5002
|
t[0] !== r || t[1] !== n ? (o = (e) => {
|
|
4885
5003
|
let t = a.current;
|
|
@@ -4916,22 +5034,22 @@ function Us(e) {
|
|
|
4916
5034
|
}
|
|
4917
5035
|
//#endregion
|
|
4918
5036
|
//#region src/lib/hooks/use-keyboard.ts
|
|
4919
|
-
function
|
|
5037
|
+
function sc(e) {
|
|
4920
5038
|
let t = [];
|
|
4921
5039
|
return e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), e.altKey && t.push("alt"), e.shiftKey && t.push("shift"), t.push(e.key.toLowerCase()), t.join("+");
|
|
4922
5040
|
}
|
|
4923
|
-
function
|
|
5041
|
+
function cc(e) {
|
|
4924
5042
|
let t = O(4), { enabled: n, handlers: r } = e, i = n === void 0 || n, a, o;
|
|
4925
5043
|
t[0] !== i || t[1] !== r ? (a = () => {
|
|
4926
5044
|
if (!i) return;
|
|
4927
5045
|
let e = (e) => {
|
|
4928
|
-
let t =
|
|
5046
|
+
let t = sc(e), n = r[t];
|
|
4929
5047
|
n ||= r[e.key], n && (e.preventDefault(), e.stopPropagation(), n(e));
|
|
4930
5048
|
};
|
|
4931
5049
|
return document.addEventListener("keydown", e, !0), () => document.removeEventListener("keydown", e, !0);
|
|
4932
5050
|
}, o = [i, r], t[0] = i, t[1] = r, t[2] = a, t[3] = o) : (a = t[2], o = t[3]), d(a, o);
|
|
4933
5051
|
}
|
|
4934
5052
|
//#endregion
|
|
4935
|
-
export {
|
|
5053
|
+
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea, pi as AssistantSnapshot, ti as COPY_EXCLUSION_ATTRIBUTE, ni as COPY_EXCLUSION_MODES, Q as ChatActionButton, zt as ChatBot, Ts as ChatComposer, Ft as ChatManager, Es as ChatTextarea, Zn as CitationPill, Ur as CodeBlock, Wr as CodeBlockCopyButton, Yo as CompactMessages, qo as CompactTrajectory, pa as CopyAction, ha as CopyDebugJsonAction, Jn as IndexProgress, Ci as InteractiveResponse, Xn as MessageItemContext, qa as MessageMetadata, Ms as MessageQueue, as as Messages, fa as MessagesActions, Yn as MessagesContext, _a as MessagesError, ba as MessagesItem, ya as MessagesList, va as MessagesRoot, oo as MessagesUserBubble, ua as NestedTrajectory, Ca as PendingToolInput, nn as ReadOnlyChatTransport, ma as RegenerateAction, J as Response, X as Segment, li as SnapshotRenderPortal, Rs as SubmitButton, U as TextShimmer, fs as TimelinedMessages, ic as TipLine, ec as TipProvider, Ws as TipValueContext, nc as Tips, Vi as ToolArg, Hs as ToolError, ao as UserMessageContent, Ba as ZukhrufChatTransport, tn as citationIndexOf, Nt as clearPrefill, oe as defineElements, fi as extractAssistantRawText, en as extractSourcesFromMessages, La as formatUsageBreakdown, Ia as formatUsageValue, pn as getIndexProgressEvents, Z as getSegmentKey, ii as hasCopyExclusion, _i as isActiveClientInputTool, Wi as isCommentaryTextPart, mi as isSubagentPart, an as isToolAborted, rn as isToolStateAborted, ja as parseMetadataUsage, Aa as parseUsage, Pt as persistedPromptOf, jt as readPrefill, oi as resolveCopyToClipboardStrategy, gi as resolveToolEntry, sn as serializeToolsRegistry, ai as shouldIncludeInCopyImage, hi as subagentDisplayName, $t as urlCitationsOf, xa as useActivePendingToolInput, z as useAgent, Lt as useAgentChatSetup, H as useAgentMessages, V as useAgentMeta, B as useAgentStatus, ac as useAsyncGenerator, oc as useAutoResizeTextarea, Qt as useChatManager, Lo as useCompactGroup, di as useCopyElementAsImage, Y as useIsAssistantSnapshotRender, on as useIsToolAborted, cc as useKeyboard, K as useMessageItem, W as useMessagesContext, G as useMessagesStatus, Fa as useNormalizedUsageTracking, Gs as useTipValue, Qi as useToolSegment, Fo as useTrajectoryItems, ci as waitForNextPaint, Mt as writePrefill };
|
|
4936
5054
|
|
|
4937
5055
|
//# sourceMappingURL=index.js.map
|