@vue-skuilder/common-ui 0.1.32-e → 0.1.32-f
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/MarkdownRenderer-DoVbFpA6.mjs +4960 -0
- package/dist/MarkdownRenderer-DoVbFpA6.mjs.map +1 -0
- package/dist/assets/MarkdownRenderer.css +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/common-ui.es.js +5049 -2
- package/dist/common-ui.es.js.map +1 -1
- package/dist/common-ui.umd.js +77 -2
- package/dist/common-ui.umd.js.map +1 -1
- package/dist/components/StudySession.vue.d.ts.map +1 -1
- package/dist/utils/SkldrMouseTrap.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/components/StudySession.vue +45 -36
- package/src/utils/SkldrMouseTrap.ts +6 -5
|
@@ -0,0 +1,4960 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, getCurrentInstance as l, h as u, inject as d, markRaw as f, mergeProps as p, normalizeClass as m, onBeforeUnmount as h, onMounted as g, openBlock as _, ref as v, renderList as y, resolveComponent as b, resolveDynamicComponent as x, toDisplayString as S, vModelText as C, watch as w, withCtx as T, withDirectives as E, withKeys as D } from "vue";
|
|
2
|
+
import O from "moment";
|
|
3
|
+
import { log as k } from "@vue-skuilder/common";
|
|
4
|
+
import { defineStore as A, setActivePinia as ee } from "pinia";
|
|
5
|
+
//#region \0rolldown/runtime.js
|
|
6
|
+
var j = Object.create, M = Object.defineProperty, __name = (e, t) => M(e, "name", {
|
|
7
|
+
value: t,
|
|
8
|
+
configurable: !0
|
|
9
|
+
}), N = Object.getOwnPropertyDescriptor, te = Object.getOwnPropertyNames, P = Object.getPrototypeOf, ne = Object.prototype.hasOwnProperty, __commonJSMin = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), __exportAll = (e, t) => {
|
|
10
|
+
let n = {};
|
|
11
|
+
for (var r in e) M(n, r, {
|
|
12
|
+
get: e[r],
|
|
13
|
+
enumerable: !0
|
|
14
|
+
});
|
|
15
|
+
return t || M(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
16
|
+
}, __copyProps = (e, t, n, r) => {
|
|
17
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = te(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !ne.call(e, s) && s !== n && M(e, s, {
|
|
18
|
+
get: ((e) => t[e]).bind(null, s),
|
|
19
|
+
enumerable: !(r = N(t, s)) || r.enumerable
|
|
20
|
+
});
|
|
21
|
+
return e;
|
|
22
|
+
}, __toESM = (e, t, n) => (n = e == null ? {} : j(P(e)), __copyProps(t || !e || !e.__esModule ? M(n, "default", {
|
|
23
|
+
value: e,
|
|
24
|
+
enumerable: !0
|
|
25
|
+
}) : n, e)), F = /* @__PURE__ */ __name((e, t) => {
|
|
26
|
+
let n = e.__vccOpts || e;
|
|
27
|
+
for (let [e, r] of t) n[e] = r;
|
|
28
|
+
return n;
|
|
29
|
+
}, "default"), re = /* @__PURE__ */ __commonJSMin(((e, t) => {
|
|
30
|
+
(function(e, n, r) {
|
|
31
|
+
if (!e) return;
|
|
32
|
+
for (var i = {
|
|
33
|
+
8: "backspace",
|
|
34
|
+
9: "tab",
|
|
35
|
+
13: "enter",
|
|
36
|
+
16: "shift",
|
|
37
|
+
17: "ctrl",
|
|
38
|
+
18: "alt",
|
|
39
|
+
20: "capslock",
|
|
40
|
+
27: "esc",
|
|
41
|
+
32: "space",
|
|
42
|
+
33: "pageup",
|
|
43
|
+
34: "pagedown",
|
|
44
|
+
35: "end",
|
|
45
|
+
36: "home",
|
|
46
|
+
37: "left",
|
|
47
|
+
38: "up",
|
|
48
|
+
39: "right",
|
|
49
|
+
40: "down",
|
|
50
|
+
45: "ins",
|
|
51
|
+
46: "del",
|
|
52
|
+
91: "meta",
|
|
53
|
+
93: "meta",
|
|
54
|
+
224: "meta"
|
|
55
|
+
}, a = {
|
|
56
|
+
106: "*",
|
|
57
|
+
107: "+",
|
|
58
|
+
109: "-",
|
|
59
|
+
110: ".",
|
|
60
|
+
111: "/",
|
|
61
|
+
186: ";",
|
|
62
|
+
187: "=",
|
|
63
|
+
188: ",",
|
|
64
|
+
189: "-",
|
|
65
|
+
190: ".",
|
|
66
|
+
191: "/",
|
|
67
|
+
192: "`",
|
|
68
|
+
219: "[",
|
|
69
|
+
220: "\\",
|
|
70
|
+
221: "]",
|
|
71
|
+
222: "'"
|
|
72
|
+
}, o = {
|
|
73
|
+
"~": "`",
|
|
74
|
+
"!": "1",
|
|
75
|
+
"@": "2",
|
|
76
|
+
"#": "3",
|
|
77
|
+
$: "4",
|
|
78
|
+
"%": "5",
|
|
79
|
+
"^": "6",
|
|
80
|
+
"&": "7",
|
|
81
|
+
"*": "8",
|
|
82
|
+
"(": "9",
|
|
83
|
+
")": "0",
|
|
84
|
+
_: "-",
|
|
85
|
+
"+": "=",
|
|
86
|
+
":": ";",
|
|
87
|
+
"\"": "'",
|
|
88
|
+
"<": ",",
|
|
89
|
+
">": ".",
|
|
90
|
+
"?": "/",
|
|
91
|
+
"|": "\\"
|
|
92
|
+
}, s = {
|
|
93
|
+
option: "alt",
|
|
94
|
+
command: "meta",
|
|
95
|
+
return: "enter",
|
|
96
|
+
escape: "esc",
|
|
97
|
+
plus: "+",
|
|
98
|
+
mod: /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? "meta" : "ctrl"
|
|
99
|
+
}, c, l = 1; l < 20; ++l) i[111 + l] = "f" + l;
|
|
100
|
+
for (l = 0; l <= 9; ++l) i[l + 96] = l.toString();
|
|
101
|
+
function _addEvent(e, t, n) {
|
|
102
|
+
if (e.addEventListener) {
|
|
103
|
+
e.addEventListener(t, n, !1);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
e.attachEvent("on" + t, n);
|
|
107
|
+
}
|
|
108
|
+
function _characterFromEvent(e) {
|
|
109
|
+
if (e.type == "keypress") {
|
|
110
|
+
var t = String.fromCharCode(e.which);
|
|
111
|
+
return e.shiftKey || (t = t.toLowerCase()), t;
|
|
112
|
+
}
|
|
113
|
+
return i[e.which] ? i[e.which] : a[e.which] ? a[e.which] : String.fromCharCode(e.which).toLowerCase();
|
|
114
|
+
}
|
|
115
|
+
function _modifiersMatch(e, t) {
|
|
116
|
+
return e.sort().join(",") === t.sort().join(",");
|
|
117
|
+
}
|
|
118
|
+
function _eventModifiers(e) {
|
|
119
|
+
var t = [];
|
|
120
|
+
return e.shiftKey && t.push("shift"), e.altKey && t.push("alt"), e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), t;
|
|
121
|
+
}
|
|
122
|
+
function _preventDefault(e) {
|
|
123
|
+
if (e.preventDefault) {
|
|
124
|
+
e.preventDefault();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
e.returnValue = !1;
|
|
128
|
+
}
|
|
129
|
+
function _stopPropagation(e) {
|
|
130
|
+
if (e.stopPropagation) {
|
|
131
|
+
e.stopPropagation();
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
e.cancelBubble = !0;
|
|
135
|
+
}
|
|
136
|
+
function _isModifier(e) {
|
|
137
|
+
return e == "shift" || e == "ctrl" || e == "alt" || e == "meta";
|
|
138
|
+
}
|
|
139
|
+
function _getReverseMap() {
|
|
140
|
+
if (!c) for (var e in c = {}, i) e > 95 && e < 112 || i.hasOwnProperty(e) && (c[i[e]] = e);
|
|
141
|
+
return c;
|
|
142
|
+
}
|
|
143
|
+
function _pickBestAction(e, t, n) {
|
|
144
|
+
return n || (n = _getReverseMap()[e] ? "keydown" : "keypress"), n == "keypress" && t.length && (n = "keydown"), n;
|
|
145
|
+
}
|
|
146
|
+
function _keysFromString(e) {
|
|
147
|
+
return e === "+" ? ["+"] : (e = e.replace(/\+{2}/g, "+plus"), e.split("+"));
|
|
148
|
+
}
|
|
149
|
+
function _getKeyInfo(e, t) {
|
|
150
|
+
var n, r, i, a = [];
|
|
151
|
+
for (n = _keysFromString(e), i = 0; i < n.length; ++i) r = n[i], s[r] && (r = s[r]), t && t != "keypress" && o[r] && (r = o[r], a.push("shift")), _isModifier(r) && a.push(r);
|
|
152
|
+
return t = _pickBestAction(r, a, t), {
|
|
153
|
+
key: r,
|
|
154
|
+
modifiers: a,
|
|
155
|
+
action: t
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function _belongsTo(e, t) {
|
|
159
|
+
return e === null || e === n ? !1 : e === t ? !0 : _belongsTo(e.parentNode, t);
|
|
160
|
+
}
|
|
161
|
+
function Mousetrap(e) {
|
|
162
|
+
var t = this;
|
|
163
|
+
if (e = e || n, !(t instanceof Mousetrap)) return new Mousetrap(e);
|
|
164
|
+
t.target = e, t._callbacks = {}, t._directMap = {};
|
|
165
|
+
var r = {}, i, a = !1, o = !1, s = !1;
|
|
166
|
+
function _resetSequences(e) {
|
|
167
|
+
e = e || {};
|
|
168
|
+
var t = !1, n;
|
|
169
|
+
for (n in r) {
|
|
170
|
+
if (e[n]) {
|
|
171
|
+
t = !0;
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
r[n] = 0;
|
|
175
|
+
}
|
|
176
|
+
t || (s = !1);
|
|
177
|
+
}
|
|
178
|
+
function _getMatches(e, n, i, a, o, s) {
|
|
179
|
+
var c, l, u = [], d = i.type;
|
|
180
|
+
if (!t._callbacks[e]) return [];
|
|
181
|
+
for (d == "keyup" && _isModifier(e) && (n = [e]), c = 0; c < t._callbacks[e].length; ++c) if (l = t._callbacks[e][c], !(!a && l.seq && r[l.seq] != l.level) && d == l.action && (d == "keypress" && !i.metaKey && !i.ctrlKey || _modifiersMatch(n, l.modifiers))) {
|
|
182
|
+
var f = !a && l.combo == o, p = a && l.seq == a && l.level == s;
|
|
183
|
+
(f || p) && t._callbacks[e].splice(c, 1), u.push(l);
|
|
184
|
+
}
|
|
185
|
+
return u;
|
|
186
|
+
}
|
|
187
|
+
function _fireCallback(e, n, r, i) {
|
|
188
|
+
t.stopCallback(n, n.target || n.srcElement, r, i) || e(n, r) === !1 && (_preventDefault(n), _stopPropagation(n));
|
|
189
|
+
}
|
|
190
|
+
t._handleKey = function(e, t, n) {
|
|
191
|
+
var r = _getMatches(e, t, n), i, a = {}, c = 0, l = !1;
|
|
192
|
+
for (i = 0; i < r.length; ++i) r[i].seq && (c = Math.max(c, r[i].level));
|
|
193
|
+
for (i = 0; i < r.length; ++i) {
|
|
194
|
+
if (r[i].seq) {
|
|
195
|
+
if (r[i].level != c) continue;
|
|
196
|
+
l = !0, a[r[i].seq] = 1, _fireCallback(r[i].callback, n, r[i].combo, r[i].seq);
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
l || _fireCallback(r[i].callback, n, r[i].combo);
|
|
200
|
+
}
|
|
201
|
+
var u = n.type == "keypress" && o;
|
|
202
|
+
n.type == s && !_isModifier(e) && !u && _resetSequences(a), o = l && n.type == "keydown";
|
|
203
|
+
};
|
|
204
|
+
function _handleKeyEvent(e) {
|
|
205
|
+
typeof e.which != "number" && (e.which = e.keyCode);
|
|
206
|
+
var n = _characterFromEvent(e);
|
|
207
|
+
if (n) {
|
|
208
|
+
if (e.type == "keyup" && a === n) {
|
|
209
|
+
a = !1;
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
t.handleKey(n, _eventModifiers(e), e);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function _resetSequenceTimer() {
|
|
216
|
+
clearTimeout(i), i = setTimeout(_resetSequences, 1e3);
|
|
217
|
+
}
|
|
218
|
+
function _bindSequence(e, t, n, i) {
|
|
219
|
+
r[e] = 0;
|
|
220
|
+
function _increaseSequence(t) {
|
|
221
|
+
return function() {
|
|
222
|
+
s = t, ++r[e], _resetSequenceTimer();
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function _callbackAndReset(t) {
|
|
226
|
+
_fireCallback(n, t, e), i !== "keyup" && (a = _characterFromEvent(t)), setTimeout(_resetSequences, 10);
|
|
227
|
+
}
|
|
228
|
+
for (var o = 0; o < t.length; ++o) {
|
|
229
|
+
var c = o + 1 === t.length ? _callbackAndReset : _increaseSequence(i || _getKeyInfo(t[o + 1]).action);
|
|
230
|
+
_bindSingle(t[o], c, i, e, o);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
function _bindSingle(e, n, r, i, a) {
|
|
234
|
+
t._directMap[e + ":" + r] = n, e = e.replace(/\s+/g, " ");
|
|
235
|
+
var o = e.split(" "), s;
|
|
236
|
+
if (o.length > 1) {
|
|
237
|
+
_bindSequence(e, o, n, r);
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
s = _getKeyInfo(e, r), t._callbacks[s.key] = t._callbacks[s.key] || [], _getMatches(s.key, s.modifiers, { type: s.action }, i, e, a), t._callbacks[s.key][i ? "unshift" : "push"]({
|
|
241
|
+
callback: n,
|
|
242
|
+
modifiers: s.modifiers,
|
|
243
|
+
action: s.action,
|
|
244
|
+
seq: i,
|
|
245
|
+
level: a,
|
|
246
|
+
combo: e
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
t._bindMultiple = function(e, t, n) {
|
|
250
|
+
for (var r = 0; r < e.length; ++r) _bindSingle(e[r], t, n);
|
|
251
|
+
}, _addEvent(e, "keypress", _handleKeyEvent), _addEvent(e, "keydown", _handleKeyEvent), _addEvent(e, "keyup", _handleKeyEvent);
|
|
252
|
+
}
|
|
253
|
+
Mousetrap.prototype.bind = function(e, t, n) {
|
|
254
|
+
var r = this;
|
|
255
|
+
return e = e instanceof Array ? e : [e], r._bindMultiple.call(r, e, t, n), r;
|
|
256
|
+
}, Mousetrap.prototype.unbind = function(e, t) {
|
|
257
|
+
var n = this;
|
|
258
|
+
return n.bind.call(n, e, function() {}, t);
|
|
259
|
+
}, Mousetrap.prototype.trigger = function(e, t) {
|
|
260
|
+
var n = this;
|
|
261
|
+
return n._directMap[e + ":" + t] && n._directMap[e + ":" + t]({}, e), n;
|
|
262
|
+
}, Mousetrap.prototype.reset = function() {
|
|
263
|
+
var e = this;
|
|
264
|
+
return e._callbacks = {}, e._directMap = {}, e;
|
|
265
|
+
}, Mousetrap.prototype.stopCallback = function(e, t) {
|
|
266
|
+
var n = this;
|
|
267
|
+
if ((" " + t.className + " ").indexOf(" mousetrap ") > -1 || _belongsTo(t, n.target)) return !1;
|
|
268
|
+
if ("composedPath" in e && typeof e.composedPath == "function") {
|
|
269
|
+
var r = e.composedPath()[0];
|
|
270
|
+
r !== e.target && (t = r);
|
|
271
|
+
}
|
|
272
|
+
return t.tagName == "INPUT" || t.tagName == "SELECT" || t.tagName == "TEXTAREA" || t.isContentEditable;
|
|
273
|
+
}, Mousetrap.prototype.handleKey = function() {
|
|
274
|
+
var e = this;
|
|
275
|
+
return e._handleKey.apply(e, arguments);
|
|
276
|
+
}, Mousetrap.addKeycodes = function(e) {
|
|
277
|
+
for (var t in e) e.hasOwnProperty(t) && (i[t] = e[t]);
|
|
278
|
+
c = null;
|
|
279
|
+
}, Mousetrap.init = function() {
|
|
280
|
+
var e = Mousetrap(n);
|
|
281
|
+
for (var t in e) t.charAt(0) !== "_" && (Mousetrap[t] = function(t) {
|
|
282
|
+
return function() {
|
|
283
|
+
return e[t].apply(e, arguments);
|
|
284
|
+
};
|
|
285
|
+
}(t));
|
|
286
|
+
}, Mousetrap.init(), e.Mousetrap = Mousetrap, t !== void 0 && t.exports && (t.exports = Mousetrap), typeof define == "function" && define.amd && define(function() {
|
|
287
|
+
return Mousetrap;
|
|
288
|
+
});
|
|
289
|
+
})(typeof window < "u" ? window : null, typeof window < "u" ? document : null);
|
|
290
|
+
}));
|
|
291
|
+
//#endregion
|
|
292
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/typeof.js
|
|
293
|
+
function _typeof(e) {
|
|
294
|
+
"@babel/helpers - typeof";
|
|
295
|
+
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
296
|
+
return typeof e;
|
|
297
|
+
} : function(e) {
|
|
298
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
299
|
+
}, _typeof(e);
|
|
300
|
+
}
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/toPrimitive.js
|
|
303
|
+
function toPrimitive(e, t) {
|
|
304
|
+
if (_typeof(e) != "object" || !e) return e;
|
|
305
|
+
var n = e[Symbol.toPrimitive];
|
|
306
|
+
if (n !== void 0) {
|
|
307
|
+
var r = n.call(e, t || "default");
|
|
308
|
+
if (_typeof(r) != "object") return r;
|
|
309
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
310
|
+
}
|
|
311
|
+
return (t === "string" ? String : Number)(e);
|
|
312
|
+
}
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/toPropertyKey.js
|
|
315
|
+
function toPropertyKey(e) {
|
|
316
|
+
var t = toPrimitive(e, "string");
|
|
317
|
+
return _typeof(t) == "symbol" ? t : t + "";
|
|
318
|
+
}
|
|
319
|
+
//#endregion
|
|
320
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/defineProperty.js
|
|
321
|
+
function _defineProperty(e, t, n) {
|
|
322
|
+
return (t = toPropertyKey(t)) in e ? Object.defineProperty(e, t, {
|
|
323
|
+
value: n,
|
|
324
|
+
enumerable: !0,
|
|
325
|
+
configurable: !0,
|
|
326
|
+
writable: !0
|
|
327
|
+
}) : e[t] = n, e;
|
|
328
|
+
}
|
|
329
|
+
//#endregion
|
|
330
|
+
//#region src/utils/SkldrMouseTrap.ts
|
|
331
|
+
var ie = /* @__PURE__ */ __toESM(re());
|
|
332
|
+
function inputElementIsFocused() {
|
|
333
|
+
let e = document.activeElement;
|
|
334
|
+
return e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio") ? !1 : e instanceof HTMLElement && (e.tagName === "INPUT" || e.tagName === "TEXTAREA" || e.tagName === "SELECT" || e.isContentEditable);
|
|
335
|
+
}
|
|
336
|
+
var I = class SkldrMouseTrap {
|
|
337
|
+
constructor() {
|
|
338
|
+
_defineProperty(this, "mouseTrap", void 0), _defineProperty(this, "hotkeys", void 0), this.mouseTrap = new ie.default(), this.mouseTrap.stopCallback = () => !1, this.hotkeys = [];
|
|
339
|
+
}
|
|
340
|
+
static get commands() {
|
|
341
|
+
return SkldrMouseTrap.instance().hotkeys.map((e) => ({
|
|
342
|
+
command: e.command,
|
|
343
|
+
hotkey: e.hotkey
|
|
344
|
+
}));
|
|
345
|
+
}
|
|
346
|
+
static addBinding(e) {
|
|
347
|
+
let t = Array.isArray(e) ? e : [e], n = SkldrMouseTrap.instance();
|
|
348
|
+
n.hotkeys = [...n.hotkeys, ...t], t.forEach((e) => {
|
|
349
|
+
n.mouseTrap.bind(e.hotkey, (t, n) => {
|
|
350
|
+
if (inputElementIsFocused()) {
|
|
351
|
+
console.log(`Ignoring hotkey ${e.hotkey} while input element is focused`);
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
e.callback(t, n);
|
|
355
|
+
});
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
static removeBinding(e) {
|
|
359
|
+
let t = SkldrMouseTrap.instance(), n = [...t.hotkeys];
|
|
360
|
+
Array.isArray(e) && !e.every((e) => typeof e == "string" || typeof e == "number") ? e.forEach((e) => {
|
|
361
|
+
t.hotkeys = t.hotkeys.filter((t) => JSON.stringify(t.hotkey) !== JSON.stringify(e)), t.mouseTrap.unbind(e);
|
|
362
|
+
}) : (t.hotkeys = n.filter((t) => JSON.stringify(t.hotkey) !== JSON.stringify(e)), t.mouseTrap.unbind(e));
|
|
363
|
+
}
|
|
364
|
+
static reset() {
|
|
365
|
+
console.warn("SkldrMouseTrap.reset() may affect hotkeys registered by other components. Consider using removeBinding() with specific hotkeys for better component isolation."), SkldrMouseTrap.instance().mouseTrap.reset(), SkldrMouseTrap.instance().hotkeys = [];
|
|
366
|
+
}
|
|
367
|
+
static instance() {
|
|
368
|
+
return SkldrMouseTrap._instance || (SkldrMouseTrap._instance = new SkldrMouseTrap()), SkldrMouseTrap._instance;
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
_defineProperty(I, "_instance", void 0);
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region src/composables/CompositionViewable.ts
|
|
374
|
+
function useViewable(e, n, r) {
|
|
375
|
+
let i = v(O.utc()), a = v([]), o = {
|
|
376
|
+
log: (e, ...t) => console.log(`[${r}]: `, e, ...t),
|
|
377
|
+
error: (e, ...t) => console.error(`[${r}]: `, e, ...t),
|
|
378
|
+
warn: (e, ...t) => console.warn(`[${r}]: `, e, ...t)
|
|
379
|
+
}, s = t(() => Math.abs(O.utc().diff(i.value, "milliseconds"))), getURL = (t, n = 0) => {
|
|
380
|
+
try {
|
|
381
|
+
if (e.data[n]?.[t]) return URL.createObjectURL(e.data[n][t]);
|
|
382
|
+
} catch (e) {
|
|
383
|
+
o.error("Error creating URL for item:", t, e);
|
|
384
|
+
}
|
|
385
|
+
return "";
|
|
386
|
+
}, emitResponse = (e) => {
|
|
387
|
+
n("emitResponse", e);
|
|
388
|
+
};
|
|
389
|
+
return {
|
|
390
|
+
startTime: i,
|
|
391
|
+
hotKeys: a,
|
|
392
|
+
timeSpent: s,
|
|
393
|
+
logger: o,
|
|
394
|
+
getURL,
|
|
395
|
+
emitResponse
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
function useQuestionView(e) {
|
|
399
|
+
let t = v(0), n = v(0), r = v([]), i = v(3), a = v(2), o = v(), submitAnswer = (t, i, a) => {
|
|
400
|
+
if (e.logger.log("submitAnswer called..."), !o.value) throw Error("Question not initialized");
|
|
401
|
+
r.value.push([t, i ?? ""]);
|
|
402
|
+
let s = o.value.evaluate(t, e.timeSpent.value);
|
|
403
|
+
e.logger.log(`evaluation of answer ${t}:`, s);
|
|
404
|
+
let c = {
|
|
405
|
+
...s,
|
|
406
|
+
priorAttemps: n.value,
|
|
407
|
+
courseID: "",
|
|
408
|
+
cardID: "",
|
|
409
|
+
timeSpent: e.timeSpent.value,
|
|
410
|
+
timeStamp: e.startTime.value,
|
|
411
|
+
userAnswer: t
|
|
412
|
+
};
|
|
413
|
+
return a?.deferAdvance !== void 0 && (c.deferAdvance = a.deferAdvance), s.isCorrect || n.value++, e.emitResponse(c), c;
|
|
414
|
+
};
|
|
415
|
+
return {
|
|
416
|
+
priorSessionViews: t,
|
|
417
|
+
priorAttempts: n,
|
|
418
|
+
priorAnswers: r,
|
|
419
|
+
maxAttemptsPerView: i,
|
|
420
|
+
maxSessionViews: a,
|
|
421
|
+
question: o,
|
|
422
|
+
submitAnswer
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
function isQuestionView(e) {
|
|
426
|
+
return typeof e == "object" && !!e && "submitAnswer" in e && "priorAttempts" in e;
|
|
427
|
+
}
|
|
428
|
+
//#endregion
|
|
429
|
+
//#region src/plugins/pinia.ts
|
|
430
|
+
var ae = null, setPinia = (e) => {
|
|
431
|
+
ae = e;
|
|
432
|
+
}, getPinia = () => ae, oe = { install(e, t) {
|
|
433
|
+
let n = t?.pinia;
|
|
434
|
+
n && setPinia(n);
|
|
435
|
+
} }, useCardPreviewModeStore = () => {
|
|
436
|
+
let e = getPinia();
|
|
437
|
+
return e && ee(e), A("previewMode", {
|
|
438
|
+
state: () => ({ previewMode: !1 }),
|
|
439
|
+
actions: { setPreviewMode(e) {
|
|
440
|
+
this.previewMode = e;
|
|
441
|
+
} },
|
|
442
|
+
getters: { isPreviewMode() {
|
|
443
|
+
return this.previewMode;
|
|
444
|
+
} }
|
|
445
|
+
})();
|
|
446
|
+
}, se = c({
|
|
447
|
+
name: "UserInput",
|
|
448
|
+
data() {
|
|
449
|
+
return {
|
|
450
|
+
answer: "",
|
|
451
|
+
previewModeStore: null
|
|
452
|
+
};
|
|
453
|
+
},
|
|
454
|
+
mounted() {
|
|
455
|
+
this.previewModeStore = useCardPreviewModeStore();
|
|
456
|
+
},
|
|
457
|
+
computed: {
|
|
458
|
+
autofocus() {
|
|
459
|
+
return !this.previewModeStore?.previewMode;
|
|
460
|
+
},
|
|
461
|
+
autoFocus() {
|
|
462
|
+
return this.autofocus;
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
methods: {
|
|
466
|
+
submitAnswer(e) {
|
|
467
|
+
return this.submit(e);
|
|
468
|
+
},
|
|
469
|
+
submit(e) {
|
|
470
|
+
return this.getQuestionViewAncestor().submitAnswer(e, this.$options.name ?? "UserInput");
|
|
471
|
+
},
|
|
472
|
+
getQuestionViewAncestor() {
|
|
473
|
+
let e = this.$parent, t = 0;
|
|
474
|
+
for (; e && !isQuestionView(e);) {
|
|
475
|
+
let n = e.$parent;
|
|
476
|
+
if (!n) {
|
|
477
|
+
let e = "\nUserInput.submit() has failed.\nThe input element has no QuestionView ancestor element.";
|
|
478
|
+
throw k(e), Error(e);
|
|
479
|
+
}
|
|
480
|
+
if (e = n, t++, t > 100) {
|
|
481
|
+
let e = "\nUserInput.submit() has failed.\nExceeded maximum ancestor lookup depth.";
|
|
482
|
+
throw k(e), Error(e);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
if (!e) throw Error("No QuestionView ancestor found");
|
|
486
|
+
return e;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}), ce = c({
|
|
490
|
+
name: "UserInputString",
|
|
491
|
+
extends: se,
|
|
492
|
+
props: { icon: {
|
|
493
|
+
type: Boolean,
|
|
494
|
+
required: !1
|
|
495
|
+
} },
|
|
496
|
+
computed: { prependIcon() {
|
|
497
|
+
return this.icon ? "edit" : "";
|
|
498
|
+
} },
|
|
499
|
+
mounted() {
|
|
500
|
+
this.$refs.input?.focus();
|
|
501
|
+
},
|
|
502
|
+
methods: {}
|
|
503
|
+
}), le = { class: "user-input-container" }, ue = ["autofocus"];
|
|
504
|
+
function _sfc_render$2(e, t, n, r, o, s) {
|
|
505
|
+
return _(), i("span", le, [E(a("input", {
|
|
506
|
+
"onUpdate:modelValue": t[0] || (t[0] = (t) => e.answer = t),
|
|
507
|
+
autofocus: e.autofocus,
|
|
508
|
+
type: "text",
|
|
509
|
+
class: "user-input-string",
|
|
510
|
+
ref: "input",
|
|
511
|
+
onKeyup: t[1] || (t[1] = D((t) => e.submitAnswer(e.answer), ["enter"]))
|
|
512
|
+
}, null, 40, ue), [[C, e.answer]])]);
|
|
513
|
+
}
|
|
514
|
+
__name(_sfc_render$2, "_sfc_render");
|
|
515
|
+
var de = /* @__PURE__ */ F(ce, [["render", _sfc_render$2], ["__scopeId", "data-v-aa14961f"]]), fe = c({
|
|
516
|
+
name: "FillInInput",
|
|
517
|
+
components: { UserInputString: de },
|
|
518
|
+
props: { text: {
|
|
519
|
+
type: String,
|
|
520
|
+
required: !0
|
|
521
|
+
} },
|
|
522
|
+
setup(e) {
|
|
523
|
+
let n = v("text"), r = v(""), i = t(() => e.text.split("||").length > 1);
|
|
524
|
+
return g(() => {
|
|
525
|
+
console.log(`fillinCreated w/ text: ${e.text}`), r.value = e.text.substring(2, e.text.length - 2), console.log(`fillin text trimmed to: ${r.value}`), r.value.split("||").length > 1 && (n.value = "radio");
|
|
526
|
+
}), {
|
|
527
|
+
inputType: n,
|
|
528
|
+
radioType: i,
|
|
529
|
+
processedText: r
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
}), pe = {
|
|
533
|
+
key: 0,
|
|
534
|
+
class: "text-h5 underline"
|
|
535
|
+
};
|
|
536
|
+
function _sfc_render$1(e, t, r, a, o, s) {
|
|
537
|
+
let c = b("user-input-string");
|
|
538
|
+
return e.radioType ? (_(), i("span", pe, "\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0")) : (_(), n(c, {
|
|
539
|
+
key: 1,
|
|
540
|
+
id: "input",
|
|
541
|
+
icon: !1,
|
|
542
|
+
type: "text",
|
|
543
|
+
value: e.processedText
|
|
544
|
+
}, null, 8, ["value"]));
|
|
545
|
+
}
|
|
546
|
+
__name(_sfc_render$1, "_sfc_render");
|
|
547
|
+
var me = /* @__PURE__ */ F(fe, [["render", _sfc_render$1], ["__scopeId", "data-v-486ac035"]]);
|
|
548
|
+
//#endregion
|
|
549
|
+
//#region ../../node_modules/marked/lib/marked.esm.js
|
|
550
|
+
function _getDefaults() {
|
|
551
|
+
return {
|
|
552
|
+
async: !1,
|
|
553
|
+
breaks: !1,
|
|
554
|
+
extensions: null,
|
|
555
|
+
gfm: !0,
|
|
556
|
+
hooks: null,
|
|
557
|
+
pedantic: !1,
|
|
558
|
+
renderer: null,
|
|
559
|
+
silent: !1,
|
|
560
|
+
tokenizer: null,
|
|
561
|
+
walkTokens: null
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
var L = _getDefaults();
|
|
565
|
+
function changeDefaults(e) {
|
|
566
|
+
L = e;
|
|
567
|
+
}
|
|
568
|
+
var R = { exec: () => null };
|
|
569
|
+
function edit(e, t = "") {
|
|
570
|
+
let n = typeof e == "string" ? e : e.source, r = {
|
|
571
|
+
replace: (e, t) => {
|
|
572
|
+
let i = typeof t == "string" ? t : t.source;
|
|
573
|
+
return i = i.replace(z.caret, "$1"), n = n.replace(e, i), r;
|
|
574
|
+
},
|
|
575
|
+
getRegex: () => new RegExp(n, t)
|
|
576
|
+
};
|
|
577
|
+
return r;
|
|
578
|
+
}
|
|
579
|
+
var z = {
|
|
580
|
+
codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
|
|
581
|
+
outputLinkReplace: /\\([\[\]])/g,
|
|
582
|
+
indentCodeCompensation: /^(\s+)(?:```)/,
|
|
583
|
+
beginningSpace: /^\s+/,
|
|
584
|
+
endingHash: /#$/,
|
|
585
|
+
startingSpaceChar: /^ /,
|
|
586
|
+
endingSpaceChar: / $/,
|
|
587
|
+
nonSpaceChar: /[^ ]/,
|
|
588
|
+
newLineCharGlobal: /\n/g,
|
|
589
|
+
tabCharGlobal: /\t/g,
|
|
590
|
+
multipleSpaceGlobal: /\s+/g,
|
|
591
|
+
blankLine: /^[ \t]*$/,
|
|
592
|
+
doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
|
|
593
|
+
blockquoteStart: /^ {0,3}>/,
|
|
594
|
+
blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
|
|
595
|
+
blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
|
|
596
|
+
listReplaceTabs: /^\t+/,
|
|
597
|
+
listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
|
|
598
|
+
listIsTask: /^\[[ xX]\] /,
|
|
599
|
+
listReplaceTask: /^\[[ xX]\] +/,
|
|
600
|
+
anyLine: /\n.*\n/,
|
|
601
|
+
hrefBrackets: /^<(.*)>$/,
|
|
602
|
+
tableDelimiter: /[:|]/,
|
|
603
|
+
tableAlignChars: /^\||\| *$/g,
|
|
604
|
+
tableRowBlankLine: /\n[ \t]*$/,
|
|
605
|
+
tableAlignRight: /^ *-+: *$/,
|
|
606
|
+
tableAlignCenter: /^ *:-+: *$/,
|
|
607
|
+
tableAlignLeft: /^ *:-+ *$/,
|
|
608
|
+
startATag: /^<a /i,
|
|
609
|
+
endATag: /^<\/a>/i,
|
|
610
|
+
startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
|
|
611
|
+
endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
|
|
612
|
+
startAngleBracket: /^</,
|
|
613
|
+
endAngleBracket: />$/,
|
|
614
|
+
pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
|
|
615
|
+
unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
|
|
616
|
+
escapeTest: /[&<>"']/,
|
|
617
|
+
escapeReplace: /[&<>"']/g,
|
|
618
|
+
escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
|
|
619
|
+
escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
|
|
620
|
+
unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,
|
|
621
|
+
caret: /(^|[^\[])\^/g,
|
|
622
|
+
percentDecode: /%25/g,
|
|
623
|
+
findPipe: /\|/g,
|
|
624
|
+
splitPipe: / \|/,
|
|
625
|
+
slashPipe: /\\\|/g,
|
|
626
|
+
carriageReturn: /\r\n|\r/g,
|
|
627
|
+
spaceLine: /^ +$/gm,
|
|
628
|
+
notSpaceStart: /^\S*/,
|
|
629
|
+
endingNewline: /\n$/,
|
|
630
|
+
listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),
|
|
631
|
+
nextBulletRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),
|
|
632
|
+
hrRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
|
|
633
|
+
fencesBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`),
|
|
634
|
+
headingBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}#`),
|
|
635
|
+
htmlBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i")
|
|
636
|
+
}, he = /^(?:[ \t]*(?:\n|$))+/, ge = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, _e = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, B = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ve = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, V = /(?:[*+-]|\d{1,9}[.)])/, ye = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, be = edit(ye).replace(/bull/g, V).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), xe = edit(ye).replace(/bull/g, V).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), H = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Se = /^[^\n]+/, U = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Ce = edit(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", U).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), we = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, V).getRegex(), W = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Te = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ee = edit("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Te).replace("tag", W).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), De = edit(H).replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", W).getRegex(), Oe = {
|
|
637
|
+
blockquote: edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", De).getRegex(),
|
|
638
|
+
code: ge,
|
|
639
|
+
def: Ce,
|
|
640
|
+
fences: _e,
|
|
641
|
+
heading: ve,
|
|
642
|
+
hr: B,
|
|
643
|
+
html: Ee,
|
|
644
|
+
lheading: be,
|
|
645
|
+
list: we,
|
|
646
|
+
newline: he,
|
|
647
|
+
paragraph: De,
|
|
648
|
+
table: R,
|
|
649
|
+
text: Se
|
|
650
|
+
}, ke = edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", W).getRegex(), Ae = {
|
|
651
|
+
...Oe,
|
|
652
|
+
lheading: xe,
|
|
653
|
+
table: ke,
|
|
654
|
+
paragraph: edit(H).replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ke).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", W).getRegex()
|
|
655
|
+
}, je = {
|
|
656
|
+
...Oe,
|
|
657
|
+
html: edit("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Te).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
658
|
+
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
659
|
+
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
660
|
+
fences: R,
|
|
661
|
+
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
662
|
+
paragraph: edit(H).replace("hr", B).replace("heading", " *#{1,6} *[^\n]").replace("lheading", be).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
663
|
+
}, Me = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ne = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Pe = /^( {2,}|\\)\n(?!\s*$)/, Fe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, G = /[\p{P}\p{S}]/u, Ie = /[\s\p{P}\p{S}]/u, Le = /[^\s\p{P}\p{S}]/u, Re = edit(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Ie).getRegex(), ze = /(?!~)[\p{P}\p{S}]/u, Be = /(?!~)[\s\p{P}\p{S}]/u, Ve = /(?:[^\s\p{P}\p{S}]|~)/u, He = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, Ue = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, We = edit(Ue, "u").replace(/punct/g, G).getRegex(), Ge = edit(Ue, "u").replace(/punct/g, ze).getRegex(), Ke = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", qe = edit(Ke, "gu").replace(/notPunctSpace/g, Le).replace(/punctSpace/g, Ie).replace(/punct/g, G).getRegex(), Je = edit(Ke, "gu").replace(/notPunctSpace/g, Ve).replace(/punctSpace/g, Be).replace(/punct/g, ze).getRegex(), Ye = edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Le).replace(/punctSpace/g, Ie).replace(/punct/g, G).getRegex(), Xe = edit(/\\(punct)/, "gu").replace(/punct/g, G).getRegex(), Ze = edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Qe = edit(Te).replace("(?:-->|$)", "-->").getRegex(), $e = edit("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Qe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), K = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, et = edit(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", K).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), tt = edit(/^!?\[(label)\]\[(ref)\]/).replace("label", K).replace("ref", U).getRegex(), nt = edit(/^!?\[(ref)\](?:\[\])?/).replace("ref", U).getRegex(), rt = {
|
|
664
|
+
_backpedal: R,
|
|
665
|
+
anyPunctuation: Xe,
|
|
666
|
+
autolink: Ze,
|
|
667
|
+
blockSkip: He,
|
|
668
|
+
br: Pe,
|
|
669
|
+
code: Ne,
|
|
670
|
+
del: R,
|
|
671
|
+
emStrongLDelim: We,
|
|
672
|
+
emStrongRDelimAst: qe,
|
|
673
|
+
emStrongRDelimUnd: Ye,
|
|
674
|
+
escape: Me,
|
|
675
|
+
link: et,
|
|
676
|
+
nolink: nt,
|
|
677
|
+
punctuation: Re,
|
|
678
|
+
reflink: tt,
|
|
679
|
+
reflinkSearch: edit("reflink|nolink(?!\\()", "g").replace("reflink", tt).replace("nolink", nt).getRegex(),
|
|
680
|
+
tag: $e,
|
|
681
|
+
text: Fe,
|
|
682
|
+
url: R
|
|
683
|
+
}, it = {
|
|
684
|
+
...rt,
|
|
685
|
+
link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", K).getRegex(),
|
|
686
|
+
reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", K).getRegex()
|
|
687
|
+
}, at = {
|
|
688
|
+
...rt,
|
|
689
|
+
emStrongRDelimAst: Je,
|
|
690
|
+
emStrongLDelim: Ge,
|
|
691
|
+
url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
|
|
692
|
+
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
693
|
+
del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
|
|
694
|
+
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
|
|
695
|
+
}, ot = {
|
|
696
|
+
...at,
|
|
697
|
+
br: edit(Pe).replace("{2,}", "*").getRegex(),
|
|
698
|
+
text: edit(at.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
699
|
+
}, q = {
|
|
700
|
+
normal: Oe,
|
|
701
|
+
gfm: Ae,
|
|
702
|
+
pedantic: je
|
|
703
|
+
}, J = {
|
|
704
|
+
normal: rt,
|
|
705
|
+
gfm: at,
|
|
706
|
+
breaks: ot,
|
|
707
|
+
pedantic: it
|
|
708
|
+
}, st = {
|
|
709
|
+
"&": "&",
|
|
710
|
+
"<": "<",
|
|
711
|
+
">": ">",
|
|
712
|
+
"\"": """,
|
|
713
|
+
"'": "'"
|
|
714
|
+
}, getEscapeReplacement = (e) => st[e];
|
|
715
|
+
function escape(e, t) {
|
|
716
|
+
if (t) {
|
|
717
|
+
if (z.escapeTest.test(e)) return e.replace(z.escapeReplace, getEscapeReplacement);
|
|
718
|
+
} else if (z.escapeTestNoEncode.test(e)) return e.replace(z.escapeReplaceNoEncode, getEscapeReplacement);
|
|
719
|
+
return e;
|
|
720
|
+
}
|
|
721
|
+
function cleanUrl(e) {
|
|
722
|
+
try {
|
|
723
|
+
e = encodeURI(e).replace(z.percentDecode, "%");
|
|
724
|
+
} catch {
|
|
725
|
+
return null;
|
|
726
|
+
}
|
|
727
|
+
return e;
|
|
728
|
+
}
|
|
729
|
+
function splitCells(e, t) {
|
|
730
|
+
let n = e.replace(z.findPipe, (e, t, n) => {
|
|
731
|
+
let r = !1, i = t;
|
|
732
|
+
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
733
|
+
return r ? "|" : " |";
|
|
734
|
+
}).split(z.splitPipe), r = 0;
|
|
735
|
+
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
|
|
736
|
+
else for (; n.length < t;) n.push("");
|
|
737
|
+
for (; r < n.length; r++) n[r] = n[r].trim().replace(z.slashPipe, "|");
|
|
738
|
+
return n;
|
|
739
|
+
}
|
|
740
|
+
function rtrim(e, t, n) {
|
|
741
|
+
let r = e.length;
|
|
742
|
+
if (r === 0) return "";
|
|
743
|
+
let i = 0;
|
|
744
|
+
for (; i < r && e.charAt(r - i - 1) === t;) i++;
|
|
745
|
+
return e.slice(0, r - i);
|
|
746
|
+
}
|
|
747
|
+
function findClosingBracket(e, t) {
|
|
748
|
+
if (e.indexOf(t[1]) === -1) return -1;
|
|
749
|
+
let n = 0;
|
|
750
|
+
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
751
|
+
else if (e[r] === t[0]) n++;
|
|
752
|
+
else if (e[r] === t[1] && (n--, n < 0)) return r;
|
|
753
|
+
return -1;
|
|
754
|
+
}
|
|
755
|
+
function outputLink(e, t, n, r, i) {
|
|
756
|
+
let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1");
|
|
757
|
+
if (e[0].charAt(0) !== "!") {
|
|
758
|
+
r.state.inLink = !0;
|
|
759
|
+
let e = {
|
|
760
|
+
type: "link",
|
|
761
|
+
raw: n,
|
|
762
|
+
href: a,
|
|
763
|
+
title: o,
|
|
764
|
+
text: s,
|
|
765
|
+
tokens: r.inlineTokens(s)
|
|
766
|
+
};
|
|
767
|
+
return r.state.inLink = !1, e;
|
|
768
|
+
}
|
|
769
|
+
return {
|
|
770
|
+
type: "image",
|
|
771
|
+
raw: n,
|
|
772
|
+
href: a,
|
|
773
|
+
title: o,
|
|
774
|
+
text: s
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
function indentCodeCompensation(e, t, n) {
|
|
778
|
+
let r = e.match(n.other.indentCodeCompensation);
|
|
779
|
+
if (r === null) return t;
|
|
780
|
+
let i = r[1];
|
|
781
|
+
return t.split("\n").map((e) => {
|
|
782
|
+
let t = e.match(n.other.beginningSpace);
|
|
783
|
+
if (t === null) return e;
|
|
784
|
+
let [r] = t;
|
|
785
|
+
return r.length >= i.length ? e.slice(i.length) : e;
|
|
786
|
+
}).join("\n");
|
|
787
|
+
}
|
|
788
|
+
var _Tokenizer = class {
|
|
789
|
+
constructor(e) {
|
|
790
|
+
_defineProperty(this, "options", void 0), _defineProperty(this, "rules", void 0), _defineProperty(this, "lexer", void 0), this.options = e || L;
|
|
791
|
+
}
|
|
792
|
+
space(e) {
|
|
793
|
+
let t = this.rules.block.newline.exec(e);
|
|
794
|
+
if (t && t[0].length > 0) return {
|
|
795
|
+
type: "space",
|
|
796
|
+
raw: t[0]
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
code(e) {
|
|
800
|
+
let t = this.rules.block.code.exec(e);
|
|
801
|
+
if (t) {
|
|
802
|
+
let e = t[0].replace(this.rules.other.codeRemoveIndent, "");
|
|
803
|
+
return {
|
|
804
|
+
type: "code",
|
|
805
|
+
raw: t[0],
|
|
806
|
+
codeBlockStyle: "indented",
|
|
807
|
+
text: this.options.pedantic ? e : rtrim(e, "\n")
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
fences(e) {
|
|
812
|
+
let t = this.rules.block.fences.exec(e);
|
|
813
|
+
if (t) {
|
|
814
|
+
let e = t[0], n = indentCodeCompensation(e, t[3] || "", this.rules);
|
|
815
|
+
return {
|
|
816
|
+
type: "code",
|
|
817
|
+
raw: e,
|
|
818
|
+
lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
|
|
819
|
+
text: n
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
heading(e) {
|
|
824
|
+
let t = this.rules.block.heading.exec(e);
|
|
825
|
+
if (t) {
|
|
826
|
+
let e = t[2].trim();
|
|
827
|
+
if (this.rules.other.endingHash.test(e)) {
|
|
828
|
+
let t = rtrim(e, "#");
|
|
829
|
+
(this.options.pedantic || !t || this.rules.other.endingSpaceChar.test(t)) && (e = t.trim());
|
|
830
|
+
}
|
|
831
|
+
return {
|
|
832
|
+
type: "heading",
|
|
833
|
+
raw: t[0],
|
|
834
|
+
depth: t[1].length,
|
|
835
|
+
text: e,
|
|
836
|
+
tokens: this.lexer.inline(e)
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
hr(e) {
|
|
841
|
+
let t = this.rules.block.hr.exec(e);
|
|
842
|
+
if (t) return {
|
|
843
|
+
type: "hr",
|
|
844
|
+
raw: rtrim(t[0], "\n")
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
blockquote(e) {
|
|
848
|
+
let t = this.rules.block.blockquote.exec(e);
|
|
849
|
+
if (t) {
|
|
850
|
+
let e = rtrim(t[0], "\n").split("\n"), n = "", r = "", i = [];
|
|
851
|
+
for (; e.length > 0;) {
|
|
852
|
+
let t = !1, a = [], o;
|
|
853
|
+
for (o = 0; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
|
|
854
|
+
else if (!t) a.push(e[o]);
|
|
855
|
+
else break;
|
|
856
|
+
e = e.slice(o);
|
|
857
|
+
let s = a.join("\n"), c = s.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
858
|
+
n = n ? `${n}\n${s}` : s, r = r ? `${r}\n${c}` : c;
|
|
859
|
+
let l = this.lexer.state.top;
|
|
860
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = l, e.length === 0) break;
|
|
861
|
+
let u = i.at(-1);
|
|
862
|
+
if (u?.type === "code") break;
|
|
863
|
+
if (u?.type === "blockquote") {
|
|
864
|
+
let t = u, a = t.raw + "\n" + e.join("\n"), o = this.blockquote(a);
|
|
865
|
+
i[i.length - 1] = o, n = n.substring(0, n.length - t.raw.length) + o.raw, r = r.substring(0, r.length - t.text.length) + o.text;
|
|
866
|
+
break;
|
|
867
|
+
} else if (u?.type === "list") {
|
|
868
|
+
let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
|
|
869
|
+
i[i.length - 1] = o, n = n.substring(0, n.length - u.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
|
|
870
|
+
continue;
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
return {
|
|
874
|
+
type: "blockquote",
|
|
875
|
+
raw: n,
|
|
876
|
+
tokens: i,
|
|
877
|
+
text: r
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
list(e) {
|
|
882
|
+
let t = this.rules.block.list.exec(e);
|
|
883
|
+
if (t) {
|
|
884
|
+
let n = t[1].trim(), r = n.length > 1, i = {
|
|
885
|
+
type: "list",
|
|
886
|
+
raw: "",
|
|
887
|
+
ordered: r,
|
|
888
|
+
start: r ? +n.slice(0, -1) : "",
|
|
889
|
+
loose: !1,
|
|
890
|
+
items: []
|
|
891
|
+
};
|
|
892
|
+
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
893
|
+
let a = this.rules.other.listItemRegex(n), o = !1;
|
|
894
|
+
for (; e;) {
|
|
895
|
+
let n = !1, r = "", s = "";
|
|
896
|
+
if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
897
|
+
r = t[0], e = e.substring(r.length);
|
|
898
|
+
let c = t[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (e) => " ".repeat(3 * e.length)), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
|
|
899
|
+
if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = t[2].search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
|
|
900
|
+
let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d);
|
|
901
|
+
for (; e;) {
|
|
902
|
+
let f = e.split("\n", 1)[0], p;
|
|
903
|
+
if (l = f, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), p = l) : p = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || t.test(l) || n.test(l)) break;
|
|
904
|
+
if (p.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + p.slice(d);
|
|
905
|
+
else {
|
|
906
|
+
if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
|
|
907
|
+
s += "\n" + l;
|
|
908
|
+
}
|
|
909
|
+
!u && !l.trim() && (u = !0), r += f + "\n", e = e.substring(f.length + 1), c = p.slice(d);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0));
|
|
913
|
+
let f = null, p;
|
|
914
|
+
this.options.gfm && (f = this.rules.other.listIsTask.exec(s), f && (p = f[0] !== "[ ] ", s = s.replace(this.rules.other.listReplaceTask, ""))), i.items.push({
|
|
915
|
+
type: "list_item",
|
|
916
|
+
raw: r,
|
|
917
|
+
task: !!f,
|
|
918
|
+
checked: p,
|
|
919
|
+
loose: !1,
|
|
920
|
+
text: s,
|
|
921
|
+
tokens: []
|
|
922
|
+
}), i.raw += r;
|
|
923
|
+
}
|
|
924
|
+
let s = i.items.at(-1);
|
|
925
|
+
if (s) s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
|
|
926
|
+
else return;
|
|
927
|
+
i.raw = i.raw.trimEnd();
|
|
928
|
+
for (let e = 0; e < i.items.length; e++) if (this.lexer.state.top = !1, i.items[e].tokens = this.lexer.blockTokens(i.items[e].text, []), !i.loose) {
|
|
929
|
+
let t = i.items[e].tokens.filter((e) => e.type === "space");
|
|
930
|
+
i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
|
|
931
|
+
}
|
|
932
|
+
if (i.loose) for (let e = 0; e < i.items.length; e++) i.items[e].loose = !0;
|
|
933
|
+
return i;
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
html(e) {
|
|
937
|
+
let t = this.rules.block.html.exec(e);
|
|
938
|
+
if (t) return {
|
|
939
|
+
type: "html",
|
|
940
|
+
block: !0,
|
|
941
|
+
raw: t[0],
|
|
942
|
+
pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
|
|
943
|
+
text: t[0]
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
def(e) {
|
|
947
|
+
let t = this.rules.block.def.exec(e);
|
|
948
|
+
if (t) {
|
|
949
|
+
let e = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
|
|
950
|
+
return {
|
|
951
|
+
type: "def",
|
|
952
|
+
tag: e,
|
|
953
|
+
raw: t[0],
|
|
954
|
+
href: n,
|
|
955
|
+
title: r
|
|
956
|
+
};
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
table(e) {
|
|
960
|
+
let t = this.rules.block.table.exec(e);
|
|
961
|
+
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
962
|
+
let n = splitCells(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
|
|
963
|
+
type: "table",
|
|
964
|
+
raw: t[0],
|
|
965
|
+
header: [],
|
|
966
|
+
align: [],
|
|
967
|
+
rows: []
|
|
968
|
+
};
|
|
969
|
+
if (n.length === r.length) {
|
|
970
|
+
for (let e of r) this.rules.other.tableAlignRight.test(e) ? a.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? a.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? a.align.push("left") : a.align.push(null);
|
|
971
|
+
for (let e = 0; e < n.length; e++) a.header.push({
|
|
972
|
+
text: n[e],
|
|
973
|
+
tokens: this.lexer.inline(n[e]),
|
|
974
|
+
header: !0,
|
|
975
|
+
align: a.align[e]
|
|
976
|
+
});
|
|
977
|
+
for (let e of i) a.rows.push(splitCells(e, a.header.length).map((e, t) => ({
|
|
978
|
+
text: e,
|
|
979
|
+
tokens: this.lexer.inline(e),
|
|
980
|
+
header: !1,
|
|
981
|
+
align: a.align[t]
|
|
982
|
+
})));
|
|
983
|
+
return a;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
lheading(e) {
|
|
987
|
+
let t = this.rules.block.lheading.exec(e);
|
|
988
|
+
if (t) return {
|
|
989
|
+
type: "heading",
|
|
990
|
+
raw: t[0],
|
|
991
|
+
depth: t[2].charAt(0) === "=" ? 1 : 2,
|
|
992
|
+
text: t[1],
|
|
993
|
+
tokens: this.lexer.inline(t[1])
|
|
994
|
+
};
|
|
995
|
+
}
|
|
996
|
+
paragraph(e) {
|
|
997
|
+
let t = this.rules.block.paragraph.exec(e);
|
|
998
|
+
if (t) {
|
|
999
|
+
let e = t[1].charAt(t[1].length - 1) === "\n" ? t[1].slice(0, -1) : t[1];
|
|
1000
|
+
return {
|
|
1001
|
+
type: "paragraph",
|
|
1002
|
+
raw: t[0],
|
|
1003
|
+
text: e,
|
|
1004
|
+
tokens: this.lexer.inline(e)
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
text(e) {
|
|
1009
|
+
let t = this.rules.block.text.exec(e);
|
|
1010
|
+
if (t) return {
|
|
1011
|
+
type: "text",
|
|
1012
|
+
raw: t[0],
|
|
1013
|
+
text: t[0],
|
|
1014
|
+
tokens: this.lexer.inline(t[0])
|
|
1015
|
+
};
|
|
1016
|
+
}
|
|
1017
|
+
escape(e) {
|
|
1018
|
+
let t = this.rules.inline.escape.exec(e);
|
|
1019
|
+
if (t) return {
|
|
1020
|
+
type: "escape",
|
|
1021
|
+
raw: t[0],
|
|
1022
|
+
text: t[1]
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
tag(e) {
|
|
1026
|
+
let t = this.rules.inline.tag.exec(e);
|
|
1027
|
+
if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
|
|
1028
|
+
type: "html",
|
|
1029
|
+
raw: t[0],
|
|
1030
|
+
inLink: this.lexer.state.inLink,
|
|
1031
|
+
inRawBlock: this.lexer.state.inRawBlock,
|
|
1032
|
+
block: !1,
|
|
1033
|
+
text: t[0]
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
link(e) {
|
|
1037
|
+
let t = this.rules.inline.link.exec(e);
|
|
1038
|
+
if (t) {
|
|
1039
|
+
let e = t[2].trim();
|
|
1040
|
+
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
|
|
1041
|
+
if (!this.rules.other.endAngleBracket.test(e)) return;
|
|
1042
|
+
let t = rtrim(e.slice(0, -1), "\\");
|
|
1043
|
+
if ((e.length - t.length) % 2 == 0) return;
|
|
1044
|
+
} else {
|
|
1045
|
+
let e = findClosingBracket(t[2], "()");
|
|
1046
|
+
if (e > -1) {
|
|
1047
|
+
let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
|
|
1048
|
+
t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "";
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
let n = t[2], r = "";
|
|
1052
|
+
if (this.options.pedantic) {
|
|
1053
|
+
let e = this.rules.other.pedanticHrefTitle.exec(n);
|
|
1054
|
+
e && (n = e[1], r = e[3]);
|
|
1055
|
+
} else r = t[3] ? t[3].slice(1, -1) : "";
|
|
1056
|
+
return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)), outputLink(t, {
|
|
1057
|
+
href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
1058
|
+
title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
|
|
1059
|
+
}, t[0], this.lexer, this.rules);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
reflink(e, t) {
|
|
1063
|
+
let n;
|
|
1064
|
+
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
1065
|
+
let e = t[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
|
|
1066
|
+
if (!e) {
|
|
1067
|
+
let e = n[0].charAt(0);
|
|
1068
|
+
return {
|
|
1069
|
+
type: "text",
|
|
1070
|
+
raw: e,
|
|
1071
|
+
text: e
|
|
1072
|
+
};
|
|
1073
|
+
}
|
|
1074
|
+
return outputLink(n, e, n[0], this.lexer, this.rules);
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
emStrong(e, t, n = "") {
|
|
1078
|
+
let r = this.rules.inline.emStrongLDelim.exec(e);
|
|
1079
|
+
if (r && !(r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[2]) || !n || this.rules.inline.punctuation.exec(n))) {
|
|
1080
|
+
let n = [...r[0]].length - 1, i, a, o = n, s = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
1081
|
+
for (c.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = c.exec(t)) != null;) {
|
|
1082
|
+
if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i) continue;
|
|
1083
|
+
if (a = [...i].length, r[3] || r[4]) {
|
|
1084
|
+
o += a;
|
|
1085
|
+
continue;
|
|
1086
|
+
} else if ((r[5] || r[6]) && n % 3 && !((n + a) % 3)) {
|
|
1087
|
+
s += a;
|
|
1088
|
+
continue;
|
|
1089
|
+
}
|
|
1090
|
+
if (o -= a, o > 0) continue;
|
|
1091
|
+
a = Math.min(a, a + o + s);
|
|
1092
|
+
let t = [...r[0]][0].length, c = e.slice(0, n + r.index + t + a);
|
|
1093
|
+
if (Math.min(n, a) % 2) {
|
|
1094
|
+
let e = c.slice(1, -1);
|
|
1095
|
+
return {
|
|
1096
|
+
type: "em",
|
|
1097
|
+
raw: c,
|
|
1098
|
+
text: e,
|
|
1099
|
+
tokens: this.lexer.inlineTokens(e)
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
let l = c.slice(2, -2);
|
|
1103
|
+
return {
|
|
1104
|
+
type: "strong",
|
|
1105
|
+
raw: c,
|
|
1106
|
+
text: l,
|
|
1107
|
+
tokens: this.lexer.inlineTokens(l)
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
codespan(e) {
|
|
1113
|
+
let t = this.rules.inline.code.exec(e);
|
|
1114
|
+
if (t) {
|
|
1115
|
+
let e = t[2].replace(this.rules.other.newLineCharGlobal, " "), n = this.rules.other.nonSpaceChar.test(e), r = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
|
|
1116
|
+
return n && r && (e = e.substring(1, e.length - 1)), {
|
|
1117
|
+
type: "codespan",
|
|
1118
|
+
raw: t[0],
|
|
1119
|
+
text: e
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
br(e) {
|
|
1124
|
+
let t = this.rules.inline.br.exec(e);
|
|
1125
|
+
if (t) return {
|
|
1126
|
+
type: "br",
|
|
1127
|
+
raw: t[0]
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
del(e) {
|
|
1131
|
+
let t = this.rules.inline.del.exec(e);
|
|
1132
|
+
if (t) return {
|
|
1133
|
+
type: "del",
|
|
1134
|
+
raw: t[0],
|
|
1135
|
+
text: t[2],
|
|
1136
|
+
tokens: this.lexer.inlineTokens(t[2])
|
|
1137
|
+
};
|
|
1138
|
+
}
|
|
1139
|
+
autolink(e) {
|
|
1140
|
+
let t = this.rules.inline.autolink.exec(e);
|
|
1141
|
+
if (t) {
|
|
1142
|
+
let e, n;
|
|
1143
|
+
return t[2] === "@" ? (e = t[1], n = "mailto:" + e) : (e = t[1], n = e), {
|
|
1144
|
+
type: "link",
|
|
1145
|
+
raw: t[0],
|
|
1146
|
+
text: e,
|
|
1147
|
+
href: n,
|
|
1148
|
+
tokens: [{
|
|
1149
|
+
type: "text",
|
|
1150
|
+
raw: e,
|
|
1151
|
+
text: e
|
|
1152
|
+
}]
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
url(e) {
|
|
1157
|
+
let t;
|
|
1158
|
+
if (t = this.rules.inline.url.exec(e)) {
|
|
1159
|
+
let e, n;
|
|
1160
|
+
if (t[2] === "@") e = t[0], n = "mailto:" + e;
|
|
1161
|
+
else {
|
|
1162
|
+
let r;
|
|
1163
|
+
do
|
|
1164
|
+
r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
|
|
1165
|
+
while (r !== t[0]);
|
|
1166
|
+
e = t[0], n = t[1] === "www." ? "http://" + t[0] : t[0];
|
|
1167
|
+
}
|
|
1168
|
+
return {
|
|
1169
|
+
type: "link",
|
|
1170
|
+
raw: t[0],
|
|
1171
|
+
text: e,
|
|
1172
|
+
href: n,
|
|
1173
|
+
tokens: [{
|
|
1174
|
+
type: "text",
|
|
1175
|
+
raw: e,
|
|
1176
|
+
text: e
|
|
1177
|
+
}]
|
|
1178
|
+
};
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
inlineText(e) {
|
|
1182
|
+
let t = this.rules.inline.text.exec(e);
|
|
1183
|
+
if (t) {
|
|
1184
|
+
let e = this.lexer.state.inRawBlock;
|
|
1185
|
+
return {
|
|
1186
|
+
type: "text",
|
|
1187
|
+
raw: t[0],
|
|
1188
|
+
text: t[0],
|
|
1189
|
+
escaped: e
|
|
1190
|
+
};
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
}, Y = class _Lexer {
|
|
1194
|
+
constructor(e) {
|
|
1195
|
+
_defineProperty(this, "tokens", void 0), _defineProperty(this, "options", void 0), _defineProperty(this, "state", void 0), _defineProperty(this, "tokenizer", void 0), _defineProperty(this, "inlineQueue", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = e || L, this.options.tokenizer = this.options.tokenizer || new _Tokenizer(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
1196
|
+
inLink: !1,
|
|
1197
|
+
inRawBlock: !1,
|
|
1198
|
+
top: !0
|
|
1199
|
+
};
|
|
1200
|
+
let t = {
|
|
1201
|
+
other: z,
|
|
1202
|
+
block: q.normal,
|
|
1203
|
+
inline: J.normal
|
|
1204
|
+
};
|
|
1205
|
+
this.options.pedantic ? (t.block = q.pedantic, t.inline = J.pedantic) : this.options.gfm && (t.block = q.gfm, this.options.breaks ? t.inline = J.breaks : t.inline = J.gfm), this.tokenizer.rules = t;
|
|
1206
|
+
}
|
|
1207
|
+
static get rules() {
|
|
1208
|
+
return {
|
|
1209
|
+
block: q,
|
|
1210
|
+
inline: J
|
|
1211
|
+
};
|
|
1212
|
+
}
|
|
1213
|
+
static lex(e, t) {
|
|
1214
|
+
return new _Lexer(t).lex(e);
|
|
1215
|
+
}
|
|
1216
|
+
static lexInline(e, t) {
|
|
1217
|
+
return new _Lexer(t).inlineTokens(e);
|
|
1218
|
+
}
|
|
1219
|
+
lex(e) {
|
|
1220
|
+
e = e.replace(z.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
|
|
1221
|
+
for (let e = 0; e < this.inlineQueue.length; e++) {
|
|
1222
|
+
let t = this.inlineQueue[e];
|
|
1223
|
+
this.inlineTokens(t.src, t.tokens);
|
|
1224
|
+
}
|
|
1225
|
+
return this.inlineQueue = [], this.tokens;
|
|
1226
|
+
}
|
|
1227
|
+
blockTokens(e, t = [], n = !1) {
|
|
1228
|
+
for (this.options.pedantic && (e = e.replace(z.tabCharGlobal, " ").replace(z.spaceLine, "")); e;) {
|
|
1229
|
+
let r;
|
|
1230
|
+
if (this.options.extensions?.block?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
|
|
1231
|
+
if (r = this.tokenizer.space(e)) {
|
|
1232
|
+
e = e.substring(r.raw.length);
|
|
1233
|
+
let n = t.at(-1);
|
|
1234
|
+
r.raw.length === 1 && n !== void 0 ? n.raw += "\n" : t.push(r);
|
|
1235
|
+
continue;
|
|
1236
|
+
}
|
|
1237
|
+
if (r = this.tokenizer.code(e)) {
|
|
1238
|
+
e = e.substring(r.raw.length);
|
|
1239
|
+
let n = t.at(-1);
|
|
1240
|
+
n?.type === "paragraph" || n?.type === "text" ? (n.raw += "\n" + r.raw, n.text += "\n" + r.text, this.inlineQueue.at(-1).src = n.text) : t.push(r);
|
|
1241
|
+
continue;
|
|
1242
|
+
}
|
|
1243
|
+
if (r = this.tokenizer.fences(e)) {
|
|
1244
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1245
|
+
continue;
|
|
1246
|
+
}
|
|
1247
|
+
if (r = this.tokenizer.heading(e)) {
|
|
1248
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1249
|
+
continue;
|
|
1250
|
+
}
|
|
1251
|
+
if (r = this.tokenizer.hr(e)) {
|
|
1252
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1253
|
+
continue;
|
|
1254
|
+
}
|
|
1255
|
+
if (r = this.tokenizer.blockquote(e)) {
|
|
1256
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1257
|
+
continue;
|
|
1258
|
+
}
|
|
1259
|
+
if (r = this.tokenizer.list(e)) {
|
|
1260
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1261
|
+
continue;
|
|
1262
|
+
}
|
|
1263
|
+
if (r = this.tokenizer.html(e)) {
|
|
1264
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1265
|
+
continue;
|
|
1266
|
+
}
|
|
1267
|
+
if (r = this.tokenizer.def(e)) {
|
|
1268
|
+
e = e.substring(r.raw.length);
|
|
1269
|
+
let n = t.at(-1);
|
|
1270
|
+
n?.type === "paragraph" || n?.type === "text" ? (n.raw += "\n" + r.raw, n.text += "\n" + r.raw, this.inlineQueue.at(-1).src = n.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
|
|
1271
|
+
href: r.href,
|
|
1272
|
+
title: r.title
|
|
1273
|
+
});
|
|
1274
|
+
continue;
|
|
1275
|
+
}
|
|
1276
|
+
if (r = this.tokenizer.table(e)) {
|
|
1277
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1278
|
+
continue;
|
|
1279
|
+
}
|
|
1280
|
+
if (r = this.tokenizer.lheading(e)) {
|
|
1281
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1282
|
+
continue;
|
|
1283
|
+
}
|
|
1284
|
+
let i = e;
|
|
1285
|
+
if (this.options.extensions?.startBlock) {
|
|
1286
|
+
let t = Infinity, n = e.slice(1), r;
|
|
1287
|
+
this.options.extensions.startBlock.forEach((e) => {
|
|
1288
|
+
r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
|
|
1289
|
+
}), t < Infinity && t >= 0 && (i = e.substring(0, t + 1));
|
|
1290
|
+
}
|
|
1291
|
+
if (this.state.top && (r = this.tokenizer.paragraph(i))) {
|
|
1292
|
+
let a = t.at(-1);
|
|
1293
|
+
n && a?.type === "paragraph" ? (a.raw += "\n" + r.raw, a.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
|
|
1294
|
+
continue;
|
|
1295
|
+
}
|
|
1296
|
+
if (r = this.tokenizer.text(e)) {
|
|
1297
|
+
e = e.substring(r.raw.length);
|
|
1298
|
+
let n = t.at(-1);
|
|
1299
|
+
n?.type === "text" ? (n.raw += "\n" + r.raw, n.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n.text) : t.push(r);
|
|
1300
|
+
continue;
|
|
1301
|
+
}
|
|
1302
|
+
if (e) {
|
|
1303
|
+
let t = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
1304
|
+
if (this.options.silent) {
|
|
1305
|
+
console.error(t);
|
|
1306
|
+
break;
|
|
1307
|
+
} else throw Error(t);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
return this.state.top = !0, t;
|
|
1311
|
+
}
|
|
1312
|
+
inline(e, t = []) {
|
|
1313
|
+
return this.inlineQueue.push({
|
|
1314
|
+
src: e,
|
|
1315
|
+
tokens: t
|
|
1316
|
+
}), t;
|
|
1317
|
+
}
|
|
1318
|
+
inlineTokens(e, t = []) {
|
|
1319
|
+
let n = e, r = null;
|
|
1320
|
+
if (this.tokens.links) {
|
|
1321
|
+
let e = Object.keys(this.tokens.links);
|
|
1322
|
+
if (e.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null;) e.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
1323
|
+
}
|
|
1324
|
+
for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null;) n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
1325
|
+
for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null;) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
1326
|
+
let i = !1, a = "";
|
|
1327
|
+
for (; e;) {
|
|
1328
|
+
i || (a = ""), i = !1;
|
|
1329
|
+
let r;
|
|
1330
|
+
if (this.options.extensions?.inline?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
|
|
1331
|
+
if (r = this.tokenizer.escape(e)) {
|
|
1332
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1333
|
+
continue;
|
|
1334
|
+
}
|
|
1335
|
+
if (r = this.tokenizer.tag(e)) {
|
|
1336
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1337
|
+
continue;
|
|
1338
|
+
}
|
|
1339
|
+
if (r = this.tokenizer.link(e)) {
|
|
1340
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1341
|
+
continue;
|
|
1342
|
+
}
|
|
1343
|
+
if (r = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
1344
|
+
e = e.substring(r.raw.length);
|
|
1345
|
+
let n = t.at(-1);
|
|
1346
|
+
r.type === "text" && n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
|
|
1347
|
+
continue;
|
|
1348
|
+
}
|
|
1349
|
+
if (r = this.tokenizer.emStrong(e, n, a)) {
|
|
1350
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1351
|
+
continue;
|
|
1352
|
+
}
|
|
1353
|
+
if (r = this.tokenizer.codespan(e)) {
|
|
1354
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1355
|
+
continue;
|
|
1356
|
+
}
|
|
1357
|
+
if (r = this.tokenizer.br(e)) {
|
|
1358
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1359
|
+
continue;
|
|
1360
|
+
}
|
|
1361
|
+
if (r = this.tokenizer.del(e)) {
|
|
1362
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1363
|
+
continue;
|
|
1364
|
+
}
|
|
1365
|
+
if (r = this.tokenizer.autolink(e)) {
|
|
1366
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1367
|
+
continue;
|
|
1368
|
+
}
|
|
1369
|
+
if (!this.state.inLink && (r = this.tokenizer.url(e))) {
|
|
1370
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
1371
|
+
continue;
|
|
1372
|
+
}
|
|
1373
|
+
let o = e;
|
|
1374
|
+
if (this.options.extensions?.startInline) {
|
|
1375
|
+
let t = Infinity, n = e.slice(1), r;
|
|
1376
|
+
this.options.extensions.startInline.forEach((e) => {
|
|
1377
|
+
r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
|
|
1378
|
+
}), t < Infinity && t >= 0 && (o = e.substring(0, t + 1));
|
|
1379
|
+
}
|
|
1380
|
+
if (r = this.tokenizer.inlineText(o)) {
|
|
1381
|
+
e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (a = r.raw.slice(-1)), i = !0;
|
|
1382
|
+
let n = t.at(-1);
|
|
1383
|
+
n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
|
|
1384
|
+
continue;
|
|
1385
|
+
}
|
|
1386
|
+
if (e) {
|
|
1387
|
+
let t = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
1388
|
+
if (this.options.silent) {
|
|
1389
|
+
console.error(t);
|
|
1390
|
+
break;
|
|
1391
|
+
} else throw Error(t);
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
return t;
|
|
1395
|
+
}
|
|
1396
|
+
}, _Renderer = class {
|
|
1397
|
+
constructor(e) {
|
|
1398
|
+
_defineProperty(this, "options", void 0), _defineProperty(this, "parser", void 0), this.options = e || L;
|
|
1399
|
+
}
|
|
1400
|
+
space(e) {
|
|
1401
|
+
return "";
|
|
1402
|
+
}
|
|
1403
|
+
code({ text: e, lang: t, escaped: n }) {
|
|
1404
|
+
let r = (t || "").match(z.notSpaceStart)?.[0], i = e.replace(z.endingNewline, "") + "\n";
|
|
1405
|
+
return r ? "<pre><code class=\"language-" + escape(r) + "\">" + (n ? i : escape(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : escape(i, !0)) + "</code></pre>\n";
|
|
1406
|
+
}
|
|
1407
|
+
blockquote({ tokens: e }) {
|
|
1408
|
+
return `<blockquote>\n${this.parser.parse(e)}</blockquote>\n`;
|
|
1409
|
+
}
|
|
1410
|
+
html({ text: e }) {
|
|
1411
|
+
return e;
|
|
1412
|
+
}
|
|
1413
|
+
heading({ tokens: e, depth: t }) {
|
|
1414
|
+
return `<h${t}>${this.parser.parseInline(e)}</h${t}>\n`;
|
|
1415
|
+
}
|
|
1416
|
+
hr(e) {
|
|
1417
|
+
return "<hr>\n";
|
|
1418
|
+
}
|
|
1419
|
+
list(e) {
|
|
1420
|
+
let t = e.ordered, n = e.start, r = "";
|
|
1421
|
+
for (let t = 0; t < e.items.length; t++) {
|
|
1422
|
+
let n = e.items[t];
|
|
1423
|
+
r += this.listitem(n);
|
|
1424
|
+
}
|
|
1425
|
+
let i = t ? "ol" : "ul", a = t && n !== 1 ? " start=\"" + n + "\"" : "";
|
|
1426
|
+
return "<" + i + a + ">\n" + r + "</" + i + ">\n";
|
|
1427
|
+
}
|
|
1428
|
+
listitem(e) {
|
|
1429
|
+
let t = "";
|
|
1430
|
+
if (e.task) {
|
|
1431
|
+
let n = this.checkbox({ checked: !!e.checked });
|
|
1432
|
+
e.loose ? e.tokens[0]?.type === "paragraph" ? (e.tokens[0].text = n + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = n + " " + escape(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = !0)) : e.tokens.unshift({
|
|
1433
|
+
type: "text",
|
|
1434
|
+
raw: n + " ",
|
|
1435
|
+
text: n + " ",
|
|
1436
|
+
escaped: !0
|
|
1437
|
+
}) : t += n + " ";
|
|
1438
|
+
}
|
|
1439
|
+
return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>\n`;
|
|
1440
|
+
}
|
|
1441
|
+
checkbox({ checked: e }) {
|
|
1442
|
+
return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\">";
|
|
1443
|
+
}
|
|
1444
|
+
paragraph({ tokens: e }) {
|
|
1445
|
+
return `<p>${this.parser.parseInline(e)}</p>\n`;
|
|
1446
|
+
}
|
|
1447
|
+
table(e) {
|
|
1448
|
+
let t = "", n = "";
|
|
1449
|
+
for (let t = 0; t < e.header.length; t++) n += this.tablecell(e.header[t]);
|
|
1450
|
+
t += this.tablerow({ text: n });
|
|
1451
|
+
let r = "";
|
|
1452
|
+
for (let t = 0; t < e.rows.length; t++) {
|
|
1453
|
+
let i = e.rows[t];
|
|
1454
|
+
n = "";
|
|
1455
|
+
for (let e = 0; e < i.length; e++) n += this.tablecell(i[e]);
|
|
1456
|
+
r += this.tablerow({ text: n });
|
|
1457
|
+
}
|
|
1458
|
+
return r && (r = `<tbody>${r}</tbody>`), "<table>\n<thead>\n" + t + "</thead>\n" + r + "</table>\n";
|
|
1459
|
+
}
|
|
1460
|
+
tablerow({ text: e }) {
|
|
1461
|
+
return `<tr>\n${e}</tr>\n`;
|
|
1462
|
+
}
|
|
1463
|
+
tablecell(e) {
|
|
1464
|
+
let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
|
|
1465
|
+
return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>\n`;
|
|
1466
|
+
}
|
|
1467
|
+
strong({ tokens: e }) {
|
|
1468
|
+
return `<strong>${this.parser.parseInline(e)}</strong>`;
|
|
1469
|
+
}
|
|
1470
|
+
em({ tokens: e }) {
|
|
1471
|
+
return `<em>${this.parser.parseInline(e)}</em>`;
|
|
1472
|
+
}
|
|
1473
|
+
codespan({ text: e }) {
|
|
1474
|
+
return `<code>${escape(e, !0)}</code>`;
|
|
1475
|
+
}
|
|
1476
|
+
br(e) {
|
|
1477
|
+
return "<br>";
|
|
1478
|
+
}
|
|
1479
|
+
del({ tokens: e }) {
|
|
1480
|
+
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
1481
|
+
}
|
|
1482
|
+
link({ href: e, title: t, tokens: n }) {
|
|
1483
|
+
let r = this.parser.parseInline(n), i = cleanUrl(e);
|
|
1484
|
+
if (i === null) return r;
|
|
1485
|
+
e = i;
|
|
1486
|
+
let a = "<a href=\"" + e + "\"";
|
|
1487
|
+
return t && (a += " title=\"" + escape(t) + "\""), a += ">" + r + "</a>", a;
|
|
1488
|
+
}
|
|
1489
|
+
image({ href: e, title: t, text: n }) {
|
|
1490
|
+
let r = cleanUrl(e);
|
|
1491
|
+
if (r === null) return escape(n);
|
|
1492
|
+
e = r;
|
|
1493
|
+
let i = `<img src="${e}" alt="${n}"`;
|
|
1494
|
+
return t && (i += ` title="${escape(t)}"`), i += ">", i;
|
|
1495
|
+
}
|
|
1496
|
+
text(e) {
|
|
1497
|
+
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : escape(e.text);
|
|
1498
|
+
}
|
|
1499
|
+
}, _TextRenderer = class {
|
|
1500
|
+
strong({ text: e }) {
|
|
1501
|
+
return e;
|
|
1502
|
+
}
|
|
1503
|
+
em({ text: e }) {
|
|
1504
|
+
return e;
|
|
1505
|
+
}
|
|
1506
|
+
codespan({ text: e }) {
|
|
1507
|
+
return e;
|
|
1508
|
+
}
|
|
1509
|
+
del({ text: e }) {
|
|
1510
|
+
return e;
|
|
1511
|
+
}
|
|
1512
|
+
html({ text: e }) {
|
|
1513
|
+
return e;
|
|
1514
|
+
}
|
|
1515
|
+
text({ text: e }) {
|
|
1516
|
+
return e;
|
|
1517
|
+
}
|
|
1518
|
+
link({ text: e }) {
|
|
1519
|
+
return "" + e;
|
|
1520
|
+
}
|
|
1521
|
+
image({ text: e }) {
|
|
1522
|
+
return "" + e;
|
|
1523
|
+
}
|
|
1524
|
+
br() {
|
|
1525
|
+
return "";
|
|
1526
|
+
}
|
|
1527
|
+
}, X = class _Parser {
|
|
1528
|
+
constructor(e) {
|
|
1529
|
+
_defineProperty(this, "options", void 0), _defineProperty(this, "renderer", void 0), _defineProperty(this, "textRenderer", void 0), this.options = e || L, this.options.renderer = this.options.renderer || new _Renderer(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new _TextRenderer();
|
|
1530
|
+
}
|
|
1531
|
+
static parse(e, t) {
|
|
1532
|
+
return new _Parser(t).parse(e);
|
|
1533
|
+
}
|
|
1534
|
+
static parseInline(e, t) {
|
|
1535
|
+
return new _Parser(t).parseInline(e);
|
|
1536
|
+
}
|
|
1537
|
+
parse(e, t = !0) {
|
|
1538
|
+
let n = "";
|
|
1539
|
+
for (let r = 0; r < e.length; r++) {
|
|
1540
|
+
let i = e[r];
|
|
1541
|
+
if (this.options.extensions?.renderers?.[i.type]) {
|
|
1542
|
+
let e = i, t = this.options.extensions.renderers[e.type].call({ parser: this }, e);
|
|
1543
|
+
if (t !== !1 || ![
|
|
1544
|
+
"space",
|
|
1545
|
+
"hr",
|
|
1546
|
+
"heading",
|
|
1547
|
+
"code",
|
|
1548
|
+
"table",
|
|
1549
|
+
"blockquote",
|
|
1550
|
+
"list",
|
|
1551
|
+
"html",
|
|
1552
|
+
"paragraph",
|
|
1553
|
+
"text"
|
|
1554
|
+
].includes(e.type)) {
|
|
1555
|
+
n += t || "";
|
|
1556
|
+
continue;
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
let a = i;
|
|
1560
|
+
switch (a.type) {
|
|
1561
|
+
case "space":
|
|
1562
|
+
n += this.renderer.space(a);
|
|
1563
|
+
continue;
|
|
1564
|
+
case "hr":
|
|
1565
|
+
n += this.renderer.hr(a);
|
|
1566
|
+
continue;
|
|
1567
|
+
case "heading":
|
|
1568
|
+
n += this.renderer.heading(a);
|
|
1569
|
+
continue;
|
|
1570
|
+
case "code":
|
|
1571
|
+
n += this.renderer.code(a);
|
|
1572
|
+
continue;
|
|
1573
|
+
case "table":
|
|
1574
|
+
n += this.renderer.table(a);
|
|
1575
|
+
continue;
|
|
1576
|
+
case "blockquote":
|
|
1577
|
+
n += this.renderer.blockquote(a);
|
|
1578
|
+
continue;
|
|
1579
|
+
case "list":
|
|
1580
|
+
n += this.renderer.list(a);
|
|
1581
|
+
continue;
|
|
1582
|
+
case "html":
|
|
1583
|
+
n += this.renderer.html(a);
|
|
1584
|
+
continue;
|
|
1585
|
+
case "paragraph":
|
|
1586
|
+
n += this.renderer.paragraph(a);
|
|
1587
|
+
continue;
|
|
1588
|
+
case "text": {
|
|
1589
|
+
let i = a, o = this.renderer.text(i);
|
|
1590
|
+
for (; r + 1 < e.length && e[r + 1].type === "text";) i = e[++r], o += "\n" + this.renderer.text(i);
|
|
1591
|
+
t ? n += this.renderer.paragraph({
|
|
1592
|
+
type: "paragraph",
|
|
1593
|
+
raw: o,
|
|
1594
|
+
text: o,
|
|
1595
|
+
tokens: [{
|
|
1596
|
+
type: "text",
|
|
1597
|
+
raw: o,
|
|
1598
|
+
text: o,
|
|
1599
|
+
escaped: !0
|
|
1600
|
+
}]
|
|
1601
|
+
}) : n += o;
|
|
1602
|
+
continue;
|
|
1603
|
+
}
|
|
1604
|
+
default: {
|
|
1605
|
+
let e = "Token with \"" + a.type + "\" type was not found.";
|
|
1606
|
+
if (this.options.silent) return console.error(e), "";
|
|
1607
|
+
throw Error(e);
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
return n;
|
|
1612
|
+
}
|
|
1613
|
+
parseInline(e, t = this.renderer) {
|
|
1614
|
+
let n = "";
|
|
1615
|
+
for (let r = 0; r < e.length; r++) {
|
|
1616
|
+
let i = e[r];
|
|
1617
|
+
if (this.options.extensions?.renderers?.[i.type]) {
|
|
1618
|
+
let e = this.options.extensions.renderers[i.type].call({ parser: this }, i);
|
|
1619
|
+
if (e !== !1 || ![
|
|
1620
|
+
"escape",
|
|
1621
|
+
"html",
|
|
1622
|
+
"link",
|
|
1623
|
+
"image",
|
|
1624
|
+
"strong",
|
|
1625
|
+
"em",
|
|
1626
|
+
"codespan",
|
|
1627
|
+
"br",
|
|
1628
|
+
"del",
|
|
1629
|
+
"text"
|
|
1630
|
+
].includes(i.type)) {
|
|
1631
|
+
n += e || "";
|
|
1632
|
+
continue;
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
let a = i;
|
|
1636
|
+
switch (a.type) {
|
|
1637
|
+
case "escape":
|
|
1638
|
+
n += t.text(a);
|
|
1639
|
+
break;
|
|
1640
|
+
case "html":
|
|
1641
|
+
n += t.html(a);
|
|
1642
|
+
break;
|
|
1643
|
+
case "link":
|
|
1644
|
+
n += t.link(a);
|
|
1645
|
+
break;
|
|
1646
|
+
case "image":
|
|
1647
|
+
n += t.image(a);
|
|
1648
|
+
break;
|
|
1649
|
+
case "strong":
|
|
1650
|
+
n += t.strong(a);
|
|
1651
|
+
break;
|
|
1652
|
+
case "em":
|
|
1653
|
+
n += t.em(a);
|
|
1654
|
+
break;
|
|
1655
|
+
case "codespan":
|
|
1656
|
+
n += t.codespan(a);
|
|
1657
|
+
break;
|
|
1658
|
+
case "br":
|
|
1659
|
+
n += t.br(a);
|
|
1660
|
+
break;
|
|
1661
|
+
case "del":
|
|
1662
|
+
n += t.del(a);
|
|
1663
|
+
break;
|
|
1664
|
+
case "text":
|
|
1665
|
+
n += t.text(a);
|
|
1666
|
+
break;
|
|
1667
|
+
default: {
|
|
1668
|
+
let e = "Token with \"" + a.type + "\" type was not found.";
|
|
1669
|
+
if (this.options.silent) return console.error(e), "";
|
|
1670
|
+
throw Error(e);
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
return n;
|
|
1675
|
+
}
|
|
1676
|
+
}, _Hooks = class {
|
|
1677
|
+
constructor(e) {
|
|
1678
|
+
_defineProperty(this, "options", void 0), _defineProperty(this, "block", void 0), this.options = e || L;
|
|
1679
|
+
}
|
|
1680
|
+
preprocess(e) {
|
|
1681
|
+
return e;
|
|
1682
|
+
}
|
|
1683
|
+
postprocess(e) {
|
|
1684
|
+
return e;
|
|
1685
|
+
}
|
|
1686
|
+
processAllTokens(e) {
|
|
1687
|
+
return e;
|
|
1688
|
+
}
|
|
1689
|
+
provideLexer() {
|
|
1690
|
+
return this.block ? Y.lex : Y.lexInline;
|
|
1691
|
+
}
|
|
1692
|
+
provideParser() {
|
|
1693
|
+
return this.block ? X.parse : X.parseInline;
|
|
1694
|
+
}
|
|
1695
|
+
};
|
|
1696
|
+
_defineProperty(_Hooks, "passThroughHooks", new Set([
|
|
1697
|
+
"preprocess",
|
|
1698
|
+
"postprocess",
|
|
1699
|
+
"processAllTokens"
|
|
1700
|
+
]));
|
|
1701
|
+
var Marked = class {
|
|
1702
|
+
constructor(...e) {
|
|
1703
|
+
_defineProperty(this, "defaults", _getDefaults()), _defineProperty(this, "options", this.setOptions), _defineProperty(this, "parse", this.parseMarkdown(!0)), _defineProperty(this, "parseInline", this.parseMarkdown(!1)), _defineProperty(this, "Parser", X), _defineProperty(this, "Renderer", _Renderer), _defineProperty(this, "TextRenderer", _TextRenderer), _defineProperty(this, "Lexer", Y), _defineProperty(this, "Tokenizer", _Tokenizer), _defineProperty(this, "Hooks", _Hooks), this.use(...e);
|
|
1704
|
+
}
|
|
1705
|
+
walkTokens(e, t) {
|
|
1706
|
+
let n = [];
|
|
1707
|
+
for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
|
|
1708
|
+
case "table": {
|
|
1709
|
+
let e = r;
|
|
1710
|
+
for (let r of e.header) n = n.concat(this.walkTokens(r.tokens, t));
|
|
1711
|
+
for (let r of e.rows) for (let e of r) n = n.concat(this.walkTokens(e.tokens, t));
|
|
1712
|
+
break;
|
|
1713
|
+
}
|
|
1714
|
+
case "list": {
|
|
1715
|
+
let e = r;
|
|
1716
|
+
n = n.concat(this.walkTokens(e.items, t));
|
|
1717
|
+
break;
|
|
1718
|
+
}
|
|
1719
|
+
default: {
|
|
1720
|
+
let e = r;
|
|
1721
|
+
this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
|
|
1722
|
+
let i = e[r].flat(Infinity);
|
|
1723
|
+
n = n.concat(this.walkTokens(i, t));
|
|
1724
|
+
}) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
return n;
|
|
1728
|
+
}
|
|
1729
|
+
use(...e) {
|
|
1730
|
+
let t = this.defaults.extensions || {
|
|
1731
|
+
renderers: {},
|
|
1732
|
+
childTokens: {}
|
|
1733
|
+
};
|
|
1734
|
+
return e.forEach((e) => {
|
|
1735
|
+
let n = { ...e };
|
|
1736
|
+
if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e) => {
|
|
1737
|
+
if (!e.name) throw Error("extension name required");
|
|
1738
|
+
if ("renderer" in e) {
|
|
1739
|
+
let n = t.renderers[e.name];
|
|
1740
|
+
n ? t.renderers[e.name] = function(...t) {
|
|
1741
|
+
let r = e.renderer.apply(this, t);
|
|
1742
|
+
return r === !1 && (r = n.apply(this, t)), r;
|
|
1743
|
+
} : t.renderers[e.name] = e.renderer;
|
|
1744
|
+
}
|
|
1745
|
+
if ("tokenizer" in e) {
|
|
1746
|
+
if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
|
|
1747
|
+
let n = t[e.level];
|
|
1748
|
+
n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && (e.level === "block" ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : e.level === "inline" && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start]));
|
|
1749
|
+
}
|
|
1750
|
+
"childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
|
|
1751
|
+
}), n.extensions = t), e.renderer) {
|
|
1752
|
+
let t = this.defaults.renderer || new _Renderer(this.defaults);
|
|
1753
|
+
for (let n in e.renderer) {
|
|
1754
|
+
if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
|
|
1755
|
+
if (["options", "parser"].includes(n)) continue;
|
|
1756
|
+
let r = n, i = e.renderer[r], a = t[r];
|
|
1757
|
+
t[r] = (...e) => {
|
|
1758
|
+
let n = i.apply(t, e);
|
|
1759
|
+
return n === !1 && (n = a.apply(t, e)), n || "";
|
|
1760
|
+
};
|
|
1761
|
+
}
|
|
1762
|
+
n.renderer = t;
|
|
1763
|
+
}
|
|
1764
|
+
if (e.tokenizer) {
|
|
1765
|
+
let t = this.defaults.tokenizer || new _Tokenizer(this.defaults);
|
|
1766
|
+
for (let n in e.tokenizer) {
|
|
1767
|
+
if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
|
|
1768
|
+
if ([
|
|
1769
|
+
"options",
|
|
1770
|
+
"rules",
|
|
1771
|
+
"lexer"
|
|
1772
|
+
].includes(n)) continue;
|
|
1773
|
+
let r = n, i = e.tokenizer[r], a = t[r];
|
|
1774
|
+
t[r] = (...e) => {
|
|
1775
|
+
let n = i.apply(t, e);
|
|
1776
|
+
return n === !1 && (n = a.apply(t, e)), n;
|
|
1777
|
+
};
|
|
1778
|
+
}
|
|
1779
|
+
n.tokenizer = t;
|
|
1780
|
+
}
|
|
1781
|
+
if (e.hooks) {
|
|
1782
|
+
let t = this.defaults.hooks || new _Hooks();
|
|
1783
|
+
for (let n in e.hooks) {
|
|
1784
|
+
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
1785
|
+
if (["options", "block"].includes(n)) continue;
|
|
1786
|
+
let r = n, i = e.hooks[r], a = t[r];
|
|
1787
|
+
_Hooks.passThroughHooks.has(n) ? t[r] = (e) => {
|
|
1788
|
+
if (this.defaults.async) return Promise.resolve(i.call(t, e)).then((e) => a.call(t, e));
|
|
1789
|
+
let n = i.call(t, e);
|
|
1790
|
+
return a.call(t, n);
|
|
1791
|
+
} : t[r] = (...e) => {
|
|
1792
|
+
let n = i.apply(t, e);
|
|
1793
|
+
return n === !1 && (n = a.apply(t, e)), n;
|
|
1794
|
+
};
|
|
1795
|
+
}
|
|
1796
|
+
n.hooks = t;
|
|
1797
|
+
}
|
|
1798
|
+
if (e.walkTokens) {
|
|
1799
|
+
let t = this.defaults.walkTokens, r = e.walkTokens;
|
|
1800
|
+
n.walkTokens = function(e) {
|
|
1801
|
+
let n = [];
|
|
1802
|
+
return n.push(r.call(this, e)), t && (n = n.concat(t.call(this, e))), n;
|
|
1803
|
+
};
|
|
1804
|
+
}
|
|
1805
|
+
this.defaults = {
|
|
1806
|
+
...this.defaults,
|
|
1807
|
+
...n
|
|
1808
|
+
};
|
|
1809
|
+
}), this;
|
|
1810
|
+
}
|
|
1811
|
+
setOptions(e) {
|
|
1812
|
+
return this.defaults = {
|
|
1813
|
+
...this.defaults,
|
|
1814
|
+
...e
|
|
1815
|
+
}, this;
|
|
1816
|
+
}
|
|
1817
|
+
lexer(e, t) {
|
|
1818
|
+
return Y.lex(e, t ?? this.defaults);
|
|
1819
|
+
}
|
|
1820
|
+
parser(e, t) {
|
|
1821
|
+
return X.parse(e, t ?? this.defaults);
|
|
1822
|
+
}
|
|
1823
|
+
parseMarkdown(e) {
|
|
1824
|
+
let parse = (t, n) => {
|
|
1825
|
+
let r = { ...n }, i = {
|
|
1826
|
+
...this.defaults,
|
|
1827
|
+
...r
|
|
1828
|
+
}, a = this.onError(!!i.silent, !!i.async);
|
|
1829
|
+
if (this.defaults.async === !0 && r.async === !1) return a(/* @__PURE__ */ Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
1830
|
+
if (t == null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
|
|
1831
|
+
if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
|
|
1832
|
+
i.hooks && (i.hooks.options = i, i.hooks.block = e);
|
|
1833
|
+
let o = i.hooks ? i.hooks.provideLexer() : e ? Y.lex : Y.lexInline, s = i.hooks ? i.hooks.provideParser() : e ? X.parse : X.parseInline;
|
|
1834
|
+
if (i.async) return Promise.resolve(i.hooks ? i.hooks.preprocess(t) : t).then((e) => o(e, i)).then((e) => i.hooks ? i.hooks.processAllTokens(e) : e).then((e) => i.walkTokens ? Promise.all(this.walkTokens(e, i.walkTokens)).then(() => e) : e).then((e) => s(e, i)).then((e) => i.hooks ? i.hooks.postprocess(e) : e).catch(a);
|
|
1835
|
+
try {
|
|
1836
|
+
i.hooks && (t = i.hooks.preprocess(t));
|
|
1837
|
+
let e = o(t, i);
|
|
1838
|
+
i.hooks && (e = i.hooks.processAllTokens(e)), i.walkTokens && this.walkTokens(e, i.walkTokens);
|
|
1839
|
+
let n = s(e, i);
|
|
1840
|
+
return i.hooks && (n = i.hooks.postprocess(n)), n;
|
|
1841
|
+
} catch (e) {
|
|
1842
|
+
return a(e);
|
|
1843
|
+
}
|
|
1844
|
+
};
|
|
1845
|
+
return parse;
|
|
1846
|
+
}
|
|
1847
|
+
onError(e, t) {
|
|
1848
|
+
return (n) => {
|
|
1849
|
+
if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
|
|
1850
|
+
let e = "<p>An error occurred:</p><pre>" + escape(n.message + "", !0) + "</pre>";
|
|
1851
|
+
return t ? Promise.resolve(e) : e;
|
|
1852
|
+
}
|
|
1853
|
+
if (t) return Promise.reject(n);
|
|
1854
|
+
throw n;
|
|
1855
|
+
};
|
|
1856
|
+
}
|
|
1857
|
+
}, Z = new Marked();
|
|
1858
|
+
function marked(e, t) {
|
|
1859
|
+
return Z.parse(e, t);
|
|
1860
|
+
}
|
|
1861
|
+
marked.options = marked.setOptions = function(e) {
|
|
1862
|
+
return Z.setOptions(e), marked.defaults = Z.defaults, changeDefaults(marked.defaults), marked;
|
|
1863
|
+
}, marked.getDefaults = _getDefaults, marked.defaults = L, marked.use = function(...e) {
|
|
1864
|
+
return Z.use(...e), marked.defaults = Z.defaults, changeDefaults(marked.defaults), marked;
|
|
1865
|
+
}, marked.walkTokens = function(e, t) {
|
|
1866
|
+
return Z.walkTokens(e, t);
|
|
1867
|
+
}, marked.parseInline = Z.parseInline, marked.Parser = X, marked.parser = X.parse, marked.Renderer = _Renderer, marked.TextRenderer = _TextRenderer, marked.Lexer = Y, marked.lexer = Y.lex, marked.Tokenizer = _Tokenizer, marked.Hooks = _Hooks, marked.parse = marked, marked.options, marked.setOptions, marked.use, marked.walkTokens, marked.parseInline, X.parse;
|
|
1868
|
+
var ct = Y.lex;
|
|
1869
|
+
//#endregion
|
|
1870
|
+
//#region src/components/cardRendering/MarkdownRendererHelpers.ts
|
|
1871
|
+
function splitByDelimiters(e, t, n) {
|
|
1872
|
+
if (e.length === 0) return [];
|
|
1873
|
+
let r = [], i = e.indexOf(t), a = e.indexOf(n, i);
|
|
1874
|
+
if (i >= 0 && a > i) r.push(e.substring(0, i)), r.push(e.substring(i, a + n.length)), r = r.concat(splitByDelimiters(e.substring(a + n.length), t, n));
|
|
1875
|
+
else return [e];
|
|
1876
|
+
return r;
|
|
1877
|
+
}
|
|
1878
|
+
function splitTextToken(e) {
|
|
1879
|
+
if (containsComponent(e)) {
|
|
1880
|
+
let t = splitByDelimiters(e.text, "{{", "}}"), n = splitByDelimiters(e.raw, "{{", "}}");
|
|
1881
|
+
if (t.length === n.length) return t.map((e, r) => ({
|
|
1882
|
+
type: "text",
|
|
1883
|
+
text: t[r],
|
|
1884
|
+
raw: n[r]
|
|
1885
|
+
}));
|
|
1886
|
+
throw Error("Error parsing markdown");
|
|
1887
|
+
} else return [e];
|
|
1888
|
+
}
|
|
1889
|
+
function splitParagraphToken(e) {
|
|
1890
|
+
let t = [];
|
|
1891
|
+
if (containsComponent(e)) {
|
|
1892
|
+
let n = splitByDelimiters(e.text, "{{", "}}"), r = splitByDelimiters(e.raw, "{{", "}}");
|
|
1893
|
+
if (n.length === r.length) {
|
|
1894
|
+
for (let e = 0; e < n.length; e++) {
|
|
1895
|
+
let i = {
|
|
1896
|
+
type: "text",
|
|
1897
|
+
text: n[e],
|
|
1898
|
+
raw: r[e]
|
|
1899
|
+
};
|
|
1900
|
+
isComponent(i) ? t.push(i) : ct(r[e]).forEach((e) => {
|
|
1901
|
+
e.type === "paragraph" ? t = t.concat(e.tokens) : t.push(e);
|
|
1902
|
+
});
|
|
1903
|
+
}
|
|
1904
|
+
return t;
|
|
1905
|
+
} else throw Error("Error parsing Markdown");
|
|
1906
|
+
} else t.push(e);
|
|
1907
|
+
return t;
|
|
1908
|
+
}
|
|
1909
|
+
function containsComponent(e) {
|
|
1910
|
+
if (e.type === "text" || e.type === "paragraph") {
|
|
1911
|
+
let t = e.raw.indexOf("{{"), n = e.raw.indexOf("}}");
|
|
1912
|
+
return t !== -1 && n !== -1 && n > t;
|
|
1913
|
+
} else return !1;
|
|
1914
|
+
}
|
|
1915
|
+
function isComponent(e) {
|
|
1916
|
+
return e.type === "text" && e.text.startsWith("{{") && e.text.endsWith("}}");
|
|
1917
|
+
}
|
|
1918
|
+
function parseComponentSyntax(e) {
|
|
1919
|
+
if (e.length > 1e4) return null;
|
|
1920
|
+
let t = e.match(/^\{\{\s*<([\w-]+)((?:\s+[\w-]+="[^"]*")*)\s*\/>\s*\}\}$/);
|
|
1921
|
+
if (!t) return null;
|
|
1922
|
+
let n = t[1], r = t[2], i = {};
|
|
1923
|
+
if (r) {
|
|
1924
|
+
let e = /\s+([\w-]+)="([^"]*)"/g, t;
|
|
1925
|
+
for (; (t = e.exec(r)) !== null;) i[t[1]] = t[2];
|
|
1926
|
+
}
|
|
1927
|
+
return {
|
|
1928
|
+
componentName: n,
|
|
1929
|
+
props: i
|
|
1930
|
+
};
|
|
1931
|
+
}
|
|
1932
|
+
function isInlineComponent(e) {
|
|
1933
|
+
if (e.length > 1e4) return !1;
|
|
1934
|
+
let t = e.trim();
|
|
1935
|
+
return /^<[\w-]+(?:\s+[\w-]+="[^"]*")*\s*\/?>$/.test(t);
|
|
1936
|
+
}
|
|
1937
|
+
function parseComponentToken(e) {
|
|
1938
|
+
return parseComponentSyntax("text" in e ? e.text : "raw" in e ? e.raw : "");
|
|
1939
|
+
}
|
|
1940
|
+
//#endregion
|
|
1941
|
+
//#region src/components/cardRendering/AudioAutoPlayer.vue?vue&type=script&setup=true&lang.ts
|
|
1942
|
+
var lt = 500, ut = /* @__PURE__ */ F(/* @__PURE__ */ c({
|
|
1943
|
+
__name: "AudioAutoPlayer",
|
|
1944
|
+
props: { src: {} },
|
|
1945
|
+
setup(e) {
|
|
1946
|
+
let t = e, r = v([]), i = v([]), a = v(!1), c = null, stop = () => {
|
|
1947
|
+
a.value = !1, setTimeout(() => {
|
|
1948
|
+
c = null;
|
|
1949
|
+
}, lt), i.value.forEach(clearTimeout), console.log("Audio stopping..."), r.value.forEach((e) => {
|
|
1950
|
+
e.paused || (e.pause(), e.currentTime = 0);
|
|
1951
|
+
});
|
|
1952
|
+
}, downloadFinished = (e) => {
|
|
1953
|
+
try {
|
|
1954
|
+
return !isNaN(r.value[e].duration);
|
|
1955
|
+
} catch (e) {
|
|
1956
|
+
throw Error("AudioPlayer does not have an element at this index:", e);
|
|
1957
|
+
}
|
|
1958
|
+
}, playByIndex = (e) => {
|
|
1959
|
+
if (downloadFinished(e)) if (r.value[e].play(), e + 1 < r.value.length) {
|
|
1960
|
+
let t = (r.value[e].duration + .7) * 1e3;
|
|
1961
|
+
i.value.push(setTimeout(() => {
|
|
1962
|
+
a.value && playByIndex(e + 1);
|
|
1963
|
+
}, t));
|
|
1964
|
+
} else setTimeout(() => {
|
|
1965
|
+
a.value = !1;
|
|
1966
|
+
}, r.value[e].duration * 1e3), setTimeout(() => {
|
|
1967
|
+
c = null;
|
|
1968
|
+
}, r.value[e].duration * 1e3 + lt);
|
|
1969
|
+
else setTimeout(playByIndex, 100, e);
|
|
1970
|
+
}, play = () => {
|
|
1971
|
+
c === null || c === l() ? (c = l(), a.value = !0, playByIndex(0)) : setTimeout(play, 100);
|
|
1972
|
+
};
|
|
1973
|
+
return g(() => {
|
|
1974
|
+
c = null, typeof t.src == "string" ? r.value.push(new Audio(t.src)) : t.src.forEach((e) => {
|
|
1975
|
+
r.value.push(new Audio(e));
|
|
1976
|
+
});
|
|
1977
|
+
let e = [{
|
|
1978
|
+
hotkey: "up",
|
|
1979
|
+
callback: play,
|
|
1980
|
+
command: "Replay Audio"
|
|
1981
|
+
}];
|
|
1982
|
+
I.addBinding(e), play();
|
|
1983
|
+
}), h(() => {
|
|
1984
|
+
I.removeBinding("up"), stop();
|
|
1985
|
+
}), (e, t) => {
|
|
1986
|
+
let r = b("v-icon"), i = b("v-btn");
|
|
1987
|
+
return _(), n(i, {
|
|
1988
|
+
size: "large",
|
|
1989
|
+
icon: "",
|
|
1990
|
+
color: a.value ? "primary lighten-3" : "primary",
|
|
1991
|
+
class: m({ playing: a.value }),
|
|
1992
|
+
onClick: play
|
|
1993
|
+
}, {
|
|
1994
|
+
default: T(() => [s(r, null, {
|
|
1995
|
+
default: T(() => t[0] || (t[0] = [o("mdi-volume-high")])),
|
|
1996
|
+
_: 1
|
|
1997
|
+
})]),
|
|
1998
|
+
_: 1
|
|
1999
|
+
}, 8, ["color", "class"]);
|
|
2000
|
+
};
|
|
2001
|
+
}
|
|
2002
|
+
}), [["__scopeId", "data-v-e1a0f62c"]]), Q = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((e, t) => {
|
|
2003
|
+
function deepFreeze(e) {
|
|
2004
|
+
return e instanceof Map ? e.clear = e.delete = e.set = function() {
|
|
2005
|
+
throw Error("map is read-only");
|
|
2006
|
+
} : e instanceof Set && (e.add = e.clear = e.delete = function() {
|
|
2007
|
+
throw Error("set is read-only");
|
|
2008
|
+
}), Object.freeze(e), Object.getOwnPropertyNames(e).forEach((t) => {
|
|
2009
|
+
let n = e[t], r = typeof n;
|
|
2010
|
+
(r === "object" || r === "function") && !Object.isFrozen(n) && deepFreeze(n);
|
|
2011
|
+
}), e;
|
|
2012
|
+
}
|
|
2013
|
+
var Response = class {
|
|
2014
|
+
constructor(e) {
|
|
2015
|
+
e.data === void 0 && (e.data = {}), this.data = e.data, this.isMatchIgnored = !1;
|
|
2016
|
+
}
|
|
2017
|
+
ignoreMatch() {
|
|
2018
|
+
this.isMatchIgnored = !0;
|
|
2019
|
+
}
|
|
2020
|
+
};
|
|
2021
|
+
function escapeHTML(e) {
|
|
2022
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2023
|
+
}
|
|
2024
|
+
function inherit$1(e, ...t) {
|
|
2025
|
+
let n = Object.create(null);
|
|
2026
|
+
for (let t in e) n[t] = e[t];
|
|
2027
|
+
return t.forEach(function(e) {
|
|
2028
|
+
for (let t in e) n[t] = e[t];
|
|
2029
|
+
}), n;
|
|
2030
|
+
}
|
|
2031
|
+
var n = "</span>", emitsWrappingTags = (e) => !!e.scope, scopeToCSSClass = (e, { prefix: t }) => {
|
|
2032
|
+
if (e.startsWith("language:")) return e.replace("language:", "language-");
|
|
2033
|
+
if (e.includes(".")) {
|
|
2034
|
+
let n = e.split(".");
|
|
2035
|
+
return [`${t}${n.shift()}`, ...n.map((e, t) => `${e}${"_".repeat(t + 1)}`)].join(" ");
|
|
2036
|
+
}
|
|
2037
|
+
return `${t}${e}`;
|
|
2038
|
+
}, HTMLRenderer = class {
|
|
2039
|
+
constructor(e, t) {
|
|
2040
|
+
this.buffer = "", this.classPrefix = t.classPrefix, e.walk(this);
|
|
2041
|
+
}
|
|
2042
|
+
addText(e) {
|
|
2043
|
+
this.buffer += escapeHTML(e);
|
|
2044
|
+
}
|
|
2045
|
+
openNode(e) {
|
|
2046
|
+
if (!emitsWrappingTags(e)) return;
|
|
2047
|
+
let t = scopeToCSSClass(e.scope, { prefix: this.classPrefix });
|
|
2048
|
+
this.span(t);
|
|
2049
|
+
}
|
|
2050
|
+
closeNode(e) {
|
|
2051
|
+
emitsWrappingTags(e) && (this.buffer += n);
|
|
2052
|
+
}
|
|
2053
|
+
value() {
|
|
2054
|
+
return this.buffer;
|
|
2055
|
+
}
|
|
2056
|
+
span(e) {
|
|
2057
|
+
this.buffer += `<span class="${e}">`;
|
|
2058
|
+
}
|
|
2059
|
+
}, newNode = (e = {}) => {
|
|
2060
|
+
let t = { children: [] };
|
|
2061
|
+
return Object.assign(t, e), t;
|
|
2062
|
+
}, r = class TokenTree {
|
|
2063
|
+
constructor() {
|
|
2064
|
+
this.rootNode = newNode(), this.stack = [this.rootNode];
|
|
2065
|
+
}
|
|
2066
|
+
get top() {
|
|
2067
|
+
return this.stack[this.stack.length - 1];
|
|
2068
|
+
}
|
|
2069
|
+
get root() {
|
|
2070
|
+
return this.rootNode;
|
|
2071
|
+
}
|
|
2072
|
+
add(e) {
|
|
2073
|
+
this.top.children.push(e);
|
|
2074
|
+
}
|
|
2075
|
+
openNode(e) {
|
|
2076
|
+
let t = newNode({ scope: e });
|
|
2077
|
+
this.add(t), this.stack.push(t);
|
|
2078
|
+
}
|
|
2079
|
+
closeNode() {
|
|
2080
|
+
if (this.stack.length > 1) return this.stack.pop();
|
|
2081
|
+
}
|
|
2082
|
+
closeAllNodes() {
|
|
2083
|
+
for (; this.closeNode(););
|
|
2084
|
+
}
|
|
2085
|
+
toJSON() {
|
|
2086
|
+
return JSON.stringify(this.rootNode, null, 4);
|
|
2087
|
+
}
|
|
2088
|
+
walk(e) {
|
|
2089
|
+
return this.constructor._walk(e, this.rootNode);
|
|
2090
|
+
}
|
|
2091
|
+
static _walk(e, t) {
|
|
2092
|
+
return typeof t == "string" ? e.addText(t) : t.children && (e.openNode(t), t.children.forEach((t) => this._walk(e, t)), e.closeNode(t)), e;
|
|
2093
|
+
}
|
|
2094
|
+
static _collapse(e) {
|
|
2095
|
+
typeof e != "string" && e.children && (e.children.every((e) => typeof e == "string") ? e.children = [e.children.join("")] : e.children.forEach((e) => {
|
|
2096
|
+
TokenTree._collapse(e);
|
|
2097
|
+
}));
|
|
2098
|
+
}
|
|
2099
|
+
}, TokenTreeEmitter = class extends r {
|
|
2100
|
+
constructor(e) {
|
|
2101
|
+
super(), this.options = e;
|
|
2102
|
+
}
|
|
2103
|
+
addText(e) {
|
|
2104
|
+
e !== "" && this.add(e);
|
|
2105
|
+
}
|
|
2106
|
+
startScope(e) {
|
|
2107
|
+
this.openNode(e);
|
|
2108
|
+
}
|
|
2109
|
+
endScope() {
|
|
2110
|
+
this.closeNode();
|
|
2111
|
+
}
|
|
2112
|
+
__addSublanguage(e, t) {
|
|
2113
|
+
let n = e.root;
|
|
2114
|
+
t && (n.scope = `language:${t}`), this.add(n);
|
|
2115
|
+
}
|
|
2116
|
+
toHTML() {
|
|
2117
|
+
return new HTMLRenderer(this, this.options).value();
|
|
2118
|
+
}
|
|
2119
|
+
finalize() {
|
|
2120
|
+
return this.closeAllNodes(), !0;
|
|
2121
|
+
}
|
|
2122
|
+
};
|
|
2123
|
+
function source(e) {
|
|
2124
|
+
return e ? typeof e == "string" ? e : e.source : null;
|
|
2125
|
+
}
|
|
2126
|
+
function lookahead(e) {
|
|
2127
|
+
return concat("(?=", e, ")");
|
|
2128
|
+
}
|
|
2129
|
+
function anyNumberOfTimes(e) {
|
|
2130
|
+
return concat("(?:", e, ")*");
|
|
2131
|
+
}
|
|
2132
|
+
function optional(e) {
|
|
2133
|
+
return concat("(?:", e, ")?");
|
|
2134
|
+
}
|
|
2135
|
+
function concat(...e) {
|
|
2136
|
+
return e.map((e) => source(e)).join("");
|
|
2137
|
+
}
|
|
2138
|
+
function stripOptionsFromArgs(e) {
|
|
2139
|
+
let t = e[e.length - 1];
|
|
2140
|
+
return typeof t == "object" && t.constructor === Object ? (e.splice(e.length - 1, 1), t) : {};
|
|
2141
|
+
}
|
|
2142
|
+
function either(...e) {
|
|
2143
|
+
return "(" + (stripOptionsFromArgs(e).capture ? "" : "?:") + e.map((e) => source(e)).join("|") + ")";
|
|
2144
|
+
}
|
|
2145
|
+
function countMatchGroups(e) {
|
|
2146
|
+
return RegExp(e.toString() + "|").exec("").length - 1;
|
|
2147
|
+
}
|
|
2148
|
+
function startsWith(e, t) {
|
|
2149
|
+
let n = e && e.exec(t);
|
|
2150
|
+
return n && n.index === 0;
|
|
2151
|
+
}
|
|
2152
|
+
var i = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
|
|
2153
|
+
function _rewriteBackreferences(e, { joinWith: t }) {
|
|
2154
|
+
let n = 0;
|
|
2155
|
+
return e.map((e) => {
|
|
2156
|
+
n += 1;
|
|
2157
|
+
let t = n, r = source(e), a = "";
|
|
2158
|
+
for (; r.length > 0;) {
|
|
2159
|
+
let e = i.exec(r);
|
|
2160
|
+
if (!e) {
|
|
2161
|
+
a += r;
|
|
2162
|
+
break;
|
|
2163
|
+
}
|
|
2164
|
+
a += r.substring(0, e.index), r = r.substring(e.index + e[0].length), e[0][0] === "\\" && e[1] ? a += "\\" + String(Number(e[1]) + t) : (a += e[0], e[0] === "(" && n++);
|
|
2165
|
+
}
|
|
2166
|
+
return a;
|
|
2167
|
+
}).map((e) => `(${e})`).join(t);
|
|
2168
|
+
}
|
|
2169
|
+
var a = /\b\B/, o = "[a-zA-Z]\\w*", s = "[a-zA-Z_]\\w*", c = "\\b\\d+(\\.\\d+)?", l = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", u = "\\b(0b[01]+)", d = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", SHEBANG = (e = {}) => {
|
|
2170
|
+
let t = /^#![ ]*\//;
|
|
2171
|
+
return e.binary && (e.begin = concat(t, /.*\b/, e.binary, /\b.*/)), inherit$1({
|
|
2172
|
+
scope: "meta",
|
|
2173
|
+
begin: t,
|
|
2174
|
+
end: /$/,
|
|
2175
|
+
relevance: 0,
|
|
2176
|
+
"on:begin": (e, t) => {
|
|
2177
|
+
e.index !== 0 && t.ignoreMatch();
|
|
2178
|
+
}
|
|
2179
|
+
}, e);
|
|
2180
|
+
}, f = {
|
|
2181
|
+
begin: "\\\\[\\s\\S]",
|
|
2182
|
+
relevance: 0
|
|
2183
|
+
}, p = {
|
|
2184
|
+
scope: "string",
|
|
2185
|
+
begin: "'",
|
|
2186
|
+
end: "'",
|
|
2187
|
+
illegal: "\\n",
|
|
2188
|
+
contains: [f]
|
|
2189
|
+
}, m = {
|
|
2190
|
+
scope: "string",
|
|
2191
|
+
begin: "\"",
|
|
2192
|
+
end: "\"",
|
|
2193
|
+
illegal: "\\n",
|
|
2194
|
+
contains: [f]
|
|
2195
|
+
}, h = { begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ }, COMMENT = function(e, t, n = {}) {
|
|
2196
|
+
let r = inherit$1({
|
|
2197
|
+
scope: "comment",
|
|
2198
|
+
begin: e,
|
|
2199
|
+
end: t,
|
|
2200
|
+
contains: []
|
|
2201
|
+
}, n);
|
|
2202
|
+
r.contains.push({
|
|
2203
|
+
scope: "doctag",
|
|
2204
|
+
begin: "[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
|
|
2205
|
+
end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,
|
|
2206
|
+
excludeBegin: !0,
|
|
2207
|
+
relevance: 0
|
|
2208
|
+
});
|
|
2209
|
+
let i = either("I", "a", "is", "so", "us", "to", "at", "if", "in", "it", "on", /[A-Za-z]+['](d|ve|re|ll|t|s|n)/, /[A-Za-z]+[-][a-z]+/, /[A-Za-z][a-z]{2,}/);
|
|
2210
|
+
return r.contains.push({ begin: concat(/[ ]+/, "(", i, /[.]?[:]?([.][ ]|[ ])/, "){3}") }), r;
|
|
2211
|
+
}, g = COMMENT("//", "$"), _ = COMMENT("/\\*", "\\*/"), v = COMMENT("#", "$"), y = {
|
|
2212
|
+
scope: "number",
|
|
2213
|
+
begin: c,
|
|
2214
|
+
relevance: 0
|
|
2215
|
+
}, b = {
|
|
2216
|
+
scope: "number",
|
|
2217
|
+
begin: l,
|
|
2218
|
+
relevance: 0
|
|
2219
|
+
}, x = {
|
|
2220
|
+
scope: "number",
|
|
2221
|
+
begin: u,
|
|
2222
|
+
relevance: 0
|
|
2223
|
+
}, S = {
|
|
2224
|
+
scope: "regexp",
|
|
2225
|
+
begin: /\/(?=[^/\n]*\/)/,
|
|
2226
|
+
end: /\/[gimuy]*/,
|
|
2227
|
+
contains: [f, {
|
|
2228
|
+
begin: /\[/,
|
|
2229
|
+
end: /\]/,
|
|
2230
|
+
relevance: 0,
|
|
2231
|
+
contains: [f]
|
|
2232
|
+
}]
|
|
2233
|
+
}, C = {
|
|
2234
|
+
scope: "title",
|
|
2235
|
+
begin: o,
|
|
2236
|
+
relevance: 0
|
|
2237
|
+
}, w = {
|
|
2238
|
+
scope: "title",
|
|
2239
|
+
begin: s,
|
|
2240
|
+
relevance: 0
|
|
2241
|
+
}, T = {
|
|
2242
|
+
begin: "\\.\\s*" + s,
|
|
2243
|
+
relevance: 0
|
|
2244
|
+
}, END_SAME_AS_BEGIN = function(e) {
|
|
2245
|
+
return Object.assign(e, {
|
|
2246
|
+
"on:begin": (e, t) => {
|
|
2247
|
+
t.data._beginMatch = e[1];
|
|
2248
|
+
},
|
|
2249
|
+
"on:end": (e, t) => {
|
|
2250
|
+
t.data._beginMatch !== e[1] && t.ignoreMatch();
|
|
2251
|
+
}
|
|
2252
|
+
});
|
|
2253
|
+
}, E = /* @__PURE__ */ Object.freeze({
|
|
2254
|
+
__proto__: null,
|
|
2255
|
+
APOS_STRING_MODE: p,
|
|
2256
|
+
BACKSLASH_ESCAPE: f,
|
|
2257
|
+
BINARY_NUMBER_MODE: x,
|
|
2258
|
+
BINARY_NUMBER_RE: u,
|
|
2259
|
+
COMMENT,
|
|
2260
|
+
C_BLOCK_COMMENT_MODE: _,
|
|
2261
|
+
C_LINE_COMMENT_MODE: g,
|
|
2262
|
+
C_NUMBER_MODE: b,
|
|
2263
|
+
C_NUMBER_RE: l,
|
|
2264
|
+
END_SAME_AS_BEGIN,
|
|
2265
|
+
HASH_COMMENT_MODE: v,
|
|
2266
|
+
IDENT_RE: o,
|
|
2267
|
+
MATCH_NOTHING_RE: a,
|
|
2268
|
+
METHOD_GUARD: T,
|
|
2269
|
+
NUMBER_MODE: y,
|
|
2270
|
+
NUMBER_RE: c,
|
|
2271
|
+
PHRASAL_WORDS_MODE: h,
|
|
2272
|
+
QUOTE_STRING_MODE: m,
|
|
2273
|
+
REGEXP_MODE: S,
|
|
2274
|
+
RE_STARTERS_RE: d,
|
|
2275
|
+
SHEBANG,
|
|
2276
|
+
TITLE_MODE: C,
|
|
2277
|
+
UNDERSCORE_IDENT_RE: s,
|
|
2278
|
+
UNDERSCORE_TITLE_MODE: w
|
|
2279
|
+
});
|
|
2280
|
+
function skipIfHasPrecedingDot(e, t) {
|
|
2281
|
+
e.input[e.index - 1] === "." && t.ignoreMatch();
|
|
2282
|
+
}
|
|
2283
|
+
function scopeClassName(e, t) {
|
|
2284
|
+
e.className !== void 0 && (e.scope = e.className, delete e.className);
|
|
2285
|
+
}
|
|
2286
|
+
function beginKeywords(e, t) {
|
|
2287
|
+
t && e.beginKeywords && (e.begin = "\\b(" + e.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", e.__beforeBegin = skipIfHasPrecedingDot, e.keywords = e.keywords || e.beginKeywords, delete e.beginKeywords, e.relevance === void 0 && (e.relevance = 0));
|
|
2288
|
+
}
|
|
2289
|
+
function compileIllegal(e, t) {
|
|
2290
|
+
Array.isArray(e.illegal) && (e.illegal = either(...e.illegal));
|
|
2291
|
+
}
|
|
2292
|
+
function compileMatch(e, t) {
|
|
2293
|
+
if (e.match) {
|
|
2294
|
+
if (e.begin || e.end) throw Error("begin & end are not supported with match");
|
|
2295
|
+
e.begin = e.match, delete e.match;
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
function compileRelevance(e, t) {
|
|
2299
|
+
e.relevance === void 0 && (e.relevance = 1);
|
|
2300
|
+
}
|
|
2301
|
+
var beforeMatchExt = (e, t) => {
|
|
2302
|
+
if (!e.beforeMatch) return;
|
|
2303
|
+
if (e.starts) throw Error("beforeMatch cannot be used with starts");
|
|
2304
|
+
let n = Object.assign({}, e);
|
|
2305
|
+
Object.keys(e).forEach((t) => {
|
|
2306
|
+
delete e[t];
|
|
2307
|
+
}), e.keywords = n.keywords, e.begin = concat(n.beforeMatch, lookahead(n.begin)), e.starts = {
|
|
2308
|
+
relevance: 0,
|
|
2309
|
+
contains: [Object.assign(n, { endsParent: !0 })]
|
|
2310
|
+
}, e.relevance = 0, delete n.beforeMatch;
|
|
2311
|
+
}, D = [
|
|
2312
|
+
"of",
|
|
2313
|
+
"and",
|
|
2314
|
+
"for",
|
|
2315
|
+
"in",
|
|
2316
|
+
"not",
|
|
2317
|
+
"or",
|
|
2318
|
+
"if",
|
|
2319
|
+
"then",
|
|
2320
|
+
"parent",
|
|
2321
|
+
"list",
|
|
2322
|
+
"value"
|
|
2323
|
+
], O = "keyword";
|
|
2324
|
+
function compileKeywords(e, t, n = O) {
|
|
2325
|
+
let r = Object.create(null);
|
|
2326
|
+
return typeof e == "string" ? compileList(n, e.split(" ")) : Array.isArray(e) ? compileList(n, e) : Object.keys(e).forEach(function(n) {
|
|
2327
|
+
Object.assign(r, compileKeywords(e[n], t, n));
|
|
2328
|
+
}), r;
|
|
2329
|
+
function compileList(e, n) {
|
|
2330
|
+
t && (n = n.map((e) => e.toLowerCase())), n.forEach(function(t) {
|
|
2331
|
+
let n = t.split("|");
|
|
2332
|
+
r[n[0]] = [e, scoreForKeyword(n[0], n[1])];
|
|
2333
|
+
});
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2336
|
+
function scoreForKeyword(e, t) {
|
|
2337
|
+
return t ? Number(t) : commonKeyword(e) ? 0 : 1;
|
|
2338
|
+
}
|
|
2339
|
+
function commonKeyword(e) {
|
|
2340
|
+
return D.includes(e.toLowerCase());
|
|
2341
|
+
}
|
|
2342
|
+
var k = {}, error = (e) => {
|
|
2343
|
+
console.error(e);
|
|
2344
|
+
}, warn = (e, ...t) => {
|
|
2345
|
+
console.log(`WARN: ${e}`, ...t);
|
|
2346
|
+
}, deprecated = (e, t) => {
|
|
2347
|
+
k[`${e}/${t}`] || (console.log(`Deprecated as of ${e}. ${t}`), k[`${e}/${t}`] = !0);
|
|
2348
|
+
}, A = /* @__PURE__ */ Error();
|
|
2349
|
+
function remapScopeNames(e, t, { key: n }) {
|
|
2350
|
+
let r = 0, i = e[n], a = {}, o = {};
|
|
2351
|
+
for (let e = 1; e <= t.length; e++) o[e + r] = i[e], a[e + r] = !0, r += countMatchGroups(t[e - 1]);
|
|
2352
|
+
e[n] = o, e[n]._emit = a, e[n]._multi = !0;
|
|
2353
|
+
}
|
|
2354
|
+
function beginMultiClass(e) {
|
|
2355
|
+
if (Array.isArray(e.begin)) {
|
|
2356
|
+
if (e.skip || e.excludeBegin || e.returnBegin) throw error("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), A;
|
|
2357
|
+
if (typeof e.beginScope != "object" || e.beginScope === null) throw error("beginScope must be object"), A;
|
|
2358
|
+
remapScopeNames(e, e.begin, { key: "beginScope" }), e.begin = _rewriteBackreferences(e.begin, { joinWith: "" });
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
function endMultiClass(e) {
|
|
2362
|
+
if (Array.isArray(e.end)) {
|
|
2363
|
+
if (e.skip || e.excludeEnd || e.returnEnd) throw error("skip, excludeEnd, returnEnd not compatible with endScope: {}"), A;
|
|
2364
|
+
if (typeof e.endScope != "object" || e.endScope === null) throw error("endScope must be object"), A;
|
|
2365
|
+
remapScopeNames(e, e.end, { key: "endScope" }), e.end = _rewriteBackreferences(e.end, { joinWith: "" });
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
function scopeSugar(e) {
|
|
2369
|
+
e.scope && typeof e.scope == "object" && e.scope !== null && (e.beginScope = e.scope, delete e.scope);
|
|
2370
|
+
}
|
|
2371
|
+
function MultiClass(e) {
|
|
2372
|
+
scopeSugar(e), typeof e.beginScope == "string" && (e.beginScope = { _wrap: e.beginScope }), typeof e.endScope == "string" && (e.endScope = { _wrap: e.endScope }), beginMultiClass(e), endMultiClass(e);
|
|
2373
|
+
}
|
|
2374
|
+
function compileLanguage(e) {
|
|
2375
|
+
function langRe(t, n) {
|
|
2376
|
+
return new RegExp(source(t), "m" + (e.case_insensitive ? "i" : "") + (e.unicodeRegex ? "u" : "") + (n ? "g" : ""));
|
|
2377
|
+
}
|
|
2378
|
+
class MultiRegex {
|
|
2379
|
+
constructor() {
|
|
2380
|
+
this.matchIndexes = {}, this.regexes = [], this.matchAt = 1, this.position = 0;
|
|
2381
|
+
}
|
|
2382
|
+
addRule(e, t) {
|
|
2383
|
+
t.position = this.position++, this.matchIndexes[this.matchAt] = t, this.regexes.push([t, e]), this.matchAt += countMatchGroups(e) + 1;
|
|
2384
|
+
}
|
|
2385
|
+
compile() {
|
|
2386
|
+
this.regexes.length === 0 && (this.exec = () => null), this.matcherRe = langRe(_rewriteBackreferences(this.regexes.map((e) => e[1]), { joinWith: "|" }), !0), this.lastIndex = 0;
|
|
2387
|
+
}
|
|
2388
|
+
exec(e) {
|
|
2389
|
+
this.matcherRe.lastIndex = this.lastIndex;
|
|
2390
|
+
let t = this.matcherRe.exec(e);
|
|
2391
|
+
if (!t) return null;
|
|
2392
|
+
let n = t.findIndex((e, t) => t > 0 && e !== void 0), r = this.matchIndexes[n];
|
|
2393
|
+
return t.splice(0, n), Object.assign(t, r);
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
class ResumableMultiRegex {
|
|
2397
|
+
constructor() {
|
|
2398
|
+
this.rules = [], this.multiRegexes = [], this.count = 0, this.lastIndex = 0, this.regexIndex = 0;
|
|
2399
|
+
}
|
|
2400
|
+
getMatcher(e) {
|
|
2401
|
+
if (this.multiRegexes[e]) return this.multiRegexes[e];
|
|
2402
|
+
let t = new MultiRegex();
|
|
2403
|
+
return this.rules.slice(e).forEach(([e, n]) => t.addRule(e, n)), t.compile(), this.multiRegexes[e] = t, t;
|
|
2404
|
+
}
|
|
2405
|
+
resumingScanAtSamePosition() {
|
|
2406
|
+
return this.regexIndex !== 0;
|
|
2407
|
+
}
|
|
2408
|
+
considerAll() {
|
|
2409
|
+
this.regexIndex = 0;
|
|
2410
|
+
}
|
|
2411
|
+
addRule(e, t) {
|
|
2412
|
+
this.rules.push([e, t]), t.type === "begin" && this.count++;
|
|
2413
|
+
}
|
|
2414
|
+
exec(e) {
|
|
2415
|
+
let t = this.getMatcher(this.regexIndex);
|
|
2416
|
+
t.lastIndex = this.lastIndex;
|
|
2417
|
+
let n = t.exec(e);
|
|
2418
|
+
if (this.resumingScanAtSamePosition() && !(n && n.index === this.lastIndex)) {
|
|
2419
|
+
let t = this.getMatcher(0);
|
|
2420
|
+
t.lastIndex = this.lastIndex + 1, n = t.exec(e);
|
|
2421
|
+
}
|
|
2422
|
+
return n && (this.regexIndex += n.position + 1, this.regexIndex === this.count && this.considerAll()), n;
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
function buildModeRegex(e) {
|
|
2426
|
+
let t = new ResumableMultiRegex();
|
|
2427
|
+
return e.contains.forEach((e) => t.addRule(e.begin, {
|
|
2428
|
+
rule: e,
|
|
2429
|
+
type: "begin"
|
|
2430
|
+
})), e.terminatorEnd && t.addRule(e.terminatorEnd, { type: "end" }), e.illegal && t.addRule(e.illegal, { type: "illegal" }), t;
|
|
2431
|
+
}
|
|
2432
|
+
function compileMode(t, n) {
|
|
2433
|
+
let r = t;
|
|
2434
|
+
if (t.isCompiled) return r;
|
|
2435
|
+
[
|
|
2436
|
+
scopeClassName,
|
|
2437
|
+
compileMatch,
|
|
2438
|
+
MultiClass,
|
|
2439
|
+
beforeMatchExt
|
|
2440
|
+
].forEach((e) => e(t, n)), e.compilerExtensions.forEach((e) => e(t, n)), t.__beforeBegin = null, [
|
|
2441
|
+
beginKeywords,
|
|
2442
|
+
compileIllegal,
|
|
2443
|
+
compileRelevance
|
|
2444
|
+
].forEach((e) => e(t, n)), t.isCompiled = !0;
|
|
2445
|
+
let i = null;
|
|
2446
|
+
return typeof t.keywords == "object" && t.keywords.$pattern && (t.keywords = Object.assign({}, t.keywords), i = t.keywords.$pattern, delete t.keywords.$pattern), i = i || /\w+/, t.keywords && (t.keywords = compileKeywords(t.keywords, e.case_insensitive)), r.keywordPatternRe = langRe(i, !0), n && (t.begin || (t.begin = /\B|\b/), r.beginRe = langRe(r.begin), !t.end && !t.endsWithParent && (t.end = /\B|\b/), t.end && (r.endRe = langRe(r.end)), r.terminatorEnd = source(r.end) || "", t.endsWithParent && n.terminatorEnd && (r.terminatorEnd += (t.end ? "|" : "") + n.terminatorEnd)), t.illegal && (r.illegalRe = langRe(t.illegal)), t.contains || (t.contains = []), t.contains = [].concat(...t.contains.map(function(e) {
|
|
2447
|
+
return expandOrCloneMode(e === "self" ? t : e);
|
|
2448
|
+
})), t.contains.forEach(function(e) {
|
|
2449
|
+
compileMode(e, r);
|
|
2450
|
+
}), t.starts && compileMode(t.starts, n), r.matcher = buildModeRegex(r), r;
|
|
2451
|
+
}
|
|
2452
|
+
if (e.compilerExtensions || (e.compilerExtensions = []), e.contains && e.contains.includes("self")) throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
|
|
2453
|
+
return e.classNameAliases = inherit$1(e.classNameAliases || {}), compileMode(e);
|
|
2454
|
+
}
|
|
2455
|
+
function dependencyOnParent(e) {
|
|
2456
|
+
return e ? e.endsWithParent || dependencyOnParent(e.starts) : !1;
|
|
2457
|
+
}
|
|
2458
|
+
function expandOrCloneMode(e) {
|
|
2459
|
+
return e.variants && !e.cachedVariants && (e.cachedVariants = e.variants.map(function(t) {
|
|
2460
|
+
return inherit$1(e, { variants: null }, t);
|
|
2461
|
+
})), e.cachedVariants ? e.cachedVariants : dependencyOnParent(e) ? inherit$1(e, { starts: e.starts ? inherit$1(e.starts) : null }) : Object.isFrozen(e) ? inherit$1(e) : e;
|
|
2462
|
+
}
|
|
2463
|
+
var ee = "11.11.1", HTMLInjectionError = class extends Error {
|
|
2464
|
+
constructor(e, t) {
|
|
2465
|
+
super(e), this.name = "HTMLInjectionError", this.html = t;
|
|
2466
|
+
}
|
|
2467
|
+
}, j = escapeHTML, M = inherit$1, N = Symbol("nomatch"), te = 7, HLJS = function(e) {
|
|
2468
|
+
let t = Object.create(null), n = Object.create(null), r = [], i = !0, a = "Could not find the language '{}', did you forget to load/include a language module?", o = {
|
|
2469
|
+
disableAutodetect: !0,
|
|
2470
|
+
name: "Plain text",
|
|
2471
|
+
contains: []
|
|
2472
|
+
}, s = {
|
|
2473
|
+
ignoreUnescapedHTML: !1,
|
|
2474
|
+
throwUnescapedHTML: !1,
|
|
2475
|
+
noHighlightRe: /^(no-?highlight)$/i,
|
|
2476
|
+
languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i,
|
|
2477
|
+
classPrefix: "hljs-",
|
|
2478
|
+
cssSelector: "pre code",
|
|
2479
|
+
languages: null,
|
|
2480
|
+
__emitter: TokenTreeEmitter
|
|
2481
|
+
};
|
|
2482
|
+
function shouldNotHighlight(e) {
|
|
2483
|
+
return s.noHighlightRe.test(e);
|
|
2484
|
+
}
|
|
2485
|
+
function blockLanguage(e) {
|
|
2486
|
+
let t = e.className + " ";
|
|
2487
|
+
t += e.parentNode ? e.parentNode.className : "";
|
|
2488
|
+
let n = s.languageDetectRe.exec(t);
|
|
2489
|
+
if (n) {
|
|
2490
|
+
let t = getLanguage(n[1]);
|
|
2491
|
+
return t || (warn(a.replace("{}", n[1])), warn("Falling back to no-highlight mode for this block.", e)), t ? n[1] : "no-highlight";
|
|
2492
|
+
}
|
|
2493
|
+
return t.split(/\s+/).find((e) => shouldNotHighlight(e) || getLanguage(e));
|
|
2494
|
+
}
|
|
2495
|
+
function highlight(e, t, n) {
|
|
2496
|
+
let r = "", i = "";
|
|
2497
|
+
typeof t == "object" ? (r = e, n = t.ignoreIllegals, i = t.language) : (deprecated("10.7.0", "highlight(lang, code, ...args) has been deprecated."), deprecated("10.7.0", "Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), i = e, r = t), n === void 0 && (n = !0);
|
|
2498
|
+
let a = {
|
|
2499
|
+
code: r,
|
|
2500
|
+
language: i
|
|
2501
|
+
};
|
|
2502
|
+
fire("before:highlight", a);
|
|
2503
|
+
let o = a.result ? a.result : _highlight(a.language, a.code, n);
|
|
2504
|
+
return o.code = a.code, fire("after:highlight", o), o;
|
|
2505
|
+
}
|
|
2506
|
+
function _highlight(e, n, r, o) {
|
|
2507
|
+
let c = Object.create(null);
|
|
2508
|
+
function keywordData(e, t) {
|
|
2509
|
+
return e.keywords[t];
|
|
2510
|
+
}
|
|
2511
|
+
function processKeywords() {
|
|
2512
|
+
if (!p.keywords) {
|
|
2513
|
+
h.addText(g);
|
|
2514
|
+
return;
|
|
2515
|
+
}
|
|
2516
|
+
let e = 0;
|
|
2517
|
+
p.keywordPatternRe.lastIndex = 0;
|
|
2518
|
+
let t = p.keywordPatternRe.exec(g), n = "";
|
|
2519
|
+
for (; t;) {
|
|
2520
|
+
n += g.substring(e, t.index);
|
|
2521
|
+
let r = u.case_insensitive ? t[0].toLowerCase() : t[0], i = keywordData(p, r);
|
|
2522
|
+
if (i) {
|
|
2523
|
+
let [e, a] = i;
|
|
2524
|
+
if (h.addText(n), n = "", c[r] = (c[r] || 0) + 1, c[r] <= te && (_ += a), e.startsWith("_")) n += t[0];
|
|
2525
|
+
else {
|
|
2526
|
+
let n = u.classNameAliases[e] || e;
|
|
2527
|
+
emitKeyword(t[0], n);
|
|
2528
|
+
}
|
|
2529
|
+
} else n += t[0];
|
|
2530
|
+
e = p.keywordPatternRe.lastIndex, t = p.keywordPatternRe.exec(g);
|
|
2531
|
+
}
|
|
2532
|
+
n += g.substring(e), h.addText(n);
|
|
2533
|
+
}
|
|
2534
|
+
function processSubLanguage() {
|
|
2535
|
+
if (g === "") return;
|
|
2536
|
+
let e = null;
|
|
2537
|
+
if (typeof p.subLanguage == "string") {
|
|
2538
|
+
if (!t[p.subLanguage]) {
|
|
2539
|
+
h.addText(g);
|
|
2540
|
+
return;
|
|
2541
|
+
}
|
|
2542
|
+
e = _highlight(p.subLanguage, g, !0, m[p.subLanguage]), m[p.subLanguage] = e._top;
|
|
2543
|
+
} else e = highlightAuto(g, p.subLanguage.length ? p.subLanguage : null);
|
|
2544
|
+
p.relevance > 0 && (_ += e.relevance), h.__addSublanguage(e._emitter, e.language);
|
|
2545
|
+
}
|
|
2546
|
+
function processBuffer() {
|
|
2547
|
+
p.subLanguage == null ? processKeywords() : processSubLanguage(), g = "";
|
|
2548
|
+
}
|
|
2549
|
+
function emitKeyword(e, t) {
|
|
2550
|
+
e !== "" && (h.startScope(t), h.addText(e), h.endScope());
|
|
2551
|
+
}
|
|
2552
|
+
function emitMultiClass(e, t) {
|
|
2553
|
+
let n = 1, r = t.length - 1;
|
|
2554
|
+
for (; n <= r;) {
|
|
2555
|
+
if (!e._emit[n]) {
|
|
2556
|
+
n++;
|
|
2557
|
+
continue;
|
|
2558
|
+
}
|
|
2559
|
+
let r = u.classNameAliases[e[n]] || e[n], i = t[n];
|
|
2560
|
+
r ? emitKeyword(i, r) : (g = i, processKeywords(), g = ""), n++;
|
|
2561
|
+
}
|
|
2562
|
+
}
|
|
2563
|
+
function startNewMode(e, t) {
|
|
2564
|
+
return e.scope && typeof e.scope == "string" && h.openNode(u.classNameAliases[e.scope] || e.scope), e.beginScope && (e.beginScope._wrap ? (emitKeyword(g, u.classNameAliases[e.beginScope._wrap] || e.beginScope._wrap), g = "") : e.beginScope._multi && (emitMultiClass(e.beginScope, t), g = "")), p = Object.create(e, { parent: { value: p } }), p;
|
|
2565
|
+
}
|
|
2566
|
+
function endOfMode(e, t, n) {
|
|
2567
|
+
let r = startsWith(e.endRe, n);
|
|
2568
|
+
if (r) {
|
|
2569
|
+
if (e["on:end"]) {
|
|
2570
|
+
let n = new Response(e);
|
|
2571
|
+
e["on:end"](t, n), n.isMatchIgnored && (r = !1);
|
|
2572
|
+
}
|
|
2573
|
+
if (r) {
|
|
2574
|
+
for (; e.endsParent && e.parent;) e = e.parent;
|
|
2575
|
+
return e;
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
if (e.endsWithParent) return endOfMode(e.parent, t, n);
|
|
2579
|
+
}
|
|
2580
|
+
function doIgnore(e) {
|
|
2581
|
+
return p.matcher.regexIndex === 0 ? (g += e[0], 1) : (b = !0, 0);
|
|
2582
|
+
}
|
|
2583
|
+
function doBeginMatch(e) {
|
|
2584
|
+
let t = e[0], n = e.rule, r = new Response(n), i = [n.__beforeBegin, n["on:begin"]];
|
|
2585
|
+
for (let n of i) if (n && (n(e, r), r.isMatchIgnored)) return doIgnore(t);
|
|
2586
|
+
return n.skip ? g += t : (n.excludeBegin && (g += t), processBuffer(), !n.returnBegin && !n.excludeBegin && (g = t)), startNewMode(n, e), n.returnBegin ? 0 : t.length;
|
|
2587
|
+
}
|
|
2588
|
+
function doEndMatch(e) {
|
|
2589
|
+
let t = e[0], r = n.substring(e.index), i = endOfMode(p, e, r);
|
|
2590
|
+
if (!i) return N;
|
|
2591
|
+
let a = p;
|
|
2592
|
+
p.endScope && p.endScope._wrap ? (processBuffer(), emitKeyword(t, p.endScope._wrap)) : p.endScope && p.endScope._multi ? (processBuffer(), emitMultiClass(p.endScope, e)) : a.skip ? g += t : (a.returnEnd || a.excludeEnd || (g += t), processBuffer(), a.excludeEnd && (g = t));
|
|
2593
|
+
do
|
|
2594
|
+
p.scope && h.closeNode(), !p.skip && !p.subLanguage && (_ += p.relevance), p = p.parent;
|
|
2595
|
+
while (p !== i.parent);
|
|
2596
|
+
return i.starts && startNewMode(i.starts, e), a.returnEnd ? 0 : t.length;
|
|
2597
|
+
}
|
|
2598
|
+
function processContinuations() {
|
|
2599
|
+
let e = [];
|
|
2600
|
+
for (let t = p; t !== u; t = t.parent) t.scope && e.unshift(t.scope);
|
|
2601
|
+
e.forEach((e) => h.openNode(e));
|
|
2602
|
+
}
|
|
2603
|
+
let l = {};
|
|
2604
|
+
function processLexeme(t, a) {
|
|
2605
|
+
let o = a && a[0];
|
|
2606
|
+
if (g += t, o == null) return processBuffer(), 0;
|
|
2607
|
+
if (l.type === "begin" && a.type === "end" && l.index === a.index && o === "") {
|
|
2608
|
+
if (g += n.slice(a.index, a.index + 1), !i) {
|
|
2609
|
+
let t = /* @__PURE__ */ Error(`0 width match regex (${e})`);
|
|
2610
|
+
throw t.languageName = e, t.badRule = l.rule, t;
|
|
2611
|
+
}
|
|
2612
|
+
return 1;
|
|
2613
|
+
}
|
|
2614
|
+
if (l = a, a.type === "begin") return doBeginMatch(a);
|
|
2615
|
+
if (a.type === "illegal" && !r) {
|
|
2616
|
+
let e = /* @__PURE__ */ Error("Illegal lexeme \"" + o + "\" for mode \"" + (p.scope || "<unnamed>") + "\"");
|
|
2617
|
+
throw e.mode = p, e;
|
|
2618
|
+
} else if (a.type === "end") {
|
|
2619
|
+
let e = doEndMatch(a);
|
|
2620
|
+
if (e !== N) return e;
|
|
2621
|
+
}
|
|
2622
|
+
if (a.type === "illegal" && o === "") return g += "\n", 1;
|
|
2623
|
+
if (y > 1e5 && y > a.index * 3) throw /* @__PURE__ */ Error("potential infinite loop, way more iterations than matches");
|
|
2624
|
+
return g += o, o.length;
|
|
2625
|
+
}
|
|
2626
|
+
let u = getLanguage(e);
|
|
2627
|
+
if (!u) throw error(a.replace("{}", e)), Error("Unknown language: \"" + e + "\"");
|
|
2628
|
+
let d = compileLanguage(u), f = "", p = o || d, m = {}, h = new s.__emitter(s);
|
|
2629
|
+
processContinuations();
|
|
2630
|
+
let g = "", _ = 0, v = 0, y = 0, b = !1;
|
|
2631
|
+
try {
|
|
2632
|
+
if (u.__emitTokens) u.__emitTokens(n, h);
|
|
2633
|
+
else {
|
|
2634
|
+
for (p.matcher.considerAll();;) {
|
|
2635
|
+
y++, b ? b = !1 : p.matcher.considerAll(), p.matcher.lastIndex = v;
|
|
2636
|
+
let e = p.matcher.exec(n);
|
|
2637
|
+
if (!e) break;
|
|
2638
|
+
let t = processLexeme(n.substring(v, e.index), e);
|
|
2639
|
+
v = e.index + t;
|
|
2640
|
+
}
|
|
2641
|
+
processLexeme(n.substring(v));
|
|
2642
|
+
}
|
|
2643
|
+
return h.finalize(), f = h.toHTML(), {
|
|
2644
|
+
language: e,
|
|
2645
|
+
value: f,
|
|
2646
|
+
relevance: _,
|
|
2647
|
+
illegal: !1,
|
|
2648
|
+
_emitter: h,
|
|
2649
|
+
_top: p
|
|
2650
|
+
};
|
|
2651
|
+
} catch (t) {
|
|
2652
|
+
if (t.message && t.message.includes("Illegal")) return {
|
|
2653
|
+
language: e,
|
|
2654
|
+
value: j(n),
|
|
2655
|
+
illegal: !0,
|
|
2656
|
+
relevance: 0,
|
|
2657
|
+
_illegalBy: {
|
|
2658
|
+
message: t.message,
|
|
2659
|
+
index: v,
|
|
2660
|
+
context: n.slice(v - 100, v + 100),
|
|
2661
|
+
mode: t.mode,
|
|
2662
|
+
resultSoFar: f
|
|
2663
|
+
},
|
|
2664
|
+
_emitter: h
|
|
2665
|
+
};
|
|
2666
|
+
if (i) return {
|
|
2667
|
+
language: e,
|
|
2668
|
+
value: j(n),
|
|
2669
|
+
illegal: !1,
|
|
2670
|
+
relevance: 0,
|
|
2671
|
+
errorRaised: t,
|
|
2672
|
+
_emitter: h,
|
|
2673
|
+
_top: p
|
|
2674
|
+
};
|
|
2675
|
+
throw t;
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
function justTextHighlightResult(e) {
|
|
2679
|
+
let t = {
|
|
2680
|
+
value: j(e),
|
|
2681
|
+
illegal: !1,
|
|
2682
|
+
relevance: 0,
|
|
2683
|
+
_top: o,
|
|
2684
|
+
_emitter: new s.__emitter(s)
|
|
2685
|
+
};
|
|
2686
|
+
return t._emitter.addText(e), t;
|
|
2687
|
+
}
|
|
2688
|
+
function highlightAuto(e, n) {
|
|
2689
|
+
n = n || s.languages || Object.keys(t);
|
|
2690
|
+
let r = justTextHighlightResult(e), i = n.filter(getLanguage).filter(autoDetection).map((t) => _highlight(t, e, !1));
|
|
2691
|
+
i.unshift(r);
|
|
2692
|
+
let [a, o] = i.sort((e, t) => {
|
|
2693
|
+
if (e.relevance !== t.relevance) return t.relevance - e.relevance;
|
|
2694
|
+
if (e.language && t.language) {
|
|
2695
|
+
if (getLanguage(e.language).supersetOf === t.language) return 1;
|
|
2696
|
+
if (getLanguage(t.language).supersetOf === e.language) return -1;
|
|
2697
|
+
}
|
|
2698
|
+
return 0;
|
|
2699
|
+
}), c = a;
|
|
2700
|
+
return c.secondBest = o, c;
|
|
2701
|
+
}
|
|
2702
|
+
function updateClassName(e, t, r) {
|
|
2703
|
+
let i = t && n[t] || r;
|
|
2704
|
+
e.classList.add("hljs"), e.classList.add(`language-${i}`);
|
|
2705
|
+
}
|
|
2706
|
+
function highlightElement(e) {
|
|
2707
|
+
let t = null, n = blockLanguage(e);
|
|
2708
|
+
if (shouldNotHighlight(n)) return;
|
|
2709
|
+
if (fire("before:highlightElement", {
|
|
2710
|
+
el: e,
|
|
2711
|
+
language: n
|
|
2712
|
+
}), e.dataset.highlighted) {
|
|
2713
|
+
console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.", e);
|
|
2714
|
+
return;
|
|
2715
|
+
}
|
|
2716
|
+
if (e.children.length > 0 && (s.ignoreUnescapedHTML || (console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), console.warn("The element with unescaped HTML:"), console.warn(e)), s.throwUnescapedHTML)) throw new HTMLInjectionError("One of your code blocks includes unescaped HTML.", e.innerHTML);
|
|
2717
|
+
t = e;
|
|
2718
|
+
let r = t.textContent, i = n ? highlight(r, {
|
|
2719
|
+
language: n,
|
|
2720
|
+
ignoreIllegals: !0
|
|
2721
|
+
}) : highlightAuto(r);
|
|
2722
|
+
e.innerHTML = i.value, e.dataset.highlighted = "yes", updateClassName(e, n, i.language), e.result = {
|
|
2723
|
+
language: i.language,
|
|
2724
|
+
re: i.relevance,
|
|
2725
|
+
relevance: i.relevance
|
|
2726
|
+
}, i.secondBest && (e.secondBest = {
|
|
2727
|
+
language: i.secondBest.language,
|
|
2728
|
+
relevance: i.secondBest.relevance
|
|
2729
|
+
}), fire("after:highlightElement", {
|
|
2730
|
+
el: e,
|
|
2731
|
+
result: i,
|
|
2732
|
+
text: r
|
|
2733
|
+
});
|
|
2734
|
+
}
|
|
2735
|
+
function configure(e) {
|
|
2736
|
+
s = M(s, e);
|
|
2737
|
+
}
|
|
2738
|
+
let initHighlighting = () => {
|
|
2739
|
+
highlightAll(), deprecated("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
|
|
2740
|
+
};
|
|
2741
|
+
function initHighlightingOnLoad() {
|
|
2742
|
+
highlightAll(), deprecated("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
|
|
2743
|
+
}
|
|
2744
|
+
let c = !1;
|
|
2745
|
+
function highlightAll() {
|
|
2746
|
+
function boot() {
|
|
2747
|
+
highlightAll();
|
|
2748
|
+
}
|
|
2749
|
+
if (document.readyState === "loading") {
|
|
2750
|
+
c || window.addEventListener("DOMContentLoaded", boot, !1), c = !0;
|
|
2751
|
+
return;
|
|
2752
|
+
}
|
|
2753
|
+
document.querySelectorAll(s.cssSelector).forEach(highlightElement);
|
|
2754
|
+
}
|
|
2755
|
+
function registerLanguage(n, r) {
|
|
2756
|
+
let a = null;
|
|
2757
|
+
try {
|
|
2758
|
+
a = r(e);
|
|
2759
|
+
} catch (e) {
|
|
2760
|
+
if (error("Language definition for '{}' could not be registered.".replace("{}", n)), i) error(e);
|
|
2761
|
+
else throw e;
|
|
2762
|
+
a = o;
|
|
2763
|
+
}
|
|
2764
|
+
a.name || (a.name = n), t[n] = a, a.rawDefinition = r.bind(null, e), a.aliases && registerAliases(a.aliases, { languageName: n });
|
|
2765
|
+
}
|
|
2766
|
+
function unregisterLanguage(e) {
|
|
2767
|
+
delete t[e];
|
|
2768
|
+
for (let t of Object.keys(n)) n[t] === e && delete n[t];
|
|
2769
|
+
}
|
|
2770
|
+
function listLanguages() {
|
|
2771
|
+
return Object.keys(t);
|
|
2772
|
+
}
|
|
2773
|
+
function getLanguage(e) {
|
|
2774
|
+
return e = (e || "").toLowerCase(), t[e] || t[n[e]];
|
|
2775
|
+
}
|
|
2776
|
+
function registerAliases(e, { languageName: t }) {
|
|
2777
|
+
typeof e == "string" && (e = [e]), e.forEach((e) => {
|
|
2778
|
+
n[e.toLowerCase()] = t;
|
|
2779
|
+
});
|
|
2780
|
+
}
|
|
2781
|
+
function autoDetection(e) {
|
|
2782
|
+
let t = getLanguage(e);
|
|
2783
|
+
return t && !t.disableAutodetect;
|
|
2784
|
+
}
|
|
2785
|
+
function upgradePluginAPI(e) {
|
|
2786
|
+
e["before:highlightBlock"] && !e["before:highlightElement"] && (e["before:highlightElement"] = (t) => {
|
|
2787
|
+
e["before:highlightBlock"](Object.assign({ block: t.el }, t));
|
|
2788
|
+
}), e["after:highlightBlock"] && !e["after:highlightElement"] && (e["after:highlightElement"] = (t) => {
|
|
2789
|
+
e["after:highlightBlock"](Object.assign({ block: t.el }, t));
|
|
2790
|
+
});
|
|
2791
|
+
}
|
|
2792
|
+
function addPlugin(e) {
|
|
2793
|
+
upgradePluginAPI(e), r.push(e);
|
|
2794
|
+
}
|
|
2795
|
+
function removePlugin(e) {
|
|
2796
|
+
let t = r.indexOf(e);
|
|
2797
|
+
t !== -1 && r.splice(t, 1);
|
|
2798
|
+
}
|
|
2799
|
+
function fire(e, t) {
|
|
2800
|
+
let n = e;
|
|
2801
|
+
r.forEach(function(e) {
|
|
2802
|
+
e[n] && e[n](t);
|
|
2803
|
+
});
|
|
2804
|
+
}
|
|
2805
|
+
function deprecateHighlightBlock(e) {
|
|
2806
|
+
return deprecated("10.7.0", "highlightBlock will be removed entirely in v12.0"), deprecated("10.7.0", "Please use highlightElement now."), highlightElement(e);
|
|
2807
|
+
}
|
|
2808
|
+
Object.assign(e, {
|
|
2809
|
+
highlight,
|
|
2810
|
+
highlightAuto,
|
|
2811
|
+
highlightAll,
|
|
2812
|
+
highlightElement,
|
|
2813
|
+
highlightBlock: deprecateHighlightBlock,
|
|
2814
|
+
configure,
|
|
2815
|
+
initHighlighting,
|
|
2816
|
+
initHighlightingOnLoad,
|
|
2817
|
+
registerLanguage,
|
|
2818
|
+
unregisterLanguage,
|
|
2819
|
+
listLanguages,
|
|
2820
|
+
getLanguage,
|
|
2821
|
+
registerAliases,
|
|
2822
|
+
autoDetection,
|
|
2823
|
+
inherit: M,
|
|
2824
|
+
addPlugin,
|
|
2825
|
+
removePlugin
|
|
2826
|
+
}), e.debugMode = function() {
|
|
2827
|
+
i = !1;
|
|
2828
|
+
}, e.safeMode = function() {
|
|
2829
|
+
i = !0;
|
|
2830
|
+
}, e.versionString = ee, e.regex = {
|
|
2831
|
+
concat,
|
|
2832
|
+
lookahead,
|
|
2833
|
+
either,
|
|
2834
|
+
optional,
|
|
2835
|
+
anyNumberOfTimes
|
|
2836
|
+
};
|
|
2837
|
+
for (let e in E) typeof E[e] == "object" && deepFreeze(E[e]);
|
|
2838
|
+
return Object.assign(e, E), e;
|
|
2839
|
+
}, P = HLJS({});
|
|
2840
|
+
P.newInstance = () => HLJS({}), t.exports = P, P.HighlightJS = P, P.default = P;
|
|
2841
|
+
})))())).default, dt = c({
|
|
2842
|
+
props: {
|
|
2843
|
+
code: {
|
|
2844
|
+
type: String,
|
|
2845
|
+
required: !0
|
|
2846
|
+
},
|
|
2847
|
+
language: {
|
|
2848
|
+
type: String,
|
|
2849
|
+
default: ""
|
|
2850
|
+
},
|
|
2851
|
+
autodetect: {
|
|
2852
|
+
type: Boolean,
|
|
2853
|
+
default: !0
|
|
2854
|
+
},
|
|
2855
|
+
ignoreIllegals: {
|
|
2856
|
+
type: Boolean,
|
|
2857
|
+
default: !0
|
|
2858
|
+
}
|
|
2859
|
+
},
|
|
2860
|
+
setup: function(e) {
|
|
2861
|
+
var n = v(e.language);
|
|
2862
|
+
w((function() {
|
|
2863
|
+
return e.language;
|
|
2864
|
+
}), (function(e) {
|
|
2865
|
+
n.value = e;
|
|
2866
|
+
}));
|
|
2867
|
+
var r = t((function() {
|
|
2868
|
+
return e.autodetect || !n.value;
|
|
2869
|
+
})), i = t((function() {
|
|
2870
|
+
return !r.value && !Q.getLanguage(n.value);
|
|
2871
|
+
}));
|
|
2872
|
+
return {
|
|
2873
|
+
className: t((function() {
|
|
2874
|
+
return i.value ? "" : "hljs " + n.value;
|
|
2875
|
+
})),
|
|
2876
|
+
highlightedCode: t((function() {
|
|
2877
|
+
if (i.value) return console.warn("The language \"" + n.value + "\" you specified could not be found."), e.code.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2878
|
+
if (r.value) {
|
|
2879
|
+
var t = Q.highlightAuto(e.code);
|
|
2880
|
+
return n.value = t.language ?? "", t.value;
|
|
2881
|
+
}
|
|
2882
|
+
return (t = Q.highlight(e.code, {
|
|
2883
|
+
language: n.value,
|
|
2884
|
+
ignoreIllegals: e.ignoreIllegals
|
|
2885
|
+
})).value;
|
|
2886
|
+
}))
|
|
2887
|
+
};
|
|
2888
|
+
},
|
|
2889
|
+
render: function() {
|
|
2890
|
+
return u("pre", {}, [u("code", {
|
|
2891
|
+
class: this.className,
|
|
2892
|
+
innerHTML: this.highlightedCode,
|
|
2893
|
+
tabindex: "0"
|
|
2894
|
+
})]);
|
|
2895
|
+
}
|
|
2896
|
+
}), ft = {
|
|
2897
|
+
install: function(e) {
|
|
2898
|
+
e.component("highlightjs", dt);
|
|
2899
|
+
},
|
|
2900
|
+
component: dt
|
|
2901
|
+
}, pt = "[A-Za-z$_][0-9A-Za-z$_]*", mt = /* @__PURE__ */ "as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using".split("."), ht = [
|
|
2902
|
+
"true",
|
|
2903
|
+
"false",
|
|
2904
|
+
"null",
|
|
2905
|
+
"undefined",
|
|
2906
|
+
"NaN",
|
|
2907
|
+
"Infinity"
|
|
2908
|
+
], gt = /* @__PURE__ */ "Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly".split("."), _t = [
|
|
2909
|
+
"Error",
|
|
2910
|
+
"EvalError",
|
|
2911
|
+
"InternalError",
|
|
2912
|
+
"RangeError",
|
|
2913
|
+
"ReferenceError",
|
|
2914
|
+
"SyntaxError",
|
|
2915
|
+
"TypeError",
|
|
2916
|
+
"URIError"
|
|
2917
|
+
], vt = [
|
|
2918
|
+
"setInterval",
|
|
2919
|
+
"setTimeout",
|
|
2920
|
+
"clearInterval",
|
|
2921
|
+
"clearTimeout",
|
|
2922
|
+
"require",
|
|
2923
|
+
"exports",
|
|
2924
|
+
"eval",
|
|
2925
|
+
"isFinite",
|
|
2926
|
+
"isNaN",
|
|
2927
|
+
"parseFloat",
|
|
2928
|
+
"parseInt",
|
|
2929
|
+
"decodeURI",
|
|
2930
|
+
"decodeURIComponent",
|
|
2931
|
+
"encodeURI",
|
|
2932
|
+
"encodeURIComponent",
|
|
2933
|
+
"escape",
|
|
2934
|
+
"unescape"
|
|
2935
|
+
], yt = [
|
|
2936
|
+
"arguments",
|
|
2937
|
+
"this",
|
|
2938
|
+
"super",
|
|
2939
|
+
"console",
|
|
2940
|
+
"window",
|
|
2941
|
+
"document",
|
|
2942
|
+
"localStorage",
|
|
2943
|
+
"sessionStorage",
|
|
2944
|
+
"module",
|
|
2945
|
+
"global"
|
|
2946
|
+
], bt = [].concat(vt, gt, _t);
|
|
2947
|
+
function javascript$1(e) {
|
|
2948
|
+
let t = e.regex, hasClosingTag = (e, { after: t }) => {
|
|
2949
|
+
let n = "</" + e[0].slice(1);
|
|
2950
|
+
return e.input.indexOf(n, t) !== -1;
|
|
2951
|
+
}, n = pt, r = {
|
|
2952
|
+
begin: "<>",
|
|
2953
|
+
end: "</>"
|
|
2954
|
+
}, i = /<[A-Za-z0-9\\._:-]+\s*\/>/, a = {
|
|
2955
|
+
begin: /<[A-Za-z0-9\\._:-]+/,
|
|
2956
|
+
end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
|
|
2957
|
+
isTrulyOpeningTag: (e, t) => {
|
|
2958
|
+
let n = e[0].length + e.index, r = e.input[n];
|
|
2959
|
+
if (r === "<" || r === ",") {
|
|
2960
|
+
t.ignoreMatch();
|
|
2961
|
+
return;
|
|
2962
|
+
}
|
|
2963
|
+
r === ">" && (hasClosingTag(e, { after: n }) || t.ignoreMatch());
|
|
2964
|
+
let i, a = e.input.substring(n);
|
|
2965
|
+
if (i = a.match(/^\s*=/)) {
|
|
2966
|
+
t.ignoreMatch();
|
|
2967
|
+
return;
|
|
2968
|
+
}
|
|
2969
|
+
if ((i = a.match(/^\s+extends\s+/)) && i.index === 0) {
|
|
2970
|
+
t.ignoreMatch();
|
|
2971
|
+
return;
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
2974
|
+
}, o = {
|
|
2975
|
+
$pattern: pt,
|
|
2976
|
+
keyword: mt,
|
|
2977
|
+
literal: ht,
|
|
2978
|
+
built_in: bt,
|
|
2979
|
+
"variable.language": yt
|
|
2980
|
+
}, s = "[0-9](_?[0-9])*", c = `\\.(${s})`, l = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", u = {
|
|
2981
|
+
className: "number",
|
|
2982
|
+
variants: [
|
|
2983
|
+
{ begin: `(\\b(${l})((${c})|\\.)?|(${c}))[eE][+-]?(${s})\\b` },
|
|
2984
|
+
{ begin: `\\b(${l})\\b((${c})\\b|\\.)?|(${c})\\b` },
|
|
2985
|
+
{ begin: "\\b(0|[1-9](_?[0-9])*)n\\b" },
|
|
2986
|
+
{ begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },
|
|
2987
|
+
{ begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },
|
|
2988
|
+
{ begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },
|
|
2989
|
+
{ begin: "\\b0[0-7]+n?\\b" }
|
|
2990
|
+
],
|
|
2991
|
+
relevance: 0
|
|
2992
|
+
}, d = {
|
|
2993
|
+
className: "subst",
|
|
2994
|
+
begin: "\\$\\{",
|
|
2995
|
+
end: "\\}",
|
|
2996
|
+
keywords: o,
|
|
2997
|
+
contains: []
|
|
2998
|
+
}, f = {
|
|
2999
|
+
begin: ".?html`",
|
|
3000
|
+
end: "",
|
|
3001
|
+
starts: {
|
|
3002
|
+
end: "`",
|
|
3003
|
+
returnEnd: !1,
|
|
3004
|
+
contains: [e.BACKSLASH_ESCAPE, d],
|
|
3005
|
+
subLanguage: "xml"
|
|
3006
|
+
}
|
|
3007
|
+
}, p = {
|
|
3008
|
+
begin: ".?css`",
|
|
3009
|
+
end: "",
|
|
3010
|
+
starts: {
|
|
3011
|
+
end: "`",
|
|
3012
|
+
returnEnd: !1,
|
|
3013
|
+
contains: [e.BACKSLASH_ESCAPE, d],
|
|
3014
|
+
subLanguage: "css"
|
|
3015
|
+
}
|
|
3016
|
+
}, m = {
|
|
3017
|
+
begin: ".?gql`",
|
|
3018
|
+
end: "",
|
|
3019
|
+
starts: {
|
|
3020
|
+
end: "`",
|
|
3021
|
+
returnEnd: !1,
|
|
3022
|
+
contains: [e.BACKSLASH_ESCAPE, d],
|
|
3023
|
+
subLanguage: "graphql"
|
|
3024
|
+
}
|
|
3025
|
+
}, h = {
|
|
3026
|
+
className: "string",
|
|
3027
|
+
begin: "`",
|
|
3028
|
+
end: "`",
|
|
3029
|
+
contains: [e.BACKSLASH_ESCAPE, d]
|
|
3030
|
+
}, g = {
|
|
3031
|
+
className: "comment",
|
|
3032
|
+
variants: [
|
|
3033
|
+
e.COMMENT(/\/\*\*(?!\/)/, "\\*/", {
|
|
3034
|
+
relevance: 0,
|
|
3035
|
+
contains: [{
|
|
3036
|
+
begin: "(?=@[A-Za-z]+)",
|
|
3037
|
+
relevance: 0,
|
|
3038
|
+
contains: [
|
|
3039
|
+
{
|
|
3040
|
+
className: "doctag",
|
|
3041
|
+
begin: "@[A-Za-z]+"
|
|
3042
|
+
},
|
|
3043
|
+
{
|
|
3044
|
+
className: "type",
|
|
3045
|
+
begin: "\\{",
|
|
3046
|
+
end: "\\}",
|
|
3047
|
+
excludeEnd: !0,
|
|
3048
|
+
excludeBegin: !0,
|
|
3049
|
+
relevance: 0
|
|
3050
|
+
},
|
|
3051
|
+
{
|
|
3052
|
+
className: "variable",
|
|
3053
|
+
begin: n + "(?=\\s*(-)|$)",
|
|
3054
|
+
endsParent: !0,
|
|
3055
|
+
relevance: 0
|
|
3056
|
+
},
|
|
3057
|
+
{
|
|
3058
|
+
begin: /(?=[^\n])\s/,
|
|
3059
|
+
relevance: 0
|
|
3060
|
+
}
|
|
3061
|
+
]
|
|
3062
|
+
}]
|
|
3063
|
+
}),
|
|
3064
|
+
e.C_BLOCK_COMMENT_MODE,
|
|
3065
|
+
e.C_LINE_COMMENT_MODE
|
|
3066
|
+
]
|
|
3067
|
+
}, _ = [
|
|
3068
|
+
e.APOS_STRING_MODE,
|
|
3069
|
+
e.QUOTE_STRING_MODE,
|
|
3070
|
+
f,
|
|
3071
|
+
p,
|
|
3072
|
+
m,
|
|
3073
|
+
h,
|
|
3074
|
+
{ match: /\$\d+/ },
|
|
3075
|
+
u
|
|
3076
|
+
];
|
|
3077
|
+
d.contains = _.concat({
|
|
3078
|
+
begin: /\{/,
|
|
3079
|
+
end: /\}/,
|
|
3080
|
+
keywords: o,
|
|
3081
|
+
contains: ["self"].concat(_)
|
|
3082
|
+
});
|
|
3083
|
+
let v = [].concat(g, d.contains), y = v.concat([{
|
|
3084
|
+
begin: /(\s*)\(/,
|
|
3085
|
+
end: /\)/,
|
|
3086
|
+
keywords: o,
|
|
3087
|
+
contains: ["self"].concat(v)
|
|
3088
|
+
}]), b = {
|
|
3089
|
+
className: "params",
|
|
3090
|
+
begin: /(\s*)\(/,
|
|
3091
|
+
end: /\)/,
|
|
3092
|
+
excludeBegin: !0,
|
|
3093
|
+
excludeEnd: !0,
|
|
3094
|
+
keywords: o,
|
|
3095
|
+
contains: y
|
|
3096
|
+
}, x = { variants: [{
|
|
3097
|
+
match: [
|
|
3098
|
+
/class/,
|
|
3099
|
+
/\s+/,
|
|
3100
|
+
n,
|
|
3101
|
+
/\s+/,
|
|
3102
|
+
/extends/,
|
|
3103
|
+
/\s+/,
|
|
3104
|
+
t.concat(n, "(", t.concat(/\./, n), ")*")
|
|
3105
|
+
],
|
|
3106
|
+
scope: {
|
|
3107
|
+
1: "keyword",
|
|
3108
|
+
3: "title.class",
|
|
3109
|
+
5: "keyword",
|
|
3110
|
+
7: "title.class.inherited"
|
|
3111
|
+
}
|
|
3112
|
+
}, {
|
|
3113
|
+
match: [
|
|
3114
|
+
/class/,
|
|
3115
|
+
/\s+/,
|
|
3116
|
+
n
|
|
3117
|
+
],
|
|
3118
|
+
scope: {
|
|
3119
|
+
1: "keyword",
|
|
3120
|
+
3: "title.class"
|
|
3121
|
+
}
|
|
3122
|
+
}] }, S = {
|
|
3123
|
+
relevance: 0,
|
|
3124
|
+
match: t.either(/\bJSON/, /\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/, /\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/, /\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),
|
|
3125
|
+
className: "title.class",
|
|
3126
|
+
keywords: { _: [...gt, ..._t] }
|
|
3127
|
+
}, C = {
|
|
3128
|
+
label: "use_strict",
|
|
3129
|
+
className: "meta",
|
|
3130
|
+
relevance: 10,
|
|
3131
|
+
begin: /^\s*['"]use (strict|asm)['"]/
|
|
3132
|
+
}, w = {
|
|
3133
|
+
variants: [{ match: [
|
|
3134
|
+
/function/,
|
|
3135
|
+
/\s+/,
|
|
3136
|
+
n,
|
|
3137
|
+
/(?=\s*\()/
|
|
3138
|
+
] }, { match: [/function/, /\s*(?=\()/] }],
|
|
3139
|
+
className: {
|
|
3140
|
+
1: "keyword",
|
|
3141
|
+
3: "title.function"
|
|
3142
|
+
},
|
|
3143
|
+
label: "func.def",
|
|
3144
|
+
contains: [b],
|
|
3145
|
+
illegal: /%/
|
|
3146
|
+
}, T = {
|
|
3147
|
+
relevance: 0,
|
|
3148
|
+
match: /\b[A-Z][A-Z_0-9]+\b/,
|
|
3149
|
+
className: "variable.constant"
|
|
3150
|
+
};
|
|
3151
|
+
function noneOf(e) {
|
|
3152
|
+
return t.concat("(?!", e.join("|"), ")");
|
|
3153
|
+
}
|
|
3154
|
+
let E = {
|
|
3155
|
+
match: t.concat(/\b/, noneOf([
|
|
3156
|
+
...vt,
|
|
3157
|
+
"super",
|
|
3158
|
+
"import"
|
|
3159
|
+
].map((e) => `${e}\\s*\\(`)), n, t.lookahead(/\s*\(/)),
|
|
3160
|
+
className: "title.function",
|
|
3161
|
+
relevance: 0
|
|
3162
|
+
}, D = {
|
|
3163
|
+
begin: t.concat(/\./, t.lookahead(t.concat(n, /(?![0-9A-Za-z$_(])/))),
|
|
3164
|
+
end: n,
|
|
3165
|
+
excludeBegin: !0,
|
|
3166
|
+
keywords: "prototype",
|
|
3167
|
+
className: "property",
|
|
3168
|
+
relevance: 0
|
|
3169
|
+
}, O = {
|
|
3170
|
+
match: [
|
|
3171
|
+
/get|set/,
|
|
3172
|
+
/\s+/,
|
|
3173
|
+
n,
|
|
3174
|
+
/(?=\()/
|
|
3175
|
+
],
|
|
3176
|
+
className: {
|
|
3177
|
+
1: "keyword",
|
|
3178
|
+
3: "title.function"
|
|
3179
|
+
},
|
|
3180
|
+
contains: [{ begin: /\(\)/ }, b]
|
|
3181
|
+
}, k = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>", A = {
|
|
3182
|
+
match: [
|
|
3183
|
+
/const|var|let/,
|
|
3184
|
+
/\s+/,
|
|
3185
|
+
n,
|
|
3186
|
+
/\s*/,
|
|
3187
|
+
/=\s*/,
|
|
3188
|
+
/(async\s*)?/,
|
|
3189
|
+
t.lookahead(k)
|
|
3190
|
+
],
|
|
3191
|
+
keywords: "async",
|
|
3192
|
+
className: {
|
|
3193
|
+
1: "keyword",
|
|
3194
|
+
3: "title.function"
|
|
3195
|
+
},
|
|
3196
|
+
contains: [b]
|
|
3197
|
+
};
|
|
3198
|
+
return {
|
|
3199
|
+
name: "JavaScript",
|
|
3200
|
+
aliases: [
|
|
3201
|
+
"js",
|
|
3202
|
+
"jsx",
|
|
3203
|
+
"mjs",
|
|
3204
|
+
"cjs"
|
|
3205
|
+
],
|
|
3206
|
+
keywords: o,
|
|
3207
|
+
exports: {
|
|
3208
|
+
PARAMS_CONTAINS: y,
|
|
3209
|
+
CLASS_REFERENCE: S
|
|
3210
|
+
},
|
|
3211
|
+
illegal: /#(?![$_A-z])/,
|
|
3212
|
+
contains: [
|
|
3213
|
+
e.SHEBANG({
|
|
3214
|
+
label: "shebang",
|
|
3215
|
+
binary: "node",
|
|
3216
|
+
relevance: 5
|
|
3217
|
+
}),
|
|
3218
|
+
C,
|
|
3219
|
+
e.APOS_STRING_MODE,
|
|
3220
|
+
e.QUOTE_STRING_MODE,
|
|
3221
|
+
f,
|
|
3222
|
+
p,
|
|
3223
|
+
m,
|
|
3224
|
+
h,
|
|
3225
|
+
g,
|
|
3226
|
+
{ match: /\$\d+/ },
|
|
3227
|
+
u,
|
|
3228
|
+
S,
|
|
3229
|
+
{
|
|
3230
|
+
scope: "attr",
|
|
3231
|
+
match: n + t.lookahead(":"),
|
|
3232
|
+
relevance: 0
|
|
3233
|
+
},
|
|
3234
|
+
A,
|
|
3235
|
+
{
|
|
3236
|
+
begin: "(" + e.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
|
|
3237
|
+
keywords: "return throw case",
|
|
3238
|
+
relevance: 0,
|
|
3239
|
+
contains: [
|
|
3240
|
+
g,
|
|
3241
|
+
e.REGEXP_MODE,
|
|
3242
|
+
{
|
|
3243
|
+
className: "function",
|
|
3244
|
+
begin: k,
|
|
3245
|
+
returnBegin: !0,
|
|
3246
|
+
end: "\\s*=>",
|
|
3247
|
+
contains: [{
|
|
3248
|
+
className: "params",
|
|
3249
|
+
variants: [
|
|
3250
|
+
{
|
|
3251
|
+
begin: e.UNDERSCORE_IDENT_RE,
|
|
3252
|
+
relevance: 0
|
|
3253
|
+
},
|
|
3254
|
+
{
|
|
3255
|
+
className: null,
|
|
3256
|
+
begin: /\(\s*\)/,
|
|
3257
|
+
skip: !0
|
|
3258
|
+
},
|
|
3259
|
+
{
|
|
3260
|
+
begin: /(\s*)\(/,
|
|
3261
|
+
end: /\)/,
|
|
3262
|
+
excludeBegin: !0,
|
|
3263
|
+
excludeEnd: !0,
|
|
3264
|
+
keywords: o,
|
|
3265
|
+
contains: y
|
|
3266
|
+
}
|
|
3267
|
+
]
|
|
3268
|
+
}]
|
|
3269
|
+
},
|
|
3270
|
+
{
|
|
3271
|
+
begin: /,/,
|
|
3272
|
+
relevance: 0
|
|
3273
|
+
},
|
|
3274
|
+
{
|
|
3275
|
+
match: /\s+/,
|
|
3276
|
+
relevance: 0
|
|
3277
|
+
},
|
|
3278
|
+
{
|
|
3279
|
+
variants: [
|
|
3280
|
+
{
|
|
3281
|
+
begin: r.begin,
|
|
3282
|
+
end: r.end
|
|
3283
|
+
},
|
|
3284
|
+
{ match: i },
|
|
3285
|
+
{
|
|
3286
|
+
begin: a.begin,
|
|
3287
|
+
"on:begin": a.isTrulyOpeningTag,
|
|
3288
|
+
end: a.end
|
|
3289
|
+
}
|
|
3290
|
+
],
|
|
3291
|
+
subLanguage: "xml",
|
|
3292
|
+
contains: [{
|
|
3293
|
+
begin: a.begin,
|
|
3294
|
+
end: a.end,
|
|
3295
|
+
skip: !0,
|
|
3296
|
+
contains: ["self"]
|
|
3297
|
+
}]
|
|
3298
|
+
}
|
|
3299
|
+
]
|
|
3300
|
+
},
|
|
3301
|
+
w,
|
|
3302
|
+
{ beginKeywords: "while if switch catch for" },
|
|
3303
|
+
{
|
|
3304
|
+
begin: "\\b(?!function)" + e.UNDERSCORE_IDENT_RE + "\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
|
|
3305
|
+
returnBegin: !0,
|
|
3306
|
+
label: "func.def",
|
|
3307
|
+
contains: [b, e.inherit(e.TITLE_MODE, {
|
|
3308
|
+
begin: n,
|
|
3309
|
+
className: "title.function"
|
|
3310
|
+
})]
|
|
3311
|
+
},
|
|
3312
|
+
{
|
|
3313
|
+
match: /\.\.\./,
|
|
3314
|
+
relevance: 0
|
|
3315
|
+
},
|
|
3316
|
+
D,
|
|
3317
|
+
{
|
|
3318
|
+
match: "\\$" + n,
|
|
3319
|
+
relevance: 0
|
|
3320
|
+
},
|
|
3321
|
+
{
|
|
3322
|
+
match: [/\bconstructor(?=\s*\()/],
|
|
3323
|
+
className: { 1: "title.function" },
|
|
3324
|
+
contains: [b]
|
|
3325
|
+
},
|
|
3326
|
+
E,
|
|
3327
|
+
T,
|
|
3328
|
+
x,
|
|
3329
|
+
O,
|
|
3330
|
+
{ match: /\$[(.]/ }
|
|
3331
|
+
]
|
|
3332
|
+
};
|
|
3333
|
+
}
|
|
3334
|
+
__name(javascript$1, "javascript");
|
|
3335
|
+
//#endregion
|
|
3336
|
+
//#region ../../node_modules/highlight.js/es/languages/typescript.js
|
|
3337
|
+
var $ = "[A-Za-z$_][0-9A-Za-z$_]*", xt = /* @__PURE__ */ "as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using".split("."), St = [
|
|
3338
|
+
"true",
|
|
3339
|
+
"false",
|
|
3340
|
+
"null",
|
|
3341
|
+
"undefined",
|
|
3342
|
+
"NaN",
|
|
3343
|
+
"Infinity"
|
|
3344
|
+
], Ct = /* @__PURE__ */ "Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly".split("."), wt = [
|
|
3345
|
+
"Error",
|
|
3346
|
+
"EvalError",
|
|
3347
|
+
"InternalError",
|
|
3348
|
+
"RangeError",
|
|
3349
|
+
"ReferenceError",
|
|
3350
|
+
"SyntaxError",
|
|
3351
|
+
"TypeError",
|
|
3352
|
+
"URIError"
|
|
3353
|
+
], Tt = [
|
|
3354
|
+
"setInterval",
|
|
3355
|
+
"setTimeout",
|
|
3356
|
+
"clearInterval",
|
|
3357
|
+
"clearTimeout",
|
|
3358
|
+
"require",
|
|
3359
|
+
"exports",
|
|
3360
|
+
"eval",
|
|
3361
|
+
"isFinite",
|
|
3362
|
+
"isNaN",
|
|
3363
|
+
"parseFloat",
|
|
3364
|
+
"parseInt",
|
|
3365
|
+
"decodeURI",
|
|
3366
|
+
"decodeURIComponent",
|
|
3367
|
+
"encodeURI",
|
|
3368
|
+
"encodeURIComponent",
|
|
3369
|
+
"escape",
|
|
3370
|
+
"unescape"
|
|
3371
|
+
], Et = [
|
|
3372
|
+
"arguments",
|
|
3373
|
+
"this",
|
|
3374
|
+
"super",
|
|
3375
|
+
"console",
|
|
3376
|
+
"window",
|
|
3377
|
+
"document",
|
|
3378
|
+
"localStorage",
|
|
3379
|
+
"sessionStorage",
|
|
3380
|
+
"module",
|
|
3381
|
+
"global"
|
|
3382
|
+
], Dt = [].concat(Tt, Ct, wt);
|
|
3383
|
+
function javascript(e) {
|
|
3384
|
+
let t = e.regex, hasClosingTag = (e, { after: t }) => {
|
|
3385
|
+
let n = "</" + e[0].slice(1);
|
|
3386
|
+
return e.input.indexOf(n, t) !== -1;
|
|
3387
|
+
}, n = $, r = {
|
|
3388
|
+
begin: "<>",
|
|
3389
|
+
end: "</>"
|
|
3390
|
+
}, i = /<[A-Za-z0-9\\._:-]+\s*\/>/, a = {
|
|
3391
|
+
begin: /<[A-Za-z0-9\\._:-]+/,
|
|
3392
|
+
end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
|
|
3393
|
+
isTrulyOpeningTag: (e, t) => {
|
|
3394
|
+
let n = e[0].length + e.index, r = e.input[n];
|
|
3395
|
+
if (r === "<" || r === ",") {
|
|
3396
|
+
t.ignoreMatch();
|
|
3397
|
+
return;
|
|
3398
|
+
}
|
|
3399
|
+
r === ">" && (hasClosingTag(e, { after: n }) || t.ignoreMatch());
|
|
3400
|
+
let i, a = e.input.substring(n);
|
|
3401
|
+
if (i = a.match(/^\s*=/)) {
|
|
3402
|
+
t.ignoreMatch();
|
|
3403
|
+
return;
|
|
3404
|
+
}
|
|
3405
|
+
if ((i = a.match(/^\s+extends\s+/)) && i.index === 0) {
|
|
3406
|
+
t.ignoreMatch();
|
|
3407
|
+
return;
|
|
3408
|
+
}
|
|
3409
|
+
}
|
|
3410
|
+
}, o = {
|
|
3411
|
+
$pattern: $,
|
|
3412
|
+
keyword: xt,
|
|
3413
|
+
literal: St,
|
|
3414
|
+
built_in: Dt,
|
|
3415
|
+
"variable.language": Et
|
|
3416
|
+
}, s = "[0-9](_?[0-9])*", c = `\\.(${s})`, l = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", u = {
|
|
3417
|
+
className: "number",
|
|
3418
|
+
variants: [
|
|
3419
|
+
{ begin: `(\\b(${l})((${c})|\\.)?|(${c}))[eE][+-]?(${s})\\b` },
|
|
3420
|
+
{ begin: `\\b(${l})\\b((${c})\\b|\\.)?|(${c})\\b` },
|
|
3421
|
+
{ begin: "\\b(0|[1-9](_?[0-9])*)n\\b" },
|
|
3422
|
+
{ begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },
|
|
3423
|
+
{ begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },
|
|
3424
|
+
{ begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },
|
|
3425
|
+
{ begin: "\\b0[0-7]+n?\\b" }
|
|
3426
|
+
],
|
|
3427
|
+
relevance: 0
|
|
3428
|
+
}, d = {
|
|
3429
|
+
className: "subst",
|
|
3430
|
+
begin: "\\$\\{",
|
|
3431
|
+
end: "\\}",
|
|
3432
|
+
keywords: o,
|
|
3433
|
+
contains: []
|
|
3434
|
+
}, f = {
|
|
3435
|
+
begin: ".?html`",
|
|
3436
|
+
end: "",
|
|
3437
|
+
starts: {
|
|
3438
|
+
end: "`",
|
|
3439
|
+
returnEnd: !1,
|
|
3440
|
+
contains: [e.BACKSLASH_ESCAPE, d],
|
|
3441
|
+
subLanguage: "xml"
|
|
3442
|
+
}
|
|
3443
|
+
}, p = {
|
|
3444
|
+
begin: ".?css`",
|
|
3445
|
+
end: "",
|
|
3446
|
+
starts: {
|
|
3447
|
+
end: "`",
|
|
3448
|
+
returnEnd: !1,
|
|
3449
|
+
contains: [e.BACKSLASH_ESCAPE, d],
|
|
3450
|
+
subLanguage: "css"
|
|
3451
|
+
}
|
|
3452
|
+
}, m = {
|
|
3453
|
+
begin: ".?gql`",
|
|
3454
|
+
end: "",
|
|
3455
|
+
starts: {
|
|
3456
|
+
end: "`",
|
|
3457
|
+
returnEnd: !1,
|
|
3458
|
+
contains: [e.BACKSLASH_ESCAPE, d],
|
|
3459
|
+
subLanguage: "graphql"
|
|
3460
|
+
}
|
|
3461
|
+
}, h = {
|
|
3462
|
+
className: "string",
|
|
3463
|
+
begin: "`",
|
|
3464
|
+
end: "`",
|
|
3465
|
+
contains: [e.BACKSLASH_ESCAPE, d]
|
|
3466
|
+
}, g = {
|
|
3467
|
+
className: "comment",
|
|
3468
|
+
variants: [
|
|
3469
|
+
e.COMMENT(/\/\*\*(?!\/)/, "\\*/", {
|
|
3470
|
+
relevance: 0,
|
|
3471
|
+
contains: [{
|
|
3472
|
+
begin: "(?=@[A-Za-z]+)",
|
|
3473
|
+
relevance: 0,
|
|
3474
|
+
contains: [
|
|
3475
|
+
{
|
|
3476
|
+
className: "doctag",
|
|
3477
|
+
begin: "@[A-Za-z]+"
|
|
3478
|
+
},
|
|
3479
|
+
{
|
|
3480
|
+
className: "type",
|
|
3481
|
+
begin: "\\{",
|
|
3482
|
+
end: "\\}",
|
|
3483
|
+
excludeEnd: !0,
|
|
3484
|
+
excludeBegin: !0,
|
|
3485
|
+
relevance: 0
|
|
3486
|
+
},
|
|
3487
|
+
{
|
|
3488
|
+
className: "variable",
|
|
3489
|
+
begin: n + "(?=\\s*(-)|$)",
|
|
3490
|
+
endsParent: !0,
|
|
3491
|
+
relevance: 0
|
|
3492
|
+
},
|
|
3493
|
+
{
|
|
3494
|
+
begin: /(?=[^\n])\s/,
|
|
3495
|
+
relevance: 0
|
|
3496
|
+
}
|
|
3497
|
+
]
|
|
3498
|
+
}]
|
|
3499
|
+
}),
|
|
3500
|
+
e.C_BLOCK_COMMENT_MODE,
|
|
3501
|
+
e.C_LINE_COMMENT_MODE
|
|
3502
|
+
]
|
|
3503
|
+
}, _ = [
|
|
3504
|
+
e.APOS_STRING_MODE,
|
|
3505
|
+
e.QUOTE_STRING_MODE,
|
|
3506
|
+
f,
|
|
3507
|
+
p,
|
|
3508
|
+
m,
|
|
3509
|
+
h,
|
|
3510
|
+
{ match: /\$\d+/ },
|
|
3511
|
+
u
|
|
3512
|
+
];
|
|
3513
|
+
d.contains = _.concat({
|
|
3514
|
+
begin: /\{/,
|
|
3515
|
+
end: /\}/,
|
|
3516
|
+
keywords: o,
|
|
3517
|
+
contains: ["self"].concat(_)
|
|
3518
|
+
});
|
|
3519
|
+
let v = [].concat(g, d.contains), y = v.concat([{
|
|
3520
|
+
begin: /(\s*)\(/,
|
|
3521
|
+
end: /\)/,
|
|
3522
|
+
keywords: o,
|
|
3523
|
+
contains: ["self"].concat(v)
|
|
3524
|
+
}]), b = {
|
|
3525
|
+
className: "params",
|
|
3526
|
+
begin: /(\s*)\(/,
|
|
3527
|
+
end: /\)/,
|
|
3528
|
+
excludeBegin: !0,
|
|
3529
|
+
excludeEnd: !0,
|
|
3530
|
+
keywords: o,
|
|
3531
|
+
contains: y
|
|
3532
|
+
}, x = { variants: [{
|
|
3533
|
+
match: [
|
|
3534
|
+
/class/,
|
|
3535
|
+
/\s+/,
|
|
3536
|
+
n,
|
|
3537
|
+
/\s+/,
|
|
3538
|
+
/extends/,
|
|
3539
|
+
/\s+/,
|
|
3540
|
+
t.concat(n, "(", t.concat(/\./, n), ")*")
|
|
3541
|
+
],
|
|
3542
|
+
scope: {
|
|
3543
|
+
1: "keyword",
|
|
3544
|
+
3: "title.class",
|
|
3545
|
+
5: "keyword",
|
|
3546
|
+
7: "title.class.inherited"
|
|
3547
|
+
}
|
|
3548
|
+
}, {
|
|
3549
|
+
match: [
|
|
3550
|
+
/class/,
|
|
3551
|
+
/\s+/,
|
|
3552
|
+
n
|
|
3553
|
+
],
|
|
3554
|
+
scope: {
|
|
3555
|
+
1: "keyword",
|
|
3556
|
+
3: "title.class"
|
|
3557
|
+
}
|
|
3558
|
+
}] }, S = {
|
|
3559
|
+
relevance: 0,
|
|
3560
|
+
match: t.either(/\bJSON/, /\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/, /\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/, /\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),
|
|
3561
|
+
className: "title.class",
|
|
3562
|
+
keywords: { _: [...Ct, ...wt] }
|
|
3563
|
+
}, C = {
|
|
3564
|
+
label: "use_strict",
|
|
3565
|
+
className: "meta",
|
|
3566
|
+
relevance: 10,
|
|
3567
|
+
begin: /^\s*['"]use (strict|asm)['"]/
|
|
3568
|
+
}, w = {
|
|
3569
|
+
variants: [{ match: [
|
|
3570
|
+
/function/,
|
|
3571
|
+
/\s+/,
|
|
3572
|
+
n,
|
|
3573
|
+
/(?=\s*\()/
|
|
3574
|
+
] }, { match: [/function/, /\s*(?=\()/] }],
|
|
3575
|
+
className: {
|
|
3576
|
+
1: "keyword",
|
|
3577
|
+
3: "title.function"
|
|
3578
|
+
},
|
|
3579
|
+
label: "func.def",
|
|
3580
|
+
contains: [b],
|
|
3581
|
+
illegal: /%/
|
|
3582
|
+
}, T = {
|
|
3583
|
+
relevance: 0,
|
|
3584
|
+
match: /\b[A-Z][A-Z_0-9]+\b/,
|
|
3585
|
+
className: "variable.constant"
|
|
3586
|
+
};
|
|
3587
|
+
function noneOf(e) {
|
|
3588
|
+
return t.concat("(?!", e.join("|"), ")");
|
|
3589
|
+
}
|
|
3590
|
+
let E = {
|
|
3591
|
+
match: t.concat(/\b/, noneOf([
|
|
3592
|
+
...Tt,
|
|
3593
|
+
"super",
|
|
3594
|
+
"import"
|
|
3595
|
+
].map((e) => `${e}\\s*\\(`)), n, t.lookahead(/\s*\(/)),
|
|
3596
|
+
className: "title.function",
|
|
3597
|
+
relevance: 0
|
|
3598
|
+
}, D = {
|
|
3599
|
+
begin: t.concat(/\./, t.lookahead(t.concat(n, /(?![0-9A-Za-z$_(])/))),
|
|
3600
|
+
end: n,
|
|
3601
|
+
excludeBegin: !0,
|
|
3602
|
+
keywords: "prototype",
|
|
3603
|
+
className: "property",
|
|
3604
|
+
relevance: 0
|
|
3605
|
+
}, O = {
|
|
3606
|
+
match: [
|
|
3607
|
+
/get|set/,
|
|
3608
|
+
/\s+/,
|
|
3609
|
+
n,
|
|
3610
|
+
/(?=\()/
|
|
3611
|
+
],
|
|
3612
|
+
className: {
|
|
3613
|
+
1: "keyword",
|
|
3614
|
+
3: "title.function"
|
|
3615
|
+
},
|
|
3616
|
+
contains: [{ begin: /\(\)/ }, b]
|
|
3617
|
+
}, k = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>", A = {
|
|
3618
|
+
match: [
|
|
3619
|
+
/const|var|let/,
|
|
3620
|
+
/\s+/,
|
|
3621
|
+
n,
|
|
3622
|
+
/\s*/,
|
|
3623
|
+
/=\s*/,
|
|
3624
|
+
/(async\s*)?/,
|
|
3625
|
+
t.lookahead(k)
|
|
3626
|
+
],
|
|
3627
|
+
keywords: "async",
|
|
3628
|
+
className: {
|
|
3629
|
+
1: "keyword",
|
|
3630
|
+
3: "title.function"
|
|
3631
|
+
},
|
|
3632
|
+
contains: [b]
|
|
3633
|
+
};
|
|
3634
|
+
return {
|
|
3635
|
+
name: "JavaScript",
|
|
3636
|
+
aliases: [
|
|
3637
|
+
"js",
|
|
3638
|
+
"jsx",
|
|
3639
|
+
"mjs",
|
|
3640
|
+
"cjs"
|
|
3641
|
+
],
|
|
3642
|
+
keywords: o,
|
|
3643
|
+
exports: {
|
|
3644
|
+
PARAMS_CONTAINS: y,
|
|
3645
|
+
CLASS_REFERENCE: S
|
|
3646
|
+
},
|
|
3647
|
+
illegal: /#(?![$_A-z])/,
|
|
3648
|
+
contains: [
|
|
3649
|
+
e.SHEBANG({
|
|
3650
|
+
label: "shebang",
|
|
3651
|
+
binary: "node",
|
|
3652
|
+
relevance: 5
|
|
3653
|
+
}),
|
|
3654
|
+
C,
|
|
3655
|
+
e.APOS_STRING_MODE,
|
|
3656
|
+
e.QUOTE_STRING_MODE,
|
|
3657
|
+
f,
|
|
3658
|
+
p,
|
|
3659
|
+
m,
|
|
3660
|
+
h,
|
|
3661
|
+
g,
|
|
3662
|
+
{ match: /\$\d+/ },
|
|
3663
|
+
u,
|
|
3664
|
+
S,
|
|
3665
|
+
{
|
|
3666
|
+
scope: "attr",
|
|
3667
|
+
match: n + t.lookahead(":"),
|
|
3668
|
+
relevance: 0
|
|
3669
|
+
},
|
|
3670
|
+
A,
|
|
3671
|
+
{
|
|
3672
|
+
begin: "(" + e.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
|
|
3673
|
+
keywords: "return throw case",
|
|
3674
|
+
relevance: 0,
|
|
3675
|
+
contains: [
|
|
3676
|
+
g,
|
|
3677
|
+
e.REGEXP_MODE,
|
|
3678
|
+
{
|
|
3679
|
+
className: "function",
|
|
3680
|
+
begin: k,
|
|
3681
|
+
returnBegin: !0,
|
|
3682
|
+
end: "\\s*=>",
|
|
3683
|
+
contains: [{
|
|
3684
|
+
className: "params",
|
|
3685
|
+
variants: [
|
|
3686
|
+
{
|
|
3687
|
+
begin: e.UNDERSCORE_IDENT_RE,
|
|
3688
|
+
relevance: 0
|
|
3689
|
+
},
|
|
3690
|
+
{
|
|
3691
|
+
className: null,
|
|
3692
|
+
begin: /\(\s*\)/,
|
|
3693
|
+
skip: !0
|
|
3694
|
+
},
|
|
3695
|
+
{
|
|
3696
|
+
begin: /(\s*)\(/,
|
|
3697
|
+
end: /\)/,
|
|
3698
|
+
excludeBegin: !0,
|
|
3699
|
+
excludeEnd: !0,
|
|
3700
|
+
keywords: o,
|
|
3701
|
+
contains: y
|
|
3702
|
+
}
|
|
3703
|
+
]
|
|
3704
|
+
}]
|
|
3705
|
+
},
|
|
3706
|
+
{
|
|
3707
|
+
begin: /,/,
|
|
3708
|
+
relevance: 0
|
|
3709
|
+
},
|
|
3710
|
+
{
|
|
3711
|
+
match: /\s+/,
|
|
3712
|
+
relevance: 0
|
|
3713
|
+
},
|
|
3714
|
+
{
|
|
3715
|
+
variants: [
|
|
3716
|
+
{
|
|
3717
|
+
begin: r.begin,
|
|
3718
|
+
end: r.end
|
|
3719
|
+
},
|
|
3720
|
+
{ match: i },
|
|
3721
|
+
{
|
|
3722
|
+
begin: a.begin,
|
|
3723
|
+
"on:begin": a.isTrulyOpeningTag,
|
|
3724
|
+
end: a.end
|
|
3725
|
+
}
|
|
3726
|
+
],
|
|
3727
|
+
subLanguage: "xml",
|
|
3728
|
+
contains: [{
|
|
3729
|
+
begin: a.begin,
|
|
3730
|
+
end: a.end,
|
|
3731
|
+
skip: !0,
|
|
3732
|
+
contains: ["self"]
|
|
3733
|
+
}]
|
|
3734
|
+
}
|
|
3735
|
+
]
|
|
3736
|
+
},
|
|
3737
|
+
w,
|
|
3738
|
+
{ beginKeywords: "while if switch catch for" },
|
|
3739
|
+
{
|
|
3740
|
+
begin: "\\b(?!function)" + e.UNDERSCORE_IDENT_RE + "\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
|
|
3741
|
+
returnBegin: !0,
|
|
3742
|
+
label: "func.def",
|
|
3743
|
+
contains: [b, e.inherit(e.TITLE_MODE, {
|
|
3744
|
+
begin: n,
|
|
3745
|
+
className: "title.function"
|
|
3746
|
+
})]
|
|
3747
|
+
},
|
|
3748
|
+
{
|
|
3749
|
+
match: /\.\.\./,
|
|
3750
|
+
relevance: 0
|
|
3751
|
+
},
|
|
3752
|
+
D,
|
|
3753
|
+
{
|
|
3754
|
+
match: "\\$" + n,
|
|
3755
|
+
relevance: 0
|
|
3756
|
+
},
|
|
3757
|
+
{
|
|
3758
|
+
match: [/\bconstructor(?=\s*\()/],
|
|
3759
|
+
className: { 1: "title.function" },
|
|
3760
|
+
contains: [b]
|
|
3761
|
+
},
|
|
3762
|
+
E,
|
|
3763
|
+
T,
|
|
3764
|
+
x,
|
|
3765
|
+
O,
|
|
3766
|
+
{ match: /\$[(.]/ }
|
|
3767
|
+
]
|
|
3768
|
+
};
|
|
3769
|
+
}
|
|
3770
|
+
function typescript(e) {
|
|
3771
|
+
let t = e.regex, n = javascript(e), r = $, i = [
|
|
3772
|
+
"any",
|
|
3773
|
+
"void",
|
|
3774
|
+
"number",
|
|
3775
|
+
"boolean",
|
|
3776
|
+
"string",
|
|
3777
|
+
"object",
|
|
3778
|
+
"never",
|
|
3779
|
+
"symbol",
|
|
3780
|
+
"bigint",
|
|
3781
|
+
"unknown"
|
|
3782
|
+
], a = {
|
|
3783
|
+
begin: [
|
|
3784
|
+
/namespace/,
|
|
3785
|
+
/\s+/,
|
|
3786
|
+
e.IDENT_RE
|
|
3787
|
+
],
|
|
3788
|
+
beginScope: {
|
|
3789
|
+
1: "keyword",
|
|
3790
|
+
3: "title.class"
|
|
3791
|
+
}
|
|
3792
|
+
}, o = {
|
|
3793
|
+
beginKeywords: "interface",
|
|
3794
|
+
end: /\{/,
|
|
3795
|
+
excludeEnd: !0,
|
|
3796
|
+
keywords: {
|
|
3797
|
+
keyword: "interface extends",
|
|
3798
|
+
built_in: i
|
|
3799
|
+
},
|
|
3800
|
+
contains: [n.exports.CLASS_REFERENCE]
|
|
3801
|
+
}, s = {
|
|
3802
|
+
className: "meta",
|
|
3803
|
+
relevance: 10,
|
|
3804
|
+
begin: /^\s*['"]use strict['"]/
|
|
3805
|
+
}, c = {
|
|
3806
|
+
$pattern: $,
|
|
3807
|
+
keyword: xt.concat([
|
|
3808
|
+
"type",
|
|
3809
|
+
"interface",
|
|
3810
|
+
"public",
|
|
3811
|
+
"private",
|
|
3812
|
+
"protected",
|
|
3813
|
+
"implements",
|
|
3814
|
+
"declare",
|
|
3815
|
+
"abstract",
|
|
3816
|
+
"readonly",
|
|
3817
|
+
"enum",
|
|
3818
|
+
"override",
|
|
3819
|
+
"satisfies"
|
|
3820
|
+
]),
|
|
3821
|
+
literal: St,
|
|
3822
|
+
built_in: Dt.concat(i),
|
|
3823
|
+
"variable.language": Et
|
|
3824
|
+
}, l = {
|
|
3825
|
+
className: "meta",
|
|
3826
|
+
begin: "@" + r
|
|
3827
|
+
}, swapMode = (e, t, n) => {
|
|
3828
|
+
let r = e.contains.findIndex((e) => e.label === t);
|
|
3829
|
+
if (r === -1) throw Error("can not find mode to replace");
|
|
3830
|
+
e.contains.splice(r, 1, n);
|
|
3831
|
+
};
|
|
3832
|
+
Object.assign(n.keywords, c), n.exports.PARAMS_CONTAINS.push(l);
|
|
3833
|
+
let u = n.contains.find((e) => e.scope === "attr"), d = Object.assign({}, u, { match: t.concat(r, t.lookahead(/\s*\?:/)) });
|
|
3834
|
+
n.exports.PARAMS_CONTAINS.push([
|
|
3835
|
+
n.exports.CLASS_REFERENCE,
|
|
3836
|
+
u,
|
|
3837
|
+
d
|
|
3838
|
+
]), n.contains = n.contains.concat([
|
|
3839
|
+
l,
|
|
3840
|
+
a,
|
|
3841
|
+
o,
|
|
3842
|
+
d
|
|
3843
|
+
]), swapMode(n, "shebang", e.SHEBANG()), swapMode(n, "use_strict", s);
|
|
3844
|
+
let f = n.contains.find((e) => e.label === "func.def");
|
|
3845
|
+
return f.relevance = 0, Object.assign(n, {
|
|
3846
|
+
name: "TypeScript",
|
|
3847
|
+
aliases: [
|
|
3848
|
+
"ts",
|
|
3849
|
+
"tsx",
|
|
3850
|
+
"mts",
|
|
3851
|
+
"cts"
|
|
3852
|
+
]
|
|
3853
|
+
}), n;
|
|
3854
|
+
}
|
|
3855
|
+
//#endregion
|
|
3856
|
+
//#region ../../node_modules/highlight.js/es/languages/css.js
|
|
3857
|
+
var MODES = (e) => ({
|
|
3858
|
+
IMPORTANT: {
|
|
3859
|
+
scope: "meta",
|
|
3860
|
+
begin: "!important"
|
|
3861
|
+
},
|
|
3862
|
+
BLOCK_COMMENT: e.C_BLOCK_COMMENT_MODE,
|
|
3863
|
+
HEXCOLOR: {
|
|
3864
|
+
scope: "number",
|
|
3865
|
+
begin: /#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/
|
|
3866
|
+
},
|
|
3867
|
+
FUNCTION_DISPATCH: {
|
|
3868
|
+
className: "built_in",
|
|
3869
|
+
begin: /[\w-]+(?=\()/
|
|
3870
|
+
},
|
|
3871
|
+
ATTRIBUTE_SELECTOR_MODE: {
|
|
3872
|
+
scope: "selector-attr",
|
|
3873
|
+
begin: /\[/,
|
|
3874
|
+
end: /\]/,
|
|
3875
|
+
illegal: "$",
|
|
3876
|
+
contains: [e.APOS_STRING_MODE, e.QUOTE_STRING_MODE]
|
|
3877
|
+
},
|
|
3878
|
+
CSS_NUMBER_MODE: {
|
|
3879
|
+
scope: "number",
|
|
3880
|
+
begin: e.NUMBER_RE + "(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",
|
|
3881
|
+
relevance: 0
|
|
3882
|
+
},
|
|
3883
|
+
CSS_VARIABLE: {
|
|
3884
|
+
className: "attr",
|
|
3885
|
+
begin: /--[A-Za-z_][A-Za-z0-9_-]*/
|
|
3886
|
+
}
|
|
3887
|
+
}), Ot = /* @__PURE__ */ "a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video".split("."), kt = /* @__PURE__ */ "defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath".split("."), At = [...Ot, ...kt], jt = (/* @__PURE__ */ "any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height".split(".")).sort().reverse(), Mt = (/* @__PURE__ */ "active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where".split(".")).sort().reverse(), Nt = [
|
|
3888
|
+
"after",
|
|
3889
|
+
"backdrop",
|
|
3890
|
+
"before",
|
|
3891
|
+
"cue",
|
|
3892
|
+
"cue-region",
|
|
3893
|
+
"first-letter",
|
|
3894
|
+
"first-line",
|
|
3895
|
+
"grammar-error",
|
|
3896
|
+
"marker",
|
|
3897
|
+
"part",
|
|
3898
|
+
"placeholder",
|
|
3899
|
+
"selection",
|
|
3900
|
+
"slotted",
|
|
3901
|
+
"spelling-error"
|
|
3902
|
+
].sort().reverse(), Pt = (/* @__PURE__ */ "accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom".split(".")).sort().reverse();
|
|
3903
|
+
function css(e) {
|
|
3904
|
+
let t = e.regex, n = MODES(e), r = { begin: /-(webkit|moz|ms|o)-(?=[a-z])/ }, i = /@-?\w[\w]*(-\w+)*/, a = [e.APOS_STRING_MODE, e.QUOTE_STRING_MODE];
|
|
3905
|
+
return {
|
|
3906
|
+
name: "CSS",
|
|
3907
|
+
case_insensitive: !0,
|
|
3908
|
+
illegal: /[=|'\$]/,
|
|
3909
|
+
keywords: { keyframePosition: "from to" },
|
|
3910
|
+
classNameAliases: { keyframePosition: "selector-tag" },
|
|
3911
|
+
contains: [
|
|
3912
|
+
n.BLOCK_COMMENT,
|
|
3913
|
+
r,
|
|
3914
|
+
n.CSS_NUMBER_MODE,
|
|
3915
|
+
{
|
|
3916
|
+
className: "selector-id",
|
|
3917
|
+
begin: /#[A-Za-z0-9_-]+/,
|
|
3918
|
+
relevance: 0
|
|
3919
|
+
},
|
|
3920
|
+
{
|
|
3921
|
+
className: "selector-class",
|
|
3922
|
+
begin: "\\.[a-zA-Z-][a-zA-Z0-9_-]*",
|
|
3923
|
+
relevance: 0
|
|
3924
|
+
},
|
|
3925
|
+
n.ATTRIBUTE_SELECTOR_MODE,
|
|
3926
|
+
{
|
|
3927
|
+
className: "selector-pseudo",
|
|
3928
|
+
variants: [{ begin: ":(" + Mt.join("|") + ")" }, { begin: ":(:)?(" + Nt.join("|") + ")" }]
|
|
3929
|
+
},
|
|
3930
|
+
n.CSS_VARIABLE,
|
|
3931
|
+
{
|
|
3932
|
+
className: "attribute",
|
|
3933
|
+
begin: "\\b(" + Pt.join("|") + ")\\b"
|
|
3934
|
+
},
|
|
3935
|
+
{
|
|
3936
|
+
begin: /:/,
|
|
3937
|
+
end: /[;}{]/,
|
|
3938
|
+
contains: [
|
|
3939
|
+
n.BLOCK_COMMENT,
|
|
3940
|
+
n.HEXCOLOR,
|
|
3941
|
+
n.IMPORTANT,
|
|
3942
|
+
n.CSS_NUMBER_MODE,
|
|
3943
|
+
...a,
|
|
3944
|
+
{
|
|
3945
|
+
begin: /(url|data-uri)\(/,
|
|
3946
|
+
end: /\)/,
|
|
3947
|
+
relevance: 0,
|
|
3948
|
+
keywords: { built_in: "url data-uri" },
|
|
3949
|
+
contains: [...a, {
|
|
3950
|
+
className: "string",
|
|
3951
|
+
begin: /[^)]/,
|
|
3952
|
+
endsWithParent: !0,
|
|
3953
|
+
excludeEnd: !0
|
|
3954
|
+
}]
|
|
3955
|
+
},
|
|
3956
|
+
n.FUNCTION_DISPATCH
|
|
3957
|
+
]
|
|
3958
|
+
},
|
|
3959
|
+
{
|
|
3960
|
+
begin: t.lookahead(/@/),
|
|
3961
|
+
end: "[{;]",
|
|
3962
|
+
relevance: 0,
|
|
3963
|
+
illegal: /:/,
|
|
3964
|
+
contains: [{
|
|
3965
|
+
className: "keyword",
|
|
3966
|
+
begin: i
|
|
3967
|
+
}, {
|
|
3968
|
+
begin: /\s/,
|
|
3969
|
+
endsWithParent: !0,
|
|
3970
|
+
excludeEnd: !0,
|
|
3971
|
+
relevance: 0,
|
|
3972
|
+
keywords: {
|
|
3973
|
+
$pattern: /[a-z-]+/,
|
|
3974
|
+
keyword: "and or not only",
|
|
3975
|
+
attribute: jt.join(" ")
|
|
3976
|
+
},
|
|
3977
|
+
contains: [
|
|
3978
|
+
{
|
|
3979
|
+
begin: /[a-z-]+(?=:)/,
|
|
3980
|
+
className: "attribute"
|
|
3981
|
+
},
|
|
3982
|
+
...a,
|
|
3983
|
+
n.CSS_NUMBER_MODE
|
|
3984
|
+
]
|
|
3985
|
+
}]
|
|
3986
|
+
},
|
|
3987
|
+
{
|
|
3988
|
+
className: "selector-tag",
|
|
3989
|
+
begin: "\\b(" + At.join("|") + ")\\b"
|
|
3990
|
+
}
|
|
3991
|
+
]
|
|
3992
|
+
};
|
|
3993
|
+
}
|
|
3994
|
+
//#endregion
|
|
3995
|
+
//#region ../../node_modules/highlight.js/es/languages/xml.js
|
|
3996
|
+
function xml(e) {
|
|
3997
|
+
let t = e.regex, n = t.concat(/[\p{L}_]/u, t.optional(/[\p{L}0-9_.-]*:/u), /[\p{L}0-9_.-]*/u), r = /[\p{L}0-9._:-]+/u, i = {
|
|
3998
|
+
className: "symbol",
|
|
3999
|
+
begin: /&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/
|
|
4000
|
+
}, a = {
|
|
4001
|
+
begin: /\s/,
|
|
4002
|
+
contains: [{
|
|
4003
|
+
className: "keyword",
|
|
4004
|
+
begin: /#?[a-z_][a-z1-9_-]+/,
|
|
4005
|
+
illegal: /\n/
|
|
4006
|
+
}]
|
|
4007
|
+
}, o = e.inherit(a, {
|
|
4008
|
+
begin: /\(/,
|
|
4009
|
+
end: /\)/
|
|
4010
|
+
}), s = e.inherit(e.APOS_STRING_MODE, { className: "string" }), c = e.inherit(e.QUOTE_STRING_MODE, { className: "string" }), l = {
|
|
4011
|
+
endsWithParent: !0,
|
|
4012
|
+
illegal: /</,
|
|
4013
|
+
relevance: 0,
|
|
4014
|
+
contains: [{
|
|
4015
|
+
className: "attr",
|
|
4016
|
+
begin: r,
|
|
4017
|
+
relevance: 0
|
|
4018
|
+
}, {
|
|
4019
|
+
begin: /=\s*/,
|
|
4020
|
+
relevance: 0,
|
|
4021
|
+
contains: [{
|
|
4022
|
+
className: "string",
|
|
4023
|
+
endsParent: !0,
|
|
4024
|
+
variants: [
|
|
4025
|
+
{
|
|
4026
|
+
begin: /"/,
|
|
4027
|
+
end: /"/,
|
|
4028
|
+
contains: [i]
|
|
4029
|
+
},
|
|
4030
|
+
{
|
|
4031
|
+
begin: /'/,
|
|
4032
|
+
end: /'/,
|
|
4033
|
+
contains: [i]
|
|
4034
|
+
},
|
|
4035
|
+
{ begin: /[^\s"'=<>`]+/ }
|
|
4036
|
+
]
|
|
4037
|
+
}]
|
|
4038
|
+
}]
|
|
4039
|
+
};
|
|
4040
|
+
return {
|
|
4041
|
+
name: "HTML, XML",
|
|
4042
|
+
aliases: [
|
|
4043
|
+
"html",
|
|
4044
|
+
"xhtml",
|
|
4045
|
+
"rss",
|
|
4046
|
+
"atom",
|
|
4047
|
+
"xjb",
|
|
4048
|
+
"xsd",
|
|
4049
|
+
"xsl",
|
|
4050
|
+
"plist",
|
|
4051
|
+
"wsf",
|
|
4052
|
+
"svg"
|
|
4053
|
+
],
|
|
4054
|
+
case_insensitive: !0,
|
|
4055
|
+
unicodeRegex: !0,
|
|
4056
|
+
contains: [
|
|
4057
|
+
{
|
|
4058
|
+
className: "meta",
|
|
4059
|
+
begin: /<![a-z]/,
|
|
4060
|
+
end: />/,
|
|
4061
|
+
relevance: 10,
|
|
4062
|
+
contains: [
|
|
4063
|
+
a,
|
|
4064
|
+
c,
|
|
4065
|
+
s,
|
|
4066
|
+
o,
|
|
4067
|
+
{
|
|
4068
|
+
begin: /\[/,
|
|
4069
|
+
end: /\]/,
|
|
4070
|
+
contains: [{
|
|
4071
|
+
className: "meta",
|
|
4072
|
+
begin: /<![a-z]/,
|
|
4073
|
+
end: />/,
|
|
4074
|
+
contains: [
|
|
4075
|
+
a,
|
|
4076
|
+
o,
|
|
4077
|
+
c,
|
|
4078
|
+
s
|
|
4079
|
+
]
|
|
4080
|
+
}]
|
|
4081
|
+
}
|
|
4082
|
+
]
|
|
4083
|
+
},
|
|
4084
|
+
e.COMMENT(/<!--/, /-->/, { relevance: 10 }),
|
|
4085
|
+
{
|
|
4086
|
+
begin: /<!\[CDATA\[/,
|
|
4087
|
+
end: /\]\]>/,
|
|
4088
|
+
relevance: 10
|
|
4089
|
+
},
|
|
4090
|
+
i,
|
|
4091
|
+
{
|
|
4092
|
+
className: "meta",
|
|
4093
|
+
end: /\?>/,
|
|
4094
|
+
variants: [{
|
|
4095
|
+
begin: /<\?xml/,
|
|
4096
|
+
relevance: 10,
|
|
4097
|
+
contains: [c]
|
|
4098
|
+
}, { begin: /<\?[a-z][a-z0-9]+/ }]
|
|
4099
|
+
},
|
|
4100
|
+
{
|
|
4101
|
+
className: "tag",
|
|
4102
|
+
begin: /<style(?=\s|>)/,
|
|
4103
|
+
end: />/,
|
|
4104
|
+
keywords: { name: "style" },
|
|
4105
|
+
contains: [l],
|
|
4106
|
+
starts: {
|
|
4107
|
+
end: /<\/style>/,
|
|
4108
|
+
returnEnd: !0,
|
|
4109
|
+
subLanguage: ["css", "xml"]
|
|
4110
|
+
}
|
|
4111
|
+
},
|
|
4112
|
+
{
|
|
4113
|
+
className: "tag",
|
|
4114
|
+
begin: /<script(?=\s|>)/,
|
|
4115
|
+
end: />/,
|
|
4116
|
+
keywords: { name: "script" },
|
|
4117
|
+
contains: [l],
|
|
4118
|
+
starts: {
|
|
4119
|
+
end: /<\/script>/,
|
|
4120
|
+
returnEnd: !0,
|
|
4121
|
+
subLanguage: [
|
|
4122
|
+
"javascript",
|
|
4123
|
+
"handlebars",
|
|
4124
|
+
"xml"
|
|
4125
|
+
]
|
|
4126
|
+
}
|
|
4127
|
+
},
|
|
4128
|
+
{
|
|
4129
|
+
className: "tag",
|
|
4130
|
+
begin: /<>|<\/>/
|
|
4131
|
+
},
|
|
4132
|
+
{
|
|
4133
|
+
className: "tag",
|
|
4134
|
+
begin: t.concat(/</, t.lookahead(t.concat(n, t.either(/\/>/, />/, /\s/)))),
|
|
4135
|
+
end: /\/?>/,
|
|
4136
|
+
contains: [{
|
|
4137
|
+
className: "name",
|
|
4138
|
+
begin: n,
|
|
4139
|
+
relevance: 0,
|
|
4140
|
+
starts: l
|
|
4141
|
+
}]
|
|
4142
|
+
},
|
|
4143
|
+
{
|
|
4144
|
+
className: "tag",
|
|
4145
|
+
begin: t.concat(/<\//, t.lookahead(t.concat(n, />/))),
|
|
4146
|
+
contains: [{
|
|
4147
|
+
className: "name",
|
|
4148
|
+
begin: n,
|
|
4149
|
+
relevance: 0
|
|
4150
|
+
}, {
|
|
4151
|
+
begin: />/,
|
|
4152
|
+
relevance: 0,
|
|
4153
|
+
endsParent: !0
|
|
4154
|
+
}]
|
|
4155
|
+
}
|
|
4156
|
+
]
|
|
4157
|
+
};
|
|
4158
|
+
}
|
|
4159
|
+
//#endregion
|
|
4160
|
+
//#region ../../node_modules/highlight.js/es/languages/bash.js
|
|
4161
|
+
function bash(e) {
|
|
4162
|
+
let t = e.regex, n = {}, r = {
|
|
4163
|
+
begin: /\$\{/,
|
|
4164
|
+
end: /\}/,
|
|
4165
|
+
contains: ["self", {
|
|
4166
|
+
begin: /:-/,
|
|
4167
|
+
contains: [n]
|
|
4168
|
+
}]
|
|
4169
|
+
};
|
|
4170
|
+
Object.assign(n, {
|
|
4171
|
+
className: "variable",
|
|
4172
|
+
variants: [{ begin: t.concat(/\$[\w\d#@][\w\d_]*/, "(?![\\w\\d])(?![$])") }, r]
|
|
4173
|
+
});
|
|
4174
|
+
let i = {
|
|
4175
|
+
className: "subst",
|
|
4176
|
+
begin: /\$\(/,
|
|
4177
|
+
end: /\)/,
|
|
4178
|
+
contains: [e.BACKSLASH_ESCAPE]
|
|
4179
|
+
}, a = e.inherit(e.COMMENT(), {
|
|
4180
|
+
match: [/(^|\s)/, /#.*$/],
|
|
4181
|
+
scope: { 2: "comment" }
|
|
4182
|
+
}), o = {
|
|
4183
|
+
begin: /<<-?\s*(?=\w+)/,
|
|
4184
|
+
starts: { contains: [e.END_SAME_AS_BEGIN({
|
|
4185
|
+
begin: /(\w+)/,
|
|
4186
|
+
end: /(\w+)/,
|
|
4187
|
+
className: "string"
|
|
4188
|
+
})] }
|
|
4189
|
+
}, s = {
|
|
4190
|
+
className: "string",
|
|
4191
|
+
begin: /"/,
|
|
4192
|
+
end: /"/,
|
|
4193
|
+
contains: [
|
|
4194
|
+
e.BACKSLASH_ESCAPE,
|
|
4195
|
+
n,
|
|
4196
|
+
i
|
|
4197
|
+
]
|
|
4198
|
+
};
|
|
4199
|
+
i.contains.push(s);
|
|
4200
|
+
let c = { match: /\\"/ }, l = {
|
|
4201
|
+
className: "string",
|
|
4202
|
+
begin: /'/,
|
|
4203
|
+
end: /'/
|
|
4204
|
+
}, u = { match: /\\'/ }, d = {
|
|
4205
|
+
begin: /\$?\(\(/,
|
|
4206
|
+
end: /\)\)/,
|
|
4207
|
+
contains: [
|
|
4208
|
+
{
|
|
4209
|
+
begin: /\d+#[0-9a-f]+/,
|
|
4210
|
+
className: "number"
|
|
4211
|
+
},
|
|
4212
|
+
e.NUMBER_MODE,
|
|
4213
|
+
n
|
|
4214
|
+
]
|
|
4215
|
+
}, f = e.SHEBANG({
|
|
4216
|
+
binary: `(${[
|
|
4217
|
+
"fish",
|
|
4218
|
+
"bash",
|
|
4219
|
+
"zsh",
|
|
4220
|
+
"sh",
|
|
4221
|
+
"csh",
|
|
4222
|
+
"ksh",
|
|
4223
|
+
"tcsh",
|
|
4224
|
+
"dash",
|
|
4225
|
+
"scsh"
|
|
4226
|
+
].join("|")})`,
|
|
4227
|
+
relevance: 10
|
|
4228
|
+
}), p = {
|
|
4229
|
+
className: "function",
|
|
4230
|
+
begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
|
|
4231
|
+
returnBegin: !0,
|
|
4232
|
+
contains: [e.inherit(e.TITLE_MODE, { begin: /\w[\w\d_]*/ })],
|
|
4233
|
+
relevance: 0
|
|
4234
|
+
}, m = [
|
|
4235
|
+
"if",
|
|
4236
|
+
"then",
|
|
4237
|
+
"else",
|
|
4238
|
+
"elif",
|
|
4239
|
+
"fi",
|
|
4240
|
+
"time",
|
|
4241
|
+
"for",
|
|
4242
|
+
"while",
|
|
4243
|
+
"until",
|
|
4244
|
+
"in",
|
|
4245
|
+
"do",
|
|
4246
|
+
"done",
|
|
4247
|
+
"case",
|
|
4248
|
+
"esac",
|
|
4249
|
+
"coproc",
|
|
4250
|
+
"function",
|
|
4251
|
+
"select"
|
|
4252
|
+
], h = ["true", "false"], g = { match: /(\/[a-z._-]+)+/ }, _ = [
|
|
4253
|
+
"break",
|
|
4254
|
+
"cd",
|
|
4255
|
+
"continue",
|
|
4256
|
+
"eval",
|
|
4257
|
+
"exec",
|
|
4258
|
+
"exit",
|
|
4259
|
+
"export",
|
|
4260
|
+
"getopts",
|
|
4261
|
+
"hash",
|
|
4262
|
+
"pwd",
|
|
4263
|
+
"readonly",
|
|
4264
|
+
"return",
|
|
4265
|
+
"shift",
|
|
4266
|
+
"test",
|
|
4267
|
+
"times",
|
|
4268
|
+
"trap",
|
|
4269
|
+
"umask",
|
|
4270
|
+
"unset"
|
|
4271
|
+
], v = [
|
|
4272
|
+
"alias",
|
|
4273
|
+
"bind",
|
|
4274
|
+
"builtin",
|
|
4275
|
+
"caller",
|
|
4276
|
+
"command",
|
|
4277
|
+
"declare",
|
|
4278
|
+
"echo",
|
|
4279
|
+
"enable",
|
|
4280
|
+
"help",
|
|
4281
|
+
"let",
|
|
4282
|
+
"local",
|
|
4283
|
+
"logout",
|
|
4284
|
+
"mapfile",
|
|
4285
|
+
"printf",
|
|
4286
|
+
"read",
|
|
4287
|
+
"readarray",
|
|
4288
|
+
"source",
|
|
4289
|
+
"sudo",
|
|
4290
|
+
"type",
|
|
4291
|
+
"typeset",
|
|
4292
|
+
"ulimit",
|
|
4293
|
+
"unalias"
|
|
4294
|
+
], y = /* @__PURE__ */ "autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp".split("."), b = /* @__PURE__ */ "chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes".split(".");
|
|
4295
|
+
return {
|
|
4296
|
+
name: "Bash",
|
|
4297
|
+
aliases: ["sh", "zsh"],
|
|
4298
|
+
keywords: {
|
|
4299
|
+
$pattern: /\b[a-z][a-z0-9._-]+\b/,
|
|
4300
|
+
keyword: m,
|
|
4301
|
+
literal: h,
|
|
4302
|
+
built_in: [
|
|
4303
|
+
..._,
|
|
4304
|
+
...v,
|
|
4305
|
+
"set",
|
|
4306
|
+
"shopt",
|
|
4307
|
+
...y,
|
|
4308
|
+
...b
|
|
4309
|
+
]
|
|
4310
|
+
},
|
|
4311
|
+
contains: [
|
|
4312
|
+
f,
|
|
4313
|
+
e.SHEBANG(),
|
|
4314
|
+
p,
|
|
4315
|
+
d,
|
|
4316
|
+
a,
|
|
4317
|
+
o,
|
|
4318
|
+
g,
|
|
4319
|
+
s,
|
|
4320
|
+
c,
|
|
4321
|
+
l,
|
|
4322
|
+
u,
|
|
4323
|
+
n
|
|
4324
|
+
]
|
|
4325
|
+
};
|
|
4326
|
+
}
|
|
4327
|
+
//#endregion
|
|
4328
|
+
//#region ../../node_modules/highlight.js/es/languages/json.js
|
|
4329
|
+
function json(e) {
|
|
4330
|
+
let t = {
|
|
4331
|
+
className: "attr",
|
|
4332
|
+
begin: /"(\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
4333
|
+
relevance: 1.01
|
|
4334
|
+
}, n = {
|
|
4335
|
+
match: /[{}[\],:]/,
|
|
4336
|
+
className: "punctuation",
|
|
4337
|
+
relevance: 0
|
|
4338
|
+
}, r = [
|
|
4339
|
+
"true",
|
|
4340
|
+
"false",
|
|
4341
|
+
"null"
|
|
4342
|
+
], i = {
|
|
4343
|
+
scope: "literal",
|
|
4344
|
+
beginKeywords: r.join(" ")
|
|
4345
|
+
};
|
|
4346
|
+
return {
|
|
4347
|
+
name: "JSON",
|
|
4348
|
+
aliases: ["jsonc"],
|
|
4349
|
+
keywords: { literal: r },
|
|
4350
|
+
contains: [
|
|
4351
|
+
t,
|
|
4352
|
+
n,
|
|
4353
|
+
e.QUOTE_STRING_MODE,
|
|
4354
|
+
i,
|
|
4355
|
+
e.C_NUMBER_MODE,
|
|
4356
|
+
e.C_LINE_COMMENT_MODE,
|
|
4357
|
+
e.C_BLOCK_COMMENT_MODE
|
|
4358
|
+
],
|
|
4359
|
+
illegal: "\\S"
|
|
4360
|
+
};
|
|
4361
|
+
}
|
|
4362
|
+
//#endregion
|
|
4363
|
+
//#region ../../node_modules/highlight.js/es/languages/go.js
|
|
4364
|
+
function go(e) {
|
|
4365
|
+
let t = {
|
|
4366
|
+
keyword: [
|
|
4367
|
+
"break",
|
|
4368
|
+
"case",
|
|
4369
|
+
"chan",
|
|
4370
|
+
"const",
|
|
4371
|
+
"continue",
|
|
4372
|
+
"default",
|
|
4373
|
+
"defer",
|
|
4374
|
+
"else",
|
|
4375
|
+
"fallthrough",
|
|
4376
|
+
"for",
|
|
4377
|
+
"func",
|
|
4378
|
+
"go",
|
|
4379
|
+
"goto",
|
|
4380
|
+
"if",
|
|
4381
|
+
"import",
|
|
4382
|
+
"interface",
|
|
4383
|
+
"map",
|
|
4384
|
+
"package",
|
|
4385
|
+
"range",
|
|
4386
|
+
"return",
|
|
4387
|
+
"select",
|
|
4388
|
+
"struct",
|
|
4389
|
+
"switch",
|
|
4390
|
+
"type",
|
|
4391
|
+
"var"
|
|
4392
|
+
],
|
|
4393
|
+
type: [
|
|
4394
|
+
"bool",
|
|
4395
|
+
"byte",
|
|
4396
|
+
"complex64",
|
|
4397
|
+
"complex128",
|
|
4398
|
+
"error",
|
|
4399
|
+
"float32",
|
|
4400
|
+
"float64",
|
|
4401
|
+
"int8",
|
|
4402
|
+
"int16",
|
|
4403
|
+
"int32",
|
|
4404
|
+
"int64",
|
|
4405
|
+
"string",
|
|
4406
|
+
"uint8",
|
|
4407
|
+
"uint16",
|
|
4408
|
+
"uint32",
|
|
4409
|
+
"uint64",
|
|
4410
|
+
"int",
|
|
4411
|
+
"uint",
|
|
4412
|
+
"uintptr",
|
|
4413
|
+
"rune"
|
|
4414
|
+
],
|
|
4415
|
+
literal: [
|
|
4416
|
+
"true",
|
|
4417
|
+
"false",
|
|
4418
|
+
"iota",
|
|
4419
|
+
"nil"
|
|
4420
|
+
],
|
|
4421
|
+
built_in: [
|
|
4422
|
+
"append",
|
|
4423
|
+
"cap",
|
|
4424
|
+
"close",
|
|
4425
|
+
"complex",
|
|
4426
|
+
"copy",
|
|
4427
|
+
"imag",
|
|
4428
|
+
"len",
|
|
4429
|
+
"make",
|
|
4430
|
+
"new",
|
|
4431
|
+
"panic",
|
|
4432
|
+
"print",
|
|
4433
|
+
"println",
|
|
4434
|
+
"real",
|
|
4435
|
+
"recover",
|
|
4436
|
+
"delete"
|
|
4437
|
+
]
|
|
4438
|
+
};
|
|
4439
|
+
return {
|
|
4440
|
+
name: "Go",
|
|
4441
|
+
aliases: ["golang"],
|
|
4442
|
+
keywords: t,
|
|
4443
|
+
illegal: "</",
|
|
4444
|
+
contains: [
|
|
4445
|
+
e.C_LINE_COMMENT_MODE,
|
|
4446
|
+
e.C_BLOCK_COMMENT_MODE,
|
|
4447
|
+
{
|
|
4448
|
+
className: "string",
|
|
4449
|
+
variants: [
|
|
4450
|
+
e.QUOTE_STRING_MODE,
|
|
4451
|
+
e.APOS_STRING_MODE,
|
|
4452
|
+
{
|
|
4453
|
+
begin: "`",
|
|
4454
|
+
end: "`"
|
|
4455
|
+
}
|
|
4456
|
+
]
|
|
4457
|
+
},
|
|
4458
|
+
{
|
|
4459
|
+
className: "number",
|
|
4460
|
+
variants: [
|
|
4461
|
+
{
|
|
4462
|
+
match: /-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,
|
|
4463
|
+
relevance: 0
|
|
4464
|
+
},
|
|
4465
|
+
{
|
|
4466
|
+
match: /-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,
|
|
4467
|
+
relevance: 0
|
|
4468
|
+
},
|
|
4469
|
+
{
|
|
4470
|
+
match: /-?\b0[oO](_?[0-7])*i?/,
|
|
4471
|
+
relevance: 0
|
|
4472
|
+
},
|
|
4473
|
+
{
|
|
4474
|
+
match: /-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,
|
|
4475
|
+
relevance: 0
|
|
4476
|
+
},
|
|
4477
|
+
{
|
|
4478
|
+
match: /-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,
|
|
4479
|
+
relevance: 0
|
|
4480
|
+
}
|
|
4481
|
+
]
|
|
4482
|
+
},
|
|
4483
|
+
{ begin: /:=/ },
|
|
4484
|
+
{
|
|
4485
|
+
className: "function",
|
|
4486
|
+
beginKeywords: "func",
|
|
4487
|
+
end: "\\s*(\\{|$)",
|
|
4488
|
+
excludeEnd: !0,
|
|
4489
|
+
contains: [e.TITLE_MODE, {
|
|
4490
|
+
className: "params",
|
|
4491
|
+
begin: /\(/,
|
|
4492
|
+
end: /\)/,
|
|
4493
|
+
endsParent: !0,
|
|
4494
|
+
keywords: t,
|
|
4495
|
+
illegal: /["']/
|
|
4496
|
+
}]
|
|
4497
|
+
}
|
|
4498
|
+
]
|
|
4499
|
+
};
|
|
4500
|
+
}
|
|
4501
|
+
//#endregion
|
|
4502
|
+
//#region ../../node_modules/highlight.js/es/languages/python.js
|
|
4503
|
+
function python(e) {
|
|
4504
|
+
let t = e.regex, n = /[\p{XID_Start}_]\p{XID_Continue}*/u, r = /* @__PURE__ */ "and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield".split("."), i = {
|
|
4505
|
+
$pattern: /[A-Za-z]\w+|__\w+__/,
|
|
4506
|
+
keyword: r,
|
|
4507
|
+
built_in: /* @__PURE__ */ "__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip".split("."),
|
|
4508
|
+
literal: [
|
|
4509
|
+
"__debug__",
|
|
4510
|
+
"Ellipsis",
|
|
4511
|
+
"False",
|
|
4512
|
+
"None",
|
|
4513
|
+
"NotImplemented",
|
|
4514
|
+
"True"
|
|
4515
|
+
],
|
|
4516
|
+
type: [
|
|
4517
|
+
"Any",
|
|
4518
|
+
"Callable",
|
|
4519
|
+
"Coroutine",
|
|
4520
|
+
"Dict",
|
|
4521
|
+
"List",
|
|
4522
|
+
"Literal",
|
|
4523
|
+
"Generic",
|
|
4524
|
+
"Optional",
|
|
4525
|
+
"Sequence",
|
|
4526
|
+
"Set",
|
|
4527
|
+
"Tuple",
|
|
4528
|
+
"Type",
|
|
4529
|
+
"Union"
|
|
4530
|
+
]
|
|
4531
|
+
}, a = {
|
|
4532
|
+
className: "meta",
|
|
4533
|
+
begin: /^(>>>|\.\.\.) /
|
|
4534
|
+
}, o = {
|
|
4535
|
+
className: "subst",
|
|
4536
|
+
begin: /\{/,
|
|
4537
|
+
end: /\}/,
|
|
4538
|
+
keywords: i,
|
|
4539
|
+
illegal: /#/
|
|
4540
|
+
}, s = {
|
|
4541
|
+
begin: /\{\{/,
|
|
4542
|
+
relevance: 0
|
|
4543
|
+
}, c = {
|
|
4544
|
+
className: "string",
|
|
4545
|
+
contains: [e.BACKSLASH_ESCAPE],
|
|
4546
|
+
variants: [
|
|
4547
|
+
{
|
|
4548
|
+
begin: /([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,
|
|
4549
|
+
end: /'''/,
|
|
4550
|
+
contains: [e.BACKSLASH_ESCAPE, a],
|
|
4551
|
+
relevance: 10
|
|
4552
|
+
},
|
|
4553
|
+
{
|
|
4554
|
+
begin: /([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,
|
|
4555
|
+
end: /"""/,
|
|
4556
|
+
contains: [e.BACKSLASH_ESCAPE, a],
|
|
4557
|
+
relevance: 10
|
|
4558
|
+
},
|
|
4559
|
+
{
|
|
4560
|
+
begin: /([fF][rR]|[rR][fF]|[fF])'''/,
|
|
4561
|
+
end: /'''/,
|
|
4562
|
+
contains: [
|
|
4563
|
+
e.BACKSLASH_ESCAPE,
|
|
4564
|
+
a,
|
|
4565
|
+
s,
|
|
4566
|
+
o
|
|
4567
|
+
]
|
|
4568
|
+
},
|
|
4569
|
+
{
|
|
4570
|
+
begin: /([fF][rR]|[rR][fF]|[fF])"""/,
|
|
4571
|
+
end: /"""/,
|
|
4572
|
+
contains: [
|
|
4573
|
+
e.BACKSLASH_ESCAPE,
|
|
4574
|
+
a,
|
|
4575
|
+
s,
|
|
4576
|
+
o
|
|
4577
|
+
]
|
|
4578
|
+
},
|
|
4579
|
+
{
|
|
4580
|
+
begin: /([uU]|[rR])'/,
|
|
4581
|
+
end: /'/,
|
|
4582
|
+
relevance: 10
|
|
4583
|
+
},
|
|
4584
|
+
{
|
|
4585
|
+
begin: /([uU]|[rR])"/,
|
|
4586
|
+
end: /"/,
|
|
4587
|
+
relevance: 10
|
|
4588
|
+
},
|
|
4589
|
+
{
|
|
4590
|
+
begin: /([bB]|[bB][rR]|[rR][bB])'/,
|
|
4591
|
+
end: /'/
|
|
4592
|
+
},
|
|
4593
|
+
{
|
|
4594
|
+
begin: /([bB]|[bB][rR]|[rR][bB])"/,
|
|
4595
|
+
end: /"/
|
|
4596
|
+
},
|
|
4597
|
+
{
|
|
4598
|
+
begin: /([fF][rR]|[rR][fF]|[fF])'/,
|
|
4599
|
+
end: /'/,
|
|
4600
|
+
contains: [
|
|
4601
|
+
e.BACKSLASH_ESCAPE,
|
|
4602
|
+
s,
|
|
4603
|
+
o
|
|
4604
|
+
]
|
|
4605
|
+
},
|
|
4606
|
+
{
|
|
4607
|
+
begin: /([fF][rR]|[rR][fF]|[fF])"/,
|
|
4608
|
+
end: /"/,
|
|
4609
|
+
contains: [
|
|
4610
|
+
e.BACKSLASH_ESCAPE,
|
|
4611
|
+
s,
|
|
4612
|
+
o
|
|
4613
|
+
]
|
|
4614
|
+
},
|
|
4615
|
+
e.APOS_STRING_MODE,
|
|
4616
|
+
e.QUOTE_STRING_MODE
|
|
4617
|
+
]
|
|
4618
|
+
}, l = "[0-9](_?[0-9])*", u = `(\\b(${l}))?\\.(${l})|\\b(${l})\\.`, d = `\\b|${r.join("|")}`, f = {
|
|
4619
|
+
className: "number",
|
|
4620
|
+
relevance: 0,
|
|
4621
|
+
variants: [
|
|
4622
|
+
{ begin: `(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})` },
|
|
4623
|
+
{ begin: `(${u})[jJ]?` },
|
|
4624
|
+
{ begin: `\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})` },
|
|
4625
|
+
{ begin: `\\b0[bB](_?[01])+[lL]?(?=${d})` },
|
|
4626
|
+
{ begin: `\\b0[oO](_?[0-7])+[lL]?(?=${d})` },
|
|
4627
|
+
{ begin: `\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})` },
|
|
4628
|
+
{ begin: `\\b(${l})[jJ](?=${d})` }
|
|
4629
|
+
]
|
|
4630
|
+
}, p = {
|
|
4631
|
+
className: "comment",
|
|
4632
|
+
begin: t.lookahead(/# type:/),
|
|
4633
|
+
end: /$/,
|
|
4634
|
+
keywords: i,
|
|
4635
|
+
contains: [{ begin: /# type:/ }, {
|
|
4636
|
+
begin: /#/,
|
|
4637
|
+
end: /\b\B/,
|
|
4638
|
+
endsWithParent: !0
|
|
4639
|
+
}]
|
|
4640
|
+
}, m = {
|
|
4641
|
+
className: "params",
|
|
4642
|
+
variants: [{
|
|
4643
|
+
className: "",
|
|
4644
|
+
begin: /\(\s*\)/,
|
|
4645
|
+
skip: !0
|
|
4646
|
+
}, {
|
|
4647
|
+
begin: /\(/,
|
|
4648
|
+
end: /\)/,
|
|
4649
|
+
excludeBegin: !0,
|
|
4650
|
+
excludeEnd: !0,
|
|
4651
|
+
keywords: i,
|
|
4652
|
+
contains: [
|
|
4653
|
+
"self",
|
|
4654
|
+
a,
|
|
4655
|
+
f,
|
|
4656
|
+
c,
|
|
4657
|
+
e.HASH_COMMENT_MODE
|
|
4658
|
+
]
|
|
4659
|
+
}]
|
|
4660
|
+
};
|
|
4661
|
+
return o.contains = [
|
|
4662
|
+
c,
|
|
4663
|
+
f,
|
|
4664
|
+
a
|
|
4665
|
+
], {
|
|
4666
|
+
name: "Python",
|
|
4667
|
+
aliases: [
|
|
4668
|
+
"py",
|
|
4669
|
+
"gyp",
|
|
4670
|
+
"ipython"
|
|
4671
|
+
],
|
|
4672
|
+
unicodeRegex: !0,
|
|
4673
|
+
keywords: i,
|
|
4674
|
+
illegal: /(<\/|\?)|=>/,
|
|
4675
|
+
contains: [
|
|
4676
|
+
a,
|
|
4677
|
+
f,
|
|
4678
|
+
{
|
|
4679
|
+
scope: "variable.language",
|
|
4680
|
+
match: /\bself\b/
|
|
4681
|
+
},
|
|
4682
|
+
{
|
|
4683
|
+
beginKeywords: "if",
|
|
4684
|
+
relevance: 0
|
|
4685
|
+
},
|
|
4686
|
+
{
|
|
4687
|
+
match: /\bor\b/,
|
|
4688
|
+
scope: "keyword"
|
|
4689
|
+
},
|
|
4690
|
+
c,
|
|
4691
|
+
p,
|
|
4692
|
+
e.HASH_COMMENT_MODE,
|
|
4693
|
+
{
|
|
4694
|
+
match: [
|
|
4695
|
+
/\bdef/,
|
|
4696
|
+
/\s+/,
|
|
4697
|
+
n
|
|
4698
|
+
],
|
|
4699
|
+
scope: {
|
|
4700
|
+
1: "keyword",
|
|
4701
|
+
3: "title.function"
|
|
4702
|
+
},
|
|
4703
|
+
contains: [m]
|
|
4704
|
+
},
|
|
4705
|
+
{
|
|
4706
|
+
variants: [{ match: [
|
|
4707
|
+
/\bclass/,
|
|
4708
|
+
/\s+/,
|
|
4709
|
+
n,
|
|
4710
|
+
/\s*/,
|
|
4711
|
+
/\(\s*/,
|
|
4712
|
+
n,
|
|
4713
|
+
/\s*\)/
|
|
4714
|
+
] }, { match: [
|
|
4715
|
+
/\bclass/,
|
|
4716
|
+
/\s+/,
|
|
4717
|
+
n
|
|
4718
|
+
] }],
|
|
4719
|
+
scope: {
|
|
4720
|
+
1: "keyword",
|
|
4721
|
+
3: "title.class",
|
|
4722
|
+
6: "title.class.inherited"
|
|
4723
|
+
}
|
|
4724
|
+
},
|
|
4725
|
+
{
|
|
4726
|
+
className: "meta",
|
|
4727
|
+
begin: /^[\t ]*@/,
|
|
4728
|
+
end: /(?=#)|$/,
|
|
4729
|
+
contains: [
|
|
4730
|
+
f,
|
|
4731
|
+
m,
|
|
4732
|
+
c
|
|
4733
|
+
]
|
|
4734
|
+
}
|
|
4735
|
+
]
|
|
4736
|
+
};
|
|
4737
|
+
}
|
|
4738
|
+
//#endregion
|
|
4739
|
+
//#region src/components/cardRendering/CodeBlockRenderer.vue?vue&type=script&setup=true&lang.ts
|
|
4740
|
+
var Ft = { class: "code-block-wrapper pa-2" }, It = {
|
|
4741
|
+
key: 0,
|
|
4742
|
+
class: "language-indicator"
|
|
4743
|
+
}, Lt = /* @__PURE__ */ c({
|
|
4744
|
+
__name: "CodeBlockRenderer",
|
|
4745
|
+
props: {
|
|
4746
|
+
code: {
|
|
4747
|
+
type: String,
|
|
4748
|
+
required: !0
|
|
4749
|
+
},
|
|
4750
|
+
language: {
|
|
4751
|
+
type: String,
|
|
4752
|
+
default: ""
|
|
4753
|
+
}
|
|
4754
|
+
},
|
|
4755
|
+
setup(e) {
|
|
4756
|
+
Q.registerLanguage("js", javascript$1), Q.registerLanguage("javascript", javascript$1), Q.registerLanguage("ts", typescript), Q.registerLanguage("typescript", typescript), Q.registerLanguage("css", css), Q.registerLanguage("html", xml), Q.registerLanguage("bash", bash), Q.registerLanguage("sh", bash), Q.registerLanguage("json", json), Q.registerLanguage("go", go), Q.registerLanguage("golang", go), Q.registerLanguage("python", python);
|
|
4757
|
+
let t = l();
|
|
4758
|
+
return t && t.appContext.app.component("highlightjs", ft.component), (t, n) => {
|
|
4759
|
+
let a = b("highlightjs");
|
|
4760
|
+
return _(), i("div", Ft, [e.language ? (_(), i("div", It, S(e.language), 1)) : r("", !0), s(a, {
|
|
4761
|
+
language: e.language,
|
|
4762
|
+
code: e.code
|
|
4763
|
+
}, null, 8, ["language", "code"])]);
|
|
4764
|
+
};
|
|
4765
|
+
}
|
|
4766
|
+
}), Rt = { key: 0 }, zt = { key: 0 }, Bt = { key: 0 }, Vt = {
|
|
4767
|
+
key: 1,
|
|
4768
|
+
class: "error--text"
|
|
4769
|
+
}, Ht = { key: 1 }, Ut = { key: 2 }, Wt = { key: 1 }, Gt = { key: 1 }, Kt = {
|
|
4770
|
+
key: 0,
|
|
4771
|
+
class: "text-h2"
|
|
4772
|
+
}, qt = {
|
|
4773
|
+
key: 1,
|
|
4774
|
+
class: "text-h3"
|
|
4775
|
+
}, Jt = {
|
|
4776
|
+
key: 2,
|
|
4777
|
+
class: "text-h4"
|
|
4778
|
+
}, Yt = { key: 3 }, Xt = { key: 4 }, Zt = { key: 5 }, Qt = { key: 2 }, $t = {
|
|
4779
|
+
key: 3,
|
|
4780
|
+
class: "text-h5"
|
|
4781
|
+
}, en = { key: 0 }, tn = ["href", "title"], nn = { key: 5 }, rn = { key: 6 }, an = { key: 7 }, on = ["src", "alt"], sn = { key: 9 }, cn = { key: 10 }, ln = { key: 11 }, un = ["align"], dn = ["innerHTML"], fn = ["innerHTML"], pn = { key: 16 }, mn = { key: 17 }, hn = { key: 18 }, gn = /* @__PURE__ */ F(/* @__PURE__ */ c({
|
|
4782
|
+
__name: "MdTokenRenderer",
|
|
4783
|
+
props: {
|
|
4784
|
+
token: {
|
|
4785
|
+
type: Object,
|
|
4786
|
+
required: !0
|
|
4787
|
+
},
|
|
4788
|
+
last: {
|
|
4789
|
+
type: Boolean,
|
|
4790
|
+
required: !1,
|
|
4791
|
+
default: !1
|
|
4792
|
+
}
|
|
4793
|
+
},
|
|
4794
|
+
setup(t, { expose: o }) {
|
|
4795
|
+
let s = d("markdownComponents", {}), c = {
|
|
4796
|
+
fillIn: f(me),
|
|
4797
|
+
...s
|
|
4798
|
+
};
|
|
4799
|
+
function isComponent$1(e) {
|
|
4800
|
+
return isComponent(e);
|
|
4801
|
+
}
|
|
4802
|
+
__name(isComponent$1, "isComponent");
|
|
4803
|
+
function containsComponent$1(e) {
|
|
4804
|
+
return containsComponent(e);
|
|
4805
|
+
}
|
|
4806
|
+
__name(containsComponent$1, "containsComponent");
|
|
4807
|
+
function splitTextToken$1(e) {
|
|
4808
|
+
return splitTextToken(e);
|
|
4809
|
+
}
|
|
4810
|
+
__name(splitTextToken$1, "splitTextToken");
|
|
4811
|
+
function splitParagraphToken$1(e) {
|
|
4812
|
+
return splitParagraphToken(e);
|
|
4813
|
+
}
|
|
4814
|
+
__name(splitParagraphToken$1, "splitParagraphToken");
|
|
4815
|
+
function parsedComponent(e) {
|
|
4816
|
+
let t = "";
|
|
4817
|
+
"text" in e && typeof e.text == "string" ? t = e.text : "raw" in e && typeof e.raw == "string" && (t = e.raw);
|
|
4818
|
+
let n = parseComponentSyntax(t);
|
|
4819
|
+
return n ? {
|
|
4820
|
+
is: n.componentName,
|
|
4821
|
+
text: "",
|
|
4822
|
+
props: n.props
|
|
4823
|
+
} : {
|
|
4824
|
+
is: "fillIn",
|
|
4825
|
+
text: t,
|
|
4826
|
+
props: {}
|
|
4827
|
+
};
|
|
4828
|
+
}
|
|
4829
|
+
function getComponent(e) {
|
|
4830
|
+
return c[e] || (console.warn(`[MarkdownRenderer] Unknown component: "${e}". Available components: ${Object.keys(c).join(", ")}`), null);
|
|
4831
|
+
}
|
|
4832
|
+
function decodeBasicEntities(e) {
|
|
4833
|
+
return e.replace(/'/g, "'").replace(/"/g, "\"").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
4834
|
+
}
|
|
4835
|
+
function isText(e) {
|
|
4836
|
+
return e.inLink === void 0 && e.type === "text";
|
|
4837
|
+
}
|
|
4838
|
+
return o({
|
|
4839
|
+
isComponent: isComponent$1,
|
|
4840
|
+
containsComponent: containsComponent$1,
|
|
4841
|
+
splitTextToken: splitTextToken$1,
|
|
4842
|
+
splitParagraphToken: splitParagraphToken$1,
|
|
4843
|
+
parsedComponent,
|
|
4844
|
+
decodeBasicEntities,
|
|
4845
|
+
isText,
|
|
4846
|
+
components: c,
|
|
4847
|
+
getComponent
|
|
4848
|
+
}), (o, s) => {
|
|
4849
|
+
let c = b("md-token-renderer", !0);
|
|
4850
|
+
return isText(t.token) ? (_(), i("span", Rt, [!t.token.tokens || t.token.tokens.length === 0 ? (_(), i("span", zt, [isComponent$1(t.token) ? (_(), i("span", Bt, [!t.last && getComponent(parsedComponent(t.token).is) ? (_(), n(x(getComponent(parsedComponent(t.token).is)), p({
|
|
4851
|
+
key: 0,
|
|
4852
|
+
text: parsedComponent(t.token).text
|
|
4853
|
+
}, parsedComponent(t.token).props), null, 16, ["text"])) : !t.last && !getComponent(parsedComponent(t.token).is) ? (_(), i("span", Vt, " [Unknown component: " + S(parsedComponent(t.token).is) + "] ", 1)) : r("", !0)])) : containsComponent$1(t.token) ? (_(), i("span", Ht, [(_(!0), i(e, null, y(splitTextToken$1(t.token), (e, t) => (_(), n(c, {
|
|
4854
|
+
key: t,
|
|
4855
|
+
token: e
|
|
4856
|
+
}, null, 8, ["token"]))), 128))])) : (_(), i("span", Ut, S(decodeBasicEntities(t.token.text)), 1))])) : t.token.tokens && t.token.tokens.length !== 0 ? (_(), i("span", Wt, [(_(!0), i(e, null, y(t.token.tokens, (e, t) => (_(), n(c, {
|
|
4857
|
+
key: t,
|
|
4858
|
+
token: e
|
|
4859
|
+
}, null, 8, ["token"]))), 128))])) : r("", !0)])) : t.token.type === "heading" ? (_(), i("span", Gt, [t.token.depth === 1 ? (_(), i("h1", Kt, [(_(!0), i(e, null, y(t.token.tokens, (e, t) => (_(), n(c, {
|
|
4860
|
+
key: t,
|
|
4861
|
+
token: e
|
|
4862
|
+
}, null, 8, ["token"]))), 128))])) : t.token.depth === 2 ? (_(), i("h2", qt, [(_(!0), i(e, null, y(t.token.tokens, (e, t) => (_(), n(c, {
|
|
4863
|
+
key: t,
|
|
4864
|
+
token: e
|
|
4865
|
+
}, null, 8, ["token"]))), 128))])) : t.token.depth === 3 ? (_(), i("h3", Jt, [(_(!0), i(e, null, y(t.token.tokens, (e, t) => (_(), n(c, {
|
|
4866
|
+
key: t,
|
|
4867
|
+
token: e
|
|
4868
|
+
}, null, 8, ["token"]))), 128))])) : t.token.depth === 4 ? (_(), i("h4", Yt, [(_(!0), i(e, null, y(t.token.tokens, (e, t) => (_(), n(c, {
|
|
4869
|
+
key: t,
|
|
4870
|
+
token: e
|
|
4871
|
+
}, null, 8, ["token"]))), 128))])) : t.token.depth === 5 ? (_(), i("h5", Xt, [(_(!0), i(e, null, y(t.token.tokens, (e, t) => (_(), n(c, {
|
|
4872
|
+
key: t,
|
|
4873
|
+
token: e
|
|
4874
|
+
}, null, 8, ["token"]))), 128))])) : t.token.depth === 6 ? (_(), i("h6", Zt, [(_(!0), i(e, null, y(t.token.tokens, (e, t) => (_(), n(c, {
|
|
4875
|
+
key: t,
|
|
4876
|
+
token: e
|
|
4877
|
+
}, null, 8, ["token"]))), 128))])) : r("", !0)])) : t.token.type === "strong" ? (_(), i("strong", Qt, [(_(!0), i(e, null, y(t.token.tokens, (e, t) => (_(), n(c, {
|
|
4878
|
+
key: t,
|
|
4879
|
+
token: e
|
|
4880
|
+
}, null, 8, ["token"]))), 128))])) : t.token.type === "paragraph" ? (_(), i("p", $t, [containsComponent$1(t.token) ? (_(), i("span", en, [(_(!0), i(e, null, y(splitParagraphToken$1(t.token), (e, r) => (_(), n(c, {
|
|
4881
|
+
key: r,
|
|
4882
|
+
token: e,
|
|
4883
|
+
last: t.last && t.token.tokens.length === 1 && r === splitParagraphToken$1(t.token).length - 1
|
|
4884
|
+
}, null, 8, ["token", "last"]))), 128))])) : (_(!0), i(e, { key: 1 }, y(t.token.tokens, (e, r) => (_(), n(c, {
|
|
4885
|
+
key: r,
|
|
4886
|
+
token: e,
|
|
4887
|
+
last: t.last && t.token.tokens.length === 1
|
|
4888
|
+
}, null, 8, ["token", "last"]))), 128))])) : t.token.type === "link" ? (_(), i("a", {
|
|
4889
|
+
key: 4,
|
|
4890
|
+
href: t.token.href,
|
|
4891
|
+
title: t.token.title
|
|
4892
|
+
}, [(_(!0), i(e, null, y(t.token.tokens, (e, t) => (_(), n(c, {
|
|
4893
|
+
key: t,
|
|
4894
|
+
token: e
|
|
4895
|
+
}, null, 8, ["token"]))), 128))], 8, tn)) : t.token.type === "list" && t.token.ordered === !1 ? (_(), i("ul", nn, [(_(!0), i(e, null, y(t.token.items, (e, t) => (_(), n(c, {
|
|
4896
|
+
key: t,
|
|
4897
|
+
token: e
|
|
4898
|
+
}, null, 8, ["token"]))), 128))])) : t.token.type === "list" && t.token.ordered === !0 ? (_(), i("ol", rn, [(_(!0), i(e, null, y(t.token.items, (e, t) => (_(), n(c, {
|
|
4899
|
+
key: t,
|
|
4900
|
+
token: e
|
|
4901
|
+
}, null, 8, ["token"]))), 128))])) : t.token.type === "list_item" ? (_(), i("li", an, [(_(!0), i(e, null, y(t.token.tokens, (e, t) => (_(), n(c, {
|
|
4902
|
+
key: t,
|
|
4903
|
+
token: e
|
|
4904
|
+
}, null, 8, ["token"]))), 128))])) : t.token.type === "image" ? (_(), i("img", {
|
|
4905
|
+
key: 8,
|
|
4906
|
+
src: t.token.href,
|
|
4907
|
+
alt: t.token.title
|
|
4908
|
+
}, null, 8, on)) : t.token.type === "hr" ? (_(), i("hr", sn)) : t.token.type === "br" ? (_(), i("br", cn)) : t.token.type === "del" ? (_(), i("del", ln)) : t.token.type === "table" ? (_(), i("table", {
|
|
4909
|
+
key: 12,
|
|
4910
|
+
align: t.token.align
|
|
4911
|
+
}, [a("thead", null, [(_(!0), i(e, null, y(t.token.header, (e, t) => (_(), i("th", { key: t }, S(e.text), 1))), 128))]), a("tbody", null, [(_(!0), i(e, null, y(t.token.rows, (t, n) => (_(), i("tr", { key: n }, [(_(!0), i(e, null, y(t, (e, t) => (_(), i("td", { key: t }, S(e.text), 1))), 128))]))), 128))])], 8, un)) : t.token.type === "html" ? (_(), i("span", {
|
|
4912
|
+
key: 13,
|
|
4913
|
+
innerHTML: t.token.raw
|
|
4914
|
+
}, null, 8, dn)) : t.token.type === "code" ? (_(), n(Lt, {
|
|
4915
|
+
key: 14,
|
|
4916
|
+
code: t.token.text,
|
|
4917
|
+
language: t.token.lang
|
|
4918
|
+
}, null, 8, ["code", "language"])) : t.token.type === "codespan" ? (_(), i("code", {
|
|
4919
|
+
key: 15,
|
|
4920
|
+
class: "codespan",
|
|
4921
|
+
innerHTML: t.token.text
|
|
4922
|
+
}, null, 8, fn)) : t.token.type === "blockquote" ? (_(), i("blockquote", pn, [(_(!0), i(e, null, y(t.token.tokens, (e, t) => (_(), n(c, {
|
|
4923
|
+
key: t,
|
|
4924
|
+
token: e
|
|
4925
|
+
}, null, 8, ["token"]))), 128))])) : t.token.type === "escape" ? (_(), i("span", mn, S(t.token.text), 1)) : t.token.type === "em" ? (_(), i("em", hn, [(_(!0), i(e, null, y(t.token.tokens, (e, t) => (_(), n(c, {
|
|
4926
|
+
key: t,
|
|
4927
|
+
token: e
|
|
4928
|
+
}, null, 8, ["token"]))), 128))])) : r("", !0);
|
|
4929
|
+
};
|
|
4930
|
+
}
|
|
4931
|
+
}), [["__scopeId", "data-v-de3eebd6"]]), _n = c({
|
|
4932
|
+
name: "MarkdownRenderer",
|
|
4933
|
+
components: {
|
|
4934
|
+
MdTokenRenderer: gn,
|
|
4935
|
+
AudioAutoPlayer: ut
|
|
4936
|
+
},
|
|
4937
|
+
props: { md: {
|
|
4938
|
+
type: String,
|
|
4939
|
+
required: !0
|
|
4940
|
+
} },
|
|
4941
|
+
computed: { tokens() {
|
|
4942
|
+
return ct(this.md);
|
|
4943
|
+
} }
|
|
4944
|
+
}), vn = /* @__PURE__ */ __exportAll({ default: () => yn });
|
|
4945
|
+
function _sfc_render(t, a, o, s, c, l) {
|
|
4946
|
+
let u = b("md-token-renderer"), d = b("audio-auto-player");
|
|
4947
|
+
return _(), i("div", null, [(_(!0), i(e, null, y(t.tokens, (e, a) => (_(), i("span", { key: a }, [e.type ? (_(), n(u, {
|
|
4948
|
+
key: 0,
|
|
4949
|
+
token: e,
|
|
4950
|
+
last: a === t.tokens.length - 1
|
|
4951
|
+
}, null, 8, ["token", "last"])) : e.audio ? (_(), n(d, {
|
|
4952
|
+
key: 1,
|
|
4953
|
+
src: e.audio
|
|
4954
|
+
}, null, 8, ["src"])) : r("", !0)]))), 128))]);
|
|
4955
|
+
}
|
|
4956
|
+
var yn = /* @__PURE__ */ F(_n, [["render", _sfc_render]]);
|
|
4957
|
+
//#endregion
|
|
4958
|
+
export { I as C, __name as E, useViewable as S, F as T, useCardPreviewModeStore as _, ut as a, isQuestionView as b, isInlineComponent as c, splitByDelimiters as d, splitParagraphToken as f, se as g, de as h, Lt as i, parseComponentSyntax as l, me as m, vn as n, containsComponent as o, splitTextToken as p, gn as r, isComponent as s, yn as t, parseComponentToken as u, getPinia as v, _defineProperty as w, useQuestionView as x, oe as y };
|
|
4959
|
+
|
|
4960
|
+
//# sourceMappingURL=MarkdownRenderer-DoVbFpA6.mjs.map
|