@andares/pdeditor 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,2174 @@
1
+ function ye(n, a, { signal: e, edges: t } = {}) {
2
+ let l, c = null;
3
+ const v = t != null && t.includes("leading"), o = t == null || t.includes("trailing"), p = () => {
4
+ c !== null && (n.apply(l, c), l = void 0, c = null);
5
+ }, A = () => {
6
+ o && p(), S();
7
+ };
8
+ let b = null;
9
+ const k = () => {
10
+ b != null && clearTimeout(b), b = setTimeout(() => {
11
+ b = null, A();
12
+ }, a);
13
+ }, $ = () => {
14
+ b !== null && (clearTimeout(b), b = null);
15
+ }, S = () => {
16
+ $(), l = void 0, c = null;
17
+ }, w = () => {
18
+ p();
19
+ }, y = function(...f) {
20
+ if (e != null && e.aborted) return;
21
+ l = this, c = f;
22
+ const x = b == null;
23
+ k(), v && x && p();
24
+ };
25
+ return y.schedule = k, y.cancel = S, y.flush = w, e == null || e.addEventListener("abort", S, { once: !0 }), y;
26
+ }
27
+ const ne = { position: "relative", boxSizing: "border-box", overflow: "hidden", fontSize: "16px", fontFamily: 'Menlo, Consolas, "Liberation Mono", Monaco, "Lucida Console", monospace' }, be = { lineHeight: "inherit", whiteSpace: "pre-wrap", wordBreak: "keep-all", overflowWrap: "break-word", background: "none", position: "absolute", width: "100%", height: "100%", zIndex: "1", resize: "none", caretColor: "currentColor", padding: "inherit", outline: "none", fontSize: "inherit", fontFamily: "inherit", letterSpacing: "inherit", boxSizing: "border-box", border: "none", top: "0px", left: "0px", color: "inherit", overflow: "hidden", "-webkit-font-smoothing": "antialiased", "-webkit-text-fill-color": "transparent" }, xe = { lineHeight: "inherit", position: "relative", whiteSpace: "pre-wrap", wordBreak: "keep-all", padding: "0", width: "100%", margin: "0", pointerEvents: "none", boxSizing: "border-box", overflowWrap: "break-word", fontFamily: "inherit" }, ke = { lineHeight: "inherit", position: "absolute", width: "100%", height: "100%", whiteSpace: "pre-wrap", wordBreak: "keep-all", padding: "inherit", margin: "0", top: "0px", left: "0px", pointerEvents: "none", boxSizing: "border-box", overflowWrap: "break-word", fontFamily: "inherit" }, ge = (n) => pe(n);
28
+ function re(n) {
29
+ const a = Array.isArray(n) ? n : [n];
30
+ return a.length === 0 ? ge : (e) => a.reduce((t, l, c) => l(t, { html: c > 0 }), e);
31
+ }
32
+ class we {
33
+ constructor(a, e = {}) {
34
+ if (this.lines = null, !a) throw new Error("selector is not defined");
35
+ if (this.root = a instanceof Node ? a : document.querySelector(a), !this.root) throw new Error(`element with "${a}" selector is not exist`);
36
+ const t = { value: "", styles: {}, plugins: [], highlighter: ge }, { highlighters: l, ...c } = e;
37
+ this.options = { ...t, ...c, highlighter: l ? re(l) : t.highlighter }, this.options.value = this.options.value == null ? "" : String(this.options.value), this.init();
38
+ }
39
+ init() {
40
+ this.textarea = document.createElement("textarea"), this.textarea.setAttribute("spellcheck", "false"), this.textarea.setAttribute("autocapitalize", "off"), this.textarea.setAttribute("autocorrect", "off"), this.textarea.setAttribute("autocomplete", "off"), this.pre = document.createElement("pre");
41
+ const a = Object.keys(ne).concat(Object.keys(this.options.styles)).concat(["paddingLeft"]);
42
+ this.initialRootStyles = {};
43
+ const e = this.root.style;
44
+ a.forEach((t) => {
45
+ this.initialRootStyles[t] = e[t] || "";
46
+ }), Object.assign(this.root.style, ne, this.options.styles), Object.assign(this.textarea.style, be), Object.assign(this.pre.style, xe), this.basePaddingLeft = this.root.style.paddingLeft || "", this.root.appendChild(this.textarea), this.root.appendChild(this.pre), this.addTextareaEvents(), this.update({ value: this.options.value }), this.updateLines();
47
+ }
48
+ addTextareaEvents() {
49
+ this.handleEvent = (a) => {
50
+ if (a.type === "keydown" && this.textarea.readOnly) return;
51
+ const e = a;
52
+ if (e.isComposing || e.keyCode === 229) return;
53
+ const t = (function(l, c) {
54
+ const { value: v, selectionStart: o, selectionEnd: p } = c.target;
55
+ return l.reduce((A, b) => ({ ...A, ...b(A, c) }), { value: v, selectionStart: o, selectionEnd: p });
56
+ })(this.options.plugins, a);
57
+ this.update(t);
58
+ }, this.textarea.addEventListener("input", this.handleEvent), this.textarea.addEventListener("keydown", this.handleEvent), this.textarea.addEventListener("compositionend", this.handleEvent);
59
+ }
60
+ update(a) {
61
+ if (!this.textarea) return;
62
+ let { value: e, selectionStart: t, selectionEnd: l } = a;
63
+ e != null && (e = String(e), t == null && (t = this.textarea.selectionStart), l == null && (l = this.textarea.selectionEnd), this.textarea.value !== e && (this.textarea.value = e)), t != null && (this.textarea.selectionStart = t), l != null && (this.textarea.selectionEnd = l), e !== this.value && e != null && (this.value = e, this.render(), this.updateCallback && this.updateCallback(e));
64
+ }
65
+ updateOptions(a) {
66
+ if (!this.textarea) return;
67
+ const { highlighters: e, ...t } = a;
68
+ if (this.options = { ...this.options, ...t, highlighter: e ? re(e) : this.options.highlighter }, a.styles) {
69
+ const l = this.root.style;
70
+ Object.keys(a.styles).forEach((c) => {
71
+ c in this.initialRootStyles || (this.initialRootStyles[c] = l[c] || "");
72
+ }), Object.assign(this.root.style, a.styles), ("paddingLeft" in a.styles || "padding" in a.styles) && (this.basePaddingLeft = this.root.style.paddingLeft || "");
73
+ }
74
+ this.lines && !this.options.lineNumbers && (N(this.lines), this.lines = null, this.root.style.paddingLeft = this.basePaddingLeft), a.value != null && this.update({ value: a.value }), this.render();
75
+ }
76
+ render() {
77
+ const a = this.options.highlighter(this.value);
78
+ this.pre.innerHTML = a + "<br/>", this.updateLines();
79
+ }
80
+ updateLines() {
81
+ if (!this.options.lineNumbers) return;
82
+ this.lines || (this.lines = document.createElement("pre"), this.root.appendChild(this.lines), Object.assign(this.lines.style, ke));
83
+ const a = this.value.split(`
84
+ `), e = a.length.toString().length;
85
+ this.root.style.paddingLeft = `${e + 1}ch`, this.lines.innerHTML = a.map((t, l) => `${`<span class="yace-line" style="position: absolute; opacity: .3; left: 0; width: ${e}ch; text-align: right">${1 + l}</span>`}${`<span style="color: transparent; pointer-events: none">${pe(t)}</span>`}`).join(`
86
+ `);
87
+ }
88
+ destroy() {
89
+ this.textarea && (this.textarea.removeEventListener("input", this.handleEvent), this.textarea.removeEventListener("keydown", this.handleEvent), this.textarea.removeEventListener("compositionend", this.handleEvent), N(this.textarea), N(this.pre), N(this.lines), Object.assign(this.root.style, this.initialRootStyles), Object.assign(this, { textarea: null, pre: null, lines: null, updateCallback: null, handleEvent: null, initialRootStyles: null, options: null, root: null }));
90
+ }
91
+ onUpdate(a) {
92
+ this.updateCallback = a;
93
+ }
94
+ }
95
+ function N(n) {
96
+ n && n.parentNode && n.parentNode.removeChild(n);
97
+ }
98
+ function pe(n) {
99
+ return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
100
+ }
101
+ function B(n, a) {
102
+ const e = n, t = e.key.toLowerCase(), l = a.split("+"), c = l.slice(0, -1), v = l[l.length - 1];
103
+ return !(t !== v || c.includes("shift") !== e.shiftKey || c.includes("ctrl") !== e.ctrlKey || c.includes("alt") !== e.altKey || c.includes("meta") !== e.metaKey);
104
+ }
105
+ function ae(n, a) {
106
+ var l;
107
+ const t = n.slice(0, a).split(`
108
+ `);
109
+ return { line: t.length - 1, col: ((l = t[t.length - 1]) == null ? void 0 : l.length) ?? 0 };
110
+ }
111
+ function W(n, a, e) {
112
+ var l;
113
+ let t = 0;
114
+ for (let c = 0; c < a; c++) t += (((l = n[c]) == null ? void 0 : l.length) ?? 0) + 1;
115
+ return t + e;
116
+ }
117
+ function Se() {
118
+ return (n, a) => {
119
+ var A;
120
+ if (a.type !== "keydown" || !B(a, "enter")) return;
121
+ const { value: e, selectionStart: t, selectionEnd: l } = n, c = e.slice(0, t).split(`
122
+ `).pop() ?? "", v = ((A = /^\s*/.exec(c)) == null ? void 0 : A[0]) ?? "";
123
+ a.preventDefault();
124
+ const o = /^(\s*)-(?=\s|$)/.test(c), p = `
125
+ ${v}${o ? "- " : ""}`;
126
+ return {
127
+ value: e.slice(0, t) + p + e.slice(l),
128
+ selectionStart: t + p.length,
129
+ selectionEnd: t + p.length
130
+ };
131
+ };
132
+ }
133
+ function Ee(n) {
134
+ return /^(\s*)-(?=\s|$)/.test(n);
135
+ }
136
+ function ie(n, a) {
137
+ return n.startsWith(a) ? a.length : n.startsWith(" ") ? 1 : 0;
138
+ }
139
+ function $e(n) {
140
+ return (a, e) => {
141
+ if (e.type !== "keydown") return;
142
+ const { value: t, selectionStart: l, selectionEnd: c } = a, v = t.split(`
143
+ `), o = t.slice(0, l).split(`
144
+ `).length - 1, p = t.slice(0, c).split(`
145
+ `).length - 1, A = ae(t, l), b = ae(t, c);
146
+ if (B(e, "shift+tab")) {
147
+ e.preventDefault();
148
+ const k = v.map(
149
+ (f, x) => x >= o && x <= p ? f.slice(ie(f, n)) : f
150
+ ), $ = k.join(`
151
+ `);
152
+ if ($ === t) return;
153
+ const S = (f) => {
154
+ const x = ie(v[f.line] ?? "", n);
155
+ return { line: f.line, col: Math.max(0, f.col - x) };
156
+ }, w = S(A), y = S(b);
157
+ return {
158
+ value: $,
159
+ selectionStart: W(k, w.line, w.col),
160
+ selectionEnd: W(k, y.line, y.col)
161
+ };
162
+ }
163
+ if (B(e, "tab")) {
164
+ e.preventDefault();
165
+ const k = v.map((w, y) => ({ l: w, i: y })).filter(({ i: w }) => w >= o && w <= p);
166
+ if (k.length > 0 && k.every(({ l: w }) => Ee(w)) || l !== c) {
167
+ const w = v.map(
168
+ (r, u) => u >= o && u <= p && r !== "" ? n + r : r
169
+ ), y = w.join(`
170
+ `), f = (r) => {
171
+ const u = v[r.line] ?? "", d = r.line >= o && r.line <= p;
172
+ return {
173
+ line: r.line,
174
+ col: d && u !== "" ? r.col + n.length : r.col
175
+ };
176
+ }, x = f(A), i = f(b);
177
+ return {
178
+ value: y,
179
+ selectionStart: W(w, x.line, x.col),
180
+ selectionEnd: W(w, i.line, i.col)
181
+ };
182
+ }
183
+ const S = l + n.length;
184
+ return {
185
+ value: t.slice(0, l) + n + t.slice(c),
186
+ selectionStart: S,
187
+ selectionEnd: S
188
+ };
189
+ }
190
+ };
191
+ }
192
+ function Ae(n) {
193
+ return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
194
+ }
195
+ function Fe(n, a) {
196
+ const e = Math.min(n.length, a.length);
197
+ let t = 0;
198
+ for (; t < e && n.charCodeAt(t) === a.charCodeAt(t); ) t++;
199
+ return t;
200
+ }
201
+ function Le(n, a, e) {
202
+ let t = a.language ?? "pd";
203
+ const l = a.onValueChange;
204
+ let c = !1;
205
+ const v = a.indentUnit ?? " ", o = new we(n, {
206
+ value: a.value ?? "",
207
+ lineNumbers: a.lineNumbers ?? !1,
208
+ styles: a.styles ?? {},
209
+ highlighters: [
210
+ a.highlight ? (s) => {
211
+ var g;
212
+ return ((g = a.highlight) == null ? void 0 : g.call(a, s, t)) ?? "";
213
+ } : e(t)
214
+ ],
215
+ // 编辑行为:pd 语义插件(续行补 `- `/保留缩进、序列项行 Tab 整行缩进/缩出)。
216
+ // 撤销/重做不在此接入 Yace history 插件(初始快照缺陷),由组件自实现(见下)。
217
+ plugins: [Se(), $e(v)]
218
+ });
219
+ o.onUpdate((s) => {
220
+ c || (r(s), l == null || l(s));
221
+ });
222
+ const p = o.textarea;
223
+ let A = !1;
224
+ const b = () => {
225
+ A = !0;
226
+ }, k = () => {
227
+ A = !1;
228
+ }, $ = () => {
229
+ A && (c = !0, o.update({
230
+ value: p.value,
231
+ selectionStart: p.selectionStart,
232
+ selectionEnd: p.selectionEnd
233
+ }), c = !1);
234
+ };
235
+ p.addEventListener("compositionstart", b), p.addEventListener("compositionend", k), p.addEventListener("input", $);
236
+ const S = 5, w = [
237
+ { value: o.value, selStart: -1, selEnd: -1 }
238
+ ], y = [], f = () => {
239
+ w.length > S + 1 && w.splice(1, 1);
240
+ }, i = ye((s) => {
241
+ const g = w[0];
242
+ if (g !== void 0 && g.selStart < 0 && g.value !== s.value) {
243
+ const h = Fe(g.value, s.value);
244
+ g.selStart = h, g.selEnd = h;
245
+ }
246
+ const m = w.at(-1);
247
+ m !== void 0 && m.value === s.value || (y.length = 0, w.push(s), f());
248
+ }, 1e3), r = (s) => {
249
+ const g = p.selectionStart, m = p.selectionEnd;
250
+ i({ value: s, selStart: g, selEnd: m });
251
+ }, u = (s) => {
252
+ const g = s.selStart >= 0 ? s.selStart : s.value.length, m = s.selEnd >= 0 ? s.selEnd : s.value.length;
253
+ c = !0, o.update({
254
+ value: s.value,
255
+ selectionStart: g,
256
+ selectionEnd: m
257
+ }), p.value === s.value && p.setSelectionRange(g, m), c = !1;
258
+ }, d = (s) => {
259
+ const g = s.ctrlKey || s.metaKey, m = s.key.toLowerCase();
260
+ if (!g || m !== "z" && m !== "y") return;
261
+ if (m === "y" || m === "z" && s.shiftKey) {
262
+ if (i.flush(), y.length === 0) return;
263
+ s.preventDefault();
264
+ const E = y.pop();
265
+ E !== void 0 && (w.push(E), f(), u(E));
266
+ } else {
267
+ if (i.flush(), w.length <= 1) return;
268
+ s.preventDefault();
269
+ const E = w.pop();
270
+ E !== void 0 && y.push(E);
271
+ const F = w.at(-1);
272
+ F !== void 0 && u(F);
273
+ }
274
+ };
275
+ return p.addEventListener("keydown", d), {
276
+ setValue(s) {
277
+ c = !0, o.update({ value: s }), c = !1;
278
+ },
279
+ getValue() {
280
+ return o.value;
281
+ },
282
+ setLanguage(s) {
283
+ t = s, o.updateOptions({
284
+ highlighters: [
285
+ a.highlight ? (g) => {
286
+ var m;
287
+ return ((m = a.highlight) == null ? void 0 : m.call(a, g, t)) ?? "";
288
+ } : e(t)
289
+ ]
290
+ });
291
+ },
292
+ destroy() {
293
+ i.cancel(), p.removeEventListener("compositionstart", b), p.removeEventListener("compositionend", k), p.removeEventListener("input", $), p.removeEventListener("keydown", d), o.destroy();
294
+ },
295
+ textarea: p
296
+ };
297
+ }
298
+ function X(n) {
299
+ const a = [];
300
+ let e = "", t = !1;
301
+ for (const l of n)
302
+ l === "`" ? t ? (a.push({ code: !0, seg: e + "`" }), e = "", t = !1) : (e && a.push({ code: !1, seg: e }), e = "`", t = !0) : e += l;
303
+ return e && a.push({ code: !1, seg: e }), a;
304
+ }
305
+ function Y(n) {
306
+ for (const { code: a, seg: e } of X(n))
307
+ if (!a && (e.includes(":-") || e.includes(":-")))
308
+ return !0;
309
+ return !1;
310
+ }
311
+ function V(n) {
312
+ let a = 0;
313
+ for (const { code: e, seg: t } of X(n)) {
314
+ if (!e) {
315
+ const l = t.indexOf(":");
316
+ if (l !== -1) return a + l;
317
+ }
318
+ a += t.length;
319
+ }
320
+ return -1;
321
+ }
322
+ function se(n) {
323
+ if (Y(n)) return null;
324
+ const a = V(n);
325
+ if (a <= 0) return null;
326
+ const e = n.slice(0, a), t = n.slice(a + 1);
327
+ if (/\s$/.test(e) || t !== "" && !/^\s/.test(t)) return null;
328
+ const l = t.trim();
329
+ return { key: e.trim(), value: l === "" ? void 0 : l };
330
+ }
331
+ function C(n) {
332
+ return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
333
+ }
334
+ const T = {
335
+ key: "pd-key",
336
+ keyPunct: "pd-key-punct",
337
+ item: "pd-item",
338
+ section: "pd-section",
339
+ sep: "pd-sep",
340
+ ref: "pd-ref",
341
+ inlineCode: "pd-inline-code",
342
+ fence: "pd-fence"
343
+ };
344
+ function Ce(n) {
345
+ return `<span class="${T.inlineCode}">${C(n)}</span>`;
346
+ }
347
+ const le = /(?:^|\s):([^\s-][^\s]*)(?=\s|$)/g;
348
+ function _e(n) {
349
+ let a = "", e = 0;
350
+ le.lastIndex = 0;
351
+ let t;
352
+ for (; (t = le.exec(n)) !== null; ) {
353
+ const l = /^\s/.test(t[0]) ? 1 : 0, c = t.index + l;
354
+ a += C(n.slice(e, c)), a += `<span class="${T.ref}">${C(n.slice(c, t.index + t[0].length))}</span>`, e = t.index + t[0].length;
355
+ }
356
+ return a += C(n.slice(e)), a;
357
+ }
358
+ function D(n) {
359
+ let a = "";
360
+ for (const { code: e, seg: t } of X(n))
361
+ a += e ? Ce(t) : _e(t);
362
+ return a;
363
+ }
364
+ function oe(n, a, e, t) {
365
+ const l = `<span class="${T.key}">${D(e)}</span>`, c = `<span class="${T.keyPunct}">:</span>`;
366
+ return `${n}${a}${l}${c}${D(t)}`;
367
+ }
368
+ function Pe(n) {
369
+ const a = n.trim();
370
+ if (/^\/\/!pd(?:\s+[^\s]+)?$/.test(a)) {
371
+ const t = /^(\s*)(\/\/!pd)(\s*.*)$/.exec(n), l = (t == null ? void 0 : t[1]) ?? "", c = (t == null ? void 0 : t[2]) ?? "//!pd", v = (t == null ? void 0 : t[3]) ?? "";
372
+ return `${C(l)}<span class="${T.section}">${C(c)}</span>${D(v)}`;
373
+ }
374
+ if (a === "---")
375
+ return `<span class="${T.sep}">${C(n)}</span>`;
376
+ const e = /^(\s*)(-)(?=\s|$)/.exec(n);
377
+ if (e) {
378
+ const t = C(e[1] ?? ""), l = (e[1] ?? "").length + 1, c = n.slice(l), v = c.trimStart(), o = c.slice(0, c.length - v.length), p = `<span class="${T.item}">-</span>`;
379
+ if (!Y(v) && se(v)) {
380
+ const b = V(v), k = v.slice(0, b), $ = v.slice(b + 1);
381
+ return `${t}${p}${C(o)}${oe("", "", k, $)}`;
382
+ }
383
+ return `${t}${p}${C(o)}${D(v)}`;
384
+ }
385
+ if (!Y(a) && se(a)) {
386
+ const l = n.length - n.trimStart().length, c = n.slice(l), v = V(c), o = c.slice(0, v).trim(), p = c.slice(v + 1);
387
+ return oe(C(n.slice(0, l)), "", o, p);
388
+ }
389
+ return D(n);
390
+ }
391
+ function Te(n) {
392
+ const a = n.split(`
393
+ `);
394
+ let e = !1;
395
+ const t = [];
396
+ for (const l of a) {
397
+ const c = l.trimStart();
398
+ if (e) {
399
+ c.startsWith("```") ? (e = !1, t.push(`<span class="${T.fence}">${C(l)}</span>`)) : t.push(C(l));
400
+ continue;
401
+ }
402
+ if (c.startsWith("```")) {
403
+ e = !0, t.push(`<span class="${T.fence}">${C(l)}</span>`);
404
+ continue;
405
+ }
406
+ t.push(Pe(l));
407
+ }
408
+ return t.join(`
409
+ `);
410
+ }
411
+ var ue = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
412
+ function Ie(n) {
413
+ return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
414
+ }
415
+ var U = { exports: {} }, ce;
416
+ function Re() {
417
+ return ce || (ce = 1, (function(n) {
418
+ var a = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
419
+ /**
420
+ * Prism: Lightweight, robust, elegant syntax highlighting
421
+ *
422
+ * @license MIT <https://opensource.org/licenses/MIT>
423
+ * @author Lea Verou <https://lea.verou.me>
424
+ * @namespace
425
+ * @public
426
+ */
427
+ var e = (function(t) {
428
+ var l = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, c = 0, v = {}, o = {
429
+ /**
430
+ * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
431
+ * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
432
+ * additional languages or plugins yourself.
433
+ *
434
+ * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
435
+ *
436
+ * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
437
+ * empty Prism object into the global scope before loading the Prism script like this:
438
+ *
439
+ * ```js
440
+ * window.Prism = window.Prism || {};
441
+ * Prism.manual = true;
442
+ * // add a new <script> to load Prism's script
443
+ * ```
444
+ *
445
+ * @default false
446
+ * @type {boolean}
447
+ * @memberof Prism
448
+ * @public
449
+ */
450
+ manual: t.Prism && t.Prism.manual,
451
+ /**
452
+ * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
453
+ * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
454
+ * own worker, you don't want it to do this.
455
+ *
456
+ * By setting this value to `true`, Prism will not add its own listeners to the worker.
457
+ *
458
+ * You obviously have to change this value before Prism executes. To do this, you can add an
459
+ * empty Prism object into the global scope before loading the Prism script like this:
460
+ *
461
+ * ```js
462
+ * window.Prism = window.Prism || {};
463
+ * Prism.disableWorkerMessageHandler = true;
464
+ * // Load Prism's script
465
+ * ```
466
+ *
467
+ * @default false
468
+ * @type {boolean}
469
+ * @memberof Prism
470
+ * @public
471
+ */
472
+ disableWorkerMessageHandler: t.Prism && t.Prism.disableWorkerMessageHandler,
473
+ /**
474
+ * A namespace for utility methods.
475
+ *
476
+ * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
477
+ * change or disappear at any time.
478
+ *
479
+ * @namespace
480
+ * @memberof Prism
481
+ */
482
+ util: {
483
+ encode: function i(r) {
484
+ return r instanceof p ? new p(r.type, i(r.content), r.alias) : Array.isArray(r) ? r.map(i) : r.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
485
+ },
486
+ /**
487
+ * Returns the name of the type of the given value.
488
+ *
489
+ * @param {any} o
490
+ * @returns {string}
491
+ * @example
492
+ * type(null) === 'Null'
493
+ * type(undefined) === 'Undefined'
494
+ * type(123) === 'Number'
495
+ * type('foo') === 'String'
496
+ * type(true) === 'Boolean'
497
+ * type([1, 2]) === 'Array'
498
+ * type({}) === 'Object'
499
+ * type(String) === 'Function'
500
+ * type(/abc+/) === 'RegExp'
501
+ */
502
+ type: function(i) {
503
+ return Object.prototype.toString.call(i).slice(8, -1);
504
+ },
505
+ /**
506
+ * Returns a unique number for the given object. Later calls will still return the same number.
507
+ *
508
+ * @param {Object} obj
509
+ * @returns {number}
510
+ */
511
+ objId: function(i) {
512
+ return i.__id || Object.defineProperty(i, "__id", { value: ++c }), i.__id;
513
+ },
514
+ /**
515
+ * Creates a deep clone of the given object.
516
+ *
517
+ * The main intended use of this function is to clone language definitions.
518
+ *
519
+ * @param {T} o
520
+ * @param {Record<number, any>} [visited]
521
+ * @returns {T}
522
+ * @template T
523
+ */
524
+ clone: function i(r, u) {
525
+ u = u || {};
526
+ var d, s;
527
+ switch (o.util.type(r)) {
528
+ case "Object":
529
+ if (s = o.util.objId(r), u[s])
530
+ return u[s];
531
+ d = /** @type {Record<string, any>} */
532
+ {}, u[s] = d;
533
+ for (var g in r)
534
+ r.hasOwnProperty(g) && (d[g] = i(r[g], u));
535
+ return (
536
+ /** @type {any} */
537
+ d
538
+ );
539
+ case "Array":
540
+ return s = o.util.objId(r), u[s] ? u[s] : (d = [], u[s] = d, /** @type {Array} */
541
+ /** @type {any} */
542
+ r.forEach(function(m, h) {
543
+ d[h] = i(m, u);
544
+ }), /** @type {any} */
545
+ d);
546
+ default:
547
+ return r;
548
+ }
549
+ },
550
+ /**
551
+ * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
552
+ *
553
+ * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
554
+ *
555
+ * @param {Element} element
556
+ * @returns {string}
557
+ */
558
+ getLanguage: function(i) {
559
+ for (; i; ) {
560
+ var r = l.exec(i.className);
561
+ if (r)
562
+ return r[1].toLowerCase();
563
+ i = i.parentElement;
564
+ }
565
+ return "none";
566
+ },
567
+ /**
568
+ * Sets the Prism `language-xxxx` class of the given element.
569
+ *
570
+ * @param {Element} element
571
+ * @param {string} language
572
+ * @returns {void}
573
+ */
574
+ setLanguage: function(i, r) {
575
+ i.className = i.className.replace(RegExp(l, "gi"), ""), i.classList.add("language-" + r);
576
+ },
577
+ /**
578
+ * Returns the script element that is currently executing.
579
+ *
580
+ * This does __not__ work for line script element.
581
+ *
582
+ * @returns {HTMLScriptElement | null}
583
+ */
584
+ currentScript: function() {
585
+ if (typeof document > "u")
586
+ return null;
587
+ if (document.currentScript && document.currentScript.tagName === "SCRIPT")
588
+ return (
589
+ /** @type {any} */
590
+ document.currentScript
591
+ );
592
+ try {
593
+ throw new Error();
594
+ } catch (d) {
595
+ var i = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(d.stack) || [])[1];
596
+ if (i) {
597
+ var r = document.getElementsByTagName("script");
598
+ for (var u in r)
599
+ if (r[u].src == i)
600
+ return r[u];
601
+ }
602
+ return null;
603
+ }
604
+ },
605
+ /**
606
+ * Returns whether a given class is active for `element`.
607
+ *
608
+ * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
609
+ * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
610
+ * given class is just the given class with a `no-` prefix.
611
+ *
612
+ * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
613
+ * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
614
+ * ancestors have the given class or the negated version of it, then the default activation will be returned.
615
+ *
616
+ * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
617
+ * version of it, the class is considered active.
618
+ *
619
+ * @param {Element} element
620
+ * @param {string} className
621
+ * @param {boolean} [defaultActivation=false]
622
+ * @returns {boolean}
623
+ */
624
+ isActive: function(i, r, u) {
625
+ for (var d = "no-" + r; i; ) {
626
+ var s = i.classList;
627
+ if (s.contains(r))
628
+ return !0;
629
+ if (s.contains(d))
630
+ return !1;
631
+ i = i.parentElement;
632
+ }
633
+ return !!u;
634
+ }
635
+ },
636
+ /**
637
+ * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
638
+ *
639
+ * @namespace
640
+ * @memberof Prism
641
+ * @public
642
+ */
643
+ languages: {
644
+ /**
645
+ * The grammar for plain, unformatted text.
646
+ */
647
+ plain: v,
648
+ plaintext: v,
649
+ text: v,
650
+ txt: v,
651
+ /**
652
+ * Creates a deep copy of the language with the given id and appends the given tokens.
653
+ *
654
+ * If a token in `redef` also appears in the copied language, then the existing token in the copied language
655
+ * will be overwritten at its original position.
656
+ *
657
+ * ## Best practices
658
+ *
659
+ * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
660
+ * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
661
+ * understand the language definition because, normally, the order of tokens matters in Prism grammars.
662
+ *
663
+ * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
664
+ * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
665
+ *
666
+ * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
667
+ * @param {Grammar} redef The new tokens to append.
668
+ * @returns {Grammar} The new language created.
669
+ * @public
670
+ * @example
671
+ * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
672
+ * // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
673
+ * // at its original position
674
+ * 'comment': { ... },
675
+ * // CSS doesn't have a 'color' token, so this token will be appended
676
+ * 'color': /\b(?:red|green|blue)\b/
677
+ * });
678
+ */
679
+ extend: function(i, r) {
680
+ var u = o.util.clone(o.languages[i]);
681
+ for (var d in r)
682
+ u[d] = r[d];
683
+ return u;
684
+ },
685
+ /**
686
+ * Inserts tokens _before_ another token in a language definition or any other grammar.
687
+ *
688
+ * ## Usage
689
+ *
690
+ * This helper method makes it easy to modify existing languages. For example, the CSS language definition
691
+ * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
692
+ * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
693
+ * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
694
+ * this:
695
+ *
696
+ * ```js
697
+ * Prism.languages.markup.style = {
698
+ * // token
699
+ * };
700
+ * ```
701
+ *
702
+ * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
703
+ * before existing tokens. For the CSS example above, you would use it like this:
704
+ *
705
+ * ```js
706
+ * Prism.languages.insertBefore('markup', 'cdata', {
707
+ * 'style': {
708
+ * // token
709
+ * }
710
+ * });
711
+ * ```
712
+ *
713
+ * ## Special cases
714
+ *
715
+ * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
716
+ * will be ignored.
717
+ *
718
+ * This behavior can be used to insert tokens after `before`:
719
+ *
720
+ * ```js
721
+ * Prism.languages.insertBefore('markup', 'comment', {
722
+ * 'comment': Prism.languages.markup.comment,
723
+ * // tokens after 'comment'
724
+ * });
725
+ * ```
726
+ *
727
+ * ## Limitations
728
+ *
729
+ * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
730
+ * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
731
+ * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
732
+ * deleting properties which is necessary to insert at arbitrary positions.
733
+ *
734
+ * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
735
+ * Instead, it will create a new object and replace all references to the target object with the new one. This
736
+ * can be done without temporarily deleting properties, so the iteration order is well-defined.
737
+ *
738
+ * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
739
+ * you hold the target object in a variable, then the value of the variable will not change.
740
+ *
741
+ * ```js
742
+ * var oldMarkup = Prism.languages.markup;
743
+ * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
744
+ *
745
+ * assert(oldMarkup !== Prism.languages.markup);
746
+ * assert(newMarkup === Prism.languages.markup);
747
+ * ```
748
+ *
749
+ * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
750
+ * object to be modified.
751
+ * @param {string} before The key to insert before.
752
+ * @param {Grammar} insert An object containing the key-value pairs to be inserted.
753
+ * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
754
+ * object to be modified.
755
+ *
756
+ * Defaults to `Prism.languages`.
757
+ * @returns {Grammar} The new grammar object.
758
+ * @public
759
+ */
760
+ insertBefore: function(i, r, u, d) {
761
+ d = d || /** @type {any} */
762
+ o.languages;
763
+ var s = d[i], g = {};
764
+ for (var m in s)
765
+ if (s.hasOwnProperty(m)) {
766
+ if (m == r)
767
+ for (var h in u)
768
+ u.hasOwnProperty(h) && (g[h] = u[h]);
769
+ u.hasOwnProperty(m) || (g[m] = s[m]);
770
+ }
771
+ var E = d[i];
772
+ return d[i] = g, o.languages.DFS(o.languages, function(F, I) {
773
+ I === E && F != i && (this[F] = g);
774
+ }), g;
775
+ },
776
+ // Traverse a language definition with Depth First Search
777
+ DFS: function i(r, u, d, s) {
778
+ s = s || {};
779
+ var g = o.util.objId;
780
+ for (var m in r)
781
+ if (r.hasOwnProperty(m)) {
782
+ u.call(r, m, r[m], d || m);
783
+ var h = r[m], E = o.util.type(h);
784
+ E === "Object" && !s[g(h)] ? (s[g(h)] = !0, i(h, u, null, s)) : E === "Array" && !s[g(h)] && (s[g(h)] = !0, i(h, u, m, s));
785
+ }
786
+ }
787
+ },
788
+ plugins: {},
789
+ /**
790
+ * This is the most high-level function in Prism’s API.
791
+ * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
792
+ * each one of them.
793
+ *
794
+ * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
795
+ *
796
+ * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
797
+ * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
798
+ * @memberof Prism
799
+ * @public
800
+ */
801
+ highlightAll: function(i, r) {
802
+ o.highlightAllUnder(document, i, r);
803
+ },
804
+ /**
805
+ * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
806
+ * {@link Prism.highlightElement} on each one of them.
807
+ *
808
+ * The following hooks will be run:
809
+ * 1. `before-highlightall`
810
+ * 2. `before-all-elements-highlight`
811
+ * 3. All hooks of {@link Prism.highlightElement} for each element.
812
+ *
813
+ * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
814
+ * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
815
+ * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
816
+ * @memberof Prism
817
+ * @public
818
+ */
819
+ highlightAllUnder: function(i, r, u) {
820
+ var d = {
821
+ callback: u,
822
+ container: i,
823
+ selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
824
+ };
825
+ o.hooks.run("before-highlightall", d), d.elements = Array.prototype.slice.apply(d.container.querySelectorAll(d.selector)), o.hooks.run("before-all-elements-highlight", d);
826
+ for (var s = 0, g; g = d.elements[s++]; )
827
+ o.highlightElement(g, r === !0, d.callback);
828
+ },
829
+ /**
830
+ * Highlights the code inside a single element.
831
+ *
832
+ * The following hooks will be run:
833
+ * 1. `before-sanity-check`
834
+ * 2. `before-highlight`
835
+ * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
836
+ * 4. `before-insert`
837
+ * 5. `after-highlight`
838
+ * 6. `complete`
839
+ *
840
+ * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
841
+ * the element's language.
842
+ *
843
+ * @param {Element} element The element containing the code.
844
+ * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
845
+ * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
846
+ * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
847
+ * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
848
+ *
849
+ * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
850
+ * asynchronous highlighting to work. You can build your own bundle on the
851
+ * [Download page](https://prismjs.com/download.html).
852
+ * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
853
+ * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
854
+ * @memberof Prism
855
+ * @public
856
+ */
857
+ highlightElement: function(i, r, u) {
858
+ var d = o.util.getLanguage(i), s = o.languages[d];
859
+ o.util.setLanguage(i, d);
860
+ var g = i.parentElement;
861
+ g && g.nodeName.toLowerCase() === "pre" && o.util.setLanguage(g, d);
862
+ var m = i.textContent, h = {
863
+ element: i,
864
+ language: d,
865
+ grammar: s,
866
+ code: m
867
+ };
868
+ function E(I) {
869
+ h.highlightedCode = I, o.hooks.run("before-insert", h), h.element.innerHTML = h.highlightedCode, o.hooks.run("after-highlight", h), o.hooks.run("complete", h), u && u.call(h.element);
870
+ }
871
+ if (o.hooks.run("before-sanity-check", h), g = h.element.parentElement, g && g.nodeName.toLowerCase() === "pre" && !g.hasAttribute("tabindex") && g.setAttribute("tabindex", "0"), !h.code) {
872
+ o.hooks.run("complete", h), u && u.call(h.element);
873
+ return;
874
+ }
875
+ if (o.hooks.run("before-highlight", h), !h.grammar) {
876
+ E(o.util.encode(h.code));
877
+ return;
878
+ }
879
+ if (r && t.Worker) {
880
+ var F = new Worker(o.filename);
881
+ F.onmessage = function(I) {
882
+ E(I.data);
883
+ }, F.postMessage(JSON.stringify({
884
+ language: h.language,
885
+ code: h.code,
886
+ immediateClose: !0
887
+ }));
888
+ } else
889
+ E(o.highlight(h.code, h.grammar, h.language));
890
+ },
891
+ /**
892
+ * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
893
+ * and the language definitions to use, and returns a string with the HTML produced.
894
+ *
895
+ * The following hooks will be run:
896
+ * 1. `before-tokenize`
897
+ * 2. `after-tokenize`
898
+ * 3. `wrap`: On each {@link Token}.
899
+ *
900
+ * @param {string} text A string with the code to be highlighted.
901
+ * @param {Grammar} grammar An object containing the tokens to use.
902
+ *
903
+ * Usually a language definition like `Prism.languages.markup`.
904
+ * @param {string} language The name of the language definition passed to `grammar`.
905
+ * @returns {string} The highlighted HTML.
906
+ * @memberof Prism
907
+ * @public
908
+ * @example
909
+ * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
910
+ */
911
+ highlight: function(i, r, u) {
912
+ var d = {
913
+ code: i,
914
+ grammar: r,
915
+ language: u
916
+ };
917
+ if (o.hooks.run("before-tokenize", d), !d.grammar)
918
+ throw new Error('The language "' + d.language + '" has no grammar.');
919
+ return d.tokens = o.tokenize(d.code, d.grammar), o.hooks.run("after-tokenize", d), p.stringify(o.util.encode(d.tokens), d.language);
920
+ },
921
+ /**
922
+ * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
923
+ * and the language definitions to use, and returns an array with the tokenized code.
924
+ *
925
+ * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
926
+ *
927
+ * This method could be useful in other contexts as well, as a very crude parser.
928
+ *
929
+ * @param {string} text A string with the code to be highlighted.
930
+ * @param {Grammar} grammar An object containing the tokens to use.
931
+ *
932
+ * Usually a language definition like `Prism.languages.markup`.
933
+ * @returns {TokenStream} An array of strings and tokens, a token stream.
934
+ * @memberof Prism
935
+ * @public
936
+ * @example
937
+ * let code = `var foo = 0;`;
938
+ * let tokens = Prism.tokenize(code, Prism.languages.javascript);
939
+ * tokens.forEach(token => {
940
+ * if (token instanceof Prism.Token && token.type === 'number') {
941
+ * console.log(`Found numeric literal: ${token.content}`);
942
+ * }
943
+ * });
944
+ */
945
+ tokenize: function(i, r) {
946
+ var u = r.rest;
947
+ if (u) {
948
+ for (var d in u)
949
+ r[d] = u[d];
950
+ delete r.rest;
951
+ }
952
+ var s = new k();
953
+ return $(s, s.head, i), b(i, s, r, s.head, 0), w(s);
954
+ },
955
+ /**
956
+ * @namespace
957
+ * @memberof Prism
958
+ * @public
959
+ */
960
+ hooks: {
961
+ all: {},
962
+ /**
963
+ * Adds the given callback to the list of callbacks for the given hook.
964
+ *
965
+ * The callback will be invoked when the hook it is registered for is run.
966
+ * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
967
+ *
968
+ * One callback function can be registered to multiple hooks and the same hook multiple times.
969
+ *
970
+ * @param {string} name The name of the hook.
971
+ * @param {HookCallback} callback The callback function which is given environment variables.
972
+ * @public
973
+ */
974
+ add: function(i, r) {
975
+ var u = o.hooks.all;
976
+ u[i] = u[i] || [], u[i].push(r);
977
+ },
978
+ /**
979
+ * Runs a hook invoking all registered callbacks with the given environment variables.
980
+ *
981
+ * Callbacks will be invoked synchronously and in the order in which they were registered.
982
+ *
983
+ * @param {string} name The name of the hook.
984
+ * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
985
+ * @public
986
+ */
987
+ run: function(i, r) {
988
+ var u = o.hooks.all[i];
989
+ if (!(!u || !u.length))
990
+ for (var d = 0, s; s = u[d++]; )
991
+ s(r);
992
+ }
993
+ },
994
+ Token: p
995
+ };
996
+ t.Prism = o;
997
+ function p(i, r, u, d) {
998
+ this.type = i, this.content = r, this.alias = u, this.length = (d || "").length | 0;
999
+ }
1000
+ p.stringify = function i(r, u) {
1001
+ if (typeof r == "string")
1002
+ return r;
1003
+ if (Array.isArray(r)) {
1004
+ var d = "";
1005
+ return r.forEach(function(E) {
1006
+ d += i(E, u);
1007
+ }), d;
1008
+ }
1009
+ var s = {
1010
+ type: r.type,
1011
+ content: i(r.content, u),
1012
+ tag: "span",
1013
+ classes: ["token", r.type],
1014
+ attributes: {},
1015
+ language: u
1016
+ }, g = r.alias;
1017
+ g && (Array.isArray(g) ? Array.prototype.push.apply(s.classes, g) : s.classes.push(g)), o.hooks.run("wrap", s);
1018
+ var m = "";
1019
+ for (var h in s.attributes)
1020
+ m += " " + h + '="' + (s.attributes[h] || "").replace(/"/g, "&quot;") + '"';
1021
+ return "<" + s.tag + ' class="' + s.classes.join(" ") + '"' + m + ">" + s.content + "</" + s.tag + ">";
1022
+ };
1023
+ function A(i, r, u, d) {
1024
+ i.lastIndex = r;
1025
+ var s = i.exec(u);
1026
+ if (s && d && s[1]) {
1027
+ var g = s[1].length;
1028
+ s.index += g, s[0] = s[0].slice(g);
1029
+ }
1030
+ return s;
1031
+ }
1032
+ function b(i, r, u, d, s, g) {
1033
+ for (var m in u)
1034
+ if (!(!u.hasOwnProperty(m) || !u[m])) {
1035
+ var h = u[m];
1036
+ h = Array.isArray(h) ? h : [h];
1037
+ for (var E = 0; E < h.length; ++E) {
1038
+ if (g && g.cause == m + "," + E)
1039
+ return;
1040
+ var F = h[E], I = F.inside, J = !!F.lookbehind, Q = !!F.greedy, he = F.alias;
1041
+ if (Q && !F.pattern.global) {
1042
+ var fe = F.pattern.toString().match(/[imsuy]*$/)[0];
1043
+ F.pattern = RegExp(F.pattern.source, fe + "g");
1044
+ }
1045
+ for (var ee = F.pattern || F, L = d.next, P = s; L !== r.tail && !(g && P >= g.reach); P += L.value.length, L = L.next) {
1046
+ var O = L.value;
1047
+ if (r.length > i.length)
1048
+ return;
1049
+ if (!(O instanceof p)) {
1050
+ var z = 1, _;
1051
+ if (Q) {
1052
+ if (_ = A(ee, P, i, J), !_ || _.index >= i.length)
1053
+ break;
1054
+ var M = _.index, me = _.index + _[0].length, R = P;
1055
+ for (R += L.value.length; M >= R; )
1056
+ L = L.next, R += L.value.length;
1057
+ if (R -= L.value.length, P = R, L.value instanceof p)
1058
+ continue;
1059
+ for (var j = L; j !== r.tail && (R < me || typeof j.value == "string"); j = j.next)
1060
+ z++, R += j.value.length;
1061
+ z--, O = i.slice(P, R), _.index -= P;
1062
+ } else if (_ = A(ee, 0, O, J), !_)
1063
+ continue;
1064
+ var M = _.index, H = _[0], K = O.slice(0, M), te = O.slice(M + H.length), G = P + O.length;
1065
+ g && G > g.reach && (g.reach = G);
1066
+ var q = L.prev;
1067
+ K && (q = $(r, q, K), P += K.length), S(r, q, z);
1068
+ var ve = new p(m, I ? o.tokenize(H, I) : H, he, H);
1069
+ if (L = $(r, q, ve), te && $(r, L, te), z > 1) {
1070
+ var Z = {
1071
+ cause: m + "," + E,
1072
+ reach: G
1073
+ };
1074
+ b(i, r, u, L.prev, P, Z), g && Z.reach > g.reach && (g.reach = Z.reach);
1075
+ }
1076
+ }
1077
+ }
1078
+ }
1079
+ }
1080
+ }
1081
+ function k() {
1082
+ var i = { value: null, prev: null, next: null }, r = { value: null, prev: i, next: null };
1083
+ i.next = r, this.head = i, this.tail = r, this.length = 0;
1084
+ }
1085
+ function $(i, r, u) {
1086
+ var d = r.next, s = { value: u, prev: r, next: d };
1087
+ return r.next = s, d.prev = s, i.length++, s;
1088
+ }
1089
+ function S(i, r, u) {
1090
+ for (var d = r.next, s = 0; s < u && d !== i.tail; s++)
1091
+ d = d.next;
1092
+ r.next = d, d.prev = r, i.length -= s;
1093
+ }
1094
+ function w(i) {
1095
+ for (var r = [], u = i.head.next; u !== i.tail; )
1096
+ r.push(u.value), u = u.next;
1097
+ return r;
1098
+ }
1099
+ if (!t.document)
1100
+ return t.addEventListener && (o.disableWorkerMessageHandler || t.addEventListener("message", function(i) {
1101
+ var r = JSON.parse(i.data), u = r.language, d = r.code, s = r.immediateClose;
1102
+ t.postMessage(o.highlight(d, o.languages[u], u)), s && t.close();
1103
+ }, !1)), o;
1104
+ var y = o.util.currentScript();
1105
+ y && (o.filename = y.src, y.hasAttribute("data-manual") && (o.manual = !0));
1106
+ function f() {
1107
+ o.manual || o.highlightAll();
1108
+ }
1109
+ if (!o.manual) {
1110
+ var x = document.readyState;
1111
+ x === "loading" || x === "interactive" && y && y.defer ? document.addEventListener("DOMContentLoaded", f) : window.requestAnimationFrame ? window.requestAnimationFrame(f) : window.setTimeout(f, 16);
1112
+ }
1113
+ return o;
1114
+ })(a);
1115
+ n.exports && (n.exports = e), typeof ue < "u" && (ue.Prism = e), e.languages.markup = {
1116
+ comment: {
1117
+ pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
1118
+ greedy: !0
1119
+ },
1120
+ prolog: {
1121
+ pattern: /<\?[\s\S]+?\?>/,
1122
+ greedy: !0
1123
+ },
1124
+ doctype: {
1125
+ // https://www.w3.org/TR/xml/#NT-doctypedecl
1126
+ pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
1127
+ greedy: !0,
1128
+ inside: {
1129
+ "internal-subset": {
1130
+ pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
1131
+ lookbehind: !0,
1132
+ greedy: !0,
1133
+ inside: null
1134
+ // see below
1135
+ },
1136
+ string: {
1137
+ pattern: /"[^"]*"|'[^']*'/,
1138
+ greedy: !0
1139
+ },
1140
+ punctuation: /^<!|>$|[[\]]/,
1141
+ "doctype-tag": /^DOCTYPE/i,
1142
+ name: /[^\s<>'"]+/
1143
+ }
1144
+ },
1145
+ cdata: {
1146
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1147
+ greedy: !0
1148
+ },
1149
+ tag: {
1150
+ pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
1151
+ greedy: !0,
1152
+ inside: {
1153
+ tag: {
1154
+ pattern: /^<\/?[^\s>\/]+/,
1155
+ inside: {
1156
+ punctuation: /^<\/?/,
1157
+ namespace: /^[^\s>\/:]+:/
1158
+ }
1159
+ },
1160
+ "special-attr": [],
1161
+ "attr-value": {
1162
+ pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
1163
+ inside: {
1164
+ punctuation: [
1165
+ {
1166
+ pattern: /^=/,
1167
+ alias: "attr-equals"
1168
+ },
1169
+ {
1170
+ pattern: /^(\s*)["']|["']$/,
1171
+ lookbehind: !0
1172
+ }
1173
+ ]
1174
+ }
1175
+ },
1176
+ punctuation: /\/?>/,
1177
+ "attr-name": {
1178
+ pattern: /[^\s>\/]+/,
1179
+ inside: {
1180
+ namespace: /^[^\s>\/:]+:/
1181
+ }
1182
+ }
1183
+ }
1184
+ },
1185
+ entity: [
1186
+ {
1187
+ pattern: /&[\da-z]{1,8};/i,
1188
+ alias: "named-entity"
1189
+ },
1190
+ /&#x?[\da-f]{1,8};/i
1191
+ ]
1192
+ }, e.languages.markup.tag.inside["attr-value"].inside.entity = e.languages.markup.entity, e.languages.markup.doctype.inside["internal-subset"].inside = e.languages.markup, e.hooks.add("wrap", function(t) {
1193
+ t.type === "entity" && (t.attributes.title = t.content.replace(/&amp;/, "&"));
1194
+ }), Object.defineProperty(e.languages.markup.tag, "addInlined", {
1195
+ /**
1196
+ * Adds an inlined language to markup.
1197
+ *
1198
+ * An example of an inlined language is CSS with `<style>` tags.
1199
+ *
1200
+ * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
1201
+ * case insensitive.
1202
+ * @param {string} lang The language key.
1203
+ * @example
1204
+ * addInlined('style', 'css');
1205
+ */
1206
+ value: function(l, c) {
1207
+ var v = {};
1208
+ v["language-" + c] = {
1209
+ pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1210
+ lookbehind: !0,
1211
+ inside: e.languages[c]
1212
+ }, v.cdata = /^<!\[CDATA\[|\]\]>$/i;
1213
+ var o = {
1214
+ "included-cdata": {
1215
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1216
+ inside: v
1217
+ }
1218
+ };
1219
+ o["language-" + c] = {
1220
+ pattern: /[\s\S]+/,
1221
+ inside: e.languages[c]
1222
+ };
1223
+ var p = {};
1224
+ p[l] = {
1225
+ pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
1226
+ return l;
1227
+ }), "i"),
1228
+ lookbehind: !0,
1229
+ greedy: !0,
1230
+ inside: o
1231
+ }, e.languages.insertBefore("markup", "cdata", p);
1232
+ }
1233
+ }), Object.defineProperty(e.languages.markup.tag, "addAttribute", {
1234
+ /**
1235
+ * Adds an pattern to highlight languages embedded in HTML attributes.
1236
+ *
1237
+ * An example of an inlined language is CSS with `style` attributes.
1238
+ *
1239
+ * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
1240
+ * case insensitive.
1241
+ * @param {string} lang The language key.
1242
+ * @example
1243
+ * addAttribute('style', 'css');
1244
+ */
1245
+ value: function(t, l) {
1246
+ e.languages.markup.tag.inside["special-attr"].push({
1247
+ pattern: RegExp(
1248
+ /(^|["'\s])/.source + "(?:" + t + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
1249
+ "i"
1250
+ ),
1251
+ lookbehind: !0,
1252
+ inside: {
1253
+ "attr-name": /^[^\s=]+/,
1254
+ "attr-value": {
1255
+ pattern: /=[\s\S]+/,
1256
+ inside: {
1257
+ value: {
1258
+ pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1259
+ lookbehind: !0,
1260
+ alias: [l, "language-" + l],
1261
+ inside: e.languages[l]
1262
+ },
1263
+ punctuation: [
1264
+ {
1265
+ pattern: /^=/,
1266
+ alias: "attr-equals"
1267
+ },
1268
+ /"|'/
1269
+ ]
1270
+ }
1271
+ }
1272
+ }
1273
+ });
1274
+ }
1275
+ }), e.languages.html = e.languages.markup, e.languages.mathml = e.languages.markup, e.languages.svg = e.languages.markup, e.languages.xml = e.languages.extend("markup", {}), e.languages.ssml = e.languages.xml, e.languages.atom = e.languages.xml, e.languages.rss = e.languages.xml, (function(t) {
1276
+ var l = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1277
+ t.languages.css = {
1278
+ comment: /\/\*[\s\S]*?\*\//,
1279
+ atrule: {
1280
+ pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + l.source + ")*?" + /(?:;|(?=\s*\{))/.source),
1281
+ inside: {
1282
+ rule: /^@[\w-]+/,
1283
+ "selector-function-argument": {
1284
+ pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
1285
+ lookbehind: !0,
1286
+ alias: "selector"
1287
+ },
1288
+ keyword: {
1289
+ pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
1290
+ lookbehind: !0
1291
+ }
1292
+ // See rest below
1293
+ }
1294
+ },
1295
+ url: {
1296
+ // https://drafts.csswg.org/css-values-3/#urls
1297
+ pattern: RegExp("\\burl\\((?:" + l.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
1298
+ greedy: !0,
1299
+ inside: {
1300
+ function: /^url/i,
1301
+ punctuation: /^\(|\)$/,
1302
+ string: {
1303
+ pattern: RegExp("^" + l.source + "$"),
1304
+ alias: "url"
1305
+ }
1306
+ }
1307
+ },
1308
+ selector: {
1309
+ pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + l.source + ")*(?=\\s*\\{)"),
1310
+ lookbehind: !0
1311
+ },
1312
+ string: {
1313
+ pattern: l,
1314
+ greedy: !0
1315
+ },
1316
+ property: {
1317
+ pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
1318
+ lookbehind: !0
1319
+ },
1320
+ important: /!important\b/i,
1321
+ function: {
1322
+ pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
1323
+ lookbehind: !0
1324
+ },
1325
+ punctuation: /[(){};:,]/
1326
+ }, t.languages.css.atrule.inside.rest = t.languages.css;
1327
+ var c = t.languages.markup;
1328
+ c && (c.tag.addInlined("style", "css"), c.tag.addAttribute("style", "css"));
1329
+ })(e), e.languages.clike = {
1330
+ comment: [
1331
+ {
1332
+ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
1333
+ lookbehind: !0,
1334
+ greedy: !0
1335
+ },
1336
+ {
1337
+ pattern: /(^|[^\\:])\/\/.*/,
1338
+ lookbehind: !0,
1339
+ greedy: !0
1340
+ }
1341
+ ],
1342
+ string: {
1343
+ pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
1344
+ greedy: !0
1345
+ },
1346
+ "class-name": {
1347
+ pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
1348
+ lookbehind: !0,
1349
+ inside: {
1350
+ punctuation: /[.\\]/
1351
+ }
1352
+ },
1353
+ keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
1354
+ boolean: /\b(?:false|true)\b/,
1355
+ function: /\b\w+(?=\()/,
1356
+ number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
1357
+ operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
1358
+ punctuation: /[{}[\];(),.:]/
1359
+ }, e.languages.javascript = e.languages.extend("clike", {
1360
+ "class-name": [
1361
+ e.languages.clike["class-name"],
1362
+ {
1363
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
1364
+ lookbehind: !0
1365
+ }
1366
+ ],
1367
+ keyword: [
1368
+ {
1369
+ pattern: /((?:^|\})\s*)catch\b/,
1370
+ lookbehind: !0
1371
+ },
1372
+ {
1373
+ 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/,
1374
+ lookbehind: !0
1375
+ }
1376
+ ],
1377
+ // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
1378
+ function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1379
+ number: {
1380
+ pattern: RegExp(
1381
+ /(^|[^\w$])/.source + "(?:" + // constant
1382
+ (/NaN|Infinity/.source + "|" + // binary integer
1383
+ /0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
1384
+ /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
1385
+ /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
1386
+ /\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
1387
+ /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
1388
+ ),
1389
+ lookbehind: !0
1390
+ },
1391
+ operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1392
+ }), e.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, e.languages.insertBefore("javascript", "keyword", {
1393
+ regex: {
1394
+ pattern: RegExp(
1395
+ // lookbehind
1396
+ // eslint-disable-next-line regexp/no-dupe-characters-character-class
1397
+ /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
1398
+ // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
1399
+ // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
1400
+ // with the only syntax, so we have to define 2 different regex patterns.
1401
+ /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
1402
+ /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
1403
+ /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
1404
+ ),
1405
+ lookbehind: !0,
1406
+ greedy: !0,
1407
+ inside: {
1408
+ "regex-source": {
1409
+ pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1410
+ lookbehind: !0,
1411
+ alias: "language-regex",
1412
+ inside: e.languages.regex
1413
+ },
1414
+ "regex-delimiter": /^\/|\/$/,
1415
+ "regex-flags": /^[a-z]+$/
1416
+ }
1417
+ },
1418
+ // This must be declared before keyword because we use "function" inside the look-forward
1419
+ "function-variable": {
1420
+ 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*=>))/,
1421
+ alias: "function"
1422
+ },
1423
+ parameter: [
1424
+ {
1425
+ pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1426
+ lookbehind: !0,
1427
+ inside: e.languages.javascript
1428
+ },
1429
+ {
1430
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1431
+ lookbehind: !0,
1432
+ inside: e.languages.javascript
1433
+ },
1434
+ {
1435
+ pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1436
+ lookbehind: !0,
1437
+ inside: e.languages.javascript
1438
+ },
1439
+ {
1440
+ 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*\{)/,
1441
+ lookbehind: !0,
1442
+ inside: e.languages.javascript
1443
+ }
1444
+ ],
1445
+ constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1446
+ }), e.languages.insertBefore("javascript", "string", {
1447
+ hashbang: {
1448
+ pattern: /^#!.*/,
1449
+ greedy: !0,
1450
+ alias: "comment"
1451
+ },
1452
+ "template-string": {
1453
+ pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
1454
+ greedy: !0,
1455
+ inside: {
1456
+ "template-punctuation": {
1457
+ pattern: /^`|`$/,
1458
+ alias: "string"
1459
+ },
1460
+ interpolation: {
1461
+ pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
1462
+ lookbehind: !0,
1463
+ inside: {
1464
+ "interpolation-punctuation": {
1465
+ pattern: /^\$\{|\}$/,
1466
+ alias: "punctuation"
1467
+ },
1468
+ rest: e.languages.javascript
1469
+ }
1470
+ },
1471
+ string: /[\s\S]+/
1472
+ }
1473
+ },
1474
+ "string-property": {
1475
+ pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
1476
+ lookbehind: !0,
1477
+ greedy: !0,
1478
+ alias: "property"
1479
+ }
1480
+ }), e.languages.insertBefore("javascript", "operator", {
1481
+ "literal-property": {
1482
+ pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
1483
+ lookbehind: !0,
1484
+ alias: "property"
1485
+ }
1486
+ }), e.languages.markup && (e.languages.markup.tag.addInlined("script", "javascript"), e.languages.markup.tag.addAttribute(
1487
+ /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,
1488
+ "javascript"
1489
+ )), e.languages.js = e.languages.javascript, (function() {
1490
+ if (typeof e > "u" || typeof document > "u")
1491
+ return;
1492
+ Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
1493
+ var t = "Loading…", l = function(y, f) {
1494
+ return "✖ Error " + y + " while fetching file: " + f;
1495
+ }, c = "✖ Error: File does not exist or is empty", v = {
1496
+ js: "javascript",
1497
+ py: "python",
1498
+ rb: "ruby",
1499
+ ps1: "powershell",
1500
+ psm1: "powershell",
1501
+ sh: "bash",
1502
+ bat: "batch",
1503
+ h: "c",
1504
+ tex: "latex"
1505
+ }, o = "data-src-status", p = "loading", A = "loaded", b = "failed", k = "pre[data-src]:not([" + o + '="' + A + '"]):not([' + o + '="' + p + '"])';
1506
+ function $(y, f, x) {
1507
+ var i = new XMLHttpRequest();
1508
+ i.open("GET", y, !0), i.onreadystatechange = function() {
1509
+ i.readyState == 4 && (i.status < 400 && i.responseText ? f(i.responseText) : i.status >= 400 ? x(l(i.status, i.statusText)) : x(c));
1510
+ }, i.send(null);
1511
+ }
1512
+ function S(y) {
1513
+ var f = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(y || "");
1514
+ if (f) {
1515
+ var x = Number(f[1]), i = f[2], r = f[3];
1516
+ return i ? r ? [x, Number(r)] : [x, void 0] : [x, x];
1517
+ }
1518
+ }
1519
+ e.hooks.add("before-highlightall", function(y) {
1520
+ y.selector += ", " + k;
1521
+ }), e.hooks.add("before-sanity-check", function(y) {
1522
+ var f = (
1523
+ /** @type {HTMLPreElement} */
1524
+ y.element
1525
+ );
1526
+ if (f.matches(k)) {
1527
+ y.code = "", f.setAttribute(o, p);
1528
+ var x = f.appendChild(document.createElement("CODE"));
1529
+ x.textContent = t;
1530
+ var i = f.getAttribute("data-src"), r = y.language;
1531
+ if (r === "none") {
1532
+ var u = (/\.(\w+)$/.exec(i) || [, "none"])[1];
1533
+ r = v[u] || u;
1534
+ }
1535
+ e.util.setLanguage(x, r), e.util.setLanguage(f, r);
1536
+ var d = e.plugins.autoloader;
1537
+ d && d.loadLanguages(r), $(
1538
+ i,
1539
+ function(s) {
1540
+ f.setAttribute(o, A);
1541
+ var g = S(f.getAttribute("data-range"));
1542
+ if (g) {
1543
+ var m = s.split(/\r\n?|\n/g), h = g[0], E = g[1] == null ? m.length : g[1];
1544
+ h < 0 && (h += m.length), h = Math.max(0, Math.min(h - 1, m.length)), E < 0 && (E += m.length), E = Math.max(0, Math.min(E, m.length)), s = m.slice(h, E).join(`
1545
+ `), f.hasAttribute("data-start") || f.setAttribute("data-start", String(h + 1));
1546
+ }
1547
+ x.textContent = s, e.highlightElement(x);
1548
+ },
1549
+ function(s) {
1550
+ f.setAttribute(o, b), x.textContent = s;
1551
+ }
1552
+ );
1553
+ }
1554
+ }), e.plugins.fileHighlight = {
1555
+ /**
1556
+ * Executes the File Highlight plugin for all matching `pre` elements under the given container.
1557
+ *
1558
+ * Note: Elements which are already loaded or currently loading will not be touched by this method.
1559
+ *
1560
+ * @param {ParentNode} [container=document]
1561
+ */
1562
+ highlight: function(f) {
1563
+ for (var x = (f || document).querySelectorAll(k), i = 0, r; r = x[i++]; )
1564
+ e.highlightElement(r);
1565
+ }
1566
+ };
1567
+ var w = !1;
1568
+ e.fileHighlight = function() {
1569
+ w || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), w = !0), e.plugins.fileHighlight.highlight.apply(this, arguments);
1570
+ };
1571
+ })();
1572
+ })(U)), U.exports;
1573
+ }
1574
+ var Oe = Re();
1575
+ const de = /* @__PURE__ */ Ie(Oe);
1576
+ Prism.languages.markup = {
1577
+ comment: {
1578
+ pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
1579
+ greedy: !0
1580
+ },
1581
+ prolog: {
1582
+ pattern: /<\?[\s\S]+?\?>/,
1583
+ greedy: !0
1584
+ },
1585
+ doctype: {
1586
+ // https://www.w3.org/TR/xml/#NT-doctypedecl
1587
+ pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
1588
+ greedy: !0,
1589
+ inside: {
1590
+ "internal-subset": {
1591
+ pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
1592
+ lookbehind: !0,
1593
+ greedy: !0,
1594
+ inside: null
1595
+ // see below
1596
+ },
1597
+ string: {
1598
+ pattern: /"[^"]*"|'[^']*'/,
1599
+ greedy: !0
1600
+ },
1601
+ punctuation: /^<!|>$|[[\]]/,
1602
+ "doctype-tag": /^DOCTYPE/i,
1603
+ name: /[^\s<>'"]+/
1604
+ }
1605
+ },
1606
+ cdata: {
1607
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1608
+ greedy: !0
1609
+ },
1610
+ tag: {
1611
+ pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
1612
+ greedy: !0,
1613
+ inside: {
1614
+ tag: {
1615
+ pattern: /^<\/?[^\s>\/]+/,
1616
+ inside: {
1617
+ punctuation: /^<\/?/,
1618
+ namespace: /^[^\s>\/:]+:/
1619
+ }
1620
+ },
1621
+ "special-attr": [],
1622
+ "attr-value": {
1623
+ pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
1624
+ inside: {
1625
+ punctuation: [
1626
+ {
1627
+ pattern: /^=/,
1628
+ alias: "attr-equals"
1629
+ },
1630
+ {
1631
+ pattern: /^(\s*)["']|["']$/,
1632
+ lookbehind: !0
1633
+ }
1634
+ ]
1635
+ }
1636
+ },
1637
+ punctuation: /\/?>/,
1638
+ "attr-name": {
1639
+ pattern: /[^\s>\/]+/,
1640
+ inside: {
1641
+ namespace: /^[^\s>\/:]+:/
1642
+ }
1643
+ }
1644
+ }
1645
+ },
1646
+ entity: [
1647
+ {
1648
+ pattern: /&[\da-z]{1,8};/i,
1649
+ alias: "named-entity"
1650
+ },
1651
+ /&#x?[\da-f]{1,8};/i
1652
+ ]
1653
+ };
1654
+ Prism.languages.markup.tag.inside["attr-value"].inside.entity = Prism.languages.markup.entity;
1655
+ Prism.languages.markup.doctype.inside["internal-subset"].inside = Prism.languages.markup;
1656
+ Prism.hooks.add("wrap", function(n) {
1657
+ n.type === "entity" && (n.attributes.title = n.content.replace(/&amp;/, "&"));
1658
+ });
1659
+ Object.defineProperty(Prism.languages.markup.tag, "addInlined", {
1660
+ /**
1661
+ * Adds an inlined language to markup.
1662
+ *
1663
+ * An example of an inlined language is CSS with `<style>` tags.
1664
+ *
1665
+ * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
1666
+ * case insensitive.
1667
+ * @param {string} lang The language key.
1668
+ * @example
1669
+ * addInlined('style', 'css');
1670
+ */
1671
+ value: function(a, e) {
1672
+ var t = {};
1673
+ t["language-" + e] = {
1674
+ pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1675
+ lookbehind: !0,
1676
+ inside: Prism.languages[e]
1677
+ }, t.cdata = /^<!\[CDATA\[|\]\]>$/i;
1678
+ var l = {
1679
+ "included-cdata": {
1680
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1681
+ inside: t
1682
+ }
1683
+ };
1684
+ l["language-" + e] = {
1685
+ pattern: /[\s\S]+/,
1686
+ inside: Prism.languages[e]
1687
+ };
1688
+ var c = {};
1689
+ c[a] = {
1690
+ pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
1691
+ return a;
1692
+ }), "i"),
1693
+ lookbehind: !0,
1694
+ greedy: !0,
1695
+ inside: l
1696
+ }, Prism.languages.insertBefore("markup", "cdata", c);
1697
+ }
1698
+ });
1699
+ Object.defineProperty(Prism.languages.markup.tag, "addAttribute", {
1700
+ /**
1701
+ * Adds an pattern to highlight languages embedded in HTML attributes.
1702
+ *
1703
+ * An example of an inlined language is CSS with `style` attributes.
1704
+ *
1705
+ * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
1706
+ * case insensitive.
1707
+ * @param {string} lang The language key.
1708
+ * @example
1709
+ * addAttribute('style', 'css');
1710
+ */
1711
+ value: function(n, a) {
1712
+ Prism.languages.markup.tag.inside["special-attr"].push({
1713
+ pattern: RegExp(
1714
+ /(^|["'\s])/.source + "(?:" + n + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
1715
+ "i"
1716
+ ),
1717
+ lookbehind: !0,
1718
+ inside: {
1719
+ "attr-name": /^[^\s=]+/,
1720
+ "attr-value": {
1721
+ pattern: /=[\s\S]+/,
1722
+ inside: {
1723
+ value: {
1724
+ pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1725
+ lookbehind: !0,
1726
+ alias: [a, "language-" + a],
1727
+ inside: Prism.languages[a]
1728
+ },
1729
+ punctuation: [
1730
+ {
1731
+ pattern: /^=/,
1732
+ alias: "attr-equals"
1733
+ },
1734
+ /"|'/
1735
+ ]
1736
+ }
1737
+ }
1738
+ }
1739
+ });
1740
+ }
1741
+ });
1742
+ Prism.languages.html = Prism.languages.markup;
1743
+ Prism.languages.mathml = Prism.languages.markup;
1744
+ Prism.languages.svg = Prism.languages.markup;
1745
+ Prism.languages.xml = Prism.languages.extend("markup", {});
1746
+ Prism.languages.ssml = Prism.languages.xml;
1747
+ Prism.languages.atom = Prism.languages.xml;
1748
+ Prism.languages.rss = Prism.languages.xml;
1749
+ (function(n) {
1750
+ var a = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;
1751
+ function e(b) {
1752
+ return b = b.replace(/<inner>/g, function() {
1753
+ return a;
1754
+ }), RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + b + ")");
1755
+ }
1756
+ var t = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source, l = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g, function() {
1757
+ return t;
1758
+ }), c = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;
1759
+ n.languages.markdown = n.languages.extend("markup", {}), n.languages.insertBefore("markdown", "prolog", {
1760
+ "front-matter-block": {
1761
+ pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,
1762
+ lookbehind: !0,
1763
+ greedy: !0,
1764
+ inside: {
1765
+ punctuation: /^---|---$/,
1766
+ "front-matter": {
1767
+ pattern: /\S+(?:\s+\S+)*/,
1768
+ alias: ["yaml", "language-yaml"],
1769
+ inside: n.languages.yaml
1770
+ }
1771
+ }
1772
+ },
1773
+ blockquote: {
1774
+ // > ...
1775
+ pattern: /^>(?:[\t ]*>)*/m,
1776
+ alias: "punctuation"
1777
+ },
1778
+ table: {
1779
+ pattern: RegExp("^" + l + c + "(?:" + l + ")*", "m"),
1780
+ inside: {
1781
+ "table-data-rows": {
1782
+ pattern: RegExp("^(" + l + c + ")(?:" + l + ")*$"),
1783
+ lookbehind: !0,
1784
+ inside: {
1785
+ "table-data": {
1786
+ pattern: RegExp(t),
1787
+ inside: n.languages.markdown
1788
+ },
1789
+ punctuation: /\|/
1790
+ }
1791
+ },
1792
+ "table-line": {
1793
+ pattern: RegExp("^(" + l + ")" + c + "$"),
1794
+ lookbehind: !0,
1795
+ inside: {
1796
+ punctuation: /\||:?-{3,}:?/
1797
+ }
1798
+ },
1799
+ "table-header-row": {
1800
+ pattern: RegExp("^" + l + "$"),
1801
+ inside: {
1802
+ "table-header": {
1803
+ pattern: RegExp(t),
1804
+ alias: "important",
1805
+ inside: n.languages.markdown
1806
+ },
1807
+ punctuation: /\|/
1808
+ }
1809
+ }
1810
+ }
1811
+ },
1812
+ code: [
1813
+ {
1814
+ // Prefixed by 4 spaces or 1 tab and preceded by an empty line
1815
+ pattern: /((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,
1816
+ lookbehind: !0,
1817
+ alias: "keyword"
1818
+ },
1819
+ {
1820
+ // ```optional language
1821
+ // code block
1822
+ // ```
1823
+ pattern: /^```[\s\S]*?^```$/m,
1824
+ greedy: !0,
1825
+ inside: {
1826
+ "code-block": {
1827
+ pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,
1828
+ lookbehind: !0
1829
+ },
1830
+ "code-language": {
1831
+ pattern: /^(```).+/,
1832
+ lookbehind: !0
1833
+ },
1834
+ punctuation: /```/
1835
+ }
1836
+ }
1837
+ ],
1838
+ title: [
1839
+ {
1840
+ // title 1
1841
+ // =======
1842
+ // title 2
1843
+ // -------
1844
+ pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,
1845
+ alias: "important",
1846
+ inside: {
1847
+ punctuation: /==+$|--+$/
1848
+ }
1849
+ },
1850
+ {
1851
+ // # title 1
1852
+ // ###### title 6
1853
+ pattern: /(^\s*)#.+/m,
1854
+ lookbehind: !0,
1855
+ alias: "important",
1856
+ inside: {
1857
+ punctuation: /^#+|#+$/
1858
+ }
1859
+ }
1860
+ ],
1861
+ hr: {
1862
+ // ***
1863
+ // ---
1864
+ // * * *
1865
+ // -----------
1866
+ pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,
1867
+ lookbehind: !0,
1868
+ alias: "punctuation"
1869
+ },
1870
+ list: {
1871
+ // * item
1872
+ // + item
1873
+ // - item
1874
+ // 1. item
1875
+ pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,
1876
+ lookbehind: !0,
1877
+ alias: "punctuation"
1878
+ },
1879
+ "url-reference": {
1880
+ // [id]: http://example.com "Optional title"
1881
+ // [id]: http://example.com 'Optional title'
1882
+ // [id]: http://example.com (Optional title)
1883
+ // [id]: <http://example.com> "Optional title"
1884
+ pattern: /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,
1885
+ inside: {
1886
+ variable: {
1887
+ pattern: /^(!?\[)[^\]]+/,
1888
+ lookbehind: !0
1889
+ },
1890
+ string: /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,
1891
+ punctuation: /^[\[\]!:]|[<>]/
1892
+ },
1893
+ alias: "url"
1894
+ },
1895
+ bold: {
1896
+ // **strong**
1897
+ // __strong__
1898
+ // allow one nested instance of italic text using the same delimiter
1899
+ pattern: e(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),
1900
+ lookbehind: !0,
1901
+ greedy: !0,
1902
+ inside: {
1903
+ content: {
1904
+ pattern: /(^..)[\s\S]+(?=..$)/,
1905
+ lookbehind: !0,
1906
+ inside: {}
1907
+ // see below
1908
+ },
1909
+ punctuation: /\*\*|__/
1910
+ }
1911
+ },
1912
+ italic: {
1913
+ // *em*
1914
+ // _em_
1915
+ // allow one nested instance of bold text using the same delimiter
1916
+ pattern: e(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),
1917
+ lookbehind: !0,
1918
+ greedy: !0,
1919
+ inside: {
1920
+ content: {
1921
+ pattern: /(^.)[\s\S]+(?=.$)/,
1922
+ lookbehind: !0,
1923
+ inside: {}
1924
+ // see below
1925
+ },
1926
+ punctuation: /[*_]/
1927
+ }
1928
+ },
1929
+ strike: {
1930
+ // ~~strike through~~
1931
+ // ~strike~
1932
+ // eslint-disable-next-line regexp/strict
1933
+ pattern: e(/(~~?)(?:(?!~)<inner>)+\2/.source),
1934
+ lookbehind: !0,
1935
+ greedy: !0,
1936
+ inside: {
1937
+ content: {
1938
+ pattern: /(^~~?)[\s\S]+(?=\1$)/,
1939
+ lookbehind: !0,
1940
+ inside: {}
1941
+ // see below
1942
+ },
1943
+ punctuation: /~~?/
1944
+ }
1945
+ },
1946
+ "code-snippet": {
1947
+ // `code`
1948
+ // ``code``
1949
+ pattern: /(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,
1950
+ lookbehind: !0,
1951
+ greedy: !0,
1952
+ alias: ["code", "keyword"]
1953
+ },
1954
+ url: {
1955
+ // [example](http://example.com "Optional title")
1956
+ // [example][id]
1957
+ // [example] [id]
1958
+ pattern: e(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),
1959
+ lookbehind: !0,
1960
+ greedy: !0,
1961
+ inside: {
1962
+ operator: /^!/,
1963
+ content: {
1964
+ pattern: /(^\[)[^\]]+(?=\])/,
1965
+ lookbehind: !0,
1966
+ inside: {}
1967
+ // see below
1968
+ },
1969
+ variable: {
1970
+ pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/,
1971
+ lookbehind: !0
1972
+ },
1973
+ url: {
1974
+ pattern: /(^\]\()[^\s)]+/,
1975
+ lookbehind: !0
1976
+ },
1977
+ string: {
1978
+ pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,
1979
+ lookbehind: !0
1980
+ }
1981
+ }
1982
+ }
1983
+ }), ["url", "bold", "italic", "strike"].forEach(function(b) {
1984
+ ["url", "bold", "italic", "strike", "code-snippet"].forEach(function(k) {
1985
+ b !== k && (n.languages.markdown[b].inside.content.inside[k] = n.languages.markdown[k]);
1986
+ });
1987
+ }), n.hooks.add("after-tokenize", function(b) {
1988
+ if (b.language !== "markdown" && b.language !== "md")
1989
+ return;
1990
+ function k($) {
1991
+ if (!(!$ || typeof $ == "string"))
1992
+ for (var S = 0, w = $.length; S < w; S++) {
1993
+ var y = $[S];
1994
+ if (y.type !== "code") {
1995
+ k(y.content);
1996
+ continue;
1997
+ }
1998
+ var f = y.content[1], x = y.content[3];
1999
+ if (f && x && f.type === "code-language" && x.type === "code-block" && typeof f.content == "string") {
2000
+ var i = f.content.replace(/\b#/g, "sharp").replace(/\b\+\+/g, "pp");
2001
+ i = (/[a-z][\w-]*/i.exec(i) || [""])[0].toLowerCase();
2002
+ var r = "language-" + i;
2003
+ x.alias ? typeof x.alias == "string" ? x.alias = [x.alias, r] : x.alias.push(r) : x.alias = [r];
2004
+ }
2005
+ }
2006
+ }
2007
+ k(b.tokens);
2008
+ }), n.hooks.add("wrap", function(b) {
2009
+ if (b.type === "code-block") {
2010
+ for (var k = "", $ = 0, S = b.classes.length; $ < S; $++) {
2011
+ var w = b.classes[$], y = /language-(.+)/.exec(w);
2012
+ if (y) {
2013
+ k = y[1];
2014
+ break;
2015
+ }
2016
+ }
2017
+ var f = n.languages[k];
2018
+ if (f)
2019
+ b.content = n.highlight(A(b.content), f, k);
2020
+ else if (k && k !== "none" && n.plugins.autoloader) {
2021
+ var x = "md-" + (/* @__PURE__ */ new Date()).valueOf() + "-" + Math.floor(Math.random() * 1e16);
2022
+ b.attributes.id = x, n.plugins.autoloader.loadLanguages(k, function() {
2023
+ var i = document.getElementById(x);
2024
+ i && (i.innerHTML = n.highlight(i.textContent, n.languages[k], k));
2025
+ });
2026
+ }
2027
+ }
2028
+ });
2029
+ var v = RegExp(n.languages.markup.tag.pattern.source, "gi"), o = {
2030
+ amp: "&",
2031
+ lt: "<",
2032
+ gt: ">",
2033
+ quot: '"'
2034
+ }, p = String.fromCodePoint || String.fromCharCode;
2035
+ function A(b) {
2036
+ var k = b.replace(v, "");
2037
+ return k = k.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function($, S) {
2038
+ if (S = S.toLowerCase(), S[0] === "#") {
2039
+ var w;
2040
+ return S[1] === "x" ? w = parseInt(S.slice(2), 16) : w = Number(S.slice(1)), p(w);
2041
+ } else {
2042
+ var y = o[S];
2043
+ return y || $;
2044
+ }
2045
+ }), k;
2046
+ }
2047
+ n.languages.md = n.languages.markdown;
2048
+ })(Prism);
2049
+ Prism.languages.json = {
2050
+ property: {
2051
+ pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
2052
+ lookbehind: !0,
2053
+ greedy: !0
2054
+ },
2055
+ string: {
2056
+ pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
2057
+ lookbehind: !0,
2058
+ greedy: !0
2059
+ },
2060
+ comment: {
2061
+ pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
2062
+ greedy: !0
2063
+ },
2064
+ number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
2065
+ punctuation: /[{}[\],]/,
2066
+ operator: /:/,
2067
+ boolean: /\b(?:false|true)\b/,
2068
+ null: {
2069
+ pattern: /\bnull\b/,
2070
+ alias: "keyword"
2071
+ }
2072
+ };
2073
+ Prism.languages.webmanifest = Prism.languages.json;
2074
+ (function(n) {
2075
+ var a = /[*&][^\s[\]{},]+/, e = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/, t = "(?:" + e.source + "(?:[ ]+" + a.source + ")?|" + a.source + "(?:[ ]+" + e.source + ")?)", l = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g, function() {
2076
+ return /[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source;
2077
+ }), c = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
2078
+ function v(o, p) {
2079
+ p = (p || "").replace(/m/g, "") + "m";
2080
+ var A = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g, function() {
2081
+ return t;
2082
+ }).replace(/<<value>>/g, function() {
2083
+ return o;
2084
+ });
2085
+ return RegExp(A, p);
2086
+ }
2087
+ n.languages.yaml = {
2088
+ scalar: {
2089
+ pattern: RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g, function() {
2090
+ return t;
2091
+ })),
2092
+ lookbehind: !0,
2093
+ alias: "string"
2094
+ },
2095
+ comment: /#.*/,
2096
+ key: {
2097
+ pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g, function() {
2098
+ return t;
2099
+ }).replace(/<<key>>/g, function() {
2100
+ return "(?:" + l + "|" + c + ")";
2101
+ })),
2102
+ lookbehind: !0,
2103
+ greedy: !0,
2104
+ alias: "atrule"
2105
+ },
2106
+ directive: {
2107
+ pattern: /(^[ \t]*)%.+/m,
2108
+ lookbehind: !0,
2109
+ alias: "important"
2110
+ },
2111
+ datetime: {
2112
+ pattern: v(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),
2113
+ lookbehind: !0,
2114
+ alias: "number"
2115
+ },
2116
+ boolean: {
2117
+ pattern: v(/false|true/.source, "i"),
2118
+ lookbehind: !0,
2119
+ alias: "important"
2120
+ },
2121
+ null: {
2122
+ pattern: v(/null|~/.source, "i"),
2123
+ lookbehind: !0,
2124
+ alias: "important"
2125
+ },
2126
+ string: {
2127
+ pattern: v(c),
2128
+ lookbehind: !0,
2129
+ greedy: !0
2130
+ },
2131
+ number: {
2132
+ pattern: v(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, "i"),
2133
+ lookbehind: !0
2134
+ },
2135
+ tag: e,
2136
+ important: a,
2137
+ punctuation: /---|[:[\]{}\-,|>?]|\.\.\./
2138
+ }, n.languages.yml = n.languages.yaml;
2139
+ })(Prism);
2140
+ function je(n, a) {
2141
+ const e = de.languages[a];
2142
+ return e ? de.highlight(n, e, a) : De(n);
2143
+ }
2144
+ function De(n) {
2145
+ return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
2146
+ }
2147
+ function ze(n) {
2148
+ switch (n) {
2149
+ case "md":
2150
+ return "markdown";
2151
+ case "xml":
2152
+ return "markup";
2153
+ case "json":
2154
+ return "json";
2155
+ case "yaml":
2156
+ return "yaml";
2157
+ default:
2158
+ return null;
2159
+ }
2160
+ }
2161
+ function Me(n) {
2162
+ return (a) => {
2163
+ if (n === "pd") return Te(a);
2164
+ const e = ze(n);
2165
+ return e ? je(a, e) : Ae(a);
2166
+ };
2167
+ }
2168
+ function He(n, a = {}) {
2169
+ return Le(n, a, Me);
2170
+ }
2171
+ export {
2172
+ He as createPdEditor
2173
+ };
2174
+ //# sourceMappingURL=index.js.map