@mcp-use/inspector 20.0.0-beta.5 → 20.0.0-beta.6
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/cdn/{ChatTab-B255lH5i.js → ChatTab-D6J3Gyp7.js} +885 -837
- package/dist/cdn/{ConnectionSettingsForm-DF-NS58d.js → ConnectionSettingsForm-CWQueI8J.js} +1 -1
- package/dist/cdn/{ConnectionSettingsTab-dI-Cqe79.js → ConnectionSettingsTab-FGyt3QaI.js} +1 -1
- package/dist/cdn/{MarkdownRenderer-Ba7nA4Ie.js → MarkdownRenderer-gLqUICEd.js} +1 -1
- package/dist/cdn/{OAuthCallback-Blc2Asxc.js → OAuthCallback-Bg2bP-o9.js} +1 -1
- package/dist/cdn/{PromptsTab-BYKnY7Rp.js → PromptsTab-C4LuwyWN.js} +1 -1
- package/dist/cdn/{ResourcesTab-BGualKW-.js → ResourcesTab-CQkKni-P.js} +5 -5
- package/dist/cdn/{SamplingTab-BeZBUeni.js → SamplingTab-D8q-iCMc.js} +3 -3
- package/dist/cdn/{ToolsTab-j6n4O_3s.js → ToolsTab-6xaVH43x.js} +4 -4
- package/dist/cdn/{ViewPreview-DihyG6Qd.js → ViewPreview-Ohh6JwOn.js} +2 -2
- package/dist/cdn/{WidgetWrapper-B4H3Fek7.js → WidgetWrapper-CruwjBOd.js} +2 -2
- package/dist/cdn/{dist-DbX5yidW.js → dist-CXHFvGre.js} +3 -2
- package/dist/cdn/inspector.js +5 -5
- package/dist/cdn/{react-BajV-X4P.js → react-BLtCruam.js} +575 -568
- package/dist/cdn/{telemetry-DabTAQ8x.js → telemetry-C7Ytz2BG.js} +1 -1
- package/dist/cdn/{useConfig-Btmh8wjJ.js → useConfig-BW6uQf2m.js} +2 -2
- package/dist/cdn/{useViewHostProps-B6SKeeH9.js → useViewHostProps-CINeSkth.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/components/chat/MessageList.d.ts +1 -0
- package/dist/client/components/chat/MessageList.d.ts.map +1 -1
- package/dist/client/components/chat/ToolResultRenderer.d.ts.map +1 -1
- package/dist/client/components/chat/partialToolArgs.d.ts +10 -0
- package/dist/client/components/chat/partialToolArgs.d.ts.map +1 -0
- package/dist/client/components/chat/types.d.ts +1 -0
- package/dist/client/components/chat/types.d.ts.map +1 -1
- package/dist/client/components/chat/useChatMessages.d.ts.map +1 -1
- package/dist/client/components/chat/useChatMessagesClientSide.d.ts.map +1 -1
- package/dist/client/index.js +158 -81
- package/dist/server/cdn-shell.js +2 -2
- package/dist/server/{chunk-ZCGLU5T7.js → chunk-GBY4WAVP.js} +1 -1
- package/dist/server/{chunk-DSTNUYWX.js → chunk-IFF5T5J4.js} +1 -1
- package/dist/server/{chunk-SQ4XNMLT.js → chunk-NUHI6MJ6.js} +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/middleware.js +3 -3
- package/dist/server/version.js +1 -1
- package/dist/web/assets/ChatTab-CsBPVCSc.js +18 -0
- package/dist/web/assets/{ConnectionSettingsTab-BjGkLwVu.js → ConnectionSettingsTab-DQTXfnl1.js} +1 -1
- package/dist/web/assets/{ElicitationTab-D3ZUKHND.js → ElicitationTab-_FKB7nNG.js} +1 -1
- package/dist/web/assets/{ManufactOAuthCallback-CS3ydSZg.js → ManufactOAuthCallback-BRO6TPkZ.js} +1 -1
- package/dist/web/assets/{MarkdownRenderer-BeeBfQhv.js → MarkdownRenderer-gaJFjbtr.js} +1 -1
- package/dist/web/assets/{NotificationsTab-Uj0_DrmK.js → NotificationsTab-LYcfRjyd.js} +1 -1
- package/dist/web/assets/{OAuthCallback-C0ljgCiw.js → OAuthCallback-D8UItgTB.js} +1 -1
- package/dist/web/assets/{PromptsTab-Bns2u0G-.js → PromptsTab-B2uVMRR2.js} +1 -1
- package/dist/web/assets/{ResourcesTab-CO24312V.js → ResourcesTab-DhOZYPjE.js} +1 -1
- package/dist/web/assets/{SamplingTab-7gtN7FwU.js → SamplingTab-C-oY2hoi.js} +1 -1
- package/dist/web/assets/{ServerMetadataTab-CQwqYSjL.js → ServerMetadataTab-BkTxO5KS.js} +1 -1
- package/dist/web/assets/{ToolsTab-bDdRxI1b.js → ToolsTab-DupHgo7A.js} +1 -1
- package/dist/web/assets/{ViewPreview-Ba1Ec5uA.js → ViewPreview--z6jL0Zg.js} +1 -1
- package/dist/web/assets/{WidgetWrapper-CYHfzrtb.js → WidgetWrapper-CZaEVEw4.js} +1 -1
- package/dist/web/assets/{checkbox-CzBkaNKa.js → checkbox-BQ9mI_6k.js} +1 -1
- package/dist/web/assets/{dist-C5JjLJN9.js → dist-B8sA8Zml.js} +5 -5
- package/dist/web/assets/{index-TQ5V7cM9.js → index-C_fCIJ4C.js} +3 -3
- package/dist/web/assets/{shared-BF0rJNdE.js → shared-CCC9rTz4.js} +1 -1
- package/dist/web/assets/{tabs-subtle-6D79T1xd.js → tabs-subtle-246ABJqx.js} +1 -1
- package/dist/web/assets/{useConfig-BAgALiZg.js → useConfig-BAsKhUxf.js} +1 -1
- package/dist/web/assets/{useViewHostProps-BYitt_6K.js → useViewHostProps-CV5zBxUb.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +3 -3
- package/dist/web/assets/ChatTab-BCobuZDc.js +0 -18
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { s as e, t } from "./react-BIs9pQ3H.js";
|
|
2
|
-
import { En as n, G as r, Lr as i, Mn as a, Nn as o, Or as s, Pr as c, Rr as l, Sr as u, Tn as d, Tr as f, Yn as p, _r as m, a as h, an as g, br as _, c as v, d as y, dr as b, f as x, fr as S, gr as C, in as w, kn as T, mn as E, mr as D, n as O, on as k, or as A, pn as j, pr as M, r as N, s as P, sr as F, t as
|
|
2
|
+
import { En as n, G as r, Lr as i, Mn as a, Nn as o, Or as s, Pr as c, Rr as l, Sr as u, Tn as d, Tr as f, Yn as p, _r as m, a as h, an as g, br as _, c as v, d as y, dr as b, f as x, fr as S, gr as C, in as w, kn as T, mn as E, mr as D, n as O, on as k, or as A, pn as j, pr as M, r as N, s as P, sr as F, t as I, u as L, wr as R, xr as ee } from "./input-C2OBd4PJ.js";
|
|
3
3
|
import { t as z } from "./jsx-runtime-CIxvMpEo.js";
|
|
4
|
-
import { _ as
|
|
5
|
-
import { n as
|
|
6
|
-
import { m as
|
|
7
|
-
import { a as
|
|
8
|
-
import { a as
|
|
9
|
-
import { t as
|
|
10
|
-
import { O as
|
|
11
|
-
import { a as
|
|
12
|
-
import { a as
|
|
13
|
-
import { t as
|
|
4
|
+
import { _ as B, a as V, c as H, d as U, f as te, i as W, l as G, n as K, o as ne, r as q, s as J, t as Y, u as X, y as re } from "./sheet-Br_l2kry.js";
|
|
5
|
+
import { n as ie, t as ae } from "./label-B9Jmm9be.js";
|
|
6
|
+
import { m as oe, t as se } from "./AnimatePresence-Dcw-FOy8.js";
|
|
7
|
+
import { a as ce, c as le, i as ue, n as de, o as fe, p as pe, r as me, s as he, t as ge } from "./select-DDdiIPR2.js";
|
|
8
|
+
import { a as _e, c as ve, i as ye, l as be, n as xe, o as Se, r as Ce, s as we, t as Te } from "./FormContext-tmgN_Vdr.js";
|
|
9
|
+
import { t as Ee } from "./createLucideIcon-C5fZZ6oB.js";
|
|
10
|
+
import { O as De, S as Oe, a as ke, c as Ae, i as je, j as Me, o as Ne, r as Pe, t as Fe, y as Ie } from "./dialog-BsDpuJd3.js";
|
|
11
|
+
import { a as Le, i as Re, t as ze } from "./browser-CbQIH4w2.js";
|
|
12
|
+
import { a as Be, i as Ve, n as He, r as Ue, t as We } from "./JSONDisplay-BFxf5oEu.js";
|
|
13
|
+
import { t as Ge } from "./external-link-CjmfT6rW.js";
|
|
14
14
|
import { n as Ke, t as qe } from "./eye-B7H96av8.js";
|
|
15
15
|
import { t as Je } from "./history-Csw4rb44.js";
|
|
16
16
|
import { a as Ye, c as Xe, d as Ze, i as Qe, l as $e, n as et, o as Z, r as tt, s as nt, u as rt } from "./providerMeta-BQIfHuNL.js";
|
|
@@ -20,8 +20,8 @@ import { t as ot } from "./refresh-cw-BXY-Pa0U.js";
|
|
|
20
20
|
import { t as st } from "./wrench-DzGmCfnb.js";
|
|
21
21
|
import { t as ct } from "./x-C3vRQIYu.js";
|
|
22
22
|
import { t as lt } from "./not-found-DEtSM_Wd.js";
|
|
23
|
-
import { s as ut, t as dt } from "./telemetry-
|
|
24
|
-
import { c as ft, r as pt } from "./react-
|
|
23
|
+
import { s as ut, t as dt } from "./telemetry-C7Ytz2BG.js";
|
|
24
|
+
import { c as ft, r as pt } from "./react-BLtCruam.js";
|
|
25
25
|
import { r as mt } from "./basePath-B8HuhIMu.js";
|
|
26
26
|
import { n as ht } from "./servers-Dm72iTpY.js";
|
|
27
27
|
import { n as gt } from "./dist-DaMB0Su9.js";
|
|
@@ -30,21 +30,21 @@ import { n as vt } from "./InspectorContext-UjtEbNod.js";
|
|
|
30
30
|
import { r as yt } from "./WidgetDebugContext-D4usL_MA.js";
|
|
31
31
|
import { t as bt } from "./useAriaLabelledBy-DqAdnppm.js";
|
|
32
32
|
import { a as xt, i as St, n as Ct } from "./CheckboxIndicator-Bt4IICtv.js";
|
|
33
|
-
import { a as wt, c as Tt, i as Et, n as Dt, o as Ot, r as kt, s as At } from "./dist-
|
|
34
|
-
import { n as jt, t as Mt } from "./MarkdownRenderer-
|
|
33
|
+
import { a as wt, c as Tt, i as Et, n as Dt, o as Ot, r as kt, s as At } from "./dist-CXHFvGre.js";
|
|
34
|
+
import { n as jt, t as Mt } from "./MarkdownRenderer-gLqUICEd.js";
|
|
35
35
|
import { a as Nt, i as Pt, n as Ft, t as It } from "./tabs-subtle-CkdI6Mac.js";
|
|
36
|
-
import { a as Lt, c as Rt, i as zt, l as Bt, n as Vt, o as Ht, r as Ut, s as Wt, t as Gt } from "./useConfig-
|
|
36
|
+
import { a as Lt, c as Rt, i as zt, l as Bt, n as Vt, o as Ht, r as Ut, s as Wt, t as Gt } from "./useConfig-BW6uQf2m.js";
|
|
37
37
|
import { t as Kt } from "./textarea-DSbwcFVt.js";
|
|
38
38
|
import { t as qt } from "./checkbox-By0FklhG.js";
|
|
39
39
|
import { n as Jt, t as Yt } from "./schemaHelpers-DTV38jGq.js";
|
|
40
|
-
import { t as Xt } from "./useViewHostProps-
|
|
41
|
-
var Zt =
|
|
40
|
+
import { t as Xt } from "./useViewHostProps-CINeSkth.js";
|
|
41
|
+
var Zt = Ee("arrow-down", [["path", {
|
|
42
42
|
d: "M12 5v14",
|
|
43
43
|
key: "s699le"
|
|
44
44
|
}], ["path", {
|
|
45
45
|
d: "m19 12-7 7-7-7",
|
|
46
46
|
key: "1idqje"
|
|
47
|
-
}]]), Qt =
|
|
47
|
+
}]]), Qt = Ee("arrow-left-from-line", [
|
|
48
48
|
["path", {
|
|
49
49
|
d: "m9 6-6 6 6 6",
|
|
50
50
|
key: "7v63n9"
|
|
@@ -57,13 +57,13 @@ var Zt = De("arrow-down", [["path", {
|
|
|
57
57
|
d: "M21 19V5",
|
|
58
58
|
key: "b4bplr"
|
|
59
59
|
}]
|
|
60
|
-
]), $t =
|
|
60
|
+
]), $t = Ee("chevrons-up-down", [["path", {
|
|
61
61
|
d: "m7 15 5 5 5-5",
|
|
62
62
|
key: "1hf1tw"
|
|
63
63
|
}], ["path", {
|
|
64
64
|
d: "m7 9 5-5 5 5",
|
|
65
65
|
key: "sgt6xg"
|
|
66
|
-
}]]), en =
|
|
66
|
+
}]]), en = Ee("circle-alert", [
|
|
67
67
|
["circle", {
|
|
68
68
|
cx: "12",
|
|
69
69
|
cy: "12",
|
|
@@ -84,10 +84,10 @@ var Zt = De("arrow-down", [["path", {
|
|
|
84
84
|
y2: "16",
|
|
85
85
|
key: "4dfq90"
|
|
86
86
|
}]
|
|
87
|
-
]), tn =
|
|
87
|
+
]), tn = Ee("paperclip", [["path", {
|
|
88
88
|
d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
|
|
89
89
|
key: "1miecu"
|
|
90
|
-
}]]), nn =
|
|
90
|
+
}]]), nn = Ee("settings-2", [
|
|
91
91
|
["path", {
|
|
92
92
|
d: "M14 17H5",
|
|
93
93
|
key: "gfn3mx"
|
|
@@ -108,7 +108,7 @@ var Zt = De("arrow-down", [["path", {
|
|
|
108
108
|
r: "3",
|
|
109
109
|
key: "dfmy0x"
|
|
110
110
|
}]
|
|
111
|
-
]), rn =
|
|
111
|
+
]), rn = Ee("square-pen", [["path", {
|
|
112
112
|
d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",
|
|
113
113
|
key: "1m0v6g"
|
|
114
114
|
}], ["path", {
|
|
@@ -130,7 +130,7 @@ an.displayName = "ScrollArea";
|
|
|
130
130
|
//#region src/client/chat-history/ChatHistoryHeader.tsx
|
|
131
131
|
function on({ count: e }) {
|
|
132
132
|
return /* @__PURE__ */ (0, $.jsx)("div", {
|
|
133
|
-
className: `flex flex-row absolute top-0 right-0 z-10 w-full items-center justify-between gap-2 ${
|
|
133
|
+
className: `flex flex-row absolute top-0 right-0 z-10 w-full items-center justify-between gap-2 ${L}`,
|
|
134
134
|
children: /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
135
135
|
className: "flex items-center gap-2 rounded-full",
|
|
136
136
|
children: [/* @__PURE__ */ (0, $.jsx)("h2", {
|
|
@@ -323,7 +323,7 @@ function Tn({ chats: e, onDelete: t, onSelect: n, compact: i, hideAgentName: a,
|
|
|
323
323
|
className: "mb-4 px-3 sm:px-5",
|
|
324
324
|
children: /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
325
325
|
className: "relative",
|
|
326
|
-
children: [/* @__PURE__ */ (0, $.jsx)(r, { className: "absolute left-3 top-2.5 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ (0, $.jsx)(
|
|
326
|
+
children: [/* @__PURE__ */ (0, $.jsx)(r, { className: "absolute left-3 top-2.5 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ (0, $.jsx)(I, {
|
|
327
327
|
placeholder: "Search chats...",
|
|
328
328
|
value: c,
|
|
329
329
|
onChange: (e) => u(e.target.value),
|
|
@@ -496,10 +496,10 @@ function On({ provider: e, open: t, onOpenChange: n, currentChatId: r, container
|
|
|
496
496
|
return c === "inline" ? /* @__PURE__ */ (0, $.jsx)("div", {
|
|
497
497
|
className: l("flex h-full min-h-0 flex-col", u),
|
|
498
498
|
children: D
|
|
499
|
-
}) : /* @__PURE__ */ (0, $.jsx)(
|
|
499
|
+
}) : /* @__PURE__ */ (0, $.jsx)(Y, {
|
|
500
500
|
open: t,
|
|
501
501
|
onOpenChange: n,
|
|
502
|
-
children: /* @__PURE__ */ (0, $.jsx)(
|
|
502
|
+
children: /* @__PURE__ */ (0, $.jsx)(K, {
|
|
503
503
|
side: "left",
|
|
504
504
|
className: "w-[400px] sm:w-[400px] border-zinc-200 p-0 dark:border-zinc-700",
|
|
505
505
|
container: i,
|
|
@@ -976,12 +976,12 @@ async function gr(e, t) {
|
|
|
976
976
|
return ((await n.json()).models || []).map((e) => ({ id: e.model || e.name || "" }));
|
|
977
977
|
}
|
|
978
978
|
function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKey: i, tempBaseUrl: a, onProviderChange: o, onModelChange: s, onApiKeyChange: c, onBaseUrlChange: u, onSave: d, onClear: f, showClearButton: p = !1, buttonLabel: m = "Configure API Key", hostedInspector: h = !1, freeTierInfo: g, managedCloudInfo: _, useManagedCloud: v = !1, onSaveManagedCloud: y }) {
|
|
979
|
-
let [b, x] = (0, Q.useState)([]), [S, C] = (0, Q.useState)(!1), [w, T] = (0, Q.useState)(null), [E, D] = (0, Q.useState)(!1), [O, k] = (0, Q.useState)(!1), [A, j] = (0, Q.useState)(!1), [M, N] = (0, Q.useState)(+!v), P = cr(n, a),
|
|
979
|
+
let [b, x] = (0, Q.useState)([]), [S, C] = (0, Q.useState)(!1), [w, T] = (0, Q.useState)(null), [E, D] = (0, Q.useState)(!1), [O, k] = (0, Q.useState)(!1), [A, j] = (0, Q.useState)(!1), [M, N] = (0, Q.useState)(+!v), P = cr(n, a), L = !!(h || g || _), R = !!(_ && M === 0);
|
|
980
980
|
(0, Q.useEffect)(() => {
|
|
981
981
|
e && N(+!v);
|
|
982
982
|
}, [e, v]), (0, Q.useEffect)(() => {
|
|
983
983
|
let t = Rt(n), r = Bt(n);
|
|
984
|
-
if (
|
|
984
|
+
if (R || !e || !n || t && !i.trim() || r && !a.trim()) {
|
|
985
985
|
x([]), T(null);
|
|
986
986
|
return;
|
|
987
987
|
}
|
|
@@ -1008,36 +1008,36 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1008
1008
|
n,
|
|
1009
1009
|
e,
|
|
1010
1010
|
P,
|
|
1011
|
-
|
|
1011
|
+
R
|
|
1012
1012
|
]);
|
|
1013
|
-
let
|
|
1013
|
+
let ee = (0, Q.useRef)(null);
|
|
1014
1014
|
(0, Q.useEffect)(() => {
|
|
1015
|
-
if (!e ||
|
|
1016
|
-
e || (
|
|
1015
|
+
if (!e || R) {
|
|
1016
|
+
e || (ee.current = null);
|
|
1017
1017
|
return;
|
|
1018
1018
|
}
|
|
1019
|
-
let t =
|
|
1020
|
-
t !== null && t !== n && s(""),
|
|
1019
|
+
let t = ee.current;
|
|
1020
|
+
t !== null && t !== n && s(""), ee.current = n;
|
|
1021
1021
|
}, [
|
|
1022
1022
|
n,
|
|
1023
1023
|
e,
|
|
1024
1024
|
s,
|
|
1025
|
-
|
|
1025
|
+
R
|
|
1026
1026
|
]);
|
|
1027
|
-
let z = Bt(n),
|
|
1028
|
-
if (
|
|
1027
|
+
let z = Bt(n), B = !Rt(n), V = e && (!Rt(n) || !!i.trim()) && (!z || !!a.trim()), U = B ? "API Key (optional)" : "API Key", te = B ? n === "ollama" ? "Leave empty for local Ollama" : "Enter your API key (optional)" : "Enter your API key", W = n === "openai-compatible" ? "http://localhost:11434/v1" : Wt(n), K = n === "openai-compatible" ? "Base URL of your OpenAI-compatible API. Local servers must have CORS enabled." : null, ne = n === "ollama" ? "Optional for local Ollama. Stored locally and never sent to our servers." : "Your API key is stored locally and never sent to our servers.", q = _ ? _.models.reduce((e, t) => (e[t.provider] || (e[t.provider] = []), e[t.provider].push(t), e), {}) : {}, Y = _?.models.find((e) => e.id === _.selectedModelId), X = Object.keys(q), re = Y?.provider ?? X[0] ?? "", ie = re ? q[re] ?? [] : [], oe = !!f && p && (!_ || M === 1), se = () => {
|
|
1028
|
+
if (R && y) {
|
|
1029
1029
|
y();
|
|
1030
1030
|
return;
|
|
1031
1031
|
}
|
|
1032
1032
|
d();
|
|
1033
|
-
},
|
|
1034
|
-
return /* @__PURE__ */ (0, $.jsx)(
|
|
1033
|
+
}, le = R ? !!(_?.isLoading || !_?.selectedModelId || _?.models.length === 0) : Rt(n) && !i.trim() || z && !a.trim() || !r.trim();
|
|
1034
|
+
return /* @__PURE__ */ (0, $.jsx)(Fe, {
|
|
1035
1035
|
open: e,
|
|
1036
1036
|
onOpenChange: t,
|
|
1037
|
-
children: /* @__PURE__ */ (0, $.jsxs)(
|
|
1037
|
+
children: /* @__PURE__ */ (0, $.jsxs)(Pe, {
|
|
1038
1038
|
className: "max-w-md",
|
|
1039
1039
|
"data-testid": "chat-config-dialog",
|
|
1040
|
-
children: [/* @__PURE__ */ (0, $.jsxs)(
|
|
1040
|
+
children: [/* @__PURE__ */ (0, $.jsxs)(Ne, { children: [/* @__PURE__ */ (0, $.jsx)(Ae, { children: L ? "Configure Chat" : "LLM Provider Configuration" }), /* @__PURE__ */ (0, $.jsx)(je, { children: _ ? "Pick a Manufact cloud model or bring your own API key." : g ? "Chat requires an LLM. You can chat for free if you have a Manufact account, or you can use your own API key (not sent to Manufact)." : "Configure your LLM provider and API key to start chatting with the MCP server" })] }), /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
1041
1041
|
className: "space-y-4",
|
|
1042
1042
|
children: [
|
|
1043
1043
|
g && /* @__PURE__ */ (0, $.jsxs)("button", {
|
|
@@ -1094,20 +1094,20 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1094
1094
|
}),
|
|
1095
1095
|
/* @__PURE__ */ (0, $.jsxs)("div", {
|
|
1096
1096
|
className: l("space-y-2", _ && "!mt-2"),
|
|
1097
|
-
children: [/* @__PURE__ */ (0, $.jsx)(
|
|
1098
|
-
value:
|
|
1097
|
+
children: [/* @__PURE__ */ (0, $.jsx)(ae, { children: "Provider" }), R ? /* @__PURE__ */ (0, $.jsxs)(ge, {
|
|
1098
|
+
value: re,
|
|
1099
1099
|
onValueChange: (e) => {
|
|
1100
1100
|
let t = _?.models.find((t) => t.provider === e);
|
|
1101
1101
|
t && _?.onModelChange(t.id);
|
|
1102
1102
|
},
|
|
1103
|
-
children: [/* @__PURE__ */ (0, $.jsx)(
|
|
1103
|
+
children: [/* @__PURE__ */ (0, $.jsx)(ue, {
|
|
1104
1104
|
className: "rounded-md",
|
|
1105
|
-
leading:
|
|
1106
|
-
provider: ur(
|
|
1105
|
+
leading: re ? /* @__PURE__ */ (0, $.jsx)(Qe, {
|
|
1106
|
+
provider: ur(re),
|
|
1107
1107
|
className: "shrink-0"
|
|
1108
1108
|
}) : void 0,
|
|
1109
|
-
children: /* @__PURE__ */ (0, $.jsx)(
|
|
1110
|
-
}), /* @__PURE__ */ (0, $.jsx)(
|
|
1109
|
+
children: /* @__PURE__ */ (0, $.jsx)(ce, {})
|
|
1110
|
+
}), /* @__PURE__ */ (0, $.jsx)(de, { children: X.map((e) => /* @__PURE__ */ (0, $.jsx)(me, {
|
|
1111
1111
|
value: e,
|
|
1112
1112
|
label: Z(ur(e)),
|
|
1113
1113
|
children: /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
@@ -1115,18 +1115,18 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1115
1115
|
children: [/* @__PURE__ */ (0, $.jsx)(Qe, { provider: ur(e) }), /* @__PURE__ */ (0, $.jsx)("span", { children: Z(ur(e)) })]
|
|
1116
1116
|
})
|
|
1117
1117
|
}, e)) })]
|
|
1118
|
-
}) : /* @__PURE__ */ (0, $.jsxs)(
|
|
1118
|
+
}) : /* @__PURE__ */ (0, $.jsxs)(ge, {
|
|
1119
1119
|
value: n,
|
|
1120
1120
|
onValueChange: (e) => o(e),
|
|
1121
|
-
children: [/* @__PURE__ */ (0, $.jsx)(
|
|
1121
|
+
children: [/* @__PURE__ */ (0, $.jsx)(ue, {
|
|
1122
1122
|
className: "rounded-md",
|
|
1123
1123
|
leading: /* @__PURE__ */ (0, $.jsx)(Qe, {
|
|
1124
1124
|
provider: n,
|
|
1125
1125
|
className: "shrink-0"
|
|
1126
1126
|
}),
|
|
1127
|
-
children: /* @__PURE__ */ (0, $.jsx)(
|
|
1128
|
-
}), /* @__PURE__ */ (0, $.jsxs)(
|
|
1129
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
1127
|
+
children: /* @__PURE__ */ (0, $.jsx)(ce, {})
|
|
1128
|
+
}), /* @__PURE__ */ (0, $.jsxs)(de, { children: [
|
|
1129
|
+
/* @__PURE__ */ (0, $.jsx)(me, {
|
|
1130
1130
|
value: "openai",
|
|
1131
1131
|
label: Z("openai"),
|
|
1132
1132
|
children: /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
@@ -1134,7 +1134,7 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1134
1134
|
children: [/* @__PURE__ */ (0, $.jsx)(Qe, { provider: "openai" }), /* @__PURE__ */ (0, $.jsx)("span", { children: Z("openai") })]
|
|
1135
1135
|
})
|
|
1136
1136
|
}),
|
|
1137
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
1137
|
+
/* @__PURE__ */ (0, $.jsx)(me, {
|
|
1138
1138
|
value: "anthropic",
|
|
1139
1139
|
label: Z("anthropic"),
|
|
1140
1140
|
children: /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
@@ -1142,7 +1142,7 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1142
1142
|
children: [/* @__PURE__ */ (0, $.jsx)(Qe, { provider: "anthropic" }), /* @__PURE__ */ (0, $.jsx)("span", { children: Z("anthropic") })]
|
|
1143
1143
|
})
|
|
1144
1144
|
}),
|
|
1145
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
1145
|
+
/* @__PURE__ */ (0, $.jsx)(me, {
|
|
1146
1146
|
value: "google",
|
|
1147
1147
|
label: Z("google"),
|
|
1148
1148
|
children: /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
@@ -1150,7 +1150,7 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1150
1150
|
children: [/* @__PURE__ */ (0, $.jsx)(Qe, { provider: "google" }), /* @__PURE__ */ (0, $.jsx)("span", { children: Z("google") })]
|
|
1151
1151
|
})
|
|
1152
1152
|
}),
|
|
1153
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
1153
|
+
/* @__PURE__ */ (0, $.jsx)(me, {
|
|
1154
1154
|
value: "ollama",
|
|
1155
1155
|
label: Z("ollama"),
|
|
1156
1156
|
children: /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
@@ -1158,7 +1158,7 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1158
1158
|
children: [/* @__PURE__ */ (0, $.jsx)(Qe, { provider: "ollama" }), /* @__PURE__ */ (0, $.jsx)("span", { children: Z("ollama") })]
|
|
1159
1159
|
})
|
|
1160
1160
|
}),
|
|
1161
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
1161
|
+
/* @__PURE__ */ (0, $.jsx)(me, {
|
|
1162
1162
|
value: "openrouter",
|
|
1163
1163
|
label: Z("openrouter"),
|
|
1164
1164
|
children: /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
@@ -1166,7 +1166,7 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1166
1166
|
children: [/* @__PURE__ */ (0, $.jsx)(Qe, { provider: "openrouter" }), /* @__PURE__ */ (0, $.jsx)("span", { children: Z("openrouter") })]
|
|
1167
1167
|
})
|
|
1168
1168
|
}),
|
|
1169
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
1169
|
+
/* @__PURE__ */ (0, $.jsx)(me, {
|
|
1170
1170
|
value: "openai-compatible",
|
|
1171
1171
|
label: Z("openai-compatible"),
|
|
1172
1172
|
children: /* @__PURE__ */ (0, $.jsx)("div", {
|
|
@@ -1177,33 +1177,33 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1177
1177
|
] })]
|
|
1178
1178
|
})]
|
|
1179
1179
|
}),
|
|
1180
|
-
!
|
|
1180
|
+
!R && z && /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
1181
1181
|
className: "space-y-2",
|
|
1182
1182
|
children: [
|
|
1183
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
1184
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
1183
|
+
/* @__PURE__ */ (0, $.jsx)(ae, { children: "Base URL" }),
|
|
1184
|
+
/* @__PURE__ */ (0, $.jsx)(I, {
|
|
1185
1185
|
value: a,
|
|
1186
1186
|
onChange: (e) => u(e.target.value),
|
|
1187
|
-
placeholder:
|
|
1187
|
+
placeholder: W,
|
|
1188
1188
|
"data-testid": "chat-config-base-url-input"
|
|
1189
1189
|
}),
|
|
1190
|
-
|
|
1190
|
+
K && /* @__PURE__ */ (0, $.jsx)("p", {
|
|
1191
1191
|
className: "text-xs text-muted-foreground",
|
|
1192
|
-
children:
|
|
1192
|
+
children: K
|
|
1193
1193
|
})
|
|
1194
1194
|
]
|
|
1195
1195
|
}),
|
|
1196
|
-
!
|
|
1196
|
+
!R && /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
1197
1197
|
className: "space-y-2",
|
|
1198
1198
|
children: [
|
|
1199
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
1199
|
+
/* @__PURE__ */ (0, $.jsx)(ae, { children: U }),
|
|
1200
1200
|
/* @__PURE__ */ (0, $.jsxs)("div", {
|
|
1201
1201
|
className: "relative",
|
|
1202
|
-
children: [/* @__PURE__ */ (0, $.jsx)(
|
|
1202
|
+
children: [/* @__PURE__ */ (0, $.jsx)(I, {
|
|
1203
1203
|
type: A ? "text" : "password",
|
|
1204
1204
|
value: i,
|
|
1205
1205
|
onChange: (e) => c(e.target.value),
|
|
1206
|
-
placeholder:
|
|
1206
|
+
placeholder: te,
|
|
1207
1207
|
className: "pr-10",
|
|
1208
1208
|
"data-testid": "chat-config-api-key-input"
|
|
1209
1209
|
}), /* @__PURE__ */ (0, $.jsx)(F, {
|
|
@@ -1217,20 +1217,20 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1217
1217
|
}),
|
|
1218
1218
|
/* @__PURE__ */ (0, $.jsx)("p", {
|
|
1219
1219
|
className: "text-xs text-muted-foreground",
|
|
1220
|
-
children:
|
|
1220
|
+
children: ne
|
|
1221
1221
|
})
|
|
1222
1222
|
]
|
|
1223
1223
|
}),
|
|
1224
|
-
|
|
1224
|
+
R ? /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
1225
1225
|
className: "space-y-2",
|
|
1226
|
-
children: [/* @__PURE__ */ (0, $.jsx)(
|
|
1226
|
+
children: [/* @__PURE__ */ (0, $.jsx)(ae, { children: "Model" }), _?.isLoading ? /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
1227
1227
|
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
1228
1228
|
children: [/* @__PURE__ */ (0, $.jsx)(it, { className: "h-4 w-4 animate-spin" }), /* @__PURE__ */ (0, $.jsx)("span", { children: "Loading models…" })]
|
|
1229
|
-
}) :
|
|
1229
|
+
}) : ie.length > 0 ? /* @__PURE__ */ (0, $.jsxs)(J, {
|
|
1230
1230
|
open: O,
|
|
1231
1231
|
modal: !0,
|
|
1232
1232
|
onOpenChange: k,
|
|
1233
|
-
children: [/* @__PURE__ */ (0, $.jsx)(
|
|
1233
|
+
children: [/* @__PURE__ */ (0, $.jsx)(G, {
|
|
1234
1234
|
render: /* @__PURE__ */ (0, $.jsxs)(F, {
|
|
1235
1235
|
variant: "outline",
|
|
1236
1236
|
role: "combobox",
|
|
@@ -1239,23 +1239,23 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1239
1239
|
"data-testid": "chat-config-cloud-model-select",
|
|
1240
1240
|
children: [/* @__PURE__ */ (0, $.jsx)("span", {
|
|
1241
1241
|
className: "inline-flex min-w-0 items-center gap-2 truncate",
|
|
1242
|
-
children:
|
|
1243
|
-
provider: ur(
|
|
1242
|
+
children: Y ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(Qe, {
|
|
1243
|
+
provider: ur(Y.provider),
|
|
1244
1244
|
className: "shrink-0"
|
|
1245
1245
|
}), /* @__PURE__ */ (0, $.jsx)("span", {
|
|
1246
1246
|
className: "truncate",
|
|
1247
|
-
children: Ye(
|
|
1247
|
+
children: Ye(Y.name, Y.provider)
|
|
1248
1248
|
})] }) : "Select a model…"
|
|
1249
1249
|
}), /* @__PURE__ */ (0, $.jsx)($t, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })]
|
|
1250
1250
|
}),
|
|
1251
1251
|
nativeButton: !0
|
|
1252
|
-
}), /* @__PURE__ */ (0, $.jsx)(
|
|
1252
|
+
}), /* @__PURE__ */ (0, $.jsx)(H, {
|
|
1253
1253
|
className: "w-full p-0",
|
|
1254
1254
|
align: "start",
|
|
1255
1255
|
children: /* @__PURE__ */ (0, $.jsxs)(Zn, { children: [/* @__PURE__ */ (0, $.jsx)(Qn, {
|
|
1256
1256
|
placeholder: "Search models…",
|
|
1257
1257
|
className: "h-9"
|
|
1258
|
-
}), /* @__PURE__ */ (0, $.jsxs)($n, { children: [/* @__PURE__ */ (0, $.jsx)(er, { children: "No model found." }), /* @__PURE__ */ (0, $.jsx)(tr, { children:
|
|
1258
|
+
}), /* @__PURE__ */ (0, $.jsxs)($n, { children: [/* @__PURE__ */ (0, $.jsx)(er, { children: "No model found." }), /* @__PURE__ */ (0, $.jsx)(tr, { children: ie.map((e) => /* @__PURE__ */ (0, $.jsxs)(nr, {
|
|
1259
1259
|
value: e.id,
|
|
1260
1260
|
keywords: [
|
|
1261
1261
|
e.name,
|
|
@@ -1265,26 +1265,26 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1265
1265
|
onSelect: (e) => {
|
|
1266
1266
|
_?.onModelChange(e), k(!1);
|
|
1267
1267
|
},
|
|
1268
|
-
children: [Ye(e.name, e.provider), /* @__PURE__ */ (0, $.jsx)(
|
|
1268
|
+
children: [Ye(e.name, e.provider), /* @__PURE__ */ (0, $.jsx)(Le, { className: l("ml-auto h-4 w-4", _?.selectedModelId === e.id ? "opacity-100" : "opacity-0") })]
|
|
1269
1269
|
}, e.id)) })] })] })
|
|
1270
1270
|
})]
|
|
1271
1271
|
}) : /* @__PURE__ */ (0, $.jsx)("p", {
|
|
1272
1272
|
className: "text-sm text-muted-foreground",
|
|
1273
1273
|
children: "Cloud models unavailable — try again or use your own key."
|
|
1274
1274
|
})]
|
|
1275
|
-
}) :
|
|
1275
|
+
}) : V && /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
1276
1276
|
className: "space-y-2",
|
|
1277
|
-
children: [/* @__PURE__ */ (0, $.jsx)(
|
|
1277
|
+
children: [/* @__PURE__ */ (0, $.jsx)(ae, { children: "Model" }), S ? /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
1278
1278
|
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
1279
1279
|
children: [/* @__PURE__ */ (0, $.jsx)(it, { className: "h-4 w-4 animate-spin" }), /* @__PURE__ */ (0, $.jsx)("span", { children: "Loading models..." })]
|
|
1280
1280
|
}) : w ? /* @__PURE__ */ (0, $.jsx)("div", {
|
|
1281
1281
|
className: "text-sm text-destructive",
|
|
1282
1282
|
children: w
|
|
1283
|
-
}) : b.length > 0 ? /* @__PURE__ */ (0, $.jsxs)(
|
|
1283
|
+
}) : b.length > 0 ? /* @__PURE__ */ (0, $.jsxs)(J, {
|
|
1284
1284
|
open: E,
|
|
1285
1285
|
modal: !0,
|
|
1286
1286
|
onOpenChange: D,
|
|
1287
|
-
children: [/* @__PURE__ */ (0, $.jsx)(
|
|
1287
|
+
children: [/* @__PURE__ */ (0, $.jsx)(G, {
|
|
1288
1288
|
render: /* @__PURE__ */ (0, $.jsxs)(F, {
|
|
1289
1289
|
variant: "outline",
|
|
1290
1290
|
role: "combobox",
|
|
@@ -1297,7 +1297,7 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1297
1297
|
}), /* @__PURE__ */ (0, $.jsx)($t, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })]
|
|
1298
1298
|
}),
|
|
1299
1299
|
nativeButton: !0
|
|
1300
|
-
}), /* @__PURE__ */ (0, $.jsx)(
|
|
1300
|
+
}), /* @__PURE__ */ (0, $.jsx)(H, {
|
|
1301
1301
|
className: "w-full p-0",
|
|
1302
1302
|
align: "start",
|
|
1303
1303
|
children: /* @__PURE__ */ (0, $.jsxs)(Zn, { children: [/* @__PURE__ */ (0, $.jsx)(Qn, {
|
|
@@ -1309,10 +1309,10 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1309
1309
|
onSelect: (e) => {
|
|
1310
1310
|
s(e === r ? "" : e), D(!1);
|
|
1311
1311
|
},
|
|
1312
|
-
children: [e.displayName || e.id, /* @__PURE__ */ (0, $.jsx)(
|
|
1312
|
+
children: [e.displayName || e.id, /* @__PURE__ */ (0, $.jsx)(Le, { className: l("ml-auto h-4 w-4", r === e.id ? "opacity-100" : "opacity-0") })]
|
|
1313
1313
|
}, e.id)) })] })] })
|
|
1314
1314
|
})]
|
|
1315
|
-
}) : /* @__PURE__ */ (0, $.jsx)(
|
|
1315
|
+
}) : /* @__PURE__ */ (0, $.jsx)(I, {
|
|
1316
1316
|
value: r,
|
|
1317
1317
|
onChange: (e) => s(e.target.value),
|
|
1318
1318
|
placeholder: "Enter model name manually",
|
|
@@ -1321,14 +1321,14 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1321
1321
|
}),
|
|
1322
1322
|
/* @__PURE__ */ (0, $.jsxs)("div", {
|
|
1323
1323
|
className: "flex justify-between",
|
|
1324
|
-
children: [
|
|
1324
|
+
children: [oe && /* @__PURE__ */ (0, $.jsx)(F, {
|
|
1325
1325
|
variant: "outline",
|
|
1326
1326
|
onClick: f,
|
|
1327
1327
|
children: "Clear Config"
|
|
1328
1328
|
}), /* @__PURE__ */ (0, $.jsxs)(F, {
|
|
1329
|
-
onClick:
|
|
1330
|
-
disabled:
|
|
1331
|
-
className:
|
|
1329
|
+
onClick: se,
|
|
1330
|
+
disabled: le,
|
|
1331
|
+
className: oe ? "ml-auto" : "",
|
|
1332
1332
|
"data-testid": "chat-config-save-button",
|
|
1333
1333
|
children: [/* @__PURE__ */ (0, $.jsx)(Ze, { className: "h-4 w-4 mr-2" }), "Save Configuration"]
|
|
1334
1334
|
})]
|
|
@@ -1341,24 +1341,24 @@ function _r({ open: e, onOpenChange: t, tempProvider: n, tempModel: r, tempApiKe
|
|
|
1341
1341
|
//#endregion
|
|
1342
1342
|
//#region src/client/components/chat/chat-bar-styles.ts
|
|
1343
1343
|
var vr = "rounded-full bg-background/80 backdrop-blur-md supports-[backdrop-filter]:bg-background/60 dark:bg-zinc-950/75 dark:supports-[backdrop-filter]:bg-zinc-950/55", yr = l(vr, "w-fit"), br = l(vr, "h-9 gap-1.5 px-3"), xr = "chat-view";
|
|
1344
|
-
function Sr({ llmConfig: e, hasMessages: t, configDialogOpen: n, onConfigDialogOpenChange: r, onClearChat: i, tempProvider: a, tempModel: o, tempApiKey: s, tempBaseUrl: c, onProviderChange: u, onModelChange: d, onApiKeyChange: f, onBaseUrlChange: p, onSaveConfig: m, onClearConfig: g, hideConfigButton: _, hostedInspector: v, freeTierInfo: y, managedCloudInfo: b, useManagedCloud: x, onSaveManagedCloud: S, showClearButton: C, clearButtonLabel: w, hideTitle: T, clearButtonHideIcon: E, clearButtonHideShortcut: D, clearButtonVariant: k, hideClearButton: A, onCopyChat: j, onExportChat: M, activeChatId: P, chatTitle:
|
|
1344
|
+
function Sr({ llmConfig: e, hasMessages: t, configDialogOpen: n, onConfigDialogOpenChange: r, onClearChat: i, tempProvider: a, tempModel: o, tempApiKey: s, tempBaseUrl: c, onProviderChange: u, onModelChange: d, onApiKeyChange: f, onBaseUrlChange: p, onSaveConfig: m, onClearConfig: g, hideConfigButton: _, hostedInspector: v, freeTierInfo: y, managedCloudInfo: b, useManagedCloud: x, onSaveManagedCloud: S, showClearButton: C, clearButtonLabel: w, hideTitle: T, clearButtonHideIcon: E, clearButtonHideShortcut: D, clearButtonVariant: k, hideClearButton: A, onCopyChat: j, onExportChat: M, activeChatId: P, chatTitle: I, showViewToggle: R, viewIndex: ee = 0, onViewIndexChange: z, elevatedHeader: V }) {
|
|
1345
1345
|
return /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
1346
|
-
className: l("relative flex w-full items-center gap-2 overflow-visible",
|
|
1346
|
+
className: l("relative flex w-full items-center gap-2 overflow-visible", L, V ? "pointer-events-none absolute top-0 right-0 z-50" : "absolute top-0 right-0 z-10"),
|
|
1347
1347
|
children: [
|
|
1348
1348
|
/* @__PURE__ */ (0, $.jsx)("div", {
|
|
1349
|
-
className: l("flex min-w-0 flex-1 items-center",
|
|
1349
|
+
className: l("flex min-w-0 flex-1 items-center", V && "pointer-events-auto"),
|
|
1350
1350
|
children: !T && /* @__PURE__ */ (0, $.jsx)("h2", {
|
|
1351
1351
|
className: l("text-[15px] text-foreground [font-variation-settings:'wght'_550,'opsz'_20]", yr),
|
|
1352
1352
|
children: P ? /* @__PURE__ */ (0, $.jsx)(Cn, {
|
|
1353
1353
|
chatId: P,
|
|
1354
|
-
title:
|
|
1354
|
+
title: I ?? "Chat"
|
|
1355
1355
|
}, P) : "Chat"
|
|
1356
1356
|
})
|
|
1357
1357
|
}),
|
|
1358
|
-
|
|
1359
|
-
className: l("absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 overflow-visible px-1",
|
|
1358
|
+
R && z && /* @__PURE__ */ (0, $.jsx)("div", {
|
|
1359
|
+
className: l("absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 overflow-visible px-1", V && "pointer-events-auto"),
|
|
1360
1360
|
children: /* @__PURE__ */ (0, $.jsxs)(It, {
|
|
1361
|
-
selectedIndex:
|
|
1361
|
+
selectedIndex: ee,
|
|
1362
1362
|
onSelect: z,
|
|
1363
1363
|
idPrefix: xr,
|
|
1364
1364
|
className: "shrink-0 overflow-visible",
|
|
@@ -1373,7 +1373,7 @@ function Sr({ llmConfig: e, hasMessages: t, configDialogOpen: n, onConfigDialogO
|
|
|
1373
1373
|
})
|
|
1374
1374
|
}),
|
|
1375
1375
|
/* @__PURE__ */ (0, $.jsxs)("div", {
|
|
1376
|
-
className: l("ml-auto flex shrink-0 items-center gap-2",
|
|
1376
|
+
className: l("ml-auto flex shrink-0 items-center gap-2", V && "pointer-events-auto"),
|
|
1377
1377
|
children: [!A && t && /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
1378
1378
|
className: "flex items-center gap-1",
|
|
1379
1379
|
children: [
|
|
@@ -1383,30 +1383,30 @@ function Sr({ llmConfig: e, hasMessages: t, configDialogOpen: n, onConfigDialogO
|
|
|
1383
1383
|
size: "sm",
|
|
1384
1384
|
className: br,
|
|
1385
1385
|
onClick: j,
|
|
1386
|
-
children: [/* @__PURE__ */ (0, $.jsx)(
|
|
1386
|
+
children: [/* @__PURE__ */ (0, $.jsx)(Re, { className: "h-4 w-4" }), /* @__PURE__ */ (0, $.jsx)("span", {
|
|
1387
1387
|
className: "hidden sm:inline",
|
|
1388
1388
|
children: "Copy"
|
|
1389
1389
|
})]
|
|
1390
1390
|
}),
|
|
1391
|
-
M && /* @__PURE__ */ (0, $.jsxs)(
|
|
1391
|
+
M && /* @__PURE__ */ (0, $.jsxs)(X, { children: [/* @__PURE__ */ (0, $.jsx)(B, {
|
|
1392
1392
|
render: /* @__PURE__ */ (0, $.jsxs)(F, {
|
|
1393
1393
|
"data-testid": "chat-export-button",
|
|
1394
1394
|
variant: "ghost",
|
|
1395
1395
|
size: "sm",
|
|
1396
1396
|
className: br,
|
|
1397
|
-
children: [/* @__PURE__ */ (0, $.jsx)(
|
|
1397
|
+
children: [/* @__PURE__ */ (0, $.jsx)(Be, { className: "h-4 w-4" }), /* @__PURE__ */ (0, $.jsx)("span", {
|
|
1398
1398
|
className: "hidden sm:inline",
|
|
1399
1399
|
children: "Export"
|
|
1400
1400
|
})]
|
|
1401
1401
|
}),
|
|
1402
1402
|
nativeButton: !0
|
|
1403
|
-
}), /* @__PURE__ */ (0, $.jsxs)(
|
|
1403
|
+
}), /* @__PURE__ */ (0, $.jsxs)(U, {
|
|
1404
1404
|
align: "end",
|
|
1405
|
-
children: [/* @__PURE__ */ (0, $.jsx)(
|
|
1405
|
+
children: [/* @__PURE__ */ (0, $.jsx)(te, {
|
|
1406
1406
|
"data-testid": "chat-export-json",
|
|
1407
1407
|
onClick: () => M("json"),
|
|
1408
1408
|
children: "Export as JSON"
|
|
1409
|
-
}), /* @__PURE__ */ (0, $.jsx)(
|
|
1409
|
+
}), /* @__PURE__ */ (0, $.jsx)(te, {
|
|
1410
1410
|
"data-testid": "chat-export-markdown",
|
|
1411
1411
|
onClick: () => M("markdown"),
|
|
1412
1412
|
children: "Export as Markdown"
|
|
@@ -1472,11 +1472,11 @@ function Cr({ tools: e, disabledTools: t, onDisabledToolsChange: n, disabled: r
|
|
|
1472
1472
|
e,
|
|
1473
1473
|
n
|
|
1474
1474
|
]), f = (0, Q.useMemo)(() => [...e].sort((e, t) => e.name.localeCompare(t.name)), [e]);
|
|
1475
|
-
return e.length === 0 ? null : /* @__PURE__ */ (0, $.jsxs)(
|
|
1475
|
+
return e.length === 0 ? null : /* @__PURE__ */ (0, $.jsxs)(J, {
|
|
1476
1476
|
open: i,
|
|
1477
1477
|
onOpenChange: a,
|
|
1478
1478
|
children: [/* @__PURE__ */ (0, $.jsxs)(O, { children: [/* @__PURE__ */ (0, $.jsx)(h, {
|
|
1479
|
-
render: /* @__PURE__ */ (0, $.jsx)(
|
|
1479
|
+
render: /* @__PURE__ */ (0, $.jsx)(G, {
|
|
1480
1480
|
render: /* @__PURE__ */ (0, $.jsxs)(F, {
|
|
1481
1481
|
variant: "ghost",
|
|
1482
1482
|
size: "sm",
|
|
@@ -1501,7 +1501,7 @@ function Cr({ tools: e, disabledTools: t, onDisabledToolsChange: n, disabled: r
|
|
|
1501
1501
|
e.length,
|
|
1502
1502
|
")"
|
|
1503
1503
|
] })
|
|
1504
|
-
})] }), /* @__PURE__ */ (0, $.jsxs)(
|
|
1504
|
+
})] }), /* @__PURE__ */ (0, $.jsxs)(H, {
|
|
1505
1505
|
className: "w-72 gap-0 p-0",
|
|
1506
1506
|
align: "start",
|
|
1507
1507
|
side: "top",
|
|
@@ -1561,7 +1561,7 @@ function wr({ inputValue: e, isConnected: t, isLoading: n, textareaRef: r, attac
|
|
|
1561
1561
|
className: "relative group bg-zinc-100/90 dark:bg-zinc-900/90 backdrop-blur-sm rounded-lg p-2 flex items-center gap-2 border border-zinc-200 dark:border-zinc-700",
|
|
1562
1562
|
"data-testid": `chat-attachment-${t}`,
|
|
1563
1563
|
children: [
|
|
1564
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
1564
|
+
/* @__PURE__ */ (0, $.jsx)(De, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
1565
1565
|
/* @__PURE__ */ (0, $.jsxs)("div", {
|
|
1566
1566
|
className: "flex flex-col min-w-0",
|
|
1567
1567
|
children: [/* @__PURE__ */ (0, $.jsx)("span", {
|
|
@@ -1569,7 +1569,7 @@ function wr({ inputValue: e, isConnected: t, isLoading: n, textareaRef: r, attac
|
|
|
1569
1569
|
children: e.name || "Image"
|
|
1570
1570
|
}), e.size && /* @__PURE__ */ (0, $.jsx)("span", {
|
|
1571
1571
|
className: "text-xs text-muted-foreground",
|
|
1572
|
-
children:
|
|
1572
|
+
children: Ve(e.size)
|
|
1573
1573
|
})]
|
|
1574
1574
|
}),
|
|
1575
1575
|
/* @__PURE__ */ (0, $.jsx)("button", {
|
|
@@ -1730,20 +1730,20 @@ function Ar() {
|
|
|
1730
1730
|
}
|
|
1731
1731
|
//#endregion
|
|
1732
1732
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/radio-group/RadioGroup.mjs
|
|
1733
|
-
var jr = [
|
|
1734
|
-
let { render: n, className: r, disabled: i, readOnly: a, required: s, onValueChange: c, value: l, defaultValue: u, form: d, name: f, inputRef: p, id: m, style: h, ...g } = e, { setTouched: _, setFocused: v, validationMode: y, name: b, disabled: x, state: S, validation: C, setDirty: w, setFilled: T, validityData: D } =
|
|
1733
|
+
var jr = [oe], Mr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
1734
|
+
let { render: n, className: r, disabled: i, readOnly: a, required: s, onValueChange: c, value: l, defaultValue: u, form: d, name: f, inputRef: p, id: m, style: h, ...g } = e, { setTouched: _, setFocused: v, validationMode: y, name: b, disabled: x, state: S, validation: C, setDirty: w, setFilled: T, validityData: D } = Se(), { labelId: O } = Ce(), { clearErrors: k } = Te(), A = Or(!0), j = x || i, M = b ?? f, N = o(m), [P, F] = ie({
|
|
1735
1735
|
controlled: l,
|
|
1736
1736
|
default: u,
|
|
1737
1737
|
name: "RadioGroup",
|
|
1738
1738
|
state: "value"
|
|
1739
|
-
}), [
|
|
1739
|
+
}), [I, L] = Q.useState(!1), ee = R((e, t) => {
|
|
1740
1740
|
c?.(e, t), !t.isCanceled && F(e);
|
|
1741
|
-
}), z = Q.useRef(null),
|
|
1742
|
-
function
|
|
1741
|
+
}), z = Q.useRef(null), B = Q.useRef(null), V = Q.useRef(null);
|
|
1742
|
+
function H(e) {
|
|
1743
1743
|
let t;
|
|
1744
|
-
return p && (typeof p == "function" ? t = p(e) : p.current = e),
|
|
1744
|
+
return p && (typeof p == "function" ? t = p(e) : p.current = e), B.current = e, C.inputRef.current = e, t;
|
|
1745
1745
|
}
|
|
1746
|
-
let
|
|
1746
|
+
let U = R((e, t = !1) => {
|
|
1747
1747
|
if (e) {
|
|
1748
1748
|
if (t) {
|
|
1749
1749
|
z.current === e && (z.current = null);
|
|
@@ -1751,26 +1751,26 @@ var jr = [se], Mr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
|
1751
1751
|
}
|
|
1752
1752
|
z.current ??= e;
|
|
1753
1753
|
}
|
|
1754
|
-
}),
|
|
1754
|
+
}), te = R((e) => {
|
|
1755
1755
|
if (!e || e.disabled) return;
|
|
1756
|
-
|
|
1757
|
-
let t =
|
|
1758
|
-
if (e.checked || t == null || t.disabled) return
|
|
1759
|
-
}),
|
|
1760
|
-
let e =
|
|
1756
|
+
V.current ||= e;
|
|
1757
|
+
let t = B.current;
|
|
1758
|
+
if (e.checked || t == null || t.disabled) return H(e);
|
|
1759
|
+
}), W = R(() => {
|
|
1760
|
+
let e = B.current;
|
|
1761
1761
|
return !e || e.disabled || !e.checked ? null : P ?? null;
|
|
1762
1762
|
});
|
|
1763
|
-
|
|
1763
|
+
ye(z, N, P ?? null, W, !j, f), be(P, () => {
|
|
1764
1764
|
k(M), w(P !== D.initialValue), T(P != null), C.change(P);
|
|
1765
|
-
let e =
|
|
1766
|
-
P == null && e && !e.disabled &&
|
|
1765
|
+
let e = V.current;
|
|
1766
|
+
P == null && e && !e.disabled && H(e);
|
|
1767
1767
|
});
|
|
1768
|
-
let
|
|
1768
|
+
let G = g["aria-labelledby"] ?? O ?? A?.legendId, K = {
|
|
1769
1769
|
...S,
|
|
1770
1770
|
disabled: j ?? !1,
|
|
1771
1771
|
required: s ?? !1,
|
|
1772
1772
|
readOnly: a ?? !1
|
|
1773
|
-
},
|
|
1773
|
+
}, ne = Q.useMemo(() => ({
|
|
1774
1774
|
...S,
|
|
1775
1775
|
checkedValue: P,
|
|
1776
1776
|
disabled: j,
|
|
@@ -1778,12 +1778,12 @@ var jr = [se], Mr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
|
1778
1778
|
validation: C,
|
|
1779
1779
|
name: M,
|
|
1780
1780
|
readOnly: a,
|
|
1781
|
-
registerControlRef:
|
|
1782
|
-
registerInputRef:
|
|
1781
|
+
registerControlRef: U,
|
|
1782
|
+
registerInputRef: te,
|
|
1783
1783
|
required: s,
|
|
1784
|
-
setCheckedValue:
|
|
1785
|
-
setTouched:
|
|
1786
|
-
touched:
|
|
1784
|
+
setCheckedValue: ee,
|
|
1785
|
+
setTouched: L,
|
|
1786
|
+
touched: I
|
|
1787
1787
|
}), [
|
|
1788
1788
|
P,
|
|
1789
1789
|
j,
|
|
@@ -1792,19 +1792,19 @@ var jr = [se], Mr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
|
1792
1792
|
S,
|
|
1793
1793
|
M,
|
|
1794
1794
|
a,
|
|
1795
|
-
|
|
1796
|
-
|
|
1795
|
+
U,
|
|
1796
|
+
te,
|
|
1797
1797
|
s,
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
]),
|
|
1798
|
+
ee,
|
|
1799
|
+
L,
|
|
1800
|
+
I
|
|
1801
|
+
]), q = {
|
|
1802
1802
|
id: m,
|
|
1803
1803
|
role: "radiogroup",
|
|
1804
1804
|
"aria-required": s || void 0,
|
|
1805
1805
|
"aria-disabled": j || void 0,
|
|
1806
1806
|
"aria-readonly": a || void 0,
|
|
1807
|
-
"aria-labelledby":
|
|
1807
|
+
"aria-labelledby": G,
|
|
1808
1808
|
onFocus() {
|
|
1809
1809
|
v(!0);
|
|
1810
1810
|
},
|
|
@@ -1812,23 +1812,23 @@ var jr = [se], Mr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
|
1812
1812
|
E(e.currentTarget, e.relatedTarget) || (_(!0), v(!1), y === "onBlur" && C.commit(P));
|
|
1813
1813
|
},
|
|
1814
1814
|
onKeyDownCapture(e) {
|
|
1815
|
-
e.key.startsWith("Arrow") && (
|
|
1815
|
+
e.key.startsWith("Arrow") && (L(!0), v(!0));
|
|
1816
1816
|
}
|
|
1817
1817
|
};
|
|
1818
1818
|
return /*#__PURE__*/ (0, $.jsx)(kr.Provider, {
|
|
1819
|
-
value:
|
|
1819
|
+
value: ne,
|
|
1820
1820
|
children: /*#__PURE__*/ (0, $.jsx)(Pt, {
|
|
1821
1821
|
render: n,
|
|
1822
1822
|
className: r,
|
|
1823
1823
|
style: h,
|
|
1824
|
-
state:
|
|
1824
|
+
state: K,
|
|
1825
1825
|
props: [
|
|
1826
|
-
|
|
1826
|
+
q,
|
|
1827
1827
|
g,
|
|
1828
1828
|
(e) => C.getValidationProps(j ?? !1, e)
|
|
1829
1829
|
],
|
|
1830
1830
|
refs: [t],
|
|
1831
|
-
stateAttributesMapping:
|
|
1831
|
+
stateAttributesMapping: ve,
|
|
1832
1832
|
enableHomeAndEndKeys: !1,
|
|
1833
1833
|
modifierKeys: jr
|
|
1834
1834
|
})
|
|
@@ -1844,50 +1844,50 @@ var Nr = /*#__PURE__*/ function(e) {
|
|
|
1844
1844
|
return e ? { [Nr.checked]: "" } : { [Nr.unchecked]: "" };
|
|
1845
1845
|
},
|
|
1846
1846
|
...A,
|
|
1847
|
-
...
|
|
1847
|
+
...ve
|
|
1848
1848
|
}, Fr = /*#__PURE__*/ Q.createContext(void 0);
|
|
1849
1849
|
process.env.NODE_ENV !== "production" && (Fr.displayName = "RadioRootContext");
|
|
1850
1850
|
//#endregion
|
|
1851
1851
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/radio/root/RadioRoot.mjs
|
|
1852
1852
|
var Ir = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
1853
|
-
let { render: n, className: r, disabled: i = !1, readOnly: c = !1, required: l = !1, "aria-labelledby": d, value: f, inputRef: h, nativeButton: _ = !1, id: v, style: y, ...x } = e, S = Ar(), { disabled: T, readOnly: E, required: O, form: k, checkedValue: A, touched: j = !1, validation: N, name: P } = S ?? {}, F = S?.setCheckedValue ?? D,
|
|
1854
|
-
e &&
|
|
1855
|
-
}),
|
|
1853
|
+
let { render: n, className: r, disabled: i = !1, readOnly: c = !1, required: l = !1, "aria-labelledby": d, value: f, inputRef: h, nativeButton: _ = !1, id: v, style: y, ...x } = e, S = Ar(), { disabled: T, readOnly: E, required: O, form: k, checkedValue: A, touched: j = !1, validation: N, name: P } = S ?? {}, F = S?.setCheckedValue ?? D, I = S?.setTouched ?? D, L = S?.registerControlRef ?? D, ee = S?.registerInputRef ?? D, { setTouched: z, setFilled: B, state: V, disabled: H } = Se(), U = xt(), { labelId: te, getDescriptionProps: W } = Ce(), G = H || U.disabled || T || i, K = E || c, ne = O || l, q = k, J = S ? A === f : f === "", Y = Q.useRef(null), X = Q.useRef(null), ie = R((e) => {
|
|
1854
|
+
e && L(e, G);
|
|
1855
|
+
}), ae = C(h, X, ee);
|
|
1856
1856
|
u(() => {
|
|
1857
|
-
|
|
1858
|
-
}, [
|
|
1859
|
-
if (
|
|
1860
|
-
if (
|
|
1861
|
-
|
|
1857
|
+
X.current?.checked && B(!0);
|
|
1858
|
+
}, [B]), u(() => {
|
|
1859
|
+
if (X.current) {
|
|
1860
|
+
if (G && J) {
|
|
1861
|
+
ee(null);
|
|
1862
1862
|
return;
|
|
1863
1863
|
}
|
|
1864
|
-
|
|
1864
|
+
Y.current && L(Y.current, G), ee(X.current);
|
|
1865
1865
|
}
|
|
1866
1866
|
}, [
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1867
|
+
J,
|
|
1868
|
+
G,
|
|
1869
|
+
L,
|
|
1870
|
+
ee
|
|
1871
1871
|
]);
|
|
1872
|
-
let
|
|
1872
|
+
let oe = o(), se = le({
|
|
1873
1873
|
id: v,
|
|
1874
1874
|
implicit: !1,
|
|
1875
|
-
controlRef:
|
|
1876
|
-
}),
|
|
1875
|
+
controlRef: Y
|
|
1876
|
+
}), ce = _ ? void 0 : se, ue = bt(d, te, X, !_, ce), de = {
|
|
1877
1877
|
role: "radio",
|
|
1878
|
-
"aria-checked":
|
|
1879
|
-
"aria-required":
|
|
1880
|
-
"aria-readonly":
|
|
1881
|
-
"aria-labelledby":
|
|
1882
|
-
[Nt]:
|
|
1883
|
-
id: _ ?
|
|
1878
|
+
"aria-checked": J,
|
|
1879
|
+
"aria-required": ne || void 0,
|
|
1880
|
+
"aria-readonly": K || void 0,
|
|
1881
|
+
"aria-labelledby": ue,
|
|
1882
|
+
[Nt]: J ? "" : void 0,
|
|
1883
|
+
id: _ ? se : oe,
|
|
1884
1884
|
onKeyDown(e) {
|
|
1885
1885
|
e.key === "Enter" && e.preventDefault();
|
|
1886
1886
|
},
|
|
1887
1887
|
onClick(e) {
|
|
1888
|
-
if (e.defaultPrevented ||
|
|
1888
|
+
if (e.defaultPrevented || G || K) return;
|
|
1889
1889
|
e.preventDefault();
|
|
1890
|
-
let t =
|
|
1890
|
+
let t = X.current;
|
|
1891
1891
|
t && t.dispatchEvent(new (s(t)).PointerEvent("click", {
|
|
1892
1892
|
bubbles: !0,
|
|
1893
1893
|
shiftKey: e.shiftKey,
|
|
@@ -1897,77 +1897,77 @@ var Ir = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
|
1897
1897
|
}));
|
|
1898
1898
|
},
|
|
1899
1899
|
onFocus(e) {
|
|
1900
|
-
e.defaultPrevented ||
|
|
1900
|
+
e.defaultPrevented || G || K || !j || (X.current?.click(), I(!1));
|
|
1901
1901
|
}
|
|
1902
|
-
}, { getButtonProps:
|
|
1903
|
-
disabled:
|
|
1902
|
+
}, { getButtonProps: fe, buttonRef: pe } = m({
|
|
1903
|
+
disabled: G,
|
|
1904
1904
|
native: _,
|
|
1905
1905
|
composite: !1
|
|
1906
|
-
}),
|
|
1906
|
+
}), me = {
|
|
1907
1907
|
type: "radio",
|
|
1908
|
-
ref:
|
|
1909
|
-
form:
|
|
1910
|
-
id:
|
|
1908
|
+
ref: ae,
|
|
1909
|
+
form: q,
|
|
1910
|
+
id: ce,
|
|
1911
1911
|
name: P,
|
|
1912
1912
|
tabIndex: -1,
|
|
1913
1913
|
style: P ? g : w,
|
|
1914
1914
|
"aria-hidden": !0,
|
|
1915
|
-
...f === void 0 ? M : { value:
|
|
1916
|
-
disabled:
|
|
1917
|
-
checked:
|
|
1918
|
-
required:
|
|
1919
|
-
readOnly:
|
|
1915
|
+
...f === void 0 ? M : { value: he(f) },
|
|
1916
|
+
disabled: G,
|
|
1917
|
+
checked: J,
|
|
1918
|
+
required: ne,
|
|
1919
|
+
readOnly: K,
|
|
1920
1920
|
onChange(e) {
|
|
1921
|
-
if (e.nativeEvent.defaultPrevented ||
|
|
1921
|
+
if (e.nativeEvent.defaultPrevented || G || K || f === void 0) return;
|
|
1922
1922
|
let t = a(p, e.nativeEvent);
|
|
1923
1923
|
F(f, t), !t.isCanceled && z(!0);
|
|
1924
1924
|
},
|
|
1925
1925
|
onFocus() {
|
|
1926
|
-
|
|
1926
|
+
Y.current?.focus();
|
|
1927
1927
|
}
|
|
1928
|
-
},
|
|
1929
|
-
...
|
|
1930
|
-
required:
|
|
1931
|
-
disabled:
|
|
1932
|
-
readOnly:
|
|
1933
|
-
checked:
|
|
1928
|
+
}, ge = Q.useMemo(() => ({
|
|
1929
|
+
...V,
|
|
1930
|
+
required: ne,
|
|
1931
|
+
disabled: G,
|
|
1932
|
+
readOnly: K,
|
|
1933
|
+
checked: J
|
|
1934
1934
|
}), [
|
|
1935
|
-
|
|
1936
|
-
W,
|
|
1935
|
+
V,
|
|
1937
1936
|
G,
|
|
1938
|
-
|
|
1939
|
-
re
|
|
1940
|
-
]), ve = _e, ye = S !== void 0, be = [
|
|
1941
|
-
t,
|
|
1937
|
+
K,
|
|
1942
1938
|
J,
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
x,
|
|
1939
|
+
ne
|
|
1940
|
+
]), _e = ge, ve = S !== void 0, ye = [
|
|
1941
|
+
t,
|
|
1942
|
+
Y,
|
|
1948
1943
|
pe,
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1944
|
+
ie
|
|
1945
|
+
], be = [
|
|
1946
|
+
de,
|
|
1947
|
+
x,
|
|
1948
|
+
fe,
|
|
1949
|
+
W,
|
|
1950
|
+
N ? (e) => N.getValidationProps(G, e) : M
|
|
1951
|
+
], xe = b("span", e, {
|
|
1952
|
+
enabled: !ve,
|
|
1953
|
+
state: ge,
|
|
1954
|
+
ref: ye,
|
|
1955
|
+
props: be,
|
|
1956
1956
|
stateAttributesMapping: Pr
|
|
1957
1957
|
});
|
|
1958
1958
|
return /*#__PURE__*/ (0, $.jsxs)(Fr.Provider, {
|
|
1959
|
-
value:
|
|
1960
|
-
children: [
|
|
1959
|
+
value: _e,
|
|
1960
|
+
children: [ve ? /*#__PURE__*/ (0, $.jsx)(re, {
|
|
1961
1961
|
tag: "span",
|
|
1962
1962
|
render: n,
|
|
1963
1963
|
className: r,
|
|
1964
1964
|
style: y,
|
|
1965
|
-
state:
|
|
1966
|
-
refs:
|
|
1967
|
-
props:
|
|
1965
|
+
state: ge,
|
|
1966
|
+
refs: ye,
|
|
1967
|
+
props: be,
|
|
1968
1968
|
stateAttributesMapping: Pr
|
|
1969
|
-
}) :
|
|
1970
|
-
...
|
|
1969
|
+
}) : xe, /*#__PURE__*/ (0, $.jsx)("input", {
|
|
1970
|
+
...me,
|
|
1971
1971
|
suppressHydrationWarning: !0
|
|
1972
1972
|
})]
|
|
1973
1973
|
});
|
|
@@ -1977,7 +1977,7 @@ process.env.NODE_ENV !== "production" && (Ir.displayName = "RadioRoot");
|
|
|
1977
1977
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/checkbox-group/useCheckboxGroupParent.mjs
|
|
1978
1978
|
var Lr = [];
|
|
1979
1979
|
function Rr(e) {
|
|
1980
|
-
let { allValues: t = Lr, value: n = Lr, onValueChange: r } = e, i = Q.useRef(n), a = Q.useRef(/* @__PURE__ */ new Map()), [s, c] = Q.useState("mixed"), l = o(), u = n.length === t.length, d = n.length !== t.length && n.length > 0, f =
|
|
1980
|
+
let { allValues: t = Lr, value: n = Lr, onValueChange: r } = e, i = Q.useRef(n), a = Q.useRef(/* @__PURE__ */ new Map()), [s, c] = Q.useState("mixed"), l = o(), u = n.length === t.length, d = n.length !== t.length && n.length > 0, f = R(r), p = Q.useCallback(() => ({
|
|
1981
1981
|
id: l,
|
|
1982
1982
|
indeterminate: d,
|
|
1983
1983
|
checked: u,
|
|
@@ -2022,14 +2022,14 @@ function Rr(e) {
|
|
|
2022
2022
|
//#endregion
|
|
2023
2023
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/checkbox-group/CheckboxGroup.mjs
|
|
2024
2024
|
var zr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
2025
|
-
let { allValues: n, className: r, defaultValue: i, disabled: a = !1, id: s, onValueChange: c, render: l, value: u, style: d, ...f } = e, { disabled: p, name: m, state: h, validation: g, setFilled: _, setDirty: v, validityData: y } =
|
|
2025
|
+
let { allValues: n, className: r, defaultValue: i, disabled: a = !1, id: s, onValueChange: c, render: l, value: u, style: d, ...f } = e, { disabled: p, name: m, state: h, validation: g, setFilled: _, setDirty: v, validityData: y } = Se(), { labelId: x, getDescriptionProps: C } = Ce(), { clearErrors: w } = Te(), T = p || a, E = Q.useMemo(() => {
|
|
2026
2026
|
if (u === void 0) return i ?? [];
|
|
2027
|
-
}, [u, i]), [D, O] =
|
|
2027
|
+
}, [u, i]), [D, O] = ie({
|
|
2028
2028
|
controlled: u,
|
|
2029
2029
|
default: E,
|
|
2030
2030
|
name: "CheckboxGroup",
|
|
2031
2031
|
state: "value"
|
|
2032
|
-
}), k =
|
|
2032
|
+
}), k = R((e, t) => {
|
|
2033
2033
|
c?.(e, t), !t.isCanceled && O(e);
|
|
2034
2034
|
}), A = Rr({
|
|
2035
2035
|
allValues: n,
|
|
@@ -2038,17 +2038,17 @@ var zr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
|
2038
2038
|
}), j = o(s), M = Q.useRef(null), N = Q.useCallback((e) => {
|
|
2039
2039
|
M.current == null && e != null && !e.hasAttribute("data-parent") && (M.current = e);
|
|
2040
2040
|
}, []);
|
|
2041
|
-
|
|
2041
|
+
ye(M, j, D, void 0, !!m && !T, m);
|
|
2042
2042
|
let P = D ?? S;
|
|
2043
|
-
|
|
2043
|
+
be(P, () => {
|
|
2044
2044
|
m && w(m);
|
|
2045
2045
|
let e = Array.isArray(y.initialValue) ? y.initialValue : S;
|
|
2046
|
-
_(P.length > 0), v(!
|
|
2046
|
+
_(P.length > 0), v(!fe(P, e)), g.change(P);
|
|
2047
2047
|
});
|
|
2048
2048
|
let F = {
|
|
2049
2049
|
...h,
|
|
2050
2050
|
disabled: T
|
|
2051
|
-
},
|
|
2051
|
+
}, I = Q.useMemo(() => ({
|
|
2052
2052
|
allValues: n,
|
|
2053
2053
|
value: D,
|
|
2054
2054
|
defaultValue: E,
|
|
@@ -2066,7 +2066,7 @@ var zr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
|
2066
2066
|
T,
|
|
2067
2067
|
g,
|
|
2068
2068
|
N
|
|
2069
|
-
]),
|
|
2069
|
+
]), L = b("div", e, {
|
|
2070
2070
|
state: F,
|
|
2071
2071
|
ref: t,
|
|
2072
2072
|
props: [
|
|
@@ -2078,18 +2078,18 @@ var zr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
|
2078
2078
|
f,
|
|
2079
2079
|
C
|
|
2080
2080
|
],
|
|
2081
|
-
stateAttributesMapping:
|
|
2081
|
+
stateAttributesMapping: ve
|
|
2082
2082
|
});
|
|
2083
2083
|
return /*#__PURE__*/ (0, $.jsx)(St.Provider, {
|
|
2084
|
-
value:
|
|
2085
|
-
children:
|
|
2084
|
+
value: I,
|
|
2085
|
+
children: L
|
|
2086
2086
|
});
|
|
2087
2087
|
});
|
|
2088
2088
|
process.env.NODE_ENV !== "production" && (zr.displayName = "CheckboxGroup");
|
|
2089
2089
|
//#endregion
|
|
2090
2090
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/labelable-provider/LabelableProvider.mjs
|
|
2091
2091
|
var Br = function(e) {
|
|
2092
|
-
let t = o(), n = e.controlId === void 0 ? t : e.controlId, [r, i] = Q.useState(n), [a, s] = Q.useState(e.labelId), [c, l] = Q.useState([]), u = f(() => /* @__PURE__ */ new Map()), { messageIds: d } =
|
|
2092
|
+
let t = o(), n = e.controlId === void 0 ? t : e.controlId, [r, i] = Q.useState(n), [a, s] = Q.useState(e.labelId), [c, l] = Q.useState([]), u = f(() => /* @__PURE__ */ new Map()), { messageIds: d } = Ce(), p = R((e, t) => {
|
|
2093
2093
|
let n = u.current;
|
|
2094
2094
|
if (t === void 0) {
|
|
2095
2095
|
n.delete(e);
|
|
@@ -2127,7 +2127,7 @@ var Br = function(e) {
|
|
|
2127
2127
|
l,
|
|
2128
2128
|
m
|
|
2129
2129
|
]);
|
|
2130
|
-
return /*#__PURE__*/ (0, $.jsx)(
|
|
2130
|
+
return /*#__PURE__*/ (0, $.jsx)(xe.Provider, {
|
|
2131
2131
|
value: h,
|
|
2132
2132
|
children: e.children
|
|
2133
2133
|
});
|
|
@@ -2146,7 +2146,7 @@ function Vr(e, t) {
|
|
|
2146
2146
|
}
|
|
2147
2147
|
//#endregion
|
|
2148
2148
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/field/root/useFieldValidation.mjs
|
|
2149
|
-
var Hr = Object.keys(
|
|
2149
|
+
var Hr = Object.keys(we);
|
|
2150
2150
|
function Ur(e) {
|
|
2151
2151
|
if (!e || e.valid || !e.valueMissing) return !1;
|
|
2152
2152
|
let t = !1;
|
|
@@ -2167,11 +2167,11 @@ function Gr(e, t) {
|
|
|
2167
2167
|
n || e.setCustomValidity("");
|
|
2168
2168
|
}
|
|
2169
2169
|
function Kr(e) {
|
|
2170
|
-
let { formRef: t } =
|
|
2170
|
+
let { formRef: t } = Te(), { setValidityData: n, validate: r, validityData: i, validationDebounceTime: a, invalid: o, markedDirtyRef: s, state: c, shouldValidateOnChange: l, getRegisteredFieldId: u } = e, { controlId: p, getDescriptionProps: m } = Ce(), h = d(), g = Q.useRef(null), _ = f(() => /* @__PURE__ */ new Set()).current, v = Q.useRef(0), y = Q.useCallback((e) => {
|
|
2171
2171
|
if (e) return _.add(e), () => {
|
|
2172
2172
|
_.delete(e);
|
|
2173
2173
|
};
|
|
2174
|
-
}, [_]), b =
|
|
2174
|
+
}, [_]), b = R(async (e, a = !1) => {
|
|
2175
2175
|
let d = Wr(_) ?? g.current;
|
|
2176
2176
|
if (!d) return;
|
|
2177
2177
|
v.current += 1;
|
|
@@ -2194,7 +2194,7 @@ function Kr(e) {
|
|
|
2194
2194
|
let t = {
|
|
2195
2195
|
value: e,
|
|
2196
2196
|
state: {
|
|
2197
|
-
...
|
|
2197
|
+
...we,
|
|
2198
2198
|
valid: !0
|
|
2199
2199
|
},
|
|
2200
2200
|
error: "",
|
|
@@ -2233,13 +2233,13 @@ function Kr(e) {
|
|
|
2233
2233
|
initialValue: i.initialValue
|
|
2234
2234
|
};
|
|
2235
2235
|
m(T), n(T);
|
|
2236
|
-
}), x =
|
|
2236
|
+
}), x = R((e) => {
|
|
2237
2237
|
h.clear();
|
|
2238
2238
|
let t = l();
|
|
2239
2239
|
t && e !== "" && a ? (v.current += 1, h.start(a, () => {
|
|
2240
2240
|
b(e);
|
|
2241
2241
|
})) : b(e, !t);
|
|
2242
|
-
}), S = Q.useCallback((e, t = {}) =>
|
|
2242
|
+
}), S = Q.useCallback((e, t = {}) => ee(m(t), c.valid === !1 && !c.disabled && !e ? { "aria-invalid": !0 } : M), [
|
|
2243
2243
|
m,
|
|
2244
2244
|
c.disabled,
|
|
2245
2245
|
c.valid
|
|
@@ -2260,14 +2260,14 @@ function Kr(e) {
|
|
|
2260
2260
|
//#endregion
|
|
2261
2261
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/field-register-control/useFieldControlRegistration.mjs
|
|
2262
2262
|
function qr(e) {
|
|
2263
|
-
let { commit: t, invalid: n, markedDirtyRef: r, name: i, setRegisteredFieldName: a, setRegisteredFieldId: o, setValidityData: s, validityData: c } = e, { formRef: l } =
|
|
2263
|
+
let { commit: t, invalid: n, markedDirtyRef: r, name: i, setRegisteredFieldName: a, setRegisteredFieldId: o, setValidityData: s, validityData: c } = e, { formRef: l } = Te(), d = Q.useRef(null), f = Q.useRef(null), p = Q.useRef(null), m = R(() => {
|
|
2264
2264
|
let e = f.current;
|
|
2265
2265
|
if (e) return e.getValue ? e.getValue() : e.value;
|
|
2266
2266
|
});
|
|
2267
2267
|
function h(e) {
|
|
2268
2268
|
return e.value === void 0 ? m() : e.value;
|
|
2269
2269
|
}
|
|
2270
|
-
let g =
|
|
2270
|
+
let g = R(() => {
|
|
2271
2271
|
let e = f.current;
|
|
2272
2272
|
if (r.current = !0, !e) {
|
|
2273
2273
|
t(c.value);
|
|
@@ -2320,7 +2320,7 @@ function qr(e) {
|
|
|
2320
2320
|
let t = f.current?.id;
|
|
2321
2321
|
t && e.delete(t);
|
|
2322
2322
|
};
|
|
2323
|
-
}, [l]), [g,
|
|
2323
|
+
}, [l]), [g, R((e, t) => {
|
|
2324
2324
|
if (!t) {
|
|
2325
2325
|
d.current === e && (d.current = null, v(), f.current = null, a(void 0), o(void 0));
|
|
2326
2326
|
return;
|
|
@@ -2332,67 +2332,67 @@ function qr(e) {
|
|
|
2332
2332
|
//#endregion
|
|
2333
2333
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/field/root/FieldRoot.mjs
|
|
2334
2334
|
var Jr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
2335
|
-
let { errors: n, validationMode: r, submitAttemptedRef: i } =
|
|
2335
|
+
let { errors: n, validationMode: r, submitAttemptedRef: i } = Te(), { render: a, className: o, validate: s, validationDebounceTime: c = 0, validationMode: l = r, name: d, disabled: f = !1, invalid: p, dirty: m, touched: h, actionsRef: g, style: _, ...v } = e, y = Or(!0)?.disabled, x = R(s || (() => null)), S = y || f, [C, w] = Q.useState(!1), [T, E] = Q.useState(!1), [D, O] = Q.useState(!1), [k, A] = Q.useState(!1), j = m ?? T, M = h ?? C, N = Q.useRef(j), P = Q.useRef(void 0), [F, I] = Q.useState(), L = d ?? F;
|
|
2336
2336
|
u(() => {
|
|
2337
2337
|
m !== void 0 && (N.current = m);
|
|
2338
2338
|
}, [m]);
|
|
2339
|
-
let
|
|
2339
|
+
let ee = Q.useCallback(() => P.current, []), z = Q.useCallback((e) => {
|
|
2340
2340
|
P.current = e;
|
|
2341
|
-
}, []),
|
|
2341
|
+
}, []), B = R((e) => {
|
|
2342
2342
|
m === void 0 && (e && (N.current = !0), E(e));
|
|
2343
|
-
}),
|
|
2343
|
+
}), V = R((e) => {
|
|
2344
2344
|
h === void 0 && w(e);
|
|
2345
|
-
}),
|
|
2346
|
-
state:
|
|
2345
|
+
}), H = R(() => l === "onChange" || l === "onSubmit" && i.current), U = L && Object.hasOwn(n, L) ? n[L] : null, te = !!(Array.isArray(U) ? U.length : U), W = p === !0 || te, [G, K] = Q.useState({
|
|
2346
|
+
state: we,
|
|
2347
2347
|
error: "",
|
|
2348
2348
|
errors: [],
|
|
2349
2349
|
value: null,
|
|
2350
2350
|
initialValue: null
|
|
2351
|
-
}),
|
|
2351
|
+
}), ne = S ? null : !W && G.state.valid, q = Q.useMemo(() => ({
|
|
2352
2352
|
disabled: S,
|
|
2353
2353
|
touched: M,
|
|
2354
2354
|
dirty: j,
|
|
2355
|
-
valid:
|
|
2355
|
+
valid: ne,
|
|
2356
2356
|
filled: D,
|
|
2357
2357
|
focused: k
|
|
2358
2358
|
}), [
|
|
2359
2359
|
S,
|
|
2360
2360
|
M,
|
|
2361
2361
|
j,
|
|
2362
|
-
|
|
2362
|
+
ne,
|
|
2363
2363
|
D,
|
|
2364
2364
|
k
|
|
2365
|
-
]),
|
|
2366
|
-
setValidityData:
|
|
2365
|
+
]), J = Kr({
|
|
2366
|
+
setValidityData: K,
|
|
2367
2367
|
validate: x,
|
|
2368
|
-
validityData:
|
|
2368
|
+
validityData: G,
|
|
2369
2369
|
validationDebounceTime: c,
|
|
2370
|
-
invalid:
|
|
2370
|
+
invalid: W,
|
|
2371
2371
|
markedDirtyRef: N,
|
|
2372
|
-
state:
|
|
2373
|
-
shouldValidateOnChange:
|
|
2374
|
-
getRegisteredFieldId:
|
|
2375
|
-
}), [
|
|
2376
|
-
commit:
|
|
2377
|
-
invalid:
|
|
2372
|
+
state: q,
|
|
2373
|
+
shouldValidateOnChange: H,
|
|
2374
|
+
getRegisteredFieldId: ee
|
|
2375
|
+
}), [Y, X] = qr({
|
|
2376
|
+
commit: J.commit,
|
|
2377
|
+
invalid: W,
|
|
2378
2378
|
markedDirtyRef: N,
|
|
2379
2379
|
name: d,
|
|
2380
|
-
setRegisteredFieldName:
|
|
2380
|
+
setRegisteredFieldName: I,
|
|
2381
2381
|
setRegisteredFieldId: z,
|
|
2382
|
-
setValidityData:
|
|
2383
|
-
validityData:
|
|
2382
|
+
setValidityData: K,
|
|
2383
|
+
validityData: G
|
|
2384
2384
|
});
|
|
2385
|
-
Q.useImperativeHandle(g, () => ({ validate:
|
|
2386
|
-
let
|
|
2387
|
-
invalid:
|
|
2388
|
-
name:
|
|
2389
|
-
validityData:
|
|
2390
|
-
setValidityData:
|
|
2385
|
+
Q.useImperativeHandle(g, () => ({ validate: Y }), [Y]);
|
|
2386
|
+
let re = Q.useMemo(() => ({
|
|
2387
|
+
invalid: W,
|
|
2388
|
+
name: L,
|
|
2389
|
+
validityData: G,
|
|
2390
|
+
setValidityData: K,
|
|
2391
2391
|
disabled: S,
|
|
2392
2392
|
touched: M,
|
|
2393
|
-
setTouched:
|
|
2393
|
+
setTouched: V,
|
|
2394
2394
|
dirty: j,
|
|
2395
|
-
setDirty:
|
|
2395
|
+
setDirty: B,
|
|
2396
2396
|
filled: D,
|
|
2397
2397
|
setFilled: O,
|
|
2398
2398
|
focused: k,
|
|
@@ -2400,20 +2400,20 @@ var Jr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
|
2400
2400
|
validate: x,
|
|
2401
2401
|
validationMode: l,
|
|
2402
2402
|
validationDebounceTime: c,
|
|
2403
|
-
shouldValidateOnChange:
|
|
2404
|
-
state:
|
|
2403
|
+
shouldValidateOnChange: H,
|
|
2404
|
+
state: q,
|
|
2405
2405
|
markedDirtyRef: N,
|
|
2406
|
-
registerFieldControl:
|
|
2407
|
-
validation:
|
|
2406
|
+
registerFieldControl: X,
|
|
2407
|
+
validation: J
|
|
2408
2408
|
}), [
|
|
2409
|
-
U,
|
|
2410
|
-
I,
|
|
2411
2409
|
W,
|
|
2410
|
+
L,
|
|
2411
|
+
G,
|
|
2412
2412
|
S,
|
|
2413
2413
|
M,
|
|
2414
|
-
|
|
2414
|
+
V,
|
|
2415
2415
|
j,
|
|
2416
|
-
|
|
2416
|
+
B,
|
|
2417
2417
|
D,
|
|
2418
2418
|
O,
|
|
2419
2419
|
k,
|
|
@@ -2421,19 +2421,19 @@ var Jr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
|
2421
2421
|
x,
|
|
2422
2422
|
l,
|
|
2423
2423
|
c,
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
]),
|
|
2424
|
+
H,
|
|
2425
|
+
q,
|
|
2426
|
+
X,
|
|
2427
|
+
J
|
|
2428
|
+
]), ie = b("div", e, {
|
|
2429
2429
|
ref: t,
|
|
2430
|
-
state:
|
|
2430
|
+
state: q,
|
|
2431
2431
|
props: v,
|
|
2432
|
-
stateAttributesMapping:
|
|
2432
|
+
stateAttributesMapping: ve
|
|
2433
2433
|
});
|
|
2434
|
-
return /*#__PURE__*/ (0, $.jsx)(
|
|
2435
|
-
value:
|
|
2436
|
-
children:
|
|
2434
|
+
return /*#__PURE__*/ (0, $.jsx)(_e.Provider, {
|
|
2435
|
+
value: re,
|
|
2436
|
+
children: ie
|
|
2437
2437
|
});
|
|
2438
2438
|
});
|
|
2439
2439
|
process.env.NODE_ENV !== "production" && (Jr.displayName = "FieldRootInner");
|
|
@@ -2447,10 +2447,10 @@ process.env.NODE_ENV !== "production" && (Yr.displayName = "FieldRoot");
|
|
|
2447
2447
|
//#endregion
|
|
2448
2448
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/field/error/FieldError.mjs
|
|
2449
2449
|
var Xr = {
|
|
2450
|
-
...
|
|
2450
|
+
...ve,
|
|
2451
2451
|
...A
|
|
2452
2452
|
}, Zr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
2453
|
-
let { render: r, id: i, className: a, match: s, style: c, ...l } = e, d = o(i), { validityData: f, state: p, name: m } =
|
|
2453
|
+
let { render: r, id: i, className: a, match: s, style: c, ...l } = e, d = o(i), { validityData: f, state: p, name: m } = Se(!1), { setMessageIds: h } = Ce(), { errors: g } = Te(), _ = m && Object.hasOwn(g, m) ? g[m] : null, v = !!(Array.isArray(_) ? _.length : _), y = typeof s == "string", x = !1;
|
|
2454
2454
|
x = s === !0 ? !0 : p.disabled ? !1 : y ? !!f.state[s] : v || f.state.valid === !1;
|
|
2455
2455
|
let { mounted: S, transitionStatus: C, setMounted: w } = T(x);
|
|
2456
2456
|
u(() => {
|
|
@@ -2493,10 +2493,10 @@ process.env.NODE_ENV !== "production" && (Zr.displayName = "FieldError");
|
|
|
2493
2493
|
//#endregion
|
|
2494
2494
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/field/control/FieldControl.mjs
|
|
2495
2495
|
var Qr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
2496
|
-
let { render: n, className: r, id: i, name: o, value: s, disabled: c = !1, onValueChange: l, defaultValue: d, autoFocus: f = !1, style: m, ...h } = e, { state: g, name: _, disabled: v, setTouched: y, setDirty: x, validityData: S, setFocused: C, setFilled: w, validationMode: T, validation: E } =
|
|
2496
|
+
let { render: n, className: r, id: i, name: o, value: s, disabled: c = !1, onValueChange: l, defaultValue: d, autoFocus: f = !1, style: m, ...h } = e, { state: g, name: _, disabled: v, setTouched: y, setDirty: x, validityData: S, setFocused: C, setFilled: w, validationMode: T, validation: E } = Se(), { clearErrors: D } = Te(), O = v || c, A = _ ?? o, M = {
|
|
2497
2497
|
...g,
|
|
2498
2498
|
disabled: O
|
|
2499
|
-
}, { labelId: N } =
|
|
2499
|
+
}, { labelId: N } = Ce(), P = le({ id: i });
|
|
2500
2500
|
u(() => {
|
|
2501
2501
|
let e = s != null;
|
|
2502
2502
|
E.inputRef.current?.value || e && s !== "" ? w(!0) : e && s === "" && w(!1);
|
|
@@ -2509,13 +2509,13 @@ var Qr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
|
2509
2509
|
u(() => {
|
|
2510
2510
|
f && F.current === j(k(F.current)) && C(!0);
|
|
2511
2511
|
}, [f, C]);
|
|
2512
|
-
let [
|
|
2512
|
+
let [I] = ie({
|
|
2513
2513
|
controlled: s,
|
|
2514
2514
|
default: d,
|
|
2515
2515
|
name: "FieldControl",
|
|
2516
2516
|
state: "value"
|
|
2517
|
-
}),
|
|
2518
|
-
return
|
|
2517
|
+
}), L = s !== void 0, ee = L ? I : void 0, z = R(() => E.inputRef.current?.value);
|
|
2518
|
+
return ye(E.inputRef, P, ee, z, !O, o), b("input", e, {
|
|
2519
2519
|
ref: [t, F],
|
|
2520
2520
|
state: M,
|
|
2521
2521
|
props: [
|
|
@@ -2526,7 +2526,7 @@ var Qr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
|
2526
2526
|
ref: E.inputRef,
|
|
2527
2527
|
"aria-labelledby": N,
|
|
2528
2528
|
autoFocus: f,
|
|
2529
|
-
...
|
|
2529
|
+
...L ? { value: ee } : { defaultValue: d },
|
|
2530
2530
|
onChange(e) {
|
|
2531
2531
|
let t = e.currentTarget.value;
|
|
2532
2532
|
l?.(t, a(p, e.nativeEvent)), x(t !== S.initialValue), w(t !== ""), e.nativeEvent.defaultPrevented || (D(A), E.change(t));
|
|
@@ -2544,7 +2544,7 @@ var Qr = /*#__PURE__*/ Q.forwardRef(function(e, t) {
|
|
|
2544
2544
|
h,
|
|
2545
2545
|
(e) => E.getValidationProps(O, e)
|
|
2546
2546
|
],
|
|
2547
|
-
stateAttributesMapping:
|
|
2547
|
+
stateAttributesMapping: ve
|
|
2548
2548
|
});
|
|
2549
2549
|
});
|
|
2550
2550
|
process.env.NODE_ENV !== "production" && (Qr.displayName = "FieldControl");
|
|
@@ -2791,7 +2791,7 @@ function di(e, t, n, r = "y") {
|
|
|
2791
2791
|
return l;
|
|
2792
2792
|
}
|
|
2793
2793
|
function fi({ blocks: e, dimmed: t }) {
|
|
2794
|
-
return /* @__PURE__ */ (0, $.jsx)(
|
|
2794
|
+
return /* @__PURE__ */ (0, $.jsx)(se, { children: e.map((e) => {
|
|
2795
2795
|
let n = e.delayCorners ? {
|
|
2796
2796
|
...ei,
|
|
2797
2797
|
delay: e.cornerDelay ?? ti
|
|
@@ -2854,105 +2854,105 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
2854
2854
|
let j = (0, Q.useCallback)((e) => {
|
|
2855
2855
|
let t = e(A.current);
|
|
2856
2856
|
return A.current = t, O || D(t), s?.(t), t;
|
|
2857
|
-
}, [O, s]), M = i(), N =
|
|
2857
|
+
}, [O, s]), M = i(), N = Ie("arrow-left"), I = Ie("arrow-right"), L = (0, Q.useMemo)(() => function(e) {
|
|
2858
2858
|
return /* @__PURE__ */ (0, $.jsx)(N, {
|
|
2859
2859
|
...e,
|
|
2860
2860
|
className: l(e.className, "hidden sm:block")
|
|
2861
2861
|
});
|
|
2862
|
-
}, [N]),
|
|
2863
|
-
return /* @__PURE__ */ (0, $.jsx)(
|
|
2862
|
+
}, [N]), R = (0, Q.useMemo)(() => function(e) {
|
|
2863
|
+
return /* @__PURE__ */ (0, $.jsx)(I, {
|
|
2864
2864
|
...e,
|
|
2865
2865
|
className: l(e.className, "hidden sm:block")
|
|
2866
2866
|
});
|
|
2867
|
-
}, [
|
|
2867
|
+
}, [I]), [ee] = (0, Q.useState)(() => {
|
|
2868
2868
|
if (typeof navigator > "u") return !1;
|
|
2869
2869
|
let e = navigator, t = e.userAgentData?.platform || e.platform || "";
|
|
2870
2870
|
return /mac/i.test(t);
|
|
2871
|
-
}), z = (0, Q.useId)(),
|
|
2871
|
+
}), z = (0, Q.useId)(), B = e.length, V = Math.max(0, Math.min(w, Math.max(0, B - 1))), H = e[V], U = H ? pi(H, V) : "", te = k[U], W = !!H?.multiSelect, G = H?.skippable !== !1, K = !!H?.freeText, ne = H?.freeTextMultiline !== !1, q = !K && !!H?.allowOther, J = (0, Q.useMemo)(() => te?.selectedIds ?? [], [te]), Y = te?.otherText ?? "", X = H?.options ?? [], re = q ? X.length : -1, ie = X.length + +!!q, ae = (0, Q.useRef)(null), oe = !!H;
|
|
2872
2872
|
(0, Q.useEffect)(() => {
|
|
2873
|
-
if (!
|
|
2874
|
-
let e =
|
|
2873
|
+
if (!oe) return;
|
|
2874
|
+
let e = ae.current;
|
|
2875
2875
|
if (e) return hi.push(e), () => {
|
|
2876
2876
|
let t = hi.indexOf(e);
|
|
2877
2877
|
t !== -1 && hi.splice(t, 1);
|
|
2878
2878
|
};
|
|
2879
|
-
}, [
|
|
2880
|
-
let
|
|
2879
|
+
}, [oe]);
|
|
2880
|
+
let ce = (0, Q.useRef)(null), le = (0, Q.useRef)(null), ue = (0, Q.useRef)(0), de = (0, Q.useRef)(/* @__PURE__ */ new Map()), { activeIndex: fe, setActiveIndex: me, itemRects: he, sessionRef: ge, handlers: _e, registerItem: ve, measureItems: ye } = pe(ce);
|
|
2881
2881
|
(0, Q.useEffect)(() => {
|
|
2882
|
-
|
|
2882
|
+
ye();
|
|
2883
2883
|
}, [
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2884
|
+
ye,
|
|
2885
|
+
U,
|
|
2886
|
+
ie,
|
|
2887
2887
|
M
|
|
2888
2888
|
]);
|
|
2889
|
-
let [
|
|
2889
|
+
let [be, xe] = (0, Q.useState)(!1);
|
|
2890
2890
|
(0, Q.useEffect)(() => {
|
|
2891
|
-
|
|
2892
|
-
}, [
|
|
2893
|
-
let e =
|
|
2891
|
+
xe(!1);
|
|
2892
|
+
}, [U]), (0, Q.useEffect)(() => {
|
|
2893
|
+
let e = le.current;
|
|
2894
2894
|
if (!e) return;
|
|
2895
2895
|
e.style.height = "0px", e.style.height = `${e.scrollHeight}px`;
|
|
2896
2896
|
let t = parseFloat(window.getComputedStyle(e).lineHeight) || 18;
|
|
2897
|
-
|
|
2897
|
+
xe(e.scrollHeight > t * 1.5), ye();
|
|
2898
2898
|
}, [
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2899
|
+
Y,
|
|
2900
|
+
ye,
|
|
2901
|
+
U
|
|
2902
2902
|
]), (0, Q.useEffect)(() => {
|
|
2903
|
-
|
|
2904
|
-
}, [
|
|
2905
|
-
let
|
|
2903
|
+
K && le.current?.focus({ preventScroll: !0 });
|
|
2904
|
+
}, [K, U]);
|
|
2905
|
+
let Se = (0, Q.useRef)(null), [Ce, we] = (0, Q.useState)("auto");
|
|
2906
2906
|
(0, Q.useEffect)(() => {
|
|
2907
|
-
let e =
|
|
2907
|
+
let e = Se.current;
|
|
2908
2908
|
if (!e) return;
|
|
2909
|
-
let t = () =>
|
|
2909
|
+
let t = () => we(e.offsetHeight);
|
|
2910
2910
|
t();
|
|
2911
2911
|
let n = new ResizeObserver(t);
|
|
2912
2912
|
return n.observe(e), () => n.disconnect();
|
|
2913
2913
|
}, []);
|
|
2914
|
-
let [
|
|
2914
|
+
let [Te, Ee] = (0, Q.useState)(null), [De, Oe] = (0, Q.useState)(null);
|
|
2915
2915
|
(0, Q.useEffect)(() => {
|
|
2916
|
-
|
|
2917
|
-
}, [
|
|
2918
|
-
let
|
|
2919
|
-
|
|
2916
|
+
me(null), Ee(null), Oe(null);
|
|
2917
|
+
}, [V, me]);
|
|
2918
|
+
let ke = (0, Q.useRef)(!1), Ae = (0, Q.useCallback)(() => {
|
|
2919
|
+
ce.current?.contains(document.activeElement) && (ke.current = !0);
|
|
2920
2920
|
}, []);
|
|
2921
2921
|
(0, Q.useEffect)(() => {
|
|
2922
|
-
|
|
2923
|
-
}, [
|
|
2924
|
-
let
|
|
2925
|
-
|
|
2922
|
+
ke.current && (ke.current = !1, (ce.current?.querySelector("[data-proximity-index=\"0\"]"))?.focus());
|
|
2923
|
+
}, [V]);
|
|
2924
|
+
let je = (0, Q.useCallback)((e) => {
|
|
2925
|
+
V >= B - 1 ? c?.(e) : (Ae(), T(V + 1));
|
|
2926
2926
|
}, [
|
|
2927
|
+
V,
|
|
2927
2928
|
B,
|
|
2928
|
-
te,
|
|
2929
2929
|
c,
|
|
2930
2930
|
T,
|
|
2931
|
-
|
|
2932
|
-
]),
|
|
2933
|
-
if (!
|
|
2934
|
-
let t = A.current[
|
|
2935
|
-
|
|
2931
|
+
Ae
|
|
2932
|
+
]), Me = (0, Q.useCallback)((e) => {
|
|
2933
|
+
if (!H) return;
|
|
2934
|
+
let t = A.current[U]?.otherText;
|
|
2935
|
+
je(j((n) => ({
|
|
2936
2936
|
...n,
|
|
2937
|
-
[
|
|
2938
|
-
questionId:
|
|
2937
|
+
[U]: {
|
|
2938
|
+
questionId: U,
|
|
2939
2939
|
selectedIds: [e],
|
|
2940
2940
|
otherText: t || void 0,
|
|
2941
2941
|
skipped: !1
|
|
2942
2942
|
}
|
|
2943
2943
|
})));
|
|
2944
2944
|
}, [
|
|
2945
|
-
V,
|
|
2946
2945
|
H,
|
|
2946
|
+
U,
|
|
2947
2947
|
j,
|
|
2948
|
-
|
|
2949
|
-
]),
|
|
2950
|
-
|
|
2951
|
-
let n = t[
|
|
2948
|
+
je
|
|
2949
|
+
]), Ne = (0, Q.useCallback)((e) => {
|
|
2950
|
+
H && j((t) => {
|
|
2951
|
+
let n = t[U], r = new Set(n?.selectedIds ?? []);
|
|
2952
2952
|
return r.has(e) ? r.delete(e) : r.add(e), {
|
|
2953
2953
|
...t,
|
|
2954
|
-
[
|
|
2955
|
-
questionId:
|
|
2954
|
+
[U]: {
|
|
2955
|
+
questionId: U,
|
|
2956
2956
|
selectedIds: Array.from(r),
|
|
2957
2957
|
otherText: n?.otherText,
|
|
2958
2958
|
skipped: !1
|
|
@@ -2960,130 +2960,130 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
2960
2960
|
};
|
|
2961
2961
|
});
|
|
2962
2962
|
}, [
|
|
2963
|
-
V,
|
|
2964
2963
|
H,
|
|
2964
|
+
U,
|
|
2965
2965
|
j
|
|
2966
|
-
]),
|
|
2967
|
-
|
|
2966
|
+
]), Pe = (0, Q.useCallback)((e) => {
|
|
2967
|
+
H && j((t) => ({
|
|
2968
2968
|
...t,
|
|
2969
|
-
[
|
|
2970
|
-
questionId:
|
|
2969
|
+
[U]: {
|
|
2970
|
+
questionId: U,
|
|
2971
2971
|
selectedIds: e,
|
|
2972
|
-
otherText: t[
|
|
2972
|
+
otherText: t[U]?.otherText,
|
|
2973
2973
|
skipped: !1
|
|
2974
2974
|
}
|
|
2975
2975
|
}));
|
|
2976
2976
|
}, [
|
|
2977
|
-
V,
|
|
2978
2977
|
H,
|
|
2978
|
+
U,
|
|
2979
2979
|
j
|
|
2980
|
-
]),
|
|
2981
|
-
|
|
2980
|
+
]), Fe = (0, Q.useCallback)((e) => {
|
|
2981
|
+
H && (Oe(null), j((t) => ({
|
|
2982
2982
|
...t,
|
|
2983
|
-
[
|
|
2984
|
-
questionId:
|
|
2985
|
-
selectedIds: t[
|
|
2983
|
+
[U]: {
|
|
2984
|
+
questionId: U,
|
|
2985
|
+
selectedIds: t[U]?.selectedIds ?? [],
|
|
2986
2986
|
otherText: e,
|
|
2987
2987
|
skipped: !1
|
|
2988
2988
|
}
|
|
2989
2989
|
})));
|
|
2990
2990
|
}, [
|
|
2991
|
-
V,
|
|
2992
2991
|
H,
|
|
2992
|
+
U,
|
|
2993
2993
|
j
|
|
2994
|
-
]),
|
|
2995
|
-
if (!
|
|
2996
|
-
let e = (A.current[
|
|
2994
|
+
]), Le = (0, Q.useCallback)(() => {
|
|
2995
|
+
if (!H) return;
|
|
2996
|
+
let e = (A.current[U]?.otherText ?? "").trim();
|
|
2997
2997
|
if (e) {
|
|
2998
|
-
if (
|
|
2999
|
-
let t =
|
|
2998
|
+
if (H.freeText && H.freeTextValidate) {
|
|
2999
|
+
let t = H.freeTextValidate(e);
|
|
3000
3000
|
if (t) {
|
|
3001
|
-
|
|
3001
|
+
Oe(t);
|
|
3002
3002
|
return;
|
|
3003
3003
|
}
|
|
3004
3004
|
}
|
|
3005
|
-
|
|
3005
|
+
Oe(null), je(j((t) => ({
|
|
3006
3006
|
...t,
|
|
3007
|
-
[
|
|
3008
|
-
questionId:
|
|
3009
|
-
selectedIds: t[
|
|
3007
|
+
[U]: {
|
|
3008
|
+
questionId: U,
|
|
3009
|
+
selectedIds: t[U]?.selectedIds ?? [],
|
|
3010
3010
|
otherText: e,
|
|
3011
3011
|
skipped: !1
|
|
3012
3012
|
}
|
|
3013
3013
|
})));
|
|
3014
3014
|
}
|
|
3015
3015
|
}, [
|
|
3016
|
-
V,
|
|
3017
3016
|
H,
|
|
3017
|
+
U,
|
|
3018
3018
|
j,
|
|
3019
|
-
|
|
3020
|
-
]),
|
|
3021
|
-
if (!
|
|
3019
|
+
je
|
|
3020
|
+
]), Re = (0, Q.useCallback)(() => {
|
|
3021
|
+
if (!H) return;
|
|
3022
3022
|
let e = j((e) => ({
|
|
3023
3023
|
...e,
|
|
3024
|
-
[
|
|
3025
|
-
questionId:
|
|
3026
|
-
selectedIds: e[
|
|
3027
|
-
otherText: e[
|
|
3024
|
+
[U]: {
|
|
3025
|
+
questionId: U,
|
|
3026
|
+
selectedIds: e[U]?.selectedIds ?? [],
|
|
3027
|
+
otherText: e[U]?.otherText,
|
|
3028
3028
|
skipped: !0
|
|
3029
3029
|
}
|
|
3030
3030
|
}));
|
|
3031
|
-
u?.(
|
|
3031
|
+
u?.(U, V), je(e);
|
|
3032
3032
|
}, [
|
|
3033
|
-
V,
|
|
3034
3033
|
H,
|
|
3034
|
+
U,
|
|
3035
3035
|
j,
|
|
3036
3036
|
u,
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
]),
|
|
3037
|
+
V,
|
|
3038
|
+
je
|
|
3039
|
+
]), ze = (0, Q.useCallback)(() => {
|
|
3040
3040
|
p?.();
|
|
3041
|
-
}, [p]),
|
|
3042
|
-
|
|
3043
|
-
}, [
|
|
3044
|
-
|
|
3041
|
+
}, [p]), Be = (0, Q.useCallback)(() => {
|
|
3042
|
+
je(k);
|
|
3043
|
+
}, [je, k]), Ve = (0, Q.useCallback)(() => {
|
|
3044
|
+
V > 0 && (Ae(), T(V - 1));
|
|
3045
3045
|
}, [
|
|
3046
|
-
|
|
3046
|
+
V,
|
|
3047
3047
|
T,
|
|
3048
|
-
|
|
3048
|
+
Ae
|
|
3049
3049
|
]);
|
|
3050
3050
|
(0, Q.useEffect)(() => {
|
|
3051
|
-
if (!
|
|
3051
|
+
if (!H) return;
|
|
3052
3052
|
let e = (e) => {
|
|
3053
3053
|
if (e.metaKey || e.ctrlKey || e.altKey) return;
|
|
3054
3054
|
let t = e.target;
|
|
3055
3055
|
if (!t) return;
|
|
3056
3056
|
let n = t.tagName;
|
|
3057
3057
|
if (n === "INPUT" || n === "TEXTAREA" || t.isContentEditable) return;
|
|
3058
|
-
let r =
|
|
3058
|
+
let r = ae.current;
|
|
3059
3059
|
if (!r || !r.contains(t) && (hi.some((e) => e !== r && e.contains(t)) || hi[hi.length - 1] !== r)) return;
|
|
3060
3060
|
let i = e.key;
|
|
3061
3061
|
if (i < "1" || i > "9") return;
|
|
3062
3062
|
let a = parseInt(i, 10) - 1;
|
|
3063
|
-
if (a >= 0 && a <
|
|
3063
|
+
if (a >= 0 && a < X.length) {
|
|
3064
3064
|
e.preventDefault();
|
|
3065
|
-
let t = mi(
|
|
3066
|
-
|
|
3067
|
-
} else a ===
|
|
3065
|
+
let t = mi(X[a], a);
|
|
3066
|
+
W ? Ne(t) : Me(t);
|
|
3067
|
+
} else a === X.length && q && (e.preventDefault(), le.current?.focus());
|
|
3068
3068
|
};
|
|
3069
3069
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
3070
3070
|
}, [
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3071
|
+
H,
|
|
3072
|
+
X,
|
|
3073
|
+
W,
|
|
3074
|
+
q,
|
|
3075
|
+
Me,
|
|
3076
|
+
Ne
|
|
3077
3077
|
]);
|
|
3078
|
-
let
|
|
3079
|
-
(
|
|
3080
|
-
},
|
|
3081
|
-
|
|
3078
|
+
let He = (e) => {
|
|
3079
|
+
(ce.current?.querySelector(`[data-proximity-index="${e}"]`))?.focus();
|
|
3080
|
+
}, Ue = (0, Q.useCallback)((e) => {
|
|
3081
|
+
me(e), q && e === re ? le.current?.focus() : He(e);
|
|
3082
3082
|
}, [
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
]),
|
|
3083
|
+
q,
|
|
3084
|
+
re,
|
|
3085
|
+
me
|
|
3086
|
+
]), We = (e) => {
|
|
3087
3087
|
let t = e.target, n = t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable;
|
|
3088
3088
|
if (n && e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
3089
3089
|
if (n && (e.key === "ArrowUp" || e.key === "ArrowDown") && t.tagName === "TEXTAREA") {
|
|
@@ -3092,30 +3092,30 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3092
3092
|
}
|
|
3093
3093
|
let r = e.preventBaseUIHandler;
|
|
3094
3094
|
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
3095
|
-
e.preventDefault(), e.stopPropagation(), r?.(), e.key === "ArrowLeft" ?
|
|
3095
|
+
e.preventDefault(), e.stopPropagation(), r?.(), e.key === "ArrowLeft" ? V > 0 && Ve() : G && B > 1 && Re();
|
|
3096
3096
|
return;
|
|
3097
3097
|
}
|
|
3098
|
-
if (
|
|
3098
|
+
if (ie !== 0 && (e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End")) {
|
|
3099
3099
|
e.preventDefault(), e.stopPropagation(), r?.();
|
|
3100
3100
|
let t;
|
|
3101
3101
|
if (e.key === "Home") t = 0;
|
|
3102
|
-
else if (e.key === "End") t =
|
|
3102
|
+
else if (e.key === "End") t = ie - 1;
|
|
3103
3103
|
else {
|
|
3104
|
-
let r = n ?
|
|
3105
|
-
t = e.key === "ArrowDown" ? r + 1 : r - 1, t = (t +
|
|
3104
|
+
let r = n ? re : fe ?? -1;
|
|
3105
|
+
t = e.key === "ArrowDown" ? r + 1 : r - 1, t = (t + ie) % ie;
|
|
3106
3106
|
}
|
|
3107
|
-
|
|
3107
|
+
Ue(t);
|
|
3108
3108
|
}
|
|
3109
|
-
},
|
|
3110
|
-
if (e.key === "Enter" && !(!(
|
|
3111
|
-
if (e.preventDefault(),
|
|
3112
|
-
|
|
3109
|
+
}, Ge = (e) => {
|
|
3110
|
+
if (e.key === "Enter" && !(!(ee ? e.metaKey : e.ctrlKey) || !(W || K))) {
|
|
3111
|
+
if (e.preventDefault(), K) {
|
|
3112
|
+
Y.trim().length > 0 && Le();
|
|
3113
3113
|
return;
|
|
3114
3114
|
}
|
|
3115
|
-
(
|
|
3115
|
+
(J.length > 0 || Y.trim().length > 0) && Be();
|
|
3116
3116
|
}
|
|
3117
3117
|
};
|
|
3118
|
-
if (!
|
|
3118
|
+
if (!H) return /* @__PURE__ */ (0, $.jsx)("div", {
|
|
3119
3119
|
ref: y,
|
|
3120
3120
|
className: l("w-full max-w-[520px] p-5 bg-card border border-border", M.container, g),
|
|
3121
3121
|
..._,
|
|
@@ -3124,17 +3124,17 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3124
3124
|
children: "No questions."
|
|
3125
3125
|
})
|
|
3126
3126
|
});
|
|
3127
|
-
let Ke =
|
|
3127
|
+
let Ke = fe === null ? null : he[fe], qe = Te !== null && !(q && Te === re) ? he[Te] : null, Je = (0, Q.useMemo)(() => {
|
|
3128
3128
|
let e = /* @__PURE__ */ new Set();
|
|
3129
|
-
return
|
|
3130
|
-
|
|
3131
|
-
}),
|
|
3129
|
+
return X.forEach((t, n) => {
|
|
3130
|
+
J.includes(mi(t, n)) && e.add(n);
|
|
3131
|
+
}), q && Y.length > 0 && e.add(re), e;
|
|
3132
3132
|
}, [
|
|
3133
|
-
|
|
3134
|
-
q,
|
|
3135
|
-
K,
|
|
3133
|
+
X,
|
|
3136
3134
|
J,
|
|
3137
|
-
|
|
3135
|
+
q,
|
|
3136
|
+
Y,
|
|
3137
|
+
re
|
|
3138
3138
|
]), Ye = (0, Q.useMemo)(() => {
|
|
3139
3139
|
let e = [], t = [...Je].sort((e, t) => e - t);
|
|
3140
3140
|
for (let n of t) {
|
|
@@ -3147,13 +3147,13 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3147
3147
|
let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), i = e.map((e) => {
|
|
3148
3148
|
let t = null;
|
|
3149
3149
|
for (let r = e.start; r <= e.end; r++) {
|
|
3150
|
-
let e =
|
|
3150
|
+
let e = de.current.get(r);
|
|
3151
3151
|
if (e !== void 0 && !n.has(e)) {
|
|
3152
3152
|
t = e;
|
|
3153
3153
|
break;
|
|
3154
3154
|
}
|
|
3155
3155
|
}
|
|
3156
|
-
let i = t ?? ++
|
|
3156
|
+
let i = t ?? ++ue.current;
|
|
3157
3157
|
n.add(i);
|
|
3158
3158
|
for (let t = e.start; t <= e.end; t++) r.set(t, i);
|
|
3159
3159
|
return {
|
|
@@ -3161,30 +3161,30 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3161
3161
|
id: i
|
|
3162
3162
|
};
|
|
3163
3163
|
});
|
|
3164
|
-
return
|
|
3165
|
-
}, [Je]), Xe =
|
|
3166
|
-
ref:
|
|
3167
|
-
role:
|
|
3168
|
-
"aria-labelledby": `${z}-${
|
|
3169
|
-
onMouseEnter:
|
|
3170
|
-
onMouseMove:
|
|
3171
|
-
onMouseLeave:
|
|
3164
|
+
return de.current = r, i;
|
|
3165
|
+
}, [Je]), Xe = fe !== null && !Je.has(fe), Ze = di(Ye, he, M.bgRadius), Qe = B > 1 && V > 0, $e = p != null, et = !$e && B > 1 && G, Z = W || K, tt = Qe || et || Z || $e || h != null, nt = X.findIndex((e, t) => J.includes(mi(e, t))), rt = /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
3166
|
+
ref: ce,
|
|
3167
|
+
role: W ? "group" : "radiogroup",
|
|
3168
|
+
"aria-labelledby": `${z}-${U}-title`,
|
|
3169
|
+
onMouseEnter: _e.onMouseEnter,
|
|
3170
|
+
onMouseMove: _e.onMouseMove,
|
|
3171
|
+
onMouseLeave: _e.onMouseLeave,
|
|
3172
3172
|
onFocus: (e) => {
|
|
3173
3173
|
let t = e.target.closest("[data-proximity-index]")?.getAttribute("data-proximity-index");
|
|
3174
3174
|
if (t != null) {
|
|
3175
3175
|
let n = Number(t);
|
|
3176
|
-
|
|
3176
|
+
me(n), Ee(e.target.matches(":focus-visible") ? n : null);
|
|
3177
3177
|
}
|
|
3178
3178
|
},
|
|
3179
3179
|
onBlur: (e) => {
|
|
3180
|
-
|
|
3180
|
+
ce.current?.contains(e.relatedTarget) || (Ee(null), me(null));
|
|
3181
3181
|
},
|
|
3182
|
-
onKeyDown:
|
|
3182
|
+
onKeyDown: We,
|
|
3183
3183
|
className: "relative flex flex-col gap-0.5 -mx-3",
|
|
3184
3184
|
children: [
|
|
3185
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
3186
|
-
if (!
|
|
3187
|
-
let e =
|
|
3185
|
+
/* @__PURE__ */ (0, $.jsx)(se, { children: (() => {
|
|
3186
|
+
if (!q) return null;
|
|
3187
|
+
let e = he[re], t = Te === re && Y.length === 0;
|
|
3188
3188
|
return !e || !t ? null : /* @__PURE__ */ (0, $.jsx)(x.div, {
|
|
3189
3189
|
"aria-hidden": !0,
|
|
3190
3190
|
className: l("absolute pointer-events-none bg-card ring-1 ring-inset ring-border", M.bg),
|
|
@@ -3212,7 +3212,7 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3212
3212
|
}
|
|
3213
3213
|
}, "other-input");
|
|
3214
3214
|
})() }),
|
|
3215
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
3215
|
+
/* @__PURE__ */ (0, $.jsx)(se, { children: Ke && /* @__PURE__ */ (0, $.jsx)(x.div, {
|
|
3216
3216
|
"aria-hidden": !0,
|
|
3217
3217
|
className: l("absolute pointer-events-none bg-hover", M.bg),
|
|
3218
3218
|
initial: {
|
|
@@ -3237,12 +3237,12 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3237
3237
|
...P.fast,
|
|
3238
3238
|
opacity: { duration: .08 }
|
|
3239
3239
|
}
|
|
3240
|
-
}, `hover-${
|
|
3240
|
+
}, `hover-${ge.current}`) }),
|
|
3241
3241
|
/* @__PURE__ */ (0, $.jsx)(fi, {
|
|
3242
3242
|
blocks: Ze,
|
|
3243
3243
|
dimmed: Xe
|
|
3244
3244
|
}),
|
|
3245
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
3245
|
+
/* @__PURE__ */ (0, $.jsx)(se, { children: qe && /* @__PURE__ */ (0, $.jsx)(x.div, {
|
|
3246
3246
|
"aria-hidden": !0,
|
|
3247
3247
|
className: l("absolute pointer-events-none border border-[color:var(--focus-ring,#6B97FF)] z-20", M.focusRing),
|
|
3248
3248
|
initial: {
|
|
@@ -3268,33 +3268,33 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3268
3268
|
opacity: { duration: .08 }
|
|
3269
3269
|
}
|
|
3270
3270
|
}) }),
|
|
3271
|
-
|
|
3272
|
-
let n = mi(e, t), r =
|
|
3271
|
+
X.map((e, t) => {
|
|
3272
|
+
let n = mi(e, t), r = J.includes(n), i = !W && fe === t;
|
|
3273
3273
|
return /* @__PURE__ */ (0, $.jsx)(vi, {
|
|
3274
3274
|
index: t,
|
|
3275
|
-
registerItem:
|
|
3276
|
-
role:
|
|
3275
|
+
registerItem: ve,
|
|
3276
|
+
role: W ? "checkbox" : "radio",
|
|
3277
3277
|
isSelected: r,
|
|
3278
3278
|
tabIndex: t === nt || nt === -1 && t === 0 ? 0 : -1,
|
|
3279
|
-
onClick: () =>
|
|
3279
|
+
onClick: () => W ? Ne(n) : Me(n),
|
|
3280
3280
|
onKeyDown: (e) => {
|
|
3281
|
-
(e.key === " " || e.key === "Enter") && !e.metaKey && !e.ctrlKey && (e.preventDefault(),
|
|
3281
|
+
(e.key === " " || e.key === "Enter") && !e.metaKey && !e.ctrlKey && (e.preventDefault(), W ? Ne(n) : Me(n));
|
|
3282
3282
|
},
|
|
3283
3283
|
shape: M,
|
|
3284
3284
|
"aria-checked": r,
|
|
3285
3285
|
chipContent: t + 1,
|
|
3286
3286
|
chipFilled: r,
|
|
3287
|
-
isMulti:
|
|
3287
|
+
isMulti: W,
|
|
3288
3288
|
showArrow: i,
|
|
3289
|
-
bodyLayout:
|
|
3290
|
-
topAlign:
|
|
3291
|
-
chipPosition:
|
|
3292
|
-
arrowIcon: /* @__PURE__ */ (0, $.jsx)(
|
|
3289
|
+
bodyLayout: H.layout === "stacked" ? "stacked" : "inline",
|
|
3290
|
+
topAlign: H.layout === "stacked",
|
|
3291
|
+
chipPosition: H.chipPosition ?? "right",
|
|
3292
|
+
arrowIcon: /* @__PURE__ */ (0, $.jsx)(I, {
|
|
3293
3293
|
size: 14,
|
|
3294
3294
|
strokeWidth: 2,
|
|
3295
3295
|
className: "h-3.5 w-3.5"
|
|
3296
3296
|
}),
|
|
3297
|
-
hiddenControl:
|
|
3297
|
+
hiddenControl: W ? /* @__PURE__ */ (0, $.jsx)(Ct, {
|
|
3298
3298
|
name: n,
|
|
3299
3299
|
className: "sr-only",
|
|
3300
3300
|
tabIndex: -1,
|
|
@@ -3305,7 +3305,7 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3305
3305
|
tabIndex: -1,
|
|
3306
3306
|
"aria-hidden": !0
|
|
3307
3307
|
}),
|
|
3308
|
-
children:
|
|
3308
|
+
children: H.layout === "stacked" ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsxs)("span", {
|
|
3309
3309
|
className: "inline-grid",
|
|
3310
3310
|
children: [/* @__PURE__ */ (0, $.jsx)("span", {
|
|
3311
3311
|
className: "col-start-1 row-start-1 invisible",
|
|
@@ -3338,38 +3338,38 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3338
3338
|
})] })] })
|
|
3339
3339
|
}, n);
|
|
3340
3340
|
}),
|
|
3341
|
-
|
|
3342
|
-
index:
|
|
3343
|
-
registerItem:
|
|
3341
|
+
q && /* @__PURE__ */ (0, $.jsx)(vi, {
|
|
3342
|
+
index: re,
|
|
3343
|
+
registerItem: ve,
|
|
3344
3344
|
role: null,
|
|
3345
|
-
isSelected:
|
|
3345
|
+
isSelected: Y.length > 0,
|
|
3346
3346
|
tabIndex: -1,
|
|
3347
|
-
onClick: () =>
|
|
3347
|
+
onClick: () => le.current?.focus(),
|
|
3348
3348
|
shape: M,
|
|
3349
|
-
chipContent:
|
|
3350
|
-
chipFilled:
|
|
3351
|
-
isMulti:
|
|
3352
|
-
topAlign:
|
|
3353
|
-
chipPosition:
|
|
3354
|
-
ariaLabel:
|
|
3355
|
-
showArrow: !
|
|
3356
|
-
arrowIcon: /* @__PURE__ */ (0, $.jsx)(
|
|
3349
|
+
chipContent: re + 1,
|
|
3350
|
+
chipFilled: Y.length > 0,
|
|
3351
|
+
isMulti: W,
|
|
3352
|
+
topAlign: be,
|
|
3353
|
+
chipPosition: H.chipPosition ?? "right",
|
|
3354
|
+
ariaLabel: H.otherPlaceholder ?? "Describe in your own words",
|
|
3355
|
+
showArrow: !W && (Te === re || fe === re) && Y.trim().length > 0,
|
|
3356
|
+
arrowIcon: /* @__PURE__ */ (0, $.jsx)(I, {
|
|
3357
3357
|
size: 14,
|
|
3358
3358
|
strokeWidth: 2,
|
|
3359
3359
|
className: "h-3.5 w-3.5"
|
|
3360
3360
|
}),
|
|
3361
|
-
onArrowClick: !
|
|
3361
|
+
onArrowClick: !W && Y.trim().length > 0 ? Le : void 0,
|
|
3362
3362
|
children: /* @__PURE__ */ (0, $.jsx)("span", {
|
|
3363
3363
|
className: "inline-grid w-full",
|
|
3364
3364
|
children: /* @__PURE__ */ (0, $.jsx)("textarea", {
|
|
3365
|
-
ref:
|
|
3365
|
+
ref: le,
|
|
3366
3366
|
rows: 1,
|
|
3367
|
-
value:
|
|
3368
|
-
placeholder:
|
|
3369
|
-
"aria-label":
|
|
3370
|
-
onChange: (e) =>
|
|
3367
|
+
value: Y,
|
|
3368
|
+
placeholder: H.otherPlaceholder ?? "Describe in your own words…",
|
|
3369
|
+
"aria-label": H.otherPlaceholder ?? "Describe in your own words",
|
|
3370
|
+
onChange: (e) => Fe(e.target.value),
|
|
3371
3371
|
onKeyDown: (e) => {
|
|
3372
|
-
e.key === "Enter" && (e.shiftKey ||
|
|
3372
|
+
e.key === "Enter" && (e.shiftKey || W || (e.preventDefault(), Le()));
|
|
3373
3373
|
},
|
|
3374
3374
|
onClick: (e) => e.stopPropagation(),
|
|
3375
3375
|
className: l("col-start-1 row-start-1 block w-full bg-transparent border-0 p-0 m-0 outline-none resize-none overflow-hidden text-[13px] leading-snug text-foreground placeholder:text-muted-foreground"),
|
|
@@ -3381,21 +3381,21 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3381
3381
|
});
|
|
3382
3382
|
return /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
3383
3383
|
ref: (e) => {
|
|
3384
|
-
|
|
3384
|
+
ae.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
|
|
3385
3385
|
},
|
|
3386
3386
|
className: l("relative w-full max-w-[520px] overflow-hidden bg-card border border-border", M.container, g),
|
|
3387
3387
|
..._,
|
|
3388
3388
|
onKeyDown: (e) => {
|
|
3389
|
-
_.onKeyDown?.(e),
|
|
3389
|
+
_.onKeyDown?.(e), Ge(e);
|
|
3390
3390
|
},
|
|
3391
3391
|
children: [
|
|
3392
3392
|
/* @__PURE__ */ (0, $.jsx)("div", {
|
|
3393
3393
|
className: "flex items-center px-4 sm:px-5 pt-4 sm:pt-5 pb-2 text-[12px] text-muted-foreground",
|
|
3394
3394
|
children: /* @__PURE__ */ (0, $.jsxs)("span", { children: [
|
|
3395
3395
|
"Question ",
|
|
3396
|
-
|
|
3396
|
+
V + 1,
|
|
3397
3397
|
" of ",
|
|
3398
|
-
|
|
3398
|
+
B
|
|
3399
3399
|
] })
|
|
3400
3400
|
}),
|
|
3401
3401
|
f != null && /* @__PURE__ */ (0, $.jsx)("div", {
|
|
@@ -3403,53 +3403,53 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3403
3403
|
children: f
|
|
3404
3404
|
}),
|
|
3405
3405
|
/* @__PURE__ */ (0, $.jsxs)(Yr, {
|
|
3406
|
-
invalid:
|
|
3406
|
+
invalid: De !== null,
|
|
3407
3407
|
className: "contents",
|
|
3408
3408
|
children: [/* @__PURE__ */ (0, $.jsx)(x.div, {
|
|
3409
|
-
animate: { height:
|
|
3409
|
+
animate: { height: Ce },
|
|
3410
3410
|
initial: !1,
|
|
3411
3411
|
transition: P.slow,
|
|
3412
3412
|
className: "overflow-hidden",
|
|
3413
3413
|
children: /* @__PURE__ */ (0, $.jsx)("div", {
|
|
3414
|
-
ref:
|
|
3414
|
+
ref: Se,
|
|
3415
3415
|
className: l("px-4 sm:px-5", tt ? "pb-1" : "pb-2.5 sm:pb-3"),
|
|
3416
3416
|
children: /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
3417
3417
|
className: "flex flex-col gap-2",
|
|
3418
3418
|
children: [/* @__PURE__ */ (0, $.jsx)("h3", {
|
|
3419
|
-
id: `${z}-${
|
|
3419
|
+
id: `${z}-${U}-title`,
|
|
3420
3420
|
className: "text-[16px] text-foreground leading-snug",
|
|
3421
3421
|
style: { fontVariationSettings: v.semibold },
|
|
3422
|
-
children:
|
|
3423
|
-
}),
|
|
3424
|
-
onClick: () =>
|
|
3425
|
-
className: l("relative mt-1 -mx-3 px-3 py-2.5 cursor-text transition-colors",
|
|
3422
|
+
children: H.title
|
|
3423
|
+
}), K ? /* @__PURE__ */ (0, $.jsx)("div", {
|
|
3424
|
+
onClick: () => le.current?.focus(),
|
|
3425
|
+
className: l("relative mt-1 -mx-3 px-3 py-2.5 cursor-text transition-colors", ne ? "min-h-[76px]" : "min-h-10", M.bg, Y.length > 0 ? "bg-active" : "hover:bg-hover focus-within:bg-card focus-within:ring-1 focus-within:ring-inset focus-within:ring-border"),
|
|
3426
3426
|
children: /* @__PURE__ */ (0, $.jsx)(Qr, {
|
|
3427
|
-
value:
|
|
3428
|
-
onValueChange:
|
|
3427
|
+
value: Y,
|
|
3428
|
+
onValueChange: Fe,
|
|
3429
3429
|
render: /* @__PURE__ */ (0, $.jsx)("textarea", {
|
|
3430
|
-
ref:
|
|
3430
|
+
ref: le,
|
|
3431
3431
|
rows: 1,
|
|
3432
|
-
placeholder:
|
|
3433
|
-
"aria-labelledby": `${z}-${
|
|
3432
|
+
placeholder: H.freeTextPlaceholder ?? "Type your answer…",
|
|
3433
|
+
"aria-labelledby": `${z}-${U}-title`,
|
|
3434
3434
|
onKeyDown: (e) => {
|
|
3435
|
-
e.key === "Enter" && (e.shiftKey || e.metaKey || e.ctrlKey ||
|
|
3435
|
+
e.key === "Enter" && (e.shiftKey || e.metaKey || e.ctrlKey || ne || (e.preventDefault(), Le()));
|
|
3436
3436
|
},
|
|
3437
3437
|
className: "block w-full bg-transparent border-0 p-0 m-0 outline-none resize-none overflow-hidden text-[13px] leading-snug text-foreground placeholder:text-muted-foreground",
|
|
3438
3438
|
style: { fontVariationSettings: v.medium }
|
|
3439
3439
|
})
|
|
3440
3440
|
})
|
|
3441
|
-
}) :
|
|
3442
|
-
value:
|
|
3443
|
-
onValueChange:
|
|
3441
|
+
}) : W ? /* @__PURE__ */ (0, $.jsx)(zr, {
|
|
3442
|
+
value: J,
|
|
3443
|
+
onValueChange: Pe,
|
|
3444
3444
|
render: rt
|
|
3445
3445
|
}) : /* @__PURE__ */ (0, $.jsx)(Mr, {
|
|
3446
|
-
value:
|
|
3446
|
+
value: J[0] ?? null,
|
|
3447
3447
|
onValueChange: (e) => {
|
|
3448
|
-
typeof e == "string" &&
|
|
3448
|
+
typeof e == "string" && Me(e);
|
|
3449
3449
|
},
|
|
3450
3450
|
render: rt
|
|
3451
3451
|
})]
|
|
3452
|
-
},
|
|
3452
|
+
}, U)
|
|
3453
3453
|
})
|
|
3454
3454
|
}), tt && /* @__PURE__ */ (0, $.jsx)("div", {
|
|
3455
3455
|
className: "px-4 sm:px-5 pt-1 pb-2",
|
|
@@ -3462,7 +3462,7 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3462
3462
|
className: "shrink-0 px-2 sm:px-3",
|
|
3463
3463
|
children: h
|
|
3464
3464
|
}),
|
|
3465
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
3465
|
+
/* @__PURE__ */ (0, $.jsx)(se, {
|
|
3466
3466
|
mode: "popLayout",
|
|
3467
3467
|
initial: !1,
|
|
3468
3468
|
children: Qe && /* @__PURE__ */ (0, $.jsx)(x.div, {
|
|
@@ -3486,14 +3486,14 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3486
3486
|
children: /* @__PURE__ */ (0, $.jsx)(F, {
|
|
3487
3487
|
variant: "ghost",
|
|
3488
3488
|
size: "sm",
|
|
3489
|
-
leadingIcon:
|
|
3490
|
-
onClick:
|
|
3489
|
+
leadingIcon: L,
|
|
3490
|
+
onClick: Ve,
|
|
3491
3491
|
className: "pl-3 sm:pl-[6px]",
|
|
3492
3492
|
children: "Back"
|
|
3493
3493
|
})
|
|
3494
3494
|
}, "back")
|
|
3495
3495
|
}),
|
|
3496
|
-
|
|
3496
|
+
De && /* @__PURE__ */ (0, $.jsx)(Zr, {
|
|
3497
3497
|
match: !0,
|
|
3498
3498
|
render: /* @__PURE__ */ (0, $.jsx)(x.p, {
|
|
3499
3499
|
role: "alert",
|
|
@@ -3511,12 +3511,12 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3511
3511
|
},
|
|
3512
3512
|
className: "min-w-0 px-2 sm:px-3 text-left text-[12px] leading-snug text-destructive"
|
|
3513
3513
|
}),
|
|
3514
|
-
children:
|
|
3514
|
+
children: De
|
|
3515
3515
|
}, "ft-error")
|
|
3516
3516
|
]
|
|
3517
3517
|
}), /* @__PURE__ */ (0, $.jsx)("div", {
|
|
3518
3518
|
className: "relative flex items-center gap-2",
|
|
3519
|
-
children: /* @__PURE__ */ (0, $.jsxs)(
|
|
3519
|
+
children: /* @__PURE__ */ (0, $.jsxs)(se, {
|
|
3520
3520
|
mode: "popLayout",
|
|
3521
3521
|
initial: !1,
|
|
3522
3522
|
children: [
|
|
@@ -3541,8 +3541,8 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3541
3541
|
children: /* @__PURE__ */ (0, $.jsx)(F, {
|
|
3542
3542
|
variant: "ghost",
|
|
3543
3543
|
size: "sm",
|
|
3544
|
-
trailingIcon:
|
|
3545
|
-
onClick:
|
|
3544
|
+
trailingIcon: R,
|
|
3545
|
+
onClick: ze,
|
|
3546
3546
|
className: "pr-3 sm:pr-[6px]",
|
|
3547
3547
|
children: m
|
|
3548
3548
|
})
|
|
@@ -3568,8 +3568,8 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3568
3568
|
children: /* @__PURE__ */ (0, $.jsx)(F, {
|
|
3569
3569
|
variant: "ghost",
|
|
3570
3570
|
size: "sm",
|
|
3571
|
-
trailingIcon:
|
|
3572
|
-
onClick:
|
|
3571
|
+
trailingIcon: R,
|
|
3572
|
+
onClick: Re,
|
|
3573
3573
|
className: "pr-3 sm:pr-[6px]",
|
|
3574
3574
|
children: d
|
|
3575
3575
|
})
|
|
@@ -3595,17 +3595,17 @@ var hi = [], gi = (0, Q.forwardRef)(function({ questions: e, currentIndex: t, de
|
|
|
3595
3595
|
children: /* @__PURE__ */ (0, $.jsx)(F, {
|
|
3596
3596
|
variant: "primary",
|
|
3597
3597
|
size: "sm",
|
|
3598
|
-
onClick:
|
|
3599
|
-
disabled: (
|
|
3598
|
+
onClick: K ? Le : Be,
|
|
3599
|
+
disabled: (K || J.length === 0) && Y.trim().length === 0,
|
|
3600
3600
|
className: "pr-3 sm:pr-[6px]",
|
|
3601
3601
|
children: /* @__PURE__ */ (0, $.jsxs)("span", {
|
|
3602
3602
|
className: "inline-flex items-center gap-1.5",
|
|
3603
|
-
children: [
|
|
3603
|
+
children: [H.nextLabel ?? (V >= B - 1 ? "Finish" : "Continue"), /* @__PURE__ */ (0, $.jsx)("span", {
|
|
3604
3604
|
className: "hidden sm:contents",
|
|
3605
3605
|
children: /* @__PURE__ */ (0, $.jsxs)(_i, {
|
|
3606
3606
|
shape: M,
|
|
3607
3607
|
tone: "inverted",
|
|
3608
|
-
children: [
|
|
3608
|
+
children: [ee ? "⌘" : "⌃", "↵"]
|
|
3609
3609
|
})
|
|
3610
3610
|
})]
|
|
3611
3611
|
})
|
|
@@ -3632,7 +3632,7 @@ function _i({ children: e, tone: t = "muted", shape: n }) {
|
|
|
3632
3632
|
function vi({ index: e, registerItem: t, role: n, isSelected: r, tabIndex: i, onClick: a, onKeyDown: o, shape: s, chipContent: c, chipFilled: u, isMulti: d, ariaLabel: f, showArrow: p, arrowIcon: m, onArrowClick: h, bodyLayout: g = "inline", topAlign: _ = !1, chipPosition: y = "right", hiddenControl: b, children: S, ...C }) {
|
|
3633
3633
|
let w = (0, Q.useRef)(null);
|
|
3634
3634
|
(0, Q.useEffect)(() => (t(e, w.current), () => t(e, null)), [e, t]);
|
|
3635
|
-
let T = /* @__PURE__ */ (0, $.jsx)(
|
|
3635
|
+
let T = /* @__PURE__ */ (0, $.jsx)(se, { children: p && /* @__PURE__ */ (0, $.jsx)(x.span, {
|
|
3636
3636
|
"aria-hidden": !h,
|
|
3637
3637
|
role: h ? "button" : void 0,
|
|
3638
3638
|
onClick: h ? (e) => {
|
|
@@ -3927,7 +3927,7 @@ function Ci({ request: e, onApprove: t, onReject: n, testId: r = "inline-elicita
|
|
|
3927
3927
|
variant: "outline",
|
|
3928
3928
|
onClick: () => window.open(f, "_blank"),
|
|
3929
3929
|
"data-testid": `${i}-open-url`,
|
|
3930
|
-
children: [/* @__PURE__ */ (0, $.jsx)(
|
|
3930
|
+
children: [/* @__PURE__ */ (0, $.jsx)(Ge, { className: "h-3 w-3 mr-1" }), "Open"]
|
|
3931
3931
|
})]
|
|
3932
3932
|
})]
|
|
3933
3933
|
}),
|
|
@@ -4007,7 +4007,7 @@ function Di({ value: e, onSave: t, disabled: n, isSaving: r = !1, compact: i = !
|
|
|
4007
4007
|
children: "System Prompt"
|
|
4008
4008
|
})]
|
|
4009
4009
|
});
|
|
4010
|
-
return /* @__PURE__ */ (0, $.jsxs)(
|
|
4010
|
+
return /* @__PURE__ */ (0, $.jsxs)(Fe, {
|
|
4011
4011
|
open: a,
|
|
4012
4012
|
onOpenChange: o,
|
|
4013
4013
|
children: [i ? /* @__PURE__ */ (0, $.jsxs)(O, { children: [/* @__PURE__ */ (0, $.jsx)(h, {
|
|
@@ -4016,22 +4016,22 @@ function Di({ value: e, onSave: t, disabled: n, isSaving: r = !1, compact: i = !
|
|
|
4016
4016
|
}), /* @__PURE__ */ (0, $.jsx)(N, {
|
|
4017
4017
|
side: "top",
|
|
4018
4018
|
children: /* @__PURE__ */ (0, $.jsx)("p", { children: m ? "Custom system prompt" : "System Prompt" })
|
|
4019
|
-
})] }) : g, /* @__PURE__ */ (0, $.jsxs)(
|
|
4019
|
+
})] }) : g, /* @__PURE__ */ (0, $.jsxs)(Pe, {
|
|
4020
4020
|
className: "sm:max-w-xl",
|
|
4021
4021
|
children: [
|
|
4022
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
4022
|
+
/* @__PURE__ */ (0, $.jsx)(Ne, { children: /* @__PURE__ */ (0, $.jsx)(Ae, { children: "System Prompt" }) }),
|
|
4023
4023
|
/* @__PURE__ */ (0, $.jsx)(Kt, {
|
|
4024
4024
|
value: s,
|
|
4025
4025
|
onChange: (e) => c(e.target.value),
|
|
4026
4026
|
placeholder: "Describe the assistant's behavior...",
|
|
4027
4027
|
className: "min-h-[160px] text-sm"
|
|
4028
4028
|
}),
|
|
4029
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
4029
|
+
/* @__PURE__ */ (0, $.jsx)(ke, { children: /* @__PURE__ */ (0, $.jsxs)(F, {
|
|
4030
4030
|
size: "sm",
|
|
4031
4031
|
onClick: f,
|
|
4032
4032
|
disabled: p || s === (e ?? ""),
|
|
4033
4033
|
className: "gap-1.5",
|
|
4034
|
-
children: [p ? /* @__PURE__ */ (0, $.jsx)(it, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, $.jsx)(
|
|
4034
|
+
children: [p ? /* @__PURE__ */ (0, $.jsx)(it, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, $.jsx)(Le, { className: "h-3.5 w-3.5" }), "Save"]
|
|
4035
4035
|
}) })
|
|
4036
4036
|
]
|
|
4037
4037
|
})]
|
|
@@ -4039,8 +4039,8 @@ function Di({ value: e, onSave: t, disabled: n, isSaving: r = !1, compact: i = !
|
|
|
4039
4039
|
}
|
|
4040
4040
|
//#endregion
|
|
4041
4041
|
//#region src/client/components/chat/ChatInputArea.tsx
|
|
4042
|
-
function Oi({ inputValue: e, isConnected: t, isLoading: n, textareaRef: r, llmConfig: i, promptsDropdownOpen: a, promptFocusedIndex: o, prompts: s, selectedPrompt: c, promptResults: u, attachments: d, tools: f, disabledTools: p, onDisabledToolsChange: m, onInputChange: g, onKeyDown: _, onKeyUp: v, onClick: y, onSendMessage: b, onStopStreaming: x, onConfigDialogOpenChange: S, onPromptSelect: C, onDeletePromptResult: w, onAttachmentAdd: T, onAttachmentRemove: E, hideModelBadge: D, freeTierInfo: k, managedCloudInfo: A, modelBadgeMode: j = "byok", modelDisplayName: M, followups: P = [], onFollowupSelect:
|
|
4043
|
-
let
|
|
4042
|
+
function Oi({ inputValue: e, isConnected: t, isLoading: n, textareaRef: r, llmConfig: i, promptsDropdownOpen: a, promptFocusedIndex: o, prompts: s, selectedPrompt: c, promptResults: u, attachments: d, tools: f, disabledTools: p, onDisabledToolsChange: m, onInputChange: g, onKeyDown: _, onKeyUp: v, onClick: y, onSendMessage: b, onStopStreaming: x, onConfigDialogOpenChange: S, onPromptSelect: C, onDeletePromptResult: w, onAttachmentAdd: T, onAttachmentRemove: E, hideModelBadge: D, freeTierInfo: k, managedCloudInfo: A, modelBadgeMode: j = "byok", modelDisplayName: M, followups: P = [], onFollowupSelect: I, pendingElicitationRequests: L, onApproveElicitation: R, onRejectElicitation: ee, systemPromptProvider: z }) {
|
|
4043
|
+
let B = e.trim() || u.length > 0 || d.length > 0, V = (L?.length ?? 0) > 0, H = i && (!D || k || A) ? /* @__PURE__ */ (0, $.jsxs)(O, { children: [/* @__PURE__ */ (0, $.jsx)(h, {
|
|
4044
4044
|
render: /* @__PURE__ */ (0, $.jsx)(tt, {
|
|
4045
4045
|
provider: i.provider,
|
|
4046
4046
|
model: i.model,
|
|
@@ -4056,10 +4056,10 @@ function Oi({ inputValue: e, isConnected: t, isLoading: n, textareaRef: r, llmCo
|
|
|
4056
4056
|
children: /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
4057
4057
|
className: "relative w-full max-w-3xl backdrop-blur-xl",
|
|
4058
4058
|
children: [
|
|
4059
|
-
|
|
4060
|
-
requests:
|
|
4061
|
-
onApprove:
|
|
4062
|
-
onReject:
|
|
4059
|
+
V && R && ee && /* @__PURE__ */ (0, $.jsx)(wi, {
|
|
4060
|
+
requests: L,
|
|
4061
|
+
onApprove: R,
|
|
4062
|
+
onReject: ee
|
|
4063
4063
|
}),
|
|
4064
4064
|
P.length > 0 && /* @__PURE__ */ (0, $.jsx)("div", {
|
|
4065
4065
|
className: "mb-2 flex flex-wrap gap-2",
|
|
@@ -4068,7 +4068,7 @@ function Oi({ inputValue: e, isConnected: t, isLoading: n, textareaRef: r, llmCo
|
|
|
4068
4068
|
variant: "outline",
|
|
4069
4069
|
size: "sm",
|
|
4070
4070
|
className: "rounded-full",
|
|
4071
|
-
onClick: () =>
|
|
4071
|
+
onClick: () => I?.(e),
|
|
4072
4072
|
disabled: n || !t,
|
|
4073
4073
|
children: e
|
|
4074
4074
|
}, e))
|
|
@@ -4108,15 +4108,15 @@ function Oi({ inputValue: e, isConnected: t, isLoading: n, textareaRef: r, llmCo
|
|
|
4108
4108
|
disabled: !t || n || z.disabled,
|
|
4109
4109
|
isSaving: z.isSaving
|
|
4110
4110
|
}) : null,
|
|
4111
|
-
trailingControls: /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
|
|
4111
|
+
trailingControls: /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [H, /* @__PURE__ */ (0, $.jsx)(F, {
|
|
4112
4112
|
type: "button",
|
|
4113
4113
|
size: "sm",
|
|
4114
|
-
className: l("h-8 w-8 rounded-full p-0", n && "animate-spin", !
|
|
4115
|
-
disabled: !n && (!
|
|
4114
|
+
className: l("h-8 w-8 rounded-full p-0", n && "animate-spin", !B && !n && "bg-zinc-400"),
|
|
4115
|
+
disabled: !n && (!B || !t || V),
|
|
4116
4116
|
title: n ? "Stop streaming" : "Send",
|
|
4117
4117
|
onClick: n ? x : b,
|
|
4118
4118
|
"data-testid": "chat-send-button",
|
|
4119
|
-
children: n ? /* @__PURE__ */ (0, $.jsx)(it, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, $.jsx)(
|
|
4119
|
+
children: n ? /* @__PURE__ */ (0, $.jsx)(it, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, $.jsx)(Me, { className: "h-3.5 w-3.5" })
|
|
4120
4120
|
})] })
|
|
4121
4121
|
})
|
|
4122
4122
|
]
|
|
@@ -4181,7 +4181,7 @@ function Ai({ onConfigureClick: e }) {
|
|
|
4181
4181
|
/* @__PURE__ */ (0, $.jsxs)(F, {
|
|
4182
4182
|
onClick: e,
|
|
4183
4183
|
"data-testid": "chat-configure-api-key-button",
|
|
4184
|
-
children: [/* @__PURE__ */ (0, $.jsx)(
|
|
4184
|
+
children: [/* @__PURE__ */ (0, $.jsx)(Oe, { className: "h-4 w-4 mr-2" }), "Configure API Key"]
|
|
4185
4185
|
})
|
|
4186
4186
|
]
|
|
4187
4187
|
});
|
|
@@ -4346,11 +4346,11 @@ function Ri({ text: e }) {
|
|
|
4346
4346
|
type: "button",
|
|
4347
4347
|
className: "text-muted-foreground hover:text-foreground flex items-center rounded p-0.5",
|
|
4348
4348
|
onClick: async () => {
|
|
4349
|
-
await
|
|
4349
|
+
await ze(e), n(!0), setTimeout(() => n(!1), 2e3);
|
|
4350
4350
|
},
|
|
4351
4351
|
title: "Copy message content",
|
|
4352
4352
|
"data-testid": "copy-button",
|
|
4353
|
-
children: t ? /* @__PURE__ */ (0, $.jsx)(
|
|
4353
|
+
children: t ? /* @__PURE__ */ (0, $.jsx)(Le, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, $.jsx)(Re, { className: "h-3.5 w-3.5" })
|
|
4354
4354
|
});
|
|
4355
4355
|
}
|
|
4356
4356
|
//#endregion
|
|
@@ -4399,9 +4399,9 @@ function Hi({ toolName: e, args: t, result: n, state: r = "result", partialArgs:
|
|
|
4399
4399
|
let a = r === "call" && i ? i : t, o = () => {
|
|
4400
4400
|
switch (r) {
|
|
4401
4401
|
case "call": return /* @__PURE__ */ (0, $.jsx)(it, { className: "h-4 w-4 animate-spin text-blue-500 dark:text-blue-400" });
|
|
4402
|
-
case "result": return /* @__PURE__ */ (0, $.jsx)(
|
|
4402
|
+
case "result": return /* @__PURE__ */ (0, $.jsx)(Le, { className: "h-4 w-4 text-emerald-800 dark:text-emerald-400" });
|
|
4403
4403
|
case "error": return /* @__PURE__ */ (0, $.jsx)(ct, { className: "h-4 w-4 text-red-500 dark:text-red-400" });
|
|
4404
|
-
default: return /* @__PURE__ */ (0, $.jsx)(
|
|
4404
|
+
default: return /* @__PURE__ */ (0, $.jsx)(Le, { className: "h-4 w-4 text-emerald-800 dark:text-emerald-400" });
|
|
4405
4405
|
}
|
|
4406
4406
|
}, s = () => {
|
|
4407
4407
|
switch (r) {
|
|
@@ -4410,8 +4410,8 @@ function Hi({ toolName: e, args: t, result: n, state: r = "result", partialArgs:
|
|
|
4410
4410
|
case "error": return " bg-red-500/20 dark:bg-red-500/20";
|
|
4411
4411
|
default: return " bg-emerald-500/20 dark:bg-emerald-500/20";
|
|
4412
4412
|
}
|
|
4413
|
-
}, c = (e) => typeof e == "object" ?
|
|
4414
|
-
return /* @__PURE__ */ (0, $.jsxs)(
|
|
4413
|
+
}, c = (e) => typeof e == "object" ? He(e).preview : String(e);
|
|
4414
|
+
return /* @__PURE__ */ (0, $.jsxs)(Y, { children: [/* @__PURE__ */ (0, $.jsx)(ne, {
|
|
4415
4415
|
render: /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
4416
4416
|
className: "flex max-w-min items-center gap-3 p-1 rounded-full border bg-card hover:bg-accent/50 transition-colors cursor-pointer my-4",
|
|
4417
4417
|
"data-testid": `chat-tool-call-${e}`,
|
|
@@ -4446,14 +4446,14 @@ function Hi({ toolName: e, args: t, result: n, state: r = "result", partialArgs:
|
|
|
4446
4446
|
]
|
|
4447
4447
|
}),
|
|
4448
4448
|
nativeButton: !1
|
|
4449
|
-
}), /* @__PURE__ */ (0, $.jsxs)(
|
|
4449
|
+
}), /* @__PURE__ */ (0, $.jsxs)(K, {
|
|
4450
4450
|
side: "right",
|
|
4451
4451
|
className: "w-[400px] sm:w-[540px] p-4 overflow-y-auto",
|
|
4452
4452
|
"data-testid": "chat-tool-drawer",
|
|
4453
|
-
children: [/* @__PURE__ */ (0, $.jsxs)(
|
|
4453
|
+
children: [/* @__PURE__ */ (0, $.jsxs)(W, { children: [/* @__PURE__ */ (0, $.jsxs)(V, {
|
|
4454
4454
|
className: "flex items-center gap-2",
|
|
4455
4455
|
children: [/* @__PURE__ */ (0, $.jsx)(st, { className: "h-5 w-5" }), "Tool Call Details"]
|
|
4456
|
-
}), /* @__PURE__ */ (0, $.jsxs)(
|
|
4456
|
+
}), /* @__PURE__ */ (0, $.jsxs)(q, {
|
|
4457
4457
|
className: "flex items-center gap-2",
|
|
4458
4458
|
children: [
|
|
4459
4459
|
e,
|
|
@@ -4478,10 +4478,10 @@ function Hi({ toolName: e, args: t, result: n, state: r = "result", partialArgs:
|
|
|
4478
4478
|
}), /* @__PURE__ */ (0, $.jsx)(F, {
|
|
4479
4479
|
variant: "ghost",
|
|
4480
4480
|
size: "sm",
|
|
4481
|
-
onClick: () =>
|
|
4481
|
+
onClick: () => ze(c(a)),
|
|
4482
4482
|
className: "absolute top-2 right-2 h-6 w-6 p-0 opacity-70 hover:opacity-100",
|
|
4483
4483
|
title: "Copy arguments",
|
|
4484
|
-
children: /* @__PURE__ */ (0, $.jsx)(
|
|
4484
|
+
children: /* @__PURE__ */ (0, $.jsx)(Re, { className: "h-3 w-3" })
|
|
4485
4485
|
})]
|
|
4486
4486
|
})] }), n && /* @__PURE__ */ (0, $.jsxs)("div", { children: [/* @__PURE__ */ (0, $.jsx)("h3", {
|
|
4487
4487
|
className: "text-sm font-medium mb-2",
|
|
@@ -4506,23 +4506,23 @@ function Hi({ toolName: e, args: t, result: n, state: r = "result", partialArgs:
|
|
|
4506
4506
|
}), /* @__PURE__ */ (0, $.jsx)(F, {
|
|
4507
4507
|
variant: "ghost",
|
|
4508
4508
|
size: "sm",
|
|
4509
|
-
onClick: () =>
|
|
4509
|
+
onClick: () => ze(n),
|
|
4510
4510
|
className: "absolute top-2 right-2 h-6 w-6 p-0 opacity-70 hover:opacity-100",
|
|
4511
4511
|
title: "Copy result",
|
|
4512
|
-
children: /* @__PURE__ */ (0, $.jsx)(
|
|
4512
|
+
children: /* @__PURE__ */ (0, $.jsx)(Re, { className: "h-3 w-3" })
|
|
4513
4513
|
})]
|
|
4514
4514
|
}) : /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
4515
4515
|
className: l("p-3 rounded-lg border text-sm leading-relaxed max-h-96 overflow-y-auto max-w-full", r === "error" ? "bg-destructive/10 border-destructive/20 text-destructive-foreground" : "bg-muted/30 border-border"),
|
|
4516
|
-
children: [/* @__PURE__ */ (0, $.jsx)(
|
|
4516
|
+
children: [/* @__PURE__ */ (0, $.jsx)(We, {
|
|
4517
4517
|
data: n,
|
|
4518
4518
|
filename: `tool-call-${e}-result-${Date.now()}.json`
|
|
4519
4519
|
}), /* @__PURE__ */ (0, $.jsx)(F, {
|
|
4520
4520
|
variant: "ghost",
|
|
4521
4521
|
size: "sm",
|
|
4522
|
-
onClick: () =>
|
|
4522
|
+
onClick: () => ze(JSON.stringify(n, null, 2)),
|
|
4523
4523
|
className: "absolute top-2 right-2 h-6 w-6 p-0 opacity-70 hover:opacity-100",
|
|
4524
4524
|
title: "Copy result",
|
|
4525
|
-
children: /* @__PURE__ */ (0, $.jsx)(
|
|
4525
|
+
children: /* @__PURE__ */ (0, $.jsx)(Re, { className: "h-3 w-3" })
|
|
4526
4526
|
})]
|
|
4527
4527
|
})
|
|
4528
4528
|
})] })]
|
|
@@ -4559,28 +4559,28 @@ function Wi({ toolName: e, toolArgs: t, result: n, serverId: r, readResource: i,
|
|
|
4559
4559
|
return n;
|
|
4560
4560
|
}
|
|
4561
4561
|
return n;
|
|
4562
|
-
}, [n]), d = ft(a), f = d ? a?.ui?.resourceUri ?? null : null, p = (0, Q.useMemo)(() =>
|
|
4562
|
+
}, [n]), d = ft(a), f = d ? a?.ui?.resourceUri ?? null : null, p = (0, Q.useMemo)(() => u, [e, u]), m = Xt({
|
|
4563
4563
|
serverId: r ?? "",
|
|
4564
4564
|
viewId: l,
|
|
4565
4565
|
resourceUri: f ?? "",
|
|
4566
4566
|
toolName: e,
|
|
4567
|
-
toolInput:
|
|
4568
|
-
toolOutput:
|
|
4567
|
+
toolInput: t,
|
|
4568
|
+
toolOutput: p,
|
|
4569
4569
|
toolMetadata: a,
|
|
4570
4570
|
readResource: i ?? (async () => ({}))
|
|
4571
4571
|
});
|
|
4572
|
-
return d && f && r && i &&
|
|
4572
|
+
return d && f && r && i && m ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(pt, {
|
|
4573
4573
|
viewId: l,
|
|
4574
4574
|
toolName: e,
|
|
4575
|
-
toolInput:
|
|
4576
|
-
toolOutput:
|
|
4575
|
+
toolInput: t,
|
|
4576
|
+
toolOutput: p,
|
|
4577
4577
|
partialToolInput: s,
|
|
4578
4578
|
cancelled: c,
|
|
4579
4579
|
className: "my-4",
|
|
4580
4580
|
onMessage: (e) => {
|
|
4581
4581
|
e.length > 0 && o && o(e);
|
|
4582
4582
|
},
|
|
4583
|
-
...
|
|
4583
|
+
...m
|
|
4584
4584
|
}), /* @__PURE__ */ (0, $.jsx)(Ui, { widgetId: l })] }) : d && !f ? /* @__PURE__ */ (0, $.jsx)("div", {
|
|
4585
4585
|
className: "flex items-center justify-center w-full h-[200px] rounded border",
|
|
4586
4586
|
children: /* @__PURE__ */ (0, $.jsx)(_t, { className: "size-5" })
|
|
@@ -4818,7 +4818,7 @@ var aa = (0, Q.memo)(({ messages: e, isLoading: t, serverId: n, readResource: r,
|
|
|
4818
4818
|
return /* @__PURE__ */ (0, $.jsx)("div", {
|
|
4819
4819
|
className: "space-y-4",
|
|
4820
4820
|
children: e.parts && e.parts.length > 0 ? e.parts.map((t, o) => {
|
|
4821
|
-
let s = t.type === "text" ? `${e.id}-text-${o}` : `${e.id}-tool-${t.toolInvocation?.toolName}-${o}`;
|
|
4821
|
+
let s = t.type === "text" ? `${e.id}-text-${o}` : `${e.id}-tool-${t.toolInvocation?.toolCallId ?? `${t.toolInvocation?.toolName}-${o}`}`;
|
|
4822
4822
|
return t.type === "text" ? /* @__PURE__ */ (0, $.jsx)(Vi, {
|
|
4823
4823
|
content: t.text || "",
|
|
4824
4824
|
timestamp: o === e.parts.length - 1 ? e.timestamp : void 0,
|
|
@@ -4905,7 +4905,7 @@ var aa = (0, Q.memo)(({ messages: e, isLoading: t, serverId: n, readResource: r,
|
|
|
4905
4905
|
function oa({ visible: e, onClick: t }) {
|
|
4906
4906
|
return /* @__PURE__ */ (0, $.jsx)("div", {
|
|
4907
4907
|
className: "pointer-events-none absolute bottom-2 left-0 right-0 z-30 flex justify-center",
|
|
4908
|
-
children: /* @__PURE__ */ (0, $.jsx)(
|
|
4908
|
+
children: /* @__PURE__ */ (0, $.jsx)(se, { children: e && /* @__PURE__ */ (0, $.jsx)(x.div, {
|
|
4909
4909
|
initial: {
|
|
4910
4910
|
opacity: 0,
|
|
4911
4911
|
y: 8,
|
|
@@ -5049,8 +5049,33 @@ var ua = (e) => {
|
|
|
5049
5049
|
return t;
|
|
5050
5050
|
};
|
|
5051
5051
|
//#endregion
|
|
5052
|
+
//#region src/client/components/chat/partialToolArgs.ts
|
|
5053
|
+
function da(e) {
|
|
5054
|
+
if (!e) return;
|
|
5055
|
+
let t = fa(e);
|
|
5056
|
+
if (t) return t;
|
|
5057
|
+
let n = [], r = !1, i = !1;
|
|
5058
|
+
for (let t of e) {
|
|
5059
|
+
if (r) {
|
|
5060
|
+
i ? i = !1 : t === "\\" ? i = !0 : t === "\"" && (r = !1);
|
|
5061
|
+
continue;
|
|
5062
|
+
}
|
|
5063
|
+
t === "\"" ? r = !0 : t === "{" ? n.push("}") : t === "[" ? n.push("]") : (t === "}" || t === "]") && n[n.length - 1] === t && n.pop();
|
|
5064
|
+
}
|
|
5065
|
+
let a = e;
|
|
5066
|
+
return r && i && (a = a.slice(0, -1)), r && (a += "\""), a += [...n].reverse().join(""), fa(a);
|
|
5067
|
+
}
|
|
5068
|
+
function fa(e) {
|
|
5069
|
+
try {
|
|
5070
|
+
let t = JSON.parse(e);
|
|
5071
|
+
return t !== null && !Array.isArray(t) && typeof t == "object" ? t : void 0;
|
|
5072
|
+
} catch {
|
|
5073
|
+
return;
|
|
5074
|
+
}
|
|
5075
|
+
}
|
|
5076
|
+
//#endregion
|
|
5052
5077
|
//#region src/client/components/chat/useChatMessages.ts
|
|
5053
|
-
function
|
|
5078
|
+
function pa({ mcpServerUrl: e, llmConfig: t, authConfig: n, mcpAuthTokens: r, isConnected: i, chatApiUrl: a, waitForChatApiUrl: o, widgetModelContexts: s, initialMessages: c, disabledTools: l, streamProtocol: u = "sse", credentials: d, extraHeaders: f, body: p }) {
|
|
5054
5079
|
let [m, h] = (0, Q.useState)(c ?? []), [g, _] = (0, Q.useState)(!1), [v, y] = (0, Q.useState)([]), [b, x] = (0, Q.useState)(qi), [S, C] = (0, Q.useState)(null), [w, T] = (0, Q.useState)(null), E = (0, Q.useRef)(null), D = (0, Q.useRef)(0), O = (0, Q.useCallback)((e) => {
|
|
5055
5080
|
let t = {
|
|
5056
5081
|
...e,
|
|
@@ -5192,19 +5217,40 @@ function da({ mcpServerUrl: e, llmConfig: t, authConfig: n, mcpAuthTokens: r, is
|
|
|
5192
5217
|
type: "text",
|
|
5193
5218
|
text: k
|
|
5194
5219
|
}), N();
|
|
5220
|
+
}, I = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ new Map(), R = (e, t) => {
|
|
5221
|
+
k &&= "", !I.has(e) && (A.push({
|
|
5222
|
+
type: "tool-invocation",
|
|
5223
|
+
toolInvocation: {
|
|
5224
|
+
toolCallId: e,
|
|
5225
|
+
toolName: t,
|
|
5226
|
+
args: {},
|
|
5227
|
+
state: "streaming",
|
|
5228
|
+
partialArgs: {}
|
|
5229
|
+
}
|
|
5230
|
+
}), I.set(e, A.length - 1), L.set(e, ""), N());
|
|
5195
5231
|
}, ee = (e, t) => {
|
|
5196
|
-
|
|
5232
|
+
let n = I.get(e);
|
|
5233
|
+
if (n === void 0 || !t) return;
|
|
5234
|
+
let r = (L.get(e) ?? "") + t;
|
|
5235
|
+
L.set(e, r);
|
|
5236
|
+
let i = da(r), a = A[n]?.toolInvocation;
|
|
5237
|
+
!i || !a || (a.partialArgs = i, N());
|
|
5238
|
+
}, z = (e, t, n) => {
|
|
5239
|
+
k &&= "";
|
|
5240
|
+
let r = I.get(e), i = r === void 0 ? void 0 : A[r]?.toolInvocation;
|
|
5241
|
+
i ? (i.toolName = t, i.args = n, i.state = "pending", i.partialArgs = void 0) : (A.push({
|
|
5197
5242
|
type: "tool-invocation",
|
|
5198
5243
|
toolInvocation: {
|
|
5199
|
-
|
|
5200
|
-
|
|
5244
|
+
toolCallId: e,
|
|
5245
|
+
toolName: t,
|
|
5246
|
+
args: n,
|
|
5201
5247
|
state: "pending"
|
|
5202
5248
|
}
|
|
5203
|
-
}), N();
|
|
5204
|
-
},
|
|
5249
|
+
}), I.set(e, A.length - 1)), L.delete(e), N();
|
|
5250
|
+
}, B = (e, t) => {
|
|
5205
5251
|
let n;
|
|
5206
5252
|
n = e.by === "toolName" ? A.find((t) => t.type === "tool-invocation" && t.toolInvocation?.toolName === e.toolName && !t.toolInvocation?.result) : A[e.index], n?.toolInvocation && (n.toolInvocation.result = t, n.toolInvocation.state = t?.isError ? "error" : "result", N());
|
|
5207
|
-
},
|
|
5253
|
+
}, V = "";
|
|
5208
5254
|
for (;;) {
|
|
5209
5255
|
if (E.current?.signal.aborted) {
|
|
5210
5256
|
await j.cancel();
|
|
@@ -5212,9 +5258,9 @@ function da({ mcpServerUrl: e, llmConfig: t, authConfig: n, mcpAuthTokens: r, is
|
|
|
5212
5258
|
}
|
|
5213
5259
|
let { done: e, value: t } = await j.read();
|
|
5214
5260
|
if (e) break;
|
|
5215
|
-
|
|
5216
|
-
let n =
|
|
5217
|
-
|
|
5261
|
+
V += M.decode(t, { stream: !0 });
|
|
5262
|
+
let n = V.split("\n");
|
|
5263
|
+
V = n.pop() || "";
|
|
5218
5264
|
for (let e of n) if (e.trim()) try {
|
|
5219
5265
|
if (u === "data-stream") {
|
|
5220
5266
|
let t = e.indexOf(":");
|
|
@@ -5235,6 +5281,21 @@ function da({ mcpServerUrl: e, llmConfig: t, authConfig: n, mcpAuthTokens: r, is
|
|
|
5235
5281
|
}), F(e);
|
|
5236
5282
|
break;
|
|
5237
5283
|
}
|
|
5284
|
+
case "b": {
|
|
5285
|
+
let e = i, t = String(e.toolCallId ?? `tool-${A.length}`), n = String(e.toolName ?? "");
|
|
5286
|
+
O({
|
|
5287
|
+
type: "tool-call-start",
|
|
5288
|
+
toolCallId: t,
|
|
5289
|
+
toolName: n,
|
|
5290
|
+
raw: i
|
|
5291
|
+
}), R(t, n);
|
|
5292
|
+
break;
|
|
5293
|
+
}
|
|
5294
|
+
case "c": {
|
|
5295
|
+
let e = i;
|
|
5296
|
+
ee(String(e.toolCallId ?? ""), String(e.argsTextDelta ?? e.argsDelta ?? ""));
|
|
5297
|
+
break;
|
|
5298
|
+
}
|
|
5238
5299
|
case "9": {
|
|
5239
5300
|
let e = i, t = e.args ?? {};
|
|
5240
5301
|
if (typeof t.input == "string" && Object.keys(t).length === 1) try {
|
|
@@ -5242,7 +5303,7 @@ function da({ mcpServerUrl: e, llmConfig: t, authConfig: n, mcpAuthTokens: r, is
|
|
|
5242
5303
|
typeof e == "object" && e && (t = e);
|
|
5243
5304
|
} catch {}
|
|
5244
5305
|
let n = String(e.toolCallId ?? `tool-${A.length}`), r = String(e.toolName ?? "");
|
|
5245
|
-
O({
|
|
5306
|
+
I.has(n) || O({
|
|
5246
5307
|
type: "tool-call-start",
|
|
5247
5308
|
toolCallId: n,
|
|
5248
5309
|
toolName: r,
|
|
@@ -5253,11 +5314,11 @@ function da({ mcpServerUrl: e, llmConfig: t, authConfig: n, mcpAuthTokens: r, is
|
|
|
5253
5314
|
toolName: r,
|
|
5254
5315
|
args: t,
|
|
5255
5316
|
raw: i
|
|
5256
|
-
}),
|
|
5317
|
+
}), z(n, r, t);
|
|
5257
5318
|
break;
|
|
5258
5319
|
}
|
|
5259
5320
|
case "a": {
|
|
5260
|
-
let e = i, t =
|
|
5321
|
+
let e = i, t = I.get(e.toolCallId), n = e.result, r = n;
|
|
5261
5322
|
if (r?.lc === 1 && r?.type === "constructor" && r?.kwargs?.content) {
|
|
5262
5323
|
let e = r.kwargs.content;
|
|
5263
5324
|
if (typeof e == "string") try {
|
|
@@ -5273,7 +5334,7 @@ function da({ mcpServerUrl: e, llmConfig: t, authConfig: n, mcpAuthTokens: r, is
|
|
|
5273
5334
|
result: n,
|
|
5274
5335
|
isError: !!(n && typeof n == "object" && n.isError),
|
|
5275
5336
|
raw: i
|
|
5276
|
-
}),
|
|
5337
|
+
}), B({
|
|
5277
5338
|
by: "index",
|
|
5278
5339
|
index: t
|
|
5279
5340
|
}, n));
|
|
@@ -5307,32 +5368,47 @@ function da({ mcpServerUrl: e, llmConfig: t, authConfig: n, mcpAuthTokens: r, is
|
|
|
5307
5368
|
delta: t.content,
|
|
5308
5369
|
raw: t
|
|
5309
5370
|
}), F(t.content);
|
|
5310
|
-
else if (t.type === "tool-call") {
|
|
5371
|
+
else if (t.type === "tool-call-start") {
|
|
5311
5372
|
let e = t.toolCallId ?? `tool-${A.length}`;
|
|
5312
5373
|
O({
|
|
5313
5374
|
type: "tool-call-start",
|
|
5314
5375
|
toolCallId: e,
|
|
5315
5376
|
toolName: t.toolName,
|
|
5316
5377
|
raw: t
|
|
5378
|
+
}), R(e, t.toolName);
|
|
5379
|
+
} else if (t.type === "tool-call-delta" || t.type === "tool-call-args-delta") ee(t.toolCallId, t.argsDelta ?? t.argsTextDelta ?? "");
|
|
5380
|
+
else if (t.type === "tool-call") {
|
|
5381
|
+
let e = t.toolCallId ?? `tool-${A.length}`;
|
|
5382
|
+
I.has(e) || O({
|
|
5383
|
+
type: "tool-call-start",
|
|
5384
|
+
toolCallId: e,
|
|
5385
|
+
toolName: t.toolName,
|
|
5386
|
+
raw: t
|
|
5317
5387
|
}), O({
|
|
5318
5388
|
type: "tool-call-args",
|
|
5319
5389
|
toolCallId: e,
|
|
5320
5390
|
toolName: t.toolName,
|
|
5321
5391
|
args: t.args,
|
|
5322
5392
|
raw: t
|
|
5323
|
-
}),
|
|
5324
|
-
} else if (t.type === "tool-result")
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5393
|
+
}), z(e, t.toolName, t.args);
|
|
5394
|
+
} else if (t.type === "tool-result") {
|
|
5395
|
+
O({
|
|
5396
|
+
type: "tool-result",
|
|
5397
|
+
toolCallId: t.toolCallId,
|
|
5398
|
+
toolName: t.toolName,
|
|
5399
|
+
result: t.result,
|
|
5400
|
+
isError: t.isError ?? t.result?.isError,
|
|
5401
|
+
raw: t
|
|
5402
|
+
});
|
|
5403
|
+
let e = I.get(t.toolCallId);
|
|
5404
|
+
B(e === void 0 ? {
|
|
5405
|
+
by: "toolName",
|
|
5406
|
+
toolName: t.toolName
|
|
5407
|
+
} : {
|
|
5408
|
+
by: "index",
|
|
5409
|
+
index: e
|
|
5410
|
+
}, t.result);
|
|
5411
|
+
} else if (t.type === "done") {
|
|
5336
5412
|
let e = Ji(t.usage);
|
|
5337
5413
|
e && O({
|
|
5338
5414
|
type: "usage",
|
|
@@ -5362,7 +5438,7 @@ function da({ mcpServerUrl: e, llmConfig: t, authConfig: n, mcpAuthTokens: r, is
|
|
|
5362
5438
|
}
|
|
5363
5439
|
}
|
|
5364
5440
|
if (E.current?.signal.aborted) {
|
|
5365
|
-
for (let e of A) e.type === "tool-invocation" && e.toolInvocation?.state === "pending" && (e.toolInvocation.state = "error", e.toolInvocation.result = "Cancelled by user");
|
|
5441
|
+
for (let e of A) e.type === "tool-invocation" && (e.toolInvocation?.state === "pending" || e.toolInvocation?.state === "streaming") && (e.toolInvocation.state = "error", e.toolInvocation.result = "Cancelled by user");
|
|
5366
5442
|
h((e) => e.map((e) => e.id === D ? {
|
|
5367
5443
|
...e,
|
|
5368
5444
|
parts: [...A],
|
|
@@ -5456,7 +5532,7 @@ function da({ mcpServerUrl: e, llmConfig: t, authConfig: n, mcpAuthTokens: r, is
|
|
|
5456
5532
|
}
|
|
5457
5533
|
//#endregion
|
|
5458
5534
|
//#region src/client/components/chat/useChatMessagesClientSide.ts
|
|
5459
|
-
function
|
|
5535
|
+
function ma({ connection: e, llmConfig: t, isConnected: n, readResource: r, widgetModelContexts: i, disabledTools: a, initialMessages: o, systemPrompt: s = Ti }) {
|
|
5460
5536
|
let [c, l] = (0, Q.useState)(o ?? []), [u, d] = (0, Q.useState)(!1), [f, p] = (0, Q.useState)([]), [m, h] = (0, Q.useState)(qi), [g, _] = (0, Q.useState)(null), v = (0, Q.useRef)(null), y = (0, Q.useRef)(0), b = (0, Q.useCallback)((e) => {
|
|
5461
5537
|
let t = {
|
|
5462
5538
|
...e,
|
|
@@ -5529,31 +5605,7 @@ function fa({ connection: e, llmConfig: t, isConnected: n, readResource: r, widg
|
|
|
5529
5605
|
disallowedTools: a ? [...a] : void 0,
|
|
5530
5606
|
maxSteps: 10,
|
|
5531
5607
|
autoInitialize: !0
|
|
5532
|
-
}), w = (
|
|
5533
|
-
try {
|
|
5534
|
-
return JSON.parse(e);
|
|
5535
|
-
} catch {
|
|
5536
|
-
let t = [() => {
|
|
5537
|
-
let t = e;
|
|
5538
|
-
(t.match(/(?<!\\)"/g) || []).length % 2 != 0 && (t += "\"");
|
|
5539
|
-
let n = (t.match(/{/g) || []).length - (t.match(/}/g) || []).length, r = (t.match(/\[/g) || []).length - (t.match(/]/g) || []).length;
|
|
5540
|
-
for (let e = 0; e < r; e++) t += "]";
|
|
5541
|
-
for (let e = 0; e < n; e++) t += "}";
|
|
5542
|
-
return JSON.parse(t);
|
|
5543
|
-
}, () => {
|
|
5544
|
-
let t = e;
|
|
5545
|
-
t = t.replace(/,\s*"[^"]*"?\s*:\s*("([^"\\]|\\.)*)?$/, ""), t = t.replace(/,\s*"[^"]*$/, ""), (t.match(/(?<!\\)"/g) || []).length % 2 != 0 && (t += "\"");
|
|
5546
|
-
let n = (t.match(/{/g) || []).length - (t.match(/}/g) || []).length, r = (t.match(/\[/g) || []).length - (t.match(/]/g) || []).length;
|
|
5547
|
-
for (let e = 0; e < r; e++) t += "]";
|
|
5548
|
-
for (let e = 0; e < n; e++) t += "}";
|
|
5549
|
-
return JSON.parse(t);
|
|
5550
|
-
}];
|
|
5551
|
-
for (let e of t) try {
|
|
5552
|
-
return e();
|
|
5553
|
-
} catch {}
|
|
5554
|
-
return;
|
|
5555
|
-
}
|
|
5556
|
-
}, T = () => {
|
|
5608
|
+
}), w = () => {
|
|
5557
5609
|
l((e) => e.map((e) => e.id === C ? {
|
|
5558
5610
|
...e,
|
|
5559
5611
|
parts: [...o]
|
|
@@ -5583,35 +5635,30 @@ function fa({ connection: e, llmConfig: t, isConnected: n, readResource: r, widg
|
|
|
5583
5635
|
t && t.type === "text" ? t.text = n : o.push({
|
|
5584
5636
|
type: "text",
|
|
5585
5637
|
text: n
|
|
5586
|
-
}),
|
|
5638
|
+
}), w();
|
|
5587
5639
|
} else if (e.type === "tool-call-start") b({
|
|
5588
5640
|
type: "tool-call-start",
|
|
5589
5641
|
toolCallId: e.toolCallId,
|
|
5590
5642
|
toolName: e.toolName,
|
|
5591
5643
|
raw: e
|
|
5592
|
-
}), n &&= "", u.set(e.toolCallId, {
|
|
5593
|
-
name: e.toolName,
|
|
5594
|
-
accumulatedJson: ""
|
|
5595
|
-
}), o.push({
|
|
5644
|
+
}), n &&= "", u.set(e.toolCallId, { accumulatedJson: "" }), o.push({
|
|
5596
5645
|
type: "tool-invocation",
|
|
5597
5646
|
toolInvocation: {
|
|
5647
|
+
toolCallId: e.toolCallId,
|
|
5598
5648
|
toolName: e.toolName,
|
|
5599
5649
|
args: {},
|
|
5600
5650
|
state: "streaming",
|
|
5601
5651
|
partialArgs: {}
|
|
5602
5652
|
}
|
|
5603
|
-
}),
|
|
5653
|
+
}), w();
|
|
5604
5654
|
else if (e.type === "tool-call-args-delta") {
|
|
5605
5655
|
let t = u.get(e.toolCallId);
|
|
5606
5656
|
if (t) {
|
|
5607
5657
|
t.accumulatedJson += e.argsDelta;
|
|
5608
|
-
let n =
|
|
5658
|
+
let n = da(t.accumulatedJson);
|
|
5609
5659
|
if (n) {
|
|
5610
|
-
let
|
|
5611
|
-
|
|
5612
|
-
let t = e.toolInvocation.partialArgs, r = t ? Object.keys(t) : [], i = Object.keys(n), a = r.reduce((e, n) => e + String(t[n] ?? "").length, 0), o = i.reduce((e, t) => e + String(n[t] ?? "").length, 0);
|
|
5613
|
-
(i.length > r.length || o >= a) && (e.toolInvocation.partialArgs = n), T(), await f();
|
|
5614
|
-
}
|
|
5660
|
+
let t = o.find((t) => t.type === "tool-invocation" && t.toolInvocation?.state === "streaming" && t.toolInvocation?.toolCallId === e.toolCallId);
|
|
5661
|
+
t && t.toolInvocation && (t.toolInvocation.partialArgs = n, w(), await f());
|
|
5615
5662
|
}
|
|
5616
5663
|
}
|
|
5617
5664
|
} else if (e.type === "tool-call-ready") {
|
|
@@ -5622,15 +5669,16 @@ function fa({ connection: e, llmConfig: t, isConnected: n, readResource: r, widg
|
|
|
5622
5669
|
args: e.args,
|
|
5623
5670
|
raw: e
|
|
5624
5671
|
}), S++, n &&= "";
|
|
5625
|
-
let t = o.find((t) => t.type === "tool-invocation" && t.toolInvocation?.state === "streaming" && t.toolInvocation?.
|
|
5626
|
-
t && t.toolInvocation ? (t.toolInvocation.args = e.args, t.toolInvocation.state = "pending") : o.push({
|
|
5672
|
+
let t = o.find((t) => t.type === "tool-invocation" && t.toolInvocation?.state === "streaming" && t.toolInvocation?.toolCallId === e.toolCallId);
|
|
5673
|
+
t && t.toolInvocation ? (t.toolInvocation.args = e.args, t.toolInvocation.state = "pending", t.toolInvocation.partialArgs = void 0) : o.push({
|
|
5627
5674
|
type: "tool-invocation",
|
|
5628
5675
|
toolInvocation: {
|
|
5676
|
+
toolCallId: e.toolCallId,
|
|
5629
5677
|
toolName: e.toolName,
|
|
5630
5678
|
args: e.args,
|
|
5631
5679
|
state: "pending"
|
|
5632
5680
|
}
|
|
5633
|
-
}),
|
|
5681
|
+
}), w();
|
|
5634
5682
|
} else if (e.type === "tool-result") {
|
|
5635
5683
|
b({
|
|
5636
5684
|
type: "tool-result",
|
|
@@ -5640,8 +5688,8 @@ function fa({ connection: e, llmConfig: t, isConnected: n, readResource: r, widg
|
|
|
5640
5688
|
isError: e.isError,
|
|
5641
5689
|
raw: e
|
|
5642
5690
|
});
|
|
5643
|
-
let t = o.find((t) => t.type === "tool-invocation" && t.toolInvocation?.
|
|
5644
|
-
t && t.toolInvocation && (t.toolInvocation.result = e.result, t.toolInvocation.state = e.isError || e.result?.isError ? "error" : "result",
|
|
5691
|
+
let t = o.find((t) => t.type === "tool-invocation" && t.toolInvocation?.toolCallId === e.toolCallId && !t.toolInvocation?.result);
|
|
5692
|
+
t && t.toolInvocation && (t.toolInvocation.result = e.result, t.toolInvocation.state = e.isError || e.result?.isError ? "error" : "result", w());
|
|
5645
5693
|
} else if (e.type === "done") b({
|
|
5646
5694
|
type: "done",
|
|
5647
5695
|
raw: e
|
|
@@ -5652,7 +5700,7 @@ function fa({ connection: e, llmConfig: t, isConnected: n, readResource: r, widg
|
|
|
5652
5700
|
raw: e
|
|
5653
5701
|
}), Error(e.message);
|
|
5654
5702
|
}
|
|
5655
|
-
if (v.current?.signal.aborted) for (let e of o) e.type === "tool-invocation" && e.toolInvocation?.state === "pending" && (e.toolInvocation.state = "error", e.toolInvocation.result = "Cancelled by user");
|
|
5703
|
+
if (v.current?.signal.aborted) for (let e of o) e.type === "tool-invocation" && (e.toolInvocation?.state === "pending" || e.toolInvocation?.state === "streaming") && (e.toolInvocation.state = "error", e.toolInvocation.result = "Cancelled by user");
|
|
5656
5704
|
l((e) => e.map((e) => e.id === C ? {
|
|
5657
5705
|
...e,
|
|
5658
5706
|
parts: [...o],
|
|
@@ -5757,7 +5805,7 @@ function fa({ connection: e, llmConfig: t, isConnected: n, readResource: r, widg
|
|
|
5757
5805
|
}
|
|
5758
5806
|
//#endregion
|
|
5759
5807
|
//#region src/client/components/chat/useHostedChatMode.ts
|
|
5760
|
-
function
|
|
5808
|
+
function ha({ useClientSide: e, managedLlmConfig: t, localLlmConfig: n }) {
|
|
5761
5809
|
let r = !e && t != null, [i, a] = (0, Q.useState)(() => Vt(r, n)), o = (0, Q.useCallback)((e) => {
|
|
5762
5810
|
Ut(e ? "byok" : "managed"), a(e);
|
|
5763
5811
|
}, []), s = r ? i : e || i || !!n, c = !!t && !i;
|
|
@@ -5772,7 +5820,7 @@ function pa({ useClientSide: e, managedLlmConfig: t, localLlmConfig: n }) {
|
|
|
5772
5820
|
}
|
|
5773
5821
|
//#endregion
|
|
5774
5822
|
//#region src/client/components/chat/McpReconnectBanner.tsx
|
|
5775
|
-
function
|
|
5823
|
+
function ga({ serverName: e, serverUrl: t, message: n, onReconnect: r, onDismiss: i }) {
|
|
5776
5824
|
let [a, o] = (0, Q.useState)(!1), s = (0, Q.useCallback)(async () => {
|
|
5777
5825
|
o(!0);
|
|
5778
5826
|
try {
|
|
@@ -5834,7 +5882,7 @@ function ma({ serverName: e, serverUrl: t, message: n, onReconnect: r, onDismiss
|
|
|
5834
5882
|
}
|
|
5835
5883
|
//#endregion
|
|
5836
5884
|
//#region src/client/components/chat/ChatManagedNotice.tsx
|
|
5837
|
-
function
|
|
5885
|
+
function _a({ notice: e, onConfigureApiKey: t, onSignIn: n, authorizing: r = !1 }) {
|
|
5838
5886
|
return /* @__PURE__ */ (0, $.jsx)("div", {
|
|
5839
5887
|
className: "mb-2 flex w-full justify-center px-2 sm:px-4",
|
|
5840
5888
|
children: /* @__PURE__ */ (0, $.jsxs)("p", {
|
|
@@ -5845,7 +5893,7 @@ function ha({ notice: e, onConfigureApiKey: t, onSignIn: n, authorizing: r = !1
|
|
|
5845
5893
|
e.kind === "cloud_unavailable" && /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
|
|
5846
5894
|
"Cloud chat is currently not available.",
|
|
5847
5895
|
" ",
|
|
5848
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
5896
|
+
/* @__PURE__ */ (0, $.jsx)(va, { onClick: t })
|
|
5849
5897
|
] }),
|
|
5850
5898
|
e.kind === "login_required" && /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
|
|
5851
5899
|
"Sign in through Manufact Cloud to continue with managed chat.",
|
|
@@ -5859,7 +5907,7 @@ function ha({ notice: e, onConfigureApiKey: t, onSignIn: n, authorizing: r = !1
|
|
|
5859
5907
|
onClick: n,
|
|
5860
5908
|
children: r ? "Authorizing…" : "Sign in"
|
|
5861
5909
|
}), " · "] }),
|
|
5862
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
5910
|
+
/* @__PURE__ */ (0, $.jsx)(va, { onClick: t })
|
|
5863
5911
|
] }),
|
|
5864
5912
|
e.kind === "credits_exhausted" && /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
|
|
5865
5913
|
e.message ?? "You've used your included free plan credits for managed chat.",
|
|
@@ -5871,13 +5919,13 @@ function ha({ notice: e, onConfigureApiKey: t, onSignIn: n, authorizing: r = !1
|
|
|
5871
5919
|
className: "underline underline-offset-2 hover:text-amber-700 dark:hover:text-amber-200",
|
|
5872
5920
|
children: "Upgrade your plan"
|
|
5873
5921
|
}), " · "] }),
|
|
5874
|
-
/* @__PURE__ */ (0, $.jsx)(
|
|
5922
|
+
/* @__PURE__ */ (0, $.jsx)(va, { onClick: t })
|
|
5875
5923
|
] })
|
|
5876
5924
|
]
|
|
5877
5925
|
})
|
|
5878
5926
|
});
|
|
5879
5927
|
}
|
|
5880
|
-
function
|
|
5928
|
+
function va({ onClick: e }) {
|
|
5881
5929
|
return /* @__PURE__ */ (0, $.jsx)("button", {
|
|
5882
5930
|
type: "button",
|
|
5883
5931
|
onClick: e,
|
|
@@ -5888,14 +5936,14 @@ function ga({ onClick: e }) {
|
|
|
5888
5936
|
}
|
|
5889
5937
|
//#endregion
|
|
5890
5938
|
//#region src/client/components/chat/ChatTraceView.tsx
|
|
5891
|
-
function
|
|
5939
|
+
function ya({ events: e, usage: t }) {
|
|
5892
5940
|
return e.length === 0 ? /* @__PURE__ */ (0, $.jsx)("p", {
|
|
5893
5941
|
className: "py-12 text-center text-sm text-muted-foreground",
|
|
5894
5942
|
children: "Raw request/response data will appear after the next message."
|
|
5895
5943
|
}) : /* @__PURE__ */ (0, $.jsx)("div", {
|
|
5896
5944
|
className: "mx-auto max-w-4xl",
|
|
5897
5945
|
"data-testid": "chat-raw-view",
|
|
5898
|
-
children: /* @__PURE__ */ (0, $.jsx)(
|
|
5946
|
+
children: /* @__PURE__ */ (0, $.jsx)(We, {
|
|
5899
5947
|
data: ta(e, t),
|
|
5900
5948
|
filename: "chat-raw.json",
|
|
5901
5949
|
collapsible: !0,
|
|
@@ -5905,25 +5953,25 @@ function _a({ events: e, usage: t }) {
|
|
|
5905
5953
|
}
|
|
5906
5954
|
//#endregion
|
|
5907
5955
|
//#region src/client/components/chat/system-prompt/local-storage.ts
|
|
5908
|
-
function
|
|
5956
|
+
function ba(e) {
|
|
5909
5957
|
return `mcp-inspector-system-prompt:${e}`;
|
|
5910
5958
|
}
|
|
5911
|
-
function
|
|
5912
|
-
return typeof localStorage > "u" ? null : localStorage.getItem(
|
|
5959
|
+
function xa(e) {
|
|
5960
|
+
return typeof localStorage > "u" ? null : localStorage.getItem(ba(e));
|
|
5913
5961
|
}
|
|
5914
|
-
function
|
|
5915
|
-
localStorage.setItem(
|
|
5962
|
+
function Sa(e, t) {
|
|
5963
|
+
localStorage.setItem(ba(e), t);
|
|
5916
5964
|
}
|
|
5917
|
-
function
|
|
5965
|
+
function Ca(e) {
|
|
5918
5966
|
return e?.trim() || "You are a helpful assistant with access to MCP tools. Help users interact with the MCP server.";
|
|
5919
5967
|
}
|
|
5920
5968
|
//#endregion
|
|
5921
5969
|
//#region src/client/components/chat/system-prompt/useLocalSystemPrompt.ts
|
|
5922
|
-
function
|
|
5923
|
-
let [t, n] = (0, Q.useState)(null), [r, i] = (0, Q.useState)(!1), a =
|
|
5970
|
+
function wa(e) {
|
|
5971
|
+
let [t, n] = (0, Q.useState)(null), [r, i] = (0, Q.useState)(!1), a = ba(e);
|
|
5924
5972
|
return (0, Q.useEffect)(() => {
|
|
5925
5973
|
let t = () => {
|
|
5926
|
-
n(
|
|
5974
|
+
n(xa(e));
|
|
5927
5975
|
};
|
|
5928
5976
|
t();
|
|
5929
5977
|
let r = (e) => {
|
|
@@ -5935,7 +5983,7 @@ function Sa(e) {
|
|
|
5935
5983
|
savePrompt: (0, Q.useCallback)(async (t) => {
|
|
5936
5984
|
i(!0);
|
|
5937
5985
|
try {
|
|
5938
|
-
|
|
5986
|
+
Sa(e, t), n(t);
|
|
5939
5987
|
} finally {
|
|
5940
5988
|
i(!1);
|
|
5941
5989
|
}
|
|
@@ -5945,114 +5993,114 @@ function Sa(e) {
|
|
|
5945
5993
|
}
|
|
5946
5994
|
//#endregion
|
|
5947
5995
|
//#region src/client/components/ChatTab.tsx
|
|
5948
|
-
var
|
|
5996
|
+
var Ta = /(?:^\/$|\s+\/$)/, Ea = [
|
|
5949
5997
|
"ArrowDown",
|
|
5950
5998
|
"ArrowUp",
|
|
5951
5999
|
"Escape",
|
|
5952
6000
|
"Enter"
|
|
5953
6001
|
];
|
|
5954
|
-
function
|
|
5955
|
-
let { isEmbedded:
|
|
5956
|
-
P ? P(e) :
|
|
5957
|
-
}, [P]), [
|
|
6002
|
+
function Da({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboardShortcuts: r = !0, prompts: i, serverId: a, callPrompt: o, readResource: s, chatApiUrl: c, waitForChatApiUrl: l, initialMessages: u, managedLlmConfig: d, managedCloudModel: f, enableFreeTierUpgrade: p = !1, clearButtonLabel: m, hideTitle: g, hideModelBadge: _, clearButtonHideIcon: v, clearButtonHideShortcut: y, clearButtonVariant: b, hideClearButton: x, hideToolSelector: S, chatQuickQuestions: C = [], chatFollowups: w = [], streamProtocol: T, credentials: E, extraHeaders: D, body: k, chatStorageProvider: A, enableChatHistory: j, activeChatId: M, onActiveChatIdChange: P, titleGenerationReady: I, activeChatTitle: L, onChatTitleGenerated: R, defaultView: ee = "conv", systemPromptProvider: z, elevatedHeader: B }) {
|
|
6003
|
+
let { isEmbedded: V } = vt(), H = wa(a), U = z ?? H, te = (0, Q.useMemo)(() => Ca(U.prompt), [U.prompt]), W = (0, Q.useRef)(new Ln()), G = A ?? (!V && j !== !1 ? W.current : null), [K, ne] = (0, Q.useState)(null), q = M ?? K, J = (0, Q.useCallback)((e) => {
|
|
6004
|
+
P ? P(e) : ne(e);
|
|
6005
|
+
}, [P]), [Y, X] = (0, Q.useState)(!1), [re, ie] = (0, Q.useState)(0), [ae, oe] = (0, Q.useState)(), [se, ce] = (0, Q.useState)(void 0), [le, ue] = (0, Q.useState)(""), [de, fe] = (0, Q.useState)(!1), [pe, me] = (0, Q.useState)(-1), [he, ge] = (0, Q.useState)(C), [_e, ve] = (0, Q.useState)(w), [ye, be] = (0, Q.useState)(ee), [xe, Se] = (0, Q.useState)(/* @__PURE__ */ new Set()), Ce = (0, Q.useRef)(null), we = (0, Q.useRef)(null), Te = (0, Q.useRef)(null), Ee = (0, Q.useMemo)(() => (e.tools ?? []).map((e) => ({
|
|
5958
6006
|
name: e.name,
|
|
5959
6007
|
description: e.description
|
|
5960
|
-
})), [e.tools]), { llmConfig:
|
|
6008
|
+
})), [e.tools]), { llmConfig: De, authConfig: Oe, configDialogOpen: ke, setConfigDialogOpen: Ae, tempProvider: je, setTempProvider: Me, tempApiKey: Ne, setTempApiKey: Pe, tempModel: Fe, setTempModel: Ie, tempBaseUrl: Le, setTempBaseUrl: Re, saveLLMConfig: Be, clearConfig: Ve } = Gt({ mcpServerUrl: e.url ?? "" }), { setForceClientSide: He, effectiveClientSide: We, llmConfig: Ge, isManaged: Ke } = ha({
|
|
5961
6009
|
useClientSide: n,
|
|
5962
6010
|
managedLlmConfig: d,
|
|
5963
|
-
localLlmConfig:
|
|
6011
|
+
localLlmConfig: De
|
|
5964
6012
|
}), { getAllModelContexts: qe } = yt(), Ze = qe(), Qe = {
|
|
5965
6013
|
connection: e,
|
|
5966
|
-
llmConfig:
|
|
6014
|
+
llmConfig: Ge,
|
|
5967
6015
|
isConnected: t,
|
|
5968
6016
|
readResource: s,
|
|
5969
6017
|
widgetModelContexts: Ze,
|
|
5970
|
-
disabledTools:
|
|
5971
|
-
}, $e =
|
|
6018
|
+
disabledTools: xe
|
|
6019
|
+
}, $e = pa({
|
|
5972
6020
|
mcpServerUrl: e.url ?? "",
|
|
5973
|
-
llmConfig:
|
|
5974
|
-
authConfig:
|
|
6021
|
+
llmConfig: Ge,
|
|
6022
|
+
authConfig: Oe,
|
|
5975
6023
|
mcpAuthTokens: e.authTokens,
|
|
5976
6024
|
isConnected: t,
|
|
5977
6025
|
chatApiUrl: c,
|
|
5978
6026
|
waitForChatApiUrl: l,
|
|
5979
6027
|
widgetModelContexts: Ze,
|
|
5980
|
-
initialMessages:
|
|
5981
|
-
disabledTools:
|
|
6028
|
+
initialMessages: se ?? u,
|
|
6029
|
+
disabledTools: xe,
|
|
5982
6030
|
streamProtocol: T,
|
|
5983
6031
|
credentials: E,
|
|
5984
6032
|
extraHeaders: D,
|
|
5985
6033
|
body: k
|
|
5986
|
-
}), et =
|
|
6034
|
+
}), et = ma({
|
|
5987
6035
|
...Qe,
|
|
5988
|
-
initialMessages:
|
|
5989
|
-
systemPrompt:
|
|
5990
|
-
}), { messages: Z, isLoading: tt, attachments: rt, sendMessage: it, clearMessages: at, setMessages: ot, stop: st, addAttachment: ct, removeAttachment: lt, clearTrace: ut, traceEvents: dt, tokenUsage: ft } =
|
|
6036
|
+
initialMessages: se ?? u,
|
|
6037
|
+
systemPrompt: te
|
|
6038
|
+
}), { messages: Z, isLoading: tt, attachments: rt, sendMessage: it, clearMessages: at, setMessages: ot, stop: st, addAttachment: ct, removeAttachment: lt, clearTrace: ut, traceEvents: dt, tokenUsage: ft } = We ? et : $e, [pt, mt] = (0, Q.useState)(() => Z.length === 0 ? "visible" : "hidden"), _t = (0, Q.useCallback)(() => {
|
|
5991
6039
|
mt((e) => e === "visible" ? "fading" : e);
|
|
5992
6040
|
}, []), bt = (0, Q.useCallback)(() => {
|
|
5993
6041
|
at(), mt("visible");
|
|
5994
|
-
}, [at]), { messagesEndRef: xt, showScrollToBottom: St, showTopFade: Ct, scrollToBottom: wt } = ca(
|
|
6042
|
+
}, [at]), { messagesEndRef: xt, showScrollToBottom: St, showTopFade: Ct, scrollToBottom: wt } = ca(we, {
|
|
5995
6043
|
messageCount: Z.length,
|
|
5996
6044
|
isLoading: tt,
|
|
5997
|
-
enabled: !!
|
|
6045
|
+
enabled: !!Ge
|
|
5998
6046
|
}), Tt = (0, Q.useCallback)(async (e) => {
|
|
5999
|
-
if (!
|
|
6000
|
-
let [t, n] = await Promise.all([
|
|
6001
|
-
|
|
6047
|
+
if (!G) return;
|
|
6048
|
+
let [t, n] = await Promise.all([G.getMessages(e), G.listChats({ agentId: a })]);
|
|
6049
|
+
ce(t), ut(), ot(t), mt(t.length === 0 ? "visible" : "hidden"), J(e), oe(n.items.find((t) => t.id === e)?.title);
|
|
6002
6050
|
}, [
|
|
6003
|
-
|
|
6051
|
+
G,
|
|
6004
6052
|
ut,
|
|
6005
6053
|
ot,
|
|
6006
|
-
|
|
6054
|
+
J,
|
|
6007
6055
|
a
|
|
6008
6056
|
]), Et = (0, Q.useCallback)(async () => {
|
|
6009
|
-
at(),
|
|
6057
|
+
at(), ce([]), mt("visible"), oe(cn), J(null), G ? (J((await G.createChat({
|
|
6010
6058
|
agentId: a,
|
|
6011
6059
|
agentName: e.displayName || e.name || "MCP Server"
|
|
6012
|
-
})).id),
|
|
6060
|
+
})).id), ie((e) => e + 1)) : oe(void 0);
|
|
6013
6061
|
}, [
|
|
6014
6062
|
at,
|
|
6015
|
-
|
|
6063
|
+
G,
|
|
6016
6064
|
a,
|
|
6017
6065
|
e.displayName,
|
|
6018
6066
|
e.name,
|
|
6019
|
-
|
|
6067
|
+
J
|
|
6020
6068
|
]), Dt = (0, Q.useCallback)(async () => {
|
|
6021
|
-
if (!
|
|
6022
|
-
let t = await
|
|
6069
|
+
if (!G || q) return q;
|
|
6070
|
+
let t = await G.createChat({
|
|
6023
6071
|
agentId: a,
|
|
6024
6072
|
agentName: e.displayName || e.name || "MCP Server"
|
|
6025
6073
|
});
|
|
6026
|
-
return
|
|
6074
|
+
return J(t.id), oe(cn), ie((e) => e + 1), t.id;
|
|
6027
6075
|
}, [
|
|
6028
|
-
|
|
6029
|
-
|
|
6076
|
+
G,
|
|
6077
|
+
q,
|
|
6030
6078
|
a,
|
|
6031
6079
|
e.displayName,
|
|
6032
6080
|
e.name,
|
|
6033
|
-
|
|
6081
|
+
J
|
|
6034
6082
|
]);
|
|
6035
6083
|
(0, Q.useEffect)(() => {
|
|
6036
|
-
!
|
|
6084
|
+
!G?.saveMessages || !q || G.saveMessages(q, Z);
|
|
6037
6085
|
}, [
|
|
6038
|
-
|
|
6039
|
-
|
|
6086
|
+
G,
|
|
6087
|
+
q,
|
|
6040
6088
|
Z
|
|
6041
6089
|
]);
|
|
6042
6090
|
let Ot = (0, Q.useCallback)(() => {
|
|
6043
|
-
|
|
6091
|
+
ie((e) => e + 1);
|
|
6044
6092
|
}, []), kt = (0, Q.useCallback)((e, t) => {
|
|
6045
|
-
|
|
6046
|
-
}, [
|
|
6093
|
+
oe(t), R?.(e, t);
|
|
6094
|
+
}, [R]), At = L ?? ae, Mt = At && !un(At) ? At : ln;
|
|
6047
6095
|
Rn({
|
|
6048
|
-
activeChatId:
|
|
6049
|
-
storage:
|
|
6096
|
+
activeChatId: q,
|
|
6097
|
+
storage: G,
|
|
6050
6098
|
messages: Z,
|
|
6051
6099
|
isLoading: tt,
|
|
6052
|
-
effectiveClientSide:
|
|
6053
|
-
llmConfig:
|
|
6100
|
+
effectiveClientSide: We,
|
|
6101
|
+
llmConfig: Ge,
|
|
6054
6102
|
activeChatTitle: At,
|
|
6055
|
-
titleGenerationReady:
|
|
6103
|
+
titleGenerationReady: I,
|
|
6056
6104
|
onTitleGenerated: kt,
|
|
6057
6105
|
onHistoryRefetch: Ot
|
|
6058
6106
|
});
|
|
@@ -6061,12 +6109,12 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6061
6109
|
}, [et.clearManagedChatNotice, $e.clearManagedChatNotice]), Ft = (0, Q.useCallback)((e) => {
|
|
6062
6110
|
et.showManagedChatNotice(e), $e.showManagedChatNotice(e);
|
|
6063
6111
|
}, [et.showManagedChatNotice, $e.showManagedChatNotice]), It = (0, Q.useCallback)(() => {
|
|
6064
|
-
|
|
6112
|
+
Be() && (He(!0), Pt());
|
|
6065
6113
|
}, [
|
|
6066
|
-
|
|
6067
|
-
|
|
6114
|
+
Be,
|
|
6115
|
+
He,
|
|
6068
6116
|
Pt
|
|
6069
|
-
]), Lt =
|
|
6117
|
+
]), Lt = We ? null : $e.mcpServerAuthRequired ?? null, Rt = We ? void 0 : $e.clearMcpServerAuthRequired, zt = (0, Q.useCallback)(async () => {
|
|
6070
6118
|
try {
|
|
6071
6119
|
await e.authenticate();
|
|
6072
6120
|
} catch (e) {
|
|
@@ -6074,16 +6122,16 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6074
6122
|
return;
|
|
6075
6123
|
}
|
|
6076
6124
|
Rt?.();
|
|
6077
|
-
}, [e, Rt]), Bt = Lt ? /* @__PURE__ */ (0, $.jsx)(
|
|
6125
|
+
}, [e, Rt]), Bt = Lt ? /* @__PURE__ */ (0, $.jsx)(ga, {
|
|
6078
6126
|
serverName: e.name,
|
|
6079
6127
|
serverUrl: Lt.mcpServerUrl,
|
|
6080
6128
|
message: Lt.message,
|
|
6081
6129
|
onReconnect: zt,
|
|
6082
6130
|
onDismiss: Rt
|
|
6083
6131
|
}) : null, Vt = (0, Q.useCallback)(() => {
|
|
6084
|
-
|
|
6085
|
-
}, [
|
|
6086
|
-
|
|
6132
|
+
Ae(!0);
|
|
6133
|
+
}, [Ae]), { user: Ht, authorizing: Ut, authorize: Wt } = nt(p ? c : void 0), Kt = (0, Q.useCallback)(() => {
|
|
6134
|
+
Ae(!1), Wt().catch((e) => {
|
|
6087
6135
|
if (c && Un(e)) {
|
|
6088
6136
|
Ft({ kind: "cloud_unavailable" });
|
|
6089
6137
|
return;
|
|
@@ -6093,7 +6141,7 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6093
6141
|
}, [
|
|
6094
6142
|
Wt,
|
|
6095
6143
|
c,
|
|
6096
|
-
|
|
6144
|
+
Ae,
|
|
6097
6145
|
Ft
|
|
6098
6146
|
]), qt = Ht != null;
|
|
6099
6147
|
(0, Q.useEffect)(() => {
|
|
@@ -6109,11 +6157,11 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6109
6157
|
onModelChange: f.setSelectedModelId,
|
|
6110
6158
|
isLoading: f.isLoading
|
|
6111
6159
|
} : void 0, Qt = Ke ? "managed" : "byok", $t = Ke && f?.selectedModel ? Ye(f.selectedModel.name, f.selectedModel.provider) : void 0, en = (0, Q.useCallback)(() => {
|
|
6112
|
-
|
|
6160
|
+
He(!1), Pt(), Ae(!1);
|
|
6113
6161
|
}, [
|
|
6114
6162
|
Pt,
|
|
6115
|
-
|
|
6116
|
-
|
|
6163
|
+
Ae,
|
|
6164
|
+
He
|
|
6117
6165
|
]), { filteredPrompts: tn, setSelectedPrompt: nn, selectedPrompt: rn, setPromptArgs: an, executePrompt: on, results: sn, handleDeleteResult: dn, clearPromptResults: fn } = jt({
|
|
6118
6166
|
prompts: i,
|
|
6119
6167
|
callPrompt: o,
|
|
@@ -6184,16 +6232,16 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6184
6232
|
isLoading: tt,
|
|
6185
6233
|
messageCount: Z.length,
|
|
6186
6234
|
messages: gn(),
|
|
6187
|
-
quickQuestions:
|
|
6188
|
-
followups:
|
|
6235
|
+
quickQuestions: he,
|
|
6236
|
+
followups: _e
|
|
6189
6237
|
});
|
|
6190
6238
|
}, [
|
|
6191
|
-
|
|
6239
|
+
_e,
|
|
6192
6240
|
gn,
|
|
6193
6241
|
tt,
|
|
6194
6242
|
Z.length,
|
|
6195
6243
|
_n,
|
|
6196
|
-
|
|
6244
|
+
he
|
|
6197
6245
|
]), (0, Q.useEffect)(() => {
|
|
6198
6246
|
let e = (e) => {
|
|
6199
6247
|
if (!e.data || typeof e.data != "object") return;
|
|
@@ -6212,7 +6260,7 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6212
6260
|
i(!1, { error: "Missing message" });
|
|
6213
6261
|
return;
|
|
6214
6262
|
}
|
|
6215
|
-
if (!
|
|
6263
|
+
if (!Ge || !t) {
|
|
6216
6264
|
i(!1, { error: "Chat is not ready to send messages" });
|
|
6217
6265
|
return;
|
|
6218
6266
|
}
|
|
@@ -6237,19 +6285,19 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6237
6285
|
isLoading: tt,
|
|
6238
6286
|
messageCount: Z.length,
|
|
6239
6287
|
messages: gn(),
|
|
6240
|
-
quickQuestions:
|
|
6241
|
-
followups:
|
|
6288
|
+
quickQuestions: he,
|
|
6289
|
+
followups: _e
|
|
6242
6290
|
}), i(!0);
|
|
6243
6291
|
return;
|
|
6244
6292
|
}
|
|
6245
6293
|
if (n.type === "mcp-inspector:chat:set_quick_questions") {
|
|
6246
6294
|
let e = pn(n.questions);
|
|
6247
|
-
|
|
6295
|
+
ge(e), i(!0, { quickQuestions: e });
|
|
6248
6296
|
return;
|
|
6249
6297
|
}
|
|
6250
6298
|
if (n.type === "mcp-inspector:chat:set_followups") {
|
|
6251
6299
|
let e = pn(n.followups);
|
|
6252
|
-
|
|
6300
|
+
ve(e), i(!0, { followups: e });
|
|
6253
6301
|
return;
|
|
6254
6302
|
}
|
|
6255
6303
|
if (n.type === "mcp-inspector:chat:load_messages") {
|
|
@@ -6270,7 +6318,7 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6270
6318
|
let e = document.querySelectorAll("[data-tool-call-id]");
|
|
6271
6319
|
e.length > 0 && (t = e[e.length - 1]);
|
|
6272
6320
|
}
|
|
6273
|
-
if (!t &&
|
|
6321
|
+
if (!t && we.current && (t = we.current), !t) {
|
|
6274
6322
|
i(!1, { error: "No screenshot target found" });
|
|
6275
6323
|
return;
|
|
6276
6324
|
}
|
|
@@ -6314,7 +6362,7 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6314
6362
|
timestamp: Date.now()
|
|
6315
6363
|
}), i(!0);
|
|
6316
6364
|
else {
|
|
6317
|
-
let t =
|
|
6365
|
+
let t = we.current || document.body, n = t.innerText?.substring(0, 5e3) || "", a = t.innerHTML?.substring(0, 1e4) || "";
|
|
6318
6366
|
_n("mcp-inspector:chat:screenshot_result", {
|
|
6319
6367
|
requestId: r,
|
|
6320
6368
|
toolCallId: e || null,
|
|
@@ -6326,7 +6374,7 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6326
6374
|
}), i(!1, { error: `html-to-image: ${o}; html2canvas: ${s}` });
|
|
6327
6375
|
}
|
|
6328
6376
|
} catch (t) {
|
|
6329
|
-
let n = (
|
|
6377
|
+
let n = (we.current || document.body).innerText?.substring(0, 5e3) || "";
|
|
6330
6378
|
_n("mcp-inspector:chat:screenshot_result", {
|
|
6331
6379
|
requestId: r,
|
|
6332
6380
|
toolCallId: e || null,
|
|
@@ -6345,57 +6393,57 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6345
6393
|
bt,
|
|
6346
6394
|
_t,
|
|
6347
6395
|
ot,
|
|
6348
|
-
|
|
6396
|
+
_e,
|
|
6349
6397
|
gn,
|
|
6350
6398
|
tt,
|
|
6351
6399
|
Z.length,
|
|
6352
6400
|
_n,
|
|
6353
|
-
|
|
6401
|
+
he,
|
|
6354
6402
|
pn,
|
|
6355
6403
|
it,
|
|
6356
6404
|
a,
|
|
6357
|
-
|
|
6405
|
+
Ge,
|
|
6358
6406
|
t
|
|
6359
|
-
]), Xe(r ? { onNewChat:
|
|
6407
|
+
]), Xe(r ? { onNewChat: G ? Et : bt } : {});
|
|
6360
6408
|
let vn = (t) => {
|
|
6361
6409
|
let n = /* @__PURE__ */ (0, $.jsx)(Vn, {
|
|
6362
6410
|
className: "h-full w-full",
|
|
6363
6411
|
shaderPhase: pt,
|
|
6364
|
-
meshAnimationPaused:
|
|
6412
|
+
meshAnimationPaused: ke,
|
|
6365
6413
|
onShaderFadeComplete: () => mt("hidden"),
|
|
6366
6414
|
children: t
|
|
6367
6415
|
});
|
|
6368
|
-
return
|
|
6416
|
+
return G ? /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
6369
6417
|
className: "flex h-full flex-row overflow-hidden",
|
|
6370
6418
|
children: [/* @__PURE__ */ (0, $.jsxs)("div", {
|
|
6371
6419
|
className: "group/chat-history relative hidden shrink-0 flex-col overflow-visible transition-[width] duration-200 lg:flex",
|
|
6372
|
-
style: { width:
|
|
6373
|
-
children: [
|
|
6420
|
+
style: { width: Y ? 320 : 0 },
|
|
6421
|
+
children: [Y && /* @__PURE__ */ (0, $.jsx)("div", {
|
|
6374
6422
|
className: "flex h-full w-full flex-col overflow-hidden border-r border-zinc-200 bg-background dark:border-zinc-700",
|
|
6375
6423
|
children: /* @__PURE__ */ (0, $.jsx)(On, {
|
|
6376
|
-
provider:
|
|
6424
|
+
provider: G,
|
|
6377
6425
|
open: !0,
|
|
6378
|
-
onOpenChange:
|
|
6379
|
-
currentChatId:
|
|
6426
|
+
onOpenChange: X,
|
|
6427
|
+
currentChatId: q ?? void 0,
|
|
6380
6428
|
agentId: a,
|
|
6381
6429
|
agentDisplayNameFallback: e.displayName || e.name || "MCP Server",
|
|
6382
6430
|
onSelectChat: Tt,
|
|
6383
6431
|
variant: "inline",
|
|
6384
6432
|
containerClassName: "h-full border-0",
|
|
6385
|
-
refetchKey:
|
|
6433
|
+
refetchKey: re,
|
|
6386
6434
|
onCurrentChatDeleted: () => void Et()
|
|
6387
6435
|
})
|
|
6388
|
-
}),
|
|
6436
|
+
}), Y && /* @__PURE__ */ (0, $.jsx)(kn, { onCollapse: () => X(!1) })]
|
|
6389
6437
|
}), /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
6390
6438
|
className: "relative min-w-0 flex-1 overflow-hidden",
|
|
6391
|
-
children: [!
|
|
6439
|
+
children: [!Y && /* @__PURE__ */ (0, $.jsx)("div", {
|
|
6392
6440
|
className: "absolute top-1/2 left-4 z-50 hidden -translate-y-1/2 lg:block",
|
|
6393
6441
|
children: /* @__PURE__ */ (0, $.jsxs)(O, { children: [/* @__PURE__ */ (0, $.jsx)(h, {
|
|
6394
6442
|
render: /* @__PURE__ */ (0, $.jsx)(F, {
|
|
6395
6443
|
size: "icon",
|
|
6396
6444
|
variant: "outline",
|
|
6397
6445
|
className: "size-10 aspect-square rounded-full",
|
|
6398
|
-
onClick: () =>
|
|
6446
|
+
onClick: () => X(!0),
|
|
6399
6447
|
children: /* @__PURE__ */ (0, $.jsx)(Je, { size: 16 })
|
|
6400
6448
|
}),
|
|
6401
6449
|
nativeButton: !0
|
|
@@ -6407,22 +6455,22 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6407
6455
|
})]
|
|
6408
6456
|
}) : n;
|
|
6409
6457
|
}, yn = (0, Q.useCallback)(() => {
|
|
6410
|
-
|
|
6458
|
+
me(-1), fe(!1), Te.current = null;
|
|
6411
6459
|
}, []), bn = (0, Q.useCallback)(() => {
|
|
6412
|
-
if (!
|
|
6413
|
-
let e =
|
|
6414
|
-
|
|
6460
|
+
if (!Ce.current) return;
|
|
6461
|
+
let e = Ce.current.selectionStart, t = le.slice(0, e), n = Ta.test(t);
|
|
6462
|
+
fe(n), n ? (Te.current = {
|
|
6415
6463
|
start: e - 1,
|
|
6416
6464
|
end: e
|
|
6417
|
-
},
|
|
6418
|
-
}, [
|
|
6465
|
+
}, me(0)) : yn();
|
|
6466
|
+
}, [le, yn]);
|
|
6419
6467
|
(0, Q.useEffect)(() => {
|
|
6420
|
-
|
|
6421
|
-
}, [
|
|
6422
|
-
!tt && Z.length > 0 &&
|
|
6468
|
+
Ge && Z.length === 0 && Ce.current && Ce.current.focus();
|
|
6469
|
+
}, [Ge, Z.length]), (0, Q.useEffect)(() => {
|
|
6470
|
+
!tt && Z.length > 0 && Ce.current && Ce.current.focus();
|
|
6423
6471
|
}, [tt, Z.length]), (0, Q.useEffect)(() => {
|
|
6424
|
-
|
|
6425
|
-
}, [
|
|
6472
|
+
Ce.current && bn();
|
|
6473
|
+
}, [le, bn]);
|
|
6426
6474
|
let xn = (0, Q.useCallback)(() => {
|
|
6427
6475
|
nn(null), an({}), yn();
|
|
6428
6476
|
}, [yn]), Sn = (0, Q.useCallback)(async (e) => {
|
|
@@ -6435,10 +6483,10 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6435
6483
|
} catch (e) {
|
|
6436
6484
|
console.error("Error executing prompt", e);
|
|
6437
6485
|
} finally {
|
|
6438
|
-
if (
|
|
6439
|
-
let { start: e, end: t } =
|
|
6440
|
-
|
|
6441
|
-
|
|
6486
|
+
if (Ce.current && Te.current) {
|
|
6487
|
+
let { start: e, end: t } = Te.current;
|
|
6488
|
+
ue(le.slice(0, e) + le.slice(t)), requestAnimationFrame(() => {
|
|
6489
|
+
Ce.current?.focus(), Ce.current?.setSelectionRange(e, e);
|
|
6442
6490
|
});
|
|
6443
6491
|
}
|
|
6444
6492
|
xn();
|
|
@@ -6446,13 +6494,13 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6446
6494
|
}, [
|
|
6447
6495
|
on,
|
|
6448
6496
|
xn,
|
|
6449
|
-
|
|
6497
|
+
le
|
|
6450
6498
|
]), Cn = (0, Q.useCallback)(() => {
|
|
6451
|
-
(
|
|
6452
|
-
it(
|
|
6499
|
+
(le.trim() || sn.length > 0 || rt.length > 0) && (Z.length === 0 && _t(), Dt().then(() => {
|
|
6500
|
+
it(le, sn), ue(""), fn();
|
|
6453
6501
|
}));
|
|
6454
6502
|
}, [
|
|
6455
|
-
|
|
6503
|
+
le,
|
|
6456
6504
|
sn,
|
|
6457
6505
|
it,
|
|
6458
6506
|
fn,
|
|
@@ -6461,24 +6509,24 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6461
6509
|
Z.length,
|
|
6462
6510
|
_t
|
|
6463
6511
|
]), wn = (0, Q.useCallback)((e) => {
|
|
6464
|
-
if (e.key === "ArrowDown")
|
|
6465
|
-
else if (e.key === "ArrowUp")
|
|
6512
|
+
if (e.key === "ArrowDown") me((e) => tn.length === 0 ? -1 : (e + 1) % tn.length);
|
|
6513
|
+
else if (e.key === "ArrowUp") me((e) => tn.length === 0 ? -1 : (e - 1 + tn.length) % tn.length);
|
|
6466
6514
|
else if (e.key === "Escape") e.stopPropagation(), yn();
|
|
6467
|
-
else if (e.key === "Enter" &&
|
|
6468
|
-
let e = tn[
|
|
6515
|
+
else if (e.key === "Enter" && pe >= 0) {
|
|
6516
|
+
let e = tn[pe];
|
|
6469
6517
|
e && Sn(e);
|
|
6470
6518
|
}
|
|
6471
6519
|
}, [
|
|
6472
6520
|
tn,
|
|
6473
|
-
|
|
6521
|
+
pe,
|
|
6474
6522
|
Sn,
|
|
6475
6523
|
yn
|
|
6476
6524
|
]), Tn = (0, Q.useCallback)((e) => {
|
|
6477
|
-
|
|
6525
|
+
Ea.includes(e.key) && de ? (e.preventDefault(), wn(e)) : e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Cn());
|
|
6478
6526
|
}, [
|
|
6479
6527
|
Cn,
|
|
6480
6528
|
wn,
|
|
6481
|
-
|
|
6529
|
+
de
|
|
6482
6530
|
]), En = (0, Q.useCallback)((e) => {
|
|
6483
6531
|
(e.key === "ArrowLeft" || e.key === "ArrowRight") && bn();
|
|
6484
6532
|
}, [bn]), Dn = (0, Q.useCallback)((e) => {
|
|
@@ -6498,10 +6546,10 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6498
6546
|
return n.length === 0 ? "" : `## ${t}\n\n${n.join("\n\n")}`;
|
|
6499
6547
|
}).filter((e) => e !== "").join("\n\n---\n\n"), t;
|
|
6500
6548
|
}, [mn, hn]), An = (0, Q.useCallback)(() => {
|
|
6501
|
-
|
|
6549
|
+
ze(Dn(Z)).then(() => gt.success("Chat copied to clipboard"), () => gt.error("Failed to copy chat"));
|
|
6502
6550
|
}, [Z, Dn]), jn = (0, Q.useCallback)((e) => {
|
|
6503
6551
|
let t = `chat-export-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}`;
|
|
6504
|
-
if (e === "json")
|
|
6552
|
+
if (e === "json") Ue(Z.map((e) => ({
|
|
6505
6553
|
id: e.id,
|
|
6506
6554
|
role: e.role,
|
|
6507
6555
|
content: mn(e),
|
|
@@ -6522,9 +6570,9 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6522
6570
|
Dn,
|
|
6523
6571
|
mn
|
|
6524
6572
|
]), Mn = (0, Q.useCallback)(() => {
|
|
6525
|
-
|
|
6526
|
-
}, [
|
|
6527
|
-
e.trim() && (!
|
|
6573
|
+
Ve(), Et();
|
|
6574
|
+
}, [Ve, Et]), Nn = (0, Q.useCallback)((e) => {
|
|
6575
|
+
e.trim() && (!Ge || !t || (_t(), it(e, []).then(() => {
|
|
6528
6576
|
_n("mcp-inspector:chat:message_sent", {
|
|
6529
6577
|
message: e,
|
|
6530
6578
|
source: "quick_question"
|
|
@@ -6533,11 +6581,11 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6533
6581
|
}, [
|
|
6534
6582
|
_n,
|
|
6535
6583
|
it,
|
|
6536
|
-
|
|
6584
|
+
Ge,
|
|
6537
6585
|
t,
|
|
6538
6586
|
_t
|
|
6539
6587
|
]), Pn = (0, Q.useCallback)((e) => {
|
|
6540
|
-
e.trim() && (!
|
|
6588
|
+
e.trim() && (!Ge || !t || it(e, []).then(() => {
|
|
6541
6589
|
_n("mcp-inspector:chat:message_sent", {
|
|
6542
6590
|
message: e,
|
|
6543
6591
|
source: "followup"
|
|
@@ -6546,9 +6594,9 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6546
6594
|
}, [
|
|
6547
6595
|
_n,
|
|
6548
6596
|
it,
|
|
6549
|
-
|
|
6597
|
+
Ge,
|
|
6550
6598
|
t
|
|
6551
|
-
]), Fn = Nt ? /* @__PURE__ */ (0, $.jsx)(
|
|
6599
|
+
]), Fn = Nt ? /* @__PURE__ */ (0, $.jsx)(_a, {
|
|
6552
6600
|
notice: Nt,
|
|
6553
6601
|
onConfigureApiKey: Vt,
|
|
6554
6602
|
onSignIn: Nt.kind === "login_required" ? c ? Kt : () => {
|
|
@@ -6556,25 +6604,25 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6556
6604
|
} : void 0,
|
|
6557
6605
|
authorizing: Ut
|
|
6558
6606
|
}) : null;
|
|
6559
|
-
return
|
|
6607
|
+
return Ge && Z.length === 0 ? vn(/* @__PURE__ */ (0, $.jsxs)("div", {
|
|
6560
6608
|
className: "flex min-h-0 flex-1 flex-col overflow-hidden",
|
|
6561
6609
|
children: [
|
|
6562
6610
|
/* @__PURE__ */ (0, $.jsx)("div", {
|
|
6563
6611
|
className: "absolute top-4 right-4 z-10",
|
|
6564
6612
|
children: /* @__PURE__ */ (0, $.jsx)(_r, {
|
|
6565
|
-
open:
|
|
6566
|
-
onOpenChange:
|
|
6567
|
-
tempProvider:
|
|
6568
|
-
tempModel:
|
|
6569
|
-
tempApiKey:
|
|
6570
|
-
tempBaseUrl:
|
|
6571
|
-
onProviderChange:
|
|
6572
|
-
onModelChange:
|
|
6573
|
-
onApiKeyChange:
|
|
6574
|
-
onBaseUrlChange:
|
|
6613
|
+
open: ke,
|
|
6614
|
+
onOpenChange: Ae,
|
|
6615
|
+
tempProvider: je,
|
|
6616
|
+
tempModel: Fe,
|
|
6617
|
+
tempApiKey: Ne,
|
|
6618
|
+
tempBaseUrl: Le,
|
|
6619
|
+
onProviderChange: Me,
|
|
6620
|
+
onModelChange: Ie,
|
|
6621
|
+
onApiKeyChange: Pe,
|
|
6622
|
+
onBaseUrlChange: Re,
|
|
6575
6623
|
onSave: It,
|
|
6576
6624
|
onClear: Mn,
|
|
6577
|
-
showClearButton: !!
|
|
6625
|
+
showClearButton: !!De,
|
|
6578
6626
|
buttonLabel: "Change API Key",
|
|
6579
6627
|
hostedInspector: p,
|
|
6580
6628
|
freeTierInfo: Jt,
|
|
@@ -6586,29 +6634,29 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6586
6634
|
/* @__PURE__ */ (0, $.jsx)(ki, {
|
|
6587
6635
|
serverDisplayName: ht(e),
|
|
6588
6636
|
composerNotice: Fn,
|
|
6589
|
-
inputValue:
|
|
6637
|
+
inputValue: le,
|
|
6590
6638
|
isConnected: t && !Nt && !Lt,
|
|
6591
6639
|
isLoading: tt,
|
|
6592
|
-
textareaRef:
|
|
6593
|
-
llmConfig:
|
|
6594
|
-
promptsDropdownOpen:
|
|
6595
|
-
promptFocusedIndex:
|
|
6640
|
+
textareaRef: Ce,
|
|
6641
|
+
llmConfig: Ge,
|
|
6642
|
+
promptsDropdownOpen: de,
|
|
6643
|
+
promptFocusedIndex: pe,
|
|
6596
6644
|
prompts: tn,
|
|
6597
6645
|
selectedPrompt: rn,
|
|
6598
6646
|
promptResults: sn,
|
|
6599
6647
|
attachments: rt,
|
|
6600
|
-
tools: S ? void 0 :
|
|
6601
|
-
disabledTools: S ? void 0 :
|
|
6602
|
-
onDisabledToolsChange: S ? void 0 :
|
|
6648
|
+
tools: S ? void 0 : Ee,
|
|
6649
|
+
disabledTools: S ? void 0 : xe,
|
|
6650
|
+
onDisabledToolsChange: S ? void 0 : Se,
|
|
6603
6651
|
onDeletePromptResult: dn,
|
|
6604
6652
|
onPromptSelect: Sn,
|
|
6605
|
-
onInputChange:
|
|
6653
|
+
onInputChange: ue,
|
|
6606
6654
|
onKeyDown: Tn,
|
|
6607
6655
|
onKeyUp: En,
|
|
6608
6656
|
onClick: bn,
|
|
6609
6657
|
onSendMessage: Cn,
|
|
6610
6658
|
onStopStreaming: st,
|
|
6611
|
-
onConfigDialogOpenChange:
|
|
6659
|
+
onConfigDialogOpenChange: Ae,
|
|
6612
6660
|
onAttachmentAdd: ct,
|
|
6613
6661
|
onAttachmentRemove: lt,
|
|
6614
6662
|
hideModelBadge: Xt,
|
|
@@ -6616,12 +6664,12 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6616
6664
|
managedCloudInfo: Zt,
|
|
6617
6665
|
modelBadgeMode: Qt,
|
|
6618
6666
|
modelDisplayName: $t,
|
|
6619
|
-
quickQuestions:
|
|
6667
|
+
quickQuestions: he,
|
|
6620
6668
|
onQuickQuestionSelect: Nn,
|
|
6621
6669
|
pendingElicitationRequests: e.pendingElicitationRequests,
|
|
6622
6670
|
onApproveElicitation: e.approveElicitation,
|
|
6623
6671
|
onRejectElicitation: e.rejectElicitation,
|
|
6624
|
-
systemPromptProvider:
|
|
6672
|
+
systemPromptProvider: U
|
|
6625
6673
|
}),
|
|
6626
6674
|
Bt
|
|
6627
6675
|
]
|
|
@@ -6629,22 +6677,22 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6629
6677
|
className: "relative flex min-h-0 flex-1 flex-col overflow-hidden",
|
|
6630
6678
|
children: [
|
|
6631
6679
|
/* @__PURE__ */ (0, $.jsx)(Sr, {
|
|
6632
|
-
llmConfig:
|
|
6680
|
+
llmConfig: Ge,
|
|
6633
6681
|
hasMessages: Z.length > 0,
|
|
6634
|
-
configDialogOpen:
|
|
6635
|
-
onConfigDialogOpenChange:
|
|
6636
|
-
onClearChat:
|
|
6637
|
-
tempProvider:
|
|
6638
|
-
tempModel:
|
|
6639
|
-
tempApiKey:
|
|
6640
|
-
tempBaseUrl:
|
|
6641
|
-
onProviderChange:
|
|
6642
|
-
onModelChange:
|
|
6643
|
-
onApiKeyChange:
|
|
6644
|
-
onBaseUrlChange:
|
|
6682
|
+
configDialogOpen: ke,
|
|
6683
|
+
onConfigDialogOpenChange: Ae,
|
|
6684
|
+
onClearChat: G ? Et : bt,
|
|
6685
|
+
tempProvider: je,
|
|
6686
|
+
tempModel: Fe,
|
|
6687
|
+
tempApiKey: Ne,
|
|
6688
|
+
tempBaseUrl: Le,
|
|
6689
|
+
onProviderChange: Me,
|
|
6690
|
+
onModelChange: Ie,
|
|
6691
|
+
onApiKeyChange: Pe,
|
|
6692
|
+
onBaseUrlChange: Re,
|
|
6645
6693
|
onSaveConfig: It,
|
|
6646
6694
|
onClearConfig: Mn,
|
|
6647
|
-
showClearButton: !!
|
|
6695
|
+
showClearButton: !!De,
|
|
6648
6696
|
hideConfigButton: Yt,
|
|
6649
6697
|
hostedInspector: p,
|
|
6650
6698
|
freeTierInfo: Jt,
|
|
@@ -6659,22 +6707,22 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6659
6707
|
clearButtonHideShortcut: y,
|
|
6660
6708
|
clearButtonVariant: b,
|
|
6661
6709
|
hideClearButton: x,
|
|
6662
|
-
activeChatId:
|
|
6710
|
+
activeChatId: q,
|
|
6663
6711
|
chatTitle: Mt,
|
|
6664
|
-
showViewToggle: !!
|
|
6665
|
-
viewIndex: +(
|
|
6666
|
-
onViewIndexChange: (e) =>
|
|
6667
|
-
elevatedHeader:
|
|
6712
|
+
showViewToggle: !!Ge,
|
|
6713
|
+
viewIndex: +(ye === "raw"),
|
|
6714
|
+
onViewIndexChange: (e) => be(e === 1 ? "raw" : "conv"),
|
|
6715
|
+
elevatedHeader: B
|
|
6668
6716
|
}),
|
|
6669
6717
|
/* @__PURE__ */ (0, $.jsxs)("div", {
|
|
6670
6718
|
className: "relative flex min-h-0 flex-1 flex-col overflow-hidden",
|
|
6671
6719
|
children: [
|
|
6672
|
-
/* @__PURE__ */ (0, $.jsx)(sa, { visible: Ct && !!
|
|
6720
|
+
/* @__PURE__ */ (0, $.jsx)(sa, { visible: Ct && !!Ge }),
|
|
6673
6721
|
/* @__PURE__ */ (0, $.jsx)("div", {
|
|
6674
|
-
ref:
|
|
6722
|
+
ref: we,
|
|
6675
6723
|
"data-testid": "chat-messages-scroll-container",
|
|
6676
6724
|
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain p-2 sm:p-4 pt-[80px] sm:pt-[100px]",
|
|
6677
|
-
children:
|
|
6725
|
+
children: Ge ? ye === "conv" ? /* @__PURE__ */ (0, $.jsx)(aa, {
|
|
6678
6726
|
messages: Z,
|
|
6679
6727
|
isLoading: tt,
|
|
6680
6728
|
serverId: e.url,
|
|
@@ -6684,43 +6732,43 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6684
6732
|
serverBaseUrl: e.url,
|
|
6685
6733
|
messagesEndRef: xt,
|
|
6686
6734
|
traceEvents: dt
|
|
6687
|
-
}) : /* @__PURE__ */ (0, $.jsx)(
|
|
6735
|
+
}) : /* @__PURE__ */ (0, $.jsx)(ya, {
|
|
6688
6736
|
events: dt,
|
|
6689
6737
|
usage: ft
|
|
6690
|
-
}) : /* @__PURE__ */ (0, $.jsx)(Ai, { onConfigureClick: () =>
|
|
6738
|
+
}) : /* @__PURE__ */ (0, $.jsx)(Ai, { onConfigureClick: () => Ae(!0) })
|
|
6691
6739
|
}),
|
|
6692
|
-
|
|
6740
|
+
Ge && /* @__PURE__ */ (0, $.jsx)(oa, {
|
|
6693
6741
|
visible: St,
|
|
6694
6742
|
onClick: () => wt("smooth")
|
|
6695
6743
|
})
|
|
6696
6744
|
]
|
|
6697
6745
|
}),
|
|
6698
|
-
|
|
6746
|
+
Ge && /* @__PURE__ */ (0, $.jsxs)("div", {
|
|
6699
6747
|
className: "relative shrink-0",
|
|
6700
6748
|
children: [Fn, /* @__PURE__ */ (0, $.jsx)(Oi, {
|
|
6701
|
-
inputValue:
|
|
6749
|
+
inputValue: le,
|
|
6702
6750
|
isConnected: t && !Nt && !Lt,
|
|
6703
6751
|
isLoading: tt,
|
|
6704
|
-
textareaRef:
|
|
6705
|
-
llmConfig:
|
|
6706
|
-
promptsDropdownOpen:
|
|
6707
|
-
promptFocusedIndex:
|
|
6752
|
+
textareaRef: Ce,
|
|
6753
|
+
llmConfig: Ge,
|
|
6754
|
+
promptsDropdownOpen: de,
|
|
6755
|
+
promptFocusedIndex: pe,
|
|
6708
6756
|
prompts: tn,
|
|
6709
6757
|
promptResults: sn,
|
|
6710
6758
|
selectedPrompt: rn,
|
|
6711
6759
|
attachments: rt,
|
|
6712
|
-
tools: S ? void 0 :
|
|
6713
|
-
disabledTools: S ? void 0 :
|
|
6714
|
-
onDisabledToolsChange: S ? void 0 :
|
|
6760
|
+
tools: S ? void 0 : Ee,
|
|
6761
|
+
disabledTools: S ? void 0 : xe,
|
|
6762
|
+
onDisabledToolsChange: S ? void 0 : Se,
|
|
6715
6763
|
onDeletePromptResult: dn,
|
|
6716
6764
|
onPromptSelect: Sn,
|
|
6717
|
-
onInputChange:
|
|
6765
|
+
onInputChange: ue,
|
|
6718
6766
|
onKeyDown: Tn,
|
|
6719
6767
|
onKeyUp: En,
|
|
6720
6768
|
onClick: bn,
|
|
6721
6769
|
onSendMessage: Cn,
|
|
6722
6770
|
onStopStreaming: st,
|
|
6723
|
-
onConfigDialogOpenChange:
|
|
6771
|
+
onConfigDialogOpenChange: Ae,
|
|
6724
6772
|
onAttachmentAdd: ct,
|
|
6725
6773
|
onAttachmentRemove: lt,
|
|
6726
6774
|
hideModelBadge: Xt,
|
|
@@ -6728,12 +6776,12 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6728
6776
|
managedCloudInfo: Zt,
|
|
6729
6777
|
modelBadgeMode: Qt,
|
|
6730
6778
|
modelDisplayName: $t,
|
|
6731
|
-
followups:
|
|
6779
|
+
followups: _e,
|
|
6732
6780
|
onFollowupSelect: Pn,
|
|
6733
6781
|
pendingElicitationRequests: e.pendingElicitationRequests,
|
|
6734
6782
|
onApproveElicitation: e.approveElicitation,
|
|
6735
6783
|
onRejectElicitation: e.rejectElicitation,
|
|
6736
|
-
systemPromptProvider:
|
|
6784
|
+
systemPromptProvider: U
|
|
6737
6785
|
})]
|
|
6738
6786
|
}),
|
|
6739
6787
|
Bt
|
|
@@ -6741,4 +6789,4 @@ function Ta({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboa
|
|
|
6741
6789
|
}));
|
|
6742
6790
|
}
|
|
6743
6791
|
//#endregion
|
|
6744
|
-
export {
|
|
6792
|
+
export { Da as ChatTab };
|