@kerkhoff-ict/solora 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.css +583 -732
  2. package/dist/index.js +1970 -0
  3. package/package.json +11 -4
package/dist/index.js ADDED
@@ -0,0 +1,1970 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
12
+ });
13
+ var __commonJS = (cb, mod) => function __require2() {
14
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+
33
+ // node_modules/prismjs/prism.js
34
+ var require_prism = __commonJS({
35
+ "node_modules/prismjs/prism.js"(exports, module) {
36
+ var _self = typeof window !== "undefined" ? window : typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope ? self : {};
37
+ var Prism3 = (function(_self2) {
38
+ var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
39
+ var uniqueId = 0;
40
+ var plainTextGrammar = {};
41
+ var _ = {
42
+ /**
43
+ * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
44
+ * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
45
+ * additional languages or plugins yourself.
46
+ *
47
+ * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
48
+ *
49
+ * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
50
+ * empty Prism object into the global scope before loading the Prism script like this:
51
+ *
52
+ * ```js
53
+ * window.Prism = window.Prism || {};
54
+ * Prism.manual = true;
55
+ * // add a new <script> to load Prism's script
56
+ * ```
57
+ *
58
+ * @default false
59
+ * @type {boolean}
60
+ * @memberof Prism
61
+ * @public
62
+ */
63
+ manual: _self2.Prism && _self2.Prism.manual,
64
+ /**
65
+ * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
66
+ * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
67
+ * own worker, you don't want it to do this.
68
+ *
69
+ * By setting this value to `true`, Prism will not add its own listeners to the worker.
70
+ *
71
+ * You obviously have to change this value before Prism executes. To do this, you can add an
72
+ * empty Prism object into the global scope before loading the Prism script like this:
73
+ *
74
+ * ```js
75
+ * window.Prism = window.Prism || {};
76
+ * Prism.disableWorkerMessageHandler = true;
77
+ * // Load Prism's script
78
+ * ```
79
+ *
80
+ * @default false
81
+ * @type {boolean}
82
+ * @memberof Prism
83
+ * @public
84
+ */
85
+ disableWorkerMessageHandler: _self2.Prism && _self2.Prism.disableWorkerMessageHandler,
86
+ /**
87
+ * A namespace for utility methods.
88
+ *
89
+ * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
90
+ * change or disappear at any time.
91
+ *
92
+ * @namespace
93
+ * @memberof Prism
94
+ */
95
+ util: {
96
+ encode: function encode(tokens) {
97
+ if (tokens instanceof Token) {
98
+ return new Token(tokens.type, encode(tokens.content), tokens.alias);
99
+ } else if (Array.isArray(tokens)) {
100
+ return tokens.map(encode);
101
+ } else {
102
+ return tokens.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
103
+ }
104
+ },
105
+ /**
106
+ * Returns the name of the type of the given value.
107
+ *
108
+ * @param {any} o
109
+ * @returns {string}
110
+ * @example
111
+ * type(null) === 'Null'
112
+ * type(undefined) === 'Undefined'
113
+ * type(123) === 'Number'
114
+ * type('foo') === 'String'
115
+ * type(true) === 'Boolean'
116
+ * type([1, 2]) === 'Array'
117
+ * type({}) === 'Object'
118
+ * type(String) === 'Function'
119
+ * type(/abc+/) === 'RegExp'
120
+ */
121
+ type: function(o) {
122
+ return Object.prototype.toString.call(o).slice(8, -1);
123
+ },
124
+ /**
125
+ * Returns a unique number for the given object. Later calls will still return the same number.
126
+ *
127
+ * @param {Object} obj
128
+ * @returns {number}
129
+ */
130
+ objId: function(obj) {
131
+ if (!obj["__id"]) {
132
+ Object.defineProperty(obj, "__id", { value: ++uniqueId });
133
+ }
134
+ return obj["__id"];
135
+ },
136
+ /**
137
+ * Creates a deep clone of the given object.
138
+ *
139
+ * The main intended use of this function is to clone language definitions.
140
+ *
141
+ * @param {T} o
142
+ * @param {Record<number, any>} [visited]
143
+ * @returns {T}
144
+ * @template T
145
+ */
146
+ clone: function deepClone(o, visited) {
147
+ visited = visited || {};
148
+ var clone;
149
+ var id;
150
+ switch (_.util.type(o)) {
151
+ case "Object":
152
+ id = _.util.objId(o);
153
+ if (visited[id]) {
154
+ return visited[id];
155
+ }
156
+ clone = /** @type {Record<string, any>} */
157
+ {};
158
+ visited[id] = clone;
159
+ for (var key in o) {
160
+ if (o.hasOwnProperty(key)) {
161
+ clone[key] = deepClone(o[key], visited);
162
+ }
163
+ }
164
+ return (
165
+ /** @type {any} */
166
+ clone
167
+ );
168
+ case "Array":
169
+ id = _.util.objId(o);
170
+ if (visited[id]) {
171
+ return visited[id];
172
+ }
173
+ clone = [];
174
+ visited[id] = clone;
175
+ /** @type {Array} */
176
+ /** @type {any} */
177
+ o.forEach(function(v, i) {
178
+ clone[i] = deepClone(v, visited);
179
+ });
180
+ return (
181
+ /** @type {any} */
182
+ clone
183
+ );
184
+ default:
185
+ return o;
186
+ }
187
+ },
188
+ /**
189
+ * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
190
+ *
191
+ * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
192
+ *
193
+ * @param {Element} element
194
+ * @returns {string}
195
+ */
196
+ getLanguage: function(element) {
197
+ while (element) {
198
+ var m = lang.exec(element.className);
199
+ if (m) {
200
+ return m[1].toLowerCase();
201
+ }
202
+ element = element.parentElement;
203
+ }
204
+ return "none";
205
+ },
206
+ /**
207
+ * Sets the Prism `language-xxxx` class of the given element.
208
+ *
209
+ * @param {Element} element
210
+ * @param {string} language
211
+ * @returns {void}
212
+ */
213
+ setLanguage: function(element, language) {
214
+ element.className = element.className.replace(RegExp(lang, "gi"), "");
215
+ element.classList.add("language-" + language);
216
+ },
217
+ /**
218
+ * Returns the script element that is currently executing.
219
+ *
220
+ * This does __not__ work for line script element.
221
+ *
222
+ * @returns {HTMLScriptElement | null}
223
+ */
224
+ currentScript: function() {
225
+ if (typeof document === "undefined") {
226
+ return null;
227
+ }
228
+ if (document.currentScript && document.currentScript.tagName === "SCRIPT" && 1 < 2) {
229
+ return (
230
+ /** @type {any} */
231
+ document.currentScript
232
+ );
233
+ }
234
+ try {
235
+ throw new Error();
236
+ } catch (err) {
237
+ var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
238
+ if (src) {
239
+ var scripts = document.getElementsByTagName("script");
240
+ for (var i in scripts) {
241
+ if (scripts[i].src == src) {
242
+ return scripts[i];
243
+ }
244
+ }
245
+ }
246
+ return null;
247
+ }
248
+ },
249
+ /**
250
+ * Returns whether a given class is active for `element`.
251
+ *
252
+ * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
253
+ * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
254
+ * given class is just the given class with a `no-` prefix.
255
+ *
256
+ * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
257
+ * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
258
+ * ancestors have the given class or the negated version of it, then the default activation will be returned.
259
+ *
260
+ * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
261
+ * version of it, the class is considered active.
262
+ *
263
+ * @param {Element} element
264
+ * @param {string} className
265
+ * @param {boolean} [defaultActivation=false]
266
+ * @returns {boolean}
267
+ */
268
+ isActive: function(element, className, defaultActivation) {
269
+ var no = "no-" + className;
270
+ while (element) {
271
+ var classList = element.classList;
272
+ if (classList.contains(className)) {
273
+ return true;
274
+ }
275
+ if (classList.contains(no)) {
276
+ return false;
277
+ }
278
+ element = element.parentElement;
279
+ }
280
+ return !!defaultActivation;
281
+ }
282
+ },
283
+ /**
284
+ * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
285
+ *
286
+ * @namespace
287
+ * @memberof Prism
288
+ * @public
289
+ */
290
+ languages: {
291
+ /**
292
+ * The grammar for plain, unformatted text.
293
+ */
294
+ plain: plainTextGrammar,
295
+ plaintext: plainTextGrammar,
296
+ text: plainTextGrammar,
297
+ txt: plainTextGrammar,
298
+ /**
299
+ * Creates a deep copy of the language with the given id and appends the given tokens.
300
+ *
301
+ * If a token in `redef` also appears in the copied language, then the existing token in the copied language
302
+ * will be overwritten at its original position.
303
+ *
304
+ * ## Best practices
305
+ *
306
+ * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
307
+ * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
308
+ * understand the language definition because, normally, the order of tokens matters in Prism grammars.
309
+ *
310
+ * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
311
+ * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
312
+ *
313
+ * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
314
+ * @param {Grammar} redef The new tokens to append.
315
+ * @returns {Grammar} The new language created.
316
+ * @public
317
+ * @example
318
+ * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
319
+ * // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
320
+ * // at its original position
321
+ * 'comment': { ... },
322
+ * // CSS doesn't have a 'color' token, so this token will be appended
323
+ * 'color': /\b(?:red|green|blue)\b/
324
+ * });
325
+ */
326
+ extend: function(id, redef) {
327
+ var lang2 = _.util.clone(_.languages[id]);
328
+ for (var key in redef) {
329
+ lang2[key] = redef[key];
330
+ }
331
+ return lang2;
332
+ },
333
+ /**
334
+ * Inserts tokens _before_ another token in a language definition or any other grammar.
335
+ *
336
+ * ## Usage
337
+ *
338
+ * This helper method makes it easy to modify existing languages. For example, the CSS language definition
339
+ * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
340
+ * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
341
+ * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
342
+ * this:
343
+ *
344
+ * ```js
345
+ * Prism.languages.markup.style = {
346
+ * // token
347
+ * };
348
+ * ```
349
+ *
350
+ * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
351
+ * before existing tokens. For the CSS example above, you would use it like this:
352
+ *
353
+ * ```js
354
+ * Prism.languages.insertBefore('markup', 'cdata', {
355
+ * 'style': {
356
+ * // token
357
+ * }
358
+ * });
359
+ * ```
360
+ *
361
+ * ## Special cases
362
+ *
363
+ * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
364
+ * will be ignored.
365
+ *
366
+ * This behavior can be used to insert tokens after `before`:
367
+ *
368
+ * ```js
369
+ * Prism.languages.insertBefore('markup', 'comment', {
370
+ * 'comment': Prism.languages.markup.comment,
371
+ * // tokens after 'comment'
372
+ * });
373
+ * ```
374
+ *
375
+ * ## Limitations
376
+ *
377
+ * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
378
+ * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
379
+ * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
380
+ * deleting properties which is necessary to insert at arbitrary positions.
381
+ *
382
+ * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
383
+ * Instead, it will create a new object and replace all references to the target object with the new one. This
384
+ * can be done without temporarily deleting properties, so the iteration order is well-defined.
385
+ *
386
+ * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
387
+ * you hold the target object in a variable, then the value of the variable will not change.
388
+ *
389
+ * ```js
390
+ * var oldMarkup = Prism.languages.markup;
391
+ * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
392
+ *
393
+ * assert(oldMarkup !== Prism.languages.markup);
394
+ * assert(newMarkup === Prism.languages.markup);
395
+ * ```
396
+ *
397
+ * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
398
+ * object to be modified.
399
+ * @param {string} before The key to insert before.
400
+ * @param {Grammar} insert An object containing the key-value pairs to be inserted.
401
+ * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
402
+ * object to be modified.
403
+ *
404
+ * Defaults to `Prism.languages`.
405
+ * @returns {Grammar} The new grammar object.
406
+ * @public
407
+ */
408
+ insertBefore: function(inside, before, insert, root) {
409
+ root = root || /** @type {any} */
410
+ _.languages;
411
+ var grammar = root[inside];
412
+ var ret = {};
413
+ for (var token in grammar) {
414
+ if (grammar.hasOwnProperty(token)) {
415
+ if (token == before) {
416
+ for (var newToken in insert) {
417
+ if (insert.hasOwnProperty(newToken)) {
418
+ ret[newToken] = insert[newToken];
419
+ }
420
+ }
421
+ }
422
+ if (!insert.hasOwnProperty(token)) {
423
+ ret[token] = grammar[token];
424
+ }
425
+ }
426
+ }
427
+ var old = root[inside];
428
+ root[inside] = ret;
429
+ _.languages.DFS(_.languages, function(key, value) {
430
+ if (value === old && key != inside) {
431
+ this[key] = ret;
432
+ }
433
+ });
434
+ return ret;
435
+ },
436
+ // Traverse a language definition with Depth First Search
437
+ DFS: function DFS(o, callback, type, visited) {
438
+ visited = visited || {};
439
+ var objId = _.util.objId;
440
+ for (var i in o) {
441
+ if (o.hasOwnProperty(i)) {
442
+ callback.call(o, i, o[i], type || i);
443
+ var property = o[i];
444
+ var propertyType = _.util.type(property);
445
+ if (propertyType === "Object" && !visited[objId(property)]) {
446
+ visited[objId(property)] = true;
447
+ DFS(property, callback, null, visited);
448
+ } else if (propertyType === "Array" && !visited[objId(property)]) {
449
+ visited[objId(property)] = true;
450
+ DFS(property, callback, i, visited);
451
+ }
452
+ }
453
+ }
454
+ }
455
+ },
456
+ plugins: {},
457
+ /**
458
+ * This is the most high-level function in Prism’s API.
459
+ * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
460
+ * each one of them.
461
+ *
462
+ * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
463
+ *
464
+ * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
465
+ * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
466
+ * @memberof Prism
467
+ * @public
468
+ */
469
+ highlightAll: function(async, callback) {
470
+ _.highlightAllUnder(document, async, callback);
471
+ },
472
+ /**
473
+ * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
474
+ * {@link Prism.highlightElement} on each one of them.
475
+ *
476
+ * The following hooks will be run:
477
+ * 1. `before-highlightall`
478
+ * 2. `before-all-elements-highlight`
479
+ * 3. All hooks of {@link Prism.highlightElement} for each element.
480
+ *
481
+ * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
482
+ * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
483
+ * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
484
+ * @memberof Prism
485
+ * @public
486
+ */
487
+ highlightAllUnder: function(container, async, callback) {
488
+ var env = {
489
+ callback,
490
+ container,
491
+ selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
492
+ };
493
+ _.hooks.run("before-highlightall", env);
494
+ env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
495
+ _.hooks.run("before-all-elements-highlight", env);
496
+ for (var i = 0, element; element = env.elements[i++]; ) {
497
+ _.highlightElement(element, async === true, env.callback);
498
+ }
499
+ },
500
+ /**
501
+ * Highlights the code inside a single element.
502
+ *
503
+ * The following hooks will be run:
504
+ * 1. `before-sanity-check`
505
+ * 2. `before-highlight`
506
+ * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
507
+ * 4. `before-insert`
508
+ * 5. `after-highlight`
509
+ * 6. `complete`
510
+ *
511
+ * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
512
+ * the element's language.
513
+ *
514
+ * @param {Element} element The element containing the code.
515
+ * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
516
+ * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
517
+ * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
518
+ * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
519
+ *
520
+ * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
521
+ * asynchronous highlighting to work. You can build your own bundle on the
522
+ * [Download page](https://prismjs.com/download.html).
523
+ * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
524
+ * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
525
+ * @memberof Prism
526
+ * @public
527
+ */
528
+ highlightElement: function(element, async, callback) {
529
+ var language = _.util.getLanguage(element);
530
+ var grammar = _.languages[language];
531
+ _.util.setLanguage(element, language);
532
+ var parent = element.parentElement;
533
+ if (parent && parent.nodeName.toLowerCase() === "pre") {
534
+ _.util.setLanguage(parent, language);
535
+ }
536
+ var code = element.textContent;
537
+ var env = {
538
+ element,
539
+ language,
540
+ grammar,
541
+ code
542
+ };
543
+ function insertHighlightedCode(highlightedCode) {
544
+ env.highlightedCode = highlightedCode;
545
+ _.hooks.run("before-insert", env);
546
+ env.element.innerHTML = env.highlightedCode;
547
+ _.hooks.run("after-highlight", env);
548
+ _.hooks.run("complete", env);
549
+ callback && callback.call(env.element);
550
+ }
551
+ _.hooks.run("before-sanity-check", env);
552
+ parent = env.element.parentElement;
553
+ if (parent && parent.nodeName.toLowerCase() === "pre" && !parent.hasAttribute("tabindex")) {
554
+ parent.setAttribute("tabindex", "0");
555
+ }
556
+ if (!env.code) {
557
+ _.hooks.run("complete", env);
558
+ callback && callback.call(env.element);
559
+ return;
560
+ }
561
+ _.hooks.run("before-highlight", env);
562
+ if (!env.grammar) {
563
+ insertHighlightedCode(_.util.encode(env.code));
564
+ return;
565
+ }
566
+ if (async && _self2.Worker) {
567
+ var worker = new Worker(_.filename);
568
+ worker.onmessage = function(evt) {
569
+ insertHighlightedCode(evt.data);
570
+ };
571
+ worker.postMessage(JSON.stringify({
572
+ language: env.language,
573
+ code: env.code,
574
+ immediateClose: true
575
+ }));
576
+ } else {
577
+ insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
578
+ }
579
+ },
580
+ /**
581
+ * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
582
+ * and the language definitions to use, and returns a string with the HTML produced.
583
+ *
584
+ * The following hooks will be run:
585
+ * 1. `before-tokenize`
586
+ * 2. `after-tokenize`
587
+ * 3. `wrap`: On each {@link Token}.
588
+ *
589
+ * @param {string} text A string with the code to be highlighted.
590
+ * @param {Grammar} grammar An object containing the tokens to use.
591
+ *
592
+ * Usually a language definition like `Prism.languages.markup`.
593
+ * @param {string} language The name of the language definition passed to `grammar`.
594
+ * @returns {string} The highlighted HTML.
595
+ * @memberof Prism
596
+ * @public
597
+ * @example
598
+ * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
599
+ */
600
+ highlight: function(text, grammar, language) {
601
+ var env = {
602
+ code: text,
603
+ grammar,
604
+ language
605
+ };
606
+ _.hooks.run("before-tokenize", env);
607
+ if (!env.grammar) {
608
+ throw new Error('The language "' + env.language + '" has no grammar.');
609
+ }
610
+ env.tokens = _.tokenize(env.code, env.grammar);
611
+ _.hooks.run("after-tokenize", env);
612
+ return Token.stringify(_.util.encode(env.tokens), env.language);
613
+ },
614
+ /**
615
+ * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
616
+ * and the language definitions to use, and returns an array with the tokenized code.
617
+ *
618
+ * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
619
+ *
620
+ * This method could be useful in other contexts as well, as a very crude parser.
621
+ *
622
+ * @param {string} text A string with the code to be highlighted.
623
+ * @param {Grammar} grammar An object containing the tokens to use.
624
+ *
625
+ * Usually a language definition like `Prism.languages.markup`.
626
+ * @returns {TokenStream} An array of strings and tokens, a token stream.
627
+ * @memberof Prism
628
+ * @public
629
+ * @example
630
+ * let code = `var foo = 0;`;
631
+ * let tokens = Prism.tokenize(code, Prism.languages.javascript);
632
+ * tokens.forEach(token => {
633
+ * if (token instanceof Prism.Token && token.type === 'number') {
634
+ * console.log(`Found numeric literal: ${token.content}`);
635
+ * }
636
+ * });
637
+ */
638
+ tokenize: function(text, grammar) {
639
+ var rest = grammar.rest;
640
+ if (rest) {
641
+ for (var token in rest) {
642
+ grammar[token] = rest[token];
643
+ }
644
+ delete grammar.rest;
645
+ }
646
+ var tokenList = new LinkedList();
647
+ addAfter(tokenList, tokenList.head, text);
648
+ matchGrammar(text, tokenList, grammar, tokenList.head, 0);
649
+ return toArray(tokenList);
650
+ },
651
+ /**
652
+ * @namespace
653
+ * @memberof Prism
654
+ * @public
655
+ */
656
+ hooks: {
657
+ all: {},
658
+ /**
659
+ * Adds the given callback to the list of callbacks for the given hook.
660
+ *
661
+ * The callback will be invoked when the hook it is registered for is run.
662
+ * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
663
+ *
664
+ * One callback function can be registered to multiple hooks and the same hook multiple times.
665
+ *
666
+ * @param {string} name The name of the hook.
667
+ * @param {HookCallback} callback The callback function which is given environment variables.
668
+ * @public
669
+ */
670
+ add: function(name, callback) {
671
+ var hooks = _.hooks.all;
672
+ hooks[name] = hooks[name] || [];
673
+ hooks[name].push(callback);
674
+ },
675
+ /**
676
+ * Runs a hook invoking all registered callbacks with the given environment variables.
677
+ *
678
+ * Callbacks will be invoked synchronously and in the order in which they were registered.
679
+ *
680
+ * @param {string} name The name of the hook.
681
+ * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
682
+ * @public
683
+ */
684
+ run: function(name, env) {
685
+ var callbacks = _.hooks.all[name];
686
+ if (!callbacks || !callbacks.length) {
687
+ return;
688
+ }
689
+ for (var i = 0, callback; callback = callbacks[i++]; ) {
690
+ callback(env);
691
+ }
692
+ }
693
+ },
694
+ Token
695
+ };
696
+ _self2.Prism = _;
697
+ function Token(type, content, alias, matchedStr) {
698
+ this.type = type;
699
+ this.content = content;
700
+ this.alias = alias;
701
+ this.length = (matchedStr || "").length | 0;
702
+ }
703
+ Token.stringify = function stringify(o, language) {
704
+ if (typeof o == "string") {
705
+ return o;
706
+ }
707
+ if (Array.isArray(o)) {
708
+ var s = "";
709
+ o.forEach(function(e) {
710
+ s += stringify(e, language);
711
+ });
712
+ return s;
713
+ }
714
+ var env = {
715
+ type: o.type,
716
+ content: stringify(o.content, language),
717
+ tag: "span",
718
+ classes: ["token", o.type],
719
+ attributes: {},
720
+ language
721
+ };
722
+ var aliases = o.alias;
723
+ if (aliases) {
724
+ if (Array.isArray(aliases)) {
725
+ Array.prototype.push.apply(env.classes, aliases);
726
+ } else {
727
+ env.classes.push(aliases);
728
+ }
729
+ }
730
+ _.hooks.run("wrap", env);
731
+ var attributes = "";
732
+ for (var name in env.attributes) {
733
+ attributes += " " + name + '="' + (env.attributes[name] || "").replace(/"/g, "&quot;") + '"';
734
+ }
735
+ return "<" + env.tag + ' class="' + env.classes.join(" ") + '"' + attributes + ">" + env.content + "</" + env.tag + ">";
736
+ };
737
+ function matchPattern(pattern, pos, text, lookbehind) {
738
+ pattern.lastIndex = pos;
739
+ var match = pattern.exec(text);
740
+ if (match && lookbehind && match[1]) {
741
+ var lookbehindLength = match[1].length;
742
+ match.index += lookbehindLength;
743
+ match[0] = match[0].slice(lookbehindLength);
744
+ }
745
+ return match;
746
+ }
747
+ function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
748
+ for (var token in grammar) {
749
+ if (!grammar.hasOwnProperty(token) || !grammar[token]) {
750
+ continue;
751
+ }
752
+ var patterns = grammar[token];
753
+ patterns = Array.isArray(patterns) ? patterns : [patterns];
754
+ for (var j = 0; j < patterns.length; ++j) {
755
+ if (rematch && rematch.cause == token + "," + j) {
756
+ return;
757
+ }
758
+ var patternObj = patterns[j];
759
+ var inside = patternObj.inside;
760
+ var lookbehind = !!patternObj.lookbehind;
761
+ var greedy = !!patternObj.greedy;
762
+ var alias = patternObj.alias;
763
+ if (greedy && !patternObj.pattern.global) {
764
+ var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
765
+ patternObj.pattern = RegExp(patternObj.pattern.source, flags + "g");
766
+ }
767
+ var pattern = patternObj.pattern || patternObj;
768
+ for (var currentNode = startNode.next, pos = startPos; currentNode !== tokenList.tail; pos += currentNode.value.length, currentNode = currentNode.next) {
769
+ if (rematch && pos >= rematch.reach) {
770
+ break;
771
+ }
772
+ var str = currentNode.value;
773
+ if (tokenList.length > text.length) {
774
+ return;
775
+ }
776
+ if (str instanceof Token) {
777
+ continue;
778
+ }
779
+ var removeCount = 1;
780
+ var match;
781
+ if (greedy) {
782
+ match = matchPattern(pattern, pos, text, lookbehind);
783
+ if (!match || match.index >= text.length) {
784
+ break;
785
+ }
786
+ var from = match.index;
787
+ var to = match.index + match[0].length;
788
+ var p = pos;
789
+ p += currentNode.value.length;
790
+ while (from >= p) {
791
+ currentNode = currentNode.next;
792
+ p += currentNode.value.length;
793
+ }
794
+ p -= currentNode.value.length;
795
+ pos = p;
796
+ if (currentNode.value instanceof Token) {
797
+ continue;
798
+ }
799
+ for (var k = currentNode; k !== tokenList.tail && (p < to || typeof k.value === "string"); k = k.next) {
800
+ removeCount++;
801
+ p += k.value.length;
802
+ }
803
+ removeCount--;
804
+ str = text.slice(pos, p);
805
+ match.index -= pos;
806
+ } else {
807
+ match = matchPattern(pattern, 0, str, lookbehind);
808
+ if (!match) {
809
+ continue;
810
+ }
811
+ }
812
+ var from = match.index;
813
+ var matchStr = match[0];
814
+ var before = str.slice(0, from);
815
+ var after = str.slice(from + matchStr.length);
816
+ var reach = pos + str.length;
817
+ if (rematch && reach > rematch.reach) {
818
+ rematch.reach = reach;
819
+ }
820
+ var removeFrom = currentNode.prev;
821
+ if (before) {
822
+ removeFrom = addAfter(tokenList, removeFrom, before);
823
+ pos += before.length;
824
+ }
825
+ removeRange(tokenList, removeFrom, removeCount);
826
+ var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
827
+ currentNode = addAfter(tokenList, removeFrom, wrapped);
828
+ if (after) {
829
+ addAfter(tokenList, currentNode, after);
830
+ }
831
+ if (removeCount > 1) {
832
+ var nestedRematch = {
833
+ cause: token + "," + j,
834
+ reach
835
+ };
836
+ matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
837
+ if (rematch && nestedRematch.reach > rematch.reach) {
838
+ rematch.reach = nestedRematch.reach;
839
+ }
840
+ }
841
+ }
842
+ }
843
+ }
844
+ }
845
+ function LinkedList() {
846
+ var head = { value: null, prev: null, next: null };
847
+ var tail = { value: null, prev: head, next: null };
848
+ head.next = tail;
849
+ this.head = head;
850
+ this.tail = tail;
851
+ this.length = 0;
852
+ }
853
+ function addAfter(list, node, value) {
854
+ var next = node.next;
855
+ var newNode = { value, prev: node, next };
856
+ node.next = newNode;
857
+ next.prev = newNode;
858
+ list.length++;
859
+ return newNode;
860
+ }
861
+ function removeRange(list, node, count) {
862
+ var next = node.next;
863
+ for (var i = 0; i < count && next !== list.tail; i++) {
864
+ next = next.next;
865
+ }
866
+ node.next = next;
867
+ next.prev = node;
868
+ list.length -= i;
869
+ }
870
+ function toArray(list) {
871
+ var array = [];
872
+ var node = list.head.next;
873
+ while (node !== list.tail) {
874
+ array.push(node.value);
875
+ node = node.next;
876
+ }
877
+ return array;
878
+ }
879
+ if (!_self2.document) {
880
+ if (!_self2.addEventListener) {
881
+ return _;
882
+ }
883
+ if (!_.disableWorkerMessageHandler) {
884
+ _self2.addEventListener("message", function(evt) {
885
+ var message = JSON.parse(evt.data);
886
+ var lang2 = message.language;
887
+ var code = message.code;
888
+ var immediateClose = message.immediateClose;
889
+ _self2.postMessage(_.highlight(code, _.languages[lang2], lang2));
890
+ if (immediateClose) {
891
+ _self2.close();
892
+ }
893
+ }, false);
894
+ }
895
+ return _;
896
+ }
897
+ var script = _.util.currentScript();
898
+ if (script) {
899
+ _.filename = script.src;
900
+ if (script.hasAttribute("data-manual")) {
901
+ _.manual = true;
902
+ }
903
+ }
904
+ function highlightAutomaticallyCallback() {
905
+ if (!_.manual) {
906
+ _.highlightAll();
907
+ }
908
+ }
909
+ if (!_.manual) {
910
+ var readyState = document.readyState;
911
+ if (readyState === "loading" || readyState === "interactive" && script && script.defer) {
912
+ document.addEventListener("DOMContentLoaded", highlightAutomaticallyCallback);
913
+ } else {
914
+ if (window.requestAnimationFrame) {
915
+ window.requestAnimationFrame(highlightAutomaticallyCallback);
916
+ } else {
917
+ window.setTimeout(highlightAutomaticallyCallback, 16);
918
+ }
919
+ }
920
+ }
921
+ return _;
922
+ })(_self);
923
+ if (typeof module !== "undefined" && module.exports) {
924
+ module.exports = Prism3;
925
+ }
926
+ if (typeof global !== "undefined") {
927
+ global.Prism = Prism3;
928
+ }
929
+ Prism3.languages.markup = {
930
+ "comment": {
931
+ pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
932
+ greedy: true
933
+ },
934
+ "prolog": {
935
+ pattern: /<\?[\s\S]+?\?>/,
936
+ greedy: true
937
+ },
938
+ "doctype": {
939
+ // https://www.w3.org/TR/xml/#NT-doctypedecl
940
+ pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
941
+ greedy: true,
942
+ inside: {
943
+ "internal-subset": {
944
+ pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
945
+ lookbehind: true,
946
+ greedy: true,
947
+ inside: null
948
+ // see below
949
+ },
950
+ "string": {
951
+ pattern: /"[^"]*"|'[^']*'/,
952
+ greedy: true
953
+ },
954
+ "punctuation": /^<!|>$|[[\]]/,
955
+ "doctype-tag": /^DOCTYPE/i,
956
+ "name": /[^\s<>'"]+/
957
+ }
958
+ },
959
+ "cdata": {
960
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
961
+ greedy: true
962
+ },
963
+ "tag": {
964
+ pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
965
+ greedy: true,
966
+ inside: {
967
+ "tag": {
968
+ pattern: /^<\/?[^\s>\/]+/,
969
+ inside: {
970
+ "punctuation": /^<\/?/,
971
+ "namespace": /^[^\s>\/:]+:/
972
+ }
973
+ },
974
+ "special-attr": [],
975
+ "attr-value": {
976
+ pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
977
+ inside: {
978
+ "punctuation": [
979
+ {
980
+ pattern: /^=/,
981
+ alias: "attr-equals"
982
+ },
983
+ {
984
+ pattern: /^(\s*)["']|["']$/,
985
+ lookbehind: true
986
+ }
987
+ ]
988
+ }
989
+ },
990
+ "punctuation": /\/?>/,
991
+ "attr-name": {
992
+ pattern: /[^\s>\/]+/,
993
+ inside: {
994
+ "namespace": /^[^\s>\/:]+:/
995
+ }
996
+ }
997
+ }
998
+ },
999
+ "entity": [
1000
+ {
1001
+ pattern: /&[\da-z]{1,8};/i,
1002
+ alias: "named-entity"
1003
+ },
1004
+ /&#x?[\da-f]{1,8};/i
1005
+ ]
1006
+ };
1007
+ Prism3.languages.markup["tag"].inside["attr-value"].inside["entity"] = Prism3.languages.markup["entity"];
1008
+ Prism3.languages.markup["doctype"].inside["internal-subset"].inside = Prism3.languages.markup;
1009
+ Prism3.hooks.add("wrap", function(env) {
1010
+ if (env.type === "entity") {
1011
+ env.attributes["title"] = env.content.replace(/&amp;/, "&");
1012
+ }
1013
+ });
1014
+ Object.defineProperty(Prism3.languages.markup.tag, "addInlined", {
1015
+ /**
1016
+ * Adds an inlined language to markup.
1017
+ *
1018
+ * An example of an inlined language is CSS with `<style>` tags.
1019
+ *
1020
+ * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
1021
+ * case insensitive.
1022
+ * @param {string} lang The language key.
1023
+ * @example
1024
+ * addInlined('style', 'css');
1025
+ */
1026
+ value: function addInlined(tagName, lang) {
1027
+ var includedCdataInside = {};
1028
+ includedCdataInside["language-" + lang] = {
1029
+ pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1030
+ lookbehind: true,
1031
+ inside: Prism3.languages[lang]
1032
+ };
1033
+ includedCdataInside["cdata"] = /^<!\[CDATA\[|\]\]>$/i;
1034
+ var inside = {
1035
+ "included-cdata": {
1036
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1037
+ inside: includedCdataInside
1038
+ }
1039
+ };
1040
+ inside["language-" + lang] = {
1041
+ pattern: /[\s\S]+/,
1042
+ inside: Prism3.languages[lang]
1043
+ };
1044
+ var def = {};
1045
+ def[tagName] = {
1046
+ pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
1047
+ return tagName;
1048
+ }), "i"),
1049
+ lookbehind: true,
1050
+ greedy: true,
1051
+ inside
1052
+ };
1053
+ Prism3.languages.insertBefore("markup", "cdata", def);
1054
+ }
1055
+ });
1056
+ Object.defineProperty(Prism3.languages.markup.tag, "addAttribute", {
1057
+ /**
1058
+ * Adds an pattern to highlight languages embedded in HTML attributes.
1059
+ *
1060
+ * An example of an inlined language is CSS with `style` attributes.
1061
+ *
1062
+ * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
1063
+ * case insensitive.
1064
+ * @param {string} lang The language key.
1065
+ * @example
1066
+ * addAttribute('style', 'css');
1067
+ */
1068
+ value: function(attrName, lang) {
1069
+ Prism3.languages.markup.tag.inside["special-attr"].push({
1070
+ pattern: RegExp(
1071
+ /(^|["'\s])/.source + "(?:" + attrName + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
1072
+ "i"
1073
+ ),
1074
+ lookbehind: true,
1075
+ inside: {
1076
+ "attr-name": /^[^\s=]+/,
1077
+ "attr-value": {
1078
+ pattern: /=[\s\S]+/,
1079
+ inside: {
1080
+ "value": {
1081
+ pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1082
+ lookbehind: true,
1083
+ alias: [lang, "language-" + lang],
1084
+ inside: Prism3.languages[lang]
1085
+ },
1086
+ "punctuation": [
1087
+ {
1088
+ pattern: /^=/,
1089
+ alias: "attr-equals"
1090
+ },
1091
+ /"|'/
1092
+ ]
1093
+ }
1094
+ }
1095
+ }
1096
+ });
1097
+ }
1098
+ });
1099
+ Prism3.languages.html = Prism3.languages.markup;
1100
+ Prism3.languages.mathml = Prism3.languages.markup;
1101
+ Prism3.languages.svg = Prism3.languages.markup;
1102
+ Prism3.languages.xml = Prism3.languages.extend("markup", {});
1103
+ Prism3.languages.ssml = Prism3.languages.xml;
1104
+ Prism3.languages.atom = Prism3.languages.xml;
1105
+ Prism3.languages.rss = Prism3.languages.xml;
1106
+ (function(Prism4) {
1107
+ var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1108
+ Prism4.languages.css = {
1109
+ "comment": /\/\*[\s\S]*?\*\//,
1110
+ "atrule": {
1111
+ pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + string.source + ")*?" + /(?:;|(?=\s*\{))/.source),
1112
+ inside: {
1113
+ "rule": /^@[\w-]+/,
1114
+ "selector-function-argument": {
1115
+ pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
1116
+ lookbehind: true,
1117
+ alias: "selector"
1118
+ },
1119
+ "keyword": {
1120
+ pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
1121
+ lookbehind: true
1122
+ }
1123
+ // See rest below
1124
+ }
1125
+ },
1126
+ "url": {
1127
+ // https://drafts.csswg.org/css-values-3/#urls
1128
+ pattern: RegExp("\\burl\\((?:" + string.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
1129
+ greedy: true,
1130
+ inside: {
1131
+ "function": /^url/i,
1132
+ "punctuation": /^\(|\)$/,
1133
+ "string": {
1134
+ pattern: RegExp("^" + string.source + "$"),
1135
+ alias: "url"
1136
+ }
1137
+ }
1138
+ },
1139
+ "selector": {
1140
+ pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + string.source + ")*(?=\\s*\\{)"),
1141
+ lookbehind: true
1142
+ },
1143
+ "string": {
1144
+ pattern: string,
1145
+ greedy: true
1146
+ },
1147
+ "property": {
1148
+ pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
1149
+ lookbehind: true
1150
+ },
1151
+ "important": /!important\b/i,
1152
+ "function": {
1153
+ pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
1154
+ lookbehind: true
1155
+ },
1156
+ "punctuation": /[(){};:,]/
1157
+ };
1158
+ Prism4.languages.css["atrule"].inside.rest = Prism4.languages.css;
1159
+ var markup = Prism4.languages.markup;
1160
+ if (markup) {
1161
+ markup.tag.addInlined("style", "css");
1162
+ markup.tag.addAttribute("style", "css");
1163
+ }
1164
+ })(Prism3);
1165
+ Prism3.languages.clike = {
1166
+ "comment": [
1167
+ {
1168
+ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
1169
+ lookbehind: true,
1170
+ greedy: true
1171
+ },
1172
+ {
1173
+ pattern: /(^|[^\\:])\/\/.*/,
1174
+ lookbehind: true,
1175
+ greedy: true
1176
+ }
1177
+ ],
1178
+ "string": {
1179
+ pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
1180
+ greedy: true
1181
+ },
1182
+ "class-name": {
1183
+ pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
1184
+ lookbehind: true,
1185
+ inside: {
1186
+ "punctuation": /[.\\]/
1187
+ }
1188
+ },
1189
+ "keyword": /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
1190
+ "boolean": /\b(?:false|true)\b/,
1191
+ "function": /\b\w+(?=\()/,
1192
+ "number": /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
1193
+ "operator": /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
1194
+ "punctuation": /[{}[\];(),.:]/
1195
+ };
1196
+ Prism3.languages.javascript = Prism3.languages.extend("clike", {
1197
+ "class-name": [
1198
+ Prism3.languages.clike["class-name"],
1199
+ {
1200
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
1201
+ lookbehind: true
1202
+ }
1203
+ ],
1204
+ "keyword": [
1205
+ {
1206
+ pattern: /((?:^|\})\s*)catch\b/,
1207
+ lookbehind: true
1208
+ },
1209
+ {
1210
+ pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
1211
+ lookbehind: true
1212
+ }
1213
+ ],
1214
+ // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
1215
+ "function": /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1216
+ "number": {
1217
+ pattern: RegExp(
1218
+ /(^|[^\w$])/.source + "(?:" + // constant
1219
+ (/NaN|Infinity/.source + "|" + // binary integer
1220
+ /0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
1221
+ /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
1222
+ /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
1223
+ /\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
1224
+ /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
1225
+ ),
1226
+ lookbehind: true
1227
+ },
1228
+ "operator": /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1229
+ });
1230
+ Prism3.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
1231
+ Prism3.languages.insertBefore("javascript", "keyword", {
1232
+ "regex": {
1233
+ pattern: RegExp(
1234
+ // lookbehind
1235
+ // eslint-disable-next-line regexp/no-dupe-characters-character-class
1236
+ /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
1237
+ // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
1238
+ // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
1239
+ // with the only syntax, so we have to define 2 different regex patterns.
1240
+ /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
1241
+ /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
1242
+ /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
1243
+ ),
1244
+ lookbehind: true,
1245
+ greedy: true,
1246
+ inside: {
1247
+ "regex-source": {
1248
+ pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1249
+ lookbehind: true,
1250
+ alias: "language-regex",
1251
+ inside: Prism3.languages.regex
1252
+ },
1253
+ "regex-delimiter": /^\/|\/$/,
1254
+ "regex-flags": /^[a-z]+$/
1255
+ }
1256
+ },
1257
+ // This must be declared before keyword because we use "function" inside the look-forward
1258
+ "function-variable": {
1259
+ pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
1260
+ alias: "function"
1261
+ },
1262
+ "parameter": [
1263
+ {
1264
+ pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1265
+ lookbehind: true,
1266
+ inside: Prism3.languages.javascript
1267
+ },
1268
+ {
1269
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1270
+ lookbehind: true,
1271
+ inside: Prism3.languages.javascript
1272
+ },
1273
+ {
1274
+ pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1275
+ lookbehind: true,
1276
+ inside: Prism3.languages.javascript
1277
+ },
1278
+ {
1279
+ pattern: /((?:\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|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
1280
+ lookbehind: true,
1281
+ inside: Prism3.languages.javascript
1282
+ }
1283
+ ],
1284
+ "constant": /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1285
+ });
1286
+ Prism3.languages.insertBefore("javascript", "string", {
1287
+ "hashbang": {
1288
+ pattern: /^#!.*/,
1289
+ greedy: true,
1290
+ alias: "comment"
1291
+ },
1292
+ "template-string": {
1293
+ pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
1294
+ greedy: true,
1295
+ inside: {
1296
+ "template-punctuation": {
1297
+ pattern: /^`|`$/,
1298
+ alias: "string"
1299
+ },
1300
+ "interpolation": {
1301
+ pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
1302
+ lookbehind: true,
1303
+ inside: {
1304
+ "interpolation-punctuation": {
1305
+ pattern: /^\$\{|\}$/,
1306
+ alias: "punctuation"
1307
+ },
1308
+ rest: Prism3.languages.javascript
1309
+ }
1310
+ },
1311
+ "string": /[\s\S]+/
1312
+ }
1313
+ },
1314
+ "string-property": {
1315
+ pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
1316
+ lookbehind: true,
1317
+ greedy: true,
1318
+ alias: "property"
1319
+ }
1320
+ });
1321
+ Prism3.languages.insertBefore("javascript", "operator", {
1322
+ "literal-property": {
1323
+ pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
1324
+ lookbehind: true,
1325
+ alias: "property"
1326
+ }
1327
+ });
1328
+ if (Prism3.languages.markup) {
1329
+ Prism3.languages.markup.tag.addInlined("script", "javascript");
1330
+ Prism3.languages.markup.tag.addAttribute(
1331
+ /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
1332
+ "javascript"
1333
+ );
1334
+ }
1335
+ Prism3.languages.js = Prism3.languages.javascript;
1336
+ (function() {
1337
+ if (typeof Prism3 === "undefined" || typeof document === "undefined") {
1338
+ return;
1339
+ }
1340
+ if (!Element.prototype.matches) {
1341
+ Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
1342
+ }
1343
+ var LOADING_MESSAGE = "Loading\u2026";
1344
+ var FAILURE_MESSAGE = function(status, message) {
1345
+ return "\u2716 Error " + status + " while fetching file: " + message;
1346
+ };
1347
+ var FAILURE_EMPTY_MESSAGE = "\u2716 Error: File does not exist or is empty";
1348
+ var EXTENSIONS = {
1349
+ "js": "javascript",
1350
+ "py": "python",
1351
+ "rb": "ruby",
1352
+ "ps1": "powershell",
1353
+ "psm1": "powershell",
1354
+ "sh": "bash",
1355
+ "bat": "batch",
1356
+ "h": "c",
1357
+ "tex": "latex"
1358
+ };
1359
+ var STATUS_ATTR = "data-src-status";
1360
+ var STATUS_LOADING = "loading";
1361
+ var STATUS_LOADED = "loaded";
1362
+ var STATUS_FAILED = "failed";
1363
+ var SELECTOR = "pre[data-src]:not([" + STATUS_ATTR + '="' + STATUS_LOADED + '"]):not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])';
1364
+ function loadFile(src, success, error) {
1365
+ var xhr = new XMLHttpRequest();
1366
+ xhr.open("GET", src, true);
1367
+ xhr.onreadystatechange = function() {
1368
+ if (xhr.readyState == 4) {
1369
+ if (xhr.status < 400 && xhr.responseText) {
1370
+ success(xhr.responseText);
1371
+ } else {
1372
+ if (xhr.status >= 400) {
1373
+ error(FAILURE_MESSAGE(xhr.status, xhr.statusText));
1374
+ } else {
1375
+ error(FAILURE_EMPTY_MESSAGE);
1376
+ }
1377
+ }
1378
+ }
1379
+ };
1380
+ xhr.send(null);
1381
+ }
1382
+ function parseRange(range) {
1383
+ var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range || "");
1384
+ if (m) {
1385
+ var start = Number(m[1]);
1386
+ var comma = m[2];
1387
+ var end = m[3];
1388
+ if (!comma) {
1389
+ return [start, start];
1390
+ }
1391
+ if (!end) {
1392
+ return [start, void 0];
1393
+ }
1394
+ return [start, Number(end)];
1395
+ }
1396
+ return void 0;
1397
+ }
1398
+ Prism3.hooks.add("before-highlightall", function(env) {
1399
+ env.selector += ", " + SELECTOR;
1400
+ });
1401
+ Prism3.hooks.add("before-sanity-check", function(env) {
1402
+ var pre = (
1403
+ /** @type {HTMLPreElement} */
1404
+ env.element
1405
+ );
1406
+ if (pre.matches(SELECTOR)) {
1407
+ env.code = "";
1408
+ pre.setAttribute(STATUS_ATTR, STATUS_LOADING);
1409
+ var code = pre.appendChild(document.createElement("CODE"));
1410
+ code.textContent = LOADING_MESSAGE;
1411
+ var src = pre.getAttribute("data-src");
1412
+ var language = env.language;
1413
+ if (language === "none") {
1414
+ var extension = (/\.(\w+)$/.exec(src) || [, "none"])[1];
1415
+ language = EXTENSIONS[extension] || extension;
1416
+ }
1417
+ Prism3.util.setLanguage(code, language);
1418
+ Prism3.util.setLanguage(pre, language);
1419
+ var autoloader = Prism3.plugins.autoloader;
1420
+ if (autoloader) {
1421
+ autoloader.loadLanguages(language);
1422
+ }
1423
+ loadFile(
1424
+ src,
1425
+ function(text) {
1426
+ pre.setAttribute(STATUS_ATTR, STATUS_LOADED);
1427
+ var range = parseRange(pre.getAttribute("data-range"));
1428
+ if (range) {
1429
+ var lines = text.split(/\r\n?|\n/g);
1430
+ var start = range[0];
1431
+ var end = range[1] == null ? lines.length : range[1];
1432
+ if (start < 0) {
1433
+ start += lines.length;
1434
+ }
1435
+ start = Math.max(0, Math.min(start - 1, lines.length));
1436
+ if (end < 0) {
1437
+ end += lines.length;
1438
+ }
1439
+ end = Math.max(0, Math.min(end, lines.length));
1440
+ text = lines.slice(start, end).join("\n");
1441
+ if (!pre.hasAttribute("data-start")) {
1442
+ pre.setAttribute("data-start", String(start + 1));
1443
+ }
1444
+ }
1445
+ code.textContent = text;
1446
+ Prism3.highlightElement(code);
1447
+ },
1448
+ function(error) {
1449
+ pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
1450
+ code.textContent = error;
1451
+ }
1452
+ );
1453
+ }
1454
+ });
1455
+ Prism3.plugins.fileHighlight = {
1456
+ /**
1457
+ * Executes the File Highlight plugin for all matching `pre` elements under the given container.
1458
+ *
1459
+ * Note: Elements which are already loaded or currently loading will not be touched by this method.
1460
+ *
1461
+ * @param {ParentNode} [container=document]
1462
+ */
1463
+ highlight: function highlight(container) {
1464
+ var elements = (container || document).querySelectorAll(SELECTOR);
1465
+ for (var i = 0, element; element = elements[i++]; ) {
1466
+ Prism3.highlightElement(element);
1467
+ }
1468
+ }
1469
+ };
1470
+ var logged = false;
1471
+ Prism3.fileHighlight = function() {
1472
+ if (!logged) {
1473
+ console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead.");
1474
+ logged = true;
1475
+ }
1476
+ Prism3.plugins.fileHighlight.highlight.apply(this, arguments);
1477
+ };
1478
+ })();
1479
+ }
1480
+ });
1481
+
1482
+ // node_modules/prismjs/components.js
1483
+ var require_components = __commonJS({
1484
+ "node_modules/prismjs/components.js"(exports, module) {
1485
+ var components = { "core": { "meta": { "path": "components/prism-core.js", "option": "mandatory" }, "core": "Core" }, "themes": { "meta": { "path": "themes/{id}.css", "link": "index.html?theme={id}", "exclusive": true }, "prism": { "title": "Default", "option": "default" }, "prism-dark": "Dark", "prism-funky": "Funky", "prism-okaidia": { "title": "Okaidia", "owner": "ocodia" }, "prism-twilight": { "title": "Twilight", "owner": "remybach" }, "prism-coy": { "title": "Coy", "owner": "tshedor" }, "prism-solarizedlight": { "title": "Solarized Light", "owner": "hectormatos2011 " }, "prism-tomorrow": { "title": "Tomorrow Night", "owner": "Rosey" } }, "languages": { "meta": { "path": "components/prism-{id}", "noCSS": true, "examplesPath": "examples/prism-{id}", "addCheckAll": true }, "markup": { "title": "Markup", "alias": ["html", "xml", "svg", "mathml", "ssml", "atom", "rss"], "aliasTitles": { "html": "HTML", "xml": "XML", "svg": "SVG", "mathml": "MathML", "ssml": "SSML", "atom": "Atom", "rss": "RSS" }, "option": "default" }, "css": { "title": "CSS", "option": "default", "modify": "markup" }, "clike": { "title": "C-like", "option": "default" }, "javascript": { "title": "JavaScript", "require": "clike", "modify": "markup", "optional": "regex", "alias": "js", "option": "default" }, "abap": { "title": "ABAP", "owner": "dellagustin" }, "abnf": { "title": "ABNF", "owner": "RunDevelopment" }, "actionscript": { "title": "ActionScript", "require": "javascript", "modify": "markup", "owner": "Golmote" }, "ada": { "title": "Ada", "owner": "Lucretia" }, "agda": { "title": "Agda", "owner": "xy-ren" }, "al": { "title": "AL", "owner": "RunDevelopment" }, "antlr4": { "title": "ANTLR4", "alias": "g4", "owner": "RunDevelopment" }, "apacheconf": { "title": "Apache Configuration", "owner": "GuiTeK" }, "apex": { "title": "Apex", "require": ["clike", "sql"], "owner": "RunDevelopment" }, "apl": { "title": "APL", "owner": "ngn" }, "applescript": { "title": "AppleScript", "owner": "Golmote" }, "aql": { "title": "AQL", "owner": "RunDevelopment" }, "arduino": { "title": "Arduino", "require": "cpp", "alias": "ino", "owner": "dkern" }, "arff": { "title": "ARFF", "owner": "Golmote" }, "armasm": { "title": "ARM Assembly", "alias": "arm-asm", "owner": "RunDevelopment" }, "arturo": { "title": "Arturo", "alias": "art", "optional": ["bash", "css", "javascript", "markup", "markdown", "sql"], "owner": "drkameleon" }, "asciidoc": { "alias": "adoc", "title": "AsciiDoc", "owner": "Golmote" }, "aspnet": { "title": "ASP.NET (C#)", "require": ["markup", "csharp"], "owner": "nauzilus" }, "asm6502": { "title": "6502 Assembly", "owner": "kzurawel" }, "asmatmel": { "title": "Atmel AVR Assembly", "owner": "cerkit" }, "autohotkey": { "title": "AutoHotkey", "owner": "aviaryan" }, "autoit": { "title": "AutoIt", "owner": "Golmote" }, "avisynth": { "title": "AviSynth", "alias": "avs", "owner": "Zinfidel" }, "avro-idl": { "title": "Avro IDL", "alias": "avdl", "owner": "RunDevelopment" }, "awk": { "title": "AWK", "alias": "gawk", "aliasTitles": { "gawk": "GAWK" }, "owner": "RunDevelopment" }, "bash": { "title": "Bash", "alias": ["sh", "shell"], "aliasTitles": { "sh": "Shell", "shell": "Shell" }, "owner": "zeitgeist87" }, "basic": { "title": "BASIC", "owner": "Golmote" }, "batch": { "title": "Batch", "owner": "Golmote" }, "bbcode": { "title": "BBcode", "alias": "shortcode", "aliasTitles": { "shortcode": "Shortcode" }, "owner": "RunDevelopment" }, "bbj": { "title": "BBj", "owner": "hyyan" }, "bicep": { "title": "Bicep", "owner": "johnnyreilly" }, "birb": { "title": "Birb", "require": "clike", "owner": "Calamity210" }, "bison": { "title": "Bison", "require": "c", "owner": "Golmote" }, "bnf": { "title": "BNF", "alias": "rbnf", "aliasTitles": { "rbnf": "RBNF" }, "owner": "RunDevelopment" }, "bqn": { "title": "BQN", "owner": "yewscion" }, "brainfuck": { "title": "Brainfuck", "owner": "Golmote" }, "brightscript": { "title": "BrightScript", "owner": "RunDevelopment" }, "bro": { "title": "Bro", "owner": "wayward710" }, "bsl": { "title": "BSL (1C:Enterprise)", "alias": "oscript", "aliasTitles": { "oscript": "OneScript" }, "owner": "Diversus23" }, "c": { "title": "C", "require": "clike", "owner": "zeitgeist87" }, "csharp": { "title": "C#", "require": "clike", "alias": ["cs", "dotnet"], "owner": "mvalipour" }, "cpp": { "title": "C++", "require": "c", "owner": "zeitgeist87" }, "cfscript": { "title": "CFScript", "require": "clike", "alias": "cfc", "owner": "mjclemente" }, "chaiscript": { "title": "ChaiScript", "require": ["clike", "cpp"], "owner": "RunDevelopment" }, "cil": { "title": "CIL", "owner": "sbrl" }, "cilkc": { "title": "Cilk/C", "require": "c", "alias": "cilk-c", "owner": "OpenCilk" }, "cilkcpp": { "title": "Cilk/C++", "require": "cpp", "alias": ["cilk-cpp", "cilk"], "owner": "OpenCilk" }, "clojure": { "title": "Clojure", "owner": "troglotit" }, "cmake": { "title": "CMake", "owner": "mjrogozinski" }, "cobol": { "title": "COBOL", "owner": "RunDevelopment" }, "coffeescript": { "title": "CoffeeScript", "require": "javascript", "alias": "coffee", "owner": "R-osey" }, "concurnas": { "title": "Concurnas", "alias": "conc", "owner": "jasontatton" }, "csp": { "title": "Content-Security-Policy", "owner": "ScottHelme" }, "cooklang": { "title": "Cooklang", "owner": "ahue" }, "coq": { "title": "Coq", "owner": "RunDevelopment" }, "crystal": { "title": "Crystal", "require": "ruby", "owner": "MakeNowJust" }, "css-extras": { "title": "CSS Extras", "require": "css", "modify": "css", "owner": "milesj" }, "csv": { "title": "CSV", "owner": "RunDevelopment" }, "cue": { "title": "CUE", "owner": "RunDevelopment" }, "cypher": { "title": "Cypher", "owner": "RunDevelopment" }, "d": { "title": "D", "require": "clike", "owner": "Golmote" }, "dart": { "title": "Dart", "require": "clike", "owner": "Golmote" }, "dataweave": { "title": "DataWeave", "owner": "machaval" }, "dax": { "title": "DAX", "owner": "peterbud" }, "dhall": { "title": "Dhall", "owner": "RunDevelopment" }, "diff": { "title": "Diff", "owner": "uranusjr" }, "django": { "title": "Django/Jinja2", "require": "markup-templating", "alias": "jinja2", "owner": "romanvm" }, "dns-zone-file": { "title": "DNS zone file", "owner": "RunDevelopment", "alias": "dns-zone" }, "docker": { "title": "Docker", "alias": "dockerfile", "owner": "JustinBeckwith" }, "dot": { "title": "DOT (Graphviz)", "alias": "gv", "optional": "markup", "owner": "RunDevelopment" }, "ebnf": { "title": "EBNF", "owner": "RunDevelopment" }, "editorconfig": { "title": "EditorConfig", "owner": "osipxd" }, "eiffel": { "title": "Eiffel", "owner": "Conaclos" }, "ejs": { "title": "EJS", "require": ["javascript", "markup-templating"], "owner": "RunDevelopment", "alias": "eta", "aliasTitles": { "eta": "Eta" } }, "elixir": { "title": "Elixir", "owner": "Golmote" }, "elm": { "title": "Elm", "owner": "zwilias" }, "etlua": { "title": "Embedded Lua templating", "require": ["lua", "markup-templating"], "owner": "RunDevelopment" }, "erb": { "title": "ERB", "require": ["ruby", "markup-templating"], "owner": "Golmote" }, "erlang": { "title": "Erlang", "owner": "Golmote" }, "excel-formula": { "title": "Excel Formula", "alias": ["xlsx", "xls"], "owner": "RunDevelopment" }, "fsharp": { "title": "F#", "require": "clike", "owner": "simonreynolds7" }, "factor": { "title": "Factor", "owner": "catb0t" }, "false": { "title": "False", "owner": "edukisto" }, "firestore-security-rules": { "title": "Firestore security rules", "require": "clike", "owner": "RunDevelopment" }, "flow": { "title": "Flow", "require": "javascript", "owner": "Golmote" }, "fortran": { "title": "Fortran", "owner": "Golmote" }, "ftl": { "title": "FreeMarker Template Language", "require": "markup-templating", "owner": "RunDevelopment" }, "gml": { "title": "GameMaker Language", "alias": "gamemakerlanguage", "require": "clike", "owner": "LiarOnce" }, "gap": { "title": "GAP (CAS)", "owner": "RunDevelopment" }, "gcode": { "title": "G-code", "owner": "RunDevelopment" }, "gdscript": { "title": "GDScript", "owner": "RunDevelopment" }, "gedcom": { "title": "GEDCOM", "owner": "Golmote" }, "gettext": { "title": "gettext", "alias": "po", "owner": "RunDevelopment" }, "gherkin": { "title": "Gherkin", "owner": "hason" }, "git": { "title": "Git", "owner": "lgiraudel" }, "glsl": { "title": "GLSL", "require": "c", "owner": "Golmote" }, "gn": { "title": "GN", "alias": "gni", "owner": "RunDevelopment" }, "linker-script": { "title": "GNU Linker Script", "alias": "ld", "owner": "RunDevelopment" }, "go": { "title": "Go", "require": "clike", "owner": "arnehormann" }, "go-module": { "title": "Go module", "alias": "go-mod", "owner": "RunDevelopment" }, "gradle": { "title": "Gradle", "require": "clike", "owner": "zeabdelkhalek-badido18" }, "graphql": { "title": "GraphQL", "optional": "markdown", "owner": "Golmote" }, "groovy": { "title": "Groovy", "require": "clike", "owner": "robfletcher" }, "haml": { "title": "Haml", "require": "ruby", "optional": ["css", "css-extras", "coffeescript", "erb", "javascript", "less", "markdown", "scss", "textile"], "owner": "Golmote" }, "handlebars": { "title": "Handlebars", "require": "markup-templating", "alias": ["hbs", "mustache"], "aliasTitles": { "mustache": "Mustache" }, "owner": "Golmote" }, "haskell": { "title": "Haskell", "alias": "hs", "owner": "bholst" }, "haxe": { "title": "Haxe", "require": "clike", "optional": "regex", "owner": "Golmote" }, "hcl": { "title": "HCL", "owner": "outsideris" }, "hlsl": { "title": "HLSL", "require": "c", "owner": "RunDevelopment" }, "hoon": { "title": "Hoon", "owner": "matildepark" }, "http": { "title": "HTTP", "optional": ["csp", "css", "hpkp", "hsts", "javascript", "json", "markup", "uri"], "owner": "danielgtaylor" }, "hpkp": { "title": "HTTP Public-Key-Pins", "owner": "ScottHelme" }, "hsts": { "title": "HTTP Strict-Transport-Security", "owner": "ScottHelme" }, "ichigojam": { "title": "IchigoJam", "owner": "BlueCocoa" }, "icon": { "title": "Icon", "owner": "Golmote" }, "icu-message-format": { "title": "ICU Message Format", "owner": "RunDevelopment" }, "idris": { "title": "Idris", "alias": "idr", "owner": "KeenS", "require": "haskell" }, "ignore": { "title": ".ignore", "owner": "osipxd", "alias": ["gitignore", "hgignore", "npmignore"], "aliasTitles": { "gitignore": ".gitignore", "hgignore": ".hgignore", "npmignore": ".npmignore" } }, "inform7": { "title": "Inform 7", "owner": "Golmote" }, "ini": { "title": "Ini", "owner": "aviaryan" }, "io": { "title": "Io", "owner": "AlesTsurko" }, "j": { "title": "J", "owner": "Golmote" }, "java": { "title": "Java", "require": "clike", "owner": "sherblot" }, "javadoc": { "title": "JavaDoc", "require": ["markup", "java", "javadoclike"], "modify": "java", "optional": "scala", "owner": "RunDevelopment" }, "javadoclike": { "title": "JavaDoc-like", "modify": ["java", "javascript", "php"], "owner": "RunDevelopment" }, "javastacktrace": { "title": "Java stack trace", "owner": "RunDevelopment" }, "jexl": { "title": "Jexl", "owner": "czosel" }, "jolie": { "title": "Jolie", "require": "clike", "owner": "thesave" }, "jq": { "title": "JQ", "owner": "RunDevelopment" }, "jsdoc": { "title": "JSDoc", "require": ["javascript", "javadoclike", "typescript"], "modify": "javascript", "optional": ["actionscript", "coffeescript"], "owner": "RunDevelopment" }, "js-extras": { "title": "JS Extras", "require": "javascript", "modify": "javascript", "optional": ["actionscript", "coffeescript", "flow", "n4js", "typescript"], "owner": "RunDevelopment" }, "json": { "title": "JSON", "alias": "webmanifest", "aliasTitles": { "webmanifest": "Web App Manifest" }, "owner": "CupOfTea696" }, "json5": { "title": "JSON5", "require": "json", "owner": "RunDevelopment" }, "jsonp": { "title": "JSONP", "require": "json", "owner": "RunDevelopment" }, "jsstacktrace": { "title": "JS stack trace", "owner": "sbrl" }, "js-templates": { "title": "JS Templates", "require": "javascript", "modify": "javascript", "optional": ["css", "css-extras", "graphql", "markdown", "markup", "sql"], "owner": "RunDevelopment" }, "julia": { "title": "Julia", "owner": "cdagnino" }, "keepalived": { "title": "Keepalived Configure", "owner": "dev-itsheng" }, "keyman": { "title": "Keyman", "owner": "mcdurdin" }, "kotlin": { "title": "Kotlin", "alias": ["kt", "kts"], "aliasTitles": { "kts": "Kotlin Script" }, "require": "clike", "owner": "Golmote" }, "kumir": { "title": "KuMir (\u041A\u0443\u041C\u0438\u0440)", "alias": "kum", "owner": "edukisto" }, "kusto": { "title": "Kusto", "owner": "RunDevelopment" }, "latex": { "title": "LaTeX", "alias": ["tex", "context"], "aliasTitles": { "tex": "TeX", "context": "ConTeXt" }, "owner": "japborst" }, "latte": { "title": "Latte", "require": ["clike", "markup-templating", "php"], "owner": "nette" }, "less": { "title": "Less", "require": "css", "optional": "css-extras", "owner": "Golmote" }, "lilypond": { "title": "LilyPond", "require": "scheme", "alias": "ly", "owner": "RunDevelopment" }, "liquid": { "title": "Liquid", "require": "markup-templating", "owner": "cinhtau" }, "lisp": { "title": "Lisp", "alias": ["emacs", "elisp", "emacs-lisp"], "owner": "JuanCaicedo" }, "livescript": { "title": "LiveScript", "owner": "Golmote" }, "llvm": { "title": "LLVM IR", "owner": "porglezomp" }, "log": { "title": "Log file", "optional": "javastacktrace", "owner": "RunDevelopment" }, "lolcode": { "title": "LOLCODE", "owner": "Golmote" }, "lua": { "title": "Lua", "owner": "Golmote" }, "magma": { "title": "Magma (CAS)", "owner": "RunDevelopment" }, "makefile": { "title": "Makefile", "owner": "Golmote" }, "markdown": { "title": "Markdown", "require": "markup", "optional": "yaml", "alias": "md", "owner": "Golmote" }, "markup-templating": { "title": "Markup templating", "require": "markup", "owner": "Golmote" }, "mata": { "title": "Mata", "owner": "RunDevelopment" }, "matlab": { "title": "MATLAB", "owner": "Golmote" }, "maxscript": { "title": "MAXScript", "owner": "RunDevelopment" }, "mel": { "title": "MEL", "owner": "Golmote" }, "mermaid": { "title": "Mermaid", "owner": "RunDevelopment" }, "metafont": { "title": "METAFONT", "owner": "LaeriExNihilo" }, "mizar": { "title": "Mizar", "owner": "Golmote" }, "mongodb": { "title": "MongoDB", "owner": "airs0urce", "require": "javascript" }, "monkey": { "title": "Monkey", "owner": "Golmote" }, "moonscript": { "title": "MoonScript", "alias": "moon", "owner": "RunDevelopment" }, "n1ql": { "title": "N1QL", "owner": "TMWilds" }, "n4js": { "title": "N4JS", "require": "javascript", "optional": "jsdoc", "alias": "n4jsd", "owner": "bsmith-n4" }, "nand2tetris-hdl": { "title": "Nand To Tetris HDL", "owner": "stephanmax" }, "naniscript": { "title": "Naninovel Script", "owner": "Elringus", "alias": "nani" }, "nasm": { "title": "NASM", "owner": "rbmj" }, "neon": { "title": "NEON", "owner": "nette" }, "nevod": { "title": "Nevod", "owner": "nezaboodka" }, "nginx": { "title": "nginx", "owner": "volado" }, "nim": { "title": "Nim", "owner": "Golmote" }, "nix": { "title": "Nix", "owner": "Golmote" }, "nsis": { "title": "NSIS", "owner": "idleberg" }, "objectivec": { "title": "Objective-C", "require": "c", "alias": "objc", "owner": "uranusjr" }, "ocaml": { "title": "OCaml", "owner": "Golmote" }, "odin": { "title": "Odin", "owner": "edukisto" }, "opencl": { "title": "OpenCL", "require": "c", "modify": ["c", "cpp"], "owner": "Milania1" }, "openqasm": { "title": "OpenQasm", "alias": "qasm", "owner": "RunDevelopment" }, "oz": { "title": "Oz", "owner": "Golmote" }, "parigp": { "title": "PARI/GP", "owner": "Golmote" }, "parser": { "title": "Parser", "require": "markup", "owner": "Golmote" }, "pascal": { "title": "Pascal", "alias": "objectpascal", "aliasTitles": { "objectpascal": "Object Pascal" }, "owner": "Golmote" }, "pascaligo": { "title": "Pascaligo", "owner": "DefinitelyNotAGoat" }, "psl": { "title": "PATROL Scripting Language", "owner": "bertysentry" }, "pcaxis": { "title": "PC-Axis", "alias": "px", "owner": "RunDevelopment" }, "peoplecode": { "title": "PeopleCode", "alias": "pcode", "owner": "RunDevelopment" }, "perl": { "title": "Perl", "owner": "Golmote" }, "php": { "title": "PHP", "require": "markup-templating", "owner": "milesj" }, "phpdoc": { "title": "PHPDoc", "require": ["php", "javadoclike"], "modify": "php", "owner": "RunDevelopment" }, "php-extras": { "title": "PHP Extras", "require": "php", "modify": "php", "owner": "milesj" }, "plant-uml": { "title": "PlantUML", "alias": "plantuml", "owner": "RunDevelopment" }, "plsql": { "title": "PL/SQL", "require": "sql", "owner": "Golmote" }, "powerquery": { "title": "PowerQuery", "alias": ["pq", "mscript"], "owner": "peterbud" }, "powershell": { "title": "PowerShell", "owner": "nauzilus" }, "processing": { "title": "Processing", "require": "clike", "owner": "Golmote" }, "prolog": { "title": "Prolog", "owner": "Golmote" }, "promql": { "title": "PromQL", "owner": "arendjr" }, "properties": { "title": ".properties", "owner": "Golmote" }, "protobuf": { "title": "Protocol Buffers", "require": "clike", "owner": "just-boris" }, "pug": { "title": "Pug", "require": ["markup", "javascript"], "optional": ["coffeescript", "ejs", "handlebars", "less", "livescript", "markdown", "scss", "stylus", "twig"], "owner": "Golmote" }, "puppet": { "title": "Puppet", "owner": "Golmote" }, "pure": { "title": "Pure", "optional": ["c", "cpp", "fortran"], "owner": "Golmote" }, "purebasic": { "title": "PureBasic", "require": "clike", "alias": "pbfasm", "owner": "HeX0R101" }, "purescript": { "title": "PureScript", "require": "haskell", "alias": "purs", "owner": "sriharshachilakapati" }, "python": { "title": "Python", "alias": "py", "owner": "multipetros" }, "qsharp": { "title": "Q#", "require": "clike", "alias": "qs", "owner": "fedonman" }, "q": { "title": "Q (kdb+ database)", "owner": "Golmote" }, "qml": { "title": "QML", "require": "javascript", "owner": "RunDevelopment" }, "qore": { "title": "Qore", "require": "clike", "owner": "temnroegg" }, "r": { "title": "R", "owner": "Golmote" }, "racket": { "title": "Racket", "require": "scheme", "alias": "rkt", "owner": "RunDevelopment" }, "cshtml": { "title": "Razor C#", "alias": "razor", "require": ["markup", "csharp"], "optional": ["css", "css-extras", "javascript", "js-extras"], "owner": "RunDevelopment" }, "jsx": { "title": "React JSX", "require": ["markup", "javascript"], "optional": ["jsdoc", "js-extras", "js-templates"], "owner": "vkbansal" }, "tsx": { "title": "React TSX", "require": ["jsx", "typescript"] }, "reason": { "title": "Reason", "require": "clike", "owner": "Golmote" }, "regex": { "title": "Regex", "owner": "RunDevelopment" }, "rego": { "title": "Rego", "owner": "JordanSh" }, "renpy": { "title": "Ren'py", "alias": "rpy", "owner": "HyuchiaDiego" }, "rescript": { "title": "ReScript", "alias": "res", "owner": "vmarcosp" }, "rest": { "title": "reST (reStructuredText)", "owner": "Golmote" }, "rip": { "title": "Rip", "owner": "ravinggenius" }, "roboconf": { "title": "Roboconf", "owner": "Golmote" }, "robotframework": { "title": "Robot Framework", "alias": "robot", "owner": "RunDevelopment" }, "ruby": { "title": "Ruby", "require": "clike", "alias": "rb", "owner": "samflores" }, "rust": { "title": "Rust", "owner": "Golmote" }, "sas": { "title": "SAS", "optional": ["groovy", "lua", "sql"], "owner": "Golmote" }, "sass": { "title": "Sass (Sass)", "require": "css", "optional": "css-extras", "owner": "Golmote" }, "scss": { "title": "Sass (SCSS)", "require": "css", "optional": "css-extras", "owner": "MoOx" }, "scala": { "title": "Scala", "require": "java", "owner": "jozic" }, "scheme": { "title": "Scheme", "owner": "bacchus123" }, "shell-session": { "title": "Shell session", "require": "bash", "alias": ["sh-session", "shellsession"], "owner": "RunDevelopment" }, "smali": { "title": "Smali", "owner": "RunDevelopment" }, "smalltalk": { "title": "Smalltalk", "owner": "Golmote" }, "smarty": { "title": "Smarty", "require": "markup-templating", "optional": "php", "owner": "Golmote" }, "sml": { "title": "SML", "alias": "smlnj", "aliasTitles": { "smlnj": "SML/NJ" }, "owner": "RunDevelopment" }, "solidity": { "title": "Solidity (Ethereum)", "alias": "sol", "require": "clike", "owner": "glachaud" }, "solution-file": { "title": "Solution file", "alias": "sln", "owner": "RunDevelopment" }, "soy": { "title": "Soy (Closure Template)", "require": "markup-templating", "owner": "Golmote" }, "sparql": { "title": "SPARQL", "require": "turtle", "owner": "Triply-Dev", "alias": "rq" }, "splunk-spl": { "title": "Splunk SPL", "owner": "RunDevelopment" }, "sqf": { "title": "SQF: Status Quo Function (Arma 3)", "require": "clike", "owner": "RunDevelopment" }, "sql": { "title": "SQL", "owner": "multipetros" }, "squirrel": { "title": "Squirrel", "require": "clike", "owner": "RunDevelopment" }, "stan": { "title": "Stan", "owner": "RunDevelopment" }, "stata": { "title": "Stata Ado", "require": ["mata", "java", "python"], "owner": "RunDevelopment" }, "iecst": { "title": "Structured Text (IEC 61131-3)", "owner": "serhioromano" }, "stylus": { "title": "Stylus", "owner": "vkbansal" }, "supercollider": { "title": "SuperCollider", "alias": "sclang", "owner": "RunDevelopment" }, "swift": { "title": "Swift", "owner": "chrischares" }, "systemd": { "title": "Systemd configuration file", "owner": "RunDevelopment" }, "t4-templating": { "title": "T4 templating", "owner": "RunDevelopment" }, "t4-cs": { "title": "T4 Text Templates (C#)", "require": ["t4-templating", "csharp"], "alias": "t4", "owner": "RunDevelopment" }, "t4-vb": { "title": "T4 Text Templates (VB)", "require": ["t4-templating", "vbnet"], "owner": "RunDevelopment" }, "tap": { "title": "TAP", "owner": "isaacs", "require": "yaml" }, "tcl": { "title": "Tcl", "owner": "PeterChaplin" }, "tt2": { "title": "Template Toolkit 2", "require": ["clike", "markup-templating"], "owner": "gflohr" }, "textile": { "title": "Textile", "require": "markup", "optional": "css", "owner": "Golmote" }, "toml": { "title": "TOML", "owner": "RunDevelopment" }, "tremor": { "title": "Tremor", "alias": ["trickle", "troy"], "owner": "darach", "aliasTitles": { "trickle": "trickle", "troy": "troy" } }, "turtle": { "title": "Turtle", "alias": "trig", "aliasTitles": { "trig": "TriG" }, "owner": "jakubklimek" }, "twig": { "title": "Twig", "require": "markup-templating", "owner": "brandonkelly" }, "typescript": { "title": "TypeScript", "require": "javascript", "optional": "js-templates", "alias": "ts", "owner": "vkbansal" }, "typoscript": { "title": "TypoScript", "alias": "tsconfig", "aliasTitles": { "tsconfig": "TSConfig" }, "owner": "dkern" }, "unrealscript": { "title": "UnrealScript", "alias": ["uscript", "uc"], "owner": "RunDevelopment" }, "uorazor": { "title": "UO Razor Script", "owner": "jaseowns" }, "uri": { "title": "URI", "alias": "url", "aliasTitles": { "url": "URL" }, "owner": "RunDevelopment" }, "v": { "title": "V", "require": "clike", "owner": "taggon" }, "vala": { "title": "Vala", "require": "clike", "optional": "regex", "owner": "TemplarVolk" }, "vbnet": { "title": "VB.Net", "require": "basic", "owner": "Bigsby" }, "velocity": { "title": "Velocity", "require": "markup", "owner": "Golmote" }, "verilog": { "title": "Verilog", "owner": "a-rey" }, "vhdl": { "title": "VHDL", "owner": "a-rey" }, "vim": { "title": "vim", "owner": "westonganger" }, "visual-basic": { "title": "Visual Basic", "alias": ["vb", "vba"], "aliasTitles": { "vba": "VBA" }, "owner": "Golmote" }, "warpscript": { "title": "WarpScript", "owner": "RunDevelopment" }, "wasm": { "title": "WebAssembly", "owner": "Golmote" }, "web-idl": { "title": "Web IDL", "alias": "webidl", "owner": "RunDevelopment" }, "wgsl": { "title": "WGSL", "owner": "Dr4gonthree" }, "wiki": { "title": "Wiki markup", "require": "markup", "owner": "Golmote" }, "wolfram": { "title": "Wolfram language", "alias": ["mathematica", "nb", "wl"], "aliasTitles": { "mathematica": "Mathematica", "nb": "Mathematica Notebook" }, "owner": "msollami" }, "wren": { "title": "Wren", "owner": "clsource" }, "xeora": { "title": "Xeora", "require": "markup", "alias": "xeoracube", "aliasTitles": { "xeoracube": "XeoraCube" }, "owner": "freakmaxi" }, "xml-doc": { "title": "XML doc (.net)", "require": "markup", "modify": ["csharp", "fsharp", "vbnet"], "owner": "RunDevelopment" }, "xojo": { "title": "Xojo (REALbasic)", "owner": "Golmote" }, "xquery": { "title": "XQuery", "require": "markup", "owner": "Golmote" }, "yaml": { "title": "YAML", "alias": "yml", "owner": "hason" }, "yang": { "title": "YANG", "owner": "RunDevelopment" }, "zig": { "title": "Zig", "owner": "RunDevelopment" } }, "plugins": { "meta": { "path": "plugins/{id}/prism-{id}", "link": "plugins/{id}/" }, "line-highlight": { "title": "Line Highlight", "description": "Highlights specific lines and/or line ranges." }, "line-numbers": { "title": "Line Numbers", "description": "Line number at the beginning of code lines.", "owner": "kuba-kubula" }, "show-invisibles": { "title": "Show Invisibles", "description": "Show hidden characters such as tabs and line breaks.", "optional": ["autolinker", "data-uri-highlight"] }, "autolinker": { "title": "Autolinker", "description": "Converts URLs and emails in code to clickable links. Parses Markdown links in comments." }, "wpd": { "title": "WebPlatform Docs", "description": 'Makes tokens link to <a href="https://webplatform.github.io/docs/">WebPlatform.org documentation</a>. The links open in a new tab.' }, "custom-class": { "title": "Custom Class", "description": "This plugin allows you to prefix Prism's default classes (<code>.comment</code> can become <code>.namespace--comment</code>) or replace them with your defined ones (like <code>.editor__comment</code>). You can even add new classes.", "owner": "dvkndn", "noCSS": true }, "file-highlight": { "title": "File Highlight", "description": "Fetch external files and highlight them with Prism. Used on the Prism website itself.", "noCSS": true }, "show-language": { "title": "Show Language", "description": "Display the highlighted language in code blocks (inline code does not show the label).", "owner": "nauzilus", "noCSS": true, "require": "toolbar" }, "jsonp-highlight": { "title": "JSONP Highlight", "description": "Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).", "noCSS": true, "owner": "nauzilus" }, "highlight-keywords": { "title": "Highlight Keywords", "description": "Adds special CSS classes for each keyword for fine-grained highlighting.", "owner": "vkbansal", "noCSS": true }, "remove-initial-line-feed": { "title": "Remove initial line feed", "description": "Removes the initial line feed in code blocks.", "owner": "Golmote", "noCSS": true }, "inline-color": { "title": "Inline color", "description": "Adds a small inline preview for colors in style sheets.", "require": "css-extras", "owner": "RunDevelopment" }, "previewers": { "title": "Previewers", "description": "Previewers for angles, colors, gradients, easing and time.", "require": "css-extras", "owner": "Golmote" }, "autoloader": { "title": "Autoloader", "description": "Automatically loads the needed languages to highlight the code blocks.", "owner": "Golmote", "noCSS": true }, "keep-markup": { "title": "Keep Markup", "description": "Prevents custom markup from being dropped out during highlighting.", "owner": "Golmote", "optional": "normalize-whitespace", "noCSS": true }, "command-line": { "title": "Command Line", "description": "Display a command line with a prompt and, optionally, the output/response from the commands.", "owner": "chriswells0" }, "unescaped-markup": { "title": "Unescaped Markup", "description": "Write markup without having to escape anything." }, "normalize-whitespace": { "title": "Normalize Whitespace", "description": "Supports multiple operations to normalize whitespace in code blocks.", "owner": "zeitgeist87", "optional": "unescaped-markup", "noCSS": true }, "data-uri-highlight": { "title": "Data-URI Highlight", "description": "Highlights data-URI contents.", "owner": "Golmote", "noCSS": true }, "toolbar": { "title": "Toolbar", "description": "Attach a toolbar for plugins to easily register buttons on the top of a code block.", "owner": "mAAdhaTTah" }, "copy-to-clipboard": { "title": "Copy to Clipboard Button", "description": "Add a button that copies the code block to the clipboard when clicked.", "owner": "mAAdhaTTah", "require": "toolbar", "noCSS": true }, "download-button": { "title": "Download Button", "description": "A button in the toolbar of a code block adding a convenient way to download a code file.", "owner": "Golmote", "require": "toolbar", "noCSS": true }, "match-braces": { "title": "Match braces", "description": "Highlights matching braces.", "owner": "RunDevelopment" }, "diff-highlight": { "title": "Diff Highlight", "description": "Highlights the code inside diff blocks.", "owner": "RunDevelopment", "require": "diff" }, "filter-highlight-all": { "title": "Filter highlightAll", "description": "Filters the elements the <code>highlightAll</code> and <code>highlightAllUnder</code> methods actually highlight.", "owner": "RunDevelopment", "noCSS": true }, "treeview": { "title": "Treeview", "description": "A language with special styles to highlight file system tree structures.", "owner": "Golmote" } } };
1486
+ if (typeof module !== "undefined" && module.exports) {
1487
+ module.exports = components;
1488
+ }
1489
+ }
1490
+ });
1491
+
1492
+ // node_modules/prismjs/dependencies.js
1493
+ var require_dependencies = __commonJS({
1494
+ "node_modules/prismjs/dependencies.js"(exports, module) {
1495
+ "use strict";
1496
+ var getLoader = /* @__PURE__ */ (function() {
1497
+ var noop = function() {
1498
+ };
1499
+ function forEach(value, callbackFn) {
1500
+ if (Array.isArray(value)) {
1501
+ value.forEach(callbackFn);
1502
+ } else if (value != null) {
1503
+ callbackFn(value, 0);
1504
+ }
1505
+ }
1506
+ function toSet(array) {
1507
+ var set = {};
1508
+ for (var i = 0, l = array.length; i < l; i++) {
1509
+ set[array[i]] = true;
1510
+ }
1511
+ return set;
1512
+ }
1513
+ function createEntryMap(components) {
1514
+ var map = {};
1515
+ for (var categoryName in components) {
1516
+ var category = components[categoryName];
1517
+ for (var id in category) {
1518
+ if (id != "meta") {
1519
+ var entry = category[id];
1520
+ map[id] = typeof entry == "string" ? { title: entry } : entry;
1521
+ }
1522
+ }
1523
+ }
1524
+ return map;
1525
+ }
1526
+ function createDependencyResolver(entryMap) {
1527
+ var map = {};
1528
+ var _stackArray = [];
1529
+ function addToMap(id, stack) {
1530
+ if (id in map) {
1531
+ return;
1532
+ }
1533
+ stack.push(id);
1534
+ var firstIndex = stack.indexOf(id);
1535
+ if (firstIndex < stack.length - 1) {
1536
+ throw new Error("Circular dependency: " + stack.slice(firstIndex).join(" -> "));
1537
+ }
1538
+ var dependencies = {};
1539
+ var entry = entryMap[id];
1540
+ if (entry) {
1541
+ let handleDirectDependency = function(depId) {
1542
+ if (!(depId in entryMap)) {
1543
+ throw new Error(id + " depends on an unknown component " + depId);
1544
+ }
1545
+ if (depId in dependencies) {
1546
+ return;
1547
+ }
1548
+ addToMap(depId, stack);
1549
+ dependencies[depId] = true;
1550
+ for (var transitiveDepId in map[depId]) {
1551
+ dependencies[transitiveDepId] = true;
1552
+ }
1553
+ };
1554
+ forEach(entry.require, handleDirectDependency);
1555
+ forEach(entry.optional, handleDirectDependency);
1556
+ forEach(entry.modify, handleDirectDependency);
1557
+ }
1558
+ map[id] = dependencies;
1559
+ stack.pop();
1560
+ }
1561
+ return function(id) {
1562
+ var deps = map[id];
1563
+ if (!deps) {
1564
+ addToMap(id, _stackArray);
1565
+ deps = map[id];
1566
+ }
1567
+ return deps;
1568
+ };
1569
+ }
1570
+ function createAliasResolver(entryMap) {
1571
+ var map;
1572
+ return function(idOrAlias) {
1573
+ if (idOrAlias in entryMap) {
1574
+ return idOrAlias;
1575
+ } else {
1576
+ if (!map) {
1577
+ map = {};
1578
+ for (var id in entryMap) {
1579
+ var entry = entryMap[id];
1580
+ forEach(entry && entry.alias, function(alias) {
1581
+ if (alias in map) {
1582
+ throw new Error(alias + " cannot be alias for both " + id + " and " + map[alias]);
1583
+ }
1584
+ if (alias in entryMap) {
1585
+ throw new Error(alias + " cannot be alias of " + id + " because it is a component.");
1586
+ }
1587
+ map[alias] = id;
1588
+ });
1589
+ }
1590
+ }
1591
+ return map[idOrAlias] || idOrAlias;
1592
+ }
1593
+ };
1594
+ }
1595
+ function loadComponentsInOrder(dependencyResolver, ids, loadComponent, chainer) {
1596
+ var series = chainer ? chainer.series : void 0;
1597
+ var parallel = chainer ? chainer.parallel : noop;
1598
+ var cache = {};
1599
+ var ends = {};
1600
+ function handleId(id2) {
1601
+ if (id2 in cache) {
1602
+ return cache[id2];
1603
+ }
1604
+ ends[id2] = true;
1605
+ var dependsOn = [];
1606
+ for (var depId in dependencyResolver(id2)) {
1607
+ if (depId in ids) {
1608
+ dependsOn.push(depId);
1609
+ }
1610
+ }
1611
+ var value;
1612
+ if (dependsOn.length === 0) {
1613
+ value = loadComponent(id2);
1614
+ } else {
1615
+ var depsValue = parallel(dependsOn.map(function(depId2) {
1616
+ var value2 = handleId(depId2);
1617
+ delete ends[depId2];
1618
+ return value2;
1619
+ }));
1620
+ if (series) {
1621
+ value = series(depsValue, function() {
1622
+ return loadComponent(id2);
1623
+ });
1624
+ } else {
1625
+ loadComponent(id2);
1626
+ }
1627
+ }
1628
+ return cache[id2] = value;
1629
+ }
1630
+ for (var id in ids) {
1631
+ handleId(id);
1632
+ }
1633
+ var endValues = [];
1634
+ for (var endId in ends) {
1635
+ endValues.push(cache[endId]);
1636
+ }
1637
+ return parallel(endValues);
1638
+ }
1639
+ function hasKeys(obj) {
1640
+ for (var key in obj) {
1641
+ return true;
1642
+ }
1643
+ return false;
1644
+ }
1645
+ function getLoader2(components, load, loaded) {
1646
+ var entryMap = createEntryMap(components);
1647
+ var resolveAlias = createAliasResolver(entryMap);
1648
+ load = load.map(resolveAlias);
1649
+ loaded = (loaded || []).map(resolveAlias);
1650
+ var loadSet = toSet(load);
1651
+ var loadedSet = toSet(loaded);
1652
+ load.forEach(addRequirements);
1653
+ function addRequirements(id) {
1654
+ var entry2 = entryMap[id];
1655
+ forEach(entry2 && entry2.require, function(reqId) {
1656
+ if (!(reqId in loadedSet)) {
1657
+ loadSet[reqId] = true;
1658
+ addRequirements(reqId);
1659
+ }
1660
+ });
1661
+ }
1662
+ var dependencyResolver = createDependencyResolver(entryMap);
1663
+ var loadAdditions = loadSet;
1664
+ var newIds;
1665
+ while (hasKeys(loadAdditions)) {
1666
+ newIds = {};
1667
+ for (var loadId in loadAdditions) {
1668
+ var entry = entryMap[loadId];
1669
+ forEach(entry && entry.modify, function(modId) {
1670
+ if (modId in loadedSet) {
1671
+ newIds[modId] = true;
1672
+ }
1673
+ });
1674
+ }
1675
+ for (var loadedId in loadedSet) {
1676
+ if (!(loadedId in loadSet)) {
1677
+ for (var depId in dependencyResolver(loadedId)) {
1678
+ if (depId in loadSet) {
1679
+ newIds[loadedId] = true;
1680
+ break;
1681
+ }
1682
+ }
1683
+ }
1684
+ }
1685
+ loadAdditions = newIds;
1686
+ for (var newId in loadAdditions) {
1687
+ loadSet[newId] = true;
1688
+ }
1689
+ }
1690
+ var loader = {
1691
+ getIds: function() {
1692
+ var ids = [];
1693
+ loader.load(function(id) {
1694
+ ids.push(id);
1695
+ });
1696
+ return ids;
1697
+ },
1698
+ load: function(loadComponent, chainer) {
1699
+ return loadComponentsInOrder(dependencyResolver, loadSet, loadComponent, chainer);
1700
+ }
1701
+ };
1702
+ return loader;
1703
+ }
1704
+ return getLoader2;
1705
+ })();
1706
+ if (typeof module !== "undefined") {
1707
+ module.exports = getLoader;
1708
+ }
1709
+ }
1710
+ });
1711
+
1712
+ // node_modules/prismjs/components/index.js
1713
+ var require_components2 = __commonJS({
1714
+ "node_modules/prismjs/components/index.js"(exports, module) {
1715
+ var components = require_components();
1716
+ var getLoader = require_dependencies();
1717
+ var loadedLanguages = /* @__PURE__ */ new Set();
1718
+ function loadLanguages(languages) {
1719
+ if (languages === void 0) {
1720
+ languages = Object.keys(components.languages).filter((l) => l != "meta");
1721
+ } else if (!Array.isArray(languages)) {
1722
+ languages = [languages];
1723
+ }
1724
+ const loaded = [...loadedLanguages, ...Object.keys(Prism.languages)];
1725
+ getLoader(components, languages, loaded).load((lang) => {
1726
+ if (!(lang in components.languages)) {
1727
+ if (!loadLanguages.silent) {
1728
+ console.warn("Language does not exist: " + lang);
1729
+ }
1730
+ return;
1731
+ }
1732
+ const pathToLanguage = "./prism-" + lang;
1733
+ delete __require.cache[__require.resolve(pathToLanguage)];
1734
+ delete Prism.languages[lang];
1735
+ __require(pathToLanguage);
1736
+ loadedLanguages.add(lang);
1737
+ });
1738
+ }
1739
+ loadLanguages.silent = false;
1740
+ module.exports = loadLanguages;
1741
+ }
1742
+ });
1743
+
1744
+ // src/components/codeblock.js
1745
+ var import_prismjs = __toESM(require_prism());
1746
+ var import_components = __toESM(require_components2());
1747
+ function initCodeblocks() {
1748
+ const blocks = document.querySelectorAll(".codeblock");
1749
+ blocks.forEach((block) => {
1750
+ const pre = block.querySelector("pre");
1751
+ const copyBtn = block.querySelector(".pre-copy-btn");
1752
+ const closeBtn = block.querySelector(".close-btn");
1753
+ const minimizeBtn = block.querySelector(".minimize-btn");
1754
+ const preContent = block.querySelector(".pre-content");
1755
+ if (!pre || !preContent) return;
1756
+ if (copyBtn) preContent.insertBefore(copyBtn, preContent.firstChild);
1757
+ if (copyBtn && !copyBtn.dataset.bound) {
1758
+ copyBtn.dataset.bound = "true";
1759
+ copyBtn.addEventListener("click", async () => {
1760
+ try {
1761
+ await navigator.clipboard.writeText(pre.innerText);
1762
+ const oldText = copyBtn.innerText;
1763
+ copyBtn.innerText = "Copied!";
1764
+ setTimeout(() => copyBtn.innerText = oldText, 1200);
1765
+ } catch (err) {
1766
+ console.error("Copy failed:", err);
1767
+ }
1768
+ });
1769
+ }
1770
+ const code = pre.textContent;
1771
+ const lang = (pre.dataset.language || "javascript").toLowerCase();
1772
+ if (!import_prismjs.default.languages[lang]) {
1773
+ console.warn(`Language '${lang}' not loaded in Prism, using plaintext fallback.`);
1774
+ pre.textContent = code;
1775
+ } else {
1776
+ pre.innerHTML = import_prismjs.default.highlight(code, import_prismjs.default.languages[lang], lang);
1777
+ }
1778
+ if (block.classList.contains("draggable")) makeDraggable(block);
1779
+ if (closeBtn) closeBtn.addEventListener("click", () => {
1780
+ block.style.transition = "opacity 0.3s ease, transform 0.3s ease";
1781
+ block.style.opacity = 0;
1782
+ block.style.transform = "scale(0.95)";
1783
+ setTimeout(() => block.remove(), 300);
1784
+ });
1785
+ if (minimizeBtn) minimizeBtn.addEventListener("click", () => {
1786
+ preContent.classList.toggle("collapsed");
1787
+ });
1788
+ const maximizeBtn = block.querySelector(".maximize-btn");
1789
+ if (maximizeBtn) initMaximizeButton(block, maximizeBtn);
1790
+ });
1791
+ }
1792
+ function initMaximizeButton(block, maximizeBtn) {
1793
+ maximizeBtn.addEventListener("click", (e) => {
1794
+ e.stopPropagation();
1795
+ const scrollX = window.scrollX || window.pageXOffset;
1796
+ const scrollY = window.scrollY || window.pageYOffset;
1797
+ if (!block.dataset.origRect) {
1798
+ const rect = block.getBoundingClientRect();
1799
+ block.dataset.origRect = JSON.stringify({
1800
+ top: rect.top + scrollY,
1801
+ left: rect.left + scrollX,
1802
+ width: rect.width,
1803
+ height: rect.height
1804
+ });
1805
+ }
1806
+ void block.offsetWidth;
1807
+ if (block.dataset.isFullscreen !== "true") {
1808
+ const rect = block.getBoundingClientRect();
1809
+ const startRect = { top: rect.top + scrollY, left: rect.left + scrollX, width: rect.width, height: rect.height };
1810
+ Object.assign(block.style, {
1811
+ position: "fixed",
1812
+ top: `${startRect.top}px`,
1813
+ left: `${startRect.left}px`,
1814
+ width: `${startRect.width}px`,
1815
+ height: `${startRect.height}px`,
1816
+ margin: "0",
1817
+ zIndex: 9999,
1818
+ transition: "all 0.3s ease"
1819
+ });
1820
+ void block.offsetWidth;
1821
+ Object.assign(block.style, { top: "0", left: "0", width: "100%", height: "100%", borderRadius: "0" });
1822
+ block.dataset.isFullscreen = "true";
1823
+ } else {
1824
+ const origRect = JSON.parse(block.dataset.origRect);
1825
+ Object.assign(block.style, {
1826
+ transition: "all 0.3s ease",
1827
+ top: `${origRect.top}px`,
1828
+ left: `${origRect.left}px`,
1829
+ width: `${origRect.width}px`,
1830
+ height: "auto",
1831
+ borderRadius: "12px"
1832
+ });
1833
+ block.addEventListener("transitionend", () => {
1834
+ Object.assign(block.style, {
1835
+ transition: "",
1836
+ position: "",
1837
+ top: "",
1838
+ left: "",
1839
+ width: "",
1840
+ height: "",
1841
+ zIndex: ""
1842
+ });
1843
+ block.dataset.isFullscreen = "false";
1844
+ }, { once: true });
1845
+ }
1846
+ });
1847
+ }
1848
+ function makeDraggable(element) {
1849
+ const header = element.querySelector(".pre-top");
1850
+ if (!header) return;
1851
+ let offsetX = 0, offsetY = 0, isDragging = false;
1852
+ header.style.cursor = "move";
1853
+ header.addEventListener("mousedown", onMouseDown);
1854
+ header.querySelectorAll("span, button").forEach((btn) => {
1855
+ btn.addEventListener("mousedown", (e) => e.stopPropagation());
1856
+ });
1857
+ function onMouseDown(e) {
1858
+ isDragging = true;
1859
+ const rect = element.getBoundingClientRect();
1860
+ offsetX = e.clientX - rect.left;
1861
+ offsetY = e.clientY - rect.top;
1862
+ Object.assign(element.style, { width: `${rect.width}px`, position: "absolute", zIndex: 9999 });
1863
+ document.addEventListener("mousemove", onMouseMove);
1864
+ document.addEventListener("mouseup", onMouseUp);
1865
+ }
1866
+ function onMouseMove(e) {
1867
+ if (element.dataset.isFullscreen === "true" || !isDragging) return;
1868
+ const left = e.clientX - offsetX;
1869
+ const top = e.clientY - offsetY;
1870
+ Object.assign(element.style, { left: `${left}px`, top: `${top}px` });
1871
+ element.dataset.currentRect = JSON.stringify({ top, left, width: element.offsetWidth, height: element.offsetHeight });
1872
+ }
1873
+ function onMouseUp() {
1874
+ isDragging = false;
1875
+ document.removeEventListener("mousemove", onMouseMove);
1876
+ document.removeEventListener("mouseup", onMouseUp);
1877
+ }
1878
+ }
1879
+
1880
+ // src/components/dropdown.js
1881
+ function initDropdowns() {
1882
+ if (typeof window === "undefined") return;
1883
+ document.querySelectorAll(".dropdown").forEach((drop) => {
1884
+ const btn = drop.querySelector(".dropdown-btn");
1885
+ const content = drop.querySelector(".dropdown-content");
1886
+ if (!btn || !content) return;
1887
+ let hiddenInput = drop.querySelector('input[type="hidden"]');
1888
+ if (!hiddenInput) {
1889
+ hiddenInput = document.createElement("input");
1890
+ hiddenInput.type = "hidden";
1891
+ hiddenInput.name = drop.dataset.name || "dropdown";
1892
+ drop.appendChild(hiddenInput);
1893
+ }
1894
+ const setValue = (item) => {
1895
+ if (item.getAttribute("aria-disabled") === "true") return;
1896
+ btn.textContent = item.textContent;
1897
+ content.querySelectorAll(".dropdown-item").forEach((i) => i.classList.remove("active"));
1898
+ item.classList.add("active");
1899
+ hiddenInput.value = item.dataset.value ?? item.textContent;
1900
+ };
1901
+ const initialItem = content.querySelector(".dropdown-item.active") || content.querySelector('.dropdown-item:not([aria-disabled="true"])');
1902
+ if (initialItem) setValue(initialItem);
1903
+ btn.addEventListener("click", (e) => {
1904
+ if (drop.getAttribute("aria-disabled") === "true") return;
1905
+ e.stopPropagation();
1906
+ drop.classList.toggle("open");
1907
+ });
1908
+ document.addEventListener("click", (e) => {
1909
+ if (!drop.contains(e.target)) drop.classList.remove("open");
1910
+ });
1911
+ content.querySelectorAll(".dropdown-item").forEach((item) => {
1912
+ item.addEventListener("click", () => {
1913
+ setValue(item);
1914
+ drop.classList.remove("open");
1915
+ });
1916
+ });
1917
+ let items = Array.from(content.querySelectorAll('.dropdown-item:not([aria-disabled="true"])'));
1918
+ let index = items.findIndex((i) => i.classList.contains("active"));
1919
+ btn.addEventListener("keydown", (e) => {
1920
+ if (drop.getAttribute("aria-disabled") === "true") return;
1921
+ if (!["ArrowDown", "ArrowUp", "Enter", "Escape"].includes(e.key)) return;
1922
+ e.preventDefault();
1923
+ drop.classList.add("open");
1924
+ if (e.key === "ArrowDown") {
1925
+ index = (index + 1) % items.length;
1926
+ items.forEach((i) => i.classList.remove("active"));
1927
+ items[index].classList.add("active");
1928
+ items[index].scrollIntoView({ block: "nearest" });
1929
+ }
1930
+ if (e.key === "ArrowUp") {
1931
+ index = (index - 1 + items.length) % items.length;
1932
+ items.forEach((i) => i.classList.remove("active"));
1933
+ items[index].classList.add("active");
1934
+ items[index].scrollIntoView({ block: "nearest" });
1935
+ }
1936
+ if (e.key === "Enter") {
1937
+ setValue(items[index]);
1938
+ drop.classList.remove("open");
1939
+ }
1940
+ if (e.key === "Escape") {
1941
+ drop.classList.remove("open");
1942
+ }
1943
+ });
1944
+ btn.setAttribute("tabindex", "0");
1945
+ });
1946
+ }
1947
+
1948
+ // src/index.js
1949
+ if (typeof window !== "undefined") {
1950
+ document.addEventListener("DOMContentLoaded", () => {
1951
+ initCodeblocks();
1952
+ initDropdowns();
1953
+ });
1954
+ }
1955
+ export {
1956
+ initCodeblocks,
1957
+ initDropdowns
1958
+ };
1959
+ /*! Bundled license information:
1960
+
1961
+ prismjs/prism.js:
1962
+ (**
1963
+ * Prism: Lightweight, robust, elegant syntax highlighting
1964
+ *
1965
+ * @license MIT <https://opensource.org/licenses/MIT>
1966
+ * @author Lea Verou <https://lea.verou.me>
1967
+ * @namespace
1968
+ * @public
1969
+ *)
1970
+ */