@bluepic/embed 0.4.0-next.187 → 0.4.0-next.189

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.
@@ -0,0 +1,3781 @@
1
+ var An = Object.defineProperty;
2
+ var En = (e, n, t) => n in e ? An(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
+ var T = (e, n, t) => En(e, typeof n != "symbol" ? n + "" : n, t);
4
+ const De = {};
5
+ function Fn(e) {
6
+ let n = De[e];
7
+ if (n)
8
+ return n;
9
+ n = De[e] = [];
10
+ for (let t = 0; t < 128; t++) {
11
+ const o = String.fromCharCode(t);
12
+ n.push(o);
13
+ }
14
+ for (let t = 0; t < e.length; t++) {
15
+ const o = e.charCodeAt(t);
16
+ n[o] = "%" + ("0" + o.toString(16).toUpperCase()).slice(-2);
17
+ }
18
+ return n;
19
+ }
20
+ function Y(e, n) {
21
+ typeof n != "string" && (n = Y.defaultChars);
22
+ const t = Fn(n);
23
+ return e.replace(/(%[a-f0-9]{2})+/gi, function(o) {
24
+ let r = "";
25
+ for (let i = 0, s = o.length; i < s; i += 3) {
26
+ const u = parseInt(o.slice(i + 1, i + 3), 16);
27
+ if (u < 128) {
28
+ r += t[u];
29
+ continue;
30
+ }
31
+ if ((u & 224) === 192 && i + 3 < s) {
32
+ const l = parseInt(o.slice(i + 4, i + 6), 16);
33
+ if ((l & 192) === 128) {
34
+ const c = u << 6 & 1984 | l & 63;
35
+ c < 128 ? r += "��" : r += String.fromCharCode(c), i += 3;
36
+ continue;
37
+ }
38
+ }
39
+ if ((u & 240) === 224 && i + 6 < s) {
40
+ const l = parseInt(o.slice(i + 4, i + 6), 16), c = parseInt(o.slice(i + 7, i + 9), 16);
41
+ if ((l & 192) === 128 && (c & 192) === 128) {
42
+ const f = u << 12 & 61440 | l << 6 & 4032 | c & 63;
43
+ f < 2048 || f >= 55296 && f <= 57343 ? r += "���" : r += String.fromCharCode(f), i += 6;
44
+ continue;
45
+ }
46
+ }
47
+ if ((u & 248) === 240 && i + 9 < s) {
48
+ const l = parseInt(o.slice(i + 4, i + 6), 16), c = parseInt(o.slice(i + 7, i + 9), 16), f = parseInt(o.slice(i + 10, i + 12), 16);
49
+ if ((l & 192) === 128 && (c & 192) === 128 && (f & 192) === 128) {
50
+ let h = u << 18 & 1835008 | l << 12 & 258048 | c << 6 & 4032 | f & 63;
51
+ h < 65536 || h > 1114111 ? r += "����" : (h -= 65536, r += String.fromCharCode(55296 + (h >> 10), 56320 + (h & 1023))), i += 9;
52
+ continue;
53
+ }
54
+ }
55
+ r += "�";
56
+ }
57
+ return r;
58
+ });
59
+ }
60
+ Y.defaultChars = ";/?:@&=+$,#";
61
+ Y.componentChars = "";
62
+ const ve = {};
63
+ function yn(e) {
64
+ let n = ve[e];
65
+ if (n)
66
+ return n;
67
+ n = ve[e] = [];
68
+ for (let t = 0; t < 128; t++) {
69
+ const o = String.fromCharCode(t);
70
+ /^[0-9a-z]$/i.test(o) ? n.push(o) : n.push("%" + ("0" + t.toString(16).toUpperCase()).slice(-2));
71
+ }
72
+ for (let t = 0; t < e.length; t++)
73
+ n[e.charCodeAt(t)] = e[t];
74
+ return n;
75
+ }
76
+ function q(e, n, t) {
77
+ typeof n != "string" && (t = n, n = q.defaultChars), typeof t > "u" && (t = !0);
78
+ const o = yn(n);
79
+ let r = "";
80
+ for (let i = 0, s = e.length; i < s; i++) {
81
+ const u = e.charCodeAt(i);
82
+ if (t && u === 37 && i + 2 < s && /^[0-9a-f]{2}$/i.test(e.slice(i + 1, i + 3))) {
83
+ r += e.slice(i, i + 3), i += 2;
84
+ continue;
85
+ }
86
+ if (u < 128) {
87
+ r += o[u];
88
+ continue;
89
+ }
90
+ if (u >= 55296 && u <= 57343) {
91
+ if (u >= 55296 && u <= 56319 && i + 1 < s) {
92
+ const l = e.charCodeAt(i + 1);
93
+ if (l >= 56320 && l <= 57343) {
94
+ r += encodeURIComponent(e[i] + e[i + 1]), i++;
95
+ continue;
96
+ }
97
+ }
98
+ r += "%EF%BF%BD";
99
+ continue;
100
+ }
101
+ r += encodeURIComponent(e[i]);
102
+ }
103
+ return r;
104
+ }
105
+ q.defaultChars = ";/?:@&=+$,-_.!~*'()#";
106
+ q.componentChars = "-_.!~*'()";
107
+ function ge(e) {
108
+ let n = "";
109
+ return n += e.protocol || "", n += e.slashes ? "//" : "", n += e.auth ? e.auth + "@" : "", e.hostname && e.hostname.indexOf(":") !== -1 ? n += "[" + e.hostname + "]" : n += e.hostname || "", n += e.port ? ":" + e.port : "", n += e.pathname || "", n += e.search || "", n += e.hash || "", n;
110
+ }
111
+ function oe() {
112
+ this.protocol = null, this.slashes = null, this.auth = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.pathname = null;
113
+ }
114
+ const Bn = /^([a-z0-9.+-]+:)/i, Tn = /:[0-9]*$/, zn = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, Sn = ["<", ">", '"', "`", " ", "\r", `
115
+ `, " "], jn = ["{", "}", "|", "\\", "^", "`"].concat(Sn), Jn = ["'"].concat(jn), we = ["%", "/", "?", ";", "#"].concat(Jn), Ae = ["/", "?", "#"], In = 255, Ee = /^[+a-z0-9A-Z_-]{0,63}$/, Mn = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, Fe = {
116
+ javascript: !0,
117
+ "javascript:": !0
118
+ }, ye = {
119
+ http: !0,
120
+ https: !0,
121
+ ftp: !0,
122
+ gopher: !0,
123
+ file: !0,
124
+ "http:": !0,
125
+ "https:": !0,
126
+ "ftp:": !0,
127
+ "gopher:": !0,
128
+ "file:": !0
129
+ };
130
+ function ke(e, n) {
131
+ if (e && e instanceof oe) return e;
132
+ const t = new oe();
133
+ return t.parse(e, n), t;
134
+ }
135
+ oe.prototype.parse = function(e, n) {
136
+ let t, o, r, i = e;
137
+ if (i = i.trim(), !n && e.split("#").length === 1) {
138
+ const c = zn.exec(i);
139
+ if (c)
140
+ return this.pathname = c[1], c[2] && (this.search = c[2]), this;
141
+ }
142
+ let s = Bn.exec(i);
143
+ if (s && (s = s[0], t = s.toLowerCase(), this.protocol = s, i = i.substr(s.length)), (n || s || i.match(/^\/\/[^@\/]+@[^@\/]+/)) && (r = i.substr(0, 2) === "//", r && !(s && Fe[s]) && (i = i.substr(2), this.slashes = !0)), !Fe[s] && (r || s && !ye[s])) {
144
+ let c = -1;
145
+ for (let a = 0; a < Ae.length; a++)
146
+ o = i.indexOf(Ae[a]), o !== -1 && (c === -1 || o < c) && (c = o);
147
+ let f, h;
148
+ c === -1 ? h = i.lastIndexOf("@") : h = i.lastIndexOf("@", c), h !== -1 && (f = i.slice(0, h), i = i.slice(h + 1), this.auth = f), c = -1;
149
+ for (let a = 0; a < we.length; a++)
150
+ o = i.indexOf(we[a]), o !== -1 && (c === -1 || o < c) && (c = o);
151
+ c === -1 && (c = i.length), i[c - 1] === ":" && c--;
152
+ const _ = i.slice(0, c);
153
+ i = i.slice(c), this.parseHost(_), this.hostname = this.hostname || "";
154
+ const p = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
155
+ if (!p) {
156
+ const a = this.hostname.split(/\./);
157
+ for (let b = 0, g = a.length; b < g; b++) {
158
+ const C = a[b];
159
+ if (C && !C.match(Ee)) {
160
+ let x = "";
161
+ for (let m = 0, d = C.length; m < d; m++)
162
+ C.charCodeAt(m) > 127 ? x += "x" : x += C[m];
163
+ if (!x.match(Ee)) {
164
+ const m = a.slice(0, b), d = a.slice(b + 1), k = C.match(Mn);
165
+ k && (m.push(k[1]), d.unshift(k[2])), d.length && (i = d.join(".") + i), this.hostname = m.join(".");
166
+ break;
167
+ }
168
+ }
169
+ }
170
+ }
171
+ this.hostname.length > In && (this.hostname = ""), p && (this.hostname = this.hostname.substr(1, this.hostname.length - 2));
172
+ }
173
+ const u = i.indexOf("#");
174
+ u !== -1 && (this.hash = i.substr(u), i = i.slice(0, u));
175
+ const l = i.indexOf("?");
176
+ return l !== -1 && (this.search = i.substr(l), i = i.slice(0, l)), i && (this.pathname = i), ye[t] && this.hostname && !this.pathname && (this.pathname = ""), this;
177
+ };
178
+ oe.prototype.parseHost = function(e) {
179
+ let n = Tn.exec(e);
180
+ n && (n = n[0], n !== ":" && (this.port = n.substr(1)), e = e.substr(0, e.length - n.length)), e && (this.hostname = e);
181
+ };
182
+ const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
183
+ __proto__: null,
184
+ decode: Y,
185
+ encode: q,
186
+ format: ge,
187
+ parse: ke
188
+ }, Symbol.toStringTag, { value: "Module" })), Xe = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Ye = /[\0-\x1F\x7F-\x9F]/, Ln = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/, Re = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/, Ke = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD803[\uDD8E\uDD8F\uDED1-\uDED8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/, He = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
189
+ __proto__: null,
190
+ Any: Xe,
191
+ Cc: Ye,
192
+ Cf: Ln,
193
+ P: Re,
194
+ S: Ke,
195
+ Z: He
196
+ }, Symbol.toStringTag, { value: "Module" })), $n = [
197
+ 8364,
198
+ 0,
199
+ 8218,
200
+ 402,
201
+ 8222,
202
+ 8230,
203
+ 8224,
204
+ 8225,
205
+ 710,
206
+ 8240,
207
+ 352,
208
+ 8249,
209
+ 338,
210
+ 0,
211
+ 381,
212
+ 0,
213
+ 0,
214
+ 8216,
215
+ 8217,
216
+ 8220,
217
+ 8221,
218
+ 8226,
219
+ 8211,
220
+ 8212,
221
+ 732,
222
+ 8482,
223
+ 353,
224
+ 8250,
225
+ 339,
226
+ 0,
227
+ 382,
228
+ 376
229
+ ];
230
+ function qn(e) {
231
+ return e === 0 || e >= 55296 && e <= 57343 || e > 1114111;
232
+ }
233
+ function On(e) {
234
+ return qn(e) ? 65533 : e >= 128 && e <= 159 && $n[e - 128] || e;
235
+ }
236
+ function Un(e) {
237
+ return e - 1 >>> 0 < 127 || e - 160 >>> 0 < 55136 ? String.fromCharCode(e) : String.fromCodePoint(On(e));
238
+ }
239
+ const M = /* @__PURE__ */ (() => {
240
+ const e = new Uint8Array(127);
241
+ let n = 0;
242
+ for (let t = 33; t <= 126; t++)
243
+ t !== 34 && t !== 36 && t !== 92 && (e[t] = n++);
244
+ return e;
245
+ })();
246
+ function Zn(e, n, t, o, r, i) {
247
+ const u = e.length, l = i * 90;
248
+ let c = 0;
249
+ const f = () => {
250
+ const v = M[e.charCodeAt(c++)];
251
+ return v < i ? v : v * 91 - l + M[e.charCodeAt(c++)];
252
+ }, h = t - o, _ = t + r, p = new Int32Array(_);
253
+ p.fill(-1, o, i), p.fill(-1, i + h, _);
254
+ const a = new Int32Array(_), b = new Int32Array(_);
255
+ function g(v, F) {
256
+ let w = 0, y = F;
257
+ const J = F + v;
258
+ for (; y < J; ) {
259
+ const I = M[e.charCodeAt(c++)];
260
+ if (I < 89)
261
+ w += I, p[y++] = w;
262
+ else if (I === 89) {
263
+ let S = M[e.charCodeAt(c++)] + 2;
264
+ for (; S--; )
265
+ p[y++] = ++w;
266
+ } else {
267
+ const S = M[e.charCodeAt(c++)];
268
+ w += 89 + // eslint-disable-next-line unicorn/prefer-minimal-ternary -- branches read a different number of side-effecting input bytes
269
+ (S < 90 ? S * 91 + M[e.charCodeAt(c++)] : M[e.charCodeAt(c++)] * 8281 + M[e.charCodeAt(c++)] * 91 + M[e.charCodeAt(c++)]), p[y++] = w;
270
+ }
271
+ }
272
+ }
273
+ g(o, 0), g(h, i);
274
+ const C = new Int32Array(r * 2);
275
+ let x = 0, m = 0;
276
+ function d(v, F) {
277
+ for (let w = 0; w < v; w++) {
278
+ const y = F + w, J = f(), I = f();
279
+ C[m * 2] = J, C[m * 2 + 1] = I, m += 1, a[y] = x;
280
+ const S = (p[J] < 0 ? b[J] : 1) + (p[I] < 0 ? b[I] : 1);
281
+ b[y] = S, x += S;
282
+ }
283
+ }
284
+ d(r - i + o, i + h), d(i - o, o);
285
+ const k = new Uint16Array(x);
286
+ let D = 0;
287
+ for (let v = 0; v < m; v++)
288
+ for (let F = 0; F < 2; F++) {
289
+ const w = C[v * 2 + F], y = p[w];
290
+ if (y < 0) {
291
+ let J = a[w];
292
+ const I = J + b[w];
293
+ for (; J < I; )
294
+ k[D++] = k[J++];
295
+ } else
296
+ k[D++] = y;
297
+ }
298
+ const A = new Uint16Array(n);
299
+ let B = 0;
300
+ for (; c < u; ) {
301
+ let v = M[e.charCodeAt(c++)];
302
+ v >= i && (v = v * 91 - l + M[e.charCodeAt(c++)]);
303
+ const F = p[v];
304
+ if (F < 0) {
305
+ let w = a[v];
306
+ const y = w + b[v];
307
+ for (; w < y; )
308
+ A[B++] = k[w++];
309
+ } else
310
+ A[B++] = F;
311
+ }
312
+ return A;
313
+ }
314
+ const Wn = /* @__PURE__ */ Zn("!}.&u%}'&}*'~!6*)%&,~!J~!J~%L~y<~!R,~~%Lu~~#GD~~#|)1#%}^%}2%+#.##%##%}&%##%'#%##&%#%#'%#&#%#&#'#%%#&#%##%#)%''%&%#%#'%#%%#%%}%%%#%#&(23#%%#&-%0%('1#(##%#'##+%'*.:1}#%#6-+(%'%%#%%%}#L'2351&('%}&/N'(0(/*-%(%%}#'+&T%7.2}#&%&#%#36/5##%&%%#&#%%#))2%%##%&&'0~!#*+&'%1~!%).'3q?&%'1~!.##%6(~!+%%%(Gw'rT~!E#<nA%#jZ~!H%(~!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_MASK = 8191] = "VALUE_MASK";
318
+ })(z || (z = {}));
319
+ var j;
320
+ (function(e) {
321
+ e[e.AMP = 38] = "AMP", e[e.NUM = 35] = "NUM", e[e.SEMI = 59] = "SEMI", e[e.EQUALS = 61] = "EQUALS", e[e.ZERO = 48] = "ZERO", e[e.NINE = 57] = "NINE", e[e.LOWER_A = 97] = "LOWER_A", e[e.LOWER_X = 120] = "LOWER_X";
322
+ })(j || (j = {}));
323
+ const se = 32, Ge = 21, Xn = 2097151, me = 2047;
324
+ let Ve = 0;
325
+ function Yn(e) {
326
+ const n = e >>> Ge;
327
+ return n === me ? Ve : n;
328
+ }
329
+ function Kn(e) {
330
+ return e - j.ZERO >>> 0 <= 9;
331
+ }
332
+ function Hn(e) {
333
+ return (e | se) - j.LOWER_A >>> 0 <= 5;
334
+ }
335
+ function Gn(e) {
336
+ return (e | se) - j.LOWER_A >>> 0 <= 25;
337
+ }
338
+ var Be;
339
+ (function(e) {
340
+ e[e.EntityStart = 0] = "EntityStart", e[e.NumericStart = 1] = "NumericStart", e[e.NumericDecimal = 2] = "NumericDecimal", e[e.NumericHex = 3] = "NumericHex", e[e.NamedEntity = 4] = "NamedEntity";
341
+ })(Be || (Be = {}));
342
+ var Te;
343
+ (function(e) {
344
+ e[e.Legacy = 0] = "Legacy", e[e.Strict = 1] = "Strict", e[e.Attribute = 2] = "Attribute";
345
+ })(Te || (Te = {}));
346
+ function Vn(e, n, t, o) {
347
+ const r = (n & z.BRANCH_LENGTH) >> 7, i = n & z.JUMP_TABLE;
348
+ if (i) {
349
+ if (r === 0)
350
+ return o === i ? t : -1;
351
+ const l = o - i;
352
+ if (l >>> 0 >= r)
353
+ return -1;
354
+ const c = e[t + l];
355
+ return c === 0 ? -1 : t + r + c - 1 & 65535;
356
+ }
357
+ if (r === 0)
358
+ return -1;
359
+ const s = r + 1 >> 1, u = t + s + r;
360
+ for (let l = 0; l < r; l++) {
361
+ const f = e[t + (l >> 1)] >> ((l & 1) << 3) & 255;
362
+ if (f === o) {
363
+ const h = t + s + l;
364
+ return u + e[h] & 65535;
365
+ }
366
+ if (f > o)
367
+ return -1;
368
+ }
369
+ return -1;
370
+ }
371
+ function ze(e, n, t) {
372
+ return t === 1 ? String.fromCharCode(e[n] & z.VALUE_MASK) : t === 2 ? String.fromCharCode(e[n + 1]) : String.fromCharCode(e[n + 1], e[n + 2]);
373
+ }
374
+ function Qn(e, n, t) {
375
+ let o = n + 1, r = 0, i = o;
376
+ if (o < t && (e.charCodeAt(o) | se) === j.LOWER_X)
377
+ for (o += 1, i = o; o < t; ) {
378
+ const u = e.charCodeAt(o);
379
+ if (Kn(u))
380
+ r = r * 16 + (u - j.ZERO);
381
+ else if (Hn(u))
382
+ r = r * 16 + ((u | se) - j.LOWER_A + 10);
383
+ else
384
+ break;
385
+ o += 1;
386
+ }
387
+ else
388
+ for (; o < t; ) {
389
+ const u = e.charCodeAt(o) - j.ZERO;
390
+ if (u >>> 0 > 9)
391
+ break;
392
+ r = r * 10 + u, o += 1;
393
+ }
394
+ if (o === i)
395
+ return 0;
396
+ o < t && e.charCodeAt(o) === j.SEMI && (o += 1), r > 1114111 && (r = 1114112);
397
+ let s = o - n;
398
+ return s >= me && (Ve = s, s = me), s << Ge | r;
399
+ }
400
+ function et(e, n, t) {
401
+ const o = Wn;
402
+ let r = e.indexOf("&");
403
+ if (r < 0)
404
+ return e;
405
+ const i = e.length;
406
+ let s = 0, u = "";
407
+ const l = o[0], c = l & z.JUMP_TABLE, f = (l & z.BRANCH_LENGTH) >> 7;
408
+ do {
409
+ const h = r + 1, _ = e.charCodeAt(h);
410
+ let p, a;
411
+ if (_ === j.NUM) {
412
+ const b = Qn(e, h, i);
413
+ p = Yn(b), p > 0 && e.charCodeAt(h + p - 1) !== j.SEMI && (p = 0), a = p === 0 ? "" : Un(b & Xn);
414
+ } else if (Gn(_)) {
415
+ p = 0, a = "";
416
+ const b = _ - c;
417
+ let g;
418
+ if (b >>> 0 < f) {
419
+ const k = o[1 + b];
420
+ g = k === 0 ? -1 : f + k & 65535;
421
+ } else
422
+ g = -1;
423
+ let C = 0, x = 0, m = g < 0 ? 0 : o[g], d = h + 1;
424
+ e: for (; d < i; ) {
425
+ for (
426
+ ;
427
+ // Value-less, non-run node with a nonzero jump offset.
428
+ !(m & (z.VALUE_LENGTH | z.FLAG13)) && m & z.JUMP_TABLE;
429
+ ) {
430
+ const B = m & z.JUMP_TABLE, v = (m & z.BRANCH_LENGTH) >> 7;
431
+ if (v === 0) {
432
+ if (e.charCodeAt(d) !== B)
433
+ break e;
434
+ g += 1;
435
+ } else {
436
+ const F = e.charCodeAt(d) - B;
437
+ if (F >>> 0 >= v)
438
+ break e;
439
+ const w = o[g + 1 + F];
440
+ if (w === 0)
441
+ break e;
442
+ g = g + v + w & 65535;
443
+ }
444
+ if (m = o[g], d += 1, d >= i)
445
+ break e;
446
+ }
447
+ if ((m & (z.VALUE_LENGTH | z.FLAG13)) === z.FLAG13) {
448
+ const B = (m & z.BRANCH_LENGTH) >> 7;
449
+ if (e.charCodeAt(d) !== (m & z.JUMP_TABLE))
450
+ break;
451
+ d += 1;
452
+ const v = B - 1;
453
+ let F = g + 1, w = 0;
454
+ for (; w + 1 < v; w += 2) {
455
+ const y = o[F];
456
+ if (e.charCodeAt(d) !== (y & 255) || (d += 1, e.charCodeAt(d) !== (y >> 8 & 255)))
457
+ break e;
458
+ d += 1, F += 1;
459
+ }
460
+ if (w < v) {
461
+ if (e.charCodeAt(d) !== (o[F] & 255))
462
+ break;
463
+ d += 1;
464
+ }
465
+ g += 1 + (B >> 1), m = o[g];
466
+ continue;
467
+ }
468
+ const k = m >>> 14, D = e.charCodeAt(d);
469
+ if (k !== 0) {
470
+ if (D === j.SEMI) {
471
+ p = d - h + 1, a = k === 1 ? String.fromCharCode(m & z.VALUE_MASK) : ze(o, g, k);
472
+ break;
473
+ }
474
+ if (k === 1)
475
+ break;
476
+ }
477
+ const A = Vn(o, m, g + (k || 1), D);
478
+ if (A < 0)
479
+ break;
480
+ g = A, m = o[g], d += 1;
481
+ }
482
+ a === "" && p > 0 && (a = ze(o, C, x));
483
+ } else
484
+ p = 0, a = "";
485
+ p === 0 || t ? r = h : (s < r && (u += e.slice(s, r)), u += a, r = s = h + p), e.charCodeAt(r) !== j.AMP && (r = e.indexOf("&", r));
486
+ } while (r >= 0);
487
+ return u + e.slice(s);
488
+ }
489
+ function Qe(e) {
490
+ return et(e, !0, !1);
491
+ }
492
+ var nt = class {
493
+ constructor(e = {}) {
494
+ T(this, "src_Any", Xe.source);
495
+ T(this, "src_Cc", Ye.source);
496
+ T(this, "src_Z", He.source);
497
+ T(this, "src_P", Re.source);
498
+ T(this, "src_ZPCc", [
499
+ this.src_Z,
500
+ this.src_P,
501
+ this.src_Cc
502
+ ].join("|"));
503
+ T(this, "src_ZCc", [this.src_Z, this.src_Cc].join("|"));
504
+ T(this, "cache", {});
505
+ T(this, "opts", {
506
+ maxLength: 1e4,
507
+ urlAuth: !1,
508
+ schema_names: []
509
+ });
510
+ this.opts = {
511
+ ...this.opts,
512
+ ...e
513
+ };
514
+ }
515
+ set(e = {}) {
516
+ return this.opts = {
517
+ ...this.opts,
518
+ ...e
519
+ }, this.cache = {}, this;
520
+ }
521
+ escapeRE(e) {
522
+ return e.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
523
+ }
524
+ nestedPairRE(e, n, t = 4) {
525
+ const o = this.escapeRE(e), r = this.escapeRE(n), i = `(?:(?!${this.src_ZCc}|${o}|${r}).)`;
526
+ let s = `${o}${i}{0,1000}${r}`;
527
+ for (let u = 2; u <= t; u++) s = `${o}(?:${i}|${s}){0,1000}${r}`;
528
+ return s;
529
+ }
530
+ get_text_separators() {
531
+ var e;
532
+ return (e = this.cache).text_separators ?? (e.text_separators = /[><\uff5c]/);
533
+ }
534
+ get_pseudo_letter() {
535
+ var e;
536
+ return (e = this.cache).src_pseudo_letter ?? (e.src_pseudo_letter = new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`));
537
+ }
538
+ get_ipv4_addr() {
539
+ var e;
540
+ return (e = this.cache).src_ip4 ?? (e.src_ip4 = /* @__PURE__ */ new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])"));
541
+ }
542
+ get_ipv6_addr() {
543
+ var t;
544
+ const e = "[0-9A-Fa-f]{1,4}", n = `(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;
545
+ return (t = this.cache).src_ip6_addr ?? (t.src_ip6_addr = new RegExp(`(?:(?:${e}:){6}${n}|::(?:${e}:){5}${n}|(?:${e})?::(?:${e}:){4}${n}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${n}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${n}|(?:(?:${e}:){0,3}${e})?::${e}:${n}|(?:(?:${e}:){0,4}${e})?::${n}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`));
546
+ }
547
+ get_ipv6_url_host() {
548
+ var e;
549
+ return (e = this.cache).src_ip6_host ?? (e.src_ip6_host = new RegExp(`\\[${this.get_ipv6_addr().source}\\]`));
550
+ }
551
+ get_ipv6_mail_host() {
552
+ var e;
553
+ return (e = this.cache).src_ipv6_mail_host ?? (e.src_ipv6_mail_host = new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`));
554
+ }
555
+ get_auth() {
556
+ var e;
557
+ return (e = this.cache).src_auth ?? (e.src_auth = new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`));
558
+ }
559
+ get_port() {
560
+ var e;
561
+ return (e = this.cache).src_port ?? (e.src_port = /* @__PURE__ */ new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?"));
562
+ }
563
+ get_host_terminator() {
564
+ var e;
565
+ return (e = this.cache).src_host_terminator ?? (e.src_host_terminator = new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"] ? "-(?!--)|" : "-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`));
566
+ }
567
+ get_path_terminator() {
568
+ var e;
569
+ return (e = this.cache).src_path_terminator ?? (e.src_path_terminator = new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`));
570
+ }
571
+ get_path() {
572
+ var e;
573
+ return (e = this.cache).src_path ?? (e.src_path = new RegExp(`(?:[/?#](?:${this.nestedPairRE("[", "]")}|${this.nestedPairRE("(", ")")}|${this.nestedPairRE("{", "}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|` + (this.opts["---"] ? "\\-(?!--(?:[^-]|$))(?:-{0,19})|" : "\\-{1,20}|") + `,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|` + this.get_path_extra().source + `[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`));
574
+ }
575
+ get_mail_name() {
576
+ var e;
577
+ return (e = this.cache).src_mail_name ?? (e.src_mail_name = /* @__PURE__ */ new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}"));
578
+ }
579
+ get_xn() {
580
+ var e;
581
+ return (e = this.cache).src_xn ?? (e.src_xn = /* @__PURE__ */ new RegExp("xn--[a-z0-9\\-]{1,59}"));
582
+ }
583
+ get_tld() {
584
+ if (this.cache.tld) return this.cache.tld;
585
+ const e = [...new Set(this.opts.tlds || [])].sort().reverse().join("|");
586
+ return this.cache.tld = new RegExp(`${e || "$#none#$"}|${this.get_xn().source}`), this.cache.tld;
587
+ }
588
+ get_domain_root() {
589
+ var e;
590
+ return (e = this.cache).src_domain_root ?? (e.src_domain_root = new RegExp("(?:" + this.get_xn().source + `|${this.get_pseudo_letter().source}{1,63})`));
591
+ }
592
+ get_domain() {
593
+ var e;
594
+ return (e = this.cache).src_domain ?? (e.src_domain = new RegExp("(?:" + this.get_xn().source + `|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`));
595
+ }
596
+ get_url_host_port() {
597
+ var e;
598
+ return (e = this.cache).url_host_port ?? (e.url_host_port = new RegExp("(?:" + this.get_ipv6_url_host().source + `|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))` + this.get_port().source + this.get_host_terminator().source));
599
+ }
600
+ get_fuzzy_url_host_port() {
601
+ var e;
602
+ return (e = this.cache).fuzzy_url_host_port ?? (e.fuzzy_url_host_port = new RegExp("(?:" + (this.opts.fuzzyIP ? this.get_ipv4_addr().source + "|" : "") + `(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))` + this.get_host_terminator().source));
603
+ }
604
+ get_mail_host() {
605
+ var e;
606
+ return (e = this.cache).src_mail_host ?? (e.src_mail_host = new RegExp("(?:" + this.get_ipv6_mail_host().source + `|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))` + this.get_host_terminator().source));
607
+ }
608
+ get_fuzzy_mail_host() {
609
+ var e;
610
+ return (e = this.cache).src_fuzzy_mail_host ?? (e.src_fuzzy_mail_host = new RegExp("(?:" + this.get_ipv6_mail_host().source + `|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))` + this.get_host_terminator().source));
611
+ }
612
+ get_path_extra() {
613
+ var e;
614
+ return (e = this.cache).src_path_extra ?? (e.src_path_extra = /* @__PURE__ */ new RegExp(""));
615
+ }
616
+ get_fuzzy_mail_host_search() {
617
+ var e;
618
+ return (e = this.cache).mail_fuzzy_host_search ?? (e.mail_fuzzy_host_search = new RegExp(`@${this.get_fuzzy_mail_host().source}`, "ig"));
619
+ }
620
+ get_fuzzy_link_search() {
621
+ var e;
622
+ return (e = this.cache).link_fuzzy_search ?? (e.link_fuzzy_search = new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`, "ig"));
623
+ }
624
+ get_http_validator() {
625
+ var e;
626
+ return (e = this.cache).http_validator ?? (e.http_validator = new RegExp("\\/\\/" + (this.opts.urlAuth ? this.get_auth().source : "") + this.get_url_host_port().source + this.get_path().source, "iy"));
627
+ }
628
+ get_relative_proto_validator() {
629
+ var e;
630
+ return (e = this.cache).relative_proto_validator ?? (e.relative_proto_validator = new RegExp((this.opts.urlAuth ? this.get_auth().source : "") + `(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})` + this.get_port().source + this.get_host_terminator().source + this.get_path().source, "iy"));
631
+ }
632
+ get_mail_name_validator() {
633
+ var e;
634
+ return (e = this.cache).mail_name_validator ?? (e.mail_name_validator = new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`));
635
+ }
636
+ get_mailto_validator() {
637
+ var e;
638
+ return (e = this.cache).mailto_validator ?? (e.mailto_validator = new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`, "iy"));
639
+ }
640
+ get_schema_names() {
641
+ var e;
642
+ return (e = this.cache).schema_names ?? (e.schema_names = new RegExp((this.opts.schema_names || []).map((n) => this.escapeRE(n)).join("|")));
643
+ }
644
+ get_schema_search() {
645
+ var e;
646
+ return (e = this.cache).schema_search ?? (e.schema_search = new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`, "ig"));
647
+ }
648
+ get_schema_at_start() {
649
+ var e;
650
+ return (e = this.cache).schema_at_start ?? (e.schema_at_start = new RegExp(`^${this.get_schema_search().source}`, "i"));
651
+ }
652
+ }, ce = {
653
+ validate: (e, n, t) => {
654
+ const o = t.re.get_http_validator();
655
+ o.lastIndex = n;
656
+ const r = o.exec(e);
657
+ return r ? r[0].length : 0;
658
+ },
659
+ normalize: (e, n) => n.normalize(e)
660
+ }, tt = {
661
+ "http:": ce,
662
+ "https:": ce,
663
+ "ftp:": ce,
664
+ "//": {
665
+ validate: function(e, n, t) {
666
+ const o = t.re.get_relative_proto_validator();
667
+ o.lastIndex = n;
668
+ const r = o.exec(e);
669
+ return r ? n >= 3 && e[n - 3] === ":" || n >= 3 && e[n - 3] === "/" ? 0 : r[0].length : 0;
670
+ },
671
+ normalize: (e, n) => n.normalize(e)
672
+ },
673
+ "mailto:": {
674
+ validate: function(e, n, t) {
675
+ const o = t.re.get_mailto_validator();
676
+ o.lastIndex = n;
677
+ const r = o.exec(e);
678
+ return r ? r[0].length : 0;
679
+ },
680
+ normalize: (e, n) => n.normalize(e)
681
+ }
682
+ }, rt = "a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw", it = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";
683
+ function ot() {
684
+ const e = it.split("|");
685
+ return rt.split("|").forEach((n) => {
686
+ const t = n.indexOf(":"), o = n.slice(0, t);
687
+ for (const r of n.slice(t + 1)) e.push(o + r);
688
+ }), e;
689
+ }
690
+ var st = {
691
+ fuzzyLink: !1,
692
+ fuzzyEmail: !0,
693
+ fuzzyIP: !1,
694
+ "---": !1,
695
+ tlds: ot(),
696
+ urlAuth: !1,
697
+ maxLength: 1e4
698
+ }, Se = class {
699
+ constructor(e, n, t, o) {
700
+ /** Prefix (protocol) for matched string. Empty for fuzzy links. */
701
+ T(this, "schema");
702
+ /** First position of matched string. */
703
+ T(this, "index");
704
+ /** Next position after matched string. */
705
+ T(this, "lastIndex");
706
+ /** Matched string. */
707
+ T(this, "raw");
708
+ /** Normalized text of matched string. */
709
+ T(this, "text");
710
+ /** Normalized URL of matched string. */
711
+ T(this, "url");
712
+ const r = e.slice(t, o);
713
+ this.schema = n.toLowerCase(), this.index = t, this.lastIndex = o, this.raw = r, this.text = r, this.url = r;
714
+ }
715
+ }, ut = class {
716
+ /**
717
+ * Creates new linkifier instance.
718
+ *
719
+ * By default understands:
720
+ *
721
+ * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links
722
+ * - "fuzzy" emails (foo@bar.com).
723
+ *
724
+ * See {@link LinkifyConstructorOptions} for available options.
725
+ *
726
+ * @param options Recognition options.
727
+ *
728
+ * @example
729
+ * ```javascript
730
+ * import { LinkifyIt } from 'linkify-it'
731
+ *
732
+ * const linkify = new LinkifyIt({ fuzzyLink: true })
733
+ *
734
+ * linkify
735
+ * .tlds(require('tlds')) // Reload with full TLD list
736
+ * .tlds('onion', true) // Add unofficial `.onion` domain
737
+ * .add('ftp:', null) // Disable `ftp:` protocol
738
+ * .set({ fuzzyIP: true }) // Enable IPs in fuzzy links
739
+ *
740
+ * console.log(linkify.test('Site github.com!')) // true
741
+ * console.log(linkify.match('Site github.com!'))
742
+ * ```
743
+ */
744
+ constructor(e = {}) {
745
+ T(this, "__opts__");
746
+ T(this, "__schemas__");
747
+ T(this, "re");
748
+ const { rebuilder: n, ...t } = e;
749
+ this.__opts__ = {
750
+ ...st,
751
+ ...t
752
+ }, this.__schemas__ = { ...tt }, this.re = n || new nt(), this.re.set({
753
+ ...this.__opts__,
754
+ schema_names: Object.keys(this.__schemas__)
755
+ });
756
+ }
757
+ /**
758
+ * Add new rule definition.
759
+ *
760
+ * `schema` is a link prefix (usually, protocol name with `:` at the end,
761
+ * `skype:` for example). `linkify-it` makes sure that prefix is not
762
+ * preceded with alphanumeric char and symbols. Only whitespaces and
763
+ * punctuation allowed.
764
+ *
765
+ * `definition` is a rule to check tail after link prefix. To disable an
766
+ * existing rule, pass `null`.
767
+ *
768
+ * @param schema Rule name (fixed pattern prefix).
769
+ * @param definition Schema definition, or `null` to disable the rule.
770
+ *
771
+ * See [twitter mentions example](https://github.com/markdown-it/linkify-it/blob/master/examples/twitter.mjs).
772
+ */
773
+ add(e, n = null) {
774
+ if (!n) delete this.__schemas__[e];
775
+ else {
776
+ const t = {
777
+ normalize: (o, r) => r.normalize(o),
778
+ ...n
779
+ };
780
+ this.__schemas__[e] = t;
781
+ }
782
+ return this.re.set({
783
+ ...this.__opts__,
784
+ schema_names: Object.keys(this.__schemas__)
785
+ }), this;
786
+ }
787
+ /**
788
+ * Set recognition options for links without schema.
789
+ *
790
+ * @param options Recognition options.
791
+ */
792
+ set(e = {}) {
793
+ return this.__opts__ = {
794
+ ...this.__opts__,
795
+ ...e
796
+ }, this.re.set({
797
+ ...this.__opts__,
798
+ schema_names: Object.keys(this.__schemas__)
799
+ }), this;
800
+ }
801
+ /**
802
+ * Searches linkifiable pattern and returns `true` on success or `false` on fail.
803
+ *
804
+ * @param text Text to scan.
805
+ */
806
+ test(e) {
807
+ if (!e.length) return !1;
808
+ let n, t;
809
+ for (t = this.re.get_schema_search(), t.lastIndex = 0; (n = t.exec(e)) !== null; ) if (this.testSchemaAt(e, n[2], t.lastIndex)) return !0;
810
+ if (this.__opts__.fuzzyLink && this.__schemas__["http:"] && (t = this.re.get_fuzzy_link_search(), t.lastIndex = 0, t.exec(e) !== null))
811
+ return !0;
812
+ if (this.__opts__.fuzzyEmail && this.__schemas__["mailto:"] && e.indexOf("@") >= 0) {
813
+ const o = this.re.get_fuzzy_mail_host_search(), r = this.re.get_mail_name_validator();
814
+ for (o.lastIndex = 0; (n = o.exec(e)) !== null; ) {
815
+ const i = e.slice(Math.max(0, n.index - 65), n.index);
816
+ if (r.test(i)) return !0;
817
+ }
818
+ }
819
+ return !1;
820
+ }
821
+ /**
822
+ * Similar to {@link LinkifyIt.test} but checks only specific protocol tail exactly
823
+ * at given position. Returns length of found pattern (0 on fail).
824
+ *
825
+ * @param text Text to scan.
826
+ * @param schema Rule (schema) name.
827
+ * @param pos Text offset to check from.
828
+ */
829
+ testSchemaAt(e, n, t) {
830
+ return this.__schemas__[n.toLowerCase()] ? this.__schemas__[n.toLowerCase()].validate(e.slice(0, t + this.__opts__.maxLength), t, this) : 0;
831
+ }
832
+ /**
833
+ * Returns array of found link descriptions or `null` on fail. We strongly
834
+ * recommend to use {@link LinkifyIt.test} first, for best speed.
835
+ *
836
+ * @param text Text to scan.
837
+ */
838
+ match(e) {
839
+ const n = [], t = this.re.get_schema_search();
840
+ let o, r, i, s, u, l, c = !1, f = !1, h = !1, _ = 0;
841
+ if (!e.length) return null;
842
+ for (t.lastIndex = 0, this.__opts__.fuzzyLink && this.__schemas__["http:"] && (o = this.re.get_fuzzy_link_search(), o.lastIndex = 0), this.__opts__.fuzzyEmail && this.__schemas__["mailto:"] && (r = this.re.get_fuzzy_mail_host_search(), r.lastIndex = 0, i = this.re.get_mail_name_validator()); ; ) {
843
+ const p = Math.max(_ - 1, 0);
844
+ if (r && i && !h && (!u || u.index < _))
845
+ for (r.lastIndex < p && (r.lastIndex = p); ; ) {
846
+ const x = r.exec(e);
847
+ if (!x) {
848
+ h = !0, u = void 0;
849
+ break;
850
+ }
851
+ const m = i.exec(e.slice(Math.max(0, x.index - 65), x.index));
852
+ if (m) {
853
+ if (u = {
854
+ schema: "mailto:",
855
+ index: x.index - m[1].length,
856
+ lastIndex: x.index + x[0].length
857
+ }, u.index >= _) break;
858
+ r.lastIndex < p && (r.lastIndex = p);
859
+ }
860
+ }
861
+ if (o && !f && (!s || s.index < _))
862
+ for (o.lastIndex < p && (o.lastIndex = p); ; ) {
863
+ const x = o.exec(e);
864
+ if (!x) {
865
+ f = !0, s = void 0;
866
+ break;
867
+ }
868
+ if (s = {
869
+ schema: "",
870
+ index: x.index + x[1].length,
871
+ lastIndex: x.index + x[0].length
872
+ }, s.index >= _) break;
873
+ o.lastIndex < p && (o.lastIndex = p);
874
+ }
875
+ let a = u;
876
+ (!a || s && (s.index < a.index || s.index === a.index && s.lastIndex > a.lastIndex)) && (a = s);
877
+ let b;
878
+ if (!c) for (; ; ) {
879
+ if (!l) {
880
+ t.lastIndex < p && (t.lastIndex = p);
881
+ const d = t.exec(e);
882
+ if (!d) {
883
+ c = !0;
884
+ break;
885
+ }
886
+ l = {
887
+ schema: d[2],
888
+ index: d.index + d[1].length,
889
+ lastIndex: d.index + d[0].length
890
+ };
891
+ }
892
+ if (l.index < _) {
893
+ l = void 0;
894
+ continue;
895
+ }
896
+ if (a && l.index > a.index) break;
897
+ const x = l;
898
+ l = void 0;
899
+ const m = this.testSchemaAt(e, x.schema, x.lastIndex);
900
+ if (m) {
901
+ b = {
902
+ schema: x.schema,
903
+ index: x.index,
904
+ lastIndex: x.lastIndex + m
905
+ };
906
+ break;
907
+ }
908
+ }
909
+ let g = b;
910
+ if ((!g || u && (u.index < g.index || u.index === g.index && u.lastIndex > g.lastIndex)) && (g = u), (!g || s && (s.index < g.index || s.index === g.index && s.lastIndex > g.lastIndex)) && (g = s), !g) break;
911
+ g === u ? u = void 0 : g === s && (s = void 0);
912
+ const C = new Se(e, g.schema, g.index, g.lastIndex);
913
+ C.schema ? this.__schemas__[C.schema].normalize(C, this) : this.normalize(C), n.push(C), _ = g.lastIndex;
914
+ }
915
+ return n.length ? n : null;
916
+ }
917
+ /**
918
+ * Returns fully-formed (not fuzzy) link if it starts at the beginning
919
+ * of the string, and null otherwise.
920
+ *
921
+ * @param text Text to scan.
922
+ */
923
+ matchAtStart(e) {
924
+ if (!e.length) return null;
925
+ const n = this.re.get_schema_at_start().exec(e);
926
+ if (!n) return null;
927
+ const t = this.testSchemaAt(e, n[2], n[0].length);
928
+ if (!t) return null;
929
+ const o = new Se(e, n[2], n.index + n[1].length, n.index + n[0].length + t);
930
+ return this.__schemas__[o.schema].normalize(o, this), o;
931
+ }
932
+ /**
933
+ * Load (or merge) new TLDs list. Those are used for fuzzy links (without
934
+ * prefix) to avoid false positives. By default this algorithm is used:
935
+ *
936
+ * - hostname with any 2-letter root zones are ok.
937
+ * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф
938
+ * are ok.
939
+ * - encoded (`xn--...`) root zones are ok.
940
+ *
941
+ * If list is replaced, then exact match for 2-chars root zones will be checked.
942
+ *
943
+ * @param list List of TLDs.
944
+ * @param keepOld Merge with current list if `true` (`false` by default).
945
+ */
946
+ tlds(e, n = !1) {
947
+ return e = Array.isArray(e) ? e : [e], n ? this.__opts__.tlds = this.__opts__.tlds.concat(e) : this.__opts__.tlds = e, this.re.set({
948
+ ...this.__opts__,
949
+ schema_names: Object.keys(this.__schemas__)
950
+ }), this;
951
+ }
952
+ /**
953
+ * Default normalizer (if schema does not define its own).
954
+ *
955
+ * @param match Match to normalize.
956
+ */
957
+ normalize(e) {
958
+ e.schema || (e.url = `http://${e.url}`), e.schema === "mailto:" && !/^mailto:/i.test(e.url) && (e.url = `mailto:${e.url}`);
959
+ }
960
+ };
961
+ const X = 2147483647, P = 36, be = 1, H = 26, lt = 38, ct = 700, en = 72, nn = 128, tn = "-", at = /^xn--/, ht = /[^\0-\x7F]/, ft = /[\x2E\u3002\uFF0E\uFF61]/g, pt = {
962
+ overflow: "Overflow: input needs wider integers to process",
963
+ "not-basic": "Illegal input >= 0x80 (not a basic code point)",
964
+ "invalid-input": "Invalid input"
965
+ }, ae = P - be, L = Math.floor, he = String.fromCharCode;
966
+ function O(e) {
967
+ throw new RangeError(pt[e]);
968
+ }
969
+ function dt(e, n) {
970
+ const t = [];
971
+ let o = e.length;
972
+ for (; o--; )
973
+ t[o] = n(e[o]);
974
+ return t;
975
+ }
976
+ function rn(e, n) {
977
+ const t = e.split("@");
978
+ let o = "";
979
+ t.length > 1 && (o = t[0] + "@", e = t[1]), e = e.replace(ft, ".");
980
+ const r = e.split("."), i = dt(r, n).join(".");
981
+ return o + i;
982
+ }
983
+ function on(e) {
984
+ const n = [];
985
+ let t = 0;
986
+ const o = e.length;
987
+ for (; t < o; ) {
988
+ const r = e.charCodeAt(t++);
989
+ if (r >= 55296 && r <= 56319 && t < o) {
990
+ const i = e.charCodeAt(t++);
991
+ (i & 64512) == 56320 ? n.push(((r & 1023) << 10) + (i & 1023) + 65536) : (n.push(r), t--);
992
+ } else
993
+ n.push(r);
994
+ }
995
+ return n;
996
+ }
997
+ const _t = (e) => String.fromCodePoint(...e), gt = function(e) {
998
+ return e >= 48 && e < 58 ? 26 + (e - 48) : e >= 65 && e < 91 ? e - 65 : e >= 97 && e < 123 ? e - 97 : P;
999
+ }, je = function(e, n) {
1000
+ return e + 22 + 75 * (e < 26) - ((n != 0) << 5);
1001
+ }, sn = function(e, n, t) {
1002
+ let o = 0;
1003
+ for (e = t ? L(e / ct) : e >> 1, e += L(e / n); e > ae * H >> 1; o += P)
1004
+ e = L(e / ae);
1005
+ return L(o + (ae + 1) * e / (e + lt));
1006
+ }, un = function(e) {
1007
+ const n = [], t = e.length;
1008
+ let o = 0, r = nn, i = en, s = e.lastIndexOf(tn);
1009
+ s < 0 && (s = 0);
1010
+ for (let u = 0; u < s; ++u)
1011
+ e.charCodeAt(u) >= 128 && O("not-basic"), n.push(e.charCodeAt(u));
1012
+ for (let u = s > 0 ? s + 1 : 0; u < t; ) {
1013
+ const l = o;
1014
+ for (let f = 1, h = P; ; h += P) {
1015
+ u >= t && O("invalid-input");
1016
+ const _ = gt(e.charCodeAt(u++));
1017
+ _ >= P && O("invalid-input"), _ > L((X - o) / f) && O("overflow"), o += _ * f;
1018
+ const p = h <= i ? be : h >= i + H ? H : h - i;
1019
+ if (_ < p)
1020
+ break;
1021
+ const a = P - p;
1022
+ f > L(X / a) && O("overflow"), f *= a;
1023
+ }
1024
+ const c = n.length + 1;
1025
+ i = sn(o - l, c, l == 0), L(o / c) > X - r && O("overflow"), r += L(o / c), o %= c, n.splice(o++, 0, r);
1026
+ }
1027
+ return String.fromCodePoint(...n);
1028
+ }, ln = function(e) {
1029
+ const n = [];
1030
+ e = on(e);
1031
+ const t = e.length;
1032
+ let o = nn, r = 0, i = en;
1033
+ for (const l of e)
1034
+ l < 128 && n.push(he(l));
1035
+ const s = n.length;
1036
+ let u = s;
1037
+ for (s && n.push(tn); u < t; ) {
1038
+ let l = X;
1039
+ for (const f of e)
1040
+ f >= o && f < l && (l = f);
1041
+ const c = u + 1;
1042
+ l - o > L((X - r) / c) && O("overflow"), r += (l - o) * c, o = l;
1043
+ for (const f of e)
1044
+ if (f < o && ++r > X && O("overflow"), f === o) {
1045
+ let h = r;
1046
+ for (let _ = P; ; _ += P) {
1047
+ const p = _ <= i ? be : _ >= i + H ? H : _ - i;
1048
+ if (h < p)
1049
+ break;
1050
+ const a = h - p, b = P - p;
1051
+ n.push(
1052
+ he(je(p + a % b, 0))
1053
+ ), h = L(a / b);
1054
+ }
1055
+ n.push(he(je(h, 0))), i = sn(r, c, u === s), r = 0, ++u;
1056
+ }
1057
+ ++r, ++o;
1058
+ }
1059
+ return n.join("");
1060
+ }, kt = function(e) {
1061
+ return rn(e, function(n) {
1062
+ return at.test(n) ? un(n.slice(4).toLowerCase()) : n;
1063
+ });
1064
+ }, mt = function(e) {
1065
+ return rn(e, function(n) {
1066
+ return ht.test(n) ? "xn--" + ln(n) : n;
1067
+ });
1068
+ }, Je = {
1069
+ /**
1070
+ * A string representing the current Punycode.js version number.
1071
+ * @memberOf punycode
1072
+ * @type String
1073
+ */
1074
+ version: "2.3.1",
1075
+ /**
1076
+ * An object of methods to convert from JavaScript's internal character
1077
+ * representation (UCS-2) to Unicode code points, and back.
1078
+ * @see <https://mathiasbynens.be/notes/javascript-encoding>
1079
+ * @memberOf punycode
1080
+ * @type Object
1081
+ */
1082
+ ucs2: {
1083
+ decode: on,
1084
+ encode: _t
1085
+ },
1086
+ decode: un,
1087
+ encode: ln,
1088
+ toASCII: mt,
1089
+ toUnicode: kt
1090
+ };
1091
+ /*! markdown-it 15.0.1 https://github.com/markdown-it/markdown-it @license MIT */
1092
+ var Ie = Object.defineProperty, cn = (e, n) => {
1093
+ let t = {};
1094
+ for (var o in e) Ie(t, o, {
1095
+ get: e[o],
1096
+ enumerable: !0
1097
+ });
1098
+ return Ie(t, Symbol.toStringTag, { value: "Module" }), t;
1099
+ }, Rt = /* @__PURE__ */ cn({
1100
+ arrayReplaceAt: () => bt,
1101
+ asciiTrim: () => le,
1102
+ callable: () => an,
1103
+ escapeHtml: () => U,
1104
+ escapeRE: () => Bt,
1105
+ fromCodePoint: () => G,
1106
+ isMdAsciiPunct: () => ee,
1107
+ isPunctChar: () => fn,
1108
+ isPunctCharCode: () => Q,
1109
+ isSpace: () => E,
1110
+ isValidEntityCode: () => xe,
1111
+ isWhiteSpace: () => V,
1112
+ lib: () => Tt,
1113
+ normalizeReference: () => ue,
1114
+ unescapeAll: () => K,
1115
+ unescapeMd: () => vt
1116
+ });
1117
+ function an(e) {
1118
+ const n = function(...t) {
1119
+ return Reflect.construct(e, t, new.target && new.target !== n ? new.target : e);
1120
+ };
1121
+ return Object.defineProperty(n, "name", { value: e.name }), Object.setPrototypeOf(n, e), n.prototype = e.prototype, n;
1122
+ }
1123
+ function bt(e, n, t) {
1124
+ return [].concat(e.slice(0, n), t, e.slice(n + 1));
1125
+ }
1126
+ function xe(e) {
1127
+ return !(e >= 55296 && e <= 57343 || e >= 64976 && e <= 65007 || (e & 65535) === 65535 || (e & 65535) === 65534 || e >= 0 && e <= 8 || e === 11 || e >= 14 && e <= 31 || e >= 127 && e <= 159 || e > 1114111);
1128
+ }
1129
+ function G(e) {
1130
+ if (e > 65535) {
1131
+ e -= 65536;
1132
+ const n = 55296 + (e >> 10), t = 56320 + (e & 1023);
1133
+ return String.fromCharCode(n, t);
1134
+ }
1135
+ return String.fromCharCode(e);
1136
+ }
1137
+ var hn = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g, xt = new RegExp(`${hn.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`, "gi"), Ct = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;
1138
+ function Dt(e, n) {
1139
+ if (n.charCodeAt(0) === 35 && Ct.test(n)) {
1140
+ const o = n[1].toLowerCase() === "x" ? parseInt(n.slice(2), 16) : parseInt(n.slice(1), 10);
1141
+ return xe(o) ? G(o) : e;
1142
+ }
1143
+ const t = Qe(e);
1144
+ return t !== e ? t : e;
1145
+ }
1146
+ function vt(e) {
1147
+ return e.indexOf("\\") < 0 ? e : e.replace(hn, "$1");
1148
+ }
1149
+ function K(e) {
1150
+ return e.indexOf("\\") < 0 && e.indexOf("&") < 0 ? e : e.replace(xt, function(n, t, o) {
1151
+ return t || Dt(n, o);
1152
+ });
1153
+ }
1154
+ var wt = /[&<>"]/, At = /[&<>"]/g, Et = {
1155
+ "&": "&amp;",
1156
+ "<": "&lt;",
1157
+ ">": "&gt;",
1158
+ '"': "&quot;"
1159
+ };
1160
+ function Ft(e) {
1161
+ return Et[e];
1162
+ }
1163
+ function U(e) {
1164
+ return wt.test(e) ? e.replace(At, Ft) : e;
1165
+ }
1166
+ var yt = /[.?*+^$[\]\\(){}|-]/g;
1167
+ function Bt(e) {
1168
+ return e.replace(yt, "\\$&");
1169
+ }
1170
+ function E(e) {
1171
+ switch (e) {
1172
+ case 9:
1173
+ case 32:
1174
+ return !0;
1175
+ }
1176
+ return !1;
1177
+ }
1178
+ function V(e) {
1179
+ if (e >= 8192 && e <= 8202) return !0;
1180
+ switch (e) {
1181
+ case 9:
1182
+ case 10:
1183
+ case 11:
1184
+ case 12:
1185
+ case 13:
1186
+ case 32:
1187
+ case 160:
1188
+ case 5760:
1189
+ case 8239:
1190
+ case 8287:
1191
+ case 12288:
1192
+ return !0;
1193
+ }
1194
+ return !1;
1195
+ }
1196
+ function fn(e) {
1197
+ return Re.test(e) || Ke.test(e);
1198
+ }
1199
+ function Q(e) {
1200
+ return fn(G(e));
1201
+ }
1202
+ function ee(e) {
1203
+ switch (e) {
1204
+ case 33:
1205
+ case 34:
1206
+ case 35:
1207
+ case 36:
1208
+ case 37:
1209
+ case 38:
1210
+ case 39:
1211
+ case 40:
1212
+ case 41:
1213
+ case 42:
1214
+ case 43:
1215
+ case 44:
1216
+ case 45:
1217
+ case 46:
1218
+ case 47:
1219
+ case 58:
1220
+ case 59:
1221
+ case 60:
1222
+ case 61:
1223
+ case 62:
1224
+ case 63:
1225
+ case 64:
1226
+ case 91:
1227
+ case 92:
1228
+ case 93:
1229
+ case 94:
1230
+ case 95:
1231
+ case 96:
1232
+ case 123:
1233
+ case 124:
1234
+ case 125:
1235
+ case 126:
1236
+ return !0;
1237
+ default:
1238
+ return !1;
1239
+ }
1240
+ }
1241
+ function ue(e) {
1242
+ return e = e.trim().replace(/\s+/g, " "), e.toLowerCase().toUpperCase();
1243
+ }
1244
+ function Me(e) {
1245
+ return e === 32 || e === 9 || e === 10 || e === 13;
1246
+ }
1247
+ function le(e) {
1248
+ let n = 0;
1249
+ for (; n < e.length && Me(e.charCodeAt(n)); n++) ;
1250
+ let t = e.length - 1;
1251
+ for (; t >= n && Me(e.charCodeAt(t)); t--) ;
1252
+ return e.slice(n, t + 1);
1253
+ }
1254
+ var Tt = {
1255
+ mdurl: Pn,
1256
+ ucmicro: Nn
1257
+ };
1258
+ function zt(e, n, t) {
1259
+ let o, r, i, s;
1260
+ const u = e.posMax, l = e.pos;
1261
+ for (e.pos = n + 1, o = 1; e.pos < u; ) {
1262
+ if (i = e.src.charCodeAt(e.pos), i === 93 && (o--, o === 0)) {
1263
+ r = !0;
1264
+ break;
1265
+ }
1266
+ if (s = e.pos, e.md.inline.skipToken(e), i === 91) {
1267
+ if (s === e.pos - 1) o++;
1268
+ else if (t)
1269
+ return e.pos = l, -1;
1270
+ }
1271
+ }
1272
+ let c = -1;
1273
+ return r && (c = e.pos), e.pos = l, c;
1274
+ }
1275
+ function St(e, n, t) {
1276
+ let o, r = n;
1277
+ const i = {
1278
+ ok: !1,
1279
+ pos: 0,
1280
+ str: ""
1281
+ };
1282
+ if (e.charCodeAt(r) === 60) {
1283
+ for (r++; r < t; ) {
1284
+ if (o = e.charCodeAt(r), o === 10 || o === 60) return i;
1285
+ if (o === 62)
1286
+ return i.pos = r + 1, i.str = K(e.slice(n + 1, r)), i.ok = !0, i;
1287
+ if (o === 92 && r + 1 < t) {
1288
+ r += 2;
1289
+ continue;
1290
+ }
1291
+ r++;
1292
+ }
1293
+ return i;
1294
+ }
1295
+ let s = 0;
1296
+ for (; r < t && (o = e.charCodeAt(r), !(o === 32 || o < 32 || o === 127)); ) {
1297
+ if (o === 92 && r + 1 < t) {
1298
+ if (e.charCodeAt(r + 1) === 32) {
1299
+ r++;
1300
+ continue;
1301
+ }
1302
+ r += 2;
1303
+ continue;
1304
+ }
1305
+ if (o === 40 && (s++, s > 32))
1306
+ return i;
1307
+ if (o === 41) {
1308
+ if (s === 0) break;
1309
+ s--;
1310
+ }
1311
+ r++;
1312
+ }
1313
+ return n === r || s !== 0 || (i.str = K(e.slice(n, r)), i.pos = r, i.ok = !0), i;
1314
+ }
1315
+ function jt(e, n, t, o) {
1316
+ let r, i = n;
1317
+ const s = {
1318
+ ok: !1,
1319
+ can_continue: !1,
1320
+ pos: 0,
1321
+ str: "",
1322
+ marker: 0
1323
+ };
1324
+ if (o)
1325
+ s.str = o.str, s.marker = o.marker;
1326
+ else {
1327
+ if (i >= t) return s;
1328
+ let u = e.charCodeAt(i);
1329
+ if (u !== 34 && u !== 39 && u !== 40) return s;
1330
+ n++, i++, u === 40 && (u = 41), s.marker = u;
1331
+ }
1332
+ for (; i < t; ) {
1333
+ if (r = e.charCodeAt(i), r === s.marker)
1334
+ return s.pos = i + 1, s.str += K(e.slice(n, i)), s.ok = !0, s;
1335
+ if (r === 40 && s.marker === 41) return s;
1336
+ r === 92 && i + 1 < t && i++, i++;
1337
+ }
1338
+ return s.can_continue = !0, s.str += K(e.slice(n, i)), s;
1339
+ }
1340
+ var Jt = /* @__PURE__ */ cn({
1341
+ parseLinkDestination: () => St,
1342
+ parseLinkLabel: () => zt,
1343
+ parseLinkTitle: () => jt
1344
+ });
1345
+ function ne(e) {
1346
+ "@babel/helpers - typeof";
1347
+ return ne = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1348
+ return typeof n;
1349
+ } : function(n) {
1350
+ return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1351
+ }, ne(e);
1352
+ }
1353
+ function It(e, n) {
1354
+ if (ne(e) != "object" || !e) return e;
1355
+ var t = e[Symbol.toPrimitive];
1356
+ if (t !== void 0) {
1357
+ var o = t.call(e, n);
1358
+ if (ne(o) != "object") return o;
1359
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1360
+ }
1361
+ return (n === "string" ? String : Number)(e);
1362
+ }
1363
+ function Mt(e) {
1364
+ var n = It(e, "string");
1365
+ return ne(n) == "symbol" ? n : n + "";
1366
+ }
1367
+ function R(e, n, t) {
1368
+ return (n = Mt(n)) in e ? Object.defineProperty(e, n, {
1369
+ value: t,
1370
+ enumerable: !0,
1371
+ configurable: !0,
1372
+ writable: !0
1373
+ }) : e[n] = t, e;
1374
+ }
1375
+ var W = class {
1376
+ constructor(e, n, t) {
1377
+ R(
1378
+ this,
1379
+ /**
1380
+ * Source map info. Format: `[ line_begin, line_end ]`
1381
+ */
1382
+ "map",
1383
+ null
1384
+ ), R(
1385
+ this,
1386
+ /**
1387
+ * nesting level, the same as `state.level`
1388
+ */
1389
+ "level",
1390
+ 0
1391
+ ), R(
1392
+ this,
1393
+ /**
1394
+ * An array of child nodes (inline and img tokens)
1395
+ */
1396
+ "children",
1397
+ null
1398
+ ), R(
1399
+ this,
1400
+ /**
1401
+ * In a case of self-closing tag (code, html, fence, etc.),
1402
+ * it has contents of this tag.
1403
+ */
1404
+ "content",
1405
+ ""
1406
+ ), R(
1407
+ this,
1408
+ /**
1409
+ * '*' or '_' for emphasis, fence string for fence, etc.
1410
+ */
1411
+ "markup",
1412
+ ""
1413
+ ), R(
1414
+ this,
1415
+ /**
1416
+ * Additional information:
1417
+ *
1418
+ * - Info string for "fence" tokens
1419
+ * - The value "auto" for autolink "link_open" and "link_close" tokens
1420
+ * - The string value of the item marker for ordered-list "list_item_open" tokens
1421
+ */
1422
+ "info",
1423
+ ""
1424
+ ), R(
1425
+ this,
1426
+ /**
1427
+ * True for block-level tokens, false for inline tokens.
1428
+ * Used in renderer to calculate line breaks
1429
+ */
1430
+ "block",
1431
+ !1
1432
+ ), R(
1433
+ this,
1434
+ /**
1435
+ * If it's true, ignore this element when rendering. Used for tight lists
1436
+ * to hide paragraphs.
1437
+ */
1438
+ "hidden",
1439
+ !1
1440
+ ), this.type = e, this.tag = n, this.attrs = null, this.nesting = t, this.meta = null;
1441
+ }
1442
+ /**
1443
+ * Search attribute index by name.
1444
+ */
1445
+ attrIndex(e) {
1446
+ if (!this.attrs) return -1;
1447
+ const n = this.attrs;
1448
+ for (let t = 0, o = n.length; t < o; t++) if (n[t][0] === e) return t;
1449
+ return -1;
1450
+ }
1451
+ /**
1452
+ * Add `[ name, value ]` attribute to list. Init attrs if necessary
1453
+ */
1454
+ attrPush(e) {
1455
+ this.attrs ? this.attrs.push(e) : this.attrs = [e];
1456
+ }
1457
+ /**
1458
+ * Set `name` attribute to `value`. Override old value if exists.
1459
+ */
1460
+ attrSet(e, n) {
1461
+ const t = this.attrIndex(e), o = [e, n];
1462
+ t < 0 ? this.attrPush(o) : this.attrs[t] = o;
1463
+ }
1464
+ /**
1465
+ * Get the value of attribute `name`, or null if it does not exist.
1466
+ */
1467
+ attrGet(e) {
1468
+ const n = this.attrIndex(e);
1469
+ let t = null;
1470
+ return n >= 0 && (t = this.attrs[n][1]), t;
1471
+ }
1472
+ /**
1473
+ * Join value to existing attribute via space. Or create new attribute if not
1474
+ * exists. Useful to operate with token classes.
1475
+ */
1476
+ attrJoin(e, n) {
1477
+ const t = this.attrIndex(e);
1478
+ t < 0 ? this.attrPush([e, n]) : this.attrs[t][1] = `${this.attrs[t][1]} ${n}`;
1479
+ }
1480
+ }, te = class {
1481
+ constructor() {
1482
+ R(
1483
+ this,
1484
+ /** @internal */
1485
+ "__rules__",
1486
+ []
1487
+ ), R(
1488
+ this,
1489
+ /** @internal */
1490
+ "__cache__",
1491
+ null
1492
+ );
1493
+ }
1494
+ /** @internal */
1495
+ __find__(e) {
1496
+ for (let n = 0; n < this.__rules__.length; n++) if (this.__rules__[n].name === e) return n;
1497
+ return -1;
1498
+ }
1499
+ /** @internal */
1500
+ __compile__() {
1501
+ const e = /* @__PURE__ */ new Set();
1502
+ this.__rules__.forEach((n) => {
1503
+ n.enabled && n.alt.forEach((t) => {
1504
+ t && e.add(t);
1505
+ });
1506
+ }), this.__cache__ = /* @__PURE__ */ Object.create(null), this.__cache__[""] = [], this.__rules__.forEach((n) => {
1507
+ n.enabled && this.__cache__[""].push(n.fn);
1508
+ }), e.forEach((n) => {
1509
+ this.__cache__[n] = [], this.__rules__.forEach((t) => {
1510
+ t.enabled && t.alt.indexOf(n) >= 0 && this.__cache__[n].push(t.fn);
1511
+ });
1512
+ });
1513
+ }
1514
+ /**
1515
+ * Replace rule by name with new function & options. Throws error if name not
1516
+ * found.
1517
+ *
1518
+ * @example Replace existing typographer replacement rule with new one
1519
+ * ```javascript
1520
+ * import MarkdownIt from 'markdown-it'
1521
+ * const md = new MarkdownIt()
1522
+ *
1523
+ * md.core.ruler.at('replacements', function replace(state) {
1524
+ * //...
1525
+ * });
1526
+ * ```
1527
+ */
1528
+ at(e, n, t = {}) {
1529
+ const o = this.__find__(e);
1530
+ if (o === -1) throw new Error(`Parser rule not found: ${e}`);
1531
+ this.__rules__[o].fn = n, this.__rules__[o].alt = t.alt || [], this.__cache__ = null;
1532
+ }
1533
+ /**
1534
+ * Add new rule to chain before one with given name. See also
1535
+ * {@link Ruler.after}, {@link Ruler.push}.
1536
+ *
1537
+ * @example
1538
+ * ```javascript
1539
+ * import MarkdownIt from 'markdown-it'
1540
+ * const md = new MarkdownIt()
1541
+ *
1542
+ * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {
1543
+ * //...
1544
+ * });
1545
+ * ```
1546
+ */
1547
+ before(e, n, t, o = {}) {
1548
+ const r = this.__find__(e);
1549
+ if (r === -1) throw new Error(`Parser rule not found: ${e}`);
1550
+ this.__rules__.splice(r, 0, {
1551
+ name: n,
1552
+ enabled: !0,
1553
+ fn: t,
1554
+ alt: o.alt || []
1555
+ }), this.__cache__ = null;
1556
+ }
1557
+ /**
1558
+ * Add new rule to chain after one with given name. See also
1559
+ * {@link Ruler.before}, {@link Ruler.push}.
1560
+ *
1561
+ * @example
1562
+ * ```javascript
1563
+ * import MarkdownIt from 'markdown-it'
1564
+ * const md = new MarkdownIt()
1565
+ *
1566
+ * md.inline.ruler.after('text', 'my_rule', function replace(state) {
1567
+ * //...
1568
+ * });
1569
+ * ```
1570
+ */
1571
+ after(e, n, t, o = {}) {
1572
+ const r = this.__find__(e);
1573
+ if (r === -1) throw new Error(`Parser rule not found: ${e}`);
1574
+ this.__rules__.splice(r + 1, 0, {
1575
+ name: n,
1576
+ enabled: !0,
1577
+ fn: t,
1578
+ alt: o.alt || []
1579
+ }), this.__cache__ = null;
1580
+ }
1581
+ /**
1582
+ * Push new rule to the end of chain. See also
1583
+ * {@link Ruler.before}, {@link Ruler.after}.
1584
+ *
1585
+ * @example
1586
+ * ```javascript
1587
+ * import MarkdownIt from 'markdown-it'
1588
+ * const md = new MarkdownIt()
1589
+ *
1590
+ * md.core.ruler.push('my_rule', function replace(state) {
1591
+ * //...
1592
+ * });
1593
+ * ```
1594
+ */
1595
+ push(e, n, t = {}) {
1596
+ this.__rules__.push({
1597
+ name: e,
1598
+ enabled: !0,
1599
+ fn: n,
1600
+ alt: t.alt || []
1601
+ }), this.__cache__ = null;
1602
+ }
1603
+ /**
1604
+ * Enable rules with given names. If any rule name not found - throw Error.
1605
+ * Errors can be disabled by second param.
1606
+ *
1607
+ * See also {@link Ruler.disable}, {@link Ruler.enableOnly}.
1608
+ *
1609
+ * Returns list of found rule names (if no exception happened).
1610
+ */
1611
+ enable(e, n = !1) {
1612
+ Array.isArray(e) || (e = [e]);
1613
+ const t = [];
1614
+ return e.forEach((o) => {
1615
+ const r = this.__find__(o);
1616
+ if (r < 0) {
1617
+ if (n) return;
1618
+ throw new Error(`Rules manager: invalid rule name ${o}`);
1619
+ }
1620
+ this.__rules__[r].enabled = !0, t.push(o);
1621
+ }), this.__cache__ = null, t;
1622
+ }
1623
+ /**
1624
+ * Enable rules with given names, and disable everything else. If any rule name
1625
+ * not found - throw Error. Errors can be disabled by second param.
1626
+ *
1627
+ * See also {@link Ruler.disable}, {@link Ruler.enable}.
1628
+ */
1629
+ enableOnly(e, n = !1) {
1630
+ Array.isArray(e) || (e = [e]), this.__rules__.forEach((t) => {
1631
+ t.enabled = !1;
1632
+ }), this.enable(e, n);
1633
+ }
1634
+ /**
1635
+ * Disable rules with given names. If any rule name not found - throw Error.
1636
+ * Errors can be disabled by second param.
1637
+ *
1638
+ * See also {@link Ruler.enable}, {@link Ruler.enableOnly}.
1639
+ *
1640
+ * Returns list of found rule names (if no exception happened).
1641
+ */
1642
+ disable(e, n = !1) {
1643
+ Array.isArray(e) || (e = [e]);
1644
+ const t = [];
1645
+ return e.forEach((o) => {
1646
+ const r = this.__find__(o);
1647
+ if (r < 0) {
1648
+ if (n) return;
1649
+ throw new Error(`Rules manager: invalid rule name ${o}`);
1650
+ }
1651
+ this.__rules__[r].enabled = !1, t.push(o);
1652
+ }), this.__cache__ = null, t;
1653
+ }
1654
+ /**
1655
+ * Return array of active functions (rules) for given chain name. It analyzes
1656
+ * rules configuration, compiles caches if not exists and returns result.
1657
+ *
1658
+ * Default chain name is `''` (empty string). It can't be skipped. That's
1659
+ * done intentionally, to keep signature monomorphic for high speed.
1660
+ */
1661
+ getRules(e) {
1662
+ return this.__cache__ || this.__compile__(), this.__cache__[e] || [];
1663
+ }
1664
+ }, N = {};
1665
+ N.code_inline = function(e, n, t, o, r) {
1666
+ const i = e[n];
1667
+ return `<code${r.renderAttrs(i)}>${U(i.content)}</code>`;
1668
+ };
1669
+ N.code_block = function(e, n, t, o, r) {
1670
+ const i = e[n];
1671
+ return `<pre${r.renderAttrs(i)}><code>${U(e[n].content)}</code></pre>
1672
+ `;
1673
+ };
1674
+ N.fence = function(e, n, t, o, r) {
1675
+ const i = e[n], s = i.info ? K(i.info).trim() : "";
1676
+ let u = "", l = "";
1677
+ if (s) {
1678
+ const f = s.split(/(\s+)/g);
1679
+ u = f[0], l = f.slice(2).join("");
1680
+ }
1681
+ let c;
1682
+ if (t.highlight ? c = t.highlight(i.content, u, l) || U(i.content) : c = U(i.content), c.indexOf("<pre") === 0) return c + `
1683
+ `;
1684
+ if (s) {
1685
+ const f = i.attrIndex("class"), h = i.attrs ? i.attrs.slice() : [];
1686
+ f < 0 ? h.push(["class", `${t.langPrefix}${u}`]) : (h[f] = [h[f][0], h[f][1]], h[f][1] += ` ${t.langPrefix}${u}`);
1687
+ const _ = { attrs: h };
1688
+ return `<pre><code${r.renderAttrs(_)}>${c}</code></pre>
1689
+ `;
1690
+ }
1691
+ return `<pre><code${r.renderAttrs(i)}>${c}</code></pre>
1692
+ `;
1693
+ };
1694
+ N.image = function(e, n, t, o, r) {
1695
+ const i = e[n];
1696
+ return i.attrs[i.attrIndex("alt")][1] = r.renderInlineAsText(i.children, t, o), r.renderToken(e, n, t);
1697
+ };
1698
+ N.hardbreak = function(e, n, t) {
1699
+ return t.xhtmlOut ? `<br />
1700
+ ` : `<br>
1701
+ `;
1702
+ };
1703
+ N.softbreak = function(e, n, t) {
1704
+ return t.breaks ? t.xhtmlOut ? `<br />
1705
+ ` : `<br>
1706
+ ` : `
1707
+ `;
1708
+ };
1709
+ N.text = function(e, n) {
1710
+ return U(e[n].content);
1711
+ };
1712
+ N.html_block = function(e, n) {
1713
+ return e[n].content;
1714
+ };
1715
+ N.html_inline = function(e, n) {
1716
+ return e[n].content;
1717
+ };
1718
+ var pn = class {
1719
+ constructor() {
1720
+ R(
1721
+ this,
1722
+ /**
1723
+ * Contains render rules for tokens. Can be updated and extended.
1724
+ *
1725
+ * See [source code](https://github.com/markdown-it/markdown-it/blob/master/src/renderer.ts)
1726
+ * for more details and examples.
1727
+ *
1728
+ * @example Custom render rules
1729
+ * ```javascript
1730
+ * import MarkdownIt from 'markdown-it'
1731
+ * const md = new MarkdownIt()
1732
+ *
1733
+ * md.renderer.rules.strong_open = function () { return '<b>'; };
1734
+ * md.renderer.rules.strong_close = function () { return '</b>'; };
1735
+ *
1736
+ * const result = md.renderInline(...);
1737
+ * ```
1738
+ *
1739
+ * @example Each rule is called as independent static function with fixed signature
1740
+ * ```javascript
1741
+ * function my_token_render(tokens, idx, options, env, renderer) {
1742
+ * // ...
1743
+ * return renderedHTML;
1744
+ * }
1745
+ * ```
1746
+ */
1747
+ "rules",
1748
+ Object.assign({}, N)
1749
+ );
1750
+ }
1751
+ /**
1752
+ * Render token attributes to string.
1753
+ */
1754
+ renderAttrs(e) {
1755
+ let n, t, o;
1756
+ if (!e.attrs) return "";
1757
+ for (o = "", n = 0, t = e.attrs.length; n < t; n++) o += ` ${U(e.attrs[n][0])}="${U(String(e.attrs[n][1]))}"`;
1758
+ return o;
1759
+ }
1760
+ /**
1761
+ * Default token renderer. Can be overriden by custom function
1762
+ * in {@link Renderer.rules}.
1763
+ */
1764
+ renderToken(e, n, t) {
1765
+ const o = e[n];
1766
+ let r = "";
1767
+ if (o.hidden) return "";
1768
+ let i = n - 1;
1769
+ for (; i >= 0 && e[i].hidden && e[i].nesting === 0; ) i--;
1770
+ o.block && o.nesting !== -1 && i >= 0 && e[i].hidden && e[i].nesting === -1 && (r += `
1771
+ `), r += (o.nesting === -1 ? "</" : "<") + o.tag, r += this.renderAttrs(o), o.nesting === 0 && t.xhtmlOut && (r += " /");
1772
+ let s = !1;
1773
+ if (o.block && (s = !0, o.nesting === 1)) {
1774
+ let u = n + 1;
1775
+ for (; u < e.length && e[u].hidden && e[u].nesting === 0; ) u++;
1776
+ if (u < e.length) {
1777
+ const l = e[u];
1778
+ (l.type === "inline" || l.hidden || l.nesting === -1 && l.tag === o.tag) && (s = !1);
1779
+ }
1780
+ }
1781
+ return r += s ? `>
1782
+ ` : ">", r;
1783
+ }
1784
+ /**
1785
+ * The same as {@link Renderer.render}, but for single token of `inline` type.
1786
+ */
1787
+ renderInline(e, n, t) {
1788
+ let o = "";
1789
+ const r = this.rules;
1790
+ for (let i = 0, s = e.length; i < s; i++) {
1791
+ const u = e[i].type;
1792
+ typeof r[u] < "u" ? o += r[u](e, i, n, t, this) : o += this.renderToken(e, i, n);
1793
+ }
1794
+ return o;
1795
+ }
1796
+ /**
1797
+ * Special kludge for image `alt` attributes to conform CommonMark spec.
1798
+ * Don't try to use it! Spec requires to show `alt` content with stripped markup,
1799
+ * instead of simple escaping.
1800
+ */
1801
+ renderInlineAsText(e, n, t) {
1802
+ let o = "";
1803
+ for (let r = 0, i = e.length; r < i; r++) switch (e[r].type) {
1804
+ case "text":
1805
+ case "code_inline":
1806
+ o += e[r].content;
1807
+ break;
1808
+ case "image":
1809
+ o += this.renderInlineAsText(e[r].children, n, t);
1810
+ break;
1811
+ case "html_inline":
1812
+ case "html_block":
1813
+ o += e[r].content;
1814
+ break;
1815
+ case "softbreak":
1816
+ case "hardbreak":
1817
+ o += `
1818
+ `;
1819
+ }
1820
+ return o;
1821
+ }
1822
+ /**
1823
+ * Takes token stream and generates HTML. Probably, you will never need to call
1824
+ * this method directly.
1825
+ */
1826
+ render(e, n, t) {
1827
+ let o = "";
1828
+ const r = this.rules;
1829
+ for (let i = 0, s = e.length; i < s; i++) {
1830
+ const u = e[i].type;
1831
+ u === "inline" ? o += this.renderInline(e[i].children, n, t) : typeof r[u] < "u" ? o += r[u](e, i, n, t, this) : o += this.renderToken(e, i, n);
1832
+ }
1833
+ return o;
1834
+ }
1835
+ }, dn = class {
1836
+ constructor(e, n, t) {
1837
+ R(this, "tokens", []), R(this, "inlineMode", !1), R(this, "Token", W), this.src = e, this.env = t, this.md = n;
1838
+ }
1839
+ }, Pt = /\r\n?/g, Lt = /\0/g;
1840
+ function Nt(e) {
1841
+ let n;
1842
+ n = e.src.replace(Pt, `
1843
+ `), n = n.replace(Lt, "�"), e.src = n;
1844
+ }
1845
+ function $t(e) {
1846
+ let n;
1847
+ e.inlineMode ? (n = new e.Token("inline", "", 0), n.content = e.src, n.map = [0, 1], n.children = [], e.tokens.push(n)) : e.md.block.parse(e.src, e.md, e.env, e.tokens);
1848
+ }
1849
+ function qt(e) {
1850
+ const n = e.tokens;
1851
+ let t = 0;
1852
+ for (let o = 0; o < n.length; o++)
1853
+ n[o].type !== "reference_definition" && (o !== t && (n[t] = n[o]), t++);
1854
+ n.length !== t && (n.length = t);
1855
+ }
1856
+ function Ot(e) {
1857
+ const n = e.tokens;
1858
+ for (let t = 0, o = n.length; t < o; t++) {
1859
+ const r = n[t];
1860
+ r.type === "inline" && e.md.inline.parse(r.content, e.md, e.env, r.children);
1861
+ }
1862
+ }
1863
+ function Ut(e) {
1864
+ return /^<a[>\s]/i.test(e);
1865
+ }
1866
+ function Zt(e) {
1867
+ return /^<\/a\s*>/i.test(e);
1868
+ }
1869
+ function Wt(e) {
1870
+ const n = e.tokens;
1871
+ if (e.md.options.linkify)
1872
+ for (let t = 0, o = n.length; t < o; t++) {
1873
+ if (n[t].type !== "inline" || !e.md.linkify.test(n[t].content)) continue;
1874
+ const r = n[t].children, i = [];
1875
+ let s = 0;
1876
+ for (let u = r.length - 1; u >= 0; u--) {
1877
+ const l = r[u];
1878
+ if (l.type === "link_close") {
1879
+ for (u--; r[u].level !== l.level && r[u].type !== "link_open"; ) u--;
1880
+ continue;
1881
+ }
1882
+ if (l.type === "html_inline" && (Ut(l.content) && s > 0 && s--, Zt(l.content) && s++), !(s > 0) && l.type === "text" && e.md.linkify.test(l.content)) {
1883
+ const c = l.content;
1884
+ let f = e.md.linkify.match(c);
1885
+ const h = [];
1886
+ let _ = l.level, p = 0;
1887
+ f.length > 0 && f[0].index === 0 && u > 0 && r[u - 1].type === "text_special" && (f = f.slice(1));
1888
+ for (let a = 0; a < f.length; a++) {
1889
+ const b = f[a].url, g = e.md.normalizeLink(b);
1890
+ if (!e.md.validateLink(g)) continue;
1891
+ let C = f[a].text;
1892
+ f[a].schema ? f[a].schema === "mailto:" && !/^mailto:/i.test(C) ? C = e.md.normalizeLinkText(`mailto:${C}`).replace(/^mailto:/, "") : C = e.md.normalizeLinkText(C) : C = e.md.normalizeLinkText(`http://${C}`).replace(/^http:\/\//, "");
1893
+ const x = f[a].index;
1894
+ if (x > p) {
1895
+ const D = new e.Token("text", "", 0);
1896
+ D.content = c.slice(p, x), D.level = _, h.push(D);
1897
+ }
1898
+ const m = new e.Token("link_open", "a", 1);
1899
+ m.attrs = [["href", g]], m.level = _++, m.markup = "linkify", m.info = "auto", h.push(m);
1900
+ const d = new e.Token("text", "", 0);
1901
+ d.content = C, d.level = _, h.push(d);
1902
+ const k = new e.Token("link_close", "a", -1);
1903
+ k.level = --_, k.markup = "linkify", k.info = "auto", h.push(k), p = f[a].lastIndex;
1904
+ }
1905
+ if (p < c.length) {
1906
+ const a = new e.Token("text", "", 0);
1907
+ a.content = c.slice(p), a.level = _, h.push(a);
1908
+ }
1909
+ i.push({
1910
+ index: u,
1911
+ nodes: h
1912
+ });
1913
+ }
1914
+ }
1915
+ if (i.length > 0) {
1916
+ let u = r.length;
1917
+ for (const h of i) u += h.nodes.length - 1;
1918
+ const l = new Array(u);
1919
+ let c = 0, f = 0;
1920
+ i.reverse();
1921
+ for (let h = 0; h < r.length; h++) {
1922
+ const _ = i[c];
1923
+ if ((_ == null ? void 0 : _.index) === h) {
1924
+ for (const p of _.nodes) l[f++] = p;
1925
+ c++;
1926
+ } else l[f++] = r[h];
1927
+ }
1928
+ n[t].children = l;
1929
+ }
1930
+ }
1931
+ }
1932
+ var _n = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/, Xt = /\((c|tm|r)\)/i, Yt = /\((c|tm|r)\)/gi, Kt = {
1933
+ c: "©",
1934
+ r: "®",
1935
+ tm: "™"
1936
+ };
1937
+ function Ht(e, n) {
1938
+ return Kt[n.toLowerCase()];
1939
+ }
1940
+ function Gt(e) {
1941
+ let n = 0;
1942
+ for (let t = e.length - 1; t >= 0; t--) {
1943
+ const o = e[t];
1944
+ o.type === "text" && !n && (o.content = o.content.replace(Yt, Ht)), o.type === "link_open" && o.info === "auto" && n--, o.type === "link_close" && o.info === "auto" && n++;
1945
+ }
1946
+ }
1947
+ function Vt(e) {
1948
+ let n = 0;
1949
+ for (let t = e.length - 1; t >= 0; t--) {
1950
+ const o = e[t];
1951
+ o.type === "text" && !n && _n.test(o.content) && (o.content = o.content.replace(/\+-/g, "±").replace(/\.{2,}/g, "…").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---(?=[^-]|$)/gm, "$1—").replace(/(^|\s)--(?=\s|$)/gm, "$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm, "$1–")), o.type === "link_open" && o.info === "auto" && n--, o.type === "link_close" && o.info === "auto" && n++;
1952
+ }
1953
+ }
1954
+ function Qt(e) {
1955
+ let n;
1956
+ if (e.md.options.typographer)
1957
+ for (n = e.tokens.length - 1; n >= 0; n--)
1958
+ e.tokens[n].type === "inline" && (Xt.test(e.tokens[n].content) && Gt(e.tokens[n].children), _n.test(e.tokens[n].content) && Vt(e.tokens[n].children));
1959
+ }
1960
+ var er = /['"]/, Pe = /['"]/g, Le = "’";
1961
+ function re(e, n, t, o) {
1962
+ e[n] || (e[n] = []), e[n].push({
1963
+ pos: t,
1964
+ ch: o
1965
+ });
1966
+ }
1967
+ function nr(e, n) {
1968
+ let t = "", o = 0;
1969
+ n.sort((r, i) => r.pos - i.pos);
1970
+ for (let r = 0; r < n.length; r++) {
1971
+ const i = n[r];
1972
+ t += e.slice(o, i.pos) + i.ch, o = i.pos + 1;
1973
+ }
1974
+ return t + e.slice(o);
1975
+ }
1976
+ function tr(e, n) {
1977
+ let t;
1978
+ const o = [], r = {};
1979
+ for (let i = 0; i < e.length; i++) {
1980
+ const s = e[i], u = e[i].level;
1981
+ for (t = o.length - 1; t >= 0 && !(o[t].level <= u); t--) ;
1982
+ if (o.length = t + 1, s.type !== "text") continue;
1983
+ const l = s.content;
1984
+ let c = 0;
1985
+ const f = l.length;
1986
+ e: for (; c < f; ) {
1987
+ Pe.lastIndex = c;
1988
+ const h = Pe.exec(l);
1989
+ if (!h) break;
1990
+ let _ = !0, p = !0;
1991
+ c = h.index + 1;
1992
+ const a = h[0] === "'";
1993
+ let b = 32;
1994
+ if (h.index - 1 >= 0) b = l.charCodeAt(h.index - 1);
1995
+ else for (t = i - 1; t >= 0 && !(e[t].type === "softbreak" || e[t].type === "hardbreak"); t--)
1996
+ if (e[t].content) {
1997
+ b = e[t].content.charCodeAt(e[t].content.length - 1);
1998
+ break;
1999
+ }
2000
+ let g = 32;
2001
+ if (c < f) g = l.charCodeAt(c);
2002
+ else for (t = i + 1; t < e.length && !(e[t].type === "softbreak" || e[t].type === "hardbreak"); t++)
2003
+ if (e[t].content) {
2004
+ g = e[t].content.charCodeAt(0);
2005
+ break;
2006
+ }
2007
+ const C = ee(b) || Q(b), x = ee(g) || Q(g), m = V(b), d = V(g);
2008
+ if (d ? _ = !1 : x && (m || C || (_ = !1)), m ? p = !1 : C && (d || x || (p = !1)), g === 34 && h[0] === '"' && b >= 48 && b <= 57 && (p = _ = !1), _ && p && (_ = C, p = x), !_ && !p) {
2009
+ a && re(r, i, h.index, Le);
2010
+ continue;
2011
+ }
2012
+ if (p) for (t = o.length - 1; t >= 0; t--) {
2013
+ let k = o[t];
2014
+ if (o[t].level < u) break;
2015
+ if (k.single === a && o[t].level === u) {
2016
+ k = o[t];
2017
+ let D, A;
2018
+ a ? (D = n.md.options.quotes[2], A = n.md.options.quotes[3]) : (D = n.md.options.quotes[0], A = n.md.options.quotes[1]), re(r, i, h.index, A), re(r, k.token, k.pos, D), o.length = t;
2019
+ continue e;
2020
+ }
2021
+ }
2022
+ _ ? o.push({
2023
+ token: i,
2024
+ pos: h.index,
2025
+ single: a,
2026
+ level: u
2027
+ }) : p && a && re(r, i, h.index, Le);
2028
+ }
2029
+ }
2030
+ Object.keys(r).forEach(function(i) {
2031
+ const s = Number(i);
2032
+ e[s].content = nr(e[s].content, r[i]);
2033
+ });
2034
+ }
2035
+ function rr(e) {
2036
+ if (e.md.options.typographer)
2037
+ for (let n = e.tokens.length - 1; n >= 0; n--)
2038
+ e.tokens[n].type !== "inline" || !er.test(e.tokens[n].content) || tr(e.tokens[n].children, e);
2039
+ }
2040
+ function ir(e) {
2041
+ let n, t;
2042
+ const o = e.length;
2043
+ for (n = 0; n < o; n++) e[n].type === "text_special" && (e[n].type = "text");
2044
+ for (n = t = 0; n < o; n++) e[n].type === "text" && n + 1 < o && e[n + 1].type === "text" ? e[n + 1].content = e[n].content + e[n + 1].content : (n !== t && (e[t] = e[n]), t++);
2045
+ n !== t && (e.length = t);
2046
+ }
2047
+ function or(e) {
2048
+ let n, t;
2049
+ const o = e.tokens, r = o.length;
2050
+ for (let i = 0; i < r; i++) {
2051
+ if (o[i].type !== "inline") continue;
2052
+ const s = o[i].children, u = s.length;
2053
+ for (n = 0; n < u; n++)
2054
+ s[n].type === "text_special" && (s[n].type = "text"), s[n].children && ir(s[n].children);
2055
+ for (n = t = 0; n < u; n++) s[n].type === "text" && n + 1 < u && s[n + 1].type === "text" ? s[n + 1].content = s[n].content + s[n + 1].content : (n !== t && (s[t] = s[n]), t++);
2056
+ n !== t && (s.length = t);
2057
+ }
2058
+ }
2059
+ var fe = [
2060
+ ["normalize", Nt],
2061
+ ["block", $t],
2062
+ ["strip_references", qt],
2063
+ ["inline", Ot],
2064
+ ["linkify", Wt],
2065
+ ["replacements", Qt],
2066
+ ["smartquotes", rr],
2067
+ ["text_join", or]
2068
+ ], gn = class {
2069
+ constructor() {
2070
+ R(
2071
+ this,
2072
+ /**
2073
+ * {@link Ruler} instance. Keep configuration of core rules.
2074
+ */
2075
+ "ruler",
2076
+ new te()
2077
+ ), R(this, "State", dn);
2078
+ for (let e = 0; e < fe.length; e++) this.ruler.push(fe[e][0], fe[e][1]);
2079
+ }
2080
+ /**
2081
+ * Executes core chain rules.
2082
+ */
2083
+ process(e) {
2084
+ const n = this.ruler.getRules("");
2085
+ for (let t = 0, o = n.length; t < o; t++) n[t](e);
2086
+ }
2087
+ }, kn = class {
2088
+ constructor(e, n, t, o) {
2089
+ R(this, "bMarks", []), R(this, "eMarks", []), R(this, "tShift", []), R(this, "sCount", []), R(this, "bsCount", []), R(this, "blkIndent", 0), R(this, "line", 0), R(this, "lineMax", 0), R(this, "tight", !1), R(this, "listIndent", -1), R(this, "parentType", "root"), R(this, "level", 0), R(this, "Token", W), this.src = e, this.md = n, this.env = t, this.tokens = o;
2090
+ const r = this.src;
2091
+ for (let i = 0, s = 0, u = 0, l = 0, c = r.length, f = !1; s < c; s++) {
2092
+ const h = r.charCodeAt(s);
2093
+ if (!f) if (E(h)) {
2094
+ u++, h === 9 ? l += 4 - l % 4 : l++;
2095
+ continue;
2096
+ } else f = !0;
2097
+ (h === 10 || s === c - 1) && (h !== 10 && s++, this.bMarks.push(i), this.eMarks.push(s), this.tShift.push(u), this.sCount.push(l), this.bsCount.push(0), f = !1, u = 0, l = 0, i = s + 1);
2098
+ }
2099
+ this.bMarks.push(r.length), this.eMarks.push(r.length), this.tShift.push(0), this.sCount.push(0), this.bsCount.push(0), this.lineMax = this.bMarks.length - 1;
2100
+ }
2101
+ push(e, n, t) {
2102
+ const o = new W(e, n, t);
2103
+ return o.block = !0, t < 0 && this.level--, o.level = this.level, t > 0 && this.level++, this.tokens.push(o), o;
2104
+ }
2105
+ isEmpty(e) {
2106
+ return this.bMarks[e] + this.tShift[e] >= this.eMarks[e];
2107
+ }
2108
+ skipEmptyLines(e) {
2109
+ for (let n = this.lineMax; e < n && !(this.bMarks[e] + this.tShift[e] < this.eMarks[e]); e++) ;
2110
+ return e;
2111
+ }
2112
+ skipSpaces(e) {
2113
+ for (let n = this.src.length; e < n && E(this.src.charCodeAt(e)); e++) ;
2114
+ return e;
2115
+ }
2116
+ skipSpacesBack(e, n) {
2117
+ if (e <= n) return e;
2118
+ for (; e > n; ) if (!E(this.src.charCodeAt(--e))) return e + 1;
2119
+ return e;
2120
+ }
2121
+ skipChars(e, n) {
2122
+ for (let t = this.src.length; e < t && this.src.charCodeAt(e) === n; e++) ;
2123
+ return e;
2124
+ }
2125
+ skipCharsBack(e, n, t) {
2126
+ if (e <= t) return e;
2127
+ for (; e > t; ) if (n !== this.src.charCodeAt(--e)) return e + 1;
2128
+ return e;
2129
+ }
2130
+ getLines(e, n, t, o) {
2131
+ if (e >= n) return "";
2132
+ const r = new Array(n - e);
2133
+ for (let i = 0, s = e; s < n; s++, i++) {
2134
+ let u = 0;
2135
+ const l = this.bMarks[s];
2136
+ let c = l, f;
2137
+ for (s + 1 < n || o ? f = this.eMarks[s] + 1 : f = this.eMarks[s]; c < f && u < t; ) {
2138
+ const h = this.src.charCodeAt(c);
2139
+ if (E(h)) h === 9 ? u += 4 - (u + this.bsCount[s]) % 4 : u++;
2140
+ else if (c - l < this.tShift[s]) u++;
2141
+ else break;
2142
+ c++;
2143
+ }
2144
+ u > t ? r[i] = new Array(u - t + 1).join(" ") + this.src.slice(c, f) : r[i] = this.src.slice(c, f);
2145
+ }
2146
+ return r.join("");
2147
+ }
2148
+ }, sr = 65536;
2149
+ function pe(e, n) {
2150
+ const t = e.bMarks[n] + e.tShift[n], o = e.eMarks[n];
2151
+ return e.src.slice(t, o);
2152
+ }
2153
+ function Ne(e) {
2154
+ const n = [], t = e.length;
2155
+ let o = 0, r = e.charCodeAt(o), i = !1, s = 0, u = "";
2156
+ for (; o < t; )
2157
+ r === 124 && (i ? (u += e.substring(s, o - 1), s = o) : (n.push(u + e.substring(s, o)), u = "", s = o + 1)), i = r === 92, o++, r = e.charCodeAt(o);
2158
+ return n.push(u + e.substring(s)), n;
2159
+ }
2160
+ function ur(e, n, t, o) {
2161
+ if (n + 2 > t) return !1;
2162
+ let r = n + 1;
2163
+ if (e.sCount[r] < e.blkIndent || e.sCount[r] - e.blkIndent >= 4) return !1;
2164
+ let i = e.bMarks[r] + e.tShift[r];
2165
+ if (i >= e.eMarks[r]) return !1;
2166
+ const s = e.src.charCodeAt(i++);
2167
+ if (s !== 124 && s !== 45 && s !== 58 || i >= e.eMarks[r]) return !1;
2168
+ const u = e.src.charCodeAt(i++);
2169
+ if (u !== 124 && u !== 45 && u !== 58 && !E(u) || s === 45 && E(u)) return !1;
2170
+ for (; i < e.eMarks[r]; ) {
2171
+ const d = e.src.charCodeAt(i);
2172
+ if (d !== 124 && d !== 45 && d !== 58 && !E(d)) return !1;
2173
+ i++;
2174
+ }
2175
+ let l = pe(e, n + 1), c = l.split("|");
2176
+ const f = [];
2177
+ for (let d = 0; d < c.length; d++) {
2178
+ const k = c[d].trim();
2179
+ if (!k) {
2180
+ if (d === 0 || d === c.length - 1) continue;
2181
+ return !1;
2182
+ }
2183
+ if (!/^:?-+:?$/.test(k)) return !1;
2184
+ k.charCodeAt(k.length - 1) === 58 ? f.push(k.charCodeAt(0) === 58 ? "center" : "right") : k.charCodeAt(0) === 58 ? f.push("left") : f.push("");
2185
+ }
2186
+ if (l = pe(e, n).trim(), l.indexOf("|") === -1 || e.sCount[n] - e.blkIndent >= 4) return !1;
2187
+ c = Ne(l), c.length && c[0] === "" && c.shift(), c.length && c[c.length - 1] === "" && c.pop();
2188
+ const h = c.length;
2189
+ if (h === 0 || h !== f.length) return !1;
2190
+ if (o) return !0;
2191
+ const _ = e.parentType;
2192
+ e.parentType = "table";
2193
+ const p = e.md.block.ruler.getRules("blockquote"), a = e.push("table_open", "table", 1), b = [n, 0];
2194
+ a.map = b;
2195
+ const g = e.push("thead_open", "thead", 1);
2196
+ g.map = [n, n + 1];
2197
+ const C = e.push("tr_open", "tr", 1);
2198
+ C.map = [n, n + 1];
2199
+ for (let d = 0; d < c.length; d++) {
2200
+ const k = e.push("th_open", "th", 1);
2201
+ f[d] && (k.attrs = [["style", `text-align:${f[d]}`]]);
2202
+ const D = e.push("inline", "", 0);
2203
+ D.content = c[d].trim(), D.children = [], e.push("th_close", "th", -1);
2204
+ }
2205
+ e.push("tr_close", "tr", -1), e.push("thead_close", "thead", -1);
2206
+ let x, m = 0;
2207
+ for (r = n + 2; r < t && !(e.sCount[r] < e.blkIndent); r++) {
2208
+ let d = !1;
2209
+ for (let D = 0, A = p.length; D < A; D++) if (p[D](e, r, t, !0)) {
2210
+ d = !0;
2211
+ break;
2212
+ }
2213
+ if (d || (l = pe(e, r).trim(), !l) || e.sCount[r] - e.blkIndent >= 4 || (c = Ne(l), c.length && c[0] === "" && c.shift(), c.length && c[c.length - 1] === "" && c.pop(), m += h - c.length, m > sr)) break;
2214
+ if (r === n + 2) {
2215
+ const D = e.push("tbody_open", "tbody", 1);
2216
+ D.map = x = [n + 2, 0];
2217
+ }
2218
+ const k = e.push("tr_open", "tr", 1);
2219
+ k.map = [r, r + 1];
2220
+ for (let D = 0; D < h; D++) {
2221
+ const A = e.push("td_open", "td", 1);
2222
+ f[D] && (A.attrs = [["style", `text-align:${f[D]}`]]);
2223
+ const B = e.push("inline", "", 0);
2224
+ B.content = c[D] ? c[D].trim() : "", B.children = [], e.push("td_close", "td", -1);
2225
+ }
2226
+ e.push("tr_close", "tr", -1);
2227
+ }
2228
+ return x && (e.push("tbody_close", "tbody", -1), x[1] = r), e.push("table_close", "table", -1), b[1] = r, e.parentType = _, e.line = r, !0;
2229
+ }
2230
+ function lr(e, n, t) {
2231
+ if (e.sCount[n] - e.blkIndent < 4) return !1;
2232
+ let o = n + 1, r = o;
2233
+ for (; o < t; ) {
2234
+ if (e.isEmpty(o)) {
2235
+ o++;
2236
+ continue;
2237
+ }
2238
+ if (e.sCount[o] - e.blkIndent >= 4) {
2239
+ o++, r = o;
2240
+ continue;
2241
+ }
2242
+ break;
2243
+ }
2244
+ e.line = r;
2245
+ const i = e.push("code_block", "code", 0);
2246
+ return i.content = e.getLines(n, r, 4 + e.blkIndent, !1) + `
2247
+ `, i.map = [n, e.line], !0;
2248
+ }
2249
+ function cr(e, n, t, o) {
2250
+ let r = e.bMarks[n] + e.tShift[n], i = e.eMarks[n];
2251
+ if (e.sCount[n] - e.blkIndent >= 4 || r + 3 > i) return !1;
2252
+ const s = e.src.charCodeAt(r);
2253
+ if (s !== 126 && s !== 96) return !1;
2254
+ let u = r;
2255
+ r = e.skipChars(r, s);
2256
+ let l = r - u;
2257
+ if (l < 3) return !1;
2258
+ const c = e.src.slice(u, r), f = e.src.slice(r, i);
2259
+ if (s === 96 && f.indexOf(String.fromCharCode(s)) >= 0)
2260
+ return !1;
2261
+ if (o) return !0;
2262
+ let h = n, _ = !1;
2263
+ for (; h++, !(h >= t || (r = u = e.bMarks[h] + e.tShift[h], i = e.eMarks[h], r < i && e.sCount[h] < e.blkIndent)); )
2264
+ if (e.src.charCodeAt(r) === s && !(e.sCount[h] - e.blkIndent >= 4) && (r = e.skipChars(r, s), !(r - u < l) && (r = e.skipSpaces(r), !(r < i)))) {
2265
+ _ = !0;
2266
+ break;
2267
+ }
2268
+ l = e.sCount[n], e.line = h + (_ ? 1 : 0);
2269
+ const p = e.push("fence", "code", 0);
2270
+ return p.info = f, p.content = e.getLines(n + 1, h, l, !0), p.markup = c, p.map = [n, e.line], !0;
2271
+ }
2272
+ function ar(e, n, t, o) {
2273
+ let r = e.bMarks[n] + e.tShift[n], i = e.eMarks[n];
2274
+ const s = e.lineMax;
2275
+ if (e.sCount[n] - e.blkIndent >= 4 || e.src.charCodeAt(r) !== 62) return !1;
2276
+ if (o) return !0;
2277
+ const u = [], l = [], c = [], f = [], h = e.md.block.ruler.getRules("blockquote"), _ = e.parentType;
2278
+ e.parentType = "blockquote";
2279
+ let p = !1, a;
2280
+ for (a = n; a < t; a++) {
2281
+ const m = e.sCount[a] < e.blkIndent;
2282
+ if (r = e.bMarks[a] + e.tShift[a], i = e.eMarks[a], r >= i) break;
2283
+ if (e.src.charCodeAt(r++) === 62 && !m) {
2284
+ let k = e.sCount[a] + 1, D, A;
2285
+ e.src.charCodeAt(r) === 32 ? (r++, k++, A = !1, D = !0) : e.src.charCodeAt(r) === 9 ? (D = !0, (e.bsCount[a] + k) % 4 === 3 ? (r++, k++, A = !1) : A = !0) : D = !1;
2286
+ let B = k;
2287
+ for (u.push(e.bMarks[a]), e.bMarks[a] = r; r < i; ) {
2288
+ const v = e.src.charCodeAt(r);
2289
+ if (E(v)) v === 9 ? B += 4 - (B + e.bsCount[a] + (A ? 1 : 0)) % 4 : B++;
2290
+ else break;
2291
+ r++;
2292
+ }
2293
+ p = r >= i, l.push(e.bsCount[a]), e.bsCount[a] = e.sCount[a] + 1 + (D ? 1 : 0), c.push(e.sCount[a]), e.sCount[a] = B - k, f.push(e.tShift[a]), e.tShift[a] = r - e.bMarks[a];
2294
+ continue;
2295
+ }
2296
+ if (p) break;
2297
+ let d = !1;
2298
+ for (let k = 0, D = h.length; k < D; k++) if (h[k](e, a, t, !0)) {
2299
+ d = !0;
2300
+ break;
2301
+ }
2302
+ if (d) {
2303
+ e.lineMax = a, e.blkIndent !== 0 && (u.push(e.bMarks[a]), l.push(e.bsCount[a]), f.push(e.tShift[a]), c.push(e.sCount[a]), e.sCount[a] -= e.blkIndent);
2304
+ break;
2305
+ }
2306
+ u.push(e.bMarks[a]), l.push(e.bsCount[a]), f.push(e.tShift[a]), c.push(e.sCount[a]), e.sCount[a] = -1;
2307
+ }
2308
+ const b = e.blkIndent;
2309
+ e.blkIndent = 0;
2310
+ const g = e.push("blockquote_open", "blockquote", 1);
2311
+ g.markup = ">";
2312
+ const C = [n, 0];
2313
+ g.map = C, e.md.block.tokenize(e, n, a);
2314
+ const x = e.push("blockquote_close", "blockquote", -1);
2315
+ x.markup = ">", e.lineMax = s, e.parentType = _, C[1] = e.line;
2316
+ for (let m = 0; m < f.length; m++)
2317
+ e.bMarks[m + n] = u[m], e.tShift[m + n] = f[m], e.sCount[m + n] = c[m], e.bsCount[m + n] = l[m];
2318
+ return e.blkIndent = b, !0;
2319
+ }
2320
+ function hr(e, n, t, o) {
2321
+ const r = e.eMarks[n];
2322
+ if (e.sCount[n] - e.blkIndent >= 4) return !1;
2323
+ let i = e.bMarks[n] + e.tShift[n];
2324
+ const s = e.src.charCodeAt(i++);
2325
+ if (s !== 42 && s !== 45 && s !== 95) return !1;
2326
+ let u = 1;
2327
+ for (; i < r; ) {
2328
+ const c = e.src.charCodeAt(i++);
2329
+ if (c !== s && !E(c)) return !1;
2330
+ c === s && u++;
2331
+ }
2332
+ if (u < 3) return !1;
2333
+ if (o) return !0;
2334
+ e.line = n + 1;
2335
+ const l = e.push("hr", "hr", 0);
2336
+ return l.map = [n, e.line], l.markup = Array(u + 1).join(String.fromCharCode(s)), !0;
2337
+ }
2338
+ function $e(e, n) {
2339
+ const t = e.eMarks[n];
2340
+ let o = e.bMarks[n] + e.tShift[n];
2341
+ const r = e.src.charCodeAt(o++);
2342
+ return r !== 42 && r !== 45 && r !== 43 || o < t && !E(e.src.charCodeAt(o)) ? -1 : o;
2343
+ }
2344
+ function qe(e, n) {
2345
+ const t = e.bMarks[n] + e.tShift[n], o = e.eMarks[n];
2346
+ let r = t;
2347
+ if (r + 1 >= o) return -1;
2348
+ let i = e.src.charCodeAt(r++);
2349
+ if (i < 48 || i > 57) return -1;
2350
+ for (; ; ) {
2351
+ if (r >= o) return -1;
2352
+ if (i = e.src.charCodeAt(r++), i >= 48 && i <= 57) {
2353
+ if (r - t >= 10) return -1;
2354
+ continue;
2355
+ }
2356
+ if (i === 41 || i === 46) break;
2357
+ return -1;
2358
+ }
2359
+ return r < o && (i = e.src.charCodeAt(r), !E(i)) ? -1 : r;
2360
+ }
2361
+ function fr(e, n) {
2362
+ const t = e.level + 2;
2363
+ for (let o = n + 2, r = e.tokens.length - 2; o < r; o++) e.tokens[o].level === t && e.tokens[o].type === "paragraph_open" && (e.tokens[o + 2].hidden = !0, e.tokens[o].hidden = !0, o += 2);
2364
+ }
2365
+ function pr(e, n, t, o) {
2366
+ let r, i, s, u, l = n, c = !0;
2367
+ if (e.sCount[l] - e.blkIndent >= 4 || e.listIndent >= 0 && e.sCount[l] - e.listIndent >= 4 && e.sCount[l] < e.blkIndent) return !1;
2368
+ let f = !1;
2369
+ o && e.parentType === "paragraph" && e.sCount[l] >= e.blkIndent && (f = !0);
2370
+ let h, _, p;
2371
+ if ((p = qe(e, l)) >= 0) {
2372
+ if (h = !0, s = e.bMarks[l] + e.tShift[l], _ = Number(e.src.slice(s, p - 1)), f && _ !== 1) return !1;
2373
+ } else if ((p = $e(e, l)) >= 0) h = !1;
2374
+ else return !1;
2375
+ if (f && e.skipSpaces(p) >= e.eMarks[l])
2376
+ return !1;
2377
+ if (o) return !0;
2378
+ const a = e.src.charCodeAt(p - 1), b = e.tokens.length;
2379
+ h ? (u = e.push("ordered_list_open", "ol", 1), _ !== 1 && (u.attrs = [["start", _]])) : u = e.push("bullet_list_open", "ul", 1);
2380
+ const g = [l, 0];
2381
+ u.map = g, u.markup = String.fromCharCode(a);
2382
+ let C = !1;
2383
+ const x = e.md.block.ruler.getRules("list"), m = e.parentType;
2384
+ for (e.parentType = "list"; l < t; ) {
2385
+ i = p, r = e.eMarks[l];
2386
+ const d = e.sCount[l] + p - (e.bMarks[l] + e.tShift[l]);
2387
+ let k = d;
2388
+ for (; i < r; ) {
2389
+ const S = e.src.charCodeAt(i);
2390
+ if (S === 9) k += 4 - (k + e.bsCount[l]) % 4;
2391
+ else if (S === 32) k++;
2392
+ else break;
2393
+ i++;
2394
+ }
2395
+ const D = i;
2396
+ let A;
2397
+ D >= r ? A = 1 : A = k - d, A > 4 && (A = 1);
2398
+ const B = d + A;
2399
+ u = e.push("list_item_open", "li", 1), u.markup = String.fromCharCode(a);
2400
+ const v = [l, 0];
2401
+ u.map = v, h && (u.info = e.src.slice(s, p - 1));
2402
+ const F = e.tight, w = e.tShift[l], y = e.sCount[l], J = e.listIndent;
2403
+ if (e.listIndent = e.blkIndent, e.blkIndent = B, e.tight = !0, e.tShift[l] = D - e.bMarks[l], e.sCount[l] = k, D >= r && e.isEmpty(l + 1) ? e.line = Math.min(e.line + 2, t) : e.md.block.tokenize(e, l, t), (!e.tight || C) && (c = !1), C = e.line - l > 1 && e.isEmpty(e.line - 1), e.blkIndent = e.listIndent, e.listIndent = J, e.tShift[l] = w, e.sCount[l] = y, e.tight = F, u = e.push("list_item_close", "li", -1), u.markup = String.fromCharCode(a), l = e.line, v[1] = l, l >= t || e.sCount[l] < e.blkIndent || e.sCount[l] - e.blkIndent >= 4) break;
2404
+ let I = !1;
2405
+ for (let S = 0, wn = x.length; S < wn; S++) if (x[S](e, l, t, !0)) {
2406
+ I = !0;
2407
+ break;
2408
+ }
2409
+ if (I) break;
2410
+ if (h) {
2411
+ if (p = qe(e, l), p < 0) break;
2412
+ s = e.bMarks[l] + e.tShift[l];
2413
+ } else if (p = $e(e, l), p < 0) break;
2414
+ if (a !== e.src.charCodeAt(p - 1)) break;
2415
+ }
2416
+ return h ? u = e.push("ordered_list_close", "ol", -1) : u = e.push("bullet_list_close", "ul", -1), u.markup = String.fromCharCode(a), g[1] = l, e.line = l, e.parentType = m, c && fr(e, b), !0;
2417
+ }
2418
+ function dr(e, n, t, o) {
2419
+ let r = e.bMarks[n] + e.tShift[n], i = e.eMarks[n], s = n + 1;
2420
+ if (e.sCount[n] - e.blkIndent >= 4 || e.src.charCodeAt(r) !== 91) return !1;
2421
+ function u(d) {
2422
+ const k = e.lineMax;
2423
+ if (d >= k || e.isEmpty(d)) return null;
2424
+ let D = !1;
2425
+ if (e.sCount[d] - e.blkIndent > 3 && (D = !0), e.sCount[d] < 0 && (D = !0), !D) {
2426
+ const v = e.md.block.ruler.getRules("reference"), F = e.parentType;
2427
+ e.parentType = "reference";
2428
+ let w = !1;
2429
+ for (let y = 0, J = v.length; y < J; y++) if (v[y](e, d, k, !0)) {
2430
+ w = !0;
2431
+ break;
2432
+ }
2433
+ if (e.parentType = F, w) return null;
2434
+ }
2435
+ const A = e.bMarks[d] + e.tShift[d], B = e.eMarks[d];
2436
+ return e.src.slice(A, B + 1);
2437
+ }
2438
+ let l = e.src.slice(r, i + 1);
2439
+ i = l.length;
2440
+ let c = -1;
2441
+ for (r = 1; r < i; r++) {
2442
+ const d = l.charCodeAt(r);
2443
+ if (d === 91) return !1;
2444
+ if (d === 93) {
2445
+ c = r;
2446
+ break;
2447
+ } else if (d === 10) {
2448
+ const k = u(s);
2449
+ k !== null && (l += k, i = l.length, s++);
2450
+ } else if (d === 92 && (r++, r < i && l.charCodeAt(r) === 10)) {
2451
+ const k = u(s);
2452
+ k !== null && (l += k, i = l.length, s++);
2453
+ }
2454
+ }
2455
+ if (c < 0 || l.charCodeAt(c + 1) !== 58) return !1;
2456
+ for (r = c + 2; r < i; r++) {
2457
+ const d = l.charCodeAt(r);
2458
+ if (d === 10) {
2459
+ const k = u(s);
2460
+ k !== null && (l += k, i = l.length, s++);
2461
+ } else if (!E(d)) break;
2462
+ }
2463
+ const f = e.md.helpers.parseLinkDestination(l, r, i);
2464
+ if (!f.ok) return !1;
2465
+ const h = e.md.normalizeLink(f.str);
2466
+ if (!e.md.validateLink(h)) return !1;
2467
+ r = f.pos;
2468
+ const _ = r, p = s, a = r;
2469
+ for (; r < i; r++) {
2470
+ const d = l.charCodeAt(r);
2471
+ if (d === 10) {
2472
+ const k = u(s);
2473
+ k !== null && (l += k, i = l.length, s++);
2474
+ } else if (!E(d)) break;
2475
+ }
2476
+ let b = e.md.helpers.parseLinkTitle(l, r, i);
2477
+ for (; b.can_continue; ) {
2478
+ const d = u(s);
2479
+ if (d === null) break;
2480
+ l += d, r = i, i = l.length, s++, b = e.md.helpers.parseLinkTitle(l, r, i, b);
2481
+ }
2482
+ let g;
2483
+ for (r < i && a !== r && b.ok ? (g = b.str, r = b.pos) : (g = "", r = _, s = p); r < i && E(l.charCodeAt(r)); )
2484
+ r++;
2485
+ if (r < i && l.charCodeAt(r) !== 10 && g)
2486
+ for (g = "", r = _, s = p; r < i && E(l.charCodeAt(r)); )
2487
+ r++;
2488
+ if (r < i && l.charCodeAt(r) !== 10) return !1;
2489
+ const C = ue(l.slice(1, c));
2490
+ if (!C) return !1;
2491
+ if (o) return !0;
2492
+ typeof e.env.references > "u" && (e.env.references = {}), typeof e.env.references[C] > "u" && (e.env.references[C] = {
2493
+ title: g,
2494
+ href: h
2495
+ });
2496
+ const x = e.push("reference_definition", "", 0);
2497
+ x.map = [n, s], x.hidden = !0;
2498
+ const m = /* @__PURE__ */ Object.create(null);
2499
+ return m.label = C, x.meta = m, e.line = s, !0;
2500
+ }
2501
+ var _r = [
2502
+ "address",
2503
+ "article",
2504
+ "aside",
2505
+ "base",
2506
+ "basefont",
2507
+ "blockquote",
2508
+ "body",
2509
+ "caption",
2510
+ "center",
2511
+ "col",
2512
+ "colgroup",
2513
+ "dd",
2514
+ "details",
2515
+ "dialog",
2516
+ "dir",
2517
+ "div",
2518
+ "dl",
2519
+ "dt",
2520
+ "fieldset",
2521
+ "figcaption",
2522
+ "figure",
2523
+ "footer",
2524
+ "form",
2525
+ "frame",
2526
+ "frameset",
2527
+ "h1",
2528
+ "h2",
2529
+ "h3",
2530
+ "h4",
2531
+ "h5",
2532
+ "h6",
2533
+ "head",
2534
+ "header",
2535
+ "hr",
2536
+ "html",
2537
+ "iframe",
2538
+ "legend",
2539
+ "li",
2540
+ "link",
2541
+ "main",
2542
+ "menu",
2543
+ "menuitem",
2544
+ "nav",
2545
+ "noframes",
2546
+ "ol",
2547
+ "optgroup",
2548
+ "option",
2549
+ "p",
2550
+ "param",
2551
+ "search",
2552
+ "section",
2553
+ "summary",
2554
+ "table",
2555
+ "tbody",
2556
+ "td",
2557
+ "tfoot",
2558
+ "th",
2559
+ "thead",
2560
+ "title",
2561
+ "tr",
2562
+ "track",
2563
+ "ul"
2564
+ ], mn = `<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`, Rn = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>", gr = new RegExp(`^(?:${mn}|${Rn}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`), kr = new RegExp(`^(?:${mn}|${Rn})`), Z = [
2565
+ [
2566
+ /^<(script|pre|style|textarea)(?=(\s|>|$))/i,
2567
+ /<\/(script|pre|style|textarea)>/i,
2568
+ !0
2569
+ ],
2570
+ [
2571
+ /^<!--/,
2572
+ /-->/,
2573
+ !0
2574
+ ],
2575
+ [
2576
+ /^<\?/,
2577
+ /\?>/,
2578
+ !0
2579
+ ],
2580
+ [
2581
+ /^<![A-Za-z]/,
2582
+ />/,
2583
+ !0
2584
+ ],
2585
+ [
2586
+ /^<!\[CDATA\[/,
2587
+ /\]\]>/,
2588
+ !0
2589
+ ],
2590
+ [
2591
+ new RegExp(`^</?(${_r.join("|")})(?=(\\s|/?>|$))`, "i"),
2592
+ /^$/,
2593
+ !0
2594
+ ],
2595
+ [
2596
+ new RegExp(`${kr.source}\\s*$`),
2597
+ /^$/,
2598
+ !1
2599
+ ]
2600
+ ];
2601
+ function mr(e, n, t, o) {
2602
+ let r = e.bMarks[n] + e.tShift[n], i = e.eMarks[n];
2603
+ if (e.sCount[n] - e.blkIndent >= 4 || !e.md.options.html || e.src.charCodeAt(r) !== 60) return !1;
2604
+ let s = e.src.slice(r, i), u = 0;
2605
+ for (; u < Z.length && !Z[u][0].test(s); u++) ;
2606
+ if (u === Z.length) return !1;
2607
+ if (o) return Z[u][2];
2608
+ let l = n + 1;
2609
+ const c = Z[u][1].test("");
2610
+ if (!Z[u][1].test(s)) {
2611
+ for (; l < t && !(e.sCount[l] < e.blkIndent && (c || !e.isEmpty(l))); l++)
2612
+ if (r = e.bMarks[l] + e.tShift[l], i = e.eMarks[l], s = e.src.slice(r, i), Z[u][1].test(s)) {
2613
+ s.length !== 0 && l++;
2614
+ break;
2615
+ }
2616
+ }
2617
+ e.line = l;
2618
+ const f = e.push("html_block", "", 0);
2619
+ return f.map = [n, l], f.content = e.getLines(n, l, e.blkIndent, !0), !0;
2620
+ }
2621
+ function Rr(e, n, t, o) {
2622
+ let r = e.bMarks[n] + e.tShift[n], i = e.eMarks[n];
2623
+ if (e.sCount[n] - e.blkIndent >= 4) return !1;
2624
+ let s = e.src.charCodeAt(r);
2625
+ if (s !== 35 || r >= i) return !1;
2626
+ let u = 1;
2627
+ for (s = e.src.charCodeAt(++r); s === 35 && r < i && u <= 6; )
2628
+ u++, s = e.src.charCodeAt(++r);
2629
+ if (u > 6 || r < i && !E(s)) return !1;
2630
+ if (o) return !0;
2631
+ i = e.skipSpacesBack(i, r);
2632
+ const l = e.skipCharsBack(i, 35, r);
2633
+ l > r && E(e.src.charCodeAt(l - 1)) && (i = l), e.line = n + 1;
2634
+ const c = e.push("heading_open", `h${u}`, 1);
2635
+ c.markup = "########".slice(0, u), c.map = [n, e.line];
2636
+ const f = e.push("inline", "", 0);
2637
+ f.content = le(e.src.slice(r, i)), f.map = [n, e.line], f.children = [];
2638
+ const h = e.push("heading_close", `h${u}`, -1);
2639
+ return h.markup = "########".slice(0, u), !0;
2640
+ }
2641
+ function br(e, n, t) {
2642
+ const o = e.md.block.ruler.getRules("paragraph");
2643
+ if (e.sCount[n] - e.blkIndent >= 4) return !1;
2644
+ const r = e.parentType;
2645
+ e.parentType = "paragraph";
2646
+ let i = 0, s, u = n + 1;
2647
+ for (; u < t && !e.isEmpty(u); u++) {
2648
+ if (e.sCount[u] - e.blkIndent > 3) continue;
2649
+ if (e.sCount[u] >= e.blkIndent) {
2650
+ let p = e.bMarks[u] + e.tShift[u];
2651
+ const a = e.eMarks[u];
2652
+ if (p < a && (s = e.src.charCodeAt(p), (s === 45 || s === 61) && (p = e.skipChars(p, s), p = e.skipSpaces(p), p >= a))) {
2653
+ i = s === 61 ? 1 : 2;
2654
+ break;
2655
+ }
2656
+ }
2657
+ if (e.sCount[u] < 0) continue;
2658
+ let _ = !1;
2659
+ for (let p = 0, a = o.length; p < a; p++) if (o[p](e, u, t, !0)) {
2660
+ _ = !0;
2661
+ break;
2662
+ }
2663
+ if (_) break;
2664
+ }
2665
+ if (!i)
2666
+ return e.parentType = r, !1;
2667
+ const l = le(e.getLines(n, u, e.blkIndent, !1));
2668
+ e.line = u + 1;
2669
+ const c = e.push("heading_open", `h${i}`, 1);
2670
+ c.markup = String.fromCharCode(s), c.map = [n, e.line];
2671
+ const f = e.push("inline", "", 0);
2672
+ f.content = l, f.map = [n, e.line - 1], f.children = [];
2673
+ const h = e.push("heading_close", `h${i}`, -1);
2674
+ return h.markup = String.fromCharCode(s), e.parentType = r, !0;
2675
+ }
2676
+ function xr(e, n, t) {
2677
+ const o = e.md.block.ruler.getRules("paragraph"), r = e.parentType;
2678
+ let i = n + 1;
2679
+ for (e.parentType = "paragraph"; i < t && !e.isEmpty(i); i++) {
2680
+ if (e.sCount[i] - e.blkIndent > 3 || e.sCount[i] < 0) continue;
2681
+ let c = !1;
2682
+ for (let f = 0, h = o.length; f < h; f++) if (o[f](e, i, t, !0)) {
2683
+ c = !0;
2684
+ break;
2685
+ }
2686
+ if (c) break;
2687
+ }
2688
+ const s = le(e.getLines(n, i, e.blkIndent, !1));
2689
+ e.line = i;
2690
+ const u = e.push("paragraph_open", "p", 1);
2691
+ u.map = [n, e.line];
2692
+ const l = e.push("inline", "", 0);
2693
+ return l.content = s, l.map = [n, e.line], l.children = [], e.push("paragraph_close", "p", -1), e.parentType = r, !0;
2694
+ }
2695
+ var ie = [
2696
+ [
2697
+ "table",
2698
+ ur,
2699
+ ["paragraph", "reference"]
2700
+ ],
2701
+ ["code", lr],
2702
+ [
2703
+ "fence",
2704
+ cr,
2705
+ [
2706
+ "paragraph",
2707
+ "reference",
2708
+ "blockquote",
2709
+ "list"
2710
+ ]
2711
+ ],
2712
+ [
2713
+ "blockquote",
2714
+ ar,
2715
+ [
2716
+ "paragraph",
2717
+ "reference",
2718
+ "blockquote",
2719
+ "list"
2720
+ ]
2721
+ ],
2722
+ [
2723
+ "hr",
2724
+ hr,
2725
+ [
2726
+ "paragraph",
2727
+ "reference",
2728
+ "blockquote",
2729
+ "list"
2730
+ ]
2731
+ ],
2732
+ [
2733
+ "list",
2734
+ pr,
2735
+ [
2736
+ "paragraph",
2737
+ "reference",
2738
+ "blockquote"
2739
+ ]
2740
+ ],
2741
+ ["reference", dr],
2742
+ [
2743
+ "html_block",
2744
+ mr,
2745
+ [
2746
+ "paragraph",
2747
+ "reference",
2748
+ "blockquote"
2749
+ ]
2750
+ ],
2751
+ [
2752
+ "heading",
2753
+ Rr,
2754
+ [
2755
+ "paragraph",
2756
+ "reference",
2757
+ "blockquote"
2758
+ ]
2759
+ ],
2760
+ ["lheading", br],
2761
+ ["paragraph", xr]
2762
+ ], bn = class {
2763
+ constructor() {
2764
+ R(
2765
+ this,
2766
+ /**
2767
+ * {@link Ruler} instance. Keep configuration of block rules.
2768
+ */
2769
+ "ruler",
2770
+ new te()
2771
+ ), R(this, "State", kn);
2772
+ for (let e = 0; e < ie.length; e++) this.ruler.push(ie[e][0], ie[e][1], { alt: (ie[e][2] || []).slice() });
2773
+ }
2774
+ tokenize(e, n, t) {
2775
+ const o = this.ruler.getRules(""), r = o.length, i = e.md.options.maxNesting;
2776
+ let s = n, u = !1;
2777
+ for (; s < t && (e.line = s = e.skipEmptyLines(s), !(s >= t || e.sCount[s] < e.blkIndent)); ) {
2778
+ if (e.level >= i) {
2779
+ e.line = t;
2780
+ break;
2781
+ }
2782
+ const l = e.line;
2783
+ let c = !1;
2784
+ for (let f = 0; f < r; f++)
2785
+ if (c = o[f](e, s, t, !1), c) {
2786
+ if (l >= e.line) throw new Error("block rule didn't increment state.line");
2787
+ break;
2788
+ }
2789
+ if (!c) throw new Error("none of the block rules matched");
2790
+ e.tight = !u, e.isEmpty(e.line - 1) && (u = !0), s = e.line, s < t && e.isEmpty(s) && (u = !0, s++, e.line = s);
2791
+ }
2792
+ }
2793
+ /**
2794
+ * Process input string and push block tokens into `outTokens`
2795
+ */
2796
+ parse(e, n, t, o) {
2797
+ if (!e) return;
2798
+ const r = new this.State(e, n, t, o);
2799
+ this.tokenize(r, r.line, r.lineMax);
2800
+ }
2801
+ }, xn = class {
2802
+ constructor(e, n, t, o) {
2803
+ R(this, "pos", 0), R(this, "level", 0), R(this, "pending", ""), R(this, "pendingLevel", 0), R(this, "cache", {}), R(this, "backticks", {}), R(this, "backticksScanned", !1), R(this, "linkLevel", 0), R(this, "delimiters", []), R(this, "_prev_delimiters", []), R(this, "Token", W), this.src = e, this.env = t, this.md = n, this.tokens = o, this.tokens_meta = Array(o.length), this.posMax = this.src.length;
2804
+ }
2805
+ pushPending() {
2806
+ const e = new W("text", "", 0);
2807
+ return e.content = this.pending, e.level = this.pendingLevel, this.tokens.push(e), this.pending = "", e;
2808
+ }
2809
+ push(e, n, t) {
2810
+ this.pending && this.pushPending();
2811
+ const o = new W(e, n, t);
2812
+ let r;
2813
+ return t < 0 && (this.level--, this.delimiters = this._prev_delimiters.pop()), o.level = this.level, t > 0 && (this.level++, this._prev_delimiters.push(this.delimiters), this.delimiters = [], r = { delimiters: this.delimiters }), this.pendingLevel = this.level, this.tokens.push(o), this.tokens_meta.push(r), o;
2814
+ }
2815
+ scanDelims(e, n) {
2816
+ const t = this.posMax, o = this.src.charCodeAt(e);
2817
+ let r;
2818
+ if (e === 0) r = 32;
2819
+ else if (e === 1)
2820
+ r = this.src.charCodeAt(0), (r & 63488) === 55296 && (r = 65533);
2821
+ else if (r = this.src.charCodeAt(e - 1), (r & 64512) === 56320) {
2822
+ const a = this.src.charCodeAt(e - 2);
2823
+ r = (a & 64512) === 55296 ? 65536 + (a - 55296 << 10) + (r - 56320) : 65533;
2824
+ } else (r & 64512) === 55296 && (r = 65533);
2825
+ let i = e;
2826
+ for (; i < t && this.src.charCodeAt(i) === o; ) i++;
2827
+ const s = i - e;
2828
+ let u = i < t ? this.src.charCodeAt(i) : 32;
2829
+ if ((u & 64512) === 55296) {
2830
+ const a = this.src.charCodeAt(i + 1);
2831
+ u = (a & 64512) === 56320 ? 65536 + (u - 55296 << 10) + (a - 56320) : 65533;
2832
+ } else (u & 64512) === 56320 && (u = 65533);
2833
+ const l = ee(r) || Q(r), c = ee(u) || Q(u), f = V(r), h = V(u), _ = !h && (!c || f || l), p = !f && (!l || h || c);
2834
+ return {
2835
+ can_open: _ && (n || !p || l),
2836
+ can_close: p && (n || !_ || c),
2837
+ length: s
2838
+ };
2839
+ }
2840
+ };
2841
+ function Cr(e) {
2842
+ switch (e) {
2843
+ case 10:
2844
+ case 33:
2845
+ case 35:
2846
+ case 36:
2847
+ case 37:
2848
+ case 38:
2849
+ case 42:
2850
+ case 43:
2851
+ case 45:
2852
+ case 58:
2853
+ case 60:
2854
+ case 61:
2855
+ case 62:
2856
+ case 64:
2857
+ case 91:
2858
+ case 92:
2859
+ case 93:
2860
+ case 94:
2861
+ case 95:
2862
+ case 96:
2863
+ case 123:
2864
+ case 125:
2865
+ case 126:
2866
+ return !0;
2867
+ default:
2868
+ return !1;
2869
+ }
2870
+ }
2871
+ function Dr(e, n) {
2872
+ let t = e.pos;
2873
+ for (; t < e.posMax && !Cr(e.src.charCodeAt(t)); ) t++;
2874
+ return t === e.pos ? !1 : (n || (e.pending += e.src.slice(e.pos, t)), e.pos = t, !0);
2875
+ }
2876
+ function vr(e) {
2877
+ return e >= 65 && e <= 90 || e >= 97 && e <= 122;
2878
+ }
2879
+ function wr(e) {
2880
+ return e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 48 && e <= 57 || e === 43 || e === 45 || e === 46;
2881
+ }
2882
+ function Ar(e, n) {
2883
+ if (!e.md.options.linkify || e.linkLevel > 0) return !1;
2884
+ const t = e.pos, o = e.posMax;
2885
+ if (t + 3 > o || e.src.charCodeAt(t) !== 58 || e.src.charCodeAt(t + 1) !== 47 || e.src.charCodeAt(t + 2) !== 47) return !1;
2886
+ const r = t - Math.min(10, e.pending.length, t);
2887
+ let i = t;
2888
+ for (; i > r && wr(e.src.charCodeAt(i - 1)); ) i--;
2889
+ if (i === t || !vr(e.src.charCodeAt(i))) return !1;
2890
+ const s = t - i, u = e.md.linkify.matchAtStart(e.src.slice(i));
2891
+ if (!u) return !1;
2892
+ let l = u.url;
2893
+ if (l.length <= s) return !1;
2894
+ let c = l.length;
2895
+ for (; c > 0 && l.charCodeAt(c - 1) === 42; ) c--;
2896
+ c !== l.length && (l = l.slice(0, c));
2897
+ const f = e.md.normalizeLink(l);
2898
+ if (!e.md.validateLink(f)) return !1;
2899
+ if (!n) {
2900
+ e.pending = e.pending.slice(0, -s);
2901
+ const h = e.push("link_open", "a", 1);
2902
+ h.attrs = [["href", f]], h.markup = "linkify", h.info = "auto";
2903
+ const _ = e.push("text", "", 0);
2904
+ _.content = e.md.normalizeLinkText(l);
2905
+ const p = e.push("link_close", "a", -1);
2906
+ p.markup = "linkify", p.info = "auto";
2907
+ }
2908
+ return e.pos += l.length - s, !0;
2909
+ }
2910
+ function Er(e, n) {
2911
+ let t = e.pos;
2912
+ if (e.src.charCodeAt(t) !== 10) return !1;
2913
+ const o = e.pending.length - 1, r = e.posMax;
2914
+ if (!n) if (o >= 0 && e.pending.charCodeAt(o) === 32) if (o >= 1 && e.pending.charCodeAt(o - 1) === 32) {
2915
+ let i = o - 1;
2916
+ for (; i >= 1 && e.pending.charCodeAt(i - 1) === 32; ) i--;
2917
+ e.pending = e.pending.slice(0, i), e.push("hardbreak", "br", 0);
2918
+ } else
2919
+ e.pending = e.pending.slice(0, -1), e.push("softbreak", "br", 0);
2920
+ else e.push("softbreak", "br", 0);
2921
+ for (t++; t < r && E(e.src.charCodeAt(t)); ) t++;
2922
+ return e.pos = t, !0;
2923
+ }
2924
+ var Ce = [];
2925
+ for (let e = 0; e < 256; e++) Ce.push(0);
2926
+ "\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e) {
2927
+ Ce[e.charCodeAt(0)] = 1;
2928
+ });
2929
+ function Fr(e, n) {
2930
+ let t = e.pos;
2931
+ const o = e.posMax;
2932
+ if (e.src.charCodeAt(t) !== 92 || (t++, t >= o)) return !1;
2933
+ let r = e.src.charCodeAt(t);
2934
+ if (r === 10) {
2935
+ for (n || e.push("hardbreak", "br", 0), t++; t < o && (r = e.src.charCodeAt(t), !!E(r)); )
2936
+ t++;
2937
+ return e.pos = t, !0;
2938
+ }
2939
+ if (r === 32) {
2940
+ if (!n) {
2941
+ const u = e.push("text_special", "", 0);
2942
+ u.content = "\\", u.markup = "\\", u.info = "escape";
2943
+ }
2944
+ return e.pos = t, !0;
2945
+ }
2946
+ let i = e.src[t];
2947
+ if (r >= 55296 && r <= 56319 && t + 1 < o) {
2948
+ const u = e.src.charCodeAt(t + 1);
2949
+ u >= 56320 && u <= 57343 && (i += e.src[t + 1], t++);
2950
+ }
2951
+ const s = "\\" + i;
2952
+ if (!n) {
2953
+ const u = e.push("text_special", "", 0);
2954
+ r < 256 && Ce[r] !== 0 ? u.content = i : u.content = s, u.markup = s, u.info = "escape";
2955
+ }
2956
+ return e.pos = t + 1, !0;
2957
+ }
2958
+ function yr(e) {
2959
+ const n = {};
2960
+ let t = 0;
2961
+ for (; (t = e.indexOf("`", t)) !== -1; ) {
2962
+ const o = t;
2963
+ for (; e.charCodeAt(++t) === 96; ) ;
2964
+ n[t - o] = o;
2965
+ }
2966
+ return n;
2967
+ }
2968
+ function Br(e, n) {
2969
+ var t;
2970
+ const o = e.pos;
2971
+ if (e.src.charCodeAt(o) !== 96) return !1;
2972
+ const r = e.posMax;
2973
+ let i = o + 1;
2974
+ for (; i < r && e.src.charCodeAt(i) === 96; ) i++;
2975
+ const s = e.src.slice(o, i), u = s.length;
2976
+ if (e.backticksScanned || (e.backticks = yr(e.src), e.backticksScanned = !0), ((t = e.backticks[u]) !== null && t !== void 0 ? t : -1) >= i) {
2977
+ let l = i, c;
2978
+ for (; (c = e.src.indexOf("`", l)) !== -1 && c < r; ) {
2979
+ for (l = c + 1; e.src.charCodeAt(l) === 96; ) l++;
2980
+ if (l > r) break;
2981
+ if (l - c === u) {
2982
+ if (!n) {
2983
+ const f = e.push("code_inline", "code", 0);
2984
+ f.markup = s;
2985
+ let h = e.src.slice(i, c).replace(/\n/g, " ");
2986
+ h.startsWith(" ") && h.endsWith(" ") && /[^ ]/.test(h) && (h = h.slice(1, -1)), f.content = h;
2987
+ }
2988
+ return e.pos = l, !0;
2989
+ }
2990
+ }
2991
+ }
2992
+ return n || (e.pending += s), e.pos = i, !0;
2993
+ }
2994
+ function Tr(e, n) {
2995
+ const t = e.pos, o = e.src.charCodeAt(t);
2996
+ if (n || o !== 126) return !1;
2997
+ const r = e.scanDelims(e.pos, !0);
2998
+ let i = r.length;
2999
+ const s = String.fromCharCode(o);
3000
+ if (i < 2) return !1;
3001
+ let u;
3002
+ i % 2 && (u = e.push("text", "", 0), u.content = s, i--);
3003
+ for (let l = 0; l < i; l += 2)
3004
+ u = e.push("text", "", 0), u.content = s + s, e.delimiters.push({
3005
+ marker: o,
3006
+ length: 0,
3007
+ token: e.tokens.length - 1,
3008
+ end: -1,
3009
+ open: r.can_open,
3010
+ close: r.can_close
3011
+ });
3012
+ return e.pos += r.length, !0;
3013
+ }
3014
+ function Oe(e, n) {
3015
+ let t;
3016
+ const o = [], r = n.length;
3017
+ for (let i = 0; i < r; i++) {
3018
+ const s = n[i];
3019
+ if (s.marker !== 126 || s.end === -1) continue;
3020
+ const u = n[s.end];
3021
+ t = e.tokens[s.token], t.type = "s_open", t.tag = "s", t.nesting = 1, t.markup = "~~", t.content = "", t = e.tokens[u.token], t.type = "s_close", t.tag = "s", t.nesting = -1, t.markup = "~~", t.content = "", e.tokens[u.token - 1].type === "text" && e.tokens[u.token - 1].content === "~" && o.push(u.token - 1);
3022
+ }
3023
+ for (; o.length; ) {
3024
+ const i = o.pop();
3025
+ let s = i + 1;
3026
+ for (; s < e.tokens.length && e.tokens[s].type === "s_close"; ) s++;
3027
+ s--, i !== s && (t = e.tokens[s], e.tokens[s] = e.tokens[i], e.tokens[i] = t);
3028
+ }
3029
+ }
3030
+ function zr(e) {
3031
+ const n = e.tokens_meta, t = e.tokens_meta.length;
3032
+ Oe(e, e.delimiters);
3033
+ for (let r = 0; r < t; r++) {
3034
+ var o;
3035
+ const i = (o = n[r]) === null || o === void 0 ? void 0 : o.delimiters;
3036
+ i && Oe(e, i);
3037
+ }
3038
+ }
3039
+ var Cn = {
3040
+ tokenize: Tr,
3041
+ postProcess: zr
3042
+ };
3043
+ function Sr(e, n) {
3044
+ const t = e.pos, o = e.src.charCodeAt(t);
3045
+ if (n || o !== 95 && o !== 42) return !1;
3046
+ const r = e.scanDelims(e.pos, o === 42);
3047
+ for (let i = 0; i < r.length; i++) {
3048
+ const s = e.push("text", "", 0);
3049
+ s.content = String.fromCharCode(o), e.delimiters.push({
3050
+ marker: o,
3051
+ length: r.length,
3052
+ token: e.tokens.length - 1,
3053
+ end: -1,
3054
+ open: r.can_open,
3055
+ close: r.can_close
3056
+ });
3057
+ }
3058
+ return e.pos += r.length, !0;
3059
+ }
3060
+ function Ue(e, n) {
3061
+ const t = n.length;
3062
+ for (let o = t - 1; o >= 0; o--) {
3063
+ const r = n[o];
3064
+ if (r.marker !== 95 && r.marker !== 42 || r.end === -1) continue;
3065
+ const i = n[r.end], s = o > 0 && n[o - 1].end === r.end + 1 && n[o - 1].marker === r.marker && n[o - 1].token === r.token - 1 && n[r.end + 1].token === i.token + 1, u = String.fromCharCode(r.marker), l = e.tokens[r.token];
3066
+ l.type = s ? "strong_open" : "em_open", l.tag = s ? "strong" : "em", l.nesting = 1, l.markup = s ? u + u : u, l.content = "";
3067
+ const c = e.tokens[i.token];
3068
+ c.type = s ? "strong_close" : "em_close", c.tag = s ? "strong" : "em", c.nesting = -1, c.markup = s ? u + u : u, c.content = "", s && (e.tokens[n[o - 1].token].content = "", e.tokens[n[r.end + 1].token].content = "", o--);
3069
+ }
3070
+ }
3071
+ function jr(e) {
3072
+ const n = e.tokens_meta, t = e.tokens_meta.length;
3073
+ Ue(e, e.delimiters);
3074
+ for (let r = 0; r < t; r++) {
3075
+ var o;
3076
+ const i = (o = n[r]) === null || o === void 0 ? void 0 : o.delimiters;
3077
+ i && Ue(e, i);
3078
+ }
3079
+ }
3080
+ var Dn = {
3081
+ tokenize: Sr,
3082
+ postProcess: jr
3083
+ };
3084
+ function Jr(e, n) {
3085
+ let t, o, r, i, s = "", u = "", l = e.pos, c = !0;
3086
+ if (e.src.charCodeAt(e.pos) !== 91) return !1;
3087
+ const f = e.pos, h = e.posMax, _ = e.pos + 1, p = e.md.helpers.parseLinkLabel(e, e.pos, !0);
3088
+ if (p < 0) return !1;
3089
+ let a = p + 1;
3090
+ if (a < h && e.src.charCodeAt(a) === 40) {
3091
+ for (c = !1, a++; a < h && (t = e.src.charCodeAt(a), !(!E(t) && t !== 10)); a++)
3092
+ ;
3093
+ if (a >= h) return !1;
3094
+ if (l = a, r = e.md.helpers.parseLinkDestination(e.src, a, e.posMax), r.ok) {
3095
+ for (s = e.md.normalizeLink(r.str), e.md.validateLink(s) ? a = r.pos : s = "", l = a; a < h && (t = e.src.charCodeAt(a), !(!E(t) && t !== 10)); a++)
3096
+ ;
3097
+ if (r = e.md.helpers.parseLinkTitle(e.src, a, e.posMax), a < h && l !== a && r.ok)
3098
+ for (u = r.str, a = r.pos; a < h && (t = e.src.charCodeAt(a), !(!E(t) && t !== 10)); a++)
3099
+ ;
3100
+ }
3101
+ (a >= h || e.src.charCodeAt(a) !== 41) && (c = !0), a++;
3102
+ }
3103
+ if (c) {
3104
+ if (typeof e.env.references > "u") return !1;
3105
+ if (a < h && e.src.charCodeAt(a) === 91 ? (l = a + 1, a = e.md.helpers.parseLinkLabel(e, a), a >= 0 ? o = e.src.slice(l, a++) : a = p + 1) : a = p + 1, o || (o = e.src.slice(_, p)), o = ue(o), i = e.env.references[o], !i)
3106
+ return e.pos = f, !1;
3107
+ s = i.href, u = i.title;
3108
+ }
3109
+ if (!n) {
3110
+ e.pos = _, e.posMax = p;
3111
+ const b = e.push("link_open", "a", 1), g = [["href", s]];
3112
+ if (b.attrs = g, u && g.push(["title", u]), o) {
3113
+ const C = /* @__PURE__ */ Object.create(null);
3114
+ C.label = o, b.meta = C;
3115
+ }
3116
+ e.linkLevel++, e.md.inline.tokenize(e), e.linkLevel--, e.push("link_close", "a", -1);
3117
+ }
3118
+ return e.pos = a, e.posMax = h, !0;
3119
+ }
3120
+ function Ir(e, n) {
3121
+ let t, o, r, i, s, u, l, c, f = "";
3122
+ const h = e.pos, _ = e.posMax;
3123
+ if (e.src.charCodeAt(e.pos) !== 33 || e.src.charCodeAt(e.pos + 1) !== 91) return !1;
3124
+ const p = e.pos + 2, a = e.md.helpers.parseLinkLabel(e, e.pos + 1, !1);
3125
+ if (a < 0) return !1;
3126
+ if (i = a + 1, i < _ && e.src.charCodeAt(i) === 40) {
3127
+ for (i++; i < _ && (t = e.src.charCodeAt(i), !(!E(t) && t !== 10)); i++)
3128
+ ;
3129
+ if (i >= _) return !1;
3130
+ for (c = i, u = e.md.helpers.parseLinkDestination(e.src, i, e.posMax), u.ok && (f = e.md.normalizeLink(u.str), e.md.validateLink(f) ? i = u.pos : f = ""), c = i; i < _ && (t = e.src.charCodeAt(i), !(!E(t) && t !== 10)); i++)
3131
+ ;
3132
+ if (u = e.md.helpers.parseLinkTitle(e.src, i, e.posMax), i < _ && c !== i && u.ok)
3133
+ for (l = u.str, i = u.pos; i < _ && (t = e.src.charCodeAt(i), !(!E(t) && t !== 10)); i++)
3134
+ ;
3135
+ else l = "";
3136
+ if (i >= _ || e.src.charCodeAt(i) !== 41)
3137
+ return e.pos = h, !1;
3138
+ i++;
3139
+ } else {
3140
+ if (typeof e.env.references > "u") return !1;
3141
+ if (i < _ && e.src.charCodeAt(i) === 91 ? (c = i + 1, i = e.md.helpers.parseLinkLabel(e, i), i >= 0 ? r = e.src.slice(c, i++) : i = a + 1) : i = a + 1, r || (r = e.src.slice(p, a)), r = ue(r), s = e.env.references[r], !s)
3142
+ return e.pos = h, !1;
3143
+ f = s.href, l = s.title;
3144
+ }
3145
+ if (!n) {
3146
+ o = e.src.slice(p, a);
3147
+ const b = [];
3148
+ e.md.inline.parse(o, e.md, e.env, b);
3149
+ const g = e.push("image", "img", 0), C = [["src", f], ["alt", ""]];
3150
+ if (g.attrs = C, g.children = b, g.content = o, l && C.push(["title", l]), r) {
3151
+ const x = /* @__PURE__ */ Object.create(null);
3152
+ x.label = r, g.meta = x;
3153
+ }
3154
+ }
3155
+ return e.pos = i, e.posMax = _, !0;
3156
+ }
3157
+ var Mr = /^([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])?)*)$/, Pr = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;
3158
+ function Lr(e, n) {
3159
+ let t = e.pos;
3160
+ if (e.src.charCodeAt(t) !== 60) return !1;
3161
+ const o = e.pos, r = e.posMax;
3162
+ for (; ; ) {
3163
+ if (++t >= r) return !1;
3164
+ const s = e.src.charCodeAt(t);
3165
+ if (s === 60) return !1;
3166
+ if (s === 62) break;
3167
+ }
3168
+ const i = e.src.slice(o + 1, t);
3169
+ if (Pr.test(i)) {
3170
+ const s = e.md.normalizeLink(i);
3171
+ if (!e.md.validateLink(s)) return !1;
3172
+ if (!n) {
3173
+ const u = e.push("link_open", "a", 1);
3174
+ u.attrs = [["href", s]], u.markup = "autolink", u.info = "auto";
3175
+ const l = e.push("text", "", 0);
3176
+ l.content = e.md.normalizeLinkText(i);
3177
+ const c = e.push("link_close", "a", -1);
3178
+ c.markup = "autolink", c.info = "auto";
3179
+ }
3180
+ return e.pos += i.length + 2, !0;
3181
+ }
3182
+ if (Mr.test(i)) {
3183
+ const s = e.md.normalizeLink(`mailto:${i}`);
3184
+ if (!e.md.validateLink(s)) return !1;
3185
+ if (!n) {
3186
+ const u = e.push("link_open", "a", 1);
3187
+ u.attrs = [["href", s]], u.markup = "autolink", u.info = "auto";
3188
+ const l = e.push("text", "", 0);
3189
+ l.content = e.md.normalizeLinkText(i);
3190
+ const c = e.push("link_close", "a", -1);
3191
+ c.markup = "autolink", c.info = "auto";
3192
+ }
3193
+ return e.pos += i.length + 2, !0;
3194
+ }
3195
+ return !1;
3196
+ }
3197
+ function Nr(e) {
3198
+ return /^<a[>\s]/i.test(e);
3199
+ }
3200
+ function $r(e) {
3201
+ return /^<\/a\s*>/i.test(e);
3202
+ }
3203
+ function qr(e) {
3204
+ const n = e | 32;
3205
+ return n >= 97 && n <= 122;
3206
+ }
3207
+ function Or(e, n) {
3208
+ if (!e.md.options.html) return !1;
3209
+ const t = e.posMax, o = e.pos;
3210
+ if (e.src.charCodeAt(o) !== 60 || o + 2 >= t) return !1;
3211
+ const r = e.src.charCodeAt(o + 1);
3212
+ if (r !== 33 && r !== 63 && r !== 47 && !qr(r)) return !1;
3213
+ const i = e.src.slice(o).match(gr);
3214
+ if (!i) return !1;
3215
+ if (!n) {
3216
+ const s = e.push("html_inline", "", 0);
3217
+ s.content = i[0], Nr(s.content) && e.linkLevel++, $r(s.content) && e.linkLevel--;
3218
+ }
3219
+ return e.pos += i[0].length, !0;
3220
+ }
3221
+ var Ur = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i, Zr = /^&([a-z][a-z0-9]{1,31});/i;
3222
+ function Wr(e, n) {
3223
+ const t = e.pos, o = e.posMax;
3224
+ if (e.src.charCodeAt(t) !== 38 || t + 1 >= o) return !1;
3225
+ if (e.src.charCodeAt(t + 1) === 35) {
3226
+ const r = e.src.slice(t).match(Ur);
3227
+ if (r) {
3228
+ if (!n) {
3229
+ const i = r[1][0].toLowerCase() === "x" ? parseInt(r[1].slice(1), 16) : parseInt(r[1], 10), s = e.push("text_special", "", 0);
3230
+ s.content = xe(i) ? G(i) : G(65533), s.markup = r[0], s.info = "entity";
3231
+ }
3232
+ return e.pos += r[0].length, !0;
3233
+ }
3234
+ } else {
3235
+ const r = e.src.slice(t).match(Zr);
3236
+ if (r) {
3237
+ const i = Qe(r[0]);
3238
+ if (i !== r[0]) {
3239
+ if (!n) {
3240
+ const s = e.push("text_special", "", 0);
3241
+ s.content = i, s.markup = r[0], s.info = "entity";
3242
+ }
3243
+ return e.pos += r[0].length, !0;
3244
+ }
3245
+ }
3246
+ }
3247
+ return !1;
3248
+ }
3249
+ function Ze(e) {
3250
+ const n = {}, t = e.length;
3251
+ if (!t) return;
3252
+ let o = 0, r = -2;
3253
+ const i = [];
3254
+ for (let s = 0; s < t; s++) {
3255
+ const u = e[s];
3256
+ if (i.push(0), (e[o].marker !== u.marker || r !== u.token - 1) && (o = s), r = u.token, u.length = u.length || 0, !u.close) continue;
3257
+ n.hasOwnProperty(u.marker) || (n[u.marker] = [
3258
+ -1,
3259
+ -1,
3260
+ -1,
3261
+ -1,
3262
+ -1,
3263
+ -1
3264
+ ]);
3265
+ const l = n[u.marker][(u.open ? 3 : 0) + u.length % 3];
3266
+ let c = o - i[o] - 1, f = c;
3267
+ for (; c > l; c -= i[c] + 1) {
3268
+ const h = e[c];
3269
+ if (h.marker === u.marker && h.open && h.end < 0) {
3270
+ let _ = !1;
3271
+ if ((h.close || u.open) && (h.length + u.length) % 3 === 0 && (h.length % 3 !== 0 || u.length % 3 !== 0) && (_ = !0), !_) {
3272
+ const p = c > 0 && !e[c - 1].open ? i[c - 1] + 1 : 0;
3273
+ i[s] = s - c + p, i[c] = p, u.open = !1, h.end = s, h.close = !1, f = -1, r = -2;
3274
+ break;
3275
+ }
3276
+ }
3277
+ }
3278
+ f !== -1 && (n[u.marker][(u.open ? 3 : 0) + (u.length || 0) % 3] = f);
3279
+ }
3280
+ }
3281
+ function Xr(e) {
3282
+ const n = e.tokens_meta, t = e.tokens_meta.length;
3283
+ Ze(e.delimiters);
3284
+ for (let r = 0; r < t; r++) {
3285
+ var o;
3286
+ const i = (o = n[r]) === null || o === void 0 ? void 0 : o.delimiters;
3287
+ i && Ze(i);
3288
+ }
3289
+ }
3290
+ function Yr(e) {
3291
+ let n, t, o = 0;
3292
+ const r = e.tokens, i = e.tokens.length;
3293
+ for (n = t = 0; n < i; n++)
3294
+ r[n].nesting < 0 && o--, r[n].level = o, r[n].nesting > 0 && o++, r[n].type === "text" && n + 1 < i && r[n + 1].type === "text" ? r[n + 1].content = r[n].content + r[n + 1].content : (n !== t && (r[t] = r[n]), t++);
3295
+ n !== t && (r.length = t);
3296
+ }
3297
+ var de = [
3298
+ ["text", Dr],
3299
+ ["linkify", Ar],
3300
+ ["newline", Er],
3301
+ ["escape", Fr],
3302
+ ["backticks", Br],
3303
+ ["strikethrough", Cn.tokenize],
3304
+ ["emphasis", Dn.tokenize],
3305
+ ["link", Jr],
3306
+ ["image", Ir],
3307
+ ["autolink", Lr],
3308
+ ["html_inline", Or],
3309
+ ["entity", Wr]
3310
+ ], _e = [
3311
+ ["balance_pairs", Xr],
3312
+ ["strikethrough", Cn.postProcess],
3313
+ ["emphasis", Dn.postProcess],
3314
+ ["fragments_join", Yr]
3315
+ ], vn = class {
3316
+ constructor() {
3317
+ R(
3318
+ this,
3319
+ /**
3320
+ * {@link Ruler} instance. Keep configuration of inline rules.
3321
+ */
3322
+ "ruler",
3323
+ new te()
3324
+ ), R(
3325
+ this,
3326
+ /**
3327
+ * {@link Ruler} instance. Second ruler used for post-processing
3328
+ * (e.g. in emphasis-like rules).
3329
+ */
3330
+ "ruler2",
3331
+ new te()
3332
+ ), R(this, "State", xn);
3333
+ for (let e = 0; e < de.length; e++) this.ruler.push(de[e][0], de[e][1]);
3334
+ for (let e = 0; e < _e.length; e++) this.ruler2.push(_e[e][0], _e[e][1]);
3335
+ }
3336
+ skipToken(e) {
3337
+ const n = e.pos, t = this.ruler.getRules(""), o = t.length, r = e.md.options.maxNesting, i = e.cache;
3338
+ if (typeof i[n] < "u") {
3339
+ e.pos = i[n];
3340
+ return;
3341
+ }
3342
+ let s = !1;
3343
+ if (e.level < r) {
3344
+ for (let u = 0; u < o; u++)
3345
+ if (e.level++, s = t[u](e, !0), e.level--, s) {
3346
+ if (n >= e.pos) throw new Error("inline rule didn't increment state.pos");
3347
+ break;
3348
+ }
3349
+ } else e.pos = e.posMax;
3350
+ s || e.pos++, i[n] = e.pos;
3351
+ }
3352
+ tokenize(e) {
3353
+ const n = this.ruler.getRules(""), t = n.length, o = e.posMax, r = e.md.options.maxNesting;
3354
+ for (; e.pos < o; ) {
3355
+ const i = e.pos;
3356
+ let s = !1;
3357
+ if (e.level < r) {
3358
+ for (let u = 0; u < t; u++)
3359
+ if (s = n[u](e, !1), s) {
3360
+ if (i >= e.pos) throw new Error("inline rule didn't increment state.pos");
3361
+ break;
3362
+ }
3363
+ }
3364
+ if (s) {
3365
+ if (e.pos >= o) break;
3366
+ continue;
3367
+ }
3368
+ e.pending += e.src[e.pos++];
3369
+ }
3370
+ e.pending && e.pushPending();
3371
+ }
3372
+ /**
3373
+ * Process input string and push inline tokens into `outTokens`
3374
+ */
3375
+ parse(e, n, t, o) {
3376
+ const r = new this.State(e, n, t, o);
3377
+ this.tokenize(r);
3378
+ const i = this.ruler2.getRules(""), s = i.length;
3379
+ for (let u = 0; u < s; u++) i[u](r);
3380
+ }
3381
+ }, Kr = {
3382
+ default: {
3383
+ options: {
3384
+ html: !1,
3385
+ xhtmlOut: !1,
3386
+ breaks: !1,
3387
+ langPrefix: "language-",
3388
+ linkify: !1,
3389
+ typographer: !1,
3390
+ quotes: "“”‘’",
3391
+ highlight: null,
3392
+ maxNesting: 100
3393
+ },
3394
+ components: {
3395
+ core: {},
3396
+ block: {},
3397
+ inline: {}
3398
+ }
3399
+ },
3400
+ zero: {
3401
+ options: {
3402
+ html: !1,
3403
+ xhtmlOut: !1,
3404
+ breaks: !1,
3405
+ langPrefix: "language-",
3406
+ linkify: !1,
3407
+ typographer: !1,
3408
+ quotes: "“”‘’",
3409
+ highlight: null,
3410
+ maxNesting: 20
3411
+ },
3412
+ components: {
3413
+ core: { rules: [
3414
+ "normalize",
3415
+ "block",
3416
+ "strip_references",
3417
+ "inline",
3418
+ "text_join"
3419
+ ] },
3420
+ block: { rules: ["paragraph"] },
3421
+ inline: {
3422
+ rules: ["text"],
3423
+ rules2: ["balance_pairs", "fragments_join"]
3424
+ }
3425
+ }
3426
+ },
3427
+ commonmark: {
3428
+ options: {
3429
+ html: !0,
3430
+ xhtmlOut: !0,
3431
+ breaks: !1,
3432
+ langPrefix: "language-",
3433
+ linkify: !1,
3434
+ typographer: !1,
3435
+ quotes: "“”‘’",
3436
+ highlight: null,
3437
+ maxNesting: 20
3438
+ },
3439
+ components: {
3440
+ core: { rules: [
3441
+ "normalize",
3442
+ "block",
3443
+ "strip_references",
3444
+ "inline",
3445
+ "text_join"
3446
+ ] },
3447
+ block: { rules: [
3448
+ "blockquote",
3449
+ "code",
3450
+ "fence",
3451
+ "heading",
3452
+ "hr",
3453
+ "html_block",
3454
+ "lheading",
3455
+ "list",
3456
+ "reference",
3457
+ "paragraph"
3458
+ ] },
3459
+ inline: {
3460
+ rules: [
3461
+ "autolink",
3462
+ "backticks",
3463
+ "emphasis",
3464
+ "entity",
3465
+ "escape",
3466
+ "html_inline",
3467
+ "image",
3468
+ "link",
3469
+ "newline",
3470
+ "text"
3471
+ ],
3472
+ rules2: [
3473
+ "balance_pairs",
3474
+ "emphasis",
3475
+ "fragments_join"
3476
+ ]
3477
+ }
3478
+ }
3479
+ }
3480
+ }, Hr = /^(vbscript|javascript|file|data):/, Gr = /^data:image\/(gif|png|jpeg|webp);/, We = [
3481
+ "http:",
3482
+ "https:",
3483
+ "mailto:"
3484
+ ], $ = class {
3485
+ /**
3486
+ * Link validation function. CommonMark allows too much in links. By default
3487
+ * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
3488
+ * except some embedded image types.
3489
+ *
3490
+ * You can change this behaviour:
3491
+ *
3492
+ * @example
3493
+ * ```javascript
3494
+ * import MarkdownIt from 'markdown-it'
3495
+ * const md = new MarkdownIt()
3496
+ *
3497
+ * // enable everything
3498
+ * md.validateLink = function () { return true; }
3499
+ * ```
3500
+ */
3501
+ validateLink(e) {
3502
+ const n = e.trim().toLowerCase();
3503
+ return Hr.test(n) ? Gr.test(n) : !0;
3504
+ }
3505
+ /**
3506
+ * Function used to encode link url to a machine-readable format,
3507
+ * which includes url-encoding, punycode, etc.
3508
+ */
3509
+ normalizeLink(e) {
3510
+ const n = ke(e, !0);
3511
+ if (n.hostname && (!n.protocol || We.indexOf(n.protocol) >= 0))
3512
+ try {
3513
+ n.hostname = Je.toASCII(n.hostname);
3514
+ } catch {
3515
+ }
3516
+ return n.auth && (n.auth = q(n.auth)), n.hostname && (n.hostname = q(n.hostname)), n.pathname && (n.pathname = q(n.pathname)), n.search && (n.search = q(n.search)), n.hash && (n.hash = q(n.hash)), ge(n);
3517
+ }
3518
+ /**
3519
+ * Function used to decode link url to a human-readable format`
3520
+ */
3521
+ normalizeLinkText(e) {
3522
+ const n = ke(e, !0);
3523
+ if (n.hostname && (!n.protocol || We.indexOf(n.protocol) >= 0))
3524
+ try {
3525
+ n.hostname = Je.toUnicode(n.hostname);
3526
+ } catch {
3527
+ }
3528
+ return Y(ge(n), Y.defaultChars + "%");
3529
+ }
3530
+ constructor(...e) {
3531
+ R(
3532
+ this,
3533
+ /**
3534
+ * Instance of {@link ParserInline}. You may need it to add new rules when
3535
+ * writing plugins. For simple rules control use {@link MarkdownIt.disable}
3536
+ * and {@link MarkdownIt.enable}.
3537
+ */
3538
+ "inline",
3539
+ new vn()
3540
+ ), R(
3541
+ this,
3542
+ /**
3543
+ * Instance of {@link ParserBlock}. You may need it to add new rules when
3544
+ * writing plugins. For simple rules control use {@link MarkdownIt.disable}
3545
+ * and {@link MarkdownIt.enable}.
3546
+ */
3547
+ "block",
3548
+ new bn()
3549
+ ), R(
3550
+ this,
3551
+ /**
3552
+ * Instance of {@link ParserCore} chain executor. You may need it to add new
3553
+ * rules when writing plugins. For simple rules control use
3554
+ * {@link MarkdownIt.disable} and {@link MarkdownIt.enable}.
3555
+ */
3556
+ "core",
3557
+ new gn()
3558
+ ), R(
3559
+ this,
3560
+ /**
3561
+ * Instance of {@link Renderer}. Use it to modify output look. Or to add rendering
3562
+ * rules for new token types, generated by plugins.
3563
+ *
3564
+ * See {@link Renderer} docs and
3565
+ * [source code](https://github.com/markdown-it/markdown-it/blob/master/src/renderer.ts).
3566
+ *
3567
+ * @example
3568
+ * ```javascript
3569
+ * import MarkdownIt from 'markdown-it'
3570
+ * const md = new MarkdownIt()
3571
+ *
3572
+ * function myToken(tokens, idx, options, env, self) {
3573
+ * //...
3574
+ * return result;
3575
+ * };
3576
+ *
3577
+ * md.renderer.rules['my_token'] = myToken
3578
+ * ```
3579
+ */
3580
+ "renderer",
3581
+ new pn()
3582
+ ), R(
3583
+ this,
3584
+ /**
3585
+ * [linkify-it](https://github.com/markdown-it/linkify-it) instance.
3586
+ * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/src/rules_core/linkify.ts)
3587
+ * rule.
3588
+ */
3589
+ "linkify",
3590
+ new ut()
3591
+ ), R(
3592
+ this,
3593
+ /**
3594
+ * Assorted utility functions, useful to write plugins. See details
3595
+ * [here](https://github.com/markdown-it/markdown-it/blob/master/src/common/utils.ts).
3596
+ */
3597
+ "utils",
3598
+ Rt
3599
+ ), R(
3600
+ this,
3601
+ /**
3602
+ * Link components parser functions, useful to write plugins. See details
3603
+ * [here](https://github.com/markdown-it/markdown-it/blob/master/src/helpers).
3604
+ */
3605
+ "helpers",
3606
+ Object.assign({}, Jt)
3607
+ );
3608
+ const [n, t] = e;
3609
+ typeof n == "string" ? (this.configure(n), t && this.set(t)) : (this.configure("default"), this.set(n || {}));
3610
+ }
3611
+ /**
3612
+ * Set parser options (in the same format as in constructor). Probably, you
3613
+ * will never need it, but you can change options after constructor call.
3614
+ *
3615
+ * __Note:__ To achieve the best possible performance, don't modify a
3616
+ * `markdown-it` instance options on the fly. If you need multiple configurations
3617
+ * it's best to create multiple instances and initialize each with separate
3618
+ * config.
3619
+ *
3620
+ * @example
3621
+ * ```javascript
3622
+ * import MarkdownIt from 'markdown-it'
3623
+ *
3624
+ * const md = new MarkdownIt()
3625
+ * .set({ html: true, breaks: true })
3626
+ * .set({ typographer: true })
3627
+ * ```
3628
+ */
3629
+ set(e) {
3630
+ return Object.assign(this.options, e), this;
3631
+ }
3632
+ /**
3633
+ * Batch load of all options and compenent settings. This is internal method,
3634
+ * and you probably will not need it. But if you will - see available presets
3635
+ * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/src/presets)
3636
+ *
3637
+ * We strongly recommend to use presets instead of direct config loads. That
3638
+ * will give better compatibility with next versions.
3639
+ */
3640
+ configure(e) {
3641
+ let n;
3642
+ if (typeof e == "string") {
3643
+ const r = e;
3644
+ if (n = Kr[r], !n) throw new Error(`Wrong 'markdown-it' preset "${r}", check name`);
3645
+ } else n = e;
3646
+ if (!n) throw new Error("Wrong `markdown-it` preset, can't be empty");
3647
+ n.options && (this.options = { ...n.options });
3648
+ const t = n.components;
3649
+ if (t) {
3650
+ var o;
3651
+ [
3652
+ "core",
3653
+ "block",
3654
+ "inline"
3655
+ ].forEach((i) => {
3656
+ var s;
3657
+ const u = (s = t[i]) === null || s === void 0 ? void 0 : s.rules;
3658
+ u && this[i].ruler.enableOnly(u);
3659
+ });
3660
+ const r = (o = t.inline) === null || o === void 0 ? void 0 : o.rules2;
3661
+ r && this.inline.ruler2.enableOnly(r);
3662
+ }
3663
+ return this;
3664
+ }
3665
+ /**
3666
+ * Enable list or rules. It will automatically find appropriate components,
3667
+ * containing rules with given names. If rule not found, and `ignoreInvalid`
3668
+ * not set - throws exception.
3669
+ *
3670
+ * @example
3671
+ * ```javascript
3672
+ * import MarkdownIt from 'markdown-it'
3673
+ *
3674
+ * const md = new MarkdownIt()
3675
+ * .enable(['sub', 'sup'])
3676
+ * .disable('smartquotes')
3677
+ * ```
3678
+ */
3679
+ enable(e, n = !1) {
3680
+ let t = [];
3681
+ Array.isArray(e) || (e = [e]), [
3682
+ "core",
3683
+ "block",
3684
+ "inline"
3685
+ ].forEach((r) => {
3686
+ t = t.concat(this[r].ruler.enable(e, !0));
3687
+ }), t = t.concat(this.inline.ruler2.enable(e, !0));
3688
+ const o = e.filter((r) => t.indexOf(r) < 0);
3689
+ if (o.length && !n) throw new Error(`MarkdownIt. Failed to enable unknown rule(s): ${o}`);
3690
+ return this;
3691
+ }
3692
+ /**
3693
+ * The same as {@link MarkdownIt.enable}, but turn specified rules off.
3694
+ */
3695
+ disable(e, n = !1) {
3696
+ let t = [];
3697
+ Array.isArray(e) || (e = [e]), [
3698
+ "core",
3699
+ "block",
3700
+ "inline"
3701
+ ].forEach((r) => {
3702
+ t = t.concat(this[r].ruler.disable(e, !0));
3703
+ }), t = t.concat(this.inline.ruler2.disable(e, !0));
3704
+ const o = e.filter((r) => t.indexOf(r) < 0);
3705
+ if (o.length && !n) throw new Error(`MarkdownIt. Failed to disable unknown rule(s): ${o}`);
3706
+ return this;
3707
+ }
3708
+ /**
3709
+ * Load specified plugin with given params into current parser instance.
3710
+ * It's just a sugar to call `plugin(md, params)` with curring.
3711
+ *
3712
+ * @example
3713
+ * ```javascript
3714
+ * import MarkdownIt from 'markdown-it'
3715
+ * import iterator from 'markdown-it-for-inline'
3716
+ *
3717
+ * const md = new MarkdownIt()
3718
+ * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
3719
+ * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar')
3720
+ * })
3721
+ * ```
3722
+ */
3723
+ use(e, ...n) {
3724
+ return e.apply(e, [this, ...n]), this;
3725
+ }
3726
+ /**
3727
+ * Parse input string and return list of block tokens (special token type
3728
+ * "inline" will contain list of inline tokens). You should not call this
3729
+ * method directly, until you write custom renderer (for example, to produce
3730
+ * AST).
3731
+ *
3732
+ * `env` is used to pass data between "distributed" rules and return additional
3733
+ * metadata like reference info, needed for the renderer. It also can be used to
3734
+ * inject data in specific cases. Usually, you will be ok to pass `{}`,
3735
+ * and then pass updated object to renderer.
3736
+ */
3737
+ parse(e, n) {
3738
+ if (typeof e != "string") throw new Error("Input data should be a String");
3739
+ const t = new this.core.State(e, this, n);
3740
+ return this.core.process(t), t.tokens;
3741
+ }
3742
+ /**
3743
+ * Render markdown string into html. It does all magic for you :).
3744
+ *
3745
+ * `env` can be used to inject additional metadata (`{}` by default).
3746
+ * But you will not need it with high probability. See also comment
3747
+ * in {@link MarkdownIt.parse}.
3748
+ */
3749
+ render(e, n = {}) {
3750
+ return this.renderer.render(this.parse(e, n), this.options, n);
3751
+ }
3752
+ /**
3753
+ * The same as {@link MarkdownIt.parse} but skip all block rules. It returns
3754
+ * the block tokens list with the single `inline` element, containing parsed
3755
+ * inline tokens in `children` property. Also updates `env` object.
3756
+ */
3757
+ parseInline(e, n) {
3758
+ const t = new this.core.State(e, this, n);
3759
+ return t.inlineMode = !0, this.core.process(t), t.tokens;
3760
+ }
3761
+ /**
3762
+ * Similar to {@link MarkdownIt.render} but for single paragraph content.
3763
+ * Result will NOT be wrapped into `<p>` tags.
3764
+ */
3765
+ renderInline(e, n = {}) {
3766
+ return this.renderer.render(this.parseInline(e, n), this.options, n);
3767
+ }
3768
+ };
3769
+ R($, "Token", W);
3770
+ R($, "Ruler", te);
3771
+ R($, "Renderer", pn);
3772
+ R($, "ParserCore", gn);
3773
+ R($, "StateCore", dn);
3774
+ R($, "ParserBlock", bn);
3775
+ R($, "StateBlock", kn);
3776
+ R($, "ParserInline", vn);
3777
+ R($, "StateInline", xn);
3778
+ var Qr = an($);
3779
+ export {
3780
+ Qr as default
3781
+ };