@hep-code-runner/vue3 1.5.3 → 2.0.1

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.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import { defineComponent as ie, useCssVars as be, ref as N, computed as G, onMounted as pe, watch as le, openBlock as _, createElementBlock as R, normalizeClass as W, createElementVNode as E, withDirectives as Ee, createCommentVNode as U, Fragment as ve, renderList as ye, toDisplayString as H, vModelSelect as Ae, createTextVNode as Se, normalizeStyle as oe, createVNode as se, createBlock as ke, Teleport as we, Transition as Te, withCtx as Ie, normalizeProps as Fe, guardReactiveProps as _e, renderSlot as Re } from "vue";
2
- var xe = Object.defineProperty, Oe = (i, d, n) => d in i ? xe(i, d, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[d] = n, ce = (i, d, n) => Oe(i, typeof d != "symbol" ? d + "" : d, n);
3
- let ne = null;
4
- class Le {
5
- constructor(d = {}) {
6
- ce(this, "baseUrl"), ce(this, "timeout"), this.baseUrl = d.pistonUrl || "/api/piston", this.timeout = d.timeout || 3e3;
1
+ import { defineComponent as le, useCssVars as be, ref as N, computed as B, onMounted as ge, watch as ue, openBlock as x, createElementBlock as _, normalizeClass as z, createElementVNode as y, normalizeStyle as J, withDirectives as ve, createCommentVNode as U, Fragment as Ee, renderList as ye, toDisplayString as H, vModelSelect as Ae, createTextVNode as ke, createStaticVNode as Se, createVNode as ie, createBlock as we, Teleport as Te, Transition as xe, withCtx as _e, normalizeProps as Ie, guardReactiveProps as Fe, renderSlot as Re } from "vue";
2
+ var Le = Object.defineProperty, Ne = (i, g, n) => g in i ? Le(i, g, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[g] = n, de = (i, g, n) => Ne(i, typeof g != "symbol" ? g + "" : g, n);
3
+ let ae = null;
4
+ class Oe {
5
+ constructor(g = {}) {
6
+ de(this, "baseUrl"), de(this, "timeout"), this.baseUrl = g.pistonUrl || "/api/piston", this.timeout = g.timeout || 3e3;
7
7
  }
8
- async getRuntimes(d = !1) {
9
- if (ne && !d)
10
- return ne;
8
+ async getRuntimes(g = !1) {
9
+ if (ae && !g)
10
+ return ae;
11
11
  try {
12
12
  const n = await fetch(`${this.baseUrl}/runtimes`, {
13
13
  method: "GET",
@@ -18,26 +18,26 @@ class Le {
18
18
  if (!n.ok)
19
19
  throw new Error(`Failed to fetch runtimes: ${n.statusText}`);
20
20
  const l = await n.json();
21
- return ne = l, l;
21
+ return ae = l, l;
22
22
  } catch (n) {
23
23
  throw console.error("Failed to fetch runtimes:", n), n;
24
24
  }
25
25
  }
26
- async execute(d, n, l = {}) {
27
- const h = (await this.getRuntimes()).find(
28
- (f) => {
29
- var m;
30
- return f.language.toLowerCase() === d.toLowerCase() || ((m = f.aliases) == null ? void 0 : m.some((T) => T.toLowerCase() === d.toLowerCase()));
26
+ async execute(g, n, l = {}) {
27
+ const v = (await this.getRuntimes()).find(
28
+ (m) => {
29
+ var b;
30
+ return m.language.toLowerCase() === g.toLowerCase() || ((b = m.aliases) == null ? void 0 : b.some((I) => I.toLowerCase() === g.toLowerCase()));
31
31
  }
32
32
  );
33
- if (!h)
34
- throw new Error(`Language '${d}' is not supported`);
35
- const y = this.getFileName(d), A = {
36
- language: h.language,
37
- version: l.version || h.version,
33
+ if (!v)
34
+ throw new Error(`Language '${g}' is not supported`);
35
+ const T = this.getFileName(g), A = {
36
+ language: v.language,
37
+ version: l.version || v.version,
38
38
  files: [
39
39
  {
40
- name: y,
40
+ name: T,
41
41
  content: n
42
42
  }
43
43
  ],
@@ -45,41 +45,41 @@ class Le {
45
45
  args: l.args || [],
46
46
  run_timeout: l.runTimeout || this.timeout,
47
47
  compile_timeout: this.timeout
48
- }, o = Date.now();
48
+ }, s = Date.now();
49
49
  try {
50
- const f = await fetch(`${this.baseUrl}/execute`, {
50
+ const m = await fetch(`${this.baseUrl}/execute`, {
51
51
  method: "POST",
52
52
  headers: {
53
53
  "Content-Type": "application/json"
54
54
  },
55
55
  body: JSON.stringify(A)
56
56
  });
57
- if (!f.ok)
58
- throw new Error(`Execute failed: ${f.statusText}`);
59
- const m = await f.json(), T = Date.now() - o, L = m.run.stdout || "", I = m.run.stderr || "";
57
+ if (!m.ok)
58
+ throw new Error(`Execute failed: ${m.statusText}`);
59
+ const b = await m.json(), I = Date.now() - s, D = b.run.stdout || "", O = b.run.stderr || "";
60
60
  return {
61
- success: m.run.code === 0,
62
- output: L,
63
- stderr: I,
64
- code: m.run.code,
65
- executionTime: T,
66
- compile: m.compile ? {
67
- stdout: m.compile.stdout || "",
68
- stderr: m.compile.stderr || "",
69
- code: m.compile.code
61
+ success: b.run.code === 0,
62
+ output: D,
63
+ stderr: O,
64
+ code: b.run.code,
65
+ executionTime: I,
66
+ compile: b.compile ? {
67
+ stdout: b.compile.stdout || "",
68
+ stderr: b.compile.stderr || "",
69
+ code: b.compile.code
70
70
  } : void 0
71
71
  };
72
- } catch (f) {
72
+ } catch (m) {
73
73
  return {
74
74
  success: !1,
75
75
  output: "",
76
- stderr: f instanceof Error ? f.message : "Unknown error",
76
+ stderr: m instanceof Error ? m.message : "Unknown error",
77
77
  code: -1,
78
- executionTime: Date.now() - o
78
+ executionTime: Date.now() - s
79
79
  };
80
80
  }
81
81
  }
82
- getFileName(d) {
82
+ getFileName(g) {
83
83
  return {
84
84
  javascript: "main.js",
85
85
  typescript: "main.ts",
@@ -106,10 +106,10 @@ class Le {
106
106
  css: "style.css",
107
107
  sql: "query.sql",
108
108
  markdown: "readme.md"
109
- }[d.toLowerCase()] || `main.${d}`;
109
+ }[g.toLowerCase()] || `main.${g}`;
110
110
  }
111
111
  }
112
- const Ne = {
112
+ const Ce = {
113
113
  javascript: 'console.log("Hello, World!");',
114
114
  typescript: 'console.log("Hello, World!");',
115
115
  python: 'print("Hello, World!")',
@@ -207,18 +207,18 @@ h1 {
207
207
 
208
208
  This is a sample markdown document.`
209
209
  };
210
- function re(i) {
211
- const d = i.toLowerCase();
212
- return Ne[d] || `// ${i}
210
+ function oe(i) {
211
+ const g = i.toLowerCase();
212
+ return Ce[g] || `// ${i}
213
213
  // Write your code here`;
214
214
  }
215
- var de = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
216
- function Ce(i) {
215
+ var pe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
216
+ function De(i) {
217
217
  return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
218
218
  }
219
- var ge = { exports: {} };
219
+ var he = { exports: {} };
220
220
  (function(i) {
221
- var d = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
221
+ var g = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
222
222
  /**
223
223
  * Prism: Lightweight, robust, elegant syntax highlighting
224
224
  *
@@ -228,7 +228,7 @@ var ge = { exports: {} };
228
228
  * @public
229
229
  */
230
230
  var n = function(l) {
231
- var h = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, y = 0, A = {}, o = {
231
+ var v = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, T = 0, A = {}, s = {
232
232
  /**
233
233
  * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
234
234
  * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
@@ -284,7 +284,7 @@ var ge = { exports: {} };
284
284
  */
285
285
  util: {
286
286
  encode: function t(e) {
287
- return e instanceof f ? new f(e.type, t(e.content), e.alias) : Array.isArray(e) ? e.map(t) : e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
287
+ return e instanceof m ? new m(e.type, t(e.content), e.alias) : Array.isArray(e) ? e.map(t) : e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
288
288
  },
289
289
  /**
290
290
  * Returns the name of the type of the given value.
@@ -312,7 +312,7 @@ var ge = { exports: {} };
312
312
  * @returns {number}
313
313
  */
314
314
  objId: function(t) {
315
- return t.__id || Object.defineProperty(t, "__id", { value: ++y }), t.__id;
315
+ return t.__id || Object.defineProperty(t, "__id", { value: ++T }), t.__id;
316
316
  },
317
317
  /**
318
318
  * Creates a deep clone of the given object.
@@ -326,26 +326,26 @@ var ge = { exports: {} };
326
326
  */
327
327
  clone: function t(e, r) {
328
328
  r = r || {};
329
- var a, s;
330
- switch (o.util.type(e)) {
329
+ var o, a;
330
+ switch (s.util.type(e)) {
331
331
  case "Object":
332
- if (s = o.util.objId(e), r[s])
333
- return r[s];
334
- a = /** @type {Record<string, any>} */
335
- {}, r[s] = a;
332
+ if (a = s.util.objId(e), r[a])
333
+ return r[a];
334
+ o = /** @type {Record<string, any>} */
335
+ {}, r[a] = o;
336
336
  for (var c in e)
337
- e.hasOwnProperty(c) && (a[c] = t(e[c], r));
337
+ e.hasOwnProperty(c) && (o[c] = t(e[c], r));
338
338
  return (
339
339
  /** @type {any} */
340
- a
340
+ o
341
341
  );
342
342
  case "Array":
343
- return s = o.util.objId(e), r[s] ? r[s] : (a = [], r[s] = a, /** @type {Array} */
343
+ return a = s.util.objId(e), r[a] ? r[a] : (o = [], r[a] = o, /** @type {Array} */
344
344
  /** @type {any} */
345
- e.forEach(function(b, u) {
346
- a[u] = t(b, r);
345
+ e.forEach(function(E, u) {
346
+ o[u] = t(E, r);
347
347
  }), /** @type {any} */
348
- a);
348
+ o);
349
349
  default:
350
350
  return e;
351
351
  }
@@ -360,7 +360,7 @@ var ge = { exports: {} };
360
360
  */
361
361
  getLanguage: function(t) {
362
362
  for (; t; ) {
363
- var e = h.exec(t.className);
363
+ var e = v.exec(t.className);
364
364
  if (e)
365
365
  return e[1].toLowerCase();
366
366
  t = t.parentElement;
@@ -375,7 +375,7 @@ var ge = { exports: {} };
375
375
  * @returns {void}
376
376
  */
377
377
  setLanguage: function(t, e) {
378
- t.className = t.className.replace(RegExp(h, "gi"), ""), t.classList.add("language-" + e);
378
+ t.className = t.className.replace(RegExp(v, "gi"), ""), t.classList.add("language-" + e);
379
379
  },
380
380
  /**
381
381
  * Returns the script element that is currently executing.
@@ -394,8 +394,8 @@ var ge = { exports: {} };
394
394
  );
395
395
  try {
396
396
  throw new Error();
397
- } catch (a) {
398
- var t = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(a.stack) || [])[1];
397
+ } catch (o) {
398
+ var t = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(o.stack) || [])[1];
399
399
  if (t) {
400
400
  var e = document.getElementsByTagName("script");
401
401
  for (var r in e)
@@ -425,11 +425,11 @@ var ge = { exports: {} };
425
425
  * @returns {boolean}
426
426
  */
427
427
  isActive: function(t, e, r) {
428
- for (var a = "no-" + e; t; ) {
429
- var s = t.classList;
430
- if (s.contains(e))
428
+ for (var o = "no-" + e; t; ) {
429
+ var a = t.classList;
430
+ if (a.contains(e))
431
431
  return !0;
432
- if (s.contains(a))
432
+ if (a.contains(o))
433
433
  return !1;
434
434
  t = t.parentElement;
435
435
  }
@@ -480,9 +480,9 @@ var ge = { exports: {} };
480
480
  * });
481
481
  */
482
482
  extend: function(t, e) {
483
- var r = o.util.clone(o.languages[t]);
484
- for (var a in e)
485
- r[a] = e[a];
483
+ var r = s.util.clone(s.languages[t]);
484
+ for (var o in e)
485
+ r[o] = e[o];
486
486
  return r;
487
487
  },
488
488
  /**
@@ -560,31 +560,31 @@ var ge = { exports: {} };
560
560
  * @returns {Grammar} The new grammar object.
561
561
  * @public
562
562
  */
563
- insertBefore: function(t, e, r, a) {
564
- a = a || /** @type {any} */
565
- o.languages;
566
- var s = a[t], c = {};
567
- for (var b in s)
568
- if (s.hasOwnProperty(b)) {
569
- if (b == e)
563
+ insertBefore: function(t, e, r, o) {
564
+ o = o || /** @type {any} */
565
+ s.languages;
566
+ var a = o[t], c = {};
567
+ for (var E in a)
568
+ if (a.hasOwnProperty(E)) {
569
+ if (E == e)
570
570
  for (var u in r)
571
571
  r.hasOwnProperty(u) && (c[u] = r[u]);
572
- r.hasOwnProperty(b) || (c[b] = s[b]);
572
+ r.hasOwnProperty(E) || (c[E] = a[E]);
573
573
  }
574
- var k = a[t];
575
- return a[t] = c, o.languages.DFS(o.languages, function(F, P) {
576
- P === k && F != t && (this[F] = c);
574
+ var S = o[t];
575
+ return o[t] = c, s.languages.DFS(s.languages, function(R, M) {
576
+ M === S && R != t && (this[R] = c);
577
577
  }), c;
578
578
  },
579
579
  // Traverse a language definition with Depth First Search
580
- DFS: function t(e, r, a, s) {
581
- s = s || {};
582
- var c = o.util.objId;
583
- for (var b in e)
584
- if (e.hasOwnProperty(b)) {
585
- r.call(e, b, e[b], a || b);
586
- var u = e[b], k = o.util.type(u);
587
- k === "Object" && !s[c(u)] ? (s[c(u)] = !0, t(u, r, null, s)) : k === "Array" && !s[c(u)] && (s[c(u)] = !0, t(u, r, b, s));
580
+ DFS: function t(e, r, o, a) {
581
+ a = a || {};
582
+ var c = s.util.objId;
583
+ for (var E in e)
584
+ if (e.hasOwnProperty(E)) {
585
+ r.call(e, E, e[E], o || E);
586
+ var u = e[E], S = s.util.type(u);
587
+ S === "Object" && !a[c(u)] ? (a[c(u)] = !0, t(u, r, null, a)) : S === "Array" && !a[c(u)] && (a[c(u)] = !0, t(u, r, E, a));
588
588
  }
589
589
  }
590
590
  },
@@ -602,7 +602,7 @@ var ge = { exports: {} };
602
602
  * @public
603
603
  */
604
604
  highlightAll: function(t, e) {
605
- o.highlightAllUnder(document, t, e);
605
+ s.highlightAllUnder(document, t, e);
606
606
  },
607
607
  /**
608
608
  * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
@@ -620,14 +620,14 @@ var ge = { exports: {} };
620
620
  * @public
621
621
  */
622
622
  highlightAllUnder: function(t, e, r) {
623
- var a = {
623
+ var o = {
624
624
  callback: r,
625
625
  container: t,
626
626
  selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
627
627
  };
628
- o.hooks.run("before-highlightall", a), a.elements = Array.prototype.slice.apply(a.container.querySelectorAll(a.selector)), o.hooks.run("before-all-elements-highlight", a);
629
- for (var s = 0, c; c = a.elements[s++]; )
630
- o.highlightElement(c, e === !0, a.callback);
628
+ s.hooks.run("before-highlightall", o), o.elements = Array.prototype.slice.apply(o.container.querySelectorAll(o.selector)), s.hooks.run("before-all-elements-highlight", o);
629
+ for (var a = 0, c; c = o.elements[a++]; )
630
+ s.highlightElement(c, e === !0, o.callback);
631
631
  },
632
632
  /**
633
633
  * Highlights the code inside a single element.
@@ -658,38 +658,38 @@ var ge = { exports: {} };
658
658
  * @public
659
659
  */
660
660
  highlightElement: function(t, e, r) {
661
- var a = o.util.getLanguage(t), s = o.languages[a];
662
- o.util.setLanguage(t, a);
661
+ var o = s.util.getLanguage(t), a = s.languages[o];
662
+ s.util.setLanguage(t, o);
663
663
  var c = t.parentElement;
664
- c && c.nodeName.toLowerCase() === "pre" && o.util.setLanguage(c, a);
665
- var b = t.textContent, u = {
664
+ c && c.nodeName.toLowerCase() === "pre" && s.util.setLanguage(c, o);
665
+ var E = t.textContent, u = {
666
666
  element: t,
667
- language: a,
668
- grammar: s,
669
- code: b
667
+ language: o,
668
+ grammar: a,
669
+ code: E
670
670
  };
671
- function k(P) {
672
- u.highlightedCode = P, o.hooks.run("before-insert", u), u.element.innerHTML = u.highlightedCode, o.hooks.run("after-highlight", u), o.hooks.run("complete", u), r && r.call(u.element);
671
+ function S(M) {
672
+ u.highlightedCode = M, s.hooks.run("before-insert", u), u.element.innerHTML = u.highlightedCode, s.hooks.run("after-highlight", u), s.hooks.run("complete", u), r && r.call(u.element);
673
673
  }
674
- if (o.hooks.run("before-sanity-check", u), c = u.element.parentElement, c && c.nodeName.toLowerCase() === "pre" && !c.hasAttribute("tabindex") && c.setAttribute("tabindex", "0"), !u.code) {
675
- o.hooks.run("complete", u), r && r.call(u.element);
674
+ if (s.hooks.run("before-sanity-check", u), c = u.element.parentElement, c && c.nodeName.toLowerCase() === "pre" && !c.hasAttribute("tabindex") && c.setAttribute("tabindex", "0"), !u.code) {
675
+ s.hooks.run("complete", u), r && r.call(u.element);
676
676
  return;
677
677
  }
678
- if (o.hooks.run("before-highlight", u), !u.grammar) {
679
- k(o.util.encode(u.code));
678
+ if (s.hooks.run("before-highlight", u), !u.grammar) {
679
+ S(s.util.encode(u.code));
680
680
  return;
681
681
  }
682
682
  if (e && l.Worker) {
683
- var F = new Worker(o.filename);
684
- F.onmessage = function(P) {
685
- k(P.data);
686
- }, F.postMessage(JSON.stringify({
683
+ var R = new Worker(s.filename);
684
+ R.onmessage = function(M) {
685
+ S(M.data);
686
+ }, R.postMessage(JSON.stringify({
687
687
  language: u.language,
688
688
  code: u.code,
689
689
  immediateClose: !0
690
690
  }));
691
691
  } else
692
- k(o.highlight(u.code, u.grammar, u.language));
692
+ S(s.highlight(u.code, u.grammar, u.language));
693
693
  },
694
694
  /**
695
695
  * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
@@ -712,14 +712,14 @@ var ge = { exports: {} };
712
712
  * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
713
713
  */
714
714
  highlight: function(t, e, r) {
715
- var a = {
715
+ var o = {
716
716
  code: t,
717
717
  grammar: e,
718
718
  language: r
719
719
  };
720
- if (o.hooks.run("before-tokenize", a), !a.grammar)
721
- throw new Error('The language "' + a.language + '" has no grammar.');
722
- return a.tokens = o.tokenize(a.code, a.grammar), o.hooks.run("after-tokenize", a), f.stringify(o.util.encode(a.tokens), a.language);
720
+ if (s.hooks.run("before-tokenize", o), !o.grammar)
721
+ throw new Error('The language "' + o.language + '" has no grammar.');
722
+ return o.tokens = s.tokenize(o.code, o.grammar), s.hooks.run("after-tokenize", o), m.stringify(s.util.encode(o.tokens), o.language);
723
723
  },
724
724
  /**
725
725
  * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
@@ -748,12 +748,12 @@ var ge = { exports: {} };
748
748
  tokenize: function(t, e) {
749
749
  var r = e.rest;
750
750
  if (r) {
751
- for (var a in r)
752
- e[a] = r[a];
751
+ for (var o in r)
752
+ e[o] = r[o];
753
753
  delete e.rest;
754
754
  }
755
- var s = new L();
756
- return I(s, s.head, t), T(t, s, e, s.head, 0), D(s);
755
+ var a = new D();
756
+ return O(a, a.head, t), I(t, a, e, a.head, 0), P(a);
757
757
  },
758
758
  /**
759
759
  * @namespace
@@ -775,7 +775,7 @@ var ge = { exports: {} };
775
775
  * @public
776
776
  */
777
777
  add: function(t, e) {
778
- var r = o.hooks.all;
778
+ var r = s.hooks.all;
779
779
  r[t] = r[t] || [], r[t].push(e);
780
780
  },
781
781
  /**
@@ -788,28 +788,28 @@ var ge = { exports: {} };
788
788
  * @public
789
789
  */
790
790
  run: function(t, e) {
791
- var r = o.hooks.all[t];
791
+ var r = s.hooks.all[t];
792
792
  if (!(!r || !r.length))
793
- for (var a = 0, s; s = r[a++]; )
794
- s(e);
793
+ for (var o = 0, a; a = r[o++]; )
794
+ a(e);
795
795
  }
796
796
  },
797
- Token: f
797
+ Token: m
798
798
  };
799
- l.Prism = o;
800
- function f(t, e, r, a) {
801
- this.type = t, this.content = e, this.alias = r, this.length = (a || "").length | 0;
799
+ l.Prism = s;
800
+ function m(t, e, r, o) {
801
+ this.type = t, this.content = e, this.alias = r, this.length = (o || "").length | 0;
802
802
  }
803
- f.stringify = function t(e, r) {
803
+ m.stringify = function t(e, r) {
804
804
  if (typeof e == "string")
805
805
  return e;
806
806
  if (Array.isArray(e)) {
807
- var a = "";
808
- return e.forEach(function(k) {
809
- a += t(k, r);
810
- }), a;
807
+ var o = "";
808
+ return e.forEach(function(S) {
809
+ o += t(S, r);
810
+ }), o;
811
811
  }
812
- var s = {
812
+ var a = {
813
813
  type: e.type,
814
814
  content: t(e.content, r),
815
815
  tag: "span",
@@ -817,105 +817,105 @@ var ge = { exports: {} };
817
817
  attributes: {},
818
818
  language: r
819
819
  }, c = e.alias;
820
- c && (Array.isArray(c) ? Array.prototype.push.apply(s.classes, c) : s.classes.push(c)), o.hooks.run("wrap", s);
821
- var b = "";
822
- for (var u in s.attributes)
823
- b += " " + u + '="' + (s.attributes[u] || "").replace(/"/g, "&quot;") + '"';
824
- return "<" + s.tag + ' class="' + s.classes.join(" ") + '"' + b + ">" + s.content + "</" + s.tag + ">";
820
+ c && (Array.isArray(c) ? Array.prototype.push.apply(a.classes, c) : a.classes.push(c)), s.hooks.run("wrap", a);
821
+ var E = "";
822
+ for (var u in a.attributes)
823
+ E += " " + u + '="' + (a.attributes[u] || "").replace(/"/g, "&quot;") + '"';
824
+ return "<" + a.tag + ' class="' + a.classes.join(" ") + '"' + E + ">" + a.content + "</" + a.tag + ">";
825
825
  };
826
- function m(t, e, r, a) {
826
+ function b(t, e, r, o) {
827
827
  t.lastIndex = e;
828
- var s = t.exec(r);
829
- if (s && a && s[1]) {
830
- var c = s[1].length;
831
- s.index += c, s[0] = s[0].slice(c);
828
+ var a = t.exec(r);
829
+ if (a && o && a[1]) {
830
+ var c = a[1].length;
831
+ a.index += c, a[0] = a[0].slice(c);
832
832
  }
833
- return s;
833
+ return a;
834
834
  }
835
- function T(t, e, r, a, s, c) {
836
- for (var b in r)
837
- if (!(!r.hasOwnProperty(b) || !r[b])) {
838
- var u = r[b];
835
+ function I(t, e, r, o, a, c) {
836
+ for (var E in r)
837
+ if (!(!r.hasOwnProperty(E) || !r[E])) {
838
+ var u = r[E];
839
839
  u = Array.isArray(u) ? u : [u];
840
- for (var k = 0; k < u.length; ++k) {
841
- if (c && c.cause == b + "," + k)
840
+ for (var S = 0; S < u.length; ++S) {
841
+ if (c && c.cause == E + "," + S)
842
842
  return;
843
- var F = u[k], P = F.inside, V = !!F.lookbehind, v = !!F.greedy, w = F.alias;
844
- if (v && !F.pattern.global) {
845
- var x = F.pattern.toString().match(/[imsuy]*$/)[0];
846
- F.pattern = RegExp(F.pattern.source, x + "g");
843
+ var R = u[S], M = R.inside, Y = !!R.lookbehind, j = !!R.greedy, ee = R.alias;
844
+ if (j && !R.pattern.global) {
845
+ var X = R.pattern.toString().match(/[imsuy]*$/)[0];
846
+ R.pattern = RegExp(R.pattern.source, X + "g");
847
847
  }
848
- for (var Y = F.pattern || F, O = a.next, M = s; O !== e.tail && !(c && M >= c.reach); M += O.value.length, O = O.next) {
849
- var z = O.value;
848
+ for (var W = R.pattern || R, L = o.next, d = a; L !== e.tail && !(c && d >= c.reach); d += L.value.length, L = L.next) {
849
+ var h = L.value;
850
850
  if (e.length > t.length)
851
851
  return;
852
- if (!(z instanceof f)) {
853
- var X = 1, $;
854
- if (v) {
855
- if ($ = m(Y, M, t, V), !$ || $.index >= t.length)
852
+ if (!(h instanceof m)) {
853
+ var w = 1, F;
854
+ if (j) {
855
+ if (F = b(W, d, t, Y), !F || F.index >= t.length)
856
856
  break;
857
- var Z = $.index, fe = $.index + $[0].length, B = M;
858
- for (B += O.value.length; Z >= B; )
859
- O = O.next, B += O.value.length;
860
- if (B -= O.value.length, M = B, O.value instanceof f)
857
+ var Z = F.index, V = F.index + F[0].length, $ = d;
858
+ for ($ += L.value.length; Z >= $; )
859
+ L = L.next, $ += L.value.length;
860
+ if ($ -= L.value.length, d = $, L.value instanceof m)
861
861
  continue;
862
- for (var j = O; j !== e.tail && (B < fe || typeof j.value == "string"); j = j.next)
863
- X++, B += j.value.length;
864
- X--, z = t.slice(M, B), $.index -= M;
865
- } else if ($ = m(Y, 0, z, V), !$)
862
+ for (var G = L; G !== e.tail && ($ < V || typeof G.value == "string"); G = G.next)
863
+ w++, $ += G.value.length;
864
+ w--, h = t.slice(d, $), F.index -= d;
865
+ } else if (F = b(W, 0, h, Y), !F)
866
866
  continue;
867
- var Z = $.index, K = $[0], Q = z.slice(0, Z), ue = z.slice(Z + K.length), ee = M + z.length;
868
- c && ee > c.reach && (c.reach = ee);
869
- var q = O.prev;
870
- Q && (q = I(e, q, Q), M += Q.length), C(e, q, X);
871
- var me = new f(b, P ? o.tokenize(K, P) : K, w, K);
872
- if (O = I(e, q, me), ue && I(e, O, ue), X > 1) {
873
- var te = {
874
- cause: b + "," + k,
875
- reach: ee
867
+ var Z = F.index, K = F[0], te = h.slice(0, Z), ce = h.slice(Z + K.length), ne = d + h.length;
868
+ c && ne > c.reach && (c.reach = ne);
869
+ var q = L.prev;
870
+ te && (q = O(e, q, te), d += te.length), C(e, q, w);
871
+ var me = new m(E, M ? s.tokenize(K, M) : K, ee, K);
872
+ if (L = O(e, q, me), ce && O(e, L, ce), w > 1) {
873
+ var re = {
874
+ cause: E + "," + S,
875
+ reach: ne
876
876
  };
877
- T(t, e, r, O.prev, M, te), c && te.reach > c.reach && (c.reach = te.reach);
877
+ I(t, e, r, L.prev, d, re), c && re.reach > c.reach && (c.reach = re.reach);
878
878
  }
879
879
  }
880
880
  }
881
881
  }
882
882
  }
883
883
  }
884
- function L() {
884
+ function D() {
885
885
  var t = { value: null, prev: null, next: null }, e = { value: null, prev: t, next: null };
886
886
  t.next = e, this.head = t, this.tail = e, this.length = 0;
887
887
  }
888
- function I(t, e, r) {
889
- var a = e.next, s = { value: r, prev: e, next: a };
890
- return e.next = s, a.prev = s, t.length++, s;
888
+ function O(t, e, r) {
889
+ var o = e.next, a = { value: r, prev: e, next: o };
890
+ return e.next = a, o.prev = a, t.length++, a;
891
891
  }
892
892
  function C(t, e, r) {
893
- for (var a = e.next, s = 0; s < r && a !== t.tail; s++)
894
- a = a.next;
895
- e.next = a, a.prev = e, t.length -= s;
893
+ for (var o = e.next, a = 0; a < r && o !== t.tail; a++)
894
+ o = o.next;
895
+ e.next = o, o.prev = e, t.length -= a;
896
896
  }
897
- function D(t) {
897
+ function P(t) {
898
898
  for (var e = [], r = t.head.next; r !== t.tail; )
899
899
  e.push(r.value), r = r.next;
900
900
  return e;
901
901
  }
902
902
  if (!l.document)
903
- return l.addEventListener && (o.disableWorkerMessageHandler || l.addEventListener("message", function(t) {
904
- var e = JSON.parse(t.data), r = e.language, a = e.code, s = e.immediateClose;
905
- l.postMessage(o.highlight(a, o.languages[r], r)), s && l.close();
906
- }, !1)), o;
907
- var g = o.util.currentScript();
908
- g && (o.filename = g.src, g.hasAttribute("data-manual") && (o.manual = !0));
903
+ return l.addEventListener && (s.disableWorkerMessageHandler || l.addEventListener("message", function(t) {
904
+ var e = JSON.parse(t.data), r = e.language, o = e.code, a = e.immediateClose;
905
+ l.postMessage(s.highlight(o, s.languages[r], r)), a && l.close();
906
+ }, !1)), s;
907
+ var f = s.util.currentScript();
908
+ f && (s.filename = f.src, f.hasAttribute("data-manual") && (s.manual = !0));
909
909
  function p() {
910
- o.manual || o.highlightAll();
910
+ s.manual || s.highlightAll();
911
911
  }
912
- if (!o.manual) {
913
- var S = document.readyState;
914
- S === "loading" || S === "interactive" && g && g.defer ? document.addEventListener("DOMContentLoaded", p) : window.requestAnimationFrame ? window.requestAnimationFrame(p) : window.setTimeout(p, 16);
912
+ if (!s.manual) {
913
+ var k = document.readyState;
914
+ k === "loading" || k === "interactive" && f && f.defer ? document.addEventListener("DOMContentLoaded", p) : window.requestAnimationFrame ? window.requestAnimationFrame(p) : window.setTimeout(p, 16);
915
915
  }
916
- return o;
917
- }(d);
918
- i.exports && (i.exports = n), typeof de < "u" && (de.Prism = n), n.languages.markup = {
916
+ return s;
917
+ }(g);
918
+ i.exports && (i.exports = n), typeof pe < "u" && (pe.Prism = n), n.languages.markup = {
919
919
  comment: {
920
920
  pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
921
921
  greedy: !0
@@ -1006,32 +1006,32 @@ var ge = { exports: {} };
1006
1006
  * @example
1007
1007
  * addInlined('style', 'css');
1008
1008
  */
1009
- value: function(h, y) {
1009
+ value: function(v, T) {
1010
1010
  var A = {};
1011
- A["language-" + y] = {
1011
+ A["language-" + T] = {
1012
1012
  pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1013
1013
  lookbehind: !0,
1014
- inside: n.languages[y]
1014
+ inside: n.languages[T]
1015
1015
  }, A.cdata = /^<!\[CDATA\[|\]\]>$/i;
1016
- var o = {
1016
+ var s = {
1017
1017
  "included-cdata": {
1018
1018
  pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1019
1019
  inside: A
1020
1020
  }
1021
1021
  };
1022
- o["language-" + y] = {
1022
+ s["language-" + T] = {
1023
1023
  pattern: /[\s\S]+/,
1024
- inside: n.languages[y]
1024
+ inside: n.languages[T]
1025
1025
  };
1026
- var f = {};
1027
- f[h] = {
1026
+ var m = {};
1027
+ m[v] = {
1028
1028
  pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
1029
- return h;
1029
+ return v;
1030
1030
  }), "i"),
1031
1031
  lookbehind: !0,
1032
1032
  greedy: !0,
1033
- inside: o
1034
- }, n.languages.insertBefore("markup", "cdata", f);
1033
+ inside: s
1034
+ }, n.languages.insertBefore("markup", "cdata", m);
1035
1035
  }
1036
1036
  }), Object.defineProperty(n.languages.markup.tag, "addAttribute", {
1037
1037
  /**
@@ -1045,7 +1045,7 @@ var ge = { exports: {} };
1045
1045
  * @example
1046
1046
  * addAttribute('style', 'css');
1047
1047
  */
1048
- value: function(l, h) {
1048
+ value: function(l, v) {
1049
1049
  n.languages.markup.tag.inside["special-attr"].push({
1050
1050
  pattern: RegExp(
1051
1051
  /(^|["'\s])/.source + "(?:" + l + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
@@ -1060,8 +1060,8 @@ var ge = { exports: {} };
1060
1060
  value: {
1061
1061
  pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1062
1062
  lookbehind: !0,
1063
- alias: [h, "language-" + h],
1064
- inside: n.languages[h]
1063
+ alias: [v, "language-" + v],
1064
+ inside: n.languages[v]
1065
1065
  },
1066
1066
  punctuation: [
1067
1067
  {
@@ -1076,11 +1076,11 @@ var ge = { exports: {} };
1076
1076
  });
1077
1077
  }
1078
1078
  }), n.languages.html = n.languages.markup, n.languages.mathml = n.languages.markup, n.languages.svg = n.languages.markup, n.languages.xml = n.languages.extend("markup", {}), n.languages.ssml = n.languages.xml, n.languages.atom = n.languages.xml, n.languages.rss = n.languages.xml, function(l) {
1079
- var h = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1079
+ var v = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1080
1080
  l.languages.css = {
1081
1081
  comment: /\/\*[\s\S]*?\*\//,
1082
1082
  atrule: {
1083
- pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + h.source + ")*?" + /(?:;|(?=\s*\{))/.source),
1083
+ pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + v.source + ")*?" + /(?:;|(?=\s*\{))/.source),
1084
1084
  inside: {
1085
1085
  rule: /^@[\w-]+/,
1086
1086
  "selector-function-argument": {
@@ -1097,23 +1097,23 @@ var ge = { exports: {} };
1097
1097
  },
1098
1098
  url: {
1099
1099
  // https://drafts.csswg.org/css-values-3/#urls
1100
- pattern: RegExp("\\burl\\((?:" + h.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
1100
+ pattern: RegExp("\\burl\\((?:" + v.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
1101
1101
  greedy: !0,
1102
1102
  inside: {
1103
1103
  function: /^url/i,
1104
1104
  punctuation: /^\(|\)$/,
1105
1105
  string: {
1106
- pattern: RegExp("^" + h.source + "$"),
1106
+ pattern: RegExp("^" + v.source + "$"),
1107
1107
  alias: "url"
1108
1108
  }
1109
1109
  }
1110
1110
  },
1111
1111
  selector: {
1112
- pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + h.source + ")*(?=\\s*\\{)"),
1112
+ pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + v.source + ")*(?=\\s*\\{)"),
1113
1113
  lookbehind: !0
1114
1114
  },
1115
1115
  string: {
1116
- pattern: h,
1116
+ pattern: v,
1117
1117
  greedy: !0
1118
1118
  },
1119
1119
  property: {
@@ -1127,8 +1127,8 @@ var ge = { exports: {} };
1127
1127
  },
1128
1128
  punctuation: /[(){};:,]/
1129
1129
  }, l.languages.css.atrule.inside.rest = l.languages.css;
1130
- var y = l.languages.markup;
1131
- y && (y.tag.addInlined("style", "css"), y.tag.addAttribute("style", "css"));
1130
+ var T = l.languages.markup;
1131
+ T && (T.tag.addInlined("style", "css"), T.tag.addAttribute("style", "css"));
1132
1132
  }(n), n.languages.clike = {
1133
1133
  comment: [
1134
1134
  {
@@ -1293,9 +1293,9 @@ var ge = { exports: {} };
1293
1293
  if (typeof n > "u" || typeof document > "u")
1294
1294
  return;
1295
1295
  Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
1296
- var l = "Loading…", h = function(g, p) {
1297
- return "✖ Error " + g + " while fetching file: " + p;
1298
- }, y = "✖ Error: File does not exist or is empty", A = {
1296
+ var l = "Loading…", v = function(f, p) {
1297
+ return "✖ Error " + f + " while fetching file: " + p;
1298
+ }, T = "✖ Error: File does not exist or is empty", A = {
1299
1299
  js: "javascript",
1300
1300
  py: "python",
1301
1301
  rb: "ruby",
@@ -1305,52 +1305,52 @@ var ge = { exports: {} };
1305
1305
  bat: "batch",
1306
1306
  h: "c",
1307
1307
  tex: "latex"
1308
- }, o = "data-src-status", f = "loading", m = "loaded", T = "failed", L = "pre[data-src]:not([" + o + '="' + m + '"]):not([' + o + '="' + f + '"])';
1309
- function I(g, p, S) {
1308
+ }, s = "data-src-status", m = "loading", b = "loaded", I = "failed", D = "pre[data-src]:not([" + s + '="' + b + '"]):not([' + s + '="' + m + '"])';
1309
+ function O(f, p, k) {
1310
1310
  var t = new XMLHttpRequest();
1311
- t.open("GET", g, !0), t.onreadystatechange = function() {
1312
- t.readyState == 4 && (t.status < 400 && t.responseText ? p(t.responseText) : t.status >= 400 ? S(h(t.status, t.statusText)) : S(y));
1311
+ t.open("GET", f, !0), t.onreadystatechange = function() {
1312
+ t.readyState == 4 && (t.status < 400 && t.responseText ? p(t.responseText) : t.status >= 400 ? k(v(t.status, t.statusText)) : k(T));
1313
1313
  }, t.send(null);
1314
1314
  }
1315
- function C(g) {
1316
- var p = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g || "");
1315
+ function C(f) {
1316
+ var p = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(f || "");
1317
1317
  if (p) {
1318
- var S = Number(p[1]), t = p[2], e = p[3];
1319
- return t ? e ? [S, Number(e)] : [S, void 0] : [S, S];
1318
+ var k = Number(p[1]), t = p[2], e = p[3];
1319
+ return t ? e ? [k, Number(e)] : [k, void 0] : [k, k];
1320
1320
  }
1321
1321
  }
1322
- n.hooks.add("before-highlightall", function(g) {
1323
- g.selector += ", " + L;
1324
- }), n.hooks.add("before-sanity-check", function(g) {
1322
+ n.hooks.add("before-highlightall", function(f) {
1323
+ f.selector += ", " + D;
1324
+ }), n.hooks.add("before-sanity-check", function(f) {
1325
1325
  var p = (
1326
1326
  /** @type {HTMLPreElement} */
1327
- g.element
1327
+ f.element
1328
1328
  );
1329
- if (p.matches(L)) {
1330
- g.code = "", p.setAttribute(o, f);
1331
- var S = p.appendChild(document.createElement("CODE"));
1332
- S.textContent = l;
1333
- var t = p.getAttribute("data-src"), e = g.language;
1329
+ if (p.matches(D)) {
1330
+ f.code = "", p.setAttribute(s, m);
1331
+ var k = p.appendChild(document.createElement("CODE"));
1332
+ k.textContent = l;
1333
+ var t = p.getAttribute("data-src"), e = f.language;
1334
1334
  if (e === "none") {
1335
1335
  var r = (/\.(\w+)$/.exec(t) || [, "none"])[1];
1336
1336
  e = A[r] || r;
1337
1337
  }
1338
- n.util.setLanguage(S, e), n.util.setLanguage(p, e);
1339
- var a = n.plugins.autoloader;
1340
- a && a.loadLanguages(e), I(
1338
+ n.util.setLanguage(k, e), n.util.setLanguage(p, e);
1339
+ var o = n.plugins.autoloader;
1340
+ o && o.loadLanguages(e), O(
1341
1341
  t,
1342
- function(s) {
1343
- p.setAttribute(o, m);
1342
+ function(a) {
1343
+ p.setAttribute(s, b);
1344
1344
  var c = C(p.getAttribute("data-range"));
1345
1345
  if (c) {
1346
- var b = s.split(/\r\n?|\n/g), u = c[0], k = c[1] == null ? b.length : c[1];
1347
- u < 0 && (u += b.length), u = Math.max(0, Math.min(u - 1, b.length)), k < 0 && (k += b.length), k = Math.max(0, Math.min(k, b.length)), s = b.slice(u, k).join(`
1346
+ var E = a.split(/\r\n?|\n/g), u = c[0], S = c[1] == null ? E.length : c[1];
1347
+ u < 0 && (u += E.length), u = Math.max(0, Math.min(u - 1, E.length)), S < 0 && (S += E.length), S = Math.max(0, Math.min(S, E.length)), a = E.slice(u, S).join(`
1348
1348
  `), p.hasAttribute("data-start") || p.setAttribute("data-start", String(u + 1));
1349
1349
  }
1350
- S.textContent = s, n.highlightElement(S);
1350
+ k.textContent = a, n.highlightElement(k);
1351
1351
  },
1352
- function(s) {
1353
- p.setAttribute(o, T), S.textContent = s;
1352
+ function(a) {
1353
+ p.setAttribute(s, I), k.textContent = a;
1354
1354
  }
1355
1355
  );
1356
1356
  }
@@ -1363,18 +1363,18 @@ var ge = { exports: {} };
1363
1363
  * @param {ParentNode} [container=document]
1364
1364
  */
1365
1365
  highlight: function(p) {
1366
- for (var S = (p || document).querySelectorAll(L), t = 0, e; e = S[t++]; )
1366
+ for (var k = (p || document).querySelectorAll(D), t = 0, e; e = k[t++]; )
1367
1367
  n.highlightElement(e);
1368
1368
  }
1369
1369
  };
1370
- var D = !1;
1370
+ var P = !1;
1371
1371
  n.fileHighlight = function() {
1372
- D || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), D = !0), n.plugins.fileHighlight.highlight.apply(this, arguments);
1372
+ P || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), P = !0), n.plugins.fileHighlight.highlight.apply(this, arguments);
1373
1373
  };
1374
1374
  }();
1375
- })(ge);
1376
- var De = ge.exports;
1377
- const ae = /* @__PURE__ */ Ce(De);
1375
+ })(he);
1376
+ var Pe = he.exports;
1377
+ const se = /* @__PURE__ */ De(Pe);
1378
1378
  Prism.languages.clike = {
1379
1379
  comment: [
1380
1380
  {
@@ -1633,7 +1633,7 @@ Prism.languages.insertBefore("go", "string", {
1633
1633
  });
1634
1634
  delete Prism.languages.go["class-name"];
1635
1635
  (function(i) {
1636
- var d = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, n = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, l = {
1636
+ var g = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, n = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, l = {
1637
1637
  pattern: RegExp(/(^|[^\w.])/.source + n + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
1638
1638
  lookbehind: !0,
1639
1639
  inside: {
@@ -1669,7 +1669,7 @@ delete Prism.languages.go["class-name"];
1669
1669
  inside: l.inside
1670
1670
  }
1671
1671
  ],
1672
- keyword: d,
1672
+ keyword: g,
1673
1673
  function: [
1674
1674
  i.languages.clike.function,
1675
1675
  {
@@ -1704,7 +1704,7 @@ delete Prism.languages.go["class-name"];
1704
1704
  pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
1705
1705
  inside: {
1706
1706
  "class-name": l,
1707
- keyword: d,
1707
+ keyword: g,
1708
1708
  punctuation: /[<>(),.:]/,
1709
1709
  operator: /[?&|]/
1710
1710
  }
@@ -1736,7 +1736,7 @@ delete Prism.languages.go["class-name"];
1736
1736
  namespace: {
1737
1737
  pattern: RegExp(
1738
1738
  /(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g, function() {
1739
- return d.source;
1739
+ return g.source;
1740
1740
  })
1741
1741
  ),
1742
1742
  lookbehind: !0,
@@ -1823,16 +1823,16 @@ Prism.languages.insertBefore("c", "function", {
1823
1823
  });
1824
1824
  delete Prism.languages.c.boolean;
1825
1825
  (function(i) {
1826
- for (var d = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, n = 0; n < 2; n++)
1827
- d = d.replace(/<self>/g, function() {
1828
- return d;
1826
+ for (var g = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, n = 0; n < 2; n++)
1827
+ g = g.replace(/<self>/g, function() {
1828
+ return g;
1829
1829
  });
1830
- d = d.replace(/<self>/g, function() {
1830
+ g = g.replace(/<self>/g, function() {
1831
1831
  return /[^\s\S]/.source;
1832
1832
  }), i.languages.rust = {
1833
1833
  comment: [
1834
1834
  {
1835
- pattern: RegExp(/(^|[^\\])/.source + d),
1835
+ pattern: RegExp(/(^|[^\\])/.source + g),
1836
1836
  lookbehind: !0,
1837
1837
  greedy: !0
1838
1838
  },
@@ -1972,7 +1972,7 @@ Prism.languages.sql = {
1972
1972
  punctuation: /[;[\]()`,.]/
1973
1973
  };
1974
1974
  (function(i) {
1975
- var d = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", n = {
1975
+ var g = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", n = {
1976
1976
  pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
1977
1977
  lookbehind: !0,
1978
1978
  alias: "punctuation",
@@ -1982,7 +1982,7 @@ Prism.languages.sql = {
1982
1982
  }, l = {
1983
1983
  bash: n,
1984
1984
  environment: {
1985
- pattern: RegExp("\\$" + d),
1985
+ pattern: RegExp("\\$" + g),
1986
1986
  alias: "constant"
1987
1987
  },
1988
1988
  variable: [
@@ -2022,7 +2022,7 @@ Prism.languages.sql = {
2022
2022
  operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
2023
2023
  punctuation: /[\[\]]/,
2024
2024
  environment: {
2025
- pattern: RegExp("(\\{)" + d),
2025
+ pattern: RegExp("(\\{)" + g),
2026
2026
  lookbehind: !0,
2027
2027
  alias: "constant"
2028
2028
  }
@@ -2071,7 +2071,7 @@ Prism.languages.sql = {
2071
2071
  pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
2072
2072
  inside: {
2073
2073
  environment: {
2074
- pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + d),
2074
+ pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + g),
2075
2075
  lookbehind: !0,
2076
2076
  alias: "constant"
2077
2077
  }
@@ -2127,7 +2127,7 @@ Prism.languages.sql = {
2127
2127
  }
2128
2128
  ],
2129
2129
  environment: {
2130
- pattern: RegExp("\\$?" + d),
2130
+ pattern: RegExp("\\$?" + g),
2131
2131
  alias: "constant"
2132
2132
  },
2133
2133
  variable: l.variable,
@@ -2170,7 +2170,7 @@ Prism.languages.sql = {
2170
2170
  lookbehind: !0
2171
2171
  }
2172
2172
  }, n.inside = i.languages.bash;
2173
- for (var h = [
2173
+ for (var v = [
2174
2174
  "comment",
2175
2175
  "function-name",
2176
2176
  "for-or-select",
@@ -2186,8 +2186,8 @@ Prism.languages.sql = {
2186
2186
  "operator",
2187
2187
  "punctuation",
2188
2188
  "number"
2189
- ], y = l.variable[1].inside, A = 0; A < h.length; A++)
2190
- y[h[A]] = i.languages.bash[h[A]];
2189
+ ], T = l.variable[1].inside, A = 0; A < v.length; A++)
2190
+ T[v[A]] = i.languages.bash[v[A]];
2191
2191
  i.languages.sh = i.languages.bash, i.languages.shell = i.languages.bash;
2192
2192
  })(Prism);
2193
2193
  Prism.languages.json = {
@@ -2215,7 +2215,7 @@ Prism.languages.json = {
2215
2215
  }
2216
2216
  };
2217
2217
  Prism.languages.webmanifest = Prism.languages.json;
2218
- const Pe = `
2218
+ const $e = `
2219
2219
  /* 默认代码颜色 */
2220
2220
  .hep-cr-editor .hep-cr-highlight code,
2221
2221
  .hep-cr-editor .hep-cr-highlight pre {
@@ -2301,7 +2301,7 @@ const Pe = `
2301
2301
  .hep-cr-editor .token.console {
2302
2302
  color: #f8f8f2 !important;
2303
2303
  }
2304
- `, $e = `
2304
+ `, Me = `
2305
2305
  /* 默认代码颜色 */
2306
2306
  .hep-cr-editor .hep-cr-highlight code,
2307
2307
  .hep-cr-editor .hep-cr-highlight pre {
@@ -2378,7 +2378,7 @@ const Pe = `
2378
2378
  .hep-cr-editor .token.console {
2379
2379
  color: #333 !important;
2380
2380
  }
2381
- `, Me = ["innerHTML"], Ue = ["value", "disabled"], He = /* @__PURE__ */ ie({
2381
+ `, Ue = ["innerHTML"], Be = ["value", "disabled"], He = /* @__PURE__ */ le({
2382
2382
  __name: "CodeEditor",
2383
2383
  props: {
2384
2384
  modelValue: {},
@@ -2387,18 +2387,18 @@ const Pe = `
2387
2387
  disabled: { type: Boolean, default: !1 }
2388
2388
  },
2389
2389
  emits: ["update:modelValue"],
2390
- setup(i, { emit: d }) {
2391
- be((g) => ({
2392
- v6d72dafb: m.value
2393
- })), typeof window < "u" && (window.Prism = ae);
2394
- function n(g) {
2390
+ setup(i, { emit: g }) {
2391
+ be((f) => ({
2392
+ v6d72dafb: b.value
2393
+ })), typeof window < "u" && (window.Prism = se);
2394
+ function n(f) {
2395
2395
  if (typeof document > "u") return;
2396
- const p = "hep-cr-prism-styles", S = document.getElementById(p), t = g === "dark" ? Pe : $e;
2397
- S && S.remove();
2396
+ const p = "hep-cr-prism-styles", k = document.getElementById(p), t = f === "dark" ? $e : Me;
2397
+ k && k.remove();
2398
2398
  const e = document.createElement("style");
2399
2399
  e.id = p, e.textContent = t, document.head.appendChild(e);
2400
2400
  }
2401
- const l = i, h = d, y = N(null), A = N(null), o = {
2401
+ const l = i, v = g, T = N(null), A = N(null), s = {
2402
2402
  javascript: "javascript",
2403
2403
  js: "javascript",
2404
2404
  typescript: "typescript",
@@ -2429,91 +2429,130 @@ const Pe = `
2429
2429
  yml: "yaml",
2430
2430
  markdown: "markdown",
2431
2431
  md: "markdown"
2432
- }, f = G(() => o[l.language.toLowerCase()] || "javascript"), m = G(() => l.theme === "dark" ? "#1e1e1e" : "#fafafa"), T = G(() => {
2432
+ }, m = B(() => s[l.language.toLowerCase()] || "javascript"), b = B(() => l.theme === "dark" ? "#1e1e1e" : "#fafafa"), I = B(() => {
2433
2433
  try {
2434
- const g = ae.languages[f.value];
2435
- if (g)
2436
- return ae.highlight(l.modelValue || "", g, f.value);
2434
+ const f = se.languages[m.value];
2435
+ if (f)
2436
+ return se.highlight(l.modelValue || "", f, m.value);
2437
2437
  } catch {
2438
2438
  }
2439
- return L(l.modelValue || "");
2439
+ return D(l.modelValue || "");
2440
2440
  });
2441
- function L(g) {
2441
+ function D(f) {
2442
2442
  const p = document.createElement("div");
2443
- return p.textContent = g, p.innerHTML;
2443
+ return p.textContent = f, p.innerHTML;
2444
2444
  }
2445
- function I(g) {
2446
- const p = g.target;
2447
- h("update:modelValue", p.value);
2445
+ function O(f) {
2446
+ const p = f.target;
2447
+ v("update:modelValue", p.value);
2448
2448
  }
2449
2449
  function C() {
2450
- y.value && A.value && (A.value.scrollTop = y.value.scrollTop, A.value.scrollLeft = y.value.scrollLeft);
2450
+ T.value && A.value && (A.value.scrollTop = T.value.scrollTop, A.value.scrollLeft = T.value.scrollLeft);
2451
2451
  }
2452
- function D(g) {
2453
- if (g.key === "Tab") {
2454
- g.preventDefault();
2455
- const p = g.target, S = p.selectionStart, t = p.selectionEnd, e = p.value;
2456
- p.value = e.substring(0, S) + " " + e.substring(t), p.selectionStart = p.selectionEnd = S + 2, h("update:modelValue", p.value);
2452
+ function P(f) {
2453
+ if (f.key === "Tab") {
2454
+ f.preventDefault();
2455
+ const p = f.target, k = p.selectionStart, t = p.selectionEnd, e = p.value;
2456
+ p.value = e.substring(0, k) + " " + e.substring(t), p.selectionStart = p.selectionEnd = k + 2, v("update:modelValue", p.value);
2457
2457
  }
2458
2458
  }
2459
- return pe(() => {
2459
+ return ge(() => {
2460
2460
  n(l.theme);
2461
- }), le(() => l.theme, (g) => {
2462
- n(g);
2463
- }), (g, p) => (_(), R("div", {
2464
- class: W(["hep-cr-editor", `hep-cr-theme-${i.theme}`])
2461
+ }), ue(() => l.theme, (f) => {
2462
+ n(f);
2463
+ }), (f, p) => (x(), _("div", {
2464
+ class: z(["hep-cr-editor", `hep-cr-theme-${i.theme}`])
2465
2465
  }, [
2466
- E("pre", {
2466
+ y("pre", {
2467
2467
  ref_key: "highlightRef",
2468
2468
  ref: A,
2469
- class: W(["hep-cr-highlight", [`language-${f.value}`, `hep-cr-prism-${i.theme}`]]),
2469
+ class: z(["hep-cr-highlight", [`language-${m.value}`, `hep-cr-prism-${i.theme}`]]),
2470
2470
  "aria-hidden": "true"
2471
2471
  }, [
2472
- E("code", { innerHTML: T.value }, null, 8, Me)
2472
+ y("code", { innerHTML: I.value }, null, 8, Ue)
2473
2473
  ], 2),
2474
- E("textarea", {
2474
+ y("textarea", {
2475
2475
  ref_key: "codeRef",
2476
- ref: y,
2476
+ ref: T,
2477
2477
  class: "hep-cr-input",
2478
2478
  value: i.modelValue,
2479
2479
  disabled: i.disabled,
2480
- onInput: I,
2480
+ onInput: O,
2481
2481
  onScroll: C,
2482
- onKeydown: D,
2482
+ onKeydown: P,
2483
2483
  spellcheck: "false",
2484
2484
  placeholder: "Write your code here..."
2485
- }, null, 40, Ue)
2485
+ }, null, 40, Be)
2486
2486
  ], 2));
2487
2487
  }
2488
- }), he = (i, d) => {
2488
+ }), fe = (i, g) => {
2489
2489
  const n = i.__vccOpts || i;
2490
- for (const [l, h] of d)
2491
- n[l] = h;
2490
+ for (const [l, v] of g)
2491
+ n[l] = v;
2492
2492
  return n;
2493
- }, Be = /* @__PURE__ */ he(He, [["__scopeId", "data-v-bf752fa5"]]), Ge = { class: "hep-cr-header" }, ze = { class: "hep-cr-controls" }, je = ["disabled"], We = {
2493
+ }, Ge = /* @__PURE__ */ fe(He, [["__scopeId", "data-v-bf752fa5"]]), ze = { class: "hep-cr-header" }, je = { class: "hep-cr-controls" }, We = ["disabled"], Ve = {
2494
2494
  key: 0,
2495
2495
  value: ""
2496
- }, Ve = ["value"], Ye = { class: "hep-cr-actions" }, Xe = ["disabled"], Ze = {
2496
+ }, Ye = ["value"], Xe = { class: "hep-cr-actions" }, Ze = ["disabled"], Ke = {
2497
2497
  key: 0,
2498
2498
  class: "hep-cr-spinner"
2499
- }, Ke = {
2499
+ }, qe = {
2500
2500
  key: 1,
2501
2501
  class: "hep-cr-run-icon"
2502
- }, qe = ["title"], Je = {
2502
+ }, Je = ["title"], Qe = {
2503
+ key: 0,
2504
+ width: "16",
2505
+ height: "16",
2506
+ viewBox: "0 0 24 24",
2507
+ fill: "none",
2508
+ stroke: "currentColor",
2509
+ "stroke-width": "2"
2510
+ }, et = {
2511
+ key: 1,
2512
+ width: "16",
2513
+ height: "16",
2514
+ viewBox: "0 0 24 24",
2515
+ fill: "none",
2516
+ stroke: "currentColor",
2517
+ "stroke-width": "2"
2518
+ }, tt = {
2503
2519
  key: 0,
2504
2520
  class: "hep-cr-error"
2505
- }, Qe = { class: "hep-cr-main" }, et = { class: "hep-cr-panel-header" }, tt = { class: "hep-cr-language-badge" }, nt = { class: "hep-cr-panel-header" }, rt = { class: "hep-cr-output-tabs" }, at = { class: "hep-cr-output-actions" }, ot = {
2521
+ }, nt = { class: "hep-cr-main" }, rt = { class: "hep-cr-panel-header" }, at = { class: "hep-cr-output-actions" }, ot = { class: "hep-cr-language-badge" }, st = ["disabled", "title"], it = {
2522
+ key: 0,
2523
+ width: "14",
2524
+ height: "14",
2525
+ viewBox: "0 0 24 24",
2526
+ fill: "none",
2527
+ stroke: "currentColor",
2528
+ "stroke-width": "2"
2529
+ }, lt = {
2530
+ key: 1,
2531
+ class: "hep-cr-copied-text"
2532
+ }, ut = { class: "hep-cr-panel-header" }, ct = { class: "hep-cr-output-tabs" }, dt = { class: "hep-cr-output-actions" }, pt = {
2506
2533
  key: 0,
2507
2534
  class: "hep-cr-execution-time"
2508
- }, st = { class: "hep-cr-output-content" }, it = { key: 0 }, lt = {
2535
+ }, gt = ["disabled", "title"], ht = {
2536
+ key: 0,
2537
+ width: "14",
2538
+ height: "14",
2539
+ viewBox: "0 0 24 24",
2540
+ fill: "none",
2541
+ stroke: "currentColor",
2542
+ "stroke-width": "2"
2543
+ }, ft = {
2544
+ key: 1,
2545
+ class: "hep-cr-copied-text"
2546
+ }, mt = { class: "hep-cr-output-content" }, bt = { key: 0 }, vt = {
2509
2547
  key: 1,
2510
2548
  class: "hep-cr-stderr"
2511
- }, ut = /* @__PURE__ */ ie({
2549
+ }, Et = /* @__PURE__ */ le({
2512
2550
  __name: "CodeRunner",
2513
2551
  props: {
2514
2552
  pistonUrl: { default: "/api/piston" },
2515
2553
  language: { default: "javascript" },
2516
2554
  theme: { default: "light" },
2555
+ themeColor: { default: "" },
2517
2556
  showLanguageSelector: { type: Boolean, default: !0 },
2518
2557
  showEditor: { type: Boolean, default: !0 },
2519
2558
  editable: { type: Boolean, default: !0 },
@@ -2521,221 +2560,249 @@ const Pe = `
2521
2560
  executorLabel: { default: "运行" }
2522
2561
  },
2523
2562
  emits: ["execute-start", "execute-end", "language-change"],
2524
- setup(i, { emit: d }) {
2525
- const n = i, l = d, h = N([]), y = N(n.language), A = N(n.theme), o = N(""), f = N(""), m = N(""), T = N(!1), L = N(null), I = N("stdout"), C = N(null), D = N(!1), g = N(60);
2526
- function p() {
2527
- A.value = A.value === "light" ? "dark" : "light";
2563
+ setup(i, { emit: g }) {
2564
+ const n = i, l = B(() => {
2565
+ if (!n.themeColor) return {};
2566
+ const d = n.theme === "dark", h = n.themeColor, F = v(h) ? "#000" : "#fff";
2567
+ return {
2568
+ "--hep-cr-theme-color": h,
2569
+ "--hep-cr-theme-color-hover": d ? T(h, 20) : T(h, -20),
2570
+ "--hep-cr-tab-active-color": F
2571
+ };
2572
+ });
2573
+ function v(d) {
2574
+ const h = parseInt(d.replace("#", ""), 16), w = h >> 16 & 255, F = h >> 8 & 255, V = h & 255;
2575
+ return (0.299 * w + 0.587 * F + 0.114 * V) / 255 > 0.5;
2576
+ }
2577
+ function T(d, h) {
2578
+ const w = parseInt(d.replace("#", ""), 16), F = Math.round(2.55 * h), V = Math.min(255, Math.max(0, (w >> 16) + F)), $ = Math.min(255, Math.max(0, (w >> 8 & 255) + F)), G = Math.min(255, Math.max(0, (w & 255) + F));
2579
+ return "#" + (16777216 + V * 65536 + $ * 256 + G).toString(16).slice(1);
2580
+ }
2581
+ const A = g, s = N([]), m = N(n.language), b = N(n.theme), I = N(""), D = N(""), O = N(""), C = N(!1), P = N(null), f = N("stdout"), p = N(null), k = N(!1), t = N(60);
2582
+ function e() {
2583
+ b.value = b.value === "light" ? "dark" : "light";
2528
2584
  }
2529
- const S = G(
2530
- () => new Le({ pistonUrl: n.pistonUrl })
2531
- ), t = G(() => h.value.map((v) => ({
2532
- value: `${v.language}:${v.version}`,
2533
- label: `${v.language.charAt(0).toUpperCase() + v.language.slice(1)} ${v.version}`
2534
- }))), e = G(() => {
2535
- const v = y.value;
2536
- return v.includes(":") ? v.split(":")[0] : v;
2585
+ const r = B(
2586
+ () => new Oe({ pistonUrl: n.pistonUrl })
2587
+ ), o = B(() => s.value.map((d) => ({
2588
+ value: `${d.language}:${d.version}`,
2589
+ label: `${d.language.charAt(0).toUpperCase() + d.language.slice(1)} ${d.version}`
2590
+ }))), a = B(() => {
2591
+ const d = m.value;
2592
+ return d.includes(":") ? d.split(":")[0] : d;
2537
2593
  });
2538
- async function r() {
2539
- D.value = !0, C.value = null;
2594
+ async function c() {
2595
+ k.value = !0, p.value = null;
2540
2596
  try {
2541
- h.value = await S.value.getRuntimes();
2542
- } catch (v) {
2543
- C.value = v instanceof Error ? v.message : "Failed to load runtimes";
2597
+ s.value = await r.value.getRuntimes();
2598
+ const d = m.value.split(":")[0], h = s.value.find((w) => w.language === d);
2599
+ h && !m.value.includes(":") && (m.value = `${d}:${h.version}`);
2600
+ } catch (d) {
2601
+ p.value = d instanceof Error ? d.message : "Failed to load runtimes";
2544
2602
  } finally {
2545
- D.value = !1;
2603
+ k.value = !1;
2546
2604
  }
2547
2605
  }
2548
- le(y, (v) => {
2549
- const w = v.includes(":") ? v.split(":")[0] : v, x = re(w);
2550
- o.value = x, l("language-change", w, x);
2606
+ ue(m, (d) => {
2607
+ const h = d.includes(":") ? d.split(":")[0] : d, w = oe(h);
2608
+ I.value = w, A("language-change", h, w);
2551
2609
  });
2552
- async function a() {
2553
- if (!T.value) {
2554
- T.value = !0, f.value = "", m.value = "", L.value = null, C.value = null, I.value = "stdout", l("execute-start");
2610
+ async function E() {
2611
+ if (!C.value) {
2612
+ C.value = !0, D.value = "", O.value = "", P.value = null, p.value = null, f.value = "stdout", A("execute-start");
2555
2613
  try {
2556
- const v = await S.value.execute(e.value, o.value);
2557
- f.value = v.output, m.value = v.stderr, L.value = v.executionTime || null, I.value = v.stderr ? "stderr" : "stdout", l("execute-end", v);
2558
- } catch (v) {
2559
- C.value = v instanceof Error ? v.message : "Execution failed", l("execute-end", {
2614
+ const d = await r.value.execute(a.value, I.value);
2615
+ D.value = d.output, O.value = d.stderr, P.value = d.executionTime || null, f.value = d.stderr ? "stderr" : "stdout", A("execute-end", d);
2616
+ } catch (d) {
2617
+ p.value = d instanceof Error ? d.message : "Execution failed", A("execute-end", {
2560
2618
  success: !1,
2561
2619
  output: "",
2562
- stderr: C.value,
2620
+ stderr: p.value,
2563
2621
  code: -1
2564
2622
  });
2565
2623
  } finally {
2566
- T.value = !1;
2624
+ C.value = !1;
2567
2625
  }
2568
2626
  }
2569
2627
  }
2570
- function s() {
2571
- f.value = "", m.value = "", L.value = null, C.value = null;
2628
+ const u = N(!1), S = N(!1);
2629
+ async function R() {
2630
+ await navigator.clipboard.writeText(I.value), u.value = !0, setTimeout(() => {
2631
+ u.value = !1;
2632
+ }, 2e3);
2572
2633
  }
2573
- async function c() {
2574
- const v = I.value === "stdout" ? f.value : m.value;
2575
- await navigator.clipboard.writeText(v);
2634
+ async function M() {
2635
+ const d = f.value === "stdout" ? D.value : O.value;
2636
+ await navigator.clipboard.writeText(d), S.value = !0, setTimeout(() => {
2637
+ S.value = !1;
2638
+ }, 2e3);
2576
2639
  }
2577
- function b() {
2578
- o.value = re(e.value);
2640
+ function Y() {
2641
+ I.value = oe(a.value);
2579
2642
  }
2580
- let u = !1;
2581
- function k(v) {
2582
- u = !0, document.addEventListener("mousemove", F), document.addEventListener("mouseup", P), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
2643
+ let j = !1;
2644
+ function ee(d) {
2645
+ j = !0, document.addEventListener("mousemove", X), document.addEventListener("mouseup", W), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
2583
2646
  }
2584
- function F(v) {
2585
- if (!u) return;
2586
- const w = document.querySelector(
2647
+ function X(d) {
2648
+ if (!j) return;
2649
+ const h = document.querySelector(
2587
2650
  ".hep-cr-main"
2588
2651
  );
2589
- if (!w) return;
2590
- const x = w.getBoundingClientRect(), Y = (v.clientX - x.left) / x.width * 100;
2591
- g.value = Math.max(20, Math.min(80, Y));
2652
+ if (!h) return;
2653
+ const w = h.getBoundingClientRect(), F = (d.clientX - w.left) / w.width * 100;
2654
+ t.value = Math.max(20, Math.min(80, F));
2592
2655
  }
2593
- function P() {
2594
- u = !1, document.removeEventListener("mousemove", F), document.removeEventListener("mouseup", P), document.body.style.cursor = "", document.body.style.userSelect = "";
2656
+ function W() {
2657
+ j = !1, document.removeEventListener("mousemove", X), document.removeEventListener("mouseup", W), document.body.style.cursor = "", document.body.style.userSelect = "";
2595
2658
  }
2596
- pe(async () => {
2597
- await r(), o.value || (o.value = n.defaultCode || re(y.value));
2659
+ ge(async () => {
2660
+ await c(), I.value || (I.value = n.defaultCode || oe(m.value));
2598
2661
  });
2599
- const V = G(() => `hep-cr-runner-${A.value}`);
2600
- return (v, w) => (_(), R("div", {
2601
- class: W(["hep-cr-runner", V.value])
2662
+ const L = B(() => `hep-cr-runner-${b.value}`);
2663
+ return (d, h) => (x(), _("div", {
2664
+ class: z(["hep-cr-runner", L.value]),
2665
+ style: J(l.value)
2602
2666
  }, [
2603
- E("div", Ge, [
2604
- E("div", ze, [
2605
- i.showLanguageSelector ? Ee((_(), R("select", {
2667
+ y("div", ze, [
2668
+ y("div", je, [
2669
+ i.showLanguageSelector ? ve((x(), _("select", {
2606
2670
  key: 0,
2607
- "onUpdate:modelValue": w[0] || (w[0] = (x) => y.value = x),
2671
+ "onUpdate:modelValue": h[0] || (h[0] = (w) => m.value = w),
2608
2672
  class: "hep-cr-language-select",
2609
- disabled: T.value
2673
+ disabled: C.value
2610
2674
  }, [
2611
- D.value ? (_(), R("option", We, "加载中...")) : U("", !0),
2612
- (_(!0), R(ve, null, ye(t.value, (x) => (_(), R("option", {
2613
- key: x.value,
2614
- value: x.value
2615
- }, H(x.label), 9, Ve))), 128))
2616
- ], 8, je)), [
2617
- [Ae, y.value]
2675
+ k.value ? (x(), _("option", Ve, "加载中...")) : U("", !0),
2676
+ (x(!0), _(Ee, null, ye(o.value, (w) => (x(), _("option", {
2677
+ key: w.value,
2678
+ value: w.value
2679
+ }, H(w.label), 9, Ye))), 128))
2680
+ ], 8, We)), [
2681
+ [Ae, m.value]
2618
2682
  ]) : U("", !0)
2619
2683
  ]),
2620
- E("div", Ye, [
2621
- E("button", {
2684
+ y("div", Xe, [
2685
+ y("button", {
2622
2686
  class: "hep-cr-btn hep-cr-btn-run",
2623
- disabled: T.value || D.value,
2624
- onClick: a
2687
+ disabled: C.value || k.value,
2688
+ onClick: E
2625
2689
  }, [
2626
- T.value ? (_(), R("span", Ze)) : (_(), R("span", Ke, "▶")),
2627
- Se(" " + H(T.value ? "运行中..." : i.executorLabel), 1)
2628
- ], 8, Xe),
2629
- i.showEditor && i.editable ? (_(), R("button", {
2690
+ C.value ? (x(), _("span", Ke)) : (x(), _("span", qe, "▶")),
2691
+ ke(" " + H(C.value ? "运行中..." : i.executorLabel), 1)
2692
+ ], 8, Ze),
2693
+ i.showEditor && i.editable ? (x(), _("button", {
2630
2694
  key: 0,
2631
2695
  class: "hep-cr-btn hep-cr-btn-reset",
2632
- onClick: b
2696
+ onClick: Y
2633
2697
  }, " 重置 ")) : U("", !0),
2634
- E("button", {
2698
+ y("button", {
2635
2699
  class: "hep-cr-btn hep-cr-btn-theme",
2636
- onClick: p,
2637
- title: A.value === "light" ? "Switch to dark mode" : "Switch to light mode"
2638
- }, H(A.value === "light" ? "🌙" : "☀️"), 9, qe)
2700
+ onClick: e,
2701
+ title: b.value === "light" ? "Switch to dark mode" : "Switch to light mode"
2702
+ }, [
2703
+ b.value === "light" ? (x(), _("svg", Qe, [...h[4] || (h[4] = [
2704
+ y("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)
2705
+ ])])) : (x(), _("svg", et, [...h[5] || (h[5] = [
2706
+ Se('<circle cx="12" cy="12" r="5" data-v-6f81b71d></circle><line x1="12" y1="1" x2="12" y2="3" data-v-6f81b71d></line><line x1="12" y1="21" x2="12" y2="23" data-v-6f81b71d></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64" data-v-6f81b71d></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78" data-v-6f81b71d></line><line x1="1" y1="12" x2="3" y2="12" data-v-6f81b71d></line><line x1="21" y1="12" x2="23" y2="12" data-v-6f81b71d></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36" data-v-6f81b71d></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22" data-v-6f81b71d></line>', 9)
2707
+ ])]))
2708
+ ], 8, Je)
2639
2709
  ])
2640
2710
  ]),
2641
- C.value ? (_(), R("div", Je, H(C.value), 1)) : U("", !0),
2642
- E("div", Qe, [
2643
- i.showEditor ? (_(), R("div", {
2711
+ p.value ? (x(), _("div", tt, H(p.value), 1)) : U("", !0),
2712
+ y("div", nt, [
2713
+ i.showEditor ? (x(), _("div", {
2644
2714
  key: 0,
2645
2715
  class: "hep-cr-editor-panel",
2646
- style: oe({ width: g.value + "%" })
2716
+ style: J({ width: t.value + "%" })
2647
2717
  }, [
2648
- E("div", et, [
2649
- w[4] || (w[4] = E("span", { class: "hep-cr-panel-title" }, "编辑器", -1)),
2650
- E("span", tt, H(e.value), 1)
2718
+ y("div", rt, [
2719
+ h[7] || (h[7] = y("span", { class: "hep-cr-panel-title" }, "编辑器", -1)),
2720
+ y("div", at, [
2721
+ y("span", ot, H(a.value), 1),
2722
+ y("button", {
2723
+ class: z(["hep-cr-btn-icon", { "hep-cr-btn-copied": u.value }]),
2724
+ disabled: u.value,
2725
+ onClick: R,
2726
+ title: u.value ? "已复制" : "复制"
2727
+ }, [
2728
+ u.value ? (x(), _("span", lt, "已复制")) : (x(), _("svg", it, [...h[6] || (h[6] = [
2729
+ y("rect", {
2730
+ x: "9",
2731
+ y: "9",
2732
+ width: "13",
2733
+ height: "13",
2734
+ rx: "2",
2735
+ ry: "2"
2736
+ }, null, -1),
2737
+ y("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
2738
+ ])]))
2739
+ ], 10, st)
2740
+ ])
2651
2741
  ]),
2652
- se(Be, {
2653
- modelValue: o.value,
2654
- "onUpdate:modelValue": w[1] || (w[1] = (x) => o.value = x),
2655
- language: e.value,
2656
- theme: A.value,
2657
- disabled: !i.editable || T.value
2742
+ ie(Ge, {
2743
+ modelValue: I.value,
2744
+ "onUpdate:modelValue": h[1] || (h[1] = (w) => I.value = w),
2745
+ language: a.value,
2746
+ theme: b.value,
2747
+ disabled: !i.editable || C.value
2658
2748
  }, null, 8, ["modelValue", "language", "theme", "disabled"])
2659
2749
  ], 4)) : U("", !0),
2660
- i.showEditor ? (_(), R("div", {
2750
+ i.showEditor ? (x(), _("div", {
2661
2751
  key: 1,
2662
2752
  class: "hep-cr-resize-handle",
2663
- onMousedown: k
2664
- }, [...w[5] || (w[5] = [
2665
- E("div", { class: "hep-cr-resize-line" }, null, -1)
2753
+ onMousedown: ee
2754
+ }, [...h[8] || (h[8] = [
2755
+ y("div", { class: "hep-cr-resize-line" }, null, -1)
2666
2756
  ])], 32)) : U("", !0),
2667
- E("div", {
2757
+ y("div", {
2668
2758
  class: "hep-cr-output-panel",
2669
- style: oe({ width: i.showEditor ? 100 - g.value + "%" : "100%" })
2759
+ style: J({ width: i.showEditor ? 100 - t.value + "%" : "100%" })
2670
2760
  }, [
2671
- E("div", nt, [
2672
- E("div", rt, [
2673
- E("button", {
2674
- class: W(["hep-cr-tab", { active: I.value === "stdout" }]),
2675
- onClick: w[2] || (w[2] = (x) => I.value = "stdout")
2761
+ y("div", ut, [
2762
+ y("div", ct, [
2763
+ y("button", {
2764
+ class: z(["hep-cr-tab", { active: f.value === "stdout" }]),
2765
+ onClick: h[2] || (h[2] = (w) => f.value = "stdout")
2676
2766
  }, " 输出 ", 2),
2677
- m.value ? (_(), R("button", {
2767
+ O.value ? (x(), _("button", {
2678
2768
  key: 0,
2679
- class: W(["hep-cr-tab", { active: I.value === "stderr" }]),
2680
- onClick: w[3] || (w[3] = (x) => I.value = "stderr")
2769
+ class: z(["hep-cr-tab", "hep-cr-tab-error", { active: f.value === "stderr" }]),
2770
+ onClick: h[3] || (h[3] = (w) => f.value = "stderr")
2681
2771
  }, " 错误 ", 2)) : U("", !0)
2682
2772
  ]),
2683
- E("div", at, [
2684
- L.value !== null ? (_(), R("span", ot, H(L.value) + "ms ", 1)) : U("", !0),
2685
- E("button", {
2686
- class: "hep-cr-btn-icon",
2687
- onClick: c,
2688
- title: "复制"
2689
- }, [...w[6] || (w[6] = [
2690
- E("svg", {
2691
- width: "14",
2692
- height: "14",
2693
- viewBox: "0 0 24 24",
2694
- fill: "none",
2695
- stroke: "currentColor",
2696
- "stroke-width": "2"
2697
- }, [
2698
- E("rect", {
2773
+ y("div", dt, [
2774
+ P.value !== null ? (x(), _("span", pt, H(P.value) + "ms ", 1)) : U("", !0),
2775
+ y("button", {
2776
+ class: z(["hep-cr-btn-icon", { "hep-cr-btn-copied": S.value }]),
2777
+ disabled: S.value,
2778
+ onClick: M,
2779
+ title: S.value ? "已复制" : "复制"
2780
+ }, [
2781
+ S.value ? (x(), _("span", ft, "已复制")) : (x(), _("svg", ht, [...h[9] || (h[9] = [
2782
+ y("rect", {
2699
2783
  x: "9",
2700
2784
  y: "9",
2701
2785
  width: "13",
2702
2786
  height: "13",
2703
2787
  rx: "2",
2704
2788
  ry: "2"
2705
- }),
2706
- E("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
2707
- ], -1)
2708
- ])]),
2709
- E("button", {
2710
- class: "hep-cr-btn-icon",
2711
- onClick: s,
2712
- title: "清除"
2713
- }, [...w[7] || (w[7] = [
2714
- E("svg", {
2715
- width: "14",
2716
- height: "14",
2717
- viewBox: "0 0 24 24",
2718
- fill: "none",
2719
- stroke: "currentColor",
2720
- "stroke-width": "2"
2721
- }, [
2722
- E("polyline", { points: "3 6 5 6 21 6" }),
2723
- E("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
2724
- ], -1)
2725
- ])])
2789
+ }, null, -1),
2790
+ y("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
2791
+ ])]))
2792
+ ], 10, gt)
2726
2793
  ])
2727
2794
  ]),
2728
- E("div", st, [
2729
- I.value === "stdout" ? (_(), R("pre", it, H(f.value || '点击"运行"执行代码'), 1)) : (_(), R("pre", lt, H(m.value), 1))
2795
+ y("div", mt, [
2796
+ f.value === "stdout" ? (x(), _("pre", bt, H(C.value ? "代码执行中..." : D.value || '点击"运行"执行代码'), 1)) : (x(), _("pre", vt, H(O.value), 1))
2730
2797
  ])
2731
2798
  ], 4)
2732
2799
  ])
2733
- ], 2));
2800
+ ], 6));
2734
2801
  }
2735
- }), J = /* @__PURE__ */ he(ut, [["__scopeId", "data-v-f4bf7f21"]]), ct = { class: "hep-cr-dialog-header" }, dt = { class: "hep-cr-dialog-title" }, pt = { class: "hep-cr-dialog-body" }, gt = {
2802
+ }), Q = /* @__PURE__ */ fe(Et, [["__scopeId", "data-v-6f81b71d"]]), yt = { class: "hep-cr-dialog-header" }, At = { class: "hep-cr-dialog-title" }, kt = { class: "hep-cr-dialog-body" }, St = {
2736
2803
  key: 0,
2737
2804
  class: "hep-cr-dialog-footer"
2738
- }, ft = /* @__PURE__ */ ie({
2805
+ }, Tt = /* @__PURE__ */ le({
2739
2806
  __name: "CodeRunnerDialog",
2740
2807
  props: {
2741
2808
  modelValue: { type: Boolean, default: !1 },
@@ -2751,41 +2818,41 @@ const Pe = `
2751
2818
  executorLabel: { default: "运行" }
2752
2819
  },
2753
2820
  emits: ["update:modelValue", "close"],
2754
- setup(i, { expose: d, emit: n }) {
2755
- const l = i, h = n, y = N(l.modelValue), A = G(() => l.modelValue !== void 0 ? l.modelValue : y.value);
2756
- le(
2821
+ setup(i, { expose: g, emit: n }) {
2822
+ const l = i, v = n, T = N(l.modelValue), A = B(() => l.modelValue !== void 0 ? l.modelValue : T.value);
2823
+ ue(
2757
2824
  () => l.modelValue,
2758
- (m) => {
2759
- m !== void 0 && (y.value = m);
2825
+ (b) => {
2826
+ b !== void 0 && (T.value = b);
2760
2827
  }
2761
2828
  );
2762
- function o() {
2763
- y.value = !1, h("update:modelValue", !1), h("close");
2829
+ function s() {
2830
+ T.value = !1, v("update:modelValue", !1), v("close");
2764
2831
  }
2765
- function f(m) {
2766
- m.target === m.currentTarget && o();
2832
+ function m(b) {
2833
+ b.target === b.currentTarget && s();
2767
2834
  }
2768
- return d({
2769
- close: o
2770
- }), (m, T) => (_(), ke(we, { to: "body" }, [
2771
- se(Te, { name: "hep-cr-dialog-fade" }, {
2772
- default: Ie(() => [
2773
- A.value ? (_(), R("div", {
2835
+ return g({
2836
+ close: s
2837
+ }), (b, I) => (x(), we(Te, { to: "body" }, [
2838
+ ie(xe, { name: "hep-cr-dialog-fade" }, {
2839
+ default: _e(() => [
2840
+ A.value ? (x(), _("div", {
2774
2841
  key: 0,
2775
2842
  class: "hep-cr-dialog-overlay",
2776
- onClick: f
2843
+ onClick: m
2777
2844
  }, [
2778
- E("div", {
2845
+ y("div", {
2779
2846
  class: "hep-cr-dialog-container",
2780
- style: oe({ width: typeof i.width == "number" ? i.width + "px" : i.width })
2847
+ style: J({ width: typeof i.width == "number" ? i.width + "px" : i.width })
2781
2848
  }, [
2782
- E("div", ct, [
2783
- E("h3", dt, H(i.title), 1),
2784
- E("button", {
2849
+ y("div", yt, [
2850
+ y("h3", At, H(i.title), 1),
2851
+ y("button", {
2785
2852
  class: "hep-cr-dialog-close",
2786
- onClick: o
2787
- }, [...T[0] || (T[0] = [
2788
- E("svg", {
2853
+ onClick: s
2854
+ }, [...I[0] || (I[0] = [
2855
+ y("svg", {
2789
2856
  width: "16",
2790
2857
  height: "16",
2791
2858
  viewBox: "0 0 24 24",
@@ -2793,13 +2860,13 @@ const Pe = `
2793
2860
  stroke: "currentColor",
2794
2861
  "stroke-width": "2"
2795
2862
  }, [
2796
- E("line", {
2863
+ y("line", {
2797
2864
  x1: "18",
2798
2865
  y1: "6",
2799
2866
  x2: "6",
2800
2867
  y2: "18"
2801
2868
  }),
2802
- E("line", {
2869
+ y("line", {
2803
2870
  x1: "6",
2804
2871
  y1: "6",
2805
2872
  x2: "18",
@@ -2808,11 +2875,11 @@ const Pe = `
2808
2875
  ], -1)
2809
2876
  ])])
2810
2877
  ]),
2811
- E("div", pt, [
2812
- se(J, Fe(_e(m.$attrs)), null, 16)
2878
+ y("div", kt, [
2879
+ ie(Q, Ie(Fe(b.$attrs)), null, 16)
2813
2880
  ]),
2814
- m.$slots.footer ? (_(), R("div", gt, [
2815
- Re(m.$slots, "footer", { close: o })
2881
+ b.$slots.footer ? (x(), _("div", St, [
2882
+ Re(b.$slots, "footer", { close: s })
2816
2883
  ])) : U("", !0)
2817
2884
  ], 4)
2818
2885
  ])) : U("", !0)
@@ -2822,16 +2889,16 @@ const Pe = `
2822
2889
  ]));
2823
2890
  }
2824
2891
  });
2825
- J.install = (i) => {
2826
- i.component("CodeRunner", J);
2892
+ Q.install = (i) => {
2893
+ i.component("CodeRunner", Q);
2827
2894
  };
2828
- const mt = {
2895
+ const xt = {
2829
2896
  install(i) {
2830
- i.component("CodeRunner", J);
2897
+ i.component("CodeRunner", Q);
2831
2898
  }
2832
2899
  };
2833
2900
  export {
2834
- J as CodeRunner,
2835
- ft as CodeRunnerDialog,
2836
- mt as default
2901
+ Q as CodeRunner,
2902
+ Tt as CodeRunnerDialog,
2903
+ xt as default
2837
2904
  };