@deepagents/react-genai 7.45.4 → 7.46.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 +811 -800
- package/dist/index.js.map +1 -1
- package/dist/lib/chat/citation-order.d.ts +12 -0
- package/dist/lib/chat/citation-order.d.ts.map +1 -0
- package/dist/lib/chat/citations.d.ts +4 -3
- package/dist/lib/chat/citations.d.ts.map +1 -1
- package/dist/lib/chat/message-parts.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/segments/index.d.ts.map +1 -1
- package/dist/lib/components/CitationPill.d.ts.map +1 -1
- package/dist/lib/copy/assistant-snapshot.d.ts +4 -0
- package/dist/lib/copy/assistant-snapshot.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -186,7 +186,7 @@ function zt(e) {
|
|
|
186
186
|
function Bt(e) {
|
|
187
187
|
let t = O(13), n;
|
|
188
188
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = { initial: "smooth" }, t[0] = n) : n = t[0];
|
|
189
|
-
let { scrollRef: r, contentRef: i } = ie(n), { hasSubmitted: a } =
|
|
189
|
+
let { scrollRef: r, contentRef: i } = ie(n), { hasSubmitted: a } = B(), o;
|
|
190
190
|
t[1] === e.className ? o = t[2] : (o = k("@container mx-auto h-full w-full overflow-y-auto", e.className), t[1] = e.className, t[2] = o);
|
|
191
191
|
let s = a ? "min-h-full" : "h-full justify-center", c;
|
|
192
192
|
t[3] === s ? c = t[4] : (c = k("relative mx-auto flex w-full flex-col", s), t[3] = s, t[4] = c);
|
|
@@ -207,7 +207,7 @@ function Bt(e) {
|
|
|
207
207
|
}), t[9] = r, t[10] = o, t[11] = l, t[12] = u) : u = t[12], u;
|
|
208
208
|
}
|
|
209
209
|
function Vt(e) {
|
|
210
|
-
let t = O(12), { hasSubmitted: n } =
|
|
210
|
+
let t = O(12), { hasSubmitted: n } = B(), r;
|
|
211
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];
|
|
212
212
|
let i;
|
|
213
213
|
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = { layout: {
|
|
@@ -237,7 +237,7 @@ function Vt(e) {
|
|
|
237
237
|
}
|
|
238
238
|
Vt.displayName = "AgentHeader.Root";
|
|
239
239
|
function Ht(e) {
|
|
240
|
-
let t = O(6), { hasSubmitted: n } =
|
|
240
|
+
let t = O(6), { hasSubmitted: n } = B(), r;
|
|
241
241
|
t[0] !== n || t[1] !== e.children || t[2] !== e.icon ? (r = !n && /* @__PURE__ */ M(A.div, {
|
|
242
242
|
exit: { opacity: 0 },
|
|
243
243
|
transition: { duration: .2 },
|
|
@@ -263,7 +263,7 @@ function Ut(e) {
|
|
|
263
263
|
}
|
|
264
264
|
Ut.displayName = "AgentHeader.Title";
|
|
265
265
|
function Wt(e) {
|
|
266
|
-
let t = O(5), { hasSubmitted: n } =
|
|
266
|
+
let t = O(5), { hasSubmitted: n } = B(), r;
|
|
267
267
|
t[0] !== n || t[1] !== e.children ? (r = n && !!e.children && /* @__PURE__ */ M(A.p, {
|
|
268
268
|
initial: { opacity: 0 },
|
|
269
269
|
animate: { opacity: 1 },
|
|
@@ -351,49 +351,58 @@ function z() {
|
|
|
351
351
|
if (e === void 0) throw Error("useAgent must be used within an AgentProvider");
|
|
352
352
|
return e;
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function Qt() {
|
|
355
355
|
return { status: l(qt) };
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function B() {
|
|
358
358
|
let e = l(Xt);
|
|
359
359
|
if (e === void 0) throw Error("useAgentMeta must be used within an AgentProvider");
|
|
360
360
|
return e;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function V() {
|
|
363
363
|
let e = l(Jt);
|
|
364
364
|
if (e === void 0) throw Error("useAgentMessages must be used within an AgentProvider");
|
|
365
365
|
return e;
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function $t() {
|
|
368
368
|
let e = l(Yt);
|
|
369
369
|
if (!e) throw Error("useChatManager must be used within an AgentProvider");
|
|
370
370
|
return e;
|
|
371
371
|
}
|
|
372
372
|
//#endregion
|
|
373
|
+
//#region src/lib/chat/citation-order.ts
|
|
374
|
+
function en(e, t) {
|
|
375
|
+
return t.map((t, n) => ({
|
|
376
|
+
citation: t,
|
|
377
|
+
order: n,
|
|
378
|
+
at: t.endIndex ?? e.length
|
|
379
|
+
})).sort((e, t) => e.at - t.at || e.order - t.order);
|
|
380
|
+
}
|
|
381
|
+
//#endregion
|
|
373
382
|
//#region src/lib/chat/citations.ts
|
|
374
|
-
function
|
|
383
|
+
function H(e) {
|
|
375
384
|
return (e ?? []).filter((e) => e.source.sourceType === "url");
|
|
376
385
|
}
|
|
377
|
-
function
|
|
378
|
-
let t =
|
|
379
|
-
|
|
386
|
+
function tn(e) {
|
|
387
|
+
let t = new Set(e.parts.flatMap((e) => e.type === "text" ? H(e.citations).map(({ source: e }) => e.url) : [])), n = /* @__PURE__ */ new Map(), r = (e, t) => {
|
|
388
|
+
n.has(e) || n.set(e, {
|
|
380
389
|
url: e,
|
|
381
|
-
title:
|
|
382
|
-
})
|
|
390
|
+
title: t
|
|
391
|
+
});
|
|
383
392
|
};
|
|
384
|
-
for (let
|
|
385
|
-
if (
|
|
386
|
-
|
|
393
|
+
for (let n of e.parts) {
|
|
394
|
+
if (n.type === "text") for (let { citation: e } of en(n.text, H(n.citations))) r(e.source.url, e.source.title);
|
|
395
|
+
n.type === "source-url" && !t.has(n.url) && r(n.url, n.title);
|
|
387
396
|
}
|
|
388
|
-
return n;
|
|
397
|
+
return [...n.values()];
|
|
389
398
|
}
|
|
390
|
-
function
|
|
399
|
+
function nn(e, t) {
|
|
391
400
|
let n = e.findIndex((e) => e.url === t);
|
|
392
401
|
return n === -1 ? null : n + 1;
|
|
393
402
|
}
|
|
394
403
|
//#endregion
|
|
395
404
|
//#region src/lib/chat/read-only-transport.ts
|
|
396
|
-
var
|
|
405
|
+
var rn = class {
|
|
397
406
|
sendMessages() {
|
|
398
407
|
return Promise.reject(/* @__PURE__ */ Error("This chat is read-only: it has no transport to send messages through."));
|
|
399
408
|
}
|
|
@@ -403,19 +412,19 @@ var nn = class {
|
|
|
403
412
|
};
|
|
404
413
|
//#endregion
|
|
405
414
|
//#region src/lib/chat/tool-abort.ts
|
|
406
|
-
function
|
|
415
|
+
function an(e, t) {
|
|
407
416
|
return t === "streaming" || t === "submitted" ? !1 : e === "input-streaming" || e === "input-available";
|
|
408
417
|
}
|
|
409
|
-
function
|
|
410
|
-
return
|
|
418
|
+
function on(e, t) {
|
|
419
|
+
return an(e.state, t);
|
|
411
420
|
}
|
|
412
|
-
function
|
|
413
|
-
let t = O(3), { status: n } =
|
|
414
|
-
return t[0] !== e || t[1] !== n ? (r =
|
|
421
|
+
function sn(e) {
|
|
422
|
+
let t = O(3), { status: n } = Qt(), r;
|
|
423
|
+
return t[0] !== e || t[1] !== n ? (r = on(e, n), t[0] = e, t[1] = n, t[2] = r) : r = t[2], r;
|
|
415
424
|
}
|
|
416
425
|
//#endregion
|
|
417
426
|
//#region src/lib/chat/tools-schema.ts
|
|
418
|
-
function
|
|
427
|
+
function cn(e) {
|
|
419
428
|
return Object.entries(e).reduce((e, [t, n]) => (n.static || (e[t] = {
|
|
420
429
|
inputSchema: P.toJSONSchema(n.inputSchema, {
|
|
421
430
|
io: "input",
|
|
@@ -440,7 +449,7 @@ function U(e) {
|
|
|
440
449
|
}
|
|
441
450
|
//#endregion
|
|
442
451
|
//#region src/lib/chat/trajectory/compact-disclosure.tsx
|
|
443
|
-
function
|
|
452
|
+
function ln(e) {
|
|
444
453
|
let t = O(4), { className: n } = e, r;
|
|
445
454
|
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);
|
|
446
455
|
let i;
|
|
@@ -449,22 +458,22 @@ function cn(e) {
|
|
|
449
458
|
className: r
|
|
450
459
|
}), t[2] = r, t[3] = i), i;
|
|
451
460
|
}
|
|
452
|
-
function
|
|
461
|
+
function un(e) {
|
|
453
462
|
return k("group hover:bg-muted/30 flex min-h-7 w-full gap-2 rounded-sm py-1 text-left transition-colors", e);
|
|
454
463
|
}
|
|
455
464
|
//#endregion
|
|
456
465
|
//#region src/lib/chat/trajectory/IndexProgressSegment.tsx
|
|
457
|
-
var
|
|
466
|
+
var dn = "data-text2sql-index-progress", fn = {
|
|
458
467
|
initial: "instant",
|
|
459
468
|
resize: "instant"
|
|
460
469
|
};
|
|
461
|
-
function fn(e) {
|
|
462
|
-
return e.type === un;
|
|
463
|
-
}
|
|
464
470
|
function pn(e) {
|
|
465
|
-
return e.
|
|
471
|
+
return e.type === dn;
|
|
466
472
|
}
|
|
467
473
|
function mn(e) {
|
|
474
|
+
return e.parts.filter(pn).map((e) => e.data);
|
|
475
|
+
}
|
|
476
|
+
function hn(e) {
|
|
468
477
|
let t = /* @__PURE__ */ new Map(), n = "running", r, i, a = (e, n) => {
|
|
469
478
|
let r = t.get(e) ?? {
|
|
470
479
|
name: e,
|
|
@@ -526,11 +535,11 @@ function mn(e) {
|
|
|
526
535
|
errorMessage: i
|
|
527
536
|
};
|
|
528
537
|
}
|
|
529
|
-
function
|
|
538
|
+
function gn(e) {
|
|
530
539
|
let t = O(2), n;
|
|
531
|
-
return t[0] === e ? n = t[1] : (n =
|
|
540
|
+
return t[0] === e ? n = t[1] : (n = hn(e), t[0] = e, t[1] = n), n;
|
|
532
541
|
}
|
|
533
|
-
function
|
|
542
|
+
function _n(e) {
|
|
534
543
|
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;
|
|
535
544
|
t[0] !== i || t[1] !== o || t[2] !== a ? (u = (e) => {
|
|
536
545
|
i === void 0 && c({
|
|
@@ -544,20 +553,20 @@ function gn(e) {
|
|
|
544
553
|
handleOpenChange: d
|
|
545
554
|
}, t[4] = d, t[5] = l, t[6] = f) : f = t[6], f;
|
|
546
555
|
}
|
|
547
|
-
function
|
|
556
|
+
function vn(e, t) {
|
|
548
557
|
return e.length === 0 ? !0 : t.status !== "complete" || t.adapters.length === 0 ? !1 : t.adapters.every((e) => e.status === "cache-hit");
|
|
549
558
|
}
|
|
550
|
-
function
|
|
559
|
+
function yn(e) {
|
|
551
560
|
return e.filter((e) => e.type === "index:start").length;
|
|
552
561
|
}
|
|
553
|
-
function
|
|
562
|
+
function bn(e) {
|
|
554
563
|
return e.filter((e) => [
|
|
555
564
|
"adapter:start",
|
|
556
565
|
"adapter:cache-hit",
|
|
557
566
|
"adapter:cache-miss"
|
|
558
567
|
].includes(e.type)).length;
|
|
559
568
|
}
|
|
560
|
-
function
|
|
569
|
+
function xn(e) {
|
|
561
570
|
let t = (e.totalAdapters ?? e.adapters.length) > 1;
|
|
562
571
|
if (e.status === "error") {
|
|
563
572
|
let n = e.adapters.find((e) => e.status === "error");
|
|
@@ -573,7 +582,7 @@ function bn(e) {
|
|
|
573
582
|
}
|
|
574
583
|
return e.adapters.length === 0 || !t ? ["Schema indexed"] : ["Schema indexed", `${e.adapters.length} adapters`];
|
|
575
584
|
}
|
|
576
|
-
function
|
|
585
|
+
function Sn(e) {
|
|
577
586
|
if (e.status === "error") return [
|
|
578
587
|
"Failed",
|
|
579
588
|
e.name,
|
|
@@ -597,18 +606,18 @@ function xn(e) {
|
|
|
597
606
|
"queued"
|
|
598
607
|
];
|
|
599
608
|
}
|
|
600
|
-
function
|
|
609
|
+
function Cn(e) {
|
|
601
610
|
return ["Failed", e.errorMessage ?? "unknown error"];
|
|
602
611
|
}
|
|
603
|
-
var
|
|
604
|
-
function
|
|
605
|
-
let t = l(
|
|
612
|
+
var wn = o(null);
|
|
613
|
+
function Tn(e) {
|
|
614
|
+
let t = l(wn);
|
|
606
615
|
if (!t) throw Error(`<IndexProgress.${e}> must be used inside <IndexProgress.Root>`);
|
|
607
616
|
return t;
|
|
608
617
|
}
|
|
609
|
-
function
|
|
610
|
-
let t = O(21), { events: n, open: r, onOpenChange: i, children: a, className: o } = e, s =
|
|
611
|
-
t[0] === n ? l = t[1] : (l =
|
|
618
|
+
function En(e) {
|
|
619
|
+
let t = O(21), { events: n, open: r, onOpenChange: i, children: a, className: o } = e, s = gn(n), c = s.status, l;
|
|
620
|
+
t[0] === n ? l = t[1] : (l = yn(n), t[0] = n, t[1] = l);
|
|
612
621
|
let u;
|
|
613
622
|
t[2] !== r || t[3] !== i || t[4] !== s.status || t[5] !== l ? (u = {
|
|
614
623
|
status: c,
|
|
@@ -616,8 +625,8 @@ function Tn(e) {
|
|
|
616
625
|
controlledOpen: r,
|
|
617
626
|
onOpenChange: i
|
|
618
627
|
}, t[2] = r, t[3] = i, t[4] = s.status, t[5] = l, t[6] = u) : u = t[6];
|
|
619
|
-
let { isOpen: d, handleOpenChange: f } =
|
|
620
|
-
if (
|
|
628
|
+
let { isOpen: d, handleOpenChange: f } = _n(u);
|
|
629
|
+
if (vn(n, s)) return null;
|
|
621
630
|
let p;
|
|
622
631
|
t[7] !== n || t[8] !== s ? (p = {
|
|
623
632
|
state: s,
|
|
@@ -635,14 +644,14 @@ function Tn(e) {
|
|
|
635
644
|
children: a
|
|
636
645
|
}), t[12] = a, t[13] = f, t[14] = d, t[15] = s.status, t[16] = h, t[17] = g) : g = t[17];
|
|
637
646
|
let _;
|
|
638
|
-
return t[18] !== p || t[19] !== g ? (_ = /* @__PURE__ */ M(
|
|
647
|
+
return t[18] !== p || t[19] !== g ? (_ = /* @__PURE__ */ M(wn, {
|
|
639
648
|
value: p,
|
|
640
649
|
children: g
|
|
641
650
|
}), t[18] = p, t[19] = g, t[20] = _) : _ = t[20], _;
|
|
642
651
|
}
|
|
643
|
-
function
|
|
644
|
-
let t = O(13), { className: n } = e, { state: r } =
|
|
645
|
-
t[0] === n ? i = t[1] : (i =
|
|
652
|
+
function Dn(e) {
|
|
653
|
+
let t = O(13), { className: n } = e, { state: r } = Tn("Trigger"), i;
|
|
654
|
+
t[0] === n ? i = t[1] : (i = On(n), t[0] = n, t[1] = i);
|
|
646
655
|
let a;
|
|
647
656
|
t[2] === i ? a = t[3] : (a = /* @__PURE__ */ M("button", {
|
|
648
657
|
type: "button",
|
|
@@ -650,28 +659,28 @@ function En(e) {
|
|
|
650
659
|
className: i
|
|
651
660
|
}), t[2] = i, t[3] = a);
|
|
652
661
|
let o;
|
|
653
|
-
t[4] === r ? o = t[5] : (o =
|
|
662
|
+
t[4] === r ? o = t[5] : (o = xn(r), t[4] = r, t[5] = o);
|
|
654
663
|
let s = r.status === "running", c;
|
|
655
|
-
t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ M(
|
|
664
|
+
t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ M(kn, {
|
|
656
665
|
segments: o,
|
|
657
666
|
isRunning: s
|
|
658
667
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8];
|
|
659
668
|
let l;
|
|
660
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ M(
|
|
669
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ M(jn, {}), t[9] = l) : l = t[9];
|
|
661
670
|
let u;
|
|
662
671
|
return t[10] !== a || t[11] !== c ? (u = /* @__PURE__ */ N(L, {
|
|
663
672
|
render: a,
|
|
664
673
|
children: [c, l]
|
|
665
674
|
}), t[10] = a, t[11] = c, t[12] = u) : u = t[12], u;
|
|
666
675
|
}
|
|
667
|
-
function Dn(e) {
|
|
668
|
-
return ln(k("items-baseline px-1", e));
|
|
669
|
-
}
|
|
670
676
|
function On(e) {
|
|
677
|
+
return un(k("items-baseline px-1", e));
|
|
678
|
+
}
|
|
679
|
+
function kn(e) {
|
|
671
680
|
let t = O(8), { segments: n, isRunning: r } = e, i = n.length - 1, a;
|
|
672
681
|
if (t[0] !== i || t[1] !== n) {
|
|
673
682
|
let e;
|
|
674
|
-
t[3] === i ? e = t[4] : (e = (e, t) => /* @__PURE__ */ M(
|
|
683
|
+
t[3] === i ? e = t[4] : (e = (e, t) => /* @__PURE__ */ M(An, {
|
|
675
684
|
segment: e,
|
|
676
685
|
index: t,
|
|
677
686
|
isLast: t === i
|
|
@@ -685,7 +694,7 @@ function On(e) {
|
|
|
685
694
|
children: a
|
|
686
695
|
}), t[5] = r, t[6] = a, t[7] = o) : o = t[7], o;
|
|
687
696
|
}
|
|
688
|
-
function
|
|
697
|
+
function An(e) {
|
|
689
698
|
let t = O(11), { segment: n, index: r, isLast: i } = e, o;
|
|
690
699
|
t[0] === r ? o = t[1] : (o = r > 0 && /* @__PURE__ */ M("span", {
|
|
691
700
|
"aria-hidden": !0,
|
|
@@ -702,11 +711,11 @@ function kn(e) {
|
|
|
702
711
|
let d;
|
|
703
712
|
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;
|
|
704
713
|
}
|
|
705
|
-
function
|
|
714
|
+
function jn() {
|
|
706
715
|
let e = O(1), t;
|
|
707
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
716
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(ln, { className: "text-muted-foreground/60 size-3" }), e[0] = t) : t = e[0], t;
|
|
708
717
|
}
|
|
709
|
-
function
|
|
718
|
+
function Mn(e) {
|
|
710
719
|
let t = O(3), { className: n, children: r } = e, i;
|
|
711
720
|
return t[0] !== r || t[1] !== n ? (i = /* @__PURE__ */ M(I, {
|
|
712
721
|
"data-slot": "index-progress-content",
|
|
@@ -714,7 +723,7 @@ function jn(e) {
|
|
|
714
723
|
children: r
|
|
715
724
|
}), t[0] = r, t[1] = n, t[2] = i) : i = t[2], i;
|
|
716
725
|
}
|
|
717
|
-
function
|
|
726
|
+
function Nn(e) {
|
|
718
727
|
let t = O(11), { event: n } = e, r;
|
|
719
728
|
t[0] === n.type ? r = t[1] : (r = /* @__PURE__ */ M("span", {
|
|
720
729
|
className: "text-muted-foreground/50 w-40 shrink-0 truncate",
|
|
@@ -744,7 +753,7 @@ function Mn(e) {
|
|
|
744
753
|
]
|
|
745
754
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o) : o = t[10], o;
|
|
746
755
|
}
|
|
747
|
-
function
|
|
756
|
+
function Pn(e) {
|
|
748
757
|
let t = O(2), n;
|
|
749
758
|
if (t[0] !== e) {
|
|
750
759
|
let r = /* @__PURE__ */ new Map(), i = [];
|
|
@@ -759,25 +768,25 @@ function Nn(e) {
|
|
|
759
768
|
} else n = t[1];
|
|
760
769
|
return n;
|
|
761
770
|
}
|
|
762
|
-
function
|
|
763
|
-
let t = O(8), { className: n } = e, { events: r } =
|
|
771
|
+
function Fn(e) {
|
|
772
|
+
let t = O(8), { className: n } = e, { events: r } = Tn("EventLog"), i = Pn(r), a;
|
|
764
773
|
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);
|
|
765
774
|
let o = a;
|
|
766
775
|
if (i.byAdapter.size <= 1) {
|
|
767
776
|
let e;
|
|
768
|
-
return t[2] !== o || t[3] !== r ? (e = /* @__PURE__ */ M(
|
|
777
|
+
return t[2] !== o || t[3] !== r ? (e = /* @__PURE__ */ M(Ln, {
|
|
769
778
|
events: r,
|
|
770
779
|
className: o
|
|
771
780
|
}), t[2] = o, t[3] = r, t[4] = e) : e = t[4], e;
|
|
772
781
|
}
|
|
773
782
|
let s;
|
|
774
|
-
return t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ M(
|
|
783
|
+
return t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ M(zn, {
|
|
775
784
|
groupedEvents: i,
|
|
776
785
|
className: o
|
|
777
786
|
}), t[5] = o, t[6] = i, t[7] = s) : s = t[7], s;
|
|
778
787
|
}
|
|
779
|
-
function
|
|
780
|
-
let t = O(8), { className: n, contentClassName: r, children: i } = e, { scrollRef: a, contentRef: o } = ie(
|
|
788
|
+
function In(e) {
|
|
789
|
+
let t = O(8), { className: n, contentClassName: r, children: i } = e, { scrollRef: a, contentRef: o } = ie(fn), s;
|
|
781
790
|
t[0] !== i || t[1] !== r || t[2] !== o ? (s = /* @__PURE__ */ M("div", {
|
|
782
791
|
ref: o,
|
|
783
792
|
"data-slot": "index-progress-event-log",
|
|
@@ -791,56 +800,56 @@ function Fn(e) {
|
|
|
791
800
|
children: s
|
|
792
801
|
}), t[4] = n, t[5] = a, t[6] = s, t[7] = c) : c = t[7], c;
|
|
793
802
|
}
|
|
794
|
-
function
|
|
803
|
+
function Ln(e) {
|
|
795
804
|
let t = O(7), { events: n, className: r } = e, i;
|
|
796
|
-
t[0] === n ? i = t[1] : (i = n.map(
|
|
805
|
+
t[0] === n ? i = t[1] : (i = n.map(Rn), t[0] = n, t[1] = i);
|
|
797
806
|
let a;
|
|
798
807
|
t[2] === i ? a = t[3] : (a = /* @__PURE__ */ M("ul", {
|
|
799
808
|
className: "space-y-0.5",
|
|
800
809
|
children: i
|
|
801
810
|
}), t[2] = i, t[3] = a);
|
|
802
811
|
let o;
|
|
803
|
-
return t[4] !== r || t[5] !== a ? (o = /* @__PURE__ */ M(
|
|
812
|
+
return t[4] !== r || t[5] !== a ? (o = /* @__PURE__ */ M(In, {
|
|
804
813
|
className: r,
|
|
805
814
|
children: a
|
|
806
815
|
}), t[4] = r, t[5] = a, t[6] = o) : o = t[6], o;
|
|
807
816
|
}
|
|
808
|
-
function
|
|
809
|
-
return /* @__PURE__ */ M(
|
|
817
|
+
function Rn(e, t) {
|
|
818
|
+
return /* @__PURE__ */ M(Nn, { event: e }, `${e.type}-${t}`);
|
|
810
819
|
}
|
|
811
|
-
function
|
|
820
|
+
function zn(e) {
|
|
812
821
|
let t = O(8), { groupedEvents: n, className: r } = e, i;
|
|
813
822
|
t[0] === n.globalEvents ? i = t[1] : (i = n.globalEvents.length > 0 && /* @__PURE__ */ M("ul", {
|
|
814
823
|
className: "space-y-0.5",
|
|
815
|
-
children: n.globalEvents.map(
|
|
824
|
+
children: n.globalEvents.map(Vn)
|
|
816
825
|
}), t[0] = n.globalEvents, t[1] = i);
|
|
817
826
|
let a;
|
|
818
|
-
t[2] === n.byAdapter ? a = t[3] : (a = Array.from(n.byAdapter.entries()).map(
|
|
827
|
+
t[2] === n.byAdapter ? a = t[3] : (a = Array.from(n.byAdapter.entries()).map(Bn), t[2] = n.byAdapter, t[3] = a);
|
|
819
828
|
let o;
|
|
820
|
-
return t[4] !== r || t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(
|
|
829
|
+
return t[4] !== r || t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(In, {
|
|
821
830
|
className: r,
|
|
822
831
|
contentClassName: "space-y-2",
|
|
823
832
|
children: [i, a]
|
|
824
833
|
}), t[4] = r, t[5] = i, t[6] = a, t[7] = o) : o = t[7], o;
|
|
825
834
|
}
|
|
826
|
-
function
|
|
835
|
+
function Bn(e) {
|
|
827
836
|
let [t, n] = e;
|
|
828
|
-
return /* @__PURE__ */ M(
|
|
837
|
+
return /* @__PURE__ */ M(Hn, {
|
|
829
838
|
name: t,
|
|
830
839
|
events: n
|
|
831
840
|
}, t);
|
|
832
841
|
}
|
|
833
|
-
function
|
|
834
|
-
return /* @__PURE__ */ M(
|
|
842
|
+
function Vn(e, t) {
|
|
843
|
+
return /* @__PURE__ */ M(Nn, { event: e }, `${e.type}-${t}`);
|
|
835
844
|
}
|
|
836
|
-
function
|
|
845
|
+
function Hn(e) {
|
|
837
846
|
let t = O(9), { name: n, events: r } = e, i;
|
|
838
847
|
t[0] === n ? i = t[1] : (i = /* @__PURE__ */ M("div", {
|
|
839
848
|
className: "text-foreground/90",
|
|
840
849
|
children: n
|
|
841
850
|
}), t[0] = n, t[1] = i);
|
|
842
851
|
let a;
|
|
843
|
-
t[2] === r ? a = t[3] : (a = r.map(
|
|
852
|
+
t[2] === r ? a = t[3] : (a = r.map(Un), t[2] = r, t[3] = a);
|
|
844
853
|
let o;
|
|
845
854
|
t[4] === a ? o = t[5] : (o = /* @__PURE__ */ M("ul", {
|
|
846
855
|
className: "space-y-0.5",
|
|
@@ -852,21 +861,21 @@ function Vn(e) {
|
|
|
852
861
|
children: [i, o]
|
|
853
862
|
}), t[6] = i, t[7] = o, t[8] = s) : s = t[8], s;
|
|
854
863
|
}
|
|
855
|
-
function
|
|
856
|
-
return /* @__PURE__ */ M(
|
|
864
|
+
function Un(e, t) {
|
|
865
|
+
return /* @__PURE__ */ M(Nn, { event: e }, `${e.type}-${t}`);
|
|
857
866
|
}
|
|
858
|
-
function
|
|
859
|
-
let t = O(22), { events: n, className: r, showCacheHits: i } = e, a = i !== void 0 && i, o =
|
|
860
|
-
t[0] === s.globalEvents ? c = t[1] : (c = s.globalEvents.filter(
|
|
867
|
+
function Wn(e) {
|
|
868
|
+
let t = O(22), { events: n, className: r, showCacheHits: i } = e, a = i !== void 0 && i, o = gn(n), s = Pn(n), c;
|
|
869
|
+
t[0] === s.globalEvents ? c = t[1] : (c = s.globalEvents.filter(Gn), t[0] = s.globalEvents, t[1] = c);
|
|
861
870
|
let l = c;
|
|
862
|
-
if (n.length === 0 || !a &&
|
|
871
|
+
if (n.length === 0 || !a && vn(n, o)) return null;
|
|
863
872
|
if (o.adapters.length === 0) {
|
|
864
873
|
let e;
|
|
865
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M(
|
|
874
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M(Dn, {}), t[2] = e) : e = t[2];
|
|
866
875
|
let i;
|
|
867
|
-
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M(
|
|
876
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M(Mn, { children: /* @__PURE__ */ M(Fn, {}) }), t[3] = i) : i = t[3];
|
|
868
877
|
let a;
|
|
869
|
-
return t[4] !== r || t[5] !== n ? (a = /* @__PURE__ */ N(
|
|
878
|
+
return t[4] !== r || t[5] !== n ? (a = /* @__PURE__ */ N(En, {
|
|
870
879
|
events: n,
|
|
871
880
|
className: r,
|
|
872
881
|
children: [e, i]
|
|
@@ -877,13 +886,13 @@ function Un(e) {
|
|
|
877
886
|
let f;
|
|
878
887
|
if (t[9] !== s.byAdapter || t[10] !== o.adapters) {
|
|
879
888
|
let e;
|
|
880
|
-
t[12] === s.byAdapter ? e = t[13] : (e = (e) => /* @__PURE__ */ M(
|
|
889
|
+
t[12] === s.byAdapter ? e = t[13] : (e = (e) => /* @__PURE__ */ M(Kn, {
|
|
881
890
|
adapter: e,
|
|
882
891
|
events: s.byAdapter.get(e.name) ?? []
|
|
883
892
|
}, 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;
|
|
884
893
|
} else f = t[11];
|
|
885
894
|
let p;
|
|
886
|
-
t[14] !== l || t[15] !== o ? (p = l.length > 0 && /* @__PURE__ */ M(
|
|
895
|
+
t[14] !== l || t[15] !== o ? (p = l.length > 0 && /* @__PURE__ */ M(Jn, {
|
|
887
896
|
state: o,
|
|
888
897
|
events: l
|
|
889
898
|
}), t[14] = l, t[15] = o, t[16] = p) : p = t[16];
|
|
@@ -895,32 +904,32 @@ function Un(e) {
|
|
|
895
904
|
children: [f, p]
|
|
896
905
|
}), t[17] = o.status, t[18] = d, t[19] = f, t[20] = p, t[21] = m) : m = t[21], m;
|
|
897
906
|
}
|
|
898
|
-
function
|
|
907
|
+
function Gn(e) {
|
|
899
908
|
return e.type === "index:error";
|
|
900
909
|
}
|
|
901
|
-
function
|
|
910
|
+
function Kn(e) {
|
|
902
911
|
let t = O(22), { adapter: n, events: r } = e, i = n.status, a;
|
|
903
|
-
t[0] === r ? a = t[1] : (a =
|
|
912
|
+
t[0] === r ? a = t[1] : (a = bn(r), t[0] = r, t[1] = a);
|
|
904
913
|
let o;
|
|
905
914
|
t[2] !== n.status || t[3] !== a ? (o = {
|
|
906
915
|
status: i,
|
|
907
916
|
resetKey: a
|
|
908
917
|
}, t[2] = n.status, t[3] = a, t[4] = o) : o = t[4];
|
|
909
|
-
let { isOpen: s, handleOpenChange: c } =
|
|
918
|
+
let { isOpen: s, handleOpenChange: c } = _n(o), l = n.status, u;
|
|
910
919
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ M("button", {
|
|
911
920
|
type: "button",
|
|
912
921
|
"data-slot": "index-progress-adapter-trigger",
|
|
913
|
-
className:
|
|
922
|
+
className: On()
|
|
914
923
|
}), t[5] = u) : u = t[5];
|
|
915
924
|
let d;
|
|
916
|
-
t[6] === n ? d = t[7] : (d =
|
|
925
|
+
t[6] === n ? d = t[7] : (d = Sn(n), t[6] = n, t[7] = d);
|
|
917
926
|
let f = n.status === "running", p;
|
|
918
|
-
t[8] !== d || t[9] !== f ? (p = /* @__PURE__ */ M(
|
|
927
|
+
t[8] !== d || t[9] !== f ? (p = /* @__PURE__ */ M(kn, {
|
|
919
928
|
segments: d,
|
|
920
929
|
isRunning: f
|
|
921
930
|
}), t[8] = d, t[9] = f, t[10] = p) : p = t[10];
|
|
922
931
|
let m;
|
|
923
|
-
t[11] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(
|
|
932
|
+
t[11] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(jn, {}), t[11] = m) : m = t[11];
|
|
924
933
|
let h;
|
|
925
934
|
t[12] === p ? h = t[13] : (h = /* @__PURE__ */ N(L, {
|
|
926
935
|
render: u,
|
|
@@ -929,7 +938,7 @@ function Gn(e) {
|
|
|
929
938
|
let g;
|
|
930
939
|
t[14] === r ? g = t[15] : (g = /* @__PURE__ */ M(I, {
|
|
931
940
|
"data-slot": "index-progress-adapter-content",
|
|
932
|
-
children: /* @__PURE__ */ M(
|
|
941
|
+
children: /* @__PURE__ */ M(qn, { events: r })
|
|
933
942
|
}), t[14] = r, t[15] = g);
|
|
934
943
|
let _;
|
|
935
944
|
return t[16] !== n.status || t[17] !== c || t[18] !== s || t[19] !== h || t[20] !== g ? (_ = /* @__PURE__ */ N(F, {
|
|
@@ -941,36 +950,36 @@ function Gn(e) {
|
|
|
941
950
|
children: [h, g]
|
|
942
951
|
}), t[16] = n.status, t[17] = c, t[18] = s, t[19] = h, t[20] = g, t[21] = _) : _ = t[21], _;
|
|
943
952
|
}
|
|
944
|
-
function
|
|
953
|
+
function qn(e) {
|
|
945
954
|
let t = O(2), { events: n } = e;
|
|
946
955
|
if (n.length === 0) return null;
|
|
947
956
|
let r;
|
|
948
|
-
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M(
|
|
957
|
+
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M(Ln, {
|
|
949
958
|
events: n,
|
|
950
959
|
className: "mt-2 ml-4 max-h-64 overflow-y-auto font-mono text-[11px]"
|
|
951
960
|
}), t[0] = n, t[1] = r), r;
|
|
952
961
|
}
|
|
953
|
-
function
|
|
962
|
+
function Jn(e) {
|
|
954
963
|
let t = O(20), { state: n, events: r } = e, i;
|
|
955
964
|
t[0] !== r.length || t[1] !== n.status ? (i = {
|
|
956
965
|
status: n.status,
|
|
957
966
|
resetKey: r.length
|
|
958
967
|
}, t[0] = r.length, t[1] = n.status, t[2] = i) : i = t[2];
|
|
959
|
-
let { isOpen: a, handleOpenChange: o } =
|
|
968
|
+
let { isOpen: a, handleOpenChange: o } = _n(i), s = n.status, c;
|
|
960
969
|
t[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ M("button", {
|
|
961
970
|
type: "button",
|
|
962
971
|
"data-slot": "index-progress-global-error-trigger",
|
|
963
|
-
className:
|
|
972
|
+
className: On()
|
|
964
973
|
}), t[3] = c) : c = t[3];
|
|
965
974
|
let l;
|
|
966
|
-
t[4] === n ? l = t[5] : (l =
|
|
975
|
+
t[4] === n ? l = t[5] : (l = Cn(n), t[4] = n, t[5] = l);
|
|
967
976
|
let u = n.status === "running", d;
|
|
968
|
-
t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ M(
|
|
977
|
+
t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ M(kn, {
|
|
969
978
|
segments: l,
|
|
970
979
|
isRunning: u
|
|
971
980
|
}), t[6] = l, t[7] = u, t[8] = d) : d = t[8];
|
|
972
981
|
let f;
|
|
973
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(
|
|
982
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(jn, {}), t[9] = f) : f = t[9];
|
|
974
983
|
let p;
|
|
975
984
|
t[10] === d ? p = t[11] : (p = /* @__PURE__ */ N(L, {
|
|
976
985
|
render: c,
|
|
@@ -979,7 +988,7 @@ function qn(e) {
|
|
|
979
988
|
let m;
|
|
980
989
|
t[12] === r ? m = t[13] : (m = /* @__PURE__ */ M(I, {
|
|
981
990
|
"data-slot": "index-progress-global-error-content",
|
|
982
|
-
children: /* @__PURE__ */ M(
|
|
991
|
+
children: /* @__PURE__ */ M(qn, { events: r })
|
|
983
992
|
}), t[12] = r, t[13] = m);
|
|
984
993
|
let h;
|
|
985
994
|
return t[14] !== o || t[15] !== a || t[16] !== n.status || t[17] !== p || t[18] !== m ? (h = /* @__PURE__ */ N(F, {
|
|
@@ -991,30 +1000,30 @@ function qn(e) {
|
|
|
991
1000
|
children: [p, m]
|
|
992
1001
|
}), t[14] = o, t[15] = a, t[16] = n.status, t[17] = p, t[18] = m, t[19] = h) : h = t[19], h;
|
|
993
1002
|
}
|
|
994
|
-
var
|
|
995
|
-
Root:
|
|
996
|
-
Trigger:
|
|
997
|
-
Content:
|
|
998
|
-
EventLog:
|
|
999
|
-
PerAdapter:
|
|
1000
|
-
},
|
|
1003
|
+
var Yn = {
|
|
1004
|
+
Root: En,
|
|
1005
|
+
Trigger: Dn,
|
|
1006
|
+
Content: Mn,
|
|
1007
|
+
EventLog: Fn,
|
|
1008
|
+
PerAdapter: Wn
|
|
1009
|
+
}, Xn = o(void 0), Zn = o(void 0);
|
|
1001
1010
|
function W() {
|
|
1002
|
-
let e = l(
|
|
1011
|
+
let e = l(Xn);
|
|
1003
1012
|
if (!e) throw Error("useMessagesContext must be used within <Messages>");
|
|
1004
1013
|
return e;
|
|
1005
1014
|
}
|
|
1006
1015
|
function G() {
|
|
1007
|
-
let e = l(
|
|
1016
|
+
let e = l(Xn), { status: t } = Qt();
|
|
1008
1017
|
return e?.status ?? t;
|
|
1009
1018
|
}
|
|
1010
1019
|
function K() {
|
|
1011
|
-
let e = l(
|
|
1020
|
+
let e = l(Zn);
|
|
1012
1021
|
if (!e) throw Error("useMessageItem must be used within <Messages.Item>");
|
|
1013
1022
|
return e;
|
|
1014
1023
|
}
|
|
1015
1024
|
//#endregion
|
|
1016
1025
|
//#region src/lib/components/CitationPill.tsx
|
|
1017
|
-
function
|
|
1026
|
+
function Qn({ source: e, index: t, labels: n = {
|
|
1018
1027
|
source: `Source ${t}`,
|
|
1019
1028
|
open: "Open the source"
|
|
1020
1029
|
}, children: r }) {
|
|
@@ -1031,9 +1040,13 @@ function Zn({ source: e, index: t, labels: n = {
|
|
|
1031
1040
|
children: [
|
|
1032
1041
|
/* @__PURE__ */ N(Ae, { children: [/* @__PURE__ */ M(je, {
|
|
1033
1042
|
dir: "auto",
|
|
1043
|
+
title: e.title ?? i,
|
|
1044
|
+
className: "truncate",
|
|
1034
1045
|
children: e.title ?? i
|
|
1035
1046
|
}), e.title ? /* @__PURE__ */ M(ke, {
|
|
1036
1047
|
dir: "auto",
|
|
1048
|
+
title: i,
|
|
1049
|
+
className: "truncate",
|
|
1037
1050
|
children: i
|
|
1038
1051
|
}) : null] }),
|
|
1039
1052
|
r,
|
|
@@ -1050,7 +1063,7 @@ function Zn({ source: e, index: t, labels: n = {
|
|
|
1050
1063
|
}
|
|
1051
1064
|
//#endregion
|
|
1052
1065
|
//#region src/lib/ui/TablePanel.tsx
|
|
1053
|
-
function
|
|
1066
|
+
function $n(e) {
|
|
1054
1067
|
let t = O(10), n, r, i;
|
|
1055
1068
|
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);
|
|
1056
1069
|
let a;
|
|
@@ -1064,8 +1077,8 @@ function Qn(e) {
|
|
|
1064
1077
|
...r
|
|
1065
1078
|
}), t[6] = r, t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
1066
1079
|
}
|
|
1067
|
-
|
|
1068
|
-
function
|
|
1080
|
+
$n.displayName = "TablePanel.Root";
|
|
1081
|
+
function er(e) {
|
|
1069
1082
|
let t = O(8), n, r;
|
|
1070
1083
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1071
1084
|
let i;
|
|
@@ -1077,7 +1090,7 @@ function $n(e) {
|
|
|
1077
1090
|
...r
|
|
1078
1091
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1079
1092
|
}
|
|
1080
|
-
function
|
|
1093
|
+
function tr(e) {
|
|
1081
1094
|
let t = O(8), n, r;
|
|
1082
1095
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1083
1096
|
let i;
|
|
@@ -1089,7 +1102,7 @@ function er(e) {
|
|
|
1089
1102
|
...r
|
|
1090
1103
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1091
1104
|
}
|
|
1092
|
-
function
|
|
1105
|
+
function nr(e) {
|
|
1093
1106
|
let t = O(8), n, r;
|
|
1094
1107
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1095
1108
|
let i;
|
|
@@ -1101,7 +1114,7 @@ function tr(e) {
|
|
|
1101
1114
|
...r
|
|
1102
1115
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1103
1116
|
}
|
|
1104
|
-
function
|
|
1117
|
+
function rr(e) {
|
|
1105
1118
|
let t = O(8), n, r;
|
|
1106
1119
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1107
1120
|
let i;
|
|
@@ -1113,7 +1126,7 @@ function nr(e) {
|
|
|
1113
1126
|
...r
|
|
1114
1127
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1115
1128
|
}
|
|
1116
|
-
function
|
|
1129
|
+
function ir(e) {
|
|
1117
1130
|
let t = O(8), n, r;
|
|
1118
1131
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1119
1132
|
let i;
|
|
@@ -1125,7 +1138,7 @@ function rr(e) {
|
|
|
1125
1138
|
...r
|
|
1126
1139
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1127
1140
|
}
|
|
1128
|
-
function
|
|
1141
|
+
function ar(e) {
|
|
1129
1142
|
let t = O(8), n, r;
|
|
1130
1143
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1131
1144
|
let i;
|
|
@@ -1137,40 +1150,40 @@ function ir(e) {
|
|
|
1137
1150
|
...r
|
|
1138
1151
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1139
1152
|
}
|
|
1140
|
-
var q = Object.assign(
|
|
1141
|
-
Header:
|
|
1142
|
-
Heading:
|
|
1143
|
-
Title:
|
|
1144
|
-
Description:
|
|
1145
|
-
Actions:
|
|
1146
|
-
Content:
|
|
1147
|
-
}),
|
|
1148
|
-
function
|
|
1149
|
-
return e.replace(
|
|
1150
|
-
}
|
|
1151
|
-
function
|
|
1153
|
+
var q = Object.assign($n, {
|
|
1154
|
+
Header: er,
|
|
1155
|
+
Heading: tr,
|
|
1156
|
+
Title: nr,
|
|
1157
|
+
Description: rr,
|
|
1158
|
+
Actions: ir,
|
|
1159
|
+
Content: ar
|
|
1160
|
+
}), or = /<\w[\w-]*(?:"(?:\\.|[^"])*"|[^>"])*>/g, sr = /\b([\w-]+)="((?:\\.|[^"])*)"/g;
|
|
1161
|
+
function cr(e) {
|
|
1162
|
+
return e.replace(or, (e) => e.replace(sr, (e, t, n) => `${t}="${n.replace(/\\"/g, """)}"`));
|
|
1163
|
+
}
|
|
1164
|
+
function lr(e, t) {
|
|
1152
1165
|
if (typeof e != "string") return e;
|
|
1153
|
-
let n =
|
|
1154
|
-
return n = n.replace(/\/>(\s*)</g, (e, t, n, r) => !t.includes("\n") &&
|
|
1166
|
+
let n = cr(gr(e, fr(t))).replace(/<(\w[\w-]*)((?:\s+[\w-]+="[^"]*")+)\s*(\/?>)/g, (e, t, n, r) => `<${t}${n.replace(/\s+/g, " ")}${r}`);
|
|
1167
|
+
return n = n.replace(/\/>(\s*)</g, (e, t, n, r) => !t.includes("\n") && dr(r, n) ? e : "/>\n\n<"), _r(n, t);
|
|
1155
1168
|
}
|
|
1156
|
-
var
|
|
1157
|
-
function
|
|
1169
|
+
var ur = /<\w[\w-]*(?:"(?:\\.|[^"])*"|[^>"])*>|<\/[\w-]+\s*>/g;
|
|
1170
|
+
function dr(e, t) {
|
|
1158
1171
|
let n = e.lastIndexOf("\n", t - 1) + 1, r = e.indexOf("\n", t);
|
|
1159
|
-
return e.slice(n, r < 0 ? e.length : r).replace(
|
|
1172
|
+
return e.slice(n, r < 0 ? e.length : r).replace(ur, "").trim() !== "";
|
|
1160
1173
|
}
|
|
1161
|
-
function
|
|
1174
|
+
function fr(e) {
|
|
1162
1175
|
let t = e?.length ? new Set(e) : null;
|
|
1163
1176
|
return t ? (e) => t.has(e) : (e) => e.includes("-");
|
|
1164
1177
|
}
|
|
1165
|
-
var
|
|
1166
|
-
function
|
|
1167
|
-
return e.replace(
|
|
1178
|
+
var pr = /<([\w-]+)((?:\s+[\w-]+=(?:[“”][^“”]*[“”]|[‘’][^‘’]*[‘’]|"[^"]*"|'[^']*'))+)\s*(\/?>)/g, mr = /([\w-]+)=(?:[“”]([^“”]*)[“”]|[‘’]([^‘’]*)[‘’])/g;
|
|
1179
|
+
function hr(e) {
|
|
1180
|
+
return e.replace(mr, (e, t, n, r) => `${t}="${(n ?? r ?? "").replace(/"/g, """)}"`);
|
|
1168
1181
|
}
|
|
1169
|
-
function
|
|
1170
|
-
return e.replace(
|
|
1182
|
+
function gr(e, t) {
|
|
1183
|
+
return e.replace(pr, (e, n, r, i) => t(n) ? `<${n}${hr(r)}${i}` : e);
|
|
1171
1184
|
}
|
|
1172
|
-
function
|
|
1173
|
-
let r =
|
|
1185
|
+
function _r(e, t, n = !1) {
|
|
1186
|
+
let r = fr(t), i = "", a = 0;
|
|
1174
1187
|
for (; a < e.length;) {
|
|
1175
1188
|
if (e[a] !== "<" || e[a + 1] === "/") {
|
|
1176
1189
|
i += e[a++];
|
|
@@ -1183,36 +1196,36 @@ function gr(e, t, n = !1) {
|
|
|
1183
1196
|
i += e[a++];
|
|
1184
1197
|
continue;
|
|
1185
1198
|
}
|
|
1186
|
-
let c =
|
|
1199
|
+
let c = vr(e, a);
|
|
1187
1200
|
if (c < 0) {
|
|
1188
1201
|
i += e[a++];
|
|
1189
1202
|
continue;
|
|
1190
1203
|
}
|
|
1191
1204
|
if (e[c - 1] === "/") {
|
|
1192
1205
|
let t = e.slice(a, c + 1);
|
|
1193
|
-
n ? i += "<div>" + t + "</div>" :
|
|
1206
|
+
n ? i += "<div>" + t + "</div>" : dr(e, a) ? i += "<span>" + t.slice(0, -2).trimEnd() + "></" + s + "></span>" : (i += t.slice(0, -2).trimEnd() + "></" + s + ">", e[c + 1] === "\n" && c + 2 < e.length && e[c + 2] !== "\n" && (i += "\n")), a = c + 1;
|
|
1194
1207
|
continue;
|
|
1195
1208
|
}
|
|
1196
|
-
let l =
|
|
1209
|
+
let l = yr(e, c + 1, s);
|
|
1197
1210
|
if (!l) {
|
|
1198
1211
|
if (n) {
|
|
1199
|
-
let n = e.slice(a, c + 1), r =
|
|
1212
|
+
let n = e.slice(a, c + 1), r = _r(e.slice(c + 1), t, !0);
|
|
1200
1213
|
return i += "<div>" + n + r + "</" + s + "></div>", i;
|
|
1201
1214
|
}
|
|
1202
1215
|
i += e.slice(a, c + 1), a = c + 1;
|
|
1203
1216
|
continue;
|
|
1204
1217
|
}
|
|
1205
|
-
let u = e.slice(a, c + 1), d = e.slice(c + 1, l.start), f = e.slice(l.start, l.end), p =
|
|
1218
|
+
let u = e.slice(a, c + 1), d = e.slice(c + 1, l.start), f = e.slice(l.start, l.end), p = _r(d, t, !0);
|
|
1206
1219
|
if (n) i += "<div>" + u + p + f + "</div>";
|
|
1207
1220
|
else {
|
|
1208
1221
|
let t = p.includes("\n") ? "\n" : "";
|
|
1209
|
-
i =
|
|
1222
|
+
i = br(i) + "<div>" + t + u + p + f + t + "</div>", e[l.end] === "\n" && l.end + 1 < e.length && e[l.end + 1] !== "\n" && (i += "\n");
|
|
1210
1223
|
}
|
|
1211
1224
|
a = l.end;
|
|
1212
1225
|
}
|
|
1213
1226
|
return i;
|
|
1214
1227
|
}
|
|
1215
|
-
function
|
|
1228
|
+
function vr(e, t) {
|
|
1216
1229
|
let n = t + 1;
|
|
1217
1230
|
for (; n < e.length;) {
|
|
1218
1231
|
if (e[n] === "\"") for (n++; n < e.length && e[n] !== "\"";) n++;
|
|
@@ -1221,14 +1234,14 @@ function _r(e, t) {
|
|
|
1221
1234
|
}
|
|
1222
1235
|
return -1;
|
|
1223
1236
|
}
|
|
1224
|
-
function
|
|
1237
|
+
function yr(e, t, n) {
|
|
1225
1238
|
let r = 1, i = t, a = "<" + n, o = "</" + n;
|
|
1226
1239
|
for (; i < e.length;) {
|
|
1227
1240
|
let t = e.indexOf("<", i);
|
|
1228
1241
|
if (t < 0) return null;
|
|
1229
1242
|
if (e.startsWith(o, t) && !/[\w-]/.test(e[t + o.length] || "")) {
|
|
1230
1243
|
if (r--, r === 0) {
|
|
1231
|
-
let n =
|
|
1244
|
+
let n = vr(e, t);
|
|
1232
1245
|
return n < 0 ? null : {
|
|
1233
1246
|
start: t,
|
|
1234
1247
|
end: n + 1
|
|
@@ -1237,25 +1250,25 @@ function vr(e, t, n) {
|
|
|
1237
1250
|
let n = e.indexOf(">", t + o.length);
|
|
1238
1251
|
i = n < 0 ? t + 1 : n + 1;
|
|
1239
1252
|
} else if (e.startsWith(a, t) && !/[\w-]/.test(e[t + a.length] || "")) {
|
|
1240
|
-
let n =
|
|
1253
|
+
let n = vr(e, t);
|
|
1241
1254
|
n >= 0 && e[n - 1] !== "/" && r++, i = n < 0 ? t + 1 : n + 1;
|
|
1242
1255
|
} else if (/[a-zA-Z/]/.test(e[t + 1] || "")) {
|
|
1243
|
-
let n =
|
|
1256
|
+
let n = vr(e, t);
|
|
1244
1257
|
i = n < 0 ? t + 1 : n + 1;
|
|
1245
1258
|
} else i = t + 1;
|
|
1246
1259
|
}
|
|
1247
1260
|
return null;
|
|
1248
1261
|
}
|
|
1249
|
-
function
|
|
1262
|
+
function br(e) {
|
|
1250
1263
|
return e.length === 0 ? "\n\n" : e.endsWith("\n\n") ? e : e.endsWith("\n") ? e + "\n" : e + "\n\n";
|
|
1251
1264
|
}
|
|
1252
1265
|
//#endregion
|
|
1253
1266
|
//#region src/lib/elements/table-panel-extension.tsx
|
|
1254
|
-
var
|
|
1267
|
+
var xr = "response-table-panel", Sr = ["title", "description"], Cr = k(Ne({
|
|
1255
1268
|
variant: "ghost",
|
|
1256
1269
|
size: "icon-sm"
|
|
1257
|
-
})),
|
|
1258
|
-
let t = _t(e), n =
|
|
1270
|
+
})), wr = vt().use(ut).use(lt).use(ct), Tr = (e) => {
|
|
1271
|
+
let t = _t(e), n = Or(e);
|
|
1259
1272
|
if (n.length === 0) return t;
|
|
1260
1273
|
let r = 0, i = t.map((e) => {
|
|
1261
1274
|
let t = {
|
|
@@ -1270,49 +1283,49 @@ var br = "response-table-panel", xr = ["title", "description"], Sr = k(Ne({
|
|
|
1270
1283
|
}
|
|
1271
1284
|
return t.reduce((e, t, n) => (a.has(n) && e.length > 0 ? e[e.length - 1] += t : e.push(t), e), []);
|
|
1272
1285
|
};
|
|
1273
|
-
function
|
|
1286
|
+
function Er(e) {
|
|
1274
1287
|
return e?.type === "leafDirective" && "name" in e && e.name === "table";
|
|
1275
1288
|
}
|
|
1276
|
-
function
|
|
1289
|
+
function Dr(e, t) {
|
|
1277
1290
|
if (t === void 0) return;
|
|
1278
1291
|
let n = e[t - 1];
|
|
1279
|
-
return
|
|
1292
|
+
return Er(n) ? n : void 0;
|
|
1280
1293
|
}
|
|
1281
|
-
function
|
|
1294
|
+
function Or(e) {
|
|
1282
1295
|
let t = [];
|
|
1283
|
-
return bt(
|
|
1296
|
+
return bt(wr.parse(e), "table", (e, n, r) => {
|
|
1284
1297
|
if (!r) return;
|
|
1285
|
-
let i =
|
|
1298
|
+
let i = Dr(r.children, n)?.position?.start.offset, a = e.position?.end.offset;
|
|
1286
1299
|
i !== void 0 && a !== void 0 && t.push({
|
|
1287
1300
|
start: i,
|
|
1288
1301
|
end: a
|
|
1289
1302
|
});
|
|
1290
1303
|
}), t;
|
|
1291
1304
|
}
|
|
1292
|
-
function
|
|
1305
|
+
function kr(e, t) {
|
|
1293
1306
|
return e.attributes?.[t]?.trim() || void 0;
|
|
1294
1307
|
}
|
|
1295
|
-
function
|
|
1296
|
-
let t =
|
|
1308
|
+
function Ar(e) {
|
|
1309
|
+
let t = wr.parse(e), n = !1;
|
|
1297
1310
|
if (bt(t, "leafDirective", (e, t, r) => {
|
|
1298
1311
|
let i = t === void 0 ? void 0 : r?.children[t + 1];
|
|
1299
1312
|
if (e.name !== "table" || i?.type !== "table") return;
|
|
1300
1313
|
n = !0;
|
|
1301
|
-
let a = [
|
|
1314
|
+
let a = [kr(e, "title"), kr(e, "description")].filter(Boolean).join(" ");
|
|
1302
1315
|
e.children = a ? [{
|
|
1303
1316
|
type: "text",
|
|
1304
1317
|
value: a
|
|
1305
1318
|
}] : [];
|
|
1306
1319
|
}), n) return gt(st(t, { includeHtml: !1 }));
|
|
1307
1320
|
}
|
|
1308
|
-
function
|
|
1321
|
+
function jr(e) {
|
|
1309
1322
|
let t = O(2), n;
|
|
1310
1323
|
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ M(dt, { ...e }), t[0] = e, t[1] = n), n;
|
|
1311
1324
|
}
|
|
1312
|
-
function
|
|
1325
|
+
function Mr(e) {
|
|
1313
1326
|
function t(t) {
|
|
1314
1327
|
let n = O(6), r;
|
|
1315
|
-
n[0] !== t.content || n[1] !== t.dir ? (r =
|
|
1328
|
+
n[0] !== t.content || n[1] !== t.dir ? (r = Ar(t.content) ?? t.dir, n[0] = t.content, n[1] = t.dir, n[2] = r) : r = n[2];
|
|
1316
1329
|
let i = r, a;
|
|
1317
1330
|
return n[3] !== i || n[4] !== t ? (a = /* @__PURE__ */ M(e, {
|
|
1318
1331
|
...t,
|
|
@@ -1321,54 +1334,54 @@ function jr(e) {
|
|
|
1321
1334
|
}
|
|
1322
1335
|
return t.displayName = "DirectionAwareTableBlock", t;
|
|
1323
1336
|
}
|
|
1324
|
-
function
|
|
1325
|
-
let n = t &&
|
|
1337
|
+
function Nr(e, t) {
|
|
1338
|
+
let n = t && kr(t, "title"), r = t && kr(t, "description"), i = {
|
|
1326
1339
|
...n ? { title: n } : {},
|
|
1327
1340
|
...r ? { description: r } : {}
|
|
1328
1341
|
};
|
|
1329
1342
|
return {
|
|
1330
1343
|
type: "tablePanel",
|
|
1331
1344
|
data: {
|
|
1332
|
-
hName:
|
|
1345
|
+
hName: xr,
|
|
1333
1346
|
...Object.keys(i).length > 0 ? { hProperties: i } : {}
|
|
1334
1347
|
},
|
|
1335
1348
|
children: [e]
|
|
1336
1349
|
};
|
|
1337
1350
|
}
|
|
1338
|
-
function
|
|
1351
|
+
function Pr() {
|
|
1339
1352
|
return (e) => {
|
|
1340
1353
|
bt(e, "table", (e, t, n) => {
|
|
1341
1354
|
if (t === void 0 || !n) return;
|
|
1342
|
-
let r =
|
|
1343
|
-
return n.children.splice(i, a,
|
|
1355
|
+
let r = Dr(n.children, t), i = r ? t - 1 : t, a = r ? 2 : 1;
|
|
1356
|
+
return n.children.splice(i, a, Nr(e, r)), [yt, i + 1];
|
|
1344
1357
|
});
|
|
1345
1358
|
};
|
|
1346
1359
|
}
|
|
1347
|
-
var
|
|
1360
|
+
var Fr = [
|
|
1348
1361
|
...Object.values(ht),
|
|
1349
1362
|
ct,
|
|
1350
|
-
|
|
1351
|
-
],
|
|
1363
|
+
Pr
|
|
1364
|
+
], Ir = t.createContext({
|
|
1352
1365
|
actions: null,
|
|
1353
1366
|
controls: !0
|
|
1354
1367
|
});
|
|
1355
|
-
function
|
|
1368
|
+
function Lr(e, t) {
|
|
1356
1369
|
if (e === !1) return !1;
|
|
1357
1370
|
if (e === !0 || e === void 0) return !0;
|
|
1358
1371
|
let n = e.table;
|
|
1359
1372
|
return n === !1 ? !1 : n === !0 || n === void 0 || n[t] !== !1;
|
|
1360
1373
|
}
|
|
1361
|
-
function
|
|
1374
|
+
function Rr(e) {
|
|
1362
1375
|
return e === !1 ? !1 : e === !0 || e === void 0 ? { table: !1 } : {
|
|
1363
1376
|
...e,
|
|
1364
1377
|
table: !1
|
|
1365
1378
|
};
|
|
1366
1379
|
}
|
|
1367
|
-
function
|
|
1368
|
-
let n = O(21), { children: r, className: i, title: a, description: o } = e, { actions: s, controls: c } = t.use(
|
|
1369
|
-
n[0] === c ? l = n[1] : (l =
|
|
1380
|
+
function zr(e) {
|
|
1381
|
+
let n = O(21), { children: r, className: i, title: a, description: o } = e, { actions: s, controls: c } = t.use(Ir), l;
|
|
1382
|
+
n[0] === c ? l = n[1] : (l = Lr(c, "copy"), n[0] = c, n[1] = l);
|
|
1370
1383
|
let u = l, d;
|
|
1371
|
-
n[2] === c ? d = n[3] : (d =
|
|
1384
|
+
n[2] === c ? d = n[3] : (d = Lr(c, "download"), n[2] = c, n[3] = d);
|
|
1372
1385
|
let f = d, p = !!(a || o), m = !!(u || f || s);
|
|
1373
1386
|
if (!r) return null;
|
|
1374
1387
|
let h;
|
|
@@ -1382,8 +1395,8 @@ function Rr(e) {
|
|
|
1382
1395
|
})] }), m && /* @__PURE__ */ N(q.Actions, {
|
|
1383
1396
|
"data-copy-exclude": "assistant-snapshot",
|
|
1384
1397
|
children: [
|
|
1385
|
-
u && /* @__PURE__ */ M(pt, { className:
|
|
1386
|
-
f && /* @__PURE__ */ M(mt, { className:
|
|
1398
|
+
u && /* @__PURE__ */ M(pt, { className: Cr }),
|
|
1399
|
+
f && /* @__PURE__ */ M(mt, { className: Cr }),
|
|
1387
1400
|
s
|
|
1388
1401
|
]
|
|
1389
1402
|
})]
|
|
@@ -1402,31 +1415,31 @@ function Rr(e) {
|
|
|
1402
1415
|
children: [g, v]
|
|
1403
1416
|
}), n[17] = h, n[18] = g, n[19] = v, n[20] = y) : y = n[20], y;
|
|
1404
1417
|
}
|
|
1405
|
-
function
|
|
1418
|
+
function Br(e) {
|
|
1406
1419
|
let t = O(43), n, r, i, a, o, s, c, l, u, d;
|
|
1407
1420
|
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);
|
|
1408
1421
|
let f;
|
|
1409
1422
|
bb0: {
|
|
1410
1423
|
if (!u) {
|
|
1411
|
-
f =
|
|
1424
|
+
f = Fr;
|
|
1412
1425
|
break bb0;
|
|
1413
1426
|
}
|
|
1414
1427
|
let e;
|
|
1415
1428
|
t[11] === u ? e = t[12] : (e = [
|
|
1416
1429
|
...u,
|
|
1417
1430
|
ct,
|
|
1418
|
-
|
|
1431
|
+
Pr
|
|
1419
1432
|
], t[11] = u, t[12] = e), f = e;
|
|
1420
1433
|
}
|
|
1421
1434
|
let p = f, m;
|
|
1422
1435
|
t[13] === r ? m = t[14] : (m = {
|
|
1423
1436
|
...r,
|
|
1424
|
-
[
|
|
1437
|
+
[xr]: Sr
|
|
1425
1438
|
}, t[13] = r, t[14] = m);
|
|
1426
1439
|
let h = m, g;
|
|
1427
1440
|
t[15] === a ? g = t[16] : (g = {
|
|
1428
1441
|
...a,
|
|
1429
|
-
[
|
|
1442
|
+
[xr]: zr
|
|
1430
1443
|
}, t[15] = a, t[16] = g);
|
|
1431
1444
|
let _ = g, v;
|
|
1432
1445
|
t[17] !== o || t[18] !== d ? (v = {
|
|
@@ -1439,8 +1452,8 @@ function zr(e) {
|
|
|
1439
1452
|
b = n;
|
|
1440
1453
|
break bb1;
|
|
1441
1454
|
}
|
|
1442
|
-
let e = n ??
|
|
1443
|
-
t[20] === e ? r = t[21] : (r =
|
|
1455
|
+
let e = n ?? jr, r;
|
|
1456
|
+
t[20] === e ? r = t[21] : (r = Mr(e), t[20] = e, t[21] = r), b = r;
|
|
1444
1457
|
}
|
|
1445
1458
|
let x = b, S;
|
|
1446
1459
|
bb2: {
|
|
@@ -1449,12 +1462,12 @@ function zr(e) {
|
|
|
1449
1462
|
break bb2;
|
|
1450
1463
|
}
|
|
1451
1464
|
let e;
|
|
1452
|
-
t[22] !== i || t[23] !== s ? (e =
|
|
1465
|
+
t[22] !== i || t[23] !== s ? (e = Ar(i) ?? s, t[22] = i, t[23] = s, t[24] = e) : e = t[24], S = e;
|
|
1453
1466
|
}
|
|
1454
1467
|
let C = S, w;
|
|
1455
|
-
t[25] === o ? w = t[26] : (w =
|
|
1468
|
+
t[25] === o ? w = t[26] : (w = Rr(o), t[25] = o, t[26] = w);
|
|
1456
1469
|
let T;
|
|
1457
|
-
t[27] !== i || t[28] !== h ? (T =
|
|
1470
|
+
t[27] !== i || t[28] !== h ? (T = lr(i, Object.keys(h)), t[27] = i, t[28] = h, t[29] = T) : T = t[29];
|
|
1458
1471
|
let E;
|
|
1459
1472
|
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, {
|
|
1460
1473
|
allowedTags: h,
|
|
@@ -1463,20 +1476,20 @@ function zr(e) {
|
|
|
1463
1476
|
controls: w,
|
|
1464
1477
|
dir: C,
|
|
1465
1478
|
mode: c,
|
|
1466
|
-
parseMarkdownIntoBlocksFn:
|
|
1479
|
+
parseMarkdownIntoBlocksFn: Tr,
|
|
1467
1480
|
remarkPlugins: p,
|
|
1468
1481
|
...l,
|
|
1469
1482
|
children: T
|
|
1470
1483
|
}), 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];
|
|
1471
1484
|
let D;
|
|
1472
|
-
return t[40] !== E || t[41] !== y ? (D = /* @__PURE__ */ M(
|
|
1485
|
+
return t[40] !== E || t[41] !== y ? (D = /* @__PURE__ */ M(Ir, {
|
|
1473
1486
|
value: y,
|
|
1474
1487
|
children: E
|
|
1475
1488
|
}), t[40] = E, t[41] = y, t[42] = D) : D = t[42], D;
|
|
1476
1489
|
}
|
|
1477
1490
|
//#endregion
|
|
1478
1491
|
//#region src/lib/elements/Response.tsx
|
|
1479
|
-
var
|
|
1492
|
+
var Vr = class extends t.Component {
|
|
1480
1493
|
state = {
|
|
1481
1494
|
hasError: !1,
|
|
1482
1495
|
error: null
|
|
@@ -1499,7 +1512,7 @@ var Br = class extends t.Component {
|
|
|
1499
1512
|
let i;
|
|
1500
1513
|
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);
|
|
1501
1514
|
let a;
|
|
1502
|
-
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ M(
|
|
1515
|
+
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ M(Vr, { children: /* @__PURE__ */ M(Br, {
|
|
1503
1516
|
className: i,
|
|
1504
1517
|
dir: "auto",
|
|
1505
1518
|
...r
|
|
@@ -1508,7 +1521,7 @@ var Br = class extends t.Component {
|
|
|
1508
1521
|
J.displayName = "Response";
|
|
1509
1522
|
//#endregion
|
|
1510
1523
|
//#region src/lib/ui/use-copy-feedback.ts
|
|
1511
|
-
function
|
|
1524
|
+
function Hr(e) {
|
|
1512
1525
|
let t = O(9), n = e === void 0 ? 2e3 : e, r = St(), [i, a] = g(!1), o = h(null), s, c;
|
|
1513
1526
|
t[0] === r ? (s = t[1], c = t[2]) : (s = () => () => {
|
|
1514
1527
|
o.current && r.clearTimeout(o.current);
|
|
@@ -1522,13 +1535,13 @@ function Vr(e) {
|
|
|
1522
1535
|
}
|
|
1523
1536
|
//#endregion
|
|
1524
1537
|
//#region src/lib/elements/code-block.tsx
|
|
1525
|
-
var
|
|
1538
|
+
var Ur = o({ code: "" }), Wr = (e) => {
|
|
1526
1539
|
let t = O(24), n, r, i, a, o, s;
|
|
1527
1540
|
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);
|
|
1528
1541
|
let c = o !== void 0 && o, l = s !== void 0 && s, u = Pe(r, i), d;
|
|
1529
1542
|
t[7] === r ? d = t[8] : (d = { code: r }, t[7] = r, t[8] = d);
|
|
1530
1543
|
let f;
|
|
1531
|
-
t[9] === u ? f = t[10] : (f = u.map(
|
|
1544
|
+
t[9] === u ? f = t[10] : (f = u.map(Kr), t[9] = u, t[10] = f);
|
|
1532
1545
|
let p;
|
|
1533
1546
|
t[11] !== c || t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(Te, {
|
|
1534
1547
|
lineNumbers: c,
|
|
@@ -1544,12 +1557,12 @@ var Hr = o({ code: "" }), Ur = (e) => {
|
|
|
1544
1557
|
children: [p, m]
|
|
1545
1558
|
}), t[17] = a, t[18] = p, t[19] = m, t[20] = h) : h = t[20];
|
|
1546
1559
|
let g;
|
|
1547
|
-
return t[21] !== d || t[22] !== h ? (g = /* @__PURE__ */ M(
|
|
1560
|
+
return t[21] !== d || t[22] !== h ? (g = /* @__PURE__ */ M(Ur, {
|
|
1548
1561
|
value: d,
|
|
1549
1562
|
children: h
|
|
1550
1563
|
}), t[21] = d, t[22] = h, t[23] = g) : g = t[23], g;
|
|
1551
|
-
},
|
|
1552
|
-
let [o, s] =
|
|
1564
|
+
}, Gr = ({ onCopy: e, onError: t, timeout: n = 2e3, children: r, className: i, ...a }) => {
|
|
1565
|
+
let [o, s] = Hr(n), { code: c } = l(Ur), u = async () => {
|
|
1553
1566
|
if (typeof window > "u" || !navigator.clipboard.writeText) {
|
|
1554
1567
|
t?.(/* @__PURE__ */ Error("Clipboard API not available"));
|
|
1555
1568
|
return;
|
|
@@ -1569,12 +1582,12 @@ var Hr = o({ code: "" }), Ur = (e) => {
|
|
|
1569
1582
|
children: r ?? /* @__PURE__ */ M(d, {})
|
|
1570
1583
|
});
|
|
1571
1584
|
};
|
|
1572
|
-
function
|
|
1585
|
+
function Kr(e, t) {
|
|
1573
1586
|
return /* @__PURE__ */ M(Ee, { children: e }, t);
|
|
1574
1587
|
}
|
|
1575
1588
|
//#endregion
|
|
1576
1589
|
//#region src/lib/elements/Tool.tsx
|
|
1577
|
-
var
|
|
1590
|
+
var qr = (e) => {
|
|
1578
1591
|
let t = O(8), n, r;
|
|
1579
1592
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1580
1593
|
let i;
|
|
@@ -1584,7 +1597,7 @@ var Kr = (e) => {
|
|
|
1584
1597
|
className: i,
|
|
1585
1598
|
...r
|
|
1586
1599
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1587
|
-
},
|
|
1600
|
+
}, Jr = (e) => /* @__PURE__ */ N(me, {
|
|
1588
1601
|
className: "gap-1.5 rounded-full text-xs",
|
|
1589
1602
|
variant: "secondary",
|
|
1590
1603
|
children: [{
|
|
@@ -1604,7 +1617,7 @@ var Kr = (e) => {
|
|
|
1604
1617
|
"output-error": "Error",
|
|
1605
1618
|
"output-denied": "Denied"
|
|
1606
1619
|
}[e]]
|
|
1607
|
-
}),
|
|
1620
|
+
}), Yr = (e) => {
|
|
1608
1621
|
let t = O(23), n, r, i, a;
|
|
1609
1622
|
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);
|
|
1610
1623
|
let o;
|
|
@@ -1619,7 +1632,7 @@ var Kr = (e) => {
|
|
|
1619
1632
|
children: c
|
|
1620
1633
|
}), t[11] = c, t[12] = l);
|
|
1621
1634
|
let u;
|
|
1622
|
-
t[13] === r.state ? u = t[14] : (u =
|
|
1635
|
+
t[13] === r.state ? u = t[14] : (u = Jr(r.state), t[13] = r.state, t[14] = u);
|
|
1623
1636
|
let d;
|
|
1624
1637
|
t[15] !== l || t[16] !== u ? (d = /* @__PURE__ */ N("div", {
|
|
1625
1638
|
className: "flex items-center gap-2",
|
|
@@ -1637,7 +1650,7 @@ var Kr = (e) => {
|
|
|
1637
1650
|
...i,
|
|
1638
1651
|
children: [d, f]
|
|
1639
1652
|
}), t[19] = i, t[20] = o, t[21] = d, t[22] = p) : p = t[22], p;
|
|
1640
|
-
},
|
|
1653
|
+
}, Xr = (e) => {
|
|
1641
1654
|
let t = O(8), n, r;
|
|
1642
1655
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1643
1656
|
let i;
|
|
@@ -1647,7 +1660,7 @@ var Kr = (e) => {
|
|
|
1647
1660
|
className: i,
|
|
1648
1661
|
...r
|
|
1649
1662
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1650
|
-
},
|
|
1663
|
+
}, Zr = (e) => {
|
|
1651
1664
|
let t = O(15), n, r, i;
|
|
1652
1665
|
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);
|
|
1653
1666
|
let a;
|
|
@@ -1662,7 +1675,7 @@ var Kr = (e) => {
|
|
|
1662
1675
|
let c;
|
|
1663
1676
|
t[9] === s ? c = t[10] : (c = /* @__PURE__ */ M("div", {
|
|
1664
1677
|
className: "bg-muted/50 rounded-md",
|
|
1665
|
-
children: /* @__PURE__ */ M(
|
|
1678
|
+
children: /* @__PURE__ */ M(Wr, {
|
|
1666
1679
|
code: s,
|
|
1667
1680
|
language: "json"
|
|
1668
1681
|
})
|
|
@@ -1673,7 +1686,7 @@ var Kr = (e) => {
|
|
|
1673
1686
|
...i,
|
|
1674
1687
|
children: [o, c]
|
|
1675
1688
|
}), t[11] = i, t[12] = a, t[13] = c, t[14] = l) : l = t[14], l;
|
|
1676
|
-
},
|
|
1689
|
+
}, Qr = (e) => {
|
|
1677
1690
|
let t = O(24), n, r, i, a;
|
|
1678
1691
|
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;
|
|
1679
1692
|
let o;
|
|
@@ -1688,7 +1701,7 @@ var Kr = (e) => {
|
|
|
1688
1701
|
let d;
|
|
1689
1702
|
t[11] === r ? d = t[12] : (d = r && /* @__PURE__ */ M("div", { children: r }), t[11] = r, t[12] = d);
|
|
1690
1703
|
let f;
|
|
1691
|
-
t[13] === i ? f = t[14] : (f =
|
|
1704
|
+
t[13] === i ? f = t[14] : (f = $r(i), t[13] = i, t[14] = f);
|
|
1692
1705
|
let p;
|
|
1693
1706
|
t[15] !== u || t[16] !== d || t[17] !== f ? (p = /* @__PURE__ */ N("div", {
|
|
1694
1707
|
className: u,
|
|
@@ -1701,27 +1714,27 @@ var Kr = (e) => {
|
|
|
1701
1714
|
children: [c, p]
|
|
1702
1715
|
}), t[19] = a, t[20] = o, t[21] = c, t[22] = p, t[23] = m) : m = t[23], m;
|
|
1703
1716
|
};
|
|
1704
|
-
function
|
|
1705
|
-
return typeof e == "string" ? /* @__PURE__ */ M(
|
|
1717
|
+
function $r(e) {
|
|
1718
|
+
return typeof e == "string" ? /* @__PURE__ */ M(Wr, {
|
|
1706
1719
|
code: e,
|
|
1707
1720
|
language: "json"
|
|
1708
|
-
}) : s(e) ? /* @__PURE__ */ M("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ M(
|
|
1721
|
+
}) : s(e) ? /* @__PURE__ */ M("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ M(Wr, {
|
|
1709
1722
|
code: JSON.stringify(e, null, 2),
|
|
1710
1723
|
language: "json"
|
|
1711
1724
|
}) : typeof e == "number" || typeof e == "bigint" ? /* @__PURE__ */ M("div", { children: e }) : /* @__PURE__ */ M("div", {});
|
|
1712
1725
|
}
|
|
1713
1726
|
//#endregion
|
|
1714
1727
|
//#region src/lib/components/tool-debug.tsx
|
|
1715
|
-
function
|
|
1728
|
+
function ei(e) {
|
|
1716
1729
|
let t = O(20), { part: n } = e, r;
|
|
1717
1730
|
t[0] === n ? r = t[1] : (r = b(n), t[0] = n, t[1] = r);
|
|
1718
1731
|
let i = `Executing ${r}`, a;
|
|
1719
|
-
t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M(
|
|
1732
|
+
t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M(Yr, {
|
|
1720
1733
|
title: i,
|
|
1721
1734
|
part: n
|
|
1722
1735
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4];
|
|
1723
1736
|
let o;
|
|
1724
|
-
t[5] === n.input ? o = t[6] : (o = /* @__PURE__ */ M(
|
|
1737
|
+
t[5] === n.input ? o = t[6] : (o = /* @__PURE__ */ M(Zr, { input: n.input }), t[5] = n.input, t[6] = o);
|
|
1725
1738
|
let s;
|
|
1726
1739
|
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);
|
|
1727
1740
|
let c;
|
|
@@ -1730,26 +1743,26 @@ function $r(e) {
|
|
|
1730
1743
|
children: s
|
|
1731
1744
|
}), t[9] = s, t[10] = c);
|
|
1732
1745
|
let l;
|
|
1733
|
-
t[11] !== n.errorText || t[12] !== c ? (l = /* @__PURE__ */ M(
|
|
1746
|
+
t[11] !== n.errorText || t[12] !== c ? (l = /* @__PURE__ */ M(Qr, {
|
|
1734
1747
|
output: c,
|
|
1735
1748
|
errorText: n.errorText
|
|
1736
1749
|
}), t[11] = n.errorText, t[12] = c, t[13] = l) : l = t[13];
|
|
1737
1750
|
let u;
|
|
1738
|
-
t[14] !== o || t[15] !== l ? (u = /* @__PURE__ */ N(
|
|
1751
|
+
t[14] !== o || t[15] !== l ? (u = /* @__PURE__ */ N(Xr, { children: [o, l] }), t[14] = o, t[15] = l, t[16] = u) : u = t[16];
|
|
1739
1752
|
let d;
|
|
1740
|
-
return t[17] !== a || t[18] !== u ? (d = /* @__PURE__ */ N(
|
|
1753
|
+
return t[17] !== a || t[18] !== u ? (d = /* @__PURE__ */ N(qr, {
|
|
1741
1754
|
"data-copy-exclude": "assistant-snapshot",
|
|
1742
1755
|
children: [a, u]
|
|
1743
1756
|
}), t[17] = a, t[18] = u, t[19] = d) : d = t[19], d;
|
|
1744
1757
|
}
|
|
1745
|
-
function
|
|
1758
|
+
function ti(e) {
|
|
1746
1759
|
let t = O(18), { part: n } = e, r = `Executing ${n.toolName}`, i;
|
|
1747
|
-
t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
1760
|
+
t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(Yr, {
|
|
1748
1761
|
title: r,
|
|
1749
1762
|
part: n
|
|
1750
1763
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
1751
1764
|
let a;
|
|
1752
|
-
t[3] === n.input ? a = t[4] : (a = /* @__PURE__ */ M(
|
|
1765
|
+
t[3] === n.input ? a = t[4] : (a = /* @__PURE__ */ M(Zr, { input: n.input }), t[3] = n.input, t[4] = a);
|
|
1753
1766
|
let o;
|
|
1754
1767
|
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);
|
|
1755
1768
|
let s;
|
|
@@ -1758,49 +1771,49 @@ function ei(e) {
|
|
|
1758
1771
|
children: o
|
|
1759
1772
|
}), t[7] = o, t[8] = s);
|
|
1760
1773
|
let c;
|
|
1761
|
-
t[9] !== n.errorText || t[10] !== s ? (c = /* @__PURE__ */ M(
|
|
1774
|
+
t[9] !== n.errorText || t[10] !== s ? (c = /* @__PURE__ */ M(Qr, {
|
|
1762
1775
|
output: s,
|
|
1763
1776
|
errorText: n.errorText
|
|
1764
1777
|
}), t[9] = n.errorText, t[10] = s, t[11] = c) : c = t[11];
|
|
1765
1778
|
let l;
|
|
1766
|
-
t[12] !== a || t[13] !== c ? (l = /* @__PURE__ */ N(
|
|
1779
|
+
t[12] !== a || t[13] !== c ? (l = /* @__PURE__ */ N(Xr, { children: [a, c] }), t[12] = a, t[13] = c, t[14] = l) : l = t[14];
|
|
1767
1780
|
let u;
|
|
1768
|
-
return t[15] !== i || t[16] !== l ? (u = /* @__PURE__ */ N(
|
|
1781
|
+
return t[15] !== i || t[16] !== l ? (u = /* @__PURE__ */ N(qr, {
|
|
1769
1782
|
"data-copy-exclude": "assistant-snapshot",
|
|
1770
1783
|
children: [i, l]
|
|
1771
1784
|
}), t[15] = i, t[16] = l, t[17] = u) : u = t[17], u;
|
|
1772
1785
|
}
|
|
1773
1786
|
//#endregion
|
|
1774
1787
|
//#region src/lib/copy/copy-image.ts
|
|
1775
|
-
var
|
|
1788
|
+
var ni = "data-copy-exclude", ri = {
|
|
1776
1789
|
image: "image",
|
|
1777
1790
|
assistantSnapshot: "assistant-snapshot"
|
|
1778
1791
|
};
|
|
1779
|
-
function
|
|
1792
|
+
function ii(e) {
|
|
1780
1793
|
return typeof e == "object" && !!e && "getAttribute" in e && typeof e.getAttribute == "function";
|
|
1781
1794
|
}
|
|
1782
|
-
function
|
|
1783
|
-
if (!
|
|
1784
|
-
let n = e.getAttribute(
|
|
1795
|
+
function ai(e, t) {
|
|
1796
|
+
if (!ii(e)) return !1;
|
|
1797
|
+
let n = e.getAttribute(ni);
|
|
1785
1798
|
return n ? n.split(/\s+/).includes(t) : !1;
|
|
1786
1799
|
}
|
|
1787
|
-
function
|
|
1788
|
-
return !
|
|
1800
|
+
function oi(e, t) {
|
|
1801
|
+
return !ai(e, t);
|
|
1789
1802
|
}
|
|
1790
|
-
function
|
|
1803
|
+
function si({ clipboard: e, ClipboardItem: t }) {
|
|
1791
1804
|
return typeof e?.write == "function" && typeof t == "function" ? "image" : typeof e?.writeText == "function" ? "text" : "none";
|
|
1792
1805
|
}
|
|
1793
1806
|
//#endregion
|
|
1794
1807
|
//#region src/lib/copy/snapshot-context.ts
|
|
1795
|
-
var
|
|
1808
|
+
var ci = o(!1);
|
|
1796
1809
|
//#endregion
|
|
1797
1810
|
//#region src/lib/copy/snapshot-render.tsx
|
|
1798
|
-
function
|
|
1811
|
+
function li() {
|
|
1799
1812
|
return new Promise((e) => {
|
|
1800
1813
|
requestAnimationFrame(() => e());
|
|
1801
1814
|
});
|
|
1802
1815
|
}
|
|
1803
|
-
function
|
|
1816
|
+
function ui(e) {
|
|
1804
1817
|
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;
|
|
1805
1818
|
if (typeof document > "u") return null;
|
|
1806
1819
|
let u;
|
|
@@ -1821,7 +1834,7 @@ function li(e) {
|
|
|
1821
1834
|
return t[4] !== r || t[5] !== l || t[6] !== n || t[7] !== d ? (f = Ct(/* @__PURE__ */ M("div", {
|
|
1822
1835
|
"aria-hidden": "true",
|
|
1823
1836
|
style: u,
|
|
1824
|
-
children: /* @__PURE__ */ M(
|
|
1837
|
+
children: /* @__PURE__ */ M(ci, {
|
|
1825
1838
|
value: !0,
|
|
1826
1839
|
children: /* @__PURE__ */ M("div", {
|
|
1827
1840
|
ref: n,
|
|
@@ -1834,13 +1847,13 @@ function li(e) {
|
|
|
1834
1847
|
}
|
|
1835
1848
|
//#endregion
|
|
1836
1849
|
//#region src/lib/copy/use-copy-element-as-image.ts
|
|
1837
|
-
function
|
|
1850
|
+
function di(e) {
|
|
1838
1851
|
let t = getComputedStyle(e).backgroundColor;
|
|
1839
1852
|
if (t !== "rgba(0, 0, 0, 0)") return t;
|
|
1840
1853
|
let n = getComputedStyle(document.body).backgroundColor;
|
|
1841
1854
|
return n === "rgba(0, 0, 0, 0)" ? void 0 : n;
|
|
1842
1855
|
}
|
|
1843
|
-
function
|
|
1856
|
+
function fi({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
1844
1857
|
let r = St(), [i, a] = g(!1), [o, s] = g(null), c = h(null), l = u(() => {
|
|
1845
1858
|
c.current !== null && (r.clearTimeout(c.current), c.current = null);
|
|
1846
1859
|
}, [r]), f = u((e) => {
|
|
@@ -1857,9 +1870,9 @@ function di({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1857
1870
|
}), !0), [n, f]), m = u(async () => {
|
|
1858
1871
|
if (!e.current) throw Error("Nothing is ready to copy yet.");
|
|
1859
1872
|
let { toBlob: n } = await import("html-to-image"), r = await n(e.current, {
|
|
1860
|
-
backgroundColor:
|
|
1873
|
+
backgroundColor: di(e.current),
|
|
1861
1874
|
pixelRatio: 2,
|
|
1862
|
-
filter: (e) =>
|
|
1875
|
+
filter: (e) => oi(e, t)
|
|
1863
1876
|
});
|
|
1864
1877
|
if (!r) throw Error("Unable to render the image for copying.");
|
|
1865
1878
|
await navigator.clipboard.write([new ClipboardItem({ [r.type]: r })]), f({
|
|
@@ -1875,7 +1888,7 @@ function di({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1875
1888
|
copy: u(async () => {
|
|
1876
1889
|
a(!0), s(null);
|
|
1877
1890
|
try {
|
|
1878
|
-
let e =
|
|
1891
|
+
let e = si({
|
|
1879
1892
|
clipboard: typeof navigator > "u" ? void 0 : navigator.clipboard,
|
|
1880
1893
|
ClipboardItem: typeof window > "u" ? void 0 : window.ClipboardItem
|
|
1881
1894
|
});
|
|
@@ -1910,29 +1923,30 @@ function di({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1910
1923
|
}
|
|
1911
1924
|
//#endregion
|
|
1912
1925
|
//#region src/lib/copy/assistant-snapshot.tsx
|
|
1913
|
-
function
|
|
1914
|
-
|
|
1926
|
+
function pi(e) {
|
|
1927
|
+
let t = tn(e), n = e.parts.filter(C).map((e) => en(e.text, H(e.citations)).reverse().reduce((e, { at: n, citation: r }) => `${e.slice(0, n)}[${nn(t, r.source.url)}]${e.slice(n)}`, e.text)).join("\n");
|
|
1928
|
+
return t.length === 0 ? n : `${n}\n\n${t.map(({ url: e, title: t }, n) => `[${n + 1}] ${t ? `${t} — ` : ""}${e}`).join("\n")}`;
|
|
1915
1929
|
}
|
|
1916
1930
|
function Y() {
|
|
1917
|
-
return l(
|
|
1931
|
+
return l(ci);
|
|
1918
1932
|
}
|
|
1919
|
-
function
|
|
1933
|
+
function mi(e) {
|
|
1920
1934
|
let t = O(30), { message: n, renderContent: r, className: i } = e, a = h(null), [o, s] = g(!1), c;
|
|
1921
|
-
t[0] === n ? c = t[1] : (c =
|
|
1935
|
+
t[0] === n ? c = t[1] : (c = pi(n), t[0] = n, t[1] = c);
|
|
1922
1936
|
let l = c, u;
|
|
1923
1937
|
t[2] === l ? u = t[3] : (u = {
|
|
1924
1938
|
elementRef: a,
|
|
1925
|
-
excludeMode:
|
|
1939
|
+
excludeMode: ri.assistantSnapshot,
|
|
1926
1940
|
fallbackText: l
|
|
1927
1941
|
}, t[2] = l, t[3] = u);
|
|
1928
|
-
let { copy: d, feedback: f, isCopying: p } =
|
|
1942
|
+
let { copy: d, feedback: f, isCopying: p } = fi(u), m;
|
|
1929
1943
|
t[4] !== d || t[5] !== o ? (m = async () => {
|
|
1930
|
-
o || s(!0), await
|
|
1944
|
+
o || s(!0), await li(), await d();
|
|
1931
1945
|
}, t[4] = d, t[5] = o, t[6] = m) : m = t[6];
|
|
1932
1946
|
let _ = m, v = "Copy snapshot";
|
|
1933
1947
|
p ? v = "Copying snapshot" : f?.kind === "success" && (v = f.mode === "image" ? "Copied snapshot" : "Copied text");
|
|
1934
1948
|
let y;
|
|
1935
|
-
t[7] !== r || t[8] !== o ? (y = o && /* @__PURE__ */ M(
|
|
1949
|
+
t[7] !== r || t[8] !== o ? (y = o && /* @__PURE__ */ M(ui, {
|
|
1936
1950
|
contentRef: a,
|
|
1937
1951
|
children: r()
|
|
1938
1952
|
}), t[7] = r, t[8] = o, t[9] = y) : y = t[9];
|
|
@@ -1968,41 +1982,41 @@ function pi(e) {
|
|
|
1968
1982
|
}
|
|
1969
1983
|
//#endregion
|
|
1970
1984
|
//#region src/lib/tools/helpers.ts
|
|
1971
|
-
function
|
|
1985
|
+
function hi(e) {
|
|
1972
1986
|
return w(e) && e.toolMetadata?.kind === "subagent";
|
|
1973
1987
|
}
|
|
1974
|
-
function
|
|
1988
|
+
function gi(e) {
|
|
1975
1989
|
let t = e.toolMetadata?.displayName;
|
|
1976
1990
|
return typeof t == "string" ? t : "Subagent";
|
|
1977
1991
|
}
|
|
1978
|
-
function
|
|
1992
|
+
function _i(e, t) {
|
|
1979
1993
|
let n = y(e);
|
|
1980
1994
|
return {
|
|
1981
1995
|
toolKey: n,
|
|
1982
1996
|
toolEntry: t?.[n]
|
|
1983
1997
|
};
|
|
1984
1998
|
}
|
|
1985
|
-
function
|
|
1999
|
+
function vi(e, t) {
|
|
1986
2000
|
return e?.static === !1 && !!e?.requiresUserInput && t === "input-available";
|
|
1987
2001
|
}
|
|
1988
2002
|
//#endregion
|
|
1989
2003
|
//#region src/lib/chat/markdown-paragraph.tsx
|
|
1990
|
-
var
|
|
1991
|
-
function
|
|
2004
|
+
var yi = /* @__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("."));
|
|
2005
|
+
function bi(e) {
|
|
1992
2006
|
if (!n.isValidElement(e)) return !1;
|
|
1993
2007
|
let t = typeof e.type == "string" ? e.type : e.props.node?.tagName;
|
|
1994
|
-
return t === void 0 || !
|
|
2008
|
+
return t === void 0 || !yi.has(t);
|
|
1995
2009
|
}
|
|
1996
|
-
function
|
|
2010
|
+
function xi(e) {
|
|
1997
2011
|
let t = O(6), { children: r, dir: i } = e, a = n.Children.toArray(r);
|
|
1998
|
-
if (!a.some(
|
|
2012
|
+
if (!a.some(bi)) {
|
|
1999
2013
|
let e;
|
|
2000
2014
|
return t[0] !== r || t[1] !== i ? (e = /* @__PURE__ */ M("p", {
|
|
2001
2015
|
dir: i,
|
|
2002
2016
|
children: r
|
|
2003
2017
|
}), t[0] = r, t[1] = i, t[2] = e) : e = t[2], e;
|
|
2004
2018
|
}
|
|
2005
|
-
if (a.every(
|
|
2019
|
+
if (a.every(bi)) return r;
|
|
2006
2020
|
let o;
|
|
2007
2021
|
return t[3] !== r || t[4] !== i ? (o = /* @__PURE__ */ M("div", {
|
|
2008
2022
|
dir: i,
|
|
@@ -2011,25 +2025,25 @@ function bi(e) {
|
|
|
2011
2025
|
}
|
|
2012
2026
|
//#endregion
|
|
2013
2027
|
//#region src/lib/components/InteractiveResponse.tsx
|
|
2014
|
-
var
|
|
2028
|
+
var Si = { p: ({ children: e, dir: t }) => /* @__PURE__ */ M(xi, {
|
|
2015
2029
|
dir: t,
|
|
2016
2030
|
children: e
|
|
2017
2031
|
}) };
|
|
2018
|
-
function
|
|
2019
|
-
let t = { ...
|
|
2032
|
+
function Ci(e) {
|
|
2033
|
+
let t = { ...Si }, n = {};
|
|
2020
2034
|
for (let r of e) ae(r), t[r.name] = r.component, n[r.name] = r.allowedAttributes;
|
|
2021
2035
|
return {
|
|
2022
2036
|
components: t,
|
|
2023
2037
|
allowedTags: n
|
|
2024
2038
|
};
|
|
2025
2039
|
}
|
|
2026
|
-
function
|
|
2040
|
+
function wi(e) {
|
|
2027
2041
|
let t = O(10), n, r;
|
|
2028
2042
|
t[0] === e ? (n = t[1], r = t[2]) : ({elements: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
2029
2043
|
let i;
|
|
2030
2044
|
t[3] === n ? i = t[4] : (i = n ?? [], t[3] = n, t[4] = i);
|
|
2031
2045
|
let a;
|
|
2032
|
-
t[5] === i ? a = t[6] : (a =
|
|
2046
|
+
t[5] === i ? a = t[6] : (a = Ci(i), t[5] = i, t[6] = a);
|
|
2033
2047
|
let o = a, s;
|
|
2034
2048
|
return t[7] !== r || t[8] !== o ? (s = /* @__PURE__ */ M(J, {
|
|
2035
2049
|
...o,
|
|
@@ -2038,8 +2052,8 @@ function Ci(e) {
|
|
|
2038
2052
|
}
|
|
2039
2053
|
//#endregion
|
|
2040
2054
|
//#region src/lib/renderers/render-part.tsx
|
|
2041
|
-
function
|
|
2042
|
-
let t = O(22), { part: n } = e, { addToolApprovalResponse: r } =
|
|
2055
|
+
function Ti(e) {
|
|
2056
|
+
let t = O(22), { part: n } = e, { addToolApprovalResponse: r } = V();
|
|
2043
2057
|
if (n.state !== "approval-requested") return null;
|
|
2044
2058
|
let i;
|
|
2045
2059
|
t[0] === n ? i = t[1] : (i = n.title ?? y(n), t[0] = n, t[1] = i);
|
|
@@ -2091,21 +2105,21 @@ function wi(e) {
|
|
|
2091
2105
|
children: [l, f]
|
|
2092
2106
|
}), t[18] = o, t[19] = l, t[20] = f, t[21] = p) : p = t[21], p;
|
|
2093
2107
|
}
|
|
2094
|
-
function
|
|
2108
|
+
function Ei(e) {
|
|
2095
2109
|
let t = O(25), { part: n } = e, { registry: r } = z();
|
|
2096
2110
|
if (n.input === void 0) {
|
|
2097
2111
|
let e;
|
|
2098
|
-
return t[0] !== n.errorText || t[1] !== n.output || t[2] !== n.state ? (e = n.state === "output-error" ? /* @__PURE__ */ M(
|
|
2112
|
+
return t[0] !== n.errorText || t[1] !== n.output || t[2] !== n.state ? (e = n.state === "output-error" ? /* @__PURE__ */ M(Qr, {
|
|
2099
2113
|
output: n.output,
|
|
2100
2114
|
errorText: n.errorText
|
|
2101
2115
|
}) : /* @__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;
|
|
2102
2116
|
}
|
|
2103
2117
|
let i;
|
|
2104
|
-
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(
|
|
2118
|
+
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(Ti, { part: n }), t[4] = n, t[5] = i);
|
|
2105
2119
|
let a = i;
|
|
2106
2120
|
if (!r) return a;
|
|
2107
2121
|
let o;
|
|
2108
|
-
t[6] !== n || t[7] !== r ? (o =
|
|
2122
|
+
t[6] !== n || t[7] !== r ? (o = _i(n, r), t[6] = n, t[7] = r, t[8] = o) : o = t[8];
|
|
2109
2123
|
let { toolEntry: s } = o;
|
|
2110
2124
|
if (s) {
|
|
2111
2125
|
let e = s.component, i;
|
|
@@ -2130,8 +2144,8 @@ function Ti(e) {
|
|
|
2130
2144
|
}
|
|
2131
2145
|
//#endregion
|
|
2132
2146
|
//#region src/lib/chat/message-parts.tsx
|
|
2133
|
-
var
|
|
2134
|
-
function
|
|
2147
|
+
var Di = { animation: "slideUp" };
|
|
2148
|
+
function Oi(e) {
|
|
2135
2149
|
let t = O(3), { filename: n, url: r } = e, i = n ?? "Attached image", a;
|
|
2136
2150
|
return t[0] !== i || t[1] !== r ? (a = /* @__PURE__ */ M("img", {
|
|
2137
2151
|
src: r,
|
|
@@ -2139,7 +2153,7 @@ function Di(e) {
|
|
|
2139
2153
|
className: "max-h-64 rounded-md border object-contain"
|
|
2140
2154
|
}), t[0] = i, t[1] = r, t[2] = a) : a = t[2], a;
|
|
2141
2155
|
}
|
|
2142
|
-
function
|
|
2156
|
+
function ki(e) {
|
|
2143
2157
|
let t = O(16), { filename: n, mediaType: r, url: i } = e, a = n || "Untitled", o;
|
|
2144
2158
|
t[0] !== r || t[1] !== a || t[2] !== i ? (o = i?.startsWith("data:") ? null : i && r.startsWith("video/") ? /* @__PURE__ */ M("video", {
|
|
2145
2159
|
controls: !0,
|
|
@@ -2185,30 +2199,27 @@ function Oi(e) {
|
|
|
2185
2199
|
children: [s, d]
|
|
2186
2200
|
}), t[13] = s, t[14] = d, t[15] = f) : f = t[15], f;
|
|
2187
2201
|
}
|
|
2188
|
-
function
|
|
2202
|
+
function Ai(e) {
|
|
2189
2203
|
let t = O(4), { filename: n, mediaType: r, url: i } = e, a;
|
|
2190
|
-
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(
|
|
2204
|
+
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(Oi, {
|
|
2191
2205
|
filename: n,
|
|
2192
2206
|
url: i
|
|
2193
|
-
}) : /* @__PURE__ */ M(
|
|
2207
|
+
}) : /* @__PURE__ */ M(ki, {
|
|
2194
2208
|
filename: n,
|
|
2195
2209
|
mediaType: r,
|
|
2196
2210
|
url: i
|
|
2197
2211
|
}), t[0] = n, t[1] = r, t[2] = i, t[3] = a) : a = t[3], a;
|
|
2198
2212
|
}
|
|
2199
|
-
var
|
|
2200
|
-
function
|
|
2201
|
-
return t.
|
|
2202
|
-
at: t.endIndex ?? e.length,
|
|
2203
|
-
order: n
|
|
2204
|
-
})).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);
|
|
2213
|
+
var ji = "genai-citation";
|
|
2214
|
+
function Mi(e, t) {
|
|
2215
|
+
return en(e, t).reverse().reduce((e, { at: t, order: n }) => `${e.slice(0, t)}<${ji} citation="${n}" />${e.slice(t)}`, e);
|
|
2205
2216
|
}
|
|
2206
|
-
var
|
|
2207
|
-
function
|
|
2208
|
-
let t = O(16), n = l(
|
|
2217
|
+
var Ni = o(null);
|
|
2218
|
+
function Pi(e) {
|
|
2219
|
+
let t = O(16), n = l(Ni), r = n?.citations[Number(e.citation)];
|
|
2209
2220
|
if (!n || !r) return null;
|
|
2210
2221
|
let i;
|
|
2211
|
-
t[0] !== r.source.url || t[1] !== n.sources ? (i =
|
|
2222
|
+
t[0] !== r.source.url || t[1] !== n.sources ? (i = nn(n.sources, r.source.url), t[0] = r.source.url, t[1] = n.sources, t[2] = i) : i = t[2];
|
|
2212
2223
|
let a = i;
|
|
2213
2224
|
if (a === null) return null;
|
|
2214
2225
|
if (n.HostCitation) {
|
|
@@ -2229,38 +2240,38 @@ function Ni(e) {
|
|
|
2229
2240
|
children: r.citedText
|
|
2230
2241
|
}) : null, t[10] = r.citedText, t[11] = s);
|
|
2231
2242
|
let c;
|
|
2232
|
-
return t[12] !== a || t[13] !== o || t[14] !== s ? (c = /* @__PURE__ */ M(
|
|
2243
|
+
return t[12] !== a || t[13] !== o || t[14] !== s ? (c = /* @__PURE__ */ M(Qn, {
|
|
2233
2244
|
source: o,
|
|
2234
2245
|
index: a,
|
|
2235
2246
|
children: s
|
|
2236
2247
|
}), t[12] = a, t[13] = o, t[14] = s, t[15] = c) : c = t[15], c;
|
|
2237
2248
|
}
|
|
2238
|
-
var
|
|
2239
|
-
name:
|
|
2249
|
+
var Fi = {
|
|
2250
|
+
name: ji,
|
|
2240
2251
|
allowedAttributes: ["citation"],
|
|
2241
|
-
component:
|
|
2252
|
+
component: Pi
|
|
2242
2253
|
};
|
|
2243
|
-
function
|
|
2244
|
-
let t = O(27), { text: n, citations: r, elements: i, className: a } = e, { status: o } =
|
|
2245
|
-
t[0] === r ? u = t[1] : (u =
|
|
2254
|
+
function Ii(e) {
|
|
2255
|
+
let t = O(27), { text: n, citations: r, elements: i, className: a } = e, { status: o } = Qt(), s = Y(), { citation: c } = W(), { message: l } = K(), u;
|
|
2256
|
+
t[0] === r ? u = t[1] : (u = H(r), t[0] = r, t[1] = u);
|
|
2246
2257
|
let d = u, f;
|
|
2247
|
-
t[2] ===
|
|
2258
|
+
t[2] === l ? f = t[3] : (f = tn(l), t[2] = l, t[3] = f);
|
|
2248
2259
|
let p;
|
|
2249
|
-
t[4] !==
|
|
2260
|
+
t[4] !== c || t[5] !== f || t[6] !== d ? (p = {
|
|
2250
2261
|
citations: d,
|
|
2251
2262
|
sources: f,
|
|
2252
|
-
HostCitation:
|
|
2253
|
-
}, t[4] =
|
|
2263
|
+
HostCitation: c
|
|
2264
|
+
}, t[4] = c, t[5] = f, t[6] = d, t[7] = p) : p = t[7];
|
|
2254
2265
|
let m = p, h = d.length > 0, g;
|
|
2255
|
-
t[8] !== i || t[9] !== h ? (g = h ? [...i ?? [],
|
|
2266
|
+
t[8] !== i || t[9] !== h ? (g = h ? [...i ?? [], Fi] : i, t[8] = i, t[9] = h, t[10] = g) : g = t[10];
|
|
2256
2267
|
let _ = g, v;
|
|
2257
2268
|
t[11] === a ? v = t[12] : (v = k("text-sm", a), t[11] = a, t[12] = v);
|
|
2258
2269
|
let y = !s && o === "streaming", b;
|
|
2259
|
-
t[13] !== h || t[14] !== n || t[15] !== d ? (b = h ?
|
|
2270
|
+
t[13] !== h || t[14] !== n || t[15] !== d ? (b = h ? Mi(n, d) : n, t[13] = h, t[14] = n, t[15] = d, t[16] = b) : b = t[16];
|
|
2260
2271
|
let x;
|
|
2261
|
-
t[17] !== y || t[18] !== b || t[19] !== _ ? (x = /* @__PURE__ */ M(
|
|
2272
|
+
t[17] !== y || t[18] !== b || t[19] !== _ ? (x = /* @__PURE__ */ M(wi, {
|
|
2262
2273
|
elements: _,
|
|
2263
|
-
animated:
|
|
2274
|
+
animated: Di,
|
|
2264
2275
|
isAnimating: y,
|
|
2265
2276
|
children: b
|
|
2266
2277
|
}), t[17] = y, t[18] = b, t[19] = _, t[20] = x) : x = t[20];
|
|
@@ -2270,40 +2281,40 @@ function Fi(e) {
|
|
|
2270
2281
|
children: x
|
|
2271
2282
|
}), t[21] = v, t[22] = x, t[23] = S) : S = t[23];
|
|
2272
2283
|
let C;
|
|
2273
|
-
return t[24] !== m || t[25] !== S ? (C = /* @__PURE__ */ M(
|
|
2284
|
+
return t[24] !== m || t[25] !== S ? (C = /* @__PURE__ */ M(Ni, {
|
|
2274
2285
|
value: m,
|
|
2275
2286
|
children: S
|
|
2276
2287
|
}), t[24] = m, t[25] = S, t[26] = C) : C = t[26], C;
|
|
2277
2288
|
}
|
|
2278
|
-
function
|
|
2279
|
-
let t = O(8), { part: n } = e, r =
|
|
2280
|
-
t[0] !== n || t[1] !== r ? (i = r && /* @__PURE__ */ M(
|
|
2289
|
+
function Li(e) {
|
|
2290
|
+
let t = O(8), { part: n } = e, r = Ri(), i;
|
|
2291
|
+
t[0] !== n || t[1] !== r ? (i = r && /* @__PURE__ */ M(ei, { part: n }), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
2281
2292
|
let a;
|
|
2282
|
-
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(
|
|
2293
|
+
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(Ei, { part: n }), t[3] = n, t[4] = a);
|
|
2283
2294
|
let o;
|
|
2284
2295
|
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;
|
|
2285
2296
|
}
|
|
2286
|
-
function
|
|
2297
|
+
function Ri() {
|
|
2287
2298
|
let { debugMode: e } = z(), t = Y();
|
|
2288
2299
|
return !!e && !t;
|
|
2289
2300
|
}
|
|
2290
2301
|
//#endregion
|
|
2291
2302
|
//#region src/lib/chat/trajectory/tool-label.tsx
|
|
2292
|
-
function
|
|
2303
|
+
function zi(e) {
|
|
2293
2304
|
return !!e && e !== "output-available";
|
|
2294
2305
|
}
|
|
2295
|
-
function
|
|
2306
|
+
function Bi(e) {
|
|
2296
2307
|
let t = O(5), { label: n, part: r, state: i } = e, a = Y(), o;
|
|
2297
|
-
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !
|
|
2308
|
+
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !zi(i), t[0] = a, t[1] = n, t[2] = r, t[3] = i, t[4] = o) : o = t[4], o;
|
|
2298
2309
|
}
|
|
2299
|
-
function
|
|
2310
|
+
function Vi(e) {
|
|
2300
2311
|
let t = O(18), { label: n, part: r } = e, i = n.icon, a = n.actions, o;
|
|
2301
2312
|
t[0] !== n || t[1] !== r ? (o = {
|
|
2302
2313
|
label: n,
|
|
2303
2314
|
part: r,
|
|
2304
2315
|
state: r.state
|
|
2305
2316
|
}, t[0] = n, t[1] = r, t[2] = o) : o = t[2];
|
|
2306
|
-
let s =
|
|
2317
|
+
let s = Bi(o), c;
|
|
2307
2318
|
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];
|
|
2308
2319
|
let l;
|
|
2309
2320
|
t[6] === n.name ? l = t[7] : (l = /* @__PURE__ */ M("span", {
|
|
@@ -2323,7 +2334,7 @@ function Bi(e) {
|
|
|
2323
2334
|
children: [u, d]
|
|
2324
2335
|
}), t[15] = u, t[16] = d, t[17] = f) : f = t[17], f;
|
|
2325
2336
|
}
|
|
2326
|
-
function
|
|
2337
|
+
function Hi(e) {
|
|
2327
2338
|
let t = O(3), { name: n, value: r } = e, i;
|
|
2328
2339
|
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ N("span", {
|
|
2329
2340
|
"data-slot": "tool-arg",
|
|
@@ -2335,15 +2346,15 @@ function Vi(e) {
|
|
|
2335
2346
|
]
|
|
2336
2347
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2337
2348
|
}
|
|
2338
|
-
function
|
|
2349
|
+
function Ui(e) {
|
|
2339
2350
|
let t = O(23), { label: n, state: r, part: i, children: a } = e, o = n.actions, s;
|
|
2340
2351
|
t[0] !== n || t[1] !== i || t[2] !== r ? (s = {
|
|
2341
2352
|
label: n,
|
|
2342
2353
|
part: i,
|
|
2343
2354
|
state: r
|
|
2344
2355
|
}, t[0] = n, t[1] = i, t[2] = r, t[3] = s) : s = t[3];
|
|
2345
|
-
let c =
|
|
2346
|
-
t[4] === n.args ? l = t[5] : (l = n.args ? Object.entries(n.args).map(
|
|
2356
|
+
let c = Bi(s), l;
|
|
2357
|
+
t[4] === n.args ? l = t[5] : (l = n.args ? Object.entries(n.args).map(Wi) : "...", t[4] = n.args, t[5] = l);
|
|
2347
2358
|
let u;
|
|
2348
2359
|
t[6] !== a || t[7] !== n.name || t[8] !== l ? (u = /* @__PURE__ */ N("span", {
|
|
2349
2360
|
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-[',']",
|
|
@@ -2376,25 +2387,25 @@ function Hi(e) {
|
|
|
2376
2387
|
children: [f, p]
|
|
2377
2388
|
}), t[20] = f, t[21] = p, t[22] = m) : m = t[22], m;
|
|
2378
2389
|
}
|
|
2379
|
-
function
|
|
2390
|
+
function Wi(e) {
|
|
2380
2391
|
let [t, n] = e;
|
|
2381
|
-
return /* @__PURE__ */ M(
|
|
2392
|
+
return /* @__PURE__ */ M(Hi, {
|
|
2382
2393
|
name: t,
|
|
2383
2394
|
value: n
|
|
2384
2395
|
}, t);
|
|
2385
2396
|
}
|
|
2386
2397
|
//#endregion
|
|
2387
2398
|
//#region src/lib/chat/trajectory/segments/index.tsx
|
|
2388
|
-
function
|
|
2399
|
+
function Gi(e) {
|
|
2389
2400
|
return e.type === "text" && e.providerMetadata?.openai?.phase === "commentary";
|
|
2390
2401
|
}
|
|
2391
|
-
function
|
|
2402
|
+
function Ki(e) {
|
|
2392
2403
|
let t = O(9), { segment: n, elements: r, className: i } = e, a;
|
|
2393
2404
|
if (t[0] !== i || t[1] !== r || t[2] !== n.parts) {
|
|
2394
2405
|
let e;
|
|
2395
2406
|
t[4] !== i || t[5] !== r ? (e = (e) => {
|
|
2396
2407
|
let { part: t, idx: n } = e;
|
|
2397
|
-
return t.type === "text" ? /* @__PURE__ */ M(
|
|
2408
|
+
return t.type === "text" ? /* @__PURE__ */ M(Ii, {
|
|
2398
2409
|
text: t.text,
|
|
2399
2410
|
citations: t.citations,
|
|
2400
2411
|
elements: r,
|
|
@@ -2405,27 +2416,27 @@ function Gi(e) {
|
|
|
2405
2416
|
let o;
|
|
2406
2417
|
return t[7] === a ? o = t[8] : (o = /* @__PURE__ */ M(j, { children: a }), t[7] = a, t[8] = o), o;
|
|
2407
2418
|
}
|
|
2408
|
-
function
|
|
2419
|
+
function qi(e) {
|
|
2409
2420
|
let t = O(4), { segment: n } = e, { part: r } = n;
|
|
2410
2421
|
if (r.type !== "file") return null;
|
|
2411
2422
|
let i;
|
|
2412
|
-
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(
|
|
2423
|
+
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(Ai, {
|
|
2413
2424
|
filename: r.filename,
|
|
2414
2425
|
mediaType: r.mediaType,
|
|
2415
2426
|
url: r.url
|
|
2416
2427
|
}), t[0] = r.filename, t[1] = r.mediaType, t[2] = r.url, t[3] = i) : i = t[3], i;
|
|
2417
2428
|
}
|
|
2418
|
-
function
|
|
2419
|
-
let t = O(9), { segment: n } = e, {
|
|
2420
|
-
t[0] === r ? i = t[1] : (i =
|
|
2429
|
+
function Ji(e) {
|
|
2430
|
+
let t = O(9), { segment: n } = e, { message: r } = K(), i;
|
|
2431
|
+
t[0] === r ? i = t[1] : (i = tn(r), t[0] = r, t[1] = i);
|
|
2421
2432
|
let a = i, o;
|
|
2422
2433
|
if (t[2] !== n.parts || t[3] !== a) {
|
|
2423
2434
|
let e;
|
|
2424
2435
|
t[5] === a ? e = t[6] : (e = (e) => {
|
|
2425
2436
|
let { part: t, idx: n } = e;
|
|
2426
2437
|
if (t.type !== "source-url") return null;
|
|
2427
|
-
let r =
|
|
2428
|
-
return r === null ? null : /* @__PURE__ */ M(
|
|
2438
|
+
let r = nn(a, t.url);
|
|
2439
|
+
return r === null ? null : /* @__PURE__ */ M(Qn, {
|
|
2429
2440
|
source: {
|
|
2430
2441
|
url: t.url,
|
|
2431
2442
|
title: t.title
|
|
@@ -2437,7 +2448,7 @@ function qi(e) {
|
|
|
2437
2448
|
let s;
|
|
2438
2449
|
return t[7] === o ? s = t[8] : (s = /* @__PURE__ */ M("span", { children: o }), t[7] = o, t[8] = s), s;
|
|
2439
2450
|
}
|
|
2440
|
-
function
|
|
2451
|
+
function Yi(e) {
|
|
2441
2452
|
let t = O(3), { segment: n } = e, r = G();
|
|
2442
2453
|
if (Y()) return null;
|
|
2443
2454
|
let { part: i } = n;
|
|
@@ -2446,31 +2457,31 @@ function Ji(e) {
|
|
|
2446
2457
|
return t[0] !== i.text || t[1] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
2447
2458
|
className: "text-muted-foreground text-xs",
|
|
2448
2459
|
children: /* @__PURE__ */ M(J, {
|
|
2449
|
-
animated:
|
|
2460
|
+
animated: Di,
|
|
2450
2461
|
isAnimating: a,
|
|
2451
2462
|
children: i.text
|
|
2452
2463
|
})
|
|
2453
2464
|
}), t[0] = i.text, t[1] = a, t[2] = o) : o = t[2], o;
|
|
2454
2465
|
}
|
|
2455
|
-
function
|
|
2466
|
+
function Xi(e) {
|
|
2456
2467
|
let t = O(2), { segment: n } = e;
|
|
2457
|
-
if (!
|
|
2468
|
+
if (!Ri()) return null;
|
|
2458
2469
|
let { part: r } = n;
|
|
2459
2470
|
if (r.type !== "dynamic-tool") return null;
|
|
2460
2471
|
let i;
|
|
2461
|
-
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ M(
|
|
2472
|
+
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ M(ti, { part: r }), t[0] = r, t[1] = i), i;
|
|
2462
2473
|
}
|
|
2463
|
-
var
|
|
2464
|
-
function
|
|
2465
|
-
let e = l(
|
|
2474
|
+
var Zi = o(null), Qi = o(null);
|
|
2475
|
+
function $i() {
|
|
2476
|
+
let e = l(Zi);
|
|
2466
2477
|
if (!e) throw Error("Segment.Tool* parts must be rendered within Segment.Tool");
|
|
2467
2478
|
return e;
|
|
2468
2479
|
}
|
|
2469
|
-
function
|
|
2480
|
+
function ea(e) {
|
|
2470
2481
|
let t = O(29), { segment: n, children: r } = e, i = z(), a = G(), { part: o } = n;
|
|
2471
2482
|
if (!S(o)) return null;
|
|
2472
2483
|
let s, c, l, u;
|
|
2473
|
-
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} =
|
|
2484
|
+
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} = _i(o, i.registry), c = vi(u, o.state), s = !c && on(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]);
|
|
2474
2485
|
let d = l, f;
|
|
2475
2486
|
t[7] !== s || t[8] !== d || t[9] !== o ? (f = s ? {
|
|
2476
2487
|
...d ?? { name: y(o) },
|
|
@@ -2492,37 +2503,37 @@ function $i(e) {
|
|
|
2492
2503
|
aborted: s
|
|
2493
2504
|
}, t[17] = s, t[18] = p, t[19] = o.state, t[20] = g) : g = t[20];
|
|
2494
2505
|
let _;
|
|
2495
|
-
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(
|
|
2506
|
+
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(na, {}), t[21] = r, t[22] = _);
|
|
2496
2507
|
let v;
|
|
2497
|
-
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(
|
|
2508
|
+
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(Qi, {
|
|
2498
2509
|
value: g,
|
|
2499
2510
|
children: _
|
|
2500
2511
|
}), t[23] = g, t[24] = _, t[25] = v) : v = t[25];
|
|
2501
2512
|
let b;
|
|
2502
|
-
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M(
|
|
2513
|
+
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M(Zi, {
|
|
2503
2514
|
value: h,
|
|
2504
2515
|
children: v
|
|
2505
2516
|
}), t[26] = h, t[27] = v, t[28] = b) : b = t[28], b;
|
|
2506
2517
|
}
|
|
2507
|
-
function
|
|
2508
|
-
let e = O(2), { part: t, activeClientInput: n } =
|
|
2518
|
+
function ta() {
|
|
2519
|
+
let e = O(2), { part: t, activeClientInput: n } = $i();
|
|
2509
2520
|
if (n) return null;
|
|
2510
2521
|
let r;
|
|
2511
|
-
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(
|
|
2522
|
+
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(Li, { part: t }), e[0] = t, e[1] = r), r;
|
|
2512
2523
|
}
|
|
2513
|
-
function
|
|
2514
|
-
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } =
|
|
2524
|
+
function na(e) {
|
|
2525
|
+
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } = $i();
|
|
2515
2526
|
if (!i) {
|
|
2516
2527
|
let e;
|
|
2517
2528
|
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M("div", {
|
|
2518
2529
|
className: "min-w-0 flex-1",
|
|
2519
|
-
children: /* @__PURE__ */ M(
|
|
2530
|
+
children: /* @__PURE__ */ M(ta, {})
|
|
2520
2531
|
}), t[0] = e) : e = t[0], e;
|
|
2521
2532
|
}
|
|
2522
2533
|
let o;
|
|
2523
2534
|
t[1] !== n || t[2] !== i || t[3] !== r ? (o = /* @__PURE__ */ M(L, {
|
|
2524
2535
|
className: "cursor-pointer",
|
|
2525
|
-
children: /* @__PURE__ */ M(
|
|
2536
|
+
children: /* @__PURE__ */ M(Ui, {
|
|
2526
2537
|
label: i,
|
|
2527
2538
|
state: r.state,
|
|
2528
2539
|
part: r,
|
|
@@ -2532,7 +2543,7 @@ function ta(e) {
|
|
|
2532
2543
|
let s;
|
|
2533
2544
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(I, {
|
|
2534
2545
|
className: "mb-2",
|
|
2535
|
-
children: /* @__PURE__ */ M(
|
|
2546
|
+
children: /* @__PURE__ */ M(ta, {})
|
|
2536
2547
|
}), t[5] = s) : s = t[5];
|
|
2537
2548
|
let c;
|
|
2538
2549
|
return t[6] !== a || t[7] !== o ? (c = /* @__PURE__ */ N(F, {
|
|
@@ -2542,31 +2553,31 @@ function ta(e) {
|
|
|
2542
2553
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2543
2554
|
}
|
|
2544
2555
|
var X = {
|
|
2545
|
-
Text:
|
|
2546
|
-
File:
|
|
2547
|
-
Source:
|
|
2548
|
-
Reasoning:
|
|
2549
|
-
DynamicTool:
|
|
2550
|
-
Tool:
|
|
2551
|
-
ToolDisclosure:
|
|
2552
|
-
ToolContent:
|
|
2556
|
+
Text: Ki,
|
|
2557
|
+
File: qi,
|
|
2558
|
+
Source: Ji,
|
|
2559
|
+
Reasoning: Yi,
|
|
2560
|
+
DynamicTool: Xi,
|
|
2561
|
+
Tool: ea,
|
|
2562
|
+
ToolDisclosure: na,
|
|
2563
|
+
ToolContent: ta
|
|
2553
2564
|
};
|
|
2554
2565
|
//#endregion
|
|
2555
2566
|
//#region src/lib/chat/trajectory/trajectory-segments.ts
|
|
2556
|
-
function
|
|
2567
|
+
function ra(e) {
|
|
2557
2568
|
return S(e) ? "tool" : e.type === "dynamic-tool" ? "dynamic-tool" : e.type === "reasoning" && "text" in e && e.text ? "reasoning" : null;
|
|
2558
2569
|
}
|
|
2559
|
-
function
|
|
2570
|
+
function ia(e, t) {
|
|
2560
2571
|
return e.kind === "text" || e.kind === "file" || e.kind === "source" ? !1 : e.kind === "reasoning" || e.kind !== "dynamic-tool" || !!t;
|
|
2561
2572
|
}
|
|
2562
|
-
function
|
|
2573
|
+
function aa(e, t, n) {
|
|
2563
2574
|
let r = e[t + 1];
|
|
2564
|
-
return !!r &&
|
|
2575
|
+
return !!r && ia(r, n);
|
|
2565
2576
|
}
|
|
2566
|
-
function
|
|
2567
|
-
let t = [], n = new Set(e.flatMap((e) => e.type === "text" ?
|
|
2577
|
+
function oa(e) {
|
|
2578
|
+
let t = [], n = new Set(e.flatMap((e) => e.type === "text" ? H(e.citations).map(({ source: e }) => e.url) : []));
|
|
2568
2579
|
for (let r = 0; r < e.length; r++) {
|
|
2569
|
-
let i = e[r], a =
|
|
2580
|
+
let i = e[r], a = ra(i);
|
|
2570
2581
|
if (a) t.push({
|
|
2571
2582
|
kind: a,
|
|
2572
2583
|
part: i,
|
|
@@ -2610,7 +2621,7 @@ function Z(e, t) {
|
|
|
2610
2621
|
}
|
|
2611
2622
|
//#endregion
|
|
2612
2623
|
//#region src/lib/chat/trajectory/nested-trajectory.tsx
|
|
2613
|
-
function
|
|
2624
|
+
function sa(e, t) {
|
|
2614
2625
|
let n = `${Z(e, t)}:${e.kind}`;
|
|
2615
2626
|
if (e.kind === "text") return `${n}:${e.parts.map(({ part: e }) => e.type === "text" ? e.text : "").join("")}`;
|
|
2616
2627
|
if (e.kind === "reasoning" && e.part.type === "reasoning") return `${n}:${e.part.text}`;
|
|
@@ -2620,10 +2631,10 @@ function oa(e, t) {
|
|
|
2620
2631
|
}
|
|
2621
2632
|
return e.kind === "file" && e.part.type === "file" ? `${n}:${e.part.url}:${e.part.mediaType}:${e.part.filename ?? ""}` : n;
|
|
2622
2633
|
}
|
|
2623
|
-
function
|
|
2634
|
+
function ca(e, t, n) {
|
|
2624
2635
|
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;
|
|
2625
2636
|
}
|
|
2626
|
-
var
|
|
2637
|
+
var la = c(function(e) {
|
|
2627
2638
|
let t = O(8), { segment: n } = e;
|
|
2628
2639
|
if (n.kind === "tool") {
|
|
2629
2640
|
let e;
|
|
@@ -2645,13 +2656,13 @@ var ca = c(function(e) {
|
|
|
2645
2656
|
return t[6] === n ? e = t[7] : (e = /* @__PURE__ */ M(X.File, { segment: n }), t[6] = n, t[7] = e), e;
|
|
2646
2657
|
}
|
|
2647
2658
|
return null;
|
|
2648
|
-
},
|
|
2649
|
-
function
|
|
2659
|
+
}, ua);
|
|
2660
|
+
function ua(e, t) {
|
|
2650
2661
|
return e.complete && t.complete && e.cacheKey === t.cacheKey;
|
|
2651
2662
|
}
|
|
2652
|
-
function
|
|
2663
|
+
function da(e) {
|
|
2653
2664
|
let t = O(11), { parts: n, className: r } = e, i;
|
|
2654
|
-
t[0] === n ? i = t[1] : (i =
|
|
2665
|
+
t[0] === n ? i = t[1] : (i = oa(n), t[0] = n, t[1] = i);
|
|
2655
2666
|
let a = i;
|
|
2656
2667
|
if (a.length === 0) return null;
|
|
2657
2668
|
let o;
|
|
@@ -2661,10 +2672,10 @@ function ua(e) {
|
|
|
2661
2672
|
let e;
|
|
2662
2673
|
t[6] === a.length ? e = t[7] : (e = (e, t) => {
|
|
2663
2674
|
let n = `${Z(e, t)}-${e.kind}`;
|
|
2664
|
-
return /* @__PURE__ */ M(
|
|
2675
|
+
return /* @__PURE__ */ M(la, {
|
|
2665
2676
|
segment: e,
|
|
2666
|
-
cacheKey:
|
|
2667
|
-
complete:
|
|
2677
|
+
cacheKey: sa(e, t),
|
|
2678
|
+
complete: ca(e, t, a.length)
|
|
2668
2679
|
}, n);
|
|
2669
2680
|
}, t[6] = a.length, t[7] = e), s = a.map(e), t[4] = a, t[5] = s;
|
|
2670
2681
|
} else s = t[5];
|
|
@@ -2696,13 +2707,13 @@ function Q(e) {
|
|
|
2696
2707
|
}
|
|
2697
2708
|
//#endregion
|
|
2698
2709
|
//#region src/lib/chat/trajectory/trajectories/message-actions.tsx
|
|
2699
|
-
function
|
|
2710
|
+
function fa() {
|
|
2700
2711
|
let { index: e } = K(), { messages: t } = W(), n = G();
|
|
2701
2712
|
return !(e === t.length - 1 && (n === "submitted" || n === "streaming" || n === "error"));
|
|
2702
2713
|
}
|
|
2703
|
-
function
|
|
2714
|
+
function pa(e) {
|
|
2704
2715
|
let t = O(5), { className: n, children: r } = e;
|
|
2705
|
-
if (!
|
|
2716
|
+
if (!fa() || i.toArray(r).length === 0) return null;
|
|
2706
2717
|
let a;
|
|
2707
2718
|
t[0] === n ? a = t[1] : (a = k("mt-1 flex items-center gap-0.5", n), t[0] = n, t[1] = a);
|
|
2708
2719
|
let o;
|
|
@@ -2712,11 +2723,11 @@ function fa(e) {
|
|
|
2712
2723
|
children: r
|
|
2713
2724
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
2714
2725
|
}
|
|
2715
|
-
function
|
|
2716
|
-
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] =
|
|
2726
|
+
function ma(e) {
|
|
2727
|
+
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] = Hr(), o = i ? "Copied" : "Copy message", s;
|
|
2717
2728
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2718
2729
|
let c;
|
|
2719
|
-
t[2] !== a || t[3] !== r ? (c = () => void a(
|
|
2730
|
+
t[2] !== a || t[3] !== r ? (c = () => void a(pi(r)), t[2] = a, t[3] = r, t[4] = c) : c = t[4];
|
|
2720
2731
|
let l;
|
|
2721
2732
|
t[5] === i ? l = t[6] : (l = M(i ? Re : Ke, { className: "size-3.5" }), t[5] = i, t[6] = l);
|
|
2722
2733
|
let u;
|
|
@@ -2727,8 +2738,8 @@ function pa(e) {
|
|
|
2727
2738
|
icon: l
|
|
2728
2739
|
}), t[7] = o, t[8] = s, t[9] = c, t[10] = l, t[11] = u) : u = t[11], u;
|
|
2729
2740
|
}
|
|
2730
|
-
function
|
|
2731
|
-
let t = O(9), { className: n } = e, { message: r } = K(), { regenerate: i } =
|
|
2741
|
+
function ha(e) {
|
|
2742
|
+
let t = O(9), { className: n } = e, { message: r } = K(), { regenerate: i } = V(), a;
|
|
2732
2743
|
t[0] === n ? a = t[1] : (a = k("p-1.5", n), t[0] = n, t[1] = a);
|
|
2733
2744
|
let o;
|
|
2734
2745
|
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];
|
|
@@ -2742,8 +2753,8 @@ function ma(e) {
|
|
|
2742
2753
|
icon: s
|
|
2743
2754
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2744
2755
|
}
|
|
2745
|
-
function
|
|
2746
|
-
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] =
|
|
2756
|
+
function ga(e) {
|
|
2757
|
+
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] = Hr(), o = i ? "Copied" : "Copy debug JSON", s;
|
|
2747
2758
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2748
2759
|
let c;
|
|
2749
2760
|
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];
|
|
@@ -2759,7 +2770,7 @@ function ha(e) {
|
|
|
2759
2770
|
}
|
|
2760
2771
|
//#endregion
|
|
2761
2772
|
//#region src/lib/chat/trajectory/trajectories/messages-error.tsx
|
|
2762
|
-
function
|
|
2773
|
+
function _a(e) {
|
|
2763
2774
|
let t = O(7), { onTryAgain: n, error: r } = e, i = r instanceof Error ? r.message : "An error occurred. Please try again.", a;
|
|
2764
2775
|
t[0] === i ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
2765
2776
|
className: "text-destructive text-sm",
|
|
@@ -2785,18 +2796,18 @@ function ga(e) {
|
|
|
2785
2796
|
})
|
|
2786
2797
|
}), t[4] = a, t[5] = o, t[6] = s) : s = t[6], s;
|
|
2787
2798
|
}
|
|
2788
|
-
function
|
|
2799
|
+
function va(e) {
|
|
2789
2800
|
let t = O(3), { error: n, onRetry: r } = e;
|
|
2790
2801
|
if (!n || !r) return null;
|
|
2791
2802
|
let i;
|
|
2792
|
-
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
2803
|
+
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(_a, {
|
|
2793
2804
|
onTryAgain: r,
|
|
2794
2805
|
error: n
|
|
2795
2806
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2796
2807
|
}
|
|
2797
2808
|
//#endregion
|
|
2798
2809
|
//#region src/lib/chat/trajectory/trajectories/messages-shell.tsx
|
|
2799
|
-
function
|
|
2810
|
+
function ya(e) {
|
|
2800
2811
|
let t = O(15), { messages: n, className: r, elements: i, citation: a, status: o, children: s } = e, c;
|
|
2801
2812
|
t[0] !== a || t[1] !== i || t[2] !== n || t[3] !== o ? (c = {
|
|
2802
2813
|
messages: n,
|
|
@@ -2817,12 +2828,12 @@ function va(e) {
|
|
|
2817
2828
|
children: d
|
|
2818
2829
|
}), t[9] = u, t[10] = d, t[11] = f) : f = t[11];
|
|
2819
2830
|
let p;
|
|
2820
|
-
return t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(
|
|
2831
|
+
return t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(Xn, {
|
|
2821
2832
|
value: l,
|
|
2822
2833
|
children: f
|
|
2823
2834
|
}), t[12] = f, t[13] = l, t[14] = p) : p = t[14], p;
|
|
2824
2835
|
}
|
|
2825
|
-
function
|
|
2836
|
+
function ba(e) {
|
|
2826
2837
|
let t = O(5), { className: n, children: r } = e, i;
|
|
2827
2838
|
t[0] === n ? i = t[1] : (i = k("flex flex-col gap-4", n), t[0] = n, t[1] = i);
|
|
2828
2839
|
let a;
|
|
@@ -2831,7 +2842,7 @@ function ya(e) {
|
|
|
2831
2842
|
children: r
|
|
2832
2843
|
}), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
|
|
2833
2844
|
}
|
|
2834
|
-
function
|
|
2845
|
+
function xa(e) {
|
|
2835
2846
|
let t = O(9), { message: n, index: r, className: i, children: a } = e, o;
|
|
2836
2847
|
t[0] !== r || t[1] !== n ? (o = {
|
|
2837
2848
|
message: n,
|
|
@@ -2843,22 +2854,22 @@ function ba(e) {
|
|
|
2843
2854
|
children: a
|
|
2844
2855
|
}), t[3] = a, t[4] = i, t[5] = c) : c = t[5];
|
|
2845
2856
|
let l;
|
|
2846
|
-
return t[6] !== c || t[7] !== s ? (l = /* @__PURE__ */ M(
|
|
2857
|
+
return t[6] !== c || t[7] !== s ? (l = /* @__PURE__ */ M(Zn, {
|
|
2847
2858
|
value: s,
|
|
2848
2859
|
children: c
|
|
2849
2860
|
}), t[6] = c, t[7] = s, t[8] = l) : l = t[8], l;
|
|
2850
2861
|
}
|
|
2851
2862
|
//#endregion
|
|
2852
2863
|
//#region src/lib/components/PendingToolInput.tsx
|
|
2853
|
-
function
|
|
2854
|
-
let e = O(5), { registry: t } = z(), n =
|
|
2864
|
+
function Sa() {
|
|
2865
|
+
let e = O(5), { registry: t } = z(), n = V().messages, r;
|
|
2855
2866
|
if (e[0] !== n || e[1] !== t) {
|
|
2856
2867
|
bb0: {
|
|
2857
2868
|
if (!t) {
|
|
2858
2869
|
r = null;
|
|
2859
2870
|
break bb0;
|
|
2860
2871
|
}
|
|
2861
|
-
let i = n.findLast(
|
|
2872
|
+
let i = n.findLast(Ca);
|
|
2862
2873
|
if (!i) {
|
|
2863
2874
|
r = null;
|
|
2864
2875
|
break bb0;
|
|
@@ -2877,12 +2888,12 @@ function xa() {
|
|
|
2877
2888
|
} else r = e[2];
|
|
2878
2889
|
return r;
|
|
2879
2890
|
}
|
|
2880
|
-
function
|
|
2891
|
+
function Ca(e) {
|
|
2881
2892
|
let { role: t } = e;
|
|
2882
2893
|
return t === "assistant";
|
|
2883
2894
|
}
|
|
2884
|
-
function
|
|
2885
|
-
let t = O(10), { children: n, className: i } = e, a =
|
|
2895
|
+
function wa(e) {
|
|
2896
|
+
let t = O(10), { children: n, className: i } = e, a = Sa(), o = a?.entry.component, s = a ? "hidden" : "visible", c;
|
|
2886
2897
|
t[0] !== n || t[1] !== s ? (c = /* @__PURE__ */ M(r, {
|
|
2887
2898
|
mode: s,
|
|
2888
2899
|
children: n
|
|
@@ -2897,12 +2908,12 @@ function Ca(e) {
|
|
|
2897
2908
|
}
|
|
2898
2909
|
//#endregion
|
|
2899
2910
|
//#region src/lib/chat/trajectory/trajectories/thinking-hint.ts
|
|
2900
|
-
function
|
|
2911
|
+
function Ta(e, t) {
|
|
2901
2912
|
if (e === "error" || e === "ready" || !t) return null;
|
|
2902
2913
|
if (t.role !== "assistant") return "Thinking...";
|
|
2903
2914
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2904
2915
|
let n = t.parts[e];
|
|
2905
|
-
if (C(n) &&
|
|
2916
|
+
if (C(n) && Gi(n) && n.text) return n.text;
|
|
2906
2917
|
}
|
|
2907
2918
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2908
2919
|
let n = t.parts[e];
|
|
@@ -2926,7 +2937,7 @@ function wa(e, t) {
|
|
|
2926
2937
|
}
|
|
2927
2938
|
//#endregion
|
|
2928
2939
|
//#region src/lib/chat/trajectory/trajectories/timeline-dot.tsx
|
|
2929
|
-
function
|
|
2940
|
+
function Ea(e) {
|
|
2930
2941
|
let t = O(5), { isLast: n } = e, r = n !== void 0 && n, i;
|
|
2931
2942
|
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];
|
|
2932
2943
|
let a;
|
|
@@ -2939,7 +2950,7 @@ function Ta(e) {
|
|
|
2939
2950
|
}
|
|
2940
2951
|
//#endregion
|
|
2941
2952
|
//#region src/lib/chat/trajectory/trajectories/timeline-item.tsx
|
|
2942
|
-
function
|
|
2953
|
+
function Da(e) {
|
|
2943
2954
|
let t = O(6), { marker: n, children: r, className: i } = e, a;
|
|
2944
2955
|
t[0] === i ? a = t[1] : (a = k("relative z-0 flex gap-3 pl-5", i), t[0] = i, t[1] = a);
|
|
2945
2956
|
let o;
|
|
@@ -2950,15 +2961,15 @@ function Ea(e) {
|
|
|
2950
2961
|
}
|
|
2951
2962
|
//#endregion
|
|
2952
2963
|
//#region src/lib/chat/trajectory/trajectories/trajectory-thinking.tsx
|
|
2953
|
-
function
|
|
2954
|
-
let e = O(6), t = G(), { messages: n } = W(), r =
|
|
2955
|
-
e[0] !== t || e[1] !== i ? (a =
|
|
2964
|
+
function Oa() {
|
|
2965
|
+
let e = O(6), t = G(), { messages: n } = W(), r = Sa(), i = n[n.length - 1], a;
|
|
2966
|
+
e[0] !== t || e[1] !== i ? (a = Ta(t, i), e[0] = t, e[1] = i, e[2] = a) : a = e[2];
|
|
2956
2967
|
let o = a;
|
|
2957
2968
|
if (!o || r) return null;
|
|
2958
2969
|
let s;
|
|
2959
|
-
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(
|
|
2970
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(Ea, { isLast: !0 }), e[3] = s) : s = e[3];
|
|
2960
2971
|
let c;
|
|
2961
|
-
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(
|
|
2972
|
+
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(Da, {
|
|
2962
2973
|
className: "mt-2",
|
|
2963
2974
|
marker: s,
|
|
2964
2975
|
children: /* @__PURE__ */ M("span", {
|
|
@@ -2979,7 +2990,7 @@ var $ = [
|
|
|
2979
2990
|
"reasoningTokens",
|
|
2980
2991
|
"cachedInputTokens",
|
|
2981
2992
|
"totalTokens"
|
|
2982
|
-
],
|
|
2993
|
+
], ka = {
|
|
2983
2994
|
inputTokens: [["inputTokens"], ["raw", "prompt_tokens"]],
|
|
2984
2995
|
outputTokens: [["outputTokens"], ["raw", "completion_tokens"]],
|
|
2985
2996
|
reasoningTokens: [
|
|
@@ -3003,7 +3014,7 @@ var $ = [
|
|
|
3003
3014
|
],
|
|
3004
3015
|
totalTokens: [["totalTokens"], ["raw", "total_tokens"]]
|
|
3005
3016
|
};
|
|
3006
|
-
function
|
|
3017
|
+
function Aa(e) {
|
|
3007
3018
|
if (typeof e == "number" && Number.isFinite(e) && e >= 0) return e;
|
|
3008
3019
|
if (typeof e == "string" && e.trim().length > 0) {
|
|
3009
3020
|
let t = Number(e);
|
|
@@ -3011,7 +3022,7 @@ function ka(e) {
|
|
|
3011
3022
|
}
|
|
3012
3023
|
return null;
|
|
3013
3024
|
}
|
|
3014
|
-
function
|
|
3025
|
+
function ja(e) {
|
|
3015
3026
|
if (!e || typeof e != "object") return null;
|
|
3016
3027
|
let t = {
|
|
3017
3028
|
inputTokens: null,
|
|
@@ -3020,8 +3031,8 @@ function Aa(e) {
|
|
|
3020
3031
|
cachedInputTokens: null,
|
|
3021
3032
|
totalTokens: null
|
|
3022
3033
|
};
|
|
3023
|
-
for (let n of $) for (let r of
|
|
3024
|
-
let i =
|
|
3034
|
+
for (let n of $) for (let r of ka[n]) {
|
|
3035
|
+
let i = Aa(Dt(e, r));
|
|
3025
3036
|
if (i !== null) {
|
|
3026
3037
|
t[n] = i;
|
|
3027
3038
|
break;
|
|
@@ -3029,10 +3040,10 @@ function Aa(e) {
|
|
|
3029
3040
|
}
|
|
3030
3041
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
3031
3042
|
}
|
|
3032
|
-
function
|
|
3033
|
-
return D(e) ?
|
|
3043
|
+
function Ma(e) {
|
|
3044
|
+
return D(e) ? ja(e.totalUsage ?? e.usage) : null;
|
|
3034
3045
|
}
|
|
3035
|
-
function
|
|
3046
|
+
function Na(e, t) {
|
|
3036
3047
|
let n = {
|
|
3037
3048
|
inputTokens: null,
|
|
3038
3049
|
outputTokens: null,
|
|
@@ -3054,7 +3065,7 @@ function Ma(e, t) {
|
|
|
3054
3065
|
}
|
|
3055
3066
|
return $.some((e) => n[e] !== null) ? n : null;
|
|
3056
3067
|
}
|
|
3057
|
-
function
|
|
3068
|
+
function Pa(e) {
|
|
3058
3069
|
if (e.length === 0) return null;
|
|
3059
3070
|
let t = {
|
|
3060
3071
|
inputTokens: null,
|
|
@@ -3073,32 +3084,32 @@ function Na(e) {
|
|
|
3073
3084
|
}
|
|
3074
3085
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
3075
3086
|
}
|
|
3076
|
-
function
|
|
3087
|
+
function Fa(e) {
|
|
3077
3088
|
let t = {}, n = [], r = null, i = null;
|
|
3078
3089
|
for (let a of e) {
|
|
3079
3090
|
if (a.role !== "assistant") continue;
|
|
3080
|
-
let e = D(a.metadata) ? a.metadata : void 0, o =
|
|
3091
|
+
let e = D(a.metadata) ? a.metadata : void 0, o = ja(e?.usage), s = ja(e?.totalUsage), c = o ?? (s ? Na(s, r) : null);
|
|
3081
3092
|
c && (t[a.id] = c, n.push(c)), s && (i = s, r = s);
|
|
3082
3093
|
}
|
|
3083
3094
|
return {
|
|
3084
3095
|
assistantUsageByMessageId: t,
|
|
3085
|
-
chatUsageSummary: i ??
|
|
3096
|
+
chatUsageSummary: i ?? Pa(n)
|
|
3086
3097
|
};
|
|
3087
3098
|
}
|
|
3088
|
-
function
|
|
3089
|
-
let e = O(2), t =
|
|
3090
|
-
return e[0] === t.messages ? n = e[1] : (n =
|
|
3099
|
+
function Ia() {
|
|
3100
|
+
let e = O(2), t = V(), n;
|
|
3101
|
+
return e[0] === t.messages ? n = e[1] : (n = Fa(t.messages), e[0] = t.messages, e[1] = n), n;
|
|
3091
3102
|
}
|
|
3092
|
-
function
|
|
3103
|
+
function La(e) {
|
|
3093
3104
|
return kt(e);
|
|
3094
3105
|
}
|
|
3095
|
-
function
|
|
3106
|
+
function Ra(e) {
|
|
3096
3107
|
let t = [`↑ ${Ot(e.inputTokens)}`, `↓ ${Ot(e.outputTokens)}`];
|
|
3097
3108
|
return e.totalTokens !== null && t.push(`· ${kt(e.totalTokens)} tokens`), e.cachedInputTokens !== null && e.cachedInputTokens > 0 && t.push(`(${Ot(e.cachedInputTokens)} cached)`), t.join(" ");
|
|
3098
3109
|
}
|
|
3099
3110
|
//#endregion
|
|
3100
3111
|
//#region src/lib/chat/zukhruf-chat-transport.ts
|
|
3101
|
-
var
|
|
3112
|
+
var za = "x-upload-filename", Ba = P.strictObject({
|
|
3102
3113
|
path: P.string().startsWith("/"),
|
|
3103
3114
|
name: P.string().min(1),
|
|
3104
3115
|
mediaType: P.enum([
|
|
@@ -3116,19 +3127,19 @@ var Ra = "x-upload-filename", za = P.strictObject({
|
|
|
3116
3127
|
]),
|
|
3117
3128
|
size: P.int().nonnegative(),
|
|
3118
3129
|
url: P.url()
|
|
3119
|
-
}),
|
|
3130
|
+
}), Va = class extends _ {
|
|
3120
3131
|
sessionsApi;
|
|
3121
3132
|
request;
|
|
3122
3133
|
constructor({ api: e, fetch: t = (e, t) => globalThis.fetch(e, t), tools: n = {}, elements: r = [] }) {
|
|
3123
|
-
let i =
|
|
3134
|
+
let i = Ga(e), a = r.map(se);
|
|
3124
3135
|
super({
|
|
3125
3136
|
api: i,
|
|
3126
3137
|
fetch: async (e, n) => {
|
|
3127
3138
|
let r = await t(e, n);
|
|
3128
3139
|
if ((n?.method ?? "GET").toUpperCase() !== "POST" || !r.ok) return r;
|
|
3129
3140
|
let i = await r.json();
|
|
3130
|
-
if (!
|
|
3131
|
-
let a =
|
|
3141
|
+
if (!Ka(i)) throw Error("Zukhruf returned an invalid accepted-turn response");
|
|
3142
|
+
let a = Ga(String(e)), o = decodeURIComponent(a.slice(a.lastIndexOf("/") + 1));
|
|
3132
3143
|
if (i.sessionId !== o) throw Error("Zukhruf returned a different session ID");
|
|
3133
3144
|
let s = n?.signal;
|
|
3134
3145
|
return s?.addEventListener("abort", () => {
|
|
@@ -3143,7 +3154,7 @@ var Ra = "x-upload-filename", za = P.strictObject({
|
|
|
3143
3154
|
let o = t[t.length - 1];
|
|
3144
3155
|
if (!o) throw Error("A message is required");
|
|
3145
3156
|
return {
|
|
3146
|
-
api:
|
|
3157
|
+
api: Ha(i, e),
|
|
3147
3158
|
body: {
|
|
3148
3159
|
sessionId: e,
|
|
3149
3160
|
message: o,
|
|
@@ -3154,50 +3165,50 @@ var Ra = "x-upload-filename", za = P.strictObject({
|
|
|
3154
3165
|
};
|
|
3155
3166
|
},
|
|
3156
3167
|
prepareReconnectToStreamRequest: ({ headers: e, id: t }) => ({
|
|
3157
|
-
api: `${
|
|
3168
|
+
api: `${Ha(i, t)}/stream`,
|
|
3158
3169
|
headers: e
|
|
3159
3170
|
})
|
|
3160
3171
|
}), this.sessionsApi = i, this.request = t;
|
|
3161
3172
|
}
|
|
3162
3173
|
async uploadFile(e, t) {
|
|
3163
|
-
let n = await this.request(`${
|
|
3174
|
+
let n = await this.request(`${Ha(this.sessionsApi, e)}/uploads`, {
|
|
3164
3175
|
method: "POST",
|
|
3165
3176
|
headers: {
|
|
3166
3177
|
"content-type": t.type,
|
|
3167
|
-
[
|
|
3178
|
+
[za]: encodeURIComponent(t.name)
|
|
3168
3179
|
},
|
|
3169
3180
|
body: t
|
|
3170
3181
|
});
|
|
3171
|
-
if (!n.ok) throw Error(await
|
|
3172
|
-
let r =
|
|
3182
|
+
if (!n.ok) throw Error(await Ua(n, t));
|
|
3183
|
+
let r = Ba.safeParse(await n.json());
|
|
3173
3184
|
if (!r.success) throw Error("Zukhruf returned an invalid upload response");
|
|
3174
3185
|
return r.data;
|
|
3175
3186
|
}
|
|
3176
3187
|
};
|
|
3177
|
-
function
|
|
3188
|
+
function Ha(e, t) {
|
|
3178
3189
|
return `${e}/${encodeURIComponent(t)}`;
|
|
3179
3190
|
}
|
|
3180
|
-
async function
|
|
3181
|
-
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r =
|
|
3191
|
+
async function Ua(e, t) {
|
|
3192
|
+
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r = Wa(await e.json().catch((e) => {
|
|
3182
3193
|
if (e instanceof SyntaxError) return null;
|
|
3183
3194
|
throw e;
|
|
3184
3195
|
}));
|
|
3185
3196
|
return r ? `${n}: ${r}` : n;
|
|
3186
3197
|
}
|
|
3187
|
-
function
|
|
3198
|
+
function Wa(e) {
|
|
3188
3199
|
if (typeof e != "object" || !e) return null;
|
|
3189
3200
|
let t = "cause" in e && typeof e.cause == "object" && e.cause !== null ? e.cause : null;
|
|
3190
3201
|
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;
|
|
3191
3202
|
}
|
|
3192
|
-
function
|
|
3203
|
+
function Ga(e) {
|
|
3193
3204
|
return e.replace(/\/$/, "");
|
|
3194
3205
|
}
|
|
3195
|
-
function
|
|
3206
|
+
function Ka(e) {
|
|
3196
3207
|
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";
|
|
3197
3208
|
}
|
|
3198
3209
|
//#endregion
|
|
3199
3210
|
//#region src/lib/chat/trajectory/trajectories/collapsible-disclosure.tsx
|
|
3200
|
-
function
|
|
3211
|
+
function qa(e) {
|
|
3201
3212
|
let t = O(24), { label: n, open: r, onOpenChange: i, children: a, className: o, triggerClassName: s, contentClassName: c, chevronClassName: l } = e, u;
|
|
3202
3213
|
t[0] === s ? u = t[1] : (u = k("flex items-center font-mono", s), t[0] = s, t[1] = u);
|
|
3203
3214
|
let d;
|
|
@@ -3231,19 +3242,19 @@ function Ka(e) {
|
|
|
3231
3242
|
}
|
|
3232
3243
|
//#endregion
|
|
3233
3244
|
//#region src/lib/chat/trajectory/trajectories/user-message.tsx
|
|
3234
|
-
function
|
|
3245
|
+
function Ja(e) {
|
|
3235
3246
|
let t = O(7), { metadata: n } = e;
|
|
3236
3247
|
if (!n) return null;
|
|
3237
3248
|
let r, i, a;
|
|
3238
3249
|
if (t[0] !== n) {
|
|
3239
3250
|
a = Symbol.for("react.early_return_sentinel");
|
|
3240
3251
|
bb0: {
|
|
3241
|
-
let e =
|
|
3252
|
+
let e = Ma(n);
|
|
3242
3253
|
if (!e) {
|
|
3243
3254
|
a = null;
|
|
3244
3255
|
break bb0;
|
|
3245
3256
|
}
|
|
3246
|
-
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i =
|
|
3257
|
+
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i = Ra(e);
|
|
3247
3258
|
}
|
|
3248
3259
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a;
|
|
3249
3260
|
} else r = t[1], i = t[2], a = t[3];
|
|
@@ -3254,27 +3265,27 @@ function qa(e) {
|
|
|
3254
3265
|
children: i
|
|
3255
3266
|
}), t[4] = r, t[5] = i, t[6] = o) : o = t[6], o;
|
|
3256
3267
|
}
|
|
3257
|
-
function
|
|
3268
|
+
function Ya(e, t) {
|
|
3258
3269
|
return D(e.metadata) ? e.metadata[t] : void 0;
|
|
3259
3270
|
}
|
|
3260
|
-
function
|
|
3261
|
-
let t =
|
|
3271
|
+
function Xa(e) {
|
|
3272
|
+
let t = Ya(e, "reminders");
|
|
3262
3273
|
return Array.isArray(t) ? t.filter((e) => {
|
|
3263
3274
|
if (!e || typeof e != "object") return !1;
|
|
3264
3275
|
let t = e;
|
|
3265
3276
|
return typeof t.id == "string" && t.id.length > 0 && typeof t.text == "string" && t.text.trim().length > 0;
|
|
3266
3277
|
}) : [];
|
|
3267
3278
|
}
|
|
3268
|
-
function
|
|
3269
|
-
let t =
|
|
3279
|
+
function Za(e) {
|
|
3280
|
+
let t = Ya(e, "uploads");
|
|
3270
3281
|
return Array.isArray(t) ? t.flatMap((e) => {
|
|
3271
|
-
let t =
|
|
3282
|
+
let t = Ba.safeParse(e);
|
|
3272
3283
|
return t.success ? [t.data] : [];
|
|
3273
3284
|
}) : [];
|
|
3274
3285
|
}
|
|
3275
|
-
function
|
|
3286
|
+
function Qa(e) {
|
|
3276
3287
|
let t = O(7), { text: n } = e, [r, i] = g(!1), a;
|
|
3277
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i(
|
|
3288
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i($a), t[0] = a) : a = t[0];
|
|
3278
3289
|
let o = !r && "line-clamp-3", s;
|
|
3279
3290
|
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);
|
|
3280
3291
|
let c;
|
|
@@ -3286,21 +3297,21 @@ function Za(e) {
|
|
|
3286
3297
|
children: n
|
|
3287
3298
|
}) }), t[3] = r, t[4] = s, t[5] = n, t[6] = c) : c = t[6], c;
|
|
3288
3299
|
}
|
|
3289
|
-
function
|
|
3300
|
+
function $a(e) {
|
|
3290
3301
|
return !e;
|
|
3291
3302
|
}
|
|
3292
|
-
function
|
|
3303
|
+
function eo(e) {
|
|
3293
3304
|
let t = O(8), { reminders: n } = e, [r, i] = g(!1);
|
|
3294
3305
|
if (n.length === 0) return null;
|
|
3295
3306
|
let a = `${n.length} reminder${n.length === 1 ? "" : "s"} attached`, o;
|
|
3296
|
-
t[0] === n ? o = t[1] : (o = n.map(
|
|
3307
|
+
t[0] === n ? o = t[1] : (o = n.map(to), t[0] = n, t[1] = o);
|
|
3297
3308
|
let s;
|
|
3298
3309
|
t[2] === o ? s = t[3] : (s = /* @__PURE__ */ M("ul", {
|
|
3299
3310
|
className: "border-ink-12 text-muted-foreground space-y-1 border-l pl-3 text-xs",
|
|
3300
3311
|
children: o
|
|
3301
3312
|
}), t[2] = o, t[3] = s);
|
|
3302
3313
|
let c;
|
|
3303
|
-
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(
|
|
3314
|
+
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(qa, {
|
|
3304
3315
|
label: a,
|
|
3305
3316
|
open: r,
|
|
3306
3317
|
onOpenChange: i,
|
|
@@ -3311,10 +3322,10 @@ function $a(e) {
|
|
|
3311
3322
|
children: s
|
|
3312
3323
|
}), t[4] = a, t[5] = r, t[6] = s, t[7] = c) : c = t[7], c;
|
|
3313
3324
|
}
|
|
3314
|
-
function eo(e) {
|
|
3315
|
-
return /* @__PURE__ */ M(Za, { text: e.text }, e.id);
|
|
3316
|
-
}
|
|
3317
3325
|
function to(e) {
|
|
3326
|
+
return /* @__PURE__ */ M(Qa, { text: e.text }, e.id);
|
|
3327
|
+
}
|
|
3328
|
+
function no(e) {
|
|
3318
3329
|
let t = O(19), { upload: n } = e;
|
|
3319
3330
|
if (n.mediaType.startsWith("video/")) {
|
|
3320
3331
|
let e;
|
|
@@ -3380,17 +3391,17 @@ function to(e) {
|
|
|
3380
3391
|
})
|
|
3381
3392
|
}), t[16] = n.name, t[17] = n.url, t[18] = r) : r = t[18], r;
|
|
3382
3393
|
}
|
|
3383
|
-
function
|
|
3394
|
+
function ro(e) {
|
|
3384
3395
|
let t = O(13), { message: n } = e, r, i, a, o, s, c;
|
|
3385
3396
|
if (t[0] !== n) {
|
|
3386
3397
|
c = Symbol.for("react.early_return_sentinel");
|
|
3387
3398
|
bb0: {
|
|
3388
|
-
let e =
|
|
3399
|
+
let e = Za(n);
|
|
3389
3400
|
if (e.length === 0) {
|
|
3390
3401
|
c = null;
|
|
3391
3402
|
break bb0;
|
|
3392
3403
|
}
|
|
3393
|
-
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(
|
|
3404
|
+
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(io);
|
|
3394
3405
|
}
|
|
3395
3406
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a, t[4] = o, t[5] = s, t[6] = c;
|
|
3396
3407
|
} else r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], c = t[6];
|
|
@@ -3403,23 +3414,23 @@ function no(e) {
|
|
|
3403
3414
|
children: s
|
|
3404
3415
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o, t[11] = s, t[12] = l) : l = t[12], l;
|
|
3405
3416
|
}
|
|
3406
|
-
function
|
|
3417
|
+
function io(e) {
|
|
3407
3418
|
return /* @__PURE__ */ M("div", {
|
|
3408
3419
|
role: "listitem",
|
|
3409
3420
|
"data-slot": "attachment",
|
|
3410
|
-
children: /* @__PURE__ */ M(
|
|
3421
|
+
children: /* @__PURE__ */ M(no, { upload: e })
|
|
3411
3422
|
}, e.path);
|
|
3412
3423
|
}
|
|
3413
|
-
function
|
|
3424
|
+
function ao(e) {
|
|
3414
3425
|
let t = O(10), { body: n, reminders: r, metadata: i } = e, a;
|
|
3415
3426
|
t[0] === n ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
3416
3427
|
className: "flex-1 space-y-3",
|
|
3417
3428
|
children: n
|
|
3418
3429
|
}), t[0] = n, t[1] = a);
|
|
3419
3430
|
let o;
|
|
3420
|
-
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(
|
|
3431
|
+
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(eo, { reminders: r }), t[2] = r, t[3] = o);
|
|
3421
3432
|
let s;
|
|
3422
|
-
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(
|
|
3433
|
+
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(Ja, { metadata: i }), t[4] = i, t[5] = s);
|
|
3423
3434
|
let c;
|
|
3424
3435
|
return t[6] !== a || t[7] !== o || t[8] !== s ? (c = /* @__PURE__ */ N("div", {
|
|
3425
3436
|
className: "bg-secondary flex max-w-[80%] flex-col gap-3 rounded-lg p-3",
|
|
@@ -3430,13 +3441,13 @@ function io(e) {
|
|
|
3430
3441
|
]
|
|
3431
3442
|
}), t[6] = a, t[7] = o, t[8] = s, t[9] = c) : c = t[9], c;
|
|
3432
3443
|
}
|
|
3433
|
-
function
|
|
3444
|
+
function oo(e) {
|
|
3434
3445
|
let t = O(28), { message: n } = e;
|
|
3435
|
-
|
|
3446
|
+
Ya(n, "reminders");
|
|
3436
3447
|
let r;
|
|
3437
3448
|
t[0] === n ? r = t[1] : (r = ee(n), t[0] = n, t[1] = r);
|
|
3438
3449
|
let i;
|
|
3439
|
-
t[2] === n ? i = t[3] : (i =
|
|
3450
|
+
t[2] === n ? i = t[3] : (i = Xa(n), t[2] = n, t[3] = i);
|
|
3440
3451
|
let a;
|
|
3441
3452
|
t[4] !== r || t[5] !== i ? (a = {
|
|
3442
3453
|
message: r,
|
|
@@ -3444,7 +3455,7 @@ function ao(e) {
|
|
|
3444
3455
|
}, t[4] = r, t[5] = i, t[6] = a) : a = t[6];
|
|
3445
3456
|
let { message: o, reminders: s } = a, c;
|
|
3446
3457
|
if (t[7] !== n) {
|
|
3447
|
-
let e =
|
|
3458
|
+
let e = Ya(n, "alias");
|
|
3448
3459
|
c = typeof e == "string" && e.trim().length > 0 ? e : void 0, t[7] = n, t[8] = c;
|
|
3449
3460
|
} else c = t[8];
|
|
3450
3461
|
let l = c;
|
|
@@ -3456,13 +3467,13 @@ function ao(e) {
|
|
|
3456
3467
|
children: l
|
|
3457
3468
|
}), t[9] = l, t[10] = e);
|
|
3458
3469
|
let n;
|
|
3459
|
-
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(
|
|
3470
|
+
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(ao, {
|
|
3460
3471
|
reminders: s,
|
|
3461
3472
|
body: e
|
|
3462
3473
|
}), t[11] = s, t[12] = e, t[13] = n) : n = t[13], n;
|
|
3463
3474
|
}
|
|
3464
3475
|
let u;
|
|
3465
|
-
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(
|
|
3476
|
+
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(ro, { message: o }), t[14] = o, t[15] = u);
|
|
3466
3477
|
let d = o.metadata, f;
|
|
3467
3478
|
if (t[16] !== o.id || t[17] !== o.parts) {
|
|
3468
3479
|
let e;
|
|
@@ -3473,7 +3484,7 @@ function ao(e) {
|
|
|
3473
3484
|
}, `${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;
|
|
3474
3485
|
} else f = t[18];
|
|
3475
3486
|
let p;
|
|
3476
|
-
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(
|
|
3487
|
+
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(ao, {
|
|
3477
3488
|
reminders: s,
|
|
3478
3489
|
metadata: d,
|
|
3479
3490
|
body: f
|
|
@@ -3484,11 +3495,11 @@ function ao(e) {
|
|
|
3484
3495
|
children: [u, p]
|
|
3485
3496
|
}), t[25] = u, t[26] = p, t[27] = m) : m = t[27], m;
|
|
3486
3497
|
}
|
|
3487
|
-
var
|
|
3498
|
+
var so = c(function(e) {
|
|
3488
3499
|
let t = O(7), { className: n } = e, { message: r } = K(), i;
|
|
3489
3500
|
t[0] === n ? i = t[1] : (i = k("flex justify-end", n), t[0] = n, t[1] = i);
|
|
3490
3501
|
let a;
|
|
3491
|
-
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(
|
|
3502
|
+
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(oo, { message: r }), t[2] = r, t[3] = a);
|
|
3492
3503
|
let o;
|
|
3493
3504
|
return t[4] !== i || t[5] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
3494
3505
|
className: i,
|
|
@@ -3497,20 +3508,20 @@ var oo = c(function(e) {
|
|
|
3497
3508
|
});
|
|
3498
3509
|
//#endregion
|
|
3499
3510
|
//#region src/lib/chat/trajectory/trajectories/compact-messages.tsx
|
|
3500
|
-
function
|
|
3501
|
-
return e.kind === "tool" ? !
|
|
3511
|
+
function co(e) {
|
|
3512
|
+
return e.kind === "tool" ? !hi(e.part) : e.kind === "dynamic-tool" || e.kind === "reasoning";
|
|
3502
3513
|
}
|
|
3503
|
-
function
|
|
3514
|
+
function lo(e, t) {
|
|
3504
3515
|
return e.kind === "tool" ? !0 : e.kind === "reasoning" || e.kind === "dynamic-tool" ? !!t : !1;
|
|
3505
3516
|
}
|
|
3506
|
-
function
|
|
3507
|
-
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !
|
|
3517
|
+
function uo(e) {
|
|
3518
|
+
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !Gi(e));
|
|
3508
3519
|
}
|
|
3509
|
-
function
|
|
3520
|
+
function fo(e, t) {
|
|
3510
3521
|
let n = [];
|
|
3511
3522
|
for (let r = 0; r < e.length; r++) {
|
|
3512
3523
|
let i = e[r];
|
|
3513
|
-
if (!
|
|
3524
|
+
if (!co(i)) {
|
|
3514
3525
|
n.push({
|
|
3515
3526
|
kind: "segment",
|
|
3516
3527
|
segment: i,
|
|
@@ -3519,25 +3530,25 @@ function uo(e, t) {
|
|
|
3519
3530
|
continue;
|
|
3520
3531
|
}
|
|
3521
3532
|
let a = [], o = r;
|
|
3522
|
-
for (; r < e.length &&
|
|
3533
|
+
for (; r < e.length && co(e[r]);) {
|
|
3523
3534
|
let n = e[r];
|
|
3524
|
-
|
|
3535
|
+
lo(n, t) && a.push({ segment: n }), r++;
|
|
3525
3536
|
}
|
|
3526
3537
|
r--, a.length > 0 && n.push({
|
|
3527
3538
|
kind: "group",
|
|
3528
3539
|
items: a,
|
|
3529
|
-
hasLaterText: e.slice(r + 1).some((e) =>
|
|
3540
|
+
hasLaterText: e.slice(r + 1).some((e) => uo(e)),
|
|
3530
3541
|
firstIndex: o
|
|
3531
3542
|
});
|
|
3532
3543
|
}
|
|
3533
3544
|
return n;
|
|
3534
3545
|
}
|
|
3535
|
-
function
|
|
3546
|
+
function po(e) {
|
|
3536
3547
|
if (e.kind !== "tool" && e.kind !== "dynamic-tool") return;
|
|
3537
3548
|
let { part: t } = e;
|
|
3538
3549
|
return w(t) ? t.state : void 0;
|
|
3539
3550
|
}
|
|
3540
|
-
function
|
|
3551
|
+
function mo({ groupStatus: e, labelCount: t }) {
|
|
3541
3552
|
return e === "running" ? {
|
|
3542
3553
|
title: "text-info",
|
|
3543
3554
|
detail: "text-info/80",
|
|
@@ -3560,20 +3571,20 @@ function po({ groupStatus: e, labelCount: t }) {
|
|
|
3560
3571
|
chevron: "text-muted-foreground"
|
|
3561
3572
|
};
|
|
3562
3573
|
}
|
|
3563
|
-
function
|
|
3574
|
+
function ho(e) {
|
|
3564
3575
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
3565
3576
|
}
|
|
3566
|
-
function
|
|
3577
|
+
function go(e, t = 80) {
|
|
3567
3578
|
let n = e.replace(/\s+/g, " ").trim();
|
|
3568
3579
|
return n.length <= t ? n : `${n.slice(0, t - 3).trimEnd()}...`;
|
|
3569
3580
|
}
|
|
3570
|
-
function
|
|
3571
|
-
if (typeof e == "string") return
|
|
3581
|
+
function _o(e) {
|
|
3582
|
+
if (typeof e == "string") return go(e, 48);
|
|
3572
3583
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
3573
3584
|
if (Array.isArray(e)) return `${e.length} items`;
|
|
3574
3585
|
}
|
|
3575
|
-
function
|
|
3576
|
-
if (!
|
|
3586
|
+
function vo(e) {
|
|
3587
|
+
if (!ho(e)) return;
|
|
3577
3588
|
let t = [
|
|
3578
3589
|
"command",
|
|
3579
3590
|
"query",
|
|
@@ -3585,13 +3596,13 @@ function _o(e) {
|
|
|
3585
3596
|
"checks"
|
|
3586
3597
|
], n = [...t.filter((t) => t in e).map((t) => [t, e[t]]), ...Object.entries(e).filter(([e]) => !t.includes(e))], r = {};
|
|
3587
3598
|
for (let [e, t] of n) {
|
|
3588
|
-
let n =
|
|
3599
|
+
let n = _o(t);
|
|
3589
3600
|
if (n && (r[e] = n, Object.keys(r).length >= 2)) break;
|
|
3590
3601
|
}
|
|
3591
3602
|
return Object.keys(r).length > 0 ? r : void 0;
|
|
3592
3603
|
}
|
|
3593
|
-
function
|
|
3594
|
-
if (
|
|
3604
|
+
function yo(e) {
|
|
3605
|
+
if (ho(e)) for (let t of [
|
|
3595
3606
|
"reasoning",
|
|
3596
3607
|
"thoughts",
|
|
3597
3608
|
"thought",
|
|
@@ -3599,36 +3610,36 @@ function vo(e) {
|
|
|
3599
3610
|
"detail"
|
|
3600
3611
|
]) {
|
|
3601
3612
|
let n = e[t];
|
|
3602
|
-
if (typeof n == "string" && n.trim().length > 0) return
|
|
3613
|
+
if (typeof n == "string" && n.trim().length > 0) return go(n);
|
|
3603
3614
|
}
|
|
3604
3615
|
}
|
|
3605
|
-
function
|
|
3616
|
+
function bo(e) {
|
|
3606
3617
|
if (e.kind !== "reasoning") return;
|
|
3607
3618
|
let { part: t } = e;
|
|
3608
|
-
if (t.type === "reasoning") return
|
|
3619
|
+
if (t.type === "reasoning") return go(t.text, 96);
|
|
3609
3620
|
}
|
|
3610
|
-
function
|
|
3621
|
+
function xo(e, t) {
|
|
3611
3622
|
if (e.kind === "reasoning") return {
|
|
3612
3623
|
kind: "reasoning",
|
|
3613
3624
|
name: "reasoning",
|
|
3614
|
-
detail:
|
|
3625
|
+
detail: bo(e)
|
|
3615
3626
|
};
|
|
3616
3627
|
if (e.kind === "dynamic-tool" && e.part.type === "dynamic-tool") {
|
|
3617
3628
|
let t = e.part;
|
|
3618
3629
|
return {
|
|
3619
3630
|
kind: "dynamic-tool",
|
|
3620
3631
|
name: t.toolName || "Tool",
|
|
3621
|
-
args:
|
|
3622
|
-
detail:
|
|
3632
|
+
args: vo(t.input),
|
|
3633
|
+
detail: yo(t.input)
|
|
3623
3634
|
};
|
|
3624
3635
|
}
|
|
3625
3636
|
if (e.kind === "tool" && S(e.part)) {
|
|
3626
|
-
let n = e.part, { toolEntry: r, toolKey: i } =
|
|
3637
|
+
let n = e.part, { toolEntry: r, toolKey: i } = _i(n, t), a = r?.label?.(n);
|
|
3627
3638
|
return {
|
|
3628
3639
|
kind: "tool",
|
|
3629
3640
|
name: a?.name ?? i,
|
|
3630
|
-
args: a?.args ??
|
|
3631
|
-
detail: a?.detail ??
|
|
3641
|
+
args: a?.args ?? vo(n.input),
|
|
3642
|
+
detail: a?.detail ?? yo(n.input),
|
|
3632
3643
|
isError: a?.isError
|
|
3633
3644
|
};
|
|
3634
3645
|
}
|
|
@@ -3637,54 +3648,54 @@ function bo(e, t) {
|
|
|
3637
3648
|
name: "Step"
|
|
3638
3649
|
};
|
|
3639
3650
|
}
|
|
3640
|
-
function
|
|
3651
|
+
function So(e) {
|
|
3641
3652
|
if (!e) return;
|
|
3642
3653
|
let t = Object.entries(e).filter((e) => typeof e[1] == "string" && e[1].trim().length > 0);
|
|
3643
|
-
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${
|
|
3654
|
+
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${go(t, 36)}`).join(", ");
|
|
3644
3655
|
}
|
|
3645
|
-
function
|
|
3646
|
-
let t =
|
|
3656
|
+
function Co(e) {
|
|
3657
|
+
let t = So(e.args);
|
|
3647
3658
|
return t ? `${e.name}(${t})` : e.name;
|
|
3648
3659
|
}
|
|
3649
|
-
function
|
|
3660
|
+
function wo(e) {
|
|
3650
3661
|
return e === "output-available" || e === "output-error" || e === "output-denied";
|
|
3651
3662
|
}
|
|
3652
|
-
function
|
|
3653
|
-
return !!e && !
|
|
3663
|
+
function To(e) {
|
|
3664
|
+
return !!e && !wo(e);
|
|
3654
3665
|
}
|
|
3655
|
-
function
|
|
3656
|
-
return
|
|
3666
|
+
function Eo(e, t) {
|
|
3667
|
+
return an(e, t);
|
|
3657
3668
|
}
|
|
3658
|
-
function
|
|
3659
|
-
return e.some(({ segment: e }) =>
|
|
3660
|
-
let t =
|
|
3669
|
+
function Do({ items: e, labels: t, status: n, hasLaterText: r }) {
|
|
3670
|
+
return e.some(({ segment: e }) => Eo(po(e), n)) ? "aborted" : !r && (n === "streaming" || n === "submitted") ? "running" : t.some((e) => e.isError) || e.some(({ segment: e }) => {
|
|
3671
|
+
let t = po(e);
|
|
3661
3672
|
return t === "output-error" || t === "output-denied";
|
|
3662
|
-
}) ? "error" : e.some(({ segment: e }) =>
|
|
3673
|
+
}) ? "error" : e.some(({ segment: e }) => To(po(e))) || !r && t.every((e) => e.kind === "reasoning") && (n === "streaming" || n === "submitted") ? "running" : "complete";
|
|
3663
3674
|
}
|
|
3664
|
-
function
|
|
3675
|
+
function Oo(e) {
|
|
3665
3676
|
return e && `${e[0].toUpperCase()}${e.slice(1)}`;
|
|
3666
3677
|
}
|
|
3667
|
-
function
|
|
3678
|
+
function ko(e) {
|
|
3668
3679
|
return e.filter((e) => e.kind !== "reasoning").length;
|
|
3669
3680
|
}
|
|
3670
|
-
function
|
|
3671
|
-
let n =
|
|
3681
|
+
function Ao(e, t) {
|
|
3682
|
+
let n = ko(e);
|
|
3672
3683
|
if (n !== 0) return `${t === "running" || t === "aborted" ? "running" : "ran"} ${n} ${n === 1 ? "tool" : "tools"}`;
|
|
3673
3684
|
}
|
|
3674
|
-
function
|
|
3675
|
-
let n =
|
|
3676
|
-
if (n) return
|
|
3685
|
+
function jo(e, t) {
|
|
3686
|
+
let n = Ao(e, t);
|
|
3687
|
+
if (n) return Oo(t === "error" ? `${n} with issues` : t === "aborted" ? `cancelled after ${n}` : n);
|
|
3677
3688
|
}
|
|
3678
|
-
function
|
|
3689
|
+
function Mo(e, t, n) {
|
|
3679
3690
|
let r = e.length === 1 ? e[0] : void 0;
|
|
3680
3691
|
if (t === "running") return n || (r?.kind === "reasoning" ? `Reasoning${r.detail ? ` ${r.detail}` : ""}` : e.every((e) => e.kind === "reasoning") ? "Reasoning" : "Working...");
|
|
3681
3692
|
if (r) {
|
|
3682
|
-
let e =
|
|
3693
|
+
let e = Co(r);
|
|
3683
3694
|
return t === "error" ? `Failed ${e}` : t === "aborted" ? `Cancelled ${e}` : r.kind === "reasoning" ? `Reasoned${r.detail ? ` ${r.detail}` : ""}` : `Called ${e}`;
|
|
3684
3695
|
}
|
|
3685
|
-
return e.every((e) => e.kind === "reasoning") ? "Reasoned" :
|
|
3696
|
+
return e.every((e) => e.kind === "reasoning") ? "Reasoned" : jo(e, t) ?? "Ran tools";
|
|
3686
3697
|
}
|
|
3687
|
-
function
|
|
3698
|
+
function No(e, t) {
|
|
3688
3699
|
if (t !== "running") {
|
|
3689
3700
|
if (e.length === 1) {
|
|
3690
3701
|
let t = e[0];
|
|
@@ -3693,28 +3704,28 @@ function Mo(e, t) {
|
|
|
3693
3704
|
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;
|
|
3694
3705
|
}
|
|
3695
3706
|
}
|
|
3696
|
-
function
|
|
3707
|
+
function Po(e) {
|
|
3697
3708
|
let t;
|
|
3698
3709
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
3699
3710
|
let r = e[n].segment;
|
|
3700
3711
|
if (r.kind === "dynamic-tool" && r.part.type === "dynamic-tool") {
|
|
3701
|
-
let e =
|
|
3712
|
+
let e = yo(r.part.input);
|
|
3702
3713
|
if (e) return e;
|
|
3703
3714
|
}
|
|
3704
3715
|
if (r.kind === "tool" && S(r.part)) {
|
|
3705
|
-
let e =
|
|
3716
|
+
let e = yo(r.part.input);
|
|
3706
3717
|
if (e) return e;
|
|
3707
3718
|
}
|
|
3708
|
-
r.kind === "reasoning" && (t ??=
|
|
3719
|
+
r.kind === "reasoning" && (t ??= bo(r));
|
|
3709
3720
|
}
|
|
3710
3721
|
return t;
|
|
3711
3722
|
}
|
|
3712
|
-
function
|
|
3713
|
-
return !e || e.role !== "assistant" ? !1 :
|
|
3723
|
+
function Fo(e, t) {
|
|
3724
|
+
return !e || e.role !== "assistant" ? !1 : fo(oa(e.parts), t).some((e) => e.kind === "group" && !e.hasLaterText);
|
|
3714
3725
|
}
|
|
3715
|
-
function
|
|
3726
|
+
function Io() {
|
|
3716
3727
|
let e = O(8), { message: t } = K(), { debugMode: n } = z(), r;
|
|
3717
|
-
e[0] === t.parts ? r = e[1] : (r =
|
|
3728
|
+
e[0] === t.parts ? r = e[1] : (r = oa(t.parts), e[0] = t.parts, e[1] = r);
|
|
3718
3729
|
let i = r, a;
|
|
3719
3730
|
if (e[2] !== n || e[3] !== t.id || e[4] !== i) {
|
|
3720
3731
|
let r;
|
|
@@ -3724,29 +3735,29 @@ function Fo() {
|
|
|
3724
3735
|
} : {
|
|
3725
3736
|
...e,
|
|
3726
3737
|
key: `${t.id}-${Z(e.segment, e.segmentIndex)}-${e.segment.kind}`
|
|
3727
|
-
}, e[6] = t.id, e[7] = r), a =
|
|
3738
|
+
}, e[6] = t.id, e[7] = r), a = fo(i, n).map(r), e[2] = n, e[3] = t.id, e[4] = i, e[5] = a;
|
|
3728
3739
|
} else a = e[5];
|
|
3729
3740
|
return a;
|
|
3730
3741
|
}
|
|
3731
|
-
var
|
|
3732
|
-
function
|
|
3733
|
-
let e = l(
|
|
3742
|
+
var Lo = o(null);
|
|
3743
|
+
function Ro() {
|
|
3744
|
+
let e = l(Lo);
|
|
3734
3745
|
if (!e) throw Error("CompactTrajectory group parts must be rendered within CompactTrajectory.Group");
|
|
3735
3746
|
return e;
|
|
3736
3747
|
}
|
|
3737
|
-
function
|
|
3748
|
+
function zo(e) {
|
|
3738
3749
|
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;
|
|
3739
3750
|
if (t[0] !== n.hasLaterText || t[1] !== n.items || t[2] !== i || t[3] !== o) {
|
|
3740
3751
|
let e;
|
|
3741
3752
|
t[7] === i ? e = t[8] : (e = (e) => {
|
|
3742
3753
|
let { segment: t } = e;
|
|
3743
|
-
return
|
|
3744
|
-
}, t[7] = i, t[8] = e), u = n.items.map(e), l =
|
|
3754
|
+
return xo(t, i);
|
|
3755
|
+
}, t[7] = i, t[8] = e), u = n.items.map(e), l = Do({
|
|
3745
3756
|
items: n.items,
|
|
3746
3757
|
labels: u,
|
|
3747
3758
|
status: o,
|
|
3748
3759
|
hasLaterText: n.hasLaterText
|
|
3749
|
-
}), d =
|
|
3760
|
+
}), d = mo({
|
|
3750
3761
|
groupStatus: l,
|
|
3751
3762
|
labelCount: u.length
|
|
3752
3763
|
}), t[0] = n.hasLaterText, t[1] = n.items, t[2] = i, t[3] = o, t[4] = l, t[5] = u, t[6] = d;
|
|
@@ -3767,16 +3778,16 @@ function Ro(e) {
|
|
|
3767
3778
|
children: r
|
|
3768
3779
|
}), t[15] = r, t[16] = s, t[17] = m) : m = t[17];
|
|
3769
3780
|
let h;
|
|
3770
|
-
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(
|
|
3781
|
+
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(Lo, {
|
|
3771
3782
|
value: p,
|
|
3772
3783
|
children: m
|
|
3773
3784
|
}), t[18] = p, t[19] = m, t[20] = h) : h = t[20], h;
|
|
3774
3785
|
}
|
|
3775
|
-
function
|
|
3786
|
+
function Bo(e) {
|
|
3776
3787
|
let t = O(3), { children: n } = e, r;
|
|
3777
3788
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M("button", {
|
|
3778
3789
|
type: "button",
|
|
3779
|
-
className:
|
|
3790
|
+
className: un("items-start")
|
|
3780
3791
|
}), t[0] = r) : r = t[0];
|
|
3781
3792
|
let i;
|
|
3782
3793
|
return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ M(L, {
|
|
@@ -3787,11 +3798,11 @@ function zo(e) {
|
|
|
3787
3798
|
})
|
|
3788
3799
|
}), t[1] = n, t[2] = i), i;
|
|
3789
3800
|
}
|
|
3790
|
-
function
|
|
3791
|
-
let e = O(12), { items: t, labels: n, groupStatus: r, tone: i } =
|
|
3792
|
-
e[0] !== r || e[1] !== t || e[2] !== n ? (a =
|
|
3801
|
+
function Vo() {
|
|
3802
|
+
let e = O(12), { items: t, labels: n, groupStatus: r, tone: i } = Ro(), a;
|
|
3803
|
+
e[0] !== r || e[1] !== t || e[2] !== n ? (a = Mo(n, r, Po(t)), e[0] = r, e[1] = t, e[2] = n, e[3] = a) : a = e[3];
|
|
3793
3804
|
let o = a, s;
|
|
3794
|
-
e[4] !== r || e[5] !== n ? (s =
|
|
3805
|
+
e[4] !== r || e[5] !== n ? (s = No(n, r), e[4] = r, e[5] = n, e[6] = s) : s = e[6];
|
|
3795
3806
|
let c = s, l;
|
|
3796
3807
|
return e[7] !== c || e[8] !== r || e[9] !== o || e[10] !== i ? (l = {
|
|
3797
3808
|
title: o,
|
|
@@ -3800,8 +3811,8 @@ function Bo() {
|
|
|
3800
3811
|
groupStatus: r
|
|
3801
3812
|
}, e[7] = c, e[8] = r, e[9] = o, e[10] = i, e[11] = l) : l = e[11], l;
|
|
3802
3813
|
}
|
|
3803
|
-
function
|
|
3804
|
-
let t = O(9), { title: n, suffix: r, children: i } = e, { title: a, tone: o, groupStatus: s } =
|
|
3814
|
+
function Ho(e) {
|
|
3815
|
+
let t = O(9), { title: n, suffix: r, children: i } = e, { title: a, tone: o, groupStatus: s } = Vo(), c = n ?? a, l = r ? `${c} · ${r}` : c, u = s === "running", d = s === "running" ? "text-info" : o.title, f;
|
|
3805
3816
|
t[0] === d ? f = t[1] : (f = k("max-w-full min-w-0 truncate", d), t[0] = d, t[1] = f);
|
|
3806
3817
|
let p;
|
|
3807
3818
|
t[2] !== u || t[3] !== f || t[4] !== l ? (p = /* @__PURE__ */ M(U, {
|
|
@@ -3816,12 +3827,12 @@ function Vo(e) {
|
|
|
3816
3827
|
children: [p, i]
|
|
3817
3828
|
}), t[6] = i, t[7] = p, t[8] = m) : m = t[8], m;
|
|
3818
3829
|
}
|
|
3819
|
-
function
|
|
3820
|
-
let e = O(2), { tone: t } =
|
|
3821
|
-
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(
|
|
3830
|
+
function Uo() {
|
|
3831
|
+
let e = O(2), { tone: t } = Ro(), n;
|
|
3832
|
+
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(ln, { className: t.chevron }), e[0] = t.chevron, e[1] = n), n;
|
|
3822
3833
|
}
|
|
3823
|
-
function
|
|
3824
|
-
let t = O(5), { detail: n } = e, { title: r, detail: i, tone: a } =
|
|
3834
|
+
function Wo(e) {
|
|
3835
|
+
let t = O(5), { detail: n } = e, { title: r, detail: i, tone: a } = Vo();
|
|
3825
3836
|
if (n === null) return null;
|
|
3826
3837
|
let o = n ?? i;
|
|
3827
3838
|
if (!o || o === r) return null;
|
|
@@ -3833,8 +3844,8 @@ function Uo(e) {
|
|
|
3833
3844
|
children: o
|
|
3834
3845
|
}), t[2] = o, t[3] = s, t[4] = c) : c = t[4], c;
|
|
3835
3846
|
}
|
|
3836
|
-
function
|
|
3837
|
-
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } =
|
|
3847
|
+
function Go(e) {
|
|
3848
|
+
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } = Ro(), o = a === "running", s;
|
|
3838
3849
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (s = {
|
|
3839
3850
|
initial: "instant",
|
|
3840
3851
|
resize: "instant"
|
|
@@ -3858,11 +3869,11 @@ function Wo(e) {
|
|
|
3858
3869
|
children: h
|
|
3859
3870
|
}), t[10] = u, t[11] = f, t[12] = h, t[13] = g) : g = t[13], g;
|
|
3860
3871
|
}
|
|
3861
|
-
function
|
|
3872
|
+
function Ko(e) {
|
|
3862
3873
|
let t = O(19), { item: n, textClassName: r } = e, i = r === void 0 ? "my-4" : r, { elements: a } = W(), { segment: o } = n;
|
|
3863
3874
|
if (o.kind === "text") {
|
|
3864
3875
|
let e;
|
|
3865
|
-
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(
|
|
3876
|
+
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(qo), t[0] = o.parts, t[1] = e);
|
|
3866
3877
|
let n = e;
|
|
3867
3878
|
if (n.length === 0) return null;
|
|
3868
3879
|
let r;
|
|
@@ -3899,55 +3910,55 @@ function Go(e) {
|
|
|
3899
3910
|
}
|
|
3900
3911
|
return null;
|
|
3901
3912
|
}
|
|
3902
|
-
function
|
|
3913
|
+
function qo(e) {
|
|
3903
3914
|
let { part: t } = e;
|
|
3904
|
-
return !
|
|
3905
|
-
}
|
|
3906
|
-
var
|
|
3907
|
-
Group:
|
|
3908
|
-
GroupTrigger:
|
|
3909
|
-
GroupTitle:
|
|
3910
|
-
GroupChevron:
|
|
3911
|
-
GroupDetail:
|
|
3912
|
-
GroupContent:
|
|
3913
|
-
Segment:
|
|
3915
|
+
return !Gi(t);
|
|
3916
|
+
}
|
|
3917
|
+
var Jo = {
|
|
3918
|
+
Group: zo,
|
|
3919
|
+
GroupTrigger: Bo,
|
|
3920
|
+
GroupTitle: Ho,
|
|
3921
|
+
GroupChevron: Uo,
|
|
3922
|
+
GroupDetail: Wo,
|
|
3923
|
+
GroupContent: Go,
|
|
3924
|
+
Segment: Ko
|
|
3914
3925
|
};
|
|
3915
|
-
function
|
|
3926
|
+
function Yo() {
|
|
3916
3927
|
let e = O(1), t = G(), { messages: n } = W(), { debugMode: r } = z(), i = n[n.length - 1];
|
|
3917
|
-
if (t !== "ready" && t !== "error" &&
|
|
3928
|
+
if (t !== "ready" && t !== "error" && Fo(i, r)) return null;
|
|
3918
3929
|
let a;
|
|
3919
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(
|
|
3930
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(Oa, {}), e[0] = a) : a = e[0], a;
|
|
3920
3931
|
}
|
|
3921
|
-
var
|
|
3922
|
-
Root:
|
|
3923
|
-
List:
|
|
3924
|
-
Item:
|
|
3925
|
-
UserBubble:
|
|
3932
|
+
var Xo = {
|
|
3933
|
+
Root: ya,
|
|
3934
|
+
List: ba,
|
|
3935
|
+
Item: xa,
|
|
3936
|
+
UserBubble: so,
|
|
3926
3937
|
AssistantContent: c(function(e) {
|
|
3927
|
-
let t = O(5), { className: n } = e, r =
|
|
3928
|
-
t[0] === r ? i = t[1] : (i = r.map(
|
|
3938
|
+
let t = O(5), { className: n } = e, r = Io(), i;
|
|
3939
|
+
t[0] === r ? i = t[1] : (i = r.map(Zo), t[0] = r, t[1] = i);
|
|
3929
3940
|
let a;
|
|
3930
3941
|
return t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M("div", {
|
|
3931
3942
|
className: n,
|
|
3932
3943
|
children: i
|
|
3933
3944
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
3934
3945
|
}),
|
|
3935
|
-
Actions:
|
|
3936
|
-
CopyAction:
|
|
3937
|
-
RegenerateAction:
|
|
3938
|
-
CopyDebugJsonAction:
|
|
3939
|
-
Thinking:
|
|
3940
|
-
Error:
|
|
3946
|
+
Actions: pa,
|
|
3947
|
+
CopyAction: ma,
|
|
3948
|
+
RegenerateAction: ha,
|
|
3949
|
+
CopyDebugJsonAction: ga,
|
|
3950
|
+
Thinking: Yo,
|
|
3951
|
+
Error: va
|
|
3941
3952
|
};
|
|
3942
|
-
function
|
|
3943
|
-
return e.kind === "group" ? /* @__PURE__ */ N(
|
|
3953
|
+
function Zo(e) {
|
|
3954
|
+
return e.kind === "group" ? /* @__PURE__ */ N(zo, {
|
|
3944
3955
|
group: e,
|
|
3945
|
-
children: [/* @__PURE__ */ N(
|
|
3946
|
-
}, e.key) : /* @__PURE__ */ M(
|
|
3956
|
+
children: [/* @__PURE__ */ N(Bo, { children: [/* @__PURE__ */ M(Ho, { children: /* @__PURE__ */ M(Uo, {}) }), /* @__PURE__ */ M(Wo, {})] }), /* @__PURE__ */ M(Go, {})]
|
|
3957
|
+
}, e.key) : /* @__PURE__ */ M(Ko, { item: e }, e.key);
|
|
3947
3958
|
}
|
|
3948
3959
|
//#endregion
|
|
3949
3960
|
//#region src/lib/chat/trajectory/trajectories/messages.tsx
|
|
3950
|
-
function
|
|
3961
|
+
function Qo(e) {
|
|
3951
3962
|
let t = O(8), { message: n, className: r } = e, i;
|
|
3952
3963
|
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);
|
|
3953
3964
|
let a;
|
|
@@ -3960,13 +3971,13 @@ function Zo(e) {
|
|
|
3960
3971
|
children: [a, o]
|
|
3961
3972
|
}), t[5] = i, t[6] = o, t[7] = s) : s = t[7], s;
|
|
3962
3973
|
}
|
|
3963
|
-
function
|
|
3974
|
+
function $o(e) {
|
|
3964
3975
|
let t = O(15), { part: n } = e, r = z(), i, a;
|
|
3965
3976
|
if (t[0] !== r.registry || t[1] !== n) {
|
|
3966
3977
|
a = Symbol.for("react.early_return_sentinel");
|
|
3967
3978
|
bb0: {
|
|
3968
|
-
let { toolEntry: e } =
|
|
3969
|
-
if (e &&
|
|
3979
|
+
let { toolEntry: e } = _i(n, r.registry);
|
|
3980
|
+
if (e && vi(e, n.state)) {
|
|
3970
3981
|
let t = e.label?.(n);
|
|
3971
3982
|
if (!t) {
|
|
3972
3983
|
a = null;
|
|
@@ -3999,14 +4010,14 @@ function Qo(e) {
|
|
|
3999
4010
|
} else i = t[2], a = t[3];
|
|
4000
4011
|
if (a !== Symbol.for("react.early_return_sentinel")) return a;
|
|
4001
4012
|
let o = i, s;
|
|
4002
|
-
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(
|
|
4013
|
+
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(Vi, {
|
|
4003
4014
|
label: o,
|
|
4004
4015
|
part: n
|
|
4005
4016
|
}), t[4] = o, t[5] = n, t[6] = s) : s = t[6];
|
|
4006
4017
|
let c;
|
|
4007
|
-
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(
|
|
4018
|
+
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(Qo, { message: o.detail }), t[7] = o, t[8] = c);
|
|
4008
4019
|
let l;
|
|
4009
|
-
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(
|
|
4020
|
+
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(Li, { part: n }), t[9] = n, t[10] = l);
|
|
4010
4021
|
let u;
|
|
4011
4022
|
return t[11] !== s || t[12] !== c || t[13] !== l ? (u = /* @__PURE__ */ N(j, { children: [
|
|
4012
4023
|
s,
|
|
@@ -4014,7 +4025,7 @@ function Qo(e) {
|
|
|
4014
4025
|
l
|
|
4015
4026
|
] }), t[11] = s, t[12] = c, t[13] = l, t[14] = u) : u = t[14], u;
|
|
4016
4027
|
}
|
|
4017
|
-
function
|
|
4028
|
+
function es(e) {
|
|
4018
4029
|
let t = O(5), { part: n } = e, [r, i] = g(!1), a;
|
|
4019
4030
|
t[0] === n.text ? a = t[1] : (a = /* @__PURE__ */ M(J, {
|
|
4020
4031
|
mode: "static",
|
|
@@ -4024,7 +4035,7 @@ function $o(e) {
|
|
|
4024
4035
|
return t[2] !== r || t[3] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
4025
4036
|
"data-copy-exclude": "assistant-snapshot",
|
|
4026
4037
|
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",
|
|
4027
|
-
children: /* @__PURE__ */ M(
|
|
4038
|
+
children: /* @__PURE__ */ M(qa, {
|
|
4028
4039
|
label: "Reasoning",
|
|
4029
4040
|
open: r,
|
|
4030
4041
|
onOpenChange: i,
|
|
@@ -4035,12 +4046,12 @@ function $o(e) {
|
|
|
4035
4046
|
})
|
|
4036
4047
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
4037
4048
|
}
|
|
4038
|
-
function
|
|
4039
|
-
let t = O(16), { part: n } = e, { elements: r } = W(), i =
|
|
4049
|
+
function ts(e) {
|
|
4050
|
+
let t = O(16), { part: n } = e, { elements: r } = W(), i = Ri();
|
|
4040
4051
|
if (n.type === "text") {
|
|
4041
|
-
if (
|
|
4052
|
+
if (Gi(n)) return null;
|
|
4042
4053
|
let e;
|
|
4043
|
-
return t[0] !== r || t[1] !== n.citations || t[2] !== n.text ? (e = /* @__PURE__ */ M(
|
|
4054
|
+
return t[0] !== r || t[1] !== n.citations || t[2] !== n.text ? (e = /* @__PURE__ */ M(Ii, {
|
|
4044
4055
|
text: n.text,
|
|
4045
4056
|
citations: n.citations,
|
|
4046
4057
|
elements: r
|
|
@@ -4048,19 +4059,19 @@ function es(e) {
|
|
|
4048
4059
|
}
|
|
4049
4060
|
if (n.type === "dynamic-tool") {
|
|
4050
4061
|
let e;
|
|
4051
|
-
return t[4] !== i || t[5] !== n ? (e = i ? /* @__PURE__ */ M(
|
|
4062
|
+
return t[4] !== i || t[5] !== n ? (e = i ? /* @__PURE__ */ M(ti, { part: n }) : null, t[4] = i, t[5] = n, t[6] = e) : e = t[6], e;
|
|
4052
4063
|
}
|
|
4053
4064
|
if (S(n)) {
|
|
4054
4065
|
let e;
|
|
4055
|
-
return t[7] === n ? e = t[8] : (e = /* @__PURE__ */ M(
|
|
4066
|
+
return t[7] === n ? e = t[8] : (e = /* @__PURE__ */ M($o, { part: n }), t[7] = n, t[8] = e), e;
|
|
4056
4067
|
}
|
|
4057
4068
|
if (n.type === "reasoning" && n.text) {
|
|
4058
4069
|
let e;
|
|
4059
|
-
return t[9] !== i || t[10] !== n ? (e = i ? /* @__PURE__ */ M(
|
|
4070
|
+
return t[9] !== i || t[10] !== n ? (e = i ? /* @__PURE__ */ M(es, { part: n }) : null, t[9] = i, t[10] = n, t[11] = e) : e = t[11], e;
|
|
4060
4071
|
}
|
|
4061
4072
|
if (n.type === "file") {
|
|
4062
4073
|
let e;
|
|
4063
|
-
return t[12] !== n.filename || t[13] !== n.mediaType || t[14] !== n.url ? (e = /* @__PURE__ */ M(
|
|
4074
|
+
return t[12] !== n.filename || t[13] !== n.mediaType || t[14] !== n.url ? (e = /* @__PURE__ */ M(Ai, {
|
|
4064
4075
|
filename: n.filename,
|
|
4065
4076
|
mediaType: n.mediaType,
|
|
4066
4077
|
url: n.url
|
|
@@ -4068,13 +4079,13 @@ function es(e) {
|
|
|
4068
4079
|
}
|
|
4069
4080
|
return null;
|
|
4070
4081
|
}
|
|
4071
|
-
var
|
|
4082
|
+
var ns = c(function(e) {
|
|
4072
4083
|
let t = O(10), { className: n } = e, { message: r } = K(), i;
|
|
4073
4084
|
t[0] === n ? i = t[1] : (i = k("flex-1 space-y-3", n), t[0] = n, t[1] = i);
|
|
4074
4085
|
let a;
|
|
4075
4086
|
if (t[2] !== r.id || t[3] !== r.parts) {
|
|
4076
4087
|
let e;
|
|
4077
|
-
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(
|
|
4088
|
+
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(ts, { 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;
|
|
4078
4089
|
} else a = t[4];
|
|
4079
4090
|
let o;
|
|
4080
4091
|
return t[7] !== i || t[8] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
@@ -4082,9 +4093,9 @@ var ts = c(function(e) {
|
|
|
4082
4093
|
children: a
|
|
4083
4094
|
}), t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
4084
4095
|
});
|
|
4085
|
-
function
|
|
4096
|
+
function rs(e) {
|
|
4086
4097
|
let t = O(9), { className: n, label: r } = e, i;
|
|
4087
|
-
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(
|
|
4098
|
+
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(is).pop() || "Thinking...", t[0] = r, t[1] = i);
|
|
4088
4099
|
let a = i, o;
|
|
4089
4100
|
t[2] === n ? o = t[3] : (o = k("flex items-start", n), t[2] = n, t[3] = o);
|
|
4090
4101
|
let s;
|
|
@@ -4099,33 +4110,33 @@ function ns(e) {
|
|
|
4099
4110
|
children: s
|
|
4100
4111
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8], c;
|
|
4101
4112
|
}
|
|
4102
|
-
function
|
|
4113
|
+
function is(e) {
|
|
4103
4114
|
return e.trim();
|
|
4104
4115
|
}
|
|
4105
|
-
function
|
|
4116
|
+
function as() {
|
|
4106
4117
|
let e = O(5), t = G(), { messages: n } = W(), r = n[n.length - 1], i;
|
|
4107
|
-
e[0] !== t || e[1] !== r ? (i =
|
|
4118
|
+
e[0] !== t || e[1] !== r ? (i = Ta(t, r), e[0] = t, e[1] = r, e[2] = i) : i = e[2];
|
|
4108
4119
|
let a = i;
|
|
4109
4120
|
if (!a) return null;
|
|
4110
4121
|
let o;
|
|
4111
|
-
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(
|
|
4122
|
+
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(rs, {
|
|
4112
4123
|
label: a,
|
|
4113
4124
|
className: "mt-2"
|
|
4114
4125
|
}), e[3] = a, e[4] = o), o;
|
|
4115
4126
|
}
|
|
4116
|
-
var
|
|
4117
|
-
Root:
|
|
4118
|
-
List:
|
|
4119
|
-
Item:
|
|
4120
|
-
UserBubble:
|
|
4121
|
-
AssistantContent:
|
|
4122
|
-
Thinking:
|
|
4123
|
-
Error:
|
|
4124
|
-
Actions:
|
|
4125
|
-
CopyAction:
|
|
4126
|
-
RegenerateAction:
|
|
4127
|
-
CopyDebugJsonAction:
|
|
4128
|
-
},
|
|
4127
|
+
var os = {
|
|
4128
|
+
Root: ya,
|
|
4129
|
+
List: ba,
|
|
4130
|
+
Item: xa,
|
|
4131
|
+
UserBubble: so,
|
|
4132
|
+
AssistantContent: ns,
|
|
4133
|
+
Thinking: as,
|
|
4134
|
+
Error: va,
|
|
4135
|
+
Actions: pa,
|
|
4136
|
+
CopyAction: ma,
|
|
4137
|
+
RegenerateAction: ha,
|
|
4138
|
+
CopyDebugJsonAction: ga
|
|
4139
|
+
}, ss = {
|
|
4129
4140
|
braille: {
|
|
4130
4141
|
frames: [
|
|
4131
4142
|
"⠋",
|
|
@@ -4192,10 +4203,10 @@ var as = {
|
|
|
4192
4203
|
interval: 100
|
|
4193
4204
|
}
|
|
4194
4205
|
};
|
|
4195
|
-
function
|
|
4206
|
+
function cs(e) {
|
|
4196
4207
|
let t = O(15), n, r, i;
|
|
4197
4208
|
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);
|
|
4198
|
-
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } =
|
|
4209
|
+
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } = ss[a], [l, u] = g(0), f, p;
|
|
4199
4210
|
t[4] !== o || t[5] !== s.length || t[6] !== c ? (f = () => {
|
|
4200
4211
|
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
4201
4212
|
let e = o.setInterval(() => {
|
|
@@ -4220,9 +4231,9 @@ function ss(e) {
|
|
|
4220
4231
|
}
|
|
4221
4232
|
//#endregion
|
|
4222
4233
|
//#region src/lib/chat/trajectory/trajectories/timeline.tsx
|
|
4223
|
-
function
|
|
4234
|
+
function ls(e) {
|
|
4224
4235
|
let t = O(11), { Icon: n, isLast: r, isLoading: i, aborted: a, state: o, isError: s } = e, c;
|
|
4225
|
-
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(
|
|
4236
|
+
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(cs, { 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];
|
|
4226
4237
|
let l;
|
|
4227
4238
|
t[6] === r ? l = t[7] : (l = !r && /* @__PURE__ */ M("span", { className: "bg-border w-px flex-1" }), t[6] = r, t[7] = l);
|
|
4228
4239
|
let u;
|
|
@@ -4231,16 +4242,16 @@ function cs(e) {
|
|
|
4231
4242
|
children: [c, l]
|
|
4232
4243
|
}), t[8] = c, t[9] = l, t[10] = u) : u = t[10], u;
|
|
4233
4244
|
}
|
|
4234
|
-
function
|
|
4235
|
-
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(
|
|
4236
|
-
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(
|
|
4245
|
+
function us(e) {
|
|
4246
|
+
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(Qi), 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;
|
|
4247
|
+
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(ls, {
|
|
4237
4248
|
Icon: f,
|
|
4238
4249
|
isLast: n,
|
|
4239
4250
|
isLoading: p,
|
|
4240
4251
|
aborted: d,
|
|
4241
4252
|
state: u,
|
|
4242
4253
|
isError: c?.isError ?? !1
|
|
4243
|
-
}) : /* @__PURE__ */ M(
|
|
4254
|
+
}) : /* @__PURE__ */ M(Ea, { 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];
|
|
4244
4255
|
let h = m, g = n ? "" : "pb-3.5", _;
|
|
4245
4256
|
t[7] === g ? _ = t[8] : (_ = k("min-w-0 flex-1", g), t[7] = g, t[8] = _);
|
|
4246
4257
|
let v;
|
|
@@ -4249,16 +4260,16 @@ function ls(e) {
|
|
|
4249
4260
|
children: o
|
|
4250
4261
|
}), t[9] = o, t[10] = _, t[11] = v) : v = t[11];
|
|
4251
4262
|
let y;
|
|
4252
|
-
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(
|
|
4263
|
+
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(Da, {
|
|
4253
4264
|
marker: h,
|
|
4254
4265
|
children: v
|
|
4255
4266
|
}), t[12] = h, t[13] = v, t[14] = y) : y = t[14], y;
|
|
4256
4267
|
}
|
|
4257
|
-
function
|
|
4268
|
+
function ds(e) {
|
|
4258
4269
|
let t = O(10), { label: n, state: r, part: i, defaultOpen: a, children: o } = e, s = a !== void 0 && a, c;
|
|
4259
4270
|
t[0] !== n || t[1] !== i || t[2] !== r ? (c = /* @__PURE__ */ M(L, {
|
|
4260
4271
|
className: "cursor-pointer",
|
|
4261
|
-
children: /* @__PURE__ */ M(
|
|
4272
|
+
children: /* @__PURE__ */ M(Ui, {
|
|
4262
4273
|
label: n,
|
|
4263
4274
|
state: r,
|
|
4264
4275
|
part: i
|
|
@@ -4273,17 +4284,17 @@ function us(e) {
|
|
|
4273
4284
|
children: [c, l]
|
|
4274
4285
|
}), t[6] = s, t[7] = c, t[8] = l, t[9] = u) : u = t[9], u;
|
|
4275
4286
|
}
|
|
4276
|
-
var
|
|
4277
|
-
Item:
|
|
4278
|
-
Disclosure:
|
|
4279
|
-
},
|
|
4280
|
-
Root:
|
|
4281
|
-
List:
|
|
4282
|
-
Item:
|
|
4283
|
-
UserBubble:
|
|
4287
|
+
var fs = {
|
|
4288
|
+
Item: us,
|
|
4289
|
+
Disclosure: ds
|
|
4290
|
+
}, ps = {
|
|
4291
|
+
Root: ya,
|
|
4292
|
+
List: ba,
|
|
4293
|
+
Item: xa,
|
|
4294
|
+
UserBubble: so,
|
|
4284
4295
|
AssistantContent: c(function(e) {
|
|
4285
|
-
let t = O(12), { className: n } = e, { message: r } = K(), { elements: i } = W(), { debugMode: a } = z(), o =
|
|
4286
|
-
t[0] === r.parts ? c = t[1] : (c =
|
|
4296
|
+
let t = O(12), { className: n } = e, { message: r } = K(), { elements: i } = W(), { debugMode: a } = z(), o = Ri(), s = Y(), c;
|
|
4297
|
+
t[0] === r.parts ? c = t[1] : (c = oa(r.parts), t[0] = r.parts, t[1] = c);
|
|
4287
4298
|
let l = c, u;
|
|
4288
4299
|
t[2] !== a || t[3] !== i || t[4] !== s || t[5] !== r.id || t[6] !== l || t[7] !== o ? (u = l.map((e, t) => {
|
|
4289
4300
|
let n = `${r.id}-${Z(e, t)}-${e.kind}`;
|
|
@@ -4296,33 +4307,33 @@ var ds = {
|
|
|
4296
4307
|
if (e.kind === "source") return /* @__PURE__ */ M(X.Source, { segment: e }, n);
|
|
4297
4308
|
if (e.kind === "dynamic-tool") {
|
|
4298
4309
|
if (!o) return null;
|
|
4299
|
-
let r = !
|
|
4300
|
-
return /* @__PURE__ */ M(
|
|
4310
|
+
let r = !aa(l, t, !0);
|
|
4311
|
+
return /* @__PURE__ */ M(fs.Item, {
|
|
4301
4312
|
isLast: r,
|
|
4302
4313
|
children: /* @__PURE__ */ M(X.DynamicTool, { segment: e })
|
|
4303
4314
|
}, n);
|
|
4304
4315
|
}
|
|
4305
4316
|
if (e.kind === "reasoning") {
|
|
4306
4317
|
if (s || e.part.type !== "reasoning") return null;
|
|
4307
|
-
let r = !
|
|
4318
|
+
let r = !aa(l, t, a), i = {
|
|
4308
4319
|
name: "Reasoning",
|
|
4309
4320
|
icon: Je,
|
|
4310
4321
|
args: { text: [...e.part.text].slice(0, 60).join("") }
|
|
4311
4322
|
};
|
|
4312
|
-
return /* @__PURE__ */ M(
|
|
4323
|
+
return /* @__PURE__ */ M(fs.Item, {
|
|
4313
4324
|
isLast: r,
|
|
4314
4325
|
label: i,
|
|
4315
|
-
children: /* @__PURE__ */ M(
|
|
4326
|
+
children: /* @__PURE__ */ M(fs.Disclosure, {
|
|
4316
4327
|
label: i,
|
|
4317
4328
|
children: /* @__PURE__ */ M(X.Reasoning, { segment: e })
|
|
4318
4329
|
})
|
|
4319
4330
|
}, n);
|
|
4320
4331
|
}
|
|
4321
4332
|
if (e.kind === "tool") {
|
|
4322
|
-
let r = !
|
|
4333
|
+
let r = !aa(l, t, a);
|
|
4323
4334
|
return /* @__PURE__ */ M(X.Tool, {
|
|
4324
4335
|
segment: e,
|
|
4325
|
-
children: /* @__PURE__ */ M(
|
|
4336
|
+
children: /* @__PURE__ */ M(fs.Item, {
|
|
4326
4337
|
isLast: r,
|
|
4327
4338
|
children: /* @__PURE__ */ M(X.ToolDisclosure, {})
|
|
4328
4339
|
})
|
|
@@ -4336,19 +4347,19 @@ var ds = {
|
|
|
4336
4347
|
children: u
|
|
4337
4348
|
}), t[9] = n, t[10] = u, t[11] = d) : d = t[11], d;
|
|
4338
4349
|
}),
|
|
4339
|
-
Actions:
|
|
4340
|
-
CopyAction:
|
|
4341
|
-
RegenerateAction:
|
|
4342
|
-
CopyDebugJsonAction:
|
|
4343
|
-
Thinking:
|
|
4344
|
-
Error:
|
|
4350
|
+
Actions: pa,
|
|
4351
|
+
CopyAction: ma,
|
|
4352
|
+
RegenerateAction: ha,
|
|
4353
|
+
CopyDebugJsonAction: ga,
|
|
4354
|
+
Thinking: Oa,
|
|
4355
|
+
Error: va
|
|
4345
4356
|
};
|
|
4346
4357
|
//#endregion
|
|
4347
4358
|
//#region src/lib/components/ChatComposer.tsx
|
|
4348
|
-
function
|
|
4359
|
+
function ms(e) {
|
|
4349
4360
|
let t = O(9), n, r;
|
|
4350
4361
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4351
|
-
let { hasSubmitted: i } =
|
|
4362
|
+
let { hasSubmitted: i } = B(), a;
|
|
4352
4363
|
t[3] === n ? a = t[4] : (a = k("bg-background sticky bottom-0 rounded-t-2xl border-0 **:data-[slot=composer-editor]:!min-h-15", n), t[3] = n, t[4] = a);
|
|
4353
4364
|
let o;
|
|
4354
4365
|
return t[5] !== i || t[6] !== r || t[7] !== a ? (o = /* @__PURE__ */ M(R.Root, {
|
|
@@ -4357,7 +4368,7 @@ function ps(e) {
|
|
|
4357
4368
|
...r
|
|
4358
4369
|
}), t[5] = i, t[6] = r, t[7] = a, t[8] = o) : o = t[8], o;
|
|
4359
4370
|
}
|
|
4360
|
-
function
|
|
4371
|
+
function hs(e) {
|
|
4361
4372
|
let t = O(8), n, r;
|
|
4362
4373
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4363
4374
|
let i;
|
|
@@ -4368,7 +4379,7 @@ function ms(e) {
|
|
|
4368
4379
|
...r
|
|
4369
4380
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4370
4381
|
}
|
|
4371
|
-
function
|
|
4382
|
+
function gs(e) {
|
|
4372
4383
|
let t = O(8), n, r;
|
|
4373
4384
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4374
4385
|
let i;
|
|
@@ -4379,7 +4390,7 @@ function hs(e) {
|
|
|
4379
4390
|
...r
|
|
4380
4391
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4381
4392
|
}
|
|
4382
|
-
function
|
|
4393
|
+
function _s(e) {
|
|
4383
4394
|
let t = O(8), n, r;
|
|
4384
4395
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4385
4396
|
let i;
|
|
@@ -4390,7 +4401,7 @@ function gs(e) {
|
|
|
4390
4401
|
...r
|
|
4391
4402
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4392
4403
|
}
|
|
4393
|
-
function
|
|
4404
|
+
function vs(e) {
|
|
4394
4405
|
let t = O(8), n, r;
|
|
4395
4406
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4396
4407
|
let i;
|
|
@@ -4401,7 +4412,7 @@ function _s(e) {
|
|
|
4401
4412
|
...r
|
|
4402
4413
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4403
4414
|
}
|
|
4404
|
-
function
|
|
4415
|
+
function ys(e) {
|
|
4405
4416
|
let t = O(8), n, r;
|
|
4406
4417
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4407
4418
|
let i;
|
|
@@ -4412,7 +4423,7 @@ function vs(e) {
|
|
|
4412
4423
|
...r
|
|
4413
4424
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4414
4425
|
}
|
|
4415
|
-
function
|
|
4426
|
+
function bs(e) {
|
|
4416
4427
|
let t = O(3), n;
|
|
4417
4428
|
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];
|
|
4418
4429
|
let r;
|
|
@@ -4422,7 +4433,7 @@ function ys(e) {
|
|
|
4422
4433
|
...e
|
|
4423
4434
|
}), t[1] = e, t[2] = r), r;
|
|
4424
4435
|
}
|
|
4425
|
-
function
|
|
4436
|
+
function xs() {
|
|
4426
4437
|
let e = O(6), { actions: t, meta: n } = Tt("ChatComposer.CommandButton"), r;
|
|
4427
4438
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M(et, { className: "size-4" }), e[0] = r) : r = e[0];
|
|
4428
4439
|
let i = n.activePopup?.trigger === "/", a;
|
|
@@ -4438,7 +4449,7 @@ function bs() {
|
|
|
4438
4449
|
onClick: a
|
|
4439
4450
|
}), e[3] = i, e[4] = a, e[5] = o) : o = e[5], o;
|
|
4440
4451
|
}
|
|
4441
|
-
function
|
|
4452
|
+
function Ss(e) {
|
|
4442
4453
|
switch (e) {
|
|
4443
4454
|
case "permission-denied": return "Allow microphone access to use dictation";
|
|
4444
4455
|
case "no-microphone": return "Connect a microphone to use dictation";
|
|
@@ -4447,17 +4458,17 @@ function xs(e) {
|
|
|
4447
4458
|
case "transcription-failed": return "Unable to transcribe audio";
|
|
4448
4459
|
}
|
|
4449
4460
|
}
|
|
4450
|
-
function
|
|
4461
|
+
function Cs(e) {
|
|
4451
4462
|
switch (e.status) {
|
|
4452
4463
|
case "unavailable": return e.reason === "blocked" ? "Allow microphone access in your browser settings to use dictation" : "Dictation is not available in this browser";
|
|
4453
4464
|
case "idle": return "Start dictation";
|
|
4454
4465
|
case "starting": return "Starting dictation";
|
|
4455
4466
|
case "recording": return "Stop dictation";
|
|
4456
4467
|
case "finishing": return "Transcribing…";
|
|
4457
|
-
case "failed": return
|
|
4468
|
+
case "failed": return Ss(e.error.code);
|
|
4458
4469
|
}
|
|
4459
4470
|
}
|
|
4460
|
-
function
|
|
4471
|
+
function ws(e) {
|
|
4461
4472
|
switch (e.status) {
|
|
4462
4473
|
case "recording": return /* @__PURE__ */ M(nt, { className: "size-4 fill-current" });
|
|
4463
4474
|
case "starting":
|
|
@@ -4467,11 +4478,11 @@ function Cs(e) {
|
|
|
4467
4478
|
case "failed": return /* @__PURE__ */ M(Qe, { className: "size-4" });
|
|
4468
4479
|
}
|
|
4469
4480
|
}
|
|
4470
|
-
function
|
|
4471
|
-
let e = O(20), { status: t } =
|
|
4472
|
-
e[0] === n ? r = e[1] : (r =
|
|
4481
|
+
function Ts() {
|
|
4482
|
+
let e = O(20), { status: t } = Qt(), { state: n } = Et("ChatComposer.Dictate"), r;
|
|
4483
|
+
e[0] === n ? r = e[1] : (r = Cs(n), e[0] = n, e[1] = r);
|
|
4473
4484
|
let i = r, a = n.status === "starting" || n.status === "recording" || n.status === "finishing", o = t === "streaming" || t === "submitted", s;
|
|
4474
|
-
e[2] === n ? s = e[3] : (s =
|
|
4485
|
+
e[2] === n ? s = e[3] : (s = ws(n), e[2] = n, e[3] = s);
|
|
4475
4486
|
let c;
|
|
4476
4487
|
e[4] !== i || e[5] !== s ? (c = /* @__PURE__ */ M(Q, {
|
|
4477
4488
|
icon: s,
|
|
@@ -4501,22 +4512,22 @@ function ws() {
|
|
|
4501
4512
|
d
|
|
4502
4513
|
] }), e[16] = l, e[17] = u, e[18] = d, e[19] = f) : f = e[19], f;
|
|
4503
4514
|
}
|
|
4504
|
-
var
|
|
4505
|
-
Provider:
|
|
4506
|
-
Root:
|
|
4515
|
+
var Es = {
|
|
4516
|
+
Provider: ms,
|
|
4517
|
+
Root: hs,
|
|
4507
4518
|
Popup: R.Popup,
|
|
4508
|
-
Content:
|
|
4509
|
-
Attachments:
|
|
4510
|
-
Editor:
|
|
4519
|
+
Content: gs,
|
|
4520
|
+
Attachments: vs,
|
|
4521
|
+
Editor: _s,
|
|
4511
4522
|
Error: R.Error,
|
|
4512
|
-
Toolbar:
|
|
4513
|
-
CommandButton:
|
|
4514
|
-
AttachFiles:
|
|
4515
|
-
Dictate:
|
|
4523
|
+
Toolbar: ys,
|
|
4524
|
+
CommandButton: xs,
|
|
4525
|
+
AttachFiles: bs,
|
|
4526
|
+
Dictate: Ts
|
|
4516
4527
|
};
|
|
4517
4528
|
//#endregion
|
|
4518
4529
|
//#region src/lib/components/ChatTextarea.tsx
|
|
4519
|
-
function
|
|
4530
|
+
function Ds(e) {
|
|
4520
4531
|
let t = O(10), n, r, i;
|
|
4521
4532
|
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);
|
|
4522
4533
|
let a;
|
|
@@ -4533,7 +4544,7 @@ function Es(e) {
|
|
|
4533
4544
|
}
|
|
4534
4545
|
//#endregion
|
|
4535
4546
|
//#region src/lib/components/queue.tsx
|
|
4536
|
-
function
|
|
4547
|
+
function Os(e) {
|
|
4537
4548
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4538
4549
|
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);
|
|
4539
4550
|
let a;
|
|
@@ -4542,7 +4553,7 @@ function Ds(e) {
|
|
|
4542
4553
|
children: n
|
|
4543
4554
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4544
4555
|
}
|
|
4545
|
-
function
|
|
4556
|
+
function ks(e) {
|
|
4546
4557
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4547
4558
|
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);
|
|
4548
4559
|
let a;
|
|
@@ -4551,13 +4562,13 @@ function Os(e) {
|
|
|
4551
4562
|
children: n
|
|
4552
4563
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4553
4564
|
}
|
|
4554
|
-
function
|
|
4565
|
+
function As(e) {
|
|
4555
4566
|
let t = O(4), { className: n } = e, r;
|
|
4556
4567
|
t[0] === n ? r = t[1] : (r = k("text-muted-foreground size-3.5 shrink-0", n), t[0] = n, t[1] = r);
|
|
4557
4568
|
let i;
|
|
4558
4569
|
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ M(Ye, { className: r }), t[2] = r, t[3] = i), i;
|
|
4559
4570
|
}
|
|
4560
|
-
function
|
|
4571
|
+
function js(e) {
|
|
4561
4572
|
let t = O(7), { children: n, className: r } = e, i;
|
|
4562
4573
|
t[0] === r ? i = t[1] : (i = k("min-w-0 flex-1 truncate text-sm", r), t[0] = r, t[1] = i);
|
|
4563
4574
|
let a;
|
|
@@ -4568,7 +4579,7 @@ function As(e) {
|
|
|
4568
4579
|
children: a
|
|
4569
4580
|
}), t[4] = i, t[5] = a, t[6] = o) : o = t[6], o;
|
|
4570
4581
|
}
|
|
4571
|
-
function
|
|
4582
|
+
function Ms(e) {
|
|
4572
4583
|
let t = O(6), { onClick: n, className: r } = e, i;
|
|
4573
4584
|
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);
|
|
4574
4585
|
let a;
|
|
@@ -4582,13 +4593,13 @@ function js(e) {
|
|
|
4582
4593
|
children: a
|
|
4583
4594
|
}), t[3] = n, t[4] = i, t[5] = o) : o = t[5], o;
|
|
4584
4595
|
}
|
|
4585
|
-
var
|
|
4586
|
-
Root:
|
|
4587
|
-
Item:
|
|
4588
|
-
Icon:
|
|
4589
|
-
Text:
|
|
4590
|
-
Remove:
|
|
4591
|
-
},
|
|
4596
|
+
var Ns = {
|
|
4597
|
+
Root: Os,
|
|
4598
|
+
Item: ks,
|
|
4599
|
+
Icon: As,
|
|
4600
|
+
Text: js,
|
|
4601
|
+
Remove: Ms
|
|
4602
|
+
}, Ps = {
|
|
4592
4603
|
normal: {
|
|
4593
4604
|
d: "m5 12 7-7 7 7",
|
|
4594
4605
|
translateY: 0
|
|
@@ -4602,7 +4613,7 @@ var Ms = {
|
|
|
4602
4613
|
],
|
|
4603
4614
|
transition: { duration: .4 }
|
|
4604
4615
|
}
|
|
4605
|
-
},
|
|
4616
|
+
}, Fs = {
|
|
4606
4617
|
normal: { d: "M12 19V5" },
|
|
4607
4618
|
animate: {
|
|
4608
4619
|
d: [
|
|
@@ -4612,7 +4623,7 @@ var Ms = {
|
|
|
4612
4623
|
],
|
|
4613
4624
|
transition: { duration: .4 }
|
|
4614
4625
|
}
|
|
4615
|
-
},
|
|
4626
|
+
}, Is = (e) => {
|
|
4616
4627
|
let t = O(30), n, r, i, a, o, s;
|
|
4617
4628
|
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);
|
|
4618
4629
|
let c = s === void 0 ? 20 : s, l = ne(), u = h(!1), d;
|
|
@@ -4634,11 +4645,11 @@ var Ms = {
|
|
|
4634
4645
|
t[17] === l ? (y = t[18], b = t[19]) : (y = /* @__PURE__ */ M(A.path, {
|
|
4635
4646
|
animate: l,
|
|
4636
4647
|
d: "m5 12 7-7 7 7",
|
|
4637
|
-
variants:
|
|
4648
|
+
variants: Ps
|
|
4638
4649
|
}), b = /* @__PURE__ */ M(A.path, {
|
|
4639
4650
|
animate: l,
|
|
4640
4651
|
d: "M12 19V5",
|
|
4641
|
-
variants:
|
|
4652
|
+
variants: Fs
|
|
4642
4653
|
}), t[17] = l, t[18] = y, t[19] = b);
|
|
4643
4654
|
let x;
|
|
4644
4655
|
t[20] !== c || t[21] !== y || t[22] !== b ? (x = /* @__PURE__ */ N("svg", {
|
|
@@ -4662,10 +4673,10 @@ var Ms = {
|
|
|
4662
4673
|
children: x
|
|
4663
4674
|
}), t[24] = m, t[25] = _, t[26] = a, t[27] = v, t[28] = x, t[29] = S) : S = t[29], S;
|
|
4664
4675
|
};
|
|
4665
|
-
|
|
4676
|
+
Is.displayName = "ArrowUpIcon";
|
|
4666
4677
|
//#endregion
|
|
4667
4678
|
//#region src/lib/components/SubmitButton.tsx
|
|
4668
|
-
var
|
|
4679
|
+
var Ls = {
|
|
4669
4680
|
duration: .15,
|
|
4670
4681
|
ease: [
|
|
4671
4682
|
0,
|
|
@@ -4673,7 +4684,7 @@ var Is = {
|
|
|
4673
4684
|
.2,
|
|
4674
4685
|
1
|
|
4675
4686
|
]
|
|
4676
|
-
},
|
|
4687
|
+
}, Rs = {
|
|
4677
4688
|
duration: .12,
|
|
4678
4689
|
ease: [
|
|
4679
4690
|
0,
|
|
@@ -4682,7 +4693,7 @@ var Is = {
|
|
|
4682
4693
|
1
|
|
4683
4694
|
]
|
|
4684
4695
|
};
|
|
4685
|
-
function
|
|
4696
|
+
function zs(e) {
|
|
4686
4697
|
let t = O(40), n, r, i, a;
|
|
4687
4698
|
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);
|
|
4688
4699
|
let o = re(), s = a === "stop", c;
|
|
@@ -4722,7 +4733,7 @@ function Rs(e) {
|
|
|
4722
4733
|
scale: .7
|
|
4723
4734
|
}, t[21] = o, t[22] = v);
|
|
4724
4735
|
let y;
|
|
4725
|
-
t[23] === s ? y = t[24] : (y = M(s ?
|
|
4736
|
+
t[23] === s ? y = t[24] : (y = M(s ? Hs : Vs, {}), t[23] = s, t[24] = y);
|
|
4726
4737
|
let b;
|
|
4727
4738
|
t[25] !== v || t[26] !== y || t[27] !== h || t[28] !== g ? (b = /* @__PURE__ */ M(te, {
|
|
4728
4739
|
initial: !1,
|
|
@@ -4730,7 +4741,7 @@ function Rs(e) {
|
|
|
4730
4741
|
initial: g,
|
|
4731
4742
|
animate: _,
|
|
4732
4743
|
exit: v,
|
|
4733
|
-
transition:
|
|
4744
|
+
transition: Rs,
|
|
4734
4745
|
className: "absolute flex items-center justify-center",
|
|
4735
4746
|
children: y
|
|
4736
4747
|
}, h)
|
|
@@ -4740,7 +4751,7 @@ function Rs(e) {
|
|
|
4740
4751
|
initial: c,
|
|
4741
4752
|
animate: l,
|
|
4742
4753
|
exit: u,
|
|
4743
|
-
transition:
|
|
4754
|
+
transition: Ls,
|
|
4744
4755
|
whileHover: d,
|
|
4745
4756
|
whileTap: f,
|
|
4746
4757
|
"aria-label": p,
|
|
@@ -4750,7 +4761,7 @@ function Rs(e) {
|
|
|
4750
4761
|
children: b
|
|
4751
4762
|
}), 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;
|
|
4752
4763
|
}
|
|
4753
|
-
function
|
|
4764
|
+
function Bs(e) {
|
|
4754
4765
|
let t = O(2), { children: n } = e, r;
|
|
4755
4766
|
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M("svg", {
|
|
4756
4767
|
width: "20",
|
|
@@ -4761,13 +4772,13 @@ function zs(e) {
|
|
|
4761
4772
|
children: n
|
|
4762
4773
|
}), t[0] = n, t[1] = r), r;
|
|
4763
4774
|
}
|
|
4764
|
-
function
|
|
4775
|
+
function Vs() {
|
|
4765
4776
|
let e = O(1), t;
|
|
4766
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4777
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(Is, {}), e[0] = t) : t = e[0], t;
|
|
4767
4778
|
}
|
|
4768
|
-
function
|
|
4779
|
+
function Hs() {
|
|
4769
4780
|
let e = O(1), t;
|
|
4770
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4781
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(Bs, { children: /* @__PURE__ */ M("rect", {
|
|
4771
4782
|
x: "5",
|
|
4772
4783
|
y: "5",
|
|
4773
4784
|
width: "10",
|
|
@@ -4777,9 +4788,9 @@ function Vs() {
|
|
|
4777
4788
|
}
|
|
4778
4789
|
//#endregion
|
|
4779
4790
|
//#region src/lib/components/tool-error.tsx
|
|
4780
|
-
function
|
|
4781
|
-
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 =
|
|
4782
|
-
t[0] === o.issues ? u = t[1] : (u = o.issues.map(
|
|
4791
|
+
function Us(e) {
|
|
4792
|
+
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 = V(), u;
|
|
4793
|
+
t[0] === o.issues ? u = t[1] : (u = o.issues.map(Ws).join("\n"), t[0] = o.issues, t[1] = u);
|
|
4783
4794
|
let d = u, f;
|
|
4784
4795
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(Fe, { className: "size-5" }), t[2] = f) : f = t[2];
|
|
4785
4796
|
let p;
|
|
@@ -4847,71 +4858,71 @@ function Hs(e) {
|
|
|
4847
4858
|
]
|
|
4848
4859
|
}), t[21] = v, t[22] = S, t[23] = p, t[24] = C) : C = t[24], C;
|
|
4849
4860
|
}
|
|
4850
|
-
function
|
|
4861
|
+
function Ws(e) {
|
|
4851
4862
|
return `${e.path.join(".")}: ${e.message}`;
|
|
4852
4863
|
}
|
|
4853
4864
|
//#endregion
|
|
4854
4865
|
//#region src/lib/components/Tip/TipProvider.tsx
|
|
4855
|
-
var
|
|
4856
|
-
function
|
|
4857
|
-
return l(
|
|
4866
|
+
var Gs = o("");
|
|
4867
|
+
function Ks() {
|
|
4868
|
+
return l(Gs);
|
|
4858
4869
|
}
|
|
4859
|
-
var
|
|
4860
|
-
function
|
|
4870
|
+
var qs = "tips:history", Js = "tips:session";
|
|
4871
|
+
function Ys() {
|
|
4861
4872
|
try {
|
|
4862
|
-
return JSON.parse(localStorage.getItem(
|
|
4873
|
+
return JSON.parse(localStorage.getItem(qs) ?? "{}");
|
|
4863
4874
|
} catch (e) {
|
|
4864
|
-
if (
|
|
4875
|
+
if (Qs(e)) return {};
|
|
4865
4876
|
throw e;
|
|
4866
4877
|
}
|
|
4867
4878
|
}
|
|
4868
|
-
function
|
|
4879
|
+
function Xs(e, t) {
|
|
4869
4880
|
try {
|
|
4870
|
-
let n =
|
|
4871
|
-
n[e] = t, localStorage.setItem(
|
|
4881
|
+
let n = Ys();
|
|
4882
|
+
n[e] = t, localStorage.setItem(qs, JSON.stringify(n));
|
|
4872
4883
|
} catch (e) {
|
|
4873
|
-
if (!
|
|
4884
|
+
if (!Qs(e)) throw e;
|
|
4874
4885
|
}
|
|
4875
4886
|
}
|
|
4876
|
-
function
|
|
4887
|
+
function Zs(e) {
|
|
4877
4888
|
try {
|
|
4878
|
-
let t = localStorage.getItem(
|
|
4889
|
+
let t = localStorage.getItem(Js), n = t ? JSON.parse(t) : {
|
|
4879
4890
|
id: "",
|
|
4880
4891
|
n: 0
|
|
4881
4892
|
};
|
|
4882
|
-
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(
|
|
4893
|
+
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(Js, JSON.stringify(n))), n.n;
|
|
4883
4894
|
} catch (e) {
|
|
4884
|
-
if (
|
|
4895
|
+
if (Qs(e)) return 0;
|
|
4885
4896
|
throw e;
|
|
4886
4897
|
}
|
|
4887
4898
|
}
|
|
4888
|
-
function
|
|
4899
|
+
function Qs(e) {
|
|
4889
4900
|
return e instanceof SyntaxError || e instanceof DOMException && (e.name === "QuotaExceededError" || e.name === "SecurityError");
|
|
4890
4901
|
}
|
|
4891
|
-
function
|
|
4902
|
+
function $s(e, t, n) {
|
|
4892
4903
|
let r = n[e];
|
|
4893
4904
|
return r == null ? Infinity : t - r;
|
|
4894
4905
|
}
|
|
4895
|
-
async function
|
|
4896
|
-
let r =
|
|
4906
|
+
async function ec(e, t, n) {
|
|
4907
|
+
let r = Ys(), i = await Promise.all(e.map((e) => e.isRelevant(t))), a = e.filter((e, t) => i[t]);
|
|
4897
4908
|
if (a.length === 0) return null;
|
|
4898
|
-
let o = a.filter((e) =>
|
|
4899
|
-
s.sort((e, t) =>
|
|
4909
|
+
let o = a.filter((e) => $s(e.id, n, r) >= e.cooldownSessions), s = o.length > 0 ? o : a;
|
|
4910
|
+
s.sort((e, t) => $s(t.id, n, r) - $s(e.id, n, r));
|
|
4900
4911
|
let c = s[0], l = await c.content(t);
|
|
4901
4912
|
return {
|
|
4902
4913
|
id: c.id,
|
|
4903
4914
|
text: l
|
|
4904
4915
|
};
|
|
4905
4916
|
}
|
|
4906
|
-
function
|
|
4917
|
+
function tc(e) {
|
|
4907
4918
|
let t = O(13), { tips: n, streaming: r, chatId: i, context: a, children: o } = e, s;
|
|
4908
|
-
t[0] === i ? s = t[1] : (s = () =>
|
|
4919
|
+
t[0] === i ? s = t[1] : (s = () => Zs(i), t[0] = i, t[1] = s);
|
|
4909
4920
|
let [c] = g(s), [l, u] = g(""), [p, m] = g(r), [_, v] = g(0);
|
|
4910
|
-
r !== p && (m(r), r && v(
|
|
4921
|
+
r !== p && (m(r), r && v(nc));
|
|
4911
4922
|
let y = h(!1), b;
|
|
4912
4923
|
t[2] !== a || t[3] !== c || t[4] !== n ? (b = () => {
|
|
4913
|
-
y.current || (y.current = !0,
|
|
4914
|
-
e && (u(e.text),
|
|
4924
|
+
y.current || (y.current = !0, ec(n, a, c).then((e) => {
|
|
4925
|
+
e && (u(e.text), Xs(e.id, c));
|
|
4915
4926
|
}).finally(() => {
|
|
4916
4927
|
y.current = !1;
|
|
4917
4928
|
}));
|
|
@@ -4923,17 +4934,17 @@ function ec(e) {
|
|
|
4923
4934
|
let C;
|
|
4924
4935
|
t[8] === _ ? C = t[9] : (C = [_], t[8] = _, t[9] = C), d(S, C);
|
|
4925
4936
|
let w;
|
|
4926
|
-
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(
|
|
4937
|
+
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(Gs, {
|
|
4927
4938
|
value: l,
|
|
4928
4939
|
children: o
|
|
4929
4940
|
}), t[10] = o, t[11] = l, t[12] = w) : w = t[12], w;
|
|
4930
4941
|
}
|
|
4931
|
-
function
|
|
4942
|
+
function nc(e) {
|
|
4932
4943
|
return e + 1;
|
|
4933
4944
|
}
|
|
4934
|
-
function
|
|
4935
|
-
let t = O(6), { tips: n, context: r, children: i } = e, { chatId: a } = z(), { status: o } =
|
|
4936
|
-
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(
|
|
4945
|
+
function rc(e) {
|
|
4946
|
+
let t = O(6), { tips: n, context: r, children: i } = e, { chatId: a } = z(), { status: o } = Qt(), s = o === "streaming" || o === "submitted", c = a ?? "", l;
|
|
4947
|
+
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(tc, {
|
|
4937
4948
|
tips: n,
|
|
4938
4949
|
streaming: s,
|
|
4939
4950
|
chatId: c,
|
|
@@ -4943,14 +4954,14 @@ function nc(e) {
|
|
|
4943
4954
|
}
|
|
4944
4955
|
//#endregion
|
|
4945
4956
|
//#region src/lib/components/Tip/TipLine.tsx
|
|
4946
|
-
var
|
|
4947
|
-
function
|
|
4948
|
-
let t = O(13), { className: n } = e, r = St(), i =
|
|
4957
|
+
var ic = 1.5;
|
|
4958
|
+
function ac(e) {
|
|
4959
|
+
let t = O(13), { className: n } = e, r = St(), i = Ks(), [a, o] = g(i), [s, c] = g(!1);
|
|
4949
4960
|
i !== a && (o(i), i && c(!0));
|
|
4950
4961
|
let l, u;
|
|
4951
4962
|
t[0] !== r || t[1] !== s ? (l = () => {
|
|
4952
4963
|
if (!s) return;
|
|
4953
|
-
let e = r.setTimeout(() => c(!1),
|
|
4964
|
+
let e = r.setTimeout(() => c(!1), ic * 1e3);
|
|
4954
4965
|
return () => r.clearTimeout(e);
|
|
4955
4966
|
}, u = [r, s], t[0] = r, t[1] = s, t[2] = l, t[3] = u) : (l = t[2], u = t[3]), d(l, u);
|
|
4956
4967
|
let f;
|
|
@@ -4961,7 +4972,7 @@ function ic(e) {
|
|
|
4961
4972
|
t[7] !== s || t[8] !== i ? (m = /* @__PURE__ */ N(U, {
|
|
4962
4973
|
as: "span",
|
|
4963
4974
|
enabled: s,
|
|
4964
|
-
duration:
|
|
4975
|
+
duration: ic,
|
|
4965
4976
|
children: ["Tip: ", i]
|
|
4966
4977
|
}), t[7] = s, t[8] = i, t[9] = m) : m = t[9];
|
|
4967
4978
|
let h;
|
|
@@ -4972,7 +4983,7 @@ function ic(e) {
|
|
|
4972
4983
|
}
|
|
4973
4984
|
//#endregion
|
|
4974
4985
|
//#region src/lib/hooks/use-async-generator.ts
|
|
4975
|
-
function
|
|
4986
|
+
function oc() {
|
|
4976
4987
|
let [e, t] = g({
|
|
4977
4988
|
loading: !1,
|
|
4978
4989
|
error: null
|
|
@@ -5002,7 +5013,7 @@ function ac() {
|
|
|
5002
5013
|
}
|
|
5003
5014
|
//#endregion
|
|
5004
5015
|
//#region src/lib/hooks/use-auto-resize-textarea.ts
|
|
5005
|
-
function
|
|
5016
|
+
function sc(e) {
|
|
5006
5017
|
let t = O(16), { minHeight: n, maxHeight: r, value: i } = e, a = h(null), o;
|
|
5007
5018
|
t[0] !== r || t[1] !== n ? (o = (e) => {
|
|
5008
5019
|
let t = a.current;
|
|
@@ -5039,22 +5050,22 @@ function oc(e) {
|
|
|
5039
5050
|
}
|
|
5040
5051
|
//#endregion
|
|
5041
5052
|
//#region src/lib/hooks/use-keyboard.ts
|
|
5042
|
-
function
|
|
5053
|
+
function cc(e) {
|
|
5043
5054
|
let t = [];
|
|
5044
5055
|
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("+");
|
|
5045
5056
|
}
|
|
5046
|
-
function
|
|
5057
|
+
function lc(e) {
|
|
5047
5058
|
let t = O(4), { enabled: n, handlers: r } = e, i = n === void 0 || n, a, o;
|
|
5048
5059
|
t[0] !== i || t[1] !== r ? (a = () => {
|
|
5049
5060
|
if (!i) return;
|
|
5050
5061
|
let e = (e) => {
|
|
5051
|
-
let t =
|
|
5062
|
+
let t = cc(e), n = r[t];
|
|
5052
5063
|
n ||= r[e.key], n && (e.preventDefault(), e.stopPropagation(), n(e));
|
|
5053
5064
|
};
|
|
5054
5065
|
return document.addEventListener("keydown", e, !0), () => document.removeEventListener("keydown", e, !0);
|
|
5055
5066
|
}, o = [i, r], t[0] = i, t[1] = r, t[2] = a, t[3] = o) : (a = t[2], o = t[3]), d(a, o);
|
|
5056
5067
|
}
|
|
5057
5068
|
//#endregion
|
|
5058
|
-
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea,
|
|
5069
|
+
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea, mi as AssistantSnapshot, ni as COPY_EXCLUSION_ATTRIBUTE, ri as COPY_EXCLUSION_MODES, Q as ChatActionButton, zt as ChatBot, Es as ChatComposer, Ft as ChatManager, Ds as ChatTextarea, Qn as CitationPill, Wr as CodeBlock, Gr as CodeBlockCopyButton, Xo as CompactMessages, Jo as CompactTrajectory, ma as CopyAction, ga as CopyDebugJsonAction, Yn as IndexProgress, wi as InteractiveResponse, Zn as MessageItemContext, Ja as MessageMetadata, Ns as MessageQueue, os as Messages, pa as MessagesActions, Xn as MessagesContext, va as MessagesError, xa as MessagesItem, ba as MessagesList, ya as MessagesRoot, so as MessagesUserBubble, da as NestedTrajectory, wa as PendingToolInput, rn as ReadOnlyChatTransport, ha as RegenerateAction, J as Response, X as Segment, ui as SnapshotRenderPortal, zs as SubmitButton, U as TextShimmer, ps as TimelinedMessages, ac as TipLine, tc as TipProvider, Gs as TipValueContext, rc as Tips, Hi as ToolArg, Us as ToolError, oo as UserMessageContent, Va as ZukhrufChatTransport, nn as citationIndexOf, Nt as clearPrefill, oe as defineElements, pi as extractAssistantRawText, tn as extractSourcesFromMessage, Ra as formatUsageBreakdown, La as formatUsageValue, mn as getIndexProgressEvents, Z as getSegmentKey, ai as hasCopyExclusion, vi as isActiveClientInputTool, Gi as isCommentaryTextPart, hi as isSubagentPart, on as isToolAborted, an as isToolStateAborted, Ma as parseMetadataUsage, ja as parseUsage, Pt as persistedPromptOf, jt as readPrefill, si as resolveCopyToClipboardStrategy, _i as resolveToolEntry, cn as serializeToolsRegistry, oi as shouldIncludeInCopyImage, gi as subagentDisplayName, H as urlCitationsOf, Sa as useActivePendingToolInput, z as useAgent, Lt as useAgentChatSetup, V as useAgentMessages, B as useAgentMeta, Qt as useAgentStatus, oc as useAsyncGenerator, sc as useAutoResizeTextarea, $t as useChatManager, Ro as useCompactGroup, fi as useCopyElementAsImage, Y as useIsAssistantSnapshotRender, sn as useIsToolAborted, lc as useKeyboard, K as useMessageItem, W as useMessagesContext, G as useMessagesStatus, Ia as useNormalizedUsageTracking, Ks as useTipValue, $i as useToolSegment, Io as useTrajectoryItems, li as waitForNextPaint, Mt as writePrefill };
|
|
5059
5070
|
|
|
5060
5071
|
//# sourceMappingURL=index.js.map
|