@blueking/ai-blueking 0.3.5 → 0.3.7
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.
- package/dist/ai-blueking.vue.d.ts +2 -0
- package/dist/components/render-content.vue.d.ts +2 -0
- package/dist/components/render-send.vue.d.ts +2 -0
- package/dist/vue2/index.es.min.js +2218 -2209
- package/dist/vue2/index.iife.min.js +37 -37
- package/dist/vue2/index.umd.min.js +23 -23
- package/dist/vue2/style.css +1 -1
- package/dist/vue3/index.es.min.js +190 -184
- package/dist/vue3/index.iife.min.js +36 -36
- package/dist/vue3/index.umd.min.js +4 -4
- package/dist/vue3/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var ze = Object.defineProperty;
|
|
2
2
|
var Ce = (o, n, t) => n in o ? ze(o, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[n] = t;
|
|
3
|
-
var
|
|
3
|
+
var j = (o, n, t) => (Ce(o, typeof n != "symbol" ? n + "" : n, t), t);
|
|
4
4
|
import { Popover as Be, Input as he, Exception as He, clickoutside as Te, bkTooltips as ue, Tag as Pe, Alert as Re, Button as Ve, Message as me, Select as ge, provideGlobalConfig as De } from "bkui-vue";
|
|
5
|
-
import { ref as x, onMounted as ne, onBeforeUnmount as le, defineComponent as Y, withDirectives as
|
|
5
|
+
import { ref as x, onMounted as ne, onBeforeUnmount as le, defineComponent as Y, withDirectives as E, openBlock as m, createElementBlock as g, createElementVNode as d, toDisplayString as P, unref as c, createCommentVNode as M, vShow as fe, createTextVNode as ee, pushScopeId as ae, popScopeId as ie, computed as X, normalizeStyle as W, normalizeClass as $, createVNode as T, Fragment as K, watch as be, createBlock as q, withCtx as G, renderList as re, nextTick as ye, withModifiers as D, onBeforeMount as xe, renderSlot as Ye } from "vue";
|
|
6
6
|
import se from "dayjs";
|
|
7
7
|
import ve from "highlight.js";
|
|
8
8
|
import Ie from "markdown-it";
|
|
@@ -33,17 +33,17 @@ function pe() {
|
|
|
33
33
|
let t;
|
|
34
34
|
const s = () => {
|
|
35
35
|
clearTimeout(t), t = setTimeout(() => {
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
36
|
+
const r = window.getSelection();
|
|
37
|
+
if (r && r.toString().trim().length > 0) {
|
|
38
38
|
de.value = !1;
|
|
39
|
-
const k =
|
|
40
|
-
_.value =
|
|
39
|
+
const k = r.getRangeAt(0).getBoundingClientRect(), C = window.innerWidth;
|
|
40
|
+
_.value = r.toString().trim();
|
|
41
41
|
const w = 80, B = 34, z = 10;
|
|
42
42
|
let H = k.left + window.scrollX + k.width / 2 - w / 2;
|
|
43
43
|
H = Math.max(z, Math.min(H, C - w - z));
|
|
44
|
-
let
|
|
45
|
-
k.top > B + z || (
|
|
46
|
-
top: `${
|
|
44
|
+
let R = k.top + window.scrollY - B - z;
|
|
45
|
+
k.top > B + z || (R = k.bottom + window.scrollY + z), n.value = {
|
|
46
|
+
top: `${R}px`,
|
|
47
47
|
left: `${H}px`
|
|
48
48
|
}, o.value = !0;
|
|
49
49
|
} else
|
|
@@ -52,10 +52,10 @@ function pe() {
|
|
|
52
52
|
}, i = () => {
|
|
53
53
|
o.value = !1, de.value || (_.value = "");
|
|
54
54
|
}, l = () => {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
}, e = (
|
|
58
|
-
_.value =
|
|
55
|
+
const r = window.getSelection();
|
|
56
|
+
r && r.removeAllRanges(), _.value = "";
|
|
57
|
+
}, e = (r) => {
|
|
58
|
+
_.value = r;
|
|
59
59
|
};
|
|
60
60
|
return ne(() => {
|
|
61
61
|
document.addEventListener("selectionchange", s);
|
|
@@ -138,7 +138,7 @@ const Xe = [
|
|
|
138
138
|
},
|
|
139
139
|
emits: ["close"],
|
|
140
140
|
setup(o) {
|
|
141
|
-
return (n, t) =>
|
|
141
|
+
return (n, t) => E((m(), g(
|
|
142
142
|
"section",
|
|
143
143
|
We,
|
|
144
144
|
[
|
|
@@ -152,7 +152,7 @@ const Xe = [
|
|
|
152
152
|
d(
|
|
153
153
|
"span",
|
|
154
154
|
Je,
|
|
155
|
-
P(
|
|
155
|
+
P(c(b)("您选择的文本内容")),
|
|
156
156
|
1
|
|
157
157
|
/* TEXT */
|
|
158
158
|
),
|
|
@@ -183,15 +183,15 @@ const Xe = [
|
|
|
183
183
|
__name: "render-back",
|
|
184
184
|
setup(o) {
|
|
185
185
|
const { isShow: n, scrollToBottom: t } = ke();
|
|
186
|
-
return (s, i) =>
|
|
186
|
+
return (s, i) => c(n) ? (m(), g("span", {
|
|
187
187
|
key: 0,
|
|
188
188
|
class: "ai-blueking-render-back",
|
|
189
189
|
onClick: i[0] || (i[0] = //@ts-ignore
|
|
190
|
-
(...l) =>
|
|
190
|
+
(...l) => c(t) && c(t)(...l))
|
|
191
191
|
}, [
|
|
192
192
|
Ne,
|
|
193
193
|
ee(
|
|
194
|
-
" " + P(
|
|
194
|
+
" " + P(c(b)("返回最新")),
|
|
195
195
|
1
|
|
196
196
|
/* TEXT */
|
|
197
197
|
)
|
|
@@ -205,28 +205,28 @@ const et = /* @__PURE__ */ Y({
|
|
|
205
205
|
size: { default: 36 }
|
|
206
206
|
},
|
|
207
207
|
setup(o) {
|
|
208
|
-
const n = o, t =
|
|
208
|
+
const n = o, t = X(() => ({
|
|
209
209
|
minWidth: `${n.size}px`,
|
|
210
210
|
maxWidth: `${n.size}px`,
|
|
211
211
|
minHeight: `${n.size}px`,
|
|
212
212
|
maxHeight: `${n.size}px`,
|
|
213
213
|
padding: `${n.size * 0.208}px ${n.size * 0.222}px ${n.size * 0.194}px ${n.size * 0.18}px`
|
|
214
214
|
// 保持原比例
|
|
215
|
-
})), s =
|
|
215
|
+
})), s = X(() => ({
|
|
216
216
|
fontSize: `${n.size * 0.611}px`
|
|
217
217
|
// 保持原比例 22/36
|
|
218
218
|
}));
|
|
219
219
|
return (i, l) => (m(), g(
|
|
220
220
|
"span",
|
|
221
221
|
{
|
|
222
|
-
style:
|
|
222
|
+
style: W(t.value),
|
|
223
223
|
class: "message-photo ai"
|
|
224
224
|
},
|
|
225
225
|
[
|
|
226
226
|
d(
|
|
227
227
|
"i",
|
|
228
228
|
{
|
|
229
|
-
style:
|
|
229
|
+
style: W(s.value),
|
|
230
230
|
class: "ai-blueking-icon ai-blueking-ai"
|
|
231
231
|
},
|
|
232
232
|
null,
|
|
@@ -244,7 +244,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
244
244
|
}, st = { class: "message-content-container" }, nt = { class: "message-content user" }, lt = {
|
|
245
245
|
key: 0,
|
|
246
246
|
class: "time-message user"
|
|
247
|
-
}, at = ["innerHTML"], it = { class: "message-photo user" },
|
|
247
|
+
}, at = ["innerHTML"], it = { class: "message-photo user" }, rt = ["src"], ct = { class: "message-content ai" }, dt = {
|
|
248
248
|
key: 0,
|
|
249
249
|
class: "time-message ai"
|
|
250
250
|
}, ut = {
|
|
@@ -273,10 +273,10 @@ const et = /* @__PURE__ */ Y({
|
|
|
273
273
|
setup(o) {
|
|
274
274
|
const n = new Ie({
|
|
275
275
|
html: !0,
|
|
276
|
-
highlight: function(e,
|
|
277
|
-
if (
|
|
276
|
+
highlight: function(e, r) {
|
|
277
|
+
if (r && ve.getLanguage(r))
|
|
278
278
|
try {
|
|
279
|
-
return ve.highlight(e, { language:
|
|
279
|
+
return ve.highlight(e, { language: r }).value;
|
|
280
280
|
} catch {
|
|
281
281
|
}
|
|
282
282
|
return "";
|
|
@@ -284,19 +284,19 @@ const et = /* @__PURE__ */ Y({
|
|
|
284
284
|
}).use(Ae, {
|
|
285
285
|
iconClass: "ai-blueking-icon ai-blueking-copy",
|
|
286
286
|
buttonClass: "ai-blueking-copy-button"
|
|
287
|
-
}), t = o, s =
|
|
288
|
-
var
|
|
287
|
+
}), t = o, s = X(() => {
|
|
288
|
+
var r;
|
|
289
289
|
const e = {
|
|
290
290
|
error: "ai-blueking-icon ai-blueking-warning-circle-fill",
|
|
291
291
|
loading: "",
|
|
292
292
|
success: ""
|
|
293
293
|
};
|
|
294
|
-
return (
|
|
295
|
-
}), i =
|
|
296
|
-
const e = se(t.message.time),
|
|
297
|
-
return t.message.time ?
|
|
294
|
+
return (r = t.message) != null && r.status ? e[t.message.status] : "";
|
|
295
|
+
}), i = X(() => t.message.content ? n.render(t.message.content) : ""), l = X(() => {
|
|
296
|
+
const e = se(t.message.time), r = se();
|
|
297
|
+
return t.message.time ? r.isSame(e, "year") ? e.format("MM-DD HH:mm:ss") : e.format("YYYY-MM-DD HH:mm:ss") : "";
|
|
298
298
|
});
|
|
299
|
-
return (e,
|
|
299
|
+
return (e, r) => (m(), g(
|
|
300
300
|
"li",
|
|
301
301
|
{
|
|
302
302
|
class: $([e.message.role, "message-main"])
|
|
@@ -308,8 +308,8 @@ const et = /* @__PURE__ */ Y({
|
|
|
308
308
|
}, null, 8, ["text"])
|
|
309
309
|
])) : M("v-if", !0),
|
|
310
310
|
d("div", st, [
|
|
311
|
-
e.message.role ===
|
|
312
|
-
|
|
311
|
+
e.message.role === c(Le).User ? (m(), g(
|
|
312
|
+
K,
|
|
313
313
|
{ key: 0 },
|
|
314
314
|
[
|
|
315
315
|
d("p", nt, [
|
|
@@ -326,17 +326,17 @@ const et = /* @__PURE__ */ Y({
|
|
|
326
326
|
}, null, 8, at)
|
|
327
327
|
]),
|
|
328
328
|
d("span", it, [
|
|
329
|
-
d("img", { src: e.userPhoto }, null, 8,
|
|
329
|
+
d("img", { src: e.userPhoto }, null, 8, rt)
|
|
330
330
|
])
|
|
331
331
|
],
|
|
332
332
|
64
|
|
333
333
|
/* STABLE_FRAGMENT */
|
|
334
334
|
)) : (m(), g(
|
|
335
|
-
|
|
335
|
+
K,
|
|
336
336
|
{ key: 1 },
|
|
337
337
|
[
|
|
338
338
|
T(tt),
|
|
339
|
-
d("p",
|
|
339
|
+
d("p", ct, [
|
|
340
340
|
l.value ? (m(), g(
|
|
341
341
|
"span",
|
|
342
342
|
dt,
|
|
@@ -354,8 +354,8 @@ const et = /* @__PURE__ */ Y({
|
|
|
354
354
|
2
|
|
355
355
|
/* CLASS */
|
|
356
356
|
)) : M("v-if", !0),
|
|
357
|
-
e.message.status ===
|
|
358
|
-
e.message.status ===
|
|
357
|
+
e.message.status === c(oe).Loading ? (m(), g("svg", ut, ht)) : M("v-if", !0),
|
|
358
|
+
e.message.status === c(oe).Error ? (m(), g(
|
|
359
359
|
"span",
|
|
360
360
|
mt,
|
|
361
361
|
P(e.message.content),
|
|
@@ -366,7 +366,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
366
366
|
innerHTML: i.value,
|
|
367
367
|
class: $({
|
|
368
368
|
"markdown-message": !0,
|
|
369
|
-
loading: e.message.status ===
|
|
369
|
+
loading: e.message.status === c(oe).Loading
|
|
370
370
|
})
|
|
371
371
|
}, null, 10, gt))
|
|
372
372
|
])
|
|
@@ -387,48 +387,48 @@ const et = /* @__PURE__ */ Y({
|
|
|
387
387
|
placeholder: {},
|
|
388
388
|
value: {}
|
|
389
389
|
},
|
|
390
|
-
emits: ["update:value", "enter", "choose-prompt"],
|
|
390
|
+
emits: ["change-prompt", "update:value", "enter", "choose-prompt"],
|
|
391
391
|
setup(o, { emit: n }) {
|
|
392
|
-
const t = o, s = n, i = Te, l = ue, { selectedText: e, lockSelectedText:
|
|
392
|
+
const t = o, s = n, i = Te, l = ue, { selectedText: e, lockSelectedText: r } = pe(), h = x(""), k = x(40), C = x(), w = x(!1), B = X(() => {
|
|
393
393
|
var v;
|
|
394
394
|
return ((v = t.prompts) == null ? void 0 : v.filter((L) => L.content.includes(h.value))) || [];
|
|
395
|
-
}), z =
|
|
395
|
+
}), z = X(() => {
|
|
396
396
|
var v;
|
|
397
397
|
return t.placeholder ? t.placeholder : (v = t.prompts) != null && v.length ? b("您可以键入 “/” 查看更多Prompt") : b("请输入");
|
|
398
398
|
}), H = (v) => {
|
|
399
|
-
s("update:value", v);
|
|
400
|
-
}, u = () => {
|
|
401
|
-
var v;
|
|
402
|
-
t.value === "/" && ((v = t.prompts) != null && v.length) ? y() : j();
|
|
399
|
+
s("update:value", v), s("change-prompt", v);
|
|
403
400
|
}, R = () => {
|
|
401
|
+
var v;
|
|
402
|
+
t.value === "/" && ((v = t.prompts) != null && v.length) ? f() : y();
|
|
403
|
+
}, u = () => {
|
|
404
404
|
ye(() => {
|
|
405
405
|
var L;
|
|
406
406
|
const v = (L = C.value) == null ? void 0 : L.$el.querySelector("textarea");
|
|
407
407
|
(v == null ? void 0 : v.scrollHeight) > 40 && t.value ? k.value = v.scrollHeight <= 300 ? v.scrollHeight : 300 : k.value = 40;
|
|
408
408
|
});
|
|
409
|
-
},
|
|
410
|
-
s("update:value", v.content), s("choose-prompt", v),
|
|
409
|
+
}, A = (v) => {
|
|
410
|
+
s("update:value", v.content), s("choose-prompt", v), y(), U();
|
|
411
411
|
}, J = (v, L) => {
|
|
412
412
|
L.key === "Enter" && !L.shiftKey && (L.preventDefault(), s("enter"));
|
|
413
413
|
}, Z = () => {
|
|
414
414
|
H("");
|
|
415
|
-
},
|
|
415
|
+
}, U = () => {
|
|
416
416
|
var L;
|
|
417
417
|
const v = (L = C.value) == null ? void 0 : L.$el.querySelector("textarea");
|
|
418
418
|
v == null || v.focus();
|
|
419
|
+
}, p = () => {
|
|
420
|
+
e.value && (r.value = !0);
|
|
419
421
|
}, f = () => {
|
|
420
|
-
e.value && (c.value = !0);
|
|
421
|
-
}, y = () => {
|
|
422
422
|
w.value = !0;
|
|
423
|
-
},
|
|
423
|
+
}, y = () => {
|
|
424
424
|
w.value = !1;
|
|
425
425
|
};
|
|
426
426
|
return be(
|
|
427
427
|
() => t.value,
|
|
428
428
|
() => {
|
|
429
|
-
|
|
429
|
+
u(), R();
|
|
430
430
|
}
|
|
431
|
-
), ne(
|
|
431
|
+
), ne(U), (v, L) => (m(), q(c(Be), {
|
|
432
432
|
width: "calc(100% - 118px)",
|
|
433
433
|
"ext-cls": "empty-padding",
|
|
434
434
|
arrow: !1,
|
|
@@ -439,37 +439,37 @@ const et = /* @__PURE__ */ Y({
|
|
|
439
439
|
theme: "light",
|
|
440
440
|
trigger: "manual"
|
|
441
441
|
}, {
|
|
442
|
-
content:
|
|
442
|
+
content: G(() => {
|
|
443
443
|
var te;
|
|
444
444
|
return [
|
|
445
445
|
d("div", null, [
|
|
446
|
-
|
|
447
|
-
T(
|
|
446
|
+
E((m(), g("section", ft, [
|
|
447
|
+
T(c(he), {
|
|
448
448
|
class: "input-search",
|
|
449
449
|
modelValue: h.value,
|
|
450
|
-
"onUpdate:modelValue": L[0] || (L[0] = (
|
|
450
|
+
"onUpdate:modelValue": L[0] || (L[0] = (Q) => h.value = Q),
|
|
451
451
|
behavior: "simplicity",
|
|
452
452
|
clearable: ""
|
|
453
453
|
}, null, 8, ["modelValue"]),
|
|
454
454
|
d("section", bt, [
|
|
455
455
|
(m(!0), g(
|
|
456
|
-
|
|
456
|
+
K,
|
|
457
457
|
null,
|
|
458
|
-
|
|
458
|
+
re(B.value, (Q, ce) => E((m(), g("span", {
|
|
459
459
|
class: "group-prompt",
|
|
460
|
-
key:
|
|
461
|
-
onClick: (a) =>
|
|
460
|
+
key: ce,
|
|
461
|
+
onClick: (a) => A(Q)
|
|
462
462
|
}, [
|
|
463
463
|
d(
|
|
464
464
|
"span",
|
|
465
465
|
kt,
|
|
466
|
-
P(
|
|
466
|
+
P(Q.content),
|
|
467
467
|
1
|
|
468
468
|
/* TEXT */
|
|
469
469
|
)
|
|
470
470
|
], 8, yt)), [
|
|
471
|
-
[
|
|
472
|
-
content:
|
|
471
|
+
[c(l), {
|
|
472
|
+
content: Q.content,
|
|
473
473
|
placement: "right",
|
|
474
474
|
theme: "light",
|
|
475
475
|
width: 300,
|
|
@@ -479,7 +479,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
479
479
|
128
|
|
480
480
|
/* KEYED_FRAGMENT */
|
|
481
481
|
)),
|
|
482
|
-
(te = B.value) != null && te.length ? M("v-if", !0) : (m(),
|
|
482
|
+
(te = B.value) != null && te.length ? M("v-if", !0) : (m(), q(c(He), {
|
|
483
483
|
key: 0,
|
|
484
484
|
class: "exception-wrap-item exception-part",
|
|
485
485
|
scene: "part",
|
|
@@ -487,22 +487,22 @@ const et = /* @__PURE__ */ Y({
|
|
|
487
487
|
}))
|
|
488
488
|
])
|
|
489
489
|
])), [
|
|
490
|
-
[
|
|
490
|
+
[c(i), y]
|
|
491
491
|
])
|
|
492
492
|
])
|
|
493
493
|
];
|
|
494
494
|
}),
|
|
495
|
-
default:
|
|
495
|
+
default: G(() => [
|
|
496
496
|
d(
|
|
497
497
|
"section",
|
|
498
498
|
{
|
|
499
|
-
style:
|
|
499
|
+
style: W({
|
|
500
500
|
"--text-height": k.value + "px"
|
|
501
501
|
}),
|
|
502
502
|
class: "send-prompt-container"
|
|
503
503
|
},
|
|
504
504
|
[
|
|
505
|
-
T(
|
|
505
|
+
T(c(he), {
|
|
506
506
|
ref_key: "inputRef",
|
|
507
507
|
ref: C,
|
|
508
508
|
class: "send-prompt",
|
|
@@ -513,11 +513,11 @@ const et = /* @__PURE__ */ Y({
|
|
|
513
513
|
placeholder: z.value,
|
|
514
514
|
row: "1",
|
|
515
515
|
type: "textarea",
|
|
516
|
-
onFocus:
|
|
516
|
+
onFocus: p,
|
|
517
517
|
onInput: H,
|
|
518
518
|
onKeydown: J
|
|
519
519
|
}, null, 8, ["model-value", "placeholder"]),
|
|
520
|
-
v.value ? (m(),
|
|
520
|
+
v.value ? (m(), q(c(Ee), {
|
|
521
521
|
key: 0,
|
|
522
522
|
class: "show-clear-only-hover bk-input--clear-icon clear-icon",
|
|
523
523
|
onClick: Z
|
|
@@ -531,7 +531,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
531
531
|
/* STABLE */
|
|
532
532
|
}, 8, ["is-show"]));
|
|
533
533
|
}
|
|
534
|
-
}), Lt = /* @__PURE__ */ I(wt, [["__scopeId", "data-v-
|
|
534
|
+
}), Lt = /* @__PURE__ */ I(wt, [["__scopeId", "data-v-f75335eb"]]), St = { class: "ai-shortcuts" }, Mt = /* @__PURE__ */ Y({
|
|
535
535
|
__name: "render-shortcuts",
|
|
536
536
|
props: {
|
|
537
537
|
shortcuts: {}
|
|
@@ -543,15 +543,15 @@ const et = /* @__PURE__ */ Y({
|
|
|
543
543
|
};
|
|
544
544
|
return (i, l) => (m(), g("ul", St, [
|
|
545
545
|
(m(!0), g(
|
|
546
|
-
|
|
546
|
+
K,
|
|
547
547
|
null,
|
|
548
|
-
|
|
548
|
+
re(i.shortcuts, (e) => (m(), q(c(Pe), {
|
|
549
549
|
class: "ai-blueking-shortcut",
|
|
550
550
|
key: e.label,
|
|
551
551
|
theme: "info",
|
|
552
|
-
onClick: (
|
|
552
|
+
onClick: (r) => s(e)
|
|
553
553
|
}, {
|
|
554
|
-
default:
|
|
554
|
+
default: G(() => [
|
|
555
555
|
ee(
|
|
556
556
|
P(e.label),
|
|
557
557
|
1
|
|
@@ -596,7 +596,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
596
596
|
}, [
|
|
597
597
|
Bt,
|
|
598
598
|
ee(
|
|
599
|
-
" " + P(
|
|
599
|
+
" " + P(c(b)("终止生成")),
|
|
600
600
|
1
|
|
601
601
|
/* TEXT */
|
|
602
602
|
)
|
|
@@ -611,7 +611,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
611
611
|
message: {}
|
|
612
612
|
},
|
|
613
613
|
setup(o) {
|
|
614
|
-
const n = o, t =
|
|
614
|
+
const n = o, t = X(() => {
|
|
615
615
|
var e;
|
|
616
616
|
const s = se(n.message.time), i = se(), l = {
|
|
617
617
|
0: b("日"),
|
|
@@ -623,7 +623,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
623
623
|
6: b("六")
|
|
624
624
|
};
|
|
625
625
|
return !n.message.time || (e = window.showTimes) != null && e.some(
|
|
626
|
-
(
|
|
626
|
+
(r) => Math.abs(s.diff(r, "minute")) < 10 && r !== n.message.time
|
|
627
627
|
) ? "" : (window.showTimes = [...window.showTimes || [], n.message.time], i.isSame(s, "day") ? s.format("HH:mm:ss") : i.subtract(1, "day").isSame(s, "week") ? b("昨天") + " " + s.format("HH:mm:ss") : i.isSame(s, "week") ? b("本周") + l[s.day()] + " " + s.format("HH:mm:ss") : i.subtract(1, "week").isSame(s, "week") ? b("上周") + l[s.day()] + " " + s.format("HH:mm:ss") : i.isSame(s, "year") ? s.format("MM-DD HH:mm:ss") : s.format("YYYY-MM-DD HH:mm:ss"));
|
|
628
628
|
});
|
|
629
629
|
return (s, i) => t.value ? (m(), g("section", Pt, [
|
|
@@ -636,7 +636,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
636
636
|
)
|
|
637
637
|
])) : M("v-if", !0);
|
|
638
638
|
}
|
|
639
|
-
}), Dt = /* @__PURE__ */ I(Vt, [["__scopeId", "data-v-55c9a119"]]), Se = (o) => (ae("data-v-
|
|
639
|
+
}), Dt = /* @__PURE__ */ I(Vt, [["__scopeId", "data-v-55c9a119"]]), Se = (o) => (ae("data-v-de79ff73"), o = o(), ie(), o), xt = {
|
|
640
640
|
key: 0,
|
|
641
641
|
width: "18",
|
|
642
642
|
height: "18",
|
|
@@ -670,9 +670,9 @@ const et = /* @__PURE__ */ Y({
|
|
|
670
670
|
alert: {},
|
|
671
671
|
shortcuts: { default: () => Xe }
|
|
672
672
|
},
|
|
673
|
-
emits: ["ai-click", "send", "choose-prompt", "scroll-load", "stop"],
|
|
673
|
+
emits: ["ai-click", "change-prompt", "send", "choose-prompt", "scroll-load", "stop"],
|
|
674
674
|
setup(o, { expose: n, emit: t }) {
|
|
675
|
-
const s = o, i = t, l = ue, e = x(""), { selectedText:
|
|
675
|
+
const s = o, i = t, l = ue, e = x(""), { selectedText: r, clearSelection: h } = pe(), { isShow: k } = ke(), C = () => {
|
|
676
676
|
ye(() => {
|
|
677
677
|
const p = document.querySelector(".ai-blueking-messages");
|
|
678
678
|
p.scrollTop = p.scrollHeight;
|
|
@@ -689,12 +689,14 @@ const et = /* @__PURE__ */ Y({
|
|
|
689
689
|
}
|
|
690
690
|
i("send", {
|
|
691
691
|
content: e.value,
|
|
692
|
-
cite:
|
|
693
|
-
}), e.value = "",
|
|
692
|
+
cite: r.value
|
|
693
|
+
}), e.value = "", r.value = "";
|
|
694
694
|
}
|
|
695
695
|
}, z = (p) => {
|
|
696
696
|
i("choose-prompt", p);
|
|
697
|
-
}, H = () => {
|
|
697
|
+
}, H = (p) => {
|
|
698
|
+
i("change-prompt", p);
|
|
699
|
+
}, R = () => {
|
|
698
700
|
i("stop");
|
|
699
701
|
}, u = (p) => {
|
|
700
702
|
const f = p.target;
|
|
@@ -703,23 +705,23 @@ const et = /* @__PURE__ */ Y({
|
|
|
703
705
|
y != null && y.classList.contains("closed") ? y == null || y.classList.remove("closed") : y == null || y.classList.add("closed");
|
|
704
706
|
}
|
|
705
707
|
f != null && f.classList.contains("ai-clickable") && i("ai-click", f.dataset.ai);
|
|
706
|
-
},
|
|
708
|
+
}, A = () => {
|
|
707
709
|
C(), document.addEventListener("click", u);
|
|
708
|
-
},
|
|
710
|
+
}, J = () => {
|
|
709
711
|
window.showTimes = [], document.removeEventListener("click", u);
|
|
710
|
-
}, J = (p) => {
|
|
711
|
-
e.value = p;
|
|
712
712
|
}, Z = (p) => {
|
|
713
|
-
|
|
713
|
+
e.value = p;
|
|
714
|
+
}, U = (p) => {
|
|
715
|
+
const f = p.prompt.replace("{{ SELECTED_TEXT }}", r.value);
|
|
714
716
|
if (s.loading) {
|
|
715
717
|
me({ theme: "warning", message: b("内容正在执行中,请执行完成后再发送") });
|
|
716
718
|
return;
|
|
717
719
|
}
|
|
718
720
|
i("send", {
|
|
719
721
|
content: p.label,
|
|
720
|
-
cite:
|
|
722
|
+
cite: r.value,
|
|
721
723
|
prompt: f
|
|
722
|
-
}),
|
|
724
|
+
}), r.value = "";
|
|
723
725
|
};
|
|
724
726
|
return be(
|
|
725
727
|
() => s.messages,
|
|
@@ -730,18 +732,18 @@ const et = /* @__PURE__ */ Y({
|
|
|
730
732
|
{
|
|
731
733
|
deep: !0
|
|
732
734
|
}
|
|
733
|
-
), ne(
|
|
734
|
-
setInputMessage:
|
|
735
|
+
), ne(A), le(J), n({
|
|
736
|
+
setInputMessage: Z
|
|
735
737
|
}), (p, f) => (m(), g(
|
|
736
738
|
"section",
|
|
737
739
|
{
|
|
738
|
-
style:
|
|
740
|
+
style: W({
|
|
739
741
|
background: p.background
|
|
740
742
|
}),
|
|
741
743
|
class: "ai-content"
|
|
742
744
|
},
|
|
743
745
|
[
|
|
744
|
-
p.alert ? (m(),
|
|
746
|
+
p.alert ? (m(), q(c(Re), {
|
|
745
747
|
key: 0,
|
|
746
748
|
title: p.alert,
|
|
747
749
|
theme: "warning",
|
|
@@ -752,15 +754,15 @@ const et = /* @__PURE__ */ Y({
|
|
|
752
754
|
{
|
|
753
755
|
class: "ai-messages ai-blueking-messages",
|
|
754
756
|
onScrollPassive: f[0] || (f[0] = //@ts-ignore
|
|
755
|
-
(...y) =>
|
|
757
|
+
(...y) => c(w) && c(w)(...y))
|
|
756
758
|
},
|
|
757
759
|
[
|
|
758
760
|
p.scrollLoading ? (m(), g("svg", xt, It)) : M("v-if", !0),
|
|
759
761
|
(m(!0), g(
|
|
760
|
-
|
|
762
|
+
K,
|
|
761
763
|
null,
|
|
762
|
-
|
|
763
|
-
|
|
764
|
+
re(p.messages, (y) => (m(), g(
|
|
765
|
+
K,
|
|
764
766
|
{
|
|
765
767
|
key: y.content
|
|
766
768
|
},
|
|
@@ -797,37 +799,37 @@ const et = /* @__PURE__ */ Y({
|
|
|
797
799
|
T(_e),
|
|
798
800
|
T(Tt, {
|
|
799
801
|
"is-show": p.loading,
|
|
800
|
-
onStop:
|
|
802
|
+
onStop: R
|
|
801
803
|
}, null, 8, ["is-show"])
|
|
802
804
|
],
|
|
803
805
|
32
|
|
804
806
|
/* NEED_HYDRATION */
|
|
805
807
|
),
|
|
806
808
|
d("section", Et, [
|
|
807
|
-
r
|
|
809
|
+
c(r) ? (m(), g(
|
|
808
810
|
"div",
|
|
809
811
|
{
|
|
810
812
|
key: 0,
|
|
811
|
-
class: $(["ai-cite-container", { "is-back-show": !
|
|
813
|
+
class: $(["ai-cite-container", { "is-back-show": !c(k) }]),
|
|
812
814
|
onMousedown: f[2] || (f[2] = D(() => {
|
|
813
815
|
}, ["prevent"]))
|
|
814
816
|
},
|
|
815
817
|
[
|
|
816
818
|
T(we, {
|
|
817
819
|
"show-close-icon": !0,
|
|
818
|
-
text: r
|
|
819
|
-
onClose:
|
|
820
|
+
text: c(r),
|
|
821
|
+
onClose: c(h)
|
|
820
822
|
}, null, 8, ["text", "onClose"]),
|
|
821
823
|
d(
|
|
822
824
|
"span",
|
|
823
825
|
Xt,
|
|
824
|
-
P(
|
|
826
|
+
P(c(b)("想对选中的文本做什么")),
|
|
825
827
|
1
|
|
826
828
|
/* TEXT */
|
|
827
829
|
),
|
|
828
830
|
T(zt, {
|
|
829
831
|
shortcuts: p.shortcuts,
|
|
830
|
-
onSelect:
|
|
832
|
+
onSelect: U
|
|
831
833
|
}, null, 8, ["shortcuts"])
|
|
832
834
|
],
|
|
833
835
|
34
|
|
@@ -839,20 +841,21 @@ const et = /* @__PURE__ */ Y({
|
|
|
839
841
|
"onUpdate:value": f[3] || (f[3] = (y) => e.value = y),
|
|
840
842
|
placeholder: p.placeholder,
|
|
841
843
|
prompts: p.prompts,
|
|
844
|
+
onChangePrompt: H,
|
|
842
845
|
onChoosePrompt: z,
|
|
843
846
|
onEnter: B
|
|
844
847
|
}, null, 8, ["value", "placeholder", "prompts"]),
|
|
845
|
-
|
|
848
|
+
E((m(), q(c(Ve), {
|
|
846
849
|
class: "ai-operation-button",
|
|
847
850
|
disabled: p.loading || !e.value,
|
|
848
851
|
size: "large",
|
|
849
852
|
theme: "primary",
|
|
850
853
|
onClick: B
|
|
851
854
|
}, {
|
|
852
|
-
default:
|
|
855
|
+
default: G(() => [
|
|
853
856
|
Kt,
|
|
854
857
|
ee(
|
|
855
|
-
" " + P(
|
|
858
|
+
" " + P(c(b)("发送")),
|
|
856
859
|
1
|
|
857
860
|
/* TEXT */
|
|
858
861
|
)
|
|
@@ -860,8 +863,8 @@ const et = /* @__PURE__ */ Y({
|
|
|
860
863
|
_: 1
|
|
861
864
|
/* STABLE */
|
|
862
865
|
}, 8, ["disabled"])), [
|
|
863
|
-
[
|
|
864
|
-
content:
|
|
866
|
+
[c(l), {
|
|
867
|
+
content: c(b)("内容正在执行中,请执行完成后再发送"),
|
|
865
868
|
disabled: !p.loading
|
|
866
869
|
}]
|
|
867
870
|
])
|
|
@@ -873,7 +876,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
873
876
|
/* STYLE */
|
|
874
877
|
));
|
|
875
878
|
}
|
|
876
|
-
}), Qt = /* @__PURE__ */ I(Ut, [["__scopeId", "data-v-
|
|
879
|
+
}), Qt = /* @__PURE__ */ I(Ut, [["__scopeId", "data-v-de79ff73"]]), jt = { class: "ai-modal-header-icon" }, Wt = /* @__PURE__ */ Y({
|
|
877
880
|
__name: "render-modal",
|
|
878
881
|
props: {
|
|
879
882
|
headBackground: { default: "linear-gradient(267deg, #2dd1f4 0%, #1482ff 95%)" },
|
|
@@ -908,7 +911,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
908
911
|
type: "",
|
|
909
912
|
clientX: 0,
|
|
910
913
|
clientY: 0
|
|
911
|
-
},
|
|
914
|
+
}, r = () => {
|
|
912
915
|
var S, V, O, N;
|
|
913
916
|
const a = (F, Me) => F === void 0 ? Me : F;
|
|
914
917
|
return {
|
|
@@ -917,7 +920,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
917
920
|
left: a((O = t.startPosition) == null ? void 0 : O.left, 0),
|
|
918
921
|
right: a((N = t.startPosition) == null ? void 0 : N.right, l.width - t.sizeLimit.width)
|
|
919
922
|
};
|
|
920
|
-
}, h = x(
|
|
923
|
+
}, h = x(r()), k = X(() => h.value.top <= t.positionLimit.top && h.value.bottom <= t.positionLimit.bottom), C = (a) => {
|
|
921
924
|
s("choose-model", a);
|
|
922
925
|
}, w = (a) => {
|
|
923
926
|
e.isMove = !0, e.type = "move", e.clientX = a.clientX, e.clientY = a.clientY;
|
|
@@ -927,48 +930,48 @@ const et = /* @__PURE__ */ Y({
|
|
|
927
930
|
e.isMove = !0, e.type = "leftDrag", e.clientX = a.clientX;
|
|
928
931
|
}, H = (a) => {
|
|
929
932
|
e.isMove = !0, e.type = "topDrag", e.clientY = a.clientY;
|
|
930
|
-
}, u = (a) => {
|
|
931
|
-
e.isMove = !0, e.type = "bottomDrag", e.clientY = a.clientY;
|
|
932
933
|
}, R = (a) => {
|
|
934
|
+
e.isMove = !0, e.type = "bottomDrag", e.clientY = a.clientY;
|
|
935
|
+
}, u = (a) => {
|
|
933
936
|
e.isMove = !0, e.type = "topLeftDrag", e.clientY = a.clientY, e.clientX = a.clientX;
|
|
934
|
-
},
|
|
937
|
+
}, A = (a) => {
|
|
935
938
|
e.isMove = !0, e.type = "topRightDrag", e.clientY = a.clientY, e.clientX = a.clientX;
|
|
936
939
|
}, J = (a) => {
|
|
937
940
|
e.isMove = !0, e.type = "bottomLeftDrag", e.clientY = a.clientY, e.clientX = a.clientX;
|
|
938
941
|
}, Z = (a) => {
|
|
939
942
|
e.isMove = !0, e.type = "bottomRightDrag", e.clientY = a.clientY, e.clientX = a.clientX;
|
|
940
|
-
},
|
|
943
|
+
}, U = () => {
|
|
941
944
|
e.isMove = !1;
|
|
942
|
-
},
|
|
945
|
+
}, p = (a, S) => {
|
|
943
946
|
["move", "leftDrag"].includes(e.type) && (h.value.left += a), ["move", "rightDrag"].includes(e.type) && (h.value.right -= a), ["move", "topDrag"].includes(e.type) && (h.value.top += S), ["move", "bottomDrag"].includes(e.type) && (h.value.bottom -= S), ["topLeftDrag"].includes(e.type) && (h.value.left += a, h.value.top += S), ["topRightDrag"].includes(e.type) && (h.value.right -= a, h.value.top += S), ["bottomLeftDrag"].includes(e.type) && (h.value.left += a, h.value.bottom -= S), ["bottomRightDrag"].includes(e.type) && (h.value.right -= a, h.value.bottom -= S);
|
|
944
|
-
},
|
|
947
|
+
}, f = (a, S) => {
|
|
945
948
|
const { top: V, bottom: O, left: N, right: F } = h.value;
|
|
946
949
|
(l.width - N - F < t.sizeLimit.width || N < t.positionLimit.left || F < t.positionLimit.right) && (["move", "leftDrag", "topLeftDrag", "bottomLeftDrag"].includes(e.type) && (h.value.left -= a), ["move", "rightDrag", "topRightDrag", "bottomRightDrag"].includes(e.type) && (h.value.right += a)), (l.height - V - O < t.sizeLimit.height || V < t.positionLimit.top || O < t.positionLimit.bottom) && (["move", "topDrag", "topRightDrag", "topLeftDrag"].includes(e.type) && (h.value.top -= S), ["move", "bottomDrag", "bottomLeftDrag", "bottomRightDrag"].includes(e.type) && (h.value.bottom += S));
|
|
947
|
-
},
|
|
950
|
+
}, y = (a) => {
|
|
948
951
|
if (!e.isMove)
|
|
949
952
|
return;
|
|
950
953
|
a.preventDefault();
|
|
951
954
|
const S = a.clientX - e.clientX, V = a.clientY - e.clientY;
|
|
952
|
-
|
|
955
|
+
p(S, V), f(S, V), e.clientX = a.clientX, e.clientY = a.clientY;
|
|
953
956
|
}, v = () => {
|
|
954
|
-
l.height = window.innerHeight, l.width = window.innerWidth, h.value =
|
|
957
|
+
l.height = window.innerHeight, l.width = window.innerWidth, h.value = r();
|
|
955
958
|
}, L = () => {
|
|
956
959
|
h.value.top = t.positionLimit.top, h.value.bottom = t.positionLimit.bottom;
|
|
957
960
|
}, te = () => {
|
|
958
961
|
h.value.top = l.height - t.sizeLimit.height, h.value.bottom = t.positionLimit.bottom;
|
|
959
|
-
},
|
|
962
|
+
}, Q = () => {
|
|
960
963
|
s("clear");
|
|
961
|
-
},
|
|
964
|
+
}, ce = () => {
|
|
962
965
|
s("close");
|
|
963
966
|
};
|
|
964
967
|
return xe(() => {
|
|
965
|
-
window.addEventListener("mousemove",
|
|
968
|
+
window.addEventListener("mousemove", y, !0), window.addEventListener("mouseup", U), window.addEventListener("resize", v);
|
|
966
969
|
}), le(() => {
|
|
967
|
-
window.removeEventListener("mousemove",
|
|
970
|
+
window.removeEventListener("mousemove", y, !0), window.removeEventListener("mouseup", U), window.removeEventListener("resize", v);
|
|
968
971
|
}), (a, S) => (m(), g(
|
|
969
972
|
"section",
|
|
970
973
|
{
|
|
971
|
-
style:
|
|
974
|
+
style: W({
|
|
972
975
|
top: h.value.top + "px",
|
|
973
976
|
bottom: h.value.bottom + "px",
|
|
974
977
|
left: h.value.left + "px",
|
|
@@ -980,7 +983,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
980
983
|
d(
|
|
981
984
|
"header",
|
|
982
985
|
{
|
|
983
|
-
style:
|
|
986
|
+
style: W({
|
|
984
987
|
background: a.headBackground
|
|
985
988
|
}),
|
|
986
989
|
class: "ai-modal-header",
|
|
@@ -998,22 +1001,22 @@ const et = /* @__PURE__ */ Y({
|
|
|
998
1001
|
/* CLASS */
|
|
999
1002
|
),
|
|
1000
1003
|
ee(
|
|
1001
|
-
" " + P(a.name ||
|
|
1004
|
+
" " + P(a.name || c(b)("小鲸")) + " ",
|
|
1002
1005
|
1
|
|
1003
1006
|
/* TEXT */
|
|
1004
1007
|
),
|
|
1005
|
-
a.models ? (m(),
|
|
1008
|
+
a.models ? (m(), q(c(ge), {
|
|
1006
1009
|
key: 0,
|
|
1007
1010
|
class: "ai-modal-header-models",
|
|
1008
1011
|
"model-value": a.model,
|
|
1009
1012
|
size: "small",
|
|
1010
1013
|
onChange: C
|
|
1011
1014
|
}, {
|
|
1012
|
-
default:
|
|
1015
|
+
default: G(() => [
|
|
1013
1016
|
(m(!0), g(
|
|
1014
|
-
|
|
1017
|
+
K,
|
|
1015
1018
|
null,
|
|
1016
|
-
|
|
1019
|
+
re(a.models, (V) => (m(), q(c(ge).Option, {
|
|
1017
1020
|
key: V.id,
|
|
1018
1021
|
name: V.name,
|
|
1019
1022
|
value: V.id
|
|
@@ -1027,7 +1030,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
1027
1030
|
}, 8, ["model-value"])) : M("v-if", !0)
|
|
1028
1031
|
]),
|
|
1029
1032
|
d("span", null, [
|
|
1030
|
-
k.value ?
|
|
1033
|
+
k.value ? E((m(), g(
|
|
1031
1034
|
"i",
|
|
1032
1035
|
{
|
|
1033
1036
|
key: 0,
|
|
@@ -1038,11 +1041,11 @@ const et = /* @__PURE__ */ Y({
|
|
|
1038
1041
|
512
|
|
1039
1042
|
/* NEED_PATCH */
|
|
1040
1043
|
)), [
|
|
1041
|
-
[
|
|
1042
|
-
content:
|
|
1044
|
+
[c(i), {
|
|
1045
|
+
content: c(b)("向下收缩"),
|
|
1043
1046
|
distance: 20
|
|
1044
1047
|
}]
|
|
1045
|
-
]) :
|
|
1048
|
+
]) : E((m(), g(
|
|
1046
1049
|
"i",
|
|
1047
1050
|
{
|
|
1048
1051
|
key: 1,
|
|
@@ -1053,38 +1056,38 @@ const et = /* @__PURE__ */ Y({
|
|
|
1053
1056
|
512
|
|
1054
1057
|
/* NEED_PATCH */
|
|
1055
1058
|
)), [
|
|
1056
|
-
[
|
|
1057
|
-
content:
|
|
1059
|
+
[c(i), {
|
|
1060
|
+
content: c(b)("向上扩展"),
|
|
1058
1061
|
distance: 20
|
|
1059
1062
|
}]
|
|
1060
1063
|
]),
|
|
1061
|
-
|
|
1064
|
+
E(d(
|
|
1062
1065
|
"i",
|
|
1063
1066
|
{
|
|
1064
1067
|
class: "ai-header-tool ai-blueking-icon ai-blueking-saoba",
|
|
1065
|
-
onClick:
|
|
1068
|
+
onClick: Q
|
|
1066
1069
|
},
|
|
1067
1070
|
null,
|
|
1068
1071
|
512
|
|
1069
1072
|
/* NEED_PATCH */
|
|
1070
1073
|
), [
|
|
1071
|
-
[
|
|
1072
|
-
content:
|
|
1074
|
+
[c(i), {
|
|
1075
|
+
content: c(b)("清空聊天记录"),
|
|
1073
1076
|
distance: 20
|
|
1074
1077
|
}]
|
|
1075
1078
|
]),
|
|
1076
|
-
|
|
1079
|
+
E(d(
|
|
1077
1080
|
"i",
|
|
1078
1081
|
{
|
|
1079
1082
|
class: "ai-header-tool ai-blueking-icon ai-blueking-shanchu-2",
|
|
1080
|
-
onClick:
|
|
1083
|
+
onClick: ce
|
|
1081
1084
|
},
|
|
1082
1085
|
null,
|
|
1083
1086
|
512
|
|
1084
1087
|
/* NEED_PATCH */
|
|
1085
1088
|
), [
|
|
1086
|
-
[
|
|
1087
|
-
content:
|
|
1089
|
+
[c(i), {
|
|
1090
|
+
content: c(b)("关闭"),
|
|
1088
1091
|
distance: 20
|
|
1089
1092
|
}]
|
|
1090
1093
|
])
|
|
@@ -1128,7 +1131,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
1128
1131
|
"span",
|
|
1129
1132
|
{
|
|
1130
1133
|
class: "drag-line bottom",
|
|
1131
|
-
onMousedown: D(
|
|
1134
|
+
onMousedown: D(R, ["stop"])
|
|
1132
1135
|
},
|
|
1133
1136
|
null,
|
|
1134
1137
|
32
|
|
@@ -1138,7 +1141,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
1138
1141
|
"span",
|
|
1139
1142
|
{
|
|
1140
1143
|
class: "drag-line top-left-corner",
|
|
1141
|
-
onMousedown: D(
|
|
1144
|
+
onMousedown: D(u, ["stop"])
|
|
1142
1145
|
},
|
|
1143
1146
|
null,
|
|
1144
1147
|
32
|
|
@@ -1148,7 +1151,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
1148
1151
|
"span",
|
|
1149
1152
|
{
|
|
1150
1153
|
class: "drag-line top-right-corner",
|
|
1151
|
-
onMousedown: D(
|
|
1154
|
+
onMousedown: D(A, ["stop"])
|
|
1152
1155
|
},
|
|
1153
1156
|
null,
|
|
1154
1157
|
32
|
|
@@ -1192,13 +1195,13 @@ const et = /* @__PURE__ */ Y({
|
|
|
1192
1195
|
const { isIconVisible: t, iconPosition: s } = pe(), i = n, l = () => {
|
|
1193
1196
|
i("click"), t.value = !1;
|
|
1194
1197
|
};
|
|
1195
|
-
return (e,
|
|
1198
|
+
return (e, r) => c(t) ? (m(), g(
|
|
1196
1199
|
"div",
|
|
1197
1200
|
{
|
|
1198
1201
|
key: 0,
|
|
1199
|
-
style:
|
|
1202
|
+
style: W(c(s)),
|
|
1200
1203
|
class: "ai-blueking-render-popup",
|
|
1201
|
-
onMousedown:
|
|
1204
|
+
onMousedown: r[0] || (r[0] = D(() => {
|
|
1202
1205
|
}, ["prevent"]))
|
|
1203
1206
|
},
|
|
1204
1207
|
[
|
|
@@ -1210,7 +1213,7 @@ const et = /* @__PURE__ */ Y({
|
|
|
1210
1213
|
d(
|
|
1211
1214
|
"span",
|
|
1212
1215
|
Ot,
|
|
1213
|
-
P(
|
|
1216
|
+
P(c(b)("问小鲸")),
|
|
1214
1217
|
1
|
|
1215
1218
|
/* TEXT */
|
|
1216
1219
|
)
|
|
@@ -1243,14 +1246,14 @@ const et = /* @__PURE__ */ Y({
|
|
|
1243
1246
|
isShow: { type: Boolean },
|
|
1244
1247
|
shortcuts: {}
|
|
1245
1248
|
},
|
|
1246
|
-
emits: ["clear", "close", "scroll-load", "stop", "ai-click", "update:model", "choose-prompt", "send", "update:isShow"],
|
|
1249
|
+
emits: ["clear", "close", "scroll-load", "stop", "ai-click", "change-prompt", "update:model", "choose-prompt", "send", "update:isShow"],
|
|
1247
1250
|
setup(o, { expose: n, emit: t }) {
|
|
1248
1251
|
const s = t, i = x(), l = (u) => {
|
|
1249
|
-
var
|
|
1250
|
-
(
|
|
1252
|
+
var A;
|
|
1253
|
+
(A = i.value) == null || A.setInputMessage(u);
|
|
1251
1254
|
}, e = () => {
|
|
1252
1255
|
s("update:isShow", !0);
|
|
1253
|
-
},
|
|
1256
|
+
}, r = () => {
|
|
1254
1257
|
s("clear");
|
|
1255
1258
|
}, h = () => {
|
|
1256
1259
|
s("update:isShow", !1), s("close");
|
|
@@ -1266,14 +1269,16 @@ const et = /* @__PURE__ */ Y({
|
|
|
1266
1269
|
s("ai-click", u);
|
|
1267
1270
|
}, H = (u) => {
|
|
1268
1271
|
s("choose-prompt", u);
|
|
1272
|
+
}, R = (u) => {
|
|
1273
|
+
s("change-prompt", u);
|
|
1269
1274
|
};
|
|
1270
1275
|
return n({
|
|
1271
1276
|
setInputMessage: l
|
|
1272
|
-
}), (u,
|
|
1273
|
-
|
|
1277
|
+
}), (u, A) => (m(), g(
|
|
1278
|
+
K,
|
|
1274
1279
|
null,
|
|
1275
1280
|
[
|
|
1276
|
-
|
|
1281
|
+
E(T(Gt, {
|
|
1277
1282
|
"head-background": u.headBackground,
|
|
1278
1283
|
logo: u.logo,
|
|
1279
1284
|
model: u.model,
|
|
@@ -1283,10 +1288,10 @@ const et = /* @__PURE__ */ Y({
|
|
|
1283
1288
|
"size-limit": u.sizeLimit,
|
|
1284
1289
|
"start-position": u.startPosition,
|
|
1285
1290
|
onChooseModel: k,
|
|
1286
|
-
onClear:
|
|
1291
|
+
onClear: r,
|
|
1287
1292
|
onClose: h
|
|
1288
1293
|
}, {
|
|
1289
|
-
default:
|
|
1294
|
+
default: G(() => [
|
|
1290
1295
|
T(Qt, {
|
|
1291
1296
|
ref_key: "contentRef",
|
|
1292
1297
|
ref: i,
|
|
@@ -1298,14 +1303,15 @@ const et = /* @__PURE__ */ Y({
|
|
|
1298
1303
|
prompts: u.prompts,
|
|
1299
1304
|
"scroll-loading": u.scrollLoading,
|
|
1300
1305
|
"scroll-loading-end": u.scrollLoadingEnd,
|
|
1301
|
-
"user-photo": u.userPhoto,
|
|
1302
1306
|
shortcuts: u.shortcuts,
|
|
1307
|
+
"user-photo": u.userPhoto,
|
|
1303
1308
|
onAiClick: z,
|
|
1309
|
+
onChangePrompt: R,
|
|
1304
1310
|
onChoosePrompt: H,
|
|
1305
1311
|
onScrollLoad: B,
|
|
1306
1312
|
onSend: C,
|
|
1307
1313
|
onStop: w
|
|
1308
|
-
}, null, 8, ["alert", "background", "loading", "messages", "placeholder", "prompts", "scroll-loading", "scroll-loading-end", "
|
|
1314
|
+
}, null, 8, ["alert", "background", "loading", "messages", "placeholder", "prompts", "scroll-loading", "scroll-loading-end", "shortcuts", "user-photo"])
|
|
1309
1315
|
]),
|
|
1310
1316
|
_: 1
|
|
1311
1317
|
/* STABLE */
|
|
@@ -1327,12 +1333,12 @@ const et = /* @__PURE__ */ Y({
|
|
|
1327
1333
|
})();
|
|
1328
1334
|
class io {
|
|
1329
1335
|
constructor(n, t, s, i, l) {
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
+
j(this, "controllerMap");
|
|
1337
|
+
j(this, "handleEnd");
|
|
1338
|
+
j(this, "handleError");
|
|
1339
|
+
j(this, "handleReceiveMessage");
|
|
1340
|
+
j(this, "handleStart");
|
|
1341
|
+
j(this, "url");
|
|
1336
1342
|
this.url = n, this.handleStart = t, this.handleReceiveMessage = s, this.handleEnd = i, this.handleError = l, this.controllerMap = {};
|
|
1337
1343
|
}
|
|
1338
1344
|
stop(n) {
|
|
@@ -1355,22 +1361,22 @@ class io {
|
|
|
1355
1361
|
const e = l.body.pipeThrough(new window.TextDecoderStream()).getReader();
|
|
1356
1362
|
for (; ; )
|
|
1357
1363
|
try {
|
|
1358
|
-
const { value:
|
|
1364
|
+
const { value: r, done: h } = await e.read();
|
|
1359
1365
|
if (!l.ok) {
|
|
1360
|
-
this.handleError(
|
|
1366
|
+
this.handleError(r || l.statusText, l.status, t);
|
|
1361
1367
|
break;
|
|
1362
1368
|
}
|
|
1363
1369
|
if (h) {
|
|
1364
1370
|
this.handleEnd(t);
|
|
1365
1371
|
break;
|
|
1366
1372
|
}
|
|
1367
|
-
|
|
1373
|
+
r.toString().split(`
|
|
1368
1374
|
`).forEach((C) => {
|
|
1369
1375
|
const w = C.replace("data:", "").trim();
|
|
1370
1376
|
if (Ke(w)) {
|
|
1371
|
-
const { event: B, content: z, result: H, code:
|
|
1377
|
+
const { event: B, content: z, result: H, code: R, message: u } = JSON.parse(w);
|
|
1372
1378
|
if (H === !1 || l.status !== 200) {
|
|
1373
|
-
this.handleError(
|
|
1379
|
+
this.handleError(u, R, t);
|
|
1374
1380
|
return;
|
|
1375
1381
|
}
|
|
1376
1382
|
switch (B) {
|
|
@@ -1381,13 +1387,13 @@ class io {
|
|
|
1381
1387
|
this.handleEnd(t);
|
|
1382
1388
|
break;
|
|
1383
1389
|
case "error":
|
|
1384
|
-
this.handleError(
|
|
1390
|
+
this.handleError(u, R, t);
|
|
1385
1391
|
break;
|
|
1386
1392
|
}
|
|
1387
1393
|
}
|
|
1388
1394
|
});
|
|
1389
|
-
} catch (
|
|
1390
|
-
(
|
|
1395
|
+
} catch (r) {
|
|
1396
|
+
(r == null ? void 0 : r.code) !== 20 && this.handleError(r.message, r.code, t);
|
|
1391
1397
|
break;
|
|
1392
1398
|
}
|
|
1393
1399
|
}).catch((l) => {
|