@glodon-aiot/agent-cli-ui 3.2.2-beta.4 → 3.2.10-beta.1

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