@somecat/ai-assist-sdk 1.1.16 → 1.1.23

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,69 +1,69 @@
1
- import { defineComponent as tt, ref as C, watch as wt, onUnmounted as kt, openBlock as k, createElementBlock as b, normalizeClass as _, createElementVNode as s, toDisplayString as X, createVNode as F, Transition as xt, withCtx as Wt, createTextVNode as Yt, createCommentVNode as V, reactive as Z, Fragment as K, createStaticVNode as Qt, renderList as ct, unref as $, createBlock as lt, withKeys as Xt, nextTick as z, computed as U, onMounted as I, normalizeStyle as Tt, withModifiers as Mt, Teleport as Ft, withDirectives as it, vShow as vt, vModelText as Vt, createApp as Gt } from "vue";
2
- import { r as Dt, p as Ht, u as Jt, c as Ot, g as _t, s as qt, a as $t, e as Ut, b as jt, d as Ct, f as Kt, h as zt, i as Zt, j as It, k as te, l as Nt } from "../chunks/index-DwhpwWON.mjs";
3
- import { SearchOutlined as ee, CheckOutlined as ne, CopyOutlined as se, RedoOutlined as oe } from "@ant-design/icons-vue";
1
+ import { defineComponent as ne, ref as C, watch as Ce, onUnmounted as Ae, openBlock as w, createElementBlock as S, normalizeClass as J, createElementVNode as s, toDisplayString as F, createVNode as X, Transition as Fe, withCtx as Ve, createTextVNode as Xe, createCommentVNode as V, reactive as I, Fragment as K, createStaticVNode as Ge, renderList as ue, unref as O, createBlock as ee, withKeys as Je, nextTick as Z, computed as _, onMounted as te, normalizeStyle as Te, withModifiers as He, Teleport as qe, withDirectives as re, vShow as ge, vModelText as _e, createApp as Ue } from "vue";
2
+ import { r as Oe, p as $e, u as je, c as Pe, g as Ke, s as ze, a as Ne, e as Ze, b as Ie, d as fe, f as et, h as tt, i as nt, j as st, k as ot, l as Me, w as at, m as it, n as Le } from "../chunks/index-CWRmx9Cv.mjs";
3
+ import { f as lt, s as ce, a as xe, b as rt, c as ct } from "../chunks/index-DBik4Gma.mjs";
4
+ import { SearchOutlined as ut, CheckOutlined as vt, CopyOutlined as dt, RedoOutlined as gt } from "@ant-design/icons-vue";
4
5
  import { Icon as j } from "@iconify/vue";
5
- import { f as ae, s as rt, a as ie, c as le, b as re } from "../chunks/index-CgnkZbtP.mjs";
6
- const ce = "data:image/png;base64,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", ue = { class: "thinking-block__title" }, ve = {
6
+ const mt = "data:image/png;base64,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", ht = { class: "thinking-block__title" }, ft = {
7
7
  key: 0,
8
8
  class: "thinking-block__content"
9
- }, de = {
9
+ }, pt = {
10
10
  key: 0,
11
11
  class: "streaming-cursor"
12
- }, ge = /* @__PURE__ */ tt({
12
+ }, yt = /* @__PURE__ */ ne({
13
13
  __name: "ThinkingBlock",
14
14
  props: {
15
15
  content: {},
16
16
  isStreaming: { type: Boolean }
17
17
  },
18
- setup(t) {
19
- const u = t, r = C(!1);
18
+ setup(e) {
19
+ const u = e, r = C(!1);
20
20
  function v() {
21
21
  r.value = !r.value;
22
22
  }
23
23
  const o = C(u.content), c = C(u.content.length), a = C(0);
24
- let n = 0, d = 0;
25
- function H() {
24
+ let n = 0, f = 0;
25
+ function T() {
26
26
  if (n) return;
27
- const f = 80, g = (T) => {
28
- if (d === 0) {
29
- d = T, n = requestAnimationFrame(g);
27
+ const m = 80, g = (E) => {
28
+ if (f === 0) {
29
+ f = E, n = requestAnimationFrame(g);
30
30
  return;
31
31
  }
32
- const R = Math.min(T - d, 100);
33
- d = T;
34
- const w = u.content, e = w.length - c.value;
35
- if (e > 0) {
36
- const L = f + e;
37
- a.value += L * R / 1e3;
38
- const M = Math.floor(a.value);
39
- M > 0 && (a.value -= M, c.value = Math.min(c.value + M, w.length), o.value = w.slice(0, c.value));
32
+ const b = Math.min(E - f, 100);
33
+ f = E;
34
+ const L = u.content, t = L.length - c.value;
35
+ if (t > 0) {
36
+ const x = m + t;
37
+ a.value += x * b / 1e3;
38
+ const D = Math.floor(a.value);
39
+ D > 0 && (a.value -= D, c.value = Math.min(c.value + D, L.length), o.value = L.slice(0, c.value));
40
40
  } else
41
41
  a.value = 0;
42
42
  n = requestAnimationFrame(g);
43
43
  };
44
- d = 0, n = requestAnimationFrame(g);
44
+ f = 0, n = requestAnimationFrame(g);
45
45
  }
46
- function x() {
46
+ function B() {
47
47
  n && (cancelAnimationFrame(n), n = 0);
48
48
  }
49
- function E() {
50
- x(), o.value = u.content, c.value = u.content.length, a.value = 0;
49
+ function R() {
50
+ B(), o.value = u.content, c.value = u.content.length, a.value = 0;
51
51
  }
52
- return wt(
52
+ return Ce(
53
53
  () => u.content,
54
54
  () => {
55
- u.isStreaming || E();
55
+ u.isStreaming || R();
56
56
  }
57
- ), wt(
57
+ ), Ce(
58
58
  () => u.isStreaming,
59
- (f) => {
60
- f ? H() : E();
59
+ (m) => {
60
+ m ? T() : R();
61
61
  },
62
62
  { immediate: !0 }
63
- ), kt(x), (f, g) => (k(), b("div", {
64
- class: _(["thinking-block", {
63
+ ), Ae(B), (m, g) => (w(), S("div", {
64
+ class: J(["thinking-block", {
65
65
  "thinking-block--expanded": r.value,
66
- "thinking-block--active": t.isStreaming
66
+ "thinking-block--active": e.isStreaming
67
67
  }])
68
68
  }, [
69
69
  s("div", {
@@ -71,9 +71,9 @@ const ce = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
71
71
  onClick: v
72
72
  }, [
73
73
  g[1] || (g[1] = s("span", { class: "thinking-block__indicator" }, null, -1)),
74
- s("span", ue, X(t.isStreaming ? "深度思考中" : "深度思考"), 1),
75
- (k(), b("svg", {
76
- class: _(["thinking-block__arrow", { "thinking-block__arrow--down": r.value }]),
74
+ s("span", ht, F(e.isStreaming ? "深度思考中" : "深度思考"), 1),
75
+ (w(), S("svg", {
76
+ class: J(["thinking-block__arrow", { "thinking-block__arrow--down": r.value }]),
77
77
  viewBox: "0 0 24 24",
78
78
  width: "14",
79
79
  height: "14",
@@ -86,39 +86,39 @@ const ce = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
86
86
  s("polyline", { points: "6 9 12 15 18 9" }, null, -1)
87
87
  ])], 2))
88
88
  ]),
89
- F(xt, { name: "thinking-expand" }, {
90
- default: Wt(() => [
91
- r.value ? (k(), b("div", ve, [
92
- Yt(X(o.value), 1),
93
- t.isStreaming ? (k(), b("span", de)) : V("", !0)
89
+ X(Fe, { name: "thinking-expand" }, {
90
+ default: Ve(() => [
91
+ r.value ? (w(), S("div", ft, [
92
+ Xe(F(o.value), 1),
93
+ e.isStreaming ? (w(), S("span", pt)) : V("", !0)
94
94
  ])) : V("", !0)
95
95
  ]),
96
96
  _: 1
97
97
  })
98
98
  ], 2));
99
99
  }
100
- }), me = {
100
+ }), wt = {
101
101
  key: 0,
102
102
  class: "message-content ba-markdown"
103
- }, he = { class: "agent-thought__spinner" }, fe = { class: "agent-thought__text" }, pe = { key: 2 }, ye = ["innerHTML"], we = {
103
+ }, kt = { class: "agent-thought__spinner" }, Ct = { class: "agent-thought__text" }, At = { key: 2 }, St = ["innerHTML"], bt = {
104
104
  key: 0,
105
105
  class: "streaming-cursor"
106
- }, ke = ["innerHTML"], Ce = {
106
+ }, Rt = ["innerHTML"], Et = {
107
107
  key: 0,
108
108
  class: "streaming-cursor"
109
- }, Ae = {
109
+ }, Tt = {
110
110
  key: 3,
111
111
  class: "message-error"
112
- }, Se = {
112
+ }, Mt = {
113
113
  key: 4,
114
114
  class: "message-toolbar"
115
- }, be = ["data-tooltip"], Re = {
115
+ }, Dt = ["data-tooltip"], Ht = {
116
116
  class: "tooltip-enhanced",
117
117
  "data-tooltip": "重新回答"
118
- }, Ee = {
118
+ }, Ot = {
119
119
  key: 1,
120
120
  class: "message-content"
121
- }, Te = /* @__PURE__ */ tt({
121
+ }, $t = /* @__PURE__ */ ne({
122
122
  __name: "MessageItem",
123
123
  props: {
124
124
  msg: {},
@@ -129,100 +129,100 @@ const ce = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
129
129
  setMessageRef: { type: Function }
130
130
  },
131
131
  emits: ["regenerate"],
132
- setup(t, { emit: u }) {
133
- const r = Z(/* @__PURE__ */ new Map());
132
+ setup(e, { emit: u }) {
133
+ const r = I(/* @__PURE__ */ new Map());
134
134
  function v(o, c) {
135
135
  var a;
136
136
  try {
137
137
  let n = o.content;
138
- if (!n && ((a = o.segments) != null && a.length) && (n = o.segments.filter((d) => d.type !== "thinking" && d.type !== "agent_thought").map((d) => d.content).join(`
138
+ if (!n && ((a = o.segments) != null && a.length) && (n = o.segments.filter((f) => f.type !== "thinking" && f.type !== "agent_thought").map((f) => f.content).join(`
139
139
  `)), n) {
140
- const { copy: d } = Jt();
141
- d(n), r.set(c, !0), setTimeout(() => r.set(c, !1), 2e3);
140
+ const { copy: f } = je();
141
+ f(n), r.set(c, !0), setTimeout(() => r.set(c, !1), 2e3);
142
142
  }
143
143
  } catch {
144
144
  }
145
145
  }
146
146
  return (o, c) => {
147
147
  var a;
148
- return k(), b("div", {
149
- class: _(["message", `${t.msg.type}-message`])
148
+ return w(), S("div", {
149
+ class: J(["message", `${e.msg.type}-message`])
150
150
  }, [
151
- t.msg.type === "ai" ? (k(), b(K, { key: 0 }, [
152
- (t.msg.status === t.STATUS.THINKING || t.msg.status === t.STATUS.RETHINKING) && !t.msg.thinkingContent && !t.msg.content ? (k(), b("div", me, [...c[2] || (c[2] = [
153
- Qt('<div class="scale-animation-container"><span class="scale-dot"></span><span class="scale-dot"></span><span class="scale-dot"></span><span class="scale-dot"></span></div>', 1)
151
+ e.msg.type === "ai" ? (w(), S(K, { key: 0 }, [
152
+ (e.msg.status === e.STATUS.THINKING || e.msg.status === e.STATUS.RETHINKING) && !e.msg.thinkingContent && !e.msg.content ? (w(), S("div", wt, [...c[2] || (c[2] = [
153
+ Ge('<div class="scale-animation-container"><span class="scale-dot"></span><span class="scale-dot"></span><span class="scale-dot"></span><span class="scale-dot"></span></div>', 1)
154
154
  ])])) : V("", !0),
155
- t.msg.segments && t.msg.segments.length ? (k(), b("div", {
155
+ e.msg.segments && e.msg.segments.length ? (w(), S("div", {
156
156
  key: 1,
157
157
  class: "message-content ba-markdown",
158
- ref: (n) => t.setMessageRef(n, t.index)
158
+ ref: (n) => e.setMessageRef(n, e.index)
159
159
  }, [
160
- (k(!0), b(K, null, ct(t.msg.segments, (n, d) => (k(), b(K, { key: d }, [
161
- n.type === "agent_thought" ? (k(), b("div", {
160
+ (w(!0), S(K, null, ue(e.msg.segments, (n, f) => (w(), S(K, { key: f }, [
161
+ n.type === "agent_thought" ? (w(), S("div", {
162
162
  key: 0,
163
- class: _(["agent-thought", { "agent-thought--done": n.duration != null }])
163
+ class: J(["agent-thought", { "agent-thought--done": n.duration != null }])
164
164
  }, [
165
- s("span", he, [
166
- F($(ee))
165
+ s("span", kt, [
166
+ X(O(ut))
167
167
  ]),
168
- s("span", fe, X(n.duration != null ? "工具调用" : "工具调用中..."), 1)
169
- ], 2)) : n.type === "thinking" ? (k(), lt(ge, {
168
+ s("span", Ct, F(n.duration != null ? "工具调用" : "工具调用中..."), 1)
169
+ ], 2)) : n.type === "thinking" ? (w(), ee(yt, {
170
170
  key: 1,
171
171
  content: n.content,
172
- "is-streaming": n.duration == null && (t.msg.status === t.STATUS.THINKING || t.msg.status === t.STATUS.RETHINKING)
173
- }, null, 8, ["content", "is-streaming"])) : (k(), b("div", pe, [
172
+ "is-streaming": n.duration == null && (e.msg.status === e.STATUS.THINKING || e.msg.status === e.STATUS.RETHINKING)
173
+ }, null, 8, ["content", "is-streaming"])) : (w(), S("div", At, [
174
174
  s("div", {
175
- innerHTML: $(Dt)($(Ht)(t.getSegmentDisplayContent(t.index, d, n, t.msg)))
176
- }, null, 8, ye)
175
+ innerHTML: O(Oe)(O($e)(e.getSegmentDisplayContent(e.index, f, n, e.msg)))
176
+ }, null, 8, St)
177
177
  ]))
178
178
  ], 64))), 128)),
179
- t.msg.status === t.STATUS.ANSWERING ? (k(), b("span", we)) : V("", !0)
179
+ e.msg.status === e.STATUS.ANSWERING ? (w(), S("span", bt)) : V("", !0)
180
180
  ], 512)) : V("", !0),
181
- !((a = t.msg.segments) != null && a.length) && t.msg.content ? (k(), b("div", {
181
+ !((a = e.msg.segments) != null && a.length) && e.msg.content ? (w(), S("div", {
182
182
  key: 2,
183
183
  class: "message-content ba-markdown",
184
- ref: (n) => t.setMessageRef(n, t.index)
184
+ ref: (n) => e.setMessageRef(n, e.index)
185
185
  }, [
186
186
  s("div", {
187
- innerHTML: $(Dt)($(Ht)(t.displayedContent.get(t.index) ?? t.msg.content))
188
- }, null, 8, ke),
189
- t.msg.status === t.STATUS.ANSWERING ? (k(), b("span", Ce)) : V("", !0)
187
+ innerHTML: O(Oe)(O($e)(e.displayedContent.get(e.index) ?? e.msg.content))
188
+ }, null, 8, Rt),
189
+ e.msg.status === e.STATUS.ANSWERING ? (w(), S("span", Et)) : V("", !0)
190
190
  ], 512)) : V("", !0),
191
- t.msg.errorMessage ? (k(), b("div", Ae, [
191
+ e.msg.errorMessage ? (w(), S("div", Tt, [
192
192
  c[3] || (c[3] = s("span", { class: "message-error__icon" }, "⚠️", -1)),
193
- s("span", null, X(t.msg.errorMessage), 1)
193
+ s("span", null, F(e.msg.errorMessage), 1)
194
194
  ])) : V("", !0),
195
- t.msg.status === t.STATUS.COMPLETED || t.msg.status === t.STATUS.STOP ? (k(), b("div", Se, [
195
+ e.msg.status === e.STATUS.COMPLETED || e.msg.status === e.STATUS.STOP ? (w(), S("div", Mt, [
196
196
  s("div", {
197
197
  class: "tooltip-enhanced",
198
- "data-tooltip": r.get(t.index) ? "已复制" : "复制回答"
198
+ "data-tooltip": r.get(e.index) ? "已复制" : "复制回答"
199
199
  }, [
200
- r.get(t.index) ? (k(), lt($(ne), {
200
+ r.get(e.index) ? (w(), ee(O(vt), {
201
201
  key: 0,
202
202
  class: "message-toolbar__check"
203
- })) : (k(), lt($(se), {
203
+ })) : (w(), ee(O(dt), {
204
204
  key: 1,
205
- onClick: c[0] || (c[0] = (n) => v(t.msg, t.index))
205
+ onClick: c[0] || (c[0] = (n) => v(e.msg, e.index))
206
206
  }))
207
- ], 8, be),
208
- s("div", Re, [
209
- F($(oe), {
207
+ ], 8, Dt),
208
+ s("div", Ht, [
209
+ X(O(gt), {
210
210
  onClick: c[1] || (c[1] = (n) => o.$emit("regenerate"))
211
211
  })
212
212
  ])
213
213
  ])) : V("", !0)
214
- ], 64)) : (k(), b("div", Ee, X(t.msg.content), 1))
214
+ ], 64)) : (w(), S("div", Ot, F(e.msg.content), 1))
215
215
  ], 2);
216
216
  };
217
217
  }
218
- }), Me = { class: "input-container" }, De = ["value", "disabled"], He = {
218
+ }), Pt = { class: "input-container" }, Nt = ["value", "disabled"], Bt = {
219
219
  key: 0,
220
220
  class: "tooltip-enhanced stop",
221
221
  "data-tooltip": "停止生成"
222
- }, Oe = ["data-tooltip"], $e = {
222
+ }, Lt = ["data-tooltip"], xt = {
223
223
  key: 2,
224
224
  class: "moveTB"
225
- }, Pe = /* @__PURE__ */ tt({
225
+ }, Wt = /* @__PURE__ */ ne({
226
226
  __name: "ChatInput",
227
227
  props: {
228
228
  modelValue: {},
@@ -232,35 +232,35 @@ const ce = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
232
232
  isAtBottom: { type: Boolean }
233
233
  },
234
234
  emits: ["update:modelValue", "send", "stop", "scroll-to-bottom"],
235
- setup(t) {
236
- return (u, r) => (k(), b("div", Me, [
235
+ setup(e) {
236
+ return (u, r) => (w(), S("div", Pt, [
237
237
  s("input", {
238
- value: t.modelValue,
238
+ value: e.modelValue,
239
239
  type: "text",
240
240
  placeholder: "给AI助手发送消息...",
241
241
  onInput: r[0] || (r[0] = (v) => u.$emit("update:modelValue", v.target.value)),
242
- onKeyup: r[1] || (r[1] = Xt((v) => t.modelValue.trim() && u.$emit("send"), ["enter"])),
243
- disabled: t.isGenerating
244
- }, null, 40, De),
245
- t.isGenerating && t.lastUserMessage ? (k(), b("div", He, [
246
- F($(j), {
242
+ onKeyup: r[1] || (r[1] = Je((v) => e.modelValue.trim() && u.$emit("send"), ["enter"])),
243
+ disabled: e.isGenerating
244
+ }, null, 40, Nt),
245
+ e.isGenerating && e.lastUserMessage ? (w(), S("div", Bt, [
246
+ X(O(j), {
247
247
  class: "op-icon stop-icon",
248
248
  icon: "heroicons-solid:stop",
249
249
  onClick: r[2] || (r[2] = (v) => u.$emit("stop"))
250
250
  })
251
- ])) : (k(), b("div", {
251
+ ])) : (w(), S("div", {
252
252
  key: 1,
253
- class: _(["tooltip-enhanced send", { disabled: !t.modelValue.trim() }]),
254
- "data-tooltip": t.modelValue.trim() ? "开始回答" : "请输入你的问题"
253
+ class: J(["tooltip-enhanced send", { disabled: !e.modelValue.trim() }]),
254
+ "data-tooltip": e.modelValue.trim() ? "开始回答" : "请输入你的问题"
255
255
  }, [
256
- F($(j), {
256
+ X(O(j), {
257
257
  class: "op-icon",
258
258
  icon: "fluent-color:send-16",
259
- onClick: r[3] || (r[3] = (v) => t.modelValue.trim() && u.$emit("send"))
259
+ onClick: r[3] || (r[3] = (v) => e.modelValue.trim() && u.$emit("send"))
260
260
  })
261
- ], 10, Oe)),
262
- t.hasScroll && !t.isAtBottom ? (k(), b("div", $e, [
263
- F($(j), {
261
+ ], 10, Lt)),
262
+ e.hasScroll && !e.isAtBottom ? (w(), S("div", xt, [
263
+ X(O(j), {
264
264
  class: "op-icon",
265
265
  icon: "ep:bottom",
266
266
  onClick: r[4] || (r[4] = (v) => u.$emit("scroll-to-bottom"))
@@ -269,30 +269,30 @@ const ce = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
269
269
  ]));
270
270
  }
271
271
  });
272
- function Ne(t) {
272
+ function Yt(e) {
273
273
  const u = C(!0), r = C(!1);
274
274
  function v() {
275
- z(() => {
276
- t.value && (t.value.scrollTop = t.value.scrollHeight);
275
+ Z(() => {
276
+ e.value && (e.value.scrollTop = e.value.scrollHeight);
277
277
  });
278
278
  }
279
279
  function o() {
280
- if (!t.value) return;
281
- const c = t.value, a = c.scrollTop + c.clientHeight >= c.scrollHeight - 1, n = c.scrollHeight > c.clientHeight;
280
+ if (!e.value) return;
281
+ const c = e.value, a = c.scrollTop + c.clientHeight >= c.scrollHeight - 1, n = c.scrollHeight > c.clientHeight;
282
282
  u.value = a, r.value = n;
283
283
  }
284
284
  return { isAtBottom: u, hasScroll: r, scrollToBottom: v, checkScrollStatus: o };
285
285
  }
286
- function Be() {
287
- function t(u) {
286
+ function Qt() {
287
+ function e(u) {
288
288
  u.querySelectorAll("pre").forEach((v) => {
289
289
  if (v.querySelector(".copy-button")) return;
290
290
  const o = v.querySelector("code");
291
291
  if (!o) return;
292
- const a = (Array.from(o.classList).find((d) => d.startsWith("language-")) || "").replace("language-", "");
292
+ const a = (Array.from(o.classList).find((f) => f.startsWith("language-")) || "").replace("language-", "");
293
293
  if (a) {
294
- const d = document.createElement("span");
295
- d.className = "code-lang", d.textContent = a, v.appendChild(d);
294
+ const f = document.createElement("span");
295
+ f.className = "code-lang", f.textContent = a, v.appendChild(f);
296
296
  }
297
297
  const n = document.createElement("button");
298
298
  n.className = "copy-button", n.textContent = "复制", n.onclick = () => {
@@ -304,79 +304,79 @@ function Be() {
304
304
  }, v.appendChild(n);
305
305
  });
306
306
  }
307
- return { enhanceCodeBlocks: t };
307
+ return { enhanceCodeBlocks: e };
308
308
  }
309
- function Le(t) {
309
+ function Ft(e) {
310
310
  let u = null, r = 0;
311
311
  function v(c) {
312
- u = c(u || [...t.value]), r || (r = requestAnimationFrame(() => {
313
- r = 0, u && (t.value = u, u = null);
312
+ u = c(u || [...e.value]), r || (r = requestAnimationFrame(() => {
313
+ r = 0, u && (e.value = u, u = null);
314
314
  }));
315
315
  }
316
316
  function o() {
317
- r && (cancelAnimationFrame(r), r = 0), u && (t.value = u, u = null);
317
+ r && (cancelAnimationFrame(r), r = 0), u && (e.value = u, u = null);
318
318
  }
319
319
  return { batchMessagesUpdate: v, flushMessagesBatch: o };
320
320
  }
321
- function xe(t, u, r) {
322
- const v = Z(/* @__PURE__ */ new Map()), o = C(/* @__PURE__ */ new Map()), c = C(/* @__PURE__ */ new Map());
321
+ function Vt(e, u, r) {
322
+ const v = I(/* @__PURE__ */ new Map()), o = C(/* @__PURE__ */ new Map()), c = C(/* @__PURE__ */ new Map());
323
323
  let a = 0, n = 0;
324
- function d() {
324
+ function f() {
325
325
  if (a) return;
326
- const f = 50, g = 100, T = (R) => {
326
+ const m = 50, g = 100, E = (b) => {
327
327
  if (n === 0) {
328
- n = R, a = requestAnimationFrame(T);
328
+ n = b, a = requestAnimationFrame(E);
329
329
  return;
330
330
  }
331
- const w = Math.min(R - n, 100);
332
- n = R;
333
- let e = !1;
334
- if (t.value.forEach((M, P) => {
335
- if (M.type !== "ai" || M.status !== r) return;
336
- const i = M.content, m = o.value.get(P) ?? 0, S = i.length - m;
337
- if (S > 0) {
338
- e = !0;
339
- const y = Math.min(f + S, g), l = (c.value.get(P) ?? 0) + y * w / 1e3, p = Math.floor(l);
340
- if (p > 0) {
341
- c.value.set(P, l - p);
342
- const A = Math.min(m + p, i.length);
343
- o.value.set(P, A), v.set(P, i.slice(0, A));
331
+ const L = Math.min(b - n, 100);
332
+ n = b;
333
+ let t = !1;
334
+ if (e.value.forEach((D, H) => {
335
+ if (D.type !== "ai" || D.status !== r) return;
336
+ const l = D.content, p = o.value.get(H) ?? 0, A = l.length - p;
337
+ if (A > 0) {
338
+ t = !0;
339
+ const y = Math.min(m + A, g), i = (c.value.get(H) ?? 0) + y * L / 1e3, h = Math.floor(i);
340
+ if (h > 0) {
341
+ c.value.set(H, i - h);
342
+ const k = Math.min(p + h, l.length);
343
+ o.value.set(H, k), v.set(H, l.slice(0, k));
344
344
  } else
345
- c.value.set(P, l);
345
+ c.value.set(H, i);
346
346
  } else
347
- c.value.set(P, 0);
348
- }), e && u(), !t.value.some((M) => M.type === "ai" && M.status === r)) {
347
+ c.value.set(H, 0);
348
+ }), t && u(), !e.value.some((D) => D.type === "ai" && D.status === r)) {
349
349
  a = 0;
350
350
  return;
351
351
  }
352
- a = requestAnimationFrame(T);
352
+ a = requestAnimationFrame(E);
353
353
  };
354
- n = 0, a = requestAnimationFrame(T);
354
+ n = 0, a = requestAnimationFrame(E);
355
355
  }
356
- function H() {
357
- a && (cancelAnimationFrame(a), a = 0), t.value.forEach((f, g) => {
358
- f.type === "ai" && (v.set(g, f.content), o.value.set(g, f.content.length), c.value.set(g, 0));
356
+ function T() {
357
+ a && (cancelAnimationFrame(a), a = 0), e.value.forEach((m, g) => {
358
+ m.type === "ai" && (v.set(g, m.content), o.value.set(g, m.content.length), c.value.set(g, 0));
359
359
  });
360
360
  }
361
- function x() {
361
+ function B() {
362
362
  a && (cancelAnimationFrame(a), a = 0);
363
363
  }
364
- function E(f, g, T, R) {
365
- if (T.type !== "answer" || R.status !== r) return T.content;
366
- const w = R.segments || [];
367
- if (w.slice(g + 1).some((i) => i.type === "answer")) return T.content;
368
- const L = o.value.get(f);
369
- if (L == null) return T.content;
370
- let M = 0;
371
- for (let i = 0; i < g; i++)
372
- w[i].type === "answer" && (M += w[i].content.length);
373
- const P = M + T.content.length;
374
- return L >= P ? T.content : L <= M ? "" : T.content.slice(0, L - M);
364
+ function R(m, g, E, b) {
365
+ if (E.type !== "answer" || b.status !== r) return E.content;
366
+ const L = b.segments || [];
367
+ if (L.slice(g + 1).some((l) => l.type === "answer")) return E.content;
368
+ const x = o.value.get(m);
369
+ if (x == null) return E.content;
370
+ let D = 0;
371
+ for (let l = 0; l < g; l++)
372
+ L[l].type === "answer" && (D += L[l].content.length);
373
+ const H = D + E.content.length;
374
+ return x >= H ? E.content : x <= D ? "" : E.content.slice(0, x - D);
375
375
  }
376
- return { displayedContent: v, streamingIndexRef: o, startTypewriter: d, flushTypewriter: H, getSegmentDisplayContent: E, stopTypewriter: x };
376
+ return { displayedContent: v, streamingIndexRef: o, startTypewriter: f, flushTypewriter: T, getSegmentDisplayContent: R, stopTypewriter: B };
377
377
  }
378
- function We({
379
- messages: t,
378
+ function Xt({
379
+ messages: e,
380
380
  isGenerating: u,
381
381
  lastUserMessage: r,
382
382
  batchMessagesUpdate: v,
@@ -384,248 +384,248 @@ function We({
384
384
  STATUS: c,
385
385
  cfg: a
386
386
  }) {
387
- const n = C(/* @__PURE__ */ new Map()), d = C(/* @__PURE__ */ new Map()), H = C(/* @__PURE__ */ new Map()), x = C(/* @__PURE__ */ new Map()), E = C(!1);
388
- function f(R) {
389
- const w = n.value.get(R) || [];
390
- v((e) => {
391
- if (e[R]) {
392
- const L = [...e];
393
- return L[R] = { ...L[R], segments: w.map((M) => ({ ...M })) }, L;
387
+ const n = C(/* @__PURE__ */ new Map()), f = C(/* @__PURE__ */ new Map()), T = C(/* @__PURE__ */ new Map()), B = C(/* @__PURE__ */ new Map()), R = C(!1);
388
+ function m(b) {
389
+ const L = n.value.get(b) || [];
390
+ v((t) => {
391
+ if (t[b]) {
392
+ const x = [...t];
393
+ return x[b] = { ...x[b], segments: L.map((D) => ({ ...D })) }, x;
394
394
  }
395
- return e;
395
+ return t;
396
396
  });
397
397
  }
398
- function g(R) {
399
- const w = n.value.get(R) || [], e = H.value.get(R);
400
- let L = 0, M = !1;
401
- w.forEach((P) => {
402
- if (P.type === "thinking" && P.duration == null) {
403
- const i = e ? Math.round((Date.now() - e) / 1e3 * 10) / 10 : 0;
404
- P.duration = i, L += i, M = !0;
398
+ function g(b) {
399
+ const L = n.value.get(b) || [], t = T.value.get(b);
400
+ let x = 0, D = !1;
401
+ L.forEach((H) => {
402
+ if (H.type === "thinking" && H.duration == null) {
403
+ const l = t ? Math.round((Date.now() - t) / 1e3 * 10) / 10 : 0;
404
+ H.duration = l, x += l, D = !0;
405
405
  }
406
- }), M && (n.value.set(R, w), v((P) => {
407
- if (P[R]) {
408
- const i = [...P];
409
- return i[R] = {
410
- ...i[R],
411
- segments: w.map((m) => ({ ...m })),
412
- thinkingDuration: (i[R].thinkingDuration || 0) + L
413
- }, i;
406
+ }), D && (n.value.set(b, L), v((H) => {
407
+ if (H[b]) {
408
+ const l = [...H];
409
+ return l[b] = {
410
+ ...l[b],
411
+ segments: L.map((p) => ({ ...p })),
412
+ thinkingDuration: (l[b].thinkingDuration || 0) + x
413
+ }, l;
414
414
  }
415
- return P;
415
+ return H;
416
416
  }));
417
417
  }
418
- async function T(R, w, e, L, M = !1) {
419
- E.value = !1, n.value.set(e, []), u.value = !0;
418
+ async function E(b, L, t, x, D = !1) {
419
+ R.value = !1, n.value.set(t, []), u.value = !0;
420
420
  try {
421
- const P = a.baseUrl.replace(/\/+$/, "") + "/" + R.replace(/^\/+/, "");
422
- await ae(P, {
421
+ const H = a.baseUrl.replace(/\/+$/, "") + "/" + b.replace(/^\/+/, "");
422
+ await lt(H, {
423
423
  method: "POST",
424
424
  headers: { "Content-Type": "application/json" },
425
- body: JSON.stringify({ app: a.app ?? 1, data: w }),
426
- signal: L,
425
+ body: JSON.stringify({ app: a.app ?? 1, data: L }),
426
+ signal: x,
427
427
  openWhenHidden: !0,
428
- async onopen(i) {
429
- i.ok || console.error("[ai-assist-sdk] ❌ SSE 连接失败:", i.status, i.statusText);
428
+ async onopen(l) {
429
+ l.ok || console.error("[ai-assist-sdk] ❌ SSE 连接失败:", l.status, l.statusText);
430
430
  },
431
- onmessage(i) {
432
- var m;
431
+ onmessage(l) {
432
+ var p;
433
433
  try {
434
- let S = i.data || "";
435
- for (; S.startsWith("data:"); )
436
- S = S.replace(/^data:\s*/, "");
437
- if (!S) return;
434
+ let A = l.data || "";
435
+ for (; A.startsWith("data:"); )
436
+ A = A.replace(/^data:\s*/, "");
437
+ if (!A) return;
438
438
  let y;
439
439
  try {
440
- y = JSON.parse(S);
440
+ y = JSON.parse(A);
441
441
  } catch {
442
442
  return;
443
443
  }
444
444
  switch (y.event) {
445
445
  case "message_start":
446
- M || (r.value = y.id), d.value.set(e, "answer");
446
+ D || (r.value = y.id), f.value.set(t, "answer");
447
447
  break;
448
448
  case "think_message_output_start": {
449
- H.value.set(e, Date.now()), d.value.set(e, "thinking");
450
- const l = n.value.get(e) || [];
451
- n.value.set(e, [...l, { type: "thinking", content: "" }]), f(e);
449
+ T.value.set(t, Date.now()), f.value.set(t, "thinking");
450
+ const i = n.value.get(t) || [];
451
+ n.value.set(t, [...i, { type: "thinking", content: "" }]), m(t);
452
452
  break;
453
453
  }
454
454
  case "agent_thought": {
455
- const l = y.thought || y.thinking || "", p = n.value.get(e) || [], A = p[p.length - 1];
456
- A && A.type === "agent_thought" ? A.content += l : (d.value.set(e, "agent_thought"), p.push({ type: "agent_thought", content: l }), x.value.set(e, Date.now())), n.value.set(e, p), v((O) => {
457
- if (O[e]) {
458
- const N = [...O];
459
- return N[e] = {
460
- ...N[e],
461
- segments: p.map((B) => ({ ...B })),
462
- thinkingContent: (N[e].thinkingContent || "") + l,
455
+ const i = y.thought || y.thinking || "", h = n.value.get(t) || [], k = h[h.length - 1];
456
+ k && k.type === "agent_thought" ? k.content += i : (f.value.set(t, "agent_thought"), h.push({ type: "agent_thought", content: i }), B.value.set(t, Date.now())), n.value.set(t, h), v(($) => {
457
+ if ($[t]) {
458
+ const P = [...$];
459
+ return P[t] = {
460
+ ...P[t],
461
+ segments: h.map((N) => ({ ...N })),
462
+ thinkingContent: (P[t].thinkingContent || "") + i,
463
463
  status: c.THINKING
464
- }, N;
464
+ }, P;
465
465
  }
466
- return O;
466
+ return $;
467
467
  });
468
468
  break;
469
469
  }
470
470
  case "think_message": {
471
- const l = y.thinking || y.answer || y.text || "", p = n.value.get(e) || [], A = p[p.length - 1];
472
- A && A.type === "thinking" ? A.content += l : (p.push({ type: "thinking", content: l }), H.value.set(e, Date.now())), n.value.set(e, p), v((O) => {
473
- if (O[e]) {
474
- const N = [...O];
475
- return N[e] = {
476
- ...N[e],
477
- segments: p.map((B) => ({ ...B })),
478
- thinkingContent: (N[e].thinkingContent || "") + l,
471
+ const i = y.thinking || y.answer || y.text || "", h = n.value.get(t) || [], k = h[h.length - 1];
472
+ k && k.type === "thinking" ? k.content += i : (h.push({ type: "thinking", content: i }), T.value.set(t, Date.now())), n.value.set(t, h), v(($) => {
473
+ if ($[t]) {
474
+ const P = [...$];
475
+ return P[t] = {
476
+ ...P[t],
477
+ segments: h.map((N) => ({ ...N })),
478
+ thinkingContent: (P[t].thinkingContent || "") + i,
479
479
  status: c.THINKING
480
- }, N;
480
+ }, P;
481
481
  }
482
- return O;
482
+ return $;
483
483
  });
484
484
  break;
485
485
  }
486
486
  case "agent_thought_end": {
487
- const l = x.value.get(e), p = l ? Math.round((Date.now() - l) / 1e3 * 10) / 10 : 0, A = n.value.get(e) || [], O = A[A.length - 1];
488
- O && O.type === "agent_thought" && (O.duration = p), n.value.set(e, A), v((N) => {
489
- if (N[e]) {
490
- const B = [...N];
491
- return B[e] = {
492
- ...B[e],
493
- segments: A.map((G) => ({ ...G })),
494
- thinkingDuration: (B[e].thinkingDuration || 0) + p
495
- }, B;
487
+ const i = B.value.get(t), h = i ? Math.round((Date.now() - i) / 1e3 * 10) / 10 : 0, k = n.value.get(t) || [], $ = k[k.length - 1];
488
+ $ && $.type === "agent_thought" && ($.duration = h), n.value.set(t, k), v((P) => {
489
+ if (P[t]) {
490
+ const N = [...P];
491
+ return N[t] = {
492
+ ...N[t],
493
+ segments: k.map((G) => ({ ...G })),
494
+ thinkingDuration: (N[t].thinkingDuration || 0) + h
495
+ }, N;
496
496
  }
497
- return N;
497
+ return P;
498
498
  });
499
499
  break;
500
500
  }
501
501
  case "think_message_output_end": {
502
- const l = H.value.get(e), p = l ? Math.round((Date.now() - l) / 1e3 * 10) / 10 : 0, A = n.value.get(e) || [], O = A[A.length - 1];
503
- O && O.type === "thinking" && (O.duration = p), n.value.set(e, A), v((N) => {
504
- if (N[e]) {
505
- const B = [...N];
506
- return B[e] = {
507
- ...B[e],
508
- segments: A.map((G) => ({ ...G })),
509
- thinkingDuration: (B[e].thinkingDuration || 0) + p
510
- }, B;
502
+ const i = T.value.get(t), h = i ? Math.round((Date.now() - i) / 1e3 * 10) / 10 : 0, k = n.value.get(t) || [], $ = k[k.length - 1];
503
+ $ && $.type === "thinking" && ($.duration = h), n.value.set(t, k), v((P) => {
504
+ if (P[t]) {
505
+ const N = [...P];
506
+ return N[t] = {
507
+ ...N[t],
508
+ segments: k.map((G) => ({ ...G })),
509
+ thinkingDuration: (N[t].thinkingDuration || 0) + h
510
+ }, N;
511
511
  }
512
- return N;
512
+ return P;
513
513
  });
514
514
  break;
515
515
  }
516
516
  case "tool_message": {
517
- const l = y.answer || y.text || y.content || "";
518
- if (!l) break;
519
- const p = n.value.get(e) || [];
520
- p.push({ type: "answer", content: l }), n.value.set(e, p), f(e);
517
+ const i = y.answer || y.text || y.content || "";
518
+ if (!i) break;
519
+ const h = n.value.get(t) || [];
520
+ h.push({ type: "answer", content: i }), n.value.set(t, h), m(t);
521
521
  break;
522
522
  }
523
523
  case "message_output_start":
524
- d.value.set(e, "answer"), g(e);
524
+ f.value.set(t, "answer"), g(t);
525
525
  break;
526
526
  case "message": {
527
- const l = y.answer || "", p = d.value.get(e), A = n.value.get(e) || [], O = A[A.length - 1];
528
- p === "answer" && O && O.type === "answer" ? O.content += l : (g(e), d.value.set(e, "answer"), A.push({ type: "answer", content: l })), n.value.set(e, A);
529
- const N = A.filter((B) => B.type === "answer").map((B) => B.content).join("");
530
- v((B) => {
531
- if (B[e]) {
532
- const G = [...B];
533
- return G[e] = {
534
- ...G[e],
535
- segments: A.map((ut) => ({ ...ut })),
536
- content: N,
537
- status: E.value ? c.STOP : c.ANSWERING
527
+ const i = y.answer || "", h = f.value.get(t), k = n.value.get(t) || [], $ = k[k.length - 1];
528
+ h === "answer" && $ && $.type === "answer" ? $.content += i : (g(t), f.value.set(t, "answer"), k.push({ type: "answer", content: i })), n.value.set(t, k);
529
+ const P = k.filter((N) => N.type === "answer").map((N) => N.content).join("");
530
+ v((N) => {
531
+ if (N[t]) {
532
+ const G = [...N];
533
+ return G[t] = {
534
+ ...G[t],
535
+ segments: k.map((ve) => ({ ...ve })),
536
+ content: P,
537
+ status: R.value ? c.STOP : c.ANSWERING
538
538
  }, G;
539
539
  }
540
- return B;
540
+ return N;
541
541
  });
542
542
  break;
543
543
  }
544
544
  case "message_end": {
545
545
  o();
546
- const l = [...t.value];
547
- l[e] && (l[e] = { ...l[e], status: E.value ? c.STOP : c.COMPLETED }), t.value = l, u.value = !1;
546
+ const i = [...e.value];
547
+ i[t] && (i[t] = { ...i[t], status: R.value ? c.STOP : c.COMPLETED }), e.value = i, u.value = !1;
548
548
  break;
549
549
  }
550
550
  case "agent_error":
551
551
  case "message_failed": {
552
552
  o();
553
- const l = [...t.value];
554
- l[e] && (l[e] = {
555
- ...l[e],
553
+ const i = [...e.value];
554
+ i[t] && (i[t] = {
555
+ ...i[t],
556
556
  status: c.ERROR,
557
557
  content: y.error_msg || y.message || "请求失败",
558
558
  errorMessage: y.error_msg || y.message || "请求失败"
559
- }, t.value = l), u.value = !1;
559
+ }, e.value = i), u.value = !1;
560
560
  break;
561
561
  }
562
562
  case "message_replace": {
563
- const l = y.answer || "", p = n.value.get(e) || [], A = (m = p.map((O, N) => ({ s: O, i: N })).reverse().find((O) => O.s.type === "answer")) == null ? void 0 : m.i;
564
- A != null ? p[A] = { ...p[A], content: l } : p.push({ type: "answer", content: l }), n.value.set(e, p), v((O) => {
565
- if (O[e]) {
566
- const N = [...O];
567
- return N[e] = {
568
- ...N[e],
569
- segments: p.map((B) => ({ ...B })),
570
- content: l
571
- }, N;
563
+ const i = y.answer || "", h = n.value.get(t) || [], k = (p = h.map(($, P) => ({ s: $, i: P })).reverse().find(($) => $.s.type === "answer")) == null ? void 0 : p.i;
564
+ k != null ? h[k] = { ...h[k], content: i } : h.push({ type: "answer", content: i }), n.value.set(t, h), v(($) => {
565
+ if ($[t]) {
566
+ const P = [...$];
567
+ return P[t] = {
568
+ ...P[t],
569
+ segments: h.map((N) => ({ ...N })),
570
+ content: i
571
+ }, P;
572
572
  }
573
- return O;
573
+ return $;
574
574
  });
575
575
  break;
576
576
  }
577
577
  case "message_cost": {
578
- const l = {
578
+ const i = {
579
579
  inputTokens: y.input_tokens || 0,
580
580
  outputTokens: y.output_tokens || 0,
581
581
  latency: y.latency || 0,
582
582
  latencyFirstResp: y.latency_first_resp
583
583
  };
584
- v((p) => {
585
- if (p[e]) {
586
- const A = [...p];
587
- return A[e] = { ...A[e], cost: l }, A;
584
+ v((h) => {
585
+ if (h[t]) {
586
+ const k = [...h];
587
+ return k[t] = { ...k[t], cost: i }, k;
588
588
  }
589
- return p;
589
+ return h;
590
590
  });
591
591
  break;
592
592
  }
593
593
  default:
594
594
  }
595
- } catch (S) {
596
- console.error("[ai-assist-sdk] onmessage 解析失败:", S);
595
+ } catch (A) {
596
+ console.error("[ai-assist-sdk] onmessage 解析失败:", A);
597
597
  }
598
598
  },
599
599
  onclose() {
600
- o(), g(e), o();
601
- const m = (n.value.get(e) || []).filter((y) => y.type === "answer").map((y) => y.content).join(""), S = [...t.value];
602
- S[e] && S[e].status !== c.ERROR && (S[e] = {
603
- ...S[e],
604
- content: E.value && !m ? "已停止回答" : m,
605
- status: E.value ? c.STOP : c.COMPLETED
606
- }), t.value = S, u.value = !1;
600
+ o(), g(t), o();
601
+ const p = (n.value.get(t) || []).filter((y) => y.type === "answer").map((y) => y.content).join(""), A = [...e.value];
602
+ A[t] && A[t].status !== c.ERROR && (A[t] = {
603
+ ...A[t],
604
+ content: R.value && !p ? "已停止回答" : p,
605
+ status: R.value ? c.STOP : c.COMPLETED
606
+ }), e.value = A, u.value = !1;
607
607
  },
608
- onerror(i) {
609
- console.error("[ai-assist-sdk] ❌ 连接错误:", i), o();
610
- const m = [...t.value];
611
- m[e] && (m[e] = { ...m[e], content: `
612
- ⚠️ 请求异常,已终止`, status: c.ERROR }), t.value = m, u.value = !1;
608
+ onerror(l) {
609
+ console.error("[ai-assist-sdk] ❌ 连接错误:", l), o();
610
+ const p = [...e.value];
611
+ p[t] && (p[t] = { ...p[t], content: `
612
+ ⚠️ 请求异常,已终止`, status: c.ERROR }), e.value = p, u.value = !1;
613
613
  }
614
614
  });
615
- } catch (P) {
616
- if (console.error("[ai-assist-sdk] doStreamRequest error:", P), !E.value) {
615
+ } catch (H) {
616
+ if (console.error("[ai-assist-sdk] doStreamRequest error:", H), !R.value) {
617
617
  o();
618
- const i = [...t.value];
619
- i[e] && (i[e] = { ...i[e], content: "服务连接失败,请稍后重试", status: c.ERROR }), t.value = i, u.value = !1;
618
+ const l = [...e.value];
619
+ l[t] && (l[t] = { ...l[t], content: "服务连接失败,请稍后重试", status: c.ERROR }), e.value = l, u.value = !1;
620
620
  }
621
621
  }
622
622
  }
623
- return { doStreamRequest: T, issTop: E };
623
+ return { doStreamRequest: E, issTop: R };
624
624
  }
625
- function Pt(t) {
625
+ function Be(e) {
626
626
  var u;
627
- if (t && typeof t == "object" && typeof t.data == "string" && (t = t.data), typeof t == "string") {
628
- const r = t.split(`
627
+ if (e && typeof e == "object" && typeof e.data == "string" && (e = e.data), typeof e == "string") {
628
+ const r = e.split(`
629
629
  `);
630
630
  let v = "";
631
631
  for (const o of r) {
@@ -637,15 +637,15 @@ function Pt(t) {
637
637
  } catch {
638
638
  }
639
639
  }
640
- return v || t;
640
+ return v || e;
641
641
  }
642
- return (t == null ? void 0 : t.answer) || ((u = t == null ? void 0 : t.data) == null ? void 0 : u.answer) || String(t || "");
642
+ return (e == null ? void 0 : e.answer) || ((u = e == null ? void 0 : e.data) == null ? void 0 : u.answer) || String(e || "");
643
643
  }
644
- function Ye(t) {
645
- return t.queryAgainStreamApi || t.queryAgainApi || t.chatQueryStreamApi || t.chatQueryApi;
644
+ function Gt(e) {
645
+ return e.queryAgainStreamApi || e.queryAgainApi || e.chatQueryStreamApi || e.chatQueryApi;
646
646
  }
647
- function Qe({
648
- messages: t,
647
+ function Jt({
648
+ messages: e,
649
649
  userInput: u,
650
650
  isGenerating: r,
651
651
  lastUserMessage: v,
@@ -653,139 +653,139 @@ function Qe({
653
653
  doStreamRequest: c,
654
654
  issTop: a,
655
655
  scrollToBottom: n,
656
- STATUS: d,
657
- cfg: H,
658
- onTitleGenerated: x
656
+ STATUS: f,
657
+ cfg: T,
658
+ onTitleGenerated: B
659
659
  }) {
660
- const E = H.apis, f = Z({
660
+ const R = T.apis, m = I({
661
661
  first: new AbortController(),
662
662
  again: new AbortController()
663
663
  }), g = C(!1);
664
- async function T(i, m) {
664
+ async function E(l, p) {
665
665
  var y;
666
- if (!H.titleGenerateApp || !E.updateConversationApi || g.value) return;
667
- let S = o.value;
668
- if (!S)
666
+ if (!T.titleGenerateApp || !R.updateConversationApi || g.value) return;
667
+ let A = o.value;
668
+ if (!A)
669
669
  try {
670
- const l = await Ot(E);
671
- (y = l == null ? void 0 : l.conversation) != null && y.appConversationID && (S = l.conversation.appConversationID, o.value = S);
672
- } catch (l) {
673
- console.error("[ai-assist-sdk] 创建会话失败:", l);
670
+ const i = await Pe(R);
671
+ (y = i == null ? void 0 : i.conversation) != null && y.appConversationID && (A = i.conversation.appConversationID, o.value = A);
672
+ } catch (i) {
673
+ console.error("[ai-assist-sdk] 创建会话失败:", i);
674
674
  return;
675
675
  }
676
- if (S)
676
+ if (A)
677
677
  try {
678
- const l = await Ut(E, H.titleGenerateApp);
679
- if (!l) return;
680
- const p = m.length > 500 ? m.slice(0, 500) : m, A = `用户提问:${i}
681
- AI回答:${p}`, N = await $t().post(E.chatQueryApi, {
682
- app: H.titleGenerateApp,
683
- data: { Query: A, AppConversationID: l }
684
- }), B = Pt(N.data.data);
685
- B && (await jt(E, S, B), g.value = !0, x == null || x(B));
686
- } catch (l) {
687
- console.error("[ai-assist-sdk] 生成对话标题失败:", l);
678
+ const i = await Ze(R, T.titleGenerateApp);
679
+ if (!i) return;
680
+ const h = p.length > 500 ? p.slice(0, 500) : p, k = `用户提问:${l}
681
+ AI回答:${h}`, P = await Ne().post(R.chatQueryApi, {
682
+ app: T.titleGenerateApp,
683
+ data: { Query: k, AppConversationID: i }
684
+ }), N = Be(P.data.data);
685
+ N && (await Ie(R, A, N), g.value = !0, B == null || B(N));
686
+ } catch (i) {
687
+ console.error("[ai-assist-sdk] 生成对话标题失败:", i);
688
688
  }
689
689
  }
690
- async function R() {
691
- const i = u.value.trim();
692
- if (!i || r.value) return;
693
- if (!o.value && (await M(), !o.value)) {
694
- rt("创建会话失败,请重试");
690
+ async function b() {
691
+ const l = u.value.trim();
692
+ if (!l || r.value) return;
693
+ if (!o.value && (await D(), !o.value)) {
694
+ ce("创建会话失败,请重试");
695
695
  return;
696
696
  }
697
- const m = t.value.length === 0, S = [
698
- ...t.value,
699
- { type: "user", content: i },
700
- { type: "ai", content: "", status: d.THINKING }
697
+ const p = e.value.length === 0, A = [
698
+ ...e.value,
699
+ { type: "user", content: l },
700
+ { type: "ai", content: "", status: f.THINKING }
701
701
  ];
702
- t.value = S, u.value = "", n();
703
- const y = S.length - 1;
704
- if (E.chatQueryStreamApi) {
705
- if (console.log("[ai-assist-sdk] ✅ 使用流式 SSE:", E.chatQueryStreamApi), await c(E.chatQueryStreamApi, {
706
- Query: i,
702
+ e.value = A, u.value = "", n();
703
+ const y = A.length - 1;
704
+ if (R.chatQueryStreamApi) {
705
+ if (console.log("[ai-assist-sdk] ✅ 使用流式 SSE:", R.chatQueryStreamApi), await c(R.chatQueryStreamApi, {
706
+ Query: l,
707
707
  AppConversationID: o.value,
708
708
  ResponseMode: "streaming"
709
- }, y, f.first.signal), m && !g.value) {
710
- const l = t.value[y];
711
- l && l.status !== d.ERROR && T(i, l.content);
709
+ }, y, m.first.signal), p && !g.value) {
710
+ const i = e.value[y];
711
+ i && i.status !== f.ERROR && E(l, i.content);
712
712
  }
713
713
  return;
714
714
  }
715
715
  console.warn("[ai-assist-sdk] ⚠️ 未配置 chatQueryStreamApi,降级为非流式请求");
716
716
  try {
717
- const p = await $t().post(E.chatQueryApi, {
718
- app: H.app ?? 1,
719
- data: { Query: i, AppConversationID: o.value }
720
- }), A = Pt(p.data);
721
- t.value = [...t.value.slice(0, -1), { type: "ai", content: A, status: d.COMPLETED }], m && !g.value && T(i, A);
722
- } catch (l) {
723
- t.value = [...t.value.slice(0, -1), { type: "ai", content: (l == null ? void 0 : l.message) || "服务连接失败,请稍后重试", status: d.ERROR }];
717
+ const h = await Ne().post(R.chatQueryApi, {
718
+ app: T.app ?? 1,
719
+ data: { Query: l, AppConversationID: o.value }
720
+ }), k = Be(h.data);
721
+ e.value = [...e.value.slice(0, -1), { type: "ai", content: k, status: f.COMPLETED }], p && !g.value && E(l, k);
722
+ } catch (i) {
723
+ e.value = [...e.value.slice(0, -1), { type: "ai", content: (i == null ? void 0 : i.message) || "服务连接失败,请稍后重试", status: f.ERROR }];
724
724
  }
725
725
  }
726
- async function w() {
726
+ async function L() {
727
727
  if (!v.value || r.value) return;
728
- f.again.abort(), f.again = new AbortController();
729
- const i = [...t.value];
730
- i.length > 0 && i[i.length - 1].type === "ai" && i.pop(), i.push({ type: "ai", content: "", status: d.RETHINKING }), t.value = i, n();
731
- const m = t.value.length - 1, S = Ye(E);
732
- await c(S, {
728
+ m.again.abort(), m.again = new AbortController();
729
+ const l = [...e.value];
730
+ l.length > 0 && l[l.length - 1].type === "ai" && l.pop(), l.push({ type: "ai", content: "", status: f.RETHINKING }), e.value = l, n();
731
+ const p = e.value.length - 1, A = Gt(R);
732
+ await c(A, {
733
733
  MessageID: v.value,
734
734
  AppConversationID: o.value,
735
735
  ResponseMode: "streaming"
736
- }, m, f.again.signal, !0);
736
+ }, p, m.again.signal, !0);
737
737
  }
738
- async function e() {
739
- if (!E.stopMessageApi || !r.value) return;
740
- const i = t.value.length - 1 - 1;
738
+ async function t() {
739
+ if (!R.stopMessageApi || !r.value) return;
740
+ const l = e.value.length - 1 - 1;
741
741
  try {
742
- await qt(E, v.value);
743
- const m = [...t.value];
744
- m[i] && (m[i] = { ...m[i], content: m[i].content || "已停止回答", status: d.STOP }), t.value = m, r.value = !1, f.first.abort(), f.first = new AbortController(), f.again.abort(), f.again = new AbortController(), a.value = !0;
745
- } catch (m) {
746
- const S = [...t.value];
747
- S[i] && (S[i] = { ...S[i], content: (m == null ? void 0 : m.message) || "系统繁忙,请稍后再试", status: d.ERROR }), t.value = S;
742
+ await ze(R, v.value);
743
+ const p = [...e.value];
744
+ p[l] && (p[l] = { ...p[l], content: p[l].content || "已停止回答", status: f.STOP }), e.value = p, r.value = !1, m.first.abort(), m.first = new AbortController(), m.again.abort(), m.again = new AbortController(), a.value = !0;
745
+ } catch (p) {
746
+ const A = [...e.value];
747
+ A[l] && (A[l] = { ...A[l], content: (p == null ? void 0 : p.message) || "系统繁忙,请稍后再试", status: f.ERROR }), e.value = A;
748
748
  }
749
749
  }
750
- async function L(i) {
751
- var m, S;
752
- o.value = i, g.value = !0;
750
+ async function x(l) {
751
+ var p, A;
752
+ o.value = l, g.value = !0;
753
753
  try {
754
- const y = await _t(E, i), l = [];
755
- if ((m = y == null ? void 0 : y.messages) != null && m.length)
756
- for (const p of y.messages)
757
- p.query && l.push({ type: "user", content: p.query }), (S = p.answerInfo) != null && S.answer && l.push({ type: "ai", content: p.answerInfo.answer, status: d.COMPLETED });
758
- t.value = l, n();
754
+ const y = await Ke(R, l), i = [];
755
+ if ((p = y == null ? void 0 : y.messages) != null && p.length)
756
+ for (const h of y.messages)
757
+ h.query && i.push({ type: "user", content: h.query }), (A = h.answerInfo) != null && A.answer && i.push({ type: "ai", content: h.answerInfo.answer, status: f.COMPLETED });
758
+ e.value = i, n();
759
759
  } catch (y) {
760
- rt((y == null ? void 0 : y.message) || "加载历史会话失败");
760
+ ce((y == null ? void 0 : y.message) || "加载历史会话失败");
761
761
  }
762
762
  }
763
- async function M() {
764
- var i;
763
+ async function D() {
764
+ var l;
765
765
  g.value = !1;
766
766
  try {
767
- const m = await Ot(E);
768
- (i = m == null ? void 0 : m.conversation) != null && i.appConversationID && (o.value = m.conversation.appConversationID);
769
- } catch (m) {
770
- rt((m == null ? void 0 : m.message) || "创建会话失败");
767
+ const p = await Pe(R);
768
+ (l = p == null ? void 0 : p.conversation) != null && l.appConversationID && (o.value = p.conversation.appConversationID);
769
+ } catch (p) {
770
+ ce((p == null ? void 0 : p.message) || "创建会话失败");
771
771
  }
772
772
  }
773
- function P() {
773
+ function H() {
774
774
  o.value = "", g.value = !1;
775
775
  }
776
- return { sendMessage: R, regenerateResponse: w, toggleStop: e, goHistoryMessage: L, initConversation: M, resetConversation: P, controllers: f };
776
+ return { sendMessage: b, regenerateResponse: L, toggleStop: t, goHistoryMessage: x, initConversation: D, resetConversation: H, controllers: m };
777
777
  }
778
- const Xe = { class: "container" }, Fe = { class: "message ai-message greet-message" }, Ve = { class: "ai-greet" }, Ge = {
778
+ const qt = { class: "container" }, _t = { class: "message ai-message greet-message" }, Ut = { class: "ai-greet" }, jt = ["src"], Kt = {
779
779
  key: 0,
780
780
  class: "message ai-message recommend-message"
781
- }, Je = { class: "ai-recommend" }, _e = { class: "recommend-header" }, qe = ["src"], Ue = ["onClick"], je = /* @__PURE__ */ tt({
781
+ }, zt = { class: "ai-recommend" }, Zt = { class: "recommend-header" }, It = ["src"], en = ["onClick"], tn = /* @__PURE__ */ ne({
782
782
  __name: "Answer",
783
783
  props: {
784
784
  defaultSayhello: {},
785
785
  defaultRecommend: {}
786
786
  },
787
787
  emits: ["title-generated"],
788
- setup(t, { expose: u, emit: r }) {
788
+ setup(e, { expose: u, emit: r }) {
789
789
  const v = {
790
790
  THINKING: "thinking",
791
791
  RETHINKING: "rethinking",
@@ -794,207 +794,208 @@ const Xe = { class: "container" }, Fe = { class: "message ai-message greet-messa
794
794
  COMPLETED: "completed",
795
795
  STOP: "stop",
796
796
  ERROR: "error"
797
- }, o = t, c = r, a = Ct(), n = C([]), d = C(""), H = C(!1), x = C(""), E = C(""), f = C(null), g = Z({ text1: "", text2: "" }), T = C([]), R = C(0), w = U(
798
- () => T.value[R.value % (T.value.length || 1)]
797
+ }, o = e, c = r, a = fe(), n = C([]), f = C(""), T = C(!1), B = C(""), R = C(""), m = C(null), g = I({ text1: "", text2: "" }), E = C([]), b = C(0), L = _(
798
+ () => E.value[b.value % (E.value.length || 1)]
799
799
  );
800
- function e() {
801
- R.value++;
800
+ function t() {
801
+ b.value++;
802
802
  }
803
- function L(Y) {
804
- d.value = Y;
803
+ function x(Y) {
804
+ f.value = Y;
805
805
  }
806
- const { isAtBottom: M, hasScroll: P, scrollToBottom: i, checkScrollStatus: m } = Ne(f), { enhanceCodeBlocks: S } = Be(), { batchMessagesUpdate: y, flushMessagesBatch: l } = Le(n), { displayedContent: p, streamingIndexRef: A, startTypewriter: O, stopTypewriter: N, getSegmentDisplayContent: B } = xe(
806
+ const { isAtBottom: D, hasScroll: H, scrollToBottom: l, checkScrollStatus: p } = Yt(m), { enhanceCodeBlocks: A } = Qt(), { batchMessagesUpdate: y, flushMessagesBatch: i } = Ft(n), { displayedContent: h, streamingIndexRef: k, startTypewriter: $, stopTypewriter: P, getSegmentDisplayContent: N } = Vt(
807
807
  n,
808
- i,
808
+ l,
809
809
  v.ANSWERING
810
- ), { doStreamRequest: G, issTop: ut } = We({
810
+ ), { doStreamRequest: G, issTop: ve } = Xt({
811
811
  messages: n,
812
- isGenerating: H,
813
- lastUserMessage: x,
812
+ isGenerating: T,
813
+ lastUserMessage: B,
814
814
  batchMessagesUpdate: y,
815
- flushMessagesBatch: l,
815
+ flushMessagesBatch: i,
816
816
  STATUS: v,
817
817
  cfg: a
818
- }), { sendMessage: mt, regenerateResponse: ht, toggleStop: At, goHistoryMessage: et, resetConversation: nt } = Qe({
818
+ }), { sendMessage: de, regenerateResponse: pe, toggleStop: ye, goHistoryMessage: Se, resetConversation: be } = Jt({
819
819
  messages: n,
820
- userInput: d,
821
- isGenerating: H,
822
- lastUserMessage: x,
823
- conversationId: E,
820
+ userInput: f,
821
+ isGenerating: T,
822
+ lastUserMessage: B,
823
+ conversationId: R,
824
824
  doStreamRequest: G,
825
- issTop: ut,
826
- scrollToBottom: i,
825
+ issTop: ve,
826
+ scrollToBottom: l,
827
827
  STATUS: v,
828
828
  cfg: a,
829
829
  onTitleGenerated: (Y) => c("title-generated", Y)
830
830
  });
831
- function ft() {
832
- n.value = [], x.value = "", nt();
831
+ function se() {
832
+ n.value = [], B.value = "", be();
833
833
  }
834
- const St = U(() => n.value.length === 0);
835
- u({ goHistoryMessage: et, createNewConversation: ft, isEmptyConversation: St });
836
- const st = C(/* @__PURE__ */ new Map());
837
- function bt(Y, Q) {
838
- Y ? st.value.set(Q, Y) : st.value.delete(Q);
834
+ const oe = _(() => n.value.length === 0);
835
+ u({ goHistoryMessage: Se, createNewConversation: se, isEmptyConversation: oe });
836
+ const ae = C(/* @__PURE__ */ new Map());
837
+ function Re(Y, Q) {
838
+ Y ? ae.value.set(Q, Y) : ae.value.delete(Q);
839
839
  }
840
- wt(n, () => {
841
- z(() => {
840
+ Ce(n, () => {
841
+ Z(() => {
842
842
  n.value.forEach((Y, Q) => {
843
- Y.type === "ai" && Y.status !== v.ANSWERING && (p.set(Q, Y.content), A.value.set(Q, Y.content.length));
844
- }), O(), st.value.forEach((Y) => {
845
- S(Y);
843
+ Y.type === "ai" && Y.status !== v.ANSWERING && (h.set(Q, Y.content), k.value.set(Q, Y.content.length));
844
+ }), $(), ae.value.forEach((Y) => {
845
+ A(Y);
846
846
  });
847
847
  });
848
848
  }, { deep: !0 });
849
- let ot = null;
850
- return I(() => {
851
- o.defaultSayhello && (g.text1 = o.defaultSayhello.text1, g.text2 = o.defaultSayhello.text2), o.defaultRecommend && (T.value = Kt(o.defaultRecommend));
852
- }), I(() => {
853
- f.value && (ot = () => m(), f.value.addEventListener("scroll", ot));
854
- }), kt(() => {
855
- N(), f.value && ot && f.value.removeEventListener("scroll", ot);
849
+ let z = null;
850
+ return te(() => {
851
+ o.defaultSayhello && (g.text1 = o.defaultSayhello.text1, g.text2 = o.defaultSayhello.text2), o.defaultRecommend && (E.value = et(o.defaultRecommend));
852
+ }), te(() => {
853
+ m.value && (z = () => p(), m.value.addEventListener("scroll", z));
854
+ }), Ae(() => {
855
+ P(), m.value && z && m.value.removeEventListener("scroll", z);
856
856
  }), (Y, Q) => {
857
- var pt;
858
- return k(), b("div", Xe, [
857
+ var we;
858
+ return w(), S("div", qt, [
859
859
  s("div", {
860
860
  class: "chat-box scrollWrap",
861
861
  ref_key: "chatBoxRef",
862
- ref: f
862
+ ref: m
863
863
  }, [
864
- s("div", Fe, [
865
- s("div", Ve, [
866
- s("h1", null, X(g.text1), 1),
867
- s("p", null, X(g.text2), 1)
864
+ s("div", _t, [
865
+ s("div", Ut, [
866
+ s("img", { src: O(xe) }, null, 8, jt),
867
+ s("h1", null, F(g.text1), 1),
868
+ s("p", null, F(g.text2), 1)
868
869
  ])
869
870
  ]),
870
- (pt = w.value) != null && pt.length ? (k(), b("div", Ge, [
871
- s("div", Je, [
872
- s("div", _e, [
871
+ (we = L.value) != null && we.length ? (w(), S("div", Kt, [
872
+ s("div", zt, [
873
+ s("div", Zt, [
873
874
  Q[2] || (Q[2] = s("span", null, "你可以尝试这样问我:", -1)),
874
875
  s("p", {
875
876
  class: "refresh-btn",
876
- onClick: e
877
+ onClick: t
877
878
  }, [
878
- s("img", { src: $(ce) }, null, 8, qe),
879
+ s("img", { src: O(mt) }, null, 8, It),
879
880
  Q[1] || (Q[1] = s("span", null, "换一换", -1))
880
881
  ])
881
882
  ]),
882
883
  s("ul", null, [
883
- (k(!0), b(K, null, ct(w.value, (J, at) => (k(), b("li", {
884
- key: at,
885
- onClick: (Rt) => L(J)
886
- }, X(J), 9, Ue))), 128))
884
+ (w(!0), S(K, null, ue(L.value, (U, ie) => (w(), S("li", {
885
+ key: ie,
886
+ onClick: (le) => x(U)
887
+ }, F(U), 9, en))), 128))
887
888
  ])
888
889
  ])
889
890
  ])) : V("", !0),
890
- (k(!0), b(K, null, ct(n.value, (J, at) => (k(), lt(Te, {
891
- key: at,
892
- msg: J,
893
- index: at,
891
+ (w(!0), S(K, null, ue(n.value, (U, ie) => (w(), ee($t, {
892
+ key: ie,
893
+ msg: U,
894
+ index: ie,
894
895
  STATUS: v,
895
- displayedContent: $(p),
896
- getSegmentDisplayContent: $(B),
897
- setMessageRef: bt,
898
- onRegenerate: $(ht)
896
+ displayedContent: O(h),
897
+ getSegmentDisplayContent: O(N),
898
+ setMessageRef: Re,
899
+ onRegenerate: O(pe)
899
900
  }, null, 8, ["msg", "index", "displayedContent", "getSegmentDisplayContent", "onRegenerate"]))), 128))
900
901
  ], 512),
901
- F(Pe, {
902
- modelValue: d.value,
903
- "onUpdate:modelValue": Q[0] || (Q[0] = (J) => d.value = J),
904
- isGenerating: H.value,
905
- lastUserMessage: x.value,
906
- hasScroll: $(P),
907
- isAtBottom: $(M),
908
- onSend: $(mt),
909
- onRegenerate: $(ht),
910
- onStop: $(At),
911
- onScrollToBottom: $(i)
902
+ X(Wt, {
903
+ modelValue: f.value,
904
+ "onUpdate:modelValue": Q[0] || (Q[0] = (U) => f.value = U),
905
+ isGenerating: T.value,
906
+ lastUserMessage: B.value,
907
+ hasScroll: O(H),
908
+ isAtBottom: O(D),
909
+ onSend: O(de),
910
+ onRegenerate: O(pe),
911
+ onStop: O(ye),
912
+ onScrollToBottom: O(l)
912
913
  }, null, 8, ["modelValue", "isGenerating", "lastUserMessage", "hasScroll", "isAtBottom", "onSend", "onRegenerate", "onStop", "onScrollToBottom"]),
913
914
  Q[3] || (Q[3] = s("div", { class: "ai-mistake-tip" }, "AI也会犯错,请核实重要信息", -1))
914
915
  ]);
915
916
  };
916
917
  }
917
- }), Ke = { class: "ai-history" }, ze = { class: "content" }, Ze = {
918
+ }), nn = { class: "ai-history" }, sn = { class: "content" }, on = {
918
919
  key: 0,
919
920
  class: "ai-history-loading"
920
- }, Ie = { class: "ai-history-group-title" }, tn = ["onClick"], en = { class: "ai-history-item-title" }, nn = ["onClick"], sn = {
921
+ }, an = { class: "ai-history-group-title" }, ln = ["onClick"], rn = { class: "ai-history-item-title" }, cn = ["onClick"], un = {
921
922
  key: 2,
922
923
  class: "ai-history-empty"
923
- }, on = ["src"], an = { class: "ai-modal" }, ln = { class: "ai-modal-footer" }, rn = /* @__PURE__ */ tt({
924
+ }, vn = ["src"], dn = { class: "ai-modal" }, gn = { class: "ai-modal-footer" }, mn = /* @__PURE__ */ ne({
924
925
  __name: "History",
925
926
  emits: ["history-detail", "new-conversation"],
926
- setup(t, { emit: u }) {
927
- const v = Ct().apis, o = C([]), c = C(!0), a = C(!1), n = C(""), d = U(() => zt(o.value));
928
- async function H() {
927
+ setup(e, { emit: u }) {
928
+ const v = fe().apis, o = C([]), c = C(!0), a = C(!1), n = C(""), f = _(() => tt(o.value));
929
+ async function T() {
929
930
  try {
930
- const f = await Zt(v);
931
- f != null && f.conversationList && (o.value = f.conversationList.filter((g) => g !== null).map((g) => ({ ...g, selected: !1 })));
932
- } catch (f) {
933
- rt((f == null ? void 0 : f.message) || "获取历史记录失败");
931
+ const m = await nt(v);
932
+ m != null && m.conversationList && (o.value = m.conversationList.filter((g) => g !== null).map((g) => ({ ...g, selected: !1 })));
933
+ } catch (m) {
934
+ ce((m == null ? void 0 : m.message) || "获取历史记录失败");
934
935
  } finally {
935
936
  c.value = !1;
936
937
  }
937
938
  }
938
- function x(f) {
939
- n.value = f, a.value = !0;
939
+ function B(m) {
940
+ n.value = m, a.value = !0;
940
941
  }
941
- async function E() {
942
+ async function R() {
942
943
  a.value = !1;
943
944
  try {
944
- await It(v, n.value), await H();
945
- } catch (f) {
946
- rt((f == null ? void 0 : f.message) || "删除失败"), await H();
945
+ await st(v, n.value), await T();
946
+ } catch (m) {
947
+ ce((m == null ? void 0 : m.message) || "删除失败"), await T();
947
948
  }
948
949
  }
949
- return I(() => {
950
- H();
951
- }), (f, g) => (k(), b("div", Ke, [
952
- s("div", ze, [
953
- c.value ? (k(), b("div", Ze, [...g[3] || (g[3] = [
950
+ return te(() => {
951
+ T();
952
+ }), (m, g) => (w(), S("div", nn, [
953
+ s("div", sn, [
954
+ c.value ? (w(), S("div", on, [...g[3] || (g[3] = [
954
955
  s("div", { class: "ai-history-spinner" }, null, -1)
955
- ])])) : d.value.length > 0 ? (k(!0), b(K, { key: 1 }, ct(d.value, (T) => (k(), b("div", {
956
- key: T.label,
956
+ ])])) : f.value.length > 0 ? (w(!0), S(K, { key: 1 }, ue(f.value, (E) => (w(), S("div", {
957
+ key: E.label,
957
958
  class: "ai-history-group"
958
959
  }, [
959
- s("div", Ie, X(T.label), 1),
960
- (k(!0), b(K, null, ct(T.items, (R, w) => (k(), b("div", {
961
- key: R.appConversationID,
960
+ s("div", an, F(E.label), 1),
961
+ (w(!0), S(K, null, ue(E.items, (b, L) => (w(), S("div", {
962
+ key: b.appConversationID,
962
963
  class: "ai-history-item",
963
- style: Tt({ "--i": w }),
964
- onClick: (e) => f.$emit("history-detail", R.appConversationID)
964
+ style: Te({ "--i": L }),
965
+ onClick: (t) => m.$emit("history-detail", b.appConversationID)
965
966
  }, [
966
- s("div", en, X(R.conversationName), 1),
967
+ s("div", rn, F(b.conversationName), 1),
967
968
  s("div", {
968
969
  class: "ai-history-item-delete",
969
- onClick: Mt((e) => x(R.appConversationID), ["stop"])
970
- }, "删除", 8, nn)
971
- ], 12, tn))), 128))
972
- ]))), 128)) : (k(), b("div", sn, "暂无历史记录"))
970
+ onClick: He((t) => B(b.appConversationID), ["stop"])
971
+ }, "删除", 8, cn)
972
+ ], 12, ln))), 128))
973
+ ]))), 128)) : (w(), S("div", un, "暂无历史记录"))
973
974
  ]),
974
975
  s("div", {
975
976
  class: "ai-add",
976
- onClick: g[0] || (g[0] = (T) => f.$emit("new-conversation"))
977
+ onClick: g[0] || (g[0] = (E) => m.$emit("new-conversation"))
977
978
  }, [
978
- s("img", { src: $(ie) }, null, 8, on),
979
+ s("img", { src: O(rt) }, null, 8, vn),
979
980
  g[4] || (g[4] = s("span", null, "新建AI对话", -1))
980
981
  ]),
981
- (k(), lt(Ft, { to: "body" }, [
982
- a.value ? (k(), b("div", {
982
+ (w(), ee(qe, { to: "#ai-assist-root" }, [
983
+ a.value ? (w(), S("div", {
983
984
  key: 0,
984
985
  class: "ai-modal-overlay",
985
- onClick: g[2] || (g[2] = Mt((T) => a.value = !1, ["self"]))
986
+ onClick: g[2] || (g[2] = He((E) => a.value = !1, ["self"]))
986
987
  }, [
987
- s("div", an, [
988
+ s("div", dn, [
988
989
  g[5] || (g[5] = s("div", { class: "ai-modal-header" }, "确定要删除该历史记录吗?", -1)),
989
990
  g[6] || (g[6] = s("div", { class: "ai-modal-body" }, "一旦删除,数据将无法恢复。", -1)),
990
- s("div", ln, [
991
+ s("div", gn, [
991
992
  s("button", {
992
993
  class: "ai-modal-btn cancel",
993
- onClick: g[1] || (g[1] = (T) => a.value = !1)
994
+ onClick: g[1] || (g[1] = (E) => a.value = !1)
994
995
  }, "取消"),
995
996
  s("button", {
996
997
  class: "ai-modal-btn confirm",
997
- onClick: E
998
+ onClick: R
998
999
  }, "确定")
999
1000
  ])
1000
1001
  ])
@@ -1002,154 +1003,149 @@ const Xe = { class: "container" }, Fe = { class: "message ai-message greet-messa
1002
1003
  ]))
1003
1004
  ]));
1004
1005
  }
1005
- }), cn = (t, u) => {
1006
- const r = t.__vccOpts || t;
1007
- for (const [v, o] of u)
1008
- r[v] = o;
1009
- return r;
1010
- }, un = /* @__PURE__ */ cn(rn, [["__scopeId", "data-v-0d2cc243"]]), vn = { class: "container info" }, dn = { class: "info-item" }, gn = { class: "basic-content" }, mn = { class: "basic-content-text" }, hn = { class: "basic-content" }, fn = { class: "basic-content-text" }, pn = { class: "info-item" }, yn = { class: "permission-content" }, wn = { class: "info-item" }, kn = { class: "basic-content" }, Cn = { class: "basic-content-text" }, An = { class: "basic-content" }, Sn = { class: "basic-content-text" }, bn = /* @__PURE__ */ tt({
1006
+ }), hn = { class: "container info" }, fn = { class: "info-item" }, pn = { class: "basic-content" }, yn = { class: "basic-content-text" }, wn = { class: "basic-content" }, kn = { class: "basic-content-text" }, Cn = { class: "info-item" }, An = { class: "permission-content" }, Sn = { class: "info-item" }, bn = { class: "basic-content" }, Rn = { class: "basic-content-text" }, En = { class: "basic-content" }, Tn = { class: "basic-content-text" }, Mn = /* @__PURE__ */ ne({
1011
1007
  __name: "Info",
1012
- setup(t) {
1013
- const u = Ct(), r = C(null);
1014
- return I(async () => {
1008
+ setup(e) {
1009
+ const u = fe(), r = C(null);
1010
+ return te(async () => {
1015
1011
  try {
1016
- r.value = await te(u.apis);
1012
+ r.value = await ot(u.apis);
1017
1013
  } catch (v) {
1018
- rt((v == null ? void 0 : v.message) || "获取个人信息失败");
1014
+ ce((v == null ? void 0 : v.message) || "获取个人信息失败");
1019
1015
  }
1020
1016
  }), (v, o) => {
1021
- var c, a, n, d, H;
1022
- return k(), b("div", vn, [
1023
- s("div", dn, [
1017
+ var c, a, n, f, T;
1018
+ return w(), S("div", hn, [
1019
+ s("div", fn, [
1024
1020
  o[2] || (o[2] = s("div", { class: "heading" }, [
1025
1021
  s("div", { class: "heading-column" }),
1026
1022
  s("div", { class: "heading-title" }, "基本信息")
1027
1023
  ], -1)),
1028
- s("div", gn, [
1024
+ s("div", pn, [
1029
1025
  o[0] || (o[0] = s("div", { class: "basic-content-text basic-content-key" }, "姓名", -1)),
1030
- s("div", mn, X(((c = r.value) == null ? void 0 : c.name) || ""), 1)
1026
+ s("div", yn, F(((c = r.value) == null ? void 0 : c.name) || ""), 1)
1031
1027
  ]),
1032
- s("div", hn, [
1028
+ s("div", wn, [
1033
1029
  o[1] || (o[1] = s("div", { class: "basic-content-text basic-content-key" }, "用户名", -1)),
1034
- s("div", fn, X(((a = r.value) == null ? void 0 : a.userName) || ""), 1)
1030
+ s("div", kn, F(((a = r.value) == null ? void 0 : a.userName) || ""), 1)
1035
1031
  ])
1036
1032
  ]),
1037
- s("div", pn, [
1033
+ s("div", Cn, [
1038
1034
  o[3] || (o[3] = s("div", { class: "heading" }, [
1039
1035
  s("div", { class: "heading-column" }),
1040
1036
  s("div", { class: "heading-title" }, "数据权限")
1041
1037
  ], -1)),
1042
- s("div", yn, [
1043
- (k(!0), b(K, null, ct((n = r.value) == null ? void 0 : n.ptnameList, (x, E) => (k(), b("div", {
1044
- key: E,
1038
+ s("div", An, [
1039
+ (w(!0), S(K, null, ue((n = r.value) == null ? void 0 : n.ptnameList, (B, R) => (w(), S("div", {
1040
+ key: R,
1045
1041
  class: "permission-content-text"
1046
- }, X(x), 1))), 128))
1042
+ }, F(B), 1))), 128))
1047
1043
  ])
1048
1044
  ]),
1049
- s("div", wn, [
1045
+ s("div", Sn, [
1050
1046
  o[6] || (o[6] = s("div", { class: "heading" }, [
1051
1047
  s("div", { class: "heading-column" }),
1052
1048
  s("div", { class: "heading-title" }, "帮助信息")
1053
1049
  ], -1)),
1054
- s("div", kn, [
1050
+ s("div", bn, [
1055
1051
  o[4] || (o[4] = s("div", { class: "basic-content-text basic-content-key" }, "部门", -1)),
1056
- s("div", Cn, X(((d = r.value) == null ? void 0 : d.dept) || ""), 1)
1052
+ s("div", Rn, F(((f = r.value) == null ? void 0 : f.dept) || ""), 1)
1057
1053
  ]),
1058
- s("div", An, [
1054
+ s("div", En, [
1059
1055
  o[5] || (o[5] = s("div", { class: "basic-content-text basic-content-key" }, "邮箱", -1)),
1060
- s("div", Sn, X(((H = r.value) == null ? void 0 : H.email) || ""), 1)
1056
+ s("div", Tn, F(((T = r.value) == null ? void 0 : T.email) || ""), 1)
1061
1057
  ])
1062
1058
  ])
1063
1059
  ]);
1064
1060
  };
1065
1061
  }
1066
- }), Rn = { class: "header" }, En = { key: 1 }, Tn = ["src"], Mn = { class: "header-title" }, Dn = ["title"], Hn = { class: "ai-history-drawer-panel" }, On = { class: "ai-history-drawer-header" }, $n = { class: "setTitle" }, Pn = { class: "content" }, Nn = { class: "main" }, Bn = { class: "btn" }, Ln = ["src"], xn = 78, dt = 78, Bt = /* @__PURE__ */ tt({
1062
+ }), Dn = { class: "header" }, Hn = { key: 1 }, On = ["src"], $n = { class: "header-title" }, Pn = ["title"], Nn = { class: "ai-history-drawer-panel" }, Bn = { class: "ai-history-drawer-header" }, Ln = { class: "setTitle" }, xn = { class: "content" }, Wn = { class: "main" }, Yn = { class: "btn" }, Qn = ["src"], Fn = 78, me = 78, We = /* @__PURE__ */ ne({
1067
1063
  __name: "AiAssist",
1068
- setup(t) {
1069
- const u = xn / 2, r = Ct(), v = C(!1), o = C("idle"), c = C(!1), a = Z({ x: 0, y: 0, w: 78, h: 78, radius: "14px" }), n = C(!1), d = C(!1), H = C("answer"), x = C(!1), E = C(""), f = C(""), g = C(""), T = C(!1), R = C(!1), w = Z({
1064
+ setup(e) {
1065
+ const u = Fn / 2, r = fe(), v = C(!1), o = C("idle"), c = C(!1), a = I({ x: 0, y: 0, w: 78, h: 78, radius: "14px" }), n = C(!1), f = C(window.innerWidth < 768), T = C(window.innerWidth < 768), B = C("answer"), R = C(!1), m = C(""), g = C(""), E = C(""), b = C(!1), L = C(!1), t = I({
1070
1066
  x: window.innerWidth - u,
1071
- y: window.innerHeight / 2 - dt / 2
1072
- }), e = C(!1), L = C(!1), M = C("right"), P = C("left"), i = Z({ x: 0, y: 0 }), m = C(!1), S = C(null);
1073
- let y = null;
1074
- const l = U(() => {
1075
- const h = window.innerWidth / 2;
1076
- return w.x + u < h ? 5 : -5;
1077
- }), p = U(() => d.value ? "" : `panel-${M.value}`), A = U(() => {
1078
- var h;
1079
- return !((h = S.value) != null && h.isEmptyConversation);
1080
- }), O = U(() => ({
1081
- left: `${w.x}px`,
1082
- top: `${w.y}px`,
1083
- transition: e.value ? "none" : "all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1)",
1084
- "--direction": String(l.value)
1085
- })), N = U(() => r.characterImage || le), B = U(() => o.value === "idle" ? {} : {
1067
+ y: window.innerHeight / 2 - me / 2
1068
+ }), x = C(!1), D = C(!1), H = C("right"), l = C("left"), p = I({ x: 0, y: 0 }), A = C(!1), y = C(null);
1069
+ let i = null, h = null;
1070
+ const k = _(() => {
1071
+ const d = window.innerWidth / 2;
1072
+ return t.x + u < d ? 5 : -5;
1073
+ }), $ = _(() => T.value ? "" : `panel-${H.value}`), P = _(() => {
1074
+ var d;
1075
+ return !((d = y.value) != null && d.isEmptyConversation);
1076
+ }), N = _(() => ({
1077
+ left: `${t.x}px`,
1078
+ top: `${t.y}px`,
1079
+ transition: x.value ? "none" : "all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1)",
1080
+ "--direction": String(k.value)
1081
+ })), G = _(() => r.characterImage || ct), ve = _(() => o.value === "idle" ? {} : {
1086
1082
  left: `${a.x}px`,
1087
1083
  top: `${a.y}px`,
1088
1084
  width: `${a.w}px`,
1089
1085
  height: `${a.h}px`,
1090
1086
  borderRadius: a.radius
1091
1087
  });
1092
- function G() {
1093
- const h = window.innerWidth / 2;
1094
- w.x + u < h ? (M.value = "left", P.value = "right") : (M.value = "right", P.value = "left");
1088
+ function de() {
1089
+ const d = window.innerWidth / 2;
1090
+ t.x + u < d ? (H.value = "left", l.value = "right") : (H.value = "right", l.value = "left");
1095
1091
  }
1096
- function ut() {
1097
- const h = window.innerWidth, D = Math.max(0, Math.min(w.y, window.innerHeight - dt));
1098
- return { x: w.x + u >= h / 2 ? h - u : -u, y: D };
1092
+ function pe() {
1093
+ const d = window.innerWidth, M = Math.max(0, Math.min(t.y, window.innerHeight - me));
1094
+ return { x: t.x + u >= d / 2 ? d - u : -u, y: M };
1099
1095
  }
1100
- function mt() {
1101
- L.value = !0;
1102
- const h = ut();
1103
- w.x = h.x, w.y = h.y, setTimeout(() => {
1104
- L.value = !1, G(), ht();
1096
+ function ye() {
1097
+ D.value = !0;
1098
+ const d = pe();
1099
+ t.x = d.x, t.y = d.y, setTimeout(() => {
1100
+ D.value = !1, de(), Se();
1105
1101
  }, 400);
1106
1102
  }
1107
- function ht() {
1103
+ function Se() {
1108
1104
  try {
1109
- localStorage.setItem("characterPosition", JSON.stringify({ x: w.x, y: w.y })), localStorage.setItem("panelPosition", M.value), localStorage.setItem("backPosition", P.value);
1105
+ localStorage.setItem("characterPosition", JSON.stringify({ x: t.x, y: t.y })), localStorage.setItem("panelPosition", H.value), localStorage.setItem("backPosition", l.value);
1110
1106
  } catch {
1111
1107
  }
1112
1108
  }
1113
- function At() {
1114
- const h = localStorage.getItem("characterPosition");
1115
- if (h) {
1116
- const q = JSON.parse(h);
1117
- w.x = q.x, w.y = Math.min(Math.max(q.y, 0), window.innerHeight - dt);
1109
+ function be() {
1110
+ const d = localStorage.getItem("characterPosition");
1111
+ if (d) {
1112
+ const q = JSON.parse(d);
1113
+ t.x = q.x, t.y = Math.min(Math.max(q.y, 0), window.innerHeight - me);
1118
1114
  } else
1119
- w.x = window.innerWidth - u, w.y = window.innerHeight / 2 - dt / 2;
1120
- const D = localStorage.getItem("panelPosition"), W = localStorage.getItem("backPosition");
1121
- D && (M.value = D), W && (P.value = W);
1115
+ t.x = window.innerWidth - u, t.y = window.innerHeight / 2 - me / 2;
1116
+ const M = localStorage.getItem("panelPosition"), W = localStorage.getItem("backPosition");
1117
+ M && (H.value = M), W && (l.value = W);
1122
1118
  }
1123
- function et(h) {
1124
- if (!e.value) return;
1125
- const D = "touches" in h ? h.touches[0].clientX : h.clientX, W = "touches" in h ? h.touches[0].clientY : h.clientY, q = D - i.x, Et = Math.max(0, Math.min(W - i.y, window.innerHeight - dt)), yt = Math.abs(q - w.x), Lt = Math.abs(Et - w.y);
1126
- yt + Lt > 5 && (m.value = !0), w.x = q, w.y = Et;
1119
+ function se(d) {
1120
+ if (!x.value) return;
1121
+ const M = "touches" in d ? d.touches[0].clientX : d.clientX, W = "touches" in d ? d.touches[0].clientY : d.clientY, q = M - p.x, Ee = Math.max(0, Math.min(W - p.y, window.innerHeight - me)), ke = Math.abs(q - t.x), Qe = Math.abs(Ee - t.y);
1122
+ ke + Qe > 5 && (A.value = !0), t.x = q, t.y = Ee;
1127
1123
  }
1128
- function nt() {
1129
- e.value && (e.value = !1, m.value && (mt(), m.value = !1));
1124
+ function oe() {
1125
+ x.value && (x.value = !1, A.value && (ye(), A.value = !1));
1130
1126
  }
1131
- function ft(h) {
1132
- L.value = !1, e.value = !0, m.value = !1;
1133
- const D = "touches" in h ? h.touches[0].clientX : h.clientX, W = "touches" in h ? h.touches[0].clientY : h.clientY;
1134
- i.x = D - w.x, i.y = W - w.y;
1127
+ function ae(d) {
1128
+ D.value = !1, x.value = !0, A.value = !1;
1129
+ const M = "touches" in d ? d.touches[0].clientX : d.clientX, W = "touches" in d ? d.touches[0].clientY : d.clientY;
1130
+ p.x = M - t.x, p.y = W - t.y;
1135
1131
  }
1136
- function St() {
1137
- if (!m.value && !L.value) {
1138
- G();
1139
- const h = st();
1140
- a.x = w.x, a.y = w.y, a.w = 78, a.h = 78, a.radius = "50%", c.value = !0, o.value = "expanding", v.value = !0, z(() => {
1132
+ function Re() {
1133
+ if (!A.value && !D.value) {
1134
+ de();
1135
+ const d = z();
1136
+ a.x = t.x + k.value * 3, a.y = t.y - k.value * 2, a.w = 53, a.h = 53, a.radius = "50%", c.value = !0, o.value = "expanding", v.value = !0, Z(() => {
1141
1137
  requestAnimationFrame(() => {
1142
- c.value = !1, a.x = h.x, a.y = h.y, a.w = h.w, a.h = h.h, a.radius = h.radius;
1138
+ c.value = !1, a.x = d.x, a.y = d.y, a.w = d.w, a.h = d.h, a.radius = d.radius;
1143
1139
  });
1144
1140
  }), setTimeout(() => {
1145
1141
  o.value = "idle";
1146
1142
  }, 400);
1147
1143
  } else
1148
- m.value = !1;
1144
+ A.value = !1;
1149
1145
  }
1150
- function st() {
1146
+ function z() {
1151
1147
  if (window.innerWidth < 768)
1152
- return d.value ? {
1148
+ return T.value ? {
1153
1149
  x: 0,
1154
1150
  y: 0,
1155
1151
  w: window.innerWidth,
@@ -1162,26 +1158,26 @@ const Xe = { class: "container" }, Fe = { class: "message ai-message greet-messa
1162
1158
  h: window.innerHeight - 16,
1163
1159
  radius: "14px"
1164
1160
  };
1165
- const D = window.innerHeight - 78, W = 54;
1166
- if (d.value) {
1167
- const yt = window.innerWidth * 0.8;
1161
+ const M = window.innerHeight - 78, W = 54;
1162
+ if (T.value) {
1163
+ const ke = window.innerWidth * 0.8;
1168
1164
  return {
1169
- x: (window.innerWidth - yt) / 2,
1165
+ x: (window.innerWidth - ke) / 2,
1170
1166
  y: W,
1171
- w: yt,
1172
- h: D,
1167
+ w: ke,
1168
+ h: M,
1173
1169
  radius: "14px"
1174
1170
  };
1175
1171
  }
1176
1172
  const q = 490;
1177
- return { x: M.value === "left" ? 24 : window.innerWidth - q - 24, y: W, w: q, h: D, radius: "14px" };
1173
+ return { x: H.value === "left" ? 24 : window.innerWidth - q - 24, y: W, w: q, h: M, radius: "14px" };
1178
1174
  }
1179
- function bt() {
1175
+ function Y() {
1180
1176
  if (o.value !== "idle") return;
1181
- const h = st();
1182
- a.x = h.x, a.y = h.y, a.w = h.w, a.h = h.h, a.radius = h.radius, c.value = !0, o.value = "collapsing", z(() => {
1177
+ const d = z();
1178
+ a.x = d.x, a.y = d.y, a.w = d.w, a.h = d.h, a.radius = d.radius, c.value = !0, o.value = "collapsing", Z(() => {
1183
1179
  requestAnimationFrame(() => {
1184
- c.value = !1, a.x = w.x + l.value * 6, a.y = w.y, a.w = 78, a.h = 78, a.radius = "50%";
1180
+ c.value = !1, a.x = t.x + k.value * 3, a.y = t.y - k.value * 2, a.w = 53, a.h = 53, a.radius = "50%";
1185
1181
  });
1186
1182
  }), setTimeout(() => {
1187
1183
  v.value = !1, o.value = "idle", n.value = !0;
@@ -1189,184 +1185,192 @@ const Xe = { class: "container" }, Fe = { class: "message ai-message greet-messa
1189
1185
  n.value = !1;
1190
1186
  }, 1400);
1191
1187
  }
1192
- function ot(h) {
1193
- J(), H.value = "answer", z(() => {
1194
- var D;
1195
- (D = S.value) == null || D.goHistoryMessage(h);
1188
+ function Q(d) {
1189
+ le(), B.value = "answer", Z(() => {
1190
+ var M;
1191
+ (M = y.value) == null || M.goHistoryMessage(d);
1196
1192
  });
1197
1193
  }
1198
- function Y() {
1199
- g.value = "", H.value = "answer", z(() => {
1200
- var h;
1201
- (h = S.value) == null || h.createNewConversation();
1194
+ function we() {
1195
+ E.value = "", B.value = "answer", Z(() => {
1196
+ var d;
1197
+ (d = y.value) == null || d.createNewConversation();
1202
1198
  });
1203
1199
  }
1204
- function Q() {
1205
- J(), g.value = "", z(() => {
1206
- var h;
1207
- (h = S.value) == null || h.createNewConversation();
1200
+ function U() {
1201
+ le(), E.value = "", Z(() => {
1202
+ var d;
1203
+ (d = y.value) == null || d.createNewConversation();
1208
1204
  });
1209
1205
  }
1210
- function pt() {
1211
- R.value = !1, T.value = !0;
1206
+ function ie() {
1207
+ L.value = !1, b.value = !0;
1212
1208
  }
1213
- function J() {
1214
- R.value = !0, setTimeout(() => {
1215
- T.value = !1, R.value = !1;
1209
+ function le() {
1210
+ L.value = !0, setTimeout(() => {
1211
+ b.value = !1, L.value = !1;
1216
1212
  }, 300);
1217
1213
  }
1218
- function at() {
1219
- f.value = E.value, x.value = !1;
1214
+ function Ye() {
1215
+ g.value = m.value, R.value = !1;
1220
1216
  }
1221
- wt(d, (h) => {
1222
- h ? M.value = "center" : G();
1223
- }), I(() => {
1224
- At();
1217
+ Ce(T, (d) => {
1218
+ d ? H.value = "center" : de();
1219
+ }), te(() => {
1220
+ be();
1221
+ const d = r.theme || "light";
1222
+ Me(d), d === "auto" && (h = at(() => Me("auto")));
1225
1223
  });
1226
- function Rt() {
1227
- y && clearTimeout(y), y = setTimeout(() => mt(), 100);
1224
+ function De() {
1225
+ i && clearTimeout(i), i = setTimeout(() => {
1226
+ const d = window.innerWidth < 768;
1227
+ f.value = d, d && (T.value = !0), ye();
1228
+ }, 100);
1228
1229
  }
1229
- return I(() => {
1230
- window.addEventListener("resize", Rt);
1231
- }), kt(() => {
1232
- window.removeEventListener("resize", Rt), y && clearTimeout(y);
1233
- }), I(() => {
1234
- document.addEventListener("mousemove", et), document.addEventListener("touchmove", et, { passive: !0 }), document.addEventListener("mouseup", nt), document.addEventListener("touchend", nt);
1235
- }), kt(() => {
1236
- document.removeEventListener("mousemove", et), document.removeEventListener("touchmove", et), document.removeEventListener("mouseup", nt), document.removeEventListener("touchend", nt);
1237
- }), (h, D) => (k(), b("div", null, [
1238
- it(s("div", {
1239
- class: _(["ai-panel", d.value ? "maxWrap" : "minWrap", p.value, o.value !== "idle" ? o.value : "", { morphing: o.value !== "idle", "morph-instant": c.value }]),
1240
- style: Tt(B.value)
1230
+ return te(() => {
1231
+ window.addEventListener("resize", De);
1232
+ }), Ae(() => {
1233
+ window.removeEventListener("resize", De), i && clearTimeout(i), h == null || h();
1234
+ }), te(() => {
1235
+ document.addEventListener("mousemove", se), document.addEventListener("touchmove", se, { passive: !0 }), document.addEventListener("mouseup", oe), document.addEventListener("touchend", oe);
1236
+ }), Ae(() => {
1237
+ document.removeEventListener("mousemove", se), document.removeEventListener("touchmove", se), document.removeEventListener("mouseup", oe), document.removeEventListener("touchend", oe);
1238
+ }), (d, M) => (w(), S("div", null, [
1239
+ re(s("div", {
1240
+ class: J(["ai-panel", T.value ? "maxWrap" : "minWrap", $.value, o.value !== "idle" ? o.value : "", { morphing: o.value !== "idle", "morph-instant": c.value }]),
1241
+ style: Te(ve.value)
1241
1242
  }, [
1242
- s("div", Rn, [
1243
- H.value === "info" ? (k(), b("span", {
1243
+ s("div", Dn, [
1244
+ B.value === "info" ? (w(), S("span", {
1244
1245
  key: 0,
1245
- class: _(["back", P.value]),
1246
- onClick: D[0] || (D[0] = (W) => H.value = "answer")
1247
- }, [...D[6] || (D[6] = [
1246
+ class: J(["back", l.value]),
1247
+ onClick: M[0] || (M[0] = (W) => B.value = "answer")
1248
+ }, [...M[6] || (M[6] = [
1248
1249
  s("span", { style: { "font-size": "14px" } }, "←", -1)
1249
- ])], 2)) : (k(), b("p", En, [
1250
- s("img", { src: $(re) }, null, 8, Tn)
1250
+ ])], 2)) : (w(), S("p", Hn, [
1251
+ s("img", { src: O(xe) }, null, 8, On)
1251
1252
  ])),
1252
- s("div", Mn, [
1253
+ s("div", $n, [
1253
1254
  s("span", {
1254
- title: H.value === "info" ? "个人信息" : g.value || $(r).name
1255
- }, X(H.value === "info" ? "个人信息" : g.value || $(r).name), 9, Dn)
1255
+ title: B.value === "info" ? "个人信息" : E.value || O(r).name
1256
+ }, F(B.value === "info" ? "个人信息" : E.value || O(r).name), 9, Pn)
1256
1257
  ]),
1257
1258
  s("p", null, [
1258
- it(F($(j), {
1259
+ re(X(O(j), {
1259
1260
  class: "op-icon",
1260
1261
  icon: "ic:round-add",
1261
- onClick: Y
1262
+ onClick: we
1262
1263
  }, null, 512), [
1263
- [vt, A.value]
1264
+ [ge, P.value]
1264
1265
  ]),
1265
- F($(j), {
1266
- class: _(["mute", { active: T.value }]),
1266
+ X(O(j), {
1267
+ class: J(["mute", { active: b.value }]),
1267
1268
  icon: "ic:round-history",
1268
- onClick: D[1] || (D[1] = (W) => T.value ? J() : pt())
1269
+ onClick: M[1] || (M[1] = (W) => b.value ? le() : ie())
1269
1270
  }, null, 8, ["class"]),
1270
- F($(j), {
1271
- onClick: D[2] || (D[2] = (W) => d.value = !d.value),
1272
- icon: d.value ? "ic:round-fullscreen-exit" : "ic:round-fullscreen"
1273
- }, null, 8, ["icon"]),
1274
- F($(j), {
1275
- onClick: bt,
1271
+ f.value ? V("", !0) : (w(), ee(O(j), {
1272
+ key: 0,
1273
+ onClick: M[2] || (M[2] = (W) => T.value = !T.value),
1274
+ icon: T.value ? "ic:round-fullscreen-exit" : "ic:round-fullscreen"
1275
+ }, null, 8, ["icon"])),
1276
+ X(O(j), {
1277
+ onClick: Y,
1276
1278
  icon: "ic:round-close"
1277
1279
  })
1278
1280
  ])
1279
1281
  ]),
1280
- it(F(je, {
1282
+ re(X(tn, {
1281
1283
  ref_key: "answerRef",
1282
- ref: S,
1283
- defaultSayhello: $(r).defaultSayhello,
1284
- defaultRecommend: $(r).defaultRecommend,
1285
- onTitleGenerated: D[3] || (D[3] = (W) => g.value = W)
1284
+ ref: y,
1285
+ defaultSayhello: O(r).defaultSayhello,
1286
+ defaultRecommend: O(r).defaultRecommend,
1287
+ onTitleGenerated: M[3] || (M[3] = (W) => E.value = W)
1286
1288
  }, null, 8, ["defaultSayhello", "defaultRecommend"]), [
1287
- [vt, H.value === "answer"]
1289
+ [ge, B.value === "answer"]
1288
1290
  ]),
1289
- H.value === "info" ? (k(), lt(bn, { key: 0 })) : V("", !0),
1290
- T.value ? (k(), b("div", {
1291
+ B.value === "info" ? (w(), ee(Mn, { key: 0 })) : V("", !0),
1292
+ b.value ? (w(), S("div", {
1291
1293
  key: 1,
1292
- class: _(["ai-history-drawer", { closing: R.value }])
1294
+ class: J(["ai-history-drawer", { closing: L.value }])
1293
1295
  }, [
1294
1296
  s("div", {
1295
1297
  class: "ai-history-backdrop",
1296
- onClick: J
1298
+ onClick: le
1297
1299
  }),
1298
- s("div", Hn, [
1299
- s("div", On, [
1300
- D[7] || (D[7] = s("span", null, "对话记录", -1)),
1301
- F($(j), {
1300
+ s("div", Nn, [
1301
+ s("div", Bn, [
1302
+ M[7] || (M[7] = s("span", null, "对话记录", -1)),
1303
+ X(O(j), {
1302
1304
  icon: "ic:round-close",
1303
1305
  class: "ai-history-drawer-close",
1304
- onClick: J
1306
+ onClick: le
1305
1307
  })
1306
1308
  ]),
1307
- F(un, {
1308
- onHistoryDetail: ot,
1309
- onNewConversation: Q
1309
+ X(mn, {
1310
+ onHistoryDetail: Q,
1311
+ onNewConversation: U
1310
1312
  })
1311
1313
  ])
1312
1314
  ], 2)) : V("", !0),
1313
- it(s("div", $n, [
1314
- s("div", Pn, [
1315
- s("div", Nn, [
1316
- D[8] || (D[8] = s("p", { class: "title" }, "修改标题", -1)),
1317
- it(s("textarea", {
1318
- "onUpdate:modelValue": D[4] || (D[4] = (W) => E.value = W),
1315
+ re(s("div", Ln, [
1316
+ s("div", xn, [
1317
+ s("div", Wn, [
1318
+ M[8] || (M[8] = s("p", { class: "title" }, "修改标题", -1)),
1319
+ re(s("textarea", {
1320
+ "onUpdate:modelValue": M[4] || (M[4] = (W) => m.value = W),
1319
1321
  placeholder: "请输入新标题"
1320
1322
  }, null, 512), [
1321
- [Vt, E.value]
1323
+ [_e, m.value]
1322
1324
  ]),
1323
- s("p", Bn, [
1325
+ s("p", Yn, [
1324
1326
  s("span", {
1325
- onClick: D[5] || (D[5] = (W) => x.value = !1)
1327
+ onClick: M[5] || (M[5] = (W) => R.value = !1)
1326
1328
  }, "取消"),
1327
- s("span", { onClick: at }, "确定")
1329
+ s("span", { onClick: Ye }, "确定")
1328
1330
  ])
1329
1331
  ])
1330
1332
  ])
1331
1333
  ], 512), [
1332
- [vt, x.value]
1334
+ [ge, R.value]
1333
1335
  ])
1334
1336
  ], 6), [
1335
- [vt, v.value || o.value !== "idle"]
1337
+ [ge, v.value || o.value !== "idle"]
1336
1338
  ]),
1337
- it(s("div", {
1338
- class: _(["character", { dragging: e.value, recycling: L.value, "hover-preview": n.value }]),
1339
- style: Tt(O.value),
1340
- onMousedown: ft,
1341
- onTouchstart: ft,
1342
- onClick: St
1339
+ re(s("div", {
1340
+ class: J(["character", { dragging: x.value, recycling: D.value, "hover-preview": n.value }]),
1341
+ style: Te(N.value),
1342
+ onMousedown: ae,
1343
+ onTouchstart: ae,
1344
+ onClick: Re
1343
1345
  }, [
1344
- s("img", { src: N.value }, null, 8, Ln)
1346
+ s("img", { src: G.value }, null, 8, Qn)
1345
1347
  ], 38), [
1346
- [vt, !v.value]
1348
+ [ge, !v.value]
1347
1349
  ])
1348
1350
  ]));
1349
1351
  }
1350
1352
  });
1351
- let gt = null;
1352
- const Vn = (t) => {
1353
- Nt(t);
1354
- }, Gn = (t) => {
1355
- const u = t || document.body, r = document.createElement("div");
1356
- r.id = "ai-assist-root", u.appendChild(r), gt = Gt(Bt), gt.mount(r);
1357
- }, Jn = () => {
1358
- gt && (gt.unmount(), gt = null);
1359
- const t = document.getElementById("ai-assist-root");
1360
- t && t.remove();
1361
- }, _n = {
1362
- install(t, u) {
1363
- Nt(u), t.component("AiAssist", Bt);
1353
+ let he = null;
1354
+ const _n = (e) => {
1355
+ Le(e);
1356
+ }, Un = (e) => {
1357
+ const u = e || document.body, r = document.createElement("div");
1358
+ r.id = "ai-assist-root";
1359
+ const v = fe();
1360
+ Me(v.theme), it(), u.appendChild(r), he = Ue(We), he.mount(r);
1361
+ }, jn = () => {
1362
+ he && (he.unmount(), he = null);
1363
+ const e = document.getElementById("ai-assist-root");
1364
+ e && e.remove();
1365
+ }, Kn = {
1366
+ install(e, u) {
1367
+ Le(u), e.component("AiAssist", We);
1364
1368
  }
1365
1369
  };
1366
1370
  export {
1367
- Bt as AiAssist,
1368
- _n as default,
1369
- Vn as initAiAssist,
1370
- Gn as mountAiAssist,
1371
- Jn as unmountAiAssist
1371
+ We as AiAssist,
1372
+ Kn as default,
1373
+ _n as initAiAssist,
1374
+ Un as mountAiAssist,
1375
+ jn as unmountAiAssist
1372
1376
  };