@glodon-aiot/agent-cli-ui 3.0.11-alpha.1 → 3.0.11-alpha.3

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,97 +1,97 @@
1
- import { jsxs as r, jsx as e } from "../../_virtual/jsx-runtime.mjs";
2
- import { memo as d, useContext as se, useState as re } from "react";
1
+ import { jsxs as s, jsx as e } from "../../_virtual/jsx-runtime.mjs";
2
+ import { memo as d, useContext as le, useState as se } from "react";
3
3
  import c from "../../InputProgress/index.mjs";
4
- import ae from "../SessionRefer/index.mjs";
5
- import oe from "../SessionAction/index.mjs";
6
- import { IHistoryRole as Q, IThinkingStatus as q } from "@glodon-aiot/apis";
7
- import de from "../../FileItem/index.mjs";
8
- import { Popover as ce, Space as D, Button as V, Row as pe, Col as me, Collapse as W, Divider as ue, message as G } from "antd";
9
- import he from "../SearchReference/index.mjs";
4
+ import re from "../SessionRefer/index.mjs";
5
+ import ae from "../SessionAction/index.mjs";
6
+ import { IHistoryRole as H, IThinkingStatus as Q } from "@glodon-aiot/apis";
7
+ import oe from "../../FileItem/index.mjs";
8
+ import { Popover as de, Space as q, Button as D, Row as ce, Col as pe, Collapse as V, Divider as me, message as W } from "antd";
9
+ import ue from "../SearchReference/index.mjs";
10
10
  import "./style.less.mjs";
11
- import ge from "../HistoryContent/index.mjs";
12
- import Ne from "../../components/Markdown/index.mjs";
13
- import fe from "../../node_modules/classnames/index.mjs";
11
+ import he from "../HistoryContent/index.mjs";
12
+ import ge from "../../components/Markdown/index.mjs";
13
+ import Ne from "../../node_modules/classnames/index.mjs";
14
14
  import p from "../../Iconfont/index.mjs";
15
- import { CheckOutlined as K, CloseOutlined as X, LoadingOutlined as ye } from "@ant-design/icons";
15
+ import { CheckOutlined as G, CloseOutlined as K, LoadingOutlined as fe } from "@ant-design/icons";
16
16
  import m from "../../components/JsonDisplay/index.mjs";
17
- import Le from "../../context.mjs";
18
- import Ce from "../SessionRelated/index.mjs";
19
- import ve from "../ReferCollapse/index.mjs";
20
- import Re from "../../node_modules/copy-to-clipboard/index.mjs";
21
- import be from "../../assets/think.svg.mjs";
22
- import { escapeSlash as Ee } from "../../utils/index.mjs";
23
- const Se = (o) => {
17
+ import ye from "../../context.mjs";
18
+ import Le from "../SessionRelated/index.mjs";
19
+ import Ce from "../ReferCollapse/index.mjs";
20
+ import ve from "../../node_modules/copy-to-clipboard/index.mjs";
21
+ import Re from "../../assets/think.svg.mjs";
22
+ import { escapeSlash as Se } from "../../utils/index.mjs";
23
+ const be = (o) => {
24
24
  if (!o)
25
25
  return o;
26
26
  try {
27
27
  return JSON.parse(o);
28
- } catch (a) {
28
+ } catch (r) {
29
29
  return o;
30
30
  }
31
- }, ke = d(he), Y = d(ae), L = d(Ne);
32
- d(ge);
33
- const Te = d(de);
34
- d(ve);
31
+ }, Ee = d(ue), X = d(re), L = d(ge);
32
+ d(he);
33
+ const ke = d(oe);
34
+ d(Ce);
35
35
  const u = (o) => {
36
36
  if (!o)
37
37
  return !1;
38
38
  try {
39
- const a = JSON.parse(o);
40
- return !(a != null && a.code && (a.code < 200 || a.code > 300));
41
- } catch (a) {
39
+ const r = JSON.parse(o);
40
+ return !(r != null && r.code && (r.code < 200 || r.code > 300));
41
+ } catch (r) {
42
42
  return !0;
43
43
  }
44
- }, Z = (o) => {
44
+ }, Y = (o) => {
45
45
  var t;
46
- const a = JSON.parse(JSON.stringify(o)) || [], l = (t = a == null ? void 0 : a.pop()) == null ? void 0 : t.pop();
47
- return l ? (l == null ? void 0 : l.type) === "BEFORE_CALL" || (l == null ? void 0 : l.type) === "FUNCTION_CALL" : !1;
48
- }, Ye = (o) => {
49
- var b, E, S, k, T, A, O, x, F, _;
46
+ const r = JSON.parse(JSON.stringify(o)) || [], a = (t = r == null ? void 0 : r.pop()) == null ? void 0 : t.pop();
47
+ return a ? (a == null ? void 0 : a.type) === "BEFORE_CALL" || (a == null ? void 0 : a.type) === "FUNCTION_CALL" : !1;
48
+ }, Xe = (o) => {
49
+ var S, b, E, k, T, A, x, O, F;
50
50
  const {
51
- application: a,
52
- currentSession: l,
51
+ application: r,
52
+ currentSession: a,
53
53
  history: t,
54
54
  isLastHistory: h,
55
- onRelatedClick: $,
56
- onAgainClick: ee,
57
- isLoading: Ae,
55
+ onRelatedClick: Z,
56
+ onAgainClick: $,
57
+ isLoading: Te,
58
58
  docViewerUrl: g,
59
59
  onEditClick: N
60
60
  } = o, {
61
61
  debug: C,
62
62
  transform: i,
63
63
  popupContainer: f
64
- } = se(Le), v = t.role === Q.User, R = t.role === Q.Robot, {
65
- Panel: te
66
- } = W, [y, ne] = re(!0), ie = () => {
67
- G.config({
64
+ } = le(ye), v = t.role === H.User, R = t.role === H.Robot, {
65
+ Panel: ee
66
+ } = V, [y, te] = se(!0), ne = () => {
67
+ W.config({
68
68
  getContainer: () => (f == null ? void 0 : f.current) || document.body
69
- }), Re(t.content), G.success("复制成功");
69
+ }), ve(t.content), W.success("复制成功");
70
70
  };
71
- return /* @__PURE__ */ r("div", {
72
- className: fe({
71
+ return /* @__PURE__ */ s("div", {
72
+ className: Ne({
73
73
  "history-item": !0,
74
74
  "history-item__user": v,
75
75
  "history-item__bot": R
76
76
  }),
77
- children: [v && /* @__PURE__ */ r("div", {
77
+ children: [v && /* @__PURE__ */ s("div", {
78
78
  className: "history-item-user",
79
79
  children: [/* @__PURE__ */ e("div", {
80
80
  className: "item-user-panel",
81
- children: /* @__PURE__ */ e(ce, {
81
+ children: /* @__PURE__ */ e(de, {
82
82
  placement: "topLeft",
83
83
  overlayStyle: {
84
84
  padding: 4
85
85
  },
86
86
  overlayClassName: "session-item-overlay-popover",
87
87
  getPopupContainer: (n) => n.parentNode,
88
- content: i != null && i.userEdit || i != null && i.userCopy ? /* @__PURE__ */ r(D, {
88
+ content: i != null && i.userEdit || i != null && i.userCopy ? /* @__PURE__ */ s(q, {
89
89
  className: "item-user-popover",
90
90
  size: 4,
91
91
  children: [(i == null ? void 0 : i.userEdit) && /* @__PURE__ */ e("div", {
92
92
  className: "user-pannel-item",
93
93
  onClick: () => N == null ? void 0 : N(t.content),
94
- children: /* @__PURE__ */ e(V, {
94
+ children: /* @__PURE__ */ e(D, {
95
95
  type: "link",
96
96
  size: "small",
97
97
  icon: /* @__PURE__ */ e(p, {
@@ -100,8 +100,8 @@ const u = (o) => {
100
100
  })
101
101
  }), (i == null ? void 0 : i.userCopy) && /* @__PURE__ */ e("div", {
102
102
  className: "user-pannel-item",
103
- onClick: ie,
104
- children: /* @__PURE__ */ e(V, {
103
+ onClick: ne,
104
+ children: /* @__PURE__ */ e(D, {
105
105
  type: "link",
106
106
  size: "small",
107
107
  icon: /* @__PURE__ */ e(p, {
@@ -119,22 +119,22 @@ const u = (o) => {
119
119
  className: "item-user-content",
120
120
  children: /* @__PURE__ */ e(L, {
121
121
  showLatex: !1,
122
- children: Ee(t.content)
122
+ children: Se(t.content)
123
123
  })
124
124
  })
125
125
  })
126
126
  })
127
127
  }), /* @__PURE__ */ e("div", {
128
128
  className: "item-user-file",
129
- children: /* @__PURE__ */ e(pe, {
129
+ children: /* @__PURE__ */ e(ce, {
130
130
  gutter: [12, 12],
131
131
  justify: "end",
132
132
  wrap: !0,
133
- children: (b = t.files) == null ? void 0 : b.map((n) => /* @__PURE__ */ e(me, {
133
+ children: (S = t.files) == null ? void 0 : S.map((n) => /* @__PURE__ */ e(pe, {
134
134
  className: "user-file-col",
135
- children: /* @__PURE__ */ e(Te, {
135
+ children: /* @__PURE__ */ e(ke, {
136
136
  docViewerUrl: g,
137
- currentSession: l,
137
+ currentSession: a,
138
138
  file: n
139
139
  })
140
140
  }, n.id))
@@ -142,51 +142,51 @@ const u = (o) => {
142
142
  })]
143
143
  }), R && /* @__PURE__ */ e("div", {
144
144
  className: "history-item-bot",
145
- children: /* @__PURE__ */ r("div", {
145
+ children: /* @__PURE__ */ s("div", {
146
146
  className: "bot-content-wrapper",
147
- children: [a.type === 2 && /* @__PURE__ */ r("div", {
147
+ children: [r.type === 2 && /* @__PURE__ */ s("div", {
148
148
  className: "item-bot-plugin",
149
- children: [/* @__PURE__ */ e(W, {
149
+ children: [/* @__PURE__ */ e(V, {
150
150
  ghost: !0,
151
151
  expandIconPosition: "right",
152
- children: (E = t.actions) == null ? void 0 : E.map((n, le) => {
153
- var I, U, z, j, B, w, M, J, P, H;
154
- return /* @__PURE__ */ r(te, {
152
+ children: (b = t.actions) == null ? void 0 : b.map((n, ie) => {
153
+ var _, I, U, z, j, B, w, M, J, P;
154
+ return /* @__PURE__ */ s(ee, {
155
155
  collapsible: C ? "header" : "icon",
156
156
  showArrow: C,
157
- header: /* @__PURE__ */ r(D, {
157
+ header: /* @__PURE__ */ s(q, {
158
158
  size: 8,
159
159
  style: {
160
160
  width: "100%"
161
161
  },
162
- children: [/* @__PURE__ */ r("span", {
162
+ children: [/* @__PURE__ */ s("span", {
163
163
  className: "bot-plugin-status",
164
- children: [(n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && u((I = n.find((s) => s.type === "RESULT")) == null ? void 0 : I.data.result) && /* @__PURE__ */ e("span", {
164
+ children: [(n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && u((_ = n.find((l) => l.type === "RESULT")) == null ? void 0 : _.data.result) && /* @__PURE__ */ e("span", {
165
165
  className: "plugin-status-success",
166
- children: /* @__PURE__ */ e(K, {})
166
+ children: /* @__PURE__ */ e(G, {})
167
167
  }), n[n.length - 1].type === "ABORT" && /* @__PURE__ */ e("span", {
168
168
  className: "plugin-status-error",
169
- children: /* @__PURE__ */ e(X, {})
170
- }), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && !u((U = n.find((s) => s.type === "RESULT")) == null ? void 0 : U.data.result) && /* @__PURE__ */ e("span", {
169
+ children: /* @__PURE__ */ e(K, {})
170
+ }), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && !u((I = n.find((l) => l.type === "RESULT")) == null ? void 0 : I.data.result) && /* @__PURE__ */ e("span", {
171
171
  className: "plugin-status-error",
172
- children: /* @__PURE__ */ e(X, {})
172
+ children: /* @__PURE__ */ e(K, {})
173
173
  }), (n[n.length - 1].type === "BEFORE_CALL" || n[n.length - 1].type === "FUNCTION_CALL") && /* @__PURE__ */ e("span", {
174
174
  className: "plugin-status-loading",
175
- children: /* @__PURE__ */ e(ye, {})
175
+ children: /* @__PURE__ */ e(fe, {})
176
176
  })]
177
177
  }), /* @__PURE__ */ e("span", {
178
178
  className: "bot-plugin-title",
179
- children: (z = n[n.length - 1].data) == null ? void 0 : z.pluginName
179
+ children: (U = n[n.length - 1].data) == null ? void 0 : U.pluginName
180
180
  }), /* @__PURE__ */ e("span", {
181
181
  className: "bot-plugin-action",
182
- children: (j = n[n.length - 1].data) == null ? void 0 : j.funcName
182
+ children: (z = n[n.length - 1].data) == null ? void 0 : z.funcName
183
183
  }), (n[n.length - 1].type === "BEFORE_CALL" || n[n.length - 1].type === "FUNCTION_CALL") && /* @__PURE__ */ e("span", {
184
184
  className: "bot-plugin-result",
185
185
  children: "执行中"
186
- }), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && u((B = n.find((s) => s.type === "RESULT")) == null ? void 0 : B.data.result) && /* @__PURE__ */ e("span", {
186
+ }), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && u((j = n.find((l) => l.type === "RESULT")) == null ? void 0 : j.data.result) && /* @__PURE__ */ e("span", {
187
187
  className: "bot-plugin-result",
188
188
  children: "执行成功"
189
- }), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && !u((w = n.find((s) => s.type === "RESULT")) == null ? void 0 : w.data.result) && /* @__PURE__ */ e("span", {
189
+ }), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && !u((B = n.find((l) => l.type === "RESULT")) == null ? void 0 : B.data.result) && /* @__PURE__ */ e("span", {
190
190
  className: "bot-plugin-result",
191
191
  children: "执行失败"
192
192
  }), n[n.length - 1].type === "ABORT" && /* @__PURE__ */ e("span", {
@@ -200,7 +200,7 @@ const u = (o) => {
200
200
  }), /* @__PURE__ */ e("div", {
201
201
  className: "bot-plugin-json",
202
202
  children: /* @__PURE__ */ e(m, {
203
- josn: (M = n.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : M.data.thought
203
+ josn: (w = n.find((l) => l.type === "BEFORE_CALL")) == null ? void 0 : w.data.thought
204
204
  })
205
205
  }), /* @__PURE__ */ e("div", {
206
206
  className: "bot-plugin-content",
@@ -208,7 +208,7 @@ const u = (o) => {
208
208
  }), /* @__PURE__ */ e("div", {
209
209
  className: "bot-plugin-json",
210
210
  children: /* @__PURE__ */ e(m, {
211
- josn: (J = n.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : J.data.parameters
211
+ josn: (M = n.find((l) => l.type === "BEFORE_CALL")) == null ? void 0 : M.data.parameters
212
212
  })
213
213
  }), /* @__PURE__ */ e("div", {
214
214
  className: "bot-plugin-content",
@@ -216,7 +216,7 @@ const u = (o) => {
216
216
  }), /* @__PURE__ */ e("div", {
217
217
  className: "bot-plugin-json",
218
218
  children: /* @__PURE__ */ e(m, {
219
- josn: (P = n.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : P.data.requestBody
219
+ josn: (J = n.find((l) => l.type === "BEFORE_CALL")) == null ? void 0 : J.data.requestBody
220
220
  })
221
221
  }), /* @__PURE__ */ e("div", {
222
222
  className: "bot-plugin-content",
@@ -224,44 +224,44 @@ const u = (o) => {
224
224
  }), /* @__PURE__ */ e("div", {
225
225
  className: "bot-plugin-json",
226
226
  children: /* @__PURE__ */ e(m, {
227
- josn: Se((H = n.find((s) => s.type === "RESULT")) == null ? void 0 : H.data.result)
227
+ josn: be((P = n.find((l) => l.type === "RESULT")) == null ? void 0 : P.data.result)
228
228
  })
229
229
  })]
230
- }, le);
230
+ }, ie);
231
231
  })
232
232
  }), t.isLoading && /* @__PURE__ */ e("div", {
233
233
  className: "history-input-progress",
234
234
  style: {
235
235
  padding: "4px 0"
236
236
  },
237
- children: Z(t.actions) ? null : /* @__PURE__ */ e(c, {
237
+ children: Y(t.actions) ? null : /* @__PURE__ */ e(c, {
238
238
  size: 4,
239
239
  text: "思考中"
240
240
  })
241
241
  })]
242
- }), ((S = l == null ? void 0 : l.data) == null ? void 0 : S.netOpen) && /* @__PURE__ */ e("div", {
242
+ }), /* @__PURE__ */ e("div", {
243
243
  className: "item-bot-net",
244
- children: /* @__PURE__ */ e(ke, {
244
+ children: /* @__PURE__ */ e(Ee, {
245
245
  history: t
246
246
  })
247
- }), (k = t == null ? void 0 : t.reference) != null && k.length && ((T = i == null ? void 0 : i.reference) != null && T.referenceFirst) ? /* @__PURE__ */ e(Y, {
247
+ }), (E = t == null ? void 0 : t.reference) != null && E.length && ((k = i == null ? void 0 : i.reference) != null && k.referenceFirst) ? /* @__PURE__ */ e(X, {
248
248
  history: t,
249
249
  docViewerUrl: g
250
- }) : null, /* @__PURE__ */ r("div", {
250
+ }) : null, /* @__PURE__ */ s("div", {
251
251
  className: "item-bot-content",
252
- children: [/* @__PURE__ */ r("div", {
252
+ children: [/* @__PURE__ */ s("div", {
253
253
  className: "content-think",
254
- children: [(t == null ? void 0 : t.reasoningContent) && /* @__PURE__ */ r("div", {
254
+ children: [(t == null ? void 0 : t.reasoningContent) && /* @__PURE__ */ s("div", {
255
255
  className: "think-top",
256
256
  onClick: () => {
257
- ne(!y);
257
+ te(!y);
258
258
  },
259
259
  children: [/* @__PURE__ */ e("img", {
260
- src: be,
260
+ src: Re,
261
261
  alt: ""
262
262
  }), (t == null ? void 0 : t.reasoningContent) && !(t != null && t.content) && /* @__PURE__ */ e("span", {
263
263
  children: "我正在推理思考…"
264
- }), (t == null ? void 0 : t.reasoningContent) && t.content && /* @__PURE__ */ r("span", {
264
+ }), (t == null ? void 0 : t.reasoningContent) && t.content && /* @__PURE__ */ s("span", {
265
265
  children: ["已完成推理(用时 ", (t == null ? void 0 : t.thinkingSecs) || 0, " 秒)"]
266
266
  }), /* @__PURE__ */ e("span", {
267
267
  className: "think-action",
@@ -277,15 +277,15 @@ const u = (o) => {
277
277
  }
278
278
  })
279
279
  })]
280
- }), !!((A = t == null ? void 0 : t.reasoningContent) != null && A.trim()) && y && /* @__PURE__ */ r("div", {
280
+ }), !!((T = t == null ? void 0 : t.reasoningContent) != null && T.trim()) && y && /* @__PURE__ */ s("div", {
281
281
  className: "think-bottom",
282
- children: [/* @__PURE__ */ r("div", {
282
+ children: [/* @__PURE__ */ s("div", {
283
283
  className: "bottom-left",
284
- children: [(t == null ? void 0 : t.thinkingStatus) === q.Start && /* @__PURE__ */ e("div", {
284
+ children: [(t == null ? void 0 : t.thinkingStatus) === Q.Start && /* @__PURE__ */ e("div", {
285
285
  className: "thinking"
286
- }), (t == null ? void 0 : t.thinkingStatus) === q.End && /* @__PURE__ */ e("div", {
286
+ }), (t == null ? void 0 : t.thinkingStatus) === Q.End && /* @__PURE__ */ e("div", {
287
287
  className: "thinked",
288
- children: /* @__PURE__ */ e(K, {})
288
+ children: /* @__PURE__ */ e(G, {})
289
289
  })]
290
290
  }), /* @__PURE__ */ e("div", {
291
291
  className: "bottom-right",
@@ -297,7 +297,7 @@ const u = (o) => {
297
297
  }), /* @__PURE__ */ e(L, {
298
298
  children: t.content
299
299
  })]
300
- }), (O = t == null ? void 0 : t.reference) != null && O.length && !((x = i == null ? void 0 : i.reference) != null && x.referenceFirst) ? /* @__PURE__ */ e(Y, {
300
+ }), (A = t == null ? void 0 : t.reference) != null && A.length && !((x = i == null ? void 0 : i.reference) != null && x.referenceFirst) ? /* @__PURE__ */ e(X, {
301
301
  history: t,
302
302
  docViewerUrl: g
303
303
  }) : null, t.isRelatedQuestion && h ? /* @__PURE__ */ e("div", {
@@ -312,23 +312,23 @@ const u = (o) => {
312
312
  style: {
313
313
  padding: "4px 0"
314
314
  },
315
- children: Z(t.actions) ? null : /* @__PURE__ */ e(c, {
315
+ children: Y(t.actions) ? null : /* @__PURE__ */ e(c, {
316
316
  size: 4,
317
317
  text: "思考中"
318
318
  })
319
- }), (i == null ? void 0 : i.relate) && h && !!((F = t.relatedQuesion) != null && F.length) && /* @__PURE__ */ e(Ce, {
319
+ }), (i == null ? void 0 : i.relate) && h && !!((O = t.relatedQuesion) != null && O.length) && /* @__PURE__ */ e(Le, {
320
320
  relatedQuesion: t.relatedQuesion,
321
- onRelatedClick: $
322
- }), !t.isSensitive && !!t.messageId && /* @__PURE__ */ e(oe, {
323
- appId: a.id,
321
+ onRelatedClick: Z
322
+ }), !t.isSensitive && !!t.messageId && /* @__PURE__ */ e(ae, {
323
+ appId: r.id,
324
324
  history: t,
325
- sessionId: (_ = l == null ? void 0 : l.data) == null ? void 0 : _.id,
326
- onAgainClick: ee,
325
+ sessionId: (F = a == null ? void 0 : a.data) == null ? void 0 : F.id,
326
+ onAgainClick: $,
327
327
  isLastHistory: h,
328
- currentSession: l
328
+ currentSession: a
329
329
  })]
330
330
  })
331
- }), t.isContext && /* @__PURE__ */ r(ue, {
331
+ }), t.isContext && /* @__PURE__ */ s(me, {
332
332
  children: [/* @__PURE__ */ e("div", {
333
333
  style: {
334
334
  color: "#84868C",
@@ -346,6 +346,6 @@ const u = (o) => {
346
346
  });
347
347
  };
348
348
  export {
349
- Ye as default,
349
+ Xe as default,
350
350
  u as isResultExec
351
351
  };
@@ -1,69 +1,69 @@
1
- import { jsx as e, jsxs as r, Fragment as d } from "../../_virtual/jsx-runtime.mjs";
2
- import { useState as p } from "react";
3
- import m from "../../assets/think.svg.mjs";
1
+ import { jsx as e, jsxs as r, Fragment as f } from "../../_virtual/jsx-runtime.mjs";
2
+ import { useState as N } from "react";
3
+ import R from "../../assets/think.svg.mjs";
4
4
  import "./style.less.mjs";
5
- import { CheckOutlined as u, CloseOutlined as g } from "@ant-design/icons";
6
- import { Collapse as l, Space as f } from "antd";
5
+ import { CheckOutlined as k, CloseOutlined as x } from "@ant-design/icons";
6
+ import { Collapse as p, Space as S } from "antd";
7
7
  const {
8
- Panel: N
9
- } = l, C = (i) => {
10
- var t;
8
+ Panel: b
9
+ } = p, E = (m) => {
10
+ var t, a, c, l, i, h;
11
11
  const {
12
12
  history: n
13
- } = i, [h, o] = p(!1), s = n.searchingStatus ? n.searchingStatus : n.searchReference.length ? "end" : "";
13
+ } = m, [u, g] = N(!1), s = n.searchingStatus ? n.searchingStatus : (t = n.searchReference) != null && t.length ? "end" : "";
14
14
  return s ? /* @__PURE__ */ e("div", {
15
15
  className: "search-reference",
16
16
  children: /* @__PURE__ */ r("div", {
17
17
  className: "item-bot-plugin",
18
18
  onClick: () => {
19
- o(!h);
19
+ g(!u);
20
20
  },
21
- children: [s === "start" && /* @__PURE__ */ r(d, {
21
+ children: [s === "start" && /* @__PURE__ */ r(f, {
22
22
  children: [/* @__PURE__ */ e("img", {
23
- src: m,
23
+ src: R,
24
24
  alt: ""
25
25
  }), /* @__PURE__ */ e("span", {
26
26
  children: "正在搜索…"
27
27
  })]
28
- }), s === "end" && /* @__PURE__ */ e(l, {
28
+ }), s === "end" && /* @__PURE__ */ e(p, {
29
29
  ghost: !0,
30
30
  expandIconPosition: "right",
31
- children: /* @__PURE__ */ e(N, {
31
+ children: /* @__PURE__ */ e(b, {
32
32
  collapsible: "icon",
33
- showArrow: !!(s === "end" && n.searchReference.length),
34
- header: /* @__PURE__ */ r(f, {
33
+ showArrow: !!(s === "end" && ((a = n.searchReference) != null && a.length)),
34
+ header: /* @__PURE__ */ r(S, {
35
35
  size: 8,
36
36
  style: {
37
37
  width: "100%"
38
38
  },
39
39
  children: [/* @__PURE__ */ r("span", {
40
40
  className: "bot-plugin-status",
41
- children: [s === "end" && n.searchReference.length > 0 && /* @__PURE__ */ e("span", {
41
+ children: [s === "end" && ((c = n.searchReference) == null ? void 0 : c.length) && /* @__PURE__ */ e("span", {
42
42
  className: "plugin-status-success",
43
- children: /* @__PURE__ */ e(u, {})
44
- }), s === "end" && !n.searchReference.length && /* @__PURE__ */ e("span", {
43
+ children: /* @__PURE__ */ e(k, {})
44
+ }), s === "end" && !((l = n.searchReference) != null && l.length) && /* @__PURE__ */ e("span", {
45
45
  className: "plugin-status-error",
46
- children: /* @__PURE__ */ e(g, {})
46
+ children: /* @__PURE__ */ e(x, {})
47
47
  })]
48
48
  }), s === "end" && /* @__PURE__ */ e("span", {
49
49
  className: "bot-plugin-title",
50
- children: n.searchReference.length ? `已搜索到${n.searchReference.length}个网页` : "未找到搜索内容,请检查搜索服务"
50
+ children: (i = n.searchReference) != null && i.length ? `已搜索到${n.searchReference.length}个网页` : "未找到搜索内容,请检查搜索服务"
51
51
  })]
52
52
  }),
53
53
  children: /* @__PURE__ */ e("div", {
54
54
  className: "bot-net-main",
55
- children: (t = n.searchReference) == null ? void 0 : t.map((a, c) => /* @__PURE__ */ r("div", {
55
+ children: (h = n.searchReference) == null ? void 0 : h.map((o, d) => /* @__PURE__ */ r("div", {
56
56
  className: "text",
57
57
  children: [/* @__PURE__ */ r("span", {
58
- children: [c + 1, ". "]
58
+ children: [d + 1, ". "]
59
59
  }), /* @__PURE__ */ e("span", {
60
60
  className: "link",
61
61
  onClick: () => {
62
- window.open(a.link);
62
+ window.open(o.link);
63
63
  },
64
- children: a.title
64
+ children: o.title
65
65
  })]
66
- }, c))
66
+ }, d))
67
67
  })
68
68
  }, "")
69
69
  })]
@@ -71,5 +71,5 @@ const {
71
71
  }) : null;
72
72
  };
73
73
  export {
74
- C as default
74
+ E as default
75
75
  };