@opengis/bi 1.2.7 → 1.2.10

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.
@@ -1,1521 +0,0 @@
1
- var ge = Object.defineProperty;
2
- var ke = (c, e, t) => e in c ? ge(c, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[e] = t;
3
- var k = (c, e, t) => ke(c, typeof e != "symbol" ? e + "" : e, t);
4
- import { _ as de, c as xe } from "./import-file-DnbEvuUN.js";
5
- import { createElementBlock as V, openBlock as J, createCommentVNode as be } from "vue";
6
- function Q() {
7
- return {
8
- async: !1,
9
- breaks: !1,
10
- extensions: null,
11
- gfm: !0,
12
- hooks: null,
13
- pedantic: !1,
14
- renderer: null,
15
- silent: !1,
16
- tokenizer: null,
17
- walkTokens: null
18
- };
19
- }
20
- let z = Q();
21
- function se(c) {
22
- z = c;
23
- }
24
- const ie = /[&<>"']/, me = new RegExp(ie.source, "g"), re = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, we = new RegExp(re.source, "g"), ye = {
25
- "&": "&amp;",
26
- "<": "&lt;",
27
- ">": "&gt;",
28
- '"': "&quot;",
29
- "'": "&#39;"
30
- }, K = (c) => ye[c];
31
- function b(c, e) {
32
- if (e) {
33
- if (ie.test(c))
34
- return c.replace(me, K);
35
- } else if (re.test(c))
36
- return c.replace(we, K);
37
- return c;
38
- }
39
- const $e = /(^|[^\[])\^/g;
40
- function f(c, e) {
41
- let t = typeof c == "string" ? c : c.source;
42
- e = e || "";
43
- const n = {
44
- replace: (s, i) => {
45
- let r = typeof i == "string" ? i : i.source;
46
- return r = r.replace($e, "$1"), t = t.replace(s, r), n;
47
- },
48
- getRegex: () => new RegExp(t, e)
49
- };
50
- return n;
51
- }
52
- function Y(c) {
53
- try {
54
- c = encodeURI(c).replace(/%25/g, "%");
55
- } catch {
56
- return null;
57
- }
58
- return c;
59
- }
60
- const S = { exec: () => null };
61
- function ee(c, e) {
62
- const t = c.replace(/\|/g, (i, r, l) => {
63
- let o = !1, h = r;
64
- for (; --h >= 0 && l[h] === "\\"; )
65
- o = !o;
66
- return o ? "|" : " |";
67
- }), n = t.split(/ \|/);
68
- let s = 0;
69
- if (n[0].trim() || n.shift(), n.length > 0 && !n[n.length - 1].trim() && n.pop(), e)
70
- if (n.length > e)
71
- n.splice(e);
72
- else
73
- for (; n.length < e; )
74
- n.push("");
75
- for (; s < n.length; s++)
76
- n[s] = n[s].trim().replace(/\\\|/g, "|");
77
- return n;
78
- }
79
- function _(c, e, t) {
80
- const n = c.length;
81
- if (n === 0)
82
- return "";
83
- let s = 0;
84
- for (; s < n && c.charAt(n - s - 1) === e; )
85
- s++;
86
- return c.slice(0, n - s);
87
- }
88
- function Te(c, e) {
89
- if (c.indexOf(e[1]) === -1)
90
- return -1;
91
- let t = 0;
92
- for (let n = 0; n < c.length; n++)
93
- if (c[n] === "\\")
94
- n++;
95
- else if (c[n] === e[0])
96
- t++;
97
- else if (c[n] === e[1] && (t--, t < 0))
98
- return n;
99
- return -1;
100
- }
101
- function te(c, e, t, n) {
102
- const s = e.href, i = e.title ? b(e.title) : null, r = c[1].replace(/\\([\[\]])/g, "$1");
103
- if (c[0].charAt(0) !== "!") {
104
- n.state.inLink = !0;
105
- const l = {
106
- type: "link",
107
- raw: t,
108
- href: s,
109
- title: i,
110
- text: r,
111
- tokens: n.inlineTokens(r)
112
- };
113
- return n.state.inLink = !1, l;
114
- }
115
- return {
116
- type: "image",
117
- raw: t,
118
- href: s,
119
- title: i,
120
- text: b(r)
121
- };
122
- }
123
- function ze(c, e) {
124
- const t = c.match(/^(\s+)(?:```)/);
125
- if (t === null)
126
- return e;
127
- const n = t[1];
128
- return e.split(`
129
- `).map((s) => {
130
- const i = s.match(/^\s+/);
131
- if (i === null)
132
- return s;
133
- const [r] = i;
134
- return r.length >= n.length ? s.slice(n.length) : s;
135
- }).join(`
136
- `);
137
- }
138
- class q {
139
- // set by the lexer
140
- constructor(e) {
141
- k(this, "options");
142
- k(this, "rules");
143
- // set by the lexer
144
- k(this, "lexer");
145
- this.options = e || z;
146
- }
147
- space(e) {
148
- const t = this.rules.block.newline.exec(e);
149
- if (t && t[0].length > 0)
150
- return {
151
- type: "space",
152
- raw: t[0]
153
- };
154
- }
155
- code(e) {
156
- const t = this.rules.block.code.exec(e);
157
- if (t) {
158
- const n = t[0].replace(/^(?: {1,4}| {0,3}\t)/gm, "");
159
- return {
160
- type: "code",
161
- raw: t[0],
162
- codeBlockStyle: "indented",
163
- text: this.options.pedantic ? n : _(n, `
164
- `)
165
- };
166
- }
167
- }
168
- fences(e) {
169
- const t = this.rules.block.fences.exec(e);
170
- if (t) {
171
- const n = t[0], s = ze(n, t[3] || "");
172
- return {
173
- type: "code",
174
- raw: n,
175
- lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
176
- text: s
177
- };
178
- }
179
- }
180
- heading(e) {
181
- const t = this.rules.block.heading.exec(e);
182
- if (t) {
183
- let n = t[2].trim();
184
- if (/#$/.test(n)) {
185
- const s = _(n, "#");
186
- (this.options.pedantic || !s || / $/.test(s)) && (n = s.trim());
187
- }
188
- return {
189
- type: "heading",
190
- raw: t[0],
191
- depth: t[1].length,
192
- text: n,
193
- tokens: this.lexer.inline(n)
194
- };
195
- }
196
- }
197
- hr(e) {
198
- const t = this.rules.block.hr.exec(e);
199
- if (t)
200
- return {
201
- type: "hr",
202
- raw: _(t[0], `
203
- `)
204
- };
205
- }
206
- blockquote(e) {
207
- const t = this.rules.block.blockquote.exec(e);
208
- if (t) {
209
- let n = _(t[0], `
210
- `).split(`
211
- `), s = "", i = "";
212
- const r = [];
213
- for (; n.length > 0; ) {
214
- let l = !1;
215
- const o = [];
216
- let h;
217
- for (h = 0; h < n.length; h++)
218
- if (/^ {0,3}>/.test(n[h]))
219
- o.push(n[h]), l = !0;
220
- else if (!l)
221
- o.push(n[h]);
222
- else
223
- break;
224
- n = n.slice(h);
225
- const a = o.join(`
226
- `), p = a.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, `
227
- $1`).replace(/^ {0,3}>[ \t]?/gm, "");
228
- s = s ? `${s}
229
- ${a}` : a, i = i ? `${i}
230
- ${p}` : p;
231
- const g = this.lexer.state.top;
232
- if (this.lexer.state.top = !0, this.lexer.blockTokens(p, r, !0), this.lexer.state.top = g, n.length === 0)
233
- break;
234
- const x = r[r.length - 1];
235
- if ((x == null ? void 0 : x.type) === "code")
236
- break;
237
- if ((x == null ? void 0 : x.type) === "blockquote") {
238
- const d = x, m = d.raw + `
239
- ` + n.join(`
240
- `), $ = this.blockquote(m);
241
- r[r.length - 1] = $, s = s.substring(0, s.length - d.raw.length) + $.raw, i = i.substring(0, i.length - d.text.length) + $.text;
242
- break;
243
- } else if ((x == null ? void 0 : x.type) === "list") {
244
- const d = x, m = d.raw + `
245
- ` + n.join(`
246
- `), $ = this.list(m);
247
- r[r.length - 1] = $, s = s.substring(0, s.length - x.raw.length) + $.raw, i = i.substring(0, i.length - d.raw.length) + $.raw, n = m.substring(r[r.length - 1].raw.length).split(`
248
- `);
249
- continue;
250
- }
251
- }
252
- return {
253
- type: "blockquote",
254
- raw: s,
255
- tokens: r,
256
- text: i
257
- };
258
- }
259
- }
260
- list(e) {
261
- let t = this.rules.block.list.exec(e);
262
- if (t) {
263
- let n = t[1].trim();
264
- const s = n.length > 1, i = {
265
- type: "list",
266
- raw: "",
267
- ordered: s,
268
- start: s ? +n.slice(0, -1) : "",
269
- loose: !1,
270
- items: []
271
- };
272
- n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]");
273
- const r = new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);
274
- let l = !1;
275
- for (; e; ) {
276
- let o = !1, h = "", a = "";
277
- if (!(t = r.exec(e)) || this.rules.block.hr.test(e))
278
- break;
279
- h = t[0], e = e.substring(h.length);
280
- let p = t[2].split(`
281
- `, 1)[0].replace(/^\t+/, (Z) => " ".repeat(3 * Z.length)), g = e.split(`
282
- `, 1)[0], x = !p.trim(), d = 0;
283
- if (this.options.pedantic ? (d = 2, a = p.trimStart()) : x ? d = t[1].length + 1 : (d = t[2].search(/[^ ]/), d = d > 4 ? 1 : d, a = p.slice(d), d += t[1].length), x && /^[ \t]*$/.test(g) && (h += g + `
284
- `, e = e.substring(g.length + 1), o = !0), !o) {
285
- const Z = new RegExp(`^ {0,${Math.min(3, d - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), W = new RegExp(`^ {0,${Math.min(3, d - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), X = new RegExp(`^ {0,${Math.min(3, d - 1)}}(?:\`\`\`|~~~)`), G = new RegExp(`^ {0,${Math.min(3, d - 1)}}#`), fe = new RegExp(`^ {0,${Math.min(3, d - 1)}}<(?:[a-z].*>|!--)`, "i");
286
- for (; e; ) {
287
- const M = e.split(`
288
- `, 1)[0];
289
- let R;
290
- if (g = M, this.options.pedantic ? (g = g.replace(/^ {1,4}(?=( {4})*[^ ])/g, " "), R = g) : R = g.replace(/\t/g, " "), X.test(g) || G.test(g) || fe.test(g) || Z.test(g) || W.test(g))
291
- break;
292
- if (R.search(/[^ ]/) >= d || !g.trim())
293
- a += `
294
- ` + R.slice(d);
295
- else {
296
- if (x || p.replace(/\t/g, " ").search(/[^ ]/) >= 4 || X.test(p) || G.test(p) || W.test(p))
297
- break;
298
- a += `
299
- ` + g;
300
- }
301
- !x && !g.trim() && (x = !0), h += M + `
302
- `, e = e.substring(M.length + 1), p = R.slice(d);
303
- }
304
- }
305
- i.loose || (l ? i.loose = !0 : /\n[ \t]*\n[ \t]*$/.test(h) && (l = !0));
306
- let m = null, $;
307
- this.options.gfm && (m = /^\[[ xX]\] /.exec(a), m && ($ = m[0] !== "[ ] ", a = a.replace(/^\[[ xX]\] +/, ""))), i.items.push({
308
- type: "list_item",
309
- raw: h,
310
- task: !!m,
311
- checked: $,
312
- loose: !1,
313
- text: a,
314
- tokens: []
315
- }), i.raw += h;
316
- }
317
- i.items[i.items.length - 1].raw = i.items[i.items.length - 1].raw.trimEnd(), i.items[i.items.length - 1].text = i.items[i.items.length - 1].text.trimEnd(), i.raw = i.raw.trimEnd();
318
- for (let o = 0; o < i.items.length; o++)
319
- if (this.lexer.state.top = !1, i.items[o].tokens = this.lexer.blockTokens(i.items[o].text, []), !i.loose) {
320
- const h = i.items[o].tokens.filter((p) => p.type === "space"), a = h.length > 0 && h.some((p) => /\n.*\n/.test(p.raw));
321
- i.loose = a;
322
- }
323
- if (i.loose)
324
- for (let o = 0; o < i.items.length; o++)
325
- i.items[o].loose = !0;
326
- return i;
327
- }
328
- }
329
- html(e) {
330
- const t = this.rules.block.html.exec(e);
331
- if (t)
332
- return {
333
- type: "html",
334
- block: !0,
335
- raw: t[0],
336
- pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
337
- text: t[0]
338
- };
339
- }
340
- def(e) {
341
- const t = this.rules.block.def.exec(e);
342
- if (t) {
343
- const n = t[1].toLowerCase().replace(/\s+/g, " "), s = t[2] ? t[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", i = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
344
- return {
345
- type: "def",
346
- tag: n,
347
- raw: t[0],
348
- href: s,
349
- title: i
350
- };
351
- }
352
- }
353
- table(e) {
354
- const t = this.rules.block.table.exec(e);
355
- if (!t || !/[:|]/.test(t[2]))
356
- return;
357
- const n = ee(t[1]), s = t[2].replace(/^\||\| *$/g, "").split("|"), i = t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split(`
358
- `) : [], r = {
359
- type: "table",
360
- raw: t[0],
361
- header: [],
362
- align: [],
363
- rows: []
364
- };
365
- if (n.length === s.length) {
366
- for (const l of s)
367
- /^ *-+: *$/.test(l) ? r.align.push("right") : /^ *:-+: *$/.test(l) ? r.align.push("center") : /^ *:-+ *$/.test(l) ? r.align.push("left") : r.align.push(null);
368
- for (let l = 0; l < n.length; l++)
369
- r.header.push({
370
- text: n[l],
371
- tokens: this.lexer.inline(n[l]),
372
- header: !0,
373
- align: r.align[l]
374
- });
375
- for (const l of i)
376
- r.rows.push(ee(l, r.header.length).map((o, h) => ({
377
- text: o,
378
- tokens: this.lexer.inline(o),
379
- header: !1,
380
- align: r.align[h]
381
- })));
382
- return r;
383
- }
384
- }
385
- lheading(e) {
386
- const t = this.rules.block.lheading.exec(e);
387
- if (t)
388
- return {
389
- type: "heading",
390
- raw: t[0],
391
- depth: t[2].charAt(0) === "=" ? 1 : 2,
392
- text: t[1],
393
- tokens: this.lexer.inline(t[1])
394
- };
395
- }
396
- paragraph(e) {
397
- const t = this.rules.block.paragraph.exec(e);
398
- if (t) {
399
- const n = t[1].charAt(t[1].length - 1) === `
400
- ` ? t[1].slice(0, -1) : t[1];
401
- return {
402
- type: "paragraph",
403
- raw: t[0],
404
- text: n,
405
- tokens: this.lexer.inline(n)
406
- };
407
- }
408
- }
409
- text(e) {
410
- const t = this.rules.block.text.exec(e);
411
- if (t)
412
- return {
413
- type: "text",
414
- raw: t[0],
415
- text: t[0],
416
- tokens: this.lexer.inline(t[0])
417
- };
418
- }
419
- escape(e) {
420
- const t = this.rules.inline.escape.exec(e);
421
- if (t)
422
- return {
423
- type: "escape",
424
- raw: t[0],
425
- text: b(t[1])
426
- };
427
- }
428
- tag(e) {
429
- const t = this.rules.inline.tag.exec(e);
430
- if (t)
431
- return !this.lexer.state.inLink && /^<a /i.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && /^<\/a>/i.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
432
- type: "html",
433
- raw: t[0],
434
- inLink: this.lexer.state.inLink,
435
- inRawBlock: this.lexer.state.inRawBlock,
436
- block: !1,
437
- text: t[0]
438
- };
439
- }
440
- link(e) {
441
- const t = this.rules.inline.link.exec(e);
442
- if (t) {
443
- const n = t[2].trim();
444
- if (!this.options.pedantic && /^</.test(n)) {
445
- if (!/>$/.test(n))
446
- return;
447
- const r = _(n.slice(0, -1), "\\");
448
- if ((n.length - r.length) % 2 === 0)
449
- return;
450
- } else {
451
- const r = Te(t[2], "()");
452
- if (r > -1) {
453
- const o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + r;
454
- t[2] = t[2].substring(0, r), t[0] = t[0].substring(0, o).trim(), t[3] = "";
455
- }
456
- }
457
- let s = t[2], i = "";
458
- if (this.options.pedantic) {
459
- const r = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);
460
- r && (s = r[1], i = r[3]);
461
- } else
462
- i = t[3] ? t[3].slice(1, -1) : "";
463
- return s = s.trim(), /^</.test(s) && (this.options.pedantic && !/>$/.test(n) ? s = s.slice(1) : s = s.slice(1, -1)), te(t, {
464
- href: s && s.replace(this.rules.inline.anyPunctuation, "$1"),
465
- title: i && i.replace(this.rules.inline.anyPunctuation, "$1")
466
- }, t[0], this.lexer);
467
- }
468
- }
469
- reflink(e, t) {
470
- let n;
471
- if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
472
- const s = (n[2] || n[1]).replace(/\s+/g, " "), i = t[s.toLowerCase()];
473
- if (!i) {
474
- const r = n[0].charAt(0);
475
- return {
476
- type: "text",
477
- raw: r,
478
- text: r
479
- };
480
- }
481
- return te(n, i, n[0], this.lexer);
482
- }
483
- }
484
- emStrong(e, t, n = "") {
485
- let s = this.rules.inline.emStrongLDelim.exec(e);
486
- if (!s || s[3] && n.match(/[\p{L}\p{N}]/u))
487
- return;
488
- if (!(s[1] || s[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
489
- const r = [...s[0]].length - 1;
490
- let l, o, h = r, a = 0;
491
- const p = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
492
- for (p.lastIndex = 0, t = t.slice(-1 * e.length + r); (s = p.exec(t)) != null; ) {
493
- if (l = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !l)
494
- continue;
495
- if (o = [...l].length, s[3] || s[4]) {
496
- h += o;
497
- continue;
498
- } else if ((s[5] || s[6]) && r % 3 && !((r + o) % 3)) {
499
- a += o;
500
- continue;
501
- }
502
- if (h -= o, h > 0)
503
- continue;
504
- o = Math.min(o, o + h + a);
505
- const g = [...s[0]][0].length, x = e.slice(0, r + s.index + g + o);
506
- if (Math.min(r, o) % 2) {
507
- const m = x.slice(1, -1);
508
- return {
509
- type: "em",
510
- raw: x,
511
- text: m,
512
- tokens: this.lexer.inlineTokens(m)
513
- };
514
- }
515
- const d = x.slice(2, -2);
516
- return {
517
- type: "strong",
518
- raw: x,
519
- text: d,
520
- tokens: this.lexer.inlineTokens(d)
521
- };
522
- }
523
- }
524
- }
525
- codespan(e) {
526
- const t = this.rules.inline.code.exec(e);
527
- if (t) {
528
- let n = t[2].replace(/\n/g, " ");
529
- const s = /[^ ]/.test(n), i = /^ /.test(n) && / $/.test(n);
530
- return s && i && (n = n.substring(1, n.length - 1)), n = b(n, !0), {
531
- type: "codespan",
532
- raw: t[0],
533
- text: n
534
- };
535
- }
536
- }
537
- br(e) {
538
- const t = this.rules.inline.br.exec(e);
539
- if (t)
540
- return {
541
- type: "br",
542
- raw: t[0]
543
- };
544
- }
545
- del(e) {
546
- const t = this.rules.inline.del.exec(e);
547
- if (t)
548
- return {
549
- type: "del",
550
- raw: t[0],
551
- text: t[2],
552
- tokens: this.lexer.inlineTokens(t[2])
553
- };
554
- }
555
- autolink(e) {
556
- const t = this.rules.inline.autolink.exec(e);
557
- if (t) {
558
- let n, s;
559
- return t[2] === "@" ? (n = b(t[1]), s = "mailto:" + n) : (n = b(t[1]), s = n), {
560
- type: "link",
561
- raw: t[0],
562
- text: n,
563
- href: s,
564
- tokens: [
565
- {
566
- type: "text",
567
- raw: n,
568
- text: n
569
- }
570
- ]
571
- };
572
- }
573
- }
574
- url(e) {
575
- var n;
576
- let t;
577
- if (t = this.rules.inline.url.exec(e)) {
578
- let s, i;
579
- if (t[2] === "@")
580
- s = b(t[0]), i = "mailto:" + s;
581
- else {
582
- let r;
583
- do
584
- r = t[0], t[0] = ((n = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : n[0]) ?? "";
585
- while (r !== t[0]);
586
- s = b(t[0]), t[1] === "www." ? i = "http://" + t[0] : i = t[0];
587
- }
588
- return {
589
- type: "link",
590
- raw: t[0],
591
- text: s,
592
- href: i,
593
- tokens: [
594
- {
595
- type: "text",
596
- raw: s,
597
- text: s
598
- }
599
- ]
600
- };
601
- }
602
- }
603
- inlineText(e) {
604
- const t = this.rules.inline.text.exec(e);
605
- if (t) {
606
- let n;
607
- return this.lexer.state.inRawBlock ? n = t[0] : n = b(t[0]), {
608
- type: "text",
609
- raw: t[0],
610
- text: n
611
- };
612
- }
613
- }
614
- }
615
- const Re = /^(?:[ \t]*(?:\n|$))+/, _e = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Ie = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, E = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Se = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, le = /(?:[*+-]|\d{1,9}[.)])/, oe = f(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, le).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Ae = /^[^\n]+/, O = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Ee = f(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", O).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Le = f(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, le).getRegex(), P = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", H = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ve = f("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", H).replace("tag", P).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ae = f(j).replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", P).getRegex(), qe = f(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex(), N = {
616
- blockquote: qe,
617
- code: _e,
618
- def: Ee,
619
- fences: Ie,
620
- heading: Se,
621
- hr: E,
622
- html: ve,
623
- lheading: oe,
624
- list: Le,
625
- newline: Re,
626
- paragraph: ae,
627
- table: S,
628
- text: Ae
629
- }, ne = f("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", P).getRegex(), Ce = {
630
- ...N,
631
- table: ne,
632
- paragraph: f(j).replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ne).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", P).getRegex()
633
- }, Be = {
634
- ...N,
635
- html: f(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", H).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
636
- def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
637
- heading: /^(#{1,6})(.*)(?:\n+|$)/,
638
- fences: S,
639
- // fences not supported
640
- lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
641
- paragraph: f(j).replace("hr", E).replace("heading", ` *#{1,6} *[^
642
- ]`).replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
643
- }, ce = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Pe = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, he = /^( {2,}|\\)\n(?!\s*$)/, Ze = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, L = "\\p{P}\\p{S}", Me = f(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, L).getRegex(), De = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, Qe = f(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, L).getRegex(), je = f("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, L).getRegex(), Oe = f("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, L).getRegex(), He = f(/\\([punct])/, "gu").replace(/punct/g, L).getRegex(), Ne = f(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ue = f(H).replace("(?:-->|$)", "-->").getRegex(), Fe = f("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Ue).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), C = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, We = f(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", C).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), pe = f(/^!?\[(label)\]\[(ref)\]/).replace("label", C).replace("ref", O).getRegex(), ue = f(/^!?\[(ref)\](?:\[\])?/).replace("ref", O).getRegex(), Xe = f("reflink|nolink(?!\\()", "g").replace("reflink", pe).replace("nolink", ue).getRegex(), U = {
644
- _backpedal: S,
645
- // only used for GFM url
646
- anyPunctuation: He,
647
- autolink: Ne,
648
- blockSkip: De,
649
- br: he,
650
- code: Pe,
651
- del: S,
652
- emStrongLDelim: Qe,
653
- emStrongRDelimAst: je,
654
- emStrongRDelimUnd: Oe,
655
- escape: ce,
656
- link: We,
657
- nolink: ue,
658
- punctuation: Me,
659
- reflink: pe,
660
- reflinkSearch: Xe,
661
- tag: Fe,
662
- text: Ze,
663
- url: S
664
- }, Ge = {
665
- ...U,
666
- link: f(/^!?\[(label)\]\((.*?)\)/).replace("label", C).getRegex(),
667
- reflink: f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", C).getRegex()
668
- }, D = {
669
- ...U,
670
- escape: f(ce).replace("])", "~|])").getRegex(),
671
- url: f(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
672
- _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
673
- del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
674
- text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
675
- }, Ve = {
676
- ...D,
677
- br: f(he).replace("{2,}", "*").getRegex(),
678
- text: f(D.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
679
- }, v = {
680
- normal: N,
681
- gfm: Ce,
682
- pedantic: Be
683
- }, I = {
684
- normal: U,
685
- gfm: D,
686
- breaks: Ve,
687
- pedantic: Ge
688
- };
689
- class w {
690
- constructor(e) {
691
- k(this, "tokens");
692
- k(this, "options");
693
- k(this, "state");
694
- k(this, "tokenizer");
695
- k(this, "inlineQueue");
696
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || z, this.options.tokenizer = this.options.tokenizer || new q(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
697
- inLink: !1,
698
- inRawBlock: !1,
699
- top: !0
700
- };
701
- const t = {
702
- block: v.normal,
703
- inline: I.normal
704
- };
705
- this.options.pedantic ? (t.block = v.pedantic, t.inline = I.pedantic) : this.options.gfm && (t.block = v.gfm, this.options.breaks ? t.inline = I.breaks : t.inline = I.gfm), this.tokenizer.rules = t;
706
- }
707
- /**
708
- * Expose Rules
709
- */
710
- static get rules() {
711
- return {
712
- block: v,
713
- inline: I
714
- };
715
- }
716
- /**
717
- * Static Lex Method
718
- */
719
- static lex(e, t) {
720
- return new w(t).lex(e);
721
- }
722
- /**
723
- * Static Lex Inline Method
724
- */
725
- static lexInline(e, t) {
726
- return new w(t).inlineTokens(e);
727
- }
728
- /**
729
- * Preprocessing
730
- */
731
- lex(e) {
732
- e = e.replace(/\r\n|\r/g, `
733
- `), this.blockTokens(e, this.tokens);
734
- for (let t = 0; t < this.inlineQueue.length; t++) {
735
- const n = this.inlineQueue[t];
736
- this.inlineTokens(n.src, n.tokens);
737
- }
738
- return this.inlineQueue = [], this.tokens;
739
- }
740
- blockTokens(e, t = [], n = !1) {
741
- this.options.pedantic && (e = e.replace(/\t/g, " ").replace(/^ +$/gm, ""));
742
- let s, i, r;
743
- for (; e; )
744
- if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((l) => (s = l.call({ lexer: this }, e, t)) ? (e = e.substring(s.raw.length), t.push(s), !0) : !1))) {
745
- if (s = this.tokenizer.space(e)) {
746
- e = e.substring(s.raw.length), s.raw.length === 1 && t.length > 0 ? t[t.length - 1].raw += `
747
- ` : t.push(s);
748
- continue;
749
- }
750
- if (s = this.tokenizer.code(e)) {
751
- e = e.substring(s.raw.length), i = t[t.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
752
- ` + s.raw, i.text += `
753
- ` + s.text, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : t.push(s);
754
- continue;
755
- }
756
- if (s = this.tokenizer.fences(e)) {
757
- e = e.substring(s.raw.length), t.push(s);
758
- continue;
759
- }
760
- if (s = this.tokenizer.heading(e)) {
761
- e = e.substring(s.raw.length), t.push(s);
762
- continue;
763
- }
764
- if (s = this.tokenizer.hr(e)) {
765
- e = e.substring(s.raw.length), t.push(s);
766
- continue;
767
- }
768
- if (s = this.tokenizer.blockquote(e)) {
769
- e = e.substring(s.raw.length), t.push(s);
770
- continue;
771
- }
772
- if (s = this.tokenizer.list(e)) {
773
- e = e.substring(s.raw.length), t.push(s);
774
- continue;
775
- }
776
- if (s = this.tokenizer.html(e)) {
777
- e = e.substring(s.raw.length), t.push(s);
778
- continue;
779
- }
780
- if (s = this.tokenizer.def(e)) {
781
- e = e.substring(s.raw.length), i = t[t.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
782
- ` + s.raw, i.text += `
783
- ` + s.raw, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : this.tokens.links[s.tag] || (this.tokens.links[s.tag] = {
784
- href: s.href,
785
- title: s.title
786
- });
787
- continue;
788
- }
789
- if (s = this.tokenizer.table(e)) {
790
- e = e.substring(s.raw.length), t.push(s);
791
- continue;
792
- }
793
- if (s = this.tokenizer.lheading(e)) {
794
- e = e.substring(s.raw.length), t.push(s);
795
- continue;
796
- }
797
- if (r = e, this.options.extensions && this.options.extensions.startBlock) {
798
- let l = 1 / 0;
799
- const o = e.slice(1);
800
- let h;
801
- this.options.extensions.startBlock.forEach((a) => {
802
- h = a.call({ lexer: this }, o), typeof h == "number" && h >= 0 && (l = Math.min(l, h));
803
- }), l < 1 / 0 && l >= 0 && (r = e.substring(0, l + 1));
804
- }
805
- if (this.state.top && (s = this.tokenizer.paragraph(r))) {
806
- i = t[t.length - 1], n && (i == null ? void 0 : i.type) === "paragraph" ? (i.raw += `
807
- ` + s.raw, i.text += `
808
- ` + s.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : t.push(s), n = r.length !== e.length, e = e.substring(s.raw.length);
809
- continue;
810
- }
811
- if (s = this.tokenizer.text(e)) {
812
- e = e.substring(s.raw.length), i = t[t.length - 1], i && i.type === "text" ? (i.raw += `
813
- ` + s.raw, i.text += `
814
- ` + s.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : t.push(s);
815
- continue;
816
- }
817
- if (e) {
818
- const l = "Infinite loop on byte: " + e.charCodeAt(0);
819
- if (this.options.silent) {
820
- console.error(l);
821
- break;
822
- } else
823
- throw new Error(l);
824
- }
825
- }
826
- return this.state.top = !0, t;
827
- }
828
- inline(e, t = []) {
829
- return this.inlineQueue.push({ src: e, tokens: t }), t;
830
- }
831
- /**
832
- * Lexing/Compiling
833
- */
834
- inlineTokens(e, t = []) {
835
- let n, s, i, r = e, l, o, h;
836
- if (this.tokens.links) {
837
- const a = Object.keys(this.tokens.links);
838
- if (a.length > 0)
839
- for (; (l = this.tokenizer.rules.inline.reflinkSearch.exec(r)) != null; )
840
- a.includes(l[0].slice(l[0].lastIndexOf("[") + 1, -1)) && (r = r.slice(0, l.index) + "[" + "a".repeat(l[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
841
- }
842
- for (; (l = this.tokenizer.rules.inline.blockSkip.exec(r)) != null; )
843
- r = r.slice(0, l.index) + "[" + "a".repeat(l[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
844
- for (; (l = this.tokenizer.rules.inline.anyPunctuation.exec(r)) != null; )
845
- r = r.slice(0, l.index) + "++" + r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
846
- for (; e; )
847
- if (o || (h = ""), o = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((a) => (n = a.call({ lexer: this }, e, t)) ? (e = e.substring(n.raw.length), t.push(n), !0) : !1))) {
848
- if (n = this.tokenizer.escape(e)) {
849
- e = e.substring(n.raw.length), t.push(n);
850
- continue;
851
- }
852
- if (n = this.tokenizer.tag(e)) {
853
- e = e.substring(n.raw.length), s = t[t.length - 1], s && n.type === "text" && s.type === "text" ? (s.raw += n.raw, s.text += n.text) : t.push(n);
854
- continue;
855
- }
856
- if (n = this.tokenizer.link(e)) {
857
- e = e.substring(n.raw.length), t.push(n);
858
- continue;
859
- }
860
- if (n = this.tokenizer.reflink(e, this.tokens.links)) {
861
- e = e.substring(n.raw.length), s = t[t.length - 1], s && n.type === "text" && s.type === "text" ? (s.raw += n.raw, s.text += n.text) : t.push(n);
862
- continue;
863
- }
864
- if (n = this.tokenizer.emStrong(e, r, h)) {
865
- e = e.substring(n.raw.length), t.push(n);
866
- continue;
867
- }
868
- if (n = this.tokenizer.codespan(e)) {
869
- e = e.substring(n.raw.length), t.push(n);
870
- continue;
871
- }
872
- if (n = this.tokenizer.br(e)) {
873
- e = e.substring(n.raw.length), t.push(n);
874
- continue;
875
- }
876
- if (n = this.tokenizer.del(e)) {
877
- e = e.substring(n.raw.length), t.push(n);
878
- continue;
879
- }
880
- if (n = this.tokenizer.autolink(e)) {
881
- e = e.substring(n.raw.length), t.push(n);
882
- continue;
883
- }
884
- if (!this.state.inLink && (n = this.tokenizer.url(e))) {
885
- e = e.substring(n.raw.length), t.push(n);
886
- continue;
887
- }
888
- if (i = e, this.options.extensions && this.options.extensions.startInline) {
889
- let a = 1 / 0;
890
- const p = e.slice(1);
891
- let g;
892
- this.options.extensions.startInline.forEach((x) => {
893
- g = x.call({ lexer: this }, p), typeof g == "number" && g >= 0 && (a = Math.min(a, g));
894
- }), a < 1 / 0 && a >= 0 && (i = e.substring(0, a + 1));
895
- }
896
- if (n = this.tokenizer.inlineText(i)) {
897
- e = e.substring(n.raw.length), n.raw.slice(-1) !== "_" && (h = n.raw.slice(-1)), o = !0, s = t[t.length - 1], s && s.type === "text" ? (s.raw += n.raw, s.text += n.text) : t.push(n);
898
- continue;
899
- }
900
- if (e) {
901
- const a = "Infinite loop on byte: " + e.charCodeAt(0);
902
- if (this.options.silent) {
903
- console.error(a);
904
- break;
905
- } else
906
- throw new Error(a);
907
- }
908
- }
909
- return t;
910
- }
911
- }
912
- class B {
913
- // set by the parser
914
- constructor(e) {
915
- k(this, "options");
916
- k(this, "parser");
917
- this.options = e || z;
918
- }
919
- space(e) {
920
- return "";
921
- }
922
- code({ text: e, lang: t, escaped: n }) {
923
- var r;
924
- const s = (r = (t || "").match(/^\S*/)) == null ? void 0 : r[0], i = e.replace(/\n$/, "") + `
925
- `;
926
- return s ? '<pre><code class="language-' + b(s) + '">' + (n ? i : b(i, !0)) + `</code></pre>
927
- ` : "<pre><code>" + (n ? i : b(i, !0)) + `</code></pre>
928
- `;
929
- }
930
- blockquote({ tokens: e }) {
931
- return `<blockquote>
932
- ${this.parser.parse(e)}</blockquote>
933
- `;
934
- }
935
- html({ text: e }) {
936
- return e;
937
- }
938
- heading({ tokens: e, depth: t }) {
939
- return `<h${t}>${this.parser.parseInline(e)}</h${t}>
940
- `;
941
- }
942
- hr(e) {
943
- return `<hr>
944
- `;
945
- }
946
- list(e) {
947
- const t = e.ordered, n = e.start;
948
- let s = "";
949
- for (let l = 0; l < e.items.length; l++) {
950
- const o = e.items[l];
951
- s += this.listitem(o);
952
- }
953
- const i = t ? "ol" : "ul", r = t && n !== 1 ? ' start="' + n + '"' : "";
954
- return "<" + i + r + `>
955
- ` + s + "</" + i + `>
956
- `;
957
- }
958
- listitem(e) {
959
- let t = "";
960
- if (e.task) {
961
- const n = this.checkbox({ checked: !!e.checked });
962
- e.loose ? e.tokens.length > 0 && e.tokens[0].type === "paragraph" ? (e.tokens[0].text = n + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = n + " " + e.tokens[0].tokens[0].text)) : e.tokens.unshift({
963
- type: "text",
964
- raw: n + " ",
965
- text: n + " "
966
- }) : t += n + " ";
967
- }
968
- return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>
969
- `;
970
- }
971
- checkbox({ checked: e }) {
972
- return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
973
- }
974
- paragraph({ tokens: e }) {
975
- return `<p>${this.parser.parseInline(e)}</p>
976
- `;
977
- }
978
- table(e) {
979
- let t = "", n = "";
980
- for (let i = 0; i < e.header.length; i++)
981
- n += this.tablecell(e.header[i]);
982
- t += this.tablerow({ text: n });
983
- let s = "";
984
- for (let i = 0; i < e.rows.length; i++) {
985
- const r = e.rows[i];
986
- n = "";
987
- for (let l = 0; l < r.length; l++)
988
- n += this.tablecell(r[l]);
989
- s += this.tablerow({ text: n });
990
- }
991
- return s && (s = `<tbody>${s}</tbody>`), `<table>
992
- <thead>
993
- ` + t + `</thead>
994
- ` + s + `</table>
995
- `;
996
- }
997
- tablerow({ text: e }) {
998
- return `<tr>
999
- ${e}</tr>
1000
- `;
1001
- }
1002
- tablecell(e) {
1003
- const t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
1004
- return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
1005
- `;
1006
- }
1007
- /**
1008
- * span level renderer
1009
- */
1010
- strong({ tokens: e }) {
1011
- return `<strong>${this.parser.parseInline(e)}</strong>`;
1012
- }
1013
- em({ tokens: e }) {
1014
- return `<em>${this.parser.parseInline(e)}</em>`;
1015
- }
1016
- codespan({ text: e }) {
1017
- return `<code>${e}</code>`;
1018
- }
1019
- br(e) {
1020
- return "<br>";
1021
- }
1022
- del({ tokens: e }) {
1023
- return `<del>${this.parser.parseInline(e)}</del>`;
1024
- }
1025
- link({ href: e, title: t, tokens: n }) {
1026
- const s = this.parser.parseInline(n), i = Y(e);
1027
- if (i === null)
1028
- return s;
1029
- e = i;
1030
- let r = '<a href="' + e + '"';
1031
- return t && (r += ' title="' + t + '"'), r += ">" + s + "</a>", r;
1032
- }
1033
- image({ href: e, title: t, text: n }) {
1034
- const s = Y(e);
1035
- if (s === null)
1036
- return n;
1037
- e = s;
1038
- let i = `<img src="${e}" alt="${n}"`;
1039
- return t && (i += ` title="${t}"`), i += ">", i;
1040
- }
1041
- text(e) {
1042
- return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : e.text;
1043
- }
1044
- }
1045
- class F {
1046
- // no need for block level renderers
1047
- strong({ text: e }) {
1048
- return e;
1049
- }
1050
- em({ text: e }) {
1051
- return e;
1052
- }
1053
- codespan({ text: e }) {
1054
- return e;
1055
- }
1056
- del({ text: e }) {
1057
- return e;
1058
- }
1059
- html({ text: e }) {
1060
- return e;
1061
- }
1062
- text({ text: e }) {
1063
- return e;
1064
- }
1065
- link({ text: e }) {
1066
- return "" + e;
1067
- }
1068
- image({ text: e }) {
1069
- return "" + e;
1070
- }
1071
- br() {
1072
- return "";
1073
- }
1074
- }
1075
- class y {
1076
- constructor(e) {
1077
- k(this, "options");
1078
- k(this, "renderer");
1079
- k(this, "textRenderer");
1080
- this.options = e || z, this.options.renderer = this.options.renderer || new B(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new F();
1081
- }
1082
- /**
1083
- * Static Parse Method
1084
- */
1085
- static parse(e, t) {
1086
- return new y(t).parse(e);
1087
- }
1088
- /**
1089
- * Static Parse Inline Method
1090
- */
1091
- static parseInline(e, t) {
1092
- return new y(t).parseInline(e);
1093
- }
1094
- /**
1095
- * Parse Loop
1096
- */
1097
- parse(e, t = !0) {
1098
- let n = "";
1099
- for (let s = 0; s < e.length; s++) {
1100
- const i = e[s];
1101
- if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[i.type]) {
1102
- const l = i, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
1103
- if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(l.type)) {
1104
- n += o || "";
1105
- continue;
1106
- }
1107
- }
1108
- const r = i;
1109
- switch (r.type) {
1110
- case "space": {
1111
- n += this.renderer.space(r);
1112
- continue;
1113
- }
1114
- case "hr": {
1115
- n += this.renderer.hr(r);
1116
- continue;
1117
- }
1118
- case "heading": {
1119
- n += this.renderer.heading(r);
1120
- continue;
1121
- }
1122
- case "code": {
1123
- n += this.renderer.code(r);
1124
- continue;
1125
- }
1126
- case "table": {
1127
- n += this.renderer.table(r);
1128
- continue;
1129
- }
1130
- case "blockquote": {
1131
- n += this.renderer.blockquote(r);
1132
- continue;
1133
- }
1134
- case "list": {
1135
- n += this.renderer.list(r);
1136
- continue;
1137
- }
1138
- case "html": {
1139
- n += this.renderer.html(r);
1140
- continue;
1141
- }
1142
- case "paragraph": {
1143
- n += this.renderer.paragraph(r);
1144
- continue;
1145
- }
1146
- case "text": {
1147
- let l = r, o = this.renderer.text(l);
1148
- for (; s + 1 < e.length && e[s + 1].type === "text"; )
1149
- l = e[++s], o += `
1150
- ` + this.renderer.text(l);
1151
- t ? n += this.renderer.paragraph({
1152
- type: "paragraph",
1153
- raw: o,
1154
- text: o,
1155
- tokens: [{ type: "text", raw: o, text: o }]
1156
- }) : n += o;
1157
- continue;
1158
- }
1159
- default: {
1160
- const l = 'Token with "' + r.type + '" type was not found.';
1161
- if (this.options.silent)
1162
- return console.error(l), "";
1163
- throw new Error(l);
1164
- }
1165
- }
1166
- }
1167
- return n;
1168
- }
1169
- /**
1170
- * Parse Inline Tokens
1171
- */
1172
- parseInline(e, t) {
1173
- t = t || this.renderer;
1174
- let n = "";
1175
- for (let s = 0; s < e.length; s++) {
1176
- const i = e[s];
1177
- if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[i.type]) {
1178
- const l = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1179
- if (l !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
1180
- n += l || "";
1181
- continue;
1182
- }
1183
- }
1184
- const r = i;
1185
- switch (r.type) {
1186
- case "escape": {
1187
- n += t.text(r);
1188
- break;
1189
- }
1190
- case "html": {
1191
- n += t.html(r);
1192
- break;
1193
- }
1194
- case "link": {
1195
- n += t.link(r);
1196
- break;
1197
- }
1198
- case "image": {
1199
- n += t.image(r);
1200
- break;
1201
- }
1202
- case "strong": {
1203
- n += t.strong(r);
1204
- break;
1205
- }
1206
- case "em": {
1207
- n += t.em(r);
1208
- break;
1209
- }
1210
- case "codespan": {
1211
- n += t.codespan(r);
1212
- break;
1213
- }
1214
- case "br": {
1215
- n += t.br(r);
1216
- break;
1217
- }
1218
- case "del": {
1219
- n += t.del(r);
1220
- break;
1221
- }
1222
- case "text": {
1223
- n += t.text(r);
1224
- break;
1225
- }
1226
- default: {
1227
- const l = 'Token with "' + r.type + '" type was not found.';
1228
- if (this.options.silent)
1229
- return console.error(l), "";
1230
- throw new Error(l);
1231
- }
1232
- }
1233
- }
1234
- return n;
1235
- }
1236
- }
1237
- class A {
1238
- constructor(e) {
1239
- k(this, "options");
1240
- k(this, "block");
1241
- this.options = e || z;
1242
- }
1243
- /**
1244
- * Process markdown before marked
1245
- */
1246
- preprocess(e) {
1247
- return e;
1248
- }
1249
- /**
1250
- * Process HTML after marked is finished
1251
- */
1252
- postprocess(e) {
1253
- return e;
1254
- }
1255
- /**
1256
- * Process all tokens before walk tokens
1257
- */
1258
- processAllTokens(e) {
1259
- return e;
1260
- }
1261
- /**
1262
- * Provide function to tokenize markdown
1263
- */
1264
- provideLexer() {
1265
- return this.block ? w.lex : w.lexInline;
1266
- }
1267
- /**
1268
- * Provide function to parse tokens
1269
- */
1270
- provideParser() {
1271
- return this.block ? y.parse : y.parseInline;
1272
- }
1273
- }
1274
- k(A, "passThroughHooks", /* @__PURE__ */ new Set([
1275
- "preprocess",
1276
- "postprocess",
1277
- "processAllTokens"
1278
- ]));
1279
- class Je {
1280
- constructor(...e) {
1281
- k(this, "defaults", Q());
1282
- k(this, "options", this.setOptions);
1283
- k(this, "parse", this.parseMarkdown(!0));
1284
- k(this, "parseInline", this.parseMarkdown(!1));
1285
- k(this, "Parser", y);
1286
- k(this, "Renderer", B);
1287
- k(this, "TextRenderer", F);
1288
- k(this, "Lexer", w);
1289
- k(this, "Tokenizer", q);
1290
- k(this, "Hooks", A);
1291
- this.use(...e);
1292
- }
1293
- /**
1294
- * Run callback for every token
1295
- */
1296
- walkTokens(e, t) {
1297
- var s, i;
1298
- let n = [];
1299
- for (const r of e)
1300
- switch (n = n.concat(t.call(this, r)), r.type) {
1301
- case "table": {
1302
- const l = r;
1303
- for (const o of l.header)
1304
- n = n.concat(this.walkTokens(o.tokens, t));
1305
- for (const o of l.rows)
1306
- for (const h of o)
1307
- n = n.concat(this.walkTokens(h.tokens, t));
1308
- break;
1309
- }
1310
- case "list": {
1311
- const l = r;
1312
- n = n.concat(this.walkTokens(l.items, t));
1313
- break;
1314
- }
1315
- default: {
1316
- const l = r;
1317
- (i = (s = this.defaults.extensions) == null ? void 0 : s.childTokens) != null && i[l.type] ? this.defaults.extensions.childTokens[l.type].forEach((o) => {
1318
- const h = l[o].flat(1 / 0);
1319
- n = n.concat(this.walkTokens(h, t));
1320
- }) : l.tokens && (n = n.concat(this.walkTokens(l.tokens, t)));
1321
- }
1322
- }
1323
- return n;
1324
- }
1325
- use(...e) {
1326
- const t = this.defaults.extensions || { renderers: {}, childTokens: {} };
1327
- return e.forEach((n) => {
1328
- const s = { ...n };
1329
- if (s.async = this.defaults.async || s.async || !1, n.extensions && (n.extensions.forEach((i) => {
1330
- if (!i.name)
1331
- throw new Error("extension name required");
1332
- if ("renderer" in i) {
1333
- const r = t.renderers[i.name];
1334
- r ? t.renderers[i.name] = function(...l) {
1335
- let o = i.renderer.apply(this, l);
1336
- return o === !1 && (o = r.apply(this, l)), o;
1337
- } : t.renderers[i.name] = i.renderer;
1338
- }
1339
- if ("tokenizer" in i) {
1340
- if (!i.level || i.level !== "block" && i.level !== "inline")
1341
- throw new Error("extension level must be 'block' or 'inline'");
1342
- const r = t[i.level];
1343
- r ? r.unshift(i.tokenizer) : t[i.level] = [i.tokenizer], i.start && (i.level === "block" ? t.startBlock ? t.startBlock.push(i.start) : t.startBlock = [i.start] : i.level === "inline" && (t.startInline ? t.startInline.push(i.start) : t.startInline = [i.start]));
1344
- }
1345
- "childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
1346
- }), s.extensions = t), n.renderer) {
1347
- const i = this.defaults.renderer || new B(this.defaults);
1348
- for (const r in n.renderer) {
1349
- if (!(r in i))
1350
- throw new Error(`renderer '${r}' does not exist`);
1351
- if (["options", "parser"].includes(r))
1352
- continue;
1353
- const l = r, o = n.renderer[l], h = i[l];
1354
- i[l] = (...a) => {
1355
- let p = o.apply(i, a);
1356
- return p === !1 && (p = h.apply(i, a)), p || "";
1357
- };
1358
- }
1359
- s.renderer = i;
1360
- }
1361
- if (n.tokenizer) {
1362
- const i = this.defaults.tokenizer || new q(this.defaults);
1363
- for (const r in n.tokenizer) {
1364
- if (!(r in i))
1365
- throw new Error(`tokenizer '${r}' does not exist`);
1366
- if (["options", "rules", "lexer"].includes(r))
1367
- continue;
1368
- const l = r, o = n.tokenizer[l], h = i[l];
1369
- i[l] = (...a) => {
1370
- let p = o.apply(i, a);
1371
- return p === !1 && (p = h.apply(i, a)), p;
1372
- };
1373
- }
1374
- s.tokenizer = i;
1375
- }
1376
- if (n.hooks) {
1377
- const i = this.defaults.hooks || new A();
1378
- for (const r in n.hooks) {
1379
- if (!(r in i))
1380
- throw new Error(`hook '${r}' does not exist`);
1381
- if (["options", "block"].includes(r))
1382
- continue;
1383
- const l = r, o = n.hooks[l], h = i[l];
1384
- A.passThroughHooks.has(r) ? i[l] = (a) => {
1385
- if (this.defaults.async)
1386
- return Promise.resolve(o.call(i, a)).then((g) => h.call(i, g));
1387
- const p = o.call(i, a);
1388
- return h.call(i, p);
1389
- } : i[l] = (...a) => {
1390
- let p = o.apply(i, a);
1391
- return p === !1 && (p = h.apply(i, a)), p;
1392
- };
1393
- }
1394
- s.hooks = i;
1395
- }
1396
- if (n.walkTokens) {
1397
- const i = this.defaults.walkTokens, r = n.walkTokens;
1398
- s.walkTokens = function(l) {
1399
- let o = [];
1400
- return o.push(r.call(this, l)), i && (o = o.concat(i.call(this, l))), o;
1401
- };
1402
- }
1403
- this.defaults = { ...this.defaults, ...s };
1404
- }), this;
1405
- }
1406
- setOptions(e) {
1407
- return this.defaults = { ...this.defaults, ...e }, this;
1408
- }
1409
- lexer(e, t) {
1410
- return w.lex(e, t ?? this.defaults);
1411
- }
1412
- parser(e, t) {
1413
- return y.parse(e, t ?? this.defaults);
1414
- }
1415
- parseMarkdown(e) {
1416
- return (n, s) => {
1417
- const i = { ...s }, r = { ...this.defaults, ...i }, l = this.onError(!!r.silent, !!r.async);
1418
- if (this.defaults.async === !0 && i.async === !1)
1419
- return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1420
- if (typeof n > "u" || n === null)
1421
- return l(new Error("marked(): input parameter is undefined or null"));
1422
- if (typeof n != "string")
1423
- return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1424
- r.hooks && (r.hooks.options = r, r.hooks.block = e);
1425
- const o = r.hooks ? r.hooks.provideLexer() : e ? w.lex : w.lexInline, h = r.hooks ? r.hooks.provideParser() : e ? y.parse : y.parseInline;
1426
- if (r.async)
1427
- return Promise.resolve(r.hooks ? r.hooks.preprocess(n) : n).then((a) => o(a, r)).then((a) => r.hooks ? r.hooks.processAllTokens(a) : a).then((a) => r.walkTokens ? Promise.all(this.walkTokens(a, r.walkTokens)).then(() => a) : a).then((a) => h(a, r)).then((a) => r.hooks ? r.hooks.postprocess(a) : a).catch(l);
1428
- try {
1429
- r.hooks && (n = r.hooks.preprocess(n));
1430
- let a = o(n, r);
1431
- r.hooks && (a = r.hooks.processAllTokens(a)), r.walkTokens && this.walkTokens(a, r.walkTokens);
1432
- let p = h(a, r);
1433
- return r.hooks && (p = r.hooks.postprocess(p)), p;
1434
- } catch (a) {
1435
- return l(a);
1436
- }
1437
- };
1438
- }
1439
- onError(e, t) {
1440
- return (n) => {
1441
- if (n.message += `
1442
- Please report this to https://github.com/markedjs/marked.`, e) {
1443
- const s = "<p>An error occurred:</p><pre>" + b(n.message + "", !0) + "</pre>";
1444
- return t ? Promise.resolve(s) : s;
1445
- }
1446
- if (t)
1447
- return Promise.reject(n);
1448
- throw n;
1449
- };
1450
- }
1451
- }
1452
- const T = new Je();
1453
- function u(c, e) {
1454
- return T.parse(c, e);
1455
- }
1456
- u.options = u.setOptions = function(c) {
1457
- return T.setOptions(c), u.defaults = T.defaults, se(u.defaults), u;
1458
- };
1459
- u.getDefaults = Q;
1460
- u.defaults = z;
1461
- u.use = function(...c) {
1462
- return T.use(...c), u.defaults = T.defaults, se(u.defaults), u;
1463
- };
1464
- u.walkTokens = function(c, e) {
1465
- return T.walkTokens(c, e);
1466
- };
1467
- u.parseInline = T.parseInline;
1468
- u.Parser = y;
1469
- u.parser = y.parse;
1470
- u.Renderer = B;
1471
- u.TextRenderer = F;
1472
- u.Lexer = w;
1473
- u.lexer = w.lex;
1474
- u.Tokenizer = q;
1475
- u.Hooks = A;
1476
- u.parse = u;
1477
- u.options;
1478
- u.setOptions;
1479
- u.use;
1480
- u.walkTokens;
1481
- u.parseInline;
1482
- y.parse;
1483
- w.lex;
1484
- const Ke = {
1485
- name: "VsText",
1486
- mixins: [xe],
1487
- data() {
1488
- return {
1489
- markedText: null,
1490
- uniqueID: null
1491
- };
1492
- },
1493
- async mounted() {
1494
- this.uniqueID = this.widget;
1495
- try {
1496
- await this.getData(), this.markedText = u(this.sourceData);
1497
- } catch (c) {
1498
- console.error(c);
1499
- }
1500
- },
1501
- methods: {
1502
- onChangedData() {
1503
- return null;
1504
- }
1505
- }
1506
- }, Ye = ["id"], et = ["innerHTML"];
1507
- function tt(c, e, t, n, s, i) {
1508
- return J(), V("div", {
1509
- id: s.uniqueID,
1510
- class: "relative select-auto h-full rounded-xl text-[12px] box-border bg-white custom-scrollbar text-widget"
1511
- }, [
1512
- s.markedText ? (J(), V("div", {
1513
- key: 0,
1514
- innerHTML: s.markedText
1515
- }, null, 8, et)) : be("", !0)
1516
- ], 8, Ye);
1517
- }
1518
- const rt = /* @__PURE__ */ de(Ke, [["render", tt]]);
1519
- export {
1520
- rt as default
1521
- };