@ibiz-template-plugin/ai-chat 0.0.26 → 0.0.28
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/index.es.js +102 -81
- package/dist/index.legacy.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -4,7 +4,7 @@ var kn = (n, e, t) => e in n ? Sn(n, e, { enumerable: !0, configurable: !0, writ
|
|
|
4
4
|
var x = (n, e, t) => (kn(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
5
5
|
import Pe from "interactjs";
|
|
6
6
|
import Vt from "cherry-markdown";
|
|
7
|
-
var Le,
|
|
7
|
+
var Le, b, qt, jt, ne, ct, Yt, Xe, Xt, re = {}, Zt = [], Nn = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ze = Array.isArray;
|
|
8
8
|
function G(n, e) {
|
|
9
9
|
for (var t in e)
|
|
10
10
|
n[t] = e[t];
|
|
@@ -25,7 +25,7 @@ function j(n, e, t) {
|
|
|
25
25
|
}
|
|
26
26
|
function Se(n, e, t, i, s) {
|
|
27
27
|
var o = { type: n, props: e, key: t, ref: i, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: s == null ? ++qt : s };
|
|
28
|
-
return s == null &&
|
|
28
|
+
return s == null && b.vnode != null && b.vnode(o), o;
|
|
29
29
|
}
|
|
30
30
|
function lt() {
|
|
31
31
|
return { current: null };
|
|
@@ -56,7 +56,7 @@ function Jt(n) {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
function Ze(n) {
|
|
59
|
-
(!n.__d && (n.__d = !0) && ne.push(n) && !Ee.__r++ || ct !==
|
|
59
|
+
(!n.__d && (n.__d = !0) && ne.push(n) && !Ee.__r++ || ct !== b.debounceRendering) && ((ct = b.debounceRendering) || Yt)(Ee);
|
|
60
60
|
}
|
|
61
61
|
function Ee() {
|
|
62
62
|
var n, e, t, i, s, o, a, r, u;
|
|
@@ -65,9 +65,9 @@ function Ee() {
|
|
|
65
65
|
Ee.__r = 0;
|
|
66
66
|
}
|
|
67
67
|
function Kt(n, e, t, i, s, o, a, r, u, h, p) {
|
|
68
|
-
var l, v, _, d, f, m,
|
|
68
|
+
var l, v, _, d, f, m, w, g, T, C = 0, S = i && i.__k || Zt, O = S.length, L = O, U = e.length;
|
|
69
69
|
for (t.__k = [], l = 0; l < U; l++)
|
|
70
|
-
(d = t.__k[l] = (d = e[l]) == null || typeof d == "boolean" || typeof d == "function" ? null : typeof d == "string" || typeof d == "number" || typeof d == "bigint" ? Se(null, d, null, null, d) : ze(d) ? Se(Y, { children: d }, null, null, null) : d.__b > 0 ? Se(d.type, d.props, d.key, d.ref ? d.ref : null, d.__v) : d) != null ? (d.__ = t, d.__b = t.__b + 1, (g = En(d, S,
|
|
70
|
+
(d = t.__k[l] = (d = e[l]) == null || typeof d == "boolean" || typeof d == "function" ? null : typeof d == "string" || typeof d == "number" || typeof d == "bigint" ? Se(null, d, null, null, d) : ze(d) ? Se(Y, { children: d }, null, null, null) : d.__b > 0 ? Se(d.type, d.props, d.key, d.ref ? d.ref : null, d.__v) : d) != null ? (d.__ = t, d.__b = t.__b + 1, (g = En(d, S, w = l + C, L)) === -1 ? _ = re : (_ = S[g] || re, S[g] = void 0, L--), tt(n, d, _, s, o, a, r, u, h, p), f = d.__e, (v = d.ref) && _.ref != v && (_.ref && nt(_.ref, null, d), p.push(v, d.__c || f, d)), f != null && (m == null && (m = f), (T = _ === re || _.__v === null) ? g == -1 && C-- : g !== w && (g === w + 1 ? C++ : g > w ? L > U - w ? C += g - w : C-- : C = g < w && g == w - 1 ? g - w : 0), w = l + C, typeof d.type != "function" || g === w && _.__k !== d.__k ? typeof d.type == "function" || g === w && !T ? d.__d !== void 0 ? (u = d.__d, d.__d = void 0) : u = f.nextSibling : u = en(n, f, u) : u = Qt(d, u, n), typeof t.type == "function" && (t.__d = u))) : (_ = S[l]) && _.key == null && _.__e && (_.__e == u && (_.__ = i, u = ge(_)), Ge(_, _, !1), S[l] = null);
|
|
71
71
|
for (t.__e = m, l = O; l--; )
|
|
72
72
|
S[l] != null && (typeof t.type == "function" && S[l].__e != null && S[l].__e == t.__d && (t.__d = S[l].__e.nextSibling), Ge(S[l], S[l]));
|
|
73
73
|
}
|
|
@@ -148,35 +148,35 @@ function dt(n) {
|
|
|
148
148
|
return;
|
|
149
149
|
} else
|
|
150
150
|
n.t = Date.now();
|
|
151
|
-
return e(
|
|
151
|
+
return e(b.event ? b.event(n) : n);
|
|
152
152
|
}
|
|
153
153
|
function ht(n) {
|
|
154
|
-
return this.l[n.type + !0](
|
|
154
|
+
return this.l[n.type + !0](b.event ? b.event(n) : n);
|
|
155
155
|
}
|
|
156
156
|
function tt(n, e, t, i, s, o, a, r, u, h) {
|
|
157
|
-
var p, l, v, _, d, f, m,
|
|
157
|
+
var p, l, v, _, d, f, m, w, g, T, C, S, O, L, U, z = e.type;
|
|
158
158
|
if (e.constructor !== void 0)
|
|
159
159
|
return null;
|
|
160
|
-
t.__h != null && (u = t.__h, r = e.__e = t.__e, e.__h = null, o = [r]), (p =
|
|
160
|
+
t.__h != null && (u = t.__h, r = e.__e = t.__e, e.__h = null, o = [r]), (p = b.__b) && p(e);
|
|
161
161
|
e:
|
|
162
162
|
if (typeof z == "function")
|
|
163
163
|
try {
|
|
164
|
-
if (
|
|
164
|
+
if (w = e.props, g = (p = z.contextType) && i[p.__c], T = p ? g ? g.props.value : p.__ : i, t.__c ? m = (l = e.__c = t.__c).__ = l.__E : ("prototype" in z && z.prototype.render ? e.__c = l = new z(w, T) : (e.__c = l = new F(w, T), l.constructor = z, l.render = An), g && g.sub(l), l.props = w, l.state || (l.state = {}), l.context = T, l.__n = i, v = l.__d = !0, l.__h = [], l._sb = []), l.__s == null && (l.__s = l.state), z.getDerivedStateFromProps != null && (l.__s == l.state && (l.__s = G({}, l.__s)), G(l.__s, z.getDerivedStateFromProps(w, l.__s))), _ = l.props, d = l.state, l.__v = e, v)
|
|
165
165
|
z.getDerivedStateFromProps == null && l.componentWillMount != null && l.componentWillMount(), l.componentDidMount != null && l.__h.push(l.componentDidMount);
|
|
166
166
|
else {
|
|
167
|
-
if (z.getDerivedStateFromProps == null &&
|
|
168
|
-
for (e.__v !== t.__v && (l.props =
|
|
167
|
+
if (z.getDerivedStateFromProps == null && w !== _ && l.componentWillReceiveProps != null && l.componentWillReceiveProps(w, T), !l.__e && (l.shouldComponentUpdate != null && l.shouldComponentUpdate(w, l.__s, T) === !1 || e.__v === t.__v)) {
|
|
168
|
+
for (e.__v !== t.__v && (l.props = w, l.state = l.__s, l.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.forEach(function(ye) {
|
|
169
169
|
ye && (ye.__ = e);
|
|
170
170
|
}), C = 0; C < l._sb.length; C++)
|
|
171
171
|
l.__h.push(l._sb[C]);
|
|
172
172
|
l._sb = [], l.__h.length && a.push(l);
|
|
173
173
|
break e;
|
|
174
174
|
}
|
|
175
|
-
l.componentWillUpdate != null && l.componentWillUpdate(
|
|
175
|
+
l.componentWillUpdate != null && l.componentWillUpdate(w, l.__s, T), l.componentDidUpdate != null && l.__h.push(function() {
|
|
176
176
|
l.componentDidUpdate(_, d, f);
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
if (l.context = T, l.props =
|
|
179
|
+
if (l.context = T, l.props = w, l.__P = n, l.__e = !1, S = b.__r, O = 0, "prototype" in z && z.prototype.render) {
|
|
180
180
|
for (l.state = l.__s, l.__d = !1, S && S(e), p = l.render(l.props, l.state, l.context), L = 0; L < l._sb.length; L++)
|
|
181
181
|
l.__h.push(l._sb[L]);
|
|
182
182
|
l._sb = [];
|
|
@@ -186,22 +186,22 @@ function tt(n, e, t, i, s, o, a, r, u, h) {
|
|
|
186
186
|
while (l.__d && ++O < 25);
|
|
187
187
|
l.state = l.__s, l.getChildContext != null && (i = G(G({}, i), l.getChildContext())), v || l.getSnapshotBeforeUpdate == null || (f = l.getSnapshotBeforeUpdate(_, d)), Kt(n, ze(U = p != null && p.type === Y && p.key == null ? p.props.children : p) ? U : [U], e, t, i, s, o, a, r, u, h), l.base = e.__e, e.__h = null, l.__h.length && a.push(l), m && (l.__E = l.__ = null);
|
|
188
188
|
} catch (ye) {
|
|
189
|
-
e.__v = null, (u || o != null) && (e.__e = r, e.__h = !!u, o[o.indexOf(r)] = null),
|
|
189
|
+
e.__v = null, (u || o != null) && (e.__e = r, e.__h = !!u, o[o.indexOf(r)] = null), b.__e(ye, e, t);
|
|
190
190
|
}
|
|
191
191
|
else
|
|
192
192
|
o == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e = $n(t.__e, e, t, i, s, o, a, u, h);
|
|
193
|
-
(p =
|
|
193
|
+
(p = b.diffed) && p(e);
|
|
194
194
|
}
|
|
195
195
|
function tn(n, e, t) {
|
|
196
196
|
for (var i = 0; i < t.length; i++)
|
|
197
197
|
nt(t[i], t[++i], t[++i]);
|
|
198
|
-
|
|
198
|
+
b.__c && b.__c(e, n), n.some(function(s) {
|
|
199
199
|
try {
|
|
200
200
|
n = s.__h, s.__h = [], n.some(function(o) {
|
|
201
201
|
o.call(s);
|
|
202
202
|
});
|
|
203
203
|
} catch (o) {
|
|
204
|
-
|
|
204
|
+
b.__e(o, s.__v);
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
}
|
|
@@ -241,17 +241,17 @@ function nt(n, e, t) {
|
|
|
241
241
|
try {
|
|
242
242
|
typeof n == "function" ? n(e) : n.current = e;
|
|
243
243
|
} catch (i) {
|
|
244
|
-
|
|
244
|
+
b.__e(i, t);
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
function Ge(n, e, t) {
|
|
248
248
|
var i, s;
|
|
249
|
-
if (
|
|
249
|
+
if (b.unmount && b.unmount(n), (i = n.ref) && (i.current && i.current !== n.__e || nt(i, null, e)), (i = n.__c) != null) {
|
|
250
250
|
if (i.componentWillUnmount)
|
|
251
251
|
try {
|
|
252
252
|
i.componentWillUnmount();
|
|
253
253
|
} catch (o) {
|
|
254
|
-
|
|
254
|
+
b.__e(o, e);
|
|
255
255
|
}
|
|
256
256
|
i.base = i.__P = null, n.__c = void 0;
|
|
257
257
|
}
|
|
@@ -265,7 +265,7 @@ function An(n, e, t) {
|
|
|
265
265
|
}
|
|
266
266
|
function ae(n, e, t) {
|
|
267
267
|
var i, s, o, a;
|
|
268
|
-
|
|
268
|
+
b.__ && b.__(n, e), s = (i = typeof t == "function") ? null : t && t.__k || e.__k, o = [], a = [], tt(e, n = (!i && t || e).__k = j(Y, null, [n]), s || re, re, e.ownerSVGElement !== void 0, !i && t ? [t] : s ? null : e.firstChild ? Le.call(e.childNodes) : null, o, !i && t ? t : s ? s.__e : e.firstChild, i, a), tn(o, n, a);
|
|
269
269
|
}
|
|
270
270
|
function In(n, e) {
|
|
271
271
|
var t = { __c: e = "__cC" + Xt++, __: n, Consumer: function(i, s) {
|
|
@@ -288,7 +288,7 @@ function In(n, e) {
|
|
|
288
288
|
} };
|
|
289
289
|
return t.Provider.__ = t.Consumer.contextType = t;
|
|
290
290
|
}
|
|
291
|
-
Le = Zt.slice,
|
|
291
|
+
Le = Zt.slice, b = { __e: function(n, e, t, i) {
|
|
292
292
|
for (var s, o, a; e = e.__; )
|
|
293
293
|
if ((s = e.__c) && !s.__)
|
|
294
294
|
try {
|
|
@@ -1234,9 +1234,9 @@ function on(n, e, t, i) {
|
|
|
1234
1234
|
y: r
|
|
1235
1235
|
};
|
|
1236
1236
|
}
|
|
1237
|
-
var le, k, Re, ft, we = 0, an = [], ke = [], vt =
|
|
1237
|
+
var le, k, Re, ft, we = 0, an = [], ke = [], vt = b.__b, mt = b.__r, _t = b.diffed, gt = b.__c, wt = b.unmount;
|
|
1238
1238
|
function He(n, e) {
|
|
1239
|
-
|
|
1239
|
+
b.__h && b.__h(k, n, we || e), we = 0;
|
|
1240
1240
|
var t = k.__H || (k.__H = { __: [], __h: [] });
|
|
1241
1241
|
return n >= t.__.length && t.__.push({ __V: ke }), t.__[n];
|
|
1242
1242
|
}
|
|
@@ -1281,7 +1281,7 @@ function Pn(n, e, t) {
|
|
|
1281
1281
|
}
|
|
1282
1282
|
function D(n, e) {
|
|
1283
1283
|
var t = He(le++, 3);
|
|
1284
|
-
!
|
|
1284
|
+
!b.__s && cn(t.__H, e) && (t.__ = n, t.i = e, k.__H.__h.push(t));
|
|
1285
1285
|
}
|
|
1286
1286
|
function P(n) {
|
|
1287
1287
|
return we = 5, X(function() {
|
|
@@ -1307,24 +1307,24 @@ function Rn() {
|
|
|
1307
1307
|
try {
|
|
1308
1308
|
n.__H.__h.forEach(Ne), n.__H.__h.forEach(Ke), n.__H.__h = [];
|
|
1309
1309
|
} catch (e) {
|
|
1310
|
-
n.__H.__h = [],
|
|
1310
|
+
n.__H.__h = [], b.__e(e, n.__v);
|
|
1311
1311
|
}
|
|
1312
1312
|
}
|
|
1313
|
-
|
|
1313
|
+
b.__b = function(n) {
|
|
1314
1314
|
k = null, vt && vt(n);
|
|
1315
|
-
},
|
|
1315
|
+
}, b.__r = function(n) {
|
|
1316
1316
|
mt && mt(n), le = 0;
|
|
1317
1317
|
var e = (k = n.__c).__H;
|
|
1318
1318
|
e && (Re === k ? (e.__h = [], k.__h = [], e.__.forEach(function(t) {
|
|
1319
1319
|
t.__N && (t.__ = t.__N), t.__V = ke, t.__N = t.i = void 0;
|
|
1320
1320
|
})) : (e.__h.forEach(Ne), e.__h.forEach(Ke), e.__h = [], le = 0)), Re = k;
|
|
1321
|
-
},
|
|
1321
|
+
}, b.diffed = function(n) {
|
|
1322
1322
|
_t && _t(n);
|
|
1323
1323
|
var e = n.__c;
|
|
1324
|
-
e && e.__H && (e.__H.__h.length && (an.push(e) !== 1 && ft ===
|
|
1324
|
+
e && e.__H && (e.__H.__h.length && (an.push(e) !== 1 && ft === b.requestAnimationFrame || ((ft = b.requestAnimationFrame) || Fn)(Rn)), e.__H.__.forEach(function(t) {
|
|
1325
1325
|
t.i && (t.__H = t.i), t.__V !== ke && (t.__ = t.__V), t.i = void 0, t.__V = ke;
|
|
1326
1326
|
})), Re = k = null;
|
|
1327
|
-
},
|
|
1327
|
+
}, b.__c = function(n, e) {
|
|
1328
1328
|
e.some(function(t) {
|
|
1329
1329
|
try {
|
|
1330
1330
|
t.__h.forEach(Ne), t.__h = t.__h.filter(function(i) {
|
|
@@ -1333,10 +1333,10 @@ w.__b = function(n) {
|
|
|
1333
1333
|
} catch (i) {
|
|
1334
1334
|
e.some(function(s) {
|
|
1335
1335
|
s.__h && (s.__h = []);
|
|
1336
|
-
}), e = [],
|
|
1336
|
+
}), e = [], b.__e(i, t.__v);
|
|
1337
1337
|
}
|
|
1338
1338
|
}), gt && gt(n, e);
|
|
1339
|
-
},
|
|
1339
|
+
}, b.unmount = function(n) {
|
|
1340
1340
|
wt && wt(n);
|
|
1341
1341
|
var e, t = n.__c;
|
|
1342
1342
|
t && t.__H && (t.__H.__.forEach(function(i) {
|
|
@@ -1345,7 +1345,7 @@ w.__b = function(n) {
|
|
|
1345
1345
|
} catch (s) {
|
|
1346
1346
|
e = s;
|
|
1347
1347
|
}
|
|
1348
|
-
}), t.__H = void 0, e &&
|
|
1348
|
+
}), t.__H = void 0, e && b.__e(e, t.__v));
|
|
1349
1349
|
};
|
|
1350
1350
|
var bt = typeof requestAnimationFrame == "function";
|
|
1351
1351
|
function Fn(n) {
|
|
@@ -1604,7 +1604,7 @@ function at(n) {
|
|
|
1604
1604
|
}
|
|
1605
1605
|
var Be, Ue;
|
|
1606
1606
|
function ue(n, e) {
|
|
1607
|
-
|
|
1607
|
+
b[n] = e.bind(null, b[n] || function() {
|
|
1608
1608
|
});
|
|
1609
1609
|
}
|
|
1610
1610
|
function De(n) {
|
|
@@ -1751,7 +1751,7 @@ function c(n, e, t, i, s, o) {
|
|
|
1751
1751
|
if (typeof n == "function" && (a = n.defaultProps))
|
|
1752
1752
|
for (r in a)
|
|
1753
1753
|
u[r] === void 0 && (u[r] = a[r]);
|
|
1754
|
-
return
|
|
1754
|
+
return b.vnode && b.vnode(h), h;
|
|
1755
1755
|
}
|
|
1756
1756
|
const jn = () => c("svg", {
|
|
1757
1757
|
viewBox: "0 0 1024 1024",
|
|
@@ -2169,9 +2169,9 @@ const te = new M("markdown-message"), wi = (n) => {
|
|
|
2169
2169
|
n.controller.handleSuggestionClick(n.message, v, _);
|
|
2170
2170
|
}, l = (v) => {
|
|
2171
2171
|
const _ = v.indexOf("<think>"), d = v.indexOf("</think>");
|
|
2172
|
-
let f = "", m = "",
|
|
2173
|
-
return d === -1 ? (
|
|
2174
|
-
isThoughtCompleted:
|
|
2172
|
+
let f = "", m = "", w = !1;
|
|
2173
|
+
return d === -1 ? (w = !1, f = v.slice(_ + 7), m = "") : (w = !0, f = v.slice(_ + 7, d), m = v.slice(d + 8)), {
|
|
2174
|
+
isThoughtCompleted: w,
|
|
2175
2175
|
thoughtContent: f,
|
|
2176
2176
|
answerContent: m
|
|
2177
2177
|
};
|
|
@@ -2218,6 +2218,14 @@ const te = new M("markdown-message"), wi = (n) => {
|
|
|
2218
2218
|
previewer: {
|
|
2219
2219
|
// 默认禁用
|
|
2220
2220
|
enablePreviewerBubble: !1
|
|
2221
|
+
},
|
|
2222
|
+
engine: {
|
|
2223
|
+
syntax: {
|
|
2224
|
+
table: {
|
|
2225
|
+
enableChart: !1,
|
|
2226
|
+
externals: ["echarts"]
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2221
2229
|
}
|
|
2222
2230
|
});
|
|
2223
2231
|
}, []), c("div", {
|
|
@@ -2367,6 +2375,14 @@ const ie = new M("user-message-question"), Ci = (n) => {
|
|
|
2367
2375
|
previewer: {
|
|
2368
2376
|
// 默认禁用
|
|
2369
2377
|
enablePreviewerBubble: !1
|
|
2378
|
+
},
|
|
2379
|
+
engine: {
|
|
2380
|
+
syntax: {
|
|
2381
|
+
table: {
|
|
2382
|
+
enableChart: !1,
|
|
2383
|
+
externals: ["echarts"]
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2370
2386
|
}
|
|
2371
2387
|
});
|
|
2372
2388
|
}, [s.value.remainingText]), c("div", {
|
|
@@ -2550,7 +2566,7 @@ class je {
|
|
|
2550
2566
|
}
|
|
2551
2567
|
}
|
|
2552
2568
|
const H = new M("chat-toolbar-item"), Ni = (n) => {
|
|
2553
|
-
var f, m,
|
|
2569
|
+
var f, m, w;
|
|
2554
2570
|
const {
|
|
2555
2571
|
model: e,
|
|
2556
2572
|
data: t,
|
|
@@ -2613,7 +2629,7 @@ const H = new M("chat-toolbar-item"), Ni = (n) => {
|
|
|
2613
2629
|
}), r && c("div", {
|
|
2614
2630
|
ref: h,
|
|
2615
2631
|
className: H.b("dropdown"),
|
|
2616
|
-
children: (
|
|
2632
|
+
children: (w = e.children) == null ? void 0 : w.map((g, T) => {
|
|
2617
2633
|
if (!p(g))
|
|
2618
2634
|
return c("div", {
|
|
2619
2635
|
title: g.title,
|
|
@@ -2724,8 +2740,8 @@ const Ei = new M("chat-toolbar"), et = (n) => {
|
|
|
2724
2740
|
})), f.onClick && typeof f.onClick == "function")
|
|
2725
2741
|
f.onClick(d, f, e.context, e.params, m);
|
|
2726
2742
|
else {
|
|
2727
|
-
const
|
|
2728
|
-
|
|
2743
|
+
const w = n.controller.opts.extendToolbarClick;
|
|
2744
|
+
w && typeof w == "function" && w(d, f, e.context, e.params, m);
|
|
2729
2745
|
}
|
|
2730
2746
|
}, _ = X(() => s === "content" && (i == null ? void 0 : i.state) === 20 && (i == null ? void 0 : i.completed) !== !0, [i == null ? void 0 : i.state, i == null ? void 0 : i.completed]);
|
|
2731
2747
|
return c("div", {
|
|
@@ -2851,12 +2867,12 @@ function kt(n) {
|
|
|
2851
2867
|
(kt.prototype = new F()).isPureReactComponent = !0, kt.prototype.shouldComponentUpdate = function(n, e) {
|
|
2852
2868
|
return St(this.props, n) || St(this.state, e);
|
|
2853
2869
|
};
|
|
2854
|
-
var Nt =
|
|
2855
|
-
|
|
2870
|
+
var Nt = b.__b;
|
|
2871
|
+
b.__b = function(n) {
|
|
2856
2872
|
n.type && n.type.__f && n.ref && (n.props.ref = n.ref, n.ref = null), Nt && Nt(n);
|
|
2857
2873
|
};
|
|
2858
|
-
var Ii =
|
|
2859
|
-
|
|
2874
|
+
var Ii = b.__e;
|
|
2875
|
+
b.__e = function(n, e, t, i) {
|
|
2860
2876
|
if (n.then) {
|
|
2861
2877
|
for (var s, o = e; o = o.__; )
|
|
2862
2878
|
if ((s = o.__c) && s.__c)
|
|
@@ -2864,7 +2880,7 @@ w.__e = function(n, e, t, i) {
|
|
|
2864
2880
|
}
|
|
2865
2881
|
Ii(n, e, t, i);
|
|
2866
2882
|
};
|
|
2867
|
-
var Et =
|
|
2883
|
+
var Et = b.unmount;
|
|
2868
2884
|
function bn(n, e, t) {
|
|
2869
2885
|
return n && (n.__c && n.__c.__H && (n.__c.__H.__.forEach(function(i) {
|
|
2870
2886
|
typeof i.__c == "function" && i.__c();
|
|
@@ -2887,7 +2903,7 @@ function Cn(n) {
|
|
|
2887
2903
|
function Te() {
|
|
2888
2904
|
this.u = null, this.o = null;
|
|
2889
2905
|
}
|
|
2890
|
-
|
|
2906
|
+
b.unmount = function(n) {
|
|
2891
2907
|
var e = n.__c;
|
|
2892
2908
|
e && e.__R && e.__R(), e && n.__h === !0 && (n.type = null), Et && Et(n);
|
|
2893
2909
|
}, (Ye.prototype = new F()).__c = function(n, e) {
|
|
@@ -2984,7 +3000,7 @@ F.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveP
|
|
|
2984
3000
|
Object.defineProperty(this, n, { configurable: !0, writable: !0, value: e });
|
|
2985
3001
|
} });
|
|
2986
3002
|
});
|
|
2987
|
-
var $t =
|
|
3003
|
+
var $t = b.event;
|
|
2988
3004
|
function Ui() {
|
|
2989
3005
|
}
|
|
2990
3006
|
function Wi() {
|
|
@@ -2993,13 +3009,13 @@ function Wi() {
|
|
|
2993
3009
|
function Vi() {
|
|
2994
3010
|
return this.defaultPrevented;
|
|
2995
3011
|
}
|
|
2996
|
-
|
|
3012
|
+
b.event = function(n) {
|
|
2997
3013
|
return $t && (n = $t(n)), n.persist = Ui, n.isPropagationStopped = Wi, n.isDefaultPrevented = Vi, n.nativeEvent = n;
|
|
2998
3014
|
};
|
|
2999
3015
|
var qi = { enumerable: !1, configurable: !0, get: function() {
|
|
3000
3016
|
return this.class;
|
|
3001
|
-
} }, At =
|
|
3002
|
-
|
|
3017
|
+
} }, At = b.vnode;
|
|
3018
|
+
b.vnode = function(n) {
|
|
3003
3019
|
typeof n.type == "string" && function(e) {
|
|
3004
3020
|
var t = e.props, i = e.type, s = {};
|
|
3005
3021
|
for (var o in t) {
|
|
@@ -3016,12 +3032,12 @@ w.vnode = function(n) {
|
|
|
3016
3032
|
})), t.class && !t.className ? (s.class = t.class, Object.defineProperty(s, "className", qi)) : (t.className && !t.class || t.class && t.className) && (s.class = s.className = t.className), e.props = s;
|
|
3017
3033
|
}(n), n.$$typeof = Hi, At && At(n);
|
|
3018
3034
|
};
|
|
3019
|
-
var It =
|
|
3020
|
-
|
|
3035
|
+
var It = b.__r;
|
|
3036
|
+
b.__r = function(n) {
|
|
3021
3037
|
It && It(n), n.__c;
|
|
3022
3038
|
};
|
|
3023
|
-
var Dt =
|
|
3024
|
-
|
|
3039
|
+
var Dt = b.diffed;
|
|
3040
|
+
b.diffed = function(n) {
|
|
3025
3041
|
Dt && Dt(n);
|
|
3026
3042
|
var e = n.props, t = n.__e;
|
|
3027
3043
|
t != null && n.type === "textarea" && "value" in e && e.value !== t.value && (t.value = e.value == null ? "" : e.value);
|
|
@@ -3056,8 +3072,8 @@ typeof window > "u" ? ((fe = function(n) {
|
|
|
3056
3072
|
i.addEventListener("autosize:destroy", u), i.addEventListener("autosize:update", p), i.addEventListener("input", r), window.addEventListener("resize", p), i.style.overflowX = "hidden", i.style.wordWrap = "break-word", _e.set(i, { destroy: u, update: p }), p();
|
|
3057
3073
|
}
|
|
3058
3074
|
function h(l) {
|
|
3059
|
-
var v, _, d = l.restoreTextAlign, f = d === void 0 ? null : d, m = l.testForHeightReduction,
|
|
3060
|
-
if (i.scrollHeight !== 0 && (a.resize === "vertical" ? i.style.resize = "none" : a.resize === "both" && (i.style.resize = "horizontal"),
|
|
3075
|
+
var v, _, d = l.restoreTextAlign, f = d === void 0 ? null : d, m = l.testForHeightReduction, w = m === void 0 || m, g = a.overflowY;
|
|
3076
|
+
if (i.scrollHeight !== 0 && (a.resize === "vertical" ? i.style.resize = "none" : a.resize === "both" && (i.style.resize = "horizontal"), w && (v = function(C) {
|
|
3061
3077
|
for (var S = []; C && C.parentNode && C.parentNode instanceof Element; )
|
|
3062
3078
|
C.parentNode.scrollTop && S.push([C.parentNode, C.parentNode.scrollTop]), C = C.parentNode;
|
|
3063
3079
|
return function() {
|
|
@@ -3417,7 +3433,8 @@ class zt {
|
|
|
3417
3433
|
*/
|
|
3418
3434
|
async resetTopic() {
|
|
3419
3435
|
await this.abortQuestion(), this.topicId && await q.deleteData(E.DATA_BASE_NAME, E.DATA_TABLE_NAME, this.topicId), this.messages.value = [], this.opts.history(this.context, this.params, {
|
|
3420
|
-
appDataEntityId: this.appDataEntityId
|
|
3436
|
+
appDataEntityId: this.appDataEntityId,
|
|
3437
|
+
appendCurData: this.opts.appendCurData
|
|
3421
3438
|
});
|
|
3422
3439
|
}
|
|
3423
3440
|
/**
|
|
@@ -4188,7 +4205,8 @@ const xn = ({
|
|
|
4188
4205
|
}, d.id)))
|
|
4189
4206
|
}), v.current)]
|
|
4190
4207
|
});
|
|
4191
|
-
}
|
|
4208
|
+
};
|
|
4209
|
+
const $ = new M("chat-input"), Ot = window.SpeechRecognition || window.webkitSpeechRecognition, Bt = (n) => {
|
|
4192
4210
|
var f;
|
|
4193
4211
|
const [e, t] = K(!1), i = P(null), s = n.controller.input, o = I(!1), a = P();
|
|
4194
4212
|
Ot && !a.current && (a.current = new Ot(), a.current.onstart = () => {
|
|
@@ -4197,8 +4215,8 @@ const xn = ({
|
|
|
4197
4215
|
o.value = !1;
|
|
4198
4216
|
}, a.current.onresult = (m) => {
|
|
4199
4217
|
var g, T, C;
|
|
4200
|
-
const
|
|
4201
|
-
|
|
4218
|
+
const w = (C = (T = (g = m.results) == null ? void 0 : g[0]) == null ? void 0 : T[0]) == null ? void 0 : C.transcript;
|
|
4219
|
+
w && (s.value = "".concat(s.value).concat(w));
|
|
4202
4220
|
});
|
|
4203
4221
|
const r = () => {
|
|
4204
4222
|
a.current && !o.value && a.current.start();
|
|
@@ -4209,11 +4227,14 @@ const xn = ({
|
|
|
4209
4227
|
i.current && Lt.destroy(i.current);
|
|
4210
4228
|
}), [i]);
|
|
4211
4229
|
const p = Fe(async () => {
|
|
4230
|
+
var m;
|
|
4212
4231
|
try {
|
|
4213
|
-
const
|
|
4214
|
-
s.value = "", await n.controller.question(
|
|
4215
|
-
} catch (
|
|
4216
|
-
console.error(
|
|
4232
|
+
const w = s.value;
|
|
4233
|
+
s.value = "", await n.controller.question(w);
|
|
4234
|
+
} catch (w) {
|
|
4235
|
+
console.error(w);
|
|
4236
|
+
} finally {
|
|
4237
|
+
(m = i.current) == null || m.focus();
|
|
4217
4238
|
}
|
|
4218
4239
|
}, [s]), l = Fe(async () => {
|
|
4219
4240
|
try {
|
|
@@ -4225,8 +4246,8 @@ const xn = ({
|
|
|
4225
4246
|
m.code === "Enter" && !m.isComposing && (m.stopPropagation(), m.shiftKey === !1 && p());
|
|
4226
4247
|
}, _ = async (m) => {
|
|
4227
4248
|
await Ht.getMaterialHelper("ossfile", n.controller).excuteAction(m), t(!1);
|
|
4228
|
-
}, d = async (m,
|
|
4229
|
-
await Ht.getMaterialHelper("common", n.controller).excuteAction(m,
|
|
4249
|
+
}, d = async (m, w) => {
|
|
4250
|
+
await Ht.getMaterialHelper("common", n.controller).excuteAction(m, w), t(!1);
|
|
4230
4251
|
};
|
|
4231
4252
|
return c("div", {
|
|
4232
4253
|
className: $.b("wrapper"),
|
|
@@ -4270,7 +4291,7 @@ const xn = ({
|
|
|
4270
4291
|
children: "文件资料"
|
|
4271
4292
|
})]
|
|
4272
4293
|
}), (f = n.questionToolbarItems) == null ? void 0 : f.map((m) => {
|
|
4273
|
-
var
|
|
4294
|
+
var w, g, T;
|
|
4274
4295
|
return c("div", {
|
|
4275
4296
|
className: $.b("pop-action-item"),
|
|
4276
4297
|
onClick: (C) => {
|
|
@@ -4278,7 +4299,7 @@ const xn = ({
|
|
|
4278
4299
|
},
|
|
4279
4300
|
children: [c("span", {
|
|
4280
4301
|
className: $.b("pop-action-item-icon"),
|
|
4281
|
-
children: typeof m.icon == "function" ? m.icon() : ((
|
|
4302
|
+
children: typeof m.icon == "function" ? m.icon() : ((w = m.icon) == null ? void 0 : w.showIcon) && c(Y, {
|
|
4282
4303
|
children: (g = m.icon) != null && g.cssClass ? c("i", {
|
|
4283
4304
|
className: m.icon.cssClass
|
|
4284
4305
|
}) : (T = m.icon) != null && T.imagePath ? it(m.icon.imagePath) ? c("div", {
|
|
@@ -4334,8 +4355,8 @@ const R = new M("chat-topic-item"), es = (n) => {
|
|
|
4334
4355
|
f.stopPropagation(), s("LINK", f);
|
|
4335
4356
|
}, l = (f, m) => {
|
|
4336
4357
|
f === "DELETE" ? s("DELETE", m) : f === "RENAME" && (h.value = !0, setTimeout(() => {
|
|
4337
|
-
var
|
|
4338
|
-
(
|
|
4358
|
+
var w;
|
|
4359
|
+
(w = o.current) == null || w.focus();
|
|
4339
4360
|
}, 100)), u(!1);
|
|
4340
4361
|
}, v = (f) => {
|
|
4341
4362
|
var m;
|
|
@@ -4492,9 +4513,9 @@ const oe = new M("chat-minimize"), is = (n) => {
|
|
|
4492
4513
|
return d ? d.role === "ASSISTANT" && d.state === 20 && d.completed !== !0 : !1;
|
|
4493
4514
|
}), h = (d) => {
|
|
4494
4515
|
const f = d.indexOf("<think>"), m = d.indexOf("</think>");
|
|
4495
|
-
let
|
|
4496
|
-
return m === -1 ? (
|
|
4497
|
-
thoughtContent:
|
|
4516
|
+
let w = "", g = "";
|
|
4517
|
+
return m === -1 ? (w = d.slice(f + 7), g = "") : (w = d.slice(f + 7, m), g = d.slice(m + 8)), {
|
|
4518
|
+
thoughtContent: w,
|
|
4498
4519
|
answerContent: g
|
|
4499
4520
|
};
|
|
4500
4521
|
}, p = B(() => {
|
|
@@ -4505,9 +4526,9 @@ const oe = new M("chat-minimize"), is = (n) => {
|
|
|
4505
4526
|
if (d = f.content, f.content.indexOf("<think>") !== -1) {
|
|
4506
4527
|
const {
|
|
4507
4528
|
thoughtContent: m,
|
|
4508
|
-
answerContent:
|
|
4529
|
+
answerContent: w
|
|
4509
4530
|
} = h(f.content);
|
|
4510
|
-
d = m +
|
|
4531
|
+
d = m + w;
|
|
4511
4532
|
}
|
|
4512
4533
|
return d;
|
|
4513
4534
|
}), l = () => {
|
|
@@ -4519,11 +4540,11 @@ const oe = new M("chat-minimize"), is = (n) => {
|
|
|
4519
4540
|
const d = e.current;
|
|
4520
4541
|
d && (d.onmousedown = (f) => {
|
|
4521
4542
|
document.body.style.userSelect = "none";
|
|
4522
|
-
const m = f.clientX - d.offsetLeft,
|
|
4543
|
+
const m = f.clientX - d.offsetLeft, w = f.clientY - d.offsetTop, g = Date.now(), T = (S) => {
|
|
4523
4544
|
const O = 56 / window.innerWidth, L = 56 / window.innerHeight, {
|
|
4524
4545
|
x: U,
|
|
4525
4546
|
y: z
|
|
4526
|
-
} = on(S.clientX - m, S.clientY -
|
|
4547
|
+
} = on(S.clientX - m, S.clientY - w, O, L);
|
|
4527
4548
|
Object.assign(r, {
|
|
4528
4549
|
x: U,
|
|
4529
4550
|
y: z
|