@wdprlib/render 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,4701 @@
1
+ var import_node_module = require("node:module");
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __moduleCache = /* @__PURE__ */ new WeakMap;
7
+ var __toCommonJS = (from) => {
8
+ var entry = __moduleCache.get(from), desc;
9
+ if (entry)
10
+ return entry;
11
+ entry = __defProp({}, "__esModule", { value: true });
12
+ if (from && typeof from === "object" || typeof from === "function")
13
+ __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ }));
17
+ __moduleCache.set(from, entry);
18
+ return entry;
19
+ };
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, {
23
+ get: all[name],
24
+ enumerable: true,
25
+ configurable: true,
26
+ set: (newValue) => all[name] = () => newValue
27
+ });
28
+ };
29
+
30
+ // packages/render/src/index.ts
31
+ var exports_src = {};
32
+ __export(exports_src, {
33
+ renderToHtml: () => renderToHtml
34
+ });
35
+ module.exports = __toCommonJS(exports_src);
36
+
37
+ // packages/render/src/escape.ts
38
+ function escapeHtml(text) {
39
+ return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
40
+ }
41
+ function escapeAttr(value) {
42
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
43
+ }
44
+ function escapeStyleContent(css) {
45
+ return css.replace(/<\/style/gi, "<\\/style");
46
+ }
47
+ var SAFE_ATTRIBUTES = new Set([
48
+ "accept",
49
+ "align",
50
+ "alt",
51
+ "autocapitalize",
52
+ "autoplay",
53
+ "background",
54
+ "bgcolor",
55
+ "border",
56
+ "buffered",
57
+ "checked",
58
+ "cite",
59
+ "class",
60
+ "cols",
61
+ "colspan",
62
+ "contenteditable",
63
+ "controls",
64
+ "coords",
65
+ "datetime",
66
+ "decoding",
67
+ "default",
68
+ "dir",
69
+ "dirname",
70
+ "disabled",
71
+ "download",
72
+ "draggable",
73
+ "for",
74
+ "form",
75
+ "headers",
76
+ "height",
77
+ "hidden",
78
+ "high",
79
+ "href",
80
+ "hreflang",
81
+ "id",
82
+ "inputmode",
83
+ "ismap",
84
+ "itemprop",
85
+ "kind",
86
+ "label",
87
+ "lang",
88
+ "list",
89
+ "loop",
90
+ "low",
91
+ "max",
92
+ "maxlength",
93
+ "min",
94
+ "minlength",
95
+ "multiple",
96
+ "muted",
97
+ "name",
98
+ "optimum",
99
+ "pattern",
100
+ "placeholder",
101
+ "poster",
102
+ "preload",
103
+ "readonly",
104
+ "required",
105
+ "reversed",
106
+ "role",
107
+ "rows",
108
+ "rowspan",
109
+ "scope",
110
+ "selected",
111
+ "shape",
112
+ "size",
113
+ "sizes",
114
+ "span",
115
+ "spellcheck",
116
+ "src",
117
+ "srclang",
118
+ "srcset",
119
+ "start",
120
+ "step",
121
+ "style",
122
+ "tabindex",
123
+ "target",
124
+ "title",
125
+ "translate",
126
+ "type",
127
+ "usemap",
128
+ "value",
129
+ "width",
130
+ "wrap"
131
+ ]);
132
+ function isSafeAttribute(name) {
133
+ const lower = name.toLowerCase();
134
+ if (lower.startsWith("on"))
135
+ return false;
136
+ if (lower.startsWith("aria-") || lower.startsWith("data-"))
137
+ return true;
138
+ return SAFE_ATTRIBUTES.has(lower);
139
+ }
140
+ function isDangerousUrl(value) {
141
+ const normalized = value.replace(/[\s\u0000-\u001f\u007f-\u009f]/g, "");
142
+ return /^(javascript|data|vbscript):/i.test(normalized);
143
+ }
144
+ var CSS_NAMED_COLORS = new Set([
145
+ "aliceblue",
146
+ "antiquewhite",
147
+ "aqua",
148
+ "aquamarine",
149
+ "azure",
150
+ "beige",
151
+ "bisque",
152
+ "black",
153
+ "blanchedalmond",
154
+ "blue",
155
+ "blueviolet",
156
+ "brown",
157
+ "burlywood",
158
+ "cadetblue",
159
+ "chartreuse",
160
+ "chocolate",
161
+ "coral",
162
+ "cornflowerblue",
163
+ "cornsilk",
164
+ "crimson",
165
+ "cyan",
166
+ "darkblue",
167
+ "darkcyan",
168
+ "darkgoldenrod",
169
+ "darkgray",
170
+ "darkgreen",
171
+ "darkgrey",
172
+ "darkkhaki",
173
+ "darkmagenta",
174
+ "darkolivegreen",
175
+ "darkorange",
176
+ "darkorchid",
177
+ "darkred",
178
+ "darksalmon",
179
+ "darkseagreen",
180
+ "darkslateblue",
181
+ "darkslategray",
182
+ "darkslategrey",
183
+ "darkturquoise",
184
+ "darkviolet",
185
+ "deeppink",
186
+ "deepskyblue",
187
+ "dimgray",
188
+ "dimgrey",
189
+ "dodgerblue",
190
+ "firebrick",
191
+ "floralwhite",
192
+ "forestgreen",
193
+ "fuchsia",
194
+ "gainsboro",
195
+ "ghostwhite",
196
+ "gold",
197
+ "goldenrod",
198
+ "gray",
199
+ "green",
200
+ "greenyellow",
201
+ "grey",
202
+ "honeydew",
203
+ "hotpink",
204
+ "indianred",
205
+ "indigo",
206
+ "ivory",
207
+ "khaki",
208
+ "lavender",
209
+ "lavenderblush",
210
+ "lawngreen",
211
+ "lemonchiffon",
212
+ "lightblue",
213
+ "lightcoral",
214
+ "lightcyan",
215
+ "lightgoldenrodyellow",
216
+ "lightgray",
217
+ "lightgreen",
218
+ "lightgrey",
219
+ "lightpink",
220
+ "lightsalmon",
221
+ "lightseagreen",
222
+ "lightskyblue",
223
+ "lightslategray",
224
+ "lightslategrey",
225
+ "lightsteelblue",
226
+ "lightyellow",
227
+ "lime",
228
+ "limegreen",
229
+ "linen",
230
+ "magenta",
231
+ "maroon",
232
+ "mediumaquamarine",
233
+ "mediumblue",
234
+ "mediumorchid",
235
+ "mediumpurple",
236
+ "mediumseagreen",
237
+ "mediumslateblue",
238
+ "mediumspringgreen",
239
+ "mediumturquoise",
240
+ "mediumvioletred",
241
+ "midnightblue",
242
+ "mintcream",
243
+ "mistyrose",
244
+ "moccasin",
245
+ "navajowhite",
246
+ "navy",
247
+ "oldlace",
248
+ "olive",
249
+ "olivedrab",
250
+ "orange",
251
+ "orangered",
252
+ "orchid",
253
+ "palegoldenrod",
254
+ "palegreen",
255
+ "paleturquoise",
256
+ "palevioletred",
257
+ "papayawhip",
258
+ "peachpuff",
259
+ "peru",
260
+ "pink",
261
+ "plum",
262
+ "powderblue",
263
+ "purple",
264
+ "rebeccapurple",
265
+ "red",
266
+ "rosybrown",
267
+ "royalblue",
268
+ "saddlebrown",
269
+ "salmon",
270
+ "sandybrown",
271
+ "seagreen",
272
+ "seashell",
273
+ "sienna",
274
+ "silver",
275
+ "skyblue",
276
+ "slateblue",
277
+ "slategray",
278
+ "slategrey",
279
+ "snow",
280
+ "springgreen",
281
+ "steelblue",
282
+ "tan",
283
+ "teal",
284
+ "thistle",
285
+ "tomato",
286
+ "turquoise",
287
+ "violet",
288
+ "wheat",
289
+ "white",
290
+ "whitesmoke",
291
+ "yellow",
292
+ "yellowgreen",
293
+ "transparent",
294
+ "currentcolor",
295
+ "inherit",
296
+ "initial",
297
+ "unset"
298
+ ]);
299
+ function isValidCssColor(color) {
300
+ const trimmed = color.trim().toLowerCase();
301
+ if (!trimmed)
302
+ return false;
303
+ if (CSS_NAMED_COLORS.has(trimmed))
304
+ return true;
305
+ if (/^#[0-9a-f]{3}([0-9a-f])?$/.test(trimmed) || /^#[0-9a-f]{6}([0-9a-f]{2})?$/.test(trimmed)) {
306
+ return true;
307
+ }
308
+ if (/^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*(,\s*(0|1|0?\.\d+))?\s*\)$/.test(trimmed)) {
309
+ return true;
310
+ }
311
+ if (/^hsla?\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*(,\s*(0|1|0?\.\d+))?\s*\)$/.test(trimmed)) {
312
+ return true;
313
+ }
314
+ return false;
315
+ }
316
+ function sanitizeCssColor(color, fallback = "inherit") {
317
+ return isValidCssColor(color) ? color : fallback;
318
+ }
319
+ function normalizeCssValue(value) {
320
+ let result = value;
321
+ result = result.replace(/\/\*[\s\S]*?\*\//g, "");
322
+ result = result.replace(/\\(?:\r\n|[\n\r\f])/g, "");
323
+ result = result.replace(/\\([0-9a-f]{1,6})\s?/gi, (_, hex) => {
324
+ const code = Number.parseInt(hex, 16);
325
+ return code > 0 && code <= 1114111 ? String.fromCodePoint(code) : "";
326
+ });
327
+ result = result.replace(/\\(.)/g, "$1");
328
+ result = result.replace(/[\s\u0000-\u001f\u007f-\u009f]/g, "");
329
+ return result.toLowerCase();
330
+ }
331
+ function isDangerousCssValue(value) {
332
+ const normalized = normalizeCssValue(value);
333
+ if (normalized.includes("url("))
334
+ return true;
335
+ if (normalized.includes("expression("))
336
+ return true;
337
+ if (normalized.includes("-moz-binding"))
338
+ return true;
339
+ if (normalized.includes("behavior:"))
340
+ return true;
341
+ if (normalized.includes("@import"))
342
+ return true;
343
+ return false;
344
+ }
345
+ function sanitizeStyleValue(style) {
346
+ const endsWithSemicolon = style.trimEnd().endsWith(";");
347
+ const declarations = style.split(";").map((d) => d.trim()).filter(Boolean);
348
+ const safe = [];
349
+ for (const decl of declarations) {
350
+ const colonIdx = decl.indexOf(":");
351
+ if (colonIdx === -1)
352
+ continue;
353
+ const property = decl.slice(0, colonIdx).trim().toLowerCase();
354
+ const value = decl.slice(colonIdx + 1).trim();
355
+ if (isDangerousCssValue(value))
356
+ continue;
357
+ if (property.startsWith("-moz-binding"))
358
+ continue;
359
+ if (property === "behavior")
360
+ continue;
361
+ safe.push(decl);
362
+ }
363
+ if (safe.length === 0)
364
+ return "";
365
+ return endsWithSemicolon ? safe.join(";") + ";" : safe.join(";");
366
+ }
367
+ function isValidEmail(email) {
368
+ return /^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(email);
369
+ }
370
+ var URL_ATTRIBUTES = new Set([
371
+ "href",
372
+ "src",
373
+ "action",
374
+ "formaction",
375
+ "srcset",
376
+ "poster",
377
+ "background"
378
+ ]);
379
+ function sanitizeAttributes(attributes) {
380
+ const result = {};
381
+ for (const [key, value] of Object.entries(attributes)) {
382
+ if (!isSafeAttribute(key))
383
+ continue;
384
+ const lower = key.toLowerCase();
385
+ if (URL_ATTRIBUTES.has(lower) && isDangerousUrl(value))
386
+ continue;
387
+ if (lower === "style") {
388
+ const sanitized = sanitizeStyleValue(value);
389
+ if (sanitized) {
390
+ result[key] = sanitized;
391
+ }
392
+ continue;
393
+ }
394
+ result[key] = value;
395
+ }
396
+ return result;
397
+ }
398
+
399
+ // packages/render/src/context.ts
400
+ class RenderContext {
401
+ chunks = [];
402
+ _tocIndex = 0;
403
+ _footnoteIndex = 0;
404
+ _equationIndex = 0;
405
+ _htmlBlockIndex = 0;
406
+ options;
407
+ footnotes;
408
+ styles;
409
+ htmlBlocks;
410
+ tocElements;
411
+ constructor(tree, options = {}) {
412
+ this.options = options;
413
+ this.footnotes = options.footnotes ?? tree.footnotes ?? [];
414
+ this.styles = tree.styles ?? [];
415
+ this.htmlBlocks = tree["html-blocks"] ?? [];
416
+ this.tocElements = tree["table-of-contents"] ?? [];
417
+ }
418
+ push(html) {
419
+ this.chunks.push(html);
420
+ }
421
+ pushEscaped(text) {
422
+ this.chunks.push(escapeHtml(text));
423
+ }
424
+ getOutput() {
425
+ return this.chunks.join("");
426
+ }
427
+ nextTocIndex() {
428
+ return this._tocIndex++;
429
+ }
430
+ nextFootnoteIndex() {
431
+ return this._footnoteIndex++;
432
+ }
433
+ nextEquationIndex() {
434
+ return this._equationIndex++;
435
+ }
436
+ nextHtmlBlockIndex() {
437
+ return this._htmlBlockIndex++;
438
+ }
439
+ get page() {
440
+ return this.options.page;
441
+ }
442
+ resolveImageSource(source) {
443
+ switch (source.type) {
444
+ case "url":
445
+ return source.data;
446
+ case "file1":
447
+ return `/local--files/${source.data.file}`;
448
+ case "file2":
449
+ return `/local--files/${source.data.page}/${source.data.file}`;
450
+ case "file3":
451
+ return `/local--files/${source.data.site}/${source.data.page}/${source.data.file}`;
452
+ }
453
+ }
454
+ resolvePageLink(location) {
455
+ if (typeof location === "string") {
456
+ return location;
457
+ }
458
+ if (location.site) {
459
+ return `https://${location.site}.wikidot.com/${location.page}`;
460
+ }
461
+ return `/${location.page}`;
462
+ }
463
+ renderAttributes(attributes) {
464
+ const safe = sanitizeAttributes(attributes);
465
+ let result = "";
466
+ for (const [key, value] of Object.entries(safe)) {
467
+ if (value !== "") {
468
+ result += ` ${key}="${escapeAttr(value)}"`;
469
+ } else {
470
+ result += ` ${key}=""`;
471
+ }
472
+ }
473
+ return result;
474
+ }
475
+ }
476
+
477
+ // packages/render/src/elements/container.ts
478
+ var import_ast = require("@wdprlib/ast");
479
+ function renderContainer(ctx, data) {
480
+ const { type, attributes, elements } = data;
481
+ if (import_ast.isHeaderType(type)) {
482
+ renderHeader(ctx, type.header.level, type.header["has-toc"], attributes, elements);
483
+ return;
484
+ }
485
+ if (import_ast.isAlignType(type)) {
486
+ ctx.push(`<div style="text-align: ${type.align};">`);
487
+ renderElements(ctx, elements);
488
+ ctx.push("</div>");
489
+ return;
490
+ }
491
+ if (import_ast.isStringContainerType(type)) {
492
+ renderStringContainer(ctx, type, attributes, elements);
493
+ }
494
+ }
495
+ function renderHeader(ctx, level, hasToc, attributes, elements) {
496
+ const tag = `h${level}`;
497
+ if (hasToc) {
498
+ const tocId = ctx.nextTocIndex();
499
+ ctx.push(`<${tag} id="toc${tocId}"${renderAttrs(attributes)}>`);
500
+ } else {
501
+ ctx.push(`<${tag}${renderAttrs(attributes)}>`);
502
+ }
503
+ ctx.push("<span>");
504
+ renderElements(ctx, elements);
505
+ ctx.push("</span>");
506
+ ctx.push(`</${tag}>`);
507
+ }
508
+ function renderStringContainer(ctx, type, attributes, elements) {
509
+ switch (type) {
510
+ case "paragraph":
511
+ ctx.push(`<p${renderAttrs(attributes)}>`);
512
+ renderElements(ctx, elements);
513
+ ctx.push("</p>");
514
+ break;
515
+ case "bold":
516
+ ctx.push(`<strong${renderAttrs(attributes)}>`);
517
+ renderElements(ctx, elements);
518
+ ctx.push("</strong>");
519
+ break;
520
+ case "italics":
521
+ ctx.push(`<em${renderAttrs(attributes)}>`);
522
+ renderElements(ctx, elements);
523
+ ctx.push("</em>");
524
+ break;
525
+ case "underline":
526
+ ctx.push(`<span style="text-decoration: underline;"${renderAttrs(attributes)}>`);
527
+ renderElements(ctx, elements);
528
+ ctx.push("</span>");
529
+ break;
530
+ case "strikethrough":
531
+ ctx.push(`<span style="text-decoration: line-through;"${renderAttrs(attributes)}>`);
532
+ renderElements(ctx, elements);
533
+ ctx.push("</span>");
534
+ break;
535
+ case "superscript":
536
+ ctx.push(`<sup${renderAttrs(attributes)}>`);
537
+ renderElements(ctx, elements);
538
+ ctx.push("</sup>");
539
+ break;
540
+ case "subscript":
541
+ ctx.push(`<sub${renderAttrs(attributes)}>`);
542
+ renderElements(ctx, elements);
543
+ ctx.push("</sub>");
544
+ break;
545
+ case "monospace":
546
+ ctx.push(`<tt${renderAttrs(attributes)}>`);
547
+ renderElements(ctx, elements);
548
+ ctx.push("</tt>");
549
+ break;
550
+ case "span":
551
+ ctx.push(`<span${renderAttrs(attributes)}>`);
552
+ renderElements(ctx, elements);
553
+ ctx.push("</span>");
554
+ break;
555
+ case "div":
556
+ ctx.push(`<div${renderAttrs(attributes)}>`);
557
+ renderElements(ctx, elements);
558
+ ctx.push("</div>");
559
+ break;
560
+ case "blockquote":
561
+ ctx.push(`<blockquote${renderAttrs(attributes)}>`);
562
+ renderElements(ctx, elements);
563
+ ctx.push("</blockquote>");
564
+ break;
565
+ case "mark":
566
+ ctx.push(`<mark${renderAttrs(attributes)}>`);
567
+ renderElements(ctx, elements);
568
+ ctx.push("</mark>");
569
+ break;
570
+ case "insertion":
571
+ ctx.push(`<ins${renderAttrs(attributes)}>`);
572
+ renderElements(ctx, elements);
573
+ ctx.push("</ins>");
574
+ break;
575
+ case "deletion":
576
+ ctx.push(`<del${renderAttrs(attributes)}>`);
577
+ renderElements(ctx, elements);
578
+ ctx.push("</del>");
579
+ break;
580
+ case "size":
581
+ renderSizeContainer(ctx, attributes, elements);
582
+ break;
583
+ case "hidden":
584
+ ctx.push(`<span style="display: none"${renderAttrs(attributes)}>`);
585
+ renderElements(ctx, elements);
586
+ ctx.push("</span>");
587
+ break;
588
+ case "invisible":
589
+ ctx.push(`<span style="visibility: hidden"${renderAttrs(attributes)}>`);
590
+ renderElements(ctx, elements);
591
+ ctx.push("</span>");
592
+ break;
593
+ case "ruby":
594
+ ctx.push(`<ruby${renderAttrs(attributes)}>`);
595
+ renderElements(ctx, elements);
596
+ ctx.push("</ruby>");
597
+ break;
598
+ case "ruby-text":
599
+ ctx.push(`<rt${renderAttrs(attributes)}>`);
600
+ renderElements(ctx, elements);
601
+ ctx.push("</rt>");
602
+ break;
603
+ case "heading":
604
+ renderElements(ctx, elements);
605
+ break;
606
+ case "collapsible":
607
+ renderElements(ctx, elements);
608
+ break;
609
+ case "definition-list":
610
+ ctx.push("<dl>");
611
+ renderElements(ctx, elements);
612
+ ctx.push("</dl>");
613
+ break;
614
+ case "definition-list-item":
615
+ renderElements(ctx, elements);
616
+ break;
617
+ case "definition-list-key":
618
+ ctx.push("<dt>");
619
+ renderElements(ctx, elements);
620
+ ctx.push("</dt>");
621
+ break;
622
+ case "definition-list-value":
623
+ ctx.push("<dd>");
624
+ renderElements(ctx, elements);
625
+ ctx.push("</dd>");
626
+ break;
627
+ case "table-row":
628
+ ctx.push(`<tr${renderAttrs(attributes)}>`);
629
+ renderElements(ctx, elements);
630
+ ctx.push("</tr>");
631
+ break;
632
+ case "table-cell":
633
+ ctx.push(`<td${renderAttrs(attributes)}>`);
634
+ renderElements(ctx, elements);
635
+ ctx.push("</td>");
636
+ break;
637
+ default:
638
+ renderElements(ctx, elements);
639
+ }
640
+ }
641
+ function renderSizeContainer(ctx, attributes, elements) {
642
+ const style = attributes.style ?? "";
643
+ const existingAttrs = { ...attributes };
644
+ if (!style.includes("font-size")) {
645
+ ctx.push(`<span${renderAttrs(existingAttrs)}>`);
646
+ } else {
647
+ ctx.push(`<span${renderAttrs(existingAttrs)}>`);
648
+ }
649
+ renderElements(ctx, elements);
650
+ ctx.push("</span>");
651
+ }
652
+ function renderAttrs(attributes) {
653
+ const safe = sanitizeAttributes(attributes);
654
+ let result = "";
655
+ for (const [key, value] of Object.entries(safe)) {
656
+ if (key.startsWith("_"))
657
+ continue;
658
+ if (value !== "") {
659
+ result += ` ${key}="${escapeAttr(value)}"`;
660
+ } else {
661
+ result += ` ${key}=""`;
662
+ }
663
+ }
664
+ return result;
665
+ }
666
+
667
+ // packages/render/src/elements/text.ts
668
+ function renderText(ctx, data) {
669
+ ctx.pushEscaped(data);
670
+ }
671
+ function renderRaw(ctx, data) {
672
+ if (data === "")
673
+ return;
674
+ ctx.push(`<span style="white-space: pre-wrap;">`);
675
+ ctx.push(escapeHtml(data));
676
+ ctx.push("</span>");
677
+ }
678
+ function renderEmail(ctx, email) {
679
+ if (!isValidEmail(email)) {
680
+ ctx.pushEscaped(email);
681
+ return;
682
+ }
683
+ ctx.push(`<a href="mailto:${escapeAttr(email)}">${escapeHtml(email)}</a>`);
684
+ }
685
+
686
+ // packages/render/src/elements/link.ts
687
+ function renderLink(ctx, data) {
688
+ let href = ctx.resolvePageLink(data.link);
689
+ if (data.extra) {
690
+ href += data.extra;
691
+ }
692
+ const isAnchorJsVoid = data.type === "anchor" && href === "javascript:;";
693
+ if (!isAnchorJsVoid && isDangerousUrl(href)) {
694
+ href = "#invalid-url";
695
+ }
696
+ const attrs = [`href="${escapeAttr(href)}"`];
697
+ if (data.target) {
698
+ const targetMap = {
699
+ "new-tab": "_blank",
700
+ parent: "_parent",
701
+ top: "_top",
702
+ same: "_self"
703
+ };
704
+ const targetValue = targetMap[data.target] ?? "_blank";
705
+ attrs.push(`target="${targetValue}"`);
706
+ if (targetValue === "_blank") {
707
+ attrs.push(`rel="noopener noreferrer"`);
708
+ }
709
+ }
710
+ ctx.push(`<a ${attrs.join(" ")}>`);
711
+ renderLinkLabel(ctx, data);
712
+ ctx.push("</a>");
713
+ }
714
+ function renderLinkLabel(ctx, data) {
715
+ if (data.label === "page") {
716
+ if (typeof data.link === "string") {
717
+ ctx.pushEscaped(data.link);
718
+ } else {
719
+ ctx.pushEscaped(data.link.page);
720
+ }
721
+ return;
722
+ }
723
+ if ("text" in data.label) {
724
+ ctx.pushEscaped(data.label.text);
725
+ return;
726
+ }
727
+ if ("url" in data.label) {
728
+ const href = ctx.resolvePageLink(data.link);
729
+ ctx.pushEscaped(data.label.url ?? href);
730
+ }
731
+ }
732
+ function renderAnchor(ctx, data) {
733
+ const safe = sanitizeAttributes(data.attributes);
734
+ const attrs = [];
735
+ if (safe.href && isDangerousUrl(safe.href)) {
736
+ safe.href = "#invalid-url";
737
+ }
738
+ const href = safe.href ?? "";
739
+ attrs.push(`href="${escapeAttr(href)}"`);
740
+ if (data.target) {
741
+ const targetMap = {
742
+ "new-tab": "_blank",
743
+ parent: "_parent",
744
+ top: "_top",
745
+ same: "_self"
746
+ };
747
+ const targetValue = targetMap[data.target] ?? "_blank";
748
+ attrs.push(`target="${targetValue}"`);
749
+ if (targetValue === "_blank") {
750
+ attrs.push(`rel="noopener noreferrer"`);
751
+ }
752
+ }
753
+ for (const [key, value] of Object.entries(safe)) {
754
+ if (key === "href" || key === "target")
755
+ continue;
756
+ attrs.push(`${key}="${escapeAttr(value)}"`);
757
+ }
758
+ ctx.push(`<a ${attrs.join(" ")}>`);
759
+ renderElements(ctx, data.elements);
760
+ ctx.push("</a>");
761
+ }
762
+ function renderAnchorName(ctx, name) {
763
+ ctx.push(`<a name="${escapeAttr(name)}"></a>`);
764
+ }
765
+
766
+ // packages/render/src/elements/image.ts
767
+ function renderImage(ctx, data) {
768
+ let src = ctx.resolveImageSource(data.source);
769
+ if (isDangerousUrl(src)) {
770
+ src = "#invalid-url";
771
+ }
772
+ const safeAttrs = sanitizeAttributes(data.attributes);
773
+ const alt = safeAttrs.alt ?? getFilenameFromSource(data.source);
774
+ const className = safeAttrs.class ?? "image";
775
+ const imgAttrs = [`src="${escapeAttr(src)}"`];
776
+ for (const [key, value] of Object.entries(safeAttrs)) {
777
+ if (key === "alt" || key === "class" || key === "src" || key === "srcset")
778
+ continue;
779
+ imgAttrs.push(`${key}="${escapeAttr(value)}"`);
780
+ }
781
+ imgAttrs.push(`alt="${escapeAttr(alt)}"`);
782
+ if (!safeAttrs.class) {
783
+ imgAttrs.push(`class="${escapeAttr(className)}"`);
784
+ } else {
785
+ imgAttrs.push(`class="${escapeAttr(safeAttrs.class)}"`);
786
+ }
787
+ const imgTag = `<img ${imgAttrs.join(" ")} />`;
788
+ let output = imgTag;
789
+ if (data.link) {
790
+ let href = typeof data.link === "string" ? data.link : `/${data.link.page}`;
791
+ if (isDangerousUrl(href)) {
792
+ href = "#invalid-url";
793
+ }
794
+ output = `<a href="${escapeAttr(href)}">${imgTag}</a>`;
795
+ }
796
+ if (data.alignment) {
797
+ const alignClass = getAlignmentClass(data.alignment.align, data.alignment.float);
798
+ ctx.push(`<div class="image-container ${alignClass}">`);
799
+ ctx.push(output);
800
+ ctx.push("</div>");
801
+ } else {
802
+ ctx.push(output);
803
+ }
804
+ }
805
+ function getAlignmentClass(align, isFloat) {
806
+ if (isFloat) {
807
+ return align === "left" ? "floatleft" : "floatright";
808
+ }
809
+ switch (align) {
810
+ case "left":
811
+ return "alignleft";
812
+ case "right":
813
+ return "alignright";
814
+ case "center":
815
+ return "aligncenter";
816
+ default:
817
+ return `align${align}`;
818
+ }
819
+ }
820
+ function getFilenameFromSource(source) {
821
+ switch (source.type) {
822
+ case "url": {
823
+ const parts = source.data.split("/");
824
+ return parts[parts.length - 1] ?? source.data;
825
+ }
826
+ case "file1":
827
+ return source.data.file;
828
+ case "file2":
829
+ return source.data.file;
830
+ case "file3":
831
+ return source.data.file;
832
+ }
833
+ }
834
+
835
+ // packages/render/src/elements/list.ts
836
+ function renderList(ctx, data) {
837
+ const tag = data.type === "numbered" ? "ol" : "ul";
838
+ ctx.push(`<${tag}${renderListAttrs(data.attributes)}>`);
839
+ const items = data.items;
840
+ let i = 0;
841
+ while (i < items.length) {
842
+ const item = items[i];
843
+ if (item["item-type"] === "elements") {
844
+ ctx.push(`<li${renderListAttrs(item.attributes)}>`);
845
+ renderElements(ctx, item.elements);
846
+ while (i + 1 < items.length && items[i + 1]["item-type"] === "sub-list") {
847
+ i++;
848
+ const subItem = items[i];
849
+ renderList(ctx, subItem.data);
850
+ }
851
+ ctx.push("</li>");
852
+ } else {
853
+ const subItem = item;
854
+ ctx.push(`<li style="list-style: none; display: inline">`);
855
+ renderList(ctx, subItem.data);
856
+ ctx.push("</li>");
857
+ }
858
+ i++;
859
+ }
860
+ ctx.push(`</${tag}>`);
861
+ }
862
+ function renderListAttrs(attributes) {
863
+ const safe = sanitizeAttributes(attributes);
864
+ let result = "";
865
+ for (const [key, value] of Object.entries(safe)) {
866
+ if (key.startsWith("_"))
867
+ continue;
868
+ result += ` ${key}="${escapeAttr(value)}"`;
869
+ }
870
+ return result;
871
+ }
872
+ function renderDefinitionList(ctx, items) {
873
+ ctx.push("<dl>");
874
+ for (const item of items) {
875
+ ctx.push("<dt>");
876
+ renderElements(ctx, item.key);
877
+ ctx.push("</dt>");
878
+ ctx.push("<dd>");
879
+ renderElements(ctx, item.value);
880
+ ctx.push("</dd>");
881
+ }
882
+ ctx.push("</dl>");
883
+ }
884
+
885
+ // packages/render/src/elements/table.ts
886
+ function renderTable(ctx, data) {
887
+ const isPipeTable = data.attributes._source === "pipe";
888
+ const classAttr = isPipeTable ? ' class="wiki-content-table"' : "";
889
+ ctx.push(`<table${classAttr}${renderTableAttrs(data.attributes)}>`);
890
+ for (const row of data.rows) {
891
+ ctx.push(`<tr${renderTableAttrs(row.attributes)}>`);
892
+ for (const cell of row.cells) {
893
+ const tag = cell.header ? "th" : "td";
894
+ const attrs = [];
895
+ const safeCellAttrs = sanitizeAttributes(cell.attributes);
896
+ if (cell["column-span"] > 1) {
897
+ attrs.push(`colspan="${cell["column-span"]}"`);
898
+ }
899
+ if (safeCellAttrs.rowspan) {
900
+ const rowspan = parseInt(safeCellAttrs.rowspan, 10);
901
+ if (rowspan > 1) {
902
+ attrs.push(`rowspan="${rowspan}"`);
903
+ }
904
+ }
905
+ if (cell.align) {
906
+ const existingStyle = safeCellAttrs.style ?? "";
907
+ const alignStyle = `text-align: ${cell.align};`;
908
+ if (existingStyle) {
909
+ attrs.push(`style="${escapeAttr(existingStyle + "; " + alignStyle)}"`);
910
+ } else {
911
+ attrs.push(`style="${alignStyle}"`);
912
+ }
913
+ }
914
+ for (const [key, value] of Object.entries(safeCellAttrs)) {
915
+ if (key === "style" && cell.align)
916
+ continue;
917
+ if (key === "rowspan")
918
+ continue;
919
+ attrs.push(`${key}="${escapeAttr(value)}"`);
920
+ }
921
+ const attrStr = attrs.length > 0 ? " " + attrs.join(" ") : "";
922
+ ctx.push(`<${tag}${attrStr}>`);
923
+ renderElements(ctx, cell.elements);
924
+ ctx.push(`</${tag}>`);
925
+ }
926
+ ctx.push("</tr>");
927
+ }
928
+ ctx.push("</table>");
929
+ }
930
+ function renderTableAttrs(attributes) {
931
+ const safe = sanitizeAttributes(attributes);
932
+ let result = "";
933
+ for (const [key, value] of Object.entries(safe)) {
934
+ if (key.startsWith("_"))
935
+ continue;
936
+ result += ` ${key}="${escapeAttr(value)}"`;
937
+ }
938
+ return result;
939
+ }
940
+
941
+ // packages/render/src/elements/collapsible.ts
942
+ function renderCollapsible(ctx, data) {
943
+ const startOpen = data["start-open"];
944
+ const showTop = data["show-top"];
945
+ const showBottom = data["show-bottom"];
946
+ const showLabel = data["show-text"] ? formatLabelText(data["show-text"]) : formatCollapsibleText("+", "show block");
947
+ const hideLabel = data["hide-text"] ? formatLabelText(data["hide-text"]) : formatCollapsibleText("–", "hide block");
948
+ ctx.push(`<div class="collapsible-block">`);
949
+ const foldedStyle = startOpen ? ` style="display:none"` : "";
950
+ ctx.push(`<div class="collapsible-block-folded"${foldedStyle}>`);
951
+ ctx.push(`<a class="collapsible-block-link" href="javascript:;">${showLabel}</a>`);
952
+ ctx.push("</div>");
953
+ const unfoldedStyle = startOpen ? "" : ` style="display:none"`;
954
+ ctx.push(`<div class="collapsible-block-unfolded"${unfoldedStyle}>`);
955
+ if (showTop || !showTop && !showBottom) {
956
+ ctx.push(`<div class="collapsible-block-unfolded-link">`);
957
+ ctx.push(`<a class="collapsible-block-link" href="javascript:;">${hideLabel}</a>`);
958
+ ctx.push("</div>");
959
+ }
960
+ ctx.push(`<div class="collapsible-block-content">`);
961
+ renderElements(ctx, data.elements);
962
+ ctx.push("</div>");
963
+ if (showBottom) {
964
+ ctx.push(`<div class="collapsible-block-unfolded-link">`);
965
+ ctx.push(`<a class="collapsible-block-link" href="javascript:;">${hideLabel}</a>`);
966
+ ctx.push("</div>");
967
+ }
968
+ ctx.push("</div>");
969
+ ctx.push("</div>");
970
+ }
971
+ function formatCollapsibleText(prefix, text) {
972
+ const encoded = escapeHtml(text).replace(/ /g, "&nbsp;");
973
+ return `${prefix}&nbsp;${encoded}`;
974
+ }
975
+ function formatLabelText(text) {
976
+ return escapeHtml(text).replace(/ /g, "&nbsp;");
977
+ }
978
+
979
+ // packages/render/src/libs/highlighter/engine.ts
980
+ function tokenize(def, input) {
981
+ let str = input.replace(/\r\n/g, `
982
+ `);
983
+ str = str.replace(/^$/gm, " ");
984
+ str = str.replace(/\t/g, " ");
985
+ str = str.replace(/\s+$/, "");
986
+ const len = str.length;
987
+ if (len === 0)
988
+ return [];
989
+ let state = -1;
990
+ let pos = 0;
991
+ let lastinner = def.defClass;
992
+ let lastdelim = def.defClass;
993
+ let endpattern = null;
994
+ const stateStack = [];
995
+ const tokenStack = [];
996
+ const result = [];
997
+ function getToken() {
998
+ if (tokenStack.length > 0) {
999
+ return tokenStack.pop();
1000
+ }
1001
+ if (pos >= len) {
1002
+ return null;
1003
+ }
1004
+ let endpos = -1;
1005
+ let endmatch = "";
1006
+ if (state !== -1 && endpattern) {
1007
+ endpattern.lastIndex = pos;
1008
+ const em = endpattern.exec(str);
1009
+ if (em) {
1010
+ endpos = em.index;
1011
+ endmatch = em[0];
1012
+ }
1013
+ }
1014
+ const reg = def.regs[state];
1015
+ if (reg) {
1016
+ reg.lastIndex = pos;
1017
+ const m = reg.exec(str);
1018
+ if (m) {
1019
+ const countsArr = def.counts[state];
1020
+ const statesArr = def.states[state];
1021
+ const delimArr = def.delim[state];
1022
+ const innerArr = def.inner[state];
1023
+ let n = 1;
1024
+ for (let i = 0;i < countsArr.length; i++) {
1025
+ const count = countsArr[i];
1026
+ if (n >= m.length)
1027
+ break;
1028
+ if (m[n] != null && (endpos === -1 || m.index < endpos)) {
1029
+ const matchStart = m.index;
1030
+ const matchStr = m[n];
1031
+ const groupStart = findGroupPosition(str, m, n, matchStart);
1032
+ if (statesArr[i] !== -1) {
1033
+ tokenStack.push({ class: delimArr[i], content: matchStr });
1034
+ } else {
1035
+ let inner = innerArr[i];
1036
+ const partDef = def.parts[state]?.[i];
1037
+ if (partDef) {
1038
+ const parts = [];
1039
+ let partpos = groupStart;
1040
+ for (let j = 1;j <= count; j++) {
1041
+ const subIdx = j + n;
1042
+ if (subIdx >= m.length || m[subIdx] == null || m[subIdx] === "")
1043
+ continue;
1044
+ const subStr = m[subIdx];
1045
+ const subStart = str.indexOf(subStr, partpos);
1046
+ if (subStart < 0)
1047
+ continue;
1048
+ if (partDef[j]) {
1049
+ if (subStart > partpos) {
1050
+ parts.unshift({ class: inner, content: str.substring(partpos, subStart) });
1051
+ }
1052
+ parts.unshift({ class: partDef[j], content: subStr });
1053
+ }
1054
+ partpos = subStart + subStr.length;
1055
+ }
1056
+ if (partpos < groupStart + matchStr.length) {
1057
+ parts.unshift({
1058
+ class: inner,
1059
+ content: str.substring(partpos, groupStart + matchStr.length)
1060
+ });
1061
+ }
1062
+ tokenStack.push(...parts);
1063
+ } else {
1064
+ let kwDef = def.keywords[state]?.[i];
1065
+ if (!kwDef || kwDef === -1 || typeof kwDef !== "object" || Object.keys(kwDef).length === 0) {
1066
+ kwDef = def.keywords[-1]?.[i];
1067
+ }
1068
+ if (kwDef && kwDef !== -1 && typeof kwDef === "object") {
1069
+ for (const [group, re] of Object.entries(kwDef)) {
1070
+ if (re.test(matchStr)) {
1071
+ inner = def.kwmap[group] ?? inner;
1072
+ break;
1073
+ }
1074
+ }
1075
+ }
1076
+ tokenStack.push({ class: inner, content: matchStr });
1077
+ }
1078
+ }
1079
+ if (groupStart > pos) {
1080
+ tokenStack.push({ class: lastinner, content: str.substring(pos, groupStart) });
1081
+ }
1082
+ pos = groupStart + matchStr.length;
1083
+ if (statesArr[i] !== -1) {
1084
+ stateStack.push({ state, lastdelim, lastinner, endpattern });
1085
+ lastinner = innerArr[i];
1086
+ lastdelim = delimArr[i];
1087
+ const prevState = state;
1088
+ state = statesArr[i];
1089
+ const endRe = def.end[state];
1090
+ if (def.subst[prevState]?.[i] && endRe) {
1091
+ let epSource = endRe.source;
1092
+ for (let k = 0;k <= count; k++) {
1093
+ const subIdx = n + k;
1094
+ if (subIdx >= m.length || m[subIdx] == null)
1095
+ break;
1096
+ const quoted = escapeRegex(m[subIdx]);
1097
+ epSource = epSource.replace(`%${k}%`, quoted);
1098
+ epSource = epSource.replace(`%b${k}%`, matchingBrackets(quoted));
1099
+ }
1100
+ endpattern = new RegExp(epSource, endRe.flags);
1101
+ } else {
1102
+ endpattern = endRe ?? null;
1103
+ }
1104
+ }
1105
+ return tokenStack.pop();
1106
+ }
1107
+ n += count + 1;
1108
+ }
1109
+ }
1110
+ }
1111
+ if (endpos > -1) {
1112
+ tokenStack.push({ class: lastdelim, content: endmatch });
1113
+ if (endpos > pos) {
1114
+ tokenStack.push({ class: lastinner, content: str.substring(pos, endpos) });
1115
+ }
1116
+ const prev = stateStack.pop();
1117
+ state = prev.state;
1118
+ lastdelim = prev.lastdelim;
1119
+ lastinner = prev.lastinner;
1120
+ endpattern = prev.endpattern;
1121
+ pos = endpos + endmatch.length;
1122
+ if (tokenStack.length > 0) {
1123
+ return tokenStack.pop();
1124
+ }
1125
+ return getToken();
1126
+ }
1127
+ const p = pos;
1128
+ pos = len;
1129
+ return { class: lastinner, content: str.substring(p) };
1130
+ }
1131
+ let token;
1132
+ while ((token = getToken()) !== null) {
1133
+ result.push(token);
1134
+ }
1135
+ return result;
1136
+ }
1137
+ function findGroupPosition(str, m, n, matchStart) {
1138
+ const groupStr = m[n];
1139
+ const idx = str.indexOf(groupStr, matchStart);
1140
+ return idx >= 0 ? idx : matchStart;
1141
+ }
1142
+ function renderTokens(tokens) {
1143
+ if (tokens.length === 0)
1144
+ return "";
1145
+ let html = "";
1146
+ let lastClass = "";
1147
+ for (const token of tokens) {
1148
+ if (token.content.length === 0)
1149
+ continue;
1150
+ const escaped = escapeHtml2(token.content);
1151
+ if (token.class !== lastClass) {
1152
+ if (lastClass) {
1153
+ html += "</span>";
1154
+ }
1155
+ html += `<span class="hl-${token.class}">`;
1156
+ lastClass = token.class;
1157
+ }
1158
+ html += escaped;
1159
+ }
1160
+ if (lastClass) {
1161
+ html += "</span>";
1162
+ }
1163
+ return `<div class="hl-main"><pre>${html}</pre></div>`;
1164
+ }
1165
+ function escapeHtml2(str) {
1166
+ return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1167
+ }
1168
+ function escapeRegex(str) {
1169
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1170
+ }
1171
+ function matchingBrackets(str) {
1172
+ return str.replace(/[()<>[\]{}]/g, (c) => {
1173
+ const map = {
1174
+ "(": ")",
1175
+ ")": "(",
1176
+ "<": ">",
1177
+ ">": "<",
1178
+ "[": "]",
1179
+ "]": "[",
1180
+ "{": "}",
1181
+ "}": "{"
1182
+ };
1183
+ return map[c] ?? c;
1184
+ });
1185
+ }
1186
+
1187
+ // packages/render/src/libs/highlighter/languages/css.ts
1188
+ var cssLang = {
1189
+ language: "css",
1190
+ defClass: "code",
1191
+ regs: {
1192
+ [-1]: /((@[a-z\d]+))|((((\.|#)?[a-z]+[a-z\d-]*(?![a-z\d-]))|(\*))(?!\s*:\s*[\s{]))|(:[a-z][a-z\d-]*)|(\[)|(\{)/gi,
1193
+ 0: /(\d*\.?\d+(%|em|ex|pc|pt|px|in|mm|cm))|(\d*\.?\d+)|([a-z][a-z\d-]*)|(#([\da-f]{6}|[\da-f]{3})\b)/gi,
1194
+ 1: /(')|(")|([\w\-:]+)/gi,
1195
+ 2: /([a-z][a-z\d-]*\s*:)|((((\.|#)?[a-z]+[a-z\d-]*(?![a-z\d-]))|(\*))(?!\s*:\s*[\s{]))|(\{)/gi,
1196
+ 3: /(\\[\\(\\)\\])/gi,
1197
+ 4: /(\\\\|\\"|\\'|\\`)/gi,
1198
+ 5: /(\\\\|\\"|\\'|\\`|\\t|\\n|\\r)/gi
1199
+ },
1200
+ counts: {
1201
+ [-1]: [1, 4, 0, 0, 0],
1202
+ 0: [1, 0, 0, 1],
1203
+ 1: [0, 0, 0],
1204
+ 2: [0, 4, 0],
1205
+ 3: [0],
1206
+ 4: [0],
1207
+ 5: [0]
1208
+ },
1209
+ delim: {
1210
+ [-1]: ["", "", "", "brackets", "brackets"],
1211
+ 0: ["", "", "", ""],
1212
+ 1: ["quotes", "quotes", ""],
1213
+ 2: ["reserved", "", "brackets"],
1214
+ 3: [""],
1215
+ 4: [""],
1216
+ 5: [""]
1217
+ },
1218
+ inner: {
1219
+ [-1]: ["var", "identifier", "special", "code", "code"],
1220
+ 0: ["number", "number", "code", "var"],
1221
+ 1: ["string", "string", "var"],
1222
+ 2: ["code", "identifier", "code"],
1223
+ 3: ["string"],
1224
+ 4: ["special"],
1225
+ 5: ["special"]
1226
+ },
1227
+ end: {
1228
+ 0: /(?=;|\})/gi,
1229
+ 1: /\]/gi,
1230
+ 2: /\}/gi,
1231
+ 3: /\)/gi,
1232
+ 4: /'/gi,
1233
+ 5: /"/gi
1234
+ },
1235
+ states: {
1236
+ [-1]: [-1, -1, -1, 1, 2],
1237
+ 0: [-1, -1, -1, -1],
1238
+ 1: [4, 5, -1],
1239
+ 2: [0, -1, 2],
1240
+ 3: [-1],
1241
+ 4: [-1],
1242
+ 5: [-1]
1243
+ },
1244
+ keywords: {
1245
+ [-1]: [{}, {}, {}, -1, -1],
1246
+ 0: [
1247
+ {},
1248
+ {},
1249
+ {
1250
+ propertyValue: /^(?:far-left|left|center-left|center-right|center|far-right|right-side|right|behind|leftwards|rightwards|inherit|scroll|fixed|transparent|none|repeat-x|repeat-y|repeat|no-repeat|collapse|separate|auto|top|bottom|both|open-quote|close-quote|no-open-quote|no-close-quote|crosshair|default|pointer|move|e-resize|ne-resize|nw-resize|n-resize|se-resize|sw-resize|s-resize|text|wait|help|ltr|rtl|inline|block|list-item|run-in|compact|marker|table|inline-table|table-row-group|table-header-group|table-footer-group|table-row|table-column-group|table-column|table-cell|table-caption|below|level|above|higher|lower|show|hide|caption|icon|menu|message-box|small-caption|status-bar|normal|wider|narrower|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|italic|oblique|small-caps|bold|bolder|lighter|inside|outside|disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman|lower-greek|lower-alpha|lower-latin|upper-alpha|upper-latin|hebrew|armenian|georgian|cjk-ideographic|hiragana|katakana|hiragana-iroha|katakana-iroha|crop|cross|invert|visible|hidden|always|avoid|x-low|low|medium|high|x-high|mix?|repeat?|static|relative|absolute|portrait|landscape|spell-out|once|digits|continuous|code|x-slow|slow|fast|x-fast|faster|slower|justify|underline|overline|line-through|blink|capitalize|uppercase|lowercase|embed|bidi-override|baseline|sub|super|text-top|middle|text-bottom|silent|x-soft|soft|loud|x-loud|pre|nowrap|serif|sans-serif|cursive|fantasy|monospace|empty|string|strict|loose|char|true|false|dotted|dashed|solid|double|groove|ridge|inset|outset|larger|smaller|xx-small|x-small|small|large|x-large|xx-large|all|newspaper|distribute|distribute-all-lines|distribute-center-last|inter-word|inter-ideograph|inter-cluster|kashida|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|keep-all|break-all|break-word|lr-tb|tb-rl|thin|thick|inline-block|w-resize|hand|distribute-letter|distribute-space|whitespace|male|female|child)$/i,
1251
+ namedcolor: /^(?:aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|purple|red|silver|teal|white|yellow|activeborder|activecaption|appworkspace|background|buttonface|buttonhighlight|buttonshadow|buttontext|captiontext|graytext|highlight|highlighttext|inactiveborder|inactivecaption|inactivecaptiontext|infobackground|infotext|menu|menutext|scrollbar|threeddarkshadow|threedface|threedhighlight|threedlightshadow|threedshadow|window|windowframe|windowtext)$/i
1252
+ },
1253
+ {}
1254
+ ],
1255
+ 1: [-1, -1, {}],
1256
+ 2: [-1, {}, -1],
1257
+ 3: [{}],
1258
+ 4: [{}],
1259
+ 5: [{}]
1260
+ },
1261
+ kwmap: {
1262
+ propertyValue: "string",
1263
+ namedcolor: "var"
1264
+ },
1265
+ parts: {
1266
+ 0: [{ 1: "string" }, null, null, null],
1267
+ 1: [null, null, null],
1268
+ 2: [null, null, null],
1269
+ 3: [null],
1270
+ 4: [null],
1271
+ 5: [null]
1272
+ },
1273
+ subst: {
1274
+ [-1]: [false, false, false, false, false],
1275
+ 0: [false, false, false, false],
1276
+ 1: [false, false, false],
1277
+ 2: [false, false, false],
1278
+ 3: [false],
1279
+ 4: [false],
1280
+ 5: [false]
1281
+ }
1282
+ };
1283
+
1284
+ // packages/render/src/libs/highlighter/languages/cpp.ts
1285
+ var cppLang = {
1286
+ language: "cpp",
1287
+ defClass: "code",
1288
+ regs: {
1289
+ [-1]: /(")|(\{)|(\()|(\[)|([a-z_]\w*)|(^[ \t]*#include)|(^[ \t]*#[ \t]*[a-z]+)|(\d*\.?\d+)|(\/\*)|(\/\/.+)/gim,
1290
+ 0: /(\\)/gi,
1291
+ 1: /(")|(\{)|(\()|(\[)|([a-z_]\w*)|(\b0[xX][\da-f]+)|(\b\d\d*|\b0\b)|(\b0[0-7]+)|(\b(\d*\.\d+)|(\d+\.\d*))|(^[ \t]*#include)|(^[ \t]*#[ \t]*[a-z]+)|(\d*\.?\d+)|(\/\*)|(\/\/.+)/gim,
1292
+ 2: /(")|(\{)|(\()|(\[)|([a-z_]\w*)|(\b0[xX][\da-f]+)|(\b\d\d*|\b0\b)|(\b0[0-7]+)|(\b(\d*\.\d+)|(\d+\.\d*))|(^[ \t]*#include)|(^[ \t]*#[ \t]*[a-z]+)|(\d*\.?\d+)|(\/\*)|(\/\/.+)/gim,
1293
+ 3: /(")|(\{)|(\()|(\[)|([a-z_]\w*)|(\b0[xX][\da-f]+)|(\b\d\d*|\b0\b)|(\b0[0-7]+)|(\b(\d*\.\d+)|(\d+\.\d*))|(^[ \t]*#include)|(^[ \t]*#[ \t]*[a-z]+)|(\d*\.?\d+)|(\/\*)|(\/\/.+)/gim,
1294
+ 4: null,
1295
+ 5: /(")|(<)/gi,
1296
+ 6: /(")|(\{)|(\()|([a-z_]\w*)|(\b0[xX][\da-f]+)|(\b\d\d*|\b0\b)|(\b0[0-7]+)|(\b(\d*\.\d+)|(\d+\.\d*))|(\/\*)|(\/\/.+)/gi,
1297
+ 7: /(\$\w+\s*:.+\$)/gi,
1298
+ 8: /(\$\w+\s*:.+\$)/gi
1299
+ },
1300
+ counts: {
1301
+ [-1]: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
1302
+ 0: [0],
1303
+ 1: [0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0],
1304
+ 2: [0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0],
1305
+ 3: [0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0],
1306
+ 4: [],
1307
+ 5: [0, 0],
1308
+ 6: [0, 0, 0, 0, 0, 0, 0, 2, 0, 0],
1309
+ 7: [0],
1310
+ 8: [0]
1311
+ },
1312
+ delim: {
1313
+ [-1]: [
1314
+ "quotes",
1315
+ "brackets",
1316
+ "brackets",
1317
+ "brackets",
1318
+ "",
1319
+ "prepro",
1320
+ "prepro",
1321
+ "",
1322
+ "mlcomment",
1323
+ "comment"
1324
+ ],
1325
+ 0: [""],
1326
+ 1: [
1327
+ "quotes",
1328
+ "brackets",
1329
+ "brackets",
1330
+ "brackets",
1331
+ "",
1332
+ "",
1333
+ "",
1334
+ "",
1335
+ "",
1336
+ "prepro",
1337
+ "prepro",
1338
+ "",
1339
+ "mlcomment",
1340
+ "comment"
1341
+ ],
1342
+ 2: [
1343
+ "quotes",
1344
+ "brackets",
1345
+ "brackets",
1346
+ "brackets",
1347
+ "",
1348
+ "",
1349
+ "",
1350
+ "",
1351
+ "",
1352
+ "prepro",
1353
+ "prepro",
1354
+ "",
1355
+ "mlcomment",
1356
+ "comment"
1357
+ ],
1358
+ 3: [
1359
+ "quotes",
1360
+ "brackets",
1361
+ "brackets",
1362
+ "brackets",
1363
+ "",
1364
+ "",
1365
+ "",
1366
+ "",
1367
+ "",
1368
+ "prepro",
1369
+ "prepro",
1370
+ "",
1371
+ "mlcomment",
1372
+ "comment"
1373
+ ],
1374
+ 4: [],
1375
+ 5: ["quotes", "quotes"],
1376
+ 6: ["quotes", "brackets", "brackets", "", "", "", "", "", "mlcomment", "comment"],
1377
+ 7: [""],
1378
+ 8: [""]
1379
+ },
1380
+ inner: {
1381
+ [-1]: [
1382
+ "string",
1383
+ "code",
1384
+ "code",
1385
+ "code",
1386
+ "identifier",
1387
+ "prepro",
1388
+ "code",
1389
+ "number",
1390
+ "mlcomment",
1391
+ "comment"
1392
+ ],
1393
+ 0: ["special"],
1394
+ 1: [
1395
+ "string",
1396
+ "code",
1397
+ "code",
1398
+ "code",
1399
+ "identifier",
1400
+ "number",
1401
+ "number",
1402
+ "number",
1403
+ "number",
1404
+ "prepro",
1405
+ "code",
1406
+ "number",
1407
+ "mlcomment",
1408
+ "comment"
1409
+ ],
1410
+ 2: [
1411
+ "string",
1412
+ "code",
1413
+ "code",
1414
+ "code",
1415
+ "identifier",
1416
+ "number",
1417
+ "number",
1418
+ "number",
1419
+ "number",
1420
+ "prepro",
1421
+ "code",
1422
+ "number",
1423
+ "mlcomment",
1424
+ "comment"
1425
+ ],
1426
+ 3: [
1427
+ "string",
1428
+ "code",
1429
+ "code",
1430
+ "code",
1431
+ "identifier",
1432
+ "number",
1433
+ "number",
1434
+ "number",
1435
+ "number",
1436
+ "prepro",
1437
+ "code",
1438
+ "number",
1439
+ "mlcomment",
1440
+ "comment"
1441
+ ],
1442
+ 4: [],
1443
+ 5: ["string", "string"],
1444
+ 6: [
1445
+ "string",
1446
+ "code",
1447
+ "code",
1448
+ "identifier",
1449
+ "number",
1450
+ "number",
1451
+ "number",
1452
+ "number",
1453
+ "mlcomment",
1454
+ "comment"
1455
+ ],
1456
+ 7: ["inlinedoc"],
1457
+ 8: ["inlinedoc"]
1458
+ },
1459
+ end: {
1460
+ 0: /"/gi,
1461
+ 1: /\}/gi,
1462
+ 2: /\)/gi,
1463
+ 3: /\]/gi,
1464
+ 4: />/gi,
1465
+ 5: /(?<!\\)$/gim,
1466
+ 6: /(?<!\\)$/gim,
1467
+ 7: /\*\//gi,
1468
+ 8: /$/gim
1469
+ },
1470
+ states: {
1471
+ [-1]: [0, 1, 2, 3, -1, 5, 6, -1, 7, 8],
1472
+ 0: [-1],
1473
+ 1: [0, 1, 2, 3, -1, -1, -1, -1, -1, 5, 6, -1, 7, 8],
1474
+ 2: [0, 1, 2, 3, -1, -1, -1, -1, -1, 5, 6, -1, 7, 8],
1475
+ 3: [0, 1, 2, 3, -1, -1, -1, -1, -1, 5, 6, -1, 7, 8],
1476
+ 4: [],
1477
+ 5: [0, 4],
1478
+ 6: [0, 1, 2, -1, -1, -1, -1, -1, 7, 8],
1479
+ 7: [-1],
1480
+ 8: [-1]
1481
+ },
1482
+ keywords: {
1483
+ [-1]: [
1484
+ -1,
1485
+ -1,
1486
+ -1,
1487
+ -1,
1488
+ {
1489
+ reserved: /^(and|and_eq|asm|bitand|bitor|break|case|catch|compl|const_cast|continue|default|delete|do|dynamic_cast|else|for|fortran|friend|goto|if|new|not|not_eq|operator|or|or_eq|private|protected|public|reinterpret_cast|return|sizeof|static_cast|switch|this|throw|try|typeid|using|while|xor|xor_eq|false|true)$/,
1490
+ types: /^(auto|bool|char|class|const|double|enum|explicit|export|extern|float|inline|int|long|mutable|namespace|register|short|signed|static|struct|template|typedef|typename|union|unsigned|virtual|void|volatile|wchar_t)$/,
1491
+ "Common Macros": /^(NULL|TRUE|FALSE|MAX|MIN|__LINE__|__DATA__|__FILE__|__TIME__|__STDC__)$/
1492
+ },
1493
+ -1,
1494
+ -1,
1495
+ {},
1496
+ -1,
1497
+ -1
1498
+ ],
1499
+ 0: [],
1500
+ 1: [
1501
+ -1,
1502
+ -1,
1503
+ -1,
1504
+ -1,
1505
+ {
1506
+ reserved: /^(and|and_eq|asm|bitand|bitor|break|case|catch|compl|const_cast|continue|default|delete|do|dynamic_cast|else|for|fortran|friend|goto|if|new|not|not_eq|operator|or|or_eq|private|protected|public|reinterpret_cast|return|sizeof|static_cast|switch|this|throw|try|typeid|using|while|xor|xor_eq|false|true)$/,
1507
+ types: /^(auto|bool|char|class|const|double|enum|explicit|export|extern|float|inline|int|long|mutable|namespace|register|short|signed|static|struct|template|typedef|typename|union|unsigned|virtual|void|volatile|wchar_t)$/,
1508
+ "Common Macros": /^(NULL|TRUE|FALSE|MAX|MIN|__LINE__|__DATA__|__FILE__|__TIME__|__STDC__)$/
1509
+ },
1510
+ {},
1511
+ {},
1512
+ {},
1513
+ {},
1514
+ -1,
1515
+ -1,
1516
+ {},
1517
+ -1,
1518
+ -1
1519
+ ],
1520
+ 2: [
1521
+ -1,
1522
+ -1,
1523
+ -1,
1524
+ -1,
1525
+ {
1526
+ reserved: /^(and|and_eq|asm|bitand|bitor|break|case|catch|compl|const_cast|continue|default|delete|do|dynamic_cast|else|for|fortran|friend|goto|if|new|not|not_eq|operator|or|or_eq|private|protected|public|reinterpret_cast|return|sizeof|static_cast|switch|this|throw|try|typeid|using|while|xor|xor_eq|false|true)$/,
1527
+ types: /^(auto|bool|char|class|const|double|enum|explicit|export|extern|float|inline|int|long|mutable|namespace|register|short|signed|static|struct|template|typedef|typename|union|unsigned|virtual|void|volatile|wchar_t)$/,
1528
+ "Common Macros": /^(NULL|TRUE|FALSE|MAX|MIN|__LINE__|__DATA__|__FILE__|__TIME__|__STDC__)$/
1529
+ },
1530
+ {},
1531
+ {},
1532
+ {},
1533
+ {},
1534
+ -1,
1535
+ -1,
1536
+ {},
1537
+ -1,
1538
+ -1
1539
+ ],
1540
+ 3: [],
1541
+ 4: [],
1542
+ 5: [],
1543
+ 6: [],
1544
+ 7: [{}],
1545
+ 8: [{}],
1546
+ 11: []
1547
+ },
1548
+ kwmap: {
1549
+ reserved: "reserved",
1550
+ types: "types",
1551
+ "Common Macros": "prepro"
1552
+ },
1553
+ parts: {
1554
+ 0: [null],
1555
+ 1: [null, null, null, null, null, null, null, null, null, null, null, null, null, null],
1556
+ 2: [null, null, null, null, null, null, null, null, null, null, null, null, null, null],
1557
+ 3: [null, null, null, null, null, null, null, null, null, null, null, null, null, null],
1558
+ 4: [],
1559
+ 5: [null, null],
1560
+ 6: [null, null, null, null, null, null, null, null, null, null],
1561
+ 7: [null],
1562
+ 8: [null]
1563
+ },
1564
+ subst: {
1565
+ [-1]: [false, false, false, false, false, false, false, false, false, false],
1566
+ 0: [false],
1567
+ 1: [
1568
+ false,
1569
+ false,
1570
+ false,
1571
+ false,
1572
+ false,
1573
+ false,
1574
+ false,
1575
+ false,
1576
+ false,
1577
+ false,
1578
+ false,
1579
+ false,
1580
+ false,
1581
+ false
1582
+ ],
1583
+ 2: [
1584
+ false,
1585
+ false,
1586
+ false,
1587
+ false,
1588
+ false,
1589
+ false,
1590
+ false,
1591
+ false,
1592
+ false,
1593
+ false,
1594
+ false,
1595
+ false,
1596
+ false,
1597
+ false
1598
+ ],
1599
+ 3: [
1600
+ false,
1601
+ false,
1602
+ false,
1603
+ false,
1604
+ false,
1605
+ false,
1606
+ false,
1607
+ false,
1608
+ false,
1609
+ false,
1610
+ false,
1611
+ false,
1612
+ false,
1613
+ false
1614
+ ],
1615
+ 4: [],
1616
+ 5: [false, false],
1617
+ 6: [false, false, false, false, false, false, false, false, false, false],
1618
+ 7: [false],
1619
+ 8: [false]
1620
+ }
1621
+ };
1622
+
1623
+ // packages/render/src/libs/highlighter/languages/diff.ts
1624
+ var diffLang = {
1625
+ language: "diff",
1626
+ defClass: "default",
1627
+ regs: {
1628
+ [-1]: /(^\\\sNo\snewline.+$)|(^---$)|(^(diff\s+-|Only\s+|Index).*$)|(^(---|\+\+\+)\s.+$)|(^\*.*$)|(^\+.*$)|(^!.*$)|(^<\s.*$)|(^>\s.*$)|(^\d+(,\d+)?[acd]\d+(,\d+)?$)|(^-.*$)|(^\+.*$)|(^@@.+@@$)|(^d\d+\s\d+$)|(^a\d+\s\d+$)|(^(\d+)(,\d+)?(a)$)|(^(\d+)(,\d+)?(c)$)|(^(\d+)(,\d+)?(d)$)|(^a(\d+)(\s\d+)?$)|(^c(\d+)(\s\d+)?$)|(^d(\d+)(\s\d+)?$)/gm,
1629
+ 0: null,
1630
+ 1: null,
1631
+ 2: null,
1632
+ 3: null,
1633
+ 4: null
1634
+ },
1635
+ counts: {
1636
+ [-1]: [0, 0, 1, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 3, 3, 3, 2, 2, 2],
1637
+ 0: [],
1638
+ 1: [],
1639
+ 2: [],
1640
+ 3: [],
1641
+ 4: []
1642
+ },
1643
+ delim: {
1644
+ [-1]: [
1645
+ "",
1646
+ "",
1647
+ "",
1648
+ "",
1649
+ "",
1650
+ "",
1651
+ "",
1652
+ "",
1653
+ "",
1654
+ "",
1655
+ "",
1656
+ "",
1657
+ "",
1658
+ "",
1659
+ "code",
1660
+ "code",
1661
+ "code",
1662
+ "",
1663
+ "code",
1664
+ "code",
1665
+ ""
1666
+ ],
1667
+ 0: [],
1668
+ 1: [],
1669
+ 2: [],
1670
+ 3: [],
1671
+ 4: []
1672
+ },
1673
+ inner: {
1674
+ [-1]: [
1675
+ "special",
1676
+ "code",
1677
+ "var",
1678
+ "reserved",
1679
+ "quotes",
1680
+ "string",
1681
+ "inlinedoc",
1682
+ "quotes",
1683
+ "string",
1684
+ "code",
1685
+ "quotes",
1686
+ "string",
1687
+ "code",
1688
+ "code",
1689
+ "var",
1690
+ "string",
1691
+ "inlinedoc",
1692
+ "code",
1693
+ "string",
1694
+ "inlinedoc",
1695
+ "code"
1696
+ ],
1697
+ 0: [],
1698
+ 1: [],
1699
+ 2: [],
1700
+ 3: [],
1701
+ 4: []
1702
+ },
1703
+ end: {
1704
+ 0: /(?=^[ad]\d+\s\d+)/gm,
1705
+ 1: /^(\.)$/gm,
1706
+ 2: /^(\.)$/gm,
1707
+ 3: /^(\.)$/gm,
1708
+ 4: /^(\.)$/gm
1709
+ },
1710
+ states: {
1711
+ [-1]: [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, -1, 3, 4, -1],
1712
+ 0: [],
1713
+ 1: [],
1714
+ 2: [],
1715
+ 3: [],
1716
+ 4: []
1717
+ },
1718
+ keywords: {
1719
+ [-1]: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, -1, -1, -1, {}, -1, -1, {}],
1720
+ 0: [],
1721
+ 1: [],
1722
+ 2: [],
1723
+ 3: [],
1724
+ 4: [],
1725
+ 5: [],
1726
+ 6: [],
1727
+ 7: [],
1728
+ 8: [],
1729
+ 9: [],
1730
+ 10: [],
1731
+ 11: [],
1732
+ 12: [],
1733
+ 13: [],
1734
+ 17: [],
1735
+ 20: []
1736
+ },
1737
+ kwmap: {},
1738
+ parts: {
1739
+ 0: [],
1740
+ 1: [],
1741
+ 2: [],
1742
+ 3: [],
1743
+ 4: []
1744
+ },
1745
+ subst: {
1746
+ [-1]: [
1747
+ false,
1748
+ false,
1749
+ false,
1750
+ false,
1751
+ false,
1752
+ false,
1753
+ false,
1754
+ false,
1755
+ false,
1756
+ false,
1757
+ false,
1758
+ false,
1759
+ false,
1760
+ false,
1761
+ false,
1762
+ false,
1763
+ false,
1764
+ false,
1765
+ false,
1766
+ false,
1767
+ false
1768
+ ],
1769
+ 0: [],
1770
+ 1: [],
1771
+ 2: [],
1772
+ 3: [],
1773
+ 4: []
1774
+ }
1775
+ };
1776
+
1777
+ // packages/render/src/libs/highlighter/languages/dtd.ts
1778
+ var dtdLang = {
1779
+ language: "dtd",
1780
+ defClass: "code",
1781
+ regs: {
1782
+ [-1]: /(<!--)|(<!\[)|((&|%)[\w\-.]+;)/g,
1783
+ 0: null,
1784
+ 1: /(<!--)|(<)|(#PCDATA\b)|((&|%)[\w\-.]+;)|([a-z][a-z\d\-,:]+)/gi,
1785
+ 2: /(<!--)|(\()|(')|(")|((?<=<)!(ENTITY|ATTLIST|ELEMENT|NOTATION)\b)|(\s(#(IMPLIED|REQUIRED|FIXED))|CDATA|ENTITY|NOTATION|NMTOKENS?|PUBLIC|SYSTEM\b)|(#PCDATA\b)|((&|%)[\w\-.]+;)|([a-z][a-z\d\-,:]+)/gi,
1786
+ 3: /(\()|((&|%)[\w\-.]+;)|([a-z][a-z\d\-,:]+)/gi,
1787
+ 4: /((&|%)[\w\-.]+;)/g,
1788
+ 5: /((&|%)[\w\-.]+;)/g
1789
+ },
1790
+ counts: {
1791
+ [-1]: [0, 0, 1],
1792
+ 0: [],
1793
+ 1: [0, 0, 0, 1, 0],
1794
+ 2: [0, 0, 0, 0, 1, 2, 0, 1, 0],
1795
+ 3: [0, 1, 0],
1796
+ 4: [1],
1797
+ 5: [1]
1798
+ },
1799
+ delim: {
1800
+ [-1]: ["comment", "brackets", ""],
1801
+ 0: [],
1802
+ 1: ["comment", "brackets", "", "", ""],
1803
+ 2: ["comment", "brackets", "quotes", "quotes", "", "", "", "", ""],
1804
+ 3: ["brackets", "", ""],
1805
+ 4: [""],
1806
+ 5: [""]
1807
+ },
1808
+ inner: {
1809
+ [-1]: ["comment", "code", "special"],
1810
+ 0: [],
1811
+ 1: ["comment", "code", "reserved", "special", "identifier"],
1812
+ 2: [
1813
+ "comment",
1814
+ "code",
1815
+ "string",
1816
+ "string",
1817
+ "var",
1818
+ "reserved",
1819
+ "reserved",
1820
+ "special",
1821
+ "identifier"
1822
+ ],
1823
+ 3: ["code", "special", "identifier"],
1824
+ 4: ["special"],
1825
+ 5: ["special"]
1826
+ },
1827
+ end: {
1828
+ 0: /-->/g,
1829
+ 1: /\]\]>/g,
1830
+ 2: />/g,
1831
+ 3: /\)/g,
1832
+ 4: /'/g,
1833
+ 5: /"/g
1834
+ },
1835
+ states: {
1836
+ [-1]: [0, 1, -1],
1837
+ 0: [],
1838
+ 1: [0, 2, -1, -1, -1],
1839
+ 2: [0, 3, 4, 5, -1, -1, -1, -1, -1],
1840
+ 3: [3, -1, -1],
1841
+ 4: [-1],
1842
+ 5: [-1]
1843
+ },
1844
+ keywords: {
1845
+ [-1]: [-1, -1, {}],
1846
+ 0: [],
1847
+ 1: [],
1848
+ 2: [],
1849
+ 3: [-1, {}, {}],
1850
+ 4: [{}],
1851
+ 5: [{}],
1852
+ 6: [],
1853
+ 7: [],
1854
+ 8: []
1855
+ },
1856
+ kwmap: {},
1857
+ parts: {
1858
+ 0: [],
1859
+ 1: [null, null, null, null, null],
1860
+ 2: [null, null, null, null, null, null, null, null, null],
1861
+ 3: [null, null, null],
1862
+ 4: [null],
1863
+ 5: [null]
1864
+ },
1865
+ subst: {
1866
+ [-1]: [false, false, false],
1867
+ 0: [],
1868
+ 1: [false, false, false, false, false],
1869
+ 2: [false, false, false, false, false, false, false, false, false],
1870
+ 3: [false, false, false],
1871
+ 4: [false],
1872
+ 5: [false]
1873
+ }
1874
+ };
1875
+
1876
+ // packages/render/src/libs/highlighter/languages/html.ts
1877
+ var htmlLang = {
1878
+ language: "html",
1879
+ defClass: "code",
1880
+ regs: {
1881
+ [-1]: /(<!--)|(<[?/]?)|((&)[\w\-.]+;)/gi,
1882
+ 0: null,
1883
+ 1: /((?<=[</?])[\w\-:]+)|([\w\-:]+)|(")/gi,
1884
+ 2: /((&)[\w\-.]+;)/gi
1885
+ },
1886
+ counts: {
1887
+ [-1]: [0, 0, 1],
1888
+ 0: [],
1889
+ 1: [0, 0, 0],
1890
+ 2: [1]
1891
+ },
1892
+ delim: {
1893
+ [-1]: ["comment", "brackets", ""],
1894
+ 0: [],
1895
+ 1: ["", "", "quotes"],
1896
+ 2: [""]
1897
+ },
1898
+ inner: {
1899
+ [-1]: ["comment", "code", "special"],
1900
+ 0: [],
1901
+ 1: ["reserved", "var", "string"],
1902
+ 2: ["special"]
1903
+ },
1904
+ end: {
1905
+ 0: /-->/gi,
1906
+ 1: /[/?]?>/gi,
1907
+ 2: /"/gi
1908
+ },
1909
+ states: {
1910
+ [-1]: [0, 1, -1],
1911
+ 0: [],
1912
+ 1: [-1, -1, 2],
1913
+ 2: [-1]
1914
+ },
1915
+ keywords: {
1916
+ [-1]: [-1, -1, {}],
1917
+ 0: [],
1918
+ 1: [],
1919
+ 2: [{}]
1920
+ },
1921
+ kwmap: {},
1922
+ parts: {
1923
+ 0: [],
1924
+ 1: [null, null, null],
1925
+ 2: [null]
1926
+ },
1927
+ subst: {
1928
+ [-1]: [false, false, false],
1929
+ 0: [],
1930
+ 1: [false, false, false],
1931
+ 2: [false]
1932
+ }
1933
+ };
1934
+
1935
+ // packages/render/src/libs/highlighter/languages/java.ts
1936
+ var javaLang = {
1937
+ language: "java",
1938
+ defClass: "code",
1939
+ regs: {
1940
+ [-1]: /(\{)|(\()|(\[)|(\/\*)|(")|(')|(\/\/)|([a-z_]\w*)|(0[xX][\da-f]+)|(\d\d*|\b0\b)|(0[0-7]+)|((\d*\.\d+)|(\d+\.\d*))|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))/gi,
1941
+ 0: /(\{)|(\()|(\[)|(\/\*)|(")|(')|(\/\/)|([a-z_]\w*)|(0[xX][\da-f]+)|(\d\d*|\b0\b)|(0[0-7]+)|((\d*\.\d+)|(\d+\.\d*))|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))/gi,
1942
+ 1: /(\{)|(\()|(\[)|(\/\*)|(")|(')|(\/\/)|([a-z_]\w*)|(0[xX][\da-f]+)|(\d\d*|\b0\b)|(0[0-7]+)|((\d*\.\d+)|(\d+\.\d*))|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))/gi,
1943
+ 2: /(\{)|(\()|(\[)|(\/\*)|(")|(')|(\/\/)|([a-z_]\w*)|(0[xX][\da-f]+)|(\d\d*|\b0\b)|(0[0-7]+)|((\d*\.\d+)|(\d+\.\d*))|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))/gi,
1944
+ 3: /(\s@\w+\s)|(((https?|ftp):\/\/[\w?.\-&=/%+]+)|(^|[\s,!?])www\.\w+\.\w+[\w?.&=/%+]*)|(\w+[.\w-]+@(\w+[.\w-])+)|(\bnote:)|(\$\w+\s*:.*\$)/gim,
1945
+ 4: /(\\[\\"'`tnr${])/gi,
1946
+ 5: /(\\.)/gi,
1947
+ 6: /(\s@\w+\s)|(((https?|ftp):\/\/[\w?.\-&=/%+]+)|(^|[\s,!?])www\.\w+\.\w+[\w?.&=/%+]*)|(\w+[.\w-]+@(\w+[.\w-])+)|(\bnote:)|(\$\w+\s*:.*\$)/gim
1948
+ },
1949
+ counts: {
1950
+ [-1]: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5],
1951
+ 0: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5],
1952
+ 1: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5],
1953
+ 2: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5],
1954
+ 3: [0, 3, 1, 0, 0],
1955
+ 4: [0],
1956
+ 5: [0],
1957
+ 6: [0, 3, 1, 0, 0]
1958
+ },
1959
+ delim: {
1960
+ [-1]: [
1961
+ "brackets",
1962
+ "brackets",
1963
+ "brackets",
1964
+ "comment",
1965
+ "quotes",
1966
+ "quotes",
1967
+ "comment",
1968
+ "",
1969
+ "",
1970
+ "",
1971
+ "",
1972
+ "",
1973
+ ""
1974
+ ],
1975
+ 0: [
1976
+ "brackets",
1977
+ "brackets",
1978
+ "brackets",
1979
+ "comment",
1980
+ "quotes",
1981
+ "quotes",
1982
+ "comment",
1983
+ "",
1984
+ "",
1985
+ "",
1986
+ "",
1987
+ "",
1988
+ ""
1989
+ ],
1990
+ 1: [
1991
+ "brackets",
1992
+ "brackets",
1993
+ "brackets",
1994
+ "comment",
1995
+ "quotes",
1996
+ "quotes",
1997
+ "comment",
1998
+ "",
1999
+ "",
2000
+ "",
2001
+ "",
2002
+ "",
2003
+ ""
2004
+ ],
2005
+ 2: [
2006
+ "brackets",
2007
+ "brackets",
2008
+ "brackets",
2009
+ "comment",
2010
+ "quotes",
2011
+ "quotes",
2012
+ "comment",
2013
+ "",
2014
+ "",
2015
+ "",
2016
+ "",
2017
+ "",
2018
+ ""
2019
+ ],
2020
+ 3: ["", "", "", "", ""],
2021
+ 4: [""],
2022
+ 5: [""],
2023
+ 6: ["", "", "", "", ""]
2024
+ },
2025
+ inner: {
2026
+ [-1]: [
2027
+ "code",
2028
+ "code",
2029
+ "code",
2030
+ "comment",
2031
+ "string",
2032
+ "string",
2033
+ "comment",
2034
+ "identifier",
2035
+ "number",
2036
+ "number",
2037
+ "number",
2038
+ "number",
2039
+ "number"
2040
+ ],
2041
+ 0: [
2042
+ "code",
2043
+ "code",
2044
+ "code",
2045
+ "comment",
2046
+ "string",
2047
+ "string",
2048
+ "comment",
2049
+ "identifier",
2050
+ "number",
2051
+ "number",
2052
+ "number",
2053
+ "number",
2054
+ "number"
2055
+ ],
2056
+ 1: [
2057
+ "code",
2058
+ "code",
2059
+ "code",
2060
+ "comment",
2061
+ "string",
2062
+ "string",
2063
+ "comment",
2064
+ "identifier",
2065
+ "number",
2066
+ "number",
2067
+ "number",
2068
+ "number",
2069
+ "number"
2070
+ ],
2071
+ 2: [
2072
+ "code",
2073
+ "code",
2074
+ "code",
2075
+ "comment",
2076
+ "string",
2077
+ "string",
2078
+ "comment",
2079
+ "identifier",
2080
+ "number",
2081
+ "number",
2082
+ "number",
2083
+ "number",
2084
+ "number"
2085
+ ],
2086
+ 3: ["inlinedoc", "url", "url", "inlinedoc", "inlinedoc"],
2087
+ 4: ["special"],
2088
+ 5: ["special"],
2089
+ 6: ["inlinedoc", "url", "url", "inlinedoc", "inlinedoc"]
2090
+ },
2091
+ end: {
2092
+ 0: /\}/gi,
2093
+ 1: /\)/gi,
2094
+ 2: /\]/gi,
2095
+ 3: /\*\//gi,
2096
+ 4: /"/gi,
2097
+ 5: /'/gi,
2098
+ 6: /$/gim
2099
+ },
2100
+ states: {
2101
+ [-1]: [0, 1, 2, 3, 4, 5, 6, -1, -1, -1, -1, -1, -1],
2102
+ 0: [0, 1, 2, 3, 4, 5, 6, -1, -1, -1, -1, -1, -1],
2103
+ 1: [0, 1, 2, 3, 4, 5, 6, -1, -1, -1, -1, -1, -1],
2104
+ 2: [0, 1, 2, 3, 4, 5, 6, -1, -1, -1, -1, -1, -1],
2105
+ 3: [-1, -1, -1, -1, -1],
2106
+ 4: [-1],
2107
+ 5: [-1],
2108
+ 6: [-1, -1, -1, -1, -1]
2109
+ },
2110
+ keywords: {
2111
+ [-1]: [
2112
+ -1,
2113
+ -1,
2114
+ -1,
2115
+ -1,
2116
+ -1,
2117
+ -1,
2118
+ -1,
2119
+ {
2120
+ types: /^(boolean|byte|char|const|double|final|float|int|long|short|static|void)$/,
2121
+ reserved: /^(import|package|abstract|break|case|catch|class|continue|default|do|else|extends|false|finally|for|goto|if|implements|instanceof|interface|native|new|null|private|protected|public|return|super|strictfp|switch|synchronized|this|throws|throw|transient|true|try|volatile|while)$/,
2122
+ builtin: /^(AbstractAction|AbstractBorder|AbstractButton|AbstractCellEditor|AbstractCollection|AbstractColorChooserPanel|AbstractDocument|AbstractInterruptibleChannel|AbstractLayoutCache|AbstractList|AbstractListModel|AbstractMap|AbstractMethodError|AbstractPreferences|AbstractSelectableChannel|AbstractSelectionKey|AbstractSelector|AbstractSequentialList|AbstractSet|AbstractSpinnerModel|AbstractTableModel|AbstractUndoableEdit|AbstractWriter|AccessControlContext|AccessControlException|AccessController|AccessException|Accessible|AccessibleAction|AccessibleBundle|AccessibleComponent|AccessibleContext|AccessibleEditableText|AccessibleExtendedComponent|AccessibleExtendedTable|AccessibleHyperlink|AccessibleHypertext|AccessibleIcon|AccessibleKeyBinding|AccessibleObject|AccessibleRelation|AccessibleRelationSet|AccessibleResourceBundle|AccessibleRole|AccessibleSelection|AccessibleState|AccessibleStateSet|AccessibleTable|AccessibleTableModelChange|AccessibleText|AccessibleValue|AccountExpiredException|Acl|AclEntry|AclNotFoundException|Action|ActionEvent|ActionListener|ActionMap|ActionMapUIResource|Activatable|ActivateFailedException|ActivationDesc|ActivationException|ActivationGroup|ActivationGroup_Stub|ActivationGroupDesc|ActivationGroupID|ActivationID|ActivationInstantiator|ActivationMonitor|ActivationSystem|Activator|ActiveEvent|AdapterActivator|AdapterActivatorOperations|AdapterAlreadyExists|AdapterAlreadyExistsHelper|AdapterInactive|AdapterInactiveHelper|AdapterNonExistent|AdapterNonExistentHelper|AddressHelper|Adjustable|AdjustmentEvent|AdjustmentListener|Adler32|AffineTransform|AffineTransformOp|AlgorithmParameterGenerator|AlgorithmParameterGeneratorSpi|AlgorithmParameters|AlgorithmParameterSpec|AlgorithmParametersSpi|AllPermission|AlphaComposite|AlreadyBound|AlreadyBoundException|AlreadyBoundHelper|AlreadyBoundHolder|AlreadyConnectedException|AncestorEvent|AncestorListener|Annotation|Any|AnyHolder|AnySeqHelper|AnySeqHolder|AppConfigurationEntry|Applet|AppletContext|AppletInitializer|AppletStub|ApplicationException|Arc2D|Area|AreaAveragingScaleFilter|ARG_IN|ARG_INOUT|ARG_OUT|ArithmeticException|Array|ArrayIndexOutOfBoundsException|ArrayList|Arrays|ArrayStoreException|AssertionError|AsyncBoxView|AsynchronousCloseException|Attr|Attribute|AttributedCharacterIterator|AttributedString|AttributeException|AttributeInUseException|AttributeList|AttributeListImpl|AttributeModificationException|Attributes|AttributeSet|AttributeSetUtilities|AttributesImpl|AudioClip|AudioFileFormat|AudioFileReader|AudioFileWriter|AudioFormat|AudioInputStream|AudioPermission|AudioSystem|AuthenticationException|AuthenticationNotSupportedException|Authenticator|AuthPermission|Autoscroll|AWTError|AWTEvent|AWTEventListener|AWTEventListenerProxy|AWTEventMulticaster|AWTException|AWTKeyStroke|AWTPermission|BackingStoreException|BAD_CONTEXT|BAD_INV_ORDER|BAD_OPERATION|BAD_PARAM|BAD_POLICY|BAD_POLICY_TYPE|BAD_POLICY_VALUE|BAD_TYPECODE|BadKind|BadLocationException|BadPaddingException|BandCombineOp|BandedSampleModel|BasicArrowButton|BasicAttribute|BasicAttributes|BasicBorders|BasicButtonListener|BasicButtonUI|BasicCheckBoxMenuItemUI|BasicCheckBoxUI|BasicColorChooserUI|BasicComboBoxEditor|BasicComboBoxRenderer|BasicComboBoxUI|BasicComboPopup|BasicDesktopIconUI|BasicDesktopPaneUI|BasicDirectoryModel|BasicEditorPaneUI|BasicFileChooserUI|BasicFormattedTextFieldUI|BasicGraphicsUtils|BasicHTML|BasicIconFactory|BasicInternalFrameTitlePane|BasicInternalFrameUI|BasicLabelUI|BasicListUI|BasicLookAndFeel|BasicMenuBarUI|BasicMenuItemUI|BasicMenuUI|BasicOptionPaneUI|BasicPanelUI|BasicPasswordFieldUI|BasicPermission|BasicPopupMenuSeparatorUI|BasicPopupMenuUI|BasicProgressBarUI|BasicRadioButtonMenuItemUI|BasicRadioButtonUI|BasicRootPaneUI|BasicScrollBarUI|BasicScrollPaneUI|BasicSeparatorUI|BasicSliderUI|BasicSpinnerUI|BasicSplitPaneDivider|BasicSplitPaneUI|BasicStroke|BasicTabbedPaneUI|BasicTableHeaderUI|BasicTableUI|BasicTextAreaUI|BasicTextFieldUI|BasicTextPaneUI|BasicTextUI|BasicToggleButtonUI|BasicToolBarSeparatorUI|BasicToolBarUI|BasicToolTipUI|BasicTreeUI|BasicViewportUI|BatchUpdateException|BeanContext|BeanContextChild|BeanContextChildComponentProxy|BeanContextChildSupport|BeanContextContainerProxy|BeanContextEvent|BeanContextMembershipEvent|BeanContextMembershipListener|BeanContextProxy|BeanContextServiceAvailableEvent|BeanContextServiceProvider|BeanContextServiceProviderBeanInfo|BeanContextServiceRevokedEvent|BeanContextServiceRevokedListener|BeanContextServices|BeanContextServicesListener|BeanContextServicesSupport|BeanContextSupport|BeanDescriptor|BeanInfo|Beans|BevelBorder|Bidi|BigDecimal|BigInteger|BinaryRefAddr|BindException|Binding|BindingHelper|BindingHolder|BindingIterator|BindingIteratorHelper|BindingIteratorHolder|BindingIteratorOperations|BindingIteratorPOA|BindingListHelper|BindingListHolder|BindingType|BindingTypeHelper|BindingTypeHolder|BitSet|Blob|BlockView|Book|Boolean|BooleanControl|BooleanHolder|BooleanSeqHelper|BooleanSeqHolder|Border|BorderFactory|BorderLayout|BorderUIResource|BoundedRangeModel|Bounds|Box|BoxedValueHelper|BoxLayout|BoxView|BreakIterator|Buffer|BufferCapabilities|BufferedImage|BufferedImageFilter|BufferedImageOp|BufferedInputStream|BufferedOutputStream|BufferedReader|BufferedWriter|BufferOverflowException|BufferStrategy|BufferUnderflowException|Button|ButtonGroup|ButtonModel|ButtonUI|Byte|ByteArrayInputStream|ByteArrayOutputStream|ByteBuffer|ByteChannel|ByteHolder|ByteLookupTable|ByteOrder|Calendar|CallableStatement|Callback|CallbackHandler|CancelablePrintJob|CancelledKeyException|CannotProceed|CannotProceedException|CannotProceedHelper|CannotProceedHolder|CannotRedoException|CannotUndoException|Canvas|CardLayout|Caret|CaretEvent|CaretListener|CDATASection|CellEditor|CellEditorListener|CellRendererPane|Certificate|CertificateEncodingException|CertificateException|CertificateExpiredException|CertificateFactory|CertificateFactorySpi|CertificateNotYetValidException|CertificateParsingException|CertPath|CertPathBuilder|CertPathBuilderException|CertPathBuilderResult|CertPathBuilderSpi|CertPathParameters|CertPathValidator|CertPathValidatorException|CertPathValidatorResult|CertPathValidatorSpi|CertSelector|CertStore|CertStoreException|CertStoreParameters|CertStoreSpi|ChangedCharSetException|ChangeEvent|ChangeListener|Channel|ChannelBinding|Channels|Character|CharacterCodingException|CharacterData|CharacterIterator|CharArrayReader|CharArrayWriter|CharBuffer|CharConversionException|CharHolder|CharSeqHelper|CharSeqHolder|CharSequence|Charset|CharsetDecoder|CharsetEncoder|CharsetProvider|Checkbox|CheckboxGroup|CheckboxMenuItem|CheckedInputStream|CheckedOutputStream|Checksum|Choice|ChoiceCallback|ChoiceFormat|Chromaticity|Cipher|CipherInputStream|CipherOutputStream|CipherSpi|Class|ClassCastException|ClassCircularityError|ClassDesc|ClassFormatError|ClassLoader|ClassNotFoundException|ClientRequestInfo|ClientRequestInfoOperations|ClientRequestInterceptor|ClientRequestInterceptorOperations|Clip|Clipboard|ClipboardOwner|Clob|Cloneable|CloneNotSupportedException|ClosedByInterruptException|ClosedChannelException|ClosedSelectorException|CMMException|Codec|CodecFactory|CodecFactoryHelper|CodecFactoryOperations|CodecOperations|CoderMalfunctionError|CoderResult|CodeSets|CodeSource|CodingErrorAction|CollationElementIterator|CollationKey|Collator|Collection|CollectionCertStoreParameters|Collections|Color|ColorChooserComponentFactory|ColorChooserUI|ColorConvertOp|ColorModel|ColorSelectionModel|ColorSpace|ColorSupported|ColorUIResource|ComboBoxEditor|ComboBoxModel|ComboBoxUI|ComboPopup|COMM_FAILURE|Comment|CommunicationException|Comparable|Comparator|Compiler|CompletionStatus|CompletionStatusHelper|Component|ComponentAdapter|ComponentColorModel|ComponentEvent|ComponentIdHelper|ComponentInputMap|ComponentInputMapUIResource|ComponentListener|ComponentOrientation|ComponentSampleModel|ComponentUI|ComponentView|Composite|CompositeContext|CompositeName|CompositeView|CompoundBorder|CompoundControl|CompoundEdit|CompoundName|Compression|ConcurrentModificationException|Configuration|ConfigurationException|ConfirmationCallback|ConnectException|ConnectIOException|Connection|ConnectionEvent|ConnectionEventListener|ConnectionPendingException|ConnectionPoolDataSource|ConsoleHandler|Constructor|Container|ContainerAdapter|ContainerEvent|ContainerListener|ContainerOrderFocusTraversalPolicy|ContentHandler|ContentHandlerFactory|ContentModel|Context|ContextList|ContextNotEmptyException|ContextualRenderedImageFactory|Control|ControlFactory|ControllerEventListener|ConvolveOp|CookieHolder|Copies|CopiesSupported|CRC32|CredentialExpiredException|CRL|CRLException|CRLSelector|CropImageFilter|CSS|CTX_RESTRICT_SCOPE|CubicCurve2D|Currency|Current|CurrentHelper|CurrentHolder|CurrentOperations|Cursor|Customizer|CustomMarshal|CustomValue|DATA_CONVERSION|DatabaseMetaData|DataBuffer|DataBufferByte|DataBufferDouble|DataBufferFloat|DataBufferInt|DataBufferShort|DataBufferUShort|DataFlavor|DataFormatException|DatagramChannel|DatagramPacket|DatagramSocket|DatagramSocketImpl|DatagramSocketImplFactory|DataInput|DataInputStream|DataLine|DataOutput|DataOutputStream|DataSource|DataTruncation|Date|DateFormat|DateFormatSymbols|DateFormatter|DateTimeAtCompleted|DateTimeAtCreation|DateTimeAtProcessing|DateTimeSyntax|DebugGraphics|DecimalFormat|DecimalFormatSymbols|DeclHandler|DefaultBoundedRangeModel|DefaultButtonModel|DefaultCaret|DefaultCellEditor|DefaultColorSelectionModel|DefaultComboBoxModel|DefaultDesktopManager|DefaultEditorKit|DefaultFocusManager|DefaultFocusTraversalPolicy|DefaultFormatter|DefaultFormatterFactory|DefaultHandler|DefaultHighlighter|DefaultKeyboardFocusManager|DefaultListCellRenderer|DefaultListModel|DefaultListSelectionModel|DefaultMenuLayout|DefaultMetalTheme|DefaultMutableTreeNode|DefaultPersistenceDelegate|DefaultSingleSelectionModel|DefaultStyledDocument|DefaultTableCellRenderer|DefaultTableColumnModel|DefaultTableModel|DefaultTextUI|DefaultTreeCellEditor|DefaultTreeCellRenderer|DefaultTreeModel|DefaultTreeSelectionModel|DefinitionKind|DefinitionKindHelper|Deflater|DeflaterOutputStream|Delegate|DelegationPermission|DESedeKeySpec|DesignMode|DESKeySpec|DesktopIconUI|DesktopManager|DesktopPaneUI|Destination|Destroyable|DestroyFailedException|DGC|DHGenParameterSpec|DHKey|DHParameterSpec|DHPrivateKey|DHPrivateKeySpec|DHPublicKey|DHPublicKeySpec|Dialog|Dictionary|DigestException|DigestInputStream|DigestOutputStream|Dimension|Dimension2D|DimensionUIResource|DirContext|DirectColorModel|DirectoryManager|DirObjectFactory|DirStateFactory|DisplayMode|DnDConstants|Doc|DocAttribute|DocAttributeSet|DocFlavor|DocPrintJob|Document|DocumentBuilder|DocumentBuilderFactory|DocumentEvent|DocumentFilter|DocumentFragment|DocumentHandler|DocumentListener|DocumentName|DocumentParser|DocumentType|DomainCombiner|DomainManager|DomainManagerOperations|DOMException|DOMImplementation|DOMLocator|DOMResult|DOMSource|Double|DoubleBuffer|DoubleHolder|DoubleSeqHelper|DoubleSeqHolder|DragGestureEvent|DragGestureListener|DragGestureRecognizer|DragSource|DragSourceAdapter|DragSourceContext|DragSourceDragEvent|DragSourceDropEvent|DragSourceEvent|DragSourceListener|DragSourceMotionListener|Driver|DriverManager|DriverPropertyInfo|DropTarget|DropTargetAdapter|DropTargetContext|DropTargetDragEvent|DropTargetDropEvent|DropTargetEvent|DropTargetListener|DSAKey|DSAKeyPairGenerator|DSAParameterSpec|DSAParams|DSAPrivateKey|DSAPrivateKeySpec|DSAPublicKey|DSAPublicKeySpec|DTD|DTDConstants|DTDHandler|DuplicateName|DuplicateNameHelper|DynamicImplementation|DynAny|DynAnyFactory|DynAnyFactoryHelper|DynAnyFactoryOperations|DynAnyHelper|DynAnyOperations|DynAnySeqHelper|DynArray|DynArrayHelper|DynArrayOperations|DynEnum|DynEnumHelper|DynEnumOperations|DynFixed|DynFixedHelper|DynFixedOperations|DynSequence|DynSequenceHelper|DynSequenceOperations|DynStruct|DynStructHelper|DynStructOperations|DynUnion|DynUnionHelper|DynUnionOperations|DynValue|DynValueBox|DynValueBoxOperations|DynValueCommon|DynValueCommonOperations|DynValueHelper|DynValueOperations|EditorKit|Element|ElementIterator|Ellipse2D|EmptyBorder|EmptyStackException|EncodedKeySpec|Encoder|Encoding|ENCODING_CDR_ENCAPS|EncryptedPrivateKeyInfo|Entity|EntityReference|EntityResolver|EnumControl|Enumeration|EnumSyntax|Environment|EOFException|Error|ErrorHandler|ErrorListener|ErrorManager|EtchedBorder|Event|EventContext|EventDirContext|EventHandler|EventListener|EventListenerList|EventListenerProxy|EventObject|EventQueue|EventSetDescriptor|Exception|ExceptionInInitializerError|ExceptionList|ExceptionListener|ExemptionMechanism|ExemptionMechanismException|ExemptionMechanismSpi|ExpandVetoException|ExportException|Expression|ExtendedRequest|ExtendedResponse|Externalizable|FactoryConfigurationError|FailedLoginException|FeatureDescriptor|Fidelity|Field|FieldNameHelper|FieldPosition|FieldView|File|FileCacheImageInputStream|FileCacheImageOutputStream|FileChannel|FileChooserUI|FileDescriptor|FileDialog|FileFilter|FileHandler|FileImageInputStream|FileImageOutputStream|FileInputStream|FileLock|FileLockInterruptionException|FilenameFilter|FileNameMap|FileNotFoundException|FileOutputStream|FilePermission|FileReader|FileSystemView|FileView|FileWriter|Filter|FilteredImageSource|FilterInputStream|FilterOutputStream|FilterReader|FilterWriter|Finishings|FixedHeightLayoutCache|FixedHolder|FlatteningPathIterator|FlavorException|FlavorMap|FlavorTable|Float|FloatBuffer|FloatControl|FloatHolder|FloatSeqHelper|FloatSeqHolder|FlowLayout|FlowView|FocusAdapter|FocusEvent|FocusListener|FocusManager|FocusTraversalPolicy|Font|FontFormatException|FontMetrics|FontRenderContext|FontUIResource|Format|FormatConversionProvider|FormatMismatch|FormatMismatchHelper|Formatter|FormView|ForwardRequest|ForwardRequestHelper|Frame|FREE_MEM|GapContent|GatheringByteChannel|GeneralPath|GeneralSecurityException|GlyphJustificationInfo|GlyphMetrics|GlyphVector|GlyphView|GradientPaint|GraphicAttribute|Graphics|Graphics2D|GraphicsConfigTemplate|GraphicsConfiguration|GraphicsDevice|GraphicsEnvironment|GrayFilter|GregorianCalendar|GridBagConstraints|GridBagLayout|GridLayout|Group|GSSContext|GSSCredential|GSSException|GSSManager|GSSName|Guard|GuardedObject|GZIPInputStream|GZIPOutputStream|Handler|HandlerBase|HandshakeCompletedEvent|HandshakeCompletedListener|HasControls|HashAttributeSet|HashDocAttributeSet|HashMap|HashPrintJobAttributeSet|HashPrintRequestAttributeSet|HashPrintServiceAttributeSet|HashSet|Hashtable|HeadlessException|HierarchyBoundsAdapter|HierarchyBoundsListener|HierarchyEvent|HierarchyListener|Highlighter|HostnameVerifier|HTML|HTMLDocument|HTMLEditorKit|HTMLFrameHyperlinkEvent|HTMLWriter|HttpsURLConnection|HttpURLConnection|HyperlinkEvent|HyperlinkListener|ICC_ColorSpace|ICC_Profile|ICC_ProfileGray|ICC_ProfileRGB|Icon|IconUIResource|IconView|ID_ASSIGNMENT_POLICY_ID|ID_UNIQUENESS_POLICY_ID|IdAssignmentPolicy|IdAssignmentPolicyOperations|IdAssignmentPolicyValue|IdentifierHelper|Identity|IdentityHashMap|IdentityScope|IDLEntity|IDLType|IDLTypeHelper|IDLTypeOperations|IdUniquenessPolicy|IdUniquenessPolicyOperations|IdUniquenessPolicyValue|IIOByteBuffer|IIOException|IIOImage|IIOInvalidTreeException|IIOMetadata|IIOMetadataController|IIOMetadataFormat|IIOMetadataFormatImpl|IIOMetadataNode|IIOParam|IIOParamController|IIOReadProgressListener|IIOReadUpdateListener|IIOReadWarningListener|IIORegistry|IIOServiceProvider|IIOWriteProgressListener|IIOWriteWarningListener|IllegalAccessError|IllegalAccessException|IllegalArgumentException|IllegalBlockingModeException|IllegalBlockSizeException|IllegalCharsetNameException|IllegalComponentStateException|IllegalMonitorStateException|IllegalPathStateException|IllegalSelectorException|IllegalStateException|IllegalThreadStateException|Image|ImageCapabilities|ImageConsumer|ImageFilter|ImageGraphicAttribute|ImageIcon|ImageInputStream|ImageInputStreamImpl|ImageInputStreamSpi|ImageIO|ImageObserver|ImageOutputStream|ImageOutputStreamImpl|ImageOutputStreamSpi|ImageProducer|ImageReader|ImageReaderSpi|ImageReaderWriterSpi|ImageReadParam|ImageTranscoder|ImageTranscoderSpi|ImageTypeSpecifier|ImageView|ImageWriteParam|ImageWriter|ImageWriterSpi|ImagingOpException|IMP_LIMIT|IMPLICIT_ACTIVATION_POLICY_ID|ImplicitActivationPolicy|ImplicitActivationPolicyOperations|ImplicitActivationPolicyValue|IncompatibleClassChangeError|InconsistentTypeCode|InconsistentTypeCodeHelper|IndexColorModel|IndexedPropertyDescriptor|IndexOutOfBoundsException|IndirectionException|Inet4Address|Inet6Address|InetAddress|InetSocketAddress|Inflater|InflaterInputStream|InheritableThreadLocal|InitialContext|InitialContextFactory|InitialContextFactoryBuilder|InitialDirContext|INITIALIZE|InitialLdapContext|InlineView|InputContext|InputEvent|InputMap|InputMapUIResource|InputMethod|InputMethodContext|InputMethodDescriptor|InputMethodEvent|InputMethodHighlight|InputMethodListener|InputMethodRequests|InputSource|InputStream|InputStreamReader|InputSubset|InputVerifier|Insets|InsetsUIResource|InstantiationError|InstantiationException|Instrument|InsufficientResourcesException|IntBuffer|Integer|IntegerSyntax|Interceptor|InterceptorOperations|INTERNAL|InternalError|InternalFrameAdapter|InternalFrameEvent|InternalFrameFocusTraversalPolicy|InternalFrameListener|InternalFrameUI|InternationalFormatter|InterruptedException|InterruptedIOException|InterruptedNamingException|InterruptibleChannel|INTF_REPOS|IntHolder|IntrospectionException|Introspector|INV_FLAG|INV_IDENT|INV_OBJREF|INV_POLICY|Invalid|INVALID_TRANSACTION|InvalidAddress|InvalidAddressHelper|InvalidAddressHolder|InvalidAlgorithmParameterException|InvalidAttributeIdentifierException|InvalidAttributesException|InvalidAttributeValueException|InvalidClassException|InvalidDnDOperationException|InvalidKeyException|InvalidKeySpecException|InvalidMarkException|InvalidMidiDataException|InvalidName|InvalidNameException|InvalidNameHelper|InvalidNameHolder|InvalidObjectException|InvalidParameterException|InvalidParameterSpecException|InvalidPolicy|InvalidPolicyHelper|InvalidPreferencesFormatException|InvalidSearchControlsException|InvalidSearchFilterException|InvalidSeq|InvalidSlot|InvalidSlotHelper|InvalidTransactionException|InvalidTypeForEncoding|InvalidTypeForEncodingHelper|InvalidValue|InvalidValueHelper|InvocationEvent|InvocationHandler|InvocationTargetException|InvokeHandler|IOException|IOR|IORHelper|IORHolder|IORInfo|IORInfoOperations|IORInterceptor|IORInterceptorOperations|IRObject|IRObjectOperations|IstringHelper|ItemEvent|ItemListener|ItemSelectable|Iterator|IvParameterSpec|JApplet|JarEntry|JarException|JarFile|JarInputStream|JarOutputStream|JarURLConnection|JButton|JCheckBox|JCheckBoxMenuItem|JColorChooser|JComboBox|JComponent|JDesktopPane|JDialog|JEditorPane|JFileChooser|JFormattedTextField|JFrame|JInternalFrame|JLabel|JLayeredPane|JList|JMenu|JMenuBar|JMenuItem|JobAttributes|JobHoldUntil|JobImpressions|JobImpressionsCompleted|JobImpressionsSupported|JobKOctets|JobKOctetsProcessed|JobKOctetsSupported|JobMediaSheets|JobMediaSheetsCompleted|JobMediaSheetsSupported|JobMessageFromOperator|JobName|JobOriginatingUserName|JobPriority|JobPrioritySupported|JobSheets|JobState|JobStateReason|JobStateReasons|JOptionPane|JPanel|JPasswordField|JPEGHuffmanTable|JPEGImageReadParam|JPEGImageWriteParam|JPEGQTable|JPopupMenu|JProgressBar|JRadioButton|JRadioButtonMenuItem|JRootPane|JScrollBar|JScrollPane|JSeparator|JSlider|JSpinner|JSplitPane|JTabbedPane|JTable|JTableHeader|JTextArea|JTextComponent|JTextField|JTextPane|JToggleButton|JToolBar|JToolTip|JTree|JViewport|JWindow|KerberosKey|KerberosPrincipal|KerberosTicket|Kernel|Key|KeyAdapter|KeyAgreement|KeyAgreementSpi|KeyboardFocusManager|KeyEvent|KeyEventDispatcher|KeyEventPostProcessor|KeyException|KeyFactory|KeyFactorySpi|KeyGenerator|KeyGeneratorSpi|KeyListener|KeyManagementException|KeyManager|KeyManagerFactory|KeyManagerFactorySpi|Keymap|KeyPair|KeyPairGenerator|KeyPairGeneratorSpi|KeySpec|KeyStore|KeyStoreException|KeyStoreSpi|KeyStroke|Label|LabelUI|LabelView|LanguageCallback|LastOwnerException|LayeredHighlighter|LayoutFocusTraversalPolicy|LayoutManager|LayoutManager2|LayoutQueue|LDAPCertStoreParameters|LdapContext|LdapReferralException|Lease|Level|LexicalHandler|LIFESPAN_POLICY_ID|LifespanPolicy|LifespanPolicyOperations|LifespanPolicyValue|LimitExceededException|Line|Line2D|LineBorder|LineBreakMeasurer|LineEvent|LineListener|LineMetrics|LineNumberInputStream|LineNumberReader|LineUnavailableException|LinkageError|LinkedHashMap|LinkedHashSet|LinkedList|LinkException|LinkLoopException|LinkRef|List|ListCellRenderer|ListDataEvent|ListDataListener|ListIterator|ListModel|ListResourceBundle|ListSelectionEvent|ListSelectionListener|ListSelectionModel|ListUI|ListView|LoaderHandler|Locale|LocalObject|LocateRegistry|LOCATION_FORWARD|Locator|LocatorImpl|Logger|LoggingPermission|LoginContext|LoginException|LoginModule|LogManager|LogRecord|LogStream|Long|LongBuffer|LongHolder|LongLongSeqHelper|LongLongSeqHolder|LongSeqHelper|LongSeqHolder|LookAndFeel|LookupOp|LookupTable|Mac|MacSpi|MalformedInputException|MalformedLinkException|MalformedURLException|ManagerFactoryParameters|Manifest|Map|MappedByteBuffer|MARSHAL|MarshalException|MarshalledObject|MaskFormatter|Matcher|Math|MatteBorder|Media|MediaName|MediaPrintableArea|MediaSize|MediaSizeName|MediaTracker|MediaTray|Member|MemoryCacheImageInputStream|MemoryCacheImageOutputStream|MemoryHandler|MemoryImageSource|Menu|MenuBar|MenuBarUI|MenuComponent|MenuContainer|MenuDragMouseEvent|MenuDragMouseListener|MenuElement|MenuEvent|MenuItem|MenuItemUI|MenuKeyEvent|MenuKeyListener|MenuListener|MenuSelectionManager|MenuShortcut|MessageDigest|MessageDigestSpi|MessageFormat|MessageProp|MetaEventListener|MetalBorders|MetalButtonUI|MetalCheckBoxIcon|MetalCheckBoxUI|MetalComboBoxButton|MetalComboBoxEditor|MetalComboBoxIcon|MetalComboBoxUI|MetalDesktopIconUI|MetalFileChooserUI|MetalIconFactory|MetalInternalFrameTitlePane|MetalInternalFrameUI|MetalLabelUI|MetalLookAndFeel|MetalPopupMenuSeparatorUI|MetalProgressBarUI|MetalRadioButtonUI|MetalRootPaneUI|MetalScrollBarUI|MetalScrollButton|MetalScrollPaneUI|MetalSeparatorUI|MetalSliderUI|MetalSplitPaneUI|MetalTabbedPaneUI|MetalTextFieldUI|MetalTheme|MetalToggleButtonUI|MetalToolBarUI|MetalToolTipUI|MetalTreeUI|MetaMessage|Method|MethodDescriptor|MidiChannel|MidiDevice|MidiDeviceProvider|MidiEvent|MidiFileFormat|MidiFileReader|MidiFileWriter|MidiMessage|MidiSystem|MidiUnavailableException|MimeTypeParseException|MinimalHTMLWriter|MissingResourceException|Mixer|MixerProvider|ModificationItem|Modifier|MouseAdapter|MouseDragGestureRecognizer|MouseEvent|MouseInputAdapter|MouseInputListener|MouseListener|MouseMotionAdapter|MouseMotionListener|MouseWheelEvent|MouseWheelListener|MultiButtonUI|MulticastSocket|MultiColorChooserUI|MultiComboBoxUI|MultiDesktopIconUI|MultiDesktopPaneUI|MultiDoc|MultiDocPrintJob|MultiDocPrintService|MultiFileChooserUI|MultiInternalFrameUI|MultiLabelUI|MultiListUI|MultiLookAndFeel|MultiMenuBarUI|MultiMenuItemUI|MultiOptionPaneUI|MultiPanelUI|MultiPixelPackedSampleModel|MultipleComponentProfileHelper|MultipleComponentProfileHolder|MultipleDocumentHandling|MultipleMaster|MultiPopupMenuUI|MultiProgressBarUI|MultiRootPaneUI|MultiScrollBarUI|MultiScrollPaneUI|MultiSeparatorUI|MultiSliderUI|MultiSpinnerUI|MultiSplitPaneUI|MultiTabbedPaneUI|MultiTableHeaderUI|MultiTableUI|MultiTextUI|MultiToolBarUI|MultiToolTipUI|MultiTreeUI|MultiViewportUI|MutableAttributeSet|MutableComboBoxModel|MutableTreeNode|Name|NameAlreadyBoundException|NameCallback|NameClassPair|NameComponent|NameComponentHelper|NameComponentHolder|NamedNodeMap|NamedValue|NameDynAnyPair|NameDynAnyPairHelper|NameDynAnyPairSeqHelper|NameHelper|NameHolder|NameNotFoundException|NameParser|NamespaceChangeListener|NamespaceSupport|NameValuePair|NameValuePairHelper|NameValuePairSeqHelper|Naming|NamingContext|NamingContextExt|NamingContextExtHelper|NamingContextExtHolder|NamingContextExtOperations|NamingContextExtPOA|NamingContextHelper|NamingContextHolder|NamingContextOperations|NamingContextPOA|NamingEnumeration|NamingEvent|NamingException|NamingExceptionEvent|NamingListener|NamingManager|NamingSecurityException|NavigationFilter|NegativeArraySizeException|NetPermission|NetworkInterface|NO_IMPLEMENT|NO_MEMORY|NO_PERMISSION|NO_RESOURCES|NO_RESPONSE|NoClassDefFoundError|NoConnectionPendingException|NoContext|NoContextHelper|Node|NodeChangeEvent|NodeChangeListener|NodeList|NoInitialContextException|NoninvertibleTransformException|NonReadableChannelException|NonWritableChannelException|NoPermissionException|NoRouteToHostException|NoServant|NoServantHelper|NoSuchAlgorithmException|NoSuchAttributeException|NoSuchElementException|NoSuchFieldError|NoSuchFieldException|NoSuchMethodError|NoSuchMethodException|NoSuchObjectException|NoSuchPaddingException|NoSuchProviderException|NotActiveException|Notation|NotBoundException|NotContextException|NotEmpty|NotEmptyHelper|NotEmptyHolder|NotFound|NotFoundHelper|NotFoundHolder|NotFoundReason|NotFoundReasonHelper|NotFoundReasonHolder|NotOwnerException|NotSerializableException|NotYetBoundException|NotYetConnectedException|NullCipher|NullPointerException|Number|NumberFormat|NumberFormatException|NumberFormatter|NumberOfDocuments|NumberOfInterveningJobs|NumberUp|NumberUpSupported|NumericShaper|NVList|OBJ_ADAPTER|Object|OBJECT_NOT_EXIST|ObjectAlreadyActive|ObjectAlreadyActiveHelper|ObjectChangeListener|ObjectFactory|ObjectFactoryBuilder|ObjectHelper|ObjectHolder|ObjectIdHelper|ObjectImpl|ObjectInput|ObjectInputStream|ObjectInputValidation|ObjectNotActive|ObjectNotActiveHelper|ObjectOutput|ObjectOutputStream|ObjectStreamClass|ObjectStreamConstants|ObjectStreamException|ObjectStreamField|ObjectView|ObjID|Observable|Observer|OctetSeqHelper|OctetSeqHolder|Oid|OMGVMCID|OpenType|Operation|OperationNotSupportedException|Option|OptionalDataException|OptionPaneUI|ORB|ORBInitializer|ORBInitializerOperations|ORBInitInfo|ORBInitInfoOperations|OrientationRequested|OutOfMemoryError|OutputDeviceAssigned|OutputKeys|OutputStream|OutputStreamWriter|OverlappingFileLockException|OverlayLayout|Owner|Package|PackedColorModel|Pageable|PageAttributes|PageFormat|PageRanges|PagesPerMinute|PagesPerMinuteColor|Paint|PaintContext|PaintEvent|Panel|PanelUI|Paper|ParagraphView|Parameter|ParameterBlock|ParameterDescriptor|ParameterMetaData|ParameterMode|ParameterModeHelper|ParameterModeHolder|ParseException|ParsePosition|Parser|ParserAdapter|ParserConfigurationException|ParserDelegator|ParserFactory|PartialResultException|PasswordAuthentication|PasswordCallback|PasswordView|Patch|PathIterator|Pattern|PatternSyntaxException|PBEKey|PBEKeySpec|PBEParameterSpec|PDLOverrideSupported|Permission|PermissionCollection|Permissions|PERSIST_STORE|PersistenceDelegate|PhantomReference|Pipe|PipedInputStream|PipedOutputStream|PipedReader|PipedWriter|PixelGrabber|PixelInterleavedSampleModel|PKCS8EncodedKeySpec|PKIXBuilderParameters|PKIXCertPathBuilderResult|PKIXCertPathChecker|PKIXCertPathValidatorResult|PKIXParameters|PlainDocument|PlainView|POA|POAHelper|POAManager|POAManagerOperations|POAOperations|Point|Point2D|Policy|PolicyError|PolicyErrorCodeHelper|PolicyErrorHelper|PolicyErrorHolder|PolicyFactory|PolicyFactoryOperations|PolicyHelper|PolicyHolder|PolicyListHelper|PolicyListHolder|PolicyNode|PolicyOperations|PolicyQualifierInfo|PolicyTypeHelper|Polygon|PooledConnection|Popup|PopupFactory|PopupMenu|PopupMenuEvent|PopupMenuListener|PopupMenuUI|Port|PortableRemoteObject|PortableRemoteObjectDelegate|PortUnreachableException|Position|PreferenceChangeEvent|PreferenceChangeListener|Preferences|PreferencesFactory|PreparedStatement|PresentationDirection|Principal|PrincipalHolder|Printable|PrinterAbortException|PrinterException|PrinterGraphics|PrinterInfo|PrinterIOException|PrinterIsAcceptingJobs|PrinterJob|PrinterLocation|PrinterMakeAndModel|PrinterMessageFromOperator|PrinterMoreInfo|PrinterMoreInfoManufacturer|PrinterName|PrinterResolution|PrinterState|PrinterStateReason|PrinterStateReasons|PrinterURI|PrintEvent|PrintException|PrintGraphics|PrintJob|PrintJobAdapter|PrintJobAttribute|PrintJobAttributeEvent|PrintJobAttributeListener|PrintJobAttributeSet|PrintJobEvent|PrintJobListener|PrintQuality|PrintRequestAttribute|PrintRequestAttributeSet|PrintService|PrintServiceAttribute|PrintServiceAttributeEvent|PrintServiceAttributeListener|PrintServiceAttributeSet|PrintServiceLookup|PrintStream|PrintWriter|PRIVATE_MEMBER|PrivateCredentialPermission|PrivateKey|PrivilegedAction|PrivilegedActionException|PrivilegedExceptionAction|Process|ProcessingInstruction|ProfileDataException|ProfileIdHelper|ProgressBarUI|ProgressMonitor|ProgressMonitorInputStream|Properties|PropertyChangeEvent|PropertyChangeListener|PropertyChangeListenerProxy|PropertyChangeSupport|PropertyDescriptor|PropertyEditor|PropertyEditorManager|PropertyEditorSupport|PropertyPermission|PropertyResourceBundle|PropertyVetoException|ProtectionDomain|ProtocolException|Provider|ProviderException|Proxy|PSSParameterSpec|PUBLIC_MEMBER|PublicKey|PushbackInputStream|PushbackReader|QuadCurve2D|QueuedJobCount|Random|RandomAccess|RandomAccessFile|Raster|RasterFormatException|RasterOp|RC2ParameterSpec|RC5ParameterSpec|ReadableByteChannel|Reader|ReadOnlyBufferException|Receiver|Rectangle|Rectangle2D|RectangularShape|Ref|RefAddr|Reference|Referenceable|ReferenceQueue|ReferenceUriSchemesSupported|ReferralException|ReflectPermission|Refreshable|RefreshFailedException|RegisterableService|Registry|RegistryHandler|RemarshalException|Remote|RemoteCall|RemoteException|RemoteObject|RemoteRef|RemoteServer|RemoteStub|RenderableImage|RenderableImageOp|RenderableImageProducer|RenderContext|RenderedImage|RenderedImageFactory|Renderer|RenderingHints|RepaintManager|ReplicateScaleFilter|RepositoryIdHelper|Request|REQUEST_PROCESSING_POLICY_ID|RequestInfo|RequestInfoOperations|RequestingUserName|RequestProcessingPolicy|RequestProcessingPolicyOperations|RequestProcessingPolicyValue|RescaleOp|ResolutionSyntax|Resolver|ResolveResult|ResourceBundle|ResponseHandler|Result|ResultSet|ResultSetMetaData|ReverbType|RGBImageFilter|RMIClassLoader|RMIClassLoaderSpi|RMIClientSocketFactory|RMIFailureHandler|RMISecurityException|RMISecurityManager|RMIServerSocketFactory|RMISocketFactory|Robot|RootPaneContainer|RootPaneUI|RoundRectangle2D|RowMapper|RowSet|RowSetEvent|RowSetInternal|RowSetListener|RowSetMetaData|RowSetReader|RowSetWriter|RSAKey|RSAKeyGenParameterSpec|RSAMultiPrimePrivateCrtKey|RSAMultiPrimePrivateCrtKeySpec|RSAOtherPrimeInfo|RSAPrivateCrtKey|RSAPrivateCrtKeySpec|RSAPrivateKey|RSAPrivateKeySpec|RSAPublicKey|RSAPublicKeySpec|RTFEditorKit|RuleBasedCollator|Runnable|Runtime|RunTime|RuntimeException|RunTimeOperations|RuntimePermission|SampleModel|Savepoint|SAXException|SAXNotRecognizedException|SAXNotSupportedException|SAXParseException|SAXParser|SAXParserFactory|SAXResult|SAXSource|SAXTransformerFactory|ScatteringByteChannel|SchemaViolationException|Scrollable|Scrollbar|ScrollBarUI|ScrollPane|ScrollPaneAdjustable|ScrollPaneConstants|ScrollPaneLayout|ScrollPaneUI|SealedObject|SearchControls|SearchResult|SecretKey|SecretKeyFactory|SecretKeyFactorySpi|SecretKeySpec|SecureClassLoader|SecureRandom|SecureRandomSpi|Security|SecurityException|SecurityManager|SecurityPermission|Segment|SelectableChannel|SelectionKey|Selector|SelectorProvider|SeparatorUI|Sequence|SequenceInputStream|Sequencer|Serializable|SerializablePermission|Servant|SERVANT_RETENTION_POLICY_ID|ServantActivator|ServantActivatorHelper|ServantActivatorOperations|ServantActivatorPOA|ServantAlreadyActive|ServantAlreadyActiveHelper|ServantLocator|ServantLocatorHelper|ServantLocatorOperations|ServantLocatorPOA|ServantManager|ServantManagerOperations|ServantNotActive|ServantNotActiveHelper|ServantObject|ServantRetentionPolicy|ServantRetentionPolicyOperations|ServantRetentionPolicyValue|ServerCloneException|ServerError|ServerException|ServerNotActiveException|ServerRef|ServerRequest|ServerRequestInfo|ServerRequestInfoOperations|ServerRequestInterceptor|ServerRequestInterceptorOperations|ServerRuntimeException|ServerSocket|ServerSocketChannel|ServerSocketFactory|ServiceContext|ServiceContextHelper|ServiceContextHolder|ServiceContextListHelper|ServiceContextListHolder|ServiceDetail|ServiceDetailHelper|ServiceIdHelper|ServiceInformation|ServiceInformationHelper|ServiceInformationHolder|ServicePermission|ServiceRegistry|ServiceUI|ServiceUIFactory|ServiceUnavailableException|Set|SetOfIntegerSyntax|SetOverrideType|SetOverrideTypeHelper|Severity|Shape|ShapeGraphicAttribute|SheetCollate|Short|ShortBuffer|ShortBufferException|ShortHolder|ShortLookupTable|ShortMessage|ShortSeqHelper|ShortSeqHolder|Sides|Signature|SignatureException|SignatureSpi|SignedObject|Signer|SimpleAttributeSet|SimpleBeanInfo|SimpleDateFormat|SimpleDoc|SimpleFormatter|SimpleTimeZone|SinglePixelPackedSampleModel|SingleSelectionModel|Size2DSyntax|SizeLimitExceededException|SizeRequirements|SizeSequence|Skeleton|SkeletonMismatchException|SkeletonNotFoundException|SliderUI|Socket|SocketAddress|SocketChannel|SocketException|SocketFactory|SocketHandler|SocketImpl|SocketImplFactory|SocketOptions|SocketPermission|SocketSecurityException|SocketTimeoutException|SoftBevelBorder|SoftReference|SortedMap|SortedSet|SortingFocusTraversalPolicy|Soundbank|SoundbankReader|SoundbankResource|Source|SourceDataLine|SourceLocator|SpinnerDateModel|SpinnerListModel|SpinnerModel|SpinnerNumberModel|SpinnerUI|SplitPaneUI|Spring|SpringLayout|SQLData|SQLException|SQLInput|SQLOutput|SQLPermission|SQLWarning|SSLContext|SSLContextSpi|SSLException|SSLHandshakeException|SSLKeyException|SSLPeerUnverifiedException|SSLPermission|SSLProtocolException|SSLServerSocket|SSLServerSocketFactory|SSLSession|SSLSessionBindingEvent|SSLSessionBindingListener|SSLSessionContext|SSLSocket|SSLSocketFactory|Stack|StackOverflowError|StackTraceElement|StartTlsRequest|StartTlsResponse|State|StateEdit|StateEditable|StateFactory|Statement|Streamable|StreamableValue|StreamCorruptedException|StreamHandler|StreamPrintService|StreamPrintServiceFactory|StreamResult|StreamSource|StreamTokenizer|StrictMath|String|StringBuffer|StringBufferInputStream|StringCharacterIterator|StringContent|StringHolder|StringIndexOutOfBoundsException|StringNameHelper|StringReader|StringRefAddr|StringSelection|StringSeqHelper|StringSeqHolder|StringTokenizer|StringValueHelper|StringWriter|Stroke|Struct|StructMember|StructMemberHelper|Stub|StubDelegate|StubNotFoundException|Style|StyleConstants|StyleContext|StyledDocument|StyledEditorKit|StyleSheet|Subject|SubjectDomainCombiner|SUCCESSFUL|SupportedValuesAttribute|SwingConstants|SwingPropertyChangeSupport|SwingUtilities|SYNC_WITH_TRANSPORT|SyncFailedException|SyncScopeHelper|Synthesizer|SysexMessage|System|SYSTEM_EXCEPTION|SystemColor|SystemException|SystemFlavorMap|TabableView|TabbedPaneUI|TabExpander|TableCellEditor|TableCellRenderer|TableColumn|TableColumnModel|TableColumnModelEvent|TableColumnModelListener|TableHeaderUI|TableModel|TableModelEvent|TableModelListener|TableUI|TableView|TabSet|TabStop|TAG_ALTERNATE_IIOP_ADDRESS|TAG_CODE_SETS|TAG_INTERNET_IOP|TAG_JAVA_CODEBASE|TAG_MULTIPLE_COMPONENTS|TAG_ORB_TYPE|TAG_POLICIES|TagElement|TaggedComponent|TaggedComponentHelper|TaggedComponentHolder|TaggedProfile|TaggedProfileHelper|TaggedProfileHolder|TargetDataLine|TCKind|Templates|TemplatesHandler|Text|TextAction|TextArea|TextAttribute|TextComponent|TextEvent|TextField|TextHitInfo|TextInputCallback|TextLayout|TextListener|TextMeasurer|TextOutputCallback|TextSyntax|TextUI|TexturePaint|Thread|THREAD_POLICY_ID|ThreadDeath|ThreadGroup|ThreadLocal|ThreadPolicy|ThreadPolicyOperations|ThreadPolicyValue|Throwable|Tie|TileObserver|Time|TimeLimitExceededException|Timer|TimerTask|Timestamp|TimeZone|TitledBorder|ToolBarUI|Toolkit|ToolTipManager|ToolTipUI|TooManyListenersException|Track|TRANSACTION_REQUIRED|TRANSACTION_ROLLEDBACK|TransactionRequiredException|TransactionRolledbackException|TransactionService|Transferable|TransferHandler|TransformAttribute|Transformer|TransformerConfigurationException|TransformerException|TransformerFactory|TransformerFactoryConfigurationError|TransformerHandler|TRANSIENT|Transmitter|Transparency|TRANSPORT_RETRY|TreeCellEditor|TreeCellRenderer|TreeExpansionEvent|TreeExpansionListener|TreeMap|TreeModel|TreeModelEvent|TreeModelListener|TreeNode|TreePath|TreeSelectionEvent|TreeSelectionListener|TreeSelectionModel|TreeSet|TreeUI|TreeWillExpandListener|TrustAnchor|TrustManager|TrustManagerFactory|TrustManagerFactorySpi|TypeCode|TypeCodeHolder|TypeMismatch|TypeMismatchHelper|Types|UID|UIDefaults|UIManager|UIResource|ULongLongSeqHelper|ULongLongSeqHolder|ULongSeqHelper|ULongSeqHolder|UndeclaredThrowableException|UndoableEdit|UndoableEditEvent|UndoableEditListener|UndoableEditSupport|UndoManager|UnexpectedException|UnicastRemoteObject|UnionMember|UnionMemberHelper|UNKNOWN|UnknownEncoding|UnknownEncodingHelper|UnknownError|UnknownException|UnknownGroupException|UnknownHostException|UnknownObjectException|UnknownServiceException|UnknownUserException|UnknownUserExceptionHelper|UnknownUserExceptionHolder|UnmappableCharacterException|UnmarshalException|UnmodifiableSetException|UnrecoverableKeyException|Unreferenced|UnresolvedAddressException|UnresolvedPermission|UnsatisfiedLinkError|UnsolicitedNotification|UnsolicitedNotificationEvent|UnsolicitedNotificationListener|UNSUPPORTED_POLICY|UNSUPPORTED_POLICY_VALUE|UnsupportedAddressTypeException|UnsupportedAudioFileException|UnsupportedCallbackException|UnsupportedCharsetException|UnsupportedClassVersionError|UnsupportedEncodingException|UnsupportedFlavorException|UnsupportedLookAndFeelException|UnsupportedOperationException|URI|URIException|URIResolver|URISyntax|URISyntaxException|URL|URLClassLoader|URLConnection|URLDecoder|URLEncoder|URLStreamHandler|URLStreamHandlerFactory|URLStringHelper|USER_EXCEPTION|UserException|UShortSeqHelper|UShortSeqHolder|UTFDataFormatException|Util|UtilDelegate|Utilities|ValueBase|ValueBaseHelper|ValueBaseHolder|ValueFactory|ValueHandler|ValueMember|ValueMemberHelper|VariableHeightLayoutCache|Vector|VerifyError|VersionSpecHelper|VetoableChangeListener|VetoableChangeListenerProxy|VetoableChangeSupport|View|ViewFactory|ViewportLayout|ViewportUI|VirtualMachineError|Visibility|VisibilityHelper|VM_ABSTRACT|VM_CUSTOM|VM_NONE|VM_TRUNCATABLE|VMID|VoiceStatus|Void|VolatileImage|WCharSeqHelper|WCharSeqHolder|WeakHashMap|WeakReference|Window|WindowAdapter|WindowConstants|WindowEvent|WindowFocusListener|WindowListener|WindowStateListener|WrappedPlainView|WritableByteChannel|WritableRaster|WritableRenderedImage|WriteAbortedException|Writer|WrongAdapter|WrongAdapterHelper|WrongPolicy|WrongPolicyHelper|WrongTransaction|WrongTransactionHelper|WrongTransactionHolder|WStringSeqHelper|WStringSeqHolder|WStringValueHelper|X500Principal|X500PrivateCredential|X509Certificate|X509CertSelector|X509CRL|X509CRLEntry|X509CRLSelector|X509EncodedKeySpec|X509Extension|X509KeyManager|X509TrustManager|XAConnection|XADataSource|XAException|XAResource|Xid|XMLDecoder|XMLEncoder|XMLFilter|XMLFilterImpl|XMLFormatter|XMLReader|XMLReaderAdapter|XMLReaderFactory|ZipEntry|ZipException|ZipFile|ZipInputStream|ZipOutputStream|ZoneView|_BindingIteratorImplBase|_BindingIteratorStub|_DynAnyFactoryStub|_DynAnyStub|_DynArrayStub|_DynEnumStub|_DynFixedStub|_DynSequenceStub|_DynStructStub|_DynUnionStub|_DynValueStub|_IDLTypeStub|_NamingContextExtStub|_NamingContextImplBase|_NamingContextStub|_PolicyStub|_Remote_Stub|_ServantActivatorStub|_ServantLocatorStub)$/
2123
+ },
2124
+ {},
2125
+ {},
2126
+ {},
2127
+ {},
2128
+ {}
2129
+ ],
2130
+ 0: [],
2131
+ 1: [],
2132
+ 2: [],
2133
+ 3: [],
2134
+ 4: [],
2135
+ 5: [{}],
2136
+ 6: [{}, {}, {}, {}, {}],
2137
+ 7: [],
2138
+ 8: [],
2139
+ 9: [],
2140
+ 10: [],
2141
+ 11: [],
2142
+ 12: []
2143
+ },
2144
+ kwmap: {
2145
+ types: "types",
2146
+ reserved: "reserved",
2147
+ builtin: "builtin"
2148
+ },
2149
+ parts: {
2150
+ 0: [null, null, null, null, null, null, null, null, null, null, null, null, null],
2151
+ 1: [null, null, null, null, null, null, null, null, null, null, null, null, null],
2152
+ 2: [null, null, null, null, null, null, null, null, null, null, null, null, null],
2153
+ 3: [null, null, null, null, null],
2154
+ 4: [null],
2155
+ 5: [null],
2156
+ 6: [null, null, null, null, null]
2157
+ },
2158
+ subst: {
2159
+ [-1]: [
2160
+ false,
2161
+ false,
2162
+ false,
2163
+ false,
2164
+ false,
2165
+ false,
2166
+ false,
2167
+ false,
2168
+ false,
2169
+ false,
2170
+ false,
2171
+ false,
2172
+ false
2173
+ ],
2174
+ 0: [false, false, false, false, false, false, false, false, false, false, false, false, false],
2175
+ 1: [false, false, false, false, false, false, false, false, false, false, false, false, false],
2176
+ 2: [false, false, false, false, false, false, false, false, false, false, false, false, false],
2177
+ 3: [false, false, false, false, false],
2178
+ 4: [false],
2179
+ 5: [false],
2180
+ 6: [false, false, false, false, false]
2181
+ }
2182
+ };
2183
+
2184
+ // packages/render/src/libs/highlighter/languages/javascript.ts
2185
+ var javascriptLang = {
2186
+ language: "javascript",
2187
+ defClass: "code",
2188
+ regs: {
2189
+ [-1]: /(\{)|(\()|(\[)|(\/\*)|(")|(')|(\/\/)|(\/)|([a-z_]\w*)|(\d*\.?\d+)/gi,
2190
+ 0: /(\{)|(\()|(\[)|(\/\*)|(")|(')|(\/\/)|(\/)|([a-z_]\w*)|(\d*\.?\d+)/gi,
2191
+ 1: /(\{)|(\()|(\[)|(\/\*)|(")|(')|(\/\/)|(\/)|([a-z_]\w*)|(\d*\.?\d+)/gi,
2192
+ 2: /(\{)|(\()|(\[)|(\/\*)|(")|(')|(\/\/)|(\/)|([a-z_]\w*)|(\d*\.?\d+)/gi,
2193
+ 3: /(((https?|ftp):\/\/[\w?.\-&=/%+]+)|(^|[\s,!?])www\.\w+\.\w+[\w?.&=/%+]*)|(\w+[.\w-]+@(\w+[.\w-])+)|(\b(note|fixme):)|(\$\w+:.+\$)/gim,
2194
+ 4: /(\\\\|\\"|\\'|\\`|\\t|\\n|\\r)/gi,
2195
+ 5: /(\\\\|\\"|\\'|\\`)/gi,
2196
+ 6: /(((https?|ftp):\/\/[\w?.\-&=/%+]+)|(^|[\s,!?])www\.\w+\.\w+[\w?.&=/%+]*)|(\w+[.\w-]+@(\w+[.\w-])+)|(\b(note|fixme):)|(\$\w+:.+\$)/gim,
2197
+ 7: /(\\\/)/gi
2198
+ },
2199
+ counts: {
2200
+ [-1]: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
2201
+ 0: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
2202
+ 1: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
2203
+ 2: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
2204
+ 3: [3, 1, 1, 0],
2205
+ 4: [0],
2206
+ 5: [0],
2207
+ 6: [3, 1, 1, 0],
2208
+ 7: [0]
2209
+ },
2210
+ delim: {
2211
+ [-1]: [
2212
+ "brackets",
2213
+ "brackets",
2214
+ "brackets",
2215
+ "comment",
2216
+ "quotes",
2217
+ "quotes",
2218
+ "comment",
2219
+ "quotes",
2220
+ "",
2221
+ ""
2222
+ ],
2223
+ 0: [
2224
+ "brackets",
2225
+ "brackets",
2226
+ "brackets",
2227
+ "comment",
2228
+ "quotes",
2229
+ "quotes",
2230
+ "comment",
2231
+ "quotes",
2232
+ "",
2233
+ ""
2234
+ ],
2235
+ 1: [
2236
+ "brackets",
2237
+ "brackets",
2238
+ "brackets",
2239
+ "comment",
2240
+ "quotes",
2241
+ "quotes",
2242
+ "comment",
2243
+ "quotes",
2244
+ "",
2245
+ ""
2246
+ ],
2247
+ 2: [
2248
+ "brackets",
2249
+ "brackets",
2250
+ "brackets",
2251
+ "comment",
2252
+ "quotes",
2253
+ "quotes",
2254
+ "comment",
2255
+ "quotes",
2256
+ "",
2257
+ ""
2258
+ ],
2259
+ 3: ["", "", "", ""],
2260
+ 4: [""],
2261
+ 5: [""],
2262
+ 6: ["", "", "", ""],
2263
+ 7: [""]
2264
+ },
2265
+ inner: {
2266
+ [-1]: [
2267
+ "code",
2268
+ "code",
2269
+ "code",
2270
+ "comment",
2271
+ "string",
2272
+ "string",
2273
+ "comment",
2274
+ "string",
2275
+ "identifier",
2276
+ "number"
2277
+ ],
2278
+ 0: [
2279
+ "code",
2280
+ "code",
2281
+ "code",
2282
+ "comment",
2283
+ "string",
2284
+ "string",
2285
+ "comment",
2286
+ "string",
2287
+ "identifier",
2288
+ "number"
2289
+ ],
2290
+ 1: [
2291
+ "code",
2292
+ "code",
2293
+ "code",
2294
+ "comment",
2295
+ "string",
2296
+ "string",
2297
+ "comment",
2298
+ "string",
2299
+ "identifier",
2300
+ "number"
2301
+ ],
2302
+ 2: [
2303
+ "code",
2304
+ "code",
2305
+ "code",
2306
+ "comment",
2307
+ "string",
2308
+ "string",
2309
+ "comment",
2310
+ "string",
2311
+ "identifier",
2312
+ "number"
2313
+ ],
2314
+ 3: ["url", "url", "inlinedoc", "inlinedoc"],
2315
+ 4: ["special"],
2316
+ 5: ["special"],
2317
+ 6: ["url", "url", "inlinedoc", "inlinedoc"],
2318
+ 7: ["special"]
2319
+ },
2320
+ end: {
2321
+ 0: /\}/gi,
2322
+ 1: /\)/gi,
2323
+ 2: /\]/gi,
2324
+ 3: /\*\//gi,
2325
+ 4: /"/gi,
2326
+ 5: /'/gi,
2327
+ 6: /$/gim,
2328
+ 7: /\/g?i?/g
2329
+ },
2330
+ states: {
2331
+ [-1]: [0, 1, 2, 3, 4, 5, 6, 7, -1, -1],
2332
+ 0: [0, 1, 2, 3, 4, 5, 6, 7, -1, -1],
2333
+ 1: [0, 1, 2, 3, 4, 5, 6, 7, -1, -1],
2334
+ 2: [0, 1, 2, 3, 4, 5, 6, 7, -1, -1],
2335
+ 3: [-1, -1, -1, -1],
2336
+ 4: [-1],
2337
+ 5: [-1],
2338
+ 6: [-1, -1, -1, -1],
2339
+ 7: [-1]
2340
+ },
2341
+ keywords: {
2342
+ [-1]: [
2343
+ -1,
2344
+ -1,
2345
+ -1,
2346
+ -1,
2347
+ -1,
2348
+ -1,
2349
+ -1,
2350
+ -1,
2351
+ {
2352
+ builtin: /^(String|Array|RegExp|Function|Math|Number|Date|Image|window|document|navigator|onAbort|onBlur|onChange|onClick|onDblClick|onDragDrop|onError|onFocus|onKeyDown|onKeyPress|onKeyUp|onLoad|onMouseDown|onMouseOver|onMouseOut|onMouseMove|onMouseUp|onMove|onReset|onResize|onSelect|onSubmit|onUnload)$/,
2353
+ reserved: /^(break|continue|do|while|export|for|in|if|else|import|return|label|switch|case|var|with|delete|new|this|typeof|void|abstract|boolean|byte|catch|char|class|const|debugger|default|double|enum|extends|false|final|finally|float|function|implements|goto|instanceof|int|interface|long|native|null|package|private|protected|public|short|static|super|synchronized|throw|throws|transient|true|try|volatile)$/
2354
+ },
2355
+ {}
2356
+ ],
2357
+ 0: [],
2358
+ 1: [],
2359
+ 2: [],
2360
+ 3: [],
2361
+ 4: [{}],
2362
+ 5: [{}],
2363
+ 6: [{}, {}, {}, {}],
2364
+ 7: [{}],
2365
+ 8: [],
2366
+ 9: []
2367
+ },
2368
+ kwmap: {
2369
+ builtin: "builtin",
2370
+ reserved: "reserved"
2371
+ },
2372
+ parts: {
2373
+ 0: [null, null, null, null, null, null, null, null, null, null],
2374
+ 1: [null, null, null, null, null, null, null, null, null, null],
2375
+ 2: [null, null, null, null, null, null, null, null, null, null],
2376
+ 3: [null, null, null, null],
2377
+ 4: [null],
2378
+ 5: [null],
2379
+ 6: [null, null, null, null],
2380
+ 7: [null]
2381
+ },
2382
+ subst: {
2383
+ [-1]: [false, false, false, false, false, false, false, false, false, false],
2384
+ 0: [false, false, false, false, false, false, false, false, false, false],
2385
+ 1: [false, false, false, false, false, false, false, false, false, false],
2386
+ 2: [false, false, false, false, false, false, false, false, false, false],
2387
+ 3: [false, false, false, false],
2388
+ 4: [false],
2389
+ 5: [false],
2390
+ 6: [false, false, false, false],
2391
+ 7: [false]
2392
+ }
2393
+ };
2394
+
2395
+ // packages/render/src/libs/highlighter/languages/php.ts
2396
+ var phpLang = {
2397
+ language: "php",
2398
+ defClass: "code",
2399
+ regs: {
2400
+ [-1]: /(<\?(php|=)?)/gi,
2401
+ 0: /(\{)|(\()|(\[)|(\/\*)|(")|(`)|(<<<[\x20\x09]*(\w+)$)|(')|((#|\/\/))|([a-z_]\w*)|(\((array|int|integer|string|bool|boolean|object|float|double)\))|(0[xX][\da-f]+)|(\$[a-z_]\w*)|(\d\d*|\b0\b)|(0[0-7]+)|((\d*\.\d+)|(\d+\.\d*))|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))/gim,
2402
+ 1: /(\{)|(\()|(\[)|(\/\*)|(")|(`)|(<<<[\x20\x09]*(\w+)$)|(')|((#|\/\/))|([a-z_]\w*)|(\((array|int|integer|string|bool|boolean|object|float|double)\))|(\?>)|(0[xX][\da-f]+)|(\$[a-z_]\w*)|(\d\d*|\b0\b)|(0[0-7]+)|((\d*\.\d+)|(\d+\.\d*))|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))/gim,
2403
+ 2: /(\{)|(\()|(\[)|(\/\*)|(")|(`)|(<<<[\x20\x09]*(\w+)$)|(')|((#|\/\/))|([a-z_]\w*)|(\((array|int|integer|string|bool|boolean|object|float|double)\))|(0[xX][\da-f]+)|(\$[a-z_]\w*)|(\d\d*|\b0\b)|(0[0-7]+)|((\d*\.\d+)|(\d+\.\d*))|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))/gim,
2404
+ 3: /(\{)|(\()|(\[)|(\/\*)|(")|(`)|(<<<[\x20\x09]*(\w+)$)|(')|((#|\/\/))|([a-z_]\w*)|(\((array|int|integer|string|bool|boolean|object|float|double)\))|(0[xX][\da-f]+)|(\$[a-z_]\w*)|(\d\d*|\b0\b)|(0[0-7]+)|((\d*\.\d+)|(\d+\.\d*))|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))/gim,
2405
+ 4: /(\s@\w+\s)|(((https?|ftp):\/\/[\w?.\-&=/%+]+)|(^|[\s,!?])www\.\w+\.\w+[\w?.&=/%+]*)|(\w+[.\w-]+@(\w+[.\w-])+)|(\bnote:)|(\$\w+\s*:.*\$)/gim,
2406
+ 5: /(\\[\\"'`tnr${])|(\{\$[a-z_].*\})|(\$[a-z_]\w*)/gi,
2407
+ 6: /(\\\\|\\"|\\'|\\`)|(\{\$[a-z_].*\})|(\$[a-z_]\w*)/gi,
2408
+ 7: /(\\[\\"'`tnr${])|(\{\$[a-z_].*\})|(\$[a-z_]\w*)/gi,
2409
+ 8: /(\\\\|\\"|\\'|\\`)/gi,
2410
+ 9: /(\s@\w+\s)|(((https?|ftp):\/\/[\w?.\-&=/%+]+)|(^|[\s,!?])www\.\w+\.\w+[\w?.&=/%+]*)|(\w+[.\w-]+@(\w+[.\w-])+)|(\bnote:)|(\$\w+\s*:.*\$)/gim,
2411
+ 10: null
2412
+ },
2413
+ counts: {
2414
+ [-1]: [1],
2415
+ 0: [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 2, 5],
2416
+ 1: [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 2, 5],
2417
+ 2: [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 2, 5],
2418
+ 3: [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 2, 5],
2419
+ 4: [0, 3, 1, 0, 0],
2420
+ 5: [0, 0, 0],
2421
+ 6: [0, 0, 0],
2422
+ 7: [0, 0, 0],
2423
+ 8: [0],
2424
+ 9: [0, 3, 1, 0, 0],
2425
+ 10: []
2426
+ },
2427
+ delim: {
2428
+ [-1]: ["inlinetags"],
2429
+ 0: [
2430
+ "brackets",
2431
+ "brackets",
2432
+ "brackets",
2433
+ "comment",
2434
+ "quotes",
2435
+ "quotes",
2436
+ "quotes",
2437
+ "quotes",
2438
+ "comment",
2439
+ "",
2440
+ "",
2441
+ "",
2442
+ "",
2443
+ "",
2444
+ "",
2445
+ "",
2446
+ ""
2447
+ ],
2448
+ 1: [
2449
+ "brackets",
2450
+ "brackets",
2451
+ "brackets",
2452
+ "comment",
2453
+ "quotes",
2454
+ "quotes",
2455
+ "quotes",
2456
+ "quotes",
2457
+ "comment",
2458
+ "",
2459
+ "",
2460
+ "inlinetags",
2461
+ "",
2462
+ "",
2463
+ "",
2464
+ "",
2465
+ "",
2466
+ ""
2467
+ ],
2468
+ 2: [
2469
+ "brackets",
2470
+ "brackets",
2471
+ "brackets",
2472
+ "comment",
2473
+ "quotes",
2474
+ "quotes",
2475
+ "quotes",
2476
+ "quotes",
2477
+ "comment",
2478
+ "",
2479
+ "",
2480
+ "",
2481
+ "",
2482
+ "",
2483
+ "",
2484
+ "",
2485
+ ""
2486
+ ],
2487
+ 3: [
2488
+ "brackets",
2489
+ "brackets",
2490
+ "brackets",
2491
+ "comment",
2492
+ "quotes",
2493
+ "quotes",
2494
+ "quotes",
2495
+ "quotes",
2496
+ "comment",
2497
+ "",
2498
+ "",
2499
+ "",
2500
+ "",
2501
+ "",
2502
+ "",
2503
+ "",
2504
+ ""
2505
+ ],
2506
+ 4: ["", "", "", "", ""],
2507
+ 5: ["", "", ""],
2508
+ 6: ["", "", ""],
2509
+ 7: ["", "", ""],
2510
+ 8: [""],
2511
+ 9: ["", "", "", "", ""],
2512
+ 10: []
2513
+ },
2514
+ inner: {
2515
+ [-1]: ["code"],
2516
+ 0: [
2517
+ "code",
2518
+ "code",
2519
+ "code",
2520
+ "comment",
2521
+ "string",
2522
+ "string",
2523
+ "string",
2524
+ "string",
2525
+ "comment",
2526
+ "identifier",
2527
+ "reserved",
2528
+ "number",
2529
+ "var",
2530
+ "number",
2531
+ "number",
2532
+ "number",
2533
+ "number"
2534
+ ],
2535
+ 1: [
2536
+ "code",
2537
+ "code",
2538
+ "code",
2539
+ "comment",
2540
+ "string",
2541
+ "string",
2542
+ "string",
2543
+ "string",
2544
+ "comment",
2545
+ "identifier",
2546
+ "reserved",
2547
+ "default",
2548
+ "number",
2549
+ "var",
2550
+ "number",
2551
+ "number",
2552
+ "number",
2553
+ "number"
2554
+ ],
2555
+ 2: [
2556
+ "code",
2557
+ "code",
2558
+ "code",
2559
+ "comment",
2560
+ "string",
2561
+ "string",
2562
+ "string",
2563
+ "string",
2564
+ "comment",
2565
+ "identifier",
2566
+ "reserved",
2567
+ "number",
2568
+ "var",
2569
+ "number",
2570
+ "number",
2571
+ "number",
2572
+ "number"
2573
+ ],
2574
+ 3: [
2575
+ "code",
2576
+ "code",
2577
+ "code",
2578
+ "comment",
2579
+ "string",
2580
+ "string",
2581
+ "string",
2582
+ "string",
2583
+ "comment",
2584
+ "identifier",
2585
+ "reserved",
2586
+ "number",
2587
+ "var",
2588
+ "number",
2589
+ "number",
2590
+ "number",
2591
+ "number"
2592
+ ],
2593
+ 4: ["inlinedoc", "url", "url", "inlinedoc", "inlinedoc"],
2594
+ 5: ["special", "var", "var"],
2595
+ 6: ["special", "var", "var"],
2596
+ 7: ["special", "var", "var"],
2597
+ 8: ["special"],
2598
+ 9: ["inlinedoc", "url", "url", "inlinedoc", "inlinedoc"],
2599
+ 10: []
2600
+ },
2601
+ end: {
2602
+ 0: /\?>/gi,
2603
+ 1: /\}/gi,
2604
+ 2: /\)/gi,
2605
+ 3: /\]/gi,
2606
+ 4: /\*\//gi,
2607
+ 5: /"/gi,
2608
+ 6: /`/gi,
2609
+ 7: /^%1%;?$/gim,
2610
+ 8: /'/gi,
2611
+ 9: /$|(?=\?>)/gim,
2612
+ 10: /<\?(php|=)?/gi
2613
+ },
2614
+ states: {
2615
+ [-1]: [0],
2616
+ 0: [1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1],
2617
+ 1: [1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, 10, -1, -1, -1, -1, -1, -1],
2618
+ 2: [1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1],
2619
+ 3: [1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1],
2620
+ 4: [-1, -1, -1, -1, -1],
2621
+ 5: [-1, -1, -1],
2622
+ 6: [-1, -1, -1],
2623
+ 7: [-1, -1, -1],
2624
+ 8: [-1],
2625
+ 9: [-1, -1, -1, -1, -1],
2626
+ 10: []
2627
+ },
2628
+ keywords: {
2629
+ [-1]: [-1],
2630
+ 0: [],
2631
+ 1: [],
2632
+ 2: [],
2633
+ 3: [],
2634
+ 4: [],
2635
+ 5: [{}, {}, {}],
2636
+ 6: [{}, {}, {}],
2637
+ 7: [{}, {}, {}],
2638
+ 8: [{}],
2639
+ 9: [{}, {}, {}, {}, {}],
2640
+ 10: [],
2641
+ 11: [],
2642
+ 12: [],
2643
+ 13: [],
2644
+ 14: [],
2645
+ 15: [],
2646
+ 16: [],
2647
+ 17: []
2648
+ },
2649
+ kwmap: {
2650
+ constants: "reserved",
2651
+ reserved: "reserved"
2652
+ },
2653
+ parts: {
2654
+ 0: [
2655
+ null,
2656
+ null,
2657
+ null,
2658
+ null,
2659
+ null,
2660
+ null,
2661
+ null,
2662
+ null,
2663
+ null,
2664
+ null,
2665
+ null,
2666
+ null,
2667
+ null,
2668
+ null,
2669
+ null,
2670
+ null,
2671
+ null
2672
+ ],
2673
+ 1: [
2674
+ null,
2675
+ null,
2676
+ null,
2677
+ null,
2678
+ null,
2679
+ null,
2680
+ null,
2681
+ null,
2682
+ null,
2683
+ null,
2684
+ null,
2685
+ null,
2686
+ null,
2687
+ null,
2688
+ null,
2689
+ null,
2690
+ null,
2691
+ null
2692
+ ],
2693
+ 2: [
2694
+ null,
2695
+ null,
2696
+ null,
2697
+ null,
2698
+ null,
2699
+ null,
2700
+ null,
2701
+ null,
2702
+ null,
2703
+ null,
2704
+ null,
2705
+ null,
2706
+ null,
2707
+ null,
2708
+ null,
2709
+ null,
2710
+ null
2711
+ ],
2712
+ 3: [
2713
+ null,
2714
+ null,
2715
+ null,
2716
+ null,
2717
+ null,
2718
+ null,
2719
+ null,
2720
+ null,
2721
+ null,
2722
+ null,
2723
+ null,
2724
+ null,
2725
+ null,
2726
+ null,
2727
+ null,
2728
+ null,
2729
+ null
2730
+ ],
2731
+ 4: [null, null, null, null, null],
2732
+ 5: [null, null, null],
2733
+ 6: [null, null, null],
2734
+ 7: [null, null, null],
2735
+ 8: [null],
2736
+ 9: [null, null, null, null, null],
2737
+ 10: []
2738
+ },
2739
+ subst: {
2740
+ [-1]: [false],
2741
+ 0: [
2742
+ false,
2743
+ false,
2744
+ false,
2745
+ false,
2746
+ false,
2747
+ false,
2748
+ true,
2749
+ false,
2750
+ false,
2751
+ false,
2752
+ false,
2753
+ false,
2754
+ false,
2755
+ false,
2756
+ false,
2757
+ false,
2758
+ false
2759
+ ],
2760
+ 1: [
2761
+ false,
2762
+ false,
2763
+ false,
2764
+ false,
2765
+ false,
2766
+ false,
2767
+ true,
2768
+ false,
2769
+ false,
2770
+ false,
2771
+ false,
2772
+ false,
2773
+ false,
2774
+ false,
2775
+ false,
2776
+ false,
2777
+ false,
2778
+ false
2779
+ ],
2780
+ 2: [
2781
+ false,
2782
+ false,
2783
+ false,
2784
+ false,
2785
+ false,
2786
+ false,
2787
+ true,
2788
+ false,
2789
+ false,
2790
+ false,
2791
+ false,
2792
+ false,
2793
+ false,
2794
+ false,
2795
+ false,
2796
+ false,
2797
+ false
2798
+ ],
2799
+ 3: [
2800
+ false,
2801
+ false,
2802
+ false,
2803
+ false,
2804
+ false,
2805
+ false,
2806
+ true,
2807
+ false,
2808
+ false,
2809
+ false,
2810
+ false,
2811
+ false,
2812
+ false,
2813
+ false,
2814
+ false,
2815
+ false,
2816
+ false
2817
+ ],
2818
+ 4: [false, false, false, false, false],
2819
+ 5: [false, false, false],
2820
+ 6: [false, false, false],
2821
+ 7: [false, false, false],
2822
+ 8: [false],
2823
+ 9: [false, false, false, false, false],
2824
+ 10: []
2825
+ }
2826
+ };
2827
+
2828
+ // packages/render/src/libs/highlighter/languages/python.ts
2829
+ var pythonLang = {
2830
+ language: "python",
2831
+ defClass: "code",
2832
+ regs: {
2833
+ [-1]: /(''')|(""")|(")|(')|(\()|(\[)|([a-z_]\w*(?=\s*\())|([a-z_]\w*)|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))|(((\d*\.\d+)|(\d+\.\d*)|(\d+))j)|((\d*\.\d+)|(\d+\.\d*))|(\d+l?|\b0l?\b)|(0[xX][\da-f]+l?)|(0[0-7]+l?)|(#.+)/gi,
2834
+ 0: /(\\.)/gi,
2835
+ 1: /(\\.)/gi,
2836
+ 2: /(\\.)/gi,
2837
+ 3: /(\\.)/gi,
2838
+ 4: /(''')|(""")|(")|(')|(\()|(\[)|([a-z_]\w*(?=\s*\())|([a-z_]\w*)|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))|(((\d*\.\d+)|(\d+\.\d*)|(\d+))j)|((\d*\.\d+)|(\d+\.\d*))|(\d+l?|\b0l?\b)|(0[xX][\da-f]+l?)|(0[0-7]+l?)|(#.+)/gi,
2839
+ 5: /(''')|(""")|(")|(')|(\()|(\[)|([a-z_]\w*(?=\s*\())|([a-z_]\w*)|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))|(((\d*\.\d+)|(\d+\.\d*)|(\d+))j)|((\d*\.\d+)|(\d+\.\d*))|(\d+l?|\b0l?\b)|(0[xX][\da-f]+l?)|(0[0-7]+l?)|(#.+)/gi
2840
+ },
2841
+ counts: {
2842
+ [-1]: [0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 2, 0, 0, 0, 0],
2843
+ 0: [0],
2844
+ 1: [0],
2845
+ 2: [0],
2846
+ 3: [0],
2847
+ 4: [0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 2, 0, 0, 0, 0],
2848
+ 5: [0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 2, 0, 0, 0, 0]
2849
+ },
2850
+ delim: {
2851
+ [-1]: [
2852
+ "quotes",
2853
+ "quotes",
2854
+ "quotes",
2855
+ "quotes",
2856
+ "brackets",
2857
+ "brackets",
2858
+ "",
2859
+ "",
2860
+ "",
2861
+ "",
2862
+ "",
2863
+ "",
2864
+ "",
2865
+ "",
2866
+ ""
2867
+ ],
2868
+ 0: [""],
2869
+ 1: [""],
2870
+ 2: [""],
2871
+ 3: [""],
2872
+ 4: [
2873
+ "quotes",
2874
+ "quotes",
2875
+ "quotes",
2876
+ "quotes",
2877
+ "brackets",
2878
+ "brackets",
2879
+ "",
2880
+ "",
2881
+ "",
2882
+ "",
2883
+ "",
2884
+ "",
2885
+ "",
2886
+ "",
2887
+ ""
2888
+ ],
2889
+ 5: [
2890
+ "quotes",
2891
+ "quotes",
2892
+ "quotes",
2893
+ "quotes",
2894
+ "brackets",
2895
+ "brackets",
2896
+ "",
2897
+ "",
2898
+ "",
2899
+ "",
2900
+ "",
2901
+ "",
2902
+ "",
2903
+ "",
2904
+ ""
2905
+ ]
2906
+ },
2907
+ inner: {
2908
+ [-1]: [
2909
+ "string",
2910
+ "string",
2911
+ "string",
2912
+ "string",
2913
+ "code",
2914
+ "code",
2915
+ "identifier",
2916
+ "identifier",
2917
+ "number",
2918
+ "number",
2919
+ "number",
2920
+ "number",
2921
+ "number",
2922
+ "number",
2923
+ "comment"
2924
+ ],
2925
+ 0: ["special"],
2926
+ 1: ["special"],
2927
+ 2: ["special"],
2928
+ 3: ["special"],
2929
+ 4: [
2930
+ "string",
2931
+ "string",
2932
+ "string",
2933
+ "string",
2934
+ "code",
2935
+ "code",
2936
+ "identifier",
2937
+ "identifier",
2938
+ "number",
2939
+ "number",
2940
+ "number",
2941
+ "number",
2942
+ "number",
2943
+ "number",
2944
+ "comment"
2945
+ ],
2946
+ 5: [
2947
+ "string",
2948
+ "string",
2949
+ "string",
2950
+ "string",
2951
+ "code",
2952
+ "code",
2953
+ "identifier",
2954
+ "identifier",
2955
+ "number",
2956
+ "number",
2957
+ "number",
2958
+ "number",
2959
+ "number",
2960
+ "number",
2961
+ "comment"
2962
+ ]
2963
+ },
2964
+ end: {
2965
+ 0: /'''/gi,
2966
+ 1: /"""/gi,
2967
+ 2: /"/gi,
2968
+ 3: /'/gi,
2969
+ 4: /\)/gi,
2970
+ 5: /\]/gi
2971
+ },
2972
+ states: {
2973
+ [-1]: [0, 1, 2, 3, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1],
2974
+ 0: [-1],
2975
+ 1: [-1],
2976
+ 2: [-1],
2977
+ 3: [-1],
2978
+ 4: [0, 1, 2, 3, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1],
2979
+ 5: [0, 1, 2, 3, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1]
2980
+ },
2981
+ keywords: {
2982
+ [-1]: [
2983
+ -1,
2984
+ -1,
2985
+ -1,
2986
+ -1,
2987
+ -1,
2988
+ -1,
2989
+ {
2990
+ builtin: /^(__import__|abs|apply|basestring|bool|buffer|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|min|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|round|setattr|slice|staticmethod|sum|super|str|tuple|type|unichr|unicode|vars|xrange|zip)$/
2991
+ },
2992
+ {
2993
+ reserved: /^(and|del|for|is|raise|assert|elif|from|lambda|return|break|else|global|not|try|class|except|if|or|while|continue|exec|import|pass|yield|def|finally|in|print|False|True|None|NotImplemented|Ellipsis|Exception|SystemExit|StopIteration|StandardError|KeyboardInterrupt|ImportError|EnvironmentError|IOError|OSError|WindowsError|EOFError|RuntimeError|NotImplementedError|NameError|UnboundLocalError|AttributeError|SyntaxError|IndentationError|TabError|TypeError|AssertionError|LookupError|IndexError|KeyError|ArithmeticError|OverflowError|ZeroDivisionError|FloatingPointError|ValueError|UnicodeError|UnicodeEncodeError|UnicodeDecodeError|UnicodeTranslateError|ReferenceError|SystemError|MemoryError|Warning|UserWarning|DeprecationWarning|PendingDeprecationWarning|SyntaxWarning|OverflowWarning|RuntimeWarning|FutureWarning)$/
2994
+ },
2995
+ {},
2996
+ {},
2997
+ {},
2998
+ {},
2999
+ {},
3000
+ {},
3001
+ {}
3002
+ ],
3003
+ 0: [],
3004
+ 1: [{}],
3005
+ 2: [{}],
3006
+ 3: [{}],
3007
+ 4: [
3008
+ -1,
3009
+ -1,
3010
+ -1,
3011
+ -1,
3012
+ -1,
3013
+ -1,
3014
+ {
3015
+ builtin: /^(__import__|abs|apply|basestring|bool|buffer|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|min|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|round|setattr|slice|staticmethod|sum|super|str|tuple|type|unichr|unicode|vars|xrange|zip)$/
3016
+ },
3017
+ {
3018
+ reserved: /^(and|del|for|is|raise|assert|elif|from|lambda|return|break|else|global|not|try|class|except|if|or|while|continue|exec|import|pass|yield|def|finally|in|print|False|True|None|NotImplemented|Ellipsis|Exception|SystemExit|StopIteration|StandardError|KeyboardInterrupt|ImportError|EnvironmentError|IOError|OSError|WindowsError|EOFError|RuntimeError|NotImplementedError|NameError|UnboundLocalError|AttributeError|SyntaxError|IndentationError|TabError|TypeError|AssertionError|LookupError|IndexError|KeyError|ArithmeticError|OverflowError|ZeroDivisionError|FloatingPointError|ValueError|UnicodeError|UnicodeEncodeError|UnicodeDecodeError|UnicodeTranslateError|ReferenceError|SystemError|MemoryError|Warning|UserWarning|DeprecationWarning|PendingDeprecationWarning|SyntaxWarning|OverflowWarning|RuntimeWarning|FutureWarning)$/
3019
+ },
3020
+ {},
3021
+ {},
3022
+ {},
3023
+ {},
3024
+ {},
3025
+ {},
3026
+ {}
3027
+ ],
3028
+ 5: [
3029
+ -1,
3030
+ -1,
3031
+ -1,
3032
+ -1,
3033
+ -1,
3034
+ -1,
3035
+ {
3036
+ builtin: /^(__import__|abs|apply|basestring|bool|buffer|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|min|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|round|setattr|slice|staticmethod|sum|super|str|tuple|type|unichr|unicode|vars|xrange|zip)$/
3037
+ },
3038
+ {
3039
+ reserved: /^(and|del|for|is|raise|assert|elif|from|lambda|return|break|else|global|not|try|class|except|if|or|while|continue|exec|import|pass|yield|def|finally|in|print|False|True|None|NotImplemented|Ellipsis|Exception|SystemExit|StopIteration|StandardError|KeyboardInterrupt|ImportError|EnvironmentError|IOError|OSError|WindowsError|EOFError|RuntimeError|NotImplementedError|NameError|UnboundLocalError|AttributeError|SyntaxError|IndentationError|TabError|TypeError|AssertionError|LookupError|IndexError|KeyError|ArithmeticError|OverflowError|ZeroDivisionError|FloatingPointError|ValueError|UnicodeError|UnicodeEncodeError|UnicodeDecodeError|UnicodeTranslateError|ReferenceError|SystemError|MemoryError|Warning|UserWarning|DeprecationWarning|PendingDeprecationWarning|SyntaxWarning|OverflowWarning|RuntimeWarning|FutureWarning)$/
3040
+ },
3041
+ {},
3042
+ {},
3043
+ {},
3044
+ {},
3045
+ {},
3046
+ {},
3047
+ {}
3048
+ ],
3049
+ 6: [],
3050
+ 7: [],
3051
+ 8: [],
3052
+ 9: [],
3053
+ 10: [],
3054
+ 11: [],
3055
+ 12: [],
3056
+ 13: [],
3057
+ 14: []
3058
+ },
3059
+ kwmap: {
3060
+ builtin: "builtin",
3061
+ reserved: "reserved"
3062
+ },
3063
+ parts: {
3064
+ 0: [null],
3065
+ 1: [null],
3066
+ 2: [null],
3067
+ 3: [null],
3068
+ 4: [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null],
3069
+ 5: [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]
3070
+ },
3071
+ subst: {
3072
+ [-1]: [
3073
+ false,
3074
+ false,
3075
+ false,
3076
+ false,
3077
+ false,
3078
+ false,
3079
+ false,
3080
+ false,
3081
+ false,
3082
+ false,
3083
+ false,
3084
+ false,
3085
+ false,
3086
+ false,
3087
+ false
3088
+ ],
3089
+ 0: [false],
3090
+ 1: [false],
3091
+ 2: [false],
3092
+ 3: [false],
3093
+ 4: [
3094
+ false,
3095
+ false,
3096
+ false,
3097
+ false,
3098
+ false,
3099
+ false,
3100
+ false,
3101
+ false,
3102
+ false,
3103
+ false,
3104
+ false,
3105
+ false,
3106
+ false,
3107
+ false,
3108
+ false
3109
+ ],
3110
+ 5: [
3111
+ false,
3112
+ false,
3113
+ false,
3114
+ false,
3115
+ false,
3116
+ false,
3117
+ false,
3118
+ false,
3119
+ false,
3120
+ false,
3121
+ false,
3122
+ false,
3123
+ false,
3124
+ false,
3125
+ false
3126
+ ]
3127
+ }
3128
+ };
3129
+
3130
+ // packages/render/src/libs/highlighter/languages/ruby.ts
3131
+ var rubyLang = {
3132
+ language: "ruby",
3133
+ defClass: "code",
3134
+ regs: {
3135
+ [-1]: /(^__END__$)|(")|(%[Qx]([!"#$%&'+\-*./:;=?@^`|~{<[(]))|(')|(%[wq]([!"#$%&'+\-*./:;=?@^`|~{<[(]))|(\$(\W|\w+))|(@@?[_a-z][\d_a-z]*)|(\()|(\[)|([a-z_]\w*)|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))|((\d*\.\d+)|(\d+\.\d*))|(0[xX][\da-f]+l?)|(\d+l?|\b0l?\b)|(0[0-7]+l?)|(^=begin$)|(#)|(\s*\/)/gim,
3136
+ 0: null,
3137
+ 1: /(\\.)/gi,
3138
+ 2: /(\\.)/gi,
3139
+ 3: /(\\.)/gi,
3140
+ 4: /(\\.)/gi,
3141
+ 5: /(^__END__$)|(")|(%[Qx]([!"#$%&'+\-*./:;=?@^`|~{<[(]))|(')|(%[wq]([!"#$%&'+\-*./:;=?@^`|~{<[(]))|(\$(\W|\w+))|(@@?[_a-z][\d_a-z]*)|(\()|(\[)|([a-z_]\w*)|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))|((\d*\.\d+)|(\d+\.\d*))|(0[xX][\da-f]+l?)|(\d+l?|\b0l?\b)|(0[0-7]+l?)|(^=begin$)|(#)|(\s*\/)/gim,
3142
+ 6: /(^__END__$)|(")|(%[Qx]([!"#$%&'+\-*./:;=?@^`|~{<[(]))|(')|(%[wq]([!"#$%&'+\-*./:;=?@^`|~{<[(]))|(\$(\W|\w+))|(@@?[_a-z][\d_a-z]*)|(\()|(\[)|([a-z_]\w*)|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))|((\d*\.\d+)|(\d+\.\d*))|(0[xX][\da-f]+l?)|(\d+l?|\b0l?\b)|(0[0-7]+l?)|(^=begin$)|(#)|(\s*\/)/gim,
3143
+ 7: /(\$\w+\s*:.+\$)/gi,
3144
+ 8: /(\$\w+\s*:.+\$)/gi,
3145
+ 9: /(\\.)/gi
3146
+ },
3147
+ counts: {
3148
+ [-1]: [0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 5, 2, 0, 0, 0, 0, 0, 0],
3149
+ 0: [],
3150
+ 1: [0],
3151
+ 2: [0],
3152
+ 3: [0],
3153
+ 4: [0],
3154
+ 5: [0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 5, 2, 0, 0, 0, 0, 0, 0],
3155
+ 6: [0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 5, 2, 0, 0, 0, 0, 0, 0],
3156
+ 7: [0],
3157
+ 8: [0],
3158
+ 9: [0]
3159
+ },
3160
+ delim: {
3161
+ [-1]: [
3162
+ "reserved",
3163
+ "quotes",
3164
+ "quotes",
3165
+ "quotes",
3166
+ "quotes",
3167
+ "",
3168
+ "",
3169
+ "brackets",
3170
+ "brackets",
3171
+ "",
3172
+ "",
3173
+ "",
3174
+ "",
3175
+ "",
3176
+ "",
3177
+ "comment",
3178
+ "comment",
3179
+ "quotes"
3180
+ ],
3181
+ 0: [],
3182
+ 1: [""],
3183
+ 2: [""],
3184
+ 3: [""],
3185
+ 4: [""],
3186
+ 5: [
3187
+ "reserved",
3188
+ "quotes",
3189
+ "quotes",
3190
+ "quotes",
3191
+ "quotes",
3192
+ "",
3193
+ "",
3194
+ "brackets",
3195
+ "brackets",
3196
+ "",
3197
+ "",
3198
+ "",
3199
+ "",
3200
+ "",
3201
+ "",
3202
+ "comment",
3203
+ "comment",
3204
+ "quotes"
3205
+ ],
3206
+ 6: [
3207
+ "reserved",
3208
+ "quotes",
3209
+ "quotes",
3210
+ "quotes",
3211
+ "quotes",
3212
+ "",
3213
+ "",
3214
+ "brackets",
3215
+ "brackets",
3216
+ "",
3217
+ "",
3218
+ "",
3219
+ "",
3220
+ "",
3221
+ "",
3222
+ "comment",
3223
+ "comment",
3224
+ "quotes"
3225
+ ],
3226
+ 7: [""],
3227
+ 8: [""],
3228
+ 9: [""]
3229
+ },
3230
+ inner: {
3231
+ [-1]: [
3232
+ "comment",
3233
+ "string",
3234
+ "string",
3235
+ "string",
3236
+ "string",
3237
+ "var",
3238
+ "var",
3239
+ "code",
3240
+ "code",
3241
+ "identifier",
3242
+ "number",
3243
+ "number",
3244
+ "number",
3245
+ "number",
3246
+ "number",
3247
+ "comment",
3248
+ "comment",
3249
+ "string"
3250
+ ],
3251
+ 0: [],
3252
+ 1: ["special"],
3253
+ 2: ["special"],
3254
+ 3: ["special"],
3255
+ 4: ["special"],
3256
+ 5: [
3257
+ "comment",
3258
+ "string",
3259
+ "string",
3260
+ "string",
3261
+ "string",
3262
+ "var",
3263
+ "var",
3264
+ "code",
3265
+ "code",
3266
+ "identifier",
3267
+ "number",
3268
+ "number",
3269
+ "number",
3270
+ "number",
3271
+ "number",
3272
+ "comment",
3273
+ "comment",
3274
+ "string"
3275
+ ],
3276
+ 6: [
3277
+ "comment",
3278
+ "string",
3279
+ "string",
3280
+ "string",
3281
+ "string",
3282
+ "var",
3283
+ "var",
3284
+ "code",
3285
+ "code",
3286
+ "identifier",
3287
+ "number",
3288
+ "number",
3289
+ "number",
3290
+ "number",
3291
+ "number",
3292
+ "comment",
3293
+ "comment",
3294
+ "string"
3295
+ ],
3296
+ 7: ["inlinedoc"],
3297
+ 8: ["inlinedoc"],
3298
+ 9: ["special"]
3299
+ },
3300
+ end: {
3301
+ 0: /$/gim,
3302
+ 1: /"/gi,
3303
+ 2: /%b1%/gi,
3304
+ 3: /'/gi,
3305
+ 4: /%b1%/gi,
3306
+ 5: /\)/gi,
3307
+ 6: /\]/gi,
3308
+ 7: /^=end$/gim,
3309
+ 8: /$/gim,
3310
+ 9: /\/[iomx]*/gi
3311
+ },
3312
+ states: {
3313
+ [-1]: [0, 1, 2, 3, 4, -1, -1, 5, 6, -1, -1, -1, -1, -1, -1, 7, 8, 9],
3314
+ 0: [],
3315
+ 1: [-1],
3316
+ 2: [-1],
3317
+ 3: [-1],
3318
+ 4: [-1],
3319
+ 5: [0, 1, 2, 3, 4, -1, -1, 5, 6, -1, -1, -1, -1, -1, -1, 7, 8, 9],
3320
+ 6: [0, 1, 2, 3, 4, -1, -1, 5, 6, -1, -1, -1, -1, -1, -1, 7, 8, 9],
3321
+ 7: [-1],
3322
+ 8: [-1],
3323
+ 9: [-1]
3324
+ },
3325
+ keywords: {
3326
+ [-1]: [
3327
+ -1,
3328
+ -1,
3329
+ -1,
3330
+ -1,
3331
+ -1,
3332
+ {},
3333
+ {},
3334
+ -1,
3335
+ -1,
3336
+ {
3337
+ reserved: /^(__FILE__|require|and|def|end|in|or|self|unless|__LINE__|begin|defined?|ensure|module|redo|super|until|BEGIN|break|do|false|next|rescue|then|when|END|case|else|for|nil|retry|true|while|alias|module_function|private|public|protected|attr_reader|attr_writer|attr_accessor|class|elsif|if|not|return|undef|yield)$/
3338
+ },
3339
+ {},
3340
+ {},
3341
+ {},
3342
+ {},
3343
+ {},
3344
+ -1,
3345
+ -1,
3346
+ -1
3347
+ ],
3348
+ 0: [],
3349
+ 1: [{}],
3350
+ 2: [{}],
3351
+ 3: [{}],
3352
+ 4: [{}],
3353
+ 5: [],
3354
+ 6: [],
3355
+ 7: [{}],
3356
+ 8: [{}],
3357
+ 9: [{}],
3358
+ 10: [],
3359
+ 11: [],
3360
+ 12: [],
3361
+ 13: [],
3362
+ 14: []
3363
+ },
3364
+ kwmap: {
3365
+ reserved: "reserved"
3366
+ },
3367
+ parts: {
3368
+ 0: [],
3369
+ 1: [null],
3370
+ 2: [null],
3371
+ 3: [null],
3372
+ 4: [null],
3373
+ 5: [
3374
+ null,
3375
+ null,
3376
+ null,
3377
+ null,
3378
+ null,
3379
+ null,
3380
+ null,
3381
+ null,
3382
+ null,
3383
+ null,
3384
+ null,
3385
+ null,
3386
+ null,
3387
+ null,
3388
+ null,
3389
+ null,
3390
+ null,
3391
+ null
3392
+ ],
3393
+ 6: [
3394
+ null,
3395
+ null,
3396
+ null,
3397
+ null,
3398
+ null,
3399
+ null,
3400
+ null,
3401
+ null,
3402
+ null,
3403
+ null,
3404
+ null,
3405
+ null,
3406
+ null,
3407
+ null,
3408
+ null,
3409
+ null,
3410
+ null,
3411
+ null
3412
+ ],
3413
+ 7: [null],
3414
+ 8: [null],
3415
+ 9: [null]
3416
+ },
3417
+ subst: {
3418
+ [-1]: [
3419
+ false,
3420
+ false,
3421
+ true,
3422
+ false,
3423
+ true,
3424
+ false,
3425
+ false,
3426
+ false,
3427
+ false,
3428
+ false,
3429
+ false,
3430
+ false,
3431
+ false,
3432
+ false,
3433
+ false,
3434
+ false,
3435
+ false,
3436
+ false
3437
+ ],
3438
+ 0: [],
3439
+ 1: [false],
3440
+ 2: [false],
3441
+ 3: [false],
3442
+ 4: [false],
3443
+ 5: [
3444
+ false,
3445
+ false,
3446
+ true,
3447
+ false,
3448
+ true,
3449
+ false,
3450
+ false,
3451
+ false,
3452
+ false,
3453
+ false,
3454
+ false,
3455
+ false,
3456
+ false,
3457
+ false,
3458
+ false,
3459
+ false,
3460
+ false,
3461
+ false
3462
+ ],
3463
+ 6: [
3464
+ false,
3465
+ false,
3466
+ true,
3467
+ false,
3468
+ true,
3469
+ false,
3470
+ false,
3471
+ false,
3472
+ false,
3473
+ false,
3474
+ false,
3475
+ false,
3476
+ false,
3477
+ false,
3478
+ false,
3479
+ false,
3480
+ false,
3481
+ false
3482
+ ],
3483
+ 7: [false],
3484
+ 8: [false],
3485
+ 9: [false]
3486
+ }
3487
+ };
3488
+
3489
+ // packages/render/src/libs/highlighter/languages/sql.ts
3490
+ var sqlLang = {
3491
+ language: "sql",
3492
+ defClass: "code",
3493
+ regs: {
3494
+ [-1]: /(`)|(\/\*)|((#|--\s).*)|([a-z_]\w*)|(")|(\()|(')|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))|((\d*\.\d+)|(\d+\.\d*))|(\d+l?|\b0l?\b)|(0[xX][\da-f]+l?)/gi,
3495
+ 0: null,
3496
+ 1: null,
3497
+ 2: /(\\.)/gi,
3498
+ 3: /(`)|(\/\*)|((#|--\s).*)|([a-z_]\w*)|(")|(\()|(')|(((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+))|((\d*\.\d+)|(\d+\.\d*))|(\d+l?|\b0l?\b)|(0[xX][\da-f]+l?)/gi,
3499
+ 4: /(\\.)/gi
3500
+ },
3501
+ counts: {
3502
+ [-1]: [0, 0, 1, 0, 0, 0, 0, 5, 2, 0, 0],
3503
+ 0: [],
3504
+ 1: [],
3505
+ 2: [0],
3506
+ 3: [0, 0, 1, 0, 0, 0, 0, 5, 2, 0, 0],
3507
+ 4: [0]
3508
+ },
3509
+ delim: {
3510
+ [-1]: ["quotes", "comment", "", "", "quotes", "brackets", "quotes", "", "", "", ""],
3511
+ 0: [],
3512
+ 1: [],
3513
+ 2: [""],
3514
+ 3: ["quotes", "comment", "", "", "quotes", "brackets", "quotes", "", "", "", ""],
3515
+ 4: [""]
3516
+ },
3517
+ inner: {
3518
+ [-1]: [
3519
+ "identifier",
3520
+ "comment",
3521
+ "comment",
3522
+ "identifier",
3523
+ "string",
3524
+ "code",
3525
+ "string",
3526
+ "number",
3527
+ "number",
3528
+ "number",
3529
+ "number"
3530
+ ],
3531
+ 0: [],
3532
+ 1: [],
3533
+ 2: ["special"],
3534
+ 3: [
3535
+ "identifier",
3536
+ "comment",
3537
+ "comment",
3538
+ "identifier",
3539
+ "string",
3540
+ "code",
3541
+ "string",
3542
+ "number",
3543
+ "number",
3544
+ "number",
3545
+ "number"
3546
+ ],
3547
+ 4: ["special"]
3548
+ },
3549
+ end: {
3550
+ 0: /`/gi,
3551
+ 1: /\*\//gi,
3552
+ 2: /"/gi,
3553
+ 3: /\)/gi,
3554
+ 4: /'/gi
3555
+ },
3556
+ states: {
3557
+ [-1]: [0, 1, -1, -1, 2, 3, 4, -1, -1, -1, -1],
3558
+ 0: [],
3559
+ 1: [],
3560
+ 2: [-1],
3561
+ 3: [0, 1, -1, -1, 2, 3, 4, -1, -1, -1, -1],
3562
+ 4: [-1]
3563
+ },
3564
+ keywords: {
3565
+ [-1]: [
3566
+ -1,
3567
+ -1,
3568
+ {},
3569
+ {
3570
+ reserved: /^(absolute|action|add|admin|after|aggregate|alias|all|allocate|alter|and|any|are|array|as|asc|assertion|at|authorization|before|begin|binary|bit|blob|boolean|both|breadth|by|call|cascade|cascaded|case|cast|catalog|char|character|check|class|clob|close|collate|collation|column|commit|completion|connect|connection|constraint|constraints|constructor|continue|corresponding|create|cross|cube|current|current_date|current_path|current_role|current_time|current_timestamp|current_user|cursor|cycle|data|date|day|deallocate|dec|decimal|declare|default|deferrable|deferred|delete|depth|deref|desc|describe|descriptor|destroy|destructor|deterministic|diagnostics|dictionary|disconnect|distinct|domain|double|drop|dynamic|each|else|end|end-exec|equals|escape|every|except|exception|exec|execute|external|false|fetch|first|float|for|foreign|found|free|from|full|function|general|get|global|go|goto|grant|group|grouping|having|host|hour|identity|ignore|immediate|in|indicator|initialize|initially|inner|inout|input|insert|int|integer|intersect|interval|into|is|isolation|iterate|join|key|language|large|last|lateral|leading|left|less|level|like|limit|local|localtime|localtimestamp|locator|map|match|minute|modifies|modify|module|month|names|national|natural|nchar|nclob|new|next|no|none|not|null|numeric|object|of|off|old|on|only|open|operation|option|or|order|ordinality|out|outer|output|pad|parameter|parameters|partial|path|postfix|precision|prefix|preorder|prepare|preserve|primary|prior|privileges|procedure|public|read|reads|real|recursive|ref|references|referencing|relative|restrict|result|return|returns|revoke|right|role|rollback|rollup|routine|row|rows|savepoint|schema|scope|scroll|search|second|section|select|sequence|session|session_user|set|sets|size|smallint|some|space|specific|specifictype|sql|sqlexception|sqlstate|sqlwarning|start|state|statement|static|structure|system_user|table|temporary|terminate|than|then|time|timestamp|timezone_hour|timezone_minute|to|trailing|transaction|translation|treat|trigger|true|under|union|unique|unknown|unnest|update|usage|user|using|value|values|varchar|variable|varying|view|when|whenever|where|with|without|work|write|year|zone)$/i,
3571
+ keyword: /^(abs|ada|asensitive|assignment|asymmetric|atomic|avg|between|bitvar|bit_length|c|called|cardinality|catalog_name|chain|character_length|character_set_catalog|character_set_name|character_set_schema|char_length|checked|class_origin|coalesce|cobol|collation_catalog|collation_name|collation_schema|column_name|command_function|command_function_code|committed|condition_number|connection_name|constraint_catalog|constraint_name|constraint_schema|contains|convert|count|cursor_name|datetime_interval_code|datetime_interval_precision|defined|definer|dispatch|dynamic_function|dynamic_function_code|existing|exists|extract|final|fortran|g|generated|granted|hierarchy|hold|implementation|infix|insensitive|instance|instantiable|invoker|k|key_member|key_type|length|lower|m|max|message_length|message_octet_length|message_text|method|min|mod|more|mumps|name|nullable|nullif|number|octet_length|options|overlaps|overlay|overriding|parameter_mode|parameter_name|parameter_ordinal_position|parameter_specific_catalog|parameter_specific_name|parameter_specific_schema|pascal|pli|position|repeatable|returned_length|returned_octet_length|returned_sqlstate|routine_catalog|routine_name|routine_schema|row_count|scale|schema_name|security|self|sensitive|serializable|server_name|similar|simple|source|specific_name|style|subclass_origin|sublist|substring|sum|symmetric|system|table_name|transactions_committed|transactions_rolled_back|transaction_active|transform|transforms|translate|trigger_catalog|trigger_name|trigger_schema|trim|type|uncommitted|unnamed|upper|user_defined_type_catalog|user_defined_type_name|user_defined_type_schema)$/i
3572
+ },
3573
+ -1,
3574
+ -1,
3575
+ -1,
3576
+ {},
3577
+ {},
3578
+ {},
3579
+ {}
3580
+ ],
3581
+ 0: [],
3582
+ 1: [],
3583
+ 2: [],
3584
+ 3: [],
3585
+ 4: [{}],
3586
+ 7: [],
3587
+ 8: [],
3588
+ 9: [],
3589
+ 10: []
3590
+ },
3591
+ kwmap: {
3592
+ reserved: "reserved",
3593
+ keyword: "var"
3594
+ },
3595
+ parts: {
3596
+ 0: [],
3597
+ 1: [],
3598
+ 2: [null],
3599
+ 3: [null, null, null, null, null, null, null, null, null, null, null],
3600
+ 4: [null]
3601
+ },
3602
+ subst: {
3603
+ [-1]: [false, false, false, false, false, false, false, false, false, false, false],
3604
+ 0: [],
3605
+ 1: [],
3606
+ 2: [false],
3607
+ 3: [false, false, false, false, false, false, false, false, false, false, false],
3608
+ 4: [false]
3609
+ }
3610
+ };
3611
+
3612
+ // packages/render/src/libs/highlighter/languages/xml.ts
3613
+ var xmlLang = {
3614
+ language: "xml",
3615
+ defClass: "code",
3616
+ regs: {
3617
+ [-1]: /(<!\[CDATA\[)|(<!--)|(<[?/]?)|((&|%)[\w\-.]+;)/gi,
3618
+ 0: null,
3619
+ 1: null,
3620
+ 2: /((?<=[</?])[\w\-:]+)|([\w\-:]+)|(")/gi,
3621
+ 3: /((&|%)[\w\-.]+;)/gi
3622
+ },
3623
+ counts: {
3624
+ [-1]: [0, 0, 0, 1],
3625
+ 0: [],
3626
+ 1: [],
3627
+ 2: [0, 0, 0],
3628
+ 3: [1]
3629
+ },
3630
+ delim: {
3631
+ [-1]: ["comment", "comment", "brackets", ""],
3632
+ 0: [],
3633
+ 1: [],
3634
+ 2: ["", "", "quotes"],
3635
+ 3: [""]
3636
+ },
3637
+ inner: {
3638
+ [-1]: ["comment", "comment", "code", "special"],
3639
+ 0: [],
3640
+ 1: [],
3641
+ 2: ["reserved", "var", "string"],
3642
+ 3: ["special"]
3643
+ },
3644
+ end: {
3645
+ 0: /\]\]>/gi,
3646
+ 1: /-->/gi,
3647
+ 2: /[/?]?>/gi,
3648
+ 3: /"/gi
3649
+ },
3650
+ states: {
3651
+ [-1]: [0, 1, 2, -1],
3652
+ 0: [],
3653
+ 1: [],
3654
+ 2: [-1, -1, 3],
3655
+ 3: [-1]
3656
+ },
3657
+ keywords: {
3658
+ [-1]: [-1, -1, -1, {}],
3659
+ 0: [],
3660
+ 1: [],
3661
+ 2: [{}, {}, -1],
3662
+ 3: [{}]
3663
+ },
3664
+ kwmap: {},
3665
+ parts: {
3666
+ 0: [],
3667
+ 1: [],
3668
+ 2: [null, null, null],
3669
+ 3: [null]
3670
+ },
3671
+ subst: {
3672
+ [-1]: [false, false, false, false],
3673
+ 0: [],
3674
+ 1: [],
3675
+ 2: [false, false, false],
3676
+ 3: [false]
3677
+ }
3678
+ };
3679
+
3680
+ // packages/render/src/libs/highlighter/index.ts
3681
+ var LANGUAGES = {
3682
+ css: cssLang,
3683
+ cpp: cppLang,
3684
+ diff: diffLang,
3685
+ dtd: dtdLang,
3686
+ html: htmlLang,
3687
+ java: javaLang,
3688
+ javascript: javascriptLang,
3689
+ php: phpLang,
3690
+ python: pythonLang,
3691
+ ruby: rubyLang,
3692
+ sql: sqlLang,
3693
+ xml: xmlLang,
3694
+ xhtml: htmlLang
3695
+ };
3696
+ function highlight(code, language) {
3697
+ const def = LANGUAGES[language.toLowerCase()];
3698
+ if (!def)
3699
+ return null;
3700
+ const tokens = tokenize(def, code);
3701
+ return renderTokens(tokens);
3702
+ }
3703
+
3704
+ // packages/render/src/elements/code.ts
3705
+ function renderCode(ctx, data) {
3706
+ ctx.push(`<div class="code">`);
3707
+ if (data.contents === "") {
3708
+ ctx.push("</div>");
3709
+ return;
3710
+ }
3711
+ if (data.language) {
3712
+ const highlighted = highlight(data.contents, data.language);
3713
+ if (highlighted) {
3714
+ ctx.push(highlighted);
3715
+ } else {
3716
+ ctx.push(`<pre><code>${escapeHtml(data.contents)}</code></pre>`);
3717
+ }
3718
+ } else {
3719
+ ctx.push(`<pre><code>${escapeHtml(data.contents)}</code></pre>`);
3720
+ }
3721
+ ctx.push("</div>");
3722
+ }
3723
+
3724
+ // packages/render/src/hash.ts
3725
+ function syncHashSha1(input) {
3726
+ return fnv1aHash(input, 40);
3727
+ }
3728
+ function syncHashMd5(input) {
3729
+ return fnv1aHash(input, 32);
3730
+ }
3731
+ function fnv1aHash(input, hexLen) {
3732
+ let result = "";
3733
+ const rounds = Math.ceil(hexLen / 8);
3734
+ for (let round = 0;round < rounds; round++) {
3735
+ let h = 2166136261 ^ round;
3736
+ for (let i = 0;i < input.length; i++) {
3737
+ h ^= input.charCodeAt(i);
3738
+ h = Math.imul(h, 16777619);
3739
+ }
3740
+ result += (h >>> 0).toString(16).padStart(8, "0");
3741
+ }
3742
+ return result.substring(0, hexLen);
3743
+ }
3744
+
3745
+ // packages/render/src/elements/tab-view.ts
3746
+ function renderTabView(ctx, tabs) {
3747
+ const labelString = tabs.map((t) => t.label).join("");
3748
+ const hash = md5Hash(labelString);
3749
+ const widgetId = `wiki-tabview-${hash}`;
3750
+ ctx.push(`<div id="${widgetId}" class="yui-navset">`);
3751
+ ctx.push(`<ul class="yui-nav">`);
3752
+ for (let i = 0;i < tabs.length; i++) {
3753
+ const tab = tabs[i];
3754
+ const selectedClass = i === 0 ? ` class="selected"` : "";
3755
+ ctx.push(`<li${selectedClass}>`);
3756
+ ctx.push(`<a href="javascript:;"><em>${escapeHtml(tab.label)}</em></a>`);
3757
+ ctx.push("</li>");
3758
+ }
3759
+ ctx.push("</ul>");
3760
+ ctx.push(`<div class="yui-content">`);
3761
+ for (let i = 0;i < tabs.length; i++) {
3762
+ const tab = tabs[i];
3763
+ const displayStyle = i === 0 ? "" : ` style="display: none"`;
3764
+ ctx.push(`<div id="wiki-tab-0-${i}"${displayStyle}>`);
3765
+ renderElements(ctx, tab.elements);
3766
+ ctx.push("</div>");
3767
+ }
3768
+ ctx.push("</div>");
3769
+ ctx.push("</div>");
3770
+ }
3771
+ function md5Hash(input) {
3772
+ return syncHashMd5(input);
3773
+ }
3774
+
3775
+ // packages/render/src/elements/footnote.ts
3776
+ function renderFootnoteRef(ctx, index) {
3777
+ ctx.push(`<sup class="footnoteref">`);
3778
+ ctx.push(`<a id="footnoteref-${index}" href="javascript:;" class="footnoteref">${index}</a>`);
3779
+ ctx.push("</sup>");
3780
+ }
3781
+ function renderFootnoteBlock(ctx, data) {
3782
+ if (data.hide)
3783
+ return;
3784
+ if (ctx.footnotes.length === 0)
3785
+ return;
3786
+ const title = data.title ?? "Footnotes";
3787
+ ctx.push(`<div class="footnotes-footer">`);
3788
+ ctx.push(`<div class="title">${escapeHtml(title)}</div>`);
3789
+ for (let i = 0;i < ctx.footnotes.length; i++) {
3790
+ const index = i + 1;
3791
+ const elements = ctx.footnotes[i] ?? [];
3792
+ ctx.push(`<div class="footnote-footer" id="footnote-${index}">`);
3793
+ ctx.push(`<a href="javascript:;">${index}</a>. `);
3794
+ renderElements(ctx, elements);
3795
+ ctx.push("</div>");
3796
+ }
3797
+ ctx.push("</div>");
3798
+ }
3799
+
3800
+ // packages/render/src/elements/math.ts
3801
+ function renderMath(ctx, data) {
3802
+ const index = ctx.nextEquationIndex() + 1;
3803
+ if (data.name) {
3804
+ ctx.push(`<span class="equation-number">(${index})</span>`);
3805
+ }
3806
+ const id = data.name ? `equation-${data.name}` : `equation-${index}`;
3807
+ ctx.push(`<div class="math-equation" id="${escapeAttr(id)}">`);
3808
+ ctx.push(escapeHtml(data["latex-source"]));
3809
+ ctx.push("</div>");
3810
+ }
3811
+ function renderMathInline(ctx, data) {
3812
+ ctx.push(`<span class="math-inline">$`);
3813
+ ctx.push(escapeHtml(data["latex-source"]));
3814
+ ctx.push("$</span>");
3815
+ }
3816
+ function renderEquationRef(ctx, name) {
3817
+ const id = `equation-${name}`;
3818
+ ctx.push(`<a class="equation-ref" href="#${escapeAttr(id)}">`);
3819
+ ctx.push(escapeHtml(name));
3820
+ ctx.push("</a>");
3821
+ }
3822
+
3823
+ // packages/render/src/elements/module/backlinks.ts
3824
+ function renderBacklinks(ctx, _data) {
3825
+ ctx.push(`<div class="backlinks-module-box">
3826
+ </div>`);
3827
+ }
3828
+
3829
+ // packages/render/src/elements/module/categories.ts
3830
+ function renderCategories(ctx, _data) {
3831
+ ctx.push(`<div class="categories-module-box">`);
3832
+ ctx.push("</div>");
3833
+ }
3834
+
3835
+ // packages/render/src/elements/module/join.ts
3836
+ function renderJoin(ctx, data) {
3837
+ const buttonText = data["button-text"] ?? "Join";
3838
+ const attrs = data.attributes ?? {};
3839
+ const className = attrs.class ?? "join-box";
3840
+ ctx.push(`<div class="${escapeHtml(className)}">`);
3841
+ ctx.push(`<a href="javascript:;">${escapeHtml(buttonText)}</a>`);
3842
+ ctx.push("</div>");
3843
+ }
3844
+
3845
+ // packages/render/src/elements/module/page-tree.ts
3846
+ function renderPageTree(ctx, _data) {
3847
+ ctx.push(`<div class="page-tree-module-box">`);
3848
+ ctx.push("</div>");
3849
+ }
3850
+
3851
+ // packages/render/src/elements/module/rate.ts
3852
+ function renderRate(ctx) {
3853
+ ctx.push(`<div class="page-rate-widget-box">`);
3854
+ ctx.push(`<span class="rate-points">rating:&nbsp;<span class="number prw54353">0</span></span>`);
3855
+ ctx.push(`<span class="rateup btn btn-default"><a title="I like it" href="javascript:;">+</a></span>`);
3856
+ ctx.push(`<span class="ratedown btn btn-default"><a title="I don't like it" href="javascript:;">&#8211;</a></span>`);
3857
+ ctx.push(`<span class="cancel btn btn-default"><a title="Cancel my vote" href="javascript:;">x</a></span>`);
3858
+ ctx.push("</div>");
3859
+ }
3860
+
3861
+ // packages/render/src/elements/module/listusers.ts
3862
+ function renderListUsers(ctx, _data) {
3863
+ ctx.push(`<div class="list-users-module-box">`);
3864
+ ctx.push("</div>");
3865
+ }
3866
+
3867
+ // packages/render/src/elements/module/listpages.ts
3868
+ function renderListPages(ctx, _data) {
3869
+ ctx.push(`<div class="list-pages-box">`);
3870
+ ctx.push("</div>");
3871
+ }
3872
+
3873
+ // packages/render/src/elements/module/index.ts
3874
+ function renderModule(ctx, data) {
3875
+ switch (data.module) {
3876
+ case "unknown":
3877
+ ctx.push(`<div class="error-block">[[module <em>${data.name}</em>]] No such module, please <a href="http://www.wikidot.com/doc:modules" target="_blank">check available modules</a> and fix this page.</div>`);
3878
+ break;
3879
+ case "backlinks":
3880
+ renderBacklinks(ctx, data);
3881
+ break;
3882
+ case "categories":
3883
+ renderCategories(ctx, data);
3884
+ break;
3885
+ case "join":
3886
+ renderJoin(ctx, data);
3887
+ break;
3888
+ case "page-tree":
3889
+ renderPageTree(ctx, data);
3890
+ break;
3891
+ case "rate":
3892
+ renderRate(ctx);
3893
+ break;
3894
+ case "list-users":
3895
+ renderListUsers(ctx, data);
3896
+ break;
3897
+ case "list-pages":
3898
+ renderListPages(ctx, data);
3899
+ break;
3900
+ }
3901
+ }
3902
+
3903
+ // packages/render/src/elements/embed.ts
3904
+ function isValidVideoId(id) {
3905
+ return /^[a-zA-Z0-9_-]+$/.test(id);
3906
+ }
3907
+ function isValidGithubUsername(username) {
3908
+ return /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,37}[a-zA-Z0-9])?$/.test(username);
3909
+ }
3910
+ function isValidGistHash(hash) {
3911
+ return /^[a-f0-9]+$/.test(hash);
3912
+ }
3913
+ function isValidGitlabSnippetId(id) {
3914
+ return /^[0-9]+$/.test(id);
3915
+ }
3916
+ function renderEmbed(ctx, data) {
3917
+ switch (data.embed) {
3918
+ case "youtube":
3919
+ renderYoutube(ctx, data.data["video-id"]);
3920
+ break;
3921
+ case "vimeo":
3922
+ renderVimeo(ctx, data.data["video-id"]);
3923
+ break;
3924
+ case "github-gist":
3925
+ renderGithubGist(ctx, data.data.username, data.data.hash);
3926
+ break;
3927
+ case "gitlab-snippet":
3928
+ renderGitlabSnippet(ctx, data.data["snippet-id"]);
3929
+ break;
3930
+ }
3931
+ }
3932
+ function renderYoutube(ctx, videoId) {
3933
+ if (!isValidVideoId(videoId)) {
3934
+ ctx.push(`<!-- Invalid YouTube video ID -->`);
3935
+ return;
3936
+ }
3937
+ ctx.push(`<div class="embed-youtube">`);
3938
+ ctx.push(`<iframe src="https://www.youtube.com/embed/${escapeAttr(videoId)}" ` + `frameborder="0" allowfullscreen></iframe>`);
3939
+ ctx.push("</div>");
3940
+ }
3941
+ function renderVimeo(ctx, videoId) {
3942
+ if (!isValidVideoId(videoId)) {
3943
+ ctx.push(`<!-- Invalid Vimeo video ID -->`);
3944
+ return;
3945
+ }
3946
+ ctx.push(`<div class="embed-vimeo">`);
3947
+ ctx.push(`<iframe src="https://player.vimeo.com/video/${escapeAttr(videoId)}" ` + `frameborder="0" allowfullscreen></iframe>`);
3948
+ ctx.push("</div>");
3949
+ }
3950
+ function renderGithubGist(ctx, username, hash) {
3951
+ if (!isValidGithubUsername(username) || !isValidGistHash(hash)) {
3952
+ ctx.push(`<!-- Invalid GitHub Gist parameters -->`);
3953
+ return;
3954
+ }
3955
+ ctx.push(`<script src="https://gist.github.com/${escapeAttr(username)}/${escapeAttr(hash)}.js"></script>`);
3956
+ }
3957
+ function renderGitlabSnippet(ctx, snippetId) {
3958
+ if (!isValidGitlabSnippetId(snippetId)) {
3959
+ ctx.push(`<!-- Invalid GitLab snippet ID -->`);
3960
+ return;
3961
+ }
3962
+ ctx.push(`<script src="https://gitlab.com/snippets/${escapeAttr(snippetId)}.js"></script>`);
3963
+ }
3964
+
3965
+ // packages/render/src/elements/user.ts
3966
+ function renderUser(ctx, data) {
3967
+ const resolved = ctx.options.resolvers?.user?.(data.name) ?? null;
3968
+ if (resolved === null) {
3969
+ ctx.push(escapeHtml(data.name));
3970
+ return;
3971
+ }
3972
+ const displayName = resolved.name ?? data.name;
3973
+ const hrefAttr = resolved.url ? ` href="${escapeAttr(resolved.url)}"` : "";
3974
+ const showAvatar = data["show-avatar"] && resolved.url && resolved.avatarUrl;
3975
+ if (showAvatar) {
3976
+ ctx.push(`<span class="printuser avatarhover">`);
3977
+ ctx.push(`<a${hrefAttr}>`);
3978
+ ctx.push(`<img class="small" src="${escapeAttr(resolved.avatarUrl)}" alt="${escapeAttr(displayName)}" />`);
3979
+ ctx.push("</a>");
3980
+ ctx.push(`<a${hrefAttr}>`);
3981
+ ctx.push(escapeHtml(displayName));
3982
+ ctx.push("</a>");
3983
+ ctx.push("</span>");
3984
+ } else {
3985
+ ctx.push(`<span class="printuser">`);
3986
+ ctx.push(`<a${hrefAttr}>`);
3987
+ ctx.push(escapeHtml(displayName));
3988
+ ctx.push("</a>");
3989
+ ctx.push("</span>");
3990
+ }
3991
+ }
3992
+
3993
+ // packages/render/src/elements/bibliography.ts
3994
+ function renderBibliographyCite(ctx, data) {
3995
+ if (data.brackets) {
3996
+ ctx.push("[");
3997
+ }
3998
+ ctx.push(`<a class="bibcite" href="javascript:;">`);
3999
+ ctx.push(escapeHtml(data.label));
4000
+ ctx.push("</a>");
4001
+ if (data.brackets) {
4002
+ ctx.push("]");
4003
+ }
4004
+ }
4005
+ function renderBibliographyBlock(ctx, data) {
4006
+ if (data.hide)
4007
+ return;
4008
+ const title = data.title ?? "Bibliography";
4009
+ ctx.push(`<div class="bibitems">`);
4010
+ ctx.push(`<div class="title">${escapeHtml(title)}</div>`);
4011
+ ctx.push("</div>");
4012
+ }
4013
+
4014
+ // packages/render/src/elements/toc.ts
4015
+ function extractLinkText(element) {
4016
+ if (element.element !== "link")
4017
+ return null;
4018
+ const label = element.data.label;
4019
+ let text = "";
4020
+ if (typeof label === "object" && label !== null && "text" in label) {
4021
+ text = label.text;
4022
+ }
4023
+ const href = typeof element.data.link === "string" ? element.data.link : "";
4024
+ return { href, text };
4025
+ }
4026
+ function renderTocEntries(ctx, elements) {
4027
+ for (const element of elements) {
4028
+ if (element.element === "list") {
4029
+ renderTocList(ctx, element.data, 1);
4030
+ }
4031
+ }
4032
+ }
4033
+ function renderTocList(ctx, listData, depth) {
4034
+ for (const item of listData.items) {
4035
+ renderTocItem(ctx, item, depth);
4036
+ }
4037
+ }
4038
+ function renderTocItem(ctx, item, depth) {
4039
+ if (item["item-type"] === "elements") {
4040
+ for (const el of item.elements) {
4041
+ const link = extractLinkText(el);
4042
+ if (link) {
4043
+ ctx.push(`<div style="margin-left: ${depth}em;"><a href="${escapeHtml(link.href)}">${escapeHtml(link.text)}</a></div>`);
4044
+ }
4045
+ }
4046
+ } else if (item["item-type"] === "sub-list") {
4047
+ renderTocList(ctx, item.data, depth + 1);
4048
+ }
4049
+ }
4050
+ function renderTableOfContents(ctx, data) {
4051
+ const isFloat = data.align === "left" || data.align === "right";
4052
+ if (!isFloat) {
4053
+ ctx.push(`<table style="margin:0; padding:0"><tr><td style="margin:0; padding:0">`);
4054
+ }
4055
+ if (isFloat) {
4056
+ const floatClass = data.align === "left" ? "floatleft" : "floatright";
4057
+ ctx.push(`<div id="toc" class="${floatClass}">`);
4058
+ } else {
4059
+ ctx.push(`<div id="toc">`);
4060
+ }
4061
+ ctx.push(`<div id="toc-action-bar"><a href="javascript:;">Fold</a><a style="display: none" href="javascript:;">Unfold</a></div>`);
4062
+ ctx.push(`<div class="title">Table of Contents</div>`);
4063
+ ctx.push(`<div id="toc-list">`);
4064
+ renderTocEntries(ctx, ctx.tocElements);
4065
+ ctx.push("</div>");
4066
+ ctx.push("</div>");
4067
+ if (!isFloat) {
4068
+ ctx.push(`</td></tr></table>`);
4069
+ }
4070
+ }
4071
+
4072
+ // packages/render/src/elements/line-break.ts
4073
+ function renderLineBreaks(ctx, count) {
4074
+ for (let i = 0;i < count; i++) {
4075
+ ctx.push("<br />");
4076
+ }
4077
+ }
4078
+
4079
+ // packages/render/src/elements/clear-float.ts
4080
+ function renderClearFloat(ctx, direction) {
4081
+ ctx.push(`<div style="clear:${direction}; height: 0px; font-size: 1px"></div>`);
4082
+ }
4083
+
4084
+ // packages/render/src/elements/iframe.ts
4085
+ function renderIframe(ctx, data) {
4086
+ const url = isDangerousUrl(data.url) ? "#invalid-url" : data.url;
4087
+ const attrs = [`src="${escapeAttr(url)}"`];
4088
+ const iframeAttrs = ["align", "frameborder", "height", "scrolling", "width", "class", "style"];
4089
+ for (const attr of iframeAttrs) {
4090
+ let value = data.attributes[attr] ?? "";
4091
+ if (attr === "style") {
4092
+ value = sanitizeStyleValue(value);
4093
+ }
4094
+ attrs.push(`${attr}="${escapeAttr(value)}"`);
4095
+ }
4096
+ ctx.push(`<p><iframe ${attrs.join(" ")}></iframe></p>`);
4097
+ }
4098
+
4099
+ // packages/render/src/elements/html.ts
4100
+ function generateDefaultUrl(pageName, contents) {
4101
+ const hash = syncHashSha1(contents);
4102
+ const nonce = BigInt(contents.length) * 1000000000n + BigInt(hash.charCodeAt(0)) * 100000000n;
4103
+ const path = pageName ? `/${pageName}/html/${hash}-${nonce}` : `/html/${hash}-${nonce}`;
4104
+ return path;
4105
+ }
4106
+ function renderHtmlBlock(ctx, data) {
4107
+ const index = ctx.nextHtmlBlockIndex();
4108
+ const pageName = ctx.page?.pageName ?? "";
4109
+ const callbackUrl = ctx.options.resolvers?.htmlBlockUrl?.(index);
4110
+ const src = callbackUrl || generateDefaultUrl(pageName, data.contents);
4111
+ const sandbox = ctx.options.htmlBlockSandbox;
4112
+ const sandboxAttr = sandbox ? ` sandbox="${escapeAttr(sandbox)}"` : "";
4113
+ ctx.push(`<iframe src="${escapeAttr(src)}"${sandboxAttr} allowtransparency="true" frameborder="0" class="html-block-iframe"></iframe>`);
4114
+ }
4115
+
4116
+ // packages/render/src/elements/include.ts
4117
+ function renderInclude(ctx, data) {
4118
+ renderElements(ctx, data.elements);
4119
+ }
4120
+
4121
+ // packages/render/src/elements/iftags.ts
4122
+ function renderIfTags(ctx, data) {
4123
+ renderElements(ctx, data.elements);
4124
+ }
4125
+
4126
+ // packages/render/src/elements/color.ts
4127
+ function renderColor(ctx, data) {
4128
+ const safeColor = sanitizeCssColor(data.color, "inherit");
4129
+ ctx.push(`<span style="color: ${escapeAttr(safeColor)}">`);
4130
+ renderElements(ctx, data.elements);
4131
+ ctx.push("</span>");
4132
+ }
4133
+
4134
+ // packages/render/src/elements/date.ts
4135
+ function renderDate(ctx, data) {
4136
+ const date = new Date(data.value.timestamp * 1000);
4137
+ const formatted = data.format ? formatDate(date, data.format) : date.toLocaleString();
4138
+ if (data.hover) {
4139
+ ctx.push(`<span class="odate">${escapeHtml(formatted)}</span>`);
4140
+ } else {
4141
+ ctx.push(escapeHtml(formatted));
4142
+ }
4143
+ }
4144
+ function formatDate(date, format) {
4145
+ return format.replace(/%Y/g, String(date.getFullYear())).replace(/%m/g, String(date.getMonth() + 1).padStart(2, "0")).replace(/%d/g, String(date.getDate()).padStart(2, "0")).replace(/%H/g, String(date.getHours()).padStart(2, "0")).replace(/%M/g, String(date.getMinutes()).padStart(2, "0")).replace(/%S/g, String(date.getSeconds()).padStart(2, "0"));
4146
+ }
4147
+
4148
+ // packages/render/src/utils/expr-eval.ts
4149
+ var FALSE_VALUES = new Set(["false", "null", "", "0"]);
4150
+ function isTruthy(value) {
4151
+ return !FALSE_VALUES.has(value.toLowerCase().trim());
4152
+ }
4153
+ var MAX_EXPRESSION_LENGTH = 256;
4154
+ function isTruthyNum(n) {
4155
+ return n !== 0 && !Number.isNaN(n);
4156
+ }
4157
+ function evaluateExpression(expr) {
4158
+ try {
4159
+ if (expr.length > MAX_EXPRESSION_LENGTH) {
4160
+ return { success: false, error: "expression too long" };
4161
+ }
4162
+ if (expr.trim() === "") {
4163
+ return { success: false, error: "empty expression" };
4164
+ }
4165
+ const tokens = tokenize2(expr);
4166
+ if (tokens.length <= 1) {
4167
+ return { success: false, error: "empty expression" };
4168
+ }
4169
+ const parser = new ExprParser(tokens);
4170
+ const result = parser.parse();
4171
+ if (!Number.isFinite(result)) {
4172
+ return { success: false, error: "division by zero" };
4173
+ }
4174
+ return { success: true, value: result };
4175
+ } catch (e) {
4176
+ const msg = e instanceof Error ? e.message : "unknown error";
4177
+ return { success: false, error: msg };
4178
+ }
4179
+ }
4180
+ function tokenize2(expr) {
4181
+ const tokens = [];
4182
+ let i = 0;
4183
+ while (i < expr.length) {
4184
+ const ch = expr[i];
4185
+ if (/\s/.test(ch)) {
4186
+ i++;
4187
+ continue;
4188
+ }
4189
+ if (/\d/.test(ch) || ch === "." && /\d/.test(expr[i + 1] ?? "")) {
4190
+ let numStr = "";
4191
+ let hasDot = false;
4192
+ while (i < expr.length) {
4193
+ const c = expr[i];
4194
+ if (c === ".") {
4195
+ if (hasDot)
4196
+ break;
4197
+ hasDot = true;
4198
+ } else if (!/\d/.test(c)) {
4199
+ break;
4200
+ }
4201
+ numStr += c;
4202
+ i++;
4203
+ }
4204
+ const num = parseFloat(numStr);
4205
+ if (!Number.isFinite(num)) {
4206
+ throw new Error("Invalid number");
4207
+ }
4208
+ tokens.push({ kind: "NUMBER", value: num });
4209
+ continue;
4210
+ }
4211
+ if (/[a-zA-Z_]/.test(ch)) {
4212
+ let id = "";
4213
+ while (i < expr.length) {
4214
+ const c = expr[i];
4215
+ if (!/[a-zA-Z0-9_]/.test(c))
4216
+ break;
4217
+ id += c;
4218
+ i++;
4219
+ }
4220
+ tokens.push({ kind: "IDENTIFIER", value: id.toLowerCase() });
4221
+ continue;
4222
+ }
4223
+ if (ch === "<" && expr[i + 1] === "=") {
4224
+ tokens.push({ kind: "LE", value: "<=" });
4225
+ i += 2;
4226
+ continue;
4227
+ }
4228
+ if (ch === ">" && expr[i + 1] === "=") {
4229
+ tokens.push({ kind: "GE", value: ">=" });
4230
+ i += 2;
4231
+ continue;
4232
+ }
4233
+ if (ch === "!" && expr[i + 1] === "=") {
4234
+ tokens.push({ kind: "NE", value: "!=" });
4235
+ i += 2;
4236
+ continue;
4237
+ }
4238
+ if (ch === "<" && expr[i + 1] === ">") {
4239
+ tokens.push({ kind: "NE", value: "<>" });
4240
+ i += 2;
4241
+ continue;
4242
+ }
4243
+ switch (ch) {
4244
+ case "+":
4245
+ tokens.push({ kind: "PLUS", value: "+" });
4246
+ break;
4247
+ case "-":
4248
+ tokens.push({ kind: "MINUS", value: "-" });
4249
+ break;
4250
+ case "*":
4251
+ tokens.push({ kind: "STAR", value: "*" });
4252
+ break;
4253
+ case "/":
4254
+ tokens.push({ kind: "SLASH", value: "/" });
4255
+ break;
4256
+ case "%":
4257
+ tokens.push({ kind: "PERCENT", value: "%" });
4258
+ break;
4259
+ case "^":
4260
+ tokens.push({ kind: "CARET", value: "^" });
4261
+ break;
4262
+ case "(":
4263
+ tokens.push({ kind: "LPAREN", value: "(" });
4264
+ break;
4265
+ case ")":
4266
+ tokens.push({ kind: "RPAREN", value: ")" });
4267
+ break;
4268
+ case ",":
4269
+ tokens.push({ kind: "COMMA", value: "," });
4270
+ break;
4271
+ case "<":
4272
+ tokens.push({ kind: "LT", value: "<" });
4273
+ break;
4274
+ case ">":
4275
+ tokens.push({ kind: "GT", value: ">" });
4276
+ break;
4277
+ case "=":
4278
+ tokens.push({ kind: "EQ", value: "=" });
4279
+ break;
4280
+ default:
4281
+ throw new Error(`Unknown character: ${ch}`);
4282
+ }
4283
+ i++;
4284
+ }
4285
+ tokens.push({ kind: "EOF", value: "" });
4286
+ return tokens;
4287
+ }
4288
+
4289
+ class ExprParser {
4290
+ tokens;
4291
+ pos = 0;
4292
+ constructor(tokens) {
4293
+ this.tokens = tokens;
4294
+ }
4295
+ parse() {
4296
+ const result = this.parseOr();
4297
+ if (this.current().kind !== "EOF") {
4298
+ throw new Error("Unexpected token");
4299
+ }
4300
+ return result;
4301
+ }
4302
+ current() {
4303
+ return this.tokens[this.pos] ?? { kind: "EOF", value: "" };
4304
+ }
4305
+ advance() {
4306
+ const token = this.current();
4307
+ this.pos++;
4308
+ return token;
4309
+ }
4310
+ parseOr() {
4311
+ let left = this.parseAnd();
4312
+ while (this.current().kind === "IDENTIFIER" && this.current().value === "or") {
4313
+ this.advance();
4314
+ const right = this.parseAnd();
4315
+ left = isTruthyNum(left) || isTruthyNum(right) ? 1 : 0;
4316
+ }
4317
+ return left;
4318
+ }
4319
+ parseAnd() {
4320
+ let left = this.parseNot();
4321
+ while (this.current().kind === "IDENTIFIER" && this.current().value === "and") {
4322
+ this.advance();
4323
+ const right = this.parseNot();
4324
+ left = isTruthyNum(left) && isTruthyNum(right) ? 1 : 0;
4325
+ }
4326
+ return left;
4327
+ }
4328
+ parseNot() {
4329
+ if (this.current().kind === "IDENTIFIER" && this.current().value === "not") {
4330
+ this.advance();
4331
+ const value = this.parseNot();
4332
+ return isTruthyNum(value) ? 0 : 1;
4333
+ }
4334
+ return this.parseComparison();
4335
+ }
4336
+ parseComparison() {
4337
+ let left = this.parseAddition();
4338
+ const kind = this.current().kind;
4339
+ if (kind === "LT" || kind === "GT" || kind === "LE" || kind === "GE" || kind === "EQ" || kind === "NE") {
4340
+ this.advance();
4341
+ const right = this.parseAddition();
4342
+ switch (kind) {
4343
+ case "LT":
4344
+ return left < right ? 1 : 0;
4345
+ case "GT":
4346
+ return left > right ? 1 : 0;
4347
+ case "LE":
4348
+ return left <= right ? 1 : 0;
4349
+ case "GE":
4350
+ return left >= right ? 1 : 0;
4351
+ case "EQ":
4352
+ return left === right ? 1 : 0;
4353
+ case "NE":
4354
+ return left !== right ? 1 : 0;
4355
+ }
4356
+ }
4357
+ return left;
4358
+ }
4359
+ parseAddition() {
4360
+ let left = this.parseMultiplication();
4361
+ while (true) {
4362
+ const kind = this.current().kind;
4363
+ if (kind === "PLUS") {
4364
+ this.advance();
4365
+ left = left + this.parseMultiplication();
4366
+ } else if (kind === "MINUS") {
4367
+ this.advance();
4368
+ left = left - this.parseMultiplication();
4369
+ } else {
4370
+ break;
4371
+ }
4372
+ }
4373
+ return left;
4374
+ }
4375
+ parseMultiplication() {
4376
+ let left = this.parsePower();
4377
+ while (true) {
4378
+ const kind = this.current().kind;
4379
+ if (kind === "STAR") {
4380
+ this.advance();
4381
+ left = left * this.parsePower();
4382
+ } else if (kind === "SLASH") {
4383
+ this.advance();
4384
+ left = left / this.parsePower();
4385
+ } else if (kind === "PERCENT") {
4386
+ this.advance();
4387
+ left = left % this.parsePower();
4388
+ } else {
4389
+ break;
4390
+ }
4391
+ }
4392
+ return left;
4393
+ }
4394
+ parsePower() {
4395
+ const left = this.parseUnary();
4396
+ if (this.current().kind === "CARET") {
4397
+ this.advance();
4398
+ const right = this.parsePower();
4399
+ return Math.pow(left, right);
4400
+ }
4401
+ return left;
4402
+ }
4403
+ parseUnary() {
4404
+ const kind = this.current().kind;
4405
+ if (kind === "MINUS") {
4406
+ this.advance();
4407
+ return -this.parseUnary();
4408
+ }
4409
+ if (kind === "PLUS") {
4410
+ this.advance();
4411
+ return this.parseUnary();
4412
+ }
4413
+ return this.parsePrimary();
4414
+ }
4415
+ parsePrimary() {
4416
+ const token = this.current();
4417
+ if (token.kind === "NUMBER") {
4418
+ this.advance();
4419
+ return token.value;
4420
+ }
4421
+ if (token.kind === "LPAREN") {
4422
+ this.advance();
4423
+ const value = this.parseOr();
4424
+ if (this.current().kind !== "RPAREN") {
4425
+ throw new Error("Expected )");
4426
+ }
4427
+ this.advance();
4428
+ return value;
4429
+ }
4430
+ if (token.kind === "IDENTIFIER") {
4431
+ const name = token.value;
4432
+ this.advance();
4433
+ if (this.current().kind === "LPAREN") {
4434
+ return this.parseFunctionCall(name);
4435
+ }
4436
+ throw new Error(`undefined constant "${name}"`);
4437
+ }
4438
+ throw new Error("Expected expression");
4439
+ }
4440
+ parseFunctionCall(name) {
4441
+ if (this.current().kind !== "LPAREN") {
4442
+ throw new Error("Expected (");
4443
+ }
4444
+ this.advance();
4445
+ const args = [];
4446
+ if (this.current().kind !== "RPAREN") {
4447
+ args.push(this.parseOr());
4448
+ while (this.current().kind === "COMMA") {
4449
+ this.advance();
4450
+ args.push(this.parseOr());
4451
+ }
4452
+ }
4453
+ if (this.current().kind !== "RPAREN") {
4454
+ throw new Error("Expected )");
4455
+ }
4456
+ this.advance();
4457
+ return this.callFunction(name, args);
4458
+ }
4459
+ callFunction(name, args) {
4460
+ switch (name) {
4461
+ case "abs":
4462
+ this.checkArgs(name, args, 1);
4463
+ return Math.abs(args[0]);
4464
+ case "min":
4465
+ this.checkArgsMin(name, args, 1);
4466
+ return Math.min(...args);
4467
+ case "max":
4468
+ this.checkArgsMin(name, args, 1);
4469
+ return Math.max(...args);
4470
+ case "floor":
4471
+ this.checkArgs(name, args, 1);
4472
+ return Math.floor(args[0]);
4473
+ case "ceil":
4474
+ this.checkArgs(name, args, 1);
4475
+ return Math.ceil(args[0]);
4476
+ case "round":
4477
+ this.checkArgs(name, args, 1);
4478
+ return Math.round(args[0]);
4479
+ case "sqrt":
4480
+ this.checkArgs(name, args, 1);
4481
+ return Math.sqrt(args[0]);
4482
+ case "sin":
4483
+ this.checkArgs(name, args, 1);
4484
+ return Math.sin(args[0]);
4485
+ case "cos":
4486
+ this.checkArgs(name, args, 1);
4487
+ return Math.cos(args[0]);
4488
+ case "tan":
4489
+ this.checkArgs(name, args, 1);
4490
+ return Math.tan(args[0]);
4491
+ case "ln":
4492
+ this.checkArgs(name, args, 1);
4493
+ return Math.log(args[0]);
4494
+ case "log":
4495
+ this.checkArgs(name, args, 1);
4496
+ return Math.log10(args[0]);
4497
+ case "exp":
4498
+ this.checkArgs(name, args, 1);
4499
+ return Math.exp(args[0]);
4500
+ case "pow":
4501
+ this.checkArgs(name, args, 2);
4502
+ return Math.pow(args[0], args[1]);
4503
+ default:
4504
+ throw new Error(`undefined function "${name}"`);
4505
+ }
4506
+ }
4507
+ checkArgs(name, args, expected) {
4508
+ if (args.length !== expected) {
4509
+ throw new Error(`${name}() expects ${expected} argument(s), got ${args.length}`);
4510
+ }
4511
+ }
4512
+ checkArgsMin(name, args, min) {
4513
+ if (args.length < min) {
4514
+ throw new Error(`${name}() expects at least ${min} argument(s), got ${args.length}`);
4515
+ }
4516
+ }
4517
+ }
4518
+
4519
+ // packages/render/src/elements/expr.ts
4520
+ function renderExpr(ctx, data) {
4521
+ const result = evaluateExpression(data.expression);
4522
+ if (result.success) {
4523
+ ctx.pushEscaped(formatNumber(result.value));
4524
+ } else if (result.error !== "empty expression") {
4525
+ ctx.pushEscaped(`run-time error: ${result.error}`);
4526
+ }
4527
+ }
4528
+ function renderIf(ctx, data) {
4529
+ const elements = isTruthy(data.condition) ? data.then : data.else;
4530
+ renderBranchElements(ctx, elements);
4531
+ }
4532
+ function renderIfExpr(ctx, data) {
4533
+ const result = evaluateExpression(data.expression);
4534
+ const isTrue = result.success && result.value !== 0;
4535
+ const elements = isTrue ? data.then : data.else;
4536
+ renderBranchElements(ctx, elements);
4537
+ }
4538
+ function renderBranchElements(ctx, elements) {
4539
+ let lastIdx = elements.length - 1;
4540
+ while (lastIdx >= 0) {
4541
+ const el = elements[lastIdx];
4542
+ if (el.element === "text" && typeof el.data === "string" && el.data.trim() === "") {
4543
+ lastIdx--;
4544
+ } else {
4545
+ break;
4546
+ }
4547
+ }
4548
+ renderElements(ctx, elements.slice(0, lastIdx + 1));
4549
+ }
4550
+ function formatNumber(n) {
4551
+ if (Number.isInteger(n)) {
4552
+ return String(n);
4553
+ }
4554
+ return n.toFixed(6).replace(/\.?0+$/, "");
4555
+ }
4556
+
4557
+ // packages/render/src/render.ts
4558
+ function renderToHtml(tree, options = {}) {
4559
+ const ctx = new RenderContext(tree, options);
4560
+ renderElements(ctx, tree.elements);
4561
+ if (tree.styles?.length) {
4562
+ for (const style of tree.styles) {
4563
+ ctx.push(`<style>${escapeStyleContent(style)}</style>`);
4564
+ }
4565
+ }
4566
+ return ctx.getOutput();
4567
+ }
4568
+ function renderElements(ctx, elements) {
4569
+ for (const element of elements) {
4570
+ renderElement(ctx, element);
4571
+ }
4572
+ }
4573
+ function renderElement(ctx, element) {
4574
+ switch (element.element) {
4575
+ case "text":
4576
+ ctx.pushEscaped(element.data);
4577
+ break;
4578
+ case "raw":
4579
+ renderRaw(ctx, element.data);
4580
+ break;
4581
+ case "variable":
4582
+ renderText(ctx, element.data);
4583
+ break;
4584
+ case "email":
4585
+ renderEmail(ctx, element.data);
4586
+ break;
4587
+ case "container":
4588
+ renderContainer(ctx, element.data);
4589
+ break;
4590
+ case "link":
4591
+ renderLink(ctx, element.data);
4592
+ break;
4593
+ case "anchor":
4594
+ renderAnchor(ctx, element.data);
4595
+ break;
4596
+ case "anchor-name":
4597
+ renderAnchorName(ctx, element.data);
4598
+ break;
4599
+ case "image":
4600
+ renderImage(ctx, element.data);
4601
+ break;
4602
+ case "list":
4603
+ renderList(ctx, element.data);
4604
+ break;
4605
+ case "definition-list":
4606
+ renderDefinitionList(ctx, element.data);
4607
+ break;
4608
+ case "table":
4609
+ renderTable(ctx, element.data);
4610
+ break;
4611
+ case "collapsible":
4612
+ renderCollapsible(ctx, element.data);
4613
+ break;
4614
+ case "code":
4615
+ renderCode(ctx, element.data);
4616
+ break;
4617
+ case "tab-view":
4618
+ renderTabView(ctx, element.data);
4619
+ break;
4620
+ case "footnote":
4621
+ renderFootnoteRef(ctx, ctx.nextFootnoteIndex() + 1);
4622
+ break;
4623
+ case "footnote-ref":
4624
+ renderFootnoteRef(ctx, element.data);
4625
+ break;
4626
+ case "footnote-block":
4627
+ renderFootnoteBlock(ctx, element.data);
4628
+ break;
4629
+ case "bibliography-cite":
4630
+ renderBibliographyCite(ctx, element.data);
4631
+ break;
4632
+ case "bibliography-block":
4633
+ renderBibliographyBlock(ctx, element.data);
4634
+ break;
4635
+ case "table-of-contents":
4636
+ renderTableOfContents(ctx, element.data);
4637
+ break;
4638
+ case "math":
4639
+ renderMath(ctx, element.data);
4640
+ break;
4641
+ case "math-inline":
4642
+ renderMathInline(ctx, element.data);
4643
+ break;
4644
+ case "module":
4645
+ renderModule(ctx, element.data);
4646
+ break;
4647
+ case "embed":
4648
+ renderEmbed(ctx, element.data);
4649
+ break;
4650
+ case "user":
4651
+ renderUser(ctx, element.data);
4652
+ break;
4653
+ case "date":
4654
+ renderDate(ctx, element.data);
4655
+ break;
4656
+ case "color":
4657
+ renderColor(ctx, element.data);
4658
+ break;
4659
+ case "html":
4660
+ renderHtmlBlock(ctx, element.data);
4661
+ break;
4662
+ case "iframe":
4663
+ renderIframe(ctx, element.data);
4664
+ break;
4665
+ case "include":
4666
+ renderInclude(ctx, element.data);
4667
+ break;
4668
+ case "if-tags":
4669
+ renderIfTags(ctx, element.data);
4670
+ break;
4671
+ case "style":
4672
+ break;
4673
+ case "line-break":
4674
+ ctx.push("<br />");
4675
+ break;
4676
+ case "line-breaks":
4677
+ renderLineBreaks(ctx, element.data);
4678
+ break;
4679
+ case "clear-float":
4680
+ renderClearFloat(ctx, element.data);
4681
+ break;
4682
+ case "horizontal-rule":
4683
+ ctx.push("<hr />");
4684
+ break;
4685
+ case "content-separator":
4686
+ ctx.push(`<div class="content-separator" style="display: none:"></div>`);
4687
+ break;
4688
+ case "expr":
4689
+ renderExpr(ctx, element.data);
4690
+ break;
4691
+ case "if":
4692
+ renderIf(ctx, element.data);
4693
+ break;
4694
+ case "ifexpr":
4695
+ renderIfExpr(ctx, element.data);
4696
+ break;
4697
+ case "equation-reference":
4698
+ renderEquationRef(ctx, element.data);
4699
+ break;
4700
+ }
4701
+ }