@brainbase-labs/chat-widget 0.1.18 → 0.1.19
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/embed/index.js +2 -2
- package/dist/index.cjs +7 -7
- package/dist/index.js +324 -317
- package/dist/styles.css +1 -1
- package/package.json +2 -1
- package/styles.css +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState as he, useRef as
|
|
1
|
+
import { useState as he, useRef as Ce, useEffect as Ge, useCallback as ge, useMemo as xn } from "react";
|
|
2
2
|
import { jsxs as H, jsx as x, Fragment as Kt } from "react/jsx-runtime";
|
|
3
3
|
const Hn = "bb-chat-";
|
|
4
4
|
function Hr(e) {
|
|
@@ -33,7 +33,7 @@ function Vr(e) {
|
|
|
33
33
|
onSessionEnd: o,
|
|
34
34
|
onMessage: l,
|
|
35
35
|
onError: a
|
|
36
|
-
} = e, [c, s] = he([]), [u, p] = he([]), [m, h] = he(!1), [_, I] = he(null), [E, b] = he(null), P =
|
|
36
|
+
} = e, [c, s] = he([]), [u, p] = he([]), [m, h] = he(!1), [_, I] = he(null), [E, b] = he(null), P = Ce(0), v = Ce(!1), R = Ce({});
|
|
37
37
|
Ge(() => {
|
|
38
38
|
if (v.current) return;
|
|
39
39
|
v.current = !0;
|
|
@@ -52,9 +52,9 @@ function Vr(e) {
|
|
|
52
52
|
});
|
|
53
53
|
}, [E, c, u, n]);
|
|
54
54
|
const V = ge(async () => (P.current = Date.now(), b(null), s([]), p([]), ut(n.embedId), ""), [n.embedId]), k = ge((C, z) => {
|
|
55
|
-
s((
|
|
55
|
+
s((T) => {
|
|
56
56
|
let y = !1;
|
|
57
|
-
const A =
|
|
57
|
+
const A = T.map((L) => L.id === C ? (y = !0, { ...L, content: z, status: "streaming" }) : L);
|
|
58
58
|
return y || A.push({
|
|
59
59
|
id: C,
|
|
60
60
|
role: "assistant",
|
|
@@ -64,35 +64,35 @@ function Vr(e) {
|
|
|
64
64
|
}), A;
|
|
65
65
|
});
|
|
66
66
|
}, []), B = ge(
|
|
67
|
-
(C, z,
|
|
67
|
+
(C, z, T) => {
|
|
68
68
|
switch (C.type) {
|
|
69
69
|
case "session": {
|
|
70
70
|
const y = C.data;
|
|
71
|
-
y.session_id && (
|
|
71
|
+
y.session_id && (T(y.session_id), y.is_new && (P.current = Date.now(), i == null || i(y.session_id)));
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
74
|
case "message": {
|
|
75
75
|
const y = C.data;
|
|
76
|
-
y.content && (
|
|
76
|
+
y.content && (R.current[z] = y.content, k(z, y.content));
|
|
77
77
|
break;
|
|
78
78
|
}
|
|
79
79
|
case "chunk": {
|
|
80
80
|
const y = C.data;
|
|
81
81
|
if (y.content) {
|
|
82
|
-
const
|
|
83
|
-
|
|
82
|
+
const L = (R.current[z] ?? "") + y.content;
|
|
83
|
+
R.current[z] = L, k(z, L);
|
|
84
84
|
}
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
87
|
case "tool_call": {
|
|
88
88
|
const y = C.data;
|
|
89
89
|
if (p((A) => {
|
|
90
|
-
const
|
|
90
|
+
const L = A.findIndex(
|
|
91
91
|
(q) => q.name === y.function && q.status === "pending"
|
|
92
92
|
);
|
|
93
|
-
return
|
|
94
|
-
(q, Q) => Q ===
|
|
95
|
-
) :
|
|
93
|
+
return L !== -1 && y.result !== void 0 ? A.map(
|
|
94
|
+
(q, Q) => Q === L ? { ...q, result: y.result, status: "completed" } : q
|
|
95
|
+
) : L === -1 ? [
|
|
96
96
|
...A,
|
|
97
97
|
{
|
|
98
98
|
id: `tc-${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
@@ -104,7 +104,7 @@ function Vr(e) {
|
|
|
104
104
|
] : A;
|
|
105
105
|
}), y.content) {
|
|
106
106
|
const A = y.content;
|
|
107
|
-
|
|
107
|
+
R.current[z] = A, k(z, A);
|
|
108
108
|
}
|
|
109
109
|
break;
|
|
110
110
|
}
|
|
@@ -113,13 +113,13 @@ function Vr(e) {
|
|
|
113
113
|
case "done": {
|
|
114
114
|
s(
|
|
115
115
|
(y) => y.map((A) => A.id === z ? { ...A, status: "sent" } : A)
|
|
116
|
-
), delete
|
|
116
|
+
), delete R.current[z];
|
|
117
117
|
break;
|
|
118
118
|
}
|
|
119
119
|
case "completed": {
|
|
120
120
|
s((y) => {
|
|
121
121
|
const A = y.map(
|
|
122
|
-
(
|
|
122
|
+
(L) => L.id === z ? { ...L, status: "sent" } : L
|
|
123
123
|
);
|
|
124
124
|
return E && st(n.embedId, {
|
|
125
125
|
sessionId: E,
|
|
@@ -132,18 +132,18 @@ function Vr(e) {
|
|
|
132
132
|
// Tool calls stored separately
|
|
133
133
|
status: "completed"
|
|
134
134
|
}), A;
|
|
135
|
-
}), delete
|
|
135
|
+
}), delete R.current[z];
|
|
136
136
|
break;
|
|
137
137
|
}
|
|
138
138
|
case "error": {
|
|
139
139
|
const y = C.data;
|
|
140
140
|
s(
|
|
141
141
|
(A) => A.map(
|
|
142
|
-
(
|
|
143
|
-
...
|
|
142
|
+
(L) => L.id === z ? {
|
|
143
|
+
...L,
|
|
144
144
|
status: "error",
|
|
145
145
|
content: y.error ?? "An error occurred"
|
|
146
|
-
} :
|
|
146
|
+
} : L
|
|
147
147
|
)
|
|
148
148
|
);
|
|
149
149
|
break;
|
|
@@ -152,26 +152,26 @@ function Vr(e) {
|
|
|
152
152
|
},
|
|
153
153
|
[n, E, i, k]
|
|
154
154
|
), U = ge(
|
|
155
|
-
async (C, z,
|
|
155
|
+
async (C, z, T) => {
|
|
156
156
|
const y = C.getReader(), A = new TextDecoder();
|
|
157
|
-
let
|
|
157
|
+
let L = "";
|
|
158
158
|
try {
|
|
159
159
|
for (; ; ) {
|
|
160
160
|
const { done: q, value: Q } = await y.read();
|
|
161
161
|
if (q) break;
|
|
162
|
-
|
|
162
|
+
L += A.decode(Q, { stream: !0 });
|
|
163
163
|
let f;
|
|
164
|
-
for (; (f =
|
|
164
|
+
for (; (f = L.indexOf(`
|
|
165
165
|
|
|
166
166
|
`)) !== -1; ) {
|
|
167
|
-
const J =
|
|
168
|
-
|
|
167
|
+
const J = L.slice(0, f);
|
|
168
|
+
L = L.slice(f + 2);
|
|
169
169
|
for (const ue of J.split(`
|
|
170
170
|
`))
|
|
171
171
|
if (ue.startsWith("data: "))
|
|
172
172
|
try {
|
|
173
173
|
const d = JSON.parse(ue.slice(6));
|
|
174
|
-
B(d, z,
|
|
174
|
+
B(d, z, T);
|
|
175
175
|
} catch {
|
|
176
176
|
}
|
|
177
177
|
}
|
|
@@ -181,7 +181,7 @@ function Vr(e) {
|
|
|
181
181
|
}
|
|
182
182
|
},
|
|
183
183
|
[B]
|
|
184
|
-
),
|
|
184
|
+
), F = ge(
|
|
185
185
|
async (C) => {
|
|
186
186
|
if (!C.trim()) return;
|
|
187
187
|
const z = {
|
|
@@ -191,41 +191,41 @@ function Vr(e) {
|
|
|
191
191
|
timestamp: Date.now(),
|
|
192
192
|
status: "sent"
|
|
193
193
|
};
|
|
194
|
-
s((
|
|
195
|
-
const
|
|
196
|
-
id:
|
|
194
|
+
s((L) => [...L, z]), l == null || l(z);
|
|
195
|
+
const T = `assistant-${Date.now()}`, y = {
|
|
196
|
+
id: T,
|
|
197
197
|
role: "assistant",
|
|
198
198
|
content: "",
|
|
199
199
|
timestamp: Date.now(),
|
|
200
200
|
status: "streaming"
|
|
201
201
|
};
|
|
202
|
-
s((
|
|
203
|
-
const A = (
|
|
204
|
-
b(
|
|
202
|
+
s((L) => [...L, y]), h(!0), I(null);
|
|
203
|
+
const A = (L) => {
|
|
204
|
+
b(L);
|
|
205
205
|
};
|
|
206
206
|
try {
|
|
207
207
|
if (r) {
|
|
208
|
-
const
|
|
209
|
-
for await (const q of
|
|
210
|
-
B(q,
|
|
208
|
+
const L = t.sendMessage(C);
|
|
209
|
+
for await (const q of L)
|
|
210
|
+
B(q, T, A);
|
|
211
211
|
} else {
|
|
212
|
-
const
|
|
212
|
+
const L = await t.sendMessage({
|
|
213
213
|
embedId: n.embedId,
|
|
214
214
|
message: C,
|
|
215
215
|
sessionId: E ?? void 0
|
|
216
216
|
});
|
|
217
|
-
await U(
|
|
217
|
+
await U(L, T, A);
|
|
218
218
|
}
|
|
219
219
|
s(
|
|
220
|
-
(
|
|
221
|
-
(q) => q.id ===
|
|
220
|
+
(L) => L.map(
|
|
221
|
+
(q) => q.id === T && q.status === "streaming" ? { ...q, status: "sent" } : q
|
|
222
222
|
)
|
|
223
223
|
);
|
|
224
|
-
} catch (
|
|
225
|
-
const q =
|
|
224
|
+
} catch (L) {
|
|
225
|
+
const q = L instanceof Error ? L : new Error("Failed to send message");
|
|
226
226
|
I(q), a == null || a(q), s(
|
|
227
227
|
(Q) => Q.map(
|
|
228
|
-
(f) => f.id ===
|
|
228
|
+
(f) => f.id === T ? { ...f, status: "error", content: "Failed to get response" } : f
|
|
229
229
|
)
|
|
230
230
|
);
|
|
231
231
|
} finally {
|
|
@@ -270,7 +270,7 @@ function Vr(e) {
|
|
|
270
270
|
isLoading: m,
|
|
271
271
|
error: _,
|
|
272
272
|
sessionId: E,
|
|
273
|
-
sendMessage:
|
|
273
|
+
sendMessage: F,
|
|
274
274
|
endSession: j,
|
|
275
275
|
clearMessages: N,
|
|
276
276
|
startNewSession: V
|
|
@@ -693,7 +693,7 @@ Vn.prototype.defined = !0;
|
|
|
693
693
|
function ht(e, n, t) {
|
|
694
694
|
t && (e[n] = t);
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function Fe(e) {
|
|
697
697
|
const n = {}, t = {};
|
|
698
698
|
for (const [r, i] of Object.entries(e.properties)) {
|
|
699
699
|
const o = new Vn(
|
|
@@ -706,7 +706,7 @@ function Re(e) {
|
|
|
706
706
|
}
|
|
707
707
|
return new tn(n, t, e.space);
|
|
708
708
|
}
|
|
709
|
-
const Jt =
|
|
709
|
+
const Jt = Fe({
|
|
710
710
|
properties: {
|
|
711
711
|
ariaActiveDescendant: null,
|
|
712
712
|
ariaAtomic: Z,
|
|
@@ -768,7 +768,7 @@ function Gt(e, n) {
|
|
|
768
768
|
function er(e, n) {
|
|
769
769
|
return Gt(e, n.toLowerCase());
|
|
770
770
|
}
|
|
771
|
-
const yi =
|
|
771
|
+
const yi = Fe({
|
|
772
772
|
attributes: {
|
|
773
773
|
acceptcharset: "accept-charset",
|
|
774
774
|
classname: "class",
|
|
@@ -1129,7 +1129,7 @@ const yi = Re({
|
|
|
1129
1129
|
},
|
|
1130
1130
|
space: "html",
|
|
1131
1131
|
transform: er
|
|
1132
|
-
}), xi =
|
|
1132
|
+
}), xi = Fe({
|
|
1133
1133
|
attributes: {
|
|
1134
1134
|
accentHeight: "accent-height",
|
|
1135
1135
|
alignmentBaseline: "alignment-baseline",
|
|
@@ -1688,7 +1688,7 @@ const yi = Re({
|
|
|
1688
1688
|
},
|
|
1689
1689
|
space: "svg",
|
|
1690
1690
|
transform: Gt
|
|
1691
|
-
}), nr =
|
|
1691
|
+
}), nr = Fe({
|
|
1692
1692
|
properties: {
|
|
1693
1693
|
xLinkActuate: null,
|
|
1694
1694
|
xLinkArcRole: null,
|
|
@@ -1702,12 +1702,12 @@ const yi = Re({
|
|
|
1702
1702
|
transform(e, n) {
|
|
1703
1703
|
return "xlink:" + n.slice(5).toLowerCase();
|
|
1704
1704
|
}
|
|
1705
|
-
}), tr =
|
|
1705
|
+
}), tr = Fe({
|
|
1706
1706
|
attributes: { xmlnsxlink: "xmlns:xlink" },
|
|
1707
1707
|
properties: { xmlnsXLink: null, xmlns: null },
|
|
1708
1708
|
space: "xmlns",
|
|
1709
1709
|
transform: er
|
|
1710
|
-
}), rr =
|
|
1710
|
+
}), rr = Fe({
|
|
1711
1711
|
properties: { xmlBase: null, xmlLang: null, xmlSpace: null },
|
|
1712
1712
|
space: "xml",
|
|
1713
1713
|
transform(e, n) {
|
|
@@ -1777,78 +1777,78 @@ function vi() {
|
|
|
1777
1777
|
if (!E) return [];
|
|
1778
1778
|
b = b || {};
|
|
1779
1779
|
var P = 1, v = 1;
|
|
1780
|
-
function
|
|
1781
|
-
var y =
|
|
1780
|
+
function R(T) {
|
|
1781
|
+
var y = T.match(n);
|
|
1782
1782
|
y && (P += y.length);
|
|
1783
|
-
var A =
|
|
1784
|
-
v = ~A ?
|
|
1783
|
+
var A = T.lastIndexOf(c);
|
|
1784
|
+
v = ~A ? T.length - A : v + T.length;
|
|
1785
1785
|
}
|
|
1786
1786
|
function V() {
|
|
1787
|
-
var
|
|
1787
|
+
var T = { line: P, column: v };
|
|
1788
1788
|
return function(y) {
|
|
1789
|
-
return y.position = new k(
|
|
1789
|
+
return y.position = new k(T), F(), y;
|
|
1790
1790
|
};
|
|
1791
1791
|
}
|
|
1792
|
-
function k(
|
|
1793
|
-
this.start =
|
|
1792
|
+
function k(T) {
|
|
1793
|
+
this.start = T, this.end = { line: P, column: v }, this.source = b.source;
|
|
1794
1794
|
}
|
|
1795
1795
|
k.prototype.content = E;
|
|
1796
|
-
function B(
|
|
1796
|
+
function B(T) {
|
|
1797
1797
|
var y = new Error(
|
|
1798
|
-
b.source + ":" + P + ":" + v + ": " +
|
|
1798
|
+
b.source + ":" + P + ":" + v + ": " + T
|
|
1799
1799
|
);
|
|
1800
|
-
if (y.reason =
|
|
1800
|
+
if (y.reason = T, y.filename = b.source, y.line = P, y.column = v, y.source = E, !b.silent) throw y;
|
|
1801
1801
|
}
|
|
1802
|
-
function U(
|
|
1803
|
-
var y =
|
|
1802
|
+
function U(T) {
|
|
1803
|
+
var y = T.exec(E);
|
|
1804
1804
|
if (y) {
|
|
1805
1805
|
var A = y[0];
|
|
1806
|
-
return
|
|
1806
|
+
return R(A), E = E.slice(A.length), y;
|
|
1807
1807
|
}
|
|
1808
1808
|
}
|
|
1809
|
-
function
|
|
1809
|
+
function F() {
|
|
1810
1810
|
U(t);
|
|
1811
1811
|
}
|
|
1812
|
-
function j(
|
|
1812
|
+
function j(T) {
|
|
1813
1813
|
var y;
|
|
1814
|
-
for (
|
|
1815
|
-
y !== !1 &&
|
|
1816
|
-
return
|
|
1814
|
+
for (T = T || []; y = N(); )
|
|
1815
|
+
y !== !1 && T.push(y);
|
|
1816
|
+
return T;
|
|
1817
1817
|
}
|
|
1818
1818
|
function N() {
|
|
1819
|
-
var
|
|
1819
|
+
var T = V();
|
|
1820
1820
|
if (!(s != E.charAt(0) || u != E.charAt(1))) {
|
|
1821
1821
|
for (var y = 2; p != E.charAt(y) && (u != E.charAt(y) || s != E.charAt(y + 1)); )
|
|
1822
1822
|
++y;
|
|
1823
1823
|
if (y += 2, p === E.charAt(y - 1))
|
|
1824
1824
|
return B("End of comment missing");
|
|
1825
1825
|
var A = E.slice(2, y - 2);
|
|
1826
|
-
return v += 2,
|
|
1826
|
+
return v += 2, R(A), E = E.slice(y), v += 2, T({
|
|
1827
1827
|
type: m,
|
|
1828
1828
|
comment: A
|
|
1829
1829
|
});
|
|
1830
1830
|
}
|
|
1831
1831
|
}
|
|
1832
1832
|
function C() {
|
|
1833
|
-
var
|
|
1833
|
+
var T = V(), y = U(r);
|
|
1834
1834
|
if (y) {
|
|
1835
1835
|
if (N(), !U(i)) return B("property missing ':'");
|
|
1836
|
-
var A = U(o),
|
|
1836
|
+
var A = U(o), L = T({
|
|
1837
1837
|
type: h,
|
|
1838
1838
|
property: I(y[0].replace(e, p)),
|
|
1839
1839
|
value: A ? I(A[0].replace(e, p)) : p
|
|
1840
1840
|
});
|
|
1841
|
-
return U(l),
|
|
1841
|
+
return U(l), L;
|
|
1842
1842
|
}
|
|
1843
1843
|
}
|
|
1844
1844
|
function z() {
|
|
1845
|
-
var
|
|
1846
|
-
j(
|
|
1845
|
+
var T = [];
|
|
1846
|
+
j(T);
|
|
1847
1847
|
for (var y; y = C(); )
|
|
1848
|
-
y !== !1 && (
|
|
1849
|
-
return
|
|
1848
|
+
y !== !1 && (T.push(y), j(T));
|
|
1849
|
+
return T;
|
|
1850
1850
|
}
|
|
1851
|
-
return
|
|
1851
|
+
return F(), z();
|
|
1852
1852
|
}
|
|
1853
1853
|
function I(E) {
|
|
1854
1854
|
return E ? E.replace(a, p) : p;
|
|
@@ -1856,7 +1856,7 @@ function vi() {
|
|
|
1856
1856
|
return bn = _, bn;
|
|
1857
1857
|
}
|
|
1858
1858
|
var mt;
|
|
1859
|
-
function
|
|
1859
|
+
function Ti() {
|
|
1860
1860
|
if (mt) return Me;
|
|
1861
1861
|
mt = 1;
|
|
1862
1862
|
var e = Me && Me.__importDefault || function(r) {
|
|
@@ -1879,7 +1879,7 @@ function Li() {
|
|
|
1879
1879
|
return Me;
|
|
1880
1880
|
}
|
|
1881
1881
|
var qe = {}, gt;
|
|
1882
|
-
function
|
|
1882
|
+
function Li() {
|
|
1883
1883
|
if (gt) return qe;
|
|
1884
1884
|
gt = 1, Object.defineProperty(qe, "__esModule", { value: !0 }), qe.camelCase = void 0;
|
|
1885
1885
|
var e = /^--[a-zA-Z0-9_-]+$/, n = /-([a-z])/g, t = /^[^-]+$/, r = /^-(webkit|moz|ms|o|khtml)-/, i = /^-(ms)-/, o = function(s) {
|
|
@@ -1899,7 +1899,7 @@ function Ni() {
|
|
|
1899
1899
|
yt = 1;
|
|
1900
1900
|
var e = We && We.__importDefault || function(i) {
|
|
1901
1901
|
return i && i.__esModule ? i : { default: i };
|
|
1902
|
-
}, n = e(
|
|
1902
|
+
}, n = e(Ti()), t = Li();
|
|
1903
1903
|
function r(i, o) {
|
|
1904
1904
|
var l = {};
|
|
1905
1905
|
return !i || typeof i != "string" || (0, n.default)(i, function(a, c) {
|
|
@@ -2027,7 +2027,7 @@ te.prototype.place = void 0;
|
|
|
2027
2027
|
te.prototype.ruleId = void 0;
|
|
2028
2028
|
te.prototype.source = void 0;
|
|
2029
2029
|
const Wn = {}.hasOwnProperty, Mi = /* @__PURE__ */ new Map(), Di = /[A-Z]/g, Bi = /* @__PURE__ */ new Set(["table", "tbody", "thead", "tfoot", "tr"]), Oi = /* @__PURE__ */ new Set(["td", "th"]), ar = "https://github.com/syntax-tree/hast-util-to-jsx-runtime";
|
|
2030
|
-
function
|
|
2030
|
+
function Ri(e, n) {
|
|
2031
2031
|
if (!n || n.Fragment === void 0)
|
|
2032
2032
|
throw new TypeError("Expected `Fragment` in options");
|
|
2033
2033
|
const t = n.filePath || void 0;
|
|
@@ -2069,7 +2069,7 @@ function Fi(e, n) {
|
|
|
2069
2069
|
}
|
|
2070
2070
|
function sr(e, n, t) {
|
|
2071
2071
|
if (n.type === "element")
|
|
2072
|
-
return
|
|
2072
|
+
return Fi(e, n, t);
|
|
2073
2073
|
if (n.type === "mdxFlowExpression" || n.type === "mdxTextExpression")
|
|
2074
2074
|
return ji(e, n);
|
|
2075
2075
|
if (n.type === "mdxJsxFlowElement" || n.type === "mdxJsxTextElement")
|
|
@@ -2081,7 +2081,7 @@ function sr(e, n, t) {
|
|
|
2081
2081
|
if (n.type === "text")
|
|
2082
2082
|
return Ui(e, n);
|
|
2083
2083
|
}
|
|
2084
|
-
function
|
|
2084
|
+
function Fi(e, n, t) {
|
|
2085
2085
|
const r = e.schema;
|
|
2086
2086
|
let i = r;
|
|
2087
2087
|
n.tagName.toLowerCase() === "svg" && r.space === "html" && (i = Un, e.schema = i), e.ancestors.push(n);
|
|
@@ -2430,10 +2430,10 @@ function hr(e, n) {
|
|
|
2430
2430
|
t > 1114111 ? "�" : String.fromCodePoint(t)
|
|
2431
2431
|
);
|
|
2432
2432
|
}
|
|
2433
|
-
function
|
|
2433
|
+
function Re(e) {
|
|
2434
2434
|
return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
|
|
2435
2435
|
}
|
|
2436
|
-
const xe =
|
|
2436
|
+
const xe = ve(/[A-Za-z]/), se = ve(/[\dA-Za-z]/), lo = ve(/[#-'*+\--9=?A-Z^-~]/);
|
|
2437
2437
|
function Bn(e) {
|
|
2438
2438
|
return (
|
|
2439
2439
|
// Special whitespace codes (which have negative values), C0 and Control
|
|
@@ -2441,7 +2441,7 @@ function Bn(e) {
|
|
|
2441
2441
|
e !== null && (e < 32 || e === 127)
|
|
2442
2442
|
);
|
|
2443
2443
|
}
|
|
2444
|
-
const On =
|
|
2444
|
+
const On = ve(/\d/), ao = ve(/[\dA-Fa-f]/), so = ve(/[!-/:-@[-`{-~]/);
|
|
2445
2445
|
function M(e) {
|
|
2446
2446
|
return e !== null && e < -2;
|
|
2447
2447
|
}
|
|
@@ -2451,8 +2451,8 @@ function ie(e) {
|
|
|
2451
2451
|
function W(e) {
|
|
2452
2452
|
return e === -2 || e === -1 || e === 32;
|
|
2453
2453
|
}
|
|
2454
|
-
const uo =
|
|
2455
|
-
function
|
|
2454
|
+
const uo = ve(new RegExp("\\p{P}|\\p{S}", "u")), co = ve(/\s/);
|
|
2455
|
+
function ve(e) {
|
|
2456
2456
|
return n;
|
|
2457
2457
|
function n(t) {
|
|
2458
2458
|
return t !== null && t > -1 && e.test(String.fromCharCode(t));
|
|
@@ -2531,28 +2531,28 @@ function mo(e) {
|
|
|
2531
2531
|
return a;
|
|
2532
2532
|
function a(v) {
|
|
2533
2533
|
if (r < t.length) {
|
|
2534
|
-
const
|
|
2535
|
-
return n.containerState =
|
|
2534
|
+
const R = t[r];
|
|
2535
|
+
return n.containerState = R[1], e.attempt(R[0].continuation, c, s)(v);
|
|
2536
2536
|
}
|
|
2537
2537
|
return s(v);
|
|
2538
2538
|
}
|
|
2539
2539
|
function c(v) {
|
|
2540
2540
|
if (r++, n.containerState._closeFlow) {
|
|
2541
2541
|
n.containerState._closeFlow = void 0, i && P();
|
|
2542
|
-
const
|
|
2543
|
-
let V =
|
|
2542
|
+
const R = n.events.length;
|
|
2543
|
+
let V = R, k;
|
|
2544
2544
|
for (; V--; )
|
|
2545
2545
|
if (n.events[V][0] === "exit" && n.events[V][1].type === "chunkFlow") {
|
|
2546
2546
|
k = n.events[V][1].end;
|
|
2547
2547
|
break;
|
|
2548
2548
|
}
|
|
2549
2549
|
b(r);
|
|
2550
|
-
let B =
|
|
2550
|
+
let B = R;
|
|
2551
2551
|
for (; B < n.events.length; )
|
|
2552
2552
|
n.events[B][1].end = {
|
|
2553
2553
|
...k
|
|
2554
2554
|
}, B++;
|
|
2555
|
-
return ke(n.events, V + 1, 0, n.events.slice(
|
|
2555
|
+
return ke(n.events, V + 1, 0, n.events.slice(R)), n.events.length = B, s(v);
|
|
2556
2556
|
}
|
|
2557
2557
|
return a(v);
|
|
2558
2558
|
}
|
|
@@ -2596,9 +2596,9 @@ function mo(e) {
|
|
|
2596
2596
|
}
|
|
2597
2597
|
return M(v) ? (e.consume(v), E(e.exit("chunkFlow")), r = 0, n.interrupt = void 0, a) : (e.consume(v), I);
|
|
2598
2598
|
}
|
|
2599
|
-
function E(v,
|
|
2599
|
+
function E(v, R) {
|
|
2600
2600
|
const V = n.sliceStream(v);
|
|
2601
|
-
if (
|
|
2601
|
+
if (R && V.push(null), v.previous = o, o && (o.next = v), o = v, i.defineSkip(v.start), i.write(V), n.parser.lazy[v.start.line]) {
|
|
2602
2602
|
let k = i.events.length;
|
|
2603
2603
|
for (; k--; )
|
|
2604
2604
|
if (
|
|
@@ -2609,14 +2609,14 @@ function mo(e) {
|
|
|
2609
2609
|
)
|
|
2610
2610
|
return;
|
|
2611
2611
|
const B = n.events.length;
|
|
2612
|
-
let U = B,
|
|
2612
|
+
let U = B, F, j;
|
|
2613
2613
|
for (; U--; )
|
|
2614
2614
|
if (n.events[U][0] === "exit" && n.events[U][1].type === "chunkFlow") {
|
|
2615
|
-
if (
|
|
2615
|
+
if (F) {
|
|
2616
2616
|
j = n.events[U][1].end;
|
|
2617
2617
|
break;
|
|
2618
2618
|
}
|
|
2619
|
-
|
|
2619
|
+
F = !0;
|
|
2620
2620
|
}
|
|
2621
2621
|
for (b(r), k = B; k < n.events.length; )
|
|
2622
2622
|
n.events[k][1].end = {
|
|
@@ -2626,9 +2626,9 @@ function mo(e) {
|
|
|
2626
2626
|
}
|
|
2627
2627
|
}
|
|
2628
2628
|
function b(v) {
|
|
2629
|
-
let
|
|
2630
|
-
for (;
|
|
2631
|
-
const V = t[
|
|
2629
|
+
let R = t.length;
|
|
2630
|
+
for (; R-- > v; ) {
|
|
2631
|
+
const V = t[R];
|
|
2632
2632
|
n.containerState = V[1], V[0].exit.call(n, e);
|
|
2633
2633
|
}
|
|
2634
2634
|
t.length = v;
|
|
@@ -2655,7 +2655,7 @@ function Qn(e, n, t) {
|
|
|
2655
2655
|
}
|
|
2656
2656
|
return n;
|
|
2657
2657
|
}
|
|
2658
|
-
const
|
|
2658
|
+
const Rn = {
|
|
2659
2659
|
name: "attention",
|
|
2660
2660
|
resolveAll: yo,
|
|
2661
2661
|
tokenize: xo
|
|
@@ -2861,7 +2861,7 @@ function Eo(e, n, t) {
|
|
|
2861
2861
|
}
|
|
2862
2862
|
const Et = {
|
|
2863
2863
|
partial: !0,
|
|
2864
|
-
tokenize:
|
|
2864
|
+
tokenize: To
|
|
2865
2865
|
}, vt = {
|
|
2866
2866
|
concrete: !0,
|
|
2867
2867
|
name: "codeFenced",
|
|
@@ -2885,7 +2885,7 @@ function vo(e, n, t) {
|
|
|
2885
2885
|
return k === a ? (l++, e.consume(k), u) : l < 3 ? t(k) : (e.exit("codeFencedFenceSequence"), W(k) ? K(e, p, "whitespace")(k) : p(k));
|
|
2886
2886
|
}
|
|
2887
2887
|
function p(k) {
|
|
2888
|
-
return k === null || M(k) ? (e.exit("codeFencedFence"), r.interrupt ? n(k) : e.check(Et, I,
|
|
2888
|
+
return k === null || M(k) ? (e.exit("codeFencedFence"), r.interrupt ? n(k) : e.check(Et, I, R)(k)) : (e.enter("codeFencedFenceInfo"), e.enter("chunkString", {
|
|
2889
2889
|
contentType: "string"
|
|
2890
2890
|
}), m(k));
|
|
2891
2891
|
}
|
|
@@ -2901,7 +2901,7 @@ function vo(e, n, t) {
|
|
|
2901
2901
|
return k === null || M(k) ? (e.exit("chunkString"), e.exit("codeFencedFenceMeta"), p(k)) : k === 96 && k === a ? t(k) : (e.consume(k), _);
|
|
2902
2902
|
}
|
|
2903
2903
|
function I(k) {
|
|
2904
|
-
return e.attempt(i,
|
|
2904
|
+
return e.attempt(i, R, E)(k);
|
|
2905
2905
|
}
|
|
2906
2906
|
function E(k) {
|
|
2907
2907
|
return e.enter("lineEnding"), e.consume(k), e.exit("lineEnding"), b;
|
|
@@ -2910,16 +2910,16 @@ function vo(e, n, t) {
|
|
|
2910
2910
|
return o > 0 && W(k) ? K(e, P, "linePrefix", o + 1)(k) : P(k);
|
|
2911
2911
|
}
|
|
2912
2912
|
function P(k) {
|
|
2913
|
-
return k === null || M(k) ? e.check(Et, I,
|
|
2913
|
+
return k === null || M(k) ? e.check(Et, I, R)(k) : (e.enter("codeFlowValue"), v(k));
|
|
2914
2914
|
}
|
|
2915
2915
|
function v(k) {
|
|
2916
2916
|
return k === null || M(k) ? (e.exit("codeFlowValue"), P(k)) : (e.consume(k), v);
|
|
2917
2917
|
}
|
|
2918
|
-
function
|
|
2918
|
+
function R(k) {
|
|
2919
2919
|
return e.exit("codeFenced"), n(k);
|
|
2920
2920
|
}
|
|
2921
2921
|
function V(k, B, U) {
|
|
2922
|
-
let
|
|
2922
|
+
let F = 0;
|
|
2923
2923
|
return j;
|
|
2924
2924
|
function j(y) {
|
|
2925
2925
|
return k.enter("lineEnding"), k.consume(y), k.exit("lineEnding"), N;
|
|
@@ -2931,14 +2931,14 @@ function vo(e, n, t) {
|
|
|
2931
2931
|
return y === a ? (k.enter("codeFencedFenceSequence"), z(y)) : U(y);
|
|
2932
2932
|
}
|
|
2933
2933
|
function z(y) {
|
|
2934
|
-
return y === a ? (
|
|
2934
|
+
return y === a ? (F++, k.consume(y), z) : F >= l ? (k.exit("codeFencedFenceSequence"), W(y) ? K(k, T, "whitespace")(y) : T(y)) : U(y);
|
|
2935
2935
|
}
|
|
2936
|
-
function
|
|
2936
|
+
function T(y) {
|
|
2937
2937
|
return y === null || M(y) ? (k.exit("codeFencedFence"), B(y)) : U(y);
|
|
2938
2938
|
}
|
|
2939
2939
|
}
|
|
2940
2940
|
}
|
|
2941
|
-
function
|
|
2941
|
+
function To(e, n, t) {
|
|
2942
2942
|
const r = this;
|
|
2943
2943
|
return i;
|
|
2944
2944
|
function i(l) {
|
|
@@ -2951,7 +2951,7 @@ function Lo(e, n, t) {
|
|
|
2951
2951
|
const Cn = {
|
|
2952
2952
|
name: "codeIndented",
|
|
2953
2953
|
tokenize: No
|
|
2954
|
-
},
|
|
2954
|
+
}, Lo = {
|
|
2955
2955
|
partial: !0,
|
|
2956
2956
|
tokenize: Po
|
|
2957
2957
|
};
|
|
@@ -2966,7 +2966,7 @@ function No(e, n, t) {
|
|
|
2966
2966
|
return u && u[1].type === "linePrefix" && u[2].sliceSerialize(u[1], !0).length >= 4 ? l(s) : t(s);
|
|
2967
2967
|
}
|
|
2968
2968
|
function l(s) {
|
|
2969
|
-
return s === null ? c(s) : M(s) ? e.attempt(
|
|
2969
|
+
return s === null ? c(s) : M(s) ? e.attempt(Lo, l, c)(s) : (e.enter("codeFlowValue"), a(s));
|
|
2970
2970
|
}
|
|
2971
2971
|
function a(s) {
|
|
2972
2972
|
return s === null || M(s) ? (e.exit("codeFlowValue"), l(s)) : (e.consume(s), a);
|
|
@@ -3248,10 +3248,10 @@ function Oo(e, n) {
|
|
|
3248
3248
|
s[_ + c[m][0]] = _ + c[m][1], _ += c[m][1] - c[m][0] - 1;
|
|
3249
3249
|
return s;
|
|
3250
3250
|
}
|
|
3251
|
-
const
|
|
3251
|
+
const Ro = {
|
|
3252
3252
|
resolve: jo,
|
|
3253
3253
|
tokenize: $o
|
|
3254
|
-
},
|
|
3254
|
+
}, Fo = {
|
|
3255
3255
|
partial: !0,
|
|
3256
3256
|
tokenize: Ho
|
|
3257
3257
|
};
|
|
@@ -3267,7 +3267,7 @@ function $o(e, n) {
|
|
|
3267
3267
|
}), i(a);
|
|
3268
3268
|
}
|
|
3269
3269
|
function i(a) {
|
|
3270
|
-
return a === null ? o(a) : M(a) ? e.check(
|
|
3270
|
+
return a === null ? o(a) : M(a) ? e.check(Fo, l, o)(a) : (e.consume(a), i);
|
|
3271
3271
|
}
|
|
3272
3272
|
function o(a) {
|
|
3273
3273
|
return e.exit("chunkContent"), e.exit("content"), n(a);
|
|
@@ -3398,7 +3398,7 @@ function qo(e, n, t) {
|
|
|
3398
3398
|
)(h);
|
|
3399
3399
|
}
|
|
3400
3400
|
function a(h) {
|
|
3401
|
-
return i =
|
|
3401
|
+
return i = Re(r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1)), h === 58 ? (e.enter("definitionMarker"), e.consume(h), e.exit("definitionMarker"), c) : t(h);
|
|
3402
3402
|
}
|
|
3403
3403
|
function c(h) {
|
|
3404
3404
|
return ie(h) ? Ze(e, s)(h) : s(h);
|
|
@@ -3557,7 +3557,7 @@ const Jo = [
|
|
|
3557
3557
|
"tr",
|
|
3558
3558
|
"track",
|
|
3559
3559
|
"ul"
|
|
3560
|
-
],
|
|
3560
|
+
], Tt = ["pre", "script", "style", "textarea"], Go = {
|
|
3561
3561
|
concrete: !0,
|
|
3562
3562
|
name: "htmlFlow",
|
|
3563
3563
|
resolveTo: tl,
|
|
@@ -3603,8 +3603,8 @@ function rl(e, n, t) {
|
|
|
3603
3603
|
}
|
|
3604
3604
|
function E(d) {
|
|
3605
3605
|
if (d === null || d === 47 || d === 62 || ie(d)) {
|
|
3606
|
-
const fe = d === 47,
|
|
3607
|
-
return !fe && !o &&
|
|
3606
|
+
const fe = d === 47, Te = l.toLowerCase();
|
|
3607
|
+
return !fe && !o && Tt.includes(Te) ? (i = 1, r.interrupt ? n(d) : C(d)) : Jo.includes(l.toLowerCase()) ? (i = 6, fe ? (e.consume(d), b) : r.interrupt ? n(d) : C(d)) : (i = 7, r.interrupt && !r.parser.lazy[r.now().line] ? t(d) : o ? P(d) : v(d));
|
|
3608
3608
|
}
|
|
3609
3609
|
return d === 45 || se(d) ? (e.consume(d), l += String.fromCharCode(d), E) : t(d);
|
|
3610
3610
|
}
|
|
@@ -3615,10 +3615,10 @@ function rl(e, n, t) {
|
|
|
3615
3615
|
return W(d) ? (e.consume(d), P) : j(d);
|
|
3616
3616
|
}
|
|
3617
3617
|
function v(d) {
|
|
3618
|
-
return d === 47 ? (e.consume(d), j) : d === 58 || d === 95 || xe(d) ? (e.consume(d),
|
|
3618
|
+
return d === 47 ? (e.consume(d), j) : d === 58 || d === 95 || xe(d) ? (e.consume(d), R) : W(d) ? (e.consume(d), v) : j(d);
|
|
3619
3619
|
}
|
|
3620
|
-
function
|
|
3621
|
-
return d === 45 || d === 46 || d === 58 || d === 95 || se(d) ? (e.consume(d),
|
|
3620
|
+
function R(d) {
|
|
3621
|
+
return d === 45 || d === 46 || d === 58 || d === 95 || se(d) ? (e.consume(d), R) : V(d);
|
|
3622
3622
|
}
|
|
3623
3623
|
function V(d) {
|
|
3624
3624
|
return d === 61 ? (e.consume(d), k) : W(d) ? (e.consume(d), V) : v(d);
|
|
@@ -3627,12 +3627,12 @@ function rl(e, n, t) {
|
|
|
3627
3627
|
return d === null || d === 60 || d === 61 || d === 62 || d === 96 ? t(d) : d === 34 || d === 39 ? (e.consume(d), c = d, B) : W(d) ? (e.consume(d), k) : U(d);
|
|
3628
3628
|
}
|
|
3629
3629
|
function B(d) {
|
|
3630
|
-
return d === c ? (e.consume(d), c = null,
|
|
3630
|
+
return d === c ? (e.consume(d), c = null, F) : d === null || M(d) ? t(d) : (e.consume(d), B);
|
|
3631
3631
|
}
|
|
3632
3632
|
function U(d) {
|
|
3633
3633
|
return d === null || d === 34 || d === 39 || d === 47 || d === 60 || d === 61 || d === 62 || d === 96 || ie(d) ? V(d) : (e.consume(d), U);
|
|
3634
3634
|
}
|
|
3635
|
-
function
|
|
3635
|
+
function F(d) {
|
|
3636
3636
|
return d === 47 || d === 62 || W(d) ? v(d) : t(d);
|
|
3637
3637
|
}
|
|
3638
3638
|
function j(d) {
|
|
@@ -3642,12 +3642,12 @@ function rl(e, n, t) {
|
|
|
3642
3642
|
return d === null || M(d) ? C(d) : W(d) ? (e.consume(d), N) : t(d);
|
|
3643
3643
|
}
|
|
3644
3644
|
function C(d) {
|
|
3645
|
-
return d === 45 && i === 2 ? (e.consume(d), A) : d === 60 && i === 1 ? (e.consume(d),
|
|
3645
|
+
return d === 45 && i === 2 ? (e.consume(d), A) : d === 60 && i === 1 ? (e.consume(d), L) : d === 62 && i === 4 ? (e.consume(d), J) : d === 63 && i === 3 ? (e.consume(d), f) : d === 93 && i === 5 ? (e.consume(d), Q) : M(d) && (i === 6 || i === 7) ? (e.exit("htmlFlowData"), e.check(el, ue, z)(d)) : d === null || M(d) ? (e.exit("htmlFlowData"), z(d)) : (e.consume(d), C);
|
|
3646
3646
|
}
|
|
3647
3647
|
function z(d) {
|
|
3648
|
-
return e.check(nl,
|
|
3648
|
+
return e.check(nl, T, ue)(d);
|
|
3649
3649
|
}
|
|
3650
|
-
function
|
|
3650
|
+
function T(d) {
|
|
3651
3651
|
return e.enter("lineEnding"), e.consume(d), e.exit("lineEnding"), y;
|
|
3652
3652
|
}
|
|
3653
3653
|
function y(d) {
|
|
@@ -3656,13 +3656,13 @@ function rl(e, n, t) {
|
|
|
3656
3656
|
function A(d) {
|
|
3657
3657
|
return d === 45 ? (e.consume(d), f) : C(d);
|
|
3658
3658
|
}
|
|
3659
|
-
function
|
|
3659
|
+
function L(d) {
|
|
3660
3660
|
return d === 47 ? (e.consume(d), l = "", q) : C(d);
|
|
3661
3661
|
}
|
|
3662
3662
|
function q(d) {
|
|
3663
3663
|
if (d === 62) {
|
|
3664
3664
|
const fe = l.toLowerCase();
|
|
3665
|
-
return
|
|
3665
|
+
return Tt.includes(fe) ? (e.consume(d), J) : C(d);
|
|
3666
3666
|
}
|
|
3667
3667
|
return xe(d) && l.length < 8 ? (e.consume(d), l += String.fromCharCode(d), q) : C(d);
|
|
3668
3668
|
}
|
|
@@ -3716,7 +3716,7 @@ function al(e, n, t) {
|
|
|
3716
3716
|
return f === 45 ? (e.consume(f), h) : t(f);
|
|
3717
3717
|
}
|
|
3718
3718
|
function p(f) {
|
|
3719
|
-
return f === null ? t(f) : f === 45 ? (e.consume(f), m) : M(f) ? (l = p,
|
|
3719
|
+
return f === null ? t(f) : f === 45 ? (e.consume(f), m) : M(f) ? (l = p, L(f)) : (e.consume(f), p);
|
|
3720
3720
|
}
|
|
3721
3721
|
function m(f) {
|
|
3722
3722
|
return f === 45 ? (e.consume(f), h) : p(f);
|
|
@@ -3729,7 +3729,7 @@ function al(e, n, t) {
|
|
|
3729
3729
|
return f === J.charCodeAt(o++) ? (e.consume(f), o === J.length ? I : _) : t(f);
|
|
3730
3730
|
}
|
|
3731
3731
|
function I(f) {
|
|
3732
|
-
return f === null ? t(f) : f === 93 ? (e.consume(f), E) : M(f) ? (l = I,
|
|
3732
|
+
return f === null ? t(f) : f === 93 ? (e.consume(f), E) : M(f) ? (l = I, L(f)) : (e.consume(f), I);
|
|
3733
3733
|
}
|
|
3734
3734
|
function E(f) {
|
|
3735
3735
|
return f === 93 ? (e.consume(f), b) : I(f);
|
|
@@ -3738,12 +3738,12 @@ function al(e, n, t) {
|
|
|
3738
3738
|
return f === 62 ? A(f) : f === 93 ? (e.consume(f), b) : I(f);
|
|
3739
3739
|
}
|
|
3740
3740
|
function P(f) {
|
|
3741
|
-
return f === null || f === 62 ? A(f) : M(f) ? (l = P,
|
|
3741
|
+
return f === null || f === 62 ? A(f) : M(f) ? (l = P, L(f)) : (e.consume(f), P);
|
|
3742
3742
|
}
|
|
3743
3743
|
function v(f) {
|
|
3744
|
-
return f === null ? t(f) : f === 63 ? (e.consume(f),
|
|
3744
|
+
return f === null ? t(f) : f === 63 ? (e.consume(f), R) : M(f) ? (l = v, L(f)) : (e.consume(f), v);
|
|
3745
3745
|
}
|
|
3746
|
-
function
|
|
3746
|
+
function R(f) {
|
|
3747
3747
|
return f === 62 ? A(f) : v(f);
|
|
3748
3748
|
}
|
|
3749
3749
|
function V(f) {
|
|
@@ -3753,36 +3753,36 @@ function al(e, n, t) {
|
|
|
3753
3753
|
return f === 45 || se(f) ? (e.consume(f), k) : B(f);
|
|
3754
3754
|
}
|
|
3755
3755
|
function B(f) {
|
|
3756
|
-
return M(f) ? (l = B,
|
|
3756
|
+
return M(f) ? (l = B, L(f)) : W(f) ? (e.consume(f), B) : A(f);
|
|
3757
3757
|
}
|
|
3758
3758
|
function U(f) {
|
|
3759
|
-
return f === 45 || se(f) ? (e.consume(f), U) : f === 47 || f === 62 || ie(f) ?
|
|
3759
|
+
return f === 45 || se(f) ? (e.consume(f), U) : f === 47 || f === 62 || ie(f) ? F(f) : t(f);
|
|
3760
3760
|
}
|
|
3761
|
-
function
|
|
3762
|
-
return f === 47 ? (e.consume(f), A) : f === 58 || f === 95 || xe(f) ? (e.consume(f), j) : M(f) ? (l =
|
|
3761
|
+
function F(f) {
|
|
3762
|
+
return f === 47 ? (e.consume(f), A) : f === 58 || f === 95 || xe(f) ? (e.consume(f), j) : M(f) ? (l = F, L(f)) : W(f) ? (e.consume(f), F) : A(f);
|
|
3763
3763
|
}
|
|
3764
3764
|
function j(f) {
|
|
3765
3765
|
return f === 45 || f === 46 || f === 58 || f === 95 || se(f) ? (e.consume(f), j) : N(f);
|
|
3766
3766
|
}
|
|
3767
3767
|
function N(f) {
|
|
3768
|
-
return f === 61 ? (e.consume(f), C) : M(f) ? (l = N,
|
|
3768
|
+
return f === 61 ? (e.consume(f), C) : M(f) ? (l = N, L(f)) : W(f) ? (e.consume(f), N) : F(f);
|
|
3769
3769
|
}
|
|
3770
3770
|
function C(f) {
|
|
3771
|
-
return f === null || f === 60 || f === 61 || f === 62 || f === 96 ? t(f) : f === 34 || f === 39 ? (e.consume(f), i = f, z) : M(f) ? (l = C,
|
|
3771
|
+
return f === null || f === 60 || f === 61 || f === 62 || f === 96 ? t(f) : f === 34 || f === 39 ? (e.consume(f), i = f, z) : M(f) ? (l = C, L(f)) : W(f) ? (e.consume(f), C) : (e.consume(f), T);
|
|
3772
3772
|
}
|
|
3773
3773
|
function z(f) {
|
|
3774
|
-
return f === i ? (e.consume(f), i = void 0, y) : f === null ? t(f) : M(f) ? (l = z,
|
|
3774
|
+
return f === i ? (e.consume(f), i = void 0, y) : f === null ? t(f) : M(f) ? (l = z, L(f)) : (e.consume(f), z);
|
|
3775
3775
|
}
|
|
3776
|
-
function
|
|
3777
|
-
return f === null || f === 34 || f === 39 || f === 60 || f === 61 || f === 96 ? t(f) : f === 47 || f === 62 || ie(f) ?
|
|
3776
|
+
function T(f) {
|
|
3777
|
+
return f === null || f === 34 || f === 39 || f === 60 || f === 61 || f === 96 ? t(f) : f === 47 || f === 62 || ie(f) ? F(f) : (e.consume(f), T);
|
|
3778
3778
|
}
|
|
3779
3779
|
function y(f) {
|
|
3780
|
-
return f === 47 || f === 62 || ie(f) ?
|
|
3780
|
+
return f === 47 || f === 62 || ie(f) ? F(f) : t(f);
|
|
3781
3781
|
}
|
|
3782
3782
|
function A(f) {
|
|
3783
3783
|
return f === 62 ? (e.consume(f), e.exit("htmlTextData"), e.exit("htmlText"), n) : t(f);
|
|
3784
3784
|
}
|
|
3785
|
-
function
|
|
3785
|
+
function L(f) {
|
|
3786
3786
|
return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(f), e.exit("lineEnding"), q;
|
|
3787
3787
|
}
|
|
3788
3788
|
function q(f) {
|
|
@@ -3866,7 +3866,7 @@ function fl(e, n, t) {
|
|
|
3866
3866
|
}
|
|
3867
3867
|
return a;
|
|
3868
3868
|
function a(m) {
|
|
3869
|
-
return o ? o._inactive ? p(m) : (l = r.parser.defined.includes(
|
|
3869
|
+
return o ? o._inactive ? p(m) : (l = r.parser.defined.includes(Re(r.sliceSerialize({
|
|
3870
3870
|
start: o.end,
|
|
3871
3871
|
end: r.now()
|
|
3872
3872
|
}))), e.enter("labelEnd"), e.enter("labelMarker"), e.consume(m), e.exit("labelMarker"), e.exit("labelEnd"), c) : t(m);
|
|
@@ -3918,7 +3918,7 @@ function ml(e, n, t) {
|
|
|
3918
3918
|
return xr.call(r, e, o, l, "reference", "referenceMarker", "referenceString")(a);
|
|
3919
3919
|
}
|
|
3920
3920
|
function o(a) {
|
|
3921
|
-
return r.parser.defined.includes(
|
|
3921
|
+
return r.parser.defined.includes(Re(r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1))) ? n(a) : t(a);
|
|
3922
3922
|
}
|
|
3923
3923
|
function l(a) {
|
|
3924
3924
|
return t(a);
|
|
@@ -4000,12 +4000,12 @@ const re = {
|
|
|
4000
4000
|
continuation: {
|
|
4001
4001
|
tokenize: El
|
|
4002
4002
|
},
|
|
4003
|
-
exit:
|
|
4003
|
+
exit: Tl,
|
|
4004
4004
|
name: "list",
|
|
4005
4005
|
tokenize: Il
|
|
4006
4006
|
}, _l = {
|
|
4007
4007
|
partial: !0,
|
|
4008
|
-
tokenize:
|
|
4008
|
+
tokenize: Ll
|
|
4009
4009
|
}, Sl = {
|
|
4010
4010
|
partial: !0,
|
|
4011
4011
|
tokenize: vl
|
|
@@ -4068,10 +4068,10 @@ function vl(e, n, t) {
|
|
|
4068
4068
|
return l && l[1].type === "listItemIndent" && l[2].sliceSerialize(l[1], !0).length === r.containerState.size ? n(o) : t(o);
|
|
4069
4069
|
}
|
|
4070
4070
|
}
|
|
4071
|
-
function
|
|
4071
|
+
function Tl(e) {
|
|
4072
4072
|
e.exit(this.containerState.type);
|
|
4073
4073
|
}
|
|
4074
|
-
function
|
|
4074
|
+
function Ll(e, n, t) {
|
|
4075
4075
|
const r = this;
|
|
4076
4076
|
return K(e, i, "listItemPrefixWhitespace", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 5);
|
|
4077
4077
|
function i(o) {
|
|
@@ -4079,7 +4079,7 @@ function Tl(e, n, t) {
|
|
|
4079
4079
|
return !W(o) && l && l[1].type === "listItemPrefixWhitespace" ? n(o) : t(o);
|
|
4080
4080
|
}
|
|
4081
4081
|
}
|
|
4082
|
-
const
|
|
4082
|
+
const Lt = {
|
|
4083
4083
|
name: "setextUnderline",
|
|
4084
4084
|
resolveTo: Nl,
|
|
4085
4085
|
tokenize: Pl
|
|
@@ -4140,7 +4140,7 @@ function zl(e) {
|
|
|
4140
4140
|
mn,
|
|
4141
4141
|
r,
|
|
4142
4142
|
// Try to parse initial flow (essentially, only code).
|
|
4143
|
-
e.attempt(this.parser.constructs.flowInitial, i, K(e, e.attempt(this.parser.constructs.flow, i, e.attempt(
|
|
4143
|
+
e.attempt(this.parser.constructs.flowInitial, i, K(e, e.attempt(this.parser.constructs.flow, i, e.attempt(Ro, i)), "linePrefix"))
|
|
4144
4144
|
);
|
|
4145
4145
|
return t;
|
|
4146
4146
|
function r(o) {
|
|
@@ -4248,7 +4248,7 @@ function Ol(e, n) {
|
|
|
4248
4248
|
}
|
|
4249
4249
|
return e;
|
|
4250
4250
|
}
|
|
4251
|
-
const
|
|
4251
|
+
const Rl = {
|
|
4252
4252
|
42: re,
|
|
4253
4253
|
43: re,
|
|
4254
4254
|
45: re,
|
|
@@ -4263,7 +4263,7 @@ const Fl = {
|
|
|
4263
4263
|
56: re,
|
|
4264
4264
|
57: re,
|
|
4265
4265
|
62: fr
|
|
4266
|
-
},
|
|
4266
|
+
}, Fl = {
|
|
4267
4267
|
91: Vo
|
|
4268
4268
|
}, jl = {
|
|
4269
4269
|
[-2]: Cn,
|
|
@@ -4272,9 +4272,9 @@ const Fl = {
|
|
|
4272
4272
|
}, $l = {
|
|
4273
4273
|
35: Ko,
|
|
4274
4274
|
42: hn,
|
|
4275
|
-
45: [
|
|
4275
|
+
45: [Lt, hn],
|
|
4276
4276
|
60: Go,
|
|
4277
|
-
61:
|
|
4277
|
+
61: Lt,
|
|
4278
4278
|
95: hn,
|
|
4279
4279
|
96: vt,
|
|
4280
4280
|
126: vt
|
|
@@ -4287,15 +4287,15 @@ const Fl = {
|
|
|
4287
4287
|
[-3]: _n,
|
|
4288
4288
|
33: yl,
|
|
4289
4289
|
38: mr,
|
|
4290
|
-
42:
|
|
4290
|
+
42: Rn,
|
|
4291
4291
|
60: [ko, ll],
|
|
4292
4292
|
91: kl,
|
|
4293
4293
|
92: [Yo, dr],
|
|
4294
4294
|
93: Zn,
|
|
4295
|
-
95:
|
|
4295
|
+
95: Rn,
|
|
4296
4296
|
96: Ao
|
|
4297
4297
|
}, Ul = {
|
|
4298
|
-
null: [
|
|
4298
|
+
null: [Rn, Ml]
|
|
4299
4299
|
}, ql = {
|
|
4300
4300
|
null: [42, 95]
|
|
4301
4301
|
}, Wl = {
|
|
@@ -4303,9 +4303,9 @@ const Fl = {
|
|
|
4303
4303
|
}, Yl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4304
4304
|
__proto__: null,
|
|
4305
4305
|
attentionMarkers: ql,
|
|
4306
|
-
contentInitial:
|
|
4306
|
+
contentInitial: Fl,
|
|
4307
4307
|
disable: Wl,
|
|
4308
|
-
document:
|
|
4308
|
+
document: Rl,
|
|
4309
4309
|
flow: $l,
|
|
4310
4310
|
flowInitial: jl,
|
|
4311
4311
|
insideSpan: Ul,
|
|
@@ -4327,7 +4327,7 @@ function Xl(e, n, t) {
|
|
|
4327
4327
|
check: B(k),
|
|
4328
4328
|
consume: P,
|
|
4329
4329
|
enter: v,
|
|
4330
|
-
exit:
|
|
4330
|
+
exit: R,
|
|
4331
4331
|
interrupt: B(k, {
|
|
4332
4332
|
interrupt: !0
|
|
4333
4333
|
})
|
|
@@ -4359,14 +4359,14 @@ function Xl(e, n, t) {
|
|
|
4359
4359
|
_bufferIndex: N,
|
|
4360
4360
|
_index: C,
|
|
4361
4361
|
line: z,
|
|
4362
|
-
column:
|
|
4362
|
+
column: T,
|
|
4363
4363
|
offset: y
|
|
4364
4364
|
} = r;
|
|
4365
4365
|
return {
|
|
4366
4366
|
_bufferIndex: N,
|
|
4367
4367
|
_index: C,
|
|
4368
4368
|
line: z,
|
|
4369
|
-
column:
|
|
4369
|
+
column: T,
|
|
4370
4370
|
offset: y
|
|
4371
4371
|
};
|
|
4372
4372
|
}
|
|
@@ -4397,7 +4397,7 @@ function Xl(e, n, t) {
|
|
|
4397
4397
|
const z = C || {};
|
|
4398
4398
|
return z.type = N, z.start = _(), s.events.push(["enter", z, s]), a.push(z), z;
|
|
4399
4399
|
}
|
|
4400
|
-
function
|
|
4400
|
+
function R(N) {
|
|
4401
4401
|
const C = a.pop();
|
|
4402
4402
|
return C.end = _(), s.events.push(["exit", C, s]), C;
|
|
4403
4403
|
}
|
|
@@ -4409,66 +4409,66 @@ function Xl(e, n, t) {
|
|
|
4409
4409
|
}
|
|
4410
4410
|
function B(N, C) {
|
|
4411
4411
|
return z;
|
|
4412
|
-
function z(
|
|
4413
|
-
let
|
|
4414
|
-
return Array.isArray(
|
|
4412
|
+
function z(T, y, A) {
|
|
4413
|
+
let L, q, Q, f;
|
|
4414
|
+
return Array.isArray(T) ? (
|
|
4415
4415
|
/* c8 ignore next 1 */
|
|
4416
|
-
ue(
|
|
4417
|
-
) : "tokenize" in
|
|
4416
|
+
ue(T)
|
|
4417
|
+
) : "tokenize" in T ? (
|
|
4418
4418
|
// Looks like a construct.
|
|
4419
4419
|
ue([
|
|
4420
4420
|
/** @type {Construct} */
|
|
4421
|
-
|
|
4421
|
+
T
|
|
4422
4422
|
])
|
|
4423
|
-
) : J(
|
|
4423
|
+
) : J(T);
|
|
4424
4424
|
function J(G) {
|
|
4425
4425
|
return $e;
|
|
4426
|
-
function $e(
|
|
4427
|
-
const Pe =
|
|
4426
|
+
function $e(_e) {
|
|
4427
|
+
const Pe = _e !== null && G[_e], Ae = _e !== null && G.null, on = [
|
|
4428
4428
|
// To do: add more extension tests.
|
|
4429
4429
|
/* c8 ignore next 2 */
|
|
4430
4430
|
...Array.isArray(Pe) ? Pe : Pe ? [Pe] : [],
|
|
4431
4431
|
...Array.isArray(Ae) ? Ae : Ae ? [Ae] : []
|
|
4432
4432
|
];
|
|
4433
|
-
return ue(on)(
|
|
4433
|
+
return ue(on)(_e);
|
|
4434
4434
|
}
|
|
4435
4435
|
}
|
|
4436
4436
|
function ue(G) {
|
|
4437
|
-
return
|
|
4437
|
+
return L = G, q = 0, G.length === 0 ? A : d(G[q]);
|
|
4438
4438
|
}
|
|
4439
4439
|
function d(G) {
|
|
4440
4440
|
return $e;
|
|
4441
|
-
function $e(
|
|
4442
|
-
return f =
|
|
4441
|
+
function $e(_e) {
|
|
4442
|
+
return f = F(), Q = G, G.partial || (s.currentConstruct = G), G.name && s.parser.constructs.disable.null.includes(G.name) ? Te() : G.tokenize.call(
|
|
4443
4443
|
// If we do have fields, create an object w/ `context` as its
|
|
4444
4444
|
// prototype.
|
|
4445
4445
|
// This allows a “live binding”, which is needed for `interrupt`.
|
|
4446
4446
|
C ? Object.assign(Object.create(s), C) : s,
|
|
4447
4447
|
c,
|
|
4448
4448
|
fe,
|
|
4449
|
-
|
|
4450
|
-
)(
|
|
4449
|
+
Te
|
|
4450
|
+
)(_e);
|
|
4451
4451
|
}
|
|
4452
4452
|
}
|
|
4453
4453
|
function fe(G) {
|
|
4454
4454
|
return N(Q, f), y;
|
|
4455
4455
|
}
|
|
4456
|
-
function
|
|
4457
|
-
return f.restore(), ++q <
|
|
4456
|
+
function Te(G) {
|
|
4457
|
+
return f.restore(), ++q < L.length ? d(L[q]) : A;
|
|
4458
4458
|
}
|
|
4459
4459
|
}
|
|
4460
4460
|
}
|
|
4461
4461
|
function U(N, C) {
|
|
4462
4462
|
N.resolveAll && !o.includes(N) && o.push(N), N.resolve && ke(s.events, C, s.events.length - C, N.resolve(s.events.slice(C), s)), N.resolveTo && (s.events = N.resolveTo(s.events, s));
|
|
4463
4463
|
}
|
|
4464
|
-
function
|
|
4465
|
-
const N = _(), C = s.previous, z = s.currentConstruct,
|
|
4464
|
+
function F() {
|
|
4465
|
+
const N = _(), C = s.previous, z = s.currentConstruct, T = s.events.length, y = Array.from(a);
|
|
4466
4466
|
return {
|
|
4467
|
-
from:
|
|
4467
|
+
from: T,
|
|
4468
4468
|
restore: A
|
|
4469
4469
|
};
|
|
4470
4470
|
function A() {
|
|
4471
|
-
r = N, s.previous = C, s.currentConstruct = z, s.events.length =
|
|
4471
|
+
r = N, s.previous = C, s.currentConstruct = z, s.events.length = T, a = y, j();
|
|
4472
4472
|
}
|
|
4473
4473
|
}
|
|
4474
4474
|
function j() {
|
|
@@ -4615,20 +4615,20 @@ function ia(e) {
|
|
|
4615
4615
|
canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
|
|
4616
4616
|
enter: {
|
|
4617
4617
|
autolink: o(lt),
|
|
4618
|
-
autolinkProtocol:
|
|
4619
|
-
autolinkEmail:
|
|
4618
|
+
autolinkProtocol: F,
|
|
4619
|
+
autolinkEmail: F,
|
|
4620
4620
|
atxHeading: o(rt),
|
|
4621
4621
|
blockQuote: o(Ae),
|
|
4622
|
-
characterEscape:
|
|
4623
|
-
characterReference:
|
|
4622
|
+
characterEscape: F,
|
|
4623
|
+
characterReference: F,
|
|
4624
4624
|
codeFenced: o(on),
|
|
4625
4625
|
codeFencedFenceInfo: l,
|
|
4626
4626
|
codeFencedFenceMeta: l,
|
|
4627
4627
|
codeIndented: o(on, l),
|
|
4628
4628
|
codeText: o(zr, l),
|
|
4629
|
-
codeTextData:
|
|
4630
|
-
data:
|
|
4631
|
-
codeFlowValue:
|
|
4629
|
+
codeTextData: F,
|
|
4630
|
+
data: F,
|
|
4631
|
+
codeFlowValue: F,
|
|
4632
4632
|
definition: o(Mr),
|
|
4633
4633
|
definitionDestinationString: l,
|
|
4634
4634
|
definitionLabelString: l,
|
|
@@ -4637,9 +4637,9 @@ function ia(e) {
|
|
|
4637
4637
|
hardBreakEscape: o(it),
|
|
4638
4638
|
hardBreakTrailing: o(it),
|
|
4639
4639
|
htmlFlow: o(ot, l),
|
|
4640
|
-
htmlFlowData:
|
|
4640
|
+
htmlFlowData: F,
|
|
4641
4641
|
htmlText: o(ot, l),
|
|
4642
|
-
htmlTextData:
|
|
4642
|
+
htmlTextData: F,
|
|
4643
4643
|
image: o(Br),
|
|
4644
4644
|
label: l,
|
|
4645
4645
|
link: o(lt),
|
|
@@ -4647,13 +4647,13 @@ function ia(e) {
|
|
|
4647
4647
|
listItemValue: m,
|
|
4648
4648
|
listOrdered: o(at, p),
|
|
4649
4649
|
listUnordered: o(at),
|
|
4650
|
-
paragraph: o(
|
|
4650
|
+
paragraph: o(Rr),
|
|
4651
4651
|
reference: d,
|
|
4652
4652
|
referenceString: l,
|
|
4653
4653
|
resourceDestinationString: l,
|
|
4654
4654
|
resourceTitleString: l,
|
|
4655
4655
|
setextHeading: o(rt),
|
|
4656
|
-
strong: o(
|
|
4656
|
+
strong: o(Fr),
|
|
4657
4657
|
thematicBreak: o($r)
|
|
4658
4658
|
},
|
|
4659
4659
|
exit: {
|
|
@@ -4661,11 +4661,11 @@ function ia(e) {
|
|
|
4661
4661
|
atxHeadingSequence: V,
|
|
4662
4662
|
autolink: c(),
|
|
4663
4663
|
autolinkEmail: Pe,
|
|
4664
|
-
autolinkProtocol:
|
|
4664
|
+
autolinkProtocol: _e,
|
|
4665
4665
|
blockQuote: c(),
|
|
4666
4666
|
characterEscapeValue: j,
|
|
4667
|
-
characterReferenceMarkerHexadecimal:
|
|
4668
|
-
characterReferenceMarkerNumeric:
|
|
4667
|
+
characterReferenceMarkerHexadecimal: Te,
|
|
4668
|
+
characterReferenceMarkerNumeric: Te,
|
|
4669
4669
|
characterReferenceValue: G,
|
|
4670
4670
|
characterReference: $e,
|
|
4671
4671
|
codeFenced: c(E),
|
|
@@ -4678,7 +4678,7 @@ function ia(e) {
|
|
|
4678
4678
|
codeTextData: j,
|
|
4679
4679
|
data: j,
|
|
4680
4680
|
definition: c(),
|
|
4681
|
-
definitionDestinationString:
|
|
4681
|
+
definitionDestinationString: R,
|
|
4682
4682
|
definitionLabelString: P,
|
|
4683
4683
|
definitionTitleString: v,
|
|
4684
4684
|
emphasis: c(),
|
|
@@ -4686,9 +4686,9 @@ function ia(e) {
|
|
|
4686
4686
|
hardBreakTrailing: c(C),
|
|
4687
4687
|
htmlFlow: c(z),
|
|
4688
4688
|
htmlFlowData: j,
|
|
4689
|
-
htmlText: c(
|
|
4689
|
+
htmlText: c(T),
|
|
4690
4690
|
htmlTextData: j,
|
|
4691
|
-
image: c(
|
|
4691
|
+
image: c(L),
|
|
4692
4692
|
label: Q,
|
|
4693
4693
|
labelText: q,
|
|
4694
4694
|
lineEnding: N,
|
|
@@ -4746,12 +4746,12 @@ function ia(e) {
|
|
|
4746
4746
|
(de[1] || Pt).call(D, void 0, de[0]);
|
|
4747
4747
|
}
|
|
4748
4748
|
for (S.position = {
|
|
4749
|
-
start:
|
|
4749
|
+
start: Se(g.length > 0 ? g[0][1].start : {
|
|
4750
4750
|
line: 1,
|
|
4751
4751
|
column: 1,
|
|
4752
4752
|
offset: 0
|
|
4753
4753
|
}),
|
|
4754
|
-
end:
|
|
4754
|
+
end: Se(g.length > 0 ? g[g.length - 2][1].end : {
|
|
4755
4755
|
line: 1,
|
|
4756
4756
|
column: 1,
|
|
4757
4757
|
offset: 0
|
|
@@ -4824,7 +4824,7 @@ function ia(e) {
|
|
|
4824
4824
|
}
|
|
4825
4825
|
function a(g, S, D) {
|
|
4826
4826
|
this.stack[this.stack.length - 1].children.push(g), this.stack.push(g), this.tokenStack.push([S, D || void 0]), g.position = {
|
|
4827
|
-
start:
|
|
4827
|
+
start: Se(S.start),
|
|
4828
4828
|
// @ts-expect-error: `end` will be patched later.
|
|
4829
4829
|
end: void 0
|
|
4830
4830
|
};
|
|
@@ -4843,7 +4843,7 @@ function ia(e) {
|
|
|
4843
4843
|
start: g.start,
|
|
4844
4844
|
end: g.end
|
|
4845
4845
|
}) + "): it’s not open");
|
|
4846
|
-
D.position.end =
|
|
4846
|
+
D.position.end = Se(g.end);
|
|
4847
4847
|
}
|
|
4848
4848
|
function u() {
|
|
4849
4849
|
return no(this.stack.pop());
|
|
@@ -4878,13 +4878,13 @@ function ia(e) {
|
|
|
4878
4878
|
}
|
|
4879
4879
|
function P(g) {
|
|
4880
4880
|
const S = this.resume(), D = this.stack[this.stack.length - 1];
|
|
4881
|
-
D.label = S, D.identifier =
|
|
4881
|
+
D.label = S, D.identifier = Re(this.sliceSerialize(g)).toLowerCase();
|
|
4882
4882
|
}
|
|
4883
4883
|
function v() {
|
|
4884
4884
|
const g = this.resume(), S = this.stack[this.stack.length - 1];
|
|
4885
4885
|
S.title = g;
|
|
4886
4886
|
}
|
|
4887
|
-
function
|
|
4887
|
+
function R() {
|
|
4888
4888
|
const g = this.resume(), S = this.stack[this.stack.length - 1];
|
|
4889
4889
|
S.url = g;
|
|
4890
4890
|
}
|
|
@@ -4905,27 +4905,27 @@ function ia(e) {
|
|
|
4905
4905
|
function U() {
|
|
4906
4906
|
this.data.setextHeadingSlurpLineEnding = void 0;
|
|
4907
4907
|
}
|
|
4908
|
-
function
|
|
4908
|
+
function F(g) {
|
|
4909
4909
|
const D = this.stack[this.stack.length - 1].children;
|
|
4910
4910
|
let $ = D[D.length - 1];
|
|
4911
4911
|
(!$ || $.type !== "text") && ($ = jr(), $.position = {
|
|
4912
|
-
start:
|
|
4912
|
+
start: Se(g.start),
|
|
4913
4913
|
// @ts-expect-error: we’ll add `end` later.
|
|
4914
4914
|
end: void 0
|
|
4915
4915
|
}, D.push($)), this.stack.push($);
|
|
4916
4916
|
}
|
|
4917
4917
|
function j(g) {
|
|
4918
4918
|
const S = this.stack.pop();
|
|
4919
|
-
S.value += this.sliceSerialize(g), S.position.end =
|
|
4919
|
+
S.value += this.sliceSerialize(g), S.position.end = Se(g.end);
|
|
4920
4920
|
}
|
|
4921
4921
|
function N(g) {
|
|
4922
4922
|
const S = this.stack[this.stack.length - 1];
|
|
4923
4923
|
if (this.data.atHardBreak) {
|
|
4924
4924
|
const D = S.children[S.children.length - 1];
|
|
4925
|
-
D.position.end =
|
|
4925
|
+
D.position.end = Se(g.end), this.data.atHardBreak = void 0;
|
|
4926
4926
|
return;
|
|
4927
4927
|
}
|
|
4928
|
-
!this.data.setextHeadingSlurpLineEnding && n.canContainEols.includes(S.type) && (
|
|
4928
|
+
!this.data.setextHeadingSlurpLineEnding && n.canContainEols.includes(S.type) && (F.call(this, g), j.call(this, g));
|
|
4929
4929
|
}
|
|
4930
4930
|
function C() {
|
|
4931
4931
|
this.data.atHardBreak = !0;
|
|
@@ -4934,7 +4934,7 @@ function ia(e) {
|
|
|
4934
4934
|
const g = this.resume(), S = this.stack[this.stack.length - 1];
|
|
4935
4935
|
S.value = g;
|
|
4936
4936
|
}
|
|
4937
|
-
function
|
|
4937
|
+
function T() {
|
|
4938
4938
|
const g = this.resume(), S = this.stack[this.stack.length - 1];
|
|
4939
4939
|
S.value = g;
|
|
4940
4940
|
}
|
|
@@ -4951,7 +4951,7 @@ function ia(e) {
|
|
|
4951
4951
|
delete g.identifier, delete g.label;
|
|
4952
4952
|
this.data.referenceType = void 0;
|
|
4953
4953
|
}
|
|
4954
|
-
function
|
|
4954
|
+
function L() {
|
|
4955
4955
|
const g = this.stack[this.stack.length - 1];
|
|
4956
4956
|
if (this.data.inReference) {
|
|
4957
4957
|
const S = this.data.referenceType || "shortcut";
|
|
@@ -4962,7 +4962,7 @@ function ia(e) {
|
|
|
4962
4962
|
}
|
|
4963
4963
|
function q(g) {
|
|
4964
4964
|
const S = this.sliceSerialize(g), D = this.stack[this.stack.length - 2];
|
|
4965
|
-
D.label = na(S), D.identifier =
|
|
4965
|
+
D.label = na(S), D.identifier = Re(S).toLowerCase();
|
|
4966
4966
|
}
|
|
4967
4967
|
function Q() {
|
|
4968
4968
|
const g = this.stack[this.stack.length - 1], S = this.resume(), D = this.stack[this.stack.length - 1];
|
|
@@ -4988,9 +4988,9 @@ function ia(e) {
|
|
|
4988
4988
|
}
|
|
4989
4989
|
function fe(g) {
|
|
4990
4990
|
const S = this.resume(), D = this.stack[this.stack.length - 1];
|
|
4991
|
-
D.label = S, D.identifier =
|
|
4991
|
+
D.label = S, D.identifier = Re(this.sliceSerialize(g)).toLowerCase(), this.data.referenceType = "full";
|
|
4992
4992
|
}
|
|
4993
|
-
function
|
|
4993
|
+
function Te(g) {
|
|
4994
4994
|
this.data.characterReferenceType = g.type;
|
|
4995
4995
|
}
|
|
4996
4996
|
function G(g) {
|
|
@@ -5002,9 +5002,9 @@ function ia(e) {
|
|
|
5002
5002
|
}
|
|
5003
5003
|
function $e(g) {
|
|
5004
5004
|
const S = this.stack.pop();
|
|
5005
|
-
S.position.end =
|
|
5005
|
+
S.position.end = Se(g.end);
|
|
5006
5006
|
}
|
|
5007
|
-
function
|
|
5007
|
+
function _e(g) {
|
|
5008
5008
|
j.call(this, g);
|
|
5009
5009
|
const S = this.stack[this.stack.length - 1];
|
|
5010
5010
|
S.url = this.sliceSerialize(g);
|
|
@@ -5101,13 +5101,13 @@ function ia(e) {
|
|
|
5101
5101
|
children: []
|
|
5102
5102
|
};
|
|
5103
5103
|
}
|
|
5104
|
-
function
|
|
5104
|
+
function Rr() {
|
|
5105
5105
|
return {
|
|
5106
5106
|
type: "paragraph",
|
|
5107
5107
|
children: []
|
|
5108
5108
|
};
|
|
5109
5109
|
}
|
|
5110
|
-
function
|
|
5110
|
+
function Fr() {
|
|
5111
5111
|
return {
|
|
5112
5112
|
type: "strong",
|
|
5113
5113
|
children: []
|
|
@@ -5125,7 +5125,7 @@ function ia(e) {
|
|
|
5125
5125
|
};
|
|
5126
5126
|
}
|
|
5127
5127
|
}
|
|
5128
|
-
function
|
|
5128
|
+
function Se(e) {
|
|
5129
5129
|
return {
|
|
5130
5130
|
line: e.line,
|
|
5131
5131
|
column: e.column,
|
|
@@ -5458,7 +5458,7 @@ function va(e, n, t) {
|
|
|
5458
5458
|
};
|
|
5459
5459
|
return e.patch(n, u), e.applyData(n, u);
|
|
5460
5460
|
}
|
|
5461
|
-
function
|
|
5461
|
+
function Ta(e, n) {
|
|
5462
5462
|
const t = {
|
|
5463
5463
|
type: "element",
|
|
5464
5464
|
tagName: "td",
|
|
@@ -5469,7 +5469,7 @@ function La(e, n) {
|
|
|
5469
5469
|
return e.patch(n, t), e.applyData(n, t);
|
|
5470
5470
|
}
|
|
5471
5471
|
const At = 9, zt = 32;
|
|
5472
|
-
function
|
|
5472
|
+
function La(e) {
|
|
5473
5473
|
const n = String(e), t = /\r?\n|\r/g;
|
|
5474
5474
|
let r = t.exec(n), i = 0;
|
|
5475
5475
|
const o = [];
|
|
@@ -5495,7 +5495,7 @@ function Mt(e, n, t) {
|
|
|
5495
5495
|
return i > r ? e.slice(r, i) : "";
|
|
5496
5496
|
}
|
|
5497
5497
|
function Na(e, n) {
|
|
5498
|
-
const t = { type: "text", value:
|
|
5498
|
+
const t = { type: "text", value: La(String(n.value)) };
|
|
5499
5499
|
return e.patch(n, t), e.applyData(n, t);
|
|
5500
5500
|
}
|
|
5501
5501
|
function Pa(e, n) {
|
|
@@ -5528,7 +5528,7 @@ const Aa = {
|
|
|
5528
5528
|
root: Sa,
|
|
5529
5529
|
strong: Ia,
|
|
5530
5530
|
table: Ea,
|
|
5531
|
-
tableCell:
|
|
5531
|
+
tableCell: Ta,
|
|
5532
5532
|
tableRow: va,
|
|
5533
5533
|
text: Na,
|
|
5534
5534
|
thematicBreak: Pa,
|
|
@@ -5539,7 +5539,7 @@ const Aa = {
|
|
|
5539
5539
|
};
|
|
5540
5540
|
function ln() {
|
|
5541
5541
|
}
|
|
5542
|
-
const Er = -1, gn = 0, Je = 1, fn = 2, Jn = 3, Gn = 4, et = 5, nt = 6, vr = 7,
|
|
5542
|
+
const Er = -1, gn = 0, Je = 1, fn = 2, Jn = 3, Gn = 4, et = 5, nt = 6, vr = 7, Tr = 8, Dt = typeof self == "object" ? self : globalThis, za = (e, n) => {
|
|
5543
5543
|
const t = (i, o) => (e.set(o, i), i), r = (i) => {
|
|
5544
5544
|
if (e.has(i))
|
|
5545
5545
|
return e.get(i);
|
|
@@ -5582,7 +5582,7 @@ const Er = -1, gn = 0, Je = 1, fn = 2, Jn = 3, Gn = 4, et = 5, nt = 6, vr = 7, L
|
|
|
5582
5582
|
const { name: a, message: c } = l;
|
|
5583
5583
|
return t(new Dt[a](c), i);
|
|
5584
5584
|
}
|
|
5585
|
-
case
|
|
5585
|
+
case Tr:
|
|
5586
5586
|
return t(BigInt(l), i);
|
|
5587
5587
|
case "BigInt":
|
|
5588
5588
|
return t(Object(BigInt(l)), i);
|
|
@@ -5631,7 +5631,7 @@ const Er = -1, gn = 0, Je = 1, fn = 2, Jn = 3, Gn = 4, et = 5, nt = 6, vr = 7, L
|
|
|
5631
5631
|
let u = l;
|
|
5632
5632
|
switch (c) {
|
|
5633
5633
|
case "bigint":
|
|
5634
|
-
a =
|
|
5634
|
+
a = Tr, u = l.toString();
|
|
5635
5635
|
break;
|
|
5636
5636
|
case "function":
|
|
5637
5637
|
case "symbol":
|
|
@@ -5710,11 +5710,11 @@ function Oa(e, n) {
|
|
|
5710
5710
|
children: [{ type: "text", value: String(n) }]
|
|
5711
5711
|
}), t;
|
|
5712
5712
|
}
|
|
5713
|
-
function
|
|
5713
|
+
function Ra(e, n) {
|
|
5714
5714
|
return "Back to reference " + (e + 1) + (n > 1 ? "-" + n : "");
|
|
5715
5715
|
}
|
|
5716
|
-
function
|
|
5717
|
-
const n = typeof e.options.clobberPrefix == "string" ? e.options.clobberPrefix : "user-content-", t = e.options.footnoteBackContent || Oa, r = e.options.footnoteBackLabel ||
|
|
5716
|
+
function Fa(e) {
|
|
5717
|
+
const n = typeof e.options.clobberPrefix == "string" ? e.options.clobberPrefix : "user-content-", t = e.options.footnoteBackContent || Oa, r = e.options.footnoteBackLabel || Ra, i = e.options.footnoteLabel || "Footnotes", o = e.options.footnoteLabelTagName || "h2", l = e.options.footnoteLabelProperties || {
|
|
5718
5718
|
className: ["sr-only"]
|
|
5719
5719
|
}, a = [];
|
|
5720
5720
|
let c = -1;
|
|
@@ -5784,7 +5784,7 @@ function Ra(e) {
|
|
|
5784
5784
|
]
|
|
5785
5785
|
};
|
|
5786
5786
|
}
|
|
5787
|
-
const
|
|
5787
|
+
const Lr = (
|
|
5788
5788
|
// Note: overloads in JSDoc can’t yet use different `@template`s.
|
|
5789
5789
|
/**
|
|
5790
5790
|
* @type {(
|
|
@@ -5822,7 +5822,7 @@ function ja(e) {
|
|
|
5822
5822
|
const n = [];
|
|
5823
5823
|
let t = -1;
|
|
5824
5824
|
for (; ++t < e.length; )
|
|
5825
|
-
n[t] =
|
|
5825
|
+
n[t] = Lr(e[t]);
|
|
5826
5826
|
return yn(r);
|
|
5827
5827
|
function r(...i) {
|
|
5828
5828
|
let o = -1;
|
|
@@ -5872,11 +5872,11 @@ function Va() {
|
|
|
5872
5872
|
function Ua(e) {
|
|
5873
5873
|
return e !== null && typeof e == "object" && "type" in e;
|
|
5874
5874
|
}
|
|
5875
|
-
const Nr = [], qa = !0,
|
|
5875
|
+
const Nr = [], qa = !0, Rt = !1, Wa = "skip";
|
|
5876
5876
|
function Ya(e, n, t, r) {
|
|
5877
5877
|
let i;
|
|
5878
5878
|
typeof n == "function" && typeof t != "function" ? (r = t, t = n) : i = n;
|
|
5879
|
-
const o =
|
|
5879
|
+
const o = Lr(i), l = r ? -1 : 1;
|
|
5880
5880
|
a(e, void 0, [])();
|
|
5881
5881
|
function a(c, s, u) {
|
|
5882
5882
|
const p = (
|
|
@@ -5898,7 +5898,7 @@ function Ya(e, n, t, r) {
|
|
|
5898
5898
|
return m;
|
|
5899
5899
|
function m() {
|
|
5900
5900
|
let h = Nr, _, I, E;
|
|
5901
|
-
if ((!n || o(c, s, u[u.length - 1] || void 0)) && (h = Xa(t(c, u)), h[0] ===
|
|
5901
|
+
if ((!n || o(c, s, u[u.length - 1] || void 0)) && (h = Xa(t(c, u)), h[0] === Rt))
|
|
5902
5902
|
return h;
|
|
5903
5903
|
if ("children" in c && c.children) {
|
|
5904
5904
|
const b = (
|
|
@@ -5908,7 +5908,7 @@ function Ya(e, n, t, r) {
|
|
|
5908
5908
|
if (b.children && h[0] !== Wa)
|
|
5909
5909
|
for (I = (r ? b.children.length : -1) + l, E = u.concat(b); I > -1 && I < b.children.length; ) {
|
|
5910
5910
|
const P = b.children[I];
|
|
5911
|
-
if (_ = a(P, I, E)(), _[0] ===
|
|
5911
|
+
if (_ = a(P, I, E)(), _[0] === Rt)
|
|
5912
5912
|
return _;
|
|
5913
5913
|
I = typeof _[1] == "number" ? _[1] : I + l;
|
|
5914
5914
|
}
|
|
@@ -5928,7 +5928,7 @@ function Pr(e, n, t, r) {
|
|
|
5928
5928
|
return l(c, p, u);
|
|
5929
5929
|
}
|
|
5930
5930
|
}
|
|
5931
|
-
const
|
|
5931
|
+
const Fn = {}.hasOwnProperty, Ka = {};
|
|
5932
5932
|
function Qa(e, n) {
|
|
5933
5933
|
const t = n || Ka, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), l = { ...Aa, ...t.handlers }, a = {
|
|
5934
5934
|
all: s,
|
|
@@ -5951,7 +5951,7 @@ function Qa(e, n) {
|
|
|
5951
5951
|
}), a;
|
|
5952
5952
|
function c(u, p) {
|
|
5953
5953
|
const m = u.type, h = a.handlers[m];
|
|
5954
|
-
if (
|
|
5954
|
+
if (Fn.call(a.handlers, m) && h)
|
|
5955
5955
|
return h(a, u, p);
|
|
5956
5956
|
if (a.options.passThrough && a.options.passThrough.includes(m)) {
|
|
5957
5957
|
if ("children" in u) {
|
|
@@ -5970,9 +5970,9 @@ function Qa(e, n) {
|
|
|
5970
5970
|
for (; ++h < m.length; ) {
|
|
5971
5971
|
const _ = a.one(m[h], u);
|
|
5972
5972
|
if (_) {
|
|
5973
|
-
if (h && m[h - 1].type === "break" && (!Array.isArray(_) && _.type === "text" && (_.value =
|
|
5973
|
+
if (h && m[h - 1].type === "break" && (!Array.isArray(_) && _.type === "text" && (_.value = Ft(_.value)), !Array.isArray(_) && _.type === "element")) {
|
|
5974
5974
|
const I = _.children[0];
|
|
5975
|
-
I && I.type === "text" && (I.value =
|
|
5975
|
+
I && I.type === "text" && (I.value = Ft(I.value));
|
|
5976
5976
|
}
|
|
5977
5977
|
Array.isArray(_) ? p.push(..._) : p.push(_);
|
|
5978
5978
|
}
|
|
@@ -6000,7 +6000,7 @@ function Ja(e, n) {
|
|
|
6000
6000
|
return t;
|
|
6001
6001
|
}
|
|
6002
6002
|
function Ga(e, n) {
|
|
6003
|
-
const t = n.data || {}, r = "value" in n && !(
|
|
6003
|
+
const t = n.data || {}, r = "value" in n && !(Fn.call(t, "hProperties") || Fn.call(t, "hChildren")) ? { type: "text", value: n.value } : {
|
|
6004
6004
|
type: "element",
|
|
6005
6005
|
tagName: "div",
|
|
6006
6006
|
properties: {},
|
|
@@ -6018,14 +6018,14 @@ function es(e, n) {
|
|
|
6018
6018
|
return n && e.length > 0 && t.push({ type: "text", value: `
|
|
6019
6019
|
` }), t;
|
|
6020
6020
|
}
|
|
6021
|
-
function
|
|
6021
|
+
function Ft(e) {
|
|
6022
6022
|
let n = 0, t = e.charCodeAt(n);
|
|
6023
6023
|
for (; t === 9 || t === 32; )
|
|
6024
6024
|
n++, t = e.charCodeAt(n);
|
|
6025
6025
|
return e.slice(n);
|
|
6026
6026
|
}
|
|
6027
6027
|
function jt(e, n) {
|
|
6028
|
-
const t = Qa(e, n), r = t.one(e, void 0), i =
|
|
6028
|
+
const t = Qa(e, n), r = t.one(e, void 0), i = Fa(t), o = Array.isArray(r) ? { type: "root", children: r } : r || { type: "root", children: [] };
|
|
6029
6029
|
return i && o.children.push({ type: "text", value: `
|
|
6030
6030
|
` }, i), o;
|
|
6031
6031
|
}
|
|
@@ -6372,7 +6372,7 @@ class Ar {
|
|
|
6372
6372
|
* Nothing.
|
|
6373
6373
|
*/
|
|
6374
6374
|
set basename(n) {
|
|
6375
|
-
|
|
6375
|
+
Tn(n, "basename"), vn(n, "basename"), this.path = ye.join(this.dirname || "", n);
|
|
6376
6376
|
}
|
|
6377
6377
|
/**
|
|
6378
6378
|
* Get the parent path (example: `'~'`).
|
|
@@ -6448,7 +6448,7 @@ class Ar {
|
|
|
6448
6448
|
* Nothing.
|
|
6449
6449
|
*/
|
|
6450
6450
|
set path(n) {
|
|
6451
|
-
$n(n) && (n = ds(n)),
|
|
6451
|
+
$n(n) && (n = ds(n)), Tn(n, "path"), this.path !== n && this.history.push(n);
|
|
6452
6452
|
}
|
|
6453
6453
|
/**
|
|
6454
6454
|
* Get the stem (basename w/o extname) (example: `'index.min'`).
|
|
@@ -6472,7 +6472,7 @@ class Ar {
|
|
|
6472
6472
|
* Nothing.
|
|
6473
6473
|
*/
|
|
6474
6474
|
set stem(n) {
|
|
6475
|
-
|
|
6475
|
+
Tn(n, "stem"), vn(n, "stem"), this.path = ye.join(this.dirname || "", n + (this.extname || ""));
|
|
6476
6476
|
}
|
|
6477
6477
|
// Normal prototypal methods.
|
|
6478
6478
|
/**
|
|
@@ -6691,7 +6691,7 @@ function vn(e, n) {
|
|
|
6691
6691
|
"`" + n + "` cannot be a path: did not expect `" + ye.sep + "`"
|
|
6692
6692
|
);
|
|
6693
6693
|
}
|
|
6694
|
-
function
|
|
6694
|
+
function Tn(e, n) {
|
|
6695
6695
|
if (!e)
|
|
6696
6696
|
throw new Error("`" + n + "` cannot be empty");
|
|
6697
6697
|
}
|
|
@@ -6868,7 +6868,7 @@ class tt extends ys {
|
|
|
6868
6868
|
parse(n) {
|
|
6869
6869
|
this.freeze();
|
|
6870
6870
|
const t = sn(n), r = this.parser || this.Parser;
|
|
6871
|
-
return
|
|
6871
|
+
return Ln("parse", r), r(String(t), t);
|
|
6872
6872
|
}
|
|
6873
6873
|
/**
|
|
6874
6874
|
* Process the given file as configured on the processor.
|
|
@@ -6914,7 +6914,7 @@ class tt extends ys {
|
|
|
6914
6914
|
*/
|
|
6915
6915
|
process(n, t) {
|
|
6916
6916
|
const r = this;
|
|
6917
|
-
return this.freeze(),
|
|
6917
|
+
return this.freeze(), Ln("process", this.parser || this.Parser), Nn("process", this.compiler || this.Compiler), t ? i(void 0, t) : new Promise(i);
|
|
6918
6918
|
function i(o, l) {
|
|
6919
6919
|
const a = sn(n), c = (
|
|
6920
6920
|
/** @type {HeadTree extends undefined ? Node : HeadTree} */
|
|
@@ -6973,7 +6973,7 @@ class tt extends ys {
|
|
|
6973
6973
|
*/
|
|
6974
6974
|
processSync(n) {
|
|
6975
6975
|
let t = !1, r;
|
|
6976
|
-
return this.freeze(),
|
|
6976
|
+
return this.freeze(), Ln("processSync", this.parser || this.Parser), Nn("processSync", this.compiler || this.Compiler), this.process(n, i), qt("processSync", "process", t), r;
|
|
6977
6977
|
function i(o, l) {
|
|
6978
6978
|
t = !0, $t(o), r = l;
|
|
6979
6979
|
}
|
|
@@ -7206,7 +7206,7 @@ class tt extends ys {
|
|
|
7206
7206
|
}
|
|
7207
7207
|
}
|
|
7208
7208
|
const ks = new tt().freeze();
|
|
7209
|
-
function
|
|
7209
|
+
function Ln(e, n) {
|
|
7210
7210
|
if (typeof n != "function")
|
|
7211
7211
|
throw new TypeError("Cannot `" + e + "` without `parser`");
|
|
7212
7212
|
}
|
|
@@ -7277,22 +7277,22 @@ const _s = "https://github.com/remarkjs/react-markdown/blob/main/changelog.md",
|
|
|
7277
7277
|
{ from: "transformLinkUri", id: "#add-urltransform", to: "urlTransform" }
|
|
7278
7278
|
];
|
|
7279
7279
|
function Es(e) {
|
|
7280
|
-
const n = vs(e), t =
|
|
7281
|
-
return
|
|
7280
|
+
const n = vs(e), t = Ts(e);
|
|
7281
|
+
return Ls(n.runSync(n.parse(t), t), e);
|
|
7282
7282
|
}
|
|
7283
7283
|
function vs(e) {
|
|
7284
7284
|
const n = e.rehypePlugins || Wt, t = e.remarkPlugins || Wt, r = e.remarkRehypeOptions ? { ...e.remarkRehypeOptions, ...Yt } : Yt;
|
|
7285
7285
|
return ks().use(la).use(t).use(ns, r).use(n);
|
|
7286
7286
|
}
|
|
7287
|
-
function
|
|
7287
|
+
function Ts(e) {
|
|
7288
7288
|
const n = e.children || "", t = new Ar();
|
|
7289
7289
|
return typeof n == "string" && (t.value = n), t;
|
|
7290
7290
|
}
|
|
7291
|
-
function
|
|
7291
|
+
function Ls(e, n) {
|
|
7292
7292
|
const t = n.allowedElements, r = n.allowElement, i = n.components, o = n.disallowedElements, l = n.skipHtml, a = n.unwrapDisallowed, c = n.urlTransform || Ns;
|
|
7293
7293
|
for (const u of Is)
|
|
7294
7294
|
Object.hasOwn(n, u.from) && ("" + u.from + (u.to ? "use `" + u.to + "` instead" : "remove it") + _s + u.id, void 0);
|
|
7295
|
-
return Pr(e, s),
|
|
7295
|
+
return Pr(e, s), Ri(e, {
|
|
7296
7296
|
Fragment: Kt,
|
|
7297
7297
|
components: i,
|
|
7298
7298
|
ignoreInvalidStyle: !0,
|
|
@@ -7328,7 +7328,7 @@ function Ns(e) {
|
|
|
7328
7328
|
Ss.test(e.slice(0, n)) ? e : ""
|
|
7329
7329
|
);
|
|
7330
7330
|
}
|
|
7331
|
-
const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1thak_24", Ms = "_avatar_1thak_28", Ds = "_avatarPlaceholder_1thak_43", Bs = "_brainbaseLogo_1thak_53", Os = "_messageBubble_1thak_58",
|
|
7331
|
+
const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1thak_24", Ms = "_avatar_1thak_28", Ds = "_avatarPlaceholder_1thak_43", Bs = "_brainbaseLogo_1thak_53", Os = "_messageBubble_1thak_58", Rs = "_error_1thak_76", Fs = "_content_1thak_81", js = "_markdown_1thak_92", $s = "_cursor_1thak_183", Hs = "_errorIndicator_1thak_202", ce = {
|
|
7332
7332
|
messageWrapper: Ps,
|
|
7333
7333
|
user: As,
|
|
7334
7334
|
assistant: zs,
|
|
@@ -7336,8 +7336,8 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
7336
7336
|
avatarPlaceholder: Ds,
|
|
7337
7337
|
brainbaseLogo: Bs,
|
|
7338
7338
|
messageBubble: Os,
|
|
7339
|
-
error:
|
|
7340
|
-
content:
|
|
7339
|
+
error: Rs,
|
|
7340
|
+
content: Fs,
|
|
7341
7341
|
markdown: js,
|
|
7342
7342
|
cursor: $s,
|
|
7343
7343
|
errorIndicator: Hs
|
|
@@ -7437,7 +7437,7 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
7437
7437
|
]
|
|
7438
7438
|
}
|
|
7439
7439
|
);
|
|
7440
|
-
}, tu = "_wrapper_10rss_2", ru = "_avatar_10rss_22", iu = "_avatarPlaceholder_10rss_37", ou = "_brainbaseLogo_10rss_47", lu = "_bubble_10rss_52", au = "_dot_10rss_63",
|
|
7440
|
+
}, tu = "_wrapper_10rss_2", ru = "_avatar_10rss_22", iu = "_avatarPlaceholder_10rss_37", ou = "_brainbaseLogo_10rss_47", lu = "_bubble_10rss_52", au = "_dot_10rss_63", Ie = {
|
|
7441
7441
|
wrapper: tu,
|
|
7442
7442
|
avatar: ru,
|
|
7443
7443
|
avatarPlaceholder: iu,
|
|
@@ -7447,19 +7447,19 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
7447
7447
|
}, su = ({
|
|
7448
7448
|
agentName: e = "AI",
|
|
7449
7449
|
agentLogoUrl: n
|
|
7450
|
-
}) => /* @__PURE__ */ H("div", { className:
|
|
7451
|
-
/* @__PURE__ */ x("div", { className:
|
|
7450
|
+
}) => /* @__PURE__ */ H("div", { className: Ie.wrapper, role: "status", "aria-label": `${e} is typing`, children: [
|
|
7451
|
+
/* @__PURE__ */ x("div", { className: Ie.avatar, children: n ? /* @__PURE__ */ x("img", { src: n, alt: e }) : /* @__PURE__ */ x("div", { className: Ie.avatarPlaceholder, children: /* @__PURE__ */ x(
|
|
7452
7452
|
en,
|
|
7453
7453
|
{
|
|
7454
|
-
className:
|
|
7454
|
+
className: Ie.brainbaseLogo,
|
|
7455
7455
|
color: "white",
|
|
7456
7456
|
cutoutColor: "var(--bb-primary-color)"
|
|
7457
7457
|
}
|
|
7458
7458
|
) }) }),
|
|
7459
|
-
/* @__PURE__ */ H("div", { className:
|
|
7460
|
-
/* @__PURE__ */ x("span", { className:
|
|
7461
|
-
/* @__PURE__ */ x("span", { className:
|
|
7462
|
-
/* @__PURE__ */ x("span", { className:
|
|
7459
|
+
/* @__PURE__ */ H("div", { className: Ie.bubble, children: [
|
|
7460
|
+
/* @__PURE__ */ x("span", { className: Ie.dot }),
|
|
7461
|
+
/* @__PURE__ */ x("span", { className: Ie.dot }),
|
|
7462
|
+
/* @__PURE__ */ x("span", { className: Ie.dot })
|
|
7463
7463
|
] })
|
|
7464
7464
|
] }), uu = "_messageList_9tkjc_1", cu = "_emptyState_9tkjc_30", pu = "_emptyIcon_9tkjc_41", hu = "_emptyText_9tkjc_53", un = {
|
|
7465
7465
|
messageList: uu,
|
|
@@ -7473,14 +7473,21 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
7473
7473
|
agentName: r,
|
|
7474
7474
|
agentLogoUrl: i
|
|
7475
7475
|
}) => {
|
|
7476
|
-
var
|
|
7477
|
-
const o =
|
|
7476
|
+
var u;
|
|
7477
|
+
const o = Ce(null), l = Ce(null), a = Ce(e.length), c = Ce(n.length);
|
|
7478
7478
|
Ge(() => {
|
|
7479
|
-
|
|
7480
|
-
(
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7479
|
+
const p = e.length > a.current, m = n.length > c.current;
|
|
7480
|
+
if (p || m || t && e.length > 0) {
|
|
7481
|
+
const h = o.current;
|
|
7482
|
+
h && h.scrollTo({
|
|
7483
|
+
top: h.scrollHeight,
|
|
7484
|
+
behavior: "smooth"
|
|
7485
|
+
});
|
|
7486
|
+
}
|
|
7487
|
+
a.current = e.length, c.current = n.length;
|
|
7488
|
+
}, [e.length, n.length, t]);
|
|
7489
|
+
const s = n.filter(
|
|
7490
|
+
(p) => p.status === "pending" || p.status === "executing"
|
|
7484
7491
|
);
|
|
7485
7492
|
return /* @__PURE__ */ H("div", { className: un.messageList, ref: o, role: "log", "aria-live": "polite", children: [
|
|
7486
7493
|
e.length === 0 && !t && /* @__PURE__ */ H("div", { className: un.emptyState, children: [
|
|
@@ -7496,17 +7503,17 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
7496
7503
|
) }) }),
|
|
7497
7504
|
/* @__PURE__ */ x("p", { className: un.emptyText, children: "Start a conversation" })
|
|
7498
7505
|
] }),
|
|
7499
|
-
e.map((
|
|
7506
|
+
e.map((p) => /* @__PURE__ */ x(
|
|
7500
7507
|
Vs,
|
|
7501
7508
|
{
|
|
7502
|
-
message:
|
|
7509
|
+
message: p,
|
|
7503
7510
|
agentName: r,
|
|
7504
7511
|
agentLogoUrl: i
|
|
7505
7512
|
},
|
|
7506
|
-
|
|
7513
|
+
p.id
|
|
7507
7514
|
)),
|
|
7508
|
-
|
|
7509
|
-
t && ((
|
|
7515
|
+
s.map((p) => /* @__PURE__ */ x(nu, { toolCall: p }, p.id)),
|
|
7516
|
+
t && ((u = e[e.length - 1]) == null ? void 0 : u.role) === "user" && /* @__PURE__ */ x(su, { agentName: r, agentLogoUrl: i }),
|
|
7510
7517
|
/* @__PURE__ */ x("div", { ref: l })
|
|
7511
7518
|
] });
|
|
7512
7519
|
}, du = "_inputWrapper_5lgg7_1", mu = "_inputContainer_5lgg7_7", gu = "_textarea_5lgg7_23", yu = "_sendButton_5lgg7_50", xu = "_hint_5lgg7_89", Ke = {
|
|
@@ -7520,7 +7527,7 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
7520
7527
|
disabled: n = !1,
|
|
7521
7528
|
placeholder: t = "Send a message..."
|
|
7522
7529
|
}) => {
|
|
7523
|
-
const [r, i] = he(""), o =
|
|
7530
|
+
const [r, i] = he(""), o = Ce(null), l = ge(() => {
|
|
7524
7531
|
const s = o.current;
|
|
7525
7532
|
s && (s.style.height = "auto", s.style.height = `${Math.min(s.scrollHeight, 150)}px`);
|
|
7526
7533
|
}, []);
|
|
@@ -7655,11 +7662,11 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
7655
7662
|
/* @__PURE__ */ x("span", { className: cn.text, children: "Brainbase Labs" })
|
|
7656
7663
|
]
|
|
7657
7664
|
}
|
|
7658
|
-
) : null, Eu = "
|
|
7665
|
+
) : null, Eu = "_container_tgamx_1", vu = "_body_tgamx_27", Tu = "_confirmationOverlay_tgamx_38", Lu = "_confirmationDialog_tgamx_59", Nu = "_confirmationText_tgamx_81", Pu = "_confirmationButtons_tgamx_89", Au = "_cancelButton_tgamx_94", zu = "_confirmButton_tgamx_95", Ee = {
|
|
7659
7666
|
container: Eu,
|
|
7660
7667
|
body: vu,
|
|
7661
|
-
confirmationOverlay:
|
|
7662
|
-
confirmationDialog:
|
|
7668
|
+
confirmationOverlay: Tu,
|
|
7669
|
+
confirmationDialog: Lu,
|
|
7663
7670
|
confirmationText: Nu,
|
|
7664
7671
|
confirmationButtons: Pu,
|
|
7665
7672
|
cancelButton: Au,
|
|
@@ -7681,7 +7688,7 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
7681
7688
|
}, m = () => {
|
|
7682
7689
|
c(!1);
|
|
7683
7690
|
};
|
|
7684
|
-
return /* @__PURE__ */ H("div", { className:
|
|
7691
|
+
return /* @__PURE__ */ H("div", { className: Ee.container, role: "dialog", "aria-label": "Chat window", children: [
|
|
7685
7692
|
/* @__PURE__ */ x(
|
|
7686
7693
|
ui,
|
|
7687
7694
|
{
|
|
@@ -7695,7 +7702,7 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
7695
7702
|
compact: s
|
|
7696
7703
|
}
|
|
7697
7704
|
),
|
|
7698
|
-
/* @__PURE__ */ H("div", { className:
|
|
7705
|
+
/* @__PURE__ */ H("div", { className: Ee.body, children: [
|
|
7699
7706
|
/* @__PURE__ */ x(
|
|
7700
7707
|
fu,
|
|
7701
7708
|
{
|
|
@@ -7716,13 +7723,13 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
7716
7723
|
)
|
|
7717
7724
|
] }),
|
|
7718
7725
|
/* @__PURE__ */ x(Iu, { showBranding: ((h = e.styling) == null ? void 0 : h.showBranding) ?? !0 }),
|
|
7719
|
-
a && /* @__PURE__ */ x("div", { className:
|
|
7720
|
-
/* @__PURE__ */ x("p", { className:
|
|
7721
|
-
/* @__PURE__ */ H("div", { className:
|
|
7726
|
+
a && /* @__PURE__ */ x("div", { className: Ee.confirmationOverlay, children: /* @__PURE__ */ H("div", { className: Ee.confirmationDialog, children: [
|
|
7727
|
+
/* @__PURE__ */ x("p", { className: Ee.confirmationText, children: "End current chat and start a new conversation?" }),
|
|
7728
|
+
/* @__PURE__ */ H("div", { className: Ee.confirmationButtons, children: [
|
|
7722
7729
|
/* @__PURE__ */ x(
|
|
7723
7730
|
"button",
|
|
7724
7731
|
{
|
|
7725
|
-
className:
|
|
7732
|
+
className: Ee.cancelButton,
|
|
7726
7733
|
onClick: m,
|
|
7727
7734
|
type: "button",
|
|
7728
7735
|
children: "Cancel"
|
|
@@ -7731,7 +7738,7 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
7731
7738
|
/* @__PURE__ */ x(
|
|
7732
7739
|
"button",
|
|
7733
7740
|
{
|
|
7734
|
-
className:
|
|
7741
|
+
className: Ee.confirmButton,
|
|
7735
7742
|
onClick: p,
|
|
7736
7743
|
type: "button",
|
|
7737
7744
|
children: "End Chat"
|
|
@@ -7740,11 +7747,11 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
7740
7747
|
] })
|
|
7741
7748
|
] }) })
|
|
7742
7749
|
] });
|
|
7743
|
-
}, Du = "_toggleButton_11dqz_1", Bu = "_icon_11dqz_31", Ou = "_agentLogo_11dqz_36",
|
|
7750
|
+
}, Du = "_toggleButton_11dqz_1", Bu = "_icon_11dqz_31", Ou = "_agentLogo_11dqz_36", Ru = "_unreadBadge_11dqz_43", pn = {
|
|
7744
7751
|
toggleButton: Du,
|
|
7745
7752
|
icon: Bu,
|
|
7746
7753
|
agentLogo: Ou,
|
|
7747
|
-
unreadBadge:
|
|
7754
|
+
unreadBadge: Ru
|
|
7748
7755
|
}, Xt = ({
|
|
7749
7756
|
onClick: e,
|
|
7750
7757
|
agentLogoUrl: n,
|
|
@@ -7779,8 +7786,8 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
7779
7786
|
t > 0 && /* @__PURE__ */ x("span", { className: pn.unreadBadge, children: t > 9 ? "9+" : t })
|
|
7780
7787
|
]
|
|
7781
7788
|
}
|
|
7782
|
-
),
|
|
7783
|
-
container:
|
|
7789
|
+
), Fu = "_container_kgfgt_1", ju = "_header_kgfgt_25", $u = "_logoWrapper_kgfgt_38", Hu = "_logo_kgfgt_38", Vu = "_closeButton_kgfgt_51", Uu = "_content_kgfgt_74", qu = "_iconWrapper_kgfgt_84", Wu = "_errorIcon_kgfgt_95", Yu = "_title_kgfgt_101", Xu = "_description_kgfgt_109", Ku = "_retryButton_kgfgt_117", Qu = "_footer_kgfgt_139", Zu = "_poweredBy_kgfgt_146", Ju = "_footerLogo_kgfgt_160", ne = {
|
|
7790
|
+
container: Fu,
|
|
7784
7791
|
header: ju,
|
|
7785
7792
|
logoWrapper: $u,
|
|
7786
7793
|
logo: Hu,
|
|
@@ -7949,15 +7956,15 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
7949
7956
|
onMessage: _,
|
|
7950
7957
|
onError: I
|
|
7951
7958
|
}) => {
|
|
7952
|
-
const [E, b] = he(o), [P, v] = he(null), [
|
|
7959
|
+
const [E, b] = he(o), [P, v] = he(null), [R, V] = he(!0), [k, B] = he(null), [U, F] = he(), j = Ce(!1), N = xn(() => t ? Yr({}, r) : Ur(n), [t, r, n]), C = ge(async () => {
|
|
7953
7960
|
if (!(j.current && P)) {
|
|
7954
|
-
V(!0), B(null),
|
|
7961
|
+
V(!0), B(null), F(void 0);
|
|
7955
7962
|
try {
|
|
7956
7963
|
const f = await N.getDeploymentConfig(e);
|
|
7957
7964
|
v(f), j.current = !0;
|
|
7958
7965
|
} catch (f) {
|
|
7959
7966
|
const J = f instanceof Error ? f : new Error("Failed to load config");
|
|
7960
|
-
J.message.includes("404") ? (B("not_found"),
|
|
7967
|
+
J.message.includes("404") ? (B("not_found"), F("The chat widget with this embed ID was not found.")) : J.message.includes("Failed to fetch") || J.message.includes("network") ? B("network") : B("unknown"), t && (v({
|
|
7961
7968
|
embedId: e,
|
|
7962
7969
|
deploymentId: "mock-deployment",
|
|
7963
7970
|
workerId: "mock-worker",
|
|
@@ -7993,7 +8000,7 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
7993
8000
|
...u !== void 0 ? { showBranding: u } : {}
|
|
7994
8001
|
}
|
|
7995
8002
|
};
|
|
7996
|
-
}, [P, e, l, a, c, s, u]),
|
|
8003
|
+
}, [P, e, l, a, c, s, u]), T = Vr({
|
|
7997
8004
|
config: z,
|
|
7998
8005
|
apiClient: N,
|
|
7999
8006
|
mockMode: t,
|
|
@@ -8007,13 +8014,13 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
8007
8014
|
}),
|
|
8008
8015
|
[z.primaryColor]
|
|
8009
8016
|
), A = () => {
|
|
8010
|
-
|
|
8011
|
-
},
|
|
8017
|
+
T.endSession(), T.startNewSession();
|
|
8018
|
+
}, L = () => {
|
|
8012
8019
|
b(!1);
|
|
8013
8020
|
}, q = () => {
|
|
8014
8021
|
C();
|
|
8015
8022
|
}, Q = i === "inline";
|
|
8016
|
-
return
|
|
8023
|
+
return R ? null : k && !t ? !Q && !E ? /* @__PURE__ */ x(
|
|
8017
8024
|
"div",
|
|
8018
8025
|
{
|
|
8019
8026
|
className: `${Be.widget} ${Be[i]} ${p ?? ""}`,
|
|
@@ -8037,7 +8044,7 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
8037
8044
|
errorType: k,
|
|
8038
8045
|
message: U,
|
|
8039
8046
|
onRetry: q,
|
|
8040
|
-
onClose: Q ? void 0 :
|
|
8047
|
+
onClose: Q ? void 0 : L
|
|
8041
8048
|
}
|
|
8042
8049
|
)
|
|
8043
8050
|
}
|
|
@@ -8050,10 +8057,10 @@ const Ps = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
|
|
|
8050
8057
|
Mu,
|
|
8051
8058
|
{
|
|
8052
8059
|
config: z,
|
|
8053
|
-
messages:
|
|
8054
|
-
isLoading:
|
|
8055
|
-
onSendMessage:
|
|
8056
|
-
onClose: Q ? void 0 :
|
|
8060
|
+
messages: T.messages,
|
|
8061
|
+
isLoading: T.isLoading,
|
|
8062
|
+
onSendMessage: T.sendMessage,
|
|
8063
|
+
onClose: Q ? void 0 : L,
|
|
8057
8064
|
onNewChat: A
|
|
8058
8065
|
}
|
|
8059
8066
|
) : /* @__PURE__ */ x(
|