aprsd 3.3.4__py2.py3-none-any.whl → 3.4.0__py2.py3-none-any.whl

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 (70) hide show
  1. aprsd/client.py +133 -20
  2. aprsd/clients/aprsis.py +6 -3
  3. aprsd/clients/fake.py +1 -1
  4. aprsd/clients/kiss.py +1 -1
  5. aprsd/cmds/completion.py +13 -27
  6. aprsd/cmds/fetch_stats.py +53 -57
  7. aprsd/cmds/healthcheck.py +32 -30
  8. aprsd/cmds/list_plugins.py +2 -2
  9. aprsd/cmds/listen.py +33 -17
  10. aprsd/cmds/send_message.py +2 -2
  11. aprsd/cmds/server.py +26 -9
  12. aprsd/cmds/webchat.py +34 -29
  13. aprsd/conf/common.py +46 -31
  14. aprsd/log/log.py +28 -6
  15. aprsd/main.py +4 -17
  16. aprsd/packets/__init__.py +3 -2
  17. aprsd/packets/collector.py +56 -0
  18. aprsd/packets/core.py +456 -321
  19. aprsd/packets/log.py +143 -0
  20. aprsd/packets/packet_list.py +83 -66
  21. aprsd/packets/seen_list.py +30 -19
  22. aprsd/packets/tracker.py +60 -62
  23. aprsd/packets/watch_list.py +64 -38
  24. aprsd/plugin.py +41 -16
  25. aprsd/plugins/email.py +35 -7
  26. aprsd/plugins/time.py +3 -2
  27. aprsd/plugins/version.py +4 -5
  28. aprsd/plugins/weather.py +0 -1
  29. aprsd/stats/__init__.py +20 -0
  30. aprsd/stats/app.py +46 -0
  31. aprsd/stats/collector.py +38 -0
  32. aprsd/threads/__init__.py +3 -2
  33. aprsd/threads/aprsd.py +67 -36
  34. aprsd/threads/keep_alive.py +55 -49
  35. aprsd/threads/log_monitor.py +46 -0
  36. aprsd/threads/rx.py +43 -24
  37. aprsd/threads/stats.py +44 -0
  38. aprsd/threads/tx.py +36 -17
  39. aprsd/utils/__init__.py +12 -0
  40. aprsd/utils/counter.py +6 -3
  41. aprsd/utils/json.py +20 -0
  42. aprsd/utils/objectstore.py +22 -17
  43. aprsd/web/admin/static/css/prism.css +4 -189
  44. aprsd/web/admin/static/js/charts.js +9 -7
  45. aprsd/web/admin/static/js/echarts.js +71 -9
  46. aprsd/web/admin/static/js/main.js +47 -6
  47. aprsd/web/admin/static/js/prism.js +11 -2246
  48. aprsd/web/admin/templates/index.html +18 -7
  49. aprsd/web/chat/static/js/gps.js +3 -1
  50. aprsd/web/chat/static/js/main.js +4 -3
  51. aprsd/web/chat/static/js/send-message.js +5 -2
  52. aprsd/web/chat/templates/index.html +1 -0
  53. aprsd/wsgi.py +62 -127
  54. {aprsd-3.3.4.dist-info → aprsd-3.4.0.dist-info}/METADATA +14 -16
  55. {aprsd-3.3.4.dist-info → aprsd-3.4.0.dist-info}/RECORD +60 -63
  56. {aprsd-3.3.4.dist-info → aprsd-3.4.0.dist-info}/WHEEL +1 -1
  57. aprsd-3.4.0.dist-info/pbr.json +1 -0
  58. aprsd/plugins/query.py +0 -81
  59. aprsd/rpc/__init__.py +0 -14
  60. aprsd/rpc/client.py +0 -165
  61. aprsd/rpc/server.py +0 -99
  62. aprsd/stats.py +0 -266
  63. aprsd/web/admin/static/json-viewer/jquery.json-viewer.css +0 -57
  64. aprsd/web/admin/static/json-viewer/jquery.json-viewer.js +0 -158
  65. aprsd/web/chat/static/json-viewer/jquery.json-viewer.css +0 -57
  66. aprsd/web/chat/static/json-viewer/jquery.json-viewer.js +0 -158
  67. aprsd-3.3.4.dist-info/pbr.json +0 -1
  68. {aprsd-3.3.4.dist-info → aprsd-3.4.0.dist-info}/LICENSE +0 -0
  69. {aprsd-3.3.4.dist-info → aprsd-3.4.0.dist-info}/entry_points.txt +0 -0
  70. {aprsd-3.3.4.dist-info → aprsd-3.4.0.dist-info}/top_level.txt +0 -0
@@ -1,2247 +1,12 @@
1
- /* PrismJS 1.24.1
1
+ /* PrismJS 1.29.0
2
2
  https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+clike+javascript+json+json5+log&plugins=show-language+toolbar */
3
- /// <reference lib="WebWorker"/>
4
-
5
- var _self = (typeof window !== 'undefined')
6
- ? window // if in browser
7
- : (
8
- (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
9
- ? self // if in worker
10
- : {} // if in node js
11
- );
12
-
13
- /**
14
- * Prism: Lightweight, robust, elegant syntax highlighting
15
- *
16
- * @license MIT <https://opensource.org/licenses/MIT>
17
- * @author Lea Verou <https://lea.verou.me>
18
- * @namespace
19
- * @public
20
- */
21
- var Prism = (function (_self) {
22
-
23
- // Private helper vars
24
- var lang = /\blang(?:uage)?-([\w-]+)\b/i;
25
- var uniqueId = 0;
26
-
27
- // The grammar object for plaintext
28
- var plainTextGrammar = {};
29
-
30
-
31
- var _ = {
32
- /**
33
- * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
34
- * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
35
- * additional languages or plugins yourself.
36
- *
37
- * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
38
- *
39
- * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
40
- * empty Prism object into the global scope before loading the Prism script like this:
41
- *
42
- * ```js
43
- * window.Prism = window.Prism || {};
44
- * Prism.manual = true;
45
- * // add a new <script> to load Prism's script
46
- * ```
47
- *
48
- * @default false
49
- * @type {boolean}
50
- * @memberof Prism
51
- * @public
52
- */
53
- manual: _self.Prism && _self.Prism.manual,
54
- disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
55
-
56
- /**
57
- * A namespace for utility methods.
58
- *
59
- * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
60
- * change or disappear at any time.
61
- *
62
- * @namespace
63
- * @memberof Prism
64
- */
65
- util: {
66
- encode: function encode(tokens) {
67
- if (tokens instanceof Token) {
68
- return new Token(tokens.type, encode(tokens.content), tokens.alias);
69
- } else if (Array.isArray(tokens)) {
70
- return tokens.map(encode);
71
- } else {
72
- return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
73
- }
74
- },
75
-
76
- /**
77
- * Returns the name of the type of the given value.
78
- *
79
- * @param {any} o
80
- * @returns {string}
81
- * @example
82
- * type(null) === 'Null'
83
- * type(undefined) === 'Undefined'
84
- * type(123) === 'Number'
85
- * type('foo') === 'String'
86
- * type(true) === 'Boolean'
87
- * type([1, 2]) === 'Array'
88
- * type({}) === 'Object'
89
- * type(String) === 'Function'
90
- * type(/abc+/) === 'RegExp'
91
- */
92
- type: function (o) {
93
- return Object.prototype.toString.call(o).slice(8, -1);
94
- },
95
-
96
- /**
97
- * Returns a unique number for the given object. Later calls will still return the same number.
98
- *
99
- * @param {Object} obj
100
- * @returns {number}
101
- */
102
- objId: function (obj) {
103
- if (!obj['__id']) {
104
- Object.defineProperty(obj, '__id', { value: ++uniqueId });
105
- }
106
- return obj['__id'];
107
- },
108
-
109
- /**
110
- * Creates a deep clone of the given object.
111
- *
112
- * The main intended use of this function is to clone language definitions.
113
- *
114
- * @param {T} o
115
- * @param {Record<number, any>} [visited]
116
- * @returns {T}
117
- * @template T
118
- */
119
- clone: function deepClone(o, visited) {
120
- visited = visited || {};
121
-
122
- var clone; var id;
123
- switch (_.util.type(o)) {
124
- case 'Object':
125
- id = _.util.objId(o);
126
- if (visited[id]) {
127
- return visited[id];
128
- }
129
- clone = /** @type {Record<string, any>} */ ({});
130
- visited[id] = clone;
131
-
132
- for (var key in o) {
133
- if (o.hasOwnProperty(key)) {
134
- clone[key] = deepClone(o[key], visited);
135
- }
136
- }
137
-
138
- return /** @type {any} */ (clone);
139
-
140
- case 'Array':
141
- id = _.util.objId(o);
142
- if (visited[id]) {
143
- return visited[id];
144
- }
145
- clone = [];
146
- visited[id] = clone;
147
-
148
- (/** @type {Array} */(/** @type {any} */(o))).forEach(function (v, i) {
149
- clone[i] = deepClone(v, visited);
150
- });
151
-
152
- return /** @type {any} */ (clone);
153
-
154
- default:
155
- return o;
156
- }
157
- },
158
-
159
- /**
160
- * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
161
- *
162
- * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
163
- *
164
- * @param {Element} element
165
- * @returns {string}
166
- */
167
- getLanguage: function (element) {
168
- while (element && !lang.test(element.className)) {
169
- element = element.parentElement;
170
- }
171
- if (element) {
172
- return (element.className.match(lang) || [, 'none'])[1].toLowerCase();
173
- }
174
- return 'none';
175
- },
176
-
177
- /**
178
- * Returns the script element that is currently executing.
179
- *
180
- * This does __not__ work for line script element.
181
- *
182
- * @returns {HTMLScriptElement | null}
183
- */
184
- currentScript: function () {
185
- if (typeof document === 'undefined') {
186
- return null;
187
- }
188
- if ('currentScript' in document && 1 < 2 /* hack to trip TS' flow analysis */) {
189
- return /** @type {any} */ (document.currentScript);
190
- }
191
-
192
- // IE11 workaround
193
- // we'll get the src of the current script by parsing IE11's error stack trace
194
- // this will not work for inline scripts
195
-
196
- try {
197
- throw new Error();
198
- } catch (err) {
199
- // Get file src url from stack. Specifically works with the format of stack traces in IE.
200
- // A stack will look like this:
201
- //
202
- // Error
203
- // at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
204
- // at Global code (http://localhost/components/prism-core.js:606:1)
205
-
206
- var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
207
- if (src) {
208
- var scripts = document.getElementsByTagName('script');
209
- for (var i in scripts) {
210
- if (scripts[i].src == src) {
211
- return scripts[i];
212
- }
213
- }
214
- }
215
- return null;
216
- }
217
- },
218
-
219
- /**
220
- * Returns whether a given class is active for `element`.
221
- *
222
- * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
223
- * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
224
- * given class is just the given class with a `no-` prefix.
225
- *
226
- * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
227
- * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
228
- * ancestors have the given class or the negated version of it, then the default activation will be returned.
229
- *
230
- * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
231
- * version of it, the class is considered active.
232
- *
233
- * @param {Element} element
234
- * @param {string} className
235
- * @param {boolean} [defaultActivation=false]
236
- * @returns {boolean}
237
- */
238
- isActive: function (element, className, defaultActivation) {
239
- var no = 'no-' + className;
240
-
241
- while (element) {
242
- var classList = element.classList;
243
- if (classList.contains(className)) {
244
- return true;
245
- }
246
- if (classList.contains(no)) {
247
- return false;
248
- }
249
- element = element.parentElement;
250
- }
251
- return !!defaultActivation;
252
- }
253
- },
254
-
255
- /**
256
- * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
257
- *
258
- * @namespace
259
- * @memberof Prism
260
- * @public
261
- */
262
- languages: {
263
- /**
264
- * The grammar for plain, unformatted text.
265
- */
266
- plain: plainTextGrammar,
267
- plaintext: plainTextGrammar,
268
- text: plainTextGrammar,
269
- txt: plainTextGrammar,
270
-
271
- /**
272
- * Creates a deep copy of the language with the given id and appends the given tokens.
273
- *
274
- * If a token in `redef` also appears in the copied language, then the existing token in the copied language
275
- * will be overwritten at its original position.
276
- *
277
- * ## Best practices
278
- *
279
- * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
280
- * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
281
- * understand the language definition because, normally, the order of tokens matters in Prism grammars.
282
- *
283
- * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
284
- * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
285
- *
286
- * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
287
- * @param {Grammar} redef The new tokens to append.
288
- * @returns {Grammar} The new language created.
289
- * @public
290
- * @example
291
- * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
292
- * // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
293
- * // at its original position
294
- * 'comment': { ... },
295
- * // CSS doesn't have a 'color' token, so this token will be appended
296
- * 'color': /\b(?:red|green|blue)\b/
297
- * });
298
- */
299
- extend: function (id, redef) {
300
- var lang = _.util.clone(_.languages[id]);
301
-
302
- for (var key in redef) {
303
- lang[key] = redef[key];
304
- }
305
-
306
- return lang;
307
- },
308
-
309
- /**
310
- * Inserts tokens _before_ another token in a language definition or any other grammar.
311
- *
312
- * ## Usage
313
- *
314
- * This helper method makes it easy to modify existing languages. For example, the CSS language definition
315
- * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
316
- * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
317
- * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
318
- * this:
319
- *
320
- * ```js
321
- * Prism.languages.markup.style = {
322
- * // token
323
- * };
324
- * ```
325
- *
326
- * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
327
- * before existing tokens. For the CSS example above, you would use it like this:
328
- *
329
- * ```js
330
- * Prism.languages.insertBefore('markup', 'cdata', {
331
- * 'style': {
332
- * // token
333
- * }
334
- * });
335
- * ```
336
- *
337
- * ## Special cases
338
- *
339
- * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
340
- * will be ignored.
341
- *
342
- * This behavior can be used to insert tokens after `before`:
343
- *
344
- * ```js
345
- * Prism.languages.insertBefore('markup', 'comment', {
346
- * 'comment': Prism.languages.markup.comment,
347
- * // tokens after 'comment'
348
- * });
349
- * ```
350
- *
351
- * ## Limitations
352
- *
353
- * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
354
- * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
355
- * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
356
- * deleting properties which is necessary to insert at arbitrary positions.
357
- *
358
- * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
359
- * Instead, it will create a new object and replace all references to the target object with the new one. This
360
- * can be done without temporarily deleting properties, so the iteration order is well-defined.
361
- *
362
- * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
363
- * you hold the target object in a variable, then the value of the variable will not change.
364
- *
365
- * ```js
366
- * var oldMarkup = Prism.languages.markup;
367
- * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
368
- *
369
- * assert(oldMarkup !== Prism.languages.markup);
370
- * assert(newMarkup === Prism.languages.markup);
371
- * ```
372
- *
373
- * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
374
- * object to be modified.
375
- * @param {string} before The key to insert before.
376
- * @param {Grammar} insert An object containing the key-value pairs to be inserted.
377
- * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
378
- * object to be modified.
379
- *
380
- * Defaults to `Prism.languages`.
381
- * @returns {Grammar} The new grammar object.
382
- * @public
383
- */
384
- insertBefore: function (inside, before, insert, root) {
385
- root = root || /** @type {any} */ (_.languages);
386
- var grammar = root[inside];
387
- /** @type {Grammar} */
388
- var ret = {};
389
-
390
- for (var token in grammar) {
391
- if (grammar.hasOwnProperty(token)) {
392
-
393
- if (token == before) {
394
- for (var newToken in insert) {
395
- if (insert.hasOwnProperty(newToken)) {
396
- ret[newToken] = insert[newToken];
397
- }
398
- }
399
- }
400
-
401
- // Do not insert token which also occur in insert. See #1525
402
- if (!insert.hasOwnProperty(token)) {
403
- ret[token] = grammar[token];
404
- }
405
- }
406
- }
407
-
408
- var old = root[inside];
409
- root[inside] = ret;
410
-
411
- // Update references in other language definitions
412
- _.languages.DFS(_.languages, function (key, value) {
413
- if (value === old && key != inside) {
414
- this[key] = ret;
415
- }
416
- });
417
-
418
- return ret;
419
- },
420
-
421
- // Traverse a language definition with Depth First Search
422
- DFS: function DFS(o, callback, type, visited) {
423
- visited = visited || {};
424
-
425
- var objId = _.util.objId;
426
-
427
- for (var i in o) {
428
- if (o.hasOwnProperty(i)) {
429
- callback.call(o, i, o[i], type || i);
430
-
431
- var property = o[i];
432
- var propertyType = _.util.type(property);
433
-
434
- if (propertyType === 'Object' && !visited[objId(property)]) {
435
- visited[objId(property)] = true;
436
- DFS(property, callback, null, visited);
437
- } else if (propertyType === 'Array' && !visited[objId(property)]) {
438
- visited[objId(property)] = true;
439
- DFS(property, callback, i, visited);
440
- }
441
- }
442
- }
443
- }
444
- },
445
-
446
- plugins: {},
447
-
448
- /**
449
- * This is the most high-level function in Prism’s API.
450
- * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
451
- * each one of them.
452
- *
453
- * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
454
- *
455
- * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
456
- * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
457
- * @memberof Prism
458
- * @public
459
- */
460
- highlightAll: function (async, callback) {
461
- _.highlightAllUnder(document, async, callback);
462
- },
463
-
464
- /**
465
- * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
466
- * {@link Prism.highlightElement} on each one of them.
467
- *
468
- * The following hooks will be run:
469
- * 1. `before-highlightall`
470
- * 2. `before-all-elements-highlight`
471
- * 3. All hooks of {@link Prism.highlightElement} for each element.
472
- *
473
- * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
474
- * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
475
- * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
476
- * @memberof Prism
477
- * @public
478
- */
479
- highlightAllUnder: function (container, async, callback) {
480
- var env = {
481
- callback: callback,
482
- container: container,
483
- selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
484
- };
485
-
486
- _.hooks.run('before-highlightall', env);
487
-
488
- env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
489
-
490
- _.hooks.run('before-all-elements-highlight', env);
491
-
492
- for (var i = 0, element; (element = env.elements[i++]);) {
493
- _.highlightElement(element, async === true, env.callback);
494
- }
495
- },
496
-
497
- /**
498
- * Highlights the code inside a single element.
499
- *
500
- * The following hooks will be run:
501
- * 1. `before-sanity-check`
502
- * 2. `before-highlight`
503
- * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
504
- * 4. `before-insert`
505
- * 5. `after-highlight`
506
- * 6. `complete`
507
- *
508
- * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
509
- * the element's language.
510
- *
511
- * @param {Element} element The element containing the code.
512
- * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
513
- * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
514
- * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
515
- * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
516
- *
517
- * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
518
- * asynchronous highlighting to work. You can build your own bundle on the
519
- * [Download page](https://prismjs.com/download.html).
520
- * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
521
- * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
522
- * @memberof Prism
523
- * @public
524
- */
525
- highlightElement: function (element, async, callback) {
526
- // Find language
527
- var language = _.util.getLanguage(element);
528
- var grammar = _.languages[language];
529
-
530
- // Set language on the element, if not present
531
- element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
532
-
533
- // Set language on the parent, for styling
534
- var parent = element.parentElement;
535
- if (parent && parent.nodeName.toLowerCase() === 'pre') {
536
- parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
537
- }
538
-
539
- var code = element.textContent;
540
-
541
- var env = {
542
- element: element,
543
- language: language,
544
- grammar: grammar,
545
- code: code
546
- };
547
-
548
- function insertHighlightedCode(highlightedCode) {
549
- env.highlightedCode = highlightedCode;
550
-
551
- _.hooks.run('before-insert', env);
552
-
553
- env.element.innerHTML = env.highlightedCode;
554
-
555
- _.hooks.run('after-highlight', env);
556
- _.hooks.run('complete', env);
557
- callback && callback.call(env.element);
558
- }
559
-
560
- _.hooks.run('before-sanity-check', env);
561
-
562
- // plugins may change/add the parent/element
563
- parent = env.element.parentElement;
564
- if (parent && parent.nodeName.toLowerCase() === 'pre' && !parent.hasAttribute('tabindex')) {
565
- parent.setAttribute('tabindex', '0');
566
- }
567
-
568
- if (!env.code) {
569
- _.hooks.run('complete', env);
570
- callback && callback.call(env.element);
571
- return;
572
- }
573
-
574
- _.hooks.run('before-highlight', env);
575
-
576
- if (!env.grammar) {
577
- insertHighlightedCode(_.util.encode(env.code));
578
- return;
579
- }
580
-
581
- if (async && _self.Worker) {
582
- var worker = new Worker(_.filename);
583
-
584
- worker.onmessage = function (evt) {
585
- insertHighlightedCode(evt.data);
586
- };
587
-
588
- worker.postMessage(JSON.stringify({
589
- language: env.language,
590
- code: env.code,
591
- immediateClose: true
592
- }));
593
- } else {
594
- insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
595
- }
596
- },
597
-
598
- /**
599
- * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
600
- * and the language definitions to use, and returns a string with the HTML produced.
601
- *
602
- * The following hooks will be run:
603
- * 1. `before-tokenize`
604
- * 2. `after-tokenize`
605
- * 3. `wrap`: On each {@link Token}.
606
- *
607
- * @param {string} text A string with the code to be highlighted.
608
- * @param {Grammar} grammar An object containing the tokens to use.
609
- *
610
- * Usually a language definition like `Prism.languages.markup`.
611
- * @param {string} language The name of the language definition passed to `grammar`.
612
- * @returns {string} The highlighted HTML.
613
- * @memberof Prism
614
- * @public
615
- * @example
616
- * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
617
- */
618
- highlight: function (text, grammar, language) {
619
- var env = {
620
- code: text,
621
- grammar: grammar,
622
- language: language
623
- };
624
- _.hooks.run('before-tokenize', env);
625
- env.tokens = _.tokenize(env.code, env.grammar);
626
- _.hooks.run('after-tokenize', env);
627
- return Token.stringify(_.util.encode(env.tokens), env.language);
628
- },
629
-
630
- /**
631
- * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
632
- * and the language definitions to use, and returns an array with the tokenized code.
633
- *
634
- * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
635
- *
636
- * This method could be useful in other contexts as well, as a very crude parser.
637
- *
638
- * @param {string} text A string with the code to be highlighted.
639
- * @param {Grammar} grammar An object containing the tokens to use.
640
- *
641
- * Usually a language definition like `Prism.languages.markup`.
642
- * @returns {TokenStream} An array of strings and tokens, a token stream.
643
- * @memberof Prism
644
- * @public
645
- * @example
646
- * let code = `var foo = 0;`;
647
- * let tokens = Prism.tokenize(code, Prism.languages.javascript);
648
- * tokens.forEach(token => {
649
- * if (token instanceof Prism.Token && token.type === 'number') {
650
- * console.log(`Found numeric literal: ${token.content}`);
651
- * }
652
- * });
653
- */
654
- tokenize: function (text, grammar) {
655
- var rest = grammar.rest;
656
- if (rest) {
657
- for (var token in rest) {
658
- grammar[token] = rest[token];
659
- }
660
-
661
- delete grammar.rest;
662
- }
663
-
664
- var tokenList = new LinkedList();
665
- addAfter(tokenList, tokenList.head, text);
666
-
667
- matchGrammar(text, tokenList, grammar, tokenList.head, 0);
668
-
669
- return toArray(tokenList);
670
- },
671
-
672
- /**
673
- * @namespace
674
- * @memberof Prism
675
- * @public
676
- */
677
- hooks: {
678
- all: {},
679
-
680
- /**
681
- * Adds the given callback to the list of callbacks for the given hook.
682
- *
683
- * The callback will be invoked when the hook it is registered for is run.
684
- * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
685
- *
686
- * One callback function can be registered to multiple hooks and the same hook multiple times.
687
- *
688
- * @param {string} name The name of the hook.
689
- * @param {HookCallback} callback The callback function which is given environment variables.
690
- * @public
691
- */
692
- add: function (name, callback) {
693
- var hooks = _.hooks.all;
694
-
695
- hooks[name] = hooks[name] || [];
696
-
697
- hooks[name].push(callback);
698
- },
699
-
700
- /**
701
- * Runs a hook invoking all registered callbacks with the given environment variables.
702
- *
703
- * Callbacks will be invoked synchronously and in the order in which they were registered.
704
- *
705
- * @param {string} name The name of the hook.
706
- * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
707
- * @public
708
- */
709
- run: function (name, env) {
710
- var callbacks = _.hooks.all[name];
711
-
712
- if (!callbacks || !callbacks.length) {
713
- return;
714
- }
715
-
716
- for (var i = 0, callback; (callback = callbacks[i++]);) {
717
- callback(env);
718
- }
719
- }
720
- },
721
-
722
- Token: Token
723
- };
724
- _self.Prism = _;
725
-
726
-
727
- // Typescript note:
728
- // The following can be used to import the Token type in JSDoc:
729
- //
730
- // @typedef {InstanceType<import("./prism-core")["Token"]>} Token
731
-
732
- /**
733
- * Creates a new token.
734
- *
735
- * @param {string} type See {@link Token#type type}
736
- * @param {string | TokenStream} content See {@link Token#content content}
737
- * @param {string|string[]} [alias] The alias(es) of the token.
738
- * @param {string} [matchedStr=""] A copy of the full string this token was created from.
739
- * @class
740
- * @global
741
- * @public
742
- */
743
- function Token(type, content, alias, matchedStr) {
744
- /**
745
- * The type of the token.
746
- *
747
- * This is usually the key of a pattern in a {@link Grammar}.
748
- *
749
- * @type {string}
750
- * @see GrammarToken
751
- * @public
752
- */
753
- this.type = type;
754
- /**
755
- * The strings or tokens contained by this token.
756
- *
757
- * This will be a token stream if the pattern matched also defined an `inside` grammar.
758
- *
759
- * @type {string | TokenStream}
760
- * @public
761
- */
762
- this.content = content;
763
- /**
764
- * The alias(es) of the token.
765
- *
766
- * @type {string|string[]}
767
- * @see GrammarToken
768
- * @public
769
- */
770
- this.alias = alias;
771
- // Copy of the full string this token was created from
772
- this.length = (matchedStr || '').length | 0;
773
- }
774
-
775
- /**
776
- * A token stream is an array of strings and {@link Token Token} objects.
777
- *
778
- * Token streams have to fulfill a few properties that are assumed by most functions (mostly internal ones) that process
779
- * them.
780
- *
781
- * 1. No adjacent strings.
782
- * 2. No empty strings.
783
- *
784
- * The only exception here is the token stream that only contains the empty string and nothing else.
785
- *
786
- * @typedef {Array<string | Token>} TokenStream
787
- * @global
788
- * @public
789
- */
790
-
791
- /**
792
- * Converts the given token or token stream to an HTML representation.
793
- *
794
- * The following hooks will be run:
795
- * 1. `wrap`: On each {@link Token}.
796
- *
797
- * @param {string | Token | TokenStream} o The token or token stream to be converted.
798
- * @param {string} language The name of current language.
799
- * @returns {string} The HTML representation of the token or token stream.
800
- * @memberof Token
801
- * @static
802
- */
803
- Token.stringify = function stringify(o, language) {
804
- if (typeof o == 'string') {
805
- return o;
806
- }
807
- if (Array.isArray(o)) {
808
- var s = '';
809
- o.forEach(function (e) {
810
- s += stringify(e, language);
811
- });
812
- return s;
813
- }
814
-
815
- var env = {
816
- type: o.type,
817
- content: stringify(o.content, language),
818
- tag: 'span',
819
- classes: ['token', o.type],
820
- attributes: {},
821
- language: language
822
- };
823
-
824
- var aliases = o.alias;
825
- if (aliases) {
826
- if (Array.isArray(aliases)) {
827
- Array.prototype.push.apply(env.classes, aliases);
828
- } else {
829
- env.classes.push(aliases);
830
- }
831
- }
832
-
833
- _.hooks.run('wrap', env);
834
-
835
- var attributes = '';
836
- for (var name in env.attributes) {
837
- attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
838
- }
839
-
840
- return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + '</' + env.tag + '>';
841
- };
842
-
843
- /**
844
- * @param {RegExp} pattern
845
- * @param {number} pos
846
- * @param {string} text
847
- * @param {boolean} lookbehind
848
- * @returns {RegExpExecArray | null}
849
- */
850
- function matchPattern(pattern, pos, text, lookbehind) {
851
- pattern.lastIndex = pos;
852
- var match = pattern.exec(text);
853
- if (match && lookbehind && match[1]) {
854
- // change the match to remove the text matched by the Prism lookbehind group
855
- var lookbehindLength = match[1].length;
856
- match.index += lookbehindLength;
857
- match[0] = match[0].slice(lookbehindLength);
858
- }
859
- return match;
860
- }
861
-
862
- /**
863
- * @param {string} text
864
- * @param {LinkedList<string | Token>} tokenList
865
- * @param {any} grammar
866
- * @param {LinkedListNode<string | Token>} startNode
867
- * @param {number} startPos
868
- * @param {RematchOptions} [rematch]
869
- * @returns {void}
870
- * @private
871
- *
872
- * @typedef RematchOptions
873
- * @property {string} cause
874
- * @property {number} reach
875
- */
876
- function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
877
- for (var token in grammar) {
878
- if (!grammar.hasOwnProperty(token) || !grammar[token]) {
879
- continue;
880
- }
881
-
882
- var patterns = grammar[token];
883
- patterns = Array.isArray(patterns) ? patterns : [patterns];
884
-
885
- for (var j = 0; j < patterns.length; ++j) {
886
- if (rematch && rematch.cause == token + ',' + j) {
887
- return;
888
- }
889
-
890
- var patternObj = patterns[j];
891
- var inside = patternObj.inside;
892
- var lookbehind = !!patternObj.lookbehind;
893
- var greedy = !!patternObj.greedy;
894
- var alias = patternObj.alias;
895
-
896
- if (greedy && !patternObj.pattern.global) {
897
- // Without the global flag, lastIndex won't work
898
- var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
899
- patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g');
900
- }
901
-
902
- /** @type {RegExp} */
903
- var pattern = patternObj.pattern || patternObj;
904
-
905
- for ( // iterate the token list and keep track of the current token/string position
906
- var currentNode = startNode.next, pos = startPos;
907
- currentNode !== tokenList.tail;
908
- pos += currentNode.value.length, currentNode = currentNode.next
909
- ) {
910
-
911
- if (rematch && pos >= rematch.reach) {
912
- break;
913
- }
914
-
915
- var str = currentNode.value;
916
-
917
- if (tokenList.length > text.length) {
918
- // Something went terribly wrong, ABORT, ABORT!
919
- return;
920
- }
921
-
922
- if (str instanceof Token) {
923
- continue;
924
- }
925
-
926
- var removeCount = 1; // this is the to parameter of removeBetween
927
- var match;
928
-
929
- if (greedy) {
930
- match = matchPattern(pattern, pos, text, lookbehind);
931
- if (!match) {
932
- break;
933
- }
934
-
935
- var from = match.index;
936
- var to = match.index + match[0].length;
937
- var p = pos;
938
-
939
- // find the node that contains the match
940
- p += currentNode.value.length;
941
- while (from >= p) {
942
- currentNode = currentNode.next;
943
- p += currentNode.value.length;
944
- }
945
- // adjust pos (and p)
946
- p -= currentNode.value.length;
947
- pos = p;
948
-
949
- // the current node is a Token, then the match starts inside another Token, which is invalid
950
- if (currentNode.value instanceof Token) {
951
- continue;
952
- }
953
-
954
- // find the last node which is affected by this match
955
- for (
956
- var k = currentNode;
957
- k !== tokenList.tail && (p < to || typeof k.value === 'string');
958
- k = k.next
959
- ) {
960
- removeCount++;
961
- p += k.value.length;
962
- }
963
- removeCount--;
964
-
965
- // replace with the new match
966
- str = text.slice(pos, p);
967
- match.index -= pos;
968
- } else {
969
- match = matchPattern(pattern, 0, str, lookbehind);
970
- if (!match) {
971
- continue;
972
- }
973
- }
974
-
975
- // eslint-disable-next-line no-redeclare
976
- var from = match.index;
977
- var matchStr = match[0];
978
- var before = str.slice(0, from);
979
- var after = str.slice(from + matchStr.length);
980
-
981
- var reach = pos + str.length;
982
- if (rematch && reach > rematch.reach) {
983
- rematch.reach = reach;
984
- }
985
-
986
- var removeFrom = currentNode.prev;
987
-
988
- if (before) {
989
- removeFrom = addAfter(tokenList, removeFrom, before);
990
- pos += before.length;
991
- }
992
-
993
- removeRange(tokenList, removeFrom, removeCount);
994
-
995
- var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
996
- currentNode = addAfter(tokenList, removeFrom, wrapped);
997
-
998
- if (after) {
999
- addAfter(tokenList, currentNode, after);
1000
- }
1001
-
1002
- if (removeCount > 1) {
1003
- // at least one Token object was removed, so we have to do some rematching
1004
- // this can only happen if the current pattern is greedy
1005
-
1006
- /** @type {RematchOptions} */
1007
- var nestedRematch = {
1008
- cause: token + ',' + j,
1009
- reach: reach
1010
- };
1011
- matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
1012
-
1013
- // the reach might have been extended because of the rematching
1014
- if (rematch && nestedRematch.reach > rematch.reach) {
1015
- rematch.reach = nestedRematch.reach;
1016
- }
1017
- }
1018
- }
1019
- }
1020
- }
1021
- }
1022
-
1023
- /**
1024
- * @typedef LinkedListNode
1025
- * @property {T} value
1026
- * @property {LinkedListNode<T> | null} prev The previous node.
1027
- * @property {LinkedListNode<T> | null} next The next node.
1028
- * @template T
1029
- * @private
1030
- */
1031
-
1032
- /**
1033
- * @template T
1034
- * @private
1035
- */
1036
- function LinkedList() {
1037
- /** @type {LinkedListNode<T>} */
1038
- var head = { value: null, prev: null, next: null };
1039
- /** @type {LinkedListNode<T>} */
1040
- var tail = { value: null, prev: head, next: null };
1041
- head.next = tail;
1042
-
1043
- /** @type {LinkedListNode<T>} */
1044
- this.head = head;
1045
- /** @type {LinkedListNode<T>} */
1046
- this.tail = tail;
1047
- this.length = 0;
1048
- }
1049
-
1050
- /**
1051
- * Adds a new node with the given value to the list.
1052
- *
1053
- * @param {LinkedList<T>} list
1054
- * @param {LinkedListNode<T>} node
1055
- * @param {T} value
1056
- * @returns {LinkedListNode<T>} The added node.
1057
- * @template T
1058
- */
1059
- function addAfter(list, node, value) {
1060
- // assumes that node != list.tail && values.length >= 0
1061
- var next = node.next;
1062
-
1063
- var newNode = { value: value, prev: node, next: next };
1064
- node.next = newNode;
1065
- next.prev = newNode;
1066
- list.length++;
1067
-
1068
- return newNode;
1069
- }
1070
- /**
1071
- * Removes `count` nodes after the given node. The given node will not be removed.
1072
- *
1073
- * @param {LinkedList<T>} list
1074
- * @param {LinkedListNode<T>} node
1075
- * @param {number} count
1076
- * @template T
1077
- */
1078
- function removeRange(list, node, count) {
1079
- var next = node.next;
1080
- for (var i = 0; i < count && next !== list.tail; i++) {
1081
- next = next.next;
1082
- }
1083
- node.next = next;
1084
- next.prev = node;
1085
- list.length -= i;
1086
- }
1087
- /**
1088
- * @param {LinkedList<T>} list
1089
- * @returns {T[]}
1090
- * @template T
1091
- */
1092
- function toArray(list) {
1093
- var array = [];
1094
- var node = list.head.next;
1095
- while (node !== list.tail) {
1096
- array.push(node.value);
1097
- node = node.next;
1098
- }
1099
- return array;
1100
- }
1101
-
1102
-
1103
- if (!_self.document) {
1104
- if (!_self.addEventListener) {
1105
- // in Node.js
1106
- return _;
1107
- }
1108
-
1109
- if (!_.disableWorkerMessageHandler) {
1110
- // In worker
1111
- _self.addEventListener('message', function (evt) {
1112
- var message = JSON.parse(evt.data);
1113
- var lang = message.language;
1114
- var code = message.code;
1115
- var immediateClose = message.immediateClose;
1116
-
1117
- _self.postMessage(_.highlight(code, _.languages[lang], lang));
1118
- if (immediateClose) {
1119
- _self.close();
1120
- }
1121
- }, false);
1122
- }
1123
-
1124
- return _;
1125
- }
1126
-
1127
- // Get current script and highlight
1128
- var script = _.util.currentScript();
1129
-
1130
- if (script) {
1131
- _.filename = script.src;
1132
-
1133
- if (script.hasAttribute('data-manual')) {
1134
- _.manual = true;
1135
- }
1136
- }
1137
-
1138
- function highlightAutomaticallyCallback() {
1139
- if (!_.manual) {
1140
- _.highlightAll();
1141
- }
1142
- }
1143
-
1144
- if (!_.manual) {
1145
- // If the document state is "loading", then we'll use DOMContentLoaded.
1146
- // If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
1147
- // DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
1148
- // might take longer one animation frame to execute which can create a race condition where only some plugins have
1149
- // been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.
1150
- // See https://github.com/PrismJS/prism/issues/2102
1151
- var readyState = document.readyState;
1152
- if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {
1153
- document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);
1154
- } else {
1155
- if (window.requestAnimationFrame) {
1156
- window.requestAnimationFrame(highlightAutomaticallyCallback);
1157
- } else {
1158
- window.setTimeout(highlightAutomaticallyCallback, 16);
1159
- }
1160
- }
1161
- }
1162
-
1163
- return _;
1164
-
1165
- }(_self));
1166
-
1167
- if (typeof module !== 'undefined' && module.exports) {
1168
- module.exports = Prism;
1169
- }
1170
-
1171
- // hack for components to work correctly in node.js
1172
- if (typeof global !== 'undefined') {
1173
- global.Prism = Prism;
1174
- }
1175
-
1176
- // some additional documentation/types
1177
-
1178
- /**
1179
- * The expansion of a simple `RegExp` literal to support additional properties.
1180
- *
1181
- * @typedef GrammarToken
1182
- * @property {RegExp} pattern The regular expression of the token.
1183
- * @property {boolean} [lookbehind=false] If `true`, then the first capturing group of `pattern` will (effectively)
1184
- * behave as a lookbehind group meaning that the captured text will not be part of the matched text of the new token.
1185
- * @property {boolean} [greedy=false] Whether the token is greedy.
1186
- * @property {string|string[]} [alias] An optional alias or list of aliases.
1187
- * @property {Grammar} [inside] The nested grammar of this token.
1188
- *
1189
- * The `inside` grammar will be used to tokenize the text value of each token of this kind.
1190
- *
1191
- * This can be used to make nested and even recursive language definitions.
1192
- *
1193
- * Note: This can cause infinite recursion. Be careful when you embed different languages or even the same language into
1194
- * each another.
1195
- * @global
1196
- * @public
1197
- */
1198
-
1199
- /**
1200
- * @typedef Grammar
1201
- * @type {Object<string, RegExp | GrammarToken | Array<RegExp | GrammarToken>>}
1202
- * @property {Grammar} [rest] An optional grammar object that will be appended to this grammar.
1203
- * @global
1204
- * @public
1205
- */
1206
-
1207
- /**
1208
- * A function which will invoked after an element was successfully highlighted.
1209
- *
1210
- * @callback HighlightCallback
1211
- * @param {Element} element The element successfully highlighted.
1212
- * @returns {void}
1213
- * @global
1214
- * @public
1215
- */
1216
-
1217
- /**
1218
- * @callback HookCallback
1219
- * @param {Object<string, any>} env The environment variables of the hook.
1220
- * @returns {void}
1221
- * @global
1222
- * @public
1223
- */
1224
- ;
1225
- Prism.languages.markup = {
1226
- 'comment': /<!--[\s\S]*?-->/,
1227
- 'prolog': /<\?[\s\S]+?\?>/,
1228
- 'doctype': {
1229
- // https://www.w3.org/TR/xml/#NT-doctypedecl
1230
- pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
1231
- greedy: true,
1232
- inside: {
1233
- 'internal-subset': {
1234
- pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
1235
- lookbehind: true,
1236
- greedy: true,
1237
- inside: null // see below
1238
- },
1239
- 'string': {
1240
- pattern: /"[^"]*"|'[^']*'/,
1241
- greedy: true
1242
- },
1243
- 'punctuation': /^<!|>$|[[\]]/,
1244
- 'doctype-tag': /^DOCTYPE/,
1245
- 'name': /[^\s<>'"]+/
1246
- }
1247
- },
1248
- 'cdata': /<!\[CDATA\[[\s\S]*?\]\]>/i,
1249
- 'tag': {
1250
- pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
1251
- greedy: true,
1252
- inside: {
1253
- 'tag': {
1254
- pattern: /^<\/?[^\s>\/]+/,
1255
- inside: {
1256
- 'punctuation': /^<\/?/,
1257
- 'namespace': /^[^\s>\/:]+:/
1258
- }
1259
- },
1260
- 'special-attr': [],
1261
- 'attr-value': {
1262
- pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
1263
- inside: {
1264
- 'punctuation': [
1265
- {
1266
- pattern: /^=/,
1267
- alias: 'attr-equals'
1268
- },
1269
- /"|'/
1270
- ]
1271
- }
1272
- },
1273
- 'punctuation': /\/?>/,
1274
- 'attr-name': {
1275
- pattern: /[^\s>\/]+/,
1276
- inside: {
1277
- 'namespace': /^[^\s>\/:]+:/
1278
- }
1279
- }
1280
-
1281
- }
1282
- },
1283
- 'entity': [
1284
- {
1285
- pattern: /&[\da-z]{1,8};/i,
1286
- alias: 'named-entity'
1287
- },
1288
- /&#x?[\da-f]{1,8};/i
1289
- ]
1290
- };
1291
-
1292
- Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
1293
- Prism.languages.markup['entity'];
1294
- Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;
1295
-
1296
- // Plugin to make entity title show the real entity, idea by Roman Komarov
1297
- Prism.hooks.add('wrap', function (env) {
1298
-
1299
- if (env.type === 'entity') {
1300
- env.attributes['title'] = env.content.replace(/&amp;/, '&');
1301
- }
1302
- });
1303
-
1304
- Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
1305
- /**
1306
- * Adds an inlined language to markup.
1307
- *
1308
- * An example of an inlined language is CSS with `<style>` tags.
1309
- *
1310
- * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
1311
- * case insensitive.
1312
- * @param {string} lang The language key.
1313
- * @example
1314
- * addInlined('style', 'css');
1315
- */
1316
- value: function addInlined(tagName, lang) {
1317
- var includedCdataInside = {};
1318
- includedCdataInside['language-' + lang] = {
1319
- pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1320
- lookbehind: true,
1321
- inside: Prism.languages[lang]
1322
- };
1323
- includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
1324
-
1325
- var inside = {
1326
- 'included-cdata': {
1327
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1328
- inside: includedCdataInside
1329
- }
1330
- };
1331
- inside['language-' + lang] = {
1332
- pattern: /[\s\S]+/,
1333
- inside: Prism.languages[lang]
1334
- };
1335
-
1336
- var def = {};
1337
- def[tagName] = {
1338
- pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),
1339
- lookbehind: true,
1340
- greedy: true,
1341
- inside: inside
1342
- };
1343
-
1344
- Prism.languages.insertBefore('markup', 'cdata', def);
1345
- }
1346
- });
1347
- Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
1348
- /**
1349
- * Adds an pattern to highlight languages embedded in HTML attributes.
1350
- *
1351
- * An example of an inlined language is CSS with `style` attributes.
1352
- *
1353
- * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
1354
- * case insensitive.
1355
- * @param {string} lang The language key.
1356
- * @example
1357
- * addAttribute('style', 'css');
1358
- */
1359
- value: function (attrName, lang) {
1360
- Prism.languages.markup.tag.inside['special-attr'].push({
1361
- pattern: RegExp(
1362
- /(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
1363
- 'i'
1364
- ),
1365
- lookbehind: true,
1366
- inside: {
1367
- 'attr-name': /^[^\s=]+/,
1368
- 'attr-value': {
1369
- pattern: /=[\s\S]+/,
1370
- inside: {
1371
- 'value': {
1372
- pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1373
- lookbehind: true,
1374
- alias: [lang, 'language-' + lang],
1375
- inside: Prism.languages[lang]
1376
- },
1377
- 'punctuation': [
1378
- {
1379
- pattern: /^=/,
1380
- alias: 'attr-equals'
1381
- },
1382
- /"|'/
1383
- ]
1384
- }
1385
- }
1386
- }
1387
- });
1388
- }
1389
- });
1390
-
1391
- Prism.languages.html = Prism.languages.markup;
1392
- Prism.languages.mathml = Prism.languages.markup;
1393
- Prism.languages.svg = Prism.languages.markup;
1394
-
1395
- Prism.languages.xml = Prism.languages.extend('markup', {});
1396
- Prism.languages.ssml = Prism.languages.xml;
1397
- Prism.languages.atom = Prism.languages.xml;
1398
- Prism.languages.rss = Prism.languages.xml;
1399
-
1400
- (function (Prism) {
1401
-
1402
- var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1403
-
1404
- Prism.languages.css = {
1405
- 'comment': /\/\*[\s\S]*?\*\//,
1406
- 'atrule': {
1407
- pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,
1408
- inside: {
1409
- 'rule': /^@[\w-]+/,
1410
- 'selector-function-argument': {
1411
- pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
1412
- lookbehind: true,
1413
- alias: 'selector'
1414
- },
1415
- 'keyword': {
1416
- pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
1417
- lookbehind: true
1418
- }
1419
- // See rest below
1420
- }
1421
- },
1422
- 'url': {
1423
- // https://drafts.csswg.org/css-values-3/#urls
1424
- pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
1425
- greedy: true,
1426
- inside: {
1427
- 'function': /^url/i,
1428
- 'punctuation': /^\(|\)$/,
1429
- 'string': {
1430
- pattern: RegExp('^' + string.source + '$'),
1431
- alias: 'url'
1432
- }
1433
- }
1434
- },
1435
- 'selector': {
1436
- pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
1437
- lookbehind: true
1438
- },
1439
- 'string': {
1440
- pattern: string,
1441
- greedy: true
1442
- },
1443
- 'property': {
1444
- pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
1445
- lookbehind: true
1446
- },
1447
- 'important': /!important\b/i,
1448
- 'function': {
1449
- pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
1450
- lookbehind: true
1451
- },
1452
- 'punctuation': /[(){};:,]/
1453
- };
1454
-
1455
- Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
1456
-
1457
- var markup = Prism.languages.markup;
1458
- if (markup) {
1459
- markup.tag.addInlined('style', 'css');
1460
- markup.tag.addAttribute('style', 'css');
1461
- }
1462
-
1463
- }(Prism));
1464
-
1465
- Prism.languages.clike = {
1466
- 'comment': [
1467
- {
1468
- pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
1469
- lookbehind: true,
1470
- greedy: true
1471
- },
1472
- {
1473
- pattern: /(^|[^\\:])\/\/.*/,
1474
- lookbehind: true,
1475
- greedy: true
1476
- }
1477
- ],
1478
- 'string': {
1479
- pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
1480
- greedy: true
1481
- },
1482
- 'class-name': {
1483
- pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,
1484
- lookbehind: true,
1485
- inside: {
1486
- 'punctuation': /[.\\]/
1487
- }
1488
- },
1489
- 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
1490
- 'boolean': /\b(?:true|false)\b/,
1491
- 'function': /\b\w+(?=\()/,
1492
- 'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
1493
- 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
1494
- 'punctuation': /[{}[\];(),.:]/
1495
- };
1496
-
1497
- Prism.languages.javascript = Prism.languages.extend('clike', {
1498
- 'class-name': [
1499
- Prism.languages.clike['class-name'],
1500
- {
1501
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,
1502
- lookbehind: true
1503
- }
1504
- ],
1505
- 'keyword': [
1506
- {
1507
- pattern: /((?:^|\})\s*)catch\b/,
1508
- lookbehind: true
1509
- },
1510
- {
1511
- 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/,
1512
- lookbehind: true
1513
- },
1514
- ],
1515
- // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
1516
- 'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1517
- 'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,
1518
- 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1519
- });
1520
-
1521
- Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;
1522
-
1523
- Prism.languages.insertBefore('javascript', 'keyword', {
1524
- 'regex': {
1525
- // eslint-disable-next-line regexp/no-dupe-characters-character-class
1526
- pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,
1527
- lookbehind: true,
1528
- greedy: true,
1529
- inside: {
1530
- 'regex-source': {
1531
- pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1532
- lookbehind: true,
1533
- alias: 'language-regex',
1534
- inside: Prism.languages.regex
1535
- },
1536
- 'regex-delimiter': /^\/|\/$/,
1537
- 'regex-flags': /^[a-z]+$/,
1538
- }
1539
- },
1540
- // This must be declared before keyword because we use "function" inside the look-forward
1541
- 'function-variable': {
1542
- 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*=>))/,
1543
- alias: 'function'
1544
- },
1545
- 'parameter': [
1546
- {
1547
- pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1548
- lookbehind: true,
1549
- inside: Prism.languages.javascript
1550
- },
1551
- {
1552
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1553
- lookbehind: true,
1554
- inside: Prism.languages.javascript
1555
- },
1556
- {
1557
- pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1558
- lookbehind: true,
1559
- inside: Prism.languages.javascript
1560
- },
1561
- {
1562
- 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*\{)/,
1563
- lookbehind: true,
1564
- inside: Prism.languages.javascript
1565
- }
1566
- ],
1567
- 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1568
- });
1569
-
1570
- Prism.languages.insertBefore('javascript', 'string', {
1571
- 'hashbang': {
1572
- pattern: /^#!.*/,
1573
- greedy: true,
1574
- alias: 'comment'
1575
- },
1576
- 'template-string': {
1577
- pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
1578
- greedy: true,
1579
- inside: {
1580
- 'template-punctuation': {
1581
- pattern: /^`|`$/,
1582
- alias: 'string'
1583
- },
1584
- 'interpolation': {
1585
- pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
1586
- lookbehind: true,
1587
- inside: {
1588
- 'interpolation-punctuation': {
1589
- pattern: /^\$\{|\}$/,
1590
- alias: 'punctuation'
1591
- },
1592
- rest: Prism.languages.javascript
1593
- }
1594
- },
1595
- 'string': /[\s\S]+/
1596
- }
1597
- }
1598
- });
1599
-
1600
- if (Prism.languages.markup) {
1601
- Prism.languages.markup.tag.addInlined('script', 'javascript');
1602
-
1603
- // add attribute support for all DOM events.
1604
- // https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events
1605
- Prism.languages.markup.tag.addAttribute(
1606
- /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,
1607
- 'javascript'
1608
- );
1609
- }
1610
-
1611
- Prism.languages.js = Prism.languages.javascript;
1612
-
1613
- // https://www.json.org/json-en.html
1614
- Prism.languages.json = {
1615
- 'property': {
1616
- pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
1617
- lookbehind: true,
1618
- greedy: true
1619
- },
1620
- 'string': {
1621
- pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
1622
- lookbehind: true,
1623
- greedy: true
1624
- },
1625
- 'comment': {
1626
- pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
1627
- greedy: true
1628
- },
1629
- 'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
1630
- 'punctuation': /[{}[\],]/,
1631
- 'operator': /:/,
1632
- 'boolean': /\b(?:true|false)\b/,
1633
- 'null': {
1634
- pattern: /\bnull\b/,
1635
- alias: 'keyword'
1636
- }
1637
- };
1638
-
1639
- Prism.languages.webmanifest = Prism.languages.json;
1640
-
1641
- (function (Prism) {
1642
-
1643
- var string = /("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/;
1644
-
1645
- Prism.languages.json5 = Prism.languages.extend('json', {
1646
- 'property': [
1647
- {
1648
- pattern: RegExp(string.source + '(?=\\s*:)'),
1649
- greedy: true
1650
- },
1651
- {
1652
- pattern: /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/,
1653
- alias: 'unquoted'
1654
- }
1655
- ],
1656
- 'string': {
1657
- pattern: string,
1658
- greedy: true
1659
- },
1660
- 'number': /[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+\b)?/
1661
- });
1662
-
1663
- }(Prism));
1664
-
1665
- // This is a language definition for generic log files.
1666
- // Since there is no one log format, this language definition has to support all formats to some degree.
1667
- //
1668
- // Based on https://github.com/MTDL9/vim-log-highlighting
1669
-
1670
- Prism.languages.log = {
1671
- 'string': {
1672
- // Single-quoted strings must not be confused with plain text. E.g. Can't isn't Susan's Chris' toy
1673
- pattern: /"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,
1674
- greedy: true,
1675
- },
1676
-
1677
- 'exception': {
1678
- pattern: /(^|[^\w.])[a-z][\w.]*(?:Exception|Error):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/,
1679
- lookbehind: true,
1680
- greedy: true,
1681
- alias: ['javastacktrace', 'language-javastacktrace'],
1682
- inside: Prism.languages['javastacktrace'] || {
1683
- 'keyword': /\bat\b/,
1684
- 'function': /[a-z_][\w$]*(?=\()/,
1685
- 'punctuation': /[.:()]/
1686
- }
1687
- },
1688
-
1689
- 'level': [
1690
- {
1691
- pattern: /\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,
1692
- alias: ['error', 'important']
1693
- },
1694
- {
1695
- pattern: /\b(?:WARN|WARNING|WRN)\b/,
1696
- alias: ['warning', 'important']
1697
- },
1698
- {
1699
- pattern: /\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,
1700
- alias: ['info', 'keyword']
1701
- },
1702
- {
1703
- pattern: /\b(?:DBG|DEBUG|FINE)\b/,
1704
- alias: ['debug', 'keyword']
1705
- },
1706
- {
1707
- pattern: /\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,
1708
- alias: ['trace', 'comment']
1709
- }
1710
- ],
1711
-
1712
- 'property': {
1713
- pattern: /((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,
1714
- lookbehind: true
1715
- },
1716
-
1717
- 'separator': {
1718
- pattern: /(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,
1719
- lookbehind: true,
1720
- alias: 'comment'
1721
- },
1722
-
1723
- 'url': /\b(?:https?|ftp|file):\/\/[^\s|,;'"]*[^\s|,;'">.]/,
1724
- 'email': {
1725
- pattern: /(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,
1726
- lookbehind: true,
1727
- alias: 'url'
1728
- },
1729
-
1730
- 'ip-address': {
1731
- pattern: /\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/i,
1732
- alias: 'constant'
1733
- },
1734
- 'mac-address': {
1735
- pattern: /\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,
1736
- alias: 'constant'
1737
- },
1738
- 'domain': {
1739
- pattern: /(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,
1740
- lookbehind: true,
1741
- alias: 'constant'
1742
- },
1743
-
1744
- 'uuid': {
1745
- pattern: /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,
1746
- alias: 'constant'
1747
- },
1748
- 'hash': {
1749
- pattern: /\b(?:[a-f0-9]{32}){1,2}\b/i,
1750
- alias: 'constant'
1751
- },
1752
-
1753
- 'file-path': {
1754
- pattern: /\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,
1755
- lookbehind: true,
1756
- greedy: true,
1757
- alias: 'string'
1758
- },
1759
-
1760
- 'date': {
1761
- pattern: RegExp(
1762
- /\b\d{4}[-/]\d{2}[-/]\d{2}(?:T(?=\d{1,2}:)|(?=\s\d{1,2}:))/.source +
1763
- '|' +
1764
- /\b\d{1,4}[-/ ](?:\d{1,2}|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[-/ ]\d{2,4}T?\b/.source +
1765
- '|' +
1766
- /\b(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:\s{1,2}(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))?|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s{1,2}\d{1,2}\b/.source,
1767
- 'i'
1768
- ),
1769
- alias: 'number'
1770
- },
1771
- 'time': {
1772
- pattern: /\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,
1773
- alias: 'number'
1774
- },
1775
-
1776
- 'boolean': /\b(?:true|false|null)\b/i,
1777
- 'number': {
1778
- pattern: /(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,
1779
- lookbehind: true
1780
- },
1781
-
1782
- 'operator': /[;:?<=>~/@!$%&+\-|^(){}*#]/,
1783
- 'punctuation': /[\[\].,]/
1784
- };
1785
-
1786
- (function () {
1787
-
1788
- if (typeof Prism === 'undefined' || typeof document === 'undefined') {
1789
- return;
1790
- }
1791
-
1792
- var callbacks = [];
1793
- var map = {};
1794
- var noop = function () {};
1795
-
1796
- Prism.plugins.toolbar = {};
1797
-
1798
- /**
1799
- * @typedef ButtonOptions
1800
- * @property {string} text The text displayed.
1801
- * @property {string} [url] The URL of the link which will be created.
1802
- * @property {Function} [onClick] The event listener for the `click` event of the created button.
1803
- * @property {string} [className] The class attribute to include with element.
1804
- */
1805
-
1806
- /**
1807
- * Register a button callback with the toolbar.
1808
- *
1809
- * @param {string} key
1810
- * @param {ButtonOptions|Function} opts
1811
- */
1812
- var registerButton = Prism.plugins.toolbar.registerButton = function (key, opts) {
1813
- var callback;
1814
-
1815
- if (typeof opts === 'function') {
1816
- callback = opts;
1817
- } else {
1818
- callback = function (env) {
1819
- var element;
1820
-
1821
- if (typeof opts.onClick === 'function') {
1822
- element = document.createElement('button');
1823
- element.type = 'button';
1824
- element.addEventListener('click', function () {
1825
- opts.onClick.call(this, env);
1826
- });
1827
- } else if (typeof opts.url === 'string') {
1828
- element = document.createElement('a');
1829
- element.href = opts.url;
1830
- } else {
1831
- element = document.createElement('span');
1832
- }
1833
-
1834
- if (opts.className) {
1835
- element.classList.add(opts.className);
1836
- }
1837
-
1838
- element.textContent = opts.text;
1839
-
1840
- return element;
1841
- };
1842
- }
1843
-
1844
- if (key in map) {
1845
- console.warn('There is a button with the key "' + key + '" registered already.');
1846
- return;
1847
- }
1848
-
1849
- callbacks.push(map[key] = callback);
1850
- };
1851
-
1852
- /**
1853
- * Returns the callback order of the given element.
1854
- *
1855
- * @param {HTMLElement} element
1856
- * @returns {string[] | undefined}
1857
- */
1858
- function getOrder(element) {
1859
- while (element) {
1860
- var order = element.getAttribute('data-toolbar-order');
1861
- if (order != null) {
1862
- order = order.trim();
1863
- if (order.length) {
1864
- return order.split(/\s*,\s*/g);
1865
- } else {
1866
- return [];
1867
- }
1868
- }
1869
- element = element.parentElement;
1870
- }
1871
- }
1872
-
1873
- /**
1874
- * Post-highlight Prism hook callback.
1875
- *
1876
- * @param env
1877
- */
1878
- var hook = Prism.plugins.toolbar.hook = function (env) {
1879
- // Check if inline or actual code block (credit to line-numbers plugin)
1880
- var pre = env.element.parentNode;
1881
- if (!pre || !/pre/i.test(pre.nodeName)) {
1882
- return;
1883
- }
1884
-
1885
- // Autoloader rehighlights, so only do this once.
1886
- if (pre.parentNode.classList.contains('code-toolbar')) {
1887
- return;
1888
- }
1889
-
1890
- // Create wrapper for <pre> to prevent scrolling toolbar with content
1891
- var wrapper = document.createElement('div');
1892
- wrapper.classList.add('code-toolbar');
1893
- pre.parentNode.insertBefore(wrapper, pre);
1894
- wrapper.appendChild(pre);
1895
-
1896
- // Setup the toolbar
1897
- var toolbar = document.createElement('div');
1898
- toolbar.classList.add('toolbar');
1899
-
1900
- // order callbacks
1901
- var elementCallbacks = callbacks;
1902
- var order = getOrder(env.element);
1903
- if (order) {
1904
- elementCallbacks = order.map(function (key) {
1905
- return map[key] || noop;
1906
- });
1907
- }
1908
-
1909
- elementCallbacks.forEach(function (callback) {
1910
- var element = callback(env);
1911
-
1912
- if (!element) {
1913
- return;
1914
- }
1915
-
1916
- var item = document.createElement('div');
1917
- item.classList.add('toolbar-item');
1918
-
1919
- item.appendChild(element);
1920
- toolbar.appendChild(item);
1921
- });
1922
-
1923
- // Add our toolbar to the currently created wrapper of <pre> tag
1924
- wrapper.appendChild(toolbar);
1925
- };
1926
-
1927
- registerButton('label', function (env) {
1928
- var pre = env.element.parentNode;
1929
- if (!pre || !/pre/i.test(pre.nodeName)) {
1930
- return;
1931
- }
1932
-
1933
- if (!pre.hasAttribute('data-label')) {
1934
- return;
1935
- }
1936
-
1937
- var element; var template;
1938
- var text = pre.getAttribute('data-label');
1939
- try {
1940
- // Any normal text will blow up this selector.
1941
- template = document.querySelector('template#' + text);
1942
- } catch (e) { /* noop */ }
1943
-
1944
- if (template) {
1945
- element = template.content;
1946
- } else {
1947
- if (pre.hasAttribute('data-url')) {
1948
- element = document.createElement('a');
1949
- element.href = pre.getAttribute('data-url');
1950
- } else {
1951
- element = document.createElement('span');
1952
- }
1953
-
1954
- element.textContent = text;
1955
- }
1956
-
1957
- return element;
1958
- });
1959
-
1960
- /**
1961
- * Register the toolbar with Prism.
1962
- */
1963
- Prism.hooks.add('complete', hook);
1964
- }());
1965
-
1966
- (function () {
1967
-
1968
- if (typeof Prism === 'undefined' || typeof document === 'undefined') {
1969
- return;
1970
- }
1971
-
1972
- if (!Prism.plugins.toolbar) {
1973
- console.warn('Show Languages plugin loaded before Toolbar plugin.');
1974
-
1975
- return;
1976
- }
1977
-
1978
- /* eslint-disable */
1979
-
1980
- // The languages map is built automatically with gulp
1981
- var Languages = /*languages_placeholder[*/{
1982
- "none": "Plain text",
1983
- "plain": "Plain text",
1984
- "plaintext": "Plain text",
1985
- "text": "Plain text",
1986
- "txt": "Plain text",
1987
- "html": "HTML",
1988
- "xml": "XML",
1989
- "svg": "SVG",
1990
- "mathml": "MathML",
1991
- "ssml": "SSML",
1992
- "rss": "RSS",
1993
- "css": "CSS",
1994
- "clike": "C-like",
1995
- "js": "JavaScript",
1996
- "abap": "ABAP",
1997
- "abnf": "ABNF",
1998
- "al": "AL",
1999
- "antlr4": "ANTLR4",
2000
- "g4": "ANTLR4",
2001
- "apacheconf": "Apache Configuration",
2002
- "apl": "APL",
2003
- "aql": "AQL",
2004
- "arff": "ARFF",
2005
- "asciidoc": "AsciiDoc",
2006
- "adoc": "AsciiDoc",
2007
- "aspnet": "ASP.NET (C#)",
2008
- "asm6502": "6502 Assembly",
2009
- "autohotkey": "AutoHotkey",
2010
- "autoit": "AutoIt",
2011
- "avro-idl": "Avro IDL",
2012
- "avdl": "Avro IDL",
2013
- "basic": "BASIC",
2014
- "bbcode": "BBcode",
2015
- "bnf": "BNF",
2016
- "rbnf": "RBNF",
2017
- "bsl": "BSL (1C:Enterprise)",
2018
- "oscript": "OneScript",
2019
- "csharp": "C#",
2020
- "cs": "C#",
2021
- "dotnet": "C#",
2022
- "cpp": "C++",
2023
- "cfscript": "CFScript",
2024
- "cfc": "CFScript",
2025
- "cil": "CIL",
2026
- "cmake": "CMake",
2027
- "cobol": "COBOL",
2028
- "coffee": "CoffeeScript",
2029
- "conc": "Concurnas",
2030
- "csp": "Content-Security-Policy",
2031
- "css-extras": "CSS Extras",
2032
- "csv": "CSV",
2033
- "dataweave": "DataWeave",
2034
- "dax": "DAX",
2035
- "django": "Django/Jinja2",
2036
- "jinja2": "Django/Jinja2",
2037
- "dns-zone-file": "DNS zone file",
2038
- "dns-zone": "DNS zone file",
2039
- "dockerfile": "Docker",
2040
- "dot": "DOT (Graphviz)",
2041
- "gv": "DOT (Graphviz)",
2042
- "ebnf": "EBNF",
2043
- "editorconfig": "EditorConfig",
2044
- "ejs": "EJS",
2045
- "etlua": "Embedded Lua templating",
2046
- "erb": "ERB",
2047
- "excel-formula": "Excel Formula",
2048
- "xlsx": "Excel Formula",
2049
- "xls": "Excel Formula",
2050
- "fsharp": "F#",
2051
- "firestore-security-rules": "Firestore security rules",
2052
- "ftl": "FreeMarker Template Language",
2053
- "gml": "GameMaker Language",
2054
- "gamemakerlanguage": "GameMaker Language",
2055
- "gcode": "G-code",
2056
- "gdscript": "GDScript",
2057
- "gedcom": "GEDCOM",
2058
- "glsl": "GLSL",
2059
- "gn": "GN",
2060
- "gni": "GN",
2061
- "graphql": "GraphQL",
2062
- "hbs": "Handlebars",
2063
- "hs": "Haskell",
2064
- "hcl": "HCL",
2065
- "hlsl": "HLSL",
2066
- "http": "HTTP",
2067
- "hpkp": "HTTP Public-Key-Pins",
2068
- "hsts": "HTTP Strict-Transport-Security",
2069
- "ichigojam": "IchigoJam",
2070
- "icu-message-format": "ICU Message Format",
2071
- "idr": "Idris",
2072
- "ignore": ".ignore",
2073
- "gitignore": ".gitignore",
2074
- "hgignore": ".hgignore",
2075
- "npmignore": ".npmignore",
2076
- "inform7": "Inform 7",
2077
- "javadoc": "JavaDoc",
2078
- "javadoclike": "JavaDoc-like",
2079
- "javastacktrace": "Java stack trace",
2080
- "jq": "JQ",
2081
- "jsdoc": "JSDoc",
2082
- "js-extras": "JS Extras",
2083
- "json": "JSON",
2084
- "webmanifest": "Web App Manifest",
2085
- "json5": "JSON5",
2086
- "jsonp": "JSONP",
2087
- "jsstacktrace": "JS stack trace",
2088
- "js-templates": "JS Templates",
2089
- "kts": "Kotlin Script",
2090
- "kt": "Kotlin",
2091
- "kumir": "KuMir (КуМир)",
2092
- "kum": "KuMir (КуМир)",
2093
- "latex": "LaTeX",
2094
- "tex": "TeX",
2095
- "context": "ConTeXt",
2096
- "lilypond": "LilyPond",
2097
- "ly": "LilyPond",
2098
- "emacs": "Lisp",
2099
- "elisp": "Lisp",
2100
- "emacs-lisp": "Lisp",
2101
- "llvm": "LLVM IR",
2102
- "log": "Log file",
2103
- "lolcode": "LOLCODE",
2104
- "md": "Markdown",
2105
- "markup-templating": "Markup templating",
2106
- "matlab": "MATLAB",
2107
- "mel": "MEL",
2108
- "mongodb": "MongoDB",
2109
- "moon": "MoonScript",
2110
- "n1ql": "N1QL",
2111
- "n4js": "N4JS",
2112
- "n4jsd": "N4JS",
2113
- "nand2tetris-hdl": "Nand To Tetris HDL",
2114
- "naniscript": "Naninovel Script",
2115
- "nani": "Naninovel Script",
2116
- "nasm": "NASM",
2117
- "neon": "NEON",
2118
- "nginx": "nginx",
2119
- "nsis": "NSIS",
2120
- "objectivec": "Objective-C",
2121
- "objc": "Objective-C",
2122
- "ocaml": "OCaml",
2123
- "opencl": "OpenCL",
2124
- "openqasm": "OpenQasm",
2125
- "qasm": "OpenQasm",
2126
- "parigp": "PARI/GP",
2127
- "objectpascal": "Object Pascal",
2128
- "psl": "PATROL Scripting Language",
2129
- "pcaxis": "PC-Axis",
2130
- "px": "PC-Axis",
2131
- "peoplecode": "PeopleCode",
2132
- "pcode": "PeopleCode",
2133
- "php": "PHP",
2134
- "phpdoc": "PHPDoc",
2135
- "php-extras": "PHP Extras",
2136
- "plsql": "PL/SQL",
2137
- "powerquery": "PowerQuery",
2138
- "pq": "PowerQuery",
2139
- "mscript": "PowerQuery",
2140
- "powershell": "PowerShell",
2141
- "promql": "PromQL",
2142
- "properties": ".properties",
2143
- "protobuf": "Protocol Buffers",
2144
- "purebasic": "PureBasic",
2145
- "pbfasm": "PureBasic",
2146
- "purs": "PureScript",
2147
- "py": "Python",
2148
- "qsharp": "Q#",
2149
- "qs": "Q#",
2150
- "q": "Q (kdb+ database)",
2151
- "qml": "QML",
2152
- "rkt": "Racket",
2153
- "jsx": "React JSX",
2154
- "tsx": "React TSX",
2155
- "renpy": "Ren'py",
2156
- "rpy": "Ren'py",
2157
- "rest": "reST (reStructuredText)",
2158
- "robotframework": "Robot Framework",
2159
- "robot": "Robot Framework",
2160
- "rb": "Ruby",
2161
- "sas": "SAS",
2162
- "sass": "Sass (Sass)",
2163
- "scss": "Sass (Scss)",
2164
- "shell-session": "Shell session",
2165
- "sh-session": "Shell session",
2166
- "shellsession": "Shell session",
2167
- "sml": "SML",
2168
- "smlnj": "SML/NJ",
2169
- "solidity": "Solidity (Ethereum)",
2170
- "sol": "Solidity (Ethereum)",
2171
- "solution-file": "Solution file",
2172
- "sln": "Solution file",
2173
- "soy": "Soy (Closure Template)",
2174
- "sparql": "SPARQL",
2175
- "rq": "SPARQL",
2176
- "splunk-spl": "Splunk SPL",
2177
- "sqf": "SQF: Status Quo Function (Arma 3)",
2178
- "sql": "SQL",
2179
- "iecst": "Structured Text (IEC 61131-3)",
2180
- "systemd": "Systemd configuration file",
2181
- "t4-templating": "T4 templating",
2182
- "t4-cs": "T4 Text Templates (C#)",
2183
- "t4": "T4 Text Templates (C#)",
2184
- "t4-vb": "T4 Text Templates (VB)",
2185
- "tap": "TAP",
2186
- "tt2": "Template Toolkit 2",
2187
- "toml": "TOML",
2188
- "trig": "TriG",
2189
- "ts": "TypeScript",
2190
- "tsconfig": "TSConfig",
2191
- "uscript": "UnrealScript",
2192
- "uc": "UnrealScript",
2193
- "uri": "URI",
2194
- "url": "URL",
2195
- "vbnet": "VB.Net",
2196
- "vhdl": "VHDL",
2197
- "vim": "vim",
2198
- "visual-basic": "Visual Basic",
2199
- "vba": "VBA",
2200
- "vb": "Visual Basic",
2201
- "wasm": "WebAssembly",
2202
- "wiki": "Wiki markup",
2203
- "wolfram": "Wolfram language",
2204
- "nb": "Mathematica Notebook",
2205
- "wl": "Wolfram language",
2206
- "xeoracube": "XeoraCube",
2207
- "xml-doc": "XML doc (.net)",
2208
- "xojo": "Xojo (REALbasic)",
2209
- "xquery": "XQuery",
2210
- "yaml": "YAML",
2211
- "yml": "YAML",
2212
- "yang": "YANG"
2213
- }/*]*/;
2214
-
2215
- /* eslint-enable */
2216
-
2217
- Prism.plugins.toolbar.registerButton('show-language', function (env) {
2218
- var pre = env.element.parentNode;
2219
- if (!pre || !/pre/i.test(pre.nodeName)) {
2220
- return;
2221
- }
2222
-
2223
- /**
2224
- * Tries to guess the name of a language given its id.
2225
- *
2226
- * @param {string} id The language id.
2227
- * @returns {string}
2228
- */
2229
- function guessTitle(id) {
2230
- if (!id) {
2231
- return id;
2232
- }
2233
- return (id.substring(0, 1).toUpperCase() + id.substring(1)).replace(/s(?=cript)/, 'S');
2234
- }
2235
-
2236
- var language = pre.getAttribute('data-language') || Languages[env.language] || guessTitle(env.language);
2237
-
2238
- if (!language) {
2239
- return;
2240
- }
2241
- var element = document.createElement('span');
2242
- element.textContent = language;
2243
-
2244
- return element;
2245
- });
2246
-
2247
- }());
3
+ var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(e){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,r={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof i?new i(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function e(n,t){var r,i;switch(t=t||{},a.util.type(n)){case"Object":if(i=a.util.objId(n),t[i])return t[i];for(var l in r={},t[i]=r,n)n.hasOwnProperty(l)&&(r[l]=e(n[l],t));return r;case"Array":return i=a.util.objId(n),t[i]?t[i]:(r=[],t[i]=r,n.forEach((function(n,a){r[a]=e(n,t)})),r);default:return n}},getLanguage:function(e){for(;e;){var t=n.exec(e.className);if(t)return t[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,t){e.className=e.className.replace(RegExp(n,"gi"),""),e.classList.add("language-"+t)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var n=document.getElementsByTagName("script");for(var t in n)if(n[t].src==e)return n[t]}return null}},isActive:function(e,n,t){for(var r="no-"+n;e;){var a=e.classList;if(a.contains(n))return!0;if(a.contains(r))return!1;e=e.parentElement}return!!t}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,n){var t=a.util.clone(a.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){var i=(r=r||a.languages)[e],l={};for(var o in i)if(i.hasOwnProperty(o)){if(o==n)for(var s in t)t.hasOwnProperty(s)&&(l[s]=t[s]);t.hasOwnProperty(o)||(l[o]=i[o])}var u=r[e];return r[e]=l,a.languages.DFS(a.languages,(function(n,t){t===u&&n!=e&&(this[n]=l)})),l},DFS:function e(n,t,r,i){i=i||{};var l=a.util.objId;for(var o in n)if(n.hasOwnProperty(o)){t.call(n,o,n[o],r||o);var s=n[o],u=a.util.type(s);"Object"!==u||i[l(s)]?"Array"!==u||i[l(s)]||(i[l(s)]=!0,e(s,t,o,i)):(i[l(s)]=!0,e(s,t,null,i))}}},plugins:{},highlightAll:function(e,n){a.highlightAllUnder(document,e,n)},highlightAllUnder:function(e,n,t){var r={callback:t,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),a.hooks.run("before-all-elements-highlight",r);for(var i,l=0;i=r.elements[l++];)a.highlightElement(i,!0===n,r.callback)},highlightElement:function(n,t,r){var i=a.util.getLanguage(n),l=a.languages[i];a.util.setLanguage(n,i);var o=n.parentElement;o&&"pre"===o.nodeName.toLowerCase()&&a.util.setLanguage(o,i);var s={element:n,language:i,grammar:l,code:n.textContent};function u(e){s.highlightedCode=e,a.hooks.run("before-insert",s),s.element.innerHTML=s.highlightedCode,a.hooks.run("after-highlight",s),a.hooks.run("complete",s),r&&r.call(s.element)}if(a.hooks.run("before-sanity-check",s),(o=s.element.parentElement)&&"pre"===o.nodeName.toLowerCase()&&!o.hasAttribute("tabindex")&&o.setAttribute("tabindex","0"),!s.code)return a.hooks.run("complete",s),void(r&&r.call(s.element));if(a.hooks.run("before-highlight",s),s.grammar)if(t&&e.Worker){var c=new Worker(a.filename);c.onmessage=function(e){u(e.data)},c.postMessage(JSON.stringify({language:s.language,code:s.code,immediateClose:!0}))}else u(a.highlight(s.code,s.grammar,s.language));else u(a.util.encode(s.code))},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(a.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=a.tokenize(r.code,r.grammar),a.hooks.run("after-tokenize",r),i.stringify(a.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var a=new s;return u(a,a.head,e),o(e,a,n,a.head,0),function(e){for(var n=[],t=e.head.next;t!==e.tail;)n.push(t.value),t=t.next;return n}(a)},hooks:{all:{},add:function(e,n){var t=a.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=a.hooks.all[e];if(t&&t.length)for(var r,i=0;r=t[i++];)r(n)}},Token:i};function i(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=0|(r||"").length}function l(e,n,t,r){e.lastIndex=n;var a=e.exec(t);if(a&&r&&a[1]){var i=a[1].length;a.index+=i,a[0]=a[0].slice(i)}return a}function o(e,n,t,r,s,g){for(var f in t)if(t.hasOwnProperty(f)&&t[f]){var h=t[f];h=Array.isArray(h)?h:[h];for(var d=0;d<h.length;++d){if(g&&g.cause==f+","+d)return;var v=h[d],p=v.inside,m=!!v.lookbehind,y=!!v.greedy,k=v.alias;if(y&&!v.pattern.global){var x=v.pattern.toString().match(/[imsuy]*$/)[0];v.pattern=RegExp(v.pattern.source,x+"g")}for(var b=v.pattern||v,w=r.next,A=s;w!==n.tail&&!(g&&A>=g.reach);A+=w.value.length,w=w.next){var E=w.value;if(n.length>e.length)return;if(!(E instanceof i)){var P,L=1;if(y){if(!(P=l(b,A,e,m))||P.index>=e.length)break;var S=P.index,O=P.index+P[0].length,j=A;for(j+=w.value.length;S>=j;)j+=(w=w.next).value.length;if(A=j-=w.value.length,w.value instanceof i)continue;for(var C=w;C!==n.tail&&(j<O||"string"==typeof C.value);C=C.next)L++,j+=C.value.length;L--,E=e.slice(A,j),P.index-=A}else if(!(P=l(b,0,E,m)))continue;S=P.index;var N=P[0],_=E.slice(0,S),M=E.slice(S+N.length),W=A+E.length;g&&W>g.reach&&(g.reach=W);var z=w.prev;if(_&&(z=u(n,z,_),A+=_.length),c(n,z,L),w=u(n,z,new i(f,p?a.tokenize(N,p):N,k,N)),M&&u(n,w,M),L>1){var I={cause:f+","+d,reach:W};o(e,n,t,w.prev,A,I),g&&I.reach>g.reach&&(g.reach=I.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function u(e,n,t){var r=n.next,a={value:t,prev:n,next:r};return n.next=a,r.prev=a,e.length++,a}function c(e,n,t){for(var r=n.next,a=0;a<t&&r!==e.tail;a++)r=r.next;n.next=r,r.prev=n,e.length-=a}if(e.Prism=a,i.stringify=function e(n,t){if("string"==typeof n)return n;if(Array.isArray(n)){var r="";return n.forEach((function(n){r+=e(n,t)})),r}var i={type:n.type,content:e(n.content,t),tag:"span",classes:["token",n.type],attributes:{},language:t},l=n.alias;l&&(Array.isArray(l)?Array.prototype.push.apply(i.classes,l):i.classes.push(l)),a.hooks.run("wrap",i);var o="";for(var s in i.attributes)o+=" "+s+'="'+(i.attributes[s]||"").replace(/"/g,"&quot;")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+o+">"+i.content+"</"+i.tag+">"},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(n){var t=JSON.parse(n.data),r=t.language,i=t.code,l=t.immediateClose;e.postMessage(a.highlight(i,a.languages[r],r)),l&&e.close()}),!1),a):a;var g=a.util.currentScript();function f(){a.manual||a.highlightAll()}if(g&&(a.filename=g.src,g.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var h=document.readyState;"loading"===h||"interactive"===h&&g&&g.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return a}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
4
+ Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&amp;/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var t={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};t["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var n={};n[a]={pattern:RegExp("(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[^])*?(?=</__>)".replace(/__/g,(function(){return a})),"i"),lookbehind:!0,greedy:!0,inside:t},Prism.languages.insertBefore("markup","cdata",n)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(a,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp("(^|[\"'\\s])(?:"+a+")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))","i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml;
5
+ !function(s){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;s.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:[^;{\\s\"']|\\s+(?!\\s)|"+e.source+")*?(?:;|(?=\\s*\\{))"),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|(?:[^\\\\\r\n()\"']|\\\\[^])*)\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},s.languages.css.atrule.inside.rest=s.languages.css;var t=s.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(Prism);
6
+ Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};
7
+ Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{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/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp("((?:^|[^$\\w\\xA0-\\uFFFF.\"'\\])\\s]|\\b(?:return|yield))\\s*)/(?:(?:\\[(?:[^\\]\\\\\r\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|/\\*(?:[^*]|\\*(?!/))*\\*/)*(?:$|[\r\n,.;:})\\]]|//))"),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{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*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{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*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute("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)","javascript")),Prism.languages.js=Prism.languages.javascript;
8
+ Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json;
9
+ !function(n){var e=/("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/;n.languages.json5=n.languages.extend("json",{property:[{pattern:RegExp(e.source+"(?=\\s*:)"),greedy:!0},{pattern:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/,alias:"unquoted"}],string:{pattern:e,greedy:!0},number:/[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+\b)?/})}(Prism);
10
+ Prism.languages.log={string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,greedy:!0},exception:{pattern:/(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/,lookbehind:!0,greedy:!0,alias:["javastacktrace","language-javastacktrace"],inside:Prism.languages.javastacktrace||{keyword:/\bat\b/,function:/[a-z_][\w$]*(?=\()/,punctuation:/[.:()]/}},level:[{pattern:/\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,alias:["error","important"]},{pattern:/\b(?:WARN|WARNING|WRN)\b/,alias:["warning","important"]},{pattern:/\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,alias:["info","keyword"]},{pattern:/\b(?:DBG|DEBUG|FINE)\b/,alias:["debug","keyword"]},{pattern:/\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,alias:["trace","comment"]}],property:{pattern:/((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,lookbehind:!0},separator:{pattern:/(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,lookbehind:!0,alias:"comment"},url:/\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/,email:{pattern:/(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,lookbehind:!0,alias:"url"},"ip-address":{pattern:/\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/,alias:"constant"},"mac-address":{pattern:/\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,alias:"constant"},domain:{pattern:/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,lookbehind:!0,alias:"constant"},uuid:{pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,alias:"constant"},hash:{pattern:/\b(?:[a-f0-9]{32}){1,2}\b/i,alias:"constant"},"file-path":{pattern:/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,lookbehind:!0,greedy:!0,alias:"string"},date:{pattern:RegExp("\\b\\d{4}[-/]\\d{2}[-/]\\d{2}(?:T(?=\\d{1,2}:)|(?=\\s\\d{1,2}:))|\\b\\d{1,4}[-/ ](?:\\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\\d{2,4}T?\\b|\\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\\s{1,2}\\d{1,2}\\b","i"),alias:"number"},time:{pattern:/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,alias:"number"},boolean:/\b(?:false|null|true)\b/i,number:{pattern:/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,lookbehind:!0},operator:/[;:?<=>~/@!$%&+\-|^(){}*#]/,punctuation:/[\[\].,]/};
11
+ !function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var e=[],t={},n=function(){};Prism.plugins.toolbar={};var a=Prism.plugins.toolbar.registerButton=function(n,a){var r;r="function"==typeof a?a:function(e){var t;return"function"==typeof a.onClick?((t=document.createElement("button")).type="button",t.addEventListener("click",(function(){a.onClick.call(this,e)}))):"string"==typeof a.url?(t=document.createElement("a")).href=a.url:t=document.createElement("span"),a.className&&t.classList.add(a.className),t.textContent=a.text,t},n in t?console.warn('There is a button with the key "'+n+'" registered already.'):e.push(t[n]=r)},r=Prism.plugins.toolbar.hook=function(a){var r=a.element.parentNode;if(r&&/pre/i.test(r.nodeName)&&!r.parentNode.classList.contains("code-toolbar")){var o=document.createElement("div");o.classList.add("code-toolbar"),r.parentNode.insertBefore(o,r),o.appendChild(r);var i=document.createElement("div");i.classList.add("toolbar");var l=e,d=function(e){for(;e;){var t=e.getAttribute("data-toolbar-order");if(null!=t)return(t=t.trim()).length?t.split(/\s*,\s*/g):[];e=e.parentElement}}(a.element);d&&(l=d.map((function(e){return t[e]||n}))),l.forEach((function(e){var t=e(a);if(t){var n=document.createElement("div");n.classList.add("toolbar-item"),n.appendChild(t),i.appendChild(n)}})),o.appendChild(i)}};a("label",(function(e){var t=e.element.parentNode;if(t&&/pre/i.test(t.nodeName)&&t.hasAttribute("data-label")){var n,a,r=t.getAttribute("data-label");try{a=document.querySelector("template#"+r)}catch(e){}return a?n=a.content:(t.hasAttribute("data-url")?(n=document.createElement("a")).href=t.getAttribute("data-url"):n=document.createElement("span"),n.textContent=r),n}})),Prism.hooks.add("complete",r)}}();
12
+ !function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document)if(Prism.plugins.toolbar){var e={none:"Plain text",plain:"Plain text",plaintext:"Plain text",text:"Plain text",txt:"Plain text",html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",rss:"RSS",css:"CSS",clike:"C-like",js:"JavaScript",abap:"ABAP",abnf:"ABNF",al:"AL",antlr4:"ANTLR4",g4:"ANTLR4",apacheconf:"Apache Configuration",apl:"APL",aql:"AQL",ino:"Arduino",arff:"ARFF",armasm:"ARM Assembly","arm-asm":"ARM Assembly",art:"Arturo",asciidoc:"AsciiDoc",adoc:"AsciiDoc",aspnet:"ASP.NET (C#)",asm6502:"6502 Assembly",asmatmel:"Atmel AVR Assembly",autohotkey:"AutoHotkey",autoit:"AutoIt",avisynth:"AviSynth",avs:"AviSynth","avro-idl":"Avro IDL",avdl:"Avro IDL",awk:"AWK",gawk:"GAWK",sh:"Shell",basic:"BASIC",bbcode:"BBcode",bbj:"BBj",bnf:"BNF",rbnf:"RBNF",bqn:"BQN",bsl:"BSL (1C:Enterprise)",oscript:"OneScript",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cfscript:"CFScript",cfc:"CFScript",cil:"CIL",cilkc:"Cilk/C","cilk-c":"Cilk/C",cilkcpp:"Cilk/C++","cilk-cpp":"Cilk/C++",cilk:"Cilk/C++",cmake:"CMake",cobol:"COBOL",coffee:"CoffeeScript",conc:"Concurnas",csp:"Content-Security-Policy","css-extras":"CSS Extras",csv:"CSV",cue:"CUE",dataweave:"DataWeave",dax:"DAX",django:"Django/Jinja2",jinja2:"Django/Jinja2","dns-zone-file":"DNS zone file","dns-zone":"DNS zone file",dockerfile:"Docker",dot:"DOT (Graphviz)",gv:"DOT (Graphviz)",ebnf:"EBNF",editorconfig:"EditorConfig",ejs:"EJS",etlua:"Embedded Lua templating",erb:"ERB","excel-formula":"Excel Formula",xlsx:"Excel Formula",xls:"Excel Formula",fsharp:"F#","firestore-security-rules":"Firestore security rules",ftl:"FreeMarker Template Language",gml:"GameMaker Language",gamemakerlanguage:"GameMaker Language",gap:"GAP (CAS)",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",gettext:"gettext",po:"gettext",glsl:"GLSL",gn:"GN",gni:"GN","linker-script":"GNU Linker Script",ld:"GNU Linker Script","go-module":"Go module","go-mod":"Go module",graphql:"GraphQL",hbs:"Handlebars",hs:"Haskell",hcl:"HCL",hlsl:"HLSL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam","icu-message-format":"ICU Message Format",idr:"Idris",ignore:".ignore",gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore",inform7:"Inform 7",javadoc:"JavaDoc",javadoclike:"JavaDoc-like",javastacktrace:"Java stack trace",jq:"JQ",jsdoc:"JSDoc","js-extras":"JS Extras",json:"JSON",webmanifest:"Web App Manifest",json5:"JSON5",jsonp:"JSONP",jsstacktrace:"JS stack trace","js-templates":"JS Templates",keepalived:"Keepalived Configure",kts:"Kotlin Script",kt:"Kotlin",kumir:"KuMir (КуМир)",kum:"KuMir (КуМир)",latex:"LaTeX",tex:"TeX",context:"ConTeXt",lilypond:"LilyPond",ly:"LilyPond",emacs:"Lisp",elisp:"Lisp","emacs-lisp":"Lisp",llvm:"LLVM IR",log:"Log file",lolcode:"LOLCODE",magma:"Magma (CAS)",md:"Markdown","markup-templating":"Markup templating",matlab:"MATLAB",maxscript:"MAXScript",mel:"MEL",metafont:"METAFONT",mongodb:"MongoDB",moon:"MoonScript",n1ql:"N1QL",n4js:"N4JS",n4jsd:"N4JS","nand2tetris-hdl":"Nand To Tetris HDL",naniscript:"Naninovel Script",nani:"Naninovel Script",nasm:"NASM",neon:"NEON",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",objc:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",openqasm:"OpenQasm",qasm:"OpenQasm",parigp:"PARI/GP",objectpascal:"Object Pascal",psl:"PATROL Scripting Language",pcaxis:"PC-Axis",px:"PC-Axis",peoplecode:"PeopleCode",pcode:"PeopleCode",php:"PHP",phpdoc:"PHPDoc","php-extras":"PHP Extras","plant-uml":"PlantUML",plantuml:"PlantUML",plsql:"PL/SQL",powerquery:"PowerQuery",pq:"PowerQuery",mscript:"PowerQuery",powershell:"PowerShell",promql:"PromQL",properties:".properties",protobuf:"Protocol Buffers",purebasic:"PureBasic",pbfasm:"PureBasic",purs:"PureScript",py:"Python",qsharp:"Q#",qs:"Q#",q:"Q (kdb+ database)",qml:"QML",rkt:"Racket",cshtml:"Razor C#",razor:"Razor C#",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rpy:"Ren'py",res:"ReScript",rest:"reST (reStructuredText)",robotframework:"Robot Framework",robot:"Robot Framework",rb:"Ruby",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (SCSS)","shell-session":"Shell session","sh-session":"Shell session",shellsession:"Shell session",sml:"SML",smlnj:"SML/NJ",solidity:"Solidity (Ethereum)",sol:"Solidity (Ethereum)","solution-file":"Solution file",sln:"Solution file",soy:"Soy (Closure Template)",sparql:"SPARQL",rq:"SPARQL","splunk-spl":"Splunk SPL",sqf:"SQF: Status Quo Function (Arma 3)",sql:"SQL",stata:"Stata Ado",iecst:"Structured Text (IEC 61131-3)",supercollider:"SuperCollider",sclang:"SuperCollider",systemd:"Systemd configuration file","t4-templating":"T4 templating","t4-cs":"T4 Text Templates (C#)",t4:"T4 Text Templates (C#)","t4-vb":"T4 Text Templates (VB)",tap:"TAP",tt2:"Template Toolkit 2",toml:"TOML",trickle:"trickle",troy:"troy",trig:"TriG",ts:"TypeScript",tsconfig:"TSConfig",uscript:"UnrealScript",uc:"UnrealScript",uorazor:"UO Razor Script",uri:"URI",url:"URL",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vba:"VBA",vb:"Visual Basic",wasm:"WebAssembly","web-idl":"Web IDL",webidl:"Web IDL",wgsl:"WGSL",wiki:"Wiki markup",wolfram:"Wolfram language",nb:"Mathematica Notebook",wl:"Wolfram language",xeoracube:"XeoraCube","xml-doc":"XML doc (.net)",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML",yml:"YAML",yang:"YANG"};Prism.plugins.toolbar.registerButton("show-language",(function(a){var t=a.element.parentNode;if(t&&/pre/i.test(t.nodeName)){var o,i=t.getAttribute("data-language")||e[a.language]||((o=a.language)?(o.substring(0,1).toUpperCase()+o.substring(1)).replace(/s(?=cript)/,"S"):o);if(i){var s=document.createElement("span");return s.textContent=i,s}}}))}else console.warn("Show Languages plugin loaded before Toolbar plugin.")}();