wi-chat 0.0.0-stage → 0.3.0

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