@8wave/ai-elements 0.121.0-beta.5 → 0.121.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{Agent-BYC51e6E.js → Agent-7rbrjWzu.js} +64 -58
- package/dist/_chunks/Agent-7rbrjWzu.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-CNoHyTuC.js → PkStreamingMarkdown-BnClGp-3.js} +826 -831
- package/dist/_chunks/PkStreamingMarkdown-BnClGp-3.js.map +1 -0
- package/dist/_chunks/{PkToolEditSpreadsheet-B8bO3vZa.js → PkToolEditSpreadsheet-D4M6BUKx.js} +2 -2
- package/dist/_chunks/{PkToolEditSpreadsheet-B8bO3vZa.js.map → PkToolEditSpreadsheet-D4M6BUKx.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-DrvL0h9d.js → PkToolRequestGeolocation-DmOoFghZ.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-DrvL0h9d.js.map → PkToolRequestGeolocation-DmOoFghZ.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-BXti5Vkt.js → PkToolRequestOAuthConnection-DV0sfojC.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-BXti5Vkt.js.map → PkToolRequestOAuthConnection-DV0sfojC.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-DR71LNck.js → PkToolShowArtifact-V0a8zhdO.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-DR71LNck.js.map → PkToolShowArtifact-V0a8zhdO.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-C4BshHSs.js → PkToolShowContactForm-sLhBxf9e.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-C4BshHSs.js.map → PkToolShowContactForm-sLhBxf9e.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-BLSTn0xE.js → PkToolShowForm-Dl2k9jqk.js} +3 -3
- package/dist/_chunks/{PkToolShowForm-BLSTn0xE.js.map → PkToolShowForm-Dl2k9jqk.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-CqOXbo0Y.js → PkToolShowImageGallery-CTsq_DPb.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-CqOXbo0Y.js.map → PkToolShowImageGallery-CTsq_DPb.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-westY5bY.js → PkToolShowProductList-CpdKWQkP.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-westY5bY.js.map → PkToolShowProductList-CpdKWQkP.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-Dy9VXRgv.js → PkToolShowSources-WFm2JF0r.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-Dy9VXRgv.js.map → PkToolShowSources-WFm2JF0r.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-BZ2U3ULB.js → PkToolShowSuggestedReply-RcL_3RAz.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-BZ2U3ULB.js.map → PkToolShowSuggestedReply-RcL_3RAz.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-CrFaQbMp.js → PkToolShowVideo-Ua5heyl1.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-CrFaQbMp.js.map → PkToolShowVideo-Ua5heyl1.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-DXszshY9.js → PkToolShowWebPages-STOCnsKm.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-DXszshY9.js.map → PkToolShowWebPages-STOCnsKm.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-B5-QV037.js → chatImagePolicy-C8X_GMnS.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-B5-QV037.js.map → chatImagePolicy-C8X_GMnS.js.map} +1 -1
- package/dist/_chunks/{markdown-DO_FLvlJ.js → markdown-EqEd3eyd.js} +10 -10
- package/dist/_chunks/{markdown-DO_FLvlJ.js.map → markdown-EqEd3eyd.js.map} +1 -1
- package/dist/ai-elements.es.js +1572 -1572
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{Agent-2DVqpLwz.js → Agent-SH2vEFKs.js} +63 -57
- package/dist-vue/_chunks/Agent-SH2vEFKs.js.map +1 -0
- package/dist-vue/_chunks/{Document-ChfbOVVs.js → Document-fmCxsccF.js} +10 -10
- package/dist-vue/_chunks/{Document-ChfbOVVs.js.map → Document-fmCxsccF.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-DsZ8mAbt.js → PkChatbot-DlIEIjKJ.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-DsZ8mAbt.js.map → PkChatbot-DlIEIjKJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-DqzgF4vH.js → PkChatbotEmptyState-Bcozn56E.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-DqzgF4vH.js.map → PkChatbotEmptyState-Bcozn56E.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-BRhIG8HR.js → PkChatbotInput-DQVpDLNp.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-BRhIG8HR.js.map → PkChatbotInput-DQVpDLNp.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-WryjcyH7.js → PkChatbotMessages-BYFozlwC.js} +17 -17
- package/dist-vue/_chunks/{PkChatbotMessages-WryjcyH7.js.map → PkChatbotMessages-BYFozlwC.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-Bga_HEps.js → PkChatbotStepPayload-DjntsSlX.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-Bga_HEps.js.map → PkChatbotStepPayload-DjntsSlX.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-YbUYP-Y3.js → PkChatbotStepToolDetail-If9goNdY.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-YbUYP-Y3.js.map → PkChatbotStepToolDetail-If9goNdY.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-CVAkaIzk.js → PkChatbotSteps-DUFfniZn.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-CVAkaIzk.js.map → PkChatbotSteps-DUFfniZn.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-B1gbdvs1.js → PkChatbotViewChat-BGoltDr9.js} +7 -7
- package/dist-vue/_chunks/{PkChatbotViewChat-B1gbdvs1.js.map → PkChatbotViewChat-BGoltDr9.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-BHvHF0w7.js → PkChatbotViewConversations-WUpRm6GG.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-BHvHF0w7.js.map → PkChatbotViewConversations-WUpRm6GG.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-C-4__qj_.js → PkChatbotViewFiles-CpG_LRg6.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-C-4__qj_.js.map → PkChatbotViewFiles-CpG_LRg6.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-_WMSVDlA.js → PkChatbotViewProfile-DetQJa7E.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-_WMSVDlA.js.map → PkChatbotViewProfile-DetQJa7E.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-6Y7qgbvS.js → PkStreamingMarkdown-DLKEIMcZ.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-6Y7qgbvS.js.map → PkStreamingMarkdown-DLKEIMcZ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-BTauPyXT.js → PkToolEditSpreadsheet-D2JtjXef.js} +2 -2
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-BTauPyXT.js.map → PkToolEditSpreadsheet-D2JtjXef.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DBzup6bn.js → PkToolRequestGeolocation--MTT__Vu.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DBzup6bn.js.map → PkToolRequestGeolocation--MTT__Vu.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-yrRDpNqp.js → PkToolRequestOAuthConnection-Gb_qfvlN.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-yrRDpNqp.js.map → PkToolRequestOAuthConnection-Gb_qfvlN.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-fp37O1om.js → PkToolShowArtifact-BWVntj9H.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-fp37O1om.js.map → PkToolShowArtifact-BWVntj9H.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-iSx2ioyT.js → PkToolShowContactForm-BbBt3ha0.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-iSx2ioyT.js.map → PkToolShowContactForm-BbBt3ha0.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-BlKrh4gK.js → PkToolShowDiagram-CE6KHz1M.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-BlKrh4gK.js.map → PkToolShowDiagram-CE6KHz1M.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-CwlXH13N.js → PkToolShowForm-CNm8HSUW.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-CwlXH13N.js.map → PkToolShowForm-CNm8HSUW.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-C4esYiM_.js → PkToolShowImageGallery-6k3ituoi.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-C4esYiM_.js.map → PkToolShowImageGallery-6k3ituoi.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-CdeYQ-mF.js → PkToolShowProductList-Bu-pUg5d.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-CdeYQ-mF.js.map → PkToolShowProductList-Bu-pUg5d.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-D8IF7g0d.js → PkToolShowSources-DTWNZqWu.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-D8IF7g0d.js.map → PkToolShowSources-DTWNZqWu.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DXyO8ki2.js → PkToolShowSuggestedReply-DSXhqWhx.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DXyO8ki2.js.map → PkToolShowSuggestedReply-DSXhqWhx.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-CA7MNSp_.js → PkToolShowVideo-C0ycBiOI.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-CA7MNSp_.js.map → PkToolShowVideo-C0ycBiOI.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-CKWnAbp8.js → PkToolShowWebPages-CWWv1tr5.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-CKWnAbp8.js.map → PkToolShowWebPages-CWWv1tr5.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-DecVahlB.js → createChatbotApiClient-MbfcTdwY.js} +16 -16
- package/dist-vue/_chunks/{createChatbotApiClient-DecVahlB.js.map → createChatbotApiClient-MbfcTdwY.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-BQTq8fq-.js → useChatbotStore-DDSgrRzg.js} +1143 -1143
- package/dist-vue/_chunks/{useChatbotStore-BQTq8fq-.js.map → useChatbotStore-DDSgrRzg.js.map} +1 -1
- package/dist-vue/_chunks/{utils-BLMOBcka.js → utils-B9-Vt10H.js} +35 -40
- package/dist-vue/_chunks/utils-B9-Vt10H.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +6 -6
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +4235 -4227
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +8 -2
- package/dist-vue/packages/components/src/chat/PkWebSearchSettings.d.ts +2 -0
- package/dist-vue/packages/models/src/schema/Agent.d.ts +14 -0
- package/package.json +1 -1
- package/dist/_chunks/Agent-BYC51e6E.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown-CNoHyTuC.js.map +0 -1
- package/dist-vue/_chunks/Agent-2DVqpLwz.js.map +0 -1
- package/dist-vue/_chunks/utils-BLMOBcka.js.map +0 -1
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import { F as e, I as t, P as n, R as r, Y as i, Z as a, at as o, h as s, k as c, w as l, y as u, yt as d } from "./vue.runtime.esm-bundler-BkvITeKg.js";
|
|
2
2
|
import { r as f } from "./vue-i18n-BoTyYk8j.js";
|
|
3
3
|
import { n as p, t as ee } from "./cdn-css-JUUNhyQ6.js";
|
|
4
|
-
import {
|
|
4
|
+
import { N as m, _ as te, f as ne, g as re, t as ie, u as ae } from "./Agent-7rbrjWzu.js";
|
|
5
5
|
import "./src-Ra4oUpUU.js";
|
|
6
|
-
import { n as h, t as
|
|
7
|
-
import { n as
|
|
8
|
-
import { b as
|
|
9
|
-
import { n as
|
|
10
|
-
import { t as
|
|
11
|
-
import { n as
|
|
6
|
+
import { n as h, t as oe } from "./text-BHCGblDQ.js";
|
|
7
|
+
import { n as g } from "./url-validation-9DstIfq2.js";
|
|
8
|
+
import { b as se } from "./dist---RigjU4.js";
|
|
9
|
+
import { n as ce } from "./useShortUrlResolver-BGoPo6JO.js";
|
|
10
|
+
import { t as le } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
11
|
+
import { n as _ } from "./chatImagePolicy-C8X_GMnS.js";
|
|
12
12
|
//#region ../../packages/utils/src/citations.ts
|
|
13
|
-
var v = /[ \t]*\uE200[^\uE201]*\uE201/g,
|
|
14
|
-
function
|
|
15
|
-
return e && e.replace(v, "").replace(
|
|
13
|
+
var v = /[ \t]*\uE200[^\uE201]*\uE201/g, ue = /(?<![ \t])[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, de = /[\uE200-\uE20F]/g;
|
|
14
|
+
function fe(e) {
|
|
15
|
+
return e && e.replace(v, "").replace(ue, "").replace(de, "");
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region ../../packages/utils/src/message.ts
|
|
19
|
-
function
|
|
19
|
+
function pe(e) {
|
|
20
20
|
return e ? e.type === "text" : !1;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function y(e) {
|
|
23
23
|
return e ? e.type.startsWith("tool-") : !1;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return
|
|
25
|
+
function me(e) {
|
|
26
|
+
return y(e) ? e.type.slice(5) : "";
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function b(e) {
|
|
29
29
|
return e ? e.type === "file" : !1;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
if (!
|
|
31
|
+
function he(e) {
|
|
32
|
+
if (!b(e)) return;
|
|
33
33
|
let t = e.providerMetadata?.["8bot"]?.media;
|
|
34
34
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
if (!
|
|
36
|
+
function ge(e) {
|
|
37
|
+
if (!b(e)) return;
|
|
38
38
|
let t = e.providerMetadata?.["8bot"]?.transcript;
|
|
39
39
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function _e(e, t) {
|
|
42
42
|
return e.map((e) => {
|
|
43
43
|
let n = t.filter((t) => t.messageId === e.id);
|
|
44
44
|
return n.length === 0 ? e : {
|
|
45
45
|
...e,
|
|
46
46
|
parts: e.parts.map((e) => {
|
|
47
|
-
let t = n.find(({ storedFileName: t }) => t ===
|
|
48
|
-
return t &&
|
|
47
|
+
let t = n.find(({ storedFileName: t }) => t === he(e)?.storedFileName);
|
|
48
|
+
return t && b(e) ? {
|
|
49
49
|
...e,
|
|
50
50
|
providerMetadata: {
|
|
51
51
|
...e.providerMetadata,
|
|
@@ -59,53 +59,53 @@ function pe(e, t) {
|
|
|
59
59
|
};
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function ve(e) {
|
|
63
63
|
return e ? e.type === "reasoning" : !1;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return e ? e.parts.some((e) =>
|
|
65
|
+
function ye(e) {
|
|
66
|
+
return e ? e.parts.some((e) => pe(e)) : !1;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function be(e) {
|
|
69
69
|
if (!e) return;
|
|
70
70
|
let t = e.parts;
|
|
71
|
-
if (Array.isArray(t)) return t.find((e) =>
|
|
71
|
+
if (Array.isArray(t)) return t.find((e) => pe(e))?.text;
|
|
72
72
|
}
|
|
73
73
|
//#endregion
|
|
74
74
|
//#region ../../packages/components/src/chat/utils.ts
|
|
75
|
-
function
|
|
75
|
+
function x(e) {
|
|
76
76
|
let t = [];
|
|
77
77
|
for (let n of e) {
|
|
78
|
-
if (!
|
|
78
|
+
if (!pe(n)) {
|
|
79
79
|
t.push(n);
|
|
80
80
|
continue;
|
|
81
81
|
}
|
|
82
82
|
let e = t[t.length - 1];
|
|
83
|
-
e &&
|
|
83
|
+
e && pe(e) ? t[t.length - 1] = {
|
|
84
84
|
...e,
|
|
85
85
|
text: e.text + n.text
|
|
86
86
|
} : t.push(n);
|
|
87
87
|
}
|
|
88
88
|
return t;
|
|
89
89
|
}
|
|
90
|
-
var
|
|
91
|
-
function
|
|
90
|
+
var xe = (e) => y(e) && te(me(e));
|
|
91
|
+
function Se(e) {
|
|
92
92
|
let t = /* @__PURE__ */ new Map();
|
|
93
|
-
for (let [n, r] of e.entries())
|
|
94
|
-
return e.filter((e, n) => !(
|
|
93
|
+
for (let [n, r] of e.entries()) xe(r) && r.state !== "output-error" && !ke(r) && t.set(r.type, n);
|
|
94
|
+
return e.filter((e, n) => !(xe(e) && e.state === "output-error" && (t.get(e.type) ?? -1) > n));
|
|
95
95
|
}
|
|
96
|
-
var
|
|
97
|
-
function
|
|
98
|
-
let t = e.filter((e) =>
|
|
99
|
-
return t.length > 0 ? [...e.filter((e) => !
|
|
96
|
+
var Ce = /* @__PURE__ */ new Set(["tool-editSpreadsheet"]);
|
|
97
|
+
function we(e) {
|
|
98
|
+
let t = e.filter((e) => Ce.has(e.type));
|
|
99
|
+
return t.length > 0 ? [...e.filter((e) => !Ce.has(e.type)), ...t] : e;
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function Te(e, t) {
|
|
102
102
|
let n = e.toolCallId;
|
|
103
|
-
return
|
|
103
|
+
return Ce.has(e.type) && n ? `file-${n}` : t;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function S(e) {
|
|
106
106
|
return m(e) ? e : void 0;
|
|
107
107
|
}
|
|
108
|
-
var
|
|
108
|
+
var Ee = {
|
|
109
109
|
page_snapshot: {
|
|
110
110
|
icon: "ri:pages-line",
|
|
111
111
|
label: "messagePart.pageTool.snapshot"
|
|
@@ -126,21 +126,21 @@ var Ce = {
|
|
|
126
126
|
icon: "ri:arrow-up-down-line",
|
|
127
127
|
label: "messagePart.pageTool.scroll"
|
|
128
128
|
}
|
|
129
|
-
},
|
|
129
|
+
}, De = {
|
|
130
130
|
icon: "ri:survey-line",
|
|
131
131
|
label: "messagePart.pageTool.form"
|
|
132
|
-
},
|
|
133
|
-
function
|
|
134
|
-
return
|
|
132
|
+
}, Oe = (e) => e.toolMetadata?.provider === "page" ? Ee[e.toolName] ?? (e.toolName.startsWith("form_") ? De : void 0) : void 0;
|
|
133
|
+
function C(e) {
|
|
134
|
+
return S(e)?.toolMetadata?.readOnly === !1;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function ke(e) {
|
|
137
137
|
return e && "state" in e ? e.state === "streaming" || e.state === "input-streaming" : !1;
|
|
138
138
|
}
|
|
139
|
-
var
|
|
140
|
-
function
|
|
139
|
+
var w = 4e3, Ae = /^[ \t]*(?:(?:[-*+]|\d{1,9}[.)])[ \t]+|>[ \t]?)*(`{3,}|~{3,})(.*)$/gm;
|
|
140
|
+
function T(e, t) {
|
|
141
141
|
if (e.length <= t) return e;
|
|
142
142
|
let n = e.length - t, r = n + t / 2, i = (e, t) => e !== -1 && e < r ? e + t : void 0, a = i(e.indexOf("\n\n", n), 2) ?? i(e.indexOf("\n", n), 1) ?? n, o;
|
|
143
|
-
for (let t of e.matchAll(
|
|
143
|
+
for (let t of e.matchAll(Ae)) {
|
|
144
144
|
if (t.index >= a) break;
|
|
145
145
|
let [, e, n] = t;
|
|
146
146
|
if (o) e[0] === o[0] && e.length >= o.length && !n.trim() && (o = void 0);
|
|
@@ -151,37 +151,37 @@ function Oe(e, t) {
|
|
|
151
151
|
}
|
|
152
152
|
return `…\n\n${o ? `${o}\n` : ""}${e.slice(a)}`;
|
|
153
153
|
}
|
|
154
|
-
var
|
|
154
|
+
var je = /* @__PURE__ */ new Set([
|
|
155
155
|
"approval-requested",
|
|
156
156
|
"approval-responded",
|
|
157
157
|
"output-denied"
|
|
158
158
|
]);
|
|
159
|
-
function
|
|
160
|
-
return
|
|
159
|
+
function Me(e) {
|
|
160
|
+
return y(e) ? je.has(e.state) ? !0 : e.approval != null : !1;
|
|
161
161
|
}
|
|
162
|
-
var
|
|
163
|
-
function
|
|
164
|
-
return
|
|
162
|
+
var Ne = "requestConfirm";
|
|
163
|
+
function Pe(e) {
|
|
164
|
+
return y(e) && e.type === "tool-requestConfirm";
|
|
165
165
|
}
|
|
166
|
-
function
|
|
167
|
-
return
|
|
166
|
+
function Fe(e) {
|
|
167
|
+
return Me(e) || Pe(e);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
170
|
-
if (
|
|
169
|
+
function Ie(e) {
|
|
170
|
+
if (y(e)) return e.approval?.id;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function Le(e) {
|
|
173
173
|
if (e && "state" in e) return e.state;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function E(e = "000000") {
|
|
176
176
|
let t = e.replace("#", "");
|
|
177
177
|
t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
|
|
178
178
|
let n = parseInt(t.substring(0, 2), 16) / 255, r = parseInt(t.substring(2, 4), 16) / 255, i = parseInt(t.substring(4, 6), 16) / 255, a = (e) => e <= .03928 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
179
179
|
return .2126 * a(n) + .7152 * a(r) + .0722 * a(i) > .179 ? "black" : "white";
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
return e === "white" || e === "black" ? e :
|
|
181
|
+
function Re(e, t) {
|
|
182
|
+
return e === "white" || e === "black" ? e : E(t);
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function ze(e, t) {
|
|
185
185
|
if (e) return {
|
|
186
186
|
"--chatbot-main-color": e,
|
|
187
187
|
"--chatbot-contrast-color": t,
|
|
@@ -190,10 +190,10 @@ function Ie(e, t) {
|
|
|
190
190
|
"--input-focus-color": "var(--color-brand-graphic)"
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function Be(e, t) {
|
|
194
194
|
if (!(t === void 0 || t < 50)) return e(t / 1e3, "seconds");
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function Ve(e) {
|
|
197
197
|
if (e !== void 0) {
|
|
198
198
|
if (typeof e == "string") return e.trim() || void 0;
|
|
199
199
|
try {
|
|
@@ -204,10 +204,10 @@ function Re(e) {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
return
|
|
207
|
+
function He(e) {
|
|
208
|
+
return Ve(e) !== void 0;
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function Ue(e, t) {
|
|
211
211
|
let n = e?.input;
|
|
212
212
|
if (typeof t == "string") {
|
|
213
213
|
let e = n?.question ?? n?.steps?.[0]?.question;
|
|
@@ -219,14 +219,14 @@ function Be(e, t) {
|
|
|
219
219
|
return i ? `${i} ${n}` : n;
|
|
220
220
|
}).join(". ");
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function We(e) {
|
|
223
223
|
return e?.options ? e.options.map((e) => ({
|
|
224
224
|
label: e.label,
|
|
225
225
|
value: e.label,
|
|
226
226
|
description: e.description
|
|
227
227
|
})) : [];
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function Ge(e, t) {
|
|
230
230
|
let n = {};
|
|
231
231
|
if (t == null) return n;
|
|
232
232
|
if (typeof t == "string") return e.length === 1 && (n[0] = t), n;
|
|
@@ -242,12 +242,7 @@ function He(e, t) {
|
|
|
242
242
|
for (let [e, n] of Object.entries(t)) n !== void 0 && r(e, n);
|
|
243
243
|
return n;
|
|
244
244
|
}
|
|
245
|
-
var
|
|
246
|
-
"tool-perplexity_search",
|
|
247
|
-
"tool-parallel_search",
|
|
248
|
-
"tool-web_search",
|
|
249
|
-
"tool-google_search"
|
|
250
|
-
], We = /* @__PURE__ */ new Set([
|
|
245
|
+
var Ke = re.map((e) => `tool-${e}`), qe = /* @__PURE__ */ new Set([
|
|
251
246
|
"tool-searchInKnowledgeBase",
|
|
252
247
|
"tool-retrieveRevisedAnswers",
|
|
253
248
|
"tool-expandChunkContext",
|
|
@@ -256,60 +251,60 @@ var Ue = [
|
|
|
256
251
|
"tool-geocode",
|
|
257
252
|
"tool-recallUserMemory",
|
|
258
253
|
"tool-saveUserMemory",
|
|
259
|
-
...
|
|
254
|
+
...Ke
|
|
260
255
|
]);
|
|
261
|
-
function
|
|
262
|
-
return
|
|
256
|
+
function Je(e) {
|
|
257
|
+
return y(e) && qe.has(e.type);
|
|
263
258
|
}
|
|
264
|
-
var
|
|
259
|
+
var Ye = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, D = (e, ...t) => {
|
|
265
260
|
for (let n of t) {
|
|
266
261
|
let t = e?.[n];
|
|
267
262
|
if (typeof t == "string" && t.trim()) return t;
|
|
268
263
|
}
|
|
269
264
|
};
|
|
270
|
-
function
|
|
271
|
-
if (!
|
|
272
|
-
let t =
|
|
273
|
-
if (e.type === "tool-searchInKnowledgeBase" ||
|
|
265
|
+
function Xe(e) {
|
|
266
|
+
if (!y(e)) return;
|
|
267
|
+
let t = Ye("input" in e ? e.input : void 0), n = Ye("output" in e ? e.output : void 0);
|
|
268
|
+
if (e.type === "tool-searchInKnowledgeBase" || Ke.includes(e.type)) {
|
|
274
269
|
let e = t?.queries;
|
|
275
270
|
if (Array.isArray(e)) {
|
|
276
271
|
let t = e.filter((e) => typeof e == "string" && !!e.trim());
|
|
277
272
|
return t.length ? t.join(" · ") : void 0;
|
|
278
273
|
}
|
|
279
|
-
return
|
|
274
|
+
return D(t, "query", "objective");
|
|
280
275
|
}
|
|
281
|
-
if (e.type === "tool-retrieveRevisedAnswers") return
|
|
282
|
-
if (e.type === "tool-getWeather") return
|
|
283
|
-
if (e.type === "tool-geocode") return
|
|
284
|
-
if (e.type === "tool-expandChunkContext") return
|
|
285
|
-
if (e.type === "tool-readDocumentFile" || e.type === "tool-readChatAttachment") return
|
|
276
|
+
if (e.type === "tool-retrieveRevisedAnswers") return D(t, "query");
|
|
277
|
+
if (e.type === "tool-getWeather") return D(n, "location") ?? D(t, "locationName");
|
|
278
|
+
if (e.type === "tool-geocode") return D(t, "locationName");
|
|
279
|
+
if (e.type === "tool-expandChunkContext") return D(n, "documentName");
|
|
280
|
+
if (e.type === "tool-readDocumentFile" || e.type === "tool-readChatAttachment") return D(n, "name");
|
|
286
281
|
if (e.type === "tool-readSpreadsheet") {
|
|
287
|
-
let e =
|
|
282
|
+
let e = D(t, "sheet"), n = D(t, "range");
|
|
288
283
|
return e && n ? `${e}!${n}` : e;
|
|
289
284
|
}
|
|
290
|
-
if (e.type === "tool-editSpreadsheet") return
|
|
291
|
-
if (e.type === "tool-querySpreadsheet") return
|
|
292
|
-
if (e.type === "tool-recallUserMemory") return
|
|
293
|
-
if (e.type === "tool-saveUserMemory") return
|
|
285
|
+
if (e.type === "tool-editSpreadsheet") return D(n, "filename");
|
|
286
|
+
if (e.type === "tool-querySpreadsheet") return D(n, "file");
|
|
287
|
+
if (e.type === "tool-recallUserMemory") return D(t, "query");
|
|
288
|
+
if (e.type === "tool-saveUserMemory") return D(t, "content", "query");
|
|
294
289
|
}
|
|
295
|
-
function
|
|
296
|
-
let t =
|
|
297
|
-
if (t) return
|
|
298
|
-
if (
|
|
299
|
-
if (
|
|
300
|
-
if (
|
|
301
|
-
}
|
|
302
|
-
var
|
|
303
|
-
re,
|
|
290
|
+
function Ze(e) {
|
|
291
|
+
let t = S(e);
|
|
292
|
+
if (t) return Oe(t)?.icon ?? "ri:apps-line";
|
|
293
|
+
if (y(e)) return e.type.includes("tool-subagent") ? "ri:robot-2-line" : e.type === "tool-runWorker" ? "ri:flow-chart" : e.type === "tool-scheduleWakeup" ? "ri:alarm-line" : e.type === "tool-fetchTeamsChannelHistory" ? "ri:chat-history-line" : e.type === "tool-readEarlierMessages" ? "ri:history-line" : e.type === "tool-readChatAttachment" ? "ri:attachment-line" : e.type === "tool-enableTools" ? "ri:toggle-line" : e.type.includes("tool-mcp") ? "mcp" : e.type === "tool-retrieveRevisedAnswers" ? "ri:file-edit-line" : e.type === "tool-searchInKnowledgeBase" ? "ri:search-line" : e.type === "tool-expandChunkContext" ? "ri:file-search-line" : e.type === "tool-readDocumentFile" ? "ri:file-text-line" : e.type === "tool-readSpreadsheet" ? "ri:table-line" : e.type === "tool-editSpreadsheet" ? "ri:file-excel-2-line" : e.type === "tool-querySpreadsheet" ? "ri:database-2-line" : e.type === "tool-geocode" ? "ri:map-2-line" : e.type === "tool-getWeather" ? "ri:sun-cloudy-line" : e.type === "tool-recallUserMemory" ? "ri:brain-line" : e.type === "tool-saveUserMemory" ? "ri:save-3-line" : e.type === "tool-showWeather" ? "ri:sun-line" : e.type === "tool-showDiagram" ? "ri:flow-chart" : e.type === "tool-showSources" ? "ri:book-2-line" : e.type === "tool-showForm" ? "ri:survey-line" : e.type === "tool-showMultipleChoice" ? "ri:checkbox-multiple-line" : e.type === "tool-showArtifact" ? "ri:file-code-line" : e.type === "tool-showEmail" ? "ri:mail-line" : e.type === "tool-showMessage" ? "ri:chat-1-line" : e.type === "tool-showWebPages" ? "ri:pages-line" : e.type === "tool-showProductList" ? "ri:shopping-bag-line" : e.type === "tool-showContactForm" ? "ri:send-plane-2-line" : e.type === "tool-showCalendarEvent" ? "ri:calendar-event-line" : e.type === "tool-showComparison" ? "ri:scales-line" : e.type === "tool-showLocation" ? "ri:map-pin-line" : e.type === "tool-showQrCode" ? "ri:qr-code-line" : e.type === "tool-showImageGallery" ? "ri:image-line" : e.type === "tool-showVideo" ? "ri:film-line" : e.type === "tool-showSuggestedReply" ? "ri:corner-down-right-line" : e.type === "tool-requestGeolocation" ? "ri:map-pin-user-line" : e.type === "tool-disconnectOAuthConnection" ? "ri:link-unlink" : e.type === "tool-requestAccountLink" ? "ri:link" : e.type === "tool-unlinkAccount" ? "ri:link-unlink" : Ke.includes(e.type) ? "ri:global-line" : "ri:tools-line";
|
|
294
|
+
if (ve(e)) return "ri:lightbulb-line";
|
|
295
|
+
if (pe(e)) return "ri:double-quotes-r";
|
|
296
|
+
}
|
|
297
|
+
var Qe = [
|
|
304
298
|
ie,
|
|
305
|
-
|
|
299
|
+
ae,
|
|
300
|
+
ne
|
|
306
301
|
];
|
|
307
|
-
function
|
|
302
|
+
function O(e, { t, te: n }) {
|
|
308
303
|
if (n(`agent.tool.${e}`)) return t(`agent.tool.${e}`);
|
|
309
|
-
let r =
|
|
310
|
-
return
|
|
304
|
+
let r = Qe.find((t) => e.startsWith(t)), i = r ? e.slice(r.length) : e;
|
|
305
|
+
return oe(h(i).trim().toLowerCase());
|
|
311
306
|
}
|
|
312
|
-
var
|
|
307
|
+
var $e = {
|
|
313
308
|
custom: (e) => e("messagePart.type.custom"),
|
|
314
309
|
data: (e) => e("messagePart.type.data"),
|
|
315
310
|
file: (e) => e("messagePart.type.file"),
|
|
@@ -319,13 +314,13 @@ var Ze = {
|
|
|
319
314
|
"step-start": (e) => e("messagePart.type.stepStart"),
|
|
320
315
|
text: (e) => e("messagePart.type.text")
|
|
321
316
|
};
|
|
322
|
-
function
|
|
323
|
-
if (
|
|
324
|
-
if (e.type === "dynamic-tool") return
|
|
325
|
-
let n =
|
|
326
|
-
return n ? n(t.t) :
|
|
317
|
+
function et(e, t) {
|
|
318
|
+
if (y(e)) return O(me(e), t);
|
|
319
|
+
if (e.type === "dynamic-tool") return O(e.toolName, t);
|
|
320
|
+
let n = $e[e.type.startsWith("data-") ? "data" : e.type];
|
|
321
|
+
return n ? n(t.t) : oe(h(e.type));
|
|
327
322
|
}
|
|
328
|
-
function
|
|
323
|
+
function tt(e, t) {
|
|
329
324
|
if (!e) return e;
|
|
330
325
|
let n = {
|
|
331
326
|
Intent: t("conversationSummary.intent"),
|
|
@@ -335,42 +330,42 @@ function $e(e, t) {
|
|
|
335
330
|
};
|
|
336
331
|
return e.replace(/\*\*(Intent|Topics covered|Key facts|Open questions)(:?)\*\*/g, (e, t, r) => `**${n[t]}${r}**`);
|
|
337
332
|
}
|
|
338
|
-
function
|
|
339
|
-
let n =
|
|
333
|
+
function nt(e, t) {
|
|
334
|
+
let n = S(t);
|
|
340
335
|
if (n) {
|
|
341
|
-
let t =
|
|
336
|
+
let t = Oe(n);
|
|
342
337
|
return t ? e(t.label) : n.title || n.toolName;
|
|
343
338
|
}
|
|
344
|
-
return
|
|
339
|
+
return y(t) ? t.type.includes("tool-subagent") ? e("messagePart.runSubagent") : t.type === "tool-runWorker" ? e("messagePart.runWorker") : t.type === "tool-scheduleWakeup" ? e("messagePart.scheduleWakeup") : t.type === "tool-fetchTeamsChannelHistory" ? e("messagePart.fetchTeamsChannelHistory") : t.type === "tool-readEarlierMessages" ? e("messagePart.readEarlierMessages") : t.type === "tool-readChatAttachment" ? e("messagePart.readChatAttachment") : t.type === "tool-enableTools" ? e("messagePart.enableTools") : t.type === "tool-retrieveRevisedAnswers" ? e("messagePart.revisedAnswers") : t.type === "tool-searchInKnowledgeBase" ? e("messagePart.searchingDocuments") : t.type === "tool-expandChunkContext" ? e("messagePart.expandChunkContext") : t.type === "tool-readDocumentFile" ? e("messagePart.readDocumentFile") : t.type === "tool-readSpreadsheet" ? e("messagePart.readSpreadsheet") : t.type === "tool-editSpreadsheet" ? e("messagePart.editSpreadsheet") : t.type === "tool-querySpreadsheet" ? e("messagePart.querySpreadsheet") : t.type === "tool-geocode" ? e("messagePart.geocode") : t.type === "tool-getWeather" ? e("messagePart.getWeather") : t.type === "tool-recallUserMemory" ? e("messagePart.recallUserMemory") : t.type === "tool-saveUserMemory" ? e("messagePart.saveUserMemory") : t.type === "tool-showWeather" ? e("messagePart.showWeather") : t.type === "tool-showForm" ? e("messagePart.showForm") : t.type === "tool-showDiagram" ? e("messagePart.showDiagram") : t.type === "tool-showSources" ? e("messagePart.showSources") : t.type === "tool-showMultipleChoice" ? e("messagePart.showMultipleChoice") : t.type === "tool-showArtifact" ? e("messagePart.showArtifact") : t.type === "tool-showEmail" ? e("messagePart.showEmail") : t.type === "tool-showMessage" ? e("messagePart.showMessage") : t.type === "tool-showWebPages" ? e("messagePart.showWebPages") : t.type === "tool-showProducts" ? e("messagePart.showProducts") : t.type === "tool-showContactForm" ? e("messagePart.showContactForm") : t.type === "tool-showCalendarEvent" ? e("messagePart.showCalendarEvent") : t.type === "tool-showComparison" ? e("messagePart.showComparison") : t.type === "tool-showLocation" ? e("messagePart.showLocation") : t.type === "tool-showQrCode" ? e("messagePart.showQrCode") : t.type === "tool-showImageGallery" ? e("messagePart.showImageGallery") : t.type === "tool-showVideo" ? e("messagePart.showVideo") : t.type === "tool-showSuggestedReply" ? e("messagePart.showSuggestedReply") : t.type === "tool-requestGeolocation" ? e("messagePart.requestGeolocation") : t.type === "tool-disconnectOAuthConnection" ? e("messagePart.disconnectOAuthConnection") : t.type === "tool-requestAccountLink" ? e("messagePart.requestAccountLink") : t.type === "tool-unlinkAccount" ? e("messagePart.unlinkAccount") : Ke.includes(t.type) ? e("messagePart.webSearch") : e("messagePart.tool") : ve(t) ? e("messagePart.reasoning") : e("messagePart.streaming");
|
|
345
340
|
}
|
|
346
341
|
//#endregion
|
|
347
342
|
//#region ../../node_modules/.pnpm/remend@1.4.0/node_modules/remend/dist/index.js
|
|
348
|
-
var
|
|
343
|
+
var rt = Object.defineProperty, it = Object.defineProperties, at = Object.getOwnPropertyDescriptors, k = Object.getOwnPropertySymbols, ot = Object.prototype.hasOwnProperty, st = Object.prototype.propertyIsEnumerable, ct = (e, t, n) => t in e ? rt(e, t, {
|
|
349
344
|
enumerable: !0,
|
|
350
345
|
configurable: !0,
|
|
351
346
|
writable: !0,
|
|
352
347
|
value: n
|
|
353
|
-
}) : e[t] = n,
|
|
354
|
-
for (var n in t ||= {})
|
|
355
|
-
if (
|
|
348
|
+
}) : e[t] = n, lt = (e, t) => {
|
|
349
|
+
for (var n in t ||= {}) ot.call(t, n) && ct(e, n, t[n]);
|
|
350
|
+
if (k) for (var n of k(t)) st.call(t, n) && ct(e, n, t[n]);
|
|
356
351
|
return e;
|
|
357
|
-
},
|
|
352
|
+
}, ut = (e, t) => it(e, at(t)), A = {
|
|
358
353
|
PROSE: 0,
|
|
359
354
|
FENCE_MARKER: 1,
|
|
360
355
|
FENCE_INFO: 2,
|
|
361
356
|
FENCE_BODY: 3,
|
|
362
357
|
CODE_SPAN: 4,
|
|
363
358
|
CODE_SPAN_OPEN: 5
|
|
364
|
-
},
|
|
359
|
+
}, dt = /^(`{3,}|~{3,})(.*)$/, ft = (e) => e !== void 0 && e >= "0" && e <= "9", pt = (e, t) => {
|
|
365
360
|
let n = t;
|
|
366
361
|
if (e[n] === "-" || e[n] === "*" || e[n] === "+") n += 1;
|
|
367
362
|
else {
|
|
368
|
-
for (;
|
|
363
|
+
for (; ft(e[n]) && n - t < 9;) n += 1;
|
|
369
364
|
if (n === t || e[n] !== "." && e[n] !== ")") return -1;
|
|
370
365
|
n += 1;
|
|
371
366
|
}
|
|
372
367
|
return e[n] === " " ? n + 1 : -1;
|
|
373
|
-
},
|
|
368
|
+
}, mt = (e, t, n) => {
|
|
374
369
|
let r = 0, i = t, a = !1, o = t;
|
|
375
370
|
for (;;) {
|
|
376
371
|
for (; o < n && e[o] === " ";) o += 1;
|
|
@@ -378,7 +373,7 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
|
|
|
378
373
|
r += 1, o += e[o + 1] === " " ? 2 : 1, i = o, a = !1;
|
|
379
374
|
continue;
|
|
380
375
|
}
|
|
381
|
-
let t = o < n ?
|
|
376
|
+
let t = o < n ? pt(e, o) : -1;
|
|
382
377
|
if (t === -1) return {
|
|
383
378
|
contentStart: o,
|
|
384
379
|
listIndent: a ? o - i : 0,
|
|
@@ -386,7 +381,7 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
|
|
|
386
381
|
};
|
|
387
382
|
o = t, a = !0;
|
|
388
383
|
}
|
|
389
|
-
},
|
|
384
|
+
}, ht = (e, t, n, r) => {
|
|
390
385
|
let i = t;
|
|
391
386
|
for (let t = 0; t < r; t += 1) {
|
|
392
387
|
for (; i < n && e[i] === " ";) i += 1;
|
|
@@ -394,10 +389,10 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
|
|
|
394
389
|
i += 1, e[i] === " " && (i += 1);
|
|
395
390
|
}
|
|
396
391
|
return i;
|
|
397
|
-
},
|
|
392
|
+
}, j = (e, t, n, r, i) => {
|
|
398
393
|
let a = t + r;
|
|
399
|
-
e.fill(
|
|
400
|
-
},
|
|
394
|
+
e.fill(A.FENCE_MARKER, a, a + i), e.fill(A.FENCE_INFO, a + i, Math.min(n + 1, e.length));
|
|
395
|
+
}, gt = (e, t, n, r) => {
|
|
401
396
|
let i = t;
|
|
402
397
|
for (; i < n && e[i] === " ";) i += 1;
|
|
403
398
|
let a = 0;
|
|
@@ -408,62 +403,62 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
|
|
|
408
403
|
i += 1;
|
|
409
404
|
}
|
|
410
405
|
return !0;
|
|
411
|
-
},
|
|
412
|
-
let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a =
|
|
406
|
+
}, _t = (e, t, n, r) => {
|
|
407
|
+
let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a = mt(e, n, i), o = e.slice(a.contentStart, i).match(dt);
|
|
413
408
|
if (!o) return null;
|
|
414
409
|
let [, s, c] = o, l = s[0];
|
|
415
|
-
return l === "`" && c.includes("`") ? null : (
|
|
410
|
+
return l === "`" && c.includes("`") ? null : (j(t, n, r, a.contentStart - n, s.length), {
|
|
416
411
|
char: l,
|
|
417
412
|
length: s.length,
|
|
418
413
|
listIndent: a.listIndent,
|
|
419
414
|
quoteDepth: a.quoteDepth
|
|
420
415
|
});
|
|
421
|
-
},
|
|
422
|
-
let i =
|
|
416
|
+
}, vt = (e, t, n, r) => {
|
|
417
|
+
let i = ht(e, t, n, r.quoteDepth);
|
|
423
418
|
if (i === -1 || r.listIndent === 0) return i;
|
|
424
419
|
let a = i;
|
|
425
420
|
for (; a < n && e[a] === " ";) a += 1;
|
|
426
421
|
return a === n || e[a] === "\r" && a + 1 === n || a - i >= r.listIndent ? i : -1;
|
|
427
|
-
},
|
|
422
|
+
}, yt = (e, t) => {
|
|
428
423
|
let n = e.length, r = null, i = 0;
|
|
429
424
|
for (; i < n;) {
|
|
430
425
|
let a = e.indexOf("\n", i);
|
|
431
426
|
a === -1 && (a = n);
|
|
432
|
-
let o = r ?
|
|
433
|
-
r && o === -1 && (r = null), r ?
|
|
427
|
+
let o = r ? vt(e, i, a, r) : -1;
|
|
428
|
+
r && o === -1 && (r = null), r ? gt(e, o, a, r) ? (t.fill(A.FENCE_MARKER, i, a), r = null) : t.fill(A.FENCE_BODY, i, Math.min(a + 1, n)) : r = _t(e, t, i, a), i = a + 1;
|
|
434
429
|
}
|
|
435
430
|
return r;
|
|
436
|
-
},
|
|
431
|
+
}, bt = (e, t) => {
|
|
437
432
|
let n = t + 1;
|
|
438
433
|
for (; n < e.length && e[n] === "`";) n += 1;
|
|
439
434
|
return n;
|
|
440
|
-
},
|
|
435
|
+
}, xt = (e, t) => {
|
|
441
436
|
let n = t + 1;
|
|
442
437
|
for (; n < e.length && (e[n] === " " || e[n] === " " || e[n] === "\r");) n += 1;
|
|
443
438
|
return n < e.length && e[n] === "\n";
|
|
444
|
-
},
|
|
439
|
+
}, St = (e, t, n) => {
|
|
445
440
|
let r = n;
|
|
446
441
|
for (;;) {
|
|
447
442
|
let n = e.indexOf("`", r);
|
|
448
443
|
if (n === -1) return -1;
|
|
449
|
-
let i = n > r && e[n - 1] === "\\" && t[n - 1] ===
|
|
450
|
-
if (t[n] ===
|
|
444
|
+
let i = n > r && e[n - 1] === "\\" && t[n - 1] === A.PROSE;
|
|
445
|
+
if (t[n] === A.PROSE && !i) return n;
|
|
451
446
|
r = n + 1;
|
|
452
447
|
}
|
|
453
|
-
},
|
|
448
|
+
}, Ct = (e, t) => {
|
|
454
449
|
let n = e.length, r = -1, i = 0, a = 0;
|
|
455
450
|
for (; a < n;) {
|
|
456
451
|
if (r < 0) {
|
|
457
|
-
if (a =
|
|
458
|
-
let n =
|
|
452
|
+
if (a = St(e, t, a), a === -1) break;
|
|
453
|
+
let n = bt(e, a);
|
|
459
454
|
r = a, i = n - a, a = n;
|
|
460
455
|
continue;
|
|
461
456
|
}
|
|
462
|
-
if (t[a] !==
|
|
463
|
-
t.fill(
|
|
457
|
+
if (t[a] !== A.PROSE) {
|
|
458
|
+
t.fill(A.CODE_SPAN_OPEN, r, a), r = -1, a += 1;
|
|
464
459
|
continue;
|
|
465
460
|
}
|
|
466
|
-
if (e[a] === "\n" &&
|
|
461
|
+
if (e[a] === "\n" && xt(e, a)) {
|
|
467
462
|
r = -1, a += 1;
|
|
468
463
|
continue;
|
|
469
464
|
}
|
|
@@ -471,79 +466,79 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
|
|
|
471
466
|
a += 1;
|
|
472
467
|
continue;
|
|
473
468
|
}
|
|
474
|
-
let n =
|
|
475
|
-
n - a === i && (t.fill(
|
|
469
|
+
let n = bt(e, a);
|
|
470
|
+
n - a === i && (t.fill(A.CODE_SPAN, r, n), r = -1), a = n;
|
|
476
471
|
}
|
|
477
|
-
return r >= 0 ? (t.fill(
|
|
472
|
+
return r >= 0 ? (t.fill(A.CODE_SPAN_OPEN, r, n), {
|
|
478
473
|
start: r,
|
|
479
474
|
runLength: i
|
|
480
475
|
}) : null;
|
|
481
|
-
},
|
|
476
|
+
}, wt = (e) => {
|
|
482
477
|
let t = new Uint8Array(e.length);
|
|
483
478
|
return {
|
|
484
479
|
text: e,
|
|
485
480
|
regions: t,
|
|
486
|
-
openFence:
|
|
487
|
-
openSpan:
|
|
481
|
+
openFence: yt(e, t),
|
|
482
|
+
openSpan: Ct(e, t),
|
|
488
483
|
mathMask: null,
|
|
489
484
|
linkUrlMask: null,
|
|
490
485
|
htmlTagMask: null
|
|
491
486
|
};
|
|
492
|
-
},
|
|
493
|
-
if (
|
|
494
|
-
let t =
|
|
495
|
-
return
|
|
496
|
-
},
|
|
497
|
-
|
|
498
|
-
},
|
|
487
|
+
}, Tt = null, M = null, N = (e) => {
|
|
488
|
+
if (M !== null && e === Tt) return M;
|
|
489
|
+
let t = wt(e);
|
|
490
|
+
return Tt = e, M = t, t;
|
|
491
|
+
}, Et = () => {
|
|
492
|
+
Tt = null, M = null;
|
|
493
|
+
}, Dt = (e, t) => t >= e.regions.length ? e.openFence !== null || e.openSpan !== null : t < 0 ? !1 : e.regions[t] !== A.PROSE, Ot = (e, t) => e.regions[t] === A.CODE_SPAN, kt = (e, t) => {
|
|
499
494
|
let n = N(e), r = t + t, i = 0;
|
|
500
|
-
for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] ===
|
|
495
|
+
for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] === A.PROSE ? (i += 1, t += 2) : t += 1;
|
|
501
496
|
return i;
|
|
502
|
-
},
|
|
497
|
+
}, At = /* @__PURE__ */ new Uint8Array(), jt = (e) => e === "inlineLatex" || e === "blockLatex", Mt = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, Nt = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", Pt = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), Ft = (e, t, n) => {
|
|
503
498
|
let r = e[t + 1];
|
|
504
499
|
if (e[t] === "\\") {
|
|
505
500
|
if (r === "$") return {
|
|
506
501
|
context: n,
|
|
507
502
|
length: 2
|
|
508
503
|
};
|
|
509
|
-
let e =
|
|
504
|
+
let e = Mt(n, r);
|
|
510
505
|
return e === null ? null : {
|
|
511
506
|
context: e,
|
|
512
507
|
length: 2
|
|
513
508
|
};
|
|
514
509
|
}
|
|
515
|
-
if (e[t] === "$" && !
|
|
510
|
+
if (e[t] === "$" && !jt(n)) {
|
|
516
511
|
let e = r === "$";
|
|
517
512
|
return {
|
|
518
|
-
context:
|
|
513
|
+
context: Nt(n, e),
|
|
519
514
|
length: e ? 2 : 1
|
|
520
515
|
};
|
|
521
516
|
}
|
|
522
517
|
return null;
|
|
523
|
-
},
|
|
518
|
+
}, It = (e) => {
|
|
524
519
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = "none", o = 0;
|
|
525
520
|
for (; o < r;) {
|
|
526
521
|
i[o] = a === "none" ? 0 : 1;
|
|
527
|
-
let e = n[o] ===
|
|
522
|
+
let e = n[o] === A.PROSE ? Ft(t, o, a) : null;
|
|
528
523
|
e === null ? o += 1 : (a = e.context, e.length === 2 && (i[o + 1] = a === "none" ? 0 : 1), o += e.length);
|
|
529
524
|
}
|
|
530
525
|
return i;
|
|
531
|
-
},
|
|
526
|
+
}, Lt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.mathMask === null && (e.mathMask = Pt(e.text) ? It(e) : At), e.mathMask[t] === 1), Rt = (e, t, n, r) => {
|
|
532
527
|
let { text: i, regions: a } = e, o = new Uint8Array(n - t), s = 0;
|
|
533
|
-
for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] ===
|
|
528
|
+
for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] === A.PROSE && (s = 1), o[e - t] = s;
|
|
534
529
|
let c = !1;
|
|
535
|
-
for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] ===
|
|
536
|
-
},
|
|
530
|
+
for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] === A.PROSE && (i[e] === ")" ? c = !1 : i[e] === "(" && (c = e > 0 && i[e - 1] === "]"));
|
|
531
|
+
}, zt = (e) => {
|
|
537
532
|
let { text: t } = e, n = t.length, r = new Uint8Array(n), i = 0;
|
|
538
533
|
for (; i < n;) {
|
|
539
534
|
let a = t.indexOf("\n", i);
|
|
540
|
-
a === -1 && (a = n),
|
|
535
|
+
a === -1 && (a = n), Rt(e, i, a, r), i = a + 1;
|
|
541
536
|
}
|
|
542
537
|
return r;
|
|
543
|
-
},
|
|
538
|
+
}, Bt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.linkUrlMask === null && (e.linkUrlMask = e.text.includes("](") ? zt(e) : At), e.linkUrlMask[t] === 1), Vt = (e) => {
|
|
544
539
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = !1;
|
|
545
540
|
for (let e = 0; e < r; e += 1) if (t[e] === "\n") a = !1;
|
|
546
|
-
else if (i[e] = +!!a, n[e] ===
|
|
541
|
+
else if (i[e] = +!!a, n[e] === A.PROSE) {
|
|
547
542
|
if (t[e] === ">") a = !1;
|
|
548
543
|
else if (t[e] === "<") {
|
|
549
544
|
let n = t[e + 1];
|
|
@@ -551,56 +546,56 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
|
|
|
551
546
|
}
|
|
552
547
|
}
|
|
553
548
|
return i;
|
|
554
|
-
},
|
|
549
|
+
}, Ht = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.htmlTagMask === null && (e.htmlTagMask = e.text.includes("<") ? Vt(e) : At), e.htmlTagMask[t] === 1), P = (e, t) => Dt(N(e), t), F = (e, t) => Ot(N(e), t), Ut = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, Wt = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Ut, (t, n, r, i) => P(e, i) ? t : `${n}\\>${r}`), I = (e, { delimiter: t, markerLength: n, regex: r }) => {
|
|
555
550
|
let i = e.lastIndexOf(t, e.length - 2), a = i === -1 ? e.length - 1 : i;
|
|
556
551
|
return e.slice(Math.max(0, a - n + 1)).match(r);
|
|
557
|
-
},
|
|
552
|
+
}, Gt = {
|
|
558
553
|
delimiter: "*",
|
|
559
554
|
markerLength: 2,
|
|
560
555
|
regex: /(\*\*)([^*]*\*?)$/
|
|
561
|
-
},
|
|
556
|
+
}, Kt = {
|
|
562
557
|
delimiter: "_",
|
|
563
558
|
markerLength: 2,
|
|
564
559
|
regex: /(__)([^_]*?)$/
|
|
565
|
-
},
|
|
560
|
+
}, qt = {
|
|
566
561
|
delimiter: "*",
|
|
567
562
|
markerLength: 3,
|
|
568
563
|
regex: /(\*\*\*)([^*]*?)$/
|
|
569
|
-
},
|
|
564
|
+
}, Jt = {
|
|
570
565
|
delimiter: "*",
|
|
571
566
|
markerLength: 1,
|
|
572
567
|
regex: /(\*)([^*]*?)$/
|
|
573
|
-
},
|
|
568
|
+
}, Yt = {
|
|
574
569
|
delimiter: "_",
|
|
575
570
|
markerLength: 1,
|
|
576
571
|
regex: /(_)([^_]*?)$/
|
|
577
|
-
},
|
|
572
|
+
}, Xt = {
|
|
578
573
|
delimiter: "~",
|
|
579
574
|
markerLength: 2,
|
|
580
575
|
regex: /(~~)([^~]*?)$/
|
|
581
|
-
},
|
|
576
|
+
}, Zt = {
|
|
582
577
|
delimiter: "_",
|
|
583
578
|
markerLength: 2,
|
|
584
579
|
regex: /(__)([^_]+)_$/
|
|
585
|
-
},
|
|
580
|
+
}, Qt = {
|
|
586
581
|
delimiter: "~",
|
|
587
582
|
markerLength: 2,
|
|
588
583
|
regex: /(~~)([^~]+)~$/
|
|
589
|
-
},
|
|
584
|
+
}, $t = /^[\s_~*`]*$/, en = /^[\s]*[-*+][\s]+$/, tn = /[\p{L}\p{N}_]/u, nn = /^\*{4,}$/, L = (e) => {
|
|
590
585
|
if (!e) return !1;
|
|
591
586
|
let t = e.charCodeAt(0);
|
|
592
|
-
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 ||
|
|
593
|
-
},
|
|
587
|
+
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || tn.test(e);
|
|
588
|
+
}, rn = (e, t) => {
|
|
594
589
|
let n = 1;
|
|
595
590
|
for (let r = t - 1; r >= 0; --r) if (e[r] === "]") n += 1;
|
|
596
591
|
else if (e[r] === "[" && (--n, n === 0)) return r;
|
|
597
592
|
return -1;
|
|
598
|
-
},
|
|
593
|
+
}, an = (e, t) => {
|
|
599
594
|
let n = 1;
|
|
600
595
|
for (let r = t + 1; r < e.length; r += 1) if (e[r] === "[") n += 1;
|
|
601
596
|
else if (e[r] === "]" && (--n, n === 0)) return r;
|
|
602
597
|
return -1;
|
|
603
|
-
},
|
|
598
|
+
}, on = (e, t) => Lt(N(e), t), sn = (e, t, n) => {
|
|
604
599
|
let r = 0;
|
|
605
600
|
for (let n = t - 1; n >= 0; --n) if (e[n] === "\n") {
|
|
606
601
|
r = n + 1;
|
|
@@ -618,184 +613,184 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
|
|
|
618
613
|
break;
|
|
619
614
|
}
|
|
620
615
|
return o >= 3 && !s;
|
|
621
|
-
},
|
|
622
|
-
let i =
|
|
616
|
+
}, cn = (e, t, n, r) => n === "\\" || Lt(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.text.length - 2 ? e.text[t + 2] : "") !== "*" : n === "*" || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n"), ln = (e) => e === " " || e === " " || e === "\n", un = (e, t) => !!(e && t && L(e) && L(t)), dn = (e, t, n, r) => {
|
|
617
|
+
let i = un(e, t), a = !!t && !ln(t), o = !!e && !ln(e);
|
|
623
618
|
return i && n % 2 == 0 && !r ? { count: !1 } : o && n % 2 == 1 || a ? {
|
|
624
619
|
count: !0,
|
|
625
620
|
inWordAsteriskChain: i
|
|
626
621
|
} : { count: !1 };
|
|
627
|
-
},
|
|
622
|
+
}, fn = (e) => {
|
|
628
623
|
let t = N(e), n = 0, r = !1, i = e.length;
|
|
629
624
|
for (let a = 0; a < i; a += 1) {
|
|
630
|
-
if (e[a] !== "*" || t.regions[a] !==
|
|
625
|
+
if (e[a] !== "*" || t.regions[a] !== A.PROSE) {
|
|
631
626
|
L(e[a]) || (r = !1);
|
|
632
627
|
continue;
|
|
633
628
|
}
|
|
634
629
|
let o = a > 0 ? e[a - 1] : "", s = a < i - 1 ? e[a + 1] : "";
|
|
635
|
-
if (
|
|
636
|
-
let c =
|
|
630
|
+
if (cn(t, a, o, s)) continue;
|
|
631
|
+
let c = dn(o, s, n, r);
|
|
637
632
|
c.count && (n += 1, r = c.inWordAsteriskChain);
|
|
638
633
|
}
|
|
639
634
|
return n;
|
|
640
|
-
},
|
|
635
|
+
}, pn = (e, t, n, r) => !!(n === "\\" || Lt(e, t) || Bt(e, t) || Ht(e, t) || n === "_" || r === "_" || n && r && L(n) && L(r)), mn = (e) => {
|
|
641
636
|
let t = N(e), n = 0, r = e.length;
|
|
642
637
|
for (let i = 0; i < r; i += 1) {
|
|
643
|
-
if (e[i] !== "_" || t.regions[i] !==
|
|
638
|
+
if (e[i] !== "_" || t.regions[i] !== A.PROSE) continue;
|
|
644
639
|
let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
|
|
645
|
-
|
|
640
|
+
pn(t, i, a, o) || (n += 1);
|
|
646
641
|
}
|
|
647
642
|
return n;
|
|
648
|
-
},
|
|
643
|
+
}, hn = (e) => {
|
|
649
644
|
let t = N(e), n = 0, r = 0;
|
|
650
|
-
for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] ===
|
|
645
|
+
for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] === A.PROSE ? r += 1 : (r >= 3 && (n += Math.floor(r / 3)), r = 0);
|
|
651
646
|
return r >= 3 && (n += Math.floor(r / 3)), n;
|
|
652
|
-
},
|
|
653
|
-
if (!(
|
|
647
|
+
}, gn = (e) => kt(e, "*"), _n = (e) => e === "" || e === " " || e === " " || e === "\n", vn = (e, t, n, r, i) => {
|
|
648
|
+
if (!(_n(n) && _n(r))) return !1;
|
|
654
649
|
if (t > i.lineEnd) {
|
|
655
650
|
let n = e.indexOf("\n", t);
|
|
656
|
-
i.lineEnd = n === -1 ? e.length : n, i.result =
|
|
651
|
+
i.lineEnd = n === -1 ? e.length : n, i.result = sn(e, t, "_");
|
|
657
652
|
}
|
|
658
653
|
return i.result;
|
|
659
|
-
},
|
|
654
|
+
}, yn = (e, t, n, r) => {
|
|
660
655
|
let i = e.text, a = t, o = !1;
|
|
661
656
|
a > 0 && i[a - 1] === "\\" && (a += 1, o = !0);
|
|
662
657
|
let s = n - a;
|
|
663
658
|
if (s < 2) return !1;
|
|
664
659
|
let c = a > 0 ? i[a - 1] : "", l = o ? "\\" : c, u = n < i.length ? i[n] : "";
|
|
665
|
-
return L(l) && L(u) ||
|
|
666
|
-
},
|
|
660
|
+
return L(l) && L(u) || vn(i, a, l, u, r) || Lt(e, a) || Bt(e, a) || Ht(e, a) ? !1 : Math.floor(s / 2) % 2 == 1;
|
|
661
|
+
}, bn = (e) => {
|
|
667
662
|
let t = N(e), n = e.length, r = {
|
|
668
663
|
lineEnd: -1,
|
|
669
664
|
result: !1
|
|
670
665
|
}, i = !1, a = 0;
|
|
671
666
|
for (; a < n;) {
|
|
672
|
-
if (e[a] !== "_" || t.regions[a] !==
|
|
667
|
+
if (e[a] !== "_" || t.regions[a] !== A.PROSE) {
|
|
673
668
|
a += 1;
|
|
674
669
|
continue;
|
|
675
670
|
}
|
|
676
671
|
let o = a, s = a + 1;
|
|
677
|
-
for (; s < n && e[s] === "_" && t.regions[s] ===
|
|
678
|
-
a = s,
|
|
672
|
+
for (; s < n && e[s] === "_" && t.regions[s] === A.PROSE;) s += 1;
|
|
673
|
+
a = s, yn(t, o, s, r) && (i = !i);
|
|
679
674
|
}
|
|
680
675
|
return i;
|
|
681
|
-
},
|
|
682
|
-
if (!t ||
|
|
676
|
+
}, xn = (e, t, n) => {
|
|
677
|
+
if (!t || $t.test(t)) return !0;
|
|
683
678
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
684
|
-
return
|
|
685
|
-
},
|
|
686
|
-
let t =
|
|
679
|
+
return en.test(a) && t.includes("\n") ? !0 : sn(e, n, "*");
|
|
680
|
+
}, Sn = (e) => {
|
|
681
|
+
let t = I(e, Gt);
|
|
687
682
|
if (!t) return e;
|
|
688
683
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
689
|
-
return P(e, r) ||
|
|
690
|
-
},
|
|
691
|
-
if (!t ||
|
|
684
|
+
return P(e, r) || F(e, r) || xn(e, n, r) ? e : gn(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
|
|
685
|
+
}, Cn = (e, t, n) => {
|
|
686
|
+
if (!t || $t.test(t)) return !0;
|
|
692
687
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
693
|
-
return
|
|
694
|
-
},
|
|
695
|
-
let t =
|
|
688
|
+
return en.test(a) && t.includes("\n") ? !0 : sn(e, n, "_");
|
|
689
|
+
}, wn = (e) => {
|
|
690
|
+
let t = I(e, Kt);
|
|
696
691
|
if (!t) {
|
|
697
|
-
let t =
|
|
692
|
+
let t = I(e, Zt);
|
|
698
693
|
if (t) {
|
|
699
694
|
let n = e.lastIndexOf(t[1]);
|
|
700
|
-
if (!(P(e, n) ||
|
|
695
|
+
if (!(P(e, n) || F(e, n)) && bn(e)) return `${e}_`;
|
|
701
696
|
}
|
|
702
697
|
return e;
|
|
703
698
|
}
|
|
704
699
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
705
|
-
return P(e, r) ||
|
|
706
|
-
},
|
|
700
|
+
return P(e, r) || F(e, r) || Cn(e, n, r) ? e : bn(e) ? `${e}__` : e;
|
|
701
|
+
}, Tn = (e, t) => {
|
|
707
702
|
let { text: n } = e;
|
|
708
|
-
return n[t] === "*" && e.regions[t] ===
|
|
709
|
-
},
|
|
703
|
+
return n[t] === "*" && e.regions[t] === A.PROSE && n[t - 1] !== "*" && n[t + 1] !== "*" && n[t - 1] !== "\\" && !Lt(e, t);
|
|
704
|
+
}, En = (e) => {
|
|
710
705
|
let t = N(e);
|
|
711
706
|
for (let n = e.indexOf("*"); n !== -1; n = e.indexOf("*", n + 1)) {
|
|
712
|
-
if (!
|
|
713
|
-
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r ||
|
|
707
|
+
if (!Tn(t, n)) continue;
|
|
708
|
+
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r || ln(r), o = !i || ln(i);
|
|
714
709
|
if (!(a && o) && !(r && i && L(r) && L(i)) && !o) return n;
|
|
715
710
|
}
|
|
716
711
|
return -1;
|
|
717
|
-
}, En = (e) => {
|
|
718
|
-
if (!F(e, qt)) return e;
|
|
719
|
-
let t = Tn(e);
|
|
720
|
-
if (t === -1 || P(e, t) || Ht(e, t)) return e;
|
|
721
|
-
let n = e.substring(t + 1);
|
|
722
|
-
return !n || Qt.test(n) ? e : dn(e) % 2 == 1 ? `${e}*` : e;
|
|
723
712
|
}, Dn = (e) => {
|
|
713
|
+
if (!I(e, Jt)) return e;
|
|
714
|
+
let t = En(e);
|
|
715
|
+
if (t === -1 || P(e, t) || F(e, t)) return e;
|
|
716
|
+
let n = e.substring(t + 1);
|
|
717
|
+
return !n || $t.test(n) ? e : fn(e) % 2 == 1 ? `${e}*` : e;
|
|
718
|
+
}, On = (e) => {
|
|
724
719
|
let t = N(e);
|
|
725
|
-
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] ===
|
|
720
|
+
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] === A.PROSE && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !Lt(t, n) && !Bt(t, n)) {
|
|
726
721
|
let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
|
|
727
722
|
if (t && r && L(t) && L(r)) continue;
|
|
728
723
|
return n;
|
|
729
724
|
}
|
|
730
725
|
return -1;
|
|
731
|
-
},
|
|
726
|
+
}, kn = (e) => {
|
|
732
727
|
let t = e.length;
|
|
733
728
|
for (; t > 0 && e[t - 1] === "\n";) --t;
|
|
734
729
|
return t < e.length ? `${e.slice(0, t)}_${e.slice(t)}` : `${e}_`;
|
|
735
|
-
},
|
|
730
|
+
}, An = (e) => {
|
|
736
731
|
if (!e.endsWith("**")) return null;
|
|
737
732
|
let t = e.slice(0, -2);
|
|
738
|
-
if (
|
|
739
|
-
let n = t.indexOf("**"), r =
|
|
733
|
+
if (gn(t) % 2 != 1) return null;
|
|
734
|
+
let n = t.indexOf("**"), r = On(t);
|
|
740
735
|
return n !== -1 && r !== -1 && n < r ? `${t}_**` : null;
|
|
741
|
-
},
|
|
742
|
-
if (!
|
|
743
|
-
let t =
|
|
736
|
+
}, jn = (e) => {
|
|
737
|
+
if (!I(e, Yt)) return e;
|
|
738
|
+
let t = On(e);
|
|
744
739
|
if (t === -1) return e;
|
|
745
740
|
let n = e.substring(t + 1);
|
|
746
|
-
if (!n ||
|
|
747
|
-
if (
|
|
748
|
-
let t =
|
|
749
|
-
return t === null ?
|
|
741
|
+
if (!n || $t.test(n) || P(e, t) || F(e, t)) return e;
|
|
742
|
+
if (mn(e) % 2 == 1) {
|
|
743
|
+
let t = An(e);
|
|
744
|
+
return t === null ? kn(e) : t;
|
|
750
745
|
}
|
|
751
746
|
return e;
|
|
752
|
-
},
|
|
753
|
-
let t =
|
|
747
|
+
}, Mn = (e) => {
|
|
748
|
+
let t = gn(e), n = fn(e);
|
|
754
749
|
return t % 2 == 0 && n % 2 == 0;
|
|
755
|
-
},
|
|
756
|
-
if (
|
|
757
|
-
let t =
|
|
750
|
+
}, Nn = (e, t, n) => !t || $t.test(t) || P(e, n) || F(e, n) ? !0 : sn(e, n, "*"), Pn = (e) => {
|
|
751
|
+
if (nn.test(e)) return e;
|
|
752
|
+
let t = I(e, qt);
|
|
758
753
|
if (!t) return e;
|
|
759
754
|
let n = t[2];
|
|
760
|
-
return
|
|
761
|
-
},
|
|
755
|
+
return Nn(e, n, e.lastIndexOf(t[1])) ? e : hn(e) % 2 == 1 ? Mn(e) ? e : `${e}***` : e;
|
|
756
|
+
}, Fn = /<[a-zA-Z/][^>]*$/, In = /[a-zA-Z/]/, Ln = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), Rn = (e, t) => {
|
|
762
757
|
let n = e[t + 1];
|
|
763
|
-
return n !== void 0 &&
|
|
764
|
-
},
|
|
765
|
-
let t = e.match(
|
|
758
|
+
return n !== void 0 && In.test(n);
|
|
759
|
+
}, zn = (e) => {
|
|
760
|
+
let t = e.match(Fn);
|
|
766
761
|
if (!t || t.index === void 0) return e;
|
|
767
|
-
let n =
|
|
768
|
-
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" &&
|
|
762
|
+
let n = Ln(e);
|
|
763
|
+
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" && Rn(e, r) && !P(e, r) && !(n && on(e, r))) return e.substring(0, r).trimEnd();
|
|
769
764
|
return e;
|
|
770
|
-
},
|
|
765
|
+
}, Bn = (e) => {
|
|
771
766
|
let t = N(e);
|
|
772
767
|
if (t.openFence) return e;
|
|
773
768
|
let n = t.openSpan;
|
|
774
769
|
if (!n) return e;
|
|
775
770
|
let r = e.slice(n.start + n.runLength);
|
|
776
|
-
if (!r ||
|
|
771
|
+
if (!r || $t.test(r)) return e;
|
|
777
772
|
let i = 0, a = e.length - 1;
|
|
778
773
|
for (; a >= 0 && e[a] === "`";) i += 1, --a;
|
|
779
774
|
return i >= n.runLength ? e : e + "`".repeat(n.runLength - i);
|
|
780
|
-
},
|
|
775
|
+
}, Vn = (e) => kt(e, "$"), Hn = (e) => {
|
|
781
776
|
let t = N(e), n = 0;
|
|
782
|
-
for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] ===
|
|
777
|
+
for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] === A.PROSE && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : n += 1);
|
|
783
778
|
return n;
|
|
784
|
-
},
|
|
779
|
+
}, Un = (e) => {
|
|
785
780
|
if (e.endsWith("$") && !e.endsWith("$$")) return `${e}$`;
|
|
786
781
|
let t = e.indexOf("$$");
|
|
787
782
|
return t !== -1 && e.indexOf("\n", t) !== -1 && !e.endsWith("\n") ? `${e}
|
|
788
783
|
$$` : `${e}$$`;
|
|
789
|
-
},
|
|
784
|
+
}, Wn = (e) => Vn(e) % 2 == 0 ? e : Un(e), Gn = (e) => Hn(e) % 2 == 1 ? `${e}$` : e, Kn = "streamdown:incomplete-image", qn = (e, t, n) => {
|
|
790
785
|
if (e.substring(t + 2).includes(")")) return null;
|
|
791
|
-
let r =
|
|
786
|
+
let r = rn(e, t);
|
|
792
787
|
if (r === -1 || P(e, r)) return null;
|
|
793
788
|
let i = r > 0 && e[r - 1] === "!", a = i ? r - 1 : r, o = e.substring(0, a), s = e.substring(r + 1, t);
|
|
794
|
-
return i ? `${o}` : n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
|
|
790
|
+
}, Jn = (e, t) => {
|
|
796
791
|
for (let n = 0; n < t; n++) if (e[n] === "[" && !P(e, n)) {
|
|
797
792
|
if (n > 0 && e[n - 1] === "!") continue;
|
|
798
|
-
let t =
|
|
793
|
+
let t = an(e, n);
|
|
799
794
|
if (t === -1) return n;
|
|
800
795
|
if (t + 1 < e.length && e[t + 1] === "(") {
|
|
801
796
|
let r = e.indexOf(")", t + 2);
|
|
@@ -803,69 +798,69 @@ $$` : `${e}$$`;
|
|
|
803
798
|
}
|
|
804
799
|
}
|
|
805
800
|
return t;
|
|
806
|
-
},
|
|
801
|
+
}, Yn = (e, t, n) => {
|
|
807
802
|
let r = t > 0 && e[t - 1] === "!", i = r ? t - 1 : t;
|
|
808
|
-
if (!e.substring(t + 1).includes("]") ||
|
|
803
|
+
if (!e.substring(t + 1).includes("]") || an(e, t) === -1) {
|
|
809
804
|
let a = e.substring(0, i);
|
|
810
|
-
if (r) return `${a} return `${a}`;
|
|
811
806
|
if (n === "text-only") {
|
|
812
|
-
let n =
|
|
807
|
+
let n = Jn(e, t);
|
|
813
808
|
return e.substring(0, n) + e.substring(n + 1);
|
|
814
809
|
}
|
|
815
810
|
return `${e}](streamdown:incomplete-link)`;
|
|
816
811
|
}
|
|
817
812
|
return null;
|
|
818
|
-
},
|
|
813
|
+
}, Xn = (e, t) => {
|
|
819
814
|
let n = e.lastIndexOf("](");
|
|
820
815
|
if (n !== -1 && !P(e, n)) {
|
|
821
|
-
let r =
|
|
816
|
+
let r = qn(e, n, t);
|
|
822
817
|
if (r !== null) return r;
|
|
823
818
|
}
|
|
824
819
|
for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!P(e, n)) {
|
|
825
|
-
let r =
|
|
820
|
+
let r = Yn(e, n, t);
|
|
826
821
|
if (r !== null) return r;
|
|
827
822
|
}
|
|
828
823
|
return e;
|
|
829
|
-
},
|
|
824
|
+
}, Zn = 32, Qn = (e, t = "protocol") => {
|
|
830
825
|
let n = e;
|
|
831
|
-
for (let e = 0; e <
|
|
832
|
-
let e =
|
|
826
|
+
for (let e = 0; e < Zn; e += 1) {
|
|
827
|
+
let e = Xn(n, t);
|
|
833
828
|
if (e.length >= n.length) return e;
|
|
834
829
|
n = e;
|
|
835
830
|
}
|
|
836
831
|
return n;
|
|
837
|
-
},
|
|
832
|
+
}, $n = /^-{1,2}$/, er = /^[\s]*-{1,2}[\s]+$/, tr = /^={1,2}$/, nr = /^[\s]*={1,2}[\s]+$/, rr = (e) => {
|
|
838
833
|
if (!e || typeof e != "string") return e;
|
|
839
834
|
let t = e.lastIndexOf("\n");
|
|
840
835
|
if (t === -1) return e;
|
|
841
836
|
let n = e.substring(t + 1), r = e.substring(0, t), i = n.trim();
|
|
842
|
-
if (
|
|
837
|
+
if ($n.test(i) && !n.match(er)) {
|
|
843
838
|
let t = r.split("\n").at(-1);
|
|
844
839
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
845
840
|
}
|
|
846
|
-
if (
|
|
841
|
+
if (tr.test(i) && !n.match(nr)) {
|
|
847
842
|
let t = r.split("\n").at(-1);
|
|
848
843
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
849
844
|
}
|
|
850
845
|
return e;
|
|
851
|
-
},
|
|
852
|
-
let t =
|
|
846
|
+
}, ir = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, ar = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(ir, (t, n, r) => P(e, r + n.length) ? t : `${n}\\~`), or = (e) => kt(e, "~"), sr = (e) => {
|
|
847
|
+
let t = I(e, Xt);
|
|
853
848
|
if (t) {
|
|
854
849
|
let n = t[2];
|
|
855
|
-
if (!n ||
|
|
850
|
+
if (!n || $t.test(n)) return e;
|
|
856
851
|
let r = e.lastIndexOf(t[1]);
|
|
857
|
-
if (P(e, r) ||
|
|
858
|
-
if (
|
|
852
|
+
if (P(e, r) || F(e, r)) return e;
|
|
853
|
+
if (or(e) % 2 == 1) return `${e}~~`;
|
|
859
854
|
} else {
|
|
860
|
-
let t =
|
|
855
|
+
let t = I(e, Qt);
|
|
861
856
|
if (t) {
|
|
862
857
|
let n = e.lastIndexOf(t[0].slice(0, 2));
|
|
863
|
-
if (P(e, n) ||
|
|
864
|
-
if (
|
|
858
|
+
if (P(e, n) || F(e, n)) return e;
|
|
859
|
+
if (or(e) % 2 == 1) return `${e}~`;
|
|
865
860
|
}
|
|
866
861
|
}
|
|
867
862
|
return e;
|
|
868
|
-
},
|
|
863
|
+
}, cr = (e) => e !== !1, lr = (e) => e === !0, R = {
|
|
869
864
|
SINGLE_TILDE: 0,
|
|
870
865
|
COMPARISON_OPERATORS: 5,
|
|
871
866
|
HTML_TAGS: 10,
|
|
@@ -881,11 +876,11 @@ $$` : `${e}$$`;
|
|
|
881
876
|
KATEX: 70,
|
|
882
877
|
INLINE_KATEX: 75,
|
|
883
878
|
DEFAULT: 100
|
|
884
|
-
},
|
|
879
|
+
}, ur = [
|
|
885
880
|
{
|
|
886
881
|
handler: {
|
|
887
882
|
name: "singleTilde",
|
|
888
|
-
handle:
|
|
883
|
+
handle: ar,
|
|
889
884
|
priority: R.SINGLE_TILDE
|
|
890
885
|
},
|
|
891
886
|
optionKey: "singleTilde"
|
|
@@ -901,7 +896,7 @@ $$` : `${e}$$`;
|
|
|
901
896
|
{
|
|
902
897
|
handler: {
|
|
903
898
|
name: "htmlTags",
|
|
904
|
-
handle:
|
|
899
|
+
handle: zn,
|
|
905
900
|
priority: R.HTML_TAGS
|
|
906
901
|
},
|
|
907
902
|
optionKey: "htmlTags"
|
|
@@ -909,7 +904,7 @@ $$` : `${e}$$`;
|
|
|
909
904
|
{
|
|
910
905
|
handler: {
|
|
911
906
|
name: "setextHeadings",
|
|
912
|
-
handle:
|
|
907
|
+
handle: rr,
|
|
913
908
|
priority: R.SETEXT_HEADINGS
|
|
914
909
|
},
|
|
915
910
|
optionKey: "setextHeadings"
|
|
@@ -917,7 +912,7 @@ $$` : `${e}$$`;
|
|
|
917
912
|
{
|
|
918
913
|
handler: {
|
|
919
914
|
name: "links",
|
|
920
|
-
handle:
|
|
915
|
+
handle: Qn,
|
|
921
916
|
priority: R.LINKS
|
|
922
917
|
},
|
|
923
918
|
optionKey: "links",
|
|
@@ -926,7 +921,7 @@ $$` : `${e}$$`;
|
|
|
926
921
|
{
|
|
927
922
|
handler: {
|
|
928
923
|
name: "boldItalic",
|
|
929
|
-
handle:
|
|
924
|
+
handle: Pn,
|
|
930
925
|
priority: R.BOLD_ITALIC
|
|
931
926
|
},
|
|
932
927
|
optionKey: "boldItalic"
|
|
@@ -934,7 +929,7 @@ $$` : `${e}$$`;
|
|
|
934
929
|
{
|
|
935
930
|
handler: {
|
|
936
931
|
name: "bold",
|
|
937
|
-
handle:
|
|
932
|
+
handle: Sn,
|
|
938
933
|
priority: R.BOLD
|
|
939
934
|
},
|
|
940
935
|
optionKey: "bold"
|
|
@@ -942,7 +937,7 @@ $$` : `${e}$$`;
|
|
|
942
937
|
{
|
|
943
938
|
handler: {
|
|
944
939
|
name: "italicDoubleUnderscore",
|
|
945
|
-
handle:
|
|
940
|
+
handle: wn,
|
|
946
941
|
priority: R.ITALIC_DOUBLE_UNDERSCORE
|
|
947
942
|
},
|
|
948
943
|
optionKey: "italic"
|
|
@@ -950,7 +945,7 @@ $$` : `${e}$$`;
|
|
|
950
945
|
{
|
|
951
946
|
handler: {
|
|
952
947
|
name: "italicSingleAsterisk",
|
|
953
|
-
handle:
|
|
948
|
+
handle: Dn,
|
|
954
949
|
priority: R.ITALIC_SINGLE_ASTERISK
|
|
955
950
|
},
|
|
956
951
|
optionKey: "italic"
|
|
@@ -958,7 +953,7 @@ $$` : `${e}$$`;
|
|
|
958
953
|
{
|
|
959
954
|
handler: {
|
|
960
955
|
name: "italicSingleUnderscore",
|
|
961
|
-
handle:
|
|
956
|
+
handle: jn,
|
|
962
957
|
priority: R.ITALIC_SINGLE_UNDERSCORE
|
|
963
958
|
},
|
|
964
959
|
optionKey: "italic"
|
|
@@ -966,7 +961,7 @@ $$` : `${e}$$`;
|
|
|
966
961
|
{
|
|
967
962
|
handler: {
|
|
968
963
|
name: "inlineCode",
|
|
969
|
-
handle:
|
|
964
|
+
handle: Bn,
|
|
970
965
|
priority: R.INLINE_CODE
|
|
971
966
|
},
|
|
972
967
|
optionKey: "inlineCode"
|
|
@@ -974,7 +969,7 @@ $$` : `${e}$$`;
|
|
|
974
969
|
{
|
|
975
970
|
handler: {
|
|
976
971
|
name: "strikethrough",
|
|
977
|
-
handle:
|
|
972
|
+
handle: sr,
|
|
978
973
|
priority: R.STRIKETHROUGH
|
|
979
974
|
},
|
|
980
975
|
optionKey: "strikethrough"
|
|
@@ -982,7 +977,7 @@ $$` : `${e}$$`;
|
|
|
982
977
|
{
|
|
983
978
|
handler: {
|
|
984
979
|
name: "katex",
|
|
985
|
-
handle:
|
|
980
|
+
handle: Wn,
|
|
986
981
|
priority: R.KATEX
|
|
987
982
|
},
|
|
988
983
|
optionKey: "katex"
|
|
@@ -990,36 +985,36 @@ $$` : `${e}$$`;
|
|
|
990
985
|
{
|
|
991
986
|
handler: {
|
|
992
987
|
name: "inlineKatex",
|
|
993
|
-
handle:
|
|
988
|
+
handle: Gn,
|
|
994
989
|
priority: R.INLINE_KATEX
|
|
995
990
|
},
|
|
996
991
|
optionKey: "inlineKatex"
|
|
997
992
|
}
|
|
998
|
-
],
|
|
993
|
+
], dr = (e) => {
|
|
999
994
|
let t = e?.linkMode ?? "protocol";
|
|
1000
|
-
return
|
|
1001
|
-
handler:
|
|
995
|
+
return ur.filter(({ handler: t, optionKey: n }) => t.name === "links" ? cr(e?.links) || cr(e?.images) : t.name === "inlineKatex" ? lr(e?.inlineKatex) : cr(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
|
|
996
|
+
handler: ut(lt({}, e), { handle: (e) => Qn(e, t) }),
|
|
1002
997
|
earlyReturn: t === "protocol" ? n : void 0
|
|
1003
998
|
} : {
|
|
1004
999
|
handler: e,
|
|
1005
1000
|
earlyReturn: n
|
|
1006
1001
|
});
|
|
1007
|
-
},
|
|
1002
|
+
}, fr = (e, t) => {
|
|
1008
1003
|
if (!e || typeof e != "string") return e;
|
|
1009
|
-
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r =
|
|
1010
|
-
handler:
|
|
1004
|
+
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = dr(t), i = (t?.handlers ?? []).map((e) => ({
|
|
1005
|
+
handler: ut(lt({}, e), { priority: e.priority ?? R.DEFAULT }),
|
|
1011
1006
|
earlyReturn: void 0
|
|
1012
1007
|
})), a = [...r, ...i].sort((e, t) => (e.handler.priority ?? 0) - (t.handler.priority ?? 0));
|
|
1013
1008
|
try {
|
|
1014
1009
|
for (let { handler: e, earlyReturn: t } of a) if (n = e.handle(n), t != null && t(n)) return n;
|
|
1015
1010
|
return n.endsWith(" ") && !n.endsWith(" ") ? n.slice(0, -1) : n;
|
|
1016
1011
|
} finally {
|
|
1017
|
-
|
|
1012
|
+
Et();
|
|
1018
1013
|
}
|
|
1019
1014
|
};
|
|
1020
1015
|
//#endregion
|
|
1021
1016
|
//#region ../../node_modules/.pnpm/marked@18.1.1/node_modules/marked/lib/marked.esm.js
|
|
1022
|
-
function
|
|
1017
|
+
function pr() {
|
|
1023
1018
|
return {
|
|
1024
1019
|
async: !1,
|
|
1025
1020
|
breaks: !1,
|
|
@@ -1033,12 +1028,12 @@ function fr() {
|
|
|
1033
1028
|
walkTokens: null
|
|
1034
1029
|
};
|
|
1035
1030
|
}
|
|
1036
|
-
var
|
|
1037
|
-
function
|
|
1038
|
-
|
|
1031
|
+
var mr = pr();
|
|
1032
|
+
function hr(e) {
|
|
1033
|
+
mr = e;
|
|
1039
1034
|
}
|
|
1040
|
-
var
|
|
1041
|
-
function
|
|
1035
|
+
var gr = { exec: () => null };
|
|
1036
|
+
function _r(e) {
|
|
1042
1037
|
let t = [];
|
|
1043
1038
|
return (n) => {
|
|
1044
1039
|
let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
|
|
@@ -1055,7 +1050,7 @@ function z(e, t = "") {
|
|
|
1055
1050
|
};
|
|
1056
1051
|
return r;
|
|
1057
1052
|
}
|
|
1058
|
-
var
|
|
1053
|
+
var vr = ((e = "") => {
|
|
1059
1054
|
try {
|
|
1060
1055
|
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
1061
1056
|
} catch {
|
|
@@ -1116,113 +1111,113 @@ var _r = ((e = "") => {
|
|
|
1116
1111
|
notSpaceStart: /^\S*/,
|
|
1117
1112
|
endingNewline: /\n$/,
|
|
1118
1113
|
listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
1119
|
-
nextBulletRegex:
|
|
1120
|
-
hrRegex:
|
|
1121
|
-
fencesBeginRegex:
|
|
1122
|
-
headingBeginRegex:
|
|
1123
|
-
htmlBeginRegex:
|
|
1124
|
-
blockquoteBeginRegex:
|
|
1125
|
-
},
|
|
1126
|
-
blockquote: z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",
|
|
1127
|
-
code:
|
|
1128
|
-
def:
|
|
1129
|
-
fences:
|
|
1130
|
-
heading:
|
|
1131
|
-
hr:
|
|
1132
|
-
html:
|
|
1133
|
-
lheading: Tr,
|
|
1134
|
-
list: jr,
|
|
1135
|
-
newline: vr,
|
|
1136
|
-
paragraph: Ir,
|
|
1137
|
-
table: hr,
|
|
1138
|
-
text: Or
|
|
1139
|
-
}, zr = z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", xr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Mr).getRegex(), Br = {
|
|
1140
|
-
...Rr,
|
|
1114
|
+
nextBulletRegex: _r((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
|
|
1115
|
+
hrRegex: _r((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
|
|
1116
|
+
fencesBeginRegex: _r((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
|
|
1117
|
+
headingBeginRegex: _r((e) => RegExp(`^ {0,${e}}#`)),
|
|
1118
|
+
htmlBeginRegex: _r((e) => RegExp(`^ {0,${e}}(?:</?(?:${Nr})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
|
|
1119
|
+
blockquoteBeginRegex: _r((e) => RegExp(`^ {0,${e}}>`))
|
|
1120
|
+
}, yr = /^(?:[ \t]*(?:\n|$))+/, br = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, xr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Sr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Cr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, wr = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Tr = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Er = z(Tr).replace(/bull/g, wr).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Dr = z(Tr).replace(/bull/g, wr).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Or = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, kr = /^[^\n]+/, Ar = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, jr = z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Ar).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Mr = z(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, wr).getRegex(), Nr = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Pr = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Fr = z("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Pr).replace("tag", Nr).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Ir = (e) => z(Or).replace("hr", Sr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Nr).getRegex(), Lr = Ir(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Rr = Ir(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), zr = {
|
|
1121
|
+
blockquote: z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Rr).getRegex(),
|
|
1122
|
+
code: br,
|
|
1123
|
+
def: jr,
|
|
1124
|
+
fences: xr,
|
|
1125
|
+
heading: Cr,
|
|
1126
|
+
hr: Sr,
|
|
1127
|
+
html: Fr,
|
|
1141
1128
|
lheading: Er,
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1129
|
+
list: Mr,
|
|
1130
|
+
newline: yr,
|
|
1131
|
+
paragraph: Lr,
|
|
1132
|
+
table: gr,
|
|
1133
|
+
text: kr
|
|
1134
|
+
}, Br = z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Sr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Nr).getRegex(), Vr = {
|
|
1135
|
+
...zr,
|
|
1136
|
+
lheading: Dr,
|
|
1137
|
+
table: Br,
|
|
1138
|
+
paragraph: z(Or).replace("hr", Sr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Br).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Nr).getRegex()
|
|
1139
|
+
}, Hr = {
|
|
1140
|
+
...zr,
|
|
1141
|
+
html: z("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Pr).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
1147
1142
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
1148
1143
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
1149
|
-
fences:
|
|
1144
|
+
fences: gr,
|
|
1150
1145
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
1151
|
-
paragraph: z(
|
|
1152
|
-
},
|
|
1153
|
-
_backpedal:
|
|
1154
|
-
anyPunctuation:
|
|
1155
|
-
anyPunctuationOutsideCode:
|
|
1156
|
-
autolink:
|
|
1157
|
-
blockSkip:
|
|
1158
|
-
br:
|
|
1159
|
-
code:
|
|
1160
|
-
del:
|
|
1161
|
-
delLDelim:
|
|
1162
|
-
delRDelim:
|
|
1163
|
-
emStrongLDelim:
|
|
1164
|
-
emStrongRDelimAst:
|
|
1165
|
-
emStrongRDelimUnd: li,
|
|
1166
|
-
escape: Hr,
|
|
1167
|
-
link: bi,
|
|
1168
|
-
nolink: Si,
|
|
1169
|
-
punctuation: Yr,
|
|
1170
|
-
reflink: xi,
|
|
1171
|
-
reflinkSearch: Ti,
|
|
1172
|
-
tag: _i,
|
|
1173
|
-
text: Gr,
|
|
1174
|
-
url: hr
|
|
1175
|
-
}, ki = {
|
|
1176
|
-
...Oi,
|
|
1177
|
-
emStrongLDelim: ii,
|
|
1178
|
-
emStrongRDelimAst: ci,
|
|
1146
|
+
paragraph: z(Or).replace("hr", Sr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Er).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
1147
|
+
}, Ur = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Wr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Gr = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, Kr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, qr = /[\p{P}\p{S}]/u, Jr = /[\s\p{P}\p{S}]/u, Yr = /[^\s\p{P}\p{S}]/u, Xr = z(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Jr).getRegex(), Zr = /[\p{Pi}\p{Ps}"']/u, Qr = /(?!~)[\p{P}\p{S}]/u, $r = /(?!~)[\s\p{P}\p{S}]/u, ei = /(?:[^\s\p{P}\p{S}]|~)/u, ti = z(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", vr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ni = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ri = z(ni, "u").replace(/punct/g, qr).getRegex(), ii = z(ni, "u").replace(/punct/g, Qr).getRegex(), ai = z(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Zr).replace(/punct/g, qr).getRegex(), oi = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", si = z(oi, "gu").replace(/notPunctSpace/g, Yr).replace(/punctSpace/g, Jr).replace(/punct/g, qr).getRegex(), ci = z(oi, "gu").replace(/notPunctSpace/g, ei).replace(/punctSpace/g, $r).replace(/punct/g, Qr).getRegex(), li = z("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Yr).replace(/punctSpace/g, Jr).replace(/punct/g, qr).getRegex(), ui = z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Yr).replace(/punctSpace/g, Jr).replace(/punct/g, qr).getRegex(), di = z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Yr).replace(/punctSpace/g, Jr).replace(/punct/g, qr).getRegex(), fi = z(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, qr).getRegex(), pi = z("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Yr).replace(/punctSpace/g, Jr).replace(/punct/g, qr).getRegex(), mi = z(/\\(punct)/, "gu").replace(/punct/g, qr).getRegex(), hi = z(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, qr).getRegex(), gi = z(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), _i = z(Pr).replace("(?:-->|$)", "-->").getRegex(), vi = z("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", _i).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), yi = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, bi = z(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", yi).getRegex(), xi = z(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", bi).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Si = z(/^!?\[(label)\]\[(ref)\]/).replace("label", bi).replace("ref", Ar).getRegex(), Ci = z(/^!?\[(ref)\](?:\[\])?/).replace("ref", Ar).getRegex(), wi = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, Ti = z(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", yi).getRegex(), Ei = z("reflink|nolink(?!\\()", "g").replace("reflink", z(/^!?\[(label)\]\[(ref)\]/).replace("label", Ti).replace("ref", wi).getRegex()).replace("nolink", z(/^!?\[(ref)\](?:\[\])?/).replace("ref", wi).getRegex()).getRegex(), Di = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Oi = z(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), ki = {
|
|
1148
|
+
_backpedal: gr,
|
|
1149
|
+
anyPunctuation: mi,
|
|
1150
|
+
anyPunctuationOutsideCode: hi,
|
|
1151
|
+
autolink: gi,
|
|
1152
|
+
blockSkip: ti,
|
|
1153
|
+
br: Gr,
|
|
1154
|
+
code: Wr,
|
|
1155
|
+
del: gr,
|
|
1156
|
+
delLDelim: gr,
|
|
1157
|
+
delRDelim: gr,
|
|
1158
|
+
emStrongLDelim: ri,
|
|
1159
|
+
emStrongRDelimAst: si,
|
|
1179
1160
|
emStrongRDelimUnd: ui,
|
|
1180
|
-
|
|
1181
|
-
|
|
1161
|
+
escape: Ur,
|
|
1162
|
+
link: xi,
|
|
1163
|
+
nolink: Ci,
|
|
1164
|
+
punctuation: Xr,
|
|
1165
|
+
reflink: Si,
|
|
1166
|
+
reflinkSearch: Ei,
|
|
1167
|
+
tag: vi,
|
|
1168
|
+
text: Kr,
|
|
1169
|
+
url: gr
|
|
1182
1170
|
}, Ai = {
|
|
1183
|
-
...
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1171
|
+
...ki,
|
|
1172
|
+
emStrongLDelim: ai,
|
|
1173
|
+
emStrongRDelimAst: li,
|
|
1174
|
+
emStrongRDelimUnd: di,
|
|
1175
|
+
link: z(/^!?\[(label)\]\((.*?)\)/).replace("label", bi).getRegex(),
|
|
1176
|
+
reflink: z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", bi).getRegex()
|
|
1177
|
+
}, ji = {
|
|
1178
|
+
...ki,
|
|
1179
|
+
emStrongRDelimAst: ci,
|
|
1180
|
+
emStrongLDelim: ii,
|
|
1181
|
+
delLDelim: fi,
|
|
1182
|
+
delRDelim: pi,
|
|
1183
|
+
url: z(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", Oi).replace("protocol", Di).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
|
|
1189
1184
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1190
1185
|
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
1191
|
-
text: z(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",
|
|
1192
|
-
}, ji = {
|
|
1193
|
-
...Ai,
|
|
1194
|
-
br: z(Wr).replace("{2,}", "*").getRegex(),
|
|
1195
|
-
text: z(Ai.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
1186
|
+
text: z(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", Di).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
|
|
1196
1187
|
}, Mi = {
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1188
|
+
...ji,
|
|
1189
|
+
br: z(Gr).replace("{2,}", "*").getRegex(),
|
|
1190
|
+
text: z(ji.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
1200
1191
|
}, Ni = {
|
|
1201
|
-
normal:
|
|
1202
|
-
gfm:
|
|
1203
|
-
|
|
1204
|
-
pedantic: ki
|
|
1192
|
+
normal: zr,
|
|
1193
|
+
gfm: Vr,
|
|
1194
|
+
pedantic: Hr
|
|
1205
1195
|
}, Pi = {
|
|
1196
|
+
normal: ki,
|
|
1197
|
+
gfm: ji,
|
|
1198
|
+
breaks: Mi,
|
|
1199
|
+
pedantic: Ai
|
|
1200
|
+
}, Fi = {
|
|
1206
1201
|
"&": "&",
|
|
1207
1202
|
"<": "<",
|
|
1208
1203
|
">": ">",
|
|
1209
1204
|
"\"": """,
|
|
1210
1205
|
"'": "'"
|
|
1211
|
-
},
|
|
1206
|
+
}, Ii = (e) => Fi[e];
|
|
1212
1207
|
function V(e, t) {
|
|
1213
1208
|
if (t) {
|
|
1214
|
-
if (B.escapeTest.test(e)) return e.replace(B.escapeReplace,
|
|
1215
|
-
} else if (B.escapeTestNoEncode.test(e)) return e.replace(B.escapeReplaceNoEncode,
|
|
1209
|
+
if (B.escapeTest.test(e)) return e.replace(B.escapeReplace, Ii);
|
|
1210
|
+
} else if (B.escapeTestNoEncode.test(e)) return e.replace(B.escapeReplaceNoEncode, Ii);
|
|
1216
1211
|
return e;
|
|
1217
1212
|
}
|
|
1218
|
-
function
|
|
1213
|
+
function Li(e) {
|
|
1219
1214
|
return B.numericCharacterReference.test(e) ? e.replace(B.numericCharacterReferenceOrAmpersand, (e, t, n) => {
|
|
1220
1215
|
if (t === void 0 && n === void 0) return "&";
|
|
1221
1216
|
let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
|
|
1222
1217
|
return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : r === 38 ? "&" : String.fromCodePoint(r);
|
|
1223
1218
|
}) : e;
|
|
1224
1219
|
}
|
|
1225
|
-
function
|
|
1220
|
+
function Ri(e) {
|
|
1226
1221
|
try {
|
|
1227
1222
|
e = encodeURI(e).replace(B.percentDecode, "%");
|
|
1228
1223
|
} catch {
|
|
@@ -1230,7 +1225,7 @@ function Li(e) {
|
|
|
1230
1225
|
}
|
|
1231
1226
|
return e;
|
|
1232
1227
|
}
|
|
1233
|
-
function
|
|
1228
|
+
function zi(e, t) {
|
|
1234
1229
|
let n = e.replace(B.findPipe, (e, t, n) => {
|
|
1235
1230
|
let r = !1, i = t;
|
|
1236
1231
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
@@ -1243,7 +1238,7 @@ function Ri(e, t) {
|
|
|
1243
1238
|
for (; r < n.length; r++) n[r] = n[r].trim().replace(B.slashPipe, "|");
|
|
1244
1239
|
return n;
|
|
1245
1240
|
}
|
|
1246
|
-
function
|
|
1241
|
+
function Bi(e, t, n) {
|
|
1247
1242
|
let r = e.length;
|
|
1248
1243
|
if (r === 0) return "";
|
|
1249
1244
|
let i = 0;
|
|
@@ -1255,15 +1250,15 @@ function zi(e, t, n) {
|
|
|
1255
1250
|
}
|
|
1256
1251
|
return e.slice(0, r - i);
|
|
1257
1252
|
}
|
|
1258
|
-
function
|
|
1253
|
+
function Vi(e) {
|
|
1259
1254
|
let t = e.split("\n"), n = t.length - 1;
|
|
1260
1255
|
for (; n >= 0 && B.blankLine.test(t[n]);) n--;
|
|
1261
1256
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
1262
1257
|
}
|
|
1263
|
-
function
|
|
1258
|
+
function Hi(e) {
|
|
1264
1259
|
return e.trim().toLowerCase().toUpperCase().toLowerCase();
|
|
1265
1260
|
}
|
|
1266
|
-
function
|
|
1261
|
+
function Ui(e, t) {
|
|
1267
1262
|
if (e.indexOf(t[0]) === -1 && e.indexOf(t[1]) === -1) return -1;
|
|
1268
1263
|
let n = 0;
|
|
1269
1264
|
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
@@ -1271,7 +1266,7 @@ function Hi(e, t) {
|
|
|
1271
1266
|
else if (e[r] === t[1] && (n--, n < 0)) return r;
|
|
1272
1267
|
return n > 0 ? -2 : -1;
|
|
1273
1268
|
}
|
|
1274
|
-
function
|
|
1269
|
+
function Wi(e, t = 0) {
|
|
1275
1270
|
let n = t, r = "";
|
|
1276
1271
|
for (let t of e) if (t === " ") {
|
|
1277
1272
|
let e = 4 - n % 4;
|
|
@@ -1279,7 +1274,7 @@ function Ui(e, t = 0) {
|
|
|
1279
1274
|
} else r += t, n++;
|
|
1280
1275
|
return r;
|
|
1281
1276
|
}
|
|
1282
|
-
function
|
|
1277
|
+
function Gi(e, t, n, r, i) {
|
|
1283
1278
|
let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!", l = r.state.inLink, u = r.state.linkEmitted, d = r.state.inRawBlock;
|
|
1284
1279
|
r.state.inLink = !0, r.state.linkEmitted = !1;
|
|
1285
1280
|
let f = r.inlineTokens(s), p = r.state.linkEmitted;
|
|
@@ -1299,7 +1294,7 @@ function Wi(e, t, n, r, i) {
|
|
|
1299
1294
|
tokens: f
|
|
1300
1295
|
};
|
|
1301
1296
|
}
|
|
1302
|
-
function
|
|
1297
|
+
function Ki(e, t, n) {
|
|
1303
1298
|
let r = e.match(n.other.indentCodeCompensation);
|
|
1304
1299
|
if (r === null) return t;
|
|
1305
1300
|
let i = r[1];
|
|
@@ -1310,7 +1305,7 @@ function Gi(e, t, n) {
|
|
|
1310
1305
|
return e.slice(Math.min(r.length, i.length));
|
|
1311
1306
|
}).join("\n");
|
|
1312
1307
|
}
|
|
1313
|
-
function
|
|
1308
|
+
function qi(e, t, n, r) {
|
|
1314
1309
|
if (!t.includes("<")) return !1;
|
|
1315
1310
|
for (let i = 0; i < t.length; i++) {
|
|
1316
1311
|
if (t[i] === "\\") {
|
|
@@ -1333,12 +1328,12 @@ function Ki(e, t, n, r) {
|
|
|
1333
1328
|
}
|
|
1334
1329
|
return !1;
|
|
1335
1330
|
}
|
|
1336
|
-
var
|
|
1331
|
+
var Ji = class {
|
|
1337
1332
|
options;
|
|
1338
1333
|
rules;
|
|
1339
1334
|
lexer;
|
|
1340
1335
|
constructor(e) {
|
|
1341
|
-
this.options = e ||
|
|
1336
|
+
this.options = e || mr;
|
|
1342
1337
|
}
|
|
1343
1338
|
space(e) {
|
|
1344
1339
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -1350,7 +1345,7 @@ var qi = class {
|
|
|
1350
1345
|
code(e) {
|
|
1351
1346
|
let t = this.rules.block.code.exec(e);
|
|
1352
1347
|
if (t) {
|
|
1353
|
-
let e = this.options.pedantic ? t[0] :
|
|
1348
|
+
let e = this.options.pedantic ? t[0] : Vi(t[0]);
|
|
1354
1349
|
return {
|
|
1355
1350
|
type: "code",
|
|
1356
1351
|
raw: e,
|
|
@@ -1362,7 +1357,7 @@ var qi = class {
|
|
|
1362
1357
|
fences(e) {
|
|
1363
1358
|
let t = this.rules.block.fences.exec(e);
|
|
1364
1359
|
if (t) {
|
|
1365
|
-
let e = t[0], n =
|
|
1360
|
+
let e = t[0], n = Ki(e, t[3] || "", this.rules);
|
|
1366
1361
|
return {
|
|
1367
1362
|
type: "code",
|
|
1368
1363
|
raw: e,
|
|
@@ -1376,12 +1371,12 @@ var qi = class {
|
|
|
1376
1371
|
if (t) {
|
|
1377
1372
|
let e = t[2].trim();
|
|
1378
1373
|
if (this.rules.other.endingHash.test(e)) {
|
|
1379
|
-
let t =
|
|
1374
|
+
let t = Bi(e, "#");
|
|
1380
1375
|
(this.options.pedantic || !t || this.rules.other.endingSpaceTabChar.test(t)) && (e = t.trim());
|
|
1381
1376
|
}
|
|
1382
1377
|
return {
|
|
1383
1378
|
type: "heading",
|
|
1384
|
-
raw:
|
|
1379
|
+
raw: Bi(t[0], "\n"),
|
|
1385
1380
|
depth: t[1].length,
|
|
1386
1381
|
text: e,
|
|
1387
1382
|
tokens: this.lexer.inline(e)
|
|
@@ -1392,13 +1387,13 @@ var qi = class {
|
|
|
1392
1387
|
let t = this.rules.block.hr.exec(e);
|
|
1393
1388
|
if (t) return {
|
|
1394
1389
|
type: "hr",
|
|
1395
|
-
raw:
|
|
1390
|
+
raw: Bi(t[0], "\n")
|
|
1396
1391
|
};
|
|
1397
1392
|
}
|
|
1398
1393
|
blockquote(e) {
|
|
1399
1394
|
let t = this.rules.block.blockquote.exec(e);
|
|
1400
1395
|
if (t) {
|
|
1401
|
-
let e =
|
|
1396
|
+
let e = Bi(t[0], "\n").split("\n"), n = "", r = "", i = [];
|
|
1402
1397
|
for (; e.length > 0;) {
|
|
1403
1398
|
let t = !1, a = [], o = 0;
|
|
1404
1399
|
for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
|
|
@@ -1452,12 +1447,12 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1452
1447
|
if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
1453
1448
|
let l = r();
|
|
1454
1449
|
e = e.substring(t[0].length);
|
|
1455
|
-
let u = t[2].split("\n", 1)[0], d = t[1].length, f = this.options.pedantic ?
|
|
1450
|
+
let u = t[2].split("\n", 1)[0], d = t[1].length, f = this.options.pedantic ? Wi(u, d) : u.replace(this.rules.other.leadingSpaceTab, (e) => Wi(e, d)), p = e.split("\n", 1)[0], ee = !f.trim(), m = 0;
|
|
1456
1451
|
if (this.options.pedantic ? (m = 2, a = f.trimStart()) : ee ? m = d + 1 : (m = f.search(this.rules.other.nonSpaceChar), m = m > 4 ? 1 : m, a = f.slice(m), m += d), ee && this.rules.other.blankLine.test(p) && (e = e.substring(p.length + 1), i = !0), !i) {
|
|
1457
1452
|
let t = this.rules.other.nextBulletRegex(m), n = this.rules.other.hrRegex(m), r = this.rules.other.fencesBeginRegex(m), i = this.rules.other.headingBeginRegex(m), o = this.rules.other.htmlBeginRegex(m), s = this.rules.other.blockquoteBeginRegex(m);
|
|
1458
1453
|
for (; e;) {
|
|
1459
1454
|
let c = e.split("\n", 1)[0], l;
|
|
1460
|
-
if (p = c, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), l = p) : l = p.replace(this.rules.other.leadingSpaceTab, (e) =>
|
|
1455
|
+
if (p = c, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), l = p) : l = p.replace(this.rules.other.leadingSpaceTab, (e) => Wi(e)), r.test(p) || i.test(p) || o.test(p) || s.test(p) || t.test(p) || n.test(p)) break;
|
|
1461
1456
|
if (l.search(this.rules.other.nonSpaceChar) >= m || !p.trim()) a += "\n" + l.slice(m);
|
|
1462
1457
|
else {
|
|
1463
1458
|
if (ee || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || r.test(f) || i.test(f) || n.test(f)) break;
|
|
@@ -1518,7 +1513,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1518
1513
|
html(e) {
|
|
1519
1514
|
let t = this.rules.block.html.exec(e);
|
|
1520
1515
|
if (t) {
|
|
1521
|
-
let e =
|
|
1516
|
+
let e = Vi(t[0]);
|
|
1522
1517
|
return {
|
|
1523
1518
|
type: "html",
|
|
1524
1519
|
block: !0,
|
|
@@ -1531,12 +1526,12 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1531
1526
|
def(e) {
|
|
1532
1527
|
let t = this.rules.block.def.exec(e);
|
|
1533
1528
|
if (t) {
|
|
1534
|
-
if (!this.rules.other.startAngleBracket.test(t[2]) &&
|
|
1535
|
-
let e =
|
|
1529
|
+
if (!this.rules.other.startAngleBracket.test(t[2]) && Ui(t[2], "()") !== -1) return;
|
|
1530
|
+
let e = Hi(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
|
|
1536
1531
|
return {
|
|
1537
1532
|
type: "def",
|
|
1538
1533
|
tag: e,
|
|
1539
|
-
raw:
|
|
1534
|
+
raw: Bi(t[0], "\n"),
|
|
1540
1535
|
href: n,
|
|
1541
1536
|
title: r
|
|
1542
1537
|
};
|
|
@@ -1545,9 +1540,9 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1545
1540
|
table(e) {
|
|
1546
1541
|
let t = this.rules.block.table.exec(e);
|
|
1547
1542
|
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
1548
|
-
let n =
|
|
1543
|
+
let n = zi(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
|
|
1549
1544
|
type: "table",
|
|
1550
|
-
raw:
|
|
1545
|
+
raw: Bi(t[0], "\n"),
|
|
1551
1546
|
header: [],
|
|
1552
1547
|
align: [],
|
|
1553
1548
|
rows: []
|
|
@@ -1560,7 +1555,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1560
1555
|
header: !0,
|
|
1561
1556
|
align: a.align[e]
|
|
1562
1557
|
});
|
|
1563
|
-
for (let e of i) a.rows.push(
|
|
1558
|
+
for (let e of i) a.rows.push(zi(e, a.header.length).map((e, t) => ({
|
|
1564
1559
|
text: e,
|
|
1565
1560
|
tokens: this.lexer.inline(e),
|
|
1566
1561
|
header: !1,
|
|
@@ -1575,7 +1570,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1575
1570
|
let e = t[1].trim();
|
|
1576
1571
|
return {
|
|
1577
1572
|
type: "heading",
|
|
1578
|
-
raw:
|
|
1573
|
+
raw: Bi(t[0], "\n"),
|
|
1579
1574
|
depth: t[2].charAt(0) === "=" ? 1 : 2,
|
|
1580
1575
|
text: e,
|
|
1581
1576
|
tokens: this.lexer.inline(e)
|
|
@@ -1627,14 +1622,14 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1627
1622
|
let t = this.rules.inline.link.exec(e);
|
|
1628
1623
|
if (t) {
|
|
1629
1624
|
let n = t[0].charAt(0) === "!" ? 2 : 1;
|
|
1630
|
-
if (!this.options.pedantic &&
|
|
1625
|
+
if (!this.options.pedantic && qi(e, t[1], n, this.rules)) return;
|
|
1631
1626
|
let r = t[2].trim();
|
|
1632
1627
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
|
|
1633
1628
|
if (!this.rules.other.endAngleBracket.test(r)) return;
|
|
1634
|
-
let e =
|
|
1629
|
+
let e = Bi(r.slice(0, -1), "\\");
|
|
1635
1630
|
if ((r.length - e.length) % 2 == 0) return;
|
|
1636
1631
|
} else {
|
|
1637
|
-
let e =
|
|
1632
|
+
let e = Ui(t[2], "()");
|
|
1638
1633
|
if (e === -2) return;
|
|
1639
1634
|
if (e > -1) {
|
|
1640
1635
|
let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
|
|
@@ -1646,7 +1641,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1646
1641
|
let e = this.rules.other.pedanticHrefTitle.exec(i);
|
|
1647
1642
|
e && (i = e[1], a = e[3]);
|
|
1648
1643
|
} else a = t[3] ? t[3].slice(1, -1) : "";
|
|
1649
|
-
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (i = this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i.slice(1) : i.slice(1, -1)),
|
|
1644
|
+
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (i = this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i.slice(1) : i.slice(1, -1)), Gi(t, {
|
|
1650
1645
|
href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
1651
1646
|
title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
|
|
1652
1647
|
}, t[0], this.lexer, this.rules);
|
|
@@ -1656,8 +1651,8 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1656
1651
|
let n;
|
|
1657
1652
|
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
1658
1653
|
let r = n[0].charAt(0) === "!" ? 2 : 1;
|
|
1659
|
-
if (!this.options.pedantic &&
|
|
1660
|
-
let i = t[
|
|
1654
|
+
if (!this.options.pedantic && qi(e, n[1], r, this.rules)) return;
|
|
1655
|
+
let i = t[Hi((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
|
|
1661
1656
|
if (!i) {
|
|
1662
1657
|
let e = n[0].charAt(0);
|
|
1663
1658
|
return {
|
|
@@ -1666,7 +1661,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1666
1661
|
text: e
|
|
1667
1662
|
};
|
|
1668
1663
|
}
|
|
1669
|
-
return
|
|
1664
|
+
return Gi(n, i, n[0], this.lexer, this.rules);
|
|
1670
1665
|
}
|
|
1671
1666
|
}
|
|
1672
1667
|
emStrong(e, t, n = "") {
|
|
@@ -1799,7 +1794,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1799
1794
|
return {
|
|
1800
1795
|
type: "text",
|
|
1801
1796
|
raw: t[0],
|
|
1802
|
-
text: e ? t[0] :
|
|
1797
|
+
text: e ? t[0] : Li(t[0]),
|
|
1803
1798
|
escaped: e
|
|
1804
1799
|
};
|
|
1805
1800
|
}
|
|
@@ -1811,7 +1806,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1811
1806
|
inlineQueue;
|
|
1812
1807
|
tokenizer;
|
|
1813
1808
|
constructor(e) {
|
|
1814
|
-
this.tokens = [], this.tokens.links = Object.create(null), this.options = e ||
|
|
1809
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || mr, this.options.tokenizer = this.options.tokenizer || new Ji(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
1815
1810
|
inLink: !1,
|
|
1816
1811
|
inRawBlock: !1,
|
|
1817
1812
|
linkEmitted: !1,
|
|
@@ -1820,15 +1815,15 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1820
1815
|
};
|
|
1821
1816
|
let t = {
|
|
1822
1817
|
other: B,
|
|
1823
|
-
block:
|
|
1824
|
-
inline:
|
|
1818
|
+
block: Ni.normal,
|
|
1819
|
+
inline: Pi.normal
|
|
1825
1820
|
};
|
|
1826
|
-
this.options.pedantic ? (t.block =
|
|
1821
|
+
this.options.pedantic ? (t.block = Ni.pedantic, t.inline = Pi.pedantic) : this.options.gfm && (t.block = Ni.gfm, t.inline = this.options.breaks ? Pi.breaks : Pi.gfm), this.tokenizer.rules = t;
|
|
1827
1822
|
}
|
|
1828
1823
|
static get rules() {
|
|
1829
1824
|
return {
|
|
1830
|
-
block:
|
|
1831
|
-
inline:
|
|
1825
|
+
block: Ni,
|
|
1826
|
+
inline: Pi
|
|
1832
1827
|
};
|
|
1833
1828
|
}
|
|
1834
1829
|
static lex(t, n) {
|
|
@@ -1918,7 +1913,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1918
1913
|
for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
|
|
1919
1914
|
for (let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
|
|
1920
1915
|
let e = t[0], n = e.lastIndexOf("[");
|
|
1921
|
-
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links,
|
|
1916
|
+
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, Hi(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
|
|
1922
1917
|
}
|
|
1923
1918
|
return !1;
|
|
1924
1919
|
}
|
|
@@ -1937,7 +1932,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1937
1932
|
if (this.tokens.links && e.includes("[")) {
|
|
1938
1933
|
let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
|
|
1939
1934
|
let r = n.lastIndexOf("[");
|
|
1940
|
-
if (!Object.hasOwn(this.tokens.links,
|
|
1935
|
+
if (!Object.hasOwn(this.tokens.links, Hi(n.slice(r + 1, -1)))) return n;
|
|
1941
1936
|
if (r > 1 && n.charAt(0) !== "!") {
|
|
1942
1937
|
let i = n.slice(1, r - 1);
|
|
1943
1938
|
if (this.linkInText(i)) return "[" + i.replace(e, t) + "][" + "a".repeat(n.length - r - 2) + "]";
|
|
@@ -1997,11 +1992,11 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1997
1992
|
if (this.options.silent) console.error(t);
|
|
1998
1993
|
else throw Error(t);
|
|
1999
1994
|
}
|
|
2000
|
-
},
|
|
1995
|
+
}, Yi = class {
|
|
2001
1996
|
options;
|
|
2002
1997
|
parser;
|
|
2003
1998
|
constructor(e) {
|
|
2004
|
-
this.options = e ||
|
|
1999
|
+
this.options = e || mr;
|
|
2005
2000
|
}
|
|
2006
2001
|
space(e) {
|
|
2007
2002
|
return "";
|
|
@@ -2087,7 +2082,7 @@ ${e}</tr>
|
|
|
2087
2082
|
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
2088
2083
|
}
|
|
2089
2084
|
link({ href: e, title: t, text: n, tokens: r, autolink: i }) {
|
|
2090
|
-
let a = i ? V(n, !0) : this.parser.parseInline(r), o =
|
|
2085
|
+
let a = i ? V(n, !0) : this.parser.parseInline(r), o = Ri(e);
|
|
2091
2086
|
if (o === null) return a;
|
|
2092
2087
|
e = V(o, i);
|
|
2093
2088
|
let s = "<a href=\"" + e + "\"";
|
|
@@ -2095,7 +2090,7 @@ ${e}</tr>
|
|
|
2095
2090
|
}
|
|
2096
2091
|
image({ href: e, title: t, text: n, tokens: r }) {
|
|
2097
2092
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
2098
|
-
let i =
|
|
2093
|
+
let i = Ri(e);
|
|
2099
2094
|
if (i === null) return V(n);
|
|
2100
2095
|
e = i;
|
|
2101
2096
|
let a = `<img src="${V(e)}" alt="${V(n)}"`;
|
|
@@ -2104,7 +2099,7 @@ ${e}</tr>
|
|
|
2104
2099
|
text(e) {
|
|
2105
2100
|
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : V(e.text);
|
|
2106
2101
|
}
|
|
2107
|
-
},
|
|
2102
|
+
}, Xi = class {
|
|
2108
2103
|
strong({ text: e }) {
|
|
2109
2104
|
return e;
|
|
2110
2105
|
}
|
|
@@ -2140,7 +2135,7 @@ ${e}</tr>
|
|
|
2140
2135
|
renderer;
|
|
2141
2136
|
textRenderer;
|
|
2142
2137
|
constructor(e) {
|
|
2143
|
-
this.options = e ||
|
|
2138
|
+
this.options = e || mr, this.options.renderer = this.options.renderer || new Yi(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Xi();
|
|
2144
2139
|
}
|
|
2145
2140
|
static parse(t, n) {
|
|
2146
2141
|
return new e(n).parse(t);
|
|
@@ -2288,11 +2283,11 @@ ${e}</tr>
|
|
|
2288
2283
|
}
|
|
2289
2284
|
return n;
|
|
2290
2285
|
}
|
|
2291
|
-
},
|
|
2286
|
+
}, Zi = class {
|
|
2292
2287
|
options;
|
|
2293
2288
|
block;
|
|
2294
2289
|
constructor(e) {
|
|
2295
|
-
this.options = e ||
|
|
2290
|
+
this.options = e || mr;
|
|
2296
2291
|
}
|
|
2297
2292
|
static passThroughHooks = /* @__PURE__ */ new Set([
|
|
2298
2293
|
"preprocess",
|
|
@@ -2324,44 +2319,44 @@ ${e}</tr>
|
|
|
2324
2319
|
return e ? U.parse : U.parseInline;
|
|
2325
2320
|
}
|
|
2326
2321
|
};
|
|
2327
|
-
function
|
|
2322
|
+
function Qi(e, t) {
|
|
2328
2323
|
if (Array.isArray(t)) for (let n = 0; n < t.length; n++) e.push(t[n]);
|
|
2329
2324
|
else e.push(t);
|
|
2330
2325
|
}
|
|
2331
|
-
var
|
|
2332
|
-
defaults =
|
|
2326
|
+
var $i = new class {
|
|
2327
|
+
defaults = pr();
|
|
2333
2328
|
options = this.setOptions;
|
|
2334
2329
|
parse = this.parseMarkdown(!0);
|
|
2335
2330
|
parseInline = this.parseMarkdown(!1);
|
|
2336
2331
|
Parser = U;
|
|
2337
|
-
Renderer =
|
|
2338
|
-
TextRenderer =
|
|
2332
|
+
Renderer = Yi;
|
|
2333
|
+
TextRenderer = Xi;
|
|
2339
2334
|
Lexer = H;
|
|
2340
|
-
Tokenizer =
|
|
2341
|
-
Hooks =
|
|
2335
|
+
Tokenizer = Ji;
|
|
2336
|
+
Hooks = Zi;
|
|
2342
2337
|
constructor(...e) {
|
|
2343
2338
|
this.use(...e);
|
|
2344
2339
|
}
|
|
2345
2340
|
walkTokens(e, t) {
|
|
2346
2341
|
let n = [];
|
|
2347
|
-
for (let r of e) switch (
|
|
2342
|
+
for (let r of e) switch (Qi(n, t.call(this, r)), r.type) {
|
|
2348
2343
|
case "table": {
|
|
2349
2344
|
let e = r;
|
|
2350
|
-
for (let r of e.header)
|
|
2351
|
-
for (let r of e.rows) for (let e of r)
|
|
2345
|
+
for (let r of e.header) Qi(n, this.walkTokens(r.tokens, t));
|
|
2346
|
+
for (let r of e.rows) for (let e of r) Qi(n, this.walkTokens(e.tokens, t));
|
|
2352
2347
|
break;
|
|
2353
2348
|
}
|
|
2354
2349
|
case "list": {
|
|
2355
2350
|
let e = r;
|
|
2356
|
-
|
|
2351
|
+
Qi(n, this.walkTokens(e.items, t));
|
|
2357
2352
|
break;
|
|
2358
2353
|
}
|
|
2359
2354
|
default: {
|
|
2360
2355
|
let e = r;
|
|
2361
2356
|
this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
|
|
2362
2357
|
let i = e[r].flat(1 / 0);
|
|
2363
|
-
|
|
2364
|
-
}) : e.tokens &&
|
|
2358
|
+
Qi(n, this.walkTokens(i, t));
|
|
2359
|
+
}) : e.tokens && Qi(n, this.walkTokens(e.tokens, t));
|
|
2365
2360
|
}
|
|
2366
2361
|
}
|
|
2367
2362
|
return n;
|
|
@@ -2389,7 +2384,7 @@ var Qi = new class {
|
|
|
2389
2384
|
}
|
|
2390
2385
|
"childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
|
|
2391
2386
|
}), n.extensions = t), e.renderer) {
|
|
2392
|
-
let t = this.defaults.renderer || new
|
|
2387
|
+
let t = this.defaults.renderer || new Yi(this.defaults);
|
|
2393
2388
|
for (let n in e.renderer) {
|
|
2394
2389
|
if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
|
|
2395
2390
|
if (["options", "parser"].includes(n)) continue;
|
|
@@ -2402,7 +2397,7 @@ var Qi = new class {
|
|
|
2402
2397
|
n.renderer = t;
|
|
2403
2398
|
}
|
|
2404
2399
|
if (e.tokenizer) {
|
|
2405
|
-
let t = this.defaults.tokenizer || new
|
|
2400
|
+
let t = this.defaults.tokenizer || new Ji(this.defaults);
|
|
2406
2401
|
for (let n in e.tokenizer) {
|
|
2407
2402
|
if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
|
|
2408
2403
|
if ([
|
|
@@ -2419,13 +2414,13 @@ var Qi = new class {
|
|
|
2419
2414
|
n.tokenizer = t;
|
|
2420
2415
|
}
|
|
2421
2416
|
if (e.hooks) {
|
|
2422
|
-
let t = this.defaults.hooks || new
|
|
2417
|
+
let t = this.defaults.hooks || new Zi();
|
|
2423
2418
|
for (let n in e.hooks) {
|
|
2424
2419
|
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
2425
2420
|
if (["options", "block"].includes(n)) continue;
|
|
2426
2421
|
let r = n, i = e.hooks[r], a = t[r];
|
|
2427
|
-
t[r] =
|
|
2428
|
-
if (this.defaults.async &&
|
|
2422
|
+
t[r] = Zi.passThroughHooks.has(n) ? (e) => {
|
|
2423
|
+
if (this.defaults.async && Zi.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
2429
2424
|
let n = await i.call(t, e);
|
|
2430
2425
|
return a.call(t, n);
|
|
2431
2426
|
})();
|
|
@@ -2446,7 +2441,7 @@ var Qi = new class {
|
|
|
2446
2441
|
let t = this.defaults.walkTokens, r = e.walkTokens;
|
|
2447
2442
|
n.walkTokens = function(e) {
|
|
2448
2443
|
let n = [];
|
|
2449
|
-
return n.push(r.call(this, e)), t &&
|
|
2444
|
+
return n.push(r.call(this, e)), t && Qi(n, t.call(this, e)), n;
|
|
2450
2445
|
};
|
|
2451
2446
|
}
|
|
2452
2447
|
this.defaults = {
|
|
@@ -2505,31 +2500,31 @@ var Qi = new class {
|
|
|
2505
2500
|
}
|
|
2506
2501
|
}();
|
|
2507
2502
|
function W(e, t) {
|
|
2508
|
-
return
|
|
2503
|
+
return $i.parse(e, t);
|
|
2509
2504
|
}
|
|
2510
2505
|
W.options = W.setOptions = function(e) {
|
|
2511
|
-
return
|
|
2512
|
-
}, W.getDefaults =
|
|
2513
|
-
function
|
|
2514
|
-
return
|
|
2515
|
-
}
|
|
2516
|
-
W.use =
|
|
2517
|
-
return
|
|
2518
|
-
}, W.parseInline =
|
|
2506
|
+
return $i.setOptions(e), W.defaults = $i.defaults, hr(W.defaults), W;
|
|
2507
|
+
}, W.getDefaults = pr, W.defaults = mr;
|
|
2508
|
+
function ea(...e) {
|
|
2509
|
+
return $i.use(...e), W.defaults = $i.defaults, hr(W.defaults), W;
|
|
2510
|
+
}
|
|
2511
|
+
W.use = ea, W.walkTokens = function(e, t) {
|
|
2512
|
+
return $i.walkTokens(e, t);
|
|
2513
|
+
}, W.parseInline = $i.parseInline, W.Parser = U, W.parser = U.parse, W.Renderer = Yi, W.TextRenderer = Xi, W.Lexer = H, W.lexer = H.lex, W.Tokenizer = Ji, W.Hooks = Zi, W.parse = W, W.options, W.setOptions, W.walkTokens, W.parseInline, U.parse, H.lex;
|
|
2519
2514
|
//#endregion
|
|
2520
2515
|
//#region ../../node_modules/.pnpm/dompurify@3.4.17/node_modules/dompurify/dist/purify.es.mjs
|
|
2521
|
-
function
|
|
2516
|
+
function ta(e, t) {
|
|
2522
2517
|
this.v = e, this.k = t;
|
|
2523
2518
|
}
|
|
2524
|
-
function
|
|
2519
|
+
function na(e, t) {
|
|
2525
2520
|
(t == null || t > e.length) && (t = e.length);
|
|
2526
2521
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
2527
2522
|
return r;
|
|
2528
2523
|
}
|
|
2529
|
-
function
|
|
2524
|
+
function ra(e) {
|
|
2530
2525
|
if (Array.isArray(e)) return e;
|
|
2531
2526
|
}
|
|
2532
|
-
function
|
|
2527
|
+
function ia(e, t) {
|
|
2533
2528
|
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
2534
2529
|
if (n != null) {
|
|
2535
2530
|
var r, i, a, o, s = [], c = !0, l = !1;
|
|
@@ -2550,24 +2545,24 @@ function ra(e, t) {
|
|
|
2550
2545
|
return s;
|
|
2551
2546
|
}
|
|
2552
2547
|
}
|
|
2553
|
-
function
|
|
2548
|
+
function aa() {
|
|
2554
2549
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2555
2550
|
}
|
|
2556
|
-
function aa(e, t) {
|
|
2557
|
-
return na(e) || ra(e, t) || oa(e, t) || ia();
|
|
2558
|
-
}
|
|
2559
2551
|
function oa(e, t) {
|
|
2552
|
+
return ra(e) || ia(e, t) || sa(e, t) || aa();
|
|
2553
|
+
}
|
|
2554
|
+
function sa(e, t) {
|
|
2560
2555
|
if (e) {
|
|
2561
|
-
if (typeof e == "string") return
|
|
2556
|
+
if (typeof e == "string") return na(e, t);
|
|
2562
2557
|
var n = {}.toString.call(e).slice(8, -1);
|
|
2563
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
2558
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? na(e, t) : void 0;
|
|
2564
2559
|
}
|
|
2565
2560
|
}
|
|
2566
|
-
function
|
|
2561
|
+
function ca(e) {
|
|
2567
2562
|
var t, n;
|
|
2568
2563
|
function r(t, n) {
|
|
2569
2564
|
try {
|
|
2570
|
-
var a = e[t](n), o = a.value, s = o instanceof
|
|
2565
|
+
var a = e[t](n), o = a.value, s = o instanceof ta;
|
|
2571
2566
|
Promise.resolve(s ? o.v : o).then(function(n) {
|
|
2572
2567
|
if (s) {
|
|
2573
2568
|
var c = t === "return" && o.k ? t : "next";
|
|
@@ -2601,119 +2596,119 @@ function sa(e) {
|
|
|
2601
2596
|
});
|
|
2602
2597
|
}, typeof e.return != "function" && (this.return = void 0);
|
|
2603
2598
|
}
|
|
2604
|
-
|
|
2599
|
+
ca.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
|
|
2605
2600
|
return this;
|
|
2606
|
-
},
|
|
2601
|
+
}, ca.prototype.next = function(e) {
|
|
2607
2602
|
return this._invoke("next", e);
|
|
2608
|
-
},
|
|
2603
|
+
}, ca.prototype.throw = function(e) {
|
|
2609
2604
|
return this._invoke("throw", e);
|
|
2610
|
-
},
|
|
2605
|
+
}, ca.prototype.return = function(e) {
|
|
2611
2606
|
return this._invoke("return", e);
|
|
2612
2607
|
};
|
|
2613
|
-
var
|
|
2608
|
+
var la = Object.entries, ua = Object.setPrototypeOf, da = Object.isFrozen, fa = Object.getPrototypeOf, pa = Object.getOwnPropertyDescriptor, G = Object.freeze, K = Object.seal, ma = Object.create, ha = typeof Reflect < "u" && Reflect, ga = ha.apply, _a = ha.construct;
|
|
2614
2609
|
G ||= function(e) {
|
|
2615
2610
|
return e;
|
|
2616
2611
|
}, K ||= function(e) {
|
|
2617
2612
|
return e;
|
|
2618
|
-
},
|
|
2613
|
+
}, ga ||= function(e, t) {
|
|
2619
2614
|
var n = [...arguments].slice(2);
|
|
2620
2615
|
return e.apply(t, n);
|
|
2621
|
-
},
|
|
2616
|
+
}, _a ||= function(e) {
|
|
2622
2617
|
return new e(...[...arguments].slice(1));
|
|
2623
2618
|
};
|
|
2624
|
-
var
|
|
2619
|
+
var va = Y(Array.prototype.forEach);
|
|
2625
2620
|
Array.prototype.indexOf;
|
|
2626
|
-
var
|
|
2621
|
+
var ya = Y(Array.prototype.lastIndexOf), ba = Y(Array.prototype.pop), xa = Y(Array.prototype.push), Sa = Y(Array.prototype.slice), Ca = Y(Array.prototype.splice), wa = Array.isArray, Ta = Ba(Set), Ea = Y(Set.prototype.add), Da = Y(Set.prototype.has), Oa = Y(String.prototype.toLowerCase), ka = Y(String.prototype.toString), Aa = Y(String.prototype.match), ja = Y(String.prototype.replace), Ma = Y(String.prototype.indexOf), Na = Y(String.prototype.trim), Pa = Y(Number.prototype.toString), Fa = Y(Boolean.prototype.toString), Ia = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), La = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), Ra = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), za = Ba(TypeError);
|
|
2627
2622
|
function Y(e) {
|
|
2628
2623
|
return function(t) {
|
|
2629
2624
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
2630
2625
|
var n = [...arguments].slice(1);
|
|
2631
|
-
return
|
|
2626
|
+
return ga(e, t, n);
|
|
2632
2627
|
};
|
|
2633
2628
|
}
|
|
2634
|
-
function
|
|
2629
|
+
function Ba(e) {
|
|
2635
2630
|
return function() {
|
|
2636
|
-
return
|
|
2631
|
+
return _a(e, [...arguments]);
|
|
2637
2632
|
};
|
|
2638
2633
|
}
|
|
2639
2634
|
function X(e, t) {
|
|
2640
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
2641
|
-
if (
|
|
2635
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Oa;
|
|
2636
|
+
if (ua && ua(e, null), !wa(t)) return e;
|
|
2642
2637
|
let r = t.length;
|
|
2643
2638
|
for (; r--;) {
|
|
2644
2639
|
let i = t[r];
|
|
2645
2640
|
if (typeof i == "string") {
|
|
2646
2641
|
let e = n(i);
|
|
2647
|
-
e !== i && (
|
|
2642
|
+
e !== i && (da(t) || (t[r] = e), i = e);
|
|
2648
2643
|
}
|
|
2649
2644
|
e[i] = !0;
|
|
2650
2645
|
}
|
|
2651
2646
|
return e;
|
|
2652
2647
|
}
|
|
2653
|
-
function
|
|
2648
|
+
function Va(e) {
|
|
2654
2649
|
for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
|
|
2655
2650
|
return e;
|
|
2656
2651
|
}
|
|
2657
2652
|
function Z(e) {
|
|
2658
|
-
let t =
|
|
2659
|
-
for (let r of
|
|
2660
|
-
var n =
|
|
2653
|
+
let t = ma(null);
|
|
2654
|
+
for (let r of la(e)) {
|
|
2655
|
+
var n = oa(r, 2);
|
|
2661
2656
|
let i = n[0], a = n[1];
|
|
2662
|
-
q(e, i) && (t[i] =
|
|
2657
|
+
q(e, i) && (t[i] = wa(a) ? Va(a) : a && typeof a == "object" && a.constructor === Object ? Z(a) : a);
|
|
2663
2658
|
}
|
|
2664
2659
|
return t;
|
|
2665
2660
|
}
|
|
2666
|
-
function
|
|
2661
|
+
function Ha(e) {
|
|
2667
2662
|
switch (typeof e) {
|
|
2668
2663
|
case "string": return e;
|
|
2669
|
-
case "number": return
|
|
2670
|
-
case "boolean": return
|
|
2671
|
-
case "bigint": return
|
|
2672
|
-
case "symbol": return
|
|
2673
|
-
case "undefined": return
|
|
2664
|
+
case "number": return Pa(e);
|
|
2665
|
+
case "boolean": return Fa(e);
|
|
2666
|
+
case "bigint": return Ia ? Ia(e) : "0";
|
|
2667
|
+
case "symbol": return La ? La(e) : "Symbol()";
|
|
2668
|
+
case "undefined": return Ra(e);
|
|
2674
2669
|
case "function":
|
|
2675
2670
|
case "object": {
|
|
2676
|
-
if (e === null) return
|
|
2671
|
+
if (e === null) return Ra(e);
|
|
2677
2672
|
let t = e, n = Q(t, "toString");
|
|
2678
2673
|
if (typeof n == "function") {
|
|
2679
2674
|
let e = n(t);
|
|
2680
|
-
return typeof e == "string" ? e :
|
|
2675
|
+
return typeof e == "string" ? e : Ra(e);
|
|
2681
2676
|
}
|
|
2682
|
-
return
|
|
2677
|
+
return Ra(e);
|
|
2683
2678
|
}
|
|
2684
|
-
default: return
|
|
2679
|
+
default: return Ra(e);
|
|
2685
2680
|
}
|
|
2686
2681
|
}
|
|
2687
2682
|
function Q(e, t) {
|
|
2688
2683
|
for (; e !== null;) {
|
|
2689
|
-
let n =
|
|
2684
|
+
let n = pa(e, t);
|
|
2690
2685
|
if (n) {
|
|
2691
2686
|
if (n.get) return Y(n.get);
|
|
2692
2687
|
if (typeof n.value == "function") return Y(n.value);
|
|
2693
2688
|
}
|
|
2694
|
-
e =
|
|
2689
|
+
e = fa(e);
|
|
2695
2690
|
}
|
|
2696
2691
|
function n() {
|
|
2697
2692
|
return null;
|
|
2698
2693
|
}
|
|
2699
2694
|
return n;
|
|
2700
2695
|
}
|
|
2701
|
-
function
|
|
2696
|
+
function Ua(e, t) {
|
|
2702
2697
|
for (; e !== null;) {
|
|
2703
|
-
let n =
|
|
2698
|
+
let n = pa(e, t);
|
|
2704
2699
|
if (n) return n.get ? Y(n.get) : null;
|
|
2705
|
-
e =
|
|
2700
|
+
e = fa(e);
|
|
2706
2701
|
}
|
|
2707
2702
|
return null;
|
|
2708
2703
|
}
|
|
2709
|
-
function
|
|
2704
|
+
function Wa(e) {
|
|
2710
2705
|
try {
|
|
2711
2706
|
return J(e, ""), !0;
|
|
2712
2707
|
} catch {
|
|
2713
2708
|
return !1;
|
|
2714
2709
|
}
|
|
2715
2710
|
}
|
|
2716
|
-
var
|
|
2711
|
+
var Ga = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), Ka = G(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), qa = G([
|
|
2717
2712
|
"feBlend",
|
|
2718
2713
|
"feColorMatrix",
|
|
2719
2714
|
"feComponentTransfer",
|
|
@@ -2739,7 +2734,7 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2739
2734
|
"feSpotLight",
|
|
2740
2735
|
"feTile",
|
|
2741
2736
|
"feTurbulence"
|
|
2742
|
-
]),
|
|
2737
|
+
]), Ja = G([
|
|
2743
2738
|
"animate",
|
|
2744
2739
|
"color-profile",
|
|
2745
2740
|
"cursor",
|
|
@@ -2762,7 +2757,7 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2762
2757
|
"solidcolor",
|
|
2763
2758
|
"unknown",
|
|
2764
2759
|
"use"
|
|
2765
|
-
]),
|
|
2760
|
+
]), Ya = G(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Xa = G([
|
|
2766
2761
|
"maction",
|
|
2767
2762
|
"maligngroup",
|
|
2768
2763
|
"malignmark",
|
|
@@ -2778,13 +2773,13 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2778
2773
|
"annotation-xml",
|
|
2779
2774
|
"mprescripts",
|
|
2780
2775
|
"none"
|
|
2781
|
-
]),
|
|
2776
|
+
]), Za = G(["#text"]), Qa = G(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), $a = G(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), eo = G(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), to = G([
|
|
2782
2777
|
"xlink:href",
|
|
2783
2778
|
"xml:id",
|
|
2784
2779
|
"xlink:title",
|
|
2785
2780
|
"xml:space",
|
|
2786
2781
|
"xmlns:xlink"
|
|
2787
|
-
]),
|
|
2782
|
+
]), no = K(/{{[\w\W]*|^[\w\W]*}}/g), ro = K(/<%[\w\W]*|^[\w\W]*%>/g), io = K(/\${[\w\W]*/g), ao = K(/^data-[\-\w.\u00B7-\uFFFF]+$/), oo = K(/^aria-[\-\w]+$/), so = K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), co = K(/^(?:\w+script|data):/i), lo = K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), uo = K(/^html$/i), fo = K(/^[a-z][.\w]*(-[.\w]+)+$/i), po = K(/<[/\w!]/g), mo = K(/<[/\w]/g), ho = K(/<\/no(script|embed|frames)/i), go = K(/\/>/i), $ = {
|
|
2788
2783
|
element: 1,
|
|
2789
2784
|
attribute: 2,
|
|
2790
2785
|
text: 3,
|
|
@@ -2797,7 +2792,7 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2797
2792
|
documentType: 10,
|
|
2798
2793
|
documentFragment: 11,
|
|
2799
2794
|
notation: 12
|
|
2800
|
-
},
|
|
2795
|
+
}, _o = G(X({}, [
|
|
2801
2796
|
"style",
|
|
2802
2797
|
"script",
|
|
2803
2798
|
"xmp",
|
|
@@ -2806,9 +2801,9 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2806
2801
|
"noframes",
|
|
2807
2802
|
"plaintext",
|
|
2808
2803
|
"noscript"
|
|
2809
|
-
])),
|
|
2804
|
+
])), vo = function() {
|
|
2810
2805
|
return typeof window > "u" ? null : window;
|
|
2811
|
-
},
|
|
2806
|
+
}, yo = function(e, t) {
|
|
2812
2807
|
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
2813
2808
|
let n = null, r = "data-tt-policy-suffix";
|
|
2814
2809
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
@@ -2825,7 +2820,7 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2825
2820
|
} catch {
|
|
2826
2821
|
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
2827
2822
|
}
|
|
2828
|
-
},
|
|
2823
|
+
}, bo = function() {
|
|
2829
2824
|
return {
|
|
2830
2825
|
afterSanitizeAttributes: [],
|
|
2831
2826
|
afterSanitizeElements: [],
|
|
@@ -2837,62 +2832,62 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2837
2832
|
uponSanitizeElement: [],
|
|
2838
2833
|
uponSanitizeShadowNode: []
|
|
2839
2834
|
};
|
|
2840
|
-
},
|
|
2841
|
-
return q(e, t) &&
|
|
2842
|
-
},
|
|
2835
|
+
}, xo = function(e, t, n, r) {
|
|
2836
|
+
return q(e, t) && wa(e[t]) ? X(r.base ? Z(r.base) : {}, e[t], r.transform) : n;
|
|
2837
|
+
}, So = function(e, t, n) {
|
|
2843
2838
|
let r = q(e, t) ? e[t] : void 0;
|
|
2844
2839
|
return r && typeof r == "object" ? Z(r) : n();
|
|
2845
2840
|
};
|
|
2846
|
-
function
|
|
2847
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
2841
|
+
function Co() {
|
|
2842
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : vo(), t = (e) => Co(e);
|
|
2848
2843
|
if (t.version = "3.4.17", t.removed = [], !e || !e.document || e.document.nodeType !== $.document || !e.Element) return t.isSupported = !1, t;
|
|
2849
2844
|
let n = e.document, r = n, i = r.currentScript;
|
|
2850
2845
|
e.DocumentFragment;
|
|
2851
2846
|
let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
|
|
2852
2847
|
e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
|
|
2853
|
-
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), m = Q(d, "nextSibling"), te = Q(d, "childNodes"), ne = Q(d, "parentNode"), re = Q(d, "shadowRoot"), ie = Q(d, "attributes"),
|
|
2854
|
-
return
|
|
2855
|
-
},
|
|
2856
|
-
return
|
|
2857
|
-
},
|
|
2858
|
-
return
|
|
2848
|
+
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), m = Q(d, "nextSibling"), te = Q(d, "childNodes"), ne = Q(d, "parentNode"), re = Q(d, "shadowRoot"), ie = Q(d, "attributes"), ae = o && o.prototype ? Q(o.prototype, "nodeType") : null, h = o && o.prototype ? Q(o.prototype, "nodeName") : null, oe = o && o.prototype ? Q(o.prototype, "ownerDocument") : null, g = function(e) {
|
|
2849
|
+
return ae ? ae(e) : e.nodeType;
|
|
2850
|
+
}, se = function(e) {
|
|
2851
|
+
return h ? h(e) : e.nodeName;
|
|
2852
|
+
}, ce = Ua(d, "namespaceURI"), le = function(e) {
|
|
2853
|
+
return ce ? ce(e) : e.namespaceURI;
|
|
2859
2854
|
};
|
|
2860
2855
|
if (typeof a == "function") {
|
|
2861
2856
|
let e = n.createElement("template");
|
|
2862
2857
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
2863
2858
|
}
|
|
2864
|
-
let
|
|
2865
|
-
if (
|
|
2866
|
-
},
|
|
2867
|
-
|
|
2859
|
+
let _, v = "", ue, de = !1, fe = 0, pe = function() {
|
|
2860
|
+
if (fe > 0) throw za("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
|
|
2861
|
+
}, y = function(e) {
|
|
2862
|
+
pe(), fe++;
|
|
2868
2863
|
try {
|
|
2869
|
-
return
|
|
2864
|
+
return _.createHTML(e);
|
|
2870
2865
|
} finally {
|
|
2871
|
-
|
|
2866
|
+
fe--;
|
|
2872
2867
|
}
|
|
2873
|
-
},
|
|
2874
|
-
|
|
2868
|
+
}, me = function(e) {
|
|
2869
|
+
pe(), fe++;
|
|
2875
2870
|
try {
|
|
2876
|
-
return
|
|
2871
|
+
return _.createScriptURL(e);
|
|
2877
2872
|
} finally {
|
|
2878
|
-
|
|
2879
|
-
}
|
|
2880
|
-
},
|
|
2881
|
-
return
|
|
2882
|
-
},
|
|
2883
|
-
t.isSupported = typeof
|
|
2884
|
-
let
|
|
2885
|
-
...Wa,
|
|
2873
|
+
fe--;
|
|
2874
|
+
}
|
|
2875
|
+
}, b = function() {
|
|
2876
|
+
return de ||= (ue = yo(u, i), !0), ue;
|
|
2877
|
+
}, he = n, ge = he.implementation, _e = he.createNodeIterator, ve = he.createDocumentFragment, ye = he.getElementsByTagName, be = r.importNode, x = bo();
|
|
2878
|
+
t.isSupported = typeof la == "function" && typeof ne == "function" && ge && ge.createHTMLDocument !== void 0;
|
|
2879
|
+
let xe = no, Se = ro, Ce = io, we = ao, Te = oo, S = co, Ee = lo, De = fo, Oe = so, C = null, ke = X({}, [
|
|
2886
2880
|
...Ga,
|
|
2887
2881
|
...Ka,
|
|
2888
|
-
...
|
|
2889
|
-
...
|
|
2890
|
-
|
|
2891
|
-
|
|
2882
|
+
...qa,
|
|
2883
|
+
...Ya,
|
|
2884
|
+
...Za
|
|
2885
|
+
]), w = null, Ae = X({}, [
|
|
2892
2886
|
...Qa,
|
|
2893
2887
|
...$a,
|
|
2894
|
-
...eo
|
|
2895
|
-
|
|
2888
|
+
...eo,
|
|
2889
|
+
...to
|
|
2890
|
+
]), T = Object.seal(ma(null, {
|
|
2896
2891
|
tagNameCheck: {
|
|
2897
2892
|
writable: !0,
|
|
2898
2893
|
configurable: !1,
|
|
@@ -2911,7 +2906,7 @@ function So() {
|
|
|
2911
2906
|
enumerable: !0,
|
|
2912
2907
|
value: !1
|
|
2913
2908
|
}
|
|
2914
|
-
})),
|
|
2909
|
+
})), je = null, Me = null, Ne = Object.seal(ma(null, {
|
|
2915
2910
|
tagCheck: {
|
|
2916
2911
|
writable: !0,
|
|
2917
2912
|
configurable: !1,
|
|
@@ -2924,14 +2919,14 @@ function So() {
|
|
|
2924
2919
|
enumerable: !0,
|
|
2925
2920
|
value: null
|
|
2926
2921
|
}
|
|
2927
|
-
})),
|
|
2922
|
+
})), Pe = !0, Fe = !0, Ie = !1, Le = !0, E = !1, Re = !0, ze = !1, Be = !1, Ve = null, He = null, Ue = !1, We = !1, Ge = !1, Ke = !1, qe = !0, Je = !1, Ye = "user-content-", D = !0, Xe = !1, Ze = null, Qe = {}, O = null, $e = X({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), et = null, tt = X({}, [
|
|
2928
2923
|
"audio",
|
|
2929
2924
|
"video",
|
|
2930
2925
|
"img",
|
|
2931
2926
|
"source",
|
|
2932
2927
|
"image",
|
|
2933
2928
|
"track"
|
|
2934
|
-
]),
|
|
2929
|
+
]), nt = null, rt = X({}, [
|
|
2935
2930
|
"alt",
|
|
2936
2931
|
"class",
|
|
2937
2932
|
"for",
|
|
@@ -2946,72 +2941,72 @@ function So() {
|
|
|
2946
2941
|
"value",
|
|
2947
2942
|
"style",
|
|
2948
2943
|
"xmlns"
|
|
2949
|
-
]),
|
|
2950
|
-
rt,
|
|
2944
|
+
]), it = "http://www.w3.org/1998/Math/MathML", at = "http://www.w3.org/2000/svg", k = "http://www.w3.org/1999/xhtml", ot = k, st = !1, ct = null, lt = X({}, [
|
|
2951
2945
|
it,
|
|
2952
|
-
|
|
2953
|
-
|
|
2946
|
+
at,
|
|
2947
|
+
k
|
|
2948
|
+
], ka), ut = G([
|
|
2954
2949
|
"mi",
|
|
2955
2950
|
"mo",
|
|
2956
2951
|
"mn",
|
|
2957
2952
|
"ms",
|
|
2958
2953
|
"mtext"
|
|
2959
|
-
]),
|
|
2954
|
+
]), A = X({}, ut), dt = G(["annotation-xml"]), ft = X({}, dt), pt = X({}, [
|
|
2960
2955
|
"title",
|
|
2961
2956
|
"style",
|
|
2962
2957
|
"font",
|
|
2963
2958
|
"a",
|
|
2964
2959
|
"script"
|
|
2965
|
-
]),
|
|
2960
|
+
]), mt = null, ht = ["application/xhtml+xml", "text/html"], j = null, gt = null, _t = n.createElement("form"), vt = function(e) {
|
|
2966
2961
|
return e instanceof RegExp || e instanceof Function;
|
|
2967
|
-
},
|
|
2962
|
+
}, yt = function() {
|
|
2968
2963
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2969
|
-
if (
|
|
2970
|
-
(!e || typeof e != "object") && (e = {}), e = Z(e),
|
|
2971
|
-
transform:
|
|
2972
|
-
base:
|
|
2973
|
-
}),
|
|
2974
|
-
transform:
|
|
2975
|
-
base:
|
|
2976
|
-
}),
|
|
2977
|
-
let t =
|
|
2978
|
-
if (
|
|
2964
|
+
if (gt && gt === e) return;
|
|
2965
|
+
(!e || typeof e != "object") && (e = {}), e = Z(e), mt = ht.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, j = mt === "application/xhtml+xml" ? ka : Oa, C = xo(e, "ALLOWED_TAGS", ke, { transform: j }), w = xo(e, "ALLOWED_ATTR", Ae, { transform: j }), ct = xo(e, "ALLOWED_NAMESPACES", lt, { transform: ka }), nt = xo(e, "ADD_URI_SAFE_ATTR", rt, {
|
|
2966
|
+
transform: j,
|
|
2967
|
+
base: rt
|
|
2968
|
+
}), et = xo(e, "ADD_DATA_URI_TAGS", tt, {
|
|
2969
|
+
transform: j,
|
|
2970
|
+
base: tt
|
|
2971
|
+
}), O = xo(e, "FORBID_CONTENTS", $e, { transform: j }), je = xo(e, "FORBID_TAGS", Z({}), { transform: j }), Me = xo(e, "FORBID_ATTR", Z({}), { transform: j }), Qe = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, Pe = e.ALLOW_ARIA_ATTR !== !1, Fe = e.ALLOW_DATA_ATTR !== !1, Ie = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Le = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, E = e.SAFE_FOR_TEMPLATES || !1, Re = e.SAFE_FOR_XML !== !1, ze = e.WHOLE_DOCUMENT || !1, We = e.RETURN_DOM || !1, Ge = e.RETURN_DOM_FRAGMENT || !1, Ke = e.RETURN_TRUSTED_TYPE || !1, Ue = e.FORCE_BODY || !1, qe = e.SANITIZE_DOM !== !1, Je = e.SANITIZE_NAMED_PROPS || !1, D = e.KEEP_CONTENT !== !1, Xe = e.IN_PLACE || !1, Oe = Wa(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : so, ot = typeof e.NAMESPACE == "string" ? e.NAMESPACE : k, A = So(e, "MATHML_TEXT_INTEGRATION_POINTS", () => X({}, ut)), ft = So(e, "HTML_INTEGRATION_POINTS", () => X({}, dt));
|
|
2972
|
+
let t = So(e, "CUSTOM_ELEMENT_HANDLING", () => ma(null));
|
|
2973
|
+
if (T = ma(null), q(t, "tagNameCheck") && vt(t.tagNameCheck) && (T.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && vt(t.attributeNameCheck) && (T.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (T.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(T), E && (Fe = !1), Ge && (We = !0), Qe && (C = X({}, Za), w = ma(null), Qe.html === !0 && (X(C, Ga), X(w, Qa)), Qe.svg === !0 && (X(C, Ka), X(w, $a), X(w, to)), Qe.svgFilters === !0 && (X(C, qa), X(w, $a), X(w, to)), Qe.mathMl === !0 && (X(C, Ya), X(w, eo), X(w, to))), Ne.tagCheck = null, Ne.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Ne.tagCheck = e.ADD_TAGS : wa(e.ADD_TAGS) && (C === ke && (C = Z(C)), X(C, e.ADD_TAGS, j))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Ne.attributeCheck = e.ADD_ATTR : wa(e.ADD_ATTR) && (w === Ae && (w = Z(w)), X(w, e.ADD_ATTR, j))), q(e, "ADD_FORBID_CONTENTS") && wa(e.ADD_FORBID_CONTENTS) && (O === $e && (O = Z(O)), X(O, e.ADD_FORBID_CONTENTS, j)), D && (C["#text"] = !0), ze && X(C, [
|
|
2979
2974
|
"html",
|
|
2980
2975
|
"head",
|
|
2981
2976
|
"body"
|
|
2982
|
-
]),
|
|
2983
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
2984
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
2985
|
-
let t =
|
|
2986
|
-
|
|
2977
|
+
]), C.table && (X(C, ["tbody"]), delete je.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
2978
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw za("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
2979
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw za("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
2980
|
+
let t = _;
|
|
2981
|
+
_ = e.TRUSTED_TYPES_POLICY;
|
|
2987
2982
|
try {
|
|
2988
|
-
|
|
2983
|
+
v = y("");
|
|
2989
2984
|
} catch (e) {
|
|
2990
|
-
throw
|
|
2985
|
+
throw _ = t, e;
|
|
2991
2986
|
}
|
|
2992
|
-
} else e.TRUSTED_TYPES_POLICY === null ? (
|
|
2993
|
-
G && G(e),
|
|
2994
|
-
},
|
|
2995
|
-
...Ga,
|
|
2987
|
+
} else e.TRUSTED_TYPES_POLICY === null ? (_ = void 0, v = "") : (_ === void 0 && (_ = b()), _ && typeof v == "string" && (v = y("")));
|
|
2988
|
+
G && G(e), gt = e;
|
|
2989
|
+
}, bt = X({}, [
|
|
2996
2990
|
...Ka,
|
|
2997
|
-
...qa
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
return t.namespaceURI === A ? e === "math" : t.namespaceURI === it ? e === "math" && dt[n] : !!bt[e];
|
|
2991
|
+
...qa,
|
|
2992
|
+
...Ja
|
|
2993
|
+
]), xt = X({}, [...Ya, ...Xa]), St = function(e, t, n) {
|
|
2994
|
+
return t.namespaceURI === k ? e === "svg" : t.namespaceURI === it ? e === "svg" && (n === "annotation-xml" || A[n]) : !!bt[e];
|
|
3002
2995
|
}, Ct = function(e, t, n) {
|
|
3003
|
-
return t.namespaceURI ===
|
|
3004
|
-
}, wt = function(e) {
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
2996
|
+
return t.namespaceURI === k ? e === "math" : t.namespaceURI === at ? e === "math" && ft[n] : !!xt[e];
|
|
2997
|
+
}, wt = function(e, t, n) {
|
|
2998
|
+
return t.namespaceURI === at && !ft[n] || t.namespaceURI === it && !A[n] ? !1 : !xt[e] && (pt[e] || !bt[e]);
|
|
2999
|
+
}, Tt = function(e) {
|
|
3000
|
+
let t = le(e), n = Oa(se(e)), r = ne(e), i, a;
|
|
3001
|
+
return r && g(r) === $.element ? (i = { namespaceURI: le(r) }, a = Oa(se(r))) : (i = { namespaceURI: ot }, a = "template"), ct[t] ? t === at ? St(n, i, a) : t === it ? Ct(n, i, a) : t === k ? wt(n, i, a) : !!(mt === "application/xhtml+xml" && ct[t]) : !1;
|
|
3002
|
+
}, M = function(e) {
|
|
3003
|
+
xa(t.removed, { element: e });
|
|
3009
3004
|
try {
|
|
3010
3005
|
ne(e).removeChild(e);
|
|
3011
3006
|
} catch {
|
|
3012
|
-
if (p(e), !ne(e)) throw
|
|
3007
|
+
if (p(e), !ne(e)) throw za("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
3013
3008
|
}
|
|
3014
|
-
},
|
|
3009
|
+
}, N = function(e, t, n) {
|
|
3015
3010
|
try {
|
|
3016
3011
|
ee(e, t);
|
|
3017
3012
|
} catch {
|
|
@@ -3022,15 +3017,15 @@ function So() {
|
|
|
3022
3017
|
}, Et = function(e) {
|
|
3023
3018
|
At(e);
|
|
3024
3019
|
let t = te(e);
|
|
3025
|
-
t &&
|
|
3020
|
+
t && va(Sa(t), (e) => {
|
|
3026
3021
|
try {
|
|
3027
3022
|
p(e);
|
|
3028
3023
|
} catch {}
|
|
3029
3024
|
});
|
|
3030
|
-
let n =
|
|
3025
|
+
let n = g(e) === $.element ? ie(e) : null;
|
|
3031
3026
|
if (n) for (let t = n.length - 1; t >= 0; --t) {
|
|
3032
3027
|
let r = n[t], i = r && r.name;
|
|
3033
|
-
typeof i == "string" &&
|
|
3028
|
+
typeof i == "string" && N(e, r, i);
|
|
3034
3029
|
}
|
|
3035
3030
|
}, Dt = function(e, n, r) {
|
|
3036
3031
|
if (!r) try {
|
|
@@ -3038,7 +3033,7 @@ function So() {
|
|
|
3038
3033
|
} catch {
|
|
3039
3034
|
r = null;
|
|
3040
3035
|
}
|
|
3041
|
-
|
|
3036
|
+
xa(t.removed, {
|
|
3042
3037
|
attribute: r || null,
|
|
3043
3038
|
from: n
|
|
3044
3039
|
});
|
|
@@ -3050,8 +3045,8 @@ function So() {
|
|
|
3050
3045
|
} catch {}
|
|
3051
3046
|
}
|
|
3052
3047
|
if (e === "is") {
|
|
3053
|
-
if (
|
|
3054
|
-
|
|
3048
|
+
if (We || Ge) try {
|
|
3049
|
+
M(n);
|
|
3055
3050
|
} catch {}
|
|
3056
3051
|
else try {
|
|
3057
3052
|
n.setAttribute(e, "");
|
|
@@ -3061,23 +3056,23 @@ function So() {
|
|
|
3061
3056
|
let t = ie(e);
|
|
3062
3057
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
3063
3058
|
let r = t[n], i = r && r.name;
|
|
3064
|
-
typeof i != "string" ||
|
|
3059
|
+
typeof i != "string" || w[j(i)] || N(e, r, i);
|
|
3065
3060
|
}
|
|
3066
3061
|
}, kt = function(e, t) {
|
|
3067
3062
|
let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], r = [e];
|
|
3068
3063
|
for (; r.length > 0;) {
|
|
3069
3064
|
let e = r.pop();
|
|
3070
3065
|
if (t(e) === !1) continue;
|
|
3071
|
-
if (n &&
|
|
3066
|
+
if (n && g(e) === $.element) {
|
|
3072
3067
|
let t = re(e);
|
|
3073
|
-
|
|
3068
|
+
Ut(t) && r.push(t);
|
|
3074
3069
|
}
|
|
3075
3070
|
let i = te(e);
|
|
3076
3071
|
if (i) for (let e = i.length - 1; e >= 0; --e) r.push(i[e]);
|
|
3077
3072
|
}
|
|
3078
3073
|
}, At = function(e) {
|
|
3079
3074
|
kt(e, (e) => {
|
|
3080
|
-
|
|
3075
|
+
g(e) === $.element && Ot(e);
|
|
3081
3076
|
});
|
|
3082
3077
|
}, jt = function(e) {
|
|
3083
3078
|
let t = [];
|
|
@@ -3085,49 +3080,49 @@ function So() {
|
|
|
3085
3080
|
t.push(e);
|
|
3086
3081
|
}, !0), t;
|
|
3087
3082
|
}, Mt = function(e, t) {
|
|
3088
|
-
let n =
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
}),
|
|
3092
|
-
|
|
3083
|
+
let n = Ta();
|
|
3084
|
+
va(jt(e), (e) => {
|
|
3085
|
+
g(e) === $.element && Ea(n, e);
|
|
3086
|
+
}), va(t, (e) => {
|
|
3087
|
+
g(e) === $.element && !Da(n, e) && Ot(e);
|
|
3093
3088
|
});
|
|
3094
3089
|
}, Nt = function(e, n) {
|
|
3095
3090
|
let r = !1;
|
|
3096
|
-
return
|
|
3091
|
+
return va(t.removed, (t) => {
|
|
3097
3092
|
t.element && (r ||= t.element === e, At(t.element));
|
|
3098
3093
|
}), Mt(e, n), r;
|
|
3099
3094
|
}, Pt = function(e, t) {
|
|
3100
|
-
let n =
|
|
3101
|
-
|
|
3095
|
+
let n = Ze, r = null, i = () => (r || (r = Ta(), va(t, (e) => {
|
|
3096
|
+
Ea(r, e);
|
|
3102
3097
|
})), r);
|
|
3103
3098
|
for (let t = 0;; t++) {
|
|
3104
3099
|
let r = jt(e), a = [e], o = !1;
|
|
3105
|
-
if (
|
|
3106
|
-
|
|
3100
|
+
if (va(r, (e) => {
|
|
3101
|
+
g(e) === $.documentFragment ? xa(a, e) : !o && !Da(n, e) && (o = Da(i(), e));
|
|
3107
3102
|
}), !o) return;
|
|
3108
|
-
if (t >= 8) throw
|
|
3109
|
-
|
|
3103
|
+
if (t >= 8) throw za("the tree kept changing during in-place sanitization; refusing to return it");
|
|
3104
|
+
va(a, (t, n) => {
|
|
3110
3105
|
Ft(t, n > 0, e, i());
|
|
3111
3106
|
});
|
|
3112
3107
|
}
|
|
3113
3108
|
}, Ft = function(e, t, n, r) {
|
|
3114
3109
|
let i = Bt(e), a;
|
|
3115
|
-
for (; a = i.nextNode();)
|
|
3110
|
+
for (; a = i.nextNode();) Da(r, a) && !Da(Ze, a) && (t && I(x.uponSanitizeShadowNode, a, null), Xt(a, n), L(a, n), Ut(a.content) && rn(a.content));
|
|
3116
3111
|
}, It = function(e) {
|
|
3117
|
-
|
|
3112
|
+
Ze && Ea(Ze, e);
|
|
3118
3113
|
}, Lt = function(e, t) {
|
|
3119
|
-
return
|
|
3114
|
+
return Re ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
|
|
3120
3115
|
}, Rt = function(e) {
|
|
3121
|
-
|
|
3122
|
-
let t =
|
|
3123
|
-
if (t === $.processingInstruction || t === $.comment && J(
|
|
3116
|
+
Re && kt(e, (e) => {
|
|
3117
|
+
let t = g(e);
|
|
3118
|
+
if (t === $.processingInstruction || t === $.comment && J(mo, e.data)) {
|
|
3124
3119
|
try {
|
|
3125
3120
|
p(e);
|
|
3126
3121
|
} catch {}
|
|
3127
3122
|
return !1;
|
|
3128
3123
|
}
|
|
3129
3124
|
if (t === $.element) {
|
|
3130
|
-
let t = e, n =
|
|
3125
|
+
let t = e, n = j(se(e));
|
|
3131
3126
|
try {
|
|
3132
3127
|
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && Lt("for", n) && t.removeAttribute("for");
|
|
3133
3128
|
} catch {}
|
|
@@ -3136,69 +3131,69 @@ function So() {
|
|
|
3136
3131
|
});
|
|
3137
3132
|
}, zt = function(e) {
|
|
3138
3133
|
let t = null, r = null;
|
|
3139
|
-
if (
|
|
3134
|
+
if (Ue) e = "<remove></remove>" + e;
|
|
3140
3135
|
else {
|
|
3141
|
-
let t =
|
|
3136
|
+
let t = Aa(e, /^[\r\n\t ]+/);
|
|
3142
3137
|
r = t && t[0];
|
|
3143
3138
|
}
|
|
3144
|
-
|
|
3145
|
-
let i =
|
|
3146
|
-
if (
|
|
3147
|
-
t = new l().parseFromString(i,
|
|
3139
|
+
mt === "application/xhtml+xml" && ot === k && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
3140
|
+
let i = _ ? y(e) : e;
|
|
3141
|
+
if (ot === k) try {
|
|
3142
|
+
t = new l().parseFromString(i, mt);
|
|
3148
3143
|
} catch {}
|
|
3149
3144
|
if (!t || !t.documentElement) {
|
|
3150
|
-
t =
|
|
3145
|
+
t = ge.createDocument(ot, "template", null);
|
|
3151
3146
|
try {
|
|
3152
|
-
t.documentElement.innerHTML =
|
|
3147
|
+
t.documentElement.innerHTML = st ? v : i;
|
|
3153
3148
|
} catch {}
|
|
3154
3149
|
}
|
|
3155
3150
|
let a = t.body || t.documentElement;
|
|
3156
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null),
|
|
3151
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), ot === k ? ye.call(t, ze ? "html" : "body")[0] : ze ? t.documentElement : a;
|
|
3157
3152
|
}, Bt = function(e) {
|
|
3158
|
-
let t =
|
|
3159
|
-
return
|
|
3153
|
+
let t = oe ? oe(e) : e.ownerDocument;
|
|
3154
|
+
return _e.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
|
|
3160
3155
|
}, Vt = function(e) {
|
|
3161
|
-
return e =
|
|
3162
|
-
},
|
|
3163
|
-
|
|
3156
|
+
return e = ja(e, xe, " "), e = ja(e, Se, " "), e = ja(e, Ce, " "), e;
|
|
3157
|
+
}, Ht = function(e) {
|
|
3158
|
+
P(e);
|
|
3164
3159
|
let t = e.querySelectorAll?.call(e, "template");
|
|
3165
|
-
t &&
|
|
3166
|
-
|
|
3160
|
+
t && va(t, (e) => {
|
|
3161
|
+
Ut(e.content) && Ht(e.content);
|
|
3167
3162
|
});
|
|
3168
|
-
},
|
|
3163
|
+
}, P = function(e) {
|
|
3169
3164
|
e.normalize();
|
|
3170
|
-
let t =
|
|
3165
|
+
let t = oe ? oe(e) : e.ownerDocument, n = _e.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
|
|
3171
3166
|
for (; r;) r.data = Vt(r.data), r = n.nextNode();
|
|
3167
|
+
}, F = function(e) {
|
|
3168
|
+
let t = h ? h(e) : null;
|
|
3169
|
+
return typeof t != "string" || j(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== ie(e) || typeof e.removeAttribute != "function" || typeof e.removeAttributeNode != "function" || typeof e.getAttributeNode != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== ae(e) || e.childNodes !== te(e);
|
|
3172
3170
|
}, Ut = function(e) {
|
|
3173
|
-
|
|
3174
|
-
return typeof t != "string" || M(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== ie(e) || typeof e.removeAttribute != "function" || typeof e.removeAttributeNode != "function" || typeof e.getAttributeNode != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== h(e) || e.childNodes !== te(e);
|
|
3175
|
-
}, Wt = function(e) {
|
|
3176
|
-
if (!h || typeof e != "object" || !e) return !1;
|
|
3171
|
+
if (!ae || typeof e != "object" || !e) return !1;
|
|
3177
3172
|
try {
|
|
3178
|
-
return
|
|
3173
|
+
return ae(e) === $.documentFragment;
|
|
3179
3174
|
} catch {
|
|
3180
3175
|
return !1;
|
|
3181
3176
|
}
|
|
3182
|
-
},
|
|
3183
|
-
if (!
|
|
3177
|
+
}, Wt = function(e) {
|
|
3178
|
+
if (!ae || typeof e != "object" || !e) return !1;
|
|
3184
3179
|
try {
|
|
3185
|
-
return typeof
|
|
3180
|
+
return typeof ae(e) == "number";
|
|
3186
3181
|
} catch {
|
|
3187
3182
|
return !1;
|
|
3188
3183
|
}
|
|
3189
3184
|
};
|
|
3190
3185
|
function I(e, n, r) {
|
|
3191
|
-
e.length !== 0 &&
|
|
3192
|
-
e.call(t, n, r,
|
|
3186
|
+
e.length !== 0 && va(e, (e) => {
|
|
3187
|
+
e.call(t, n, r, gt);
|
|
3193
3188
|
});
|
|
3194
3189
|
}
|
|
3195
3190
|
let Gt = function(e, t) {
|
|
3196
|
-
return !!(
|
|
3191
|
+
return !!(Re && e.hasChildNodes() && !Wt(e.firstElementChild) && J(po, e.textContent) && J(po, e.innerHTML) || Re && _o[t] && g(e) === $.element && le(e) === k && (Wt(e.firstElementChild) || typeof e.textContent == "string" && J(po, e.textContent)) || e.nodeType === $.processingInstruction || Re && e.nodeType === $.comment && J(mo, e.data));
|
|
3197
3192
|
}, Kt = function(e, t) {
|
|
3198
3193
|
return e instanceof RegExp ? J(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
|
|
3199
3194
|
}, qt = function(e, t, n) {
|
|
3200
|
-
if (!
|
|
3201
|
-
if (
|
|
3195
|
+
if (!je[t] && $t(t) && Kt(T.tagNameCheck, t)) return !1;
|
|
3196
|
+
if (D && !O[t] && !O[Oa(t)]) {
|
|
3202
3197
|
let t = ne(e), r = te(e);
|
|
3203
3198
|
if (r && t) {
|
|
3204
3199
|
let i = r.length;
|
|
@@ -3208,34 +3203,34 @@ function So() {
|
|
|
3208
3203
|
}
|
|
3209
3204
|
}
|
|
3210
3205
|
}
|
|
3211
|
-
return
|
|
3206
|
+
return M(e), !0;
|
|
3212
3207
|
}, Jt = function(e, t, n, r) {
|
|
3213
3208
|
return e.length === 0 ? t : t === n || t === r ? Z(t) : t;
|
|
3214
3209
|
}, Yt = function(e, t) {
|
|
3215
|
-
return e === t || ne(e) !== null ? !1 : (
|
|
3210
|
+
return e === t || ne(e) !== null ? !1 : (Xe && At(e), !0);
|
|
3216
3211
|
}, Xt = function(e, n) {
|
|
3217
|
-
if (It(e), I(
|
|
3218
|
-
if (
|
|
3219
|
-
let r =
|
|
3220
|
-
if (
|
|
3212
|
+
if (It(e), I(x.beforeSanitizeElements, e, null), Yt(e, n)) return !0;
|
|
3213
|
+
if (F(e)) return M(e), !0;
|
|
3214
|
+
let r = j(se(e));
|
|
3215
|
+
if (C = Jt(x.uponSanitizeElement, C, ke, Ve), I(x.uponSanitizeElement, e, {
|
|
3221
3216
|
tagName: r,
|
|
3222
|
-
allowedTags:
|
|
3217
|
+
allowedTags: C
|
|
3223
3218
|
}), Yt(e, n)) return !0;
|
|
3224
|
-
if (Gt(e, r)) return
|
|
3225
|
-
if (
|
|
3219
|
+
if (Gt(e, r)) return M(e), !0;
|
|
3220
|
+
if (je[r] || !(Ne.tagCheck instanceof Function && Ne.tagCheck(r)) && !C[r]) {
|
|
3226
3221
|
let t = qt(e, r, n);
|
|
3227
|
-
return t === !1 && (I(
|
|
3222
|
+
return t === !1 && (I(x.afterSanitizeElements, e, null), Yt(e, n)) ? !0 : t;
|
|
3228
3223
|
}
|
|
3229
|
-
if (
|
|
3230
|
-
if (
|
|
3224
|
+
if (g(e) === $.element && !Tt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(ho, e.innerHTML)) return M(e), !0;
|
|
3225
|
+
if (E && e.nodeType === $.text) {
|
|
3231
3226
|
let n = Vt(e.textContent);
|
|
3232
|
-
e.textContent !== n && (
|
|
3227
|
+
e.textContent !== n && (xa(t.removed, { element: e.cloneNode() }), e.textContent = n);
|
|
3233
3228
|
}
|
|
3234
|
-
return I(
|
|
3229
|
+
return I(x.afterSanitizeElements, e, null), Yt(e, n);
|
|
3235
3230
|
}, Zt = function(e, t, r) {
|
|
3236
|
-
if (
|
|
3237
|
-
let i =
|
|
3238
|
-
return
|
|
3231
|
+
if (Me[t] || Lt(t, e) || qe && (t === "id" || t === "name") && (r in n || r in _t)) return !1;
|
|
3232
|
+
let i = w[t] || Ne.attributeCheck instanceof Function && Ne.attributeCheck(t, e);
|
|
3233
|
+
return Fe && J(we, t) || Pe && J(Te, t) ? !0 : i ? nt[t] || J(Oe, ja(r, Ee, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Ma(r, "data:") === 0 && et[e] || Ie && !J(S, ja(r, Ee, "")) ? !0 : !r : $t(e) && Kt(T.tagNameCheck, e) && Kt(T.attributeNameCheck, t, e) || t === "is" && T.allowCustomizedBuiltInElements && Kt(T.tagNameCheck, r);
|
|
3239
3234
|
}, Qt = X({}, [
|
|
3240
3235
|
"annotation-xml",
|
|
3241
3236
|
"color-profile",
|
|
@@ -3246,45 +3241,45 @@ function So() {
|
|
|
3246
3241
|
"font-face-uri",
|
|
3247
3242
|
"missing-glyph"
|
|
3248
3243
|
]), $t = function(e) {
|
|
3249
|
-
return !Qt[
|
|
3244
|
+
return !Qt[Oa(e)] && J(De, e);
|
|
3250
3245
|
}, en = function(e, t, n, r) {
|
|
3251
|
-
if (
|
|
3252
|
-
case "TrustedHTML": return
|
|
3253
|
-
case "TrustedScriptURL": return
|
|
3246
|
+
if (_ && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
3247
|
+
case "TrustedHTML": return y(r);
|
|
3248
|
+
case "TrustedScriptURL": return me(r);
|
|
3254
3249
|
}
|
|
3255
3250
|
return r;
|
|
3256
3251
|
}, tn = function(e, t, n, r) {
|
|
3257
3252
|
try {
|
|
3258
|
-
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !
|
|
3253
|
+
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !F(e) || (M(e), !1);
|
|
3259
3254
|
} catch {
|
|
3260
3255
|
return Dt(t, e), !1;
|
|
3261
3256
|
}
|
|
3262
|
-
},
|
|
3263
|
-
return
|
|
3264
|
-
},
|
|
3265
|
-
if (I(
|
|
3257
|
+
}, nn = function(e, t) {
|
|
3258
|
+
return Re && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, t) ? !0 : Oa(e) === "attributename" && Aa(t, "href") !== null;
|
|
3259
|
+
}, L = function(e, n) {
|
|
3260
|
+
if (I(x.beforeSanitizeAttributes, e, null), Yt(e, n)) return;
|
|
3266
3261
|
let r = e.attributes;
|
|
3267
|
-
if (!r ||
|
|
3268
|
-
|
|
3262
|
+
if (!r || F(e)) return;
|
|
3263
|
+
w = Jt(x.uponSanitizeAttribute, w, Ae, He);
|
|
3269
3264
|
let i = {
|
|
3270
3265
|
attrName: "",
|
|
3271
3266
|
attrValue: "",
|
|
3272
3267
|
keepAttr: !0,
|
|
3273
|
-
allowedAttributes:
|
|
3268
|
+
allowedAttributes: w,
|
|
3274
3269
|
forceKeepAttr: void 0
|
|
3275
|
-
}, a = r.length, o =
|
|
3270
|
+
}, a = r.length, o = j(e.nodeName);
|
|
3276
3271
|
for (; a--;) {
|
|
3277
|
-
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u =
|
|
3278
|
-
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, I(
|
|
3272
|
+
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = j(s), d = l, f = s === "value" ? d : Na(d), p = !1;
|
|
3273
|
+
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, I(x.uponSanitizeAttribute, e, i), f = i.attrValue, Je && (u === "id" || u === "name") && Ma(f, Ye) !== 0 && (Dt(s, e, n), f = Ye + f, p = !0), nn(s, f) ? Dt(s, e, n) : i.forceKeepAttr || (i.keepAttr ? !Le && J(go, f) ? Dt(s, e, n) : (E && (f = Vt(f)), Zt(o, u, f) ? (f = en(o, u, c, f), f !== d && tn(e, s, c, f) && p && ba(t.removed)) : Dt(s, e, n)) : Dt(s, e, n));
|
|
3279
3274
|
}
|
|
3280
|
-
I(
|
|
3275
|
+
I(x.afterSanitizeAttributes, e, null), Yt(e, n);
|
|
3281
3276
|
}, rn = function(e) {
|
|
3282
3277
|
let t = null, n = Bt(e);
|
|
3283
|
-
for (I(
|
|
3278
|
+
for (I(x.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (I(x.uponSanitizeShadowNode, t, null), Xt(t, e), L(t, e), Ut(t.content) && rn(t.content), g(t) === $.element) {
|
|
3284
3279
|
let e = re(t);
|
|
3285
|
-
|
|
3280
|
+
Ut(e) && (an(e), rn(e));
|
|
3286
3281
|
}
|
|
3287
|
-
|
|
3282
|
+
E && P(e), I(x.afterSanitizeShadowDOM, e, null);
|
|
3288
3283
|
}, an = function(e) {
|
|
3289
3284
|
let t = [{
|
|
3290
3285
|
node: e,
|
|
@@ -3296,16 +3291,16 @@ function So() {
|
|
|
3296
3291
|
rn(e.shadow);
|
|
3297
3292
|
continue;
|
|
3298
3293
|
}
|
|
3299
|
-
let n = e.node, r =
|
|
3294
|
+
let n = e.node, r = g(n) === $.element, i = te(n);
|
|
3300
3295
|
if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
|
|
3301
3296
|
node: i[e],
|
|
3302
3297
|
shadow: null
|
|
3303
3298
|
});
|
|
3304
3299
|
if (r) {
|
|
3305
|
-
let e =
|
|
3306
|
-
if (typeof e == "string" &&
|
|
3300
|
+
let e = h ? h(n) : null;
|
|
3301
|
+
if (typeof e == "string" && j(e) === "template") {
|
|
3307
3302
|
let e = n.content;
|
|
3308
|
-
|
|
3303
|
+
Ut(e) && t.push({
|
|
3309
3304
|
node: e,
|
|
3310
3305
|
shadow: null
|
|
3311
3306
|
});
|
|
@@ -3313,7 +3308,7 @@ function So() {
|
|
|
3313
3308
|
}
|
|
3314
3309
|
if (r) {
|
|
3315
3310
|
let e = re(n);
|
|
3316
|
-
|
|
3311
|
+
Ut(e) && t.push({
|
|
3317
3312
|
node: null,
|
|
3318
3313
|
shadow: e
|
|
3319
3314
|
}, {
|
|
@@ -3325,82 +3320,82 @@ function So() {
|
|
|
3325
3320
|
};
|
|
3326
3321
|
return t.sanitize = function(e) {
|
|
3327
3322
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
|
|
3328
|
-
if (
|
|
3323
|
+
if (st = !e, st && (e = "<!-->"), typeof e != "string" && !Wt(e) && (e = Ha(e), typeof e != "string")) throw za("dirty is not a string, aborting");
|
|
3329
3324
|
if (!t.isSupported) return e;
|
|
3330
|
-
|
|
3331
|
-
let c =
|
|
3325
|
+
Be ? (C = Ve, w = He) : yt(n), (x.uponSanitizeElement.length > 0 || x.uponSanitizeAttribute.length > 0) && (C = Z(C)), x.uponSanitizeAttribute.length > 0 && (w = Z(w)), t.removed = [];
|
|
3326
|
+
let c = Xe && typeof e != "string" && Wt(e), l = [], u = Ze;
|
|
3332
3327
|
if (c) {
|
|
3333
3328
|
Rt(e);
|
|
3334
|
-
let t =
|
|
3329
|
+
let t = se(e);
|
|
3335
3330
|
if (typeof t == "string") {
|
|
3336
|
-
let n =
|
|
3337
|
-
if (!
|
|
3331
|
+
let n = j(t);
|
|
3332
|
+
if (!C[n] || je[n]) throw Et(e), za("root node is forbidden and cannot be sanitized in-place");
|
|
3338
3333
|
}
|
|
3339
|
-
if (
|
|
3340
|
-
l = jt(e),
|
|
3341
|
-
} else if (
|
|
3334
|
+
if (F(e)) throw Et(e), za("root node is clobbered and cannot be sanitized in-place");
|
|
3335
|
+
l = jt(e), Ze = Ta();
|
|
3336
|
+
} else if (Wt(e)) i = zt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === $.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), an(i);
|
|
3342
3337
|
else {
|
|
3343
|
-
if (!
|
|
3344
|
-
if (i = zt(e), !i) return
|
|
3338
|
+
if (!We && !E && !ze && e.indexOf("<") === -1) return _ && Ke ? y(e) : e;
|
|
3339
|
+
if (i = zt(e), !i) return We ? null : Ke ? v : "";
|
|
3345
3340
|
}
|
|
3346
|
-
i &&
|
|
3341
|
+
i && Ue && M(i.firstChild);
|
|
3347
3342
|
let d = c ? e : i;
|
|
3348
3343
|
try {
|
|
3349
3344
|
c && an(e);
|
|
3350
3345
|
let t = Bt(d);
|
|
3351
|
-
for (; o = t.nextNode();) Xt(o, d),
|
|
3346
|
+
for (; o = t.nextNode();) Xt(o, d), L(o, d), Ut(o.content) && rn(o.content);
|
|
3352
3347
|
c && Pt(e, l);
|
|
3353
3348
|
} catch (t) {
|
|
3354
3349
|
throw c && (Et(e), Nt(e, l)), t;
|
|
3355
3350
|
} finally {
|
|
3356
|
-
|
|
3351
|
+
Ze = u;
|
|
3357
3352
|
}
|
|
3358
3353
|
if (c) {
|
|
3359
|
-
if (Nt(e, l)) throw
|
|
3360
|
-
return
|
|
3354
|
+
if (Nt(e, l)) throw za("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
3355
|
+
return E && Ht(e), e;
|
|
3361
3356
|
}
|
|
3362
|
-
if (
|
|
3363
|
-
if (
|
|
3357
|
+
if (We) {
|
|
3358
|
+
if (E && Ht(i), Ge) for (s = ve.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
|
|
3364
3359
|
else s = i;
|
|
3365
|
-
return (
|
|
3360
|
+
return (w.shadowroot || w.shadowrootmode) && (s = be.call(r, s, !0)), s;
|
|
3366
3361
|
}
|
|
3367
|
-
let f =
|
|
3368
|
-
return
|
|
3362
|
+
let f = ze ? i.outerHTML : i.innerHTML;
|
|
3363
|
+
return ze && C["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(uo, i.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + f), E && (f = Vt(f)), _ && Ke ? y(f) : f;
|
|
3369
3364
|
}, t.setConfig = function() {
|
|
3370
3365
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3371
|
-
|
|
3366
|
+
yt(e), Be = !0, Ve = C, He = w;
|
|
3372
3367
|
}, t.clearConfig = function() {
|
|
3373
|
-
|
|
3368
|
+
gt = null, Be = !1, Ve = null, He = null, _ = ue, v = "";
|
|
3374
3369
|
}, t.isValidAttribute = function(e, t, n) {
|
|
3375
|
-
|
|
3376
|
-
let r =
|
|
3377
|
-
return typeof n == "string" && (
|
|
3370
|
+
gt || yt({});
|
|
3371
|
+
let r = j(e), i = j(t);
|
|
3372
|
+
return typeof n == "string" && (nn(t, n) || !Le && J(go, n)) ? !1 : Zt(r, i, n);
|
|
3378
3373
|
}, t.addHook = function(e, t) {
|
|
3379
|
-
typeof t == "function" && q(
|
|
3374
|
+
typeof t == "function" && q(x, e) && xa(x[e], t);
|
|
3380
3375
|
}, t.removeHook = function(e, t) {
|
|
3381
|
-
if (q(
|
|
3376
|
+
if (q(x, e)) {
|
|
3382
3377
|
if (t !== void 0) {
|
|
3383
|
-
let n =
|
|
3384
|
-
return n === -1 ? void 0 :
|
|
3378
|
+
let n = ya(x[e], t);
|
|
3379
|
+
return n === -1 ? void 0 : Ca(x[e], n, 1)[0];
|
|
3385
3380
|
}
|
|
3386
|
-
return
|
|
3381
|
+
return ba(x[e]);
|
|
3387
3382
|
}
|
|
3388
3383
|
}, t.removeHooks = function(e) {
|
|
3389
|
-
q(
|
|
3384
|
+
q(x, e) && (x[e] = []);
|
|
3390
3385
|
}, t.removeAllHooks = function() {
|
|
3391
|
-
|
|
3386
|
+
x = bo();
|
|
3392
3387
|
}, t;
|
|
3393
3388
|
}
|
|
3394
|
-
var
|
|
3389
|
+
var wo = Co();
|
|
3395
3390
|
//#endregion
|
|
3396
3391
|
//#region ../../packages/components/src/chat/markdownHtml.ts
|
|
3397
|
-
function
|
|
3392
|
+
function To(e) {
|
|
3398
3393
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
3399
3394
|
}
|
|
3400
|
-
function
|
|
3395
|
+
function Eo(e, t) {
|
|
3401
3396
|
return `<span class="katex-pending" data-katex="${encodeURIComponent(e)}" data-display="${t}"></span>`;
|
|
3402
3397
|
}
|
|
3403
|
-
var
|
|
3398
|
+
var Do = {
|
|
3404
3399
|
ADD_ATTR: ["target"],
|
|
3405
3400
|
ALLOW_UNKNOWN_PROTOCOLS: !0,
|
|
3406
3401
|
FORBID_TAGS: [
|
|
@@ -3421,21 +3416,21 @@ var Eo = {
|
|
|
3421
3416
|
"background"
|
|
3422
3417
|
]
|
|
3423
3418
|
};
|
|
3424
|
-
|
|
3419
|
+
wo.addHook("uponSanitizeAttribute", (e, t) => {
|
|
3425
3420
|
t.attrName === "src" && e.nodeName !== "IMG" && (t.keepAttr = !1);
|
|
3426
3421
|
});
|
|
3427
|
-
var
|
|
3428
|
-
function
|
|
3429
|
-
if (!t) return
|
|
3430
|
-
let n =
|
|
3431
|
-
...
|
|
3422
|
+
var Oo = "data-held-src";
|
|
3423
|
+
function ko(e, t) {
|
|
3424
|
+
if (!t) return wo.sanitize(e, Do);
|
|
3425
|
+
let n = wo.sanitize(e, {
|
|
3426
|
+
...Do,
|
|
3432
3427
|
RETURN_DOM_FRAGMENT: !0
|
|
3433
3428
|
});
|
|
3434
3429
|
for (let e of Array.from(n.querySelectorAll("img"))) {
|
|
3435
3430
|
let n = e.getAttribute("src") ?? "";
|
|
3436
3431
|
if (t.canLoad(n)) continue;
|
|
3437
3432
|
let r = e.ownerDocument.createElement("button");
|
|
3438
|
-
r.type = "button", r.className = "markdown-held-image", r.setAttribute(
|
|
3433
|
+
r.type = "button", r.className = "markdown-held-image", r.setAttribute(Oo, n), r.textContent = t.label(t.hostOf(n) ?? n), e.replaceWith(r);
|
|
3439
3434
|
}
|
|
3440
3435
|
let r = n.ownerDocument.createElement("div");
|
|
3441
3436
|
return r.append(n), r.innerHTML;
|
|
@@ -3443,7 +3438,7 @@ function Oo(e, t) {
|
|
|
3443
3438
|
//#endregion
|
|
3444
3439
|
//#region ../../packages/components/src/chat/PkStreamingMarkdown.vue?vue&type=script&setup=true&lang.ts
|
|
3445
3440
|
c(), o();
|
|
3446
|
-
var
|
|
3441
|
+
var Ao = ["innerHTML"], jo = 100, Mo = /*#__PURE__*/ le(/* @__PURE__ */ l({
|
|
3447
3442
|
__name: "PkStreamingMarkdown",
|
|
3448
3443
|
props: {
|
|
3449
3444
|
markdown: {
|
|
@@ -3480,7 +3475,7 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3480
3475
|
function re() {
|
|
3481
3476
|
return ne ||= import("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.mjs").then((e) => e.default), ne;
|
|
3482
3477
|
}
|
|
3483
|
-
let ie = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/,
|
|
3478
|
+
let ie = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, ae = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
|
|
3484
3479
|
W.use({ extensions: [{
|
|
3485
3480
|
name: "inlineKatex",
|
|
3486
3481
|
level: "inline",
|
|
@@ -3498,13 +3493,13 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3498
3493
|
};
|
|
3499
3494
|
},
|
|
3500
3495
|
renderer(e) {
|
|
3501
|
-
return
|
|
3496
|
+
return Eo(e.text, e.displayMode);
|
|
3502
3497
|
}
|
|
3503
3498
|
}, {
|
|
3504
3499
|
name: "blockKatex",
|
|
3505
3500
|
level: "block",
|
|
3506
3501
|
tokenizer(e) {
|
|
3507
|
-
let t = e.match(
|
|
3502
|
+
let t = e.match(ae);
|
|
3508
3503
|
if (t) return {
|
|
3509
3504
|
type: "blockKatex",
|
|
3510
3505
|
raw: t[0],
|
|
@@ -3513,7 +3508,7 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3513
3508
|
};
|
|
3514
3509
|
},
|
|
3515
3510
|
renderer(e) {
|
|
3516
|
-
return
|
|
3511
|
+
return Eo(e.text, e.displayMode) + "\n";
|
|
3517
3512
|
}
|
|
3518
3513
|
}] }), W.use({ extensions: [{
|
|
3519
3514
|
name: "thinking",
|
|
@@ -3534,30 +3529,30 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3534
3529
|
return `<div class="thinking-block">${this.parser.parse(e.tokens ?? [])}</div>`;
|
|
3535
3530
|
}
|
|
3536
3531
|
}] });
|
|
3537
|
-
let
|
|
3538
|
-
|
|
3532
|
+
let h = new W.Renderer(), oe = (e) => e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), le = /^(?:javascript|data|vbscript|file):/i, v = !1, ue = (e) => oe(e.replace(/^https?:\/\/(?:www\.)?/i, "").replace(/\/$/, "")).replace(/\//g, "/<wbr>");
|
|
3533
|
+
h.link = function({ href: e, title: t, text: n, tokens: r }) {
|
|
3539
3534
|
let i = this.parser.parseInline(r), a = (e ?? "").trim().replace(/[\x00-\x1f]/g, "");
|
|
3540
|
-
if (!a ||
|
|
3541
|
-
let o =
|
|
3542
|
-
return `<a href="${
|
|
3543
|
-
},
|
|
3544
|
-
|
|
3535
|
+
if (!a || le.test(a)) return i;
|
|
3536
|
+
let o = v && n === a, s = t || (o ? a : ""), c = s ? ` title="${oe(s)}"` : "", l = g(a) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
|
|
3537
|
+
return `<a href="${oe(a)}"${c}${l}>${o ? ue(a) : i}</a>`;
|
|
3538
|
+
}, h.table = function(e) {
|
|
3539
|
+
v = !0;
|
|
3545
3540
|
try {
|
|
3546
|
-
let t = e.header.map((e) =>
|
|
3541
|
+
let t = e.header.map((e) => oe(this.parser.parseInline(e.tokens, this.parser.textRenderer))), n = (e) => `<tr role="row">${e.map((e, n) => {
|
|
3547
3542
|
let r = this.parser.parseInline(e.tokens), i = e.align ? ` align="${e.align}"` : "";
|
|
3548
3543
|
return e.header ? `<th role="columnheader"${i}>${r}</th>` : `<td role="cell" data-label="${t[n] ?? ""}"${i}><span>${r}</span></td>`;
|
|
3549
3544
|
}).join("")}</tr>`, r = e.rows.length ? `<tbody role="rowgroup">${e.rows.map(n).join("")}</tbody>` : "";
|
|
3550
3545
|
return `<div class="table-wrapper u-table-scroll"><table class="${e.header.length >= 3 && e.rows.length ? "u-table u-table--stack" : "u-table"}" role="table"><thead role="rowgroup">${n(e.header)}</thead>${r}</table></div>\n`;
|
|
3551
3546
|
} finally {
|
|
3552
|
-
|
|
3547
|
+
v = !1;
|
|
3553
3548
|
}
|
|
3554
3549
|
};
|
|
3555
|
-
let
|
|
3556
|
-
|
|
3557
|
-
function
|
|
3550
|
+
let de = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
|
|
3551
|
+
h.code = ({ text: e }) => de.test(e) ? `<pre class="mermaid">${To(e)}</pre>` : `<pre><code>${To(e)}</code></pre>`;
|
|
3552
|
+
function pe(e) {
|
|
3558
3553
|
return e.replace(/\\\[([\s\S]*?)\\\]/g, (e, t) => `$$${t}$$`).replace(/\\\(([\s\S]*?)\\\)/g, (e, t) => `$${t}$`).replace(/^(\d+)\.(?!\s)/gm, "$1\\.");
|
|
3559
3554
|
}
|
|
3560
|
-
function
|
|
3555
|
+
function y(e) {
|
|
3561
3556
|
let t = /* @__PURE__ */ new Set(), n = /^(`{3,}|~{3,})[^\n]*\n([\s\S]*?)\n\1/gm, r;
|
|
3562
3557
|
for (; (r = n.exec(e)) !== null;) for (let e = r.index; e < r.index + r[0].length; e++) t.add(e);
|
|
3563
3558
|
return e.replace(/[{[]([\s\S]*?)[}\]]/g, (e, n, r) => {
|
|
@@ -3569,31 +3564,31 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3569
3564
|
}
|
|
3570
3565
|
}).replace(/\n{3,}/g, "\n\n");
|
|
3571
3566
|
}
|
|
3572
|
-
let
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
],
|
|
3578
|
-
let e =
|
|
3579
|
-
return
|
|
3567
|
+
let me = [
|
|
3568
|
+
fe,
|
|
3569
|
+
y,
|
|
3570
|
+
fr,
|
|
3571
|
+
pe
|
|
3572
|
+
], b = i("container"), he = se(d(c, "markdown"), jo), ge = s(() => c.tailLength ? T(he.value, c.tailLength) : he.value), { resolveText: _e } = ce(), ve = _e(ge), ye = _(), be = s(() => {
|
|
3573
|
+
let e = me.reduce((e, t) => t(e), ve.value);
|
|
3574
|
+
return ko(W.parse(e, {
|
|
3580
3575
|
async: !1,
|
|
3581
3576
|
breaks: !0,
|
|
3582
|
-
renderer:
|
|
3583
|
-
}),
|
|
3584
|
-
canLoad:
|
|
3585
|
-
hostOf:
|
|
3577
|
+
renderer: h
|
|
3578
|
+
}), ye.isGated.value ? {
|
|
3579
|
+
canLoad: ye.canLoad,
|
|
3580
|
+
hostOf: ye.hostOf,
|
|
3586
3581
|
label: (e) => l("label.imageHeld", { host: e })
|
|
3587
3582
|
} : void 0);
|
|
3588
3583
|
});
|
|
3589
|
-
function
|
|
3590
|
-
let t = (e.target?.closest?.(`[${
|
|
3591
|
-
t && (e.preventDefault(), e.stopPropagation(),
|
|
3584
|
+
function x(e) {
|
|
3585
|
+
let t = (e.target?.closest?.(`[${Oo}]`))?.getAttribute(Oo);
|
|
3586
|
+
t && (e.preventDefault(), e.stopPropagation(), ye.release(t));
|
|
3592
3587
|
}
|
|
3593
|
-
async function
|
|
3588
|
+
async function xe() {
|
|
3594
3589
|
if (c.loading) return;
|
|
3595
3590
|
await n();
|
|
3596
|
-
let e =
|
|
3591
|
+
let e = b.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
|
|
3597
3592
|
if (!e?.length) return;
|
|
3598
3593
|
let { renderMermaidSVG: t, THEMES: r } = await te(), i = c.isDark ? r["github-dark"] : r["github-light"];
|
|
3599
3594
|
for (let n of Array.from(e)) {
|
|
@@ -3605,19 +3600,19 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3605
3600
|
} catch {}
|
|
3606
3601
|
}
|
|
3607
3602
|
}
|
|
3608
|
-
async function
|
|
3603
|
+
async function Se() {
|
|
3609
3604
|
await n();
|
|
3610
|
-
let e =
|
|
3605
|
+
let e = b.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
|
|
3611
3606
|
if (!e?.length) return;
|
|
3612
3607
|
let t = (await import("https://cdn.jsdelivr.net/npm/highlight.js@11/es/common.js")).default;
|
|
3613
3608
|
for (let n of e) t.highlightElement(n), n.setAttribute("data-highlighted", "true");
|
|
3614
3609
|
}
|
|
3615
|
-
async function
|
|
3610
|
+
async function Ce() {
|
|
3616
3611
|
await n();
|
|
3617
|
-
let e =
|
|
3612
|
+
let e = b.value?.querySelectorAll(".katex-pending");
|
|
3618
3613
|
if (!e?.length) return;
|
|
3619
3614
|
let t = await re();
|
|
3620
|
-
p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", ee(
|
|
3615
|
+
p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", ee(b.value));
|
|
3621
3616
|
for (let n of Array.from(e)) {
|
|
3622
3617
|
if (!n.isConnected) continue;
|
|
3623
3618
|
let e = n.dataset.katex;
|
|
@@ -3631,9 +3626,9 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3631
3626
|
} catch {}
|
|
3632
3627
|
}
|
|
3633
3628
|
}
|
|
3634
|
-
async function
|
|
3629
|
+
async function we() {
|
|
3635
3630
|
await n();
|
|
3636
|
-
let e =
|
|
3631
|
+
let e = b.value?.querySelectorAll("pre.mermaid[data-rendered]");
|
|
3637
3632
|
if (!e?.length) return;
|
|
3638
3633
|
let { renderMermaidSVG: t, THEMES: r } = await te(), i = c.isDark ? r["github-dark"] : r["github-light"];
|
|
3639
3634
|
for (let n of Array.from(e)) {
|
|
@@ -3644,7 +3639,7 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3644
3639
|
} catch {}
|
|
3645
3640
|
}
|
|
3646
3641
|
}
|
|
3647
|
-
function
|
|
3642
|
+
function Te(e) {
|
|
3648
3643
|
let t = e.target;
|
|
3649
3644
|
if (!(t instanceof HTMLImageElement) || t.dataset.broken) return;
|
|
3650
3645
|
t.dataset.broken = "true";
|
|
@@ -3652,60 +3647,60 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3652
3647
|
n.className = "markdown-broken-image", n.textContent = t.alt || l("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
|
|
3653
3648
|
}
|
|
3654
3649
|
t(() => {
|
|
3655
|
-
|
|
3650
|
+
b.value?.addEventListener("error", Te, !0);
|
|
3656
3651
|
}), e(() => {
|
|
3657
|
-
|
|
3658
|
-
}), a([
|
|
3659
|
-
let
|
|
3660
|
-
function
|
|
3652
|
+
b.value?.removeEventListener("error", Te, !0);
|
|
3653
|
+
}), a([be, () => c.loading], xe, { immediate: !0 }), a(() => c.isDark, we), a(be, Se, { immediate: !0 }), a(be, Ce, { immediate: !0 });
|
|
3654
|
+
let S = 0;
|
|
3655
|
+
function Ee(e, t) {
|
|
3661
3656
|
let n = document.createElement("span");
|
|
3662
3657
|
return n.style.cssText = `animation:ft-${c.animation} ${c.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
|
|
3663
3658
|
let t = n.parentNode;
|
|
3664
3659
|
t && (t.replaceChild(document.createTextNode(e), n), t.normalize());
|
|
3665
3660
|
}, { once: !0 }), n;
|
|
3666
3661
|
}
|
|
3667
|
-
function
|
|
3662
|
+
function De(e, t, n, r) {
|
|
3668
3663
|
let i = r, a = e.split(/(\s+)/);
|
|
3669
|
-
for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(
|
|
3664
|
+
for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(Ee(e, i * 30), n), i++));
|
|
3670
3665
|
return i;
|
|
3671
3666
|
}
|
|
3672
|
-
function
|
|
3667
|
+
function Oe(e) {
|
|
3673
3668
|
let t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode(e) {
|
|
3674
3669
|
return e.parentElement?.closest("pre, code, .katex-pending, .markdown-broken-image") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
3675
3670
|
} }), n = [];
|
|
3676
3671
|
for (; t.nextNode();) n.push(t.currentNode);
|
|
3677
3672
|
return n;
|
|
3678
3673
|
}
|
|
3679
|
-
function
|
|
3680
|
-
if (!
|
|
3681
|
-
let e =
|
|
3674
|
+
function C() {
|
|
3675
|
+
if (!b.value || !c.loading || !c.animation) return;
|
|
3676
|
+
let e = Oe(b.value), t = 0, n = 0;
|
|
3682
3677
|
for (let r of e) {
|
|
3683
3678
|
let e = r.textContent || "", i = t, a = t + e.length;
|
|
3684
|
-
if (t = a, a <=
|
|
3679
|
+
if (t = a, a <= S) continue;
|
|
3685
3680
|
let o = r.parentNode;
|
|
3686
3681
|
if (!o) continue;
|
|
3687
|
-
if (i >=
|
|
3682
|
+
if (i >= S) {
|
|
3688
3683
|
let t = r.nextSibling;
|
|
3689
|
-
o.removeChild(r), n =
|
|
3684
|
+
o.removeChild(r), n = De(e, o, t, n);
|
|
3690
3685
|
continue;
|
|
3691
3686
|
}
|
|
3692
|
-
let s =
|
|
3693
|
-
o.removeChild(c), n =
|
|
3687
|
+
let s = S - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
|
|
3688
|
+
o.removeChild(c), n = De(l, o, u, n);
|
|
3694
3689
|
}
|
|
3695
|
-
|
|
3690
|
+
S = t;
|
|
3696
3691
|
}
|
|
3697
|
-
return a(
|
|
3698
|
-
await n(),
|
|
3692
|
+
return a(be, async () => {
|
|
3693
|
+
await n(), C();
|
|
3699
3694
|
}, { immediate: !0 }), a(() => c.markdown, (e, t) => {
|
|
3700
|
-
(!e || t && e.length < t.length) && (
|
|
3695
|
+
(!e || t && e.length < t.length) && (S = 0);
|
|
3701
3696
|
}), (e, t) => (r(), u("div", {
|
|
3702
3697
|
ref: "container",
|
|
3703
|
-
onClick:
|
|
3704
|
-
innerHTML:
|
|
3705
|
-
}, null, 8,
|
|
3698
|
+
onClick: x,
|
|
3699
|
+
innerHTML: be.value
|
|
3700
|
+
}, null, 8, Ao));
|
|
3706
3701
|
}
|
|
3707
3702
|
}), [["styles", [".markdown-held-image{max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-3);font:inherit;font-size:var(--text-12);vertical-align:middle;cursor:pointer;align-items:center;display:inline-flex}.markdown-held-image:hover,.markdown-held-image:focus-visible{background-color:var(--color-surface-2);color:var(--color-word-2)}.markdown-broken-image{align-items:center;gap:var(--spacing-4);max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-4);font-size:var(--text-12);vertical-align:middle;display:inline-flex}@keyframes ft-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes ft-blurIn{0%{opacity:0;filter:blur(4px)}to{opacity:1;filter:blur()}}@keyframes ft-dropIn{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-slideUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-fadeAndScale{0%{opacity:0;transform:scale(.85)}to{opacity:1;transform:scale(1)}}"]]]);
|
|
3708
3703
|
//#endregion
|
|
3709
|
-
export {
|
|
3704
|
+
export { O as A, _e as B, ke as C, we as D, x as E, ye as F, b as I, ve as L, ge as M, be as N, Re as O, me as P, pe as R, C as S, tt as T, nt as _, ze as a, Je as b, Ue as c, Be as d, S as f, Ie as g, et as h, Ke as i, he as j, Ve as k, Ge as l, Le as m, Ne as n, Se as o, Ze as p, w as r, Te as s, Mo as t, We as u, Xe as v, Pe as w, Fe as x, He as y, y as z };
|
|
3710
3705
|
|
|
3711
|
-
//# sourceMappingURL=PkStreamingMarkdown-
|
|
3706
|
+
//# sourceMappingURL=PkStreamingMarkdown-BnClGp-3.js.map
|