@glodon-aiot/agent-cli-ui 3.4.1 → 3.5.0-alpha.2

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.
@@ -1,67 +1,67 @@
1
- var rn = Object.defineProperty, an = Object.defineProperties;
2
- var ln = Object.getOwnPropertyDescriptors;
3
- var ct = Object.getOwnPropertySymbols;
4
- var dn = Object.prototype.hasOwnProperty, cn = Object.prototype.propertyIsEnumerable;
5
- var Ee = (x, k, o) => k in x ? rn(x, k, { enumerable: !0, configurable: !0, writable: !0, value: o }) : x[k] = o, ft = (x, k) => {
6
- for (var o in k || (k = {}))
7
- dn.call(k, o) && Ee(x, o, k[o]);
8
- if (ct)
9
- for (var o of ct(k))
10
- cn.call(k, o) && Ee(x, o, k[o]);
11
- return x;
12
- }, gt = (x, k) => an(x, ln(k));
13
- var D = (x, k, o) => (Ee(x, typeof k != "symbol" ? k + "" : k, o), o);
14
- var j = (x, k, o) => new Promise((Y, e) => {
1
+ var an = Object.defineProperty, ln = Object.defineProperties;
2
+ var dn = Object.getOwnPropertyDescriptors;
3
+ var ut = Object.getOwnPropertySymbols;
4
+ var cn = Object.prototype.hasOwnProperty, fn = Object.prototype.propertyIsEnumerable;
5
+ var Ee = (b, v, o) => v in b ? an(b, v, { enumerable: !0, configurable: !0, writable: !0, value: o }) : b[v] = o, Pe = (b, v) => {
6
+ for (var o in v || (v = {}))
7
+ cn.call(v, o) && Ee(b, o, v[o]);
8
+ if (ut)
9
+ for (var o of ut(v))
10
+ fn.call(v, o) && Ee(b, o, v[o]);
11
+ return b;
12
+ }, Te = (b, v) => ln(b, dn(v));
13
+ var D = (b, v, o) => (Ee(b, typeof v != "symbol" ? v + "" : v, o), o);
14
+ var j = (b, v, o) => new Promise((Y, e) => {
15
15
  var L = (E) => {
16
16
  try {
17
- p(o.next(E));
17
+ y(o.next(E));
18
18
  } catch (P) {
19
19
  e(P);
20
20
  }
21
21
  }, pe = (E) => {
22
22
  try {
23
- p(o.throw(E));
23
+ y(o.throw(E));
24
24
  } catch (P) {
25
25
  e(P);
26
26
  }
27
- }, p = (E) => E.done ? Y(E.value) : Promise.resolve(E.value).then(L, pe);
28
- p((o = o.apply(x, k)).next());
27
+ }, y = (E) => E.done ? Y(E.value) : Promise.resolve(E.value).then(L, pe);
28
+ y((o = o.apply(b, v)).next());
29
29
  });
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 ut, Divider as pn, Button as W, Space as he, Upload as vn, Tooltip as kn, Popover as wn, notification as me, message as u } from "antd";
33
- import ne from "../../components/Iconfont/index.mjs";
34
- import { IHistoryRole as J, ChatMessageRole as ht, PromptVariableType as ye } from "@glodon-aiot/apis";
35
- import pt from "./HistoryItem/index.mjs";
36
- import vt from "dayjs";
37
- import { v4 as Te } from "uuid";
38
- import bn from "../../context.mjs";
39
- import { configuration as xn } from "@glodon-aiot/bot-client-sdk";
40
- import { NET_OPEN_STATUS as $, 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
- import { useMemoizedFn as Pe } from "ahooks";
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 { useSessionState as An } from "../../hooks/useSessionState.mjs";
58
- import qn from "../../assets/icon.svg.mjs";
59
- const Bn = gn(pt), mt = {
60
- icon: qn,
30
+ import { jsx as c, jsxs as z, Fragment as gn } from "react/jsx-runtime";
31
+ import { memo as un, forwardRef as hn, useState as h, useRef as K, useContext as mn, useEffect as C, useMemo as yn, useImperativeHandle as pn } from "react";
32
+ /* empty css */import { Spin as ht, Divider as vn, Button as W, Space as he, Upload as kn, Tooltip as wn, Popover as bn, notification as me, message as u } from "antd";
33
+ import ie from "../../components/Iconfont/index.mjs";
34
+ import { IHistoryRole as J, ChatMessageRole as mt, PromptVariableType as ye } from "@glodon-aiot/apis";
35
+ import vt from "./HistoryItem/index.mjs";
36
+ import kt from "dayjs";
37
+ import { v4 as Fe } from "uuid";
38
+ import xn from "../../context.mjs";
39
+ import { configuration as In } from "@glodon-aiot/bot-client-sdk";
40
+ import { NET_OPEN_STATUS as $, MB as Nn } from "../../constant.mjs";
41
+ import Cn from "../../components/FilePreview/index.mjs";
42
+ import { getImageExtension as Ln } from "../../utils/index.mjs";
43
+ import En from "../../QuillEditor/index.mjs";
44
+ import Pn from "../../components/Recommend/index.mjs";
45
+ import Tn from "../../components/Greeting/index.mjs";
46
+ import On from "../../Footer/index.mjs";
47
+ import { CameraOutlined as Fn, PlusOutlined as Hn } from "@ant-design/icons";
48
+ import Rn from "./Tools/UploadKnowledgeFiles/index.mjs";
49
+ import Dn from "../UploadingPrompt/index.mjs";
50
+ import Un from "./PromptSetting/index.mjs";
51
+ import { useMemoizedFn as Oe } from "ahooks";
52
+ import Mn from "./Tools/SessionListDrawer/index.mjs";
53
+ import jn from "./Tools/SessionHistoryDrawer/index.mjs";
54
+ import zn from "react-infinite-scroll-component";
55
+ import Vn from "./Tools/ConnectToNetwork/index.mjs";
56
+ import An from "./Tools/PromptManager/index.mjs";
57
+ import { useSessionState as qn } from "../../hooks/useSessionState.mjs";
58
+ import Bn from "../../assets/icon.svg.mjs";
59
+ const $n = un(vt), yt = {
60
+ icon: Bn,
61
61
  text: "今天我能帮你什么?"
62
62
  };
63
- class ie {
64
- constructor(k, o, Y, e) {
63
+ class oe {
64
+ constructor(v, o, Y, e) {
65
65
  D(this, "messageTime");
66
66
  D(this, "isWaiting");
67
67
  D(this, "messageId");
@@ -71,51 +71,51 @@ class ie {
71
71
  D(this, "isSensitive");
72
72
  D(this, "isSuspend");
73
73
  D(this, "comment");
74
- this.content = k, this.sessionId = o, this.role = Y, this.files = e, this.content = k, this.role = Y, this.sessionId = o, this.files = e, this.messageTime = vt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = Te(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
74
+ this.content = v, this.sessionId = o, this.role = Y, this.files = e, this.content = v, this.role = Y, this.sessionId = o, this.files = e, this.messageTime = kt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = Fe(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
75
75
  isAgree: 0
76
76
  };
77
77
  }
78
78
  }
79
- const yt = 10, wi = un((x, k) => {
80
- var Se, et, tt, nt, it, ot, st, rt, at, lt, dt;
79
+ const pt = 10, bi = hn((b, v) => {
80
+ var tt, nt, it, ot, st, rt, at, lt, dt, ct, ft, gt;
81
81
  const {
82
82
  application: o,
83
83
  docViewerUrl: Y = "",
84
84
  currentSession: e,
85
85
  onCreateSession: L,
86
86
  embeddingService: pe,
87
- setCurrentSession: p,
87
+ setCurrentSession: y,
88
88
  networkStatus: E,
89
89
  setNetworkStatus: P
90
- } = x, [v, I] = h([]), [kt, oe] = h(), [ve, Fe] = h(), H = K(null), {
91
- service: T,
92
- agentClient: N,
93
- depId: wt,
94
- footer: bt,
90
+ } = b, [p, x] = h([]), [wt, se] = h(), [ve, He] = h(), F = K(null), {
91
+ service: H,
92
+ agentClient: I,
93
+ depId: bt,
94
+ footer: xt,
95
95
  transform: g,
96
96
  defaultInput: ke,
97
- onMessage: se,
98
- onHistoryLoad: Oe,
97
+ onMessage: re,
98
+ onHistoryLoad: Re,
99
99
  beforeMessageSend: V,
100
- bodyStyle: xt,
100
+ bodyStyle: It,
101
101
  disabled: R,
102
102
  features: s,
103
103
  popupContainer: f,
104
- icon: It,
105
- sider: Nt,
106
- mode: Ct
107
- } = hn(bn), [He, we] = h(!1), m = K(v), Re = K(void 0), [Lt, Et] = h(0), [S, Q] = h(), [_, re] = h(""), [De, be] = h(!1), ae = K(null), [Ue, Pt] = h([]), [Me, G] = h(!1), [je, Tt] = h(!1), [Ft, Ot] = h(""), [Ht, X] = h(), [le, de] = h({}), ce = K(null), ze = K(null), xe = K(null), [Ve, Rt] = h(!1), [Dt, Ut] = h([]), [Mt, fe] = h(!0), [jt, zt] = h(!0), [Ae, U] = h(!1), [Ie, A] = h(!1), [qe, Vt] = h(!1), [O, ge] = h(typeof (s == null ? void 0 : s.promptVariables) == "object" ? s.promptVariables.default || [] : []), [At, qt] = h(typeof (s == null ? void 0 : s.knowledges) == "object" && s.knowledges.default || void 0), [Be, M] = h(!1), [$e, ee] = h(!1), [Bt, Z] = h(typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.default) == "boolean" ? s.connectNetwork.default : !1), [Ye, ue] = h(!1), [$t, q] = h(!1), [Yt, Kt] = h(null), [Ke, We] = h(!1), {
108
- isSwitchingToExistingSession: Wt,
104
+ icon: Nt,
105
+ sider: Ct,
106
+ mode: Lt
107
+ } = mn(xn), [De, we] = h(!1), m = K(p), Ue = K(void 0), [Et, Pt] = h(0), [S, Q] = h(), [_, ae] = h(""), [Me, be] = h(!1), le = K(null), [je, Tt] = h([]), [ze, G] = h(!1), [Ve, Ot] = h(!1), [Ft, Ht] = h(""), [Rt, X] = h(), [de, ee] = h({}), ce = K(null), Ae = K(null), xe = K(null), [qe, Dt] = h(!1), [Ut, Mt] = h([]), [jt, fe] = h(!0), [zt, Vt] = h(!0), [Be, U] = h(!1), [Ie, A] = h(!1), [$e, 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), [Ye, M] = h(!1), [Ke, te] = 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), [We, ue] = h(!1), [Yt, q] = h(!1), [Kt, Wt] = h(null), [Qe, _e] = h(!1), {
108
+ isSwitchingToExistingSession: Qt,
109
109
  setIsSwitchingToExistingSession: Ne
110
- } = An();
110
+ } = qn();
111
111
  C(() => {
112
- if (Kt(e), e === null)
112
+ if (Wt(e), e === null)
113
113
  q(!1);
114
114
  else if (e === void 0)
115
115
  q(!0);
116
116
  else {
117
- if (Yt === null) {
118
- if (Wt) {
117
+ if (Kt === null) {
118
+ if (Qt) {
119
119
  q(!0), Ne(!1);
120
120
  return;
121
121
  }
@@ -126,31 +126,31 @@ const yt = 10, wi = un((x, k) => {
126
126
  }
127
127
  }, [e, e == null ? void 0 : e.ready]), C(() => {
128
128
  var a, i;
129
- e && (m.current = []), I([]);
130
- const t = H.current;
129
+ e && (m.current = []), x([]);
130
+ const t = F.current;
131
131
  if (t && t.scrollTo({
132
132
  top: 0
133
133
  }), !((a = e == null ? void 0 : e.data) != null && a.id))
134
134
  return;
135
135
  if (A(!1), U(!1), (i = e.messages) != null && i.length) {
136
136
  const r = [...e.messages.filter((d) => d == null ? void 0 : d.messageId)].reverse();
137
- m.current = [...r], I([...r]), q(!1);
137
+ m.current = [...r], x([...r]), q(!1);
138
138
  }
139
139
  const n = (l) => {
140
140
  var r;
141
- (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), q(!1), Oe && Oe({
141
+ (r = e == null ? void 0 : e.data) != null && r.id && (m.current = [...l].reverse(), x([...l].reverse()), !l || l.length < 10 ? te(!1) : te(!0), q(!1), Re && Re({
142
142
  applicationId: o.id,
143
143
  sessionId: e.data.id,
144
144
  histories: l
145
145
  }));
146
146
  };
147
147
  return e.addEventListener("history:loaded", n), () => {
148
- m.current = [], I([]), e == null || e.removeEventListener("history:loaded", n);
148
+ m.current = [], x([]), e == null || e.removeEventListener("history:loaded", n);
149
149
  };
150
150
  }, [e]), C(() => {
151
151
  const t = () => {
152
152
  var n;
153
- (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 && qt(e.knowledges), P(e.netOpen));
153
+ (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));
154
154
  };
155
155
  return e == null || e.addEventListener("data:updated", t), () => {
156
156
  e == null || e.removeEventListener("data:updated", t);
@@ -173,11 +173,11 @@ const yt = 10, wi = un((x, k) => {
173
173
  e == null || e.removeEventListener("error", t);
174
174
  };
175
175
  }, [e]);
176
- const Qt = () => {
176
+ const _t = () => {
177
177
  var a;
178
178
  if (!((a = e == null ? void 0 : e.data) != null && a.id) || !(o != null && o.id))
179
179
  return;
180
- const t = e.data.id, n = v[v.length - 1];
180
+ const t = e.data.id, n = p[p.length - 1];
181
181
  if (n && n.isContext) {
182
182
  u.config({
183
183
  getContainer: () => (f == null ? void 0 : f.current) || document.body
@@ -187,17 +187,17 @@ const yt = 10, wi = un((x, k) => {
187
187
  return;
188
188
  } else
189
189
  e.clear().then(() => {
190
- const i = new ie("", t, J.System);
191
- i.isContext = !0, I([i, ...v]);
190
+ const i = new oe("", t, J.System);
191
+ i.isContext = !0, x([i, ...p]);
192
192
  });
193
193
  };
194
194
  C(() => {
195
- o != null && o.id && (T == null || T.getRecommendQues(o.id).then((t) => {
196
- Pt(t);
195
+ o != null && o.id && (H == null || H.getRecommendQues(o.id).then((t) => {
196
+ Tt(t);
197
197
  }));
198
- }, [wt, o]);
199
- const Qe = (t) => j(void 0, null, function* () {
200
- var y, F;
198
+ }, [bt, o]);
199
+ const Ge = (t) => j(void 0, null, function* () {
200
+ var N, T;
201
201
  if (R) {
202
202
  u.config({
203
203
  getContainer: () => (f == null ? void 0 : f.current) || document.body
@@ -206,7 +206,7 @@ const yt = 10, wi = un((x, k) => {
206
206
  });
207
207
  return;
208
208
  }
209
- const n = t || kt;
209
+ const n = t || wt;
210
210
  if (!(n != null && n.trim())) {
211
211
  u.config({
212
212
  getContainer: () => (f == null ? void 0 : f.current) || document.body
@@ -215,7 +215,7 @@ const yt = 10, wi = un((x, k) => {
215
215
  });
216
216
  return;
217
217
  }
218
- if (!(O == null ? void 0 : O.every((w) => !!(w != null && w.value))))
218
+ if (!(O == null ? void 0 : O.every((k) => !!(k != null && k.value))))
219
219
  if (g != null && g.promptVariables) {
220
220
  u.config({
221
221
  getContainer: () => (f == null ? void 0 : f.current) || document.body
@@ -224,7 +224,7 @@ const yt = 10, wi = un((x, k) => {
224
224
  });
225
225
  return;
226
226
  } else
227
- console.error("变量值不能为空", O == null ? void 0 : O.map((w) => !!(w != null && w.value)));
227
+ console.error("变量值不能为空", O == null ? void 0 : O.map((k) => !!(k != null && k.value)));
228
228
  if (Ie) {
229
229
  u.config({
230
230
  getContainer: () => (f == null ? void 0 : f.current) || document.body
@@ -233,7 +233,7 @@ const yt = 10, wi = un((x, k) => {
233
233
  });
234
234
  return;
235
235
  }
236
- if (He) {
236
+ if (De) {
237
237
  u.config({
238
238
  getContainer: () => (f == null ? void 0 : f.current) || document.body
239
239
  }), u.error("等待初始化"), u.config({
@@ -241,7 +241,7 @@ const yt = 10, wi = un((x, k) => {
241
241
  });
242
242
  return;
243
243
  }
244
- if (!Mt) {
244
+ if (!jt) {
245
245
  u.config({
246
246
  getContainer: () => (f == null ? void 0 : f.current) || document.body
247
247
  }), u.error("正在解析文件"), u.config({
@@ -249,7 +249,7 @@ const yt = 10, wi = un((x, k) => {
249
249
  });
250
250
  return;
251
251
  }
252
- if (De) {
252
+ if (Me) {
253
253
  u.config({
254
254
  getContainer: () => (f == null ? void 0 : f.current) || document.body
255
255
  }), u.error("正在上传图片"), u.config({
@@ -257,15 +257,15 @@ const yt = 10, wi = un((x, k) => {
257
257
  });
258
258
  return;
259
259
  }
260
- Q(void 0), re("");
261
- const i = (y = e == null ? void 0 : e.data) == null ? void 0 : y.id;
260
+ Q(void 0), ae("");
261
+ const i = (N = e == null ? void 0 : e.data) == null ? void 0 : N.id;
262
262
  if (!i) {
263
263
  L == null || L({
264
264
  netOpen: E ? $.OPEN : $.CLOSE
265
- }).then((w) => {
266
- var B, te;
267
- M(!0), P(!!((B = w.data) != null && B.netOpen)), Z(!!((te = w.data) != null && te.enableNetOpen)), _e(w).then(() => {
268
- p == null || p(w), M(!1), Fe(n);
265
+ }).then((k) => {
266
+ var B, ne;
267
+ M(!0), P(!!((B = k.data) != null && B.netOpen)), Z(!!((ne = k.data) != null && ne.enableNetOpen)), Xe(k).then(() => {
268
+ y == null || y(k), M(!1), He(n);
269
269
  });
270
270
  });
271
271
  return;
@@ -281,47 +281,39 @@ ${n}` : n;
281
281
  message: {
282
282
  content: l,
283
283
  sessionId: i,
284
- role: ht.User,
285
- files: le[i]
284
+ role: mt.User,
285
+ files: de[i]
286
286
  }
287
287
  }) : r = !0;
288
- } catch (w) {
288
+ } catch (k) {
289
289
  r = !1;
290
290
  }
291
291
  if (ue(!1), r === !1)
292
292
  return;
293
293
  let d = n;
294
- typeof r == "object" && (d = r.content || n), (yield e.setPromptVariables(O)) && (((F = le[i]) == null ? void 0 : F.length) > 0 ? _t(d) : Ce(d));
295
- }), _e = (t) => new Promise((n, a) => j(void 0, null, function* () {
294
+ typeof r == "object" && (d = r.content || n), (yield e.setPromptVariables(O)) && (((T = de[i]) == null ? void 0 : T.length) > 0 ? Gt(d) : Ce(d));
295
+ }), Xe = (t) => new Promise((n, a) => j(void 0, null, function* () {
296
296
  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) => {
297
- var y;
298
- const b = (y = O.find((F) => F.key === d.key && F.type === d.type)) == null ? void 0 : y.value;
299
- return d.value = b || "", d;
297
+ var N;
298
+ const w = (N = O.find((T) => T.key === d.key && T.type === d.type)) == null ? void 0 : N.value;
299
+ return d.value = w || "", d;
300
300
  });
301
- ge(r.sort((d, b) => d.key.localeCompare(b.key))), yield t == null ? void 0 : t.setPromptVariables(r).catch((d) => {
301
+ ge(r.sort((d, w) => d.key.localeCompare(w.key))), yield t == null ? void 0 : t.setPromptVariables(r).catch((d) => {
302
302
  console.error(d), u.config({
303
303
  getContainer: () => (f == null ? void 0 : f.current) || document.body
304
304
  }), u.error(d.message), u.config({
305
305
  getContainer: void 0
306
306
  });
307
307
  }), n();
308
- })), _t = (t) => {
309
- var r, d, b;
310
- if (fe(!1), !((r = e == null ? void 0 : e.data) != null && r.id) || !(o != null && o.id))
308
+ })), Gt = (t) => {
309
+ var l, r, d;
310
+ if (fe(!1), !((l = e == null ? void 0 : e.data) != null && l.id) || !(o != null && o.id))
311
311
  return;
312
- const n = ((d = e.data) == null ? void 0 : d.id) || "", a = [];
313
- let i = [], l = /* @__PURE__ */ new Set();
314
- (b = le[n]) == null || b.forEach((y) => {
315
- l.has(y.id) || (i.push(y), l.add(y.id));
316
- }), Promise.all(i.map((y) => T == null ? void 0 : T.patchApplicationIdKnowledgeIdFileId(o == null ? void 0 : o.id, n, y.id, {
317
- enabled: 1
318
- }).then((F) => {
319
- a.push(y);
320
- }))).then((y) => {
321
- fe(!0), Ce(t, a);
322
- }).catch((y) => {
323
- throw Error(y);
324
- });
312
+ const n = ((r = e.data) == null ? void 0 : r.id) || "";
313
+ let a = [], i = /* @__PURE__ */ new Set();
314
+ (d = de[n]) == null || d.forEach((w) => {
315
+ i.has(w.id) || (a.push(w), i.add(w.id));
316
+ }), fe(!0), Ce(t, a);
325
317
  };
326
318
  C(() => {
327
319
  if (!ve || !e)
@@ -338,53 +330,53 @@ ${t}` : t;
338
330
  message: {
339
331
  content: a,
340
332
  sessionId: e.id,
341
- role: ht.User,
342
- files: le[e.id]
333
+ role: mt.User,
334
+ files: de[e.id]
343
335
  }
344
336
  }) : i = !0;
345
337
  } catch (l) {
346
338
  i = !1;
347
339
  }
348
- ue(!1), i !== !1 && (Ce(t), Fe(void 0));
340
+ ue(!1), i !== !1 && (Ce(t), He(void 0));
349
341
  });
350
342
  return e.ready ? n() : e.addEventListener("ready", n, !0), () => {
351
343
  e == null || e.removeEventListener("ready", n);
352
344
  };
353
345
  }, [ve, e]);
354
346
  const Ce = (t, n) => j(void 0, null, function* () {
355
- var y, F;
356
- const a = (y = e == null ? void 0 : e.data) == null ? void 0 : y.id;
347
+ var N, T;
348
+ const a = (N = e == null ? void 0 : e.data) == null ? void 0 : N.id;
357
349
  if (!a)
358
350
  return;
359
351
  A(!0), U(!0);
360
352
  const i = _ ? `![](${_})
361
- ${t}` : t, l = new ie(i, a, J.User, n);
362
- oe(void 0), X(void 0), m.current = [l, ...v], I(m.current), o.id && se && se({
353
+ ${t}` : t, l = new oe(i, a, J.User, n);
354
+ se(void 0), X(void 0), m.current = [l, ...p], x(m.current), o.id && re && re({
363
355
  applicationId: o.id,
364
356
  sessionId: a,
365
357
  message: l
366
358
  });
367
- const r = new ie("", a, J.System);
368
- r.isWaiting = !0, m.current = [r, ...m.current], I(m.current);
369
- const d = (n == null ? void 0 : n.map((w) => w.id)) || [], b = {
370
- stream: xn.stream,
359
+ const r = new oe("", a, J.System);
360
+ r.isWaiting = !0, m.current = [r, ...m.current], x(m.current);
361
+ const d = (n == null ? void 0 : n.map((k) => k.id)) || [], w = {
362
+ stream: In.stream,
371
363
  referenceFirst: !1
372
364
  };
373
365
  if (g != null && g.promptVariables) {
374
- const w = O == null ? void 0 : O.reduce((B, te) => (B[te.key] = te.value, B), {});
375
- b.formatValues = w;
366
+ const k = O == null ? void 0 : O.reduce((B, ne) => (B[ne.key] = ne.value, B), {});
367
+ w.formatValues = k;
376
368
  }
377
369
  if (g != null && g.knowledges) {
378
- const w = At;
379
- b.knowledges = w;
370
+ const k = qt;
371
+ w.knowledges = k;
380
372
  }
381
373
  yield e.send({
382
374
  text: i,
383
375
  fileIds: d,
384
376
  files: n
385
- }, b), de({
377
+ }, w), ee({
386
378
  [a]: []
387
- }), (F = ce.current) == null || F.update();
379
+ }), (T = ce.current) == null || T.update();
388
380
  });
389
381
  C(() => {
390
382
  var a;
@@ -392,18 +384,18 @@ ${t}` : t, l = new ie(i, a, J.User, n);
392
384
  if (!t)
393
385
  return;
394
386
  const n = (i) => {
395
- if (!i.sessionId || i.sessionId && i.sessionId !== Re.current || i.role === J.User)
387
+ if (!i.sessionId || i.sessionId && i.sessionId !== Ue.current || i.role === J.User)
396
388
  return;
397
- if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (U(!1), A(!1), m.current = m.current.filter((d) => !d.isWaiting), I([...m.current]), m.current = [...m.current], i.content))
389
+ if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (U(!1), A(!1), m.current = m.current.filter((d) => !d.isWaiting), x([...m.current]), m.current = [...m.current], i.content))
398
390
  return me.error({
399
391
  message: i.content
400
392
  });
401
- const l = i.actions || [], r = new ie(i.content, t, J.Robot);
402
- r.messageId = i.messageId || Te(), 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({
393
+ const l = i.actions || [], r = new oe(i.content, t, J.Robot);
394
+ r.messageId = i.messageId || Fe(), 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 && x([r, ...m.current]), i.code === 11915 && (U(!1), A(!1), r.isLoading = !1, r.content = "请您换个问题问我吧~", r.isSensitive = !0, x([r, ...m.current])), i.index === -2 && (U(!1), A(!1), r.isLoading = !1, r.content = "回答已中止~", r.isSuspend = !0, x([r, ...m.current])), i.index === -1 && (U(!1), A(!1), r.isLoading = !1, r.reference = i.reference, x([r, ...m.current]), o.id && re && re({
403
395
  applicationId: o.id,
404
396
  sessionId: t,
405
397
  message: r
406
- })), i.index === -3 && (U(!1), A(!1), r.isLoading = !1, r.reference = i.reference, r.relatedQuesion = i.relatedQuesion, I([r, ...m.current]));
398
+ })), i.index === -3 && (U(!1), A(!1), r.isLoading = !1, r.reference = i.reference, r.relatedQuesion = i.relatedQuesion, x([r, ...m.current]));
407
399
  };
408
400
  return e.ready ? e.addEventListener("message:updated", n) : e.addEventListener("ready", () => {
409
401
  e.addEventListener("message:updated", n);
@@ -422,125 +414,125 @@ ${t}` : t, l = new ie(i, a, J.User, n);
422
414
  e == null || e.removeEventListener("frozen", t);
423
415
  };
424
416
  }, [e]), C(() => {
425
- if (!N)
417
+ if (!I)
426
418
  return;
427
- const t = N.questionContextMaxLength || 4e3;
428
- Et(t);
429
- }, [N, T]), C(() => {
419
+ const t = I.questionContextMaxLength || 4e3;
420
+ Pt(t);
421
+ }, [I, H]), C(() => {
430
422
  ke && X(ke.text);
431
423
  }, [ke]);
432
- const Gt = (t) => {
424
+ const Xt = (t) => {
433
425
  const n = t.size;
434
426
  return n <= 0 ? (u.config({
435
427
  getContainer: () => (f == null ? void 0 : f.current) || document.body
436
428
  }), u.error("该文件为空,请重新上传"), u.config({
437
429
  getContainer: void 0
438
- }), !1) : n > 20 * In ? (u.config({
430
+ }), !1) : n > 20 * Nn ? (u.config({
439
431
  getContainer: () => (f == null ? void 0 : f.current) || document.body
440
432
  }), u.error("图片须小于20M"), u.config({
441
433
  getContainer: void 0
442
434
  }), !1) : (Q(t), !1);
443
- }, Xt = (t) => j(void 0, null, function* () {
435
+ }, Zt = (t) => j(void 0, null, function* () {
444
436
  var n;
445
- return Q(t), (n = e == null ? void 0 : e.data) != null && n.id ? Ge(e, t) : new Promise((a) => {
437
+ return Q(t), (n = e == null ? void 0 : e.data) != null && n.id ? Ze(e, t) : new Promise((a) => {
446
438
  M(!0), L == null || L({
447
439
  netOpen: E ? $.OPEN : $.CLOSE
448
440
  }).then((i) => {
449
441
  var l, r;
450
- p == null || p(i), M(!1), P(!!((l = i.data) != null && l.netOpen)), Z(!!((r = i.data) != null && r.enableNetOpen)), a(Ge(i, t));
442
+ y == null || y(i), M(!1), P(!!((l = i.data) != null && l.netOpen)), Z(!!((r = i.data) != null && r.enableNetOpen)), a(Ze(i, t));
451
443
  });
452
444
  });
453
- }), Ge = (t, n) => {
454
- const a = Cn(n.name);
445
+ }), Ze = (t, n) => {
446
+ const a = Ln(n.name);
455
447
  return new Promise((i) => {
456
448
  var r;
457
449
  const l = {
458
- files: [`${Te()}.${a}`],
450
+ files: [`${Fe()}.${a}`],
459
451
  isv: "minio",
460
452
  knowledgeId: ((r = t.data) == null ? void 0 : r.id) || "",
461
453
  type: 1
462
454
  };
463
- be(!0), T == null || T.postTicket(l).then((d) => {
464
- T.uploadMinioFile(d.minio, n).then(() => {
465
- var w, B;
466
- const b = (w = d.minio.endpoints) == null ? void 0 : w[0], y = d.minio.bucket, F = (B = d.minio.fileKeys) == null ? void 0 : B[0];
467
- i(`${location.protocol}//${b}/${y}/${F}`);
455
+ be(!0), H == null || H.postTicket(l).then((d) => {
456
+ H.uploadMinioFile(d.minio, n).then(() => {
457
+ var k, B;
458
+ const w = (k = d.minio.endpoints) == null ? void 0 : k[0], N = d.minio.bucket, T = (B = d.minio.fileKeys) == null ? void 0 : B[0];
459
+ i(`${location.protocol}//${w}/${N}/${T}`);
468
460
  }).catch(() => {
469
- re(""), Q(void 0);
461
+ ae(""), Q(void 0);
470
462
  }).finally(() => {
471
463
  be(!1);
472
464
  });
473
465
  }).catch(() => {
474
- re(""), Q(void 0), be(!1);
466
+ ae(""), Q(void 0), be(!1);
475
467
  });
476
468
  });
477
469
  };
478
470
  C(() => {
479
- const t = H.current;
480
- t && !qe && t.scrollTo({
471
+ const t = F.current;
472
+ t && !$e && t.scrollTo({
481
473
  top: t.scrollHeight
482
474
  });
483
- }, [v]);
484
- const Xe = (t, n) => new Promise((a) => {
475
+ }, [p]);
476
+ const Je = (t, n) => new Promise((a) => {
485
477
  if (!n.file.url || !(o != null && o.id))
486
478
  return a();
487
- const i = gt(ft({}, n.file), {
479
+ const i = Te(Pe({}, n.file), {
488
480
  type: 1
489
481
  });
490
- T == null || T.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
482
+ H == null || H.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
491
483
  var l;
492
484
  (l = ce.current) == null || l.update().finally(a);
493
485
  });
494
- }), Zt = () => {
486
+ }), Jt = () => {
495
487
  var t;
496
488
  (t = e == null ? void 0 : e.data) != null && t.id && (U(!1), e.suspend());
497
- }, Jt = (t) => {
498
- const n = H.current;
489
+ }, St = (t) => {
490
+ const n = F.current;
499
491
  n && setTimeout(() => {
500
492
  n.scrollTo({
501
493
  top: n.scrollHeight,
502
494
  behavior: t == null ? void 0 : t.behavior
503
495
  });
504
496
  }, t == null ? void 0 : t.ms);
505
- }, St = () => {
506
- if (!H.current)
497
+ }, en = () => {
498
+ if (!F.current)
507
499
  return;
508
- const t = H.current.scrollTop <= -80;
509
- Vt(t);
510
- }, en = Pe((t) => {
500
+ const t = F.current.scrollTop <= -80;
501
+ At(t);
502
+ }, tn = Oe((t) => {
511
503
  var n, a;
512
- (n = ae.current) == null || n.update(t), (a = ae.current) == null || a.focus();
513
- }), tn = Pe((t) => {
514
- Qe(t);
515
- }), nn = Pe(() => {
504
+ (n = le.current) == null || n.update(t), (a = le.current) == null || a.focus();
505
+ }), nn = Oe((t) => {
506
+ Ge(t);
507
+ }), on = Oe(() => {
516
508
  var n;
517
509
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
518
510
  return;
519
- m.current = [...v.slice(1, v.length)], I(m.current);
520
- const t = new ie("", e.data.id, J.System);
521
- t.isWaiting = !0, m.current = [t, ...m.current], I(m.current), A(!0), U(!0), e.answerAgain();
511
+ m.current = [...p.slice(1, p.length)], x(m.current);
512
+ const t = new oe("", e.data.id, J.System);
513
+ t.isWaiting = !0, m.current = [t, ...m.current], x(m.current), A(!0), U(!0), e.answerAgain();
522
514
  });
523
515
  C(() => {
524
516
  var t, n;
525
- Re.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !Be && ((n = xe.current) == null || n.clear());
517
+ Ue.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !Ye && ((n = xe.current) == null || n.clear());
526
518
  }, [e]);
527
- const on = () => {
519
+ const sn = () => {
528
520
  var a;
529
521
  if (!((a = e == null ? void 0 : e.data) != null && a.id))
530
522
  return;
531
- const n = v[v.length - 1].messageTime;
523
+ const n = p[p.length - 1].messageTime;
532
524
  e.fetchMessages({
533
525
  endTime: n,
534
- pageSize: yt
526
+ pageSize: pt
535
527
  }).then((i) => {
536
528
  const l = i || [];
537
529
  if (!l || !(l != null && l.length)) {
538
- ee(!1);
530
+ te(!1);
539
531
  return;
540
532
  }
541
- l.length < 10 ? ee(!1) : ee(!0), I([...v, ...l.reverse()]);
533
+ l.length < 10 ? te(!1) : te(!0), x([...p, ...l.reverse()]);
542
534
  });
543
- }, sn = (t) => j(void 0, null, function* () {
535
+ }, rn = (t) => j(void 0, null, function* () {
544
536
  var n, a;
545
537
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
546
538
  P(t);
@@ -560,8 +552,8 @@ ${t}` : t, l = new ie(i, a, J.User, n);
560
552
  }, [e]), C(() => {
561
553
  requestAnimationFrame(() => {
562
554
  var n, a;
563
- if (H.current) {
564
- const i = document.getElementById("chat-main"), l = (n = H.current) == null ? void 0 : n.querySelector(".infinite-scroll-component__outerdiv"), r = (a = H.current) == null ? void 0 : a.querySelector(".infinite-scroll-component");
555
+ if (F.current) {
556
+ const i = document.getElementById("chat-main"), l = (n = F.current) == null ? void 0 : n.querySelector(".infinite-scroll-component__outerdiv"), r = (a = F.current) == null ? void 0 : a.querySelector(".infinite-scroll-component");
565
557
  if (!l || !r || !i)
566
558
  return;
567
559
  const d = i.offsetHeight;
@@ -576,14 +568,14 @@ ${t}` : t, l = new ie(i, a, J.User, n);
576
568
  }
577
569
  }
578
570
  });
579
- }, [v]), C(() => {
571
+ }, [p]), C(() => {
580
572
  if (e)
581
573
  return;
582
574
  const t = () => {
583
- const i = ((N == null ? void 0 : N.promptVariables) || []).filter((l) => l.type ? !(l.type === ye.User && l.key === "query") && !(l.type === ye.System && l.key === "datetime") && l.status === 1 : l.key !== "query" && l.status === 1).map((l, r) => {
584
- var b, y;
575
+ const i = ((I == null ? void 0 : I.promptVariables) || []).filter((l) => l.type ? !(l.type === ye.User && l.key === "query") && !(l.type === ye.System && l.key === "datetime") && l.status === 1 : l.key !== "query" && l.status === 1).map((l, r) => {
576
+ var w, N;
585
577
  let d = "";
586
- return typeof (s == null ? void 0 : s.promptVariables) == "object" && (d = ((y = (b = s.promptVariables.default) == null ? void 0 : b.find((F) => F.key === l.key && F.type === l.type)) == null ? void 0 : y.value) || ""), {
578
+ return typeof (s == null ? void 0 : s.promptVariables) == "object" && (d = ((N = (w = s.promptVariables.default) == null ? void 0 : w.find((T) => T.key === l.key && T.type === l.type)) == null ? void 0 : N.value) || ""), {
587
579
  id: r + "",
588
580
  key: l.key,
589
581
  name: l.name,
@@ -593,18 +585,18 @@ ${t}` : t, l = new ie(i, a, J.User, n);
593
585
  });
594
586
  ge([...i].sort((l, r) => l.key.localeCompare(r.key)));
595
587
  };
596
- return N != null && N.ready ? t() : N == null || N.addEventListener("ready", t), () => {
597
- N == null || N.removeEventListener("ready", t);
588
+ return I != null && I.ready ? t() : I == null || I.addEventListener("ready", t), () => {
589
+ I == null || I.removeEventListener("ready", t);
598
590
  };
599
- }, [e, N, s == null ? void 0 : s.promptVariables]);
600
- const Ze = () => L == null ? void 0 : L({
591
+ }, [e, I, s == null ? void 0 : s.promptVariables]);
592
+ const Se = () => L == null ? void 0 : L({
601
593
  netOpen: E ? $.OPEN : $.CLOSE
602
594
  }).then((t) => {
603
595
  var n, a;
604
- return p == null || p(t), M(!1), P(!!((n = t.data) != null && n.netOpen)), Z(!!((a = t.data) != null && a.enableNetOpen)), _e(t), t;
605
- }), Je = mn(() => {
596
+ return y == null || y(t), M(!1), P(!!((n = t.data) != null && n.netOpen)), Z(!!((a = t.data) != null && a.enableNetOpen)), Xe(t), t;
597
+ }), et = yn(() => {
606
598
  var t;
607
- return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(pt, {
599
+ return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(vt, {
608
600
  application: o,
609
601
  history: {
610
602
  role: 1,
@@ -614,36 +606,42 @@ ${t}` : t, l = new ie(i, a, J.User, n);
614
606
  sessionId: "",
615
607
  reference: [],
616
608
  searchReference: [],
617
- messageTime: vt(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
609
+ messageTime: kt(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
618
610
  actions: [],
619
611
  isLoading: !1
620
612
  },
621
- actions: !!v.length,
613
+ actions: !!p.length,
622
614
  markdown: s == null ? void 0 : s.markdown
623
615
  }) : null;
624
- }, [o == null ? void 0 : o.arrange, v]);
625
- return yn(k, () => ({
616
+ }, [o == null ? void 0 : o.arrange, p]);
617
+ return pn(v, () => ({
626
618
  getCurrentInputText: () => {
627
619
  var t;
628
- return (t = ae.current) == null ? void 0 : t.getCurrentText();
620
+ return (t = le.current) == null ? void 0 : t.getCurrentText();
629
621
  }
630
- })), /* @__PURE__ */ z("div", {
622
+ })), C(() => {
623
+ var n;
624
+ const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
625
+ t && ee((a) => Te(Pe({}, a), {
626
+ [t]: []
627
+ }));
628
+ }, [(tt = e == null ? void 0 : e.data) == null ? void 0 : tt.id]), /* @__PURE__ */ z("div", {
631
629
  className: "agent-chat",
632
- children: [$t ? /* @__PURE__ */ c("div", {
630
+ children: [Yt ? /* @__PURE__ */ c("div", {
633
631
  className: "session-loading",
634
- children: /* @__PURE__ */ c(ut, {})
635
- }) : /* @__PURE__ */ z(fn, {
636
- children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ c(Dn, {
637
- ref: ze,
632
+ children: /* @__PURE__ */ c(ht, {})
633
+ }) : /* @__PURE__ */ z(gn, {
634
+ children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ c(Un, {
635
+ ref: Ae,
638
636
  appId: o.id,
639
637
  currentSession: e,
640
638
  promptVariables: O,
641
639
  setPromptVariables: ge,
642
- setCurrentSession: p
640
+ setCurrentSession: y
643
641
  }), /* @__PURE__ */ z("div", {
644
642
  className: "chat-main",
645
643
  id: "chat-main",
646
- style: xt,
644
+ style: It,
647
645
  children: [/* @__PURE__ */ c("div", {
648
646
  className: "chat-main-wrapper",
649
647
  id: "scrollableDiv",
@@ -653,76 +651,76 @@ ${t}` : t, l = new ie(i, a, J.User, n);
653
651
  display: "flex",
654
652
  flexDirection: "column-reverse"
655
653
  },
656
- ref: H,
657
- onScroll: St,
658
- children: (Se = e == null ? void 0 : e.data) != null && Se.id && (v != null && v.length) ? /* @__PURE__ */ z(jn, {
659
- dataLength: v.length,
660
- next: on,
654
+ ref: F,
655
+ onScroll: en,
656
+ children: (nt = e == null ? void 0 : e.data) != null && nt.id && (p != null && p.length) ? /* @__PURE__ */ z(zn, {
657
+ dataLength: p.length,
658
+ next: sn,
661
659
  style: {
662
660
  display: "flex",
663
661
  flexDirection: "column-reverse",
664
662
  overflowX: "hidden"
665
663
  },
666
664
  inverse: !0,
667
- endMessage: v.length > yt && // 少于一页不展示这个提示
668
- ((et = H.current) != null && et.scrollTop) && ((tt = H.current) == null ? void 0 : tt.scrollTop) < -10 ? /* @__PURE__ */ c(pn, {
665
+ endMessage: p.length > pt && // 少于一页不展示这个提示
666
+ ((it = F.current) != null && it.scrollTop) && ((ot = F.current) == null ? void 0 : ot.scrollTop) < -10 ? /* @__PURE__ */ c(vn, {
669
667
  plain: !0,
670
668
  children: "没有更多数据了"
671
669
  }) : null,
672
- hasMore: $e,
670
+ hasMore: Ke,
673
671
  loader: /* @__PURE__ */ c("div", {
674
672
  style: {
675
673
  height: "50px",
676
674
  textAlign: "center",
677
675
  overflow: "hidden"
678
676
  },
679
- children: /* @__PURE__ */ c(ut, {})
677
+ children: /* @__PURE__ */ c(ht, {})
680
678
  }),
681
679
  scrollableTarget: "scrollableDiv",
682
- children: [v.map((t, n) => /* @__PURE__ */ c(Bn, {
680
+ children: [p.map((t, n) => /* @__PURE__ */ c($n, {
683
681
  application: o,
684
682
  currentSession: e,
685
683
  history: t,
686
684
  docViewerUrl: Y,
687
685
  isLastHistory: n === 0,
688
- onRelatedClick: tn,
689
- onAgainClick: nn,
690
- onEditClick: en,
686
+ onRelatedClick: nn,
687
+ onAgainClick: on,
688
+ onEditClick: tn,
691
689
  markdown: s == null ? void 0 : s.markdown
692
- }, t.messageId + n)), !$e && Je]
690
+ }, t.messageId + n)), !Ke && et]
693
691
  }) : /* @__PURE__ */ z("div", {
694
692
  className: "main-empty",
695
- children: [(s == null ? void 0 : s.greeting) !== !1 && /* @__PURE__ */ c(Pn, {
696
- text: s === void 0 || s.greeting === !0 || ((nt = s.greeting) == null ? void 0 : nt.text) === void 0 ? mt.text : s.greeting.text,
697
- icon: s === void 0 || s.greeting === !0 || ((it = s.greeting) == null ? void 0 : it.icon) === void 0 ? It || mt.icon : s.greeting.icon,
698
- children: !!Ue.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, {
693
+ children: [(s == null ? void 0 : s.greeting) !== !1 && /* @__PURE__ */ c(Tn, {
694
+ text: s === void 0 || s.greeting === !0 || ((st = s.greeting) == null ? void 0 : st.text) === void 0 ? yt.text : s.greeting.text,
695
+ icon: s === void 0 || s.greeting === !0 || ((rt = s.greeting) == null ? void 0 : rt.icon) === void 0 ? Nt || yt.icon : s.greeting.icon,
696
+ children: !!je.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(Pn, {
699
697
  ref: xe,
700
- sid: (ot = e == null ? void 0 : e.data) == null ? void 0 : ot.id,
701
- isRecommendClearing: Me,
702
- data: Ue,
698
+ sid: (at = e == null ? void 0 : e.data) == null ? void 0 : at.id,
699
+ isRecommendClearing: ze,
700
+ data: je,
703
701
  layoutBreakpoints: typeof (s == null ? void 0 : s.greeting) == "object" ? s.greeting.layoutBreakpoints : void 0,
704
702
  onItemClick: (t) => {
705
703
  var a, i, l;
706
- if (oe(t == null ? void 0 : t.question), X(t == null ? void 0 : t.question), Me)
704
+ if (se(t == null ? void 0 : t.question), X(t == null ? void 0 : t.question), ze)
707
705
  return;
708
706
  t != null && t.id && G(!0);
709
707
  const n = (a = e == null ? void 0 : e.data) == null ? void 0 : a.id;
710
708
  g != null && g.fileUpload ? (l = (i = ce.current) == null ? void 0 : i.clear()) == null || l.then(() => {
711
709
  var r, d;
712
- t != null && t.id && (n ? (r = Xe(n, t)) == null || r.finally(() => {
710
+ t != null && t.id && (n ? (r = Je(n, t)) == null || r.finally(() => {
713
711
  G(!1);
714
- }) : (G(!1), M(!0), (d = Ze()) == null || d.then((b) => {
715
- var y;
716
- (y = Xe(b.id, t)) == null || y.finally(() => {
712
+ }) : (G(!1), M(!0), (d = Se()) == null || d.then((w) => {
713
+ var N;
714
+ (N = Je(w.id, t)) == null || N.finally(() => {
717
715
  G(!1);
718
716
  });
719
717
  })));
720
- }) : n ? G(!1) : (G(!1), M(!0), Ze());
718
+ }) : n ? G(!1) : (G(!1), M(!0), Se());
721
719
  }
722
720
  })
723
- }), Je]
721
+ }), et]
724
722
  })
725
- }), Ae && /* @__PURE__ */ c("div", {
723
+ }), Be && /* @__PURE__ */ c("div", {
726
724
  className: "session-stop",
727
725
  children: /* @__PURE__ */ c(W, {
728
726
  type: "primary",
@@ -731,24 +729,24 @@ ${t}` : t, l = new ie(i, a, J.User, n);
731
729
  },
732
730
  ghost: !0,
733
731
  size: "small",
734
- icon: /* @__PURE__ */ c(ne, {
732
+ icon: /* @__PURE__ */ c(ie, {
735
733
  type: "icon-zantinghuida",
736
734
  style: {
737
735
  fontSize: 16
738
736
  }
739
737
  }),
740
- onClick: () => Zt(),
738
+ onClick: () => Jt(),
741
739
  children: "停止回答"
742
740
  })
743
- }), qe && (v == null ? void 0 : v.length) > 0 && /* @__PURE__ */ c("div", {
741
+ }), $e && (p == null ? void 0 : p.length) > 0 && /* @__PURE__ */ c("div", {
744
742
  className: "back-bottom",
745
743
  children: /* @__PURE__ */ c(W, {
746
744
  size: "small",
747
- onClick: () => Jt({
745
+ onClick: () => St({
748
746
  behavior: "smooth"
749
747
  }),
750
748
  type: "link",
751
- icon: /* @__PURE__ */ c(ne, {
749
+ icon: /* @__PURE__ */ c(ie, {
752
750
  type: "icon-yijianhuidaodibu",
753
751
  style: {
754
752
  fontSize: 24
@@ -762,25 +760,25 @@ ${t}` : t, l = new ie(i, a, J.User, n);
762
760
  className: "chat-footer-input",
763
761
  children: [S && /* @__PURE__ */ c("div", {
764
762
  className: "input-files",
765
- children: /* @__PURE__ */ c(Nn, {
763
+ children: /* @__PURE__ */ c(Cn, {
766
764
  file: S,
767
765
  actions: {
768
- upload: Xt,
766
+ upload: Zt,
769
767
  remove: () => {
770
768
  Q(void 0);
771
769
  }
772
770
  },
773
- onUrlChange: (t) => re(t)
771
+ onUrlChange: (t) => ae(t)
774
772
  })
775
773
  }), /* @__PURE__ */ z(he, {
776
774
  className: "footer-upload-action",
777
775
  onClick: (t) => t.preventDefault(),
778
776
  children: [/* @__PURE__ */ z(he, {
779
- children: [o.type === 2 && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ c(vn, {
777
+ children: [o.type === 2 && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ c(kn, {
780
778
  disabled: !!S || R,
781
779
  accept: ".jpg, .png, .jpeg,.bmp",
782
780
  listType: "picture-card",
783
- beforeUpload: Gt,
781
+ beforeUpload: Xt,
784
782
  className: "footer-upload-picture",
785
783
  showUploadList: !1,
786
784
  children: S ? /* @__PURE__ */ c(W, {
@@ -798,7 +796,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
798
796
  fontSize: "22px"
799
797
  }
800
798
  })
801
- }) : /* @__PURE__ */ c(kn, {
799
+ }) : /* @__PURE__ */ c(wn, {
802
800
  placement: "topLeft",
803
801
  overlayClassName: "footer-upload-tooltip",
804
802
  title: /* @__PURE__ */ c("div", {
@@ -812,7 +810,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
812
810
  position: "relative",
813
811
  bottom: "-2px"
814
812
  },
815
- icon: /* @__PURE__ */ c(ne, {
813
+ icon: /* @__PURE__ */ c(ie, {
816
814
  type: "icon-Vector",
817
815
  className: "icon-tianjia",
818
816
  style: {
@@ -821,10 +819,10 @@ ${t}` : t, l = new ie(i, a, J.User, n);
821
819
  })
822
820
  })
823
821
  })
824
- }), pe && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ c(Hn, {
822
+ }), pe && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ c(Rn, {
825
823
  appId: o == null ? void 0 : o.id,
826
824
  ref: ce,
827
- isFirstSession: Be,
825
+ isFirstSession: Ye,
828
826
  docViewerUrl: Y,
829
827
  onStatusChange: (t) => j(void 0, null, function* () {
830
828
  t !== "process" ? (fe(!0), Le()) : fe(!1);
@@ -834,15 +832,15 @@ ${t}` : t, l = new ie(i, a, J.User, n);
834
832
  netOpen: E ? $.OPEN : $.CLOSE
835
833
  }).then((n) => {
836
834
  var i, l, r;
837
- p == null || p(n), M(!1), P(!!((i = n.data) != null && i.netOpen)), Z(!!((l = n.data) != null && l.enableNetOpen));
835
+ y == null || y(n), M(!1), P(!!((i = n.data) != null && i.netOpen)), Z(!!((l = n.data) != null && l.enableNetOpen));
838
836
  const a = ((r = n.data) == null ? void 0 : r.id) || "";
839
837
  t(a);
840
838
  });
841
839
  }),
842
- sid: (st = e == null ? void 0 : e.data) == null ? void 0 : st.id,
840
+ sid: (lt = e == null ? void 0 : e.data) == null ? void 0 : lt.id,
843
841
  disabled: Ie || R,
844
842
  afterFileAdd: (t, n) => {
845
- n && de((a) => {
843
+ n && ee((a) => {
846
844
  const i = a[n] || [];
847
845
  return {
848
846
  [n]: [...i, t]
@@ -852,7 +850,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
852
850
  afterFileDelete: (t) => {
853
851
  var a;
854
852
  const n = (a = e == null ? void 0 : e.data) == null ? void 0 : a.id;
855
- n && de((i) => {
853
+ n && ee((i) => {
856
854
  const l = i[n] || [];
857
855
  return {
858
856
  [n]: l.filter((r) => r.id !== t)
@@ -860,43 +858,43 @@ ${t}` : t, l = new ie(i, a, J.User, n);
860
858
  });
861
859
  },
862
860
  onFileListChange: (t) => {
863
- Ut(t);
861
+ Mt(t);
864
862
  },
865
- shouldContinue: jt,
863
+ shouldContinue: zt,
866
864
  afterFilesClear: () => {
867
865
  var n;
868
866
  const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
869
- t && (de({
867
+ t && (ee({
870
868
  [t]: []
871
869
  }), Le());
872
870
  }
873
- }) : null, (g == null ? void 0 : g.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ c(Vn, {
871
+ }) : null, (g == null ? void 0 : g.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ c(An, {
874
872
  appId: o.id,
875
873
  list: [],
876
- search: je ? Ft : "",
874
+ search: Ve ? Ft : "",
877
875
  onPromptSelect: (t) => {
878
- X(t.context), oe(t.context);
876
+ X(t.context), se(t.context);
879
877
  },
880
878
  disabled: R
881
879
  })]
882
880
  }), /* @__PURE__ */ z(he, {
883
- children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((rt = o.arrange) == null ? void 0 : rt.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ c(zn, {
884
- sessionId: (at = e == null ? void 0 : e.data) == null ? void 0 : at.id,
881
+ children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((dt = o.arrange) == null ? void 0 : dt.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ c(Vn, {
882
+ sessionId: (ct = e == null ? void 0 : e.data) == null ? void 0 : ct.id,
885
883
  netStatus: E,
886
- enable: typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.diabled) == "boolean" ? !(s != null && s.connectNetwork.diabled) : Bt,
884
+ enable: typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.diabled) == "boolean" ? !(s != null && s.connectNetwork.diabled) : $t,
887
885
  disabledTip: e ? void 0 : "网络访问已被禁用",
888
886
  onNetStatusChange: (t) => {
889
- sn(t);
887
+ rn(t);
890
888
  }
891
- }), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(Un, {
892
- currentSessionId: (lt = e == null ? void 0 : e.data) == null ? void 0 : lt.id,
889
+ }), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(Mn, {
890
+ currentSessionId: (ft = e == null ? void 0 : e.data) == null ? void 0 : ft.id,
893
891
  onSessionChange: (t, n) => {
894
- X(void 0), Ne(!0), p == null || p(n);
892
+ X(void 0), Ne(!0), y == null || y(n);
895
893
  },
896
894
  disabled: R
897
- }), Nt && Ct === "float" && /* @__PURE__ */ c("div", {
895
+ }), Ct && Lt === "float" && /* @__PURE__ */ c("div", {
898
896
  className: "session-history-drawer-component",
899
- children: /* @__PURE__ */ c(wn, {
897
+ children: /* @__PURE__ */ c(bn, {
900
898
  placement: "topRight",
901
899
  showArrow: !1,
902
900
  overlayClassName: "session-history-overlay",
@@ -909,41 +907,41 @@ ${t}` : t, l = new ie(i, a, J.User, n);
909
907
  className: "history-overlay-action",
910
908
  disabled: R,
911
909
  type: "text",
912
- icon: /* @__PURE__ */ c(ne, {
910
+ icon: /* @__PURE__ */ c(ie, {
913
911
  type: "icon-lishijilu",
914
912
  style: {
915
913
  fontSize: 24
916
914
  }
917
915
  }),
918
- onClick: () => We(!0)
916
+ onClick: () => _e(!0)
919
917
  })
920
918
  })
921
919
  }), (g == null ? void 0 : g.sessionOpen) && /* @__PURE__ */ c(W, {
922
- icon: /* @__PURE__ */ c(On, {}),
920
+ icon: /* @__PURE__ */ c(Hn, {}),
923
921
  className: "add-btn",
924
922
  type: "primary",
925
- disabled: Ae || !e || !v.length || R,
923
+ disabled: Be || !e || !p.length || R,
926
924
  onClick: () => {
927
925
  var t, n;
928
- p == null || p(null), P(!1), (t = ze.current) == null || t.clear(), (n = xe.current) == null || n.clear();
926
+ y == null || y(null), P(!1), (t = Ae.current) == null || t.clear(), (n = xe.current) == null || n.clear();
929
927
  },
930
928
  children: "新会话"
931
929
  })]
932
930
  })]
933
931
  }), /* @__PURE__ */ c("div", {
934
932
  className: "footer-textarea",
935
- children: /* @__PURE__ */ c(Ln, {
936
- ref: ae,
937
- maxLength: Lt,
938
- text: Ht,
933
+ children: /* @__PURE__ */ c(En, {
934
+ ref: le,
935
+ maxLength: Et,
936
+ text: Rt,
939
937
  networkStatus: !1,
940
- loading: Ye,
941
- disabled: He || De || R || Ye,
942
- onTextSend: Qe,
938
+ loading: We,
939
+ disabled: De || Me || R || We,
940
+ onTextSend: Ge,
943
941
  onChange: (t, n) => {
944
942
  X(t);
945
943
  const a = n.getText().replace(/[\n\s]+$/, "");
946
- oe(a), Ot(a), je || Tt(!0);
944
+ se(a), Ht(a), Ve || Ot(!0);
947
945
  },
948
946
  clearAction: /* @__PURE__ */ c(he, {
949
947
  size: 0,
@@ -951,36 +949,36 @@ ${t}` : t, l = new ie(i, a, J.User, n);
951
949
  type: "link",
952
950
  disabled: Ie || R,
953
951
  ghost: !0,
954
- icon: /* @__PURE__ */ c(ne, {
952
+ icon: /* @__PURE__ */ c(ie, {
955
953
  style: {
956
954
  fontSize: 22
957
955
  },
958
956
  type: "icon-qingchujiyi"
959
957
  }),
960
- onClick: () => Qt()
958
+ onClick: () => _t()
961
959
  })
962
960
  })
963
961
  })
964
962
  })]
965
963
  })
966
- }), /* @__PURE__ */ c(Tn, {
967
- tips: bt
968
- }), Ve && /* @__PURE__ */ c(Rn, {
969
- isvisible: Ve,
970
- files: Dt,
971
- sessionId: (dt = e == null ? void 0 : e.data) == null ? void 0 : dt.id,
964
+ }), /* @__PURE__ */ c(On, {
965
+ tips: xt
966
+ }), qe && /* @__PURE__ */ c(Dn, {
967
+ isvisible: qe,
968
+ files: Ut,
969
+ sessionId: (gt = e == null ? void 0 : e.data) == null ? void 0 : gt.id,
972
970
  onClose: (t) => {
973
- Rt(!1), zt(!1);
971
+ Dt(!1), Vt(!1);
974
972
  }
975
973
  })]
976
- }), Ke && /* @__PURE__ */ c(Mn, {
974
+ }), Qe && /* @__PURE__ */ c(jn, {
977
975
  currentSession: e,
978
976
  application: o,
979
977
  networkStatus: E,
980
- setCurrentSession: p,
978
+ setCurrentSession: y,
981
979
  disabled: R,
982
- isSessionHistoryVisible: Ke,
983
- setIsSessionHistoryVisible: We,
980
+ isSessionHistoryVisible: Qe,
981
+ setIsSessionHistoryVisible: _e,
984
982
  onSessionChange: (t) => {
985
983
  Ne(!0);
986
984
  }
@@ -988,5 +986,5 @@ ${t}` : t, l = new ie(i, a, J.User, n);
988
986
  });
989
987
  });
990
988
  export {
991
- wi as default
989
+ bi as default
992
990
  };