@8wave/ai-elements 0.112.0 → 0.114.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/Agent-D3ODaN3E.js +566 -0
- package/dist/_chunks/Agent-D3ODaN3E.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-CRlRDGYl.js → PkStreamingMarkdown-CYOm47PX.js} +1276 -453
- package/dist/_chunks/PkStreamingMarkdown-CYOm47PX.js.map +1 -0
- package/dist/_chunks/{PkToolRequestGeolocation-BbxYKt-9.js → PkToolRequestGeolocation-BY7nXImb.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-BbxYKt-9.js.map → PkToolRequestGeolocation-BY7nXImb.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-CTp2w60F.js → PkToolRequestOAuthConnection-DFOTALFt.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-CTp2w60F.js.map → PkToolRequestOAuthConnection-DFOTALFt.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-CNnt82aH.js → PkToolShowArtifact-DzHRWoru.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-CNnt82aH.js.map → PkToolShowArtifact-DzHRWoru.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-D77gyjQG.js → PkToolShowContactForm-1J6_1AA2.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-D77gyjQG.js.map → PkToolShowContactForm-1J6_1AA2.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-DP4LLAk3.js → PkToolShowForm-DmQYj3v1.js} +5 -5
- package/dist/_chunks/{PkToolShowForm-DP4LLAk3.js.map → PkToolShowForm-DmQYj3v1.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-Bwy0Ptmi.js → PkToolShowSources-BO8V5rlS.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-Bwy0Ptmi.js.map → PkToolShowSources-BO8V5rlS.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-CFO8wV1b.js → PkToolShowSuggestedReply-CTWVG1Zk.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-CFO8wV1b.js.map → PkToolShowSuggestedReply-CTWVG1Zk.js.map} +1 -1
- package/dist/_chunks/{markdown-BRD-hDrH.js → markdown-JpLFzufn.js} +7 -7
- package/dist/_chunks/{markdown-BRD-hDrH.js.map → markdown-JpLFzufn.js.map} +1 -1
- package/dist/_chunks/url-validation-uLMZ5-AU.js.map +1 -1
- package/dist/ai-elements.es.js +2741 -2733
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/_chunks/Media-_HfFLHGD.js.map +1 -1
- package/dist-vue/_chunks/{PkChatbot-C11EVHnI.js → PkChatbot-BdvDl_Gw.js} +4 -4
- package/dist-vue/_chunks/{PkChatbot-C11EVHnI.js.map → PkChatbot-BdvDl_Gw.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-CacY4o02.js → PkChatbotEmptyState-DycCrfwz.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-CacY4o02.js.map → PkChatbotEmptyState-DycCrfwz.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-Dkz3SNAk.js → PkChatbotInput-BCuqLdkT.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-Dkz3SNAk.js.map → PkChatbotInput-BCuqLdkT.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-PjKRDNYJ.js +776 -0
- package/dist-vue/_chunks/PkChatbotMessages-PjKRDNYJ.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-DU0W-eUp.js → PkChatbotStepPayload-CI98RiNv.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-DU0W-eUp.js.map → PkChatbotStepPayload-CI98RiNv.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-etlBryOg.js → PkChatbotStepToolDetail-B8zXJOdI.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-etlBryOg.js.map → PkChatbotStepToolDetail-B8zXJOdI.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotSteps-CL27pMFS.js +190 -0
- package/dist-vue/_chunks/{PkChatbotSteps-jW07Q-4x.js.map → PkChatbotSteps-CL27pMFS.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-DJnjuhjt.js → PkChatbotViewChat-CS-OSJfX.js} +6 -6
- package/dist-vue/_chunks/{PkChatbotViewChat-DJnjuhjt.js.map → PkChatbotViewChat-CS-OSJfX.js.map} +1 -1
- package/dist-vue/_chunks/PkStreamingMarkdown-B2iju0WK.js +3245 -0
- package/dist-vue/_chunks/PkStreamingMarkdown-B2iju0WK.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowArtifact-BnwU7CV2.js → PkToolShowArtifact-C0J71YF6.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-BnwU7CV2.js.map → PkToolShowArtifact-C0J71YF6.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-_x_dbiHn.js → PkToolShowContactForm-De3Od9mC.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-_x_dbiHn.js.map → PkToolShowContactForm-De3Od9mC.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-RtkI_sKL.js → PkToolShowDiagram-DmY_hhAS.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-RtkI_sKL.js.map → PkToolShowDiagram-DmY_hhAS.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowEmail-CRQjoJr1.js → PkToolShowEmail-D_Z15wCS.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowEmail-CRQjoJr1.js.map → PkToolShowEmail-D_Z15wCS.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-IPAkJIXh.js → PkToolShowForm-DUGysIxj.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowForm-IPAkJIXh.js.map → PkToolShowForm-DUGysIxj.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowMessage-joTzAg9N.js → PkToolShowMessage-e5_EI5mV.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowMessage-joTzAg9N.js.map → PkToolShowMessage-e5_EI5mV.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-tOYjd2bq.js → PkToolShowProductList-B3X7Svyc.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-tOYjd2bq.js.map → PkToolShowProductList-B3X7Svyc.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-gI947JOm.js → PkToolShowSources-BUjBSGc5.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-gI947JOm.js.map → PkToolShowSources-BUjBSGc5.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-D3Xy4iUs.js → PkToolShowWebPages-DEih8h5k.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-D3Xy4iUs.js.map → PkToolShowWebPages-DEih8h5k.js.map} +1 -1
- package/dist-vue/_chunks/{PkUrl-BgMBemSz.js → PkUrl-3NH9t-WA.js} +2 -2
- package/dist-vue/_chunks/{PkUrl-BgMBemSz.js.map → PkUrl-3NH9t-WA.js.map} +1 -1
- package/dist-vue/_chunks/url-validation-uLMZ5-AU.js.map +1 -1
- package/dist-vue/_chunks/utils-BL4Ppr2R.js +184 -0
- package/dist-vue/_chunks/utils-BL4Ppr2R.js.map +1 -0
- package/dist-vue/apps/web-component/src/composables/useChatbotAuth.d.ts +1 -3
- package/dist-vue/composables.js +102 -93
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +26 -26
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/packages/auth/src/social-redirect-plugin.d.ts +18 -12
- package/dist-vue/packages/components/src/chat/markdownHtml.d.ts +20 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +9 -0
- package/dist-vue/packages/models/src/schema/AgentApiTool.d.ts +70 -0
- package/dist-vue/packages/models/src/schema/Lead.d.ts +13 -0
- package/dist-vue/packages/models/src/schema/Media.d.ts +0 -1
- package/dist-vue/packages/models/src/schema/ModelProvider.d.ts +1 -1
- package/package.json +2 -1
- package/dist/_chunks/Agent-DTLrWpzX.js +0 -460
- package/dist/_chunks/Agent-DTLrWpzX.js.map +0 -1
- package/dist/_chunks/Media-Cft7Pwrh.js +0 -108
- package/dist/_chunks/Media-Cft7Pwrh.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown-CRlRDGYl.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-BD-vUak6.js +0 -776
- package/dist-vue/_chunks/PkChatbotMessages-BD-vUak6.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotSteps-jW07Q-4x.js +0 -190
- package/dist-vue/_chunks/PkStreamingMarkdown-BoEpwaYQ.js +0 -2430
- package/dist-vue/_chunks/PkStreamingMarkdown-BoEpwaYQ.js.map +0 -1
- package/dist-vue/_chunks/utils-h4C7rRcu.js +0 -177
- package/dist-vue/_chunks/utils-h4C7rRcu.js.map +0 -1
|
@@ -1,15 +1,16 @@
|
|
|
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-CIT_Sbqw.js";
|
|
2
2
|
import { r as f } from "./vue-i18n-BdMHu4Kd.js";
|
|
3
|
-
import { n as p, t as
|
|
3
|
+
import { n as p, t as ee } from "./cdn-css-JUUNhyQ6.js";
|
|
4
|
+
import { l as te } from "./Agent-D3ODaN3E.js";
|
|
4
5
|
import "./src-BQHP1-Xs.js";
|
|
5
|
-
import { n as
|
|
6
|
-
import { v as
|
|
7
|
-
import { n as
|
|
8
|
-
import { t as
|
|
6
|
+
import { n as ne } from "./url-validation-uLMZ5-AU.js";
|
|
7
|
+
import { v as re } from "./dist-QdjZA6MJ.js";
|
|
8
|
+
import { n as ie } from "./useShortUrlResolver-DuDol0Oq.js";
|
|
9
|
+
import { t as ae } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
9
10
|
//#region ../../packages/utils/src/citations.ts
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
return e && e.replace(
|
|
11
|
+
var m = /[ \t]*\uE200[^\uE201]*\uE201/g, oe = /[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, se = /[\uE200-\uE20F]/g;
|
|
12
|
+
function ce(e) {
|
|
13
|
+
return e && e.replace(m, "").replace(oe, "").replace(se, "");
|
|
13
14
|
}
|
|
14
15
|
//#endregion
|
|
15
16
|
//#region ../../packages/utils/src/message.ts
|
|
@@ -19,13 +20,13 @@ function h(e) {
|
|
|
19
20
|
function g(e) {
|
|
20
21
|
return e ? e.type.startsWith("tool-") : !1;
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
+
function _(e) {
|
|
23
24
|
return g(e) ? e.type.slice(5) : "";
|
|
24
25
|
}
|
|
25
26
|
function le(e) {
|
|
26
27
|
return e ? e.type === "file" : !1;
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
+
function ue(e) {
|
|
29
30
|
if (!le(e)) return;
|
|
30
31
|
let t = e.providerMetadata?.["8bot"]?.media;
|
|
31
32
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
@@ -33,14 +34,14 @@ function _(e) {
|
|
|
33
34
|
function v(e) {
|
|
34
35
|
return e ? e.type === "reasoning" : !1;
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function de(e) {
|
|
37
38
|
if (!e) return;
|
|
38
39
|
let t = e.parts;
|
|
39
40
|
if (Array.isArray(t)) return t.find((e) => h(e))?.text;
|
|
40
41
|
}
|
|
41
42
|
//#endregion
|
|
42
43
|
//#region ../../packages/components/src/chat/utils.ts
|
|
43
|
-
function
|
|
44
|
+
function fe(e) {
|
|
44
45
|
let t = [];
|
|
45
46
|
for (let n of e) {
|
|
46
47
|
if (!h(n)) {
|
|
@@ -55,14 +56,20 @@ function de(e) {
|
|
|
55
56
|
}
|
|
56
57
|
return t;
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
+
var y = (e) => g(e) && te(_(e));
|
|
60
|
+
function pe(e) {
|
|
61
|
+
let t = /* @__PURE__ */ new Map();
|
|
62
|
+
for (let [n, r] of e.entries()) y(r) && r.state !== "output-error" && !me(r) && t.set(r.type, n);
|
|
63
|
+
return e.filter((e, n) => !(y(e) && e.state === "output-error" && (t.get(e.type) ?? -1) > n));
|
|
64
|
+
}
|
|
65
|
+
function me(e) {
|
|
59
66
|
return e && "state" in e ? e.state === "streaming" || e.state === "input-streaming" : !1;
|
|
60
67
|
}
|
|
61
|
-
var
|
|
62
|
-
function
|
|
68
|
+
var he = 4e3, ge = /^[ \t]*(?:(?:[-*+]|\d{1,9}[.)])[ \t]+|>[ \t]?)*(`{3,}|~{3,})(.*)$/gm;
|
|
69
|
+
function _e(e, t) {
|
|
63
70
|
if (e.length <= t) return e;
|
|
64
71
|
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;
|
|
65
|
-
for (let t of e.matchAll(
|
|
72
|
+
for (let t of e.matchAll(ge)) {
|
|
66
73
|
if (t.index >= a) break;
|
|
67
74
|
let [, e, n] = t;
|
|
68
75
|
if (o) e[0] === o[0] && e.length >= o.length && !n.trim() && (o = void 0);
|
|
@@ -73,40 +80,40 @@ function he(e, t) {
|
|
|
73
80
|
}
|
|
74
81
|
return `…\n\n${o ? `${o}\n` : ""}${e.slice(a)}`;
|
|
75
82
|
}
|
|
76
|
-
var
|
|
83
|
+
var ve = /* @__PURE__ */ new Set([
|
|
77
84
|
"approval-requested",
|
|
78
85
|
"approval-responded",
|
|
79
86
|
"output-denied"
|
|
80
87
|
]);
|
|
81
|
-
function
|
|
82
|
-
return g(e) ?
|
|
88
|
+
function ye(e) {
|
|
89
|
+
return g(e) ? ve.has(e.state) ? !0 : e.approval != null : !1;
|
|
83
90
|
}
|
|
84
|
-
var
|
|
85
|
-
function
|
|
91
|
+
var b = "requestConfirm";
|
|
92
|
+
function be(e) {
|
|
86
93
|
return g(e) && e.type === "tool-requestConfirm";
|
|
87
94
|
}
|
|
88
|
-
function
|
|
89
|
-
return
|
|
95
|
+
function xe(e) {
|
|
96
|
+
return ye(e) || be(e);
|
|
90
97
|
}
|
|
91
|
-
function
|
|
98
|
+
function Se(e) {
|
|
92
99
|
if (g(e)) return e.approval?.id;
|
|
93
100
|
}
|
|
94
|
-
function
|
|
101
|
+
function Ce(e) {
|
|
95
102
|
if (e && "state" in e) return e.state;
|
|
96
103
|
}
|
|
97
|
-
function
|
|
104
|
+
function we(e = "000000") {
|
|
98
105
|
let t = e.replace("#", "");
|
|
99
106
|
t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
|
|
100
107
|
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;
|
|
101
108
|
return .2126 * a(n) + .7152 * a(r) + .0722 * a(i) > .179 ? "black" : "white";
|
|
102
109
|
}
|
|
103
|
-
function
|
|
104
|
-
return e === "white" || e === "black" ? e :
|
|
110
|
+
function Te(e, t) {
|
|
111
|
+
return e === "white" || e === "black" ? e : we(t);
|
|
105
112
|
}
|
|
106
|
-
function
|
|
113
|
+
function Ee(e, t) {
|
|
107
114
|
if (!(t === void 0 || t < 50)) return e(t / 1e3, "seconds");
|
|
108
115
|
}
|
|
109
|
-
function
|
|
116
|
+
function De(e) {
|
|
110
117
|
if (e !== void 0) {
|
|
111
118
|
if (typeof e == "string") return e.trim() || void 0;
|
|
112
119
|
try {
|
|
@@ -117,10 +124,10 @@ function x(e) {
|
|
|
117
124
|
}
|
|
118
125
|
}
|
|
119
126
|
}
|
|
120
|
-
function
|
|
121
|
-
return
|
|
127
|
+
function Oe(e) {
|
|
128
|
+
return De(e) !== void 0;
|
|
122
129
|
}
|
|
123
|
-
function
|
|
130
|
+
function x(e, t) {
|
|
124
131
|
let n = e?.input;
|
|
125
132
|
if (typeof t == "string") {
|
|
126
133
|
let e = n?.question ?? n?.steps?.[0]?.question;
|
|
@@ -132,14 +139,14 @@ function we(e, t) {
|
|
|
132
139
|
return i ? `${i} ${n}` : n;
|
|
133
140
|
}).join(". ");
|
|
134
141
|
}
|
|
135
|
-
function
|
|
142
|
+
function ke(e) {
|
|
136
143
|
return e?.options ? e.options.map((e) => ({
|
|
137
144
|
label: e.label,
|
|
138
145
|
value: e.label,
|
|
139
146
|
description: e.description
|
|
140
147
|
})) : [];
|
|
141
148
|
}
|
|
142
|
-
function
|
|
149
|
+
function S(e, t) {
|
|
143
150
|
let n = {};
|
|
144
151
|
if (t == null) return n;
|
|
145
152
|
if (typeof t == "string") return e.length === 1 && (n[0] = t), n;
|
|
@@ -155,12 +162,12 @@ function Ee(e, t) {
|
|
|
155
162
|
for (let [e, n] of Object.entries(t)) n !== void 0 && r(e, n);
|
|
156
163
|
return n;
|
|
157
164
|
}
|
|
158
|
-
var
|
|
165
|
+
var Ae = [
|
|
159
166
|
"tool-perplexity_search",
|
|
160
167
|
"tool-parallel_search",
|
|
161
168
|
"tool-web_search",
|
|
162
169
|
"tool-google_search"
|
|
163
|
-
],
|
|
170
|
+
], C = /* @__PURE__ */ new Set([
|
|
164
171
|
"tool-searchInKnowledgeBase",
|
|
165
172
|
"tool-retrieveRevisedAnswers",
|
|
166
173
|
"tool-expandChunkContext",
|
|
@@ -169,21 +176,21 @@ var C = [
|
|
|
169
176
|
"tool-geocode",
|
|
170
177
|
"tool-recallUserMemory",
|
|
171
178
|
"tool-saveUserMemory",
|
|
172
|
-
...
|
|
179
|
+
...Ae
|
|
173
180
|
]);
|
|
174
|
-
function
|
|
175
|
-
return g(e) &&
|
|
181
|
+
function je(e) {
|
|
182
|
+
return g(e) && C.has(e.type);
|
|
176
183
|
}
|
|
177
|
-
var
|
|
184
|
+
var Me = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, w = (e, ...t) => {
|
|
178
185
|
for (let n of t) {
|
|
179
186
|
let t = e?.[n];
|
|
180
187
|
if (typeof t == "string" && t.trim()) return t;
|
|
181
188
|
}
|
|
182
189
|
};
|
|
183
|
-
function
|
|
190
|
+
function Ne(e) {
|
|
184
191
|
if (!g(e)) return;
|
|
185
|
-
let t =
|
|
186
|
-
if (e.type === "tool-searchInKnowledgeBase" ||
|
|
192
|
+
let t = Me("input" in e ? e.input : void 0), n = Me("output" in e ? e.output : void 0);
|
|
193
|
+
if (e.type === "tool-searchInKnowledgeBase" || Ae.includes(e.type)) {
|
|
187
194
|
let e = t?.queries;
|
|
188
195
|
if (Array.isArray(e)) {
|
|
189
196
|
let t = e.filter((e) => typeof e == "string" && !!e.trim());
|
|
@@ -199,26 +206,26 @@ function Ae(e) {
|
|
|
199
206
|
if (e.type === "tool-recallUserMemory") return w(t, "query");
|
|
200
207
|
if (e.type === "tool-saveUserMemory") return w(t, "content", "query");
|
|
201
208
|
}
|
|
202
|
-
function
|
|
209
|
+
function Pe(e) {
|
|
203
210
|
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-perplexity_search" || e.type === "tool-parallel_search" || e.type === "tool-web_search" || e.type === "tool-google_search" ? "ri:global-line" : "ri:tools-line";
|
|
204
211
|
if (v(e)) return "ri:lightbulb-line";
|
|
205
212
|
if (h(e)) return "ri:double-quotes-r";
|
|
206
213
|
}
|
|
207
|
-
function
|
|
208
|
-
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") :
|
|
214
|
+
function Fe(e, t) {
|
|
215
|
+
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") : Ae.includes(t.type) ? e("messagePart.webSearch") : e("messagePart.tool") : v(t) ? e("messagePart.reasoning") : e("messagePart.streaming");
|
|
209
216
|
}
|
|
210
217
|
//#endregion
|
|
211
218
|
//#region ../../node_modules/.pnpm/remend@1.3.1/node_modules/remend/dist/index.js
|
|
212
|
-
var
|
|
219
|
+
var Ie = Object.defineProperty, T = Object.defineProperties, Le = Object.getOwnPropertyDescriptors, E = Object.getOwnPropertySymbols, Re = Object.prototype.hasOwnProperty, ze = Object.prototype.propertyIsEnumerable, Be = (e, t, n) => t in e ? Ie(e, t, {
|
|
213
220
|
enumerable: !0,
|
|
214
221
|
configurable: !0,
|
|
215
222
|
writable: !0,
|
|
216
223
|
value: n
|
|
217
|
-
}) : e[t] = n,
|
|
218
|
-
for (var n in t ||= {})
|
|
219
|
-
if (
|
|
224
|
+
}) : e[t] = n, Ve = (e, t) => {
|
|
225
|
+
for (var n in t ||= {}) Re.call(t, n) && Be(e, n, t[n]);
|
|
226
|
+
if (E) for (var n of E(t)) ze.call(t, n) && Be(e, n, t[n]);
|
|
220
227
|
return e;
|
|
221
|
-
},
|
|
228
|
+
}, D = (e, t) => T(e, Le(t)), He = (e) => {
|
|
222
229
|
let t = new Uint8Array(e.length + 1), n = !1, r = !1, i = 0;
|
|
223
230
|
for (; i < e.length;) {
|
|
224
231
|
if (e[i] === "\\" && i + 1 < e.length && e[i + 1] === "`") {
|
|
@@ -236,7 +243,7 @@ var Ne = Object.defineProperty, Pe = Object.defineProperties, Fe = Object.getOwn
|
|
|
236
243
|
!r && e[i] === "`" && (n = !n), t[i + 1] = n || r ? 1 : 0, i += 1;
|
|
237
244
|
}
|
|
238
245
|
return t;
|
|
239
|
-
}, Ue = null,
|
|
246
|
+
}, Ue = null, O = (e, t) => {
|
|
240
247
|
let n = Ue;
|
|
241
248
|
return (n === null || n.text !== e) && (n = {
|
|
242
249
|
text: e,
|
|
@@ -255,7 +262,7 @@ var Ne = Object.defineProperty, Pe = Object.defineProperties, Fe = Object.getOwn
|
|
|
255
262
|
e[n] === "`" && !We(e, n) && (t += 1);
|
|
256
263
|
}
|
|
257
264
|
return t;
|
|
258
|
-
},
|
|
265
|
+
}, k = (e, t) => {
|
|
259
266
|
let n = !1, r = !1, i = -1;
|
|
260
267
|
for (let a = 0; a < e.length; a += 1) {
|
|
261
268
|
if (e[a] === "\\" && a + 1 < e.length && e[a + 1] === "`") {
|
|
@@ -274,21 +281,21 @@ var Ne = Object.defineProperty, Pe = Object.defineProperties, Fe = Object.getOwn
|
|
|
274
281
|
}
|
|
275
282
|
}
|
|
276
283
|
return !1;
|
|
277
|
-
}, Ke = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, qe = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Ke, (t, n, r, i) =>
|
|
284
|
+
}, Ke = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, qe = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Ke, (t, n, r, i) => O(e, i) ? t : `${n}\\>${r}`), Je = /(\*\*)([^*]*\*?)$/, Ye = /(__)([^_]*?)$/, Xe = /(\*\*\*)([^*]*?)$/, Ze = /(\*)([^*]*?)$/, Qe = /(_)([^_]*?)$/, $e = /(`)([^`]*?)$/, et = /(~~)([^~]*?)$/, A = /^[\s_~*`]*$/, j = /^[\s]*[-*+][\s]+$/, tt = /[\p{L}\p{N}_]/u, nt = /^```[^`\n]*```?$/, rt = /^\*{4,}$/, it = /(__)([^_]+)_$/, at = /(~~)([^~]+)~$/, ot = /~~/g, M = (e) => {
|
|
278
285
|
if (!e) return !1;
|
|
279
286
|
let t = e.charCodeAt(0);
|
|
280
|
-
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 ||
|
|
281
|
-
},
|
|
287
|
+
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || tt.test(e);
|
|
288
|
+
}, st = (e, t) => {
|
|
282
289
|
let n = 1;
|
|
283
290
|
for (let r = t - 1; r >= 0; --r) if (e[r] === "]") n += 1;
|
|
284
291
|
else if (e[r] === "[" && (--n, n === 0)) return r;
|
|
285
292
|
return -1;
|
|
286
|
-
},
|
|
293
|
+
}, ct = (e, t) => {
|
|
287
294
|
let n = 1;
|
|
288
295
|
for (let r = t + 1; r < e.length; r += 1) if (e[r] === "[") n += 1;
|
|
289
296
|
else if (e[r] === "]" && (--n, n === 0)) return r;
|
|
290
297
|
return -1;
|
|
291
|
-
},
|
|
298
|
+
}, lt = (e) => e === "inlineLatex" || e === "blockLatex", ut = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, N = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", P = (e, t) => {
|
|
292
299
|
let n = "none";
|
|
293
300
|
for (let r = 0; r < e.length && r < t; r += 1) {
|
|
294
301
|
if (e[r] === "\\" && e[r + 1] === "$") {
|
|
@@ -296,32 +303,32 @@ var Ne = Object.defineProperty, Pe = Object.defineProperties, Fe = Object.getOwn
|
|
|
296
303
|
continue;
|
|
297
304
|
}
|
|
298
305
|
if (e[r] === "\\") {
|
|
299
|
-
let t =
|
|
306
|
+
let t = ut(n, e[r + 1]);
|
|
300
307
|
if (t !== null) {
|
|
301
308
|
n = t, r += 1;
|
|
302
309
|
continue;
|
|
303
310
|
}
|
|
304
311
|
}
|
|
305
|
-
if (e[r] === "$" && !
|
|
312
|
+
if (e[r] === "$" && !lt(n)) {
|
|
306
313
|
let t = e[r + 1] === "$";
|
|
307
|
-
n =
|
|
314
|
+
n = N(n, t), t && (r += 1);
|
|
308
315
|
}
|
|
309
316
|
}
|
|
310
317
|
return n !== "none";
|
|
311
|
-
},
|
|
318
|
+
}, dt = (e, t) => {
|
|
312
319
|
for (let n = t; n < e.length; n += 1) {
|
|
313
320
|
if (e[n] === ")") return !0;
|
|
314
321
|
if (e[n] === "\n") return !1;
|
|
315
322
|
}
|
|
316
323
|
return !1;
|
|
317
|
-
},
|
|
324
|
+
}, ft = (e, t) => {
|
|
318
325
|
for (let n = t - 1; n >= 0; --n) {
|
|
319
326
|
if (e[n] === ")") return !1;
|
|
320
|
-
if (e[n] === "(") return n > 0 && e[n - 1] === "]" &&
|
|
327
|
+
if (e[n] === "(") return n > 0 && e[n - 1] === "]" && dt(e, t);
|
|
321
328
|
if (e[n] === "\n") return !1;
|
|
322
329
|
}
|
|
323
330
|
return !1;
|
|
324
|
-
},
|
|
331
|
+
}, pt = (e, t) => {
|
|
325
332
|
for (let n = t - 1; n >= 0; --n) {
|
|
326
333
|
if (e[n] === ">") return !1;
|
|
327
334
|
if (e[n] === "<") {
|
|
@@ -331,7 +338,7 @@ var Ne = Object.defineProperty, Pe = Object.defineProperties, Fe = Object.getOwn
|
|
|
331
338
|
if (e[n] === "\n") return !1;
|
|
332
339
|
}
|
|
333
340
|
return !1;
|
|
334
|
-
},
|
|
341
|
+
}, mt = (e, t, n) => {
|
|
335
342
|
let r = 0;
|
|
336
343
|
for (let n = t - 1; n >= 0; --n) if (e[n] === "\n") {
|
|
337
344
|
r = n + 1;
|
|
@@ -349,13 +356,13 @@ var Ne = Object.defineProperty, Pe = Object.defineProperties, Fe = Object.getOwn
|
|
|
349
356
|
break;
|
|
350
357
|
}
|
|
351
358
|
return o >= 3 && !s;
|
|
352
|
-
},
|
|
353
|
-
let i =
|
|
359
|
+
}, ht = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), gt = (e, t, n, r) => n === "\\" || ht(e) && P(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.length - 2 ? e[t + 2] : "") !== "*" : n === "*" || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n"), _t = (e) => e === " " || e === " " || e === "\n", vt = (e, t) => !!(e && t && M(e) && M(t)), yt = (e, t, n, r) => {
|
|
360
|
+
let i = vt(e, t), a = !!t && !_t(t), o = !!e && !_t(e);
|
|
354
361
|
return i && n % 2 == 0 && !r ? { count: !1 } : o && n % 2 == 1 || a ? {
|
|
355
362
|
count: !0,
|
|
356
363
|
inWordAsteriskChain: i
|
|
357
364
|
} : { count: !1 };
|
|
358
|
-
},
|
|
365
|
+
}, F = (e) => {
|
|
359
366
|
let t = 0, n = !1, r = !1, i = e.length;
|
|
360
367
|
for (let a = 0; a < i; a += 1) {
|
|
361
368
|
if (e[a] === "`" && a + 2 < i && e[a + 1] === "`" && e[a + 2] === "`") {
|
|
@@ -364,16 +371,16 @@ var Ne = Object.defineProperty, Pe = Object.defineProperties, Fe = Object.getOwn
|
|
|
364
371
|
}
|
|
365
372
|
if (n) continue;
|
|
366
373
|
if (e[a] !== "*") {
|
|
367
|
-
|
|
374
|
+
M(e[a]) || (r = !1);
|
|
368
375
|
continue;
|
|
369
376
|
}
|
|
370
377
|
let o = a > 0 ? e[a - 1] : "", s = a < i - 1 ? e[a + 1] : "";
|
|
371
|
-
if (
|
|
372
|
-
let c =
|
|
378
|
+
if (gt(e, a, o, s)) continue;
|
|
379
|
+
let c = yt(o, s, t, r);
|
|
373
380
|
c.count && (t += 1, r = c.inWordAsteriskChain);
|
|
374
381
|
}
|
|
375
382
|
return t;
|
|
376
|
-
},
|
|
383
|
+
}, bt = (e, t, n, r) => !!(n === "\\" || ht(e) && P(e, t) || ft(e, t) || pt(e, t) || n === "_" || r === "_" || n && r && M(n) && M(r)), xt = (e) => {
|
|
377
384
|
let t = 0, n = !1, r = e.length;
|
|
378
385
|
for (let i = 0; i < r; i += 1) {
|
|
379
386
|
if (e[i] === "`" && i + 2 < r && e[i + 1] === "`" && e[i + 2] === "`") {
|
|
@@ -382,10 +389,10 @@ var Ne = Object.defineProperty, Pe = Object.defineProperties, Fe = Object.getOwn
|
|
|
382
389
|
}
|
|
383
390
|
if (n || e[i] !== "_") continue;
|
|
384
391
|
let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
|
|
385
|
-
|
|
392
|
+
bt(e, i, a, o) || (t += 1);
|
|
386
393
|
}
|
|
387
394
|
return t;
|
|
388
|
-
},
|
|
395
|
+
}, St = (e) => {
|
|
389
396
|
let t = 0, n = 0, r = !1;
|
|
390
397
|
for (let i = 0; i < e.length; i += 1) {
|
|
391
398
|
if (e[i] === "`" && i + 2 < e.length && e[i + 1] === "`" && e[i + 2] === "`") {
|
|
@@ -395,7 +402,7 @@ var Ne = Object.defineProperty, Pe = Object.defineProperties, Fe = Object.getOwn
|
|
|
395
402
|
r || (e[i] === "*" ? n += 1 : (n >= 3 && (t += Math.floor(n / 3)), n = 0));
|
|
396
403
|
}
|
|
397
404
|
return n >= 3 && (t += Math.floor(n / 3)), t;
|
|
398
|
-
},
|
|
405
|
+
}, Ct = (e) => {
|
|
399
406
|
let t = 0, n = !1;
|
|
400
407
|
for (let r = 0; r < e.length; r += 1) {
|
|
401
408
|
if (e[r] === "`" && r + 2 < e.length && e[r + 1] === "`" && e[r + 2] === "`") {
|
|
@@ -405,7 +412,7 @@ var Ne = Object.defineProperty, Pe = Object.defineProperties, Fe = Object.getOwn
|
|
|
405
412
|
n || e[r] === "*" && r + 1 < e.length && e[r + 1] === "*" && (t += 1, r += 1);
|
|
406
413
|
}
|
|
407
414
|
return t;
|
|
408
|
-
},
|
|
415
|
+
}, wt = (e) => {
|
|
409
416
|
let t = 0, n = !1;
|
|
410
417
|
for (let r = 0; r < e.length; r += 1) {
|
|
411
418
|
if (e[r] === "`" && r + 2 < e.length && e[r + 1] === "`" && e[r + 2] === "`") {
|
|
@@ -415,143 +422,143 @@ var Ne = Object.defineProperty, Pe = Object.defineProperties, Fe = Object.getOwn
|
|
|
415
422
|
n || e[r] === "_" && r + 1 < e.length && e[r + 1] === "_" && (t += 1, r += 1);
|
|
416
423
|
}
|
|
417
424
|
return t;
|
|
418
|
-
},
|
|
419
|
-
if (!t ||
|
|
425
|
+
}, Tt = (e, t, n) => {
|
|
426
|
+
if (!t || A.test(t)) return !0;
|
|
420
427
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
421
|
-
return
|
|
422
|
-
},
|
|
428
|
+
return j.test(a) && t.includes("\n") ? !0 : mt(e, n, "*");
|
|
429
|
+
}, Et = (e) => {
|
|
423
430
|
let t = e.match(Je);
|
|
424
431
|
if (!t) return e;
|
|
425
432
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
426
|
-
return
|
|
427
|
-
},
|
|
428
|
-
if (!t ||
|
|
433
|
+
return O(e, r) || k(e, r) || Tt(e, n, r) ? e : Ct(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
|
|
434
|
+
}, Dt = (e, t, n) => {
|
|
435
|
+
if (!t || A.test(t)) return !0;
|
|
429
436
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
430
|
-
return
|
|
431
|
-
},
|
|
437
|
+
return j.test(a) && t.includes("\n") ? !0 : mt(e, n, "_");
|
|
438
|
+
}, Ot = (e) => {
|
|
432
439
|
let t = e.match(Ye);
|
|
433
440
|
if (!t) {
|
|
434
|
-
let t = e.match(
|
|
441
|
+
let t = e.match(it);
|
|
435
442
|
if (t) {
|
|
436
443
|
let n = e.lastIndexOf(t[1]);
|
|
437
|
-
if (!(
|
|
444
|
+
if (!(O(e, n) || k(e, n)) && wt(e) % 2 == 1) return `${e}_`;
|
|
438
445
|
}
|
|
439
446
|
return e;
|
|
440
447
|
}
|
|
441
448
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
442
|
-
return
|
|
443
|
-
},
|
|
449
|
+
return O(e, r) || k(e, r) || Dt(e, n, r) ? e : wt(e) % 2 == 1 ? `${e}__` : e;
|
|
450
|
+
}, kt = (e) => {
|
|
444
451
|
let t = !1;
|
|
445
452
|
for (let n = 0; n < e.length; n += 1) {
|
|
446
453
|
if (e[n] === "`" && n + 2 < e.length && e[n + 1] === "`" && e[n + 2] === "`") {
|
|
447
454
|
t = !t, n += 2;
|
|
448
455
|
continue;
|
|
449
456
|
}
|
|
450
|
-
if (!t && e[n] === "*" && e[n - 1] !== "*" && e[n + 1] !== "*" && e[n - 1] !== "\\" && !
|
|
451
|
-
let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "", i = !t ||
|
|
452
|
-
if (i && a || t && r &&
|
|
457
|
+
if (!t && e[n] === "*" && e[n - 1] !== "*" && e[n + 1] !== "*" && e[n - 1] !== "\\" && !P(e, n)) {
|
|
458
|
+
let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "", i = !t || _t(t), a = !r || _t(r);
|
|
459
|
+
if (i && a || t && r && M(t) && M(r) || a) continue;
|
|
453
460
|
return n;
|
|
454
461
|
}
|
|
455
462
|
}
|
|
456
463
|
return -1;
|
|
457
|
-
},
|
|
464
|
+
}, At = (e) => {
|
|
458
465
|
if (!e.match(Ze)) return e;
|
|
459
|
-
let t =
|
|
460
|
-
if (t === -1 ||
|
|
466
|
+
let t = kt(e);
|
|
467
|
+
if (t === -1 || O(e, t) || k(e, t)) return e;
|
|
461
468
|
let n = e.substring(t + 1);
|
|
462
|
-
return !n ||
|
|
463
|
-
},
|
|
469
|
+
return !n || A.test(n) ? e : F(e) % 2 == 1 ? `${e}*` : e;
|
|
470
|
+
}, jt = (e) => {
|
|
464
471
|
let t = !1;
|
|
465
472
|
for (let n = 0; n < e.length; n += 1) {
|
|
466
473
|
if (e[n] === "`" && n + 2 < e.length && e[n + 1] === "`" && e[n + 2] === "`") {
|
|
467
474
|
t = !t, n += 2;
|
|
468
475
|
continue;
|
|
469
476
|
}
|
|
470
|
-
if (!t && e[n] === "_" && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !
|
|
477
|
+
if (!t && e[n] === "_" && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !P(e, n) && !ft(e, n)) {
|
|
471
478
|
let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
|
|
472
|
-
if (t && r &&
|
|
479
|
+
if (t && r && M(t) && M(r)) continue;
|
|
473
480
|
return n;
|
|
474
481
|
}
|
|
475
482
|
}
|
|
476
483
|
return -1;
|
|
477
|
-
},
|
|
484
|
+
}, Mt = (e) => {
|
|
478
485
|
let t = e.length;
|
|
479
486
|
for (; t > 0 && e[t - 1] === "\n";) --t;
|
|
480
487
|
return t < e.length ? `${e.slice(0, t)}_${e.slice(t)}` : `${e}_`;
|
|
481
|
-
},
|
|
488
|
+
}, Nt = (e) => {
|
|
482
489
|
if (!e.endsWith("**")) return null;
|
|
483
490
|
let t = e.slice(0, -2);
|
|
484
|
-
if (
|
|
485
|
-
let n = t.indexOf("**"), r =
|
|
491
|
+
if (Ct(t) % 2 != 1) return null;
|
|
492
|
+
let n = t.indexOf("**"), r = jt(t);
|
|
486
493
|
return n !== -1 && r !== -1 && n < r ? `${t}_**` : null;
|
|
487
|
-
},
|
|
494
|
+
}, I = (e) => {
|
|
488
495
|
if (!e.match(Qe)) return e;
|
|
489
|
-
let t =
|
|
496
|
+
let t = jt(e);
|
|
490
497
|
if (t === -1) return e;
|
|
491
498
|
let n = e.substring(t + 1);
|
|
492
|
-
if (!n ||
|
|
493
|
-
if (
|
|
494
|
-
let t =
|
|
495
|
-
return t === null ?
|
|
499
|
+
if (!n || A.test(n) || O(e, t) || k(e, t)) return e;
|
|
500
|
+
if (xt(e) % 2 == 1) {
|
|
501
|
+
let t = Nt(e);
|
|
502
|
+
return t === null ? Mt(e) : t;
|
|
496
503
|
}
|
|
497
504
|
return e;
|
|
498
|
-
},
|
|
499
|
-
let t =
|
|
505
|
+
}, Pt = (e) => {
|
|
506
|
+
let t = Ct(e), n = F(e);
|
|
500
507
|
return t % 2 == 0 && n % 2 == 0;
|
|
501
|
-
},
|
|
502
|
-
if (
|
|
508
|
+
}, Ft = (e, t, n) => !t || A.test(t) || O(e, n) || k(e, n) ? !0 : mt(e, n, "*"), It = (e) => {
|
|
509
|
+
if (rt.test(e)) return e;
|
|
503
510
|
let t = e.match(Xe);
|
|
504
511
|
if (!t) return e;
|
|
505
512
|
let n = t[2];
|
|
506
|
-
return
|
|
507
|
-
},
|
|
508
|
-
let t = e.match(
|
|
509
|
-
return !t || t.index === void 0 ||
|
|
510
|
-
},
|
|
511
|
-
let t =
|
|
513
|
+
return Ft(e, n, e.lastIndexOf(t[1])) ? e : St(e) % 2 == 1 ? Pt(e) ? e : `${e}***` : e;
|
|
514
|
+
}, Lt = /<[a-zA-Z/][^>]*$/, Rt = (e) => {
|
|
515
|
+
let t = e.match(Lt);
|
|
516
|
+
return !t || t.index === void 0 || O(e, t.index) ? e : e.substring(0, t.index).trimEnd();
|
|
517
|
+
}, zt = (e) => !e.match(nt) || e.includes("\n") ? null : e.endsWith("``") && !e.endsWith("```") ? `${e}\`` : e, Bt = (e) => (e.match(/```/g) || []).length % 2 == 1, Vt = (e) => {
|
|
518
|
+
let t = zt(e);
|
|
512
519
|
if (t !== null) return t;
|
|
513
520
|
let n = e.match($e);
|
|
514
|
-
if (n && !
|
|
521
|
+
if (n && !Bt(e)) {
|
|
515
522
|
let t = n[2];
|
|
516
|
-
if (!t ||
|
|
523
|
+
if (!t || A.test(t)) return e;
|
|
517
524
|
if (Ge(e) % 2 == 1) return `${e}\``;
|
|
518
525
|
}
|
|
519
526
|
return e;
|
|
520
|
-
},
|
|
527
|
+
}, Ht = (e, t) => t >= 2 && e.substring(t - 2, t + 1) === "```" || t >= 1 && e.substring(t - 1, t + 2) === "```" || t <= e.length - 3 && e.substring(t, t + 3) === "```", Ut = (e) => {
|
|
521
528
|
let t = 0, n = !1;
|
|
522
|
-
for (let r = 0; r < e.length - 1; r += 1) e[r] === "`" && !
|
|
529
|
+
for (let r = 0; r < e.length - 1; r += 1) e[r] === "`" && !Ht(e, r) && (n = !n), !n && e[r] === "$" && e[r + 1] === "$" && (t += 1, r += 1);
|
|
523
530
|
return t;
|
|
524
|
-
},
|
|
531
|
+
}, Wt = (e) => {
|
|
525
532
|
let t = 0, n = !1;
|
|
526
533
|
for (let r = 0; r < e.length; r += 1) {
|
|
527
534
|
if (e[r] === "\\") {
|
|
528
535
|
r += 1;
|
|
529
536
|
continue;
|
|
530
537
|
}
|
|
531
|
-
if (e[r] === "`" && !
|
|
538
|
+
if (e[r] === "`" && !Ht(e, r)) {
|
|
532
539
|
n = !n;
|
|
533
540
|
continue;
|
|
534
541
|
}
|
|
535
542
|
!n && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : t += 1);
|
|
536
543
|
}
|
|
537
544
|
return t;
|
|
538
|
-
},
|
|
545
|
+
}, Gt = (e) => {
|
|
539
546
|
if (e.endsWith("$") && !e.endsWith("$$")) return `${e}$`;
|
|
540
547
|
let t = e.indexOf("$$");
|
|
541
548
|
return t !== -1 && e.indexOf("\n", t) !== -1 && !e.endsWith("\n") ? `${e}
|
|
542
549
|
$$` : `${e}$$`;
|
|
543
|
-
},
|
|
550
|
+
}, Kt = (e) => Ut(e) % 2 == 0 ? e : Gt(e), qt = (e) => Wt(e) % 2 == 1 ? `${e}$` : e, Jt = (e, t, n) => {
|
|
544
551
|
if (e.substring(t + 2).includes(")")) return null;
|
|
545
|
-
let r =
|
|
546
|
-
if (r === -1 ||
|
|
552
|
+
let r = st(e, t);
|
|
553
|
+
if (r === -1 || O(e, r)) return null;
|
|
547
554
|
let i = r > 0 && e[r - 1] === "!", a = i ? r - 1 : r, o = e.substring(0, a);
|
|
548
555
|
if (i) return o;
|
|
549
556
|
let s = e.substring(r + 1, t);
|
|
550
557
|
return n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
|
|
551
|
-
},
|
|
552
|
-
for (let n = 0; n < t; n++) if (e[n] === "[" && !
|
|
558
|
+
}, Yt = (e, t) => {
|
|
559
|
+
for (let n = 0; n < t; n++) if (e[n] === "[" && !O(e, n)) {
|
|
553
560
|
if (n > 0 && e[n - 1] === "!") continue;
|
|
554
|
-
let t =
|
|
561
|
+
let t = ct(e, n);
|
|
555
562
|
if (t === -1) return n;
|
|
556
563
|
if (t + 1 < e.length && e[t + 1] === "(") {
|
|
557
564
|
let r = e.indexOf(")", t + 2);
|
|
@@ -559,70 +566,70 @@ $$` : `${e}$$`;
|
|
|
559
566
|
}
|
|
560
567
|
}
|
|
561
568
|
return t;
|
|
562
|
-
},
|
|
569
|
+
}, Xt = (e, t, n) => {
|
|
563
570
|
let r = t > 0 && e[t - 1] === "!", i = r ? t - 1 : t;
|
|
564
571
|
if (!e.substring(t + 1).includes("]")) {
|
|
565
572
|
let a = e.substring(0, i);
|
|
566
573
|
if (r) return a;
|
|
567
574
|
if (n === "text-only") {
|
|
568
|
-
let n =
|
|
575
|
+
let n = Yt(e, t);
|
|
569
576
|
return e.substring(0, n) + e.substring(n + 1);
|
|
570
577
|
}
|
|
571
578
|
return `${e}](streamdown:incomplete-link)`;
|
|
572
579
|
}
|
|
573
|
-
if (
|
|
580
|
+
if (ct(e, t) === -1) {
|
|
574
581
|
let a = e.substring(0, i);
|
|
575
582
|
if (r) return a;
|
|
576
583
|
if (n === "text-only") {
|
|
577
|
-
let n =
|
|
584
|
+
let n = Yt(e, t);
|
|
578
585
|
return e.substring(0, n) + e.substring(n + 1);
|
|
579
586
|
}
|
|
580
587
|
return `${e}](streamdown:incomplete-link)`;
|
|
581
588
|
}
|
|
582
589
|
return null;
|
|
583
|
-
},
|
|
590
|
+
}, Zt = (e, t = "protocol") => {
|
|
584
591
|
let n = e.lastIndexOf("](");
|
|
585
|
-
if (n !== -1 && !
|
|
586
|
-
let r =
|
|
592
|
+
if (n !== -1 && !O(e, n)) {
|
|
593
|
+
let r = Jt(e, n, t);
|
|
587
594
|
if (r !== null) return r;
|
|
588
595
|
}
|
|
589
|
-
for (let n = e.length - 1; n >= 0; --n) if (e[n] === "[" && !
|
|
590
|
-
let r =
|
|
596
|
+
for (let n = e.length - 1; n >= 0; --n) if (e[n] === "[" && !O(e, n)) {
|
|
597
|
+
let r = Xt(e, n, t);
|
|
591
598
|
if (r !== null) return r;
|
|
592
599
|
}
|
|
593
600
|
return e;
|
|
594
|
-
},
|
|
601
|
+
}, Qt = /^-{1,2}$/, $t = /^[\s]*-{1,2}[\s]+$/, en = /^={1,2}$/, tn = /^[\s]*={1,2}[\s]+$/, nn = (e) => {
|
|
595
602
|
if (!e || typeof e != "string") return e;
|
|
596
603
|
let t = e.lastIndexOf("\n");
|
|
597
604
|
if (t === -1) return e;
|
|
598
605
|
let n = e.substring(t + 1), r = e.substring(0, t), i = n.trim();
|
|
599
|
-
if (
|
|
606
|
+
if (Qt.test(i) && !n.match($t)) {
|
|
600
607
|
let t = r.split("\n").at(-1);
|
|
601
608
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
602
609
|
}
|
|
603
|
-
if (
|
|
610
|
+
if (en.test(i) && !n.match(tn)) {
|
|
604
611
|
let t = r.split("\n").at(-1);
|
|
605
612
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
606
613
|
}
|
|
607
614
|
return e;
|
|
608
|
-
},
|
|
615
|
+
}, rn = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, an = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(rn, (t, n, r) => O(e, r + n.length) ? t : `${n}\\~`), on = (e) => {
|
|
609
616
|
let t = e.match(et);
|
|
610
617
|
if (t) {
|
|
611
618
|
let n = t[2];
|
|
612
|
-
if (!n ||
|
|
619
|
+
if (!n || A.test(n)) return e;
|
|
613
620
|
let r = e.lastIndexOf(t[1]);
|
|
614
|
-
if (
|
|
615
|
-
if (e.match(
|
|
621
|
+
if (O(e, r) || k(e, r)) return e;
|
|
622
|
+
if (e.match(ot)?.length % 2 == 1) return `${e}~~`;
|
|
616
623
|
} else {
|
|
617
|
-
let t = e.match(
|
|
624
|
+
let t = e.match(at);
|
|
618
625
|
if (t) {
|
|
619
626
|
let n = e.lastIndexOf(t[0].slice(0, 2));
|
|
620
|
-
if (
|
|
621
|
-
if (e.match(
|
|
627
|
+
if (O(e, n) || k(e, n)) return e;
|
|
628
|
+
if (e.match(ot)?.length % 2 == 1) return `${e}~`;
|
|
622
629
|
}
|
|
623
630
|
}
|
|
624
631
|
return e;
|
|
625
|
-
},
|
|
632
|
+
}, sn = (e) => e !== !1, cn = (e) => e === !0, L = {
|
|
626
633
|
SINGLE_TILDE: 0,
|
|
627
634
|
COMPARISON_OPERATORS: 5,
|
|
628
635
|
HTML_TAGS: 10,
|
|
@@ -638,12 +645,12 @@ $$` : `${e}$$`;
|
|
|
638
645
|
KATEX: 70,
|
|
639
646
|
INLINE_KATEX: 75,
|
|
640
647
|
DEFAULT: 100
|
|
641
|
-
},
|
|
648
|
+
}, ln = [
|
|
642
649
|
{
|
|
643
650
|
handler: {
|
|
644
651
|
name: "singleTilde",
|
|
645
|
-
handle:
|
|
646
|
-
priority:
|
|
652
|
+
handle: an,
|
|
653
|
+
priority: L.SINGLE_TILDE
|
|
647
654
|
},
|
|
648
655
|
optionKey: "singleTilde"
|
|
649
656
|
},
|
|
@@ -651,31 +658,31 @@ $$` : `${e}$$`;
|
|
|
651
658
|
handler: {
|
|
652
659
|
name: "comparisonOperators",
|
|
653
660
|
handle: qe,
|
|
654
|
-
priority:
|
|
661
|
+
priority: L.COMPARISON_OPERATORS
|
|
655
662
|
},
|
|
656
663
|
optionKey: "comparisonOperators"
|
|
657
664
|
},
|
|
658
665
|
{
|
|
659
666
|
handler: {
|
|
660
667
|
name: "htmlTags",
|
|
661
|
-
handle:
|
|
662
|
-
priority:
|
|
668
|
+
handle: Rt,
|
|
669
|
+
priority: L.HTML_TAGS
|
|
663
670
|
},
|
|
664
671
|
optionKey: "htmlTags"
|
|
665
672
|
},
|
|
666
673
|
{
|
|
667
674
|
handler: {
|
|
668
675
|
name: "setextHeadings",
|
|
669
|
-
handle:
|
|
670
|
-
priority:
|
|
676
|
+
handle: nn,
|
|
677
|
+
priority: L.SETEXT_HEADINGS
|
|
671
678
|
},
|
|
672
679
|
optionKey: "setextHeadings"
|
|
673
680
|
},
|
|
674
681
|
{
|
|
675
682
|
handler: {
|
|
676
683
|
name: "links",
|
|
677
|
-
handle:
|
|
678
|
-
priority:
|
|
684
|
+
handle: Zt,
|
|
685
|
+
priority: L.LINKS
|
|
679
686
|
},
|
|
680
687
|
optionKey: "links",
|
|
681
688
|
earlyReturn: (e) => e.endsWith("](streamdown:incomplete-link)")
|
|
@@ -683,88 +690,88 @@ $$` : `${e}$$`;
|
|
|
683
690
|
{
|
|
684
691
|
handler: {
|
|
685
692
|
name: "boldItalic",
|
|
686
|
-
handle:
|
|
687
|
-
priority:
|
|
693
|
+
handle: It,
|
|
694
|
+
priority: L.BOLD_ITALIC
|
|
688
695
|
},
|
|
689
696
|
optionKey: "boldItalic"
|
|
690
697
|
},
|
|
691
698
|
{
|
|
692
699
|
handler: {
|
|
693
700
|
name: "bold",
|
|
694
|
-
handle:
|
|
695
|
-
priority:
|
|
701
|
+
handle: Et,
|
|
702
|
+
priority: L.BOLD
|
|
696
703
|
},
|
|
697
704
|
optionKey: "bold"
|
|
698
705
|
},
|
|
699
706
|
{
|
|
700
707
|
handler: {
|
|
701
708
|
name: "italicDoubleUnderscore",
|
|
702
|
-
handle:
|
|
703
|
-
priority:
|
|
709
|
+
handle: Ot,
|
|
710
|
+
priority: L.ITALIC_DOUBLE_UNDERSCORE
|
|
704
711
|
},
|
|
705
712
|
optionKey: "italic"
|
|
706
713
|
},
|
|
707
714
|
{
|
|
708
715
|
handler: {
|
|
709
716
|
name: "italicSingleAsterisk",
|
|
710
|
-
handle:
|
|
711
|
-
priority:
|
|
717
|
+
handle: At,
|
|
718
|
+
priority: L.ITALIC_SINGLE_ASTERISK
|
|
712
719
|
},
|
|
713
720
|
optionKey: "italic"
|
|
714
721
|
},
|
|
715
722
|
{
|
|
716
723
|
handler: {
|
|
717
724
|
name: "italicSingleUnderscore",
|
|
718
|
-
handle:
|
|
719
|
-
priority:
|
|
725
|
+
handle: I,
|
|
726
|
+
priority: L.ITALIC_SINGLE_UNDERSCORE
|
|
720
727
|
},
|
|
721
728
|
optionKey: "italic"
|
|
722
729
|
},
|
|
723
730
|
{
|
|
724
731
|
handler: {
|
|
725
732
|
name: "inlineCode",
|
|
726
|
-
handle:
|
|
727
|
-
priority:
|
|
733
|
+
handle: Vt,
|
|
734
|
+
priority: L.INLINE_CODE
|
|
728
735
|
},
|
|
729
736
|
optionKey: "inlineCode"
|
|
730
737
|
},
|
|
731
738
|
{
|
|
732
739
|
handler: {
|
|
733
740
|
name: "strikethrough",
|
|
734
|
-
handle:
|
|
735
|
-
priority:
|
|
741
|
+
handle: on,
|
|
742
|
+
priority: L.STRIKETHROUGH
|
|
736
743
|
},
|
|
737
744
|
optionKey: "strikethrough"
|
|
738
745
|
},
|
|
739
746
|
{
|
|
740
747
|
handler: {
|
|
741
748
|
name: "katex",
|
|
742
|
-
handle:
|
|
743
|
-
priority:
|
|
749
|
+
handle: Kt,
|
|
750
|
+
priority: L.KATEX
|
|
744
751
|
},
|
|
745
752
|
optionKey: "katex"
|
|
746
753
|
},
|
|
747
754
|
{
|
|
748
755
|
handler: {
|
|
749
756
|
name: "inlineKatex",
|
|
750
|
-
handle:
|
|
751
|
-
priority:
|
|
757
|
+
handle: qt,
|
|
758
|
+
priority: L.INLINE_KATEX
|
|
752
759
|
},
|
|
753
760
|
optionKey: "inlineKatex"
|
|
754
761
|
}
|
|
755
|
-
],
|
|
762
|
+
], un = (e) => {
|
|
756
763
|
let t = e?.linkMode ?? "protocol";
|
|
757
|
-
return
|
|
758
|
-
handler: Ve(
|
|
764
|
+
return ln.filter(({ handler: t, optionKey: n }) => t.name === "links" ? sn(e?.links) || sn(e?.images) : t.name === "inlineKatex" ? cn(e?.inlineKatex) : sn(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
|
|
765
|
+
handler: D(Ve({}, e), { handle: (e) => Zt(e, t) }),
|
|
759
766
|
earlyReturn: t === "protocol" ? n : void 0
|
|
760
767
|
} : {
|
|
761
768
|
handler: e,
|
|
762
769
|
earlyReturn: n
|
|
763
770
|
});
|
|
764
|
-
},
|
|
771
|
+
}, dn = (e, t) => {
|
|
765
772
|
if (!e || typeof e != "string") return e;
|
|
766
|
-
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r =
|
|
767
|
-
handler: Ve(
|
|
773
|
+
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = un(t), i = (t?.handlers ?? []).map((e) => ({
|
|
774
|
+
handler: D(Ve({}, e), { priority: e.priority ?? L.DEFAULT }),
|
|
768
775
|
earlyReturn: void 0
|
|
769
776
|
})), a = [...r, ...i].sort((e, t) => (e.handler.priority ?? 0) - (t.handler.priority ?? 0));
|
|
770
777
|
for (let { handler: e, earlyReturn: t } of a) if (n = e.handle(n), t != null && t(n)) return n;
|
|
@@ -772,7 +779,7 @@ $$` : `${e}$$`;
|
|
|
772
779
|
};
|
|
773
780
|
//#endregion
|
|
774
781
|
//#region ../../node_modules/.pnpm/marked@18.0.14/node_modules/marked/lib/marked.esm.js
|
|
775
|
-
function
|
|
782
|
+
function fn() {
|
|
776
783
|
return {
|
|
777
784
|
async: !1,
|
|
778
785
|
breaks: !1,
|
|
@@ -786,23 +793,23 @@ function hn() {
|
|
|
786
793
|
walkTokens: null
|
|
787
794
|
};
|
|
788
795
|
}
|
|
789
|
-
var
|
|
790
|
-
function
|
|
791
|
-
|
|
796
|
+
var pn = fn();
|
|
797
|
+
function mn(e) {
|
|
798
|
+
pn = e;
|
|
792
799
|
}
|
|
793
|
-
var
|
|
794
|
-
function
|
|
800
|
+
var hn = { exec: () => null };
|
|
801
|
+
function gn(e) {
|
|
795
802
|
let t = [];
|
|
796
803
|
return (n) => {
|
|
797
804
|
let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
|
|
798
805
|
return i || (i = e(r), t[r] = i), i;
|
|
799
806
|
};
|
|
800
807
|
}
|
|
801
|
-
function
|
|
808
|
+
function R(e, t = "") {
|
|
802
809
|
let n = typeof e == "string" ? e : e.source, r = {
|
|
803
810
|
replace: (e, t) => {
|
|
804
811
|
let i = typeof t == "string" ? t : t.source;
|
|
805
|
-
return i = i.replace(
|
|
812
|
+
return i = i.replace(z.caret, "$1"), n = n.replace(e, i), r;
|
|
806
813
|
},
|
|
807
814
|
getRegex: () => new RegExp(n, t)
|
|
808
815
|
};
|
|
@@ -814,7 +821,7 @@ var _n = ((e = "") => {
|
|
|
814
821
|
} catch {
|
|
815
822
|
return !1;
|
|
816
823
|
}
|
|
817
|
-
})(),
|
|
824
|
+
})(), z = {
|
|
818
825
|
codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm,
|
|
819
826
|
outputLinkReplace: /\\([\[\]])/g,
|
|
820
827
|
indentCodeCompensation: /^(\s+)(?:```)/,
|
|
@@ -868,132 +875,132 @@ var _n = ((e = "") => {
|
|
|
868
875
|
notSpaceStart: /^\S*/,
|
|
869
876
|
endingNewline: /\n$/,
|
|
870
877
|
listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
871
|
-
nextBulletRegex:
|
|
872
|
-
hrRegex:
|
|
873
|
-
fencesBeginRegex:
|
|
874
|
-
headingBeginRegex:
|
|
875
|
-
htmlBeginRegex:
|
|
876
|
-
blockquoteBeginRegex:
|
|
877
|
-
}, vn = /^(?:[ \t]*(?:\n|$))+/, yn = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, bn = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
|
|
878
|
-
blockquote:
|
|
878
|
+
nextBulletRegex: gn((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
|
|
879
|
+
hrRegex: gn((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
|
|
880
|
+
fencesBeginRegex: gn((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
|
|
881
|
+
headingBeginRegex: gn((e) => RegExp(`^ {0,${e}}#`)),
|
|
882
|
+
htmlBeginRegex: gn((e) => RegExp(`^ {0,${e}}(?:</?(?:${Mn})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
|
|
883
|
+
blockquoteBeginRegex: gn((e) => RegExp(`^ {0,${e}}>`))
|
|
884
|
+
}, vn = /^(?:[ \t]*(?:\n|$))+/, yn = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, bn = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, xn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Sn = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Cn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, wn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Tn = R(wn).replace(/bull/g, Cn).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(), En = R(wn).replace(/bull/g, Cn).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(), Dn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, On = /^[^\n]+/, kn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, An = R(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", kn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), jn = R(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Cn).getRegex(), Mn = "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", Nn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Pn = 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", Nn).replace("tag", Mn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Fn = (e) => R(Dn).replace("hr", xn).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", Mn).getRegex(), In = Fn(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Ln = Fn(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Rn = {
|
|
885
|
+
blockquote: R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ln).getRegex(),
|
|
879
886
|
code: yn,
|
|
880
|
-
def:
|
|
887
|
+
def: An,
|
|
881
888
|
fences: bn,
|
|
882
|
-
heading:
|
|
883
|
-
hr:
|
|
884
|
-
html:
|
|
885
|
-
lheading: wn,
|
|
886
|
-
list: An,
|
|
887
|
-
newline: vn,
|
|
888
|
-
paragraph: Pn,
|
|
889
|
-
table: N,
|
|
890
|
-
text: Dn
|
|
891
|
-
}, Ln = F("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", L).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", R).getRegex(), Rn = {
|
|
892
|
-
...In,
|
|
889
|
+
heading: Sn,
|
|
890
|
+
hr: xn,
|
|
891
|
+
html: Pn,
|
|
893
892
|
lheading: Tn,
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
893
|
+
list: jn,
|
|
894
|
+
newline: vn,
|
|
895
|
+
paragraph: In,
|
|
896
|
+
table: hn,
|
|
897
|
+
text: On
|
|
898
|
+
}, zn = R("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", xn).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", Mn).getRegex(), Bn = {
|
|
899
|
+
...Rn,
|
|
900
|
+
lheading: En,
|
|
901
|
+
table: zn,
|
|
902
|
+
paragraph: R(Dn).replace("hr", xn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", zn).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", Mn).getRegex()
|
|
903
|
+
}, Vn = {
|
|
904
|
+
...Rn,
|
|
905
|
+
html: R("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Nn).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(),
|
|
899
906
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
900
907
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
901
|
-
fences:
|
|
908
|
+
fences: hn,
|
|
902
909
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
903
|
-
paragraph:
|
|
904
|
-
},
|
|
905
|
-
_backpedal:
|
|
906
|
-
anyPunctuation:
|
|
907
|
-
autolink:
|
|
908
|
-
blockSkip:
|
|
909
|
-
br:
|
|
910
|
-
code:
|
|
911
|
-
del:
|
|
912
|
-
delLDelim:
|
|
913
|
-
delRDelim:
|
|
914
|
-
emStrongLDelim:
|
|
915
|
-
emStrongRDelimAst:
|
|
916
|
-
emStrongRDelimUnd:
|
|
917
|
-
escape:
|
|
918
|
-
link:
|
|
919
|
-
nolink:
|
|
920
|
-
punctuation:
|
|
921
|
-
reflink:
|
|
922
|
-
reflinkSearch:
|
|
923
|
-
tag:
|
|
924
|
-
text:
|
|
925
|
-
url:
|
|
926
|
-
},
|
|
927
|
-
...
|
|
928
|
-
emStrongLDelim:
|
|
929
|
-
emStrongRDelimAst:
|
|
930
|
-
emStrongRDelimUnd:
|
|
931
|
-
link:
|
|
932
|
-
reflink:
|
|
933
|
-
},
|
|
934
|
-
...
|
|
935
|
-
emStrongRDelimAst:
|
|
936
|
-
emStrongLDelim:
|
|
937
|
-
delLDelim:
|
|
938
|
-
delRDelim:
|
|
939
|
-
url:
|
|
910
|
+
paragraph: R(Dn).replace("hr", xn).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Tn).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
911
|
+
}, Hn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Un = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Wn = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, Gn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, B = /[\p{P}\p{S}]/u, Kn = /[\s\p{P}\p{S}]/u, qn = /[^\s\p{P}\p{S}]/u, Jn = R(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Kn).getRegex(), Yn = /[\p{Pi}\p{Ps}"']/u, Xn = /(?!~)[\p{P}\p{S}]/u, Zn = /(?!~)[\s\p{P}\p{S}]/u, Qn = /(?:[^\s\p{P}\p{S}]|~)/u, $n = R(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", _n ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), er = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, tr = R(er, "u").replace(/punct/g, B).getRegex(), nr = R(er, "u").replace(/punct/g, Xn).getRegex(), rr = R(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Yn).replace(/punct/g, B).getRegex(), ir = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ar = R(ir, "gu").replace(/notPunctSpace/g, qn).replace(/punctSpace/g, Kn).replace(/punct/g, B).getRegex(), or = R(ir, "gu").replace(/notPunctSpace/g, Qn).replace(/punctSpace/g, Zn).replace(/punct/g, Xn).getRegex(), sr = R("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, qn).replace(/punctSpace/g, Kn).replace(/punct/g, B).getRegex(), cr = R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, qn).replace(/punctSpace/g, Kn).replace(/punct/g, B).getRegex(), lr = R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, qn).replace(/punctSpace/g, Kn).replace(/punct/g, B).getRegex(), ur = R(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, B).getRegex(), dr = R("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, qn).replace(/punctSpace/g, Kn).replace(/punct/g, B).getRegex(), fr = R(/\\(punct)/, "gu").replace(/punct/g, B).getRegex(), pr = 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(), mr = R(Nn).replace("(?:-->|$)", "-->").getRegex(), hr = 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", mr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), gr = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, _r = R(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", gr).getRegex(), vr = R(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", _r).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), yr = R(/^!?\[(label)\]\[(ref)\]/).replace("label", _r).replace("ref", kn).getRegex(), br = R(/^!?\[(ref)\](?:\[\])?/).replace("ref", kn).getRegex(), xr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, Sr = R(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", gr).getRegex(), Cr = R("reflink|nolink(?!\\()", "g").replace("reflink", R(/^!?\[(label)\]\[(ref)\]/).replace("label", Sr).replace("ref", xr).getRegex()).replace("nolink", R(/^!?\[(ref)\](?:\[\])?/).replace("ref", xr).getRegex()).getRegex(), wr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Tr = 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(), Er = {
|
|
912
|
+
_backpedal: hn,
|
|
913
|
+
anyPunctuation: fr,
|
|
914
|
+
autolink: pr,
|
|
915
|
+
blockSkip: $n,
|
|
916
|
+
br: Wn,
|
|
917
|
+
code: Un,
|
|
918
|
+
del: hn,
|
|
919
|
+
delLDelim: hn,
|
|
920
|
+
delRDelim: hn,
|
|
921
|
+
emStrongLDelim: tr,
|
|
922
|
+
emStrongRDelimAst: ar,
|
|
923
|
+
emStrongRDelimUnd: cr,
|
|
924
|
+
escape: Hn,
|
|
925
|
+
link: vr,
|
|
926
|
+
nolink: br,
|
|
927
|
+
punctuation: Jn,
|
|
928
|
+
reflink: yr,
|
|
929
|
+
reflinkSearch: Cr,
|
|
930
|
+
tag: hr,
|
|
931
|
+
text: Gn,
|
|
932
|
+
url: hn
|
|
933
|
+
}, Dr = {
|
|
934
|
+
...Er,
|
|
935
|
+
emStrongLDelim: rr,
|
|
936
|
+
emStrongRDelimAst: sr,
|
|
937
|
+
emStrongRDelimUnd: lr,
|
|
938
|
+
link: R(/^!?\[(label)\]\((.*?)\)/).replace("label", _r).getRegex(),
|
|
939
|
+
reflink: R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", _r).getRegex()
|
|
940
|
+
}, Or = {
|
|
941
|
+
...Er,
|
|
942
|
+
emStrongRDelimAst: or,
|
|
943
|
+
emStrongLDelim: nr,
|
|
944
|
+
delLDelim: ur,
|
|
945
|
+
delRDelim: dr,
|
|
946
|
+
url: R(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", Tr).replace("protocol", wr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
|
|
940
947
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
941
948
|
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
942
|
-
text:
|
|
943
|
-
},
|
|
944
|
-
...
|
|
945
|
-
br:
|
|
946
|
-
text:
|
|
947
|
-
},
|
|
948
|
-
normal:
|
|
949
|
-
gfm:
|
|
950
|
-
pedantic:
|
|
951
|
-
},
|
|
952
|
-
normal:
|
|
953
|
-
gfm:
|
|
954
|
-
breaks:
|
|
955
|
-
pedantic:
|
|
956
|
-
},
|
|
949
|
+
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", wr).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
|
|
950
|
+
}, kr = {
|
|
951
|
+
...Or,
|
|
952
|
+
br: R(Wn).replace("{2,}", "*").getRegex(),
|
|
953
|
+
text: R(Or.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
954
|
+
}, Ar = {
|
|
955
|
+
normal: Rn,
|
|
956
|
+
gfm: Bn,
|
|
957
|
+
pedantic: Vn
|
|
958
|
+
}, jr = {
|
|
959
|
+
normal: Er,
|
|
960
|
+
gfm: Or,
|
|
961
|
+
breaks: kr,
|
|
962
|
+
pedantic: Dr
|
|
963
|
+
}, Mr = {
|
|
957
964
|
"&": "&",
|
|
958
965
|
"<": "<",
|
|
959
966
|
">": ">",
|
|
960
967
|
"\"": """,
|
|
961
968
|
"'": "'"
|
|
962
|
-
},
|
|
963
|
-
function
|
|
969
|
+
}, Nr = (e) => Mr[e];
|
|
970
|
+
function V(e, t) {
|
|
964
971
|
if (t) {
|
|
965
|
-
if (
|
|
966
|
-
} else if (
|
|
972
|
+
if (z.escapeTest.test(e)) return e.replace(z.escapeReplace, Nr);
|
|
973
|
+
} else if (z.escapeTestNoEncode.test(e)) return e.replace(z.escapeReplaceNoEncode, Nr);
|
|
967
974
|
return e;
|
|
968
975
|
}
|
|
969
|
-
function
|
|
970
|
-
return e.replace(
|
|
976
|
+
function Pr(e) {
|
|
977
|
+
return e.replace(z.numericCharacterReference, (e, t, n) => {
|
|
971
978
|
let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
|
|
972
979
|
return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : String.fromCodePoint(r);
|
|
973
980
|
});
|
|
974
981
|
}
|
|
975
|
-
function
|
|
982
|
+
function Fr(e) {
|
|
976
983
|
try {
|
|
977
|
-
e = encodeURI(e).replace(
|
|
984
|
+
e = encodeURI(e).replace(z.percentDecode, "%");
|
|
978
985
|
} catch {
|
|
979
986
|
return null;
|
|
980
987
|
}
|
|
981
988
|
return e;
|
|
982
989
|
}
|
|
983
|
-
function
|
|
984
|
-
let n = e.replace(
|
|
990
|
+
function Ir(e, t) {
|
|
991
|
+
let n = e.replace(z.findPipe, (e, t, n) => {
|
|
985
992
|
let r = !1, i = t;
|
|
986
993
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
987
994
|
return r ? "|" : " |";
|
|
988
|
-
}).split(
|
|
995
|
+
}).split(z.splitPipe), r = 0;
|
|
989
996
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) {
|
|
990
997
|
if (n.length > t) n.splice(t);
|
|
991
998
|
else for (; n.length < t;) n.push("");
|
|
992
999
|
}
|
|
993
|
-
for (; r < n.length; r++) n[r] = n[r].trim().replace(
|
|
1000
|
+
for (; r < n.length; r++) n[r] = n[r].trim().replace(z.slashPipe, "|");
|
|
994
1001
|
return n;
|
|
995
1002
|
}
|
|
996
|
-
function
|
|
1003
|
+
function Lr(e, t, n) {
|
|
997
1004
|
let r = e.length;
|
|
998
1005
|
if (r === 0) return "";
|
|
999
1006
|
let i = 0;
|
|
@@ -1005,15 +1012,15 @@ function K(e, t, n) {
|
|
|
1005
1012
|
}
|
|
1006
1013
|
return e.slice(0, r - i);
|
|
1007
1014
|
}
|
|
1008
|
-
function
|
|
1015
|
+
function Rr(e) {
|
|
1009
1016
|
let t = e.split("\n"), n = t.length - 1;
|
|
1010
|
-
for (; n >= 0 &&
|
|
1017
|
+
for (; n >= 0 && z.blankLine.test(t[n]);) n--;
|
|
1011
1018
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
1012
1019
|
}
|
|
1013
|
-
function
|
|
1020
|
+
function zr(e) {
|
|
1014
1021
|
return e.trim().toLowerCase().toUpperCase().toLowerCase();
|
|
1015
1022
|
}
|
|
1016
|
-
function
|
|
1023
|
+
function Br(e, t) {
|
|
1017
1024
|
if (e.indexOf(t[1]) === -1) return -1;
|
|
1018
1025
|
let n = 0;
|
|
1019
1026
|
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
@@ -1021,7 +1028,7 @@ function jr(e, t) {
|
|
|
1021
1028
|
else if (e[r] === t[1] && (n--, n < 0)) return r;
|
|
1022
1029
|
return n > 0 ? -2 : -1;
|
|
1023
1030
|
}
|
|
1024
|
-
function
|
|
1031
|
+
function Vr(e, t = 0) {
|
|
1025
1032
|
let n = t, r = "";
|
|
1026
1033
|
for (let t of e) if (t === " ") {
|
|
1027
1034
|
let e = 4 - n % 4;
|
|
@@ -1029,7 +1036,7 @@ function Mr(e, t = 0) {
|
|
|
1029
1036
|
} else r += t, n++;
|
|
1030
1037
|
return r;
|
|
1031
1038
|
}
|
|
1032
|
-
function
|
|
1039
|
+
function Hr(e, t, n, r, i) {
|
|
1033
1040
|
let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!";
|
|
1034
1041
|
r.state.inLink = !0;
|
|
1035
1042
|
let l = r.state.linkEmitted, u = r.state.inRawBlock;
|
|
@@ -1051,7 +1058,7 @@ function Nr(e, t, n, r, i) {
|
|
|
1051
1058
|
tokens: d
|
|
1052
1059
|
};
|
|
1053
1060
|
}
|
|
1054
|
-
function
|
|
1061
|
+
function Ur(e, t, n) {
|
|
1055
1062
|
let r = e.match(n.other.indentCodeCompensation);
|
|
1056
1063
|
if (r === null) return t;
|
|
1057
1064
|
let i = r[1];
|
|
@@ -1062,7 +1069,7 @@ function Pr(e, t, n) {
|
|
|
1062
1069
|
return e.slice(Math.min(r.length, i.length));
|
|
1063
1070
|
}).join("\n");
|
|
1064
1071
|
}
|
|
1065
|
-
function
|
|
1072
|
+
function Wr(e, t, n, r) {
|
|
1066
1073
|
if (!t.includes("<")) return !1;
|
|
1067
1074
|
for (let i = 0; i < t.length; i++) {
|
|
1068
1075
|
if (t[i] === "\\") {
|
|
@@ -1085,12 +1092,12 @@ function Fr(e, t, n, r) {
|
|
|
1085
1092
|
}
|
|
1086
1093
|
return !1;
|
|
1087
1094
|
}
|
|
1088
|
-
var
|
|
1095
|
+
var Gr = class {
|
|
1089
1096
|
options;
|
|
1090
1097
|
rules;
|
|
1091
1098
|
lexer;
|
|
1092
1099
|
constructor(e) {
|
|
1093
|
-
this.options = e ||
|
|
1100
|
+
this.options = e || pn;
|
|
1094
1101
|
}
|
|
1095
1102
|
space(e) {
|
|
1096
1103
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -1102,7 +1109,7 @@ var J = class {
|
|
|
1102
1109
|
code(e) {
|
|
1103
1110
|
let t = this.rules.block.code.exec(e);
|
|
1104
1111
|
if (t) {
|
|
1105
|
-
let e = this.options.pedantic ? t[0] :
|
|
1112
|
+
let e = this.options.pedantic ? t[0] : Rr(t[0]);
|
|
1106
1113
|
return {
|
|
1107
1114
|
type: "code",
|
|
1108
1115
|
raw: e,
|
|
@@ -1114,7 +1121,7 @@ var J = class {
|
|
|
1114
1121
|
fences(e) {
|
|
1115
1122
|
let t = this.rules.block.fences.exec(e);
|
|
1116
1123
|
if (t) {
|
|
1117
|
-
let e = t[0], n =
|
|
1124
|
+
let e = t[0], n = Ur(e, t[3] || "", this.rules);
|
|
1118
1125
|
return {
|
|
1119
1126
|
type: "code",
|
|
1120
1127
|
raw: e,
|
|
@@ -1128,12 +1135,12 @@ var J = class {
|
|
|
1128
1135
|
if (t) {
|
|
1129
1136
|
let e = t[2].trim();
|
|
1130
1137
|
if (this.rules.other.endingHash.test(e)) {
|
|
1131
|
-
let t =
|
|
1138
|
+
let t = Lr(e, "#");
|
|
1132
1139
|
(this.options.pedantic || !t || this.rules.other.endingSpaceTabChar.test(t)) && (e = t.trim());
|
|
1133
1140
|
}
|
|
1134
1141
|
return {
|
|
1135
1142
|
type: "heading",
|
|
1136
|
-
raw:
|
|
1143
|
+
raw: Lr(t[0], "\n"),
|
|
1137
1144
|
depth: t[1].length,
|
|
1138
1145
|
text: e,
|
|
1139
1146
|
tokens: this.lexer.inline(e)
|
|
@@ -1144,13 +1151,13 @@ var J = class {
|
|
|
1144
1151
|
let t = this.rules.block.hr.exec(e);
|
|
1145
1152
|
if (t) return {
|
|
1146
1153
|
type: "hr",
|
|
1147
|
-
raw:
|
|
1154
|
+
raw: Lr(t[0], "\n")
|
|
1148
1155
|
};
|
|
1149
1156
|
}
|
|
1150
1157
|
blockquote(e) {
|
|
1151
1158
|
let t = this.rules.block.blockquote.exec(e);
|
|
1152
1159
|
if (t) {
|
|
1153
|
-
let e =
|
|
1160
|
+
let e = Lr(t[0], "\n").split("\n"), n = "", r = "", i = [];
|
|
1154
1161
|
for (; e.length > 0;) {
|
|
1155
1162
|
let t = !1, a = [], o = 0;
|
|
1156
1163
|
for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
|
|
@@ -1204,18 +1211,18 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1204
1211
|
let n = !1, r = "", s = "";
|
|
1205
1212
|
if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
1206
1213
|
r = t[0], e = e.substring(r.length);
|
|
1207
|
-
let c = t[2].split("\n", 1)[0], l = t[1].length, u = this.options.pedantic ?
|
|
1214
|
+
let c = t[2].split("\n", 1)[0], l = t[1].length, u = this.options.pedantic ? Vr(c, l) : c.replace(this.rules.other.leadingSpaceTab, (e) => Vr(e, l)), d = e.split("\n", 1)[0], f = !u.trim(), p = 0;
|
|
1208
1215
|
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) {
|
|
1209
1216
|
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);
|
|
1210
1217
|
for (; e;) {
|
|
1211
|
-
let l = e.split("\n", 1)[0],
|
|
1212
|
-
if (d = l, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "),
|
|
1213
|
-
if (
|
|
1218
|
+
let l = e.split("\n", 1)[0], ee;
|
|
1219
|
+
if (d = l, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), ee = d) : ee = d.replace(this.rules.other.leadingSpaceTab, (e) => e.replace(this.rules.other.tabCharGlobal, " ")), i.test(d) || a.test(d) || o.test(d) || c.test(d) || t.test(d) || n.test(d)) break;
|
|
1220
|
+
if (ee.search(this.rules.other.nonSpaceChar) >= p || !d.trim()) s += "\n" + ee.slice(p);
|
|
1214
1221
|
else {
|
|
1215
1222
|
if (f || u.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(u) || a.test(u) || n.test(u)) break;
|
|
1216
1223
|
s += "\n" + d;
|
|
1217
1224
|
}
|
|
1218
|
-
f = !d.trim(), r += l + "\n", e = e.substring(l.length + 1), u =
|
|
1225
|
+
f = !d.trim(), r += l + "\n", e = e.substring(l.length + 1), u = ee.slice(p);
|
|
1219
1226
|
}
|
|
1220
1227
|
}
|
|
1221
1228
|
i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0)), i.items.push({
|
|
@@ -1269,7 +1276,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1269
1276
|
html(e) {
|
|
1270
1277
|
let t = this.rules.block.html.exec(e);
|
|
1271
1278
|
if (t) {
|
|
1272
|
-
let e =
|
|
1279
|
+
let e = Rr(t[0]);
|
|
1273
1280
|
return {
|
|
1274
1281
|
type: "html",
|
|
1275
1282
|
block: !0,
|
|
@@ -1282,11 +1289,11 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1282
1289
|
def(e) {
|
|
1283
1290
|
let t = this.rules.block.def.exec(e);
|
|
1284
1291
|
if (t) {
|
|
1285
|
-
let e =
|
|
1292
|
+
let e = zr(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];
|
|
1286
1293
|
return {
|
|
1287
1294
|
type: "def",
|
|
1288
1295
|
tag: e,
|
|
1289
|
-
raw:
|
|
1296
|
+
raw: Lr(t[0], "\n"),
|
|
1290
1297
|
href: n,
|
|
1291
1298
|
title: r
|
|
1292
1299
|
};
|
|
@@ -1295,9 +1302,9 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1295
1302
|
table(e) {
|
|
1296
1303
|
let t = this.rules.block.table.exec(e);
|
|
1297
1304
|
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
1298
|
-
let n =
|
|
1305
|
+
let n = Ir(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 = {
|
|
1299
1306
|
type: "table",
|
|
1300
|
-
raw:
|
|
1307
|
+
raw: Lr(t[0], "\n"),
|
|
1301
1308
|
header: [],
|
|
1302
1309
|
align: [],
|
|
1303
1310
|
rows: []
|
|
@@ -1310,7 +1317,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1310
1317
|
header: !0,
|
|
1311
1318
|
align: a.align[e]
|
|
1312
1319
|
});
|
|
1313
|
-
for (let e of i) a.rows.push(
|
|
1320
|
+
for (let e of i) a.rows.push(Ir(e, a.header.length).map((e, t) => ({
|
|
1314
1321
|
text: e,
|
|
1315
1322
|
tokens: this.lexer.inline(e),
|
|
1316
1323
|
header: !1,
|
|
@@ -1325,7 +1332,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1325
1332
|
let e = t[1].trim();
|
|
1326
1333
|
return {
|
|
1327
1334
|
type: "heading",
|
|
1328
|
-
raw:
|
|
1335
|
+
raw: Lr(t[0], "\n"),
|
|
1329
1336
|
depth: t[2].charAt(0) === "=" ? 1 : 2,
|
|
1330
1337
|
text: e,
|
|
1331
1338
|
tokens: this.lexer.inline(e)
|
|
@@ -1376,14 +1383,14 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1376
1383
|
let t = this.rules.inline.link.exec(e);
|
|
1377
1384
|
if (t) {
|
|
1378
1385
|
let n = t[0].charAt(0) === "!" ? 2 : 1;
|
|
1379
|
-
if (!this.options.pedantic &&
|
|
1386
|
+
if (!this.options.pedantic && Wr(e, t[1], n, this.rules)) return;
|
|
1380
1387
|
let r = t[2].trim();
|
|
1381
1388
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
|
|
1382
1389
|
if (!this.rules.other.endAngleBracket.test(r)) return;
|
|
1383
|
-
let e =
|
|
1390
|
+
let e = Lr(r.slice(0, -1), "\\");
|
|
1384
1391
|
if ((r.length - e.length) % 2 == 0) return;
|
|
1385
1392
|
} else {
|
|
1386
|
-
let e =
|
|
1393
|
+
let e = Br(t[2], "()");
|
|
1387
1394
|
if (e === -2) return;
|
|
1388
1395
|
if (e > -1) {
|
|
1389
1396
|
let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
|
|
@@ -1395,7 +1402,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1395
1402
|
let e = this.rules.other.pedanticHrefTitle.exec(i);
|
|
1396
1403
|
e && (i = e[1], a = e[3]);
|
|
1397
1404
|
} else a = t[3] ? t[3].slice(1, -1) : "";
|
|
1398
|
-
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)),
|
|
1405
|
+
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)), Hr(t, {
|
|
1399
1406
|
href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
1400
1407
|
title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
|
|
1401
1408
|
}, t[0], this.lexer, this.rules);
|
|
@@ -1405,8 +1412,8 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1405
1412
|
let n;
|
|
1406
1413
|
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
1407
1414
|
let r = n[0].charAt(0) === "!" ? 2 : 1;
|
|
1408
|
-
if (!this.options.pedantic &&
|
|
1409
|
-
let i = t[
|
|
1415
|
+
if (!this.options.pedantic && Wr(e, n[1], r, this.rules)) return;
|
|
1416
|
+
let i = t[zr((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
|
|
1410
1417
|
if (!i) {
|
|
1411
1418
|
let e = n[0].charAt(0);
|
|
1412
1419
|
return {
|
|
@@ -1415,7 +1422,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1415
1422
|
text: e
|
|
1416
1423
|
};
|
|
1417
1424
|
}
|
|
1418
|
-
return
|
|
1425
|
+
return Hr(n, i, n[0], this.lexer, this.rules);
|
|
1419
1426
|
}
|
|
1420
1427
|
}
|
|
1421
1428
|
emStrong(e, t, n = "") {
|
|
@@ -1548,35 +1555,35 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1548
1555
|
return {
|
|
1549
1556
|
type: "text",
|
|
1550
1557
|
raw: t[0],
|
|
1551
|
-
text: e ? t[0] :
|
|
1558
|
+
text: e ? t[0] : Pr(t[0]),
|
|
1552
1559
|
escaped: e
|
|
1553
1560
|
};
|
|
1554
1561
|
}
|
|
1555
1562
|
}
|
|
1556
|
-
},
|
|
1563
|
+
}, H = class e {
|
|
1557
1564
|
tokens;
|
|
1558
1565
|
options;
|
|
1559
1566
|
state;
|
|
1560
1567
|
inlineQueue;
|
|
1561
1568
|
tokenizer;
|
|
1562
1569
|
constructor(e) {
|
|
1563
|
-
this.tokens = [], this.tokens.links = Object.create(null), this.options = e ||
|
|
1570
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || pn, this.options.tokenizer = this.options.tokenizer || new Gr(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
1564
1571
|
inLink: !1,
|
|
1565
1572
|
inRawBlock: !1,
|
|
1566
1573
|
linkEmitted: !1,
|
|
1567
1574
|
top: !0
|
|
1568
1575
|
};
|
|
1569
1576
|
let t = {
|
|
1570
|
-
other:
|
|
1571
|
-
block:
|
|
1572
|
-
inline:
|
|
1577
|
+
other: z,
|
|
1578
|
+
block: Ar.normal,
|
|
1579
|
+
inline: jr.normal
|
|
1573
1580
|
};
|
|
1574
|
-
this.options.pedantic ? (t.block =
|
|
1581
|
+
this.options.pedantic ? (t.block = Ar.pedantic, t.inline = jr.pedantic) : this.options.gfm && (t.block = Ar.gfm, t.inline = this.options.breaks ? jr.breaks : jr.gfm), this.tokenizer.rules = t;
|
|
1575
1582
|
}
|
|
1576
1583
|
static get rules() {
|
|
1577
1584
|
return {
|
|
1578
|
-
block:
|
|
1579
|
-
inline:
|
|
1585
|
+
block: Ar,
|
|
1586
|
+
inline: jr
|
|
1580
1587
|
};
|
|
1581
1588
|
}
|
|
1582
1589
|
static lex(t, n) {
|
|
@@ -1586,7 +1593,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1586
1593
|
return new e(n).inlineTokens(t);
|
|
1587
1594
|
}
|
|
1588
1595
|
lex(e) {
|
|
1589
|
-
e = e.replace(
|
|
1596
|
+
e = e.replace(z.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
|
|
1590
1597
|
for (let e = 0; e < this.inlineQueue.length; e++) {
|
|
1591
1598
|
let t = this.inlineQueue[e];
|
|
1592
1599
|
this.inlineTokens(t.src, t.tokens);
|
|
@@ -1594,7 +1601,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1594
1601
|
return this.inlineQueue = [], this.tokens;
|
|
1595
1602
|
}
|
|
1596
1603
|
blockTokens(e, t = [], n = !1) {
|
|
1597
|
-
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(
|
|
1604
|
+
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(z.tabCharGlobal, " ").replace(z.spaceLine, ""));
|
|
1598
1605
|
let r = 1 / 0;
|
|
1599
1606
|
for (; e;) {
|
|
1600
1607
|
if (e.length < r) r = e.length;
|
|
@@ -1694,7 +1701,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1694
1701
|
for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
|
|
1695
1702
|
for (let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
|
|
1696
1703
|
let e = t[0], n = e.lastIndexOf("[");
|
|
1697
|
-
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links,
|
|
1704
|
+
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, zr(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
|
|
1698
1705
|
}
|
|
1699
1706
|
return !1;
|
|
1700
1707
|
}
|
|
@@ -1704,7 +1711,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1704
1711
|
if (this.tokens.links && e.includes("[")) {
|
|
1705
1712
|
let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
|
|
1706
1713
|
let r = n.lastIndexOf("[");
|
|
1707
|
-
if (!Object.hasOwn(this.tokens.links,
|
|
1714
|
+
if (!Object.hasOwn(this.tokens.links, zr(n.slice(r + 1, -1)))) return n;
|
|
1708
1715
|
if (r > 1 && n.charAt(0) !== "!") {
|
|
1709
1716
|
let i = n.slice(1, r - 1);
|
|
1710
1717
|
if (this.linkInText(i)) return "[" + i.replace(e, t) + "][" + "a".repeat(n.length - r - 2) + "]";
|
|
@@ -1794,18 +1801,18 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1794
1801
|
if (this.options.silent) console.error(t);
|
|
1795
1802
|
else throw Error(t);
|
|
1796
1803
|
}
|
|
1797
|
-
},
|
|
1804
|
+
}, Kr = class {
|
|
1798
1805
|
options;
|
|
1799
1806
|
parser;
|
|
1800
1807
|
constructor(e) {
|
|
1801
|
-
this.options = e ||
|
|
1808
|
+
this.options = e || pn;
|
|
1802
1809
|
}
|
|
1803
1810
|
space(e) {
|
|
1804
1811
|
return "";
|
|
1805
1812
|
}
|
|
1806
1813
|
code({ text: e, lang: t, escaped: n }) {
|
|
1807
|
-
let r = (t || "").match(
|
|
1808
|
-
return r ? "<pre><code class=\"language-" +
|
|
1814
|
+
let r = (t || "").match(z.notSpaceStart)?.[0], i = e ? e.replace(z.endingNewline, "") + "\n" : "";
|
|
1815
|
+
return r ? "<pre><code class=\"language-" + V(r) + "\">" + (n ? i : V(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : V(i, !0)) + "</code></pre>\n";
|
|
1809
1816
|
}
|
|
1810
1817
|
blockquote({ tokens: e }) {
|
|
1811
1818
|
return `<blockquote>
|
|
@@ -1875,7 +1882,7 @@ ${e}</tr>
|
|
|
1875
1882
|
return `<em>${this.parser.parseInline(e)}</em>`;
|
|
1876
1883
|
}
|
|
1877
1884
|
codespan({ text: e }) {
|
|
1878
|
-
return `<code>${
|
|
1885
|
+
return `<code>${V(e, !0)}</code>`;
|
|
1879
1886
|
}
|
|
1880
1887
|
br(e) {
|
|
1881
1888
|
return "<br>";
|
|
@@ -1884,24 +1891,24 @@ ${e}</tr>
|
|
|
1884
1891
|
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
1885
1892
|
}
|
|
1886
1893
|
link({ href: e, title: t, text: n, tokens: r, autolink: i }) {
|
|
1887
|
-
let a = i ?
|
|
1894
|
+
let a = i ? V(n, !0) : this.parser.parseInline(r), o = Fr(e);
|
|
1888
1895
|
if (o === null) return a;
|
|
1889
|
-
e =
|
|
1896
|
+
e = V(o, i);
|
|
1890
1897
|
let s = "<a href=\"" + e + "\"";
|
|
1891
|
-
return t && (s += " title=\"" +
|
|
1898
|
+
return t && (s += " title=\"" + V(t) + "\""), s += ">" + a + "</a>", s;
|
|
1892
1899
|
}
|
|
1893
1900
|
image({ href: e, title: t, text: n, tokens: r }) {
|
|
1894
1901
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
1895
|
-
let i =
|
|
1896
|
-
if (i === null) return
|
|
1902
|
+
let i = Fr(e);
|
|
1903
|
+
if (i === null) return V(n);
|
|
1897
1904
|
e = i;
|
|
1898
|
-
let a = `<img src="${
|
|
1899
|
-
return t && (a += ` title="${
|
|
1905
|
+
let a = `<img src="${V(e)}" alt="${V(n)}"`;
|
|
1906
|
+
return t && (a += ` title="${V(t)}"`), a += ">", a;
|
|
1900
1907
|
}
|
|
1901
1908
|
text(e) {
|
|
1902
|
-
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text :
|
|
1909
|
+
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : V(e.text);
|
|
1903
1910
|
}
|
|
1904
|
-
},
|
|
1911
|
+
}, qr = class {
|
|
1905
1912
|
strong({ text: e }) {
|
|
1906
1913
|
return e;
|
|
1907
1914
|
}
|
|
@@ -1932,12 +1939,12 @@ ${e}</tr>
|
|
|
1932
1939
|
checkbox({ raw: e }) {
|
|
1933
1940
|
return e;
|
|
1934
1941
|
}
|
|
1935
|
-
},
|
|
1942
|
+
}, U = class e {
|
|
1936
1943
|
options;
|
|
1937
1944
|
renderer;
|
|
1938
1945
|
textRenderer;
|
|
1939
1946
|
constructor(e) {
|
|
1940
|
-
this.options = e ||
|
|
1947
|
+
this.options = e || pn, this.options.renderer = this.options.renderer || new Kr(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new qr();
|
|
1941
1948
|
}
|
|
1942
1949
|
static parse(t, n) {
|
|
1943
1950
|
return new e(n).parse(t);
|
|
@@ -2085,11 +2092,11 @@ ${e}</tr>
|
|
|
2085
2092
|
}
|
|
2086
2093
|
return n;
|
|
2087
2094
|
}
|
|
2088
|
-
},
|
|
2095
|
+
}, Jr = class {
|
|
2089
2096
|
options;
|
|
2090
2097
|
block;
|
|
2091
2098
|
constructor(e) {
|
|
2092
|
-
this.options = e ||
|
|
2099
|
+
this.options = e || pn;
|
|
2093
2100
|
}
|
|
2094
2101
|
static passThroughHooks = /* @__PURE__ */ new Set([
|
|
2095
2102
|
"preprocess",
|
|
@@ -2115,22 +2122,22 @@ ${e}</tr>
|
|
|
2115
2122
|
return e;
|
|
2116
2123
|
}
|
|
2117
2124
|
provideLexer(e = this.block) {
|
|
2118
|
-
return e ?
|
|
2125
|
+
return e ? H.lex : H.lexInline;
|
|
2119
2126
|
}
|
|
2120
2127
|
provideParser(e = this.block) {
|
|
2121
|
-
return e ?
|
|
2128
|
+
return e ? U.parse : U.parseInline;
|
|
2122
2129
|
}
|
|
2123
|
-
},
|
|
2124
|
-
defaults =
|
|
2130
|
+
}, Yr = new class {
|
|
2131
|
+
defaults = fn();
|
|
2125
2132
|
options = this.setOptions;
|
|
2126
2133
|
parse = this.parseMarkdown(!0);
|
|
2127
2134
|
parseInline = this.parseMarkdown(!1);
|
|
2128
|
-
Parser =
|
|
2129
|
-
Renderer =
|
|
2130
|
-
TextRenderer =
|
|
2131
|
-
Lexer =
|
|
2132
|
-
Tokenizer =
|
|
2133
|
-
Hooks =
|
|
2135
|
+
Parser = U;
|
|
2136
|
+
Renderer = Kr;
|
|
2137
|
+
TextRenderer = qr;
|
|
2138
|
+
Lexer = H;
|
|
2139
|
+
Tokenizer = Gr;
|
|
2140
|
+
Hooks = Jr;
|
|
2134
2141
|
constructor(...e) {
|
|
2135
2142
|
this.use(...e);
|
|
2136
2143
|
}
|
|
@@ -2181,7 +2188,7 @@ ${e}</tr>
|
|
|
2181
2188
|
}
|
|
2182
2189
|
"childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
|
|
2183
2190
|
}), n.extensions = t), e.renderer) {
|
|
2184
|
-
let t = this.defaults.renderer || new
|
|
2191
|
+
let t = this.defaults.renderer || new Kr(this.defaults);
|
|
2185
2192
|
for (let n in e.renderer) {
|
|
2186
2193
|
if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
|
|
2187
2194
|
if (["options", "parser"].includes(n)) continue;
|
|
@@ -2194,7 +2201,7 @@ ${e}</tr>
|
|
|
2194
2201
|
n.renderer = t;
|
|
2195
2202
|
}
|
|
2196
2203
|
if (e.tokenizer) {
|
|
2197
|
-
let t = this.defaults.tokenizer || new
|
|
2204
|
+
let t = this.defaults.tokenizer || new Gr(this.defaults);
|
|
2198
2205
|
for (let n in e.tokenizer) {
|
|
2199
2206
|
if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
|
|
2200
2207
|
if ([
|
|
@@ -2211,13 +2218,13 @@ ${e}</tr>
|
|
|
2211
2218
|
n.tokenizer = t;
|
|
2212
2219
|
}
|
|
2213
2220
|
if (e.hooks) {
|
|
2214
|
-
let t = this.defaults.hooks || new
|
|
2221
|
+
let t = this.defaults.hooks || new Jr();
|
|
2215
2222
|
for (let n in e.hooks) {
|
|
2216
2223
|
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
2217
2224
|
if (["options", "block"].includes(n)) continue;
|
|
2218
2225
|
let r = n, i = e.hooks[r], a = t[r];
|
|
2219
|
-
t[r] =
|
|
2220
|
-
if (this.defaults.async &&
|
|
2226
|
+
t[r] = Jr.passThroughHooks.has(n) ? (e) => {
|
|
2227
|
+
if (this.defaults.async && Jr.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
2221
2228
|
let n = await i.call(t, e);
|
|
2222
2229
|
return a.call(t, n);
|
|
2223
2230
|
})();
|
|
@@ -2254,10 +2261,10 @@ ${e}</tr>
|
|
|
2254
2261
|
}, this;
|
|
2255
2262
|
}
|
|
2256
2263
|
lexer(e, t) {
|
|
2257
|
-
return
|
|
2264
|
+
return H.lex(e, t ?? this.defaults);
|
|
2258
2265
|
}
|
|
2259
2266
|
parser(e, t) {
|
|
2260
|
-
return
|
|
2267
|
+
return U.parse(e, t ?? this.defaults);
|
|
2261
2268
|
}
|
|
2262
2269
|
parseMarkdown(e) {
|
|
2263
2270
|
return (t, n) => {
|
|
@@ -2269,16 +2276,16 @@ ${e}</tr>
|
|
|
2269
2276
|
if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
|
|
2270
2277
|
if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
|
|
2271
2278
|
if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
|
|
2272
|
-
let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ?
|
|
2279
|
+
let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? H.lex : H.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
|
|
2273
2280
|
i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
|
|
2274
|
-
let o = await (i.hooks ? await i.hooks.provideParser(e) : e ?
|
|
2281
|
+
let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? U.parse : U.parseInline)(a, i);
|
|
2275
2282
|
return i.hooks ? await i.hooks.postprocess(o) : o;
|
|
2276
2283
|
})().catch(a);
|
|
2277
2284
|
try {
|
|
2278
2285
|
i.hooks && (t = i.hooks.preprocess(t));
|
|
2279
|
-
let n = (i.hooks ? i.hooks.provideLexer(e) : e ?
|
|
2286
|
+
let n = (i.hooks ? i.hooks.provideLexer(e) : e ? H.lex : H.lexInline)(t, i);
|
|
2280
2287
|
i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
|
|
2281
|
-
let r = (i.hooks ? i.hooks.provideParser(e) : e ?
|
|
2288
|
+
let r = (i.hooks ? i.hooks.provideParser(e) : e ? U.parse : U.parseInline)(n, i);
|
|
2282
2289
|
return i.hooks && (r = i.hooks.postprocess(r)), r;
|
|
2283
2290
|
} catch (e) {
|
|
2284
2291
|
return a(e);
|
|
@@ -2288,7 +2295,7 @@ ${e}</tr>
|
|
|
2288
2295
|
onError(e, t) {
|
|
2289
2296
|
return (n) => {
|
|
2290
2297
|
if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
|
|
2291
|
-
let e = "<p>An error occurred:</p><pre>" +
|
|
2298
|
+
let e = "<p>An error occurred:</p><pre>" + V(n.message + "", !0) + "</pre>";
|
|
2292
2299
|
return t ? Promise.resolve(e) : e;
|
|
2293
2300
|
}
|
|
2294
2301
|
if (t) return Promise.reject(n);
|
|
@@ -2296,19 +2303,841 @@ ${e}</tr>
|
|
|
2296
2303
|
};
|
|
2297
2304
|
}
|
|
2298
2305
|
}();
|
|
2299
|
-
function
|
|
2300
|
-
return
|
|
2301
|
-
}
|
|
2302
|
-
|
|
2303
|
-
return
|
|
2304
|
-
},
|
|
2305
|
-
function
|
|
2306
|
-
return
|
|
2307
|
-
}
|
|
2308
|
-
|
|
2309
|
-
return
|
|
2310
|
-
},
|
|
2311
|
-
|
|
2306
|
+
function W(e, t) {
|
|
2307
|
+
return Yr.parse(e, t);
|
|
2308
|
+
}
|
|
2309
|
+
W.options = W.setOptions = function(e) {
|
|
2310
|
+
return Yr.setOptions(e), W.defaults = Yr.defaults, mn(W.defaults), W;
|
|
2311
|
+
}, W.getDefaults = fn, W.defaults = pn;
|
|
2312
|
+
function Xr(...e) {
|
|
2313
|
+
return Yr.use(...e), W.defaults = Yr.defaults, mn(W.defaults), W;
|
|
2314
|
+
}
|
|
2315
|
+
W.use = Xr, W.walkTokens = function(e, t) {
|
|
2316
|
+
return Yr.walkTokens(e, t);
|
|
2317
|
+
}, W.parseInline = Yr.parseInline, W.Parser = U, W.parser = U.parse, W.Renderer = Kr, W.TextRenderer = qr, W.Lexer = H, W.lexer = H.lex, W.Tokenizer = Gr, W.Hooks = Jr, W.parse = W, W.options, W.setOptions, W.walkTokens, W.parseInline, U.parse, H.lex;
|
|
2318
|
+
//#endregion
|
|
2319
|
+
//#region ../../node_modules/.pnpm/dompurify@3.4.15/node_modules/dompurify/dist/purify.es.mjs
|
|
2320
|
+
function Zr(e, t) {
|
|
2321
|
+
(t == null || t > e.length) && (t = e.length);
|
|
2322
|
+
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
2323
|
+
return r;
|
|
2324
|
+
}
|
|
2325
|
+
function Qr(e) {
|
|
2326
|
+
if (Array.isArray(e)) return e;
|
|
2327
|
+
}
|
|
2328
|
+
function $r(e, t) {
|
|
2329
|
+
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
2330
|
+
if (n != null) {
|
|
2331
|
+
var r, i, a, o, s = [], c = !0, l = !1;
|
|
2332
|
+
try {
|
|
2333
|
+
if (a = (n = n.call(e)).next, t !== 0) for (; !(c = (r = a.call(n)).done) && (s.push(r.value), s.length !== t); c = !0);
|
|
2334
|
+
} catch (e) {
|
|
2335
|
+
l = !0, i = e;
|
|
2336
|
+
} finally {
|
|
2337
|
+
try {
|
|
2338
|
+
if (!c && n.return != null && (o = n.return(), Object(o) !== o)) return;
|
|
2339
|
+
} finally {
|
|
2340
|
+
if (l) throw i;
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
return s;
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
function ei() {
|
|
2347
|
+
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2348
|
+
}
|
|
2349
|
+
function ti(e, t) {
|
|
2350
|
+
return Qr(e) || $r(e, t) || ni(e, t) || ei();
|
|
2351
|
+
}
|
|
2352
|
+
function ni(e, t) {
|
|
2353
|
+
if (e) {
|
|
2354
|
+
if (typeof e == "string") return Zr(e, t);
|
|
2355
|
+
var n = {}.toString.call(e).slice(8, -1);
|
|
2356
|
+
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) ? Zr(e, t) : void 0;
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
var ri = Object.entries, ii = Object.setPrototypeOf, ai = Object.isFrozen, oi = Object.getPrototypeOf, si = Object.getOwnPropertyDescriptor, G = Object.freeze, K = Object.seal, ci = Object.create, li = typeof Reflect < "u" && Reflect, ui = li.apply, di = li.construct;
|
|
2360
|
+
G ||= function(e) {
|
|
2361
|
+
return e;
|
|
2362
|
+
}, K ||= function(e) {
|
|
2363
|
+
return e;
|
|
2364
|
+
}, ui ||= function(e, t) {
|
|
2365
|
+
var n = [...arguments].slice(2);
|
|
2366
|
+
return e.apply(t, n);
|
|
2367
|
+
}, di ||= function(e) {
|
|
2368
|
+
return new e(...[...arguments].slice(1));
|
|
2369
|
+
};
|
|
2370
|
+
var fi = Y(Array.prototype.forEach), pi = Y(Array.prototype.lastIndexOf), mi = Y(Array.prototype.pop), hi = Y(Array.prototype.push), gi = Y(Array.prototype.splice), _i = Array.isArray, vi = Y(String.prototype.toLowerCase), yi = Y(String.prototype.toString), bi = Y(String.prototype.match), xi = Y(String.prototype.replace), Si = Y(String.prototype.indexOf), Ci = Y(String.prototype.trim), wi = Y(Number.prototype.toString), Ti = Y(Boolean.prototype.toString), Ei = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), Di = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), Oi = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), ki = Ai(TypeError);
|
|
2371
|
+
function Y(e) {
|
|
2372
|
+
return function(t) {
|
|
2373
|
+
t instanceof RegExp && (t.lastIndex = 0);
|
|
2374
|
+
var n = [...arguments].slice(1);
|
|
2375
|
+
return ui(e, t, n);
|
|
2376
|
+
};
|
|
2377
|
+
}
|
|
2378
|
+
function Ai(e) {
|
|
2379
|
+
return function() {
|
|
2380
|
+
return di(e, [...arguments]);
|
|
2381
|
+
};
|
|
2382
|
+
}
|
|
2383
|
+
function X(e, t) {
|
|
2384
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : vi;
|
|
2385
|
+
if (ii && ii(e, null), !_i(t)) return e;
|
|
2386
|
+
let r = t.length;
|
|
2387
|
+
for (; r--;) {
|
|
2388
|
+
let i = t[r];
|
|
2389
|
+
if (typeof i == "string") {
|
|
2390
|
+
let e = n(i);
|
|
2391
|
+
e !== i && (ai(t) || (t[r] = e), i = e);
|
|
2392
|
+
}
|
|
2393
|
+
e[i] = !0;
|
|
2394
|
+
}
|
|
2395
|
+
return e;
|
|
2396
|
+
}
|
|
2397
|
+
function ji(e) {
|
|
2398
|
+
for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
|
|
2399
|
+
return e;
|
|
2400
|
+
}
|
|
2401
|
+
function Z(e) {
|
|
2402
|
+
let t = ci(null);
|
|
2403
|
+
for (let r of ri(e)) {
|
|
2404
|
+
var n = ti(r, 2);
|
|
2405
|
+
let i = n[0], a = n[1];
|
|
2406
|
+
q(e, i) && (t[i] = _i(a) ? ji(a) : a && typeof a == "object" && a.constructor === Object ? Z(a) : a);
|
|
2407
|
+
}
|
|
2408
|
+
return t;
|
|
2409
|
+
}
|
|
2410
|
+
function Mi(e) {
|
|
2411
|
+
switch (typeof e) {
|
|
2412
|
+
case "string": return e;
|
|
2413
|
+
case "number": return wi(e);
|
|
2414
|
+
case "boolean": return Ti(e);
|
|
2415
|
+
case "bigint": return Ei ? Ei(e) : "0";
|
|
2416
|
+
case "symbol": return Di ? Di(e) : "Symbol()";
|
|
2417
|
+
case "undefined": return Oi(e);
|
|
2418
|
+
case "function":
|
|
2419
|
+
case "object": {
|
|
2420
|
+
if (e === null) return Oi(e);
|
|
2421
|
+
let t = e, n = Q(t, "toString");
|
|
2422
|
+
if (typeof n == "function") {
|
|
2423
|
+
let e = n(t);
|
|
2424
|
+
return typeof e == "string" ? e : Oi(e);
|
|
2425
|
+
}
|
|
2426
|
+
return Oi(e);
|
|
2427
|
+
}
|
|
2428
|
+
default: return Oi(e);
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
function Q(e, t) {
|
|
2432
|
+
for (; e !== null;) {
|
|
2433
|
+
let n = si(e, t);
|
|
2434
|
+
if (n) {
|
|
2435
|
+
if (n.get) return Y(n.get);
|
|
2436
|
+
if (typeof n.value == "function") return Y(n.value);
|
|
2437
|
+
}
|
|
2438
|
+
e = oi(e);
|
|
2439
|
+
}
|
|
2440
|
+
function n() {
|
|
2441
|
+
return null;
|
|
2442
|
+
}
|
|
2443
|
+
return n;
|
|
2444
|
+
}
|
|
2445
|
+
function Ni(e) {
|
|
2446
|
+
try {
|
|
2447
|
+
return J(e, ""), !0;
|
|
2448
|
+
} catch {
|
|
2449
|
+
return !1;
|
|
2450
|
+
}
|
|
2451
|
+
}
|
|
2452
|
+
var Pi = 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(".")), Fi = 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(".")), Ii = G([
|
|
2453
|
+
"feBlend",
|
|
2454
|
+
"feColorMatrix",
|
|
2455
|
+
"feComponentTransfer",
|
|
2456
|
+
"feComposite",
|
|
2457
|
+
"feConvolveMatrix",
|
|
2458
|
+
"feDiffuseLighting",
|
|
2459
|
+
"feDisplacementMap",
|
|
2460
|
+
"feDistantLight",
|
|
2461
|
+
"feDropShadow",
|
|
2462
|
+
"feFlood",
|
|
2463
|
+
"feFuncA",
|
|
2464
|
+
"feFuncB",
|
|
2465
|
+
"feFuncG",
|
|
2466
|
+
"feFuncR",
|
|
2467
|
+
"feGaussianBlur",
|
|
2468
|
+
"feImage",
|
|
2469
|
+
"feMerge",
|
|
2470
|
+
"feMergeNode",
|
|
2471
|
+
"feMorphology",
|
|
2472
|
+
"feOffset",
|
|
2473
|
+
"fePointLight",
|
|
2474
|
+
"feSpecularLighting",
|
|
2475
|
+
"feSpotLight",
|
|
2476
|
+
"feTile",
|
|
2477
|
+
"feTurbulence"
|
|
2478
|
+
]), Li = G([
|
|
2479
|
+
"animate",
|
|
2480
|
+
"color-profile",
|
|
2481
|
+
"cursor",
|
|
2482
|
+
"discard",
|
|
2483
|
+
"font-face",
|
|
2484
|
+
"font-face-format",
|
|
2485
|
+
"font-face-name",
|
|
2486
|
+
"font-face-src",
|
|
2487
|
+
"font-face-uri",
|
|
2488
|
+
"foreignobject",
|
|
2489
|
+
"hatch",
|
|
2490
|
+
"hatchpath",
|
|
2491
|
+
"mesh",
|
|
2492
|
+
"meshgradient",
|
|
2493
|
+
"meshpatch",
|
|
2494
|
+
"meshrow",
|
|
2495
|
+
"missing-glyph",
|
|
2496
|
+
"script",
|
|
2497
|
+
"set",
|
|
2498
|
+
"solidcolor",
|
|
2499
|
+
"unknown",
|
|
2500
|
+
"use"
|
|
2501
|
+
]), Ri = 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(".")), zi = G([
|
|
2502
|
+
"maction",
|
|
2503
|
+
"maligngroup",
|
|
2504
|
+
"malignmark",
|
|
2505
|
+
"mlongdiv",
|
|
2506
|
+
"mscarries",
|
|
2507
|
+
"mscarry",
|
|
2508
|
+
"msgroup",
|
|
2509
|
+
"mstack",
|
|
2510
|
+
"msline",
|
|
2511
|
+
"msrow",
|
|
2512
|
+
"semantics",
|
|
2513
|
+
"annotation",
|
|
2514
|
+
"annotation-xml",
|
|
2515
|
+
"mprescripts",
|
|
2516
|
+
"none"
|
|
2517
|
+
]), Bi = G(["#text"]), Vi = 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(".")), Hi = 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(".")), Ui = 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(".")), Wi = G([
|
|
2518
|
+
"xlink:href",
|
|
2519
|
+
"xml:id",
|
|
2520
|
+
"xlink:title",
|
|
2521
|
+
"xml:space",
|
|
2522
|
+
"xmlns:xlink"
|
|
2523
|
+
]), Gi = K(/{{[\w\W]*|^[\w\W]*}}/g), Ki = K(/<%[\w\W]*|^[\w\W]*%>/g), qi = K(/\${[\w\W]*/g), Ji = K(/^data-[\-\w.\u00B7-\uFFFF]+$/), Yi = K(/^aria-[\-\w]+$/), Xi = K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Zi = K(/^(?:\w+script|data):/i), Qi = K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), $i = K(/^html$/i), ea = K(/^[a-z][.\w]*(-[.\w]+)+$/i), ta = K(/<[/\w!]/g), na = K(/<[/\w]/g), ra = K(/<\/no(script|embed|frames)/i), ia = K(/\/>/i), $ = {
|
|
2524
|
+
element: 1,
|
|
2525
|
+
attribute: 2,
|
|
2526
|
+
text: 3,
|
|
2527
|
+
cdataSection: 4,
|
|
2528
|
+
entityReference: 5,
|
|
2529
|
+
entityNode: 6,
|
|
2530
|
+
processingInstruction: 7,
|
|
2531
|
+
comment: 8,
|
|
2532
|
+
document: 9,
|
|
2533
|
+
documentType: 10,
|
|
2534
|
+
documentFragment: 11,
|
|
2535
|
+
notation: 12
|
|
2536
|
+
}, aa = [
|
|
2537
|
+
"style",
|
|
2538
|
+
"script",
|
|
2539
|
+
"xmp",
|
|
2540
|
+
"iframe",
|
|
2541
|
+
"noembed",
|
|
2542
|
+
"noframes",
|
|
2543
|
+
"plaintext",
|
|
2544
|
+
"noscript"
|
|
2545
|
+
], oa = G(X({}, aa)), sa = function() {
|
|
2546
|
+
let e = {};
|
|
2547
|
+
return fi(aa, (t) => {
|
|
2548
|
+
e[t] = K(RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
2549
|
+
}), G(e);
|
|
2550
|
+
}(), ca = function() {
|
|
2551
|
+
return typeof window > "u" ? null : window;
|
|
2552
|
+
}, la = function(e, t) {
|
|
2553
|
+
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
2554
|
+
let n = null, r = "data-tt-policy-suffix";
|
|
2555
|
+
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
2556
|
+
let i = "dompurify" + (n ? "#" + n : "");
|
|
2557
|
+
try {
|
|
2558
|
+
return e.createPolicy(i, {
|
|
2559
|
+
createHTML(e) {
|
|
2560
|
+
return e;
|
|
2561
|
+
},
|
|
2562
|
+
createScriptURL(e) {
|
|
2563
|
+
return e;
|
|
2564
|
+
}
|
|
2565
|
+
});
|
|
2566
|
+
} catch {
|
|
2567
|
+
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
2568
|
+
}
|
|
2569
|
+
}, ua = function() {
|
|
2570
|
+
return {
|
|
2571
|
+
afterSanitizeAttributes: [],
|
|
2572
|
+
afterSanitizeElements: [],
|
|
2573
|
+
afterSanitizeShadowDOM: [],
|
|
2574
|
+
beforeSanitizeAttributes: [],
|
|
2575
|
+
beforeSanitizeElements: [],
|
|
2576
|
+
beforeSanitizeShadowDOM: [],
|
|
2577
|
+
uponSanitizeAttribute: [],
|
|
2578
|
+
uponSanitizeElement: [],
|
|
2579
|
+
uponSanitizeShadowNode: []
|
|
2580
|
+
};
|
|
2581
|
+
}, da = function(e, t, n, r) {
|
|
2582
|
+
return q(e, t) && _i(e[t]) ? X(r.base ? Z(r.base) : {}, e[t], r.transform) : n;
|
|
2583
|
+
}, fa = function(e, t, n) {
|
|
2584
|
+
let r = q(e, t) ? e[t] : void 0;
|
|
2585
|
+
return r && typeof r == "object" ? Z(r) : n();
|
|
2586
|
+
};
|
|
2587
|
+
function pa() {
|
|
2588
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ca(), t = (e) => pa(e);
|
|
2589
|
+
if (t.version = "3.4.15", t.removed = [], !e || !e.document || e.document.nodeType !== $.document || !e.Element) return t.isSupported = !1, t;
|
|
2590
|
+
let n = e.document, r = n, i = r.currentScript;
|
|
2591
|
+
e.DocumentFragment;
|
|
2592
|
+
let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
|
|
2593
|
+
e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
|
|
2594
|
+
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), te = Q(d, "nextSibling"), ne = Q(d, "childNodes"), re = Q(d, "parentNode"), ie = Q(d, "shadowRoot"), ae = Q(d, "attributes"), m = o && o.prototype ? Q(o.prototype, "nodeType") : null, oe = o && o.prototype ? Q(o.prototype, "nodeName") : null, se = o && o.prototype ? Q(o.prototype, "ownerDocument") : null, ce = function(e) {
|
|
2595
|
+
return m ? m(e) : e.nodeType;
|
|
2596
|
+
}, h = function(e) {
|
|
2597
|
+
return oe ? oe(e) : e.nodeName;
|
|
2598
|
+
};
|
|
2599
|
+
if (typeof a == "function") {
|
|
2600
|
+
let e = n.createElement("template");
|
|
2601
|
+
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
2602
|
+
}
|
|
2603
|
+
let g, _ = "", le, ue = !1, v = 0, de = function() {
|
|
2604
|
+
if (v > 0) throw ki("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.");
|
|
2605
|
+
}, fe = function(e) {
|
|
2606
|
+
de(), v++;
|
|
2607
|
+
try {
|
|
2608
|
+
return g.createHTML(e);
|
|
2609
|
+
} finally {
|
|
2610
|
+
v--;
|
|
2611
|
+
}
|
|
2612
|
+
}, y = function(e) {
|
|
2613
|
+
de(), v++;
|
|
2614
|
+
try {
|
|
2615
|
+
return g.createScriptURL(e);
|
|
2616
|
+
} finally {
|
|
2617
|
+
v--;
|
|
2618
|
+
}
|
|
2619
|
+
}, pe = function() {
|
|
2620
|
+
return ue ||= (le = la(u, i), !0), le;
|
|
2621
|
+
}, me = n, he = me.implementation, ge = me.createNodeIterator, _e = me.createDocumentFragment, ve = me.getElementsByTagName, ye = r.importNode, b = ua();
|
|
2622
|
+
t.isSupported = typeof ri == "function" && typeof re == "function" && he && he.createHTMLDocument !== void 0;
|
|
2623
|
+
let be = Gi, xe = Ki, Se = qi, Ce = Ji, we = Yi, Te = Zi, Ee = Qi, De = ea, Oe = Xi, x = null, ke = X({}, [
|
|
2624
|
+
...Pi,
|
|
2625
|
+
...Fi,
|
|
2626
|
+
...Ii,
|
|
2627
|
+
...Ri,
|
|
2628
|
+
...Bi
|
|
2629
|
+
]), S = null, Ae = X({}, [
|
|
2630
|
+
...Vi,
|
|
2631
|
+
...Hi,
|
|
2632
|
+
...Ui,
|
|
2633
|
+
...Wi
|
|
2634
|
+
]), C = Object.seal(ci(null, {
|
|
2635
|
+
tagNameCheck: {
|
|
2636
|
+
writable: !0,
|
|
2637
|
+
configurable: !1,
|
|
2638
|
+
enumerable: !0,
|
|
2639
|
+
value: null
|
|
2640
|
+
},
|
|
2641
|
+
attributeNameCheck: {
|
|
2642
|
+
writable: !0,
|
|
2643
|
+
configurable: !1,
|
|
2644
|
+
enumerable: !0,
|
|
2645
|
+
value: null
|
|
2646
|
+
},
|
|
2647
|
+
allowCustomizedBuiltInElements: {
|
|
2648
|
+
writable: !0,
|
|
2649
|
+
configurable: !1,
|
|
2650
|
+
enumerable: !0,
|
|
2651
|
+
value: !1
|
|
2652
|
+
}
|
|
2653
|
+
})), je = null, Me = null, w = Object.seal(ci(null, {
|
|
2654
|
+
tagCheck: {
|
|
2655
|
+
writable: !0,
|
|
2656
|
+
configurable: !1,
|
|
2657
|
+
enumerable: !0,
|
|
2658
|
+
value: null
|
|
2659
|
+
},
|
|
2660
|
+
attributeCheck: {
|
|
2661
|
+
writable: !0,
|
|
2662
|
+
configurable: !1,
|
|
2663
|
+
enumerable: !0,
|
|
2664
|
+
value: null
|
|
2665
|
+
}
|
|
2666
|
+
})), Ne = !0, Pe = !0, Fe = !1, Ie = !0, T = !1, Le = !0, E = !1, Re = !1, ze = null, Be = null, Ve = !1, D = !1, He = !1, Ue = !1, O = !0, We = !1, Ge = "user-content-", k = !0, Ke = !1, qe = {}, Je = null, Ye = 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(".")), Xe = null, Ze = X({}, [
|
|
2667
|
+
"audio",
|
|
2668
|
+
"video",
|
|
2669
|
+
"img",
|
|
2670
|
+
"source",
|
|
2671
|
+
"image",
|
|
2672
|
+
"track"
|
|
2673
|
+
]), Qe = null, $e = X({}, [
|
|
2674
|
+
"alt",
|
|
2675
|
+
"class",
|
|
2676
|
+
"for",
|
|
2677
|
+
"id",
|
|
2678
|
+
"label",
|
|
2679
|
+
"name",
|
|
2680
|
+
"pattern",
|
|
2681
|
+
"placeholder",
|
|
2682
|
+
"role",
|
|
2683
|
+
"summary",
|
|
2684
|
+
"title",
|
|
2685
|
+
"value",
|
|
2686
|
+
"style",
|
|
2687
|
+
"xmlns"
|
|
2688
|
+
]), et = "http://www.w3.org/1998/Math/MathML", A = "http://www.w3.org/2000/svg", j = "http://www.w3.org/1999/xhtml", tt = j, nt = !1, rt = null, it = X({}, [
|
|
2689
|
+
et,
|
|
2690
|
+
A,
|
|
2691
|
+
j
|
|
2692
|
+
], yi), at = G([
|
|
2693
|
+
"mi",
|
|
2694
|
+
"mo",
|
|
2695
|
+
"mn",
|
|
2696
|
+
"ms",
|
|
2697
|
+
"mtext"
|
|
2698
|
+
]), ot = X({}, at), M = G(["annotation-xml"]), st = X({}, M), ct = X({}, [
|
|
2699
|
+
"title",
|
|
2700
|
+
"style",
|
|
2701
|
+
"font",
|
|
2702
|
+
"a",
|
|
2703
|
+
"script"
|
|
2704
|
+
]), lt = null, ut = ["application/xhtml+xml", "text/html"], N = null, P = null, dt = n.createElement("form"), ft = function(e) {
|
|
2705
|
+
return e instanceof RegExp || e instanceof Function;
|
|
2706
|
+
}, pt = function() {
|
|
2707
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2708
|
+
if (P && P === e) return;
|
|
2709
|
+
(!e || typeof e != "object") && (e = {}), e = Z(e), lt = ut.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, N = lt === "application/xhtml+xml" ? yi : vi, x = da(e, "ALLOWED_TAGS", ke, { transform: N }), S = da(e, "ALLOWED_ATTR", Ae, { transform: N }), rt = da(e, "ALLOWED_NAMESPACES", it, { transform: yi }), Qe = da(e, "ADD_URI_SAFE_ATTR", $e, {
|
|
2710
|
+
transform: N,
|
|
2711
|
+
base: $e
|
|
2712
|
+
}), Xe = da(e, "ADD_DATA_URI_TAGS", Ze, {
|
|
2713
|
+
transform: N,
|
|
2714
|
+
base: Ze
|
|
2715
|
+
}), Je = da(e, "FORBID_CONTENTS", Ye, { transform: N }), je = da(e, "FORBID_TAGS", Z({}), { transform: N }), Me = da(e, "FORBID_ATTR", Z({}), { transform: N }), qe = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, Ne = e.ALLOW_ARIA_ATTR !== !1, Pe = e.ALLOW_DATA_ATTR !== !1, Fe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ie = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, T = e.SAFE_FOR_TEMPLATES || !1, Le = e.SAFE_FOR_XML !== !1, E = e.WHOLE_DOCUMENT || !1, D = e.RETURN_DOM || !1, He = e.RETURN_DOM_FRAGMENT || !1, Ue = e.RETURN_TRUSTED_TYPE || !1, Ve = e.FORCE_BODY || !1, O = e.SANITIZE_DOM !== !1, We = e.SANITIZE_NAMED_PROPS || !1, k = e.KEEP_CONTENT !== !1, Ke = e.IN_PLACE || !1, Oe = Ni(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Xi, tt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : j, ot = fa(e, "MATHML_TEXT_INTEGRATION_POINTS", () => X({}, at)), st = fa(e, "HTML_INTEGRATION_POINTS", () => X({}, M));
|
|
2716
|
+
let t = fa(e, "CUSTOM_ELEMENT_HANDLING", () => ci(null));
|
|
2717
|
+
if (C = ci(null), q(t, "tagNameCheck") && ft(t.tagNameCheck) && (C.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && ft(t.attributeNameCheck) && (C.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (C.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(C), T && (Pe = !1), He && (D = !0), qe && (x = X({}, Bi), S = ci(null), qe.html === !0 && (X(x, Pi), X(S, Vi)), qe.svg === !0 && (X(x, Fi), X(S, Hi), X(S, Wi)), qe.svgFilters === !0 && (X(x, Ii), X(S, Hi), X(S, Wi)), qe.mathMl === !0 && (X(x, Ri), X(S, Ui), X(S, Wi))), w.tagCheck = null, w.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? w.tagCheck = e.ADD_TAGS : _i(e.ADD_TAGS) && (x === ke && (x = Z(x)), X(x, e.ADD_TAGS, N))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? w.attributeCheck = e.ADD_ATTR : _i(e.ADD_ATTR) && (S === Ae && (S = Z(S)), X(S, e.ADD_ATTR, N))), q(e, "ADD_FORBID_CONTENTS") && _i(e.ADD_FORBID_CONTENTS) && (Je === Ye && (Je = Z(Je)), X(Je, e.ADD_FORBID_CONTENTS, N)), k && (x["#text"] = !0), E && X(x, [
|
|
2718
|
+
"html",
|
|
2719
|
+
"head",
|
|
2720
|
+
"body"
|
|
2721
|
+
]), x.table && (X(x, ["tbody"]), delete je.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
2722
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw ki("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
2723
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw ki("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
2724
|
+
let t = g;
|
|
2725
|
+
g = e.TRUSTED_TYPES_POLICY;
|
|
2726
|
+
try {
|
|
2727
|
+
_ = fe("");
|
|
2728
|
+
} catch (e) {
|
|
2729
|
+
throw g = t, e;
|
|
2730
|
+
}
|
|
2731
|
+
} else e.TRUSTED_TYPES_POLICY === null ? (g = void 0, _ = "") : (g === void 0 && (g = pe()), g && typeof _ == "string" && (_ = fe("")));
|
|
2732
|
+
G && G(e), P = e;
|
|
2733
|
+
}, mt = X({}, [
|
|
2734
|
+
...Fi,
|
|
2735
|
+
...Ii,
|
|
2736
|
+
...Li
|
|
2737
|
+
]), ht = X({}, [...Ri, ...zi]), gt = function(e, t, n) {
|
|
2738
|
+
return t.namespaceURI === j ? e === "svg" : t.namespaceURI === et ? e === "svg" && (n === "annotation-xml" || ot[n]) : !!mt[e];
|
|
2739
|
+
}, _t = function(e, t, n) {
|
|
2740
|
+
return t.namespaceURI === j ? e === "math" : t.namespaceURI === A ? e === "math" && st[n] : !!ht[e];
|
|
2741
|
+
}, vt = function(e, t, n) {
|
|
2742
|
+
return t.namespaceURI === A && !st[n] || t.namespaceURI === et && !ot[n] ? !1 : !ht[e] && (ct[e] || !mt[e]);
|
|
2743
|
+
}, yt = function(e) {
|
|
2744
|
+
let t = re(e);
|
|
2745
|
+
(!t || !t.tagName) && (t = {
|
|
2746
|
+
namespaceURI: tt,
|
|
2747
|
+
tagName: "template"
|
|
2748
|
+
});
|
|
2749
|
+
let n = vi(e.tagName), r = vi(t.tagName);
|
|
2750
|
+
return rt[e.namespaceURI] ? e.namespaceURI === A ? gt(n, t, r) : e.namespaceURI === et ? _t(n, t, r) : e.namespaceURI === j ? vt(n, t, r) : !!(lt === "application/xhtml+xml" && rt[e.namespaceURI]) : !1;
|
|
2751
|
+
}, F = function(e) {
|
|
2752
|
+
hi(t.removed, { element: e });
|
|
2753
|
+
try {
|
|
2754
|
+
re(e).removeChild(e);
|
|
2755
|
+
} catch {
|
|
2756
|
+
if (p(e), !re(e)) throw ki("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
2757
|
+
}
|
|
2758
|
+
}, bt = function(e, t, n) {
|
|
2759
|
+
try {
|
|
2760
|
+
ee(e, t);
|
|
2761
|
+
} catch {
|
|
2762
|
+
try {
|
|
2763
|
+
e.removeAttribute(n);
|
|
2764
|
+
} catch {}
|
|
2765
|
+
}
|
|
2766
|
+
}, xt = function(e) {
|
|
2767
|
+
wt(e);
|
|
2768
|
+
let t = ne(e);
|
|
2769
|
+
if (t) {
|
|
2770
|
+
let e = [];
|
|
2771
|
+
fi(t, (t) => {
|
|
2772
|
+
hi(e, t);
|
|
2773
|
+
}), fi(e, (e) => {
|
|
2774
|
+
try {
|
|
2775
|
+
p(e);
|
|
2776
|
+
} catch {}
|
|
2777
|
+
});
|
|
2778
|
+
}
|
|
2779
|
+
let n = ae(e);
|
|
2780
|
+
if (n) for (let t = n.length - 1; t >= 0; --t) {
|
|
2781
|
+
let r = n[t], i = r && r.name;
|
|
2782
|
+
typeof i == "string" && bt(e, r, i);
|
|
2783
|
+
}
|
|
2784
|
+
}, St = function(e, n, r) {
|
|
2785
|
+
if (!r) try {
|
|
2786
|
+
r = n.getAttributeNode(e);
|
|
2787
|
+
} catch {
|
|
2788
|
+
r = null;
|
|
2789
|
+
}
|
|
2790
|
+
hi(t.removed, {
|
|
2791
|
+
attribute: r || null,
|
|
2792
|
+
from: n
|
|
2793
|
+
});
|
|
2794
|
+
try {
|
|
2795
|
+
r ? ee(n, r) : n.removeAttribute(e);
|
|
2796
|
+
} catch {
|
|
2797
|
+
try {
|
|
2798
|
+
n.removeAttribute(e);
|
|
2799
|
+
} catch {}
|
|
2800
|
+
}
|
|
2801
|
+
if (e === "is") {
|
|
2802
|
+
if (D || He) try {
|
|
2803
|
+
F(n);
|
|
2804
|
+
} catch {}
|
|
2805
|
+
else try {
|
|
2806
|
+
n.setAttribute(e, "");
|
|
2807
|
+
} catch {}
|
|
2808
|
+
}
|
|
2809
|
+
}, Ct = function(e) {
|
|
2810
|
+
let t = ae(e);
|
|
2811
|
+
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
2812
|
+
let r = t[n], i = r && r.name;
|
|
2813
|
+
typeof i != "string" || S[N(i)] || bt(e, r, i);
|
|
2814
|
+
}
|
|
2815
|
+
}, wt = function(e) {
|
|
2816
|
+
let t = [e];
|
|
2817
|
+
for (; t.length > 0;) {
|
|
2818
|
+
let e = t.pop();
|
|
2819
|
+
ce(e) === $.element && Ct(e);
|
|
2820
|
+
let n = ne(e);
|
|
2821
|
+
if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
|
|
2822
|
+
}
|
|
2823
|
+
}, Tt = function(e, t) {
|
|
2824
|
+
return Le ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
|
|
2825
|
+
}, Et = function(e) {
|
|
2826
|
+
if (!Le) return;
|
|
2827
|
+
let t = [e];
|
|
2828
|
+
for (; t.length > 0;) {
|
|
2829
|
+
let e = t.pop(), n = ce(e);
|
|
2830
|
+
if (n === $.processingInstruction || n === $.comment && J(na, e.data)) {
|
|
2831
|
+
try {
|
|
2832
|
+
p(e);
|
|
2833
|
+
} catch {}
|
|
2834
|
+
continue;
|
|
2835
|
+
}
|
|
2836
|
+
if (n === $.element) {
|
|
2837
|
+
let t = e, n = N(h(e));
|
|
2838
|
+
try {
|
|
2839
|
+
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && Tt("for", n) && t.removeAttribute("for");
|
|
2840
|
+
} catch {}
|
|
2841
|
+
}
|
|
2842
|
+
let r = ne(e);
|
|
2843
|
+
if (r) for (let e = r.length - 1; e >= 0; --e) t.push(r[e]);
|
|
2844
|
+
}
|
|
2845
|
+
}, Dt = function(e) {
|
|
2846
|
+
let t = null, r = null;
|
|
2847
|
+
if (Ve) e = "<remove></remove>" + e;
|
|
2848
|
+
else {
|
|
2849
|
+
let t = bi(e, /^[\r\n\t ]+/);
|
|
2850
|
+
r = t && t[0];
|
|
2851
|
+
}
|
|
2852
|
+
lt === "application/xhtml+xml" && tt === j && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
2853
|
+
let i = g ? fe(e) : e;
|
|
2854
|
+
if (tt === j) try {
|
|
2855
|
+
t = new l().parseFromString(i, lt);
|
|
2856
|
+
} catch {}
|
|
2857
|
+
if (!t || !t.documentElement) {
|
|
2858
|
+
t = he.createDocument(tt, "template", null);
|
|
2859
|
+
try {
|
|
2860
|
+
t.documentElement.innerHTML = nt ? _ : i;
|
|
2861
|
+
} catch {}
|
|
2862
|
+
}
|
|
2863
|
+
let a = t.body || t.documentElement;
|
|
2864
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), tt === j ? ve.call(t, E ? "html" : "body")[0] : E ? t.documentElement : a;
|
|
2865
|
+
}, Ot = function(e) {
|
|
2866
|
+
let t = se ? se(e) : e.ownerDocument;
|
|
2867
|
+
return ge.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
|
|
2868
|
+
}, kt = function(e) {
|
|
2869
|
+
return e = xi(e, be, " "), e = xi(e, xe, " "), e = xi(e, Se, " "), e;
|
|
2870
|
+
}, At = function(e) {
|
|
2871
|
+
e.normalize();
|
|
2872
|
+
let t = se ? se(e) : e.ownerDocument, n = ge.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
|
|
2873
|
+
for (; r;) r.data = kt(r.data), r = n.nextNode();
|
|
2874
|
+
let i = e.querySelectorAll?.call(e, "template");
|
|
2875
|
+
i && fi(i, (e) => {
|
|
2876
|
+
Mt(e.content) && At(e.content);
|
|
2877
|
+
});
|
|
2878
|
+
}, jt = function(e) {
|
|
2879
|
+
let t = oe ? oe(e) : null;
|
|
2880
|
+
return typeof t != "string" || N(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 !== m(e) || e.childNodes !== ne(e);
|
|
2881
|
+
}, Mt = function(e) {
|
|
2882
|
+
if (!m || typeof e != "object" || !e) return !1;
|
|
2883
|
+
try {
|
|
2884
|
+
return m(e) === $.documentFragment;
|
|
2885
|
+
} catch {
|
|
2886
|
+
return !1;
|
|
2887
|
+
}
|
|
2888
|
+
}, Nt = function(e) {
|
|
2889
|
+
if (!m || typeof e != "object" || !e) return !1;
|
|
2890
|
+
try {
|
|
2891
|
+
return typeof m(e) == "number";
|
|
2892
|
+
} catch {
|
|
2893
|
+
return !1;
|
|
2894
|
+
}
|
|
2895
|
+
};
|
|
2896
|
+
function I(e, n, r) {
|
|
2897
|
+
e.length !== 0 && fi(e, (e) => {
|
|
2898
|
+
e.call(t, n, r, P);
|
|
2899
|
+
});
|
|
2900
|
+
}
|
|
2901
|
+
let Pt = function(e, t) {
|
|
2902
|
+
return !!(Le && e.hasChildNodes() && !Nt(e.firstElementChild) && J(ta, e.textContent) && J(ta, e.innerHTML) || Le && e.namespaceURI === j && oa[t] && (Nt(e.firstElementChild) || typeof e.textContent == "string" && J(sa[t], e.textContent)) || e.nodeType === $.processingInstruction || Le && e.nodeType === $.comment && J(na, e.data));
|
|
2903
|
+
}, Ft = function(e, t) {
|
|
2904
|
+
return e instanceof RegExp ? J(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
|
|
2905
|
+
}, It = function(e, t, n) {
|
|
2906
|
+
if (!je[t] && Ht(t) && Ft(C.tagNameCheck, t)) return !1;
|
|
2907
|
+
if (k && !Je[t]) {
|
|
2908
|
+
let t = re(e), r = ne(e);
|
|
2909
|
+
if (r && t) {
|
|
2910
|
+
let i = r.length;
|
|
2911
|
+
for (let a = i - 1; a >= 0; --a) {
|
|
2912
|
+
let i = e === n ? f(r[a], !0) : r[a];
|
|
2913
|
+
t.insertBefore(i, te(e));
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
return F(e), !0;
|
|
2918
|
+
}, Lt = function(e, t, n, r) {
|
|
2919
|
+
return e.length === 0 ? t : t === n || t === r ? Z(t) : t;
|
|
2920
|
+
}, Rt = function(e, t) {
|
|
2921
|
+
return e === t || re(e) !== null ? !1 : (Ke && wt(e), !0);
|
|
2922
|
+
}, zt = function(e, n) {
|
|
2923
|
+
if (I(b.beforeSanitizeElements, e, null), Rt(e, n)) return !0;
|
|
2924
|
+
if (jt(e)) return F(e), !0;
|
|
2925
|
+
let r = N(h(e));
|
|
2926
|
+
if (x = Lt(b.uponSanitizeElement, x, ke, ze), I(b.uponSanitizeElement, e, {
|
|
2927
|
+
tagName: r,
|
|
2928
|
+
allowedTags: x
|
|
2929
|
+
}), Rt(e, n)) return !0;
|
|
2930
|
+
if (Pt(e, r)) return F(e), !0;
|
|
2931
|
+
if (je[r] || !(w.tagCheck instanceof Function && w.tagCheck(r)) && !x[r]) {
|
|
2932
|
+
let t = It(e, r, n);
|
|
2933
|
+
return t === !1 && I(b.afterSanitizeElements, e, null), t;
|
|
2934
|
+
}
|
|
2935
|
+
if (ce(e) === $.element && !yt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(ra, e.innerHTML)) return F(e), !0;
|
|
2936
|
+
if (T && e.nodeType === $.text) {
|
|
2937
|
+
let n = kt(e.textContent);
|
|
2938
|
+
e.textContent !== n && (hi(t.removed, { element: e.cloneNode() }), e.textContent = n);
|
|
2939
|
+
}
|
|
2940
|
+
return I(b.afterSanitizeElements, e, null), !1;
|
|
2941
|
+
}, Bt = function(e, t, r) {
|
|
2942
|
+
if (Me[t] || Tt(t, e) || O && (t === "id" || t === "name") && (r in n || r in dt)) return !1;
|
|
2943
|
+
let i = S[t] || w.attributeCheck instanceof Function && w.attributeCheck(t, e);
|
|
2944
|
+
return Pe && J(Ce, t) || Ne && J(we, t) ? !0 : i ? Qe[t] || J(Oe, xi(r, Ee, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Si(r, "data:") === 0 && Xe[e] || Fe && !J(Te, xi(r, Ee, "")) ? !0 : !r : Ht(e) && Ft(C.tagNameCheck, e) && Ft(C.attributeNameCheck, t, e) || t === "is" && C.allowCustomizedBuiltInElements && Ft(C.tagNameCheck, r);
|
|
2945
|
+
}, Vt = X({}, [
|
|
2946
|
+
"annotation-xml",
|
|
2947
|
+
"color-profile",
|
|
2948
|
+
"font-face",
|
|
2949
|
+
"font-face-format",
|
|
2950
|
+
"font-face-name",
|
|
2951
|
+
"font-face-src",
|
|
2952
|
+
"font-face-uri",
|
|
2953
|
+
"missing-glyph"
|
|
2954
|
+
]), Ht = function(e) {
|
|
2955
|
+
return !Vt[vi(e)] && J(De, e);
|
|
2956
|
+
}, Ut = function(e, t, n, r) {
|
|
2957
|
+
if (g && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
2958
|
+
case "TrustedHTML": return fe(r);
|
|
2959
|
+
case "TrustedScriptURL": return y(r);
|
|
2960
|
+
}
|
|
2961
|
+
return r;
|
|
2962
|
+
}, Wt = function(e, t, n, r) {
|
|
2963
|
+
try {
|
|
2964
|
+
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !jt(e) || (F(e), !1);
|
|
2965
|
+
} catch {
|
|
2966
|
+
return St(t, e), !1;
|
|
2967
|
+
}
|
|
2968
|
+
}, Gt = function(e) {
|
|
2969
|
+
I(b.beforeSanitizeAttributes, e, null);
|
|
2970
|
+
let n = e.attributes;
|
|
2971
|
+
if (!n || jt(e)) return;
|
|
2972
|
+
S = Lt(b.uponSanitizeAttribute, S, Ae, Be);
|
|
2973
|
+
let r = {
|
|
2974
|
+
attrName: "",
|
|
2975
|
+
attrValue: "",
|
|
2976
|
+
keepAttr: !0,
|
|
2977
|
+
allowedAttributes: S,
|
|
2978
|
+
forceKeepAttr: void 0
|
|
2979
|
+
}, i = n.length, a = N(e.nodeName);
|
|
2980
|
+
for (; i--;) {
|
|
2981
|
+
let o = n[i], s = o.name, c = o.namespaceURI, l = o.value, u = N(s), d = l, f = s === "value" ? d : Ci(d), p = !1;
|
|
2982
|
+
if (r.attrName = u, r.attrValue = f, r.keepAttr = !0, r.forceKeepAttr = void 0, I(b.uponSanitizeAttribute, e, r), f = r.attrValue, We && (u === "id" || u === "name") && Si(f, Ge) !== 0 && (St(s, e, o), f = Ge + f, p = !0), Le && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, f)) {
|
|
2983
|
+
St(s, e, o);
|
|
2984
|
+
continue;
|
|
2985
|
+
}
|
|
2986
|
+
if (u === "attributename" && bi(f, "href")) {
|
|
2987
|
+
St(s, e, o);
|
|
2988
|
+
continue;
|
|
2989
|
+
}
|
|
2990
|
+
if (!r.forceKeepAttr) {
|
|
2991
|
+
if (!r.keepAttr) {
|
|
2992
|
+
St(s, e, o);
|
|
2993
|
+
continue;
|
|
2994
|
+
}
|
|
2995
|
+
if (!Ie && J(ia, f)) {
|
|
2996
|
+
St(s, e, o);
|
|
2997
|
+
continue;
|
|
2998
|
+
}
|
|
2999
|
+
if (T && (f = kt(f)), !Bt(a, u, f)) {
|
|
3000
|
+
St(s, e, o);
|
|
3001
|
+
continue;
|
|
3002
|
+
}
|
|
3003
|
+
f = Ut(a, u, c, f), f !== d && Wt(e, s, c, f) && p && mi(t.removed);
|
|
3004
|
+
}
|
|
3005
|
+
}
|
|
3006
|
+
I(b.afterSanitizeAttributes, e, null);
|
|
3007
|
+
}, Kt = function(e) {
|
|
3008
|
+
let t = null, n = Ot(e);
|
|
3009
|
+
for (I(b.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (I(b.uponSanitizeShadowNode, t, null), zt(t, e), Gt(t), Mt(t.content) && Kt(t.content), ce(t) === $.element) {
|
|
3010
|
+
let e = ie(t);
|
|
3011
|
+
Mt(e) && (qt(e), Kt(e));
|
|
3012
|
+
}
|
|
3013
|
+
I(b.afterSanitizeShadowDOM, e, null);
|
|
3014
|
+
}, qt = function(e) {
|
|
3015
|
+
let t = [{
|
|
3016
|
+
node: e,
|
|
3017
|
+
shadow: null
|
|
3018
|
+
}];
|
|
3019
|
+
for (; t.length > 0;) {
|
|
3020
|
+
let e = t.pop();
|
|
3021
|
+
if (e.shadow) {
|
|
3022
|
+
Kt(e.shadow);
|
|
3023
|
+
continue;
|
|
3024
|
+
}
|
|
3025
|
+
let n = e.node, r = ce(n) === $.element, i = ne(n);
|
|
3026
|
+
if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
|
|
3027
|
+
node: i[e],
|
|
3028
|
+
shadow: null
|
|
3029
|
+
});
|
|
3030
|
+
if (r) {
|
|
3031
|
+
let e = oe ? oe(n) : null;
|
|
3032
|
+
if (typeof e == "string" && N(e) === "template") {
|
|
3033
|
+
let e = n.content;
|
|
3034
|
+
Mt(e) && t.push({
|
|
3035
|
+
node: e,
|
|
3036
|
+
shadow: null
|
|
3037
|
+
});
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
if (r) {
|
|
3041
|
+
let e = ie(n);
|
|
3042
|
+
Mt(e) && t.push({
|
|
3043
|
+
node: null,
|
|
3044
|
+
shadow: e
|
|
3045
|
+
}, {
|
|
3046
|
+
node: e,
|
|
3047
|
+
shadow: null
|
|
3048
|
+
});
|
|
3049
|
+
}
|
|
3050
|
+
}
|
|
3051
|
+
};
|
|
3052
|
+
return t.sanitize = function(e) {
|
|
3053
|
+
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
|
|
3054
|
+
if (nt = !e, nt && (e = "<!-->"), typeof e != "string" && !Nt(e) && (e = Mi(e), typeof e != "string")) throw ki("dirty is not a string, aborting");
|
|
3055
|
+
if (!t.isSupported) return e;
|
|
3056
|
+
Re ? (x = ze, S = Be) : pt(n), (b.uponSanitizeElement.length > 0 || b.uponSanitizeAttribute.length > 0) && (x = Z(x)), b.uponSanitizeAttribute.length > 0 && (S = Z(S)), t.removed = [];
|
|
3057
|
+
let c = Ke && typeof e != "string" && Nt(e);
|
|
3058
|
+
if (c) {
|
|
3059
|
+
Et(e);
|
|
3060
|
+
let t = h(e);
|
|
3061
|
+
if (typeof t == "string") {
|
|
3062
|
+
let n = N(t);
|
|
3063
|
+
if (!x[n] || je[n]) throw xt(e), ki("root node is forbidden and cannot be sanitized in-place");
|
|
3064
|
+
}
|
|
3065
|
+
if (jt(e)) throw xt(e), ki("root node is clobbered and cannot be sanitized in-place");
|
|
3066
|
+
try {
|
|
3067
|
+
qt(e);
|
|
3068
|
+
} catch (t) {
|
|
3069
|
+
throw xt(e), t;
|
|
3070
|
+
}
|
|
3071
|
+
} else if (Nt(e)) i = Dt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === $.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), qt(i);
|
|
3072
|
+
else {
|
|
3073
|
+
if (!D && !T && !E && e.indexOf("<") === -1) return g && Ue ? fe(e) : e;
|
|
3074
|
+
if (i = Dt(e), !i) return D ? null : Ue ? _ : "";
|
|
3075
|
+
}
|
|
3076
|
+
i && Ve && F(i.firstChild);
|
|
3077
|
+
let l = c ? e : i;
|
|
3078
|
+
try {
|
|
3079
|
+
let e = Ot(l);
|
|
3080
|
+
for (; o = e.nextNode();) zt(o, l), Gt(o), Mt(o.content) && Kt(o.content);
|
|
3081
|
+
} catch (n) {
|
|
3082
|
+
throw c && (xt(e), fi(t.removed, (e) => {
|
|
3083
|
+
e.element && wt(e.element);
|
|
3084
|
+
})), n;
|
|
3085
|
+
}
|
|
3086
|
+
if (c) return fi(t.removed, (e) => {
|
|
3087
|
+
e.element && wt(e.element);
|
|
3088
|
+
}), T && At(e), e;
|
|
3089
|
+
if (D) {
|
|
3090
|
+
if (T && At(i), He) for (s = _e.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
|
|
3091
|
+
else s = i;
|
|
3092
|
+
return (S.shadowroot || S.shadowrootmode) && (s = ye.call(r, s, !0)), s;
|
|
3093
|
+
}
|
|
3094
|
+
let u = E ? i.outerHTML : i.innerHTML;
|
|
3095
|
+
return E && x["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J($i, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), T && (u = kt(u)), g && Ue ? fe(u) : u;
|
|
3096
|
+
}, t.setConfig = function() {
|
|
3097
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3098
|
+
pt(e), Re = !0, ze = x, Be = S;
|
|
3099
|
+
}, t.clearConfig = function() {
|
|
3100
|
+
P = null, Re = !1, ze = null, Be = null, g = le, _ = "";
|
|
3101
|
+
}, t.isValidAttribute = function(e, t, n) {
|
|
3102
|
+
P || pt({});
|
|
3103
|
+
let r = N(e), i = N(t);
|
|
3104
|
+
return Bt(r, i, n);
|
|
3105
|
+
}, t.addHook = function(e, t) {
|
|
3106
|
+
typeof t == "function" && q(b, e) && hi(b[e], t);
|
|
3107
|
+
}, t.removeHook = function(e, t) {
|
|
3108
|
+
if (q(b, e)) {
|
|
3109
|
+
if (t !== void 0) {
|
|
3110
|
+
let n = pi(b[e], t);
|
|
3111
|
+
return n === -1 ? void 0 : gi(b[e], n, 1)[0];
|
|
3112
|
+
}
|
|
3113
|
+
return mi(b[e]);
|
|
3114
|
+
}
|
|
3115
|
+
}, t.removeHooks = function(e) {
|
|
3116
|
+
q(b, e) && (b[e] = []);
|
|
3117
|
+
}, t.removeAllHooks = function() {
|
|
3118
|
+
b = ua();
|
|
3119
|
+
}, t;
|
|
3120
|
+
}
|
|
3121
|
+
var ma = pa();
|
|
3122
|
+
//#endregion
|
|
3123
|
+
//#region ../../packages/components/src/chat/markdownHtml.ts
|
|
3124
|
+
function ha(e) {
|
|
3125
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
3126
|
+
}
|
|
3127
|
+
function ga(e, t) {
|
|
3128
|
+
return `<span class="katex-pending" data-katex="${encodeURIComponent(e)}" data-display="${t}"></span>`;
|
|
3129
|
+
}
|
|
3130
|
+
var _a = {
|
|
3131
|
+
ADD_ATTR: ["target"],
|
|
3132
|
+
ALLOW_UNKNOWN_PROTOCOLS: !0,
|
|
3133
|
+
FORBID_TAGS: ["style", "form"],
|
|
3134
|
+
FORBID_ATTR: ["style"]
|
|
3135
|
+
};
|
|
3136
|
+
function va(e) {
|
|
3137
|
+
return ma.sanitize(e, _a);
|
|
3138
|
+
}
|
|
3139
|
+
a(), l();
|
|
3140
|
+
var ya = ["innerHTML"], ba = 100, xa = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
2312
3141
|
__name: "PkStreamingMarkdown",
|
|
2313
3142
|
props: {
|
|
2314
3143
|
markdown: {
|
|
@@ -2337,22 +3166,16 @@ var zr = ["innerHTML"], Br = 100, Vr = /*#__PURE__*/ re(/* @__PURE__ */ e({
|
|
|
2337
3166
|
}
|
|
2338
3167
|
},
|
|
2339
3168
|
setup(e) {
|
|
2340
|
-
let a = e, { t: l } = f({ useScope: "global" }),
|
|
2341
|
-
function
|
|
2342
|
-
return
|
|
3169
|
+
let a = e, { t: l } = f({ useScope: "global" }), te = null;
|
|
3170
|
+
function ae() {
|
|
3171
|
+
return te ||= import("./dist-CsXLeGNF.js"), te;
|
|
2343
3172
|
}
|
|
2344
|
-
let
|
|
3173
|
+
let m = null;
|
|
2345
3174
|
function oe() {
|
|
2346
|
-
return
|
|
3175
|
+
return m ||= import("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.mjs").then((e) => e.default), m;
|
|
2347
3176
|
}
|
|
2348
|
-
let
|
|
2349
|
-
|
|
2350
|
-
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
2351
|
-
}
|
|
2352
|
-
function le(e, t) {
|
|
2353
|
-
return `<span class="katex-pending" data-katex="${ce(e)}" data-display="${t}"></span>`;
|
|
2354
|
-
}
|
|
2355
|
-
$.use({ extensions: [{
|
|
3177
|
+
let se = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, h = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
|
|
3178
|
+
W.use({ extensions: [{
|
|
2356
3179
|
name: "inlineKatex",
|
|
2357
3180
|
level: "inline",
|
|
2358
3181
|
start: (e) => {
|
|
@@ -2360,7 +3183,7 @@ var zr = ["innerHTML"], Br = 100, Vr = /*#__PURE__*/ re(/* @__PURE__ */ e({
|
|
|
2360
3183
|
if (t !== -1 && (t === 0 || e.charAt(t - 1) === " ")) return t;
|
|
2361
3184
|
},
|
|
2362
3185
|
tokenizer(e) {
|
|
2363
|
-
let t = e.match(
|
|
3186
|
+
let t = e.match(se);
|
|
2364
3187
|
if (t) return {
|
|
2365
3188
|
type: "inlineKatex",
|
|
2366
3189
|
raw: t[0],
|
|
@@ -2369,13 +3192,13 @@ var zr = ["innerHTML"], Br = 100, Vr = /*#__PURE__*/ re(/* @__PURE__ */ e({
|
|
|
2369
3192
|
};
|
|
2370
3193
|
},
|
|
2371
3194
|
renderer(e) {
|
|
2372
|
-
return
|
|
3195
|
+
return ga(e.text, e.displayMode);
|
|
2373
3196
|
}
|
|
2374
3197
|
}, {
|
|
2375
3198
|
name: "blockKatex",
|
|
2376
3199
|
level: "block",
|
|
2377
3200
|
tokenizer(e) {
|
|
2378
|
-
let t = e.match(
|
|
3201
|
+
let t = e.match(h);
|
|
2379
3202
|
if (t) return {
|
|
2380
3203
|
type: "blockKatex",
|
|
2381
3204
|
raw: t[0],
|
|
@@ -2384,9 +3207,9 @@ var zr = ["innerHTML"], Br = 100, Vr = /*#__PURE__*/ re(/* @__PURE__ */ e({
|
|
|
2384
3207
|
};
|
|
2385
3208
|
},
|
|
2386
3209
|
renderer(e) {
|
|
2387
|
-
return
|
|
3210
|
+
return ga(e.text, e.displayMode) + "\n";
|
|
2388
3211
|
}
|
|
2389
|
-
}] }),
|
|
3212
|
+
}] }), W.use({ extensions: [{
|
|
2390
3213
|
name: "thinking",
|
|
2391
3214
|
level: "block",
|
|
2392
3215
|
start: (e) => e.indexOf("<thinking>"),
|
|
@@ -2405,21 +3228,21 @@ var zr = ["innerHTML"], Br = 100, Vr = /*#__PURE__*/ re(/* @__PURE__ */ e({
|
|
|
2405
3228
|
return `<div class="thinking-block">${this.parser.parse(e.tokens ?? [])}</div>`;
|
|
2406
3229
|
}
|
|
2407
3230
|
}] });
|
|
2408
|
-
let
|
|
2409
|
-
|
|
3231
|
+
let g = new W.Renderer(), _ = (e) => e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), le = /^(?:javascript|data|vbscript|file):/i;
|
|
3232
|
+
g.link = function({ href: e, title: t, tokens: n }) {
|
|
2410
3233
|
let r = this.parser.parseInline(n), i = (e ?? "").trim().replace(/[\x00-\x1f]/g, "");
|
|
2411
|
-
if (!i ||
|
|
2412
|
-
let a = t ? ` title="${
|
|
2413
|
-
return `<a href="${
|
|
2414
|
-
},
|
|
2415
|
-
return `<div class="table-wrapper">${
|
|
3234
|
+
if (!i || le.test(i)) return r;
|
|
3235
|
+
let a = t ? ` title="${_(t)}"` : "", o = ne(i) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
|
|
3236
|
+
return `<a href="${_(i)}"${a}${o}>${r}</a>`;
|
|
3237
|
+
}, g.table = function(e) {
|
|
3238
|
+
return `<div class="table-wrapper">${W.Renderer.prototype.table.call(this, e)}</div>`;
|
|
2416
3239
|
};
|
|
2417
|
-
let
|
|
2418
|
-
|
|
2419
|
-
function
|
|
3240
|
+
let ue = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
|
|
3241
|
+
g.code = ({ text: e }) => ue.test(e) ? `<pre class="mermaid">${ha(e)}</pre>` : `<pre><code>${ha(e)}</code></pre>`;
|
|
3242
|
+
function v(e) {
|
|
2420
3243
|
return e.replace(/\\\[([\s\S]*?)\\\]/g, (e, t) => `$$${t}$$`).replace(/\\\(([\s\S]*?)\\\)/g, (e, t) => `$${t}$`).replace(/^(\d+)\.(?!\s)/gm, "$1\\.");
|
|
2421
3244
|
}
|
|
2422
|
-
function
|
|
3245
|
+
function de(e) {
|
|
2423
3246
|
let t = /* @__PURE__ */ new Set(), n = /^(`{3,}|~{3,})[^\n]*\n([\s\S]*?)\n\1/gm, r;
|
|
2424
3247
|
for (; (r = n.exec(e)) !== null;) for (let e = r.index; e < r.index + r[0].length; e++) t.add(e);
|
|
2425
3248
|
return e.replace(/[{[]([\s\S]*?)[}\]]/g, (e, n, r) => {
|
|
@@ -2431,25 +3254,25 @@ var zr = ["innerHTML"], Br = 100, Vr = /*#__PURE__*/ re(/* @__PURE__ */ e({
|
|
|
2431
3254
|
}
|
|
2432
3255
|
}).replace(/\n{3,}/g, "\n\n");
|
|
2433
3256
|
}
|
|
2434
|
-
let
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
], y = n("container"),
|
|
2440
|
-
let e =
|
|
2441
|
-
return
|
|
3257
|
+
let fe = [
|
|
3258
|
+
ce,
|
|
3259
|
+
de,
|
|
3260
|
+
dn,
|
|
3261
|
+
v
|
|
3262
|
+
], y = n("container"), pe = re(c(a, "markdown"), ba), me = u(() => a.tailLength ? _e(pe.value, a.tailLength) : pe.value), { resolveText: he } = ie(), ge = he(me), ve = u(() => {
|
|
3263
|
+
let e = fe.reduce((e, t) => t(e), ge.value);
|
|
3264
|
+
return va(W.parse(e, {
|
|
2442
3265
|
async: !1,
|
|
2443
3266
|
breaks: !0,
|
|
2444
|
-
renderer:
|
|
2445
|
-
});
|
|
3267
|
+
renderer: g
|
|
3268
|
+
}));
|
|
2446
3269
|
});
|
|
2447
|
-
async function
|
|
3270
|
+
async function ye() {
|
|
2448
3271
|
if (a.loading) return;
|
|
2449
3272
|
await i();
|
|
2450
3273
|
let e = y.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
|
|
2451
3274
|
if (!e?.length) return;
|
|
2452
|
-
let { renderMermaidSVG: t, THEMES: n } = await
|
|
3275
|
+
let { renderMermaidSVG: t, THEMES: n } = await ae(), r = a.isDark ? n["github-dark"] : n["github-light"];
|
|
2453
3276
|
for (let n of Array.from(e)) {
|
|
2454
3277
|
if (!n.isConnected) continue;
|
|
2455
3278
|
let e = n.textContent?.trim();
|
|
@@ -2459,37 +3282,37 @@ var zr = ["innerHTML"], Br = 100, Vr = /*#__PURE__*/ re(/* @__PURE__ */ e({
|
|
|
2459
3282
|
} catch {}
|
|
2460
3283
|
}
|
|
2461
3284
|
}
|
|
2462
|
-
async function
|
|
3285
|
+
async function b() {
|
|
2463
3286
|
await i();
|
|
2464
3287
|
let e = y.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
|
|
2465
3288
|
if (!e?.length) return;
|
|
2466
3289
|
let t = (await import("https://cdn.jsdelivr.net/npm/highlight.js@11/es/common.js")).default;
|
|
2467
3290
|
for (let n of e) t.highlightElement(n), n.setAttribute("data-highlighted", "true");
|
|
2468
3291
|
}
|
|
2469
|
-
async function
|
|
3292
|
+
async function be() {
|
|
2470
3293
|
await i();
|
|
2471
3294
|
let e = y.value?.querySelectorAll(".katex-pending");
|
|
2472
3295
|
if (!e?.length) return;
|
|
2473
3296
|
let t = await oe();
|
|
2474
|
-
p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css",
|
|
3297
|
+
p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", ee(y.value));
|
|
2475
3298
|
for (let n of Array.from(e)) {
|
|
2476
3299
|
if (!n.isConnected) continue;
|
|
2477
3300
|
let e = n.dataset.katex;
|
|
2478
3301
|
if (!e) continue;
|
|
2479
3302
|
let r = n.dataset.display === "true";
|
|
2480
3303
|
try {
|
|
2481
|
-
n.innerHTML = t.renderToString(e, {
|
|
3304
|
+
n.innerHTML = t.renderToString(decodeURIComponent(e), {
|
|
2482
3305
|
throwOnError: !1,
|
|
2483
3306
|
displayMode: r
|
|
2484
3307
|
}), n.classList.remove("katex-pending");
|
|
2485
3308
|
} catch {}
|
|
2486
3309
|
}
|
|
2487
3310
|
}
|
|
2488
|
-
async function
|
|
3311
|
+
async function xe() {
|
|
2489
3312
|
await i();
|
|
2490
3313
|
let e = y.value?.querySelectorAll("pre.mermaid[data-rendered]");
|
|
2491
3314
|
if (!e?.length) return;
|
|
2492
|
-
let { renderMermaidSVG: t, THEMES: n } = await
|
|
3315
|
+
let { renderMermaidSVG: t, THEMES: n } = await ae(), r = a.isDark ? n["github-dark"] : n["github-light"];
|
|
2493
3316
|
for (let n of Array.from(e)) {
|
|
2494
3317
|
if (!n.isConnected) continue;
|
|
2495
3318
|
let e = n.dataset.code;
|
|
@@ -2498,7 +3321,7 @@ var zr = ["innerHTML"], Br = 100, Vr = /*#__PURE__*/ re(/* @__PURE__ */ e({
|
|
|
2498
3321
|
} catch {}
|
|
2499
3322
|
}
|
|
2500
3323
|
}
|
|
2501
|
-
function
|
|
3324
|
+
function Se(e) {
|
|
2502
3325
|
let t = e.target;
|
|
2503
3326
|
if (!(t instanceof HTMLImageElement) || t.dataset.broken) return;
|
|
2504
3327
|
t.dataset.broken = "true";
|
|
@@ -2506,11 +3329,11 @@ var zr = ["innerHTML"], Br = 100, Vr = /*#__PURE__*/ re(/* @__PURE__ */ e({
|
|
|
2506
3329
|
n.className = "markdown-broken-image", n.textContent = t.alt || l("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
|
|
2507
3330
|
}
|
|
2508
3331
|
t(() => {
|
|
2509
|
-
y.value?.addEventListener("error",
|
|
3332
|
+
y.value?.addEventListener("error", Se, !0);
|
|
2510
3333
|
}), o(() => {
|
|
2511
|
-
y.value?.removeEventListener("error",
|
|
2512
|
-
}), s([
|
|
2513
|
-
let
|
|
3334
|
+
y.value?.removeEventListener("error", Se, !0);
|
|
3335
|
+
}), s([ve, () => a.loading], ye, { immediate: !0 }), s(() => a.isDark, xe), s(ve, b, { immediate: !0 }), s(ve, be, { immediate: !0 });
|
|
3336
|
+
let Ce = 0;
|
|
2514
3337
|
function we(e, t) {
|
|
2515
3338
|
let n = document.createElement("span");
|
|
2516
3339
|
return n.style.cssText = `animation:ft-${a.animation} ${a.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
|
|
@@ -2536,35 +3359,35 @@ var zr = ["innerHTML"], Br = 100, Vr = /*#__PURE__*/ re(/* @__PURE__ */ e({
|
|
|
2536
3359
|
for (; t.nextNode();) n.push(t.currentNode);
|
|
2537
3360
|
return n;
|
|
2538
3361
|
}
|
|
2539
|
-
function
|
|
3362
|
+
function De() {
|
|
2540
3363
|
if (!y.value || !a.loading || !a.animation) return;
|
|
2541
3364
|
let e = Ee(y.value), t = 0, n = 0;
|
|
2542
3365
|
for (let r of e) {
|
|
2543
3366
|
let e = r.textContent || "", i = t, a = t + e.length;
|
|
2544
|
-
if (t = a, a <=
|
|
3367
|
+
if (t = a, a <= Ce) continue;
|
|
2545
3368
|
let o = r.parentNode;
|
|
2546
3369
|
if (!o) continue;
|
|
2547
|
-
if (i >=
|
|
3370
|
+
if (i >= Ce) {
|
|
2548
3371
|
let t = r.nextSibling;
|
|
2549
3372
|
o.removeChild(r), n = Te(e, o, t, n);
|
|
2550
3373
|
continue;
|
|
2551
3374
|
}
|
|
2552
|
-
let s =
|
|
3375
|
+
let s = Ce - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
|
|
2553
3376
|
o.removeChild(c), n = Te(l, o, u, n);
|
|
2554
3377
|
}
|
|
2555
|
-
|
|
3378
|
+
Ce = t;
|
|
2556
3379
|
}
|
|
2557
|
-
return s(
|
|
2558
|
-
await i(),
|
|
3380
|
+
return s(ve, async () => {
|
|
3381
|
+
await i(), De();
|
|
2559
3382
|
}, { immediate: !0 }), s(() => a.markdown, (e, t) => {
|
|
2560
|
-
(!e || t && e.length < t.length) && (
|
|
3383
|
+
(!e || t && e.length < t.length) && (Ce = 0);
|
|
2561
3384
|
}), (e, t) => (r(), d("div", {
|
|
2562
3385
|
ref: "container",
|
|
2563
|
-
innerHTML:
|
|
2564
|
-
}, null, 8,
|
|
3386
|
+
innerHTML: ve.value
|
|
3387
|
+
}, null, 8, ya));
|
|
2565
3388
|
}
|
|
2566
3389
|
}), [["styles", [".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)}}"]]]);
|
|
2567
3390
|
//#endregion
|
|
2568
|
-
export { ue as C,
|
|
3391
|
+
export { ue as C, v as D, le as E, h as O, De as S, _ as T, xe as _, pe as a, fe as b, ke as c, Ce as d, Se as f, je as g, Oe as h, Ae as i, g as k, Ee as l, Ne as m, b as n, x as o, Fe as p, he as r, S as s, xa as t, Pe as u, me as v, de as w, Te as x, be as y };
|
|
2569
3392
|
|
|
2570
|
-
//# sourceMappingURL=PkStreamingMarkdown-
|
|
3393
|
+
//# sourceMappingURL=PkStreamingMarkdown-CYOm47PX.js.map
|