@hep-code-runner/react 3.2.0 → 3.2.2
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 +86 -6
- package/dist/index.mjs +894 -1231
- package/package.json +6 -3
package/dist/index.mjs
CHANGED
|
@@ -1,848 +1,717 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import Ue, { useRef as Ne, useMemo as Se, useCallback as he, useEffect as ve, useState as K, forwardRef as Ze, useImperativeHandle as Ke } from "react";
|
|
2
|
+
var ze = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3
|
+
function Ve(h) {
|
|
4
|
+
return h && h.__esModule && Object.prototype.hasOwnProperty.call(h, "default") ? h.default : h;
|
|
5
|
+
}
|
|
6
|
+
var He, $e = { exports: {} }, _e = {}, Be, Le = {};
|
|
7
|
+
process.env.NODE_ENV === "production" ? $e.exports = function() {
|
|
8
|
+
if (He) return _e;
|
|
9
|
+
He = 1;
|
|
10
|
+
var h = Ue, t = Symbol.for("react.element"), c = Symbol.for("react.fragment"), p = Object.prototype.hasOwnProperty, b = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, k = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
11
|
+
function s(_, y, m) {
|
|
12
|
+
var E, w = {}, L = null, x = null;
|
|
13
|
+
for (E in m !== void 0 && (L = "" + m), y.key !== void 0 && (L = "" + y.key), y.ref !== void 0 && (x = y.ref), y) p.call(y, E) && !k.hasOwnProperty(E) && (w[E] = y[E]);
|
|
14
|
+
if (_ && _.defaultProps) for (E in y = _.defaultProps) w[E] === void 0 && (w[E] = y[E]);
|
|
15
|
+
return { $$typeof: t, type: _, key: L, ref: x, props: w, _owner: b.current };
|
|
16
|
+
}
|
|
17
|
+
return _e.Fragment = c, _e.jsx = s, _e.jsxs = s, _e;
|
|
18
|
+
}() : $e.exports = (Be || (Be = 1, process.env.NODE_ENV !== "production" && function() {
|
|
19
|
+
var h, t = Ue, c = Symbol.for("react.element"), p = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), k = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), _ = Symbol.for("react.provider"), y = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), L = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), R = Symbol.for("react.offscreen"), U = Symbol.iterator, r = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
20
|
+
function n(e) {
|
|
21
|
+
for (var g = arguments.length, f = new Array(g > 1 ? g - 1 : 0), j = 1; j < g; j++) f[j - 1] = arguments[j];
|
|
22
|
+
(function(I, O, T) {
|
|
23
|
+
var N = r.ReactDebugCurrentFrame.getStackAddendum();
|
|
24
|
+
N !== "" && (O += "%s", T = T.concat([N]));
|
|
25
|
+
var D = T.map(function($) {
|
|
26
|
+
return String($);
|
|
27
|
+
});
|
|
28
|
+
D.unshift("Warning: " + O), Function.prototype.apply.call(console[I], console, D);
|
|
29
|
+
})("error", e, f);
|
|
30
|
+
}
|
|
31
|
+
function a(e) {
|
|
32
|
+
return e.displayName || "Context";
|
|
33
|
+
}
|
|
34
|
+
function o(e) {
|
|
35
|
+
if (e == null) return null;
|
|
36
|
+
if (typeof e.tag == "number" && n("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function") return e.displayName || e.name || null;
|
|
37
|
+
if (typeof e == "string") return e;
|
|
38
|
+
switch (e) {
|
|
39
|
+
case b:
|
|
40
|
+
return "Fragment";
|
|
41
|
+
case p:
|
|
42
|
+
return "Portal";
|
|
43
|
+
case s:
|
|
44
|
+
return "Profiler";
|
|
45
|
+
case k:
|
|
46
|
+
return "StrictMode";
|
|
47
|
+
case E:
|
|
48
|
+
return "Suspense";
|
|
49
|
+
case w:
|
|
50
|
+
return "SuspenseList";
|
|
27
51
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
52
|
+
if (typeof e == "object") switch (e.$$typeof) {
|
|
53
|
+
case y:
|
|
54
|
+
return a(e) + ".Consumer";
|
|
55
|
+
case _:
|
|
56
|
+
return a(e._context) + ".Provider";
|
|
57
|
+
case m:
|
|
58
|
+
return function(O, T, N) {
|
|
59
|
+
var D = O.displayName;
|
|
60
|
+
if (D) return D;
|
|
61
|
+
var $ = T.displayName || T.name || "";
|
|
62
|
+
return $ !== "" ? N + "(" + $ + ")" : N;
|
|
63
|
+
}(e, e.render, "ForwardRef");
|
|
64
|
+
case L:
|
|
65
|
+
var g = e.displayName || null;
|
|
66
|
+
return g !== null ? g : o(e.type) || "Memo";
|
|
67
|
+
case x:
|
|
68
|
+
var f = e, j = f._payload, I = f._init;
|
|
69
|
+
try {
|
|
70
|
+
return o(I(j));
|
|
71
|
+
} catch {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
42
74
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
h = Symbol.for("react.module.reference");
|
|
78
|
+
var i, d, u, v, P, z, Y, J = Object.assign, le = 0;
|
|
79
|
+
function be() {
|
|
80
|
+
}
|
|
81
|
+
be.__reactDisabledLog = !0;
|
|
82
|
+
var re, ae = r.ReactCurrentDispatcher;
|
|
83
|
+
function H(e, g, f) {
|
|
84
|
+
if (re === void 0) try {
|
|
85
|
+
throw Error();
|
|
86
|
+
} catch (I) {
|
|
87
|
+
var j = I.stack.trim().match(/\n( *(at )?)/);
|
|
88
|
+
re = j && j[1] || "";
|
|
52
89
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
return `
|
|
91
|
+
` + re + e;
|
|
92
|
+
}
|
|
93
|
+
var G, Z = !1, V = typeof WeakMap == "function" ? WeakMap : Map;
|
|
94
|
+
function ce(e, g) {
|
|
95
|
+
if (!e || Z) return "";
|
|
96
|
+
var f, j = G.get(e);
|
|
97
|
+
if (j !== void 0) return j;
|
|
98
|
+
Z = !0;
|
|
99
|
+
var I, O = Error.prepareStackTrace;
|
|
100
|
+
Error.prepareStackTrace = void 0, I = ae.current, ae.current = null, function() {
|
|
101
|
+
if (le === 0) {
|
|
102
|
+
i = console.log, d = console.info, u = console.warn, v = console.error, P = console.group, z = console.groupCollapsed, Y = console.groupEnd;
|
|
103
|
+
var F = { configurable: !0, enumerable: !0, value: be, writable: !0 };
|
|
104
|
+
Object.defineProperties(console, { info: F, log: F, warn: F, error: F, group: F, groupCollapsed: F, groupEnd: F });
|
|
105
|
+
}
|
|
106
|
+
le++;
|
|
107
|
+
}();
|
|
108
|
+
try {
|
|
109
|
+
if (g) {
|
|
110
|
+
var T = function() {
|
|
111
|
+
throw Error();
|
|
112
|
+
};
|
|
113
|
+
if (Object.defineProperty(T.prototype, "props", { set: function() {
|
|
114
|
+
throw Error();
|
|
115
|
+
} }), typeof Reflect == "object" && Reflect.construct) {
|
|
116
|
+
try {
|
|
117
|
+
Reflect.construct(T, []);
|
|
118
|
+
} catch (F) {
|
|
119
|
+
f = F;
|
|
120
|
+
}
|
|
121
|
+
Reflect.construct(e, [], T);
|
|
122
|
+
} else {
|
|
123
|
+
try {
|
|
124
|
+
T.call();
|
|
125
|
+
} catch (F) {
|
|
126
|
+
f = F;
|
|
127
|
+
}
|
|
128
|
+
e.call(T.prototype);
|
|
129
|
+
}
|
|
130
|
+
} else {
|
|
131
|
+
try {
|
|
132
|
+
throw Error();
|
|
133
|
+
} catch (F) {
|
|
134
|
+
f = F;
|
|
135
|
+
}
|
|
136
|
+
e();
|
|
137
|
+
}
|
|
138
|
+
} catch (F) {
|
|
139
|
+
if (F && f && typeof F.stack == "string") {
|
|
140
|
+
for (var N = F.stack.split(`
|
|
141
|
+
`), D = f.stack.split(`
|
|
142
|
+
`), $ = N.length - 1, C = D.length - 1; $ >= 1 && C >= 0 && N[$] !== D[C]; ) C--;
|
|
143
|
+
for (; $ >= 1 && C >= 0; $--, C--) if (N[$] !== D[C]) {
|
|
144
|
+
if ($ !== 1 || C !== 1) do
|
|
145
|
+
if ($--, --C < 0 || N[$] !== D[C]) {
|
|
146
|
+
var A = `
|
|
147
|
+
` + N[$].replace(" at new ", " at ");
|
|
148
|
+
return e.displayName && A.includes("<anonymous>") && (A = A.replace("<anonymous>", e.displayName)), typeof e == "function" && G.set(e, A), A;
|
|
149
|
+
}
|
|
150
|
+
while ($ >= 1 && C >= 0);
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
} finally {
|
|
155
|
+
Z = !1, ae.current = I, function() {
|
|
156
|
+
if (--le === 0) {
|
|
157
|
+
var F = { configurable: !0, enumerable: !0, writable: !0 };
|
|
158
|
+
Object.defineProperties(console, { log: J({}, F, { value: i }), info: J({}, F, { value: d }), warn: J({}, F, { value: u }), error: J({}, F, { value: v }), group: J({}, F, { value: P }), groupCollapsed: J({}, F, { value: z }), groupEnd: J({}, F, { value: Y }) });
|
|
159
|
+
}
|
|
160
|
+
le < 0 && n("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
161
|
+
}(), Error.prepareStackTrace = O;
|
|
95
162
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
110
|
-
lookbehind: !0,
|
|
111
|
-
inside: Prism.languages.javascript
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
115
|
-
lookbehind: !0,
|
|
116
|
-
inside: Prism.languages.javascript
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
|
|
120
|
-
lookbehind: !0,
|
|
121
|
-
inside: Prism.languages.javascript
|
|
163
|
+
var B = e ? e.displayName || e.name : "", W = B ? H(B) : "";
|
|
164
|
+
return typeof e == "function" && G.set(e, W), W;
|
|
165
|
+
}
|
|
166
|
+
function oe(e, g, f) {
|
|
167
|
+
if (e == null) return "";
|
|
168
|
+
if (typeof e == "function") return ce(e, !(!(j = e.prototype) || !j.isReactComponent));
|
|
169
|
+
var j;
|
|
170
|
+
if (typeof e == "string") return H(e);
|
|
171
|
+
switch (e) {
|
|
172
|
+
case E:
|
|
173
|
+
return H("Suspense");
|
|
174
|
+
case w:
|
|
175
|
+
return H("SuspenseList");
|
|
122
176
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
134
|
-
greedy: !0,
|
|
135
|
-
inside: {
|
|
136
|
-
"template-punctuation": {
|
|
137
|
-
pattern: /^`|`$/,
|
|
138
|
-
alias: "string"
|
|
139
|
-
},
|
|
140
|
-
interpolation: {
|
|
141
|
-
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
142
|
-
lookbehind: !0,
|
|
143
|
-
inside: {
|
|
144
|
-
"interpolation-punctuation": {
|
|
145
|
-
pattern: /^\$\{|\}$/,
|
|
146
|
-
alias: "punctuation"
|
|
147
|
-
},
|
|
148
|
-
rest: Prism.languages.javascript
|
|
177
|
+
if (typeof e == "object") switch (e.$$typeof) {
|
|
178
|
+
case m:
|
|
179
|
+
return ce(e.render, !1);
|
|
180
|
+
case L:
|
|
181
|
+
return oe(e.type, g, f);
|
|
182
|
+
case x:
|
|
183
|
+
var I = e, O = I._payload, T = I._init;
|
|
184
|
+
try {
|
|
185
|
+
return oe(T(O), g, f);
|
|
186
|
+
} catch {
|
|
149
187
|
}
|
|
150
|
-
},
|
|
151
|
-
string: /[\s\S]+/
|
|
152
188
|
}
|
|
153
|
-
|
|
154
|
-
"string-property": {
|
|
155
|
-
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
156
|
-
lookbehind: !0,
|
|
157
|
-
greedy: !0,
|
|
158
|
-
alias: "property"
|
|
189
|
+
return "";
|
|
159
190
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
191
|
+
G = new V();
|
|
192
|
+
var ne = Object.prototype.hasOwnProperty, Q = {}, ee = r.ReactDebugCurrentFrame;
|
|
193
|
+
function te(e) {
|
|
194
|
+
if (e) {
|
|
195
|
+
var g = e._owner, f = oe(e.type, e._source, g ? g.type : null);
|
|
196
|
+
ee.setExtraStackFrame(f);
|
|
197
|
+
} else ee.setExtraStackFrame(null);
|
|
166
198
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
|
|
199
|
+
var fe = Array.isArray;
|
|
200
|
+
function ie(e) {
|
|
201
|
+
return fe(e);
|
|
202
|
+
}
|
|
203
|
+
function me(e) {
|
|
204
|
+
return "" + e;
|
|
205
|
+
}
|
|
206
|
+
function ge(e) {
|
|
207
|
+
if (function(g) {
|
|
208
|
+
try {
|
|
209
|
+
return me(g), !1;
|
|
210
|
+
} catch {
|
|
211
|
+
return !0;
|
|
212
|
+
}
|
|
213
|
+
}(e)) return n("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", function(g) {
|
|
214
|
+
return typeof Symbol == "function" && Symbol.toStringTag && g[Symbol.toStringTag] || g.constructor.name || "Object";
|
|
215
|
+
}(e)), me(e);
|
|
216
|
+
}
|
|
217
|
+
var q, Re, Oe = r.ReactCurrentOwner, Ce = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
218
|
+
function je(e, g, f, j, I) {
|
|
219
|
+
var O, T = {}, N = null, D = null;
|
|
220
|
+
for (O in f !== void 0 && (ge(f), N = "" + f), function(A) {
|
|
221
|
+
if (ne.call(A, "key")) {
|
|
222
|
+
var B = Object.getOwnPropertyDescriptor(A, "key").get;
|
|
223
|
+
if (B && B.isReactWarning) return !1;
|
|
224
|
+
}
|
|
225
|
+
return A.key !== void 0;
|
|
226
|
+
}(g) && (ge(g.key), N = "" + g.key), function(A) {
|
|
227
|
+
if (ne.call(A, "ref")) {
|
|
228
|
+
var B = Object.getOwnPropertyDescriptor(A, "ref").get;
|
|
229
|
+
if (B && B.isReactWarning) return !1;
|
|
230
|
+
}
|
|
231
|
+
return A.ref !== void 0;
|
|
232
|
+
}(g) && (D = g.ref, function(A) {
|
|
233
|
+
typeof A.ref == "string" && Oe.current;
|
|
234
|
+
}(g)), g) ne.call(g, O) && !Ce.hasOwnProperty(O) && (T[O] = g[O]);
|
|
235
|
+
if (e && e.defaultProps) {
|
|
236
|
+
var $ = e.defaultProps;
|
|
237
|
+
for (O in $) T[O] === void 0 && (T[O] = $[O]);
|
|
200
238
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
},
|
|
215
|
-
"class-name": {
|
|
216
|
-
pattern: /(\bclass\s+)\w+/i,
|
|
217
|
-
lookbehind: !0
|
|
218
|
-
},
|
|
219
|
-
decorator: {
|
|
220
|
-
pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
|
|
221
|
-
lookbehind: !0,
|
|
222
|
-
alias: ["annotation", "punctuation"],
|
|
223
|
-
inside: {
|
|
224
|
-
punctuation: /\./
|
|
239
|
+
if (N || D) {
|
|
240
|
+
var C = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
241
|
+
N && function(A, B) {
|
|
242
|
+
var W = function() {
|
|
243
|
+
q || (q = !0, n("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", B));
|
|
244
|
+
};
|
|
245
|
+
W.isReactWarning = !0, Object.defineProperty(A, "key", { get: W, configurable: !0 });
|
|
246
|
+
}(T, C), D && function(A, B) {
|
|
247
|
+
var W = function() {
|
|
248
|
+
Re || (Re = !0, n("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", B));
|
|
249
|
+
};
|
|
250
|
+
W.isReactWarning = !0, Object.defineProperty(A, "ref", { get: W, configurable: !0 });
|
|
251
|
+
}(T, C);
|
|
225
252
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
number: /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
|
|
231
|
-
operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
|
|
232
|
-
punctuation: /[{}[\];(),.:]/
|
|
233
|
-
};
|
|
234
|
-
Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python;
|
|
235
|
-
Prism.languages.py = Prism.languages.python;
|
|
236
|
-
Prism.languages.go = Prism.languages.extend("clike", {
|
|
237
|
-
string: {
|
|
238
|
-
pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,
|
|
239
|
-
lookbehind: !0,
|
|
240
|
-
greedy: !0
|
|
241
|
-
},
|
|
242
|
-
keyword: /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,
|
|
243
|
-
boolean: /\b(?:_|false|iota|nil|true)\b/,
|
|
244
|
-
number: [
|
|
245
|
-
// binary and octal integers
|
|
246
|
-
/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,
|
|
247
|
-
// hexadecimal integers and floats
|
|
248
|
-
/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,
|
|
249
|
-
// decimal integers and floats
|
|
250
|
-
/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i
|
|
251
|
-
],
|
|
252
|
-
operator: /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,
|
|
253
|
-
builtin: /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/
|
|
254
|
-
});
|
|
255
|
-
Prism.languages.insertBefore("go", "string", {
|
|
256
|
-
char: {
|
|
257
|
-
pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/,
|
|
258
|
-
greedy: !0
|
|
253
|
+
return function(A, B, W, F, M, Ie, Te) {
|
|
254
|
+
var de = { $$typeof: c, type: A, key: B, ref: W, props: Te, _owner: Ie, _store: {} };
|
|
255
|
+
return Object.defineProperty(de._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(de, "_self", { configurable: !1, enumerable: !1, writable: !1, value: F }), Object.defineProperty(de, "_source", { configurable: !1, enumerable: !1, writable: !1, value: M }), Object.freeze && (Object.freeze(de.props), Object.freeze(de)), de;
|
|
256
|
+
}(e, N, D, I, j, Oe.current, T);
|
|
259
257
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
(
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
258
|
+
var Ae, ye = r.ReactCurrentOwner, Fe = r.ReactDebugCurrentFrame;
|
|
259
|
+
function pe(e) {
|
|
260
|
+
if (e) {
|
|
261
|
+
var g = e._owner, f = oe(e.type, e._source, g ? g.type : null);
|
|
262
|
+
Fe.setExtraStackFrame(f);
|
|
263
|
+
} else Fe.setExtraStackFrame(null);
|
|
264
|
+
}
|
|
265
|
+
function xe(e) {
|
|
266
|
+
return typeof e == "object" && e !== null && e.$$typeof === c;
|
|
267
|
+
}
|
|
268
|
+
function S() {
|
|
269
|
+
if (ye.current) {
|
|
270
|
+
var e = o(ye.current.type);
|
|
271
|
+
if (e) return `
|
|
272
|
+
|
|
273
|
+
Check the render method of \`` + e + "`.";
|
|
274
274
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
inside: o.inside
|
|
297
|
-
}
|
|
298
|
-
],
|
|
299
|
-
keyword: r,
|
|
300
|
-
function: [
|
|
301
|
-
t.languages.clike.function,
|
|
302
|
-
{
|
|
303
|
-
pattern: /(::\s*)[a-z_]\w*/,
|
|
304
|
-
lookbehind: !0
|
|
275
|
+
return "";
|
|
276
|
+
}
|
|
277
|
+
Ae = !1;
|
|
278
|
+
var X = {};
|
|
279
|
+
function ue(e, g) {
|
|
280
|
+
if (e._store && !e._store.validated && e.key == null) {
|
|
281
|
+
e._store.validated = !0;
|
|
282
|
+
var f = function(I) {
|
|
283
|
+
var O = S();
|
|
284
|
+
if (!O) {
|
|
285
|
+
var T = typeof I == "string" ? I : I.displayName || I.name;
|
|
286
|
+
T && (O = `
|
|
287
|
+
|
|
288
|
+
Check the top-level render call using <` + T + ">.");
|
|
289
|
+
}
|
|
290
|
+
return O;
|
|
291
|
+
}(g);
|
|
292
|
+
if (!X[f]) {
|
|
293
|
+
X[f] = !0;
|
|
294
|
+
var j = "";
|
|
295
|
+
e && e._owner && e._owner !== ye.current && (j = " It was passed a child from " + o(e._owner.type) + "."), pe(e), n('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', f, j), pe(null);
|
|
305
296
|
}
|
|
306
|
-
],
|
|
307
|
-
number: /\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,
|
|
308
|
-
operator: {
|
|
309
|
-
pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
|
|
310
|
-
lookbehind: !0
|
|
311
|
-
},
|
|
312
|
-
constant: /\b[A-Z][A-Z_\d]+\b/
|
|
313
|
-
}), t.languages.insertBefore("java", "string", {
|
|
314
|
-
"triple-quoted-string": {
|
|
315
|
-
// http://openjdk.java.net/jeps/355#Description
|
|
316
|
-
pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
|
|
317
|
-
greedy: !0,
|
|
318
|
-
alias: "string"
|
|
319
|
-
},
|
|
320
|
-
char: {
|
|
321
|
-
pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
|
|
322
|
-
greedy: !0
|
|
323
297
|
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
generics: {
|
|
331
|
-
pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
|
|
332
|
-
inside: {
|
|
333
|
-
"class-name": o,
|
|
334
|
-
keyword: r,
|
|
335
|
-
punctuation: /[<>(),.:]/,
|
|
336
|
-
operator: /[?&|]/
|
|
337
|
-
}
|
|
338
|
-
},
|
|
339
|
-
import: [
|
|
340
|
-
{
|
|
341
|
-
pattern: RegExp(/(\bimport\s+)/.source + a + /(?:[A-Z]\w*|\*)(?=\s*;)/.source),
|
|
342
|
-
lookbehind: !0,
|
|
343
|
-
inside: {
|
|
344
|
-
namespace: o.inside.namespace,
|
|
345
|
-
punctuation: /\./,
|
|
346
|
-
operator: /\*/,
|
|
347
|
-
"class-name": /\w+/
|
|
348
|
-
}
|
|
349
|
-
},
|
|
350
|
-
{
|
|
351
|
-
pattern: RegExp(/(\bimport\s+static\s+)/.source + a + /(?:\w+|\*)(?=\s*;)/.source),
|
|
352
|
-
lookbehind: !0,
|
|
353
|
-
alias: "static",
|
|
354
|
-
inside: {
|
|
355
|
-
namespace: o.inside.namespace,
|
|
356
|
-
static: /\b\w+$/,
|
|
357
|
-
punctuation: /\./,
|
|
358
|
-
operator: /\*/,
|
|
359
|
-
"class-name": /\w+/
|
|
360
|
-
}
|
|
298
|
+
}
|
|
299
|
+
function se(e, g) {
|
|
300
|
+
if (typeof e == "object") {
|
|
301
|
+
if (ie(e)) for (var f = 0; f < e.length; f++) {
|
|
302
|
+
var j = e[f];
|
|
303
|
+
xe(j) && ue(j, g);
|
|
361
304
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
inside: {
|
|
371
|
-
punctuation: /\./
|
|
305
|
+
else if (xe(e)) e._store && (e._store.validated = !0);
|
|
306
|
+
else if (e) {
|
|
307
|
+
var I = function(N) {
|
|
308
|
+
if (N === null || typeof N != "object") return null;
|
|
309
|
+
var D = U && N[U] || N["@@iterator"];
|
|
310
|
+
return typeof D == "function" ? D : null;
|
|
311
|
+
}(e);
|
|
312
|
+
if (typeof I == "function" && I !== e.entries) for (var O, T = I.call(e); !(O = T.next()).done; ) xe(O.value) && ue(O.value, g);
|
|
372
313
|
}
|
|
373
314
|
}
|
|
374
|
-
});
|
|
375
|
-
})(Prism);
|
|
376
|
-
Prism.languages.c = Prism.languages.extend("clike", {
|
|
377
|
-
comment: {
|
|
378
|
-
pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
|
|
379
|
-
greedy: !0
|
|
380
|
-
},
|
|
381
|
-
string: {
|
|
382
|
-
// https://en.cppreference.com/w/c/language/string_literal
|
|
383
|
-
pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
|
|
384
|
-
greedy: !0
|
|
385
|
-
},
|
|
386
|
-
"class-name": {
|
|
387
|
-
pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,
|
|
388
|
-
lookbehind: !0
|
|
389
|
-
},
|
|
390
|
-
keyword: /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,
|
|
391
|
-
function: /\b[a-z_]\w*(?=\s*\()/i,
|
|
392
|
-
number: /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
|
|
393
|
-
operator: />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/
|
|
394
|
-
});
|
|
395
|
-
Prism.languages.insertBefore("c", "string", {
|
|
396
|
-
char: {
|
|
397
|
-
// https://en.cppreference.com/w/c/language/character_constant
|
|
398
|
-
pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,
|
|
399
|
-
greedy: !0
|
|
400
315
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
greedy: !0,
|
|
409
|
-
alias: "property",
|
|
410
|
-
inside: {
|
|
411
|
-
string: [
|
|
412
|
-
{
|
|
413
|
-
// highlight the path of the include statement as a string
|
|
414
|
-
pattern: /^(#\s*include\s*)<[^>]+>/,
|
|
415
|
-
lookbehind: !0
|
|
416
|
-
},
|
|
417
|
-
Prism.languages.c.string
|
|
418
|
-
],
|
|
419
|
-
char: Prism.languages.c.char,
|
|
420
|
-
comment: Prism.languages.c.comment,
|
|
421
|
-
"macro-name": [
|
|
422
|
-
{
|
|
423
|
-
pattern: /(^#\s*define\s+)\w+\b(?!\()/i,
|
|
424
|
-
lookbehind: !0
|
|
425
|
-
},
|
|
426
|
-
{
|
|
427
|
-
pattern: /(^#\s*define\s+)\w+\b(?=\()/i,
|
|
428
|
-
lookbehind: !0,
|
|
429
|
-
alias: "function"
|
|
430
|
-
}
|
|
431
|
-
],
|
|
432
|
-
// highlight macro directives as keywords
|
|
433
|
-
directive: {
|
|
434
|
-
pattern: /^(#\s*)[a-z]+/,
|
|
435
|
-
lookbehind: !0,
|
|
436
|
-
alias: "keyword"
|
|
437
|
-
},
|
|
438
|
-
"directive-hash": /^#/,
|
|
439
|
-
punctuation: /##|\\(?=[\r\n])/,
|
|
440
|
-
expression: {
|
|
441
|
-
pattern: /\S[\s\S]*/,
|
|
442
|
-
inside: Prism.languages.c
|
|
316
|
+
function Ee(e) {
|
|
317
|
+
var g, f = e.type;
|
|
318
|
+
if (f != null && typeof f != "string") {
|
|
319
|
+
if (typeof f == "function") g = f.propTypes;
|
|
320
|
+
else {
|
|
321
|
+
if (typeof f != "object" || f.$$typeof !== m && f.$$typeof !== L) return;
|
|
322
|
+
g = f.propTypes;
|
|
443
323
|
}
|
|
324
|
+
if (g) {
|
|
325
|
+
var j = o(f);
|
|
326
|
+
(function(I, O, T, N, D) {
|
|
327
|
+
var $ = Function.call.bind(ne);
|
|
328
|
+
for (var C in I) if ($(I, C)) {
|
|
329
|
+
var A = void 0;
|
|
330
|
+
try {
|
|
331
|
+
if (typeof I[C] != "function") {
|
|
332
|
+
var B = Error((N || "React class") + ": " + T + " type `" + C + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof I[C] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
|
+
throw B.name = "Invariant Violation", B;
|
|
334
|
+
}
|
|
335
|
+
A = I[C](O, C, N, T, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
|
+
} catch (W) {
|
|
337
|
+
A = W;
|
|
338
|
+
}
|
|
339
|
+
!A || A instanceof Error || (te(D), n("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", N || "React class", T, C, typeof A), te(null)), A instanceof Error && !(A.message in Q) && (Q[A.message] = !0, te(D), n("Failed %s type: %s", T, A.message), te(null));
|
|
340
|
+
}
|
|
341
|
+
})(g, e.props, "prop", j, e);
|
|
342
|
+
} else f.PropTypes === void 0 || Ae || (Ae = !0, n("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o(f) || "Unknown"));
|
|
343
|
+
typeof f.getDefaultProps != "function" || f.getDefaultProps.isReactClassApproved || n("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
444
344
|
}
|
|
445
345
|
}
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
});
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
{
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
346
|
+
var ke = {};
|
|
347
|
+
function we(e, g, f, j, I, O) {
|
|
348
|
+
var T = function(M) {
|
|
349
|
+
return typeof M == "string" || typeof M == "function" || M === b || M === s || M === k || M === E || M === w || M === R || typeof M == "object" && M !== null && (M.$$typeof === x || M.$$typeof === L || M.$$typeof === _ || M.$$typeof === y || M.$$typeof === m || M.$$typeof === h || M.getModuleId !== void 0);
|
|
350
|
+
}(e);
|
|
351
|
+
if (!T) {
|
|
352
|
+
var N, D = "";
|
|
353
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (D += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), D += S(), e === null ? N = "null" : ie(e) ? N = "array" : e !== void 0 && e.$$typeof === c ? (N = "<" + (o(e.type) || "Unknown") + " />", D = " Did you accidentally export a JSX literal instead of a component?") : N = typeof e, n("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, D);
|
|
354
|
+
}
|
|
355
|
+
var $ = je(e, g, f, I, O);
|
|
356
|
+
if ($ == null) return $;
|
|
357
|
+
if (T) {
|
|
358
|
+
var C = g.children;
|
|
359
|
+
if (C !== void 0) if (j) if (ie(C)) {
|
|
360
|
+
for (var A = 0; A < C.length; A++) se(C[A], e);
|
|
361
|
+
Object.freeze && Object.freeze(C);
|
|
362
|
+
} else n("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
363
|
+
else se(C, e);
|
|
364
|
+
}
|
|
365
|
+
if (ne.call(g, "key")) {
|
|
366
|
+
var B = o(e), W = Object.keys(g).filter(function(M) {
|
|
367
|
+
return M !== "key";
|
|
368
|
+
}), F = W.length > 0 ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
369
|
+
ke[B + F] || (n(`A props object containing a "key" prop is being spread into JSX:
|
|
370
|
+
let props = %s;
|
|
371
|
+
<%s {...props} />
|
|
372
|
+
React keys must be passed directly to JSX without using spread:
|
|
373
|
+
let props = %s;
|
|
374
|
+
<%s key={someKey} {...props} />`, F, B, W.length > 0 ? "{" + W.join(": ..., ") + ": ...}" : "{}", B), ke[B + F] = !0);
|
|
375
|
+
}
|
|
376
|
+
return e === b ? function(M) {
|
|
377
|
+
for (var Ie = Object.keys(M.props), Te = 0; Te < Ie.length; Te++) {
|
|
378
|
+
var de = Ie[Te];
|
|
379
|
+
if (de !== "children" && de !== "key") {
|
|
380
|
+
pe(M), n("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", de), pe(null);
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
470
383
|
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
384
|
+
M.ref !== null && (pe(M), n("Invalid attribute `ref` supplied to `React.Fragment`."), pe(null));
|
|
385
|
+
}($) : Ee($), $;
|
|
386
|
+
}
|
|
387
|
+
var Ye = function(e, g, f) {
|
|
388
|
+
return we(e, g, f, !1);
|
|
389
|
+
}, Xe = function(e, g, f) {
|
|
390
|
+
return we(e, g, f, !0);
|
|
391
|
+
};
|
|
392
|
+
Le.Fragment = b, Le.jsx = Ye, Le.jsxs = Xe;
|
|
393
|
+
}()), Le);
|
|
394
|
+
var l = $e.exports, We = { exports: {} };
|
|
395
|
+
(function(h) {
|
|
396
|
+
var t = function(c) {
|
|
397
|
+
var p = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, b = 0, k = {}, s = { manual: c.Prism && c.Prism.manual, disableWorkerMessageHandler: c.Prism && c.Prism.disableWorkerMessageHandler, util: { encode: function r(n) {
|
|
398
|
+
return n instanceof _ ? new _(n.type, r(n.content), n.alias) : Array.isArray(n) ? n.map(r) : n.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
399
|
+
}, type: function(r) {
|
|
400
|
+
return Object.prototype.toString.call(r).slice(8, -1);
|
|
401
|
+
}, objId: function(r) {
|
|
402
|
+
return r.__id || Object.defineProperty(r, "__id", { value: ++b }), r.__id;
|
|
403
|
+
}, clone: function r(n, a) {
|
|
404
|
+
var o, i;
|
|
405
|
+
switch (a = a || {}, s.util.type(n)) {
|
|
406
|
+
case "Object":
|
|
407
|
+
if (i = s.util.objId(n), a[i]) return a[i];
|
|
408
|
+
for (var d in o = {}, a[i] = o, n) n.hasOwnProperty(d) && (o[d] = r(n[d], a));
|
|
409
|
+
return o;
|
|
410
|
+
case "Array":
|
|
411
|
+
return i = s.util.objId(n), a[i] ? a[i] : (o = [], a[i] = o, n.forEach(function(u, v) {
|
|
412
|
+
o[v] = r(u, a);
|
|
413
|
+
}), o);
|
|
414
|
+
default:
|
|
415
|
+
return n;
|
|
487
416
|
}
|
|
488
|
-
},
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
greedy: !0,
|
|
494
|
-
inside: {
|
|
495
|
-
"closure-punctuation": {
|
|
496
|
-
pattern: /^\||\|$/,
|
|
497
|
-
alias: "punctuation"
|
|
498
|
-
},
|
|
499
|
-
rest: null
|
|
500
|
-
// see below
|
|
417
|
+
}, getLanguage: function(r) {
|
|
418
|
+
for (; r; ) {
|
|
419
|
+
var n = p.exec(r.className);
|
|
420
|
+
if (n) return n[1].toLowerCase();
|
|
421
|
+
r = r.parentElement;
|
|
501
422
|
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
lookbehind: !0,
|
|
516
|
-
alias: "function"
|
|
517
|
-
},
|
|
518
|
-
"type-definition": {
|
|
519
|
-
pattern: /(\b(?:enum|struct|trait|type|union)\s+)\w+/,
|
|
520
|
-
lookbehind: !0,
|
|
521
|
-
alias: "class-name"
|
|
522
|
-
},
|
|
523
|
-
"module-declaration": [
|
|
524
|
-
{
|
|
525
|
-
pattern: /(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,
|
|
526
|
-
lookbehind: !0,
|
|
527
|
-
alias: "namespace"
|
|
528
|
-
},
|
|
529
|
-
{
|
|
530
|
-
pattern: /(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,
|
|
531
|
-
lookbehind: !0,
|
|
532
|
-
alias: "namespace",
|
|
533
|
-
inside: {
|
|
534
|
-
punctuation: /::/
|
|
423
|
+
return "none";
|
|
424
|
+
}, setLanguage: function(r, n) {
|
|
425
|
+
r.className = r.className.replace(RegExp(p, "gi"), ""), r.classList.add("language-" + n);
|
|
426
|
+
}, currentScript: function() {
|
|
427
|
+
if (typeof document > "u") return null;
|
|
428
|
+
if (document.currentScript && document.currentScript.tagName === "SCRIPT") return document.currentScript;
|
|
429
|
+
try {
|
|
430
|
+
throw new Error();
|
|
431
|
+
} catch (o) {
|
|
432
|
+
var r = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(o.stack) || [])[1];
|
|
433
|
+
if (r) {
|
|
434
|
+
var n = document.getElementsByTagName("script");
|
|
435
|
+
for (var a in n) if (n[a].src == r) return n[a];
|
|
535
436
|
}
|
|
437
|
+
return null;
|
|
438
|
+
}
|
|
439
|
+
}, isActive: function(r, n, a) {
|
|
440
|
+
for (var o = "no-" + n; r; ) {
|
|
441
|
+
var i = r.classList;
|
|
442
|
+
if (i.contains(n)) return !0;
|
|
443
|
+
if (i.contains(o)) return !1;
|
|
444
|
+
r = r.parentElement;
|
|
445
|
+
}
|
|
446
|
+
return !!a;
|
|
447
|
+
} }, languages: { plain: k, plaintext: k, text: k, txt: k, extend: function(r, n) {
|
|
448
|
+
var a = s.util.clone(s.languages[r]);
|
|
449
|
+
for (var o in n) a[o] = n[o];
|
|
450
|
+
return a;
|
|
451
|
+
}, insertBefore: function(r, n, a, o) {
|
|
452
|
+
var i = (o = o || s.languages)[r], d = {};
|
|
453
|
+
for (var u in i) if (i.hasOwnProperty(u)) {
|
|
454
|
+
if (u == n) for (var v in a) a.hasOwnProperty(v) && (d[v] = a[v]);
|
|
455
|
+
a.hasOwnProperty(u) || (d[u] = i[u]);
|
|
456
|
+
}
|
|
457
|
+
var P = o[r];
|
|
458
|
+
return o[r] = d, s.languages.DFS(s.languages, function(z, Y) {
|
|
459
|
+
Y === P && z != r && (this[z] = d);
|
|
460
|
+
}), d;
|
|
461
|
+
}, DFS: function r(n, a, o, i) {
|
|
462
|
+
i = i || {};
|
|
463
|
+
var d = s.util.objId;
|
|
464
|
+
for (var u in n) if (n.hasOwnProperty(u)) {
|
|
465
|
+
a.call(n, u, n[u], o || u);
|
|
466
|
+
var v = n[u], P = s.util.type(v);
|
|
467
|
+
P !== "Object" || i[d(v)] ? P !== "Array" || i[d(v)] || (i[d(v)] = !0, r(v, a, u, i)) : (i[d(v)] = !0, r(v, a, null, i));
|
|
536
468
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
alias: "property"
|
|
552
|
-
},
|
|
553
|
-
constant: /\b[A-Z_][A-Z_\d]+\b/,
|
|
554
|
-
"class-name": /\b[A-Z]\w*\b/,
|
|
555
|
-
namespace: {
|
|
556
|
-
pattern: /(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,
|
|
557
|
-
inside: {
|
|
558
|
-
punctuation: /::/
|
|
469
|
+
} }, plugins: {}, highlightAll: function(r, n) {
|
|
470
|
+
s.highlightAllUnder(document, r, n);
|
|
471
|
+
}, highlightAllUnder: function(r, n, a) {
|
|
472
|
+
var o = { callback: a, container: r, selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code' };
|
|
473
|
+
s.hooks.run("before-highlightall", o), o.elements = Array.prototype.slice.apply(o.container.querySelectorAll(o.selector)), s.hooks.run("before-all-elements-highlight", o);
|
|
474
|
+
for (var i, d = 0; i = o.elements[d++]; ) s.highlightElement(i, n === !0, o.callback);
|
|
475
|
+
}, highlightElement: function(r, n, a) {
|
|
476
|
+
var o = s.util.getLanguage(r), i = s.languages[o];
|
|
477
|
+
s.util.setLanguage(r, o);
|
|
478
|
+
var d = r.parentElement;
|
|
479
|
+
d && d.nodeName.toLowerCase() === "pre" && s.util.setLanguage(d, o);
|
|
480
|
+
var u = { element: r, language: o, grammar: i, code: r.textContent };
|
|
481
|
+
function v(z) {
|
|
482
|
+
u.highlightedCode = z, s.hooks.run("before-insert", u), u.element.innerHTML = u.highlightedCode, s.hooks.run("after-highlight", u), s.hooks.run("complete", u), a && a.call(u.element);
|
|
559
483
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
484
|
+
if (s.hooks.run("before-sanity-check", u), (d = u.element.parentElement) && d.nodeName.toLowerCase() === "pre" && !d.hasAttribute("tabindex") && d.setAttribute("tabindex", "0"), !u.code) return s.hooks.run("complete", u), void (a && a.call(u.element));
|
|
485
|
+
if (s.hooks.run("before-highlight", u), u.grammar) if (n && c.Worker) {
|
|
486
|
+
var P = new Worker(s.filename);
|
|
487
|
+
P.onmessage = function(z) {
|
|
488
|
+
v(z.data);
|
|
489
|
+
}, P.postMessage(JSON.stringify({ language: u.language, code: u.code, immediateClose: !0 }));
|
|
490
|
+
} else v(s.highlight(u.code, u.grammar, u.language));
|
|
491
|
+
else v(s.util.encode(u.code));
|
|
492
|
+
}, highlight: function(r, n, a) {
|
|
493
|
+
var o = { code: r, grammar: n, language: a };
|
|
494
|
+
if (s.hooks.run("before-tokenize", o), !o.grammar) throw new Error('The language "' + o.language + '" has no grammar.');
|
|
495
|
+
return o.tokens = s.tokenize(o.code, o.grammar), s.hooks.run("after-tokenize", o), _.stringify(s.util.encode(o.tokens), o.language);
|
|
496
|
+
}, tokenize: function(r, n) {
|
|
497
|
+
var a = n.rest;
|
|
498
|
+
if (a) {
|
|
499
|
+
for (var o in a) n[o] = a[o];
|
|
500
|
+
delete n.rest;
|
|
501
|
+
}
|
|
502
|
+
var i = new E();
|
|
503
|
+
return w(i, i.head, r), m(r, i, n, i.head, 0), function(d) {
|
|
504
|
+
for (var u = [], v = d.head.next; v !== d.tail; ) u.push(v.value), v = v.next;
|
|
505
|
+
return u;
|
|
506
|
+
}(i);
|
|
507
|
+
}, hooks: { all: {}, add: function(r, n) {
|
|
508
|
+
var a = s.hooks.all;
|
|
509
|
+
a[r] = a[r] || [], a[r].push(n);
|
|
510
|
+
}, run: function(r, n) {
|
|
511
|
+
var a = s.hooks.all[r];
|
|
512
|
+
if (a && a.length) for (var o, i = 0; o = a[i++]; ) o(n);
|
|
513
|
+
} }, Token: _ };
|
|
514
|
+
function _(r, n, a, o) {
|
|
515
|
+
this.type = r, this.content = n, this.alias = a, this.length = 0 | (o || "").length;
|
|
591
516
|
}
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
}
|
|
635
|
-
},
|
|
636
|
-
// [1]: Command Substitution
|
|
637
|
-
{
|
|
638
|
-
pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
|
|
639
|
-
greedy: !0,
|
|
640
|
-
inside: {
|
|
641
|
-
variable: /^\$\(|^`|\)$|`$/
|
|
642
|
-
}
|
|
643
|
-
},
|
|
644
|
-
// [2]: Brace expansion
|
|
645
|
-
{
|
|
646
|
-
pattern: /\$\{[^}]+\}/,
|
|
647
|
-
greedy: !0,
|
|
648
|
-
inside: {
|
|
649
|
-
operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
|
|
650
|
-
punctuation: /[\[\]]/,
|
|
651
|
-
environment: {
|
|
652
|
-
pattern: RegExp("(\\{)" + r),
|
|
653
|
-
lookbehind: !0,
|
|
654
|
-
alias: "constant"
|
|
517
|
+
function y(r, n, a, o) {
|
|
518
|
+
r.lastIndex = n;
|
|
519
|
+
var i = r.exec(a);
|
|
520
|
+
if (i && o && i[1]) {
|
|
521
|
+
var d = i[1].length;
|
|
522
|
+
i.index += d, i[0] = i[0].slice(d);
|
|
523
|
+
}
|
|
524
|
+
return i;
|
|
525
|
+
}
|
|
526
|
+
function m(r, n, a, o, i, d) {
|
|
527
|
+
for (var u in a) if (a.hasOwnProperty(u) && a[u]) {
|
|
528
|
+
var v = a[u];
|
|
529
|
+
v = Array.isArray(v) ? v : [v];
|
|
530
|
+
for (var P = 0; P < v.length; ++P) {
|
|
531
|
+
if (d && d.cause == u + "," + P) return;
|
|
532
|
+
var z = v[P], Y = z.inside, J = !!z.lookbehind, le = !!z.greedy, be = z.alias;
|
|
533
|
+
if (le && !z.pattern.global) {
|
|
534
|
+
var re = z.pattern.toString().match(/[imsuy]*$/)[0];
|
|
535
|
+
z.pattern = RegExp(z.pattern.source, re + "g");
|
|
536
|
+
}
|
|
537
|
+
for (var ae = z.pattern || z, H = o.next, G = i; H !== n.tail && !(d && G >= d.reach); G += H.value.length, H = H.next) {
|
|
538
|
+
var Z = H.value;
|
|
539
|
+
if (n.length > r.length) return;
|
|
540
|
+
if (!(Z instanceof _)) {
|
|
541
|
+
var V, ce = 1;
|
|
542
|
+
if (le) {
|
|
543
|
+
if (!(V = y(ae, G, r, J)) || V.index >= r.length) break;
|
|
544
|
+
var oe = V.index, ne = V.index + V[0].length, Q = G;
|
|
545
|
+
for (Q += H.value.length; oe >= Q; ) Q += (H = H.next).value.length;
|
|
546
|
+
if (G = Q -= H.value.length, H.value instanceof _) continue;
|
|
547
|
+
for (var ee = H; ee !== n.tail && (Q < ne || typeof ee.value == "string"); ee = ee.next) ce++, Q += ee.value.length;
|
|
548
|
+
ce--, Z = r.slice(G, Q), V.index -= G;
|
|
549
|
+
} else if (!(V = y(ae, 0, Z, J))) continue;
|
|
550
|
+
oe = V.index;
|
|
551
|
+
var te = V[0], fe = Z.slice(0, oe), ie = Z.slice(oe + te.length), me = G + Z.length;
|
|
552
|
+
d && me > d.reach && (d.reach = me);
|
|
553
|
+
var ge = H.prev;
|
|
554
|
+
if (fe && (ge = w(n, ge, fe), G += fe.length), L(n, ge, ce), H = w(n, ge, new _(u, Y ? s.tokenize(te, Y) : te, be, te)), ie && w(n, H, ie), ce > 1) {
|
|
555
|
+
var q = { cause: u + "," + P, reach: me };
|
|
556
|
+
m(r, n, a, H.prev, G, q), d && q.reach > d.reach && (d.reach = q.reach);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
655
559
|
}
|
|
656
560
|
}
|
|
657
|
-
},
|
|
658
|
-
/\$(?:\w+|[#?*!@$])/
|
|
659
|
-
],
|
|
660
|
-
// Escape sequences from echo and printf's manuals, and escaped quotes.
|
|
661
|
-
entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
|
|
662
|
-
};
|
|
663
|
-
t.languages.bash = {
|
|
664
|
-
shebang: {
|
|
665
|
-
pattern: /^#!\s*\/.*/,
|
|
666
|
-
alias: "important"
|
|
667
|
-
},
|
|
668
|
-
comment: {
|
|
669
|
-
pattern: /(^|[^"{\\$])#.*/,
|
|
670
|
-
lookbehind: !0
|
|
671
|
-
},
|
|
672
|
-
"function-name": [
|
|
673
|
-
// a) function foo {
|
|
674
|
-
// b) foo() {
|
|
675
|
-
// c) function foo() {
|
|
676
|
-
// but not “foo {”
|
|
677
|
-
{
|
|
678
|
-
// a) and c)
|
|
679
|
-
pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
|
|
680
|
-
lookbehind: !0,
|
|
681
|
-
alias: "function"
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
// b)
|
|
685
|
-
pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
|
|
686
|
-
alias: "function"
|
|
687
561
|
}
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
},
|
|
709
|
-
// Highlight parameter names as variables
|
|
710
|
-
parameter: {
|
|
711
|
-
pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
|
|
712
|
-
alias: "variable",
|
|
713
|
-
lookbehind: !0
|
|
714
|
-
},
|
|
715
|
-
string: [
|
|
716
|
-
// Support for Here-documents https://en.wikipedia.org/wiki/Here_document
|
|
717
|
-
{
|
|
718
|
-
pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
|
|
719
|
-
lookbehind: !0,
|
|
720
|
-
greedy: !0,
|
|
721
|
-
inside: o
|
|
722
|
-
},
|
|
723
|
-
// Here-document with quotes around the tag
|
|
724
|
-
// → No expansion (so no “inside”).
|
|
725
|
-
{
|
|
726
|
-
pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
|
|
727
|
-
lookbehind: !0,
|
|
728
|
-
greedy: !0,
|
|
729
|
-
inside: {
|
|
730
|
-
bash: a
|
|
731
|
-
}
|
|
732
|
-
},
|
|
733
|
-
// “Normal” string
|
|
734
|
-
{
|
|
735
|
-
// https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
|
|
736
|
-
pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
|
|
737
|
-
lookbehind: !0,
|
|
738
|
-
greedy: !0,
|
|
739
|
-
inside: o
|
|
740
|
-
},
|
|
741
|
-
{
|
|
742
|
-
// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
|
|
743
|
-
pattern: /(^|[^$\\])'[^']*'/,
|
|
744
|
-
lookbehind: !0,
|
|
745
|
-
greedy: !0
|
|
746
|
-
},
|
|
747
|
-
{
|
|
748
|
-
// https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
|
|
749
|
-
pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
|
|
750
|
-
greedy: !0,
|
|
751
|
-
inside: {
|
|
752
|
-
entity: o.entity
|
|
753
|
-
}
|
|
562
|
+
}
|
|
563
|
+
function E() {
|
|
564
|
+
var r = { value: null, prev: null, next: null }, n = { value: null, prev: r, next: null };
|
|
565
|
+
r.next = n, this.head = r, this.tail = n, this.length = 0;
|
|
566
|
+
}
|
|
567
|
+
function w(r, n, a) {
|
|
568
|
+
var o = n.next, i = { value: a, prev: n, next: o };
|
|
569
|
+
return n.next = i, o.prev = i, r.length++, i;
|
|
570
|
+
}
|
|
571
|
+
function L(r, n, a) {
|
|
572
|
+
for (var o = n.next, i = 0; i < a && o !== r.tail; i++) o = o.next;
|
|
573
|
+
n.next = o, o.prev = n, r.length -= i;
|
|
574
|
+
}
|
|
575
|
+
if (c.Prism = s, _.stringify = function r(n, a) {
|
|
576
|
+
if (typeof n == "string") return n;
|
|
577
|
+
if (Array.isArray(n)) {
|
|
578
|
+
var o = "";
|
|
579
|
+
return n.forEach(function(P) {
|
|
580
|
+
o += r(P, a);
|
|
581
|
+
}), o;
|
|
754
582
|
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
}
|
|
780
|
-
"
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
583
|
+
var i = { type: n.type, content: r(n.content, a), tag: "span", classes: ["token", n.type], attributes: {}, language: a }, d = n.alias;
|
|
584
|
+
d && (Array.isArray(d) ? Array.prototype.push.apply(i.classes, d) : i.classes.push(d)), s.hooks.run("wrap", i);
|
|
585
|
+
var u = "";
|
|
586
|
+
for (var v in i.attributes) u += " " + v + '="' + (i.attributes[v] || "").replace(/"/g, """) + '"';
|
|
587
|
+
return "<" + i.tag + ' class="' + i.classes.join(" ") + '"' + u + ">" + i.content + "</" + i.tag + ">";
|
|
588
|
+
}, !c.document) return c.addEventListener && (s.disableWorkerMessageHandler || c.addEventListener("message", function(r) {
|
|
589
|
+
var n = JSON.parse(r.data), a = n.language, o = n.code, i = n.immediateClose;
|
|
590
|
+
c.postMessage(s.highlight(o, s.languages[a], a)), i && c.close();
|
|
591
|
+
}, !1)), s;
|
|
592
|
+
var x = s.util.currentScript();
|
|
593
|
+
function R() {
|
|
594
|
+
s.manual || s.highlightAll();
|
|
595
|
+
}
|
|
596
|
+
if (x && (s.filename = x.src, x.hasAttribute("data-manual") && (s.manual = !0)), !s.manual) {
|
|
597
|
+
var U = document.readyState;
|
|
598
|
+
U === "loading" || U === "interactive" && x && x.defer ? document.addEventListener("DOMContentLoaded", R) : window.requestAnimationFrame ? window.requestAnimationFrame(R) : window.setTimeout(R, 16);
|
|
599
|
+
}
|
|
600
|
+
return s;
|
|
601
|
+
}(typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {});
|
|
602
|
+
h.exports && (h.exports = t), ze !== void 0 && (ze.Prism = t), t.languages.markup = { comment: { pattern: /<!--(?:(?!<!--)[\s\S])*?-->/, greedy: !0 }, prolog: { pattern: /<\?[\s\S]+?\?>/, greedy: !0 }, doctype: { pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i, greedy: !0, inside: { "internal-subset": { pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/, lookbehind: !0, greedy: !0, inside: null }, string: { pattern: /"[^"]*"|'[^']*'/, greedy: !0 }, punctuation: /^<!|>$|[[\]]/, "doctype-tag": /^DOCTYPE/i, name: /[^\s<>'"]+/ } }, cdata: { pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i, greedy: !0 }, tag: { pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/, greedy: !0, inside: { tag: { pattern: /^<\/?[^\s>\/]+/, inside: { punctuation: /^<\/?/, namespace: /^[^\s>\/:]+:/ } }, "special-attr": [], "attr-value": { pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/, inside: { punctuation: [{ pattern: /^=/, alias: "attr-equals" }, { pattern: /^(\s*)["']|["']$/, lookbehind: !0 }] } }, punctuation: /\/?>/, "attr-name": { pattern: /[^\s>\/]+/, inside: { namespace: /^[^\s>\/:]+:/ } } } }, entity: [{ pattern: /&[\da-z]{1,8};/i, alias: "named-entity" }, /&#x?[\da-f]{1,8};/i] }, t.languages.markup.tag.inside["attr-value"].inside.entity = t.languages.markup.entity, t.languages.markup.doctype.inside["internal-subset"].inside = t.languages.markup, t.hooks.add("wrap", function(c) {
|
|
603
|
+
c.type === "entity" && (c.attributes.title = c.content.replace(/&/, "&"));
|
|
604
|
+
}), Object.defineProperty(t.languages.markup.tag, "addInlined", { value: function(c, p) {
|
|
605
|
+
var b = {};
|
|
606
|
+
b["language-" + p] = { pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i, lookbehind: !0, inside: t.languages[p] }, b.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
607
|
+
var k = { "included-cdata": { pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i, inside: b } };
|
|
608
|
+
k["language-" + p] = { pattern: /[\s\S]+/, inside: t.languages[p] };
|
|
609
|
+
var s = {};
|
|
610
|
+
s[c] = { pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
611
|
+
return c;
|
|
612
|
+
}), "i"), lookbehind: !0, greedy: !0, inside: k }, t.languages.insertBefore("markup", "cdata", s);
|
|
613
|
+
} }), Object.defineProperty(t.languages.markup.tag, "addAttribute", { value: function(c, p) {
|
|
614
|
+
t.languages.markup.tag.inside["special-attr"].push({ pattern: RegExp(/(^|["'\s])/.source + "(?:" + c + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, "i"), lookbehind: !0, inside: { "attr-name": /^[^\s=]+/, "attr-value": { pattern: /=[\s\S]+/, inside: { value: { pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/, lookbehind: !0, alias: [p, "language-" + p], inside: t.languages[p] }, punctuation: [{ pattern: /^=/, alias: "attr-equals" }, /"|'/] } } } });
|
|
615
|
+
} }), t.languages.html = t.languages.markup, t.languages.mathml = t.languages.markup, t.languages.svg = t.languages.markup, t.languages.xml = t.languages.extend("markup", {}), t.languages.ssml = t.languages.xml, t.languages.atom = t.languages.xml, t.languages.rss = t.languages.xml, function(c) {
|
|
616
|
+
var p = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
617
|
+
c.languages.css = { comment: /\/\*[\s\S]*?\*\//, atrule: { pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + p.source + ")*?" + /(?:;|(?=\s*\{))/.source), inside: { rule: /^@[\w-]+/, "selector-function-argument": { pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/, lookbehind: !0, alias: "selector" }, keyword: { pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/, lookbehind: !0 } } }, url: { pattern: RegExp("\\burl\\((?:" + p.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"), greedy: !0, inside: { function: /^url/i, punctuation: /^\(|\)$/, string: { pattern: RegExp("^" + p.source + "$"), alias: "url" } } }, selector: { pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + p.source + ")*(?=\\s*\\{)"), lookbehind: !0 }, string: { pattern: p, greedy: !0 }, property: { pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i, lookbehind: !0 }, important: /!important\b/i, function: { pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i, lookbehind: !0 }, punctuation: /[(){};:,]/ }, c.languages.css.atrule.inside.rest = c.languages.css;
|
|
618
|
+
var b = c.languages.markup;
|
|
619
|
+
b && (b.tag.addInlined("style", "css"), b.tag.addAttribute("style", "css"));
|
|
620
|
+
}(t), t.languages.clike = { comment: [{ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, lookbehind: !0, greedy: !0 }, { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }], string: { pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, greedy: !0 }, "class-name": { pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i, lookbehind: !0, inside: { punctuation: /[.\\]/ } }, keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/, boolean: /\b(?:false|true)\b/, function: /\b\w+(?=\()/, number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, punctuation: /[{}[\];(),.:]/ }, t.languages.javascript = t.languages.extend("clike", { "class-name": [t.languages.clike["class-name"], { pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/, lookbehind: !0 }], keyword: [{ pattern: /((?:^|\})\s*)catch\b/, lookbehind: !0 }, { pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, lookbehind: !0 }], function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, number: { pattern: RegExp(/(^|[^\w$])/.source + "(?:" + /NaN|Infinity/.source + "|" + /0[bB][01]+(?:_[01]+)*n?/.source + "|" + /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + /\d+(?:_\d+)*n/.source + "|" + /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source + ")" + /(?![\w$])/.source), lookbehind: !0 }, operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/ }), t.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, t.languages.insertBefore("javascript", "keyword", { regex: { pattern: RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source), lookbehind: !0, greedy: !0, inside: { "regex-source": { pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/, lookbehind: !0, alias: "language-regex", inside: t.languages.regex }, "regex-delimiter": /^\/|\/$/, "regex-flags": /^[a-z]+$/ } }, "function-variable": { pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/, alias: "function" }, parameter: [{ pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/, lookbehind: !0, inside: t.languages.javascript }, { pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i, lookbehind: !0, inside: t.languages.javascript }, { pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/, lookbehind: !0, inside: t.languages.javascript }, { pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/, lookbehind: !0, inside: t.languages.javascript }], constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/ }), t.languages.insertBefore("javascript", "string", { hashbang: { pattern: /^#!.*/, greedy: !0, alias: "comment" }, "template-string": { pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/, greedy: !0, inside: { "template-punctuation": { pattern: /^`|`$/, alias: "string" }, interpolation: { pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, lookbehind: !0, inside: { "interpolation-punctuation": { pattern: /^\$\{|\}$/, alias: "punctuation" }, rest: t.languages.javascript } }, string: /[\s\S]+/ } }, "string-property": { pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m, lookbehind: !0, greedy: !0, alias: "property" } }), t.languages.insertBefore("javascript", "operator", { "literal-property": { pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m, lookbehind: !0, alias: "property" } }), t.languages.markup && (t.languages.markup.tag.addInlined("script", "javascript"), t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source, "javascript")), t.languages.js = t.languages.javascript, function() {
|
|
621
|
+
if (t !== void 0 && typeof document < "u") {
|
|
622
|
+
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
623
|
+
var c = { js: "javascript", py: "python", rb: "ruby", ps1: "powershell", psm1: "powershell", sh: "bash", bat: "batch", h: "c", tex: "latex" }, p = "data-src-status", b = "loading", k = "loaded", s = "pre[data-src]:not([" + p + '="' + k + '"]):not([' + p + '="' + b + '"])';
|
|
624
|
+
t.hooks.add("before-highlightall", function(y) {
|
|
625
|
+
y.selector += ", " + s;
|
|
626
|
+
}), t.hooks.add("before-sanity-check", function(y) {
|
|
627
|
+
var m = y.element;
|
|
628
|
+
if (m.matches(s)) {
|
|
629
|
+
y.code = "", m.setAttribute(p, b);
|
|
630
|
+
var E = m.appendChild(document.createElement("CODE"));
|
|
631
|
+
E.textContent = "Loading…";
|
|
632
|
+
var w = m.getAttribute("data-src"), L = y.language;
|
|
633
|
+
if (L === "none") {
|
|
634
|
+
var x = (/\.(\w+)$/.exec(w) || [, "none"])[1];
|
|
635
|
+
L = c[x] || x;
|
|
636
|
+
}
|
|
637
|
+
t.util.setLanguage(E, L), t.util.setLanguage(m, L);
|
|
638
|
+
var R = t.plugins.autoloader;
|
|
639
|
+
R && R.loadLanguages(L), function(U, r, n) {
|
|
640
|
+
var a = new XMLHttpRequest();
|
|
641
|
+
a.open("GET", U, !0), a.onreadystatechange = function() {
|
|
642
|
+
a.readyState == 4 && (a.status < 400 && a.responseText ? r(a.responseText) : a.status >= 400 ? n("✖ Error " + a.status + " while fetching file: " + a.statusText) : n("✖ Error: File does not exist or is empty"));
|
|
643
|
+
}, a.send(null);
|
|
644
|
+
}(w, function(U) {
|
|
645
|
+
m.setAttribute(p, k);
|
|
646
|
+
var r = function(i) {
|
|
647
|
+
var d = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(i || "");
|
|
648
|
+
if (d) {
|
|
649
|
+
var u = Number(d[1]), v = d[2], P = d[3];
|
|
650
|
+
return v ? P ? [u, Number(P)] : [u, void 0] : [u, u];
|
|
651
|
+
}
|
|
652
|
+
}(m.getAttribute("data-range"));
|
|
653
|
+
if (r) {
|
|
654
|
+
var n = U.split(/\r\n?|\n/g), a = r[0], o = r[1] == null ? n.length : r[1];
|
|
655
|
+
a < 0 && (a += n.length), a = Math.max(0, Math.min(a - 1, n.length)), o < 0 && (o += n.length), o = Math.max(0, Math.min(o, n.length)), U = n.slice(a, o).join(`
|
|
656
|
+
`), m.hasAttribute("data-start") || m.setAttribute("data-start", String(a + 1));
|
|
657
|
+
}
|
|
658
|
+
E.textContent = U, t.highlightElement(E);
|
|
659
|
+
}, function(U) {
|
|
660
|
+
m.setAttribute(p, "failed"), E.textContent = U;
|
|
661
|
+
});
|
|
791
662
|
}
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
663
|
+
}), t.plugins.fileHighlight = { highlight: function(y) {
|
|
664
|
+
for (var m, E = (y || document).querySelectorAll(s), w = 0; m = E[w++]; ) t.highlightElement(m);
|
|
665
|
+
} };
|
|
666
|
+
var _ = !1;
|
|
667
|
+
t.fileHighlight = function() {
|
|
668
|
+
_ || (_ = !0), t.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
669
|
+
};
|
|
798
670
|
}
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
],
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
})(Prism
|
|
820
|
-
Prism
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
};
|
|
844
|
-
Prism.languages.webmanifest = Prism.languages.json;
|
|
845
|
-
const Re = `
|
|
671
|
+
}();
|
|
672
|
+
})(We);
|
|
673
|
+
const Me = Ve(We.exports);
|
|
674
|
+
Prism.languages.clike = { comment: [{ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, lookbehind: !0, greedy: !0 }, { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }], string: { pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, greedy: !0 }, "class-name": { pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i, lookbehind: !0, inside: { punctuation: /[.\\]/ } }, keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/, boolean: /\b(?:false|true)\b/, function: /\b\w+(?=\()/, number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, punctuation: /[{}[\];(),.:]/ }, Prism.languages.javascript = Prism.languages.extend("clike", { "class-name": [Prism.languages.clike["class-name"], { pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/, lookbehind: !0 }], keyword: [{ pattern: /((?:^|\})\s*)catch\b/, lookbehind: !0 }, { pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, lookbehind: !0 }], function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, number: { pattern: RegExp(/(^|[^\w$])/.source + "(?:" + /NaN|Infinity/.source + "|" + /0[bB][01]+(?:_[01]+)*n?/.source + "|" + /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + /\d+(?:_\d+)*n/.source + "|" + /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source + ")" + /(?![\w$])/.source), lookbehind: !0 }, operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/ }), Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, Prism.languages.insertBefore("javascript", "keyword", { regex: { pattern: RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source), lookbehind: !0, greedy: !0, inside: { "regex-source": { pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/, lookbehind: !0, alias: "language-regex", inside: Prism.languages.regex }, "regex-delimiter": /^\/|\/$/, "regex-flags": /^[a-z]+$/ } }, "function-variable": { pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/, alias: "function" }, parameter: [{ pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/, lookbehind: !0, inside: Prism.languages.javascript }, { pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i, lookbehind: !0, inside: Prism.languages.javascript }, { pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/, lookbehind: !0, inside: Prism.languages.javascript }, { pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/, lookbehind: !0, inside: Prism.languages.javascript }], constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/ }), Prism.languages.insertBefore("javascript", "string", { hashbang: { pattern: /^#!.*/, greedy: !0, alias: "comment" }, "template-string": { pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/, greedy: !0, inside: { "template-punctuation": { pattern: /^`|`$/, alias: "string" }, interpolation: { pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, lookbehind: !0, inside: { "interpolation-punctuation": { pattern: /^\$\{|\}$/, alias: "punctuation" }, rest: Prism.languages.javascript } }, string: /[\s\S]+/ } }, "string-property": { pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m, lookbehind: !0, greedy: !0, alias: "property" } }), Prism.languages.insertBefore("javascript", "operator", { "literal-property": { pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m, lookbehind: !0, alias: "property" } }), Prism.languages.markup && (Prism.languages.markup.tag.addInlined("script", "javascript"), Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source, "javascript")), Prism.languages.js = Prism.languages.javascript, Prism.languages.python = { comment: { pattern: /(^|[^\\])#.*/, lookbehind: !0, greedy: !0 }, "string-interpolation": { pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i, greedy: !0, inside: { interpolation: { pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/, lookbehind: !0, inside: { "format-spec": { pattern: /(:)[^:(){}]+(?=\}$)/, lookbehind: !0 }, "conversion-option": { pattern: //, alias: "punctuation" }, rest: null } }, string: /[\s\S]+/ } }, "triple-quoted-string": { pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i, greedy: !0, alias: "string" }, string: { pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i, greedy: !0 }, function: { pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g, lookbehind: !0 }, "class-name": { pattern: /(\bclass\s+)\w+/i, lookbehind: !0 }, decorator: { pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m, lookbehind: !0, alias: ["annotation", "punctuation"], inside: { punctuation: /\./ } }, keyword: /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/, builtin: /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/, boolean: /\b(?:False|None|True)\b/, number: /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i, operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, punctuation: /[{}[\];(),.:]/ }, Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python, Prism.languages.py = Prism.languages.python, Prism.languages.go = Prism.languages.extend("clike", { string: { pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/, lookbehind: !0, greedy: !0 }, keyword: /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/, boolean: /\b(?:_|false|iota|nil|true)\b/, number: [/\b0(?:b[01_]+|o[0-7_]+)i?\b/i, /\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i, /(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i], operator: /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./, builtin: /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/ }), Prism.languages.insertBefore("go", "string", { char: { pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/, greedy: !0 } }), delete Prism.languages.go["class-name"], function(h) {
|
|
675
|
+
var t = /\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/, c = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, p = { pattern: RegExp(/(^|[^\w.])/.source + c + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source), lookbehind: !0, inside: { namespace: { pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/, inside: { punctuation: /\./ } }, punctuation: /\./ } };
|
|
676
|
+
h.languages.java = h.languages.extend("clike", { string: { pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/, lookbehind: !0, greedy: !0 }, "class-name": [p, { pattern: RegExp(/(^|[^\w.])/.source + c + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source), lookbehind: !0, inside: p.inside }, { pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + c + /[A-Z]\w*\b/.source), lookbehind: !0, inside: p.inside }], keyword: t, function: [h.languages.clike.function, { pattern: /(::\s*)[a-z_]\w*/, lookbehind: !0 }], number: /\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i, operator: { pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m, lookbehind: !0 }, constant: /\b[A-Z][A-Z_\d]+\b/ }), h.languages.insertBefore("java", "string", { "triple-quoted-string": { pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/, greedy: !0, alias: "string" }, char: { pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/, greedy: !0 } }), h.languages.insertBefore("java", "class-name", { annotation: { pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/, lookbehind: !0, alias: "punctuation" }, generics: { pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/, inside: { "class-name": p, keyword: t, punctuation: /[<>(),.:]/, operator: /[?&|]/ } }, import: [{ pattern: RegExp(/(\bimport\s+)/.source + c + /(?:[A-Z]\w*|\*)(?=\s*;)/.source), lookbehind: !0, inside: { namespace: p.inside.namespace, punctuation: /\./, operator: /\*/, "class-name": /\w+/ } }, { pattern: RegExp(/(\bimport\s+static\s+)/.source + c + /(?:\w+|\*)(?=\s*;)/.source), lookbehind: !0, alias: "static", inside: { namespace: p.inside.namespace, static: /\b\w+$/, punctuation: /\./, operator: /\*/, "class-name": /\w+/ } }], namespace: { pattern: RegExp(/(\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() {
|
|
677
|
+
return t.source;
|
|
678
|
+
})), lookbehind: !0, inside: { punctuation: /\./ } } });
|
|
679
|
+
}(Prism), Prism.languages.c = Prism.languages.extend("clike", { comment: { pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/, greedy: !0 }, string: { pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, greedy: !0 }, "class-name": { pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/, lookbehind: !0 }, keyword: /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/, function: /\b[a-z_]\w*(?=\s*\()/i, number: /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i, operator: />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/ }), Prism.languages.insertBefore("c", "string", { char: { pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/, greedy: !0 } }), Prism.languages.insertBefore("c", "string", { macro: { pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im, lookbehind: !0, greedy: !0, alias: "property", inside: { string: [{ pattern: /^(#\s*include\s*)<[^>]+>/, lookbehind: !0 }, Prism.languages.c.string], char: Prism.languages.c.char, comment: Prism.languages.c.comment, "macro-name": [{ pattern: /(^#\s*define\s+)\w+\b(?!\()/i, lookbehind: !0 }, { pattern: /(^#\s*define\s+)\w+\b(?=\()/i, lookbehind: !0, alias: "function" }], directive: { pattern: /^(#\s*)[a-z]+/, lookbehind: !0, alias: "keyword" }, "directive-hash": /^#/, punctuation: /##|\\(?=[\r\n])/, expression: { pattern: /\S[\s\S]*/, inside: Prism.languages.c } } } }), Prism.languages.insertBefore("c", "function", { constant: /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/ }), delete Prism.languages.c.boolean, function(h) {
|
|
680
|
+
for (var t = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, c = 0; c < 2; c++) t = t.replace(/<self>/g, function() {
|
|
681
|
+
return t;
|
|
682
|
+
});
|
|
683
|
+
t = t.replace(/<self>/g, function() {
|
|
684
|
+
return /[^\s\S]/.source;
|
|
685
|
+
}), h.languages.rust = { comment: [{ pattern: RegExp(/(^|[^\\])/.source + t), lookbehind: !0, greedy: !0 }, { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }], string: { pattern: /b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/, greedy: !0 }, char: { pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/, greedy: !0 }, attribute: { pattern: /#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/, greedy: !0, alias: "attr-name", inside: { string: null } }, "closure-params": { pattern: /([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/, lookbehind: !0, greedy: !0, inside: { "closure-punctuation": { pattern: /^\||\|$/, alias: "punctuation" }, rest: null } }, "lifetime-annotation": { pattern: /'\w+/, alias: "symbol" }, "fragment-specifier": { pattern: /(\$\w+:)[a-z]+/, lookbehind: !0, alias: "punctuation" }, variable: /\$\w+/, "function-definition": { pattern: /(\bfn\s+)\w+/, lookbehind: !0, alias: "function" }, "type-definition": { pattern: /(\b(?:enum|struct|trait|type|union)\s+)\w+/, lookbehind: !0, alias: "class-name" }, "module-declaration": [{ pattern: /(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/, lookbehind: !0, alias: "namespace" }, { pattern: /(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/, lookbehind: !0, alias: "namespace", inside: { punctuation: /::/ } }], keyword: [/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/, /\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/], function: /\b[a-z_]\w*(?=\s*(?:::\s*<|\())/, macro: { pattern: /\b\w+!/, alias: "property" }, constant: /\b[A-Z_][A-Z_\d]+\b/, "class-name": /\b[A-Z]\w*\b/, namespace: { pattern: /(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/, inside: { punctuation: /::/ } }, number: /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/, boolean: /\b(?:false|true)\b/, punctuation: /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/, operator: /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/ }, h.languages.rust["closure-params"].inside.rest = h.languages.rust, h.languages.rust.attribute.inside.string = h.languages.rust.string;
|
|
686
|
+
}(Prism), Prism.languages.sql = { comment: { pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/, lookbehind: !0 }, variable: [{ pattern: /@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/, greedy: !0 }, /@[\w.$]+/], string: { pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/, greedy: !0, lookbehind: !0 }, identifier: { pattern: /(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/, greedy: !0, lookbehind: !0, inside: { punctuation: /^`|`$/ } }, function: /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i, keyword: /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i, boolean: /\b(?:FALSE|NULL|TRUE)\b/i, number: /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i, operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i, punctuation: /[;[\]()`,.]/ }, function(h) {
|
|
687
|
+
var t = "\\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", c = { pattern: /(^(["']?)\w+\2)[ \t]+\S.*/, lookbehind: !0, alias: "punctuation", inside: null }, p = { bash: c, environment: { pattern: RegExp("\\$" + t), alias: "constant" }, variable: [{ pattern: /\$?\(\([\s\S]+?\)\)/, greedy: !0, inside: { variable: [{ pattern: /(^\$\(\([\s\S]+)\)\)/, lookbehind: !0 }, /^\$\(\(/], number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/, operator: /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/, punctuation: /\(\(?|\)\)?|,|;/ } }, { pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/, greedy: !0, inside: { variable: /^\$\(|^`|\)$|`$/ } }, { pattern: /\$\{[^}]+\}/, greedy: !0, inside: { operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/, punctuation: /[\[\]]/, environment: { pattern: RegExp("(\\{)" + t), lookbehind: !0, alias: "constant" } } }, /\$(?:\w+|[#?*!@$])/], entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/ };
|
|
688
|
+
h.languages.bash = { shebang: { pattern: /^#!\s*\/.*/, alias: "important" }, comment: { pattern: /(^|[^"{\\$])#.*/, lookbehind: !0 }, "function-name": [{ pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/, lookbehind: !0, alias: "function" }, { pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/, alias: "function" }], "for-or-select": { pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/, alias: "variable", lookbehind: !0 }, "assign-left": { pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/, inside: { environment: { pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + t), lookbehind: !0, alias: "constant" } }, alias: "variable", lookbehind: !0 }, parameter: { pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/, alias: "variable", lookbehind: !0 }, string: [{ pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/, lookbehind: !0, greedy: !0, inside: p }, { pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/, lookbehind: !0, greedy: !0, inside: { bash: c } }, { pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/, lookbehind: !0, greedy: !0, inside: p }, { pattern: /(^|[^$\\])'[^']*'/, lookbehind: !0, greedy: !0 }, { pattern: /\$'(?:[^'\\]|\\[\s\S])*'/, greedy: !0, inside: { entity: p.entity } }], environment: { pattern: RegExp("\\$?" + t), alias: "constant" }, variable: p.variable, function: { pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/, lookbehind: !0 }, keyword: { pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/, lookbehind: !0 }, builtin: { pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/, lookbehind: !0, alias: "class-name" }, boolean: { pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/, lookbehind: !0 }, "file-descriptor": { pattern: /\B&\d\b/, alias: "important" }, operator: { pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/, inside: { "file-descriptor": { pattern: /^\d/, alias: "important" } } }, punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/, number: { pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/, lookbehind: !0 } }, c.inside = h.languages.bash;
|
|
689
|
+
for (var b = ["comment", "function-name", "for-or-select", "assign-left", "parameter", "string", "environment", "function", "keyword", "builtin", "boolean", "file-descriptor", "operator", "punctuation", "number"], k = p.variable[1].inside, s = 0; s < b.length; s++) k[b[s]] = h.languages.bash[b[s]];
|
|
690
|
+
h.languages.sh = h.languages.bash, h.languages.shell = h.languages.bash;
|
|
691
|
+
}(Prism), Prism.languages.json = { property: { pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/, lookbehind: !0, greedy: !0 }, string: { pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/, lookbehind: !0, greedy: !0 }, comment: { pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, greedy: !0 }, number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, punctuation: /[{}[\],]/, operator: /:/, boolean: /\b(?:false|true)\b/, null: { pattern: /\bnull\b/, alias: "keyword" } }, Prism.languages.webmanifest = Prism.languages.json;
|
|
692
|
+
window.Prism = Me;
|
|
693
|
+
const qe = { javascript: "javascript", js: "javascript", typescript: "typescript", ts: "typescript", python: "python", py: "python", java: "java", c: "c", cpp: "cpp", "c++": "cpp", csharp: "csharp", "c#": "csharp", go: "go", golang: "go", rust: "rust", ruby: "ruby", rb: "ruby", php: "php", swift: "swift", kotlin: "kotlin", kt: "kotlin", sql: "sql", bash: "bash", sh: "bash", shell: "bash", json: "json", yaml: "yaml", yml: "yaml", markdown: "markdown", md: "markdown" }, Je = ({ value: h, language: t, theme: c = "dark", disabled: p = !1, onChange: b, onCodeChange: k }) => {
|
|
694
|
+
const s = Ne(null), _ = Ne(null), y = Ne(null), m = Se(() => qe[t.toLowerCase()] || "javascript", [t]), E = c === "dark" ? "#1e1e1e" : "#fafafa", w = Se(() => {
|
|
695
|
+
try {
|
|
696
|
+
const x = Me.languages[m];
|
|
697
|
+
if (x) return Me.highlight(h || "", x, m);
|
|
698
|
+
} catch {
|
|
699
|
+
}
|
|
700
|
+
return function(x) {
|
|
701
|
+
const R = document.createElement("div");
|
|
702
|
+
return R.textContent = x, R.innerHTML;
|
|
703
|
+
}(h || "");
|
|
704
|
+
}, [h, m]), L = he((x) => {
|
|
705
|
+
y.current && clearTimeout(y.current), y.current = setTimeout(() => {
|
|
706
|
+
k == null || k(x);
|
|
707
|
+
}, 500);
|
|
708
|
+
}, [k]);
|
|
709
|
+
return ve(() => () => {
|
|
710
|
+
y.current && clearTimeout(y.current);
|
|
711
|
+
}, []), ve(() => {
|
|
712
|
+
(function(x) {
|
|
713
|
+
if (typeof document > "u") return;
|
|
714
|
+
const R = "hep-cr-prism-styles", U = document.getElementById(R), r = x === "dark" ? `
|
|
846
715
|
/* 默认代码颜色 */
|
|
847
716
|
.hep-cr-editor .hep-cr-highlight code,
|
|
848
717
|
.hep-cr-editor .hep-cr-highlight pre {
|
|
@@ -926,7 +795,7 @@ const Re = `
|
|
|
926
795
|
.hep-cr-editor .token.console {
|
|
927
796
|
color: #f8f8f2 !important;
|
|
928
797
|
}
|
|
929
|
-
|
|
798
|
+
` : `
|
|
930
799
|
/* 默认代码颜色 */
|
|
931
800
|
.hep-cr-editor .hep-cr-highlight code,
|
|
932
801
|
.hep-cr-editor .hep-cr-highlight pre {
|
|
@@ -1004,114 +873,30 @@ const Re = `
|
|
|
1004
873
|
color: #333 !important;
|
|
1005
874
|
}
|
|
1006
875
|
`;
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
java: "java",
|
|
1023
|
-
c: "c",
|
|
1024
|
-
cpp: "cpp",
|
|
1025
|
-
"c++": "cpp",
|
|
1026
|
-
csharp: "csharp",
|
|
1027
|
-
"c#": "csharp",
|
|
1028
|
-
go: "go",
|
|
1029
|
-
golang: "go",
|
|
1030
|
-
rust: "rust",
|
|
1031
|
-
ruby: "ruby",
|
|
1032
|
-
rb: "ruby",
|
|
1033
|
-
php: "php",
|
|
1034
|
-
swift: "swift",
|
|
1035
|
-
kotlin: "kotlin",
|
|
1036
|
-
kt: "kotlin",
|
|
1037
|
-
sql: "sql",
|
|
1038
|
-
bash: "bash",
|
|
1039
|
-
sh: "bash",
|
|
1040
|
-
shell: "bash",
|
|
1041
|
-
json: "json",
|
|
1042
|
-
yaml: "yaml",
|
|
1043
|
-
yml: "yaml",
|
|
1044
|
-
markdown: "markdown",
|
|
1045
|
-
md: "markdown"
|
|
1046
|
-
};
|
|
1047
|
-
function _e(t) {
|
|
1048
|
-
const r = document.createElement("div");
|
|
1049
|
-
return r.textContent = t, r.innerHTML;
|
|
1050
|
-
}
|
|
1051
|
-
const Fe = ({
|
|
1052
|
-
value: t,
|
|
1053
|
-
language: r,
|
|
1054
|
-
theme: a = "dark",
|
|
1055
|
-
disabled: o = !1,
|
|
1056
|
-
onChange: s,
|
|
1057
|
-
onCodeChange: u
|
|
1058
|
-
}) => {
|
|
1059
|
-
const h = P(null), f = P(null), y = P(null), m = v(() => Le[r.toLowerCase()] || "javascript", [r]), b = a === "dark" ? "#1e1e1e" : "#fafafa", g = v(() => {
|
|
1060
|
-
try {
|
|
1061
|
-
const l = J.languages[m];
|
|
1062
|
-
if (l)
|
|
1063
|
-
return J.highlight(t || "", l, m);
|
|
1064
|
-
} catch {
|
|
1065
|
-
}
|
|
1066
|
-
return _e(t || "");
|
|
1067
|
-
}, [t, m]), S = k((l) => {
|
|
1068
|
-
y.current && clearTimeout(y.current), y.current = setTimeout(() => {
|
|
1069
|
-
u == null || u(l);
|
|
1070
|
-
}, 500);
|
|
1071
|
-
}, [u]), A = (l) => {
|
|
1072
|
-
const d = l.target.value;
|
|
1073
|
-
s == null || s(d), S(d);
|
|
1074
|
-
}, O = () => {
|
|
1075
|
-
h.current && f.current && (f.current.scrollTop = h.current.scrollTop, f.current.scrollLeft = h.current.scrollLeft);
|
|
1076
|
-
}, E = (l) => {
|
|
1077
|
-
if (l.key === "Tab") {
|
|
1078
|
-
l.preventDefault();
|
|
1079
|
-
const d = l.target, M = d.selectionStart, x = d.selectionEnd, U = t.substring(0, M) + " " + t.substring(x);
|
|
1080
|
-
s == null || s(U), S(U), requestAnimationFrame(() => {
|
|
1081
|
-
d.selectionStart = d.selectionEnd = M + 2;
|
|
876
|
+
U && U.remove();
|
|
877
|
+
const n = document.createElement("style");
|
|
878
|
+
n.id = R, n.textContent = r, document.head.appendChild(n);
|
|
879
|
+
})(c);
|
|
880
|
+
}, [c]), l.jsxs("div", { className: `hep-cr-editor theme-${c}`, style: { background: E }, children: [l.jsx("pre", { ref: _, className: `hep-cr-highlight language-${m}`, "aria-hidden": "true", children: l.jsx("code", { dangerouslySetInnerHTML: { __html: w } }) }), l.jsx("textarea", { ref: s, className: "hep-cr-input", value: h, disabled: p, onChange: (x) => {
|
|
881
|
+
const R = x.target.value;
|
|
882
|
+
b == null || b(R), L(R);
|
|
883
|
+
}, onScroll: () => {
|
|
884
|
+
s.current && _.current && (_.current.scrollTop = s.current.scrollTop, _.current.scrollLeft = s.current.scrollLeft);
|
|
885
|
+
}, onKeyDown: (x) => {
|
|
886
|
+
if (x.key === "Tab") {
|
|
887
|
+
x.preventDefault();
|
|
888
|
+
const R = x.target, U = R.selectionStart, r = R.selectionEnd, n = h.substring(0, U) + " " + h.substring(r);
|
|
889
|
+
b == null || b(n), L(n), requestAnimationFrame(() => {
|
|
890
|
+
R.selectionStart = R.selectionEnd = U + 2;
|
|
1082
891
|
});
|
|
1083
892
|
}
|
|
1084
|
-
};
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
"pre",
|
|
1092
|
-
{
|
|
1093
|
-
ref: f,
|
|
1094
|
-
className: `hep-cr-highlight language-${m}`,
|
|
1095
|
-
"aria-hidden": "true",
|
|
1096
|
-
children: /* @__PURE__ */ e("code", { dangerouslySetInnerHTML: { __html: g } })
|
|
1097
|
-
}
|
|
1098
|
-
),
|
|
1099
|
-
/* @__PURE__ */ e(
|
|
1100
|
-
"textarea",
|
|
1101
|
-
{
|
|
1102
|
-
ref: h,
|
|
1103
|
-
className: "hep-cr-input",
|
|
1104
|
-
value: t,
|
|
1105
|
-
disabled: o,
|
|
1106
|
-
onChange: A,
|
|
1107
|
-
onScroll: O,
|
|
1108
|
-
onKeyDown: E,
|
|
1109
|
-
spellCheck: !1,
|
|
1110
|
-
placeholder: "Write your code here..."
|
|
1111
|
-
}
|
|
1112
|
-
)
|
|
1113
|
-
] });
|
|
1114
|
-
}, De = `
|
|
893
|
+
}, spellCheck: !1, placeholder: "Write your code here..." })] });
|
|
894
|
+
};
|
|
895
|
+
if (typeof document < "u") {
|
|
896
|
+
const h = "hep-cr-editor-styles";
|
|
897
|
+
if (!document.getElementById(h)) {
|
|
898
|
+
const t = document.createElement("style");
|
|
899
|
+
t.id = h, t.textContent = `
|
|
1115
900
|
.hep-cr-editor {
|
|
1116
901
|
position: relative;
|
|
1117
902
|
flex: 1;
|
|
@@ -1168,273 +953,189 @@ const Fe = ({
|
|
|
1168
953
|
.theme-light .hep-cr-input {
|
|
1169
954
|
caret-color: #333333;
|
|
1170
955
|
}
|
|
1171
|
-
|
|
1172
|
-
if (typeof document < "u") {
|
|
1173
|
-
const t = "hep-cr-editor-styles";
|
|
1174
|
-
if (!document.getElementById(t)) {
|
|
1175
|
-
const r = document.createElement("style");
|
|
1176
|
-
r.id = t, r.textContent = De, document.head.appendChild(r);
|
|
956
|
+
`, document.head.appendChild(t);
|
|
1177
957
|
}
|
|
1178
958
|
}
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
"
|
|
1208
|
-
|
|
1209
|
-
"
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
959
|
+
var Qe = Object.defineProperty, Ge = (h, t, c) => ((p, b, k) => b in p ? Qe(p, b, { enumerable: !0, configurable: !0, writable: !0, value: k }) : p[b] = k)(h, typeof t != "symbol" ? t + "" : t, c);
|
|
960
|
+
let Pe = null;
|
|
961
|
+
class en {
|
|
962
|
+
constructor(t = {}) {
|
|
963
|
+
Ge(this, "baseUrl"), Ge(this, "timeout"), this.baseUrl = t.pistonUrl || "/api/piston", this.timeout = t.timeout || 3e3;
|
|
964
|
+
}
|
|
965
|
+
async getRuntimes(t = !1) {
|
|
966
|
+
if (Pe && !t) return Pe;
|
|
967
|
+
try {
|
|
968
|
+
const c = await fetch(`${this.baseUrl}/runtimes`, { method: "GET", headers: { "Content-Type": "application/json" } });
|
|
969
|
+
if (!c.ok) throw new Error(`Failed to fetch runtimes: ${c.statusText}`);
|
|
970
|
+
const p = await c.json();
|
|
971
|
+
return Pe = p, p;
|
|
972
|
+
} catch (c) {
|
|
973
|
+
throw c;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
async execute(t, c, p = {}) {
|
|
977
|
+
const b = (await this.getRuntimes()).find((y) => {
|
|
978
|
+
var m;
|
|
979
|
+
return y.language.toLowerCase() === t.toLowerCase() || ((m = y.aliases) == null ? void 0 : m.some((E) => E.toLowerCase() === t.toLowerCase()));
|
|
980
|
+
});
|
|
981
|
+
if (!b) throw new Error(`Language '${t}' is not supported`);
|
|
982
|
+
const k = this.getFileName(t), s = { language: b.language, version: p.version || b.version, files: [{ name: k, content: c }], stdin: p.stdin || "", args: p.args || [], run_timeout: p.runTimeout || this.timeout, compile_timeout: this.timeout }, _ = Date.now();
|
|
983
|
+
try {
|
|
984
|
+
const y = await fetch(`${this.baseUrl}/execute`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(s) });
|
|
985
|
+
if (!y.ok) throw new Error(`Execute failed: ${y.statusText}`);
|
|
986
|
+
const m = await y.json(), E = Date.now() - _, w = m.run.stdout || "", L = m.run.stderr || "";
|
|
987
|
+
return { success: m.run.code === 0, output: w, stderr: L, code: m.run.code, executionTime: E, compile: m.compile ? { stdout: m.compile.stdout || "", stderr: m.compile.stderr || "", code: m.compile.code } : void 0 };
|
|
988
|
+
} catch (y) {
|
|
989
|
+
return { success: !1, output: "", stderr: y instanceof Error ? y.message : "Unknown error", code: -1, executionTime: Date.now() - _ };
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
getFileName(t) {
|
|
993
|
+
return { javascript: "main.js", typescript: "main.ts", python: "main.py", python3: "main.py", go: "main.go", rust: "main.rs", java: "Main.java", c: "main.c", cpp: "main.cpp", csharp: "Main.cs", ruby: "main.rb", php: "main.php", bash: "main.sh", shell: "main.sh", perl: "main.pl", lua: "main.lua", swift: "main.swift", kotlin: "Main.kt", scala: "Main.scala", haskell: "main.hs", dart: "main.dart", html: "index.html", css: "style.css", sql: "query.sql", markdown: "readme.md" }[t.toLowerCase()] || `main.${t}`;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
const nn = { javascript: 'console.log("Hello, World!");', typescript: 'console.log("Hello, World!");', python: 'print("Hello, World!")', python3: 'print("Hello, World!")', go: `package main
|
|
997
|
+
|
|
998
|
+
import "fmt"
|
|
999
|
+
|
|
1000
|
+
func main() {
|
|
1001
|
+
fmt.Println("Hello, World!")
|
|
1002
|
+
}`, rust: `fn main() {
|
|
1003
|
+
println!("Hello, World!");
|
|
1004
|
+
}`, java: `public class Main {
|
|
1005
|
+
public static void main(String[] args) {
|
|
1006
|
+
System.out.println("Hello, World!");
|
|
1007
|
+
}
|
|
1008
|
+
}`, c: `#include <stdio.h>
|
|
1009
|
+
|
|
1010
|
+
int main() {
|
|
1011
|
+
printf("Hello, World!\\n");
|
|
1012
|
+
return 0;
|
|
1013
|
+
}`, cpp: `#include <iostream>
|
|
1014
|
+
|
|
1015
|
+
int main() {
|
|
1016
|
+
std::cout << "Hello, World!" << std::endl;
|
|
1017
|
+
return 0;
|
|
1018
|
+
}`, csharp: `using System;
|
|
1019
|
+
|
|
1020
|
+
class Main {
|
|
1021
|
+
static void Main() {
|
|
1022
|
+
Console.WriteLine("Hello, World!");
|
|
1023
|
+
}
|
|
1024
|
+
}`, ruby: 'puts "Hello, World!"', php: `<?php
|
|
1025
|
+
echo "Hello, World!";
|
|
1026
|
+
?>`, bash: 'echo "Hello, World!"', shell: 'echo "Hello, World!"', perl: 'print "Hello, World!\\n";', lua: 'print("Hello, World!")', r: 'print("Hello, World!")', swift: 'print("Hello, World!")', kotlin: `fun main() {
|
|
1027
|
+
println("Hello, World!")
|
|
1028
|
+
}`, scala: `object Main extends App {
|
|
1029
|
+
println("Hello, World!")
|
|
1030
|
+
}`, haskell: 'main = putStrLn "Hello, World!"', elixir: 'IO.puts "Hello, World!"', erlang: 'main() -> io:fwrite("Hello, World!~n").', clojure: '(println "Hello, World!")', fsharp: 'printfn "Hello, World!"', dart: `void main() {
|
|
1031
|
+
print("Hello, World!");
|
|
1032
|
+
}`, assembly: `section .data
|
|
1033
|
+
msg db 'Hello, World!', 0
|
|
1034
|
+
section .text
|
|
1035
|
+
global _start
|
|
1036
|
+
_start:
|
|
1037
|
+
mov rax, 1
|
|
1038
|
+
mov rdi, 1
|
|
1039
|
+
mov rsi, msg
|
|
1040
|
+
mov rdx, 13
|
|
1041
|
+
syscall
|
|
1042
|
+
mov rax, 60
|
|
1043
|
+
xor rdi, rdi
|
|
1044
|
+
syscall`, html: `<!DOCTYPE html>
|
|
1045
|
+
<html>
|
|
1046
|
+
<head>
|
|
1047
|
+
<title>Hello</title>
|
|
1048
|
+
</head>
|
|
1049
|
+
<body>
|
|
1050
|
+
<h1>Hello, World!</h1>
|
|
1051
|
+
</body>
|
|
1052
|
+
</html>`, css: `body {
|
|
1053
|
+
background-color: #f0f0f0;
|
|
1054
|
+
font-family: Arial, sans-serif;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
h1 {
|
|
1058
|
+
color: #333;
|
|
1059
|
+
}`, sql: "SELECT 'Hello, World!' AS message;", markdown: `# Hello, World!
|
|
1060
|
+
|
|
1061
|
+
This is a sample markdown document.` };
|
|
1062
|
+
function De(h) {
|
|
1063
|
+
const t = h.toLowerCase();
|
|
1064
|
+
return nn[t] || `// ${h}
|
|
1065
|
+
// Write your code here`;
|
|
1066
|
+
}
|
|
1067
|
+
const tn = ({ pistonUrl: h = "/api/piston", language: t = "javascript", theme: c = "light", themeColor: p = "", showLanguageSelector: b = !0, showEditor: k = !0, editable: s = !0, defaultCode: _ = "", executorLabel: y = "运行", onExecuteStart: m, onExecuteEnd: E, onLanguageChange: w, onChange: L }) => {
|
|
1068
|
+
const x = "hep-cr-default-language", [R, U] = K([]), [r, n] = K(typeof window > "u" ? t : localStorage.getItem(x) || t), [a, o] = K(c), [i, d] = K(_), [u, v] = K(""), [P, z] = K(""), [Y, J] = K(!1), [le, be] = K(null), [re, ae] = K("stdout"), [H, G] = K(null), [Z, V] = K(!0), [ce, oe] = K(60), [ne, Q] = K(!1), [ee, te] = K(!1), fe = Ne(!1), ie = Se(() => new en({ pistonUrl: h }), [h]), me = Se(() => R.map((S) => ({ value: `${S.language}:${S.version}`, label: `${S.language.charAt(0).toUpperCase() + S.language.slice(1)} ${S.version}` })), [R]), ge = Se(() => {
|
|
1069
|
+
if (!p) return {};
|
|
1070
|
+
const S = c === "dark", X = (se, Ee) => {
|
|
1071
|
+
const ke = parseInt(se.replace("#", ""), 16), we = Math.round(2.55 * Ee);
|
|
1072
|
+
return "#" + (16777216 + 65536 * Math.min(255, Math.max(0, (ke >> 16) + we)) + 256 * Math.min(255, Math.max(0, (ke >> 8 & 255) + we)) + Math.min(255, Math.max(0, (255 & ke) + we))).toString(16).slice(1);
|
|
1073
|
+
}, ue = ((se) => {
|
|
1074
|
+
const Ee = parseInt(se.replace("#", ""), 16);
|
|
1075
|
+
return (0.299 * (Ee >> 16 & 255) + 0.587 * (Ee >> 8 & 255) + 0.114 * (255 & Ee)) / 255 > 0.5;
|
|
1076
|
+
})(p) ? "#000" : "#fff";
|
|
1077
|
+
return { "--hep-cr-theme-color": p, "--hep-cr-theme-color-hover": X(p, S ? 20 : -20), "--hep-cr-tab-active-color": ue };
|
|
1078
|
+
}, [p, c]), q = Se(() => r.includes(":") ? r.split(":")[0] : r, [r]);
|
|
1079
|
+
ve(() => {
|
|
1080
|
+
(async function() {
|
|
1081
|
+
V(!0), G(null);
|
|
1215
1082
|
try {
|
|
1216
|
-
const
|
|
1217
|
-
|
|
1218
|
-
} catch (
|
|
1219
|
-
G(
|
|
1083
|
+
const S = await ie.getRuntimes();
|
|
1084
|
+
U(S);
|
|
1085
|
+
} catch (S) {
|
|
1086
|
+
G(S instanceof Error ? S.message : "Failed to load runtimes");
|
|
1220
1087
|
} finally {
|
|
1221
|
-
|
|
1088
|
+
V(!1);
|
|
1222
1089
|
}
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
(
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
[g]
|
|
1240
|
-
), fe = k(async () => {
|
|
1241
|
-
if (!N) {
|
|
1242
|
-
re(!0), ee(""), te(""), oe(null), G(null), z("stdout"), m == null || m();
|
|
1090
|
+
})();
|
|
1091
|
+
}, [ie]), ve(() => {
|
|
1092
|
+
!i && R.length > 0 && d(_ || De(q));
|
|
1093
|
+
}, [R, i, _, q]), ve(() => {
|
|
1094
|
+
L == null || L(i);
|
|
1095
|
+
}, []), ve(() => {
|
|
1096
|
+
!Z && R.length > 0 && w && !fe.current && (fe.current = !0, w(q, i));
|
|
1097
|
+
}, [Z, R.length]);
|
|
1098
|
+
const Re = he((S) => {
|
|
1099
|
+
const X = S.target.value, ue = X.includes(":") ? X.split(":")[0] : X;
|
|
1100
|
+
n(X);
|
|
1101
|
+
const se = De(ue);
|
|
1102
|
+
d(se), w == null || w(ue, se), typeof window < "u" && localStorage.setItem(x, X);
|
|
1103
|
+
}, [w]), Oe = he(async () => {
|
|
1104
|
+
if (!Y) {
|
|
1105
|
+
J(!0), v(""), z(""), be(null), G(null), ae("stdout"), m == null || m();
|
|
1243
1106
|
try {
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1246
|
-
} catch (
|
|
1247
|
-
const
|
|
1248
|
-
G(
|
|
1249
|
-
success: !1,
|
|
1250
|
-
output: "",
|
|
1251
|
-
stderr: c,
|
|
1252
|
-
code: -1
|
|
1253
|
-
});
|
|
1107
|
+
const S = await ie.execute(q, i);
|
|
1108
|
+
v(S.output), z(S.stderr), be(S.executionTime || null), ae(S.stderr ? "stderr" : "stdout"), E == null || E(S);
|
|
1109
|
+
} catch (S) {
|
|
1110
|
+
const X = S instanceof Error ? S.message : "Execution failed";
|
|
1111
|
+
G(X), E == null || E({ success: !1, output: "", stderr: X, code: -1 });
|
|
1254
1112
|
} finally {
|
|
1255
|
-
|
|
1113
|
+
J(!1);
|
|
1256
1114
|
}
|
|
1257
1115
|
}
|
|
1258
|
-
}, [
|
|
1259
|
-
await navigator.clipboard.writeText(
|
|
1260
|
-
|
|
1116
|
+
}, [Y, r, i, ie, m, E]), Ce = he(async () => {
|
|
1117
|
+
await navigator.clipboard.writeText(i), Q(!0), setTimeout(() => {
|
|
1118
|
+
Q(!1);
|
|
1261
1119
|
}, 2e3);
|
|
1262
|
-
}, [
|
|
1263
|
-
const
|
|
1264
|
-
await navigator.clipboard.writeText(
|
|
1265
|
-
|
|
1120
|
+
}, [i]), je = he(async () => {
|
|
1121
|
+
const S = re === "stdout" ? u : P;
|
|
1122
|
+
await navigator.clipboard.writeText(S), te(!0), setTimeout(() => {
|
|
1123
|
+
te(!1);
|
|
1266
1124
|
}, 2e3);
|
|
1267
|
-
}, [
|
|
1268
|
-
|
|
1269
|
-
}, [
|
|
1270
|
-
|
|
1271
|
-
}, []),
|
|
1272
|
-
if (!
|
|
1273
|
-
const
|
|
1274
|
-
if (!
|
|
1275
|
-
const
|
|
1276
|
-
|
|
1277
|
-
}, []),
|
|
1278
|
-
|
|
1279
|
-
}, [
|
|
1280
|
-
return
|
|
1281
|
-
/* @__PURE__ */ i("div", { className: "hep-cr-header", children: [
|
|
1282
|
-
/* @__PURE__ */ e("div", { className: "hep-cr-controls", children: s && /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ i(
|
|
1283
|
-
"select",
|
|
1284
|
-
{
|
|
1285
|
-
value: d,
|
|
1286
|
-
onChange: be,
|
|
1287
|
-
className: "hep-cr-language-select",
|
|
1288
|
-
disabled: N,
|
|
1289
|
-
children: [
|
|
1290
|
-
H && /* @__PURE__ */ e("option", { value: "", children: "加载中..." }),
|
|
1291
|
-
ge.map((n) => /* @__PURE__ */ e("option", { value: n.value, children: n.label }, n.value))
|
|
1292
|
-
]
|
|
1293
|
-
}
|
|
1294
|
-
) }) }),
|
|
1295
|
-
/* @__PURE__ */ i("div", { className: "hep-cr-actions", children: [
|
|
1296
|
-
/* @__PURE__ */ i(
|
|
1297
|
-
"button",
|
|
1298
|
-
{
|
|
1299
|
-
className: "hep-cr-btn hep-cr-btn-run",
|
|
1300
|
-
disabled: N || H,
|
|
1301
|
-
onClick: fe,
|
|
1302
|
-
children: [
|
|
1303
|
-
N ? /* @__PURE__ */ e("span", { className: "hep-cr-spinner" }) : /* @__PURE__ */ e("span", { className: "hep-cr-run-icon", children: "▶" }),
|
|
1304
|
-
N ? "运行中..." : y
|
|
1305
|
-
]
|
|
1306
|
-
}
|
|
1307
|
-
),
|
|
1308
|
-
u && h && /* @__PURE__ */ e("button", { className: "hep-cr-btn hep-cr-btn-reset", onClick: ye, children: "重置" }),
|
|
1309
|
-
/* @__PURE__ */ e(
|
|
1310
|
-
"button",
|
|
1311
|
-
{
|
|
1312
|
-
className: "hep-cr-btn hep-cr-btn-theme",
|
|
1313
|
-
onClick: () => U(x === "light" ? "dark" : "light"),
|
|
1314
|
-
title: x === "light" ? "Switch to dark mode" : "Switch to light mode",
|
|
1315
|
-
children: x === "light" ? /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ e("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) }) : /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
1316
|
-
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "5" }),
|
|
1317
|
-
/* @__PURE__ */ e("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
|
|
1318
|
-
/* @__PURE__ */ e("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
|
|
1319
|
-
/* @__PURE__ */ e("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
|
|
1320
|
-
/* @__PURE__ */ e("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
|
|
1321
|
-
/* @__PURE__ */ e("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
|
|
1322
|
-
/* @__PURE__ */ e("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
|
|
1323
|
-
/* @__PURE__ */ e("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
|
|
1324
|
-
/* @__PURE__ */ e("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
|
|
1325
|
-
] })
|
|
1326
|
-
}
|
|
1327
|
-
)
|
|
1328
|
-
] })
|
|
1329
|
-
] }),
|
|
1330
|
-
ae && /* @__PURE__ */ e("div", { className: "hep-cr-error-message", children: ae }),
|
|
1331
|
-
/* @__PURE__ */ i("div", { className: "hep-cr-main", children: [
|
|
1332
|
-
u && /* @__PURE__ */ i("div", { className: "hep-cr-editor-panel", style: { width: `${se}%` }, children: [
|
|
1333
|
-
/* @__PURE__ */ i("div", { className: "hep-cr-panel-header", children: [
|
|
1334
|
-
/* @__PURE__ */ e("span", { className: "hep-cr-panel-title", children: "编辑器" }),
|
|
1335
|
-
/* @__PURE__ */ i("div", { className: "hep-cr-output-actions", children: [
|
|
1336
|
-
/* @__PURE__ */ e("span", { className: "hep-cr-language-badge", children: I }),
|
|
1337
|
-
/* @__PURE__ */ e(
|
|
1338
|
-
"button",
|
|
1339
|
-
{
|
|
1340
|
-
className: `hep-cr-btn-icon ${j ? "hep-cr-btn-copied" : ""}`,
|
|
1341
|
-
disabled: j,
|
|
1342
|
-
onClick: Ee,
|
|
1343
|
-
title: j ? "已复制" : "复制",
|
|
1344
|
-
children: j ? /* @__PURE__ */ e("span", { className: "hep-cr-copied-text", children: "已复制" }) : /* @__PURE__ */ i(
|
|
1345
|
-
"svg",
|
|
1346
|
-
{
|
|
1347
|
-
width: "14",
|
|
1348
|
-
height: "14",
|
|
1349
|
-
viewBox: "0 0 24 24",
|
|
1350
|
-
fill: "none",
|
|
1351
|
-
stroke: "currentColor",
|
|
1352
|
-
strokeWidth: "2",
|
|
1353
|
-
children: [
|
|
1354
|
-
/* @__PURE__ */ e("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
|
|
1355
|
-
/* @__PURE__ */ e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
1356
|
-
]
|
|
1357
|
-
}
|
|
1358
|
-
)
|
|
1359
|
-
}
|
|
1360
|
-
)
|
|
1361
|
-
] })
|
|
1362
|
-
] }),
|
|
1363
|
-
/* @__PURE__ */ e(
|
|
1364
|
-
Fe,
|
|
1365
|
-
{
|
|
1366
|
-
value: T,
|
|
1367
|
-
language: I,
|
|
1368
|
-
theme: x,
|
|
1369
|
-
disabled: !h || N,
|
|
1370
|
-
onChange: B,
|
|
1371
|
-
onCodeChange: S
|
|
1372
|
-
}
|
|
1373
|
-
)
|
|
1374
|
-
] }),
|
|
1375
|
-
u && /* @__PURE__ */ e("div", { className: "hep-cr-resize-handle", onMouseDown: Se, children: /* @__PURE__ */ e("div", { className: "hep-cr-resize-line" }) }),
|
|
1376
|
-
/* @__PURE__ */ i(
|
|
1377
|
-
"div",
|
|
1378
|
-
{
|
|
1379
|
-
className: "hep-cr-output-panel",
|
|
1380
|
-
style: { width: u ? `${100 - se}%` : "100%" },
|
|
1381
|
-
children: [
|
|
1382
|
-
/* @__PURE__ */ i("div", { className: "hep-cr-panel-header", children: [
|
|
1383
|
-
/* @__PURE__ */ i("div", { className: "hep-cr-output-tabs", children: [
|
|
1384
|
-
/* @__PURE__ */ e(
|
|
1385
|
-
"button",
|
|
1386
|
-
{
|
|
1387
|
-
className: `hep-cr-tab ${L === "stdout" ? "active" : ""}`,
|
|
1388
|
-
onClick: () => z("stdout"),
|
|
1389
|
-
children: "输出"
|
|
1390
|
-
}
|
|
1391
|
-
),
|
|
1392
|
-
$ && /* @__PURE__ */ e(
|
|
1393
|
-
"button",
|
|
1394
|
-
{
|
|
1395
|
-
className: `hep-cr-tab hep-cr-tab-error ${L === "stderr" ? "active" : ""}`,
|
|
1396
|
-
onClick: () => z("stderr"),
|
|
1397
|
-
children: "错误"
|
|
1398
|
-
}
|
|
1399
|
-
)
|
|
1400
|
-
] }),
|
|
1401
|
-
/* @__PURE__ */ i("div", { className: "hep-cr-output-actions", children: [
|
|
1402
|
-
ne !== null && /* @__PURE__ */ i("span", { className: "hep-cr-execution-time", children: [
|
|
1403
|
-
ne,
|
|
1404
|
-
"ms"
|
|
1405
|
-
] }),
|
|
1406
|
-
/* @__PURE__ */ e(
|
|
1407
|
-
"button",
|
|
1408
|
-
{
|
|
1409
|
-
className: `hep-cr-btn-icon ${Y ? "hep-cr-btn-copied" : ""}`,
|
|
1410
|
-
disabled: Y,
|
|
1411
|
-
onClick: ke,
|
|
1412
|
-
title: Y ? "已复制" : "复制",
|
|
1413
|
-
children: Y ? /* @__PURE__ */ e("span", { className: "hep-cr-copied-text", children: "已复制" }) : /* @__PURE__ */ i(
|
|
1414
|
-
"svg",
|
|
1415
|
-
{
|
|
1416
|
-
width: "14",
|
|
1417
|
-
height: "14",
|
|
1418
|
-
viewBox: "0 0 24 24",
|
|
1419
|
-
fill: "none",
|
|
1420
|
-
stroke: "currentColor",
|
|
1421
|
-
strokeWidth: "2",
|
|
1422
|
-
children: [
|
|
1423
|
-
/* @__PURE__ */ e("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
|
|
1424
|
-
/* @__PURE__ */ e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
1425
|
-
]
|
|
1426
|
-
}
|
|
1427
|
-
)
|
|
1428
|
-
}
|
|
1429
|
-
)
|
|
1430
|
-
] })
|
|
1431
|
-
] }),
|
|
1432
|
-
/* @__PURE__ */ e("div", { className: "hep-cr-output-content", children: /* @__PURE__ */ e("pre", { children: L === "stdout" ? N ? "代码执行中..." : K || '点击"运行"执行代码' : $ }) })
|
|
1433
|
-
]
|
|
1434
|
-
}
|
|
1435
|
-
)
|
|
1436
|
-
] }),
|
|
1437
|
-
/* @__PURE__ */ e("style", { children: `
|
|
1125
|
+
}, [re, u, P]), Ae = he(() => {
|
|
1126
|
+
d(De(q));
|
|
1127
|
+
}, [r]), ye = Ne(!1), Fe = he((S) => {
|
|
1128
|
+
ye.current = !0, document.addEventListener("mousemove", pe), document.addEventListener("mouseup", xe), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
1129
|
+
}, []), pe = he((S) => {
|
|
1130
|
+
if (!ye.current) return;
|
|
1131
|
+
const X = document.querySelector(".hep-cr-main");
|
|
1132
|
+
if (!X) return;
|
|
1133
|
+
const ue = X.getBoundingClientRect(), se = (S.clientX - ue.left) / ue.width * 100;
|
|
1134
|
+
oe(Math.max(20, Math.min(80, se)));
|
|
1135
|
+
}, []), xe = he(() => {
|
|
1136
|
+
ye.current = !1, document.removeEventListener("mousemove", pe), document.removeEventListener("mouseup", xe), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
1137
|
+
}, [pe]);
|
|
1138
|
+
return l.jsxs("div", { className: `hep-cr-runner hep-cr-runner-${a}`, style: ge, children: [l.jsxs("div", { className: "hep-cr-header", children: [l.jsx("div", { className: "hep-cr-controls", children: b && l.jsx(l.Fragment, { children: l.jsxs("select", { value: r, onChange: Re, className: "hep-cr-language-select", disabled: Y, children: [Z && l.jsx("option", { value: "", children: "加载中..." }), me.map((S) => l.jsx("option", { value: S.value, children: S.label }, S.value))] }) }) }), l.jsxs("div", { className: "hep-cr-actions", children: [l.jsxs("button", { className: "hep-cr-btn hep-cr-btn-run", disabled: Y || Z, onClick: Oe, children: [Y ? l.jsx("span", { className: "hep-cr-spinner" }) : l.jsx("span", { className: "hep-cr-run-icon", children: "▶" }), Y ? "运行中..." : y] }), k && s && l.jsx("button", { className: "hep-cr-btn hep-cr-btn-reset", onClick: Ae, children: "重置" }), l.jsx("button", { className: "hep-cr-btn hep-cr-btn-theme", onClick: () => o(a === "light" ? "dark" : "light"), title: a === "light" ? "Switch to dark mode" : "Switch to light mode", children: a === "light" ? l.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: l.jsx("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) }) : l.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [l.jsx("circle", { cx: "12", cy: "12", r: "5" }), l.jsx("line", { x1: "12", y1: "1", x2: "12", y2: "3" }), l.jsx("line", { x1: "12", y1: "21", x2: "12", y2: "23" }), l.jsx("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }), l.jsx("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }), l.jsx("line", { x1: "1", y1: "12", x2: "3", y2: "12" }), l.jsx("line", { x1: "21", y1: "12", x2: "23", y2: "12" }), l.jsx("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }), l.jsx("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })] }) })] })] }), H && l.jsx("div", { className: "hep-cr-error-message", children: H }), l.jsxs("div", { className: "hep-cr-main", children: [k && l.jsxs("div", { className: "hep-cr-editor-panel", style: { width: `${ce}%` }, children: [l.jsxs("div", { className: "hep-cr-panel-header", children: [l.jsx("span", { className: "hep-cr-panel-title", children: "编辑器" }), l.jsxs("div", { className: "hep-cr-output-actions", children: [l.jsx("span", { className: "hep-cr-language-badge", children: q }), l.jsx("button", { className: "hep-cr-btn-icon " + (ne ? "hep-cr-btn-copied" : ""), disabled: ne, onClick: Ce, title: ne ? "已复制" : "复制", children: ne ? l.jsx("span", { className: "hep-cr-copied-text", children: "已复制" }) : l.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [l.jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }), l.jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })] }) })] })] }), l.jsx(Je, { value: i, language: q, theme: a, disabled: !s || Y, onChange: d, onCodeChange: L })] }), k && l.jsx("div", { className: "hep-cr-resize-handle", onMouseDown: Fe, children: l.jsx("div", { className: "hep-cr-resize-line" }) }), l.jsxs("div", { className: "hep-cr-output-panel", style: { width: k ? 100 - ce + "%" : "100%" }, children: [l.jsxs("div", { className: "hep-cr-panel-header", children: [l.jsxs("div", { className: "hep-cr-output-tabs", children: [l.jsx("button", { className: "hep-cr-tab " + (re === "stdout" ? "active" : ""), onClick: () => ae("stdout"), children: "输出" }), P && l.jsx("button", { className: "hep-cr-tab hep-cr-tab-error " + (re === "stderr" ? "active" : ""), onClick: () => ae("stderr"), children: "错误" })] }), l.jsxs("div", { className: "hep-cr-output-actions", children: [le !== null && l.jsxs("span", { className: "hep-cr-execution-time", children: [le, "ms"] }), l.jsx("button", { className: "hep-cr-btn-icon " + (ee ? "hep-cr-btn-copied" : ""), disabled: ee, onClick: je, title: ee ? "已复制" : "复制", children: ee ? l.jsx("span", { className: "hep-cr-copied-text", children: "已复制" }) : l.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [l.jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }), l.jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })] }) })] })] }), l.jsx("div", { className: "hep-cr-output-content", children: l.jsx("pre", { children: re === "stdout" ? Y ? "代码执行中..." : u || '点击"运行"执行代码' : P }) })] })] }), l.jsx("style", { children: `
|
|
1438
1139
|
.hep-cr-runner {
|
|
1439
1140
|
display: flex;
|
|
1440
1141
|
flex-direction: column;
|
|
@@ -1662,56 +1363,20 @@ const Ce = ({
|
|
|
1662
1363
|
animation: spin 0.8s linear infinite;
|
|
1663
1364
|
}
|
|
1664
1365
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
1665
|
-
` })
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
({
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
w(() => {
|
|
1680
|
-
g && t !== m && b(t);
|
|
1681
|
-
}, [t, g]);
|
|
1682
|
-
const A = k(() => {
|
|
1683
|
-
g || b(!1), s == null || s();
|
|
1684
|
-
}, [g, s]), O = (l) => {
|
|
1685
|
-
l.target === l.currentTarget && A();
|
|
1686
|
-
};
|
|
1687
|
-
Ie(y, () => ({
|
|
1688
|
-
close: A
|
|
1689
|
-
}));
|
|
1690
|
-
const E = typeof o == "number" ? `${o}px` : o;
|
|
1691
|
-
return S ? /* @__PURE__ */ i("div", { className: "hep-cr-dialog-overlay", onClick: O, children: [
|
|
1692
|
-
/* @__PURE__ */ i("div", { className: "hep-cr-dialog-container", style: { width: E }, children: [
|
|
1693
|
-
/* @__PURE__ */ i("div", { className: "hep-cr-dialog-header", children: [
|
|
1694
|
-
/* @__PURE__ */ e("h3", { className: "hep-cr-dialog-title", children: a }),
|
|
1695
|
-
/* @__PURE__ */ e("button", { className: "hep-cr-dialog-close", onClick: A, children: /* @__PURE__ */ i(
|
|
1696
|
-
"svg",
|
|
1697
|
-
{
|
|
1698
|
-
width: "16",
|
|
1699
|
-
height: "16",
|
|
1700
|
-
viewBox: "0 0 24 24",
|
|
1701
|
-
fill: "none",
|
|
1702
|
-
stroke: "currentColor",
|
|
1703
|
-
strokeWidth: "2",
|
|
1704
|
-
children: [
|
|
1705
|
-
/* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1706
|
-
/* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1707
|
-
]
|
|
1708
|
-
}
|
|
1709
|
-
) })
|
|
1710
|
-
] }),
|
|
1711
|
-
/* @__PURE__ */ e("div", { className: "hep-cr-dialog-body", children: /* @__PURE__ */ e(Ce, { theme: h, ...f }) }),
|
|
1712
|
-
u && /* @__PURE__ */ e("div", { className: "hep-cr-dialog-footer", children: u })
|
|
1713
|
-
] }),
|
|
1714
|
-
/* @__PURE__ */ e("style", { children: `
|
|
1366
|
+
` })] });
|
|
1367
|
+
}, rn = Ze(({ open: h, defaultOpen: t = !1, title: c = "代码执行器", width: p = 800, onClose: b, footer: k, theme: s = "light", ..._ }, y) => {
|
|
1368
|
+
const [m, E] = K(t), w = h !== void 0, L = w ? h : m;
|
|
1369
|
+
ve(() => {
|
|
1370
|
+
w && h !== m && E(h);
|
|
1371
|
+
}, [h, w]);
|
|
1372
|
+
const x = he(() => {
|
|
1373
|
+
w || E(!1), b == null || b();
|
|
1374
|
+
}, [w, b]);
|
|
1375
|
+
Ke(y, () => ({ close: x }));
|
|
1376
|
+
const R = typeof p == "number" ? `${p}px` : p;
|
|
1377
|
+
return L ? l.jsxs("div", { className: "hep-cr-dialog-overlay", onClick: (U) => {
|
|
1378
|
+
U.target === U.currentTarget && x();
|
|
1379
|
+
}, children: [l.jsxs("div", { className: "hep-cr-dialog-container", style: { width: R }, children: [l.jsxs("div", { className: "hep-cr-dialog-header", children: [l.jsx("h3", { className: "hep-cr-dialog-title", children: c }), l.jsx("button", { className: "hep-cr-dialog-close", onClick: x, children: l.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [l.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), l.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) })] }), l.jsx("div", { className: "hep-cr-dialog-body", children: l.jsx(tn, { theme: s, ..._ }) }), k && l.jsx("div", { className: "hep-cr-dialog-footer", children: k })] }), l.jsx("style", { children: `
|
|
1715
1380
|
.hep-cr-dialog-overlay {
|
|
1716
1381
|
position: fixed;
|
|
1717
1382
|
top: 0;
|
|
@@ -1799,13 +1464,11 @@ const Ce = ({
|
|
|
1799
1464
|
from { transform: scale(0.95); }
|
|
1800
1465
|
to { transform: scale(1); }
|
|
1801
1466
|
}
|
|
1802
|
-
` })
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
);
|
|
1806
|
-
Pe.displayName = "CodeRunnerDialog";
|
|
1467
|
+
` })] }) : null;
|
|
1468
|
+
});
|
|
1469
|
+
rn.displayName = "CodeRunnerDialog";
|
|
1807
1470
|
export {
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1471
|
+
tn as CodeRunner,
|
|
1472
|
+
rn as CodeRunnerDialog,
|
|
1473
|
+
tn as default
|
|
1811
1474
|
};
|