@hep-code-runner/vue2 1.4.0 → 1.5.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,6 +1,6 @@
1
- var re = Object.defineProperty, se = (r, e, t) => e in r ? re(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, q = (r, e, t) => se(r, typeof e != "symbol" ? e + "" : e, t);
1
+ var ae = Object.defineProperty, ie = (r, e, t) => e in r ? ae(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, q = (r, e, t) => ie(r, typeof e != "symbol" ? e + "" : e, t);
2
2
  let W = null;
3
- class ie {
3
+ class se {
4
4
  constructor(e = {}) {
5
5
  q(this, "baseUrl"), q(this, "timeout"), this.baseUrl = e.pistonUrl || "/api/piston", this.timeout = e.timeout || 3e3;
6
6
  }
@@ -26,17 +26,17 @@ class ie {
26
26
  const p = (await this.getRuntimes()).find(
27
27
  (h) => {
28
28
  var A;
29
- return h.language.toLowerCase() === e.toLowerCase() || ((A = h.aliases) == null ? void 0 : A.some((I) => I.toLowerCase() === e.toLowerCase()));
29
+ return h.language.toLowerCase() === e.toLowerCase() || ((A = h.aliases) == null ? void 0 : A.some((_) => _.toLowerCase() === e.toLowerCase()));
30
30
  }
31
31
  );
32
32
  if (!p)
33
33
  throw new Error(`Language '${e}' is not supported`);
34
- const f = this.getFileName(e), b = {
34
+ const m = this.getFileName(e), b = {
35
35
  language: p.language,
36
36
  version: l.version || p.version,
37
37
  files: [
38
38
  {
39
- name: f,
39
+ name: m,
40
40
  content: t
41
41
  }
42
42
  ],
@@ -55,13 +55,13 @@ class ie {
55
55
  });
56
56
  if (!h.ok)
57
57
  throw new Error(`Execute failed: ${h.statusText}`);
58
- const A = await h.json(), I = Date.now() - u, x = A.run.stdout || "", F = A.run.stderr || "";
58
+ const A = await h.json(), _ = Date.now() - u, x = A.run.stdout || "", I = A.run.stderr || "";
59
59
  return {
60
60
  success: A.run.code === 0,
61
61
  output: x,
62
- stderr: F,
62
+ stderr: I,
63
63
  code: A.run.code,
64
- executionTime: I,
64
+ executionTime: _,
65
65
  compile: A.compile ? {
66
66
  stdout: A.compile.stdout || "",
67
67
  stderr: A.compile.stderr || "",
@@ -227,7 +227,7 @@ var Q = { exports: {} };
227
227
  * @public
228
228
  */
229
229
  var t = function(l) {
230
- var p = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, f = 0, b = {}, u = {
230
+ var p = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, m = 0, b = {}, u = {
231
231
  /**
232
232
  * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
233
233
  * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
@@ -311,7 +311,7 @@ var Q = { exports: {} };
311
311
  * @returns {number}
312
312
  */
313
313
  objId: function(a) {
314
- return a.__id || Object.defineProperty(a, "__id", { value: ++f }), a.__id;
314
+ return a.__id || Object.defineProperty(a, "__id", { value: ++m }), a.__id;
315
315
  },
316
316
  /**
317
317
  * Creates a deep clone of the given object.
@@ -323,28 +323,28 @@ var Q = { exports: {} };
323
323
  * @returns {T}
324
324
  * @template T
325
325
  */
326
- clone: function a(n, s) {
327
- s = s || {};
328
- var i, o;
326
+ clone: function a(n, i) {
327
+ i = i || {};
328
+ var s, o;
329
329
  switch (u.util.type(n)) {
330
330
  case "Object":
331
- if (o = u.util.objId(n), s[o])
332
- return s[o];
333
- i = /** @type {Record<string, any>} */
334
- {}, s[o] = i;
331
+ if (o = u.util.objId(n), i[o])
332
+ return i[o];
333
+ s = /** @type {Record<string, any>} */
334
+ {}, i[o] = s;
335
335
  for (var d in n)
336
- n.hasOwnProperty(d) && (i[d] = a(n[d], s));
336
+ n.hasOwnProperty(d) && (s[d] = a(n[d], i));
337
337
  return (
338
338
  /** @type {any} */
339
- i
339
+ s
340
340
  );
341
341
  case "Array":
342
- return o = u.util.objId(n), s[o] ? s[o] : (i = [], s[o] = i, /** @type {Array} */
342
+ return o = u.util.objId(n), i[o] ? i[o] : (s = [], i[o] = s, /** @type {Array} */
343
343
  /** @type {any} */
344
344
  n.forEach(function(g, c) {
345
- i[c] = a(g, s);
345
+ s[c] = a(g, i);
346
346
  }), /** @type {any} */
347
- i);
347
+ s);
348
348
  default:
349
349
  return n;
350
350
  }
@@ -393,13 +393,13 @@ var Q = { exports: {} };
393
393
  );
394
394
  try {
395
395
  throw new Error();
396
- } catch (i) {
397
- var a = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(i.stack) || [])[1];
396
+ } catch (s) {
397
+ var a = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(s.stack) || [])[1];
398
398
  if (a) {
399
399
  var n = document.getElementsByTagName("script");
400
- for (var s in n)
401
- if (n[s].src == a)
402
- return n[s];
400
+ for (var i in n)
401
+ if (n[i].src == a)
402
+ return n[i];
403
403
  }
404
404
  return null;
405
405
  }
@@ -423,16 +423,16 @@ var Q = { exports: {} };
423
423
  * @param {boolean} [defaultActivation=false]
424
424
  * @returns {boolean}
425
425
  */
426
- isActive: function(a, n, s) {
427
- for (var i = "no-" + n; a; ) {
426
+ isActive: function(a, n, i) {
427
+ for (var s = "no-" + n; a; ) {
428
428
  var o = a.classList;
429
429
  if (o.contains(n))
430
430
  return !0;
431
- if (o.contains(i))
431
+ if (o.contains(s))
432
432
  return !1;
433
433
  a = a.parentElement;
434
434
  }
435
- return !!s;
435
+ return !!i;
436
436
  }
437
437
  },
438
438
  /**
@@ -479,10 +479,10 @@ var Q = { exports: {} };
479
479
  * });
480
480
  */
481
481
  extend: function(a, n) {
482
- var s = u.util.clone(u.languages[a]);
483
- for (var i in n)
484
- s[i] = n[i];
485
- return s;
482
+ var i = u.util.clone(u.languages[a]);
483
+ for (var s in n)
484
+ i[s] = n[s];
485
+ return i;
486
486
  },
487
487
  /**
488
488
  * Inserts tokens _before_ another token in a language definition or any other grammar.
@@ -559,31 +559,31 @@ var Q = { exports: {} };
559
559
  * @returns {Grammar} The new grammar object.
560
560
  * @public
561
561
  */
562
- insertBefore: function(a, n, s, i) {
563
- i = i || /** @type {any} */
562
+ insertBefore: function(a, n, i, s) {
563
+ s = s || /** @type {any} */
564
564
  u.languages;
565
- var o = i[a], d = {};
565
+ var o = s[a], d = {};
566
566
  for (var g in o)
567
567
  if (o.hasOwnProperty(g)) {
568
568
  if (g == n)
569
- for (var c in s)
570
- s.hasOwnProperty(c) && (d[c] = s[c]);
571
- s.hasOwnProperty(g) || (d[g] = o[g]);
569
+ for (var c in i)
570
+ i.hasOwnProperty(c) && (d[c] = i[c]);
571
+ i.hasOwnProperty(g) || (d[g] = o[g]);
572
572
  }
573
- var E = i[a];
574
- return i[a] = d, u.languages.DFS(u.languages, function(S, R) {
575
- R === E && S != a && (this[S] = d);
573
+ var E = s[a];
574
+ return s[a] = d, u.languages.DFS(u.languages, function(S, F) {
575
+ F === E && S != a && (this[S] = d);
576
576
  }), d;
577
577
  },
578
578
  // Traverse a language definition with Depth First Search
579
- DFS: function a(n, s, i, o) {
579
+ DFS: function a(n, i, s, o) {
580
580
  o = o || {};
581
581
  var d = u.util.objId;
582
582
  for (var g in n)
583
583
  if (n.hasOwnProperty(g)) {
584
- s.call(n, g, n[g], i || g);
584
+ i.call(n, g, n[g], s || g);
585
585
  var c = n[g], E = u.util.type(c);
586
- E === "Object" && !o[d(c)] ? (o[d(c)] = !0, a(c, s, null, o)) : E === "Array" && !o[d(c)] && (o[d(c)] = !0, a(c, s, g, o));
586
+ E === "Object" && !o[d(c)] ? (o[d(c)] = !0, a(c, i, null, o)) : E === "Array" && !o[d(c)] && (o[d(c)] = !0, a(c, i, g, o));
587
587
  }
588
588
  }
589
589
  },
@@ -618,15 +618,15 @@ var Q = { exports: {} };
618
618
  * @memberof Prism
619
619
  * @public
620
620
  */
621
- highlightAllUnder: function(a, n, s) {
622
- var i = {
623
- callback: s,
621
+ highlightAllUnder: function(a, n, i) {
622
+ var s = {
623
+ callback: i,
624
624
  container: a,
625
625
  selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
626
626
  };
627
- u.hooks.run("before-highlightall", i), i.elements = Array.prototype.slice.apply(i.container.querySelectorAll(i.selector)), u.hooks.run("before-all-elements-highlight", i);
628
- for (var o = 0, d; d = i.elements[o++]; )
629
- u.highlightElement(d, n === !0, i.callback);
627
+ u.hooks.run("before-highlightall", s), s.elements = Array.prototype.slice.apply(s.container.querySelectorAll(s.selector)), u.hooks.run("before-all-elements-highlight", s);
628
+ for (var o = 0, d; d = s.elements[o++]; )
629
+ u.highlightElement(d, n === !0, s.callback);
630
630
  },
631
631
  /**
632
632
  * Highlights the code inside a single element.
@@ -656,22 +656,22 @@ var Q = { exports: {} };
656
656
  * @memberof Prism
657
657
  * @public
658
658
  */
659
- highlightElement: function(a, n, s) {
660
- var i = u.util.getLanguage(a), o = u.languages[i];
661
- u.util.setLanguage(a, i);
659
+ highlightElement: function(a, n, i) {
660
+ var s = u.util.getLanguage(a), o = u.languages[s];
661
+ u.util.setLanguage(a, s);
662
662
  var d = a.parentElement;
663
- d && d.nodeName.toLowerCase() === "pre" && u.util.setLanguage(d, i);
663
+ d && d.nodeName.toLowerCase() === "pre" && u.util.setLanguage(d, s);
664
664
  var g = a.textContent, c = {
665
665
  element: a,
666
- language: i,
666
+ language: s,
667
667
  grammar: o,
668
668
  code: g
669
669
  };
670
- function E(R) {
671
- c.highlightedCode = R, u.hooks.run("before-insert", c), c.element.innerHTML = c.highlightedCode, u.hooks.run("after-highlight", c), u.hooks.run("complete", c), s && s.call(c.element);
670
+ function E(F) {
671
+ c.highlightedCode = F, u.hooks.run("before-insert", c), c.element.innerHTML = c.highlightedCode, u.hooks.run("after-highlight", c), u.hooks.run("complete", c), i && i.call(c.element);
672
672
  }
673
673
  if (u.hooks.run("before-sanity-check", c), d = c.element.parentElement, d && d.nodeName.toLowerCase() === "pre" && !d.hasAttribute("tabindex") && d.setAttribute("tabindex", "0"), !c.code) {
674
- u.hooks.run("complete", c), s && s.call(c.element);
674
+ u.hooks.run("complete", c), i && i.call(c.element);
675
675
  return;
676
676
  }
677
677
  if (u.hooks.run("before-highlight", c), !c.grammar) {
@@ -680,8 +680,8 @@ var Q = { exports: {} };
680
680
  }
681
681
  if (n && l.Worker) {
682
682
  var S = new Worker(u.filename);
683
- S.onmessage = function(R) {
684
- E(R.data);
683
+ S.onmessage = function(F) {
684
+ E(F.data);
685
685
  }, S.postMessage(JSON.stringify({
686
686
  language: c.language,
687
687
  code: c.code,
@@ -710,15 +710,15 @@ var Q = { exports: {} };
710
710
  * @example
711
711
  * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
712
712
  */
713
- highlight: function(a, n, s) {
714
- var i = {
713
+ highlight: function(a, n, i) {
714
+ var s = {
715
715
  code: a,
716
716
  grammar: n,
717
- language: s
717
+ language: i
718
718
  };
719
- if (u.hooks.run("before-tokenize", i), !i.grammar)
720
- throw new Error('The language "' + i.language + '" has no grammar.');
721
- return i.tokens = u.tokenize(i.code, i.grammar), u.hooks.run("after-tokenize", i), h.stringify(u.util.encode(i.tokens), i.language);
719
+ if (u.hooks.run("before-tokenize", s), !s.grammar)
720
+ throw new Error('The language "' + s.language + '" has no grammar.');
721
+ return s.tokens = u.tokenize(s.code, s.grammar), u.hooks.run("after-tokenize", s), h.stringify(u.util.encode(s.tokens), s.language);
722
722
  },
723
723
  /**
724
724
  * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
@@ -745,14 +745,14 @@ var Q = { exports: {} };
745
745
  * });
746
746
  */
747
747
  tokenize: function(a, n) {
748
- var s = n.rest;
749
- if (s) {
750
- for (var i in s)
751
- n[i] = s[i];
748
+ var i = n.rest;
749
+ if (i) {
750
+ for (var s in i)
751
+ n[s] = i[s];
752
752
  delete n.rest;
753
753
  }
754
754
  var o = new x();
755
- return F(o, o.head, a), I(a, o, n, o.head, 0), O(o);
755
+ return I(o, o.head, a), _(a, o, n, o.head, 0), O(o);
756
756
  },
757
757
  /**
758
758
  * @namespace
@@ -774,8 +774,8 @@ var Q = { exports: {} };
774
774
  * @public
775
775
  */
776
776
  add: function(a, n) {
777
- var s = u.hooks.all;
778
- s[a] = s[a] || [], s[a].push(n);
777
+ var i = u.hooks.all;
778
+ i[a] = i[a] || [], i[a].push(n);
779
779
  },
780
780
  /**
781
781
  * Runs a hook invoking all registered callbacks with the given environment variables.
@@ -787,34 +787,34 @@ var Q = { exports: {} };
787
787
  * @public
788
788
  */
789
789
  run: function(a, n) {
790
- var s = u.hooks.all[a];
791
- if (!(!s || !s.length))
792
- for (var i = 0, o; o = s[i++]; )
790
+ var i = u.hooks.all[a];
791
+ if (!(!i || !i.length))
792
+ for (var s = 0, o; o = i[s++]; )
793
793
  o(n);
794
794
  }
795
795
  },
796
796
  Token: h
797
797
  };
798
798
  l.Prism = u;
799
- function h(a, n, s, i) {
800
- this.type = a, this.content = n, this.alias = s, this.length = (i || "").length | 0;
799
+ function h(a, n, i, s) {
800
+ this.type = a, this.content = n, this.alias = i, this.length = (s || "").length | 0;
801
801
  }
802
- h.stringify = function a(n, s) {
802
+ h.stringify = function a(n, i) {
803
803
  if (typeof n == "string")
804
804
  return n;
805
805
  if (Array.isArray(n)) {
806
- var i = "";
806
+ var s = "";
807
807
  return n.forEach(function(E) {
808
- i += a(E, s);
809
- }), i;
808
+ s += a(E, i);
809
+ }), s;
810
810
  }
811
811
  var o = {
812
812
  type: n.type,
813
- content: a(n.content, s),
813
+ content: a(n.content, i),
814
814
  tag: "span",
815
815
  classes: ["token", n.type],
816
816
  attributes: {},
817
- language: s
817
+ language: i
818
818
  }, d = n.alias;
819
819
  d && (Array.isArray(d) ? Array.prototype.push.apply(o.classes, d) : o.classes.push(d)), u.hooks.run("wrap", o);
820
820
  var g = "";
@@ -822,58 +822,58 @@ var Q = { exports: {} };
822
822
  g += " " + c + '="' + (o.attributes[c] || "").replace(/"/g, "&quot;") + '"';
823
823
  return "<" + o.tag + ' class="' + o.classes.join(" ") + '"' + g + ">" + o.content + "</" + o.tag + ">";
824
824
  };
825
- function A(a, n, s, i) {
825
+ function A(a, n, i, s) {
826
826
  a.lastIndex = n;
827
- var o = a.exec(s);
828
- if (o && i && o[1]) {
827
+ var o = a.exec(i);
828
+ if (o && s && o[1]) {
829
829
  var d = o[1].length;
830
830
  o.index += d, o[0] = o[0].slice(d);
831
831
  }
832
832
  return o;
833
833
  }
834
- function I(a, n, s, i, o, d) {
835
- for (var g in s)
836
- if (!(!s.hasOwnProperty(g) || !s[g])) {
837
- var c = s[g];
834
+ function _(a, n, i, s, o, d) {
835
+ for (var g in i)
836
+ if (!(!i.hasOwnProperty(g) || !i[g])) {
837
+ var c = i[g];
838
838
  c = Array.isArray(c) ? c : [c];
839
839
  for (var E = 0; E < c.length; ++E) {
840
840
  if (d && d.cause == g + "," + E)
841
841
  return;
842
- var S = c[E], R = S.inside, X = !!S.lookbehind, Z = !!S.greedy, ee = S.alias;
842
+ var S = c[E], F = S.inside, X = !!S.lookbehind, Z = !!S.greedy, ee = S.alias;
843
843
  if (Z && !S.pattern.global) {
844
844
  var te = S.pattern.toString().match(/[imsuy]*$/)[0];
845
845
  S.pattern = RegExp(S.pattern.source, te + "g");
846
846
  }
847
- for (var K = S.pattern || S, T = i.next, _ = o; T !== n.tail && !(d && _ >= d.reach); _ += T.value.length, T = T.next) {
847
+ for (var K = S.pattern || S, T = s.next, k = o; T !== n.tail && !(d && k >= d.reach); k += T.value.length, T = T.next) {
848
848
  var C = T.value;
849
849
  if (n.length > a.length)
850
850
  return;
851
851
  if (!(C instanceof h)) {
852
852
  var N = 1, w;
853
853
  if (Z) {
854
- if (w = A(K, _, a, X), !w || w.index >= a.length)
854
+ if (w = A(K, k, a, X), !w || w.index >= a.length)
855
855
  break;
856
- var D = w.index, ne = w.index + w[0].length, k = _;
857
- for (k += T.value.length; D >= k; )
858
- T = T.next, k += T.value.length;
859
- if (k -= T.value.length, _ = k, T.value instanceof h)
856
+ var D = w.index, ne = w.index + w[0].length, R = k;
857
+ for (R += T.value.length; D >= R; )
858
+ T = T.next, R += T.value.length;
859
+ if (R -= T.value.length, k = R, T.value instanceof h)
860
860
  continue;
861
- for (var L = T; L !== n.tail && (k < ne || typeof L.value == "string"); L = L.next)
862
- N++, k += L.value.length;
863
- N--, C = a.slice(_, k), w.index -= _;
861
+ for (var L = T; L !== n.tail && (R < ne || typeof L.value == "string"); L = L.next)
862
+ N++, R += L.value.length;
863
+ N--, C = a.slice(k, R), w.index -= k;
864
864
  } else if (w = A(K, 0, C, X), !w)
865
865
  continue;
866
- var D = w.index, P = w[0], H = C.slice(0, D), V = C.slice(D + P.length), B = _ + C.length;
866
+ var D = w.index, P = w[0], H = C.slice(0, D), V = C.slice(D + P.length), B = k + C.length;
867
867
  d && B > d.reach && (d.reach = B);
868
868
  var $ = T.prev;
869
- H && ($ = F(n, $, H), _ += H.length), U(n, $, N);
870
- var ae = new h(g, R ? u.tokenize(P, R) : P, ee, P);
871
- if (T = F(n, $, ae), V && F(n, T, V), N > 1) {
869
+ H && ($ = I(n, $, H), k += H.length), U(n, $, N);
870
+ var re = new h(g, F ? u.tokenize(P, F) : P, ee, P);
871
+ if (T = I(n, $, re), V && I(n, T, V), N > 1) {
872
872
  var G = {
873
873
  cause: g + "," + E,
874
874
  reach: B
875
875
  };
876
- I(a, n, s, T.prev, _, G), d && G.reach > d.reach && (d.reach = G.reach);
876
+ _(a, n, i, T.prev, k, G), d && G.reach > d.reach && (d.reach = G.reach);
877
877
  }
878
878
  }
879
879
  }
@@ -884,33 +884,33 @@ var Q = { exports: {} };
884
884
  var a = { value: null, prev: null, next: null }, n = { value: null, prev: a, next: null };
885
885
  a.next = n, this.head = a, this.tail = n, this.length = 0;
886
886
  }
887
- function F(a, n, s) {
888
- var i = n.next, o = { value: s, prev: n, next: i };
889
- return n.next = o, i.prev = o, a.length++, o;
887
+ function I(a, n, i) {
888
+ var s = n.next, o = { value: i, prev: n, next: s };
889
+ return n.next = o, s.prev = o, a.length++, o;
890
890
  }
891
- function U(a, n, s) {
892
- for (var i = n.next, o = 0; o < s && i !== a.tail; o++)
893
- i = i.next;
894
- n.next = i, i.prev = n, a.length -= o;
891
+ function U(a, n, i) {
892
+ for (var s = n.next, o = 0; o < i && s !== a.tail; o++)
893
+ s = s.next;
894
+ n.next = s, s.prev = n, a.length -= o;
895
895
  }
896
896
  function O(a) {
897
- for (var n = [], s = a.head.next; s !== a.tail; )
898
- n.push(s.value), s = s.next;
897
+ for (var n = [], i = a.head.next; i !== a.tail; )
898
+ n.push(i.value), i = i.next;
899
899
  return n;
900
900
  }
901
901
  if (!l.document)
902
902
  return l.addEventListener && (u.disableWorkerMessageHandler || l.addEventListener("message", function(a) {
903
- var n = JSON.parse(a.data), s = n.language, i = n.code, o = n.immediateClose;
904
- l.postMessage(u.highlight(i, u.languages[s], s)), o && l.close();
903
+ var n = JSON.parse(a.data), i = n.language, s = n.code, o = n.immediateClose;
904
+ l.postMessage(u.highlight(s, u.languages[i], i)), o && l.close();
905
905
  }, !1)), u;
906
906
  var v = u.util.currentScript();
907
907
  v && (u.filename = v.src, v.hasAttribute("data-manual") && (u.manual = !0));
908
- function m() {
908
+ function f() {
909
909
  u.manual || u.highlightAll();
910
910
  }
911
911
  if (!u.manual) {
912
912
  var y = document.readyState;
913
- y === "loading" || y === "interactive" && v && v.defer ? document.addEventListener("DOMContentLoaded", m) : window.requestAnimationFrame ? window.requestAnimationFrame(m) : window.setTimeout(m, 16);
913
+ y === "loading" || y === "interactive" && v && v.defer ? document.addEventListener("DOMContentLoaded", f) : window.requestAnimationFrame ? window.requestAnimationFrame(f) : window.setTimeout(f, 16);
914
914
  }
915
915
  return u;
916
916
  }(e);
@@ -1005,12 +1005,12 @@ var Q = { exports: {} };
1005
1005
  * @example
1006
1006
  * addInlined('style', 'css');
1007
1007
  */
1008
- value: function(p, f) {
1008
+ value: function(p, m) {
1009
1009
  var b = {};
1010
- b["language-" + f] = {
1010
+ b["language-" + m] = {
1011
1011
  pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1012
1012
  lookbehind: !0,
1013
- inside: t.languages[f]
1013
+ inside: t.languages[m]
1014
1014
  }, b.cdata = /^<!\[CDATA\[|\]\]>$/i;
1015
1015
  var u = {
1016
1016
  "included-cdata": {
@@ -1018,9 +1018,9 @@ var Q = { exports: {} };
1018
1018
  inside: b
1019
1019
  }
1020
1020
  };
1021
- u["language-" + f] = {
1021
+ u["language-" + m] = {
1022
1022
  pattern: /[\s\S]+/,
1023
- inside: t.languages[f]
1023
+ inside: t.languages[m]
1024
1024
  };
1025
1025
  var h = {};
1026
1026
  h[p] = {
@@ -1126,8 +1126,8 @@ var Q = { exports: {} };
1126
1126
  },
1127
1127
  punctuation: /[(){};:,]/
1128
1128
  }, l.languages.css.atrule.inside.rest = l.languages.css;
1129
- var f = l.languages.markup;
1130
- f && (f.tag.addInlined("style", "css"), f.tag.addAttribute("style", "css"));
1129
+ var m = l.languages.markup;
1130
+ m && (m.tag.addInlined("style", "css"), m.tag.addAttribute("style", "css"));
1131
1131
  }(t), t.languages.clike = {
1132
1132
  comment: [
1133
1133
  {
@@ -1292,9 +1292,9 @@ var Q = { exports: {} };
1292
1292
  if (typeof t > "u" || typeof document > "u")
1293
1293
  return;
1294
1294
  Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
1295
- var l = "Loading…", p = function(v, m) {
1296
- return "✖ Error " + v + " while fetching file: " + m;
1297
- }, f = "✖ Error: File does not exist or is empty", b = {
1295
+ var l = "Loading…", p = function(v, f) {
1296
+ return "✖ Error " + v + " while fetching file: " + f;
1297
+ }, m = "✖ Error: File does not exist or is empty", b = {
1298
1298
  js: "javascript",
1299
1299
  py: "python",
1300
1300
  rb: "ruby",
@@ -1304,52 +1304,52 @@ var Q = { exports: {} };
1304
1304
  bat: "batch",
1305
1305
  h: "c",
1306
1306
  tex: "latex"
1307
- }, u = "data-src-status", h = "loading", A = "loaded", I = "failed", x = "pre[data-src]:not([" + u + '="' + A + '"]):not([' + u + '="' + h + '"])';
1308
- function F(v, m, y) {
1307
+ }, u = "data-src-status", h = "loading", A = "loaded", _ = "failed", x = "pre[data-src]:not([" + u + '="' + A + '"]):not([' + u + '="' + h + '"])';
1308
+ function I(v, f, y) {
1309
1309
  var a = new XMLHttpRequest();
1310
1310
  a.open("GET", v, !0), a.onreadystatechange = function() {
1311
- a.readyState == 4 && (a.status < 400 && a.responseText ? m(a.responseText) : a.status >= 400 ? y(p(a.status, a.statusText)) : y(f));
1311
+ a.readyState == 4 && (a.status < 400 && a.responseText ? f(a.responseText) : a.status >= 400 ? y(p(a.status, a.statusText)) : y(m));
1312
1312
  }, a.send(null);
1313
1313
  }
1314
1314
  function U(v) {
1315
- var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v || "");
1316
- if (m) {
1317
- var y = Number(m[1]), a = m[2], n = m[3];
1315
+ var f = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v || "");
1316
+ if (f) {
1317
+ var y = Number(f[1]), a = f[2], n = f[3];
1318
1318
  return a ? n ? [y, Number(n)] : [y, void 0] : [y, y];
1319
1319
  }
1320
1320
  }
1321
1321
  t.hooks.add("before-highlightall", function(v) {
1322
1322
  v.selector += ", " + x;
1323
1323
  }), t.hooks.add("before-sanity-check", function(v) {
1324
- var m = (
1324
+ var f = (
1325
1325
  /** @type {HTMLPreElement} */
1326
1326
  v.element
1327
1327
  );
1328
- if (m.matches(x)) {
1329
- v.code = "", m.setAttribute(u, h);
1330
- var y = m.appendChild(document.createElement("CODE"));
1328
+ if (f.matches(x)) {
1329
+ v.code = "", f.setAttribute(u, h);
1330
+ var y = f.appendChild(document.createElement("CODE"));
1331
1331
  y.textContent = l;
1332
- var a = m.getAttribute("data-src"), n = v.language;
1332
+ var a = f.getAttribute("data-src"), n = v.language;
1333
1333
  if (n === "none") {
1334
- var s = (/\.(\w+)$/.exec(a) || [, "none"])[1];
1335
- n = b[s] || s;
1334
+ var i = (/\.(\w+)$/.exec(a) || [, "none"])[1];
1335
+ n = b[i] || i;
1336
1336
  }
1337
- t.util.setLanguage(y, n), t.util.setLanguage(m, n);
1338
- var i = t.plugins.autoloader;
1339
- i && i.loadLanguages(n), F(
1337
+ t.util.setLanguage(y, n), t.util.setLanguage(f, n);
1338
+ var s = t.plugins.autoloader;
1339
+ s && s.loadLanguages(n), I(
1340
1340
  a,
1341
1341
  function(o) {
1342
- m.setAttribute(u, A);
1343
- var d = U(m.getAttribute("data-range"));
1342
+ f.setAttribute(u, A);
1343
+ var d = U(f.getAttribute("data-range"));
1344
1344
  if (d) {
1345
1345
  var g = o.split(/\r\n?|\n/g), c = d[0], E = d[1] == null ? g.length : d[1];
1346
1346
  c < 0 && (c += g.length), c = Math.max(0, Math.min(c - 1, g.length)), E < 0 && (E += g.length), E = Math.max(0, Math.min(E, g.length)), o = g.slice(c, E).join(`
1347
- `), m.hasAttribute("data-start") || m.setAttribute("data-start", String(c + 1));
1347
+ `), f.hasAttribute("data-start") || f.setAttribute("data-start", String(c + 1));
1348
1348
  }
1349
1349
  y.textContent = o, t.highlightElement(y);
1350
1350
  },
1351
1351
  function(o) {
1352
- m.setAttribute(u, I), y.textContent = o;
1352
+ f.setAttribute(u, _), y.textContent = o;
1353
1353
  }
1354
1354
  );
1355
1355
  }
@@ -1361,8 +1361,8 @@ var Q = { exports: {} };
1361
1361
  *
1362
1362
  * @param {ParentNode} [container=document]
1363
1363
  */
1364
- highlight: function(m) {
1365
- for (var y = (m || document).querySelectorAll(x), a = 0, n; n = y[a++]; )
1364
+ highlight: function(f) {
1365
+ for (var y = (f || document).querySelectorAll(x), a = 0, n; n = y[a++]; )
1366
1366
  t.highlightElement(n);
1367
1367
  }
1368
1368
  };
@@ -2185,8 +2185,8 @@ Prism.languages.sql = {
2185
2185
  "operator",
2186
2186
  "punctuation",
2187
2187
  "number"
2188
- ], f = l.variable[1].inside, b = 0; b < p.length; b++)
2189
- f[p[b]] = r.languages.bash[p[b]];
2188
+ ], m = l.variable[1].inside, b = 0; b < p.length; b++)
2189
+ m[p[b]] = r.languages.bash[p[b]];
2190
2190
  r.languages.sh = r.languages.bash, r.languages.shell = r.languages.bash;
2191
2191
  })(Prism);
2192
2192
  Prism.languages.json = {
@@ -2214,15 +2214,133 @@ Prism.languages.json = {
2214
2214
  }
2215
2215
  };
2216
2216
  Prism.languages.webmanifest = Prism.languages.json;
2217
- function Y(r, e, t, l, p, f, b, u) {
2217
+ const ce = `
2218
+ .hep-cr-editor .token.comment,
2219
+ .hep-cr-editor .token.prolog,
2220
+ .hep-cr-editor .token.doctype,
2221
+ .hep-cr-editor .token.cdata {
2222
+ color: #8292a2 !important;
2223
+ }
2224
+
2225
+ .hep-cr-editor .token.punctuation {
2226
+ color: #f8f8f2 !important;
2227
+ }
2228
+
2229
+ .hep-cr-editor .token.property,
2230
+ .hep-cr-editor .token.tag,
2231
+ .hep-cr-editor .token.constant,
2232
+ .hep-cr-editor .token.symbol,
2233
+ .hep-cr-editor .token.deleted {
2234
+ color: #f92672 !important;
2235
+ }
2236
+
2237
+ .hep-cr-editor .token.boolean,
2238
+ .hep-cr-editor .token.number {
2239
+ color: #ae81ff !important;
2240
+ }
2241
+
2242
+ .hep-cr-editor .token.selector,
2243
+ .hep-cr-editor .token.attr-name,
2244
+ .hep-cr-editor .token.string,
2245
+ .hep-cr-editor .token.char,
2246
+ .hep-cr-editor .token.builtin,
2247
+ .hep-cr-editor .token.inserted {
2248
+ color: #a6e22e !important;
2249
+ }
2250
+
2251
+ .hep-cr-editor .token.operator,
2252
+ .hep-cr-editor .token.entity,
2253
+ .hep-cr-editor .token.url,
2254
+ .hep-cr-editor .language-css .hep-cr-editor .token.string,
2255
+ .hep-cr-editor .style .hep-cr-editor .token.string,
2256
+ .hep-cr-editor .token.variable {
2257
+ color: #f8f8f2 !important;
2258
+ }
2259
+
2260
+ .hep-cr-editor .token.atrule,
2261
+ .hep-cr-editor .token.attr-value,
2262
+ .hep-cr-editor .token.function,
2263
+ .hep-cr-editor .token.class-name {
2264
+ color: #e6db74 !important;
2265
+ }
2266
+
2267
+ .hep-cr-editor .token.keyword,
2268
+ .hep-cr-editor .token.keyword-control {
2269
+ color: #66d9ef !important;
2270
+ }
2271
+
2272
+ .hep-cr-editor .token.regex,
2273
+ .hep-cr-editor .token.important {
2274
+ color: #fd971f !important;
2275
+ }
2276
+ `, de = `
2277
+ .hep-cr-editor .token.comment,
2278
+ .hep-cr-editor .token.prolog,
2279
+ .hep-cr-editor .token.doctype,
2280
+ .hep-cr-editor .token.cdata {
2281
+ color: #708090;
2282
+ }
2283
+
2284
+ .hep-cr-editor .token.punctuation {
2285
+ color: #333;
2286
+ }
2287
+
2288
+ .hep-cr-editor .token.property,
2289
+ .hep-cr-editor .token.tag,
2290
+ .hep-cr-editor .token.constant,
2291
+ .hep-cr-editor .token.symbol,
2292
+ .hep-cr-editor .token.deleted {
2293
+ color: #d73a49;
2294
+ }
2295
+
2296
+ .hep-cr-editor .token.boolean,
2297
+ .hep-cr-editor .token.number {
2298
+ color: #005cc5;
2299
+ }
2300
+
2301
+ .hep-cr-editor .token.selector,
2302
+ .hep-cr-editor .token.attr-name,
2303
+ .hep-cr-editor .token.string,
2304
+ .hep-cr-editor .token.char,
2305
+ .hep-cr-editor .token.builtin,
2306
+ .hep-cr-editor .token.inserted {
2307
+ color: #22863a;
2308
+ }
2309
+
2310
+ .hep-cr-editor .token.operator,
2311
+ .hep-cr-editor .token.entity,
2312
+ .hep-cr-editor .token.url,
2313
+ .hep-cr-editor .language-css .hep-cr-editor .token.string,
2314
+ .hep-cr-editor .style .hep-cr-editor .token.string,
2315
+ .hep-cr-editor .token.variable {
2316
+ color: #333;
2317
+ }
2318
+
2319
+ .hep-cr-editor .token.atrule,
2320
+ .hep-cr-editor .token.attr-value,
2321
+ .hep-cr-editor .token.function,
2322
+ .hep-cr-editor .token.class-name {
2323
+ color: #6f42c1;
2324
+ }
2325
+
2326
+ .hep-cr-editor .token.keyword {
2327
+ color: #d73a49;
2328
+ }
2329
+
2330
+ .hep-cr-editor .token.regex,
2331
+ .hep-cr-editor .token.important {
2332
+ color: #e36209;
2333
+ }
2334
+ `;
2335
+ function Y(r, e, t, l, p, m, b, u) {
2218
2336
  var h = typeof r == "function" ? r.options : r;
2219
- return e && (h.render = e, h.staticRenderFns = t, h._compiled = !0), f && (h._scopeId = "data-v-" + f), {
2337
+ return e && (h.render = e, h.staticRenderFns = t, h._compiled = !0), m && (h._scopeId = "data-v-" + m), {
2220
2338
  exports: r,
2221
2339
  options: h
2222
2340
  };
2223
2341
  }
2224
2342
  typeof window < "u" && (window.Prism = j);
2225
- const ce = {
2343
+ const pe = {
2226
2344
  name: "CodeEditor",
2227
2345
  props: {
2228
2346
  value: {
@@ -2247,6 +2365,14 @@ const ce = {
2247
2365
  highlightRef: null
2248
2366
  };
2249
2367
  },
2368
+ mounted() {
2369
+ this.loadPrismTheme(this.theme);
2370
+ },
2371
+ watch: {
2372
+ theme(r) {
2373
+ this.loadPrismTheme(r);
2374
+ }
2375
+ },
2250
2376
  computed: {
2251
2377
  languageMap: function() {
2252
2378
  return {
@@ -2303,6 +2429,12 @@ const ce = {
2303
2429
  }
2304
2430
  },
2305
2431
  methods: {
2432
+ loadPrismTheme(r) {
2433
+ const e = "hep-cr-prism-styles", t = document.getElementById(e), l = r === "dark" ? ce : de;
2434
+ t && t.remove();
2435
+ const p = document.createElement("style");
2436
+ p.id = e, p.textContent = l, document.head.appendChild(p);
2437
+ },
2306
2438
  escapeHtml: function(r) {
2307
2439
  var e = document.createElement("div");
2308
2440
  return e.textContent = r, e.innerHTML;
@@ -2323,21 +2455,21 @@ const ce = {
2323
2455
  }
2324
2456
  }
2325
2457
  };
2326
- var de = function() {
2458
+ var ge = function() {
2327
2459
  var e = this, t = e._self._c;
2328
2460
  return t("div", { staticClass: "hep-cr-editor", class: "hep-cr-theme-" + e.theme, style: { background: e.editorBackground } }, [t("pre", { ref: "highlightRef", staticClass: "hep-cr-highlight", class: "language-" + e.prismLanguage, attrs: { "aria-hidden": "true" } }, [t("code", { domProps: { innerHTML: e._s(e.highlightedCode) } })]), t("textarea", { staticClass: "hep-cr-input", attrs: { disabled: e.disabled, spellcheck: "false", placeholder: "Write your code here..." }, domProps: { value: e.value }, on: { input: e.handleInput, scroll: e.handleScroll, keydown: e.handleKeydown } })]);
2329
- }, pe = [], ge = /* @__PURE__ */ Y(
2330
- ce,
2331
- de,
2461
+ }, he = [], me = /* @__PURE__ */ Y(
2332
2462
  pe,
2463
+ ge,
2464
+ he,
2333
2465
  !1,
2334
2466
  null,
2335
- "bee30f50"
2467
+ "9d5753e0"
2336
2468
  );
2337
- const he = ge.exports, fe = {
2469
+ const fe = me.exports, be = {
2338
2470
  name: "CodeRunner",
2339
2471
  components: {
2340
- CodeEditor: he
2472
+ CodeEditor: fe
2341
2473
  },
2342
2474
  props: {
2343
2475
  pistonUrl: {
@@ -2417,7 +2549,7 @@ const he = ge.exports, fe = {
2417
2549
  }
2418
2550
  },
2419
2551
  mounted: function() {
2420
- this.client = new ie({ pistonUrl: this.pistonUrl }), this.loadRuntimes();
2552
+ this.client = new se({ pistonUrl: this.pistonUrl }), this.loadRuntimes();
2421
2553
  },
2422
2554
  methods: {
2423
2555
  loadRuntimes: function() {
@@ -2461,8 +2593,8 @@ const he = ge.exports, fe = {
2461
2593
  startDrag: function(r) {
2462
2594
  var e = this, t = document.querySelector(".hep-cr-runner-main");
2463
2595
  if (t) {
2464
- var l = function(f) {
2465
- var b = t.getBoundingClientRect(), u = (f.clientX - b.left) / b.width * 100;
2596
+ var l = function(m) {
2597
+ var b = t.getBoundingClientRect(), u = (m.clientX - b.left) / b.width * 100;
2466
2598
  e.editorWidth = Math.max(20, Math.min(80, u));
2467
2599
  }, p = function() {
2468
2600
  document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", p), document.body.style.cursor = "", document.body.style.userSelect = "";
@@ -2472,13 +2604,13 @@ const he = ge.exports, fe = {
2472
2604
  }
2473
2605
  }
2474
2606
  };
2475
- var me = function() {
2607
+ var Ee = function() {
2476
2608
  var e = this, t = e._self._c;
2477
2609
  return t("div", { class: ["hep-cr-runner", e.themeClass] }, [t("div", { staticClass: "hep-cr-runner-header" }, [t("div", { staticClass: "hep-cr-runner-controls" }, [e.showLanguageSelector ? t("select", { directives: [{ name: "model", rawName: "v-model", value: e.currentLanguage, expression: "currentLanguage" }], staticClass: "hep-cr-language-select", attrs: { disabled: e.isRunning }, on: { change: function(l) {
2478
- var p = Array.prototype.filter.call(l.target.options, function(f) {
2479
- return f.selected;
2480
- }).map(function(f) {
2481
- var b = "_value" in f ? f._value : f.value;
2610
+ var p = Array.prototype.filter.call(l.target.options, function(m) {
2611
+ return m.selected;
2612
+ }).map(function(m) {
2613
+ var b = "_value" in m ? m._value : m.value;
2482
2614
  return b;
2483
2615
  });
2484
2616
  e.currentLanguage = l.target.multiple ? p : p[0];
@@ -2491,15 +2623,15 @@ var me = function() {
2491
2623
  } } }, [e._v(" 输出 ")]), e.stderr ? t("button", { class: ["hep-cr-tab", { active: e.activeTab === "stderr" }], on: { click: function(l) {
2492
2624
  e.activeTab = "stderr";
2493
2625
  } } }, [e._v(" 错误 ")]) : e._e()]), t("div", { staticClass: "hep-cr-output-actions" }, [e.executionTime !== null ? t("span", { staticClass: "hep-cr-execution-time" }, [e._v(" " + e._s(e.executionTime) + "ms ")]) : e._e(), t("button", { staticClass: "hep-cr-btn-icon", attrs: { title: "复制" }, on: { click: e.copyOutput } }, [t("svg", { attrs: { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" } }, [t("rect", { attrs: { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" } }), t("path", { attrs: { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" } })])]), t("button", { staticClass: "hep-cr-btn-icon", attrs: { title: "清除" }, on: { click: e.clearOutput } }, [t("svg", { attrs: { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" } }, [t("polyline", { attrs: { points: "3 6 5 6 21 6" } }), t("path", { attrs: { 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" } })])])])]), t("div", { staticClass: "hep-cr-output-content" }, [e.activeTab === "stdout" ? t("pre", [e._v(e._s(e.output || '点击"运行"执行代码'))]) : t("pre", { staticClass: "hep-cr-stderr" }, [e._v(e._s(e.stderr))])])])])]);
2494
- }, be = [], Ee = /* @__PURE__ */ Y(
2495
- fe,
2496
- me,
2626
+ }, ve = [], ye = /* @__PURE__ */ Y(
2497
2627
  be,
2628
+ Ee,
2629
+ ve,
2498
2630
  !1,
2499
2631
  null,
2500
2632
  "490ecb17"
2501
2633
  );
2502
- const M = Ee.exports, ve = {
2634
+ const M = ye.exports, Ae = {
2503
2635
  name: "CodeRunnerDialog",
2504
2636
  components: {
2505
2637
  CodeRunner: M
@@ -2547,28 +2679,28 @@ const M = Ee.exports, ve = {
2547
2679
  },
2548
2680
  expose: ["close"]
2549
2681
  };
2550
- var ye = function() {
2682
+ var Se = function() {
2551
2683
  var e = this, t = e._self._c;
2552
2684
  return t("Teleport", { attrs: { to: "body" } }, [t("Transition", { attrs: { name: "hep-cr-dialog-fade" } }, [e.localVisible ? t("div", { staticClass: "hep-cr-dialog-overlay", on: { click: e.handleOverlayClick } }, [t("div", { staticClass: "hep-cr-dialog-container", style: { width: e.dialogWidth } }, [t("div", { staticClass: "hep-cr-dialog-header" }, [t("h3", { staticClass: "hep-cr-dialog-title" }, [e._v(e._s(e.title))]), t("button", { staticClass: "hep-cr-dialog-close", on: { click: e.close } }, [t("svg", { attrs: { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" } }, [t("line", { attrs: { x1: "18", y1: "6", x2: "6", y2: "18" } }), t("line", { attrs: { x1: "6", y1: "6", x2: "18", y2: "18" } })])])]), t("div", { staticClass: "hep-cr-dialog-body" }, [t("CodeRunner", e._b({}, "CodeRunner", e.$attrs, !1))], 1), e.$slots.footer ? t("div", { staticClass: "hep-cr-dialog-footer" }, [e._t("footer", null, { close: e.close })], 2) : e._e()])]) : e._e()])], 1);
2553
- }, Ae = [], Se = /* @__PURE__ */ Y(
2554
- ve,
2555
- ye,
2685
+ }, Te = [], we = /* @__PURE__ */ Y(
2556
2686
  Ae,
2687
+ Se,
2688
+ Te,
2557
2689
  !1,
2558
2690
  null,
2559
2691
  "ec700b03"
2560
2692
  );
2561
- const Te = Se.exports;
2693
+ const ke = we.exports;
2562
2694
  M.install = (r) => {
2563
2695
  r.component("CodeRunner", M);
2564
2696
  };
2565
- const we = {
2697
+ const _e = {
2566
2698
  install(r) {
2567
2699
  r.component("CodeRunner", M);
2568
2700
  }
2569
2701
  };
2570
2702
  export {
2571
2703
  M as CodeRunner,
2572
- Te as CodeRunnerDialog,
2573
- we as default
2704
+ ke as CodeRunnerDialog,
2705
+ _e as default
2574
2706
  };