@ibiz-template-plugin/ai-chat 0.0.44 → 0.0.46
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
CHANGED
|
@@ -33,16 +33,16 @@ function ys() {
|
|
|
33
33
|
function $e(n) {
|
|
34
34
|
return n.children;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function Ie(n, e) {
|
|
37
37
|
this.props = n, this.context = e;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function Ut(n, e) {
|
|
40
40
|
if (e == null)
|
|
41
|
-
return n.__ ?
|
|
41
|
+
return n.__ ? Ut(n.__, n.__i + 1) : null;
|
|
42
42
|
for (var t; e < n.__k.length; e++)
|
|
43
43
|
if ((t = n.__k[e]) != null && t.__e != null)
|
|
44
44
|
return t.__e;
|
|
45
|
-
return typeof n.type == "function" ?
|
|
45
|
+
return typeof n.type == "function" ? Ut(n) : null;
|
|
46
46
|
}
|
|
47
47
|
function vl(n) {
|
|
48
48
|
var e, t;
|
|
@@ -60,7 +60,7 @@ function cr(n) {
|
|
|
60
60
|
}
|
|
61
61
|
function Kn() {
|
|
62
62
|
for (var n, e, t, i, r, s, o, l = 1; pt.length; )
|
|
63
|
-
pt.length > l && pt.sort(pl), n = pt.shift(), l = pt.length, n.__d && (t = void 0, i = void 0, r = (i = (e = n).__v).__e, s = [], o = [], e.__P && ((t = qe({}, i)).__v = i.__v + 1, D.vnode && D.vnode(t), $r(e.__P, t, i, e.__n, e.__P.namespaceURI, 32 & i.__u ? [r] : null, s, r == null ?
|
|
63
|
+
pt.length > l && pt.sort(pl), n = pt.shift(), l = pt.length, n.__d && (t = void 0, i = void 0, r = (i = (e = n).__v).__e, s = [], o = [], e.__P && ((t = qe({}, i)).__v = i.__v + 1, D.vnode && D.vnode(t), $r(e.__P, t, i, e.__n, e.__P.namespaceURI, 32 & i.__u ? [r] : null, s, r == null ? Ut(i) : r, !!(32 & i.__u), o), t.__v = i.__v, t.__.__k[t.__i] = t, Cl(s, t, o), i.__e = i.__ = null, t.__e != r && vl(t)));
|
|
64
64
|
Kn.__r = 0;
|
|
65
65
|
}
|
|
66
66
|
function bl(n, e, t, i, r, s, o, l, a, c, d) {
|
|
@@ -75,7 +75,7 @@ function ed(n, e, t, i, r) {
|
|
|
75
75
|
(o = e[s]) != null && typeof o != "boolean" && typeof o != "function" ? (a = s + h, (o = n.__k[s] = typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? Hn(null, o, null, null, null) : _n(o) ? Hn($e, { children: o }, null, null, null) : o.constructor == null && o.__b > 0 ? Hn(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : o).__ = n, o.__b = n.__b + 1, l = null, (c = o.__i = td(o, t, a, u)) != -1 && (u--, (l = t[c]) && (l.__u |= 2)), l == null || l.__v == null ? (c == -1 && (r > d ? h-- : r < d && h++), typeof o.type != "function" && (o.__u |= 4)) : c != a && (c == a - 1 ? h-- : c == a + 1 ? h++ : (c > a ? h-- : h++, o.__u |= 4))) : n.__k[s] = null;
|
|
76
76
|
if (u)
|
|
77
77
|
for (s = 0; s < d; s++)
|
|
78
|
-
(l = t[s]) != null && !(2 & l.__u) && (l.__e == i && (i =
|
|
78
|
+
(l = t[s]) != null && !(2 & l.__u) && (l.__e == i && (i = Ut(l)), xl(l, l));
|
|
79
79
|
return i;
|
|
80
80
|
}
|
|
81
81
|
function wl(n, e, t, i) {
|
|
@@ -85,7 +85,7 @@ function wl(n, e, t, i) {
|
|
|
85
85
|
r[s] && (r[s].__ = n, e = wl(r[s], e, t, i));
|
|
86
86
|
return e;
|
|
87
87
|
}
|
|
88
|
-
n.__e != e && (i && (e && n.type && !e.parentNode && (e =
|
|
88
|
+
n.__e != e && (i && (e && n.type && !e.parentNode && (e = Ut(n)), t.insertBefore(n.__e, e || null)), e = n.__e);
|
|
89
89
|
do
|
|
90
90
|
e = e && e.nextSibling;
|
|
91
91
|
while (e != null && e.nodeType == 8);
|
|
@@ -158,12 +158,12 @@ function $r(n, e, t, i, r, s, o, l, a, c) {
|
|
|
158
158
|
e:
|
|
159
159
|
if (typeof me == "function")
|
|
160
160
|
try {
|
|
161
|
-
if (v = e.props, b = "prototype" in me && me.prototype.render, C = (d = me.contextType) && i[d.__c], w = d ? C ? C.props.value : d.__ : i, t.__c ? g = (u = e.__c = t.__c).__ = u.__E : (b ? e.__c = u = new me(v, w) : (e.__c = u = new
|
|
161
|
+
if (v = e.props, b = "prototype" in me && me.prototype.render, C = (d = me.contextType) && i[d.__c], w = d ? C ? C.props.value : d.__ : i, t.__c ? g = (u = e.__c = t.__c).__ = u.__E : (b ? e.__c = u = new me(v, w) : (e.__c = u = new Ie(v, w), u.constructor = me, u.render = id), C && C.sub(u), u.props = v, u.state || (u.state = {}), u.context = w, u.__n = i, h = u.__d = !0, u.__h = [], u._sb = []), b && u.__s == null && (u.__s = u.state), b && me.getDerivedStateFromProps != null && (u.__s == u.state && (u.__s = qe({}, u.__s)), qe(u.__s, me.getDerivedStateFromProps(v, u.__s))), f = u.props, p = u.state, u.__v = e, h)
|
|
162
162
|
b && me.getDerivedStateFromProps == null && u.componentWillMount != null && u.componentWillMount(), b && u.componentDidMount != null && u.__h.push(u.componentDidMount);
|
|
163
163
|
else {
|
|
164
164
|
if (b && me.getDerivedStateFromProps == null && v !== f && u.componentWillReceiveProps != null && u.componentWillReceiveProps(v, w), !u.__e && u.shouldComponentUpdate != null && u.shouldComponentUpdate(v, u.__s, w) === !1 || e.__v == t.__v) {
|
|
165
|
-
for (e.__v != t.__v && (u.props = v, u.state = u.__s, u.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.some(function(
|
|
166
|
-
|
|
165
|
+
for (e.__v != t.__v && (u.props = v, u.state = u.__s, u.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.some(function(Ae) {
|
|
166
|
+
Ae && (Ae.__ = e);
|
|
167
167
|
}), x = 0; x < u._sb.length; x++)
|
|
168
168
|
u.__h.push(u._sb[x]);
|
|
169
169
|
u._sb = [], u.__h.length && o.push(u);
|
|
@@ -182,9 +182,9 @@ function $r(n, e, t, i, r, s, o, l, a, c) {
|
|
|
182
182
|
u.__d = !1, M && M(e), d = u.render(u.props, u.state, u.context), u.state = u.__s;
|
|
183
183
|
while (u.__d && ++_ < 25);
|
|
184
184
|
u.state = u.__s, u.getChildContext != null && (i = qe(qe({}, i), u.getChildContext())), b && !h && u.getSnapshotBeforeUpdate != null && (y = u.getSnapshotBeforeUpdate(f, p)), I = d, d != null && d.type === $e && d.key == null && (I = kl(d.props.children)), l = bl(n, _n(I) ? I : [I], e, t, i, r, s, o, l, a, c), u.base = e.__e, e.__u &= -161, u.__h.length && o.push(u), g && (u.__E = u.__ = null);
|
|
185
|
-
} catch (
|
|
185
|
+
} catch (Ae) {
|
|
186
186
|
if (e.__v = null, a || s != null)
|
|
187
|
-
if (
|
|
187
|
+
if (Ae.then) {
|
|
188
188
|
for (e.__u |= a ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; )
|
|
189
189
|
l = l.nextSibling;
|
|
190
190
|
s[s.indexOf(l)] = null, e.__e = l;
|
|
@@ -194,8 +194,8 @@ function $r(n, e, t, i, r, s, o, l, a, c) {
|
|
|
194
194
|
dr(e);
|
|
195
195
|
}
|
|
196
196
|
else
|
|
197
|
-
e.__e = t.__e, e.__k = t.__k,
|
|
198
|
-
D.__e(
|
|
197
|
+
e.__e = t.__e, e.__k = t.__k, Ae.then || dr(e);
|
|
198
|
+
D.__e(Ae, e, t);
|
|
199
199
|
}
|
|
200
200
|
else
|
|
201
201
|
s == null && e.__v == t.__v ? (e.__k = t.__k, e.__e = t.__e) : l = e.__e = nd(t.__e, e, t, i, r, s, o, a, c);
|
|
@@ -254,7 +254,7 @@ function nd(n, e, t, i, r, s, o, l, a) {
|
|
|
254
254
|
f = v[c], c == "children" ? h = f : c == "dangerouslySetInnerHTML" ? d = f : c == "value" ? p = f : c == "checked" ? y = f : l && typeof f != "function" || g[c] === f || An(n, c, f, g[c], r);
|
|
255
255
|
if (d)
|
|
256
256
|
l || u && (d.__html == u.__html || d.__html == n.innerHTML) || (n.innerHTML = d.__html), e.__k = [];
|
|
257
|
-
else if (u && (n.innerHTML = ""), bl(e.type == "template" ? n.content : n, _n(h) ? h : [h], e, t, i, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : r, s, o, s ? s[0] : t.__k &&
|
|
257
|
+
else if (u && (n.innerHTML = ""), bl(e.type == "template" ? n.content : n, _n(h) ? h : [h], e, t, i, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : r, s, o, s ? s[0] : t.__k && Ut(t, 0), l, a), s != null)
|
|
258
258
|
for (c = s.length; c--; )
|
|
259
259
|
zr(s[c]);
|
|
260
260
|
l || (c = "value", b == "progress" && p == null ? n.removeAttribute("value") : p != null && (p !== n[c] || b == "progress" && !p || b == "option" && p != g[c]) && An(n, c, p, g[c], r), c = "checked", y != null && y != n[c] && An(n, c, y, g[c], r));
|
|
@@ -330,12 +330,12 @@ hi = yl.slice, D = { __e: function(n, e, t, i) {
|
|
|
330
330
|
throw n;
|
|
331
331
|
} }, ul = 0, hl = function(n) {
|
|
332
332
|
return n != null && n.constructor == null;
|
|
333
|
-
},
|
|
333
|
+
}, Ie.prototype.setState = function(n, e) {
|
|
334
334
|
var t;
|
|
335
335
|
t = this.__s != null && this.__s != this.state ? this.__s : this.__s = qe({}, this.state), typeof n == "function" && (n = n(qe({}, t), this.props)), n && qe(t, n), n != null && this.__v && (e && this._sb.push(e), cr(this));
|
|
336
|
-
},
|
|
336
|
+
}, Ie.prototype.forceUpdate = function(n) {
|
|
337
337
|
this.__v && (this.__e = !0, n && this.__h.push(n), cr(this));
|
|
338
|
-
},
|
|
338
|
+
}, Ie.prototype.render = $e, pt = [], fl = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, pl = function(n, e) {
|
|
339
339
|
return n.__v.__b - e.__v.__b;
|
|
340
340
|
}, Kn.__r = 0, ml = /(PointerCapture)$|Capture$/i, Pr = 0, lr = bs(!1), ar = bs(!0), gl = 0;
|
|
341
341
|
var sd = 0;
|
|
@@ -525,7 +525,7 @@ class L {
|
|
|
525
525
|
return "--".concat(this.namespace, "-").concat(this.block, "-").concat(e);
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function Re(n) {
|
|
529
529
|
if (typeof n != "string")
|
|
530
530
|
throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
|
|
531
531
|
}
|
|
@@ -571,30 +571,30 @@ var an = {
|
|
|
571
571
|
resolve: function() {
|
|
572
572
|
for (var e = "", t = !1, i, r = arguments.length - 1; r >= -1 && !t; r--) {
|
|
573
573
|
var s;
|
|
574
|
-
r >= 0 ? s = arguments[r] : (i === void 0 && (i = process.cwd()), s = i),
|
|
574
|
+
r >= 0 ? s = arguments[r] : (i === void 0 && (i = process.cwd()), s = i), Re(s), s.length !== 0 && (e = s + "/" + e, t = s.charCodeAt(0) === 47);
|
|
575
575
|
}
|
|
576
576
|
return e = ws(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
|
|
577
577
|
},
|
|
578
578
|
normalize: function(e) {
|
|
579
|
-
if (
|
|
579
|
+
if (Re(e), e.length === 0)
|
|
580
580
|
return ".";
|
|
581
581
|
var t = e.charCodeAt(0) === 47, i = e.charCodeAt(e.length - 1) === 47;
|
|
582
582
|
return e = ws(e, !t), e.length === 0 && !t && (e = "."), e.length > 0 && i && (e += "/"), t ? "/" + e : e;
|
|
583
583
|
},
|
|
584
584
|
isAbsolute: function(e) {
|
|
585
|
-
return
|
|
585
|
+
return Re(e), e.length > 0 && e.charCodeAt(0) === 47;
|
|
586
586
|
},
|
|
587
587
|
join: function() {
|
|
588
588
|
if (arguments.length === 0)
|
|
589
589
|
return ".";
|
|
590
590
|
for (var e, t = 0; t < arguments.length; ++t) {
|
|
591
591
|
var i = arguments[t];
|
|
592
|
-
|
|
592
|
+
Re(i), i.length > 0 && (e === void 0 ? e = i : e += "/" + i);
|
|
593
593
|
}
|
|
594
594
|
return e === void 0 ? "." : an.normalize(e);
|
|
595
595
|
},
|
|
596
596
|
relative: function(e, t) {
|
|
597
|
-
if (
|
|
597
|
+
if (Re(e), Re(t), e === t || (e = an.resolve(e), t = an.resolve(t), e === t))
|
|
598
598
|
return "";
|
|
599
599
|
for (var i = 1; i < e.length && e.charCodeAt(i) === 47; ++i)
|
|
600
600
|
;
|
|
@@ -625,7 +625,7 @@ var an = {
|
|
|
625
625
|
return e;
|
|
626
626
|
},
|
|
627
627
|
dirname: function(e) {
|
|
628
|
-
if (
|
|
628
|
+
if (Re(e), e.length === 0)
|
|
629
629
|
return ".";
|
|
630
630
|
for (var t = e.charCodeAt(0), i = t === 47, r = -1, s = !0, o = e.length - 1; o >= 1; --o)
|
|
631
631
|
if (t = e.charCodeAt(o), t === 47) {
|
|
@@ -640,7 +640,7 @@ var an = {
|
|
|
640
640
|
basename: function(e, t) {
|
|
641
641
|
if (t !== void 0 && typeof t != "string")
|
|
642
642
|
throw new TypeError('"ext" argument must be a string');
|
|
643
|
-
|
|
643
|
+
Re(e);
|
|
644
644
|
var i = 0, r = -1, s = !0, o;
|
|
645
645
|
if (t !== void 0 && t.length > 0 && t.length <= e.length) {
|
|
646
646
|
if (t.length === e.length && t === e)
|
|
@@ -670,7 +670,7 @@ var an = {
|
|
|
670
670
|
}
|
|
671
671
|
},
|
|
672
672
|
extname: function(e) {
|
|
673
|
-
|
|
673
|
+
Re(e);
|
|
674
674
|
for (var t = -1, i = 0, r = -1, s = !0, o = 0, l = e.length - 1; l >= 0; --l) {
|
|
675
675
|
var a = e.charCodeAt(l);
|
|
676
676
|
if (a === 47) {
|
|
@@ -692,7 +692,7 @@ var an = {
|
|
|
692
692
|
return ad("/", e);
|
|
693
693
|
},
|
|
694
694
|
parse: function(e) {
|
|
695
|
-
|
|
695
|
+
Re(e);
|
|
696
696
|
var t = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
697
697
|
if (e.length === 0)
|
|
698
698
|
return t;
|
|
@@ -1360,17 +1360,17 @@ class yd {
|
|
|
1360
1360
|
return r;
|
|
1361
1361
|
}
|
|
1362
1362
|
}
|
|
1363
|
-
var
|
|
1363
|
+
var Jt, V, Di, Cs, gn = 0, Tl = [], q = D, ks = q.__b, xs = q.__r, Ss = q.diffed, Ms = q.__c, _s = q.unmount, Ts = q.__;
|
|
1364
1364
|
function pi(n, e) {
|
|
1365
1365
|
q.__h && q.__h(V, n, gn || e), gn = 0;
|
|
1366
1366
|
var t = V.__H || (V.__H = { __: [], __h: [] });
|
|
1367
1367
|
return n >= t.__.length && t.__.push({}), t.__[n];
|
|
1368
1368
|
}
|
|
1369
|
-
function
|
|
1369
|
+
function Me(n) {
|
|
1370
1370
|
return gn = 1, vd(El, n);
|
|
1371
1371
|
}
|
|
1372
1372
|
function vd(n, e, t) {
|
|
1373
|
-
var i = pi(
|
|
1373
|
+
var i = pi(Jt++, 2);
|
|
1374
1374
|
if (i.t = n, !i.__c && (i.__ = [t ? t(e) : El(void 0, e), function(l) {
|
|
1375
1375
|
var a = i.__N ? i.__N[0] : i.__[0], c = i.t(a, l);
|
|
1376
1376
|
a !== c && (i.__N = [c, i.__[1]], i.__c.setState({}));
|
|
@@ -1406,25 +1406,25 @@ function vd(n, e, t) {
|
|
|
1406
1406
|
return i.__N || i.__;
|
|
1407
1407
|
}
|
|
1408
1408
|
function K(n, e) {
|
|
1409
|
-
var t = pi(
|
|
1409
|
+
var t = pi(Jt++, 3);
|
|
1410
1410
|
!q.__s && Nl(t.__H, e) && (t.__ = n, t.u = e, V.__H.__h.push(t));
|
|
1411
1411
|
}
|
|
1412
1412
|
function Q(n) {
|
|
1413
|
-
return gn = 5,
|
|
1413
|
+
return gn = 5, Ee(function() {
|
|
1414
1414
|
return { current: n };
|
|
1415
1415
|
}, []);
|
|
1416
1416
|
}
|
|
1417
|
-
function
|
|
1418
|
-
var t = pi(
|
|
1417
|
+
function Ee(n, e) {
|
|
1418
|
+
var t = pi(Jt++, 7);
|
|
1419
1419
|
return Nl(t.__H, e) && (t.__ = n(), t.__H = e, t.__h = n), t.__;
|
|
1420
1420
|
}
|
|
1421
1421
|
function Ns(n, e) {
|
|
1422
|
-
return gn = 8,
|
|
1422
|
+
return gn = 8, Ee(function() {
|
|
1423
1423
|
return n;
|
|
1424
1424
|
}, e);
|
|
1425
1425
|
}
|
|
1426
1426
|
function Br(n) {
|
|
1427
|
-
var e = V.context[n.__c], t = pi(
|
|
1427
|
+
var e = V.context[n.__c], t = pi(Jt++, 9);
|
|
1428
1428
|
return t.c = n, e ? (t.__ == null && (t.__ = !0, e.sub(V)), e.props.value) : n.__;
|
|
1429
1429
|
}
|
|
1430
1430
|
function bd() {
|
|
@@ -1441,11 +1441,11 @@ q.__b = function(n) {
|
|
|
1441
1441
|
}, q.__ = function(n, e) {
|
|
1442
1442
|
n && e.__k && e.__k.__m && (n.__m = e.__k.__m), Ts && Ts(n, e);
|
|
1443
1443
|
}, q.__r = function(n) {
|
|
1444
|
-
xs && xs(n),
|
|
1444
|
+
xs && xs(n), Jt = 0;
|
|
1445
1445
|
var e = (V = n.__c).__H;
|
|
1446
1446
|
e && (Di === V ? (e.__h = [], V.__h = [], e.__.forEach(function(t) {
|
|
1447
1447
|
t.__N && (t.__ = t.__N), t.u = t.__N = void 0;
|
|
1448
|
-
})) : (e.__h.forEach(Wn), e.__h.forEach(fr), e.__h = [],
|
|
1448
|
+
})) : (e.__h.forEach(Wn), e.__h.forEach(fr), e.__h = [], Jt = 0)), Di = V;
|
|
1449
1449
|
}, q.diffed = function(n) {
|
|
1450
1450
|
Ss && Ss(n);
|
|
1451
1451
|
var e = n.__c;
|
|
@@ -1500,8 +1500,8 @@ function El(n, e) {
|
|
|
1500
1500
|
}
|
|
1501
1501
|
var Cd = Symbol.for("preact-signals");
|
|
1502
1502
|
function Fr() {
|
|
1503
|
-
if (
|
|
1504
|
-
|
|
1503
|
+
if (Ht > 1)
|
|
1504
|
+
Ht--;
|
|
1505
1505
|
else {
|
|
1506
1506
|
for (var n, e = !1; cn !== void 0; ) {
|
|
1507
1507
|
var t = cn;
|
|
@@ -1516,7 +1516,7 @@ function Fr() {
|
|
|
1516
1516
|
t = i;
|
|
1517
1517
|
}
|
|
1518
1518
|
}
|
|
1519
|
-
if (pr = 0,
|
|
1519
|
+
if (pr = 0, Ht--, e)
|
|
1520
1520
|
throw n;
|
|
1521
1521
|
}
|
|
1522
1522
|
}
|
|
@@ -1530,7 +1530,7 @@ function Al(n) {
|
|
|
1530
1530
|
z = e;
|
|
1531
1531
|
}
|
|
1532
1532
|
}
|
|
1533
|
-
var cn = void 0,
|
|
1533
|
+
var cn = void 0, Ht = 0, pr = 0, Xn = 0;
|
|
1534
1534
|
function Ol(n) {
|
|
1535
1535
|
if (z !== void 0) {
|
|
1536
1536
|
var e = n.n;
|
|
@@ -1601,7 +1601,7 @@ Object.defineProperty(oe.prototype, "value", { get: function() {
|
|
|
1601
1601
|
if (n !== this.v) {
|
|
1602
1602
|
if (pr > 100)
|
|
1603
1603
|
throw new Error("Cycle detected");
|
|
1604
|
-
this.v = n, this.i++, Xn++,
|
|
1604
|
+
this.v = n, this.i++, Xn++, Ht++;
|
|
1605
1605
|
try {
|
|
1606
1606
|
for (var e = this.t; e !== void 0; e = e.x)
|
|
1607
1607
|
e.t.N();
|
|
@@ -1692,7 +1692,7 @@ function Pl(n, e) {
|
|
|
1692
1692
|
function zl(n) {
|
|
1693
1693
|
var e = n.u;
|
|
1694
1694
|
if (n.u = void 0, typeof e == "function") {
|
|
1695
|
-
|
|
1695
|
+
Ht++;
|
|
1696
1696
|
var t = z;
|
|
1697
1697
|
z = void 0;
|
|
1698
1698
|
try {
|
|
@@ -1714,10 +1714,10 @@ function kd(n) {
|
|
|
1714
1714
|
throw new Error("Out-of-order effect");
|
|
1715
1715
|
Rl(this), z = n, this.f &= -2, 8 & this.f && Vr(this), Fr();
|
|
1716
1716
|
}
|
|
1717
|
-
function
|
|
1717
|
+
function Qt(n, e) {
|
|
1718
1718
|
this.x = n, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32, this.name = e == null ? void 0 : e.name;
|
|
1719
1719
|
}
|
|
1720
|
-
|
|
1720
|
+
Qt.prototype.c = function() {
|
|
1721
1721
|
var n = this.S();
|
|
1722
1722
|
try {
|
|
1723
1723
|
if (8 & this.f || this.x === void 0)
|
|
@@ -1728,24 +1728,24 @@ Zt.prototype.c = function() {
|
|
|
1728
1728
|
n();
|
|
1729
1729
|
}
|
|
1730
1730
|
};
|
|
1731
|
-
|
|
1731
|
+
Qt.prototype.S = function() {
|
|
1732
1732
|
if (1 & this.f)
|
|
1733
1733
|
throw new Error("Cycle detected");
|
|
1734
|
-
this.f |= 1, this.f &= -9, zl(this), Il(this),
|
|
1734
|
+
this.f |= 1, this.f &= -9, zl(this), Il(this), Ht++;
|
|
1735
1735
|
var n = z;
|
|
1736
1736
|
return z = this, kd.bind(this, n);
|
|
1737
1737
|
};
|
|
1738
|
-
|
|
1738
|
+
Qt.prototype.N = function() {
|
|
1739
1739
|
2 & this.f || (this.f |= 2, this.o = cn, cn = this);
|
|
1740
1740
|
};
|
|
1741
|
-
|
|
1741
|
+
Qt.prototype.d = function() {
|
|
1742
1742
|
this.f |= 8, 1 & this.f || Vr(this);
|
|
1743
1743
|
};
|
|
1744
|
-
|
|
1744
|
+
Qt.prototype.dispose = function() {
|
|
1745
1745
|
this.d();
|
|
1746
1746
|
};
|
|
1747
1747
|
function Hr(n, e) {
|
|
1748
|
-
var t = new
|
|
1748
|
+
var t = new Qt(n, e);
|
|
1749
1749
|
try {
|
|
1750
1750
|
t.c();
|
|
1751
1751
|
} catch (r) {
|
|
@@ -1755,7 +1755,7 @@ function Hr(n, e) {
|
|
|
1755
1755
|
return i[Symbol.dispose] = i, i;
|
|
1756
1756
|
}
|
|
1757
1757
|
var mi, Ii;
|
|
1758
|
-
function
|
|
1758
|
+
function en(n, e) {
|
|
1759
1759
|
D[n] = e.bind(null, D[n] || function() {
|
|
1760
1760
|
});
|
|
1761
1761
|
}
|
|
@@ -1765,7 +1765,7 @@ function Gn(n) {
|
|
|
1765
1765
|
function $l(n) {
|
|
1766
1766
|
var e = this, t = n.data, i = F(t);
|
|
1767
1767
|
i.value = t;
|
|
1768
|
-
var r =
|
|
1768
|
+
var r = Ee(function() {
|
|
1769
1769
|
for (var s = e.__v; s = s.__; )
|
|
1770
1770
|
if (s.__c) {
|
|
1771
1771
|
s.__c.__$f |= 4;
|
|
@@ -1785,7 +1785,7 @@ $l.displayName = "_st";
|
|
|
1785
1785
|
Object.defineProperties(oe.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: $l }, props: { configurable: !0, get: function() {
|
|
1786
1786
|
return { data: this };
|
|
1787
1787
|
} }, __b: { configurable: !0, value: 1 } });
|
|
1788
|
-
|
|
1788
|
+
en("__b", function(n, e) {
|
|
1789
1789
|
if (typeof e.type == "string") {
|
|
1790
1790
|
var t, i = e.props;
|
|
1791
1791
|
for (var r in i)
|
|
@@ -1796,7 +1796,7 @@ Qt("__b", function(n, e) {
|
|
|
1796
1796
|
}
|
|
1797
1797
|
n(e);
|
|
1798
1798
|
});
|
|
1799
|
-
|
|
1799
|
+
en("__r", function(n, e) {
|
|
1800
1800
|
Gn();
|
|
1801
1801
|
var t, i = e.__c;
|
|
1802
1802
|
i && (i.__$f &= -2, (t = i.__$u) === void 0 && (i.__$u = t = function(r) {
|
|
@@ -1808,10 +1808,10 @@ Qt("__r", function(n, e) {
|
|
|
1808
1808
|
}, s;
|
|
1809
1809
|
}())), mi = i, Gn(t), n(e);
|
|
1810
1810
|
});
|
|
1811
|
-
|
|
1811
|
+
en("__e", function(n, e, t, i) {
|
|
1812
1812
|
Gn(), mi = void 0, n(e, t, i);
|
|
1813
1813
|
});
|
|
1814
|
-
|
|
1814
|
+
en("diffed", function(n, e) {
|
|
1815
1815
|
Gn(), mi = void 0;
|
|
1816
1816
|
var t;
|
|
1817
1817
|
if (typeof e.type == "string" && (t = e.__e)) {
|
|
@@ -1842,7 +1842,7 @@ function xd(n, e, t, i) {
|
|
|
1842
1842
|
i[e] !== o && (i[e] = o, r ? n[e] = o : o ? n.setAttribute(e, o) : n.removeAttribute(e));
|
|
1843
1843
|
}) };
|
|
1844
1844
|
}
|
|
1845
|
-
|
|
1845
|
+
en("unmount", function(n, e) {
|
|
1846
1846
|
if (typeof e.type == "string") {
|
|
1847
1847
|
var t = e.__e;
|
|
1848
1848
|
if (t) {
|
|
@@ -1864,10 +1864,10 @@ Qt("unmount", function(n, e) {
|
|
|
1864
1864
|
}
|
|
1865
1865
|
n(e);
|
|
1866
1866
|
});
|
|
1867
|
-
|
|
1867
|
+
en("__h", function(n, e, t, i) {
|
|
1868
1868
|
(i < 3 || i === 9) && (e.__$f |= 2), n(e, t, i);
|
|
1869
1869
|
});
|
|
1870
|
-
|
|
1870
|
+
Ie.prototype.shouldComponentUpdate = function(n, e) {
|
|
1871
1871
|
var t = this.__$u, i = t && t.s !== void 0;
|
|
1872
1872
|
for (var r in e)
|
|
1873
1873
|
return !0;
|
|
@@ -1885,13 +1885,13 @@ De.prototype.shouldComponentUpdate = function(n, e) {
|
|
|
1885
1885
|
return !1;
|
|
1886
1886
|
};
|
|
1887
1887
|
function F(n) {
|
|
1888
|
-
return
|
|
1888
|
+
return Ee(function() {
|
|
1889
1889
|
return je(n);
|
|
1890
1890
|
}, []);
|
|
1891
1891
|
}
|
|
1892
1892
|
function ye(n) {
|
|
1893
1893
|
var e = Q(n);
|
|
1894
|
-
return e.current = n, mi.__$f |= 4,
|
|
1894
|
+
return e.current = n, mi.__$f |= 4, Ee(function() {
|
|
1895
1895
|
return Pl(function() {
|
|
1896
1896
|
return e.current();
|
|
1897
1897
|
});
|
|
@@ -2563,9 +2563,9 @@ const be = new L("chat-select"), su = (n) => {
|
|
|
2563
2563
|
placeholder: s = "请选择",
|
|
2564
2564
|
onChange: o,
|
|
2565
2565
|
disabled: l = !1
|
|
2566
|
-
} = n, a = Q(null), c = Q(null), [d, u] =
|
|
2566
|
+
} = n, a = Q(null), c = Q(null), [d, u] = Me(
|
|
2567
2567
|
t || i || ""
|
|
2568
|
-
), [h, f] =
|
|
2568
|
+
), [h, f] = Me(!1);
|
|
2569
2569
|
K(() => {
|
|
2570
2570
|
t !== void 0 && u(t);
|
|
2571
2571
|
}, [t]);
|
|
@@ -2651,7 +2651,7 @@ const zi = new L("messsage-toolbar"), ou = (n) => {
|
|
|
2651
2651
|
}
|
|
2652
2652
|
) : /* @__PURE__ */ m("img", { src: l.icon.imagePath });
|
|
2653
2653
|
};
|
|
2654
|
-
return
|
|
2654
|
+
return Ee(() => t.state === 20 && t.completed !== !0 || e.resourceMode !== "REMOTE" || !t.realmessageid || e.currentTopicDisableStorage, [t.state, t.completed]) ? /* @__PURE__ */ m($e, {}) : /* @__PURE__ */ m("div", { className: "".concat(zi.b()), children: i.map((l, a) => {
|
|
2655
2655
|
const c = l.id === "islike" && t.islike === "1" || l.id === "isdislike" && t.isdislike === "1";
|
|
2656
2656
|
return /* @__PURE__ */ m(
|
|
2657
2657
|
"div",
|
|
@@ -2666,7 +2666,7 @@ const zi = new L("messsage-toolbar"), ou = (n) => {
|
|
|
2666
2666
|
}) });
|
|
2667
2667
|
};
|
|
2668
2668
|
const ht = new L("markdown-message"), lu = (n) => {
|
|
2669
|
-
const { message: e, size: t } = n, i = F(We()), r = F(null), s =
|
|
2669
|
+
const { message: e, size: t } = n, i = F(We()), r = F(null), s = Ee(() => e.state === 20 && e.completed !== !0, [e.state, e.completed]), o = Ee(() => e.state === 20 && e.completed === !0, [e.state, e.completed]), l = F({
|
|
2670
2670
|
title: "",
|
|
2671
2671
|
description: "",
|
|
2672
2672
|
icon: /* @__PURE__ */ m(Pi, {})
|
|
@@ -2809,13 +2809,13 @@ const Dt = new L("ossfile-material"), au = (n) => {
|
|
|
2809
2809
|
] })
|
|
2810
2810
|
] });
|
|
2811
2811
|
};
|
|
2812
|
-
const
|
|
2812
|
+
const nn = new L("common-material"), cu = (n) => {
|
|
2813
2813
|
var i, r, s, o;
|
|
2814
2814
|
const e = (i = n.controller.opts.questionToolbarItems) == null ? void 0 : i.find(
|
|
2815
2815
|
(l) => l.id === n.material.metadata.actionId
|
|
2816
2816
|
), t = ye(() => n.material.metadata.name);
|
|
2817
|
-
return /* @__PURE__ */ m("div", { className:
|
|
2818
|
-
/* @__PURE__ */ m("div", { className:
|
|
2817
|
+
return /* @__PURE__ */ m("div", { className: nn.b(), children: [
|
|
2818
|
+
/* @__PURE__ */ m("div", { className: nn.b("left"), children: e && e.icon ? typeof e.icon == "function" ? e.icon() : ((r = e.icon) == null ? void 0 : r.showIcon) && /* @__PURE__ */ m($e, { children: (s = e.icon) != null && s.cssClass ? /* @__PURE__ */ m("i", { className: e.icon.cssClass }) : (o = e.icon) != null && o.imagePath ? fi(e.icon.imagePath) ? /* @__PURE__ */ m(
|
|
2819
2819
|
"div",
|
|
2820
2820
|
{
|
|
2821
2821
|
dangerouslySetInnerHTML: {
|
|
@@ -2823,9 +2823,9 @@ const tn = new L("common-material"), cu = (n) => {
|
|
|
2823
2823
|
}
|
|
2824
2824
|
}
|
|
2825
2825
|
) : /* @__PURE__ */ m("img", { src: e.icon.imagePath }) : null }) : /* @__PURE__ */ m(Vd, {}) }),
|
|
2826
|
-
/* @__PURE__ */ m("div", { className:
|
|
2827
|
-
/* @__PURE__ */ m("div", { className:
|
|
2828
|
-
/* @__PURE__ */ m("div", { className:
|
|
2826
|
+
/* @__PURE__ */ m("div", { className: nn.b("right"), children: [
|
|
2827
|
+
/* @__PURE__ */ m("div", { className: nn.e("name"), title: t, children: t }),
|
|
2828
|
+
/* @__PURE__ */ m("div", { className: nn.e("metadata"), children: /* @__PURE__ */ m("div", { children: (e == null ? void 0 : e.label) || "素材资源" }) })
|
|
2829
2829
|
] })
|
|
2830
2830
|
] });
|
|
2831
2831
|
};
|
|
@@ -2850,9 +2850,9 @@ const $i = new L("chat-input-material-item"), Fl = (n) => {
|
|
|
2850
2850
|
})
|
|
2851
2851
|
] });
|
|
2852
2852
|
};
|
|
2853
|
-
const
|
|
2853
|
+
const ke = new L("user-message-question"), du = (n) => {
|
|
2854
2854
|
const e = F(We()), t = F(null), i = F(135), r = F(!0), s = F(!1), o = Q(null), l = ye(() => n.message.content), a = ye(() => ur.parseMixedContent(l.value));
|
|
2855
|
-
|
|
2855
|
+
K(() => {
|
|
2856
2856
|
t.value = new dl({
|
|
2857
2857
|
id: e,
|
|
2858
2858
|
value: a.value.remainingText || "",
|
|
@@ -2880,66 +2880,112 @@ const Re = new L("user-message-question"), du = (n) => {
|
|
|
2880
2880
|
}, [a.value.remainingText]), K(() => {
|
|
2881
2881
|
if (!o.current || !window.ResizeObserver)
|
|
2882
2882
|
return;
|
|
2883
|
-
const
|
|
2884
|
-
var
|
|
2885
|
-
const
|
|
2886
|
-
|
|
2883
|
+
const d = new ResizeObserver(() => {
|
|
2884
|
+
var h;
|
|
2885
|
+
const u = (h = t.value) == null ? void 0 : h.previewer.options.previewerDom;
|
|
2886
|
+
u && (s.value = u.scrollHeight > i.value);
|
|
2887
2887
|
});
|
|
2888
|
-
return
|
|
2889
|
-
|
|
2888
|
+
return d.observe(o.current), () => {
|
|
2889
|
+
d.disconnect();
|
|
2890
2890
|
};
|
|
2891
|
-
}, [o.current])
|
|
2892
|
-
|
|
2891
|
+
}, [o.current]);
|
|
2892
|
+
const c = (d) => {
|
|
2893
|
+
!n.message || !n.controller || n.controller.refreshMessage(n.message, !0);
|
|
2894
|
+
};
|
|
2895
|
+
return /* @__PURE__ */ m("div", { className: ke.b(), children: [
|
|
2896
|
+
/* @__PURE__ */ m("div", { className: ke.e("user-header"), children: [
|
|
2893
2897
|
n.children,
|
|
2894
|
-
/* @__PURE__ */ m("div", { className:
|
|
2898
|
+
/* @__PURE__ */ m("div", { className: ke.e("user"), children: "我" })
|
|
2895
2899
|
] }),
|
|
2896
|
-
/* @__PURE__ */ m("div", { className:
|
|
2897
|
-
|
|
2898
|
-
|
|
2900
|
+
/* @__PURE__ */ m("div", { className: ke.e("content"), children: [
|
|
2901
|
+
n.message.state === 40 && /* @__PURE__ */ m(
|
|
2902
|
+
"div",
|
|
2899
2903
|
{
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
)) }),
|
|
2906
|
-
/* @__PURE__ */ m("div", { className: "pre-wrap-container", children: [
|
|
2907
|
-
/* @__PURE__ */ m(
|
|
2908
|
-
"div",
|
|
2909
|
-
{
|
|
2910
|
-
className: "".concat(Re.e("text-content"), " ").concat(Re.is("collapse", r.value)),
|
|
2911
|
-
id: e,
|
|
2912
|
-
ref: o,
|
|
2913
|
-
style: {
|
|
2914
|
-
maxHeight: r.value ? "".concat(i.value, "px") : ""
|
|
2915
|
-
}
|
|
2916
|
-
}
|
|
2917
|
-
),
|
|
2918
|
-
/* @__PURE__ */ m(
|
|
2919
|
-
"div",
|
|
2920
|
-
{
|
|
2921
|
-
className: "".concat(Re.e("collapse-btn"), " ").concat(Re.is("visible", s.value)),
|
|
2922
|
-
title: r.value ? "展开" : "收起",
|
|
2923
|
-
onClick: () => {
|
|
2924
|
-
r.value = !r.value;
|
|
2925
|
-
},
|
|
2926
|
-
children: r.value ? /* @__PURE__ */ m("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024", children: /* @__PURE__ */ m(
|
|
2927
|
-
"path",
|
|
2904
|
+
className: ke.em("content", "warning-container"),
|
|
2905
|
+
onClick: c,
|
|
2906
|
+
children: /* @__PURE__ */ m("div", { className: ke.em("content", "warning"), children: [
|
|
2907
|
+
/* @__PURE__ */ m(
|
|
2908
|
+
"svg",
|
|
2928
2909
|
{
|
|
2929
|
-
|
|
2930
|
-
|
|
2910
|
+
className: "warning-icon",
|
|
2911
|
+
viewBox: "0 0 1024 1024",
|
|
2912
|
+
version: "1.1",
|
|
2913
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2914
|
+
width: "16",
|
|
2915
|
+
height: "16",
|
|
2916
|
+
children: /* @__PURE__ */ m(
|
|
2917
|
+
"path",
|
|
2918
|
+
{
|
|
2919
|
+
d: "M934.4 770.133333L605.866667 181.333333C586.666667 147.2 550.4 128 512 128s-74.666667 21.333333-93.866667 53.333333L89.6 770.133333c-19.2 34.133333-19.2 76.8 0 110.933334S145.066667 938.666667 183.466667 938.666667h657.066666c40.533333 0 74.666667-21.333333 93.866667-57.6 19.2-34.133333 19.2-76.8 0-110.933334zM480 362.666667c0-17.066667 14.933333-32 32-32s29.866667 12.8 32 29.866666V640c0 17.066667-14.933333 32-32 32s-29.866667-12.8-32-29.866667V362.666667zM512 832c-23.466667 0-42.666667-19.2-42.666667-42.666667s19.2-42.666667 42.666667-42.666666 42.666667 19.2 42.666667 42.666666-19.2 42.666667-42.666667 42.666667z",
|
|
2920
|
+
fill: "red"
|
|
2921
|
+
}
|
|
2922
|
+
)
|
|
2931
2923
|
}
|
|
2932
|
-
)
|
|
2933
|
-
|
|
2924
|
+
),
|
|
2925
|
+
/* @__PURE__ */ m(
|
|
2926
|
+
"svg",
|
|
2934
2927
|
{
|
|
2935
|
-
|
|
2936
|
-
|
|
2928
|
+
title: "刷新",
|
|
2929
|
+
className: "refresh-icon",
|
|
2930
|
+
viewBox: "0 0 1024 1024",
|
|
2931
|
+
version: "1.1",
|
|
2932
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2933
|
+
width: "16",
|
|
2934
|
+
height: "16",
|
|
2935
|
+
children: /* @__PURE__ */ m("path", { d: "M511.582491 63.413262C265.134543 63.413262 64.62588 263.921925 64.62588 510.369873s200.508663 446.957635 446.957635 446.957635 446.957635-200.508663 446.957635-446.957635S758.031463 63.413262 511.582491 63.413262zM509.001713 751.859903c-98.517781 0-182.467775-62.623269-214.771505-150.056598l0.327458-0.134053c-2.007727-4.036943-3.38305-8.422833-3.38305-13.237489 0-16.647145 13.494339-30.142507 30.142507-30.142507 13.389962 0 24.358781 8.877181 28.2893 20.955264l0.422625-0.172939c23.269983 65.442478 85.645612 112.503307 158.972665 112.503307 93.106538 0 168.845523-75.738985 168.845523-168.845523s-75.738985-168.845523-168.845523-168.845523c-20.432355 0-39.874149 3.980661-58.013275 10.66899l21.248953 40.742936c2.486634 2.677992 4.0175 6.2831 4.0175 10.243295 0 8.417717-8.404414 14.921851-15.365966 15.07023-0.102331 0-0.206708 0-0.309038 0-0.220011 0-0.427742 0-0.647753-0.013303l-150.579507-6.463202c-5.372358-0.234337-10.229992-3.310396-12.716626-8.093329-2.486634-4.76963-2.236947-10.509355 0.647753-15.055904l80.890308-127.179564c2.8847-4.533246 8.006348-7.151887 13.365402-6.960529 5.372358 0.234337 10.227945 3.312442 12.71458 8.095375l18.580171 35.625382c26.629497-10.855232 55.683207-16.963347 86.168522-16.963347 126.338407 0 229.130537 102.791108 229.130537 229.130537S635.340119 751.859903 509.001713 751.859903z" })
|
|
2937
2936
|
}
|
|
2938
|
-
)
|
|
2939
|
-
}
|
|
2940
|
-
|
|
2937
|
+
)
|
|
2938
|
+
] })
|
|
2939
|
+
}
|
|
2940
|
+
),
|
|
2941
|
+
/* @__PURE__ */ m("div", { className: ke.em("content", "body"), children: [
|
|
2942
|
+
a.value.hasResources && /* @__PURE__ */ m("div", { className: ke.em("content", "material"), children: a.value.resources.map((d) => /* @__PURE__ */ m(
|
|
2943
|
+
Fl,
|
|
2944
|
+
{
|
|
2945
|
+
material: d,
|
|
2946
|
+
disabled: !0,
|
|
2947
|
+
controller: n.controller
|
|
2948
|
+
},
|
|
2949
|
+
d.id
|
|
2950
|
+
)) }),
|
|
2951
|
+
/* @__PURE__ */ m("div", { className: "pre-wrap-container", children: [
|
|
2952
|
+
/* @__PURE__ */ m(
|
|
2953
|
+
"div",
|
|
2954
|
+
{
|
|
2955
|
+
className: "".concat(ke.e("text-content"), " ").concat(ke.is("collapse", r.value)),
|
|
2956
|
+
id: e,
|
|
2957
|
+
ref: o,
|
|
2958
|
+
style: {
|
|
2959
|
+
maxHeight: r.value ? "".concat(i.value, "px") : ""
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
),
|
|
2963
|
+
/* @__PURE__ */ m(
|
|
2964
|
+
"div",
|
|
2965
|
+
{
|
|
2966
|
+
className: "".concat(ke.e("collapse-btn"), " ").concat(ke.is("visible", s.value)),
|
|
2967
|
+
title: r.value ? "展开" : "收起",
|
|
2968
|
+
onClick: () => {
|
|
2969
|
+
r.value = !r.value;
|
|
2970
|
+
},
|
|
2971
|
+
children: r.value ? /* @__PURE__ */ m("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024", children: /* @__PURE__ */ m(
|
|
2972
|
+
"path",
|
|
2973
|
+
{
|
|
2974
|
+
fill: "currentColor",
|
|
2975
|
+
d: "M104.704 338.752a64 64 0 0 1 90.496 0l316.8 316.8 316.8-316.8a64 64 0 0 1 90.496 90.496L557.248 791.296a64 64 0 0 1-90.496 0L104.704 429.248a64 64 0 0 1 0-90.496"
|
|
2976
|
+
}
|
|
2977
|
+
) }) : /* @__PURE__ */ m("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024", children: /* @__PURE__ */ m(
|
|
2978
|
+
"path",
|
|
2979
|
+
{
|
|
2980
|
+
fill: "currentColor",
|
|
2981
|
+
d: "M104.704 685.248a64 64 0 0 0 90.496 0l316.8-316.8 316.8 316.8a64 64 0 0 0 90.496-90.496L557.248 232.704a64 64 0 0 0-90.496 0L104.704 594.752a64 64 0 0 0 0 90.496"
|
|
2982
|
+
}
|
|
2983
|
+
) })
|
|
2984
|
+
}
|
|
2985
|
+
)
|
|
2986
|
+
] })
|
|
2941
2987
|
] })
|
|
2942
|
-
] })
|
|
2988
|
+
] })
|
|
2943
2989
|
] });
|
|
2944
2990
|
};
|
|
2945
2991
|
const On = new L("error-message"), uu = (n) => {
|
|
@@ -3071,7 +3117,7 @@ class ft {
|
|
|
3071
3117
|
this.toolcalls = yd.parse(this.allcontent);
|
|
3072
3118
|
}
|
|
3073
3119
|
}
|
|
3074
|
-
class
|
|
3120
|
+
class It {
|
|
3075
3121
|
constructor(e) {
|
|
3076
3122
|
this.data = e;
|
|
3077
3123
|
}
|
|
@@ -3164,7 +3210,7 @@ const ge = new L("chat-toolbar-item"), gu = (n) => {
|
|
|
3164
3210
|
disabled: r = !1,
|
|
3165
3211
|
buttonType: s = "default",
|
|
3166
3212
|
onClick: o
|
|
3167
|
-
} = n, [l, a] =
|
|
3213
|
+
} = n, [l, a] = Me(!1), c = Q(null), d = (b) => typeof b.hidden == "function" ? b.hidden(t) : b.hidden === !0;
|
|
3168
3214
|
if (d(e))
|
|
3169
3215
|
return /* @__PURE__ */ m($e, {});
|
|
3170
3216
|
const u = (b) => r ? !0 : typeof b.disabled == "function" ? b.disabled(t) : b.disabled === !0, h = (b) => {
|
|
@@ -3354,7 +3400,7 @@ const yu = new L("chat-toolbar"), mr = (n) => {
|
|
|
3354
3400
|
v
|
|
3355
3401
|
);
|
|
3356
3402
|
}
|
|
3357
|
-
}, p =
|
|
3403
|
+
}, p = Ee(() => r === "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]);
|
|
3358
3404
|
return /* @__PURE__ */ m("div", { className: "".concat(yu.b(), " ").concat(s || ""), children: c.map((y, g) => /* @__PURE__ */ m(
|
|
3359
3405
|
gu,
|
|
3360
3406
|
{
|
|
@@ -3388,7 +3434,7 @@ const bu = (n) => {
|
|
|
3388
3434
|
behavior: "smooth"
|
|
3389
3435
|
}), (a = n.onClick) == null || a.call(n));
|
|
3390
3436
|
}, l = vu(s, 300);
|
|
3391
|
-
return
|
|
3437
|
+
return Ee(() => {
|
|
3392
3438
|
t.value = {
|
|
3393
3439
|
right: "".concat(n.right, "px"),
|
|
3394
3440
|
bottom: "".concat(n.bottom, "px")
|
|
@@ -3410,10 +3456,10 @@ const bu = (n) => {
|
|
|
3410
3456
|
);
|
|
3411
3457
|
};
|
|
3412
3458
|
const Is = new L("chat-messages"), Rs = (n) => {
|
|
3413
|
-
const e = Q(null), t = 5, [i, r] =
|
|
3459
|
+
const e = Q(null), t = 5, [i, r] = Me(t), [s, o] = Me(!1), [l, a] = Me(!0), c = Q(!1), d = n.controller.messages, u = Ee(() => {
|
|
3414
3460
|
const g = Math.max(0, d.value.length - i);
|
|
3415
3461
|
return d.value.slice(g);
|
|
3416
|
-
}, [d.value, i]), h =
|
|
3462
|
+
}, [d.value, i]), h = Ee(() => i < d.value.length, [d.value, i]), f = () => {
|
|
3417
3463
|
const g = e.current;
|
|
3418
3464
|
g && (c.current = !0, g.scrollTo({
|
|
3419
3465
|
top: g.scrollHeight,
|
|
@@ -3471,7 +3517,7 @@ const Is = new L("chat-messages"), Rs = (n) => {
|
|
|
3471
3517
|
}
|
|
3472
3518
|
)
|
|
3473
3519
|
},
|
|
3474
|
-
g.messageid
|
|
3520
|
+
"".concat(g.messageid, "_").concat(g.completed ? "completed" : "incomplete")
|
|
3475
3521
|
) : null;
|
|
3476
3522
|
}),
|
|
3477
3523
|
/* @__PURE__ */ m(
|
|
@@ -3502,7 +3548,7 @@ function Ps(n, e) {
|
|
|
3502
3548
|
function zs(n, e) {
|
|
3503
3549
|
this.props = n, this.context = e;
|
|
3504
3550
|
}
|
|
3505
|
-
(zs.prototype = new
|
|
3551
|
+
(zs.prototype = new Ie()).isPureReactComponent = !0, zs.prototype.shouldComponentUpdate = function(n, e) {
|
|
3506
3552
|
return Ps(this.props, n) || Ps(this.state, e);
|
|
3507
3553
|
};
|
|
3508
3554
|
var $s = D.__b;
|
|
@@ -3544,7 +3590,7 @@ function Dn() {
|
|
|
3544
3590
|
D.unmount = function(n) {
|
|
3545
3591
|
var e = n.__c;
|
|
3546
3592
|
e && e.__R && e.__R(), e && 32 & n.__u && (n.type = null), Ls && Ls(n);
|
|
3547
|
-
}, (Bi.prototype = new
|
|
3593
|
+
}, (Bi.prototype = new Ie()).__c = function(n, e) {
|
|
3548
3594
|
var t = e.__c, i = this;
|
|
3549
3595
|
i.o == null && (i.o = []), i.o.push(t);
|
|
3550
3596
|
var r = Wl(i.__v), s = !1, o = function() {
|
|
@@ -3612,7 +3658,7 @@ function Su(n, e) {
|
|
|
3612
3658
|
var t = ze(xu, { __v: n, h: e });
|
|
3613
3659
|
return t.containerInfo = e, t;
|
|
3614
3660
|
}
|
|
3615
|
-
(Dn.prototype = new
|
|
3661
|
+
(Dn.prototype = new Ie()).__a = function(n) {
|
|
3616
3662
|
var e = this, t = Wl(e.__v), i = e.l.get(n);
|
|
3617
3663
|
return i[0]++, function(r) {
|
|
3618
3664
|
var s = function() {
|
|
@@ -3636,8 +3682,8 @@ function Su(n, e) {
|
|
|
3636
3682
|
var Mu = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, _u = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, Tu = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Nu = /[A-Z0-9]/g, Eu = typeof document < "u", Au = function(n) {
|
|
3637
3683
|
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(n);
|
|
3638
3684
|
};
|
|
3639
|
-
|
|
3640
|
-
Object.defineProperty(
|
|
3685
|
+
Ie.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(n) {
|
|
3686
|
+
Object.defineProperty(Ie.prototype, n, { configurable: !0, get: function() {
|
|
3641
3687
|
return this["UNSAFE_" + n];
|
|
3642
3688
|
}, set: function(e) {
|
|
3643
3689
|
Object.defineProperty(this, n, { configurable: !0, writable: !0, value: e });
|
|
@@ -4225,7 +4271,14 @@ class js {
|
|
|
4225
4271
|
const i = this.messages.value.findIndex(
|
|
4226
4272
|
(r) => r.messageid === e.messageid
|
|
4227
4273
|
);
|
|
4228
|
-
if (t)
|
|
4274
|
+
if (t) {
|
|
4275
|
+
if (e.state === 40) {
|
|
4276
|
+
const r = {
|
|
4277
|
+
...e._origin,
|
|
4278
|
+
state: 30
|
|
4279
|
+
};
|
|
4280
|
+
this.replaceMessage(r, !1);
|
|
4281
|
+
}
|
|
4229
4282
|
this.messages.value.splice(i + 1, this.messages.value.length - i - 1), this.messages.value = [...this.messages.value], await this.opts.question(
|
|
4230
4283
|
this,
|
|
4231
4284
|
this.context,
|
|
@@ -4236,7 +4289,7 @@ class js {
|
|
|
4236
4289
|
this.activeAIAgentID,
|
|
4237
4290
|
this.chatMode
|
|
4238
4291
|
);
|
|
4239
|
-
else if (i === this.messages.value.length - 1)
|
|
4292
|
+
} else if (i === this.messages.value.length - 1)
|
|
4240
4293
|
this.messages.value.pop(), this.messages.value = [...this.messages.value], await this.opts.question(
|
|
4241
4294
|
this,
|
|
4242
4295
|
this.context,
|
|
@@ -4555,7 +4608,7 @@ class Bu {
|
|
|
4555
4608
|
e.type
|
|
4556
4609
|
).load();
|
|
4557
4610
|
i && i.length > 0 && (this.resourceMode === "REMOTE" && this.resourceOptions ? (this.remoteSessionList = await this.resourceOptions.getSessionList(), await this.asyncRemoteSession(i)) : i.forEach((r, s) => {
|
|
4558
|
-
Object.prototype.hasOwnProperty.call(r, "sequence") || (r.sequence = s), Object.prototype.hasOwnProperty.call(r, "isTop") || (r.isTop = 0), this.topics.value = [...this.topics.value, new
|
|
4611
|
+
Object.prototype.hasOwnProperty.call(r, "sequence") || (r.sequence = s), Object.prototype.hasOwnProperty.call(r, "isTop") || (r.isTop = 0), this.topics.value = [...this.topics.value, new It(r)];
|
|
4559
4612
|
}));
|
|
4560
4613
|
}
|
|
4561
4614
|
/**
|
|
@@ -4568,7 +4621,19 @@ class Bu {
|
|
|
4568
4621
|
var s;
|
|
4569
4622
|
return ((s = r.aiChat) == null ? void 0 : s.sessionid) === t.session_id;
|
|
4570
4623
|
});
|
|
4571
|
-
|
|
4624
|
+
if (i) {
|
|
4625
|
+
i.realid = t.realid, i.sequence = t.sequence, i.isTop = t.is_top ? t.is_top : 0, t.caption && (i.caption = t.caption);
|
|
4626
|
+
const r = this.topics.value.findIndex(
|
|
4627
|
+
(s) => {
|
|
4628
|
+
var o;
|
|
4629
|
+
return ((o = s.aiChat) == null ? void 0 : o.sessionid) === t.session_id;
|
|
4630
|
+
}
|
|
4631
|
+
);
|
|
4632
|
+
r === -1 ? this.topics.value = [
|
|
4633
|
+
...this.topics.value,
|
|
4634
|
+
new It(i)
|
|
4635
|
+
] : (this.topics.value.splice(r, 1, new It(i)), this.topics.value = [...this.topics.value]);
|
|
4636
|
+
}
|
|
4572
4637
|
});
|
|
4573
4638
|
}
|
|
4574
4639
|
/**
|
|
@@ -4583,7 +4648,7 @@ class Bu {
|
|
|
4583
4648
|
this.backupOptions = e;
|
|
4584
4649
|
const t = this.topics.value.findIndex(
|
|
4585
4650
|
(r) => r.id === e.id
|
|
4586
|
-
), i = new
|
|
4651
|
+
), i = new It(e);
|
|
4587
4652
|
t !== -1 ? this.topics.value.splice(t, 1, i) : this.topics.value = [...this.topics.value, i], await this.updateTopic(e), this.activedTopic.value = i;
|
|
4588
4653
|
}
|
|
4589
4654
|
/**
|
|
@@ -4593,7 +4658,7 @@ class Bu {
|
|
|
4593
4658
|
*/
|
|
4594
4659
|
getCurrentTopicByID(e) {
|
|
4595
4660
|
const t = this.topics.value.find((i) => i.id === e);
|
|
4596
|
-
return t && t.data ? new
|
|
4661
|
+
return t && t.data ? new It({ ...t.data }) : void 0;
|
|
4597
4662
|
}
|
|
4598
4663
|
/**
|
|
4599
4664
|
* 基于话题标识更新当前话题
|
|
@@ -4789,7 +4854,7 @@ class Bu {
|
|
|
4789
4854
|
sequence: l + 1,
|
|
4790
4855
|
isTop: 0,
|
|
4791
4856
|
disableStorage: i.disableStorage
|
|
4792
|
-
}, c = new
|
|
4857
|
+
}, c = new It(a);
|
|
4793
4858
|
this.topics.value = [...this.topics.value, c], this.backupOptions && await this.updateTopic(this.backupOptions), this.handleTopicChange(c);
|
|
4794
4859
|
}
|
|
4795
4860
|
/**
|
|
@@ -5397,7 +5462,7 @@ const ql = ({
|
|
|
5397
5462
|
onAction: l
|
|
5398
5463
|
// 接收行为事件回调
|
|
5399
5464
|
}) => {
|
|
5400
|
-
const a = new L("pop"), c = Br(Ei), [d, u] =
|
|
5465
|
+
const a = new L("pop"), c = Br(Ei), [d, u] = Me(s || !1), h = Q(null), f = Q(null), p = Q(null);
|
|
5401
5466
|
K(() => {
|
|
5402
5467
|
s !== void 0 && u(s);
|
|
5403
5468
|
}, [s]), K(() => (f.current || (f.current = document.createElement("div"), f.current.className = a.b("content-container"), document.body.appendChild(f.current)), () => {
|
|
@@ -8674,7 +8739,7 @@ class nt extends de {
|
|
|
8674
8739
|
return J.fromReplace(e, this.from, this.to, s);
|
|
8675
8740
|
}
|
|
8676
8741
|
invert() {
|
|
8677
|
-
return new
|
|
8742
|
+
return new De(this.from, this.to, this.mark);
|
|
8678
8743
|
}
|
|
8679
8744
|
map(e) {
|
|
8680
8745
|
let t = e.mapResult(this.from, 1), i = e.mapResult(this.to, -1);
|
|
@@ -8701,7 +8766,7 @@ class nt extends de {
|
|
|
8701
8766
|
}
|
|
8702
8767
|
}
|
|
8703
8768
|
de.jsonID("addMark", nt);
|
|
8704
|
-
class
|
|
8769
|
+
class De extends de {
|
|
8705
8770
|
/**
|
|
8706
8771
|
Create a mark-removing step.
|
|
8707
8772
|
*/
|
|
@@ -8717,10 +8782,10 @@ class Oe extends de {
|
|
|
8717
8782
|
}
|
|
8718
8783
|
map(e) {
|
|
8719
8784
|
let t = e.mapResult(this.from, 1), i = e.mapResult(this.to, -1);
|
|
8720
|
-
return t.deleted && i.deleted || t.pos >= i.pos ? null : new
|
|
8785
|
+
return t.deleted && i.deleted || t.pos >= i.pos ? null : new De(t.pos, i.pos, this.mark);
|
|
8721
8786
|
}
|
|
8722
8787
|
merge(e) {
|
|
8723
|
-
return e instanceof
|
|
8788
|
+
return e instanceof De && e.mark.eq(this.mark) && this.from <= e.to && this.to >= e.from ? new De(Math.min(this.from, e.from), Math.max(this.to, e.to), this.mark) : null;
|
|
8724
8789
|
}
|
|
8725
8790
|
toJSON() {
|
|
8726
8791
|
return {
|
|
@@ -8736,10 +8801,10 @@ class Oe extends de {
|
|
|
8736
8801
|
static fromJSON(e, t) {
|
|
8737
8802
|
if (typeof t.from != "number" || typeof t.to != "number")
|
|
8738
8803
|
throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");
|
|
8739
|
-
return new
|
|
8804
|
+
return new De(t.from, t.to, e.markFromJSON(t.mark));
|
|
8740
8805
|
}
|
|
8741
8806
|
}
|
|
8742
|
-
de.jsonID("removeMark",
|
|
8807
|
+
de.jsonID("removeMark", De);
|
|
8743
8808
|
class it extends de {
|
|
8744
8809
|
/**
|
|
8745
8810
|
Create a node mark step.
|
|
@@ -8952,7 +9017,7 @@ function gh(n, e, t, i) {
|
|
|
8952
9017
|
if (!i.isInSet(u) && d.type.allowsMarkType(i.type)) {
|
|
8953
9018
|
let h = Math.max(c, e), f = Math.min(c + a.nodeSize, t), p = i.addToSet(u);
|
|
8954
9019
|
for (let y = 0; y < u.length; y++)
|
|
8955
|
-
u[y].isInSet(p) || (o && o.to == h && o.mark.eq(u[y]) ? o.to = f : r.push(o = new
|
|
9020
|
+
u[y].isInSet(p) || (o && o.to == h && o.mark.eq(u[y]) ? o.to = f : r.push(o = new De(h, f, u[y])));
|
|
8956
9021
|
l && l.to == h ? l.to = f : s.push(l = new nt(h, f, i));
|
|
8957
9022
|
}
|
|
8958
9023
|
}), r.forEach((a) => n.step(a)), s.forEach((a) => n.step(a));
|
|
@@ -8981,7 +9046,7 @@ function yh(n, e, t, i) {
|
|
|
8981
9046
|
h ? (h.to = c, h.step = s) : r.push({ style: u, from: Math.max(l, e), to: c, step: s });
|
|
8982
9047
|
}
|
|
8983
9048
|
}
|
|
8984
|
-
}), r.forEach((o) => n.step(new
|
|
9049
|
+
}), r.forEach((o) => n.step(new De(o.from, o.to, o.style)));
|
|
8985
9050
|
}
|
|
8986
9051
|
function jr(n, e, t, i = t.contentMatch, r = !0) {
|
|
8987
9052
|
let s = n.doc.nodeAt(e), o = [], l = e + 1;
|
|
@@ -8992,7 +9057,7 @@ function jr(n, e, t, i = t.contentMatch, r = !0) {
|
|
|
8992
9057
|
else {
|
|
8993
9058
|
i = u;
|
|
8994
9059
|
for (let h = 0; h < c.marks.length; h++)
|
|
8995
|
-
t.allowsMarkType(c.marks[h].type) || n.step(new
|
|
9060
|
+
t.allowsMarkType(c.marks[h].type) || n.step(new De(l, d, c.marks[h]));
|
|
8996
9061
|
if (r && c.isText && t.whitespace != "pre") {
|
|
8997
9062
|
let h, f = /\r?\n|\r/g, p;
|
|
8998
9063
|
for (; h = f.exec(c.text); )
|
|
@@ -9011,7 +9076,7 @@ function jr(n, e, t, i = t.contentMatch, r = !0) {
|
|
|
9011
9076
|
function vh(n, e, t) {
|
|
9012
9077
|
return (e == 0 || n.canReplace(e, n.childCount)) && (t == n.childCount || n.canReplace(0, t));
|
|
9013
9078
|
}
|
|
9014
|
-
function
|
|
9079
|
+
function tn(n) {
|
|
9015
9080
|
let t = n.parent.content.cutByIndex(n.startIndex, n.endIndex);
|
|
9016
9081
|
for (let i = n.depth, r = 0, s = 0; ; --i) {
|
|
9017
9082
|
let o = n.$from.node(i), l = n.$from.index(i) + r, a = n.$to.indexAfter(i) - s;
|
|
@@ -9121,7 +9186,7 @@ function Mh(n, e, t, i, r) {
|
|
|
9121
9186
|
throw new RangeError("Invalid content for node type " + t.name);
|
|
9122
9187
|
n.step(new ee(e, e + s.nodeSize, e + 1, e + s.nodeSize - 1, new S(k.from(o), 0, 0), 1, !0));
|
|
9123
9188
|
}
|
|
9124
|
-
function
|
|
9189
|
+
function Wt(n, e, t = 1, i) {
|
|
9125
9190
|
let r = n.resolve(e), s = r.depth - t, o = i && i[i.length - 1] || r.parent;
|
|
9126
9191
|
if (s < 0 || r.parent.type.spec.isolating || !r.parent.canReplace(r.index(), r.parent.childCount) || !o.type.validContent(r.parent.content.cutByIndex(r.index(), r.parent.childCount)))
|
|
9127
9192
|
return !1;
|
|
@@ -9516,7 +9581,7 @@ function xa(n, e) {
|
|
|
9516
9581
|
}
|
|
9517
9582
|
return t;
|
|
9518
9583
|
}
|
|
9519
|
-
class
|
|
9584
|
+
class jt extends de {
|
|
9520
9585
|
/**
|
|
9521
9586
|
Construct an attribute step.
|
|
9522
9587
|
*/
|
|
@@ -9538,11 +9603,11 @@ class Wt extends de {
|
|
|
9538
9603
|
return Ce.empty;
|
|
9539
9604
|
}
|
|
9540
9605
|
invert(e) {
|
|
9541
|
-
return new
|
|
9606
|
+
return new jt(this.pos, this.attr, e.nodeAt(this.pos).attrs[this.attr]);
|
|
9542
9607
|
}
|
|
9543
9608
|
map(e) {
|
|
9544
9609
|
let t = e.mapResult(this.pos, 1);
|
|
9545
|
-
return t.deletedAfter ? null : new
|
|
9610
|
+
return t.deletedAfter ? null : new jt(t.pos, this.attr, this.value);
|
|
9546
9611
|
}
|
|
9547
9612
|
toJSON() {
|
|
9548
9613
|
return { stepType: "attr", pos: this.pos, attr: this.attr, value: this.value };
|
|
@@ -9550,10 +9615,10 @@ class Wt extends de {
|
|
|
9550
9615
|
static fromJSON(e, t) {
|
|
9551
9616
|
if (typeof t.pos != "number" || typeof t.attr != "string")
|
|
9552
9617
|
throw new RangeError("Invalid input for AttrStep.fromJSON");
|
|
9553
|
-
return new
|
|
9618
|
+
return new jt(t.pos, t.attr, t.value);
|
|
9554
9619
|
}
|
|
9555
9620
|
}
|
|
9556
|
-
de.jsonID("attr",
|
|
9621
|
+
de.jsonID("attr", jt);
|
|
9557
9622
|
class wn extends de {
|
|
9558
9623
|
/**
|
|
9559
9624
|
Construct an attribute step.
|
|
@@ -9588,15 +9653,15 @@ class wn extends de {
|
|
|
9588
9653
|
}
|
|
9589
9654
|
}
|
|
9590
9655
|
de.jsonID("docAttr", wn);
|
|
9591
|
-
let
|
|
9656
|
+
let Kt = class extends Error {
|
|
9592
9657
|
};
|
|
9593
|
-
|
|
9658
|
+
Kt = function n(e) {
|
|
9594
9659
|
let t = Error.call(this, e);
|
|
9595
9660
|
return t.__proto__ = n.prototype, t;
|
|
9596
9661
|
};
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
|
|
9662
|
+
Kt.prototype = Object.create(Error.prototype);
|
|
9663
|
+
Kt.prototype.constructor = Kt;
|
|
9664
|
+
Kt.prototype.name = "TransformError";
|
|
9600
9665
|
class Sa {
|
|
9601
9666
|
/**
|
|
9602
9667
|
Create a transform that starts with the given document.
|
|
@@ -9617,7 +9682,7 @@ class Sa {
|
|
|
9617
9682
|
step(e) {
|
|
9618
9683
|
let t = this.maybeStep(e);
|
|
9619
9684
|
if (t.failed)
|
|
9620
|
-
throw new
|
|
9685
|
+
throw new Kt(t.failed);
|
|
9621
9686
|
return this;
|
|
9622
9687
|
}
|
|
9623
9688
|
/**
|
|
@@ -9754,7 +9819,7 @@ class Sa {
|
|
|
9754
9819
|
to set attributes on the document itself.
|
|
9755
9820
|
*/
|
|
9756
9821
|
setNodeAttribute(e, t, i) {
|
|
9757
|
-
return this.step(new
|
|
9822
|
+
return this.step(new jt(e, t, i)), this;
|
|
9758
9823
|
}
|
|
9759
9824
|
/**
|
|
9760
9825
|
Set a single attribute on the document to a new value.
|
|
@@ -9917,11 +9982,11 @@ class P {
|
|
|
9917
9982
|
found.
|
|
9918
9983
|
*/
|
|
9919
9984
|
static findFrom(e, t, i = !1) {
|
|
9920
|
-
let r = e.parent.inlineContent ? new R(e) :
|
|
9985
|
+
let r = e.parent.inlineContent ? new R(e) : Lt(e.node(0), e.parent, e.pos, e.index(), t, i);
|
|
9921
9986
|
if (r)
|
|
9922
9987
|
return r;
|
|
9923
9988
|
for (let s = e.depth - 1; s >= 0; s--) {
|
|
9924
|
-
let o = t < 0 ?
|
|
9989
|
+
let o = t < 0 ? Lt(e.node(0), e.node(s), e.before(s + 1), e.index(s), t, i) : Lt(e.node(0), e.node(s), e.after(s + 1), e.index(s) + 1, t, i);
|
|
9925
9990
|
if (o)
|
|
9926
9991
|
return o;
|
|
9927
9992
|
}
|
|
@@ -9933,7 +9998,7 @@ class P {
|
|
|
9933
9998
|
negative, it will search backwards first.
|
|
9934
9999
|
*/
|
|
9935
10000
|
static near(e, t = 1) {
|
|
9936
|
-
return this.findFrom(e, t) || this.findFrom(e, -t) || new
|
|
10001
|
+
return this.findFrom(e, t) || this.findFrom(e, -t) || new _e(e.node(0));
|
|
9937
10002
|
}
|
|
9938
10003
|
/**
|
|
9939
10004
|
Find the cursor or leaf node selection closest to the start of
|
|
@@ -9942,14 +10007,14 @@ class P {
|
|
|
9942
10007
|
exists.
|
|
9943
10008
|
*/
|
|
9944
10009
|
static atStart(e) {
|
|
9945
|
-
return
|
|
10010
|
+
return Lt(e, e, 0, 0, 1) || new _e(e);
|
|
9946
10011
|
}
|
|
9947
10012
|
/**
|
|
9948
10013
|
Find the cursor or leaf node selection closest to the end of the
|
|
9949
10014
|
given document.
|
|
9950
10015
|
*/
|
|
9951
10016
|
static atEnd(e) {
|
|
9952
|
-
return
|
|
10017
|
+
return Lt(e, e, e.content.size, e.childCount, -1) || new _e(e);
|
|
9953
10018
|
}
|
|
9954
10019
|
/**
|
|
9955
10020
|
Deserialize the JSON representation of a selection. Must be
|
|
@@ -10145,7 +10210,7 @@ class qr {
|
|
|
10145
10210
|
return i && E.isSelectable(i) ? new E(t) : P.near(t);
|
|
10146
10211
|
}
|
|
10147
10212
|
}
|
|
10148
|
-
class
|
|
10213
|
+
class _e extends P {
|
|
10149
10214
|
/**
|
|
10150
10215
|
Create an all-selection over the given document.
|
|
10151
10216
|
*/
|
|
@@ -10167,28 +10232,28 @@ class Me extends P {
|
|
|
10167
10232
|
@internal
|
|
10168
10233
|
*/
|
|
10169
10234
|
static fromJSON(e) {
|
|
10170
|
-
return new
|
|
10235
|
+
return new _e(e);
|
|
10171
10236
|
}
|
|
10172
10237
|
map(e) {
|
|
10173
|
-
return new
|
|
10238
|
+
return new _e(e);
|
|
10174
10239
|
}
|
|
10175
10240
|
eq(e) {
|
|
10176
|
-
return e instanceof
|
|
10241
|
+
return e instanceof _e;
|
|
10177
10242
|
}
|
|
10178
10243
|
getBookmark() {
|
|
10179
10244
|
return $h;
|
|
10180
10245
|
}
|
|
10181
10246
|
}
|
|
10182
|
-
P.jsonID("all",
|
|
10247
|
+
P.jsonID("all", _e);
|
|
10183
10248
|
const $h = {
|
|
10184
10249
|
map() {
|
|
10185
10250
|
return this;
|
|
10186
10251
|
},
|
|
10187
10252
|
resolve(n) {
|
|
10188
|
-
return new
|
|
10253
|
+
return new _e(n);
|
|
10189
10254
|
}
|
|
10190
10255
|
};
|
|
10191
|
-
function
|
|
10256
|
+
function Lt(n, e, t, i, r, s = !1) {
|
|
10192
10257
|
if (e.inlineContent)
|
|
10193
10258
|
return R.create(n, t);
|
|
10194
10259
|
for (let o = i - (r > 0 ? 0 : 1); r > 0 ? o < e.childCount : o >= 0; o += r) {
|
|
@@ -10197,7 +10262,7 @@ function $t(n, e, t, i, r, s = !1) {
|
|
|
10197
10262
|
if (!s && E.isSelectable(l))
|
|
10198
10263
|
return E.create(n, t - (r < 0 ? l.nodeSize : 0));
|
|
10199
10264
|
} else {
|
|
10200
|
-
let a =
|
|
10265
|
+
let a = Lt(n, l, t + r, r < 0 ? l.childCount : 0, r, s);
|
|
10201
10266
|
if (a)
|
|
10202
10267
|
return a;
|
|
10203
10268
|
}
|
|
@@ -10420,7 +10485,7 @@ class Ui {
|
|
|
10420
10485
|
});
|
|
10421
10486
|
}
|
|
10422
10487
|
}
|
|
10423
|
-
class
|
|
10488
|
+
class Vt {
|
|
10424
10489
|
/**
|
|
10425
10490
|
@internal
|
|
10426
10491
|
*/
|
|
@@ -10495,7 +10560,7 @@ class Ft {
|
|
|
10495
10560
|
applyInner(e) {
|
|
10496
10561
|
if (!e.before.eq(this.doc))
|
|
10497
10562
|
throw new RangeError("Applying a mismatched transaction");
|
|
10498
|
-
let t = new
|
|
10563
|
+
let t = new Vt(this.config), i = this.config.fields;
|
|
10499
10564
|
for (let r = 0; r < i.length; r++) {
|
|
10500
10565
|
let s = i[r];
|
|
10501
10566
|
t[s.name] = s.apply(e, this[s.name], this, t);
|
|
@@ -10512,7 +10577,7 @@ class Ft {
|
|
|
10512
10577
|
Create a new state.
|
|
10513
10578
|
*/
|
|
10514
10579
|
static create(e) {
|
|
10515
|
-
let t = new Ui(e.doc ? e.doc.type.schema : e.schema, e.plugins), i = new
|
|
10580
|
+
let t = new Ui(e.doc ? e.doc.type.schema : e.schema, e.plugins), i = new Vt(t);
|
|
10516
10581
|
for (let r = 0; r < t.fields.length; r++)
|
|
10517
10582
|
i[t.fields[r].name] = t.fields[r].init(e, i);
|
|
10518
10583
|
return i;
|
|
@@ -10526,7 +10591,7 @@ class Ft {
|
|
|
10526
10591
|
configuration object..
|
|
10527
10592
|
*/
|
|
10528
10593
|
reconfigure(e) {
|
|
10529
|
-
let t = new Ui(this.schema, e.plugins), i = t.fields, r = new
|
|
10594
|
+
let t = new Ui(this.schema, e.plugins), i = t.fields, r = new Vt(t);
|
|
10530
10595
|
for (let s = 0; s < i.length; s++) {
|
|
10531
10596
|
let o = i[s].name;
|
|
10532
10597
|
r[o] = this.hasOwnProperty(o) ? this[o] : i[s].init(e, r);
|
|
@@ -10563,7 +10628,7 @@ class Ft {
|
|
|
10563
10628
|
throw new RangeError("Invalid input for EditorState.fromJSON");
|
|
10564
10629
|
if (!e.schema)
|
|
10565
10630
|
throw new RangeError("Required config field 'schema' missing");
|
|
10566
|
-
let r = new Ui(e.schema, e.plugins), s = new
|
|
10631
|
+
let r = new Ui(e.schema, e.plugins), s = new Vt(r);
|
|
10567
10632
|
return r.fields.forEach((o) => {
|
|
10568
10633
|
if (o.name == "doc")
|
|
10569
10634
|
s.doc = st.fromJSON(e.schema, t.doc);
|
|
@@ -10642,19 +10707,19 @@ const Vh = (n, e, t) => {
|
|
|
10642
10707
|
return !1;
|
|
10643
10708
|
let r = Ur(i);
|
|
10644
10709
|
if (!r) {
|
|
10645
|
-
let o = i.blockRange(), l = o &&
|
|
10710
|
+
let o = i.blockRange(), l = o && tn(o);
|
|
10646
10711
|
return l == null ? !1 : (e && e(n.tr.lift(o, l).scrollIntoView()), !0);
|
|
10647
10712
|
}
|
|
10648
10713
|
let s = r.nodeBefore;
|
|
10649
10714
|
if (Oa(n, r, e, -1))
|
|
10650
10715
|
return !0;
|
|
10651
|
-
if (i.parent.content.size == 0 && (
|
|
10716
|
+
if (i.parent.content.size == 0 && (Yt(s, "end") || E.isSelectable(s)))
|
|
10652
10717
|
for (let o = i.depth; ; o--) {
|
|
10653
10718
|
let l = vi(n.doc, i.before(o), i.after(o), S.empty);
|
|
10654
10719
|
if (l && l.slice.size < l.to - l.from) {
|
|
10655
10720
|
if (e) {
|
|
10656
10721
|
let a = n.tr.step(l);
|
|
10657
|
-
a.setSelection(
|
|
10722
|
+
a.setSelection(Yt(s, "end") ? P.findFrom(a.doc.resolve(a.mapping.map(r.pos, -1)), -1) : E.create(a.doc, r.pos - s.nodeSize)), e(a.scrollIntoView());
|
|
10658
10723
|
}
|
|
10659
10724
|
return !0;
|
|
10660
10725
|
}
|
|
@@ -10703,7 +10768,7 @@ function Na(n, e, t) {
|
|
|
10703
10768
|
}
|
|
10704
10769
|
return !0;
|
|
10705
10770
|
}
|
|
10706
|
-
function
|
|
10771
|
+
function Yt(n, e, t = !1) {
|
|
10707
10772
|
for (let i = n; i; i = e == "start" ? i.firstChild : i.lastChild) {
|
|
10708
10773
|
if (i.isTextblock)
|
|
10709
10774
|
return !0;
|
|
@@ -10748,12 +10813,12 @@ const qh = (n, e, t) => {
|
|
|
10748
10813
|
let s = r.nodeAfter;
|
|
10749
10814
|
if (Oa(n, r, e, 1))
|
|
10750
10815
|
return !0;
|
|
10751
|
-
if (i.parent.content.size == 0 && (
|
|
10816
|
+
if (i.parent.content.size == 0 && (Yt(s, "start") || E.isSelectable(s))) {
|
|
10752
10817
|
let o = vi(n.doc, i.before(), i.after(), S.empty);
|
|
10753
10818
|
if (o && o.slice.size < o.to - o.from) {
|
|
10754
10819
|
if (e) {
|
|
10755
10820
|
let l = n.tr.step(o);
|
|
10756
|
-
l.setSelection(
|
|
10821
|
+
l.setSelection(Yt(s, "start") ? P.findFrom(l.doc.resolve(l.mapping.map(r.pos)), 1) : E.create(l.doc, l.mapping.map(r.pos))), e(l.scrollIntoView());
|
|
10757
10822
|
}
|
|
10758
10823
|
return !0;
|
|
10759
10824
|
}
|
|
@@ -10805,7 +10870,7 @@ const Jh = (n, e) => {
|
|
|
10805
10870
|
return !1;
|
|
10806
10871
|
return e && e(n.tr.join(i).scrollIntoView()), !0;
|
|
10807
10872
|
}, Yh = (n, e) => {
|
|
10808
|
-
let { $from: t, $to: i } = n.selection, r = t.blockRange(i), s = r &&
|
|
10873
|
+
let { $from: t, $to: i } = n.selection, r = t.blockRange(i), s = r && tn(r);
|
|
10809
10874
|
return s == null ? !1 : (e && e(n.tr.lift(r, s).scrollIntoView()), !0);
|
|
10810
10875
|
}, Xh = (n, e) => {
|
|
10811
10876
|
let { $head: t, $anchor: i } = n.selection;
|
|
@@ -10833,7 +10898,7 @@ const Gh = (n, e) => {
|
|
|
10833
10898
|
return !0;
|
|
10834
10899
|
}, Zh = (n, e) => {
|
|
10835
10900
|
let t = n.selection, { $from: i, $to: r } = t;
|
|
10836
|
-
if (t instanceof
|
|
10901
|
+
if (t instanceof _e || i.parent.inlineContent || r.parent.inlineContent)
|
|
10837
10902
|
return !1;
|
|
10838
10903
|
let s = Aa(r.parent.contentMatchAt(r.indexAfter()));
|
|
10839
10904
|
if (!s || !s.isTextblock)
|
|
@@ -10849,10 +10914,10 @@ const Gh = (n, e) => {
|
|
|
10849
10914
|
return !1;
|
|
10850
10915
|
if (t.depth > 1 && t.after() != t.end(-1)) {
|
|
10851
10916
|
let s = t.before();
|
|
10852
|
-
if (
|
|
10917
|
+
if (Wt(n.doc, s))
|
|
10853
10918
|
return e && e(n.tr.split(s).scrollIntoView()), !0;
|
|
10854
10919
|
}
|
|
10855
|
-
let i = t.blockRange(), r = i &&
|
|
10920
|
+
let i = t.blockRange(), r = i && tn(i);
|
|
10856
10921
|
return r == null ? !1 : (e && e(n.tr.lift(i, r).scrollIntoView()), !0);
|
|
10857
10922
|
}, ef = (n, e) => {
|
|
10858
10923
|
let { $from: t, to: i } = n.selection, r, s = t.sharedDepth(i);
|
|
@@ -10878,10 +10943,10 @@ function Oa(n, e, t, i) {
|
|
|
10878
10943
|
}
|
|
10879
10944
|
return !0;
|
|
10880
10945
|
}
|
|
10881
|
-
let d = s.type.spec.isolating || i > 0 && a ? null : P.findFrom(e, 1), u = d && d.$from.blockRange(d.$to), h = u &&
|
|
10946
|
+
let d = s.type.spec.isolating || i > 0 && a ? null : P.findFrom(e, 1), u = d && d.$from.blockRange(d.$to), h = u && tn(u);
|
|
10882
10947
|
if (h != null && h >= e.depth)
|
|
10883
10948
|
return t && t(n.tr.lift(u, h).scrollIntoView()), !0;
|
|
10884
|
-
if (c &&
|
|
10949
|
+
if (c && Yt(s, "start", !0) && Yt(r, "end")) {
|
|
10885
10950
|
let f = r, p = [];
|
|
10886
10951
|
for (; p.push(f), !f.isTextblock; )
|
|
10887
10952
|
f = f.lastChild;
|
|
@@ -10980,7 +11045,7 @@ function af(n, e, t, i, r) {
|
|
|
10980
11045
|
t[d].type == r && (o = d + 1);
|
|
10981
11046
|
let l = t.length - o, a = e.start + t.length - (i ? 2 : 0), c = e.parent;
|
|
10982
11047
|
for (let d = e.startIndex, u = e.endIndex, h = !0; d < u; d++, h = !1)
|
|
10983
|
-
!h &&
|
|
11048
|
+
!h && Wt(n.doc, a, l) && (n.split(a, l), a += 2 * l), a += c.child(d).nodeSize;
|
|
10984
11049
|
return n;
|
|
10985
11050
|
}
|
|
10986
11051
|
function cf(n) {
|
|
@@ -10992,7 +11057,7 @@ function cf(n) {
|
|
|
10992
11057
|
function df(n, e, t, i) {
|
|
10993
11058
|
let r = n.tr, s = i.end, o = i.$to.end(i.depth);
|
|
10994
11059
|
s < o && (r.step(new ee(s - 1, o, s, o, new S(k.from(t.create(null, i.parent.copy())), 1, 0), 1, !0)), i = new ti(r.doc.resolve(i.$from.pos), r.doc.resolve(o), i.depth));
|
|
10995
|
-
const l =
|
|
11060
|
+
const l = tn(i);
|
|
10996
11061
|
if (l == null)
|
|
10997
11062
|
return !1;
|
|
10998
11063
|
r.lift(i, l);
|
|
@@ -11034,7 +11099,7 @@ const re = function(n) {
|
|
|
11034
11099
|
for (var e = 0; ; e++)
|
|
11035
11100
|
if (n = n.previousSibling, !n)
|
|
11036
11101
|
return e;
|
|
11037
|
-
},
|
|
11102
|
+
}, Xt = function(n) {
|
|
11038
11103
|
let e = n.assignedSlot || n.parentNode;
|
|
11039
11104
|
return e && e.nodeType == 11 ? e.host : e;
|
|
11040
11105
|
};
|
|
@@ -11051,7 +11116,7 @@ function fo(n, e, t, i, r) {
|
|
|
11051
11116
|
for (var s; ; ) {
|
|
11052
11117
|
if (n == t && e == i)
|
|
11053
11118
|
return !0;
|
|
11054
|
-
if (e == (r < 0 ? 0 :
|
|
11119
|
+
if (e == (r < 0 ? 0 : Se(n))) {
|
|
11055
11120
|
let o = n.parentNode;
|
|
11056
11121
|
if (!o || o.nodeType != 1 || Tn(n) || pf.test(n.nodeName) || n.contentEditable == "false")
|
|
11057
11122
|
return !1;
|
|
@@ -11064,12 +11129,12 @@ function fo(n, e, t, i, r) {
|
|
|
11064
11129
|
else
|
|
11065
11130
|
return !1;
|
|
11066
11131
|
else
|
|
11067
|
-
n = o, e = r < 0 ?
|
|
11132
|
+
n = o, e = r < 0 ? Se(n) : 0;
|
|
11068
11133
|
} else
|
|
11069
11134
|
return !1;
|
|
11070
11135
|
}
|
|
11071
11136
|
}
|
|
11072
|
-
function
|
|
11137
|
+
function Se(n) {
|
|
11073
11138
|
return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
|
|
11074
11139
|
}
|
|
11075
11140
|
function mf(n, e) {
|
|
@@ -11079,7 +11144,7 @@ function mf(n, e) {
|
|
|
11079
11144
|
if (n.nodeType == 1 && e > 0) {
|
|
11080
11145
|
if (n.contentEditable == "false")
|
|
11081
11146
|
return null;
|
|
11082
|
-
n = n.childNodes[e - 1], e =
|
|
11147
|
+
n = n.childNodes[e - 1], e = Se(n);
|
|
11083
11148
|
} else if (n.parentNode && !Tn(n))
|
|
11084
11149
|
e = re(n), n = n.parentNode;
|
|
11085
11150
|
else
|
|
@@ -11101,13 +11166,13 @@ function gf(n, e) {
|
|
|
11101
11166
|
}
|
|
11102
11167
|
}
|
|
11103
11168
|
function yf(n, e, t) {
|
|
11104
|
-
for (let i = e == 0, r = e ==
|
|
11169
|
+
for (let i = e == 0, r = e == Se(n); i || r; ) {
|
|
11105
11170
|
if (n == t)
|
|
11106
11171
|
return !0;
|
|
11107
11172
|
let s = re(n);
|
|
11108
11173
|
if (n = n.parentNode, !n)
|
|
11109
11174
|
return !1;
|
|
11110
|
-
i = i && s == 0, r = r && s ==
|
|
11175
|
+
i = i && s == 0, r = r && s == Se(n);
|
|
11111
11176
|
}
|
|
11112
11177
|
}
|
|
11113
11178
|
function Tn(n) {
|
|
@@ -11134,18 +11199,18 @@ function bf(n, e, t) {
|
|
|
11134
11199
|
try {
|
|
11135
11200
|
let i = n.caretPositionFromPoint(e, t);
|
|
11136
11201
|
if (i)
|
|
11137
|
-
return { node: i.offsetNode, offset: Math.min(
|
|
11202
|
+
return { node: i.offsetNode, offset: Math.min(Se(i.offsetNode), i.offset) };
|
|
11138
11203
|
} catch (i) {
|
|
11139
11204
|
}
|
|
11140
11205
|
if (n.caretRangeFromPoint) {
|
|
11141
11206
|
let i = n.caretRangeFromPoint(e, t);
|
|
11142
11207
|
if (i)
|
|
11143
|
-
return { node: i.startContainer, offset: Math.min(
|
|
11208
|
+
return { node: i.startContainer, offset: Math.min(Se(i.startContainer), i.startOffset) };
|
|
11144
11209
|
}
|
|
11145
11210
|
}
|
|
11146
|
-
const Le = typeof navigator < "u" ? navigator : null, po = typeof document < "u" ? document : null, dt = Le && Le.userAgent || "", Sr = /Edge\/(\d+)/.exec(dt), Ia = /MSIE \d/.exec(dt), Mr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(dt), ve = !!(Ia || Mr || Sr), ot = Ia ? document.documentMode : Mr ? +Mr[1] : Sr ? +Sr[1] : 0,
|
|
11147
|
-
|
|
11148
|
-
const _r = !ve && /Chrome\/(\d+)/.exec(dt), Z = !!_r, Ra = _r ? +_r[1] : 0, ce = !ve && !!Le && /Apple Computer/.test(Le.vendor),
|
|
11211
|
+
const Le = typeof navigator < "u" ? navigator : null, po = typeof document < "u" ? document : null, dt = Le && Le.userAgent || "", Sr = /Edge\/(\d+)/.exec(dt), Ia = /MSIE \d/.exec(dt), Mr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(dt), ve = !!(Ia || Mr || Sr), ot = Ia ? document.documentMode : Mr ? +Mr[1] : Sr ? +Sr[1] : 0, Te = !ve && /gecko\/(\d+)/i.test(dt);
|
|
11212
|
+
Te && +(/Firefox\/(\d+)/.exec(dt) || [0, 0])[1];
|
|
11213
|
+
const _r = !ve && /Chrome\/(\d+)/.exec(dt), Z = !!_r, Ra = _r ? +_r[1] : 0, ce = !ve && !!Le && /Apple Computer/.test(Le.vendor), Gt = ce && (/Mobile\/\w+/.test(dt) || !!Le && Le.maxTouchPoints > 2), xe = Gt || (Le ? /Mac/.test(Le.platform) : !1), Pa = Le ? /Win/.test(Le.platform) : !1, Ue = /Android \d/.test(dt), Nn = !!po && "webkitFontSmoothing" in po.documentElement.style, wf = Nn ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
11149
11214
|
function Cf(n) {
|
|
11150
11215
|
let e = n.defaultView && n.defaultView.visualViewport;
|
|
11151
11216
|
return e ? {
|
|
@@ -11176,7 +11241,7 @@ function mo(n, e, t) {
|
|
|
11176
11241
|
let i = n.someProp("scrollThreshold") || 0, r = n.someProp("scrollMargin") || 5, s = n.dom.ownerDocument;
|
|
11177
11242
|
for (let o = t || n.dom; o; ) {
|
|
11178
11243
|
if (o.nodeType != 1) {
|
|
11179
|
-
o =
|
|
11244
|
+
o = Xt(o);
|
|
11180
11245
|
continue;
|
|
11181
11246
|
}
|
|
11182
11247
|
let l = o, a = l == s.body, c = a ? Cf(s) : kf(l), d = 0, u = 0;
|
|
@@ -11192,7 +11257,7 @@ function mo(n, e, t) {
|
|
|
11192
11257
|
let h = a ? "fixed" : getComputedStyle(o).position;
|
|
11193
11258
|
if (/^(fixed|sticky)$/.test(h))
|
|
11194
11259
|
break;
|
|
11195
|
-
o = h == "absolute" ? o.offsetParent :
|
|
11260
|
+
o = h == "absolute" ? o.offsetParent : Xt(o);
|
|
11196
11261
|
}
|
|
11197
11262
|
}
|
|
11198
11263
|
function xf(n) {
|
|
@@ -11211,7 +11276,7 @@ function xf(n) {
|
|
|
11211
11276
|
}
|
|
11212
11277
|
function za(n) {
|
|
11213
11278
|
let e = [], t = n.ownerDocument;
|
|
11214
|
-
for (let i = n; i && (e.push({ dom: i, top: i.scrollTop, left: i.scrollLeft }), n != t); i =
|
|
11279
|
+
for (let i = n; i && (e.push({ dom: i, top: i.scrollTop, left: i.scrollLeft }), n != t); i = Xt(i))
|
|
11215
11280
|
;
|
|
11216
11281
|
return e;
|
|
11217
11282
|
}
|
|
@@ -11225,18 +11290,18 @@ function $a(n, e) {
|
|
|
11225
11290
|
i.scrollTop != r + e && (i.scrollTop = r + e), i.scrollLeft != s && (i.scrollLeft = s);
|
|
11226
11291
|
}
|
|
11227
11292
|
}
|
|
11228
|
-
let
|
|
11293
|
+
let Rt = null;
|
|
11229
11294
|
function Mf(n) {
|
|
11230
11295
|
if (n.setActive)
|
|
11231
11296
|
return n.setActive();
|
|
11232
|
-
if (
|
|
11233
|
-
return n.focus(
|
|
11297
|
+
if (Rt)
|
|
11298
|
+
return n.focus(Rt);
|
|
11234
11299
|
let e = za(n);
|
|
11235
|
-
n.focus(
|
|
11300
|
+
n.focus(Rt == null ? {
|
|
11236
11301
|
get preventScroll() {
|
|
11237
|
-
return
|
|
11302
|
+
return Rt = { preventScroll: !0 }, !0;
|
|
11238
11303
|
}
|
|
11239
|
-
} : void 0),
|
|
11304
|
+
} : void 0), Rt || (Rt = !1, $a(e, 0));
|
|
11240
11305
|
}
|
|
11241
11306
|
function La(n, e) {
|
|
11242
11307
|
let t, i = 2e8, r, s = 0, o = e.top, l = e.top, a, c;
|
|
@@ -11335,10 +11400,10 @@ function Af(n, e) {
|
|
|
11335
11400
|
return null;
|
|
11336
11401
|
}
|
|
11337
11402
|
if (ce)
|
|
11338
|
-
for (let c = o; i && c; c =
|
|
11403
|
+
for (let c = o; i && c; c = Xt(c))
|
|
11339
11404
|
c.draggable && (i = void 0);
|
|
11340
11405
|
if (o = Tf(o, e), i) {
|
|
11341
|
-
if (
|
|
11406
|
+
if (Te && i.nodeType == 1 && (r = Math.min(r, i.childNodes.length), r < i.childNodes.length)) {
|
|
11342
11407
|
let d = i.childNodes[r], u;
|
|
11343
11408
|
d.nodeName == "IMG" && (u = d.getBoundingClientRect()).right <= e.left && u.bottom > e.top && r++;
|
|
11344
11409
|
}
|
|
@@ -11363,11 +11428,11 @@ function Ze(n, e) {
|
|
|
11363
11428
|
}
|
|
11364
11429
|
const Of = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
|
|
11365
11430
|
function Fa(n, e, t) {
|
|
11366
|
-
let { node: i, offset: r, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o = Nn ||
|
|
11431
|
+
let { node: i, offset: r, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o = Nn || Te;
|
|
11367
11432
|
if (i.nodeType == 3)
|
|
11368
11433
|
if (o && (Of.test(i.nodeValue) || (t < 0 ? !r : r == i.nodeValue.length))) {
|
|
11369
11434
|
let a = Ze(He(i, r, r), t);
|
|
11370
|
-
if (
|
|
11435
|
+
if (Te && r && /\s/.test(i.nodeValue[r - 1]) && r < i.nodeValue.length) {
|
|
11371
11436
|
let c = Ze(He(i, r - 1, r - 1), -1);
|
|
11372
11437
|
if (c.top == a.top) {
|
|
11373
11438
|
let d = Ze(He(i, r, r + 1), -1);
|
|
@@ -11381,24 +11446,24 @@ function Fa(n, e, t) {
|
|
|
11381
11446
|
return t < 0 && !r ? (c++, d = -1) : t >= 0 && r == i.nodeValue.length ? (a--, d = 1) : t < 0 ? a-- : c++, rn(Ze(He(i, a, c), d), d < 0);
|
|
11382
11447
|
}
|
|
11383
11448
|
if (!n.state.doc.resolve(e - (s || 0)).parent.inlineContent) {
|
|
11384
|
-
if (s == null && r && (t < 0 || r ==
|
|
11449
|
+
if (s == null && r && (t < 0 || r == Se(i))) {
|
|
11385
11450
|
let a = i.childNodes[r - 1];
|
|
11386
11451
|
if (a.nodeType == 1)
|
|
11387
11452
|
return Ki(a.getBoundingClientRect(), !1);
|
|
11388
11453
|
}
|
|
11389
|
-
if (s == null && r <
|
|
11454
|
+
if (s == null && r < Se(i)) {
|
|
11390
11455
|
let a = i.childNodes[r];
|
|
11391
11456
|
if (a.nodeType == 1)
|
|
11392
11457
|
return Ki(a.getBoundingClientRect(), !0);
|
|
11393
11458
|
}
|
|
11394
11459
|
return Ki(i.getBoundingClientRect(), t >= 0);
|
|
11395
11460
|
}
|
|
11396
|
-
if (s == null && r && (t < 0 || r ==
|
|
11397
|
-
let a = i.childNodes[r - 1], c = a.nodeType == 3 ? He(a,
|
|
11461
|
+
if (s == null && r && (t < 0 || r == Se(i))) {
|
|
11462
|
+
let a = i.childNodes[r - 1], c = a.nodeType == 3 ? He(a, Se(a) - (o ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
|
|
11398
11463
|
if (c)
|
|
11399
11464
|
return rn(Ze(c, 1), !1);
|
|
11400
11465
|
}
|
|
11401
|
-
if (s == null && r <
|
|
11466
|
+
if (s == null && r < Se(i)) {
|
|
11402
11467
|
let a = i.childNodes[r];
|
|
11403
11468
|
for (; a.pmViewDesc && a.pmViewDesc.ignoreForCoords; )
|
|
11404
11469
|
a = a.nextSibling;
|
|
@@ -11482,10 +11547,10 @@ let yo = null, vo = null, bo = !1;
|
|
|
11482
11547
|
function Pf(n, e, t) {
|
|
11483
11548
|
return yo == e && vo == t ? bo : (yo = e, vo = t, bo = t == "up" || t == "down" ? Df(n, e, t) : Rf(n, e, t));
|
|
11484
11549
|
}
|
|
11485
|
-
const
|
|
11550
|
+
const Ne = 0, wo = 1, yt = 2, Be = 3;
|
|
11486
11551
|
class En {
|
|
11487
11552
|
constructor(e, t, i, r) {
|
|
11488
|
-
this.parent = e, this.children = t, this.dom = i, this.contentDOM = r, this.dirty =
|
|
11553
|
+
this.parent = e, this.children = t, this.dom = i, this.contentDOM = r, this.dirty = Ne, i.pmViewDesc = this;
|
|
11489
11554
|
}
|
|
11490
11555
|
// Used to check whether a given description corresponds to a
|
|
11491
11556
|
// widget/mark/node.
|
|
@@ -11742,7 +11807,7 @@ class En {
|
|
|
11742
11807
|
p = g;
|
|
11743
11808
|
}
|
|
11744
11809
|
let l = this.domFromPos(e, e ? -1 : 1), a = t == e ? l : this.domFromPos(t, t ? -1 : 1), c = i.root.getSelection(), d = i.domSelectionRange(), u = !1;
|
|
11745
|
-
if ((
|
|
11810
|
+
if ((Te || ce) && e == t) {
|
|
11746
11811
|
let { node: f, offset: p } = l;
|
|
11747
11812
|
if (f.nodeType == 3) {
|
|
11748
11813
|
if (u = !!(p && f.nodeValue[p - 1] == "\n"), u && p == f.nodeValue.length)
|
|
@@ -11760,14 +11825,14 @@ class En {
|
|
|
11760
11825
|
u = y && (y.nodeName == "BR" || y.contentEditable == "false");
|
|
11761
11826
|
}
|
|
11762
11827
|
}
|
|
11763
|
-
if (
|
|
11828
|
+
if (Te && d.focusNode && d.focusNode != a.node && d.focusNode.nodeType == 1) {
|
|
11764
11829
|
let f = d.focusNode.childNodes[d.focusOffset];
|
|
11765
11830
|
f && f.contentEditable == "false" && (r = !0);
|
|
11766
11831
|
}
|
|
11767
11832
|
if (!(r || u && ce) && Tt(l.node, l.offset, d.anchorNode, d.anchorOffset) && Tt(a.node, a.offset, d.focusNode, d.focusOffset))
|
|
11768
11833
|
return;
|
|
11769
11834
|
let h = !1;
|
|
11770
|
-
if ((c.extend || e == t) && !(u &&
|
|
11835
|
+
if ((c.extend || e == t) && !(u && Te)) {
|
|
11771
11836
|
c.collapse(l.node, l.offset);
|
|
11772
11837
|
try {
|
|
11773
11838
|
e != t && c.extend(a.node, a.offset), h = !0;
|
|
@@ -11844,7 +11909,7 @@ class Ha extends En {
|
|
|
11844
11909
|
super(e, [], o, null), this.widget = t, this.widget = t, s = this;
|
|
11845
11910
|
}
|
|
11846
11911
|
matchesWidget(e) {
|
|
11847
|
-
return this.dirty ==
|
|
11912
|
+
return this.dirty == Ne && e.type.eq(this.widget.type);
|
|
11848
11913
|
}
|
|
11849
11914
|
parseRule() {
|
|
11850
11915
|
return { ignore: !0 };
|
|
@@ -11901,11 +11966,11 @@ class Nt extends En {
|
|
|
11901
11966
|
return this.dirty != Be && this.mark.eq(e);
|
|
11902
11967
|
}
|
|
11903
11968
|
markDirty(e, t) {
|
|
11904
|
-
if (super.markDirty(e, t), this.dirty !=
|
|
11969
|
+
if (super.markDirty(e, t), this.dirty != Ne) {
|
|
11905
11970
|
let i = this.parent;
|
|
11906
11971
|
for (; !i.node; )
|
|
11907
11972
|
i = i.parent;
|
|
11908
|
-
i.dirty < this.dirty && (i.dirty = this.dirty), this.dirty =
|
|
11973
|
+
i.dirty < this.dirty && (i.dirty = this.dirty), this.dirty = Ne;
|
|
11909
11974
|
}
|
|
11910
11975
|
}
|
|
11911
11976
|
slice(e, t, i) {
|
|
@@ -11974,7 +12039,7 @@ class lt extends En {
|
|
|
11974
12039
|
return e;
|
|
11975
12040
|
}
|
|
11976
12041
|
matchesNode(e, t, i) {
|
|
11977
|
-
return this.dirty ==
|
|
12042
|
+
return this.dirty == Ne && e.eq(this.node) && ii(t, this.outerDeco) && i.eq(this.innerDeco);
|
|
11978
12043
|
}
|
|
11979
12044
|
get size() {
|
|
11980
12045
|
return this.node.nodeSize;
|
|
@@ -11994,7 +12059,7 @@ class lt extends En {
|
|
|
11994
12059
|
a.syncToMarks(c.marks, i, e);
|
|
11995
12060
|
let f;
|
|
11996
12061
|
a.findNodeMatch(c, d, u, h) || l && e.state.selection.from > r && e.state.selection.to < r + c.nodeSize && (f = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, d, u, f, e) || a.updateNextNode(c, d, u, e, h, r) || a.addNode(c, d, u, e, r), r += c.nodeSize;
|
|
11997
|
-
}), a.syncToMarks([], i, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == yt) && (o && this.protectLocalComposition(e, o), ja(this.contentDOM, this.children, e),
|
|
12062
|
+
}), a.syncToMarks([], i, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == yt) && (o && this.protectLocalComposition(e, o), ja(this.contentDOM, this.children, e), Gt && Wf(this.dom));
|
|
11998
12063
|
}
|
|
11999
12064
|
localCompositionInfo(e, t) {
|
|
12000
12065
|
let { from: i, to: r } = e.state.selection;
|
|
@@ -12029,7 +12094,7 @@ class lt extends En {
|
|
|
12029
12094
|
return this.dirty == Be || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, t, i, r), !0);
|
|
12030
12095
|
}
|
|
12031
12096
|
updateInner(e, t, i, r) {
|
|
12032
|
-
this.updateOuterDeco(t), this.node = e, this.innerDeco = i, this.contentDOM && this.updateChildren(r, this.posAtStart), this.dirty =
|
|
12097
|
+
this.updateOuterDeco(t), this.node = e, this.innerDeco = i, this.contentDOM && this.updateChildren(r, this.posAtStart), this.dirty = Ne;
|
|
12033
12098
|
}
|
|
12034
12099
|
updateOuterDeco(e) {
|
|
12035
12100
|
if (ii(e, this.outerDeco))
|
|
@@ -12065,7 +12130,7 @@ class Ci extends lt {
|
|
|
12065
12130
|
return { skip: e || !0 };
|
|
12066
12131
|
}
|
|
12067
12132
|
update(e, t, i, r) {
|
|
12068
|
-
return this.dirty == Be || this.dirty !=
|
|
12133
|
+
return this.dirty == Be || this.dirty != Ne && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(t), (this.dirty != Ne || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, r.trackWrites == this.nodeDOM && (r.trackWrites = null)), this.node = e, this.dirty = Ne, !0);
|
|
12069
12134
|
}
|
|
12070
12135
|
inParent() {
|
|
12071
12136
|
let e = this.parent.contentDOM;
|
|
@@ -12102,7 +12167,7 @@ class Wa extends En {
|
|
|
12102
12167
|
return { ignore: !0 };
|
|
12103
12168
|
}
|
|
12104
12169
|
matchesHack(e) {
|
|
12105
|
-
return this.dirty ==
|
|
12170
|
+
return this.dirty == Ne && this.dom.nodeName == e;
|
|
12106
12171
|
}
|
|
12107
12172
|
get domAtom() {
|
|
12108
12173
|
return !0;
|
|
@@ -12261,7 +12326,7 @@ class Bf {
|
|
|
12261
12326
|
for (; r < o && (r == s - 1 ? this.top : this.stack[r + 1 << 1]).matchesMark(e[r]) && e[r].type.spec.spanning !== !1; )
|
|
12262
12327
|
r++;
|
|
12263
12328
|
for (; r < s; )
|
|
12264
|
-
this.destroyRest(), this.top.dirty =
|
|
12329
|
+
this.destroyRest(), this.top.dirty = Ne, this.index = this.stack.pop(), this.top = this.stack.pop(), s--;
|
|
12265
12330
|
for (; s < e.length; ) {
|
|
12266
12331
|
this.stack.push(this.top, this.index + 1);
|
|
12267
12332
|
let l = -1;
|
|
@@ -12331,7 +12396,7 @@ class Bf {
|
|
|
12331
12396
|
if (!h && a.update(e, t, i, r))
|
|
12332
12397
|
return this.destroyBetween(this.index, l), a.dom != d && (this.changed = !0), this.index++, !0;
|
|
12333
12398
|
if (!h && (u = this.recreateWrapper(a, e, t, i, r, o)))
|
|
12334
|
-
return this.destroyBetween(this.index, l), this.top.children[this.index] = u, u.contentDOM && (u.dirty = yt, u.updateChildren(r, o + 1), u.dirty =
|
|
12399
|
+
return this.destroyBetween(this.index, l), this.top.children[this.index] = u, u.contentDOM && (u.dirty = yt, u.updateChildren(r, o + 1), u.dirty = Ne), this.changed = !0, this.index++, !0;
|
|
12335
12400
|
break;
|
|
12336
12401
|
}
|
|
12337
12402
|
}
|
|
@@ -12649,7 +12714,7 @@ function No(n, e, t) {
|
|
|
12649
12714
|
if (n.endOfTextblock(e > 0 ? "forward" : "backward")) {
|
|
12650
12715
|
let r = Er(n.state, e);
|
|
12651
12716
|
return r && r instanceof E ? Qe(n, r) : !1;
|
|
12652
|
-
} else if (!(
|
|
12717
|
+
} else if (!(xe && t.indexOf("m") > -1)) {
|
|
12653
12718
|
let r = i.$head, s = r.textOffset ? null : e < 0 ? r.nodeBefore : r.nodeAfter, o;
|
|
12654
12719
|
if (!s || s.isText)
|
|
12655
12720
|
return !1;
|
|
@@ -12674,7 +12739,7 @@ function pn(n, e) {
|
|
|
12674
12739
|
let t = n.pmViewDesc;
|
|
12675
12740
|
return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
|
|
12676
12741
|
}
|
|
12677
|
-
function
|
|
12742
|
+
function Pt(n, e) {
|
|
12678
12743
|
return e < 0 ? Kf(n) : Yf(n);
|
|
12679
12744
|
}
|
|
12680
12745
|
function Kf(n) {
|
|
@@ -12682,7 +12747,7 @@ function Kf(n) {
|
|
|
12682
12747
|
if (!t)
|
|
12683
12748
|
return;
|
|
12684
12749
|
let r, s, o = !1;
|
|
12685
|
-
for (
|
|
12750
|
+
for (Te && t.nodeType == 1 && i < ri(t) && pn(t.childNodes[i], -1) && (o = !0); ; )
|
|
12686
12751
|
if (i > 0) {
|
|
12687
12752
|
if (t.nodeType != 1)
|
|
12688
12753
|
break;
|
|
@@ -12811,7 +12876,7 @@ function Eo(n, e) {
|
|
|
12811
12876
|
}
|
|
12812
12877
|
function Ao(n, e, t) {
|
|
12813
12878
|
let i = n.state.selection;
|
|
12814
|
-
if (i instanceof R && !i.empty || t.indexOf("s") > -1 ||
|
|
12879
|
+
if (i instanceof R && !i.empty || t.indexOf("s") > -1 || xe && t.indexOf("m") > -1)
|
|
12815
12880
|
return !1;
|
|
12816
12881
|
let { $from: r, $to: s } = i;
|
|
12817
12882
|
if (!r.parent.inlineContent || n.endOfTextblock(e < 0 ? "up" : "down")) {
|
|
@@ -12820,7 +12885,7 @@ function Ao(n, e, t) {
|
|
|
12820
12885
|
return Qe(n, o);
|
|
12821
12886
|
}
|
|
12822
12887
|
if (!r.parent.inlineContent) {
|
|
12823
|
-
let o = e < 0 ? r : s, l = i instanceof
|
|
12888
|
+
let o = e < 0 ? r : s, l = i instanceof _e ? P.near(o, e) : P.findFrom(o, e);
|
|
12824
12889
|
return l ? Qe(n, l) : !1;
|
|
12825
12890
|
}
|
|
12826
12891
|
return !1;
|
|
@@ -12861,24 +12926,24 @@ function Qf(n) {
|
|
|
12861
12926
|
}
|
|
12862
12927
|
function ep(n, e) {
|
|
12863
12928
|
let t = e.keyCode, i = Qf(e);
|
|
12864
|
-
if (t == 8 ||
|
|
12865
|
-
return Oo(n, -1) ||
|
|
12866
|
-
if (t == 46 && !e.shiftKey ||
|
|
12867
|
-
return Oo(n, 1) ||
|
|
12929
|
+
if (t == 8 || xe && t == 72 && i == "c")
|
|
12930
|
+
return Oo(n, -1) || Pt(n, -1);
|
|
12931
|
+
if (t == 46 && !e.shiftKey || xe && t == 68 && i == "c")
|
|
12932
|
+
return Oo(n, 1) || Pt(n, 1);
|
|
12868
12933
|
if (t == 13 || t == 27)
|
|
12869
12934
|
return !0;
|
|
12870
|
-
if (t == 37 ||
|
|
12935
|
+
if (t == 37 || xe && t == 66 && i == "c") {
|
|
12871
12936
|
let r = t == 37 ? Eo(n, n.state.selection.from) == "ltr" ? -1 : 1 : -1;
|
|
12872
|
-
return No(n, r, i) ||
|
|
12873
|
-
} else if (t == 39 ||
|
|
12937
|
+
return No(n, r, i) || Pt(n, r);
|
|
12938
|
+
} else if (t == 39 || xe && t == 70 && i == "c") {
|
|
12874
12939
|
let r = t == 39 ? Eo(n, n.state.selection.from) == "ltr" ? 1 : -1 : 1;
|
|
12875
|
-
return No(n, r, i) ||
|
|
12940
|
+
return No(n, r, i) || Pt(n, r);
|
|
12876
12941
|
} else {
|
|
12877
|
-
if (t == 38 ||
|
|
12878
|
-
return Ao(n, -1, i) ||
|
|
12879
|
-
if (t == 40 ||
|
|
12880
|
-
return Zf(n) || Ao(n, 1, i) ||
|
|
12881
|
-
if (i == (
|
|
12942
|
+
if (t == 38 || xe && t == 80 && i == "c")
|
|
12943
|
+
return Ao(n, -1, i) || Pt(n, -1);
|
|
12944
|
+
if (t == 40 || xe && t == 78 && i == "c")
|
|
12945
|
+
return Zf(n) || Ao(n, 1, i) || Pt(n, 1);
|
|
12946
|
+
if (i == (xe ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
|
|
12882
12947
|
return !0;
|
|
12883
12948
|
}
|
|
12884
12949
|
return !1;
|
|
@@ -13122,7 +13187,7 @@ function hp(n, e) {
|
|
|
13122
13187
|
pe.keydown = (n, e) => {
|
|
13123
13188
|
let t = e;
|
|
13124
13189
|
if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !rc(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(Ue && Z && t.keyCode == 13)))
|
|
13125
|
-
if (t.keyCode != 229 && n.domObserver.forceFlush(),
|
|
13190
|
+
if (t.keyCode != 229 && n.domObserver.forceFlush(), Gt && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
|
|
13126
13191
|
let i = Date.now();
|
|
13127
13192
|
n.input.lastIOSEnter = i, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
13128
13193
|
n.input.lastIOSEnter == i && (n.someProp("handleKeyDown", (r) => r(n, gt(13, "Enter"))), n.input.lastIOSEnter = 0);
|
|
@@ -13135,7 +13200,7 @@ pe.keyup = (n, e) => {
|
|
|
13135
13200
|
};
|
|
13136
13201
|
pe.keypress = (n, e) => {
|
|
13137
13202
|
let t = e;
|
|
13138
|
-
if (rc(n, t) || !t.charCode || t.ctrlKey && !t.altKey ||
|
|
13203
|
+
if (rc(n, t) || !t.charCode || t.ctrlKey && !t.altKey || xe && t.metaKey)
|
|
13139
13204
|
return;
|
|
13140
13205
|
if (n.someProp("handleKeyPress", (r) => r(n, t))) {
|
|
13141
13206
|
t.preventDefault();
|
|
@@ -13163,7 +13228,7 @@ function Qr(n, e, t, i, r) {
|
|
|
13163
13228
|
return !0;
|
|
13164
13229
|
return !1;
|
|
13165
13230
|
}
|
|
13166
|
-
function
|
|
13231
|
+
function qt(n, e, t) {
|
|
13167
13232
|
if (n.focused || n.focus(), n.state.selection.eq(e))
|
|
13168
13233
|
return;
|
|
13169
13234
|
let i = n.state.tr.setSelection(e);
|
|
@@ -13173,7 +13238,7 @@ function pp(n, e) {
|
|
|
13173
13238
|
if (e == -1)
|
|
13174
13239
|
return !1;
|
|
13175
13240
|
let t = n.state.doc.resolve(e), i = t.nodeAfter;
|
|
13176
|
-
return i && i.isAtom && E.isSelectable(i) ? (
|
|
13241
|
+
return i && i.isAtom && E.isSelectable(i) ? (qt(n, new E(t), "pointer"), !0) : !1;
|
|
13177
13242
|
}
|
|
13178
13243
|
function mp(n, e) {
|
|
13179
13244
|
if (e == -1)
|
|
@@ -13188,7 +13253,7 @@ function mp(n, e) {
|
|
|
13188
13253
|
break;
|
|
13189
13254
|
}
|
|
13190
13255
|
}
|
|
13191
|
-
return r != null ? (
|
|
13256
|
+
return r != null ? (qt(n, E.create(n.state.doc, r), "pointer"), !0) : !1;
|
|
13192
13257
|
}
|
|
13193
13258
|
function gp(n, e, t, i, r) {
|
|
13194
13259
|
return Qr(n, "handleClickOn", e, t, i) || n.someProp("handleClick", (s) => s(n, e, i)) || (r ? mp(n, t) : pp(n, t));
|
|
@@ -13204,14 +13269,14 @@ function bp(n, e, t) {
|
|
|
13204
13269
|
return !1;
|
|
13205
13270
|
let i = n.state.doc;
|
|
13206
13271
|
if (e == -1)
|
|
13207
|
-
return i.inlineContent ? (
|
|
13272
|
+
return i.inlineContent ? (qt(n, R.create(i, 0, i.content.size), "pointer"), !0) : !1;
|
|
13208
13273
|
let r = i.resolve(e);
|
|
13209
13274
|
for (let s = r.depth + 1; s > 0; s--) {
|
|
13210
13275
|
let o = s > r.depth ? r.nodeAfter : r.node(s), l = r.before(s);
|
|
13211
13276
|
if (o.inlineContent)
|
|
13212
|
-
|
|
13277
|
+
qt(n, R.create(i, l + 1, l + 1 + o.content.size), "pointer");
|
|
13213
13278
|
else if (E.isSelectable(o))
|
|
13214
|
-
|
|
13279
|
+
qt(n, E.create(i, l), "pointer");
|
|
13215
13280
|
else
|
|
13216
13281
|
continue;
|
|
13217
13282
|
return !0;
|
|
@@ -13220,7 +13285,7 @@ function bp(n, e, t) {
|
|
|
13220
13285
|
function es(n) {
|
|
13221
13286
|
return si(n);
|
|
13222
13287
|
}
|
|
13223
|
-
const ic =
|
|
13288
|
+
const ic = xe ? "metaKey" : "ctrlKey";
|
|
13224
13289
|
fe.mousedown = (n, e) => {
|
|
13225
13290
|
let t = e;
|
|
13226
13291
|
n.input.shiftKey = t.shiftKey;
|
|
@@ -13246,7 +13311,7 @@ class wp {
|
|
|
13246
13311
|
node: s,
|
|
13247
13312
|
pos: o,
|
|
13248
13313
|
addAttr: !!(this.target && !this.target.draggable),
|
|
13249
|
-
setUneditable: !!(this.target &&
|
|
13314
|
+
setUneditable: !!(this.target && Te && !this.target.hasAttribute("contentEditable"))
|
|
13250
13315
|
}), this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable) && (this.view.domObserver.stop(), this.mightDrag.addAttr && (this.target.draggable = !0), this.mightDrag.setUneditable && setTimeout(() => {
|
|
13251
13316
|
this.view.input.mouseDown == this && this.target.setAttribute("contentEditable", "false");
|
|
13252
13317
|
}, 20), this.view.domObserver.start()), e.root.addEventListener("mouseup", this.up = this.up.bind(this)), e.root.addEventListener("mousemove", this.move = this.move.bind(this)), rt(e, "pointer");
|
|
@@ -13266,7 +13331,7 @@ class wp {
|
|
|
13266
13331
|
// (hidden) cursor is doesn't change the selection, and
|
|
13267
13332
|
// thus doesn't get a reaction from ProseMirror. This
|
|
13268
13333
|
// works around that.
|
|
13269
|
-
Z && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (
|
|
13334
|
+
Z && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (qt(this.view, P.near(this.view.state.doc.resolve(t.pos)), "pointer"), e.preventDefault()) : rt(this.view, "pointer");
|
|
13270
13335
|
}
|
|
13271
13336
|
move(e) {
|
|
13272
13337
|
this.updateAllowDefault(e), rt(this.view, "pointer"), e.buttons == 0 && this.done();
|
|
@@ -13292,7 +13357,7 @@ pe.compositionstart = pe.compositionupdate = (n) => {
|
|
|
13292
13357
|
let { state: e } = n, t = e.selection.$to;
|
|
13293
13358
|
if (e.selection instanceof R && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((i) => i.type.spec.inclusive === !1) || Z && Pa && kp(n)))
|
|
13294
13359
|
n.markCursor = n.state.storedMarks || t.marks(), si(n, !0), n.markCursor = null;
|
|
13295
|
-
else if (si(n, !e.selection.empty),
|
|
13360
|
+
else if (si(n, !e.selection.empty), Te && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
|
|
13296
13361
|
let i = n.domSelectionRange();
|
|
13297
13362
|
for (let r = i.focusNode, s = i.focusOffset; r && r.nodeType == 1 && s != 0; ) {
|
|
13298
13363
|
let o = s < 0 ? r.lastChild : r.childNodes[s - 1];
|
|
@@ -13369,7 +13434,7 @@ function Mp(n, e) {
|
|
|
13369
13434
|
t.parentNode && t.parentNode.removeChild(t), n.focus();
|
|
13370
13435
|
}, 50);
|
|
13371
13436
|
}
|
|
13372
|
-
const Cn = ve && ot < 15 ||
|
|
13437
|
+
const Cn = ve && ot < 15 || Gt && wf < 604;
|
|
13373
13438
|
fe.copy = pe.cut = (n, e) => {
|
|
13374
13439
|
let t = e, i = n.state.selection, r = t.type == "cut";
|
|
13375
13440
|
if (i.empty)
|
|
@@ -13418,7 +13483,7 @@ class ac {
|
|
|
13418
13483
|
this.slice = e, this.move = t, this.node = i;
|
|
13419
13484
|
}
|
|
13420
13485
|
}
|
|
13421
|
-
const Np =
|
|
13486
|
+
const Np = xe ? "altKey" : "ctrlKey";
|
|
13422
13487
|
function cc(n, e) {
|
|
13423
13488
|
let t = n.someProp("dragCopies", (i) => !i(e));
|
|
13424
13489
|
return t != null ? t : !e[Np];
|
|
@@ -13654,13 +13719,13 @@ class he {
|
|
|
13654
13719
|
return this.type instanceof oi;
|
|
13655
13720
|
}
|
|
13656
13721
|
}
|
|
13657
|
-
const
|
|
13722
|
+
const Bt = [], kt = {};
|
|
13658
13723
|
class H {
|
|
13659
13724
|
/**
|
|
13660
13725
|
@internal
|
|
13661
13726
|
*/
|
|
13662
13727
|
constructor(e, t) {
|
|
13663
|
-
this.local = e.length ? e :
|
|
13728
|
+
this.local = e.length ? e : Bt, this.children = t.length ? t : Bt;
|
|
13664
13729
|
}
|
|
13665
13730
|
/**
|
|
13666
13731
|
Create a set of decorations, using the structure of the given
|
|
@@ -13709,7 +13774,7 @@ class H {
|
|
|
13709
13774
|
let a = this.local[l].map(e, i, r);
|
|
13710
13775
|
a && a.type.valid(t, a) ? (o || (o = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
|
|
13711
13776
|
}
|
|
13712
|
-
return this.children.length ? Ap(this.children, o || [], e, t, i, r, s) : o ? new H(o.sort(xt),
|
|
13777
|
+
return this.children.length ? Ap(this.children, o || [], e, t, i, r, s) : o ? new H(o.sort(xt), Bt) : ae;
|
|
13713
13778
|
}
|
|
13714
13779
|
/**
|
|
13715
13780
|
Add the given array of decorations to the ones in the set,
|
|
@@ -13782,7 +13847,7 @@ class H {
|
|
|
13782
13847
|
}
|
|
13783
13848
|
}
|
|
13784
13849
|
if (r) {
|
|
13785
|
-
let l = new H(r.sort(xt),
|
|
13850
|
+
let l = new H(r.sort(xt), Bt);
|
|
13786
13851
|
return i ? new tt([l, i]) : l;
|
|
13787
13852
|
}
|
|
13788
13853
|
return i || ae;
|
|
@@ -13814,7 +13879,7 @@ class H {
|
|
|
13814
13879
|
*/
|
|
13815
13880
|
localsInner(e) {
|
|
13816
13881
|
if (this == ae)
|
|
13817
|
-
return
|
|
13882
|
+
return Bt;
|
|
13818
13883
|
if (e.inlineContent || !this.local.some(at.is))
|
|
13819
13884
|
return this.local;
|
|
13820
13885
|
let t = [];
|
|
@@ -13868,7 +13933,7 @@ class tt {
|
|
|
13868
13933
|
t.push(s[o]);
|
|
13869
13934
|
}
|
|
13870
13935
|
}
|
|
13871
|
-
return t ? ns(i ? t : t.sort(xt)) :
|
|
13936
|
+
return t ? ns(i ? t : t.sort(xt)) : Bt;
|
|
13872
13937
|
}
|
|
13873
13938
|
// Create a group for the given array of decoration sets, or return
|
|
13874
13939
|
// a single set when possible.
|
|
@@ -14104,9 +14169,9 @@ class Pp {
|
|
|
14104
14169
|
if (!e.focusNode)
|
|
14105
14170
|
return !0;
|
|
14106
14171
|
let t = /* @__PURE__ */ new Set(), i;
|
|
14107
|
-
for (let s = e.focusNode; s; s =
|
|
14172
|
+
for (let s = e.focusNode; s; s = Xt(s))
|
|
14108
14173
|
t.add(s);
|
|
14109
|
-
for (let s = e.anchorNode; s; s =
|
|
14174
|
+
for (let s = e.anchorNode; s; s = Xt(s))
|
|
14110
14175
|
if (t.has(s)) {
|
|
14111
14176
|
i = s;
|
|
14112
14177
|
break;
|
|
@@ -14136,7 +14201,7 @@ class Pp {
|
|
|
14136
14201
|
let u = this.registerMutation(t[d], a);
|
|
14137
14202
|
u && (s = s < 0 ? u.from : Math.min(u.from, s), o = o < 0 ? u.to : Math.max(u.to, o), u.typeOver && (l = !0));
|
|
14138
14203
|
}
|
|
14139
|
-
if (
|
|
14204
|
+
if (Te && a.length) {
|
|
14140
14205
|
let d = a.filter((u) => u.nodeName == "BR");
|
|
14141
14206
|
if (d.length == 2) {
|
|
14142
14207
|
let [u, h] = d;
|
|
@@ -14195,7 +14260,7 @@ class Pp {
|
|
|
14195
14260
|
let zo = /* @__PURE__ */ new WeakMap(), $o = !1;
|
|
14196
14261
|
function zp(n) {
|
|
14197
14262
|
if (!zo.has(n) && (zo.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
|
|
14198
|
-
if (n.requiresGeckoHackNode =
|
|
14263
|
+
if (n.requiresGeckoHackNode = Te, $o)
|
|
14199
14264
|
return;
|
|
14200
14265
|
console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."), $o = !0;
|
|
14201
14266
|
}
|
|
@@ -14285,7 +14350,7 @@ function Hp(n, e, t, i, r) {
|
|
|
14285
14350
|
let a = n.state.selection, c = Bp(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), h, f;
|
|
14286
14351
|
n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (h = n.state.selection.to, f = "end") : (h = n.state.selection.from, f = "start"), n.input.lastKeyCode = null;
|
|
14287
14352
|
let p = qp(u.content, c.doc.content, c.from, h, f);
|
|
14288
|
-
if (p && n.input.domChangeCount++, (
|
|
14353
|
+
if (p && n.input.domChangeCount++, (Gt && n.input.lastIOSEnter > Date.now() - 225 || Ue) && r.some((_) => _.nodeType == 1 && !Vp.test(_.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (_) => _(n, gt(13, "Enter")))) {
|
|
14289
14354
|
n.input.lastIOSEnter = 0;
|
|
14290
14355
|
return;
|
|
14291
14356
|
}
|
|
@@ -14304,7 +14369,7 @@ function Hp(n, e, t, i, r) {
|
|
|
14304
14369
|
}
|
|
14305
14370
|
n.state.selection.from < n.state.selection.to && p.start == p.endB && n.state.selection instanceof R && (p.start > n.state.selection.from && p.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? p.start = n.state.selection.from : p.endA < n.state.selection.to && p.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (p.endB += n.state.selection.to - p.endA, p.endA = n.state.selection.to)), ve && ot <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == " " && (p.start--, p.endA--, p.endB--);
|
|
14306
14371
|
let y = c.doc.resolveNoCache(p.start - c.from), g = c.doc.resolveNoCache(p.endB - c.from), v = d.resolve(p.start), b = y.sameParent(g) && y.parent.inlineContent && v.end() >= p.endA;
|
|
14307
|
-
if ((
|
|
14372
|
+
if ((Gt && n.input.lastIOSEnter > Date.now() - 225 && (!b || r.some((_) => _.nodeName == "DIV" || _.nodeName == "P")) || !b && y.pos < c.doc.content.size && (!y.sameParent(g) || !y.parent.inlineContent) && y.pos < g.pos && !/\S/.test(c.doc.textBetween(y.pos, g.pos, "", ""))) && n.someProp("handleKeyDown", (_) => _(n, gt(13, "Enter")))) {
|
|
14308
14373
|
n.input.lastIOSEnter = 0;
|
|
14309
14374
|
return;
|
|
14310
14375
|
}
|
|
@@ -15117,7 +15182,7 @@ var im = () => ({ editor: n, view: e }) => (requestAnimationFrame(() => {
|
|
|
15117
15182
|
const { doc: c, mapping: d } = e, u = c.resolve(d.map(a)), h = c.resolve(d.map(a + l.nodeSize)), f = u.blockRange(h);
|
|
15118
15183
|
if (!f)
|
|
15119
15184
|
return;
|
|
15120
|
-
const p =
|
|
15185
|
+
const p = tn(f);
|
|
15121
15186
|
if (l.type.isTextblock) {
|
|
15122
15187
|
const { defaultType: y } = u.parent.contentMatchAt(u.index());
|
|
15123
15188
|
e.setNodeMarkup(f.start, y);
|
|
@@ -15517,7 +15582,7 @@ var Lm = (n, e) => ({ tr: t, state: i, dispatch: r }) => {
|
|
|
15517
15582
|
}), a;
|
|
15518
15583
|
}, Bm = () => ({ tr: n, dispatch: e }) => (e && n.scrollIntoView(), !0), Fm = () => ({ tr: n, dispatch: e }) => {
|
|
15519
15584
|
if (e) {
|
|
15520
|
-
const t = new
|
|
15585
|
+
const t = new _e(n.doc);
|
|
15521
15586
|
n.setSelection(t);
|
|
15522
15587
|
}
|
|
15523
15588
|
return !0;
|
|
@@ -15610,7 +15675,7 @@ function B(n, e = void 0, ...t) {
|
|
|
15610
15675
|
function Xm(n = {}) {
|
|
15611
15676
|
return Object.keys(n).length === 0 && n.constructor === Object;
|
|
15612
15677
|
}
|
|
15613
|
-
function
|
|
15678
|
+
function Zt(n) {
|
|
15614
15679
|
const e = n.filter((r) => r.type === "extension"), t = n.filter((r) => r.type === "node"), i = n.filter((r) => r.type === "mark");
|
|
15615
15680
|
return {
|
|
15616
15681
|
baseExtensions: e,
|
|
@@ -15619,7 +15684,7 @@ function Gt(n) {
|
|
|
15619
15684
|
};
|
|
15620
15685
|
}
|
|
15621
15686
|
function Sc(n) {
|
|
15622
|
-
const e = [], { nodeExtensions: t, markExtensions: i } =
|
|
15687
|
+
const e = [], { nodeExtensions: t, markExtensions: i } = Zt(n), r = [...t, ...i], s = {
|
|
15623
15688
|
default: null,
|
|
15624
15689
|
validate: void 0,
|
|
15625
15690
|
rendered: !0,
|
|
@@ -15745,7 +15810,7 @@ function Xo(n) {
|
|
|
15745
15810
|
}
|
|
15746
15811
|
function Zm(n, e) {
|
|
15747
15812
|
var t;
|
|
15748
|
-
const i = Sc(n), { nodeExtensions: r, markExtensions: s } =
|
|
15813
|
+
const i = Sc(n), { nodeExtensions: r, markExtensions: s } = Zt(n), o = (t = r.find((c) => T(c, "topNode"))) == null ? void 0 : t.name, l = Object.fromEntries(
|
|
15749
15814
|
r.map((c) => {
|
|
15750
15815
|
const d = i.filter((v) => v.type === c.name), u = {
|
|
15751
15816
|
name: c.name,
|
|
@@ -15986,7 +16051,7 @@ function Go(n, e) {
|
|
|
15986
16051
|
return Array.isArray(e) ? e.some((t) => (typeof t == "string" ? t : t.name) === n.name) : e;
|
|
15987
16052
|
}
|
|
15988
16053
|
function Zo(n, e) {
|
|
15989
|
-
const { nodeExtensions: t } =
|
|
16054
|
+
const { nodeExtensions: t } = Zt(e), i = t.find((o) => o.name === n);
|
|
15990
16055
|
if (!i)
|
|
15991
16056
|
return !1;
|
|
15992
16057
|
const r = {
|
|
@@ -16143,7 +16208,7 @@ function Qo(n, e) {
|
|
|
16143
16208
|
var b0 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor: r }) => {
|
|
16144
16209
|
const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = r.extensionManager.attributes, d = Un(c, l.node().type.name, l.node().attrs);
|
|
16145
16210
|
if (s instanceof E && s.node.isBlock)
|
|
16146
|
-
return !l.parentOffset || !
|
|
16211
|
+
return !l.parentOffset || !Wt(o, l.pos) ? !1 : (i && (n && Qo(t, r.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
|
|
16147
16212
|
if (!l.parent.isBlock)
|
|
16148
16213
|
return !1;
|
|
16149
16214
|
const u = a.parentOffset === a.parent.content.size, h = l.depth === 0 ? void 0 : Km(l.node(-1).contentMatchAt(l.indexAfter(-1)));
|
|
@@ -16152,8 +16217,8 @@ var b0 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
|
|
|
16152
16217
|
type: h,
|
|
16153
16218
|
attrs: d
|
|
16154
16219
|
}
|
|
16155
|
-
] : void 0, p =
|
|
16156
|
-
if (!f && !p &&
|
|
16220
|
+
] : void 0, p = Wt(e.doc, e.mapping.map(l.pos), 1, f);
|
|
16221
|
+
if (!f && !p && Wt(e.doc, e.mapping.map(l.pos), 1, h ? [{ type: h }] : void 0) && (p = !0, f = h ? [
|
|
16157
16222
|
{
|
|
16158
16223
|
type: h,
|
|
16159
16224
|
attrs: d
|
|
@@ -16214,7 +16279,7 @@ var b0 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
|
|
|
16214
16279
|
{ type: l, attrs: p },
|
|
16215
16280
|
{ type: f, attrs: y }
|
|
16216
16281
|
] : [{ type: l, attrs: p }];
|
|
16217
|
-
if (!
|
|
16282
|
+
if (!Wt(t.doc, a.pos, 2))
|
|
16218
16283
|
return !1;
|
|
16219
16284
|
if (r) {
|
|
16220
16285
|
const { selection: v, storedMarks: b } = i, { splittableMarks: C } = s.extensionManager, w = b || v.$to.parentOffset && v.$from.marks();
|
|
@@ -16630,12 +16695,12 @@ function F0(n) {
|
|
|
16630
16695
|
B0(_, s.find, o).forEach((I) => {
|
|
16631
16696
|
if (I.index === void 0)
|
|
16632
16697
|
return;
|
|
16633
|
-
const ue = x + I.index + 1, me = ue + I[0].length,
|
|
16698
|
+
const ue = x + I.index + 1, me = ue + I[0].length, Ae = {
|
|
16634
16699
|
from: t.tr.mapping.map(ue),
|
|
16635
16700
|
to: t.tr.mapping.map(me)
|
|
16636
16701
|
}, Ai = s.handler({
|
|
16637
16702
|
state: t,
|
|
16638
|
-
range:
|
|
16703
|
+
range: Ae,
|
|
16639
16704
|
match: I,
|
|
16640
16705
|
commands: a,
|
|
16641
16706
|
chain: c,
|
|
@@ -16845,7 +16910,7 @@ var Ti = class {
|
|
|
16845
16910
|
* @returns An object with all node views where the key is the node name and the value is the node view function
|
|
16846
16911
|
*/
|
|
16847
16912
|
get nodeViews() {
|
|
16848
|
-
const { editor: n } = this, { nodeExtensions: e } =
|
|
16913
|
+
const { editor: n } = this, { nodeExtensions: e } = Zt(this.extensions);
|
|
16849
16914
|
return Object.fromEntries(
|
|
16850
16915
|
e.filter((t) => !!T(t, "addNodeView")).map((t) => {
|
|
16851
16916
|
const i = this.attributes.filter((a) => a.type === t.name), r = {
|
|
@@ -16880,7 +16945,7 @@ var Ti = class {
|
|
|
16880
16945
|
);
|
|
16881
16946
|
}
|
|
16882
16947
|
get markViews() {
|
|
16883
|
-
const { editor: n } = this, { markExtensions: e } =
|
|
16948
|
+
const { editor: n } = this, { markExtensions: e } = Zt(this.extensions);
|
|
16884
16949
|
return Object.fromEntries(
|
|
16885
16950
|
e.filter((t) => !!T(t, "addMarkView")).map((t) => {
|
|
16886
16951
|
const i = this.attributes.filter((l) => l.type === t.name), r = {
|
|
@@ -17036,7 +17101,7 @@ var X = class Dc extends hs {
|
|
|
17036
17101
|
const h = d.mapping;
|
|
17037
17102
|
d.steps.forEach((f, p) => {
|
|
17038
17103
|
var y, g;
|
|
17039
|
-
if (f instanceof
|
|
17104
|
+
if (f instanceof De) {
|
|
17040
17105
|
const v = h.slice(p).map(f.from, -1), b = h.slice(p).map(f.to), C = h.invert().map(v, -1), w = h.invert().map(b), x = (y = d.doc.nodeAt(v - 1)) == null ? void 0 : y.marks.some((_) => _.eq(f.mark)), M = (g = d.doc.nodeAt(b)) == null ? void 0 : g.marks.some((_) => _.eq(f.mark));
|
|
17041
17106
|
this.editor.emit("delete", {
|
|
17042
17107
|
type: "mark",
|
|
@@ -17234,7 +17299,7 @@ var X = class Dc extends hs {
|
|
|
17234
17299
|
addGlobalAttributes() {
|
|
17235
17300
|
if (!this.options.direction)
|
|
17236
17301
|
return [];
|
|
17237
|
-
const { nodeExtensions: n } =
|
|
17302
|
+
const { nodeExtensions: n } = Zt(this.extensions);
|
|
17238
17303
|
return [
|
|
17239
17304
|
{
|
|
17240
17305
|
types: n.filter((e) => e.name !== "text").map((e) => e.name),
|
|
@@ -17268,7 +17333,7 @@ var X = class Dc extends hs {
|
|
|
17268
17333
|
})
|
|
17269
17334
|
];
|
|
17270
17335
|
}
|
|
17271
|
-
}), j0 = class
|
|
17336
|
+
}), j0 = class Ft {
|
|
17272
17337
|
constructor(e, t, i = !1, r = null) {
|
|
17273
17338
|
this.currentNode = null, this.actualDepth = null, this.isBlock = i, this.resolvedPos = e, this.editor = t, this.currentNode = r;
|
|
17274
17339
|
}
|
|
@@ -17327,15 +17392,15 @@ var X = class Dc extends hs {
|
|
|
17327
17392
|
if (this.depth === 0)
|
|
17328
17393
|
return null;
|
|
17329
17394
|
const e = this.resolvedPos.start(this.resolvedPos.depth - 1), t = this.resolvedPos.doc.resolve(e);
|
|
17330
|
-
return new
|
|
17395
|
+
return new Ft(t, this.editor);
|
|
17331
17396
|
}
|
|
17332
17397
|
get before() {
|
|
17333
17398
|
let e = this.resolvedPos.doc.resolve(this.from - (this.isBlock ? 1 : 2));
|
|
17334
|
-
return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.from - 3)), new
|
|
17399
|
+
return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.from - 3)), new Ft(e, this.editor);
|
|
17335
17400
|
}
|
|
17336
17401
|
get after() {
|
|
17337
17402
|
let e = this.resolvedPos.doc.resolve(this.to + (this.isBlock ? 2 : 1));
|
|
17338
|
-
return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.to + 3)), new
|
|
17403
|
+
return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.to + 3)), new Ft(e, this.editor);
|
|
17339
17404
|
}
|
|
17340
17405
|
get children() {
|
|
17341
17406
|
const e = [];
|
|
@@ -17346,8 +17411,8 @@ var X = class Dc extends hs {
|
|
|
17346
17411
|
const l = this.resolvedPos.doc.resolve(o);
|
|
17347
17412
|
if (!r && l.depth <= this.depth)
|
|
17348
17413
|
return;
|
|
17349
|
-
const a = new
|
|
17350
|
-
r && (a.actualDepth = this.depth + 1), e.push(new
|
|
17414
|
+
const a = new Ft(l, this.editor, r, r ? t : null);
|
|
17415
|
+
r && (a.actualDepth = this.depth + 1), e.push(new Ft(l, this.editor, r, r ? t : null));
|
|
17351
17416
|
}), e;
|
|
17352
17417
|
}
|
|
17353
17418
|
get firstChild() {
|
|
@@ -17441,7 +17506,7 @@ var J0 = class extends D0 {
|
|
|
17441
17506
|
createMappablePosition: d0
|
|
17442
17507
|
}, this.setOptions(n), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("mount", this.options.onMount), this.on("unmount", this.options.onUnmount), this.on("contentError", this.options.onContentError), this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", this.options.onFocus), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), this.on("drop", ({ event: i, slice: r, moved: s }) => this.options.onDrop(i, r, s)), this.on("paste", ({ event: i, slice: r }) => this.options.onPaste(i, r)), this.on("delete", this.options.onDelete);
|
|
17443
17508
|
const e = this.createDoc(), t = bc(e, this.options.autofocus);
|
|
17444
|
-
this.editorState =
|
|
17509
|
+
this.editorState = Vt.create({
|
|
17445
17510
|
doc: e,
|
|
17446
17511
|
schema: this.schema,
|
|
17447
17512
|
selection: t || void 0
|
|
@@ -18244,13 +18309,13 @@ function Q0(n) {
|
|
|
18244
18309
|
if (me)
|
|
18245
18310
|
w += 1;
|
|
18246
18311
|
else if (w -= 1, w === 0) {
|
|
18247
|
-
const
|
|
18248
|
-
M =
|
|
18312
|
+
const Ae = O.slice(0, ue);
|
|
18313
|
+
M = Ae.trim();
|
|
18249
18314
|
const Ai = u.slice(0, x + ue + I[0].length);
|
|
18250
18315
|
let Xe = [];
|
|
18251
18316
|
if (M)
|
|
18252
18317
|
if (l === "block")
|
|
18253
|
-
for (Xe = f.blockTokens(
|
|
18318
|
+
for (Xe = f.blockTokens(Ae), Xe.forEach((Fe) => {
|
|
18254
18319
|
Fe.text && (!Fe.tokens || Fe.tokens.length === 0) && (Fe.tokens = f.inlineTokens(Fe.text));
|
|
18255
18320
|
}); Xe.length > 0; ) {
|
|
18256
18321
|
const Fe = Xe[Xe.length - 1];
|
|
@@ -18886,7 +18951,7 @@ var C1 = /* @__PURE__ */ function(n) {
|
|
|
18886
18951
|
}, e;
|
|
18887
18952
|
}(te);
|
|
18888
18953
|
const k1 = 500;
|
|
18889
|
-
class
|
|
18954
|
+
class Oe {
|
|
18890
18955
|
constructor(e, t) {
|
|
18891
18956
|
this.items = e, this.eventCount = t;
|
|
18892
18957
|
}
|
|
@@ -18916,7 +18981,7 @@ class Ae {
|
|
|
18916
18981
|
} else
|
|
18917
18982
|
o.maybeStep(u.step);
|
|
18918
18983
|
if (u.selection)
|
|
18919
|
-
return l = r ? u.selection.map(r.slice(s)) : u.selection, a = new
|
|
18984
|
+
return l = r ? u.selection.map(r.slice(s)) : u.selection, a = new Oe(this.items.slice(0, i).append(d.reverse().concat(c)), this.eventCount - 1), !1;
|
|
18920
18985
|
}, this.items.length, 0), { remaining: a, transform: o, selection: l };
|
|
18921
18986
|
}
|
|
18922
18987
|
// Create a new branch with the given transform added.
|
|
@@ -18927,7 +18992,7 @@ class Ae {
|
|
|
18927
18992
|
(f = a && a.merge(h)) && (h = f, d ? s.pop() : l = l.slice(0, l.length - 1)), s.push(h), t && (o++, t = void 0), r || (a = h);
|
|
18928
18993
|
}
|
|
18929
18994
|
let c = o - i.depth;
|
|
18930
|
-
return c > S1 && (l = x1(l, c), o -= c), new
|
|
18995
|
+
return c > S1 && (l = x1(l, c), o -= c), new Oe(l.append(s), o);
|
|
18931
18996
|
}
|
|
18932
18997
|
remapping(e, t) {
|
|
18933
18998
|
let i = new bn();
|
|
@@ -18937,7 +19002,7 @@ class Ae {
|
|
|
18937
19002
|
}, e, t), i;
|
|
18938
19003
|
}
|
|
18939
19004
|
addMaps(e) {
|
|
18940
|
-
return this.eventCount == 0 ? this : new
|
|
19005
|
+
return this.eventCount == 0 ? this : new Oe(this.items.append(e.map((t) => new Pe(t))), this.eventCount);
|
|
18941
19006
|
}
|
|
18942
19007
|
// When the collab module receives remote changes, the history has
|
|
18943
19008
|
// to know about those, so that it can adjust the steps that were
|
|
@@ -18966,7 +19031,7 @@ class Ae {
|
|
|
18966
19031
|
let c = [];
|
|
18967
19032
|
for (let h = t; h < o; h++)
|
|
18968
19033
|
c.push(new Pe(s.maps[h]));
|
|
18969
|
-
let d = this.items.slice(0, r).append(c).append(i), u = new
|
|
19034
|
+
let d = this.items.slice(0, r).append(c).append(i), u = new Oe(d, l);
|
|
18970
19035
|
return u.emptyItemCount() > k1 && (u = u.compress(this.items.length - i.length)), u;
|
|
18971
19036
|
}
|
|
18972
19037
|
emptyItemCount() {
|
|
@@ -18996,10 +19061,10 @@ class Ae {
|
|
|
18996
19061
|
}
|
|
18997
19062
|
} else
|
|
18998
19063
|
o.map && i--;
|
|
18999
|
-
}, this.items.length, 0), new
|
|
19064
|
+
}, this.items.length, 0), new Oe(te.from(r.reverse()), s);
|
|
19000
19065
|
}
|
|
19001
19066
|
}
|
|
19002
|
-
|
|
19067
|
+
Oe.empty = new Oe(te.empty, 0);
|
|
19003
19068
|
function x1(n, e) {
|
|
19004
19069
|
let t;
|
|
19005
19070
|
return n.forEach((i, r) => {
|
|
@@ -19037,7 +19102,7 @@ function M1(n, e, t, i) {
|
|
|
19037
19102
|
return o.getMeta(St).redo ? new et(n.done.addTransform(t, void 0, i, Jn(e)), n.undone, el(t.mapping.maps), n.prevTime, n.prevComposition) : new et(n.done, n.undone.addTransform(t, void 0, i, Jn(e)), null, n.prevTime, n.prevComposition);
|
|
19038
19103
|
if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
19039
19104
|
let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - i.newGroupDelay || !_1(t, n.prevRanges)), c = o ? rr(n.prevRanges, t.mapping) : el(t.mapping.maps);
|
|
19040
|
-
return new et(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, i, Jn(e)),
|
|
19105
|
+
return new et(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, i, Jn(e)), Oe.empty, c, t.time, l == null ? n.prevComposition : l);
|
|
19041
19106
|
} else
|
|
19042
19107
|
return (s = t.getMeta("rebased")) ? new et(n.done.rebased(t, s), n.undone.rebased(t, s), rr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new et(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), rr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
|
|
19043
19108
|
}
|
|
@@ -19097,7 +19162,7 @@ function E1(n = {}) {
|
|
|
19097
19162
|
key: St,
|
|
19098
19163
|
state: {
|
|
19099
19164
|
init() {
|
|
19100
|
-
return new et(
|
|
19165
|
+
return new et(Oe.empty, Oe.empty, null, 0, -1);
|
|
19101
19166
|
},
|
|
19102
19167
|
apply(e, t, i) {
|
|
19103
19168
|
return M1(t, i, e, n);
|
|
@@ -19587,7 +19652,10 @@ const il = new L("chat-editor"), $1 = ({
|
|
|
19587
19652
|
n.context,
|
|
19588
19653
|
n.params,
|
|
19589
19654
|
{},
|
|
19590
|
-
{
|
|
19655
|
+
{
|
|
19656
|
+
enableNoAccess: !0,
|
|
19657
|
+
globalDownloadPrifix: n.opts.uploader.globalDownloadPrifix
|
|
19658
|
+
}
|
|
19591
19659
|
), u = async (f) => {
|
|
19592
19660
|
const p = new FormData();
|
|
19593
19661
|
p.append("file", f);
|
|
@@ -19685,7 +19753,7 @@ const il = new L("chat-editor"), $1 = ({
|
|
|
19685
19753
|
};
|
|
19686
19754
|
const j = new L("chat-input"), rl = window.SpeechRecognition || window.webkitSpeechRecognition, sl = (n) => {
|
|
19687
19755
|
var g;
|
|
19688
|
-
const [e, t] =
|
|
19756
|
+
const [e, t] = Me(!1);
|
|
19689
19757
|
Br(Ei);
|
|
19690
19758
|
const i = n.controller.input, r = F(!1), s = Q(), o = Q(null);
|
|
19691
19759
|
rl && !s.current && (s.current = new rl(), s.current.onstart = () => {
|
|
@@ -19883,7 +19951,7 @@ const we = new L("chat-topic-item"), L1 = (n) => {
|
|
|
19883
19951
|
const { controller: e, topic: t, onClick: i, onAction: r } = n, s = Q(null), o = ye(() => {
|
|
19884
19952
|
var g;
|
|
19885
19953
|
return ((g = e.activedTopic.value) == null ? void 0 : g.id) === t.id;
|
|
19886
|
-
}), [l, a] =
|
|
19954
|
+
}), [l, a] = Me(!1), c = F(!1), d = (y) => {
|
|
19887
19955
|
y.stopPropagation(), r("LINK", y);
|
|
19888
19956
|
}, u = (y, g) => {
|
|
19889
19957
|
y === "RENAME" ? (c.value = !0, setTimeout(() => {
|
|
@@ -19958,7 +20026,7 @@ const we = new L("chat-topic-item"), L1 = (n) => {
|
|
|
19958
20026
|
);
|
|
19959
20027
|
};
|
|
19960
20028
|
const Vn = new L("chat-search"), B1 = (n) => {
|
|
19961
|
-
const { className: e, value: t, placeholder: i, onChange: r } = n, [s, o] =
|
|
20029
|
+
const { className: e, value: t, placeholder: i, onChange: r } = n, [s, o] = Me(!1), l = (a) => {
|
|
19962
20030
|
var c;
|
|
19963
20031
|
a.stopPropagation(), r == null || r((c = a.target) == null ? void 0 : c.value);
|
|
19964
20032
|
};
|
|
@@ -19983,7 +20051,7 @@ const Vn = new L("chat-search"), B1 = (n) => {
|
|
|
19983
20051
|
}
|
|
19984
20052
|
);
|
|
19985
20053
|
};
|
|
19986
|
-
const
|
|
20054
|
+
const zt = new L("chat-topics"), F1 = (n) => {
|
|
19987
20055
|
const e = Q(null), t = F(void 0), i = F([]);
|
|
19988
20056
|
K(() => {
|
|
19989
20057
|
const l = [...n.controller.topics.value].sort((a, c) => a.isTop !== c.isTop ? c.isTop ? 1 : -1 : a.sequence - c.sequence);
|
|
@@ -20014,8 +20082,8 @@ const Pt = new L("chat-topics"), F1 = (n) => {
|
|
|
20014
20082
|
".ibiz-chat-topic-item.is-active"
|
|
20015
20083
|
);
|
|
20016
20084
|
a == null || a.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
20017
|
-
}, [n.controller.activedTopic.value]), /* @__PURE__ */ m("div", { className:
|
|
20018
|
-
/* @__PURE__ */ m("div", { className:
|
|
20085
|
+
}, [n.controller.activedTopic.value]), /* @__PURE__ */ m("div", { className: zt.b(), children: [
|
|
20086
|
+
/* @__PURE__ */ m("div", { className: zt.e("header"), children: /* @__PURE__ */ m(
|
|
20019
20087
|
B1,
|
|
20020
20088
|
{
|
|
20021
20089
|
value: t.value,
|
|
@@ -20023,7 +20091,7 @@ const Pt = new L("chat-topics"), F1 = (n) => {
|
|
|
20023
20091
|
onChange: o.bind(void 0)
|
|
20024
20092
|
}
|
|
20025
20093
|
) }),
|
|
20026
|
-
/* @__PURE__ */ m("div", { ref: e, className:
|
|
20094
|
+
/* @__PURE__ */ m("div", { ref: e, className: zt.e("main"), children: i.value && i.value.length > 0 ? i.value.map((l) => /* @__PURE__ */ m(
|
|
20027
20095
|
L1,
|
|
20028
20096
|
{
|
|
20029
20097
|
topic: l,
|
|
@@ -20032,12 +20100,12 @@ const Pt = new L("chat-topics"), F1 = (n) => {
|
|
|
20032
20100
|
onAction: (a, c) => s(a, l, c)
|
|
20033
20101
|
},
|
|
20034
20102
|
l.id
|
|
20035
|
-
)) : /* @__PURE__ */ m("div", { className:
|
|
20036
|
-
/* @__PURE__ */ m("div", { className:
|
|
20103
|
+
)) : /* @__PURE__ */ m("div", { className: zt.e("empty"), children: "暂无话题" }) }),
|
|
20104
|
+
/* @__PURE__ */ m("div", { className: zt.e("footer"), children: /* @__PURE__ */ m(
|
|
20037
20105
|
"div",
|
|
20038
20106
|
{
|
|
20039
20107
|
title: "清空会话",
|
|
20040
|
-
className:
|
|
20108
|
+
className: zt.e("action"),
|
|
20041
20109
|
onClick: () => n.controller.clearTopic(),
|
|
20042
20110
|
children: [
|
|
20043
20111
|
/* @__PURE__ */ m(Ll, {}),
|
|
@@ -20047,8 +20115,8 @@ const Pt = new L("chat-topics"), F1 = (n) => {
|
|
|
20047
20115
|
) })
|
|
20048
20116
|
] });
|
|
20049
20117
|
};
|
|
20050
|
-
const
|
|
20051
|
-
const e = Q(null), [t, i] =
|
|
20118
|
+
const $t = new L("chat-minimize"), V1 = (n) => {
|
|
20119
|
+
const e = Q(null), [t, i] = Me(""), [r, s] = Me(0), o = Q(!1), l = {
|
|
20052
20120
|
x: (window.innerWidth - 86) / window.innerWidth,
|
|
20053
20121
|
y: (window.innerHeight - 86) / window.innerHeight
|
|
20054
20122
|
}, a = ye(() => {
|
|
@@ -20120,7 +20188,7 @@ const zt = new L("chat-minimize"), V1 = (n) => {
|
|
|
20120
20188
|
{
|
|
20121
20189
|
ref: e,
|
|
20122
20190
|
title: n.title,
|
|
20123
|
-
className: "".concat(
|
|
20191
|
+
className: "".concat($t.b(), " ").concat($t.is("hidden", !n.isMinimize), " ").concat($t.is(
|
|
20124
20192
|
"show-halo",
|
|
20125
20193
|
a.value
|
|
20126
20194
|
)),
|
|
@@ -20128,12 +20196,12 @@ const zt = new L("chat-minimize"), V1 = (n) => {
|
|
|
20128
20196
|
children: /* @__PURE__ */ m(
|
|
20129
20197
|
"div",
|
|
20130
20198
|
{
|
|
20131
|
-
className: "".concat(
|
|
20199
|
+
className: "".concat($t.e("content"), " ").concat($t.is(
|
|
20132
20200
|
"show-border",
|
|
20133
20201
|
!a.value
|
|
20134
20202
|
)),
|
|
20135
20203
|
children: [
|
|
20136
|
-
t && /* @__PURE__ */ m("div", { className: "".concat(
|
|
20204
|
+
t && /* @__PURE__ */ m("div", { className: "".concat($t.em("content", "popover")), children: /* @__PURE__ */ m("div", { className: "typewriter", children: t }) }),
|
|
20137
20205
|
/* @__PURE__ */ m(Dd, {})
|
|
20138
20206
|
]
|
|
20139
20207
|
}
|
|
@@ -20146,7 +20214,7 @@ const Ei = rd({
|
|
|
20146
20214
|
enableBackFill: !0
|
|
20147
20215
|
});
|
|
20148
20216
|
var ol, ll, al, cl;
|
|
20149
|
-
class or extends
|
|
20217
|
+
class or extends Ie {
|
|
20150
20218
|
constructor(t) {
|
|
20151
20219
|
var i, r;
|
|
20152
20220
|
super(t);
|