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