@hep-code-runner/vue3 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -7
- package/dist/index.mjs +415 -403
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as le, useCssVars as
|
|
2
|
-
var
|
|
1
|
+
import { defineComponent as le, useCssVars as ve, ref as N, computed as H, onMounted as he, watch as ue, onUnmounted as Ee, openBlock as _, createElementBlock as I, normalizeClass as W, createElementVNode as E, normalizeStyle as J, withDirectives as ye, createCommentVNode as U, Fragment as Ae, renderList as Se, toDisplayString as z, vModelSelect as ke, createTextVNode as we, createStaticVNode as Te, createVNode as ie, createBlock as _e, Teleport as xe, Transition as Ie, withCtx as Fe, mergeProps as Re, toHandlers as Le, renderSlot as Ne } from "vue";
|
|
2
|
+
var Oe = Object.defineProperty, Ce = (i, p, n) => p in i ? Oe(i, p, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[p] = n, de = (i, p, n) => Ce(i, typeof p != "symbol" ? p + "" : p, n);
|
|
3
3
|
let re = null;
|
|
4
|
-
class
|
|
5
|
-
constructor(
|
|
6
|
-
de(this, "baseUrl"), de(this, "timeout"), this.baseUrl =
|
|
4
|
+
class De {
|
|
5
|
+
constructor(p = {}) {
|
|
6
|
+
de(this, "baseUrl"), de(this, "timeout"), this.baseUrl = p.pistonUrl || "/api/piston", this.timeout = p.timeout || 3e3;
|
|
7
7
|
}
|
|
8
|
-
async getRuntimes(
|
|
9
|
-
if (re && !
|
|
8
|
+
async getRuntimes(p = !1) {
|
|
9
|
+
if (re && !p)
|
|
10
10
|
return re;
|
|
11
11
|
try {
|
|
12
12
|
const n = await fetch(`${this.baseUrl}/runtimes`, {
|
|
@@ -23,21 +23,21 @@ class Ce {
|
|
|
23
23
|
throw console.error("Failed to fetch runtimes:", n), n;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
async execute(
|
|
27
|
-
const
|
|
26
|
+
async execute(p, n, l = {}) {
|
|
27
|
+
const v = (await this.getRuntimes()).find(
|
|
28
28
|
(m) => {
|
|
29
|
-
var
|
|
30
|
-
return m.language.toLowerCase() ===
|
|
29
|
+
var b;
|
|
30
|
+
return m.language.toLowerCase() === p.toLowerCase() || ((b = m.aliases) == null ? void 0 : b.some((T) => T.toLowerCase() === p.toLowerCase()));
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
|
-
if (!
|
|
34
|
-
throw new Error(`Language '${
|
|
35
|
-
const
|
|
36
|
-
language:
|
|
37
|
-
version: l.version ||
|
|
33
|
+
if (!v)
|
|
34
|
+
throw new Error(`Language '${p}' is not supported`);
|
|
35
|
+
const k = this.getFileName(p), A = {
|
|
36
|
+
language: v.language,
|
|
37
|
+
version: l.version || v.version,
|
|
38
38
|
files: [
|
|
39
39
|
{
|
|
40
|
-
name:
|
|
40
|
+
name: k,
|
|
41
41
|
content: n
|
|
42
42
|
}
|
|
43
43
|
],
|
|
@@ -56,17 +56,17 @@ class Ce {
|
|
|
56
56
|
});
|
|
57
57
|
if (!m.ok)
|
|
58
58
|
throw new Error(`Execute failed: ${m.statusText}`);
|
|
59
|
-
const
|
|
59
|
+
const b = await m.json(), T = Date.now() - s, P = b.run.stdout || "", O = b.run.stderr || "";
|
|
60
60
|
return {
|
|
61
|
-
success:
|
|
62
|
-
output:
|
|
61
|
+
success: b.run.code === 0,
|
|
62
|
+
output: P,
|
|
63
63
|
stderr: O,
|
|
64
|
-
code:
|
|
65
|
-
executionTime:
|
|
66
|
-
compile:
|
|
67
|
-
stdout:
|
|
68
|
-
stderr:
|
|
69
|
-
code:
|
|
64
|
+
code: b.run.code,
|
|
65
|
+
executionTime: T,
|
|
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
72
|
} catch (m) {
|
|
@@ -79,7 +79,7 @@ class Ce {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
getFileName(
|
|
82
|
+
getFileName(p) {
|
|
83
83
|
return {
|
|
84
84
|
javascript: "main.js",
|
|
85
85
|
typescript: "main.ts",
|
|
@@ -106,10 +106,10 @@ class Ce {
|
|
|
106
106
|
css: "style.css",
|
|
107
107
|
sql: "query.sql",
|
|
108
108
|
markdown: "readme.md"
|
|
109
|
-
}[
|
|
109
|
+
}[p.toLowerCase()] || `main.${p}`;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
const
|
|
112
|
+
const Pe = {
|
|
113
113
|
javascript: 'console.log("Hello, World!");',
|
|
114
114
|
typescript: 'console.log("Hello, World!");',
|
|
115
115
|
python: 'print("Hello, World!")',
|
|
@@ -208,17 +208,17 @@ h1 {
|
|
|
208
208
|
This is a sample markdown document.`
|
|
209
209
|
};
|
|
210
210
|
function oe(i) {
|
|
211
|
-
const
|
|
212
|
-
return
|
|
211
|
+
const p = i.toLowerCase();
|
|
212
|
+
return Pe[p] || `// ${i}
|
|
213
213
|
// Write your code here`;
|
|
214
214
|
}
|
|
215
215
|
var pe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
216
|
-
function
|
|
216
|
+
function $e(i) {
|
|
217
217
|
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
218
218
|
}
|
|
219
|
-
var
|
|
219
|
+
var me = { exports: {} };
|
|
220
220
|
(function(i) {
|
|
221
|
-
var
|
|
221
|
+
var p = 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 he = { exports: {} };
|
|
|
228
228
|
* @public
|
|
229
229
|
*/
|
|
230
230
|
var n = function(l) {
|
|
231
|
-
var
|
|
231
|
+
var v = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, k = 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
|
|
@@ -312,7 +312,7 @@ var he = { exports: {} };
|
|
|
312
312
|
* @returns {number}
|
|
313
313
|
*/
|
|
314
314
|
objId: function(e) {
|
|
315
|
-
return e.__id || Object.defineProperty(e, "__id", { value: ++
|
|
315
|
+
return e.__id || Object.defineProperty(e, "__id", { value: ++k }), e.__id;
|
|
316
316
|
},
|
|
317
317
|
/**
|
|
318
318
|
* Creates a deep clone of the given object.
|
|
@@ -333,8 +333,8 @@ var he = { exports: {} };
|
|
|
333
333
|
return a[o];
|
|
334
334
|
r = /** @type {Record<string, any>} */
|
|
335
335
|
{}, a[o] = r;
|
|
336
|
-
for (var
|
|
337
|
-
t.hasOwnProperty(
|
|
336
|
+
for (var d in t)
|
|
337
|
+
t.hasOwnProperty(d) && (r[d] = e(t[d], a));
|
|
338
338
|
return (
|
|
339
339
|
/** @type {any} */
|
|
340
340
|
r
|
|
@@ -342,8 +342,8 @@ var he = { exports: {} };
|
|
|
342
342
|
case "Array":
|
|
343
343
|
return o = s.util.objId(t), a[o] ? a[o] : (r = [], a[o] = r, /** @type {Array} */
|
|
344
344
|
/** @type {any} */
|
|
345
|
-
t.forEach(function(
|
|
346
|
-
r[
|
|
345
|
+
t.forEach(function(f, c) {
|
|
346
|
+
r[c] = e(f, a);
|
|
347
347
|
}), /** @type {any} */
|
|
348
348
|
r);
|
|
349
349
|
default:
|
|
@@ -360,7 +360,7 @@ var he = { exports: {} };
|
|
|
360
360
|
*/
|
|
361
361
|
getLanguage: function(e) {
|
|
362
362
|
for (; e; ) {
|
|
363
|
-
var t =
|
|
363
|
+
var t = v.exec(e.className);
|
|
364
364
|
if (t)
|
|
365
365
|
return t[1].toLowerCase();
|
|
366
366
|
e = e.parentElement;
|
|
@@ -375,7 +375,7 @@ var he = { exports: {} };
|
|
|
375
375
|
* @returns {void}
|
|
376
376
|
*/
|
|
377
377
|
setLanguage: function(e, t) {
|
|
378
|
-
e.className = e.className.replace(RegExp(
|
|
378
|
+
e.className = e.className.replace(RegExp(v, "gi"), ""), e.classList.add("language-" + t);
|
|
379
379
|
},
|
|
380
380
|
/**
|
|
381
381
|
* Returns the script element that is currently executing.
|
|
@@ -563,28 +563,28 @@ var he = { exports: {} };
|
|
|
563
563
|
insertBefore: function(e, t, a, r) {
|
|
564
564
|
r = r || /** @type {any} */
|
|
565
565
|
s.languages;
|
|
566
|
-
var o = r[e],
|
|
567
|
-
for (var
|
|
568
|
-
if (o.hasOwnProperty(
|
|
569
|
-
if (
|
|
570
|
-
for (var
|
|
571
|
-
a.hasOwnProperty(
|
|
572
|
-
a.hasOwnProperty(
|
|
566
|
+
var o = r[e], d = {};
|
|
567
|
+
for (var f in o)
|
|
568
|
+
if (o.hasOwnProperty(f)) {
|
|
569
|
+
if (f == t)
|
|
570
|
+
for (var c in a)
|
|
571
|
+
a.hasOwnProperty(c) && (d[c] = a[c]);
|
|
572
|
+
a.hasOwnProperty(f) || (d[f] = o[f]);
|
|
573
573
|
}
|
|
574
|
-
var
|
|
575
|
-
return r[e] =
|
|
576
|
-
|
|
577
|
-
}),
|
|
574
|
+
var x = r[e];
|
|
575
|
+
return r[e] = d, s.languages.DFS(s.languages, function(F, D) {
|
|
576
|
+
D === x && F != e && (this[F] = d);
|
|
577
|
+
}), d;
|
|
578
578
|
},
|
|
579
579
|
// Traverse a language definition with Depth First Search
|
|
580
580
|
DFS: function e(t, a, r, o) {
|
|
581
581
|
o = o || {};
|
|
582
|
-
var
|
|
583
|
-
for (var
|
|
584
|
-
if (t.hasOwnProperty(
|
|
585
|
-
a.call(t,
|
|
586
|
-
var
|
|
587
|
-
|
|
582
|
+
var d = s.util.objId;
|
|
583
|
+
for (var f in t)
|
|
584
|
+
if (t.hasOwnProperty(f)) {
|
|
585
|
+
a.call(t, f, t[f], r || f);
|
|
586
|
+
var c = t[f], x = s.util.type(c);
|
|
587
|
+
x === "Object" && !o[d(c)] ? (o[d(c)] = !0, e(c, a, null, o)) : x === "Array" && !o[d(c)] && (o[d(c)] = !0, e(c, a, f, o));
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
590
|
},
|
|
@@ -626,8 +626,8 @@ var he = { exports: {} };
|
|
|
626
626
|
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
|
627
627
|
};
|
|
628
628
|
s.hooks.run("before-highlightall", r), r.elements = Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)), s.hooks.run("before-all-elements-highlight", r);
|
|
629
|
-
for (var o = 0,
|
|
630
|
-
s.highlightElement(
|
|
629
|
+
for (var o = 0, d; d = r.elements[o++]; )
|
|
630
|
+
s.highlightElement(d, t === !0, r.callback);
|
|
631
631
|
},
|
|
632
632
|
/**
|
|
633
633
|
* Highlights the code inside a single element.
|
|
@@ -660,36 +660,36 @@ var he = { exports: {} };
|
|
|
660
660
|
highlightElement: function(e, t, a) {
|
|
661
661
|
var r = s.util.getLanguage(e), o = s.languages[r];
|
|
662
662
|
s.util.setLanguage(e, r);
|
|
663
|
-
var
|
|
664
|
-
|
|
665
|
-
var
|
|
663
|
+
var d = e.parentElement;
|
|
664
|
+
d && d.nodeName.toLowerCase() === "pre" && s.util.setLanguage(d, r);
|
|
665
|
+
var f = e.textContent, c = {
|
|
666
666
|
element: e,
|
|
667
667
|
language: r,
|
|
668
668
|
grammar: o,
|
|
669
|
-
code:
|
|
669
|
+
code: f
|
|
670
670
|
};
|
|
671
|
-
function
|
|
672
|
-
|
|
671
|
+
function x(D) {
|
|
672
|
+
c.highlightedCode = D, s.hooks.run("before-insert", c), c.element.innerHTML = c.highlightedCode, s.hooks.run("after-highlight", c), s.hooks.run("complete", c), a && a.call(c.element);
|
|
673
673
|
}
|
|
674
|
-
if (s.hooks.run("before-sanity-check",
|
|
675
|
-
s.hooks.run("complete",
|
|
674
|
+
if (s.hooks.run("before-sanity-check", c), d = c.element.parentElement, d && d.nodeName.toLowerCase() === "pre" && !d.hasAttribute("tabindex") && d.setAttribute("tabindex", "0"), !c.code) {
|
|
675
|
+
s.hooks.run("complete", c), a && a.call(c.element);
|
|
676
676
|
return;
|
|
677
677
|
}
|
|
678
|
-
if (s.hooks.run("before-highlight",
|
|
679
|
-
|
|
678
|
+
if (s.hooks.run("before-highlight", c), !c.grammar) {
|
|
679
|
+
x(s.util.encode(c.code));
|
|
680
680
|
return;
|
|
681
681
|
}
|
|
682
682
|
if (t && l.Worker) {
|
|
683
|
-
var
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
},
|
|
687
|
-
language:
|
|
688
|
-
code:
|
|
683
|
+
var F = new Worker(s.filename);
|
|
684
|
+
F.onmessage = function(D) {
|
|
685
|
+
x(D.data);
|
|
686
|
+
}, F.postMessage(JSON.stringify({
|
|
687
|
+
language: c.language,
|
|
688
|
+
code: c.code,
|
|
689
689
|
immediateClose: !0
|
|
690
690
|
}));
|
|
691
691
|
} else
|
|
692
|
-
|
|
692
|
+
x(s.highlight(c.code, c.grammar, c.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
|
|
@@ -752,8 +752,8 @@ var he = { exports: {} };
|
|
|
752
752
|
t[r] = a[r];
|
|
753
753
|
delete t.rest;
|
|
754
754
|
}
|
|
755
|
-
var o = new
|
|
756
|
-
return O(o, o.head, e),
|
|
755
|
+
var o = new P();
|
|
756
|
+
return O(o, o.head, e), T(e, o, t, o.head, 0), M(o);
|
|
757
757
|
},
|
|
758
758
|
/**
|
|
759
759
|
* @namespace
|
|
@@ -805,8 +805,8 @@ var he = { exports: {} };
|
|
|
805
805
|
return t;
|
|
806
806
|
if (Array.isArray(t)) {
|
|
807
807
|
var r = "";
|
|
808
|
-
return t.forEach(function(
|
|
809
|
-
r += e(
|
|
808
|
+
return t.forEach(function(x) {
|
|
809
|
+
r += e(x, a);
|
|
810
810
|
}), r;
|
|
811
811
|
}
|
|
812
812
|
var o = {
|
|
@@ -816,72 +816,72 @@ var he = { exports: {} };
|
|
|
816
816
|
classes: ["token", t.type],
|
|
817
817
|
attributes: {},
|
|
818
818
|
language: a
|
|
819
|
-
},
|
|
820
|
-
|
|
821
|
-
var
|
|
822
|
-
for (var
|
|
823
|
-
|
|
824
|
-
return "<" + o.tag + ' class="' + o.classes.join(" ") + '"' +
|
|
819
|
+
}, d = t.alias;
|
|
820
|
+
d && (Array.isArray(d) ? Array.prototype.push.apply(o.classes, d) : o.classes.push(d)), s.hooks.run("wrap", o);
|
|
821
|
+
var f = "";
|
|
822
|
+
for (var c in o.attributes)
|
|
823
|
+
f += " " + c + '="' + (o.attributes[c] || "").replace(/"/g, """) + '"';
|
|
824
|
+
return "<" + o.tag + ' class="' + o.classes.join(" ") + '"' + f + ">" + o.content + "</" + o.tag + ">";
|
|
825
825
|
};
|
|
826
|
-
function
|
|
826
|
+
function b(e, t, a, r) {
|
|
827
827
|
e.lastIndex = t;
|
|
828
828
|
var o = e.exec(a);
|
|
829
829
|
if (o && r && o[1]) {
|
|
830
|
-
var
|
|
831
|
-
o.index +=
|
|
830
|
+
var d = o[1].length;
|
|
831
|
+
o.index += d, o[0] = o[0].slice(d);
|
|
832
832
|
}
|
|
833
833
|
return o;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
836
|
-
for (var
|
|
837
|
-
if (!(!a.hasOwnProperty(
|
|
838
|
-
var
|
|
839
|
-
|
|
840
|
-
for (var
|
|
841
|
-
if (
|
|
835
|
+
function T(e, t, a, r, o, d) {
|
|
836
|
+
for (var f in a)
|
|
837
|
+
if (!(!a.hasOwnProperty(f) || !a[f])) {
|
|
838
|
+
var c = a[f];
|
|
839
|
+
c = Array.isArray(c) ? c : [c];
|
|
840
|
+
for (var x = 0; x < c.length; ++x) {
|
|
841
|
+
if (d && d.cause == f + "," + x)
|
|
842
842
|
return;
|
|
843
|
-
var
|
|
844
|
-
if (
|
|
845
|
-
var
|
|
846
|
-
|
|
843
|
+
var F = c[x], D = F.inside, X = !!F.lookbehind, Z = !!F.greedy, ee = F.alias;
|
|
844
|
+
if (Z && !F.pattern.global) {
|
|
845
|
+
var Y = F.pattern.toString().match(/[imsuy]*$/)[0];
|
|
846
|
+
F.pattern = RegExp(F.pattern.source, Y + "g");
|
|
847
847
|
}
|
|
848
|
-
for (var
|
|
849
|
-
var
|
|
848
|
+
for (var K = F.pattern || F, R = r.next, $ = o; R !== t.tail && !(d && $ >= d.reach); $ += R.value.length, R = R.next) {
|
|
849
|
+
var G = R.value;
|
|
850
850
|
if (t.length > e.length)
|
|
851
851
|
return;
|
|
852
|
-
if (!(
|
|
853
|
-
var
|
|
854
|
-
if (
|
|
855
|
-
if (
|
|
852
|
+
if (!(G instanceof m)) {
|
|
853
|
+
var g = 1, u;
|
|
854
|
+
if (Z) {
|
|
855
|
+
if (u = b(K, $, e, X), !u || u.index >= e.length)
|
|
856
856
|
break;
|
|
857
|
-
var
|
|
858
|
-
for (
|
|
859
|
-
|
|
860
|
-
if (
|
|
857
|
+
var j = u.index, w = u.index + u[0].length, L = $;
|
|
858
|
+
for (L += R.value.length; j >= L; )
|
|
859
|
+
R = R.next, L += R.value.length;
|
|
860
|
+
if (L -= R.value.length, $ = L, R.value instanceof m)
|
|
861
861
|
continue;
|
|
862
|
-
for (var
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
} else if (
|
|
862
|
+
for (var B = R; B !== t.tail && (L < w || typeof B.value == "string"); B = B.next)
|
|
863
|
+
g++, L += B.value.length;
|
|
864
|
+
g--, G = e.slice($, L), u.index -= $;
|
|
865
|
+
} else if (u = b(K, 0, G, X), !u)
|
|
866
866
|
continue;
|
|
867
|
-
var
|
|
868
|
-
|
|
869
|
-
var q =
|
|
870
|
-
te && (q = O(t, q, te),
|
|
871
|
-
var
|
|
872
|
-
if (
|
|
867
|
+
var j = u.index, V = u[0], te = G.slice(0, j), ce = G.slice(j + V.length), ne = $ + G.length;
|
|
868
|
+
d && ne > d.reach && (d.reach = ne);
|
|
869
|
+
var q = R.prev;
|
|
870
|
+
te && (q = O(t, q, te), $ += te.length), C(t, q, g);
|
|
871
|
+
var be = new m(f, D ? s.tokenize(V, D) : V, ee, V);
|
|
872
|
+
if (R = O(t, q, be), ce && O(t, R, ce), g > 1) {
|
|
873
873
|
var ae = {
|
|
874
|
-
cause:
|
|
874
|
+
cause: f + "," + x,
|
|
875
875
|
reach: ne
|
|
876
876
|
};
|
|
877
|
-
|
|
877
|
+
T(e, t, a, R.prev, $, ae), d && ae.reach > d.reach && (d.reach = ae.reach);
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
|
-
function
|
|
884
|
+
function P() {
|
|
885
885
|
var e = { value: null, prev: null, next: null }, t = { value: null, prev: e, next: null };
|
|
886
886
|
e.next = t, this.head = e, this.tail = t, this.length = 0;
|
|
887
887
|
}
|
|
@@ -894,7 +894,7 @@ var he = { exports: {} };
|
|
|
894
894
|
r = r.next;
|
|
895
895
|
t.next = r, r.prev = t, e.length -= o;
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function M(e) {
|
|
898
898
|
for (var t = [], a = e.head.next; a !== e.tail; )
|
|
899
899
|
t.push(a.value), a = a.next;
|
|
900
900
|
return t;
|
|
@@ -906,15 +906,15 @@ var he = { exports: {} };
|
|
|
906
906
|
}, !1)), s;
|
|
907
907
|
var S = s.util.currentScript();
|
|
908
908
|
S && (s.filename = S.src, S.hasAttribute("data-manual") && (s.manual = !0));
|
|
909
|
-
function
|
|
909
|
+
function y() {
|
|
910
910
|
s.manual || s.highlightAll();
|
|
911
911
|
}
|
|
912
912
|
if (!s.manual) {
|
|
913
913
|
var h = document.readyState;
|
|
914
|
-
h === "loading" || h === "interactive" && S && S.defer ? document.addEventListener("DOMContentLoaded",
|
|
914
|
+
h === "loading" || h === "interactive" && S && S.defer ? document.addEventListener("DOMContentLoaded", y) : window.requestAnimationFrame ? window.requestAnimationFrame(y) : window.setTimeout(y, 16);
|
|
915
915
|
}
|
|
916
916
|
return s;
|
|
917
|
-
}(
|
|
917
|
+
}(p);
|
|
918
918
|
i.exports && (i.exports = n), typeof pe < "u" && (pe.Prism = n), n.languages.markup = {
|
|
919
919
|
comment: {
|
|
920
920
|
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
@@ -1006,12 +1006,12 @@ var he = { exports: {} };
|
|
|
1006
1006
|
* @example
|
|
1007
1007
|
* addInlined('style', 'css');
|
|
1008
1008
|
*/
|
|
1009
|
-
value: function(
|
|
1009
|
+
value: function(v, k) {
|
|
1010
1010
|
var A = {};
|
|
1011
|
-
A["language-" +
|
|
1011
|
+
A["language-" + k] = {
|
|
1012
1012
|
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
1013
1013
|
lookbehind: !0,
|
|
1014
|
-
inside: n.languages[
|
|
1014
|
+
inside: n.languages[k]
|
|
1015
1015
|
}, A.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
1016
1016
|
var s = {
|
|
1017
1017
|
"included-cdata": {
|
|
@@ -1019,14 +1019,14 @@ var he = { exports: {} };
|
|
|
1019
1019
|
inside: A
|
|
1020
1020
|
}
|
|
1021
1021
|
};
|
|
1022
|
-
s["language-" +
|
|
1022
|
+
s["language-" + k] = {
|
|
1023
1023
|
pattern: /[\s\S]+/,
|
|
1024
|
-
inside: n.languages[
|
|
1024
|
+
inside: n.languages[k]
|
|
1025
1025
|
};
|
|
1026
1026
|
var m = {};
|
|
1027
|
-
m[
|
|
1027
|
+
m[v] = {
|
|
1028
1028
|
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
1029
|
-
return
|
|
1029
|
+
return v;
|
|
1030
1030
|
}), "i"),
|
|
1031
1031
|
lookbehind: !0,
|
|
1032
1032
|
greedy: !0,
|
|
@@ -1045,7 +1045,7 @@ var he = { exports: {} };
|
|
|
1045
1045
|
* @example
|
|
1046
1046
|
* addAttribute('style', 'css');
|
|
1047
1047
|
*/
|
|
1048
|
-
value: function(l,
|
|
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 he = { exports: {} };
|
|
|
1060
1060
|
value: {
|
|
1061
1061
|
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
1062
1062
|
lookbehind: !0,
|
|
1063
|
-
alias: [
|
|
1064
|
-
inside: n.languages[
|
|
1063
|
+
alias: [v, "language-" + v],
|
|
1064
|
+
inside: n.languages[v]
|
|
1065
1065
|
},
|
|
1066
1066
|
punctuation: [
|
|
1067
1067
|
{
|
|
@@ -1076,11 +1076,11 @@ var he = { 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
|
|
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 + "|" +
|
|
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 he = { exports: {} };
|
|
|
1097
1097
|
},
|
|
1098
1098
|
url: {
|
|
1099
1099
|
// https://drafts.csswg.org/css-values-3/#urls
|
|
1100
|
-
pattern: RegExp("\\burl\\((?:" +
|
|
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("^" +
|
|
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{])|` +
|
|
1112
|
+
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + v.source + ")*(?=\\s*\\{)"),
|
|
1113
1113
|
lookbehind: !0
|
|
1114
1114
|
},
|
|
1115
1115
|
string: {
|
|
1116
|
-
pattern:
|
|
1116
|
+
pattern: v,
|
|
1117
1117
|
greedy: !0
|
|
1118
1118
|
},
|
|
1119
1119
|
property: {
|
|
@@ -1127,8 +1127,8 @@ var he = { exports: {} };
|
|
|
1127
1127
|
},
|
|
1128
1128
|
punctuation: /[(){};:,]/
|
|
1129
1129
|
}, l.languages.css.atrule.inside.rest = l.languages.css;
|
|
1130
|
-
var
|
|
1131
|
-
|
|
1130
|
+
var k = l.languages.markup;
|
|
1131
|
+
k && (k.tag.addInlined("style", "css"), k.tag.addAttribute("style", "css"));
|
|
1132
1132
|
}(n), n.languages.clike = {
|
|
1133
1133
|
comment: [
|
|
1134
1134
|
{
|
|
@@ -1293,9 +1293,9 @@ var he = { 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…",
|
|
1297
|
-
return "✖ Error " + S + " while fetching file: " +
|
|
1298
|
-
},
|
|
1296
|
+
var l = "Loading…", v = function(S, y) {
|
|
1297
|
+
return "✖ Error " + S + " while fetching file: " + y;
|
|
1298
|
+
}, k = "✖ 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 he = { exports: {} };
|
|
|
1305
1305
|
bat: "batch",
|
|
1306
1306
|
h: "c",
|
|
1307
1307
|
tex: "latex"
|
|
1308
|
-
}, s = "data-src-status", m = "loading",
|
|
1309
|
-
function O(S,
|
|
1308
|
+
}, s = "data-src-status", m = "loading", b = "loaded", T = "failed", P = "pre[data-src]:not([" + s + '="' + b + '"]):not([' + s + '="' + m + '"])';
|
|
1309
|
+
function O(S, y, h) {
|
|
1310
1310
|
var e = new XMLHttpRequest();
|
|
1311
1311
|
e.open("GET", S, !0), e.onreadystatechange = function() {
|
|
1312
|
-
e.readyState == 4 && (e.status < 400 && e.responseText ?
|
|
1312
|
+
e.readyState == 4 && (e.status < 400 && e.responseText ? y(e.responseText) : e.status >= 400 ? h(v(e.status, e.statusText)) : h(k));
|
|
1313
1313
|
}, e.send(null);
|
|
1314
1314
|
}
|
|
1315
1315
|
function C(S) {
|
|
1316
|
-
var
|
|
1317
|
-
if (
|
|
1318
|
-
var h = Number(
|
|
1316
|
+
var y = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(S || "");
|
|
1317
|
+
if (y) {
|
|
1318
|
+
var h = Number(y[1]), e = y[2], t = y[3];
|
|
1319
1319
|
return e ? t ? [h, Number(t)] : [h, void 0] : [h, h];
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
1322
|
n.hooks.add("before-highlightall", function(S) {
|
|
1323
|
-
S.selector += ", " +
|
|
1323
|
+
S.selector += ", " + P;
|
|
1324
1324
|
}), n.hooks.add("before-sanity-check", function(S) {
|
|
1325
|
-
var
|
|
1325
|
+
var y = (
|
|
1326
1326
|
/** @type {HTMLPreElement} */
|
|
1327
1327
|
S.element
|
|
1328
1328
|
);
|
|
1329
|
-
if (
|
|
1330
|
-
S.code = "",
|
|
1331
|
-
var h =
|
|
1329
|
+
if (y.matches(P)) {
|
|
1330
|
+
S.code = "", y.setAttribute(s, m);
|
|
1331
|
+
var h = y.appendChild(document.createElement("CODE"));
|
|
1332
1332
|
h.textContent = l;
|
|
1333
|
-
var e =
|
|
1333
|
+
var e = y.getAttribute("data-src"), t = S.language;
|
|
1334
1334
|
if (t === "none") {
|
|
1335
1335
|
var a = (/\.(\w+)$/.exec(e) || [, "none"])[1];
|
|
1336
1336
|
t = A[a] || a;
|
|
1337
1337
|
}
|
|
1338
|
-
n.util.setLanguage(h, t), n.util.setLanguage(
|
|
1338
|
+
n.util.setLanguage(h, t), n.util.setLanguage(y, t);
|
|
1339
1339
|
var r = n.plugins.autoloader;
|
|
1340
1340
|
r && r.loadLanguages(t), O(
|
|
1341
1341
|
e,
|
|
1342
1342
|
function(o) {
|
|
1343
|
-
|
|
1344
|
-
var
|
|
1345
|
-
if (
|
|
1346
|
-
var
|
|
1347
|
-
|
|
1348
|
-
`),
|
|
1343
|
+
y.setAttribute(s, b);
|
|
1344
|
+
var d = C(y.getAttribute("data-range"));
|
|
1345
|
+
if (d) {
|
|
1346
|
+
var f = o.split(/\r\n?|\n/g), c = d[0], x = d[1] == null ? f.length : d[1];
|
|
1347
|
+
c < 0 && (c += f.length), c = Math.max(0, Math.min(c - 1, f.length)), x < 0 && (x += f.length), x = Math.max(0, Math.min(x, f.length)), o = f.slice(c, x).join(`
|
|
1348
|
+
`), y.hasAttribute("data-start") || y.setAttribute("data-start", String(c + 1));
|
|
1349
1349
|
}
|
|
1350
1350
|
h.textContent = o, n.highlightElement(h);
|
|
1351
1351
|
},
|
|
1352
1352
|
function(o) {
|
|
1353
|
-
|
|
1353
|
+
y.setAttribute(s, T), h.textContent = o;
|
|
1354
1354
|
}
|
|
1355
1355
|
);
|
|
1356
1356
|
}
|
|
@@ -1362,19 +1362,19 @@ var he = { exports: {} };
|
|
|
1362
1362
|
*
|
|
1363
1363
|
* @param {ParentNode} [container=document]
|
|
1364
1364
|
*/
|
|
1365
|
-
highlight: function(
|
|
1366
|
-
for (var h = (
|
|
1365
|
+
highlight: function(y) {
|
|
1366
|
+
for (var h = (y || document).querySelectorAll(P), e = 0, t; t = h[e++]; )
|
|
1367
1367
|
n.highlightElement(t);
|
|
1368
1368
|
}
|
|
1369
1369
|
};
|
|
1370
|
-
var
|
|
1370
|
+
var M = !1;
|
|
1371
1371
|
n.fileHighlight = function() {
|
|
1372
|
-
|
|
1372
|
+
M || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), M = !0), n.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
1373
1373
|
};
|
|
1374
1374
|
}();
|
|
1375
|
-
})(
|
|
1376
|
-
var
|
|
1377
|
-
const se = /* @__PURE__ */
|
|
1375
|
+
})(me);
|
|
1376
|
+
var Me = me.exports;
|
|
1377
|
+
const se = /* @__PURE__ */ $e(Me);
|
|
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
|
|
1636
|
+
var p = /\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:
|
|
1672
|
+
keyword: p,
|
|
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:
|
|
1707
|
+
keyword: p,
|
|
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
|
|
1739
|
+
return p.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
|
|
1827
|
-
|
|
1828
|
-
return
|
|
1826
|
+
for (var p = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, n = 0; n < 2; n++)
|
|
1827
|
+
p = p.replace(/<self>/g, function() {
|
|
1828
|
+
return p;
|
|
1829
1829
|
});
|
|
1830
|
-
|
|
1830
|
+
p = p.replace(/<self>/g, function() {
|
|
1831
1831
|
return /[^\s\S]/.source;
|
|
1832
1832
|
}), i.languages.rust = {
|
|
1833
1833
|
comment: [
|
|
1834
1834
|
{
|
|
1835
|
-
pattern: RegExp(/(^|[^\\])/.source +
|
|
1835
|
+
pattern: RegExp(/(^|[^\\])/.source + p),
|
|
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
|
|
1975
|
+
var p = "\\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("\\$" +
|
|
1985
|
+
pattern: RegExp("\\$" + p),
|
|
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("(\\{)" +
|
|
2025
|
+
pattern: RegExp("(\\{)" + p),
|
|
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;|&]|[<>]\\()" +
|
|
2074
|
+
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + p),
|
|
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("\\$?" +
|
|
2130
|
+
pattern: RegExp("\\$?" + p),
|
|
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
|
|
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
|
-
],
|
|
2190
|
-
|
|
2189
|
+
], k = l.variable[1].inside, A = 0; A < v.length; A++)
|
|
2190
|
+
k[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
|
|
2218
|
+
const Ue = `
|
|
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 Me = `
|
|
|
2301
2301
|
.hep-cr-editor .token.console {
|
|
2302
2302
|
color: #f8f8f2 !important;
|
|
2303
2303
|
}
|
|
2304
|
-
`,
|
|
2304
|
+
`, Be = `
|
|
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 Me = `
|
|
|
2378
2378
|
.hep-cr-editor .token.console {
|
|
2379
2379
|
color: #333 !important;
|
|
2380
2380
|
}
|
|
2381
|
-
`,
|
|
2381
|
+
`, He = ["innerHTML"], Ge = ["value", "disabled"], ze = 500, je = /* @__PURE__ */ le({
|
|
2382
2382
|
__name: "CodeEditor",
|
|
2383
2383
|
props: {
|
|
2384
2384
|
modelValue: {},
|
|
@@ -2387,25 +2387,25 @@ const Me = `
|
|
|
2387
2387
|
disabled: { type: Boolean, default: !1 }
|
|
2388
2388
|
},
|
|
2389
2389
|
emits: ["update:modelValue", "change"],
|
|
2390
|
-
setup(i, { emit:
|
|
2391
|
-
|
|
2392
|
-
v2b19bab6:
|
|
2390
|
+
setup(i, { emit: p }) {
|
|
2391
|
+
ve((h) => ({
|
|
2392
|
+
v2b19bab6: P.value
|
|
2393
2393
|
})), typeof window < "u" && (window.Prism = se);
|
|
2394
2394
|
function n(h) {
|
|
2395
2395
|
if (typeof document > "u") return;
|
|
2396
|
-
const e = "hep-cr-prism-styles", t = document.getElementById(e), a = h === "dark" ?
|
|
2396
|
+
const e = "hep-cr-prism-styles", t = document.getElementById(e), a = h === "dark" ? Ue : Be;
|
|
2397
2397
|
t && t.remove();
|
|
2398
2398
|
const r = document.createElement("style");
|
|
2399
2399
|
r.id = e, r.textContent = a, document.head.appendChild(r);
|
|
2400
2400
|
}
|
|
2401
|
-
const l = i,
|
|
2401
|
+
const l = i, v = p, k = N(null), A = N(null);
|
|
2402
2402
|
let s = null;
|
|
2403
2403
|
function m(h) {
|
|
2404
2404
|
s && clearTimeout(s), s = setTimeout(() => {
|
|
2405
|
-
|
|
2406
|
-
},
|
|
2405
|
+
v("change", h);
|
|
2406
|
+
}, ze);
|
|
2407
2407
|
}
|
|
2408
|
-
const
|
|
2408
|
+
const b = {
|
|
2409
2409
|
javascript: "javascript",
|
|
2410
2410
|
js: "javascript",
|
|
2411
2411
|
typescript: "typescript",
|
|
@@ -2436,11 +2436,11 @@ const Me = `
|
|
|
2436
2436
|
yml: "yaml",
|
|
2437
2437
|
markdown: "markdown",
|
|
2438
2438
|
md: "markdown"
|
|
2439
|
-
},
|
|
2439
|
+
}, T = H(() => b[l.language.toLowerCase()] || "javascript"), P = H(() => l.theme === "dark" ? "#1e1e1e" : "#fafafa"), O = H(() => {
|
|
2440
2440
|
try {
|
|
2441
|
-
const h = se.languages[
|
|
2441
|
+
const h = se.languages[T.value];
|
|
2442
2442
|
if (h)
|
|
2443
|
-
return se.highlight(l.modelValue || "", h,
|
|
2443
|
+
return se.highlight(l.modelValue || "", h, T.value);
|
|
2444
2444
|
} catch {
|
|
2445
2445
|
}
|
|
2446
2446
|
return C(l.modelValue || "");
|
|
@@ -2449,66 +2449,66 @@ const Me = `
|
|
|
2449
2449
|
const e = document.createElement("div");
|
|
2450
2450
|
return e.textContent = h, e.innerHTML;
|
|
2451
2451
|
}
|
|
2452
|
-
function
|
|
2452
|
+
function M(h) {
|
|
2453
2453
|
const e = h.target;
|
|
2454
|
-
|
|
2454
|
+
v("update:modelValue", e.value), m(e.value);
|
|
2455
2455
|
}
|
|
2456
2456
|
function S() {
|
|
2457
|
-
|
|
2457
|
+
k.value && A.value && (A.value.scrollTop = k.value.scrollTop, A.value.scrollLeft = k.value.scrollLeft);
|
|
2458
2458
|
}
|
|
2459
|
-
function
|
|
2459
|
+
function y(h) {
|
|
2460
2460
|
if (h.key === "Tab") {
|
|
2461
2461
|
h.preventDefault();
|
|
2462
2462
|
const e = h.target, t = e.selectionStart, a = e.selectionEnd, r = e.value;
|
|
2463
|
-
e.value = r.substring(0, t) + " " + r.substring(a), e.selectionStart = e.selectionEnd = t + 2,
|
|
2463
|
+
e.value = r.substring(0, t) + " " + r.substring(a), e.selectionStart = e.selectionEnd = t + 2, v("update:modelValue", e.value), m(e.value);
|
|
2464
2464
|
}
|
|
2465
2465
|
}
|
|
2466
|
-
return
|
|
2466
|
+
return he(() => {
|
|
2467
2467
|
n(l.theme);
|
|
2468
2468
|
}), ue(() => l.theme, (h) => {
|
|
2469
2469
|
n(h);
|
|
2470
|
-
}),
|
|
2470
|
+
}), Ee(() => {
|
|
2471
2471
|
s && clearTimeout(s);
|
|
2472
2472
|
}), (h, e) => (_(), I("div", {
|
|
2473
|
-
class:
|
|
2473
|
+
class: W(["hep-cr-editor", `hep-cr-theme-${i.theme}`])
|
|
2474
2474
|
}, [
|
|
2475
|
-
|
|
2475
|
+
E("pre", {
|
|
2476
2476
|
ref_key: "highlightRef",
|
|
2477
2477
|
ref: A,
|
|
2478
|
-
class:
|
|
2478
|
+
class: W(["hep-cr-highlight", [`language-${T.value}`, `hep-cr-prism-${i.theme}`]]),
|
|
2479
2479
|
"aria-hidden": "true"
|
|
2480
2480
|
}, [
|
|
2481
|
-
|
|
2481
|
+
E("code", { innerHTML: O.value }, null, 8, He)
|
|
2482
2482
|
], 2),
|
|
2483
|
-
|
|
2483
|
+
E("textarea", {
|
|
2484
2484
|
ref_key: "codeRef",
|
|
2485
|
-
ref:
|
|
2485
|
+
ref: k,
|
|
2486
2486
|
class: "hep-cr-input",
|
|
2487
2487
|
value: i.modelValue,
|
|
2488
2488
|
disabled: i.disabled,
|
|
2489
|
-
onInput:
|
|
2489
|
+
onInput: M,
|
|
2490
2490
|
onScroll: S,
|
|
2491
|
-
onKeydown:
|
|
2491
|
+
onKeydown: y,
|
|
2492
2492
|
spellcheck: "false",
|
|
2493
2493
|
placeholder: "Write your code here..."
|
|
2494
|
-
}, null, 40,
|
|
2494
|
+
}, null, 40, Ge)
|
|
2495
2495
|
], 2));
|
|
2496
2496
|
}
|
|
2497
|
-
}),
|
|
2497
|
+
}), fe = (i, p) => {
|
|
2498
2498
|
const n = i.__vccOpts || i;
|
|
2499
|
-
for (const [l,
|
|
2500
|
-
n[l] =
|
|
2499
|
+
for (const [l, v] of p)
|
|
2500
|
+
n[l] = v;
|
|
2501
2501
|
return n;
|
|
2502
|
-
},
|
|
2502
|
+
}, We = /* @__PURE__ */ fe(je, [["__scopeId", "data-v-a988ca2a"]]), Ve = { class: "hep-cr-header" }, Ye = { class: "hep-cr-controls" }, Xe = ["disabled"], Ze = {
|
|
2503
2503
|
key: 0,
|
|
2504
2504
|
value: ""
|
|
2505
|
-
},
|
|
2505
|
+
}, Ke = ["value"], qe = ["disabled"], Je = { class: "hep-cr-actions" }, Qe = ["disabled"], et = {
|
|
2506
2506
|
key: 0,
|
|
2507
2507
|
class: "hep-cr-spinner"
|
|
2508
|
-
},
|
|
2508
|
+
}, tt = {
|
|
2509
2509
|
key: 1,
|
|
2510
2510
|
class: "hep-cr-run-icon"
|
|
2511
|
-
},
|
|
2511
|
+
}, nt = ["title"], at = {
|
|
2512
2512
|
key: 0,
|
|
2513
2513
|
width: "16",
|
|
2514
2514
|
height: "16",
|
|
@@ -2516,7 +2516,7 @@ const Me = `
|
|
|
2516
2516
|
fill: "none",
|
|
2517
2517
|
stroke: "currentColor",
|
|
2518
2518
|
"stroke-width": "2"
|
|
2519
|
-
},
|
|
2519
|
+
}, rt = {
|
|
2520
2520
|
key: 1,
|
|
2521
2521
|
width: "16",
|
|
2522
2522
|
height: "16",
|
|
@@ -2524,10 +2524,10 @@ const Me = `
|
|
|
2524
2524
|
fill: "none",
|
|
2525
2525
|
stroke: "currentColor",
|
|
2526
2526
|
"stroke-width": "2"
|
|
2527
|
-
},
|
|
2527
|
+
}, ot = {
|
|
2528
2528
|
key: 0,
|
|
2529
2529
|
class: "hep-cr-error"
|
|
2530
|
-
},
|
|
2530
|
+
}, st = { class: "hep-cr-main" }, it = { class: "hep-cr-panel-header" }, lt = { class: "hep-cr-output-actions" }, ut = { class: "hep-cr-language-badge" }, ct = ["disabled", "title"], dt = {
|
|
2531
2531
|
key: 0,
|
|
2532
2532
|
width: "14",
|
|
2533
2533
|
height: "14",
|
|
@@ -2535,13 +2535,13 @@ const Me = `
|
|
|
2535
2535
|
fill: "none",
|
|
2536
2536
|
stroke: "currentColor",
|
|
2537
2537
|
"stroke-width": "2"
|
|
2538
|
-
},
|
|
2538
|
+
}, pt = {
|
|
2539
2539
|
key: 1,
|
|
2540
2540
|
class: "hep-cr-copied-text"
|
|
2541
|
-
},
|
|
2541
|
+
}, gt = { class: "hep-cr-panel-header" }, ht = { class: "hep-cr-output-tabs" }, mt = { class: "hep-cr-output-actions" }, ft = {
|
|
2542
2542
|
key: 0,
|
|
2543
2543
|
class: "hep-cr-execution-time"
|
|
2544
|
-
},
|
|
2544
|
+
}, bt = ["disabled", "title"], vt = {
|
|
2545
2545
|
key: 0,
|
|
2546
2546
|
width: "14",
|
|
2547
2547
|
height: "14",
|
|
@@ -2549,13 +2549,13 @@ const Me = `
|
|
|
2549
2549
|
fill: "none",
|
|
2550
2550
|
stroke: "currentColor",
|
|
2551
2551
|
"stroke-width": "2"
|
|
2552
|
-
},
|
|
2552
|
+
}, Et = {
|
|
2553
2553
|
key: 1,
|
|
2554
2554
|
class: "hep-cr-copied-text"
|
|
2555
|
-
},
|
|
2555
|
+
}, yt = { class: "hep-cr-output-content" }, At = { key: 0 }, St = {
|
|
2556
2556
|
key: 1,
|
|
2557
2557
|
class: "hep-cr-stderr"
|
|
2558
|
-
},
|
|
2558
|
+
}, ge = "hep-cr-default-language", kt = /* @__PURE__ */ le({
|
|
2559
2559
|
__name: "CodeRunner",
|
|
2560
2560
|
props: {
|
|
2561
2561
|
pistonUrl: { default: "/api/piston" },
|
|
@@ -2569,64 +2569,70 @@ const Me = `
|
|
|
2569
2569
|
executorLabel: { default: "运行" }
|
|
2570
2570
|
},
|
|
2571
2571
|
emits: ["execute-start", "execute-end", "language-change", "change"],
|
|
2572
|
-
setup(i, { emit:
|
|
2573
|
-
const n = i, l =
|
|
2572
|
+
setup(i, { emit: p }) {
|
|
2573
|
+
const n = i, l = H(() => {
|
|
2574
2574
|
if (!n.themeColor) return {};
|
|
2575
|
-
const
|
|
2575
|
+
const g = n.theme === "dark", u = n.themeColor, L = v(u) ? "#000" : "#fff";
|
|
2576
2576
|
return {
|
|
2577
|
-
"--hep-cr-theme-color":
|
|
2578
|
-
"--hep-cr-theme-color-hover":
|
|
2579
|
-
"--hep-cr-tab-active-color":
|
|
2577
|
+
"--hep-cr-theme-color": u,
|
|
2578
|
+
"--hep-cr-theme-color-hover": g ? k(u, 20) : k(u, -20),
|
|
2579
|
+
"--hep-cr-tab-active-color": L
|
|
2580
2580
|
};
|
|
2581
2581
|
});
|
|
2582
|
-
function
|
|
2583
|
-
const
|
|
2584
|
-
return (0.299 *
|
|
2582
|
+
function v(g) {
|
|
2583
|
+
const u = parseInt(g.replace("#", ""), 16), w = u >> 16 & 255, L = u >> 8 & 255, B = u & 255;
|
|
2584
|
+
return (0.299 * w + 0.587 * L + 0.114 * B) / 255 > 0.5;
|
|
2585
2585
|
}
|
|
2586
|
-
function
|
|
2587
|
-
const
|
|
2588
|
-
return "#" + (16777216 +
|
|
2586
|
+
function k(g, u) {
|
|
2587
|
+
const w = parseInt(g.replace("#", ""), 16), L = Math.round(2.55 * u), B = Math.min(255, Math.max(0, (w >> 16) + L)), j = Math.min(255, Math.max(0, (w >> 8 & 255) + L)), V = Math.min(255, Math.max(0, (w & 255) + L));
|
|
2588
|
+
return "#" + (16777216 + B * 65536 + j * 256 + V).toString(16).slice(1);
|
|
2589
2589
|
}
|
|
2590
|
-
const A =
|
|
2590
|
+
const A = p, s = N([]), m = N(t()), b = N(n.theme), T = N(""), P = N(""), O = N(""), C = N(!1), M = N(null), S = N("stdout"), y = N(null), h = N(!1), e = N(60);
|
|
2591
2591
|
function t() {
|
|
2592
|
-
|
|
2592
|
+
return typeof window > "u" ? n.language : localStorage.getItem(ge) || n.language;
|
|
2593
2593
|
}
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
}
|
|
2600
|
-
|
|
2601
|
-
|
|
2594
|
+
function a() {
|
|
2595
|
+
typeof window < "u" && localStorage.setItem(ge, m.value);
|
|
2596
|
+
}
|
|
2597
|
+
function r() {
|
|
2598
|
+
b.value = b.value === "light" ? "dark" : "light";
|
|
2599
|
+
}
|
|
2600
|
+
const o = H(
|
|
2601
|
+
() => new De({ pistonUrl: n.pistonUrl })
|
|
2602
|
+
), d = H(() => s.value.map((g) => ({
|
|
2603
|
+
value: `${g.language}:${g.version}`,
|
|
2604
|
+
label: `${g.language.charAt(0).toUpperCase() + g.language.slice(1)} ${g.version}`
|
|
2605
|
+
}))), f = H(() => {
|
|
2606
|
+
const g = m.value;
|
|
2607
|
+
return g.includes(":") ? g.split(":")[0] : g;
|
|
2602
2608
|
});
|
|
2603
2609
|
async function c() {
|
|
2604
|
-
h.value = !0,
|
|
2610
|
+
h.value = !0, y.value = null;
|
|
2605
2611
|
try {
|
|
2606
|
-
s.value = await
|
|
2607
|
-
const
|
|
2608
|
-
|
|
2609
|
-
} catch (
|
|
2610
|
-
|
|
2612
|
+
s.value = await o.value.getRuntimes();
|
|
2613
|
+
const g = m.value.split(":")[0], u = s.value.find((w) => w.language === g);
|
|
2614
|
+
u && !m.value.includes(":") && (m.value = `${g}:${u.version}`), A("language-change", g, T.value);
|
|
2615
|
+
} catch (g) {
|
|
2616
|
+
y.value = g instanceof Error ? g.message : "Failed to load runtimes";
|
|
2611
2617
|
} finally {
|
|
2612
2618
|
h.value = !1;
|
|
2613
2619
|
}
|
|
2614
2620
|
}
|
|
2615
|
-
ue(m, (
|
|
2616
|
-
const
|
|
2617
|
-
|
|
2621
|
+
ue(m, (g) => {
|
|
2622
|
+
const u = g.includes(":") ? g.split(":")[0] : g, w = oe(u);
|
|
2623
|
+
T.value = w, A("language-change", u, w);
|
|
2618
2624
|
});
|
|
2619
|
-
async function
|
|
2625
|
+
async function x() {
|
|
2620
2626
|
if (!C.value) {
|
|
2621
|
-
C.value = !0,
|
|
2627
|
+
C.value = !0, P.value = "", O.value = "", M.value = null, y.value = null, S.value = "stdout", A("execute-start");
|
|
2622
2628
|
try {
|
|
2623
|
-
const
|
|
2624
|
-
|
|
2625
|
-
} catch (
|
|
2626
|
-
|
|
2629
|
+
const g = await o.value.execute(f.value, T.value);
|
|
2630
|
+
P.value = g.output, O.value = g.stderr, M.value = g.executionTime || null, S.value = g.stderr ? "stderr" : "stdout", A("execute-end", g);
|
|
2631
|
+
} catch (g) {
|
|
2632
|
+
y.value = g instanceof Error ? g.message : "Execution failed", A("execute-end", {
|
|
2627
2633
|
success: !1,
|
|
2628
2634
|
output: "",
|
|
2629
|
-
stderr:
|
|
2635
|
+
stderr: y.value,
|
|
2630
2636
|
code: -1
|
|
2631
2637
|
});
|
|
2632
2638
|
} finally {
|
|
@@ -2634,108 +2640,114 @@ const Me = `
|
|
|
2634
2640
|
}
|
|
2635
2641
|
}
|
|
2636
2642
|
}
|
|
2637
|
-
const
|
|
2638
|
-
async function
|
|
2639
|
-
await navigator.clipboard.writeText(
|
|
2640
|
-
|
|
2643
|
+
const F = N(!1), D = N(!1);
|
|
2644
|
+
async function X() {
|
|
2645
|
+
await navigator.clipboard.writeText(T.value), F.value = !0, setTimeout(() => {
|
|
2646
|
+
F.value = !1;
|
|
2641
2647
|
}, 2e3);
|
|
2642
2648
|
}
|
|
2643
|
-
async function
|
|
2644
|
-
const
|
|
2645
|
-
await navigator.clipboard.writeText(
|
|
2646
|
-
|
|
2649
|
+
async function Z() {
|
|
2650
|
+
const g = S.value === "stdout" ? P.value : O.value;
|
|
2651
|
+
await navigator.clipboard.writeText(g), D.value = !0, setTimeout(() => {
|
|
2652
|
+
D.value = !1;
|
|
2647
2653
|
}, 2e3);
|
|
2648
2654
|
}
|
|
2649
|
-
function
|
|
2650
|
-
|
|
2655
|
+
function ee() {
|
|
2656
|
+
T.value = oe(f.value);
|
|
2651
2657
|
}
|
|
2652
|
-
let
|
|
2653
|
-
function
|
|
2654
|
-
|
|
2658
|
+
let Y = !1;
|
|
2659
|
+
function K(g) {
|
|
2660
|
+
Y = !0, document.addEventListener("mousemove", R), document.addEventListener("mouseup", $), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
2655
2661
|
}
|
|
2656
|
-
function
|
|
2657
|
-
if (!
|
|
2658
|
-
const
|
|
2662
|
+
function R(g) {
|
|
2663
|
+
if (!Y) return;
|
|
2664
|
+
const u = document.querySelector(
|
|
2659
2665
|
".hep-cr-main"
|
|
2660
2666
|
);
|
|
2661
|
-
if (!
|
|
2662
|
-
const
|
|
2663
|
-
e.value = Math.max(20, Math.min(80,
|
|
2667
|
+
if (!u) return;
|
|
2668
|
+
const w = u.getBoundingClientRect(), L = (g.clientX - w.left) / w.width * 100;
|
|
2669
|
+
e.value = Math.max(20, Math.min(80, L));
|
|
2664
2670
|
}
|
|
2665
|
-
function
|
|
2666
|
-
|
|
2671
|
+
function $() {
|
|
2672
|
+
Y = !1, document.removeEventListener("mousemove", R), document.removeEventListener("mouseup", $), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
2667
2673
|
}
|
|
2668
|
-
|
|
2669
|
-
await c(),
|
|
2674
|
+
he(async () => {
|
|
2675
|
+
await c(), T.value || (T.value = n.defaultCode || oe(m.value), A("change", T.value));
|
|
2670
2676
|
});
|
|
2671
|
-
const
|
|
2672
|
-
return (
|
|
2673
|
-
class:
|
|
2677
|
+
const G = H(() => `hep-cr-runner-${b.value}`);
|
|
2678
|
+
return (g, u) => (_(), I("div", {
|
|
2679
|
+
class: W(["hep-cr-runner", G.value]),
|
|
2674
2680
|
style: J(l.value)
|
|
2675
2681
|
}, [
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
i.showLanguageSelector ?
|
|
2682
|
+
E("div", Ve, [
|
|
2683
|
+
E("div", Ye, [
|
|
2684
|
+
i.showLanguageSelector ? ye((_(), I("select", {
|
|
2679
2685
|
key: 0,
|
|
2680
|
-
"onUpdate:modelValue":
|
|
2686
|
+
"onUpdate:modelValue": u[0] || (u[0] = (w) => m.value = w),
|
|
2681
2687
|
class: "hep-cr-language-select",
|
|
2682
2688
|
disabled: C.value
|
|
2683
2689
|
}, [
|
|
2684
|
-
h.value ? (_(), I("option",
|
|
2685
|
-
(_(!0), I(
|
|
2686
|
-
key:
|
|
2687
|
-
value:
|
|
2688
|
-
},
|
|
2689
|
-
], 8,
|
|
2690
|
+
h.value ? (_(), I("option", Ze, "加载中...")) : U("", !0),
|
|
2691
|
+
(_(!0), I(Ae, null, Se(d.value, (w) => (_(), I("option", {
|
|
2692
|
+
key: w.value,
|
|
2693
|
+
value: w.value
|
|
2694
|
+
}, z(w.label), 9, Ke))), 128))
|
|
2695
|
+
], 8, Xe)), [
|
|
2690
2696
|
[ke, m.value]
|
|
2691
|
-
]) : U("", !0)
|
|
2697
|
+
]) : U("", !0),
|
|
2698
|
+
E("button", {
|
|
2699
|
+
class: "hep-cr-btn hep-cr-btn-set-default",
|
|
2700
|
+
disabled: C.value,
|
|
2701
|
+
onClick: a,
|
|
2702
|
+
title: "设为默认语言"
|
|
2703
|
+
}, " ★ ", 8, qe)
|
|
2692
2704
|
]),
|
|
2693
|
-
|
|
2694
|
-
|
|
2705
|
+
E("div", Je, [
|
|
2706
|
+
E("button", {
|
|
2695
2707
|
class: "hep-cr-btn hep-cr-btn-run",
|
|
2696
2708
|
disabled: C.value || h.value,
|
|
2697
|
-
onClick:
|
|
2709
|
+
onClick: x
|
|
2698
2710
|
}, [
|
|
2699
|
-
C.value ? (_(), I("span",
|
|
2700
|
-
|
|
2701
|
-
], 8,
|
|
2711
|
+
C.value ? (_(), I("span", et)) : (_(), I("span", tt, "▶")),
|
|
2712
|
+
we(" " + z(C.value ? "运行中..." : i.executorLabel), 1)
|
|
2713
|
+
], 8, Qe),
|
|
2702
2714
|
i.showEditor && i.editable ? (_(), I("button", {
|
|
2703
2715
|
key: 0,
|
|
2704
2716
|
class: "hep-cr-btn hep-cr-btn-reset",
|
|
2705
|
-
onClick:
|
|
2717
|
+
onClick: ee
|
|
2706
2718
|
}, " 重置 ")) : U("", !0),
|
|
2707
|
-
|
|
2719
|
+
E("button", {
|
|
2708
2720
|
class: "hep-cr-btn hep-cr-btn-theme",
|
|
2709
|
-
onClick:
|
|
2710
|
-
title:
|
|
2721
|
+
onClick: r,
|
|
2722
|
+
title: b.value === "light" ? "Switch to dark mode" : "Switch to light mode"
|
|
2711
2723
|
}, [
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
])])) : (_(), I("svg",
|
|
2715
|
-
|
|
2724
|
+
b.value === "light" ? (_(), I("svg", at, [...u[5] || (u[5] = [
|
|
2725
|
+
E("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)
|
|
2726
|
+
])])) : (_(), I("svg", rt, [...u[6] || (u[6] = [
|
|
2727
|
+
Te('<circle cx="12" cy="12" r="5" data-v-d9748673></circle><line x1="12" y1="1" x2="12" y2="3" data-v-d9748673></line><line x1="12" y1="21" x2="12" y2="23" data-v-d9748673></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64" data-v-d9748673></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78" data-v-d9748673></line><line x1="1" y1="12" x2="3" y2="12" data-v-d9748673></line><line x1="21" y1="12" x2="23" y2="12" data-v-d9748673></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36" data-v-d9748673></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22" data-v-d9748673></line>', 9)
|
|
2716
2728
|
])]))
|
|
2717
|
-
], 8,
|
|
2729
|
+
], 8, nt)
|
|
2718
2730
|
])
|
|
2719
2731
|
]),
|
|
2720
|
-
|
|
2721
|
-
|
|
2732
|
+
y.value ? (_(), I("div", ot, z(y.value), 1)) : U("", !0),
|
|
2733
|
+
E("div", st, [
|
|
2722
2734
|
i.showEditor ? (_(), I("div", {
|
|
2723
2735
|
key: 0,
|
|
2724
2736
|
class: "hep-cr-editor-panel",
|
|
2725
2737
|
style: J({ width: e.value + "%" })
|
|
2726
2738
|
}, [
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
class:
|
|
2733
|
-
disabled:
|
|
2734
|
-
onClick:
|
|
2735
|
-
title:
|
|
2739
|
+
E("div", it, [
|
|
2740
|
+
u[8] || (u[8] = E("span", { class: "hep-cr-panel-title" }, "编辑器", -1)),
|
|
2741
|
+
E("div", lt, [
|
|
2742
|
+
E("span", ut, z(f.value), 1),
|
|
2743
|
+
E("button", {
|
|
2744
|
+
class: W(["hep-cr-btn-icon", { "hep-cr-btn-copied": F.value }]),
|
|
2745
|
+
disabled: F.value,
|
|
2746
|
+
onClick: X,
|
|
2747
|
+
title: F.value ? "已复制" : "复制"
|
|
2736
2748
|
}, [
|
|
2737
|
-
|
|
2738
|
-
|
|
2749
|
+
F.value ? (_(), I("span", pt, "已复制")) : (_(), I("svg", dt, [...u[7] || (u[7] = [
|
|
2750
|
+
E("rect", {
|
|
2739
2751
|
x: "9",
|
|
2740
2752
|
y: "9",
|
|
2741
2753
|
width: "13",
|
|
@@ -2743,53 +2755,53 @@ const Me = `
|
|
|
2743
2755
|
rx: "2",
|
|
2744
2756
|
ry: "2"
|
|
2745
2757
|
}, null, -1),
|
|
2746
|
-
|
|
2758
|
+
E("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
|
|
2747
2759
|
])]))
|
|
2748
|
-
], 10,
|
|
2760
|
+
], 10, ct)
|
|
2749
2761
|
])
|
|
2750
2762
|
]),
|
|
2751
|
-
ie(
|
|
2752
|
-
modelValue:
|
|
2753
|
-
"onUpdate:modelValue":
|
|
2754
|
-
language:
|
|
2755
|
-
theme:
|
|
2763
|
+
ie(We, {
|
|
2764
|
+
modelValue: T.value,
|
|
2765
|
+
"onUpdate:modelValue": u[1] || (u[1] = (w) => T.value = w),
|
|
2766
|
+
language: f.value,
|
|
2767
|
+
theme: b.value,
|
|
2756
2768
|
disabled: !i.editable || C.value,
|
|
2757
|
-
onChange:
|
|
2769
|
+
onChange: u[2] || (u[2] = (w) => A("change", w))
|
|
2758
2770
|
}, null, 8, ["modelValue", "language", "theme", "disabled"])
|
|
2759
2771
|
], 4)) : U("", !0),
|
|
2760
2772
|
i.showEditor ? (_(), I("div", {
|
|
2761
2773
|
key: 1,
|
|
2762
2774
|
class: "hep-cr-resize-handle",
|
|
2763
|
-
onMousedown:
|
|
2764
|
-
}, [...
|
|
2765
|
-
|
|
2775
|
+
onMousedown: K
|
|
2776
|
+
}, [...u[9] || (u[9] = [
|
|
2777
|
+
E("div", { class: "hep-cr-resize-line" }, null, -1)
|
|
2766
2778
|
])], 32)) : U("", !0),
|
|
2767
|
-
|
|
2779
|
+
E("div", {
|
|
2768
2780
|
class: "hep-cr-output-panel",
|
|
2769
2781
|
style: J({ width: i.showEditor ? 100 - e.value + "%" : "100%" })
|
|
2770
2782
|
}, [
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
class:
|
|
2775
|
-
onClick:
|
|
2783
|
+
E("div", gt, [
|
|
2784
|
+
E("div", ht, [
|
|
2785
|
+
E("button", {
|
|
2786
|
+
class: W(["hep-cr-tab", { active: S.value === "stdout" }]),
|
|
2787
|
+
onClick: u[3] || (u[3] = (w) => S.value = "stdout")
|
|
2776
2788
|
}, " 输出 ", 2),
|
|
2777
2789
|
O.value ? (_(), I("button", {
|
|
2778
2790
|
key: 0,
|
|
2779
|
-
class:
|
|
2780
|
-
onClick:
|
|
2791
|
+
class: W(["hep-cr-tab", "hep-cr-tab-error", { active: S.value === "stderr" }]),
|
|
2792
|
+
onClick: u[4] || (u[4] = (w) => S.value = "stderr")
|
|
2781
2793
|
}, " 错误 ", 2)) : U("", !0)
|
|
2782
2794
|
]),
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
class:
|
|
2787
|
-
disabled:
|
|
2788
|
-
onClick:
|
|
2789
|
-
title:
|
|
2795
|
+
E("div", mt, [
|
|
2796
|
+
M.value !== null ? (_(), I("span", ft, z(M.value) + "ms ", 1)) : U("", !0),
|
|
2797
|
+
E("button", {
|
|
2798
|
+
class: W(["hep-cr-btn-icon", { "hep-cr-btn-copied": D.value }]),
|
|
2799
|
+
disabled: D.value,
|
|
2800
|
+
onClick: Z,
|
|
2801
|
+
title: D.value ? "已复制" : "复制"
|
|
2790
2802
|
}, [
|
|
2791
|
-
|
|
2792
|
-
|
|
2803
|
+
D.value ? (_(), I("span", Et, "已复制")) : (_(), I("svg", vt, [...u[10] || (u[10] = [
|
|
2804
|
+
E("rect", {
|
|
2793
2805
|
x: "9",
|
|
2794
2806
|
y: "9",
|
|
2795
2807
|
width: "13",
|
|
@@ -2797,22 +2809,22 @@ const Me = `
|
|
|
2797
2809
|
rx: "2",
|
|
2798
2810
|
ry: "2"
|
|
2799
2811
|
}, null, -1),
|
|
2800
|
-
|
|
2812
|
+
E("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
|
|
2801
2813
|
])]))
|
|
2802
|
-
], 10,
|
|
2814
|
+
], 10, bt)
|
|
2803
2815
|
])
|
|
2804
2816
|
]),
|
|
2805
|
-
|
|
2806
|
-
S.value === "stdout" ? (_(), I("pre",
|
|
2817
|
+
E("div", yt, [
|
|
2818
|
+
S.value === "stdout" ? (_(), I("pre", At, z(C.value ? "代码执行中..." : P.value || '点击"运行"执行代码'), 1)) : (_(), I("pre", St, z(O.value), 1))
|
|
2807
2819
|
])
|
|
2808
2820
|
], 4)
|
|
2809
2821
|
])
|
|
2810
2822
|
], 6));
|
|
2811
2823
|
}
|
|
2812
|
-
}), Q = /* @__PURE__ */
|
|
2824
|
+
}), Q = /* @__PURE__ */ fe(kt, [["__scopeId", "data-v-d9748673"]]), wt = { class: "hep-cr-dialog-header" }, Tt = { class: "hep-cr-dialog-title" }, _t = { class: "hep-cr-dialog-body" }, xt = {
|
|
2813
2825
|
key: 0,
|
|
2814
2826
|
class: "hep-cr-dialog-footer"
|
|
2815
|
-
},
|
|
2827
|
+
}, Ft = /* @__PURE__ */ le({
|
|
2816
2828
|
__name: "CodeRunnerDialog",
|
|
2817
2829
|
props: {
|
|
2818
2830
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -2829,41 +2841,41 @@ const Me = `
|
|
|
2829
2841
|
executorLabel: { default: "运行" }
|
|
2830
2842
|
},
|
|
2831
2843
|
emits: ["update:modelValue", "close", "change"],
|
|
2832
|
-
setup(i, { expose:
|
|
2833
|
-
const l = i,
|
|
2844
|
+
setup(i, { expose: p, emit: n }) {
|
|
2845
|
+
const l = i, v = n, k = N(l.modelValue), A = H(() => l.modelValue !== void 0 ? l.modelValue : k.value);
|
|
2834
2846
|
ue(
|
|
2835
2847
|
() => l.modelValue,
|
|
2836
|
-
(
|
|
2837
|
-
|
|
2848
|
+
(b) => {
|
|
2849
|
+
b !== void 0 && (k.value = b);
|
|
2838
2850
|
}
|
|
2839
2851
|
);
|
|
2840
2852
|
function s() {
|
|
2841
|
-
|
|
2853
|
+
k.value = !1, v("update:modelValue", !1), v("close");
|
|
2842
2854
|
}
|
|
2843
|
-
function m(
|
|
2844
|
-
|
|
2855
|
+
function m(b) {
|
|
2856
|
+
b.target === b.currentTarget && s();
|
|
2845
2857
|
}
|
|
2846
|
-
return
|
|
2858
|
+
return p({
|
|
2847
2859
|
close: s
|
|
2848
|
-
}), (
|
|
2849
|
-
ie(
|
|
2850
|
-
default:
|
|
2860
|
+
}), (b, T) => (_(), _e(xe, { to: "body" }, [
|
|
2861
|
+
ie(Ie, { name: "hep-cr-dialog-fade" }, {
|
|
2862
|
+
default: Fe(() => [
|
|
2851
2863
|
A.value ? (_(), I("div", {
|
|
2852
2864
|
key: 0,
|
|
2853
2865
|
class: "hep-cr-dialog-overlay",
|
|
2854
2866
|
onClick: m
|
|
2855
2867
|
}, [
|
|
2856
|
-
|
|
2868
|
+
E("div", {
|
|
2857
2869
|
class: "hep-cr-dialog-container",
|
|
2858
2870
|
style: J({ width: typeof i.width == "number" ? i.width + "px" : i.width })
|
|
2859
2871
|
}, [
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2872
|
+
E("div", wt, [
|
|
2873
|
+
E("h3", Tt, z(i.title), 1),
|
|
2874
|
+
E("button", {
|
|
2863
2875
|
class: "hep-cr-dialog-close",
|
|
2864
2876
|
onClick: s
|
|
2865
|
-
}, [...
|
|
2866
|
-
|
|
2877
|
+
}, [...T[0] || (T[0] = [
|
|
2878
|
+
E("svg", {
|
|
2867
2879
|
width: "16",
|
|
2868
2880
|
height: "16",
|
|
2869
2881
|
viewBox: "0 0 24 24",
|
|
@@ -2871,13 +2883,13 @@ const Me = `
|
|
|
2871
2883
|
stroke: "currentColor",
|
|
2872
2884
|
"stroke-width": "2"
|
|
2873
2885
|
}, [
|
|
2874
|
-
|
|
2886
|
+
E("line", {
|
|
2875
2887
|
x1: "18",
|
|
2876
2888
|
y1: "6",
|
|
2877
2889
|
x2: "6",
|
|
2878
2890
|
y2: "18"
|
|
2879
2891
|
}),
|
|
2880
|
-
|
|
2892
|
+
E("line", {
|
|
2881
2893
|
x1: "6",
|
|
2882
2894
|
y1: "6",
|
|
2883
2895
|
x2: "18",
|
|
@@ -2886,11 +2898,11 @@ const Me = `
|
|
|
2886
2898
|
], -1)
|
|
2887
2899
|
])])
|
|
2888
2900
|
]),
|
|
2889
|
-
|
|
2890
|
-
ie(Q,
|
|
2901
|
+
E("div", _t, [
|
|
2902
|
+
ie(Q, Re(b.$attrs, Le(b.$attrs)), null, 16)
|
|
2891
2903
|
]),
|
|
2892
|
-
|
|
2893
|
-
Ne(
|
|
2904
|
+
b.$slots.footer ? (_(), I("div", xt, [
|
|
2905
|
+
Ne(b.$slots, "footer", { close: s })
|
|
2894
2906
|
])) : U("", !0)
|
|
2895
2907
|
], 4)
|
|
2896
2908
|
])) : U("", !0)
|
|
@@ -2903,13 +2915,13 @@ const Me = `
|
|
|
2903
2915
|
Q.install = (i) => {
|
|
2904
2916
|
i.component("CodeRunner", Q);
|
|
2905
2917
|
};
|
|
2906
|
-
const
|
|
2918
|
+
const Rt = {
|
|
2907
2919
|
install(i) {
|
|
2908
2920
|
i.component("CodeRunner", Q);
|
|
2909
2921
|
}
|
|
2910
2922
|
};
|
|
2911
2923
|
export {
|
|
2912
2924
|
Q as CodeRunner,
|
|
2913
|
-
|
|
2914
|
-
|
|
2925
|
+
Ft as CodeRunnerDialog,
|
|
2926
|
+
Rt as default
|
|
2915
2927
|
};
|