2 https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript&plugins=keep-markup */
4 'undefined' != typeof window
6 : 'undefined' != typeof WorkerGlobalScope && self instanceof WorkerGlobalScope
10 var e = /\blang(?:uage)?-([\w-]+)\b/i,
13 manual: _self.Prism && _self.Prism.manual,
14 disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
16 encode: function (e) {
18 ? new a(e.type, n.util.encode(e.content), e.alias)
19 : 'Array' === n.util.type(e)
20 ? e.map(n.util.encode)
22 .replace(/&/g, '&')
23 .replace(/</g, '<')
24 .replace(/\u00a0/g, ' ');
27 return Object.prototype.toString.call(e).slice(8, -1);
30 return e.__id || Object.defineProperty(e, '__id', { value: ++t }), e.__id;
32 clone: function (e, t) {
33 var a = n.util.type(e);
34 switch (((t = t || {}), a)) {
36 if (t[n.util.objId(e)]) return t[n.util.objId(e)];
38 t[n.util.objId(e)] = r;
39 for (var l in e) e.hasOwnProperty(l) && (r[l] = n.util.clone(e[l], t));
42 if (t[n.util.objId(e)]) return t[n.util.objId(e)];
45 (t[n.util.objId(e)] = r),
46 e.forEach(function (e, a) {
47 r[a] = n.util.clone(e, t);
56 extend: function (e, t) {
57 var a = n.util.clone(n.languages[e]);
58 for (var r in t) a[r] = t[r];
61 insertBefore: function (e, t, a, r) {
66 if (l.hasOwnProperty(o)) {
67 if (o == t) for (var s in a) a.hasOwnProperty(s) && (i[s] = a[s]);
68 a.hasOwnProperty(o) || (i[o] = l[o]);
73 n.languages.DFS(n.languages, function (t, n) {
74 n === u && t != e && (this[t] = i);
79 DFS: function (e, t, a, r) {
82 e.hasOwnProperty(l) &&
83 (t.call(e, l, e[l], a || l),
84 'Object' !== n.util.type(e[l]) || r[n.util.objId(e[l])]
85 ? 'Array' !== n.util.type(e[l]) ||
86 r[n.util.objId(e[l])] ||
87 ((r[n.util.objId(e[l])] = !0), n.languages.DFS(e[l], t, l, r))
88 : ((r[n.util.objId(e[l])] = !0), n.languages.DFS(e[l], t, null, r)));
92 highlightAll: function (e, t) {
93 n.highlightAllUnder(document, e, t);
95 highlightAllUnder: function (e, t, a) {
99 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code',
101 n.hooks.run('before-highlightall', r);
102 for (var l, i = r.elements || e.querySelectorAll(r.selector), o = 0; (l = i[o++]); )
103 n.highlightElement(l, t === !0, r.callback);
105 highlightElement: function (t, a, r) {
106 for (var l, i, o = t; o && !e.test(o.className); ) o = o.parentNode;
107 o && ((l = (o.className.match(e) || [, ''])[1].toLowerCase()), (i = n.languages[l])),
108 (t.className = t.className.replace(e, '').replace(/\s+/g, ' ') + ' language-' + l),
111 /pre/i.test(o.nodeName) &&
112 (o.className = o.className.replace(e, '').replace(/\s+/g, ' ') + ' language-' + l));
113 var s = t.textContent,
114 u = { element: t, language: l, grammar: i, code: s };
115 if ((n.hooks.run('before-sanity-check', u), !u.code || !u.grammar))
118 (n.hooks.run('before-highlight', u),
119 (u.element.textContent = u.code),
120 n.hooks.run('after-highlight', u)),
121 n.hooks.run('complete', u),
124 if ((n.hooks.run('before-highlight', u), a && _self.Worker)) {
125 var g = new Worker(n.filename);
126 (g.onmessage = function (e) {
127 (u.highlightedCode = e.data),
128 n.hooks.run('before-insert', u),
129 (u.element.innerHTML = u.highlightedCode),
130 n.hooks.run('after-highlight', u),
131 n.hooks.run('complete', u),
132 r && r.call(u.element);
134 g.postMessage(JSON.stringify({ language: u.language, code: u.code, immediateClose: !0 }));
136 (u.highlightedCode = n.highlight(u.code, u.grammar, u.language)),
137 n.hooks.run('before-insert', u),
138 (u.element.innerHTML = u.highlightedCode),
139 n.hooks.run('after-highlight', u),
140 n.hooks.run('complete', u),
143 highlight: function (e, t, r) {
144 var l = { code: e, grammar: t, language: r };
146 n.hooks.run('before-tokenize', l),
147 (l.tokens = n.tokenize(l.code, l.grammar)),
148 n.hooks.run('after-tokenize', l),
149 a.stringify(n.util.encode(l.tokens), l.language)
152 matchGrammar: function (e, t, a, r, l, i, o) {
155 if (a.hasOwnProperty(u) && a[u]) {
158 g = 'Array' === n.util.type(g) ? g : [g];
159 for (var c = 0; c < g.length; ++c) {
166 if (m && !h.pattern.global) {
167 var v = h.pattern.toString().match(/[imuy]*$/)[0];
168 h.pattern = RegExp(h.pattern.source, v + 'g');
171 for (var b = r, k = l; b < t.length; k += t[b].length, ++b) {
173 if (t.length > e.length) return;
174 if (!(w instanceof s)) {
175 if (m && b != t.length - 1) {
180 var j = _.index + (d ? _[1].length : 0),
181 P = _.index + _[0].length,
185 O > A && (P > x || (!t[A].type && !t[A - 1].greedy));
188 (x += t[A].length), j >= x && (++b, (k = x));
189 if (t[b] instanceof s) continue;
190 (I = A - b), (w = e.slice(k, x)), (_.index -= k);
197 d && (p = _[1] ? _[1].length : 0);
204 N && (++b, (k += N.length), C.push(N));
205 var E = new s(u, f ? n.tokenize(_, f) : _, y, _, m);
209 Array.prototype.splice.apply(t, C),
210 1 != I && n.matchGrammar(e, t, a, b, k, !0, u),
220 tokenize: function (e, t) {
224 for (var l in r) t[l] = r[l];
227 return n.matchGrammar(e, a, t, 0, 0, !1), a;
231 add: function (e, t) {
233 (a[e] = a[e] || []), a[e].push(t);
235 run: function (e, t) {
236 var a = n.hooks.all[e];
237 if (a && a.length) for (var r, l = 0; (r = a[l++]); ) r(t);
241 a = (n.Token = function (e, t, n, a, r) {
245 (this.length = 0 | (a || '').length),
249 ((a.stringify = function (e, t, r) {
250 if ('string' == typeof e) return e;
251 if ('Array' === n.util.type(e))
254 return a.stringify(n, t, e);
259 content: a.stringify(e.content, t, r),
261 classes: ['token', e.type],
267 var i = 'Array' === n.util.type(e.alias) ? e.alias : [e.alias];
268 Array.prototype.push.apply(l.classes, i);
270 n.hooks.run('wrap', l);
271 var o = Object.keys(l.attributes)
273 return e + '="' + (l.attributes[e] || '').replace(/"/g, '"') + '"';
280 l.classes.join(' ') +
292 return _self.addEventListener
293 ? (n.disableWorkerMessageHandler ||
294 _self.addEventListener(
297 var t = JSON.parse(e.data),
300 l = t.immediateClose;
301 _self.postMessage(n.highlight(r, n.languages[a], a)), l && _self.close();
307 var r = document.currentScript || [].slice.call(document.getElementsByTagName('script')).pop();
310 ((n.filename = r.src),
312 r.hasAttribute('data-manual') ||
313 ('loading' !== document.readyState
314 ? window.requestAnimationFrame
315 ? window.requestAnimationFrame(n.highlightAll)
316 : window.setTimeout(n.highlightAll, 16)
317 : document.addEventListener('DOMContentLoaded', n.highlightAll))),
321 'undefined' != typeof module && module.exports && (module.exports = Prism),
322 'undefined' != typeof global && (global.Prism = Prism);
323 (Prism.languages.markup = {
324 comment: /<!--[\s\S]*?-->/,
325 prolog: /<\?[\s\S]+?\?>/,
326 doctype: /<!DOCTYPE[\s\S]+?>/i,
327 cdata: /<!\[CDATA\[[\s\S]*?]]>/i,
330 /<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,
333 tag: { pattern: /^<\/?[^\s>\/]+/i, inside: { punctuation: /^<\/?/, namespace: /^[^\s>\/:]+:/ } },
335 pattern: /=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,
336 inside: { punctuation: [/^=/, { pattern: /(^|[^\\])["']/, lookbehind: !0 }] },
339 'attr-name': { pattern: /[^\s>\/]+/, inside: { namespace: /^[^\s>\/:]+:/ } },
342 entity: /&#?[\da-z]{1,8};/i,
344 (Prism.languages.markup.tag.inside['attr-value'].inside.entity = Prism.languages.markup.entity),
345 Prism.hooks.add('wrap', function (a) {
346 'entity' === a.type && (a.attributes.title = a.content.replace(/&/, '&'));
348 (Prism.languages.xml = Prism.languages.markup),
349 (Prism.languages.html = Prism.languages.markup),
350 (Prism.languages.mathml = Prism.languages.markup),
351 (Prism.languages.svg = Prism.languages.markup);
352 (Prism.languages.css = {
353 comment: /\/\*[\s\S]*?\*\//,
354 atrule: { pattern: /@[\w-]+?[\s\S]*?(?:;|(?=\s*\{))/i, inside: { rule: /@[\w-]+/ } },
355 url: /url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,
356 selector: /[^{}\s][^{};]*?(?=\s*\{)/,
357 string: { pattern: /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, greedy: !0 },
358 property: /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,
359 important: /!important\b/i,
360 function: /[-a-z0-9]+(?=\()/i,
361 punctuation: /[(){};:,]/,
363 (Prism.languages.css.atrule.inside.rest = Prism.languages.css),
364 Prism.languages.markup &&
365 (Prism.languages.insertBefore('markup', 'tag', {
367 pattern: /(<style[\s\S]*?>)[\s\S]*?(?=<\/style>)/i,
369 inside: Prism.languages.css,
370 alias: 'language-css',
374 Prism.languages.insertBefore(
379 pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,
381 'attr-name': { pattern: /^\s*style/i, inside: Prism.languages.markup.tag.inside },
382 punctuation: /^\s*=\s*['"]|['"]\s*$/,
383 'attr-value': { pattern: /.+/i, inside: Prism.languages.css },
385 alias: 'language-css',
388 Prism.languages.markup.tag
390 Prism.languages.clike = {
392 { pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, lookbehind: !0 },
393 { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 },
395 string: { pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, greedy: !0 },
397 pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,
399 inside: { punctuation: /[.\\]/ },
402 /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
403 boolean: /\b(?:true|false)\b/,
404 function: /\w+(?=\()/,
405 number: /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,
406 operator: /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,
407 punctuation: /[{}[\];(),.:]/,
409 (Prism.languages.javascript = Prism.languages.extend('clike', {
411 Prism.languages.clike['class-name'],
413 pattern: /(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,
418 { pattern: /((?:^|})\s*)(?:catch|finally)\b/, lookbehind: !0 },
419 /\b(?:as|async|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,
421 number: /\b(?:(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+)n?|\d+n|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,
422 function: /[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\(|\.(?:apply|bind|call)\()/,
423 operator: /-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/,
425 (Prism.languages.javascript['class-name'][0].pattern =
426 /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/),
427 Prism.languages.insertBefore('javascript', 'keyword', {
430 /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^\/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})\]]))/,
434 'function-variable': {
436 /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i,
441 pattern: /(function(?:\s+[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)[^\s()][^()]*?(?=\s*\))/,
443 inside: Prism.languages.javascript,
445 { pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/, inside: Prism.languages.javascript },
446 { pattern: /(\(\s*)[^\s()][^()]*?(?=\s*\)\s*=>)/, lookbehind: !0, inside: Prism.languages.javascript },
449 /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)[^\s()][^()]*?(?=\s*\)\s*\{)/,
451 inside: Prism.languages.javascript,
454 constant: /\b[A-Z][A-Z\d_]*\b/,
456 Prism.languages.insertBefore('javascript', 'string', {
458 pattern: /`(?:\\[\s\S]|\${[^}]+}|[^\\`])*`/,
462 pattern: /\${[^}]+}/,
464 'interpolation-punctuation': { pattern: /^\${|}$/, alias: 'punctuation' },
465 rest: Prism.languages.javascript,
472 Prism.languages.markup &&
473 Prism.languages.insertBefore('markup', 'tag', {
475 pattern: /(<script[\s\S]*?>)[\s\S]*?(?=<\/script>)/i,
477 inside: Prism.languages.javascript,
478 alias: 'language-javascript',
482 (Prism.languages.js = Prism.languages.javascript);
484 'undefined' != typeof self &&
487 document.createRange &&
488 ((Prism.plugins.KeepMarkup = !0),
489 Prism.hooks.add('before-highlight', function (e) {
490 if (e.element.children.length) {
493 t = function (e, d) {
495 d || ((r.clone = e.cloneNode(!1)), (r.posOpen = n), o.push(r));
496 for (var a = 0, s = e.childNodes.length; s > a; a++) {
497 var l = e.childNodes[a];
498 1 === l.nodeType ? t(l) : 3 === l.nodeType && (n += l.data.length);
500 d || (r.posClose = n);
502 t(e.element, !0), o && o.length && (e.keepMarkup = o);
505 Prism.hooks.add('after-highlight', function (e) {
506 if (e.keepMarkup && e.keepMarkup.length) {
507 var n = function (e, o) {
508 for (var t = 0, d = e.childNodes.length; d > t; t++) {
509 var r = e.childNodes[t];
510 if (1 === r.nodeType) {
511 if (!n(r, o)) return !1;
515 o.pos + r.data.length > o.node.posOpen &&
516 ((o.nodeStart = r), (o.nodeStartPos = o.node.posOpen - o.pos)),
518 o.pos + r.data.length >= o.node.posClose &&
519 ((o.nodeEnd = r), (o.nodeEndPos = o.node.posClose - o.pos)),
520 (o.pos += r.data.length));
521 if (o.nodeStart && o.nodeEnd) {
522 var a = document.createRange();
524 a.setStart(o.nodeStart, o.nodeStartPos),
525 a.setEnd(o.nodeEnd, o.nodeEndPos),
526 o.node.clone.appendChild(a.extractContents()),
527 a.insertNode(o.node.clone),
535 e.keepMarkup.forEach(function (o) {
536 n(e.element, { node: o, pos: 0 });
538 (e.highlightedCode = e.element.innerHTML);