@glodon-aiot/agent-cli-ui 3.17.0-alpha.4 → 3.17.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/Dialog/AgentChat/index.mjs +270 -267
- package/dist/es/packages/agent-cli-ui/package.json.mjs +11 -11
- 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/style16.css +1 -1
- package/dist/es/src/style18.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style21.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style31.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/es/src/style9.css +1 -1
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +3 -3
- package/package.json +3 -3
|
@@ -2,36 +2,36 @@ var An = Object.defineProperty, jn = Object.defineProperties;
|
|
|
2
2
|
var $n = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var At = Object.getOwnPropertySymbols;
|
|
4
4
|
var zn = Object.prototype.hasOwnProperty, Vn = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var Ae = (
|
|
5
|
+
var Ae = (w, u, i) => u in w ? An(w, u, { enumerable: !0, configurable: !0, writable: !0, value: i }) : w[u] = i, je = (w, u) => {
|
|
6
6
|
for (var i in u || (u = {}))
|
|
7
|
-
zn.call(u, i) && Ae(
|
|
7
|
+
zn.call(u, i) && Ae(w, i, u[i]);
|
|
8
8
|
if (At)
|
|
9
9
|
for (var i of At(u))
|
|
10
|
-
Vn.call(u, i) && Ae(
|
|
11
|
-
return
|
|
12
|
-
}, $e = (
|
|
13
|
-
var
|
|
14
|
-
var
|
|
10
|
+
Vn.call(u, i) && Ae(w, i, u[i]);
|
|
11
|
+
return w;
|
|
12
|
+
}, $e = (w, u) => jn(w, $n(u));
|
|
13
|
+
var j = (w, u, i) => (Ae(w, typeof u != "symbol" ? u + "" : u, i), i);
|
|
14
|
+
var $ = (w, u, i) => new Promise((U, e) => {
|
|
15
15
|
var x = (P) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
k(i.next(P));
|
|
18
18
|
} catch (T) {
|
|
19
19
|
e(T);
|
|
20
20
|
}
|
|
21
21
|
}, V = (P) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
k(i.throw(P));
|
|
24
24
|
} catch (T) {
|
|
25
25
|
e(T);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, k = (P) => P.done ? U(P.value) : Promise.resolve(P.value).then(x, V);
|
|
28
|
+
k((i = i.apply(w, u)).next());
|
|
29
29
|
});
|
|
30
|
-
import { jsx as f, jsxs as
|
|
30
|
+
import { jsx as f, jsxs as R, Fragment as Bn } from "react/jsx-runtime";
|
|
31
31
|
import { memo as _n, forwardRef as qn, useState as g, useRef as Y, useContext as Wn, useEffect as C, useMemo as Kn, useImperativeHandle as Yn } from "react";
|
|
32
|
-
/* empty css */import { message as jt, Spin as $t, Divider as Qn, Button as G, Space as
|
|
32
|
+
/* empty css */import { message as jt, Spin as $t, Divider as Qn, Button as G, Space as Ne, Upload as Sn, Tooltip as Xn, Popover as Gn, notification as se } from "antd";
|
|
33
33
|
import re from "../../components/Iconfont/index.mjs";
|
|
34
|
-
import { IHistoryRole as ae, ApplicationTypes as Q, ChatMessageRole as zt, PromptVariableType as
|
|
34
|
+
import { IHistoryRole as ae, ApplicationTypes as Q, ChatMessageRole as zt, PromptVariableType as Ee } from "@glodon-aiot/apis";
|
|
35
35
|
import Wt from "./HistoryItem/index.mjs";
|
|
36
36
|
import Kt from "dayjs";
|
|
37
37
|
import { v4 as _e } from "uuid";
|
|
@@ -56,31 +56,31 @@ import hi from "./Tools/ConnectToNetwork/index.mjs";
|
|
|
56
56
|
import mi from "./Tools/PromptManager/index.mjs";
|
|
57
57
|
import { useSessionState as yi } from "../../hooks/useSessionState.mjs";
|
|
58
58
|
import vi from "../../assets/icon.svg.mjs";
|
|
59
|
-
const
|
|
59
|
+
const wi = _n(Wt), _t = {
|
|
60
60
|
icon: vi,
|
|
61
61
|
text: "今天我能帮你什么?"
|
|
62
62
|
};
|
|
63
63
|
class he {
|
|
64
|
-
constructor(u, i,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
constructor(u, i, U, e, x) {
|
|
65
|
+
j(this, "messageTime");
|
|
66
|
+
j(this, "isWaiting");
|
|
67
|
+
j(this, "messageId");
|
|
68
|
+
j(this, "isContext");
|
|
69
|
+
j(this, "actions");
|
|
70
|
+
j(this, "reference");
|
|
71
|
+
j(this, "isSensitive");
|
|
72
|
+
j(this, "isSuspend");
|
|
73
|
+
j(this, "imageContent");
|
|
74
74
|
// 新增:支持对话型应用的图片内容
|
|
75
|
-
|
|
76
|
-
this.content = u, this.sessionId = i, this.role =
|
|
75
|
+
j(this, "comment");
|
|
76
|
+
this.content = u, this.sessionId = i, this.role = U, this.files = e, this.content = u, this.role = U, this.sessionId = i, this.files = e, this.imageContent = x, this.messageTime = Kt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = _e(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
|
|
77
77
|
isAgree: 0
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
const qt = 10, Z = 5, Ve = 20, Be = (
|
|
82
|
-
let e =
|
|
83
|
-
if (
|
|
81
|
+
const qt = 10, Z = 5, Ve = 20, Be = (w, u, i, U) => {
|
|
82
|
+
let e = w;
|
|
83
|
+
if (U === Q.Agent) {
|
|
84
84
|
if (i && i.length > 0) {
|
|
85
85
|
const x = i.map((V) => `[${V.name.replace(/\.[^/.]+$/, "")}](${V.url})`).join(`
|
|
86
86
|
`);
|
|
@@ -95,23 +95,23 @@ ${e}` : e;
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
return e;
|
|
98
|
-
},
|
|
99
|
-
const u = Math.floor(
|
|
100
|
-
return `${e(u)}:${e(i)}:${e(
|
|
101
|
-
}, Ji = qn((
|
|
102
|
-
var
|
|
98
|
+
}, ki = (w) => {
|
|
99
|
+
const u = Math.floor(w / 3600), i = Math.floor(w % 3600 / 60), U = w % 60, e = (x) => String(x).padStart(2, "0");
|
|
100
|
+
return `${e(u)}:${e(i)}:${e(U)}`;
|
|
101
|
+
}, Ji = qn((w, u) => {
|
|
102
|
+
var kt, bt, xt, Ct, It, Nt, Et, Lt, Pt, Tt, Dt, Ot, Rt, Ut;
|
|
103
103
|
const {
|
|
104
104
|
application: i,
|
|
105
|
-
docViewerUrl:
|
|
105
|
+
docViewerUrl: U = "",
|
|
106
106
|
currentSession: e,
|
|
107
107
|
onCreateSession: x,
|
|
108
108
|
embeddingService: V,
|
|
109
|
-
setCurrentSession:
|
|
109
|
+
setCurrentSession: k,
|
|
110
110
|
networkStatus: P,
|
|
111
111
|
setNetworkStatus: T
|
|
112
|
-
} =
|
|
113
|
-
service:
|
|
114
|
-
agentClient:
|
|
112
|
+
} = w, [y, N] = g([]), [Yt, me] = g(), [Le, qe] = g(), F = Y(null), {
|
|
113
|
+
service: M,
|
|
114
|
+
agentClient: E,
|
|
115
115
|
depId: Qt,
|
|
116
116
|
footer: St,
|
|
117
117
|
transform: c,
|
|
@@ -127,11 +127,11 @@ ${e}` : e;
|
|
|
127
127
|
sider: Zt,
|
|
128
128
|
mode: Jt,
|
|
129
129
|
silencedSeconds: Te
|
|
130
|
-
} = Wn(Zn), [Ke, De] = g(!1), m = Y(y), Ye = Y(void 0), [en, tn] = g(0), [ce, ve] = g([]), [J,
|
|
130
|
+
} = Wn(Zn), [Ke, De] = g(!1), m = Y(y), Ye = Y(void 0), [en, tn] = g(0), [ce, ve] = g([]), [J, we] = g([]), [Qe, Se] = g(0), [Xe, nn] = g(!1);
|
|
131
131
|
C(() => {
|
|
132
132
|
nn(Qe > 0);
|
|
133
133
|
}, [Qe]);
|
|
134
|
-
const
|
|
134
|
+
const ke = Y(null), [Ge, on] = g([]), [Ze, ee] = g(!1), [Je, sn] = g(!1), [rn, an] = g(""), [ln, te] = g(), [ne, de] = g({}), fe = Y(null), et = Y(null), Oe = Y(null), [tt, cn] = g(!1), [dn, fn] = g([]), [gn, be] = g(!0), [un, pn] = g(!0), [nt, B] = g(!1), [Re, W] = g(!1), [it, hn] = g(!1), [H, ge] = g(typeof (l == null ? void 0 : l.promptVariables) == "object" ? l.promptVariables.default || [] : []), [mn, yn] = g(() => {
|
|
135
135
|
const t = typeof (l == null ? void 0 : l.knowledges) == "object" && l.knowledges.default || void 0;
|
|
136
136
|
if (t) {
|
|
137
137
|
if (Array.isArray(t) && t.some((a) => Array.isArray(a.fileIds) && a.fileIds.length === 0))
|
|
@@ -140,14 +140,14 @@ ${e}` : e;
|
|
|
140
140
|
throw Error(`knowledges and fileIds total count cannot exceed ${Vt}`);
|
|
141
141
|
}
|
|
142
142
|
return t;
|
|
143
|
-
}), [ot, S] = g(!1), [st, ue] = g(!1), [vn, pe] = g(typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.default) == "boolean" ? l.connectNetwork.default : !1), [rt, xe] = g(!1), [
|
|
143
|
+
}), [ot, S] = g(!1), [st, ue] = g(!1), [vn, pe] = g(typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.default) == "boolean" ? l.connectNetwork.default : !1), [rt, xe] = g(!1), [wn, K] = g(!1), [kn, bn] = g(null), [Ce, X] = g(!1), [at, lt] = g(!1), {
|
|
144
144
|
isSwitchingToExistingSession: ct,
|
|
145
145
|
setIsSwitchingToExistingSession: Ie
|
|
146
146
|
} = yi(), ie = Y(null), [Ue, xn] = g("");
|
|
147
147
|
C(() => {
|
|
148
148
|
if (!Te)
|
|
149
149
|
return;
|
|
150
|
-
let t =
|
|
150
|
+
let t = ki(Te);
|
|
151
151
|
xn(t);
|
|
152
152
|
}, [Te]), C(() => {
|
|
153
153
|
if (bn(e), e === null)
|
|
@@ -155,7 +155,7 @@ ${e}` : e;
|
|
|
155
155
|
else if (e === void 0)
|
|
156
156
|
K(!0);
|
|
157
157
|
else {
|
|
158
|
-
if (
|
|
158
|
+
if (kn === null) {
|
|
159
159
|
if (ct) {
|
|
160
160
|
K(!0), Ie(!1);
|
|
161
161
|
return;
|
|
@@ -167,26 +167,26 @@ ${e}` : e;
|
|
|
167
167
|
}
|
|
168
168
|
}, [e, e == null ? void 0 : e.ready, ct]), C(() => {
|
|
169
169
|
var s, a;
|
|
170
|
-
e && (m.current = []),
|
|
171
|
-
const t =
|
|
170
|
+
e && (m.current = []), N([]);
|
|
171
|
+
const t = F.current;
|
|
172
172
|
if (t && t.scrollTo({
|
|
173
173
|
top: 0
|
|
174
174
|
}), !((s = e == null ? void 0 : e.data) != null && s.id))
|
|
175
175
|
return;
|
|
176
176
|
if (W(!1), B(!1), (a = e.messages) != null && a.length) {
|
|
177
177
|
const d = [...e.messages.filter((r) => r == null ? void 0 : r.messageId)].reverse();
|
|
178
|
-
m.current = [...d],
|
|
178
|
+
m.current = [...d], N([...d]), K(!1);
|
|
179
179
|
}
|
|
180
180
|
const n = (o) => {
|
|
181
181
|
var d;
|
|
182
|
-
(d = e == null ? void 0 : e.data) != null && d.id && (m.current = [...o].reverse(),
|
|
182
|
+
(d = e == null ? void 0 : e.data) != null && d.id && (m.current = [...o].reverse(), N([...o].reverse()), !o || o.length < 10 ? ue(!1) : ue(!0), K(!1), We && We({
|
|
183
183
|
applicationId: i.id,
|
|
184
184
|
sessionId: e.data.id,
|
|
185
185
|
histories: o
|
|
186
186
|
}));
|
|
187
187
|
};
|
|
188
188
|
return e.addEventListener("history:loaded", n), () => {
|
|
189
|
-
m.current = [],
|
|
189
|
+
m.current = [], N([]), e == null || e.removeEventListener("history:loaded", n);
|
|
190
190
|
};
|
|
191
191
|
}, [e]), C(() => {
|
|
192
192
|
const t = () => {
|
|
@@ -227,16 +227,16 @@ ${e}` : e;
|
|
|
227
227
|
} else
|
|
228
228
|
e.clear().then(() => {
|
|
229
229
|
const a = new he("", t, ae.System);
|
|
230
|
-
a.isContext = !0,
|
|
230
|
+
a.isContext = !0, N([a, ...y]);
|
|
231
231
|
});
|
|
232
232
|
};
|
|
233
233
|
C(() => {
|
|
234
|
-
i != null && i.id && (
|
|
234
|
+
i != null && i.id && (M == null || M.getRecommendQues(i.id).then((t) => {
|
|
235
235
|
on(t);
|
|
236
236
|
}));
|
|
237
237
|
}, [Qt, i]);
|
|
238
|
-
const dt = (t) =>
|
|
239
|
-
var
|
|
238
|
+
const dt = (t) => $(void 0, null, function* () {
|
|
239
|
+
var A, D;
|
|
240
240
|
if (O) {
|
|
241
241
|
L("error", "发送功能被禁用");
|
|
242
242
|
return;
|
|
@@ -246,12 +246,12 @@ ${e}` : e;
|
|
|
246
246
|
L("error", "请输入你想问的");
|
|
247
247
|
return;
|
|
248
248
|
}
|
|
249
|
-
if (!(
|
|
249
|
+
if (!(H == null ? void 0 : H.every((b) => !!(b != null && b.value))))
|
|
250
250
|
if (c != null && c.promptVariables) {
|
|
251
251
|
L("error", "变量值不能为空");
|
|
252
252
|
return;
|
|
253
253
|
} else
|
|
254
|
-
console.error("变量值不能为空",
|
|
254
|
+
console.error("变量值不能为空", H == null ? void 0 : H.map((b) => !!(b != null && b.value)));
|
|
255
255
|
if (Re) {
|
|
256
256
|
L("error", "正在回复中");
|
|
257
257
|
return;
|
|
@@ -268,8 +268,8 @@ ${e}` : e;
|
|
|
268
268
|
L("error", "正在上传图片");
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
|
-
ve([]),
|
|
272
|
-
const a = (
|
|
271
|
+
ve([]), we([]);
|
|
272
|
+
const a = (A = e == null ? void 0 : e.data) == null ? void 0 : A.id;
|
|
273
273
|
if (!a) {
|
|
274
274
|
if (Ce)
|
|
275
275
|
return;
|
|
@@ -278,7 +278,7 @@ ${e}` : e;
|
|
|
278
278
|
}).then((b) => {
|
|
279
279
|
var p, _;
|
|
280
280
|
S(!0), T(!!((p = b.data) != null && p.netOpen)), pe(!!((_ = b.data) != null && _.enableNetOpen)), Fe(b).then(() => {
|
|
281
|
-
|
|
281
|
+
k == null || k(b), S(!1), qe(n);
|
|
282
282
|
});
|
|
283
283
|
}).catch((b) => {
|
|
284
284
|
X(!1);
|
|
@@ -318,10 +318,10 @@ ${e}` : e;
|
|
|
318
318
|
return;
|
|
319
319
|
}
|
|
320
320
|
((D = ne[a]) == null ? void 0 : D.length) > 0 ? In(r) : Me(r);
|
|
321
|
-
}), Fe = (t) => new Promise((n, s) =>
|
|
322
|
-
const d = (t == null ? void 0 : t.promptVariables).filter((r) => r.type ? !((r.type ===
|
|
321
|
+
}), Fe = (t) => new Promise((n, s) => $(void 0, null, function* () {
|
|
322
|
+
const d = (t == null ? void 0 : t.promptVariables).filter((r) => r.type ? !((r.type === Ee.User || r.type === void 0) && r.key === "query") && !((r.type === Ee.System || r.type === void 0) && r.key === "datetime") : r.key !== "query").map((r) => {
|
|
323
323
|
var v;
|
|
324
|
-
const h = (v =
|
|
324
|
+
const h = (v = H.find((I) => I.key === r.key && I.type === r.type)) == null ? void 0 : v.value;
|
|
325
325
|
return r.value = h || "", r;
|
|
326
326
|
});
|
|
327
327
|
ge(d.sort((r, h) => r.key.localeCompare(h.key))), yield t == null ? void 0 : t.setPromptVariables(d).catch((r) => {
|
|
@@ -340,7 +340,7 @@ ${e}` : e;
|
|
|
340
340
|
C(() => {
|
|
341
341
|
if (!Le || !e)
|
|
342
342
|
return;
|
|
343
|
-
const t = Le, n = () =>
|
|
343
|
+
const t = Le, n = () => $(void 0, null, function* () {
|
|
344
344
|
xe(!0);
|
|
345
345
|
const s = Be(t, J, ne[e.id], (i == null ? void 0 : i.type) || 0);
|
|
346
346
|
let a;
|
|
@@ -368,9 +368,9 @@ ${e}` : e;
|
|
|
368
368
|
e == null || e.removeEventListener("ready", n);
|
|
369
369
|
};
|
|
370
370
|
}, [Le, e]);
|
|
371
|
-
const Me = (t, n) =>
|
|
372
|
-
var
|
|
373
|
-
const s = (
|
|
371
|
+
const Me = (t, n) => $(void 0, null, function* () {
|
|
372
|
+
var A, D, b;
|
|
373
|
+
const s = (A = e == null ? void 0 : e.data) == null ? void 0 : A.id;
|
|
374
374
|
if (!s)
|
|
375
375
|
return;
|
|
376
376
|
W(!0), B(!0);
|
|
@@ -391,19 +391,19 @@ ${e}` : e;
|
|
|
391
391
|
o
|
|
392
392
|
// 新增:传入图片内容
|
|
393
393
|
);
|
|
394
|
-
me(void 0), te(void 0), m.current = [d, ...y],
|
|
394
|
+
me(void 0), te(void 0), m.current = [d, ...y], N(m.current), i.id && ye && ye({
|
|
395
395
|
applicationId: i.id,
|
|
396
396
|
sessionId: s,
|
|
397
397
|
message: d
|
|
398
398
|
});
|
|
399
399
|
const r = new he("", s, ae.System);
|
|
400
|
-
r.isWaiting = !0, m.current = [r, ...m.current],
|
|
400
|
+
r.isWaiting = !0, m.current = [r, ...m.current], N(m.current);
|
|
401
401
|
const h = (n == null ? void 0 : n.map((p) => p.id)) || [], v = {
|
|
402
402
|
stream: Jn.stream,
|
|
403
403
|
referenceFirst: !1
|
|
404
404
|
};
|
|
405
405
|
if (c != null && c.promptVariables) {
|
|
406
|
-
const p =
|
|
406
|
+
const p = H == null ? void 0 : H.reduce((_, oe) => (_[oe.key] = oe.value, _), {});
|
|
407
407
|
v.formatValues = p;
|
|
408
408
|
}
|
|
409
409
|
if (c != null && c.knowledges) {
|
|
@@ -417,7 +417,7 @@ ${e}` : e;
|
|
|
417
417
|
};
|
|
418
418
|
o && o.length > 0 && (I.imageContent = o), yield e.send(I, v), de({
|
|
419
419
|
[s]: []
|
|
420
|
-
}), (b = fe.current) == null || b.update(), ve([]),
|
|
420
|
+
}), (b = fe.current) == null || b.update(), ve([]), we([]), X(!1);
|
|
421
421
|
});
|
|
422
422
|
C(() => {
|
|
423
423
|
var a;
|
|
@@ -427,7 +427,7 @@ ${e}` : e;
|
|
|
427
427
|
const n = (o) => {
|
|
428
428
|
if (!o.sessionId || o.sessionId && o.sessionId !== Ye.current || o.role === ae.User)
|
|
429
429
|
return;
|
|
430
|
-
if (o.index === -1 && o.code !== 200 && o.code !== 11915 && (B(!1), W(!1), m.current = m.current.filter((h) => !h.isWaiting),
|
|
430
|
+
if (o.index === -1 && o.code !== 200 && o.code !== 11915 && (B(!1), W(!1), m.current = m.current.filter((h) => !h.isWaiting), N([...m.current]), m.current = [...m.current], o.content)) {
|
|
431
431
|
se.config({
|
|
432
432
|
getContainer: () => (z == null ? void 0 : z.current) || document.body,
|
|
433
433
|
prefixCls: "gbot-notification"
|
|
@@ -440,11 +440,11 @@ ${e}` : e;
|
|
|
440
440
|
return;
|
|
441
441
|
}
|
|
442
442
|
const d = o.actions || [], r = new he(o.content, t, ae.Robot);
|
|
443
|
-
r.messageId = o.messageId || _e(), r.reasoningContent = o.reasoningContent, r.searchReference = o.searchReference, r.thinkingSecs = o.thinkingSecs, r.thinkingStatus = o.thinkingStatus, r.actions = d, r.isLoading = !0, r.searchingStatus = o.searchingStatus, m.current = m.current.filter((h) => !h.isWaiting).filter((h) => !h.isReplying), o.index === void 0 &&
|
|
443
|
+
r.messageId = o.messageId || _e(), r.reasoningContent = o.reasoningContent, r.searchReference = o.searchReference, r.thinkingSecs = o.thinkingSecs, r.thinkingStatus = o.thinkingStatus, r.actions = d, r.isLoading = !0, r.searchingStatus = o.searchingStatus, m.current = m.current.filter((h) => !h.isWaiting).filter((h) => !h.isReplying), o.index === void 0 && N([r, ...m.current]), o.code === 11915 && (B(!1), W(!1), r.isLoading = !1, r.content = "请您换个问题问我吧~", r.isSensitive = !0, N([r, ...m.current])), o.index === -2 && (B(!1), W(!1), r.isLoading = !1, r.content = "回答已中止~", r.isSuspend = !0, N([r, ...m.current])), o.index === -1 && (B(!1), W(!1), r.isLoading = !1, r.reference = o.reference, N([r, ...m.current]), i.id && ye && ye({
|
|
444
444
|
applicationId: i.id,
|
|
445
445
|
sessionId: t,
|
|
446
446
|
message: r
|
|
447
|
-
})), o.index === -3 && (B(!1), W(!1), r.isLoading = !1, r.reference = o.reference, r.relatedQuesion = o.relatedQuesion,
|
|
447
|
+
})), o.index === -3 && (B(!1), W(!1), r.isLoading = !1, r.reference = o.reference, r.relatedQuesion = o.relatedQuesion, N([r, ...m.current]));
|
|
448
448
|
}, s = () => {
|
|
449
449
|
e.addEventListener("message:updated", n);
|
|
450
450
|
};
|
|
@@ -463,11 +463,11 @@ ${e}` : e;
|
|
|
463
463
|
e == null || e.removeEventListener("frozen", t);
|
|
464
464
|
};
|
|
465
465
|
}, [e]), C(() => {
|
|
466
|
-
if (!
|
|
466
|
+
if (!E)
|
|
467
467
|
return;
|
|
468
|
-
const t =
|
|
468
|
+
const t = E.questionContextMaxLength || 4e3;
|
|
469
469
|
tn(t);
|
|
470
|
-
}, [
|
|
470
|
+
}, [E, M]), C(() => {
|
|
471
471
|
Pe && te(Pe.text);
|
|
472
472
|
}, [Pe]), C(() => {
|
|
473
473
|
jt.config({
|
|
@@ -485,15 +485,15 @@ ${e}` : e;
|
|
|
485
485
|
}, ft = (t) => {
|
|
486
486
|
const n = t.size;
|
|
487
487
|
return n <= 0 ? (L("error", "该文件为空,请重新上传"), !1) : n > Ve * ei ? (L("error", `图片须小于${Ve}M`), !1) : (ve((s) => s.length >= Z ? (L("warning", `图片最多上传${Z}张`), s) : [...s, t]), !1);
|
|
488
|
-
},
|
|
488
|
+
}, Nn = () => {
|
|
489
489
|
var t;
|
|
490
490
|
return (i.type === Q.Agent && (c == null ? void 0 : c.imageUpload) || i.type === Q.Dialog && ((t = i.arrange) == null ? void 0 : t.length) && !!i.arrange[0].visionOpen && (c == null ? void 0 : c.imageUpload)) && !O;
|
|
491
|
-
},
|
|
491
|
+
}, En = () => !!V && (c == null ? void 0 : c.fileUpload) && (i == null ? void 0 : i.id) && !O, gt = (t) => {
|
|
492
492
|
var D, b;
|
|
493
493
|
const n = Array.from(t || []).filter(Boolean);
|
|
494
494
|
if (!n.length)
|
|
495
495
|
return;
|
|
496
|
-
const s =
|
|
496
|
+
const s = Nn(), a = En(), o = [], d = [];
|
|
497
497
|
let r = 0, h = 0, v = 0;
|
|
498
498
|
n.forEach((p) => {
|
|
499
499
|
var Ft, Mt, Ht;
|
|
@@ -508,9 +508,9 @@ ${e}` : e;
|
|
|
508
508
|
}
|
|
509
509
|
v++;
|
|
510
510
|
});
|
|
511
|
-
const I = [],
|
|
511
|
+
const I = [], A = r + h + v;
|
|
512
512
|
if (!a && !s)
|
|
513
|
-
|
|
513
|
+
A && I.push(`当前不支持上传文件/图片,已忽略${A}个文件`);
|
|
514
514
|
else if (a && !s) {
|
|
515
515
|
const p = r + v;
|
|
516
516
|
p && I.push(`仅支持上传 .doc/.docx/.pdf 文件,已忽略${p}个其他类型文件`);
|
|
@@ -535,19 +535,19 @@ ${e}` : e;
|
|
|
535
535
|
t.preventDefault(), t.stopPropagation();
|
|
536
536
|
const n = (s = t.dataTransfer) == null ? void 0 : s.files;
|
|
537
537
|
n && n.length && gt(n);
|
|
538
|
-
}, mt = () =>
|
|
538
|
+
}, mt = () => $(void 0, null, function* () {
|
|
539
539
|
var t;
|
|
540
540
|
return (t = e == null ? void 0 : e.data) != null && t.id ? e : (ie.current || (ie.current = new Promise((n, s) => {
|
|
541
541
|
S(!0), x == null || x({
|
|
542
542
|
netOpen: P ? le.OPEN : le.CLOSE
|
|
543
543
|
}).then((a) => {
|
|
544
544
|
var o, d;
|
|
545
|
-
|
|
545
|
+
k == null || k(a), S(!1), T(!!((o = a.data) != null && o.netOpen)), pe(!!((d = a.data) != null && d.enableNetOpen)), Fe(a), n(a);
|
|
546
546
|
}).catch((a) => {
|
|
547
547
|
ie.current = null, s(a);
|
|
548
548
|
});
|
|
549
549
|
})), ie.current);
|
|
550
|
-
}), Ln = (t) =>
|
|
550
|
+
}), Ln = (t) => $(void 0, null, function* () {
|
|
551
551
|
const n = yield mt();
|
|
552
552
|
return Pn(n, t);
|
|
553
553
|
}), Pn = (t, n) => {
|
|
@@ -560,10 +560,10 @@ ${e}` : e;
|
|
|
560
560
|
knowledgeId: ((d = t.data) == null ? void 0 : d.id) || "",
|
|
561
561
|
type: 1
|
|
562
562
|
};
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
var
|
|
566
|
-
const h = (
|
|
563
|
+
M == null || M.postTicket(o).then((r) => {
|
|
564
|
+
M.uploadMinioFile(r.minio, n).then(() => {
|
|
565
|
+
var A, D;
|
|
566
|
+
const h = (A = r.minio.endpoints) == null ? void 0 : A[0], v = r.minio.bucket, I = (D = r.minio.fileKeys) == null ? void 0 : D[0];
|
|
567
567
|
a(`${r.minio.useSSL ? "https:" : location.protocol}//${h}/${v}/${I}`);
|
|
568
568
|
}).catch(() => {
|
|
569
569
|
});
|
|
@@ -572,7 +572,7 @@ ${e}` : e;
|
|
|
572
572
|
});
|
|
573
573
|
};
|
|
574
574
|
C(() => {
|
|
575
|
-
const t =
|
|
575
|
+
const t = F.current;
|
|
576
576
|
t && !it && t.scrollTo({
|
|
577
577
|
top: t.scrollHeight
|
|
578
578
|
});
|
|
@@ -583,7 +583,7 @@ ${e}` : e;
|
|
|
583
583
|
const a = $e(je({}, n.file), {
|
|
584
584
|
type: 1
|
|
585
585
|
});
|
|
586
|
-
|
|
586
|
+
M == null || M.postApplicationIdSessionKnowledgeSessionFile(i == null ? void 0 : i.id, t, a).finally(() => {
|
|
587
587
|
var o;
|
|
588
588
|
(o = fe.current) == null || o.update().finally(s);
|
|
589
589
|
});
|
|
@@ -591,7 +591,7 @@ ${e}` : e;
|
|
|
591
591
|
var t;
|
|
592
592
|
(t = e == null ? void 0 : e.data) != null && t.id && (B(!1), e.suspend());
|
|
593
593
|
}, Dn = (t) => {
|
|
594
|
-
const n =
|
|
594
|
+
const n = F.current;
|
|
595
595
|
n && setTimeout(() => {
|
|
596
596
|
n.scrollTo({
|
|
597
597
|
top: n.scrollHeight,
|
|
@@ -599,22 +599,22 @@ ${e}` : e;
|
|
|
599
599
|
});
|
|
600
600
|
}, t == null ? void 0 : t.ms);
|
|
601
601
|
}, On = () => {
|
|
602
|
-
if (!
|
|
602
|
+
if (!F.current)
|
|
603
603
|
return;
|
|
604
|
-
const t =
|
|
604
|
+
const t = F.current.scrollTop <= -80;
|
|
605
605
|
hn(t);
|
|
606
606
|
}, Rn = ze((t) => {
|
|
607
607
|
var n, s;
|
|
608
|
-
(n =
|
|
608
|
+
(n = ke.current) == null || n.update(t), (s = ke.current) == null || s.focus();
|
|
609
609
|
}), Un = ze((t) => {
|
|
610
610
|
dt(t);
|
|
611
611
|
}), Fn = ze(() => {
|
|
612
612
|
var n;
|
|
613
613
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
614
614
|
return;
|
|
615
|
-
m.current = [...y.slice(1, y.length)],
|
|
615
|
+
m.current = [...y.slice(1, y.length)], N(m.current);
|
|
616
616
|
const t = new he("", e.data.id, ae.System);
|
|
617
|
-
t.isWaiting = !0, m.current = [t, ...m.current],
|
|
617
|
+
t.isWaiting = !0, m.current = [t, ...m.current], N(m.current), W(!0), B(!0), e.answerAgain();
|
|
618
618
|
});
|
|
619
619
|
C(() => {
|
|
620
620
|
var t, n;
|
|
@@ -634,9 +634,9 @@ ${e}` : e;
|
|
|
634
634
|
ue(!1);
|
|
635
635
|
return;
|
|
636
636
|
}
|
|
637
|
-
o.length < 10 ? ue(!1) : ue(!0),
|
|
637
|
+
o.length < 10 ? ue(!1) : ue(!0), N([...y, ...o.reverse()]);
|
|
638
638
|
});
|
|
639
|
-
}, Hn = (t) =>
|
|
639
|
+
}, Hn = (t) => $(void 0, null, function* () {
|
|
640
640
|
var n, s;
|
|
641
641
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
642
642
|
T(t);
|
|
@@ -645,7 +645,7 @@ ${e}` : e;
|
|
|
645
645
|
return;
|
|
646
646
|
T(t);
|
|
647
647
|
}
|
|
648
|
-
}), He = () =>
|
|
648
|
+
}), He = () => $(void 0, null, function* () {
|
|
649
649
|
e ? e.fetchData().then((t) => {
|
|
650
650
|
var n;
|
|
651
651
|
(n = e == null ? void 0 : e.data) != null && n.id && (T(t.netOpen), pe(t.enableNetOpen));
|
|
@@ -656,8 +656,8 @@ ${e}` : e;
|
|
|
656
656
|
}, [e]), C(() => {
|
|
657
657
|
requestAnimationFrame(() => {
|
|
658
658
|
var n, s;
|
|
659
|
-
if (
|
|
660
|
-
const a = document.getElementById("chat-main"), o = (n =
|
|
659
|
+
if (F.current) {
|
|
660
|
+
const a = document.getElementById("chat-main"), o = (n = F.current) == null ? void 0 : n.querySelector(".infinite-scroll-component__outerdiv"), d = (s = F.current) == null ? void 0 : s.querySelector(".infinite-scroll-component");
|
|
661
661
|
if (!o || !d || !a)
|
|
662
662
|
return;
|
|
663
663
|
const r = a.offsetHeight;
|
|
@@ -676,7 +676,7 @@ ${e}` : e;
|
|
|
676
676
|
if (e)
|
|
677
677
|
return;
|
|
678
678
|
const t = () => {
|
|
679
|
-
const a = ((
|
|
679
|
+
const a = ((E == null ? void 0 : E.promptVariables) || []).filter((o) => o.type ? !(o.type === Ee.User && o.key === "query") && !(o.type === Ee.System && o.key === "datetime") && o.status === 1 : o.key !== "query" && o.status === 1).map((o, d) => {
|
|
680
680
|
var h, v;
|
|
681
681
|
let r = "";
|
|
682
682
|
return typeof (l == null ? void 0 : l.promptVariables) == "object" && (r = ((v = (h = l.promptVariables.default) == null ? void 0 : h.find((I) => I.key === o.key && I.type === o.type)) == null ? void 0 : v.value) || ""), {
|
|
@@ -689,16 +689,16 @@ ${e}` : e;
|
|
|
689
689
|
});
|
|
690
690
|
ge([...a].sort((o, d) => o.key.localeCompare(d.key)));
|
|
691
691
|
};
|
|
692
|
-
return
|
|
693
|
-
|
|
692
|
+
return E != null && E.ready ? t() : E == null || E.addEventListener("ready", t), () => {
|
|
693
|
+
E == null || E.removeEventListener("ready", t);
|
|
694
694
|
};
|
|
695
|
-
}, [e,
|
|
695
|
+
}, [e, E, l == null ? void 0 : l.promptVariables]);
|
|
696
696
|
const vt = () => x == null ? void 0 : x({
|
|
697
697
|
netOpen: P ? le.OPEN : le.CLOSE
|
|
698
698
|
}).then((t) => {
|
|
699
699
|
var n, s;
|
|
700
|
-
return
|
|
701
|
-
}),
|
|
700
|
+
return k == null || k(t), S(!1), T(!!((n = t.data) != null && n.netOpen)), pe(!!((s = t.data) != null && s.enableNetOpen)), Fe(t), t;
|
|
701
|
+
}), wt = Kn(() => {
|
|
702
702
|
var t;
|
|
703
703
|
return i.arrange && ((t = i.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ f(Wt, {
|
|
704
704
|
application: i,
|
|
@@ -721,7 +721,7 @@ ${e}` : e;
|
|
|
721
721
|
return Yn(u, () => ({
|
|
722
722
|
getCurrentInputText: () => {
|
|
723
723
|
var t;
|
|
724
|
-
return (t =
|
|
724
|
+
return (t = ke.current) == null ? void 0 : t.getCurrentText();
|
|
725
725
|
}
|
|
726
726
|
})), C(() => {
|
|
727
727
|
var n;
|
|
@@ -729,20 +729,20 @@ ${e}` : e;
|
|
|
729
729
|
t && de((s) => $e(je({}, s), {
|
|
730
730
|
[t]: []
|
|
731
731
|
}));
|
|
732
|
-
}, [(
|
|
732
|
+
}, [(kt = e == null ? void 0 : e.data) == null ? void 0 : kt.id]), /* @__PURE__ */ R("div", {
|
|
733
733
|
className: "agent-chat",
|
|
734
|
-
children: [
|
|
734
|
+
children: [wn ? /* @__PURE__ */ f("div", {
|
|
735
735
|
className: "session-loading",
|
|
736
736
|
children: /* @__PURE__ */ f($t, {})
|
|
737
|
-
}) : /* @__PURE__ */
|
|
737
|
+
}) : /* @__PURE__ */ R(Bn, {
|
|
738
738
|
children: [(c == null ? void 0 : c.promptVariables) && /* @__PURE__ */ f(fi, {
|
|
739
739
|
ref: et,
|
|
740
740
|
appId: i.id,
|
|
741
741
|
currentSession: e,
|
|
742
|
-
promptVariables:
|
|
742
|
+
promptVariables: H,
|
|
743
743
|
setPromptVariables: ge,
|
|
744
|
-
setCurrentSession:
|
|
745
|
-
}), /* @__PURE__ */
|
|
744
|
+
setCurrentSession: k
|
|
745
|
+
}), /* @__PURE__ */ R("div", {
|
|
746
746
|
className: "chat-main",
|
|
747
747
|
id: "chat-main",
|
|
748
748
|
style: Xt,
|
|
@@ -755,9 +755,9 @@ ${e}` : e;
|
|
|
755
755
|
display: "flex",
|
|
756
756
|
flexDirection: "column-reverse"
|
|
757
757
|
},
|
|
758
|
-
ref:
|
|
758
|
+
ref: F,
|
|
759
759
|
onScroll: On,
|
|
760
|
-
children: (bt = e == null ? void 0 : e.data) != null && bt.id && (y != null && y.length) ? /* @__PURE__ */
|
|
760
|
+
children: (bt = e == null ? void 0 : e.data) != null && bt.id && (y != null && y.length) ? /* @__PURE__ */ R(pi, {
|
|
761
761
|
dataLength: y.length,
|
|
762
762
|
next: Mn,
|
|
763
763
|
style: {
|
|
@@ -767,7 +767,7 @@ ${e}` : e;
|
|
|
767
767
|
},
|
|
768
768
|
inverse: !0,
|
|
769
769
|
endMessage: y.length > qt && // 少于一页不展示这个提示
|
|
770
|
-
((xt =
|
|
770
|
+
((xt = F.current) != null && xt.scrollTop) && ((Ct = F.current) == null ? void 0 : Ct.scrollTop) < -10 ? /* @__PURE__ */ f(Qn, {
|
|
771
771
|
plain: !0,
|
|
772
772
|
children: "没有更多数据了"
|
|
773
773
|
}) : null,
|
|
@@ -781,31 +781,31 @@ ${e}` : e;
|
|
|
781
781
|
children: /* @__PURE__ */ f($t, {})
|
|
782
782
|
}),
|
|
783
783
|
scrollableTarget: "scrollableDiv",
|
|
784
|
-
children: [y.map((t, n) => /* @__PURE__ */ f(
|
|
784
|
+
children: [y.map((t, n) => /* @__PURE__ */ f(wi, {
|
|
785
785
|
application: i,
|
|
786
786
|
currentSession: e,
|
|
787
787
|
history: t,
|
|
788
|
-
docViewerUrl:
|
|
788
|
+
docViewerUrl: U,
|
|
789
789
|
isLastHistory: n === 0,
|
|
790
790
|
onRelatedClick: Un,
|
|
791
791
|
onAgainClick: Fn,
|
|
792
792
|
onEditClick: Rn,
|
|
793
793
|
markdown: l == null ? void 0 : l.markdown
|
|
794
|
-
}, t.messageId + n)), !st &&
|
|
795
|
-
}) : /* @__PURE__ */
|
|
794
|
+
}, t.messageId + n)), !st && wt]
|
|
795
|
+
}) : /* @__PURE__ */ R("div", {
|
|
796
796
|
className: "main-empty",
|
|
797
797
|
children: [(l == null ? void 0 : l.greeting) !== !1 && /* @__PURE__ */ f(ri, {
|
|
798
798
|
text: (
|
|
799
799
|
// 第一优先级:features配置
|
|
800
800
|
l != null && l.greeting && typeof l.greeting == "object" && l.greeting.text !== void 0 ? l.greeting.text : (
|
|
801
801
|
// 第二优先级:application.arrange[0].greetings
|
|
802
|
-
(It = i.arrange) != null && It.length && ((
|
|
802
|
+
(It = i.arrange) != null && It.length && ((Nt = i.arrange[0]) != null && Nt.greetings) ? i.arrange[0].greetings : (
|
|
803
803
|
// 第三优先级:默认文本
|
|
804
804
|
_t.text
|
|
805
805
|
)
|
|
806
806
|
)
|
|
807
807
|
),
|
|
808
|
-
icon: l === void 0 || l.greeting === !0 || ((
|
|
808
|
+
icon: l === void 0 || l.greeting === !0 || ((Et = l.greeting) == null ? void 0 : Et.icon) === void 0 ? Gt || _t.icon : l.greeting.icon,
|
|
809
809
|
children: !!Ge.length && (((l == null ? void 0 : l.greeting) === void 0 || (l == null ? void 0 : l.greeting)) === !0 || typeof (l == null ? void 0 : l.greeting) == "object" && l.greeting.questions !== !1) && /* @__PURE__ */ f(si, {
|
|
810
810
|
ref: Oe,
|
|
811
811
|
sid: (Lt = e == null ? void 0 : e.data) == null ? void 0 : Lt.id,
|
|
@@ -831,7 +831,7 @@ ${e}` : e;
|
|
|
831
831
|
}) : n ? ee(!1) : (ee(!1), S(!0), vt());
|
|
832
832
|
}
|
|
833
833
|
})
|
|
834
|
-
}),
|
|
834
|
+
}), wt]
|
|
835
835
|
})
|
|
836
836
|
}), nt && /* @__PURE__ */ f("div", {
|
|
837
837
|
className: "session-stop",
|
|
@@ -869,7 +869,7 @@ ${e}` : e;
|
|
|
869
869
|
})]
|
|
870
870
|
}), /* @__PURE__ */ f("div", {
|
|
871
871
|
className: "chat-footer",
|
|
872
|
-
children: /* @__PURE__ */
|
|
872
|
+
children: /* @__PURE__ */ R("div", {
|
|
873
873
|
className: "chat-footer-input",
|
|
874
874
|
children: [ce.length > 0 && /* @__PURE__ */ f("div", {
|
|
875
875
|
className: "input-files",
|
|
@@ -877,7 +877,7 @@ ${e}` : e;
|
|
|
877
877
|
className: "thumb-40",
|
|
878
878
|
file: t,
|
|
879
879
|
actions: {
|
|
880
|
-
upload: (s) =>
|
|
880
|
+
upload: (s) => $(void 0, null, function* () {
|
|
881
881
|
Se((a) => a + 1);
|
|
882
882
|
try {
|
|
883
883
|
return yield Ln(s);
|
|
@@ -886,36 +886,54 @@ ${e}` : e;
|
|
|
886
886
|
}
|
|
887
887
|
}),
|
|
888
888
|
remove: () => {
|
|
889
|
-
ve((s) => s.filter((a, o) => o !== n)),
|
|
889
|
+
ve((s) => s.filter((a, o) => o !== n)), we((s) => s.filter((a, o) => o !== n));
|
|
890
890
|
}
|
|
891
891
|
},
|
|
892
892
|
onUrlChange: (s) => {
|
|
893
|
-
|
|
893
|
+
we((a) => {
|
|
894
894
|
const o = [...a];
|
|
895
895
|
return o[n] = s, o;
|
|
896
896
|
});
|
|
897
897
|
}
|
|
898
898
|
}, n))
|
|
899
|
-
}), /* @__PURE__ */
|
|
900
|
-
className: "footer-upload-action",
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
899
|
+
}), /* @__PURE__ */ R("div", {
|
|
900
|
+
className: "footer-upload-action-wrapper",
|
|
901
|
+
children: [/* @__PURE__ */ R(Ne, {
|
|
902
|
+
className: "footer-upload-action",
|
|
903
|
+
onClick: (t) => t.preventDefault(),
|
|
904
|
+
children: [/* @__PURE__ */ R(Ne, {
|
|
905
|
+
children: [(i.type === Q.Agent && (c == null ? void 0 : c.imageUpload) || i.type === Q.Dialog && ((Pt = i.arrange) == null ? void 0 : Pt.length) && !!i.arrange[0].visionOpen && (c == null ? void 0 : c.imageUpload)) && /* @__PURE__ */ f(Sn, {
|
|
906
|
+
multiple: !0,
|
|
907
|
+
disabled: ce.length >= Z || O,
|
|
908
|
+
accept: ".jpg, .png, .jpeg,.bmp",
|
|
909
|
+
listType: "picture-card",
|
|
910
|
+
beforeUpload: ft,
|
|
911
|
+
className: "footer-upload-picture",
|
|
912
|
+
showUploadList: !1,
|
|
913
|
+
children: ce.length < Z ? /* @__PURE__ */ f(Xn, {
|
|
914
|
+
placement: "topLeft",
|
|
915
|
+
overlayClassName: "footer-upload-tooltip",
|
|
916
|
+
title: /* @__PURE__ */ f("div", {
|
|
917
|
+
children: `支持上传.jpg .png .jpeg
|
|
916
918
|
.bmp格式的图片数据,单文件最大${Ve}M,最多${Z}张`
|
|
917
|
-
|
|
918
|
-
|
|
919
|
+
}),
|
|
920
|
+
children: /* @__PURE__ */ f(G, {
|
|
921
|
+
type: "text",
|
|
922
|
+
className: "camera-out-btn",
|
|
923
|
+
style: {
|
|
924
|
+
width: "22px",
|
|
925
|
+
position: "relative",
|
|
926
|
+
bottom: "-2px"
|
|
927
|
+
},
|
|
928
|
+
icon: /* @__PURE__ */ f(re, {
|
|
929
|
+
type: "icon-shangchuantupian",
|
|
930
|
+
className: "icon-tianjia",
|
|
931
|
+
style: {
|
|
932
|
+
fontSize: "22px"
|
|
933
|
+
}
|
|
934
|
+
})
|
|
935
|
+
})
|
|
936
|
+
}) : /* @__PURE__ */ f(G, {
|
|
919
937
|
type: "text",
|
|
920
938
|
className: "camera-out-btn",
|
|
921
939
|
style: {
|
|
@@ -923,6 +941,7 @@ ${e}` : e;
|
|
|
923
941
|
position: "relative",
|
|
924
942
|
bottom: "-2px"
|
|
925
943
|
},
|
|
944
|
+
disabled: !0,
|
|
926
945
|
icon: /* @__PURE__ */ f(re, {
|
|
927
946
|
type: "icon-shangchuantupian",
|
|
928
947
|
className: "icon-tianjia",
|
|
@@ -931,129 +950,113 @@ ${e}` : e;
|
|
|
931
950
|
}
|
|
932
951
|
})
|
|
933
952
|
})
|
|
934
|
-
})
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
953
|
+
}), V && (c != null && c.fileUpload) && (i != null && i.id) ? /* @__PURE__ */ f(ci, {
|
|
954
|
+
appId: i == null ? void 0 : i.id,
|
|
955
|
+
ref: fe,
|
|
956
|
+
isFirstSession: ot,
|
|
957
|
+
docViewerUrl: U,
|
|
958
|
+
onStatusChange: (t) => $(void 0, null, function* () {
|
|
959
|
+
t !== "process" ? (be(!0), He()) : be(!1);
|
|
960
|
+
}),
|
|
961
|
+
createSession: () => mt().then((t) => {
|
|
962
|
+
var s;
|
|
963
|
+
return ((s = t.data) == null ? void 0 : s.id) || "";
|
|
964
|
+
}),
|
|
965
|
+
sid: (Tt = e == null ? void 0 : e.data) == null ? void 0 : Tt.id,
|
|
966
|
+
disabled: Re || O,
|
|
967
|
+
afterFileAdd: (t, n) => {
|
|
968
|
+
n && de((s) => {
|
|
969
|
+
const a = s[n] || [];
|
|
970
|
+
return {
|
|
971
|
+
[n]: [...a, t]
|
|
972
|
+
};
|
|
973
|
+
});
|
|
941
974
|
},
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
}), V && (c != null && c.fileUpload) && (i != null && i.id) ? /* @__PURE__ */ f(ci, {
|
|
952
|
-
appId: i == null ? void 0 : i.id,
|
|
953
|
-
ref: fe,
|
|
954
|
-
isFirstSession: ot,
|
|
955
|
-
docViewerUrl: R,
|
|
956
|
-
onStatusChange: (t) => j(void 0, null, function* () {
|
|
957
|
-
t !== "process" ? (be(!0), He()) : be(!1);
|
|
958
|
-
}),
|
|
959
|
-
createSession: () => mt().then((t) => {
|
|
960
|
-
var s;
|
|
961
|
-
return ((s = t.data) == null ? void 0 : s.id) || "";
|
|
962
|
-
}),
|
|
963
|
-
sid: (Tt = e == null ? void 0 : e.data) == null ? void 0 : Tt.id,
|
|
964
|
-
disabled: Re || O,
|
|
965
|
-
afterFileAdd: (t, n) => {
|
|
966
|
-
n && de((s) => {
|
|
967
|
-
const a = s[n] || [];
|
|
968
|
-
return {
|
|
969
|
-
[n]: [...a, t]
|
|
970
|
-
};
|
|
971
|
-
});
|
|
972
|
-
},
|
|
973
|
-
afterFileDelete: (t) => {
|
|
974
|
-
var s;
|
|
975
|
-
const n = (s = e == null ? void 0 : e.data) == null ? void 0 : s.id;
|
|
976
|
-
n && de((a) => {
|
|
977
|
-
const o = a[n] || [];
|
|
978
|
-
return {
|
|
979
|
-
[n]: o.filter((d) => d.id !== t)
|
|
980
|
-
};
|
|
981
|
-
});
|
|
982
|
-
},
|
|
983
|
-
onFileListChange: (t) => {
|
|
984
|
-
fn(t);
|
|
985
|
-
},
|
|
986
|
-
shouldContinue: un,
|
|
987
|
-
afterFilesClear: () => {
|
|
988
|
-
var n;
|
|
989
|
-
const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
|
|
990
|
-
t && (de({
|
|
991
|
-
[t]: []
|
|
992
|
-
}), He());
|
|
993
|
-
}
|
|
994
|
-
}) : null, (c == null ? void 0 : c.prompt) && (i == null ? void 0 : i.id) && /* @__PURE__ */ f(mi, {
|
|
995
|
-
appId: i.id,
|
|
996
|
-
list: [],
|
|
997
|
-
search: Je ? rn : "",
|
|
998
|
-
onPromptSelect: (t) => {
|
|
999
|
-
te(t.context), me(t.context);
|
|
1000
|
-
},
|
|
1001
|
-
disabled: O
|
|
1002
|
-
})]
|
|
1003
|
-
}), /* @__PURE__ */ $(Ee, {
|
|
1004
|
-
children: [(c == null ? void 0 : c.connectNetwork) && i.type === Q.Dialog && ((Dt = i.arrange) == null ? void 0 : Dt.length) && !!i.arrange[0].enableNetOpen && /* @__PURE__ */ f(hi, {
|
|
1005
|
-
sessionId: (Ot = e == null ? void 0 : e.data) == null ? void 0 : Ot.id,
|
|
1006
|
-
netStatus: P,
|
|
1007
|
-
enable: typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.diabled) == "boolean" ? !(l != null && l.connectNetwork.diabled) : vn,
|
|
1008
|
-
disabledTip: e ? void 0 : "网络访问已被禁用",
|
|
1009
|
-
onNetStatusChange: (t) => {
|
|
1010
|
-
Hn(t);
|
|
1011
|
-
}
|
|
1012
|
-
}), (c == null ? void 0 : c.sessionList) && /* @__PURE__ */ f(gi, {
|
|
1013
|
-
currentSessionId: (Rt = e == null ? void 0 : e.data) == null ? void 0 : Rt.id,
|
|
1014
|
-
onSessionChange: (t, n) => {
|
|
1015
|
-
te(void 0), Ie(!0), w == null || w(n);
|
|
1016
|
-
},
|
|
1017
|
-
disabled: O
|
|
1018
|
-
}), Zt && Jt === "float" && /* @__PURE__ */ f("div", {
|
|
1019
|
-
className: "session-history-drawer-component",
|
|
1020
|
-
children: /* @__PURE__ */ f(Gn, {
|
|
1021
|
-
placement: "topRight",
|
|
1022
|
-
showArrow: !1,
|
|
1023
|
-
overlayClassName: "session-history-overlay",
|
|
1024
|
-
overlayStyle: {
|
|
1025
|
-
padding: "4px"
|
|
975
|
+
afterFileDelete: (t) => {
|
|
976
|
+
var s;
|
|
977
|
+
const n = (s = e == null ? void 0 : e.data) == null ? void 0 : s.id;
|
|
978
|
+
n && de((a) => {
|
|
979
|
+
const o = a[n] || [];
|
|
980
|
+
return {
|
|
981
|
+
[n]: o.filter((d) => d.id !== t)
|
|
982
|
+
};
|
|
983
|
+
});
|
|
1026
984
|
},
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
985
|
+
onFileListChange: (t) => {
|
|
986
|
+
fn(t);
|
|
987
|
+
},
|
|
988
|
+
shouldContinue: un,
|
|
989
|
+
afterFilesClear: () => {
|
|
990
|
+
var n;
|
|
991
|
+
const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
|
|
992
|
+
t && (de({
|
|
993
|
+
[t]: []
|
|
994
|
+
}), He());
|
|
995
|
+
}
|
|
996
|
+
}) : null, (c == null ? void 0 : c.prompt) && (i == null ? void 0 : i.id) && /* @__PURE__ */ f(mi, {
|
|
997
|
+
appId: i.id,
|
|
998
|
+
list: [],
|
|
999
|
+
search: Je ? rn : "",
|
|
1000
|
+
onPromptSelect: (t) => {
|
|
1001
|
+
te(t.context), me(t.context);
|
|
1002
|
+
},
|
|
1003
|
+
disabled: O
|
|
1004
|
+
})]
|
|
1005
|
+
}), /* @__PURE__ */ R(Ne, {
|
|
1006
|
+
children: [(c == null ? void 0 : c.connectNetwork) && i.type === Q.Dialog && ((Dt = i.arrange) == null ? void 0 : Dt.length) && !!i.arrange[0].enableNetOpen && /* @__PURE__ */ f(hi, {
|
|
1007
|
+
sessionId: (Ot = e == null ? void 0 : e.data) == null ? void 0 : Ot.id,
|
|
1008
|
+
netStatus: P,
|
|
1009
|
+
enable: typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.diabled) == "boolean" ? !(l != null && l.connectNetwork.diabled) : vn,
|
|
1010
|
+
disabledTip: e ? void 0 : "网络访问已被禁用",
|
|
1011
|
+
onNetStatusChange: (t) => {
|
|
1012
|
+
Hn(t);
|
|
1013
|
+
}
|
|
1014
|
+
}), (c == null ? void 0 : c.sessionList) && /* @__PURE__ */ f(gi, {
|
|
1015
|
+
currentSessionId: (Rt = e == null ? void 0 : e.data) == null ? void 0 : Rt.id,
|
|
1016
|
+
onSessionChange: (t, n) => {
|
|
1017
|
+
te(void 0), Ie(!0), k == null || k(n);
|
|
1018
|
+
},
|
|
1019
|
+
disabled: O
|
|
1020
|
+
}), Zt && Jt === "float" && /* @__PURE__ */ f("div", {
|
|
1021
|
+
className: "session-history-drawer-component",
|
|
1022
|
+
children: /* @__PURE__ */ f(Gn, {
|
|
1023
|
+
placement: "topRight",
|
|
1024
|
+
showArrow: !1,
|
|
1025
|
+
overlayClassName: "session-history-overlay",
|
|
1026
|
+
overlayStyle: {
|
|
1027
|
+
padding: "4px"
|
|
1028
|
+
},
|
|
1029
|
+
getPopupContainer: (t) => t.parentNode,
|
|
1030
|
+
content: "会话历史记录",
|
|
1031
|
+
children: /* @__PURE__ */ f(G, {
|
|
1032
|
+
className: "history-overlay-action",
|
|
1033
|
+
disabled: O,
|
|
1034
|
+
type: "text",
|
|
1035
|
+
icon: /* @__PURE__ */ f(re, {
|
|
1036
|
+
type: "icon-lishijilu",
|
|
1037
|
+
style: {
|
|
1038
|
+
fontSize: 24
|
|
1039
|
+
}
|
|
1040
|
+
}),
|
|
1041
|
+
onClick: () => lt(!0)
|
|
1042
|
+
})
|
|
1040
1043
|
})
|
|
1041
|
-
})
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1044
|
+
}), (c == null ? void 0 : c.sessionOpen) && /* @__PURE__ */ f(G, {
|
|
1045
|
+
icon: /* @__PURE__ */ f(li, {}),
|
|
1046
|
+
className: "add-btn",
|
|
1047
|
+
type: "primary",
|
|
1048
|
+
disabled: nt || !e || !y.length || O,
|
|
1049
|
+
onClick: () => {
|
|
1050
|
+
var t, n;
|
|
1051
|
+
Ie(!1), k == null || k(null), ie.current = null, T(!1), (t = et.current) == null || t.clear(), (n = Oe.current) == null || n.clear();
|
|
1052
|
+
},
|
|
1053
|
+
children: "新会话"
|
|
1054
|
+
})]
|
|
1052
1055
|
})]
|
|
1053
1056
|
}), !!Ue && /* @__PURE__ */ f("div", {
|
|
1054
1057
|
className: "remainingSeconds-mark"
|
|
1055
1058
|
})]
|
|
1056
|
-
}), /* @__PURE__ */
|
|
1059
|
+
}), /* @__PURE__ */ R("div", {
|
|
1057
1060
|
className: "footer-textarea",
|
|
1058
1061
|
onPaste: ut,
|
|
1059
1062
|
onPasteCapture: ut,
|
|
@@ -1062,7 +1065,7 @@ ${e}` : e;
|
|
|
1062
1065
|
onDragOver: pt,
|
|
1063
1066
|
onDragOverCapture: pt,
|
|
1064
1067
|
children: [/* @__PURE__ */ f(oi, {
|
|
1065
|
-
ref:
|
|
1068
|
+
ref: ke,
|
|
1066
1069
|
maxLength: en,
|
|
1067
1070
|
text: ln,
|
|
1068
1071
|
networkStatus: !1,
|
|
@@ -1074,7 +1077,7 @@ ${e}` : e;
|
|
|
1074
1077
|
const s = n.getText().replace(/[\n\s]+$/, "");
|
|
1075
1078
|
me(s), an(s), Je || sn(!0);
|
|
1076
1079
|
},
|
|
1077
|
-
clearAction: /* @__PURE__ */ f(
|
|
1080
|
+
clearAction: /* @__PURE__ */ f(Ne, {
|
|
1078
1081
|
size: 0,
|
|
1079
1082
|
children: /* @__PURE__ */ f(G, {
|
|
1080
1083
|
type: "link",
|
|
@@ -1089,7 +1092,7 @@ ${e}` : e;
|
|
|
1089
1092
|
onClick: () => Cn()
|
|
1090
1093
|
})
|
|
1091
1094
|
})
|
|
1092
|
-
}), !!Ue && /* @__PURE__ */
|
|
1095
|
+
}), !!Ue && /* @__PURE__ */ R("div", {
|
|
1093
1096
|
className: "remainingSeconds-time",
|
|
1094
1097
|
children: ["您之前对话触发敏感词拦截,当前处于禁言状态,暂时无法发送消息,剩余禁言时长", Ue]
|
|
1095
1098
|
})]
|
|
@@ -1109,7 +1112,7 @@ ${e}` : e;
|
|
|
1109
1112
|
currentSession: e,
|
|
1110
1113
|
application: i,
|
|
1111
1114
|
networkStatus: P,
|
|
1112
|
-
setCurrentSession:
|
|
1115
|
+
setCurrentSession: k,
|
|
1113
1116
|
disabled: O,
|
|
1114
1117
|
isSessionHistoryVisible: at,
|
|
1115
1118
|
setIsSessionHistoryVisible: lt,
|