@glodon-aiot/agent-cli-ui 3.4.0-alpha.5 → 3.4.0-alpha.7
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/es/Dialog/AgentChat/index.mjs +196 -198
- package/dist/es/Dialog/SessionList/index.mjs +12 -12
- package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
- package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
- package/dist/es/src/style11.css +1 -1
- package/dist/es/src/style12.css +1 -1
- package/dist/es/src/style13.css +1 -1
- package/dist/es/src/style14.css +1 -1
- package/dist/es/src/style15.css +1 -1
- package/dist/es/src/style18.css +1 -1
- package/dist/es/src/style19.css +1 -1
- package/dist/es/src/style21.css +1 -1
- package/dist/es/src/style22.css +1 -1
- package/dist/es/src/style24.css +1 -1
- package/dist/es/src/style26.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style28.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style32.css +1 -1
- package/dist/es/src/style5.css +1 -1
- package/dist/es/src/style6.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style8.css +1 -1
- package/dist/lib/index.js +52 -52
- package/package.json +3 -3
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var Le = (x, k, o) => k in x ?
|
|
1
|
+
var rn = Object.defineProperty, an = Object.defineProperties;
|
|
2
|
+
var ln = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var dt = Object.getOwnPropertySymbols;
|
|
4
|
+
var dn = Object.prototype.hasOwnProperty, cn = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Le = (x, k, o) => k in x ? rn(x, k, { enumerable: !0, configurable: !0, writable: !0, value: o }) : x[k] = o, ct = (x, k) => {
|
|
6
6
|
for (var o in k || (k = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var o of
|
|
10
|
-
|
|
7
|
+
dn.call(k, o) && Le(x, o, k[o]);
|
|
8
|
+
if (dt)
|
|
9
|
+
for (var o of dt(k))
|
|
10
|
+
cn.call(k, o) && Le(x, o, k[o]);
|
|
11
11
|
return x;
|
|
12
|
-
},
|
|
12
|
+
}, ft = (x, k) => an(x, ln(k));
|
|
13
13
|
var D = (x, k, o) => (Le(x, typeof k != "symbol" ? k + "" : k, o), o);
|
|
14
14
|
var j = (x, k, o) => new Promise(($, e) => {
|
|
15
15
|
var L = (E) => {
|
|
@@ -27,39 +27,39 @@ var j = (x, k, o) => new Promise(($, e) => {
|
|
|
27
27
|
}, p = (E) => E.done ? $(E.value) : Promise.resolve(E.value).then(L, pe);
|
|
28
28
|
p((o = o.apply(x, k)).next());
|
|
29
29
|
});
|
|
30
|
-
import { jsx as c, jsxs as z, Fragment as
|
|
31
|
-
import { memo as
|
|
32
|
-
/* empty css */import { Spin as
|
|
33
|
-
import
|
|
34
|
-
import { IHistoryRole as J, ChatMessageRole as
|
|
35
|
-
import
|
|
36
|
-
import
|
|
30
|
+
import { jsx as c, jsxs as z, Fragment as fn } from "react/jsx-runtime";
|
|
31
|
+
import { memo as gn, forwardRef as un, useState as h, useRef as K, useContext as hn, useEffect as C, useMemo as mn, useImperativeHandle as yn } from "react";
|
|
32
|
+
/* empty css */import { Spin as gt, Divider as pn, Button as W, Space as he, Upload as vn, Tooltip as kn, Popover as bn, notification as me, message as u } from "antd";
|
|
33
|
+
import ne from "../../components/Iconfont/index.mjs";
|
|
34
|
+
import { IHistoryRole as J, ChatMessageRole as ut, PromptVariableType as ye } from "@glodon-aiot/apis";
|
|
35
|
+
import yt from "./HistoryItem/index.mjs";
|
|
36
|
+
import pt from "dayjs";
|
|
37
37
|
import { v4 as Pe } from "uuid";
|
|
38
|
-
import
|
|
39
|
-
import { configuration as
|
|
40
|
-
import { NET_OPEN_STATUS as B, MB as
|
|
41
|
-
import
|
|
42
|
-
import { getImageExtension as
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import { CameraOutlined as
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
38
|
+
import wn from "../../context.mjs";
|
|
39
|
+
import { configuration as xn } from "@glodon-aiot/bot-client-sdk";
|
|
40
|
+
import { NET_OPEN_STATUS as B, MB as In } from "../../constant.mjs";
|
|
41
|
+
import Nn from "../../components/FilePreview/index.mjs";
|
|
42
|
+
import { getImageExtension as Cn } from "../../utils/index.mjs";
|
|
43
|
+
import Ln from "../../QuillEditor/index.mjs";
|
|
44
|
+
import En from "../../components/Recommend/index.mjs";
|
|
45
|
+
import Pn from "../../components/Greeting/index.mjs";
|
|
46
|
+
import Tn from "../../Footer/index.mjs";
|
|
47
|
+
import { CameraOutlined as Fn, PlusOutlined as On } from "@ant-design/icons";
|
|
48
|
+
import Hn from "./Tools/UploadKnowledgeFiles/index.mjs";
|
|
49
|
+
import Rn from "../UploadingPrompt/index.mjs";
|
|
50
|
+
import Dn from "./PromptSetting/index.mjs";
|
|
51
51
|
import { useMemoizedFn as Ee } from "ahooks";
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
const
|
|
59
|
-
icon:
|
|
52
|
+
import Un from "./Tools/SessionListDrawer/index.mjs";
|
|
53
|
+
import Mn from "./Tools/SessionHistoryDrawer/index.mjs";
|
|
54
|
+
import jn from "react-infinite-scroll-component";
|
|
55
|
+
import zn from "./Tools/ConnectToNetwork/index.mjs";
|
|
56
|
+
import Vn from "./Tools/PromptManager/index.mjs";
|
|
57
|
+
import An from "../../assets/icon.svg.mjs";
|
|
58
|
+
const qn = gn(yt), ht = {
|
|
59
|
+
icon: An,
|
|
60
60
|
text: "今天我能帮你什么?"
|
|
61
61
|
};
|
|
62
|
-
class
|
|
62
|
+
class ie {
|
|
63
63
|
constructor(k, o, $, e) {
|
|
64
64
|
D(this, "messageTime");
|
|
65
65
|
D(this, "isWaiting");
|
|
@@ -70,13 +70,13 @@ class oe {
|
|
|
70
70
|
D(this, "isSensitive");
|
|
71
71
|
D(this, "isSuspend");
|
|
72
72
|
D(this, "comment");
|
|
73
|
-
this.content = k, this.sessionId = o, this.role = $, this.files = e, this.content = k, this.role = $, this.sessionId = o, this.files = e, this.messageTime =
|
|
73
|
+
this.content = k, this.sessionId = o, this.role = $, this.files = e, this.content = k, this.role = $, this.sessionId = o, this.files = e, this.messageTime = pt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = Pe(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
|
|
74
74
|
isAgree: 0
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
const
|
|
79
|
-
var Je, Se, et, tt, nt, it, ot, st, rt, at, lt
|
|
78
|
+
const mt = 10, vi = un((x, k) => {
|
|
79
|
+
var Je, Se, et, tt, nt, it, ot, st, rt, at, lt;
|
|
80
80
|
const {
|
|
81
81
|
application: o,
|
|
82
82
|
docViewerUrl: $ = "",
|
|
@@ -86,39 +86,39 @@ const yt = 10, ki = hn((x, k) => {
|
|
|
86
86
|
setCurrentSession: p,
|
|
87
87
|
networkStatus: E,
|
|
88
88
|
setNetworkStatus: P,
|
|
89
|
-
sessions:
|
|
89
|
+
sessions: vt,
|
|
90
90
|
// 👈 新增
|
|
91
|
-
setSessions:
|
|
91
|
+
setSessions: kt
|
|
92
92
|
// 👈 新增
|
|
93
|
-
} = x, [v, I] = h([]), [
|
|
93
|
+
} = x, [v, I] = h([]), [bt, oe] = h(), [ve, Te] = h(), H = K(null), {
|
|
94
94
|
service: T,
|
|
95
95
|
agentClient: N,
|
|
96
|
-
depId:
|
|
97
|
-
footer:
|
|
96
|
+
depId: wt,
|
|
97
|
+
footer: xt,
|
|
98
98
|
transform: g,
|
|
99
99
|
defaultInput: ke,
|
|
100
100
|
onMessage: se,
|
|
101
101
|
onHistoryLoad: Fe,
|
|
102
102
|
beforeMessageSend: V,
|
|
103
|
-
bodyStyle:
|
|
103
|
+
bodyStyle: It,
|
|
104
104
|
disabled: R,
|
|
105
105
|
features: s,
|
|
106
106
|
popupContainer: f,
|
|
107
|
-
icon:
|
|
108
|
-
sider:
|
|
109
|
-
mode:
|
|
110
|
-
} =
|
|
107
|
+
icon: Nt,
|
|
108
|
+
sider: Ct,
|
|
109
|
+
mode: Lt
|
|
110
|
+
} = hn(wn), [Oe, be] = h(!1), m = K(v), He = K(void 0), [Et, Pt] = h(0), [S, Q] = h(), [_, re] = h(""), [Re, we] = h(!1), ae = K(null), [De, Tt] = h([]), [Ue, G] = h(!1), [Me, Ft] = h(!1), [Ot, Ht] = h(""), [Rt, X] = h(), [le, de] = h({}), ce = K(null), je = K(null), xe = K(null), [ze, Dt] = h(!1), [Ut, Mt] = h([]), [jt, fe] = h(!0), [zt, Vt] = h(!0), [Ve, U] = h(!1), [Ie, A] = h(!1), [Ae, At] = h(!1), [O, ge] = h(typeof (s == null ? void 0 : s.promptVariables) == "object" ? s.promptVariables.default || [] : []), [qt, Bt] = h(typeof (s == null ? void 0 : s.knowledges) == "object" && s.knowledges.default || void 0), [qe, M] = h(!1), [Be, ee] = h(!1), [$t, Z] = h(typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.default) == "boolean" ? s.connectNetwork.default : !1), [$e, ue] = h(!1), [Yt, Y] = h(!1), [Kt, Wt] = h(null), [Ye, Ke] = h(!1);
|
|
111
111
|
C(() => {
|
|
112
|
-
if (
|
|
113
|
-
|
|
112
|
+
if (Wt(e), e === null)
|
|
113
|
+
Y(!1);
|
|
114
114
|
else if (e === void 0)
|
|
115
|
-
|
|
115
|
+
Y(!0);
|
|
116
116
|
else {
|
|
117
|
-
if (
|
|
118
|
-
|
|
117
|
+
if (Kt === null) {
|
|
118
|
+
Y(!1);
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
|
-
e.ready ?
|
|
121
|
+
e.ready ? Y(!1) : Y(!0);
|
|
122
122
|
}
|
|
123
123
|
}, [e, e == null ? void 0 : e.ready]), C(() => {
|
|
124
124
|
var a, i;
|
|
@@ -130,11 +130,11 @@ const yt = 10, ki = hn((x, k) => {
|
|
|
130
130
|
return;
|
|
131
131
|
if (A(!1), U(!1), (i = e.messages) != null && i.length) {
|
|
132
132
|
const r = [...e.messages.filter((d) => d == null ? void 0 : d.messageId)].reverse();
|
|
133
|
-
m.current = [...r], I([...r]),
|
|
133
|
+
m.current = [...r], I([...r]), Y(!1);
|
|
134
134
|
}
|
|
135
135
|
const n = (l) => {
|
|
136
136
|
var r;
|
|
137
|
-
(r = e == null ? void 0 : e.data) != null && r.id && (m.current = [...l].reverse(), I([...l].reverse()), !l || l.length < 10 ?
|
|
137
|
+
(r = e == null ? void 0 : e.data) != null && r.id && (m.current = [...l].reverse(), I([...l].reverse()), !l || l.length < 10 ? ee(!1) : ee(!0), Y(!1), Fe && Fe({
|
|
138
138
|
applicationId: o.id,
|
|
139
139
|
sessionId: e.data.id,
|
|
140
140
|
histories: l
|
|
@@ -146,7 +146,7 @@ const yt = 10, ki = hn((x, k) => {
|
|
|
146
146
|
}, [e]), C(() => {
|
|
147
147
|
const t = () => {
|
|
148
148
|
var n;
|
|
149
|
-
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ge(e.promptVariables.sort((a, i) => a.key.localeCompare(i.key))), e.knowledges &&
|
|
149
|
+
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ge(e.promptVariables.sort((a, i) => a.key.localeCompare(i.key))), e.knowledges && Bt(e.knowledges), P(e.netOpen));
|
|
150
150
|
};
|
|
151
151
|
return e == null || e.addEventListener("data:updated", t), () => {
|
|
152
152
|
e == null || e.removeEventListener("data:updated", t);
|
|
@@ -169,7 +169,7 @@ const yt = 10, ki = hn((x, k) => {
|
|
|
169
169
|
e == null || e.removeEventListener("error", t);
|
|
170
170
|
};
|
|
171
171
|
}, [e]);
|
|
172
|
-
const
|
|
172
|
+
const Qt = () => {
|
|
173
173
|
var a;
|
|
174
174
|
if (!((a = e == null ? void 0 : e.data) != null && a.id) || !(o != null && o.id))
|
|
175
175
|
return;
|
|
@@ -183,15 +183,15 @@ const yt = 10, ki = hn((x, k) => {
|
|
|
183
183
|
return;
|
|
184
184
|
} else
|
|
185
185
|
e.clear().then(() => {
|
|
186
|
-
const i = new
|
|
186
|
+
const i = new ie("", t, J.System);
|
|
187
187
|
i.isContext = !0, I([i, ...v]);
|
|
188
188
|
});
|
|
189
189
|
};
|
|
190
190
|
C(() => {
|
|
191
191
|
o != null && o.id && (T == null || T.getRecommendQues(o.id).then((t) => {
|
|
192
|
-
|
|
192
|
+
Tt(t);
|
|
193
193
|
}));
|
|
194
|
-
}, [
|
|
194
|
+
}, [wt, o]);
|
|
195
195
|
const We = (t) => j(void 0, null, function* () {
|
|
196
196
|
var y, F;
|
|
197
197
|
if (R) {
|
|
@@ -202,7 +202,7 @@ const yt = 10, ki = hn((x, k) => {
|
|
|
202
202
|
});
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
205
|
-
const n = t ||
|
|
205
|
+
const n = t || bt;
|
|
206
206
|
if (!(n != null && n.trim())) {
|
|
207
207
|
u.config({
|
|
208
208
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
@@ -237,7 +237,7 @@ const yt = 10, ki = hn((x, k) => {
|
|
|
237
237
|
});
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
|
-
if (!
|
|
240
|
+
if (!jt) {
|
|
241
241
|
u.config({
|
|
242
242
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
243
243
|
}), u.error("正在解析文件"), u.config({
|
|
@@ -253,21 +253,21 @@ const yt = 10, ki = hn((x, k) => {
|
|
|
253
253
|
});
|
|
254
254
|
return;
|
|
255
255
|
}
|
|
256
|
-
|
|
256
|
+
Q(void 0), re("");
|
|
257
257
|
const i = (y = e == null ? void 0 : e.data) == null ? void 0 : y.id;
|
|
258
258
|
if (!i) {
|
|
259
259
|
L == null || L({
|
|
260
260
|
netOpen: E ? B.OPEN : B.CLOSE
|
|
261
261
|
}).then((b) => {
|
|
262
|
-
var q,
|
|
263
|
-
M(!0), P(!!((q = b.data) != null && q.netOpen)), Z(!!((
|
|
262
|
+
var q, te;
|
|
263
|
+
M(!0), P(!!((q = b.data) != null && q.netOpen)), Z(!!((te = b.data) != null && te.enableNetOpen)), Qe(b).then(() => {
|
|
264
264
|
p == null || p(b), M(!1), Te(n);
|
|
265
265
|
});
|
|
266
266
|
});
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
269
|
ue(!0);
|
|
270
|
-
const l =
|
|
270
|
+
const l = _ ? `
|
|
271
271
|
${n}` : n;
|
|
272
272
|
let r;
|
|
273
273
|
try {
|
|
@@ -277,7 +277,7 @@ ${n}` : n;
|
|
|
277
277
|
message: {
|
|
278
278
|
content: l,
|
|
279
279
|
sessionId: i,
|
|
280
|
-
role:
|
|
280
|
+
role: ut.User,
|
|
281
281
|
files: le[i]
|
|
282
282
|
}
|
|
283
283
|
}) : r = !0;
|
|
@@ -287,7 +287,7 @@ ${n}` : n;
|
|
|
287
287
|
if (ue(!1), r === !1)
|
|
288
288
|
return;
|
|
289
289
|
let d = n;
|
|
290
|
-
typeof r == "object" && (d = r.content || n), (yield e.setPromptVariables(O)) && (((F = le[i]) == null ? void 0 : F.length) > 0 ?
|
|
290
|
+
typeof r == "object" && (d = r.content || n), (yield e.setPromptVariables(O)) && (((F = le[i]) == null ? void 0 : F.length) > 0 ? _t(d) : Ne(d));
|
|
291
291
|
}), Qe = (t) => new Promise((n, a) => j(void 0, null, function* () {
|
|
292
292
|
const r = (t == null ? void 0 : t.promptVariables).filter((d) => d.type ? !((d.type === ye.User || d.type === void 0) && d.key === "query") && !((d.type === ye.System || d.type === void 0) && d.key === "datetime") : d.key !== "query").map((d) => {
|
|
293
293
|
var y;
|
|
@@ -301,7 +301,7 @@ ${n}` : n;
|
|
|
301
301
|
getContainer: void 0
|
|
302
302
|
});
|
|
303
303
|
}), n();
|
|
304
|
-
})),
|
|
304
|
+
})), _t = (t) => {
|
|
305
305
|
var r, d, w;
|
|
306
306
|
if (fe(!1), !((r = e == null ? void 0 : e.data) != null && r.id) || !(o != null && o.id))
|
|
307
307
|
return;
|
|
@@ -324,7 +324,7 @@ ${n}` : n;
|
|
|
324
324
|
return;
|
|
325
325
|
const t = ve, n = () => j(void 0, null, function* () {
|
|
326
326
|
ue(!0);
|
|
327
|
-
const a =
|
|
327
|
+
const a = _ ? `
|
|
328
328
|
${t}` : t;
|
|
329
329
|
let i;
|
|
330
330
|
try {
|
|
@@ -334,7 +334,7 @@ ${t}` : t;
|
|
|
334
334
|
message: {
|
|
335
335
|
content: a,
|
|
336
336
|
sessionId: e.id,
|
|
337
|
-
role:
|
|
337
|
+
role: ut.User,
|
|
338
338
|
files: le[e.id]
|
|
339
339
|
}
|
|
340
340
|
}) : i = !0;
|
|
@@ -353,25 +353,25 @@ ${t}` : t;
|
|
|
353
353
|
if (!a)
|
|
354
354
|
return;
|
|
355
355
|
A(!0), U(!0);
|
|
356
|
-
const i =
|
|
357
|
-
${t}` : t, l = new
|
|
358
|
-
|
|
356
|
+
const i = _ ? `
|
|
357
|
+
${t}` : t, l = new ie(i, a, J.User, n);
|
|
358
|
+
oe(void 0), X(void 0), m.current = [l, ...v], I(m.current), o.id && se && se({
|
|
359
359
|
applicationId: o.id,
|
|
360
360
|
sessionId: a,
|
|
361
361
|
message: l
|
|
362
362
|
});
|
|
363
|
-
const r = new
|
|
363
|
+
const r = new ie("", a, J.System);
|
|
364
364
|
r.isWaiting = !0, m.current = [r, ...m.current], I(m.current);
|
|
365
365
|
const d = (n == null ? void 0 : n.map((b) => b.id)) || [], w = {
|
|
366
|
-
stream:
|
|
366
|
+
stream: xn.stream,
|
|
367
367
|
referenceFirst: !1
|
|
368
368
|
};
|
|
369
369
|
if (g != null && g.promptVariables) {
|
|
370
|
-
const b = O == null ? void 0 : O.reduce((q,
|
|
370
|
+
const b = O == null ? void 0 : O.reduce((q, te) => (q[te.key] = te.value, q), {});
|
|
371
371
|
w.formatValues = b;
|
|
372
372
|
}
|
|
373
373
|
if (g != null && g.knowledges) {
|
|
374
|
-
const b =
|
|
374
|
+
const b = qt;
|
|
375
375
|
w.knowledges = b;
|
|
376
376
|
}
|
|
377
377
|
yield e.send({
|
|
@@ -394,7 +394,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
394
394
|
return me.error({
|
|
395
395
|
message: i.content
|
|
396
396
|
});
|
|
397
|
-
const l = i.actions || [], r = new
|
|
397
|
+
const l = i.actions || [], r = new ie(i.content, t, J.Robot);
|
|
398
398
|
r.messageId = i.messageId || Pe(), r.reasoningContent = i.reasoningContent, r.searchReference = i.searchReference, r.thinkingSecs = i.thinkingSecs, r.thinkingStatus = i.thinkingStatus, r.actions = l, r.isLoading = !0, r.searchingStatus = i.searchingStatus, m.current = m.current.filter((d) => !d.isWaiting).filter((d) => !d.isReplying), i.index === void 0 && I([r, ...m.current]), i.code === 11915 && (U(!1), A(!1), r.isLoading = !1, r.content = "请您换个问题问我吧~", r.isSensitive = !0, I([r, ...m.current])), i.index === -2 && (U(!1), A(!1), r.isLoading = !1, r.content = "回答已中止~", r.isSuspend = !0, I([r, ...m.current])), i.index === -1 && (U(!1), A(!1), r.isLoading = !1, r.reference = i.reference, I([r, ...m.current]), o.id && se && se({
|
|
399
399
|
applicationId: o.id,
|
|
400
400
|
sessionId: t,
|
|
@@ -418,29 +418,27 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
418
418
|
e == null || e.removeEventListener("frozen", t);
|
|
419
419
|
};
|
|
420
420
|
}, [e]), C(() => {
|
|
421
|
-
e && (Y(void 0), S(void 0));
|
|
422
|
-
}, [(Je = e == null ? void 0 : e.data) == null ? void 0 : Je.id]), C(() => {
|
|
423
421
|
if (!N)
|
|
424
422
|
return;
|
|
425
423
|
const t = N.questionContextMaxLength || 4e3;
|
|
426
|
-
|
|
424
|
+
Pt(t);
|
|
427
425
|
}, [N, T]), C(() => {
|
|
428
|
-
ke &&
|
|
426
|
+
ke && X(ke.text);
|
|
429
427
|
}, [ke]);
|
|
430
|
-
const
|
|
428
|
+
const Gt = (t) => {
|
|
431
429
|
const n = t.size;
|
|
432
430
|
return n <= 0 ? (u.config({
|
|
433
431
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
434
432
|
}), u.error("该文件为空,请重新上传"), u.config({
|
|
435
433
|
getContainer: void 0
|
|
436
|
-
}), !1) : n > 20 *
|
|
434
|
+
}), !1) : n > 20 * In ? (u.config({
|
|
437
435
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
438
436
|
}), u.error("图片须小于20M"), u.config({
|
|
439
437
|
getContainer: void 0
|
|
440
|
-
}), !1) : (
|
|
441
|
-
},
|
|
438
|
+
}), !1) : (Q(t), !1);
|
|
439
|
+
}, Xt = (t) => j(void 0, null, function* () {
|
|
442
440
|
var n;
|
|
443
|
-
return
|
|
441
|
+
return Q(t), (n = e == null ? void 0 : e.data) != null && n.id ? _e(e, t) : new Promise((a) => {
|
|
444
442
|
M(!0), L == null || L({
|
|
445
443
|
netOpen: E ? B.OPEN : B.CLOSE
|
|
446
444
|
}).then((i) => {
|
|
@@ -449,7 +447,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
449
447
|
});
|
|
450
448
|
});
|
|
451
449
|
}), _e = (t, n) => {
|
|
452
|
-
const a =
|
|
450
|
+
const a = Cn(n.name);
|
|
453
451
|
return new Promise((i) => {
|
|
454
452
|
var r;
|
|
455
453
|
const l = {
|
|
@@ -464,12 +462,12 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
464
462
|
const w = (b = d.minio.endpoints) == null ? void 0 : b[0], y = d.minio.bucket, F = (q = d.minio.fileKeys) == null ? void 0 : q[0];
|
|
465
463
|
i(`${location.protocol}//${w}/${y}/${F}`);
|
|
466
464
|
}).catch(() => {
|
|
467
|
-
re(""),
|
|
465
|
+
re(""), Q(void 0);
|
|
468
466
|
}).finally(() => {
|
|
469
467
|
we(!1);
|
|
470
468
|
});
|
|
471
469
|
}).catch(() => {
|
|
472
|
-
re(""),
|
|
470
|
+
re(""), Q(void 0), we(!1);
|
|
473
471
|
});
|
|
474
472
|
});
|
|
475
473
|
};
|
|
@@ -482,17 +480,17 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
482
480
|
const Ge = (t, n) => new Promise((a) => {
|
|
483
481
|
if (!n.file.url || !(o != null && o.id))
|
|
484
482
|
return a();
|
|
485
|
-
const i =
|
|
483
|
+
const i = ft(ct({}, n.file), {
|
|
486
484
|
type: 1
|
|
487
485
|
});
|
|
488
486
|
T == null || T.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
|
|
489
487
|
var l;
|
|
490
488
|
(l = ce.current) == null || l.update().finally(a);
|
|
491
489
|
});
|
|
492
|
-
}),
|
|
490
|
+
}), Zt = () => {
|
|
493
491
|
var t;
|
|
494
492
|
(t = e == null ? void 0 : e.data) != null && t.id && (U(!1), e.suspend());
|
|
495
|
-
},
|
|
493
|
+
}, Jt = (t) => {
|
|
496
494
|
const n = H.current;
|
|
497
495
|
n && setTimeout(() => {
|
|
498
496
|
n.scrollTo({
|
|
@@ -500,45 +498,45 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
500
498
|
behavior: t == null ? void 0 : t.behavior
|
|
501
499
|
});
|
|
502
500
|
}, t == null ? void 0 : t.ms);
|
|
503
|
-
},
|
|
501
|
+
}, St = () => {
|
|
504
502
|
if (!H.current)
|
|
505
503
|
return;
|
|
506
504
|
const t = H.current.scrollTop <= -80;
|
|
507
|
-
|
|
508
|
-
},
|
|
505
|
+
At(t);
|
|
506
|
+
}, en = Ee((t) => {
|
|
509
507
|
var n, a;
|
|
510
508
|
(n = ae.current) == null || n.update(t), (a = ae.current) == null || a.focus();
|
|
511
|
-
}),
|
|
509
|
+
}), tn = Ee((t) => {
|
|
512
510
|
We(t);
|
|
513
|
-
}),
|
|
511
|
+
}), nn = Ee(() => {
|
|
514
512
|
var n;
|
|
515
513
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
516
514
|
return;
|
|
517
515
|
m.current = [...v.slice(1, v.length)], I(m.current);
|
|
518
|
-
const t = new
|
|
516
|
+
const t = new ie("", e.data.id, J.System);
|
|
519
517
|
t.isWaiting = !0, m.current = [t, ...m.current], I(m.current), A(!0), U(!0), e.answerAgain();
|
|
520
518
|
});
|
|
521
519
|
C(() => {
|
|
522
520
|
var t, n;
|
|
523
521
|
He.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !qe && ((n = xe.current) == null || n.clear());
|
|
524
522
|
}, [e]);
|
|
525
|
-
const
|
|
523
|
+
const on = () => {
|
|
526
524
|
var a;
|
|
527
525
|
if (!((a = e == null ? void 0 : e.data) != null && a.id))
|
|
528
526
|
return;
|
|
529
527
|
const n = v[v.length - 1].messageTime;
|
|
530
528
|
e.fetchMessages({
|
|
531
529
|
endTime: n,
|
|
532
|
-
pageSize:
|
|
530
|
+
pageSize: mt
|
|
533
531
|
}).then((i) => {
|
|
534
532
|
const l = i || [];
|
|
535
533
|
if (!l || !(l != null && l.length)) {
|
|
536
|
-
|
|
534
|
+
ee(!1);
|
|
537
535
|
return;
|
|
538
536
|
}
|
|
539
|
-
l.length < 10 ?
|
|
537
|
+
l.length < 10 ? ee(!1) : ee(!0), I([...v, ...l.reverse()]);
|
|
540
538
|
});
|
|
541
|
-
},
|
|
539
|
+
}, sn = (t) => j(void 0, null, function* () {
|
|
542
540
|
var n, a;
|
|
543
541
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
544
542
|
P(t);
|
|
@@ -600,9 +598,9 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
600
598
|
}).then((t) => {
|
|
601
599
|
var n, a;
|
|
602
600
|
return p == null || p(t), M(!1), P(!!((n = t.data) != null && n.netOpen)), Z(!!((a = t.data) != null && a.enableNetOpen)), Qe(t), t;
|
|
603
|
-
}), Ze =
|
|
601
|
+
}), Ze = mn(() => {
|
|
604
602
|
var t;
|
|
605
|
-
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(
|
|
603
|
+
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(yt, {
|
|
606
604
|
application: o,
|
|
607
605
|
history: {
|
|
608
606
|
role: 1,
|
|
@@ -612,7 +610,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
612
610
|
sessionId: "",
|
|
613
611
|
reference: [],
|
|
614
612
|
searchReference: [],
|
|
615
|
-
messageTime:
|
|
613
|
+
messageTime: pt(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
|
|
616
614
|
actions: [],
|
|
617
615
|
isLoading: !1
|
|
618
616
|
},
|
|
@@ -620,18 +618,18 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
620
618
|
markdown: s == null ? void 0 : s.markdown
|
|
621
619
|
}) : null;
|
|
622
620
|
}, [o == null ? void 0 : o.arrange, v]);
|
|
623
|
-
return
|
|
621
|
+
return yn(k, () => ({
|
|
624
622
|
getCurrentInputText: () => {
|
|
625
623
|
var t;
|
|
626
624
|
return (t = ae.current) == null ? void 0 : t.getCurrentText();
|
|
627
625
|
}
|
|
628
626
|
})), /* @__PURE__ */ z("div", {
|
|
629
627
|
className: "agent-chat",
|
|
630
|
-
children: [
|
|
628
|
+
children: [Yt ? /* @__PURE__ */ c("div", {
|
|
631
629
|
className: "session-loading",
|
|
632
|
-
children: /* @__PURE__ */ c(
|
|
633
|
-
}) : /* @__PURE__ */ z(
|
|
634
|
-
children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ c(
|
|
630
|
+
children: /* @__PURE__ */ c(gt, {})
|
|
631
|
+
}) : /* @__PURE__ */ z(fn, {
|
|
632
|
+
children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ c(Dn, {
|
|
635
633
|
ref: je,
|
|
636
634
|
appId: o.id,
|
|
637
635
|
currentSession: e,
|
|
@@ -641,7 +639,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
641
639
|
}), /* @__PURE__ */ z("div", {
|
|
642
640
|
className: "chat-main",
|
|
643
641
|
id: "chat-main",
|
|
644
|
-
style:
|
|
642
|
+
style: It,
|
|
645
643
|
children: [/* @__PURE__ */ c("div", {
|
|
646
644
|
className: "chat-main-wrapper",
|
|
647
645
|
id: "scrollableDiv",
|
|
@@ -652,18 +650,18 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
652
650
|
flexDirection: "column-reverse"
|
|
653
651
|
},
|
|
654
652
|
ref: H,
|
|
655
|
-
onScroll:
|
|
656
|
-
children: (
|
|
653
|
+
onScroll: St,
|
|
654
|
+
children: (Je = e == null ? void 0 : e.data) != null && Je.id && (v != null && v.length) ? /* @__PURE__ */ z(jn, {
|
|
657
655
|
dataLength: v.length,
|
|
658
|
-
next:
|
|
656
|
+
next: on,
|
|
659
657
|
style: {
|
|
660
658
|
display: "flex",
|
|
661
659
|
flexDirection: "column-reverse",
|
|
662
660
|
overflowX: "hidden"
|
|
663
661
|
},
|
|
664
662
|
inverse: !0,
|
|
665
|
-
endMessage: v.length >
|
|
666
|
-
((
|
|
663
|
+
endMessage: v.length > mt && // 少于一页不展示这个提示
|
|
664
|
+
((Se = H.current) != null && Se.scrollTop) && ((et = H.current) == null ? void 0 : et.scrollTop) < -10 ? /* @__PURE__ */ c(pn, {
|
|
667
665
|
plain: !0,
|
|
668
666
|
children: "没有更多数据了"
|
|
669
667
|
}) : null,
|
|
@@ -674,79 +672,79 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
674
672
|
textAlign: "center",
|
|
675
673
|
overflow: "hidden"
|
|
676
674
|
},
|
|
677
|
-
children: /* @__PURE__ */ c(
|
|
675
|
+
children: /* @__PURE__ */ c(gt, {})
|
|
678
676
|
}),
|
|
679
677
|
scrollableTarget: "scrollableDiv",
|
|
680
|
-
children: [v.map((t, n) => /* @__PURE__ */ c(
|
|
678
|
+
children: [v.map((t, n) => /* @__PURE__ */ c(qn, {
|
|
681
679
|
application: o,
|
|
682
680
|
currentSession: e,
|
|
683
681
|
history: t,
|
|
684
682
|
docViewerUrl: $,
|
|
685
683
|
isLastHistory: n === 0,
|
|
686
|
-
onRelatedClick:
|
|
687
|
-
onAgainClick:
|
|
688
|
-
onEditClick:
|
|
684
|
+
onRelatedClick: tn,
|
|
685
|
+
onAgainClick: nn,
|
|
686
|
+
onEditClick: en,
|
|
689
687
|
markdown: s == null ? void 0 : s.markdown
|
|
690
688
|
}, t.messageId + n)), !Be && Ze]
|
|
691
689
|
}) : /* @__PURE__ */ z("div", {
|
|
692
690
|
className: "main-empty",
|
|
693
|
-
children: [(s == null ? void 0 : s.greeting) !== !1 && /* @__PURE__ */ c(
|
|
694
|
-
text: s === void 0 || s.greeting === !0 || ((
|
|
695
|
-
icon: s === void 0 || s.greeting === !0 || ((
|
|
696
|
-
children: !!De.length && (((s == null ? void 0 : s.greeting) === void 0 || (s == null ? void 0 : s.greeting)) === !0 || typeof (s == null ? void 0 : s.greeting) == "object" && s.greeting.questions !== !1) && /* @__PURE__ */ c(
|
|
691
|
+
children: [(s == null ? void 0 : s.greeting) !== !1 && /* @__PURE__ */ c(Pn, {
|
|
692
|
+
text: s === void 0 || s.greeting === !0 || ((tt = s.greeting) == null ? void 0 : tt.text) === void 0 ? ht.text : s.greeting.text,
|
|
693
|
+
icon: s === void 0 || s.greeting === !0 || ((nt = s.greeting) == null ? void 0 : nt.icon) === void 0 ? Nt || ht.icon : s.greeting.icon,
|
|
694
|
+
children: !!De.length && (((s == null ? void 0 : s.greeting) === void 0 || (s == null ? void 0 : s.greeting)) === !0 || typeof (s == null ? void 0 : s.greeting) == "object" && s.greeting.questions !== !1) && /* @__PURE__ */ c(En, {
|
|
697
695
|
ref: xe,
|
|
698
|
-
sid: (
|
|
696
|
+
sid: (it = e == null ? void 0 : e.data) == null ? void 0 : it.id,
|
|
699
697
|
isRecommendClearing: Ue,
|
|
700
698
|
data: De,
|
|
701
699
|
layoutBreakpoints: typeof (s == null ? void 0 : s.greeting) == "object" ? s.greeting.layoutBreakpoints : void 0,
|
|
702
700
|
onItemClick: (t) => {
|
|
703
701
|
var a, i, l;
|
|
704
|
-
if (
|
|
702
|
+
if (oe(t == null ? void 0 : t.question), X(t == null ? void 0 : t.question), Ue)
|
|
705
703
|
return;
|
|
706
|
-
t != null && t.id &&
|
|
704
|
+
t != null && t.id && G(!0);
|
|
707
705
|
const n = (a = e == null ? void 0 : e.data) == null ? void 0 : a.id;
|
|
708
706
|
g != null && g.fileUpload ? (l = (i = ce.current) == null ? void 0 : i.clear()) == null || l.then(() => {
|
|
709
707
|
var r, d;
|
|
710
708
|
t != null && t.id && (n ? (r = Ge(n, t)) == null || r.finally(() => {
|
|
711
|
-
|
|
712
|
-
}) : (
|
|
709
|
+
G(!1);
|
|
710
|
+
}) : (G(!1), M(!0), (d = Xe()) == null || d.then((w) => {
|
|
713
711
|
var y;
|
|
714
712
|
(y = Ge(w.id, t)) == null || y.finally(() => {
|
|
715
|
-
|
|
713
|
+
G(!1);
|
|
716
714
|
});
|
|
717
715
|
})));
|
|
718
|
-
}) : n ?
|
|
716
|
+
}) : n ? G(!1) : (G(!1), M(!0), Xe());
|
|
719
717
|
}
|
|
720
718
|
})
|
|
721
719
|
}), Ze]
|
|
722
720
|
})
|
|
723
721
|
}), Ve && /* @__PURE__ */ c("div", {
|
|
724
722
|
className: "session-stop",
|
|
725
|
-
children: /* @__PURE__ */ c(
|
|
723
|
+
children: /* @__PURE__ */ c(W, {
|
|
726
724
|
type: "primary",
|
|
727
725
|
style: {
|
|
728
726
|
background: "white"
|
|
729
727
|
},
|
|
730
728
|
ghost: !0,
|
|
731
729
|
size: "small",
|
|
732
|
-
icon: /* @__PURE__ */ c(
|
|
730
|
+
icon: /* @__PURE__ */ c(ne, {
|
|
733
731
|
type: "icon-zantinghuida",
|
|
734
732
|
style: {
|
|
735
733
|
fontSize: 16
|
|
736
734
|
}
|
|
737
735
|
}),
|
|
738
|
-
onClick: () =>
|
|
736
|
+
onClick: () => Zt(),
|
|
739
737
|
children: "停止回答"
|
|
740
738
|
})
|
|
741
739
|
}), Ae && (v == null ? void 0 : v.length) > 0 && /* @__PURE__ */ c("div", {
|
|
742
740
|
className: "back-bottom",
|
|
743
|
-
children: /* @__PURE__ */ c(
|
|
741
|
+
children: /* @__PURE__ */ c(W, {
|
|
744
742
|
size: "small",
|
|
745
|
-
onClick: () =>
|
|
743
|
+
onClick: () => Jt({
|
|
746
744
|
behavior: "smooth"
|
|
747
745
|
}),
|
|
748
746
|
type: "link",
|
|
749
|
-
icon: /* @__PURE__ */ c(
|
|
747
|
+
icon: /* @__PURE__ */ c(ne, {
|
|
750
748
|
type: "icon-yijianhuidaodibu",
|
|
751
749
|
style: {
|
|
752
750
|
fontSize: 24
|
|
@@ -758,14 +756,14 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
758
756
|
className: "chat-footer",
|
|
759
757
|
children: /* @__PURE__ */ z("div", {
|
|
760
758
|
className: "chat-footer-input",
|
|
761
|
-
children: [
|
|
759
|
+
children: [S && /* @__PURE__ */ c("div", {
|
|
762
760
|
className: "input-files",
|
|
763
|
-
children: /* @__PURE__ */ c(
|
|
764
|
-
file:
|
|
761
|
+
children: /* @__PURE__ */ c(Nn, {
|
|
762
|
+
file: S,
|
|
765
763
|
actions: {
|
|
766
|
-
upload:
|
|
764
|
+
upload: Xt,
|
|
767
765
|
remove: () => {
|
|
768
|
-
|
|
766
|
+
Q(void 0);
|
|
769
767
|
}
|
|
770
768
|
},
|
|
771
769
|
onUrlChange: (t) => re(t)
|
|
@@ -774,14 +772,14 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
774
772
|
className: "footer-upload-action",
|
|
775
773
|
onClick: (t) => t.preventDefault(),
|
|
776
774
|
children: [/* @__PURE__ */ z(he, {
|
|
777
|
-
children: [o.type === 2 && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ c(
|
|
778
|
-
disabled: !!
|
|
775
|
+
children: [o.type === 2 && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ c(vn, {
|
|
776
|
+
disabled: !!S || R,
|
|
779
777
|
accept: ".jpg, .png, .jpeg,.bmp",
|
|
780
778
|
listType: "picture-card",
|
|
781
|
-
beforeUpload:
|
|
779
|
+
beforeUpload: Gt,
|
|
782
780
|
className: "footer-upload-picture",
|
|
783
781
|
showUploadList: !1,
|
|
784
|
-
children:
|
|
782
|
+
children: S ? /* @__PURE__ */ c(W, {
|
|
785
783
|
type: "text",
|
|
786
784
|
className: "camera-out-btn",
|
|
787
785
|
style: {
|
|
@@ -789,20 +787,20 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
789
787
|
position: "relative",
|
|
790
788
|
bottom: "-2px"
|
|
791
789
|
},
|
|
792
|
-
disabled: !!
|
|
793
|
-
icon: /* @__PURE__ */ c(
|
|
790
|
+
disabled: !!S || R,
|
|
791
|
+
icon: /* @__PURE__ */ c(Fn, {
|
|
794
792
|
className: "icon-tianjia",
|
|
795
793
|
style: {
|
|
796
794
|
fontSize: "22px"
|
|
797
795
|
}
|
|
798
796
|
})
|
|
799
|
-
}) : /* @__PURE__ */ c(
|
|
797
|
+
}) : /* @__PURE__ */ c(kn, {
|
|
800
798
|
placement: "topLeft",
|
|
801
799
|
overlayClassName: "footer-upload-tooltip",
|
|
802
800
|
title: /* @__PURE__ */ c("div", {
|
|
803
801
|
children: "支持上传.jpg .png .jpeg .bmp格式的图片数据,最大20M,单次仅可上传1个"
|
|
804
802
|
}),
|
|
805
|
-
children: /* @__PURE__ */ c(
|
|
803
|
+
children: /* @__PURE__ */ c(W, {
|
|
806
804
|
type: "text",
|
|
807
805
|
className: "camera-out-btn",
|
|
808
806
|
style: {
|
|
@@ -810,7 +808,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
810
808
|
position: "relative",
|
|
811
809
|
bottom: "-2px"
|
|
812
810
|
},
|
|
813
|
-
icon: /* @__PURE__ */ c(
|
|
811
|
+
icon: /* @__PURE__ */ c(ne, {
|
|
814
812
|
type: "icon-Vector",
|
|
815
813
|
className: "icon-tianjia",
|
|
816
814
|
style: {
|
|
@@ -819,7 +817,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
819
817
|
})
|
|
820
818
|
})
|
|
821
819
|
})
|
|
822
|
-
}), pe && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ c(
|
|
820
|
+
}), pe && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ c(Hn, {
|
|
823
821
|
appId: o == null ? void 0 : o.id,
|
|
824
822
|
ref: ce,
|
|
825
823
|
isFirstSession: qe,
|
|
@@ -837,7 +835,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
837
835
|
t(a);
|
|
838
836
|
});
|
|
839
837
|
}),
|
|
840
|
-
sid: (
|
|
838
|
+
sid: (ot = e == null ? void 0 : e.data) == null ? void 0 : ot.id,
|
|
841
839
|
disabled: Ie || R,
|
|
842
840
|
afterFileAdd: (t, n) => {
|
|
843
841
|
n && de((a) => {
|
|
@@ -858,9 +856,9 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
858
856
|
});
|
|
859
857
|
},
|
|
860
858
|
onFileListChange: (t) => {
|
|
861
|
-
|
|
859
|
+
Mt(t);
|
|
862
860
|
},
|
|
863
|
-
shouldContinue:
|
|
861
|
+
shouldContinue: zt,
|
|
864
862
|
afterFilesClear: () => {
|
|
865
863
|
var n;
|
|
866
864
|
const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
|
|
@@ -868,33 +866,33 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
868
866
|
[t]: []
|
|
869
867
|
}), Ce());
|
|
870
868
|
}
|
|
871
|
-
}) : null, (g == null ? void 0 : g.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ c(
|
|
869
|
+
}) : null, (g == null ? void 0 : g.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ c(Vn, {
|
|
872
870
|
appId: o.id,
|
|
873
871
|
list: [],
|
|
874
|
-
search: Me ?
|
|
872
|
+
search: Me ? Ot : "",
|
|
875
873
|
onPromptSelect: (t) => {
|
|
876
|
-
|
|
874
|
+
X(t.context), oe(t.context);
|
|
877
875
|
},
|
|
878
876
|
disabled: R
|
|
879
877
|
})]
|
|
880
878
|
}), /* @__PURE__ */ z(he, {
|
|
881
|
-
children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((
|
|
882
|
-
sessionId: (
|
|
879
|
+
children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((st = o.arrange) == null ? void 0 : st.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ c(zn, {
|
|
880
|
+
sessionId: (rt = e == null ? void 0 : e.data) == null ? void 0 : rt.id,
|
|
883
881
|
netStatus: E,
|
|
884
|
-
enable: typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.diabled) == "boolean" ? !(s != null && s.connectNetwork.diabled) :
|
|
882
|
+
enable: typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.diabled) == "boolean" ? !(s != null && s.connectNetwork.diabled) : $t,
|
|
885
883
|
disabledTip: e ? void 0 : "网络访问已被禁用",
|
|
886
884
|
onNetStatusChange: (t) => {
|
|
887
|
-
|
|
885
|
+
sn(t);
|
|
888
886
|
}
|
|
889
|
-
}), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(
|
|
890
|
-
currentSessionId: (
|
|
887
|
+
}), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(Un, {
|
|
888
|
+
currentSessionId: (at = e == null ? void 0 : e.data) == null ? void 0 : at.id,
|
|
891
889
|
onSessionChange: (t, n) => {
|
|
892
|
-
|
|
890
|
+
X(void 0), p == null || p(n);
|
|
893
891
|
},
|
|
894
892
|
disabled: R
|
|
895
|
-
}),
|
|
893
|
+
}), Ct && Lt === "float" && /* @__PURE__ */ c("div", {
|
|
896
894
|
className: "session-history-drawer-component",
|
|
897
|
-
children: /* @__PURE__ */ c(
|
|
895
|
+
children: /* @__PURE__ */ c(bn, {
|
|
898
896
|
placement: "topRight",
|
|
899
897
|
showArrow: !1,
|
|
900
898
|
overlayClassName: "session-history-overlay",
|
|
@@ -903,11 +901,11 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
903
901
|
},
|
|
904
902
|
getPopupContainer: (t) => t.parentNode,
|
|
905
903
|
content: "会话历史记录",
|
|
906
|
-
children: /* @__PURE__ */ c(
|
|
904
|
+
children: /* @__PURE__ */ c(W, {
|
|
907
905
|
className: "history-overlay-action",
|
|
908
906
|
disabled: R,
|
|
909
907
|
type: "text",
|
|
910
|
-
icon: /* @__PURE__ */ c(
|
|
908
|
+
icon: /* @__PURE__ */ c(ne, {
|
|
911
909
|
type: "icon-lishijilu",
|
|
912
910
|
style: {
|
|
913
911
|
fontSize: 24
|
|
@@ -916,8 +914,8 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
916
914
|
onClick: () => Ke(!0)
|
|
917
915
|
})
|
|
918
916
|
})
|
|
919
|
-
}), (g == null ? void 0 : g.sessionOpen) && /* @__PURE__ */ c(
|
|
920
|
-
icon: /* @__PURE__ */ c(
|
|
917
|
+
}), (g == null ? void 0 : g.sessionOpen) && /* @__PURE__ */ c(W, {
|
|
918
|
+
icon: /* @__PURE__ */ c(On, {}),
|
|
921
919
|
className: "add-btn",
|
|
922
920
|
type: "primary",
|
|
923
921
|
disabled: Ve || !e || !v.length || R,
|
|
@@ -930,54 +928,54 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
930
928
|
})]
|
|
931
929
|
}), /* @__PURE__ */ c("div", {
|
|
932
930
|
className: "footer-textarea",
|
|
933
|
-
children: /* @__PURE__ */ c(
|
|
931
|
+
children: /* @__PURE__ */ c(Ln, {
|
|
934
932
|
ref: ae,
|
|
935
|
-
maxLength:
|
|
936
|
-
text:
|
|
933
|
+
maxLength: Et,
|
|
934
|
+
text: Rt,
|
|
937
935
|
networkStatus: !1,
|
|
938
936
|
loading: $e,
|
|
939
937
|
disabled: Oe || Re || R || $e,
|
|
940
938
|
onTextSend: We,
|
|
941
939
|
onChange: (t, n) => {
|
|
942
|
-
|
|
940
|
+
X(t);
|
|
943
941
|
const a = n.getText().replace(/[\n\s]+$/, "");
|
|
944
|
-
|
|
942
|
+
oe(a), Ht(a), Me || Ft(!0);
|
|
945
943
|
},
|
|
946
944
|
clearAction: /* @__PURE__ */ c(he, {
|
|
947
945
|
size: 0,
|
|
948
|
-
children: /* @__PURE__ */ c(
|
|
946
|
+
children: /* @__PURE__ */ c(W, {
|
|
949
947
|
type: "link",
|
|
950
948
|
disabled: Ie || R,
|
|
951
949
|
ghost: !0,
|
|
952
|
-
icon: /* @__PURE__ */ c(
|
|
950
|
+
icon: /* @__PURE__ */ c(ne, {
|
|
953
951
|
style: {
|
|
954
952
|
fontSize: 22
|
|
955
953
|
},
|
|
956
954
|
type: "icon-qingchujiyi"
|
|
957
955
|
}),
|
|
958
|
-
onClick: () =>
|
|
956
|
+
onClick: () => Qt()
|
|
959
957
|
})
|
|
960
958
|
})
|
|
961
959
|
})
|
|
962
960
|
})]
|
|
963
961
|
})
|
|
964
|
-
}), /* @__PURE__ */ c(
|
|
965
|
-
tips:
|
|
966
|
-
}), ze && /* @__PURE__ */ c(
|
|
962
|
+
}), /* @__PURE__ */ c(Tn, {
|
|
963
|
+
tips: xt
|
|
964
|
+
}), ze && /* @__PURE__ */ c(Rn, {
|
|
967
965
|
isvisible: ze,
|
|
968
|
-
files:
|
|
969
|
-
sessionId: (
|
|
966
|
+
files: Ut,
|
|
967
|
+
sessionId: (lt = e == null ? void 0 : e.data) == null ? void 0 : lt.id,
|
|
970
968
|
onClose: (t) => {
|
|
971
|
-
|
|
969
|
+
Dt(!1), Vt(!1);
|
|
972
970
|
}
|
|
973
971
|
})]
|
|
974
|
-
}), Ye && /* @__PURE__ */ c(
|
|
972
|
+
}), Ye && /* @__PURE__ */ c(Mn, {
|
|
975
973
|
currentSession: e,
|
|
976
974
|
application: o,
|
|
977
975
|
networkStatus: E,
|
|
978
976
|
setCurrentSession: p,
|
|
979
|
-
sessions:
|
|
980
|
-
setSessions:
|
|
977
|
+
sessions: vt,
|
|
978
|
+
setSessions: kt,
|
|
981
979
|
disabled: R,
|
|
982
980
|
isSessionHistoryVisible: Ye,
|
|
983
981
|
setIsSessionHistoryVisible: Ke
|
|
@@ -985,5 +983,5 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
985
983
|
});
|
|
986
984
|
});
|
|
987
985
|
export {
|
|
988
|
-
|
|
986
|
+
vi as default
|
|
989
987
|
};
|