@8wave/ai-elements 0.115.0-beta.34 → 0.115.0-beta.47
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-Cu04vBnd.js → Agent-D3cVY0pk.js} +121 -110
- package/dist/_chunks/Agent-D3cVY0pk.js.map +1 -0
- package/dist/_chunks/PkHeldImage-BtaPh0Jr.js +42 -0
- package/dist/_chunks/PkHeldImage-BtaPh0Jr.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-Qk9Tk_N7.js → PkStreamingMarkdown-DyvZ5xKK.js} +782 -741
- package/dist/_chunks/PkStreamingMarkdown-DyvZ5xKK.js.map +1 -0
- package/dist/_chunks/{PkToolRequestGeolocation-BoKYkQ-Z.js → PkToolRequestGeolocation-DjRmmYMk.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-BoKYkQ-Z.js.map → PkToolRequestGeolocation-DjRmmYMk.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-CDzpfBg6.js → PkToolRequestOAuthConnection-CJ8dg2RY.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-CDzpfBg6.js.map → PkToolRequestOAuthConnection-CJ8dg2RY.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-DB8JjN-b.js → PkToolShowArtifact-Bk-xmGxl.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-DB8JjN-b.js.map → PkToolShowArtifact-Bk-xmGxl.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-DHviNxDk.js → PkToolShowContactForm-B0o6CY0Q.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-DHviNxDk.js.map → PkToolShowContactForm-B0o6CY0Q.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-B-R9fh3R.js → PkToolShowForm-C4-KAKPL.js} +3 -3
- package/dist/_chunks/{PkToolShowForm-B-R9fh3R.js.map → PkToolShowForm-C4-KAKPL.js.map} +1 -1
- package/dist/_chunks/PkToolShowImageGallery-Jdo7p2mZ.js +88 -0
- package/dist/_chunks/PkToolShowImageGallery-Jdo7p2mZ.js.map +1 -0
- package/dist/_chunks/PkToolShowProductList-Cfk865KB.js +72 -0
- package/dist/_chunks/PkToolShowProductList-Cfk865KB.js.map +1 -0
- package/dist/_chunks/{PkToolShowSources-CfZEfleZ.js → PkToolShowSources-qqUbdWzN.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-CfZEfleZ.js.map → PkToolShowSources-qqUbdWzN.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-DsB35hRR.js → PkToolShowSuggestedReply-Dk6Nu9cG.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-DsB35hRR.js.map → PkToolShowSuggestedReply-Dk6Nu9cG.js.map} +1 -1
- package/dist/_chunks/PkToolShowVideo-D07i4hVd.js +142 -0
- package/dist/_chunks/PkToolShowVideo-D07i4hVd.js.map +1 -0
- package/dist/_chunks/{PkToolShowWebPages-BOxbTe2X.js → PkToolShowWebPages-ksXRNsDK.js} +31 -24
- package/dist/_chunks/PkToolShowWebPages-ksXRNsDK.js.map +1 -0
- package/dist/_chunks/chatImagePolicy-B1iRRLAB.js +46 -0
- package/dist/_chunks/chatImagePolicy-B1iRRLAB.js.map +1 -0
- package/dist/_chunks/{markdown-_p-gd9w8.js → markdown-DOitQ2jz.js} +13 -13
- package/dist/_chunks/{markdown-_p-gd9w8.js.map → markdown-DOitQ2jz.js.map} +1 -1
- package/dist/ai-elements.es.js +1720 -1713
- 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-KbZm8GvA.js → Agent-C4p46YGt.js} +67 -56
- package/dist-vue/_chunks/Agent-C4p46YGt.js.map +1 -0
- package/dist-vue/_chunks/{Document-DCSWwcRE.js → Document-B9QaYHKT.js} +10 -10
- package/dist-vue/_chunks/{Document-DCSWwcRE.js.map → Document-B9QaYHKT.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbot-BkMe7zxp.js +275 -0
- package/dist-vue/_chunks/PkChatbot-BkMe7zxp.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotEmptyState-CO7-vlsZ.js → PkChatbotEmptyState-HElKT2OO.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-CO7-vlsZ.js.map → PkChatbotEmptyState-HElKT2OO.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-D8ykcHKJ.js → PkChatbotInput-BykvFqbm.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-D8ykcHKJ.js.map → PkChatbotInput-BykvFqbm.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-UT72KC_z.js → PkChatbotMessages-wH9wxc6Y.js} +19 -19
- package/dist-vue/_chunks/{PkChatbotMessages-UT72KC_z.js.map → PkChatbotMessages-wH9wxc6Y.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-CSVHe7DP.js → PkChatbotStepPayload-DY0AzM6s.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-CSVHe7DP.js.map → PkChatbotStepPayload-DY0AzM6s.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-ixte-rGB.js → PkChatbotStepToolDetail-AXtXQVQY.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-ixte-rGB.js.map → PkChatbotStepToolDetail-AXtXQVQY.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-Y6kQ00ui.js → PkChatbotSteps-B-yrfTat.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-Y6kQ00ui.js.map → PkChatbotSteps-B-yrfTat.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-D3PwREDw.js → PkChatbotViewChat-CCcMnVkM.js} +7 -7
- package/dist-vue/_chunks/{PkChatbotViewChat-D3PwREDw.js.map → PkChatbotViewChat-CCcMnVkM.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-dpwDFyr_.js → PkChatbotViewConversations-C9h_bBIc.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-dpwDFyr_.js.map → PkChatbotViewConversations-C9h_bBIc.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-BStYLY2B.js → PkChatbotViewFiles-BkoXgGE6.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-BStYLY2B.js.map → PkChatbotViewFiles-BkoXgGE6.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-Brylm3We.js → PkChatbotViewProfile-CFR0B99Z.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-Brylm3We.js.map → PkChatbotViewProfile-CFR0B99Z.js.map} +1 -1
- package/dist-vue/_chunks/PkHeldImage-BqnlurT_.js +41 -0
- package/dist-vue/_chunks/PkHeldImage-BqnlurT_.js.map +1 -0
- package/dist-vue/_chunks/{PkStreamingMarkdown-CJlfq7ub.js → PkStreamingMarkdown-XJBXdSG2.js} +792 -780
- package/dist-vue/_chunks/PkStreamingMarkdown-XJBXdSG2.js.map +1 -0
- package/dist-vue/_chunks/{PkToolRequestGeolocation-C8sLjD6g.js → PkToolRequestGeolocation-DpvsFEga.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-C8sLjD6g.js.map → PkToolRequestGeolocation-DpvsFEga.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-rbjNi_l0.js → PkToolRequestOAuthConnection-DRefs-S1.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-rbjNi_l0.js.map → PkToolRequestOAuthConnection-DRefs-S1.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-hBmAAfsd.js → PkToolShowArtifact-BopCMkyZ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-hBmAAfsd.js.map → PkToolShowArtifact-BopCMkyZ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-BHsm_W2R.js → PkToolShowContactForm-C6F_DdBu.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-BHsm_W2R.js.map → PkToolShowContactForm-C6F_DdBu.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-De2XvRnq.js → PkToolShowDiagram-7-m7VrED.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-De2XvRnq.js.map → PkToolShowDiagram-7-m7VrED.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowEmail-D1mXZrT-.js → PkToolShowEmail-C591LR5N.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowEmail-D1mXZrT-.js.map → PkToolShowEmail-C591LR5N.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-Ce_GpcBt.js → PkToolShowForm-DEr8wDJi.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-Ce_GpcBt.js.map → PkToolShowForm-DEr8wDJi.js.map} +1 -1
- package/dist-vue/_chunks/PkToolShowImageGallery-D44wf_u3.js +88 -0
- package/dist-vue/_chunks/PkToolShowImageGallery-D44wf_u3.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowMessage-lNPZxw2v.js → PkToolShowMessage-CbXERPHI.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowMessage-lNPZxw2v.js.map → PkToolShowMessage-CbXERPHI.js.map} +1 -1
- package/dist-vue/_chunks/PkToolShowProductList-C6CVRUlD.js +72 -0
- package/dist-vue/_chunks/PkToolShowProductList-C6CVRUlD.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowSources-B1Nhrk7O.js → PkToolShowSources-DzUNanmK.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowSources-B1Nhrk7O.js.map → PkToolShowSources-DzUNanmK.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-Bmzygdww.js → PkToolShowSuggestedReply-DhNtI5gJ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-Bmzygdww.js.map → PkToolShowSuggestedReply-DhNtI5gJ.js.map} +1 -1
- package/dist-vue/_chunks/PkToolShowVideo-HbQzTMh5.js +141 -0
- package/dist-vue/_chunks/PkToolShowVideo-HbQzTMh5.js.map +1 -0
- package/dist-vue/_chunks/PkToolShowWebPages-Ct1HaCSq.js +86 -0
- package/dist-vue/_chunks/PkToolShowWebPages-Ct1HaCSq.js.map +1 -0
- package/dist-vue/_chunks/{PkUrl-E12f7rn_.js → PkUrl-CN1kkZiH.js} +2 -2
- package/dist-vue/_chunks/{PkUrl-E12f7rn_.js.map → PkUrl-CN1kkZiH.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-B_mkyrEl.js → createChatbotApiClient-B2PvUG07.js} +16 -16
- package/dist-vue/_chunks/{createChatbotApiClient-B_mkyrEl.js.map → createChatbotApiClient-B2PvUG07.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-DEELIJ89.js → useChatbotStore-Cj_UmNH3.js} +3 -3
- package/dist-vue/_chunks/{useChatbotStore-DEELIJ89.js.map → useChatbotStore-Cj_UmNH3.js.map} +1 -1
- package/dist-vue/_chunks/useShortUrlResolver-DI8ycJiO.js +71 -0
- package/dist-vue/_chunks/useShortUrlResolver-DI8ycJiO.js.map +1 -0
- package/dist-vue/_chunks/{utils-CtD8DCrq.js → utils-DXXzMVU3.js} +2 -2
- package/dist-vue/_chunks/{utils-CtD8DCrq.js.map → utils-DXXzMVU3.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +2 -0
- package/dist-vue/composables.js +11 -7
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +3444 -3400
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +12 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +6 -2
- package/dist-vue/packages/components/src/chat/PkHeldImage.d.ts +21 -0
- package/dist-vue/packages/components/src/chat/chatImagePolicy.d.ts +55 -0
- package/dist-vue/packages/components/src/chat/index.d.ts +1 -0
- package/dist-vue/packages/components/src/chat/markdownHtml.d.ts +17 -1
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +6 -0
- package/dist-vue/packages/models/src/schema/Agent.d.ts +14 -0
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +2 -0
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +2 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-Cu04vBnd.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown-Qk9Tk_N7.js.map +0 -1
- package/dist/_chunks/PkToolShowImageGallery-FubPWFCb.js +0 -75
- package/dist/_chunks/PkToolShowImageGallery-FubPWFCb.js.map +0 -1
- package/dist/_chunks/PkToolShowProductList-DFy2jxn4.js +0 -65
- package/dist/_chunks/PkToolShowProductList-DFy2jxn4.js.map +0 -1
- package/dist/_chunks/PkToolShowVideo-DClps9oP.js +0 -123
- package/dist/_chunks/PkToolShowVideo-DClps9oP.js.map +0 -1
- package/dist/_chunks/PkToolShowWebPages-BOxbTe2X.js.map +0 -1
- package/dist-vue/_chunks/Agent-KbZm8GvA.js.map +0 -1
- package/dist-vue/_chunks/PkChatbot-CRb-U8e3.js +0 -272
- package/dist-vue/_chunks/PkChatbot-CRb-U8e3.js.map +0 -1
- package/dist-vue/_chunks/PkStreamingMarkdown-CJlfq7ub.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowImageGallery-DmhZLnBk.js +0 -75
- package/dist-vue/_chunks/PkToolShowImageGallery-DmhZLnBk.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowProductList-BW5pRFe4.js +0 -65
- package/dist-vue/_chunks/PkToolShowProductList-BW5pRFe4.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowVideo-BZOTu2Qe.js +0 -122
- package/dist-vue/_chunks/PkToolShowVideo-BZOTu2Qe.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowWebPages-BiIBRV_n.js +0 -79
- package/dist-vue/_chunks/PkToolShowWebPages-BiIBRV_n.js.map +0 -1
package/dist-vue/_chunks/{PkStreamingMarkdown-CJlfq7ub.js → PkStreamingMarkdown-XJBXdSG2.js}
RENAMED
|
@@ -1,110 +1,45 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as e } from "./Agent-C4p46YGt.js";
|
|
2
|
+
import { n as t, t as n } from "./cdn-css-JUUNhyQ6.js";
|
|
2
3
|
import "./src-DT8FLE4_.js";
|
|
3
|
-
import { n } from "./url-validation-9DstIfq2.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { i as r, n as i } from "./url-validation-9DstIfq2.js";
|
|
5
|
+
import { n as a } from "./useShortUrlResolver-DI8ycJiO.js";
|
|
6
|
+
import { l as o } from "./utils-DXXzMVU3.js";
|
|
7
|
+
import { computed as s, createElementBlock as c, defineComponent as l, inject as u, nextTick as d, onBeforeUnmount as f, onMounted as p, openBlock as ee, provide as te, ref as m, toRef as ne, useTemplateRef as re, watch as h } from "vue";
|
|
8
|
+
import { useI18n as ie } from "vue-i18n";
|
|
9
|
+
import { refThrottled as ae } from "@vueuse/core";
|
|
8
10
|
//#region ../../packages/utils/src/citations.ts
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
return e && e.replace(
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region ../../packages/composable/src/chatbot/useShortUrlResolver.ts
|
|
15
|
-
var ce = /\/api\/r\/([A-Za-z0-9_-]{1,20})(?:[?#]|$)/, g = /https?:\/\/[^\s)"'<>]*\/api\/r\/([A-Za-z0-9_-]{1,20})/g;
|
|
16
|
-
function _(e) {
|
|
17
|
-
return ce.exec(e)?.[1];
|
|
18
|
-
}
|
|
19
|
-
function le(e) {
|
|
20
|
-
let t = p(/* @__PURE__ */ new Map()), n = p(/* @__PURE__ */ new Set()), r = /* @__PURE__ */ new Set(), a = !1;
|
|
21
|
-
async function o() {
|
|
22
|
-
a = !1;
|
|
23
|
-
let i = [...r];
|
|
24
|
-
if (r.clear(), i.length !== 0) try {
|
|
25
|
-
let n = await e(i);
|
|
26
|
-
for (let [e, r] of Object.entries(n)) t.set(e, r);
|
|
27
|
-
} catch {} finally {
|
|
28
|
-
for (let e of i) n.add(e);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function s(e) {
|
|
32
|
-
t.has(e) || r.has(e) || (r.add(e), a || (a = !0, queueMicrotask(o)));
|
|
33
|
-
}
|
|
34
|
-
function c(e) {
|
|
35
|
-
return i(() => {
|
|
36
|
-
let r = te(e), i = r ? _(r) : void 0;
|
|
37
|
-
if (!i) return {
|
|
38
|
-
url: r,
|
|
39
|
-
loading: !1
|
|
40
|
-
};
|
|
41
|
-
let a = t.get(i);
|
|
42
|
-
return a === void 0 ? (s(i), {
|
|
43
|
-
url: r,
|
|
44
|
-
loading: !n.has(i)
|
|
45
|
-
}) : {
|
|
46
|
-
url: a,
|
|
47
|
-
loading: !1
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
function l(e) {
|
|
52
|
-
return i(() => {
|
|
53
|
-
let n = te(e) ?? "";
|
|
54
|
-
return n && n.replace(g, (e, n) => {
|
|
55
|
-
let r = t.get(n);
|
|
56
|
-
return r === void 0 ? (s(n), e) : r;
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
resolve: c,
|
|
62
|
-
resolveText: l
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
var ue = Symbol("shortUrlResolver");
|
|
66
|
-
function de(e) {
|
|
67
|
-
let t = le(e);
|
|
68
|
-
return f(ue, t), t;
|
|
69
|
-
}
|
|
70
|
-
var fe = {
|
|
71
|
-
resolve: (e) => i(() => ({
|
|
72
|
-
url: te(e),
|
|
73
|
-
loading: !1
|
|
74
|
-
})),
|
|
75
|
-
resolveText: (e) => i(() => te(e) ?? "")
|
|
76
|
-
};
|
|
77
|
-
function pe() {
|
|
78
|
-
return s(ue, fe);
|
|
11
|
+
var oe = /[ \t]*\uE200[^\uE201]*\uE201/g, se = /[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, ce = /[\uE200-\uE20F]/g;
|
|
12
|
+
function g(e) {
|
|
13
|
+
return e && e.replace(oe, "").replace(se, "").replace(ce, "");
|
|
79
14
|
}
|
|
80
15
|
//#endregion
|
|
81
16
|
//#region ../../node_modules/.pnpm/remend@1.4.0/node_modules/remend/dist/index.js
|
|
82
|
-
var
|
|
17
|
+
var _ = Object.defineProperty, le = Object.defineProperties, ue = Object.getOwnPropertyDescriptors, v = Object.getOwnPropertySymbols, de = Object.prototype.hasOwnProperty, fe = Object.prototype.propertyIsEnumerable, pe = (e, t, n) => t in e ? _(e, t, {
|
|
83
18
|
enumerable: !0,
|
|
84
19
|
configurable: !0,
|
|
85
20
|
writable: !0,
|
|
86
21
|
value: n
|
|
87
|
-
}) : e[t] = n,
|
|
88
|
-
for (var n in t ||= {})
|
|
89
|
-
if (v) for (var n of v(t))
|
|
22
|
+
}) : e[t] = n, me = (e, t) => {
|
|
23
|
+
for (var n in t ||= {}) de.call(t, n) && pe(e, n, t[n]);
|
|
24
|
+
if (v) for (var n of v(t)) fe.call(t, n) && pe(e, n, t[n]);
|
|
90
25
|
return e;
|
|
91
|
-
},
|
|
26
|
+
}, he = (e, t) => le(e, ue(t)), y = {
|
|
92
27
|
PROSE: 0,
|
|
93
28
|
FENCE_MARKER: 1,
|
|
94
29
|
FENCE_INFO: 2,
|
|
95
30
|
FENCE_BODY: 3,
|
|
96
31
|
CODE_SPAN: 4,
|
|
97
32
|
CODE_SPAN_OPEN: 5
|
|
98
|
-
},
|
|
33
|
+
}, ge = /^(`{3,}|~{3,})(.*)$/, _e = (e) => e !== void 0 && e >= "0" && e <= "9", ve = (e, t) => {
|
|
99
34
|
let n = t;
|
|
100
35
|
if (e[n] === "-" || e[n] === "*" || e[n] === "+") n += 1;
|
|
101
36
|
else {
|
|
102
|
-
for (;
|
|
37
|
+
for (; _e(e[n]) && n - t < 9;) n += 1;
|
|
103
38
|
if (n === t || e[n] !== "." && e[n] !== ")") return -1;
|
|
104
39
|
n += 1;
|
|
105
40
|
}
|
|
106
41
|
return e[n] === " " ? n + 1 : -1;
|
|
107
|
-
},
|
|
42
|
+
}, ye = (e, t, n) => {
|
|
108
43
|
let r = 0, i = t, a = !1, o = t;
|
|
109
44
|
for (;;) {
|
|
110
45
|
for (; o < n && e[o] === " ";) o += 1;
|
|
@@ -112,7 +47,7 @@ var me = Object.defineProperty, he = Object.defineProperties, ge = Object.getOwn
|
|
|
112
47
|
r += 1, o += e[o + 1] === " " ? 2 : 1, i = o, a = !1;
|
|
113
48
|
continue;
|
|
114
49
|
}
|
|
115
|
-
let t = o < n ?
|
|
50
|
+
let t = o < n ? ve(e, o) : -1;
|
|
116
51
|
if (t === -1) return {
|
|
117
52
|
contentStart: o,
|
|
118
53
|
listIndent: a ? o - i : 0,
|
|
@@ -120,7 +55,7 @@ var me = Object.defineProperty, he = Object.defineProperties, ge = Object.getOwn
|
|
|
120
55
|
};
|
|
121
56
|
o = t, a = !0;
|
|
122
57
|
}
|
|
123
|
-
},
|
|
58
|
+
}, b = (e, t, n, r) => {
|
|
124
59
|
let i = t;
|
|
125
60
|
for (let t = 0; t < r; t += 1) {
|
|
126
61
|
for (; i < n && e[i] === " ";) i += 1;
|
|
@@ -128,10 +63,10 @@ var me = Object.defineProperty, he = Object.defineProperties, ge = Object.getOwn
|
|
|
128
63
|
i += 1, e[i] === " " && (i += 1);
|
|
129
64
|
}
|
|
130
65
|
return i;
|
|
131
|
-
},
|
|
66
|
+
}, be = (e, t, n, r, i) => {
|
|
132
67
|
let a = t + r;
|
|
133
|
-
e.fill(
|
|
134
|
-
},
|
|
68
|
+
e.fill(y.FENCE_MARKER, a, a + i), e.fill(y.FENCE_INFO, a + i, Math.min(n + 1, e.length));
|
|
69
|
+
}, xe = (e, t, n, r) => {
|
|
135
70
|
let i = t;
|
|
136
71
|
for (; i < n && e[i] === " ";) i += 1;
|
|
137
72
|
let a = 0;
|
|
@@ -142,62 +77,62 @@ var me = Object.defineProperty, he = Object.defineProperties, ge = Object.getOwn
|
|
|
142
77
|
i += 1;
|
|
143
78
|
}
|
|
144
79
|
return !0;
|
|
145
|
-
},
|
|
146
|
-
let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a =
|
|
80
|
+
}, Se = (e, t, n, r) => {
|
|
81
|
+
let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a = ye(e, n, i), o = e.slice(a.contentStart, i).match(ge);
|
|
147
82
|
if (!o) return null;
|
|
148
83
|
let [, s, c] = o, l = s[0];
|
|
149
|
-
return l === "`" && c.includes("`") ? null : (
|
|
84
|
+
return l === "`" && c.includes("`") ? null : (be(t, n, r, a.contentStart - n, s.length), {
|
|
150
85
|
char: l,
|
|
151
86
|
length: s.length,
|
|
152
87
|
listIndent: a.listIndent,
|
|
153
88
|
quoteDepth: a.quoteDepth
|
|
154
89
|
});
|
|
155
|
-
},
|
|
156
|
-
let i =
|
|
90
|
+
}, Ce = (e, t, n, r) => {
|
|
91
|
+
let i = b(e, t, n, r.quoteDepth);
|
|
157
92
|
if (i === -1 || r.listIndent === 0) return i;
|
|
158
93
|
let a = i;
|
|
159
94
|
for (; a < n && e[a] === " ";) a += 1;
|
|
160
95
|
return a === n || e[a] === "\r" && a + 1 === n || a - i >= r.listIndent ? i : -1;
|
|
161
|
-
},
|
|
96
|
+
}, we = (e, t) => {
|
|
162
97
|
let n = e.length, r = null, i = 0;
|
|
163
98
|
for (; i < n;) {
|
|
164
99
|
let a = e.indexOf("\n", i);
|
|
165
100
|
a === -1 && (a = n);
|
|
166
|
-
let o = r ?
|
|
167
|
-
r && o === -1 && (r = null), r ?
|
|
101
|
+
let o = r ? Ce(e, i, a, r) : -1;
|
|
102
|
+
r && o === -1 && (r = null), r ? xe(e, o, a, r) ? (t.fill(y.FENCE_MARKER, i, a), r = null) : t.fill(y.FENCE_BODY, i, Math.min(a + 1, n)) : r = Se(e, t, i, a), i = a + 1;
|
|
168
103
|
}
|
|
169
104
|
return r;
|
|
170
|
-
},
|
|
105
|
+
}, Te = (e, t) => {
|
|
171
106
|
let n = t + 1;
|
|
172
107
|
for (; n < e.length && e[n] === "`";) n += 1;
|
|
173
108
|
return n;
|
|
174
|
-
},
|
|
109
|
+
}, Ee = (e, t) => {
|
|
175
110
|
let n = t + 1;
|
|
176
111
|
for (; n < e.length && (e[n] === " " || e[n] === " " || e[n] === "\r");) n += 1;
|
|
177
112
|
return n < e.length && e[n] === "\n";
|
|
178
|
-
},
|
|
113
|
+
}, De = (e, t, n) => {
|
|
179
114
|
let r = n;
|
|
180
115
|
for (;;) {
|
|
181
116
|
let n = e.indexOf("`", r);
|
|
182
117
|
if (n === -1) return -1;
|
|
183
|
-
let i = n > r && e[n - 1] === "\\" && t[n - 1] ===
|
|
184
|
-
if (t[n] ===
|
|
118
|
+
let i = n > r && e[n - 1] === "\\" && t[n - 1] === y.PROSE;
|
|
119
|
+
if (t[n] === y.PROSE && !i) return n;
|
|
185
120
|
r = n + 1;
|
|
186
121
|
}
|
|
187
|
-
},
|
|
122
|
+
}, Oe = (e, t) => {
|
|
188
123
|
let n = e.length, r = -1, i = 0, a = 0;
|
|
189
124
|
for (; a < n;) {
|
|
190
125
|
if (r < 0) {
|
|
191
|
-
if (a =
|
|
192
|
-
let n =
|
|
126
|
+
if (a = De(e, t, a), a === -1) break;
|
|
127
|
+
let n = Te(e, a);
|
|
193
128
|
r = a, i = n - a, a = n;
|
|
194
129
|
continue;
|
|
195
130
|
}
|
|
196
|
-
if (t[a] !==
|
|
197
|
-
t.fill(
|
|
131
|
+
if (t[a] !== y.PROSE) {
|
|
132
|
+
t.fill(y.CODE_SPAN_OPEN, r, a), r = -1, a += 1;
|
|
198
133
|
continue;
|
|
199
134
|
}
|
|
200
|
-
if (e[a] === "\n" &&
|
|
135
|
+
if (e[a] === "\n" && Ee(e, a)) {
|
|
201
136
|
r = -1, a += 1;
|
|
202
137
|
continue;
|
|
203
138
|
}
|
|
@@ -205,79 +140,79 @@ var me = Object.defineProperty, he = Object.defineProperties, ge = Object.getOwn
|
|
|
205
140
|
a += 1;
|
|
206
141
|
continue;
|
|
207
142
|
}
|
|
208
|
-
let n =
|
|
209
|
-
n - a === i && (t.fill(
|
|
143
|
+
let n = Te(e, a);
|
|
144
|
+
n - a === i && (t.fill(y.CODE_SPAN, r, n), r = -1), a = n;
|
|
210
145
|
}
|
|
211
|
-
return r >= 0 ? (t.fill(
|
|
146
|
+
return r >= 0 ? (t.fill(y.CODE_SPAN_OPEN, r, n), {
|
|
212
147
|
start: r,
|
|
213
148
|
runLength: i
|
|
214
149
|
}) : null;
|
|
215
|
-
},
|
|
150
|
+
}, x = (e) => {
|
|
216
151
|
let t = new Uint8Array(e.length);
|
|
217
152
|
return {
|
|
218
153
|
text: e,
|
|
219
154
|
regions: t,
|
|
220
|
-
openFence:
|
|
221
|
-
openSpan:
|
|
155
|
+
openFence: we(e, t),
|
|
156
|
+
openSpan: Oe(e, t),
|
|
222
157
|
mathMask: null,
|
|
223
158
|
linkUrlMask: null,
|
|
224
159
|
htmlTagMask: null
|
|
225
160
|
};
|
|
226
|
-
},
|
|
227
|
-
if (
|
|
228
|
-
let t =
|
|
229
|
-
return
|
|
230
|
-
},
|
|
231
|
-
|
|
232
|
-
},
|
|
233
|
-
let n =
|
|
234
|
-
for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] ===
|
|
161
|
+
}, ke = null, S = null, C = (e) => {
|
|
162
|
+
if (S !== null && e === ke) return S;
|
|
163
|
+
let t = x(e);
|
|
164
|
+
return ke = e, S = t, t;
|
|
165
|
+
}, w = () => {
|
|
166
|
+
ke = null, S = null;
|
|
167
|
+
}, Ae = (e, t) => t >= e.regions.length ? e.openFence !== null || e.openSpan !== null : t < 0 ? !1 : e.regions[t] !== y.PROSE, je = (e, t) => e.regions[t] === y.CODE_SPAN, T = (e, t) => {
|
|
168
|
+
let n = C(e), r = t + t, i = 0;
|
|
169
|
+
for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] === y.PROSE ? (i += 1, t += 2) : t += 1;
|
|
235
170
|
return i;
|
|
236
|
-
},
|
|
171
|
+
}, Me = /* @__PURE__ */ new Uint8Array(), Ne = (e) => e === "inlineLatex" || e === "blockLatex", Pe = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, Fe = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", E = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), Ie = (e, t, n) => {
|
|
237
172
|
let r = e[t + 1];
|
|
238
173
|
if (e[t] === "\\") {
|
|
239
174
|
if (r === "$") return {
|
|
240
175
|
context: n,
|
|
241
176
|
length: 2
|
|
242
177
|
};
|
|
243
|
-
let e =
|
|
178
|
+
let e = Pe(n, r);
|
|
244
179
|
return e === null ? null : {
|
|
245
180
|
context: e,
|
|
246
181
|
length: 2
|
|
247
182
|
};
|
|
248
183
|
}
|
|
249
|
-
if (e[t] === "$" && !
|
|
184
|
+
if (e[t] === "$" && !Ne(n)) {
|
|
250
185
|
let e = r === "$";
|
|
251
186
|
return {
|
|
252
|
-
context:
|
|
187
|
+
context: Fe(n, e),
|
|
253
188
|
length: e ? 2 : 1
|
|
254
189
|
};
|
|
255
190
|
}
|
|
256
191
|
return null;
|
|
257
|
-
},
|
|
192
|
+
}, Le = (e) => {
|
|
258
193
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = "none", o = 0;
|
|
259
194
|
for (; o < r;) {
|
|
260
195
|
i[o] = a === "none" ? 0 : 1;
|
|
261
|
-
let e = n[o] ===
|
|
196
|
+
let e = n[o] === y.PROSE ? Ie(t, o, a) : null;
|
|
262
197
|
e === null ? o += 1 : (a = e.context, e.length === 2 && (i[o + 1] = a === "none" ? 0 : 1), o += e.length);
|
|
263
198
|
}
|
|
264
199
|
return i;
|
|
265
|
-
},
|
|
200
|
+
}, D = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.mathMask === null && (e.mathMask = E(e.text) ? Le(e) : Me), e.mathMask[t] === 1), Re = (e, t, n, r) => {
|
|
266
201
|
let { text: i, regions: a } = e, o = new Uint8Array(n - t), s = 0;
|
|
267
|
-
for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] ===
|
|
202
|
+
for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] === y.PROSE && (s = 1), o[e - t] = s;
|
|
268
203
|
let c = !1;
|
|
269
|
-
for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] ===
|
|
270
|
-
},
|
|
204
|
+
for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] === y.PROSE && (i[e] === ")" ? c = !1 : i[e] === "(" && (c = e > 0 && i[e - 1] === "]"));
|
|
205
|
+
}, ze = (e) => {
|
|
271
206
|
let { text: t } = e, n = t.length, r = new Uint8Array(n), i = 0;
|
|
272
207
|
for (; i < n;) {
|
|
273
208
|
let a = t.indexOf("\n", i);
|
|
274
|
-
a === -1 && (a = n),
|
|
209
|
+
a === -1 && (a = n), Re(e, i, a, r), i = a + 1;
|
|
275
210
|
}
|
|
276
211
|
return r;
|
|
277
|
-
},
|
|
212
|
+
}, Be = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.linkUrlMask === null && (e.linkUrlMask = e.text.includes("](") ? ze(e) : Me), e.linkUrlMask[t] === 1), Ve = (e) => {
|
|
278
213
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = !1;
|
|
279
214
|
for (let e = 0; e < r; e += 1) if (t[e] === "\n") a = !1;
|
|
280
|
-
else if (i[e] = +!!a, n[e] ===
|
|
215
|
+
else if (i[e] = +!!a, n[e] === y.PROSE) {
|
|
281
216
|
if (t[e] === ">") a = !1;
|
|
282
217
|
else if (t[e] === "<") {
|
|
283
218
|
let n = t[e + 1];
|
|
@@ -285,56 +220,56 @@ var me = Object.defineProperty, he = Object.defineProperties, ge = Object.getOwn
|
|
|
285
220
|
}
|
|
286
221
|
}
|
|
287
222
|
return i;
|
|
288
|
-
},
|
|
223
|
+
}, He = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.htmlTagMask === null && (e.htmlTagMask = e.text.includes("<") ? Ve(e) : Me), e.htmlTagMask[t] === 1), O = (e, t) => Ae(C(e), t), k = (e, t) => je(C(e), t), Ue = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, We = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Ue, (t, n, r, i) => O(e, i) ? t : `${n}\\>${r}`), A = (e, { delimiter: t, markerLength: n, regex: r }) => {
|
|
289
224
|
let i = e.lastIndexOf(t, e.length - 2), a = i === -1 ? e.length - 1 : i;
|
|
290
225
|
return e.slice(Math.max(0, a - n + 1)).match(r);
|
|
291
|
-
},
|
|
226
|
+
}, Ge = {
|
|
292
227
|
delimiter: "*",
|
|
293
228
|
markerLength: 2,
|
|
294
229
|
regex: /(\*\*)([^*]*\*?)$/
|
|
295
|
-
},
|
|
230
|
+
}, Ke = {
|
|
296
231
|
delimiter: "_",
|
|
297
232
|
markerLength: 2,
|
|
298
233
|
regex: /(__)([^_]*?)$/
|
|
299
|
-
},
|
|
234
|
+
}, qe = {
|
|
300
235
|
delimiter: "*",
|
|
301
236
|
markerLength: 3,
|
|
302
237
|
regex: /(\*\*\*)([^*]*?)$/
|
|
303
|
-
},
|
|
238
|
+
}, Je = {
|
|
304
239
|
delimiter: "*",
|
|
305
240
|
markerLength: 1,
|
|
306
241
|
regex: /(\*)([^*]*?)$/
|
|
307
|
-
},
|
|
242
|
+
}, Ye = {
|
|
308
243
|
delimiter: "_",
|
|
309
244
|
markerLength: 1,
|
|
310
245
|
regex: /(_)([^_]*?)$/
|
|
311
|
-
},
|
|
246
|
+
}, Xe = {
|
|
312
247
|
delimiter: "~",
|
|
313
248
|
markerLength: 2,
|
|
314
249
|
regex: /(~~)([^~]*?)$/
|
|
315
|
-
},
|
|
250
|
+
}, Ze = {
|
|
316
251
|
delimiter: "_",
|
|
317
252
|
markerLength: 2,
|
|
318
253
|
regex: /(__)([^_]+)_$/
|
|
319
|
-
},
|
|
254
|
+
}, Qe = {
|
|
320
255
|
delimiter: "~",
|
|
321
256
|
markerLength: 2,
|
|
322
257
|
regex: /(~~)([^~]+)~$/
|
|
323
|
-
},
|
|
258
|
+
}, j = /^[\s_~*`]*$/, $e = /^[\s]*[-*+][\s]+$/, M = /[\p{L}\p{N}_]/u, et = /^\*{4,}$/, N = (e) => {
|
|
324
259
|
if (!e) return !1;
|
|
325
260
|
let t = e.charCodeAt(0);
|
|
326
|
-
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 ||
|
|
327
|
-
},
|
|
261
|
+
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || M.test(e);
|
|
262
|
+
}, tt = (e, t) => {
|
|
328
263
|
let n = 1;
|
|
329
264
|
for (let r = t - 1; r >= 0; --r) if (e[r] === "]") n += 1;
|
|
330
265
|
else if (e[r] === "[" && (--n, n === 0)) return r;
|
|
331
266
|
return -1;
|
|
332
|
-
},
|
|
267
|
+
}, nt = (e, t) => {
|
|
333
268
|
let n = 1;
|
|
334
269
|
for (let r = t + 1; r < e.length; r += 1) if (e[r] === "[") n += 1;
|
|
335
270
|
else if (e[r] === "]" && (--n, n === 0)) return r;
|
|
336
271
|
return -1;
|
|
337
|
-
},
|
|
272
|
+
}, rt = (e, t) => D(C(e), t), it = (e, t, n) => {
|
|
338
273
|
let r = 0;
|
|
339
274
|
for (let n = t - 1; n >= 0; --n) if (e[n] === "\n") {
|
|
340
275
|
r = n + 1;
|
|
@@ -352,184 +287,184 @@ var me = Object.defineProperty, he = Object.defineProperties, ge = Object.getOwn
|
|
|
352
287
|
break;
|
|
353
288
|
}
|
|
354
289
|
return o >= 3 && !s;
|
|
355
|
-
},
|
|
356
|
-
let i =
|
|
290
|
+
}, at = (e, t, n, r) => n === "\\" || D(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"), ot = (e) => e === " " || e === " " || e === "\n", st = (e, t) => !!(e && t && N(e) && N(t)), ct = (e, t, n, r) => {
|
|
291
|
+
let i = st(e, t), a = !!t && !ot(t), o = !!e && !ot(e);
|
|
357
292
|
return i && n % 2 == 0 && !r ? { count: !1 } : o && n % 2 == 1 || a ? {
|
|
358
293
|
count: !0,
|
|
359
294
|
inWordAsteriskChain: i
|
|
360
295
|
} : { count: !1 };
|
|
361
|
-
},
|
|
362
|
-
let t =
|
|
296
|
+
}, lt = (e) => {
|
|
297
|
+
let t = C(e), n = 0, r = !1, i = e.length;
|
|
363
298
|
for (let a = 0; a < i; a += 1) {
|
|
364
|
-
if (e[a] !== "*" || t.regions[a] !==
|
|
365
|
-
|
|
299
|
+
if (e[a] !== "*" || t.regions[a] !== y.PROSE) {
|
|
300
|
+
N(e[a]) || (r = !1);
|
|
366
301
|
continue;
|
|
367
302
|
}
|
|
368
303
|
let o = a > 0 ? e[a - 1] : "", s = a < i - 1 ? e[a + 1] : "";
|
|
369
|
-
if (
|
|
370
|
-
let c =
|
|
304
|
+
if (at(t, a, o, s)) continue;
|
|
305
|
+
let c = ct(o, s, n, r);
|
|
371
306
|
c.count && (n += 1, r = c.inWordAsteriskChain);
|
|
372
307
|
}
|
|
373
308
|
return n;
|
|
374
|
-
},
|
|
375
|
-
let t =
|
|
309
|
+
}, P = (e, t, n, r) => !!(n === "\\" || D(e, t) || Be(e, t) || He(e, t) || n === "_" || r === "_" || n && r && N(n) && N(r)), ut = (e) => {
|
|
310
|
+
let t = C(e), n = 0, r = e.length;
|
|
376
311
|
for (let i = 0; i < r; i += 1) {
|
|
377
|
-
if (e[i] !== "_" || t.regions[i] !==
|
|
312
|
+
if (e[i] !== "_" || t.regions[i] !== y.PROSE) continue;
|
|
378
313
|
let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
|
|
379
|
-
|
|
314
|
+
P(t, i, a, o) || (n += 1);
|
|
380
315
|
}
|
|
381
316
|
return n;
|
|
382
|
-
},
|
|
383
|
-
let t =
|
|
384
|
-
for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] ===
|
|
317
|
+
}, dt = (e) => {
|
|
318
|
+
let t = C(e), n = 0, r = 0;
|
|
319
|
+
for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] === y.PROSE ? r += 1 : (r >= 3 && (n += Math.floor(r / 3)), r = 0);
|
|
385
320
|
return r >= 3 && (n += Math.floor(r / 3)), n;
|
|
386
|
-
},
|
|
387
|
-
if (!(
|
|
321
|
+
}, ft = (e) => T(e, "*"), pt = (e) => e === "" || e === " " || e === " " || e === "\n", mt = (e, t, n, r, i) => {
|
|
322
|
+
if (!(pt(n) && pt(r))) return !1;
|
|
388
323
|
if (t > i.lineEnd) {
|
|
389
324
|
let n = e.indexOf("\n", t);
|
|
390
|
-
i.lineEnd = n === -1 ? e.length : n, i.result =
|
|
325
|
+
i.lineEnd = n === -1 ? e.length : n, i.result = it(e, t, "_");
|
|
391
326
|
}
|
|
392
327
|
return i.result;
|
|
393
|
-
},
|
|
328
|
+
}, ht = (e, t, n, r) => {
|
|
394
329
|
let i = e.text, a = t, o = !1;
|
|
395
330
|
a > 0 && i[a - 1] === "\\" && (a += 1, o = !0);
|
|
396
331
|
let s = n - a;
|
|
397
332
|
if (s < 2) return !1;
|
|
398
333
|
let c = a > 0 ? i[a - 1] : "", l = o ? "\\" : c, u = n < i.length ? i[n] : "";
|
|
399
|
-
return
|
|
400
|
-
},
|
|
401
|
-
let t =
|
|
334
|
+
return N(l) && N(u) || mt(i, a, l, u, r) || D(e, a) || Be(e, a) || He(e, a) ? !1 : Math.floor(s / 2) % 2 == 1;
|
|
335
|
+
}, gt = (e) => {
|
|
336
|
+
let t = C(e), n = e.length, r = {
|
|
402
337
|
lineEnd: -1,
|
|
403
338
|
result: !1
|
|
404
339
|
}, i = !1, a = 0;
|
|
405
340
|
for (; a < n;) {
|
|
406
|
-
if (e[a] !== "_" || t.regions[a] !==
|
|
341
|
+
if (e[a] !== "_" || t.regions[a] !== y.PROSE) {
|
|
407
342
|
a += 1;
|
|
408
343
|
continue;
|
|
409
344
|
}
|
|
410
345
|
let o = a, s = a + 1;
|
|
411
|
-
for (; s < n && e[s] === "_" && t.regions[s] ===
|
|
412
|
-
a = s,
|
|
346
|
+
for (; s < n && e[s] === "_" && t.regions[s] === y.PROSE;) s += 1;
|
|
347
|
+
a = s, ht(t, o, s, r) && (i = !i);
|
|
413
348
|
}
|
|
414
349
|
return i;
|
|
415
|
-
},
|
|
416
|
-
if (!t ||
|
|
350
|
+
}, _t = (e, t, n) => {
|
|
351
|
+
if (!t || j.test(t)) return !0;
|
|
417
352
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
418
|
-
return
|
|
419
|
-
},
|
|
420
|
-
let t =
|
|
353
|
+
return $e.test(a) && t.includes("\n") ? !0 : it(e, n, "*");
|
|
354
|
+
}, vt = (e) => {
|
|
355
|
+
let t = A(e, Ge);
|
|
421
356
|
if (!t) return e;
|
|
422
357
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
423
|
-
return
|
|
424
|
-
},
|
|
425
|
-
if (!t ||
|
|
358
|
+
return O(e, r) || k(e, r) || _t(e, n, r) ? e : ft(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
|
|
359
|
+
}, yt = (e, t, n) => {
|
|
360
|
+
if (!t || j.test(t)) return !0;
|
|
426
361
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
427
|
-
return
|
|
428
|
-
},
|
|
429
|
-
let t =
|
|
362
|
+
return $e.test(a) && t.includes("\n") ? !0 : it(e, n, "_");
|
|
363
|
+
}, F = (e) => {
|
|
364
|
+
let t = A(e, Ke);
|
|
430
365
|
if (!t) {
|
|
431
|
-
let t =
|
|
366
|
+
let t = A(e, Ze);
|
|
432
367
|
if (t) {
|
|
433
368
|
let n = e.lastIndexOf(t[1]);
|
|
434
|
-
if (!(
|
|
369
|
+
if (!(O(e, n) || k(e, n)) && gt(e)) return `${e}_`;
|
|
435
370
|
}
|
|
436
371
|
return e;
|
|
437
372
|
}
|
|
438
373
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
439
|
-
return
|
|
440
|
-
},
|
|
374
|
+
return O(e, r) || k(e, r) || yt(e, n, r) ? e : gt(e) ? `${e}__` : e;
|
|
375
|
+
}, bt = (e, t) => {
|
|
441
376
|
let { text: n } = e;
|
|
442
|
-
return n[t] === "*" && e.regions[t] ===
|
|
443
|
-
},
|
|
444
|
-
let t =
|
|
377
|
+
return n[t] === "*" && e.regions[t] === y.PROSE && n[t - 1] !== "*" && n[t + 1] !== "*" && n[t - 1] !== "\\" && !D(e, t);
|
|
378
|
+
}, xt = (e) => {
|
|
379
|
+
let t = C(e);
|
|
445
380
|
for (let n = e.indexOf("*"); n !== -1; n = e.indexOf("*", n + 1)) {
|
|
446
|
-
if (!
|
|
447
|
-
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r ||
|
|
448
|
-
if (!(a && o) && !(r && i &&
|
|
381
|
+
if (!bt(t, n)) continue;
|
|
382
|
+
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r || ot(r), o = !i || ot(i);
|
|
383
|
+
if (!(a && o) && !(r && i && N(r) && N(i)) && !o) return n;
|
|
449
384
|
}
|
|
450
385
|
return -1;
|
|
451
|
-
},
|
|
452
|
-
if (!
|
|
453
|
-
let t =
|
|
454
|
-
if (t === -1 ||
|
|
386
|
+
}, St = (e) => {
|
|
387
|
+
if (!A(e, Je)) return e;
|
|
388
|
+
let t = xt(e);
|
|
389
|
+
if (t === -1 || O(e, t) || k(e, t)) return e;
|
|
455
390
|
let n = e.substring(t + 1);
|
|
456
|
-
return !n ||
|
|
457
|
-
},
|
|
458
|
-
let t =
|
|
459
|
-
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] ===
|
|
391
|
+
return !n || j.test(n) ? e : lt(e) % 2 == 1 ? `${e}*` : e;
|
|
392
|
+
}, Ct = (e) => {
|
|
393
|
+
let t = C(e);
|
|
394
|
+
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] === y.PROSE && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !D(t, n) && !Be(t, n)) {
|
|
460
395
|
let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
|
|
461
|
-
if (t && r &&
|
|
396
|
+
if (t && r && N(t) && N(r)) continue;
|
|
462
397
|
return n;
|
|
463
398
|
}
|
|
464
399
|
return -1;
|
|
465
|
-
},
|
|
400
|
+
}, wt = (e) => {
|
|
466
401
|
let t = e.length;
|
|
467
402
|
for (; t > 0 && e[t - 1] === "\n";) --t;
|
|
468
403
|
return t < e.length ? `${e.slice(0, t)}_${e.slice(t)}` : `${e}_`;
|
|
469
|
-
},
|
|
404
|
+
}, Tt = (e) => {
|
|
470
405
|
if (!e.endsWith("**")) return null;
|
|
471
406
|
let t = e.slice(0, -2);
|
|
472
|
-
if (
|
|
473
|
-
let n = t.indexOf("**"), r =
|
|
407
|
+
if (ft(t) % 2 != 1) return null;
|
|
408
|
+
let n = t.indexOf("**"), r = Ct(t);
|
|
474
409
|
return n !== -1 && r !== -1 && n < r ? `${t}_**` : null;
|
|
475
|
-
},
|
|
476
|
-
if (!
|
|
477
|
-
let t =
|
|
410
|
+
}, Et = (e) => {
|
|
411
|
+
if (!A(e, Ye)) return e;
|
|
412
|
+
let t = Ct(e);
|
|
478
413
|
if (t === -1) return e;
|
|
479
414
|
let n = e.substring(t + 1);
|
|
480
|
-
if (!n ||
|
|
481
|
-
if (
|
|
482
|
-
let t =
|
|
483
|
-
return t === null ?
|
|
415
|
+
if (!n || j.test(n) || O(e, t) || k(e, t)) return e;
|
|
416
|
+
if (ut(e) % 2 == 1) {
|
|
417
|
+
let t = Tt(e);
|
|
418
|
+
return t === null ? wt(e) : t;
|
|
484
419
|
}
|
|
485
420
|
return e;
|
|
486
|
-
},
|
|
487
|
-
let t =
|
|
421
|
+
}, Dt = (e) => {
|
|
422
|
+
let t = ft(e), n = lt(e);
|
|
488
423
|
return t % 2 == 0 && n % 2 == 0;
|
|
489
|
-
},
|
|
490
|
-
if (
|
|
491
|
-
let t =
|
|
424
|
+
}, Ot = (e, t, n) => !t || j.test(t) || O(e, n) || k(e, n) ? !0 : it(e, n, "*"), kt = (e) => {
|
|
425
|
+
if (et.test(e)) return e;
|
|
426
|
+
let t = A(e, qe);
|
|
492
427
|
if (!t) return e;
|
|
493
428
|
let n = t[2];
|
|
494
|
-
return
|
|
495
|
-
},
|
|
429
|
+
return Ot(e, n, e.lastIndexOf(t[1])) ? e : dt(e) % 2 == 1 ? Dt(e) ? e : `${e}***` : e;
|
|
430
|
+
}, At = /<[a-zA-Z/][^>]*$/, jt = /[a-zA-Z/]/, Mt = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), Nt = (e, t) => {
|
|
496
431
|
let n = e[t + 1];
|
|
497
|
-
return n !== void 0 &&
|
|
498
|
-
},
|
|
499
|
-
let t = e.match(
|
|
432
|
+
return n !== void 0 && jt.test(n);
|
|
433
|
+
}, I = (e) => {
|
|
434
|
+
let t = e.match(At);
|
|
500
435
|
if (!t || t.index === void 0) return e;
|
|
501
|
-
let n =
|
|
502
|
-
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" &&
|
|
436
|
+
let n = Mt(e);
|
|
437
|
+
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" && Nt(e, r) && !O(e, r) && !(n && rt(e, r))) return e.substring(0, r).trimEnd();
|
|
503
438
|
return e;
|
|
504
|
-
},
|
|
505
|
-
let t =
|
|
439
|
+
}, Pt = (e) => {
|
|
440
|
+
let t = C(e);
|
|
506
441
|
if (t.openFence) return e;
|
|
507
442
|
let n = t.openSpan;
|
|
508
443
|
if (!n) return e;
|
|
509
444
|
let r = e.slice(n.start + n.runLength);
|
|
510
|
-
if (!r ||
|
|
445
|
+
if (!r || j.test(r)) return e;
|
|
511
446
|
let i = 0, a = e.length - 1;
|
|
512
447
|
for (; a >= 0 && e[a] === "`";) i += 1, --a;
|
|
513
448
|
return i >= n.runLength ? e : e + "`".repeat(n.runLength - i);
|
|
514
|
-
},
|
|
515
|
-
let t =
|
|
516
|
-
for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] ===
|
|
449
|
+
}, Ft = (e) => T(e, "$"), It = (e) => {
|
|
450
|
+
let t = C(e), n = 0;
|
|
451
|
+
for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] === y.PROSE && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : n += 1);
|
|
517
452
|
return n;
|
|
518
|
-
},
|
|
453
|
+
}, Lt = (e) => {
|
|
519
454
|
if (e.endsWith("$") && !e.endsWith("$$")) return `${e}$`;
|
|
520
455
|
let t = e.indexOf("$$");
|
|
521
456
|
return t !== -1 && e.indexOf("\n", t) !== -1 && !e.endsWith("\n") ? `${e}
|
|
522
457
|
$$` : `${e}$$`;
|
|
523
|
-
},
|
|
458
|
+
}, Rt = (e) => Ft(e) % 2 == 0 ? e : Lt(e), zt = (e) => It(e) % 2 == 1 ? `${e}$` : e, Bt = "streamdown:incomplete-image", Vt = (e, t, n) => {
|
|
524
459
|
if (e.substring(t + 2).includes(")")) return null;
|
|
525
|
-
let r =
|
|
526
|
-
if (r === -1 ||
|
|
460
|
+
let r = tt(e, t);
|
|
461
|
+
if (r === -1 || O(e, r)) return null;
|
|
527
462
|
let i = r > 0 && e[r - 1] === "!", a = i ? r - 1 : r, o = e.substring(0, a), s = e.substring(r + 1, t);
|
|
528
|
-
return i ? `${o} if (e[n] === "[" && !
|
|
463
|
+
return i ? `${o}` : n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
|
|
464
|
+
}, Ht = (e, t) => {
|
|
465
|
+
for (let n = 0; n < t; n++) if (e[n] === "[" && !O(e, n)) {
|
|
531
466
|
if (n > 0 && e[n - 1] === "!") continue;
|
|
532
|
-
let t =
|
|
467
|
+
let t = nt(e, n);
|
|
533
468
|
if (t === -1) return n;
|
|
534
469
|
if (t + 1 < e.length && e[t + 1] === "(") {
|
|
535
470
|
let r = e.indexOf(")", t + 2);
|
|
@@ -537,69 +472,69 @@ $$` : `${e}$$`;
|
|
|
537
472
|
}
|
|
538
473
|
}
|
|
539
474
|
return t;
|
|
540
|
-
},
|
|
475
|
+
}, Ut = (e, t, n) => {
|
|
541
476
|
let r = t > 0 && e[t - 1] === "!", i = r ? t - 1 : t;
|
|
542
|
-
if (!e.substring(t + 1).includes("]") ||
|
|
477
|
+
if (!e.substring(t + 1).includes("]") || nt(e, t) === -1) {
|
|
543
478
|
let a = e.substring(0, i);
|
|
544
|
-
if (r) return `${a} return `${a}`;
|
|
545
480
|
if (n === "text-only") {
|
|
546
|
-
let n =
|
|
481
|
+
let n = Ht(e, t);
|
|
547
482
|
return e.substring(0, n) + e.substring(n + 1);
|
|
548
483
|
}
|
|
549
484
|
return `${e}](streamdown:incomplete-link)`;
|
|
550
485
|
}
|
|
551
486
|
return null;
|
|
552
|
-
},
|
|
487
|
+
}, Wt = (e, t) => {
|
|
553
488
|
let n = e.lastIndexOf("](");
|
|
554
|
-
if (n !== -1 && !
|
|
555
|
-
let r =
|
|
489
|
+
if (n !== -1 && !O(e, n)) {
|
|
490
|
+
let r = Vt(e, n, t);
|
|
556
491
|
if (r !== null) return r;
|
|
557
492
|
}
|
|
558
|
-
for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!
|
|
559
|
-
let r =
|
|
493
|
+
for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!O(e, n)) {
|
|
494
|
+
let r = Ut(e, n, t);
|
|
560
495
|
if (r !== null) return r;
|
|
561
496
|
}
|
|
562
497
|
return e;
|
|
563
|
-
},
|
|
498
|
+
}, Gt = 32, Kt = (e, t = "protocol") => {
|
|
564
499
|
let n = e;
|
|
565
|
-
for (let e = 0; e <
|
|
566
|
-
let e =
|
|
500
|
+
for (let e = 0; e < Gt; e += 1) {
|
|
501
|
+
let e = Wt(n, t);
|
|
567
502
|
if (e.length >= n.length) return e;
|
|
568
503
|
n = e;
|
|
569
504
|
}
|
|
570
505
|
return n;
|
|
571
|
-
},
|
|
506
|
+
}, qt = /^-{1,2}$/, Jt = /^[\s]*-{1,2}[\s]+$/, Yt = /^={1,2}$/, Xt = /^[\s]*={1,2}[\s]+$/, Zt = (e) => {
|
|
572
507
|
if (!e || typeof e != "string") return e;
|
|
573
508
|
let t = e.lastIndexOf("\n");
|
|
574
509
|
if (t === -1) return e;
|
|
575
510
|
let n = e.substring(t + 1), r = e.substring(0, t), i = n.trim();
|
|
576
|
-
if (
|
|
511
|
+
if (qt.test(i) && !n.match(Jt)) {
|
|
577
512
|
let t = r.split("\n").at(-1);
|
|
578
513
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
579
514
|
}
|
|
580
|
-
if (
|
|
515
|
+
if (Yt.test(i) && !n.match(Xt)) {
|
|
581
516
|
let t = r.split("\n").at(-1);
|
|
582
517
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
583
518
|
}
|
|
584
519
|
return e;
|
|
585
|
-
},
|
|
586
|
-
let t =
|
|
520
|
+
}, Qt = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, $t = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(Qt, (t, n, r) => O(e, r + n.length) ? t : `${n}\\~`), en = (e) => T(e, "~"), tn = (e) => {
|
|
521
|
+
let t = A(e, Xe);
|
|
587
522
|
if (t) {
|
|
588
523
|
let n = t[2];
|
|
589
|
-
if (!n ||
|
|
524
|
+
if (!n || j.test(n)) return e;
|
|
590
525
|
let r = e.lastIndexOf(t[1]);
|
|
591
|
-
if (
|
|
592
|
-
if (
|
|
526
|
+
if (O(e, r) || k(e, r)) return e;
|
|
527
|
+
if (en(e) % 2 == 1) return `${e}~~`;
|
|
593
528
|
} else {
|
|
594
|
-
let t =
|
|
529
|
+
let t = A(e, Qe);
|
|
595
530
|
if (t) {
|
|
596
531
|
let n = e.lastIndexOf(t[0].slice(0, 2));
|
|
597
|
-
if (
|
|
598
|
-
if (
|
|
532
|
+
if (O(e, n) || k(e, n)) return e;
|
|
533
|
+
if (en(e) % 2 == 1) return `${e}~`;
|
|
599
534
|
}
|
|
600
535
|
}
|
|
601
536
|
return e;
|
|
602
|
-
},
|
|
537
|
+
}, nn = (e) => e !== !1, rn = (e) => e === !0, L = {
|
|
603
538
|
SINGLE_TILDE: 0,
|
|
604
539
|
COMPARISON_OPERATORS: 5,
|
|
605
540
|
HTML_TAGS: 10,
|
|
@@ -615,11 +550,11 @@ $$` : `${e}$$`;
|
|
|
615
550
|
KATEX: 70,
|
|
616
551
|
INLINE_KATEX: 75,
|
|
617
552
|
DEFAULT: 100
|
|
618
|
-
},
|
|
553
|
+
}, an = [
|
|
619
554
|
{
|
|
620
555
|
handler: {
|
|
621
556
|
name: "singleTilde",
|
|
622
|
-
handle:
|
|
557
|
+
handle: $t,
|
|
623
558
|
priority: L.SINGLE_TILDE
|
|
624
559
|
},
|
|
625
560
|
optionKey: "singleTilde"
|
|
@@ -627,7 +562,7 @@ $$` : `${e}$$`;
|
|
|
627
562
|
{
|
|
628
563
|
handler: {
|
|
629
564
|
name: "comparisonOperators",
|
|
630
|
-
handle:
|
|
565
|
+
handle: We,
|
|
631
566
|
priority: L.COMPARISON_OPERATORS
|
|
632
567
|
},
|
|
633
568
|
optionKey: "comparisonOperators"
|
|
@@ -635,7 +570,7 @@ $$` : `${e}$$`;
|
|
|
635
570
|
{
|
|
636
571
|
handler: {
|
|
637
572
|
name: "htmlTags",
|
|
638
|
-
handle:
|
|
573
|
+
handle: I,
|
|
639
574
|
priority: L.HTML_TAGS
|
|
640
575
|
},
|
|
641
576
|
optionKey: "htmlTags"
|
|
@@ -643,7 +578,7 @@ $$` : `${e}$$`;
|
|
|
643
578
|
{
|
|
644
579
|
handler: {
|
|
645
580
|
name: "setextHeadings",
|
|
646
|
-
handle:
|
|
581
|
+
handle: Zt,
|
|
647
582
|
priority: L.SETEXT_HEADINGS
|
|
648
583
|
},
|
|
649
584
|
optionKey: "setextHeadings"
|
|
@@ -651,7 +586,7 @@ $$` : `${e}$$`;
|
|
|
651
586
|
{
|
|
652
587
|
handler: {
|
|
653
588
|
name: "links",
|
|
654
|
-
handle:
|
|
589
|
+
handle: Kt,
|
|
655
590
|
priority: L.LINKS
|
|
656
591
|
},
|
|
657
592
|
optionKey: "links",
|
|
@@ -660,7 +595,7 @@ $$` : `${e}$$`;
|
|
|
660
595
|
{
|
|
661
596
|
handler: {
|
|
662
597
|
name: "boldItalic",
|
|
663
|
-
handle:
|
|
598
|
+
handle: kt,
|
|
664
599
|
priority: L.BOLD_ITALIC
|
|
665
600
|
},
|
|
666
601
|
optionKey: "boldItalic"
|
|
@@ -668,7 +603,7 @@ $$` : `${e}$$`;
|
|
|
668
603
|
{
|
|
669
604
|
handler: {
|
|
670
605
|
name: "bold",
|
|
671
|
-
handle:
|
|
606
|
+
handle: vt,
|
|
672
607
|
priority: L.BOLD
|
|
673
608
|
},
|
|
674
609
|
optionKey: "bold"
|
|
@@ -676,7 +611,7 @@ $$` : `${e}$$`;
|
|
|
676
611
|
{
|
|
677
612
|
handler: {
|
|
678
613
|
name: "italicDoubleUnderscore",
|
|
679
|
-
handle:
|
|
614
|
+
handle: F,
|
|
680
615
|
priority: L.ITALIC_DOUBLE_UNDERSCORE
|
|
681
616
|
},
|
|
682
617
|
optionKey: "italic"
|
|
@@ -684,7 +619,7 @@ $$` : `${e}$$`;
|
|
|
684
619
|
{
|
|
685
620
|
handler: {
|
|
686
621
|
name: "italicSingleAsterisk",
|
|
687
|
-
handle:
|
|
622
|
+
handle: St,
|
|
688
623
|
priority: L.ITALIC_SINGLE_ASTERISK
|
|
689
624
|
},
|
|
690
625
|
optionKey: "italic"
|
|
@@ -692,7 +627,7 @@ $$` : `${e}$$`;
|
|
|
692
627
|
{
|
|
693
628
|
handler: {
|
|
694
629
|
name: "italicSingleUnderscore",
|
|
695
|
-
handle:
|
|
630
|
+
handle: Et,
|
|
696
631
|
priority: L.ITALIC_SINGLE_UNDERSCORE
|
|
697
632
|
},
|
|
698
633
|
optionKey: "italic"
|
|
@@ -700,7 +635,7 @@ $$` : `${e}$$`;
|
|
|
700
635
|
{
|
|
701
636
|
handler: {
|
|
702
637
|
name: "inlineCode",
|
|
703
|
-
handle:
|
|
638
|
+
handle: Pt,
|
|
704
639
|
priority: L.INLINE_CODE
|
|
705
640
|
},
|
|
706
641
|
optionKey: "inlineCode"
|
|
@@ -708,7 +643,7 @@ $$` : `${e}$$`;
|
|
|
708
643
|
{
|
|
709
644
|
handler: {
|
|
710
645
|
name: "strikethrough",
|
|
711
|
-
handle:
|
|
646
|
+
handle: tn,
|
|
712
647
|
priority: L.STRIKETHROUGH
|
|
713
648
|
},
|
|
714
649
|
optionKey: "strikethrough"
|
|
@@ -716,7 +651,7 @@ $$` : `${e}$$`;
|
|
|
716
651
|
{
|
|
717
652
|
handler: {
|
|
718
653
|
name: "katex",
|
|
719
|
-
handle:
|
|
654
|
+
handle: Rt,
|
|
720
655
|
priority: L.KATEX
|
|
721
656
|
},
|
|
722
657
|
optionKey: "katex"
|
|
@@ -724,36 +659,36 @@ $$` : `${e}$$`;
|
|
|
724
659
|
{
|
|
725
660
|
handler: {
|
|
726
661
|
name: "inlineKatex",
|
|
727
|
-
handle:
|
|
662
|
+
handle: zt,
|
|
728
663
|
priority: L.INLINE_KATEX
|
|
729
664
|
},
|
|
730
665
|
optionKey: "inlineKatex"
|
|
731
666
|
}
|
|
732
|
-
],
|
|
667
|
+
], on = (e) => {
|
|
733
668
|
let t = e?.linkMode ?? "protocol";
|
|
734
|
-
return
|
|
735
|
-
handler:
|
|
669
|
+
return an.filter(({ handler: t, optionKey: n }) => t.name === "links" ? nn(e?.links) || nn(e?.images) : t.name === "inlineKatex" ? rn(e?.inlineKatex) : nn(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
|
|
670
|
+
handler: he(me({}, e), { handle: (e) => Kt(e, t) }),
|
|
736
671
|
earlyReturn: t === "protocol" ? n : void 0
|
|
737
672
|
} : {
|
|
738
673
|
handler: e,
|
|
739
674
|
earlyReturn: n
|
|
740
675
|
});
|
|
741
|
-
},
|
|
676
|
+
}, sn = (e, t) => {
|
|
742
677
|
if (!e || typeof e != "string") return e;
|
|
743
|
-
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r =
|
|
744
|
-
handler:
|
|
678
|
+
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = on(t), i = (t?.handlers ?? []).map((e) => ({
|
|
679
|
+
handler: he(me({}, e), { priority: e.priority ?? L.DEFAULT }),
|
|
745
680
|
earlyReturn: void 0
|
|
746
681
|
})), a = [...r, ...i].sort((e, t) => (e.handler.priority ?? 0) - (t.handler.priority ?? 0));
|
|
747
682
|
try {
|
|
748
683
|
for (let { handler: e, earlyReturn: t } of a) if (n = e.handle(n), t != null && t(n)) return n;
|
|
749
684
|
return n.endsWith(" ") && !n.endsWith(" ") ? n.slice(0, -1) : n;
|
|
750
685
|
} finally {
|
|
751
|
-
|
|
686
|
+
w();
|
|
752
687
|
}
|
|
753
688
|
};
|
|
754
689
|
//#endregion
|
|
755
690
|
//#region ../../node_modules/.pnpm/marked@18.1.0/node_modules/marked/lib/marked.esm.js
|
|
756
|
-
function
|
|
691
|
+
function cn() {
|
|
757
692
|
return {
|
|
758
693
|
async: !1,
|
|
759
694
|
breaks: !1,
|
|
@@ -767,12 +702,12 @@ function mn() {
|
|
|
767
702
|
walkTokens: null
|
|
768
703
|
};
|
|
769
704
|
}
|
|
770
|
-
var
|
|
771
|
-
function
|
|
772
|
-
|
|
705
|
+
var ln = cn();
|
|
706
|
+
function un(e) {
|
|
707
|
+
ln = e;
|
|
773
708
|
}
|
|
774
|
-
var
|
|
775
|
-
function
|
|
709
|
+
var dn = { exec: () => null };
|
|
710
|
+
function fn(e) {
|
|
776
711
|
let t = [];
|
|
777
712
|
return (n) => {
|
|
778
713
|
let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
|
|
@@ -789,7 +724,7 @@ function R(e, t = "") {
|
|
|
789
724
|
};
|
|
790
725
|
return r;
|
|
791
726
|
}
|
|
792
|
-
var
|
|
727
|
+
var pn = ((e = "") => {
|
|
793
728
|
try {
|
|
794
729
|
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
795
730
|
} catch {
|
|
@@ -849,111 +784,111 @@ var yn = ((e = "") => {
|
|
|
849
784
|
notSpaceStart: /^\S*/,
|
|
850
785
|
endingNewline: /\n$/,
|
|
851
786
|
listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
852
|
-
nextBulletRegex:
|
|
853
|
-
hrRegex:
|
|
854
|
-
fencesBeginRegex:
|
|
855
|
-
headingBeginRegex:
|
|
856
|
-
htmlBeginRegex:
|
|
857
|
-
blockquoteBeginRegex:
|
|
858
|
-
},
|
|
859
|
-
blockquote: R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",
|
|
860
|
-
code:
|
|
861
|
-
def:
|
|
862
|
-
fences:
|
|
863
|
-
heading:
|
|
864
|
-
hr:
|
|
865
|
-
html:
|
|
866
|
-
lheading:
|
|
867
|
-
list:
|
|
868
|
-
newline:
|
|
869
|
-
paragraph:
|
|
870
|
-
table:
|
|
871
|
-
text:
|
|
872
|
-
},
|
|
873
|
-
...
|
|
874
|
-
lheading:
|
|
875
|
-
table:
|
|
876
|
-
paragraph: R(
|
|
877
|
-
},
|
|
878
|
-
...
|
|
879
|
-
html: R("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",
|
|
787
|
+
nextBulletRegex: fn((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
|
|
788
|
+
hrRegex: fn((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
|
|
789
|
+
fencesBeginRegex: fn((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
|
|
790
|
+
headingBeginRegex: fn((e) => RegExp(`^ {0,${e}}#`)),
|
|
791
|
+
htmlBeginRegex: fn((e) => RegExp(`^ {0,${e}}(?:</?(?:${On})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
|
|
792
|
+
blockquoteBeginRegex: fn((e) => RegExp(`^ {0,${e}}>`))
|
|
793
|
+
}, mn = /^(?:[ \t]*(?:\n|$))+/, hn = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, gn = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, _n = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, vn = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, yn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, bn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, xn = R(bn).replace(/bull/g, yn).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(), Sn = R(bn).replace(/bull/g, yn).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(), Cn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, wn = /^[^\n]+/, Tn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, En = R(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Tn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Dn = R(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, yn).getRegex(), On = "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", kn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, An = R("^ {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-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", kn).replace("tag", On).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), jn = (e) => R(Cn).replace("hr", _n).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", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", On).getRegex(), Mn = jn(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Nn = jn(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Pn = {
|
|
794
|
+
blockquote: R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Nn).getRegex(),
|
|
795
|
+
code: hn,
|
|
796
|
+
def: En,
|
|
797
|
+
fences: gn,
|
|
798
|
+
heading: vn,
|
|
799
|
+
hr: _n,
|
|
800
|
+
html: An,
|
|
801
|
+
lheading: xn,
|
|
802
|
+
list: Dn,
|
|
803
|
+
newline: mn,
|
|
804
|
+
paragraph: Mn,
|
|
805
|
+
table: dn,
|
|
806
|
+
text: wn
|
|
807
|
+
}, Fn = R("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", _n).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", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", On).getRegex(), In = {
|
|
808
|
+
...Pn,
|
|
809
|
+
lheading: Sn,
|
|
810
|
+
table: Fn,
|
|
811
|
+
paragraph: R(Cn).replace("hr", _n).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Fn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", On).getRegex()
|
|
812
|
+
}, Ln = {
|
|
813
|
+
...Pn,
|
|
814
|
+
html: R("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", kn).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(),
|
|
880
815
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
881
816
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
882
|
-
fences:
|
|
817
|
+
fences: dn,
|
|
883
818
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
884
|
-
paragraph: R(
|
|
885
|
-
},
|
|
886
|
-
_backpedal:
|
|
887
|
-
anyPunctuation:
|
|
888
|
-
autolink:
|
|
889
|
-
blockSkip:
|
|
890
|
-
br:
|
|
891
|
-
code:
|
|
892
|
-
del:
|
|
893
|
-
delLDelim:
|
|
894
|
-
delRDelim:
|
|
895
|
-
emStrongLDelim:
|
|
896
|
-
emStrongRDelimAst:
|
|
897
|
-
emStrongRDelimUnd:
|
|
898
|
-
escape:
|
|
899
|
-
link:
|
|
900
|
-
nolink:
|
|
901
|
-
punctuation:
|
|
902
|
-
reflink:
|
|
903
|
-
reflinkSearch:
|
|
904
|
-
tag:
|
|
905
|
-
text:
|
|
906
|
-
url:
|
|
907
|
-
},
|
|
908
|
-
...
|
|
909
|
-
emStrongLDelim:
|
|
910
|
-
emStrongRDelimAst:
|
|
911
|
-
emStrongRDelimUnd:
|
|
912
|
-
link: R(/^!?\[(label)\]\((.*?)\)/).replace("label",
|
|
913
|
-
reflink: R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",
|
|
914
|
-
},
|
|
915
|
-
...
|
|
916
|
-
emStrongRDelimAst:
|
|
917
|
-
emStrongLDelim:
|
|
918
|
-
delLDelim:
|
|
919
|
-
delRDelim:
|
|
920
|
-
url: R(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",
|
|
819
|
+
paragraph: R(Cn).replace("hr", _n).replace("heading", " *#{1,6} *[^\n]").replace("lheading", xn).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
820
|
+
}, Rn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, zn = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Bn = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, Vn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, B = /[\p{P}\p{S}]/u, Hn = /[\s\p{P}\p{S}]/u, Un = /[^\s\p{P}\p{S}]/u, Wn = R(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Hn).getRegex(), Gn = /[\p{Pi}\p{Ps}"']/u, Kn = /(?!~)[\p{P}\p{S}]/u, qn = /(?!~)[\s\p{P}\p{S}]/u, Jn = /(?:[^\s\p{P}\p{S}]|~)/u, Yn = R(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", pn ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Xn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Zn = R(Xn, "u").replace(/punct/g, B).getRegex(), Qn = R(Xn, "u").replace(/punct/g, Kn).getRegex(), $n = R(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Gn).replace(/punct/g, B).getRegex(), er = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", tr = R(er, "gu").replace(/notPunctSpace/g, Un).replace(/punctSpace/g, Hn).replace(/punct/g, B).getRegex(), nr = R(er, "gu").replace(/notPunctSpace/g, Jn).replace(/punctSpace/g, qn).replace(/punct/g, Kn).getRegex(), rr = R("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Un).replace(/punctSpace/g, Hn).replace(/punct/g, B).getRegex(), ir = R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Un).replace(/punctSpace/g, Hn).replace(/punct/g, B).getRegex(), ar = R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Un).replace(/punctSpace/g, Hn).replace(/punct/g, B).getRegex(), or = R(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, B).getRegex(), sr = R("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Un).replace(/punctSpace/g, Hn).replace(/punct/g, B).getRegex(), cr = R(/\\(punct)/, "gu").replace(/punct/g, B).getRegex(), lr = R(/^<(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(), ur = R(kn).replace("(?:-->|$)", "-->").getRegex(), dr = R("^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", ur).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), fr = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, pr = R(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", fr).getRegex(), mr = R(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", pr).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), hr = R(/^!?\[(label)\]\[(ref)\]/).replace("label", pr).replace("ref", Tn).getRegex(), gr = R(/^!?\[(ref)\](?:\[\])?/).replace("ref", Tn).getRegex(), _r = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, vr = R(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", fr).getRegex(), yr = R("reflink|nolink(?!\\()", "g").replace("reflink", R(/^!?\[(label)\]\[(ref)\]/).replace("label", vr).replace("ref", _r).getRegex()).replace("nolink", R(/^!?\[(ref)\](?:\[\])?/).replace("ref", _r).getRegex()).getRegex(), br = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, xr = R(/(?: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(), Sr = {
|
|
821
|
+
_backpedal: dn,
|
|
822
|
+
anyPunctuation: cr,
|
|
823
|
+
autolink: lr,
|
|
824
|
+
blockSkip: Yn,
|
|
825
|
+
br: Bn,
|
|
826
|
+
code: zn,
|
|
827
|
+
del: dn,
|
|
828
|
+
delLDelim: dn,
|
|
829
|
+
delRDelim: dn,
|
|
830
|
+
emStrongLDelim: Zn,
|
|
831
|
+
emStrongRDelimAst: tr,
|
|
832
|
+
emStrongRDelimUnd: ir,
|
|
833
|
+
escape: Rn,
|
|
834
|
+
link: mr,
|
|
835
|
+
nolink: gr,
|
|
836
|
+
punctuation: Wn,
|
|
837
|
+
reflink: hr,
|
|
838
|
+
reflinkSearch: yr,
|
|
839
|
+
tag: dr,
|
|
840
|
+
text: Vn,
|
|
841
|
+
url: dn
|
|
842
|
+
}, Cr = {
|
|
843
|
+
...Sr,
|
|
844
|
+
emStrongLDelim: $n,
|
|
845
|
+
emStrongRDelimAst: rr,
|
|
846
|
+
emStrongRDelimUnd: ar,
|
|
847
|
+
link: R(/^!?\[(label)\]\((.*?)\)/).replace("label", pr).getRegex(),
|
|
848
|
+
reflink: R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", pr).getRegex()
|
|
849
|
+
}, wr = {
|
|
850
|
+
...Sr,
|
|
851
|
+
emStrongRDelimAst: nr,
|
|
852
|
+
emStrongLDelim: Qn,
|
|
853
|
+
delLDelim: or,
|
|
854
|
+
delRDelim: sr,
|
|
855
|
+
url: R(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", xr).replace("protocol", br).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
|
|
921
856
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
922
857
|
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
923
|
-
text: R(/^(?:[^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",
|
|
924
|
-
},
|
|
925
|
-
...
|
|
926
|
-
br: R(
|
|
927
|
-
text: R(
|
|
928
|
-
},
|
|
929
|
-
normal:
|
|
930
|
-
gfm:
|
|
931
|
-
pedantic:
|
|
932
|
-
},
|
|
933
|
-
normal:
|
|
934
|
-
gfm:
|
|
935
|
-
breaks:
|
|
936
|
-
pedantic:
|
|
937
|
-
},
|
|
858
|
+
text: R(/^(?:[^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", br).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
|
|
859
|
+
}, Tr = {
|
|
860
|
+
...wr,
|
|
861
|
+
br: R(Bn).replace("{2,}", "*").getRegex(),
|
|
862
|
+
text: R(wr.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
863
|
+
}, Er = {
|
|
864
|
+
normal: Pn,
|
|
865
|
+
gfm: In,
|
|
866
|
+
pedantic: Ln
|
|
867
|
+
}, Dr = {
|
|
868
|
+
normal: Sr,
|
|
869
|
+
gfm: wr,
|
|
870
|
+
breaks: Tr,
|
|
871
|
+
pedantic: Cr
|
|
872
|
+
}, Or = {
|
|
938
873
|
"&": "&",
|
|
939
874
|
"<": "<",
|
|
940
875
|
">": ">",
|
|
941
876
|
"\"": """,
|
|
942
877
|
"'": "'"
|
|
943
|
-
},
|
|
878
|
+
}, kr = (e) => Or[e];
|
|
944
879
|
function V(e, t) {
|
|
945
880
|
if (t) {
|
|
946
|
-
if (z.escapeTest.test(e)) return e.replace(z.escapeReplace,
|
|
947
|
-
} else if (z.escapeTestNoEncode.test(e)) return e.replace(z.escapeReplaceNoEncode,
|
|
881
|
+
if (z.escapeTest.test(e)) return e.replace(z.escapeReplace, kr);
|
|
882
|
+
} else if (z.escapeTestNoEncode.test(e)) return e.replace(z.escapeReplaceNoEncode, kr);
|
|
948
883
|
return e;
|
|
949
884
|
}
|
|
950
|
-
function
|
|
885
|
+
function Ar(e) {
|
|
951
886
|
return e.replace(z.numericCharacterReference, (e, t, n) => {
|
|
952
887
|
let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
|
|
953
888
|
return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : String.fromCodePoint(r);
|
|
954
889
|
});
|
|
955
890
|
}
|
|
956
|
-
function
|
|
891
|
+
function jr(e) {
|
|
957
892
|
try {
|
|
958
893
|
e = encodeURI(e).replace(z.percentDecode, "%");
|
|
959
894
|
} catch {
|
|
@@ -961,7 +896,7 @@ function Lr(e) {
|
|
|
961
896
|
}
|
|
962
897
|
return e;
|
|
963
898
|
}
|
|
964
|
-
function
|
|
899
|
+
function Mr(e, t) {
|
|
965
900
|
let n = e.replace(z.findPipe, (e, t, n) => {
|
|
966
901
|
let r = !1, i = t;
|
|
967
902
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
@@ -974,7 +909,7 @@ function Rr(e, t) {
|
|
|
974
909
|
for (; r < n.length; r++) n[r] = n[r].trim().replace(z.slashPipe, "|");
|
|
975
910
|
return n;
|
|
976
911
|
}
|
|
977
|
-
function
|
|
912
|
+
function Nr(e, t, n) {
|
|
978
913
|
let r = e.length;
|
|
979
914
|
if (r === 0) return "";
|
|
980
915
|
let i = 0;
|
|
@@ -986,15 +921,15 @@ function zr(e, t, n) {
|
|
|
986
921
|
}
|
|
987
922
|
return e.slice(0, r - i);
|
|
988
923
|
}
|
|
989
|
-
function
|
|
924
|
+
function Pr(e) {
|
|
990
925
|
let t = e.split("\n"), n = t.length - 1;
|
|
991
926
|
for (; n >= 0 && z.blankLine.test(t[n]);) n--;
|
|
992
927
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
993
928
|
}
|
|
994
|
-
function
|
|
929
|
+
function Fr(e) {
|
|
995
930
|
return e.trim().toLowerCase().toUpperCase().toLowerCase();
|
|
996
931
|
}
|
|
997
|
-
function
|
|
932
|
+
function Ir(e, t) {
|
|
998
933
|
if (e.indexOf(t[0]) === -1 && e.indexOf(t[1]) === -1) return -1;
|
|
999
934
|
let n = 0;
|
|
1000
935
|
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
@@ -1002,7 +937,7 @@ function Hr(e, t) {
|
|
|
1002
937
|
else if (e[r] === t[1] && (n--, n < 0)) return r;
|
|
1003
938
|
return n > 0 ? -2 : -1;
|
|
1004
939
|
}
|
|
1005
|
-
function
|
|
940
|
+
function Lr(e, t = 0) {
|
|
1006
941
|
let n = t, r = "";
|
|
1007
942
|
for (let t of e) if (t === " ") {
|
|
1008
943
|
let e = 4 - n % 4;
|
|
@@ -1010,7 +945,7 @@ function Ur(e, t = 0) {
|
|
|
1010
945
|
} else r += t, n++;
|
|
1011
946
|
return r;
|
|
1012
947
|
}
|
|
1013
|
-
function
|
|
948
|
+
function Rr(e, t, n, r, i) {
|
|
1014
949
|
let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!";
|
|
1015
950
|
r.state.inLink = !0;
|
|
1016
951
|
let l = r.state.linkEmitted, u = r.state.inRawBlock;
|
|
@@ -1032,7 +967,7 @@ function Wr(e, t, n, r, i) {
|
|
|
1032
967
|
tokens: d
|
|
1033
968
|
};
|
|
1034
969
|
}
|
|
1035
|
-
function
|
|
970
|
+
function zr(e, t, n) {
|
|
1036
971
|
let r = e.match(n.other.indentCodeCompensation);
|
|
1037
972
|
if (r === null) return t;
|
|
1038
973
|
let i = r[1];
|
|
@@ -1043,7 +978,7 @@ function Gr(e, t, n) {
|
|
|
1043
978
|
return e.slice(Math.min(r.length, i.length));
|
|
1044
979
|
}).join("\n");
|
|
1045
980
|
}
|
|
1046
|
-
function
|
|
981
|
+
function Br(e, t, n, r) {
|
|
1047
982
|
if (!t.includes("<")) return !1;
|
|
1048
983
|
for (let i = 0; i < t.length; i++) {
|
|
1049
984
|
if (t[i] === "\\") {
|
|
@@ -1066,12 +1001,12 @@ function Kr(e, t, n, r) {
|
|
|
1066
1001
|
}
|
|
1067
1002
|
return !1;
|
|
1068
1003
|
}
|
|
1069
|
-
var
|
|
1004
|
+
var Vr = class {
|
|
1070
1005
|
options;
|
|
1071
1006
|
rules;
|
|
1072
1007
|
lexer;
|
|
1073
1008
|
constructor(e) {
|
|
1074
|
-
this.options = e ||
|
|
1009
|
+
this.options = e || ln;
|
|
1075
1010
|
}
|
|
1076
1011
|
space(e) {
|
|
1077
1012
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -1083,7 +1018,7 @@ var qr = class {
|
|
|
1083
1018
|
code(e) {
|
|
1084
1019
|
let t = this.rules.block.code.exec(e);
|
|
1085
1020
|
if (t) {
|
|
1086
|
-
let e = this.options.pedantic ? t[0] :
|
|
1021
|
+
let e = this.options.pedantic ? t[0] : Pr(t[0]);
|
|
1087
1022
|
return {
|
|
1088
1023
|
type: "code",
|
|
1089
1024
|
raw: e,
|
|
@@ -1095,7 +1030,7 @@ var qr = class {
|
|
|
1095
1030
|
fences(e) {
|
|
1096
1031
|
let t = this.rules.block.fences.exec(e);
|
|
1097
1032
|
if (t) {
|
|
1098
|
-
let e = t[0], n =
|
|
1033
|
+
let e = t[0], n = zr(e, t[3] || "", this.rules);
|
|
1099
1034
|
return {
|
|
1100
1035
|
type: "code",
|
|
1101
1036
|
raw: e,
|
|
@@ -1109,12 +1044,12 @@ var qr = class {
|
|
|
1109
1044
|
if (t) {
|
|
1110
1045
|
let e = t[2].trim();
|
|
1111
1046
|
if (this.rules.other.endingHash.test(e)) {
|
|
1112
|
-
let t =
|
|
1047
|
+
let t = Nr(e, "#");
|
|
1113
1048
|
(this.options.pedantic || !t || this.rules.other.endingSpaceTabChar.test(t)) && (e = t.trim());
|
|
1114
1049
|
}
|
|
1115
1050
|
return {
|
|
1116
1051
|
type: "heading",
|
|
1117
|
-
raw:
|
|
1052
|
+
raw: Nr(t[0], "\n"),
|
|
1118
1053
|
depth: t[1].length,
|
|
1119
1054
|
text: e,
|
|
1120
1055
|
tokens: this.lexer.inline(e)
|
|
@@ -1125,13 +1060,13 @@ var qr = class {
|
|
|
1125
1060
|
let t = this.rules.block.hr.exec(e);
|
|
1126
1061
|
if (t) return {
|
|
1127
1062
|
type: "hr",
|
|
1128
|
-
raw:
|
|
1063
|
+
raw: Nr(t[0], "\n")
|
|
1129
1064
|
};
|
|
1130
1065
|
}
|
|
1131
1066
|
blockquote(e) {
|
|
1132
1067
|
let t = this.rules.block.blockquote.exec(e);
|
|
1133
1068
|
if (t) {
|
|
1134
|
-
let e =
|
|
1069
|
+
let e = Nr(t[0], "\n").split("\n"), n = "", r = "", i = [];
|
|
1135
1070
|
for (; e.length > 0;) {
|
|
1136
1071
|
let t = !1, a = [], o = 0;
|
|
1137
1072
|
for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
|
|
@@ -1184,7 +1119,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1184
1119
|
let n = !1, r = "", s = "";
|
|
1185
1120
|
if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
1186
1121
|
r = t[0], e = e.substring(r.length);
|
|
1187
|
-
let c = t[2].split("\n", 1)[0], l = t[1].length, u = this.options.pedantic ?
|
|
1122
|
+
let c = t[2].split("\n", 1)[0], l = t[1].length, u = this.options.pedantic ? Lr(c, l) : c.replace(this.rules.other.leadingSpaceTab, (e) => Lr(e, l)), d = e.split("\n", 1)[0], f = !u.trim(), p = 0;
|
|
1188
1123
|
if (this.options.pedantic ? (p = 2, s = u.trimStart()) : f ? p = l + 1 : (p = u.search(this.rules.other.nonSpaceChar), p = p > 4 ? 1 : p, s = u.slice(p), p += l), f && this.rules.other.blankLine.test(d) && (r += d + "\n", e = e.substring(d.length + 1), n = !0), !n) {
|
|
1189
1124
|
let t = this.rules.other.nextBulletRegex(p), n = this.rules.other.hrRegex(p), i = this.rules.other.fencesBeginRegex(p), a = this.rules.other.headingBeginRegex(p), o = this.rules.other.htmlBeginRegex(p), c = this.rules.other.blockquoteBeginRegex(p);
|
|
1190
1125
|
for (; e;) {
|
|
@@ -1249,7 +1184,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1249
1184
|
html(e) {
|
|
1250
1185
|
let t = this.rules.block.html.exec(e);
|
|
1251
1186
|
if (t) {
|
|
1252
|
-
let e =
|
|
1187
|
+
let e = Pr(t[0]);
|
|
1253
1188
|
return {
|
|
1254
1189
|
type: "html",
|
|
1255
1190
|
block: !0,
|
|
@@ -1262,12 +1197,12 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1262
1197
|
def(e) {
|
|
1263
1198
|
let t = this.rules.block.def.exec(e);
|
|
1264
1199
|
if (t) {
|
|
1265
|
-
if (!this.rules.other.startAngleBracket.test(t[2]) &&
|
|
1266
|
-
let e =
|
|
1200
|
+
if (!this.rules.other.startAngleBracket.test(t[2]) && Ir(t[2], "()") !== -1) return;
|
|
1201
|
+
let e = Fr(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];
|
|
1267
1202
|
return {
|
|
1268
1203
|
type: "def",
|
|
1269
1204
|
tag: e,
|
|
1270
|
-
raw:
|
|
1205
|
+
raw: Nr(t[0], "\n"),
|
|
1271
1206
|
href: n,
|
|
1272
1207
|
title: r
|
|
1273
1208
|
};
|
|
@@ -1276,9 +1211,9 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1276
1211
|
table(e) {
|
|
1277
1212
|
let t = this.rules.block.table.exec(e);
|
|
1278
1213
|
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
1279
|
-
let n =
|
|
1214
|
+
let n = Mr(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 = {
|
|
1280
1215
|
type: "table",
|
|
1281
|
-
raw:
|
|
1216
|
+
raw: Nr(t[0], "\n"),
|
|
1282
1217
|
header: [],
|
|
1283
1218
|
align: [],
|
|
1284
1219
|
rows: []
|
|
@@ -1291,7 +1226,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1291
1226
|
header: !0,
|
|
1292
1227
|
align: a.align[e]
|
|
1293
1228
|
});
|
|
1294
|
-
for (let e of i) a.rows.push(
|
|
1229
|
+
for (let e of i) a.rows.push(Mr(e, a.header.length).map((e, t) => ({
|
|
1295
1230
|
text: e,
|
|
1296
1231
|
tokens: this.lexer.inline(e),
|
|
1297
1232
|
header: !1,
|
|
@@ -1306,7 +1241,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1306
1241
|
let e = t[1].trim();
|
|
1307
1242
|
return {
|
|
1308
1243
|
type: "heading",
|
|
1309
|
-
raw:
|
|
1244
|
+
raw: Nr(t[0], "\n"),
|
|
1310
1245
|
depth: t[2].charAt(0) === "=" ? 1 : 2,
|
|
1311
1246
|
text: e,
|
|
1312
1247
|
tokens: this.lexer.inline(e)
|
|
@@ -1358,14 +1293,14 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1358
1293
|
let t = this.rules.inline.link.exec(e);
|
|
1359
1294
|
if (t) {
|
|
1360
1295
|
let n = t[0].charAt(0) === "!" ? 2 : 1;
|
|
1361
|
-
if (!this.options.pedantic &&
|
|
1296
|
+
if (!this.options.pedantic && Br(e, t[1], n, this.rules)) return;
|
|
1362
1297
|
let r = t[2].trim();
|
|
1363
1298
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
|
|
1364
1299
|
if (!this.rules.other.endAngleBracket.test(r)) return;
|
|
1365
|
-
let e =
|
|
1300
|
+
let e = Nr(r.slice(0, -1), "\\");
|
|
1366
1301
|
if ((r.length - e.length) % 2 == 0) return;
|
|
1367
1302
|
} else {
|
|
1368
|
-
let e =
|
|
1303
|
+
let e = Ir(t[2], "()");
|
|
1369
1304
|
if (e === -2) return;
|
|
1370
1305
|
if (e > -1) {
|
|
1371
1306
|
let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
|
|
@@ -1377,7 +1312,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1377
1312
|
let e = this.rules.other.pedanticHrefTitle.exec(i);
|
|
1378
1313
|
e && (i = e[1], a = e[3]);
|
|
1379
1314
|
} else a = t[3] ? t[3].slice(1, -1) : "";
|
|
1380
|
-
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)),
|
|
1315
|
+
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)), Rr(t, {
|
|
1381
1316
|
href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
1382
1317
|
title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
|
|
1383
1318
|
}, t[0], this.lexer, this.rules);
|
|
@@ -1387,8 +1322,8 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1387
1322
|
let n;
|
|
1388
1323
|
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
1389
1324
|
let r = n[0].charAt(0) === "!" ? 2 : 1;
|
|
1390
|
-
if (!this.options.pedantic &&
|
|
1391
|
-
let i = t[
|
|
1325
|
+
if (!this.options.pedantic && Br(e, n[1], r, this.rules)) return;
|
|
1326
|
+
let i = t[Fr((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
|
|
1392
1327
|
if (!i) {
|
|
1393
1328
|
let e = n[0].charAt(0);
|
|
1394
1329
|
return {
|
|
@@ -1397,7 +1332,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1397
1332
|
text: e
|
|
1398
1333
|
};
|
|
1399
1334
|
}
|
|
1400
|
-
return
|
|
1335
|
+
return Rr(n, i, n[0], this.lexer, this.rules);
|
|
1401
1336
|
}
|
|
1402
1337
|
}
|
|
1403
1338
|
emStrong(e, t, n = "") {
|
|
@@ -1530,7 +1465,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1530
1465
|
return {
|
|
1531
1466
|
type: "text",
|
|
1532
1467
|
raw: t[0],
|
|
1533
|
-
text: e ? t[0] :
|
|
1468
|
+
text: e ? t[0] : Ar(t[0]),
|
|
1534
1469
|
escaped: e
|
|
1535
1470
|
};
|
|
1536
1471
|
}
|
|
@@ -1542,7 +1477,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1542
1477
|
inlineQueue;
|
|
1543
1478
|
tokenizer;
|
|
1544
1479
|
constructor(e) {
|
|
1545
|
-
this.tokens = [], this.tokens.links = Object.create(null), this.options = e ||
|
|
1480
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || ln, this.options.tokenizer = this.options.tokenizer || new Vr(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
1546
1481
|
inLink: !1,
|
|
1547
1482
|
inRawBlock: !1,
|
|
1548
1483
|
linkEmitted: !1,
|
|
@@ -1551,15 +1486,15 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1551
1486
|
};
|
|
1552
1487
|
let t = {
|
|
1553
1488
|
other: z,
|
|
1554
|
-
block:
|
|
1555
|
-
inline:
|
|
1489
|
+
block: Er.normal,
|
|
1490
|
+
inline: Dr.normal
|
|
1556
1491
|
};
|
|
1557
|
-
this.options.pedantic ? (t.block =
|
|
1492
|
+
this.options.pedantic ? (t.block = Er.pedantic, t.inline = Dr.pedantic) : this.options.gfm && (t.block = Er.gfm, t.inline = this.options.breaks ? Dr.breaks : Dr.gfm), this.tokenizer.rules = t;
|
|
1558
1493
|
}
|
|
1559
1494
|
static get rules() {
|
|
1560
1495
|
return {
|
|
1561
|
-
block:
|
|
1562
|
-
inline:
|
|
1496
|
+
block: Er,
|
|
1497
|
+
inline: Dr
|
|
1563
1498
|
};
|
|
1564
1499
|
}
|
|
1565
1500
|
static lex(t, n) {
|
|
@@ -1649,7 +1584,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1649
1584
|
for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
|
|
1650
1585
|
for (let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
|
|
1651
1586
|
let e = t[0], n = e.lastIndexOf("[");
|
|
1652
|
-
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links,
|
|
1587
|
+
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, Fr(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
|
|
1653
1588
|
}
|
|
1654
1589
|
return !1;
|
|
1655
1590
|
}
|
|
@@ -1668,7 +1603,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1668
1603
|
if (this.tokens.links && e.includes("[")) {
|
|
1669
1604
|
let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
|
|
1670
1605
|
let r = n.lastIndexOf("[");
|
|
1671
|
-
if (!Object.hasOwn(this.tokens.links,
|
|
1606
|
+
if (!Object.hasOwn(this.tokens.links, Fr(n.slice(r + 1, -1)))) return n;
|
|
1672
1607
|
if (r > 1 && n.charAt(0) !== "!") {
|
|
1673
1608
|
let i = n.slice(1, r - 1);
|
|
1674
1609
|
if (this.linkInText(i)) return "[" + i.replace(e, t) + "][" + "a".repeat(n.length - r - 2) + "]";
|
|
@@ -1728,11 +1663,11 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1728
1663
|
if (this.options.silent) console.error(t);
|
|
1729
1664
|
else throw Error(t);
|
|
1730
1665
|
}
|
|
1731
|
-
},
|
|
1666
|
+
}, Hr = class {
|
|
1732
1667
|
options;
|
|
1733
1668
|
parser;
|
|
1734
1669
|
constructor(e) {
|
|
1735
|
-
this.options = e ||
|
|
1670
|
+
this.options = e || ln;
|
|
1736
1671
|
}
|
|
1737
1672
|
space(e) {
|
|
1738
1673
|
return "";
|
|
@@ -1818,7 +1753,7 @@ ${e}</tr>
|
|
|
1818
1753
|
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
1819
1754
|
}
|
|
1820
1755
|
link({ href: e, title: t, text: n, tokens: r, autolink: i }) {
|
|
1821
|
-
let a = i ? V(n, !0) : this.parser.parseInline(r), o =
|
|
1756
|
+
let a = i ? V(n, !0) : this.parser.parseInline(r), o = jr(e);
|
|
1822
1757
|
if (o === null) return a;
|
|
1823
1758
|
e = V(o, i);
|
|
1824
1759
|
let s = "<a href=\"" + e + "\"";
|
|
@@ -1826,7 +1761,7 @@ ${e}</tr>
|
|
|
1826
1761
|
}
|
|
1827
1762
|
image({ href: e, title: t, text: n, tokens: r }) {
|
|
1828
1763
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
1829
|
-
let i =
|
|
1764
|
+
let i = jr(e);
|
|
1830
1765
|
if (i === null) return V(n);
|
|
1831
1766
|
e = i;
|
|
1832
1767
|
let a = `<img src="${V(e)}" alt="${V(n)}"`;
|
|
@@ -1835,7 +1770,7 @@ ${e}</tr>
|
|
|
1835
1770
|
text(e) {
|
|
1836
1771
|
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : V(e.text);
|
|
1837
1772
|
}
|
|
1838
|
-
},
|
|
1773
|
+
}, Ur = class {
|
|
1839
1774
|
strong({ text: e }) {
|
|
1840
1775
|
return e;
|
|
1841
1776
|
}
|
|
@@ -1871,7 +1806,7 @@ ${e}</tr>
|
|
|
1871
1806
|
renderer;
|
|
1872
1807
|
textRenderer;
|
|
1873
1808
|
constructor(e) {
|
|
1874
|
-
this.options = e ||
|
|
1809
|
+
this.options = e || ln, this.options.renderer = this.options.renderer || new Hr(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Ur();
|
|
1875
1810
|
}
|
|
1876
1811
|
static parse(t, n) {
|
|
1877
1812
|
return new e(n).parse(t);
|
|
@@ -2019,11 +1954,11 @@ ${e}</tr>
|
|
|
2019
1954
|
}
|
|
2020
1955
|
return n;
|
|
2021
1956
|
}
|
|
2022
|
-
},
|
|
1957
|
+
}, Wr = class {
|
|
2023
1958
|
options;
|
|
2024
1959
|
block;
|
|
2025
1960
|
constructor(e) {
|
|
2026
|
-
this.options = e ||
|
|
1961
|
+
this.options = e || ln;
|
|
2027
1962
|
}
|
|
2028
1963
|
static passThroughHooks = /* @__PURE__ */ new Set([
|
|
2029
1964
|
"preprocess",
|
|
@@ -2054,17 +1989,17 @@ ${e}</tr>
|
|
|
2054
1989
|
provideParser(e = this.block) {
|
|
2055
1990
|
return e ? U.parse : U.parseInline;
|
|
2056
1991
|
}
|
|
2057
|
-
},
|
|
2058
|
-
defaults =
|
|
1992
|
+
}, Gr = new class {
|
|
1993
|
+
defaults = cn();
|
|
2059
1994
|
options = this.setOptions;
|
|
2060
1995
|
parse = this.parseMarkdown(!0);
|
|
2061
1996
|
parseInline = this.parseMarkdown(!1);
|
|
2062
1997
|
Parser = U;
|
|
2063
|
-
Renderer =
|
|
2064
|
-
TextRenderer =
|
|
1998
|
+
Renderer = Hr;
|
|
1999
|
+
TextRenderer = Ur;
|
|
2065
2000
|
Lexer = H;
|
|
2066
|
-
Tokenizer =
|
|
2067
|
-
Hooks =
|
|
2001
|
+
Tokenizer = Vr;
|
|
2002
|
+
Hooks = Wr;
|
|
2068
2003
|
constructor(...e) {
|
|
2069
2004
|
this.use(...e);
|
|
2070
2005
|
}
|
|
@@ -2115,7 +2050,7 @@ ${e}</tr>
|
|
|
2115
2050
|
}
|
|
2116
2051
|
"childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
|
|
2117
2052
|
}), n.extensions = t), e.renderer) {
|
|
2118
|
-
let t = this.defaults.renderer || new
|
|
2053
|
+
let t = this.defaults.renderer || new Hr(this.defaults);
|
|
2119
2054
|
for (let n in e.renderer) {
|
|
2120
2055
|
if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
|
|
2121
2056
|
if (["options", "parser"].includes(n)) continue;
|
|
@@ -2128,7 +2063,7 @@ ${e}</tr>
|
|
|
2128
2063
|
n.renderer = t;
|
|
2129
2064
|
}
|
|
2130
2065
|
if (e.tokenizer) {
|
|
2131
|
-
let t = this.defaults.tokenizer || new
|
|
2066
|
+
let t = this.defaults.tokenizer || new Vr(this.defaults);
|
|
2132
2067
|
for (let n in e.tokenizer) {
|
|
2133
2068
|
if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
|
|
2134
2069
|
if ([
|
|
@@ -2145,13 +2080,13 @@ ${e}</tr>
|
|
|
2145
2080
|
n.tokenizer = t;
|
|
2146
2081
|
}
|
|
2147
2082
|
if (e.hooks) {
|
|
2148
|
-
let t = this.defaults.hooks || new
|
|
2083
|
+
let t = this.defaults.hooks || new Wr();
|
|
2149
2084
|
for (let n in e.hooks) {
|
|
2150
2085
|
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
2151
2086
|
if (["options", "block"].includes(n)) continue;
|
|
2152
2087
|
let r = n, i = e.hooks[r], a = t[r];
|
|
2153
|
-
t[r] =
|
|
2154
|
-
if (this.defaults.async &&
|
|
2088
|
+
t[r] = Wr.passThroughHooks.has(n) ? (e) => {
|
|
2089
|
+
if (this.defaults.async && Wr.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
2155
2090
|
let n = await i.call(t, e);
|
|
2156
2091
|
return a.call(t, n);
|
|
2157
2092
|
})();
|
|
@@ -2231,31 +2166,31 @@ ${e}</tr>
|
|
|
2231
2166
|
}
|
|
2232
2167
|
}();
|
|
2233
2168
|
function W(e, t) {
|
|
2234
|
-
return
|
|
2169
|
+
return Gr.parse(e, t);
|
|
2235
2170
|
}
|
|
2236
2171
|
W.options = W.setOptions = function(e) {
|
|
2237
|
-
return
|
|
2238
|
-
}, W.getDefaults =
|
|
2239
|
-
function
|
|
2240
|
-
return
|
|
2172
|
+
return Gr.setOptions(e), W.defaults = Gr.defaults, un(W.defaults), W;
|
|
2173
|
+
}, W.getDefaults = cn, W.defaults = ln;
|
|
2174
|
+
function Kr(...e) {
|
|
2175
|
+
return Gr.use(...e), W.defaults = Gr.defaults, un(W.defaults), W;
|
|
2241
2176
|
}
|
|
2242
|
-
W.use =
|
|
2243
|
-
return
|
|
2244
|
-
}, W.parseInline =
|
|
2177
|
+
W.use = Kr, W.walkTokens = function(e, t) {
|
|
2178
|
+
return Gr.walkTokens(e, t);
|
|
2179
|
+
}, W.parseInline = Gr.parseInline, W.Parser = U, W.parser = U.parse, W.Renderer = Hr, W.TextRenderer = Ur, W.Lexer = H, W.lexer = H.lex, W.Tokenizer = Vr, W.Hooks = Wr, W.parse = W, W.options, W.setOptions, W.walkTokens, W.parseInline, U.parse, H.lex;
|
|
2245
2180
|
//#endregion
|
|
2246
2181
|
//#region ../../node_modules/.pnpm/dompurify@3.4.16/node_modules/dompurify/dist/purify.es.mjs
|
|
2247
|
-
function
|
|
2182
|
+
function qr(e, t) {
|
|
2248
2183
|
this.v = e, this.k = t;
|
|
2249
2184
|
}
|
|
2250
|
-
function
|
|
2185
|
+
function Jr(e, t) {
|
|
2251
2186
|
(t == null || t > e.length) && (t = e.length);
|
|
2252
2187
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
2253
2188
|
return r;
|
|
2254
2189
|
}
|
|
2255
|
-
function
|
|
2190
|
+
function Yr(e) {
|
|
2256
2191
|
if (Array.isArray(e)) return e;
|
|
2257
2192
|
}
|
|
2258
|
-
function
|
|
2193
|
+
function Xr(e, t) {
|
|
2259
2194
|
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
2260
2195
|
if (n != null) {
|
|
2261
2196
|
var r, i, a, o, s = [], c = !0, l = !1;
|
|
@@ -2276,24 +2211,24 @@ function ni(e, t) {
|
|
|
2276
2211
|
return s;
|
|
2277
2212
|
}
|
|
2278
2213
|
}
|
|
2279
|
-
function
|
|
2214
|
+
function Zr() {
|
|
2280
2215
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2281
2216
|
}
|
|
2282
|
-
function
|
|
2283
|
-
return
|
|
2217
|
+
function Qr(e, t) {
|
|
2218
|
+
return Yr(e) || Xr(e, t) || $r(e, t) || Zr();
|
|
2284
2219
|
}
|
|
2285
|
-
function
|
|
2220
|
+
function $r(e, t) {
|
|
2286
2221
|
if (e) {
|
|
2287
|
-
if (typeof e == "string") return
|
|
2222
|
+
if (typeof e == "string") return Jr(e, t);
|
|
2288
2223
|
var n = {}.toString.call(e).slice(8, -1);
|
|
2289
|
-
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) ?
|
|
2224
|
+
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) ? Jr(e, t) : void 0;
|
|
2290
2225
|
}
|
|
2291
2226
|
}
|
|
2292
|
-
function
|
|
2227
|
+
function ei(e) {
|
|
2293
2228
|
var t, n;
|
|
2294
2229
|
function r(t, n) {
|
|
2295
2230
|
try {
|
|
2296
|
-
var a = e[t](n), o = a.value, s = o instanceof
|
|
2231
|
+
var a = e[t](n), o = a.value, s = o instanceof qr;
|
|
2297
2232
|
Promise.resolve(s ? o.v : o).then(function(n) {
|
|
2298
2233
|
if (s) {
|
|
2299
2234
|
var c = t === "return" && o.k ? t : "next";
|
|
@@ -2327,113 +2262,113 @@ function oi(e) {
|
|
|
2327
2262
|
});
|
|
2328
2263
|
}, typeof e.return != "function" && (this.return = void 0);
|
|
2329
2264
|
}
|
|
2330
|
-
|
|
2265
|
+
ei.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
|
|
2331
2266
|
return this;
|
|
2332
|
-
},
|
|
2267
|
+
}, ei.prototype.next = function(e) {
|
|
2333
2268
|
return this._invoke("next", e);
|
|
2334
|
-
},
|
|
2269
|
+
}, ei.prototype.throw = function(e) {
|
|
2335
2270
|
return this._invoke("throw", e);
|
|
2336
|
-
},
|
|
2271
|
+
}, ei.prototype.return = function(e) {
|
|
2337
2272
|
return this._invoke("return", e);
|
|
2338
2273
|
};
|
|
2339
|
-
var
|
|
2274
|
+
var ti = Object.entries, ni = Object.setPrototypeOf, ri = Object.isFrozen, ii = Object.getPrototypeOf, ai = Object.getOwnPropertyDescriptor, G = Object.freeze, K = Object.seal, oi = Object.create, si = typeof Reflect < "u" && Reflect, ci = si.apply, li = si.construct;
|
|
2340
2275
|
G ||= function(e) {
|
|
2341
2276
|
return e;
|
|
2342
2277
|
}, K ||= function(e) {
|
|
2343
2278
|
return e;
|
|
2344
|
-
},
|
|
2279
|
+
}, ci ||= function(e, t) {
|
|
2345
2280
|
var n = [...arguments].slice(2);
|
|
2346
2281
|
return e.apply(t, n);
|
|
2347
|
-
},
|
|
2282
|
+
}, li ||= function(e) {
|
|
2348
2283
|
return new e(...[...arguments].slice(1));
|
|
2349
2284
|
};
|
|
2350
|
-
var
|
|
2285
|
+
var ui = Y(Array.prototype.forEach);
|
|
2351
2286
|
Array.prototype.indexOf;
|
|
2352
|
-
var
|
|
2287
|
+
var di = Y(Array.prototype.lastIndexOf), fi = Y(Array.prototype.pop), pi = Y(Array.prototype.push);
|
|
2353
2288
|
Array.prototype.slice;
|
|
2354
|
-
var
|
|
2289
|
+
var mi = Y(Array.prototype.splice), hi = Array.isArray, gi = Y(String.prototype.toLowerCase), _i = Y(String.prototype.toString), vi = Y(String.prototype.match), yi = Y(String.prototype.replace), bi = Y(String.prototype.indexOf), xi = Y(String.prototype.trim), Si = Y(Number.prototype.toString), Ci = Y(Boolean.prototype.toString), wi = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), Ti = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), Ei = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), Di = Oi(TypeError);
|
|
2355
2290
|
function Y(e) {
|
|
2356
2291
|
return function(t) {
|
|
2357
2292
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
2358
2293
|
var n = [...arguments].slice(1);
|
|
2359
|
-
return
|
|
2294
|
+
return ci(e, t, n);
|
|
2360
2295
|
};
|
|
2361
2296
|
}
|
|
2362
|
-
function
|
|
2297
|
+
function Oi(e) {
|
|
2363
2298
|
return function() {
|
|
2364
|
-
return
|
|
2299
|
+
return li(e, [...arguments]);
|
|
2365
2300
|
};
|
|
2366
2301
|
}
|
|
2367
2302
|
function X(e, t) {
|
|
2368
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
2369
|
-
if (
|
|
2303
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : gi;
|
|
2304
|
+
if (ni && ni(e, null), !hi(t)) return e;
|
|
2370
2305
|
let r = t.length;
|
|
2371
2306
|
for (; r--;) {
|
|
2372
2307
|
let i = t[r];
|
|
2373
2308
|
if (typeof i == "string") {
|
|
2374
2309
|
let e = n(i);
|
|
2375
|
-
e !== i && (
|
|
2310
|
+
e !== i && (ri(t) || (t[r] = e), i = e);
|
|
2376
2311
|
}
|
|
2377
2312
|
e[i] = !0;
|
|
2378
2313
|
}
|
|
2379
2314
|
return e;
|
|
2380
2315
|
}
|
|
2381
|
-
function
|
|
2316
|
+
function ki(e) {
|
|
2382
2317
|
for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
|
|
2383
2318
|
return e;
|
|
2384
2319
|
}
|
|
2385
2320
|
function Z(e) {
|
|
2386
|
-
let t =
|
|
2387
|
-
for (let r of
|
|
2388
|
-
var n =
|
|
2321
|
+
let t = oi(null);
|
|
2322
|
+
for (let r of ti(e)) {
|
|
2323
|
+
var n = Qr(r, 2);
|
|
2389
2324
|
let i = n[0], a = n[1];
|
|
2390
|
-
q(e, i) && (t[i] =
|
|
2325
|
+
q(e, i) && (t[i] = hi(a) ? ki(a) : a && typeof a == "object" && a.constructor === Object ? Z(a) : a);
|
|
2391
2326
|
}
|
|
2392
2327
|
return t;
|
|
2393
2328
|
}
|
|
2394
|
-
function
|
|
2329
|
+
function Ai(e) {
|
|
2395
2330
|
switch (typeof e) {
|
|
2396
2331
|
case "string": return e;
|
|
2397
|
-
case "number": return
|
|
2398
|
-
case "boolean": return
|
|
2399
|
-
case "bigint": return
|
|
2400
|
-
case "symbol": return
|
|
2401
|
-
case "undefined": return
|
|
2332
|
+
case "number": return Si(e);
|
|
2333
|
+
case "boolean": return Ci(e);
|
|
2334
|
+
case "bigint": return wi ? wi(e) : "0";
|
|
2335
|
+
case "symbol": return Ti ? Ti(e) : "Symbol()";
|
|
2336
|
+
case "undefined": return Ei(e);
|
|
2402
2337
|
case "function":
|
|
2403
2338
|
case "object": {
|
|
2404
|
-
if (e === null) return
|
|
2339
|
+
if (e === null) return Ei(e);
|
|
2405
2340
|
let t = e, n = Q(t, "toString");
|
|
2406
2341
|
if (typeof n == "function") {
|
|
2407
2342
|
let e = n(t);
|
|
2408
|
-
return typeof e == "string" ? e :
|
|
2343
|
+
return typeof e == "string" ? e : Ei(e);
|
|
2409
2344
|
}
|
|
2410
|
-
return
|
|
2345
|
+
return Ei(e);
|
|
2411
2346
|
}
|
|
2412
|
-
default: return
|
|
2347
|
+
default: return Ei(e);
|
|
2413
2348
|
}
|
|
2414
2349
|
}
|
|
2415
2350
|
function Q(e, t) {
|
|
2416
2351
|
for (; e !== null;) {
|
|
2417
|
-
let n =
|
|
2352
|
+
let n = ai(e, t);
|
|
2418
2353
|
if (n) {
|
|
2419
2354
|
if (n.get) return Y(n.get);
|
|
2420
2355
|
if (typeof n.value == "function") return Y(n.value);
|
|
2421
2356
|
}
|
|
2422
|
-
e =
|
|
2357
|
+
e = ii(e);
|
|
2423
2358
|
}
|
|
2424
2359
|
function n() {
|
|
2425
2360
|
return null;
|
|
2426
2361
|
}
|
|
2427
2362
|
return n;
|
|
2428
2363
|
}
|
|
2429
|
-
function
|
|
2364
|
+
function ji(e) {
|
|
2430
2365
|
try {
|
|
2431
2366
|
return J(e, ""), !0;
|
|
2432
2367
|
} catch {
|
|
2433
2368
|
return !1;
|
|
2434
2369
|
}
|
|
2435
2370
|
}
|
|
2436
|
-
var
|
|
2371
|
+
var Mi = 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(".")), Ni = 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(".")), Pi = G([
|
|
2437
2372
|
"feBlend",
|
|
2438
2373
|
"feColorMatrix",
|
|
2439
2374
|
"feComponentTransfer",
|
|
@@ -2459,7 +2394,7 @@ var Ri = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2459
2394
|
"feSpotLight",
|
|
2460
2395
|
"feTile",
|
|
2461
2396
|
"feTurbulence"
|
|
2462
|
-
]),
|
|
2397
|
+
]), Fi = G([
|
|
2463
2398
|
"animate",
|
|
2464
2399
|
"color-profile",
|
|
2465
2400
|
"cursor",
|
|
@@ -2482,7 +2417,7 @@ var Ri = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2482
2417
|
"solidcolor",
|
|
2483
2418
|
"unknown",
|
|
2484
2419
|
"use"
|
|
2485
|
-
]),
|
|
2420
|
+
]), Ii = 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(".")), Li = G([
|
|
2486
2421
|
"maction",
|
|
2487
2422
|
"maligngroup",
|
|
2488
2423
|
"malignmark",
|
|
@@ -2498,13 +2433,13 @@ var Ri = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2498
2433
|
"annotation-xml",
|
|
2499
2434
|
"mprescripts",
|
|
2500
2435
|
"none"
|
|
2501
|
-
]),
|
|
2436
|
+
]), Ri = G(["#text"]), zi = 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(".")), Bi = 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(".")), Vi = 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(".")), Hi = G([
|
|
2502
2437
|
"xlink:href",
|
|
2503
2438
|
"xml:id",
|
|
2504
2439
|
"xlink:title",
|
|
2505
2440
|
"xml:space",
|
|
2506
2441
|
"xmlns:xlink"
|
|
2507
|
-
]),
|
|
2442
|
+
]), Ui = K(/{{[\w\W]*|^[\w\W]*}}/g), Wi = K(/<%[\w\W]*|^[\w\W]*%>/g), Gi = K(/\${[\w\W]*/g), Ki = K(/^data-[\-\w.\u00B7-\uFFFF]+$/), qi = K(/^aria-[\-\w]+$/), Ji = K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Yi = K(/^(?:\w+script|data):/i), Xi = K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Zi = K(/^html$/i), Qi = K(/^[a-z][.\w]*(-[.\w]+)+$/i), $i = K(/<[/\w!]/g), ea = K(/<[/\w]/g), ta = K(/<\/no(script|embed|frames)/i), na = K(/\/>/i), $ = {
|
|
2508
2443
|
element: 1,
|
|
2509
2444
|
attribute: 2,
|
|
2510
2445
|
text: 3,
|
|
@@ -2517,7 +2452,7 @@ var Ri = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2517
2452
|
documentType: 10,
|
|
2518
2453
|
documentFragment: 11,
|
|
2519
2454
|
notation: 12
|
|
2520
|
-
},
|
|
2455
|
+
}, ra = [
|
|
2521
2456
|
"style",
|
|
2522
2457
|
"script",
|
|
2523
2458
|
"xmp",
|
|
@@ -2526,14 +2461,14 @@ var Ri = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2526
2461
|
"noframes",
|
|
2527
2462
|
"plaintext",
|
|
2528
2463
|
"noscript"
|
|
2529
|
-
],
|
|
2464
|
+
], ia = G(X({}, ra)), aa = function() {
|
|
2530
2465
|
let e = {};
|
|
2531
|
-
return
|
|
2466
|
+
return ui(ra, (t) => {
|
|
2532
2467
|
e[t] = K(RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
2533
2468
|
}), G(e);
|
|
2534
|
-
}(),
|
|
2469
|
+
}(), oa = function() {
|
|
2535
2470
|
return typeof window > "u" ? null : window;
|
|
2536
|
-
},
|
|
2471
|
+
}, sa = function(e, t) {
|
|
2537
2472
|
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
2538
2473
|
let n = null, r = "data-tt-policy-suffix";
|
|
2539
2474
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
@@ -2550,7 +2485,7 @@ var Ri = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2550
2485
|
} catch {
|
|
2551
2486
|
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
2552
2487
|
}
|
|
2553
|
-
},
|
|
2488
|
+
}, ca = function() {
|
|
2554
2489
|
return {
|
|
2555
2490
|
afterSanitizeAttributes: [],
|
|
2556
2491
|
afterSanitizeElements: [],
|
|
@@ -2562,21 +2497,21 @@ var Ri = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2562
2497
|
uponSanitizeElement: [],
|
|
2563
2498
|
uponSanitizeShadowNode: []
|
|
2564
2499
|
};
|
|
2565
|
-
},
|
|
2566
|
-
return q(e, t) &&
|
|
2567
|
-
},
|
|
2500
|
+
}, la = function(e, t, n, r) {
|
|
2501
|
+
return q(e, t) && hi(e[t]) ? X(r.base ? Z(r.base) : {}, e[t], r.transform) : n;
|
|
2502
|
+
}, ua = function(e, t, n) {
|
|
2568
2503
|
let r = q(e, t) ? e[t] : void 0;
|
|
2569
2504
|
return r && typeof r == "object" ? Z(r) : n();
|
|
2570
2505
|
};
|
|
2571
|
-
function
|
|
2572
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
2506
|
+
function da() {
|
|
2507
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : oa(), t = (e) => da(e);
|
|
2573
2508
|
if (t.version = "3.4.16", t.removed = [], !e || !e.document || e.document.nodeType !== $.document || !e.Element) return t.isSupported = !1, t;
|
|
2574
2509
|
let n = e.document, r = n, i = r.currentScript;
|
|
2575
2510
|
e.DocumentFragment;
|
|
2576
2511
|
let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
|
|
2577
2512
|
e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
|
|
2578
|
-
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), te = Q(d, "nextSibling"),
|
|
2579
|
-
return
|
|
2513
|
+
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), te = Q(d, "nextSibling"), m = Q(d, "childNodes"), ne = Q(d, "parentNode"), re = Q(d, "shadowRoot"), h = Q(d, "attributes"), ie = o && o.prototype ? Q(o.prototype, "nodeType") : null, ae = o && o.prototype ? Q(o.prototype, "nodeName") : null, oe = o && o.prototype ? Q(o.prototype, "ownerDocument") : null, se = function(e) {
|
|
2514
|
+
return ie ? ie(e) : e.nodeType;
|
|
2580
2515
|
}, ce = function(e) {
|
|
2581
2516
|
return ae ? ae(e) : e.nodeName;
|
|
2582
2517
|
};
|
|
@@ -2584,38 +2519,38 @@ function _a() {
|
|
|
2584
2519
|
let e = n.createElement("template");
|
|
2585
2520
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
2586
2521
|
}
|
|
2587
|
-
let g, _ = "", le, ue = !1,
|
|
2588
|
-
if (
|
|
2589
|
-
},
|
|
2590
|
-
|
|
2522
|
+
let g, _ = "", le, ue = !1, v = 0, de = function() {
|
|
2523
|
+
if (v > 0) throw Di("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.");
|
|
2524
|
+
}, fe = function(e) {
|
|
2525
|
+
de(), v++;
|
|
2591
2526
|
try {
|
|
2592
2527
|
return g.createHTML(e);
|
|
2593
2528
|
} finally {
|
|
2594
|
-
|
|
2529
|
+
v--;
|
|
2595
2530
|
}
|
|
2596
|
-
},
|
|
2597
|
-
|
|
2531
|
+
}, pe = function(e) {
|
|
2532
|
+
de(), v++;
|
|
2598
2533
|
try {
|
|
2599
2534
|
return g.createScriptURL(e);
|
|
2600
2535
|
} finally {
|
|
2601
|
-
|
|
2602
|
-
}
|
|
2603
|
-
},
|
|
2604
|
-
return ue ||= (le =
|
|
2605
|
-
},
|
|
2606
|
-
t.isSupported = typeof
|
|
2607
|
-
let
|
|
2608
|
-
...
|
|
2536
|
+
v--;
|
|
2537
|
+
}
|
|
2538
|
+
}, me = function() {
|
|
2539
|
+
return ue ||= (le = sa(u, i), !0), le;
|
|
2540
|
+
}, he = n, y = he.implementation, ge = he.createNodeIterator, _e = he.createDocumentFragment, ve = he.getElementsByTagName, ye = r.importNode, b = ca();
|
|
2541
|
+
t.isSupported = typeof ti == "function" && typeof ne == "function" && y && y.createHTMLDocument !== void 0;
|
|
2542
|
+
let be = Ui, xe = Wi, Se = Gi, Ce = Ki, we = qi, Te = Yi, Ee = Xi, De = Qi, Oe = Ji, x = null, ke = X({}, [
|
|
2543
|
+
...Mi,
|
|
2544
|
+
...Ni,
|
|
2545
|
+
...Pi,
|
|
2546
|
+
...Ii,
|
|
2547
|
+
...Ri
|
|
2548
|
+
]), S = null, C = X({}, [
|
|
2609
2549
|
...zi,
|
|
2610
2550
|
...Bi,
|
|
2611
|
-
...
|
|
2612
|
-
...
|
|
2613
|
-
]),
|
|
2614
|
-
...Gi,
|
|
2615
|
-
...Ki,
|
|
2616
|
-
...qi,
|
|
2617
|
-
...Ji
|
|
2618
|
-
]), C = Object.seal(fi(null, {
|
|
2551
|
+
...Vi,
|
|
2552
|
+
...Hi
|
|
2553
|
+
]), w = Object.seal(oi(null, {
|
|
2619
2554
|
tagNameCheck: {
|
|
2620
2555
|
writable: !0,
|
|
2621
2556
|
configurable: !1,
|
|
@@ -2634,7 +2569,7 @@ function _a() {
|
|
|
2634
2569
|
enumerable: !0,
|
|
2635
2570
|
value: !1
|
|
2636
2571
|
}
|
|
2637
|
-
})),
|
|
2572
|
+
})), Ae = null, je = null, T = Object.seal(oi(null, {
|
|
2638
2573
|
tagCheck: {
|
|
2639
2574
|
writable: !0,
|
|
2640
2575
|
configurable: !1,
|
|
@@ -2647,14 +2582,14 @@ function _a() {
|
|
|
2647
2582
|
enumerable: !0,
|
|
2648
2583
|
value: null
|
|
2649
2584
|
}
|
|
2650
|
-
})),
|
|
2585
|
+
})), Me = !0, Ne = !0, Pe = !1, Fe = !0, E = !1, Ie = !0, Le = !1, D = !1, Re = null, ze = null, Be = !1, Ve = !1, He = !1, O = !1, k = !0, Ue = !1, We = "user-content-", A = !0, Ge = !1, Ke = {}, qe = null, Je = 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(".")), Ye = null, Xe = X({}, [
|
|
2651
2586
|
"audio",
|
|
2652
2587
|
"video",
|
|
2653
2588
|
"img",
|
|
2654
2589
|
"source",
|
|
2655
2590
|
"image",
|
|
2656
2591
|
"track"
|
|
2657
|
-
]),
|
|
2592
|
+
]), Ze = null, Qe = X({}, [
|
|
2658
2593
|
"alt",
|
|
2659
2594
|
"class",
|
|
2660
2595
|
"for",
|
|
@@ -2669,75 +2604,75 @@ function _a() {
|
|
|
2669
2604
|
"value",
|
|
2670
2605
|
"style",
|
|
2671
2606
|
"xmlns"
|
|
2672
|
-
]),
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
],
|
|
2607
|
+
]), j = "http://www.w3.org/1998/Math/MathML", $e = "http://www.w3.org/2000/svg", M = "http://www.w3.org/1999/xhtml", et = M, N = !1, tt = null, nt = X({}, [
|
|
2608
|
+
j,
|
|
2609
|
+
$e,
|
|
2610
|
+
M
|
|
2611
|
+
], _i), rt = G([
|
|
2677
2612
|
"mi",
|
|
2678
2613
|
"mo",
|
|
2679
2614
|
"mn",
|
|
2680
2615
|
"ms",
|
|
2681
2616
|
"mtext"
|
|
2682
|
-
]), it = X({}, rt), at = G(["annotation-xml"]),
|
|
2617
|
+
]), it = X({}, rt), at = G(["annotation-xml"]), ot = X({}, at), st = X({}, [
|
|
2683
2618
|
"title",
|
|
2684
2619
|
"style",
|
|
2685
2620
|
"font",
|
|
2686
2621
|
"a",
|
|
2687
2622
|
"script"
|
|
2688
|
-
]),
|
|
2623
|
+
]), ct = null, lt = ["application/xhtml+xml", "text/html"], P = null, ut = null, dt = n.createElement("form"), ft = function(e) {
|
|
2689
2624
|
return e instanceof RegExp || e instanceof Function;
|
|
2690
|
-
},
|
|
2625
|
+
}, pt = function() {
|
|
2691
2626
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2692
|
-
if (
|
|
2693
|
-
(!e || typeof e != "object") && (e = {}), e = Z(e),
|
|
2694
|
-
transform:
|
|
2627
|
+
if (ut && ut === e) return;
|
|
2628
|
+
(!e || typeof e != "object") && (e = {}), e = Z(e), ct = lt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, P = ct === "application/xhtml+xml" ? _i : gi, x = la(e, "ALLOWED_TAGS", ke, { transform: P }), S = la(e, "ALLOWED_ATTR", C, { transform: P }), tt = la(e, "ALLOWED_NAMESPACES", nt, { transform: _i }), Ze = la(e, "ADD_URI_SAFE_ATTR", Qe, {
|
|
2629
|
+
transform: P,
|
|
2630
|
+
base: Qe
|
|
2631
|
+
}), Ye = la(e, "ADD_DATA_URI_TAGS", Xe, {
|
|
2632
|
+
transform: P,
|
|
2695
2633
|
base: Xe
|
|
2696
|
-
}), Je =
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
}), j = ha(e, "FORBID_CONTENTS", qe, { transform: F }), je = ha(e, "FORBID_TAGS", Z({}), { transform: F }), Me = ha(e, "FORBID_ATTR", Z({}), { transform: F }), A = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, Ne = e.ALLOW_ARIA_ATTR !== !1, T = e.ALLOW_DATA_ATTR !== !1, Pe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Fe = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, E = e.SAFE_FOR_TEMPLATES || !1, D = e.SAFE_FOR_XML !== !1, O = e.WHOLE_DOCUMENT || !1, Be = e.RETURN_DOM || !1, Ve = e.RETURN_DOM_FRAGMENT || !1, k = e.RETURN_TRUSTED_TYPE || !1, ze = e.FORCE_BODY || !1, He = e.SANITIZE_DOM !== !1, Ue = e.SANITIZE_NAMED_PROPS || !1, Ge = e.KEEP_CONTENT !== !1, Ke = e.IN_PLACE || !1, Oe = Li(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : ea, $e = typeof e.NAMESPACE == "string" ? e.NAMESPACE : N, it = ga(e, "MATHML_TEXT_INTEGRATION_POINTS", () => X({}, rt)), P = ga(e, "HTML_INTEGRATION_POINTS", () => X({}, at));
|
|
2700
|
-
let t = ga(e, "CUSTOM_ELEMENT_HANDLING", () => fi(null));
|
|
2701
|
-
if (C = fi(null), q(t, "tagNameCheck") && dt(t.tagNameCheck) && (C.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && dt(t.attributeNameCheck) && (C.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (C.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(C), E && (T = !1), Ve && (Be = !0), A && (x = X({}, Wi), S = fi(null), A.html === !0 && (X(x, Ri), X(S, Gi)), A.svg === !0 && (X(x, zi), X(S, Ki), X(S, Ji)), A.svgFilters === !0 && (X(x, Bi), X(S, Ki), X(S, Ji)), A.mathMl === !0 && (X(x, Hi), X(S, qi), X(S, Ji))), w.tagCheck = null, w.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? w.tagCheck = e.ADD_TAGS : xi(e.ADD_TAGS) && (x === ke && (x = Z(x)), X(x, e.ADD_TAGS, F))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? w.attributeCheck = e.ADD_ATTR : xi(e.ADD_ATTR) && (S === Ae && (S = Z(S)), X(S, e.ADD_ATTR, F))), q(e, "ADD_FORBID_CONTENTS") && xi(e.ADD_FORBID_CONTENTS) && (j === qe && (j = Z(j)), X(j, e.ADD_FORBID_CONTENTS, F)), Ge && (x["#text"] = !0), O && X(x, [
|
|
2634
|
+
}), qe = la(e, "FORBID_CONTENTS", Je, { transform: P }), Ae = la(e, "FORBID_TAGS", Z({}), { transform: P }), je = la(e, "FORBID_ATTR", Z({}), { transform: P }), Ke = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, Me = e.ALLOW_ARIA_ATTR !== !1, Ne = e.ALLOW_DATA_ATTR !== !1, Pe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Fe = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, E = e.SAFE_FOR_TEMPLATES || !1, Ie = e.SAFE_FOR_XML !== !1, Le = e.WHOLE_DOCUMENT || !1, Ve = e.RETURN_DOM || !1, He = e.RETURN_DOM_FRAGMENT || !1, O = e.RETURN_TRUSTED_TYPE || !1, Be = e.FORCE_BODY || !1, k = e.SANITIZE_DOM !== !1, Ue = e.SANITIZE_NAMED_PROPS || !1, A = e.KEEP_CONTENT !== !1, Ge = e.IN_PLACE || !1, Oe = ji(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Ji, et = typeof e.NAMESPACE == "string" ? e.NAMESPACE : M, it = ua(e, "MATHML_TEXT_INTEGRATION_POINTS", () => X({}, rt)), ot = ua(e, "HTML_INTEGRATION_POINTS", () => X({}, at));
|
|
2635
|
+
let t = ua(e, "CUSTOM_ELEMENT_HANDLING", () => oi(null));
|
|
2636
|
+
if (w = oi(null), q(t, "tagNameCheck") && ft(t.tagNameCheck) && (w.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && ft(t.attributeNameCheck) && (w.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (w.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(w), E && (Ne = !1), He && (Ve = !0), Ke && (x = X({}, Ri), S = oi(null), Ke.html === !0 && (X(x, Mi), X(S, zi)), Ke.svg === !0 && (X(x, Ni), X(S, Bi), X(S, Hi)), Ke.svgFilters === !0 && (X(x, Pi), X(S, Bi), X(S, Hi)), Ke.mathMl === !0 && (X(x, Ii), X(S, Vi), X(S, Hi))), T.tagCheck = null, T.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? T.tagCheck = e.ADD_TAGS : hi(e.ADD_TAGS) && (x === ke && (x = Z(x)), X(x, e.ADD_TAGS, P))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? T.attributeCheck = e.ADD_ATTR : hi(e.ADD_ATTR) && (S === C && (S = Z(S)), X(S, e.ADD_ATTR, P))), q(e, "ADD_FORBID_CONTENTS") && hi(e.ADD_FORBID_CONTENTS) && (qe === Je && (qe = Z(qe)), X(qe, e.ADD_FORBID_CONTENTS, P)), A && (x["#text"] = !0), Le && X(x, [
|
|
2702
2637
|
"html",
|
|
2703
2638
|
"head",
|
|
2704
2639
|
"body"
|
|
2705
|
-
]), x.table && (X(x, ["tbody"]), delete
|
|
2706
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
2707
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
2640
|
+
]), x.table && (X(x, ["tbody"]), delete Ae.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
2641
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Di("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
2642
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Di("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
2708
2643
|
let t = g;
|
|
2709
2644
|
g = e.TRUSTED_TYPES_POLICY;
|
|
2710
2645
|
try {
|
|
2711
|
-
_ =
|
|
2646
|
+
_ = fe("");
|
|
2712
2647
|
} catch (e) {
|
|
2713
2648
|
throw g = t, e;
|
|
2714
2649
|
}
|
|
2715
|
-
} else e.TRUSTED_TYPES_POLICY === null ? (g = void 0, _ = "") : (g === void 0 && (g =
|
|
2716
|
-
G && G(e),
|
|
2717
|
-
},
|
|
2718
|
-
...
|
|
2719
|
-
...
|
|
2720
|
-
...
|
|
2721
|
-
]),
|
|
2722
|
-
return t.namespaceURI ===
|
|
2723
|
-
}, gt = function(e, t, n) {
|
|
2724
|
-
return t.namespaceURI === N ? e === "math" : t.namespaceURI === Qe ? e === "math" && P[n] : !!mt[e];
|
|
2650
|
+
} else e.TRUSTED_TYPES_POLICY === null ? (g = void 0, _ = "") : (g === void 0 && (g = me()), g && typeof _ == "string" && (_ = fe("")));
|
|
2651
|
+
G && G(e), ut = e;
|
|
2652
|
+
}, mt = X({}, [
|
|
2653
|
+
...Ni,
|
|
2654
|
+
...Pi,
|
|
2655
|
+
...Fi
|
|
2656
|
+
]), ht = X({}, [...Ii, ...Li]), gt = function(e, t, n) {
|
|
2657
|
+
return t.namespaceURI === M ? e === "svg" : t.namespaceURI === j ? e === "svg" && (n === "annotation-xml" || it[n]) : !!mt[e];
|
|
2725
2658
|
}, _t = function(e, t, n) {
|
|
2726
|
-
return t.namespaceURI ===
|
|
2727
|
-
}, vt = function(e) {
|
|
2728
|
-
|
|
2659
|
+
return t.namespaceURI === M ? e === "math" : t.namespaceURI === $e ? e === "math" && ot[n] : !!ht[e];
|
|
2660
|
+
}, vt = function(e, t, n) {
|
|
2661
|
+
return t.namespaceURI === $e && !ot[n] || t.namespaceURI === j && !it[n] ? !1 : !ht[e] && (st[e] || !mt[e]);
|
|
2662
|
+
}, yt = function(e) {
|
|
2663
|
+
let t = ne(e);
|
|
2729
2664
|
(!t || !t.tagName) && (t = {
|
|
2730
|
-
namespaceURI:
|
|
2665
|
+
namespaceURI: et,
|
|
2731
2666
|
tagName: "template"
|
|
2732
2667
|
});
|
|
2733
|
-
let n =
|
|
2734
|
-
return tt[e.namespaceURI] ? e.namespaceURI ===
|
|
2735
|
-
},
|
|
2736
|
-
|
|
2668
|
+
let n = gi(e.tagName), r = gi(t.tagName);
|
|
2669
|
+
return tt[e.namespaceURI] ? e.namespaceURI === $e ? gt(n, t, r) : e.namespaceURI === j ? _t(n, t, r) : e.namespaceURI === M ? vt(n, t, r) : !!(ct === "application/xhtml+xml" && tt[e.namespaceURI]) : !1;
|
|
2670
|
+
}, F = function(e) {
|
|
2671
|
+
pi(t.removed, { element: e });
|
|
2737
2672
|
try {
|
|
2738
|
-
|
|
2673
|
+
ne(e).removeChild(e);
|
|
2739
2674
|
} catch {
|
|
2740
|
-
if (p(e), !
|
|
2675
|
+
if (p(e), !ne(e)) throw Di("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
2741
2676
|
}
|
|
2742
2677
|
}, bt = function(e, t, n) {
|
|
2743
2678
|
try {
|
|
@@ -2749,18 +2684,18 @@ function _a() {
|
|
|
2749
2684
|
}
|
|
2750
2685
|
}, xt = function(e) {
|
|
2751
2686
|
wt(e);
|
|
2752
|
-
let t =
|
|
2687
|
+
let t = m(e);
|
|
2753
2688
|
if (t) {
|
|
2754
2689
|
let e = [];
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
}),
|
|
2690
|
+
ui(t, (t) => {
|
|
2691
|
+
pi(e, t);
|
|
2692
|
+
}), ui(e, (e) => {
|
|
2758
2693
|
try {
|
|
2759
2694
|
p(e);
|
|
2760
2695
|
} catch {}
|
|
2761
2696
|
});
|
|
2762
2697
|
}
|
|
2763
|
-
let n =
|
|
2698
|
+
let n = h(e);
|
|
2764
2699
|
if (n) for (let t = n.length - 1; t >= 0; --t) {
|
|
2765
2700
|
let r = n[t], i = r && r.name;
|
|
2766
2701
|
typeof i == "string" && bt(e, r, i);
|
|
@@ -2771,7 +2706,7 @@ function _a() {
|
|
|
2771
2706
|
} catch {
|
|
2772
2707
|
r = null;
|
|
2773
2708
|
}
|
|
2774
|
-
|
|
2709
|
+
pi(t.removed, {
|
|
2775
2710
|
attribute: r || null,
|
|
2776
2711
|
from: n
|
|
2777
2712
|
});
|
|
@@ -2783,113 +2718,113 @@ function _a() {
|
|
|
2783
2718
|
} catch {}
|
|
2784
2719
|
}
|
|
2785
2720
|
if (e === "is") {
|
|
2786
|
-
if (
|
|
2787
|
-
|
|
2721
|
+
if (Ve || He) try {
|
|
2722
|
+
F(n);
|
|
2788
2723
|
} catch {}
|
|
2789
2724
|
else try {
|
|
2790
2725
|
n.setAttribute(e, "");
|
|
2791
2726
|
} catch {}
|
|
2792
2727
|
}
|
|
2793
2728
|
}, Ct = function(e) {
|
|
2794
|
-
let t =
|
|
2729
|
+
let t = h(e);
|
|
2795
2730
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
2796
2731
|
let r = t[n], i = r && r.name;
|
|
2797
|
-
typeof i != "string" || S[
|
|
2732
|
+
typeof i != "string" || S[P(i)] || bt(e, r, i);
|
|
2798
2733
|
}
|
|
2799
2734
|
}, wt = function(e) {
|
|
2800
2735
|
let t = [e];
|
|
2801
2736
|
for (; t.length > 0;) {
|
|
2802
2737
|
let e = t.pop();
|
|
2803
2738
|
se(e) === $.element && Ct(e);
|
|
2804
|
-
let n =
|
|
2739
|
+
let n = m(e);
|
|
2805
2740
|
if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
|
|
2806
2741
|
}
|
|
2807
2742
|
}, Tt = function(e, t) {
|
|
2808
|
-
return
|
|
2743
|
+
return Ie ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
|
|
2809
2744
|
}, Et = function(e) {
|
|
2810
|
-
if (!
|
|
2745
|
+
if (!Ie) return;
|
|
2811
2746
|
let t = [e];
|
|
2812
2747
|
for (; t.length > 0;) {
|
|
2813
2748
|
let e = t.pop(), n = se(e);
|
|
2814
|
-
if (n === $.processingInstruction || n === $.comment && J(
|
|
2749
|
+
if (n === $.processingInstruction || n === $.comment && J(ea, e.data)) {
|
|
2815
2750
|
try {
|
|
2816
2751
|
p(e);
|
|
2817
2752
|
} catch {}
|
|
2818
2753
|
continue;
|
|
2819
2754
|
}
|
|
2820
2755
|
if (n === $.element) {
|
|
2821
|
-
let t = e, n =
|
|
2756
|
+
let t = e, n = P(ce(e));
|
|
2822
2757
|
try {
|
|
2823
2758
|
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && Tt("for", n) && t.removeAttribute("for");
|
|
2824
2759
|
} catch {}
|
|
2825
2760
|
}
|
|
2826
|
-
let r =
|
|
2761
|
+
let r = m(e);
|
|
2827
2762
|
if (r) for (let e = r.length - 1; e >= 0; --e) t.push(r[e]);
|
|
2828
2763
|
}
|
|
2829
2764
|
}, Dt = function(e) {
|
|
2830
2765
|
let t = null, r = null;
|
|
2831
|
-
if (
|
|
2766
|
+
if (Be) e = "<remove></remove>" + e;
|
|
2832
2767
|
else {
|
|
2833
|
-
let t =
|
|
2768
|
+
let t = vi(e, /^[\r\n\t ]+/);
|
|
2834
2769
|
r = t && t[0];
|
|
2835
2770
|
}
|
|
2836
|
-
|
|
2837
|
-
let i = g ?
|
|
2838
|
-
if (
|
|
2839
|
-
t = new l().parseFromString(i,
|
|
2771
|
+
ct === "application/xhtml+xml" && et === M && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
2772
|
+
let i = g ? fe(e) : e;
|
|
2773
|
+
if (et === M) try {
|
|
2774
|
+
t = new l().parseFromString(i, ct);
|
|
2840
2775
|
} catch {}
|
|
2841
2776
|
if (!t || !t.documentElement) {
|
|
2842
|
-
t =
|
|
2777
|
+
t = y.createDocument(et, "template", null);
|
|
2843
2778
|
try {
|
|
2844
|
-
t.documentElement.innerHTML =
|
|
2779
|
+
t.documentElement.innerHTML = N ? _ : i;
|
|
2845
2780
|
} catch {}
|
|
2846
2781
|
}
|
|
2847
2782
|
let a = t.body || t.documentElement;
|
|
2848
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null),
|
|
2783
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), et === M ? ve.call(t, Le ? "html" : "body")[0] : Le ? t.documentElement : a;
|
|
2849
2784
|
}, Ot = function(e) {
|
|
2850
2785
|
let t = oe ? oe(e) : e.ownerDocument;
|
|
2851
|
-
return
|
|
2786
|
+
return ge.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
|
|
2852
2787
|
}, kt = function(e) {
|
|
2853
|
-
return e =
|
|
2788
|
+
return e = yi(e, be, " "), e = yi(e, xe, " "), e = yi(e, Se, " "), e;
|
|
2854
2789
|
}, At = function(e) {
|
|
2855
2790
|
e.normalize();
|
|
2856
|
-
let t = oe ? oe(e) : e.ownerDocument, n =
|
|
2791
|
+
let t = oe ? oe(e) : e.ownerDocument, n = ge.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
|
|
2857
2792
|
for (; r;) r.data = kt(r.data), r = n.nextNode();
|
|
2858
2793
|
let i = e.querySelectorAll?.call(e, "template");
|
|
2859
|
-
i &&
|
|
2794
|
+
i && ui(i, (e) => {
|
|
2860
2795
|
Mt(e.content) && At(e.content);
|
|
2861
2796
|
});
|
|
2862
2797
|
}, jt = function(e) {
|
|
2863
2798
|
let t = ae ? ae(e) : null;
|
|
2864
|
-
return typeof t != "string" ||
|
|
2799
|
+
return typeof t != "string" || P(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== h(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 !== ie(e) || e.childNodes !== m(e);
|
|
2865
2800
|
}, Mt = function(e) {
|
|
2866
|
-
if (!
|
|
2801
|
+
if (!ie || typeof e != "object" || !e) return !1;
|
|
2867
2802
|
try {
|
|
2868
|
-
return
|
|
2803
|
+
return ie(e) === $.documentFragment;
|
|
2869
2804
|
} catch {
|
|
2870
2805
|
return !1;
|
|
2871
2806
|
}
|
|
2872
2807
|
}, Nt = function(e) {
|
|
2873
|
-
if (!
|
|
2808
|
+
if (!ie || typeof e != "object" || !e) return !1;
|
|
2874
2809
|
try {
|
|
2875
|
-
return typeof
|
|
2810
|
+
return typeof ie(e) == "number";
|
|
2876
2811
|
} catch {
|
|
2877
2812
|
return !1;
|
|
2878
2813
|
}
|
|
2879
2814
|
};
|
|
2880
2815
|
function I(e, n, r) {
|
|
2881
|
-
e.length !== 0 &&
|
|
2882
|
-
e.call(t, n, r,
|
|
2816
|
+
e.length !== 0 && ui(e, (e) => {
|
|
2817
|
+
e.call(t, n, r, ut);
|
|
2883
2818
|
});
|
|
2884
2819
|
}
|
|
2885
2820
|
let Pt = function(e, t) {
|
|
2886
|
-
return !!(
|
|
2821
|
+
return !!(Ie && e.hasChildNodes() && !Nt(e.firstElementChild) && J($i, e.textContent) && J($i, e.innerHTML) || Ie && e.namespaceURI === M && ia[t] && (Nt(e.firstElementChild) || typeof e.textContent == "string" && J(aa[t], e.textContent)) || e.nodeType === $.processingInstruction || Ie && e.nodeType === $.comment && J(ea, e.data));
|
|
2887
2822
|
}, Ft = function(e, t) {
|
|
2888
2823
|
return e instanceof RegExp ? J(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
|
|
2889
2824
|
}, It = function(e, t, n) {
|
|
2890
|
-
if (!
|
|
2891
|
-
if (
|
|
2892
|
-
let t =
|
|
2825
|
+
if (!Ae[t] && Ht(t) && Ft(w.tagNameCheck, t)) return !1;
|
|
2826
|
+
if (A && !qe[t]) {
|
|
2827
|
+
let t = ne(e), r = m(e);
|
|
2893
2828
|
if (r && t) {
|
|
2894
2829
|
let i = r.length;
|
|
2895
2830
|
for (let a = i - 1; a >= 0; --a) {
|
|
@@ -2898,34 +2833,34 @@ function _a() {
|
|
|
2898
2833
|
}
|
|
2899
2834
|
}
|
|
2900
2835
|
}
|
|
2901
|
-
return
|
|
2836
|
+
return F(e), !0;
|
|
2902
2837
|
}, Lt = function(e, t, n, r) {
|
|
2903
2838
|
return e.length === 0 ? t : t === n || t === r ? Z(t) : t;
|
|
2904
2839
|
}, Rt = function(e, t) {
|
|
2905
|
-
return e === t ||
|
|
2840
|
+
return e === t || ne(e) !== null ? !1 : (Ge && wt(e), !0);
|
|
2906
2841
|
}, zt = function(e, n) {
|
|
2907
|
-
if (I(
|
|
2908
|
-
if (jt(e)) return
|
|
2909
|
-
let r =
|
|
2910
|
-
if (x = Lt(
|
|
2842
|
+
if (I(b.beforeSanitizeElements, e, null), Rt(e, n)) return !0;
|
|
2843
|
+
if (jt(e)) return F(e), !0;
|
|
2844
|
+
let r = P(ce(e));
|
|
2845
|
+
if (x = Lt(b.uponSanitizeElement, x, ke, Re), I(b.uponSanitizeElement, e, {
|
|
2911
2846
|
tagName: r,
|
|
2912
2847
|
allowedTags: x
|
|
2913
2848
|
}), Rt(e, n)) return !0;
|
|
2914
|
-
if (Pt(e, r)) return
|
|
2915
|
-
if (
|
|
2849
|
+
if (Pt(e, r)) return F(e), !0;
|
|
2850
|
+
if (Ae[r] || !(T.tagCheck instanceof Function && T.tagCheck(r)) && !x[r]) {
|
|
2916
2851
|
let t = It(e, r, n);
|
|
2917
|
-
return t === !1 && (I(
|
|
2852
|
+
return t === !1 && (I(b.afterSanitizeElements, e, null), Rt(e, n)) ? !0 : t;
|
|
2918
2853
|
}
|
|
2919
|
-
if (se(e) === $.element && !
|
|
2854
|
+
if (se(e) === $.element && !yt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(ta, e.innerHTML)) return F(e), !0;
|
|
2920
2855
|
if (E && e.nodeType === $.text) {
|
|
2921
2856
|
let n = kt(e.textContent);
|
|
2922
|
-
e.textContent !== n && (
|
|
2857
|
+
e.textContent !== n && (pi(t.removed, { element: e.cloneNode() }), e.textContent = n);
|
|
2923
2858
|
}
|
|
2924
|
-
return I(
|
|
2859
|
+
return I(b.afterSanitizeElements, e, null), Rt(e, n);
|
|
2925
2860
|
}, Bt = function(e, t, r) {
|
|
2926
|
-
if (
|
|
2927
|
-
let i = S[t] ||
|
|
2928
|
-
return
|
|
2861
|
+
if (je[t] || Tt(t, e) || k && (t === "id" || t === "name") && (r in n || r in dt)) return !1;
|
|
2862
|
+
let i = S[t] || T.attributeCheck instanceof Function && T.attributeCheck(t, e);
|
|
2863
|
+
return Ne && J(Ce, t) || Me && J(we, t) ? !0 : i ? Ze[t] || J(Oe, yi(r, Ee, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && bi(r, "data:") === 0 && Ye[e] || Pe && !J(Te, yi(r, Ee, "")) ? !0 : !r : Ht(e) && Ft(w.tagNameCheck, e) && Ft(w.attributeNameCheck, t, e) || t === "is" && w.allowCustomizedBuiltInElements && Ft(w.tagNameCheck, r);
|
|
2929
2864
|
}, Vt = X({}, [
|
|
2930
2865
|
"annotation-xml",
|
|
2931
2866
|
"color-profile",
|
|
@@ -2936,43 +2871,43 @@ function _a() {
|
|
|
2936
2871
|
"font-face-uri",
|
|
2937
2872
|
"missing-glyph"
|
|
2938
2873
|
]), Ht = function(e) {
|
|
2939
|
-
return !Vt[
|
|
2874
|
+
return !Vt[gi(e)] && J(De, e);
|
|
2940
2875
|
}, Ut = function(e, t, n, r) {
|
|
2941
2876
|
if (g && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
2942
|
-
case "TrustedHTML": return
|
|
2943
|
-
case "TrustedScriptURL": return
|
|
2877
|
+
case "TrustedHTML": return fe(r);
|
|
2878
|
+
case "TrustedScriptURL": return pe(r);
|
|
2944
2879
|
}
|
|
2945
2880
|
return r;
|
|
2946
2881
|
}, Wt = function(e, t, n, r) {
|
|
2947
2882
|
try {
|
|
2948
|
-
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !jt(e) || (
|
|
2883
|
+
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !jt(e) || (F(e), !1);
|
|
2949
2884
|
} catch {
|
|
2950
2885
|
return St(t, e), !1;
|
|
2951
2886
|
}
|
|
2952
2887
|
}, Gt = function(e, n) {
|
|
2953
|
-
if (I(
|
|
2888
|
+
if (I(b.beforeSanitizeAttributes, e, null), Rt(e, n)) return;
|
|
2954
2889
|
let r = e.attributes;
|
|
2955
2890
|
if (!r || jt(e)) return;
|
|
2956
|
-
S = Lt(
|
|
2891
|
+
S = Lt(b.uponSanitizeAttribute, S, C, ze);
|
|
2957
2892
|
let i = {
|
|
2958
2893
|
attrName: "",
|
|
2959
2894
|
attrValue: "",
|
|
2960
2895
|
keepAttr: !0,
|
|
2961
2896
|
allowedAttributes: S,
|
|
2962
2897
|
forceKeepAttr: void 0
|
|
2963
|
-
}, a = r.length, o =
|
|
2898
|
+
}, a = r.length, o = P(e.nodeName);
|
|
2964
2899
|
for (; a--;) {
|
|
2965
|
-
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u =
|
|
2966
|
-
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, I(
|
|
2900
|
+
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = P(s), d = l, f = s === "value" ? d : xi(d), p = !1;
|
|
2901
|
+
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, I(b.uponSanitizeAttribute, e, i), f = i.attrValue, Ue && (u === "id" || u === "name") && bi(f, We) !== 0 && (St(s, e, n), f = We + f, p = !0), Ie && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, f) || u === "attributename" && vi(f, "href") ? St(s, e, n) : i.forceKeepAttr || (i.keepAttr ? !Fe && J(na, f) ? St(s, e, n) : (E && (f = kt(f)), Bt(o, u, f) ? (f = Ut(o, u, c, f), f !== d && Wt(e, s, c, f) && p && fi(t.removed)) : St(s, e, n)) : St(s, e, n));
|
|
2967
2902
|
}
|
|
2968
|
-
I(
|
|
2903
|
+
I(b.afterSanitizeAttributes, e, null), Rt(e, n);
|
|
2969
2904
|
}, Kt = function(e) {
|
|
2970
2905
|
let t = null, n = Ot(e);
|
|
2971
|
-
for (I(
|
|
2906
|
+
for (I(b.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (I(b.uponSanitizeShadowNode, t, null), zt(t, e), Gt(t, e), Mt(t.content) && Kt(t.content), se(t) === $.element) {
|
|
2972
2907
|
let e = re(t);
|
|
2973
2908
|
Mt(e) && (qt(e), Kt(e));
|
|
2974
2909
|
}
|
|
2975
|
-
I(
|
|
2910
|
+
I(b.afterSanitizeShadowDOM, e, null);
|
|
2976
2911
|
}, qt = function(e) {
|
|
2977
2912
|
let t = [{
|
|
2978
2913
|
node: e,
|
|
@@ -2984,14 +2919,14 @@ function _a() {
|
|
|
2984
2919
|
Kt(e.shadow);
|
|
2985
2920
|
continue;
|
|
2986
2921
|
}
|
|
2987
|
-
let n = e.node, r = se(n) === $.element, i =
|
|
2922
|
+
let n = e.node, r = se(n) === $.element, i = m(n);
|
|
2988
2923
|
if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
|
|
2989
2924
|
node: i[e],
|
|
2990
2925
|
shadow: null
|
|
2991
2926
|
});
|
|
2992
2927
|
if (r) {
|
|
2993
2928
|
let e = ae ? ae(n) : null;
|
|
2994
|
-
if (typeof e == "string" &&
|
|
2929
|
+
if (typeof e == "string" && P(e) === "template") {
|
|
2995
2930
|
let e = n.content;
|
|
2996
2931
|
Mt(e) && t.push({
|
|
2997
2932
|
node: e,
|
|
@@ -3013,18 +2948,18 @@ function _a() {
|
|
|
3013
2948
|
};
|
|
3014
2949
|
return t.sanitize = function(e) {
|
|
3015
2950
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
|
|
3016
|
-
if (
|
|
2951
|
+
if (N = !e, N && (e = "<!-->"), typeof e != "string" && !Nt(e) && (e = Ai(e), typeof e != "string")) throw Di("dirty is not a string, aborting");
|
|
3017
2952
|
if (!t.isSupported) return e;
|
|
3018
|
-
|
|
3019
|
-
let c =
|
|
2953
|
+
D ? (x = Re, S = ze) : pt(n), (b.uponSanitizeElement.length > 0 || b.uponSanitizeAttribute.length > 0) && (x = Z(x)), b.uponSanitizeAttribute.length > 0 && (S = Z(S)), t.removed = [];
|
|
2954
|
+
let c = Ge && typeof e != "string" && Nt(e);
|
|
3020
2955
|
if (c) {
|
|
3021
2956
|
Et(e);
|
|
3022
2957
|
let t = ce(e);
|
|
3023
2958
|
if (typeof t == "string") {
|
|
3024
|
-
let n =
|
|
3025
|
-
if (!x[n] ||
|
|
2959
|
+
let n = P(t);
|
|
2960
|
+
if (!x[n] || Ae[n]) throw xt(e), Di("root node is forbidden and cannot be sanitized in-place");
|
|
3026
2961
|
}
|
|
3027
|
-
if (jt(e)) throw xt(e),
|
|
2962
|
+
if (jt(e)) throw xt(e), Di("root node is clobbered and cannot be sanitized in-place");
|
|
3028
2963
|
try {
|
|
3029
2964
|
qt(e);
|
|
3030
2965
|
} catch (t) {
|
|
@@ -3032,79 +2967,147 @@ function _a() {
|
|
|
3032
2967
|
}
|
|
3033
2968
|
} else if (Nt(e)) i = Dt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === $.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), qt(i);
|
|
3034
2969
|
else {
|
|
3035
|
-
if (!
|
|
3036
|
-
if (i = Dt(e), !i) return
|
|
2970
|
+
if (!Ve && !E && !Le && e.indexOf("<") === -1) return g && O ? fe(e) : e;
|
|
2971
|
+
if (i = Dt(e), !i) return Ve ? null : O ? _ : "";
|
|
3037
2972
|
}
|
|
3038
|
-
i &&
|
|
2973
|
+
i && Be && F(i.firstChild);
|
|
3039
2974
|
let l = c ? e : i;
|
|
3040
2975
|
try {
|
|
3041
2976
|
let e = Ot(l);
|
|
3042
2977
|
for (; o = e.nextNode();) zt(o, l), Gt(o, l), Mt(o.content) && Kt(o.content);
|
|
3043
2978
|
} catch (n) {
|
|
3044
|
-
throw c && (xt(e),
|
|
2979
|
+
throw c && (xt(e), ui(t.removed, (e) => {
|
|
3045
2980
|
e.element && wt(e.element);
|
|
3046
2981
|
})), n;
|
|
3047
2982
|
}
|
|
3048
2983
|
if (c) {
|
|
3049
2984
|
let n = !1;
|
|
3050
|
-
if (
|
|
2985
|
+
if (ui(t.removed, (t) => {
|
|
3051
2986
|
t.element && (t.element === e && (n = !0), wt(t.element));
|
|
3052
|
-
}), n) throw
|
|
2987
|
+
}), n) throw Di("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
3053
2988
|
return E && At(e), e;
|
|
3054
2989
|
}
|
|
3055
|
-
if (
|
|
3056
|
-
if (E && At(i),
|
|
2990
|
+
if (Ve) {
|
|
2991
|
+
if (E && At(i), He) for (s = _e.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
|
|
3057
2992
|
else s = i;
|
|
3058
|
-
return (S.shadowroot || S.shadowrootmode) && (s =
|
|
2993
|
+
return (S.shadowroot || S.shadowrootmode) && (s = ye.call(r, s, !0)), s;
|
|
3059
2994
|
}
|
|
3060
|
-
let u =
|
|
3061
|
-
return
|
|
2995
|
+
let u = Le ? i.outerHTML : i.innerHTML;
|
|
2996
|
+
return Le && x["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(Zi, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), E && (u = kt(u)), g && O ? fe(u) : u;
|
|
3062
2997
|
}, t.setConfig = function() {
|
|
3063
2998
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3064
|
-
|
|
2999
|
+
pt(e), D = !0, Re = x, ze = S;
|
|
3065
3000
|
}, t.clearConfig = function() {
|
|
3066
|
-
|
|
3001
|
+
ut = null, D = !1, Re = null, ze = null, g = le, _ = "";
|
|
3067
3002
|
}, t.isValidAttribute = function(e, t, n) {
|
|
3068
|
-
|
|
3069
|
-
let r =
|
|
3003
|
+
ut || pt({});
|
|
3004
|
+
let r = P(e), i = P(t);
|
|
3070
3005
|
return Bt(r, i, n);
|
|
3071
3006
|
}, t.addHook = function(e, t) {
|
|
3072
|
-
typeof t == "function" && q(
|
|
3007
|
+
typeof t == "function" && q(b, e) && pi(b[e], t);
|
|
3073
3008
|
}, t.removeHook = function(e, t) {
|
|
3074
|
-
if (q(
|
|
3009
|
+
if (q(b, e)) {
|
|
3075
3010
|
if (t !== void 0) {
|
|
3076
|
-
let n =
|
|
3077
|
-
return n === -1 ? void 0 :
|
|
3011
|
+
let n = di(b[e], t);
|
|
3012
|
+
return n === -1 ? void 0 : mi(b[e], n, 1)[0];
|
|
3078
3013
|
}
|
|
3079
|
-
return
|
|
3014
|
+
return fi(b[e]);
|
|
3080
3015
|
}
|
|
3081
3016
|
}, t.removeHooks = function(e) {
|
|
3082
|
-
q(
|
|
3017
|
+
q(b, e) && (b[e] = []);
|
|
3083
3018
|
}, t.removeAllHooks = function() {
|
|
3084
|
-
|
|
3019
|
+
b = ca();
|
|
3085
3020
|
}, t;
|
|
3086
3021
|
}
|
|
3087
|
-
var
|
|
3022
|
+
var fa = da();
|
|
3088
3023
|
//#endregion
|
|
3089
3024
|
//#region ../../packages/components/src/chat/markdownHtml.ts
|
|
3090
|
-
function
|
|
3025
|
+
function pa(e) {
|
|
3091
3026
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
3092
3027
|
}
|
|
3093
|
-
function
|
|
3028
|
+
function ma(e, t) {
|
|
3094
3029
|
return `<span class="katex-pending" data-katex="${encodeURIComponent(e)}" data-display="${t}"></span>`;
|
|
3095
3030
|
}
|
|
3096
|
-
var
|
|
3031
|
+
var ha = {
|
|
3097
3032
|
ADD_ATTR: ["target"],
|
|
3098
3033
|
ALLOW_UNKNOWN_PROTOCOLS: !0,
|
|
3099
|
-
FORBID_TAGS: [
|
|
3100
|
-
|
|
3034
|
+
FORBID_TAGS: [
|
|
3035
|
+
"style",
|
|
3036
|
+
"form",
|
|
3037
|
+
"audio",
|
|
3038
|
+
"video",
|
|
3039
|
+
"source",
|
|
3040
|
+
"picture",
|
|
3041
|
+
"track",
|
|
3042
|
+
"image",
|
|
3043
|
+
"feImage"
|
|
3044
|
+
],
|
|
3045
|
+
FORBID_ATTR: [
|
|
3046
|
+
"style",
|
|
3047
|
+
"srcset",
|
|
3048
|
+
"poster",
|
|
3049
|
+
"background"
|
|
3050
|
+
]
|
|
3101
3051
|
};
|
|
3102
|
-
|
|
3103
|
-
|
|
3052
|
+
fa.addHook("uponSanitizeAttribute", (e, t) => {
|
|
3053
|
+
t.attrName === "src" && e.nodeName !== "IMG" && (t.keepAttr = !1);
|
|
3054
|
+
});
|
|
3055
|
+
var ga = "data-held-src";
|
|
3056
|
+
function _a(e, t) {
|
|
3057
|
+
if (!t) return fa.sanitize(e, ha);
|
|
3058
|
+
let n = fa.sanitize(e, {
|
|
3059
|
+
...ha,
|
|
3060
|
+
RETURN_DOM_FRAGMENT: !0
|
|
3061
|
+
});
|
|
3062
|
+
for (let e of Array.from(n.querySelectorAll("img"))) {
|
|
3063
|
+
let n = e.getAttribute("src") ?? "";
|
|
3064
|
+
if (t.canLoad(n)) continue;
|
|
3065
|
+
let r = e.ownerDocument.createElement("button");
|
|
3066
|
+
r.type = "button", r.className = "markdown-held-image", r.setAttribute(ga, n), r.textContent = t.label(t.hostOf(n) ?? n), e.replaceWith(r);
|
|
3067
|
+
}
|
|
3068
|
+
let r = n.ownerDocument.createElement("div");
|
|
3069
|
+
return r.append(n), r.innerHTML;
|
|
3070
|
+
}
|
|
3071
|
+
//#endregion
|
|
3072
|
+
//#region ../../packages/components/src/chat/chatImagePolicy.ts
|
|
3073
|
+
var va = Symbol("ChatImagePolicy");
|
|
3074
|
+
function ya(t, n) {
|
|
3075
|
+
te(va, s(() => ({
|
|
3076
|
+
hosts: (t() ?? []).map(e),
|
|
3077
|
+
platformOrigins: [r(n())].filter((e) => !!e)
|
|
3078
|
+
})));
|
|
3079
|
+
}
|
|
3080
|
+
function ba(e, t) {
|
|
3081
|
+
try {
|
|
3082
|
+
return new URL(e, t).hostname || void 0;
|
|
3083
|
+
} catch {
|
|
3084
|
+
return;
|
|
3085
|
+
}
|
|
3086
|
+
}
|
|
3087
|
+
var xa = /^\/api\/v1\/(?:public\/medias\/[^/]+|[^/]+\/agents\/[^/]+\/chats\/[^/]+\/media\/[^/]+\/(?:view|download))$/;
|
|
3088
|
+
function Sa(e, t, n) {
|
|
3089
|
+
let r;
|
|
3090
|
+
try {
|
|
3091
|
+
r = new URL(e, n);
|
|
3092
|
+
} catch {
|
|
3093
|
+
return !1;
|
|
3094
|
+
}
|
|
3095
|
+
return r.protocol === "data:" || r.protocol === "blob:" ? !0 : t.platformOrigins.includes(r.origin) ? xa.test(r.pathname) : r.protocol === "https:" && t.hosts.includes(r.hostname);
|
|
3096
|
+
}
|
|
3097
|
+
function Ca() {
|
|
3098
|
+
let e = u(va, void 0), t = a(), n = m(/* @__PURE__ */ new Set()), r = () => typeof window > "u" ? "https://localhost/" : window.location.href, i = (e) => t.resolve(e).value.url ?? e;
|
|
3099
|
+
return {
|
|
3100
|
+
isGated: s(() => !!e),
|
|
3101
|
+
canLoad: (t) => !t || !e || n.value.has(t) || Sa(i(t), e.value, r()),
|
|
3102
|
+
release: (e) => {
|
|
3103
|
+
n.value = new Set(n.value).add(e);
|
|
3104
|
+
},
|
|
3105
|
+
hostOf: (e) => ba(i(e), r())
|
|
3106
|
+
};
|
|
3104
3107
|
}
|
|
3105
3108
|
//#endregion
|
|
3106
3109
|
//#region ../../packages/components/src/chat/PkStreamingMarkdown.vue?vue&type=script&setup=true&lang.ts
|
|
3107
|
-
var
|
|
3110
|
+
var wa = ["innerHTML"], Ta = 100, Ea = /* @__PURE__ */ l({
|
|
3108
3111
|
__name: "PkStreamingMarkdown",
|
|
3109
3112
|
props: {
|
|
3110
3113
|
markdown: { default: "" },
|
|
@@ -3120,16 +3123,16 @@ var Ca = ["innerHTML"], wa = 100, Ta = /* @__PURE__ */ o({
|
|
|
3120
3123
|
},
|
|
3121
3124
|
tailLength: { default: void 0 }
|
|
3122
3125
|
},
|
|
3123
|
-
setup(
|
|
3124
|
-
let
|
|
3126
|
+
setup(e) {
|
|
3127
|
+
let r = e, { t: l } = ie({ useScope: "global" }), u = null;
|
|
3125
3128
|
function te() {
|
|
3126
|
-
return
|
|
3129
|
+
return u ||= import("beautiful-mermaid"), u;
|
|
3127
3130
|
}
|
|
3128
|
-
let
|
|
3129
|
-
function
|
|
3130
|
-
return
|
|
3131
|
+
let m = null;
|
|
3132
|
+
function oe() {
|
|
3133
|
+
return m ||= import("katex").then((e) => e.default), m;
|
|
3131
3134
|
}
|
|
3132
|
-
let
|
|
3135
|
+
let se = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, ce = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
|
|
3133
3136
|
W.use({ extensions: [{
|
|
3134
3137
|
name: "inlineKatex",
|
|
3135
3138
|
level: "inline",
|
|
@@ -3138,7 +3141,7 @@ var Ca = ["innerHTML"], wa = 100, Ta = /* @__PURE__ */ o({
|
|
|
3138
3141
|
if (t !== -1 && (t === 0 || e.charAt(t - 1) === " ")) return t;
|
|
3139
3142
|
},
|
|
3140
3143
|
tokenizer(e) {
|
|
3141
|
-
let t = e.match(
|
|
3144
|
+
let t = e.match(se);
|
|
3142
3145
|
if (t) return {
|
|
3143
3146
|
type: "inlineKatex",
|
|
3144
3147
|
raw: t[0],
|
|
@@ -3147,7 +3150,7 @@ var Ca = ["innerHTML"], wa = 100, Ta = /* @__PURE__ */ o({
|
|
|
3147
3150
|
};
|
|
3148
3151
|
},
|
|
3149
3152
|
renderer(e) {
|
|
3150
|
-
return
|
|
3153
|
+
return ma(e.text, e.displayMode);
|
|
3151
3154
|
}
|
|
3152
3155
|
}, {
|
|
3153
3156
|
name: "blockKatex",
|
|
@@ -3162,7 +3165,7 @@ var Ca = ["innerHTML"], wa = 100, Ta = /* @__PURE__ */ o({
|
|
|
3162
3165
|
};
|
|
3163
3166
|
},
|
|
3164
3167
|
renderer(e) {
|
|
3165
|
-
return
|
|
3168
|
+
return ma(e.text, e.displayMode) + "\n";
|
|
3166
3169
|
}
|
|
3167
3170
|
}] }), W.use({ extensions: [{
|
|
3168
3171
|
name: "thinking",
|
|
@@ -3183,30 +3186,30 @@ var Ca = ["innerHTML"], wa = 100, Ta = /* @__PURE__ */ o({
|
|
|
3183
3186
|
return `<div class="thinking-block">${this.parser.parse(e.tokens ?? [])}</div>`;
|
|
3184
3187
|
}
|
|
3185
3188
|
}] });
|
|
3186
|
-
let
|
|
3187
|
-
|
|
3188
|
-
let a = this.parser.parseInline(
|
|
3189
|
-
if (!o ||
|
|
3190
|
-
let s =
|
|
3191
|
-
return `<a href="${
|
|
3192
|
-
},
|
|
3193
|
-
|
|
3189
|
+
let _ = new W.Renderer(), le = (e) => e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), ue = /^(?:javascript|data|vbscript|file):/i, v = !1, de = (e) => le(e.replace(/^https?:\/\/(?:www\.)?/i, "").replace(/\/$/, "")).replace(/\//g, "/<wbr>");
|
|
3190
|
+
_.link = function({ href: e, title: t, text: n, tokens: r }) {
|
|
3191
|
+
let a = this.parser.parseInline(r), o = (e ?? "").trim().replace(/[\x00-\x1f]/g, "");
|
|
3192
|
+
if (!o || ue.test(o)) return a;
|
|
3193
|
+
let s = v && n === o, c = t || (s ? o : ""), l = c ? ` title="${le(c)}"` : "", u = i(o) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
|
|
3194
|
+
return `<a href="${le(o)}"${l}${u}>${s ? de(o) : a}</a>`;
|
|
3195
|
+
}, _.table = function(e) {
|
|
3196
|
+
v = !0;
|
|
3194
3197
|
try {
|
|
3195
|
-
let t = e.header.map((e) =>
|
|
3198
|
+
let t = e.header.map((e) => le(this.parser.parseInline(e.tokens, this.parser.textRenderer))), n = (e) => `<tr role="row">${e.map((e, n) => {
|
|
3196
3199
|
let r = this.parser.parseInline(e.tokens), i = e.align ? ` align="${e.align}"` : "";
|
|
3197
3200
|
return e.header ? `<th role="columnheader"${i}>${r}</th>` : `<td role="cell" data-label="${t[n] ?? ""}"${i}><span>${r}</span></td>`;
|
|
3198
3201
|
}).join("")}</tr>`, r = e.rows.length ? `<tbody role="rowgroup">${e.rows.map(n).join("")}</tbody>` : "";
|
|
3199
3202
|
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`;
|
|
3200
3203
|
} finally {
|
|
3201
|
-
|
|
3204
|
+
v = !1;
|
|
3202
3205
|
}
|
|
3203
3206
|
};
|
|
3204
3207
|
let fe = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
|
|
3205
|
-
|
|
3206
|
-
function
|
|
3208
|
+
_.code = ({ text: e }) => fe.test(e) ? `<pre class="mermaid">${pa(e)}</pre>` : `<pre><code>${pa(e)}</code></pre>`;
|
|
3209
|
+
function pe(e) {
|
|
3207
3210
|
return e.replace(/\\\[([\s\S]*?)\\\]/g, (e, t) => `$$${t}$$`).replace(/\\\(([\s\S]*?)\\\)/g, (e, t) => `$${t}$`).replace(/^(\d+)\.(?!\s)/gm, "$1\\.");
|
|
3208
3211
|
}
|
|
3209
|
-
function
|
|
3212
|
+
function me(e) {
|
|
3210
3213
|
let t = /* @__PURE__ */ new Set(), n = /^(`{3,}|~{3,})[^\n]*\n([\s\S]*?)\n\1/gm, r;
|
|
3211
3214
|
for (; (r = n.exec(e)) !== null;) for (let e = r.index; e < r.index + r[0].length; e++) t.add(e);
|
|
3212
3215
|
return e.replace(/[{[]([\s\S]*?)[}\]]/g, (e, n, r) => {
|
|
@@ -3218,134 +3221,143 @@ var Ca = ["innerHTML"], wa = 100, Ta = /* @__PURE__ */ o({
|
|
|
3218
3221
|
}
|
|
3219
3222
|
}).replace(/\n{3,}/g, "\n\n");
|
|
3220
3223
|
}
|
|
3221
|
-
let
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
],
|
|
3227
|
-
let e =
|
|
3228
|
-
return
|
|
3224
|
+
let he = [
|
|
3225
|
+
g,
|
|
3226
|
+
me,
|
|
3227
|
+
sn,
|
|
3228
|
+
pe
|
|
3229
|
+
], y = re("container"), ge = ae(ne(r, "markdown"), Ta), _e = s(() => r.tailLength ? o(ge.value, r.tailLength) : ge.value), { resolveText: ve } = a(), ye = ve(_e), b = Ca(), be = s(() => {
|
|
3230
|
+
let e = he.reduce((e, t) => t(e), ye.value);
|
|
3231
|
+
return _a(W.parse(e, {
|
|
3229
3232
|
async: !1,
|
|
3230
3233
|
breaks: !0,
|
|
3231
|
-
renderer:
|
|
3232
|
-
})
|
|
3234
|
+
renderer: _
|
|
3235
|
+
}), b.isGated.value ? {
|
|
3236
|
+
canLoad: b.canLoad,
|
|
3237
|
+
hostOf: b.hostOf,
|
|
3238
|
+
label: (e) => l("label.imageHeld", { host: e })
|
|
3239
|
+
} : void 0);
|
|
3233
3240
|
});
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3241
|
+
function xe(e) {
|
|
3242
|
+
let t = (e.target?.closest?.(`[${ga}]`))?.getAttribute(ga);
|
|
3243
|
+
t && (e.preventDefault(), e.stopPropagation(), b.release(t));
|
|
3244
|
+
}
|
|
3245
|
+
async function Se() {
|
|
3246
|
+
if (r.loading) return;
|
|
3247
|
+
await d();
|
|
3248
|
+
let e = y.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
|
|
3238
3249
|
if (!e?.length) return;
|
|
3239
|
-
let { renderMermaidSVG: t, THEMES: n } = await te(),
|
|
3250
|
+
let { renderMermaidSVG: t, THEMES: n } = await te(), i = r.isDark ? n["github-dark"] : n["github-light"];
|
|
3240
3251
|
for (let n of Array.from(e)) {
|
|
3241
3252
|
if (!n.isConnected) continue;
|
|
3242
3253
|
let e = n.textContent?.trim();
|
|
3243
3254
|
if (e) try {
|
|
3244
|
-
let
|
|
3245
|
-
n.isConnected && (n.dataset.code = e, n.innerHTML =
|
|
3255
|
+
let r = t(e, i);
|
|
3256
|
+
n.isConnected && (n.dataset.code = e, n.innerHTML = r, n.setAttribute("data-rendered", "true"));
|
|
3246
3257
|
} catch {}
|
|
3247
3258
|
}
|
|
3248
3259
|
}
|
|
3249
|
-
async function
|
|
3250
|
-
await
|
|
3251
|
-
let e =
|
|
3260
|
+
async function Ce() {
|
|
3261
|
+
await d();
|
|
3262
|
+
let e = y.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
|
|
3252
3263
|
if (!e?.length) return;
|
|
3253
3264
|
let t = (await import("highlight.js/lib/common")).default;
|
|
3254
3265
|
for (let n of e) t.highlightElement(n), n.setAttribute("data-highlighted", "true");
|
|
3255
3266
|
}
|
|
3256
|
-
async function
|
|
3257
|
-
await
|
|
3258
|
-
let
|
|
3259
|
-
if (!
|
|
3260
|
-
let r = await
|
|
3261
|
-
|
|
3262
|
-
for (let
|
|
3263
|
-
if (!
|
|
3264
|
-
let
|
|
3265
|
-
if (!
|
|
3266
|
-
let n =
|
|
3267
|
+
async function we() {
|
|
3268
|
+
await d();
|
|
3269
|
+
let e = y.value?.querySelectorAll(".katex-pending");
|
|
3270
|
+
if (!e?.length) return;
|
|
3271
|
+
let r = await oe();
|
|
3272
|
+
t("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", n(y.value));
|
|
3273
|
+
for (let t of Array.from(e)) {
|
|
3274
|
+
if (!t.isConnected) continue;
|
|
3275
|
+
let e = t.dataset.katex;
|
|
3276
|
+
if (!e) continue;
|
|
3277
|
+
let n = t.dataset.display === "true";
|
|
3267
3278
|
try {
|
|
3268
|
-
|
|
3279
|
+
t.innerHTML = r.renderToString(decodeURIComponent(e), {
|
|
3269
3280
|
throwOnError: !1,
|
|
3270
3281
|
displayMode: n
|
|
3271
|
-
}),
|
|
3282
|
+
}), t.classList.remove("katex-pending");
|
|
3272
3283
|
} catch {}
|
|
3273
3284
|
}
|
|
3274
3285
|
}
|
|
3275
|
-
async function
|
|
3276
|
-
await
|
|
3277
|
-
let e =
|
|
3286
|
+
async function Te() {
|
|
3287
|
+
await d();
|
|
3288
|
+
let e = y.value?.querySelectorAll("pre.mermaid[data-rendered]");
|
|
3278
3289
|
if (!e?.length) return;
|
|
3279
|
-
let { renderMermaidSVG: t, THEMES: n } = await te(),
|
|
3290
|
+
let { renderMermaidSVG: t, THEMES: n } = await te(), i = r.isDark ? n["github-dark"] : n["github-light"];
|
|
3280
3291
|
for (let n of Array.from(e)) {
|
|
3281
3292
|
if (!n.isConnected) continue;
|
|
3282
3293
|
let e = n.dataset.code;
|
|
3283
3294
|
if (e) try {
|
|
3284
|
-
n.innerHTML = t(e,
|
|
3295
|
+
n.innerHTML = t(e, i);
|
|
3285
3296
|
} catch {}
|
|
3286
3297
|
}
|
|
3287
3298
|
}
|
|
3288
|
-
function
|
|
3299
|
+
function Ee(e) {
|
|
3289
3300
|
let t = e.target;
|
|
3290
3301
|
if (!(t instanceof HTMLImageElement) || t.dataset.broken) return;
|
|
3291
3302
|
t.dataset.broken = "true";
|
|
3292
3303
|
let n = document.createElement("span");
|
|
3293
|
-
n.className = "markdown-broken-image", n.textContent = t.alt ||
|
|
3294
|
-
}
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
}),
|
|
3298
|
-
|
|
3299
|
-
}),
|
|
3300
|
-
let
|
|
3301
|
-
function
|
|
3304
|
+
n.className = "markdown-broken-image", n.textContent = t.alt || l("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
|
|
3305
|
+
}
|
|
3306
|
+
p(() => {
|
|
3307
|
+
y.value?.addEventListener("error", Ee, !0);
|
|
3308
|
+
}), f(() => {
|
|
3309
|
+
y.value?.removeEventListener("error", Ee, !0);
|
|
3310
|
+
}), h([be, () => r.loading], Se, { immediate: !0 }), h(() => r.isDark, Te), h(be, Ce, { immediate: !0 }), h(be, we, { immediate: !0 });
|
|
3311
|
+
let De = 0;
|
|
3312
|
+
function Oe(e, t) {
|
|
3302
3313
|
let n = document.createElement("span");
|
|
3303
|
-
return n.style.cssText = `animation:ft-${
|
|
3314
|
+
return n.style.cssText = `animation:ft-${r.animation} ${r.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
|
|
3304
3315
|
let t = n.parentNode;
|
|
3305
3316
|
t && (t.replaceChild(document.createTextNode(e), n), t.normalize());
|
|
3306
3317
|
}, { once: !0 }), n;
|
|
3307
3318
|
}
|
|
3308
|
-
function
|
|
3319
|
+
function x(e, t, n, r) {
|
|
3309
3320
|
let i = r, a = e.split(/(\s+)/);
|
|
3310
|
-
for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(
|
|
3321
|
+
for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(Oe(e, i * 30), n), i++));
|
|
3311
3322
|
return i;
|
|
3312
3323
|
}
|
|
3313
|
-
function
|
|
3324
|
+
function ke(e) {
|
|
3314
3325
|
let t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode(e) {
|
|
3315
3326
|
return e.parentElement?.closest("pre, code, .katex-pending, .markdown-broken-image") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
3316
3327
|
} }), n = [];
|
|
3317
3328
|
for (; t.nextNode();) n.push(t.currentNode);
|
|
3318
3329
|
return n;
|
|
3319
3330
|
}
|
|
3320
|
-
function
|
|
3321
|
-
if (!
|
|
3322
|
-
let e =
|
|
3331
|
+
function S() {
|
|
3332
|
+
if (!y.value || !r.loading || !r.animation) return;
|
|
3333
|
+
let e = ke(y.value), t = 0, n = 0;
|
|
3323
3334
|
for (let r of e) {
|
|
3324
3335
|
let e = r.textContent || "", i = t, a = t + e.length;
|
|
3325
|
-
if (t = a, a <=
|
|
3336
|
+
if (t = a, a <= De) continue;
|
|
3326
3337
|
let o = r.parentNode;
|
|
3327
3338
|
if (!o) continue;
|
|
3328
|
-
if (i >=
|
|
3339
|
+
if (i >= De) {
|
|
3329
3340
|
let t = r.nextSibling;
|
|
3330
|
-
o.removeChild(r), n =
|
|
3341
|
+
o.removeChild(r), n = x(e, o, t, n);
|
|
3331
3342
|
continue;
|
|
3332
3343
|
}
|
|
3333
|
-
let s =
|
|
3334
|
-
o.removeChild(c), n =
|
|
3344
|
+
let s = De - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
|
|
3345
|
+
o.removeChild(c), n = x(l, o, u, n);
|
|
3335
3346
|
}
|
|
3336
|
-
|
|
3347
|
+
De = t;
|
|
3337
3348
|
}
|
|
3338
|
-
return
|
|
3339
|
-
await
|
|
3340
|
-
}, { immediate: !0 }),
|
|
3341
|
-
(!e || t && e.length < t.length) && (
|
|
3342
|
-
}), (e, t) => (
|
|
3349
|
+
return h(be, async () => {
|
|
3350
|
+
await d(), S();
|
|
3351
|
+
}, { immediate: !0 }), h(() => r.markdown, (e, t) => {
|
|
3352
|
+
(!e || t && e.length < t.length) && (De = 0);
|
|
3353
|
+
}), (e, t) => (ee(), c("div", {
|
|
3343
3354
|
ref: "container",
|
|
3344
|
-
|
|
3345
|
-
|
|
3355
|
+
onClick: xe,
|
|
3356
|
+
innerHTML: be.value
|
|
3357
|
+
}, null, 8, wa));
|
|
3346
3358
|
}
|
|
3347
3359
|
});
|
|
3348
3360
|
//#endregion
|
|
3349
|
-
export {
|
|
3361
|
+
export { ya as n, Ca as r, Ea as t };
|
|
3350
3362
|
|
|
3351
|
-
//# sourceMappingURL=PkStreamingMarkdown-
|
|
3363
|
+
//# sourceMappingURL=PkStreamingMarkdown-XJBXdSG2.js.map
|