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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,45 +1,45 @@
1
1
  var Fn = Object.defineProperty, Hn = Object.defineProperties;
2
2
  var An = Object.getOwnPropertyDescriptors;
3
- var Ft = Object.getOwnPropertySymbols;
3
+ var Ht = Object.getOwnPropertySymbols;
4
4
  var Mn = Object.prototype.hasOwnProperty, jn = Object.prototype.propertyIsEnumerable;
5
5
  var He = (x, h, o) => h in x ? Fn(x, h, { enumerable: !0, configurable: !0, writable: !0, value: o }) : x[h] = o, Ae = (x, h) => {
6
6
  for (var o in h || (h = {}))
7
7
  Mn.call(h, o) && He(x, o, h[o]);
8
- if (Ft)
9
- for (var o of Ft(h))
8
+ if (Ht)
9
+ for (var o of Ht(h))
10
10
  jn.call(h, o) && He(x, o, h[o]);
11
11
  return x;
12
12
  }, Me = (x, h) => Hn(x, An(h));
13
13
  var A = (x, h, o) => (He(x, typeof h != "symbol" ? h + "" : h, o), o);
14
14
  var M = (x, h, o) => new Promise(($, e) => {
15
- var k = (L) => {
15
+ var b = (P) => {
16
16
  try {
17
- y(o.next(L));
18
- } catch (P) {
19
- e(P);
17
+ w(o.next(P));
18
+ } catch (T) {
19
+ e(T);
20
20
  }
21
- }, z = (L) => {
21
+ }, z = (P) => {
22
22
  try {
23
- y(o.throw(L));
24
- } catch (P) {
25
- e(P);
23
+ w(o.throw(P));
24
+ } catch (T) {
25
+ e(T);
26
26
  }
27
- }, y = (L) => L.done ? $(L.value) : Promise.resolve(L.value).then(k, z);
28
- y((o = o.apply(x, h)).next());
27
+ }, w = (P) => P.done ? $(P.value) : Promise.resolve(P.value).then(b, z);
28
+ w((o = o.apply(x, h)).next());
29
29
  });
30
- import { jsx as f, jsxs as q, Fragment as $n } from "react/jsx-runtime";
31
- import { memo as zn, forwardRef as Vn, useState as g, useRef as Q, useContext as Bn, useEffect as I, useMemo as _n, useImperativeHandle as qn } from "react";
32
- /* empty css */import { message as Ht, Spin as At, Divider as Wn, Button as J, Space as Ne, Upload as Kn, Tooltip as Yn, Popover as Qn, notification as ae } from "antd";
33
- import le from "../../components/Iconfont/index.mjs";
34
- import { IHistoryRole as ce, ApplicationTypes as G, ChatMessageRole as Mt, PromptVariableType as Le } from "@glodon-aiot/apis";
35
- import Bt from "./HistoryItem/index.mjs";
36
- import _t from "dayjs";
30
+ import { jsx as f, jsxs as _, Fragment as $n } from "react/jsx-runtime";
31
+ import { memo as zn, forwardRef as Vn, useState as g, useRef as Y, useContext as Bn, useEffect as I, useMemo as _n, useImperativeHandle as qn } from "react";
32
+ /* empty css */import { message as At, Spin as Mt, Divider as Wn, Button as Z, Space as Ee, Upload as Kn, Tooltip as Yn, Popover as Qn, notification as se } from "antd";
33
+ import re from "../../components/Iconfont/index.mjs";
34
+ import { IHistoryRole as ae, ApplicationTypes as Q, ChatMessageRole as jt, PromptVariableType as Ne } from "@glodon-aiot/apis";
35
+ import _t from "./HistoryItem/index.mjs";
36
+ import qt from "dayjs";
37
37
  import { v4 as Ve } from "uuid";
38
38
  import Xn from "../../context.mjs";
39
39
  import { configuration as Gn } from "@glodon-aiot/bot-client-sdk";
40
- import { MAX_KNOWLEDGES_AND_FILES_COUNT as jt, NET_OPEN_STATUS as X, MB as Zn } from "../../constant.mjs";
40
+ import { MAX_KNOWLEDGES_AND_FILES_COUNT as $t, NET_OPEN_STATUS as le, MB as Zn } from "../../constant.mjs";
41
41
  import Jn from "../../components/FilePreview/index.mjs";
42
- import { calcKnowledgesLeafCount as Sn, getImageExtension as $t, fileTypes as ei } from "../../utils/index.mjs";
42
+ import { calcKnowledgesLeafCount as Sn, getImageExtension as zt, fileTypes as ei } from "../../utils/index.mjs";
43
43
  import ti from "../../QuillEditor/index.mjs";
44
44
  import ni from "../../components/Recommend/index.mjs";
45
45
  import ii from "../../components/Greeting/index.mjs";
@@ -53,15 +53,15 @@ import ci from "./Tools/SessionListDrawer/index.mjs";
53
53
  import di from "./Tools/SessionHistoryDrawer/index.mjs";
54
54
  import fi from "react-infinite-scroll-component";
55
55
  import gi from "./Tools/ConnectToNetwork/index.mjs";
56
- import pi from "./Tools/PromptManager/index.mjs";
57
- import { useSessionState as ui } from "../../hooks/useSessionState.mjs";
56
+ import ui from "./Tools/PromptManager/index.mjs";
57
+ import { useSessionState as pi } from "../../hooks/useSessionState.mjs";
58
58
  import hi from "../../assets/icon.svg.mjs";
59
- const mi = zn(Bt), zt = {
59
+ const mi = zn(_t), Vt = {
60
60
  icon: hi,
61
61
  text: "今天我能帮你什么?"
62
62
  };
63
63
  class he {
64
- constructor(h, o, $, e, k) {
64
+ constructor(h, o, $, e, b) {
65
65
  A(this, "messageTime");
66
66
  A(this, "isWaiting");
67
67
  A(this, "messageId");
@@ -73,104 +73,104 @@ class he {
73
73
  A(this, "imageContent");
74
74
  // 新增:支持对话型应用的图片内容
75
75
  A(this, "comment");
76
- this.content = h, this.sessionId = o, this.role = $, this.files = e, this.content = h, this.role = $, this.sessionId = o, this.files = e, this.imageContent = k, this.messageTime = _t(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = Ve(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
76
+ this.content = h, this.sessionId = o, this.role = $, this.files = e, this.content = h, this.role = $, this.sessionId = o, this.files = e, this.imageContent = b, this.messageTime = qt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = Ve(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
77
77
  isAgree: 0
78
78
  };
79
79
  }
80
80
  }
81
- const Vt = 10, S = 5, $e = 20, ze = (x, h, o, $) => {
81
+ const Bt = 10, J = 5, $e = 20, ze = (x, h, o, $) => {
82
82
  let e = x;
83
- if ($ === G.Agent) {
83
+ if ($ === Q.Agent) {
84
84
  if (o && o.length > 0) {
85
- const k = o.map((z) => `[${z.name.replace(/\.[^/.]+$/, "")}](${z.url})`).join(`
85
+ const b = o.map((z) => `[${z.name.replace(/\.[^/.]+$/, "")}](${z.url})`).join(`
86
86
  `);
87
- e = k ? `${k}
87
+ e = b ? `${b}
88
88
  ${e}` : e;
89
89
  }
90
90
  if (h && h.length > 0) {
91
- const k = h.filter(Boolean).map((z) => `![](${z})`).join(`
91
+ const b = h.filter(Boolean).map((z) => `![](${z})`).join(`
92
92
  `);
93
- e = k ? `${k}
93
+ e = b ? `${b}
94
94
  ${e}` : e;
95
95
  }
96
96
  }
97
97
  return e;
98
98
  }, Xi = Vn((x, h) => {
99
- var yt, vt, wt, kt, bt, xt, Ct, It, Et, Nt, Lt, Pt, Tt, Dt;
99
+ var vt, wt, kt, bt, xt, Ct, It, Et, Nt, Lt, Pt, Tt, Dt, Ot;
100
100
  const {
101
101
  application: o,
102
102
  docViewerUrl: $ = "",
103
103
  currentSession: e,
104
- onCreateSession: k,
104
+ onCreateSession: b,
105
105
  embeddingService: z,
106
- setCurrentSession: y,
107
- networkStatus: L,
108
- setNetworkStatus: P
109
- } = x, [v, E] = g([]), [qt, me] = g(), [Pe, Be] = g(), R = Q(null), {
106
+ setCurrentSession: w,
107
+ networkStatus: P,
108
+ setNetworkStatus: T
109
+ } = x, [y, E] = g([]), [Wt, me] = g(), [Le, Be] = g(), R = Y(null), {
110
110
  service: U,
111
111
  agentClient: N,
112
- depId: Wt,
113
- footer: Kt,
114
- transform: d,
115
- defaultInput: Te,
112
+ depId: Kt,
113
+ footer: Yt,
114
+ transform: c,
115
+ defaultInput: Pe,
116
116
  onMessage: ye,
117
117
  onHistoryLoad: _e,
118
- beforeMessageSend: W,
119
- bodyStyle: Yt,
118
+ beforeMessageSend: q,
119
+ bodyStyle: Qt,
120
120
  disabled: O,
121
121
  features: l,
122
122
  popupContainer: j,
123
- icon: Qt,
124
- sider: Xt,
125
- mode: Gt
126
- } = Bn(Xn), [qe, De] = g(!1), m = Q(v), We = Q(void 0), [Zt, Jt] = g(0), [de, ve] = g([]), [ee, we] = g([]), [Ke, Ye] = g(0), [Qe, St] = g(!1);
123
+ icon: Xt,
124
+ sider: Gt,
125
+ mode: Zt
126
+ } = Bn(Xn), [qe, Te] = g(!1), m = Y(y), We = Y(void 0), [Jt, St] = g(0), [ce, ve] = g([]), [S, we] = g([]), [Ke, Ye] = g(0), [Qe, en] = g(!1);
127
127
  I(() => {
128
- St(Ke > 0);
128
+ en(Ke > 0);
129
129
  }, [Ke]);
130
- const ke = Q(null), [Xe, en] = g([]), [Ge, te] = g(!1), [Ze, tn] = g(!1), [nn, on] = g(""), [sn, ne] = g(), [ie, fe] = g({}), ge = Q(null), Je = Q(null), Oe = Q(null), [Se, rn] = g(!1), [an, ln] = g([]), [cn, be] = g(!0), [dn, fn] = g(!0), [et, V] = g(!1), [Re, K] = g(!1), [tt, gn] = g(!1), [F, pe] = g(typeof (l == null ? void 0 : l.promptVariables) == "object" ? l.promptVariables.default || [] : []), [pn, un] = g(() => {
130
+ const ke = Y(null), [Xe, tn] = g([]), [Ge, ee] = g(!1), [Ze, nn] = g(!1), [on, sn] = g(""), [rn, te] = g(), [ne, de] = g({}), fe = Y(null), Je = Y(null), De = Y(null), [Se, an] = g(!1), [ln, cn] = g([]), [dn, be] = g(!0), [fn, gn] = g(!0), [et, V] = g(!1), [Oe, W] = g(!1), [tt, un] = g(!1), [F, ge] = g(typeof (l == null ? void 0 : l.promptVariables) == "object" ? l.promptVariables.default || [] : []), [pn, hn] = g(() => {
131
131
  const t = typeof (l == null ? void 0 : l.knowledges) == "object" && l.knowledges.default || void 0;
132
132
  if (t) {
133
- if (Array.isArray(t) && t.some((r) => Array.isArray(r.fileIds) && r.fileIds.length === 0))
133
+ if (Array.isArray(t) && t.some((a) => Array.isArray(a.fileIds) && a.fileIds.length === 0))
134
134
  throw Error("fileIds cannot be an empty array");
135
- if (Sn(t) > jt)
136
- throw Error(`knowledges and fileIds total count cannot exceed ${jt}`);
135
+ if (Sn(t) > $t)
136
+ throw Error(`knowledges and fileIds total count cannot exceed ${$t}`);
137
137
  }
138
138
  return t;
139
- }), [nt, B] = g(!1), [it, ue] = g(!1), [hn, oe] = g(typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.default) == "boolean" ? l.connectNetwork.default : !1), [ot, xe] = g(!1), [mn, Y] = g(!1), [yn, vn] = g(null), [Ce, Z] = g(!1), [st, rt] = g(!1), {
139
+ }), [nt, X] = g(!1), [it, ue] = g(!1), [mn, pe] = g(typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.default) == "boolean" ? l.connectNetwork.default : !1), [ot, xe] = g(!1), [yn, K] = g(!1), [vn, wn] = g(null), [Ce, G] = g(!1), [st, rt] = g(!1), {
140
140
  isSwitchingToExistingSession: at,
141
141
  setIsSwitchingToExistingSession: Ie
142
- } = ui(), se = Q(null);
142
+ } = pi(), ie = Y(null);
143
143
  I(() => {
144
- if (vn(e), e === null)
145
- Y(!1);
144
+ if (wn(e), e === null)
145
+ K(!1);
146
146
  else if (e === void 0)
147
- Y(!0);
147
+ K(!0);
148
148
  else {
149
- if (yn === null) {
149
+ if (vn === null) {
150
150
  if (at) {
151
- Y(!0), Ie(!1);
151
+ K(!0), Ie(!1);
152
152
  return;
153
153
  }
154
- Y(!1);
154
+ K(!1);
155
155
  return;
156
156
  }
157
- e.ready ? Y(!1) : Y(!0);
157
+ e.ready ? K(!1) : K(!0);
158
158
  }
159
159
  }, [e, e == null ? void 0 : e.ready, at]), I(() => {
160
- var s, r;
160
+ var s, a;
161
161
  e && (m.current = []), E([]);
162
162
  const t = R.current;
163
163
  if (t && t.scrollTo({
164
164
  top: 0
165
165
  }), !((s = e == null ? void 0 : e.data) != null && s.id))
166
166
  return;
167
- if (K(!1), V(!1), (r = e.messages) != null && r.length) {
168
- const c = [...e.messages.filter((a) => a == null ? void 0 : a.messageId)].reverse();
169
- m.current = [...c], E([...c]), Y(!1);
167
+ if (W(!1), V(!1), (a = e.messages) != null && a.length) {
168
+ const d = [...e.messages.filter((r) => r == null ? void 0 : r.messageId)].reverse();
169
+ m.current = [...d], E([...d]), K(!1);
170
170
  }
171
171
  const n = (i) => {
172
- var c;
173
- (c = e == null ? void 0 : e.data) != null && c.id && (m.current = [...i].reverse(), E([...i].reverse()), !i || i.length < 10 ? ue(!1) : ue(!0), Y(!1), _e && _e({
172
+ var d;
173
+ (d = e == null ? void 0 : e.data) != null && d.id && (m.current = [...i].reverse(), E([...i].reverse()), !i || i.length < 10 ? ue(!1) : ue(!0), K(!1), _e && _e({
174
174
  applicationId: o.id,
175
175
  sessionId: e.data.id,
176
176
  histories: i
@@ -182,7 +182,7 @@ ${e}` : e;
182
182
  }, [e]), I(() => {
183
183
  const t = () => {
184
184
  var n;
185
- (n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && pe(e.promptVariables.sort((s, r) => s.key.localeCompare(r.key))), e.knowledges && un(e.knowledges), P(e.netOpen));
185
+ (n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ge(e.promptVariables.sort((s, a) => s.key.localeCompare(a.key))), e.knowledges && hn(e.knowledges), T(e.netOpen));
186
186
  };
187
187
  return e == null || e.addEventListener("data:updated", t), () => {
188
188
  e == null || e.removeEventListener("data:updated", t);
@@ -192,13 +192,13 @@ ${e}` : e;
192
192
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
193
193
  return;
194
194
  const t = (s) => {
195
- var r;
196
- console.error(s.message, s.cause, "e.case"), ae.config({
195
+ var a;
196
+ console.error(s.message, s.cause, "e.case"), se.config({
197
197
  getContainer: () => (j == null ? void 0 : j.current) || document.body,
198
198
  prefixCls: "gbot-notification"
199
- }), ae.error({
200
- message: ((r = s.cause) == null ? void 0 : r.message) || s.message
201
- }), ae.config({
199
+ }), se.error({
200
+ message: ((a = s.cause) == null ? void 0 : a.message) || s.message
201
+ }), se.config({
202
202
  getContainer: void 0,
203
203
  prefixCls: "gbot-notification"
204
204
  });
@@ -207,150 +207,150 @@ ${e}` : e;
207
207
  e == null || e.removeEventListener("error", t);
208
208
  };
209
209
  }, [e]);
210
- const wn = () => {
210
+ const kn = () => {
211
211
  var s;
212
212
  if (!((s = e == null ? void 0 : e.data) != null && s.id) || !(o != null && o.id))
213
213
  return;
214
- const t = e.data.id, n = v[v.length - 1];
214
+ const t = e.data.id, n = y[y.length - 1];
215
215
  if (n && n.isContext) {
216
- T("success", "已开启新话题");
216
+ L("success", "已开启新话题");
217
217
  return;
218
218
  } else
219
219
  e.clear().then(() => {
220
- const r = new he("", t, ce.System);
221
- r.isContext = !0, E([r, ...v]);
220
+ const a = new he("", t, ae.System);
221
+ a.isContext = !0, E([a, ...y]);
222
222
  });
223
223
  };
224
224
  I(() => {
225
225
  o != null && o.id && (U == null || U.getRecommendQues(o.id).then((t) => {
226
- en(t);
226
+ tn(t);
227
227
  }));
228
- }, [Wt, o]);
228
+ }, [Kt, o]);
229
229
  const lt = (t) => M(void 0, null, function* () {
230
230
  var H, D;
231
231
  if (O) {
232
- T("error", "发送功能被禁用");
232
+ L("error", "发送功能被禁用");
233
233
  return;
234
234
  }
235
- const n = t || qt;
235
+ const n = t || Wt;
236
236
  if (!(n != null && n.trim())) {
237
- T("error", "请输入你想问的");
237
+ L("error", "请输入你想问的");
238
238
  return;
239
239
  }
240
- if (!(F == null ? void 0 : F.every((b) => !!(b != null && b.value))))
241
- if (d != null && d.promptVariables) {
242
- T("error", "变量值不能为空");
240
+ if (!(F == null ? void 0 : F.every((k) => !!(k != null && k.value))))
241
+ if (c != null && c.promptVariables) {
242
+ L("error", "变量值不能为空");
243
243
  return;
244
244
  } else
245
- console.error("变量值不能为空", F == null ? void 0 : F.map((b) => !!(b != null && b.value)));
246
- if (Re) {
247
- T("error", "正在回复中");
245
+ console.error("变量值不能为空", F == null ? void 0 : F.map((k) => !!(k != null && k.value)));
246
+ if (Oe) {
247
+ L("error", "正在回复中");
248
248
  return;
249
249
  }
250
250
  if (qe) {
251
- T("error", "等待初始化");
251
+ L("error", "等待初始化");
252
252
  return;
253
253
  }
254
- if (!cn) {
255
- T("error", "正在解析文件");
254
+ if (!dn) {
255
+ L("error", "正在解析文件");
256
256
  return;
257
257
  }
258
258
  if (Qe) {
259
- T("error", "正在上传图片");
259
+ L("error", "正在上传图片");
260
260
  return;
261
261
  }
262
262
  ve([]), we([]);
263
- const r = (H = e == null ? void 0 : e.data) == null ? void 0 : H.id;
264
- if (!r) {
263
+ const a = (H = e == null ? void 0 : e.data) == null ? void 0 : H.id;
264
+ if (!a) {
265
265
  if (Ce)
266
266
  return;
267
- Z(!0), k == null || k({
268
- netOpen: L ? X.OPEN : X.CLOSE
269
- }).then((b) => {
270
- var p, _;
271
- B(!0), P(!!((p = b.data) != null && p.netOpen)), oe(!!((_ = b.data) != null && _.enableNetOpen)), Ee(b).then(() => {
272
- y == null || y(b), B(!1), Be(n);
267
+ G(!0), b == null || b({
268
+ netOpen: P ? le.OPEN : le.CLOSE
269
+ }).then((k) => {
270
+ var u, B;
271
+ X(!0), T(!!((u = k.data) != null && u.netOpen)), pe(!!((B = k.data) != null && B.enableNetOpen)), Re(k).then(() => {
272
+ w == null || w(k), X(!1), Be(n);
273
273
  });
274
- }).catch((b) => {
275
- Z(!1);
274
+ }).catch((k) => {
275
+ G(!1);
276
276
  });
277
277
  return;
278
278
  }
279
279
  if (Ce)
280
280
  return;
281
- Z(!0), xe(!0);
282
- const i = ze(n, ee, ie[r], (o == null ? void 0 : o.type) || 0);
283
- let c;
281
+ G(!0), xe(!0);
282
+ const i = ze(n, S, ne[a], (o == null ? void 0 : o.type) || 0);
283
+ let d;
284
284
  try {
285
- W ? c = yield W == null ? void 0 : W({
285
+ q ? d = yield q == null ? void 0 : q({
286
286
  applicationId: o.id,
287
- sessionId: r,
287
+ sessionId: a,
288
288
  message: {
289
289
  content: i,
290
- sessionId: r,
291
- role: Mt.User,
292
- files: ie[r]
290
+ sessionId: a,
291
+ role: jt.User,
292
+ files: ne[a]
293
293
  }
294
- }) : c = !0;
295
- } catch (b) {
296
- c = !1;
294
+ }) : d = !0;
295
+ } catch (k) {
296
+ d = !1;
297
297
  }
298
- if (xe(!1), c === !1) {
299
- Z(!1);
298
+ if (xe(!1), d === !1) {
299
+ G(!1);
300
300
  return;
301
301
  }
302
- let a = n;
303
- typeof c == "object" && (a = c.content || n);
304
- const w = yield (() => new Promise((b) => {
305
- pe((p) => (b(p), p));
302
+ let r = n;
303
+ typeof d == "object" && (r = d.content || n);
304
+ const v = yield (() => new Promise((k) => {
305
+ ge((u) => (k(u), u));
306
306
  }))();
307
- if (!(yield e.setPromptVariables(w))) {
308
- Z(!1);
307
+ if (!(yield e.setPromptVariables(v))) {
308
+ G(!1);
309
309
  return;
310
310
  }
311
- ((D = ie[r]) == null ? void 0 : D.length) > 0 ? kn(a) : Ue(a);
312
- }), Ee = (t) => new Promise((n, s) => M(void 0, null, function* () {
313
- const c = (t == null ? void 0 : t.promptVariables).filter((a) => a.type ? !((a.type === Le.User || a.type === void 0) && a.key === "query") && !((a.type === Le.System || a.type === void 0) && a.key === "datetime") : a.key !== "query").map((a) => {
314
- var w;
315
- const u = (w = F.find((C) => C.key === a.key && C.type === a.type)) == null ? void 0 : w.value;
316
- return a.value = u || "", a;
311
+ ((D = ne[a]) == null ? void 0 : D.length) > 0 ? bn(r) : Ue(r);
312
+ }), Re = (t) => new Promise((n, s) => M(void 0, null, function* () {
313
+ const d = (t == null ? void 0 : t.promptVariables).filter((r) => r.type ? !((r.type === Ne.User || r.type === void 0) && r.key === "query") && !((r.type === Ne.System || r.type === void 0) && r.key === "datetime") : r.key !== "query").map((r) => {
314
+ var v;
315
+ const p = (v = F.find((C) => C.key === r.key && C.type === r.type)) == null ? void 0 : v.value;
316
+ return r.value = p || "", r;
317
317
  });
318
- pe(c.sort((a, u) => a.key.localeCompare(u.key))), yield t == null ? void 0 : t.setPromptVariables(c).catch((a) => {
319
- console.error(a), T("error", a.message);
318
+ ge(d.sort((r, p) => r.key.localeCompare(p.key))), yield t == null ? void 0 : t.setPromptVariables(d).catch((r) => {
319
+ console.error(r), L("error", r.message);
320
320
  }), n();
321
- })), kn = (t) => {
322
- var i, c, a;
321
+ })), bn = (t) => {
322
+ var i, d, r;
323
323
  if (be(!1), !((i = e == null ? void 0 : e.data) != null && i.id) || !(o != null && o.id))
324
324
  return;
325
- const n = ((c = e.data) == null ? void 0 : c.id) || "";
326
- let s = [], r = /* @__PURE__ */ new Set();
327
- (a = ie[n]) == null || a.forEach((u) => {
328
- r.has(u.id) || (s.push(u), r.add(u.id));
325
+ const n = ((d = e.data) == null ? void 0 : d.id) || "";
326
+ let s = [], a = /* @__PURE__ */ new Set();
327
+ (r = ne[n]) == null || r.forEach((p) => {
328
+ a.has(p.id) || (s.push(p), a.add(p.id));
329
329
  }), be(!0), Ue(t, s);
330
330
  };
331
331
  I(() => {
332
- if (!Pe || !e)
332
+ if (!Le || !e)
333
333
  return;
334
- const t = Pe, n = () => M(void 0, null, function* () {
334
+ const t = Le, n = () => M(void 0, null, function* () {
335
335
  xe(!0);
336
- const s = ze(t, ee, ie[e.id], (o == null ? void 0 : o.type) || 0);
337
- let r;
336
+ const s = ze(t, S, ne[e.id], (o == null ? void 0 : o.type) || 0);
337
+ let a;
338
338
  try {
339
- W ? r = yield W == null ? void 0 : W({
339
+ q ? a = yield q == null ? void 0 : q({
340
340
  applicationId: o.id,
341
341
  sessionId: e.id,
342
342
  message: {
343
343
  content: s,
344
344
  sessionId: e.id,
345
- role: Mt.User,
346
- files: ie[e.id]
345
+ role: jt.User,
346
+ files: ne[e.id]
347
347
  }
348
- }) : r = !0;
348
+ }) : a = !0;
349
349
  } catch (i) {
350
- r = !1;
350
+ a = !1;
351
351
  }
352
- if (xe(!1), r === !1) {
353
- Z(!1);
352
+ if (xe(!1), a === !1) {
353
+ G(!1);
354
354
  return;
355
355
  }
356
356
  Ue(t), Be(void 0);
@@ -358,84 +358,84 @@ ${e}` : e;
358
358
  return e.ready ? n() : e.addEventListener("ready", n, !0), () => {
359
359
  e == null || e.removeEventListener("ready", n);
360
360
  };
361
- }, [Pe, e]);
361
+ }, [Le, e]);
362
362
  const Ue = (t, n) => M(void 0, null, function* () {
363
- var H, D, b;
363
+ var H, D, k;
364
364
  const s = (H = e == null ? void 0 : e.data) == null ? void 0 : H.id;
365
365
  if (!s)
366
366
  return;
367
- K(!0), V(!0);
368
- const r = ze(t, ee, n, (o == null ? void 0 : o.type) || 0);
367
+ W(!0), V(!0);
368
+ const a = ze(t, S, n, (o == null ? void 0 : o.type) || 0);
369
369
  let i;
370
- if (o.type === G.Agent)
370
+ if (o.type === Q.Agent)
371
371
  i = void 0;
372
- else if (o.type === G.Dialog && ((D = o.arrange) != null && D.length) && o.arrange[0].visionOpen) {
373
- const p = ee && ee.length ? ee.filter(Boolean) : [];
374
- i = p.length ? p : void 0;
372
+ else if (o.type === Q.Dialog && ((D = o.arrange) != null && D.length) && o.arrange[0].visionOpen) {
373
+ const u = S && S.length ? S.filter(Boolean) : [];
374
+ i = u.length ? u : void 0;
375
375
  } else
376
376
  i = void 0;
377
- const c = new he(
378
- r,
377
+ const d = new he(
378
+ a,
379
379
  s,
380
- ce.User,
380
+ ae.User,
381
381
  n,
382
382
  i
383
383
  // 新增:传入图片内容
384
384
  );
385
- me(void 0), ne(void 0), m.current = [c, ...v], E(m.current), o.id && ye && ye({
385
+ me(void 0), te(void 0), m.current = [d, ...y], E(m.current), o.id && ye && ye({
386
386
  applicationId: o.id,
387
387
  sessionId: s,
388
- message: c
388
+ message: d
389
389
  });
390
- const a = new he("", s, ce.System);
391
- a.isWaiting = !0, m.current = [a, ...m.current], E(m.current);
392
- const u = (n == null ? void 0 : n.map((p) => p.id)) || [], w = {
390
+ const r = new he("", s, ae.System);
391
+ r.isWaiting = !0, m.current = [r, ...m.current], E(m.current);
392
+ const p = (n == null ? void 0 : n.map((u) => u.id)) || [], v = {
393
393
  stream: Gn.stream,
394
394
  referenceFirst: !1
395
395
  };
396
- if (d != null && d.promptVariables) {
397
- const p = F == null ? void 0 : F.reduce((_, re) => (_[re.key] = re.value, _), {});
398
- w.formatValues = p;
396
+ if (c != null && c.promptVariables) {
397
+ const u = F == null ? void 0 : F.reduce((B, oe) => (B[oe.key] = oe.value, B), {});
398
+ v.formatValues = u;
399
399
  }
400
- if (d != null && d.knowledges) {
401
- const p = pn;
402
- w.knowledges = p;
400
+ if (c != null && c.knowledges) {
401
+ const u = pn;
402
+ v.knowledges = u;
403
403
  }
404
404
  const C = {
405
- text: r,
406
- fileIds: u,
405
+ text: a,
406
+ fileIds: p,
407
407
  files: n
408
408
  };
409
- i && i.length > 0 && (C.imageContent = i), yield e.send(C, w), fe({
409
+ i && i.length > 0 && (C.imageContent = i), yield e.send(C, v), de({
410
410
  [s]: []
411
- }), (b = ge.current) == null || b.update(), ve([]), we([]), Z(!1);
411
+ }), (k = fe.current) == null || k.update(), ve([]), we([]), G(!1);
412
412
  });
413
413
  I(() => {
414
- var r;
415
- const t = (r = e == null ? void 0 : e.data) == null ? void 0 : r.id;
414
+ var a;
415
+ const t = (a = e == null ? void 0 : e.data) == null ? void 0 : a.id;
416
416
  if (!t)
417
417
  return;
418
418
  const n = (i) => {
419
- if (!i.sessionId || i.sessionId && i.sessionId !== We.current || i.role === ce.User)
419
+ if (!i.sessionId || i.sessionId && i.sessionId !== We.current || i.role === ae.User)
420
420
  return;
421
- if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (V(!1), K(!1), m.current = m.current.filter((u) => !u.isWaiting), E([...m.current]), m.current = [...m.current], i.content)) {
422
- ae.config({
421
+ if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (V(!1), W(!1), m.current = m.current.filter((p) => !p.isWaiting), E([...m.current]), m.current = [...m.current], i.content)) {
422
+ se.config({
423
423
  getContainer: () => (j == null ? void 0 : j.current) || document.body,
424
424
  prefixCls: "gbot-notification"
425
- }), ae.error({
425
+ }), se.error({
426
426
  message: i.content
427
- }), ae.config({
427
+ }), se.config({
428
428
  getContainer: void 0,
429
429
  prefixCls: "gbot-notification"
430
430
  });
431
431
  return;
432
432
  }
433
- const c = i.actions || [], a = new he(i.content, t, ce.Robot);
434
- a.messageId = i.messageId || Ve(), a.reasoningContent = i.reasoningContent, a.searchReference = i.searchReference, a.thinkingSecs = i.thinkingSecs, a.thinkingStatus = i.thinkingStatus, a.actions = c, a.isLoading = !0, a.searchingStatus = i.searchingStatus, m.current = m.current.filter((u) => !u.isWaiting).filter((u) => !u.isReplying), i.index === void 0 && E([a, ...m.current]), i.code === 11915 && (V(!1), K(!1), a.isLoading = !1, a.content = "请您换个问题问我吧~", a.isSensitive = !0, E([a, ...m.current])), i.index === -2 && (V(!1), K(!1), a.isLoading = !1, a.content = "回答已中止~", a.isSuspend = !0, E([a, ...m.current])), i.index === -1 && (V(!1), K(!1), a.isLoading = !1, a.reference = i.reference, E([a, ...m.current]), o.id && ye && ye({
433
+ const d = i.actions || [], r = new he(i.content, t, ae.Robot);
434
+ r.messageId = i.messageId || Ve(), r.reasoningContent = i.reasoningContent, r.searchReference = i.searchReference, r.thinkingSecs = i.thinkingSecs, r.thinkingStatus = i.thinkingStatus, r.actions = d, r.isLoading = !0, r.searchingStatus = i.searchingStatus, m.current = m.current.filter((p) => !p.isWaiting).filter((p) => !p.isReplying), i.index === void 0 && E([r, ...m.current]), i.code === 11915 && (V(!1), W(!1), r.isLoading = !1, r.content = "请您换个问题问我吧~", r.isSensitive = !0, E([r, ...m.current])), i.index === -2 && (V(!1), W(!1), r.isLoading = !1, r.content = "回答已中止~", r.isSuspend = !0, E([r, ...m.current])), i.index === -1 && (V(!1), W(!1), r.isLoading = !1, r.reference = i.reference, E([r, ...m.current]), o.id && ye && ye({
435
435
  applicationId: o.id,
436
436
  sessionId: t,
437
- message: a
438
- })), i.index === -3 && (V(!1), K(!1), a.isLoading = !1, a.reference = i.reference, a.relatedQuesion = i.relatedQuesion, E([a, ...m.current]));
437
+ message: r
438
+ })), i.index === -3 && (V(!1), W(!1), r.isLoading = !1, r.reference = i.reference, r.relatedQuesion = i.relatedQuesion, E([r, ...m.current]));
439
439
  }, s = () => {
440
440
  e.addEventListener("message:updated", n);
441
441
  };
@@ -444,118 +444,118 @@ ${e}` : e;
444
444
  };
445
445
  }, [e]), I(() => {
446
446
  if (!e) {
447
- De(!1);
447
+ Te(!1);
448
448
  return;
449
449
  }
450
450
  const t = (n) => {
451
- De(n);
451
+ Te(n);
452
452
  };
453
- return De(e.frozen), e.addEventListener("frozen", t), () => {
453
+ return Te(e.frozen), e.addEventListener("frozen", t), () => {
454
454
  e == null || e.removeEventListener("frozen", t);
455
455
  };
456
456
  }, [e]), I(() => {
457
457
  if (!N)
458
458
  return;
459
459
  const t = N.questionContextMaxLength || 4e3;
460
- Jt(t);
460
+ St(t);
461
461
  }, [N, U]), I(() => {
462
- Te && ne(Te.text);
463
- }, [Te]), I(() => {
464
- Ht.config({
462
+ Pe && te(Pe.text);
463
+ }, [Pe]), I(() => {
464
+ At.config({
465
465
  getContainer: () => (j == null ? void 0 : j.current) || document.body,
466
466
  prefixCls: "gbot-message",
467
467
  maxCount: 5
468
468
  });
469
469
  }, [j]);
470
- const T = (t, n, s) => {
471
- Ht.open({
470
+ const L = (t, n, s) => {
471
+ At.open({
472
472
  type: t,
473
473
  content: n,
474
474
  key: s
475
475
  });
476
476
  }, ct = (t) => {
477
477
  const n = t.size;
478
- return n <= 0 ? (T("error", "该文件为空,请重新上传"), !1) : n > $e * Zn ? (T("error", `图片须小于${$e}M`), !1) : (ve((s) => s.length >= S ? (T("warning", `图片最多上传${S}张`), s) : [...s, t]), !1);
479
- }, bn = () => {
478
+ return n <= 0 ? (L("error", "该文件为空,请重新上传"), !1) : n > $e * Zn ? (L("error", `图片须小于${$e}M`), !1) : (ve((s) => s.length >= J ? (L("warning", `图片最多上传${J}张`), s) : [...s, t]), !1);
479
+ }, xn = () => {
480
480
  var t;
481
- return (o.type === G.Agent && (d == null ? void 0 : d.imageUpload) || o.type === G.Dialog && ((t = o.arrange) == null ? void 0 : t.length) && !!o.arrange[0].visionOpen && (d == null ? void 0 : d.imageUpload)) && !O;
482
- }, xn = () => !!z && (d == null ? void 0 : d.fileUpload) && (o == null ? void 0 : o.id) && !O, dt = (t) => {
483
- var D, b;
481
+ return (o.type === Q.Agent && (c == null ? void 0 : c.imageUpload) || o.type === Q.Dialog && ((t = o.arrange) == null ? void 0 : t.length) && !!o.arrange[0].visionOpen && (c == null ? void 0 : c.imageUpload)) && !O;
482
+ }, Cn = () => !!z && (c == null ? void 0 : c.fileUpload) && (o == null ? void 0 : o.id) && !O, dt = (t) => {
483
+ var D, k;
484
484
  const n = Array.from(t || []).filter(Boolean);
485
485
  if (!n.length)
486
486
  return;
487
- const s = bn(), r = xn(), i = [], c = [];
488
- let a = 0, u = 0, w = 0;
489
- n.forEach((p) => {
490
- var Ot, Rt, Ut;
491
- if (((Ot = p.type) == null ? void 0 : Ot.startsWith("image/")) || !!$t(p.name)) {
492
- s ? i.push(p) : a++;
487
+ const s = xn(), a = Cn(), i = [], d = [];
488
+ let r = 0, p = 0, v = 0;
489
+ n.forEach((u) => {
490
+ var Rt, Ut, Ft;
491
+ if (((Rt = u.type) == null ? void 0 : Rt.startsWith("image/")) || !!zt(u.name)) {
492
+ s ? i.push(u) : r++;
493
493
  return;
494
494
  }
495
- const re = (Ut = (Rt = p.name) == null ? void 0 : Rt.split(".").pop()) == null ? void 0 : Ut.toLowerCase();
496
- if (ei.includes(p.type) || ["pdf", "doc", "docx"].includes(re || "")) {
497
- r ? c.push(p) : u++;
495
+ const oe = (Ft = (Ut = u.name) == null ? void 0 : Ut.split(".").pop()) == null ? void 0 : Ft.toLowerCase();
496
+ if (ei.includes(u.type) || ["pdf", "doc", "docx"].includes(oe || "")) {
497
+ a ? d.push(u) : p++;
498
498
  return;
499
499
  }
500
- w++;
500
+ v++;
501
501
  });
502
- const C = [], H = a + u + w;
503
- if (!r && !s)
502
+ const C = [], H = r + p + v;
503
+ if (!a && !s)
504
504
  H && C.push(`当前不支持上传文件/图片,已忽略${H}个文件`);
505
- else if (r && !s) {
506
- const p = a + w;
507
- p && C.push(`仅支持上传 .doc/.docx/.pdf 文件,已忽略${p}个其他类型文件`);
508
- } else if (!r && s) {
509
- const p = u + w;
510
- p && C.push(`仅支持上传图片(.jpg/.jpeg/.png/.bmp),已忽略${p}个其他类型文件`);
505
+ else if (a && !s) {
506
+ const u = r + v;
507
+ u && C.push(`仅支持上传 .doc/.docx/.pdf 文件,已忽略${u}个其他类型文件`);
508
+ } else if (!a && s) {
509
+ const u = p + v;
510
+ u && C.push(`仅支持上传图片(.jpg/.jpeg/.png/.bmp),已忽略${u}个其他类型文件`);
511
511
  } else
512
- w && C.push(`存在不支持的文件类型,已忽略${w}个文件`);
513
- if (C.length && T("warning", C.join(";"), "precheck-warn"), i.length) {
514
- const p = Math.max(0, S - de.length), _ = i.slice(0, p);
515
- _.forEach((re) => ct(re)), i.length > _.length && T("warning", `最多上传${S}张图片`);
512
+ v && C.push(`存在不支持的文件类型,已忽略${v}个文件`);
513
+ if (C.length && L("warning", C.join(";"), "precheck-warn"), i.length) {
514
+ const u = Math.max(0, J - ce.length), B = i.slice(0, u);
515
+ B.forEach((oe) => ct(oe)), i.length > B.length && L("warning", `最多上传${J}张图片`);
516
516
  }
517
- c.length && ((b = (D = ge.current) == null ? void 0 : D.appendFiles) == null || b.call(D, c));
517
+ d.length && ((k = (D = fe.current) == null ? void 0 : D.appendFiles) == null || k.call(D, d));
518
518
  }, ft = (t) => {
519
519
  var s;
520
520
  const n = (s = t.clipboardData) == null ? void 0 : s.files;
521
521
  n && n.length && (t.preventDefault(), t.stopPropagation(), dt(n));
522
522
  }, gt = (t) => {
523
523
  t.preventDefault();
524
- }, pt = (t) => {
524
+ }, ut = (t) => {
525
525
  var s;
526
526
  t.preventDefault(), t.stopPropagation();
527
527
  const n = (s = t.dataTransfer) == null ? void 0 : s.files;
528
528
  n && n.length && dt(n);
529
- }, Cn = () => M(void 0, null, function* () {
529
+ }, pt = () => M(void 0, null, function* () {
530
530
  var t;
531
- return (t = e == null ? void 0 : e.data) != null && t.id ? e : (se.current || (se.current = new Promise((n, s) => {
532
- B(!0), k == null || k({
533
- netOpen: L ? X.OPEN : X.CLOSE
534
- }).then((r) => {
535
- var i, c;
536
- y == null || y(r), B(!1), P(!!((i = r.data) != null && i.netOpen)), oe(!!((c = r.data) != null && c.enableNetOpen)), Ee(r), n(r);
537
- }).catch((r) => {
538
- se.current = null, s(r);
531
+ return (t = e == null ? void 0 : e.data) != null && t.id ? e : (ie.current || (ie.current = new Promise((n, s) => {
532
+ X(!0), b == null || b({
533
+ netOpen: P ? le.OPEN : le.CLOSE
534
+ }).then((a) => {
535
+ var i, d;
536
+ w == null || w(a), X(!1), T(!!((i = a.data) != null && i.netOpen)), pe(!!((d = a.data) != null && d.enableNetOpen)), Re(a), n(a);
537
+ }).catch((a) => {
538
+ ie.current = null, s(a);
539
539
  });
540
- })), se.current);
540
+ })), ie.current);
541
541
  }), In = (t) => M(void 0, null, function* () {
542
- const n = yield Cn();
542
+ const n = yield pt();
543
543
  return En(n, t);
544
544
  }), En = (t, n) => {
545
- const s = $t(n.name);
546
- return new Promise((r) => {
547
- var c;
545
+ const s = zt(n.name);
546
+ return new Promise((a) => {
547
+ var d;
548
548
  const i = {
549
549
  files: [`${Ve()}.${s}`],
550
550
  isv: "minio",
551
- knowledgeId: ((c = t.data) == null ? void 0 : c.id) || "",
551
+ knowledgeId: ((d = t.data) == null ? void 0 : d.id) || "",
552
552
  type: 1
553
553
  };
554
- U == null || U.postTicket(i).then((a) => {
555
- U.uploadMinioFile(a.minio, n).then(() => {
554
+ U == null || U.postTicket(i).then((r) => {
555
+ U.uploadMinioFile(r.minio, n).then(() => {
556
556
  var H, D;
557
- const u = (H = a.minio.endpoints) == null ? void 0 : H[0], w = a.minio.bucket, C = (D = a.minio.fileKeys) == null ? void 0 : D[0];
558
- r(`${a.minio.useSSL ? "https:" : location.protocol}//${u}/${w}/${C}`);
557
+ const p = (H = r.minio.endpoints) == null ? void 0 : H[0], v = r.minio.bucket, C = (D = r.minio.fileKeys) == null ? void 0 : D[0];
558
+ a(`${r.minio.useSSL ? "https:" : location.protocol}//${p}/${v}/${C}`);
559
559
  }).catch(() => {
560
560
  });
561
561
  }).catch(() => {
@@ -567,16 +567,16 @@ ${e}` : e;
567
567
  t && !tt && t.scrollTo({
568
568
  top: t.scrollHeight
569
569
  });
570
- }, [v]);
571
- const ut = (t, n) => new Promise((s) => {
570
+ }, [y]);
571
+ const ht = (t, n) => new Promise((s) => {
572
572
  if (!n.file.url || !(o != null && o.id))
573
573
  return s();
574
- const r = Me(Ae({}, n.file), {
574
+ const a = Me(Ae({}, n.file), {
575
575
  type: 1
576
576
  });
577
- U == null || U.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, r).finally(() => {
577
+ U == null || U.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, a).finally(() => {
578
578
  var i;
579
- (i = ge.current) == null || i.update().finally(s);
579
+ (i = fe.current) == null || i.update().finally(s);
580
580
  });
581
581
  }), Nn = () => {
582
582
  var t;
@@ -593,7 +593,7 @@ ${e}` : e;
593
593
  if (!R.current)
594
594
  return;
595
595
  const t = R.current.scrollTop <= -80;
596
- gn(t);
596
+ un(t);
597
597
  }, Tn = je((t) => {
598
598
  var n, s;
599
599
  (n = ke.current) == null || n.update(t), (s = ke.current) == null || s.focus();
@@ -603,44 +603,44 @@ ${e}` : e;
603
603
  var n;
604
604
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
605
605
  return;
606
- m.current = [...v.slice(1, v.length)], E(m.current);
607
- const t = new he("", e.data.id, ce.System);
608
- t.isWaiting = !0, m.current = [t, ...m.current], E(m.current), K(!0), V(!0), e.answerAgain();
606
+ m.current = [...y.slice(1, y.length)], E(m.current);
607
+ const t = new he("", e.data.id, ae.System);
608
+ t.isWaiting = !0, m.current = [t, ...m.current], E(m.current), W(!0), V(!0), e.answerAgain();
609
609
  });
610
610
  I(() => {
611
611
  var t, n;
612
- We.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !nt && ((n = Oe.current) == null || n.clear());
612
+ We.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !nt && ((n = De.current) == null || n.clear());
613
613
  }, [e]);
614
614
  const Rn = () => {
615
615
  var s;
616
616
  if (!((s = e == null ? void 0 : e.data) != null && s.id))
617
617
  return;
618
- const n = v[v.length - 1].messageTime;
618
+ const n = y[y.length - 1].messageTime;
619
619
  e.fetchMessages({
620
620
  endTime: n,
621
- pageSize: Vt
622
- }).then((r) => {
623
- const i = r || [];
621
+ pageSize: Bt
622
+ }).then((a) => {
623
+ const i = a || [];
624
624
  if (!i || !(i != null && i.length)) {
625
625
  ue(!1);
626
626
  return;
627
627
  }
628
- i.length < 10 ? ue(!1) : ue(!0), E([...v, ...i.reverse()]);
628
+ i.length < 10 ? ue(!1) : ue(!0), E([...y, ...i.reverse()]);
629
629
  });
630
630
  }, Un = (t) => M(void 0, null, function* () {
631
631
  var n, s;
632
632
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
633
- P(t);
633
+ T(t);
634
634
  else {
635
635
  if (yield e.setNetOpen(t), !((s = e.data) != null && s.id))
636
636
  return;
637
- P(t);
637
+ T(t);
638
638
  }
639
639
  }), Fe = () => M(void 0, null, function* () {
640
640
  e ? e.fetchData().then((t) => {
641
641
  var n;
642
- (n = e == null ? void 0 : e.data) != null && n.id && (P(t.netOpen), oe(t.enableNetOpen));
643
- }) : (P(typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.default) == "boolean" ? l.connectNetwork.default : !1), oe(o.arrange[0].enableNetOpen));
642
+ (n = e == null ? void 0 : e.data) != null && n.id && (T(t.netOpen), pe(t.enableNetOpen));
643
+ }) : (T(typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.default) == "boolean" ? l.connectNetwork.default : !1), pe(o.arrange[0].enableNetOpen));
644
644
  });
645
645
  I(() => {
646
646
  Fe();
@@ -648,11 +648,11 @@ ${e}` : e;
648
648
  requestAnimationFrame(() => {
649
649
  var n, s;
650
650
  if (R.current) {
651
- const r = document.getElementById("chat-main"), i = (n = R.current) == null ? void 0 : n.querySelector(".infinite-scroll-component__outerdiv"), c = (s = R.current) == null ? void 0 : s.querySelector(".infinite-scroll-component");
652
- if (!i || !c || !r)
651
+ const a = document.getElementById("chat-main"), i = (n = R.current) == null ? void 0 : n.querySelector(".infinite-scroll-component__outerdiv"), d = (s = R.current) == null ? void 0 : s.querySelector(".infinite-scroll-component");
652
+ if (!i || !d || !a)
653
653
  return;
654
- const a = r.offsetHeight;
655
- if (c.offsetHeight <= a) {
654
+ const r = a.offsetHeight;
655
+ if (d.offsetHeight <= r) {
656
656
  if (i.style.height === "100%")
657
657
  return;
658
658
  i.style.height = "100%";
@@ -663,35 +663,35 @@ ${e}` : e;
663
663
  }
664
664
  }
665
665
  });
666
- }, [v]), I(() => {
666
+ }, [y]), I(() => {
667
667
  if (e)
668
668
  return;
669
669
  const t = () => {
670
- const r = ((N == null ? void 0 : N.promptVariables) || []).filter((i) => i.type ? !(i.type === Le.User && i.key === "query") && !(i.type === Le.System && i.key === "datetime") && i.status === 1 : i.key !== "query" && i.status === 1).map((i, c) => {
671
- var u, w;
672
- let a = "";
673
- return typeof (l == null ? void 0 : l.promptVariables) == "object" && (a = ((w = (u = l.promptVariables.default) == null ? void 0 : u.find((C) => C.key === i.key && C.type === i.type)) == null ? void 0 : w.value) || ""), {
674
- id: c + "",
670
+ const a = ((N == null ? void 0 : N.promptVariables) || []).filter((i) => i.type ? !(i.type === Ne.User && i.key === "query") && !(i.type === Ne.System && i.key === "datetime") && i.status === 1 : i.key !== "query" && i.status === 1).map((i, d) => {
671
+ var p, v;
672
+ let r = "";
673
+ return typeof (l == null ? void 0 : l.promptVariables) == "object" && (r = ((v = (p = l.promptVariables.default) == null ? void 0 : p.find((C) => C.key === i.key && C.type === i.type)) == null ? void 0 : v.value) || ""), {
674
+ id: d + "",
675
675
  key: i.key,
676
676
  name: i.name,
677
- value: a,
677
+ value: r,
678
678
  type: i.type
679
679
  };
680
680
  });
681
- pe([...r].sort((i, c) => i.key.localeCompare(c.key)));
681
+ ge([...a].sort((i, d) => i.key.localeCompare(d.key)));
682
682
  };
683
683
  return N != null && N.ready ? t() : N == null || N.addEventListener("ready", t), () => {
684
684
  N == null || N.removeEventListener("ready", t);
685
685
  };
686
686
  }, [e, N, l == null ? void 0 : l.promptVariables]);
687
- const ht = () => k == null ? void 0 : k({
688
- netOpen: L ? X.OPEN : X.CLOSE
687
+ const mt = () => b == null ? void 0 : b({
688
+ netOpen: P ? le.OPEN : le.CLOSE
689
689
  }).then((t) => {
690
690
  var n, s;
691
- return y == null || y(t), B(!1), P(!!((n = t.data) != null && n.netOpen)), oe(!!((s = t.data) != null && s.enableNetOpen)), Ee(t), t;
692
- }), mt = _n(() => {
691
+ return w == null || w(t), X(!1), T(!!((n = t.data) != null && n.netOpen)), pe(!!((s = t.data) != null && s.enableNetOpen)), Re(t), t;
692
+ }), yt = _n(() => {
693
693
  var t;
694
- return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ f(Bt, {
694
+ return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ f(_t, {
695
695
  application: o,
696
696
  history: {
697
697
  role: 1,
@@ -701,14 +701,14 @@ ${e}` : e;
701
701
  sessionId: "",
702
702
  reference: [],
703
703
  searchReference: [],
704
- messageTime: _t(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
704
+ messageTime: qt(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
705
705
  actions: [],
706
706
  isLoading: !1
707
707
  },
708
- actions: !!v.length,
708
+ actions: !!y.length,
709
709
  markdown: l == null ? void 0 : l.markdown
710
710
  }) : null;
711
- }, [o == null ? void 0 : o.arrange, v]);
711
+ }, [o == null ? void 0 : o.arrange, y]);
712
712
  return qn(h, () => ({
713
713
  getCurrentInputText: () => {
714
714
  var t;
@@ -717,26 +717,26 @@ ${e}` : e;
717
717
  })), I(() => {
718
718
  var n;
719
719
  const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
720
- t && fe((s) => Me(Ae({}, s), {
720
+ t && de((s) => Me(Ae({}, s), {
721
721
  [t]: []
722
722
  }));
723
- }, [(yt = e == null ? void 0 : e.data) == null ? void 0 : yt.id]), /* @__PURE__ */ q("div", {
723
+ }, [(vt = e == null ? void 0 : e.data) == null ? void 0 : vt.id]), /* @__PURE__ */ _("div", {
724
724
  className: "agent-chat",
725
- children: [mn ? /* @__PURE__ */ f("div", {
725
+ children: [yn ? /* @__PURE__ */ f("div", {
726
726
  className: "session-loading",
727
- children: /* @__PURE__ */ f(At, {})
728
- }) : /* @__PURE__ */ q($n, {
729
- children: [(d == null ? void 0 : d.promptVariables) && /* @__PURE__ */ f(li, {
727
+ children: /* @__PURE__ */ f(Mt, {})
728
+ }) : /* @__PURE__ */ _($n, {
729
+ children: [(c == null ? void 0 : c.promptVariables) && /* @__PURE__ */ f(li, {
730
730
  ref: Je,
731
731
  appId: o.id,
732
732
  currentSession: e,
733
733
  promptVariables: F,
734
- setPromptVariables: pe,
735
- setCurrentSession: y
736
- }), /* @__PURE__ */ q("div", {
734
+ setPromptVariables: ge,
735
+ setCurrentSession: w
736
+ }), /* @__PURE__ */ _("div", {
737
737
  className: "chat-main",
738
738
  id: "chat-main",
739
- style: Yt,
739
+ style: Qt,
740
740
  children: [/* @__PURE__ */ f("div", {
741
741
  className: "chat-main-wrapper",
742
742
  id: "scrollableDiv",
@@ -748,8 +748,8 @@ ${e}` : e;
748
748
  },
749
749
  ref: R,
750
750
  onScroll: Pn,
751
- children: (vt = e == null ? void 0 : e.data) != null && vt.id && (v != null && v.length) ? /* @__PURE__ */ q(fi, {
752
- dataLength: v.length,
751
+ children: (wt = e == null ? void 0 : e.data) != null && wt.id && (y != null && y.length) ? /* @__PURE__ */ _(fi, {
752
+ dataLength: y.length,
753
753
  next: Rn,
754
754
  style: {
755
755
  display: "flex",
@@ -757,8 +757,8 @@ ${e}` : e;
757
757
  overflowX: "hidden"
758
758
  },
759
759
  inverse: !0,
760
- endMessage: v.length > Vt && // 少于一页不展示这个提示
761
- ((wt = R.current) != null && wt.scrollTop) && ((kt = R.current) == null ? void 0 : kt.scrollTop) < -10 ? /* @__PURE__ */ f(Wn, {
760
+ endMessage: y.length > Bt && // 少于一页不展示这个提示
761
+ ((kt = R.current) != null && kt.scrollTop) && ((bt = R.current) == null ? void 0 : bt.scrollTop) < -10 ? /* @__PURE__ */ f(Wn, {
762
762
  plain: !0,
763
763
  children: "没有更多数据了"
764
764
  }) : null,
@@ -769,10 +769,10 @@ ${e}` : e;
769
769
  textAlign: "center",
770
770
  overflow: "hidden"
771
771
  },
772
- children: /* @__PURE__ */ f(At, {})
772
+ children: /* @__PURE__ */ f(Mt, {})
773
773
  }),
774
774
  scrollableTarget: "scrollableDiv",
775
- children: [v.map((t, n) => /* @__PURE__ */ f(mi, {
775
+ children: [y.map((t, n) => /* @__PURE__ */ f(mi, {
776
776
  application: o,
777
777
  currentSession: e,
778
778
  history: t,
@@ -782,58 +782,58 @@ ${e}` : e;
782
782
  onAgainClick: On,
783
783
  onEditClick: Tn,
784
784
  markdown: l == null ? void 0 : l.markdown
785
- }, t.messageId + n)), !it && mt]
786
- }) : /* @__PURE__ */ q("div", {
785
+ }, t.messageId + n)), !it && yt]
786
+ }) : /* @__PURE__ */ _("div", {
787
787
  className: "main-empty",
788
788
  children: [(l == null ? void 0 : l.greeting) !== !1 && /* @__PURE__ */ f(ii, {
789
789
  text: (
790
790
  // 第一优先级:features配置
791
791
  l != null && l.greeting && typeof l.greeting == "object" && l.greeting.text !== void 0 ? l.greeting.text : (
792
792
  // 第二优先级:application.arrange[0].greetings
793
- (bt = o.arrange) != null && bt.length && ((xt = o.arrange[0]) != null && xt.greetings) ? o.arrange[0].greetings : (
793
+ (xt = o.arrange) != null && xt.length && ((Ct = o.arrange[0]) != null && Ct.greetings) ? o.arrange[0].greetings : (
794
794
  // 第三优先级:默认文本
795
- zt.text
795
+ Vt.text
796
796
  )
797
797
  )
798
798
  ),
799
- icon: l === void 0 || l.greeting === !0 || ((Ct = l.greeting) == null ? void 0 : Ct.icon) === void 0 ? Qt || zt.icon : l.greeting.icon,
799
+ icon: l === void 0 || l.greeting === !0 || ((It = l.greeting) == null ? void 0 : It.icon) === void 0 ? Xt || Vt.icon : l.greeting.icon,
800
800
  children: !!Xe.length && (((l == null ? void 0 : l.greeting) === void 0 || (l == null ? void 0 : l.greeting)) === !0 || typeof (l == null ? void 0 : l.greeting) == "object" && l.greeting.questions !== !1) && /* @__PURE__ */ f(ni, {
801
- ref: Oe,
802
- sid: (It = e == null ? void 0 : e.data) == null ? void 0 : It.id,
801
+ ref: De,
802
+ sid: (Et = e == null ? void 0 : e.data) == null ? void 0 : Et.id,
803
803
  isRecommendClearing: Ge,
804
804
  data: Xe,
805
805
  layoutBreakpoints: typeof (l == null ? void 0 : l.greeting) == "object" ? l.greeting.layoutBreakpoints : void 0,
806
806
  onItemClick: (t) => {
807
- var s, r, i;
808
- if (me(t == null ? void 0 : t.question), ne(t == null ? void 0 : t.question), Ge)
807
+ var s, a, i;
808
+ if (me(t == null ? void 0 : t.question), te(t == null ? void 0 : t.question), Ge)
809
809
  return;
810
- t != null && t.id && te(!0);
810
+ t != null && t.id && ee(!0);
811
811
  const n = (s = e == null ? void 0 : e.data) == null ? void 0 : s.id;
812
- d != null && d.fileUpload ? (i = (r = ge.current) == null ? void 0 : r.clear()) == null || i.then(() => {
813
- var c, a;
814
- t != null && t.id && (n ? (c = ut(n, t)) == null || c.finally(() => {
815
- te(!1);
816
- }) : (te(!1), B(!0), (a = ht()) == null || a.then((u) => {
817
- var w;
818
- (w = ut(u.id, t)) == null || w.finally(() => {
819
- te(!1);
812
+ c != null && c.fileUpload ? (i = (a = fe.current) == null ? void 0 : a.clear()) == null || i.then(() => {
813
+ var d, r;
814
+ t != null && t.id && (n ? (d = ht(n, t)) == null || d.finally(() => {
815
+ ee(!1);
816
+ }) : (ee(!1), X(!0), (r = mt()) == null || r.then((p) => {
817
+ var v;
818
+ (v = ht(p.id, t)) == null || v.finally(() => {
819
+ ee(!1);
820
820
  });
821
821
  })));
822
- }) : n ? te(!1) : (te(!1), B(!0), ht());
822
+ }) : n ? ee(!1) : (ee(!1), X(!0), mt());
823
823
  }
824
824
  })
825
- }), mt]
825
+ }), yt]
826
826
  })
827
827
  }), et && /* @__PURE__ */ f("div", {
828
828
  className: "session-stop",
829
- children: /* @__PURE__ */ f(J, {
829
+ children: /* @__PURE__ */ f(Z, {
830
830
  type: "primary",
831
831
  style: {
832
832
  background: "white"
833
833
  },
834
834
  ghost: !0,
835
835
  size: "small",
836
- icon: /* @__PURE__ */ f(le, {
836
+ icon: /* @__PURE__ */ f(re, {
837
837
  type: "icon-zantinghuida",
838
838
  style: {
839
839
  fontSize: 16
@@ -842,15 +842,15 @@ ${e}` : e;
842
842
  onClick: () => Nn(),
843
843
  children: "停止回答"
844
844
  })
845
- }), tt && (v == null ? void 0 : v.length) > 0 && /* @__PURE__ */ f("div", {
845
+ }), tt && (y == null ? void 0 : y.length) > 0 && /* @__PURE__ */ f("div", {
846
846
  className: "back-bottom",
847
- children: /* @__PURE__ */ f(J, {
847
+ children: /* @__PURE__ */ f(Z, {
848
848
  size: "small",
849
849
  onClick: () => Ln({
850
850
  behavior: "smooth"
851
851
  }),
852
852
  type: "link",
853
- icon: /* @__PURE__ */ f(le, {
853
+ icon: /* @__PURE__ */ f(re, {
854
854
  type: "icon-yijianhuidaodibu",
855
855
  style: {
856
856
  fontSize: 24
@@ -860,53 +860,53 @@ ${e}` : e;
860
860
  })]
861
861
  }), /* @__PURE__ */ f("div", {
862
862
  className: "chat-footer",
863
- children: /* @__PURE__ */ q("div", {
863
+ children: /* @__PURE__ */ _("div", {
864
864
  className: "chat-footer-input",
865
- children: [de.length > 0 && /* @__PURE__ */ f("div", {
865
+ children: [ce.length > 0 && /* @__PURE__ */ f("div", {
866
866
  className: "input-files",
867
- children: de.map((t, n) => /* @__PURE__ */ f(Jn, {
867
+ children: ce.map((t, n) => /* @__PURE__ */ f(Jn, {
868
868
  className: "thumb-40",
869
869
  file: t,
870
870
  actions: {
871
871
  upload: (s) => M(void 0, null, function* () {
872
- Ye((r) => r + 1);
872
+ Ye((a) => a + 1);
873
873
  try {
874
874
  return yield In(s);
875
875
  } finally {
876
- Ye((r) => Math.max(0, r - 1));
876
+ Ye((a) => Math.max(0, a - 1));
877
877
  }
878
878
  }),
879
879
  remove: () => {
880
- ve((s) => s.filter((r, i) => i !== n)), we((s) => s.filter((r, i) => i !== n));
880
+ ve((s) => s.filter((a, i) => i !== n)), we((s) => s.filter((a, i) => i !== n));
881
881
  }
882
882
  },
883
883
  onUrlChange: (s) => {
884
- we((r) => {
885
- const i = [...r];
884
+ we((a) => {
885
+ const i = [...a];
886
886
  return i[n] = s, i;
887
887
  });
888
888
  }
889
889
  }, n))
890
- }), /* @__PURE__ */ q(Ne, {
890
+ }), /* @__PURE__ */ _(Ee, {
891
891
  className: "footer-upload-action",
892
892
  onClick: (t) => t.preventDefault(),
893
- children: [/* @__PURE__ */ q(Ne, {
894
- children: [(o.type === G.Agent && (d == null ? void 0 : d.imageUpload) || o.type === G.Dialog && ((Et = o.arrange) == null ? void 0 : Et.length) && !!o.arrange[0].visionOpen && (d == null ? void 0 : d.imageUpload)) && /* @__PURE__ */ f(Kn, {
893
+ children: [/* @__PURE__ */ _(Ee, {
894
+ children: [(o.type === Q.Agent && (c == null ? void 0 : c.imageUpload) || o.type === Q.Dialog && ((Nt = o.arrange) == null ? void 0 : Nt.length) && !!o.arrange[0].visionOpen && (c == null ? void 0 : c.imageUpload)) && /* @__PURE__ */ f(Kn, {
895
895
  multiple: !0,
896
- disabled: de.length >= S || O,
896
+ disabled: ce.length >= J || O,
897
897
  accept: ".jpg, .png, .jpeg,.bmp",
898
898
  listType: "picture-card",
899
899
  beforeUpload: ct,
900
900
  className: "footer-upload-picture",
901
901
  showUploadList: !1,
902
- children: de.length < S ? /* @__PURE__ */ f(Yn, {
902
+ children: ce.length < J ? /* @__PURE__ */ f(Yn, {
903
903
  placement: "topLeft",
904
904
  overlayClassName: "footer-upload-tooltip",
905
905
  title: /* @__PURE__ */ f("div", {
906
906
  children: `支持上传.jpg .png .jpeg
907
- .bmp格式的图片数据,单文件最大${$e}M,最多${S}张`
907
+ .bmp格式的图片数据,单文件最大${$e}M,最多${J}张`
908
908
  }),
909
- children: /* @__PURE__ */ f(J, {
909
+ children: /* @__PURE__ */ f(Z, {
910
910
  type: "text",
911
911
  className: "camera-out-btn",
912
912
  style: {
@@ -914,7 +914,7 @@ ${e}` : e;
914
914
  position: "relative",
915
915
  bottom: "-2px"
916
916
  },
917
- icon: /* @__PURE__ */ f(le, {
917
+ icon: /* @__PURE__ */ f(re, {
918
918
  type: "icon-shangchuantupian",
919
919
  className: "icon-tianjia",
920
920
  style: {
@@ -922,7 +922,7 @@ ${e}` : e;
922
922
  }
923
923
  })
924
924
  })
925
- }) : /* @__PURE__ */ f(J, {
925
+ }) : /* @__PURE__ */ f(Z, {
926
926
  type: "text",
927
927
  className: "camera-out-btn",
928
928
  style: {
@@ -931,7 +931,7 @@ ${e}` : e;
931
931
  bottom: "-2px"
932
932
  },
933
933
  disabled: !0,
934
- icon: /* @__PURE__ */ f(le, {
934
+ icon: /* @__PURE__ */ f(re, {
935
935
  type: "icon-shangchuantupian",
936
936
  className: "icon-tianjia",
937
937
  style: {
@@ -939,80 +939,74 @@ ${e}` : e;
939
939
  }
940
940
  })
941
941
  })
942
- }), z && (d != null && d.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ f(ri, {
942
+ }), z && (c != null && c.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ f(ri, {
943
943
  appId: o == null ? void 0 : o.id,
944
- ref: ge,
944
+ ref: fe,
945
945
  isFirstSession: nt,
946
946
  docViewerUrl: $,
947
947
  onStatusChange: (t) => M(void 0, null, function* () {
948
948
  t !== "process" ? (be(!0), Fe()) : be(!1);
949
949
  }),
950
- createSession: () => new Promise((t) => {
951
- B(!0), k == null || k({
952
- netOpen: L ? X.OPEN : X.CLOSE
953
- }).then((n) => {
954
- var r, i, c;
955
- y == null || y(n), B(!1), P(!!((r = n.data) != null && r.netOpen)), oe(!!((i = n.data) != null && i.enableNetOpen)), Ee(n);
956
- const s = ((c = n.data) == null ? void 0 : c.id) || "";
957
- t(s);
958
- });
950
+ createSession: () => pt().then((t) => {
951
+ var s;
952
+ return ((s = t.data) == null ? void 0 : s.id) || "";
959
953
  }),
960
- sid: (Nt = e == null ? void 0 : e.data) == null ? void 0 : Nt.id,
961
- disabled: Re || O,
954
+ sid: (Lt = e == null ? void 0 : e.data) == null ? void 0 : Lt.id,
955
+ disabled: Oe || O,
962
956
  afterFileAdd: (t, n) => {
963
- n && fe((s) => {
964
- const r = s[n] || [];
957
+ n && de((s) => {
958
+ const a = s[n] || [];
965
959
  return {
966
- [n]: [...r, t]
960
+ [n]: [...a, t]
967
961
  };
968
962
  });
969
963
  },
970
964
  afterFileDelete: (t) => {
971
965
  var s;
972
966
  const n = (s = e == null ? void 0 : e.data) == null ? void 0 : s.id;
973
- n && fe((r) => {
974
- const i = r[n] || [];
967
+ n && de((a) => {
968
+ const i = a[n] || [];
975
969
  return {
976
- [n]: i.filter((c) => c.id !== t)
970
+ [n]: i.filter((d) => d.id !== t)
977
971
  };
978
972
  });
979
973
  },
980
974
  onFileListChange: (t) => {
981
- ln(t);
975
+ cn(t);
982
976
  },
983
- shouldContinue: dn,
977
+ shouldContinue: fn,
984
978
  afterFilesClear: () => {
985
979
  var n;
986
980
  const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
987
- t && (fe({
981
+ t && (de({
988
982
  [t]: []
989
983
  }), Fe());
990
984
  }
991
- }) : null, (d == null ? void 0 : d.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ f(pi, {
985
+ }) : null, (c == null ? void 0 : c.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ f(ui, {
992
986
  appId: o.id,
993
987
  list: [],
994
- search: Ze ? nn : "",
988
+ search: Ze ? on : "",
995
989
  onPromptSelect: (t) => {
996
- ne(t.context), me(t.context);
990
+ te(t.context), me(t.context);
997
991
  },
998
992
  disabled: O
999
993
  })]
1000
- }), /* @__PURE__ */ q(Ne, {
1001
- children: [(d == null ? void 0 : d.connectNetwork) && o.type === G.Dialog && ((Lt = o.arrange) == null ? void 0 : Lt.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ f(gi, {
1002
- sessionId: (Pt = e == null ? void 0 : e.data) == null ? void 0 : Pt.id,
1003
- netStatus: L,
1004
- enable: typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.diabled) == "boolean" ? !(l != null && l.connectNetwork.diabled) : hn,
994
+ }), /* @__PURE__ */ _(Ee, {
995
+ children: [(c == null ? void 0 : c.connectNetwork) && o.type === Q.Dialog && ((Pt = o.arrange) == null ? void 0 : Pt.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ f(gi, {
996
+ sessionId: (Tt = e == null ? void 0 : e.data) == null ? void 0 : Tt.id,
997
+ netStatus: P,
998
+ enable: typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.diabled) == "boolean" ? !(l != null && l.connectNetwork.diabled) : mn,
1005
999
  disabledTip: e ? void 0 : "网络访问已被禁用",
1006
1000
  onNetStatusChange: (t) => {
1007
1001
  Un(t);
1008
1002
  }
1009
- }), (d == null ? void 0 : d.sessionList) && /* @__PURE__ */ f(ci, {
1010
- currentSessionId: (Tt = e == null ? void 0 : e.data) == null ? void 0 : Tt.id,
1003
+ }), (c == null ? void 0 : c.sessionList) && /* @__PURE__ */ f(ci, {
1004
+ currentSessionId: (Dt = e == null ? void 0 : e.data) == null ? void 0 : Dt.id,
1011
1005
  onSessionChange: (t, n) => {
1012
- ne(void 0), Ie(!0), y == null || y(n);
1006
+ te(void 0), Ie(!0), w == null || w(n);
1013
1007
  },
1014
1008
  disabled: O
1015
- }), Xt && Gt === "float" && /* @__PURE__ */ f("div", {
1009
+ }), Gt && Zt === "float" && /* @__PURE__ */ f("div", {
1016
1010
  className: "session-history-drawer-component",
1017
1011
  children: /* @__PURE__ */ f(Qn, {
1018
1012
  placement: "topRight",
@@ -1023,11 +1017,11 @@ ${e}` : e;
1023
1017
  },
1024
1018
  getPopupContainer: (t) => t.parentNode,
1025
1019
  content: "会话历史记录",
1026
- children: /* @__PURE__ */ f(J, {
1020
+ children: /* @__PURE__ */ f(Z, {
1027
1021
  className: "history-overlay-action",
1028
1022
  disabled: O,
1029
1023
  type: "text",
1030
- icon: /* @__PURE__ */ f(le, {
1024
+ icon: /* @__PURE__ */ f(re, {
1031
1025
  type: "icon-lishijilu",
1032
1026
  style: {
1033
1027
  fontSize: 24
@@ -1036,14 +1030,14 @@ ${e}` : e;
1036
1030
  onClick: () => rt(!0)
1037
1031
  })
1038
1032
  })
1039
- }), (d == null ? void 0 : d.sessionOpen) && /* @__PURE__ */ f(J, {
1033
+ }), (c == null ? void 0 : c.sessionOpen) && /* @__PURE__ */ f(Z, {
1040
1034
  icon: /* @__PURE__ */ f(si, {}),
1041
1035
  className: "add-btn",
1042
1036
  type: "primary",
1043
- disabled: et || !e || !v.length || O,
1037
+ disabled: et || !e || !y.length || O,
1044
1038
  onClick: () => {
1045
1039
  var t, n;
1046
- Ie(!1), y == null || y(null), se.current = null, P(!1), (t = Je.current) == null || t.clear(), (n = Oe.current) == null || n.clear();
1040
+ Ie(!1), w == null || w(null), ie.current = null, T(!1), (t = Je.current) == null || t.clear(), (n = De.current) == null || n.clear();
1047
1041
  },
1048
1042
  children: "新会话"
1049
1043
  })]
@@ -1052,56 +1046,56 @@ ${e}` : e;
1052
1046
  className: "footer-textarea",
1053
1047
  onPaste: ft,
1054
1048
  onPasteCapture: ft,
1055
- onDrop: pt,
1056
- onDropCapture: pt,
1049
+ onDrop: ut,
1050
+ onDropCapture: ut,
1057
1051
  onDragOver: gt,
1058
1052
  onDragOverCapture: gt,
1059
1053
  children: /* @__PURE__ */ f(ti, {
1060
1054
  ref: ke,
1061
- maxLength: Zt,
1062
- text: sn,
1055
+ maxLength: Jt,
1056
+ text: rn,
1063
1057
  networkStatus: !1,
1064
1058
  loading: ot || Ce,
1065
1059
  disabled: qe || Qe || O || ot || Ce,
1066
1060
  onTextSend: lt,
1067
1061
  onChange: (t, n) => {
1068
- ne(t);
1062
+ te(t);
1069
1063
  const s = n.getText().replace(/[\n\s]+$/, "");
1070
- me(s), on(s), Ze || tn(!0);
1064
+ me(s), sn(s), Ze || nn(!0);
1071
1065
  },
1072
- clearAction: /* @__PURE__ */ f(Ne, {
1066
+ clearAction: /* @__PURE__ */ f(Ee, {
1073
1067
  size: 0,
1074
- children: /* @__PURE__ */ f(J, {
1068
+ children: /* @__PURE__ */ f(Z, {
1075
1069
  type: "link",
1076
- disabled: Re || O,
1070
+ disabled: Oe || O,
1077
1071
  ghost: !0,
1078
- icon: /* @__PURE__ */ f(le, {
1072
+ icon: /* @__PURE__ */ f(re, {
1079
1073
  style: {
1080
1074
  fontSize: 22
1081
1075
  },
1082
1076
  type: "icon-qingchujiyi"
1083
1077
  }),
1084
- onClick: () => wn()
1078
+ onClick: () => kn()
1085
1079
  })
1086
1080
  })
1087
1081
  })
1088
1082
  })]
1089
1083
  })
1090
1084
  }), /* @__PURE__ */ f(oi, {
1091
- tips: Kt
1085
+ tips: Yt
1092
1086
  }), Se && /* @__PURE__ */ f(ai, {
1093
1087
  isvisible: Se,
1094
- files: an,
1095
- sessionId: (Dt = e == null ? void 0 : e.data) == null ? void 0 : Dt.id,
1088
+ files: ln,
1089
+ sessionId: (Ot = e == null ? void 0 : e.data) == null ? void 0 : Ot.id,
1096
1090
  onClose: (t) => {
1097
- rn(!1), fn(!1);
1091
+ an(!1), gn(!1);
1098
1092
  }
1099
1093
  })]
1100
1094
  }), st && /* @__PURE__ */ f(di, {
1101
1095
  currentSession: e,
1102
1096
  application: o,
1103
- networkStatus: L,
1104
- setCurrentSession: y,
1097
+ networkStatus: P,
1098
+ setCurrentSession: w,
1105
1099
  disabled: O,
1106
1100
  isSessionHistoryVisible: st,
1107
1101
  setIsSessionHistoryVisible: rt,