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