UNPKG

330 kBJavaScriptView Raw
1(function () {
2 /**
3 * Create a cached version of a pure function.
4 * @param {*} fn The function call to be cached
5 * @void
6 */
7
8 function cached(fn) {
9 var cache = Object.create(null);
10 return function (str) {
11 var key = isPrimitive(str) ? str : JSON.stringify(str);
12 var hit = cache[key];
13 return hit || (cache[key] = fn(str));
14 };
15 }
16
17 /**
18 * Hyphenate a camelCase string.
19 */
20 var hyphenate = cached(function (str) {
21 return str.replace(/([A-Z])/g, function (m) { return '-' + m.toLowerCase(); });
22 });
23
24 var hasOwn = Object.prototype.hasOwnProperty;
25
26 /**
27 * Simple Object.assign polyfill
28 * @param {Object} to The object to be merged with
29 * @returns {Object} The merged object
30 */
31 var merge =
32 Object.assign ||
33 function (to) {
34 var arguments$1 = arguments;
35
36 for (var i = 1; i < arguments.length; i++) {
37 var from = Object(arguments$1[i]);
38
39 for (var key in from) {
40 if (hasOwn.call(from, key)) {
41 to[key] = from[key];
42 }
43 }
44 }
45
46 return to;
47 };
48
49 /**
50 * Check if value is primitive
51 * @param {*} value Checks if a value is primitive
52 * @returns {Boolean} Result of the check
53 */
54 function isPrimitive(value) {
55 return typeof value === 'string' || typeof value === 'number';
56 }
57
58 /**
59 * Performs no operation.
60 * @void
61 */
62 function noop() {}
63
64 /**
65 * Check if value is function
66 * @param {*} obj Any javascript object
67 * @returns {Boolean} True if the passed-in value is a function
68 */
69 function isFn(obj) {
70 return typeof obj === 'function';
71 }
72
73 /**
74 * Check if url is external
75 * @param {String} string url
76 * @returns {Boolean} True if the passed-in url is external
77 */
78 function isExternal(url) {
79 var match = url.match(
80 /^([^:/?#]+:)?(?:\/{2,}([^/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/
81 );
82
83 if (
84 typeof match[1] === 'string' &&
85 match[1].length > 0 &&
86 match[1].toLowerCase() !== location.protocol
87 ) {
88 return true;
89 }
90 if (
91 typeof match[2] === 'string' &&
92 match[2].length > 0 &&
93 match[2].replace(
94 new RegExp(
95 ':(' + { 'http:': 80, 'https:': 443 }[location.protocol] + ')?$'
96 ),
97 ''
98 ) !== location.host
99 ) {
100 return true;
101 }
102 if (/^\/\\/.test(url)) {
103 return true;
104 }
105 return false;
106 }
107
108 var inBrowser = !false;
109
110 var isMobile = document.body.clientWidth <= 600;
111
112 /**
113 * @see https://github.com/MoOx/pjax/blob/master/lib/is-supported.js
114 */
115 var supportsPushState =
116
117 (function () {
118 // Borrowed wholesale from https://github.com/defunkt/jquery-pjax
119 return (
120 window.history &&
121 window.history.pushState &&
122 window.history.replaceState &&
123 // PushState isn’t reliable on iOS until 5.
124 !navigator.userAgent.match(
125 /((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/
126 )
127 );
128 })();
129
130 var cacheNode = {};
131
132 /**
133 * Get Node
134 * @param {String|Element} el A DOM element
135 * @param {Boolean} noCache Flag to use or not use the cache
136 * @return {Element} The found node element
137 */
138 function getNode(el, noCache) {
139 if ( noCache === void 0 ) noCache = false;
140
141 if (typeof el === 'string') {
142 if (typeof window.Vue !== 'undefined') {
143 return find(el);
144 }
145
146 el = noCache ? find(el) : cacheNode[el] || (cacheNode[el] = find(el));
147 }
148
149 return el;
150 }
151
152 var $ = document;
153
154 var body = $.body;
155
156 var head = $.head;
157
158 /**
159 * Find elements
160 * @param {String|Element} el The root element where to perform the search from
161 * @param {Element} node The query
162 * @returns {Element} The found DOM element
163 * @example
164 * find('nav') => document.querySelector('nav')
165 * find(nav, 'a') => nav.querySelector('a')
166 */
167 function find(el, node) {
168 return node ? el.querySelector(node) : $.querySelector(el);
169 }
170
171 /**
172 * Find all elements
173 * @param {String|Element} el The root element where to perform the search from
174 * @param {Element} node The query
175 * @returns {Array<Element>} An array of DOM elements
176 * @example
177 * findAll('a') => [].slice.call(document.querySelectorAll('a'))
178 * findAll(nav, 'a') => [].slice.call(nav.querySelectorAll('a'))
179 */
180 function findAll(el, node) {
181 return [].slice.call(
182 node ? el.querySelectorAll(node) : $.querySelectorAll(el)
183 );
184 }
185
186 function create(node, tpl) {
187 node = $.createElement(node);
188 if (tpl) {
189 node.innerHTML = tpl;
190 }
191
192 return node;
193 }
194
195 function appendTo(target, el) {
196 return target.appendChild(el);
197 }
198
199 function before(target, el) {
200 return target.insertBefore(el, target.children[0]);
201 }
202
203 function on(el, type, handler) {
204 isFn(type)
205 ? window.addEventListener(el, type)
206 : el.addEventListener(type, handler);
207 }
208
209 function off(el, type, handler) {
210 isFn(type)
211 ? window.removeEventListener(el, type)
212 : el.removeEventListener(type, handler);
213 }
214
215 /**
216 * Toggle class
217 * @param {String|Element} el The element that needs the class to be toggled
218 * @param {Element} type The type of action to be performed on the classList (toggle by default)
219 * @param {String} val Name of the class to be toggled
220 * @void
221 * @example
222 * toggleClass(el, 'active') => el.classList.toggle('active')
223 * toggleClass(el, 'add', 'active') => el.classList.add('active')
224 */
225 function toggleClass(el, type, val) {
226 el && el.classList[val ? type : 'toggle'](val || type);
227 }
228
229 function style(content) {
230 appendTo(head, create('style', content));
231 }
232
233 /**
234 * Fork https://github.com/bendrucker/document-ready/blob/master/index.js
235 * @param {Function} callback The callbacack to be called when the page is loaded
236 * @returns {Number|void} If the page is already laoded returns the result of the setTimeout callback,
237 * otherwise it only attaches the callback to the DOMContentLoaded event
238 */
239 function documentReady(callback, doc) {
240 if ( doc === void 0 ) doc = document;
241
242 var state = doc.readyState;
243
244 if (state === 'complete' || state === 'interactive') {
245 return setTimeout(callback, 0);
246 }
247
248 doc.addEventListener('DOMContentLoaded', callback);
249 }
250
251 var dom = /*#__PURE__*/Object.freeze({
252 __proto__: null,
253 getNode: getNode,
254 $: $,
255 body: body,
256 head: head,
257 find: find,
258 findAll: findAll,
259 create: create,
260 appendTo: appendTo,
261 before: before,
262 on: on,
263 off: off,
264 toggleClass: toggleClass,
265 style: style,
266 documentReady: documentReady
267 });
268
269 function startsWith(str, prefix) {
270 return str.indexOf(prefix) === 0;
271 }
272
273 function endsWith(str, suffix) {
274 return str.indexOf(suffix, str.length - suffix.length) !== -1;
275 }
276
277 var decode = decodeURIComponent;
278 var encode = encodeURIComponent;
279
280 function parseQuery(query) {
281 var res = {};
282
283 query = query.trim().replace(/^(\?|#|&)/, '');
284
285 if (!query) {
286 return res;
287 }
288
289 // Simple parse
290 query.split('&').forEach(function (param) {
291 var parts = param.replace(/\+/g, ' ').split('=');
292
293 res[parts[0]] = parts[1] && decode(parts[1]);
294 });
295
296 return res;
297 }
298
299 function stringifyQuery(obj, ignores) {
300 if ( ignores === void 0 ) ignores = [];
301
302 var qs = [];
303
304 for (var key in obj) {
305 if (ignores.indexOf(key) > -1) {
306 continue;
307 }
308
309 qs.push(
310 obj[key]
311 ? ((encode(key)) + "=" + (encode(obj[key]))).toLowerCase()
312 : encode(key)
313 );
314 }
315
316 return qs.length ? ("?" + (qs.join('&'))) : '';
317 }
318
319 var isAbsolutePath = cached(function (path) {
320 return /(:|(\/{2}))/g.test(path);
321 });
322
323 var removeParams = cached(function (path) {
324 return path.split(/[?#]/)[0];
325 });
326
327 var getParentPath = cached(function (path) {
328 if (/\/$/g.test(path)) {
329 return path;
330 }
331
332 var matchingParts = path.match(/(\S*\/)[^/]+$/);
333 return matchingParts ? matchingParts[1] : '';
334 });
335
336 var cleanPath = cached(function (path) {
337 return path.replace(/^\/+/, '/').replace(/([^:])\/{2,}/g, '$1/');
338 });
339
340 var resolvePath = cached(function (path) {
341 var segments = path.replace(/^\//, '').split('/');
342 var resolved = [];
343 for (var i = 0, len = segments.length; i < len; i++) {
344 var segment = segments[i];
345 if (segment === '..') {
346 resolved.pop();
347 } else if (segment !== '.') {
348 resolved.push(segment);
349 }
350 }
351
352 return '/' + resolved.join('/');
353 });
354
355 /**
356 * Normalises the URI path to handle the case where Docsify is
357 * hosted off explicit files, i.e. /index.html. This function
358 * eliminates any path segments that contain `#` fragments.
359 *
360 * This is used to map browser URIs to markdown file sources.
361 *
362 * For example:
363 *
364 * http://example.org/base/index.html#/blah
365 *
366 * would be mapped to:
367 *
368 * http://example.org/base/blah.md.
369 *
370 * See here for more information:
371 *
372 * https://github.com/docsifyjs/docsify/pull/1372
373 *
374 * @param {string} path The URI path to normalise
375 * @return {string} { path, query }
376 */
377
378 function normaliseFragment(path) {
379 return path
380 .split('/')
381 .filter(function (p) { return p.indexOf('#') === -1; })
382 .join('/');
383 }
384
385 function getPath() {
386 var args = [], len = arguments.length;
387 while ( len-- ) args[ len ] = arguments[ len ];
388
389 return cleanPath(args.map(normaliseFragment).join('/'));
390 }
391
392 var replaceSlug = cached(function (path) {
393 return path.replace('#', '?id=');
394 });
395
396 var cached$1 = {};
397
398 function getAlias(path, alias, last) {
399 var match = Object.keys(alias).filter(function (key) {
400 var re = cached$1[key] || (cached$1[key] = new RegExp(("^" + key + "$")));
401 return re.test(path) && path !== last;
402 })[0];
403
404 return match
405 ? getAlias(path.replace(cached$1[match], alias[match]), alias, path)
406 : path;
407 }
408
409 function getFileName(path, ext) {
410 return new RegExp(("\\.(" + (ext.replace(/^\./, '')) + "|html)$"), 'g').test(path)
411 ? path
412 : /\/$/g.test(path)
413 ? (path + "README" + ext)
414 : ("" + path + ext);
415 }
416
417 var History = function History(config) {
418 this.config = config;
419 };
420
421 History.prototype.getBasePath = function getBasePath () {
422 return this.config.basePath;
423 };
424
425 History.prototype.getFile = function getFile (path, isRelative) {
426 if ( path === void 0 ) path = this.getCurrentPath();
427
428 var ref = this;
429 var config = ref.config;
430 var base = this.getBasePath();
431 var ext = typeof config.ext === 'string' ? config.ext : '.md';
432
433 path = config.alias ? getAlias(path, config.alias) : path;
434 path = getFileName(path, ext);
435 path = path === ("/README" + ext) ? config.homepage || path : path;
436 path = isAbsolutePath(path) ? path : getPath(base, path);
437
438 if (isRelative) {
439 path = path.replace(new RegExp(("^" + base)), '');
440 }
441
442 return path;
443 };
444
445 History.prototype.onchange = function onchange (cb) {
446 if ( cb === void 0 ) cb = noop;
447
448 cb();
449 };
450
451 History.prototype.getCurrentPath = function getCurrentPath () {};
452
453 History.prototype.normalize = function normalize () {};
454
455 History.prototype.parse = function parse () {};
456
457 History.prototype.toURL = function toURL (path, params, currentRoute) {
458 var local = currentRoute && path[0] === '#';
459 var route = this.parse(replaceSlug(path));
460
461 route.query = merge({}, route.query, params);
462 path = route.path + stringifyQuery(route.query);
463 path = path.replace(/\.md(\?)|\.md$/, '$1');
464
465 if (local) {
466 var idIndex = currentRoute.indexOf('?');
467 path =
468 (idIndex > 0 ? currentRoute.substring(0, idIndex) : currentRoute) +
469 path;
470 }
471
472 if (this.config.relativePath && path.indexOf('/') !== 0) {
473 var currentDir = currentRoute.substring(
474 0,
475 currentRoute.lastIndexOf('/') + 1
476 );
477 return cleanPath(resolvePath(currentDir + path));
478 }
479
480 return cleanPath('/' + path);
481 };
482
483 function replaceHash(path) {
484 var i = location.href.indexOf('#');
485 location.replace(location.href.slice(0, i >= 0 ? i : 0) + '#' + path);
486 }
487 var HashHistory = /*@__PURE__*/(function (History) {
488 function HashHistory(config) {
489 History.call(this, config);
490 this.mode = 'hash';
491 }
492
493 if ( History ) HashHistory.__proto__ = History;
494 HashHistory.prototype = Object.create( History && History.prototype );
495 HashHistory.prototype.constructor = HashHistory;
496
497 HashHistory.prototype.getBasePath = function getBasePath () {
498 var path = window.location.pathname || '';
499 var base = this.config.basePath;
500
501 // This handles the case where Docsify is served off an
502 // explicit file path, i.e.`/base/index.html#/blah`. This
503 // prevents the `/index.html` part of the URI from being
504 // remove during routing.
505 // See here: https://github.com/docsifyjs/docsify/pull/1372
506 var basePath = endsWith(path, '.html')
507 ? path + '#/' + base
508 : path + '/' + base;
509 return /^(\/|https?:)/g.test(base) ? base : cleanPath(basePath);
510 };
511
512 HashHistory.prototype.getCurrentPath = function getCurrentPath () {
513 // We can't use location.hash here because it's not
514 // consistent across browsers - Firefox will pre-decode it!
515 var href = location.href;
516 var index = href.indexOf('#');
517 return index === -1 ? '' : href.slice(index + 1);
518 };
519
520 /** @param {((params: {source: TODO}) => void)} [cb] */
521 HashHistory.prototype.onchange = function onchange (cb) {
522 if ( cb === void 0 ) cb = noop;
523
524 // The hashchange event does not tell us if it originated from
525 // a clicked link or by moving back/forward in the history;
526 // therefore we set a `navigating` flag when a link is clicked
527 // to be able to tell these two scenarios apart
528 var navigating = false;
529
530 on('click', function (e) {
531 var el = e.target.tagName === 'A' ? e.target : e.target.parentNode;
532
533 if (el && el.tagName === 'A' && !isExternal(el.href)) {
534 navigating = true;
535 }
536 });
537
538 on('hashchange', function (e) {
539 var source = navigating ? 'navigate' : 'history';
540 navigating = false;
541 cb({ event: e, source: source });
542 });
543 };
544
545 HashHistory.prototype.normalize = function normalize () {
546 var path = this.getCurrentPath();
547
548 path = replaceSlug(path);
549
550 if (path.charAt(0) === '/') {
551 return replaceHash(path);
552 }
553
554 replaceHash('/' + path);
555 };
556
557 /**
558 * Parse the url
559 * @param {string} [path=location.herf] URL to be parsed
560 * @return {object} { path, query }
561 */
562 HashHistory.prototype.parse = function parse (path) {
563 if ( path === void 0 ) path = location.href;
564
565 var query = '';
566
567 var hashIndex = path.indexOf('#');
568 if (hashIndex >= 0) {
569 path = path.slice(hashIndex + 1);
570 }
571
572 var queryIndex = path.indexOf('?');
573 if (queryIndex >= 0) {
574 query = path.slice(queryIndex + 1);
575 path = path.slice(0, queryIndex);
576 }
577
578 return {
579 path: path,
580 file: this.getFile(path, true),
581 query: parseQuery(query),
582 };
583 };
584
585 HashHistory.prototype.toURL = function toURL (path, params, currentRoute) {
586 return '#' + History.prototype.toURL.call(this, path, params, currentRoute);
587 };
588
589 return HashHistory;
590 }(History));
591
592 /** @typedef {any} TODO */
593
594 var HTML5History = /*@__PURE__*/(function (History) {
595 function HTML5History(config) {
596 History.call(this, config);
597 this.mode = 'history';
598 }
599
600 if ( History ) HTML5History.__proto__ = History;
601 HTML5History.prototype = Object.create( History && History.prototype );
602 HTML5History.prototype.constructor = HTML5History;
603
604 HTML5History.prototype.getCurrentPath = function getCurrentPath () {
605 var base = this.getBasePath();
606 var path = window.location.pathname;
607
608 if (base && path.indexOf(base) === 0) {
609 path = path.slice(base.length);
610 }
611
612 return (path || '/') + window.location.search + window.location.hash;
613 };
614
615 HTML5History.prototype.onchange = function onchange (cb) {
616 if ( cb === void 0 ) cb = noop;
617
618 on('click', function (e) {
619 var el = e.target.tagName === 'A' ? e.target : e.target.parentNode;
620
621 if (el && el.tagName === 'A' && !isExternal(el.href)) {
622 e.preventDefault();
623 var url = el.href;
624 window.history.pushState({ key: url }, '', url);
625 cb({ event: e, source: 'navigate' });
626 }
627 });
628
629 on('popstate', function (e) {
630 cb({ event: e, source: 'history' });
631 });
632 };
633
634 /**
635 * Parse the url
636 * @param {string} [path=location.href] URL to be parsed
637 * @return {object} { path, query }
638 */
639 HTML5History.prototype.parse = function parse (path) {
640 if ( path === void 0 ) path = location.href;
641
642 var query = '';
643
644 var queryIndex = path.indexOf('?');
645 if (queryIndex >= 0) {
646 query = path.slice(queryIndex + 1);
647 path = path.slice(0, queryIndex);
648 }
649
650 var base = getPath(location.origin);
651 var baseIndex = path.indexOf(base);
652
653 if (baseIndex > -1) {
654 path = path.slice(baseIndex + base.length);
655 }
656
657 return {
658 path: path,
659 file: this.getFile(path),
660 query: parseQuery(query),
661 };
662 };
663
664 return HTML5History;
665 }(History));
666
667 /**
668 * @typedef {{
669 * path?: string
670 * }} Route
671 */
672
673 /** @type {Route} */
674 var lastRoute = {};
675
676 /** @typedef {import('../Docsify').Constructor} Constructor */
677
678 /**
679 * @template {!Constructor} T
680 * @param {T} Base - The class to extend
681 */
682 function Router(Base) {
683 return /*@__PURE__*/(function (Base) {
684 function Router() {
685 var args = [], len = arguments.length;
686 while ( len-- ) args[ len ] = arguments[ len ];
687
688 Base.apply(this, args);
689
690 this.route = {};
691 }
692
693 if ( Base ) Router.__proto__ = Base;
694 Router.prototype = Object.create( Base && Base.prototype );
695 Router.prototype.constructor = Router;
696
697 Router.prototype.updateRender = function updateRender () {
698 this.router.normalize();
699 this.route = this.router.parse();
700 body.setAttribute('data-page', this.route.file);
701 };
702
703 Router.prototype.initRouter = function initRouter () {
704 var this$1 = this;
705
706 var config = this.config;
707 var mode = config.routerMode || 'hash';
708 var router;
709
710 if (mode === 'history' && supportsPushState) {
711 router = new HTML5History(config);
712 } else {
713 router = new HashHistory(config);
714 }
715
716 this.router = router;
717 this.updateRender();
718 lastRoute = this.route;
719
720 // eslint-disable-next-line no-unused-vars
721 router.onchange(function (params) {
722 this$1.updateRender();
723 this$1._updateRender();
724
725 if (lastRoute.path === this$1.route.path) {
726 this$1.$resetEvents(params.source);
727 return;
728 }
729
730 this$1.$fetch(noop, this$1.$resetEvents.bind(this$1, params.source));
731 lastRoute = this$1.route;
732 });
733 };
734
735 return Router;
736 }(Base));
737 }
738
739 var RGX = /([^{]*?)\w(?=\})/g;
740
741 var MAP = {
742 YYYY: 'getFullYear',
743 YY: 'getYear',
744 MM: function (d) {
745 return d.getMonth() + 1;
746 },
747 DD: 'getDate',
748 HH: 'getHours',
749 mm: 'getMinutes',
750 ss: 'getSeconds',
751 fff: 'getMilliseconds'
752 };
753
754 function tinydate (str, custom) {
755 var parts=[], offset=0;
756
757 str.replace(RGX, function (key, _, idx) {
758 // save preceding string
759 parts.push(str.substring(offset, idx - 1));
760 offset = idx += key.length + 1;
761 // save function
762 parts.push(custom && custom[key] || function (d) {
763 return ('00' + (typeof MAP[key] === 'string' ? d[MAP[key]]() : MAP[key](d))).slice(-key.length);
764 });
765 });
766
767 if (offset !== str.length) {
768 parts.push(str.substring(offset));
769 }
770
771 return function (arg) {
772 var out='', i=0, d=arg||new Date();
773 for (; i<parts.length; i++) {
774 out += (typeof parts[i]==='string') ? parts[i] : parts[i](d);
775 }
776 return out;
777 };
778 }
779
780 var barEl;
781 var timeId;
782
783 /**
784 * Init progress component
785 */
786 function init() {
787 var div = create('div');
788
789 div.classList.add('progress');
790 appendTo(body, div);
791 barEl = div;
792 }
793
794 /**
795 * Render progress bar
796 */
797 function progressbar (ref) {
798 var loaded = ref.loaded;
799 var total = ref.total;
800 var step = ref.step;
801
802 var num;
803
804 !barEl && init();
805
806 if (step) {
807 num = parseInt(barEl.style.width || 0, 10) + step;
808 num = num > 80 ? 80 : num;
809 } else {
810 num = Math.floor((loaded / total) * 100);
811 }
812
813 barEl.style.opacity = 1;
814 barEl.style.width = num >= 95 ? '100%' : num + '%';
815
816 if (num >= 95) {
817 clearTimeout(timeId);
818 // eslint-disable-next-line no-unused-vars
819 timeId = setTimeout(function (_) {
820 barEl.style.opacity = 0;
821 barEl.style.width = '0%';
822 }, 200);
823 }
824 }
825
826 /* eslint-disable no-unused-vars */
827
828 var cache = {};
829
830 /**
831 * Ajax GET implmentation
832 * @param {string} url Resource URL
833 * @param {boolean} [hasBar=false] Has progress bar
834 * @param {String[]} headers Array of headers
835 * @return {Promise} Promise response
836 */
837 function get(url, hasBar, headers) {
838 if ( hasBar === void 0 ) hasBar = false;
839 if ( headers === void 0 ) headers = {};
840
841 var xhr = new XMLHttpRequest();
842 var on = function () {
843 xhr.addEventListener.apply(xhr, arguments);
844 };
845
846 var cached = cache[url];
847
848 if (cached) {
849 return { then: function (cb) { return cb(cached.content, cached.opt); }, abort: noop };
850 }
851
852 xhr.open('GET', url);
853 for (var i in headers) {
854 if (hasOwn.call(headers, i)) {
855 xhr.setRequestHeader(i, headers[i]);
856 }
857 }
858
859 xhr.send();
860
861 return {
862 then: function (success, error) {
863 if ( error === void 0 ) error = noop;
864
865 if (hasBar) {
866 var id = setInterval(
867 function (_) { return progressbar({
868 step: Math.floor(Math.random() * 5 + 1),
869 }); },
870 500
871 );
872
873 on('progress', progressbar);
874 on('loadend', function (evt) {
875 progressbar(evt);
876 clearInterval(id);
877 });
878 }
879
880 on('error', error);
881 on('load', function (ref) {
882 var target = ref.target;
883
884 if (target.status >= 400) {
885 error(target);
886 } else {
887 var result = (cache[url] = {
888 content: target.response,
889 opt: {
890 updatedAt: xhr.getResponseHeader('last-modified'),
891 },
892 });
893
894 success(result.content, result.opt);
895 }
896 });
897 },
898 abort: function (_) { return xhr.readyState !== 4 && xhr.abort(); },
899 };
900 }
901
902 function replaceVar(block, color) {
903 block.innerHTML = block.innerHTML.replace(
904 /var\(\s*--theme-color.*?\)/g,
905 color
906 );
907 }
908
909 function cssVars (color) {
910 // Variable support
911 if (window.CSS && window.CSS.supports && window.CSS.supports('(--v:red)')) {
912 return;
913 }
914
915 var styleBlocks = findAll('style:not(.inserted),link');
916 [].forEach.call(styleBlocks, function (block) {
917 if (block.nodeName === 'STYLE') {
918 replaceVar(block, color);
919 } else if (block.nodeName === 'LINK') {
920 var href = block.getAttribute('href');
921
922 if (!/\.css$/.test(href)) {
923 return;
924 }
925
926 get(href).then(function (res) {
927 var style = create('style', res);
928
929 head.appendChild(style);
930 replaceVar(style, color);
931 });
932 }
933 });
934 }
935
936 /* eslint-disable no-unused-vars */
937
938 var title = $.title;
939 /**
940 * Toggle button
941 * @param {Element} el Button to be toggled
942 * @void
943 */
944 function btn(el) {
945 var toggle = function (_) { return body.classList.toggle('close'); };
946
947 el = getNode(el);
948 if (el === null || el === undefined) {
949 return;
950 }
951
952 on(el, 'click', function (e) {
953 e.stopPropagation();
954 toggle();
955 });
956
957 isMobile &&
958 on(
959 body,
960 'click',
961 function (_) { return body.classList.contains('close') && toggle(); }
962 );
963 }
964
965 function collapse(el) {
966 el = getNode(el);
967 if (el === null || el === undefined) {
968 return;
969 }
970
971 on(el, 'click', function (ref) {
972 var target = ref.target;
973
974 if (
975 target.nodeName === 'A' &&
976 target.nextSibling &&
977 target.nextSibling.classList &&
978 target.nextSibling.classList.contains('app-sub-sidebar')
979 ) {
980 toggleClass(target.parentNode, 'collapse');
981 }
982 });
983 }
984
985 function sticky() {
986 var cover = getNode('section.cover');
987 if (!cover) {
988 return;
989 }
990
991 var coverHeight = cover.getBoundingClientRect().height;
992
993 if (window.pageYOffset >= coverHeight || cover.classList.contains('hidden')) {
994 toggleClass(body, 'add', 'sticky');
995 } else {
996 toggleClass(body, 'remove', 'sticky');
997 }
998 }
999
1000 /**
1001 * Get and active link
1002 * @param {Object} router Router
1003 * @param {String|Element} el Target element
1004 * @param {Boolean} isParent Active parent
1005 * @param {Boolean} autoTitle Automatically set title
1006 * @return {Element} Active element
1007 */
1008 function getAndActive(router, el, isParent, autoTitle) {
1009 el = getNode(el);
1010 var links = [];
1011 if (el !== null && el !== undefined) {
1012 links = findAll(el, 'a');
1013 }
1014
1015 var hash = decodeURI(router.toURL(router.getCurrentPath()));
1016 var target;
1017
1018 links
1019 .sort(function (a, b) { return b.href.length - a.href.length; })
1020 .forEach(function (a) {
1021 var href = decodeURI(a.getAttribute('href'));
1022 var node = isParent ? a.parentNode : a;
1023
1024 a.title = a.title || a.innerText;
1025
1026 if (hash.indexOf(href) === 0 && !target) {
1027 target = a;
1028 toggleClass(node, 'add', 'active');
1029 } else {
1030 toggleClass(node, 'remove', 'active');
1031 }
1032 });
1033
1034 if (autoTitle) {
1035 $.title = target
1036 ? target.title || ((target.innerText) + " - " + title)
1037 : title;
1038 }
1039
1040 return target;
1041 }
1042
1043 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true; } Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps); } if (staticProps) { defineProperties(Constructor, staticProps); } return Constructor; }; }();
1044
1045 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1046
1047 var SingleTweener = function () {
1048 function SingleTweener() {
1049 var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1050
1051 _classCallCheck(this, SingleTweener);
1052
1053 this.start = opts.start;
1054 this.end = opts.end;
1055 this.decimal = opts.decimal;
1056 }
1057
1058 _createClass(SingleTweener, [{
1059 key: "getIntermediateValue",
1060 value: function getIntermediateValue(tick) {
1061 if (this.decimal) {
1062 return tick;
1063 } else {
1064 return Math.round(tick);
1065 }
1066 }
1067 }, {
1068 key: "getFinalValue",
1069 value: function getFinalValue() {
1070 return this.end;
1071 }
1072 }]);
1073
1074 return SingleTweener;
1075 }();
1076
1077 var _createClass$1 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true; } Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps); } if (staticProps) { defineProperties(Constructor, staticProps); } return Constructor; }; }();
1078
1079 function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1080
1081 var Tweezer = function () {
1082 function Tweezer() {
1083 var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1084
1085 _classCallCheck$1(this, Tweezer);
1086
1087 this.duration = opts.duration || 1000;
1088 this.ease = opts.easing || this._defaultEase;
1089 this.tweener = opts.tweener || new SingleTweener(opts);
1090 this.start = this.tweener.start;
1091 this.end = this.tweener.end;
1092
1093 this.frame = null;
1094 this.next = null;
1095 this.isRunning = false;
1096 this.events = {};
1097 this.direction = this.start < this.end ? 'up' : 'down';
1098 }
1099
1100 _createClass$1(Tweezer, [{
1101 key: 'begin',
1102 value: function begin() {
1103 if (!this.isRunning && this.next !== this.end) {
1104 this.frame = window.requestAnimationFrame(this._tick.bind(this));
1105 }
1106 return this;
1107 }
1108 }, {
1109 key: 'stop',
1110 value: function stop() {
1111 window.cancelAnimationFrame(this.frame);
1112 this.isRunning = false;
1113 this.frame = null;
1114 this.timeStart = null;
1115 this.next = null;
1116 return this;
1117 }
1118 }, {
1119 key: 'on',
1120 value: function on(name, handler) {
1121 this.events[name] = this.events[name] || [];
1122 this.events[name].push(handler);
1123 return this;
1124 }
1125 }, {
1126 key: '_emit',
1127 value: function _emit(name, val) {
1128 var _this = this;
1129
1130 var e = this.events[name];
1131 e && e.forEach(function (handler) {
1132 return handler.call(_this, val);
1133 });
1134 }
1135 }, {
1136 key: '_tick',
1137 value: function _tick(currentTime) {
1138 this.isRunning = true;
1139
1140 var lastTick = this.next || this.start;
1141
1142 if (!this.timeStart) { this.timeStart = currentTime; }
1143 this.timeElapsed = currentTime - this.timeStart;
1144 this.next = this.ease(this.timeElapsed, this.start, this.end - this.start, this.duration);
1145
1146 if (this._shouldTick(lastTick)) {
1147 this._emit('tick', this.tweener.getIntermediateValue(this.next));
1148 this.frame = window.requestAnimationFrame(this._tick.bind(this));
1149 } else {
1150 this._emit('tick', this.tweener.getFinalValue());
1151 this._emit('done', null);
1152 }
1153 }
1154 }, {
1155 key: '_shouldTick',
1156 value: function _shouldTick(lastTick) {
1157 return {
1158 up: this.next < this.end && lastTick <= this.next,
1159 down: this.next > this.end && lastTick >= this.next
1160 }[this.direction];
1161 }
1162 }, {
1163 key: '_defaultEase',
1164 value: function _defaultEase(t, b, c, d) {
1165 if ((t /= d / 2) < 1) { return c / 2 * t * t + b; }
1166 return -c / 2 * (--t * (t - 2) - 1) + b;
1167 }
1168 }]);
1169
1170 return Tweezer;
1171 }();
1172
1173 var currentScript = document.currentScript;
1174
1175 /** @param {import('./Docsify').Docsify} vm */
1176 function config (vm) {
1177 var config = merge(
1178 {
1179 auto2top: false,
1180 autoHeader: false,
1181 basePath: '',
1182 catchPluginErrors: true,
1183 cornerExternalLinkTarget: '_blank',
1184 coverpage: '',
1185 el: '#app',
1186 executeScript: null,
1187 ext: '.md',
1188 externalLinkRel: 'noopener',
1189 externalLinkTarget: '_blank',
1190 formatUpdated: '',
1191 ga: '',
1192 homepage: 'README.md',
1193 loadNavbar: null,
1194 loadSidebar: null,
1195 maxLevel: 6,
1196 mergeNavbar: false,
1197 name: '',
1198 nameLink: window.location.pathname,
1199 nativeEmoji: false,
1200 noCompileLinks: [],
1201 noEmoji: false,
1202 notFoundPage: true,
1203 relativePath: false,
1204 repo: '',
1205 routes: {},
1206 routerMode: 'hash',
1207 subMaxLevel: 0,
1208 themeColor: '',
1209 topMargin: 0,
1210 },
1211 typeof window.$docsify === 'function'
1212 ? window.$docsify(vm)
1213 : window.$docsify
1214 );
1215
1216 var script =
1217 currentScript ||
1218 [].slice
1219 .call(document.getElementsByTagName('script'))
1220 .filter(function (n) { return /docsify\./.test(n.src); })[0];
1221
1222 if (script) {
1223 for (var prop in config) {
1224 if (hasOwn.call(config, prop)) {
1225 var val = script.getAttribute('data-' + hyphenate(prop));
1226
1227 if (isPrimitive(val)) {
1228 config[prop] = val === '' ? true : val;
1229 }
1230 }
1231 }
1232 }
1233
1234 if (config.loadSidebar === true) {
1235 config.loadSidebar = '_sidebar' + config.ext;
1236 }
1237
1238 if (config.loadNavbar === true) {
1239 config.loadNavbar = '_navbar' + config.ext;
1240 }
1241
1242 if (config.coverpage === true) {
1243 config.coverpage = '_coverpage' + config.ext;
1244 }
1245
1246 if (config.repo === true) {
1247 config.repo = '';
1248 }
1249
1250 if (config.name === true) {
1251 config.name = '';
1252 }
1253
1254 window.$docsify = config;
1255
1256 return config;
1257 }
1258
1259 var nav = {};
1260 var hoverOver = false;
1261 var scroller = null;
1262 var enableScrollEvent = true;
1263 var coverHeight = 0;
1264
1265 function scrollTo(el, offset) {
1266 if ( offset === void 0 ) offset = 0;
1267
1268 if (scroller) {
1269 scroller.stop();
1270 }
1271
1272 enableScrollEvent = false;
1273 scroller = new Tweezer({
1274 start: window.pageYOffset,
1275 end:
1276 Math.round(el.getBoundingClientRect().top) + window.pageYOffset - offset,
1277 duration: 500,
1278 })
1279 .on('tick', function (v) { return window.scrollTo(0, v); })
1280 .on('done', function () {
1281 enableScrollEvent = true;
1282 scroller = null;
1283 })
1284 .begin();
1285 }
1286
1287 function highlight(path) {
1288 if (!enableScrollEvent) {
1289 return;
1290 }
1291
1292 var sidebar = getNode('.sidebar');
1293 var anchors = findAll('.anchor');
1294 var wrap = find(sidebar, '.sidebar-nav');
1295 var active = find(sidebar, 'li.active');
1296 var doc = document.documentElement;
1297 var top = ((doc && doc.scrollTop) || document.body.scrollTop) - coverHeight;
1298 var last;
1299
1300 for (var i = 0, len = anchors.length; i < len; i += 1) {
1301 var node = anchors[i];
1302
1303 if (node.offsetTop > top) {
1304 if (!last) {
1305 last = node;
1306 }
1307
1308 break;
1309 } else {
1310 last = node;
1311 }
1312 }
1313
1314 if (!last) {
1315 return;
1316 }
1317
1318 var li = nav[getNavKey(path, last.getAttribute('data-id'))];
1319
1320 if (!li || li === active) {
1321 return;
1322 }
1323
1324 active && active.classList.remove('active');
1325 li.classList.add('active');
1326 active = li;
1327
1328 // Scroll into view
1329 // https://github.com/vuejs/vuejs.org/blob/master/themes/vue/source/js/common.js#L282-L297
1330 if (!hoverOver && body.classList.contains('sticky')) {
1331 var height = sidebar.clientHeight;
1332 var curOffset = 0;
1333 var cur = active.offsetTop + active.clientHeight + 40;
1334 var isInView =
1335 active.offsetTop >= wrap.scrollTop && cur <= wrap.scrollTop + height;
1336 var notThan = cur - curOffset < height;
1337
1338 sidebar.scrollTop = isInView
1339 ? wrap.scrollTop
1340 : notThan
1341 ? curOffset
1342 : cur - height;
1343 }
1344 }
1345
1346 function getNavKey(path, id) {
1347 return ((decodeURIComponent(path)) + "?id=" + (decodeURIComponent(id)));
1348 }
1349
1350 function scrollActiveSidebar(router) {
1351 var cover = find('.cover.show');
1352 coverHeight = cover ? cover.offsetHeight : 0;
1353
1354 var sidebar = getNode('.sidebar');
1355 var lis = [];
1356 if (sidebar !== null && sidebar !== undefined) {
1357 lis = findAll(sidebar, 'li');
1358 }
1359
1360 for (var i = 0, len = lis.length; i < len; i += 1) {
1361 var li = lis[i];
1362 var a = li.querySelector('a');
1363 if (!a) {
1364 continue;
1365 }
1366
1367 var href = a.getAttribute('href');
1368
1369 if (href !== '/') {
1370 var ref = router.parse(href);
1371 var id = ref.query.id;
1372 var path$1 = ref.path;
1373 if (id) {
1374 href = getNavKey(path$1, id);
1375 }
1376 }
1377
1378 if (href) {
1379 nav[decodeURIComponent(href)] = li;
1380 }
1381 }
1382
1383 if (isMobile) {
1384 return;
1385 }
1386
1387 var path = removeParams(router.getCurrentPath());
1388 off('scroll', function () { return highlight(path); });
1389 on('scroll', function () { return highlight(path); });
1390 on(sidebar, 'mouseover', function () {
1391 hoverOver = true;
1392 });
1393 on(sidebar, 'mouseleave', function () {
1394 hoverOver = false;
1395 });
1396 }
1397
1398 function scrollIntoView(path, id) {
1399 if (!id) {
1400 return;
1401 }
1402 var topMargin = config().topMargin;
1403 var section = find('#' + id);
1404 section && scrollTo(section, topMargin);
1405
1406 var li = nav[getNavKey(path, id)];
1407 var sidebar = getNode('.sidebar');
1408 var active = find(sidebar, 'li.active');
1409 active && active.classList.remove('active');
1410 li && li.classList.add('active');
1411 }
1412
1413 var scrollEl = $.scrollingElement || $.documentElement;
1414
1415 function scroll2Top(offset) {
1416 if ( offset === void 0 ) offset = 0;
1417
1418 scrollEl.scrollTop = offset === true ? 0 : Number(offset);
1419 }
1420
1421 var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1422
1423 function createCommonjsModule(fn, module) {
1424 return module = { exports: {} }, fn(module, module.exports), module.exports;
1425 }
1426
1427 var defaults = createCommonjsModule(function (module) {
1428 function getDefaults() {
1429 return {
1430 baseUrl: null,
1431 breaks: false,
1432 gfm: true,
1433 headerIds: true,
1434 headerPrefix: '',
1435 highlight: null,
1436 langPrefix: 'language-',
1437 mangle: true,
1438 pedantic: false,
1439 renderer: null,
1440 sanitize: false,
1441 sanitizer: null,
1442 silent: false,
1443 smartLists: false,
1444 smartypants: false,
1445 tokenizer: null,
1446 walkTokens: null,
1447 xhtml: false
1448 };
1449 }
1450
1451 function changeDefaults(newDefaults) {
1452 module.exports.defaults = newDefaults;
1453 }
1454
1455 module.exports = {
1456 defaults: getDefaults(),
1457 getDefaults: getDefaults,
1458 changeDefaults: changeDefaults
1459 };
1460 });
1461 var defaults_1 = defaults.defaults;
1462 var defaults_2 = defaults.getDefaults;
1463 var defaults_3 = defaults.changeDefaults;
1464
1465 /**
1466 * Helpers
1467 */
1468 var escapeTest = /[&<>"']/;
1469 var escapeReplace = /[&<>"']/g;
1470 var escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/;
1471 var escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g;
1472 var escapeReplacements = {
1473 '&': '&amp;',
1474 '<': '&lt;',
1475 '>': '&gt;',
1476 '"': '&quot;',
1477 "'": '&#39;'
1478 };
1479 var getEscapeReplacement = function (ch) { return escapeReplacements[ch]; };
1480 function escape(html, encode) {
1481 if (encode) {
1482 if (escapeTest.test(html)) {
1483 return html.replace(escapeReplace, getEscapeReplacement);
1484 }
1485 } else {
1486 if (escapeTestNoEncode.test(html)) {
1487 return html.replace(escapeReplaceNoEncode, getEscapeReplacement);
1488 }
1489 }
1490
1491 return html;
1492 }
1493
1494 var unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
1495
1496 function unescape(html) {
1497 // explicitly match decimal, hex, and named HTML entities
1498 return html.replace(unescapeTest, function (_, n) {
1499 n = n.toLowerCase();
1500 if (n === 'colon') { return ':'; }
1501 if (n.charAt(0) === '#') {
1502 return n.charAt(1) === 'x'
1503 ? String.fromCharCode(parseInt(n.substring(2), 16))
1504 : String.fromCharCode(+n.substring(1));
1505 }
1506 return '';
1507 });
1508 }
1509
1510 var caret = /(^|[^\[])\^/g;
1511 function edit(regex, opt) {
1512 regex = regex.source || regex;
1513 opt = opt || '';
1514 var obj = {
1515 replace: function (name, val) {
1516 val = val.source || val;
1517 val = val.replace(caret, '$1');
1518 regex = regex.replace(name, val);
1519 return obj;
1520 },
1521 getRegex: function () {
1522 return new RegExp(regex, opt);
1523 }
1524 };
1525 return obj;
1526 }
1527
1528 var nonWordAndColonTest = /[^\w:]/g;
1529 var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
1530 function cleanUrl(sanitize, base, href) {
1531 if (sanitize) {
1532 var prot;
1533 try {
1534 prot = decodeURIComponent(unescape(href))
1535 .replace(nonWordAndColonTest, '')
1536 .toLowerCase();
1537 } catch (e) {
1538 return null;
1539 }
1540 if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
1541 return null;
1542 }
1543 }
1544 if (base && !originIndependentUrl.test(href)) {
1545 href = resolveUrl(base, href);
1546 }
1547 try {
1548 href = encodeURI(href).replace(/%25/g, '%');
1549 } catch (e) {
1550 return null;
1551 }
1552 return href;
1553 }
1554
1555 var baseUrls = {};
1556 var justDomain = /^[^:]+:\/*[^/]*$/;
1557 var protocol = /^([^:]+:)[\s\S]*$/;
1558 var domain = /^([^:]+:\/*[^/]*)[\s\S]*$/;
1559
1560 function resolveUrl(base, href) {
1561 if (!baseUrls[' ' + base]) {
1562 // we can ignore everything in base after the last slash of its path component,
1563 // but we might need to add _that_
1564 // https://tools.ietf.org/html/rfc3986#section-3
1565 if (justDomain.test(base)) {
1566 baseUrls[' ' + base] = base + '/';
1567 } else {
1568 baseUrls[' ' + base] = rtrim(base, '/', true);
1569 }
1570 }
1571 base = baseUrls[' ' + base];
1572 var relativeBase = base.indexOf(':') === -1;
1573
1574 if (href.substring(0, 2) === '//') {
1575 if (relativeBase) {
1576 return href;
1577 }
1578 return base.replace(protocol, '$1') + href;
1579 } else if (href.charAt(0) === '/') {
1580 if (relativeBase) {
1581 return href;
1582 }
1583 return base.replace(domain, '$1') + href;
1584 } else {
1585 return base + href;
1586 }
1587 }
1588
1589 var noopTest = { exec: function noopTest() {} };
1590
1591 function merge$1(obj) {
1592 var arguments$1 = arguments;
1593
1594 var i = 1,
1595 target,
1596 key;
1597
1598 for (; i < arguments.length; i++) {
1599 target = arguments$1[i];
1600 for (key in target) {
1601 if (Object.prototype.hasOwnProperty.call(target, key)) {
1602 obj[key] = target[key];
1603 }
1604 }
1605 }
1606
1607 return obj;
1608 }
1609
1610 function splitCells(tableRow, count) {
1611 // ensure that every cell-delimiting pipe has a space
1612 // before it to distinguish it from an escaped pipe
1613 var row = tableRow.replace(/\|/g, function (match, offset, str) {
1614 var escaped = false,
1615 curr = offset;
1616 while (--curr >= 0 && str[curr] === '\\') { escaped = !escaped; }
1617 if (escaped) {
1618 // odd number of slashes means | is escaped
1619 // so we leave it alone
1620 return '|';
1621 } else {
1622 // add space before unescaped |
1623 return ' |';
1624 }
1625 }),
1626 cells = row.split(/ \|/);
1627 var i = 0;
1628
1629 if (cells.length > count) {
1630 cells.splice(count);
1631 } else {
1632 while (cells.length < count) { cells.push(''); }
1633 }
1634
1635 for (; i < cells.length; i++) {
1636 // leading or trailing whitespace is ignored per the gfm spec
1637 cells[i] = cells[i].trim().replace(/\\\|/g, '|');
1638 }
1639 return cells;
1640 }
1641
1642 // Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').
1643 // /c*$/ is vulnerable to REDOS.
1644 // invert: Remove suffix of non-c chars instead. Default falsey.
1645 function rtrim(str, c, invert) {
1646 var l = str.length;
1647 if (l === 0) {
1648 return '';
1649 }
1650
1651 // Length of suffix matching the invert condition.
1652 var suffLen = 0;
1653
1654 // Step left until we fail to match the invert condition.
1655 while (suffLen < l) {
1656 var currChar = str.charAt(l - suffLen - 1);
1657 if (currChar === c && !invert) {
1658 suffLen++;
1659 } else if (currChar !== c && invert) {
1660 suffLen++;
1661 } else {
1662 break;
1663 }
1664 }
1665
1666 return str.substr(0, l - suffLen);
1667 }
1668
1669 function findClosingBracket(str, b) {
1670 if (str.indexOf(b[1]) === -1) {
1671 return -1;
1672 }
1673 var l = str.length;
1674 var level = 0,
1675 i = 0;
1676 for (; i < l; i++) {
1677 if (str[i] === '\\') {
1678 i++;
1679 } else if (str[i] === b[0]) {
1680 level++;
1681 } else if (str[i] === b[1]) {
1682 level--;
1683 if (level < 0) {
1684 return i;
1685 }
1686 }
1687 }
1688 return -1;
1689 }
1690
1691 function checkSanitizeDeprecation(opt) {
1692 if (opt && opt.sanitize && !opt.silent) {
1693 console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');
1694 }
1695 }
1696
1697 // copied from https://stackoverflow.com/a/5450113/806777
1698 function repeatString(pattern, count) {
1699 if (count < 1) {
1700 return '';
1701 }
1702 var result = '';
1703 while (count > 1) {
1704 if (count & 1) {
1705 result += pattern;
1706 }
1707 count >>= 1;
1708 pattern += pattern;
1709 }
1710 return result + pattern;
1711 }
1712
1713 var helpers = {
1714 escape: escape,
1715 unescape: unescape,
1716 edit: edit,
1717 cleanUrl: cleanUrl,
1718 resolveUrl: resolveUrl,
1719 noopTest: noopTest,
1720 merge: merge$1,
1721 splitCells: splitCells,
1722 rtrim: rtrim,
1723 findClosingBracket: findClosingBracket,
1724 checkSanitizeDeprecation: checkSanitizeDeprecation,
1725 repeatString: repeatString
1726 };
1727
1728 var defaults$1 = defaults.defaults;
1729
1730 var rtrim$1 = helpers.rtrim;
1731 var splitCells$1 = helpers.splitCells;
1732 var escape$1 = helpers.escape;
1733 var findClosingBracket$1 = helpers.findClosingBracket;
1734
1735 function outputLink(cap, link, raw) {
1736 var href = link.href;
1737 var title = link.title ? escape$1(link.title) : null;
1738 var text = cap[1].replace(/\\([\[\]])/g, '$1');
1739
1740 if (cap[0].charAt(0) !== '!') {
1741 return {
1742 type: 'link',
1743 raw: raw,
1744 href: href,
1745 title: title,
1746 text: text
1747 };
1748 } else {
1749 return {
1750 type: 'image',
1751 raw: raw,
1752 href: href,
1753 title: title,
1754 text: escape$1(text)
1755 };
1756 }
1757 }
1758
1759 function indentCodeCompensation(raw, text) {
1760 var matchIndentToCode = raw.match(/^(\s+)(?:```)/);
1761
1762 if (matchIndentToCode === null) {
1763 return text;
1764 }
1765
1766 var indentToCode = matchIndentToCode[1];
1767
1768 return text
1769 .split('\n')
1770 .map(function (node) {
1771 var matchIndentInNode = node.match(/^\s+/);
1772 if (matchIndentInNode === null) {
1773 return node;
1774 }
1775
1776 var indentInNode = matchIndentInNode[0];
1777
1778 if (indentInNode.length >= indentToCode.length) {
1779 return node.slice(indentToCode.length);
1780 }
1781
1782 return node;
1783 })
1784 .join('\n');
1785 }
1786
1787 /**
1788 * Tokenizer
1789 */
1790 var Tokenizer = /*@__PURE__*/(function () {
1791 function Tokenizer(options) {
1792 this.options = options || defaults$1;
1793 }
1794
1795 Tokenizer.prototype.space = function space (src) {
1796 var cap = this.rules.block.newline.exec(src);
1797 if (cap) {
1798 if (cap[0].length > 1) {
1799 return {
1800 type: 'space',
1801 raw: cap[0]
1802 };
1803 }
1804 return { raw: '\n' };
1805 }
1806 };
1807
1808 Tokenizer.prototype.code = function code (src, tokens) {
1809 var cap = this.rules.block.code.exec(src);
1810 if (cap) {
1811 var lastToken = tokens[tokens.length - 1];
1812 // An indented code block cannot interrupt a paragraph.
1813 if (lastToken && lastToken.type === 'paragraph') {
1814 return {
1815 raw: cap[0],
1816 text: cap[0].trimRight()
1817 };
1818 }
1819
1820 var text = cap[0].replace(/^ {1,4}/gm, '');
1821 return {
1822 type: 'code',
1823 raw: cap[0],
1824 codeBlockStyle: 'indented',
1825 text: !this.options.pedantic
1826 ? rtrim$1(text, '\n')
1827 : text
1828 };
1829 }
1830 };
1831
1832 Tokenizer.prototype.fences = function fences (src) {
1833 var cap = this.rules.block.fences.exec(src);
1834 if (cap) {
1835 var raw = cap[0];
1836 var text = indentCodeCompensation(raw, cap[3] || '');
1837
1838 return {
1839 type: 'code',
1840 raw: raw,
1841 lang: cap[2] ? cap[2].trim() : cap[2],
1842 text: text
1843 };
1844 }
1845 };
1846
1847 Tokenizer.prototype.heading = function heading (src) {
1848 var cap = this.rules.block.heading.exec(src);
1849 if (cap) {
1850 var text = cap[2].trim();
1851
1852 // remove trailing #s
1853 if (/#$/.test(text)) {
1854 var trimmed = rtrim$1(text, '#');
1855 if (this.options.pedantic) {
1856 text = trimmed.trim();
1857 } else if (!trimmed || / $/.test(trimmed)) {
1858 // CommonMark requires space before trailing #s
1859 text = trimmed.trim();
1860 }
1861 }
1862
1863 return {
1864 type: 'heading',
1865 raw: cap[0],
1866 depth: cap[1].length,
1867 text: text
1868 };
1869 }
1870 };
1871
1872 Tokenizer.prototype.nptable = function nptable (src) {
1873 var cap = this.rules.block.nptable.exec(src);
1874 if (cap) {
1875 var item = {
1876 type: 'table',
1877 header: splitCells$1(cap[1].replace(/^ *| *\| *$/g, '')),
1878 align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
1879 cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [],
1880 raw: cap[0]
1881 };
1882
1883 if (item.header.length === item.align.length) {
1884 var l = item.align.length;
1885 var i;
1886 for (i = 0; i < l; i++) {
1887 if (/^ *-+: *$/.test(item.align[i])) {
1888 item.align[i] = 'right';
1889 } else if (/^ *:-+: *$/.test(item.align[i])) {
1890 item.align[i] = 'center';
1891 } else if (/^ *:-+ *$/.test(item.align[i])) {
1892 item.align[i] = 'left';
1893 } else {
1894 item.align[i] = null;
1895 }
1896 }
1897
1898 l = item.cells.length;
1899 for (i = 0; i < l; i++) {
1900 item.cells[i] = splitCells$1(item.cells[i], item.header.length);
1901 }
1902
1903 return item;
1904 }
1905 }
1906 };
1907
1908 Tokenizer.prototype.hr = function hr (src) {
1909 var cap = this.rules.block.hr.exec(src);
1910 if (cap) {
1911 return {
1912 type: 'hr',
1913 raw: cap[0]
1914 };
1915 }
1916 };
1917
1918 Tokenizer.prototype.blockquote = function blockquote (src) {
1919 var cap = this.rules.block.blockquote.exec(src);
1920 if (cap) {
1921 var text = cap[0].replace(/^ *> ?/gm, '');
1922
1923 return {
1924 type: 'blockquote',
1925 raw: cap[0],
1926 text: text
1927 };
1928 }
1929 };
1930
1931 Tokenizer.prototype.list = function list (src) {
1932 var cap = this.rules.block.list.exec(src);
1933 if (cap) {
1934 var raw = cap[0];
1935 var bull = cap[2];
1936 var isordered = bull.length > 1;
1937
1938 var list = {
1939 type: 'list',
1940 raw: raw,
1941 ordered: isordered,
1942 start: isordered ? +bull.slice(0, -1) : '',
1943 loose: false,
1944 items: []
1945 };
1946
1947 // Get each top-level item.
1948 var itemMatch = cap[0].match(this.rules.block.item);
1949
1950 var next = false,
1951 item,
1952 space,
1953 bcurr,
1954 bnext,
1955 addBack,
1956 loose,
1957 istask,
1958 ischecked;
1959
1960 var l = itemMatch.length;
1961 bcurr = this.rules.block.listItemStart.exec(itemMatch[0]);
1962 for (var i = 0; i < l; i++) {
1963 item = itemMatch[i];
1964 raw = item;
1965
1966 // Determine whether the next list item belongs here.
1967 // Backpedal if it does not belong in this list.
1968 if (i !== l - 1) {
1969 bnext = this.rules.block.listItemStart.exec(itemMatch[i + 1]);
1970 if (
1971 !this.options.pedantic
1972 ? bnext[1].length > bcurr[0].length || bnext[1].length > 3
1973 : bnext[1].length > bcurr[1].length
1974 ) {
1975 // nested list
1976 itemMatch.splice(i, 2, itemMatch[i] + '\n' + itemMatch[i + 1]);
1977 i--;
1978 l--;
1979 continue;
1980 } else {
1981 if (
1982 // different bullet style
1983 !this.options.pedantic || this.options.smartLists
1984 ? bnext[2][bnext[2].length - 1] !== bull[bull.length - 1]
1985 : isordered === (bnext[2].length === 1)
1986 ) {
1987 addBack = itemMatch.slice(i + 1).join('\n');
1988 list.raw = list.raw.substring(0, list.raw.length - addBack.length);
1989 i = l - 1;
1990 }
1991 }
1992 bcurr = bnext;
1993 }
1994
1995 // Remove the list item's bullet
1996 // so it is seen as the next token.
1997 space = item.length;
1998 item = item.replace(/^ *([*+-]|\d+[.)]) ?/, '');
1999
2000 // Outdent whatever the
2001 // list item contains. Hacky.
2002 if (~item.indexOf('\n ')) {
2003 space -= item.length;
2004 item = !this.options.pedantic
2005 ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
2006 : item.replace(/^ {1,4}/gm, '');
2007 }
2008
2009 // Determine whether item is loose or not.
2010 // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
2011 // for discount behavior.
2012 loose = next || /\n\n(?!\s*$)/.test(item);
2013 if (i !== l - 1) {
2014 next = item.charAt(item.length - 1) === '\n';
2015 if (!loose) { loose = next; }
2016 }
2017
2018 if (loose) {
2019 list.loose = true;
2020 }
2021
2022 // Check for task list items
2023 if (this.options.gfm) {
2024 istask = /^\[[ xX]\] /.test(item);
2025 ischecked = undefined;
2026 if (istask) {
2027 ischecked = item[1] !== ' ';
2028 item = item.replace(/^\[[ xX]\] +/, '');
2029 }
2030 }
2031
2032 list.items.push({
2033 type: 'list_item',
2034 raw: raw,
2035 task: istask,
2036 checked: ischecked,
2037 loose: loose,
2038 text: item
2039 });
2040 }
2041
2042 return list;
2043 }
2044 };
2045
2046 Tokenizer.prototype.html = function html (src) {
2047 var cap = this.rules.block.html.exec(src);
2048 if (cap) {
2049 return {
2050 type: this.options.sanitize
2051 ? 'paragraph'
2052 : 'html',
2053 raw: cap[0],
2054 pre: !this.options.sanitizer
2055 && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
2056 text: this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$1(cap[0])) : cap[0]
2057 };
2058 }
2059 };
2060
2061 Tokenizer.prototype.def = function def (src) {
2062 var cap = this.rules.block.def.exec(src);
2063 if (cap) {
2064 if (cap[3]) { cap[3] = cap[3].substring(1, cap[3].length - 1); }
2065 var tag = cap[1].toLowerCase().replace(/\s+/g, ' ');
2066 return {
2067 tag: tag,
2068 raw: cap[0],
2069 href: cap[2],
2070 title: cap[3]
2071 };
2072 }
2073 };
2074
2075 Tokenizer.prototype.table = function table (src) {
2076 var cap = this.rules.block.table.exec(src);
2077 if (cap) {
2078 var item = {
2079 type: 'table',
2080 header: splitCells$1(cap[1].replace(/^ *| *\| *$/g, '')),
2081 align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
2082 cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
2083 };
2084
2085 if (item.header.length === item.align.length) {
2086 item.raw = cap[0];
2087
2088 var l = item.align.length;
2089 var i;
2090 for (i = 0; i < l; i++) {
2091 if (/^ *-+: *$/.test(item.align[i])) {
2092 item.align[i] = 'right';
2093 } else if (/^ *:-+: *$/.test(item.align[i])) {
2094 item.align[i] = 'center';
2095 } else if (/^ *:-+ *$/.test(item.align[i])) {
2096 item.align[i] = 'left';
2097 } else {
2098 item.align[i] = null;
2099 }
2100 }
2101
2102 l = item.cells.length;
2103 for (i = 0; i < l; i++) {
2104 item.cells[i] = splitCells$1(
2105 item.cells[i].replace(/^ *\| *| *\| *$/g, ''),
2106 item.header.length);
2107 }
2108
2109 return item;
2110 }
2111 }
2112 };
2113
2114 Tokenizer.prototype.lheading = function lheading (src) {
2115 var cap = this.rules.block.lheading.exec(src);
2116 if (cap) {
2117 return {
2118 type: 'heading',
2119 raw: cap[0],
2120 depth: cap[2].charAt(0) === '=' ? 1 : 2,
2121 text: cap[1]
2122 };
2123 }
2124 };
2125
2126 Tokenizer.prototype.paragraph = function paragraph (src) {
2127 var cap = this.rules.block.paragraph.exec(src);
2128 if (cap) {
2129 return {
2130 type: 'paragraph',
2131 raw: cap[0],
2132 text: cap[1].charAt(cap[1].length - 1) === '\n'
2133 ? cap[1].slice(0, -1)
2134 : cap[1]
2135 };
2136 }
2137 };
2138
2139 Tokenizer.prototype.text = function text (src, tokens) {
2140 var cap = this.rules.block.text.exec(src);
2141 if (cap) {
2142 var lastToken = tokens[tokens.length - 1];
2143 if (lastToken && lastToken.type === 'text') {
2144 return {
2145 raw: cap[0],
2146 text: cap[0]
2147 };
2148 }
2149
2150 return {
2151 type: 'text',
2152 raw: cap[0],
2153 text: cap[0]
2154 };
2155 }
2156 };
2157
2158 Tokenizer.prototype.escape = function escape$1$1 (src) {
2159 var cap = this.rules.inline.escape.exec(src);
2160 if (cap) {
2161 return {
2162 type: 'escape',
2163 raw: cap[0],
2164 text: escape$1(cap[1])
2165 };
2166 }
2167 };
2168
2169 Tokenizer.prototype.tag = function tag (src, inLink, inRawBlock) {
2170 var cap = this.rules.inline.tag.exec(src);
2171 if (cap) {
2172 if (!inLink && /^<a /i.test(cap[0])) {
2173 inLink = true;
2174 } else if (inLink && /^<\/a>/i.test(cap[0])) {
2175 inLink = false;
2176 }
2177 if (!inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
2178 inRawBlock = true;
2179 } else if (inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
2180 inRawBlock = false;
2181 }
2182
2183 return {
2184 type: this.options.sanitize
2185 ? 'text'
2186 : 'html',
2187 raw: cap[0],
2188 inLink: inLink,
2189 inRawBlock: inRawBlock,
2190 text: this.options.sanitize
2191 ? (this.options.sanitizer
2192 ? this.options.sanitizer(cap[0])
2193 : escape$1(cap[0]))
2194 : cap[0]
2195 };
2196 }
2197 };
2198
2199 Tokenizer.prototype.link = function link (src) {
2200 var cap = this.rules.inline.link.exec(src);
2201 if (cap) {
2202 var trimmedUrl = cap[2].trim();
2203 if (!this.options.pedantic && /^</.test(trimmedUrl)) {
2204 // commonmark requires matching angle brackets
2205 if (!(/>$/.test(trimmedUrl))) {
2206 return;
2207 }
2208
2209 // ending angle bracket cannot be escaped
2210 var rtrimSlash = rtrim$1(trimmedUrl.slice(0, -1), '\\');
2211 if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
2212 return;
2213 }
2214 } else {
2215 // find closing parenthesis
2216 var lastParenIndex = findClosingBracket$1(cap[2], '()');
2217 if (lastParenIndex > -1) {
2218 var start = cap[0].indexOf('!') === 0 ? 5 : 4;
2219 var linkLen = start + cap[1].length + lastParenIndex;
2220 cap[2] = cap[2].substring(0, lastParenIndex);
2221 cap[0] = cap[0].substring(0, linkLen).trim();
2222 cap[3] = '';
2223 }
2224 }
2225 var href = cap[2];
2226 var title = '';
2227 if (this.options.pedantic) {
2228 // split pedantic href and title
2229 var link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
2230
2231 if (link) {
2232 href = link[1];
2233 title = link[3];
2234 }
2235 } else {
2236 title = cap[3] ? cap[3].slice(1, -1) : '';
2237 }
2238
2239 href = href.trim();
2240 if (/^</.test(href)) {
2241 if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {
2242 // pedantic allows starting angle bracket without ending angle bracket
2243 href = href.slice(1);
2244 } else {
2245 href = href.slice(1, -1);
2246 }
2247 }
2248 return outputLink(cap, {
2249 href: href ? href.replace(this.rules.inline._escapes, '$1') : href,
2250 title: title ? title.replace(this.rules.inline._escapes, '$1') : title
2251 }, cap[0]);
2252 }
2253 };
2254
2255 Tokenizer.prototype.reflink = function reflink (src, links) {
2256 var cap;
2257 if ((cap = this.rules.inline.reflink.exec(src))
2258 || (cap = this.rules.inline.nolink.exec(src))) {
2259 var link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
2260 link = links[link.toLowerCase()];
2261 if (!link || !link.href) {
2262 var text = cap[0].charAt(0);
2263 return {
2264 type: 'text',
2265 raw: text,
2266 text: text
2267 };
2268 }
2269 return outputLink(cap, link, cap[0]);
2270 }
2271 };
2272
2273 Tokenizer.prototype.strong = function strong (src, maskedSrc, prevChar) {
2274 if ( prevChar === void 0 ) prevChar = '';
2275
2276 var match = this.rules.inline.strong.start.exec(src);
2277
2278 if (match && (!match[1] || (match[1] && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))))) {
2279 maskedSrc = maskedSrc.slice(-1 * src.length);
2280 var endReg = match[0] === '**' ? this.rules.inline.strong.endAst : this.rules.inline.strong.endUnd;
2281
2282 endReg.lastIndex = 0;
2283
2284 var cap;
2285 while ((match = endReg.exec(maskedSrc)) != null) {
2286 cap = this.rules.inline.strong.middle.exec(maskedSrc.slice(0, match.index + 3));
2287 if (cap) {
2288 return {
2289 type: 'strong',
2290 raw: src.slice(0, cap[0].length),
2291 text: src.slice(2, cap[0].length - 2)
2292 };
2293 }
2294 }
2295 }
2296 };
2297
2298 Tokenizer.prototype.em = function em (src, maskedSrc, prevChar) {
2299 if ( prevChar === void 0 ) prevChar = '';
2300
2301 var match = this.rules.inline.em.start.exec(src);
2302
2303 if (match && (!match[1] || (match[1] && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))))) {
2304 maskedSrc = maskedSrc.slice(-1 * src.length);
2305 var endReg = match[0] === '*' ? this.rules.inline.em.endAst : this.rules.inline.em.endUnd;
2306
2307 endReg.lastIndex = 0;
2308
2309 var cap;
2310 while ((match = endReg.exec(maskedSrc)) != null) {
2311 cap = this.rules.inline.em.middle.exec(maskedSrc.slice(0, match.index + 2));
2312 if (cap) {
2313 return {
2314 type: 'em',
2315 raw: src.slice(0, cap[0].length),
2316 text: src.slice(1, cap[0].length - 1)
2317 };
2318 }
2319 }
2320 }
2321 };
2322
2323 Tokenizer.prototype.codespan = function codespan (src) {
2324 var cap = this.rules.inline.code.exec(src);
2325 if (cap) {
2326 var text = cap[2].replace(/\n/g, ' ');
2327 var hasNonSpaceChars = /[^ ]/.test(text);
2328 var hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);
2329 if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
2330 text = text.substring(1, text.length - 1);
2331 }
2332 text = escape$1(text, true);
2333 return {
2334 type: 'codespan',
2335 raw: cap[0],
2336 text: text
2337 };
2338 }
2339 };
2340
2341 Tokenizer.prototype.br = function br (src) {
2342 var cap = this.rules.inline.br.exec(src);
2343 if (cap) {
2344 return {
2345 type: 'br',
2346 raw: cap[0]
2347 };
2348 }
2349 };
2350
2351 Tokenizer.prototype.del = function del (src) {
2352 var cap = this.rules.inline.del.exec(src);
2353 if (cap) {
2354 return {
2355 type: 'del',
2356 raw: cap[0],
2357 text: cap[2]
2358 };
2359 }
2360 };
2361
2362 Tokenizer.prototype.autolink = function autolink (src, mangle) {
2363 var cap = this.rules.inline.autolink.exec(src);
2364 if (cap) {
2365 var text, href;
2366 if (cap[2] === '@') {
2367 text = escape$1(this.options.mangle ? mangle(cap[1]) : cap[1]);
2368 href = 'mailto:' + text;
2369 } else {
2370 text = escape$1(cap[1]);
2371 href = text;
2372 }
2373
2374 return {
2375 type: 'link',
2376 raw: cap[0],
2377 text: text,
2378 href: href,
2379 tokens: [
2380 {
2381 type: 'text',
2382 raw: text,
2383 text: text
2384 }
2385 ]
2386 };
2387 }
2388 };
2389
2390 Tokenizer.prototype.url = function url (src, mangle) {
2391 var cap;
2392 if (cap = this.rules.inline.url.exec(src)) {
2393 var text, href;
2394 if (cap[2] === '@') {
2395 text = escape$1(this.options.mangle ? mangle(cap[0]) : cap[0]);
2396 href = 'mailto:' + text;
2397 } else {
2398 // do extended autolink path validation
2399 var prevCapZero;
2400 do {
2401 prevCapZero = cap[0];
2402 cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];
2403 } while (prevCapZero !== cap[0]);
2404 text = escape$1(cap[0]);
2405 if (cap[1] === 'www.') {
2406 href = 'http://' + text;
2407 } else {
2408 href = text;
2409 }
2410 }
2411 return {
2412 type: 'link',
2413 raw: cap[0],
2414 text: text,
2415 href: href,
2416 tokens: [
2417 {
2418 type: 'text',
2419 raw: text,
2420 text: text
2421 }
2422 ]
2423 };
2424 }
2425 };
2426
2427 Tokenizer.prototype.inlineText = function inlineText (src, inRawBlock, smartypants) {
2428 var cap = this.rules.inline.text.exec(src);
2429 if (cap) {
2430 var text;
2431 if (inRawBlock) {
2432 text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$1(cap[0])) : cap[0];
2433 } else {
2434 text = escape$1(this.options.smartypants ? smartypants(cap[0]) : cap[0]);
2435 }
2436 return {
2437 type: 'text',
2438 raw: cap[0],
2439 text: text
2440 };
2441 }
2442 };
2443
2444 return Tokenizer;
2445 }());
2446
2447 var noopTest$1 = helpers.noopTest;
2448 var edit$1 = helpers.edit;
2449 var merge$2 = helpers.merge;
2450
2451 /**
2452 * Block-Level Grammar
2453 */
2454 var block = {
2455 newline: /^(?: *(?:\n|$))+/,
2456 code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
2457 fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,
2458 hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
2459 heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
2460 blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
2461 list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,
2462 html: '^ {0,3}(?:' // optional indentation
2463 + '<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
2464 + '|comment[^\\n]*(\\n+|$)' // (2)
2465 + '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3)
2466 + '|<![A-Z][\\s\\S]*?(?:>\\n*|$)' // (4)
2467 + '|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)' // (5)
2468 + '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)' // (6)
2469 + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag
2470 + '|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag
2471 + ')',
2472 def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,
2473 nptable: noopTest$1,
2474 table: noopTest$1,
2475 lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
2476 // regex template, placeholders will be replaced according to different paragraph
2477 // interruption rules of commonmark and the original markdown spec:
2478 _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,
2479 text: /^[^\n]+/
2480 };
2481
2482 block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
2483 block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
2484 block.def = edit$1(block.def)
2485 .replace('label', block._label)
2486 .replace('title', block._title)
2487 .getRegex();
2488
2489 block.bullet = /(?:[*+-]|\d{1,9}[.)])/;
2490 block.item = /^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/;
2491 block.item = edit$1(block.item, 'gm')
2492 .replace(/bull/g, block.bullet)
2493 .getRegex();
2494
2495 block.listItemStart = edit$1(/^( *)(bull)/)
2496 .replace('bull', block.bullet)
2497 .getRegex();
2498
2499 block.list = edit$1(block.list)
2500 .replace(/bull/g, block.bullet)
2501 .replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))')
2502 .replace('def', '\\n+(?=' + block.def.source + ')')
2503 .getRegex();
2504
2505 block._tag = 'address|article|aside|base|basefont|blockquote|body|caption'
2506 + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'
2507 + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'
2508 + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'
2509 + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'
2510 + '|track|ul';
2511 block._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
2512 block.html = edit$1(block.html, 'i')
2513 .replace('comment', block._comment)
2514 .replace('tag', block._tag)
2515 .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/)
2516 .getRegex();
2517
2518 block.paragraph = edit$1(block._paragraph)
2519 .replace('hr', block.hr)
2520 .replace('heading', ' {0,3}#{1,6} ')
2521 .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
2522 .replace('blockquote', ' {0,3}>')
2523 .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
2524 .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
2525 .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
2526 .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
2527 .getRegex();
2528
2529 block.blockquote = edit$1(block.blockquote)
2530 .replace('paragraph', block.paragraph)
2531 .getRegex();
2532
2533 /**
2534 * Normal Block Grammar
2535 */
2536
2537 block.normal = merge$2({}, block);
2538
2539 /**
2540 * GFM Block Grammar
2541 */
2542
2543 block.gfm = merge$2({}, block.normal, {
2544 nptable: '^ *([^|\\n ].*\\|.*)\\n' // Header
2545 + ' {0,3}([-:]+ *\\|[-| :]*)' // Align
2546 + '(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)', // Cells
2547 table: '^ *\\|(.+)\\n' // Header
2548 + ' {0,3}\\|?( *[-:]+[-| :]*)' // Align
2549 + '(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
2550 });
2551
2552 block.gfm.nptable = edit$1(block.gfm.nptable)
2553 .replace('hr', block.hr)
2554 .replace('heading', ' {0,3}#{1,6} ')
2555 .replace('blockquote', ' {0,3}>')
2556 .replace('code', ' {4}[^\\n]')
2557 .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
2558 .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
2559 .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
2560 .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
2561 .getRegex();
2562
2563 block.gfm.table = edit$1(block.gfm.table)
2564 .replace('hr', block.hr)
2565 .replace('heading', ' {0,3}#{1,6} ')
2566 .replace('blockquote', ' {0,3}>')
2567 .replace('code', ' {4}[^\\n]')
2568 .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
2569 .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
2570 .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
2571 .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
2572 .getRegex();
2573
2574 /**
2575 * Pedantic grammar (original John Gruber's loose markdown specification)
2576 */
2577
2578 block.pedantic = merge$2({}, block.normal, {
2579 html: edit$1(
2580 '^ *(?:comment *(?:\\n|\\s*$)'
2581 + '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
2582 + '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))')
2583 .replace('comment', block._comment)
2584 .replace(/tag/g, '(?!(?:'
2585 + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'
2586 + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'
2587 + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b')
2588 .getRegex(),
2589 def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
2590 heading: /^(#{1,6})(.*)(?:\n+|$)/,
2591 fences: noopTest$1, // fences not supported
2592 paragraph: edit$1(block.normal._paragraph)
2593 .replace('hr', block.hr)
2594 .replace('heading', ' *#{1,6} *[^\n]')
2595 .replace('lheading', block.lheading)
2596 .replace('blockquote', ' {0,3}>')
2597 .replace('|fences', '')
2598 .replace('|list', '')
2599 .replace('|html', '')
2600 .getRegex()
2601 });
2602
2603 /**
2604 * Inline-Level Grammar
2605 */
2606 var inline = {
2607 escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
2608 autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
2609 url: noopTest$1,
2610 tag: '^comment'
2611 + '|^</[a-zA-Z][\\w:-]*\\s*>' // self-closing tag
2612 + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag
2613 + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. <?php ?>
2614 + '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration, e.g. <!DOCTYPE html>
2615 + '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>', // CDATA section
2616 link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
2617 reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,
2618 nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,
2619 reflinkSearch: 'reflink|nolink(?!\\()',
2620 strong: {
2621 start: /^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/, // (1) returns if starts w/ punctuation
2622 middle: /^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,
2623 endAst: /[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation_\s]|$))/, // last char can't be punct, or final * must also be followed by punct (or endline)
2624 endUnd: /[^\s]__(?!_)(?:(?=[punctuation*\s])|$)/ // last char can't be a space, and final _ must preceed punct or \s (or endline)
2625 },
2626 em: {
2627 start: /^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/, // (1) returns if starts w/ punctuation
2628 middle: /^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,
2629 endAst: /[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation_\s]|$))/, // last char can't be punct, or final * must also be followed by punct (or endline)
2630 endUnd: /[^\s]_(?!_)(?:(?=[punctuation*\s])|$)/ // last char can't be a space, and final _ must preceed punct or \s (or endline)
2631 },
2632 code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
2633 br: /^( {2,}|\\)\n(?!\s*$)/,
2634 del: noopTest$1,
2635 text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n)))/,
2636 punctuation: /^([\s*punctuation])/
2637 };
2638
2639 // list of punctuation marks from common mark spec
2640 // without * and _ to workaround cases with double emphasis
2641 inline._punctuation = '!"#$%&\'()+\\-.,/:;<=>?@\\[\\]`^{|}~';
2642 inline.punctuation = edit$1(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();
2643
2644 // sequences em should skip over [title](link), `code`, <html>
2645 inline._blockSkip = '\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>';
2646 inline._overlapSkip = '__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*';
2647
2648 inline._comment = edit$1(block._comment).replace('(?:-->|$)', '-->').getRegex();
2649
2650 inline.em.start = edit$1(inline.em.start)
2651 .replace(/punctuation/g, inline._punctuation)
2652 .getRegex();
2653
2654 inline.em.middle = edit$1(inline.em.middle)
2655 .replace(/punctuation/g, inline._punctuation)
2656 .replace(/overlapSkip/g, inline._overlapSkip)
2657 .getRegex();
2658
2659 inline.em.endAst = edit$1(inline.em.endAst, 'g')
2660 .replace(/punctuation/g, inline._punctuation)
2661 .getRegex();
2662
2663 inline.em.endUnd = edit$1(inline.em.endUnd, 'g')
2664 .replace(/punctuation/g, inline._punctuation)
2665 .getRegex();
2666
2667 inline.strong.start = edit$1(inline.strong.start)
2668 .replace(/punctuation/g, inline._punctuation)
2669 .getRegex();
2670
2671 inline.strong.middle = edit$1(inline.strong.middle)
2672 .replace(/punctuation/g, inline._punctuation)
2673 .replace(/overlapSkip/g, inline._overlapSkip)
2674 .getRegex();
2675
2676 inline.strong.endAst = edit$1(inline.strong.endAst, 'g')
2677 .replace(/punctuation/g, inline._punctuation)
2678 .getRegex();
2679
2680 inline.strong.endUnd = edit$1(inline.strong.endUnd, 'g')
2681 .replace(/punctuation/g, inline._punctuation)
2682 .getRegex();
2683
2684 inline.blockSkip = edit$1(inline._blockSkip, 'g')
2685 .getRegex();
2686
2687 inline.overlapSkip = edit$1(inline._overlapSkip, 'g')
2688 .getRegex();
2689
2690 inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
2691
2692 inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
2693 inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
2694 inline.autolink = edit$1(inline.autolink)
2695 .replace('scheme', inline._scheme)
2696 .replace('email', inline._email)
2697 .getRegex();
2698
2699 inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
2700
2701 inline.tag = edit$1(inline.tag)
2702 .replace('comment', inline._comment)
2703 .replace('attribute', inline._attribute)
2704 .getRegex();
2705
2706 inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
2707 inline._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
2708 inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
2709
2710 inline.link = edit$1(inline.link)
2711 .replace('label', inline._label)
2712 .replace('href', inline._href)
2713 .replace('title', inline._title)
2714 .getRegex();
2715
2716 inline.reflink = edit$1(inline.reflink)
2717 .replace('label', inline._label)
2718 .getRegex();
2719
2720 inline.reflinkSearch = edit$1(inline.reflinkSearch, 'g')
2721 .replace('reflink', inline.reflink)
2722 .replace('nolink', inline.nolink)
2723 .getRegex();
2724
2725 /**
2726 * Normal Inline Grammar
2727 */
2728
2729 inline.normal = merge$2({}, inline);
2730
2731 /**
2732 * Pedantic Inline Grammar
2733 */
2734
2735 inline.pedantic = merge$2({}, inline.normal, {
2736 strong: {
2737 start: /^__|\*\*/,
2738 middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
2739 endAst: /\*\*(?!\*)/g,
2740 endUnd: /__(?!_)/g
2741 },
2742 em: {
2743 start: /^_|\*/,
2744 middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
2745 endAst: /\*(?!\*)/g,
2746 endUnd: /_(?!_)/g
2747 },
2748 link: edit$1(/^!?\[(label)\]\((.*?)\)/)
2749 .replace('label', inline._label)
2750 .getRegex(),
2751 reflink: edit$1(/^!?\[(label)\]\s*\[([^\]]*)\]/)
2752 .replace('label', inline._label)
2753 .getRegex()
2754 });
2755
2756 /**
2757 * GFM Inline Grammar
2758 */
2759
2760 inline.gfm = merge$2({}, inline.normal, {
2761 escape: edit$1(inline.escape).replace('])', '~|])').getRegex(),
2762 _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
2763 url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
2764 _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,
2765 del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
2766 text: /^([`~]+|[^`~])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/
2767 });
2768
2769 inline.gfm.url = edit$1(inline.gfm.url, 'i')
2770 .replace('email', inline.gfm._extended_email)
2771 .getRegex();
2772 /**
2773 * GFM + Line Breaks Inline Grammar
2774 */
2775
2776 inline.breaks = merge$2({}, inline.gfm, {
2777 br: edit$1(inline.br).replace('{2,}', '*').getRegex(),
2778 text: edit$1(inline.gfm.text)
2779 .replace('\\b_', '\\b_| {2,}\\n')
2780 .replace(/\{2,\}/g, '*')
2781 .getRegex()
2782 });
2783
2784 var rules = {
2785 block: block,
2786 inline: inline
2787 };
2788
2789 var defaults$2 = defaults.defaults;
2790
2791 var block$1 = rules.block;
2792 var inline$1 = rules.inline;
2793
2794 var repeatString$1 = helpers.repeatString;
2795
2796 /**
2797 * smartypants text replacement
2798 */
2799 function smartypants(text) {
2800 return text
2801 // em-dashes
2802 .replace(/---/g, '\u2014')
2803 // en-dashes
2804 .replace(/--/g, '\u2013')
2805 // opening singles
2806 .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
2807 // closing singles & apostrophes
2808 .replace(/'/g, '\u2019')
2809 // opening doubles
2810 .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
2811 // closing doubles
2812 .replace(/"/g, '\u201d')
2813 // ellipses
2814 .replace(/\.{3}/g, '\u2026');
2815 }
2816
2817 /**
2818 * mangle email addresses
2819 */
2820 function mangle(text) {
2821 var out = '',
2822 i,
2823 ch;
2824
2825 var l = text.length;
2826 for (i = 0; i < l; i++) {
2827 ch = text.charCodeAt(i);
2828 if (Math.random() > 0.5) {
2829 ch = 'x' + ch.toString(16);
2830 }
2831 out += '&#' + ch + ';';
2832 }
2833
2834 return out;
2835 }
2836
2837 /**
2838 * Block Lexer
2839 */
2840 var Lexer = /*@__PURE__*/(function () {
2841 function Lexer(options) {
2842 this.tokens = [];
2843 this.tokens.links = Object.create(null);
2844 this.options = options || defaults$2;
2845 this.options.tokenizer = this.options.tokenizer || new Tokenizer();
2846 this.tokenizer = this.options.tokenizer;
2847 this.tokenizer.options = this.options;
2848
2849 var rules = {
2850 block: block$1.normal,
2851 inline: inline$1.normal
2852 };
2853
2854 if (this.options.pedantic) {
2855 rules.block = block$1.pedantic;
2856 rules.inline = inline$1.pedantic;
2857 } else if (this.options.gfm) {
2858 rules.block = block$1.gfm;
2859 if (this.options.breaks) {
2860 rules.inline = inline$1.breaks;
2861 } else {
2862 rules.inline = inline$1.gfm;
2863 }
2864 }
2865 this.tokenizer.rules = rules;
2866 }
2867
2868 var staticAccessors = { rules: { configurable: true } };
2869
2870 /**
2871 * Expose Rules
2872 */
2873 staticAccessors.rules.get = function () {
2874 return {
2875 block: block$1,
2876 inline: inline$1
2877 };
2878 };
2879
2880 /**
2881 * Static Lex Method
2882 */
2883 Lexer.lex = function lex (src, options) {
2884 var lexer = new Lexer(options);
2885 return lexer.lex(src);
2886 };
2887
2888 /**
2889 * Static Lex Inline Method
2890 */
2891 Lexer.lexInline = function lexInline (src, options) {
2892 var lexer = new Lexer(options);
2893 return lexer.inlineTokens(src);
2894 };
2895
2896 /**
2897 * Preprocessing
2898 */
2899 Lexer.prototype.lex = function lex (src) {
2900 src = src
2901 .replace(/\r\n|\r/g, '\n')
2902 .replace(/\t/g, ' ');
2903
2904 this.blockTokens(src, this.tokens, true);
2905
2906 this.inline(this.tokens);
2907
2908 return this.tokens;
2909 };
2910
2911 /**
2912 * Lexing
2913 */
2914 Lexer.prototype.blockTokens = function blockTokens (src, tokens, top) {
2915 if ( tokens === void 0 ) tokens = [];
2916 if ( top === void 0 ) top = true;
2917
2918 if (this.options.pedantic) {
2919 src = src.replace(/^ +$/gm, '');
2920 }
2921 var token, i, l, lastToken;
2922
2923 while (src) {
2924 // newline
2925 if (token = this.tokenizer.space(src)) {
2926 src = src.substring(token.raw.length);
2927 if (token.type) {
2928 tokens.push(token);
2929 }
2930 continue;
2931 }
2932
2933 // code
2934 if (token = this.tokenizer.code(src, tokens)) {
2935 src = src.substring(token.raw.length);
2936 if (token.type) {
2937 tokens.push(token);
2938 } else {
2939 lastToken = tokens[tokens.length - 1];
2940 lastToken.raw += '\n' + token.raw;
2941 lastToken.text += '\n' + token.text;
2942 }
2943 continue;
2944 }
2945
2946 // fences
2947 if (token = this.tokenizer.fences(src)) {
2948 src = src.substring(token.raw.length);
2949 tokens.push(token);
2950 continue;
2951 }
2952
2953 // heading
2954 if (token = this.tokenizer.heading(src)) {
2955 src = src.substring(token.raw.length);
2956 tokens.push(token);
2957 continue;
2958 }
2959
2960 // table no leading pipe (gfm)
2961 if (token = this.tokenizer.nptable(src)) {
2962 src = src.substring(token.raw.length);
2963 tokens.push(token);
2964 continue;
2965 }
2966
2967 // hr
2968 if (token = this.tokenizer.hr(src)) {
2969 src = src.substring(token.raw.length);
2970 tokens.push(token);
2971 continue;
2972 }
2973
2974 // blockquote
2975 if (token = this.tokenizer.blockquote(src)) {
2976 src = src.substring(token.raw.length);
2977 token.tokens = this.blockTokens(token.text, [], top);
2978 tokens.push(token);
2979 continue;
2980 }
2981
2982 // list
2983 if (token = this.tokenizer.list(src)) {
2984 src = src.substring(token.raw.length);
2985 l = token.items.length;
2986 for (i = 0; i < l; i++) {
2987 token.items[i].tokens = this.blockTokens(token.items[i].text, [], false);
2988 }
2989 tokens.push(token);
2990 continue;
2991 }
2992
2993 // html
2994 if (token = this.tokenizer.html(src)) {
2995 src = src.substring(token.raw.length);
2996 tokens.push(token);
2997 continue;
2998 }
2999
3000 // def
3001 if (top && (token = this.tokenizer.def(src))) {
3002 src = src.substring(token.raw.length);
3003 if (!this.tokens.links[token.tag]) {
3004 this.tokens.links[token.tag] = {
3005 href: token.href,
3006 title: token.title
3007 };
3008 }
3009 continue;
3010 }
3011
3012 // table (gfm)
3013 if (token = this.tokenizer.table(src)) {
3014 src = src.substring(token.raw.length);
3015 tokens.push(token);
3016 continue;
3017 }
3018
3019 // lheading
3020 if (token = this.tokenizer.lheading(src)) {
3021 src = src.substring(token.raw.length);
3022 tokens.push(token);
3023 continue;
3024 }
3025
3026 // top-level paragraph
3027 if (top && (token = this.tokenizer.paragraph(src))) {
3028 src = src.substring(token.raw.length);
3029 tokens.push(token);
3030 continue;
3031 }
3032
3033 // text
3034 if (token = this.tokenizer.text(src, tokens)) {
3035 src = src.substring(token.raw.length);
3036 if (token.type) {
3037 tokens.push(token);
3038 } else {
3039 lastToken = tokens[tokens.length - 1];
3040 lastToken.raw += '\n' + token.raw;
3041 lastToken.text += '\n' + token.text;
3042 }
3043 continue;
3044 }
3045
3046 if (src) {
3047 var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);
3048 if (this.options.silent) {
3049 console.error(errMsg);
3050 break;
3051 } else {
3052 throw new Error(errMsg);
3053 }
3054 }
3055 }
3056
3057 return tokens;
3058 };
3059
3060 Lexer.prototype.inline = function inline (tokens) {
3061 var i,
3062 j,
3063 k,
3064 l2,
3065 row,
3066 token;
3067
3068 var l = tokens.length;
3069 for (i = 0; i < l; i++) {
3070 token = tokens[i];
3071 switch (token.type) {
3072 case 'paragraph':
3073 case 'text':
3074 case 'heading': {
3075 token.tokens = [];
3076 this.inlineTokens(token.text, token.tokens);
3077 break;
3078 }
3079 case 'table': {
3080 token.tokens = {
3081 header: [],
3082 cells: []
3083 };
3084
3085 // header
3086 l2 = token.header.length;
3087 for (j = 0; j < l2; j++) {
3088 token.tokens.header[j] = [];
3089 this.inlineTokens(token.header[j], token.tokens.header[j]);
3090 }
3091
3092 // cells
3093 l2 = token.cells.length;
3094 for (j = 0; j < l2; j++) {
3095 row = token.cells[j];
3096 token.tokens.cells[j] = [];
3097 for (k = 0; k < row.length; k++) {
3098 token.tokens.cells[j][k] = [];
3099 this.inlineTokens(row[k], token.tokens.cells[j][k]);
3100 }
3101 }
3102
3103 break;
3104 }
3105 case 'blockquote': {
3106 this.inline(token.tokens);
3107 break;
3108 }
3109 case 'list': {
3110 l2 = token.items.length;
3111 for (j = 0; j < l2; j++) {
3112 this.inline(token.items[j].tokens);
3113 }
3114 break;
3115 }
3116 }
3117 }
3118
3119 return tokens;
3120 };
3121
3122 /**
3123 * Lexing/Compiling
3124 */
3125 Lexer.prototype.inlineTokens = function inlineTokens (src, tokens, inLink, inRawBlock) {
3126 if ( tokens === void 0 ) tokens = [];
3127 if ( inLink === void 0 ) inLink = false;
3128 if ( inRawBlock === void 0 ) inRawBlock = false;
3129
3130 var token;
3131
3132 // String with links masked to avoid interference with em and strong
3133 var maskedSrc = src;
3134 var match;
3135 var keepPrevChar, prevChar;
3136
3137 // Mask out reflinks
3138 if (this.tokens.links) {
3139 var links = Object.keys(this.tokens.links);
3140 if (links.length > 0) {
3141 while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
3142 if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {
3143 maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString$1('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
3144 }
3145 }
3146 }
3147 }
3148 // Mask out other blocks
3149 while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
3150 maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString$1('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
3151 }
3152
3153 while (src) {
3154 if (!keepPrevChar) {
3155 prevChar = '';
3156 }
3157 keepPrevChar = false;
3158 // escape
3159 if (token = this.tokenizer.escape(src)) {
3160 src = src.substring(token.raw.length);
3161 tokens.push(token);
3162 continue;
3163 }
3164
3165 // tag
3166 if (token = this.tokenizer.tag(src, inLink, inRawBlock)) {
3167 src = src.substring(token.raw.length);
3168 inLink = token.inLink;
3169 inRawBlock = token.inRawBlock;
3170 tokens.push(token);
3171 continue;
3172 }
3173
3174 // link
3175 if (token = this.tokenizer.link(src)) {
3176 src = src.substring(token.raw.length);
3177 if (token.type === 'link') {
3178 token.tokens = this.inlineTokens(token.text, [], true, inRawBlock);
3179 }
3180 tokens.push(token);
3181 continue;
3182 }
3183
3184 // reflink, nolink
3185 if (token = this.tokenizer.reflink(src, this.tokens.links)) {
3186 src = src.substring(token.raw.length);
3187 if (token.type === 'link') {
3188 token.tokens = this.inlineTokens(token.text, [], true, inRawBlock);
3189 }
3190 tokens.push(token);
3191 continue;
3192 }
3193
3194 // strong
3195 if (token = this.tokenizer.strong(src, maskedSrc, prevChar)) {
3196 src = src.substring(token.raw.length);
3197 token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock);
3198 tokens.push(token);
3199 continue;
3200 }
3201
3202 // em
3203 if (token = this.tokenizer.em(src, maskedSrc, prevChar)) {
3204 src = src.substring(token.raw.length);
3205 token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock);
3206 tokens.push(token);
3207 continue;
3208 }
3209
3210 // code
3211 if (token = this.tokenizer.codespan(src)) {
3212 src = src.substring(token.raw.length);
3213 tokens.push(token);
3214 continue;
3215 }
3216
3217 // br
3218 if (token = this.tokenizer.br(src)) {
3219 src = src.substring(token.raw.length);
3220 tokens.push(token);
3221 continue;
3222 }
3223
3224 // del (gfm)
3225 if (token = this.tokenizer.del(src)) {
3226 src = src.substring(token.raw.length);
3227 token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock);
3228 tokens.push(token);
3229 continue;
3230 }
3231
3232 // autolink
3233 if (token = this.tokenizer.autolink(src, mangle)) {
3234 src = src.substring(token.raw.length);
3235 tokens.push(token);
3236 continue;
3237 }
3238
3239 // url (gfm)
3240 if (!inLink && (token = this.tokenizer.url(src, mangle))) {
3241 src = src.substring(token.raw.length);
3242 tokens.push(token);
3243 continue;
3244 }
3245
3246 // text
3247 if (token = this.tokenizer.inlineText(src, inRawBlock, smartypants)) {
3248 src = src.substring(token.raw.length);
3249 prevChar = token.raw.slice(-1);
3250 keepPrevChar = true;
3251 tokens.push(token);
3252 continue;
3253 }
3254
3255 if (src) {
3256 var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);
3257 if (this.options.silent) {
3258 console.error(errMsg);
3259 break;
3260 } else {
3261 throw new Error(errMsg);
3262 }
3263 }
3264 }
3265
3266 return tokens;
3267 };
3268
3269 Object.defineProperties( Lexer, staticAccessors );
3270
3271 return Lexer;
3272 }());
3273
3274 var defaults$3 = defaults.defaults;
3275
3276 var cleanUrl$1 = helpers.cleanUrl;
3277 var escape$2 = helpers.escape;
3278
3279 /**
3280 * Renderer
3281 */
3282 var Renderer = /*@__PURE__*/(function () {
3283 function Renderer(options) {
3284 this.options = options || defaults$3;
3285 }
3286
3287 Renderer.prototype.code = function code (code$1, infostring, escaped) {
3288 var lang = (infostring || '').match(/\S*/)[0];
3289 if (this.options.highlight) {
3290 var out = this.options.highlight(code$1, lang);
3291 if (out != null && out !== code$1) {
3292 escaped = true;
3293 code$1 = out;
3294 }
3295 }
3296
3297 code$1 = code$1.replace(/\n$/, '') + '\n';
3298
3299 if (!lang) {
3300 return '<pre><code>'
3301 + (escaped ? code$1 : escape$2(code$1, true))
3302 + '</code></pre>\n';
3303 }
3304
3305 return '<pre><code class="'
3306 + this.options.langPrefix
3307 + escape$2(lang, true)
3308 + '">'
3309 + (escaped ? code$1 : escape$2(code$1, true))
3310 + '</code></pre>\n';
3311 };
3312
3313 Renderer.prototype.blockquote = function blockquote (quote) {
3314 return '<blockquote>\n' + quote + '</blockquote>\n';
3315 };
3316
3317 Renderer.prototype.html = function html (html$1) {
3318 return html$1;
3319 };
3320
3321 Renderer.prototype.heading = function heading (text, level, raw, slugger) {
3322 if (this.options.headerIds) {
3323 return '<h'
3324 + level
3325 + ' id="'
3326 + this.options.headerPrefix
3327 + slugger.slug(raw)
3328 + '">'
3329 + text
3330 + '</h'
3331 + level
3332 + '>\n';
3333 }
3334 // ignore IDs
3335 return '<h' + level + '>' + text + '</h' + level + '>\n';
3336 };
3337
3338 Renderer.prototype.hr = function hr () {
3339 return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
3340 };
3341
3342 Renderer.prototype.list = function list (body, ordered, start) {
3343 var type = ordered ? 'ol' : 'ul',
3344 startatt = (ordered && start !== 1) ? (' start="' + start + '"') : '';
3345 return '<' + type + startatt + '>\n' + body + '</' + type + '>\n';
3346 };
3347
3348 Renderer.prototype.listitem = function listitem (text) {
3349 return '<li>' + text + '</li>\n';
3350 };
3351
3352 Renderer.prototype.checkbox = function checkbox (checked) {
3353 return '<input '
3354 + (checked ? 'checked="" ' : '')
3355 + 'disabled="" type="checkbox"'
3356 + (this.options.xhtml ? ' /' : '')
3357 + '> ';
3358 };
3359
3360 Renderer.prototype.paragraph = function paragraph (text) {
3361 return '<p>' + text + '</p>\n';
3362 };
3363
3364 Renderer.prototype.table = function table (header, body) {
3365 if (body) { body = '<tbody>' + body + '</tbody>'; }
3366
3367 return '<table>\n'
3368 + '<thead>\n'
3369 + header
3370 + '</thead>\n'
3371 + body
3372 + '</table>\n';
3373 };
3374
3375 Renderer.prototype.tablerow = function tablerow (content) {
3376 return '<tr>\n' + content + '</tr>\n';
3377 };
3378
3379 Renderer.prototype.tablecell = function tablecell (content, flags) {
3380 var type = flags.header ? 'th' : 'td';
3381 var tag = flags.align
3382 ? '<' + type + ' align="' + flags.align + '">'
3383 : '<' + type + '>';
3384 return tag + content + '</' + type + '>\n';
3385 };
3386
3387 // span level renderer
3388 Renderer.prototype.strong = function strong (text) {
3389 return '<strong>' + text + '</strong>';
3390 };
3391
3392 Renderer.prototype.em = function em (text) {
3393 return '<em>' + text + '</em>';
3394 };
3395
3396 Renderer.prototype.codespan = function codespan (text) {
3397 return '<code>' + text + '</code>';
3398 };
3399
3400 Renderer.prototype.br = function br () {
3401 return this.options.xhtml ? '<br/>' : '<br>';
3402 };
3403
3404 Renderer.prototype.del = function del (text) {
3405 return '<del>' + text + '</del>';
3406 };
3407
3408 Renderer.prototype.link = function link (href, title, text) {
3409 href = cleanUrl$1(this.options.sanitize, this.options.baseUrl, href);
3410 if (href === null) {
3411 return text;
3412 }
3413 var out = '<a href="' + escape$2(href) + '"';
3414 if (title) {
3415 out += ' title="' + title + '"';
3416 }
3417 out += '>' + text + '</a>';
3418 return out;
3419 };
3420
3421 Renderer.prototype.image = function image (href, title, text) {
3422 href = cleanUrl$1(this.options.sanitize, this.options.baseUrl, href);
3423 if (href === null) {
3424 return text;
3425 }
3426
3427 var out = '<img src="' + href + '" alt="' + text + '"';
3428 if (title) {
3429 out += ' title="' + title + '"';
3430 }
3431 out += this.options.xhtml ? '/>' : '>';
3432 return out;
3433 };
3434
3435 Renderer.prototype.text = function text (text$1) {
3436 return text$1;
3437 };
3438
3439 return Renderer;
3440 }());
3441
3442 /**
3443 * TextRenderer
3444 * returns only the textual part of the token
3445 */
3446 var TextRenderer = /*@__PURE__*/(function () {
3447 function TextRenderer () {}
3448
3449 TextRenderer.prototype.strong = function strong (text) {
3450 return text;
3451 };
3452
3453 TextRenderer.prototype.em = function em (text) {
3454 return text;
3455 };
3456
3457 TextRenderer.prototype.codespan = function codespan (text) {
3458 return text;
3459 };
3460
3461 TextRenderer.prototype.del = function del (text) {
3462 return text;
3463 };
3464
3465 TextRenderer.prototype.html = function html (text) {
3466 return text;
3467 };
3468
3469 TextRenderer.prototype.text = function text (text$1) {
3470 return text$1;
3471 };
3472
3473 TextRenderer.prototype.link = function link (href, title, text) {
3474 return '' + text;
3475 };
3476
3477 TextRenderer.prototype.image = function image (href, title, text) {
3478 return '' + text;
3479 };
3480
3481 TextRenderer.prototype.br = function br () {
3482 return '';
3483 };
3484
3485 return TextRenderer;
3486 }());
3487
3488 /**
3489 * Slugger generates header id
3490 */
3491 var Slugger = /*@__PURE__*/(function () {
3492 function Slugger() {
3493 this.seen = {};
3494 }
3495
3496 Slugger.prototype.serialize = function serialize (value) {
3497 return value
3498 .toLowerCase()
3499 .trim()
3500 // remove html tags
3501 .replace(/<[!\/a-z].*?>/ig, '')
3502 // remove unwanted chars
3503 .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '')
3504 .replace(/\s/g, '-');
3505 };
3506
3507 /**
3508 * Finds the next safe (unique) slug to use
3509 */
3510 Slugger.prototype.getNextSafeSlug = function getNextSafeSlug (originalSlug, isDryRun) {
3511 var slug = originalSlug;
3512 var occurenceAccumulator = 0;
3513 if (this.seen.hasOwnProperty(slug)) {
3514 occurenceAccumulator = this.seen[originalSlug];
3515 do {
3516 occurenceAccumulator++;
3517 slug = originalSlug + '-' + occurenceAccumulator;
3518 } while (this.seen.hasOwnProperty(slug));
3519 }
3520 if (!isDryRun) {
3521 this.seen[originalSlug] = occurenceAccumulator;
3522 this.seen[slug] = 0;
3523 }
3524 return slug;
3525 };
3526
3527 /**
3528 * Convert string to unique id
3529 * @param {object} options
3530 * @param {boolean} options.dryrun Generates the next unique slug without updating the internal accumulator.
3531 */
3532 Slugger.prototype.slug = function slug (value, options) {
3533 if ( options === void 0 ) options = {};
3534
3535 var slug = this.serialize(value);
3536 return this.getNextSafeSlug(slug, options.dryrun);
3537 };
3538
3539 return Slugger;
3540 }());
3541
3542 var defaults$4 = defaults.defaults;
3543
3544 var unescape$1 = helpers.unescape;
3545
3546 /**
3547 * Parsing & Compiling
3548 */
3549 var Parser = /*@__PURE__*/(function () {
3550 function Parser(options) {
3551 this.options = options || defaults$4;
3552 this.options.renderer = this.options.renderer || new Renderer();
3553 this.renderer = this.options.renderer;
3554 this.renderer.options = this.options;
3555 this.textRenderer = new TextRenderer();
3556 this.slugger = new Slugger();
3557 }
3558
3559 /**
3560 * Static Parse Method
3561 */
3562 Parser.parse = function parse (tokens, options) {
3563 var parser = new Parser(options);
3564 return parser.parse(tokens);
3565 };
3566
3567 /**
3568 * Static Parse Inline Method
3569 */
3570 Parser.parseInline = function parseInline (tokens, options) {
3571 var parser = new Parser(options);
3572 return parser.parseInline(tokens);
3573 };
3574
3575 /**
3576 * Parse Loop
3577 */
3578 Parser.prototype.parse = function parse (tokens, top) {
3579 if ( top === void 0 ) top = true;
3580
3581 var out = '',
3582 i,
3583 j,
3584 k,
3585 l2,
3586 l3,
3587 row,
3588 cell,
3589 header,
3590 body,
3591 token,
3592 ordered,
3593 start,
3594 loose,
3595 itemBody,
3596 item,
3597 checked,
3598 task,
3599 checkbox;
3600
3601 var l = tokens.length;
3602 for (i = 0; i < l; i++) {
3603 token = tokens[i];
3604 switch (token.type) {
3605 case 'space': {
3606 continue;
3607 }
3608 case 'hr': {
3609 out += this.renderer.hr();
3610 continue;
3611 }
3612 case 'heading': {
3613 out += this.renderer.heading(
3614 this.parseInline(token.tokens),
3615 token.depth,
3616 unescape$1(this.parseInline(token.tokens, this.textRenderer)),
3617 this.slugger);
3618 continue;
3619 }
3620 case 'code': {
3621 out += this.renderer.code(token.text,
3622 token.lang,
3623 token.escaped);
3624 continue;
3625 }
3626 case 'table': {
3627 header = '';
3628
3629 // header
3630 cell = '';
3631 l2 = token.header.length;
3632 for (j = 0; j < l2; j++) {
3633 cell += this.renderer.tablecell(
3634 this.parseInline(token.tokens.header[j]),
3635 { header: true, align: token.align[j] }
3636 );
3637 }
3638 header += this.renderer.tablerow(cell);
3639
3640 body = '';
3641 l2 = token.cells.length;
3642 for (j = 0; j < l2; j++) {
3643 row = token.tokens.cells[j];
3644
3645 cell = '';
3646 l3 = row.length;
3647 for (k = 0; k < l3; k++) {
3648 cell += this.renderer.tablecell(
3649 this.parseInline(row[k]),
3650 { header: false, align: token.align[k] }
3651 );
3652 }
3653
3654 body += this.renderer.tablerow(cell);
3655 }
3656 out += this.renderer.table(header, body);
3657 continue;
3658 }
3659 case 'blockquote': {
3660 body = this.parse(token.tokens);
3661 out += this.renderer.blockquote(body);
3662 continue;
3663 }
3664 case 'list': {
3665 ordered = token.ordered;
3666 start = token.start;
3667 loose = token.loose;
3668 l2 = token.items.length;
3669
3670 body = '';
3671 for (j = 0; j < l2; j++) {
3672 item = token.items[j];
3673 checked = item.checked;
3674 task = item.task;
3675
3676 itemBody = '';
3677 if (item.task) {
3678 checkbox = this.renderer.checkbox(checked);
3679 if (loose) {
3680 if (item.tokens.length > 0 && item.tokens[0].type === 'text') {
3681 item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;
3682 if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {
3683 item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;
3684 }
3685 } else {
3686 item.tokens.unshift({
3687 type: 'text',
3688 text: checkbox
3689 });
3690 }
3691 } else {
3692 itemBody += checkbox;
3693 }
3694 }
3695
3696 itemBody += this.parse(item.tokens, loose);
3697 body += this.renderer.listitem(itemBody, task, checked);
3698 }
3699
3700 out += this.renderer.list(body, ordered, start);
3701 continue;
3702 }
3703 case 'html': {
3704 // TODO parse inline content if parameter markdown=1
3705 out += this.renderer.html(token.text);
3706 continue;
3707 }
3708 case 'paragraph': {
3709 out += this.renderer.paragraph(this.parseInline(token.tokens));
3710 continue;
3711 }
3712 case 'text': {
3713 body = token.tokens ? this.parseInline(token.tokens) : token.text;
3714 while (i + 1 < l && tokens[i + 1].type === 'text') {
3715 token = tokens[++i];
3716 body += '\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);
3717 }
3718 out += top ? this.renderer.paragraph(body) : body;
3719 continue;
3720 }
3721 default: {
3722 var errMsg = 'Token with "' + token.type + '" type was not found.';
3723 if (this.options.silent) {
3724 console.error(errMsg);
3725 return;
3726 } else {
3727 throw new Error(errMsg);
3728 }
3729 }
3730 }
3731 }
3732
3733 return out;
3734 };
3735
3736 /**
3737 * Parse Inline Tokens
3738 */
3739 Parser.prototype.parseInline = function parseInline (tokens, renderer) {
3740 renderer = renderer || this.renderer;
3741 var out = '',
3742 i,
3743 token;
3744
3745 var l = tokens.length;
3746 for (i = 0; i < l; i++) {
3747 token = tokens[i];
3748 switch (token.type) {
3749 case 'escape': {
3750 out += renderer.text(token.text);
3751 break;
3752 }
3753 case 'html': {
3754 out += renderer.html(token.text);
3755 break;
3756 }
3757 case 'link': {
3758 out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));
3759 break;
3760 }
3761 case 'image': {
3762 out += renderer.image(token.href, token.title, token.text);
3763 break;
3764 }
3765 case 'strong': {
3766 out += renderer.strong(this.parseInline(token.tokens, renderer));
3767 break;
3768 }
3769 case 'em': {
3770 out += renderer.em(this.parseInline(token.tokens, renderer));
3771 break;
3772 }
3773 case 'codespan': {
3774 out += renderer.codespan(token.text);
3775 break;
3776 }
3777 case 'br': {
3778 out += renderer.br();
3779 break;
3780 }
3781 case 'del': {
3782 out += renderer.del(this.parseInline(token.tokens, renderer));
3783 break;
3784 }
3785 case 'text': {
3786 out += renderer.text(token.text);
3787 break;
3788 }
3789 default: {
3790 var errMsg = 'Token with "' + token.type + '" type was not found.';
3791 if (this.options.silent) {
3792 console.error(errMsg);
3793 return;
3794 } else {
3795 throw new Error(errMsg);
3796 }
3797 }
3798 }
3799 }
3800 return out;
3801 };
3802
3803 return Parser;
3804 }());
3805
3806 var merge$3 = helpers.merge;
3807 var checkSanitizeDeprecation$1 = helpers.checkSanitizeDeprecation;
3808 var escape$3 = helpers.escape;
3809
3810 var getDefaults = defaults.getDefaults;
3811 var changeDefaults = defaults.changeDefaults;
3812 var defaults$5 = defaults.defaults;
3813
3814 /**
3815 * Marked
3816 */
3817 function marked(src, opt, callback) {
3818 // throw error in case of non string input
3819 if (typeof src === 'undefined' || src === null) {
3820 throw new Error('marked(): input parameter is undefined or null');
3821 }
3822 if (typeof src !== 'string') {
3823 throw new Error('marked(): input parameter is of type '
3824 + Object.prototype.toString.call(src) + ', string expected');
3825 }
3826
3827 if (typeof opt === 'function') {
3828 callback = opt;
3829 opt = null;
3830 }
3831
3832 opt = merge$3({}, marked.defaults, opt || {});
3833 checkSanitizeDeprecation$1(opt);
3834
3835 if (callback) {
3836 var highlight = opt.highlight;
3837 var tokens;
3838
3839 try {
3840 tokens = Lexer.lex(src, opt);
3841 } catch (e) {
3842 return callback(e);
3843 }
3844
3845 var done = function(err) {
3846 var out;
3847
3848 if (!err) {
3849 try {
3850 out = Parser.parse(tokens, opt);
3851 } catch (e) {
3852 err = e;
3853 }
3854 }
3855
3856 opt.highlight = highlight;
3857
3858 return err
3859 ? callback(err)
3860 : callback(null, out);
3861 };
3862
3863 if (!highlight || highlight.length < 3) {
3864 return done();
3865 }
3866
3867 delete opt.highlight;
3868
3869 if (!tokens.length) { return done(); }
3870
3871 var pending = 0;
3872 marked.walkTokens(tokens, function(token) {
3873 if (token.type === 'code') {
3874 pending++;
3875 setTimeout(function () {
3876 highlight(token.text, token.lang, function(err, code) {
3877 if (err) {
3878 return done(err);
3879 }
3880 if (code != null && code !== token.text) {
3881 token.text = code;
3882 token.escaped = true;
3883 }
3884
3885 pending--;
3886 if (pending === 0) {
3887 done();
3888 }
3889 });
3890 }, 0);
3891 }
3892 });
3893
3894 if (pending === 0) {
3895 done();
3896 }
3897
3898 return;
3899 }
3900
3901 try {
3902 var tokens$1 = Lexer.lex(src, opt);
3903 if (opt.walkTokens) {
3904 marked.walkTokens(tokens$1, opt.walkTokens);
3905 }
3906 return Parser.parse(tokens$1, opt);
3907 } catch (e) {
3908 e.message += '\nPlease report this to https://github.com/markedjs/marked.';
3909 if (opt.silent) {
3910 return '<p>An error occurred:</p><pre>'
3911 + escape$3(e.message + '', true)
3912 + '</pre>';
3913 }
3914 throw e;
3915 }
3916 }
3917
3918 /**
3919 * Options
3920 */
3921
3922 marked.options =
3923 marked.setOptions = function(opt) {
3924 merge$3(marked.defaults, opt);
3925 changeDefaults(marked.defaults);
3926 return marked;
3927 };
3928
3929 marked.getDefaults = getDefaults;
3930
3931 marked.defaults = defaults$5;
3932
3933 /**
3934 * Use Extension
3935 */
3936
3937 marked.use = function(extension) {
3938 var opts = merge$3({}, extension);
3939 if (extension.renderer) {
3940 var renderer = marked.defaults.renderer || new Renderer();
3941 var loop = function ( prop ) {
3942 var prevRenderer = renderer[prop];
3943 renderer[prop] = function () {
3944 var args = [], len = arguments.length;
3945 while ( len-- ) args[ len ] = arguments[ len ];
3946
3947 var ret = extension.renderer[prop].apply(renderer, args);
3948 if (ret === false) {
3949 ret = prevRenderer.apply(renderer, args);
3950 }
3951 return ret;
3952 };
3953 };
3954
3955 for (var prop in extension.renderer) loop( prop );
3956 opts.renderer = renderer;
3957 }
3958 if (extension.tokenizer) {
3959 var tokenizer = marked.defaults.tokenizer || new Tokenizer();
3960 var loop$1 = function ( prop ) {
3961 var prevTokenizer = tokenizer[prop$1];
3962 tokenizer[prop$1] = function () {
3963 var args = [], len = arguments.length;
3964 while ( len-- ) args[ len ] = arguments[ len ];
3965
3966 var ret = extension.tokenizer[prop$1].apply(tokenizer, args);
3967 if (ret === false) {
3968 ret = prevTokenizer.apply(tokenizer, args);
3969 }
3970 return ret;
3971 };
3972 };
3973
3974 for (var prop$1 in extension.tokenizer) loop$1( prop );
3975 opts.tokenizer = tokenizer;
3976 }
3977 if (extension.walkTokens) {
3978 var walkTokens = marked.defaults.walkTokens;
3979 opts.walkTokens = function (token) {
3980 extension.walkTokens(token);
3981 if (walkTokens) {
3982 walkTokens(token);
3983 }
3984 };
3985 }
3986 marked.setOptions(opts);
3987 };
3988
3989 /**
3990 * Run callback for every token
3991 */
3992
3993 marked.walkTokens = function(tokens, callback) {
3994 for (var i$3 = 0, list$3 = tokens; i$3 < list$3.length; i$3 += 1) {
3995 var token = list$3[i$3];
3996
3997 callback(token);
3998 switch (token.type) {
3999 case 'table': {
4000 for (var i = 0, list = token.tokens.header; i < list.length; i += 1) {
4001 var cell = list[i];
4002
4003 marked.walkTokens(cell, callback);
4004 }
4005 for (var i$2 = 0, list$2 = token.tokens.cells; i$2 < list$2.length; i$2 += 1) {
4006 var row = list$2[i$2];
4007
4008 for (var i$1 = 0, list$1 = row; i$1 < list$1.length; i$1 += 1) {
4009 var cell$1 = list$1[i$1];
4010
4011 marked.walkTokens(cell$1, callback);
4012 }
4013 }
4014 break;
4015 }
4016 case 'list': {
4017 marked.walkTokens(token.items, callback);
4018 break;
4019 }
4020 default: {
4021 if (token.tokens) {
4022 marked.walkTokens(token.tokens, callback);
4023 }
4024 }
4025 }
4026 }
4027 };
4028
4029 /**
4030 * Parse Inline
4031 */
4032 marked.parseInline = function(src, opt) {
4033 // throw error in case of non string input
4034 if (typeof src === 'undefined' || src === null) {
4035 throw new Error('marked.parseInline(): input parameter is undefined or null');
4036 }
4037 if (typeof src !== 'string') {
4038 throw new Error('marked.parseInline(): input parameter is of type '
4039 + Object.prototype.toString.call(src) + ', string expected');
4040 }
4041
4042 opt = merge$3({}, marked.defaults, opt || {});
4043 checkSanitizeDeprecation$1(opt);
4044
4045 try {
4046 var tokens = Lexer.lexInline(src, opt);
4047 if (opt.walkTokens) {
4048 marked.walkTokens(tokens, opt.walkTokens);
4049 }
4050 return Parser.parseInline(tokens, opt);
4051 } catch (e) {
4052 e.message += '\nPlease report this to https://github.com/markedjs/marked.';
4053 if (opt.silent) {
4054 return '<p>An error occurred:</p><pre>'
4055 + escape$3(e.message + '', true)
4056 + '</pre>';
4057 }
4058 throw e;
4059 }
4060 };
4061
4062 /**
4063 * Expose
4064 */
4065
4066 marked.Parser = Parser;
4067 marked.parser = Parser.parse;
4068
4069 marked.Renderer = Renderer;
4070 marked.TextRenderer = TextRenderer;
4071
4072 marked.Lexer = Lexer;
4073 marked.lexer = Lexer.lex;
4074
4075 marked.Tokenizer = Tokenizer;
4076
4077 marked.Slugger = Slugger;
4078
4079 marked.parse = marked;
4080
4081 var marked_1 = marked;
4082
4083 /**
4084 * Render github corner
4085 * @param {Object} data URL for the View Source on Github link
4086 * @param {String} cornerExternalLinkTarget value of the target attribute of the link
4087 * @return {String} SVG element as string
4088 */
4089 function corner(data, cornerExternalLinkTarget) {
4090 if (!data) {
4091 return '';
4092 }
4093
4094 if (!/\/\//.test(data)) {
4095 data = 'https://github.com/' + data;
4096 }
4097
4098 data = data.replace(/^git\+/, '');
4099 // Double check
4100 cornerExternalLinkTarget = cornerExternalLinkTarget || '_blank';
4101
4102 return (
4103 "<a href=\"" + data + "\" target=\"" + cornerExternalLinkTarget + "\" class=\"github-corner\" aria-label=\"View source on Github\">" +
4104 '<svg viewBox="0 0 250 250" aria-hidden="true">' +
4105 '<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>' +
4106 '<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>' +
4107 '<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>' +
4108 '</svg>' +
4109 '</a>'
4110 );
4111 }
4112
4113 /**
4114 * Renders main content
4115 * @param {Object} config Configuration object
4116 * @returns {String} HTML of the main content
4117 */
4118 function main(config) {
4119 var name = config.name ? config.name : '';
4120
4121 var aside =
4122 '<button class="sidebar-toggle" aria-label="Menu">' +
4123 '<div class="sidebar-toggle-button">' +
4124 '<span></span><span></span><span></span>' +
4125 '</div>' +
4126 '</button>' +
4127 '<aside class="sidebar">' +
4128 (config.name
4129 ? ("<h1 class=\"app-name\"><a class=\"app-name-link\" data-nosearch>" + (config.logo ? ("<img alt=\"" + name + "\" src=" + (config.logo) + ">") : name) + "</a></h1>")
4130 : '') +
4131 '<div class="sidebar-nav"><!--sidebar--></div>' +
4132 '</aside>';
4133 return (
4134 "<main>" + aside +
4135 '<section class="content">' +
4136 '<article class="markdown-section" id="main"><!--main--></article>' +
4137 '</section>' +
4138 '</main>'
4139 );
4140 }
4141
4142 /**
4143 * Cover Page
4144 * @returns {String} Cover page
4145 */
4146 function cover() {
4147 var SL = ', 100%, 85%';
4148 var bgc =
4149 'linear-gradient(to left bottom, ' +
4150 "hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 0%," +
4151 "hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 100%)";
4152
4153 return (
4154 "<section class=\"cover show\" style=\"background: " + bgc + "\">" +
4155 '<div class="mask"></div>' +
4156 '<div class="cover-main"><!--cover--></div>' +
4157 '</section>'
4158 );
4159 }
4160
4161 /**
4162 * Render tree
4163 * @param {Array} toc Array of TOC section links
4164 * @param {String} tpl TPL list
4165 * @return {String} Rendered tree
4166 */
4167 function tree(toc, tpl) {
4168 if ( tpl === void 0 ) tpl = '<ul class="app-sub-sidebar">{inner}</ul>';
4169
4170 if (!toc || !toc.length) {
4171 return '';
4172 }
4173
4174 var innerHTML = '';
4175 toc.forEach(function (node) {
4176 var title = node.title.replace(/(<([^>]+)>)/g, '');
4177 innerHTML += "<li><a class=\"section-link\" href=\"" + (node.slug) + "\" title=\"" + title + "\">" + (node.title) + "</a></li>";
4178 if (node.children) {
4179 innerHTML += tree(node.children, tpl);
4180 }
4181 });
4182 return tpl.replace('{inner}', innerHTML);
4183 }
4184
4185 function helper(className, content) {
4186 return ("<p class=\"" + className + "\">" + (content.slice(5).trim()) + "</p>");
4187 }
4188
4189 function theme(color) {
4190 return ("<style>:root{--theme-color: " + color + ";}</style>");
4191 }
4192
4193 /**
4194 * Gen toc tree
4195 * @link https://github.com/killercup/grock/blob/5280ae63e16c5739e9233d9009bc235ed7d79a50/styles/solarized/assets/js/behavior.coffee#L54-L81
4196 * @param {Array} toc List of TOC elements
4197 * @param {Number} maxLevel Deep level
4198 * @return {Array} Headlines
4199 */
4200 function genTree(toc, maxLevel) {
4201 var headlines = [];
4202 var last = {};
4203
4204 toc.forEach(function (headline) {
4205 var level = headline.level || 1;
4206 var len = level - 1;
4207
4208 if (level > maxLevel) {
4209 return;
4210 }
4211
4212 if (last[len]) {
4213 last[len].children = (last[len].children || []).concat(headline);
4214 } else {
4215 headlines.push(headline);
4216 }
4217
4218 last[level] = headline;
4219 });
4220
4221 return headlines;
4222 }
4223
4224 var cache$1 = {};
4225 var re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g;
4226
4227 function lower(string) {
4228 return string.toLowerCase();
4229 }
4230
4231 function slugify(str) {
4232 if (typeof str !== 'string') {
4233 return '';
4234 }
4235
4236 var slug = str
4237 .trim()
4238 .replace(/[A-Z]+/g, lower)
4239 .replace(/<[^>]+>/g, '')
4240 .replace(re, '')
4241 .replace(/\s/g, '-')
4242 .replace(/-+/g, '-')
4243 .replace(/^(\d)/, '_$1');
4244 var count = cache$1[slug];
4245
4246 count = hasOwn.call(cache$1, slug) ? count + 1 : 0;
4247 cache$1[slug] = count;
4248
4249 if (count) {
4250 slug = slug + '-' + count;
4251 }
4252
4253 return slug;
4254 }
4255
4256 slugify.clear = function () {
4257 cache$1 = {};
4258 };
4259
4260 /* eslint-disable */
4261
4262 // =============================================================================
4263 // DO NOT EDIT: This file is auto-generated by an /build/emoji.js
4264 // =============================================================================
4265
4266 var emojiData = {
4267 "baseURL": "https://github.githubassets.com/images/icons/emoji/",
4268 "data": {
4269 "100": "unicode/1f4af.png?v8",
4270 "1234": "unicode/1f522.png?v8",
4271 "+1": "unicode/1f44d.png?v8",
4272 "-1": "unicode/1f44e.png?v8",
4273 "1st_place_medal": "unicode/1f947.png?v8",
4274 "2nd_place_medal": "unicode/1f948.png?v8",
4275 "3rd_place_medal": "unicode/1f949.png?v8",
4276 "8ball": "unicode/1f3b1.png?v8",
4277 "a": "unicode/1f170.png?v8",
4278 "ab": "unicode/1f18e.png?v8",
4279 "abacus": "unicode/1f9ee.png?v8",
4280 "abc": "unicode/1f524.png?v8",
4281 "abcd": "unicode/1f521.png?v8",
4282 "accept": "unicode/1f251.png?v8",
4283 "accessibility": "accessibility.png?v8",
4284 "accordion": "unicode/1fa97.png?v8",
4285 "adhesive_bandage": "unicode/1fa79.png?v8",
4286 "adult": "unicode/1f9d1.png?v8",
4287 "aerial_tramway": "unicode/1f6a1.png?v8",
4288 "afghanistan": "unicode/1f1e6-1f1eb.png?v8",
4289 "airplane": "unicode/2708.png?v8",
4290 "aland_islands": "unicode/1f1e6-1f1fd.png?v8",
4291 "alarm_clock": "unicode/23f0.png?v8",
4292 "albania": "unicode/1f1e6-1f1f1.png?v8",
4293 "alembic": "unicode/2697.png?v8",
4294 "algeria": "unicode/1f1e9-1f1ff.png?v8",
4295 "alien": "unicode/1f47d.png?v8",
4296 "ambulance": "unicode/1f691.png?v8",
4297 "american_samoa": "unicode/1f1e6-1f1f8.png?v8",
4298 "amphora": "unicode/1f3fa.png?v8",
4299 "anatomical_heart": "unicode/1fac0.png?v8",
4300 "anchor": "unicode/2693.png?v8",
4301 "andorra": "unicode/1f1e6-1f1e9.png?v8",
4302 "angel": "unicode/1f47c.png?v8",
4303 "anger": "unicode/1f4a2.png?v8",
4304 "angola": "unicode/1f1e6-1f1f4.png?v8",
4305 "angry": "unicode/1f620.png?v8",
4306 "anguilla": "unicode/1f1e6-1f1ee.png?v8",
4307 "anguished": "unicode/1f627.png?v8",
4308 "ant": "unicode/1f41c.png?v8",
4309 "antarctica": "unicode/1f1e6-1f1f6.png?v8",
4310 "antigua_barbuda": "unicode/1f1e6-1f1ec.png?v8",
4311 "apple": "unicode/1f34e.png?v8",
4312 "aquarius": "unicode/2652.png?v8",
4313 "argentina": "unicode/1f1e6-1f1f7.png?v8",
4314 "aries": "unicode/2648.png?v8",
4315 "armenia": "unicode/1f1e6-1f1f2.png?v8",
4316 "arrow_backward": "unicode/25c0.png?v8",
4317 "arrow_double_down": "unicode/23ec.png?v8",
4318 "arrow_double_up": "unicode/23eb.png?v8",
4319 "arrow_down": "unicode/2b07.png?v8",
4320 "arrow_down_small": "unicode/1f53d.png?v8",
4321 "arrow_forward": "unicode/25b6.png?v8",
4322 "arrow_heading_down": "unicode/2935.png?v8",
4323 "arrow_heading_up": "unicode/2934.png?v8",
4324 "arrow_left": "unicode/2b05.png?v8",
4325 "arrow_lower_left": "unicode/2199.png?v8",
4326 "arrow_lower_right": "unicode/2198.png?v8",
4327 "arrow_right": "unicode/27a1.png?v8",
4328 "arrow_right_hook": "unicode/21aa.png?v8",
4329 "arrow_up": "unicode/2b06.png?v8",
4330 "arrow_up_down": "unicode/2195.png?v8",
4331 "arrow_up_small": "unicode/1f53c.png?v8",
4332 "arrow_upper_left": "unicode/2196.png?v8",
4333 "arrow_upper_right": "unicode/2197.png?v8",
4334 "arrows_clockwise": "unicode/1f503.png?v8",
4335 "arrows_counterclockwise": "unicode/1f504.png?v8",
4336 "art": "unicode/1f3a8.png?v8",
4337 "articulated_lorry": "unicode/1f69b.png?v8",
4338 "artificial_satellite": "unicode/1f6f0.png?v8",
4339 "artist": "unicode/1f9d1-1f3a8.png?v8",
4340 "aruba": "unicode/1f1e6-1f1fc.png?v8",
4341 "ascension_island": "unicode/1f1e6-1f1e8.png?v8",
4342 "asterisk": "unicode/002a-20e3.png?v8",
4343 "astonished": "unicode/1f632.png?v8",
4344 "astronaut": "unicode/1f9d1-1f680.png?v8",
4345 "athletic_shoe": "unicode/1f45f.png?v8",
4346 "atm": "unicode/1f3e7.png?v8",
4347 "atom": "atom.png?v8",
4348 "atom_symbol": "unicode/269b.png?v8",
4349 "australia": "unicode/1f1e6-1f1fa.png?v8",
4350 "austria": "unicode/1f1e6-1f1f9.png?v8",
4351 "auto_rickshaw": "unicode/1f6fa.png?v8",
4352 "avocado": "unicode/1f951.png?v8",
4353 "axe": "unicode/1fa93.png?v8",
4354 "azerbaijan": "unicode/1f1e6-1f1ff.png?v8",
4355 "b": "unicode/1f171.png?v8",
4356 "baby": "unicode/1f476.png?v8",
4357 "baby_bottle": "unicode/1f37c.png?v8",
4358 "baby_chick": "unicode/1f424.png?v8",
4359 "baby_symbol": "unicode/1f6bc.png?v8",
4360 "back": "unicode/1f519.png?v8",
4361 "bacon": "unicode/1f953.png?v8",
4362 "badger": "unicode/1f9a1.png?v8",
4363 "badminton": "unicode/1f3f8.png?v8",
4364 "bagel": "unicode/1f96f.png?v8",
4365 "baggage_claim": "unicode/1f6c4.png?v8",
4366 "baguette_bread": "unicode/1f956.png?v8",
4367 "bahamas": "unicode/1f1e7-1f1f8.png?v8",
4368 "bahrain": "unicode/1f1e7-1f1ed.png?v8",
4369 "balance_scale": "unicode/2696.png?v8",
4370 "bald_man": "unicode/1f468-1f9b2.png?v8",
4371 "bald_woman": "unicode/1f469-1f9b2.png?v8",
4372 "ballet_shoes": "unicode/1fa70.png?v8",
4373 "balloon": "unicode/1f388.png?v8",
4374 "ballot_box": "unicode/1f5f3.png?v8",
4375 "ballot_box_with_check": "unicode/2611.png?v8",
4376 "bamboo": "unicode/1f38d.png?v8",
4377 "banana": "unicode/1f34c.png?v8",
4378 "bangbang": "unicode/203c.png?v8",
4379 "bangladesh": "unicode/1f1e7-1f1e9.png?v8",
4380 "banjo": "unicode/1fa95.png?v8",
4381 "bank": "unicode/1f3e6.png?v8",
4382 "bar_chart": "unicode/1f4ca.png?v8",
4383 "barbados": "unicode/1f1e7-1f1e7.png?v8",
4384 "barber": "unicode/1f488.png?v8",
4385 "baseball": "unicode/26be.png?v8",
4386 "basecamp": "basecamp.png?v8",
4387 "basecampy": "basecampy.png?v8",
4388 "basket": "unicode/1f9fa.png?v8",
4389 "basketball": "unicode/1f3c0.png?v8",
4390 "basketball_man": "unicode/26f9-2642.png?v8",
4391 "basketball_woman": "unicode/26f9-2640.png?v8",
4392 "bat": "unicode/1f987.png?v8",
4393 "bath": "unicode/1f6c0.png?v8",
4394 "bathtub": "unicode/1f6c1.png?v8",
4395 "battery": "unicode/1f50b.png?v8",
4396 "beach_umbrella": "unicode/1f3d6.png?v8",
4397 "bear": "unicode/1f43b.png?v8",
4398 "bearded_person": "unicode/1f9d4.png?v8",
4399 "beaver": "unicode/1f9ab.png?v8",
4400 "bed": "unicode/1f6cf.png?v8",
4401 "bee": "unicode/1f41d.png?v8",
4402 "beer": "unicode/1f37a.png?v8",
4403 "beers": "unicode/1f37b.png?v8",
4404 "beetle": "unicode/1fab2.png?v8",
4405 "beginner": "unicode/1f530.png?v8",
4406 "belarus": "unicode/1f1e7-1f1fe.png?v8",
4407 "belgium": "unicode/1f1e7-1f1ea.png?v8",
4408 "belize": "unicode/1f1e7-1f1ff.png?v8",
4409 "bell": "unicode/1f514.png?v8",
4410 "bell_pepper": "unicode/1fad1.png?v8",
4411 "bellhop_bell": "unicode/1f6ce.png?v8",
4412 "benin": "unicode/1f1e7-1f1ef.png?v8",
4413 "bento": "unicode/1f371.png?v8",
4414 "bermuda": "unicode/1f1e7-1f1f2.png?v8",
4415 "beverage_box": "unicode/1f9c3.png?v8",
4416 "bhutan": "unicode/1f1e7-1f1f9.png?v8",
4417 "bicyclist": "unicode/1f6b4.png?v8",
4418 "bike": "unicode/1f6b2.png?v8",
4419 "biking_man": "unicode/1f6b4-2642.png?v8",
4420 "biking_woman": "unicode/1f6b4-2640.png?v8",
4421 "bikini": "unicode/1f459.png?v8",
4422 "billed_cap": "unicode/1f9e2.png?v8",
4423 "biohazard": "unicode/2623.png?v8",
4424 "bird": "unicode/1f426.png?v8",
4425 "birthday": "unicode/1f382.png?v8",
4426 "bison": "unicode/1f9ac.png?v8",
4427 "black_cat": "unicode/1f408-2b1b.png?v8",
4428 "black_circle": "unicode/26ab.png?v8",
4429 "black_flag": "unicode/1f3f4.png?v8",
4430 "black_heart": "unicode/1f5a4.png?v8",
4431 "black_joker": "unicode/1f0cf.png?v8",
4432 "black_large_square": "unicode/2b1b.png?v8",
4433 "black_medium_small_square": "unicode/25fe.png?v8",
4434 "black_medium_square": "unicode/25fc.png?v8",
4435 "black_nib": "unicode/2712.png?v8",
4436 "black_small_square": "unicode/25aa.png?v8",
4437 "black_square_button": "unicode/1f532.png?v8",
4438 "blond_haired_man": "unicode/1f471-2642.png?v8",
4439 "blond_haired_person": "unicode/1f471.png?v8",
4440 "blond_haired_woman": "unicode/1f471-2640.png?v8",
4441 "blonde_woman": "unicode/1f471-2640.png?v8",
4442 "blossom": "unicode/1f33c.png?v8",
4443 "blowfish": "unicode/1f421.png?v8",
4444 "blue_book": "unicode/1f4d8.png?v8",
4445 "blue_car": "unicode/1f699.png?v8",
4446 "blue_heart": "unicode/1f499.png?v8",
4447 "blue_square": "unicode/1f7e6.png?v8",
4448 "blueberries": "unicode/1fad0.png?v8",
4449 "blush": "unicode/1f60a.png?v8",
4450 "boar": "unicode/1f417.png?v8",
4451 "boat": "unicode/26f5.png?v8",
4452 "bolivia": "unicode/1f1e7-1f1f4.png?v8",
4453 "bomb": "unicode/1f4a3.png?v8",
4454 "bone": "unicode/1f9b4.png?v8",
4455 "book": "unicode/1f4d6.png?v8",
4456 "bookmark": "unicode/1f516.png?v8",
4457 "bookmark_tabs": "unicode/1f4d1.png?v8",
4458 "books": "unicode/1f4da.png?v8",
4459 "boom": "unicode/1f4a5.png?v8",
4460 "boomerang": "unicode/1fa83.png?v8",
4461 "boot": "unicode/1f462.png?v8",
4462 "bosnia_herzegovina": "unicode/1f1e7-1f1e6.png?v8",
4463 "botswana": "unicode/1f1e7-1f1fc.png?v8",
4464 "bouncing_ball_man": "unicode/26f9-2642.png?v8",
4465 "bouncing_ball_person": "unicode/26f9.png?v8",
4466 "bouncing_ball_woman": "unicode/26f9-2640.png?v8",
4467 "bouquet": "unicode/1f490.png?v8",
4468 "bouvet_island": "unicode/1f1e7-1f1fb.png?v8",
4469 "bow": "unicode/1f647.png?v8",
4470 "bow_and_arrow": "unicode/1f3f9.png?v8",
4471 "bowing_man": "unicode/1f647-2642.png?v8",
4472 "bowing_woman": "unicode/1f647-2640.png?v8",
4473 "bowl_with_spoon": "unicode/1f963.png?v8",
4474 "bowling": "unicode/1f3b3.png?v8",
4475 "bowtie": "bowtie.png?v8",
4476 "boxing_glove": "unicode/1f94a.png?v8",
4477 "boy": "unicode/1f466.png?v8",
4478 "brain": "unicode/1f9e0.png?v8",
4479 "brazil": "unicode/1f1e7-1f1f7.png?v8",
4480 "bread": "unicode/1f35e.png?v8",
4481 "breast_feeding": "unicode/1f931.png?v8",
4482 "bricks": "unicode/1f9f1.png?v8",
4483 "bride_with_veil": "unicode/1f470-2640.png?v8",
4484 "bridge_at_night": "unicode/1f309.png?v8",
4485 "briefcase": "unicode/1f4bc.png?v8",
4486 "british_indian_ocean_territory": "unicode/1f1ee-1f1f4.png?v8",
4487 "british_virgin_islands": "unicode/1f1fb-1f1ec.png?v8",
4488 "broccoli": "unicode/1f966.png?v8",
4489 "broken_heart": "unicode/1f494.png?v8",
4490 "broom": "unicode/1f9f9.png?v8",
4491 "brown_circle": "unicode/1f7e4.png?v8",
4492 "brown_heart": "unicode/1f90e.png?v8",
4493 "brown_square": "unicode/1f7eb.png?v8",
4494 "brunei": "unicode/1f1e7-1f1f3.png?v8",
4495 "bubble_tea": "unicode/1f9cb.png?v8",
4496 "bucket": "unicode/1faa3.png?v8",
4497 "bug": "unicode/1f41b.png?v8",
4498 "building_construction": "unicode/1f3d7.png?v8",
4499 "bulb": "unicode/1f4a1.png?v8",
4500 "bulgaria": "unicode/1f1e7-1f1ec.png?v8",
4501 "bullettrain_front": "unicode/1f685.png?v8",
4502 "bullettrain_side": "unicode/1f684.png?v8",
4503 "burkina_faso": "unicode/1f1e7-1f1eb.png?v8",
4504 "burrito": "unicode/1f32f.png?v8",
4505 "burundi": "unicode/1f1e7-1f1ee.png?v8",
4506 "bus": "unicode/1f68c.png?v8",
4507 "business_suit_levitating": "unicode/1f574.png?v8",
4508 "busstop": "unicode/1f68f.png?v8",
4509 "bust_in_silhouette": "unicode/1f464.png?v8",
4510 "busts_in_silhouette": "unicode/1f465.png?v8",
4511 "butter": "unicode/1f9c8.png?v8",
4512 "butterfly": "unicode/1f98b.png?v8",
4513 "cactus": "unicode/1f335.png?v8",
4514 "cake": "unicode/1f370.png?v8",
4515 "calendar": "unicode/1f4c6.png?v8",
4516 "call_me_hand": "unicode/1f919.png?v8",
4517 "calling": "unicode/1f4f2.png?v8",
4518 "cambodia": "unicode/1f1f0-1f1ed.png?v8",
4519 "camel": "unicode/1f42b.png?v8",
4520 "camera": "unicode/1f4f7.png?v8",
4521 "camera_flash": "unicode/1f4f8.png?v8",
4522 "cameroon": "unicode/1f1e8-1f1f2.png?v8",
4523 "camping": "unicode/1f3d5.png?v8",
4524 "canada": "unicode/1f1e8-1f1e6.png?v8",
4525 "canary_islands": "unicode/1f1ee-1f1e8.png?v8",
4526 "cancer": "unicode/264b.png?v8",
4527 "candle": "unicode/1f56f.png?v8",
4528 "candy": "unicode/1f36c.png?v8",
4529 "canned_food": "unicode/1f96b.png?v8",
4530 "canoe": "unicode/1f6f6.png?v8",
4531 "cape_verde": "unicode/1f1e8-1f1fb.png?v8",
4532 "capital_abcd": "unicode/1f520.png?v8",
4533 "capricorn": "unicode/2651.png?v8",
4534 "car": "unicode/1f697.png?v8",
4535 "card_file_box": "unicode/1f5c3.png?v8",
4536 "card_index": "unicode/1f4c7.png?v8",
4537 "card_index_dividers": "unicode/1f5c2.png?v8",
4538 "caribbean_netherlands": "unicode/1f1e7-1f1f6.png?v8",
4539 "carousel_horse": "unicode/1f3a0.png?v8",
4540 "carpentry_saw": "unicode/1fa9a.png?v8",
4541 "carrot": "unicode/1f955.png?v8",
4542 "cartwheeling": "unicode/1f938.png?v8",
4543 "cat": "unicode/1f431.png?v8",
4544 "cat2": "unicode/1f408.png?v8",
4545 "cayman_islands": "unicode/1f1f0-1f1fe.png?v8",
4546 "cd": "unicode/1f4bf.png?v8",
4547 "central_african_republic": "unicode/1f1e8-1f1eb.png?v8",
4548 "ceuta_melilla": "unicode/1f1ea-1f1e6.png?v8",
4549 "chad": "unicode/1f1f9-1f1e9.png?v8",
4550 "chains": "unicode/26d3.png?v8",
4551 "chair": "unicode/1fa91.png?v8",
4552 "champagne": "unicode/1f37e.png?v8",
4553 "chart": "unicode/1f4b9.png?v8",
4554 "chart_with_downwards_trend": "unicode/1f4c9.png?v8",
4555 "chart_with_upwards_trend": "unicode/1f4c8.png?v8",
4556 "checkered_flag": "unicode/1f3c1.png?v8",
4557 "cheese": "unicode/1f9c0.png?v8",
4558 "cherries": "unicode/1f352.png?v8",
4559 "cherry_blossom": "unicode/1f338.png?v8",
4560 "chess_pawn": "unicode/265f.png?v8",
4561 "chestnut": "unicode/1f330.png?v8",
4562 "chicken": "unicode/1f414.png?v8",
4563 "child": "unicode/1f9d2.png?v8",
4564 "children_crossing": "unicode/1f6b8.png?v8",
4565 "chile": "unicode/1f1e8-1f1f1.png?v8",
4566 "chipmunk": "unicode/1f43f.png?v8",
4567 "chocolate_bar": "unicode/1f36b.png?v8",
4568 "chopsticks": "unicode/1f962.png?v8",
4569 "christmas_island": "unicode/1f1e8-1f1fd.png?v8",
4570 "christmas_tree": "unicode/1f384.png?v8",
4571 "church": "unicode/26ea.png?v8",
4572 "cinema": "unicode/1f3a6.png?v8",
4573 "circus_tent": "unicode/1f3aa.png?v8",
4574 "city_sunrise": "unicode/1f307.png?v8",
4575 "city_sunset": "unicode/1f306.png?v8",
4576 "cityscape": "unicode/1f3d9.png?v8",
4577 "cl": "unicode/1f191.png?v8",
4578 "clamp": "unicode/1f5dc.png?v8",
4579 "clap": "unicode/1f44f.png?v8",
4580 "clapper": "unicode/1f3ac.png?v8",
4581 "classical_building": "unicode/1f3db.png?v8",
4582 "climbing": "unicode/1f9d7.png?v8",
4583 "climbing_man": "unicode/1f9d7-2642.png?v8",
4584 "climbing_woman": "unicode/1f9d7-2640.png?v8",
4585 "clinking_glasses": "unicode/1f942.png?v8",
4586 "clipboard": "unicode/1f4cb.png?v8",
4587 "clipperton_island": "unicode/1f1e8-1f1f5.png?v8",
4588 "clock1": "unicode/1f550.png?v8",
4589 "clock10": "unicode/1f559.png?v8",
4590 "clock1030": "unicode/1f565.png?v8",
4591 "clock11": "unicode/1f55a.png?v8",
4592 "clock1130": "unicode/1f566.png?v8",
4593 "clock12": "unicode/1f55b.png?v8",
4594 "clock1230": "unicode/1f567.png?v8",
4595 "clock130": "unicode/1f55c.png?v8",
4596 "clock2": "unicode/1f551.png?v8",
4597 "clock230": "unicode/1f55d.png?v8",
4598 "clock3": "unicode/1f552.png?v8",
4599 "clock330": "unicode/1f55e.png?v8",
4600 "clock4": "unicode/1f553.png?v8",
4601 "clock430": "unicode/1f55f.png?v8",
4602 "clock5": "unicode/1f554.png?v8",
4603 "clock530": "unicode/1f560.png?v8",
4604 "clock6": "unicode/1f555.png?v8",
4605 "clock630": "unicode/1f561.png?v8",
4606 "clock7": "unicode/1f556.png?v8",
4607 "clock730": "unicode/1f562.png?v8",
4608 "clock8": "unicode/1f557.png?v8",
4609 "clock830": "unicode/1f563.png?v8",
4610 "clock9": "unicode/1f558.png?v8",
4611 "clock930": "unicode/1f564.png?v8",
4612 "closed_book": "unicode/1f4d5.png?v8",
4613 "closed_lock_with_key": "unicode/1f510.png?v8",
4614 "closed_umbrella": "unicode/1f302.png?v8",
4615 "cloud": "unicode/2601.png?v8",
4616 "cloud_with_lightning": "unicode/1f329.png?v8",
4617 "cloud_with_lightning_and_rain": "unicode/26c8.png?v8",
4618 "cloud_with_rain": "unicode/1f327.png?v8",
4619 "cloud_with_snow": "unicode/1f328.png?v8",
4620 "clown_face": "unicode/1f921.png?v8",
4621 "clubs": "unicode/2663.png?v8",
4622 "cn": "unicode/1f1e8-1f1f3.png?v8",
4623 "coat": "unicode/1f9e5.png?v8",
4624 "cockroach": "unicode/1fab3.png?v8",
4625 "cocktail": "unicode/1f378.png?v8",
4626 "coconut": "unicode/1f965.png?v8",
4627 "cocos_islands": "unicode/1f1e8-1f1e8.png?v8",
4628 "coffee": "unicode/2615.png?v8",
4629 "coffin": "unicode/26b0.png?v8",
4630 "coin": "unicode/1fa99.png?v8",
4631 "cold_face": "unicode/1f976.png?v8",
4632 "cold_sweat": "unicode/1f630.png?v8",
4633 "collision": "unicode/1f4a5.png?v8",
4634 "colombia": "unicode/1f1e8-1f1f4.png?v8",
4635 "comet": "unicode/2604.png?v8",
4636 "comoros": "unicode/1f1f0-1f1f2.png?v8",
4637 "compass": "unicode/1f9ed.png?v8",
4638 "computer": "unicode/1f4bb.png?v8",
4639 "computer_mouse": "unicode/1f5b1.png?v8",
4640 "confetti_ball": "unicode/1f38a.png?v8",
4641 "confounded": "unicode/1f616.png?v8",
4642 "confused": "unicode/1f615.png?v8",
4643 "congo_brazzaville": "unicode/1f1e8-1f1ec.png?v8",
4644 "congo_kinshasa": "unicode/1f1e8-1f1e9.png?v8",
4645 "congratulations": "unicode/3297.png?v8",
4646 "construction": "unicode/1f6a7.png?v8",
4647 "construction_worker": "unicode/1f477.png?v8",
4648 "construction_worker_man": "unicode/1f477-2642.png?v8",
4649 "construction_worker_woman": "unicode/1f477-2640.png?v8",
4650 "control_knobs": "unicode/1f39b.png?v8",
4651 "convenience_store": "unicode/1f3ea.png?v8",
4652 "cook": "unicode/1f9d1-1f373.png?v8",
4653 "cook_islands": "unicode/1f1e8-1f1f0.png?v8",
4654 "cookie": "unicode/1f36a.png?v8",
4655 "cool": "unicode/1f192.png?v8",
4656 "cop": "unicode/1f46e.png?v8",
4657 "copyright": "unicode/00a9.png?v8",
4658 "corn": "unicode/1f33d.png?v8",
4659 "costa_rica": "unicode/1f1e8-1f1f7.png?v8",
4660 "cote_divoire": "unicode/1f1e8-1f1ee.png?v8",
4661 "couch_and_lamp": "unicode/1f6cb.png?v8",
4662 "couple": "unicode/1f46b.png?v8",
4663 "couple_with_heart": "unicode/1f491.png?v8",
4664 "couple_with_heart_man_man": "unicode/1f468-2764-1f468.png?v8",
4665 "couple_with_heart_woman_man": "unicode/1f469-2764-1f468.png?v8",
4666 "couple_with_heart_woman_woman": "unicode/1f469-2764-1f469.png?v8",
4667 "couplekiss": "unicode/1f48f.png?v8",
4668 "couplekiss_man_man": "unicode/1f468-2764-1f48b-1f468.png?v8",
4669 "couplekiss_man_woman": "unicode/1f469-2764-1f48b-1f468.png?v8",
4670 "couplekiss_woman_woman": "unicode/1f469-2764-1f48b-1f469.png?v8",
4671 "cow": "unicode/1f42e.png?v8",
4672 "cow2": "unicode/1f404.png?v8",
4673 "cowboy_hat_face": "unicode/1f920.png?v8",
4674 "crab": "unicode/1f980.png?v8",
4675 "crayon": "unicode/1f58d.png?v8",
4676 "credit_card": "unicode/1f4b3.png?v8",
4677 "crescent_moon": "unicode/1f319.png?v8",
4678 "cricket": "unicode/1f997.png?v8",
4679 "cricket_game": "unicode/1f3cf.png?v8",
4680 "croatia": "unicode/1f1ed-1f1f7.png?v8",
4681 "crocodile": "unicode/1f40a.png?v8",
4682 "croissant": "unicode/1f950.png?v8",
4683 "crossed_fingers": "unicode/1f91e.png?v8",
4684 "crossed_flags": "unicode/1f38c.png?v8",
4685 "crossed_swords": "unicode/2694.png?v8",
4686 "crown": "unicode/1f451.png?v8",
4687 "cry": "unicode/1f622.png?v8",
4688 "crying_cat_face": "unicode/1f63f.png?v8",
4689 "crystal_ball": "unicode/1f52e.png?v8",
4690 "cuba": "unicode/1f1e8-1f1fa.png?v8",
4691 "cucumber": "unicode/1f952.png?v8",
4692 "cup_with_straw": "unicode/1f964.png?v8",
4693 "cupcake": "unicode/1f9c1.png?v8",
4694 "cupid": "unicode/1f498.png?v8",
4695 "curacao": "unicode/1f1e8-1f1fc.png?v8",
4696 "curling_stone": "unicode/1f94c.png?v8",
4697 "curly_haired_man": "unicode/1f468-1f9b1.png?v8",
4698 "curly_haired_woman": "unicode/1f469-1f9b1.png?v8",
4699 "curly_loop": "unicode/27b0.png?v8",
4700 "currency_exchange": "unicode/1f4b1.png?v8",
4701 "curry": "unicode/1f35b.png?v8",
4702 "cursing_face": "unicode/1f92c.png?v8",
4703 "custard": "unicode/1f36e.png?v8",
4704 "customs": "unicode/1f6c3.png?v8",
4705 "cut_of_meat": "unicode/1f969.png?v8",
4706 "cyclone": "unicode/1f300.png?v8",
4707 "cyprus": "unicode/1f1e8-1f1fe.png?v8",
4708 "czech_republic": "unicode/1f1e8-1f1ff.png?v8",
4709 "dagger": "unicode/1f5e1.png?v8",
4710 "dancer": "unicode/1f483.png?v8",
4711 "dancers": "unicode/1f46f.png?v8",
4712 "dancing_men": "unicode/1f46f-2642.png?v8",
4713 "dancing_women": "unicode/1f46f-2640.png?v8",
4714 "dango": "unicode/1f361.png?v8",
4715 "dark_sunglasses": "unicode/1f576.png?v8",
4716 "dart": "unicode/1f3af.png?v8",
4717 "dash": "unicode/1f4a8.png?v8",
4718 "date": "unicode/1f4c5.png?v8",
4719 "de": "unicode/1f1e9-1f1ea.png?v8",
4720 "deaf_man": "unicode/1f9cf-2642.png?v8",
4721 "deaf_person": "unicode/1f9cf.png?v8",
4722 "deaf_woman": "unicode/1f9cf-2640.png?v8",
4723 "deciduous_tree": "unicode/1f333.png?v8",
4724 "deer": "unicode/1f98c.png?v8",
4725 "denmark": "unicode/1f1e9-1f1f0.png?v8",
4726 "department_store": "unicode/1f3ec.png?v8",
4727 "dependabot": "dependabot.png?v8",
4728 "derelict_house": "unicode/1f3da.png?v8",
4729 "desert": "unicode/1f3dc.png?v8",
4730 "desert_island": "unicode/1f3dd.png?v8",
4731 "desktop_computer": "unicode/1f5a5.png?v8",
4732 "detective": "unicode/1f575.png?v8",
4733 "diamond_shape_with_a_dot_inside": "unicode/1f4a0.png?v8",
4734 "diamonds": "unicode/2666.png?v8",
4735 "diego_garcia": "unicode/1f1e9-1f1ec.png?v8",
4736 "disappointed": "unicode/1f61e.png?v8",
4737 "disappointed_relieved": "unicode/1f625.png?v8",
4738 "disguised_face": "unicode/1f978.png?v8",
4739 "diving_mask": "unicode/1f93f.png?v8",
4740 "diya_lamp": "unicode/1fa94.png?v8",
4741 "dizzy": "unicode/1f4ab.png?v8",
4742 "dizzy_face": "unicode/1f635.png?v8",
4743 "djibouti": "unicode/1f1e9-1f1ef.png?v8",
4744 "dna": "unicode/1f9ec.png?v8",
4745 "do_not_litter": "unicode/1f6af.png?v8",
4746 "dodo": "unicode/1f9a4.png?v8",
4747 "dog": "unicode/1f436.png?v8",
4748 "dog2": "unicode/1f415.png?v8",
4749 "dollar": "unicode/1f4b5.png?v8",
4750 "dolls": "unicode/1f38e.png?v8",
4751 "dolphin": "unicode/1f42c.png?v8",
4752 "dominica": "unicode/1f1e9-1f1f2.png?v8",
4753 "dominican_republic": "unicode/1f1e9-1f1f4.png?v8",
4754 "door": "unicode/1f6aa.png?v8",
4755 "doughnut": "unicode/1f369.png?v8",
4756 "dove": "unicode/1f54a.png?v8",
4757 "dragon": "unicode/1f409.png?v8",
4758 "dragon_face": "unicode/1f432.png?v8",
4759 "dress": "unicode/1f457.png?v8",
4760 "dromedary_camel": "unicode/1f42a.png?v8",
4761 "drooling_face": "unicode/1f924.png?v8",
4762 "drop_of_blood": "unicode/1fa78.png?v8",
4763 "droplet": "unicode/1f4a7.png?v8",
4764 "drum": "unicode/1f941.png?v8",
4765 "duck": "unicode/1f986.png?v8",
4766 "dumpling": "unicode/1f95f.png?v8",
4767 "dvd": "unicode/1f4c0.png?v8",
4768 "e-mail": "unicode/1f4e7.png?v8",
4769 "eagle": "unicode/1f985.png?v8",
4770 "ear": "unicode/1f442.png?v8",
4771 "ear_of_rice": "unicode/1f33e.png?v8",
4772 "ear_with_hearing_aid": "unicode/1f9bb.png?v8",
4773 "earth_africa": "unicode/1f30d.png?v8",
4774 "earth_americas": "unicode/1f30e.png?v8",
4775 "earth_asia": "unicode/1f30f.png?v8",
4776 "ecuador": "unicode/1f1ea-1f1e8.png?v8",
4777 "egg": "unicode/1f95a.png?v8",
4778 "eggplant": "unicode/1f346.png?v8",
4779 "egypt": "unicode/1f1ea-1f1ec.png?v8",
4780 "eight": "unicode/0038-20e3.png?v8",
4781 "eight_pointed_black_star": "unicode/2734.png?v8",
4782 "eight_spoked_asterisk": "unicode/2733.png?v8",
4783 "eject_button": "unicode/23cf.png?v8",
4784 "el_salvador": "unicode/1f1f8-1f1fb.png?v8",
4785 "electric_plug": "unicode/1f50c.png?v8",
4786 "electron": "electron.png?v8",
4787 "elephant": "unicode/1f418.png?v8",
4788 "elevator": "unicode/1f6d7.png?v8",
4789 "elf": "unicode/1f9dd.png?v8",
4790 "elf_man": "unicode/1f9dd-2642.png?v8",
4791 "elf_woman": "unicode/1f9dd-2640.png?v8",
4792 "email": "unicode/1f4e7.png?v8",
4793 "end": "unicode/1f51a.png?v8",
4794 "england": "unicode/1f3f4-e0067-e0062-e0065-e006e-e0067-e007f.png?v8",
4795 "envelope": "unicode/2709.png?v8",
4796 "envelope_with_arrow": "unicode/1f4e9.png?v8",
4797 "equatorial_guinea": "unicode/1f1ec-1f1f6.png?v8",
4798 "eritrea": "unicode/1f1ea-1f1f7.png?v8",
4799 "es": "unicode/1f1ea-1f1f8.png?v8",
4800 "estonia": "unicode/1f1ea-1f1ea.png?v8",
4801 "ethiopia": "unicode/1f1ea-1f1f9.png?v8",
4802 "eu": "unicode/1f1ea-1f1fa.png?v8",
4803 "euro": "unicode/1f4b6.png?v8",
4804 "european_castle": "unicode/1f3f0.png?v8",
4805 "european_post_office": "unicode/1f3e4.png?v8",
4806 "european_union": "unicode/1f1ea-1f1fa.png?v8",
4807 "evergreen_tree": "unicode/1f332.png?v8",
4808 "exclamation": "unicode/2757.png?v8",
4809 "exploding_head": "unicode/1f92f.png?v8",
4810 "expressionless": "unicode/1f611.png?v8",
4811 "eye": "unicode/1f441.png?v8",
4812 "eye_speech_bubble": "unicode/1f441-1f5e8.png?v8",
4813 "eyeglasses": "unicode/1f453.png?v8",
4814 "eyes": "unicode/1f440.png?v8",
4815 "face_exhaling": "unicode/1f62e-1f4a8.png?v8",
4816 "face_in_clouds": "unicode/1f636-1f32b.png?v8",
4817 "face_with_head_bandage": "unicode/1f915.png?v8",
4818 "face_with_spiral_eyes": "unicode/1f635-1f4ab.png?v8",
4819 "face_with_thermometer": "unicode/1f912.png?v8",
4820 "facepalm": "unicode/1f926.png?v8",
4821 "facepunch": "unicode/1f44a.png?v8",
4822 "factory": "unicode/1f3ed.png?v8",
4823 "factory_worker": "unicode/1f9d1-1f3ed.png?v8",
4824 "fairy": "unicode/1f9da.png?v8",
4825 "fairy_man": "unicode/1f9da-2642.png?v8",
4826 "fairy_woman": "unicode/1f9da-2640.png?v8",
4827 "falafel": "unicode/1f9c6.png?v8",
4828 "falkland_islands": "unicode/1f1eb-1f1f0.png?v8",
4829 "fallen_leaf": "unicode/1f342.png?v8",
4830 "family": "unicode/1f46a.png?v8",
4831 "family_man_boy": "unicode/1f468-1f466.png?v8",
4832 "family_man_boy_boy": "unicode/1f468-1f466-1f466.png?v8",
4833 "family_man_girl": "unicode/1f468-1f467.png?v8",
4834 "family_man_girl_boy": "unicode/1f468-1f467-1f466.png?v8",
4835 "family_man_girl_girl": "unicode/1f468-1f467-1f467.png?v8",
4836 "family_man_man_boy": "unicode/1f468-1f468-1f466.png?v8",
4837 "family_man_man_boy_boy": "unicode/1f468-1f468-1f466-1f466.png?v8",
4838 "family_man_man_girl": "unicode/1f468-1f468-1f467.png?v8",
4839 "family_man_man_girl_boy": "unicode/1f468-1f468-1f467-1f466.png?v8",
4840 "family_man_man_girl_girl": "unicode/1f468-1f468-1f467-1f467.png?v8",
4841 "family_man_woman_boy": "unicode/1f468-1f469-1f466.png?v8",
4842 "family_man_woman_boy_boy": "unicode/1f468-1f469-1f466-1f466.png?v8",
4843 "family_man_woman_girl": "unicode/1f468-1f469-1f467.png?v8",
4844 "family_man_woman_girl_boy": "unicode/1f468-1f469-1f467-1f466.png?v8",
4845 "family_man_woman_girl_girl": "unicode/1f468-1f469-1f467-1f467.png?v8",
4846 "family_woman_boy": "unicode/1f469-1f466.png?v8",
4847 "family_woman_boy_boy": "unicode/1f469-1f466-1f466.png?v8",
4848 "family_woman_girl": "unicode/1f469-1f467.png?v8",
4849 "family_woman_girl_boy": "unicode/1f469-1f467-1f466.png?v8",
4850 "family_woman_girl_girl": "unicode/1f469-1f467-1f467.png?v8",
4851 "family_woman_woman_boy": "unicode/1f469-1f469-1f466.png?v8",
4852 "family_woman_woman_boy_boy": "unicode/1f469-1f469-1f466-1f466.png?v8",
4853 "family_woman_woman_girl": "unicode/1f469-1f469-1f467.png?v8",
4854 "family_woman_woman_girl_boy": "unicode/1f469-1f469-1f467-1f466.png?v8",
4855 "family_woman_woman_girl_girl": "unicode/1f469-1f469-1f467-1f467.png?v8",
4856 "farmer": "unicode/1f9d1-1f33e.png?v8",
4857 "faroe_islands": "unicode/1f1eb-1f1f4.png?v8",
4858 "fast_forward": "unicode/23e9.png?v8",
4859 "fax": "unicode/1f4e0.png?v8",
4860 "fearful": "unicode/1f628.png?v8",
4861 "feather": "unicode/1fab6.png?v8",
4862 "feelsgood": "feelsgood.png?v8",
4863 "feet": "unicode/1f43e.png?v8",
4864 "female_detective": "unicode/1f575-2640.png?v8",
4865 "female_sign": "unicode/2640.png?v8",
4866 "ferris_wheel": "unicode/1f3a1.png?v8",
4867 "ferry": "unicode/26f4.png?v8",
4868 "field_hockey": "unicode/1f3d1.png?v8",
4869 "fiji": "unicode/1f1eb-1f1ef.png?v8",
4870 "file_cabinet": "unicode/1f5c4.png?v8",
4871 "file_folder": "unicode/1f4c1.png?v8",
4872 "film_projector": "unicode/1f4fd.png?v8",
4873 "film_strip": "unicode/1f39e.png?v8",
4874 "finland": "unicode/1f1eb-1f1ee.png?v8",
4875 "finnadie": "finnadie.png?v8",
4876 "fire": "unicode/1f525.png?v8",
4877 "fire_engine": "unicode/1f692.png?v8",
4878 "fire_extinguisher": "unicode/1f9ef.png?v8",
4879 "firecracker": "unicode/1f9e8.png?v8",
4880 "firefighter": "unicode/1f9d1-1f692.png?v8",
4881 "fireworks": "unicode/1f386.png?v8",
4882 "first_quarter_moon": "unicode/1f313.png?v8",
4883 "first_quarter_moon_with_face": "unicode/1f31b.png?v8",
4884 "fish": "unicode/1f41f.png?v8",
4885 "fish_cake": "unicode/1f365.png?v8",
4886 "fishing_pole_and_fish": "unicode/1f3a3.png?v8",
4887 "fishsticks": "fishsticks.png?v8",
4888 "fist": "unicode/270a.png?v8",
4889 "fist_left": "unicode/1f91b.png?v8",
4890 "fist_oncoming": "unicode/1f44a.png?v8",
4891 "fist_raised": "unicode/270a.png?v8",
4892 "fist_right": "unicode/1f91c.png?v8",
4893 "five": "unicode/0035-20e3.png?v8",
4894 "flags": "unicode/1f38f.png?v8",
4895 "flamingo": "unicode/1f9a9.png?v8",
4896 "flashlight": "unicode/1f526.png?v8",
4897 "flat_shoe": "unicode/1f97f.png?v8",
4898 "flatbread": "unicode/1fad3.png?v8",
4899 "fleur_de_lis": "unicode/269c.png?v8",
4900 "flight_arrival": "unicode/1f6ec.png?v8",
4901 "flight_departure": "unicode/1f6eb.png?v8",
4902 "flipper": "unicode/1f42c.png?v8",
4903 "floppy_disk": "unicode/1f4be.png?v8",
4904 "flower_playing_cards": "unicode/1f3b4.png?v8",
4905 "flushed": "unicode/1f633.png?v8",
4906 "fly": "unicode/1fab0.png?v8",
4907 "flying_disc": "unicode/1f94f.png?v8",
4908 "flying_saucer": "unicode/1f6f8.png?v8",
4909 "fog": "unicode/1f32b.png?v8",
4910 "foggy": "unicode/1f301.png?v8",
4911 "fondue": "unicode/1fad5.png?v8",
4912 "foot": "unicode/1f9b6.png?v8",
4913 "football": "unicode/1f3c8.png?v8",
4914 "footprints": "unicode/1f463.png?v8",
4915 "fork_and_knife": "unicode/1f374.png?v8",
4916 "fortune_cookie": "unicode/1f960.png?v8",
4917 "fountain": "unicode/26f2.png?v8",
4918 "fountain_pen": "unicode/1f58b.png?v8",
4919 "four": "unicode/0034-20e3.png?v8",
4920 "four_leaf_clover": "unicode/1f340.png?v8",
4921 "fox_face": "unicode/1f98a.png?v8",
4922 "fr": "unicode/1f1eb-1f1f7.png?v8",
4923 "framed_picture": "unicode/1f5bc.png?v8",
4924 "free": "unicode/1f193.png?v8",
4925 "french_guiana": "unicode/1f1ec-1f1eb.png?v8",
4926 "french_polynesia": "unicode/1f1f5-1f1eb.png?v8",
4927 "french_southern_territories": "unicode/1f1f9-1f1eb.png?v8",
4928 "fried_egg": "unicode/1f373.png?v8",
4929 "fried_shrimp": "unicode/1f364.png?v8",
4930 "fries": "unicode/1f35f.png?v8",
4931 "frog": "unicode/1f438.png?v8",
4932 "frowning": "unicode/1f626.png?v8",
4933 "frowning_face": "unicode/2639.png?v8",
4934 "frowning_man": "unicode/1f64d-2642.png?v8",
4935 "frowning_person": "unicode/1f64d.png?v8",
4936 "frowning_woman": "unicode/1f64d-2640.png?v8",
4937 "fu": "unicode/1f595.png?v8",
4938 "fuelpump": "unicode/26fd.png?v8",
4939 "full_moon": "unicode/1f315.png?v8",
4940 "full_moon_with_face": "unicode/1f31d.png?v8",
4941 "funeral_urn": "unicode/26b1.png?v8",
4942 "gabon": "unicode/1f1ec-1f1e6.png?v8",
4943 "gambia": "unicode/1f1ec-1f1f2.png?v8",
4944 "game_die": "unicode/1f3b2.png?v8",
4945 "garlic": "unicode/1f9c4.png?v8",
4946 "gb": "unicode/1f1ec-1f1e7.png?v8",
4947 "gear": "unicode/2699.png?v8",
4948 "gem": "unicode/1f48e.png?v8",
4949 "gemini": "unicode/264a.png?v8",
4950 "genie": "unicode/1f9de.png?v8",
4951 "genie_man": "unicode/1f9de-2642.png?v8",
4952 "genie_woman": "unicode/1f9de-2640.png?v8",
4953 "georgia": "unicode/1f1ec-1f1ea.png?v8",
4954 "ghana": "unicode/1f1ec-1f1ed.png?v8",
4955 "ghost": "unicode/1f47b.png?v8",
4956 "gibraltar": "unicode/1f1ec-1f1ee.png?v8",
4957 "gift": "unicode/1f381.png?v8",
4958 "gift_heart": "unicode/1f49d.png?v8",
4959 "giraffe": "unicode/1f992.png?v8",
4960 "girl": "unicode/1f467.png?v8",
4961 "globe_with_meridians": "unicode/1f310.png?v8",
4962 "gloves": "unicode/1f9e4.png?v8",
4963 "goal_net": "unicode/1f945.png?v8",
4964 "goat": "unicode/1f410.png?v8",
4965 "goberserk": "goberserk.png?v8",
4966 "godmode": "godmode.png?v8",
4967 "goggles": "unicode/1f97d.png?v8",
4968 "golf": "unicode/26f3.png?v8",
4969 "golfing": "unicode/1f3cc.png?v8",
4970 "golfing_man": "unicode/1f3cc-2642.png?v8",
4971 "golfing_woman": "unicode/1f3cc-2640.png?v8",
4972 "gorilla": "unicode/1f98d.png?v8",
4973 "grapes": "unicode/1f347.png?v8",
4974 "greece": "unicode/1f1ec-1f1f7.png?v8",
4975 "green_apple": "unicode/1f34f.png?v8",
4976 "green_book": "unicode/1f4d7.png?v8",
4977 "green_circle": "unicode/1f7e2.png?v8",
4978 "green_heart": "unicode/1f49a.png?v8",
4979 "green_salad": "unicode/1f957.png?v8",
4980 "green_square": "unicode/1f7e9.png?v8",
4981 "greenland": "unicode/1f1ec-1f1f1.png?v8",
4982 "grenada": "unicode/1f1ec-1f1e9.png?v8",
4983 "grey_exclamation": "unicode/2755.png?v8",
4984 "grey_question": "unicode/2754.png?v8",
4985 "grimacing": "unicode/1f62c.png?v8",
4986 "grin": "unicode/1f601.png?v8",
4987 "grinning": "unicode/1f600.png?v8",
4988 "guadeloupe": "unicode/1f1ec-1f1f5.png?v8",
4989 "guam": "unicode/1f1ec-1f1fa.png?v8",
4990 "guard": "unicode/1f482.png?v8",
4991 "guardsman": "unicode/1f482-2642.png?v8",
4992 "guardswoman": "unicode/1f482-2640.png?v8",
4993 "guatemala": "unicode/1f1ec-1f1f9.png?v8",
4994 "guernsey": "unicode/1f1ec-1f1ec.png?v8",
4995 "guide_dog": "unicode/1f9ae.png?v8",
4996 "guinea": "unicode/1f1ec-1f1f3.png?v8",
4997 "guinea_bissau": "unicode/1f1ec-1f1fc.png?v8",
4998 "guitar": "unicode/1f3b8.png?v8",
4999 "gun": "unicode/1f52b.png?v8",
5000 "guyana": "unicode/1f1ec-1f1fe.png?v8",
5001 "haircut": "unicode/1f487.png?v8",
5002 "haircut_man": "unicode/1f487-2642.png?v8",
5003 "haircut_woman": "unicode/1f487-2640.png?v8",
5004 "haiti": "unicode/1f1ed-1f1f9.png?v8",
5005 "hamburger": "unicode/1f354.png?v8",
5006 "hammer": "unicode/1f528.png?v8",
5007 "hammer_and_pick": "unicode/2692.png?v8",
5008 "hammer_and_wrench": "unicode/1f6e0.png?v8",
5009 "hamster": "unicode/1f439.png?v8",
5010 "hand": "unicode/270b.png?v8",
5011 "hand_over_mouth": "unicode/1f92d.png?v8",
5012 "handbag": "unicode/1f45c.png?v8",
5013 "handball_person": "unicode/1f93e.png?v8",
5014 "handshake": "unicode/1f91d.png?v8",
5015 "hankey": "unicode/1f4a9.png?v8",
5016 "hash": "unicode/0023-20e3.png?v8",
5017 "hatched_chick": "unicode/1f425.png?v8",
5018 "hatching_chick": "unicode/1f423.png?v8",
5019 "headphones": "unicode/1f3a7.png?v8",
5020 "headstone": "unicode/1faa6.png?v8",
5021 "health_worker": "unicode/1f9d1-2695.png?v8",
5022 "hear_no_evil": "unicode/1f649.png?v8",
5023 "heard_mcdonald_islands": "unicode/1f1ed-1f1f2.png?v8",
5024 "heart": "unicode/2764.png?v8",
5025 "heart_decoration": "unicode/1f49f.png?v8",
5026 "heart_eyes": "unicode/1f60d.png?v8",
5027 "heart_eyes_cat": "unicode/1f63b.png?v8",
5028 "heart_on_fire": "unicode/2764-1f525.png?v8",
5029 "heartbeat": "unicode/1f493.png?v8",
5030 "heartpulse": "unicode/1f497.png?v8",
5031 "hearts": "unicode/2665.png?v8",
5032 "heavy_check_mark": "unicode/2714.png?v8",
5033 "heavy_division_sign": "unicode/2797.png?v8",
5034 "heavy_dollar_sign": "unicode/1f4b2.png?v8",
5035 "heavy_exclamation_mark": "unicode/2757.png?v8",
5036 "heavy_heart_exclamation": "unicode/2763.png?v8",
5037 "heavy_minus_sign": "unicode/2796.png?v8",
5038 "heavy_multiplication_x": "unicode/2716.png?v8",
5039 "heavy_plus_sign": "unicode/2795.png?v8",
5040 "hedgehog": "unicode/1f994.png?v8",
5041 "helicopter": "unicode/1f681.png?v8",
5042 "herb": "unicode/1f33f.png?v8",
5043 "hibiscus": "unicode/1f33a.png?v8",
5044 "high_brightness": "unicode/1f506.png?v8",
5045 "high_heel": "unicode/1f460.png?v8",
5046 "hiking_boot": "unicode/1f97e.png?v8",
5047 "hindu_temple": "unicode/1f6d5.png?v8",
5048 "hippopotamus": "unicode/1f99b.png?v8",
5049 "hocho": "unicode/1f52a.png?v8",
5050 "hole": "unicode/1f573.png?v8",
5051 "honduras": "unicode/1f1ed-1f1f3.png?v8",
5052 "honey_pot": "unicode/1f36f.png?v8",
5053 "honeybee": "unicode/1f41d.png?v8",
5054 "hong_kong": "unicode/1f1ed-1f1f0.png?v8",
5055 "hook": "unicode/1fa9d.png?v8",
5056 "horse": "unicode/1f434.png?v8",
5057 "horse_racing": "unicode/1f3c7.png?v8",
5058 "hospital": "unicode/1f3e5.png?v8",
5059 "hot_face": "unicode/1f975.png?v8",
5060 "hot_pepper": "unicode/1f336.png?v8",
5061 "hotdog": "unicode/1f32d.png?v8",
5062 "hotel": "unicode/1f3e8.png?v8",
5063 "hotsprings": "unicode/2668.png?v8",
5064 "hourglass": "unicode/231b.png?v8",
5065 "hourglass_flowing_sand": "unicode/23f3.png?v8",
5066 "house": "unicode/1f3e0.png?v8",
5067 "house_with_garden": "unicode/1f3e1.png?v8",
5068 "houses": "unicode/1f3d8.png?v8",
5069 "hugs": "unicode/1f917.png?v8",
5070 "hungary": "unicode/1f1ed-1f1fa.png?v8",
5071 "hurtrealbad": "hurtrealbad.png?v8",
5072 "hushed": "unicode/1f62f.png?v8",
5073 "hut": "unicode/1f6d6.png?v8",
5074 "ice_cream": "unicode/1f368.png?v8",
5075 "ice_cube": "unicode/1f9ca.png?v8",
5076 "ice_hockey": "unicode/1f3d2.png?v8",
5077 "ice_skate": "unicode/26f8.png?v8",
5078 "icecream": "unicode/1f366.png?v8",
5079 "iceland": "unicode/1f1ee-1f1f8.png?v8",
5080 "id": "unicode/1f194.png?v8",
5081 "ideograph_advantage": "unicode/1f250.png?v8",
5082 "imp": "unicode/1f47f.png?v8",
5083 "inbox_tray": "unicode/1f4e5.png?v8",
5084 "incoming_envelope": "unicode/1f4e8.png?v8",
5085 "india": "unicode/1f1ee-1f1f3.png?v8",
5086 "indonesia": "unicode/1f1ee-1f1e9.png?v8",
5087 "infinity": "unicode/267e.png?v8",
5088 "information_desk_person": "unicode/1f481.png?v8",
5089 "information_source": "unicode/2139.png?v8",
5090 "innocent": "unicode/1f607.png?v8",
5091 "interrobang": "unicode/2049.png?v8",
5092 "iphone": "unicode/1f4f1.png?v8",
5093 "iran": "unicode/1f1ee-1f1f7.png?v8",
5094 "iraq": "unicode/1f1ee-1f1f6.png?v8",
5095 "ireland": "unicode/1f1ee-1f1ea.png?v8",
5096 "isle_of_man": "unicode/1f1ee-1f1f2.png?v8",
5097 "israel": "unicode/1f1ee-1f1f1.png?v8",
5098 "it": "unicode/1f1ee-1f1f9.png?v8",
5099 "izakaya_lantern": "unicode/1f3ee.png?v8",
5100 "jack_o_lantern": "unicode/1f383.png?v8",
5101 "jamaica": "unicode/1f1ef-1f1f2.png?v8",
5102 "japan": "unicode/1f5fe.png?v8",
5103 "japanese_castle": "unicode/1f3ef.png?v8",
5104 "japanese_goblin": "unicode/1f47a.png?v8",
5105 "japanese_ogre": "unicode/1f479.png?v8",
5106 "jeans": "unicode/1f456.png?v8",
5107 "jersey": "unicode/1f1ef-1f1ea.png?v8",
5108 "jigsaw": "unicode/1f9e9.png?v8",
5109 "jordan": "unicode/1f1ef-1f1f4.png?v8",
5110 "joy": "unicode/1f602.png?v8",
5111 "joy_cat": "unicode/1f639.png?v8",
5112 "joystick": "unicode/1f579.png?v8",
5113 "jp": "unicode/1f1ef-1f1f5.png?v8",
5114 "judge": "unicode/1f9d1-2696.png?v8",
5115 "juggling_person": "unicode/1f939.png?v8",
5116 "kaaba": "unicode/1f54b.png?v8",
5117 "kangaroo": "unicode/1f998.png?v8",
5118 "kazakhstan": "unicode/1f1f0-1f1ff.png?v8",
5119 "kenya": "unicode/1f1f0-1f1ea.png?v8",
5120 "key": "unicode/1f511.png?v8",
5121 "keyboard": "unicode/2328.png?v8",
5122 "keycap_ten": "unicode/1f51f.png?v8",
5123 "kick_scooter": "unicode/1f6f4.png?v8",
5124 "kimono": "unicode/1f458.png?v8",
5125 "kiribati": "unicode/1f1f0-1f1ee.png?v8",
5126 "kiss": "unicode/1f48b.png?v8",
5127 "kissing": "unicode/1f617.png?v8",
5128 "kissing_cat": "unicode/1f63d.png?v8",
5129 "kissing_closed_eyes": "unicode/1f61a.png?v8",
5130 "kissing_heart": "unicode/1f618.png?v8",
5131 "kissing_smiling_eyes": "unicode/1f619.png?v8",
5132 "kite": "unicode/1fa81.png?v8",
5133 "kiwi_fruit": "unicode/1f95d.png?v8",
5134 "kneeling_man": "unicode/1f9ce-2642.png?v8",
5135 "kneeling_person": "unicode/1f9ce.png?v8",
5136 "kneeling_woman": "unicode/1f9ce-2640.png?v8",
5137 "knife": "unicode/1f52a.png?v8",
5138 "knot": "unicode/1faa2.png?v8",
5139 "koala": "unicode/1f428.png?v8",
5140 "koko": "unicode/1f201.png?v8",
5141 "kosovo": "unicode/1f1fd-1f1f0.png?v8",
5142 "kr": "unicode/1f1f0-1f1f7.png?v8",
5143 "kuwait": "unicode/1f1f0-1f1fc.png?v8",
5144 "kyrgyzstan": "unicode/1f1f0-1f1ec.png?v8",
5145 "lab_coat": "unicode/1f97c.png?v8",
5146 "label": "unicode/1f3f7.png?v8",
5147 "lacrosse": "unicode/1f94d.png?v8",
5148 "ladder": "unicode/1fa9c.png?v8",
5149 "lady_beetle": "unicode/1f41e.png?v8",
5150 "lantern": "unicode/1f3ee.png?v8",
5151 "laos": "unicode/1f1f1-1f1e6.png?v8",
5152 "large_blue_circle": "unicode/1f535.png?v8",
5153 "large_blue_diamond": "unicode/1f537.png?v8",
5154 "large_orange_diamond": "unicode/1f536.png?v8",
5155 "last_quarter_moon": "unicode/1f317.png?v8",
5156 "last_quarter_moon_with_face": "unicode/1f31c.png?v8",
5157 "latin_cross": "unicode/271d.png?v8",
5158 "latvia": "unicode/1f1f1-1f1fb.png?v8",
5159 "laughing": "unicode/1f606.png?v8",
5160 "leafy_green": "unicode/1f96c.png?v8",
5161 "leaves": "unicode/1f343.png?v8",
5162 "lebanon": "unicode/1f1f1-1f1e7.png?v8",
5163 "ledger": "unicode/1f4d2.png?v8",
5164 "left_luggage": "unicode/1f6c5.png?v8",
5165 "left_right_arrow": "unicode/2194.png?v8",
5166 "left_speech_bubble": "unicode/1f5e8.png?v8",
5167 "leftwards_arrow_with_hook": "unicode/21a9.png?v8",
5168 "leg": "unicode/1f9b5.png?v8",
5169 "lemon": "unicode/1f34b.png?v8",
5170 "leo": "unicode/264c.png?v8",
5171 "leopard": "unicode/1f406.png?v8",
5172 "lesotho": "unicode/1f1f1-1f1f8.png?v8",
5173 "level_slider": "unicode/1f39a.png?v8",
5174 "liberia": "unicode/1f1f1-1f1f7.png?v8",
5175 "libra": "unicode/264e.png?v8",
5176 "libya": "unicode/1f1f1-1f1fe.png?v8",
5177 "liechtenstein": "unicode/1f1f1-1f1ee.png?v8",
5178 "light_rail": "unicode/1f688.png?v8",
5179 "link": "unicode/1f517.png?v8",
5180 "lion": "unicode/1f981.png?v8",
5181 "lips": "unicode/1f444.png?v8",
5182 "lipstick": "unicode/1f484.png?v8",
5183 "lithuania": "unicode/1f1f1-1f1f9.png?v8",
5184 "lizard": "unicode/1f98e.png?v8",
5185 "llama": "unicode/1f999.png?v8",
5186 "lobster": "unicode/1f99e.png?v8",
5187 "lock": "unicode/1f512.png?v8",
5188 "lock_with_ink_pen": "unicode/1f50f.png?v8",
5189 "lollipop": "unicode/1f36d.png?v8",
5190 "long_drum": "unicode/1fa98.png?v8",
5191 "loop": "unicode/27bf.png?v8",
5192 "lotion_bottle": "unicode/1f9f4.png?v8",
5193 "lotus_position": "unicode/1f9d8.png?v8",
5194 "lotus_position_man": "unicode/1f9d8-2642.png?v8",
5195 "lotus_position_woman": "unicode/1f9d8-2640.png?v8",
5196 "loud_sound": "unicode/1f50a.png?v8",
5197 "loudspeaker": "unicode/1f4e2.png?v8",
5198 "love_hotel": "unicode/1f3e9.png?v8",
5199 "love_letter": "unicode/1f48c.png?v8",
5200 "love_you_gesture": "unicode/1f91f.png?v8",
5201 "low_brightness": "unicode/1f505.png?v8",
5202 "luggage": "unicode/1f9f3.png?v8",
5203 "lungs": "unicode/1fac1.png?v8",
5204 "luxembourg": "unicode/1f1f1-1f1fa.png?v8",
5205 "lying_face": "unicode/1f925.png?v8",
5206 "m": "unicode/24c2.png?v8",
5207 "macau": "unicode/1f1f2-1f1f4.png?v8",
5208 "macedonia": "unicode/1f1f2-1f1f0.png?v8",
5209 "madagascar": "unicode/1f1f2-1f1ec.png?v8",
5210 "mag": "unicode/1f50d.png?v8",
5211 "mag_right": "unicode/1f50e.png?v8",
5212 "mage": "unicode/1f9d9.png?v8",
5213 "mage_man": "unicode/1f9d9-2642.png?v8",
5214 "mage_woman": "unicode/1f9d9-2640.png?v8",
5215 "magic_wand": "unicode/1fa84.png?v8",
5216 "magnet": "unicode/1f9f2.png?v8",
5217 "mahjong": "unicode/1f004.png?v8",
5218 "mailbox": "unicode/1f4eb.png?v8",
5219 "mailbox_closed": "unicode/1f4ea.png?v8",
5220 "mailbox_with_mail": "unicode/1f4ec.png?v8",
5221 "mailbox_with_no_mail": "unicode/1f4ed.png?v8",
5222 "malawi": "unicode/1f1f2-1f1fc.png?v8",
5223 "malaysia": "unicode/1f1f2-1f1fe.png?v8",
5224 "maldives": "unicode/1f1f2-1f1fb.png?v8",
5225 "male_detective": "unicode/1f575-2642.png?v8",
5226 "male_sign": "unicode/2642.png?v8",
5227 "mali": "unicode/1f1f2-1f1f1.png?v8",
5228 "malta": "unicode/1f1f2-1f1f9.png?v8",
5229 "mammoth": "unicode/1f9a3.png?v8",
5230 "man": "unicode/1f468.png?v8",
5231 "man_artist": "unicode/1f468-1f3a8.png?v8",
5232 "man_astronaut": "unicode/1f468-1f680.png?v8",
5233 "man_beard": "unicode/1f9d4-2642.png?v8",
5234 "man_cartwheeling": "unicode/1f938-2642.png?v8",
5235 "man_cook": "unicode/1f468-1f373.png?v8",
5236 "man_dancing": "unicode/1f57a.png?v8",
5237 "man_facepalming": "unicode/1f926-2642.png?v8",
5238 "man_factory_worker": "unicode/1f468-1f3ed.png?v8",
5239 "man_farmer": "unicode/1f468-1f33e.png?v8",
5240 "man_feeding_baby": "unicode/1f468-1f37c.png?v8",
5241 "man_firefighter": "unicode/1f468-1f692.png?v8",
5242 "man_health_worker": "unicode/1f468-2695.png?v8",
5243 "man_in_manual_wheelchair": "unicode/1f468-1f9bd.png?v8",
5244 "man_in_motorized_wheelchair": "unicode/1f468-1f9bc.png?v8",
5245 "man_in_tuxedo": "unicode/1f935-2642.png?v8",
5246 "man_judge": "unicode/1f468-2696.png?v8",
5247 "man_juggling": "unicode/1f939-2642.png?v8",
5248 "man_mechanic": "unicode/1f468-1f527.png?v8",
5249 "man_office_worker": "unicode/1f468-1f4bc.png?v8",
5250 "man_pilot": "unicode/1f468-2708.png?v8",
5251 "man_playing_handball": "unicode/1f93e-2642.png?v8",
5252 "man_playing_water_polo": "unicode/1f93d-2642.png?v8",
5253 "man_scientist": "unicode/1f468-1f52c.png?v8",
5254 "man_shrugging": "unicode/1f937-2642.png?v8",
5255 "man_singer": "unicode/1f468-1f3a4.png?v8",
5256 "man_student": "unicode/1f468-1f393.png?v8",
5257 "man_teacher": "unicode/1f468-1f3eb.png?v8",
5258 "man_technologist": "unicode/1f468-1f4bb.png?v8",
5259 "man_with_gua_pi_mao": "unicode/1f472.png?v8",
5260 "man_with_probing_cane": "unicode/1f468-1f9af.png?v8",
5261 "man_with_turban": "unicode/1f473-2642.png?v8",
5262 "man_with_veil": "unicode/1f470-2642.png?v8",
5263 "mandarin": "unicode/1f34a.png?v8",
5264 "mango": "unicode/1f96d.png?v8",
5265 "mans_shoe": "unicode/1f45e.png?v8",
5266 "mantelpiece_clock": "unicode/1f570.png?v8",
5267 "manual_wheelchair": "unicode/1f9bd.png?v8",
5268 "maple_leaf": "unicode/1f341.png?v8",
5269 "marshall_islands": "unicode/1f1f2-1f1ed.png?v8",
5270 "martial_arts_uniform": "unicode/1f94b.png?v8",
5271 "martinique": "unicode/1f1f2-1f1f6.png?v8",
5272 "mask": "unicode/1f637.png?v8",
5273 "massage": "unicode/1f486.png?v8",
5274 "massage_man": "unicode/1f486-2642.png?v8",
5275 "massage_woman": "unicode/1f486-2640.png?v8",
5276 "mate": "unicode/1f9c9.png?v8",
5277 "mauritania": "unicode/1f1f2-1f1f7.png?v8",
5278 "mauritius": "unicode/1f1f2-1f1fa.png?v8",
5279 "mayotte": "unicode/1f1fe-1f1f9.png?v8",
5280 "meat_on_bone": "unicode/1f356.png?v8",
5281 "mechanic": "unicode/1f9d1-1f527.png?v8",
5282 "mechanical_arm": "unicode/1f9be.png?v8",
5283 "mechanical_leg": "unicode/1f9bf.png?v8",
5284 "medal_military": "unicode/1f396.png?v8",
5285 "medal_sports": "unicode/1f3c5.png?v8",
5286 "medical_symbol": "unicode/2695.png?v8",
5287 "mega": "unicode/1f4e3.png?v8",
5288 "melon": "unicode/1f348.png?v8",
5289 "memo": "unicode/1f4dd.png?v8",
5290 "men_wrestling": "unicode/1f93c-2642.png?v8",
5291 "mending_heart": "unicode/2764-1fa79.png?v8",
5292 "menorah": "unicode/1f54e.png?v8",
5293 "mens": "unicode/1f6b9.png?v8",
5294 "mermaid": "unicode/1f9dc-2640.png?v8",
5295 "merman": "unicode/1f9dc-2642.png?v8",
5296 "merperson": "unicode/1f9dc.png?v8",
5297 "metal": "unicode/1f918.png?v8",
5298 "metro": "unicode/1f687.png?v8",
5299 "mexico": "unicode/1f1f2-1f1fd.png?v8",
5300 "microbe": "unicode/1f9a0.png?v8",
5301 "micronesia": "unicode/1f1eb-1f1f2.png?v8",
5302 "microphone": "unicode/1f3a4.png?v8",
5303 "microscope": "unicode/1f52c.png?v8",
5304 "middle_finger": "unicode/1f595.png?v8",
5305 "military_helmet": "unicode/1fa96.png?v8",
5306 "milk_glass": "unicode/1f95b.png?v8",
5307 "milky_way": "unicode/1f30c.png?v8",
5308 "minibus": "unicode/1f690.png?v8",
5309 "minidisc": "unicode/1f4bd.png?v8",
5310 "mirror": "unicode/1fa9e.png?v8",
5311 "mobile_phone_off": "unicode/1f4f4.png?v8",
5312 "moldova": "unicode/1f1f2-1f1e9.png?v8",
5313 "monaco": "unicode/1f1f2-1f1e8.png?v8",
5314 "money_mouth_face": "unicode/1f911.png?v8",
5315 "money_with_wings": "unicode/1f4b8.png?v8",
5316 "moneybag": "unicode/1f4b0.png?v8",
5317 "mongolia": "unicode/1f1f2-1f1f3.png?v8",
5318 "monkey": "unicode/1f412.png?v8",
5319 "monkey_face": "unicode/1f435.png?v8",
5320 "monocle_face": "unicode/1f9d0.png?v8",
5321 "monorail": "unicode/1f69d.png?v8",
5322 "montenegro": "unicode/1f1f2-1f1ea.png?v8",
5323 "montserrat": "unicode/1f1f2-1f1f8.png?v8",
5324 "moon": "unicode/1f314.png?v8",
5325 "moon_cake": "unicode/1f96e.png?v8",
5326 "morocco": "unicode/1f1f2-1f1e6.png?v8",
5327 "mortar_board": "unicode/1f393.png?v8",
5328 "mosque": "unicode/1f54c.png?v8",
5329 "mosquito": "unicode/1f99f.png?v8",
5330 "motor_boat": "unicode/1f6e5.png?v8",
5331 "motor_scooter": "unicode/1f6f5.png?v8",
5332 "motorcycle": "unicode/1f3cd.png?v8",
5333 "motorized_wheelchair": "unicode/1f9bc.png?v8",
5334 "motorway": "unicode/1f6e3.png?v8",
5335 "mount_fuji": "unicode/1f5fb.png?v8",
5336 "mountain": "unicode/26f0.png?v8",
5337 "mountain_bicyclist": "unicode/1f6b5.png?v8",
5338 "mountain_biking_man": "unicode/1f6b5-2642.png?v8",
5339 "mountain_biking_woman": "unicode/1f6b5-2640.png?v8",
5340 "mountain_cableway": "unicode/1f6a0.png?v8",
5341 "mountain_railway": "unicode/1f69e.png?v8",
5342 "mountain_snow": "unicode/1f3d4.png?v8",
5343 "mouse": "unicode/1f42d.png?v8",
5344 "mouse2": "unicode/1f401.png?v8",
5345 "mouse_trap": "unicode/1faa4.png?v8",
5346 "movie_camera": "unicode/1f3a5.png?v8",
5347 "moyai": "unicode/1f5ff.png?v8",
5348 "mozambique": "unicode/1f1f2-1f1ff.png?v8",
5349 "mrs_claus": "unicode/1f936.png?v8",
5350 "muscle": "unicode/1f4aa.png?v8",
5351 "mushroom": "unicode/1f344.png?v8",
5352 "musical_keyboard": "unicode/1f3b9.png?v8",
5353 "musical_note": "unicode/1f3b5.png?v8",
5354 "musical_score": "unicode/1f3bc.png?v8",
5355 "mute": "unicode/1f507.png?v8",
5356 "mx_claus": "unicode/1f9d1-1f384.png?v8",
5357 "myanmar": "unicode/1f1f2-1f1f2.png?v8",
5358 "nail_care": "unicode/1f485.png?v8",
5359 "name_badge": "unicode/1f4db.png?v8",
5360 "namibia": "unicode/1f1f3-1f1e6.png?v8",
5361 "national_park": "unicode/1f3de.png?v8",
5362 "nauru": "unicode/1f1f3-1f1f7.png?v8",
5363 "nauseated_face": "unicode/1f922.png?v8",
5364 "nazar_amulet": "unicode/1f9ff.png?v8",
5365 "neckbeard": "neckbeard.png?v8",
5366 "necktie": "unicode/1f454.png?v8",
5367 "negative_squared_cross_mark": "unicode/274e.png?v8",
5368 "nepal": "unicode/1f1f3-1f1f5.png?v8",
5369 "nerd_face": "unicode/1f913.png?v8",
5370 "nesting_dolls": "unicode/1fa86.png?v8",
5371 "netherlands": "unicode/1f1f3-1f1f1.png?v8",
5372 "neutral_face": "unicode/1f610.png?v8",
5373 "new": "unicode/1f195.png?v8",
5374 "new_caledonia": "unicode/1f1f3-1f1e8.png?v8",
5375 "new_moon": "unicode/1f311.png?v8",
5376 "new_moon_with_face": "unicode/1f31a.png?v8",
5377 "new_zealand": "unicode/1f1f3-1f1ff.png?v8",
5378 "newspaper": "unicode/1f4f0.png?v8",
5379 "newspaper_roll": "unicode/1f5de.png?v8",
5380 "next_track_button": "unicode/23ed.png?v8",
5381 "ng": "unicode/1f196.png?v8",
5382 "ng_man": "unicode/1f645-2642.png?v8",
5383 "ng_woman": "unicode/1f645-2640.png?v8",
5384 "nicaragua": "unicode/1f1f3-1f1ee.png?v8",
5385 "niger": "unicode/1f1f3-1f1ea.png?v8",
5386 "nigeria": "unicode/1f1f3-1f1ec.png?v8",
5387 "night_with_stars": "unicode/1f303.png?v8",
5388 "nine": "unicode/0039-20e3.png?v8",
5389 "ninja": "unicode/1f977.png?v8",
5390 "niue": "unicode/1f1f3-1f1fa.png?v8",
5391 "no_bell": "unicode/1f515.png?v8",
5392 "no_bicycles": "unicode/1f6b3.png?v8",
5393 "no_entry": "unicode/26d4.png?v8",
5394 "no_entry_sign": "unicode/1f6ab.png?v8",
5395 "no_good": "unicode/1f645.png?v8",
5396 "no_good_man": "unicode/1f645-2642.png?v8",
5397 "no_good_woman": "unicode/1f645-2640.png?v8",
5398 "no_mobile_phones": "unicode/1f4f5.png?v8",
5399 "no_mouth": "unicode/1f636.png?v8",
5400 "no_pedestrians": "unicode/1f6b7.png?v8",
5401 "no_smoking": "unicode/1f6ad.png?v8",
5402 "non-potable_water": "unicode/1f6b1.png?v8",
5403 "norfolk_island": "unicode/1f1f3-1f1eb.png?v8",
5404 "north_korea": "unicode/1f1f0-1f1f5.png?v8",
5405 "northern_mariana_islands": "unicode/1f1f2-1f1f5.png?v8",
5406 "norway": "unicode/1f1f3-1f1f4.png?v8",
5407 "nose": "unicode/1f443.png?v8",
5408 "notebook": "unicode/1f4d3.png?v8",
5409 "notebook_with_decorative_cover": "unicode/1f4d4.png?v8",
5410 "notes": "unicode/1f3b6.png?v8",
5411 "nut_and_bolt": "unicode/1f529.png?v8",
5412 "o": "unicode/2b55.png?v8",
5413 "o2": "unicode/1f17e.png?v8",
5414 "ocean": "unicode/1f30a.png?v8",
5415 "octocat": "octocat.png?v8",
5416 "octopus": "unicode/1f419.png?v8",
5417 "oden": "unicode/1f362.png?v8",
5418 "office": "unicode/1f3e2.png?v8",
5419 "office_worker": "unicode/1f9d1-1f4bc.png?v8",
5420 "oil_drum": "unicode/1f6e2.png?v8",
5421 "ok": "unicode/1f197.png?v8",
5422 "ok_hand": "unicode/1f44c.png?v8",
5423 "ok_man": "unicode/1f646-2642.png?v8",
5424 "ok_person": "unicode/1f646.png?v8",
5425 "ok_woman": "unicode/1f646-2640.png?v8",
5426 "old_key": "unicode/1f5dd.png?v8",
5427 "older_adult": "unicode/1f9d3.png?v8",
5428 "older_man": "unicode/1f474.png?v8",
5429 "older_woman": "unicode/1f475.png?v8",
5430 "olive": "unicode/1fad2.png?v8",
5431 "om": "unicode/1f549.png?v8",
5432 "oman": "unicode/1f1f4-1f1f2.png?v8",
5433 "on": "unicode/1f51b.png?v8",
5434 "oncoming_automobile": "unicode/1f698.png?v8",
5435 "oncoming_bus": "unicode/1f68d.png?v8",
5436 "oncoming_police_car": "unicode/1f694.png?v8",
5437 "oncoming_taxi": "unicode/1f696.png?v8",
5438 "one": "unicode/0031-20e3.png?v8",
5439 "one_piece_swimsuit": "unicode/1fa71.png?v8",
5440 "onion": "unicode/1f9c5.png?v8",
5441 "open_book": "unicode/1f4d6.png?v8",
5442 "open_file_folder": "unicode/1f4c2.png?v8",
5443 "open_hands": "unicode/1f450.png?v8",
5444 "open_mouth": "unicode/1f62e.png?v8",
5445 "open_umbrella": "unicode/2602.png?v8",
5446 "ophiuchus": "unicode/26ce.png?v8",
5447 "orange": "unicode/1f34a.png?v8",
5448 "orange_book": "unicode/1f4d9.png?v8",
5449 "orange_circle": "unicode/1f7e0.png?v8",
5450 "orange_heart": "unicode/1f9e1.png?v8",
5451 "orange_square": "unicode/1f7e7.png?v8",
5452 "orangutan": "unicode/1f9a7.png?v8",
5453 "orthodox_cross": "unicode/2626.png?v8",
5454 "otter": "unicode/1f9a6.png?v8",
5455 "outbox_tray": "unicode/1f4e4.png?v8",
5456 "owl": "unicode/1f989.png?v8",
5457 "ox": "unicode/1f402.png?v8",
5458 "oyster": "unicode/1f9aa.png?v8",
5459 "package": "unicode/1f4e6.png?v8",
5460 "page_facing_up": "unicode/1f4c4.png?v8",
5461 "page_with_curl": "unicode/1f4c3.png?v8",
5462 "pager": "unicode/1f4df.png?v8",
5463 "paintbrush": "unicode/1f58c.png?v8",
5464 "pakistan": "unicode/1f1f5-1f1f0.png?v8",
5465 "palau": "unicode/1f1f5-1f1fc.png?v8",
5466 "palestinian_territories": "unicode/1f1f5-1f1f8.png?v8",
5467 "palm_tree": "unicode/1f334.png?v8",
5468 "palms_up_together": "unicode/1f932.png?v8",
5469 "panama": "unicode/1f1f5-1f1e6.png?v8",
5470 "pancakes": "unicode/1f95e.png?v8",
5471 "panda_face": "unicode/1f43c.png?v8",
5472 "paperclip": "unicode/1f4ce.png?v8",
5473 "paperclips": "unicode/1f587.png?v8",
5474 "papua_new_guinea": "unicode/1f1f5-1f1ec.png?v8",
5475 "parachute": "unicode/1fa82.png?v8",
5476 "paraguay": "unicode/1f1f5-1f1fe.png?v8",
5477 "parasol_on_ground": "unicode/26f1.png?v8",
5478 "parking": "unicode/1f17f.png?v8",
5479 "parrot": "unicode/1f99c.png?v8",
5480 "part_alternation_mark": "unicode/303d.png?v8",
5481 "partly_sunny": "unicode/26c5.png?v8",
5482 "partying_face": "unicode/1f973.png?v8",
5483 "passenger_ship": "unicode/1f6f3.png?v8",
5484 "passport_control": "unicode/1f6c2.png?v8",
5485 "pause_button": "unicode/23f8.png?v8",
5486 "paw_prints": "unicode/1f43e.png?v8",
5487 "peace_symbol": "unicode/262e.png?v8",
5488 "peach": "unicode/1f351.png?v8",
5489 "peacock": "unicode/1f99a.png?v8",
5490 "peanuts": "unicode/1f95c.png?v8",
5491 "pear": "unicode/1f350.png?v8",
5492 "pen": "unicode/1f58a.png?v8",
5493 "pencil": "unicode/1f4dd.png?v8",
5494 "pencil2": "unicode/270f.png?v8",
5495 "penguin": "unicode/1f427.png?v8",
5496 "pensive": "unicode/1f614.png?v8",
5497 "people_holding_hands": "unicode/1f9d1-1f91d-1f9d1.png?v8",
5498 "people_hugging": "unicode/1fac2.png?v8",
5499 "performing_arts": "unicode/1f3ad.png?v8",
5500 "persevere": "unicode/1f623.png?v8",
5501 "person_bald": "unicode/1f9d1-1f9b2.png?v8",
5502 "person_curly_hair": "unicode/1f9d1-1f9b1.png?v8",
5503 "person_feeding_baby": "unicode/1f9d1-1f37c.png?v8",
5504 "person_fencing": "unicode/1f93a.png?v8",
5505 "person_in_manual_wheelchair": "unicode/1f9d1-1f9bd.png?v8",
5506 "person_in_motorized_wheelchair": "unicode/1f9d1-1f9bc.png?v8",
5507 "person_in_tuxedo": "unicode/1f935.png?v8",
5508 "person_red_hair": "unicode/1f9d1-1f9b0.png?v8",
5509 "person_white_hair": "unicode/1f9d1-1f9b3.png?v8",
5510 "person_with_probing_cane": "unicode/1f9d1-1f9af.png?v8",
5511 "person_with_turban": "unicode/1f473.png?v8",
5512 "person_with_veil": "unicode/1f470.png?v8",
5513 "peru": "unicode/1f1f5-1f1ea.png?v8",
5514 "petri_dish": "unicode/1f9eb.png?v8",
5515 "philippines": "unicode/1f1f5-1f1ed.png?v8",
5516 "phone": "unicode/260e.png?v8",
5517 "pick": "unicode/26cf.png?v8",
5518 "pickup_truck": "unicode/1f6fb.png?v8",
5519 "pie": "unicode/1f967.png?v8",
5520 "pig": "unicode/1f437.png?v8",
5521 "pig2": "unicode/1f416.png?v8",
5522 "pig_nose": "unicode/1f43d.png?v8",
5523 "pill": "unicode/1f48a.png?v8",
5524 "pilot": "unicode/1f9d1-2708.png?v8",
5525 "pinata": "unicode/1fa85.png?v8",
5526 "pinched_fingers": "unicode/1f90c.png?v8",
5527 "pinching_hand": "unicode/1f90f.png?v8",
5528 "pineapple": "unicode/1f34d.png?v8",
5529 "ping_pong": "unicode/1f3d3.png?v8",
5530 "pirate_flag": "unicode/1f3f4-2620.png?v8",
5531 "pisces": "unicode/2653.png?v8",
5532 "pitcairn_islands": "unicode/1f1f5-1f1f3.png?v8",
5533 "pizza": "unicode/1f355.png?v8",
5534 "placard": "unicode/1faa7.png?v8",
5535 "place_of_worship": "unicode/1f6d0.png?v8",
5536 "plate_with_cutlery": "unicode/1f37d.png?v8",
5537 "play_or_pause_button": "unicode/23ef.png?v8",
5538 "pleading_face": "unicode/1f97a.png?v8",
5539 "plunger": "unicode/1faa0.png?v8",
5540 "point_down": "unicode/1f447.png?v8",
5541 "point_left": "unicode/1f448.png?v8",
5542 "point_right": "unicode/1f449.png?v8",
5543 "point_up": "unicode/261d.png?v8",
5544 "point_up_2": "unicode/1f446.png?v8",
5545 "poland": "unicode/1f1f5-1f1f1.png?v8",
5546 "polar_bear": "unicode/1f43b-2744.png?v8",
5547 "police_car": "unicode/1f693.png?v8",
5548 "police_officer": "unicode/1f46e.png?v8",
5549 "policeman": "unicode/1f46e-2642.png?v8",
5550 "policewoman": "unicode/1f46e-2640.png?v8",
5551 "poodle": "unicode/1f429.png?v8",
5552 "poop": "unicode/1f4a9.png?v8",
5553 "popcorn": "unicode/1f37f.png?v8",
5554 "portugal": "unicode/1f1f5-1f1f9.png?v8",
5555 "post_office": "unicode/1f3e3.png?v8",
5556 "postal_horn": "unicode/1f4ef.png?v8",
5557 "postbox": "unicode/1f4ee.png?v8",
5558 "potable_water": "unicode/1f6b0.png?v8",
5559 "potato": "unicode/1f954.png?v8",
5560 "potted_plant": "unicode/1fab4.png?v8",
5561 "pouch": "unicode/1f45d.png?v8",
5562 "poultry_leg": "unicode/1f357.png?v8",
5563 "pound": "unicode/1f4b7.png?v8",
5564 "pout": "unicode/1f621.png?v8",
5565 "pouting_cat": "unicode/1f63e.png?v8",
5566 "pouting_face": "unicode/1f64e.png?v8",
5567 "pouting_man": "unicode/1f64e-2642.png?v8",
5568 "pouting_woman": "unicode/1f64e-2640.png?v8",
5569 "pray": "unicode/1f64f.png?v8",
5570 "prayer_beads": "unicode/1f4ff.png?v8",
5571 "pregnant_woman": "unicode/1f930.png?v8",
5572 "pretzel": "unicode/1f968.png?v8",
5573 "previous_track_button": "unicode/23ee.png?v8",
5574 "prince": "unicode/1f934.png?v8",
5575 "princess": "unicode/1f478.png?v8",
5576 "printer": "unicode/1f5a8.png?v8",
5577 "probing_cane": "unicode/1f9af.png?v8",
5578 "puerto_rico": "unicode/1f1f5-1f1f7.png?v8",
5579 "punch": "unicode/1f44a.png?v8",
5580 "purple_circle": "unicode/1f7e3.png?v8",
5581 "purple_heart": "unicode/1f49c.png?v8",
5582 "purple_square": "unicode/1f7ea.png?v8",
5583 "purse": "unicode/1f45b.png?v8",
5584 "pushpin": "unicode/1f4cc.png?v8",
5585 "put_litter_in_its_place": "unicode/1f6ae.png?v8",
5586 "qatar": "unicode/1f1f6-1f1e6.png?v8",
5587 "question": "unicode/2753.png?v8",
5588 "rabbit": "unicode/1f430.png?v8",
5589 "rabbit2": "unicode/1f407.png?v8",
5590 "raccoon": "unicode/1f99d.png?v8",
5591 "racehorse": "unicode/1f40e.png?v8",
5592 "racing_car": "unicode/1f3ce.png?v8",
5593 "radio": "unicode/1f4fb.png?v8",
5594 "radio_button": "unicode/1f518.png?v8",
5595 "radioactive": "unicode/2622.png?v8",
5596 "rage": "unicode/1f621.png?v8",
5597 "rage1": "rage1.png?v8",
5598 "rage2": "rage2.png?v8",
5599 "rage3": "rage3.png?v8",
5600 "rage4": "rage4.png?v8",
5601 "railway_car": "unicode/1f683.png?v8",
5602 "railway_track": "unicode/1f6e4.png?v8",
5603 "rainbow": "unicode/1f308.png?v8",
5604 "rainbow_flag": "unicode/1f3f3-1f308.png?v8",
5605 "raised_back_of_hand": "unicode/1f91a.png?v8",
5606 "raised_eyebrow": "unicode/1f928.png?v8",
5607 "raised_hand": "unicode/270b.png?v8",
5608 "raised_hand_with_fingers_splayed": "unicode/1f590.png?v8",
5609 "raised_hands": "unicode/1f64c.png?v8",
5610 "raising_hand": "unicode/1f64b.png?v8",
5611 "raising_hand_man": "unicode/1f64b-2642.png?v8",
5612 "raising_hand_woman": "unicode/1f64b-2640.png?v8",
5613 "ram": "unicode/1f40f.png?v8",
5614 "ramen": "unicode/1f35c.png?v8",
5615 "rat": "unicode/1f400.png?v8",
5616 "razor": "unicode/1fa92.png?v8",
5617 "receipt": "unicode/1f9fe.png?v8",
5618 "record_button": "unicode/23fa.png?v8",
5619 "recycle": "unicode/267b.png?v8",
5620 "red_car": "unicode/1f697.png?v8",
5621 "red_circle": "unicode/1f534.png?v8",
5622 "red_envelope": "unicode/1f9e7.png?v8",
5623 "red_haired_man": "unicode/1f468-1f9b0.png?v8",
5624 "red_haired_woman": "unicode/1f469-1f9b0.png?v8",
5625 "red_square": "unicode/1f7e5.png?v8",
5626 "registered": "unicode/00ae.png?v8",
5627 "relaxed": "unicode/263a.png?v8",
5628 "relieved": "unicode/1f60c.png?v8",
5629 "reminder_ribbon": "unicode/1f397.png?v8",
5630 "repeat": "unicode/1f501.png?v8",
5631 "repeat_one": "unicode/1f502.png?v8",
5632 "rescue_worker_helmet": "unicode/26d1.png?v8",
5633 "restroom": "unicode/1f6bb.png?v8",
5634 "reunion": "unicode/1f1f7-1f1ea.png?v8",
5635 "revolving_hearts": "unicode/1f49e.png?v8",
5636 "rewind": "unicode/23ea.png?v8",
5637 "rhinoceros": "unicode/1f98f.png?v8",
5638 "ribbon": "unicode/1f380.png?v8",
5639 "rice": "unicode/1f35a.png?v8",
5640 "rice_ball": "unicode/1f359.png?v8",
5641 "rice_cracker": "unicode/1f358.png?v8",
5642 "rice_scene": "unicode/1f391.png?v8",
5643 "right_anger_bubble": "unicode/1f5ef.png?v8",
5644 "ring": "unicode/1f48d.png?v8",
5645 "ringed_planet": "unicode/1fa90.png?v8",
5646 "robot": "unicode/1f916.png?v8",
5647 "rock": "unicode/1faa8.png?v8",
5648 "rocket": "unicode/1f680.png?v8",
5649 "rofl": "unicode/1f923.png?v8",
5650 "roll_eyes": "unicode/1f644.png?v8",
5651 "roll_of_paper": "unicode/1f9fb.png?v8",
5652 "roller_coaster": "unicode/1f3a2.png?v8",
5653 "roller_skate": "unicode/1f6fc.png?v8",
5654 "romania": "unicode/1f1f7-1f1f4.png?v8",
5655 "rooster": "unicode/1f413.png?v8",
5656 "rose": "unicode/1f339.png?v8",
5657 "rosette": "unicode/1f3f5.png?v8",
5658 "rotating_light": "unicode/1f6a8.png?v8",
5659 "round_pushpin": "unicode/1f4cd.png?v8",
5660 "rowboat": "unicode/1f6a3.png?v8",
5661 "rowing_man": "unicode/1f6a3-2642.png?v8",
5662 "rowing_woman": "unicode/1f6a3-2640.png?v8",
5663 "ru": "unicode/1f1f7-1f1fa.png?v8",
5664 "rugby_football": "unicode/1f3c9.png?v8",
5665 "runner": "unicode/1f3c3.png?v8",
5666 "running": "unicode/1f3c3.png?v8",
5667 "running_man": "unicode/1f3c3-2642.png?v8",
5668 "running_shirt_with_sash": "unicode/1f3bd.png?v8",
5669 "running_woman": "unicode/1f3c3-2640.png?v8",
5670 "rwanda": "unicode/1f1f7-1f1fc.png?v8",
5671 "sa": "unicode/1f202.png?v8",
5672 "safety_pin": "unicode/1f9f7.png?v8",
5673 "safety_vest": "unicode/1f9ba.png?v8",
5674 "sagittarius": "unicode/2650.png?v8",
5675 "sailboat": "unicode/26f5.png?v8",
5676 "sake": "unicode/1f376.png?v8",
5677 "salt": "unicode/1f9c2.png?v8",
5678 "samoa": "unicode/1f1fc-1f1f8.png?v8",
5679 "san_marino": "unicode/1f1f8-1f1f2.png?v8",
5680 "sandal": "unicode/1f461.png?v8",
5681 "sandwich": "unicode/1f96a.png?v8",
5682 "santa": "unicode/1f385.png?v8",
5683 "sao_tome_principe": "unicode/1f1f8-1f1f9.png?v8",
5684 "sari": "unicode/1f97b.png?v8",
5685 "sassy_man": "unicode/1f481-2642.png?v8",
5686 "sassy_woman": "unicode/1f481-2640.png?v8",
5687 "satellite": "unicode/1f4e1.png?v8",
5688 "satisfied": "unicode/1f606.png?v8",
5689 "saudi_arabia": "unicode/1f1f8-1f1e6.png?v8",
5690 "sauna_man": "unicode/1f9d6-2642.png?v8",
5691 "sauna_person": "unicode/1f9d6.png?v8",
5692 "sauna_woman": "unicode/1f9d6-2640.png?v8",
5693 "sauropod": "unicode/1f995.png?v8",
5694 "saxophone": "unicode/1f3b7.png?v8",
5695 "scarf": "unicode/1f9e3.png?v8",
5696 "school": "unicode/1f3eb.png?v8",
5697 "school_satchel": "unicode/1f392.png?v8",
5698 "scientist": "unicode/1f9d1-1f52c.png?v8",
5699 "scissors": "unicode/2702.png?v8",
5700 "scorpion": "unicode/1f982.png?v8",
5701 "scorpius": "unicode/264f.png?v8",
5702 "scotland": "unicode/1f3f4-e0067-e0062-e0073-e0063-e0074-e007f.png?v8",
5703 "scream": "unicode/1f631.png?v8",
5704 "scream_cat": "unicode/1f640.png?v8",
5705 "screwdriver": "unicode/1fa9b.png?v8",
5706 "scroll": "unicode/1f4dc.png?v8",
5707 "seal": "unicode/1f9ad.png?v8",
5708 "seat": "unicode/1f4ba.png?v8",
5709 "secret": "unicode/3299.png?v8",
5710 "see_no_evil": "unicode/1f648.png?v8",
5711 "seedling": "unicode/1f331.png?v8",
5712 "selfie": "unicode/1f933.png?v8",
5713 "senegal": "unicode/1f1f8-1f1f3.png?v8",
5714 "serbia": "unicode/1f1f7-1f1f8.png?v8",
5715 "service_dog": "unicode/1f415-1f9ba.png?v8",
5716 "seven": "unicode/0037-20e3.png?v8",
5717 "sewing_needle": "unicode/1faa1.png?v8",
5718 "seychelles": "unicode/1f1f8-1f1e8.png?v8",
5719 "shallow_pan_of_food": "unicode/1f958.png?v8",
5720 "shamrock": "unicode/2618.png?v8",
5721 "shark": "unicode/1f988.png?v8",
5722 "shaved_ice": "unicode/1f367.png?v8",
5723 "sheep": "unicode/1f411.png?v8",
5724 "shell": "unicode/1f41a.png?v8",
5725 "shield": "unicode/1f6e1.png?v8",
5726 "shinto_shrine": "unicode/26e9.png?v8",
5727 "ship": "unicode/1f6a2.png?v8",
5728 "shipit": "shipit.png?v8",
5729 "shirt": "unicode/1f455.png?v8",
5730 "shit": "unicode/1f4a9.png?v8",
5731 "shoe": "unicode/1f45e.png?v8",
5732 "shopping": "unicode/1f6cd.png?v8",
5733 "shopping_cart": "unicode/1f6d2.png?v8",
5734 "shorts": "unicode/1fa73.png?v8",
5735 "shower": "unicode/1f6bf.png?v8",
5736 "shrimp": "unicode/1f990.png?v8",
5737 "shrug": "unicode/1f937.png?v8",
5738 "shushing_face": "unicode/1f92b.png?v8",
5739 "sierra_leone": "unicode/1f1f8-1f1f1.png?v8",
5740 "signal_strength": "unicode/1f4f6.png?v8",
5741 "singapore": "unicode/1f1f8-1f1ec.png?v8",
5742 "singer": "unicode/1f9d1-1f3a4.png?v8",
5743 "sint_maarten": "unicode/1f1f8-1f1fd.png?v8",
5744 "six": "unicode/0036-20e3.png?v8",
5745 "six_pointed_star": "unicode/1f52f.png?v8",
5746 "skateboard": "unicode/1f6f9.png?v8",
5747 "ski": "unicode/1f3bf.png?v8",
5748 "skier": "unicode/26f7.png?v8",
5749 "skull": "unicode/1f480.png?v8",
5750 "skull_and_crossbones": "unicode/2620.png?v8",
5751 "skunk": "unicode/1f9a8.png?v8",
5752 "sled": "unicode/1f6f7.png?v8",
5753 "sleeping": "unicode/1f634.png?v8",
5754 "sleeping_bed": "unicode/1f6cc.png?v8",
5755 "sleepy": "unicode/1f62a.png?v8",
5756 "slightly_frowning_face": "unicode/1f641.png?v8",
5757 "slightly_smiling_face": "unicode/1f642.png?v8",
5758 "slot_machine": "unicode/1f3b0.png?v8",
5759 "sloth": "unicode/1f9a5.png?v8",
5760 "slovakia": "unicode/1f1f8-1f1f0.png?v8",
5761 "slovenia": "unicode/1f1f8-1f1ee.png?v8",
5762 "small_airplane": "unicode/1f6e9.png?v8",
5763 "small_blue_diamond": "unicode/1f539.png?v8",
5764 "small_orange_diamond": "unicode/1f538.png?v8",
5765 "small_red_triangle": "unicode/1f53a.png?v8",
5766 "small_red_triangle_down": "unicode/1f53b.png?v8",
5767 "smile": "unicode/1f604.png?v8",
5768 "smile_cat": "unicode/1f638.png?v8",
5769 "smiley": "unicode/1f603.png?v8",
5770 "smiley_cat": "unicode/1f63a.png?v8",
5771 "smiling_face_with_tear": "unicode/1f972.png?v8",
5772 "smiling_face_with_three_hearts": "unicode/1f970.png?v8",
5773 "smiling_imp": "unicode/1f608.png?v8",
5774 "smirk": "unicode/1f60f.png?v8",
5775 "smirk_cat": "unicode/1f63c.png?v8",
5776 "smoking": "unicode/1f6ac.png?v8",
5777 "snail": "unicode/1f40c.png?v8",
5778 "snake": "unicode/1f40d.png?v8",
5779 "sneezing_face": "unicode/1f927.png?v8",
5780 "snowboarder": "unicode/1f3c2.png?v8",
5781 "snowflake": "unicode/2744.png?v8",
5782 "snowman": "unicode/26c4.png?v8",
5783 "snowman_with_snow": "unicode/2603.png?v8",
5784 "soap": "unicode/1f9fc.png?v8",
5785 "sob": "unicode/1f62d.png?v8",
5786 "soccer": "unicode/26bd.png?v8",
5787 "socks": "unicode/1f9e6.png?v8",
5788 "softball": "unicode/1f94e.png?v8",
5789 "solomon_islands": "unicode/1f1f8-1f1e7.png?v8",
5790 "somalia": "unicode/1f1f8-1f1f4.png?v8",
5791 "soon": "unicode/1f51c.png?v8",
5792 "sos": "unicode/1f198.png?v8",
5793 "sound": "unicode/1f509.png?v8",
5794 "south_africa": "unicode/1f1ff-1f1e6.png?v8",
5795 "south_georgia_south_sandwich_islands": "unicode/1f1ec-1f1f8.png?v8",
5796 "south_sudan": "unicode/1f1f8-1f1f8.png?v8",
5797 "space_invader": "unicode/1f47e.png?v8",
5798 "spades": "unicode/2660.png?v8",
5799 "spaghetti": "unicode/1f35d.png?v8",
5800 "sparkle": "unicode/2747.png?v8",
5801 "sparkler": "unicode/1f387.png?v8",
5802 "sparkles": "unicode/2728.png?v8",
5803 "sparkling_heart": "unicode/1f496.png?v8",
5804 "speak_no_evil": "unicode/1f64a.png?v8",
5805 "speaker": "unicode/1f508.png?v8",
5806 "speaking_head": "unicode/1f5e3.png?v8",
5807 "speech_balloon": "unicode/1f4ac.png?v8",
5808 "speedboat": "unicode/1f6a4.png?v8",
5809 "spider": "unicode/1f577.png?v8",
5810 "spider_web": "unicode/1f578.png?v8",
5811 "spiral_calendar": "unicode/1f5d3.png?v8",
5812 "spiral_notepad": "unicode/1f5d2.png?v8",
5813 "sponge": "unicode/1f9fd.png?v8",
5814 "spoon": "unicode/1f944.png?v8",
5815 "squid": "unicode/1f991.png?v8",
5816 "sri_lanka": "unicode/1f1f1-1f1f0.png?v8",
5817 "st_barthelemy": "unicode/1f1e7-1f1f1.png?v8",
5818 "st_helena": "unicode/1f1f8-1f1ed.png?v8",
5819 "st_kitts_nevis": "unicode/1f1f0-1f1f3.png?v8",
5820 "st_lucia": "unicode/1f1f1-1f1e8.png?v8",
5821 "st_martin": "unicode/1f1f2-1f1eb.png?v8",
5822 "st_pierre_miquelon": "unicode/1f1f5-1f1f2.png?v8",
5823 "st_vincent_grenadines": "unicode/1f1fb-1f1e8.png?v8",
5824 "stadium": "unicode/1f3df.png?v8",
5825 "standing_man": "unicode/1f9cd-2642.png?v8",
5826 "standing_person": "unicode/1f9cd.png?v8",
5827 "standing_woman": "unicode/1f9cd-2640.png?v8",
5828 "star": "unicode/2b50.png?v8",
5829 "star2": "unicode/1f31f.png?v8",
5830 "star_and_crescent": "unicode/262a.png?v8",
5831 "star_of_david": "unicode/2721.png?v8",
5832 "star_struck": "unicode/1f929.png?v8",
5833 "stars": "unicode/1f320.png?v8",
5834 "station": "unicode/1f689.png?v8",
5835 "statue_of_liberty": "unicode/1f5fd.png?v8",
5836 "steam_locomotive": "unicode/1f682.png?v8",
5837 "stethoscope": "unicode/1fa7a.png?v8",
5838 "stew": "unicode/1f372.png?v8",
5839 "stop_button": "unicode/23f9.png?v8",
5840 "stop_sign": "unicode/1f6d1.png?v8",
5841 "stopwatch": "unicode/23f1.png?v8",
5842 "straight_ruler": "unicode/1f4cf.png?v8",
5843 "strawberry": "unicode/1f353.png?v8",
5844 "stuck_out_tongue": "unicode/1f61b.png?v8",
5845 "stuck_out_tongue_closed_eyes": "unicode/1f61d.png?v8",
5846 "stuck_out_tongue_winking_eye": "unicode/1f61c.png?v8",
5847 "student": "unicode/1f9d1-1f393.png?v8",
5848 "studio_microphone": "unicode/1f399.png?v8",
5849 "stuffed_flatbread": "unicode/1f959.png?v8",
5850 "sudan": "unicode/1f1f8-1f1e9.png?v8",
5851 "sun_behind_large_cloud": "unicode/1f325.png?v8",
5852 "sun_behind_rain_cloud": "unicode/1f326.png?v8",
5853 "sun_behind_small_cloud": "unicode/1f324.png?v8",
5854 "sun_with_face": "unicode/1f31e.png?v8",
5855 "sunflower": "unicode/1f33b.png?v8",
5856 "sunglasses": "unicode/1f60e.png?v8",
5857 "sunny": "unicode/2600.png?v8",
5858 "sunrise": "unicode/1f305.png?v8",
5859 "sunrise_over_mountains": "unicode/1f304.png?v8",
5860 "superhero": "unicode/1f9b8.png?v8",
5861 "superhero_man": "unicode/1f9b8-2642.png?v8",
5862 "superhero_woman": "unicode/1f9b8-2640.png?v8",
5863 "supervillain": "unicode/1f9b9.png?v8",
5864 "supervillain_man": "unicode/1f9b9-2642.png?v8",
5865 "supervillain_woman": "unicode/1f9b9-2640.png?v8",
5866 "surfer": "unicode/1f3c4.png?v8",
5867 "surfing_man": "unicode/1f3c4-2642.png?v8",
5868 "surfing_woman": "unicode/1f3c4-2640.png?v8",
5869 "suriname": "unicode/1f1f8-1f1f7.png?v8",
5870 "sushi": "unicode/1f363.png?v8",
5871 "suspect": "suspect.png?v8",
5872 "suspension_railway": "unicode/1f69f.png?v8",
5873 "svalbard_jan_mayen": "unicode/1f1f8-1f1ef.png?v8",
5874 "swan": "unicode/1f9a2.png?v8",
5875 "swaziland": "unicode/1f1f8-1f1ff.png?v8",
5876 "sweat": "unicode/1f613.png?v8",
5877 "sweat_drops": "unicode/1f4a6.png?v8",
5878 "sweat_smile": "unicode/1f605.png?v8",
5879 "sweden": "unicode/1f1f8-1f1ea.png?v8",
5880 "sweet_potato": "unicode/1f360.png?v8",
5881 "swim_brief": "unicode/1fa72.png?v8",
5882 "swimmer": "unicode/1f3ca.png?v8",
5883 "swimming_man": "unicode/1f3ca-2642.png?v8",
5884 "swimming_woman": "unicode/1f3ca-2640.png?v8",
5885 "switzerland": "unicode/1f1e8-1f1ed.png?v8",
5886 "symbols": "unicode/1f523.png?v8",
5887 "synagogue": "unicode/1f54d.png?v8",
5888 "syria": "unicode/1f1f8-1f1fe.png?v8",
5889 "syringe": "unicode/1f489.png?v8",
5890 "t-rex": "unicode/1f996.png?v8",
5891 "taco": "unicode/1f32e.png?v8",
5892 "tada": "unicode/1f389.png?v8",
5893 "taiwan": "unicode/1f1f9-1f1fc.png?v8",
5894 "tajikistan": "unicode/1f1f9-1f1ef.png?v8",
5895 "takeout_box": "unicode/1f961.png?v8",
5896 "tamale": "unicode/1fad4.png?v8",
5897 "tanabata_tree": "unicode/1f38b.png?v8",
5898 "tangerine": "unicode/1f34a.png?v8",
5899 "tanzania": "unicode/1f1f9-1f1ff.png?v8",
5900 "taurus": "unicode/2649.png?v8",
5901 "taxi": "unicode/1f695.png?v8",
5902 "tea": "unicode/1f375.png?v8",
5903 "teacher": "unicode/1f9d1-1f3eb.png?v8",
5904 "teapot": "unicode/1fad6.png?v8",
5905 "technologist": "unicode/1f9d1-1f4bb.png?v8",
5906 "teddy_bear": "unicode/1f9f8.png?v8",
5907 "telephone": "unicode/260e.png?v8",
5908 "telephone_receiver": "unicode/1f4de.png?v8",
5909 "telescope": "unicode/1f52d.png?v8",
5910 "tennis": "unicode/1f3be.png?v8",
5911 "tent": "unicode/26fa.png?v8",
5912 "test_tube": "unicode/1f9ea.png?v8",
5913 "thailand": "unicode/1f1f9-1f1ed.png?v8",
5914 "thermometer": "unicode/1f321.png?v8",
5915 "thinking": "unicode/1f914.png?v8",
5916 "thong_sandal": "unicode/1fa74.png?v8",
5917 "thought_balloon": "unicode/1f4ad.png?v8",
5918 "thread": "unicode/1f9f5.png?v8",
5919 "three": "unicode/0033-20e3.png?v8",
5920 "thumbsdown": "unicode/1f44e.png?v8",
5921 "thumbsup": "unicode/1f44d.png?v8",
5922 "ticket": "unicode/1f3ab.png?v8",
5923 "tickets": "unicode/1f39f.png?v8",
5924 "tiger": "unicode/1f42f.png?v8",
5925 "tiger2": "unicode/1f405.png?v8",
5926 "timer_clock": "unicode/23f2.png?v8",
5927 "timor_leste": "unicode/1f1f9-1f1f1.png?v8",
5928 "tipping_hand_man": "unicode/1f481-2642.png?v8",
5929 "tipping_hand_person": "unicode/1f481.png?v8",
5930 "tipping_hand_woman": "unicode/1f481-2640.png?v8",
5931 "tired_face": "unicode/1f62b.png?v8",
5932 "tm": "unicode/2122.png?v8",
5933 "togo": "unicode/1f1f9-1f1ec.png?v8",
5934 "toilet": "unicode/1f6bd.png?v8",
5935 "tokelau": "unicode/1f1f9-1f1f0.png?v8",
5936 "tokyo_tower": "unicode/1f5fc.png?v8",
5937 "tomato": "unicode/1f345.png?v8",
5938 "tonga": "unicode/1f1f9-1f1f4.png?v8",
5939 "tongue": "unicode/1f445.png?v8",
5940 "toolbox": "unicode/1f9f0.png?v8",
5941 "tooth": "unicode/1f9b7.png?v8",
5942 "toothbrush": "unicode/1faa5.png?v8",
5943 "top": "unicode/1f51d.png?v8",
5944 "tophat": "unicode/1f3a9.png?v8",
5945 "tornado": "unicode/1f32a.png?v8",
5946 "tr": "unicode/1f1f9-1f1f7.png?v8",
5947 "trackball": "unicode/1f5b2.png?v8",
5948 "tractor": "unicode/1f69c.png?v8",
5949 "traffic_light": "unicode/1f6a5.png?v8",
5950 "train": "unicode/1f68b.png?v8",
5951 "train2": "unicode/1f686.png?v8",
5952 "tram": "unicode/1f68a.png?v8",
5953 "transgender_flag": "unicode/1f3f3-26a7.png?v8",
5954 "transgender_symbol": "unicode/26a7.png?v8",
5955 "triangular_flag_on_post": "unicode/1f6a9.png?v8",
5956 "triangular_ruler": "unicode/1f4d0.png?v8",
5957 "trident": "unicode/1f531.png?v8",
5958 "trinidad_tobago": "unicode/1f1f9-1f1f9.png?v8",
5959 "tristan_da_cunha": "unicode/1f1f9-1f1e6.png?v8",
5960 "triumph": "unicode/1f624.png?v8",
5961 "trolleybus": "unicode/1f68e.png?v8",
5962 "trollface": "trollface.png?v8",
5963 "trophy": "unicode/1f3c6.png?v8",
5964 "tropical_drink": "unicode/1f379.png?v8",
5965 "tropical_fish": "unicode/1f420.png?v8",
5966 "truck": "unicode/1f69a.png?v8",
5967 "trumpet": "unicode/1f3ba.png?v8",
5968 "tshirt": "unicode/1f455.png?v8",
5969 "tulip": "unicode/1f337.png?v8",
5970 "tumbler_glass": "unicode/1f943.png?v8",
5971 "tunisia": "unicode/1f1f9-1f1f3.png?v8",
5972 "turkey": "unicode/1f983.png?v8",
5973 "turkmenistan": "unicode/1f1f9-1f1f2.png?v8",
5974 "turks_caicos_islands": "unicode/1f1f9-1f1e8.png?v8",
5975 "turtle": "unicode/1f422.png?v8",
5976 "tuvalu": "unicode/1f1f9-1f1fb.png?v8",
5977 "tv": "unicode/1f4fa.png?v8",
5978 "twisted_rightwards_arrows": "unicode/1f500.png?v8",
5979 "two": "unicode/0032-20e3.png?v8",
5980 "two_hearts": "unicode/1f495.png?v8",
5981 "two_men_holding_hands": "unicode/1f46c.png?v8",
5982 "two_women_holding_hands": "unicode/1f46d.png?v8",
5983 "u5272": "unicode/1f239.png?v8",
5984 "u5408": "unicode/1f234.png?v8",
5985 "u55b6": "unicode/1f23a.png?v8",
5986 "u6307": "unicode/1f22f.png?v8",
5987 "u6708": "unicode/1f237.png?v8",
5988 "u6709": "unicode/1f236.png?v8",
5989 "u6e80": "unicode/1f235.png?v8",
5990 "u7121": "unicode/1f21a.png?v8",
5991 "u7533": "unicode/1f238.png?v8",
5992 "u7981": "unicode/1f232.png?v8",
5993 "u7a7a": "unicode/1f233.png?v8",
5994 "uganda": "unicode/1f1fa-1f1ec.png?v8",
5995 "uk": "unicode/1f1ec-1f1e7.png?v8",
5996 "ukraine": "unicode/1f1fa-1f1e6.png?v8",
5997 "umbrella": "unicode/2614.png?v8",
5998 "unamused": "unicode/1f612.png?v8",
5999 "underage": "unicode/1f51e.png?v8",
6000 "unicorn": "unicode/1f984.png?v8",
6001 "united_arab_emirates": "unicode/1f1e6-1f1ea.png?v8",
6002 "united_nations": "unicode/1f1fa-1f1f3.png?v8",
6003 "unlock": "unicode/1f513.png?v8",
6004 "up": "unicode/1f199.png?v8",
6005 "upside_down_face": "unicode/1f643.png?v8",
6006 "uruguay": "unicode/1f1fa-1f1fe.png?v8",
6007 "us": "unicode/1f1fa-1f1f8.png?v8",
6008 "us_outlying_islands": "unicode/1f1fa-1f1f2.png?v8",
6009 "us_virgin_islands": "unicode/1f1fb-1f1ee.png?v8",
6010 "uzbekistan": "unicode/1f1fa-1f1ff.png?v8",
6011 "v": "unicode/270c.png?v8",
6012 "vampire": "unicode/1f9db.png?v8",
6013 "vampire_man": "unicode/1f9db-2642.png?v8",
6014 "vampire_woman": "unicode/1f9db-2640.png?v8",
6015 "vanuatu": "unicode/1f1fb-1f1fa.png?v8",
6016 "vatican_city": "unicode/1f1fb-1f1e6.png?v8",
6017 "venezuela": "unicode/1f1fb-1f1ea.png?v8",
6018 "vertical_traffic_light": "unicode/1f6a6.png?v8",
6019 "vhs": "unicode/1f4fc.png?v8",
6020 "vibration_mode": "unicode/1f4f3.png?v8",
6021 "video_camera": "unicode/1f4f9.png?v8",
6022 "video_game": "unicode/1f3ae.png?v8",
6023 "vietnam": "unicode/1f1fb-1f1f3.png?v8",
6024 "violin": "unicode/1f3bb.png?v8",
6025 "virgo": "unicode/264d.png?v8",
6026 "volcano": "unicode/1f30b.png?v8",
6027 "volleyball": "unicode/1f3d0.png?v8",
6028 "vomiting_face": "unicode/1f92e.png?v8",
6029 "vs": "unicode/1f19a.png?v8",
6030 "vulcan_salute": "unicode/1f596.png?v8",
6031 "waffle": "unicode/1f9c7.png?v8",
6032 "wales": "unicode/1f3f4-e0067-e0062-e0077-e006c-e0073-e007f.png?v8",
6033 "walking": "unicode/1f6b6.png?v8",
6034 "walking_man": "unicode/1f6b6-2642.png?v8",
6035 "walking_woman": "unicode/1f6b6-2640.png?v8",
6036 "wallis_futuna": "unicode/1f1fc-1f1eb.png?v8",
6037 "waning_crescent_moon": "unicode/1f318.png?v8",
6038 "waning_gibbous_moon": "unicode/1f316.png?v8",
6039 "warning": "unicode/26a0.png?v8",
6040 "wastebasket": "unicode/1f5d1.png?v8",
6041 "watch": "unicode/231a.png?v8",
6042 "water_buffalo": "unicode/1f403.png?v8",
6043 "water_polo": "unicode/1f93d.png?v8",
6044 "watermelon": "unicode/1f349.png?v8",
6045 "wave": "unicode/1f44b.png?v8",
6046 "wavy_dash": "unicode/3030.png?v8",
6047 "waxing_crescent_moon": "unicode/1f312.png?v8",
6048 "waxing_gibbous_moon": "unicode/1f314.png?v8",
6049 "wc": "unicode/1f6be.png?v8",
6050 "weary": "unicode/1f629.png?v8",
6051 "wedding": "unicode/1f492.png?v8",
6052 "weight_lifting": "unicode/1f3cb.png?v8",
6053 "weight_lifting_man": "unicode/1f3cb-2642.png?v8",
6054 "weight_lifting_woman": "unicode/1f3cb-2640.png?v8",
6055 "western_sahara": "unicode/1f1ea-1f1ed.png?v8",
6056 "whale": "unicode/1f433.png?v8",
6057 "whale2": "unicode/1f40b.png?v8",
6058 "wheel_of_dharma": "unicode/2638.png?v8",
6059 "wheelchair": "unicode/267f.png?v8",
6060 "white_check_mark": "unicode/2705.png?v8",
6061 "white_circle": "unicode/26aa.png?v8",
6062 "white_flag": "unicode/1f3f3.png?v8",
6063 "white_flower": "unicode/1f4ae.png?v8",
6064 "white_haired_man": "unicode/1f468-1f9b3.png?v8",
6065 "white_haired_woman": "unicode/1f469-1f9b3.png?v8",
6066 "white_heart": "unicode/1f90d.png?v8",
6067 "white_large_square": "unicode/2b1c.png?v8",
6068 "white_medium_small_square": "unicode/25fd.png?v8",
6069 "white_medium_square": "unicode/25fb.png?v8",
6070 "white_small_square": "unicode/25ab.png?v8",
6071 "white_square_button": "unicode/1f533.png?v8",
6072 "wilted_flower": "unicode/1f940.png?v8",
6073 "wind_chime": "unicode/1f390.png?v8",
6074 "wind_face": "unicode/1f32c.png?v8",
6075 "window": "unicode/1fa9f.png?v8",
6076 "wine_glass": "unicode/1f377.png?v8",
6077 "wink": "unicode/1f609.png?v8",
6078 "wolf": "unicode/1f43a.png?v8",
6079 "woman": "unicode/1f469.png?v8",
6080 "woman_artist": "unicode/1f469-1f3a8.png?v8",
6081 "woman_astronaut": "unicode/1f469-1f680.png?v8",
6082 "woman_beard": "unicode/1f9d4-2640.png?v8",
6083 "woman_cartwheeling": "unicode/1f938-2640.png?v8",
6084 "woman_cook": "unicode/1f469-1f373.png?v8",
6085 "woman_dancing": "unicode/1f483.png?v8",
6086 "woman_facepalming": "unicode/1f926-2640.png?v8",
6087 "woman_factory_worker": "unicode/1f469-1f3ed.png?v8",
6088 "woman_farmer": "unicode/1f469-1f33e.png?v8",
6089 "woman_feeding_baby": "unicode/1f469-1f37c.png?v8",
6090 "woman_firefighter": "unicode/1f469-1f692.png?v8",
6091 "woman_health_worker": "unicode/1f469-2695.png?v8",
6092 "woman_in_manual_wheelchair": "unicode/1f469-1f9bd.png?v8",
6093 "woman_in_motorized_wheelchair": "unicode/1f469-1f9bc.png?v8",
6094 "woman_in_tuxedo": "unicode/1f935-2640.png?v8",
6095 "woman_judge": "unicode/1f469-2696.png?v8",
6096 "woman_juggling": "unicode/1f939-2640.png?v8",
6097 "woman_mechanic": "unicode/1f469-1f527.png?v8",
6098 "woman_office_worker": "unicode/1f469-1f4bc.png?v8",
6099 "woman_pilot": "unicode/1f469-2708.png?v8",
6100 "woman_playing_handball": "unicode/1f93e-2640.png?v8",
6101 "woman_playing_water_polo": "unicode/1f93d-2640.png?v8",
6102 "woman_scientist": "unicode/1f469-1f52c.png?v8",
6103 "woman_shrugging": "unicode/1f937-2640.png?v8",
6104 "woman_singer": "unicode/1f469-1f3a4.png?v8",
6105 "woman_student": "unicode/1f469-1f393.png?v8",
6106 "woman_teacher": "unicode/1f469-1f3eb.png?v8",
6107 "woman_technologist": "unicode/1f469-1f4bb.png?v8",
6108 "woman_with_headscarf": "unicode/1f9d5.png?v8",
6109 "woman_with_probing_cane": "unicode/1f469-1f9af.png?v8",
6110 "woman_with_turban": "unicode/1f473-2640.png?v8",
6111 "woman_with_veil": "unicode/1f470-2640.png?v8",
6112 "womans_clothes": "unicode/1f45a.png?v8",
6113 "womans_hat": "unicode/1f452.png?v8",
6114 "women_wrestling": "unicode/1f93c-2640.png?v8",
6115 "womens": "unicode/1f6ba.png?v8",
6116 "wood": "unicode/1fab5.png?v8",
6117 "woozy_face": "unicode/1f974.png?v8",
6118 "world_map": "unicode/1f5fa.png?v8",
6119 "worm": "unicode/1fab1.png?v8",
6120 "worried": "unicode/1f61f.png?v8",
6121 "wrench": "unicode/1f527.png?v8",
6122 "wrestling": "unicode/1f93c.png?v8",
6123 "writing_hand": "unicode/270d.png?v8",
6124 "x": "unicode/274c.png?v8",
6125 "yarn": "unicode/1f9f6.png?v8",
6126 "yawning_face": "unicode/1f971.png?v8",
6127 "yellow_circle": "unicode/1f7e1.png?v8",
6128 "yellow_heart": "unicode/1f49b.png?v8",
6129 "yellow_square": "unicode/1f7e8.png?v8",
6130 "yemen": "unicode/1f1fe-1f1ea.png?v8",
6131 "yen": "unicode/1f4b4.png?v8",
6132 "yin_yang": "unicode/262f.png?v8",
6133 "yo_yo": "unicode/1fa80.png?v8",
6134 "yum": "unicode/1f60b.png?v8",
6135 "zambia": "unicode/1f1ff-1f1f2.png?v8",
6136 "zany_face": "unicode/1f92a.png?v8",
6137 "zap": "unicode/26a1.png?v8",
6138 "zebra": "unicode/1f993.png?v8",
6139 "zero": "unicode/0030-20e3.png?v8",
6140 "zimbabwe": "unicode/1f1ff-1f1fc.png?v8",
6141 "zipper_mouth_face": "unicode/1f910.png?v8",
6142 "zombie": "unicode/1f9df.png?v8",
6143 "zombie_man": "unicode/1f9df-2642.png?v8",
6144 "zombie_woman": "unicode/1f9df-2640.png?v8",
6145 "zzz": "unicode/1f4a4.png?v8"
6146 }
6147 };
6148
6149 function replaceEmojiShorthand(m, $1, useNativeEmoji) {
6150 var emojiMatch = emojiData.data[$1];
6151
6152 var result = m;
6153
6154 if (emojiMatch) {
6155 if (useNativeEmoji && /unicode/.test(emojiMatch)) {
6156 var emojiUnicode = emojiMatch
6157 .replace('unicode/', '')
6158 .replace(/\.png.*/, '')
6159 .split('-')
6160 .map(function (u) { return ("&#x" + u + ";"); })
6161 // Separate multi-character emoji with zero width joiner sequence (ZWJ)
6162 // Hat tip: https://about.gitlab.com/blog/2018/05/30/journey-in-native-unicode-emoji/#emoji-made-up-of-multiple-characters
6163 .join('&zwj;')
6164 .concat('&#xFE0E;');
6165 result = "<span class=\"emoji\">" + emojiUnicode + "</span>";
6166 } else {
6167 result = "<img src=\"" + (emojiData.baseURL) + emojiMatch + ".png\" alt=\"" + $1 + "\" class=\"emoji\" loading=\"lazy\">";
6168 }
6169 }
6170
6171 return result;
6172 }
6173
6174 function emojify(text, useNativeEmoji) {
6175 return (
6176 text
6177 // Mark colons in tags
6178 .replace(
6179 /<(code|pre|script|template)[^>]*?>[\s\S]+?<\/(code|pre|script|template)>/g,
6180 function (m) { return m.replace(/:/g, '__colon__'); }
6181 )
6182 // Mark colons in comments
6183 .replace(/<!--[\s\S]+?-->/g, function (m) { return m.replace(/:/g, '__colon__'); })
6184 // Mark colons in URIs
6185 .replace(/([a-z]{2,}:)?\/\/[^\s'">)]+/gi, function (m) { return m.replace(/:/g, '__colon__'); }
6186 )
6187 // Replace emoji shorthand codes
6188 .replace(/:([a-z0-9_\-+]+?):/g, function (m, $1) { return replaceEmojiShorthand(m, $1, useNativeEmoji); }
6189 )
6190 // Restore colons in tags and comments
6191 .replace(/__colon__/g, ':')
6192 );
6193 }
6194
6195 /**
6196 * Converts a colon formatted string to a object with properties.
6197 *
6198 * This is process a provided string and look for any tokens in the format
6199 * of `:name[=value]` and then convert it to a object and return.
6200 * An example of this is ':include :type=code :fragment=demo' is taken and
6201 * then converted to:
6202 *
6203 * ```
6204 * {
6205 * include: '',
6206 * type: 'code',
6207 * fragment: 'demo'
6208 * }
6209 * ```
6210 *
6211 * @param {string} str The string to parse.
6212 *
6213 * @return {object} The original string and parsed object, { str, config }.
6214 */
6215 function getAndRemoveConfig(str) {
6216 if ( str === void 0 ) str = '';
6217
6218 var config = {};
6219
6220 if (str) {
6221 str = str
6222 .replace(/^('|")/, '')
6223 .replace(/('|")$/, '')
6224 .replace(/(?:^|\s):([\w-]+:?)=?([\w-%]+)?/g, function (m, key, value) {
6225 if (key.indexOf(':') === -1) {
6226 config[key] = (value && value.replace(/&quot;/g, '')) || true;
6227 return '';
6228 }
6229
6230 return m;
6231 })
6232 .trim();
6233 }
6234
6235 return { str: str, config: config };
6236 }
6237
6238 /**
6239 * Remove the <a> tag from sidebar when the header with link, details see issue 1069
6240 * @param {string} str The string to deal with.
6241 *
6242 * @return {string} str The string after delete the <a> element.
6243 */
6244 function removeAtag(str) {
6245 if ( str === void 0 ) str = '';
6246
6247 return str.replace(/(<\/?a.*?>)/gi, '');
6248 }
6249
6250 var imageCompiler = function (ref) {
6251 var renderer = ref.renderer;
6252 var contentBase = ref.contentBase;
6253 var router = ref.router;
6254
6255 return (renderer.image = function (href, title, text) {
6256 var url = href;
6257 var attrs = [];
6258
6259 var ref = getAndRemoveConfig(title);
6260 var str = ref.str;
6261 var config = ref.config;
6262 title = str;
6263
6264 if (config['no-zoom']) {
6265 attrs.push('data-no-zoom');
6266 }
6267
6268 if (title) {
6269 attrs.push(("title=\"" + title + "\""));
6270 }
6271
6272 if (config.size) {
6273 var ref$1 = config.size.split('x');
6274 var width = ref$1[0];
6275 var height = ref$1[1];
6276 if (height) {
6277 attrs.push(("width=\"" + width + "\" height=\"" + height + "\""));
6278 } else {
6279 attrs.push(("width=\"" + width + "\""));
6280 }
6281 }
6282
6283 if (config.class) {
6284 attrs.push(("class=\"" + (config.class) + "\""));
6285 }
6286
6287 if (config.id) {
6288 attrs.push(("id=\"" + (config.id) + "\""));
6289 }
6290
6291 if (!isAbsolutePath(href)) {
6292 url = getPath(contentBase, getParentPath(router.getCurrentPath()), href);
6293 }
6294
6295 if (attrs.length > 0) {
6296 return ("<img src=\"" + url + "\" data-origin=\"" + href + "\" alt=\"" + text + "\" " + (attrs.join(
6297 ' '
6298 )) + " />");
6299 }
6300
6301 return ("<img src=\"" + url + "\" data-origin=\"" + href + "\" alt=\"" + text + "\"" + attrs + ">");
6302 });
6303 };
6304
6305 var prism = createCommonjsModule(function (module) {
6306 /* **********************************************
6307 Begin prism-core.js
6308 ********************************************** */
6309
6310 /// <reference lib="WebWorker"/>
6311
6312 var _self = (typeof window !== 'undefined')
6313 ? window // if in browser
6314 : (
6315 (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
6316 ? self // if in worker
6317 : {} // if in node js
6318 );
6319
6320 /**
6321 * Prism: Lightweight, robust, elegant syntax highlighting
6322 *
6323 * @license MIT <https://opensource.org/licenses/MIT>
6324 * @author Lea Verou <https://lea.verou.me>
6325 * @namespace
6326 * @public
6327 */
6328 var Prism = (function (_self) {
6329
6330 // Private helper vars
6331 var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
6332 var uniqueId = 0;
6333
6334 // The grammar object for plaintext
6335 var plainTextGrammar = {};
6336
6337
6338 var _ = {
6339 /**
6340 * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
6341 * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
6342 * additional languages or plugins yourself.
6343 *
6344 * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
6345 *
6346 * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
6347 * empty Prism object into the global scope before loading the Prism script like this:
6348 *
6349 * ```js
6350 * window.Prism = window.Prism || {};
6351 * Prism.manual = true;
6352 * // add a new <script> to load Prism's script
6353 * ```
6354 *
6355 * @default false
6356 * @type {boolean}
6357 * @memberof Prism
6358 * @public
6359 */
6360 manual: _self.Prism && _self.Prism.manual,
6361 /**
6362 * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
6363 * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
6364 * own worker, you don't want it to do this.
6365 *
6366 * By setting this value to `true`, Prism will not add its own listeners to the worker.
6367 *
6368 * You obviously have to change this value before Prism executes. To do this, you can add an
6369 * empty Prism object into the global scope before loading the Prism script like this:
6370 *
6371 * ```js
6372 * window.Prism = window.Prism || {};
6373 * Prism.disableWorkerMessageHandler = true;
6374 * // Load Prism's script
6375 * ```
6376 *
6377 * @default false
6378 * @type {boolean}
6379 * @memberof Prism
6380 * @public
6381 */
6382 disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
6383
6384 /**
6385 * A namespace for utility methods.
6386 *
6387 * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
6388 * change or disappear at any time.
6389 *
6390 * @namespace
6391 * @memberof Prism
6392 */
6393 util: {
6394 encode: function encode(tokens) {
6395 if (tokens instanceof Token) {
6396 return new Token(tokens.type, encode(tokens.content), tokens.alias);
6397 } else if (Array.isArray(tokens)) {
6398 return tokens.map(encode);
6399 } else {
6400 return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
6401 }
6402 },
6403
6404 /**
6405 * Returns the name of the type of the given value.
6406 *
6407 * @param {any} o
6408 * @returns {string}
6409 * @example
6410 * type(null) === 'Null'
6411 * type(undefined) === 'Undefined'
6412 * type(123) === 'Number'
6413 * type('foo') === 'String'
6414 * type(true) === 'Boolean'
6415 * type([1, 2]) === 'Array'
6416 * type({}) === 'Object'
6417 * type(String) === 'Function'
6418 * type(/abc+/) === 'RegExp'
6419 */
6420 type: function (o) {
6421 return Object.prototype.toString.call(o).slice(8, -1);
6422 },
6423
6424 /**
6425 * Returns a unique number for the given object. Later calls will still return the same number.
6426 *
6427 * @param {Object} obj
6428 * @returns {number}
6429 */
6430 objId: function (obj) {
6431 if (!obj['__id']) {
6432 Object.defineProperty(obj, '__id', { value: ++uniqueId });
6433 }
6434 return obj['__id'];
6435 },
6436
6437 /**
6438 * Creates a deep clone of the given object.
6439 *
6440 * The main intended use of this function is to clone language definitions.
6441 *
6442 * @param {T} o
6443 * @param {Record<number, any>} [visited]
6444 * @returns {T}
6445 * @template T
6446 */
6447 clone: function deepClone(o, visited) {
6448 visited = visited || {};
6449
6450 var clone; var id;
6451 switch (_.util.type(o)) {
6452 case 'Object':
6453 id = _.util.objId(o);
6454 if (visited[id]) {
6455 return visited[id];
6456 }
6457 clone = /** @type {Record<string, any>} */ ({});
6458 visited[id] = clone;
6459
6460 for (var key in o) {
6461 if (o.hasOwnProperty(key)) {
6462 clone[key] = deepClone(o[key], visited);
6463 }
6464 }
6465
6466 return /** @type {any} */ (clone);
6467
6468 case 'Array':
6469 id = _.util.objId(o);
6470 if (visited[id]) {
6471 return visited[id];
6472 }
6473 clone = [];
6474 visited[id] = clone;
6475
6476 (/** @type {Array} */(/** @type {any} */(o))).forEach(function (v, i) {
6477 clone[i] = deepClone(v, visited);
6478 });
6479
6480 return /** @type {any} */ (clone);
6481
6482 default:
6483 return o;
6484 }
6485 },
6486
6487 /**
6488 * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
6489 *
6490 * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
6491 *
6492 * @param {Element} element
6493 * @returns {string}
6494 */
6495 getLanguage: function (element) {
6496 while (element) {
6497 var m = lang.exec(element.className);
6498 if (m) {
6499 return m[1].toLowerCase();
6500 }
6501 element = element.parentElement;
6502 }
6503 return 'none';
6504 },
6505
6506 /**
6507 * Sets the Prism `language-xxxx` class of the given element.
6508 *
6509 * @param {Element} element
6510 * @param {string} language
6511 * @returns {void}
6512 */
6513 setLanguage: function (element, language) {
6514 // remove all `language-xxxx` classes
6515 // (this might leave behind a leading space)
6516 element.className = element.className.replace(RegExp(lang, 'gi'), '');
6517
6518 // add the new `language-xxxx` class
6519 // (using `classList` will automatically clean up spaces for us)
6520 element.classList.add('language-' + language);
6521 },
6522
6523 /**
6524 * Returns the script element that is currently executing.
6525 *
6526 * This does __not__ work for line script element.
6527 *
6528 * @returns {HTMLScriptElement | null}
6529 */
6530 currentScript: function () {
6531 if (typeof document === 'undefined') {
6532 return null;
6533 }
6534 if ('currentScript' in document && 1 < 2 /* hack to trip TS' flow analysis */) {
6535 return /** @type {any} */ (document.currentScript);
6536 }
6537
6538 // IE11 workaround
6539 // we'll get the src of the current script by parsing IE11's error stack trace
6540 // this will not work for inline scripts
6541
6542 try {
6543 throw new Error();
6544 } catch (err) {
6545 // Get file src url from stack. Specifically works with the format of stack traces in IE.
6546 // A stack will look like this:
6547 //
6548 // Error
6549 // at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
6550 // at Global code (http://localhost/components/prism-core.js:606:1)
6551
6552 var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
6553 if (src) {
6554 var scripts = document.getElementsByTagName('script');
6555 for (var i in scripts) {
6556 if (scripts[i].src == src) {
6557 return scripts[i];
6558 }
6559 }
6560 }
6561 return null;
6562 }
6563 },
6564
6565 /**
6566 * Returns whether a given class is active for `element`.
6567 *
6568 * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
6569 * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
6570 * given class is just the given class with a `no-` prefix.
6571 *
6572 * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
6573 * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
6574 * ancestors have the given class or the negated version of it, then the default activation will be returned.
6575 *
6576 * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
6577 * version of it, the class is considered active.
6578 *
6579 * @param {Element} element
6580 * @param {string} className
6581 * @param {boolean} [defaultActivation=false]
6582 * @returns {boolean}
6583 */
6584 isActive: function (element, className, defaultActivation) {
6585 var no = 'no-' + className;
6586
6587 while (element) {
6588 var classList = element.classList;
6589 if (classList.contains(className)) {
6590 return true;
6591 }
6592 if (classList.contains(no)) {
6593 return false;
6594 }
6595 element = element.parentElement;
6596 }
6597 return !!defaultActivation;
6598 }
6599 },
6600
6601 /**
6602 * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
6603 *
6604 * @namespace
6605 * @memberof Prism
6606 * @public
6607 */
6608 languages: {
6609 /**
6610 * The grammar for plain, unformatted text.
6611 */
6612 plain: plainTextGrammar,
6613 plaintext: plainTextGrammar,
6614 text: plainTextGrammar,
6615 txt: plainTextGrammar,
6616
6617 /**
6618 * Creates a deep copy of the language with the given id and appends the given tokens.
6619 *
6620 * If a token in `redef` also appears in the copied language, then the existing token in the copied language
6621 * will be overwritten at its original position.
6622 *
6623 * ## Best practices
6624 *
6625 * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
6626 * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
6627 * understand the language definition because, normally, the order of tokens matters in Prism grammars.
6628 *
6629 * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
6630 * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
6631 *
6632 * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
6633 * @param {Grammar} redef The new tokens to append.
6634 * @returns {Grammar} The new language created.
6635 * @public
6636 * @example
6637 * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
6638 * // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
6639 * // at its original position
6640 * 'comment': { ... },
6641 * // CSS doesn't have a 'color' token, so this token will be appended
6642 * 'color': /\b(?:red|green|blue)\b/
6643 * });
6644 */
6645 extend: function (id, redef) {
6646 var lang = _.util.clone(_.languages[id]);
6647
6648 for (var key in redef) {
6649 lang[key] = redef[key];
6650 }
6651
6652 return lang;
6653 },
6654
6655 /**
6656 * Inserts tokens _before_ another token in a language definition or any other grammar.
6657 *
6658 * ## Usage
6659 *
6660 * This helper method makes it easy to modify existing languages. For example, the CSS language definition
6661 * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
6662 * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
6663 * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
6664 * this:
6665 *
6666 * ```js
6667 * Prism.languages.markup.style = {
6668 * // token
6669 * };
6670 * ```
6671 *
6672 * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
6673 * before existing tokens. For the CSS example above, you would use it like this:
6674 *
6675 * ```js
6676 * Prism.languages.insertBefore('markup', 'cdata', {
6677 * 'style': {
6678 * // token
6679 * }
6680 * });
6681 * ```
6682 *
6683 * ## Special cases
6684 *
6685 * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
6686 * will be ignored.
6687 *
6688 * This behavior can be used to insert tokens after `before`:
6689 *
6690 * ```js
6691 * Prism.languages.insertBefore('markup', 'comment', {
6692 * 'comment': Prism.languages.markup.comment,
6693 * // tokens after 'comment'
6694 * });
6695 * ```
6696 *
6697 * ## Limitations
6698 *
6699 * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
6700 * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
6701 * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
6702 * deleting properties which is necessary to insert at arbitrary positions.
6703 *
6704 * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
6705 * Instead, it will create a new object and replace all references to the target object with the new one. This
6706 * can be done without temporarily deleting properties, so the iteration order is well-defined.
6707 *
6708 * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
6709 * you hold the target object in a variable, then the value of the variable will not change.
6710 *
6711 * ```js
6712 * var oldMarkup = Prism.languages.markup;
6713 * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
6714 *
6715 * assert(oldMarkup !== Prism.languages.markup);
6716 * assert(newMarkup === Prism.languages.markup);
6717 * ```
6718 *
6719 * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
6720 * object to be modified.
6721 * @param {string} before The key to insert before.
6722 * @param {Grammar} insert An object containing the key-value pairs to be inserted.
6723 * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
6724 * object to be modified.
6725 *
6726 * Defaults to `Prism.languages`.
6727 * @returns {Grammar} The new grammar object.
6728 * @public
6729 */
6730 insertBefore: function (inside, before, insert, root) {
6731 root = root || /** @type {any} */ (_.languages);
6732 var grammar = root[inside];
6733 /** @type {Grammar} */
6734 var ret = {};
6735
6736 for (var token in grammar) {
6737 if (grammar.hasOwnProperty(token)) {
6738
6739 if (token == before) {
6740 for (var newToken in insert) {
6741 if (insert.hasOwnProperty(newToken)) {
6742 ret[newToken] = insert[newToken];
6743 }
6744 }
6745 }
6746
6747 // Do not insert token which also occur in insert. See #1525
6748 if (!insert.hasOwnProperty(token)) {
6749 ret[token] = grammar[token];
6750 }
6751 }
6752 }
6753
6754 var old = root[inside];
6755 root[inside] = ret;
6756
6757 // Update references in other language definitions
6758 _.languages.DFS(_.languages, function (key, value) {
6759 if (value === old && key != inside) {
6760 this[key] = ret;
6761 }
6762 });
6763
6764 return ret;
6765 },
6766
6767 // Traverse a language definition with Depth First Search
6768 DFS: function DFS(o, callback, type, visited) {
6769 visited = visited || {};
6770
6771 var objId = _.util.objId;
6772
6773 for (var i in o) {
6774 if (o.hasOwnProperty(i)) {
6775 callback.call(o, i, o[i], type || i);
6776
6777 var property = o[i];
6778 var propertyType = _.util.type(property);
6779
6780 if (propertyType === 'Object' && !visited[objId(property)]) {
6781 visited[objId(property)] = true;
6782 DFS(property, callback, null, visited);
6783 } else if (propertyType === 'Array' && !visited[objId(property)]) {
6784 visited[objId(property)] = true;
6785 DFS(property, callback, i, visited);
6786 }
6787 }
6788 }
6789 }
6790 },
6791
6792 plugins: {},
6793
6794 /**
6795 * This is the most high-level function in Prism’s API.
6796 * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
6797 * each one of them.
6798 *
6799 * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
6800 *
6801 * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
6802 * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
6803 * @memberof Prism
6804 * @public
6805 */
6806 highlightAll: function (async, callback) {
6807 _.highlightAllUnder(document, async, callback);
6808 },
6809
6810 /**
6811 * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
6812 * {@link Prism.highlightElement} on each one of them.
6813 *
6814 * The following hooks will be run:
6815 * 1. `before-highlightall`
6816 * 2. `before-all-elements-highlight`
6817 * 3. All hooks of {@link Prism.highlightElement} for each element.
6818 *
6819 * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
6820 * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
6821 * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
6822 * @memberof Prism
6823 * @public
6824 */
6825 highlightAllUnder: function (container, async, callback) {
6826 var env = {
6827 callback: callback,
6828 container: container,
6829 selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
6830 };
6831
6832 _.hooks.run('before-highlightall', env);
6833
6834 env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
6835
6836 _.hooks.run('before-all-elements-highlight', env);
6837
6838 for (var i = 0, element; (element = env.elements[i++]);) {
6839 _.highlightElement(element, async === true, env.callback);
6840 }
6841 },
6842
6843 /**
6844 * Highlights the code inside a single element.
6845 *
6846 * The following hooks will be run:
6847 * 1. `before-sanity-check`
6848 * 2. `before-highlight`
6849 * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
6850 * 4. `before-insert`
6851 * 5. `after-highlight`
6852 * 6. `complete`
6853 *
6854 * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
6855 * the element's language.
6856 *
6857 * @param {Element} element The element containing the code.
6858 * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
6859 * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
6860 * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
6861 * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
6862 *
6863 * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
6864 * asynchronous highlighting to work. You can build your own bundle on the
6865 * [Download page](https://prismjs.com/download.html).
6866 * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
6867 * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
6868 * @memberof Prism
6869 * @public
6870 */
6871 highlightElement: function (element, async, callback) {
6872 // Find language
6873 var language = _.util.getLanguage(element);
6874 var grammar = _.languages[language];
6875
6876 // Set language on the element, if not present
6877 _.util.setLanguage(element, language);
6878
6879 // Set language on the parent, for styling
6880 var parent = element.parentElement;
6881 if (parent && parent.nodeName.toLowerCase() === 'pre') {
6882 _.util.setLanguage(parent, language);
6883 }
6884
6885 var code = element.textContent;
6886
6887 var env = {
6888 element: element,
6889 language: language,
6890 grammar: grammar,
6891 code: code
6892 };
6893
6894 function insertHighlightedCode(highlightedCode) {
6895 env.highlightedCode = highlightedCode;
6896
6897 _.hooks.run('before-insert', env);
6898
6899 env.element.innerHTML = env.highlightedCode;
6900
6901 _.hooks.run('after-highlight', env);
6902 _.hooks.run('complete', env);
6903 callback && callback.call(env.element);
6904 }
6905
6906 _.hooks.run('before-sanity-check', env);
6907
6908 // plugins may change/add the parent/element
6909 parent = env.element.parentElement;
6910 if (parent && parent.nodeName.toLowerCase() === 'pre' && !parent.hasAttribute('tabindex')) {
6911 parent.setAttribute('tabindex', '0');
6912 }
6913
6914 if (!env.code) {
6915 _.hooks.run('complete', env);
6916 callback && callback.call(env.element);
6917 return;
6918 }
6919
6920 _.hooks.run('before-highlight', env);
6921
6922 if (!env.grammar) {
6923 insertHighlightedCode(_.util.encode(env.code));
6924 return;
6925 }
6926
6927 if (async && _self.Worker) {
6928 var worker = new Worker(_.filename);
6929
6930 worker.onmessage = function (evt) {
6931 insertHighlightedCode(evt.data);
6932 };
6933
6934 worker.postMessage(JSON.stringify({
6935 language: env.language,
6936 code: env.code,
6937 immediateClose: true
6938 }));
6939 } else {
6940 insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
6941 }
6942 },
6943
6944 /**
6945 * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
6946 * and the language definitions to use, and returns a string with the HTML produced.
6947 *
6948 * The following hooks will be run:
6949 * 1. `before-tokenize`
6950 * 2. `after-tokenize`
6951 * 3. `wrap`: On each {@link Token}.
6952 *
6953 * @param {string} text A string with the code to be highlighted.
6954 * @param {Grammar} grammar An object containing the tokens to use.
6955 *
6956 * Usually a language definition like `Prism.languages.markup`.
6957 * @param {string} language The name of the language definition passed to `grammar`.
6958 * @returns {string} The highlighted HTML.
6959 * @memberof Prism
6960 * @public
6961 * @example
6962 * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
6963 */
6964 highlight: function (text, grammar, language) {
6965 var env = {
6966 code: text,
6967 grammar: grammar,
6968 language: language
6969 };
6970 _.hooks.run('before-tokenize', env);
6971 if (!env.grammar) {
6972 throw new Error('The language "' + env.language + '" has no grammar.');
6973 }
6974 env.tokens = _.tokenize(env.code, env.grammar);
6975 _.hooks.run('after-tokenize', env);
6976 return Token.stringify(_.util.encode(env.tokens), env.language);
6977 },
6978
6979 /**
6980 * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
6981 * and the language definitions to use, and returns an array with the tokenized code.
6982 *
6983 * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
6984 *
6985 * This method could be useful in other contexts as well, as a very crude parser.
6986 *
6987 * @param {string} text A string with the code to be highlighted.
6988 * @param {Grammar} grammar An object containing the tokens to use.
6989 *
6990 * Usually a language definition like `Prism.languages.markup`.
6991 * @returns {TokenStream} An array of strings and tokens, a token stream.
6992 * @memberof Prism
6993 * @public
6994 * @example
6995 * let code = `var foo = 0;`;
6996 * let tokens = Prism.tokenize(code, Prism.languages.javascript);
6997 * tokens.forEach(token => {
6998 * if (token instanceof Prism.Token && token.type === 'number') {
6999 * console.log(`Found numeric literal: ${token.content}`);
7000 * }
7001 * });
7002 */
7003 tokenize: function (text, grammar) {
7004 var rest = grammar.rest;
7005 if (rest) {
7006 for (var token in rest) {
7007 grammar[token] = rest[token];
7008 }
7009
7010 delete grammar.rest;
7011 }
7012
7013 var tokenList = new LinkedList();
7014 addAfter(tokenList, tokenList.head, text);
7015
7016 matchGrammar(text, tokenList, grammar, tokenList.head, 0);
7017
7018 return toArray(tokenList);
7019 },
7020
7021 /**
7022 * @namespace
7023 * @memberof Prism
7024 * @public
7025 */
7026 hooks: {
7027 all: {},
7028
7029 /**
7030 * Adds the given callback to the list of callbacks for the given hook.
7031 *
7032 * The callback will be invoked when the hook it is registered for is run.
7033 * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
7034 *
7035 * One callback function can be registered to multiple hooks and the same hook multiple times.
7036 *
7037 * @param {string} name The name of the hook.
7038 * @param {HookCallback} callback The callback function which is given environment variables.
7039 * @public
7040 */
7041 add: function (name, callback) {
7042 var hooks = _.hooks.all;
7043
7044 hooks[name] = hooks[name] || [];
7045
7046 hooks[name].push(callback);
7047 },
7048
7049 /**
7050 * Runs a hook invoking all registered callbacks with the given environment variables.
7051 *
7052 * Callbacks will be invoked synchronously and in the order in which they were registered.
7053 *
7054 * @param {string} name The name of the hook.
7055 * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
7056 * @public
7057 */
7058 run: function (name, env) {
7059 var callbacks = _.hooks.all[name];
7060
7061 if (!callbacks || !callbacks.length) {
7062 return;
7063 }
7064
7065 for (var i = 0, callback; (callback = callbacks[i++]);) {
7066 callback(env);
7067 }
7068 }
7069 },
7070
7071 Token: Token
7072 };
7073 _self.Prism = _;
7074
7075
7076 // Typescript note:
7077 // The following can be used to import the Token type in JSDoc:
7078 //
7079 // @typedef {InstanceType<import("./prism-core")["Token"]>} Token
7080
7081 /**
7082 * Creates a new token.
7083 *
7084 * @param {string} type See {@link Token#type type}
7085 * @param {string | TokenStream} content See {@link Token#content content}
7086 * @param {string|string[]} [alias] The alias(es) of the token.
7087 * @param {string} [matchedStr=""] A copy of the full string this token was created from.
7088 * @class
7089 * @global
7090 * @public
7091 */
7092 function Token(type, content, alias, matchedStr) {
7093 /**
7094 * The type of the token.
7095 *
7096 * This is usually the key of a pattern in a {@link Grammar}.
7097 *
7098 * @type {string}
7099 * @see GrammarToken
7100 * @public
7101 */
7102 this.type = type;
7103 /**
7104 * The strings or tokens contained by this token.
7105 *
7106 * This will be a token stream if the pattern matched also defined an `inside` grammar.
7107 *
7108 * @type {string | TokenStream}
7109 * @public
7110 */
7111 this.content = content;
7112 /**
7113 * The alias(es) of the token.
7114 *
7115 * @type {string|string[]}
7116 * @see GrammarToken
7117 * @public
7118 */
7119 this.alias = alias;
7120 // Copy of the full string this token was created from
7121 this.length = (matchedStr || '').length | 0;
7122 }
7123
7124 /**
7125 * A token stream is an array of strings and {@link Token Token} objects.
7126 *
7127 * Token streams have to fulfill a few properties that are assumed by most functions (mostly internal ones) that process
7128 * them.
7129 *
7130 * 1. No adjacent strings.
7131 * 2. No empty strings.
7132 *
7133 * The only exception here is the token stream that only contains the empty string and nothing else.
7134 *
7135 * @typedef {Array<string | Token>} TokenStream
7136 * @global
7137 * @public
7138 */
7139
7140 /**
7141 * Converts the given token or token stream to an HTML representation.
7142 *
7143 * The following hooks will be run:
7144 * 1. `wrap`: On each {@link Token}.
7145 *
7146 * @param {string | Token | TokenStream} o The token or token stream to be converted.
7147 * @param {string} language The name of current language.
7148 * @returns {string} The HTML representation of the token or token stream.
7149 * @memberof Token
7150 * @static
7151 */
7152 Token.stringify = function stringify(o, language) {
7153 if (typeof o == 'string') {
7154 return o;
7155 }
7156 if (Array.isArray(o)) {
7157 var s = '';
7158 o.forEach(function (e) {
7159 s += stringify(e, language);
7160 });
7161 return s;
7162 }
7163
7164 var env = {
7165 type: o.type,
7166 content: stringify(o.content, language),
7167 tag: 'span',
7168 classes: ['token', o.type],
7169 attributes: {},
7170 language: language
7171 };
7172
7173 var aliases = o.alias;
7174 if (aliases) {
7175 if (Array.isArray(aliases)) {
7176 Array.prototype.push.apply(env.classes, aliases);
7177 } else {
7178 env.classes.push(aliases);
7179 }
7180 }
7181
7182 _.hooks.run('wrap', env);
7183
7184 var attributes = '';
7185 for (var name in env.attributes) {
7186 attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
7187 }
7188
7189 return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + '</' + env.tag + '>';
7190 };
7191
7192 /**
7193 * @param {RegExp} pattern
7194 * @param {number} pos
7195 * @param {string} text
7196 * @param {boolean} lookbehind
7197 * @returns {RegExpExecArray | null}
7198 */
7199 function matchPattern(pattern, pos, text, lookbehind) {
7200 pattern.lastIndex = pos;
7201 var match = pattern.exec(text);
7202 if (match && lookbehind && match[1]) {
7203 // change the match to remove the text matched by the Prism lookbehind group
7204 var lookbehindLength = match[1].length;
7205 match.index += lookbehindLength;
7206 match[0] = match[0].slice(lookbehindLength);
7207 }
7208 return match;
7209 }
7210
7211 /**
7212 * @param {string} text
7213 * @param {LinkedList<string | Token>} tokenList
7214 * @param {any} grammar
7215 * @param {LinkedListNode<string | Token>} startNode
7216 * @param {number} startPos
7217 * @param {RematchOptions} [rematch]
7218 * @returns {void}
7219 * @private
7220 *
7221 * @typedef RematchOptions
7222 * @property {string} cause
7223 * @property {number} reach
7224 */
7225 function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
7226 for (var token in grammar) {
7227 if (!grammar.hasOwnProperty(token) || !grammar[token]) {
7228 continue;
7229 }
7230
7231 var patterns = grammar[token];
7232 patterns = Array.isArray(patterns) ? patterns : [patterns];
7233
7234 for (var j = 0; j < patterns.length; ++j) {
7235 if (rematch && rematch.cause == token + ',' + j) {
7236 return;
7237 }
7238
7239 var patternObj = patterns[j];
7240 var inside = patternObj.inside;
7241 var lookbehind = !!patternObj.lookbehind;
7242 var greedy = !!patternObj.greedy;
7243 var alias = patternObj.alias;
7244
7245 if (greedy && !patternObj.pattern.global) {
7246 // Without the global flag, lastIndex won't work
7247 var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
7248 patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g');
7249 }
7250
7251 /** @type {RegExp} */
7252 var pattern = patternObj.pattern || patternObj;
7253
7254 for ( // iterate the token list and keep track of the current token/string position
7255 var currentNode = startNode.next, pos = startPos;
7256 currentNode !== tokenList.tail;
7257 pos += currentNode.value.length, currentNode = currentNode.next
7258 ) {
7259
7260 if (rematch && pos >= rematch.reach) {
7261 break;
7262 }
7263
7264 var str = currentNode.value;
7265
7266 if (tokenList.length > text.length) {
7267 // Something went terribly wrong, ABORT, ABORT!
7268 return;
7269 }
7270
7271 if (str instanceof Token) {
7272 continue;
7273 }
7274
7275 var removeCount = 1; // this is the to parameter of removeBetween
7276 var match;
7277
7278 if (greedy) {
7279 match = matchPattern(pattern, pos, text, lookbehind);
7280 if (!match || match.index >= text.length) {
7281 break;
7282 }
7283
7284 var from = match.index;
7285 var to = match.index + match[0].length;
7286 var p = pos;
7287
7288 // find the node that contains the match
7289 p += currentNode.value.length;
7290 while (from >= p) {
7291 currentNode = currentNode.next;
7292 p += currentNode.value.length;
7293 }
7294 // adjust pos (and p)
7295 p -= currentNode.value.length;
7296 pos = p;
7297
7298 // the current node is a Token, then the match starts inside another Token, which is invalid
7299 if (currentNode.value instanceof Token) {
7300 continue;
7301 }
7302
7303 // find the last node which is affected by this match
7304 for (
7305 var k = currentNode;
7306 k !== tokenList.tail && (p < to || typeof k.value === 'string');
7307 k = k.next
7308 ) {
7309 removeCount++;
7310 p += k.value.length;
7311 }
7312 removeCount--;
7313
7314 // replace with the new match
7315 str = text.slice(pos, p);
7316 match.index -= pos;
7317 } else {
7318 match = matchPattern(pattern, 0, str, lookbehind);
7319 if (!match) {
7320 continue;
7321 }
7322 }
7323
7324 // eslint-disable-next-line no-redeclare
7325 var from = match.index;
7326 var matchStr = match[0];
7327 var before = str.slice(0, from);
7328 var after = str.slice(from + matchStr.length);
7329
7330 var reach = pos + str.length;
7331 if (rematch && reach > rematch.reach) {
7332 rematch.reach = reach;
7333 }
7334
7335 var removeFrom = currentNode.prev;
7336
7337 if (before) {
7338 removeFrom = addAfter(tokenList, removeFrom, before);
7339 pos += before.length;
7340 }
7341
7342 removeRange(tokenList, removeFrom, removeCount);
7343
7344 var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
7345 currentNode = addAfter(tokenList, removeFrom, wrapped);
7346
7347 if (after) {
7348 addAfter(tokenList, currentNode, after);
7349 }
7350
7351 if (removeCount > 1) {
7352 // at least one Token object was removed, so we have to do some rematching
7353 // this can only happen if the current pattern is greedy
7354
7355 /** @type {RematchOptions} */
7356 var nestedRematch = {
7357 cause: token + ',' + j,
7358 reach: reach
7359 };
7360 matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
7361
7362 // the reach might have been extended because of the rematching
7363 if (rematch && nestedRematch.reach > rematch.reach) {
7364 rematch.reach = nestedRematch.reach;
7365 }
7366 }
7367 }
7368 }
7369 }
7370 }
7371
7372 /**
7373 * @typedef LinkedListNode
7374 * @property {T} value
7375 * @property {LinkedListNode<T> | null} prev The previous node.
7376 * @property {LinkedListNode<T> | null} next The next node.
7377 * @template T
7378 * @private
7379 */
7380
7381 /**
7382 * @template T
7383 * @private
7384 */
7385 function LinkedList() {
7386 /** @type {LinkedListNode<T>} */
7387 var head = { value: null, prev: null, next: null };
7388 /** @type {LinkedListNode<T>} */
7389 var tail = { value: null, prev: head, next: null };
7390 head.next = tail;
7391
7392 /** @type {LinkedListNode<T>} */
7393 this.head = head;
7394 /** @type {LinkedListNode<T>} */
7395 this.tail = tail;
7396 this.length = 0;
7397 }
7398
7399 /**
7400 * Adds a new node with the given value to the list.
7401 *
7402 * @param {LinkedList<T>} list
7403 * @param {LinkedListNode<T>} node
7404 * @param {T} value
7405 * @returns {LinkedListNode<T>} The added node.
7406 * @template T
7407 */
7408 function addAfter(list, node, value) {
7409 // assumes that node != list.tail && values.length >= 0
7410 var next = node.next;
7411
7412 var newNode = { value: value, prev: node, next: next };
7413 node.next = newNode;
7414 next.prev = newNode;
7415 list.length++;
7416
7417 return newNode;
7418 }
7419 /**
7420 * Removes `count` nodes after the given node. The given node will not be removed.
7421 *
7422 * @param {LinkedList<T>} list
7423 * @param {LinkedListNode<T>} node
7424 * @param {number} count
7425 * @template T
7426 */
7427 function removeRange(list, node, count) {
7428 var next = node.next;
7429 for (var i = 0; i < count && next !== list.tail; i++) {
7430 next = next.next;
7431 }
7432 node.next = next;
7433 next.prev = node;
7434 list.length -= i;
7435 }
7436 /**
7437 * @param {LinkedList<T>} list
7438 * @returns {T[]}
7439 * @template T
7440 */
7441 function toArray(list) {
7442 var array = [];
7443 var node = list.head.next;
7444 while (node !== list.tail) {
7445 array.push(node.value);
7446 node = node.next;
7447 }
7448 return array;
7449 }
7450
7451
7452 if (!_self.document) {
7453 if (!_self.addEventListener) {
7454 // in Node.js
7455 return _;
7456 }
7457
7458 if (!_.disableWorkerMessageHandler) {
7459 // In worker
7460 _self.addEventListener('message', function (evt) {
7461 var message = JSON.parse(evt.data);
7462 var lang = message.language;
7463 var code = message.code;
7464 var immediateClose = message.immediateClose;
7465
7466 _self.postMessage(_.highlight(code, _.languages[lang], lang));
7467 if (immediateClose) {
7468 _self.close();
7469 }
7470 }, false);
7471 }
7472
7473 return _;
7474 }
7475
7476 // Get current script and highlight
7477 var script = _.util.currentScript();
7478
7479 if (script) {
7480 _.filename = script.src;
7481
7482 if (script.hasAttribute('data-manual')) {
7483 _.manual = true;
7484 }
7485 }
7486
7487 function highlightAutomaticallyCallback() {
7488 if (!_.manual) {
7489 _.highlightAll();
7490 }
7491 }
7492
7493 if (!_.manual) {
7494 // If the document state is "loading", then we'll use DOMContentLoaded.
7495 // If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
7496 // DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
7497 // might take longer one animation frame to execute which can create a race condition where only some plugins have
7498 // been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.
7499 // See https://github.com/PrismJS/prism/issues/2102
7500 var readyState = document.readyState;
7501 if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {
7502 document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);
7503 } else {
7504 if (window.requestAnimationFrame) {
7505 window.requestAnimationFrame(highlightAutomaticallyCallback);
7506 } else {
7507 window.setTimeout(highlightAutomaticallyCallback, 16);
7508 }
7509 }
7510 }
7511
7512 return _;
7513
7514 }(_self));
7515
7516 if ( module.exports) {
7517 module.exports = Prism;
7518 }
7519
7520 // hack for components to work correctly in node.js
7521 if (typeof commonjsGlobal !== 'undefined') {
7522 commonjsGlobal.Prism = Prism;
7523 }
7524
7525 // some additional documentation/types
7526
7527 /**
7528 * The expansion of a simple `RegExp` literal to support additional properties.
7529 *
7530 * @typedef GrammarToken
7531 * @property {RegExp} pattern The regular expression of the token.
7532 * @property {boolean} [lookbehind=false] If `true`, then the first capturing group of `pattern` will (effectively)
7533 * behave as a lookbehind group meaning that the captured text will not be part of the matched text of the new token.
7534 * @property {boolean} [greedy=false] Whether the token is greedy.
7535 * @property {string|string[]} [alias] An optional alias or list of aliases.
7536 * @property {Grammar} [inside] The nested grammar of this token.
7537 *
7538 * The `inside` grammar will be used to tokenize the text value of each token of this kind.
7539 *
7540 * This can be used to make nested and even recursive language definitions.
7541 *
7542 * Note: This can cause infinite recursion. Be careful when you embed different languages or even the same language into
7543 * each another.
7544 * @global
7545 * @public
7546 */
7547
7548 /**
7549 * @typedef Grammar
7550 * @type {Object<string, RegExp | GrammarToken | Array<RegExp | GrammarToken>>}
7551 * @property {Grammar} [rest] An optional grammar object that will be appended to this grammar.
7552 * @global
7553 * @public
7554 */
7555
7556 /**
7557 * A function which will invoked after an element was successfully highlighted.
7558 *
7559 * @callback HighlightCallback
7560 * @param {Element} element The element successfully highlighted.
7561 * @returns {void}
7562 * @global
7563 * @public
7564 */
7565
7566 /**
7567 * @callback HookCallback
7568 * @param {Object<string, any>} env The environment variables of the hook.
7569 * @returns {void}
7570 * @global
7571 * @public
7572 */
7573
7574
7575 /* **********************************************
7576 Begin prism-markup.js
7577 ********************************************** */
7578
7579 Prism.languages.markup = {
7580 'comment': {
7581 pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
7582 greedy: true
7583 },
7584 'prolog': {
7585 pattern: /<\?[\s\S]+?\?>/,
7586 greedy: true
7587 },
7588 'doctype': {
7589 // https://www.w3.org/TR/xml/#NT-doctypedecl
7590 pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
7591 greedy: true,
7592 inside: {
7593 'internal-subset': {
7594 pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
7595 lookbehind: true,
7596 greedy: true,
7597 inside: null // see below
7598 },
7599 'string': {
7600 pattern: /"[^"]*"|'[^']*'/,
7601 greedy: true
7602 },
7603 'punctuation': /^<!|>$|[[\]]/,
7604 'doctype-tag': /^DOCTYPE/i,
7605 'name': /[^\s<>'"]+/
7606 }
7607 },
7608 'cdata': {
7609 pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
7610 greedy: true
7611 },
7612 'tag': {
7613 pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
7614 greedy: true,
7615 inside: {
7616 'tag': {
7617 pattern: /^<\/?[^\s>\/]+/,
7618 inside: {
7619 'punctuation': /^<\/?/,
7620 'namespace': /^[^\s>\/:]+:/
7621 }
7622 },
7623 'special-attr': [],
7624 'attr-value': {
7625 pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
7626 inside: {
7627 'punctuation': [
7628 {
7629 pattern: /^=/,
7630 alias: 'attr-equals'
7631 },
7632 {
7633 pattern: /^(\s*)["']|["']$/,
7634 lookbehind: true
7635 }
7636 ]
7637 }
7638 },
7639 'punctuation': /\/?>/,
7640 'attr-name': {
7641 pattern: /[^\s>\/]+/,
7642 inside: {
7643 'namespace': /^[^\s>\/:]+:/
7644 }
7645 }
7646
7647 }
7648 },
7649 'entity': [
7650 {
7651 pattern: /&[\da-z]{1,8};/i,
7652 alias: 'named-entity'
7653 },
7654 /&#x?[\da-f]{1,8};/i
7655 ]
7656 };
7657
7658 Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
7659 Prism.languages.markup['entity'];
7660 Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;
7661
7662 // Plugin to make entity title show the real entity, idea by Roman Komarov
7663 Prism.hooks.add('wrap', function (env) {
7664
7665 if (env.type === 'entity') {
7666 env.attributes['title'] = env.content.replace(/&amp;/, '&');
7667 }
7668 });
7669
7670 Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
7671 /**
7672 * Adds an inlined language to markup.
7673 *
7674 * An example of an inlined language is CSS with `<style>` tags.
7675 *
7676 * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
7677 * case insensitive.
7678 * @param {string} lang The language key.
7679 * @example
7680 * addInlined('style', 'css');
7681 */
7682 value: function addInlined(tagName, lang) {
7683 var includedCdataInside = {};
7684 includedCdataInside['language-' + lang] = {
7685 pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
7686 lookbehind: true,
7687 inside: Prism.languages[lang]
7688 };
7689 includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
7690
7691 var inside = {
7692 'included-cdata': {
7693 pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
7694 inside: includedCdataInside
7695 }
7696 };
7697 inside['language-' + lang] = {
7698 pattern: /[\s\S]+/,
7699 inside: Prism.languages[lang]
7700 };
7701
7702 var def = {};
7703 def[tagName] = {
7704 pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),
7705 lookbehind: true,
7706 greedy: true,
7707 inside: inside
7708 };
7709
7710 Prism.languages.insertBefore('markup', 'cdata', def);
7711 }
7712 });
7713 Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
7714 /**
7715 * Adds an pattern to highlight languages embedded in HTML attributes.
7716 *
7717 * An example of an inlined language is CSS with `style` attributes.
7718 *
7719 * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
7720 * case insensitive.
7721 * @param {string} lang The language key.
7722 * @example
7723 * addAttribute('style', 'css');
7724 */
7725 value: function (attrName, lang) {
7726 Prism.languages.markup.tag.inside['special-attr'].push({
7727 pattern: RegExp(
7728 /(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
7729 'i'
7730 ),
7731 lookbehind: true,
7732 inside: {
7733 'attr-name': /^[^\s=]+/,
7734 'attr-value': {
7735 pattern: /=[\s\S]+/,
7736 inside: {
7737 'value': {
7738 pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
7739 lookbehind: true,
7740 alias: [lang, 'language-' + lang],
7741 inside: Prism.languages[lang]
7742 },
7743 'punctuation': [
7744 {
7745 pattern: /^=/,
7746 alias: 'attr-equals'
7747 },
7748 /"|'/
7749 ]
7750 }
7751 }
7752 }
7753 });
7754 }
7755 });
7756
7757 Prism.languages.html = Prism.languages.markup;
7758 Prism.languages.mathml = Prism.languages.markup;
7759 Prism.languages.svg = Prism.languages.markup;
7760
7761 Prism.languages.xml = Prism.languages.extend('markup', {});
7762 Prism.languages.ssml = Prism.languages.xml;
7763 Prism.languages.atom = Prism.languages.xml;
7764 Prism.languages.rss = Prism.languages.xml;
7765
7766
7767 /* **********************************************
7768 Begin prism-css.js
7769 ********************************************** */
7770
7771 (function (Prism) {
7772
7773 var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
7774
7775 Prism.languages.css = {
7776 'comment': /\/\*[\s\S]*?\*\//,
7777 'atrule': {
7778 pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
7779 inside: {
7780 'rule': /^@[\w-]+/,
7781 'selector-function-argument': {
7782 pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
7783 lookbehind: true,
7784 alias: 'selector'
7785 },
7786 'keyword': {
7787 pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
7788 lookbehind: true
7789 }
7790 // See rest below
7791 }
7792 },
7793 'url': {
7794 // https://drafts.csswg.org/css-values-3/#urls
7795 pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
7796 greedy: true,
7797 inside: {
7798 'function': /^url/i,
7799 'punctuation': /^\(|\)$/,
7800 'string': {
7801 pattern: RegExp('^' + string.source + '$'),
7802 alias: 'url'
7803 }
7804 }
7805 },
7806 'selector': {
7807 pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
7808 lookbehind: true
7809 },
7810 'string': {
7811 pattern: string,
7812 greedy: true
7813 },
7814 'property': {
7815 pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
7816 lookbehind: true
7817 },
7818 'important': /!important\b/i,
7819 'function': {
7820 pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
7821 lookbehind: true
7822 },
7823 'punctuation': /[(){};:,]/
7824 };
7825
7826 Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
7827
7828 var markup = Prism.languages.markup;
7829 if (markup) {
7830 markup.tag.addInlined('style', 'css');
7831 markup.tag.addAttribute('style', 'css');
7832 }
7833
7834 }(Prism));
7835
7836
7837 /* **********************************************
7838 Begin prism-clike.js
7839 ********************************************** */
7840
7841 Prism.languages.clike = {
7842 'comment': [
7843 {
7844 pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
7845 lookbehind: true,
7846 greedy: true
7847 },
7848 {
7849 pattern: /(^|[^\\:])\/\/.*/,
7850 lookbehind: true,
7851 greedy: true
7852 }
7853 ],
7854 'string': {
7855 pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
7856 greedy: true
7857 },
7858 'class-name': {
7859 pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
7860 lookbehind: true,
7861 inside: {
7862 'punctuation': /[.\\]/
7863 }
7864 },
7865 'keyword': /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
7866 'boolean': /\b(?:false|true)\b/,
7867 'function': /\b\w+(?=\()/,
7868 'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
7869 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
7870 'punctuation': /[{}[\];(),.:]/
7871 };
7872
7873
7874 /* **********************************************
7875 Begin prism-javascript.js
7876 ********************************************** */
7877
7878 Prism.languages.javascript = Prism.languages.extend('clike', {
7879 'class-name': [
7880 Prism.languages.clike['class-name'],
7881 {
7882 pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
7883 lookbehind: true
7884 }
7885 ],
7886 'keyword': [
7887 {
7888 pattern: /((?:^|\})\s*)catch\b/,
7889 lookbehind: true
7890 },
7891 {
7892 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/,
7893 lookbehind: true
7894 } ],
7895 // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
7896 'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
7897 'number': {
7898 pattern: RegExp(
7899 /(^|[^\w$])/.source +
7900 '(?:' +
7901 (
7902 // constant
7903 /NaN|Infinity/.source +
7904 '|' +
7905 // binary integer
7906 /0[bB][01]+(?:_[01]+)*n?/.source +
7907 '|' +
7908 // octal integer
7909 /0[oO][0-7]+(?:_[0-7]+)*n?/.source +
7910 '|' +
7911 // hexadecimal integer
7912 /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source +
7913 '|' +
7914 // decimal bigint
7915 /\d+(?:_\d+)*n/.source +
7916 '|' +
7917 // decimal number (integer or float) but no bigint
7918 /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source
7919 ) +
7920 ')' +
7921 /(?![\w$])/.source
7922 ),
7923 lookbehind: true
7924 },
7925 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
7926 });
7927
7928 Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
7929
7930 Prism.languages.insertBefore('javascript', 'keyword', {
7931 'regex': {
7932 pattern: RegExp(
7933 // lookbehind
7934 // eslint-disable-next-line regexp/no-dupe-characters-character-class
7935 /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source +
7936 // Regex pattern:
7937 // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
7938 // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
7939 // with the only syntax, so we have to define 2 different regex patterns.
7940 /\//.source +
7941 '(?:' +
7942 /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source +
7943 '|' +
7944 // `v` flag syntax. This supports 3 levels of nested character classes.
7945 /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source +
7946 ')' +
7947 // lookahead
7948 /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
7949 ),
7950 lookbehind: true,
7951 greedy: true,
7952 inside: {
7953 'regex-source': {
7954 pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
7955 lookbehind: true,
7956 alias: 'language-regex',
7957 inside: Prism.languages.regex
7958 },
7959 'regex-delimiter': /^\/|\/$/,
7960 'regex-flags': /^[a-z]+$/,
7961 }
7962 },
7963 // This must be declared before keyword because we use "function" inside the look-forward
7964 'function-variable': {
7965 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*=>))/,
7966 alias: 'function'
7967 },
7968 'parameter': [
7969 {
7970 pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
7971 lookbehind: true,
7972 inside: Prism.languages.javascript
7973 },
7974 {
7975 pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
7976 lookbehind: true,
7977 inside: Prism.languages.javascript
7978 },
7979 {
7980 pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
7981 lookbehind: true,
7982 inside: Prism.languages.javascript
7983 },
7984 {
7985 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*\{)/,
7986 lookbehind: true,
7987 inside: Prism.languages.javascript
7988 }
7989 ],
7990 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
7991 });
7992
7993 Prism.languages.insertBefore('javascript', 'string', {
7994 'hashbang': {
7995 pattern: /^#!.*/,
7996 greedy: true,
7997 alias: 'comment'
7998 },
7999 'template-string': {
8000 pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
8001 greedy: true,
8002 inside: {
8003 'template-punctuation': {
8004 pattern: /^`|`$/,
8005 alias: 'string'
8006 },
8007 'interpolation': {
8008 pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
8009 lookbehind: true,
8010 inside: {
8011 'interpolation-punctuation': {
8012 pattern: /^\$\{|\}$/,
8013 alias: 'punctuation'
8014 },
8015 rest: Prism.languages.javascript
8016 }
8017 },
8018 'string': /[\s\S]+/
8019 }
8020 },
8021 'string-property': {
8022 pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
8023 lookbehind: true,
8024 greedy: true,
8025 alias: 'property'
8026 }
8027 });
8028
8029 Prism.languages.insertBefore('javascript', 'operator', {
8030 'literal-property': {
8031 pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
8032 lookbehind: true,
8033 alias: 'property'
8034 },
8035 });
8036
8037 if (Prism.languages.markup) {
8038 Prism.languages.markup.tag.addInlined('script', 'javascript');
8039
8040 // add attribute support for all DOM events.
8041 // https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events
8042 Prism.languages.markup.tag.addAttribute(
8043 /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,
8044 'javascript'
8045 );
8046 }
8047
8048 Prism.languages.js = Prism.languages.javascript;
8049
8050
8051 /* **********************************************
8052 Begin prism-file-highlight.js
8053 ********************************************** */
8054
8055 (function () {
8056
8057 if (typeof Prism === 'undefined' || typeof document === 'undefined') {
8058 return;
8059 }
8060
8061 // https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
8062 if (!Element.prototype.matches) {
8063 Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
8064 }
8065
8066 var LOADING_MESSAGE = 'Loading…';
8067 var FAILURE_MESSAGE = function (status, message) {
8068 return '✖ Error ' + status + ' while fetching file: ' + message;
8069 };
8070 var FAILURE_EMPTY_MESSAGE = '✖ Error: File does not exist or is empty';
8071
8072 var EXTENSIONS = {
8073 'js': 'javascript',
8074 'py': 'python',
8075 'rb': 'ruby',
8076 'ps1': 'powershell',
8077 'psm1': 'powershell',
8078 'sh': 'bash',
8079 'bat': 'batch',
8080 'h': 'c',
8081 'tex': 'latex'
8082 };
8083
8084 var STATUS_ATTR = 'data-src-status';
8085 var STATUS_LOADING = 'loading';
8086 var STATUS_LOADED = 'loaded';
8087 var STATUS_FAILED = 'failed';
8088
8089 var SELECTOR = 'pre[data-src]:not([' + STATUS_ATTR + '="' + STATUS_LOADED + '"])'
8090 + ':not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])';
8091
8092 /**
8093 * Loads the given file.
8094 *
8095 * @param {string} src The URL or path of the source file to load.
8096 * @param {(result: string) => void} success
8097 * @param {(reason: string) => void} error
8098 */
8099 function loadFile(src, success, error) {
8100 var xhr = new XMLHttpRequest();
8101 xhr.open('GET', src, true);
8102 xhr.onreadystatechange = function () {
8103 if (xhr.readyState == 4) {
8104 if (xhr.status < 400 && xhr.responseText) {
8105 success(xhr.responseText);
8106 } else {
8107 if (xhr.status >= 400) {
8108 error(FAILURE_MESSAGE(xhr.status, xhr.statusText));
8109 } else {
8110 error(FAILURE_EMPTY_MESSAGE);
8111 }
8112 }
8113 }
8114 };
8115 xhr.send(null);
8116 }
8117
8118 /**
8119 * Parses the given range.
8120 *
8121 * This returns a range with inclusive ends.
8122 *
8123 * @param {string | null | undefined} range
8124 * @returns {[number, number | undefined] | undefined}
8125 */
8126 function parseRange(range) {
8127 var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range || '');
8128 if (m) {
8129 var start = Number(m[1]);
8130 var comma = m[2];
8131 var end = m[3];
8132
8133 if (!comma) {
8134 return [start, start];
8135 }
8136 if (!end) {
8137 return [start, undefined];
8138 }
8139 return [start, Number(end)];
8140 }
8141 return undefined;
8142 }
8143
8144 Prism.hooks.add('before-highlightall', function (env) {
8145 env.selector += ', ' + SELECTOR;
8146 });
8147
8148 Prism.hooks.add('before-sanity-check', function (env) {
8149 var pre = /** @type {HTMLPreElement} */ (env.element);
8150 if (pre.matches(SELECTOR)) {
8151 env.code = ''; // fast-path the whole thing and go to complete
8152
8153 pre.setAttribute(STATUS_ATTR, STATUS_LOADING); // mark as loading
8154
8155 // add code element with loading message
8156 var code = pre.appendChild(document.createElement('CODE'));
8157 code.textContent = LOADING_MESSAGE;
8158
8159 var src = pre.getAttribute('data-src');
8160
8161 var language = env.language;
8162 if (language === 'none') {
8163 // the language might be 'none' because there is no language set;
8164 // in this case, we want to use the extension as the language
8165 var extension = (/\.(\w+)$/.exec(src) || [, 'none'])[1];
8166 language = EXTENSIONS[extension] || extension;
8167 }
8168
8169 // set language classes
8170 Prism.util.setLanguage(code, language);
8171 Prism.util.setLanguage(pre, language);
8172
8173 // preload the language
8174 var autoloader = Prism.plugins.autoloader;
8175 if (autoloader) {
8176 autoloader.loadLanguages(language);
8177 }
8178
8179 // load file
8180 loadFile(
8181 src,
8182 function (text) {
8183 // mark as loaded
8184 pre.setAttribute(STATUS_ATTR, STATUS_LOADED);
8185
8186 // handle data-range
8187 var range = parseRange(pre.getAttribute('data-range'));
8188 if (range) {
8189 var lines = text.split(/\r\n?|\n/g);
8190
8191 // the range is one-based and inclusive on both ends
8192 var start = range[0];
8193 var end = range[1] == null ? lines.length : range[1];
8194
8195 if (start < 0) { start += lines.length; }
8196 start = Math.max(0, Math.min(start - 1, lines.length));
8197 if (end < 0) { end += lines.length; }
8198 end = Math.max(0, Math.min(end, lines.length));
8199
8200 text = lines.slice(start, end).join('\n');
8201
8202 // add data-start for line numbers
8203 if (!pre.hasAttribute('data-start')) {
8204 pre.setAttribute('data-start', String(start + 1));
8205 }
8206 }
8207
8208 // highlight code
8209 code.textContent = text;
8210 Prism.highlightElement(code);
8211 },
8212 function (error) {
8213 // mark as failed
8214 pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
8215
8216 code.textContent = error;
8217 }
8218 );
8219 }
8220 });
8221
8222 Prism.plugins.fileHighlight = {
8223 /**
8224 * Executes the File Highlight plugin for all matching `pre` elements under the given container.
8225 *
8226 * Note: Elements which are already loaded or currently loading will not be touched by this method.
8227 *
8228 * @param {ParentNode} [container=document]
8229 */
8230 highlight: function highlight(container) {
8231 var elements = (container || document).querySelectorAll(SELECTOR);
8232
8233 for (var i = 0, element; (element = elements[i++]);) {
8234 Prism.highlightElement(element);
8235 }
8236 }
8237 };
8238
8239 var logged = false;
8240 /** @deprecated Use `Prism.plugins.fileHighlight.highlight` instead. */
8241 Prism.fileHighlight = function () {
8242 if (!logged) {
8243 console.warn('Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead.');
8244 logged = true;
8245 }
8246 Prism.plugins.fileHighlight.highlight.apply(this, arguments);
8247 };
8248
8249 }());
8250 });
8251
8252 (function (Prism) {
8253
8254 /**
8255 * Returns the placeholder for the given language id and index.
8256 *
8257 * @param {string} language
8258 * @param {string|number} index
8259 * @returns {string}
8260 */
8261 function getPlaceholder(language, index) {
8262 return '___' + language.toUpperCase() + index + '___';
8263 }
8264
8265 Object.defineProperties(Prism.languages['markup-templating'] = {}, {
8266 buildPlaceholders: {
8267 /**
8268 * Tokenize all inline templating expressions matching `placeholderPattern`.
8269 *
8270 * If `replaceFilter` is provided, only matches of `placeholderPattern` for which `replaceFilter` returns
8271 * `true` will be replaced.
8272 *
8273 * @param {object} env The environment of the `before-tokenize` hook.
8274 * @param {string} language The language id.
8275 * @param {RegExp} placeholderPattern The matches of this pattern will be replaced by placeholders.
8276 * @param {(match: string) => boolean} [replaceFilter]
8277 */
8278 value: function (env, language, placeholderPattern, replaceFilter) {
8279 if (env.language !== language) {
8280 return;
8281 }
8282
8283 var tokenStack = env.tokenStack = [];
8284
8285 env.code = env.code.replace(placeholderPattern, function (match) {
8286 if (typeof replaceFilter === 'function' && !replaceFilter(match)) {
8287 return match;
8288 }
8289 var i = tokenStack.length;
8290 var placeholder;
8291
8292 // Check for existing strings
8293 while (env.code.indexOf(placeholder = getPlaceholder(language, i)) !== -1) {
8294 ++i;
8295 }
8296
8297 // Create a sparse array
8298 tokenStack[i] = match;
8299
8300 return placeholder;
8301 });
8302
8303 // Switch the grammar to markup
8304 env.grammar = Prism.languages.markup;
8305 }
8306 },
8307 tokenizePlaceholders: {
8308 /**
8309 * Replace placeholders with proper tokens after tokenizing.
8310 *
8311 * @param {object} env The environment of the `after-tokenize` hook.
8312 * @param {string} language The language id.
8313 */
8314 value: function (env, language) {
8315 if (env.language !== language || !env.tokenStack) {
8316 return;
8317 }
8318
8319 // Switch the grammar back
8320 env.grammar = Prism.languages[language];
8321
8322 var j = 0;
8323 var keys = Object.keys(env.tokenStack);
8324
8325 function walkTokens(tokens) {
8326 for (var i = 0; i < tokens.length; i++) {
8327 // all placeholders are replaced already
8328 if (j >= keys.length) {
8329 break;
8330 }
8331
8332 var token = tokens[i];
8333 if (typeof token === 'string' || (token.content && typeof token.content === 'string')) {
8334 var k = keys[j];
8335 var t = env.tokenStack[k];
8336 var s = typeof token === 'string' ? token : token.content;
8337 var placeholder = getPlaceholder(language, k);
8338
8339 var index = s.indexOf(placeholder);
8340 if (index > -1) {
8341 ++j;
8342
8343 var before = s.substring(0, index);
8344 var middle = new Prism.Token(language, Prism.tokenize(t, env.grammar), 'language-' + language, t);
8345 var after = s.substring(index + placeholder.length);
8346
8347 var replacement = [];
8348 if (before) {
8349 replacement.push.apply(replacement, walkTokens([before]));
8350 }
8351 replacement.push(middle);
8352 if (after) {
8353 replacement.push.apply(replacement, walkTokens([after]));
8354 }
8355
8356 if (typeof token === 'string') {
8357 tokens.splice.apply(tokens, [i, 1].concat(replacement));
8358 } else {
8359 token.content = replacement;
8360 }
8361 }
8362 } else if (token.content /* && typeof token.content !== 'string' */) {
8363 walkTokens(token.content);
8364 }
8365 }
8366
8367 return tokens;
8368 }
8369
8370 walkTokens(env.tokens);
8371 }
8372 }
8373 });
8374
8375 }(Prism));
8376
8377 var highlightCodeCompiler = function (ref) {
8378 var renderer = ref.renderer;
8379
8380 return (renderer.code = function (code, lang) {
8381 if ( lang === void 0 ) lang = 'markup';
8382
8383 var langOrMarkup = prism.languages[lang] || prism.languages.markup;
8384 var text = prism.highlight(
8385 code.replace(/@DOCSIFY_QM@/g, '`'),
8386 langOrMarkup,
8387 lang
8388 );
8389
8390 return ("<pre v-pre data-lang=\"" + lang + "\"><code class=\"lang-" + lang + "\">" + text + "</code></pre>");
8391 });
8392 };
8393
8394 var paragraphCompiler = function (ref) {
8395 var renderer = ref.renderer;
8396
8397 return (renderer.paragraph = function (text) {
8398 var result;
8399 if (/^!&gt;/.test(text)) {
8400 result = helper('tip', text);
8401 } else if (/^\?&gt;/.test(text)) {
8402 result = helper('warn', text);
8403 } else {
8404 result = "<p>" + text + "</p>";
8405 }
8406
8407 return result;
8408 });
8409 };
8410
8411 var taskListCompiler = function (ref) {
8412 var renderer = ref.renderer;
8413
8414 return (renderer.list = function (body, ordered, start) {
8415 var isTaskList = /<li class="task-list-item">/.test(
8416 body.split('class="task-list"')[0]
8417 );
8418 var isStartReq = start && start > 1;
8419 var tag = ordered ? 'ol' : 'ul';
8420 var tagAttrs = [
8421 isTaskList ? 'class="task-list"' : '',
8422 isStartReq ? ("start=\"" + start + "\"") : '' ]
8423 .join(' ')
8424 .trim();
8425
8426 return ("<" + tag + " " + tagAttrs + ">" + body + "</" + tag + ">");
8427 });
8428 };
8429
8430 var taskListItemCompiler = function (ref) {
8431 var renderer = ref.renderer;
8432
8433 return (renderer.listitem = function (text) {
8434 var isTaskItem = /^(<input.*type="checkbox"[^>]*>)/.test(text);
8435 var html = isTaskItem
8436 ? ("<li class=\"task-list-item\"><label>" + text + "</label></li>")
8437 : ("<li>" + text + "</li>");
8438
8439 return html;
8440 });
8441 };
8442
8443 var linkCompiler = function (ref) {
8444 var renderer = ref.renderer;
8445 var router = ref.router;
8446 var linkTarget = ref.linkTarget;
8447 var linkRel = ref.linkRel;
8448 var compilerClass = ref.compilerClass;
8449
8450 return (renderer.link = function (href, title, text) {
8451 if ( title === void 0 ) title = '';
8452
8453 var attrs = [];
8454 var ref = getAndRemoveConfig(title);
8455 var str = ref.str;
8456 var config = ref.config;
8457 linkTarget = config.target || linkTarget;
8458 linkRel =
8459 linkTarget === '_blank'
8460 ? compilerClass.config.externalLinkRel || 'noopener'
8461 : '';
8462 title = str;
8463
8464 if (
8465 !isAbsolutePath(href) &&
8466 !compilerClass._matchNotCompileLink(href) &&
8467 !config.ignore
8468 ) {
8469 if (href === compilerClass.config.homepage) {
8470 href = 'README';
8471 }
8472
8473 href = router.toURL(href, null, router.getCurrentPath());
8474 } else {
8475 if (!isAbsolutePath(href) && href.slice(0, 2) === './') {
8476 href =
8477 document.URL.replace(/\/(?!.*\/).*/, '/').replace('#/./', '') + href;
8478 }
8479 attrs.push(href.indexOf('mailto:') === 0 ? '' : ("target=\"" + linkTarget + "\""));
8480 attrs.push(
8481 href.indexOf('mailto:') === 0
8482 ? ''
8483 : linkRel !== ''
8484 ? (" rel=\"" + linkRel + "\"")
8485 : ''
8486 );
8487 }
8488
8489 if (config.disabled) {
8490 attrs.push('disabled');
8491 href = 'javascript:void(0)';
8492 }
8493
8494 if (config.class) {
8495 attrs.push(("class=\"" + (config.class) + "\""));
8496 }
8497
8498 if (config.id) {
8499 attrs.push(("id=\"" + (config.id) + "\""));
8500 }
8501
8502 if (title) {
8503 attrs.push(("title=\"" + title + "\""));
8504 }
8505
8506 return ("<a href=\"" + href + "\" " + (attrs.join(' ')) + ">" + text + "</a>");
8507 });
8508 };
8509
8510 var cachedLinks = {};
8511
8512 var compileMedia = {
8513 markdown: function markdown(url) {
8514 return {
8515 url: url,
8516 };
8517 },
8518 mermaid: function mermaid(url) {
8519 return {
8520 url: url,
8521 };
8522 },
8523 iframe: function iframe(url, title) {
8524 return {
8525 html: ("<iframe src=\"" + url + "\" " + (title || 'width=100% height=400') + "></iframe>"),
8526 };
8527 },
8528 video: function video(url, title) {
8529 return {
8530 html: ("<video src=\"" + url + "\" " + (title || 'controls') + ">Not Support</video>"),
8531 };
8532 },
8533 audio: function audio(url, title) {
8534 return {
8535 html: ("<audio src=\"" + url + "\" " + (title || 'controls') + ">Not Support</audio>"),
8536 };
8537 },
8538 code: function code(url, title) {
8539 var lang = url.match(/\.(\w+)$/);
8540
8541 lang = title || (lang && lang[1]);
8542 if (lang === 'md') {
8543 lang = 'markdown';
8544 }
8545
8546 return {
8547 url: url,
8548 lang: lang,
8549 };
8550 },
8551 };
8552
8553 var Compiler = function Compiler(config, router) {
8554 var this$1 = this;
8555
8556 this.config = config;
8557 this.router = router;
8558 this.cacheTree = {};
8559 this.toc = [];
8560 this.cacheTOC = {};
8561 this.linkTarget = config.externalLinkTarget || '_blank';
8562 this.linkRel =
8563 this.linkTarget === '_blank' ? config.externalLinkRel || 'noopener' : '';
8564 this.contentBase = router.getBasePath();
8565
8566 var renderer = this._initRenderer();
8567 this.heading = renderer.heading;
8568 var compile;
8569 var mdConf = config.markdown || {};
8570
8571 if (isFn(mdConf)) {
8572 compile = mdConf(marked_1, renderer);
8573 } else {
8574 marked_1.setOptions(
8575 merge(mdConf, {
8576 renderer: merge(renderer, mdConf.renderer),
8577 })
8578 );
8579 compile = marked_1;
8580 }
8581
8582 this._marked = compile;
8583 this.compile = function (text) {
8584 var isCached = true;
8585 // eslint-disable-next-line no-unused-vars
8586 var result = cached(function (_) {
8587 isCached = false;
8588 var html = '';
8589
8590 if (!text) {
8591 return text;
8592 }
8593
8594 if (isPrimitive(text)) {
8595 html = compile(text);
8596 } else {
8597 html = compile.parser(text);
8598 }
8599
8600 html = config.noEmoji ? html : emojify(html, config.nativeEmoji);
8601 slugify.clear();
8602
8603 return html;
8604 })(text);
8605
8606 var curFileName = this$1.router.parse().file;
8607
8608 if (isCached) {
8609 this$1.toc = this$1.cacheTOC[curFileName];
8610 } else {
8611 this$1.cacheTOC[curFileName] = [].concat( this$1.toc );
8612 }
8613
8614 return result;
8615 };
8616 };
8617
8618 /**
8619 * Pulls content from file and renders inline on the page as a embedded item.
8620 *
8621 * This allows you to embed different file types on the returned
8622 * page.
8623 * The basic format is:
8624 * ```
8625 * [filename](_media/example.md ':include')
8626 * ```
8627 *
8628 * @param {string} href The href to the file to embed in the page.
8629 * @param {string} titleTitle of the link used to make the embed.
8630 *
8631 * @return {type} Return value description.
8632 */
8633 Compiler.prototype.compileEmbed = function compileEmbed (href, title) {
8634 var ref = getAndRemoveConfig(title);
8635 var str = ref.str;
8636 var config = ref.config;
8637 var embed;
8638 title = str;
8639
8640 if (config.include) {
8641 if (!isAbsolutePath(href)) {
8642 href = getPath(
8643 this.contentBase,
8644 getParentPath(this.router.getCurrentPath()),
8645 href
8646 );
8647 }
8648
8649 var media;
8650 if (config.type && (media = compileMedia[config.type])) {
8651 embed = media.call(this, href, title);
8652 embed.type = config.type;
8653 } else {
8654 var type = 'code';
8655 if (/\.(md|markdown)/.test(href)) {
8656 type = 'markdown';
8657 } else if (/\.mmd/.test(href)) {
8658 type = 'mermaid';
8659 } else if (/\.html?/.test(href)) {
8660 type = 'iframe';
8661 } else if (/\.(mp4|ogg)/.test(href)) {
8662 type = 'video';
8663 } else if (/\.mp3/.test(href)) {
8664 type = 'audio';
8665 }
8666
8667 embed = compileMedia[type].call(this, href, title);
8668 embed.type = type;
8669 }
8670
8671 embed.fragment = config.fragment;
8672
8673 return embed;
8674 }
8675 };
8676
8677 Compiler.prototype._matchNotCompileLink = function _matchNotCompileLink (link) {
8678 var links = this.config.noCompileLinks || [];
8679
8680 for (var i = 0; i < links.length; i++) {
8681 var n = links[i];
8682 var re = cachedLinks[n] || (cachedLinks[n] = new RegExp(("^" + n + "$")));
8683
8684 if (re.test(link)) {
8685 return link;
8686 }
8687 }
8688 };
8689
8690 Compiler.prototype._initRenderer = function _initRenderer () {
8691 var renderer = new marked_1.Renderer();
8692 var ref = this;
8693 var linkTarget = ref.linkTarget;
8694 var linkRel = ref.linkRel;
8695 var router = ref.router;
8696 var contentBase = ref.contentBase;
8697 var _self = this;
8698 var origin = {};
8699
8700 /**
8701 * Render anchor tag
8702 * @link https://github.com/markedjs/marked#overriding-renderer-methods
8703 * @param {String} text Text content
8704 * @param {Number} level Type of heading (h<level> tag)
8705 * @returns {String} Heading element
8706 */
8707 origin.heading = renderer.heading = function (text, level) {
8708 var ref = getAndRemoveConfig(text);
8709 var str = ref.str;
8710 var config = ref.config;
8711 var nextToc = { level: level, title: removeAtag(str) };
8712
8713 if (/<!-- {docsify-ignore} -->/g.test(str)) {
8714 str = str.replace('<!-- {docsify-ignore} -->', '');
8715 nextToc.title = removeAtag(str);
8716 nextToc.ignoreSubHeading = true;
8717 }
8718
8719 if (/{docsify-ignore}/g.test(str)) {
8720 str = str.replace('{docsify-ignore}', '');
8721 nextToc.title = removeAtag(str);
8722 nextToc.ignoreSubHeading = true;
8723 }
8724
8725 if (/<!-- {docsify-ignore-all} -->/g.test(str)) {
8726 str = str.replace('<!-- {docsify-ignore-all} -->', '');
8727 nextToc.title = removeAtag(str);
8728 nextToc.ignoreAllSubs = true;
8729 }
8730
8731 if (/{docsify-ignore-all}/g.test(str)) {
8732 str = str.replace('{docsify-ignore-all}', '');
8733 nextToc.title = removeAtag(str);
8734 nextToc.ignoreAllSubs = true;
8735 }
8736
8737 var slug = slugify(config.id || str);
8738 var url = router.toURL(router.getCurrentPath(), { id: slug });
8739 nextToc.slug = url;
8740 _self.toc.push(nextToc);
8741
8742 return ("<h" + level + " id=\"" + slug + "\"><a href=\"" + url + "\" data-id=\"" + slug + "\" class=\"anchor\"><span>" + str + "</span></a></h" + level + ">");
8743 };
8744
8745 origin.code = highlightCodeCompiler({ renderer: renderer });
8746 origin.link = linkCompiler({
8747 renderer: renderer,
8748 router: router,
8749 linkTarget: linkTarget,
8750 linkRel: linkRel,
8751 compilerClass: _self,
8752 });
8753 origin.paragraph = paragraphCompiler({ renderer: renderer });
8754 origin.image = imageCompiler({ renderer: renderer, contentBase: contentBase, router: router });
8755 origin.list = taskListCompiler({ renderer: renderer });
8756 origin.listitem = taskListItemCompiler({ renderer: renderer });
8757
8758 renderer.origin = origin;
8759
8760 return renderer;
8761 };
8762
8763 /**
8764 * Compile sidebar
8765 * @param {String} text Text content
8766 * @param {Number} level Type of heading (h<level> tag)
8767 * @returns {String} Sidebar element
8768 */
8769 Compiler.prototype.sidebar = function sidebar (text, level) {
8770 var ref = this;
8771 var toc = ref.toc;
8772 var currentPath = this.router.getCurrentPath();
8773 var html = '';
8774
8775 if (text) {
8776 html = this.compile(text);
8777 } else {
8778 for (var i = 0; i < toc.length; i++) {
8779 if (toc[i].ignoreSubHeading) {
8780 var deletedHeaderLevel = toc[i].level;
8781 toc.splice(i, 1);
8782 // Remove headers who are under current header
8783 for (
8784 var j = i;
8785 j < toc.length && deletedHeaderLevel < toc[j].level;
8786 j++
8787 ) {
8788 toc.splice(j, 1) && j-- && i++;
8789 }
8790
8791 i--;
8792 }
8793 }
8794
8795 var tree$1 = this.cacheTree[currentPath] || genTree(toc, level);
8796 html = tree(tree$1, '<ul>{inner}</ul>');
8797 this.cacheTree[currentPath] = tree$1;
8798 }
8799
8800 return html;
8801 };
8802
8803 /**
8804 * Compile sub sidebar
8805 * @param {Number} level Type of heading (h<level> tag)
8806 * @returns {String} Sub-sidebar element
8807 */
8808 Compiler.prototype.subSidebar = function subSidebar (level) {
8809 if (!level) {
8810 this.toc = [];
8811 return;
8812 }
8813
8814 var currentPath = this.router.getCurrentPath();
8815 var ref = this;
8816 var cacheTree = ref.cacheTree;
8817 var toc = ref.toc;
8818
8819 toc[0] && toc[0].ignoreAllSubs && toc.splice(0);
8820 toc[0] && toc[0].level === 1 && toc.shift();
8821
8822 for (var i = 0; i < toc.length; i++) {
8823 toc[i].ignoreSubHeading && toc.splice(i, 1) && i--;
8824 }
8825
8826 var tree$1 = cacheTree[currentPath] || genTree(toc, level);
8827
8828 cacheTree[currentPath] = tree$1;
8829 this.toc = [];
8830 return tree(tree$1);
8831 };
8832
8833 Compiler.prototype.header = function header (text, level) {
8834 return this.heading(text, level);
8835 };
8836
8837 Compiler.prototype.article = function article (text) {
8838 return this.compile(text);
8839 };
8840
8841 /**
8842 * Compile cover page
8843 * @param {Text} text Text content
8844 * @returns {String} Cover page
8845 */
8846 Compiler.prototype.cover = function cover (text) {
8847 var cacheToc = this.toc.slice();
8848 var html = this.compile(text);
8849
8850 this.toc = cacheToc.slice();
8851
8852 return html;
8853 };
8854
8855 var minIndent = function (string) {
8856 var match = string.match(/^[ \t]*(?=\S)/gm);
8857
8858 if (!match) {
8859 return 0;
8860 }
8861
8862 return match.reduce(function (r, a) { return Math.min(r, a.length); }, Infinity);
8863 };
8864
8865 var stripIndent = function (string) {
8866 var indent = minIndent(string);
8867
8868 if (indent === 0) {
8869 return string;
8870 }
8871
8872 var regex = new RegExp(("^[ \\t]{" + indent + "}"), 'gm');
8873
8874 return string.replace(regex, '');
8875 };
8876
8877 var cached$2 = {};
8878
8879 function walkFetchEmbed(ref, cb) {
8880 var embedTokens = ref.embedTokens;
8881 var compile = ref.compile;
8882 var fetch = ref.fetch;
8883
8884 var token;
8885 var step = 0;
8886 var count = 1;
8887
8888 if (!embedTokens.length) {
8889 return cb({});
8890 }
8891
8892 while ((token = embedTokens[step++])) {
8893 // eslint-disable-next-line no-shadow
8894 var next = (function (token) {
8895 return function (text) {
8896 var embedToken;
8897 if (text) {
8898 if (token.embed.type === 'markdown') {
8899 var path = token.embed.url.split('/');
8900 path.pop();
8901 path = path.join('/');
8902 // Resolves relative links to absolute
8903 text = text.replace(/\[([^[\]]+)\]\(([^)]+)\)/g, function (x) {
8904 var linkBeginIndex = x.indexOf('(');
8905 if (x.slice(linkBeginIndex, linkBeginIndex + 2) === '(.') {
8906 return (
8907 x.substring(0, linkBeginIndex) +
8908 "(" + (window.location.protocol) + "//" + (window.location.host) + path + "/" +
8909 x.substring(linkBeginIndex + 1, x.length - 1) +
8910 ')'
8911 );
8912 }
8913 return x;
8914 });
8915
8916 // This may contain YAML front matter and will need to be stripped.
8917 var frontMatterInstalled =
8918 ($docsify.frontMatter || {}).installed || false;
8919 if (frontMatterInstalled === true) {
8920 text = $docsify.frontMatter.parseMarkdown(text);
8921 }
8922
8923 embedToken = compile.lexer(text);
8924 } else if (token.embed.type === 'code') {
8925 if (token.embed.fragment) {
8926 var fragment = token.embed.fragment;
8927 var pattern = new RegExp(
8928 ("(?:###|\\/\\/\\/)\\s*\\[" + fragment + "\\]([\\s\\S]*)(?:###|\\/\\/\\/)\\s*\\[" + fragment + "\\]")
8929 );
8930 text = stripIndent((text.match(pattern) || [])[1] || '').trim();
8931 }
8932
8933 embedToken = compile.lexer(
8934 '```' +
8935 token.embed.lang +
8936 '\n' +
8937 text.replace(/`/g, '@DOCSIFY_QM@') +
8938 '\n```\n'
8939 );
8940 } else if (token.embed.type === 'mermaid') {
8941 embedToken = [
8942 { type: 'html', text: ("<div class=\"mermaid\">\n" + text + "\n</div>") } ];
8943 embedToken.links = {};
8944 } else {
8945 embedToken = [{ type: 'html', text: text }];
8946 embedToken.links = {};
8947 }
8948 }
8949
8950 cb({ token: token, embedToken: embedToken });
8951 if (++count >= step) {
8952 cb({});
8953 }
8954 };
8955 })(token);
8956
8957 if (token.embed.url) {
8958 {
8959 get(token.embed.url).then(next);
8960 }
8961 } else {
8962 next(token.embed.html);
8963 }
8964 }
8965 }
8966
8967 function prerenderEmbed(ref, done) {
8968 var compiler = ref.compiler;
8969 var raw = ref.raw; if ( raw === void 0 ) raw = '';
8970 var fetch = ref.fetch;
8971
8972 var hit = cached$2[raw];
8973 if (hit) {
8974 var copy = hit.slice();
8975 copy.links = hit.links;
8976 return done(copy);
8977 }
8978
8979 var compile = compiler._marked;
8980 var tokens = compile.lexer(raw);
8981 var embedTokens = [];
8982 var linkRE = compile.Lexer.rules.inline.link;
8983 var links = tokens.links;
8984
8985 tokens.forEach(function (token, index) {
8986 if (token.type === 'paragraph') {
8987 token.text = token.text.replace(
8988 new RegExp(linkRE.source, 'g'),
8989 function (src, filename, href, title) {
8990 var embed = compiler.compileEmbed(href, title);
8991
8992 if (embed) {
8993 embedTokens.push({
8994 index: index,
8995 embed: embed,
8996 });
8997 }
8998
8999 return src;
9000 }
9001 );
9002 }
9003 });
9004
9005 // keep track of which tokens have been embedded so far
9006 // so that we know where to insert the embedded tokens as they
9007 // are returned
9008 var moves = [];
9009 walkFetchEmbed({ compile: compile, embedTokens: embedTokens, fetch: fetch }, function (ref) {
9010 var embedToken = ref.embedToken;
9011 var token = ref.token;
9012
9013 if (token) {
9014 // iterate through the array of previously inserted tokens
9015 // to determine where the current embedded tokens should be inserted
9016 var index = token.index;
9017 moves.forEach(function (pos) {
9018 if (index > pos.start) {
9019 index += pos.length;
9020 }
9021 });
9022
9023 merge(links, embedToken.links);
9024
9025 tokens = tokens
9026 .slice(0, index)
9027 .concat(embedToken, tokens.slice(index + 1));
9028 moves.push({ start: index, length: embedToken.length - 1 });
9029 } else {
9030 cached$2[raw] = tokens.concat();
9031 tokens.links = cached$2[raw].links = links;
9032 done(tokens);
9033 }
9034 });
9035 }
9036
9037 /* eslint-disable no-unused-vars */
9038
9039 var vueGlobalData;
9040
9041 function executeScript() {
9042 var script = findAll('.markdown-section>script')
9043 .filter(function (s) { return !/template/.test(s.type); })[0];
9044 if (!script) {
9045 return false;
9046 }
9047
9048 var code = script.innerText.trim();
9049 if (!code) {
9050 return false;
9051 }
9052
9053 new Function(code)();
9054 }
9055
9056 function formatUpdated(html, updated, fn) {
9057 updated =
9058 typeof fn === 'function'
9059 ? fn(updated)
9060 : typeof fn === 'string'
9061 ? tinydate(fn)(new Date(updated))
9062 : updated;
9063
9064 return html.replace(/{docsify-updated}/g, updated);
9065 }
9066
9067 function renderMain(html) {
9068 var docsifyConfig = this.config;
9069 var markdownElm = find('.markdown-section');
9070 var vueVersion =
9071 'Vue' in window &&
9072 window.Vue.version &&
9073 Number(window.Vue.version.charAt(0));
9074
9075 var isMountedVue = function (elm) {
9076 var isVue2 = Boolean(elm.__vue__ && elm.__vue__._isVue);
9077 var isVue3 = Boolean(elm._vnode && elm._vnode.__v_skip);
9078
9079 return isVue2 || isVue3;
9080 };
9081
9082 if (!html) {
9083 html = '<h1>404 - Not found</h1>';
9084 }
9085
9086 if ('Vue' in window) {
9087 var mountedElms = findAll('.markdown-section > *')
9088 .filter(function (elm) { return isMountedVue(elm); });
9089
9090 // Destroy/unmount existing Vue instances
9091 for (var i = 0, list = mountedElms; i < list.length; i += 1) {
9092 var mountedElm = list[i];
9093
9094 if (vueVersion === 2) {
9095 mountedElm.__vue__.$destroy();
9096 } else if (vueVersion === 3) {
9097 mountedElm.__vue_app__.unmount();
9098 }
9099 }
9100 }
9101
9102 this._renderTo(markdownElm, html);
9103
9104 // Render sidebar with the TOC
9105 !docsifyConfig.loadSidebar && this._renderSidebar();
9106
9107 // Execute markdown <script>
9108 if (
9109 docsifyConfig.executeScript ||
9110 ('Vue' in window && docsifyConfig.executeScript !== false)
9111 ) {
9112 executeScript();
9113 }
9114
9115 // Handle Vue content not mounted by markdown <script>
9116 if ('Vue' in window) {
9117 var vueMountData = [];
9118 var vueComponentNames = Object.keys(docsifyConfig.vueComponents || {});
9119
9120 // Register global vueComponents
9121 if (vueVersion === 2 && vueComponentNames.length) {
9122 vueComponentNames.forEach(function (name) {
9123 var isNotRegistered = !window.Vue.options.components[name];
9124
9125 if (isNotRegistered) {
9126 window.Vue.component(name, docsifyConfig.vueComponents[name]);
9127 }
9128 });
9129 }
9130
9131 // Store global data() return value as shared data object
9132 if (
9133 !vueGlobalData &&
9134 docsifyConfig.vueGlobalOptions &&
9135 typeof docsifyConfig.vueGlobalOptions.data === 'function'
9136 ) {
9137 vueGlobalData = docsifyConfig.vueGlobalOptions.data();
9138 }
9139
9140 // vueMounts
9141 vueMountData.push.apply(
9142 vueMountData, Object.keys(docsifyConfig.vueMounts || {})
9143 .map(function (cssSelector) { return [
9144 find(markdownElm, cssSelector),
9145 docsifyConfig.vueMounts[cssSelector] ]; })
9146 .filter(function (ref) {
9147 var elm = ref[0];
9148 var vueConfig = ref[1];
9149
9150 return elm;
9151 })
9152 );
9153
9154 // Template syntax, vueComponents, vueGlobalOptions
9155 if (docsifyConfig.vueGlobalOptions || vueComponentNames.length) {
9156 var reHasBraces = /{{2}[^{}]*}{2}/;
9157 // Matches Vue full and shorthand syntax as attributes in HTML tags.
9158 //
9159 // Full syntax examples:
9160 // v-foo, v-foo[bar], v-foo-bar, v-foo:bar-baz.prop
9161 //
9162 // Shorthand syntax examples:
9163 // @foo, @foo.bar, @foo.bar.baz, @[foo], :foo, :[foo]
9164 //
9165 // Markup examples:
9166 // <div v-html>{{ html }}</div>
9167 // <div v-text="msg"></div>
9168 // <div v-bind:text-content.prop="text">
9169 // <button v-on:click="doThis"></button>
9170 // <button v-on:click.once="doThis"></button>
9171 // <button v-on:[event]="doThis"></button>
9172 // <button @click.stop.prevent="doThis">
9173 // <a :href="url">
9174 // <a :[key]="url">
9175 var reHasDirective = /<[^>/]+\s([@:]|v-)[\w-:.[\]]+[=>\s]/;
9176
9177 vueMountData.push.apply(
9178 vueMountData, findAll('.markdown-section > *')
9179 // Remove duplicates
9180 .filter(function (elm) { return !vueMountData.some(function (ref) {
9181 var e = ref[0];
9182 var c = ref[1];
9183
9184 return e === elm;
9185 }); })
9186 // Detect Vue content
9187 .filter(function (elm) {
9188 var isVueMount =
9189 // is a component
9190 elm.tagName.toLowerCase() in
9191 (docsifyConfig.vueComponents || {}) ||
9192 // has a component(s)
9193 elm.querySelector(vueComponentNames.join(',') || null) ||
9194 // has curly braces
9195 reHasBraces.test(elm.outerHTML) ||
9196 // has content directive
9197 reHasDirective.test(elm.outerHTML);
9198
9199 return isVueMount;
9200 })
9201 .map(function (elm) {
9202 // Clone global configuration
9203 var vueConfig = merge({}, docsifyConfig.vueGlobalOptions || {});
9204
9205 // Replace vueGlobalOptions data() return value with shared data object.
9206 // This provides a global store for all Vue instances that receive
9207 // vueGlobalOptions as their configuration.
9208 if (vueGlobalData) {
9209 vueConfig.data = function () {
9210 return vueGlobalData;
9211 };
9212 }
9213
9214 return [elm, vueConfig];
9215 })
9216 );
9217 }
9218
9219 // Mount
9220 for (var i$1 = 0, list$1 = vueMountData; i$1 < list$1.length; i$1 += 1) {
9221 var ref = list$1[i$1];
9222 var mountElm = ref[0];
9223 var vueConfig = ref[1];
9224
9225 var isVueAttr = 'data-isvue';
9226 var isSkipElm =
9227 // Is an invalid tag
9228 mountElm.matches('pre, script') ||
9229 // Is a mounted instance
9230 isMountedVue(mountElm) ||
9231 // Has mounted instance(s)
9232 mountElm.querySelector(("[" + isVueAttr + "]"));
9233
9234 if (!isSkipElm) {
9235 mountElm.setAttribute(isVueAttr, '');
9236
9237 if (vueVersion === 2) {
9238 vueConfig.el = undefined;
9239 new window.Vue(vueConfig).$mount(mountElm);
9240 } else if (vueVersion === 3) {
9241 var app = window.Vue.createApp(vueConfig);
9242
9243 // Register global vueComponents
9244 vueComponentNames.forEach(function (name) {
9245 var config = docsifyConfig.vueComponents[name];
9246
9247 app.component(name, config);
9248 });
9249
9250 app.mount(mountElm);
9251 }
9252 }
9253 }
9254 }
9255 }
9256
9257 function renderNameLink(vm) {
9258 var el = getNode('.app-name-link');
9259 var nameLink = vm.config.nameLink;
9260 var path = vm.route.path;
9261
9262 if (!el) {
9263 return;
9264 }
9265
9266 if (isPrimitive(vm.config.nameLink)) {
9267 el.setAttribute('href', nameLink);
9268 } else if (typeof nameLink === 'object') {
9269 var match = Object.keys(nameLink).filter(
9270 function (key) { return path.indexOf(key) > -1; }
9271 )[0];
9272
9273 el.setAttribute('href', nameLink[match]);
9274 }
9275 }
9276
9277 /** @typedef {import('../Docsify').Constructor} Constructor */
9278
9279 /**
9280 * @template {!Constructor} T
9281 * @param {T} Base - The class to extend
9282 */
9283 function Render(Base) {
9284 return /*@__PURE__*/(function (Base) {
9285 function Render () {
9286 Base.apply(this, arguments);
9287 }
9288
9289 if ( Base ) Render.__proto__ = Base;
9290 Render.prototype = Object.create( Base && Base.prototype );
9291 Render.prototype.constructor = Render;
9292
9293 Render.prototype._renderTo = function _renderTo (el, content, replace) {
9294 var node = getNode(el);
9295 if (node) {
9296 node[replace ? 'outerHTML' : 'innerHTML'] = content;
9297 }
9298 };
9299
9300 Render.prototype._renderSidebar = function _renderSidebar (text) {
9301 var ref = this.config;
9302 var maxLevel = ref.maxLevel;
9303 var subMaxLevel = ref.subMaxLevel;
9304 var loadSidebar = ref.loadSidebar;
9305 var hideSidebar = ref.hideSidebar;
9306
9307 if (hideSidebar) {
9308 // FIXME : better styling solution
9309 [
9310 document.querySelector('aside.sidebar'),
9311 document.querySelector('button.sidebar-toggle') ]
9312 .filter(function (e) { return !!e; })
9313 .forEach(function (node) { return node.parentNode.removeChild(node); });
9314 document.querySelector('section.content').style.right = 'unset';
9315 document.querySelector('section.content').style.left = 'unset';
9316 document.querySelector('section.content').style.position = 'relative';
9317 document.querySelector('section.content').style.width = '100%';
9318 return null;
9319 }
9320
9321 this._renderTo('.sidebar-nav', this.compiler.sidebar(text, maxLevel));
9322 var activeEl = getAndActive(this.router, '.sidebar-nav', true, true);
9323 if (loadSidebar && activeEl) {
9324 activeEl.parentNode.innerHTML +=
9325 this.compiler.subSidebar(subMaxLevel) || '';
9326 } else {
9327 // Reset toc
9328 this.compiler.subSidebar();
9329 }
9330
9331 // Bind event
9332 this._bindEventOnRendered(activeEl);
9333 };
9334
9335 Render.prototype._bindEventOnRendered = function _bindEventOnRendered (activeEl) {
9336 var ref = this.config;
9337 var autoHeader = ref.autoHeader;
9338
9339 scrollActiveSidebar(this.router);
9340
9341 if (autoHeader && activeEl) {
9342 var main = getNode('#main');
9343 var firstNode = main.children[0];
9344 if (firstNode && firstNode.tagName !== 'H1') {
9345 var h1 = this.compiler.header(activeEl.innerText, 1);
9346 var wrapper = create('div', h1);
9347 before(main, wrapper.children[0]);
9348 }
9349 }
9350 };
9351
9352 Render.prototype._renderNav = function _renderNav (text) {
9353 text && this._renderTo('nav', this.compiler.compile(text));
9354 if (this.config.loadNavbar) {
9355 getAndActive(this.router, 'nav');
9356 }
9357 };
9358
9359 Render.prototype._renderMain = function _renderMain (text, opt, next) {
9360 var this$1 = this;
9361 if ( opt === void 0 ) opt = {};
9362
9363 if (!text) {
9364 return renderMain.call(this, text);
9365 }
9366
9367 this.callHook('beforeEach', text, function (result) {
9368 var html;
9369 var callback = function () {
9370 if (opt.updatedAt) {
9371 html = formatUpdated(
9372 html,
9373 opt.updatedAt,
9374 this$1.config.formatUpdated
9375 );
9376 }
9377
9378 this$1.callHook('afterEach', html, function (hookData) {
9379 renderMain.call(this$1, hookData);
9380 next();
9381 });
9382 };
9383
9384 if (this$1.isHTML) {
9385 html = this$1.result = text;
9386 callback();
9387 } else {
9388 prerenderEmbed(
9389 {
9390 compiler: this$1.compiler,
9391 raw: result,
9392 },
9393 function (tokens) {
9394 html = this$1.compiler.compile(tokens);
9395 callback();
9396 }
9397 );
9398 }
9399 });
9400 };
9401
9402 Render.prototype._renderCover = function _renderCover (text, coverOnly) {
9403 var el = getNode('.cover');
9404
9405 toggleClass(
9406 getNode('main'),
9407 coverOnly ? 'add' : 'remove',
9408 'hidden'
9409 );
9410 if (!text) {
9411 toggleClass(el, 'remove', 'show');
9412 return;
9413 }
9414
9415 toggleClass(el, 'add', 'show');
9416
9417 var html = this.coverIsHTML ? text : this.compiler.cover(text);
9418
9419 var m = html
9420 .trim()
9421 .match('<p><img.*?data-origin="(.*?)"[^a]+alt="(.*?)">([^<]*?)</p>$');
9422
9423 if (m) {
9424 if (m[2] === 'color') {
9425 el.style.background = m[1] + (m[3] || '');
9426 } else {
9427 var path = m[1];
9428
9429 toggleClass(el, 'add', 'has-mask');
9430 if (!isAbsolutePath(m[1])) {
9431 path = getPath(this.router.getBasePath(), m[1]);
9432 }
9433
9434 el.style.backgroundImage = "url(" + path + ")";
9435 el.style.backgroundSize = 'cover';
9436 el.style.backgroundPosition = 'center center';
9437 }
9438
9439 html = html.replace(m[0], '');
9440 }
9441
9442 this._renderTo('.cover-main', html);
9443 sticky();
9444 };
9445
9446 Render.prototype._updateRender = function _updateRender () {
9447 // Render name link
9448 renderNameLink(this);
9449 };
9450
9451 Render.prototype.initRender = function initRender () {
9452 var config = this.config;
9453
9454 // Init markdown compiler
9455 this.compiler = new Compiler(config, this.router);
9456 {
9457 /* eslint-disable-next-line camelcase */
9458 window.__current_docsify_compiler__ = this.compiler;
9459 }
9460
9461 var id = config.el || '#app';
9462 var navEl = find('nav') || create('nav');
9463
9464 var el = find(id);
9465 var html = '';
9466 var navAppendToTarget = body;
9467
9468 if (el) {
9469 if (config.repo) {
9470 html += corner(config.repo, config.cornerExternalLinkTarget);
9471 }
9472
9473 if (config.coverpage) {
9474 html += cover();
9475 }
9476
9477 if (config.logo) {
9478 var isBase64 = /^data:image/.test(config.logo);
9479 var isExternal = /(?:http[s]?:)?\/\//.test(config.logo);
9480 var isRelative = /^\./.test(config.logo);
9481
9482 if (!isBase64 && !isExternal && !isRelative) {
9483 config.logo = getPath(this.router.getBasePath(), config.logo);
9484 }
9485 }
9486
9487 html += main(config);
9488 // Render main app
9489 this._renderTo(el, html, true);
9490 } else {
9491 this.rendered = true;
9492 }
9493
9494 if (config.mergeNavbar && isMobile) {
9495 navAppendToTarget = find('.sidebar');
9496 } else {
9497 navEl.classList.add('app-nav');
9498
9499 if (!config.repo) {
9500 navEl.classList.add('no-badge');
9501 }
9502 }
9503
9504 // Add nav
9505 if (config.loadNavbar) {
9506 before(navAppendToTarget, navEl);
9507 }
9508
9509 if (config.themeColor) {
9510 $.head.appendChild(
9511 create('div', theme(config.themeColor)).firstElementChild
9512 );
9513 // Polyfll
9514 cssVars(config.themeColor);
9515 }
9516
9517 this._updateRender();
9518 toggleClass(body, 'ready');
9519 };
9520
9521 return Render;
9522 }(Base));
9523 }
9524
9525 /* eslint-disable no-unused-vars */
9526
9527 function loadNested(path, qs, file, next, vm, first) {
9528 path = first ? path : path.replace(/\/$/, '');
9529 path = getParentPath(path);
9530
9531 if (!path) {
9532 return;
9533 }
9534
9535 get(
9536 vm.router.getFile(path + file) + qs,
9537 false,
9538 vm.config.requestHeaders
9539 ).then(next, function (_) { return loadNested(path, qs, file, next, vm); });
9540 }
9541
9542 /** @typedef {import('../Docsify').Constructor} Constructor */
9543
9544 /**
9545 * @template {!Constructor} T
9546 * @param {T} Base - The class to extend
9547 */
9548 function Fetch(Base) {
9549 var last;
9550
9551 var abort = function () { return last && last.abort && last.abort(); };
9552 var request = function (url, hasbar, requestHeaders) {
9553 abort();
9554 last = get(url, true, requestHeaders);
9555 return last;
9556 };
9557
9558 var get404Path = function (path, config) {
9559 var notFoundPage = config.notFoundPage;
9560 var ext = config.ext;
9561 var defaultPath = '_404' + (ext || '.md');
9562 var key;
9563 var path404;
9564
9565 switch (typeof notFoundPage) {
9566 case 'boolean':
9567 path404 = defaultPath;
9568 break;
9569 case 'string':
9570 path404 = notFoundPage;
9571 break;
9572
9573 case 'object':
9574 key = Object.keys(notFoundPage)
9575 .sort(function (a, b) { return b.length - a.length; })
9576 .filter(function (k) { return path.match(new RegExp('^' + k)); })[0];
9577
9578 path404 = (key && notFoundPage[key]) || defaultPath;
9579 break;
9580 }
9581
9582 return path404;
9583 };
9584
9585 return /*@__PURE__*/(function (Base) {
9586 function Fetch () {
9587 Base.apply(this, arguments);
9588 }
9589
9590 if ( Base ) Fetch.__proto__ = Base;
9591 Fetch.prototype = Object.create( Base && Base.prototype );
9592 Fetch.prototype.constructor = Fetch;
9593
9594 Fetch.prototype._loadSideAndNav = function _loadSideAndNav (path, qs, loadSidebar, cb) {
9595 var this$1 = this;
9596
9597 return function () {
9598 if (!loadSidebar) {
9599 return cb();
9600 }
9601
9602 var fn = function (result) {
9603 this$1._renderSidebar(result);
9604 cb();
9605 };
9606
9607 // Load sidebar
9608 loadNested(path, qs, loadSidebar, fn, this$1, true);
9609 };
9610 };
9611
9612 Fetch.prototype._fetch = function _fetch (cb) {
9613 var this$1 = this;
9614 if ( cb === void 0 ) cb = noop;
9615
9616 var ref = this.route;
9617 var query = ref.query;
9618 var ref$1 = this.route;
9619 var path = ref$1.path;
9620
9621 // Prevent loading remote content via URL hash
9622 // Ex: https://foo.com/#//bar.com/file.md
9623 if (isExternal(path)) {
9624 history.replaceState(null, '', '#');
9625 this.router.normalize();
9626 } else {
9627 var qs = stringifyQuery(query, ['id']);
9628 var ref$2 = this.config;
9629 var loadNavbar = ref$2.loadNavbar;
9630 var requestHeaders = ref$2.requestHeaders;
9631 var loadSidebar = ref$2.loadSidebar;
9632 // Abort last request
9633
9634 var file = this.router.getFile(path);
9635
9636 this.isRemoteUrl = isExternal(file);
9637 // Current page is html
9638 this.isHTML = /\.html$/g.test(file);
9639
9640 // create a handler that should be called if content was fetched successfully
9641 var contentFetched = function (text, opt) {
9642 this$1._renderMain(
9643 text,
9644 opt,
9645 this$1._loadSideAndNav(path, qs, loadSidebar, cb)
9646 );
9647 };
9648
9649 // and a handler that is called if content failed to fetch
9650 var contentFailedToFetch = function (_) {
9651 this$1._fetchFallbackPage(path, qs, cb) || this$1._fetch404(file, qs, cb);
9652 };
9653
9654 // attempt to fetch content from a virtual route, and fallback to fetching the actual file
9655 if (!this.isRemoteUrl) {
9656 this.matchVirtualRoute(path).then(function (contents) {
9657 if (typeof contents === 'string') {
9658 contentFetched(contents);
9659 } else {
9660 request(file + qs, true, requestHeaders).then(
9661 contentFetched,
9662 contentFailedToFetch
9663 );
9664 }
9665 });
9666 } else {
9667 // if the requested url is not local, just fetch the file
9668 request(file + qs, true, requestHeaders).then(
9669 contentFetched,
9670 contentFailedToFetch
9671 );
9672 }
9673
9674 // Load nav
9675 loadNavbar &&
9676 loadNested(
9677 path,
9678 qs,
9679 loadNavbar,
9680 function (text) { return this$1._renderNav(text); },
9681 this,
9682 true
9683 );
9684 }
9685 };
9686
9687 Fetch.prototype._fetchCover = function _fetchCover () {
9688 var this$1 = this;
9689
9690 var ref = this.config;
9691 var coverpage = ref.coverpage;
9692 var requestHeaders = ref.requestHeaders;
9693 var query = this.route.query;
9694 var root = getParentPath(this.route.path);
9695
9696 if (coverpage) {
9697 var path = null;
9698 var routePath = this.route.path;
9699 if (typeof coverpage === 'string') {
9700 if (routePath === '/') {
9701 path = coverpage;
9702 }
9703 } else if (Array.isArray(coverpage)) {
9704 path = coverpage.indexOf(routePath) > -1 && '_coverpage';
9705 } else {
9706 var cover = coverpage[routePath];
9707 path = cover === true ? '_coverpage' : cover;
9708 }
9709
9710 var coverOnly = Boolean(path) && this.config.onlyCover;
9711 if (path) {
9712 path = this.router.getFile(root + path);
9713 this.coverIsHTML = /\.html$/g.test(path);
9714 get(path + stringifyQuery(query, ['id']), false, requestHeaders).then(
9715 function (text) { return this$1._renderCover(text, coverOnly); }
9716 );
9717 } else {
9718 this._renderCover(null, coverOnly);
9719 }
9720
9721 return coverOnly;
9722 }
9723 };
9724
9725 Fetch.prototype.$fetch = function $fetch (cb, $resetEvents) {
9726 var this$1 = this;
9727 if ( cb === void 0 ) cb = noop;
9728 if ( $resetEvents === void 0 ) $resetEvents = this.$resetEvents.bind(this);
9729
9730 var done = function () {
9731 this$1.callHook('doneEach');
9732 cb();
9733 };
9734
9735 var onlyCover = this._fetchCover();
9736
9737 if (onlyCover) {
9738 done();
9739 } else {
9740 this._fetch(function () {
9741 $resetEvents();
9742 done();
9743 });
9744 }
9745 };
9746
9747 Fetch.prototype._fetchFallbackPage = function _fetchFallbackPage (path, qs, cb) {
9748 var this$1 = this;
9749 if ( cb === void 0 ) cb = noop;
9750
9751 var ref = this.config;
9752 var requestHeaders = ref.requestHeaders;
9753 var fallbackLanguages = ref.fallbackLanguages;
9754 var loadSidebar = ref.loadSidebar;
9755
9756 if (!fallbackLanguages) {
9757 return false;
9758 }
9759
9760 var local = path.split('/')[1];
9761
9762 if (fallbackLanguages.indexOf(local) === -1) {
9763 return false;
9764 }
9765
9766 var newPath = this.router.getFile(
9767 path.replace(new RegExp(("^/" + local)), '')
9768 );
9769 var req = request(newPath + qs, true, requestHeaders);
9770
9771 req.then(
9772 function (text, opt) { return this$1._renderMain(
9773 text,
9774 opt,
9775 this$1._loadSideAndNav(path, qs, loadSidebar, cb)
9776 ); },
9777 function () { return this$1._fetch404(path, qs, cb); }
9778 );
9779
9780 return true;
9781 };
9782
9783 /**
9784 * Load the 404 page
9785 * @param {String} path URL to be loaded
9786 * @param {*} qs TODO: define
9787 * @param {Function} cb Callback
9788 * @returns {Boolean} True if the requested page is not found
9789 * @private
9790 */
9791 Fetch.prototype._fetch404 = function _fetch404 (path, qs, cb) {
9792 var this$1 = this;
9793 if ( cb === void 0 ) cb = noop;
9794
9795 var ref = this.config;
9796 var loadSidebar = ref.loadSidebar;
9797 var requestHeaders = ref.requestHeaders;
9798 var notFoundPage = ref.notFoundPage;
9799
9800 var fnLoadSideAndNav = this._loadSideAndNav(path, qs, loadSidebar, cb);
9801 if (notFoundPage) {
9802 var path404 = get404Path(path, this.config);
9803
9804 request(this.router.getFile(path404), true, requestHeaders).then(
9805 function (text, opt) { return this$1._renderMain(text, opt, fnLoadSideAndNav); },
9806 function () { return this$1._renderMain(null, {}, fnLoadSideAndNav); }
9807 );
9808 return true;
9809 }
9810
9811 this._renderMain(null, {}, fnLoadSideAndNav);
9812 return false;
9813 };
9814
9815 Fetch.prototype.initFetch = function initFetch () {
9816 var this$1 = this;
9817
9818 var ref = this.config;
9819 var loadSidebar = ref.loadSidebar;
9820
9821 // Server-Side Rendering
9822 if (this.rendered) {
9823 var activeEl = getAndActive(this.router, '.sidebar-nav', true, true);
9824 if (loadSidebar && activeEl) {
9825 activeEl.parentNode.innerHTML += window.__SUB_SIDEBAR__;
9826 }
9827
9828 this._bindEventOnRendered(activeEl);
9829 this.$resetEvents();
9830 this.callHook('doneEach');
9831 this.callHook('ready');
9832 } else {
9833 this.$fetch(function (_) { return this$1.callHook('ready'); });
9834 }
9835 };
9836
9837 return Fetch;
9838 }(Base));
9839 }
9840
9841 /** @typedef {import('../Docsify').Constructor} Constructor */
9842
9843 /**
9844 * @template {!Constructor} T
9845 * @param {T} Base - The class to extend
9846 */
9847 function Events(Base) {
9848 return /*@__PURE__*/(function (Base) {
9849 function Events () {
9850 Base.apply(this, arguments);
9851 }
9852
9853 if ( Base ) Events.__proto__ = Base;
9854 Events.prototype = Object.create( Base && Base.prototype );
9855 Events.prototype.constructor = Events;
9856
9857 Events.prototype.$resetEvents = function $resetEvents (source) {
9858 var this$1 = this;
9859
9860 var ref = this.config;
9861 var auto2top = ref.auto2top;
9862
9863 (function () {
9864 // Rely on the browser's scroll auto-restoration when going back or forward
9865 if (source === 'history') {
9866 return;
9867 }
9868 // Scroll to ID if specified
9869 if (this$1.route.query.id) {
9870 scrollIntoView(this$1.route.path, this$1.route.query.id);
9871 }
9872 // Scroll to top if a link was clicked and auto2top is enabled
9873 if (source === 'navigate') {
9874 auto2top && scroll2Top(auto2top);
9875 }
9876 })();
9877
9878 if (this.config.loadNavbar) {
9879 getAndActive(this.router, 'nav');
9880 }
9881 };
9882
9883 Events.prototype.initEvent = function initEvent () {
9884 // Bind toggle button
9885 btn('button.sidebar-toggle', this.router);
9886 collapse('.sidebar', this.router);
9887 // Bind sticky effect
9888 if (this.config.coverpage) {
9889 !isMobile && on('scroll', sticky);
9890 } else {
9891 body.classList.add('sticky');
9892 }
9893 };
9894
9895 return Events;
9896 }(Base));
9897 }
9898
9899 /**
9900 * Adds beginning of input (^) and end of input ($) assertions if needed into a regex string
9901 * @param {string} matcher the string to match
9902 * @returns {string}
9903 */
9904 function makeExactMatcher(matcher) {
9905 var matcherWithBeginningOfInput = startsWith(matcher, '^')
9906 ? matcher
9907 : ("^" + matcher);
9908
9909 var matcherWithBeginningAndEndOfInput = endsWith(
9910 matcherWithBeginningOfInput,
9911 '$'
9912 )
9913 ? matcherWithBeginningOfInput
9914 : (matcherWithBeginningOfInput + "$");
9915
9916 return matcherWithBeginningAndEndOfInput;
9917 }
9918
9919 /** @typedef {((value: any) => void) => void} OnNext */
9920 /** @typedef {(value: any) => void} NextFunction */
9921
9922 /**
9923 * Creates a pair of a function and an event emitter.
9924 * When the function is called, the event emitter calls the given callback with the value that was passed to the function.
9925 * @returns {[NextFunction, OnNext]}
9926 */
9927 function createNextFunction() {
9928 var storedCb = function () { return null; };
9929
9930 function next(value) {
9931 storedCb(value);
9932 }
9933
9934 function onNext(cb) {
9935 storedCb = cb;
9936 }
9937
9938 return [next, onNext];
9939 }
9940
9941 /** @typedef {import('../Docsify').Constructor} Constructor */
9942
9943 /** @typedef {Record<string, string | VirtualRouteHandler>} VirtualRoutesMap */
9944 /** @typedef {(route: string, match: RegExpMatchArray | null) => string | void | Promise<string | void> } VirtualRouteHandler */
9945
9946 /**
9947 * @template {!Constructor} T
9948 * @param {T} Base - The class to extend
9949 */
9950 function VirtualRoutes(Base) {
9951 return /*@__PURE__*/(function (Base) {
9952 function VirtualRoutes () {
9953 Base.apply(this, arguments);
9954 }
9955
9956 if ( Base ) VirtualRoutes.__proto__ = Base;
9957 VirtualRoutes.prototype = Object.create( Base && Base.prototype );
9958 VirtualRoutes.prototype.constructor = VirtualRoutes;
9959
9960 VirtualRoutes.prototype.routes = function routes () {
9961 return this.config.routes || {};
9962 };
9963
9964 /**
9965 * Attempts to match the given path with a virtual route.
9966 * @param {string} path the path of the route to match
9967 * @returns {Promise<string | null>} resolves to string if route was matched, otherwise null
9968 */
9969 VirtualRoutes.prototype.matchVirtualRoute = function matchVirtualRoute (path) {
9970 var virtualRoutes = this.routes();
9971 var virtualRoutePaths = Object.keys(virtualRoutes);
9972
9973 var done = function () { return null; };
9974
9975 /**
9976 * This is a tail recursion that iterates over all the available routes.
9977 * It can result in one of two ways:
9978 * 1. Call itself (essentially reviewing the next route)
9979 * 2. Call the "done" callback with the result (either the contents, or "null" if no match was found)
9980 */
9981 function asyncMatchNextRoute() {
9982 var virtualRoutePath = virtualRoutePaths.shift();
9983 if (!virtualRoutePath) {
9984 return done(null);
9985 }
9986
9987 var matcher = makeExactMatcher(virtualRoutePath);
9988 var matched = path.match(matcher);
9989
9990 if (!matched) {
9991 return asyncMatchNextRoute();
9992 }
9993
9994 var virtualRouteContentOrFn = virtualRoutes[virtualRoutePath];
9995
9996 if (typeof virtualRouteContentOrFn === 'string') {
9997 var contents = virtualRouteContentOrFn;
9998 return done(contents);
9999 }
10000
10001 if (typeof virtualRouteContentOrFn === 'function') {
10002 var fn = virtualRouteContentOrFn;
10003
10004 var ref = createNextFunction();
10005 var next = ref[0];
10006 var onNext = ref[1];
10007 onNext(function (contents) {
10008 if (typeof contents === 'string') {
10009 return done(contents);
10010 } else if (contents === false) {
10011 return done(null);
10012 } else {
10013 return asyncMatchNextRoute();
10014 }
10015 });
10016
10017 if (fn.length <= 2) {
10018 var returnedValue = fn(path, matched);
10019 return next(returnedValue);
10020 } else {
10021 return fn(path, matched, next);
10022 }
10023 }
10024
10025 return asyncMatchNextRoute();
10026 }
10027
10028 return {
10029 then: function (cb) {
10030 done = cb;
10031 asyncMatchNextRoute();
10032 },
10033 };
10034 };
10035
10036 return VirtualRoutes;
10037 }(Base));
10038 }
10039
10040
10041
10042 var util = /*#__PURE__*/Object.freeze({
10043 __proto__: null,
10044 cached: cached,
10045 hyphenate: hyphenate,
10046 hasOwn: hasOwn,
10047 merge: merge,
10048 isPrimitive: isPrimitive,
10049 noop: noop,
10050 isFn: isFn,
10051 isExternal: isExternal,
10052 inBrowser: inBrowser,
10053 isMobile: isMobile,
10054 supportsPushState: supportsPushState,
10055 parseQuery: parseQuery,
10056 stringifyQuery: stringifyQuery,
10057 isAbsolutePath: isAbsolutePath,
10058 removeParams: removeParams,
10059 getParentPath: getParentPath,
10060 cleanPath: cleanPath,
10061 resolvePath: resolvePath,
10062 getPath: getPath,
10063 replaceSlug: replaceSlug
10064 });
10065
10066 // TODO This is deprecated, kept for backwards compatibility. Remove in next
10067 // major release. We'll tell people to get everything from the DOCSIFY global
10068 // when using the global build, but we'll highly recommend for them to import
10069 // from the ESM build (f.e. lib/docsify.esm.js and lib/docsify.min.esm.js).
10070 function initGlobalAPI () {
10071 window.Docsify = {
10072 util: util,
10073 dom: dom,
10074 get: get,
10075 slugify: slugify,
10076 version: '4.13.1',
10077 };
10078 window.DocsifyCompiler = Compiler;
10079 window.marked = marked_1;
10080 window.Prism = prism;
10081 }
10082
10083 /** @typedef {import('../Docsify').Constructor} Constructor */
10084
10085 /**
10086 * @template {!Constructor} T
10087 * @param {T} Base - The class to extend
10088 */
10089 function Lifecycle(Base) {
10090 return /*@__PURE__*/(function (Base) {
10091 function Lifecycle () {
10092 Base.apply(this, arguments);
10093 }
10094
10095 if ( Base ) Lifecycle.__proto__ = Base;
10096 Lifecycle.prototype = Object.create( Base && Base.prototype );
10097 Lifecycle.prototype.constructor = Lifecycle;
10098
10099 Lifecycle.prototype.initLifecycle = function initLifecycle () {
10100 var this$1 = this;
10101
10102 var hooks = [
10103 'init',
10104 'mounted',
10105 'beforeEach',
10106 'afterEach',
10107 'doneEach',
10108 'ready' ];
10109
10110 this._hooks = {};
10111 this._lifecycle = {};
10112
10113 hooks.forEach(function (hook) {
10114 var arr = (this$1._hooks[hook] = []);
10115 this$1._lifecycle[hook] = function (fn) { return arr.push(fn); };
10116 });
10117 };
10118
10119 Lifecycle.prototype.callHook = function callHook (hookName, data, next) {
10120 if ( next === void 0 ) next = noop;
10121
10122 var queue = this._hooks[hookName];
10123 var catchPluginErrors = this.config.catchPluginErrors;
10124
10125 var step = function (index) {
10126 var hookFn = queue[index];
10127
10128 if (index >= queue.length) {
10129 next(data);
10130 } else if (typeof hookFn === 'function') {
10131 var errTitle = 'Docsify plugin error';
10132
10133 if (hookFn.length === 2) {
10134 try {
10135 hookFn(data, function (result) {
10136 data = result;
10137 step(index + 1);
10138 });
10139 } catch (err) {
10140 if (catchPluginErrors) {
10141 console.error(errTitle, err);
10142 } else {
10143 throw err;
10144 }
10145
10146 step(index + 1);
10147 }
10148 } else {
10149 try {
10150 var result = hookFn(data);
10151
10152 data = result === undefined ? data : result;
10153 step(index + 1);
10154 } catch (err) {
10155 if (catchPluginErrors) {
10156 console.error(errTitle, err);
10157 } else {
10158 throw err;
10159 }
10160
10161 step(index + 1);
10162 }
10163 }
10164 } else {
10165 step(index + 1);
10166 }
10167 };
10168
10169 step(0);
10170 };
10171
10172 return Lifecycle;
10173 }(Base));
10174 }
10175
10176 /** @typedef {new (...args: any[]) => any} Constructor */
10177
10178 // eslint-disable-next-line new-cap
10179 var Docsify = /*@__PURE__*/(function (superclass) {
10180 function Docsify() {
10181 superclass.call(this);
10182
10183 this.config = config(this);
10184
10185 this.initLifecycle(); // Init hooks
10186 this.initPlugin(); // Install plugins
10187 this.callHook('init');
10188 this.initRouter(); // Add router
10189 this.initRender(); // Render base DOM
10190 this.initEvent(); // Bind events
10191 this.initFetch(); // Fetch data
10192 this.callHook('mounted');
10193 }
10194
10195 if ( superclass ) Docsify.__proto__ = superclass;
10196 Docsify.prototype = Object.create( superclass && superclass.prototype );
10197 Docsify.prototype.constructor = Docsify;
10198
10199 Docsify.prototype.initPlugin = function initPlugin () {
10200 var this$1 = this;
10201
10202 [].concat(this.config.plugins).forEach(function (fn) {
10203 try {
10204 isFn(fn) && fn(this$1._lifecycle, this$1);
10205 } catch (err) {
10206 if (this$1.config.catchPluginErrors) {
10207 var errTitle = 'Docsify plugin error';
10208 console.error(errTitle, err);
10209 } else {
10210 throw err;
10211 }
10212 }
10213 });
10214 };
10215
10216 return Docsify;
10217 }(Fetch(
10218 // eslint-disable-next-line new-cap
10219 Events(Render(VirtualRoutes(Router(Lifecycle(Object)))))
10220 )));
10221
10222 /**
10223 * Global API
10224 */
10225 initGlobalAPI();
10226
10227 /**
10228 * Run Docsify
10229 */
10230 // eslint-disable-next-line no-unused-vars
10231 documentReady(function (_) { return new Docsify(); });
10232
10233}());