@8wave/ai-elements 0.115.0-beta.47 → 0.115.0-beta.52
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/README.md +1 -0
- package/dist/_chunks/{Agent-D3cVY0pk.js → Agent-CJbRpoZG.js} +38 -38
- package/dist/_chunks/Agent-CJbRpoZG.js.map +1 -0
- package/dist/_chunks/PkChatbotFilePreview-DcqwX9nI.js +256 -0
- package/dist/_chunks/PkChatbotFilePreview-DcqwX9nI.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-DyvZ5xKK.js → PkStreamingMarkdown-B_qmgO9_.js} +728 -713
- package/dist/_chunks/PkStreamingMarkdown-B_qmgO9_.js.map +1 -0
- package/dist/_chunks/PkToolEditSpreadsheet-BSxYLcys.js +41 -0
- package/dist/_chunks/PkToolEditSpreadsheet-BSxYLcys.js.map +1 -0
- package/dist/_chunks/{PkToolRequestGeolocation-DjRmmYMk.js → PkToolRequestGeolocation-YW0ilIxN.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-DjRmmYMk.js.map → PkToolRequestGeolocation-YW0ilIxN.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-CJ8dg2RY.js → PkToolRequestOAuthConnection-Cx4aFL5g.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-CJ8dg2RY.js.map → PkToolRequestOAuthConnection-Cx4aFL5g.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-Bk-xmGxl.js → PkToolShowArtifact-Bgj02cPe.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-Bk-xmGxl.js.map → PkToolShowArtifact-Bgj02cPe.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-B0o6CY0Q.js → PkToolShowContactForm-Die8UpNv.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-B0o6CY0Q.js.map → PkToolShowContactForm-Die8UpNv.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-C4-KAKPL.js → PkToolShowForm-Dmq95u6b.js} +5 -5
- package/dist/_chunks/{PkToolShowForm-C4-KAKPL.js.map → PkToolShowForm-Dmq95u6b.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-Jdo7p2mZ.js → PkToolShowImageGallery-CKuyTxih.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-Jdo7p2mZ.js.map → PkToolShowImageGallery-CKuyTxih.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-Cfk865KB.js → PkToolShowProductList-DjS9nvXe.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-Cfk865KB.js.map → PkToolShowProductList-DjS9nvXe.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-qqUbdWzN.js → PkToolShowSources-MJRFeqMA.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-qqUbdWzN.js.map → PkToolShowSources-MJRFeqMA.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-Dk6Nu9cG.js → PkToolShowSuggestedReply-DPVS3C74.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-Dk6Nu9cG.js.map → PkToolShowSuggestedReply-DPVS3C74.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-D07i4hVd.js → PkToolShowVideo-DnvvRE7H.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-D07i4hVd.js.map → PkToolShowVideo-DnvvRE7H.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-ksXRNsDK.js → PkToolShowWebPages-CYbiGa7e.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-ksXRNsDK.js.map → PkToolShowWebPages-CYbiGa7e.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-B1iRRLAB.js → chatImagePolicy-C5eH4Cpq.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-B1iRRLAB.js.map → chatImagePolicy-C5eH4Cpq.js.map} +1 -1
- package/dist/_chunks/{markdown-DOitQ2jz.js → markdown-qIVVfGoX.js} +135 -62
- package/dist/_chunks/markdown-qIVVfGoX.js.map +1 -0
- package/dist/ai-elements.es.js +2706 -2872
- 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/PkChatbotFilePreview.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-C4p46YGt.js → Agent---jwXeaB.js} +69 -69
- package/dist-vue/_chunks/Agent---jwXeaB.js.map +1 -0
- package/dist-vue/_chunks/{Document-B9QaYHKT.js → Document-DmBTgjd4.js} +157 -84
- package/dist-vue/_chunks/Document-DmBTgjd4.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbot-BkMe7zxp.js → PkChatbot-W9tO1H9i.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-BkMe7zxp.js.map → PkChatbot-W9tO1H9i.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-HElKT2OO.js → PkChatbotEmptyState-BY3f3T0T.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-HElKT2OO.js.map → PkChatbotEmptyState-BY3f3T0T.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFilePreview-CwiVQDF2.js → PkChatbotFilePreview-Dq9JBX9U.js} +5 -3
- package/dist-vue/_chunks/PkChatbotFilePreview-Dq9JBX9U.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotInput-BykvFqbm.js → PkChatbotInput-C5l6QDQY.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotInput-BykvFqbm.js.map → PkChatbotInput-C5l6QDQY.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-3RZER9PO.js +769 -0
- package/dist-vue/_chunks/PkChatbotMessages-3RZER9PO.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-DY0AzM6s.js → PkChatbotStepPayload-C-xnhmzZ.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-DY0AzM6s.js.map → PkChatbotStepPayload-C-xnhmzZ.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-AXtXQVQY.js → PkChatbotStepToolDetail-Cko1vU0N.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-AXtXQVQY.js.map → PkChatbotStepToolDetail-Cko1vU0N.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotSteps-BkZ3Kq2M.js +191 -0
- package/dist-vue/_chunks/{PkChatbotSteps-B-yrfTat.js.map → PkChatbotSteps-BkZ3Kq2M.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotViewChat-BFImSy1X.js +789 -0
- package/dist-vue/_chunks/PkChatbotViewChat-BFImSy1X.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-C9h_bBIc.js → PkChatbotViewConversations-C6T4ZxxX.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-C9h_bBIc.js.map → PkChatbotViewConversations-C6T4ZxxX.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotViewFiles-CMQdbZN6.js +125 -0
- package/dist-vue/_chunks/PkChatbotViewFiles-CMQdbZN6.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewProfile-CFR0B99Z.js → PkChatbotViewProfile-CDCy1LEX.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-CFR0B99Z.js.map → PkChatbotViewProfile-CDCy1LEX.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-XJBXdSG2.js → PkStreamingMarkdown-DJG-aPx2.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-XJBXdSG2.js.map → PkStreamingMarkdown-DJG-aPx2.js.map} +1 -1
- package/dist-vue/_chunks/{PkSvgViewer-D-0M5bqg.js → PkSvgViewer-D1y8hZRW.js} +2 -2
- package/dist-vue/_chunks/{PkSvgViewer-D-0M5bqg.js.map → PkSvgViewer-D1y8hZRW.js.map} +1 -1
- package/dist-vue/_chunks/PkToolEditSpreadsheet-BHh7NUdR.js +40 -0
- package/dist-vue/_chunks/PkToolEditSpreadsheet-BHh7NUdR.js.map +1 -0
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DpvsFEga.js → PkToolRequestGeolocation-Ccbhljmn.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DpvsFEga.js.map → PkToolRequestGeolocation-Ccbhljmn.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DRefs-S1.js → PkToolRequestOAuthConnection-BXf5ZRzR.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DRefs-S1.js.map → PkToolRequestOAuthConnection-BXf5ZRzR.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-BopCMkyZ.js → PkToolShowArtifact-BsfbvfVC.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-BopCMkyZ.js.map → PkToolShowArtifact-BsfbvfVC.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-C6F_DdBu.js → PkToolShowContactForm-C-YbtBlG.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-C6F_DdBu.js.map → PkToolShowContactForm-C-YbtBlG.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-7-m7VrED.js → PkToolShowDiagram-CIHVrQ3e.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowDiagram-7-m7VrED.js.map → PkToolShowDiagram-CIHVrQ3e.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-DEr8wDJi.js → PkToolShowForm-BwYJhEVO.js} +6 -6
- package/dist-vue/_chunks/{PkToolShowForm-DEr8wDJi.js.map → PkToolShowForm-BwYJhEVO.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-D44wf_u3.js → PkToolShowImageGallery-1A9zyOVn.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowImageGallery-D44wf_u3.js.map → PkToolShowImageGallery-1A9zyOVn.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-C6CVRUlD.js → PkToolShowProductList-D61i6AMs.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-C6CVRUlD.js.map → PkToolShowProductList-D61i6AMs.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-DzUNanmK.js → PkToolShowSources-BQpdJE_m.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-DzUNanmK.js.map → PkToolShowSources-BQpdJE_m.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DhNtI5gJ.js → PkToolShowSuggestedReply-D3jLsbKJ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DhNtI5gJ.js.map → PkToolShowSuggestedReply-D3jLsbKJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-HbQzTMh5.js → PkToolShowVideo-DUdkb3qb.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-HbQzTMh5.js.map → PkToolShowVideo-DUdkb3qb.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-Ct1HaCSq.js → PkToolShowWebPages-BeeBiv9R.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-Ct1HaCSq.js.map → PkToolShowWebPages-BeeBiv9R.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-B2PvUG07.js → createChatbotApiClient-CDrs7NwO.js} +22 -18
- package/dist-vue/_chunks/{createChatbotApiClient-B2PvUG07.js.map → createChatbotApiClient-CDrs7NwO.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-Cj_UmNH3.js → useChatbotStore-D6YNk8Rx.js} +6 -4
- package/dist-vue/_chunks/useChatbotStore-D6YNk8Rx.js.map +1 -0
- package/dist-vue/_chunks/utils-roi6YVNC.js +199 -0
- package/dist-vue/_chunks/utils-roi6YVNC.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +67 -11
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +3483 -3472
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +14 -14
- package/dist-vue/packages/components/src/chat/PkChatbotFilePreview.d.ts +5 -0
- package/dist-vue/packages/components/src/chat/PkToolEditSpreadsheet.d.ts +14 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +8 -0
- package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +7 -1
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +12 -0
- package/dist-vue/packages/composable/src/useFileRow.d.ts +21 -0
- package/dist-vue/packages/models/src/schema/Agent.d.ts +14 -0
- package/dist-vue/packages/models/src/schema/Document.d.ts +173 -0
- package/dist-vue/packages/models/src/schema/Tabular.d.ts +181 -0
- package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-D3cVY0pk.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown-DyvZ5xKK.js.map +0 -1
- package/dist/_chunks/markdown-DOitQ2jz.js.map +0 -1
- package/dist-vue/_chunks/Agent-C4p46YGt.js.map +0 -1
- package/dist-vue/_chunks/Document-B9QaYHKT.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotFilePreview-CwiVQDF2.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-wH9wxc6Y.js +0 -769
- package/dist-vue/_chunks/PkChatbotMessages-wH9wxc6Y.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotSteps-B-yrfTat.js +0 -191
- package/dist-vue/_chunks/PkChatbotViewChat-CCcMnVkM.js +0 -784
- package/dist-vue/_chunks/PkChatbotViewChat-CCcMnVkM.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewFiles-BkoXgGE6.js +0 -111
- package/dist-vue/_chunks/PkChatbotViewFiles-BkoXgGE6.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-Cj_UmNH3.js.map +0 -1
- package/dist-vue/_chunks/utils-DXXzMVU3.js +0 -184
- package/dist-vue/_chunks/utils-DXXzMVU3.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { C as e, F as t, J as n, L as r, N as i, O as a, P as o, X as s, _t as c, it as l, m as u, v as d } from "./vue.runtime.esm-bundler-B-NVlZCY.js";
|
|
2
2
|
import { r as f } from "./vue-i18n-BAndfHYX.js";
|
|
3
3
|
import { n as p, t as ee } from "./cdn-css-JUUNhyQ6.js";
|
|
4
|
-
import {
|
|
4
|
+
import { l as te } from "./Agent-CJbRpoZG.js";
|
|
5
5
|
import "./src-CrSt0jv_.js";
|
|
6
6
|
import { n as ne } from "./url-validation-9DstIfq2.js";
|
|
7
7
|
import { v as re } from "./dist-Ce9Hi58x.js";
|
|
8
8
|
import { n as ie } from "./useShortUrlResolver-Ddb9IUei.js";
|
|
9
9
|
import { t as ae } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
10
|
-
import { n as oe } from "./chatImagePolicy-
|
|
10
|
+
import { n as oe } from "./chatImagePolicy-C5eH4Cpq.js";
|
|
11
11
|
//#region ../../packages/utils/src/citations.ts
|
|
12
12
|
var m = /[ \t]*\uE200[^\uE201]*\uE201/g, se = /[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, ce = /[\uE200-\uE20F]/g;
|
|
13
13
|
function le(e) {
|
|
@@ -21,14 +21,14 @@ function h(e) {
|
|
|
21
21
|
function g(e) {
|
|
22
22
|
return e ? e.type.startsWith("tool-") : !1;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function _(e) {
|
|
25
25
|
return g(e) ? e.type.slice(5) : "";
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function ue(e) {
|
|
28
28
|
return e ? e.type === "file" : !1;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
if (!
|
|
30
|
+
function de(e) {
|
|
31
|
+
if (!ue(e)) return;
|
|
32
32
|
let t = e.providerMetadata?.["8bot"]?.media;
|
|
33
33
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
34
34
|
}
|
|
@@ -57,20 +57,29 @@ function me(e) {
|
|
|
57
57
|
}
|
|
58
58
|
return t;
|
|
59
59
|
}
|
|
60
|
-
var he = (e) => g(e) && te(
|
|
60
|
+
var he = (e) => g(e) && te(_(e));
|
|
61
61
|
function ge(e) {
|
|
62
62
|
let t = /* @__PURE__ */ new Map();
|
|
63
|
-
for (let [n, r] of e.entries()) he(r) && r.state !== "output-error" && !
|
|
63
|
+
for (let [n, r] of e.entries()) he(r) && r.state !== "output-error" && !ye(r) && t.set(r.type, n);
|
|
64
64
|
return e.filter((e, n) => !(he(e) && e.state === "output-error" && (t.get(e.type) ?? -1) > n));
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
var v = /* @__PURE__ */ new Set(["tool-editSpreadsheet"]);
|
|
67
|
+
function _e(e) {
|
|
68
|
+
let t = e.filter((e) => v.has(e.type));
|
|
69
|
+
return t.length > 0 ? [...e.filter((e) => !v.has(e.type)), ...t] : e;
|
|
70
|
+
}
|
|
71
|
+
function ve(e, t) {
|
|
72
|
+
let n = e.toolCallId;
|
|
73
|
+
return v.has(e.type) && n ? `file-${n}` : t;
|
|
74
|
+
}
|
|
75
|
+
function ye(e) {
|
|
67
76
|
return e && "state" in e ? e.state === "streaming" || e.state === "input-streaming" : !1;
|
|
68
77
|
}
|
|
69
|
-
var
|
|
70
|
-
function
|
|
78
|
+
var be = 4e3, y = /^[ \t]*(?:(?:[-*+]|\d{1,9}[.)])[ \t]+|>[ \t]?)*(`{3,}|~{3,})(.*)$/gm;
|
|
79
|
+
function xe(e, t) {
|
|
71
80
|
if (e.length <= t) return e;
|
|
72
81
|
let n = e.length - t, r = n + t / 2, i = (e, t) => e !== -1 && e < r ? e + t : void 0, a = i(e.indexOf("\n\n", n), 2) ?? i(e.indexOf("\n", n), 1) ?? n, o;
|
|
73
|
-
for (let t of e.matchAll(
|
|
82
|
+
for (let t of e.matchAll(y)) {
|
|
74
83
|
if (t.index >= a) break;
|
|
75
84
|
let [, e, n] = t;
|
|
76
85
|
if (o) e[0] === o[0] && e.length >= o.length && !n.trim() && (o = void 0);
|
|
@@ -81,40 +90,40 @@ function ye(e, t) {
|
|
|
81
90
|
}
|
|
82
91
|
return `…\n\n${o ? `${o}\n` : ""}${e.slice(a)}`;
|
|
83
92
|
}
|
|
84
|
-
var
|
|
93
|
+
var Se = /* @__PURE__ */ new Set([
|
|
85
94
|
"approval-requested",
|
|
86
95
|
"approval-responded",
|
|
87
96
|
"output-denied"
|
|
88
97
|
]);
|
|
89
|
-
function
|
|
90
|
-
return g(e) ?
|
|
98
|
+
function Ce(e) {
|
|
99
|
+
return g(e) ? Se.has(e.state) ? !0 : e.approval != null : !1;
|
|
91
100
|
}
|
|
92
|
-
var
|
|
93
|
-
function
|
|
101
|
+
var we = "requestConfirm";
|
|
102
|
+
function Te(e) {
|
|
94
103
|
return g(e) && e.type === "tool-requestConfirm";
|
|
95
104
|
}
|
|
96
|
-
function
|
|
97
|
-
return
|
|
105
|
+
function Ee(e) {
|
|
106
|
+
return Ce(e) || Te(e);
|
|
98
107
|
}
|
|
99
|
-
function
|
|
108
|
+
function De(e) {
|
|
100
109
|
if (g(e)) return e.approval?.id;
|
|
101
110
|
}
|
|
102
|
-
function
|
|
111
|
+
function Oe(e) {
|
|
103
112
|
if (e && "state" in e) return e.state;
|
|
104
113
|
}
|
|
105
|
-
function
|
|
114
|
+
function ke(e = "000000") {
|
|
106
115
|
let t = e.replace("#", "");
|
|
107
116
|
t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
|
|
108
117
|
let n = parseInt(t.substring(0, 2), 16) / 255, r = parseInt(t.substring(2, 4), 16) / 255, i = parseInt(t.substring(4, 6), 16) / 255, a = (e) => e <= .03928 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
109
118
|
return .2126 * a(n) + .7152 * a(r) + .0722 * a(i) > .179 ? "black" : "white";
|
|
110
119
|
}
|
|
111
|
-
function
|
|
112
|
-
return e === "white" || e === "black" ? e :
|
|
120
|
+
function b(e, t) {
|
|
121
|
+
return e === "white" || e === "black" ? e : ke(t);
|
|
113
122
|
}
|
|
114
|
-
function
|
|
123
|
+
function Ae(e, t) {
|
|
115
124
|
if (!(t === void 0 || t < 50)) return e(t / 1e3, "seconds");
|
|
116
125
|
}
|
|
117
|
-
function
|
|
126
|
+
function x(e) {
|
|
118
127
|
if (e !== void 0) {
|
|
119
128
|
if (typeof e == "string") return e.trim() || void 0;
|
|
120
129
|
try {
|
|
@@ -125,10 +134,10 @@ function b(e) {
|
|
|
125
134
|
}
|
|
126
135
|
}
|
|
127
136
|
}
|
|
128
|
-
function
|
|
129
|
-
return
|
|
137
|
+
function je(e) {
|
|
138
|
+
return x(e) !== void 0;
|
|
130
139
|
}
|
|
131
|
-
function
|
|
140
|
+
function S(e, t) {
|
|
132
141
|
let n = e?.input;
|
|
133
142
|
if (typeof t == "string") {
|
|
134
143
|
let e = n?.question ?? n?.steps?.[0]?.question;
|
|
@@ -140,14 +149,14 @@ function ke(e, t) {
|
|
|
140
149
|
return i ? `${i} ${n}` : n;
|
|
141
150
|
}).join(". ");
|
|
142
151
|
}
|
|
143
|
-
function
|
|
152
|
+
function Me(e) {
|
|
144
153
|
return e?.options ? e.options.map((e) => ({
|
|
145
154
|
label: e.label,
|
|
146
155
|
value: e.label,
|
|
147
156
|
description: e.description
|
|
148
157
|
})) : [];
|
|
149
158
|
}
|
|
150
|
-
function
|
|
159
|
+
function Ne(e, t) {
|
|
151
160
|
let n = {};
|
|
152
161
|
if (t == null) return n;
|
|
153
162
|
if (typeof t == "string") return e.length === 1 && (n[0] = t), n;
|
|
@@ -168,7 +177,7 @@ var C = [
|
|
|
168
177
|
"tool-parallel_search",
|
|
169
178
|
"tool-web_search",
|
|
170
179
|
"tool-google_search"
|
|
171
|
-
],
|
|
180
|
+
], Pe = /* @__PURE__ */ new Set([
|
|
172
181
|
"tool-searchInKnowledgeBase",
|
|
173
182
|
"tool-retrieveRevisedAnswers",
|
|
174
183
|
"tool-expandChunkContext",
|
|
@@ -179,70 +188,76 @@ var C = [
|
|
|
179
188
|
"tool-saveUserMemory",
|
|
180
189
|
...C
|
|
181
190
|
]);
|
|
182
|
-
function
|
|
183
|
-
return g(e) &&
|
|
191
|
+
function Fe(e) {
|
|
192
|
+
return g(e) && Pe.has(e.type);
|
|
184
193
|
}
|
|
185
|
-
var
|
|
194
|
+
var Ie = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, w = (e, ...t) => {
|
|
186
195
|
for (let n of t) {
|
|
187
196
|
let t = e?.[n];
|
|
188
197
|
if (typeof t == "string" && t.trim()) return t;
|
|
189
198
|
}
|
|
190
199
|
};
|
|
191
|
-
function
|
|
200
|
+
function T(e) {
|
|
192
201
|
if (!g(e)) return;
|
|
193
|
-
let t =
|
|
202
|
+
let t = Ie("input" in e ? e.input : void 0), n = Ie("output" in e ? e.output : void 0);
|
|
194
203
|
if (e.type === "tool-searchInKnowledgeBase" || C.includes(e.type)) {
|
|
195
204
|
let e = t?.queries;
|
|
196
205
|
if (Array.isArray(e)) {
|
|
197
206
|
let t = e.filter((e) => typeof e == "string" && !!e.trim());
|
|
198
207
|
return t.length ? t.join(" · ") : void 0;
|
|
199
208
|
}
|
|
200
|
-
return
|
|
209
|
+
return w(t, "query", "objective");
|
|
201
210
|
}
|
|
202
|
-
if (e.type === "tool-retrieveRevisedAnswers") return
|
|
203
|
-
if (e.type === "tool-getWeather") return
|
|
204
|
-
if (e.type === "tool-geocode") return
|
|
205
|
-
if (e.type === "tool-expandChunkContext") return
|
|
206
|
-
if (e.type === "tool-readDocumentFile") return
|
|
207
|
-
if (e.type === "tool-
|
|
208
|
-
|
|
211
|
+
if (e.type === "tool-retrieveRevisedAnswers") return w(t, "query");
|
|
212
|
+
if (e.type === "tool-getWeather") return w(n, "location") ?? w(t, "locationName");
|
|
213
|
+
if (e.type === "tool-geocode") return w(t, "locationName");
|
|
214
|
+
if (e.type === "tool-expandChunkContext") return w(n, "documentName");
|
|
215
|
+
if (e.type === "tool-readDocumentFile") return w(n, "name");
|
|
216
|
+
if (e.type === "tool-readSpreadsheet") {
|
|
217
|
+
let e = w(t, "sheet"), n = w(t, "range");
|
|
218
|
+
return e && n ? `${e}!${n}` : e;
|
|
219
|
+
}
|
|
220
|
+
if (e.type === "tool-editSpreadsheet") return w(n, "filename");
|
|
221
|
+
if (e.type === "tool-querySpreadsheet") return w(n, "file");
|
|
222
|
+
if (e.type === "tool-recallUserMemory") return w(t, "query");
|
|
223
|
+
if (e.type === "tool-saveUserMemory") return w(t, "content", "query");
|
|
209
224
|
}
|
|
210
|
-
function
|
|
211
|
-
if (g(e)) return e.type.includes("tool-subagent") ? "ri:robot-2-line" : e.type === "tool-runWorker" ? "ri:flow-chart" : e.type === "tool-fetchTeamsChannelHistory" ? "ri:chat-history-line" : e.type === "tool-enableTools" ? "ri:toggle-line" : e.type.includes("tool-mcp") ? "mcp" : e.type === "tool-retrieveRevisedAnswers" ? "ri:file-edit-line" : e.type === "tool-searchInKnowledgeBase" ? "ri:search-line" : e.type === "tool-expandChunkContext" ? "ri:file-search-line" : e.type === "tool-readDocumentFile" ? "ri:file-text-line" : e.type === "tool-geocode" ? "ri:map-2-line" : e.type === "tool-getWeather" ? "ri:sun-cloudy-line" : e.type === "tool-recallUserMemory" ? "ri:brain-line" : e.type === "tool-saveUserMemory" ? "ri:save-3-line" : e.type === "tool-showWeather" ? "ri:sun-line" : e.type === "tool-showDiagram" ? "ri:flow-chart" : e.type === "tool-showSources" ? "ri:book-2-line" : e.type === "tool-showForm" ? "ri:survey-line" : e.type === "tool-showMultipleChoice" ? "ri:checkbox-multiple-line" : e.type === "tool-showArtifact" ? "ri:file-code-line" : e.type === "tool-showEmail" ? "ri:mail-line" : e.type === "tool-showMessage" ? "ri:chat-1-line" : e.type === "tool-showWebPages" ? "ri:pages-line" : e.type === "tool-showProductList" ? "ri:shopping-bag-line" : e.type === "tool-showContactForm" ? "ri:send-plane-2-line" : e.type === "tool-showCalendarEvent" ? "ri:calendar-event-line" : e.type === "tool-showComparison" ? "ri:scales-line" : e.type === "tool-showLocation" ? "ri:map-pin-line" : e.type === "tool-showQrCode" ? "ri:qr-code-line" : e.type === "tool-showImageGallery" ? "ri:image-line" : e.type === "tool-showVideo" ? "ri:film-line" : e.type === "tool-showSuggestedReply" ? "ri:corner-down-right-line" : e.type === "tool-requestGeolocation" ? "ri:map-pin-user-line" : e.type === "tool-disconnectOAuthConnection" ? "ri:link-unlink" : e.type === "tool-perplexity_search" || e.type === "tool-parallel_search" || e.type === "tool-web_search" || e.type === "tool-google_search" ? "ri:global-line" : "ri:tools-line";
|
|
225
|
+
function Le(e) {
|
|
226
|
+
if (g(e)) return e.type.includes("tool-subagent") ? "ri:robot-2-line" : e.type === "tool-runWorker" ? "ri:flow-chart" : e.type === "tool-fetchTeamsChannelHistory" ? "ri:chat-history-line" : e.type === "tool-enableTools" ? "ri:toggle-line" : e.type.includes("tool-mcp") ? "mcp" : e.type === "tool-retrieveRevisedAnswers" ? "ri:file-edit-line" : e.type === "tool-searchInKnowledgeBase" ? "ri:search-line" : e.type === "tool-expandChunkContext" ? "ri:file-search-line" : e.type === "tool-readDocumentFile" ? "ri:file-text-line" : e.type === "tool-readSpreadsheet" ? "ri:table-line" : e.type === "tool-editSpreadsheet" ? "ri:file-excel-2-line" : e.type === "tool-querySpreadsheet" ? "ri:database-2-line" : e.type === "tool-geocode" ? "ri:map-2-line" : e.type === "tool-getWeather" ? "ri:sun-cloudy-line" : e.type === "tool-recallUserMemory" ? "ri:brain-line" : e.type === "tool-saveUserMemory" ? "ri:save-3-line" : e.type === "tool-showWeather" ? "ri:sun-line" : e.type === "tool-showDiagram" ? "ri:flow-chart" : e.type === "tool-showSources" ? "ri:book-2-line" : e.type === "tool-showForm" ? "ri:survey-line" : e.type === "tool-showMultipleChoice" ? "ri:checkbox-multiple-line" : e.type === "tool-showArtifact" ? "ri:file-code-line" : e.type === "tool-showEmail" ? "ri:mail-line" : e.type === "tool-showMessage" ? "ri:chat-1-line" : e.type === "tool-showWebPages" ? "ri:pages-line" : e.type === "tool-showProductList" ? "ri:shopping-bag-line" : e.type === "tool-showContactForm" ? "ri:send-plane-2-line" : e.type === "tool-showCalendarEvent" ? "ri:calendar-event-line" : e.type === "tool-showComparison" ? "ri:scales-line" : e.type === "tool-showLocation" ? "ri:map-pin-line" : e.type === "tool-showQrCode" ? "ri:qr-code-line" : e.type === "tool-showImageGallery" ? "ri:image-line" : e.type === "tool-showVideo" ? "ri:film-line" : e.type === "tool-showSuggestedReply" ? "ri:corner-down-right-line" : e.type === "tool-requestGeolocation" ? "ri:map-pin-user-line" : e.type === "tool-disconnectOAuthConnection" ? "ri:link-unlink" : e.type === "tool-perplexity_search" || e.type === "tool-parallel_search" || e.type === "tool-web_search" || e.type === "tool-google_search" ? "ri:global-line" : "ri:tools-line";
|
|
212
227
|
if (fe(e)) return "ri:lightbulb-line";
|
|
213
228
|
if (h(e)) return "ri:double-quotes-r";
|
|
214
229
|
}
|
|
215
|
-
function
|
|
216
|
-
return g(t) ? t.type.includes("tool-subagent") ? e("messagePart.runSubagent") : t.type === "tool-runWorker" ? e("messagePart.runWorker") : t.type === "tool-fetchTeamsChannelHistory" ? e("messagePart.fetchTeamsChannelHistory") : t.type === "tool-enableTools" ? e("messagePart.enableTools") : t.type === "tool-retrieveRevisedAnswers" ? e("messagePart.revisedAnswers") : t.type === "tool-searchInKnowledgeBase" ? e("messagePart.searchingDocuments") : t.type === "tool-expandChunkContext" ? e("messagePart.expandChunkContext") : t.type === "tool-readDocumentFile" ? e("messagePart.readDocumentFile") : t.type === "tool-geocode" ? e("messagePart.geocode") : t.type === "tool-getWeather" ? e("messagePart.getWeather") : t.type === "tool-recallUserMemory" ? e("messagePart.recallUserMemory") : t.type === "tool-saveUserMemory" ? e("messagePart.saveUserMemory") : t.type === "tool-showWeather" ? e("messagePart.showWeather") : t.type === "tool-showForm" ? e("messagePart.showForm") : t.type === "tool-showDiagram" ? e("messagePart.showDiagram") : t.type === "tool-showSources" ? e("messagePart.showSources") : t.type === "tool-showMultipleChoice" ? e("messagePart.showMultipleChoice") : t.type === "tool-showArtifact" ? e("messagePart.showArtifact") : t.type === "tool-showEmail" ? e("messagePart.showEmail") : t.type === "tool-showMessage" ? e("messagePart.showMessage") : t.type === "tool-showWebPages" ? e("messagePart.showWebPages") : t.type === "tool-showProducts" ? e("messagePart.showProducts") : t.type === "tool-showContactForm" ? e("messagePart.showContactForm") : t.type === "tool-showCalendarEvent" ? e("messagePart.showCalendarEvent") : t.type === "tool-showComparison" ? e("messagePart.showComparison") : t.type === "tool-showLocation" ? e("messagePart.showLocation") : t.type === "tool-showQrCode" ? e("messagePart.showQrCode") : t.type === "tool-showImageGallery" ? e("messagePart.showImageGallery") : t.type === "tool-showVideo" ? e("messagePart.showVideo") : t.type === "tool-showSuggestedReply" ? e("messagePart.showSuggestedReply") : t.type === "tool-requestGeolocation" ? e("messagePart.requestGeolocation") : t.type === "tool-disconnectOAuthConnection" ? e("messagePart.disconnectOAuthConnection") : C.includes(t.type) ? e("messagePart.webSearch") : e("messagePart.tool") : fe(t) ? e("messagePart.reasoning") : e("messagePart.streaming");
|
|
230
|
+
function Re(e, t) {
|
|
231
|
+
return g(t) ? t.type.includes("tool-subagent") ? e("messagePart.runSubagent") : t.type === "tool-runWorker" ? e("messagePart.runWorker") : t.type === "tool-fetchTeamsChannelHistory" ? e("messagePart.fetchTeamsChannelHistory") : t.type === "tool-enableTools" ? e("messagePart.enableTools") : t.type === "tool-retrieveRevisedAnswers" ? e("messagePart.revisedAnswers") : t.type === "tool-searchInKnowledgeBase" ? e("messagePart.searchingDocuments") : t.type === "tool-expandChunkContext" ? e("messagePart.expandChunkContext") : t.type === "tool-readDocumentFile" ? e("messagePart.readDocumentFile") : t.type === "tool-readSpreadsheet" ? e("messagePart.readSpreadsheet") : t.type === "tool-editSpreadsheet" ? e("messagePart.editSpreadsheet") : t.type === "tool-querySpreadsheet" ? e("messagePart.querySpreadsheet") : t.type === "tool-geocode" ? e("messagePart.geocode") : t.type === "tool-getWeather" ? e("messagePart.getWeather") : t.type === "tool-recallUserMemory" ? e("messagePart.recallUserMemory") : t.type === "tool-saveUserMemory" ? e("messagePart.saveUserMemory") : t.type === "tool-showWeather" ? e("messagePart.showWeather") : t.type === "tool-showForm" ? e("messagePart.showForm") : t.type === "tool-showDiagram" ? e("messagePart.showDiagram") : t.type === "tool-showSources" ? e("messagePart.showSources") : t.type === "tool-showMultipleChoice" ? e("messagePart.showMultipleChoice") : t.type === "tool-showArtifact" ? e("messagePart.showArtifact") : t.type === "tool-showEmail" ? e("messagePart.showEmail") : t.type === "tool-showMessage" ? e("messagePart.showMessage") : t.type === "tool-showWebPages" ? e("messagePart.showWebPages") : t.type === "tool-showProducts" ? e("messagePart.showProducts") : t.type === "tool-showContactForm" ? e("messagePart.showContactForm") : t.type === "tool-showCalendarEvent" ? e("messagePart.showCalendarEvent") : t.type === "tool-showComparison" ? e("messagePart.showComparison") : t.type === "tool-showLocation" ? e("messagePart.showLocation") : t.type === "tool-showQrCode" ? e("messagePart.showQrCode") : t.type === "tool-showImageGallery" ? e("messagePart.showImageGallery") : t.type === "tool-showVideo" ? e("messagePart.showVideo") : t.type === "tool-showSuggestedReply" ? e("messagePart.showSuggestedReply") : t.type === "tool-requestGeolocation" ? e("messagePart.requestGeolocation") : t.type === "tool-disconnectOAuthConnection" ? e("messagePart.disconnectOAuthConnection") : C.includes(t.type) ? e("messagePart.webSearch") : e("messagePart.tool") : fe(t) ? e("messagePart.reasoning") : e("messagePart.streaming");
|
|
217
232
|
}
|
|
218
233
|
//#endregion
|
|
219
234
|
//#region ../../node_modules/.pnpm/remend@1.4.0/node_modules/remend/dist/index.js
|
|
220
|
-
var
|
|
235
|
+
var ze = Object.defineProperty, Be = Object.defineProperties, Ve = Object.getOwnPropertyDescriptors, He = Object.getOwnPropertySymbols, Ue = Object.prototype.hasOwnProperty, We = Object.prototype.propertyIsEnumerable, Ge = (e, t, n) => t in e ? ze(e, t, {
|
|
221
236
|
enumerable: !0,
|
|
222
237
|
configurable: !0,
|
|
223
238
|
writable: !0,
|
|
224
239
|
value: n
|
|
225
|
-
}) : e[t] = n,
|
|
226
|
-
for (var n in t ||= {})
|
|
227
|
-
if (
|
|
240
|
+
}) : e[t] = n, Ke = (e, t) => {
|
|
241
|
+
for (var n in t ||= {}) Ue.call(t, n) && Ge(e, n, t[n]);
|
|
242
|
+
if (He) for (var n of He(t)) We.call(t, n) && Ge(e, n, t[n]);
|
|
228
243
|
return e;
|
|
229
|
-
},
|
|
244
|
+
}, qe = (e, t) => Be(e, Ve(t)), E = {
|
|
230
245
|
PROSE: 0,
|
|
231
246
|
FENCE_MARKER: 1,
|
|
232
247
|
FENCE_INFO: 2,
|
|
233
248
|
FENCE_BODY: 3,
|
|
234
249
|
CODE_SPAN: 4,
|
|
235
250
|
CODE_SPAN_OPEN: 5
|
|
236
|
-
},
|
|
251
|
+
}, Je = /^(`{3,}|~{3,})(.*)$/, Ye = (e) => e !== void 0 && e >= "0" && e <= "9", Xe = (e, t) => {
|
|
237
252
|
let n = t;
|
|
238
253
|
if (e[n] === "-" || e[n] === "*" || e[n] === "+") n += 1;
|
|
239
254
|
else {
|
|
240
|
-
for (;
|
|
255
|
+
for (; Ye(e[n]) && n - t < 9;) n += 1;
|
|
241
256
|
if (n === t || e[n] !== "." && e[n] !== ")") return -1;
|
|
242
257
|
n += 1;
|
|
243
258
|
}
|
|
244
259
|
return e[n] === " " ? n + 1 : -1;
|
|
245
|
-
},
|
|
260
|
+
}, Ze = (e, t, n) => {
|
|
246
261
|
let r = 0, i = t, a = !1, o = t;
|
|
247
262
|
for (;;) {
|
|
248
263
|
for (; o < n && e[o] === " ";) o += 1;
|
|
@@ -250,7 +265,7 @@ var E = Object.defineProperty, Ie = Object.defineProperties, Le = Object.getOwnP
|
|
|
250
265
|
r += 1, o += e[o + 1] === " " ? 2 : 1, i = o, a = !1;
|
|
251
266
|
continue;
|
|
252
267
|
}
|
|
253
|
-
let t = o < n ?
|
|
268
|
+
let t = o < n ? Xe(e, o) : -1;
|
|
254
269
|
if (t === -1) return {
|
|
255
270
|
contentStart: o,
|
|
256
271
|
listIndent: a ? o - i : 0,
|
|
@@ -258,7 +273,7 @@ var E = Object.defineProperty, Ie = Object.defineProperties, Le = Object.getOwnP
|
|
|
258
273
|
};
|
|
259
274
|
o = t, a = !0;
|
|
260
275
|
}
|
|
261
|
-
},
|
|
276
|
+
}, Qe = (e, t, n, r) => {
|
|
262
277
|
let i = t;
|
|
263
278
|
for (let t = 0; t < r; t += 1) {
|
|
264
279
|
for (; i < n && e[i] === " ";) i += 1;
|
|
@@ -266,10 +281,10 @@ var E = Object.defineProperty, Ie = Object.defineProperties, Le = Object.getOwnP
|
|
|
266
281
|
i += 1, e[i] === " " && (i += 1);
|
|
267
282
|
}
|
|
268
283
|
return i;
|
|
269
|
-
},
|
|
284
|
+
}, $e = (e, t, n, r, i) => {
|
|
270
285
|
let a = t + r;
|
|
271
|
-
e.fill(
|
|
272
|
-
},
|
|
286
|
+
e.fill(E.FENCE_MARKER, a, a + i), e.fill(E.FENCE_INFO, a + i, Math.min(n + 1, e.length));
|
|
287
|
+
}, et = (e, t, n, r) => {
|
|
273
288
|
let i = t;
|
|
274
289
|
for (; i < n && e[i] === " ";) i += 1;
|
|
275
290
|
let a = 0;
|
|
@@ -280,62 +295,62 @@ var E = Object.defineProperty, Ie = Object.defineProperties, Le = Object.getOwnP
|
|
|
280
295
|
i += 1;
|
|
281
296
|
}
|
|
282
297
|
return !0;
|
|
283
|
-
},
|
|
284
|
-
let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a =
|
|
298
|
+
}, tt = (e, t, n, r) => {
|
|
299
|
+
let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a = Ze(e, n, i), o = e.slice(a.contentStart, i).match(Je);
|
|
285
300
|
if (!o) return null;
|
|
286
301
|
let [, s, c] = o, l = s[0];
|
|
287
|
-
return l === "`" && c.includes("`") ? null : (
|
|
302
|
+
return l === "`" && c.includes("`") ? null : ($e(t, n, r, a.contentStart - n, s.length), {
|
|
288
303
|
char: l,
|
|
289
304
|
length: s.length,
|
|
290
305
|
listIndent: a.listIndent,
|
|
291
306
|
quoteDepth: a.quoteDepth
|
|
292
307
|
});
|
|
293
|
-
},
|
|
294
|
-
let i =
|
|
308
|
+
}, nt = (e, t, n, r) => {
|
|
309
|
+
let i = Qe(e, t, n, r.quoteDepth);
|
|
295
310
|
if (i === -1 || r.listIndent === 0) return i;
|
|
296
311
|
let a = i;
|
|
297
312
|
for (; a < n && e[a] === " ";) a += 1;
|
|
298
313
|
return a === n || e[a] === "\r" && a + 1 === n || a - i >= r.listIndent ? i : -1;
|
|
299
|
-
},
|
|
314
|
+
}, rt = (e, t) => {
|
|
300
315
|
let n = e.length, r = null, i = 0;
|
|
301
316
|
for (; i < n;) {
|
|
302
317
|
let a = e.indexOf("\n", i);
|
|
303
318
|
a === -1 && (a = n);
|
|
304
|
-
let o = r ?
|
|
305
|
-
r && o === -1 && (r = null), r ?
|
|
319
|
+
let o = r ? nt(e, i, a, r) : -1;
|
|
320
|
+
r && o === -1 && (r = null), r ? et(e, o, a, r) ? (t.fill(E.FENCE_MARKER, i, a), r = null) : t.fill(E.FENCE_BODY, i, Math.min(a + 1, n)) : r = tt(e, t, i, a), i = a + 1;
|
|
306
321
|
}
|
|
307
322
|
return r;
|
|
308
|
-
},
|
|
323
|
+
}, it = (e, t) => {
|
|
309
324
|
let n = t + 1;
|
|
310
325
|
for (; n < e.length && e[n] === "`";) n += 1;
|
|
311
326
|
return n;
|
|
312
|
-
},
|
|
327
|
+
}, D = (e, t) => {
|
|
313
328
|
let n = t + 1;
|
|
314
329
|
for (; n < e.length && (e[n] === " " || e[n] === " " || e[n] === "\r");) n += 1;
|
|
315
330
|
return n < e.length && e[n] === "\n";
|
|
316
|
-
},
|
|
331
|
+
}, at = (e, t, n) => {
|
|
317
332
|
let r = n;
|
|
318
333
|
for (;;) {
|
|
319
334
|
let n = e.indexOf("`", r);
|
|
320
335
|
if (n === -1) return -1;
|
|
321
|
-
let i = n > r && e[n - 1] === "\\" && t[n - 1] ===
|
|
322
|
-
if (t[n] ===
|
|
336
|
+
let i = n > r && e[n - 1] === "\\" && t[n - 1] === E.PROSE;
|
|
337
|
+
if (t[n] === E.PROSE && !i) return n;
|
|
323
338
|
r = n + 1;
|
|
324
339
|
}
|
|
325
|
-
},
|
|
340
|
+
}, ot = (e, t) => {
|
|
326
341
|
let n = e.length, r = -1, i = 0, a = 0;
|
|
327
342
|
for (; a < n;) {
|
|
328
343
|
if (r < 0) {
|
|
329
|
-
if (a =
|
|
330
|
-
let n =
|
|
344
|
+
if (a = at(e, t, a), a === -1) break;
|
|
345
|
+
let n = it(e, a);
|
|
331
346
|
r = a, i = n - a, a = n;
|
|
332
347
|
continue;
|
|
333
348
|
}
|
|
334
|
-
if (t[a] !==
|
|
335
|
-
t.fill(
|
|
349
|
+
if (t[a] !== E.PROSE) {
|
|
350
|
+
t.fill(E.CODE_SPAN_OPEN, r, a), r = -1, a += 1;
|
|
336
351
|
continue;
|
|
337
352
|
}
|
|
338
|
-
if (e[a] === "\n" &&
|
|
353
|
+
if (e[a] === "\n" && D(e, a)) {
|
|
339
354
|
r = -1, a += 1;
|
|
340
355
|
continue;
|
|
341
356
|
}
|
|
@@ -343,79 +358,79 @@ var E = Object.defineProperty, Ie = Object.defineProperties, Le = Object.getOwnP
|
|
|
343
358
|
a += 1;
|
|
344
359
|
continue;
|
|
345
360
|
}
|
|
346
|
-
let n =
|
|
347
|
-
n - a === i && (t.fill(
|
|
361
|
+
let n = it(e, a);
|
|
362
|
+
n - a === i && (t.fill(E.CODE_SPAN, r, n), r = -1), a = n;
|
|
348
363
|
}
|
|
349
|
-
return r >= 0 ? (t.fill(
|
|
364
|
+
return r >= 0 ? (t.fill(E.CODE_SPAN_OPEN, r, n), {
|
|
350
365
|
start: r,
|
|
351
366
|
runLength: i
|
|
352
367
|
}) : null;
|
|
353
|
-
},
|
|
368
|
+
}, st = (e) => {
|
|
354
369
|
let t = new Uint8Array(e.length);
|
|
355
370
|
return {
|
|
356
371
|
text: e,
|
|
357
372
|
regions: t,
|
|
358
|
-
openFence:
|
|
359
|
-
openSpan:
|
|
373
|
+
openFence: rt(e, t),
|
|
374
|
+
openSpan: ot(e, t),
|
|
360
375
|
mathMask: null,
|
|
361
376
|
linkUrlMask: null,
|
|
362
377
|
htmlTagMask: null
|
|
363
378
|
};
|
|
364
|
-
},
|
|
365
|
-
if (
|
|
366
|
-
let t =
|
|
367
|
-
return
|
|
368
|
-
},
|
|
369
|
-
|
|
370
|
-
},
|
|
371
|
-
let n =
|
|
372
|
-
for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] ===
|
|
379
|
+
}, ct = null, lt = null, O = (e) => {
|
|
380
|
+
if (lt !== null && e === ct) return lt;
|
|
381
|
+
let t = st(e);
|
|
382
|
+
return ct = e, lt = t, t;
|
|
383
|
+
}, ut = () => {
|
|
384
|
+
ct = null, lt = null;
|
|
385
|
+
}, dt = (e, t) => t >= e.regions.length ? e.openFence !== null || e.openSpan !== null : t < 0 ? !1 : e.regions[t] !== E.PROSE, ft = (e, t) => e.regions[t] === E.CODE_SPAN, pt = (e, t) => {
|
|
386
|
+
let n = O(e), r = t + t, i = 0;
|
|
387
|
+
for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] === E.PROSE ? (i += 1, t += 2) : t += 1;
|
|
373
388
|
return i;
|
|
374
|
-
},
|
|
389
|
+
}, mt = /* @__PURE__ */ new Uint8Array(), k = (e) => e === "inlineLatex" || e === "blockLatex", ht = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, gt = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", _t = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), vt = (e, t, n) => {
|
|
375
390
|
let r = e[t + 1];
|
|
376
391
|
if (e[t] === "\\") {
|
|
377
392
|
if (r === "$") return {
|
|
378
393
|
context: n,
|
|
379
394
|
length: 2
|
|
380
395
|
};
|
|
381
|
-
let e =
|
|
396
|
+
let e = ht(n, r);
|
|
382
397
|
return e === null ? null : {
|
|
383
398
|
context: e,
|
|
384
399
|
length: 2
|
|
385
400
|
};
|
|
386
401
|
}
|
|
387
|
-
if (e[t] === "$" && !
|
|
402
|
+
if (e[t] === "$" && !k(n)) {
|
|
388
403
|
let e = r === "$";
|
|
389
404
|
return {
|
|
390
|
-
context:
|
|
405
|
+
context: gt(n, e),
|
|
391
406
|
length: e ? 2 : 1
|
|
392
407
|
};
|
|
393
408
|
}
|
|
394
409
|
return null;
|
|
395
|
-
},
|
|
410
|
+
}, yt = (e) => {
|
|
396
411
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = "none", o = 0;
|
|
397
412
|
for (; o < r;) {
|
|
398
413
|
i[o] = a === "none" ? 0 : 1;
|
|
399
|
-
let e = n[o] ===
|
|
414
|
+
let e = n[o] === E.PROSE ? vt(t, o, a) : null;
|
|
400
415
|
e === null ? o += 1 : (a = e.context, e.length === 2 && (i[o + 1] = a === "none" ? 0 : 1), o += e.length);
|
|
401
416
|
}
|
|
402
417
|
return i;
|
|
403
|
-
},
|
|
418
|
+
}, bt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.mathMask === null && (e.mathMask = _t(e.text) ? yt(e) : mt), e.mathMask[t] === 1), xt = (e, t, n, r) => {
|
|
404
419
|
let { text: i, regions: a } = e, o = new Uint8Array(n - t), s = 0;
|
|
405
|
-
for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] ===
|
|
420
|
+
for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] === E.PROSE && (s = 1), o[e - t] = s;
|
|
406
421
|
let c = !1;
|
|
407
|
-
for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] ===
|
|
408
|
-
},
|
|
422
|
+
for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] === E.PROSE && (i[e] === ")" ? c = !1 : i[e] === "(" && (c = e > 0 && i[e - 1] === "]"));
|
|
423
|
+
}, St = (e) => {
|
|
409
424
|
let { text: t } = e, n = t.length, r = new Uint8Array(n), i = 0;
|
|
410
425
|
for (; i < n;) {
|
|
411
426
|
let a = t.indexOf("\n", i);
|
|
412
|
-
a === -1 && (a = n),
|
|
427
|
+
a === -1 && (a = n), xt(e, i, a, r), i = a + 1;
|
|
413
428
|
}
|
|
414
429
|
return r;
|
|
415
|
-
},
|
|
430
|
+
}, Ct = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.linkUrlMask === null && (e.linkUrlMask = e.text.includes("](") ? St(e) : mt), e.linkUrlMask[t] === 1), wt = (e) => {
|
|
416
431
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = !1;
|
|
417
432
|
for (let e = 0; e < r; e += 1) if (t[e] === "\n") a = !1;
|
|
418
|
-
else if (i[e] = +!!a, n[e] ===
|
|
433
|
+
else if (i[e] = +!!a, n[e] === E.PROSE) {
|
|
419
434
|
if (t[e] === ">") a = !1;
|
|
420
435
|
else if (t[e] === "<") {
|
|
421
436
|
let n = t[e + 1];
|
|
@@ -423,56 +438,56 @@ var E = Object.defineProperty, Ie = Object.defineProperties, Le = Object.getOwnP
|
|
|
423
438
|
}
|
|
424
439
|
}
|
|
425
440
|
return i;
|
|
426
|
-
},
|
|
441
|
+
}, A = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.htmlTagMask === null && (e.htmlTagMask = e.text.includes("<") ? wt(e) : mt), e.htmlTagMask[t] === 1), j = (e, t) => dt(O(e), t), M = (e, t) => ft(O(e), t), Tt = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, Et = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Tt, (t, n, r, i) => j(e, i) ? t : `${n}\\>${r}`), N = (e, { delimiter: t, markerLength: n, regex: r }) => {
|
|
427
442
|
let i = e.lastIndexOf(t, e.length - 2), a = i === -1 ? e.length - 1 : i;
|
|
428
443
|
return e.slice(Math.max(0, a - n + 1)).match(r);
|
|
429
|
-
},
|
|
444
|
+
}, Dt = {
|
|
430
445
|
delimiter: "*",
|
|
431
446
|
markerLength: 2,
|
|
432
447
|
regex: /(\*\*)([^*]*\*?)$/
|
|
433
|
-
},
|
|
448
|
+
}, Ot = {
|
|
434
449
|
delimiter: "_",
|
|
435
450
|
markerLength: 2,
|
|
436
451
|
regex: /(__)([^_]*?)$/
|
|
437
|
-
},
|
|
452
|
+
}, kt = {
|
|
438
453
|
delimiter: "*",
|
|
439
454
|
markerLength: 3,
|
|
440
455
|
regex: /(\*\*\*)([^*]*?)$/
|
|
441
|
-
},
|
|
456
|
+
}, At = {
|
|
442
457
|
delimiter: "*",
|
|
443
458
|
markerLength: 1,
|
|
444
459
|
regex: /(\*)([^*]*?)$/
|
|
445
|
-
},
|
|
460
|
+
}, jt = {
|
|
446
461
|
delimiter: "_",
|
|
447
462
|
markerLength: 1,
|
|
448
463
|
regex: /(_)([^_]*?)$/
|
|
449
|
-
},
|
|
464
|
+
}, Mt = {
|
|
450
465
|
delimiter: "~",
|
|
451
466
|
markerLength: 2,
|
|
452
467
|
regex: /(~~)([^~]*?)$/
|
|
453
|
-
},
|
|
468
|
+
}, Nt = {
|
|
454
469
|
delimiter: "_",
|
|
455
470
|
markerLength: 2,
|
|
456
471
|
regex: /(__)([^_]+)_$/
|
|
457
|
-
},
|
|
472
|
+
}, Pt = {
|
|
458
473
|
delimiter: "~",
|
|
459
474
|
markerLength: 2,
|
|
460
475
|
regex: /(~~)([^~]+)~$/
|
|
461
|
-
},
|
|
476
|
+
}, P = /^[\s_~*`]*$/, F = /^[\s]*[-*+][\s]+$/, Ft = /[\p{L}\p{N}_]/u, It = /^\*{4,}$/, I = (e) => {
|
|
462
477
|
if (!e) return !1;
|
|
463
478
|
let t = e.charCodeAt(0);
|
|
464
|
-
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 ||
|
|
465
|
-
},
|
|
479
|
+
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || Ft.test(e);
|
|
480
|
+
}, Lt = (e, t) => {
|
|
466
481
|
let n = 1;
|
|
467
482
|
for (let r = t - 1; r >= 0; --r) if (e[r] === "]") n += 1;
|
|
468
483
|
else if (e[r] === "[" && (--n, n === 0)) return r;
|
|
469
484
|
return -1;
|
|
470
|
-
},
|
|
485
|
+
}, Rt = (e, t) => {
|
|
471
486
|
let n = 1;
|
|
472
487
|
for (let r = t + 1; r < e.length; r += 1) if (e[r] === "[") n += 1;
|
|
473
488
|
else if (e[r] === "]" && (--n, n === 0)) return r;
|
|
474
489
|
return -1;
|
|
475
|
-
},
|
|
490
|
+
}, zt = (e, t) => bt(O(e), t), Bt = (e, t, n) => {
|
|
476
491
|
let r = 0;
|
|
477
492
|
for (let n = t - 1; n >= 0; --n) if (e[n] === "\n") {
|
|
478
493
|
r = n + 1;
|
|
@@ -490,184 +505,184 @@ var E = Object.defineProperty, Ie = Object.defineProperties, Le = Object.getOwnP
|
|
|
490
505
|
break;
|
|
491
506
|
}
|
|
492
507
|
return o >= 3 && !s;
|
|
493
|
-
},
|
|
494
|
-
let i =
|
|
508
|
+
}, Vt = (e, t, n, r) => n === "\\" || bt(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"), Ht = (e) => e === " " || e === " " || e === "\n", Ut = (e, t) => !!(e && t && I(e) && I(t)), Wt = (e, t, n, r) => {
|
|
509
|
+
let i = Ut(e, t), a = !!t && !Ht(t), o = !!e && !Ht(e);
|
|
495
510
|
return i && n % 2 == 0 && !r ? { count: !1 } : o && n % 2 == 1 || a ? {
|
|
496
511
|
count: !0,
|
|
497
512
|
inWordAsteriskChain: i
|
|
498
513
|
} : { count: !1 };
|
|
499
|
-
},
|
|
500
|
-
let t =
|
|
514
|
+
}, Gt = (e) => {
|
|
515
|
+
let t = O(e), n = 0, r = !1, i = e.length;
|
|
501
516
|
for (let a = 0; a < i; a += 1) {
|
|
502
|
-
if (e[a] !== "*" || t.regions[a] !==
|
|
517
|
+
if (e[a] !== "*" || t.regions[a] !== E.PROSE) {
|
|
503
518
|
I(e[a]) || (r = !1);
|
|
504
519
|
continue;
|
|
505
520
|
}
|
|
506
521
|
let o = a > 0 ? e[a - 1] : "", s = a < i - 1 ? e[a + 1] : "";
|
|
507
|
-
if (
|
|
508
|
-
let c =
|
|
522
|
+
if (Vt(t, a, o, s)) continue;
|
|
523
|
+
let c = Wt(o, s, n, r);
|
|
509
524
|
c.count && (n += 1, r = c.inWordAsteriskChain);
|
|
510
525
|
}
|
|
511
526
|
return n;
|
|
512
|
-
},
|
|
513
|
-
let t =
|
|
527
|
+
}, Kt = (e, t, n, r) => !!(n === "\\" || bt(e, t) || Ct(e, t) || A(e, t) || n === "_" || r === "_" || n && r && I(n) && I(r)), qt = (e) => {
|
|
528
|
+
let t = O(e), n = 0, r = e.length;
|
|
514
529
|
for (let i = 0; i < r; i += 1) {
|
|
515
|
-
if (e[i] !== "_" || t.regions[i] !==
|
|
530
|
+
if (e[i] !== "_" || t.regions[i] !== E.PROSE) continue;
|
|
516
531
|
let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
|
|
517
|
-
|
|
532
|
+
Kt(t, i, a, o) || (n += 1);
|
|
518
533
|
}
|
|
519
534
|
return n;
|
|
520
|
-
},
|
|
521
|
-
let t =
|
|
522
|
-
for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] ===
|
|
535
|
+
}, Jt = (e) => {
|
|
536
|
+
let t = O(e), n = 0, r = 0;
|
|
537
|
+
for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] === E.PROSE ? r += 1 : (r >= 3 && (n += Math.floor(r / 3)), r = 0);
|
|
523
538
|
return r >= 3 && (n += Math.floor(r / 3)), n;
|
|
524
|
-
},
|
|
525
|
-
if (!(
|
|
539
|
+
}, Yt = (e) => pt(e, "*"), Xt = (e) => e === "" || e === " " || e === " " || e === "\n", Zt = (e, t, n, r, i) => {
|
|
540
|
+
if (!(Xt(n) && Xt(r))) return !1;
|
|
526
541
|
if (t > i.lineEnd) {
|
|
527
542
|
let n = e.indexOf("\n", t);
|
|
528
|
-
i.lineEnd = n === -1 ? e.length : n, i.result =
|
|
543
|
+
i.lineEnd = n === -1 ? e.length : n, i.result = Bt(e, t, "_");
|
|
529
544
|
}
|
|
530
545
|
return i.result;
|
|
531
|
-
},
|
|
546
|
+
}, Qt = (e, t, n, r) => {
|
|
532
547
|
let i = e.text, a = t, o = !1;
|
|
533
548
|
a > 0 && i[a - 1] === "\\" && (a += 1, o = !0);
|
|
534
549
|
let s = n - a;
|
|
535
550
|
if (s < 2) return !1;
|
|
536
551
|
let c = a > 0 ? i[a - 1] : "", l = o ? "\\" : c, u = n < i.length ? i[n] : "";
|
|
537
|
-
return I(l) && I(u) ||
|
|
538
|
-
},
|
|
539
|
-
let t =
|
|
552
|
+
return I(l) && I(u) || Zt(i, a, l, u, r) || bt(e, a) || Ct(e, a) || A(e, a) ? !1 : Math.floor(s / 2) % 2 == 1;
|
|
553
|
+
}, $t = (e) => {
|
|
554
|
+
let t = O(e), n = e.length, r = {
|
|
540
555
|
lineEnd: -1,
|
|
541
556
|
result: !1
|
|
542
557
|
}, i = !1, a = 0;
|
|
543
558
|
for (; a < n;) {
|
|
544
|
-
if (e[a] !== "_" || t.regions[a] !==
|
|
559
|
+
if (e[a] !== "_" || t.regions[a] !== E.PROSE) {
|
|
545
560
|
a += 1;
|
|
546
561
|
continue;
|
|
547
562
|
}
|
|
548
563
|
let o = a, s = a + 1;
|
|
549
|
-
for (; s < n && e[s] === "_" && t.regions[s] ===
|
|
550
|
-
a = s,
|
|
564
|
+
for (; s < n && e[s] === "_" && t.regions[s] === E.PROSE;) s += 1;
|
|
565
|
+
a = s, Qt(t, o, s, r) && (i = !i);
|
|
551
566
|
}
|
|
552
567
|
return i;
|
|
553
|
-
},
|
|
554
|
-
if (!t ||
|
|
568
|
+
}, en = (e, t, n) => {
|
|
569
|
+
if (!t || P.test(t)) return !0;
|
|
555
570
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
556
|
-
return
|
|
557
|
-
},
|
|
558
|
-
let t =
|
|
571
|
+
return F.test(a) && t.includes("\n") ? !0 : Bt(e, n, "*");
|
|
572
|
+
}, tn = (e) => {
|
|
573
|
+
let t = N(e, Dt);
|
|
559
574
|
if (!t) return e;
|
|
560
575
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
561
|
-
return
|
|
562
|
-
},
|
|
563
|
-
if (!t ||
|
|
576
|
+
return j(e, r) || M(e, r) || en(e, n, r) ? e : Yt(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
|
|
577
|
+
}, nn = (e, t, n) => {
|
|
578
|
+
if (!t || P.test(t)) return !0;
|
|
564
579
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
565
|
-
return
|
|
566
|
-
},
|
|
567
|
-
let t =
|
|
580
|
+
return F.test(a) && t.includes("\n") ? !0 : Bt(e, n, "_");
|
|
581
|
+
}, rn = (e) => {
|
|
582
|
+
let t = N(e, Ot);
|
|
568
583
|
if (!t) {
|
|
569
|
-
let t =
|
|
584
|
+
let t = N(e, Nt);
|
|
570
585
|
if (t) {
|
|
571
586
|
let n = e.lastIndexOf(t[1]);
|
|
572
|
-
if (!(
|
|
587
|
+
if (!(j(e, n) || M(e, n)) && $t(e)) return `${e}_`;
|
|
573
588
|
}
|
|
574
589
|
return e;
|
|
575
590
|
}
|
|
576
591
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
577
|
-
return
|
|
578
|
-
},
|
|
592
|
+
return j(e, r) || M(e, r) || nn(e, n, r) ? e : $t(e) ? `${e}__` : e;
|
|
593
|
+
}, an = (e, t) => {
|
|
579
594
|
let { text: n } = e;
|
|
580
|
-
return n[t] === "*" && e.regions[t] ===
|
|
581
|
-
},
|
|
582
|
-
let t =
|
|
595
|
+
return n[t] === "*" && e.regions[t] === E.PROSE && n[t - 1] !== "*" && n[t + 1] !== "*" && n[t - 1] !== "\\" && !bt(e, t);
|
|
596
|
+
}, on = (e) => {
|
|
597
|
+
let t = O(e);
|
|
583
598
|
for (let n = e.indexOf("*"); n !== -1; n = e.indexOf("*", n + 1)) {
|
|
584
|
-
if (!
|
|
585
|
-
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r ||
|
|
599
|
+
if (!an(t, n)) continue;
|
|
600
|
+
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r || Ht(r), o = !i || Ht(i);
|
|
586
601
|
if (!(a && o) && !(r && i && I(r) && I(i)) && !o) return n;
|
|
587
602
|
}
|
|
588
603
|
return -1;
|
|
589
|
-
},
|
|
590
|
-
if (!
|
|
591
|
-
let t =
|
|
592
|
-
if (t === -1 ||
|
|
604
|
+
}, sn = (e) => {
|
|
605
|
+
if (!N(e, At)) return e;
|
|
606
|
+
let t = on(e);
|
|
607
|
+
if (t === -1 || j(e, t) || M(e, t)) return e;
|
|
593
608
|
let n = e.substring(t + 1);
|
|
594
|
-
return !n ||
|
|
595
|
-
},
|
|
596
|
-
let t =
|
|
597
|
-
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] ===
|
|
609
|
+
return !n || P.test(n) ? e : Gt(e) % 2 == 1 ? `${e}*` : e;
|
|
610
|
+
}, cn = (e) => {
|
|
611
|
+
let t = O(e);
|
|
612
|
+
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] === E.PROSE && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !bt(t, n) && !Ct(t, n)) {
|
|
598
613
|
let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
|
|
599
614
|
if (t && r && I(t) && I(r)) continue;
|
|
600
615
|
return n;
|
|
601
616
|
}
|
|
602
617
|
return -1;
|
|
603
|
-
},
|
|
618
|
+
}, ln = (e) => {
|
|
604
619
|
let t = e.length;
|
|
605
620
|
for (; t > 0 && e[t - 1] === "\n";) --t;
|
|
606
621
|
return t < e.length ? `${e.slice(0, t)}_${e.slice(t)}` : `${e}_`;
|
|
607
|
-
},
|
|
622
|
+
}, un = (e) => {
|
|
608
623
|
if (!e.endsWith("**")) return null;
|
|
609
624
|
let t = e.slice(0, -2);
|
|
610
|
-
if (
|
|
611
|
-
let n = t.indexOf("**"), r =
|
|
625
|
+
if (Yt(t) % 2 != 1) return null;
|
|
626
|
+
let n = t.indexOf("**"), r = cn(t);
|
|
612
627
|
return n !== -1 && r !== -1 && n < r ? `${t}_**` : null;
|
|
613
|
-
},
|
|
614
|
-
if (!
|
|
615
|
-
let t =
|
|
628
|
+
}, dn = (e) => {
|
|
629
|
+
if (!N(e, jt)) return e;
|
|
630
|
+
let t = cn(e);
|
|
616
631
|
if (t === -1) return e;
|
|
617
632
|
let n = e.substring(t + 1);
|
|
618
|
-
if (!n ||
|
|
619
|
-
if (
|
|
620
|
-
let t =
|
|
621
|
-
return t === null ?
|
|
633
|
+
if (!n || P.test(n) || j(e, t) || M(e, t)) return e;
|
|
634
|
+
if (qt(e) % 2 == 1) {
|
|
635
|
+
let t = un(e);
|
|
636
|
+
return t === null ? ln(e) : t;
|
|
622
637
|
}
|
|
623
638
|
return e;
|
|
624
|
-
},
|
|
625
|
-
let t =
|
|
639
|
+
}, fn = (e) => {
|
|
640
|
+
let t = Yt(e), n = Gt(e);
|
|
626
641
|
return t % 2 == 0 && n % 2 == 0;
|
|
627
|
-
},
|
|
628
|
-
if (
|
|
629
|
-
let t =
|
|
642
|
+
}, pn = (e, t, n) => !t || P.test(t) || j(e, n) || M(e, n) ? !0 : Bt(e, n, "*"), mn = (e) => {
|
|
643
|
+
if (It.test(e)) return e;
|
|
644
|
+
let t = N(e, kt);
|
|
630
645
|
if (!t) return e;
|
|
631
646
|
let n = t[2];
|
|
632
|
-
return
|
|
633
|
-
},
|
|
647
|
+
return pn(e, n, e.lastIndexOf(t[1])) ? e : Jt(e) % 2 == 1 ? fn(e) ? e : `${e}***` : e;
|
|
648
|
+
}, hn = /<[a-zA-Z/][^>]*$/, gn = /[a-zA-Z/]/, _n = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), vn = (e, t) => {
|
|
634
649
|
let n = e[t + 1];
|
|
635
|
-
return n !== void 0 &&
|
|
636
|
-
},
|
|
637
|
-
let t = e.match(
|
|
650
|
+
return n !== void 0 && gn.test(n);
|
|
651
|
+
}, yn = (e) => {
|
|
652
|
+
let t = e.match(hn);
|
|
638
653
|
if (!t || t.index === void 0) return e;
|
|
639
|
-
let n =
|
|
640
|
-
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" &&
|
|
654
|
+
let n = _n(e);
|
|
655
|
+
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" && vn(e, r) && !j(e, r) && !(n && zt(e, r))) return e.substring(0, r).trimEnd();
|
|
641
656
|
return e;
|
|
642
|
-
},
|
|
643
|
-
let t =
|
|
657
|
+
}, bn = (e) => {
|
|
658
|
+
let t = O(e);
|
|
644
659
|
if (t.openFence) return e;
|
|
645
660
|
let n = t.openSpan;
|
|
646
661
|
if (!n) return e;
|
|
647
662
|
let r = e.slice(n.start + n.runLength);
|
|
648
|
-
if (!r ||
|
|
663
|
+
if (!r || P.test(r)) return e;
|
|
649
664
|
let i = 0, a = e.length - 1;
|
|
650
665
|
for (; a >= 0 && e[a] === "`";) i += 1, --a;
|
|
651
666
|
return i >= n.runLength ? e : e + "`".repeat(n.runLength - i);
|
|
652
|
-
},
|
|
653
|
-
let t =
|
|
654
|
-
for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] ===
|
|
667
|
+
}, xn = (e) => pt(e, "$"), Sn = (e) => {
|
|
668
|
+
let t = O(e), n = 0;
|
|
669
|
+
for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] === E.PROSE && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : n += 1);
|
|
655
670
|
return n;
|
|
656
|
-
},
|
|
671
|
+
}, Cn = (e) => {
|
|
657
672
|
if (e.endsWith("$") && !e.endsWith("$$")) return `${e}$`;
|
|
658
673
|
let t = e.indexOf("$$");
|
|
659
674
|
return t !== -1 && e.indexOf("\n", t) !== -1 && !e.endsWith("\n") ? `${e}
|
|
660
675
|
$$` : `${e}$$`;
|
|
661
|
-
},
|
|
676
|
+
}, wn = (e) => xn(e) % 2 == 0 ? e : Cn(e), Tn = (e) => Sn(e) % 2 == 1 ? `${e}$` : e, En = "streamdown:incomplete-image", Dn = (e, t, n) => {
|
|
662
677
|
if (e.substring(t + 2).includes(")")) return null;
|
|
663
|
-
let r =
|
|
664
|
-
if (r === -1 ||
|
|
678
|
+
let r = Lt(e, t);
|
|
679
|
+
if (r === -1 || j(e, r)) return null;
|
|
665
680
|
let i = r > 0 && e[r - 1] === "!", a = i ? r - 1 : r, o = e.substring(0, a), s = e.substring(r + 1, t);
|
|
666
|
-
return i ? `${o} if (e[n] === "[" && !
|
|
681
|
+
return i ? `${o}` : n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
|
|
682
|
+
}, On = (e, t) => {
|
|
683
|
+
for (let n = 0; n < t; n++) if (e[n] === "[" && !j(e, n)) {
|
|
669
684
|
if (n > 0 && e[n - 1] === "!") continue;
|
|
670
|
-
let t =
|
|
685
|
+
let t = Rt(e, n);
|
|
671
686
|
if (t === -1) return n;
|
|
672
687
|
if (t + 1 < e.length && e[t + 1] === "(") {
|
|
673
688
|
let r = e.indexOf(")", t + 2);
|
|
@@ -675,69 +690,69 @@ $$` : `${e}$$`;
|
|
|
675
690
|
}
|
|
676
691
|
}
|
|
677
692
|
return t;
|
|
678
|
-
},
|
|
693
|
+
}, kn = (e, t, n) => {
|
|
679
694
|
let r = t > 0 && e[t - 1] === "!", i = r ? t - 1 : t;
|
|
680
|
-
if (!e.substring(t + 1).includes("]") ||
|
|
695
|
+
if (!e.substring(t + 1).includes("]") || Rt(e, t) === -1) {
|
|
681
696
|
let a = e.substring(0, i);
|
|
682
|
-
if (r) return `${a} return `${a}`;
|
|
683
698
|
if (n === "text-only") {
|
|
684
|
-
let n =
|
|
699
|
+
let n = On(e, t);
|
|
685
700
|
return e.substring(0, n) + e.substring(n + 1);
|
|
686
701
|
}
|
|
687
702
|
return `${e}](streamdown:incomplete-link)`;
|
|
688
703
|
}
|
|
689
704
|
return null;
|
|
690
|
-
},
|
|
705
|
+
}, An = (e, t) => {
|
|
691
706
|
let n = e.lastIndexOf("](");
|
|
692
|
-
if (n !== -1 && !
|
|
693
|
-
let r =
|
|
707
|
+
if (n !== -1 && !j(e, n)) {
|
|
708
|
+
let r = Dn(e, n, t);
|
|
694
709
|
if (r !== null) return r;
|
|
695
710
|
}
|
|
696
|
-
for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!
|
|
697
|
-
let r =
|
|
711
|
+
for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!j(e, n)) {
|
|
712
|
+
let r = kn(e, n, t);
|
|
698
713
|
if (r !== null) return r;
|
|
699
714
|
}
|
|
700
715
|
return e;
|
|
701
|
-
},
|
|
716
|
+
}, jn = 32, Mn = (e, t = "protocol") => {
|
|
702
717
|
let n = e;
|
|
703
|
-
for (let e = 0; e <
|
|
704
|
-
let e =
|
|
718
|
+
for (let e = 0; e < jn; e += 1) {
|
|
719
|
+
let e = An(n, t);
|
|
705
720
|
if (e.length >= n.length) return e;
|
|
706
721
|
n = e;
|
|
707
722
|
}
|
|
708
723
|
return n;
|
|
709
|
-
},
|
|
724
|
+
}, Nn = /^-{1,2}$/, Pn = /^[\s]*-{1,2}[\s]+$/, Fn = /^={1,2}$/, In = /^[\s]*={1,2}[\s]+$/, Ln = (e) => {
|
|
710
725
|
if (!e || typeof e != "string") return e;
|
|
711
726
|
let t = e.lastIndexOf("\n");
|
|
712
727
|
if (t === -1) return e;
|
|
713
728
|
let n = e.substring(t + 1), r = e.substring(0, t), i = n.trim();
|
|
714
|
-
if (
|
|
729
|
+
if (Nn.test(i) && !n.match(Pn)) {
|
|
715
730
|
let t = r.split("\n").at(-1);
|
|
716
731
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
717
732
|
}
|
|
718
|
-
if (
|
|
733
|
+
if (Fn.test(i) && !n.match(In)) {
|
|
719
734
|
let t = r.split("\n").at(-1);
|
|
720
735
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
721
736
|
}
|
|
722
737
|
return e;
|
|
723
|
-
},
|
|
724
|
-
let t =
|
|
738
|
+
}, Rn = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, zn = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(Rn, (t, n, r) => j(e, r + n.length) ? t : `${n}\\~`), Bn = (e) => pt(e, "~"), Vn = (e) => {
|
|
739
|
+
let t = N(e, Mt);
|
|
725
740
|
if (t) {
|
|
726
741
|
let n = t[2];
|
|
727
|
-
if (!n ||
|
|
742
|
+
if (!n || P.test(n)) return e;
|
|
728
743
|
let r = e.lastIndexOf(t[1]);
|
|
729
|
-
if (
|
|
730
|
-
if (
|
|
744
|
+
if (j(e, r) || M(e, r)) return e;
|
|
745
|
+
if (Bn(e) % 2 == 1) return `${e}~~`;
|
|
731
746
|
} else {
|
|
732
|
-
let t =
|
|
747
|
+
let t = N(e, Pt);
|
|
733
748
|
if (t) {
|
|
734
749
|
let n = e.lastIndexOf(t[0].slice(0, 2));
|
|
735
|
-
if (
|
|
736
|
-
if (
|
|
750
|
+
if (j(e, n) || M(e, n)) return e;
|
|
751
|
+
if (Bn(e) % 2 == 1) return `${e}~`;
|
|
737
752
|
}
|
|
738
753
|
}
|
|
739
754
|
return e;
|
|
740
|
-
},
|
|
755
|
+
}, Hn = (e) => e !== !1, Un = (e) => e === !0, L = {
|
|
741
756
|
SINGLE_TILDE: 0,
|
|
742
757
|
COMPARISON_OPERATORS: 5,
|
|
743
758
|
HTML_TAGS: 10,
|
|
@@ -753,11 +768,11 @@ $$` : `${e}$$`;
|
|
|
753
768
|
KATEX: 70,
|
|
754
769
|
INLINE_KATEX: 75,
|
|
755
770
|
DEFAULT: 100
|
|
756
|
-
},
|
|
771
|
+
}, Wn = [
|
|
757
772
|
{
|
|
758
773
|
handler: {
|
|
759
774
|
name: "singleTilde",
|
|
760
|
-
handle:
|
|
775
|
+
handle: zn,
|
|
761
776
|
priority: L.SINGLE_TILDE
|
|
762
777
|
},
|
|
763
778
|
optionKey: "singleTilde"
|
|
@@ -765,7 +780,7 @@ $$` : `${e}$$`;
|
|
|
765
780
|
{
|
|
766
781
|
handler: {
|
|
767
782
|
name: "comparisonOperators",
|
|
768
|
-
handle:
|
|
783
|
+
handle: Et,
|
|
769
784
|
priority: L.COMPARISON_OPERATORS
|
|
770
785
|
},
|
|
771
786
|
optionKey: "comparisonOperators"
|
|
@@ -773,7 +788,7 @@ $$` : `${e}$$`;
|
|
|
773
788
|
{
|
|
774
789
|
handler: {
|
|
775
790
|
name: "htmlTags",
|
|
776
|
-
handle:
|
|
791
|
+
handle: yn,
|
|
777
792
|
priority: L.HTML_TAGS
|
|
778
793
|
},
|
|
779
794
|
optionKey: "htmlTags"
|
|
@@ -781,7 +796,7 @@ $$` : `${e}$$`;
|
|
|
781
796
|
{
|
|
782
797
|
handler: {
|
|
783
798
|
name: "setextHeadings",
|
|
784
|
-
handle:
|
|
799
|
+
handle: Ln,
|
|
785
800
|
priority: L.SETEXT_HEADINGS
|
|
786
801
|
},
|
|
787
802
|
optionKey: "setextHeadings"
|
|
@@ -789,7 +804,7 @@ $$` : `${e}$$`;
|
|
|
789
804
|
{
|
|
790
805
|
handler: {
|
|
791
806
|
name: "links",
|
|
792
|
-
handle:
|
|
807
|
+
handle: Mn,
|
|
793
808
|
priority: L.LINKS
|
|
794
809
|
},
|
|
795
810
|
optionKey: "links",
|
|
@@ -798,7 +813,7 @@ $$` : `${e}$$`;
|
|
|
798
813
|
{
|
|
799
814
|
handler: {
|
|
800
815
|
name: "boldItalic",
|
|
801
|
-
handle:
|
|
816
|
+
handle: mn,
|
|
802
817
|
priority: L.BOLD_ITALIC
|
|
803
818
|
},
|
|
804
819
|
optionKey: "boldItalic"
|
|
@@ -806,7 +821,7 @@ $$` : `${e}$$`;
|
|
|
806
821
|
{
|
|
807
822
|
handler: {
|
|
808
823
|
name: "bold",
|
|
809
|
-
handle:
|
|
824
|
+
handle: tn,
|
|
810
825
|
priority: L.BOLD
|
|
811
826
|
},
|
|
812
827
|
optionKey: "bold"
|
|
@@ -814,7 +829,7 @@ $$` : `${e}$$`;
|
|
|
814
829
|
{
|
|
815
830
|
handler: {
|
|
816
831
|
name: "italicDoubleUnderscore",
|
|
817
|
-
handle:
|
|
832
|
+
handle: rn,
|
|
818
833
|
priority: L.ITALIC_DOUBLE_UNDERSCORE
|
|
819
834
|
},
|
|
820
835
|
optionKey: "italic"
|
|
@@ -822,7 +837,7 @@ $$` : `${e}$$`;
|
|
|
822
837
|
{
|
|
823
838
|
handler: {
|
|
824
839
|
name: "italicSingleAsterisk",
|
|
825
|
-
handle:
|
|
840
|
+
handle: sn,
|
|
826
841
|
priority: L.ITALIC_SINGLE_ASTERISK
|
|
827
842
|
},
|
|
828
843
|
optionKey: "italic"
|
|
@@ -830,7 +845,7 @@ $$` : `${e}$$`;
|
|
|
830
845
|
{
|
|
831
846
|
handler: {
|
|
832
847
|
name: "italicSingleUnderscore",
|
|
833
|
-
handle:
|
|
848
|
+
handle: dn,
|
|
834
849
|
priority: L.ITALIC_SINGLE_UNDERSCORE
|
|
835
850
|
},
|
|
836
851
|
optionKey: "italic"
|
|
@@ -838,7 +853,7 @@ $$` : `${e}$$`;
|
|
|
838
853
|
{
|
|
839
854
|
handler: {
|
|
840
855
|
name: "inlineCode",
|
|
841
|
-
handle:
|
|
856
|
+
handle: bn,
|
|
842
857
|
priority: L.INLINE_CODE
|
|
843
858
|
},
|
|
844
859
|
optionKey: "inlineCode"
|
|
@@ -846,7 +861,7 @@ $$` : `${e}$$`;
|
|
|
846
861
|
{
|
|
847
862
|
handler: {
|
|
848
863
|
name: "strikethrough",
|
|
849
|
-
handle:
|
|
864
|
+
handle: Vn,
|
|
850
865
|
priority: L.STRIKETHROUGH
|
|
851
866
|
},
|
|
852
867
|
optionKey: "strikethrough"
|
|
@@ -854,7 +869,7 @@ $$` : `${e}$$`;
|
|
|
854
869
|
{
|
|
855
870
|
handler: {
|
|
856
871
|
name: "katex",
|
|
857
|
-
handle:
|
|
872
|
+
handle: wn,
|
|
858
873
|
priority: L.KATEX
|
|
859
874
|
},
|
|
860
875
|
optionKey: "katex"
|
|
@@ -862,36 +877,36 @@ $$` : `${e}$$`;
|
|
|
862
877
|
{
|
|
863
878
|
handler: {
|
|
864
879
|
name: "inlineKatex",
|
|
865
|
-
handle:
|
|
880
|
+
handle: Tn,
|
|
866
881
|
priority: L.INLINE_KATEX
|
|
867
882
|
},
|
|
868
883
|
optionKey: "inlineKatex"
|
|
869
884
|
}
|
|
870
|
-
],
|
|
885
|
+
], Gn = (e) => {
|
|
871
886
|
let t = e?.linkMode ?? "protocol";
|
|
872
|
-
return
|
|
873
|
-
handler:
|
|
887
|
+
return Wn.filter(({ handler: t, optionKey: n }) => t.name === "links" ? Hn(e?.links) || Hn(e?.images) : t.name === "inlineKatex" ? Un(e?.inlineKatex) : Hn(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
|
|
888
|
+
handler: qe(Ke({}, e), { handle: (e) => Mn(e, t) }),
|
|
874
889
|
earlyReturn: t === "protocol" ? n : void 0
|
|
875
890
|
} : {
|
|
876
891
|
handler: e,
|
|
877
892
|
earlyReturn: n
|
|
878
893
|
});
|
|
879
|
-
},
|
|
894
|
+
}, Kn = (e, t) => {
|
|
880
895
|
if (!e || typeof e != "string") return e;
|
|
881
|
-
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r =
|
|
882
|
-
handler:
|
|
896
|
+
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = Gn(t), i = (t?.handlers ?? []).map((e) => ({
|
|
897
|
+
handler: qe(Ke({}, e), { priority: e.priority ?? L.DEFAULT }),
|
|
883
898
|
earlyReturn: void 0
|
|
884
899
|
})), a = [...r, ...i].sort((e, t) => (e.handler.priority ?? 0) - (t.handler.priority ?? 0));
|
|
885
900
|
try {
|
|
886
901
|
for (let { handler: e, earlyReturn: t } of a) if (n = e.handle(n), t != null && t(n)) return n;
|
|
887
902
|
return n.endsWith(" ") && !n.endsWith(" ") ? n.slice(0, -1) : n;
|
|
888
903
|
} finally {
|
|
889
|
-
|
|
904
|
+
ut();
|
|
890
905
|
}
|
|
891
906
|
};
|
|
892
907
|
//#endregion
|
|
893
908
|
//#region ../../node_modules/.pnpm/marked@18.1.0/node_modules/marked/lib/marked.esm.js
|
|
894
|
-
function
|
|
909
|
+
function qn() {
|
|
895
910
|
return {
|
|
896
911
|
async: !1,
|
|
897
912
|
breaks: !1,
|
|
@@ -905,12 +920,12 @@ function Wn() {
|
|
|
905
920
|
walkTokens: null
|
|
906
921
|
};
|
|
907
922
|
}
|
|
908
|
-
var
|
|
909
|
-
function
|
|
910
|
-
|
|
923
|
+
var Jn = qn();
|
|
924
|
+
function Yn(e) {
|
|
925
|
+
Jn = e;
|
|
911
926
|
}
|
|
912
|
-
var
|
|
913
|
-
function
|
|
927
|
+
var Xn = { exec: () => null };
|
|
928
|
+
function Zn(e) {
|
|
914
929
|
let t = [];
|
|
915
930
|
return (n) => {
|
|
916
931
|
let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
|
|
@@ -927,7 +942,7 @@ function R(e, t = "") {
|
|
|
927
942
|
};
|
|
928
943
|
return r;
|
|
929
944
|
}
|
|
930
|
-
var
|
|
945
|
+
var Qn = ((e = "") => {
|
|
931
946
|
try {
|
|
932
947
|
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
933
948
|
} catch {
|
|
@@ -987,111 +1002,111 @@ var Yn = ((e = "") => {
|
|
|
987
1002
|
notSpaceStart: /^\S*/,
|
|
988
1003
|
endingNewline: /\n$/,
|
|
989
1004
|
listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
990
|
-
nextBulletRegex:
|
|
991
|
-
hrRegex:
|
|
992
|
-
fencesBeginRegex:
|
|
993
|
-
headingBeginRegex:
|
|
994
|
-
htmlBeginRegex:
|
|
995
|
-
blockquoteBeginRegex:
|
|
996
|
-
},
|
|
997
|
-
blockquote: R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",
|
|
998
|
-
code:
|
|
999
|
-
def:
|
|
1000
|
-
fences:
|
|
1001
|
-
heading:
|
|
1002
|
-
hr:
|
|
1003
|
-
html:
|
|
1004
|
-
lheading:
|
|
1005
|
-
list:
|
|
1006
|
-
newline:
|
|
1007
|
-
paragraph:
|
|
1008
|
-
table:
|
|
1009
|
-
text:
|
|
1010
|
-
},
|
|
1011
|
-
...
|
|
1012
|
-
lheading:
|
|
1013
|
-
table:
|
|
1014
|
-
paragraph: R(
|
|
1015
|
-
},
|
|
1016
|
-
...
|
|
1017
|
-
html: R("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",
|
|
1005
|
+
nextBulletRegex: Zn((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
|
|
1006
|
+
hrRegex: Zn((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
|
|
1007
|
+
fencesBeginRegex: Zn((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
|
|
1008
|
+
headingBeginRegex: Zn((e) => RegExp(`^ {0,${e}}#`)),
|
|
1009
|
+
htmlBeginRegex: Zn((e) => RegExp(`^ {0,${e}}(?:</?(?:${pr})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
|
|
1010
|
+
blockquoteBeginRegex: Zn((e) => RegExp(`^ {0,${e}}>`))
|
|
1011
|
+
}, $n = /^(?:[ \t]*(?:\n|$))+/, er = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, tr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, nr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, rr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, ir = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ar = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, or = R(ar).replace(/bull/g, ir).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(), sr = R(ar).replace(/bull/g, ir).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(), cr = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, lr = /^[^\n]+/, ur = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, dr = R(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ur).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), fr = R(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, ir).getRegex(), pr = "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", mr = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, hr = 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", mr).replace("tag", pr).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), gr = (e) => R(cr).replace("hr", nr).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", pr).getRegex(), _r = gr(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), vr = gr(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), yr = {
|
|
1012
|
+
blockquote: R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", vr).getRegex(),
|
|
1013
|
+
code: er,
|
|
1014
|
+
def: dr,
|
|
1015
|
+
fences: tr,
|
|
1016
|
+
heading: rr,
|
|
1017
|
+
hr: nr,
|
|
1018
|
+
html: hr,
|
|
1019
|
+
lheading: or,
|
|
1020
|
+
list: fr,
|
|
1021
|
+
newline: $n,
|
|
1022
|
+
paragraph: _r,
|
|
1023
|
+
table: Xn,
|
|
1024
|
+
text: lr
|
|
1025
|
+
}, br = R("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", nr).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", pr).getRegex(), xr = {
|
|
1026
|
+
...yr,
|
|
1027
|
+
lheading: sr,
|
|
1028
|
+
table: br,
|
|
1029
|
+
paragraph: R(cr).replace("hr", nr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", br).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", pr).getRegex()
|
|
1030
|
+
}, Sr = {
|
|
1031
|
+
...yr,
|
|
1032
|
+
html: R("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", mr).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(),
|
|
1018
1033
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
1019
1034
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
1020
|
-
fences:
|
|
1035
|
+
fences: Xn,
|
|
1021
1036
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
1022
|
-
paragraph: R(
|
|
1023
|
-
},
|
|
1024
|
-
_backpedal:
|
|
1025
|
-
anyPunctuation:
|
|
1026
|
-
autolink:
|
|
1027
|
-
blockSkip:
|
|
1028
|
-
br:
|
|
1029
|
-
code:
|
|
1030
|
-
del:
|
|
1031
|
-
delLDelim:
|
|
1032
|
-
delRDelim:
|
|
1033
|
-
emStrongLDelim:
|
|
1034
|
-
emStrongRDelimAst:
|
|
1035
|
-
emStrongRDelimUnd:
|
|
1036
|
-
escape:
|
|
1037
|
-
link:
|
|
1038
|
-
nolink:
|
|
1039
|
-
punctuation:
|
|
1040
|
-
reflink:
|
|
1041
|
-
reflinkSearch:
|
|
1042
|
-
tag:
|
|
1043
|
-
text:
|
|
1044
|
-
url:
|
|
1045
|
-
}, ai = {
|
|
1046
|
-
...ii,
|
|
1047
|
-
emStrongLDelim: Fr,
|
|
1048
|
-
emStrongRDelimAst: zr,
|
|
1049
|
-
emStrongRDelimUnd: Vr,
|
|
1050
|
-
link: R(/^!?\[(label)\]\((.*?)\)/).replace("label", Yr).getRegex(),
|
|
1051
|
-
reflink: R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Yr).getRegex()
|
|
1052
|
-
}, oi = {
|
|
1053
|
-
...ii,
|
|
1054
|
-
emStrongRDelimAst: Rr,
|
|
1055
|
-
emStrongLDelim: Pr,
|
|
1056
|
-
delLDelim: Hr,
|
|
1057
|
-
delRDelim: Ur,
|
|
1058
|
-
url: R(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", ri).replace("protocol", ni).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
|
|
1059
|
-
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1060
|
-
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
1061
|
-
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", ni).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
|
|
1062
|
-
}, si = {
|
|
1063
|
-
...oi,
|
|
1064
|
-
br: R(Sr).replace("{2,}", "*").getRegex(),
|
|
1065
|
-
text: R(oi.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
1037
|
+
paragraph: R(cr).replace("hr", nr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", or).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
1038
|
+
}, Cr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, wr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Tr = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, Er = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, B = /[\p{P}\p{S}]/u, Dr = /[\s\p{P}\p{S}]/u, Or = /[^\s\p{P}\p{S}]/u, kr = R(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Dr).getRegex(), Ar = /[\p{Pi}\p{Ps}"']/u, jr = /(?!~)[\p{P}\p{S}]/u, Mr = /(?!~)[\s\p{P}\p{S}]/u, Nr = /(?:[^\s\p{P}\p{S}]|~)/u, Pr = R(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Qn ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Fr = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Ir = R(Fr, "u").replace(/punct/g, B).getRegex(), Lr = R(Fr, "u").replace(/punct/g, jr).getRegex(), Rr = R(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Ar).replace(/punct/g, B).getRegex(), zr = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Br = R(zr, "gu").replace(/notPunctSpace/g, Or).replace(/punctSpace/g, Dr).replace(/punct/g, B).getRegex(), Vr = R(zr, "gu").replace(/notPunctSpace/g, Nr).replace(/punctSpace/g, Mr).replace(/punct/g, jr).getRegex(), Hr = R("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Or).replace(/punctSpace/g, Dr).replace(/punct/g, B).getRegex(), Ur = R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Or).replace(/punctSpace/g, Dr).replace(/punct/g, B).getRegex(), Wr = R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Or).replace(/punctSpace/g, Dr).replace(/punct/g, B).getRegex(), Gr = R(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, B).getRegex(), Kr = R("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Or).replace(/punctSpace/g, Dr).replace(/punct/g, B).getRegex(), qr = R(/\\(punct)/, "gu").replace(/punct/g, B).getRegex(), Jr = 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(), Yr = R(mr).replace("(?:-->|$)", "-->").getRegex(), Xr = 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", Yr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Zr = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, Qr = R(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", Zr).getRegex(), $r = R(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", Qr).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ei = R(/^!?\[(label)\]\[(ref)\]/).replace("label", Qr).replace("ref", ur).getRegex(), ti = R(/^!?\[(ref)\](?:\[\])?/).replace("ref", ur).getRegex(), ni = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, ri = R(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", Zr).getRegex(), ii = R("reflink|nolink(?!\\()", "g").replace("reflink", R(/^!?\[(label)\]\[(ref)\]/).replace("label", ri).replace("ref", ni).getRegex()).replace("nolink", R(/^!?\[(ref)\](?:\[\])?/).replace("ref", ni).getRegex()).getRegex(), ai = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, oi = 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(), si = {
|
|
1039
|
+
_backpedal: Xn,
|
|
1040
|
+
anyPunctuation: qr,
|
|
1041
|
+
autolink: Jr,
|
|
1042
|
+
blockSkip: Pr,
|
|
1043
|
+
br: Tr,
|
|
1044
|
+
code: wr,
|
|
1045
|
+
del: Xn,
|
|
1046
|
+
delLDelim: Xn,
|
|
1047
|
+
delRDelim: Xn,
|
|
1048
|
+
emStrongLDelim: Ir,
|
|
1049
|
+
emStrongRDelimAst: Br,
|
|
1050
|
+
emStrongRDelimUnd: Ur,
|
|
1051
|
+
escape: Cr,
|
|
1052
|
+
link: $r,
|
|
1053
|
+
nolink: ti,
|
|
1054
|
+
punctuation: kr,
|
|
1055
|
+
reflink: ei,
|
|
1056
|
+
reflinkSearch: ii,
|
|
1057
|
+
tag: Xr,
|
|
1058
|
+
text: Er,
|
|
1059
|
+
url: Xn
|
|
1066
1060
|
}, ci = {
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1061
|
+
...si,
|
|
1062
|
+
emStrongLDelim: Rr,
|
|
1063
|
+
emStrongRDelimAst: Hr,
|
|
1064
|
+
emStrongRDelimUnd: Wr,
|
|
1065
|
+
link: R(/^!?\[(label)\]\((.*?)\)/).replace("label", Qr).getRegex(),
|
|
1066
|
+
reflink: R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Qr).getRegex()
|
|
1070
1067
|
}, li = {
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1068
|
+
...si,
|
|
1069
|
+
emStrongRDelimAst: Vr,
|
|
1070
|
+
emStrongLDelim: Lr,
|
|
1071
|
+
delLDelim: Gr,
|
|
1072
|
+
delRDelim: Kr,
|
|
1073
|
+
url: R(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", oi).replace("protocol", ai).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
|
|
1074
|
+
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1075
|
+
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
1076
|
+
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", ai).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
|
|
1075
1077
|
}, ui = {
|
|
1078
|
+
...li,
|
|
1079
|
+
br: R(Tr).replace("{2,}", "*").getRegex(),
|
|
1080
|
+
text: R(li.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
1081
|
+
}, di = {
|
|
1082
|
+
normal: yr,
|
|
1083
|
+
gfm: xr,
|
|
1084
|
+
pedantic: Sr
|
|
1085
|
+
}, fi = {
|
|
1086
|
+
normal: si,
|
|
1087
|
+
gfm: li,
|
|
1088
|
+
breaks: ui,
|
|
1089
|
+
pedantic: ci
|
|
1090
|
+
}, pi = {
|
|
1076
1091
|
"&": "&",
|
|
1077
1092
|
"<": "<",
|
|
1078
1093
|
">": ">",
|
|
1079
1094
|
"\"": """,
|
|
1080
1095
|
"'": "'"
|
|
1081
|
-
},
|
|
1096
|
+
}, mi = (e) => pi[e];
|
|
1082
1097
|
function V(e, t) {
|
|
1083
1098
|
if (t) {
|
|
1084
|
-
if (z.escapeTest.test(e)) return e.replace(z.escapeReplace,
|
|
1085
|
-
} else if (z.escapeTestNoEncode.test(e)) return e.replace(z.escapeReplaceNoEncode,
|
|
1099
|
+
if (z.escapeTest.test(e)) return e.replace(z.escapeReplace, mi);
|
|
1100
|
+
} else if (z.escapeTestNoEncode.test(e)) return e.replace(z.escapeReplaceNoEncode, mi);
|
|
1086
1101
|
return e;
|
|
1087
1102
|
}
|
|
1088
|
-
function
|
|
1103
|
+
function hi(e) {
|
|
1089
1104
|
return e.replace(z.numericCharacterReference, (e, t, n) => {
|
|
1090
1105
|
let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
|
|
1091
1106
|
return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : String.fromCodePoint(r);
|
|
1092
1107
|
});
|
|
1093
1108
|
}
|
|
1094
|
-
function
|
|
1109
|
+
function gi(e) {
|
|
1095
1110
|
try {
|
|
1096
1111
|
e = encodeURI(e).replace(z.percentDecode, "%");
|
|
1097
1112
|
} catch {
|
|
@@ -1099,7 +1114,7 @@ function pi(e) {
|
|
|
1099
1114
|
}
|
|
1100
1115
|
return e;
|
|
1101
1116
|
}
|
|
1102
|
-
function
|
|
1117
|
+
function _i(e, t) {
|
|
1103
1118
|
let n = e.replace(z.findPipe, (e, t, n) => {
|
|
1104
1119
|
let r = !1, i = t;
|
|
1105
1120
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
@@ -1112,7 +1127,7 @@ function mi(e, t) {
|
|
|
1112
1127
|
for (; r < n.length; r++) n[r] = n[r].trim().replace(z.slashPipe, "|");
|
|
1113
1128
|
return n;
|
|
1114
1129
|
}
|
|
1115
|
-
function
|
|
1130
|
+
function vi(e, t, n) {
|
|
1116
1131
|
let r = e.length;
|
|
1117
1132
|
if (r === 0) return "";
|
|
1118
1133
|
let i = 0;
|
|
@@ -1124,15 +1139,15 @@ function hi(e, t, n) {
|
|
|
1124
1139
|
}
|
|
1125
1140
|
return e.slice(0, r - i);
|
|
1126
1141
|
}
|
|
1127
|
-
function
|
|
1142
|
+
function yi(e) {
|
|
1128
1143
|
let t = e.split("\n"), n = t.length - 1;
|
|
1129
1144
|
for (; n >= 0 && z.blankLine.test(t[n]);) n--;
|
|
1130
1145
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
1131
1146
|
}
|
|
1132
|
-
function
|
|
1147
|
+
function bi(e) {
|
|
1133
1148
|
return e.trim().toLowerCase().toUpperCase().toLowerCase();
|
|
1134
1149
|
}
|
|
1135
|
-
function
|
|
1150
|
+
function xi(e, t) {
|
|
1136
1151
|
if (e.indexOf(t[0]) === -1 && e.indexOf(t[1]) === -1) return -1;
|
|
1137
1152
|
let n = 0;
|
|
1138
1153
|
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
@@ -1140,7 +1155,7 @@ function vi(e, t) {
|
|
|
1140
1155
|
else if (e[r] === t[1] && (n--, n < 0)) return r;
|
|
1141
1156
|
return n > 0 ? -2 : -1;
|
|
1142
1157
|
}
|
|
1143
|
-
function
|
|
1158
|
+
function Si(e, t = 0) {
|
|
1144
1159
|
let n = t, r = "";
|
|
1145
1160
|
for (let t of e) if (t === " ") {
|
|
1146
1161
|
let e = 4 - n % 4;
|
|
@@ -1148,7 +1163,7 @@ function yi(e, t = 0) {
|
|
|
1148
1163
|
} else r += t, n++;
|
|
1149
1164
|
return r;
|
|
1150
1165
|
}
|
|
1151
|
-
function
|
|
1166
|
+
function Ci(e, t, n, r, i) {
|
|
1152
1167
|
let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!";
|
|
1153
1168
|
r.state.inLink = !0;
|
|
1154
1169
|
let l = r.state.linkEmitted, u = r.state.inRawBlock;
|
|
@@ -1170,7 +1185,7 @@ function bi(e, t, n, r, i) {
|
|
|
1170
1185
|
tokens: d
|
|
1171
1186
|
};
|
|
1172
1187
|
}
|
|
1173
|
-
function
|
|
1188
|
+
function wi(e, t, n) {
|
|
1174
1189
|
let r = e.match(n.other.indentCodeCompensation);
|
|
1175
1190
|
if (r === null) return t;
|
|
1176
1191
|
let i = r[1];
|
|
@@ -1181,7 +1196,7 @@ function xi(e, t, n) {
|
|
|
1181
1196
|
return e.slice(Math.min(r.length, i.length));
|
|
1182
1197
|
}).join("\n");
|
|
1183
1198
|
}
|
|
1184
|
-
function
|
|
1199
|
+
function Ti(e, t, n, r) {
|
|
1185
1200
|
if (!t.includes("<")) return !1;
|
|
1186
1201
|
for (let i = 0; i < t.length; i++) {
|
|
1187
1202
|
if (t[i] === "\\") {
|
|
@@ -1204,12 +1219,12 @@ function Si(e, t, n, r) {
|
|
|
1204
1219
|
}
|
|
1205
1220
|
return !1;
|
|
1206
1221
|
}
|
|
1207
|
-
var
|
|
1222
|
+
var Ei = class {
|
|
1208
1223
|
options;
|
|
1209
1224
|
rules;
|
|
1210
1225
|
lexer;
|
|
1211
1226
|
constructor(e) {
|
|
1212
|
-
this.options = e ||
|
|
1227
|
+
this.options = e || Jn;
|
|
1213
1228
|
}
|
|
1214
1229
|
space(e) {
|
|
1215
1230
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -1221,7 +1236,7 @@ var Ci = class {
|
|
|
1221
1236
|
code(e) {
|
|
1222
1237
|
let t = this.rules.block.code.exec(e);
|
|
1223
1238
|
if (t) {
|
|
1224
|
-
let e = this.options.pedantic ? t[0] :
|
|
1239
|
+
let e = this.options.pedantic ? t[0] : yi(t[0]);
|
|
1225
1240
|
return {
|
|
1226
1241
|
type: "code",
|
|
1227
1242
|
raw: e,
|
|
@@ -1233,7 +1248,7 @@ var Ci = class {
|
|
|
1233
1248
|
fences(e) {
|
|
1234
1249
|
let t = this.rules.block.fences.exec(e);
|
|
1235
1250
|
if (t) {
|
|
1236
|
-
let e = t[0], n =
|
|
1251
|
+
let e = t[0], n = wi(e, t[3] || "", this.rules);
|
|
1237
1252
|
return {
|
|
1238
1253
|
type: "code",
|
|
1239
1254
|
raw: e,
|
|
@@ -1247,12 +1262,12 @@ var Ci = class {
|
|
|
1247
1262
|
if (t) {
|
|
1248
1263
|
let e = t[2].trim();
|
|
1249
1264
|
if (this.rules.other.endingHash.test(e)) {
|
|
1250
|
-
let t =
|
|
1265
|
+
let t = vi(e, "#");
|
|
1251
1266
|
(this.options.pedantic || !t || this.rules.other.endingSpaceTabChar.test(t)) && (e = t.trim());
|
|
1252
1267
|
}
|
|
1253
1268
|
return {
|
|
1254
1269
|
type: "heading",
|
|
1255
|
-
raw:
|
|
1270
|
+
raw: vi(t[0], "\n"),
|
|
1256
1271
|
depth: t[1].length,
|
|
1257
1272
|
text: e,
|
|
1258
1273
|
tokens: this.lexer.inline(e)
|
|
@@ -1263,13 +1278,13 @@ var Ci = class {
|
|
|
1263
1278
|
let t = this.rules.block.hr.exec(e);
|
|
1264
1279
|
if (t) return {
|
|
1265
1280
|
type: "hr",
|
|
1266
|
-
raw:
|
|
1281
|
+
raw: vi(t[0], "\n")
|
|
1267
1282
|
};
|
|
1268
1283
|
}
|
|
1269
1284
|
blockquote(e) {
|
|
1270
1285
|
let t = this.rules.block.blockquote.exec(e);
|
|
1271
1286
|
if (t) {
|
|
1272
|
-
let e =
|
|
1287
|
+
let e = vi(t[0], "\n").split("\n"), n = "", r = "", i = [];
|
|
1273
1288
|
for (; e.length > 0;) {
|
|
1274
1289
|
let t = !1, a = [], o = 0;
|
|
1275
1290
|
for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
|
|
@@ -1322,7 +1337,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1322
1337
|
let n = !1, r = "", s = "";
|
|
1323
1338
|
if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
1324
1339
|
r = t[0], e = e.substring(r.length);
|
|
1325
|
-
let c = t[2].split("\n", 1)[0], l = t[1].length, u = this.options.pedantic ?
|
|
1340
|
+
let c = t[2].split("\n", 1)[0], l = t[1].length, u = this.options.pedantic ? Si(c, l) : c.replace(this.rules.other.leadingSpaceTab, (e) => Si(e, l)), d = e.split("\n", 1)[0], f = !u.trim(), p = 0;
|
|
1326
1341
|
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) {
|
|
1327
1342
|
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);
|
|
1328
1343
|
for (; e;) {
|
|
@@ -1387,7 +1402,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1387
1402
|
html(e) {
|
|
1388
1403
|
let t = this.rules.block.html.exec(e);
|
|
1389
1404
|
if (t) {
|
|
1390
|
-
let e =
|
|
1405
|
+
let e = yi(t[0]);
|
|
1391
1406
|
return {
|
|
1392
1407
|
type: "html",
|
|
1393
1408
|
block: !0,
|
|
@@ -1400,12 +1415,12 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1400
1415
|
def(e) {
|
|
1401
1416
|
let t = this.rules.block.def.exec(e);
|
|
1402
1417
|
if (t) {
|
|
1403
|
-
if (!this.rules.other.startAngleBracket.test(t[2]) &&
|
|
1404
|
-
let e =
|
|
1418
|
+
if (!this.rules.other.startAngleBracket.test(t[2]) && xi(t[2], "()") !== -1) return;
|
|
1419
|
+
let e = bi(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];
|
|
1405
1420
|
return {
|
|
1406
1421
|
type: "def",
|
|
1407
1422
|
tag: e,
|
|
1408
|
-
raw:
|
|
1423
|
+
raw: vi(t[0], "\n"),
|
|
1409
1424
|
href: n,
|
|
1410
1425
|
title: r
|
|
1411
1426
|
};
|
|
@@ -1414,9 +1429,9 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1414
1429
|
table(e) {
|
|
1415
1430
|
let t = this.rules.block.table.exec(e);
|
|
1416
1431
|
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
1417
|
-
let n =
|
|
1432
|
+
let n = _i(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 = {
|
|
1418
1433
|
type: "table",
|
|
1419
|
-
raw:
|
|
1434
|
+
raw: vi(t[0], "\n"),
|
|
1420
1435
|
header: [],
|
|
1421
1436
|
align: [],
|
|
1422
1437
|
rows: []
|
|
@@ -1429,7 +1444,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1429
1444
|
header: !0,
|
|
1430
1445
|
align: a.align[e]
|
|
1431
1446
|
});
|
|
1432
|
-
for (let e of i) a.rows.push(
|
|
1447
|
+
for (let e of i) a.rows.push(_i(e, a.header.length).map((e, t) => ({
|
|
1433
1448
|
text: e,
|
|
1434
1449
|
tokens: this.lexer.inline(e),
|
|
1435
1450
|
header: !1,
|
|
@@ -1444,7 +1459,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1444
1459
|
let e = t[1].trim();
|
|
1445
1460
|
return {
|
|
1446
1461
|
type: "heading",
|
|
1447
|
-
raw:
|
|
1462
|
+
raw: vi(t[0], "\n"),
|
|
1448
1463
|
depth: t[2].charAt(0) === "=" ? 1 : 2,
|
|
1449
1464
|
text: e,
|
|
1450
1465
|
tokens: this.lexer.inline(e)
|
|
@@ -1496,14 +1511,14 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1496
1511
|
let t = this.rules.inline.link.exec(e);
|
|
1497
1512
|
if (t) {
|
|
1498
1513
|
let n = t[0].charAt(0) === "!" ? 2 : 1;
|
|
1499
|
-
if (!this.options.pedantic &&
|
|
1514
|
+
if (!this.options.pedantic && Ti(e, t[1], n, this.rules)) return;
|
|
1500
1515
|
let r = t[2].trim();
|
|
1501
1516
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
|
|
1502
1517
|
if (!this.rules.other.endAngleBracket.test(r)) return;
|
|
1503
|
-
let e =
|
|
1518
|
+
let e = vi(r.slice(0, -1), "\\");
|
|
1504
1519
|
if ((r.length - e.length) % 2 == 0) return;
|
|
1505
1520
|
} else {
|
|
1506
|
-
let e =
|
|
1521
|
+
let e = xi(t[2], "()");
|
|
1507
1522
|
if (e === -2) return;
|
|
1508
1523
|
if (e > -1) {
|
|
1509
1524
|
let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
|
|
@@ -1515,7 +1530,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1515
1530
|
let e = this.rules.other.pedanticHrefTitle.exec(i);
|
|
1516
1531
|
e && (i = e[1], a = e[3]);
|
|
1517
1532
|
} else a = t[3] ? t[3].slice(1, -1) : "";
|
|
1518
|
-
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)),
|
|
1533
|
+
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)), Ci(t, {
|
|
1519
1534
|
href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
1520
1535
|
title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
|
|
1521
1536
|
}, t[0], this.lexer, this.rules);
|
|
@@ -1525,8 +1540,8 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1525
1540
|
let n;
|
|
1526
1541
|
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
1527
1542
|
let r = n[0].charAt(0) === "!" ? 2 : 1;
|
|
1528
|
-
if (!this.options.pedantic &&
|
|
1529
|
-
let i = t[
|
|
1543
|
+
if (!this.options.pedantic && Ti(e, n[1], r, this.rules)) return;
|
|
1544
|
+
let i = t[bi((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
|
|
1530
1545
|
if (!i) {
|
|
1531
1546
|
let e = n[0].charAt(0);
|
|
1532
1547
|
return {
|
|
@@ -1535,7 +1550,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1535
1550
|
text: e
|
|
1536
1551
|
};
|
|
1537
1552
|
}
|
|
1538
|
-
return
|
|
1553
|
+
return Ci(n, i, n[0], this.lexer, this.rules);
|
|
1539
1554
|
}
|
|
1540
1555
|
}
|
|
1541
1556
|
emStrong(e, t, n = "") {
|
|
@@ -1668,7 +1683,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1668
1683
|
return {
|
|
1669
1684
|
type: "text",
|
|
1670
1685
|
raw: t[0],
|
|
1671
|
-
text: e ? t[0] :
|
|
1686
|
+
text: e ? t[0] : hi(t[0]),
|
|
1672
1687
|
escaped: e
|
|
1673
1688
|
};
|
|
1674
1689
|
}
|
|
@@ -1680,7 +1695,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1680
1695
|
inlineQueue;
|
|
1681
1696
|
tokenizer;
|
|
1682
1697
|
constructor(e) {
|
|
1683
|
-
this.tokens = [], this.tokens.links = Object.create(null), this.options = e ||
|
|
1698
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || Jn, this.options.tokenizer = this.options.tokenizer || new Ei(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
1684
1699
|
inLink: !1,
|
|
1685
1700
|
inRawBlock: !1,
|
|
1686
1701
|
linkEmitted: !1,
|
|
@@ -1689,15 +1704,15 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1689
1704
|
};
|
|
1690
1705
|
let t = {
|
|
1691
1706
|
other: z,
|
|
1692
|
-
block:
|
|
1693
|
-
inline:
|
|
1707
|
+
block: di.normal,
|
|
1708
|
+
inline: fi.normal
|
|
1694
1709
|
};
|
|
1695
|
-
this.options.pedantic ? (t.block =
|
|
1710
|
+
this.options.pedantic ? (t.block = di.pedantic, t.inline = fi.pedantic) : this.options.gfm && (t.block = di.gfm, t.inline = this.options.breaks ? fi.breaks : fi.gfm), this.tokenizer.rules = t;
|
|
1696
1711
|
}
|
|
1697
1712
|
static get rules() {
|
|
1698
1713
|
return {
|
|
1699
|
-
block:
|
|
1700
|
-
inline:
|
|
1714
|
+
block: di,
|
|
1715
|
+
inline: fi
|
|
1701
1716
|
};
|
|
1702
1717
|
}
|
|
1703
1718
|
static lex(t, n) {
|
|
@@ -1787,7 +1802,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1787
1802
|
for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
|
|
1788
1803
|
for (let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
|
|
1789
1804
|
let e = t[0], n = e.lastIndexOf("[");
|
|
1790
|
-
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links,
|
|
1805
|
+
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, bi(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
|
|
1791
1806
|
}
|
|
1792
1807
|
return !1;
|
|
1793
1808
|
}
|
|
@@ -1806,7 +1821,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1806
1821
|
if (this.tokens.links && e.includes("[")) {
|
|
1807
1822
|
let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
|
|
1808
1823
|
let r = n.lastIndexOf("[");
|
|
1809
|
-
if (!Object.hasOwn(this.tokens.links,
|
|
1824
|
+
if (!Object.hasOwn(this.tokens.links, bi(n.slice(r + 1, -1)))) return n;
|
|
1810
1825
|
if (r > 1 && n.charAt(0) !== "!") {
|
|
1811
1826
|
let i = n.slice(1, r - 1);
|
|
1812
1827
|
if (this.linkInText(i)) return "[" + i.replace(e, t) + "][" + "a".repeat(n.length - r - 2) + "]";
|
|
@@ -1866,11 +1881,11 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1866
1881
|
if (this.options.silent) console.error(t);
|
|
1867
1882
|
else throw Error(t);
|
|
1868
1883
|
}
|
|
1869
|
-
},
|
|
1884
|
+
}, Di = class {
|
|
1870
1885
|
options;
|
|
1871
1886
|
parser;
|
|
1872
1887
|
constructor(e) {
|
|
1873
|
-
this.options = e ||
|
|
1888
|
+
this.options = e || Jn;
|
|
1874
1889
|
}
|
|
1875
1890
|
space(e) {
|
|
1876
1891
|
return "";
|
|
@@ -1956,7 +1971,7 @@ ${e}</tr>
|
|
|
1956
1971
|
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
1957
1972
|
}
|
|
1958
1973
|
link({ href: e, title: t, text: n, tokens: r, autolink: i }) {
|
|
1959
|
-
let a = i ? V(n, !0) : this.parser.parseInline(r), o =
|
|
1974
|
+
let a = i ? V(n, !0) : this.parser.parseInline(r), o = gi(e);
|
|
1960
1975
|
if (o === null) return a;
|
|
1961
1976
|
e = V(o, i);
|
|
1962
1977
|
let s = "<a href=\"" + e + "\"";
|
|
@@ -1964,7 +1979,7 @@ ${e}</tr>
|
|
|
1964
1979
|
}
|
|
1965
1980
|
image({ href: e, title: t, text: n, tokens: r }) {
|
|
1966
1981
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
1967
|
-
let i =
|
|
1982
|
+
let i = gi(e);
|
|
1968
1983
|
if (i === null) return V(n);
|
|
1969
1984
|
e = i;
|
|
1970
1985
|
let a = `<img src="${V(e)}" alt="${V(n)}"`;
|
|
@@ -1973,7 +1988,7 @@ ${e}</tr>
|
|
|
1973
1988
|
text(e) {
|
|
1974
1989
|
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : V(e.text);
|
|
1975
1990
|
}
|
|
1976
|
-
},
|
|
1991
|
+
}, Oi = class {
|
|
1977
1992
|
strong({ text: e }) {
|
|
1978
1993
|
return e;
|
|
1979
1994
|
}
|
|
@@ -2009,7 +2024,7 @@ ${e}</tr>
|
|
|
2009
2024
|
renderer;
|
|
2010
2025
|
textRenderer;
|
|
2011
2026
|
constructor(e) {
|
|
2012
|
-
this.options = e ||
|
|
2027
|
+
this.options = e || Jn, this.options.renderer = this.options.renderer || new Di(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Oi();
|
|
2013
2028
|
}
|
|
2014
2029
|
static parse(t, n) {
|
|
2015
2030
|
return new e(n).parse(t);
|
|
@@ -2157,11 +2172,11 @@ ${e}</tr>
|
|
|
2157
2172
|
}
|
|
2158
2173
|
return n;
|
|
2159
2174
|
}
|
|
2160
|
-
},
|
|
2175
|
+
}, ki = class {
|
|
2161
2176
|
options;
|
|
2162
2177
|
block;
|
|
2163
2178
|
constructor(e) {
|
|
2164
|
-
this.options = e ||
|
|
2179
|
+
this.options = e || Jn;
|
|
2165
2180
|
}
|
|
2166
2181
|
static passThroughHooks = /* @__PURE__ */ new Set([
|
|
2167
2182
|
"preprocess",
|
|
@@ -2192,17 +2207,17 @@ ${e}</tr>
|
|
|
2192
2207
|
provideParser(e = this.block) {
|
|
2193
2208
|
return e ? U.parse : U.parseInline;
|
|
2194
2209
|
}
|
|
2195
|
-
},
|
|
2196
|
-
defaults =
|
|
2210
|
+
}, Ai = new class {
|
|
2211
|
+
defaults = qn();
|
|
2197
2212
|
options = this.setOptions;
|
|
2198
2213
|
parse = this.parseMarkdown(!0);
|
|
2199
2214
|
parseInline = this.parseMarkdown(!1);
|
|
2200
2215
|
Parser = U;
|
|
2201
|
-
Renderer =
|
|
2202
|
-
TextRenderer =
|
|
2216
|
+
Renderer = Di;
|
|
2217
|
+
TextRenderer = Oi;
|
|
2203
2218
|
Lexer = H;
|
|
2204
|
-
Tokenizer =
|
|
2205
|
-
Hooks =
|
|
2219
|
+
Tokenizer = Ei;
|
|
2220
|
+
Hooks = ki;
|
|
2206
2221
|
constructor(...e) {
|
|
2207
2222
|
this.use(...e);
|
|
2208
2223
|
}
|
|
@@ -2253,7 +2268,7 @@ ${e}</tr>
|
|
|
2253
2268
|
}
|
|
2254
2269
|
"childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
|
|
2255
2270
|
}), n.extensions = t), e.renderer) {
|
|
2256
|
-
let t = this.defaults.renderer || new
|
|
2271
|
+
let t = this.defaults.renderer || new Di(this.defaults);
|
|
2257
2272
|
for (let n in e.renderer) {
|
|
2258
2273
|
if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
|
|
2259
2274
|
if (["options", "parser"].includes(n)) continue;
|
|
@@ -2266,7 +2281,7 @@ ${e}</tr>
|
|
|
2266
2281
|
n.renderer = t;
|
|
2267
2282
|
}
|
|
2268
2283
|
if (e.tokenizer) {
|
|
2269
|
-
let t = this.defaults.tokenizer || new
|
|
2284
|
+
let t = this.defaults.tokenizer || new Ei(this.defaults);
|
|
2270
2285
|
for (let n in e.tokenizer) {
|
|
2271
2286
|
if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
|
|
2272
2287
|
if ([
|
|
@@ -2283,13 +2298,13 @@ ${e}</tr>
|
|
|
2283
2298
|
n.tokenizer = t;
|
|
2284
2299
|
}
|
|
2285
2300
|
if (e.hooks) {
|
|
2286
|
-
let t = this.defaults.hooks || new
|
|
2301
|
+
let t = this.defaults.hooks || new ki();
|
|
2287
2302
|
for (let n in e.hooks) {
|
|
2288
2303
|
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
2289
2304
|
if (["options", "block"].includes(n)) continue;
|
|
2290
2305
|
let r = n, i = e.hooks[r], a = t[r];
|
|
2291
|
-
t[r] =
|
|
2292
|
-
if (this.defaults.async &&
|
|
2306
|
+
t[r] = ki.passThroughHooks.has(n) ? (e) => {
|
|
2307
|
+
if (this.defaults.async && ki.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
2293
2308
|
let n = await i.call(t, e);
|
|
2294
2309
|
return a.call(t, n);
|
|
2295
2310
|
})();
|
|
@@ -2369,31 +2384,31 @@ ${e}</tr>
|
|
|
2369
2384
|
}
|
|
2370
2385
|
}();
|
|
2371
2386
|
function W(e, t) {
|
|
2372
|
-
return
|
|
2387
|
+
return Ai.parse(e, t);
|
|
2373
2388
|
}
|
|
2374
2389
|
W.options = W.setOptions = function(e) {
|
|
2375
|
-
return
|
|
2376
|
-
}, W.getDefaults =
|
|
2377
|
-
function
|
|
2378
|
-
return
|
|
2379
|
-
}
|
|
2380
|
-
W.use =
|
|
2381
|
-
return
|
|
2382
|
-
}, W.parseInline =
|
|
2390
|
+
return Ai.setOptions(e), W.defaults = Ai.defaults, Yn(W.defaults), W;
|
|
2391
|
+
}, W.getDefaults = qn, W.defaults = Jn;
|
|
2392
|
+
function ji(...e) {
|
|
2393
|
+
return Ai.use(...e), W.defaults = Ai.defaults, Yn(W.defaults), W;
|
|
2394
|
+
}
|
|
2395
|
+
W.use = ji, W.walkTokens = function(e, t) {
|
|
2396
|
+
return Ai.walkTokens(e, t);
|
|
2397
|
+
}, W.parseInline = Ai.parseInline, W.Parser = U, W.parser = U.parse, W.Renderer = Di, W.TextRenderer = Oi, W.Lexer = H, W.lexer = H.lex, W.Tokenizer = Ei, W.Hooks = ki, W.parse = W, W.options, W.setOptions, W.walkTokens, W.parseInline, U.parse, H.lex;
|
|
2383
2398
|
//#endregion
|
|
2384
2399
|
//#region ../../node_modules/.pnpm/dompurify@3.4.16/node_modules/dompurify/dist/purify.es.mjs
|
|
2385
|
-
function
|
|
2400
|
+
function Mi(e, t) {
|
|
2386
2401
|
this.v = e, this.k = t;
|
|
2387
2402
|
}
|
|
2388
|
-
function
|
|
2403
|
+
function Ni(e, t) {
|
|
2389
2404
|
(t == null || t > e.length) && (t = e.length);
|
|
2390
2405
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
2391
2406
|
return r;
|
|
2392
2407
|
}
|
|
2393
|
-
function
|
|
2408
|
+
function Pi(e) {
|
|
2394
2409
|
if (Array.isArray(e)) return e;
|
|
2395
2410
|
}
|
|
2396
|
-
function
|
|
2411
|
+
function Fi(e, t) {
|
|
2397
2412
|
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
2398
2413
|
if (n != null) {
|
|
2399
2414
|
var r, i, a, o, s = [], c = !0, l = !1;
|
|
@@ -2414,24 +2429,24 @@ function Mi(e, t) {
|
|
|
2414
2429
|
return s;
|
|
2415
2430
|
}
|
|
2416
2431
|
}
|
|
2417
|
-
function
|
|
2432
|
+
function Ii() {
|
|
2418
2433
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2419
2434
|
}
|
|
2420
|
-
function
|
|
2421
|
-
return
|
|
2435
|
+
function Li(e, t) {
|
|
2436
|
+
return Pi(e) || Fi(e, t) || Ri(e, t) || Ii();
|
|
2422
2437
|
}
|
|
2423
|
-
function
|
|
2438
|
+
function Ri(e, t) {
|
|
2424
2439
|
if (e) {
|
|
2425
|
-
if (typeof e == "string") return
|
|
2440
|
+
if (typeof e == "string") return Ni(e, t);
|
|
2426
2441
|
var n = {}.toString.call(e).slice(8, -1);
|
|
2427
|
-
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) ?
|
|
2442
|
+
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) ? Ni(e, t) : void 0;
|
|
2428
2443
|
}
|
|
2429
2444
|
}
|
|
2430
|
-
function
|
|
2445
|
+
function zi(e) {
|
|
2431
2446
|
var t, n;
|
|
2432
2447
|
function r(t, n) {
|
|
2433
2448
|
try {
|
|
2434
|
-
var a = e[t](n), o = a.value, s = o instanceof
|
|
2449
|
+
var a = e[t](n), o = a.value, s = o instanceof Mi;
|
|
2435
2450
|
Promise.resolve(s ? o.v : o).then(function(n) {
|
|
2436
2451
|
if (s) {
|
|
2437
2452
|
var c = t === "return" && o.k ? t : "next";
|
|
@@ -2465,113 +2480,113 @@ function Ii(e) {
|
|
|
2465
2480
|
});
|
|
2466
2481
|
}, typeof e.return != "function" && (this.return = void 0);
|
|
2467
2482
|
}
|
|
2468
|
-
|
|
2483
|
+
zi.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
|
|
2469
2484
|
return this;
|
|
2470
|
-
},
|
|
2485
|
+
}, zi.prototype.next = function(e) {
|
|
2471
2486
|
return this._invoke("next", e);
|
|
2472
|
-
},
|
|
2487
|
+
}, zi.prototype.throw = function(e) {
|
|
2473
2488
|
return this._invoke("throw", e);
|
|
2474
|
-
},
|
|
2489
|
+
}, zi.prototype.return = function(e) {
|
|
2475
2490
|
return this._invoke("return", e);
|
|
2476
2491
|
};
|
|
2477
|
-
var
|
|
2492
|
+
var Bi = Object.entries, Vi = Object.setPrototypeOf, Hi = Object.isFrozen, Ui = Object.getPrototypeOf, Wi = Object.getOwnPropertyDescriptor, G = Object.freeze, K = Object.seal, Gi = Object.create, Ki = typeof Reflect < "u" && Reflect, qi = Ki.apply, Ji = Ki.construct;
|
|
2478
2493
|
G ||= function(e) {
|
|
2479
2494
|
return e;
|
|
2480
2495
|
}, K ||= function(e) {
|
|
2481
2496
|
return e;
|
|
2482
|
-
},
|
|
2497
|
+
}, qi ||= function(e, t) {
|
|
2483
2498
|
var n = [...arguments].slice(2);
|
|
2484
2499
|
return e.apply(t, n);
|
|
2485
|
-
},
|
|
2500
|
+
}, Ji ||= function(e) {
|
|
2486
2501
|
return new e(...[...arguments].slice(1));
|
|
2487
2502
|
};
|
|
2488
|
-
var
|
|
2503
|
+
var Yi = Y(Array.prototype.forEach);
|
|
2489
2504
|
Array.prototype.indexOf;
|
|
2490
|
-
var
|
|
2505
|
+
var Xi = Y(Array.prototype.lastIndexOf), Zi = Y(Array.prototype.pop), Qi = Y(Array.prototype.push);
|
|
2491
2506
|
Array.prototype.slice;
|
|
2492
|
-
var
|
|
2507
|
+
var $i = Y(Array.prototype.splice), ea = Array.isArray, ta = Y(String.prototype.toLowerCase), na = Y(String.prototype.toString), ra = Y(String.prototype.match), ia = Y(String.prototype.replace), aa = Y(String.prototype.indexOf), oa = Y(String.prototype.trim), sa = Y(Number.prototype.toString), ca = Y(Boolean.prototype.toString), la = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), ua = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), da = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), fa = pa(TypeError);
|
|
2493
2508
|
function Y(e) {
|
|
2494
2509
|
return function(t) {
|
|
2495
2510
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
2496
2511
|
var n = [...arguments].slice(1);
|
|
2497
|
-
return
|
|
2512
|
+
return qi(e, t, n);
|
|
2498
2513
|
};
|
|
2499
2514
|
}
|
|
2500
|
-
function
|
|
2515
|
+
function pa(e) {
|
|
2501
2516
|
return function() {
|
|
2502
|
-
return
|
|
2517
|
+
return Ji(e, [...arguments]);
|
|
2503
2518
|
};
|
|
2504
2519
|
}
|
|
2505
2520
|
function X(e, t) {
|
|
2506
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
2507
|
-
if (
|
|
2521
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ta;
|
|
2522
|
+
if (Vi && Vi(e, null), !ea(t)) return e;
|
|
2508
2523
|
let r = t.length;
|
|
2509
2524
|
for (; r--;) {
|
|
2510
2525
|
let i = t[r];
|
|
2511
2526
|
if (typeof i == "string") {
|
|
2512
2527
|
let e = n(i);
|
|
2513
|
-
e !== i && (
|
|
2528
|
+
e !== i && (Hi(t) || (t[r] = e), i = e);
|
|
2514
2529
|
}
|
|
2515
2530
|
e[i] = !0;
|
|
2516
2531
|
}
|
|
2517
2532
|
return e;
|
|
2518
2533
|
}
|
|
2519
|
-
function
|
|
2534
|
+
function ma(e) {
|
|
2520
2535
|
for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
|
|
2521
2536
|
return e;
|
|
2522
2537
|
}
|
|
2523
2538
|
function Z(e) {
|
|
2524
|
-
let t =
|
|
2525
|
-
for (let r of
|
|
2526
|
-
var n =
|
|
2539
|
+
let t = Gi(null);
|
|
2540
|
+
for (let r of Bi(e)) {
|
|
2541
|
+
var n = Li(r, 2);
|
|
2527
2542
|
let i = n[0], a = n[1];
|
|
2528
|
-
q(e, i) && (t[i] =
|
|
2543
|
+
q(e, i) && (t[i] = ea(a) ? ma(a) : a && typeof a == "object" && a.constructor === Object ? Z(a) : a);
|
|
2529
2544
|
}
|
|
2530
2545
|
return t;
|
|
2531
2546
|
}
|
|
2532
|
-
function
|
|
2547
|
+
function ha(e) {
|
|
2533
2548
|
switch (typeof e) {
|
|
2534
2549
|
case "string": return e;
|
|
2535
|
-
case "number": return
|
|
2536
|
-
case "boolean": return
|
|
2537
|
-
case "bigint": return
|
|
2538
|
-
case "symbol": return
|
|
2539
|
-
case "undefined": return
|
|
2550
|
+
case "number": return sa(e);
|
|
2551
|
+
case "boolean": return ca(e);
|
|
2552
|
+
case "bigint": return la ? la(e) : "0";
|
|
2553
|
+
case "symbol": return ua ? ua(e) : "Symbol()";
|
|
2554
|
+
case "undefined": return da(e);
|
|
2540
2555
|
case "function":
|
|
2541
2556
|
case "object": {
|
|
2542
|
-
if (e === null) return
|
|
2557
|
+
if (e === null) return da(e);
|
|
2543
2558
|
let t = e, n = Q(t, "toString");
|
|
2544
2559
|
if (typeof n == "function") {
|
|
2545
2560
|
let e = n(t);
|
|
2546
|
-
return typeof e == "string" ? e :
|
|
2561
|
+
return typeof e == "string" ? e : da(e);
|
|
2547
2562
|
}
|
|
2548
|
-
return
|
|
2563
|
+
return da(e);
|
|
2549
2564
|
}
|
|
2550
|
-
default: return
|
|
2565
|
+
default: return da(e);
|
|
2551
2566
|
}
|
|
2552
2567
|
}
|
|
2553
2568
|
function Q(e, t) {
|
|
2554
2569
|
for (; e !== null;) {
|
|
2555
|
-
let n =
|
|
2570
|
+
let n = Wi(e, t);
|
|
2556
2571
|
if (n) {
|
|
2557
2572
|
if (n.get) return Y(n.get);
|
|
2558
2573
|
if (typeof n.value == "function") return Y(n.value);
|
|
2559
2574
|
}
|
|
2560
|
-
e =
|
|
2575
|
+
e = Ui(e);
|
|
2561
2576
|
}
|
|
2562
2577
|
function n() {
|
|
2563
2578
|
return null;
|
|
2564
2579
|
}
|
|
2565
2580
|
return n;
|
|
2566
2581
|
}
|
|
2567
|
-
function
|
|
2582
|
+
function ga(e) {
|
|
2568
2583
|
try {
|
|
2569
2584
|
return J(e, ""), !0;
|
|
2570
2585
|
} catch {
|
|
2571
2586
|
return !1;
|
|
2572
2587
|
}
|
|
2573
2588
|
}
|
|
2574
|
-
var
|
|
2589
|
+
var _a = 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(".")), va = 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(".")), ya = G([
|
|
2575
2590
|
"feBlend",
|
|
2576
2591
|
"feColorMatrix",
|
|
2577
2592
|
"feComponentTransfer",
|
|
@@ -2597,7 +2612,7 @@ var ma = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2597
2612
|
"feSpotLight",
|
|
2598
2613
|
"feTile",
|
|
2599
2614
|
"feTurbulence"
|
|
2600
|
-
]),
|
|
2615
|
+
]), ba = G([
|
|
2601
2616
|
"animate",
|
|
2602
2617
|
"color-profile",
|
|
2603
2618
|
"cursor",
|
|
@@ -2620,7 +2635,7 @@ var ma = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2620
2635
|
"solidcolor",
|
|
2621
2636
|
"unknown",
|
|
2622
2637
|
"use"
|
|
2623
|
-
]),
|
|
2638
|
+
]), xa = 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(".")), Sa = G([
|
|
2624
2639
|
"maction",
|
|
2625
2640
|
"maligngroup",
|
|
2626
2641
|
"malignmark",
|
|
@@ -2636,13 +2651,13 @@ var ma = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2636
2651
|
"annotation-xml",
|
|
2637
2652
|
"mprescripts",
|
|
2638
2653
|
"none"
|
|
2639
|
-
]),
|
|
2654
|
+
]), Ca = G(["#text"]), wa = 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(".")), Ta = 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(".")), Ea = 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(".")), Da = G([
|
|
2640
2655
|
"xlink:href",
|
|
2641
2656
|
"xml:id",
|
|
2642
2657
|
"xlink:title",
|
|
2643
2658
|
"xml:space",
|
|
2644
2659
|
"xmlns:xlink"
|
|
2645
|
-
]),
|
|
2660
|
+
]), Oa = K(/{{[\w\W]*|^[\w\W]*}}/g), ka = K(/<%[\w\W]*|^[\w\W]*%>/g), Aa = K(/\${[\w\W]*/g), ja = K(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ma = K(/^aria-[\-\w]+$/), Na = K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Pa = K(/^(?:\w+script|data):/i), Fa = K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Ia = K(/^html$/i), La = K(/^[a-z][.\w]*(-[.\w]+)+$/i), Ra = K(/<[/\w!]/g), za = K(/<[/\w]/g), Ba = K(/<\/no(script|embed|frames)/i), Va = K(/\/>/i), $ = {
|
|
2646
2661
|
element: 1,
|
|
2647
2662
|
attribute: 2,
|
|
2648
2663
|
text: 3,
|
|
@@ -2655,7 +2670,7 @@ var ma = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2655
2670
|
documentType: 10,
|
|
2656
2671
|
documentFragment: 11,
|
|
2657
2672
|
notation: 12
|
|
2658
|
-
},
|
|
2673
|
+
}, Ha = [
|
|
2659
2674
|
"style",
|
|
2660
2675
|
"script",
|
|
2661
2676
|
"xmp",
|
|
@@ -2664,14 +2679,14 @@ var ma = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2664
2679
|
"noframes",
|
|
2665
2680
|
"plaintext",
|
|
2666
2681
|
"noscript"
|
|
2667
|
-
],
|
|
2682
|
+
], Ua = G(X({}, Ha)), Wa = function() {
|
|
2668
2683
|
let e = {};
|
|
2669
|
-
return
|
|
2684
|
+
return Yi(Ha, (t) => {
|
|
2670
2685
|
e[t] = K(RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
2671
2686
|
}), G(e);
|
|
2672
|
-
}(),
|
|
2687
|
+
}(), Ga = function() {
|
|
2673
2688
|
return typeof window > "u" ? null : window;
|
|
2674
|
-
},
|
|
2689
|
+
}, Ka = function(e, t) {
|
|
2675
2690
|
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
2676
2691
|
let n = null, r = "data-tt-policy-suffix";
|
|
2677
2692
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
@@ -2688,7 +2703,7 @@ var ma = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2688
2703
|
} catch {
|
|
2689
2704
|
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
2690
2705
|
}
|
|
2691
|
-
},
|
|
2706
|
+
}, qa = function() {
|
|
2692
2707
|
return {
|
|
2693
2708
|
afterSanitizeAttributes: [],
|
|
2694
2709
|
afterSanitizeElements: [],
|
|
@@ -2700,14 +2715,14 @@ var ma = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2700
2715
|
uponSanitizeElement: [],
|
|
2701
2716
|
uponSanitizeShadowNode: []
|
|
2702
2717
|
};
|
|
2703
|
-
},
|
|
2704
|
-
return q(e, t) &&
|
|
2705
|
-
},
|
|
2718
|
+
}, Ja = function(e, t, n, r) {
|
|
2719
|
+
return q(e, t) && ea(e[t]) ? X(r.base ? Z(r.base) : {}, e[t], r.transform) : n;
|
|
2720
|
+
}, Ya = function(e, t, n) {
|
|
2706
2721
|
let r = q(e, t) ? e[t] : void 0;
|
|
2707
2722
|
return r && typeof r == "object" ? Z(r) : n();
|
|
2708
2723
|
};
|
|
2709
|
-
function
|
|
2710
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
2724
|
+
function Xa() {
|
|
2725
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ga(), t = (e) => Xa(e);
|
|
2711
2726
|
if (t.version = "3.4.16", t.removed = [], !e || !e.document || e.document.nodeType !== $.document || !e.Element) return t.isSupported = !1, t;
|
|
2712
2727
|
let n = e.document, r = n, i = r.currentScript;
|
|
2713
2728
|
e.DocumentFragment;
|
|
@@ -2722,38 +2737,38 @@ function qa() {
|
|
|
2722
2737
|
let e = n.createElement("template");
|
|
2723
2738
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
2724
2739
|
}
|
|
2725
|
-
let h, g = "",
|
|
2726
|
-
if (
|
|
2740
|
+
let h, g = "", _, ue = !1, de = 0, fe = function() {
|
|
2741
|
+
if (de > 0) throw fa("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.");
|
|
2727
2742
|
}, pe = function(e) {
|
|
2728
|
-
fe(),
|
|
2743
|
+
fe(), de++;
|
|
2729
2744
|
try {
|
|
2730
2745
|
return h.createHTML(e);
|
|
2731
2746
|
} finally {
|
|
2732
|
-
|
|
2747
|
+
de--;
|
|
2733
2748
|
}
|
|
2734
2749
|
}, me = function(e) {
|
|
2735
|
-
fe(),
|
|
2750
|
+
fe(), de++;
|
|
2736
2751
|
try {
|
|
2737
2752
|
return h.createScriptURL(e);
|
|
2738
2753
|
} finally {
|
|
2739
|
-
|
|
2754
|
+
de--;
|
|
2740
2755
|
}
|
|
2741
2756
|
}, he = function() {
|
|
2742
|
-
return
|
|
2743
|
-
}, ge = n, v = ge.implementation, _e = ge.createNodeIterator, ve = ge.createDocumentFragment, ye = ge.getElementsByTagName, be = r.importNode, y =
|
|
2744
|
-
t.isSupported = typeof
|
|
2745
|
-
let xe =
|
|
2746
|
-
...
|
|
2747
|
-
...ha,
|
|
2748
|
-
...ga,
|
|
2757
|
+
return ue ||= (_ = Ka(u, i), !0), _;
|
|
2758
|
+
}, ge = n, v = ge.implementation, _e = ge.createNodeIterator, ve = ge.createDocumentFragment, ye = ge.getElementsByTagName, be = r.importNode, y = qa();
|
|
2759
|
+
t.isSupported = typeof Bi == "function" && typeof re == "function" && v && v.createHTMLDocument !== void 0;
|
|
2760
|
+
let xe = Oa, Se = ka, Ce = Aa, we = ja, Te = Ma, Ee = Pa, De = Fa, Oe = La, ke = Na, b = null, Ae = X({}, [
|
|
2761
|
+
..._a,
|
|
2749
2762
|
...va,
|
|
2750
|
-
...
|
|
2751
|
-
]), S = null, Ae = X({}, [
|
|
2763
|
+
...ya,
|
|
2752
2764
|
...xa,
|
|
2753
|
-
...
|
|
2754
|
-
|
|
2755
|
-
...wa
|
|
2756
|
-
|
|
2765
|
+
...Ca
|
|
2766
|
+
]), x = null, je = X({}, [
|
|
2767
|
+
...wa,
|
|
2768
|
+
...Ta,
|
|
2769
|
+
...Ea,
|
|
2770
|
+
...Da
|
|
2771
|
+
]), S = Object.seal(Gi(null, {
|
|
2757
2772
|
tagNameCheck: {
|
|
2758
2773
|
writable: !0,
|
|
2759
2774
|
configurable: !1,
|
|
@@ -2772,7 +2787,7 @@ function qa() {
|
|
|
2772
2787
|
enumerable: !0,
|
|
2773
2788
|
value: !1
|
|
2774
2789
|
}
|
|
2775
|
-
})),
|
|
2790
|
+
})), Me = null, Ne = null, C = Object.seal(Gi(null, {
|
|
2776
2791
|
tagCheck: {
|
|
2777
2792
|
writable: !0,
|
|
2778
2793
|
configurable: !1,
|
|
@@ -2785,14 +2800,14 @@ function qa() {
|
|
|
2785
2800
|
enumerable: !0,
|
|
2786
2801
|
value: null
|
|
2787
2802
|
}
|
|
2788
|
-
})),
|
|
2803
|
+
})), Pe = !0, Fe = !0, Ie = !1, w = !0, T = !1, Le = !0, Re = !1, ze = !1, Be = null, Ve = null, He = !1, Ue = !1, We = !1, Ge = !1, Ke = !0, qe = !1, E = "user-content-", Je = !0, Ye = !1, Xe = {}, Ze = null, Qe = 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(".")), $e = null, et = X({}, [
|
|
2789
2804
|
"audio",
|
|
2790
2805
|
"video",
|
|
2791
2806
|
"img",
|
|
2792
2807
|
"source",
|
|
2793
2808
|
"image",
|
|
2794
2809
|
"track"
|
|
2795
|
-
]),
|
|
2810
|
+
]), tt = null, nt = X({}, [
|
|
2796
2811
|
"alt",
|
|
2797
2812
|
"class",
|
|
2798
2813
|
"for",
|
|
@@ -2807,42 +2822,42 @@ function qa() {
|
|
|
2807
2822
|
"value",
|
|
2808
2823
|
"style",
|
|
2809
2824
|
"xmlns"
|
|
2810
|
-
]),
|
|
2811
|
-
nt,
|
|
2825
|
+
]), rt = "http://www.w3.org/1998/Math/MathML", it = "http://www.w3.org/2000/svg", D = "http://www.w3.org/1999/xhtml", at = D, ot = !1, st = null, ct = X({}, [
|
|
2812
2826
|
rt,
|
|
2813
|
-
|
|
2814
|
-
|
|
2827
|
+
it,
|
|
2828
|
+
D
|
|
2829
|
+
], na), lt = G([
|
|
2815
2830
|
"mi",
|
|
2816
2831
|
"mo",
|
|
2817
2832
|
"mn",
|
|
2818
2833
|
"ms",
|
|
2819
2834
|
"mtext"
|
|
2820
|
-
]),
|
|
2835
|
+
]), O = X({}, lt), ut = G(["annotation-xml"]), dt = X({}, ut), ft = X({}, [
|
|
2821
2836
|
"title",
|
|
2822
2837
|
"style",
|
|
2823
2838
|
"font",
|
|
2824
2839
|
"a",
|
|
2825
2840
|
"script"
|
|
2826
|
-
]),
|
|
2841
|
+
]), pt = null, mt = ["application/xhtml+xml", "text/html"], k = null, ht = null, gt = n.createElement("form"), _t = function(e) {
|
|
2827
2842
|
return e instanceof RegExp || e instanceof Function;
|
|
2828
|
-
},
|
|
2843
|
+
}, vt = function() {
|
|
2829
2844
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2830
|
-
if (
|
|
2831
|
-
(!e || typeof e != "object") && (e = {}), e = Z(e),
|
|
2832
|
-
transform:
|
|
2833
|
-
base:
|
|
2834
|
-
}),
|
|
2835
|
-
transform:
|
|
2836
|
-
base:
|
|
2837
|
-
}),
|
|
2838
|
-
let t =
|
|
2839
|
-
if (
|
|
2845
|
+
if (ht && ht === e) return;
|
|
2846
|
+
(!e || typeof e != "object") && (e = {}), e = Z(e), pt = mt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, k = pt === "application/xhtml+xml" ? na : ta, b = Ja(e, "ALLOWED_TAGS", Ae, { transform: k }), x = Ja(e, "ALLOWED_ATTR", je, { transform: k }), st = Ja(e, "ALLOWED_NAMESPACES", ct, { transform: na }), tt = Ja(e, "ADD_URI_SAFE_ATTR", nt, {
|
|
2847
|
+
transform: k,
|
|
2848
|
+
base: nt
|
|
2849
|
+
}), $e = Ja(e, "ADD_DATA_URI_TAGS", et, {
|
|
2850
|
+
transform: k,
|
|
2851
|
+
base: et
|
|
2852
|
+
}), Ze = Ja(e, "FORBID_CONTENTS", Qe, { transform: k }), Me = Ja(e, "FORBID_TAGS", Z({}), { transform: k }), Ne = Ja(e, "FORBID_ATTR", Z({}), { transform: k }), Xe = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, Pe = e.ALLOW_ARIA_ATTR !== !1, Fe = e.ALLOW_DATA_ATTR !== !1, Ie = e.ALLOW_UNKNOWN_PROTOCOLS || !1, w = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, T = e.SAFE_FOR_TEMPLATES || !1, Le = e.SAFE_FOR_XML !== !1, Re = e.WHOLE_DOCUMENT || !1, Ue = e.RETURN_DOM || !1, We = e.RETURN_DOM_FRAGMENT || !1, Ge = e.RETURN_TRUSTED_TYPE || !1, He = e.FORCE_BODY || !1, Ke = e.SANITIZE_DOM !== !1, qe = e.SANITIZE_NAMED_PROPS || !1, Je = e.KEEP_CONTENT !== !1, Ye = e.IN_PLACE || !1, ke = ga(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Na, at = typeof e.NAMESPACE == "string" ? e.NAMESPACE : D, O = Ya(e, "MATHML_TEXT_INTEGRATION_POINTS", () => X({}, lt)), dt = Ya(e, "HTML_INTEGRATION_POINTS", () => X({}, ut));
|
|
2853
|
+
let t = Ya(e, "CUSTOM_ELEMENT_HANDLING", () => Gi(null));
|
|
2854
|
+
if (S = Gi(null), q(t, "tagNameCheck") && _t(t.tagNameCheck) && (S.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && _t(t.attributeNameCheck) && (S.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (S.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(S), T && (Fe = !1), We && (Ue = !0), Xe && (b = X({}, Ca), x = Gi(null), Xe.html === !0 && (X(b, _a), X(x, wa)), Xe.svg === !0 && (X(b, va), X(x, Ta), X(x, Da)), Xe.svgFilters === !0 && (X(b, ya), X(x, Ta), X(x, Da)), Xe.mathMl === !0 && (X(b, xa), X(x, Ea), X(x, Da))), C.tagCheck = null, C.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? C.tagCheck = e.ADD_TAGS : ea(e.ADD_TAGS) && (b === Ae && (b = Z(b)), X(b, e.ADD_TAGS, k))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? C.attributeCheck = e.ADD_ATTR : ea(e.ADD_ATTR) && (x === je && (x = Z(x)), X(x, e.ADD_ATTR, k))), q(e, "ADD_FORBID_CONTENTS") && ea(e.ADD_FORBID_CONTENTS) && (Ze === Qe && (Ze = Z(Ze)), X(Ze, e.ADD_FORBID_CONTENTS, k)), Je && (b["#text"] = !0), Re && X(b, [
|
|
2840
2855
|
"html",
|
|
2841
2856
|
"head",
|
|
2842
2857
|
"body"
|
|
2843
|
-
]),
|
|
2844
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
2845
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
2858
|
+
]), b.table && (X(b, ["tbody"]), delete Me.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
2859
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw fa("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
2860
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw fa("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
2846
2861
|
let t = h;
|
|
2847
2862
|
h = e.TRUSTED_TYPES_POLICY;
|
|
2848
2863
|
try {
|
|
@@ -2851,33 +2866,33 @@ function qa() {
|
|
|
2851
2866
|
throw h = t, e;
|
|
2852
2867
|
}
|
|
2853
2868
|
} else e.TRUSTED_TYPES_POLICY === null ? (h = void 0, g = "") : (h === void 0 && (h = he()), h && typeof g == "string" && (g = pe("")));
|
|
2854
|
-
G && G(e),
|
|
2855
|
-
},
|
|
2856
|
-
...
|
|
2857
|
-
...
|
|
2858
|
-
...
|
|
2859
|
-
]),
|
|
2860
|
-
return t.namespaceURI ===
|
|
2861
|
-
},
|
|
2862
|
-
return t.namespaceURI ===
|
|
2863
|
-
},
|
|
2864
|
-
return t.namespaceURI ===
|
|
2865
|
-
},
|
|
2869
|
+
G && G(e), ht = e;
|
|
2870
|
+
}, yt = X({}, [
|
|
2871
|
+
...va,
|
|
2872
|
+
...ya,
|
|
2873
|
+
...ba
|
|
2874
|
+
]), bt = X({}, [...xa, ...Sa]), xt = function(e, t, n) {
|
|
2875
|
+
return t.namespaceURI === D ? e === "svg" : t.namespaceURI === rt ? e === "svg" && (n === "annotation-xml" || O[n]) : !!yt[e];
|
|
2876
|
+
}, St = function(e, t, n) {
|
|
2877
|
+
return t.namespaceURI === D ? e === "math" : t.namespaceURI === it ? e === "math" && dt[n] : !!bt[e];
|
|
2878
|
+
}, Ct = function(e, t, n) {
|
|
2879
|
+
return t.namespaceURI === it && !dt[n] || t.namespaceURI === rt && !O[n] ? !1 : !bt[e] && (ft[e] || !yt[e]);
|
|
2880
|
+
}, wt = function(e) {
|
|
2866
2881
|
let t = re(e);
|
|
2867
2882
|
(!t || !t.tagName) && (t = {
|
|
2868
|
-
namespaceURI:
|
|
2883
|
+
namespaceURI: at,
|
|
2869
2884
|
tagName: "template"
|
|
2870
2885
|
});
|
|
2871
|
-
let n =
|
|
2872
|
-
return
|
|
2873
|
-
},
|
|
2874
|
-
|
|
2886
|
+
let n = ta(e.tagName), r = ta(t.tagName);
|
|
2887
|
+
return st[e.namespaceURI] ? e.namespaceURI === it ? xt(n, t, r) : e.namespaceURI === rt ? St(n, t, r) : e.namespaceURI === D ? Ct(n, t, r) : !!(pt === "application/xhtml+xml" && st[e.namespaceURI]) : !1;
|
|
2888
|
+
}, A = function(e) {
|
|
2889
|
+
Qi(t.removed, { element: e });
|
|
2875
2890
|
try {
|
|
2876
2891
|
re(e).removeChild(e);
|
|
2877
2892
|
} catch {
|
|
2878
|
-
if (p(e), !re(e)) throw
|
|
2893
|
+
if (p(e), !re(e)) throw fa("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
2879
2894
|
}
|
|
2880
|
-
},
|
|
2895
|
+
}, j = function(e, t, n) {
|
|
2881
2896
|
try {
|
|
2882
2897
|
ee(e, t);
|
|
2883
2898
|
} catch {
|
|
@@ -2885,14 +2900,14 @@ function qa() {
|
|
|
2885
2900
|
e.removeAttribute(n);
|
|
2886
2901
|
} catch {}
|
|
2887
2902
|
}
|
|
2888
|
-
},
|
|
2889
|
-
|
|
2903
|
+
}, M = function(e) {
|
|
2904
|
+
N(e);
|
|
2890
2905
|
let t = ne(e);
|
|
2891
2906
|
if (t) {
|
|
2892
2907
|
let e = [];
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
}),
|
|
2908
|
+
Yi(t, (t) => {
|
|
2909
|
+
Qi(e, t);
|
|
2910
|
+
}), Yi(e, (e) => {
|
|
2896
2911
|
try {
|
|
2897
2912
|
p(e);
|
|
2898
2913
|
} catch {}
|
|
@@ -2901,15 +2916,15 @@ function qa() {
|
|
|
2901
2916
|
let n = ae(e);
|
|
2902
2917
|
if (n) for (let t = n.length - 1; t >= 0; --t) {
|
|
2903
2918
|
let r = n[t], i = r && r.name;
|
|
2904
|
-
typeof i == "string" &&
|
|
2919
|
+
typeof i == "string" && j(e, r, i);
|
|
2905
2920
|
}
|
|
2906
|
-
},
|
|
2921
|
+
}, Tt = function(e, n, r) {
|
|
2907
2922
|
if (!r) try {
|
|
2908
2923
|
r = n.getAttributeNode(e);
|
|
2909
2924
|
} catch {
|
|
2910
2925
|
r = null;
|
|
2911
2926
|
}
|
|
2912
|
-
|
|
2927
|
+
Qi(t.removed, {
|
|
2913
2928
|
attribute: r || null,
|
|
2914
2929
|
from: n
|
|
2915
2930
|
});
|
|
@@ -2921,93 +2936,93 @@ function qa() {
|
|
|
2921
2936
|
} catch {}
|
|
2922
2937
|
}
|
|
2923
2938
|
if (e === "is") {
|
|
2924
|
-
if (
|
|
2925
|
-
|
|
2939
|
+
if (Ue || We) try {
|
|
2940
|
+
A(n);
|
|
2926
2941
|
} catch {}
|
|
2927
2942
|
else try {
|
|
2928
2943
|
n.setAttribute(e, "");
|
|
2929
2944
|
} catch {}
|
|
2930
2945
|
}
|
|
2931
|
-
},
|
|
2946
|
+
}, Et = function(e) {
|
|
2932
2947
|
let t = ae(e);
|
|
2933
2948
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
2934
2949
|
let r = t[n], i = r && r.name;
|
|
2935
|
-
typeof i != "string" ||
|
|
2950
|
+
typeof i != "string" || x[k(i)] || j(e, r, i);
|
|
2936
2951
|
}
|
|
2937
|
-
},
|
|
2952
|
+
}, N = function(e) {
|
|
2938
2953
|
let t = [e];
|
|
2939
2954
|
for (; t.length > 0;) {
|
|
2940
2955
|
let e = t.pop();
|
|
2941
|
-
ce(e) === $.element &&
|
|
2956
|
+
ce(e) === $.element && Et(e);
|
|
2942
2957
|
let n = ne(e);
|
|
2943
2958
|
if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
|
|
2944
2959
|
}
|
|
2945
|
-
},
|
|
2946
|
-
return
|
|
2947
|
-
},
|
|
2948
|
-
if (!
|
|
2960
|
+
}, Dt = function(e, t) {
|
|
2961
|
+
return Le ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
|
|
2962
|
+
}, Ot = function(e) {
|
|
2963
|
+
if (!Le) return;
|
|
2949
2964
|
let t = [e];
|
|
2950
2965
|
for (; t.length > 0;) {
|
|
2951
2966
|
let e = t.pop(), n = ce(e);
|
|
2952
|
-
if (n === $.processingInstruction || n === $.comment && J(
|
|
2967
|
+
if (n === $.processingInstruction || n === $.comment && J(za, e.data)) {
|
|
2953
2968
|
try {
|
|
2954
2969
|
p(e);
|
|
2955
2970
|
} catch {}
|
|
2956
2971
|
continue;
|
|
2957
2972
|
}
|
|
2958
2973
|
if (n === $.element) {
|
|
2959
|
-
let t = e, n =
|
|
2974
|
+
let t = e, n = k(le(e));
|
|
2960
2975
|
try {
|
|
2961
|
-
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") &&
|
|
2976
|
+
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && Dt("for", n) && t.removeAttribute("for");
|
|
2962
2977
|
} catch {}
|
|
2963
2978
|
}
|
|
2964
2979
|
let r = ne(e);
|
|
2965
2980
|
if (r) for (let e = r.length - 1; e >= 0; --e) t.push(r[e]);
|
|
2966
2981
|
}
|
|
2967
|
-
},
|
|
2982
|
+
}, kt = function(e) {
|
|
2968
2983
|
let t = null, r = null;
|
|
2969
|
-
if (
|
|
2984
|
+
if (He) e = "<remove></remove>" + e;
|
|
2970
2985
|
else {
|
|
2971
|
-
let t =
|
|
2986
|
+
let t = ra(e, /^[\r\n\t ]+/);
|
|
2972
2987
|
r = t && t[0];
|
|
2973
2988
|
}
|
|
2974
|
-
|
|
2989
|
+
pt === "application/xhtml+xml" && at === D && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
2975
2990
|
let i = h ? pe(e) : e;
|
|
2976
|
-
if (
|
|
2977
|
-
t = new l().parseFromString(i,
|
|
2991
|
+
if (at === D) try {
|
|
2992
|
+
t = new l().parseFromString(i, pt);
|
|
2978
2993
|
} catch {}
|
|
2979
2994
|
if (!t || !t.documentElement) {
|
|
2980
|
-
t = v.createDocument(
|
|
2995
|
+
t = v.createDocument(at, "template", null);
|
|
2981
2996
|
try {
|
|
2982
|
-
t.documentElement.innerHTML =
|
|
2997
|
+
t.documentElement.innerHTML = ot ? g : i;
|
|
2983
2998
|
} catch {}
|
|
2984
2999
|
}
|
|
2985
3000
|
let a = t.body || t.documentElement;
|
|
2986
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null),
|
|
2987
|
-
},
|
|
3001
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), at === D ? ye.call(t, Re ? "html" : "body")[0] : Re ? t.documentElement : a;
|
|
3002
|
+
}, At = function(e) {
|
|
2988
3003
|
let t = se ? se(e) : e.ownerDocument;
|
|
2989
3004
|
return _e.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
|
|
2990
|
-
},
|
|
2991
|
-
return e =
|
|
2992
|
-
},
|
|
3005
|
+
}, jt = function(e) {
|
|
3006
|
+
return e = ia(e, xe, " "), e = ia(e, Se, " "), e = ia(e, Ce, " "), e;
|
|
3007
|
+
}, Mt = function(e) {
|
|
2993
3008
|
e.normalize();
|
|
2994
3009
|
let t = se ? se(e) : e.ownerDocument, n = _e.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
|
|
2995
|
-
for (; r;) r.data =
|
|
3010
|
+
for (; r;) r.data = jt(r.data), r = n.nextNode();
|
|
2996
3011
|
let i = e.querySelectorAll?.call(e, "template");
|
|
2997
|
-
i &&
|
|
2998
|
-
|
|
3012
|
+
i && Yi(i, (e) => {
|
|
3013
|
+
Pt(e.content) && Mt(e.content);
|
|
2999
3014
|
});
|
|
3000
|
-
},
|
|
3015
|
+
}, Nt = function(e) {
|
|
3001
3016
|
let t = m ? m(e) : null;
|
|
3002
|
-
return typeof t != "string" ||
|
|
3003
|
-
},
|
|
3017
|
+
return typeof t != "string" || k(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== ae(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 !== oe(e) || e.childNodes !== ne(e);
|
|
3018
|
+
}, Pt = function(e) {
|
|
3004
3019
|
if (!oe || typeof e != "object" || !e) return !1;
|
|
3005
3020
|
try {
|
|
3006
3021
|
return oe(e) === $.documentFragment;
|
|
3007
3022
|
} catch {
|
|
3008
3023
|
return !1;
|
|
3009
3024
|
}
|
|
3010
|
-
},
|
|
3025
|
+
}, P = function(e) {
|
|
3011
3026
|
if (!oe || typeof e != "object" || !e) return !1;
|
|
3012
3027
|
try {
|
|
3013
3028
|
return typeof oe(e) == "number";
|
|
@@ -3015,18 +3030,18 @@ function qa() {
|
|
|
3015
3030
|
return !1;
|
|
3016
3031
|
}
|
|
3017
3032
|
};
|
|
3018
|
-
function
|
|
3019
|
-
e.length !== 0 &&
|
|
3020
|
-
e.call(t, n, r,
|
|
3033
|
+
function F(e, n, r) {
|
|
3034
|
+
e.length !== 0 && Yi(e, (e) => {
|
|
3035
|
+
e.call(t, n, r, ht);
|
|
3021
3036
|
});
|
|
3022
3037
|
}
|
|
3023
|
-
let
|
|
3024
|
-
return !!(
|
|
3025
|
-
},
|
|
3038
|
+
let Ft = function(e, t) {
|
|
3039
|
+
return !!(Le && e.hasChildNodes() && !P(e.firstElementChild) && J(Ra, e.textContent) && J(Ra, e.innerHTML) || Le && e.namespaceURI === D && Ua[t] && (P(e.firstElementChild) || typeof e.textContent == "string" && J(Wa[t], e.textContent)) || e.nodeType === $.processingInstruction || Le && e.nodeType === $.comment && J(za, e.data));
|
|
3040
|
+
}, It = function(e, t) {
|
|
3026
3041
|
return e instanceof RegExp ? J(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
|
|
3027
|
-
},
|
|
3028
|
-
if (!
|
|
3029
|
-
if (
|
|
3042
|
+
}, I = function(e, t, n) {
|
|
3043
|
+
if (!Me[t] && Ht(t) && It(S.tagNameCheck, t)) return !1;
|
|
3044
|
+
if (Je && !Ze[t]) {
|
|
3030
3045
|
let t = re(e), r = ne(e);
|
|
3031
3046
|
if (r && t) {
|
|
3032
3047
|
let i = r.length;
|
|
@@ -3036,34 +3051,34 @@ function qa() {
|
|
|
3036
3051
|
}
|
|
3037
3052
|
}
|
|
3038
3053
|
}
|
|
3039
|
-
return
|
|
3054
|
+
return A(e), !0;
|
|
3040
3055
|
}, Lt = function(e, t, n, r) {
|
|
3041
3056
|
return e.length === 0 ? t : t === n || t === r ? Z(t) : t;
|
|
3042
3057
|
}, Rt = function(e, t) {
|
|
3043
|
-
return e === t || re(e) !== null ? !1 : (
|
|
3058
|
+
return e === t || re(e) !== null ? !1 : (Ye && N(e), !0);
|
|
3044
3059
|
}, zt = function(e, n) {
|
|
3045
|
-
if (
|
|
3046
|
-
if (
|
|
3047
|
-
let r =
|
|
3048
|
-
if (
|
|
3060
|
+
if (F(y.beforeSanitizeElements, e, null), Rt(e, n)) return !0;
|
|
3061
|
+
if (Nt(e)) return A(e), !0;
|
|
3062
|
+
let r = k(le(e));
|
|
3063
|
+
if (b = Lt(y.uponSanitizeElement, b, Ae, Be), F(y.uponSanitizeElement, e, {
|
|
3049
3064
|
tagName: r,
|
|
3050
|
-
allowedTags:
|
|
3065
|
+
allowedTags: b
|
|
3051
3066
|
}), Rt(e, n)) return !0;
|
|
3052
|
-
if (
|
|
3053
|
-
if (
|
|
3054
|
-
let t =
|
|
3055
|
-
return t === !1 && (
|
|
3067
|
+
if (Ft(e, r)) return A(e), !0;
|
|
3068
|
+
if (Me[r] || !(C.tagCheck instanceof Function && C.tagCheck(r)) && !b[r]) {
|
|
3069
|
+
let t = I(e, r, n);
|
|
3070
|
+
return t === !1 && (F(y.afterSanitizeElements, e, null), Rt(e, n)) ? !0 : t;
|
|
3056
3071
|
}
|
|
3057
|
-
if (ce(e) === $.element && !
|
|
3058
|
-
if (
|
|
3059
|
-
let n =
|
|
3060
|
-
e.textContent !== n && (
|
|
3072
|
+
if (ce(e) === $.element && !wt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(Ba, e.innerHTML)) return A(e), !0;
|
|
3073
|
+
if (T && e.nodeType === $.text) {
|
|
3074
|
+
let n = jt(e.textContent);
|
|
3075
|
+
e.textContent !== n && (Qi(t.removed, { element: e.cloneNode() }), e.textContent = n);
|
|
3061
3076
|
}
|
|
3062
|
-
return
|
|
3077
|
+
return F(y.afterSanitizeElements, e, null), Rt(e, n);
|
|
3063
3078
|
}, Bt = function(e, t, r) {
|
|
3064
|
-
if (
|
|
3065
|
-
let i =
|
|
3066
|
-
return
|
|
3079
|
+
if (Ne[t] || Dt(t, e) || Ke && (t === "id" || t === "name") && (r in n || r in gt)) return !1;
|
|
3080
|
+
let i = x[t] || C.attributeCheck instanceof Function && C.attributeCheck(t, e);
|
|
3081
|
+
return Fe && J(we, t) || Pe && J(Te, t) ? !0 : i ? tt[t] || J(ke, ia(r, De, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && aa(r, "data:") === 0 && $e[e] || Ie && !J(Ee, ia(r, De, "")) ? !0 : !r : Ht(e) && It(S.tagNameCheck, e) && It(S.attributeNameCheck, t, e) || t === "is" && S.allowCustomizedBuiltInElements && It(S.tagNameCheck, r);
|
|
3067
3082
|
}, Vt = X({}, [
|
|
3068
3083
|
"annotation-xml",
|
|
3069
3084
|
"color-profile",
|
|
@@ -3074,7 +3089,7 @@ function qa() {
|
|
|
3074
3089
|
"font-face-uri",
|
|
3075
3090
|
"missing-glyph"
|
|
3076
3091
|
]), Ht = function(e) {
|
|
3077
|
-
return !Vt[
|
|
3092
|
+
return !Vt[ta(e)] && J(Oe, e);
|
|
3078
3093
|
}, Ut = function(e, t, n, r) {
|
|
3079
3094
|
if (h && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
3080
3095
|
case "TrustedHTML": return pe(r);
|
|
@@ -3083,34 +3098,34 @@ function qa() {
|
|
|
3083
3098
|
return r;
|
|
3084
3099
|
}, Wt = function(e, t, n, r) {
|
|
3085
3100
|
try {
|
|
3086
|
-
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !
|
|
3101
|
+
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !Nt(e) || (A(e), !1);
|
|
3087
3102
|
} catch {
|
|
3088
|
-
return
|
|
3103
|
+
return Tt(t, e), !1;
|
|
3089
3104
|
}
|
|
3090
3105
|
}, Gt = function(e, n) {
|
|
3091
|
-
if (
|
|
3106
|
+
if (F(y.beforeSanitizeAttributes, e, null), Rt(e, n)) return;
|
|
3092
3107
|
let r = e.attributes;
|
|
3093
|
-
if (!r ||
|
|
3094
|
-
|
|
3108
|
+
if (!r || Nt(e)) return;
|
|
3109
|
+
x = Lt(y.uponSanitizeAttribute, x, je, Ve);
|
|
3095
3110
|
let i = {
|
|
3096
3111
|
attrName: "",
|
|
3097
3112
|
attrValue: "",
|
|
3098
3113
|
keepAttr: !0,
|
|
3099
|
-
allowedAttributes:
|
|
3114
|
+
allowedAttributes: x,
|
|
3100
3115
|
forceKeepAttr: void 0
|
|
3101
|
-
}, a = r.length, o =
|
|
3116
|
+
}, a = r.length, o = k(e.nodeName);
|
|
3102
3117
|
for (; a--;) {
|
|
3103
|
-
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u =
|
|
3104
|
-
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0,
|
|
3118
|
+
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = k(s), d = l, f = s === "value" ? d : oa(d), p = !1;
|
|
3119
|
+
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, F(y.uponSanitizeAttribute, e, i), f = i.attrValue, qe && (u === "id" || u === "name") && aa(f, E) !== 0 && (Tt(s, e, n), f = E + f, p = !0), Le && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, f) || u === "attributename" && ra(f, "href") ? Tt(s, e, n) : i.forceKeepAttr || (i.keepAttr ? !w && J(Va, f) ? Tt(s, e, n) : (T && (f = jt(f)), Bt(o, u, f) ? (f = Ut(o, u, c, f), f !== d && Wt(e, s, c, f) && p && Zi(t.removed)) : Tt(s, e, n)) : Tt(s, e, n));
|
|
3105
3120
|
}
|
|
3106
|
-
|
|
3121
|
+
F(y.afterSanitizeAttributes, e, null), Rt(e, n);
|
|
3107
3122
|
}, Kt = function(e) {
|
|
3108
|
-
let t = null, n =
|
|
3109
|
-
for (
|
|
3123
|
+
let t = null, n = At(e);
|
|
3124
|
+
for (F(y.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (F(y.uponSanitizeShadowNode, t, null), zt(t, e), Gt(t, e), Pt(t.content) && Kt(t.content), ce(t) === $.element) {
|
|
3110
3125
|
let e = ie(t);
|
|
3111
|
-
|
|
3126
|
+
Pt(e) && (qt(e), Kt(e));
|
|
3112
3127
|
}
|
|
3113
|
-
|
|
3128
|
+
F(y.afterSanitizeShadowDOM, e, null);
|
|
3114
3129
|
}, qt = function(e) {
|
|
3115
3130
|
let t = [{
|
|
3116
3131
|
node: e,
|
|
@@ -3129,9 +3144,9 @@ function qa() {
|
|
|
3129
3144
|
});
|
|
3130
3145
|
if (r) {
|
|
3131
3146
|
let e = m ? m(n) : null;
|
|
3132
|
-
if (typeof e == "string" &&
|
|
3147
|
+
if (typeof e == "string" && k(e) === "template") {
|
|
3133
3148
|
let e = n.content;
|
|
3134
|
-
|
|
3149
|
+
Pt(e) && t.push({
|
|
3135
3150
|
node: e,
|
|
3136
3151
|
shadow: null
|
|
3137
3152
|
});
|
|
@@ -3139,7 +3154,7 @@ function qa() {
|
|
|
3139
3154
|
}
|
|
3140
3155
|
if (r) {
|
|
3141
3156
|
let e = ie(n);
|
|
3142
|
-
|
|
3157
|
+
Pt(e) && t.push({
|
|
3143
3158
|
node: null,
|
|
3144
3159
|
shadow: e
|
|
3145
3160
|
}, {
|
|
@@ -3151,87 +3166,87 @@ function qa() {
|
|
|
3151
3166
|
};
|
|
3152
3167
|
return t.sanitize = function(e) {
|
|
3153
3168
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
|
|
3154
|
-
if (
|
|
3169
|
+
if (ot = !e, ot && (e = "<!-->"), typeof e != "string" && !P(e) && (e = ha(e), typeof e != "string")) throw fa("dirty is not a string, aborting");
|
|
3155
3170
|
if (!t.isSupported) return e;
|
|
3156
|
-
|
|
3157
|
-
let c =
|
|
3171
|
+
ze ? (b = Be, x = Ve) : vt(n), (y.uponSanitizeElement.length > 0 || y.uponSanitizeAttribute.length > 0) && (b = Z(b)), y.uponSanitizeAttribute.length > 0 && (x = Z(x)), t.removed = [];
|
|
3172
|
+
let c = Ye && typeof e != "string" && P(e);
|
|
3158
3173
|
if (c) {
|
|
3159
|
-
|
|
3174
|
+
Ot(e);
|
|
3160
3175
|
let t = le(e);
|
|
3161
3176
|
if (typeof t == "string") {
|
|
3162
|
-
let n =
|
|
3163
|
-
if (!
|
|
3177
|
+
let n = k(t);
|
|
3178
|
+
if (!b[n] || Me[n]) throw M(e), fa("root node is forbidden and cannot be sanitized in-place");
|
|
3164
3179
|
}
|
|
3165
|
-
if (
|
|
3180
|
+
if (Nt(e)) throw M(e), fa("root node is clobbered and cannot be sanitized in-place");
|
|
3166
3181
|
try {
|
|
3167
3182
|
qt(e);
|
|
3168
3183
|
} catch (t) {
|
|
3169
|
-
throw
|
|
3184
|
+
throw M(e), t;
|
|
3170
3185
|
}
|
|
3171
|
-
} else if (
|
|
3186
|
+
} else if (P(e)) i = kt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === $.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), qt(i);
|
|
3172
3187
|
else {
|
|
3173
|
-
if (!
|
|
3174
|
-
if (i =
|
|
3188
|
+
if (!Ue && !T && !Re && e.indexOf("<") === -1) return h && Ge ? pe(e) : e;
|
|
3189
|
+
if (i = kt(e), !i) return Ue ? null : Ge ? g : "";
|
|
3175
3190
|
}
|
|
3176
|
-
i &&
|
|
3191
|
+
i && He && A(i.firstChild);
|
|
3177
3192
|
let l = c ? e : i;
|
|
3178
3193
|
try {
|
|
3179
|
-
let e =
|
|
3180
|
-
for (; o = e.nextNode();) zt(o, l), Gt(o, l),
|
|
3194
|
+
let e = At(l);
|
|
3195
|
+
for (; o = e.nextNode();) zt(o, l), Gt(o, l), Pt(o.content) && Kt(o.content);
|
|
3181
3196
|
} catch (n) {
|
|
3182
|
-
throw c && (
|
|
3183
|
-
e.element &&
|
|
3197
|
+
throw c && (M(e), Yi(t.removed, (e) => {
|
|
3198
|
+
e.element && N(e.element);
|
|
3184
3199
|
})), n;
|
|
3185
3200
|
}
|
|
3186
3201
|
if (c) {
|
|
3187
3202
|
let n = !1;
|
|
3188
|
-
if (
|
|
3189
|
-
t.element && (t.element === e && (n = !0),
|
|
3190
|
-
}), n) throw
|
|
3191
|
-
return
|
|
3203
|
+
if (Yi(t.removed, (t) => {
|
|
3204
|
+
t.element && (t.element === e && (n = !0), N(t.element));
|
|
3205
|
+
}), n) throw fa("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
3206
|
+
return T && Mt(e), e;
|
|
3192
3207
|
}
|
|
3193
|
-
if (
|
|
3194
|
-
if (
|
|
3208
|
+
if (Ue) {
|
|
3209
|
+
if (T && Mt(i), We) for (s = ve.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
|
|
3195
3210
|
else s = i;
|
|
3196
|
-
return (
|
|
3211
|
+
return (x.shadowroot || x.shadowrootmode) && (s = be.call(r, s, !0)), s;
|
|
3197
3212
|
}
|
|
3198
|
-
let u =
|
|
3199
|
-
return
|
|
3213
|
+
let u = Re ? i.outerHTML : i.innerHTML;
|
|
3214
|
+
return Re && b["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(Ia, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), T && (u = jt(u)), h && Ge ? pe(u) : u;
|
|
3200
3215
|
}, t.setConfig = function() {
|
|
3201
3216
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3202
|
-
|
|
3217
|
+
vt(e), ze = !0, Be = b, Ve = x;
|
|
3203
3218
|
}, t.clearConfig = function() {
|
|
3204
|
-
|
|
3219
|
+
ht = null, ze = !1, Be = null, Ve = null, h = _, g = "";
|
|
3205
3220
|
}, t.isValidAttribute = function(e, t, n) {
|
|
3206
|
-
|
|
3207
|
-
let r =
|
|
3221
|
+
ht || vt({});
|
|
3222
|
+
let r = k(e), i = k(t);
|
|
3208
3223
|
return Bt(r, i, n);
|
|
3209
3224
|
}, t.addHook = function(e, t) {
|
|
3210
|
-
typeof t == "function" && q(y, e) &&
|
|
3225
|
+
typeof t == "function" && q(y, e) && Qi(y[e], t);
|
|
3211
3226
|
}, t.removeHook = function(e, t) {
|
|
3212
3227
|
if (q(y, e)) {
|
|
3213
3228
|
if (t !== void 0) {
|
|
3214
|
-
let n =
|
|
3215
|
-
return n === -1 ? void 0 :
|
|
3229
|
+
let n = Xi(y[e], t);
|
|
3230
|
+
return n === -1 ? void 0 : $i(y[e], n, 1)[0];
|
|
3216
3231
|
}
|
|
3217
|
-
return
|
|
3232
|
+
return Zi(y[e]);
|
|
3218
3233
|
}
|
|
3219
3234
|
}, t.removeHooks = function(e) {
|
|
3220
3235
|
q(y, e) && (y[e] = []);
|
|
3221
3236
|
}, t.removeAllHooks = function() {
|
|
3222
|
-
y =
|
|
3237
|
+
y = qa();
|
|
3223
3238
|
}, t;
|
|
3224
3239
|
}
|
|
3225
|
-
var
|
|
3240
|
+
var Za = Xa();
|
|
3226
3241
|
//#endregion
|
|
3227
3242
|
//#region ../../packages/components/src/chat/markdownHtml.ts
|
|
3228
|
-
function
|
|
3243
|
+
function Qa(e) {
|
|
3229
3244
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
3230
3245
|
}
|
|
3231
|
-
function
|
|
3246
|
+
function $a(e, t) {
|
|
3232
3247
|
return `<span class="katex-pending" data-katex="${encodeURIComponent(e)}" data-display="${t}"></span>`;
|
|
3233
3248
|
}
|
|
3234
|
-
var
|
|
3249
|
+
var eo = {
|
|
3235
3250
|
ADD_ATTR: ["target"],
|
|
3236
3251
|
ALLOW_UNKNOWN_PROTOCOLS: !0,
|
|
3237
3252
|
FORBID_TAGS: [
|
|
@@ -3252,21 +3267,21 @@ var Za = {
|
|
|
3252
3267
|
"background"
|
|
3253
3268
|
]
|
|
3254
3269
|
};
|
|
3255
|
-
|
|
3270
|
+
Za.addHook("uponSanitizeAttribute", (e, t) => {
|
|
3256
3271
|
t.attrName === "src" && e.nodeName !== "IMG" && (t.keepAttr = !1);
|
|
3257
3272
|
});
|
|
3258
|
-
var
|
|
3259
|
-
function
|
|
3260
|
-
if (!t) return
|
|
3261
|
-
let n =
|
|
3262
|
-
...
|
|
3273
|
+
var to = "data-held-src";
|
|
3274
|
+
function no(e, t) {
|
|
3275
|
+
if (!t) return Za.sanitize(e, eo);
|
|
3276
|
+
let n = Za.sanitize(e, {
|
|
3277
|
+
...eo,
|
|
3263
3278
|
RETURN_DOM_FRAGMENT: !0
|
|
3264
3279
|
});
|
|
3265
3280
|
for (let e of Array.from(n.querySelectorAll("img"))) {
|
|
3266
3281
|
let n = e.getAttribute("src") ?? "";
|
|
3267
3282
|
if (t.canLoad(n)) continue;
|
|
3268
3283
|
let r = e.ownerDocument.createElement("button");
|
|
3269
|
-
r.type = "button", r.className = "markdown-held-image", r.setAttribute(
|
|
3284
|
+
r.type = "button", r.className = "markdown-held-image", r.setAttribute(to, n), r.textContent = t.label(t.hostOf(n) ?? n), e.replaceWith(r);
|
|
3270
3285
|
}
|
|
3271
3286
|
let r = n.ownerDocument.createElement("div");
|
|
3272
3287
|
return r.append(n), r.innerHTML;
|
|
@@ -3274,7 +3289,7 @@ function $a(e, t) {
|
|
|
3274
3289
|
//#endregion
|
|
3275
3290
|
//#region ../../packages/components/src/chat/PkStreamingMarkdown.vue?vue&type=script&setup=true&lang.ts
|
|
3276
3291
|
a(), l();
|
|
3277
|
-
var
|
|
3292
|
+
var ro = ["innerHTML"], io = 100, ao = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
3278
3293
|
__name: "PkStreamingMarkdown",
|
|
3279
3294
|
props: {
|
|
3280
3295
|
markdown: {
|
|
@@ -3329,7 +3344,7 @@ var eo = ["innerHTML"], to = 100, no = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3329
3344
|
};
|
|
3330
3345
|
},
|
|
3331
3346
|
renderer(e) {
|
|
3332
|
-
return
|
|
3347
|
+
return $a(e.text, e.displayMode);
|
|
3333
3348
|
}
|
|
3334
3349
|
}, {
|
|
3335
3350
|
name: "blockKatex",
|
|
@@ -3344,7 +3359,7 @@ var eo = ["innerHTML"], to = 100, no = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3344
3359
|
};
|
|
3345
3360
|
},
|
|
3346
3361
|
renderer(e) {
|
|
3347
|
-
return
|
|
3362
|
+
return $a(e.text, e.displayMode) + "\n";
|
|
3348
3363
|
}
|
|
3349
3364
|
}] }), W.use({ extensions: [{
|
|
3350
3365
|
name: "thinking",
|
|
@@ -3365,26 +3380,26 @@ var eo = ["innerHTML"], to = 100, no = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3365
3380
|
return `<div class="thinking-block">${this.parser.parse(e.tokens ?? [])}</div>`;
|
|
3366
3381
|
}
|
|
3367
3382
|
}] });
|
|
3368
|
-
let g = new W.Renderer(),
|
|
3383
|
+
let g = new W.Renderer(), _ = (e) => e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), ue = /^(?:javascript|data|vbscript|file):/i, de = !1, fe = (e) => _(e.replace(/^https?:\/\/(?:www\.)?/i, "").replace(/\/$/, "")).replace(/\//g, "/<wbr>");
|
|
3369
3384
|
g.link = function({ href: e, title: t, text: n, tokens: r }) {
|
|
3370
3385
|
let i = this.parser.parseInline(r), a = (e ?? "").trim().replace(/[\x00-\x1f]/g, "");
|
|
3371
|
-
if (!a ||
|
|
3372
|
-
let o =
|
|
3373
|
-
return `<a href="${
|
|
3386
|
+
if (!a || ue.test(a)) return i;
|
|
3387
|
+
let o = de && n === a, s = t || (o ? a : ""), c = s ? ` title="${_(s)}"` : "", l = ne(a) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
|
|
3388
|
+
return `<a href="${_(a)}"${c}${l}>${o ? fe(a) : i}</a>`;
|
|
3374
3389
|
}, g.table = function(e) {
|
|
3375
|
-
|
|
3390
|
+
de = !0;
|
|
3376
3391
|
try {
|
|
3377
|
-
let t = e.header.map((e) =>
|
|
3392
|
+
let t = e.header.map((e) => _(this.parser.parseInline(e.tokens, this.parser.textRenderer))), n = (e) => `<tr role="row">${e.map((e, n) => {
|
|
3378
3393
|
let r = this.parser.parseInline(e.tokens), i = e.align ? ` align="${e.align}"` : "";
|
|
3379
3394
|
return e.header ? `<th role="columnheader"${i}>${r}</th>` : `<td role="cell" data-label="${t[n] ?? ""}"${i}><span>${r}</span></td>`;
|
|
3380
3395
|
}).join("")}</tr>`, r = e.rows.length ? `<tbody role="rowgroup">${e.rows.map(n).join("")}</tbody>` : "";
|
|
3381
3396
|
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`;
|
|
3382
3397
|
} finally {
|
|
3383
|
-
|
|
3398
|
+
de = !1;
|
|
3384
3399
|
}
|
|
3385
3400
|
};
|
|
3386
3401
|
let pe = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
|
|
3387
|
-
g.code = ({ text: e }) => pe.test(e) ? `<pre class="mermaid">${
|
|
3402
|
+
g.code = ({ text: e }) => pe.test(e) ? `<pre class="mermaid">${Qa(e)}</pre>` : `<pre><code>${Qa(e)}</code></pre>`;
|
|
3388
3403
|
function me(e) {
|
|
3389
3404
|
return e.replace(/\\\[([\s\S]*?)\\\]/g, (e, t) => `$$${t}$$`).replace(/\\\(([\s\S]*?)\\\)/g, (e, t) => `$${t}$`).replace(/^(\d+)\.(?!\s)/gm, "$1\\.");
|
|
3390
3405
|
}
|
|
@@ -3403,23 +3418,23 @@ var eo = ["innerHTML"], to = 100, no = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3403
3418
|
let ge = [
|
|
3404
3419
|
le,
|
|
3405
3420
|
he,
|
|
3406
|
-
|
|
3421
|
+
Kn,
|
|
3407
3422
|
me
|
|
3408
|
-
], v = n("container"), _e = re(c(a, "markdown"),
|
|
3409
|
-
let e = ge.reduce((e, t) => t(e),
|
|
3410
|
-
return
|
|
3423
|
+
], v = n("container"), _e = re(c(a, "markdown"), io), ve = u(() => a.tailLength ? xe(_e.value, a.tailLength) : _e.value), { resolveText: ye } = ie(), be = ye(ve), y = oe(), Se = u(() => {
|
|
3424
|
+
let e = ge.reduce((e, t) => t(e), be.value);
|
|
3425
|
+
return no(W.parse(e, {
|
|
3411
3426
|
async: !1,
|
|
3412
3427
|
breaks: !0,
|
|
3413
3428
|
renderer: g
|
|
3414
|
-
}),
|
|
3415
|
-
canLoad:
|
|
3416
|
-
hostOf:
|
|
3429
|
+
}), y.isGated.value ? {
|
|
3430
|
+
canLoad: y.canLoad,
|
|
3431
|
+
hostOf: y.hostOf,
|
|
3417
3432
|
label: (e) => l("label.imageHeld", { host: e })
|
|
3418
3433
|
} : void 0);
|
|
3419
3434
|
});
|
|
3420
3435
|
function Ce(e) {
|
|
3421
|
-
let t = (e.target?.closest?.(`[${
|
|
3422
|
-
t && (e.preventDefault(), e.stopPropagation(),
|
|
3436
|
+
let t = (e.target?.closest?.(`[${to}]`))?.getAttribute(to);
|
|
3437
|
+
t && (e.preventDefault(), e.stopPropagation(), y.release(t));
|
|
3423
3438
|
}
|
|
3424
3439
|
async function we() {
|
|
3425
3440
|
if (a.loading) return;
|
|
@@ -3487,56 +3502,56 @@ var eo = ["innerHTML"], to = 100, no = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3487
3502
|
}), o(() => {
|
|
3488
3503
|
v.value?.removeEventListener("error", Oe, !0);
|
|
3489
3504
|
}), s([Se, () => a.loading], we, { immediate: !0 }), s(() => a.isDark, De), s(Se, Te, { immediate: !0 }), s(Se, Ee, { immediate: !0 });
|
|
3490
|
-
let
|
|
3491
|
-
function
|
|
3505
|
+
let ke = 0;
|
|
3506
|
+
function b(e, t) {
|
|
3492
3507
|
let n = document.createElement("span");
|
|
3493
3508
|
return n.style.cssText = `animation:ft-${a.animation} ${a.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
|
|
3494
3509
|
let t = n.parentNode;
|
|
3495
3510
|
t && (t.replaceChild(document.createTextNode(e), n), t.normalize());
|
|
3496
3511
|
}, { once: !0 }), n;
|
|
3497
3512
|
}
|
|
3498
|
-
function
|
|
3513
|
+
function Ae(e, t, n, r) {
|
|
3499
3514
|
let i = r, a = e.split(/(\s+)/);
|
|
3500
|
-
for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(
|
|
3515
|
+
for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(b(e, i * 30), n), i++));
|
|
3501
3516
|
return i;
|
|
3502
3517
|
}
|
|
3503
|
-
function
|
|
3518
|
+
function x(e) {
|
|
3504
3519
|
let t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode(e) {
|
|
3505
3520
|
return e.parentElement?.closest("pre, code, .katex-pending, .markdown-broken-image") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
3506
3521
|
} }), n = [];
|
|
3507
3522
|
for (; t.nextNode();) n.push(t.currentNode);
|
|
3508
3523
|
return n;
|
|
3509
3524
|
}
|
|
3510
|
-
function
|
|
3525
|
+
function je() {
|
|
3511
3526
|
if (!v.value || !a.loading || !a.animation) return;
|
|
3512
|
-
let e =
|
|
3527
|
+
let e = x(v.value), t = 0, n = 0;
|
|
3513
3528
|
for (let r of e) {
|
|
3514
3529
|
let e = r.textContent || "", i = t, a = t + e.length;
|
|
3515
|
-
if (t = a, a <=
|
|
3530
|
+
if (t = a, a <= ke) continue;
|
|
3516
3531
|
let o = r.parentNode;
|
|
3517
3532
|
if (!o) continue;
|
|
3518
|
-
if (i >=
|
|
3533
|
+
if (i >= ke) {
|
|
3519
3534
|
let t = r.nextSibling;
|
|
3520
|
-
o.removeChild(r), n =
|
|
3535
|
+
o.removeChild(r), n = Ae(e, o, t, n);
|
|
3521
3536
|
continue;
|
|
3522
3537
|
}
|
|
3523
|
-
let s =
|
|
3524
|
-
o.removeChild(c), n =
|
|
3538
|
+
let s = ke - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
|
|
3539
|
+
o.removeChild(c), n = Ae(l, o, u, n);
|
|
3525
3540
|
}
|
|
3526
|
-
|
|
3541
|
+
ke = t;
|
|
3527
3542
|
}
|
|
3528
3543
|
return s(Se, async () => {
|
|
3529
|
-
await i(),
|
|
3544
|
+
await i(), je();
|
|
3530
3545
|
}, { immediate: !0 }), s(() => a.markdown, (e, t) => {
|
|
3531
|
-
(!e || t && e.length < t.length) && (
|
|
3546
|
+
(!e || t && e.length < t.length) && (ke = 0);
|
|
3532
3547
|
}), (e, t) => (r(), d("div", {
|
|
3533
3548
|
ref: "container",
|
|
3534
3549
|
onClick: Ce,
|
|
3535
3550
|
innerHTML: Se.value
|
|
3536
|
-
}, null, 8,
|
|
3551
|
+
}, null, 8, ro));
|
|
3537
3552
|
}
|
|
3538
3553
|
}), [["styles", [".markdown-held-image{max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-3);font:inherit;font-size:var(--text-12);vertical-align:middle;cursor:pointer;align-items:center;display:inline-flex}.markdown-held-image:hover,.markdown-held-image:focus-visible{background-color:var(--color-surface-2);color:var(--color-word-2)}.markdown-broken-image{align-items:center;gap:var(--spacing-4);max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-4);font-size:var(--text-12);vertical-align:middle;display:inline-flex}@keyframes ft-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes ft-blurIn{0%{opacity:0;filter:blur(4px)}to{opacity:1;filter:blur()}}@keyframes ft-dropIn{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-slideUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-fadeAndScale{0%{opacity:0;transform:scale(.85)}to{opacity:1;transform:scale(1)}}"]]]);
|
|
3539
3554
|
//#endregion
|
|
3540
|
-
export {
|
|
3555
|
+
export { h as A, b as C, _ as D, pe as E, ue as O, _e as S, de as T, Fe as _, ge as a, Te as b, Ne as c, Le as d, Oe as f, je as g, T as h, C as i, g as j, fe as k, Me as l, Re as m, we as n, ve as o, De as p, be as r, S as s, ao as t, Ae as u, Ee as v, x as w, me as x, ye as y };
|
|
3541
3556
|
|
|
3542
|
-
//# sourceMappingURL=PkStreamingMarkdown-
|
|
3557
|
+
//# sourceMappingURL=PkStreamingMarkdown-B_qmgO9_.js.map
|