wi-chat 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/core/index.cjs +1 -1
  2. package/dist/core/index.js +273 -261
  3. package/dist/core/useChat.d.ts +61 -12
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.js +33 -33
  7. package/dist/mobile-ui/chat/ChatContainer.vue.d.ts +6 -6
  8. package/dist/mobile-ui/chat/ChatMessagesView.vue.d.ts +6 -6
  9. package/dist/mobile-ui/index.cjs +1 -1
  10. package/dist/mobile-ui/index.js +104 -104
  11. package/dist/mobile-ui/inputbox/Inputbox.vue.d.ts +5 -5
  12. package/dist/page-context/index.js +2 -4
  13. package/dist/parser/answerCom/actionExecute/actionProtocol.d.ts +1 -7
  14. package/dist/parser/answerCom/actionExecute/clarification.d.ts +15 -3
  15. package/dist/parser/answerCom/actionExecute/constants.d.ts +10 -0
  16. package/dist/parser/answerCom/actionExecute/parseCollectClarifications.d.ts +3 -2
  17. package/dist/parser/answerCom/actionExecute/parseHostAction.d.ts +3 -2
  18. package/dist/parser/answerCom/actionExecute/types.d.ts +3 -3
  19. package/dist/parser/index.cjs +2 -2
  20. package/dist/parser/index.d.ts +2 -2
  21. package/dist/parser/index.js +216 -258
  22. package/dist/parser/registry.d.ts +1 -1
  23. package/dist/renderers/aiAnswer/AiAnswerBubble.vue.d.ts +4 -4
  24. package/dist/renderers/clarification/ClarificationCard.vue.d.ts +3 -3
  25. package/dist/renderers/deepThinking/DeepThinkingSteps.vue.d.ts +4 -4
  26. package/dist/renderers/hostAction/HostActionStatus.vue.d.ts +3 -3
  27. package/dist/renderers/iframePage/IframePage.vue.d.ts +3 -3
  28. package/dist/renderers/index.cjs +1 -1
  29. package/dist/renderers/index.js +484 -498
  30. package/dist/renderers/knowledgeStream/KnowledgeStreamResult.vue.d.ts +3 -3
  31. package/dist/renderers/outputFile/OutputFile.vue.d.ts +3 -3
  32. package/dist/renderers/style.css +1 -1
  33. package/dist/request/index.cjs +2 -2
  34. package/dist/request/index.js +6 -13
  35. package/dist/request/ws.d.ts +3 -3
  36. package/dist/right-panel/RightPanel.vue.d.ts +6 -6
  37. package/dist/right-panel/RightPanelIcon.vue.d.ts +4 -4
  38. package/dist/right-panel/RightPanelTabs.vue.d.ts +5 -5
  39. package/dist/right-panel/index.cjs +1 -1
  40. package/dist/right-panel/index.js +397 -416
  41. package/dist/right-panel/panels/newtab/NewTabPanel.vue.d.ts +4 -4
  42. package/dist/right-panel/panels/web/WebPanel.vue.d.ts +3 -3
  43. package/dist/right-panel/shared/BrowserToolbar.vue.d.ts +3 -3
  44. package/dist/right-panel/shared/RightPanelToolList.vue.d.ts +5 -5
  45. package/dist/theme/index.js +2 -4
  46. package/dist/tools/index.cjs +2 -2
  47. package/dist/tools/index.js +10 -19
  48. package/dist/tools/markdown/MarkdownContent.vue.d.ts +5 -5
  49. package/dist/tools/useAutoScroll.d.ts +3 -3
  50. package/dist/web-ui/attach/AttachmentCard.vue.d.ts +6 -6
  51. package/dist/web-ui/attach/AttachmentList.vue.d.ts +6 -6
  52. package/dist/web-ui/chat/ChatContainer.vue.d.ts +6 -6
  53. package/dist/web-ui/chat/ChatMessagesView.vue.d.ts +6 -6
  54. package/dist/web-ui/envswitch/EnvSwitch.vue.d.ts +5 -5
  55. package/dist/web-ui/index.cjs +1 -1
  56. package/dist/web-ui/index.js +630 -635
  57. package/dist/web-ui/inputbox/Inputbox.vue.d.ts +7 -7
  58. package/dist/web-ui/recordset/RecordsetTable.vue.d.ts +4 -4
  59. package/package.json +2 -1
@@ -1,58 +1,10 @@
1
- import { createAnswerContentMap as re, provideOutputFileConfig as de, DeepThinkingSteps as ce, AiAnswerBubble as ue } from "wi-chat/renderers";
2
- import { AiAnswerBubble as Es, ClarificationCard as xs, DeepThinkingSteps as Os, HostActionStatus as Ds, IframePage as Qs, KnowledgeStreamResult as Ns, OutputFile as js, createAnswerContentMap as Hs, injectIframeResizerChild as Ws, provideIframePageConfig as qs, provideOutputFileConfig as Ks, resolveIframePlaceholders as Ys, useIframePage as Xs } from "wi-chat/renderers";
3
- import { defineComponent as D, computed as k, openBlock as s, createElementBlock as n, normalizeClass as z, createElementVNode as t, renderSlot as S, createBlock as V, unref as I, withModifiers as te, withCtx as $, createTextVNode as O, toDisplayString as A, createCommentVNode as g, createStaticVNode as le, pushScopeId as q, popScopeId as K, Fragment as P, renderList as j, normalizeProps as Z, guardReactiveProps as G, ref as x, onBeforeUnmount as pe, createVNode as L, withKeys as he, defineAsyncComponent as _e, watch as se, Transition as ve, resolveComponent as J, normalizeStyle as we } from "vue";
4
- import { ElImage as me, ElPopover as be, ElCheckbox as fe, ElInput as ge, ElTooltip as ee } from "element-plus";
5
- import { isImageAttachment as ye, resolveAttachPreviewUrl as ke, normalizeAttachment as $e, resolveRemoteFileUrl as Ce, parseRealtimeAttachment as Ue } from "wi-chat/parser";
6
- import { downloadAttachment as Ae, useAutoScroll as Be } from "wi-chat/tools";
7
- const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-attach-card__icon" }, Fe = /* @__PURE__ */ H(() => /* @__PURE__ */ t("div", { class: "wi-web-attach-card__image-fallback" }, [
8
- /* @__PURE__ */ t("svg", {
9
- viewBox: "0 0 24 24",
10
- width: "16",
11
- height: "16",
12
- fill: "none",
13
- stroke: "currentColor",
14
- "stroke-width": "2"
15
- }, [
16
- /* @__PURE__ */ t("rect", {
17
- x: "3",
18
- y: "3",
19
- width: "18",
20
- height: "18",
21
- rx: "2",
22
- ry: "2"
23
- }),
24
- /* @__PURE__ */ t("circle", {
25
- cx: "8.5",
26
- cy: "8.5",
27
- r: "1.5"
28
- }),
29
- /* @__PURE__ */ t("polyline", { points: "21 15 16 10 5 21" })
30
- ])
31
- ], -1)), Re = /* @__PURE__ */ H(() => /* @__PURE__ */ t("div", { class: "wi-web-attach-card__image-fallback" }, [
32
- /* @__PURE__ */ t("svg", {
33
- viewBox: "0 0 24 24",
34
- width: "16",
35
- height: "16",
36
- fill: "none",
37
- stroke: "currentColor",
38
- "stroke-width": "2"
39
- }, [
40
- /* @__PURE__ */ t("rect", {
41
- x: "3",
42
- y: "3",
43
- width: "18",
44
- height: "18",
45
- rx: "2",
46
- ry: "2"
47
- }),
48
- /* @__PURE__ */ t("circle", {
49
- cx: "8.5",
50
- cy: "8.5",
51
- r: "1.5"
52
- }),
53
- /* @__PURE__ */ t("polyline", { points: "21 15 16 10 5 21" })
54
- ])
55
- ], -1)), Se = {
1
+ import { createAnswerContentMap as te, provideOutputFileConfig as le, DeepThinkingSteps as ae, AiAnswerBubble as ne } from "wi-chat/renderers";
2
+ import { AiAnswerBubble as qt, ClarificationCard as Kt, DeepThinkingSteps as Yt, HostActionStatus as Xt, IframePage as Zt, KnowledgeStreamResult as Gt, OutputFile as Jt, createAnswerContentMap as el, injectIframeResizerChild as tl, provideIframePageConfig as ll, provideOutputFileConfig as al, resolveIframePlaceholders as nl, useIframePage as il } from "wi-chat/renderers";
3
+ import { defineComponent as O, computed as _, openBlock as l, createElementBlock as i, normalizeClass as T, createElementVNode as t, renderSlot as I, createBlock as V, unref as B, withModifiers as X, withCtx as x, createStaticVNode as J, createTextVNode as P, toDisplayString as U, createCommentVNode as y, Fragment as M, renderList as N, mergeProps as q, ref as E, onBeforeUnmount as ie, createVNode as L, withKeys as se, defineAsyncComponent as oe, watch as Z, Transition as re, resolveComponent as K, normalizeStyle as de } from "vue";
4
+ import { ElImage as ce, ElPopover as ue, ElCheckbox as ve, ElInput as we, ElTooltip as Y } from "element-plus";
5
+ import { isImageAttachment as me, resolveAttachPreviewUrl as be, normalizeAttachment as he, resolveRemoteFileUrl as fe, parseRealtimeAttachment as ge } from "wi-chat/parser";
6
+ import { downloadAttachment as pe, useAutoScroll as ye } from "wi-chat/tools";
7
+ const ke = { class: "wi-web-attach-card__icon" }, _e = {
56
8
  key: 1,
57
9
  viewBox: "0 0 24 24",
58
10
  width: "20",
@@ -60,9 +12,7 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
60
12
  fill: "none",
61
13
  stroke: "currentColor",
62
14
  "stroke-width": "2"
63
- }, Ve = /* @__PURE__ */ le('<rect x="3" y="3" width="18" height="18" rx="2" data-v-dc2d5f2b></rect><path d="M3 9h18" data-v-dc2d5f2b></path><path d="M3 15h18" data-v-dc2d5f2b></path><path d="M9 3v18" data-v-dc2d5f2b></path><path d="M15 3v18" data-v-dc2d5f2b></path>', 5), Le = [
64
- Ve
65
- ], Te = {
15
+ }, xe = {
66
16
  key: 2,
67
17
  viewBox: "0 0 24 24",
68
18
  width: "20",
@@ -70,11 +20,7 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
70
20
  fill: "none",
71
21
  stroke: "currentColor",
72
22
  "stroke-width": "2"
73
- }, Me = /* @__PURE__ */ H(() => /* @__PURE__ */ t("path", { d: "M18 20V10" }, null, -1)), ze = /* @__PURE__ */ H(() => /* @__PURE__ */ t("path", { d: "M12 20V4" }, null, -1)), Pe = /* @__PURE__ */ H(() => /* @__PURE__ */ t("path", { d: "M6 20v-6" }, null, -1)), Ee = [
74
- Me,
75
- ze,
76
- Pe
77
- ], xe = {
23
+ }, Ce = {
78
24
  key: 3,
79
25
  viewBox: "0 0 24 24",
80
26
  width: "20",
@@ -82,30 +28,10 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
82
28
  fill: "none",
83
29
  stroke: "currentColor",
84
30
  "stroke-width": "2"
85
- }, Oe = /* @__PURE__ */ le('<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-dc2d5f2b></path><polyline points="14 2 14 8 20 8" data-v-dc2d5f2b></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-dc2d5f2b></line><line x1="16" y1="17" x2="8" y2="17" data-v-dc2d5f2b></line><polyline points="10 9 9 9 8 9" data-v-dc2d5f2b></polyline>', 5), De = [
86
- Oe
87
- ], Qe = { class: "wi-web-attach-card__info" }, Ne = ["title"], je = {
31
+ }, $e = { class: "wi-web-attach-card__info" }, Ue = ["title"], Ae = {
88
32
  key: 0,
89
33
  class: "wi-web-attach-card__size"
90
- }, He = { class: "wi-web-attach-card__actions" }, We = /* @__PURE__ */ H(() => /* @__PURE__ */ t("svg", {
91
- viewBox: "0 0 24 24",
92
- width: "14",
93
- height: "14",
94
- fill: "none",
95
- stroke: "currentColor",
96
- "stroke-width": "2"
97
- }, [
98
- /* @__PURE__ */ t("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
99
- /* @__PURE__ */ t("polyline", { points: "7 10 12 15 17 10" }),
100
- /* @__PURE__ */ t("line", {
101
- x1: "12",
102
- y1: "15",
103
- x2: "12",
104
- y2: "3"
105
- })
106
- ], -1)), qe = [
107
- We
108
- ], Ke = /* @__PURE__ */ D({
34
+ }, Be = { class: "wi-web-attach-card__actions" }, Fe = /* @__PURE__ */ O({
109
35
  __name: "AttachmentCard",
110
36
  props: {
111
37
  item: {},
@@ -116,100 +42,171 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
116
42
  getFileUrl: { type: Function, default: void 0 }
117
43
  },
118
44
  emits: ["click", "remove", "download"],
119
- setup(p, { emit: C }) {
120
- const i = p, r = C, _ = k(() => {
121
- var o;
122
- return ((o = i.item) == null ? void 0 : o.attachContent) || {};
123
- }), m = k(() => ye(i.item)), b = k(() => ke(i.item, i.baseURL, i.getFileUrl)), a = k(() => {
124
- if (i.removable)
125
- return !1;
126
- if (i.downloadable !== void 0)
127
- return i.downloadable;
128
- if (i.item.type && i.item.type !== "file")
129
- return !1;
130
- const o = _.value;
131
- return !!(o.fileId || o.raw);
132
- }), u = () => {
133
- r("click", i.item);
134
- }, d = () => {
135
- r("remove", i.item);
136
- }, h = async () => {
137
- r("download", i.item), await Ae(i.item, {
138
- baseURL: i.baseURL,
139
- getFileUrl: i.getFileUrl
45
+ setup(e, { emit: $ }) {
46
+ const s = e, o = $, m = _(() => {
47
+ var d;
48
+ return ((d = s.item) == null ? void 0 : d.attachContent) || {};
49
+ }), g = _(() => me(s.item)), p = _(() => be(s.item, s.baseURL, s.getFileUrl)), h = _(() => {
50
+ if (s.removable) return !1;
51
+ if (s.downloadable !== void 0) return s.downloadable;
52
+ if (s.item.type && s.item.type !== "file") return !1;
53
+ const d = m.value;
54
+ return !!(d.fileId || d.raw);
55
+ }), v = () => {
56
+ o("click", s.item);
57
+ }, r = () => {
58
+ o("remove", s.item);
59
+ }, w = async () => {
60
+ o("download", s.item), await pe(s.item, {
61
+ baseURL: s.baseURL,
62
+ getFileUrl: s.getFileUrl
140
63
  });
141
64
  };
142
- return (o, l) => (s(), n("div", {
143
- class: z(["wi-web-attach-card", { "is-clickable": o.clickable || !!o.$attrs.onClick }]),
144
- onClick: u
65
+ return (d, a) => (l(), i("div", {
66
+ class: T(["wi-web-attach-card", { "is-clickable": e.clickable || !!d.$attrs.onClick }]),
67
+ onClick: v
145
68
  }, [
146
- t("div", Ie, [
147
- S(o.$slots, "icon", { item: o.item }, () => [
148
- m.value && b.value ? (s(), V(I(me), {
69
+ t("div", ke, [
70
+ I(d.$slots, "icon", { item: e.item }, () => [
71
+ g.value && p.value ? (l(), V(B(ce), {
149
72
  key: 0,
150
- src: b.value,
151
- "preview-src-list": [b.value],
73
+ src: p.value,
74
+ "preview-src-list": [p.value],
152
75
  "zoom-rate": 1.2,
153
76
  "preview-teleported": "",
154
77
  fit: "cover",
155
78
  class: "wi-web-attach-card__image",
156
- onClick: l[0] || (l[0] = te(() => {
79
+ onClick: a[0] || (a[0] = X(() => {
157
80
  }, ["stop"]))
158
81
  }, {
159
- placeholder: $(() => [
160
- Fe
161
- ]),
162
- error: $(() => [
163
- Re
164
- ]),
82
+ placeholder: x(() => [...a[1] || (a[1] = [
83
+ t("div", { class: "wi-web-attach-card__image-fallback" }, [
84
+ t("svg", {
85
+ viewBox: "0 0 24 24",
86
+ width: "16",
87
+ height: "16",
88
+ fill: "none",
89
+ stroke: "currentColor",
90
+ "stroke-width": "2"
91
+ }, [
92
+ t("rect", {
93
+ x: "3",
94
+ y: "3",
95
+ width: "18",
96
+ height: "18",
97
+ rx: "2",
98
+ ry: "2"
99
+ }),
100
+ t("circle", {
101
+ cx: "8.5",
102
+ cy: "8.5",
103
+ r: "1.5"
104
+ }),
105
+ t("polyline", { points: "21 15 16 10 5 21" })
106
+ ])
107
+ ], -1)
108
+ ])]),
109
+ error: x(() => [...a[2] || (a[2] = [
110
+ t("div", { class: "wi-web-attach-card__image-fallback" }, [
111
+ t("svg", {
112
+ viewBox: "0 0 24 24",
113
+ width: "16",
114
+ height: "16",
115
+ fill: "none",
116
+ stroke: "currentColor",
117
+ "stroke-width": "2"
118
+ }, [
119
+ t("rect", {
120
+ x: "3",
121
+ y: "3",
122
+ width: "18",
123
+ height: "18",
124
+ rx: "2",
125
+ ry: "2"
126
+ }),
127
+ t("circle", {
128
+ cx: "8.5",
129
+ cy: "8.5",
130
+ r: "1.5"
131
+ }),
132
+ t("polyline", { points: "21 15 16 10 5 21" })
133
+ ])
134
+ ], -1)
135
+ ])]),
165
136
  _: 1
166
- }, 8, ["src", "preview-src-list"])) : o.item.type === "table" ? (s(), n("svg", Se, Le)) : o.item.type === "metric" ? (s(), n("svg", Te, Ee)) : (s(), n("svg", xe, De))
137
+ }, 8, ["src", "preview-src-list"])) : e.item.type === "table" ? (l(), i("svg", _e, [...a[3] || (a[3] = [
138
+ J('<rect x="3" y="3" width="18" height="18" rx="2" data-v-dc2d5f2b></rect><path d="M3 9h18" data-v-dc2d5f2b></path><path d="M3 15h18" data-v-dc2d5f2b></path><path d="M9 3v18" data-v-dc2d5f2b></path><path d="M15 3v18" data-v-dc2d5f2b></path>', 5)
139
+ ])])) : e.item.type === "metric" ? (l(), i("svg", xe, [...a[4] || (a[4] = [
140
+ t("path", { d: "M18 20V10" }, null, -1),
141
+ t("path", { d: "M12 20V4" }, null, -1),
142
+ t("path", { d: "M6 20v-6" }, null, -1)
143
+ ])])) : (l(), i("svg", Ce, [...a[5] || (a[5] = [
144
+ J('<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-dc2d5f2b></path><polyline points="14 2 14 8 20 8" data-v-dc2d5f2b></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-dc2d5f2b></line><line x1="16" y1="17" x2="8" y2="17" data-v-dc2d5f2b></line><polyline points="10 9 9 9 8 9" data-v-dc2d5f2b></polyline>', 5)
145
+ ])]))
167
146
  ], !0)
168
147
  ]),
169
- t("div", Qe, [
148
+ t("div", $e, [
170
149
  t("div", {
171
150
  class: "wi-web-attach-card__name",
172
- title: o.item.name
151
+ title: e.item.name
173
152
  }, [
174
- S(o.$slots, "title", { item: o.item }, () => [
175
- O(A(o.item.name), 1)
153
+ I(d.$slots, "title", { item: e.item }, () => [
154
+ P(U(e.item.name), 1)
176
155
  ], !0)
177
- ], 8, Ne),
178
- o.item.description || o.$slots.description ? (s(), n("div", je, [
179
- S(o.$slots, "description", { item: o.item }, () => [
180
- O(A(o.item.description), 1)
156
+ ], 8, Ue),
157
+ e.item.description || d.$slots.description ? (l(), i("div", Ae, [
158
+ I(d.$slots, "description", { item: e.item }, () => [
159
+ P(U(e.item.description), 1)
181
160
  ], !0)
182
- ])) : g("", !0)
161
+ ])) : y("", !0)
183
162
  ]),
184
- t("div", He, [
185
- S(o.$slots, "actions", { item: o.item }, () => [
186
- a.value ? (s(), n("button", {
163
+ t("div", Be, [
164
+ I(d.$slots, "actions", { item: e.item }, () => [
165
+ h.value ? (l(), i("button", {
187
166
  key: 0,
188
167
  type: "button",
189
168
  class: "wi-web-attach-card__action-btn wi-web-attach-card__download",
190
169
  title: "下载附件",
191
- onClick: te(h, ["stop"])
192
- }, qe)) : g("", !0),
193
- o.removable ? (s(), n("button", {
170
+ onClick: X(w, ["stop"])
171
+ }, [...a[6] || (a[6] = [
172
+ t("svg", {
173
+ viewBox: "0 0 24 24",
174
+ width: "14",
175
+ height: "14",
176
+ fill: "none",
177
+ stroke: "currentColor",
178
+ "stroke-width": "2"
179
+ }, [
180
+ t("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
181
+ t("polyline", { points: "7 10 12 15 17 10" }),
182
+ t("line", {
183
+ x1: "12",
184
+ y1: "15",
185
+ x2: "12",
186
+ y2: "3"
187
+ })
188
+ ], -1)
189
+ ])])) : y("", !0),
190
+ e.removable ? (l(), i("button", {
194
191
  key: 1,
195
192
  type: "button",
196
193
  class: "wi-web-attach-card__action-btn wi-web-attach-card__delete",
197
194
  title: "删除附件",
198
- onClick: te(d, ["stop"])
199
- }, " × ")) : g("", !0)
195
+ onClick: X(r, ["stop"])
196
+ }, " × ")) : y("", !0)
200
197
  ], !0)
201
198
  ])
202
199
  ], 2));
203
200
  }
204
- }), Q = (p, C) => {
205
- const i = p.__vccOpts || p;
206
- for (const [r, _] of C)
207
- i[r] = _;
208
- return i;
209
- }, Ye = /* @__PURE__ */ Q(Ke, [["__scopeId", "data-v-dc2d5f2b"]]), Xe = {
201
+ }), D = (e, $) => {
202
+ const s = e.__vccOpts || e;
203
+ for (const [o, m] of $)
204
+ s[o] = m;
205
+ return s;
206
+ }, Re = /* @__PURE__ */ D(Fe, [["__scopeId", "data-v-dc2d5f2b"]]), Ie = {
210
207
  key: 0,
211
208
  class: "wi-web-attachment-list"
212
- }, Ze = /* @__PURE__ */ D({
209
+ }, Ve = /* @__PURE__ */ O({
213
210
  __name: "AttachmentList",
214
211
  props: {
215
212
  items: { default: () => [] },
@@ -220,152 +217,82 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
220
217
  getFileUrl: { type: Function, default: void 0 }
221
218
  },
222
219
  emits: ["remove", "click", "download"],
223
- setup(p, { emit: C }) {
224
- const i = p, r = C, _ = k(() => (i.items || []).map((d, h) => {
220
+ setup(e, { emit: $ }) {
221
+ const s = e, o = $, m = _(() => (s.items || []).map((r, w) => {
225
222
  var c, f;
226
- const o = $e(d), l = (c = o.attachContent) == null ? void 0 : c.raw, U = ((f = o.attachContent) == null ? void 0 : f.fileId) || (l ? `${l.name}_${l.size}_${h}` : `${o.name}_${h}`);
223
+ const d = he(r), a = (c = d.attachContent) == null ? void 0 : c.raw, C = ((f = d.attachContent) == null ? void 0 : f.fileId) || (a ? `${a.name}_${a.size}_${w}` : `${d.name}_${w}`);
227
224
  return {
228
- ...o,
229
- key: U
225
+ ...d,
226
+ key: C
230
227
  };
231
- })), m = (u, d) => {
232
- r("remove", u, d);
233
- }, b = (u, d) => {
234
- r("click", u, d);
235
- }, a = (u, d) => {
236
- r("download", u, d);
228
+ })), g = (v, r) => {
229
+ o("remove", v, r);
230
+ }, p = (v, r) => {
231
+ o("click", v, r);
232
+ }, h = (v, r) => {
233
+ o("download", v, r);
237
234
  };
238
- return (u, d) => _.value.length > 0 ? (s(), n("div", Xe, [
239
- (s(!0), n(P, null, j(_.value, (h, o) => (s(), V(Ye, {
240
- key: h.key || o,
241
- item: h,
242
- removable: u.removable,
243
- downloadable: u.downloadable,
244
- clickable: u.clickable || !!u.$attrs.onClick,
245
- "base-u-r-l": u.baseURL,
246
- "get-file-url": u.getFileUrl,
247
- onClick: (l) => b(h, o),
248
- onRemove: (l) => m(o, h),
249
- onDownload: (l) => a(h, o)
235
+ return (v, r) => m.value.length > 0 ? (l(), i("div", Ie, [
236
+ (l(!0), i(M, null, N(m.value, (w, d) => (l(), V(Re, {
237
+ key: w.key || d,
238
+ item: w,
239
+ removable: e.removable,
240
+ downloadable: e.downloadable,
241
+ clickable: e.clickable || !!v.$attrs.onClick,
242
+ "base-u-r-l": e.baseURL,
243
+ "get-file-url": e.getFileUrl,
244
+ onClick: (a) => p(w, d),
245
+ onRemove: (a) => g(d, w),
246
+ onDownload: (a) => h(w, d)
250
247
  }, {
251
- icon: $((l) => [
252
- S(u.$slots, "icon", Z(G(l)), void 0, !0)
248
+ icon: x((a) => [
249
+ I(v.$slots, "icon", q({ ref_for: !0 }, a), void 0, !0)
253
250
  ]),
254
- title: $((l) => [
255
- S(u.$slots, "title", Z(G(l)), void 0, !0)
251
+ title: x((a) => [
252
+ I(v.$slots, "title", q({ ref_for: !0 }, a), void 0, !0)
256
253
  ]),
257
- description: $((l) => [
258
- S(u.$slots, "description", Z(G(l)), void 0, !0)
254
+ description: x((a) => [
255
+ I(v.$slots, "description", q({ ref_for: !0 }, a), void 0, !0)
259
256
  ]),
260
- actions: $((l) => [
261
- S(u.$slots, "actions", Z(G(l)), void 0, !0)
257
+ actions: x((a) => [
258
+ I(v.$slots, "actions", q({ ref_for: !0 }, a), void 0, !0)
262
259
  ]),
263
- _: 2
264
- }, 1032, ["item", "removable", "downloadable", "clickable", "base-u-r-l", "get-file-url", "onClick", "onRemove", "onDownload"]))), 128))
265
- ])) : g("", !0);
260
+ _: 3
261
+ }, 8, ["item", "removable", "downloadable", "clickable", "base-u-r-l", "get-file-url", "onClick", "onRemove", "onDownload"]))), 128))
262
+ ])) : y("", !0);
266
263
  }
267
- }), ne = /* @__PURE__ */ Q(Ze, [["__scopeId", "data-v-ff76d134"]]), T = (p) => (q("data-v-c6f1253a"), p = p(), K(), p), Ge = { class: "wi-web-inputbox" }, Je = {
264
+ }), ee = /* @__PURE__ */ D(Ve, [["__scopeId", "data-v-ff76d134"]]), Le = { class: "wi-web-inputbox" }, Se = {
268
265
  key: 0,
269
266
  class: "wi-web-inputbox__top-bar"
270
- }, et = {
267
+ }, Te = {
271
268
  key: 0,
272
269
  class: "wi-web-inputbox__agent-bar"
273
- }, tt = { class: "wi-web-inputbox__agent-icon-wrapper" }, st = ["src"], ot = {
270
+ }, Me = { class: "wi-web-inputbox__agent-icon-wrapper" }, ze = ["src"], Ee = {
274
271
  key: 1,
275
272
  class: "wi-web-inputbox__agent-svg",
276
273
  viewBox: "0 0 24 24",
277
274
  fill: "none",
278
275
  stroke: "currentColor",
279
276
  "stroke-width": "2"
280
- }, at = /* @__PURE__ */ T(() => /* @__PURE__ */ t("circle", {
281
- cx: "12",
282
- cy: "8",
283
- r: "4"
284
- }, null, -1)), lt = /* @__PURE__ */ T(() => /* @__PURE__ */ t("path", { d: "M4 20c0-4 4-6 8-6s8 2 8 6" }, null, -1)), nt = [
285
- at,
286
- lt
287
- ], it = { class: "wi-web-inputbox__agent-title" }, rt = /* @__PURE__ */ T(() => /* @__PURE__ */ t("path", {
288
- d: "M840.4 300H183.6c-19.7 0-30.7 22.7-18.5 37.1l328.4 388.7c9.5 11.2 27.5 11.2 37 0l328.4-388.7c12.2-14.4 1.2-37.1-18.5-37.1z",
289
- fill: "currentColor"
290
- }, null, -1)), dt = [
291
- rt
292
- ], ct = { class: "wi-web-agent-list" }, ut = /* @__PURE__ */ T(() => /* @__PURE__ */ t("div", { class: "wi-web-agent-list__header" }, "切换智能体", -1)), pt = {
277
+ }, Pe = { class: "wi-web-inputbox__agent-title" }, Oe = { class: "wi-web-agent-list" }, De = {
293
278
  key: 0,
294
279
  class: "wi-web-agent-list__empty"
295
- }, ht = ["onClick"], _t = { class: "wi-web-agent-item__left" }, vt = ["src"], wt = {
280
+ }, Qe = ["onClick"], Ne = { class: "wi-web-agent-item__left" }, je = ["src"], He = {
296
281
  key: 1,
297
282
  class: "wi-web-agent-item__avatar-fallback"
298
- }, mt = /* @__PURE__ */ T(() => /* @__PURE__ */ t("svg", {
299
- viewBox: "0 0 24 24",
300
- fill: "none",
301
- stroke: "currentColor",
302
- "stroke-width": "2"
303
- }, [
304
- /* @__PURE__ */ t("circle", {
305
- cx: "12",
306
- cy: "8",
307
- r: "4"
308
- }),
309
- /* @__PURE__ */ t("path", { d: "M4 20c0-4 4-6 8-6s8 2 8 6" })
310
- ], -1)), bt = [
311
- mt
312
- ], ft = { class: "wi-web-agent-item__title" }, gt = {
283
+ }, We = { class: "wi-web-agent-item__title" }, qe = {
313
284
  key: 0,
314
285
  class: "wi-web-agent-item__check"
315
- }, yt = {
286
+ }, Ke = {
316
287
  key: 1,
317
288
  class: "wi-web-inputbox__options"
318
- }, kt = { class: "wi-web-inputbox__main" }, $t = {
289
+ }, Ye = { class: "wi-web-inputbox__main" }, Xe = {
319
290
  key: 0,
320
291
  class: "wi-web-inputbox__attachments"
321
- }, Ct = { class: "wi-web-inputbox__footer" }, Ut = { class: "wi-web-inputbox__footer-left" }, At = { class: "wi-web-inputbox__footer-right" }, Bt = {
292
+ }, Ze = { class: "wi-web-inputbox__footer" }, Ge = { class: "wi-web-inputbox__footer-left" }, Je = { class: "wi-web-inputbox__footer-right" }, et = {
322
293
  key: 0,
323
294
  class: "wi-web-inputbox__counter"
324
- }, It = /* @__PURE__ */ T(() => /* @__PURE__ */ t("svg", {
325
- viewBox: "0 0 1024 1024",
326
- width: "16",
327
- height: "16",
328
- fill: "currentColor"
329
- }, [
330
- /* @__PURE__ */ t("path", { d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896z m0 85.333333a362.666667 362.666667 0 1 0 0 725.333334 362.666667 362.666667 0 0 0 0-725.333334z m120.746667 181.333334a42.666667 42.666667 0 0 1 54.826666 4.693333l5.546667 6.357334a42.666667 42.666667 0 0 1-4.693333 54.826666l-6.357334 5.546667-114.730666 114.773333 114.730666 114.730667a42.666667 42.666667 0 0 1 5.461334 54.826666l-5.461334 6.357334a42.666667 42.666667 0 0 1-54.826666 5.461333l-6.357334-5.461333-114.730666-114.730667-114.730667 114.730667a42.666667 42.666667 0 0 1-54.826667 5.461333l-6.357333-5.461333a42.666667 42.666667 0 0 1-5.461333-54.826667l5.461333-6.357333 114.730667-114.730667-114.730667-114.773333a42.666667 42.666667 0 0 1-5.461333-54.826667l5.461333-6.357333a42.666667 42.666667 0 0 1 54.826667-5.461334l6.357333 5.461334 114.730667 114.730666 114.730666-114.730666a42.666667 42.666667 0 0 1 24.32-11.434667z" })
331
- ], -1)), Ft = [
332
- It
333
- ], Rt = ["disabled"], St = /* @__PURE__ */ T(() => /* @__PURE__ */ t("svg", {
334
- viewBox: "0 0 24 24",
335
- width: "18",
336
- height: "18",
337
- fill: "none",
338
- stroke: "currentColor",
339
- "stroke-width": "2"
340
- }, [
341
- /* @__PURE__ */ t("path", { d: "M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48" })
342
- ], -1)), Vt = [
343
- St
344
- ], Lt = ["accept"], Tt = /* @__PURE__ */ T(() => /* @__PURE__ */ t("div", { class: "wi-web-inputbox__divider" }, null, -1)), Mt = /* @__PURE__ */ T(() => /* @__PURE__ */ t("svg", {
345
- viewBox: "0 0 24 24",
346
- width: "16",
347
- height: "16",
348
- fill: "currentColor"
349
- }, [
350
- /* @__PURE__ */ t("rect", {
351
- x: "6",
352
- y: "6",
353
- width: "12",
354
- height: "12",
355
- rx: "2"
356
- })
357
- ], -1)), zt = [
358
- Mt
359
- ], Pt = /* @__PURE__ */ T(() => /* @__PURE__ */ t("svg", {
360
- viewBox: "0 0 24 24",
361
- width: "18",
362
- height: "18",
363
- fill: "currentColor"
364
- }, [
365
- /* @__PURE__ */ t("path", { d: "M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" })
366
- ], -1)), Et = [
367
- Pt
368
- ], xt = /* @__PURE__ */ D({
295
+ }, tt = ["disabled"], lt = ["accept"], at = /* @__PURE__ */ O({
369
296
  __name: "Inputbox",
370
297
  props: {
371
298
  modelValue: { default: "" },
@@ -387,161 +314,186 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
387
314
  showIncPrevQuestion: { type: Boolean, default: !0 }
388
315
  },
389
316
  emits: ["update:modelValue", "submit", "stop", "selectAgent", "update:files", "update:attachments", "update:incPrevQuestion"],
390
- setup(p, { expose: C, emit: i }) {
391
- const r = p, _ = i, m = x(null), b = x(null), a = x(!1), u = (e) => Ue(e), d = x([]), h = k(() => !!!(r.modelValue && r.modelValue.trim())), o = (e) => e ? r.getFileUrl ? r.getFileUrl(e) : Ce(e, r.baseURL, "/algorithm/get_file_data") : "", l = (e) => {
392
- _("selectAgent", e), a.value = !1;
393
- }, U = (e) => {
394
- _("update:incPrevQuestion", e ? "N" : "Y");
317
+ setup(e, { expose: $, emit: s }) {
318
+ const o = e, m = s, g = E(null), p = E(null), h = E(!1), v = (u) => ge(u), r = E([]), w = _(() => !!!(o.modelValue && o.modelValue.trim())), d = (u) => u ? o.getFileUrl ? o.getFileUrl(u) : fe(u, o.baseURL, "/algorithm/get_file_data") : "", a = (u) => {
319
+ m("selectAgent", u), h.value = !1;
320
+ }, C = (u) => {
321
+ m("update:incPrevQuestion", u ? "N" : "Y");
395
322
  }, c = () => {
396
- _("update:modelValue", "");
323
+ m("update:modelValue", "");
397
324
  }, f = () => {
398
- b.value && (b.value.value = "", b.value.click());
399
- }, B = (e) => {
400
- const w = e.target;
401
- if (w.files && w.files.length > 0) {
402
- const v = Array.from(w.files);
403
- for (const y of v)
404
- d.value.some((W) => {
405
- var ae;
406
- const X = ((ae = W.attachContent) == null ? void 0 : ae.raw) || W.raw;
407
- return X && X.name === y.name && X.size === y.size && X.lastModified === y.lastModified;
408
- }) || d.value.push(u(y));
409
- const R = d.value.map((y) => {
410
- var E;
411
- return ((E = y.attachContent) == null ? void 0 : E.raw) || y.raw;
325
+ p.value && (p.value.value = "", p.value.click());
326
+ }, A = (u) => {
327
+ const n = u.target;
328
+ if (n.files && n.files.length > 0) {
329
+ const b = Array.from(n.files);
330
+ for (const k of b)
331
+ r.value.some((j) => {
332
+ var G;
333
+ const W = ((G = j.attachContent) == null ? void 0 : G.raw) || j.raw;
334
+ return W && W.name === k.name && W.size === k.size && W.lastModified === k.lastModified;
335
+ }) || r.value.push(v(k));
336
+ const R = r.value.map((k) => {
337
+ var z;
338
+ return ((z = k.attachContent) == null ? void 0 : z.raw) || k.raw;
412
339
  }).filter(Boolean);
413
- _("update:files", R), _("update:attachments", [...d.value]);
340
+ m("update:files", R), m("update:attachments", [...r.value]);
414
341
  }
415
- }, M = (e) => {
416
- var y;
417
- const w = d.value.splice(e, 1)[0], v = ((y = w == null ? void 0 : w.attachContent) == null ? void 0 : y.url) || (w == null ? void 0 : w.url);
418
- v && v.startsWith("blob:") && URL.revokeObjectURL(v);
419
- const R = d.value.map((E) => {
420
- var W;
421
- return ((W = E.attachContent) == null ? void 0 : W.raw) || E.raw;
342
+ }, S = (u) => {
343
+ var k;
344
+ const n = r.value.splice(u, 1)[0], b = ((k = n == null ? void 0 : n.attachContent) == null ? void 0 : k.url) || (n == null ? void 0 : n.url);
345
+ b && b.startsWith("blob:") && URL.revokeObjectURL(b);
346
+ const R = r.value.map((z) => {
347
+ var j;
348
+ return ((j = z.attachContent) == null ? void 0 : j.raw) || z.raw;
422
349
  }).filter(Boolean);
423
- _("update:files", R), _("update:attachments", [...d.value]);
424
- }, N = () => {
425
- d.value.forEach((e) => {
426
- var v;
427
- const w = ((v = e == null ? void 0 : e.attachContent) == null ? void 0 : v.url) || (e == null ? void 0 : e.url);
428
- w && w.startsWith("blob:") && URL.revokeObjectURL(w);
429
- }), d.value = [], _("update:files", []), _("update:attachments", []);
430
- }, Y = () => {
431
- if (r.disabled || h.value)
432
- return;
433
- const e = r.modelValue || "", w = d.value.map((R) => {
434
- var y;
435
- return ((y = R.attachContent) == null ? void 0 : y.raw) || R.raw;
436
- }).filter(Boolean), v = [...d.value];
437
- _("submit", { text: e, files: w, attachments: v, agent: r.currentAgent }), d.value = [], _("update:files", []), _("update:attachments", []);
438
- }, F = (e) => {
439
- e.isComposing || e.keyCode === 229 || (e.preventDefault(), Y());
350
+ m("update:files", R), m("update:attachments", [...r.value]);
351
+ }, Q = () => {
352
+ r.value.forEach((u) => {
353
+ var b;
354
+ const n = ((b = u == null ? void 0 : u.attachContent) == null ? void 0 : b.url) || (u == null ? void 0 : u.url);
355
+ n && n.startsWith("blob:") && URL.revokeObjectURL(n);
356
+ }), r.value = [], m("update:files", []), m("update:attachments", []);
357
+ }, H = () => {
358
+ if (o.disabled || w.value) return;
359
+ const u = o.modelValue || "", n = r.value.map((R) => {
360
+ var k;
361
+ return ((k = R.attachContent) == null ? void 0 : k.raw) || R.raw;
362
+ }).filter(Boolean), b = [...r.value];
363
+ m("submit", { text: u, files: n, attachments: b, agent: o.currentAgent }), r.value = [], m("update:files", []), m("update:attachments", []);
364
+ }, F = (u) => {
365
+ u.isComposing || u.keyCode === 229 || (u.preventDefault(), H());
440
366
  };
441
- return pe(() => {
442
- N();
443
- }), C({
367
+ return ie(() => {
368
+ Q();
369
+ }), $({
444
370
  /** 手动清空所有附件 */
445
- clearFiles: N,
371
+ clearFiles: Q,
446
372
  /** 获取当前附件原生 File 列表 */
447
- getFiles: () => d.value.map((e) => {
448
- var w;
449
- return ((w = e.attachContent) == null ? void 0 : w.raw) || e.raw;
373
+ getFiles: () => r.value.map((u) => {
374
+ var n;
375
+ return ((n = u.attachContent) == null ? void 0 : n.raw) || u.raw;
450
376
  }).filter(Boolean),
451
377
  /** 获取当前附件标准化对象列表 */
452
- getAttachments: () => d.value,
378
+ getAttachments: () => r.value,
453
379
  /** 聚焦输入框 */
454
380
  focus: () => {
455
- var e;
456
- (e = m.value) == null || e.focus();
381
+ var u;
382
+ (u = g.value) == null || u.focus();
457
383
  }
458
- }), (e, w) => (s(), n("div", Ge, [
459
- e.showAgentBar || e.showIncPrevQuestion ? (s(), n("div", Je, [
460
- e.showAgentBar ? (s(), n("div", et, [
461
- L(I(be), {
462
- visible: a.value,
463
- "onUpdate:visible": w[0] || (w[0] = (v) => a.value = v),
384
+ }), (u, n) => (l(), i("div", Le, [
385
+ e.showAgentBar || e.showIncPrevQuestion ? (l(), i("div", Se, [
386
+ e.showAgentBar ? (l(), i("div", Te, [
387
+ L(B(ue), {
388
+ visible: h.value,
389
+ "onUpdate:visible": n[0] || (n[0] = (b) => h.value = b),
464
390
  placement: "top-start",
465
391
  width: 260,
466
392
  trigger: "click",
467
393
  "popper-class": "wi-web-agent-popover"
468
394
  }, {
469
- reference: $(() => {
470
- var v, R, y;
395
+ reference: x(() => {
396
+ var b, R, k;
471
397
  return [
472
398
  t("div", {
473
- class: z(["wi-web-inputbox__agent-btn", { "is-disabled": e.disabled || e.talking }])
399
+ class: T(["wi-web-inputbox__agent-btn", { "is-disabled": e.disabled || e.talking }])
474
400
  }, [
475
- t("div", tt, [
476
- (v = e.currentAgent) != null && v.image_id && o(e.currentAgent.image_id) ? (s(), n("img", {
401
+ t("div", Me, [
402
+ (b = e.currentAgent) != null && b.image_id && d(e.currentAgent.image_id) ? (l(), i("img", {
477
403
  key: 0,
478
- src: o(e.currentAgent.image_id),
404
+ src: d(e.currentAgent.image_id),
479
405
  class: "wi-web-inputbox__agent-avatar"
480
- }, null, 8, st)) : (s(), n("svg", ot, nt))
406
+ }, null, 8, ze)) : (l(), i("svg", Ee, [...n[3] || (n[3] = [
407
+ t("circle", {
408
+ cx: "12",
409
+ cy: "8",
410
+ r: "4"
411
+ }, null, -1),
412
+ t("path", { d: "M4 20c0-4 4-6 8-6s8 2 8 6" }, null, -1)
413
+ ])]))
481
414
  ]),
482
- t("span", it, " @" + A(((R = e.currentAgent) == null ? void 0 : R.entry_title) || ((y = e.currentAgent) == null ? void 0 : y.entry_id) || e.defaultAgentTitle), 1),
483
- (s(), n("svg", {
484
- class: z(["wi-web-inputbox__agent-arrow", { "is-active": a.value }]),
415
+ t("span", Pe, " @" + U(((R = e.currentAgent) == null ? void 0 : R.entry_title) || ((k = e.currentAgent) == null ? void 0 : k.entry_id) || e.defaultAgentTitle), 1),
416
+ (l(), i("svg", {
417
+ class: T(["wi-web-inputbox__agent-arrow", { "is-active": h.value }]),
485
418
  viewBox: "0 0 1024 1024",
486
419
  width: "12",
487
420
  height: "12"
488
- }, dt, 2))
421
+ }, [...n[4] || (n[4] = [
422
+ t("path", {
423
+ d: "M840.4 300H183.6c-19.7 0-30.7 22.7-18.5 37.1l328.4 388.7c9.5 11.2 27.5 11.2 37 0l328.4-388.7c12.2-14.4 1.2-37.1-18.5-37.1z",
424
+ fill: "currentColor"
425
+ }, null, -1)
426
+ ])], 2))
489
427
  ], 2)
490
428
  ];
491
429
  }),
492
- default: $(() => [
493
- t("div", ct, [
494
- ut,
495
- !e.agentList || e.agentList.length === 0 ? (s(), n("div", pt, " 暂无可选智能体 ")) : g("", !0),
496
- (s(!0), n(P, null, j(e.agentList, (v) => {
497
- var R, y;
498
- return s(), n("div", {
499
- key: v.entry_id,
500
- class: z(["wi-web-agent-item", { "is-active": v.entry_id === ((R = e.currentAgent) == null ? void 0 : R.entry_id) }]),
501
- onClick: (E) => l(v)
430
+ default: x(() => [
431
+ t("div", Oe, [
432
+ n[6] || (n[6] = t("div", { class: "wi-web-agent-list__header" }, "切换智能体", -1)),
433
+ !e.agentList || e.agentList.length === 0 ? (l(), i("div", De, " 暂无可选智能体 ")) : y("", !0),
434
+ (l(!0), i(M, null, N(e.agentList, (b) => {
435
+ var R, k;
436
+ return l(), i("div", {
437
+ key: b.entry_id,
438
+ class: T(["wi-web-agent-item", { "is-active": b.entry_id === ((R = e.currentAgent) == null ? void 0 : R.entry_id) }]),
439
+ onClick: (z) => a(b)
502
440
  }, [
503
- t("div", _t, [
504
- v.image_id && o(v.image_id) ? (s(), n("img", {
441
+ t("div", Ne, [
442
+ b.image_id && d(b.image_id) ? (l(), i("img", {
505
443
  key: 0,
506
- src: o(v.image_id),
444
+ src: d(b.image_id),
507
445
  class: "wi-web-agent-item__avatar"
508
- }, null, 8, vt)) : (s(), n("div", wt, bt)),
509
- t("span", ft, A(v.entry_title || v.entry_id), 1)
446
+ }, null, 8, je)) : (l(), i("div", He, [...n[5] || (n[5] = [
447
+ t("svg", {
448
+ viewBox: "0 0 24 24",
449
+ fill: "none",
450
+ stroke: "currentColor",
451
+ "stroke-width": "2"
452
+ }, [
453
+ t("circle", {
454
+ cx: "12",
455
+ cy: "8",
456
+ r: "4"
457
+ }),
458
+ t("path", { d: "M4 20c0-4 4-6 8-6s8 2 8 6" })
459
+ ], -1)
460
+ ])])),
461
+ t("span", We, U(b.entry_title || b.entry_id), 1)
510
462
  ]),
511
- v.entry_id === ((y = e.currentAgent) == null ? void 0 : y.entry_id) ? (s(), n("span", gt, "✓")) : g("", !0)
512
- ], 10, ht);
463
+ b.entry_id === ((k = e.currentAgent) == null ? void 0 : k.entry_id) ? (l(), i("span", qe, "✓")) : y("", !0)
464
+ ], 10, Qe);
513
465
  }), 128))
514
466
  ])
515
467
  ]),
516
468
  _: 1
517
469
  }, 8, ["visible"])
518
- ])) : g("", !0),
519
- e.showIncPrevQuestion ? (s(), n("div", yt, [
520
- L(I(fe), {
470
+ ])) : y("", !0),
471
+ e.showIncPrevQuestion ? (l(), i("div", Ke, [
472
+ L(B(ve), {
521
473
  class: "wi-web-inputbox__ignore-prev",
522
474
  "model-value": e.incPrevQuestion === "N",
523
- "onUpdate:modelValue": U
475
+ "onUpdate:modelValue": C
524
476
  }, {
525
- default: $(() => [
526
- O(" 忽略之前对话 ")
527
- ]),
477
+ default: x(() => [...n[7] || (n[7] = [
478
+ P(" 忽略之前对话 ", -1)
479
+ ])]),
528
480
  _: 1
529
481
  }, 8, ["model-value"])
530
- ])) : g("", !0)
531
- ])) : g("", !0),
532
- t("div", kt, [
533
- d.value.length > 0 ? (s(), n("div", $t, [
534
- L(ne, {
535
- items: d.value,
482
+ ])) : y("", !0)
483
+ ])) : y("", !0),
484
+ t("div", Ye, [
485
+ r.value.length > 0 ? (l(), i("div", Xe, [
486
+ L(ee, {
487
+ items: r.value,
536
488
  "base-u-r-l": e.baseURL,
537
489
  "get-file-url": e.getFileUrl,
538
490
  removable: "",
539
- onRemove: M
491
+ onRemove: S
540
492
  }, null, 8, ["items", "base-u-r-l", "get-file-url"])
541
- ])) : g("", !0),
542
- L(I(ge), {
493
+ ])) : y("", !0),
494
+ L(B(we), {
543
495
  ref_key: "textareaRef",
544
- ref: m,
496
+ ref: g,
545
497
  "model-value": e.modelValue,
546
498
  type: "textarea",
547
499
  resize: "none",
@@ -550,81 +502,125 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
550
502
  placeholder: e.placeholder,
551
503
  disabled: e.disabled || e.talking,
552
504
  class: "wi-web-inputbox__textarea",
553
- "onUpdate:modelValue": w[1] || (w[1] = (v) => _("update:modelValue", v)),
554
- onKeydown: he(te(F, ["exact"]), ["enter"])
505
+ "onUpdate:modelValue": n[1] || (n[1] = (b) => m("update:modelValue", b)),
506
+ onKeydown: se(X(F, ["exact"]), ["enter"])
555
507
  }, null, 8, ["model-value", "maxlength", "autosize", "placeholder", "disabled", "onKeydown"]),
556
- t("div", Ct, [
557
- t("div", Ut, [
558
- S(e.$slots, "footer-left", {}, void 0, !0)
508
+ t("div", Ze, [
509
+ t("div", Ge, [
510
+ I(u.$slots, "footer-left", {}, void 0, !0)
559
511
  ]),
560
- t("div", At, [
561
- e.showWordLimit ? (s(), n("div", Bt, [
562
- O(A((e.modelValue || "").length), 1),
563
- e.maxlength ? (s(), n(P, { key: 0 }, [
564
- O("/" + A(e.maxlength), 1)
565
- ], 64)) : g("", !0)
566
- ])) : g("", !0),
567
- e.modelValue && !e.disabled && !e.talking ? (s(), V(I(ee), {
512
+ t("div", Je, [
513
+ e.showWordLimit ? (l(), i("div", et, [
514
+ P(U((e.modelValue || "").length), 1),
515
+ e.maxlength ? (l(), i(M, { key: 0 }, [
516
+ P("/" + U(e.maxlength), 1)
517
+ ], 64)) : y("", !0)
518
+ ])) : y("", !0),
519
+ e.modelValue && !e.disabled && !e.talking ? (l(), V(B(Y), {
568
520
  key: 1,
569
521
  content: "清除",
570
522
  placement: "top"
571
523
  }, {
572
- default: $(() => [
524
+ default: x(() => [
573
525
  t("button", {
574
526
  type: "button",
575
527
  class: "wi-web-inputbox__icon-btn",
576
528
  onClick: c
577
- }, Ft)
529
+ }, [...n[8] || (n[8] = [
530
+ t("svg", {
531
+ viewBox: "0 0 1024 1024",
532
+ width: "16",
533
+ height: "16",
534
+ fill: "currentColor"
535
+ }, [
536
+ t("path", { d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896z m0 85.333333a362.666667 362.666667 0 1 0 0 725.333334 362.666667 362.666667 0 0 0 0-725.333334z m120.746667 181.333334a42.666667 42.666667 0 0 1 54.826666 4.693333l5.546667 6.357334a42.666667 42.666667 0 0 1-4.693333 54.826666l-6.357334 5.546667-114.730666 114.773333 114.730666 114.730667a42.666667 42.666667 0 0 1 5.461334 54.826666l-5.461334 6.357334a42.666667 42.666667 0 0 1-54.826666 5.461333l-6.357334-5.461333-114.730666-114.730667-114.730667 114.730667a42.666667 42.666667 0 0 1-54.826667 5.461333l-6.357333-5.461333a42.666667 42.666667 0 0 1-5.461333-54.826667l5.461333-6.357333 114.730667-114.730667-114.730667-114.773333a42.666667 42.666667 0 0 1-5.461333-54.826667l5.461333-6.357333a42.666667 42.666667 0 0 1 54.826667-5.461334l6.357333 5.461334 114.730667 114.730666 114.730666-114.730666a42.666667 42.666667 0 0 1 24.32-11.434667z" })
537
+ ], -1)
538
+ ])])
578
539
  ]),
579
540
  _: 1
580
- })) : g("", !0),
581
- e.showUpload ? (s(), V(I(ee), {
541
+ })) : y("", !0),
542
+ e.showUpload ? (l(), V(B(Y), {
582
543
  key: 2,
583
544
  content: "上传附件",
584
545
  placement: "top"
585
546
  }, {
586
- default: $(() => [
547
+ default: x(() => [
587
548
  t("button", {
588
549
  type: "button",
589
550
  class: "wi-web-inputbox__icon-btn",
590
551
  disabled: e.disabled || e.talking,
591
552
  onClick: f
592
- }, Vt, 8, Rt)
553
+ }, [...n[9] || (n[9] = [
554
+ t("svg", {
555
+ viewBox: "0 0 24 24",
556
+ width: "18",
557
+ height: "18",
558
+ fill: "none",
559
+ stroke: "currentColor",
560
+ "stroke-width": "2"
561
+ }, [
562
+ t("path", { d: "M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48" })
563
+ ], -1)
564
+ ])], 8, tt)
593
565
  ]),
594
566
  _: 1
595
- })) : g("", !0),
567
+ })) : y("", !0),
596
568
  t("input", {
597
569
  ref_key: "fileInputRef",
598
- ref: b,
570
+ ref: p,
599
571
  type: "file",
600
572
  multiple: "",
601
573
  accept: e.accept,
602
574
  class: "wi-web-inputbox__hidden-file",
603
- onChange: B
604
- }, null, 40, Lt),
605
- Tt,
606
- e.talking ? (s(), V(I(ee), {
575
+ onChange: A
576
+ }, null, 40, lt),
577
+ n[12] || (n[12] = t("div", { class: "wi-web-inputbox__divider" }, null, -1)),
578
+ e.talking ? (l(), V(B(Y), {
607
579
  key: 3,
608
580
  content: "停止生成",
609
581
  placement: "top"
610
582
  }, {
611
- default: $(() => [
583
+ default: x(() => [
612
584
  t("div", {
613
585
  class: "wi-web-inputbox__action-btn wi-web-inputbox__action-btn--stop",
614
- onClick: w[2] || (w[2] = (v) => _("stop"))
615
- }, zt)
586
+ onClick: n[2] || (n[2] = (b) => m("stop"))
587
+ }, [...n[10] || (n[10] = [
588
+ t("svg", {
589
+ viewBox: "0 0 24 24",
590
+ width: "16",
591
+ height: "16",
592
+ fill: "currentColor"
593
+ }, [
594
+ t("rect", {
595
+ x: "6",
596
+ y: "6",
597
+ width: "12",
598
+ height: "12",
599
+ rx: "2"
600
+ })
601
+ ], -1)
602
+ ])])
616
603
  ]),
617
604
  _: 1
618
- })) : (s(), V(I(ee), {
605
+ })) : (l(), V(B(Y), {
619
606
  key: 4,
620
607
  content: "发送",
621
608
  placement: "top"
622
609
  }, {
623
- default: $(() => [
610
+ default: x(() => [
624
611
  t("div", {
625
- class: z(["wi-web-inputbox__action-btn wi-web-inputbox__action-btn--send", { "is-disabled": e.disabled || !e.talking && h.value }]),
626
- onClick: Y
627
- }, Et, 2)
612
+ class: T(["wi-web-inputbox__action-btn wi-web-inputbox__action-btn--send", { "is-disabled": e.disabled || !e.talking && w.value }]),
613
+ onClick: H
614
+ }, [...n[11] || (n[11] = [
615
+ t("svg", {
616
+ viewBox: "0 0 24 24",
617
+ width: "18",
618
+ height: "18",
619
+ fill: "currentColor"
620
+ }, [
621
+ t("path", { d: "M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" })
622
+ ], -1)
623
+ ])], 2)
628
624
  ]),
629
625
  _: 1
630
626
  }))
@@ -633,21 +629,21 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
633
629
  ])
634
630
  ]));
635
631
  }
636
- }), Ot = /* @__PURE__ */ Q(xt, [["__scopeId", "data-v-c6f1253a"]]), Dt = [
637
- { id: "recordset", answerType: "recordset", component: _e(() => Promise.resolve().then(() => ps)) }
638
- ], Qt = (p) => re([...Dt, ...p ?? []]), Nt = (p) => (q("data-v-c18f2f94"), p = p(), K(), p), jt = {
632
+ }), nt = /* @__PURE__ */ D(at, [["__scopeId", "data-v-c6f1253a"]]), it = [
633
+ { id: "recordset", answerType: "recordset", component: oe(() => Promise.resolve().then(() => Ut)) }
634
+ ], st = (e) => te([...it, ...e ?? []]), ot = {
639
635
  key: 0,
640
636
  class: "wi-web-chat-messages__loading"
641
- }, Ht = {
637
+ }, rt = {
642
638
  key: 1,
643
639
  class: "wi-web-chat-messages__empty"
644
- }, Wt = /* @__PURE__ */ Nt(() => /* @__PURE__ */ t("div", { class: "wi-web-chat-messages__empty-logo" }, "WI", -1)), qt = { class: "wi-web-chat-messages__empty-title" }, Kt = { class: "wi-web-chat-messages__empty-description" }, Yt = {
640
+ }, dt = { class: "wi-web-chat-messages__empty-title" }, ct = { class: "wi-web-chat-messages__empty-description" }, ut = {
645
641
  key: 0,
646
642
  class: "wi-web-chat-messages__user"
647
- }, Xt = { class: "wi-web-chat-messages__user-wrapper" }, Zt = { class: "wi-web-chat-messages__user-bubble" }, Gt = {
643
+ }, vt = { class: "wi-web-chat-messages__user-wrapper" }, wt = { class: "wi-web-chat-messages__user-bubble" }, mt = {
648
644
  key: 1,
649
645
  class: "wi-web-chat-messages__assistant"
650
- }, Jt = /* @__PURE__ */ D({
646
+ }, bt = /* @__PURE__ */ O({
651
647
  __name: "ChatMessagesView",
652
648
  props: {
653
649
  messages: {},
@@ -660,86 +656,86 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
660
656
  emptyDescription: { default: "回答内容由共享渲染层统一分发" }
661
657
  },
662
658
  emits: ["loadOlder", "updateThinkingExpanded"],
663
- setup(p, { expose: C, emit: i }) {
664
- const r = p, _ = i;
665
- de(
666
- r.outputFileConfig ?? {
667
- getFileUrl: (l) => {
668
- var U;
669
- return ((U = r.getFileUrl) == null ? void 0 : U.call(r, l)) ?? (r.baseURL ? `${r.baseURL.replace(/\/$/, "")}/algorithm/get_file_data?file_id=${encodeURIComponent(l)}` : "");
659
+ setup(e, { expose: $, emit: s }) {
660
+ const o = e, m = s;
661
+ le(
662
+ o.outputFileConfig ?? {
663
+ getFileUrl: (a) => {
664
+ var C;
665
+ return ((C = o.getFileUrl) == null ? void 0 : C.call(o, a)) ?? (o.baseURL ? `${o.baseURL.replace(/\/$/, "")}/algorithm/get_file_data?file_id=${encodeURIComponent(a)}` : "");
670
666
  }
671
667
  }
672
668
  );
673
- const m = x(), { showScrollToBottom: b, forceScrollToBottom: a, requestScrollToBottom: u, resetScrollState: d, onReachTop: h } = Be(m), o = k(() => Qt(r.parsers));
674
- return se(
675
- () => r.messages.length === 0,
676
- (l) => {
677
- l && d();
669
+ const g = E(), { showScrollToBottom: p, forceScrollToBottom: h, requestScrollToBottom: v, resetScrollState: r, onReachTop: w } = ye(g), d = _(() => st(o.parsers));
670
+ return Z(
671
+ () => o.messages.length === 0,
672
+ (a) => {
673
+ a && r();
678
674
  }
679
- ), se(
680
- () => r.messages[r.messages.length - 1],
675
+ ), Z(
676
+ () => o.messages[o.messages.length - 1],
681
677
  () => {
682
- u();
678
+ v();
683
679
  },
684
680
  { deep: !0 }
685
- ), h(() => _("loadOlder")), C({
681
+ ), w(() => m("loadOlder")), $({
686
682
  /** 强制滚动到底部 */
687
- forceScrollToBottom: a,
683
+ forceScrollToBottom: h,
688
684
  /** 自动滚动开启时请求滚动到底部 */
689
- requestScrollToBottom: u
690
- }), (l, U) => (s(), n("div", {
685
+ requestScrollToBottom: v
686
+ }), (a, C) => (l(), i("div", {
691
687
  ref_key: "scrollEl",
692
- ref: m,
688
+ ref: g,
693
689
  class: "wi-web-chat-messages"
694
690
  }, [
695
- l.loading ? (s(), n("div", jt, "历史加载中...")) : l.messages.length === 0 ? (s(), n("div", Ht, [
696
- Wt,
697
- t("div", qt, A(l.emptyTitle), 1),
698
- t("div", Kt, A(l.emptyDescription), 1)
699
- ])) : g("", !0),
700
- (s(!0), n(P, null, j(l.messages, (c) => (s(), n(P, {
691
+ e.loading ? (l(), i("div", ot, "历史加载中...")) : e.messages.length === 0 ? (l(), i("div", rt, [
692
+ C[1] || (C[1] = t("div", { class: "wi-web-chat-messages__empty-logo" }, "WI", -1)),
693
+ t("div", dt, U(e.emptyTitle), 1),
694
+ t("div", ct, U(e.emptyDescription), 1)
695
+ ])) : y("", !0),
696
+ (l(!0), i(M, null, N(e.messages, (c) => (l(), i(M, {
701
697
  key: c.id
702
698
  }, [
703
- c.role === "user" ? (s(), n("div", Yt, [
704
- t("div", Xt, [
705
- c.attachments && c.attachments.length > 0 ? (s(), V(ne, {
699
+ c.role === "user" ? (l(), i("div", ut, [
700
+ t("div", vt, [
701
+ c.attachments && c.attachments.length > 0 ? (l(), V(ee, {
706
702
  key: 0,
707
703
  class: "wi-web-chat-messages__attachments",
708
704
  items: c.attachments,
709
- "base-u-r-l": l.baseURL,
710
- "get-file-url": l.getFileUrl
711
- }, null, 8, ["items", "base-u-r-l", "get-file-url"])) : g("", !0),
712
- t("div", Zt, A(c.content), 1)
705
+ "base-u-r-l": e.baseURL,
706
+ "get-file-url": e.getFileUrl
707
+ }, null, 8, ["items", "base-u-r-l", "get-file-url"])) : y("", !0),
708
+ t("div", wt, U(c.content), 1)
713
709
  ])
714
- ])) : (s(), n("div", Gt, [
715
- L(I(ce), {
710
+ ])) : (l(), i("div", mt, [
711
+ L(B(ae), {
716
712
  steps: c.thinking.steps,
717
713
  expanded: c.thinking.expanded,
718
- "onUpdate:expanded": (f) => _("updateThinkingExpanded", c, f)
714
+ "onUpdate:expanded": (f) => m("updateThinkingExpanded", c, f)
719
715
  }, null, 8, ["steps", "expanded", "onUpdate:expanded"]),
720
- L(I(ue), {
716
+ L(B(ne), {
721
717
  answer: c.answer,
722
718
  error: c.error,
723
719
  stopped: c.stopped,
724
- "content-map": o.value
720
+ "content-map": d.value
725
721
  }, null, 8, ["answer", "error", "stopped", "content-map"])
726
722
  ]))
727
723
  ], 64))), 128)),
728
- L(ve, { name: "wi-web-chat-messages-fade" }, {
729
- default: $(() => [
730
- I(b) ? (s(), n("button", {
724
+ L(re, { name: "wi-web-chat-messages-fade" }, {
725
+ default: x(() => [
726
+ B(p) ? (l(), i("button", {
731
727
  key: 0,
732
728
  type: "button",
733
729
  class: "wi-web-chat-messages__bottom",
734
- onClick: U[0] || (U[0] = //@ts-ignore
735
- (...c) => I(a) && I(a)(...c))
736
- }, " 回到底部 ")) : g("", !0)
730
+ onClick: C[0] || (C[0] = //@ts-ignore
731
+ (...c) => B(h) && B(h)(...c))
732
+ }, " 回到底部 ")) : y("", !0)
737
733
  ]),
738
734
  _: 1
739
735
  })
740
736
  ], 512));
741
737
  }
742
- }), es = /* @__PURE__ */ Q(Jt, [["__scopeId", "data-v-c18f2f94"]]), ts = { class: "wi-web-chat-container" }, ss = { class: "wi-web-chat-container__footer" }, os = /* @__PURE__ */ D({
738
+ }), ht = /* @__PURE__ */ D(bt, [["__scopeId", "data-v-c18f2f94"]]), ft = { class: "wi-web-chat-container" }, gt = { class: "wi-web-chat-container__footer" }, pt = /* @__PURE__ */ O({
743
739
  __name: "ChatContainer",
744
740
  props: {
745
741
  messages: {},
@@ -761,153 +757,153 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
761
757
  disabled: { type: Boolean, default: !1 }
762
758
  },
763
759
  emits: ["update:question", "update:incPrevQuestion", "submit", "stop", "selectAgent", "loadOlder", "updateThinkingExpanded"],
764
- setup(p, { emit: C }) {
765
- const i = p, r = C, _ = (a) => {
766
- r("submit", a);
767
- }, m = () => {
768
- i.hasMore && r("loadOlder");
769
- }, b = (a) => {
770
- r("selectAgent", a);
760
+ setup(e, { emit: $ }) {
761
+ const s = e, o = $, m = (h) => {
762
+ o("submit", h);
763
+ }, g = () => {
764
+ s.hasMore && o("loadOlder");
765
+ }, p = (h) => {
766
+ o("selectAgent", h);
771
767
  };
772
- return (a, u) => (s(), n("section", ts, [
773
- S(a.$slots, "messages", {}, () => [
774
- L(es, {
775
- messages: a.messages,
776
- parsers: a.parsers,
777
- "base-u-r-l": a.baseURL,
778
- "get-file-url": a.getFileUrl,
779
- "output-file-config": a.outputFileConfig,
780
- loading: a.loading,
781
- "empty-title": a.emptyTitle,
782
- "empty-description": a.emptyDescription,
783
- onLoadOlder: m,
784
- onUpdateThinkingExpanded: u[0] || (u[0] = (d, h) => r("updateThinkingExpanded", d, h))
768
+ return (h, v) => (l(), i("section", ft, [
769
+ I(h.$slots, "messages", {}, () => [
770
+ L(ht, {
771
+ messages: e.messages,
772
+ parsers: e.parsers,
773
+ "base-u-r-l": e.baseURL,
774
+ "get-file-url": e.getFileUrl,
775
+ "output-file-config": e.outputFileConfig,
776
+ loading: e.loading,
777
+ "empty-title": e.emptyTitle,
778
+ "empty-description": e.emptyDescription,
779
+ onLoadOlder: g,
780
+ onUpdateThinkingExpanded: v[0] || (v[0] = (r, w) => o("updateThinkingExpanded", r, w))
785
781
  }, null, 8, ["messages", "parsers", "base-u-r-l", "get-file-url", "output-file-config", "loading", "empty-title", "empty-description"])
786
782
  ], !0),
787
- S(a.$slots, "above-input", {}, void 0, !0),
788
- t("footer", ss, [
789
- L(Ot, {
790
- "model-value": a.question,
791
- "onUpdate:modelValue": u[1] || (u[1] = (d) => r("update:question", d)),
792
- "inc-prev-question": a.incPrevQuestion,
793
- "onUpdate:incPrevQuestion": u[2] || (u[2] = (d) => r("update:incPrevQuestion", d)),
794
- "base-u-r-l": a.baseURL,
795
- disabled: a.disabled || !a.session,
796
- talking: a.talking,
797
- "agent-list": a.agentList,
798
- "current-agent": a.currentAgent,
799
- placeholder: a.placeholder,
800
- "get-file-url": a.getFileUrl,
801
- onSelectAgent: b,
802
- onSubmit: _,
803
- onStop: u[3] || (u[3] = (d) => r("stop"))
783
+ I(h.$slots, "above-input", {}, void 0, !0),
784
+ t("footer", gt, [
785
+ L(nt, {
786
+ "model-value": e.question,
787
+ "onUpdate:modelValue": v[1] || (v[1] = (r) => o("update:question", r)),
788
+ "inc-prev-question": e.incPrevQuestion,
789
+ "onUpdate:incPrevQuestion": v[2] || (v[2] = (r) => o("update:incPrevQuestion", r)),
790
+ "base-u-r-l": e.baseURL,
791
+ disabled: e.disabled || !e.session,
792
+ talking: e.talking,
793
+ "agent-list": e.agentList,
794
+ "current-agent": e.currentAgent,
795
+ placeholder: e.placeholder,
796
+ "get-file-url": e.getFileUrl,
797
+ onSelectAgent: p,
798
+ onSubmit: m,
799
+ onStop: v[3] || (v[3] = (r) => o("stop"))
804
800
  }, null, 8, ["model-value", "inc-prev-question", "base-u-r-l", "disabled", "talking", "agent-list", "current-agent", "placeholder", "get-file-url"])
805
801
  ])
806
802
  ]));
807
803
  }
808
- }), Ts = /* @__PURE__ */ Q(os, [["__scopeId", "data-v-8663b501"]]), ie = (p) => (q("data-v-96941d57"), p = p(), K(), p), as = {
804
+ }), Nt = /* @__PURE__ */ D(pt, [["__scopeId", "data-v-8663b501"]]), yt = {
809
805
  key: 0,
810
806
  class: "wi-web-recordset"
811
- }, ls = { class: "wi-web-recordset__header" }, ns = { class: "wi-web-recordset__title" }, is = /* @__PURE__ */ ie(() => /* @__PURE__ */ t("button", {
812
- type: "button",
813
- class: "wi-web-recordset__columns-btn",
814
- title: "选择展示列"
815
- }, [
816
- /* @__PURE__ */ t("svg", {
817
- class: "wi-web-recordset__columns-icon",
818
- viewBox: "0 0 24 24",
819
- fill: "none",
820
- stroke: "currentColor",
821
- "stroke-width": "2"
822
- }, [
823
- /* @__PURE__ */ t("rect", {
824
- x: "3",
825
- y: "4",
826
- width: "18",
827
- height: "16",
828
- rx: "2"
829
- }),
830
- /* @__PURE__ */ t("path", { d: "M9 4v16M15 4v16" })
831
- ]),
832
- /* @__PURE__ */ t("span", null, "列")
833
- ], -1)), rs = { class: "wi-web-recordset__columns-panel" }, ds = /* @__PURE__ */ ie(() => /* @__PURE__ */ t("div", { class: "wi-web-recordset__columns-panel-title" }, "选择展示列", -1)), cs = /* @__PURE__ */ D({
807
+ }, kt = { class: "wi-web-recordset__header" }, _t = { class: "wi-web-recordset__title" }, xt = { class: "wi-web-recordset__columns-panel" }, Ct = /* @__PURE__ */ O({
834
808
  __name: "RecordsetTable",
835
809
  props: {
836
810
  report: {},
837
811
  maxHeight: { default: 420 }
838
812
  },
839
- setup(p) {
840
- const C = p, i = k(() => {
813
+ setup(e) {
814
+ const $ = e, s = _(() => {
841
815
  var c;
842
- return ((c = C.report) == null ? void 0 : c.values) ?? {};
843
- }), r = k(() => i.value.chart === "table"), _ = k(() => i.value.title ?? ""), m = k(() => (Array.isArray(i.value.cols) ? i.value.cols : []).map((f, B) => ({
844
- key: `c${B}`,
845
- title: (f == null ? void 0 : f.title) || (f == null ? void 0 : f.name) || `列${B + 1}`
846
- }))), b = k(() => {
847
- const c = Number(i.value.max_cols);
816
+ return ((c = $.report) == null ? void 0 : c.values) ?? {};
817
+ }), o = _(() => s.value.chart === "table"), m = _(() => s.value.title ?? ""), g = _(() => (Array.isArray(s.value.cols) ? s.value.cols : []).map((f, A) => ({
818
+ key: `c${A}`,
819
+ title: (f == null ? void 0 : f.title) || (f == null ? void 0 : f.name) || `列${A + 1}`
820
+ }))), p = _(() => {
821
+ const c = Number(s.value.max_cols);
848
822
  return Number.isFinite(c) && c > 0 ? c : 1 / 0;
849
- }), a = k(() => m.value.length > b.value), u = x([]), d = k(() => new Set(u.value)), h = k(() => m.value.filter((c) => d.value.has(c.key)));
850
- se(
851
- () => m.value.map((c) => c.key).join("|"),
823
+ }), h = _(() => g.value.length > p.value), v = E([]), r = _(() => new Set(v.value)), w = _(() => g.value.filter((c) => r.value.has(c.key)));
824
+ Z(
825
+ () => g.value.map((c) => c.key).join("|"),
852
826
  () => {
853
- u.value = m.value.slice(0, b.value).map((c) => c.key);
827
+ v.value = g.value.slice(0, p.value).map((c) => c.key);
854
828
  },
855
829
  { immediate: !0 }
856
830
  );
857
- const o = k(() => (Array.isArray(i.value.values) ? i.value.values : []).map((f) => {
858
- const B = {};
859
- return m.value.forEach((M, N) => {
860
- B[M.key] = Array.isArray(f) ? f[N] : void 0;
861
- }), B;
862
- })), l = x(!1), U = (c, f) => {
863
- const B = new Set(u.value);
864
- f ? B.add(c) : B.delete(c), u.value = m.value.filter((M) => B.has(M.key)).map((M) => M.key);
831
+ const d = _(() => (Array.isArray(s.value.values) ? s.value.values : []).map((f) => {
832
+ const A = {};
833
+ return g.value.forEach((S, Q) => {
834
+ A[S.key] = Array.isArray(f) ? f[Q] : void 0;
835
+ }), A;
836
+ })), a = E(!1), C = (c, f) => {
837
+ const A = new Set(v.value);
838
+ f ? A.add(c) : A.delete(c), v.value = g.value.filter((S) => A.has(S.key)).map((S) => S.key);
865
839
  };
866
840
  return (c, f) => {
867
- const B = J("el-checkbox"), M = J("el-popover"), N = J("el-table-column"), Y = J("el-table");
868
- return r.value ? (s(), n("div", as, [
869
- t("div", ls, [
870
- t("div", ns, A(_.value), 1),
871
- a.value ? (s(), V(M, {
841
+ const A = K("el-checkbox"), S = K("el-popover"), Q = K("el-table-column"), H = K("el-table");
842
+ return o.value ? (l(), i("div", yt, [
843
+ t("div", kt, [
844
+ t("div", _t, U(m.value), 1),
845
+ h.value ? (l(), V(S, {
872
846
  key: 0,
873
- visible: l.value,
874
- "onUpdate:visible": f[0] || (f[0] = (F) => l.value = F),
847
+ visible: a.value,
848
+ "onUpdate:visible": f[0] || (f[0] = (F) => a.value = F),
875
849
  placement: "bottom-end",
876
850
  width: 220,
877
851
  trigger: "click",
878
852
  "popper-class": "wi-web-recordset-columns-popper"
879
853
  }, {
880
- reference: $(() => [
881
- is
882
- ]),
883
- default: $(() => [
884
- t("div", rs, [
885
- ds,
886
- (s(!0), n(P, null, j(m.value, (F) => (s(), V(B, {
854
+ reference: x(() => [...f[1] || (f[1] = [
855
+ t("button", {
856
+ type: "button",
857
+ class: "wi-web-recordset__columns-btn",
858
+ title: "选择展示列"
859
+ }, [
860
+ t("svg", {
861
+ class: "wi-web-recordset__columns-icon",
862
+ viewBox: "0 0 24 24",
863
+ fill: "none",
864
+ stroke: "currentColor",
865
+ "stroke-width": "2"
866
+ }, [
867
+ t("rect", {
868
+ x: "3",
869
+ y: "4",
870
+ width: "18",
871
+ height: "16",
872
+ rx: "2"
873
+ }),
874
+ t("path", { d: "M9 4v16M15 4v16" })
875
+ ]),
876
+ t("span", null, "列")
877
+ ], -1)
878
+ ])]),
879
+ default: x(() => [
880
+ t("div", xt, [
881
+ f[2] || (f[2] = t("div", { class: "wi-web-recordset__columns-panel-title" }, "选择展示列", -1)),
882
+ (l(!0), i(M, null, N(g.value, (F) => (l(), V(A, {
887
883
  key: F.key,
888
884
  class: "wi-web-recordset__column-item",
889
- "model-value": d.value.has(F.key),
890
- "onUpdate:modelValue": (e) => U(F.key, !!e)
885
+ "model-value": r.value.has(F.key),
886
+ "onUpdate:modelValue": (u) => C(F.key, !!u)
891
887
  }, {
892
- default: $(() => [
893
- O(A(F.title), 1)
888
+ default: x(() => [
889
+ P(U(F.title), 1)
894
890
  ]),
895
891
  _: 2
896
892
  }, 1032, ["model-value", "onUpdate:modelValue"]))), 128))
897
893
  ])
898
894
  ]),
899
895
  _: 1
900
- }, 8, ["visible"])) : g("", !0)
896
+ }, 8, ["visible"])) : y("", !0)
901
897
  ]),
902
- L(Y, {
903
- data: o.value,
898
+ L(H, {
899
+ data: d.value,
904
900
  border: "",
905
901
  size: "small",
906
902
  class: "wi-web-recordset__table",
907
- "max-height": c.maxHeight
903
+ "max-height": e.maxHeight
908
904
  }, {
909
- default: $(() => [
910
- (s(!0), n(P, null, j(h.value, (F) => (s(), V(N, {
905
+ default: x(() => [
906
+ (l(!0), i(M, null, N(w.value, (F) => (l(), V(Q, {
911
907
  key: F.key,
912
908
  prop: F.key,
913
909
  label: F.title,
@@ -917,13 +913,13 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
917
913
  ]),
918
914
  _: 1
919
915
  }, 8, ["data", "max-height"])
920
- ])) : g("", !0);
916
+ ])) : y("", !0);
921
917
  };
922
918
  }
923
- }), us = /* @__PURE__ */ Q(cs, [["__scopeId", "data-v-96941d57"]]), ps = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
919
+ }), $t = /* @__PURE__ */ D(Ct, [["__scopeId", "data-v-96941d57"]]), Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
924
920
  __proto__: null,
925
- default: us
926
- }, Symbol.toStringTag, { value: "Module" })), oe = (p) => (q("data-v-94659445"), p = p(), K(), p), hs = { class: "wi-web-env-switch__track" }, _s = { class: "wi-web-env-switch__items" }, vs = ["disabled", "onClick"], ws = { class: "wi-web-env-switch__icon" }, ms = {
921
+ default: $t
922
+ }, Symbol.toStringTag, { value: "Module" })), At = { class: "wi-web-env-switch__track" }, Bt = { class: "wi-web-env-switch__items" }, Ft = ["disabled", "onClick"], Rt = { class: "wi-web-env-switch__icon" }, It = {
927
923
  key: 0,
928
924
  viewBox: "0 0 24 24",
929
925
  fill: "none",
@@ -931,32 +927,20 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
931
927
  "stroke-width": "1.8",
932
928
  "stroke-linecap": "round",
933
929
  "stroke-linejoin": "round"
934
- }, bs = /* @__PURE__ */ oe(() => /* @__PURE__ */ t("path", { d: "M17.5 19a4.5 4.5 0 0 0 .6-8.96 6 6 0 0 0-11.63 1.4A3.8 3.8 0 0 0 7 19z" }, null, -1)), fs = [
935
- bs
936
- ], gs = {
930
+ }, Vt = {
937
931
  key: 1,
938
932
  viewBox: "0 0 24 24",
939
933
  fill: "none",
940
934
  stroke: "currentColor",
941
935
  "stroke-width": "1.8",
942
936
  "stroke-linecap": "round"
943
- }, ys = /* @__PURE__ */ oe(() => /* @__PURE__ */ t("rect", {
944
- x: "2.5",
945
- y: "4",
946
- width: "19",
947
- height: "12",
948
- rx: "2",
949
- "stroke-linejoin": "round"
950
- }, null, -1)), ks = /* @__PURE__ */ oe(() => /* @__PURE__ */ t("path", { d: "M8.5 20h7M12 16v4" }, null, -1)), $s = [
951
- ys,
952
- ks
953
- ], Cs = { class: "wi-web-env-switch__label" }, Us = {
937
+ }, Lt = { class: "wi-web-env-switch__label" }, St = {
954
938
  key: 0,
955
939
  class: "wi-web-env-switch__hint"
956
- }, As = { class: "wi-web-env-switch__hint-text" }, Bs = {
940
+ }, Tt = { class: "wi-web-env-switch__hint-text" }, Mt = {
957
941
  key: 0,
958
942
  class: "wi-web-env-switch__hint-status"
959
- }, Is = /* @__PURE__ */ D({
943
+ }, zt = /* @__PURE__ */ O({
960
944
  __name: "EnvSwitch",
961
945
  props: {
962
946
  modelValue: { default: "local" },
@@ -966,8 +950,8 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
966
950
  showHint: { type: Boolean, default: !0 }
967
951
  },
968
952
  emits: ["update:modelValue", "change"],
969
- setup(p, { emit: C }) {
970
- const i = p, r = C, _ = [
953
+ setup(e, { emit: $ }) {
954
+ const s = e, o = $, m = [
971
955
  {
972
956
  value: "local",
973
957
  label: "本地电脑",
@@ -982,79 +966,90 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
982
966
  status: "未连接",
983
967
  online: !1
984
968
  }
985
- ], m = { default: 3, small: 2 }, b = k(() => {
986
- const h = i.options ?? [];
987
- return h.length > 0 ? h : _;
988
- }), a = k(() => {
989
- if (!i.showHint)
990
- return null;
991
- const h = b.value;
992
- return h.find((o) => o.value === i.modelValue) ?? h[0] ?? null;
993
- }), u = k(() => {
994
- const h = b.value, o = h.length || 1, l = Math.max(h.findIndex((c) => c.value === i.modelValue), 0), U = m[i.size] ?? m.default;
969
+ ], g = { default: 3, small: 2 }, p = _(() => {
970
+ const w = s.options ?? [];
971
+ return w.length > 0 ? w : m;
972
+ }), h = _(() => {
973
+ if (!s.showHint) return null;
974
+ const w = p.value;
975
+ return w.find((d) => d.value === s.modelValue) ?? w[0] ?? null;
976
+ }), v = _(() => {
977
+ const w = p.value, d = w.length || 1, a = Math.max(w.findIndex((c) => c.value === s.modelValue), 0), C = g[s.size] ?? g.default;
995
978
  return {
996
- width: `calc(${100 / o}% - ${2 * U / o}px)`,
997
- transform: `translateX(${l * 100}%)`
979
+ width: `calc(${100 / d}% - ${2 * C / d}px)`,
980
+ transform: `translateX(${a * 100}%)`
998
981
  };
999
- }), d = (h) => {
1000
- i.disabled || h.disabled || h.value !== i.modelValue && (r("update:modelValue", h.value), r("change", h));
982
+ }), r = (w) => {
983
+ s.disabled || w.disabled || w.value !== s.modelValue && (o("update:modelValue", w.value), o("change", w));
1001
984
  };
1002
- return (h, o) => (s(), n("div", {
1003
- class: z(["wi-web-env-switch", [`is-${h.size}`, { "is-disabled": h.disabled }]])
985
+ return (w, d) => (l(), i("div", {
986
+ class: T(["wi-web-env-switch", [`is-${e.size}`, { "is-disabled": e.disabled }]])
1004
987
  }, [
1005
- t("div", hs, [
988
+ t("div", At, [
1006
989
  t("span", {
1007
990
  class: "wi-web-env-switch__thumb",
1008
- style: we(u.value)
991
+ style: de(v.value)
1009
992
  }, null, 4),
1010
- t("div", _s, [
1011
- (s(!0), n(P, null, j(b.value, (l) => (s(), n("button", {
1012
- key: l.value,
993
+ t("div", Bt, [
994
+ (l(!0), i(M, null, N(p.value, (a) => (l(), i("button", {
995
+ key: a.value,
1013
996
  type: "button",
1014
- class: z(["wi-web-env-switch__item", { "is-active": l.value === h.modelValue, "is-disabled": l.disabled }]),
1015
- disabled: h.disabled || l.disabled,
1016
- onClick: (U) => d(l)
997
+ class: T(["wi-web-env-switch__item", { "is-active": a.value === e.modelValue, "is-disabled": a.disabled }]),
998
+ disabled: e.disabled || a.disabled,
999
+ onClick: (C) => r(a)
1017
1000
  }, [
1018
- t("span", ws, [
1019
- l.value === "cloud" ? (s(), n("svg", ms, fs)) : (s(), n("svg", gs, $s))
1001
+ t("span", Rt, [
1002
+ a.value === "cloud" ? (l(), i("svg", It, [...d[0] || (d[0] = [
1003
+ t("path", { d: "M17.5 19a4.5 4.5 0 0 0 .6-8.96 6 6 0 0 0-11.63 1.4A3.8 3.8 0 0 0 7 19z" }, null, -1)
1004
+ ])])) : (l(), i("svg", Vt, [...d[1] || (d[1] = [
1005
+ t("rect", {
1006
+ x: "2.5",
1007
+ y: "4",
1008
+ width: "19",
1009
+ height: "12",
1010
+ rx: "2",
1011
+ "stroke-linejoin": "round"
1012
+ }, null, -1),
1013
+ t("path", { d: "M8.5 20h7M12 16v4" }, null, -1)
1014
+ ])]))
1020
1015
  ]),
1021
- t("span", Cs, A(l.label), 1)
1022
- ], 10, vs))), 128))
1016
+ t("span", Lt, U(a.label), 1)
1017
+ ], 10, Ft))), 128))
1023
1018
  ])
1024
1019
  ]),
1025
- a.value ? (s(), n("div", Us, [
1026
- t("span", As, A(a.value.description), 1),
1027
- a.value.status ? (s(), n("span", Bs, [
1020
+ h.value ? (l(), i("div", St, [
1021
+ t("span", Tt, U(h.value.description), 1),
1022
+ h.value.status ? (l(), i("span", Mt, [
1028
1023
  t("i", {
1029
- class: z(["wi-web-env-switch__dot", { "is-online": a.value.online }])
1024
+ class: T(["wi-web-env-switch__dot", { "is-online": h.value.online }])
1030
1025
  }, null, 2),
1031
- O(" " + A(a.value.status), 1)
1032
- ])) : g("", !0)
1033
- ])) : g("", !0)
1026
+ P(" " + U(h.value.status), 1)
1027
+ ])) : y("", !0)
1028
+ ])) : y("", !0)
1034
1029
  ], 2));
1035
1030
  }
1036
- }), Ms = /* @__PURE__ */ Q(Is, [["__scopeId", "data-v-94659445"]]);
1031
+ }), jt = /* @__PURE__ */ D(zt, [["__scopeId", "data-v-94659445"]]);
1037
1032
  export {
1038
- Es as AiAnswerBubble,
1039
- Ye as AttachmentCard,
1040
- ne as AttachmentList,
1041
- Ts as ChatContainer,
1042
- es as ChatMessagesView,
1043
- xs as ClarificationCard,
1044
- Os as DeepThinkingSteps,
1045
- Ms as EnvSwitch,
1046
- Ds as HostActionStatus,
1047
- Qs as IframePage,
1048
- Ot as Inputbox,
1049
- Ns as KnowledgeStreamResult,
1050
- js as OutputFile,
1051
- us as RecordsetTable,
1052
- Hs as createAnswerContentMap,
1053
- Qt as createWebAnswerContentMap,
1054
- Ws as injectIframeResizerChild,
1055
- qs as provideIframePageConfig,
1056
- Ks as provideOutputFileConfig,
1057
- Ys as resolveIframePlaceholders,
1058
- Xs as useIframePage
1033
+ qt as AiAnswerBubble,
1034
+ Re as AttachmentCard,
1035
+ ee as AttachmentList,
1036
+ Nt as ChatContainer,
1037
+ ht as ChatMessagesView,
1038
+ Kt as ClarificationCard,
1039
+ Yt as DeepThinkingSteps,
1040
+ jt as EnvSwitch,
1041
+ Xt as HostActionStatus,
1042
+ Zt as IframePage,
1043
+ nt as Inputbox,
1044
+ Gt as KnowledgeStreamResult,
1045
+ Jt as OutputFile,
1046
+ $t as RecordsetTable,
1047
+ el as createAnswerContentMap,
1048
+ st as createWebAnswerContentMap,
1049
+ tl as injectIframeResizerChild,
1050
+ ll as provideIframePageConfig,
1051
+ al as provideOutputFileConfig,
1052
+ nl as resolveIframePlaceholders,
1053
+ il as useIframePage
1059
1054
  };
1060
1055
  //# sourceMappingURL=index.js.map