@glodon-aiot/agent-cli-ui 3.7.0-alpha.3 → 3.9.0-alpha.5

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,242 +1,295 @@
1
- var vt = Object.defineProperty;
2
- var Z = Object.getOwnPropertySymbols;
3
- var Nt = Object.prototype.hasOwnProperty, ut = Object.prototype.propertyIsEnumerable;
4
- var I = (N, m, e) => m in N ? vt(N, m, { enumerable: !0, configurable: !0, writable: !0, value: e }) : N[m] = e, tt = (N, m) => {
5
- for (var e in m || (m = {}))
6
- Nt.call(m, e) && I(N, e, m[e]);
7
- if (Z)
8
- for (var e of Z(m))
9
- ut.call(m, e) && I(N, e, m[e]);
10
- return N;
1
+ var Pe = Object.defineProperty;
2
+ var he = Object.getOwnPropertySymbols;
3
+ var je = Object.prototype.hasOwnProperty, De = Object.prototype.propertyIsEnumerable;
4
+ var me = (A, u, a) => u in A ? Pe(A, u, { enumerable: !0, configurable: !0, writable: !0, value: a }) : A[u] = a, pe = (A, u) => {
5
+ for (var a in u || (u = {}))
6
+ je.call(u, a) && me(A, a, u[a]);
7
+ if (he)
8
+ for (var a of he(u))
9
+ De.call(u, a) && me(A, a, u[a]);
10
+ return A;
11
11
  };
12
- var P = (N, m, e) => new Promise((n, b) => {
13
- var A = (u) => {
12
+ var L = (A, u, a) => new Promise((r, O) => {
13
+ var k = (N) => {
14
14
  try {
15
- E(e.next(u));
16
- } catch (j) {
17
- b(j);
15
+ M(a.next(N));
16
+ } catch (x) {
17
+ O(x);
18
18
  }
19
- }, F = (u) => {
19
+ }, J = (N) => {
20
20
  try {
21
- E(e.throw(u));
22
- } catch (j) {
23
- b(j);
21
+ M(a.throw(N));
22
+ } catch (x) {
23
+ O(x);
24
24
  }
25
- }, E = (u) => u.done ? n(u.value) : Promise.resolve(u.value).then(A, F);
26
- E((e = e.apply(N, m)).next());
25
+ }, M = (N) => N.done ? r(N.value) : Promise.resolve(N.value).then(k, J);
26
+ M((a = a.apply(A, u)).next());
27
27
  });
28
- import { jsx as r, jsxs as M } from "react/jsx-runtime";
29
- import { forwardRef as gt, useState as x, useContext as kt, useEffect as Y, useImperativeHandle as wt, useMemo as At } from "react";
30
- import { Button as bt, Typography as Et, Space as et, Popconfirm as at, Input as Ot } from "antd";
28
+ import { jsx as f, jsxs as S } from "react/jsx-runtime";
29
+ import { forwardRef as Ie, useState as b, useContext as Re, useRef as H, useEffect as D, useImperativeHandle as Ye, useMemo as $e } from "react";
30
+ import { Button as Ve, Typography as Ce, Space as ue, Popconfirm as ye, Input as He, Divider as Fe } from "antd";
31
31
  import h from "dayjs";
32
- import Mt from "classnames";
33
- import dt from "../../components/Iconfont/index.mjs";
34
- import jt from "../../context.mjs";
35
- /* empty css */import { useMemoizedFn as ot } from "ahooks";
36
- import { NET_OPEN_STATUS as it } from "../../constant.mjs";
37
- import { useSessionState as Pt } from "../../hooks/useSessionState.mjs";
38
- const B = 15, Lt = gt((N, m) => {
32
+ import Ke from "classnames";
33
+ import ge from "../../components/Iconfont/index.mjs";
34
+ import ze from "../../context.mjs";
35
+ /* empty css */import { useMemoizedFn as ve } from "ahooks";
36
+ import { MAX_KNOWLEDGES_AND_FILES_COUNT as F, NET_OPEN_STATUS as we } from "../../constant.mjs";
37
+ import { useSessionState as Be } from "../../hooks/useSessionState.mjs";
38
+ import { calcKnowledgesLeafCount as Ae } from "../../utils/index.mjs";
39
+ const q = 15, Ge = Ie((A, u) => {
39
40
  const {
40
- currentSession: e,
41
- setCurrentSession: n,
42
- checkKnowledges: b,
43
- application: A,
44
- networkStatus: F,
45
- isShowHeader: E = !0,
46
- afterSessionClick: u,
47
- sessionId: j
48
- } = N, [V, _] = x(), {
49
- agentClient: v,
50
- mode: nt,
51
- features: a
52
- } = kt(jt), [R, C] = x(b), {
53
- sessions: L,
54
- setSessions: S
55
- } = Pt(), [K, D] = x(0), [lt, T] = x(""), [ct, z] = x(null), G = ot((t) => {
56
- t.id && S((d) => [...d.map((l) => {
57
- var s;
58
- return ((s = l.data) == null ? void 0 : s.id) === t.id && (l.data = tt({}, t)), l;
59
- })].sort((l, s) => {
60
- var w, k;
61
- const g = h((w = l.data) == null ? void 0 : w.createdAt).valueOf();
62
- return h((k = s.data) == null ? void 0 : k.createdAt).valueOf() - g;
41
+ currentSession: a,
42
+ setCurrentSession: r,
43
+ checkKnowledges: O,
44
+ application: k,
45
+ networkStatus: J,
46
+ isShowHeader: M = !0,
47
+ afterSessionClick: N,
48
+ sessionId: x
49
+ } = A, [K, z] = b(), {
50
+ agentClient: m,
51
+ mode: Q,
52
+ features: o
53
+ } = Re(ze), [ee, te] = b(O), {
54
+ sessions: T,
55
+ setSessions: _
56
+ } = Be(), [ae, B] = b(0), [Ne, I] = b(""), [Ee, oe] = b(null), P = 30, [G, R] = b(!1), [Y, $] = b(!0), [ke, V] = b(!1), C = H(void 0), j = H(0), U = H(null), X = H(null), ne = (e) => {
57
+ var n, s;
58
+ if (!(e != null && e.length))
59
+ return;
60
+ let t = (s = (n = e[0]) == null ? void 0 : n.data) == null ? void 0 : s.createdAt;
61
+ return e.forEach((d) => {
62
+ var l, p, g, w;
63
+ t ? (p = d.data) != null && p.createdAt && h((g = d.data) == null ? void 0 : g.createdAt).valueOf() < h(t).valueOf() && (t = (w = d.data) == null ? void 0 : w.createdAt) : t = (l = d.data) == null ? void 0 : l.createdAt;
64
+ }), t;
65
+ }, de = ve((e) => {
66
+ e.id && _((t) => [...t.map((d) => {
67
+ var l;
68
+ return ((l = d.data) == null ? void 0 : l.id) === e.id && (d.data = pe({}, e)), d;
69
+ })].sort((d, l) => {
70
+ var w, E;
71
+ const p = h((w = d.data) == null ? void 0 : w.createdAt).valueOf();
72
+ return h((E = l.data) == null ? void 0 : E.createdAt).valueOf() - p;
63
73
  }));
64
74
  });
65
- Y(() => {
66
- v == null || v.getSessions().then((t) => P(void 0, null, function* () {
67
- var d;
68
- if (S([...t]), !((d = e == null ? void 0 : e.data) != null && d.id) && (t != null && t.length) && nt === "inlay") {
69
- const o = t[0];
70
- j || n == null || n(o);
75
+ D(() => {
76
+ if (Q === "float") {
77
+ a === void 0 && !x && (r == null || r(null));
78
+ return;
79
+ }
80
+ R(!0), C.current = void 0, j.current = 0, m == null || m.getSessions({
81
+ pageSize: P
82
+ }).then((e) => L(void 0, null, function* () {
83
+ var t;
84
+ if (_([...e]), j.current = e.length, C.current = ne(e), $(e.length >= P), V(e.length < P), !((t = a == null ? void 0 : a.data) != null && t.id) && (e != null && e.length) && Q === "inlay") {
85
+ const n = e[0];
86
+ x || r == null || r(n);
71
87
  } else
72
- e === void 0 && (j || n == null || n(null));
73
- }));
74
- }, []), Y(() => {
75
- var t;
76
- if (!((t = e == null ? void 0 : e.data) != null && t.id) && b === void 0) {
77
- const d = typeof (a == null ? void 0 : a.knowledges) == "object" && a.knowledges.default || void 0;
78
- C(d);
88
+ a === void 0 && (x || r == null || r(null));
89
+ })).finally(() => R(!1));
90
+ }, []), D(() => {
91
+ var e;
92
+ if (!((e = a == null ? void 0 : a.data) != null && e.id) && O === void 0) {
93
+ const t = typeof (o == null ? void 0 : o.knowledges) == "object" && o.knowledges.default || void 0;
94
+ if (Array.isArray(t) && t.some((d) => Array.isArray(d.fileIds) && d.fileIds.length === 0))
95
+ throw Error("fileIds cannot be an empty array");
96
+ if (Ae(t || []) > F)
97
+ throw Error(`knowledges and fileIds total count cannot exceed ${F}`);
98
+ te(t);
79
99
  return;
80
100
  }
81
- C(b);
82
- }, [b]), Y(() => {
83
- e == null || e.addEventListener("data:updated", G);
84
- }, [e]), wt(m, () => ({
85
- create(t) {
86
- return U(t).then((d) => (n == null || n(d), d));
101
+ te(O);
102
+ }, [O]), D(() => {
103
+ a == null || a.addEventListener("data:updated", de);
104
+ }, [a]), Ye(u, () => ({
105
+ create(e) {
106
+ return re(e).then((t) => (r == null || r(t), t));
87
107
  },
88
- list: () => Promise.resolve(L)
108
+ list: () => Promise.resolve(T)
89
109
  }));
90
- const U = (t) => {
91
- const d = typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.default) == "boolean" ? a.connectNetwork.default : !1;
92
- return new Promise((o) => P(void 0, null, function* () {
93
- var s;
94
- const f = typeof (a == null ? void 0 : a.promptVariables) == "object" ? (a == null ? void 0 : a.promptVariables.default) || [] : void 0, l = yield v == null ? void 0 : v.loadSession("", {
95
- name: t == null ? void 0 : t.name,
110
+ const re = (e) => {
111
+ const t = typeof (o == null ? void 0 : o.connectNetwork) == "object" && typeof (o == null ? void 0 : o.connectNetwork.default) == "boolean" ? o.connectNetwork.default : !1;
112
+ return new Promise((n) => L(void 0, null, function* () {
113
+ var l;
114
+ const s = typeof (o == null ? void 0 : o.promptVariables) == "object" ? (o == null ? void 0 : o.promptVariables.default) || [] : void 0, d = yield m == null ? void 0 : m.loadSession("", {
115
+ name: e == null ? void 0 : e.name,
96
116
  // @ts-ignore netOpen入参是number 响应是boolen
97
117
  // 只有对话有联网 其它没有
98
118
  // 不传netOpen会默认取defaultNetOpen
99
- netOpen: (A == null ? void 0 : A.type) === 0 ? t != null && t.netOpen ? t.netOpen : d ? it.OPEN : it.CLOSE : void 0,
100
- knowledges: (s = e == null ? void 0 : e.data) != null && s.id ? t == null ? void 0 : t.knowledges : R,
101
- promptVariables: f
119
+ netOpen: (k == null ? void 0 : k.type) === 0 ? e != null && e.netOpen ? e.netOpen : t ? we.OPEN : we.CLOSE : void 0,
120
+ knowledges: (l = a == null ? void 0 : a.data) != null && l.id ? e == null ? void 0 : e.knowledges : ee,
121
+ promptVariables: s
102
122
  });
103
- l == null || l.addEventListener("data:created", () => P(void 0, null, function* () {
104
- S([l, ...L]), o(l);
123
+ d == null || d.addEventListener("data:created", () => L(void 0, null, function* () {
124
+ _([d, ...T]), n(d);
105
125
  }));
106
126
  }));
107
- }, st = () => {
108
- U({
109
- knowledges: R
110
- }).then((t) => {
111
- n == null || n(t);
127
+ }, be = () => {
128
+ re({
129
+ knowledges: ee
130
+ }).then((e) => {
131
+ r == null || r(e);
112
132
  });
113
- }, rt = (t) => {
114
- v == null || v.removeSession(t, !0).then(() => P(void 0, null, function* () {
115
- var o, f;
116
- const d = L.filter((l) => {
117
- var s, g;
118
- return ((s = l.data) == null ? void 0 : s.id) !== ((g = t.data) == null ? void 0 : g.id);
133
+ }, Oe = (e) => {
134
+ m == null || m.removeSession(e, !0).then(() => L(void 0, null, function* () {
135
+ var n, s;
136
+ const t = T.filter((d) => {
137
+ var l, p;
138
+ return ((l = d.data) == null ? void 0 : l.id) !== ((p = e.data) == null ? void 0 : p.id);
119
139
  });
120
- ((o = t.data) == null ? void 0 : o.id) === ((f = e == null ? void 0 : e.data) == null ? void 0 : f.id) && (d != null && d.length ? n == null || n(d[0]) : n == null || n(null)), S([...d]);
140
+ ((n = e.data) == null ? void 0 : n.id) === ((s = a == null ? void 0 : a.data) == null ? void 0 : s.id) && (t != null && t.length ? r == null || r(t[0]) : r == null || r(null)), _([...t]);
121
141
  }));
122
- }, mt = (t) => {
123
- var d, o;
124
- _((d = t.data) == null ? void 0 : d.name), T(""), z(((o = t.data) == null ? void 0 : o.id) || null);
125
- }, pt = (t) => {
126
- const d = q(V || "");
127
- if (d) {
128
- T(d);
142
+ }, Me = () => L(void 0, null, function* () {
143
+ if (!(G || !Y)) {
144
+ R(!0);
145
+ try {
146
+ const e = yield m == null ? void 0 : m.getSessions({
147
+ pageSize: P,
148
+ beforeTime: C.current
149
+ }), t = (e == null ? void 0 : e.length) || 0, n = t - j.current;
150
+ _([...e || []]), C.current = ne(e || []), n <= 0 ? ($(!1), V(!0)) : n < P ? ($(!1), V(!0), j.current = t) : ($(!0), V(!1), j.current = t);
151
+ } finally {
152
+ R(!1);
153
+ }
154
+ }
155
+ });
156
+ D(() => {
157
+ if (!U.current || !X.current)
158
+ return;
159
+ const e = U.current, t = X.current, n = new IntersectionObserver((s) => {
160
+ s[0].isIntersecting && Y && !G && Me();
161
+ }, {
162
+ root: e,
163
+ rootMargin: "0px 0px 200px 0px",
164
+ threshold: 0
165
+ });
166
+ return n.observe(t), () => n.disconnect();
167
+ }, [Y, G]);
168
+ const xe = (e) => {
169
+ var t, n;
170
+ z((t = e.data) == null ? void 0 : t.name), I(""), oe(((n = e.data) == null ? void 0 : n.id) || null);
171
+ }, Le = (e) => {
172
+ const t = le(K || "");
173
+ if (t) {
174
+ I(t);
129
175
  return;
130
176
  }
131
- t.rename(V.trim()), t == null || t.addEventListener("data:updated", G), X();
132
- }, ht = () => {
133
- X();
134
- }, X = () => {
135
- z(null), _(""), T(""), D((t) => t + 1);
136
- }, q = (t) => !t || t.trim().length === 0 ? "会话名称不能为空" : t.length > B ? `不能超过${B}个字符` : "", ft = (t) => P(void 0, null, function* () {
137
- n == null || n(t), u == null || u(t);
138
- }), yt = (t) => {
139
- const d = t.target.value;
140
- _(d), T(q(d));
177
+ e.rename(K.trim()), e == null || e.addEventListener("data:updated", de), ie();
178
+ }, Se = () => {
179
+ ie();
180
+ }, ie = () => {
181
+ oe(null), z(""), I(""), B((e) => e + 1);
182
+ }, le = (e) => !e || e.trim().length === 0 ? "会话名称不能为空" : e.length > q ? `不能超过${q}个字符` : "", Te = (e) => L(void 0, null, function* () {
183
+ r == null || r(e), N == null || N(e);
184
+ }), _e = (e) => {
185
+ const t = e.target.value;
186
+ z(t), I(le(t));
141
187
  };
142
- Y(() => {
143
- var d, o, f, l;
144
- if (!(e != null && e.id))
188
+ D(() => {
189
+ var t, n, s, d;
190
+ if (!(a != null && a.id))
145
191
  return;
146
- const t = {};
147
- typeof (a == null ? void 0 : a.knowledges) == "object" && ((d = a == null ? void 0 : a.knowledges) != null && d.default) && (t.knowledges = (o = a == null ? void 0 : a.knowledges) == null ? void 0 : o.default), typeof (a == null ? void 0 : a.promptVariables) == "object" && ((f = a == null ? void 0 : a.promptVariables) != null && f.default) && (t.promptVariables = (l = a == null ? void 0 : a.promptVariables) == null ? void 0 : l.default), v == null || v.loadSession(e.id, t);
148
- }, [e]);
149
- const J = ot((t) => {
150
- const d = h().endOf("day"), o = d.subtract(1, "day"), f = d.subtract(7, "day"), l = d.subtract(30, "day"), s = [], g = [], O = [], w = [], k = {};
151
- return t.forEach((c) => {
152
- var y;
153
- const i = h((y = c.data) == null ? void 0 : y.createdAt);
154
- if (i.isAfter(o))
192
+ const e = {};
193
+ if (typeof (o == null ? void 0 : o.knowledges) == "object" && ((t = o == null ? void 0 : o.knowledges) != null && t.default)) {
194
+ if (e.knowledges = (n = o == null ? void 0 : o.knowledges) == null ? void 0 : n.default, Array.isArray(e.knowledges) && e.knowledges.some((g) => Array.isArray(g.fileIds) && g.fileIds.length === 0))
195
+ throw Error("fileIds cannot be an empty array");
196
+ if (Ae(e.knowledges) > F)
197
+ throw Error(`knowledges and fileIds total count cannot exceed ${F}`);
198
+ }
199
+ typeof (o == null ? void 0 : o.promptVariables) == "object" && ((s = o == null ? void 0 : o.promptVariables) != null && s.default) && (e.promptVariables = (d = o == null ? void 0 : o.promptVariables) == null ? void 0 : d.default), m == null || m.loadSession(a.id, e);
200
+ }, [a]);
201
+ const ce = ve((e) => {
202
+ const t = h().endOf("day"), n = t.subtract(1, "day"), s = t.subtract(7, "day"), d = t.subtract(30, "day"), l = [], p = [], g = [], w = [], E = {};
203
+ return e.forEach((c) => {
204
+ var v;
205
+ const i = h((v = c.data) == null ? void 0 : v.createdAt);
206
+ if (i.isAfter(n))
207
+ p.push(c);
208
+ else if (i.isAfter(s))
155
209
  g.push(c);
156
- else if (i.isAfter(f))
157
- O.push(c);
158
- else if (i.isAfter(l))
210
+ else if (i.isAfter(d))
159
211
  w.push(c);
160
212
  else {
161
- const p = i.format("YYYY-MM");
162
- k[p] || (k[p] = []), k[p].push(c);
213
+ const y = i.format("YYYY-MM");
214
+ E[y] || (E[y] = []), E[y].push(c);
163
215
  }
164
- }), g.length > 0 && s.push({
216
+ }), p.length > 0 && l.push({
165
217
  title: "今天",
166
- sessions: g.sort((c, i) => {
167
- var y, p;
168
- return h((y = i.data) == null ? void 0 : y.createdAt).valueOf() - h((p = c.data) == null ? void 0 : p.createdAt).valueOf();
218
+ sessions: p.sort((c, i) => {
219
+ var v, y;
220
+ return h((v = i.data) == null ? void 0 : v.createdAt).valueOf() - h((y = c.data) == null ? void 0 : y.createdAt).valueOf();
169
221
  }),
170
222
  key: "today"
171
- }), O.length > 0 && s.push({
223
+ }), g.length > 0 && l.push({
172
224
  title: "7天内",
173
- sessions: O.sort((c, i) => {
174
- var y, p;
175
- return h((y = i.data) == null ? void 0 : y.createdAt).valueOf() - h((p = c.data) == null ? void 0 : p.createdAt).valueOf();
225
+ sessions: g.sort((c, i) => {
226
+ var v, y;
227
+ return h((v = i.data) == null ? void 0 : v.createdAt).valueOf() - h((y = c.data) == null ? void 0 : y.createdAt).valueOf();
176
228
  }),
177
229
  key: "seven-days"
178
- }), w.length > 0 && s.push({
230
+ }), w.length > 0 && l.push({
179
231
  title: "30天内",
180
232
  sessions: w.sort((c, i) => {
181
- var y, p;
182
- return h((y = i.data) == null ? void 0 : y.createdAt).valueOf() - h((p = c.data) == null ? void 0 : p.createdAt).valueOf();
233
+ var v, y;
234
+ return h((v = i.data) == null ? void 0 : v.createdAt).valueOf() - h((y = c.data) == null ? void 0 : y.createdAt).valueOf();
183
235
  }),
184
236
  key: "thirty-days"
185
- }), Object.keys(k).sort((c, i) => i.localeCompare(c)).forEach((c) => {
186
- const i = k[c].sort((y, p) => {
187
- var Q, W;
188
- return h((Q = p.data) == null ? void 0 : Q.createdAt).valueOf() - h((W = y.data) == null ? void 0 : W.createdAt).valueOf();
237
+ }), Object.keys(E).sort((c, i) => i.localeCompare(c)).forEach((c) => {
238
+ const i = E[c].sort((v, y) => {
239
+ var se, fe;
240
+ return h((se = y.data) == null ? void 0 : se.createdAt).valueOf() - h((fe = v.data) == null ? void 0 : fe.createdAt).valueOf();
189
241
  });
190
- s.push({
242
+ l.push({
191
243
  title: h(c).format("YYYY年MM月"),
192
244
  sessions: i,
193
245
  key: `month-${c}`
194
246
  });
195
- }), s;
196
- }), $ = At(() => J(L), [L, J]);
197
- return /* @__PURE__ */ r("div", {
247
+ }), l;
248
+ }), W = $e(() => ce(T), [T, ce]);
249
+ return /* @__PURE__ */ f("div", {
198
250
  className: "bot-session-container",
199
- children: /* @__PURE__ */ M("div", {
251
+ children: /* @__PURE__ */ S("div", {
200
252
  className: "agent-sessions",
201
- children: [E && (a == null ? void 0 : a.siderTitle) && /* @__PURE__ */ r("div", {
253
+ children: [M && (o == null ? void 0 : o.siderTitle) && /* @__PURE__ */ f("div", {
202
254
  className: "sessions-header",
203
- children: /* @__PURE__ */ r("div", {
255
+ children: /* @__PURE__ */ f("div", {
204
256
  className: "session-header-title",
205
- children: (A == null ? void 0 : A.name) || "-"
257
+ children: (k == null ? void 0 : k.name) || "-"
206
258
  })
207
- }), /* @__PURE__ */ M("div", {
259
+ }), /* @__PURE__ */ S("div", {
208
260
  className: "sessions-main",
209
- children: [E && /* @__PURE__ */ r("div", {
261
+ ref: U,
262
+ children: [M && /* @__PURE__ */ f("div", {
210
263
  className: "session-header-btn-wrapper",
211
- children: /* @__PURE__ */ r(bt, {
264
+ children: /* @__PURE__ */ f(Ve, {
212
265
  className: "session-header-btn",
213
- onClick: st,
266
+ onClick: be,
214
267
  type: "primary",
215
268
  children: "+ 新会话"
216
269
  })
217
- }), $ == null ? void 0 : $.map((t) => {
218
- var d;
219
- return /* @__PURE__ */ M("div", {
270
+ }), W == null ? void 0 : W.map((e) => {
271
+ var t;
272
+ return /* @__PURE__ */ S("div", {
220
273
  className: "session-group",
221
- children: [/* @__PURE__ */ r("div", {
274
+ children: [/* @__PURE__ */ f("div", {
222
275
  className: "group-header",
223
276
  style: {
224
- top: E ? 48 : 0
277
+ top: M ? 48 : 0
225
278
  },
226
- children: t.title
227
- }), (d = t.sessions) == null ? void 0 : d.map((o) => {
228
- var f, l, s, g, O, w, k, H, c;
229
- return /* @__PURE__ */ r("div", {
230
- className: Mt({
279
+ children: e.title
280
+ }), (t = e.sessions) == null ? void 0 : t.map((n) => {
281
+ var s, d, l, p, g, w, E, Z, c;
282
+ return /* @__PURE__ */ f("div", {
283
+ className: Ke({
231
284
  "session-item": !0,
232
- "session-item__active": ((f = o.data) == null ? void 0 : f.id) === ((l = e == null ? void 0 : e.data) == null ? void 0 : l.id)
285
+ "session-item__active": ((s = n.data) == null ? void 0 : s.id) === ((d = a == null ? void 0 : a.data) == null ? void 0 : d.id)
233
286
  }),
234
- onClick: () => ft(o),
235
- children: /* @__PURE__ */ r("div", {
287
+ onClick: () => Te(n),
288
+ children: /* @__PURE__ */ f("div", {
236
289
  className: "session-item-wrapper",
237
- children: /* @__PURE__ */ M("div", {
290
+ children: /* @__PURE__ */ S("div", {
238
291
  className: "session-item-top",
239
- children: [/* @__PURE__ */ r(Et.Paragraph, {
292
+ children: [/* @__PURE__ */ f(Ce.Paragraph, {
240
293
  className: "item-top-title",
241
294
  style: {
242
295
  margin: 0,
@@ -245,79 +298,90 @@ const B = 15, Lt = gt((N, m) => {
245
298
  ellipsis: {
246
299
  rows: 1,
247
300
  tooltip: {
248
- title: ((s = o.data) == null ? void 0 : s.name) || "-",
301
+ title: ((l = n.data) == null ? void 0 : l.name) || "-",
249
302
  placement: "topLeft"
250
303
  }
251
304
  },
252
- children: ((g = o.data) == null ? void 0 : g.name) || "-"
253
- }), /* @__PURE__ */ M(et, {
254
- children: [/* @__PURE__ */ r("span", {
305
+ children: ((p = n.data) == null ? void 0 : p.name) || "-"
306
+ }), /* @__PURE__ */ S(ue, {
307
+ children: [/* @__PURE__ */ f("span", {
255
308
  className: "item-top-time",
256
- children: h((O = o.data) == null ? void 0 : O.createdAt).format("MM/DD HH:mm:ss")
257
- }), /* @__PURE__ */ M("div", {
309
+ children: h((g = n.data) == null ? void 0 : g.createdAt).format("MM/DD HH:mm:ss")
310
+ }), /* @__PURE__ */ S("div", {
258
311
  className: "item-top-action",
259
312
  onClick: (i) => i.stopPropagation(),
260
- children: [/* @__PURE__ */ r(at, {
261
- open: ct === ((w = o.data) == null ? void 0 : w.id),
313
+ children: [/* @__PURE__ */ f(ye, {
314
+ open: Ee === ((w = n.data) == null ? void 0 : w.id),
262
315
  getPopupContainer: (i) => i.parentNode,
263
316
  icon: !1,
264
- title: /* @__PURE__ */ r(Ot, {
317
+ title: /* @__PURE__ */ f(He, {
265
318
  placeholder: "请输入内容",
266
319
  autoComplete: "off",
267
320
  showCount: !0,
268
- value: V,
269
- onChange: yt,
270
- maxLength: B,
271
- status: lt ? "error" : ""
321
+ value: K,
322
+ onChange: _e,
323
+ maxLength: q,
324
+ status: Ne ? "error" : ""
272
325
  }),
273
- onConfirm: () => pt(o),
274
- onCancel: ht,
275
- children: /* @__PURE__ */ r(dt, {
326
+ onConfirm: () => Le(n),
327
+ onCancel: Se,
328
+ children: /* @__PURE__ */ f(ge, {
276
329
  type: "icon-bianji2",
277
- onClick: () => mt(o),
330
+ onClick: () => xe(n),
278
331
  className: "icon-action",
279
332
  style: {
280
333
  marginRight: "8px"
281
334
  }
282
335
  })
283
- }, `edit-${(k = o.data) == null ? void 0 : k.id}-${K}`), /* @__PURE__ */ r(at, {
336
+ }, `edit-${(E = n.data) == null ? void 0 : E.id}-${ae}`), /* @__PURE__ */ f(ye, {
284
337
  getPopupContainer: (i) => i.parentNode,
285
338
  icon: !1,
286
- title: /* @__PURE__ */ M(et, {
339
+ title: /* @__PURE__ */ S(ue, {
287
340
  direction: "vertical",
288
- children: [/* @__PURE__ */ r("div", {
341
+ children: [/* @__PURE__ */ f("div", {
289
342
  children: "删除确认?"
290
- }), /* @__PURE__ */ r("div", {
343
+ }), /* @__PURE__ */ f("div", {
291
344
  children: "会话删除后不可恢复,请确认是否删除!"
292
345
  })]
293
346
  }),
294
347
  onConfirm: () => {
295
- rt(o), D((i) => i + 1);
348
+ Oe(n), B((i) => i + 1);
296
349
  },
297
350
  onCancel: () => {
298
- D((i) => i + 1);
351
+ B((i) => i + 1);
299
352
  },
300
- children: /* @__PURE__ */ r(dt, {
353
+ children: /* @__PURE__ */ f(ge, {
301
354
  style: {
302
355
  fontSize: "18px"
303
356
  },
304
357
  className: "icon-action",
305
358
  type: "icon-del"
306
359
  })
307
- }, `delete-${(H = o.data) == null ? void 0 : H.id}-${K}`)]
360
+ }, `delete-${(Z = n.data) == null ? void 0 : Z.id}-${ae}`)]
308
361
  })]
309
362
  })]
310
363
  })
311
364
  })
312
- }, (c = o.data) == null ? void 0 : c.id);
365
+ }, (c = n.data) == null ? void 0 : c.id);
313
366
  })]
314
- }, t.key);
367
+ }, e.key);
368
+ }), !Y && ke && /* @__PURE__ */ f(Fe, {
369
+ style: {
370
+ color: "rgb(199 199 199)"
371
+ },
372
+ plain: !0,
373
+ children: "没有更多数据了"
374
+ }), /* @__PURE__ */ f("div", {
375
+ ref: X,
376
+ style: {
377
+ height: 1
378
+ }
315
379
  })]
316
380
  })]
317
381
  })
318
382
  });
319
383
  });
320
- Lt.displayName = "SessionList";
384
+ Ge.displayName = "SessionList";
321
385
  export {
322
- Lt as default
386
+ Ge as default
323
387
  };