vpschatbotwidget 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/types/App.d.ts +1 -0
- package/dist-lib/types/chatbot/api/chatbot-api.d.ts +10 -2
- package/dist-lib/types/chatbot/api/chatbot-types.d.ts +21 -0
- package/dist-lib/types/chatbot/core/AgentReasoning.d.ts +9 -0
- package/dist-lib/types/chatbot/core/ChatContext.d.ts +2 -0
- package/dist-lib/types/chatbot/core/ChatMarkdown.d.ts +2 -2
- package/dist-lib/types/chatbot/core/ChatProvider.d.ts +13 -1
- package/dist-lib/types/chatbot/core/ChatTypingIndicator.d.ts +1 -0
- package/dist-lib/types/chatbot/core/GroundedSources.d.ts +14 -0
- package/dist-lib/types/chatbot/embedded/EmbeddedChatbot.d.ts +13 -1
- package/dist-lib/types/chatbot/index.d.ts +1 -1
- package/dist-lib/types/chatbot/widget/ChatbotWidget.d.ts +13 -1
- package/dist-lib/vps-chatbot.cjs +33 -29
- package/dist-lib/vps-chatbot.js +1198 -967
- package/package.json +1 -1
- package/src/chatbot/api/chatbot-api.ts +105 -3
- package/src/chatbot/api/chatbot-types.ts +23 -0
- package/src/chatbot/core/AgentReasoning.tsx +60 -0
- package/src/chatbot/core/ChatContext.tsx +2 -0
- package/src/chatbot/core/ChatMarkdown.tsx +279 -54
- package/src/chatbot/core/ChatMessage.tsx +41 -45
- package/src/chatbot/core/ChatMessageList.tsx +1 -1
- package/src/chatbot/core/ChatProvider.tsx +109 -22
- package/src/chatbot/core/ChatTypingIndicator.tsx +16 -5
- package/src/chatbot/core/GroundedSources.tsx +181 -0
- package/src/chatbot/embedded/EmbeddedChatbot.tsx +33 -4
- package/src/chatbot/index.ts +1 -0
- package/src/chatbot/widget/ChatbotWidget.tsx +33 -4
- package/src/index.css +1051 -68
package/dist-lib/vps-chatbot.js
CHANGED
|
@@ -1,53 +1,55 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
function
|
|
1
|
+
import { jsx as l, jsxs as T, Fragment as ke } from "react/jsx-runtime";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import Ae, { createContext as Ct, useContext as nt, useMemo as he, useState as K, useRef as se, useCallback as le, forwardRef as st, createElement as Fe, useEffect as ie } from "react";
|
|
4
|
+
const St = {};
|
|
5
|
+
function ce(e) {
|
|
6
6
|
return e != null && e.trim() !== "" ? e.trim().replace(/\/+$/, "") : String("").trim().replace(/\/+$/, "");
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
if (!
|
|
8
|
+
function Se(e, t) {
|
|
9
|
+
const n = ce(e);
|
|
10
|
+
if (!n)
|
|
11
11
|
return t;
|
|
12
|
-
if (
|
|
13
|
-
return `${
|
|
14
|
-
if (
|
|
15
|
-
const s =
|
|
12
|
+
if (n.endsWith("/api") && t.startsWith("/api/"))
|
|
13
|
+
return `${n}${t.slice(4)}`;
|
|
14
|
+
if (n.endsWith("/api") && t === "/health") {
|
|
15
|
+
const s = n.slice(0, -4);
|
|
16
16
|
return s ? `${s}/health` : "/health";
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
return `${
|
|
18
|
+
const r = t.startsWith("/") ? t : `/${t}`;
|
|
19
|
+
return `${n}${r}`;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Tt(e) {
|
|
22
22
|
return e && typeof e == "object" && "data" in e && e.success !== !1 ? e.data : e;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
var
|
|
26
|
-
const
|
|
27
|
-
return s && !
|
|
28
|
-
code: (a =
|
|
24
|
+
function Ft(e, t, n) {
|
|
25
|
+
var o, a, i;
|
|
26
|
+
const r = e, s = (o = r == null ? void 0 : r.error) == null ? void 0 : o.message;
|
|
27
|
+
return s && !Et(s) ? {
|
|
28
|
+
code: (a = r == null ? void 0 : r.error) == null ? void 0 : a.code,
|
|
29
29
|
message: s,
|
|
30
|
-
requestId: (i =
|
|
31
|
-
} :
|
|
30
|
+
requestId: (i = r == null ? void 0 : r.error) == null ? void 0 : i.request_id
|
|
31
|
+
} : n >= 500 ? { message: "I couldn't process that request right now." } : n === 0 ? { message: "Something went wrong while connecting. Please try again." } : { message: t };
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function Et(e) {
|
|
34
34
|
return /traceback|sql|exception|stack|api[_ ]?key|password/i.test(e);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function je(e) {
|
|
37
37
|
return {
|
|
38
38
|
chunkId: e.chunk_id,
|
|
39
39
|
source: e.source,
|
|
40
|
-
score: e.score
|
|
40
|
+
score: e.score,
|
|
41
|
+
title: e.title,
|
|
42
|
+
snippet: e.snippet
|
|
41
43
|
};
|
|
42
44
|
}
|
|
43
|
-
function
|
|
45
|
+
function Ye(e) {
|
|
44
46
|
return {
|
|
45
47
|
toolName: e.tool_name,
|
|
46
48
|
arguments: e.arguments ?? {},
|
|
47
49
|
result: e.result ?? {}
|
|
48
50
|
};
|
|
49
51
|
}
|
|
50
|
-
function
|
|
52
|
+
function Je(e) {
|
|
51
53
|
return {
|
|
52
54
|
model: e.model,
|
|
53
55
|
promptTokens: e.prompt_tokens,
|
|
@@ -80,13 +82,13 @@ async function At(e) {
|
|
|
80
82
|
return {};
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
|
-
function
|
|
84
|
-
const t =
|
|
85
|
-
async function r
|
|
86
|
-
let
|
|
87
|
-
const a =
|
|
85
|
+
function ot(e) {
|
|
86
|
+
const t = ce(e);
|
|
87
|
+
async function n(r, s) {
|
|
88
|
+
let o;
|
|
89
|
+
const a = Se(t, r);
|
|
88
90
|
try {
|
|
89
|
-
|
|
91
|
+
o = await fetch(a, {
|
|
90
92
|
...s,
|
|
91
93
|
headers: {
|
|
92
94
|
"Content-Type": "application/json",
|
|
@@ -96,55 +98,114 @@ function tt(e) {
|
|
|
96
98
|
} catch {
|
|
97
99
|
throw { message: "Something went wrong while connecting. Please try again." };
|
|
98
100
|
}
|
|
99
|
-
if (
|
|
101
|
+
if (o.status === 204)
|
|
100
102
|
return;
|
|
101
|
-
const i = await At(
|
|
102
|
-
if (!
|
|
103
|
-
throw
|
|
103
|
+
const i = await At(o);
|
|
104
|
+
if (!o.ok)
|
|
105
|
+
throw Ft(
|
|
104
106
|
i,
|
|
105
107
|
"I couldn't process that request right now.",
|
|
106
|
-
|
|
108
|
+
o.status
|
|
107
109
|
);
|
|
108
|
-
return
|
|
110
|
+
return Tt(i);
|
|
109
111
|
}
|
|
110
112
|
return {
|
|
111
113
|
apiBaseUrl: t,
|
|
112
114
|
async createSession() {
|
|
113
|
-
const
|
|
115
|
+
const r = await n("/api/v1/sessions", {
|
|
114
116
|
method: "POST",
|
|
115
117
|
body: JSON.stringify({})
|
|
116
118
|
});
|
|
117
|
-
return { sessionId:
|
|
119
|
+
return { sessionId: r.session_id, createdAt: r.created_at };
|
|
118
120
|
},
|
|
119
|
-
async sendMessage(
|
|
120
|
-
const
|
|
121
|
-
`/api/v1/sessions/${
|
|
121
|
+
async sendMessage(r, s, o) {
|
|
122
|
+
const a = await n(
|
|
123
|
+
`/api/v1/sessions/${r}/messages`,
|
|
122
124
|
{
|
|
123
125
|
method: "POST",
|
|
124
|
-
body: JSON.stringify({
|
|
126
|
+
body: JSON.stringify({
|
|
127
|
+
message: s,
|
|
128
|
+
...(o == null ? void 0 : o.roleId) !== void 0 ? { role_id: o.roleId } : {},
|
|
129
|
+
...o != null && o.client ? { client: o.client } : {}
|
|
130
|
+
})
|
|
125
131
|
}
|
|
126
132
|
);
|
|
127
133
|
return {
|
|
128
|
-
requestId:
|
|
129
|
-
sessionId:
|
|
130
|
-
answer:
|
|
131
|
-
sources: (
|
|
132
|
-
toolCalls: (
|
|
133
|
-
usage:
|
|
134
|
+
requestId: a.request_id,
|
|
135
|
+
sessionId: a.session_id,
|
|
136
|
+
answer: a.answer,
|
|
137
|
+
sources: (a.sources || []).map(je),
|
|
138
|
+
toolCalls: (a.tool_calls || []).map(Ye),
|
|
139
|
+
usage: Je(a.usage)
|
|
134
140
|
};
|
|
135
141
|
},
|
|
136
|
-
async
|
|
142
|
+
async sendMessageStream(r, s, o, a) {
|
|
143
|
+
const i = Se(t, `/api/v1/sessions/${r}/messages/stream`);
|
|
144
|
+
try {
|
|
145
|
+
const c = await fetch(i, {
|
|
146
|
+
method: "POST",
|
|
147
|
+
headers: {
|
|
148
|
+
"Content-Type": "application/json"
|
|
149
|
+
},
|
|
150
|
+
body: JSON.stringify({
|
|
151
|
+
message: s,
|
|
152
|
+
...(o == null ? void 0 : o.roleId) !== void 0 ? { role_id: o.roleId } : {},
|
|
153
|
+
...o != null && o.client ? { client: o.client } : {}
|
|
154
|
+
})
|
|
155
|
+
});
|
|
156
|
+
if (!c.ok || !c.body)
|
|
157
|
+
return await this.sendMessage(r, s, o);
|
|
158
|
+
const f = c.body.getReader(), g = new TextDecoder();
|
|
159
|
+
let v = "", h = null;
|
|
160
|
+
for (; ; ) {
|
|
161
|
+
const { done: d, value: p } = await f.read();
|
|
162
|
+
if (d) break;
|
|
163
|
+
v += g.decode(p, { stream: !0 });
|
|
164
|
+
const y = v.split(`
|
|
165
|
+
|
|
166
|
+
`);
|
|
167
|
+
v = y.pop() || "";
|
|
168
|
+
for (const b of y) {
|
|
169
|
+
const F = b.trim();
|
|
170
|
+
if (F.startsWith("data:"))
|
|
171
|
+
try {
|
|
172
|
+
const k = JSON.parse(F.slice(5).trim());
|
|
173
|
+
if (k.type === "progress" && k.stage)
|
|
174
|
+
a == null || a(k.stage);
|
|
175
|
+
else if (k.type === "complete")
|
|
176
|
+
h = {
|
|
177
|
+
requestId: k.request_id,
|
|
178
|
+
sessionId: k.session_id,
|
|
179
|
+
answer: k.answer,
|
|
180
|
+
sources: (k.sources || []).map(je),
|
|
181
|
+
toolCalls: (k.tool_calls || []).map(Ye),
|
|
182
|
+
usage: Je(k.usage)
|
|
183
|
+
};
|
|
184
|
+
else if (k.type === "error")
|
|
185
|
+
throw new Error(k.message || "An error occurred");
|
|
186
|
+
} catch (k) {
|
|
187
|
+
if (!(k instanceof Error && k.message !== "An error occurred"))
|
|
188
|
+
throw k;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return h || await this.sendMessage(r, s, o);
|
|
193
|
+
} catch {
|
|
194
|
+
return await this.sendMessage(r, s, o);
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
async getHistory(r) {
|
|
137
198
|
try {
|
|
138
|
-
return ((await
|
|
139
|
-
`/api/v1/sessions/${
|
|
199
|
+
return ((await n(
|
|
200
|
+
`/api/v1/sessions/${r}/messages`
|
|
140
201
|
)).messages || []).map(Rt);
|
|
141
202
|
} catch {
|
|
142
203
|
return [];
|
|
143
204
|
}
|
|
144
205
|
},
|
|
145
|
-
async closeSession(
|
|
206
|
+
async closeSession(r) {
|
|
146
207
|
try {
|
|
147
|
-
await
|
|
208
|
+
await n(`/api/v1/sessions/${r}`, { method: "DELETE" });
|
|
148
209
|
} catch {
|
|
149
210
|
}
|
|
150
211
|
},
|
|
@@ -153,15 +214,15 @@ function tt(e) {
|
|
|
153
214
|
},
|
|
154
215
|
async checkHealth() {
|
|
155
216
|
try {
|
|
156
|
-
const
|
|
157
|
-
return (await fetch(
|
|
217
|
+
const r = Se(t, "/health");
|
|
218
|
+
return (await fetch(r)).ok;
|
|
158
219
|
} catch {
|
|
159
220
|
return !1;
|
|
160
221
|
}
|
|
161
222
|
}
|
|
162
223
|
};
|
|
163
224
|
}
|
|
164
|
-
const
|
|
225
|
+
const fn = ot(), Bt = [
|
|
165
226
|
{
|
|
166
227
|
label: "How do I access my reports?",
|
|
167
228
|
query: "How do I access my reports in the VPS Customer Portal?"
|
|
@@ -178,20 +239,30 @@ const hn = tt(), Bt = [
|
|
|
178
239
|
label: "How do I contact VPS Support?",
|
|
179
240
|
query: "How can I contact VPS Customer Support?"
|
|
180
241
|
}
|
|
181
|
-
],
|
|
182
|
-
function
|
|
183
|
-
const e =
|
|
242
|
+
], Be = Ct(null);
|
|
243
|
+
function Mt() {
|
|
244
|
+
const e = nt(Be);
|
|
184
245
|
if (!e)
|
|
185
246
|
throw new Error("useChatbot must be used inside ChatProvider.");
|
|
186
247
|
return e;
|
|
187
248
|
}
|
|
188
|
-
function
|
|
189
|
-
return
|
|
190
|
-
}
|
|
191
|
-
|
|
249
|
+
function Me() {
|
|
250
|
+
return nt(Be);
|
|
251
|
+
}
|
|
252
|
+
const Dt = `Hello! I am your **VPS Veritas assistant**.
|
|
253
|
+
|
|
254
|
+
I can help you with:
|
|
255
|
+
- **Fuel Quality Testing (FQT)** & **Oil Condition Monitoring (OCM)**
|
|
256
|
+
- **Fuel Defect Reporting (FDR)** — report and track bunker defect incidents
|
|
257
|
+
- **Bunker Master** — manage bunkering operations, BDN logs, and surveys
|
|
258
|
+
- **FSC & FSQ E-Forms** — paperless fuel system checks and bunker sample pre-registration
|
|
259
|
+
- **Samplogic** sample logistics, report downloads, and support tickets
|
|
260
|
+
|
|
261
|
+
Feel free to ask a question or select one of the suggested topics below!`;
|
|
262
|
+
function Ze(e) {
|
|
192
263
|
return `${e}-${crypto.randomUUID()}`;
|
|
193
264
|
}
|
|
194
|
-
function
|
|
265
|
+
function It(e) {
|
|
195
266
|
if (e && typeof e == "object" && "message" in e) {
|
|
196
267
|
const t = String(e.message);
|
|
197
268
|
if (t && !/traceback|sql|exception|stack|api[_ ]?key|password/i.test(t))
|
|
@@ -199,133 +270,176 @@ function Mt(e) {
|
|
|
199
270
|
}
|
|
200
271
|
return "I couldn't process that request right now.";
|
|
201
272
|
}
|
|
202
|
-
const
|
|
273
|
+
const lt = ({
|
|
203
274
|
children: e,
|
|
204
275
|
userContext: t = {},
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
276
|
+
role: n,
|
|
277
|
+
roleId: r,
|
|
278
|
+
client: s,
|
|
279
|
+
welcomeMessage: o,
|
|
280
|
+
suggestions: a = Bt,
|
|
281
|
+
disableSuggestions: i = !1,
|
|
282
|
+
initialMessage: c,
|
|
283
|
+
apiBaseUrl: f,
|
|
284
|
+
apiUrl: g,
|
|
285
|
+
proxyUrl: v,
|
|
286
|
+
api: h,
|
|
287
|
+
hideInspectSources: d = !1,
|
|
288
|
+
showGroundedSources: p = !0
|
|
212
289
|
}) => {
|
|
213
|
-
const
|
|
214
|
-
() =>
|
|
215
|
-
[
|
|
216
|
-
),
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}, [
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
290
|
+
const y = f ?? g ?? v, b = he(
|
|
291
|
+
() => h ?? ot(y),
|
|
292
|
+
[h, y]
|
|
293
|
+
), F = he(() => ({
|
|
294
|
+
...t,
|
|
295
|
+
...n !== void 0 ? { role: n } : {},
|
|
296
|
+
...r !== void 0 ? { roleId: r } : {},
|
|
297
|
+
...s !== void 0 ? { client: s } : {}
|
|
298
|
+
}), [t, n, r, s]), k = he(() => o === "" ? null : {
|
|
299
|
+
id: "welcome-default",
|
|
300
|
+
role: "assistant",
|
|
301
|
+
content: o || Dt,
|
|
302
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
303
|
+
status: "complete"
|
|
304
|
+
}, [o]), [D, j] = K(null), [I, N] = K(() => k ? [k] : []), [E, L] = K("idle"), [q, te] = K(null), Y = se(null), _ = se(!1), S = le(async () => {
|
|
305
|
+
if (D) return D;
|
|
306
|
+
L("connecting");
|
|
307
|
+
const W = await b.createSession();
|
|
308
|
+
return j(W.sessionId), W.sessionId;
|
|
309
|
+
}, [D, b]), R = le(
|
|
310
|
+
async (W) => {
|
|
311
|
+
Y.current = W;
|
|
312
|
+
const Q = {
|
|
313
|
+
id: Ze("user"),
|
|
226
314
|
role: "user",
|
|
227
|
-
content:
|
|
315
|
+
content: W,
|
|
228
316
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
229
317
|
status: "complete"
|
|
230
|
-
},
|
|
231
|
-
id:
|
|
318
|
+
}, X = Ze("asst"), J = {
|
|
319
|
+
id: X,
|
|
232
320
|
role: "assistant",
|
|
233
321
|
content: "",
|
|
234
322
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
235
|
-
status: "pending"
|
|
323
|
+
status: "pending",
|
|
324
|
+
progressText: "Analyzing question & expanding domain terms "
|
|
325
|
+
};
|
|
326
|
+
N((A) => [...A, Q, J]), L("awaiting"), te(null);
|
|
327
|
+
const oe = (A) => {
|
|
328
|
+
N(
|
|
329
|
+
($) => $.map(
|
|
330
|
+
(Z) => Z.id === X ? { ...Z, progressText: A } : Z
|
|
331
|
+
)
|
|
332
|
+
);
|
|
236
333
|
};
|
|
237
|
-
m((A) => [...A, S, B]), _("awaiting"), V(null);
|
|
238
334
|
try {
|
|
239
|
-
const A = await
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
335
|
+
const A = await S(), $ = b.sendMessageStream ? await b.sendMessageStream(
|
|
336
|
+
A,
|
|
337
|
+
W,
|
|
338
|
+
{
|
|
339
|
+
roleId: F.roleId,
|
|
340
|
+
client: F.client
|
|
341
|
+
},
|
|
342
|
+
(Z) => {
|
|
343
|
+
oe(Z);
|
|
344
|
+
}
|
|
345
|
+
) : await b.sendMessage(A, W, {
|
|
346
|
+
roleId: F.roleId,
|
|
347
|
+
client: F.client
|
|
348
|
+
});
|
|
349
|
+
N(
|
|
350
|
+
(Z) => Z.map(
|
|
351
|
+
(U) => U.id === X ? {
|
|
352
|
+
...U,
|
|
353
|
+
id: $.requestId || X,
|
|
354
|
+
content: $.answer,
|
|
246
355
|
status: "complete",
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
356
|
+
progressText: void 0,
|
|
357
|
+
sources: $.sources,
|
|
358
|
+
toolCalls: $.toolCalls,
|
|
359
|
+
usage: $.usage
|
|
360
|
+
} : U
|
|
251
361
|
)
|
|
252
|
-
),
|
|
362
|
+
), L("idle");
|
|
253
363
|
} catch (A) {
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
(
|
|
257
|
-
(
|
|
364
|
+
const $ = It(A);
|
|
365
|
+
N(
|
|
366
|
+
(Z) => Z.map(
|
|
367
|
+
(U) => U.id === X ? { ...U, content: $, status: "error", progressText: void 0 } : U
|
|
258
368
|
)
|
|
259
|
-
),
|
|
369
|
+
), te($), L("error");
|
|
260
370
|
}
|
|
261
371
|
},
|
|
262
|
-
[
|
|
263
|
-
),
|
|
264
|
-
async (
|
|
265
|
-
const
|
|
266
|
-
!
|
|
372
|
+
[S, b, F.client, F.roleId]
|
|
373
|
+
), B = le(
|
|
374
|
+
async (W) => {
|
|
375
|
+
const Q = W.trim();
|
|
376
|
+
!Q || E === "awaiting" || E === "connecting" || await R(Q);
|
|
267
377
|
},
|
|
268
|
-
[
|
|
269
|
-
),
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
}, [
|
|
273
|
-
}, []),
|
|
274
|
-
}, []),
|
|
275
|
-
|
|
276
|
-
}, [
|
|
277
|
-
|
|
278
|
-
!
|
|
279
|
-
}, [
|
|
280
|
-
const
|
|
378
|
+
[R, E]
|
|
379
|
+
), M = le(async () => {
|
|
380
|
+
const W = Y.current;
|
|
381
|
+
W && (N((Q) => Q.filter((X) => X.status !== "error")), await R(W));
|
|
382
|
+
}, [R]), P = le(async () => {
|
|
383
|
+
}, []), x = le(() => {
|
|
384
|
+
}, []), G = le(async () => {
|
|
385
|
+
D && await b.closeSession(D), j(null), N(k ? [k] : []), L("idle"), te(null), Y.current = null;
|
|
386
|
+
}, [D, b, k]);
|
|
387
|
+
Ae.useEffect(() => {
|
|
388
|
+
!c || _.current || (_.current = !0, B(c));
|
|
389
|
+
}, [c, B]);
|
|
390
|
+
const re = he(
|
|
281
391
|
() => ({
|
|
282
|
-
messages:
|
|
283
|
-
status:
|
|
284
|
-
error:
|
|
285
|
-
sessionId:
|
|
392
|
+
messages: I,
|
|
393
|
+
status: E,
|
|
394
|
+
error: q,
|
|
395
|
+
sessionId: D,
|
|
286
396
|
pendingTicket: null,
|
|
287
397
|
ticketBusy: !1,
|
|
288
398
|
lastTicket: null,
|
|
289
|
-
suggestions:
|
|
290
|
-
showSuggestions: !
|
|
291
|
-
suggestionBadgesEnabled: !
|
|
292
|
-
userContext:
|
|
293
|
-
apiBaseUrl:
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
399
|
+
suggestions: a,
|
|
400
|
+
showSuggestions: !i && (I.length === 0 || I.length === 1 && I[0].id === "welcome-default"),
|
|
401
|
+
suggestionBadgesEnabled: !i,
|
|
402
|
+
userContext: F,
|
|
403
|
+
apiBaseUrl: b.apiBaseUrl,
|
|
404
|
+
hideInspectSources: d,
|
|
405
|
+
showGroundedSources: p,
|
|
406
|
+
sendMessage: B,
|
|
407
|
+
retryLast: M,
|
|
408
|
+
confirmTicket: P,
|
|
409
|
+
cancelTicket: x,
|
|
410
|
+
resetConversation: G
|
|
299
411
|
}),
|
|
300
412
|
[
|
|
301
|
-
|
|
302
|
-
|
|
413
|
+
I,
|
|
414
|
+
E,
|
|
415
|
+
q,
|
|
303
416
|
D,
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
417
|
+
a,
|
|
418
|
+
i,
|
|
419
|
+
F,
|
|
420
|
+
b.apiBaseUrl,
|
|
421
|
+
d,
|
|
422
|
+
p,
|
|
423
|
+
B,
|
|
424
|
+
M,
|
|
425
|
+
P,
|
|
426
|
+
x,
|
|
427
|
+
G
|
|
314
428
|
]
|
|
315
429
|
);
|
|
316
|
-
return /* @__PURE__ */
|
|
430
|
+
return /* @__PURE__ */ l(Be.Provider, { value: re, children: e });
|
|
317
431
|
};
|
|
318
|
-
function
|
|
319
|
-
return
|
|
432
|
+
function Ce() {
|
|
433
|
+
return Mt();
|
|
320
434
|
}
|
|
321
|
-
const
|
|
435
|
+
const Nt = ({ message: e, onRetry: t }) => /* @__PURE__ */ T(
|
|
322
436
|
"div",
|
|
323
437
|
{
|
|
324
438
|
className: "chat-error-banner",
|
|
325
439
|
role: "alert",
|
|
326
440
|
children: [
|
|
327
|
-
/* @__PURE__ */
|
|
328
|
-
t && /* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ l("p", { children: e }),
|
|
442
|
+
t && /* @__PURE__ */ l(
|
|
329
443
|
"button",
|
|
330
444
|
{
|
|
331
445
|
type: "button",
|
|
@@ -343,14 +457,14 @@ const It = ({ message: e, onRetry: t }) => /* @__PURE__ */ k(
|
|
|
343
457
|
* This source code is licensed under the ISC license.
|
|
344
458
|
* See the LICENSE file in the root directory of this source tree.
|
|
345
459
|
*/
|
|
346
|
-
const
|
|
460
|
+
const Pt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), at = (...e) => e.filter((t, n, r) => !!t && t.trim() !== "" && r.indexOf(t) === n).join(" ").trim();
|
|
347
461
|
/**
|
|
348
462
|
* @license lucide-react v0.468.0 - ISC
|
|
349
463
|
*
|
|
350
464
|
* This source code is licensed under the ISC license.
|
|
351
465
|
* See the LICENSE file in the root directory of this source tree.
|
|
352
466
|
*/
|
|
353
|
-
var
|
|
467
|
+
var xt = {
|
|
354
468
|
xmlns: "http://www.w3.org/2000/svg",
|
|
355
469
|
width: 24,
|
|
356
470
|
height: 24,
|
|
@@ -367,31 +481,31 @@ var Pt = {
|
|
|
367
481
|
* This source code is licensed under the ISC license.
|
|
368
482
|
* See the LICENSE file in the root directory of this source tree.
|
|
369
483
|
*/
|
|
370
|
-
const
|
|
484
|
+
const Lt = st(
|
|
371
485
|
({
|
|
372
486
|
color: e = "currentColor",
|
|
373
487
|
size: t = 24,
|
|
374
|
-
strokeWidth:
|
|
375
|
-
absoluteStrokeWidth:
|
|
488
|
+
strokeWidth: n = 2,
|
|
489
|
+
absoluteStrokeWidth: r,
|
|
376
490
|
className: s = "",
|
|
377
|
-
children:
|
|
491
|
+
children: o,
|
|
378
492
|
iconNode: a,
|
|
379
493
|
...i
|
|
380
|
-
},
|
|
494
|
+
}, c) => Fe(
|
|
381
495
|
"svg",
|
|
382
496
|
{
|
|
383
|
-
ref:
|
|
384
|
-
...
|
|
497
|
+
ref: c,
|
|
498
|
+
...xt,
|
|
385
499
|
width: t,
|
|
386
500
|
height: t,
|
|
387
501
|
stroke: e,
|
|
388
|
-
strokeWidth:
|
|
389
|
-
className:
|
|
502
|
+
strokeWidth: r ? Number(n) * 24 / Number(t) : n,
|
|
503
|
+
className: at("lucide", s),
|
|
390
504
|
...i
|
|
391
505
|
},
|
|
392
506
|
[
|
|
393
|
-
...a.map(([
|
|
394
|
-
...Array.isArray(
|
|
507
|
+
...a.map(([f, g]) => Fe(f, g)),
|
|
508
|
+
...Array.isArray(o) ? o : [o]
|
|
395
509
|
]
|
|
396
510
|
)
|
|
397
511
|
);
|
|
@@ -401,16 +515,16 @@ const xt = et(
|
|
|
401
515
|
* This source code is licensed under the ISC license.
|
|
402
516
|
* See the LICENSE file in the root directory of this source tree.
|
|
403
517
|
*/
|
|
404
|
-
const
|
|
405
|
-
const
|
|
406
|
-
({ className:
|
|
407
|
-
ref:
|
|
518
|
+
const z = (e, t) => {
|
|
519
|
+
const n = st(
|
|
520
|
+
({ className: r, ...s }, o) => Fe(Lt, {
|
|
521
|
+
ref: o,
|
|
408
522
|
iconNode: t,
|
|
409
|
-
className:
|
|
523
|
+
className: at(`lucide-${Pt(e)}`, r),
|
|
410
524
|
...s
|
|
411
525
|
})
|
|
412
526
|
);
|
|
413
|
-
return
|
|
527
|
+
return n.displayName = `${e}`, n;
|
|
414
528
|
};
|
|
415
529
|
/**
|
|
416
530
|
* @license lucide-react v0.468.0 - ISC
|
|
@@ -418,7 +532,7 @@ const H = (e, t) => {
|
|
|
418
532
|
* This source code is licensed under the ISC license.
|
|
419
533
|
* See the LICENSE file in the root directory of this source tree.
|
|
420
534
|
*/
|
|
421
|
-
const
|
|
535
|
+
const Ot = z("ArrowDown", [
|
|
422
536
|
["path", { d: "M12 5v14", key: "s699le" }],
|
|
423
537
|
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
424
538
|
]);
|
|
@@ -428,7 +542,7 @@ const Lt = H("ArrowDown", [
|
|
|
428
542
|
* This source code is licensed under the ISC license.
|
|
429
543
|
* See the LICENSE file in the root directory of this source tree.
|
|
430
544
|
*/
|
|
431
|
-
const
|
|
545
|
+
const qt = z("ArrowLeft", [
|
|
432
546
|
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
433
547
|
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
434
548
|
]);
|
|
@@ -438,7 +552,7 @@ const Ot = H("ArrowLeft", [
|
|
|
438
552
|
* This source code is licensed under the ISC license.
|
|
439
553
|
* See the LICENSE file in the root directory of this source tree.
|
|
440
554
|
*/
|
|
441
|
-
const
|
|
555
|
+
const Wt = z("ArrowUp", [
|
|
442
556
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
443
557
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
444
558
|
]);
|
|
@@ -448,7 +562,7 @@ const Ht = H("ArrowUp", [
|
|
|
448
562
|
* This source code is licensed under the ISC license.
|
|
449
563
|
* See the LICENSE file in the root directory of this source tree.
|
|
450
564
|
*/
|
|
451
|
-
const
|
|
565
|
+
const it = z("BotMessageSquare", [
|
|
452
566
|
["path", { d: "M12 6V2H8", key: "1155em" }],
|
|
453
567
|
["path", { d: "m8 18-4 4V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2Z", key: "w2lp3e" }],
|
|
454
568
|
["path", { d: "M2 12h2", key: "1t8f8n" }],
|
|
@@ -462,15 +576,28 @@ const lt = H("BotMessageSquare", [
|
|
|
462
576
|
* This source code is licensed under the ISC license.
|
|
463
577
|
* See the LICENSE file in the root directory of this source tree.
|
|
464
578
|
*/
|
|
465
|
-
const
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
[
|
|
579
|
+
const $t = z("Brain", [
|
|
580
|
+
[
|
|
581
|
+
"path",
|
|
582
|
+
{
|
|
583
|
+
d: "M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",
|
|
584
|
+
key: "l5xja"
|
|
585
|
+
}
|
|
586
|
+
],
|
|
587
|
+
[
|
|
588
|
+
"path",
|
|
589
|
+
{
|
|
590
|
+
d: "M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",
|
|
591
|
+
key: "ep3f8r"
|
|
592
|
+
}
|
|
593
|
+
],
|
|
594
|
+
["path", { d: "M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4", key: "1p4c4q" }],
|
|
595
|
+
["path", { d: "M17.599 6.5a3 3 0 0 0 .399-1.375", key: "tmeiqw" }],
|
|
596
|
+
["path", { d: "M6.003 5.125A3 3 0 0 0 6.401 6.5", key: "105sqy" }],
|
|
597
|
+
["path", { d: "M3.477 10.896a4 4 0 0 1 .585-.396", key: "ql3yin" }],
|
|
598
|
+
["path", { d: "M19.938 10.5a4 4 0 0 1 .585.396", key: "1qfode" }],
|
|
599
|
+
["path", { d: "M6 18a4 4 0 0 1-1.967-.516", key: "2e4loj" }],
|
|
600
|
+
["path", { d: "M19.967 17.484A4 4 0 0 1 18 18", key: "159ez6" }]
|
|
474
601
|
]);
|
|
475
602
|
/**
|
|
476
603
|
* @license lucide-react v0.468.0 - ISC
|
|
@@ -478,14 +605,14 @@ const qt = H("ChevronDown", [
|
|
|
478
605
|
* This source code is licensed under the ISC license.
|
|
479
606
|
* See the LICENSE file in the root directory of this source tree.
|
|
480
607
|
*/
|
|
481
|
-
const
|
|
608
|
+
const Ht = z("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
|
|
482
609
|
/**
|
|
483
610
|
* @license lucide-react v0.468.0 - ISC
|
|
484
611
|
*
|
|
485
612
|
* This source code is licensed under the ISC license.
|
|
486
613
|
* See the LICENSE file in the root directory of this source tree.
|
|
487
614
|
*/
|
|
488
|
-
const Vt =
|
|
615
|
+
const Vt = z("ClipboardCheck", [
|
|
489
616
|
["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
|
|
490
617
|
[
|
|
491
618
|
"path",
|
|
@@ -502,20 +629,7 @@ const Vt = H("ClipboardCheck", [
|
|
|
502
629
|
* This source code is licensed under the ISC license.
|
|
503
630
|
* See the LICENSE file in the root directory of this source tree.
|
|
504
631
|
*/
|
|
505
|
-
const
|
|
506
|
-
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
507
|
-
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
508
|
-
["path", { d: "M10 9H8", key: "b1mrlr" }],
|
|
509
|
-
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
510
|
-
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
511
|
-
]);
|
|
512
|
-
/**
|
|
513
|
-
* @license lucide-react v0.468.0 - ISC
|
|
514
|
-
*
|
|
515
|
-
* This source code is licensed under the ISC license.
|
|
516
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
517
|
-
*/
|
|
518
|
-
const $t = H("FlaskConical", [
|
|
632
|
+
const zt = z("FlaskConical", [
|
|
519
633
|
[
|
|
520
634
|
"path",
|
|
521
635
|
{
|
|
@@ -532,7 +646,7 @@ const $t = H("FlaskConical", [
|
|
|
532
646
|
* This source code is licensed under the ISC license.
|
|
533
647
|
* See the LICENSE file in the root directory of this source tree.
|
|
534
648
|
*/
|
|
535
|
-
const
|
|
649
|
+
const ct = z("MessageSquare", [
|
|
536
650
|
["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }]
|
|
537
651
|
]);
|
|
538
652
|
/**
|
|
@@ -541,7 +655,7 @@ const ot = H("MessageSquare", [
|
|
|
541
655
|
* This source code is licensed under the ISC license.
|
|
542
656
|
* See the LICENSE file in the root directory of this source tree.
|
|
543
657
|
*/
|
|
544
|
-
const
|
|
658
|
+
const Gt = z("Microscope", [
|
|
545
659
|
["path", { d: "M6 18h8", key: "1borvv" }],
|
|
546
660
|
["path", { d: "M3 22h18", key: "8prr45" }],
|
|
547
661
|
["path", { d: "M14 22a7 7 0 1 0 0-14h-1", key: "1jwaiy" }],
|
|
@@ -555,14 +669,14 @@ const Ut = H("Microscope", [
|
|
|
555
669
|
* This source code is licensed under the ISC license.
|
|
556
670
|
* See the LICENSE file in the root directory of this source tree.
|
|
557
671
|
*/
|
|
558
|
-
const
|
|
672
|
+
const Ut = z("Minus", [["path", { d: "M5 12h14", key: "1ays0h" }]]);
|
|
559
673
|
/**
|
|
560
674
|
* @license lucide-react v0.468.0 - ISC
|
|
561
675
|
*
|
|
562
676
|
* This source code is licensed under the ISC license.
|
|
563
677
|
* See the LICENSE file in the root directory of this source tree.
|
|
564
678
|
*/
|
|
565
|
-
const
|
|
679
|
+
const jt = z("RefreshCw", [
|
|
566
680
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
567
681
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
568
682
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
@@ -574,7 +688,7 @@ const Yt = H("RefreshCw", [
|
|
|
574
688
|
* This source code is licensed under the ISC license.
|
|
575
689
|
* See the LICENSE file in the root directory of this source tree.
|
|
576
690
|
*/
|
|
577
|
-
const
|
|
691
|
+
const Yt = z("TestTubeDiagonal", [
|
|
578
692
|
[
|
|
579
693
|
"path",
|
|
580
694
|
{ d: "M21 7 6.82 21.18a2.83 2.83 0 0 1-3.99-.01a2.83 2.83 0 0 1 0-4L17 3", key: "1ub6xw" }
|
|
@@ -588,25 +702,25 @@ const Zt = H("TestTubeDiagonal", [
|
|
|
588
702
|
* This source code is licensed under the ISC license.
|
|
589
703
|
* See the LICENSE file in the root directory of this source tree.
|
|
590
704
|
*/
|
|
591
|
-
const Jt =
|
|
705
|
+
const Jt = z("X", [
|
|
592
706
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
593
707
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
594
|
-
]),
|
|
708
|
+
]), Zt = {
|
|
595
709
|
alpha: {
|
|
596
710
|
label: "Alpha",
|
|
597
|
-
Icon:
|
|
711
|
+
Icon: zt,
|
|
598
712
|
variant: "env-badge--alpha",
|
|
599
713
|
tooltip: "Alpha build — internal testing only"
|
|
600
714
|
},
|
|
601
715
|
beta: {
|
|
602
716
|
label: "Beta",
|
|
603
|
-
Icon:
|
|
717
|
+
Icon: Yt,
|
|
604
718
|
variant: "env-badge--beta",
|
|
605
719
|
tooltip: "Beta build — public pre-release"
|
|
606
720
|
},
|
|
607
721
|
gamma: {
|
|
608
722
|
label: "Gamma",
|
|
609
|
-
Icon:
|
|
723
|
+
Icon: Gt,
|
|
610
724
|
variant: "env-badge--gamma",
|
|
611
725
|
tooltip: "Gamma / Release Candidate"
|
|
612
726
|
},
|
|
@@ -616,27 +730,27 @@ const Jt = H("X", [
|
|
|
616
730
|
variant: "env-badge--qa",
|
|
617
731
|
tooltip: "Quality Assurance build"
|
|
618
732
|
}
|
|
619
|
-
},
|
|
733
|
+
}, Kt = ({
|
|
620
734
|
stage: e,
|
|
621
735
|
pulse: t = !0,
|
|
622
|
-
className:
|
|
736
|
+
className: n = ""
|
|
623
737
|
}) => {
|
|
624
738
|
if (!e) return null;
|
|
625
|
-
const { label:
|
|
626
|
-
return /* @__PURE__ */
|
|
739
|
+
const { label: r, Icon: s, variant: o, tooltip: a } = Zt[e];
|
|
740
|
+
return /* @__PURE__ */ T(
|
|
627
741
|
"span",
|
|
628
742
|
{
|
|
629
|
-
className: `env-badge-inline ${
|
|
743
|
+
className: `env-badge-inline ${o} ${n}`.trim(),
|
|
630
744
|
title: a,
|
|
631
|
-
"aria-label": `${
|
|
745
|
+
"aria-label": `${r} build`,
|
|
632
746
|
role: "status",
|
|
633
747
|
children: [
|
|
634
|
-
/* @__PURE__ */
|
|
635
|
-
/* @__PURE__ */
|
|
748
|
+
/* @__PURE__ */ l(s, { size: 10, className: "env-badge-icon", "aria-hidden": "true" }),
|
|
749
|
+
/* @__PURE__ */ l("span", { className: "env-badge-inline-label", children: r })
|
|
636
750
|
]
|
|
637
751
|
}
|
|
638
752
|
);
|
|
639
|
-
}, Qt = (e) => /* @__PURE__ */
|
|
753
|
+
}, Qt = (e) => /* @__PURE__ */ l(
|
|
640
754
|
"svg",
|
|
641
755
|
{
|
|
642
756
|
width: e.width || "24px",
|
|
@@ -646,97 +760,97 @@ const Jt = H("X", [
|
|
|
646
760
|
xmlns: "http://www.w3.org/2000/svg",
|
|
647
761
|
fill: e.Color || "currentColor",
|
|
648
762
|
...e,
|
|
649
|
-
children: /* @__PURE__ */
|
|
763
|
+
children: /* @__PURE__ */ l("path", { d: "M11.999 0c-2.25 0-4.5.06-6.6.21a5.57 5.57 0 0 0-5.19 5.1c-.24 3.21-.27 6.39-.06 9.6a5.644 5.644 0 0 0 5.7 5.19h3.15v-3.9h-3.15c-.93.03-1.74-.63-1.83-1.56-.18-3-.15-6 .06-9 .06-.84.72-1.47 1.56-1.53 2.04-.15 4.2-.21 6.36-.21s4.32.09 6.36.18c.81.06 1.5.69 1.56 1.53.24 3 .24 6 .06 9-.12.93-.9 1.62-1.83 1.59h-3.15l-6 3.9V24l6-3.9h3.15c2.97.03 5.46-2.25 5.7-5.19.21-3.18.18-6.39-.03-9.57a5.57 5.57 0 0 0-5.19-5.1c-2.13-.18-4.38-.24-6.63-.24zm-5.04 8.76c-.36 0-.66.3-.66.66v2.34c0 .33.18.63.48.78 1.62.78 3.42 1.2 5.22 1.26 1.8-.06 3.6-.48 5.22-1.26.3-.15.48-.45.48-.78V9.42c0-.09-.03-.15-.09-.21a.648.648 0 0 0-.87-.36c-1.5.66-3.12 1.02-4.77 1.05-1.65-.03-3.27-.42-4.77-1.08a.566.566 0 0 0-.24-.06z" })
|
|
650
764
|
}
|
|
651
|
-
),
|
|
765
|
+
), Xt = ({
|
|
652
766
|
title: e = "VPS AI Assistant",
|
|
653
767
|
subtitle: t = "Customer portal support",
|
|
654
|
-
onClose:
|
|
655
|
-
onReset:
|
|
768
|
+
onClose: n,
|
|
769
|
+
onReset: r,
|
|
656
770
|
onBack: s,
|
|
657
|
-
showMinimize:
|
|
771
|
+
showMinimize: o = !1,
|
|
658
772
|
envStage: a,
|
|
659
773
|
envPulse: i = !0
|
|
660
|
-
}) => /* @__PURE__ */
|
|
661
|
-
/* @__PURE__ */
|
|
662
|
-
s && /* @__PURE__ */
|
|
774
|
+
}) => /* @__PURE__ */ T("header", { className: "chat-header", children: [
|
|
775
|
+
/* @__PURE__ */ T("div", { className: "chat-header-left", children: [
|
|
776
|
+
s && /* @__PURE__ */ l(
|
|
663
777
|
"button",
|
|
664
778
|
{
|
|
665
779
|
type: "button",
|
|
666
780
|
onClick: s,
|
|
667
781
|
className: "icon-btn-back",
|
|
668
782
|
"aria-label": "Back",
|
|
669
|
-
children: /* @__PURE__ */
|
|
783
|
+
children: /* @__PURE__ */ l(qt, { size: 16 })
|
|
670
784
|
}
|
|
671
785
|
),
|
|
672
|
-
/* @__PURE__ */
|
|
786
|
+
/* @__PURE__ */ l(
|
|
673
787
|
"div",
|
|
674
788
|
{
|
|
675
789
|
className: "avatar-circle",
|
|
676
790
|
"aria-hidden": "true",
|
|
677
|
-
children: /* @__PURE__ */
|
|
791
|
+
children: /* @__PURE__ */ l(Qt, { width: "16px", height: "16px", color: "white" })
|
|
678
792
|
}
|
|
679
793
|
),
|
|
680
|
-
/* @__PURE__ */
|
|
681
|
-
/* @__PURE__ */
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ T("div", { children: [
|
|
795
|
+
/* @__PURE__ */ T("div", { className: "chat-header-title-row", children: [
|
|
796
|
+
/* @__PURE__ */ l("h2", { className: "chat-header-title", children: e }),
|
|
797
|
+
/* @__PURE__ */ l(Kt, { stage: a, pulse: i })
|
|
684
798
|
] }),
|
|
685
|
-
/* @__PURE__ */
|
|
799
|
+
/* @__PURE__ */ l("p", { className: "chat-header-subtitle", children: t || "Customer portal support" })
|
|
686
800
|
] })
|
|
687
801
|
] }),
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
|
|
802
|
+
/* @__PURE__ */ T("div", { className: "chat-header-actions", children: [
|
|
803
|
+
r && /* @__PURE__ */ l(
|
|
690
804
|
"button",
|
|
691
805
|
{
|
|
692
806
|
type: "button",
|
|
693
|
-
onClick:
|
|
807
|
+
onClick: r,
|
|
694
808
|
className: "icon-btn-action",
|
|
695
809
|
"aria-label": "Start a new conversation",
|
|
696
810
|
title: "New conversation",
|
|
697
|
-
children: /* @__PURE__ */
|
|
811
|
+
children: /* @__PURE__ */ l(jt, { size: 15 })
|
|
698
812
|
}
|
|
699
813
|
),
|
|
700
|
-
|
|
814
|
+
n && /* @__PURE__ */ l(
|
|
701
815
|
"button",
|
|
702
816
|
{
|
|
703
817
|
type: "button",
|
|
704
|
-
onClick:
|
|
818
|
+
onClick: n,
|
|
705
819
|
className: "icon-btn-action",
|
|
706
|
-
"aria-label":
|
|
707
|
-
children: /* @__PURE__ */
|
|
820
|
+
"aria-label": o ? "Minimize chat" : "Close chat",
|
|
821
|
+
children: /* @__PURE__ */ l(Ut, { size: 16 })
|
|
708
822
|
}
|
|
709
823
|
)
|
|
710
824
|
] })
|
|
711
825
|
] });
|
|
712
|
-
function
|
|
713
|
-
const
|
|
714
|
-
|
|
715
|
-
var
|
|
716
|
-
|
|
826
|
+
function er(e, t) {
|
|
827
|
+
const n = se(e);
|
|
828
|
+
ie(() => {
|
|
829
|
+
var r;
|
|
830
|
+
n.current && !e && ((r = t.current) == null || r.focus()), n.current = e;
|
|
717
831
|
}, [e, t]);
|
|
718
832
|
}
|
|
719
|
-
function
|
|
720
|
-
const
|
|
721
|
-
return
|
|
722
|
-
(
|
|
833
|
+
function tr(e, t) {
|
|
834
|
+
const n = t.trim().toLowerCase();
|
|
835
|
+
return n ? e.filter(
|
|
836
|
+
(r) => r.label.toLowerCase().includes(n) || r.query.toLowerCase().includes(n)
|
|
723
837
|
) : e;
|
|
724
838
|
}
|
|
725
|
-
const
|
|
839
|
+
const rr = ({
|
|
726
840
|
suggestions: e,
|
|
727
841
|
onSelect: t,
|
|
728
|
-
disabled:
|
|
729
|
-
variant:
|
|
730
|
-
}) => e.length ?
|
|
842
|
+
disabled: n,
|
|
843
|
+
variant: r = "list"
|
|
844
|
+
}) => e.length ? r === "badge" ? /* @__PURE__ */ l(
|
|
731
845
|
"ul",
|
|
732
846
|
{
|
|
733
847
|
className: "suggestions-badge-list",
|
|
734
848
|
"aria-label": "Suggested questions",
|
|
735
|
-
children: e.map((s) => /* @__PURE__ */
|
|
849
|
+
children: e.map((s) => /* @__PURE__ */ l("li", { className: "suggestion-badge-item", children: /* @__PURE__ */ l(
|
|
736
850
|
"button",
|
|
737
851
|
{
|
|
738
852
|
type: "button",
|
|
739
|
-
disabled:
|
|
853
|
+
disabled: n,
|
|
740
854
|
onClick: () => t(s),
|
|
741
855
|
title: s.query,
|
|
742
856
|
className: "suggestion-badge-btn",
|
|
@@ -744,42 +858,42 @@ const nr = ({
|
|
|
744
858
|
}
|
|
745
859
|
) }, s.query))
|
|
746
860
|
}
|
|
747
|
-
) : /* @__PURE__ */
|
|
861
|
+
) : /* @__PURE__ */ l("div", { className: "suggestions-list", children: e.map((s) => /* @__PURE__ */ l(
|
|
748
862
|
"button",
|
|
749
863
|
{
|
|
750
864
|
type: "button",
|
|
751
|
-
disabled:
|
|
865
|
+
disabled: n,
|
|
752
866
|
onClick: () => t(s),
|
|
753
867
|
className: "suggestion-list-btn",
|
|
754
868
|
children: s.label
|
|
755
869
|
},
|
|
756
870
|
s.query
|
|
757
|
-
)) }) : null,
|
|
871
|
+
)) }) : null, nr = ({
|
|
758
872
|
onSend: e,
|
|
759
873
|
disabled: t = !1,
|
|
760
|
-
placeholder:
|
|
874
|
+
placeholder: n = "Ask something…"
|
|
761
875
|
}) => {
|
|
762
|
-
const { suggestions:
|
|
763
|
-
|
|
876
|
+
const { suggestions: r, showSuggestions: s, suggestionBadgesEnabled: o } = Ce(), [a, i] = K(""), c = se(null), f = (d) => {
|
|
877
|
+
d && (d.style.height = "auto", d.style.height = `${Math.min(d.scrollHeight, 96)}px`);
|
|
764
878
|
};
|
|
765
|
-
|
|
766
|
-
|
|
879
|
+
er(t, c), ie(() => {
|
|
880
|
+
f(c.current);
|
|
767
881
|
}, [a]);
|
|
768
|
-
const g =
|
|
769
|
-
if (!
|
|
770
|
-
const
|
|
771
|
-
return
|
|
772
|
-
}, [t, s,
|
|
773
|
-
i(
|
|
774
|
-
const
|
|
775
|
-
|
|
776
|
-
},
|
|
777
|
-
const
|
|
778
|
-
!
|
|
882
|
+
const g = he(() => {
|
|
883
|
+
if (!o || t) return [];
|
|
884
|
+
const d = a.trim();
|
|
885
|
+
return d ? tr(r, d) : s ? r : [];
|
|
886
|
+
}, [t, s, o, r, a]), v = (d) => {
|
|
887
|
+
i(d.query);
|
|
888
|
+
const p = c.current;
|
|
889
|
+
p == null || p.focus();
|
|
890
|
+
}, h = () => {
|
|
891
|
+
const d = a.trim();
|
|
892
|
+
!d || t || (e(d), i(""), c.current && (c.current.style.height = "auto"));
|
|
779
893
|
};
|
|
780
|
-
return /* @__PURE__ */
|
|
781
|
-
/* @__PURE__ */
|
|
782
|
-
|
|
894
|
+
return /* @__PURE__ */ T("div", { className: "chat-input-wrapper", children: [
|
|
895
|
+
/* @__PURE__ */ l(
|
|
896
|
+
rr,
|
|
783
897
|
{
|
|
784
898
|
variant: "badge",
|
|
785
899
|
suggestions: g,
|
|
@@ -787,827 +901,920 @@ const nr = ({
|
|
|
787
901
|
disabled: t
|
|
788
902
|
}
|
|
789
903
|
),
|
|
790
|
-
/* @__PURE__ */
|
|
791
|
-
/* @__PURE__ */
|
|
792
|
-
/* @__PURE__ */
|
|
904
|
+
/* @__PURE__ */ l("label", { htmlFor: "vps-chat-input", className: "sr-only", children: "Chat message" }),
|
|
905
|
+
/* @__PURE__ */ T("div", { className: "chat-input-row", children: [
|
|
906
|
+
/* @__PURE__ */ l(
|
|
793
907
|
"textarea",
|
|
794
908
|
{
|
|
795
909
|
id: "vps-chat-input",
|
|
796
|
-
ref:
|
|
910
|
+
ref: c,
|
|
797
911
|
rows: 1,
|
|
798
912
|
value: a,
|
|
799
913
|
disabled: t,
|
|
800
|
-
placeholder:
|
|
801
|
-
onChange: (
|
|
802
|
-
i(
|
|
914
|
+
placeholder: n,
|
|
915
|
+
onChange: (d) => {
|
|
916
|
+
i(d.target.value), f(d.target);
|
|
803
917
|
},
|
|
804
|
-
onKeyDown: (
|
|
805
|
-
|
|
918
|
+
onKeyDown: (d) => {
|
|
919
|
+
d.key === "Enter" && !d.shiftKey && (d.preventDefault(), h());
|
|
806
920
|
},
|
|
807
921
|
className: "chat-textarea"
|
|
808
922
|
}
|
|
809
923
|
),
|
|
810
|
-
/* @__PURE__ */
|
|
924
|
+
/* @__PURE__ */ l(
|
|
811
925
|
"button",
|
|
812
926
|
{
|
|
813
927
|
type: "button",
|
|
814
|
-
onClick:
|
|
928
|
+
onClick: h,
|
|
815
929
|
disabled: t || !a.trim(),
|
|
816
930
|
"aria-label": "Send message",
|
|
817
931
|
className: "chat-send-btn",
|
|
818
|
-
children: /* @__PURE__ */
|
|
932
|
+
children: /* @__PURE__ */ l(Wt, { size: 16 })
|
|
819
933
|
}
|
|
820
934
|
)
|
|
821
935
|
] }),
|
|
822
|
-
/* @__PURE__ */
|
|
936
|
+
/* @__PURE__ */ T("p", { className: "chat-input-footer", children: [
|
|
823
937
|
"Powered by ",
|
|
824
|
-
/* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ l("span", { className: "chat-input-footer-brand", children: "VPS Veritas AI" })
|
|
825
939
|
] })
|
|
826
940
|
] });
|
|
827
941
|
};
|
|
828
|
-
function
|
|
829
|
-
let
|
|
830
|
-
if (!
|
|
831
|
-
if (typeof
|
|
832
|
-
if (!
|
|
833
|
-
let a =
|
|
834
|
-
return
|
|
835
|
-
}
|
|
836
|
-
function
|
|
942
|
+
function sr({ defaultTagName: e, props: t, render: n, state: r = {}, stateAttributesMapping: s }) {
|
|
943
|
+
let o = Ee(or(r, s), t);
|
|
944
|
+
if (!n) return u.createElement(e, o);
|
|
945
|
+
if (typeof n == "function") return n(o, r);
|
|
946
|
+
if (!u.isValidElement(n)) return null;
|
|
947
|
+
let a = n.props, i = { ...Ee(o, a), ref: pe(o.ref, a.ref) };
|
|
948
|
+
return u.cloneElement(n, i);
|
|
949
|
+
}
|
|
950
|
+
function Ee(...e) {
|
|
837
951
|
let t = {};
|
|
838
|
-
for (let
|
|
839
|
-
if (!
|
|
840
|
-
let
|
|
841
|
-
for (let s of Object.keys(
|
|
842
|
-
let
|
|
843
|
-
if (
|
|
952
|
+
for (let n of e) {
|
|
953
|
+
if (!n) continue;
|
|
954
|
+
let r = n;
|
|
955
|
+
for (let s of Object.keys(r)) {
|
|
956
|
+
let o = r[s];
|
|
957
|
+
if (o === void 0) continue;
|
|
844
958
|
let a = t[s];
|
|
845
|
-
s === "className" ? t[s] = [a,
|
|
959
|
+
s === "className" ? t[s] = [a, o].filter(Boolean).join(" ") : s === "style" ? t[s] = { ...a, ...o } : s === "ref" ? t[s] = pe(a, o) : ar(s) && typeof a == "function" && typeof o == "function" ? t[s] = lr(o, a) : t[s] = o;
|
|
846
960
|
}
|
|
847
961
|
}
|
|
848
962
|
return t;
|
|
849
963
|
}
|
|
850
964
|
function or(e, t) {
|
|
851
|
-
var
|
|
852
|
-
let
|
|
965
|
+
var r;
|
|
966
|
+
let n = {};
|
|
853
967
|
for (let s of Object.keys(e)) {
|
|
854
|
-
let
|
|
968
|
+
let o = e[s], a = (r = t == null ? void 0 : t[s]) == null ? void 0 : r.call(t, o);
|
|
855
969
|
if (a) {
|
|
856
|
-
Object.assign(
|
|
970
|
+
Object.assign(n, a);
|
|
857
971
|
continue;
|
|
858
972
|
}
|
|
859
973
|
if (s === "slot") {
|
|
860
|
-
|
|
974
|
+
n["data-slot"] = o;
|
|
861
975
|
continue;
|
|
862
976
|
}
|
|
863
|
-
let i = `data-${String(s).replace(/[A-Z]/g, (
|
|
864
|
-
typeof
|
|
977
|
+
let i = `data-${String(s).replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}`;
|
|
978
|
+
typeof o == "boolean" ? n[i] = o ? "" : void 0 : o != null && (n[i] = String(o));
|
|
865
979
|
}
|
|
866
|
-
return
|
|
980
|
+
return n;
|
|
867
981
|
}
|
|
868
|
-
function
|
|
869
|
-
return function(
|
|
870
|
-
e(
|
|
982
|
+
function lr(e, t) {
|
|
983
|
+
return function(n) {
|
|
984
|
+
e(n), n.defaultPrevented || t(n);
|
|
871
985
|
};
|
|
872
986
|
}
|
|
873
|
-
function
|
|
987
|
+
function ar(e) {
|
|
874
988
|
return /^on[A-Z]/.test(e);
|
|
875
989
|
}
|
|
876
|
-
function
|
|
990
|
+
function pe(...e) {
|
|
877
991
|
let t = e.filter(Boolean);
|
|
878
|
-
if (t.length !== 0) return (
|
|
879
|
-
for (let
|
|
992
|
+
if (t.length !== 0) return (n) => {
|
|
993
|
+
for (let r of t) typeof r == "function" ? r(n) : r && (r.current = n);
|
|
880
994
|
};
|
|
881
995
|
}
|
|
882
|
-
var
|
|
883
|
-
function
|
|
884
|
-
if (!
|
|
885
|
-
let s =
|
|
886
|
-
return { start:
|
|
887
|
-
}
|
|
888
|
-
function
|
|
889
|
-
if (!e || !s) return
|
|
890
|
-
let a = s.getBoundingClientRect(), i = a.top + t +
|
|
891
|
-
for (let v of
|
|
892
|
-
let
|
|
893
|
-
if (!
|
|
894
|
-
let
|
|
895
|
-
(
|
|
996
|
+
var ir = 8, cr = 64, ur = 0, we = 0.5, dr = 180, hr = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "End", "Home", "PageDown", "PageUp", " "]), ut = { start: !1, end: !1 }, fr = [], ye = { currentAnchorId: null, visibleMessageIds: fr };
|
|
997
|
+
function pr({ content: e, scrollEdgeThreshold: t, spacer: n, viewport: r }) {
|
|
998
|
+
if (!r || !e) return ut;
|
|
999
|
+
let s = De({ content: e, spacer: n, viewport: r });
|
|
1000
|
+
return { start: r.scrollTop > t, end: s - r.scrollTop - r.clientHeight > t };
|
|
1001
|
+
}
|
|
1002
|
+
function gr({ content: e, scrollMargin: t, scrollPreviousItemPeek: n, spacer: r, viewport: s, visibleMessageIds: o }) {
|
|
1003
|
+
if (!e || !s) return ye;
|
|
1004
|
+
let a = s.getBoundingClientRect(), i = a.top + t + n, c = typeof IntersectionObserver > "u", f = [], g = null;
|
|
1005
|
+
for (let v of fe(e, r)) {
|
|
1006
|
+
let h = v.dataset.messageId;
|
|
1007
|
+
if (!h) continue;
|
|
1008
|
+
let d = v.dataset.scrollAnchor === "true", p = d || c ? v.getBoundingClientRect() : null;
|
|
1009
|
+
(c && p ? p.bottom > i && p.top < a.bottom : o.has(h)) && f.push(h), d && p && p.top <= i + we && (g = h);
|
|
896
1010
|
}
|
|
897
|
-
return
|
|
1011
|
+
return f.length === 0 && g === null ? ye : { currentAnchorId: g, visibleMessageIds: f };
|
|
898
1012
|
}
|
|
899
|
-
function
|
|
900
|
-
return Array.from(e.children).filter((
|
|
1013
|
+
function fe(e, t) {
|
|
1014
|
+
return Array.from(e.children).filter((n) => n instanceof HTMLElement && n !== t);
|
|
901
1015
|
}
|
|
902
|
-
function
|
|
903
|
-
for (let
|
|
904
|
-
let
|
|
905
|
-
if ((
|
|
1016
|
+
function mr(e, t) {
|
|
1017
|
+
for (let n = t; n < e.length; n++) {
|
|
1018
|
+
let r = e[n];
|
|
1019
|
+
if ((r == null ? void 0 : r.dataset.scrollAnchor) === "true") return r;
|
|
906
1020
|
}
|
|
907
1021
|
return null;
|
|
908
1022
|
}
|
|
909
|
-
function
|
|
910
|
-
for (let
|
|
1023
|
+
function br(e, t) {
|
|
1024
|
+
for (let n of e) if (n.dataset.scrollAnchor === "true" && !t.has(n)) return n;
|
|
911
1025
|
return null;
|
|
912
1026
|
}
|
|
913
1027
|
function vr(e, t) {
|
|
914
|
-
var
|
|
915
|
-
let
|
|
916
|
-
for (let s = t; s < e.length; s++) if (((
|
|
1028
|
+
var r;
|
|
1029
|
+
let n = 0;
|
|
1030
|
+
for (let s = t; s < e.length; s++) if (((r = e[s]) == null ? void 0 : r.dataset.scrollAnchor) === "true" && (n += 1, n > 1)) return !0;
|
|
917
1031
|
return !1;
|
|
918
1032
|
}
|
|
919
|
-
function
|
|
1033
|
+
function _r(e) {
|
|
920
1034
|
for (let t = e.length - 1; t >= 0; t--) {
|
|
921
|
-
let
|
|
922
|
-
if ((
|
|
1035
|
+
let n = e[t];
|
|
1036
|
+
if ((n == null ? void 0 : n.dataset.scrollAnchor) === "true") return n;
|
|
923
1037
|
}
|
|
924
1038
|
return null;
|
|
925
1039
|
}
|
|
926
|
-
function wr({ content: e, spacer: t, viewport:
|
|
927
|
-
let
|
|
928
|
-
for (let s of
|
|
1040
|
+
function wr({ content: e, spacer: t, viewport: n }) {
|
|
1041
|
+
let r = n.getBoundingClientRect();
|
|
1042
|
+
for (let s of fe(e, t)) {
|
|
929
1043
|
if (!s.dataset.messageId) continue;
|
|
930
|
-
let
|
|
931
|
-
if (
|
|
1044
|
+
let o = s.getBoundingClientRect();
|
|
1045
|
+
if (o.bottom > r.top && o.top < r.bottom) return s;
|
|
932
1046
|
}
|
|
933
1047
|
return null;
|
|
934
1048
|
}
|
|
935
|
-
function
|
|
936
|
-
let
|
|
1049
|
+
function yr({ align: e, element: t, scrollMargin: n, spacer: r, viewport: s }) {
|
|
1050
|
+
let o = dt(t, s), a = t.getBoundingClientRect().height, i = Sr(r);
|
|
937
1051
|
if (e === "center") {
|
|
938
|
-
let
|
|
939
|
-
return
|
|
1052
|
+
let c = Math.max(0, s.clientHeight - i.start - i.end);
|
|
1053
|
+
return o - i.start - (c - a) / 2 - n;
|
|
940
1054
|
}
|
|
941
|
-
if (e === "end") return
|
|
1055
|
+
if (e === "end") return o - s.clientHeight + a + i.end + n;
|
|
942
1056
|
if (e === "nearest") {
|
|
943
|
-
let
|
|
944
|
-
return
|
|
1057
|
+
let c = o + a, f = s.scrollTop + i.start, g = s.scrollTop + s.clientHeight - i.end;
|
|
1058
|
+
return o >= f && c <= g ? s.scrollTop : o < f ? o - i.start - n : c - s.clientHeight + i.end + n;
|
|
945
1059
|
}
|
|
946
|
-
return
|
|
1060
|
+
return o - i.start - n;
|
|
947
1061
|
}
|
|
948
|
-
function
|
|
949
|
-
let
|
|
950
|
-
return
|
|
1062
|
+
function dt(e, t) {
|
|
1063
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
1064
|
+
return n.top - r.top + t.scrollTop;
|
|
951
1065
|
}
|
|
952
|
-
function
|
|
1066
|
+
function ve(e, t) {
|
|
953
1067
|
return e.getBoundingClientRect().top - t.getBoundingClientRect().top;
|
|
954
1068
|
}
|
|
955
|
-
function kr({ content: e, scrollTop: t, spacer:
|
|
956
|
-
let s =
|
|
957
|
-
return t +
|
|
1069
|
+
function kr({ content: e, scrollTop: t, spacer: n, viewport: r }) {
|
|
1070
|
+
let s = De({ content: e, spacer: n, viewport: r });
|
|
1071
|
+
return t + r.clientHeight - s;
|
|
958
1072
|
}
|
|
959
|
-
function
|
|
960
|
-
let
|
|
961
|
-
for (let
|
|
962
|
-
let
|
|
963
|
-
i = Math.max(i,
|
|
1073
|
+
function De({ content: e, spacer: t, viewport: n }) {
|
|
1074
|
+
let r = fe(e, t), s = ht(e), o = n.getBoundingClientRect(), a = n.scrollTop, i = s.start + s.end;
|
|
1075
|
+
for (let c of r) {
|
|
1076
|
+
let f = c.getBoundingClientRect();
|
|
1077
|
+
i = Math.max(i, f.bottom - o.top + a + s.end);
|
|
964
1078
|
}
|
|
965
1079
|
return i;
|
|
966
1080
|
}
|
|
967
|
-
function
|
|
1081
|
+
function Cr(e) {
|
|
968
1082
|
return Math.max(0, e.scrollHeight - e.clientHeight);
|
|
969
1083
|
}
|
|
970
|
-
function
|
|
1084
|
+
function ht(e) {
|
|
971
1085
|
let t = window.getComputedStyle(e);
|
|
972
|
-
return { end:
|
|
1086
|
+
return { end: Re(t.paddingBlockEnd || t.paddingBottom), start: Re(t.paddingBlockStart || t.paddingTop) };
|
|
973
1087
|
}
|
|
974
|
-
function
|
|
1088
|
+
function Sr(e) {
|
|
975
1089
|
let t = e == null ? void 0 : e.parentElement;
|
|
976
|
-
return t ?
|
|
1090
|
+
return t ? ht(t) : { end: 0, start: 0 };
|
|
977
1091
|
}
|
|
978
|
-
function
|
|
1092
|
+
function Tr(e) {
|
|
979
1093
|
if (!e) return 0;
|
|
980
|
-
let t = window.getComputedStyle(e),
|
|
981
|
-
return
|
|
1094
|
+
let t = window.getComputedStyle(e), n = t.rowGap === "normal" ? t.gap : t.rowGap;
|
|
1095
|
+
return Re(n);
|
|
982
1096
|
}
|
|
983
|
-
function
|
|
1097
|
+
function Re(e) {
|
|
984
1098
|
if (!e) return 0;
|
|
985
1099
|
let t = Number.parseFloat(e);
|
|
986
1100
|
return Number.isFinite(t) ? t : 0;
|
|
987
1101
|
}
|
|
988
|
-
function
|
|
989
|
-
let
|
|
990
|
-
return { getSnapshot: () =>
|
|
991
|
-
t(
|
|
992
|
-
}, subscribe: (s,
|
|
993
|
-
let i =
|
|
994
|
-
return
|
|
995
|
-
|
|
1102
|
+
function ft(e, t) {
|
|
1103
|
+
let n = e, r = /* @__PURE__ */ new Set();
|
|
1104
|
+
return { getSnapshot: () => n, hasListeners: () => r.size > 0, setSnapshot: (s) => {
|
|
1105
|
+
t(n, s) || (n = s, r.forEach((o) => o()));
|
|
1106
|
+
}, subscribe: (s, o, a) => {
|
|
1107
|
+
let i = r.size === 0;
|
|
1108
|
+
return r.add(s), i && (o == null || o()), () => {
|
|
1109
|
+
r.delete(s), r.size === 0 && (a == null || a());
|
|
996
1110
|
};
|
|
997
1111
|
} };
|
|
998
1112
|
}
|
|
999
|
-
function
|
|
1000
|
-
return
|
|
1113
|
+
function Ke(e, t) {
|
|
1114
|
+
return ft(e, t);
|
|
1001
1115
|
}
|
|
1002
|
-
function
|
|
1003
|
-
return
|
|
1116
|
+
function Fr() {
|
|
1117
|
+
return ft(ye, Rr);
|
|
1004
1118
|
}
|
|
1005
|
-
function
|
|
1119
|
+
function Er(e, t) {
|
|
1006
1120
|
return e.start === t.start && e.end === t.end;
|
|
1007
1121
|
}
|
|
1008
|
-
function
|
|
1009
|
-
return e.currentAnchorId !== t.currentAnchorId || e.visibleMessageIds.length !== t.visibleMessageIds.length ? !1 : e.visibleMessageIds.every((
|
|
1122
|
+
function Rr(e, t) {
|
|
1123
|
+
return e.currentAnchorId !== t.currentAnchorId || e.visibleMessageIds.length !== t.visibleMessageIds.length ? !1 : e.visibleMessageIds.every((n, r) => n === t.visibleMessageIds[r]);
|
|
1010
1124
|
}
|
|
1011
|
-
function
|
|
1012
|
-
let
|
|
1013
|
-
return
|
|
1125
|
+
function Ar({ autoScroll: e, defaultScrollPosition: t, scrollEdgeThreshold: n, scrollMargin: r, scrollPreviousItemPeek: s }) {
|
|
1126
|
+
let o = u.useRef(e), a = u.useRef(!1), i = u.useRef(null), c = u.useRef(!1), f = u.useRef(n), g = u.useRef(0), v = u.useRef(null), h = u.useRef(0), d = u.useRef(e ? "following-bottom" : "free-scrolling"), p = u.useRef(/* @__PURE__ */ new Map()), y = u.useRef(null), b = u.useRef(null), F = u.useRef(null), k = u.useRef(s), D = u.useRef(!0), j = u.useRef(null), I = u.useRef(r), N = u.useRef(null), E = u.useRef(0), L = u.useRef(0), q = u.useRef(null), te = u.useRef(null), Y = u.useRef(null), _ = u.useRef(null), S = u.useRef(null), R = u.useRef(null), B = u.useRef(null), M = u.useRef(null), P = u.useRef(null), x = u.useRef(/* @__PURE__ */ new Set()), G = u.useRef(/* @__PURE__ */ new WeakSet());
|
|
1127
|
+
return Y.current === null && (Y.current = Ke(t === "end" || t === "last-anchor", (re, W) => re === W)), _.current === null && (_.current = Ke(ut, Er)), P.current === null && (P.current = Fr()), o.current = e, f.current = n, I.current = r, k.current = s, { autoScrollRef: o, autoscrollingRef: a, autoscrollingTimeoutRef: S, streamingTurnRef: F, contentRef: i, defaultScrollPositionAppliedRef: c, firstItemRef: v, itemCountRef: g, lastScrollTopRef: h, messageElementsRef: p, modeRef: d, pendingScrollFrameRef: N, pendingScrollToMessageRef: y, prependRestoreRef: b, preserveScrollOnPrependRef: D, pendingDefaultScrollStore: Y.current, rootRef: j, scrollEdgeThresholdRef: f, scrollMarginRef: I, scrollPreviousItemPeekRef: k, spacerGapRef: E, spacerHeightRef: L, spacerRef: q, stateFrameRef: te, stateStore: _.current, viewportRef: R, visibilityFrameRef: B, visibilityObserverRef: M, visibilityStore: P.current, visibleMessageIdsRef: x, handledScrollAnchorsRef: G };
|
|
1014
1128
|
}
|
|
1015
|
-
function
|
|
1129
|
+
function pt(e) {
|
|
1016
1130
|
e.pendingDefaultScrollStore.setSnapshot(!1);
|
|
1017
1131
|
}
|
|
1018
|
-
function
|
|
1019
|
-
e.defaultScrollPositionAppliedRef.current = !0,
|
|
1132
|
+
function _e(e) {
|
|
1133
|
+
e.defaultScrollPositionAppliedRef.current = !0, pt(e);
|
|
1020
1134
|
}
|
|
1021
|
-
function
|
|
1022
|
-
let { streamingTurnRef: s, autoScrollRef:
|
|
1023
|
-
i.current !== null && (window.clearTimeout(i.current), i.current = null), a.current !==
|
|
1135
|
+
function Br({ refs: e, commitScrollState: t, scheduleStateCommit: n, scheduleVisibilitySync: r }) {
|
|
1136
|
+
let { streamingTurnRef: s, autoScrollRef: o, autoscrollingRef: a, autoscrollingTimeoutRef: i, contentRef: c, itemCountRef: f, messageElementsRef: g, modeRef: v, pendingScrollToMessageRef: h, prependRestoreRef: d, scrollMarginRef: p, scrollPreviousItemPeekRef: y, spacerGapRef: b, spacerHeightRef: F, spacerRef: k, viewportRef: D } = e, j = u.useCallback((_) => {
|
|
1137
|
+
i.current !== null && (window.clearTimeout(i.current), i.current = null), a.current !== _ && (a.current = _, t()), _ && (i.current = window.setTimeout(() => {
|
|
1024
1138
|
i.current = null, a.current = !1, t();
|
|
1025
|
-
},
|
|
1026
|
-
}, [t]),
|
|
1027
|
-
let
|
|
1028
|
-
if (!
|
|
1029
|
-
let
|
|
1030
|
-
|
|
1031
|
-
}, []),
|
|
1032
|
-
let
|
|
1033
|
-
if (!
|
|
1034
|
-
let
|
|
1035
|
-
if (Math.abs(
|
|
1036
|
-
|
|
1139
|
+
}, dr));
|
|
1140
|
+
}, [t]), I = u.useCallback((_) => {
|
|
1141
|
+
let S = k.current;
|
|
1142
|
+
if (!S) return;
|
|
1143
|
+
let R = Math.max(0, Math.ceil(_));
|
|
1144
|
+
F.current !== R && (F.current = R, S.hidden = R === 0, S.style.height = `${R}px`, S.style.marginTop = R > 0 ? `${-b.current}px` : "");
|
|
1145
|
+
}, []), N = u.useCallback((_, { behavior: S = "auto", autoscrolling: R = !1 } = {}) => {
|
|
1146
|
+
let B = D.current;
|
|
1147
|
+
if (!B) return;
|
|
1148
|
+
let M = Math.max(0, _);
|
|
1149
|
+
if (Math.abs(B.scrollTop - M) <= we) {
|
|
1150
|
+
B.scrollTop = M, t();
|
|
1037
1151
|
return;
|
|
1038
1152
|
}
|
|
1039
|
-
|
|
1040
|
-
}, [t,
|
|
1041
|
-
let
|
|
1042
|
-
return
|
|
1043
|
-
}, [
|
|
1044
|
-
let
|
|
1045
|
-
if (!
|
|
1046
|
-
let
|
|
1047
|
-
return
|
|
1048
|
-
}, [
|
|
1049
|
-
let
|
|
1050
|
-
return !
|
|
1051
|
-
}, [
|
|
1052
|
-
let
|
|
1053
|
-
return
|
|
1054
|
-
}, [
|
|
1055
|
-
return { flushPendingScrollToMessage:
|
|
1056
|
-
let
|
|
1057
|
-
if (!
|
|
1058
|
-
let
|
|
1059
|
-
return !
|
|
1060
|
-
}, [
|
|
1061
|
-
}
|
|
1062
|
-
function
|
|
1063
|
-
return
|
|
1064
|
-
e.current =
|
|
1153
|
+
R && j(!0), B.scrollTo({ top: M, behavior: S }), n();
|
|
1154
|
+
}, [t, n, j]), E = u.useCallback(({ behavior: _ = "auto" } = {}) => D.current ? (I(0), s.current = null, v.current = "free-scrolling", N(0, { behavior: _ }), r(), !0) : !1, [r, N, I]), L = u.useCallback(({ behavior: _ = "auto" } = {}) => {
|
|
1155
|
+
let S = D.current;
|
|
1156
|
+
return S ? (I(0), s.current = null, v.current = o.current ? "following-bottom" : "free-scrolling", N(Cr(S), { autoscrolling: !0, behavior: _ }), r(), !0) : !1;
|
|
1157
|
+
}, [r, N, I]), q = u.useCallback((_, { align: S = "start", behavior: R = "auto", scrollMargin: B = p.current } = {}, { keepPreviousPeek: M = !1 } = {}) => {
|
|
1158
|
+
let P = c.current, x = D.current;
|
|
1159
|
+
if (!P || !x || !P.contains(_)) return !1;
|
|
1160
|
+
let G = yr({ align: S, element: _, scrollMargin: M ? B + y.current : B, spacer: k.current, viewport: x }), re = kr({ content: P, scrollTop: G, spacer: k.current, viewport: x });
|
|
1161
|
+
return I(re), d.current = { element: _, viewportTop: ve(_, x) }, v.current = M ? "anchored-to-message" : "settling-jump", s.current = M ? _ : null, N(G, { behavior: R }), r(), !0;
|
|
1162
|
+
}, [r, N, I]), te = u.useCallback(() => {
|
|
1163
|
+
let _ = s.current;
|
|
1164
|
+
return !_ || !_.isConnected || v.current !== "anchored-to-message" ? !1 : q(_, { align: "start" }, { keepPreviousPeek: !0 });
|
|
1165
|
+
}, [q]), Y = u.useCallback((_, S) => {
|
|
1166
|
+
let R = g.current.get(_);
|
|
1167
|
+
return R ? (_e(e), q(R, S) ? (h.current = null, !0) : (h.current = { messageId: _, options: S }, !0)) : f.current === 0 ? (h.current = { messageId: _, options: S }, _e(e), !0) : !1;
|
|
1168
|
+
}, [q]);
|
|
1169
|
+
return { flushPendingScrollToMessage: u.useCallback(() => {
|
|
1170
|
+
let _ = h.current;
|
|
1171
|
+
if (!_) return !1;
|
|
1172
|
+
let S = g.current.get(_.messageId);
|
|
1173
|
+
return !S || !q(S, _.options) ? !1 : (h.current = null, _e(e), !0);
|
|
1174
|
+
}, [q]), reanchorToAnchoredMessage: te, scrollToElement: q, scrollToEnd: L, scrollToMessage: Y, scrollToStart: E };
|
|
1175
|
+
}
|
|
1176
|
+
function Qe(e, t) {
|
|
1177
|
+
return u.useCallback((n) => {
|
|
1178
|
+
e.current = n, n && t();
|
|
1065
1179
|
}, [e, t]);
|
|
1066
1180
|
}
|
|
1067
|
-
function Mr({ autoScroll: e = !1, defaultScrollPosition: t = "end", scrollEdgeThreshold:
|
|
1068
|
-
let
|
|
1069
|
-
|
|
1070
|
-
let
|
|
1071
|
-
let w =
|
|
1072
|
-
for (let
|
|
1073
|
-
}, []),
|
|
1074
|
-
var
|
|
1075
|
-
let w = ((
|
|
1076
|
-
|
|
1077
|
-
}, []),
|
|
1078
|
-
let
|
|
1079
|
-
|
|
1080
|
-
let w =
|
|
1081
|
-
|
|
1082
|
-
}, [
|
|
1083
|
-
|
|
1084
|
-
|
|
1181
|
+
function Mr({ autoScroll: e = !1, defaultScrollPosition: t = "end", scrollEdgeThreshold: n = ir, scrollPreviousItemPeek: r = cr, scrollMargin: s = ur }) {
|
|
1182
|
+
let o = Ar({ autoScroll: e, defaultScrollPosition: t, scrollEdgeThreshold: n, scrollMargin: s, scrollPreviousItemPeek: r }), { streamingTurnRef: a, autoScrollRef: i, autoscrollingRef: c, autoscrollingTimeoutRef: f, contentRef: g, defaultScrollPositionAppliedRef: v, firstItemRef: h, itemCountRef: d, lastScrollTopRef: p, messageElementsRef: y, modeRef: b, pendingScrollFrameRef: F, pendingScrollToMessageRef: k, prependRestoreRef: D, preserveScrollOnPrependRef: j, pendingDefaultScrollStore: I, rootRef: N, scrollEdgeThresholdRef: E, scrollMarginRef: L, scrollPreviousItemPeekRef: q, spacerGapRef: te, spacerHeightRef: Y, spacerRef: _, stateFrameRef: S, stateStore: R, viewportRef: B, visibilityFrameRef: M, visibilityObserverRef: P, visibilityStore: x, visibleMessageIdsRef: G, handledScrollAnchorsRef: re } = o, W = u.useRef(t);
|
|
1183
|
+
W.current !== t && (W.current = t, v.current = !1);
|
|
1184
|
+
let Q = u.useCallback((m) => {
|
|
1185
|
+
let w = N.current, C = B.current, O = [m.start && "start", m.end && "end"].filter(Boolean).join(" "), ne = c.current;
|
|
1186
|
+
for (let V of [w, C]) V && (O ? V.setAttribute("data-scrollable", O) : V.removeAttribute("data-scrollable"), V.toggleAttribute("data-autoscrolling", ne));
|
|
1187
|
+
}, []), X = u.useCallback((m) => {
|
|
1188
|
+
var O;
|
|
1189
|
+
let w = ((O = B.current) == null ? void 0 : O.scrollTop) ?? 0, C = w < p.current - we;
|
|
1190
|
+
p.current = w, i.current && !m.end && b.current !== "settling-jump" && b.current !== "anchored-to-message" ? b.current = "following-bottom" : b.current === "following-bottom" && m.end && C && !c.current && (b.current = "free-scrolling");
|
|
1191
|
+
}, []), J = u.useCallback(() => {
|
|
1192
|
+
let m = pr({ content: g.current, scrollEdgeThreshold: E.current, spacer: _.current, viewport: B.current });
|
|
1193
|
+
X(m);
|
|
1194
|
+
let w = b.current === "following-bottom" ? { ...m, end: !1 } : m;
|
|
1195
|
+
Q(w), R.setSnapshot(w);
|
|
1196
|
+
}, [X, R, Q]), oe = u.useCallback(() => {
|
|
1197
|
+
S.current === null && (S.current = window.requestAnimationFrame(() => {
|
|
1198
|
+
S.current = null, J();
|
|
1085
1199
|
}));
|
|
1086
|
-
}, [
|
|
1087
|
-
|
|
1088
|
-
|
|
1200
|
+
}, [J]), A = u.useCallback(() => {
|
|
1201
|
+
x.hasListeners() && M.current === null && (M.current = window.requestAnimationFrame(() => {
|
|
1202
|
+
M.current = null, x.hasListeners() && x.setSnapshot(gr({ content: g.current, scrollMargin: L.current, scrollPreviousItemPeek: q.current, spacer: _.current, viewport: B.current, visibleMessageIds: G.current }));
|
|
1089
1203
|
}));
|
|
1090
|
-
}, [
|
|
1091
|
-
let
|
|
1092
|
-
if (!
|
|
1093
|
-
let C =
|
|
1094
|
-
return Math.abs(C) <=
|
|
1095
|
-
}, [
|
|
1096
|
-
let
|
|
1097
|
-
if (!
|
|
1098
|
-
|
|
1204
|
+
}, [x]), { flushPendingScrollToMessage: $, reanchorToAnchoredMessage: Z, scrollToElement: U, scrollToEnd: H, scrollToMessage: Ie, scrollToStart: me } = Br({ refs: o, commitScrollState: J, scheduleStateCommit: oe, scheduleVisibilitySync: A }), Ne = u.useCallback(() => {
|
|
1205
|
+
let m = D.current, w = B.current;
|
|
1206
|
+
if (!m || !w || !m.element.isConnected) return !1;
|
|
1207
|
+
let C = ve(m.element, w) - m.viewportTop;
|
|
1208
|
+
return Math.abs(C) <= we ? !1 : (w.scrollTop += C, m.viewportTop = ve(m.element, w), oe(), A(), !0);
|
|
1209
|
+
}, [oe, A]), ae = u.useCallback(() => {
|
|
1210
|
+
let m = g.current, w = B.current;
|
|
1211
|
+
if (!m || !w) {
|
|
1212
|
+
D.current = null;
|
|
1099
1213
|
return;
|
|
1100
1214
|
}
|
|
1101
|
-
let C = wr({ content:
|
|
1102
|
-
|
|
1103
|
-
}, []),
|
|
1104
|
-
|
|
1105
|
-
|
|
1215
|
+
let C = wr({ content: m, spacer: _.current, viewport: w });
|
|
1216
|
+
D.current = C ? { element: C, viewportTop: ve(C, w) } : null;
|
|
1217
|
+
}, []), Pe = u.useCallback(() => {
|
|
1218
|
+
F.current === null && (F.current = window.requestAnimationFrame(() => {
|
|
1219
|
+
F.current = null, $() && ae();
|
|
1106
1220
|
}));
|
|
1107
|
-
}, [
|
|
1108
|
-
if (!t || v.current ||
|
|
1109
|
-
let
|
|
1221
|
+
}, [ae, $]), be = u.useCallback(() => {
|
|
1222
|
+
if (!t || v.current || d.current === 0) return !1;
|
|
1223
|
+
let m = !1;
|
|
1110
1224
|
if (t === "last-anchor") {
|
|
1111
|
-
let w = g.current, C =
|
|
1112
|
-
if (!w || !C || !
|
|
1225
|
+
let w = g.current, C = B.current, O = w && C ? _r(fe(w, _.current)) : null;
|
|
1226
|
+
if (!w || !C || !O) m = H({ behavior: "auto" });
|
|
1113
1227
|
else {
|
|
1114
|
-
let
|
|
1115
|
-
|
|
1228
|
+
let ne = dt(O, C);
|
|
1229
|
+
m = De({ content: w, spacer: _.current, viewport: C }) - ne <= C.clientHeight ? H({ behavior: "auto" }) : U(O, { align: "start" }, { keepPreviousPeek: !0 });
|
|
1116
1230
|
}
|
|
1117
|
-
} else
|
|
1118
|
-
return
|
|
1119
|
-
}, [t,
|
|
1120
|
-
let
|
|
1121
|
-
if (!
|
|
1122
|
-
let w =
|
|
1123
|
-
|
|
1124
|
-
if (
|
|
1231
|
+
} else m = t === "end" ? H({ behavior: "auto" }) : me({ behavior: "auto" });
|
|
1232
|
+
return m ? (_e(o), !0) : !1;
|
|
1233
|
+
}, [t, U, H, me]), xe = u.useCallback(() => {
|
|
1234
|
+
let m = g.current;
|
|
1235
|
+
if (!m) return;
|
|
1236
|
+
let w = fe(m, _.current), C = d.current, O = h.current;
|
|
1237
|
+
d.current = w.length, h.current = w[0] ?? null, (() => {
|
|
1238
|
+
if ($()) return;
|
|
1125
1239
|
if (C === 0) {
|
|
1126
|
-
if (
|
|
1127
|
-
|
|
1240
|
+
if (be() || w.length > 0 && i.current && H({ behavior: "auto" })) return;
|
|
1241
|
+
J(), A();
|
|
1128
1242
|
return;
|
|
1129
1243
|
}
|
|
1130
|
-
let
|
|
1131
|
-
if (
|
|
1132
|
-
|
|
1244
|
+
let ne = O ? w.indexOf(O) : -1;
|
|
1245
|
+
if (j.current && ne > 0) {
|
|
1246
|
+
Ne();
|
|
1133
1247
|
return;
|
|
1134
1248
|
}
|
|
1135
1249
|
if (w.length > C) {
|
|
1136
|
-
let
|
|
1137
|
-
if (
|
|
1138
|
-
if (i.current &&
|
|
1139
|
-
|
|
1250
|
+
let V = mr(w, C);
|
|
1251
|
+
if (V) {
|
|
1252
|
+
if (i.current && b.current === "following-bottom" && vr(w, C)) {
|
|
1253
|
+
H({ behavior: "auto" });
|
|
1140
1254
|
return;
|
|
1141
1255
|
}
|
|
1142
|
-
|
|
1256
|
+
U(V, { align: "start" }, { keepPreviousPeek: !0 }), re.current.add(V);
|
|
1143
1257
|
return;
|
|
1144
1258
|
}
|
|
1145
1259
|
}
|
|
1146
1260
|
if (w.length === C) {
|
|
1147
|
-
let
|
|
1148
|
-
if (
|
|
1149
|
-
|
|
1261
|
+
let V = br(w, re.current);
|
|
1262
|
+
if (V) {
|
|
1263
|
+
U(V, { align: "start" }, { keepPreviousPeek: !0 }), re.current.add(V);
|
|
1150
1264
|
return;
|
|
1151
1265
|
}
|
|
1152
1266
|
}
|
|
1153
|
-
|
|
1154
|
-
})(),
|
|
1155
|
-
}, [
|
|
1156
|
-
if (
|
|
1157
|
-
|
|
1267
|
+
b.current === "following-bottom" && i.current ? H({ behavior: "auto" }) : (J(), A());
|
|
1268
|
+
})(), ae();
|
|
1269
|
+
}, [be, ae, J, $, Ne, A, U, H]), Le = u.useCallback(() => {
|
|
1270
|
+
if (b.current === "following-bottom" && i.current) {
|
|
1271
|
+
H({ behavior: "auto" });
|
|
1158
1272
|
return;
|
|
1159
1273
|
}
|
|
1160
|
-
let
|
|
1161
|
-
if (
|
|
1162
|
-
i.current &&
|
|
1274
|
+
let m = Y.current;
|
|
1275
|
+
if (Z()) {
|
|
1276
|
+
i.current && m > 0 && Y.current === 0 && H({ behavior: "auto" });
|
|
1163
1277
|
return;
|
|
1164
1278
|
}
|
|
1165
|
-
|
|
1166
|
-
}, [
|
|
1167
|
-
let
|
|
1168
|
-
if (!(!
|
|
1279
|
+
oe(), A();
|
|
1280
|
+
}, [Z, oe, A, H]), Oe = u.useCallback(() => {
|
|
1281
|
+
let m = B.current;
|
|
1282
|
+
if (!(!m || !x.hasListeners())) {
|
|
1169
1283
|
if (typeof IntersectionObserver > "u") {
|
|
1170
|
-
|
|
1284
|
+
A();
|
|
1171
1285
|
return;
|
|
1172
1286
|
}
|
|
1173
|
-
|
|
1287
|
+
P.current || (P.current = new IntersectionObserver((w) => {
|
|
1174
1288
|
for (let C of w) {
|
|
1175
|
-
let
|
|
1176
|
-
|
|
1289
|
+
let O = C.target.dataset.messageId;
|
|
1290
|
+
O && (C.isIntersecting ? G.current.add(O) : G.current.delete(O));
|
|
1177
1291
|
}
|
|
1178
|
-
|
|
1179
|
-
}, { root:
|
|
1292
|
+
A();
|
|
1293
|
+
}, { root: m, rootMargin: `${-(L.current + q.current)}px 0px 0px 0px`, threshold: [0, 0.01, 0.5, 1] })), y.current.forEach((w) => {
|
|
1180
1294
|
var C;
|
|
1181
|
-
(C =
|
|
1182
|
-
}),
|
|
1295
|
+
(C = P.current) == null || C.observe(w);
|
|
1296
|
+
}), A();
|
|
1183
1297
|
}
|
|
1184
|
-
}, [
|
|
1185
|
-
var
|
|
1186
|
-
|
|
1187
|
-
}, [
|
|
1188
|
-
var
|
|
1298
|
+
}, [A, x]), qe = u.useCallback(() => {
|
|
1299
|
+
var m;
|
|
1300
|
+
M.current !== null && (window.cancelAnimationFrame(M.current), M.current = null), (m = P.current) == null || m.disconnect(), P.current = null, G.current.clear(), x.setSnapshot(ye);
|
|
1301
|
+
}, [x]), yt = u.useCallback((m, w, C) => {
|
|
1302
|
+
var O, ne, V;
|
|
1189
1303
|
if (w) {
|
|
1190
|
-
|
|
1304
|
+
y.current.set(m, w), (O = P.current) == null || O.observe(w), A(), ((ne = k.current) == null ? void 0 : ne.messageId) === m && Pe();
|
|
1191
1305
|
return;
|
|
1192
1306
|
}
|
|
1193
|
-
C &&
|
|
1194
|
-
}, [
|
|
1195
|
-
(
|
|
1196
|
-
}, []),
|
|
1197
|
-
g.current =
|
|
1198
|
-
}, []), Ge =
|
|
1199
|
-
|
|
1200
|
-
}, []),
|
|
1201
|
-
|
|
1202
|
-
}, [
|
|
1203
|
-
return
|
|
1204
|
-
|
|
1205
|
-
}, [
|
|
1206
|
-
var
|
|
1207
|
-
|
|
1208
|
-
}, []),
|
|
1209
|
-
if (e &&
|
|
1210
|
-
|
|
1307
|
+
C && y.current.get(m) === C && (y.current.delete(m), G.current.delete(m), (V = P.current) == null || V.unobserve(C), A());
|
|
1308
|
+
}, [Pe, A]), We = u.useCallback(() => {
|
|
1309
|
+
(b.current === "following-bottom" || b.current === "anchored-to-message" || b.current === "settling-jump") && (a.current = null, b.current = "free-scrolling");
|
|
1310
|
+
}, []), $e = u.useCallback(() => Q(R.getSnapshot()), [R, Q]), He = Qe(N, $e), Ve = Qe(B, $e), ze = u.useCallback((m) => {
|
|
1311
|
+
g.current = m;
|
|
1312
|
+
}, []), Ge = u.useCallback((m) => {
|
|
1313
|
+
_.current = m, te.current = Tr((m == null ? void 0 : m.parentElement) ?? null);
|
|
1314
|
+
}, []), Ue = u.useCallback(() => {
|
|
1315
|
+
J(), A(), ae();
|
|
1316
|
+
}, [ae, J, A]), kt = u.useMemo(() => ({ handleContentChange: xe, handleResize: Le, observeVisibility: Oe, pendingDefaultScrollStore: I, preserveScrollOnPrependRef: j, scrollToEnd: H, scrollToMessage: Ie, scrollToStart: me, setContentElement: ze, setRootElement: He, setSpacerElement: Ge, setViewportElement: Ve, stateStore: R, syncAfterScroll: Ue, unobserveVisibility: qe, userScrollIntent: We, viewportRef: B, visibilityStore: x }), [xe, Le, Oe, I, H, Ie, me, ze, He, Ge, Ve, R, Ue, qe, We, x]);
|
|
1317
|
+
return u.useLayoutEffect(() => {
|
|
1318
|
+
be() || d.current === 0 && pt(o);
|
|
1319
|
+
}, [be]), u.useEffect(() => () => {
|
|
1320
|
+
var m;
|
|
1321
|
+
S.current !== null && (window.cancelAnimationFrame(S.current), S.current = null), M.current !== null && (window.cancelAnimationFrame(M.current), M.current = null), f.current !== null && (window.clearTimeout(f.current), f.current = null), F.current !== null && (window.cancelAnimationFrame(F.current), F.current = null), (m = P.current) == null || m.disconnect(), P.current = null;
|
|
1322
|
+
}, []), u.useLayoutEffect(() => {
|
|
1323
|
+
if (e && b.current === "following-bottom" && d.current > 0) {
|
|
1324
|
+
H({ behavior: "auto" });
|
|
1211
1325
|
return;
|
|
1212
1326
|
}
|
|
1213
|
-
|
|
1214
|
-
}, [e,
|
|
1327
|
+
J();
|
|
1328
|
+
}, [e, J, H]), { context: kt, registerMessage: yt };
|
|
1215
1329
|
}
|
|
1216
|
-
function
|
|
1217
|
-
let t =
|
|
1330
|
+
function Dr(e) {
|
|
1331
|
+
let t = u.useRef(e);
|
|
1218
1332
|
return t.current = e, t;
|
|
1219
1333
|
}
|
|
1220
|
-
var
|
|
1221
|
-
function
|
|
1222
|
-
let e =
|
|
1334
|
+
var gt = u.createContext(null), mt = u.createContext(null);
|
|
1335
|
+
function ge() {
|
|
1336
|
+
let e = u.useContext(gt);
|
|
1223
1337
|
if (!e) throw new Error("useMessageScroller must be used within a MessageScroller.");
|
|
1224
1338
|
return e;
|
|
1225
1339
|
}
|
|
1226
|
-
function
|
|
1227
|
-
let e =
|
|
1340
|
+
function Ir() {
|
|
1341
|
+
let e = u.useContext(mt);
|
|
1228
1342
|
if (!e) throw new Error("MessageScrollerItem must be used within a MessageScroller.");
|
|
1229
1343
|
return e;
|
|
1230
1344
|
}
|
|
1231
|
-
function
|
|
1232
|
-
let { context: a, registerMessage: i } = Mr({ autoScroll: e, defaultScrollPosition:
|
|
1233
|
-
return
|
|
1234
|
-
}
|
|
1235
|
-
function
|
|
1236
|
-
let { pendingDefaultScrollStore: e } =
|
|
1237
|
-
return
|
|
1238
|
-
}
|
|
1239
|
-
function
|
|
1240
|
-
let { setRootElement:
|
|
1241
|
-
return
|
|
1242
|
-
}
|
|
1243
|
-
function
|
|
1244
|
-
let { handleResize: v, preserveScrollOnPrependRef:
|
|
1245
|
-
|
|
1246
|
-
let
|
|
1247
|
-
var
|
|
1248
|
-
|
|
1249
|
-
}, [i,
|
|
1250
|
-
function
|
|
1251
|
-
|
|
1345
|
+
function Nr({ autoScroll: e = !1, children: t, defaultScrollPosition: n = "end", scrollEdgeThreshold: r, scrollPreviousItemPeek: s, scrollMargin: o }) {
|
|
1346
|
+
let { context: a, registerMessage: i } = Mr({ autoScroll: e, defaultScrollPosition: n, scrollEdgeThreshold: r, scrollPreviousItemPeek: s, scrollMargin: o });
|
|
1347
|
+
return l(gt.Provider, { value: a, children: l(mt.Provider, { value: i, children: t }) });
|
|
1348
|
+
}
|
|
1349
|
+
function bt() {
|
|
1350
|
+
let { pendingDefaultScrollStore: e } = ge();
|
|
1351
|
+
return u.useSyncExternalStore(e.subscribe, e.getSnapshot, e.getSnapshot);
|
|
1352
|
+
}
|
|
1353
|
+
function Pr({ children: e, ...t }) {
|
|
1354
|
+
let { setRootElement: n } = ge(), r = bt();
|
|
1355
|
+
return l("div", { ref: n, ...t, ...r ? { "data-pending-scroll": "" } : null, children: e });
|
|
1356
|
+
}
|
|
1357
|
+
function xr({ "aria-label": e, children: t, onKeyDown: n, onScroll: r, onTouchMove: s, onWheel: o, preserveScrollOnPrepend: a = !0, ref: i, role: c, tabIndex: f, ...g }) {
|
|
1358
|
+
let { handleResize: v, preserveScrollOnPrependRef: h, setViewportElement: d, syncAfterScroll: p, userScrollIntent: y, viewportRef: b } = ge(), F = bt();
|
|
1359
|
+
h.current = a;
|
|
1360
|
+
let k = u.useCallback((E) => {
|
|
1361
|
+
var L;
|
|
1362
|
+
d(E), (L = pe(i)) == null || L(E);
|
|
1363
|
+
}, [i, d]);
|
|
1364
|
+
function D(E) {
|
|
1365
|
+
p(), r == null || r(E);
|
|
1252
1366
|
}
|
|
1253
|
-
function
|
|
1254
|
-
|
|
1367
|
+
function j(E) {
|
|
1368
|
+
y(), o == null || o(E);
|
|
1255
1369
|
}
|
|
1256
|
-
function
|
|
1257
|
-
|
|
1370
|
+
function I(E) {
|
|
1371
|
+
y(), s == null || s(E);
|
|
1258
1372
|
}
|
|
1259
|
-
function
|
|
1260
|
-
hr.has(
|
|
1373
|
+
function N(E) {
|
|
1374
|
+
hr.has(E.key) && y(), n == null || n(E);
|
|
1261
1375
|
}
|
|
1262
|
-
return
|
|
1263
|
-
let
|
|
1264
|
-
if (!
|
|
1265
|
-
let
|
|
1266
|
-
window.cancelAnimationFrame(
|
|
1376
|
+
return u.useEffect(() => {
|
|
1377
|
+
let E = b.current;
|
|
1378
|
+
if (!E || typeof ResizeObserver > "u") return;
|
|
1379
|
+
let L = 0, q = new ResizeObserver(() => {
|
|
1380
|
+
window.cancelAnimationFrame(L), L = window.requestAnimationFrame(v);
|
|
1267
1381
|
});
|
|
1268
|
-
return
|
|
1269
|
-
window.cancelAnimationFrame(
|
|
1382
|
+
return q.observe(E), () => {
|
|
1383
|
+
window.cancelAnimationFrame(L), q.disconnect();
|
|
1270
1384
|
};
|
|
1271
|
-
}, [v,
|
|
1272
|
-
}
|
|
1273
|
-
function
|
|
1274
|
-
let { handleContentChange: a, handleResize: i, setContentElement:
|
|
1275
|
-
var
|
|
1276
|
-
g.current =
|
|
1277
|
-
}, [
|
|
1278
|
-
return
|
|
1279
|
-
let
|
|
1280
|
-
if (!
|
|
1281
|
-
let
|
|
1385
|
+
}, [v, b]), l("div", { ref: k, role: c ?? "region", "aria-label": e ?? "Messages", tabIndex: f ?? 0, onKeyDown: N, onScroll: D, onTouchMove: I, onWheel: j, ...g, ...F ? { "data-pending-scroll": "" } : null, children: t });
|
|
1386
|
+
}
|
|
1387
|
+
function Lr({ "aria-relevant": e, children: t, ref: n, role: r, spacerClassName: s, ...o }) {
|
|
1388
|
+
let { handleContentChange: a, handleResize: i, setContentElement: c, setSpacerElement: f } = ge(), g = u.useRef(null), v = u.useCallback((h) => {
|
|
1389
|
+
var d;
|
|
1390
|
+
g.current = h, c(h), (d = pe(n)) == null || d(h);
|
|
1391
|
+
}, [n, c]);
|
|
1392
|
+
return u.useLayoutEffect(() => {
|
|
1393
|
+
let h = g.current;
|
|
1394
|
+
if (!h || (a(), typeof MutationObserver > "u")) return;
|
|
1395
|
+
let d = new MutationObserver(() => {
|
|
1282
1396
|
a();
|
|
1283
1397
|
});
|
|
1284
|
-
return
|
|
1285
|
-
}, [a]),
|
|
1286
|
-
let
|
|
1287
|
-
if (!
|
|
1288
|
-
let
|
|
1289
|
-
window.cancelAnimationFrame(
|
|
1398
|
+
return d.observe(h, { childList: !0 }), () => d.disconnect();
|
|
1399
|
+
}, [a]), u.useEffect(() => {
|
|
1400
|
+
let h = g.current;
|
|
1401
|
+
if (!h || typeof ResizeObserver > "u") return;
|
|
1402
|
+
let d = 0, p = new ResizeObserver(() => {
|
|
1403
|
+
window.cancelAnimationFrame(d), d = window.requestAnimationFrame(i);
|
|
1290
1404
|
});
|
|
1291
|
-
return
|
|
1292
|
-
window.cancelAnimationFrame(
|
|
1405
|
+
return p.observe(h), () => {
|
|
1406
|
+
window.cancelAnimationFrame(d), p.disconnect();
|
|
1293
1407
|
};
|
|
1294
|
-
}, [i]),
|
|
1408
|
+
}, [i]), T("div", { ref: v, role: r ?? "log", "aria-relevant": e ?? "additions", ...o, children: [t, l("div", { ref: f, "aria-hidden": "true", "data-message-scroller-spacer": "", hidden: !0, className: s })] });
|
|
1295
1409
|
}
|
|
1296
|
-
function
|
|
1297
|
-
let s =
|
|
1298
|
-
var
|
|
1299
|
-
let
|
|
1300
|
-
|
|
1410
|
+
function Or({ messageId: e, ref: t, scrollAnchor: n = !1, ...r }) {
|
|
1411
|
+
let s = Ir(), o = u.useRef(null), a = u.useCallback((i) => {
|
|
1412
|
+
var f;
|
|
1413
|
+
let c = o.current;
|
|
1414
|
+
o.current = i, e && s(e, i, c), (f = pe(t)) == null || f(i);
|
|
1301
1415
|
}, [e, t, s]);
|
|
1302
|
-
return
|
|
1303
|
-
}
|
|
1304
|
-
function
|
|
1305
|
-
let { scrollToEnd:
|
|
1306
|
-
let
|
|
1307
|
-
return
|
|
1308
|
-
}, [
|
|
1309
|
-
var
|
|
1310
|
-
|
|
1311
|
-
}, [e,
|
|
1312
|
-
return
|
|
1313
|
-
}
|
|
1314
|
-
var
|
|
1315
|
-
function
|
|
1316
|
-
var t,
|
|
1317
|
-
if (typeof e == "string" || typeof e == "number")
|
|
1416
|
+
return l("div", { ref: a, "data-message-id": e, "data-scroll-anchor": n ? "true" : "false", ...r });
|
|
1417
|
+
}
|
|
1418
|
+
function qr({ behavior: e = "smooth", children: t, direction: n = "end", onClick: r, render: s, tabIndex: o, type: a = "button", ...i }) {
|
|
1419
|
+
let { scrollToEnd: c, scrollToStart: f, stateStore: g } = ge(), v = Dr(r), h = u.useCallback((b) => g.subscribe(b), [g]), d = u.useCallback(() => {
|
|
1420
|
+
let b = g.getSnapshot();
|
|
1421
|
+
return n === "start" ? b.start : b.end;
|
|
1422
|
+
}, [n, g]), p = u.useSyncExternalStore(h, d, d), y = u.useCallback((b) => {
|
|
1423
|
+
var F;
|
|
1424
|
+
p && ((F = v.current) == null || F.call(v, b), b.defaultPrevented || (b.currentTarget.blur(), n === "start" ? f({ behavior: e }) : c({ behavior: e })));
|
|
1425
|
+
}, [e, n, p, v, c, f]);
|
|
1426
|
+
return sr({ defaultTagName: "button", props: Ee({ type: a, inert: !p, tabIndex: p ? o : -1, children: t ?? T("span", { children: ["Scroll to ", n] }), onClick: y }, i), render: s, state: { active: p, direction: n }, stateAttributesMapping: { active: (b) => ({ "data-active": b ? "true" : "false" }) } });
|
|
1427
|
+
}
|
|
1428
|
+
var ue = { Provider: Nr, Root: Pr, Viewport: xr, Content: Lr, Item: Or, Button: qr };
|
|
1429
|
+
function vt(e) {
|
|
1430
|
+
var t, n, r = "";
|
|
1431
|
+
if (typeof e == "string" || typeof e == "number") r += e;
|
|
1318
1432
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
1319
1433
|
var s = e.length;
|
|
1320
|
-
for (t = 0; t < s; t++) e[t] && (
|
|
1321
|
-
} else for (
|
|
1322
|
-
return
|
|
1434
|
+
for (t = 0; t < s; t++) e[t] && (n = vt(e[t])) && (r && (r += " "), r += n);
|
|
1435
|
+
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
1436
|
+
return r;
|
|
1323
1437
|
}
|
|
1324
|
-
function
|
|
1325
|
-
for (var e, t,
|
|
1326
|
-
return
|
|
1438
|
+
function Wr() {
|
|
1439
|
+
for (var e, t, n = 0, r = "", s = arguments.length; n < s; n++) (e = arguments[n]) && (t = vt(e)) && (r && (r += " "), r += t);
|
|
1440
|
+
return r;
|
|
1327
1441
|
}
|
|
1328
|
-
function
|
|
1329
|
-
return
|
|
1442
|
+
function de(...e) {
|
|
1443
|
+
return Wr(e);
|
|
1330
1444
|
}
|
|
1331
|
-
function
|
|
1332
|
-
return /* @__PURE__ */
|
|
1445
|
+
function $r(e) {
|
|
1446
|
+
return /* @__PURE__ */ l(ue.Provider, { ...e });
|
|
1333
1447
|
}
|
|
1334
|
-
function
|
|
1448
|
+
function Hr({
|
|
1335
1449
|
className: e,
|
|
1336
1450
|
...t
|
|
1337
1451
|
}) {
|
|
1338
|
-
return /* @__PURE__ */
|
|
1339
|
-
|
|
1452
|
+
return /* @__PURE__ */ l(
|
|
1453
|
+
ue.Root,
|
|
1340
1454
|
{
|
|
1341
1455
|
"data-slot": "message-scroller",
|
|
1342
|
-
className:
|
|
1456
|
+
className: de("msg-scroller-root", e),
|
|
1343
1457
|
...t
|
|
1344
1458
|
}
|
|
1345
1459
|
);
|
|
1346
1460
|
}
|
|
1347
|
-
function
|
|
1461
|
+
function Vr({
|
|
1348
1462
|
className: e,
|
|
1349
1463
|
...t
|
|
1350
1464
|
}) {
|
|
1351
|
-
return /* @__PURE__ */
|
|
1352
|
-
|
|
1465
|
+
return /* @__PURE__ */ l(
|
|
1466
|
+
ue.Viewport,
|
|
1353
1467
|
{
|
|
1354
1468
|
"data-slot": "message-scroller-viewport",
|
|
1355
|
-
className:
|
|
1469
|
+
className: de("msg-scroller-viewport", e),
|
|
1356
1470
|
...t
|
|
1357
1471
|
}
|
|
1358
1472
|
);
|
|
1359
1473
|
}
|
|
1360
|
-
function
|
|
1474
|
+
function zr({
|
|
1361
1475
|
className: e,
|
|
1362
1476
|
...t
|
|
1363
1477
|
}) {
|
|
1364
|
-
return /* @__PURE__ */
|
|
1365
|
-
|
|
1478
|
+
return /* @__PURE__ */ l(
|
|
1479
|
+
ue.Content,
|
|
1366
1480
|
{
|
|
1367
1481
|
"data-slot": "message-scroller-content",
|
|
1368
|
-
className:
|
|
1482
|
+
className: de("msg-scroller-content", e),
|
|
1369
1483
|
...t
|
|
1370
1484
|
}
|
|
1371
1485
|
);
|
|
1372
1486
|
}
|
|
1373
|
-
function
|
|
1487
|
+
function Xe({
|
|
1374
1488
|
className: e,
|
|
1375
1489
|
scrollAnchor: t = !1,
|
|
1376
|
-
...
|
|
1490
|
+
...n
|
|
1377
1491
|
}) {
|
|
1378
|
-
return /* @__PURE__ */
|
|
1379
|
-
|
|
1492
|
+
return /* @__PURE__ */ l(
|
|
1493
|
+
ue.Item,
|
|
1380
1494
|
{
|
|
1381
1495
|
"data-slot": "message-scroller-item",
|
|
1382
1496
|
scrollAnchor: t,
|
|
1383
|
-
className:
|
|
1384
|
-
...
|
|
1497
|
+
className: de("msg-scroller-item", e),
|
|
1498
|
+
...n
|
|
1385
1499
|
}
|
|
1386
1500
|
);
|
|
1387
1501
|
}
|
|
1388
|
-
function
|
|
1502
|
+
function Gr({
|
|
1389
1503
|
direction: e = "end",
|
|
1390
1504
|
className: t,
|
|
1391
|
-
children:
|
|
1392
|
-
...
|
|
1505
|
+
children: n,
|
|
1506
|
+
...r
|
|
1393
1507
|
}) {
|
|
1394
|
-
return /* @__PURE__ */
|
|
1395
|
-
|
|
1508
|
+
return /* @__PURE__ */ l(
|
|
1509
|
+
ue.Button,
|
|
1396
1510
|
{
|
|
1397
1511
|
"data-slot": "message-scroller-button",
|
|
1398
1512
|
direction: e,
|
|
1399
|
-
className:
|
|
1400
|
-
...
|
|
1401
|
-
children:
|
|
1402
|
-
/* @__PURE__ */
|
|
1403
|
-
|
|
1513
|
+
className: de("msg-scroller-btn", t),
|
|
1514
|
+
...r,
|
|
1515
|
+
children: n ?? /* @__PURE__ */ T(ke, { children: [
|
|
1516
|
+
/* @__PURE__ */ l(
|
|
1517
|
+
Ot,
|
|
1404
1518
|
{
|
|
1405
1519
|
size: 16,
|
|
1406
1520
|
"aria-hidden": "true",
|
|
1407
1521
|
className: e === "start" ? "rotate-180" : void 0
|
|
1408
1522
|
}
|
|
1409
1523
|
),
|
|
1410
|
-
/* @__PURE__ */
|
|
1524
|
+
/* @__PURE__ */ l("span", { className: "sr-only", children: e === "end" ? "Jump to latest" : "Jump to start" })
|
|
1411
1525
|
] })
|
|
1412
1526
|
}
|
|
1413
1527
|
);
|
|
1414
1528
|
}
|
|
1415
|
-
const
|
|
1416
|
-
/* @__PURE__ */
|
|
1529
|
+
const Ur = () => /* @__PURE__ */ T("div", { className: "chat-empty-row", children: [
|
|
1530
|
+
/* @__PURE__ */ l(
|
|
1417
1531
|
"div",
|
|
1418
1532
|
{
|
|
1419
1533
|
className: "avatar-circle avatar-circle--mt",
|
|
1420
1534
|
"aria-hidden": "true",
|
|
1421
|
-
children: /* @__PURE__ */
|
|
1535
|
+
children: /* @__PURE__ */ l(it, { size: 15 })
|
|
1422
1536
|
}
|
|
1423
1537
|
),
|
|
1424
|
-
/* @__PURE__ */
|
|
1538
|
+
/* @__PURE__ */ l("div", { className: "chat-empty-bubble", children: /* @__PURE__ */ l("p", { children: "Hello — I am the VPS Veritas assistant. Ask about reports, sample status, registration, or support, or choose a question below the text box." }) })
|
|
1425
1539
|
] });
|
|
1426
|
-
function
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
{
|
|
1437
|
-
href: r,
|
|
1438
|
-
target: "_blank",
|
|
1439
|
-
rel: "noopener noreferrer",
|
|
1440
|
-
className: "md-link",
|
|
1441
|
-
children: r
|
|
1442
|
-
},
|
|
1443
|
-
n
|
|
1444
|
-
) : /* @__PURE__ */ o(Xe.Fragment, { children: r }, n));
|
|
1445
|
-
}
|
|
1446
|
-
function Yr({ text: e }) {
|
|
1447
|
-
if (!e) return null;
|
|
1448
|
-
const t = e.split(/\n\n+/);
|
|
1449
|
-
return /* @__PURE__ */ o(oe, { children: t.map((r, n) => {
|
|
1450
|
-
if (r.trim().startsWith("- ") || r.trim().startsWith("* ")) {
|
|
1451
|
-
const s = r.split(/\n/).filter((l) => l.trim().startsWith("- ") || l.trim().startsWith("* "));
|
|
1452
|
-
return /* @__PURE__ */ o("ul", { className: "md-ul", children: s.map((l, a) => /* @__PURE__ */ o("li", { children: ye(l.replace(/^[-*]\s+/, "")) }, a)) }, n);
|
|
1453
|
-
}
|
|
1454
|
-
if (/^\d+\.\s+/.test(r.trim())) {
|
|
1455
|
-
const s = r.split(/\n/).filter((l) => /^\d+\.\s+/.test(l.trim()));
|
|
1456
|
-
return /* @__PURE__ */ o("ol", { className: "md-ol", children: s.map((l, a) => /* @__PURE__ */ o("li", { children: ye(l.replace(/^\d+\.\s+/, "")) }, a)) }, n);
|
|
1457
|
-
}
|
|
1458
|
-
if (r.startsWith("```")) {
|
|
1459
|
-
const s = r.replace(/^```[a-zA-Z]*\n?/, "").replace(/```$/, "");
|
|
1460
|
-
return /* @__PURE__ */ o(
|
|
1461
|
-
"pre",
|
|
1540
|
+
function ee(e) {
|
|
1541
|
+
if (!e) return [];
|
|
1542
|
+
const t = /(\[[^\]]+\]\([^)]+\)|\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`|https?:\/\/[^\s]+)/g;
|
|
1543
|
+
return e.split(t).map((r, s) => {
|
|
1544
|
+
if (!r) return null;
|
|
1545
|
+
const o = r.match(/^\[([^\]]+)\]\(([^)]+)\)$/);
|
|
1546
|
+
if (o) {
|
|
1547
|
+
const a = o[1], i = o[2], c = /^https?:\/\//i.test(i);
|
|
1548
|
+
return /* @__PURE__ */ l(
|
|
1549
|
+
"a",
|
|
1462
1550
|
{
|
|
1463
|
-
|
|
1464
|
-
|
|
1551
|
+
href: i,
|
|
1552
|
+
target: c ? "_blank" : void 0,
|
|
1553
|
+
rel: c ? "noopener noreferrer" : void 0,
|
|
1554
|
+
className: "md-link",
|
|
1555
|
+
children: a
|
|
1465
1556
|
},
|
|
1466
|
-
|
|
1557
|
+
s
|
|
1467
1558
|
);
|
|
1468
1559
|
}
|
|
1469
|
-
return /* @__PURE__ */
|
|
1470
|
-
|
|
1560
|
+
return r.startsWith("**") && r.endsWith("**") && r.length >= 4 ? /* @__PURE__ */ l("strong", { children: r.slice(2, -2) }, s) : r.startsWith("*") && r.endsWith("*") && r.length >= 2 ? /* @__PURE__ */ l("em", { children: r.slice(1, -1) }, s) : r.startsWith("`") && r.endsWith("`") && r.length >= 2 ? /* @__PURE__ */ l("code", { className: "md-code", children: r.slice(1, -1) }, s) : /^https?:\/\//i.test(r) ? /* @__PURE__ */ l(
|
|
1561
|
+
"a",
|
|
1562
|
+
{
|
|
1563
|
+
href: r,
|
|
1564
|
+
target: "_blank",
|
|
1565
|
+
rel: "noopener noreferrer",
|
|
1566
|
+
className: "md-link",
|
|
1567
|
+
children: r
|
|
1568
|
+
},
|
|
1569
|
+
s
|
|
1570
|
+
) : /* @__PURE__ */ l(Ae.Fragment, { children: r }, s);
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
function jr(e) {
|
|
1574
|
+
const t = e.replace(/\r\n/g, `
|
|
1575
|
+
`).split(`
|
|
1576
|
+
`), n = [];
|
|
1577
|
+
let r = 0;
|
|
1578
|
+
for (; r < t.length; ) {
|
|
1579
|
+
const o = t[r].trim();
|
|
1580
|
+
if (!o) {
|
|
1581
|
+
r++;
|
|
1582
|
+
continue;
|
|
1583
|
+
}
|
|
1584
|
+
if (o.startsWith("```")) {
|
|
1585
|
+
const c = o.slice(3).trim(), f = [];
|
|
1586
|
+
for (r++; r < t.length && !t[r].trim().startsWith("```"); )
|
|
1587
|
+
f.push(t[r]), r++;
|
|
1588
|
+
r < t.length && t[r].trim().startsWith("```") && r++, n.push({ type: "code", lang: c, code: f.join(`
|
|
1589
|
+
`) });
|
|
1590
|
+
continue;
|
|
1591
|
+
}
|
|
1592
|
+
if (/^(---|___|\*\*\*)$/.test(o)) {
|
|
1593
|
+
n.push({ type: "hr" }), r++;
|
|
1594
|
+
continue;
|
|
1595
|
+
}
|
|
1596
|
+
const a = o.match(/^(#{1,4})\s+(.*)$/);
|
|
1597
|
+
if (a) {
|
|
1598
|
+
n.push({
|
|
1599
|
+
type: "h",
|
|
1600
|
+
level: a[1].length,
|
|
1601
|
+
content: a[2]
|
|
1602
|
+
}), r++;
|
|
1603
|
+
continue;
|
|
1604
|
+
}
|
|
1605
|
+
if (o.startsWith(">")) {
|
|
1606
|
+
const c = [];
|
|
1607
|
+
for (; r < t.length && t[r].trim().startsWith(">"); )
|
|
1608
|
+
c.push(t[r].trim().replace(/^>\s?/, "")), r++;
|
|
1609
|
+
n.push({ type: "quote", lines: c });
|
|
1610
|
+
continue;
|
|
1611
|
+
}
|
|
1612
|
+
if (/^[-*]\s+/.test(o)) {
|
|
1613
|
+
const c = [];
|
|
1614
|
+
for (; r < t.length && /^[-*]\s+/.test(t[r].trim()); )
|
|
1615
|
+
c.push(t[r].trim().replace(/^[-*]\s+/, "")), r++;
|
|
1616
|
+
n.push({ type: "ul", items: c });
|
|
1617
|
+
continue;
|
|
1618
|
+
}
|
|
1619
|
+
if (/^\d+\.\s+/.test(o)) {
|
|
1620
|
+
const c = [];
|
|
1621
|
+
for (; r < t.length && /^\d+\.\s+/.test(t[r].trim()); )
|
|
1622
|
+
c.push(t[r].trim().replace(/^\d+\.\s+/, "")), r++;
|
|
1623
|
+
n.push({ type: "ol", items: c });
|
|
1624
|
+
continue;
|
|
1625
|
+
}
|
|
1626
|
+
if (o.startsWith("|") && o.endsWith("|")) {
|
|
1627
|
+
const c = [];
|
|
1628
|
+
for (; r < t.length && t[r].trim().startsWith("|") && t[r].trim().endsWith("|"); )
|
|
1629
|
+
c.push(t[r].trim()), r++;
|
|
1630
|
+
if (c.length >= 2) {
|
|
1631
|
+
const f = (d) => d.slice(1, -1).split("|").map((p) => p.trim()), g = f(c[0]), v = c[1].includes("-") ? 2 : 1, h = c.slice(v).map(f);
|
|
1632
|
+
n.push({ type: "table", headers: g, rows: h });
|
|
1633
|
+
continue;
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
const i = [];
|
|
1637
|
+
for (; r < t.length && t[r].trim() && !t[r].trim().startsWith("```") && !/^(#{1,4})\s+/.test(t[r].trim()) && !/^[-*]\s+/.test(t[r].trim()) && !/^\d+\.\s+/.test(t[r].trim()) && !t[r].trim().startsWith(">") && !/^(---|___|\*\*\*)$/.test(t[r].trim()); )
|
|
1638
|
+
i.push(t[r].trim()), r++;
|
|
1639
|
+
i.length > 0 && n.push({ type: "p", lines: i });
|
|
1640
|
+
}
|
|
1641
|
+
return n;
|
|
1471
1642
|
}
|
|
1472
|
-
const
|
|
1643
|
+
const Yr = ({ text: e }) => {
|
|
1644
|
+
if (!e) return null;
|
|
1645
|
+
const t = jr(e);
|
|
1646
|
+
return /* @__PURE__ */ l("div", { className: "md-content", children: t.map((n, r) => {
|
|
1647
|
+
switch (n.type) {
|
|
1648
|
+
case "h":
|
|
1649
|
+
return n.level === 1 ? /* @__PURE__ */ l("h2", { className: "md-h1", children: ee(n.content) }, r) : n.level === 2 ? /* @__PURE__ */ l("h3", { className: "md-h2", children: ee(n.content) }, r) : n.level === 3 ? /* @__PURE__ */ l("h4", { className: "md-h3", children: ee(n.content) }, r) : /* @__PURE__ */ l("h5", { className: "md-h4", children: ee(n.content) }, r);
|
|
1650
|
+
case "ul":
|
|
1651
|
+
return /* @__PURE__ */ l("ul", { className: "md-ul", children: n.items.map((s, o) => /* @__PURE__ */ l("li", { className: "md-li", children: ee(s) }, o)) }, r);
|
|
1652
|
+
case "ol":
|
|
1653
|
+
return /* @__PURE__ */ l("ol", { className: "md-ol", children: n.items.map((s, o) => /* @__PURE__ */ l("li", { className: "md-li", children: ee(s) }, o)) }, r);
|
|
1654
|
+
case "code":
|
|
1655
|
+
return /* @__PURE__ */ l("pre", { className: "md-pre", children: /* @__PURE__ */ l("code", { children: n.code }) }, r);
|
|
1656
|
+
case "quote":
|
|
1657
|
+
return /* @__PURE__ */ l("blockquote", { className: "md-quote", children: n.lines.map((s, o) => /* @__PURE__ */ l("p", { children: ee(s) }, o)) }, r);
|
|
1658
|
+
case "hr":
|
|
1659
|
+
return /* @__PURE__ */ l("hr", { className: "md-hr" }, r);
|
|
1660
|
+
case "table":
|
|
1661
|
+
return /* @__PURE__ */ l("div", { className: "md-table-wrap", children: /* @__PURE__ */ T("table", { className: "md-table", children: [
|
|
1662
|
+
/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ l("tr", { children: n.headers.map((s, o) => /* @__PURE__ */ l("th", { children: ee(s) }, o)) }) }),
|
|
1663
|
+
/* @__PURE__ */ l("tbody", { children: n.rows.map((s, o) => /* @__PURE__ */ l("tr", { children: s.map((a, i) => /* @__PURE__ */ l("td", { children: ee(a) }, i)) }, o)) })
|
|
1664
|
+
] }) }, r);
|
|
1665
|
+
case "p":
|
|
1666
|
+
default:
|
|
1667
|
+
return /* @__PURE__ */ l("p", { className: "md-p", children: n.lines.map((s, o) => /* @__PURE__ */ T(Ae.Fragment, { children: [
|
|
1668
|
+
ee(s),
|
|
1669
|
+
o < n.lines.length - 1 && /* @__PURE__ */ l("br", {})
|
|
1670
|
+
] }, o)) }, r);
|
|
1671
|
+
}
|
|
1672
|
+
}) });
|
|
1673
|
+
}, Jr = ({ className: e, text: t }) => /* @__PURE__ */ l(
|
|
1473
1674
|
"div",
|
|
1474
1675
|
{
|
|
1475
|
-
className:
|
|
1676
|
+
className: de("typing-indicator-container", e),
|
|
1476
1677
|
role: "status",
|
|
1477
1678
|
"aria-label": "Assistant is preparing a reply",
|
|
1478
|
-
children:
|
|
1479
|
-
/* @__PURE__ */ o("span", { className: "typing-dot" }),
|
|
1480
|
-
/* @__PURE__ */ o("span", { className: "typing-dot" }),
|
|
1481
|
-
/* @__PURE__ */ o("span", { className: "typing-dot" })
|
|
1482
|
-
]
|
|
1679
|
+
children: /* @__PURE__ */ l("div", { className: "typing-progress-pill", children: /* @__PURE__ */ l("span", { className: "typing-progress-text", children: t || "Retrieving knowledge & generating answer ..." }) })
|
|
1483
1680
|
}
|
|
1484
|
-
)
|
|
1485
|
-
|
|
1681
|
+
), Zr = ({
|
|
1682
|
+
status: e = "complete",
|
|
1683
|
+
progressText: t,
|
|
1684
|
+
sourcesCount: n = 5,
|
|
1685
|
+
durationMs: r = 1800
|
|
1686
|
+
}) => {
|
|
1687
|
+
const s = e === "pending", [o, a] = K(s), [i, c] = K(0);
|
|
1688
|
+
ie(() => {
|
|
1689
|
+
if (!s) return;
|
|
1690
|
+
a(!0);
|
|
1691
|
+
const g = Date.now(), v = setInterval(() => {
|
|
1692
|
+
c(Number(((Date.now() - g) / 1e3).toFixed(1)));
|
|
1693
|
+
}, 100);
|
|
1694
|
+
return () => clearInterval(v);
|
|
1695
|
+
}, [s]), ie(() => {
|
|
1696
|
+
s || a(!1);
|
|
1697
|
+
}, [s]);
|
|
1698
|
+
const f = s ? `${i}s` : `${(r / 1e3).toFixed(1)}s`;
|
|
1699
|
+
return /* @__PURE__ */ l("div", { className: `agent-reasoning-container${s ? " agent-reasoning--active" : ""}`, children: /* @__PURE__ */ l(
|
|
1700
|
+
"div",
|
|
1701
|
+
{
|
|
1702
|
+
className: "agent-reasoning-header",
|
|
1703
|
+
"aria-expanded": o,
|
|
1704
|
+
children: /* @__PURE__ */ T("div", { className: "agent-reasoning-header-left", children: [
|
|
1705
|
+
/* @__PURE__ */ l(
|
|
1706
|
+
$t,
|
|
1707
|
+
{
|
|
1708
|
+
size: 13,
|
|
1709
|
+
className: `agent-reasoning-brain-icon${s ? " agent-reasoning-brain--pulse" : ""}`
|
|
1710
|
+
}
|
|
1711
|
+
),
|
|
1712
|
+
/* @__PURE__ */ l("span", { className: "agent-reasoning-title", children: s ? `Thinking (${f})...` : `Thought for ${f} ` })
|
|
1713
|
+
] })
|
|
1714
|
+
}
|
|
1715
|
+
) });
|
|
1716
|
+
};
|
|
1717
|
+
function Kr(e) {
|
|
1486
1718
|
return e === "create_ticket" ? "Support ticket processed" : e === "get_customer" ? "Account verified" : e === "get_ticket" ? "Ticket status loaded" : "Information retrieved";
|
|
1487
1719
|
}
|
|
1488
|
-
function
|
|
1489
|
-
|
|
1490
|
-
return e.length ? /* @__PURE__ */ k("div", { className: "sources-panel", children: [
|
|
1491
|
-
/* @__PURE__ */ k(
|
|
1492
|
-
"button",
|
|
1493
|
-
{
|
|
1494
|
-
type: "button",
|
|
1495
|
-
className: "sources-toggle-btn",
|
|
1496
|
-
onClick: () => r((n) => !n),
|
|
1497
|
-
"aria-expanded": t,
|
|
1498
|
-
children: [
|
|
1499
|
-
/* @__PURE__ */ o(Wt, { size: 12, "aria-hidden": "true" }),
|
|
1500
|
-
e.length,
|
|
1501
|
-
" grounded source",
|
|
1502
|
-
e.length > 1 ? "s" : "",
|
|
1503
|
-
t ? /* @__PURE__ */ o(Gt, { size: 12 }) : /* @__PURE__ */ o(qt, { size: 12 })
|
|
1504
|
-
]
|
|
1505
|
-
}
|
|
1506
|
-
),
|
|
1507
|
-
t && /* @__PURE__ */ o("ul", { className: "sources-list", children: e.map((n) => /* @__PURE__ */ k(
|
|
1508
|
-
"li",
|
|
1509
|
-
{
|
|
1510
|
-
className: "source-item",
|
|
1511
|
-
children: [
|
|
1512
|
-
/* @__PURE__ */ o("span", { className: "source-name", title: n.source, children: n.source.split(/[/\\]/).pop() || n.source }),
|
|
1513
|
-
/* @__PURE__ */ k("span", { className: "source-score", children: [
|
|
1514
|
-
Math.round(n.score * 100),
|
|
1515
|
-
"%"
|
|
1516
|
-
] })
|
|
1517
|
-
]
|
|
1518
|
-
},
|
|
1519
|
-
n.chunkId
|
|
1520
|
-
)) })
|
|
1521
|
-
] }) : null;
|
|
1522
|
-
}
|
|
1523
|
-
function Xr({ toolCalls: e }) {
|
|
1524
|
-
return e.length ? /* @__PURE__ */ o("div", { className: "tool-badges", children: e.map((t, r) => /* @__PURE__ */ o(
|
|
1720
|
+
function Qr({ toolCalls: e }) {
|
|
1721
|
+
return e.length ? /* @__PURE__ */ l("div", { className: "tool-badges", children: e.map((t, n) => /* @__PURE__ */ l(
|
|
1525
1722
|
"span",
|
|
1526
1723
|
{
|
|
1527
1724
|
className: "tool-badge",
|
|
1528
|
-
children:
|
|
1725
|
+
children: Kr(t.toolName)
|
|
1529
1726
|
},
|
|
1530
|
-
`${t.toolName}-${
|
|
1727
|
+
`${t.toolName}-${n}`
|
|
1531
1728
|
)) }) : null;
|
|
1532
1729
|
}
|
|
1533
|
-
const
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1730
|
+
const Xr = ({ message: e }) => {
|
|
1731
|
+
var c;
|
|
1732
|
+
const t = Me();
|
|
1733
|
+
t == null || t.hideInspectSources, t == null || t.showGroundedSources;
|
|
1734
|
+
const n = e.role === "user", r = e.status === "error", s = e.status === "pending", o = e.id === "welcome-default" || e.id.startsWith("welcome") || e.id === "welcome", a = !!(s || e.sources && e.sources.length > 0 || e.toolCalls && e.toolCalls.length > 0 || e.usage);
|
|
1735
|
+
return /* @__PURE__ */ T("div", { className: `msg-row${n ? " msg-row--user" : ""}`, children: [
|
|
1736
|
+
!n && /* @__PURE__ */ l(
|
|
1537
1737
|
"div",
|
|
1538
1738
|
{
|
|
1539
1739
|
className: "avatar-circle avatar-circle--mt",
|
|
1540
1740
|
"aria-hidden": "true",
|
|
1541
|
-
children: /* @__PURE__ */
|
|
1741
|
+
children: /* @__PURE__ */ l(it, { size: 15 })
|
|
1542
1742
|
}
|
|
1543
1743
|
),
|
|
1544
|
-
/* @__PURE__ */
|
|
1545
|
-
/* @__PURE__ */
|
|
1744
|
+
/* @__PURE__ */ T("div", { className: `msg-col${n ? " msg-col--user" : ""}`, children: [
|
|
1745
|
+
/* @__PURE__ */ T(
|
|
1546
1746
|
"div",
|
|
1547
1747
|
{
|
|
1548
|
-
className:
|
|
1748
|
+
className: n ? "msg-bubble msg-bubble--user" : r ? "msg-bubble msg-bubble--error" : "msg-bubble msg-bubble--bot",
|
|
1549
1749
|
children: [
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1750
|
+
!n && !r && !o && a && /* @__PURE__ */ l(
|
|
1751
|
+
Zr,
|
|
1752
|
+
{
|
|
1753
|
+
status: s ? "pending" : "complete",
|
|
1754
|
+
progressText: e.progressText,
|
|
1755
|
+
sourcesCount: ((c = e.sources) == null ? void 0 : c.length) || 5
|
|
1756
|
+
}
|
|
1757
|
+
),
|
|
1758
|
+
s ? /* @__PURE__ */ l(Jr, { text: e.progressText }) : n ? /* @__PURE__ */ l("p", { className: "msg-user-pre", children: e.content }) : /* @__PURE__ */ l("div", { className: "msg-content-wrapper", children: /* @__PURE__ */ l(Yr, { text: e.content }) }),
|
|
1759
|
+
e.toolCalls ? /* @__PURE__ */ l(Qr, { toolCalls: e.toolCalls }) : null
|
|
1553
1760
|
]
|
|
1554
1761
|
}
|
|
1555
1762
|
),
|
|
1556
|
-
|
|
1763
|
+
n && e.status !== "error" && /* @__PURE__ */ l(Ht, { size: 13, className: "msg-tick", "aria-hidden": "true" })
|
|
1557
1764
|
] })
|
|
1558
1765
|
] });
|
|
1559
1766
|
}, en = () => {
|
|
1560
|
-
const { messages: e, status: t, showSuggestions:
|
|
1561
|
-
return /* @__PURE__ */
|
|
1562
|
-
|
|
1767
|
+
const { messages: e, status: t, showSuggestions: n } = Ce();
|
|
1768
|
+
return /* @__PURE__ */ l(
|
|
1769
|
+
$r,
|
|
1563
1770
|
{
|
|
1564
1771
|
autoScroll: !0,
|
|
1565
1772
|
defaultScrollPosition: "last-anchor",
|
|
1566
1773
|
scrollPreviousItemPeek: 64,
|
|
1567
|
-
children: /* @__PURE__ */
|
|
1568
|
-
/* @__PURE__ */
|
|
1569
|
-
|
|
1570
|
-
e.map((s) => /* @__PURE__ */
|
|
1571
|
-
|
|
1774
|
+
children: /* @__PURE__ */ T(Hr, { children: [
|
|
1775
|
+
/* @__PURE__ */ l(Vr, { "aria-label": "Chat messages", children: /* @__PURE__ */ T(zr, { "aria-busy": t === "awaiting" || t === "connecting", children: [
|
|
1776
|
+
e.length === 0 && /* @__PURE__ */ l(Xe, { messageId: "welcome", children: /* @__PURE__ */ l(Ur, {}) }),
|
|
1777
|
+
e.map((s) => /* @__PURE__ */ l(
|
|
1778
|
+
Xe,
|
|
1572
1779
|
{
|
|
1573
1780
|
messageId: s.id,
|
|
1574
1781
|
scrollAnchor: s.role === "user",
|
|
1575
|
-
children: /* @__PURE__ */
|
|
1782
|
+
children: /* @__PURE__ */ l(Xr, { message: s })
|
|
1576
1783
|
},
|
|
1577
1784
|
s.id
|
|
1578
1785
|
))
|
|
1579
1786
|
] }) }),
|
|
1580
|
-
/* @__PURE__ */
|
|
1787
|
+
/* @__PURE__ */ l(Gr, {})
|
|
1581
1788
|
] })
|
|
1582
1789
|
}
|
|
1583
1790
|
);
|
|
1584
1791
|
}, tn = () => {
|
|
1585
|
-
const { pendingTicket: e, ticketBusy: t, userContext:
|
|
1586
|
-
return e ? /* @__PURE__ */
|
|
1792
|
+
const { pendingTicket: e, ticketBusy: t, userContext: n, confirmTicket: r, cancelTicket: s } = Ce(), o = !n.customerId && !n.email, [a, i] = K("");
|
|
1793
|
+
return e ? /* @__PURE__ */ T(
|
|
1587
1794
|
"div",
|
|
1588
1795
|
{
|
|
1589
1796
|
className: "ticket-card",
|
|
1590
1797
|
role: "region",
|
|
1591
1798
|
"aria-label": "Create support ticket",
|
|
1592
1799
|
children: [
|
|
1593
|
-
/* @__PURE__ */
|
|
1594
|
-
/* @__PURE__ */
|
|
1595
|
-
/* @__PURE__ */
|
|
1596
|
-
|
|
1800
|
+
/* @__PURE__ */ l("h3", { className: "ticket-card-title", children: "Create support ticket?" }),
|
|
1801
|
+
/* @__PURE__ */ l("p", { className: "ticket-card-desc", children: "I can open a support request for you. Nothing is created until you confirm." }),
|
|
1802
|
+
/* @__PURE__ */ l("p", { className: "ticket-card-body", children: e.description }),
|
|
1803
|
+
o && /* @__PURE__ */ T("label", { className: "ticket-id-label", children: [
|
|
1597
1804
|
"Customer ID or email",
|
|
1598
|
-
/* @__PURE__ */
|
|
1805
|
+
/* @__PURE__ */ l(
|
|
1599
1806
|
"input",
|
|
1600
1807
|
{
|
|
1601
1808
|
value: a,
|
|
1602
|
-
onChange: (
|
|
1809
|
+
onChange: (c) => i(c.target.value),
|
|
1603
1810
|
className: "ticket-id-input",
|
|
1604
1811
|
placeholder: "CUST-1001 or you@company.com",
|
|
1605
1812
|
autoComplete: "email"
|
|
1606
1813
|
}
|
|
1607
1814
|
)
|
|
1608
1815
|
] }),
|
|
1609
|
-
/* @__PURE__ */
|
|
1610
|
-
/* @__PURE__ */
|
|
1816
|
+
/* @__PURE__ */ T("div", { className: "ticket-actions", children: [
|
|
1817
|
+
/* @__PURE__ */ l(
|
|
1611
1818
|
"button",
|
|
1612
1819
|
{
|
|
1613
1820
|
type: "button",
|
|
@@ -1617,12 +1824,12 @@ const Qr = ({ message: e }) => {
|
|
|
1617
1824
|
children: "Cancel"
|
|
1618
1825
|
}
|
|
1619
1826
|
),
|
|
1620
|
-
/* @__PURE__ */
|
|
1827
|
+
/* @__PURE__ */ l(
|
|
1621
1828
|
"button",
|
|
1622
1829
|
{
|
|
1623
1830
|
type: "button",
|
|
1624
|
-
onClick: () => void
|
|
1625
|
-
disabled: t ||
|
|
1831
|
+
onClick: () => void r(a),
|
|
1832
|
+
disabled: t || o && !a.trim(),
|
|
1626
1833
|
className: "ticket-confirm-btn",
|
|
1627
1834
|
children: t ? "Creating…" : "Create ticket"
|
|
1628
1835
|
}
|
|
@@ -1631,42 +1838,42 @@ const Qr = ({ message: e }) => {
|
|
|
1631
1838
|
]
|
|
1632
1839
|
}
|
|
1633
1840
|
) : null;
|
|
1634
|
-
},
|
|
1841
|
+
}, _t = ({
|
|
1635
1842
|
className: e,
|
|
1636
1843
|
onClose: t,
|
|
1637
|
-
showMinimize:
|
|
1638
|
-
title:
|
|
1844
|
+
showMinimize: n,
|
|
1845
|
+
title: r,
|
|
1639
1846
|
subtitle: s,
|
|
1640
|
-
envStage:
|
|
1847
|
+
envStage: o,
|
|
1641
1848
|
envPulse: a = !0
|
|
1642
1849
|
}) => {
|
|
1643
|
-
const { sendMessage: i, status:
|
|
1644
|
-
return /* @__PURE__ */
|
|
1850
|
+
const { sendMessage: i, status: c, error: f, resetConversation: g, retryLast: v, pendingTicket: h } = Ce(), d = c === "awaiting" || c === "connecting" || !!h;
|
|
1851
|
+
return /* @__PURE__ */ T(
|
|
1645
1852
|
"section",
|
|
1646
1853
|
{
|
|
1647
1854
|
className: `chat-panel${e ? ` ${e}` : ""}`,
|
|
1648
1855
|
"aria-label": "VPS AI Assistant",
|
|
1649
1856
|
children: [
|
|
1650
|
-
/* @__PURE__ */
|
|
1651
|
-
|
|
1857
|
+
/* @__PURE__ */ l(
|
|
1858
|
+
Xt,
|
|
1652
1859
|
{
|
|
1653
|
-
title:
|
|
1860
|
+
title: r,
|
|
1654
1861
|
subtitle: s,
|
|
1655
1862
|
onClose: t,
|
|
1656
1863
|
onReset: () => void g(),
|
|
1657
|
-
showMinimize:
|
|
1658
|
-
envStage:
|
|
1864
|
+
showMinimize: n,
|
|
1865
|
+
envStage: o,
|
|
1659
1866
|
envPulse: a
|
|
1660
1867
|
}
|
|
1661
1868
|
),
|
|
1662
|
-
/* @__PURE__ */
|
|
1663
|
-
|
|
1664
|
-
/* @__PURE__ */
|
|
1665
|
-
/* @__PURE__ */
|
|
1666
|
-
|
|
1869
|
+
/* @__PURE__ */ l("div", { className: "chat-panel-body", children: /* @__PURE__ */ l(en, {}) }),
|
|
1870
|
+
f && c === "error" && /* @__PURE__ */ l(Nt, { message: f, onRetry: () => void v() }),
|
|
1871
|
+
/* @__PURE__ */ l(tn, {}),
|
|
1872
|
+
/* @__PURE__ */ l(
|
|
1873
|
+
nr,
|
|
1667
1874
|
{
|
|
1668
|
-
onSend: (
|
|
1669
|
-
disabled:
|
|
1875
|
+
onSend: (p) => void i(p),
|
|
1876
|
+
disabled: d
|
|
1670
1877
|
}
|
|
1671
1878
|
)
|
|
1672
1879
|
]
|
|
@@ -1675,28 +1882,28 @@ const Qr = ({ message: e }) => {
|
|
|
1675
1882
|
}, rn = ({
|
|
1676
1883
|
open: e,
|
|
1677
1884
|
onClose: t,
|
|
1678
|
-
envStage:
|
|
1679
|
-
envPulse:
|
|
1680
|
-
}) => e ? /* @__PURE__ */
|
|
1885
|
+
envStage: n,
|
|
1886
|
+
envPulse: r = !0
|
|
1887
|
+
}) => e ? /* @__PURE__ */ l(
|
|
1681
1888
|
"div",
|
|
1682
1889
|
{
|
|
1683
1890
|
id: "vps-chatbot-widget-panel",
|
|
1684
1891
|
className: "widget-panel",
|
|
1685
|
-
children: /* @__PURE__ */
|
|
1686
|
-
|
|
1892
|
+
children: /* @__PURE__ */ l(
|
|
1893
|
+
_t,
|
|
1687
1894
|
{
|
|
1688
1895
|
onClose: t,
|
|
1689
1896
|
showMinimize: !0,
|
|
1690
1897
|
title: "VPS AI Assistant",
|
|
1691
|
-
envStage:
|
|
1692
|
-
envPulse:
|
|
1898
|
+
envStage: n,
|
|
1899
|
+
envPulse: r
|
|
1693
1900
|
}
|
|
1694
1901
|
)
|
|
1695
1902
|
}
|
|
1696
1903
|
) : null, nn = ({
|
|
1697
1904
|
open: e,
|
|
1698
1905
|
onToggle: t
|
|
1699
|
-
}) => /* @__PURE__ */
|
|
1906
|
+
}) => /* @__PURE__ */ l(
|
|
1700
1907
|
"button",
|
|
1701
1908
|
{
|
|
1702
1909
|
type: "button",
|
|
@@ -1705,61 +1912,73 @@ const Qr = ({ message: e }) => {
|
|
|
1705
1912
|
"aria-controls": "vps-chatbot-widget-panel",
|
|
1706
1913
|
"aria-label": e ? "Close assistant" : "Open assistant",
|
|
1707
1914
|
className: "widget-trigger-btn",
|
|
1708
|
-
children: e ? /* @__PURE__ */
|
|
1915
|
+
children: e ? /* @__PURE__ */ l(Jt, { size: 22 }) : /* @__PURE__ */ l(ct, { size: 24 })
|
|
1709
1916
|
}
|
|
1710
|
-
),
|
|
1917
|
+
), et = ({
|
|
1711
1918
|
defaultOpen: e = !1,
|
|
1712
1919
|
open: t,
|
|
1713
|
-
onOpenChange:
|
|
1714
|
-
envStage:
|
|
1920
|
+
onOpenChange: n,
|
|
1921
|
+
envStage: r,
|
|
1715
1922
|
envPulse: s = !0
|
|
1716
1923
|
}) => {
|
|
1717
|
-
const [
|
|
1718
|
-
|
|
1924
|
+
const [o, a] = K(e), i = t ?? o, c = (f) => {
|
|
1925
|
+
n == null || n(f), t === void 0 && a(f);
|
|
1719
1926
|
};
|
|
1720
|
-
return /* @__PURE__ */
|
|
1721
|
-
/* @__PURE__ */
|
|
1927
|
+
return /* @__PURE__ */ T(ke, { children: [
|
|
1928
|
+
/* @__PURE__ */ l(
|
|
1722
1929
|
rn,
|
|
1723
1930
|
{
|
|
1724
1931
|
open: i,
|
|
1725
|
-
onClose: () =>
|
|
1726
|
-
envStage:
|
|
1932
|
+
onClose: () => c(!1),
|
|
1933
|
+
envStage: r,
|
|
1727
1934
|
envPulse: s
|
|
1728
1935
|
}
|
|
1729
1936
|
),
|
|
1730
|
-
/* @__PURE__ */
|
|
1937
|
+
/* @__PURE__ */ l(nn, { open: i, onToggle: () => c(!i) })
|
|
1731
1938
|
] });
|
|
1732
1939
|
}, pn = ({
|
|
1733
1940
|
apiBaseUrl: e,
|
|
1734
1941
|
apiUrl: t,
|
|
1735
|
-
proxyUrl:
|
|
1736
|
-
userContext:
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1942
|
+
proxyUrl: n,
|
|
1943
|
+
userContext: r,
|
|
1944
|
+
role: s,
|
|
1945
|
+
roleId: o,
|
|
1946
|
+
client: a,
|
|
1947
|
+
welcomeMessage: i,
|
|
1948
|
+
suggestions: c,
|
|
1949
|
+
disableSuggestions: f,
|
|
1950
|
+
initialMessage: g,
|
|
1951
|
+
hideInspectSources: v,
|
|
1952
|
+
showGroundedSources: h,
|
|
1953
|
+
...d
|
|
1741
1954
|
}) => {
|
|
1742
|
-
const
|
|
1743
|
-
return !!
|
|
1744
|
-
|
|
1955
|
+
const p = Me(), y = e ?? t ?? n;
|
|
1956
|
+
return !!p && (!y || ce(y) === ce(p == null ? void 0 : p.apiBaseUrl)) && !r && s === void 0 && o === void 0 && a === void 0 && i === void 0 && !c && f === void 0 && !g && v === void 0 && h === void 0 ? /* @__PURE__ */ l(et, { ...d }) : /* @__PURE__ */ l(
|
|
1957
|
+
lt,
|
|
1745
1958
|
{
|
|
1746
|
-
apiBaseUrl:
|
|
1747
|
-
userContext:
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1959
|
+
apiBaseUrl: y,
|
|
1960
|
+
userContext: r,
|
|
1961
|
+
role: s,
|
|
1962
|
+
roleId: o,
|
|
1963
|
+
client: a,
|
|
1964
|
+
welcomeMessage: i,
|
|
1965
|
+
suggestions: c,
|
|
1966
|
+
disableSuggestions: f,
|
|
1967
|
+
initialMessage: g,
|
|
1968
|
+
hideInspectSources: v,
|
|
1969
|
+
showGroundedSources: h,
|
|
1970
|
+
children: /* @__PURE__ */ l(et, { ...d })
|
|
1752
1971
|
}
|
|
1753
1972
|
);
|
|
1754
1973
|
}, sn = ({
|
|
1755
1974
|
open: e,
|
|
1756
1975
|
onClose: t,
|
|
1757
|
-
subtitle:
|
|
1758
|
-
title:
|
|
1976
|
+
subtitle: n,
|
|
1977
|
+
title: r,
|
|
1759
1978
|
envStage: s,
|
|
1760
|
-
envPulse:
|
|
1761
|
-
}) => /* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1979
|
+
envPulse: o = !0
|
|
1980
|
+
}) => /* @__PURE__ */ T(ke, { children: [
|
|
1981
|
+
/* @__PURE__ */ l(
|
|
1763
1982
|
"div",
|
|
1764
1983
|
{
|
|
1765
1984
|
className: `embedded-overlay ${e ? "embedded-overlay--open" : "embedded-overlay--closed"}`,
|
|
@@ -1768,38 +1987,38 @@ const Qr = ({ message: e }) => {
|
|
|
1768
1987
|
"aria-hidden": "true"
|
|
1769
1988
|
}
|
|
1770
1989
|
),
|
|
1771
|
-
/* @__PURE__ */
|
|
1990
|
+
/* @__PURE__ */ l(
|
|
1772
1991
|
"aside",
|
|
1773
1992
|
{
|
|
1774
1993
|
id: "vps-embedded-chat-panel",
|
|
1775
1994
|
className: `embedded-panel ${e ? "embedded-panel--open" : "embedded-panel--closed"}`,
|
|
1776
1995
|
"aria-hidden": !e,
|
|
1777
|
-
children: e && /* @__PURE__ */
|
|
1778
|
-
|
|
1996
|
+
children: e && /* @__PURE__ */ l(
|
|
1997
|
+
_t,
|
|
1779
1998
|
{
|
|
1780
1999
|
onClose: t,
|
|
1781
|
-
title:
|
|
1782
|
-
subtitle:
|
|
2000
|
+
title: r || "VPS AI Assistant",
|
|
2001
|
+
subtitle: n,
|
|
1783
2002
|
envStage: s,
|
|
1784
|
-
envPulse:
|
|
2003
|
+
envPulse: o
|
|
1785
2004
|
}
|
|
1786
2005
|
)
|
|
1787
2006
|
}
|
|
1788
2007
|
)
|
|
1789
|
-
] }),
|
|
1790
|
-
function
|
|
1791
|
-
return Math.min(
|
|
1792
|
-
}
|
|
1793
|
-
function
|
|
1794
|
-
const
|
|
1795
|
-
|
|
1796
|
-
window.innerHeight - t -
|
|
2008
|
+
] }), on = 5, Te = 8, wt = "vps-embedded-assistant-top";
|
|
2009
|
+
function ln(e, t, n) {
|
|
2010
|
+
return Math.min(n, Math.max(t, e));
|
|
2011
|
+
}
|
|
2012
|
+
function tt(e, t) {
|
|
2013
|
+
const n = Math.max(
|
|
2014
|
+
Te,
|
|
2015
|
+
window.innerHeight - t - Te
|
|
1797
2016
|
);
|
|
1798
|
-
return
|
|
2017
|
+
return ln(e, Te, n);
|
|
1799
2018
|
}
|
|
1800
2019
|
function an() {
|
|
1801
2020
|
try {
|
|
1802
|
-
const e = window.localStorage.getItem(
|
|
2021
|
+
const e = window.localStorage.getItem(wt);
|
|
1803
2022
|
if (!e) return null;
|
|
1804
2023
|
const t = Number(e);
|
|
1805
2024
|
return Number.isFinite(t) ? t : null;
|
|
@@ -1809,73 +2028,73 @@ function an() {
|
|
|
1809
2028
|
}
|
|
1810
2029
|
function cn(e) {
|
|
1811
2030
|
try {
|
|
1812
|
-
window.localStorage.setItem(
|
|
2031
|
+
window.localStorage.setItem(wt, String(e));
|
|
1813
2032
|
} catch {
|
|
1814
2033
|
}
|
|
1815
2034
|
}
|
|
1816
2035
|
const un = ({
|
|
1817
2036
|
onOpen: e
|
|
1818
2037
|
}) => {
|
|
1819
|
-
const t =
|
|
2038
|
+
const t = se(null), n = se({
|
|
1820
2039
|
pointerId: null,
|
|
1821
2040
|
startY: 0,
|
|
1822
2041
|
startTop: 0,
|
|
1823
2042
|
moved: !1
|
|
1824
|
-
}), [
|
|
2043
|
+
}), [r, s] = K(
|
|
1825
2044
|
() => typeof window > "u" ? null : an()
|
|
1826
|
-
),
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
}, [
|
|
1830
|
-
const
|
|
1831
|
-
if (!
|
|
1832
|
-
const
|
|
1833
|
-
s((
|
|
1834
|
-
const
|
|
1835
|
-
return
|
|
2045
|
+
), o = se(r), a = se(!1), [i, c] = K(!1);
|
|
2046
|
+
ie(() => {
|
|
2047
|
+
o.current = r;
|
|
2048
|
+
}, [r]), ie(() => {
|
|
2049
|
+
const h = t.current;
|
|
2050
|
+
if (!h) return;
|
|
2051
|
+
const d = () => {
|
|
2052
|
+
s((p) => {
|
|
2053
|
+
const y = p ?? Math.round(window.innerHeight / 2 - h.offsetHeight / 2), b = tt(y, h.offsetHeight);
|
|
2054
|
+
return o.current = b, b;
|
|
1836
2055
|
});
|
|
1837
2056
|
};
|
|
1838
|
-
return
|
|
2057
|
+
return d(), window.addEventListener("resize", d), () => window.removeEventListener("resize", d);
|
|
1839
2058
|
}, []);
|
|
1840
|
-
const
|
|
1841
|
-
if (
|
|
1842
|
-
const
|
|
1843
|
-
|
|
1844
|
-
pointerId:
|
|
1845
|
-
startY:
|
|
1846
|
-
startTop:
|
|
2059
|
+
const f = (h) => {
|
|
2060
|
+
if (h.button !== 0) return;
|
|
2061
|
+
const d = h.currentTarget, p = d.getBoundingClientRect();
|
|
2062
|
+
n.current = {
|
|
2063
|
+
pointerId: h.pointerId,
|
|
2064
|
+
startY: h.clientY,
|
|
2065
|
+
startTop: p.top,
|
|
1847
2066
|
moved: !1
|
|
1848
2067
|
};
|
|
1849
2068
|
try {
|
|
1850
|
-
|
|
2069
|
+
d.setPointerCapture(h.pointerId);
|
|
1851
2070
|
} catch {
|
|
1852
2071
|
}
|
|
1853
|
-
}, g = (
|
|
1854
|
-
if (
|
|
1855
|
-
const
|
|
1856
|
-
if (!
|
|
1857
|
-
|
|
1858
|
-
const
|
|
1859
|
-
|
|
1860
|
-
|
|
2072
|
+
}, g = (h) => {
|
|
2073
|
+
if (n.current.pointerId !== h.pointerId) return;
|
|
2074
|
+
const d = h.clientY - n.current.startY;
|
|
2075
|
+
if (!n.current.moved && Math.abs(d) < on) return;
|
|
2076
|
+
n.current.moved = !0, c(!0);
|
|
2077
|
+
const p = tt(
|
|
2078
|
+
n.current.startTop + d,
|
|
2079
|
+
h.currentTarget.offsetHeight
|
|
1861
2080
|
);
|
|
1862
|
-
|
|
1863
|
-
}, v = (
|
|
1864
|
-
var
|
|
1865
|
-
if (
|
|
2081
|
+
o.current = p, s(p);
|
|
2082
|
+
}, v = (h) => {
|
|
2083
|
+
var p, y;
|
|
2084
|
+
if (n.current.pointerId !== h.pointerId) return;
|
|
1866
2085
|
try {
|
|
1867
|
-
(
|
|
2086
|
+
(y = (p = h.currentTarget).hasPointerCapture) != null && y.call(p, h.pointerId) && h.currentTarget.releasePointerCapture(h.pointerId);
|
|
1868
2087
|
} catch {
|
|
1869
2088
|
}
|
|
1870
|
-
const
|
|
1871
|
-
|
|
2089
|
+
const d = n.current.moved;
|
|
2090
|
+
n.current.pointerId = null, n.current.moved = !1, c(!1), d && (a.current = !0, o.current != null && cn(o.current));
|
|
1872
2091
|
};
|
|
1873
|
-
return /* @__PURE__ */
|
|
2092
|
+
return /* @__PURE__ */ T(
|
|
1874
2093
|
"button",
|
|
1875
2094
|
{
|
|
1876
2095
|
ref: t,
|
|
1877
2096
|
type: "button",
|
|
1878
|
-
onPointerDown:
|
|
2097
|
+
onPointerDown: f,
|
|
1879
2098
|
onPointerMove: g,
|
|
1880
2099
|
onPointerUp: v,
|
|
1881
2100
|
onPointerCancel: v,
|
|
@@ -1891,58 +2110,70 @@ const un = ({
|
|
|
1891
2110
|
"aria-label": "Assistant",
|
|
1892
2111
|
className: `embedded-trigger-btn ${i ? "embedded-trigger-btn--grabbing" : "embedded-trigger-btn--grab"}`,
|
|
1893
2112
|
style: {
|
|
1894
|
-
top:
|
|
1895
|
-
transform:
|
|
2113
|
+
top: r ?? "50%",
|
|
2114
|
+
transform: r == null ? "translateY(-50%)" : void 0
|
|
1896
2115
|
},
|
|
1897
2116
|
children: [
|
|
1898
|
-
/* @__PURE__ */
|
|
2117
|
+
/* @__PURE__ */ l(ct, { size: 16 }),
|
|
1899
2118
|
"Assistant"
|
|
1900
2119
|
]
|
|
1901
2120
|
}
|
|
1902
2121
|
);
|
|
1903
|
-
},
|
|
2122
|
+
}, rt = ({
|
|
1904
2123
|
defaultOpen: e = !1,
|
|
1905
2124
|
open: t,
|
|
1906
|
-
onOpenChange:
|
|
1907
|
-
showTrigger:
|
|
2125
|
+
onOpenChange: n,
|
|
2126
|
+
showTrigger: r = !0,
|
|
1908
2127
|
envStage: s,
|
|
1909
|
-
envPulse:
|
|
2128
|
+
envPulse: o = !0
|
|
1910
2129
|
}) => {
|
|
1911
|
-
const [a, i] =
|
|
1912
|
-
|
|
2130
|
+
const [a, i] = K(e), c = t ?? a, f = (g) => {
|
|
2131
|
+
n == null || n(g), t === void 0 && i(g);
|
|
1913
2132
|
};
|
|
1914
|
-
return /* @__PURE__ */
|
|
1915
|
-
|
|
1916
|
-
/* @__PURE__ */
|
|
2133
|
+
return /* @__PURE__ */ T(ke, { children: [
|
|
2134
|
+
r && !c && /* @__PURE__ */ l(un, { onOpen: () => f(!0) }),
|
|
2135
|
+
/* @__PURE__ */ l(
|
|
1917
2136
|
sn,
|
|
1918
2137
|
{
|
|
1919
|
-
open:
|
|
1920
|
-
onClose: () =>
|
|
2138
|
+
open: c,
|
|
2139
|
+
onClose: () => f(!1),
|
|
1921
2140
|
envStage: s,
|
|
1922
|
-
envPulse:
|
|
2141
|
+
envPulse: o
|
|
1923
2142
|
}
|
|
1924
2143
|
)
|
|
1925
2144
|
] });
|
|
1926
2145
|
}, gn = ({
|
|
1927
2146
|
apiBaseUrl: e,
|
|
1928
2147
|
apiUrl: t,
|
|
1929
|
-
proxyUrl:
|
|
1930
|
-
userContext:
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
2148
|
+
proxyUrl: n,
|
|
2149
|
+
userContext: r,
|
|
2150
|
+
role: s,
|
|
2151
|
+
roleId: o,
|
|
2152
|
+
client: a,
|
|
2153
|
+
welcomeMessage: i,
|
|
2154
|
+
suggestions: c,
|
|
2155
|
+
disableSuggestions: f,
|
|
2156
|
+
initialMessage: g,
|
|
2157
|
+
hideInspectSources: v,
|
|
2158
|
+
showGroundedSources: h,
|
|
2159
|
+
...d
|
|
1935
2160
|
}) => {
|
|
1936
|
-
const
|
|
1937
|
-
return !!
|
|
1938
|
-
|
|
2161
|
+
const p = Me(), y = e ?? t ?? n;
|
|
2162
|
+
return !!p && (!y || ce(y) === ce(p == null ? void 0 : p.apiBaseUrl)) && !r && s === void 0 && o === void 0 && a === void 0 && i === void 0 && !c && f === void 0 && !g && v === void 0 && h === void 0 ? /* @__PURE__ */ l(rt, { ...d }) : /* @__PURE__ */ l(
|
|
2163
|
+
lt,
|
|
1939
2164
|
{
|
|
1940
|
-
apiBaseUrl:
|
|
1941
|
-
userContext:
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
2165
|
+
apiBaseUrl: y,
|
|
2166
|
+
userContext: r,
|
|
2167
|
+
role: s,
|
|
2168
|
+
roleId: o,
|
|
2169
|
+
client: a,
|
|
2170
|
+
welcomeMessage: i,
|
|
2171
|
+
suggestions: c,
|
|
2172
|
+
disableSuggestions: f,
|
|
2173
|
+
initialMessage: g,
|
|
2174
|
+
hideInspectSources: v,
|
|
2175
|
+
showGroundedSources: h,
|
|
2176
|
+
children: /* @__PURE__ */ l(rt, { ...d })
|
|
1946
2177
|
}
|
|
1947
2178
|
);
|
|
1948
2179
|
}, mn = {
|
|
@@ -2110,16 +2341,16 @@ const un = ({
|
|
|
2110
2341
|
}
|
|
2111
2342
|
};
|
|
2112
2343
|
export {
|
|
2113
|
-
|
|
2114
|
-
|
|
2344
|
+
_t as ChatPanel,
|
|
2345
|
+
lt as ChatProvider,
|
|
2115
2346
|
pn as ChatbotWidget,
|
|
2116
2347
|
mn as ColorPalette,
|
|
2117
2348
|
gn as EmbeddedChatbot,
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2349
|
+
Se as buildApiUrl,
|
|
2350
|
+
fn as chatApi,
|
|
2351
|
+
ot as createChatApi,
|
|
2352
|
+
ce as resolveApiBaseUrl,
|
|
2353
|
+
Mt as useChatContext,
|
|
2354
|
+
Ce as useChatbot,
|
|
2355
|
+
Me as useOptionalChatContext
|
|
2125
2356
|
};
|