react-markdown-table-ts 1.3.8 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -0
- package/dist/index.cjs +28 -20
- package/dist/index.mjs +1775 -612
- package/package.json +5 -2
package/dist/index.mjs
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
|
1
|
+
import Ge, { useRef as yt, useId as wt, useDeferredValue as kt, useTransition as xt, useMemo as Et, useEffect as Ne } from "react";
|
2
|
+
var We = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
3
|
+
function At(l) {
|
4
|
+
return l && l.__esModule && Object.prototype.hasOwnProperty.call(l, "default") ? l.default : l;
|
5
|
+
}
|
6
|
+
var ye = { exports: {} }, de = {};
|
4
7
|
/**
|
5
8
|
* @license React
|
6
9
|
* react-jsx-runtime.production.min.js
|
@@ -10,21 +13,21 @@ var K = { exports: {} }, W = {};
|
|
10
13
|
* This source code is licensed under the MIT license found in the
|
11
14
|
* LICENSE file in the root directory of this source tree.
|
12
15
|
*/
|
13
|
-
var
|
14
|
-
function
|
15
|
-
if (
|
16
|
-
|
17
|
-
var
|
18
|
-
function
|
19
|
-
var
|
20
|
-
|
21
|
-
for (
|
22
|
-
if (
|
23
|
-
return { $$typeof:
|
16
|
+
var He;
|
17
|
+
function _t() {
|
18
|
+
if (He) return de;
|
19
|
+
He = 1;
|
20
|
+
var l = Ge, g = Symbol.for("react.element"), r = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, v = l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, k = { key: !0, ref: !0, __self: !0, __source: !0 };
|
21
|
+
function h(a, c, x) {
|
22
|
+
var p, f = {}, E = null, C = null;
|
23
|
+
x !== void 0 && (E = "" + x), c.key !== void 0 && (E = "" + c.key), c.ref !== void 0 && (C = c.ref);
|
24
|
+
for (p in c) m.call(c, p) && !k.hasOwnProperty(p) && (f[p] = c[p]);
|
25
|
+
if (a && a.defaultProps) for (p in c = a.defaultProps, c) f[p] === void 0 && (f[p] = c[p]);
|
26
|
+
return { $$typeof: g, type: a, key: E, ref: C, props: f, _owner: v.current };
|
24
27
|
}
|
25
|
-
return
|
28
|
+
return de.Fragment = r, de.jsx = h, de.jsxs = h, de;
|
26
29
|
}
|
27
|
-
var
|
30
|
+
var fe = {};
|
28
31
|
/**
|
29
32
|
* @license React
|
30
33
|
* react-jsx-runtime.development.js
|
@@ -34,91 +37,91 @@ var H = {};
|
|
34
37
|
* This source code is licensed under the MIT license found in the
|
35
38
|
* LICENSE file in the root directory of this source tree.
|
36
39
|
*/
|
37
|
-
var
|
38
|
-
function
|
39
|
-
return
|
40
|
-
var
|
41
|
-
function
|
40
|
+
var qe;
|
41
|
+
function St() {
|
42
|
+
return qe || (qe = 1, process.env.NODE_ENV !== "production" && (function() {
|
43
|
+
var l = Ge, g = Symbol.for("react.element"), r = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), a = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), P = Symbol.iterator, S = "@@iterator";
|
44
|
+
function _(e) {
|
42
45
|
if (e === null || typeof e != "object")
|
43
46
|
return null;
|
44
|
-
var
|
45
|
-
return typeof
|
47
|
+
var i = P && e[P] || e[S];
|
48
|
+
return typeof i == "function" ? i : null;
|
46
49
|
}
|
47
|
-
var
|
48
|
-
function
|
50
|
+
var A = l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
51
|
+
function t(e) {
|
49
52
|
{
|
50
|
-
for (var
|
51
|
-
|
52
|
-
|
53
|
+
for (var i = arguments.length, d = new Array(i > 1 ? i - 1 : 0), w = 1; w < i; w++)
|
54
|
+
d[w - 1] = arguments[w];
|
55
|
+
n("error", e, d);
|
53
56
|
}
|
54
57
|
}
|
55
|
-
function
|
58
|
+
function n(e, i, d) {
|
56
59
|
{
|
57
|
-
var
|
58
|
-
|
59
|
-
var
|
60
|
-
return String(
|
60
|
+
var w = A.ReactDebugCurrentFrame, $ = w.getStackAddendum();
|
61
|
+
$ !== "" && (i += "%s", d = d.concat([$]));
|
62
|
+
var O = d.map(function(T) {
|
63
|
+
return String(T);
|
61
64
|
});
|
62
|
-
|
65
|
+
O.unshift("Warning: " + i), Function.prototype.apply.call(console[e], console, O);
|
63
66
|
}
|
64
67
|
}
|
65
|
-
var
|
66
|
-
|
67
|
-
function
|
68
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
68
|
+
var o = !1, s = !1, u = !1, y = !1, R = !1, b;
|
69
|
+
b = Symbol.for("react.module.reference");
|
70
|
+
function j(e) {
|
71
|
+
return !!(typeof e == "string" || typeof e == "function" || e === m || e === k || R || e === v || e === x || e === p || y || e === C || o || s || u || typeof e == "object" && e !== null && (e.$$typeof === E || e.$$typeof === f || e.$$typeof === h || e.$$typeof === a || e.$$typeof === c || // This needs to include all possible module reference object
|
69
72
|
// types supported by any Flight configuration anywhere since
|
70
73
|
// we don't know which Flight build this will end up being used
|
71
74
|
// with.
|
72
|
-
e.$$typeof ===
|
75
|
+
e.$$typeof === b || e.getModuleId !== void 0));
|
73
76
|
}
|
74
|
-
function
|
75
|
-
var
|
76
|
-
if (
|
77
|
-
return
|
78
|
-
var
|
79
|
-
return
|
77
|
+
function z(e, i, d) {
|
78
|
+
var w = e.displayName;
|
79
|
+
if (w)
|
80
|
+
return w;
|
81
|
+
var $ = i.displayName || i.name || "";
|
82
|
+
return $ !== "" ? d + "(" + $ + ")" : d;
|
80
83
|
}
|
81
|
-
function
|
84
|
+
function U(e) {
|
82
85
|
return e.displayName || "Context";
|
83
86
|
}
|
84
|
-
function
|
87
|
+
function Y(e) {
|
85
88
|
if (e == null)
|
86
89
|
return null;
|
87
|
-
if (typeof e.tag == "number" &&
|
90
|
+
if (typeof e.tag == "number" && t("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
88
91
|
return e.displayName || e.name || null;
|
89
92
|
if (typeof e == "string")
|
90
93
|
return e;
|
91
94
|
switch (e) {
|
92
|
-
case
|
95
|
+
case m:
|
93
96
|
return "Fragment";
|
94
|
-
case
|
97
|
+
case r:
|
95
98
|
return "Portal";
|
96
|
-
case
|
99
|
+
case k:
|
97
100
|
return "Profiler";
|
98
|
-
case
|
101
|
+
case v:
|
99
102
|
return "StrictMode";
|
100
|
-
case
|
103
|
+
case x:
|
101
104
|
return "Suspense";
|
102
|
-
case
|
105
|
+
case p:
|
103
106
|
return "SuspenseList";
|
104
107
|
}
|
105
108
|
if (typeof e == "object")
|
106
109
|
switch (e.$$typeof) {
|
110
|
+
case a:
|
111
|
+
var i = e;
|
112
|
+
return U(i) + ".Consumer";
|
113
|
+
case h:
|
114
|
+
var d = e;
|
115
|
+
return U(d._context) + ".Provider";
|
116
|
+
case c:
|
117
|
+
return z(e, e.render, "ForwardRef");
|
107
118
|
case f:
|
108
|
-
var
|
109
|
-
return
|
110
|
-
case
|
111
|
-
var
|
112
|
-
return ie(n._context) + ".Provider";
|
113
|
-
case o:
|
114
|
-
return He(e, e.render, "ForwardRef");
|
115
|
-
case i:
|
116
|
-
var u = e.displayName || null;
|
117
|
-
return u !== null ? u : P(e.type) || "Memo";
|
118
|
-
case g: {
|
119
|
-
var y = e, _ = y._payload, h = y._init;
|
119
|
+
var w = e.displayName || null;
|
120
|
+
return w !== null ? w : Y(e.type) || "Memo";
|
121
|
+
case E: {
|
122
|
+
var $ = e, O = $._payload, T = $._init;
|
120
123
|
try {
|
121
|
-
return
|
124
|
+
return Y(T(O));
|
122
125
|
} catch {
|
123
126
|
return null;
|
124
127
|
}
|
@@ -126,18 +129,18 @@ function Rr() {
|
|
126
129
|
}
|
127
130
|
return null;
|
128
131
|
}
|
129
|
-
var
|
130
|
-
function
|
132
|
+
var B = Object.assign, Q = 0, pe, le, M, H, G, ee, N;
|
133
|
+
function he() {
|
131
134
|
}
|
132
|
-
|
133
|
-
function
|
135
|
+
he.__reactDisabledLog = !0;
|
136
|
+
function V() {
|
134
137
|
{
|
135
|
-
if (
|
136
|
-
|
138
|
+
if (Q === 0) {
|
139
|
+
pe = console.log, le = console.info, M = console.warn, H = console.error, G = console.group, ee = console.groupCollapsed, N = console.groupEnd;
|
137
140
|
var e = {
|
138
141
|
configurable: !0,
|
139
142
|
enumerable: !0,
|
140
|
-
value:
|
143
|
+
value: he,
|
141
144
|
writable: !0
|
142
145
|
};
|
143
146
|
Object.defineProperties(console, {
|
@@ -150,332 +153,332 @@ function Rr() {
|
|
150
153
|
groupEnd: e
|
151
154
|
});
|
152
155
|
}
|
153
|
-
|
156
|
+
Q++;
|
154
157
|
}
|
155
158
|
}
|
156
|
-
function
|
159
|
+
function te() {
|
157
160
|
{
|
158
|
-
if (
|
161
|
+
if (Q--, Q === 0) {
|
159
162
|
var e = {
|
160
163
|
configurable: !0,
|
161
164
|
enumerable: !0,
|
162
165
|
writable: !0
|
163
166
|
};
|
164
167
|
Object.defineProperties(console, {
|
165
|
-
log:
|
166
|
-
value:
|
168
|
+
log: B({}, e, {
|
169
|
+
value: pe
|
167
170
|
}),
|
168
|
-
info:
|
169
|
-
value: se
|
170
|
-
}),
|
171
|
-
warn: N({}, e, {
|
171
|
+
info: B({}, e, {
|
172
172
|
value: le
|
173
173
|
}),
|
174
|
-
|
175
|
-
value:
|
174
|
+
warn: B({}, e, {
|
175
|
+
value: M
|
176
|
+
}),
|
177
|
+
error: B({}, e, {
|
178
|
+
value: H
|
176
179
|
}),
|
177
|
-
group:
|
178
|
-
value:
|
180
|
+
group: B({}, e, {
|
181
|
+
value: G
|
179
182
|
}),
|
180
|
-
groupCollapsed:
|
181
|
-
value:
|
183
|
+
groupCollapsed: B({}, e, {
|
184
|
+
value: ee
|
182
185
|
}),
|
183
|
-
groupEnd:
|
184
|
-
value:
|
186
|
+
groupEnd: B({}, e, {
|
187
|
+
value: N
|
185
188
|
})
|
186
189
|
});
|
187
190
|
}
|
188
|
-
|
191
|
+
Q < 0 && t("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
189
192
|
}
|
190
193
|
}
|
191
|
-
var
|
192
|
-
function
|
194
|
+
var J = A.ReactCurrentDispatcher, K;
|
195
|
+
function Z(e, i, d) {
|
193
196
|
{
|
194
|
-
if (
|
197
|
+
if (K === void 0)
|
195
198
|
try {
|
196
199
|
throw Error();
|
197
|
-
} catch (
|
198
|
-
var
|
199
|
-
|
200
|
+
} catch ($) {
|
201
|
+
var w = $.stack.trim().match(/\n( *(at )?)/);
|
202
|
+
K = w && w[1] || "";
|
200
203
|
}
|
201
204
|
return `
|
202
|
-
` +
|
205
|
+
` + K + e;
|
203
206
|
}
|
204
207
|
}
|
205
|
-
var
|
208
|
+
var re = !1, X;
|
206
209
|
{
|
207
|
-
var
|
208
|
-
|
210
|
+
var ae = typeof WeakMap == "function" ? WeakMap : Map;
|
211
|
+
X = new ae();
|
209
212
|
}
|
210
|
-
function
|
211
|
-
if (!e ||
|
213
|
+
function me(e, i) {
|
214
|
+
if (!e || re)
|
212
215
|
return "";
|
213
216
|
{
|
214
|
-
var
|
215
|
-
if (
|
216
|
-
return
|
217
|
+
var d = X.get(e);
|
218
|
+
if (d !== void 0)
|
219
|
+
return d;
|
217
220
|
}
|
218
|
-
var
|
219
|
-
|
220
|
-
var
|
221
|
+
var w;
|
222
|
+
re = !0;
|
223
|
+
var $ = Error.prepareStackTrace;
|
221
224
|
Error.prepareStackTrace = void 0;
|
222
|
-
var
|
223
|
-
|
225
|
+
var O;
|
226
|
+
O = J.current, J.current = null, V();
|
224
227
|
try {
|
225
|
-
if (
|
226
|
-
var
|
228
|
+
if (i) {
|
229
|
+
var T = function() {
|
227
230
|
throw Error();
|
228
231
|
};
|
229
|
-
if (Object.defineProperty(
|
232
|
+
if (Object.defineProperty(T.prototype, "props", {
|
230
233
|
set: function() {
|
231
234
|
throw Error();
|
232
235
|
}
|
233
236
|
}), typeof Reflect == "object" && Reflect.construct) {
|
234
237
|
try {
|
235
|
-
Reflect.construct(
|
236
|
-
} catch (
|
237
|
-
|
238
|
+
Reflect.construct(T, []);
|
239
|
+
} catch (W) {
|
240
|
+
w = W;
|
238
241
|
}
|
239
|
-
Reflect.construct(e, [],
|
242
|
+
Reflect.construct(e, [], T);
|
240
243
|
} else {
|
241
244
|
try {
|
242
|
-
|
243
|
-
} catch (
|
244
|
-
|
245
|
+
T.call();
|
246
|
+
} catch (W) {
|
247
|
+
w = W;
|
245
248
|
}
|
246
|
-
e.call(
|
249
|
+
e.call(T.prototype);
|
247
250
|
}
|
248
251
|
} else {
|
249
252
|
try {
|
250
253
|
throw Error();
|
251
|
-
} catch (
|
252
|
-
|
254
|
+
} catch (W) {
|
255
|
+
w = W;
|
253
256
|
}
|
254
257
|
e();
|
255
258
|
}
|
256
|
-
} catch (
|
257
|
-
if (
|
258
|
-
for (var
|
259
|
-
`),
|
260
|
-
`),
|
261
|
-
|
262
|
-
for (;
|
263
|
-
if (
|
264
|
-
if (
|
259
|
+
} catch (W) {
|
260
|
+
if (W && w && typeof W.stack == "string") {
|
261
|
+
for (var F = W.stack.split(`
|
262
|
+
`), L = w.stack.split(`
|
263
|
+
`), I = F.length - 1, D = L.length - 1; I >= 1 && D >= 0 && F[I] !== L[D]; )
|
264
|
+
D--;
|
265
|
+
for (; I >= 1 && D >= 0; I--, D--)
|
266
|
+
if (F[I] !== L[D]) {
|
267
|
+
if (I !== 1 || D !== 1)
|
265
268
|
do
|
266
|
-
if (
|
267
|
-
var
|
268
|
-
` +
|
269
|
-
return e.displayName &&
|
269
|
+
if (I--, D--, D < 0 || F[I] !== L[D]) {
|
270
|
+
var q = `
|
271
|
+
` + F[I].replace(" at new ", " at ");
|
272
|
+
return e.displayName && q.includes("<anonymous>") && (q = q.replace("<anonymous>", e.displayName)), typeof e == "function" && X.set(e, q), q;
|
270
273
|
}
|
271
|
-
while (
|
274
|
+
while (I >= 1 && D >= 0);
|
272
275
|
break;
|
273
276
|
}
|
274
277
|
}
|
275
278
|
} finally {
|
276
|
-
|
279
|
+
re = !1, J.current = O, te(), Error.prepareStackTrace = $;
|
277
280
|
}
|
278
|
-
var
|
279
|
-
return typeof e == "function" &&
|
281
|
+
var oe = e ? e.displayName || e.name : "", ne = oe ? Z(oe) : "";
|
282
|
+
return typeof e == "function" && X.set(e, ne), ne;
|
280
283
|
}
|
281
|
-
function
|
282
|
-
return
|
284
|
+
function ue(e, i, d) {
|
285
|
+
return me(e, !1);
|
283
286
|
}
|
284
|
-
function
|
285
|
-
var
|
286
|
-
return !!(
|
287
|
+
function Ke(e) {
|
288
|
+
var i = e.prototype;
|
289
|
+
return !!(i && i.isReactComponent);
|
287
290
|
}
|
288
|
-
function
|
291
|
+
function ve(e, i, d) {
|
289
292
|
if (e == null)
|
290
293
|
return "";
|
291
294
|
if (typeof e == "function")
|
292
|
-
return
|
295
|
+
return me(e, Ke(e));
|
293
296
|
if (typeof e == "string")
|
294
|
-
return
|
297
|
+
return Z(e);
|
295
298
|
switch (e) {
|
299
|
+
case x:
|
300
|
+
return Z("Suspense");
|
296
301
|
case p:
|
297
|
-
return
|
298
|
-
case s:
|
299
|
-
return V("SuspenseList");
|
302
|
+
return Z("SuspenseList");
|
300
303
|
}
|
301
304
|
if (typeof e == "object")
|
302
305
|
switch (e.$$typeof) {
|
303
|
-
case
|
304
|
-
return
|
305
|
-
case
|
306
|
-
return
|
307
|
-
case
|
308
|
-
var
|
306
|
+
case c:
|
307
|
+
return ue(e.render);
|
308
|
+
case f:
|
309
|
+
return ve(e.type, i, d);
|
310
|
+
case E: {
|
311
|
+
var w = e, $ = w._payload, O = w._init;
|
309
312
|
try {
|
310
|
-
return
|
313
|
+
return ve(O($), i, d);
|
311
314
|
} catch {
|
312
315
|
}
|
313
316
|
}
|
314
317
|
}
|
315
318
|
return "";
|
316
319
|
}
|
317
|
-
var
|
318
|
-
function
|
320
|
+
var ce = Object.prototype.hasOwnProperty, Se = {}, Fe = A.ReactDebugCurrentFrame;
|
321
|
+
function be(e) {
|
319
322
|
if (e) {
|
320
|
-
var
|
321
|
-
|
323
|
+
var i = e._owner, d = ve(e.type, e._source, i ? i.type : null);
|
324
|
+
Fe.setExtraStackFrame(d);
|
322
325
|
} else
|
323
|
-
|
326
|
+
Fe.setExtraStackFrame(null);
|
324
327
|
}
|
325
|
-
function
|
328
|
+
function Ze(e, i, d, w, $) {
|
326
329
|
{
|
327
|
-
var
|
328
|
-
for (var
|
329
|
-
if (
|
330
|
-
var
|
330
|
+
var O = Function.call.bind(ce);
|
331
|
+
for (var T in e)
|
332
|
+
if (O(e, T)) {
|
333
|
+
var F = void 0;
|
331
334
|
try {
|
332
|
-
if (typeof e[
|
333
|
-
var
|
334
|
-
throw
|
335
|
+
if (typeof e[T] != "function") {
|
336
|
+
var L = Error((w || "React class") + ": " + d + " type `" + T + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[T] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
337
|
+
throw L.name = "Invariant Violation", L;
|
335
338
|
}
|
336
|
-
|
337
|
-
} catch (
|
338
|
-
|
339
|
+
F = e[T](i, T, w, d, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
340
|
+
} catch (I) {
|
341
|
+
F = I;
|
339
342
|
}
|
340
|
-
|
343
|
+
F && !(F instanceof Error) && (be($), t("%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).", w || "React class", d, T, typeof F), be(null)), F instanceof Error && !(F.message in Se) && (Se[F.message] = !0, be($), t("Failed %s type: %s", d, F.message), be(null));
|
341
344
|
}
|
342
345
|
}
|
343
346
|
}
|
344
|
-
var
|
345
|
-
function
|
346
|
-
return
|
347
|
+
var Xe = Array.isArray;
|
348
|
+
function we(e) {
|
349
|
+
return Xe(e);
|
347
350
|
}
|
348
|
-
function
|
351
|
+
function Qe(e) {
|
349
352
|
{
|
350
|
-
var
|
351
|
-
return
|
353
|
+
var i = typeof Symbol == "function" && Symbol.toStringTag, d = i && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
354
|
+
return d;
|
352
355
|
}
|
353
356
|
}
|
354
|
-
function
|
357
|
+
function et(e) {
|
355
358
|
try {
|
356
|
-
return
|
359
|
+
return Re(e), !1;
|
357
360
|
} catch {
|
358
361
|
return !0;
|
359
362
|
}
|
360
363
|
}
|
361
|
-
function
|
364
|
+
function Re(e) {
|
362
365
|
return "" + e;
|
363
366
|
}
|
364
|
-
function
|
365
|
-
if (
|
366
|
-
return
|
367
|
+
function Ce(e) {
|
368
|
+
if (et(e))
|
369
|
+
return t("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Qe(e)), Re(e);
|
367
370
|
}
|
368
|
-
var
|
371
|
+
var Te = A.ReactCurrentOwner, tt = {
|
369
372
|
key: !0,
|
370
373
|
ref: !0,
|
371
374
|
__self: !0,
|
372
375
|
__source: !0
|
373
|
-
},
|
374
|
-
function
|
375
|
-
if (
|
376
|
-
var
|
377
|
-
if (
|
376
|
+
}, $e, Oe;
|
377
|
+
function nt(e) {
|
378
|
+
if (ce.call(e, "ref")) {
|
379
|
+
var i = Object.getOwnPropertyDescriptor(e, "ref").get;
|
380
|
+
if (i && i.isReactWarning)
|
378
381
|
return !1;
|
379
382
|
}
|
380
383
|
return e.ref !== void 0;
|
381
384
|
}
|
382
|
-
function
|
383
|
-
if (
|
384
|
-
var
|
385
|
-
if (
|
385
|
+
function rt(e) {
|
386
|
+
if (ce.call(e, "key")) {
|
387
|
+
var i = Object.getOwnPropertyDescriptor(e, "key").get;
|
388
|
+
if (i && i.isReactWarning)
|
386
389
|
return !1;
|
387
390
|
}
|
388
391
|
return e.key !== void 0;
|
389
392
|
}
|
390
|
-
function
|
391
|
-
typeof e.ref == "string" &&
|
393
|
+
function at(e, i) {
|
394
|
+
typeof e.ref == "string" && Te.current;
|
392
395
|
}
|
393
|
-
function
|
396
|
+
function it(e, i) {
|
394
397
|
{
|
395
|
-
var
|
396
|
-
|
398
|
+
var d = function() {
|
399
|
+
$e || ($e = !0, t("%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)", i));
|
397
400
|
};
|
398
|
-
|
399
|
-
get:
|
401
|
+
d.isReactWarning = !0, Object.defineProperty(e, "key", {
|
402
|
+
get: d,
|
400
403
|
configurable: !0
|
401
404
|
});
|
402
405
|
}
|
403
406
|
}
|
404
|
-
function
|
407
|
+
function ot(e, i) {
|
405
408
|
{
|
406
|
-
var
|
407
|
-
|
409
|
+
var d = function() {
|
410
|
+
Oe || (Oe = !0, t("%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)", i));
|
408
411
|
};
|
409
|
-
|
410
|
-
get:
|
412
|
+
d.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
413
|
+
get: d,
|
411
414
|
configurable: !0
|
412
415
|
});
|
413
416
|
}
|
414
417
|
}
|
415
|
-
var
|
416
|
-
var
|
418
|
+
var st = function(e, i, d, w, $, O, T) {
|
419
|
+
var F = {
|
417
420
|
// This tag allows us to uniquely identify this as a React Element
|
418
|
-
$$typeof:
|
421
|
+
$$typeof: g,
|
419
422
|
// Built-in properties that belong on the element
|
420
423
|
type: e,
|
421
|
-
key:
|
422
|
-
ref:
|
423
|
-
props:
|
424
|
+
key: i,
|
425
|
+
ref: d,
|
426
|
+
props: T,
|
424
427
|
// Record the component responsible for creating this element.
|
425
|
-
_owner:
|
428
|
+
_owner: O
|
426
429
|
};
|
427
|
-
return
|
430
|
+
return F._store = {}, Object.defineProperty(F._store, "validated", {
|
428
431
|
configurable: !1,
|
429
432
|
enumerable: !1,
|
430
433
|
writable: !0,
|
431
434
|
value: !1
|
432
|
-
}), Object.defineProperty(
|
435
|
+
}), Object.defineProperty(F, "_self", {
|
433
436
|
configurable: !1,
|
434
437
|
enumerable: !1,
|
435
438
|
writable: !1,
|
436
|
-
value:
|
437
|
-
}), Object.defineProperty(
|
439
|
+
value: w
|
440
|
+
}), Object.defineProperty(F, "_source", {
|
438
441
|
configurable: !1,
|
439
442
|
enumerable: !1,
|
440
443
|
writable: !1,
|
441
|
-
value:
|
442
|
-
}), Object.freeze && (Object.freeze(
|
444
|
+
value: $
|
445
|
+
}), Object.freeze && (Object.freeze(F.props), Object.freeze(F)), F;
|
443
446
|
};
|
444
|
-
function
|
447
|
+
function lt(e, i, d, w, $) {
|
445
448
|
{
|
446
|
-
var
|
447
|
-
|
448
|
-
for (
|
449
|
-
|
449
|
+
var O, T = {}, F = null, L = null;
|
450
|
+
d !== void 0 && (Ce(d), F = "" + d), rt(i) && (Ce(i.key), F = "" + i.key), nt(i) && (L = i.ref, at(i, $));
|
451
|
+
for (O in i)
|
452
|
+
ce.call(i, O) && !tt.hasOwnProperty(O) && (T[O] = i[O]);
|
450
453
|
if (e && e.defaultProps) {
|
451
|
-
var
|
452
|
-
for (
|
453
|
-
|
454
|
+
var I = e.defaultProps;
|
455
|
+
for (O in I)
|
456
|
+
T[O] === void 0 && (T[O] = I[O]);
|
454
457
|
}
|
455
|
-
if (
|
456
|
-
var
|
457
|
-
|
458
|
+
if (F || L) {
|
459
|
+
var D = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
460
|
+
F && it(T, D), L && ot(T, D);
|
458
461
|
}
|
459
|
-
return
|
462
|
+
return st(e, F, L, $, w, Te.current, T);
|
460
463
|
}
|
461
464
|
}
|
462
|
-
var
|
463
|
-
function
|
465
|
+
var ke = A.ReactCurrentOwner, je = A.ReactDebugCurrentFrame;
|
466
|
+
function ie(e) {
|
464
467
|
if (e) {
|
465
|
-
var
|
466
|
-
|
468
|
+
var i = e._owner, d = ve(e.type, e._source, i ? i.type : null);
|
469
|
+
je.setExtraStackFrame(d);
|
467
470
|
} else
|
468
|
-
|
471
|
+
je.setExtraStackFrame(null);
|
469
472
|
}
|
470
|
-
var
|
471
|
-
|
472
|
-
function
|
473
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
473
|
+
var xe;
|
474
|
+
xe = !1;
|
475
|
+
function Ee(e) {
|
476
|
+
return typeof e == "object" && e !== null && e.$$typeof === g;
|
474
477
|
}
|
475
|
-
function
|
478
|
+
function Pe() {
|
476
479
|
{
|
477
|
-
if (
|
478
|
-
var e =
|
480
|
+
if (ke.current) {
|
481
|
+
var e = Y(ke.current.type);
|
479
482
|
if (e)
|
480
483
|
return `
|
481
484
|
|
@@ -484,162 +487,1322 @@ Check the render method of \`` + e + "`.";
|
|
484
487
|
return "";
|
485
488
|
}
|
486
489
|
}
|
487
|
-
function
|
490
|
+
function ut(e) {
|
488
491
|
return "";
|
489
492
|
}
|
490
|
-
var
|
491
|
-
function
|
493
|
+
var Ie = {};
|
494
|
+
function ct(e) {
|
492
495
|
{
|
493
|
-
var
|
494
|
-
if (!
|
495
|
-
var
|
496
|
-
|
496
|
+
var i = Pe();
|
497
|
+
if (!i) {
|
498
|
+
var d = typeof e == "string" ? e : e.displayName || e.name;
|
499
|
+
d && (i = `
|
497
500
|
|
498
|
-
Check the top-level render call using <` +
|
501
|
+
Check the top-level render call using <` + d + ">.");
|
499
502
|
}
|
500
|
-
return
|
503
|
+
return i;
|
501
504
|
}
|
502
505
|
}
|
503
|
-
function
|
506
|
+
function De(e, i) {
|
504
507
|
{
|
505
508
|
if (!e._store || e._store.validated || e.key != null)
|
506
509
|
return;
|
507
510
|
e._store.validated = !0;
|
508
|
-
var
|
509
|
-
if (
|
511
|
+
var d = ct(i);
|
512
|
+
if (Ie[d])
|
510
513
|
return;
|
511
|
-
|
512
|
-
var
|
513
|
-
e && e._owner && e._owner !==
|
514
|
+
Ie[d] = !0;
|
515
|
+
var w = "";
|
516
|
+
e && e._owner && e._owner !== ke.current && (w = " It was passed a child from " + Y(e._owner.type) + "."), ie(e), t('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', d, w), ie(null);
|
514
517
|
}
|
515
518
|
}
|
516
|
-
function
|
519
|
+
function Me(e, i) {
|
517
520
|
{
|
518
521
|
if (typeof e != "object")
|
519
522
|
return;
|
520
|
-
if (
|
521
|
-
for (var
|
522
|
-
var
|
523
|
-
|
523
|
+
if (we(e))
|
524
|
+
for (var d = 0; d < e.length; d++) {
|
525
|
+
var w = e[d];
|
526
|
+
Ee(w) && De(w, i);
|
524
527
|
}
|
525
|
-
else if (
|
528
|
+
else if (Ee(e))
|
526
529
|
e._store && (e._store.validated = !0);
|
527
530
|
else if (e) {
|
528
|
-
var
|
529
|
-
if (typeof
|
530
|
-
for (var
|
531
|
-
|
531
|
+
var $ = _(e);
|
532
|
+
if (typeof $ == "function" && $ !== e.entries)
|
533
|
+
for (var O = $.call(e), T; !(T = O.next()).done; )
|
534
|
+
Ee(T.value) && De(T.value, i);
|
532
535
|
}
|
533
536
|
}
|
534
537
|
}
|
535
|
-
function
|
538
|
+
function dt(e) {
|
536
539
|
{
|
537
|
-
var
|
538
|
-
if (
|
540
|
+
var i = e.type;
|
541
|
+
if (i == null || typeof i == "string")
|
539
542
|
return;
|
540
|
-
var
|
541
|
-
if (typeof
|
542
|
-
|
543
|
-
else if (typeof
|
543
|
+
var d;
|
544
|
+
if (typeof i == "function")
|
545
|
+
d = i.propTypes;
|
546
|
+
else if (typeof i == "object" && (i.$$typeof === c || // Note: Memo only checks outer props here.
|
544
547
|
// Inner props are checked in the reconciler.
|
545
|
-
|
546
|
-
|
548
|
+
i.$$typeof === f))
|
549
|
+
d = i.propTypes;
|
547
550
|
else
|
548
551
|
return;
|
549
|
-
if (
|
550
|
-
var
|
551
|
-
|
552
|
-
} else if (
|
553
|
-
|
554
|
-
var
|
555
|
-
|
552
|
+
if (d) {
|
553
|
+
var w = Y(i);
|
554
|
+
Ze(d, e.props, "prop", w, e);
|
555
|
+
} else if (i.PropTypes !== void 0 && !xe) {
|
556
|
+
xe = !0;
|
557
|
+
var $ = Y(i);
|
558
|
+
t("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", $ || "Unknown");
|
556
559
|
}
|
557
|
-
typeof
|
560
|
+
typeof i.getDefaultProps == "function" && !i.getDefaultProps.isReactClassApproved && t("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
558
561
|
}
|
559
562
|
}
|
560
|
-
function
|
563
|
+
function ft(e) {
|
561
564
|
{
|
562
|
-
for (var
|
563
|
-
var
|
564
|
-
if (
|
565
|
-
|
565
|
+
for (var i = Object.keys(e.props), d = 0; d < i.length; d++) {
|
566
|
+
var w = i[d];
|
567
|
+
if (w !== "children" && w !== "key") {
|
568
|
+
ie(e), t("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", w), ie(null);
|
566
569
|
break;
|
567
570
|
}
|
568
571
|
}
|
569
|
-
e.ref !== null && (
|
572
|
+
e.ref !== null && (ie(e), t("Invalid attribute `ref` supplied to `React.Fragment`."), ie(null));
|
570
573
|
}
|
571
574
|
}
|
572
|
-
var
|
573
|
-
function
|
575
|
+
var ze = {};
|
576
|
+
function Le(e, i, d, w, $, O) {
|
574
577
|
{
|
575
|
-
var
|
576
|
-
if (!
|
577
|
-
var
|
578
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
579
|
-
var
|
580
|
-
|
581
|
-
var
|
582
|
-
e === null ?
|
578
|
+
var T = j(e);
|
579
|
+
if (!T) {
|
580
|
+
var F = "";
|
581
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (F += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
582
|
+
var L = ut();
|
583
|
+
L ? F += L : F += Pe();
|
584
|
+
var I;
|
585
|
+
e === null ? I = "null" : we(e) ? I = "array" : e !== void 0 && e.$$typeof === g ? (I = "<" + (Y(e.type) || "Unknown") + " />", F = " Did you accidentally export a JSX literal instead of a component?") : I = typeof e, t("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", I, F);
|
583
586
|
}
|
584
|
-
var
|
585
|
-
if (
|
586
|
-
return
|
587
|
-
if (
|
588
|
-
var
|
589
|
-
if (
|
590
|
-
if (
|
591
|
-
if (
|
592
|
-
for (var
|
593
|
-
|
594
|
-
Object.freeze && Object.freeze(
|
587
|
+
var D = lt(e, i, d, $, O);
|
588
|
+
if (D == null)
|
589
|
+
return D;
|
590
|
+
if (T) {
|
591
|
+
var q = i.children;
|
592
|
+
if (q !== void 0)
|
593
|
+
if (w)
|
594
|
+
if (we(q)) {
|
595
|
+
for (var oe = 0; oe < q.length; oe++)
|
596
|
+
Me(q[oe], e);
|
597
|
+
Object.freeze && Object.freeze(q);
|
595
598
|
} else
|
596
|
-
|
599
|
+
t("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
597
600
|
else
|
598
|
-
|
601
|
+
Me(q, e);
|
599
602
|
}
|
600
|
-
if (
|
601
|
-
var
|
602
|
-
return
|
603
|
-
}),
|
604
|
-
if (!
|
605
|
-
var
|
606
|
-
|
603
|
+
if (ce.call(i, "key")) {
|
604
|
+
var ne = Y(e), W = Object.keys(i).filter(function(bt) {
|
605
|
+
return bt !== "key";
|
606
|
+
}), Ae = W.length > 0 ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}";
|
607
|
+
if (!ze[ne + Ae]) {
|
608
|
+
var vt = W.length > 0 ? "{" + W.join(": ..., ") + ": ...}" : "{}";
|
609
|
+
t(`A props object containing a "key" prop is being spread into JSX:
|
607
610
|
let props = %s;
|
608
611
|
<%s {...props} />
|
609
612
|
React keys must be passed directly to JSX without using spread:
|
610
613
|
let props = %s;
|
611
|
-
<%s key={someKey} {...props} />`,
|
614
|
+
<%s key={someKey} {...props} />`, Ae, ne, vt, ne), ze[ne + Ae] = !0;
|
612
615
|
}
|
613
616
|
}
|
614
|
-
return e ===
|
617
|
+
return e === m ? ft(D) : dt(D), D;
|
615
618
|
}
|
616
619
|
}
|
617
|
-
function
|
618
|
-
return
|
620
|
+
function gt(e, i, d) {
|
621
|
+
return Le(e, i, d, !0);
|
619
622
|
}
|
620
|
-
function
|
621
|
-
return
|
623
|
+
function pt(e, i, d) {
|
624
|
+
return Le(e, i, d, !1);
|
622
625
|
}
|
623
|
-
var
|
624
|
-
|
625
|
-
})()),
|
626
|
+
var ht = pt, mt = gt;
|
627
|
+
fe.Fragment = m, fe.jsx = ht, fe.jsxs = mt;
|
628
|
+
})()), fe;
|
626
629
|
}
|
627
|
-
var
|
628
|
-
function
|
629
|
-
return
|
630
|
+
var Ue;
|
631
|
+
function Ft() {
|
632
|
+
return Ue || (Ue = 1, process.env.NODE_ENV === "production" ? ye.exports = _t() : ye.exports = St()), ye.exports;
|
630
633
|
}
|
631
|
-
var
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
634
|
+
var se = Ft(), _e = { exports: {} }, Ye;
|
635
|
+
function Rt() {
|
636
|
+
return Ye || (Ye = 1, (function(l) {
|
637
|
+
var g = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
|
638
|
+
/**
|
639
|
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
640
|
+
*
|
641
|
+
* @license MIT <https://opensource.org/licenses/MIT>
|
642
|
+
* @author Lea Verou <https://lea.verou.me>
|
643
|
+
* @namespace
|
644
|
+
* @public
|
645
|
+
*/
|
646
|
+
var r = (function(m) {
|
647
|
+
var v = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, k = 0, h = {}, a = {
|
648
|
+
/**
|
649
|
+
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
|
650
|
+
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
|
651
|
+
* additional languages or plugins yourself.
|
652
|
+
*
|
653
|
+
* By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
|
654
|
+
*
|
655
|
+
* You obviously have to change this value before the automatic highlighting started. To do this, you can add an
|
656
|
+
* empty Prism object into the global scope before loading the Prism script like this:
|
657
|
+
*
|
658
|
+
* ```js
|
659
|
+
* window.Prism = window.Prism || {};
|
660
|
+
* Prism.manual = true;
|
661
|
+
* // add a new <script> to load Prism's script
|
662
|
+
* ```
|
663
|
+
*
|
664
|
+
* @default false
|
665
|
+
* @type {boolean}
|
666
|
+
* @memberof Prism
|
667
|
+
* @public
|
668
|
+
*/
|
669
|
+
manual: m.Prism && m.Prism.manual,
|
670
|
+
/**
|
671
|
+
* By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
|
672
|
+
* `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
|
673
|
+
* own worker, you don't want it to do this.
|
674
|
+
*
|
675
|
+
* By setting this value to `true`, Prism will not add its own listeners to the worker.
|
676
|
+
*
|
677
|
+
* You obviously have to change this value before Prism executes. To do this, you can add an
|
678
|
+
* empty Prism object into the global scope before loading the Prism script like this:
|
679
|
+
*
|
680
|
+
* ```js
|
681
|
+
* window.Prism = window.Prism || {};
|
682
|
+
* Prism.disableWorkerMessageHandler = true;
|
683
|
+
* // Load Prism's script
|
684
|
+
* ```
|
685
|
+
*
|
686
|
+
* @default false
|
687
|
+
* @type {boolean}
|
688
|
+
* @memberof Prism
|
689
|
+
* @public
|
690
|
+
*/
|
691
|
+
disableWorkerMessageHandler: m.Prism && m.Prism.disableWorkerMessageHandler,
|
692
|
+
/**
|
693
|
+
* A namespace for utility methods.
|
694
|
+
*
|
695
|
+
* All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
|
696
|
+
* change or disappear at any time.
|
697
|
+
*
|
698
|
+
* @namespace
|
699
|
+
* @memberof Prism
|
700
|
+
*/
|
701
|
+
util: {
|
702
|
+
encode: function t(n) {
|
703
|
+
return n instanceof c ? new c(n.type, t(n.content), n.alias) : Array.isArray(n) ? n.map(t) : n.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
704
|
+
},
|
705
|
+
/**
|
706
|
+
* Returns the name of the type of the given value.
|
707
|
+
*
|
708
|
+
* @param {any} o
|
709
|
+
* @returns {string}
|
710
|
+
* @example
|
711
|
+
* type(null) === 'Null'
|
712
|
+
* type(undefined) === 'Undefined'
|
713
|
+
* type(123) === 'Number'
|
714
|
+
* type('foo') === 'String'
|
715
|
+
* type(true) === 'Boolean'
|
716
|
+
* type([1, 2]) === 'Array'
|
717
|
+
* type({}) === 'Object'
|
718
|
+
* type(String) === 'Function'
|
719
|
+
* type(/abc+/) === 'RegExp'
|
720
|
+
*/
|
721
|
+
type: function(t) {
|
722
|
+
return Object.prototype.toString.call(t).slice(8, -1);
|
723
|
+
},
|
724
|
+
/**
|
725
|
+
* Returns a unique number for the given object. Later calls will still return the same number.
|
726
|
+
*
|
727
|
+
* @param {Object} obj
|
728
|
+
* @returns {number}
|
729
|
+
*/
|
730
|
+
objId: function(t) {
|
731
|
+
return t.__id || Object.defineProperty(t, "__id", { value: ++k }), t.__id;
|
732
|
+
},
|
733
|
+
/**
|
734
|
+
* Creates a deep clone of the given object.
|
735
|
+
*
|
736
|
+
* The main intended use of this function is to clone language definitions.
|
737
|
+
*
|
738
|
+
* @param {T} o
|
739
|
+
* @param {Record<number, any>} [visited]
|
740
|
+
* @returns {T}
|
741
|
+
* @template T
|
742
|
+
*/
|
743
|
+
clone: function t(n, o) {
|
744
|
+
o = o || {};
|
745
|
+
var s, u;
|
746
|
+
switch (a.util.type(n)) {
|
747
|
+
case "Object":
|
748
|
+
if (u = a.util.objId(n), o[u])
|
749
|
+
return o[u];
|
750
|
+
s = /** @type {Record<string, any>} */
|
751
|
+
{}, o[u] = s;
|
752
|
+
for (var y in n)
|
753
|
+
n.hasOwnProperty(y) && (s[y] = t(n[y], o));
|
754
|
+
return (
|
755
|
+
/** @type {any} */
|
756
|
+
s
|
757
|
+
);
|
758
|
+
case "Array":
|
759
|
+
return u = a.util.objId(n), o[u] ? o[u] : (s = [], o[u] = s, /** @type {Array} */
|
760
|
+
/** @type {any} */
|
761
|
+
n.forEach(function(R, b) {
|
762
|
+
s[b] = t(R, o);
|
763
|
+
}), /** @type {any} */
|
764
|
+
s);
|
765
|
+
default:
|
766
|
+
return n;
|
767
|
+
}
|
768
|
+
},
|
769
|
+
/**
|
770
|
+
* Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
|
771
|
+
*
|
772
|
+
* If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
|
773
|
+
*
|
774
|
+
* @param {Element} element
|
775
|
+
* @returns {string}
|
776
|
+
*/
|
777
|
+
getLanguage: function(t) {
|
778
|
+
for (; t; ) {
|
779
|
+
var n = v.exec(t.className);
|
780
|
+
if (n)
|
781
|
+
return n[1].toLowerCase();
|
782
|
+
t = t.parentElement;
|
783
|
+
}
|
784
|
+
return "none";
|
785
|
+
},
|
786
|
+
/**
|
787
|
+
* Sets the Prism `language-xxxx` class of the given element.
|
788
|
+
*
|
789
|
+
* @param {Element} element
|
790
|
+
* @param {string} language
|
791
|
+
* @returns {void}
|
792
|
+
*/
|
793
|
+
setLanguage: function(t, n) {
|
794
|
+
t.className = t.className.replace(RegExp(v, "gi"), ""), t.classList.add("language-" + n);
|
795
|
+
},
|
796
|
+
/**
|
797
|
+
* Returns the script element that is currently executing.
|
798
|
+
*
|
799
|
+
* This does __not__ work for line script element.
|
800
|
+
*
|
801
|
+
* @returns {HTMLScriptElement | null}
|
802
|
+
*/
|
803
|
+
currentScript: function() {
|
804
|
+
if (typeof document > "u")
|
805
|
+
return null;
|
806
|
+
if (document.currentScript && document.currentScript.tagName === "SCRIPT")
|
807
|
+
return (
|
808
|
+
/** @type {any} */
|
809
|
+
document.currentScript
|
810
|
+
);
|
811
|
+
try {
|
812
|
+
throw new Error();
|
813
|
+
} catch (s) {
|
814
|
+
var t = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(s.stack) || [])[1];
|
815
|
+
if (t) {
|
816
|
+
var n = document.getElementsByTagName("script");
|
817
|
+
for (var o in n)
|
818
|
+
if (n[o].src == t)
|
819
|
+
return n[o];
|
820
|
+
}
|
821
|
+
return null;
|
822
|
+
}
|
823
|
+
},
|
824
|
+
/**
|
825
|
+
* Returns whether a given class is active for `element`.
|
826
|
+
*
|
827
|
+
* The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
|
828
|
+
* if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
|
829
|
+
* given class is just the given class with a `no-` prefix.
|
830
|
+
*
|
831
|
+
* Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
|
832
|
+
* closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
|
833
|
+
* ancestors have the given class or the negated version of it, then the default activation will be returned.
|
834
|
+
*
|
835
|
+
* In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
|
836
|
+
* version of it, the class is considered active.
|
837
|
+
*
|
838
|
+
* @param {Element} element
|
839
|
+
* @param {string} className
|
840
|
+
* @param {boolean} [defaultActivation=false]
|
841
|
+
* @returns {boolean}
|
842
|
+
*/
|
843
|
+
isActive: function(t, n, o) {
|
844
|
+
for (var s = "no-" + n; t; ) {
|
845
|
+
var u = t.classList;
|
846
|
+
if (u.contains(n))
|
847
|
+
return !0;
|
848
|
+
if (u.contains(s))
|
849
|
+
return !1;
|
850
|
+
t = t.parentElement;
|
851
|
+
}
|
852
|
+
return !!o;
|
853
|
+
}
|
854
|
+
},
|
855
|
+
/**
|
856
|
+
* This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
|
857
|
+
*
|
858
|
+
* @namespace
|
859
|
+
* @memberof Prism
|
860
|
+
* @public
|
861
|
+
*/
|
862
|
+
languages: {
|
863
|
+
/**
|
864
|
+
* The grammar for plain, unformatted text.
|
865
|
+
*/
|
866
|
+
plain: h,
|
867
|
+
plaintext: h,
|
868
|
+
text: h,
|
869
|
+
txt: h,
|
870
|
+
/**
|
871
|
+
* Creates a deep copy of the language with the given id and appends the given tokens.
|
872
|
+
*
|
873
|
+
* If a token in `redef` also appears in the copied language, then the existing token in the copied language
|
874
|
+
* will be overwritten at its original position.
|
875
|
+
*
|
876
|
+
* ## Best practices
|
877
|
+
*
|
878
|
+
* Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
|
879
|
+
* doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
|
880
|
+
* understand the language definition because, normally, the order of tokens matters in Prism grammars.
|
881
|
+
*
|
882
|
+
* Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
|
883
|
+
* Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
|
884
|
+
*
|
885
|
+
* @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
|
886
|
+
* @param {Grammar} redef The new tokens to append.
|
887
|
+
* @returns {Grammar} The new language created.
|
888
|
+
* @public
|
889
|
+
* @example
|
890
|
+
* Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
|
891
|
+
* // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
|
892
|
+
* // at its original position
|
893
|
+
* 'comment': { ... },
|
894
|
+
* // CSS doesn't have a 'color' token, so this token will be appended
|
895
|
+
* 'color': /\b(?:red|green|blue)\b/
|
896
|
+
* });
|
897
|
+
*/
|
898
|
+
extend: function(t, n) {
|
899
|
+
var o = a.util.clone(a.languages[t]);
|
900
|
+
for (var s in n)
|
901
|
+
o[s] = n[s];
|
902
|
+
return o;
|
903
|
+
},
|
904
|
+
/**
|
905
|
+
* Inserts tokens _before_ another token in a language definition or any other grammar.
|
906
|
+
*
|
907
|
+
* ## Usage
|
908
|
+
*
|
909
|
+
* This helper method makes it easy to modify existing languages. For example, the CSS language definition
|
910
|
+
* not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
|
911
|
+
* in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
|
912
|
+
* appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
|
913
|
+
* this:
|
914
|
+
*
|
915
|
+
* ```js
|
916
|
+
* Prism.languages.markup.style = {
|
917
|
+
* // token
|
918
|
+
* };
|
919
|
+
* ```
|
920
|
+
*
|
921
|
+
* then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
|
922
|
+
* before existing tokens. For the CSS example above, you would use it like this:
|
923
|
+
*
|
924
|
+
* ```js
|
925
|
+
* Prism.languages.insertBefore('markup', 'cdata', {
|
926
|
+
* 'style': {
|
927
|
+
* // token
|
928
|
+
* }
|
929
|
+
* });
|
930
|
+
* ```
|
931
|
+
*
|
932
|
+
* ## Special cases
|
933
|
+
*
|
934
|
+
* If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
|
935
|
+
* will be ignored.
|
936
|
+
*
|
937
|
+
* This behavior can be used to insert tokens after `before`:
|
938
|
+
*
|
939
|
+
* ```js
|
940
|
+
* Prism.languages.insertBefore('markup', 'comment', {
|
941
|
+
* 'comment': Prism.languages.markup.comment,
|
942
|
+
* // tokens after 'comment'
|
943
|
+
* });
|
944
|
+
* ```
|
945
|
+
*
|
946
|
+
* ## Limitations
|
947
|
+
*
|
948
|
+
* The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
|
949
|
+
* properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
|
950
|
+
* differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
|
951
|
+
* deleting properties which is necessary to insert at arbitrary positions.
|
952
|
+
*
|
953
|
+
* To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
|
954
|
+
* Instead, it will create a new object and replace all references to the target object with the new one. This
|
955
|
+
* can be done without temporarily deleting properties, so the iteration order is well-defined.
|
956
|
+
*
|
957
|
+
* However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
|
958
|
+
* you hold the target object in a variable, then the value of the variable will not change.
|
959
|
+
*
|
960
|
+
* ```js
|
961
|
+
* var oldMarkup = Prism.languages.markup;
|
962
|
+
* var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
|
963
|
+
*
|
964
|
+
* assert(oldMarkup !== Prism.languages.markup);
|
965
|
+
* assert(newMarkup === Prism.languages.markup);
|
966
|
+
* ```
|
967
|
+
*
|
968
|
+
* @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
|
969
|
+
* object to be modified.
|
970
|
+
* @param {string} before The key to insert before.
|
971
|
+
* @param {Grammar} insert An object containing the key-value pairs to be inserted.
|
972
|
+
* @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
|
973
|
+
* object to be modified.
|
974
|
+
*
|
975
|
+
* Defaults to `Prism.languages`.
|
976
|
+
* @returns {Grammar} The new grammar object.
|
977
|
+
* @public
|
978
|
+
*/
|
979
|
+
insertBefore: function(t, n, o, s) {
|
980
|
+
s = s || /** @type {any} */
|
981
|
+
a.languages;
|
982
|
+
var u = s[t], y = {};
|
983
|
+
for (var R in u)
|
984
|
+
if (u.hasOwnProperty(R)) {
|
985
|
+
if (R == n)
|
986
|
+
for (var b in o)
|
987
|
+
o.hasOwnProperty(b) && (y[b] = o[b]);
|
988
|
+
o.hasOwnProperty(R) || (y[R] = u[R]);
|
989
|
+
}
|
990
|
+
var j = s[t];
|
991
|
+
return s[t] = y, a.languages.DFS(a.languages, function(z, U) {
|
992
|
+
U === j && z != t && (this[z] = y);
|
993
|
+
}), y;
|
994
|
+
},
|
995
|
+
// Traverse a language definition with Depth First Search
|
996
|
+
DFS: function t(n, o, s, u) {
|
997
|
+
u = u || {};
|
998
|
+
var y = a.util.objId;
|
999
|
+
for (var R in n)
|
1000
|
+
if (n.hasOwnProperty(R)) {
|
1001
|
+
o.call(n, R, n[R], s || R);
|
1002
|
+
var b = n[R], j = a.util.type(b);
|
1003
|
+
j === "Object" && !u[y(b)] ? (u[y(b)] = !0, t(b, o, null, u)) : j === "Array" && !u[y(b)] && (u[y(b)] = !0, t(b, o, R, u));
|
1004
|
+
}
|
1005
|
+
}
|
1006
|
+
},
|
1007
|
+
plugins: {},
|
1008
|
+
/**
|
1009
|
+
* This is the most high-level function in Prism’s API.
|
1010
|
+
* It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
|
1011
|
+
* each one of them.
|
1012
|
+
*
|
1013
|
+
* This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
|
1014
|
+
*
|
1015
|
+
* @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
|
1016
|
+
* @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
|
1017
|
+
* @memberof Prism
|
1018
|
+
* @public
|
1019
|
+
*/
|
1020
|
+
highlightAll: function(t, n) {
|
1021
|
+
a.highlightAllUnder(document, t, n);
|
1022
|
+
},
|
1023
|
+
/**
|
1024
|
+
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
|
1025
|
+
* {@link Prism.highlightElement} on each one of them.
|
1026
|
+
*
|
1027
|
+
* The following hooks will be run:
|
1028
|
+
* 1. `before-highlightall`
|
1029
|
+
* 2. `before-all-elements-highlight`
|
1030
|
+
* 3. All hooks of {@link Prism.highlightElement} for each element.
|
1031
|
+
*
|
1032
|
+
* @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
|
1033
|
+
* @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
|
1034
|
+
* @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
|
1035
|
+
* @memberof Prism
|
1036
|
+
* @public
|
1037
|
+
*/
|
1038
|
+
highlightAllUnder: function(t, n, o) {
|
1039
|
+
var s = {
|
1040
|
+
callback: o,
|
1041
|
+
container: t,
|
1042
|
+
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
1043
|
+
};
|
1044
|
+
a.hooks.run("before-highlightall", s), s.elements = Array.prototype.slice.apply(s.container.querySelectorAll(s.selector)), a.hooks.run("before-all-elements-highlight", s);
|
1045
|
+
for (var u = 0, y; y = s.elements[u++]; )
|
1046
|
+
a.highlightElement(y, n === !0, s.callback);
|
1047
|
+
},
|
1048
|
+
/**
|
1049
|
+
* Highlights the code inside a single element.
|
1050
|
+
*
|
1051
|
+
* The following hooks will be run:
|
1052
|
+
* 1. `before-sanity-check`
|
1053
|
+
* 2. `before-highlight`
|
1054
|
+
* 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
|
1055
|
+
* 4. `before-insert`
|
1056
|
+
* 5. `after-highlight`
|
1057
|
+
* 6. `complete`
|
1058
|
+
*
|
1059
|
+
* Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
|
1060
|
+
* the element's language.
|
1061
|
+
*
|
1062
|
+
* @param {Element} element The element containing the code.
|
1063
|
+
* It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
|
1064
|
+
* @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
|
1065
|
+
* to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
|
1066
|
+
* [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
|
1067
|
+
*
|
1068
|
+
* Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
|
1069
|
+
* asynchronous highlighting to work. You can build your own bundle on the
|
1070
|
+
* [Download page](https://prismjs.com/download.html).
|
1071
|
+
* @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
|
1072
|
+
* Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
|
1073
|
+
* @memberof Prism
|
1074
|
+
* @public
|
1075
|
+
*/
|
1076
|
+
highlightElement: function(t, n, o) {
|
1077
|
+
var s = a.util.getLanguage(t), u = a.languages[s];
|
1078
|
+
a.util.setLanguage(t, s);
|
1079
|
+
var y = t.parentElement;
|
1080
|
+
y && y.nodeName.toLowerCase() === "pre" && a.util.setLanguage(y, s);
|
1081
|
+
var R = t.textContent, b = {
|
1082
|
+
element: t,
|
1083
|
+
language: s,
|
1084
|
+
grammar: u,
|
1085
|
+
code: R
|
1086
|
+
};
|
1087
|
+
function j(U) {
|
1088
|
+
b.highlightedCode = U, a.hooks.run("before-insert", b), b.element.innerHTML = b.highlightedCode, a.hooks.run("after-highlight", b), a.hooks.run("complete", b), o && o.call(b.element);
|
1089
|
+
}
|
1090
|
+
if (a.hooks.run("before-sanity-check", b), y = b.element.parentElement, y && y.nodeName.toLowerCase() === "pre" && !y.hasAttribute("tabindex") && y.setAttribute("tabindex", "0"), !b.code) {
|
1091
|
+
a.hooks.run("complete", b), o && o.call(b.element);
|
1092
|
+
return;
|
1093
|
+
}
|
1094
|
+
if (a.hooks.run("before-highlight", b), !b.grammar) {
|
1095
|
+
j(a.util.encode(b.code));
|
1096
|
+
return;
|
1097
|
+
}
|
1098
|
+
if (n && m.Worker) {
|
1099
|
+
var z = new Worker(a.filename);
|
1100
|
+
z.onmessage = function(U) {
|
1101
|
+
j(U.data);
|
1102
|
+
}, z.postMessage(JSON.stringify({
|
1103
|
+
language: b.language,
|
1104
|
+
code: b.code,
|
1105
|
+
immediateClose: !0
|
1106
|
+
}));
|
1107
|
+
} else
|
1108
|
+
j(a.highlight(b.code, b.grammar, b.language));
|
1109
|
+
},
|
1110
|
+
/**
|
1111
|
+
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input
|
1112
|
+
* and the language definitions to use, and returns a string with the HTML produced.
|
1113
|
+
*
|
1114
|
+
* The following hooks will be run:
|
1115
|
+
* 1. `before-tokenize`
|
1116
|
+
* 2. `after-tokenize`
|
1117
|
+
* 3. `wrap`: On each {@link Token}.
|
1118
|
+
*
|
1119
|
+
* @param {string} text A string with the code to be highlighted.
|
1120
|
+
* @param {Grammar} grammar An object containing the tokens to use.
|
1121
|
+
*
|
1122
|
+
* Usually a language definition like `Prism.languages.markup`.
|
1123
|
+
* @param {string} language The name of the language definition passed to `grammar`.
|
1124
|
+
* @returns {string} The highlighted HTML.
|
1125
|
+
* @memberof Prism
|
1126
|
+
* @public
|
1127
|
+
* @example
|
1128
|
+
* Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
|
1129
|
+
*/
|
1130
|
+
highlight: function(t, n, o) {
|
1131
|
+
var s = {
|
1132
|
+
code: t,
|
1133
|
+
grammar: n,
|
1134
|
+
language: o
|
1135
|
+
};
|
1136
|
+
if (a.hooks.run("before-tokenize", s), !s.grammar)
|
1137
|
+
throw new Error('The language "' + s.language + '" has no grammar.');
|
1138
|
+
return s.tokens = a.tokenize(s.code, s.grammar), a.hooks.run("after-tokenize", s), c.stringify(a.util.encode(s.tokens), s.language);
|
1139
|
+
},
|
1140
|
+
/**
|
1141
|
+
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
|
1142
|
+
* and the language definitions to use, and returns an array with the tokenized code.
|
1143
|
+
*
|
1144
|
+
* When the language definition includes nested tokens, the function is called recursively on each of these tokens.
|
1145
|
+
*
|
1146
|
+
* This method could be useful in other contexts as well, as a very crude parser.
|
1147
|
+
*
|
1148
|
+
* @param {string} text A string with the code to be highlighted.
|
1149
|
+
* @param {Grammar} grammar An object containing the tokens to use.
|
1150
|
+
*
|
1151
|
+
* Usually a language definition like `Prism.languages.markup`.
|
1152
|
+
* @returns {TokenStream} An array of strings and tokens, a token stream.
|
1153
|
+
* @memberof Prism
|
1154
|
+
* @public
|
1155
|
+
* @example
|
1156
|
+
* let code = `var foo = 0;`;
|
1157
|
+
* let tokens = Prism.tokenize(code, Prism.languages.javascript);
|
1158
|
+
* tokens.forEach(token => {
|
1159
|
+
* if (token instanceof Prism.Token && token.type === 'number') {
|
1160
|
+
* console.log(`Found numeric literal: ${token.content}`);
|
1161
|
+
* }
|
1162
|
+
* });
|
1163
|
+
*/
|
1164
|
+
tokenize: function(t, n) {
|
1165
|
+
var o = n.rest;
|
1166
|
+
if (o) {
|
1167
|
+
for (var s in o)
|
1168
|
+
n[s] = o[s];
|
1169
|
+
delete n.rest;
|
1170
|
+
}
|
1171
|
+
var u = new f();
|
1172
|
+
return E(u, u.head, t), p(t, u, n, u.head, 0), P(u);
|
1173
|
+
},
|
1174
|
+
/**
|
1175
|
+
* @namespace
|
1176
|
+
* @memberof Prism
|
1177
|
+
* @public
|
1178
|
+
*/
|
1179
|
+
hooks: {
|
1180
|
+
all: {},
|
1181
|
+
/**
|
1182
|
+
* Adds the given callback to the list of callbacks for the given hook.
|
1183
|
+
*
|
1184
|
+
* The callback will be invoked when the hook it is registered for is run.
|
1185
|
+
* Hooks are usually directly run by a highlight function but you can also run hooks yourself.
|
1186
|
+
*
|
1187
|
+
* One callback function can be registered to multiple hooks and the same hook multiple times.
|
1188
|
+
*
|
1189
|
+
* @param {string} name The name of the hook.
|
1190
|
+
* @param {HookCallback} callback The callback function which is given environment variables.
|
1191
|
+
* @public
|
1192
|
+
*/
|
1193
|
+
add: function(t, n) {
|
1194
|
+
var o = a.hooks.all;
|
1195
|
+
o[t] = o[t] || [], o[t].push(n);
|
1196
|
+
},
|
1197
|
+
/**
|
1198
|
+
* Runs a hook invoking all registered callbacks with the given environment variables.
|
1199
|
+
*
|
1200
|
+
* Callbacks will be invoked synchronously and in the order in which they were registered.
|
1201
|
+
*
|
1202
|
+
* @param {string} name The name of the hook.
|
1203
|
+
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
1204
|
+
* @public
|
1205
|
+
*/
|
1206
|
+
run: function(t, n) {
|
1207
|
+
var o = a.hooks.all[t];
|
1208
|
+
if (!(!o || !o.length))
|
1209
|
+
for (var s = 0, u; u = o[s++]; )
|
1210
|
+
u(n);
|
1211
|
+
}
|
1212
|
+
},
|
1213
|
+
Token: c
|
1214
|
+
};
|
1215
|
+
m.Prism = a;
|
1216
|
+
function c(t, n, o, s) {
|
1217
|
+
this.type = t, this.content = n, this.alias = o, this.length = (s || "").length | 0;
|
1218
|
+
}
|
1219
|
+
c.stringify = function t(n, o) {
|
1220
|
+
if (typeof n == "string")
|
1221
|
+
return n;
|
1222
|
+
if (Array.isArray(n)) {
|
1223
|
+
var s = "";
|
1224
|
+
return n.forEach(function(j) {
|
1225
|
+
s += t(j, o);
|
1226
|
+
}), s;
|
1227
|
+
}
|
1228
|
+
var u = {
|
1229
|
+
type: n.type,
|
1230
|
+
content: t(n.content, o),
|
1231
|
+
tag: "span",
|
1232
|
+
classes: ["token", n.type],
|
1233
|
+
attributes: {},
|
1234
|
+
language: o
|
1235
|
+
}, y = n.alias;
|
1236
|
+
y && (Array.isArray(y) ? Array.prototype.push.apply(u.classes, y) : u.classes.push(y)), a.hooks.run("wrap", u);
|
1237
|
+
var R = "";
|
1238
|
+
for (var b in u.attributes)
|
1239
|
+
R += " " + b + '="' + (u.attributes[b] || "").replace(/"/g, """) + '"';
|
1240
|
+
return "<" + u.tag + ' class="' + u.classes.join(" ") + '"' + R + ">" + u.content + "</" + u.tag + ">";
|
1241
|
+
};
|
1242
|
+
function x(t, n, o, s) {
|
1243
|
+
t.lastIndex = n;
|
1244
|
+
var u = t.exec(o);
|
1245
|
+
if (u && s && u[1]) {
|
1246
|
+
var y = u[1].length;
|
1247
|
+
u.index += y, u[0] = u[0].slice(y);
|
1248
|
+
}
|
1249
|
+
return u;
|
1250
|
+
}
|
1251
|
+
function p(t, n, o, s, u, y) {
|
1252
|
+
for (var R in o)
|
1253
|
+
if (!(!o.hasOwnProperty(R) || !o[R])) {
|
1254
|
+
var b = o[R];
|
1255
|
+
b = Array.isArray(b) ? b : [b];
|
1256
|
+
for (var j = 0; j < b.length; ++j) {
|
1257
|
+
if (y && y.cause == R + "," + j)
|
1258
|
+
return;
|
1259
|
+
var z = b[j], U = z.inside, Y = !!z.lookbehind, B = !!z.greedy, Q = z.alias;
|
1260
|
+
if (B && !z.pattern.global) {
|
1261
|
+
var pe = z.pattern.toString().match(/[imsuy]*$/)[0];
|
1262
|
+
z.pattern = RegExp(z.pattern.source, pe + "g");
|
1263
|
+
}
|
1264
|
+
for (var le = z.pattern || z, M = s.next, H = u; M !== n.tail && !(y && H >= y.reach); H += M.value.length, M = M.next) {
|
1265
|
+
var G = M.value;
|
1266
|
+
if (n.length > t.length)
|
1267
|
+
return;
|
1268
|
+
if (!(G instanceof c)) {
|
1269
|
+
var ee = 1, N;
|
1270
|
+
if (B) {
|
1271
|
+
if (N = x(le, H, t, Y), !N || N.index >= t.length)
|
1272
|
+
break;
|
1273
|
+
var J = N.index, he = N.index + N[0].length, V = H;
|
1274
|
+
for (V += M.value.length; J >= V; )
|
1275
|
+
M = M.next, V += M.value.length;
|
1276
|
+
if (V -= M.value.length, H = V, M.value instanceof c)
|
1277
|
+
continue;
|
1278
|
+
for (var te = M; te !== n.tail && (V < he || typeof te.value == "string"); te = te.next)
|
1279
|
+
ee++, V += te.value.length;
|
1280
|
+
ee--, G = t.slice(H, V), N.index -= H;
|
1281
|
+
} else if (N = x(le, 0, G, Y), !N)
|
1282
|
+
continue;
|
1283
|
+
var J = N.index, K = N[0], Z = G.slice(0, J), re = G.slice(J + K.length), X = H + G.length;
|
1284
|
+
y && X > y.reach && (y.reach = X);
|
1285
|
+
var ae = M.prev;
|
1286
|
+
Z && (ae = E(n, ae, Z), H += Z.length), C(n, ae, ee);
|
1287
|
+
var me = new c(R, U ? a.tokenize(K, U) : K, Q, K);
|
1288
|
+
if (M = E(n, ae, me), re && E(n, M, re), ee > 1) {
|
1289
|
+
var ue = {
|
1290
|
+
cause: R + "," + j,
|
1291
|
+
reach: X
|
1292
|
+
};
|
1293
|
+
p(t, n, o, M.prev, H, ue), y && ue.reach > y.reach && (y.reach = ue.reach);
|
1294
|
+
}
|
1295
|
+
}
|
1296
|
+
}
|
1297
|
+
}
|
1298
|
+
}
|
1299
|
+
}
|
1300
|
+
function f() {
|
1301
|
+
var t = { value: null, prev: null, next: null }, n = { value: null, prev: t, next: null };
|
1302
|
+
t.next = n, this.head = t, this.tail = n, this.length = 0;
|
1303
|
+
}
|
1304
|
+
function E(t, n, o) {
|
1305
|
+
var s = n.next, u = { value: o, prev: n, next: s };
|
1306
|
+
return n.next = u, s.prev = u, t.length++, u;
|
1307
|
+
}
|
1308
|
+
function C(t, n, o) {
|
1309
|
+
for (var s = n.next, u = 0; u < o && s !== t.tail; u++)
|
1310
|
+
s = s.next;
|
1311
|
+
n.next = s, s.prev = n, t.length -= u;
|
1312
|
+
}
|
1313
|
+
function P(t) {
|
1314
|
+
for (var n = [], o = t.head.next; o !== t.tail; )
|
1315
|
+
n.push(o.value), o = o.next;
|
1316
|
+
return n;
|
1317
|
+
}
|
1318
|
+
if (!m.document)
|
1319
|
+
return m.addEventListener && (a.disableWorkerMessageHandler || m.addEventListener("message", function(t) {
|
1320
|
+
var n = JSON.parse(t.data), o = n.language, s = n.code, u = n.immediateClose;
|
1321
|
+
m.postMessage(a.highlight(s, a.languages[o], o)), u && m.close();
|
1322
|
+
}, !1)), a;
|
1323
|
+
var S = a.util.currentScript();
|
1324
|
+
S && (a.filename = S.src, S.hasAttribute("data-manual") && (a.manual = !0));
|
1325
|
+
function _() {
|
1326
|
+
a.manual || a.highlightAll();
|
1327
|
+
}
|
1328
|
+
if (!a.manual) {
|
1329
|
+
var A = document.readyState;
|
1330
|
+
A === "loading" || A === "interactive" && S && S.defer ? document.addEventListener("DOMContentLoaded", _) : window.requestAnimationFrame ? window.requestAnimationFrame(_) : window.setTimeout(_, 16);
|
1331
|
+
}
|
636
1332
|
return a;
|
637
|
-
})
|
1333
|
+
})(g);
|
1334
|
+
l.exports && (l.exports = r), typeof We < "u" && (We.Prism = r), r.languages.markup = {
|
1335
|
+
comment: {
|
1336
|
+
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
1337
|
+
greedy: !0
|
1338
|
+
},
|
1339
|
+
prolog: {
|
1340
|
+
pattern: /<\?[\s\S]+?\?>/,
|
1341
|
+
greedy: !0
|
1342
|
+
},
|
1343
|
+
doctype: {
|
1344
|
+
// https://www.w3.org/TR/xml/#NT-doctypedecl
|
1345
|
+
pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
|
1346
|
+
greedy: !0,
|
1347
|
+
inside: {
|
1348
|
+
"internal-subset": {
|
1349
|
+
pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
|
1350
|
+
lookbehind: !0,
|
1351
|
+
greedy: !0,
|
1352
|
+
inside: null
|
1353
|
+
// see below
|
1354
|
+
},
|
1355
|
+
string: {
|
1356
|
+
pattern: /"[^"]*"|'[^']*'/,
|
1357
|
+
greedy: !0
|
1358
|
+
},
|
1359
|
+
punctuation: /^<!|>$|[[\]]/,
|
1360
|
+
"doctype-tag": /^DOCTYPE/i,
|
1361
|
+
name: /[^\s<>'"]+/
|
1362
|
+
}
|
1363
|
+
},
|
1364
|
+
cdata: {
|
1365
|
+
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
1366
|
+
greedy: !0
|
1367
|
+
},
|
1368
|
+
tag: {
|
1369
|
+
pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
|
1370
|
+
greedy: !0,
|
1371
|
+
inside: {
|
1372
|
+
tag: {
|
1373
|
+
pattern: /^<\/?[^\s>\/]+/,
|
1374
|
+
inside: {
|
1375
|
+
punctuation: /^<\/?/,
|
1376
|
+
namespace: /^[^\s>\/:]+:/
|
1377
|
+
}
|
1378
|
+
},
|
1379
|
+
"special-attr": [],
|
1380
|
+
"attr-value": {
|
1381
|
+
pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
|
1382
|
+
inside: {
|
1383
|
+
punctuation: [
|
1384
|
+
{
|
1385
|
+
pattern: /^=/,
|
1386
|
+
alias: "attr-equals"
|
1387
|
+
},
|
1388
|
+
{
|
1389
|
+
pattern: /^(\s*)["']|["']$/,
|
1390
|
+
lookbehind: !0
|
1391
|
+
}
|
1392
|
+
]
|
1393
|
+
}
|
1394
|
+
},
|
1395
|
+
punctuation: /\/?>/,
|
1396
|
+
"attr-name": {
|
1397
|
+
pattern: /[^\s>\/]+/,
|
1398
|
+
inside: {
|
1399
|
+
namespace: /^[^\s>\/:]+:/
|
1400
|
+
}
|
1401
|
+
}
|
1402
|
+
}
|
1403
|
+
},
|
1404
|
+
entity: [
|
1405
|
+
{
|
1406
|
+
pattern: /&[\da-z]{1,8};/i,
|
1407
|
+
alias: "named-entity"
|
1408
|
+
},
|
1409
|
+
/&#x?[\da-f]{1,8};/i
|
1410
|
+
]
|
1411
|
+
}, r.languages.markup.tag.inside["attr-value"].inside.entity = r.languages.markup.entity, r.languages.markup.doctype.inside["internal-subset"].inside = r.languages.markup, r.hooks.add("wrap", function(m) {
|
1412
|
+
m.type === "entity" && (m.attributes.title = m.content.replace(/&/, "&"));
|
1413
|
+
}), Object.defineProperty(r.languages.markup.tag, "addInlined", {
|
1414
|
+
/**
|
1415
|
+
* Adds an inlined language to markup.
|
1416
|
+
*
|
1417
|
+
* An example of an inlined language is CSS with `<style>` tags.
|
1418
|
+
*
|
1419
|
+
* @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
|
1420
|
+
* case insensitive.
|
1421
|
+
* @param {string} lang The language key.
|
1422
|
+
* @example
|
1423
|
+
* addInlined('style', 'css');
|
1424
|
+
*/
|
1425
|
+
value: function(v, k) {
|
1426
|
+
var h = {};
|
1427
|
+
h["language-" + k] = {
|
1428
|
+
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
1429
|
+
lookbehind: !0,
|
1430
|
+
inside: r.languages[k]
|
1431
|
+
}, h.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
1432
|
+
var a = {
|
1433
|
+
"included-cdata": {
|
1434
|
+
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
1435
|
+
inside: h
|
1436
|
+
}
|
1437
|
+
};
|
1438
|
+
a["language-" + k] = {
|
1439
|
+
pattern: /[\s\S]+/,
|
1440
|
+
inside: r.languages[k]
|
1441
|
+
};
|
1442
|
+
var c = {};
|
1443
|
+
c[v] = {
|
1444
|
+
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
1445
|
+
return v;
|
1446
|
+
}), "i"),
|
1447
|
+
lookbehind: !0,
|
1448
|
+
greedy: !0,
|
1449
|
+
inside: a
|
1450
|
+
}, r.languages.insertBefore("markup", "cdata", c);
|
1451
|
+
}
|
1452
|
+
}), Object.defineProperty(r.languages.markup.tag, "addAttribute", {
|
1453
|
+
/**
|
1454
|
+
* Adds an pattern to highlight languages embedded in HTML attributes.
|
1455
|
+
*
|
1456
|
+
* An example of an inlined language is CSS with `style` attributes.
|
1457
|
+
*
|
1458
|
+
* @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
|
1459
|
+
* case insensitive.
|
1460
|
+
* @param {string} lang The language key.
|
1461
|
+
* @example
|
1462
|
+
* addAttribute('style', 'css');
|
1463
|
+
*/
|
1464
|
+
value: function(m, v) {
|
1465
|
+
r.languages.markup.tag.inside["special-attr"].push({
|
1466
|
+
pattern: RegExp(
|
1467
|
+
/(^|["'\s])/.source + "(?:" + m + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
|
1468
|
+
"i"
|
1469
|
+
),
|
1470
|
+
lookbehind: !0,
|
1471
|
+
inside: {
|
1472
|
+
"attr-name": /^[^\s=]+/,
|
1473
|
+
"attr-value": {
|
1474
|
+
pattern: /=[\s\S]+/,
|
1475
|
+
inside: {
|
1476
|
+
value: {
|
1477
|
+
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
1478
|
+
lookbehind: !0,
|
1479
|
+
alias: [v, "language-" + v],
|
1480
|
+
inside: r.languages[v]
|
1481
|
+
},
|
1482
|
+
punctuation: [
|
1483
|
+
{
|
1484
|
+
pattern: /^=/,
|
1485
|
+
alias: "attr-equals"
|
1486
|
+
},
|
1487
|
+
/"|'/
|
1488
|
+
]
|
1489
|
+
}
|
1490
|
+
}
|
1491
|
+
}
|
1492
|
+
});
|
1493
|
+
}
|
1494
|
+
}), r.languages.html = r.languages.markup, r.languages.mathml = r.languages.markup, r.languages.svg = r.languages.markup, r.languages.xml = r.languages.extend("markup", {}), r.languages.ssml = r.languages.xml, r.languages.atom = r.languages.xml, r.languages.rss = r.languages.xml, (function(m) {
|
1495
|
+
var v = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
1496
|
+
m.languages.css = {
|
1497
|
+
comment: /\/\*[\s\S]*?\*\//,
|
1498
|
+
atrule: {
|
1499
|
+
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + v.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
1500
|
+
inside: {
|
1501
|
+
rule: /^@[\w-]+/,
|
1502
|
+
"selector-function-argument": {
|
1503
|
+
pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
|
1504
|
+
lookbehind: !0,
|
1505
|
+
alias: "selector"
|
1506
|
+
},
|
1507
|
+
keyword: {
|
1508
|
+
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
|
1509
|
+
lookbehind: !0
|
1510
|
+
}
|
1511
|
+
// See rest below
|
1512
|
+
}
|
1513
|
+
},
|
1514
|
+
url: {
|
1515
|
+
// https://drafts.csswg.org/css-values-3/#urls
|
1516
|
+
pattern: RegExp("\\burl\\((?:" + v.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
1517
|
+
greedy: !0,
|
1518
|
+
inside: {
|
1519
|
+
function: /^url/i,
|
1520
|
+
punctuation: /^\(|\)$/,
|
1521
|
+
string: {
|
1522
|
+
pattern: RegExp("^" + v.source + "$"),
|
1523
|
+
alias: "url"
|
1524
|
+
}
|
1525
|
+
}
|
1526
|
+
},
|
1527
|
+
selector: {
|
1528
|
+
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + v.source + ")*(?=\\s*\\{)"),
|
1529
|
+
lookbehind: !0
|
1530
|
+
},
|
1531
|
+
string: {
|
1532
|
+
pattern: v,
|
1533
|
+
greedy: !0
|
1534
|
+
},
|
1535
|
+
property: {
|
1536
|
+
pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
|
1537
|
+
lookbehind: !0
|
1538
|
+
},
|
1539
|
+
important: /!important\b/i,
|
1540
|
+
function: {
|
1541
|
+
pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
|
1542
|
+
lookbehind: !0
|
1543
|
+
},
|
1544
|
+
punctuation: /[(){};:,]/
|
1545
|
+
}, m.languages.css.atrule.inside.rest = m.languages.css;
|
1546
|
+
var k = m.languages.markup;
|
1547
|
+
k && (k.tag.addInlined("style", "css"), k.tag.addAttribute("style", "css"));
|
1548
|
+
})(r), r.languages.clike = {
|
1549
|
+
comment: [
|
1550
|
+
{
|
1551
|
+
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
1552
|
+
lookbehind: !0,
|
1553
|
+
greedy: !0
|
1554
|
+
},
|
1555
|
+
{
|
1556
|
+
pattern: /(^|[^\\:])\/\/.*/,
|
1557
|
+
lookbehind: !0,
|
1558
|
+
greedy: !0
|
1559
|
+
}
|
1560
|
+
],
|
1561
|
+
string: {
|
1562
|
+
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
1563
|
+
greedy: !0
|
1564
|
+
},
|
1565
|
+
"class-name": {
|
1566
|
+
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
1567
|
+
lookbehind: !0,
|
1568
|
+
inside: {
|
1569
|
+
punctuation: /[.\\]/
|
1570
|
+
}
|
1571
|
+
},
|
1572
|
+
keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
|
1573
|
+
boolean: /\b(?:false|true)\b/,
|
1574
|
+
function: /\b\w+(?=\()/,
|
1575
|
+
number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
1576
|
+
operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
1577
|
+
punctuation: /[{}[\];(),.:]/
|
1578
|
+
}, r.languages.javascript = r.languages.extend("clike", {
|
1579
|
+
"class-name": [
|
1580
|
+
r.languages.clike["class-name"],
|
1581
|
+
{
|
1582
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
1583
|
+
lookbehind: !0
|
1584
|
+
}
|
1585
|
+
],
|
1586
|
+
keyword: [
|
1587
|
+
{
|
1588
|
+
pattern: /((?:^|\})\s*)catch\b/,
|
1589
|
+
lookbehind: !0
|
1590
|
+
},
|
1591
|
+
{
|
1592
|
+
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/,
|
1593
|
+
lookbehind: !0
|
1594
|
+
}
|
1595
|
+
],
|
1596
|
+
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
|
1597
|
+
function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
1598
|
+
number: {
|
1599
|
+
pattern: RegExp(
|
1600
|
+
/(^|[^\w$])/.source + "(?:" + // constant
|
1601
|
+
(/NaN|Infinity/.source + "|" + // binary integer
|
1602
|
+
/0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
|
1603
|
+
/0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
|
1604
|
+
/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
|
1605
|
+
/\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
|
1606
|
+
/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
|
1607
|
+
),
|
1608
|
+
lookbehind: !0
|
1609
|
+
},
|
1610
|
+
operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
1611
|
+
}), r.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, r.languages.insertBefore("javascript", "keyword", {
|
1612
|
+
regex: {
|
1613
|
+
pattern: RegExp(
|
1614
|
+
// lookbehind
|
1615
|
+
// eslint-disable-next-line regexp/no-dupe-characters-character-class
|
1616
|
+
/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
|
1617
|
+
// There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
|
1618
|
+
// classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
|
1619
|
+
// with the only syntax, so we have to define 2 different regex patterns.
|
1620
|
+
/\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
|
1621
|
+
/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
|
1622
|
+
/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
|
1623
|
+
),
|
1624
|
+
lookbehind: !0,
|
1625
|
+
greedy: !0,
|
1626
|
+
inside: {
|
1627
|
+
"regex-source": {
|
1628
|
+
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
1629
|
+
lookbehind: !0,
|
1630
|
+
alias: "language-regex",
|
1631
|
+
inside: r.languages.regex
|
1632
|
+
},
|
1633
|
+
"regex-delimiter": /^\/|\/$/,
|
1634
|
+
"regex-flags": /^[a-z]+$/
|
1635
|
+
}
|
1636
|
+
},
|
1637
|
+
// This must be declared before keyword because we use "function" inside the look-forward
|
1638
|
+
"function-variable": {
|
1639
|
+
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*=>))/,
|
1640
|
+
alias: "function"
|
1641
|
+
},
|
1642
|
+
parameter: [
|
1643
|
+
{
|
1644
|
+
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
1645
|
+
lookbehind: !0,
|
1646
|
+
inside: r.languages.javascript
|
1647
|
+
},
|
1648
|
+
{
|
1649
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
1650
|
+
lookbehind: !0,
|
1651
|
+
inside: r.languages.javascript
|
1652
|
+
},
|
1653
|
+
{
|
1654
|
+
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
1655
|
+
lookbehind: !0,
|
1656
|
+
inside: r.languages.javascript
|
1657
|
+
},
|
1658
|
+
{
|
1659
|
+
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*\{)/,
|
1660
|
+
lookbehind: !0,
|
1661
|
+
inside: r.languages.javascript
|
1662
|
+
}
|
1663
|
+
],
|
1664
|
+
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
1665
|
+
}), r.languages.insertBefore("javascript", "string", {
|
1666
|
+
hashbang: {
|
1667
|
+
pattern: /^#!.*/,
|
1668
|
+
greedy: !0,
|
1669
|
+
alias: "comment"
|
1670
|
+
},
|
1671
|
+
"template-string": {
|
1672
|
+
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
1673
|
+
greedy: !0,
|
1674
|
+
inside: {
|
1675
|
+
"template-punctuation": {
|
1676
|
+
pattern: /^`|`$/,
|
1677
|
+
alias: "string"
|
1678
|
+
},
|
1679
|
+
interpolation: {
|
1680
|
+
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
1681
|
+
lookbehind: !0,
|
1682
|
+
inside: {
|
1683
|
+
"interpolation-punctuation": {
|
1684
|
+
pattern: /^\$\{|\}$/,
|
1685
|
+
alias: "punctuation"
|
1686
|
+
},
|
1687
|
+
rest: r.languages.javascript
|
1688
|
+
}
|
1689
|
+
},
|
1690
|
+
string: /[\s\S]+/
|
1691
|
+
}
|
1692
|
+
},
|
1693
|
+
"string-property": {
|
1694
|
+
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
1695
|
+
lookbehind: !0,
|
1696
|
+
greedy: !0,
|
1697
|
+
alias: "property"
|
1698
|
+
}
|
1699
|
+
}), r.languages.insertBefore("javascript", "operator", {
|
1700
|
+
"literal-property": {
|
1701
|
+
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
1702
|
+
lookbehind: !0,
|
1703
|
+
alias: "property"
|
1704
|
+
}
|
1705
|
+
}), r.languages.markup && (r.languages.markup.tag.addInlined("script", "javascript"), r.languages.markup.tag.addAttribute(
|
1706
|
+
/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,
|
1707
|
+
"javascript"
|
1708
|
+
)), r.languages.js = r.languages.javascript, (function() {
|
1709
|
+
if (typeof r > "u" || typeof document > "u")
|
1710
|
+
return;
|
1711
|
+
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
1712
|
+
var m = "Loading…", v = function(S, _) {
|
1713
|
+
return "✖ Error " + S + " while fetching file: " + _;
|
1714
|
+
}, k = "✖ Error: File does not exist or is empty", h = {
|
1715
|
+
js: "javascript",
|
1716
|
+
py: "python",
|
1717
|
+
rb: "ruby",
|
1718
|
+
ps1: "powershell",
|
1719
|
+
psm1: "powershell",
|
1720
|
+
sh: "bash",
|
1721
|
+
bat: "batch",
|
1722
|
+
h: "c",
|
1723
|
+
tex: "latex"
|
1724
|
+
}, a = "data-src-status", c = "loading", x = "loaded", p = "failed", f = "pre[data-src]:not([" + a + '="' + x + '"]):not([' + a + '="' + c + '"])';
|
1725
|
+
function E(S, _, A) {
|
1726
|
+
var t = new XMLHttpRequest();
|
1727
|
+
t.open("GET", S, !0), t.onreadystatechange = function() {
|
1728
|
+
t.readyState == 4 && (t.status < 400 && t.responseText ? _(t.responseText) : t.status >= 400 ? A(v(t.status, t.statusText)) : A(k));
|
1729
|
+
}, t.send(null);
|
1730
|
+
}
|
1731
|
+
function C(S) {
|
1732
|
+
var _ = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(S || "");
|
1733
|
+
if (_) {
|
1734
|
+
var A = Number(_[1]), t = _[2], n = _[3];
|
1735
|
+
return t ? n ? [A, Number(n)] : [A, void 0] : [A, A];
|
1736
|
+
}
|
1737
|
+
}
|
1738
|
+
r.hooks.add("before-highlightall", function(S) {
|
1739
|
+
S.selector += ", " + f;
|
1740
|
+
}), r.hooks.add("before-sanity-check", function(S) {
|
1741
|
+
var _ = (
|
1742
|
+
/** @type {HTMLPreElement} */
|
1743
|
+
S.element
|
1744
|
+
);
|
1745
|
+
if (_.matches(f)) {
|
1746
|
+
S.code = "", _.setAttribute(a, c);
|
1747
|
+
var A = _.appendChild(document.createElement("CODE"));
|
1748
|
+
A.textContent = m;
|
1749
|
+
var t = _.getAttribute("data-src"), n = S.language;
|
1750
|
+
if (n === "none") {
|
1751
|
+
var o = (/\.(\w+)$/.exec(t) || [, "none"])[1];
|
1752
|
+
n = h[o] || o;
|
1753
|
+
}
|
1754
|
+
r.util.setLanguage(A, n), r.util.setLanguage(_, n);
|
1755
|
+
var s = r.plugins.autoloader;
|
1756
|
+
s && s.loadLanguages(n), E(
|
1757
|
+
t,
|
1758
|
+
function(u) {
|
1759
|
+
_.setAttribute(a, x);
|
1760
|
+
var y = C(_.getAttribute("data-range"));
|
1761
|
+
if (y) {
|
1762
|
+
var R = u.split(/\r\n?|\n/g), b = y[0], j = y[1] == null ? R.length : y[1];
|
1763
|
+
b < 0 && (b += R.length), b = Math.max(0, Math.min(b - 1, R.length)), j < 0 && (j += R.length), j = Math.max(0, Math.min(j, R.length)), u = R.slice(b, j).join(`
|
1764
|
+
`), _.hasAttribute("data-start") || _.setAttribute("data-start", String(b + 1));
|
1765
|
+
}
|
1766
|
+
A.textContent = u, r.highlightElement(A);
|
1767
|
+
},
|
1768
|
+
function(u) {
|
1769
|
+
_.setAttribute(a, p), A.textContent = u;
|
1770
|
+
}
|
1771
|
+
);
|
1772
|
+
}
|
1773
|
+
}), r.plugins.fileHighlight = {
|
1774
|
+
/**
|
1775
|
+
* Executes the File Highlight plugin for all matching `pre` elements under the given container.
|
1776
|
+
*
|
1777
|
+
* Note: Elements which are already loaded or currently loading will not be touched by this method.
|
1778
|
+
*
|
1779
|
+
* @param {ParentNode} [container=document]
|
1780
|
+
*/
|
1781
|
+
highlight: function(_) {
|
1782
|
+
for (var A = (_ || document).querySelectorAll(f), t = 0, n; n = A[t++]; )
|
1783
|
+
r.highlightElement(n);
|
1784
|
+
}
|
1785
|
+
};
|
1786
|
+
var P = !1;
|
1787
|
+
r.fileHighlight = function() {
|
1788
|
+
P || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), P = !0), r.plugins.fileHighlight.highlight.apply(this, arguments);
|
1789
|
+
};
|
1790
|
+
})();
|
1791
|
+
})(_e)), _e.exports;
|
1792
|
+
}
|
1793
|
+
var Ct = Rt();
|
1794
|
+
const Tt = /* @__PURE__ */ At(Ct);
|
1795
|
+
(function(l) {
|
1796
|
+
var g = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;
|
1797
|
+
function r(p) {
|
1798
|
+
return p = p.replace(/<inner>/g, function() {
|
1799
|
+
return g;
|
1800
|
+
}), RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + p + ")");
|
638
1801
|
}
|
639
|
-
var
|
640
|
-
return
|
641
|
-
}),
|
642
|
-
|
1802
|
+
var m = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source, v = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g, function() {
|
1803
|
+
return m;
|
1804
|
+
}), k = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;
|
1805
|
+
l.languages.markdown = l.languages.extend("markup", {}), l.languages.insertBefore("markdown", "prolog", {
|
643
1806
|
"front-matter-block": {
|
644
1807
|
pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,
|
645
1808
|
lookbehind: !0,
|
@@ -649,7 +1812,7 @@ var M = kr();
|
|
649
1812
|
"front-matter": {
|
650
1813
|
pattern: /\S+(?:\s+\S+)*/,
|
651
1814
|
alias: ["yaml", "language-yaml"],
|
652
|
-
inside:
|
1815
|
+
inside: l.languages.yaml
|
653
1816
|
}
|
654
1817
|
}
|
655
1818
|
},
|
@@ -659,33 +1822,33 @@ var M = kr();
|
|
659
1822
|
alias: "punctuation"
|
660
1823
|
},
|
661
1824
|
table: {
|
662
|
-
pattern: RegExp("^" +
|
1825
|
+
pattern: RegExp("^" + v + k + "(?:" + v + ")*", "m"),
|
663
1826
|
inside: {
|
664
1827
|
"table-data-rows": {
|
665
|
-
pattern: RegExp("^(" +
|
1828
|
+
pattern: RegExp("^(" + v + k + ")(?:" + v + ")*$"),
|
666
1829
|
lookbehind: !0,
|
667
1830
|
inside: {
|
668
1831
|
"table-data": {
|
669
|
-
pattern: RegExp(
|
670
|
-
inside:
|
1832
|
+
pattern: RegExp(m),
|
1833
|
+
inside: l.languages.markdown
|
671
1834
|
},
|
672
1835
|
punctuation: /\|/
|
673
1836
|
}
|
674
1837
|
},
|
675
1838
|
"table-line": {
|
676
|
-
pattern: RegExp("^(" +
|
1839
|
+
pattern: RegExp("^(" + v + ")" + k + "$"),
|
677
1840
|
lookbehind: !0,
|
678
1841
|
inside: {
|
679
1842
|
punctuation: /\||:?-{3,}:?/
|
680
1843
|
}
|
681
1844
|
},
|
682
1845
|
"table-header-row": {
|
683
|
-
pattern: RegExp("^" +
|
1846
|
+
pattern: RegExp("^" + v + "$"),
|
684
1847
|
inside: {
|
685
1848
|
"table-header": {
|
686
|
-
pattern: RegExp(
|
1849
|
+
pattern: RegExp(m),
|
687
1850
|
alias: "important",
|
688
|
-
inside:
|
1851
|
+
inside: l.languages.markdown
|
689
1852
|
},
|
690
1853
|
punctuation: /\|/
|
691
1854
|
}
|
@@ -779,7 +1942,7 @@ var M = kr();
|
|
779
1942
|
// **strong**
|
780
1943
|
// __strong__
|
781
1944
|
// allow one nested instance of italic text using the same delimiter
|
782
|
-
pattern:
|
1945
|
+
pattern: r(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),
|
783
1946
|
lookbehind: !0,
|
784
1947
|
greedy: !0,
|
785
1948
|
inside: {
|
@@ -796,7 +1959,7 @@ var M = kr();
|
|
796
1959
|
// *em*
|
797
1960
|
// _em_
|
798
1961
|
// allow one nested instance of bold text using the same delimiter
|
799
|
-
pattern:
|
1962
|
+
pattern: r(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),
|
800
1963
|
lookbehind: !0,
|
801
1964
|
greedy: !0,
|
802
1965
|
inside: {
|
@@ -813,7 +1976,7 @@ var M = kr();
|
|
813
1976
|
// ~~strike through~~
|
814
1977
|
// ~strike~
|
815
1978
|
// eslint-disable-next-line regexp/strict
|
816
|
-
pattern:
|
1979
|
+
pattern: r(/(~~?)(?:(?!~)<inner>)+\2/.source),
|
817
1980
|
lookbehind: !0,
|
818
1981
|
greedy: !0,
|
819
1982
|
inside: {
|
@@ -838,7 +2001,7 @@ var M = kr();
|
|
838
2001
|
// [example](http://example.com "Optional title")
|
839
2002
|
// [example][id]
|
840
2003
|
// [example] [id]
|
841
|
-
pattern:
|
2004
|
+
pattern: r(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),
|
842
2005
|
lookbehind: !0,
|
843
2006
|
greedy: !0,
|
844
2007
|
inside: {
|
@@ -863,78 +2026,78 @@ var M = kr();
|
|
863
2026
|
}
|
864
2027
|
}
|
865
2028
|
}
|
866
|
-
}), ["url", "bold", "italic", "strike"].forEach(function(
|
867
|
-
["url", "bold", "italic", "strike", "code-snippet"].forEach(function(
|
868
|
-
|
2029
|
+
}), ["url", "bold", "italic", "strike"].forEach(function(p) {
|
2030
|
+
["url", "bold", "italic", "strike", "code-snippet"].forEach(function(f) {
|
2031
|
+
p !== f && (l.languages.markdown[p].inside.content.inside[f] = l.languages.markdown[f]);
|
869
2032
|
});
|
870
|
-
}),
|
871
|
-
if (
|
2033
|
+
}), l.hooks.add("after-tokenize", function(p) {
|
2034
|
+
if (p.language !== "markdown" && p.language !== "md")
|
872
2035
|
return;
|
873
|
-
function
|
874
|
-
if (!(!
|
875
|
-
for (var
|
876
|
-
var
|
877
|
-
if (
|
878
|
-
|
2036
|
+
function f(E) {
|
2037
|
+
if (!(!E || typeof E == "string"))
|
2038
|
+
for (var C = 0, P = E.length; C < P; C++) {
|
2039
|
+
var S = E[C];
|
2040
|
+
if (S.type !== "code") {
|
2041
|
+
f(S.content);
|
879
2042
|
continue;
|
880
2043
|
}
|
881
|
-
var
|
882
|
-
if (
|
883
|
-
var
|
884
|
-
|
885
|
-
var
|
886
|
-
|
2044
|
+
var _ = S.content[1], A = S.content[3];
|
2045
|
+
if (_ && A && _.type === "code-language" && A.type === "code-block" && typeof _.content == "string") {
|
2046
|
+
var t = _.content.replace(/\b#/g, "sharp").replace(/\b\+\+/g, "pp");
|
2047
|
+
t = (/[a-z][\w-]*/i.exec(t) || [""])[0].toLowerCase();
|
2048
|
+
var n = "language-" + t;
|
2049
|
+
A.alias ? typeof A.alias == "string" ? A.alias = [A.alias, n] : A.alias.push(n) : A.alias = [n];
|
887
2050
|
}
|
888
2051
|
}
|
889
2052
|
}
|
890
|
-
|
891
|
-
}),
|
892
|
-
if (
|
893
|
-
for (var
|
894
|
-
var
|
895
|
-
if (
|
896
|
-
|
2053
|
+
f(p.tokens);
|
2054
|
+
}), l.hooks.add("wrap", function(p) {
|
2055
|
+
if (p.type === "code-block") {
|
2056
|
+
for (var f = "", E = 0, C = p.classes.length; E < C; E++) {
|
2057
|
+
var P = p.classes[E], S = /language-(.+)/.exec(P);
|
2058
|
+
if (S) {
|
2059
|
+
f = S[1];
|
897
2060
|
break;
|
898
2061
|
}
|
899
2062
|
}
|
900
|
-
var
|
901
|
-
if (
|
902
|
-
|
903
|
-
else if (
|
904
|
-
var
|
905
|
-
|
906
|
-
var
|
907
|
-
|
2063
|
+
var _ = l.languages[f];
|
2064
|
+
if (_)
|
2065
|
+
p.content = l.highlight(x(p.content), _, f);
|
2066
|
+
else if (f && f !== "none" && l.plugins.autoloader) {
|
2067
|
+
var A = "md-" + (/* @__PURE__ */ new Date()).valueOf() + "-" + Math.floor(Math.random() * 1e16);
|
2068
|
+
p.attributes.id = A, l.plugins.autoloader.loadLanguages(f, function() {
|
2069
|
+
var t = document.getElementById(A);
|
2070
|
+
t && (t.innerHTML = l.highlight(t.textContent, l.languages[f], f));
|
908
2071
|
});
|
909
2072
|
}
|
910
2073
|
}
|
911
2074
|
});
|
912
|
-
var
|
2075
|
+
var h = RegExp(l.languages.markup.tag.pattern.source, "gi"), a = {
|
913
2076
|
amp: "&",
|
914
2077
|
lt: "<",
|
915
2078
|
gt: ">",
|
916
2079
|
quot: '"'
|
917
|
-
},
|
918
|
-
function p
|
919
|
-
var
|
920
|
-
return
|
921
|
-
if (
|
922
|
-
var
|
923
|
-
return
|
2080
|
+
}, c = String.fromCodePoint || String.fromCharCode;
|
2081
|
+
function x(p) {
|
2082
|
+
var f = p.replace(h, "");
|
2083
|
+
return f = f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function(E, C) {
|
2084
|
+
if (C = C.toLowerCase(), C[0] === "#") {
|
2085
|
+
var P;
|
2086
|
+
return C[1] === "x" ? P = parseInt(C.slice(2), 16) : P = Number(C.slice(1)), c(P);
|
924
2087
|
} else {
|
925
|
-
var
|
926
|
-
return
|
2088
|
+
var S = a[C];
|
2089
|
+
return S || E;
|
927
2090
|
}
|
928
|
-
}),
|
2091
|
+
}), f;
|
929
2092
|
}
|
930
|
-
|
2093
|
+
l.languages.md = l.languages.markdown;
|
931
2094
|
})(Prism);
|
932
|
-
var
|
933
|
-
function
|
934
|
-
return
|
2095
|
+
var Be = {}, Ve;
|
2096
|
+
function $t() {
|
2097
|
+
return Ve || (Ve = 1, (function() {
|
935
2098
|
if (typeof Prism > "u" || typeof document > "u")
|
936
2099
|
return;
|
937
|
-
var
|
2100
|
+
var l = "line-numbers", g = /\n(?!$)/g, r = Prism.plugins.lineNumbers = {
|
938
2101
|
/**
|
939
2102
|
* Get node for provided line number
|
940
2103
|
*
|
@@ -942,14 +2105,14 @@ function xr() {
|
|
942
2105
|
* @param {number} number line number
|
943
2106
|
* @returns {Element|undefined}
|
944
2107
|
*/
|
945
|
-
getLine: function(
|
946
|
-
if (!(
|
947
|
-
var
|
948
|
-
if (
|
949
|
-
var
|
950
|
-
|
951
|
-
var
|
952
|
-
return
|
2108
|
+
getLine: function(h, a) {
|
2109
|
+
if (!(h.tagName !== "PRE" || !h.classList.contains(l))) {
|
2110
|
+
var c = h.querySelector(".line-numbers-rows");
|
2111
|
+
if (c) {
|
2112
|
+
var x = parseInt(h.getAttribute("data-start"), 10) || 1, p = x + (c.children.length - 1);
|
2113
|
+
a < x && (a = x), a > p && (a = p);
|
2114
|
+
var f = a - x;
|
2115
|
+
return c.children[f];
|
953
2116
|
}
|
954
2117
|
}
|
955
2118
|
},
|
@@ -961,8 +2124,8 @@ function xr() {
|
|
961
2124
|
* @param {HTMLElement} element A `<pre>` element with line numbers.
|
962
2125
|
* @returns {void}
|
963
2126
|
*/
|
964
|
-
resize: function(
|
965
|
-
|
2127
|
+
resize: function(h) {
|
2128
|
+
m([h]);
|
966
2129
|
},
|
967
2130
|
/**
|
968
2131
|
* Whether the plugin can assume that the units font sizes and margins are not depended on the size of
|
@@ -976,112 +2139,112 @@ function xr() {
|
|
976
2139
|
*/
|
977
2140
|
assumeViewportIndependence: !0
|
978
2141
|
};
|
979
|
-
function
|
980
|
-
if (
|
981
|
-
var
|
982
|
-
return
|
983
|
-
}),
|
984
|
-
var
|
985
|
-
var
|
986
|
-
if (!(!
|
987
|
-
var
|
988
|
-
|
989
|
-
var
|
990
|
-
return
|
991
|
-
element:
|
992
|
-
lines:
|
2142
|
+
function m(h) {
|
2143
|
+
if (h = h.filter(function(c) {
|
2144
|
+
var x = v(c), p = x["white-space"];
|
2145
|
+
return p === "pre-wrap" || p === "pre-line";
|
2146
|
+
}), h.length != 0) {
|
2147
|
+
var a = h.map(function(c) {
|
2148
|
+
var x = c.querySelector("code"), p = c.querySelector(".line-numbers-rows");
|
2149
|
+
if (!(!x || !p)) {
|
2150
|
+
var f = c.querySelector(".line-numbers-sizer"), E = x.textContent.split(g);
|
2151
|
+
f || (f = document.createElement("span"), f.className = "line-numbers-sizer", x.appendChild(f)), f.innerHTML = "0", f.style.display = "block";
|
2152
|
+
var C = f.getBoundingClientRect().height;
|
2153
|
+
return f.innerHTML = "", {
|
2154
|
+
element: c,
|
2155
|
+
lines: E,
|
993
2156
|
lineHeights: [],
|
994
|
-
oneLinerHeight:
|
995
|
-
sizer:
|
2157
|
+
oneLinerHeight: C,
|
2158
|
+
sizer: f
|
996
2159
|
};
|
997
2160
|
}
|
998
2161
|
}).filter(Boolean);
|
999
|
-
|
1000
|
-
var
|
1001
|
-
|
1002
|
-
if (
|
1003
|
-
var
|
1004
|
-
|
2162
|
+
a.forEach(function(c) {
|
2163
|
+
var x = c.sizer, p = c.lines, f = c.lineHeights, E = c.oneLinerHeight;
|
2164
|
+
f[p.length - 1] = void 0, p.forEach(function(C, P) {
|
2165
|
+
if (C && C.length > 1) {
|
2166
|
+
var S = x.appendChild(document.createElement("span"));
|
2167
|
+
S.style.display = "block", S.textContent = C;
|
1005
2168
|
} else
|
1006
|
-
|
2169
|
+
f[P] = E;
|
1007
2170
|
});
|
1008
|
-
}),
|
1009
|
-
for (var
|
1010
|
-
|
1011
|
-
}),
|
1012
|
-
var
|
1013
|
-
|
1014
|
-
|
2171
|
+
}), a.forEach(function(c) {
|
2172
|
+
for (var x = c.sizer, p = c.lineHeights, f = 0, E = 0; E < p.length; E++)
|
2173
|
+
p[E] === void 0 && (p[E] = x.children[f++].getBoundingClientRect().height);
|
2174
|
+
}), a.forEach(function(c) {
|
2175
|
+
var x = c.sizer, p = c.element.querySelector(".line-numbers-rows");
|
2176
|
+
x.style.display = "none", x.innerHTML = "", c.lineHeights.forEach(function(f, E) {
|
2177
|
+
p.children[E].style.height = f + "px";
|
1015
2178
|
});
|
1016
2179
|
});
|
1017
2180
|
}
|
1018
2181
|
}
|
1019
|
-
function
|
1020
|
-
return
|
2182
|
+
function v(h) {
|
2183
|
+
return h ? window.getComputedStyle ? getComputedStyle(h) : h.currentStyle || null : null;
|
1021
2184
|
}
|
1022
|
-
var
|
2185
|
+
var k = void 0;
|
1023
2186
|
window.addEventListener("resize", function() {
|
1024
|
-
|
1025
|
-
}), Prism.hooks.add("complete", function(
|
1026
|
-
if (
|
1027
|
-
var
|
2187
|
+
r.assumeViewportIndependence && k === window.innerWidth || (k = window.innerWidth, m(Array.prototype.slice.call(document.querySelectorAll("pre." + l))));
|
2188
|
+
}), Prism.hooks.add("complete", function(h) {
|
2189
|
+
if (h.code) {
|
2190
|
+
var a = (
|
1028
2191
|
/** @type {Element} */
|
1029
|
-
|
1030
|
-
),
|
2192
|
+
h.element
|
2193
|
+
), c = (
|
1031
2194
|
/** @type {HTMLElement} */
|
1032
|
-
|
2195
|
+
a.parentNode
|
1033
2196
|
);
|
1034
|
-
if (!(!
|
1035
|
-
|
1036
|
-
var
|
1037
|
-
|
2197
|
+
if (!(!c || !/pre/i.test(c.nodeName)) && !a.querySelector(".line-numbers-rows") && Prism.util.isActive(a, l)) {
|
2198
|
+
a.classList.remove(l), c.classList.add(l);
|
2199
|
+
var x = h.code.match(g), p = x ? x.length + 1 : 1, f, E = new Array(p + 1).join("<span></span>");
|
2200
|
+
f = document.createElement("span"), f.setAttribute("aria-hidden", "true"), f.className = "line-numbers-rows", f.innerHTML = E, c.hasAttribute("data-start") && (c.style.counterReset = "linenumber " + (parseInt(c.getAttribute("data-start"), 10) - 1)), h.element.appendChild(f), m([c]), Prism.hooks.run("line-numbers", h);
|
1038
2201
|
}
|
1039
2202
|
}
|
1040
|
-
}), Prism.hooks.add("line-numbers", function(
|
1041
|
-
|
2203
|
+
}), Prism.hooks.add("line-numbers", function(h) {
|
2204
|
+
h.plugins = h.plugins || {}, h.plugins.lineNumbers = !0;
|
1042
2205
|
});
|
1043
|
-
})()),
|
2206
|
+
})()), Be;
|
1044
2207
|
}
|
1045
|
-
|
1046
|
-
function
|
1047
|
-
return
|
2208
|
+
$t();
|
2209
|
+
function Je(l) {
|
2210
|
+
return l.useTabs ? " " : l.hasPadding ? " " : "";
|
1048
2211
|
}
|
1049
|
-
class
|
2212
|
+
class Ot {
|
1050
2213
|
padding;
|
1051
|
-
constructor(
|
1052
|
-
this.padding =
|
2214
|
+
constructor(g) {
|
2215
|
+
this.padding = Je(g);
|
1053
2216
|
}
|
1054
|
-
formatCell(
|
1055
|
-
const
|
1056
|
-
switch (
|
2217
|
+
formatCell(g, r, m) {
|
2218
|
+
const v = m;
|
2219
|
+
switch (r) {
|
1057
2220
|
case "right":
|
1058
|
-
return `${this.padding}${
|
2221
|
+
return `${this.padding}${g.padStart(v)}${this.padding}`;
|
1059
2222
|
case "center": {
|
1060
|
-
const
|
1061
|
-
return `${this.padding}${" ".repeat(
|
2223
|
+
const k = v - g.length, h = Math.floor(k / 2), a = k - h;
|
2224
|
+
return `${this.padding}${" ".repeat(h)}${g}${" ".repeat(a)}${this.padding}`;
|
1062
2225
|
}
|
1063
2226
|
default:
|
1064
|
-
return `${this.padding}${
|
2227
|
+
return `${this.padding}${g.padEnd(v)}${this.padding}`;
|
1065
2228
|
}
|
1066
2229
|
}
|
1067
2230
|
}
|
1068
|
-
class
|
2231
|
+
class jt {
|
1069
2232
|
static indicators = {
|
1070
|
-
left: (
|
1071
|
-
right: (
|
1072
|
-
center: (
|
1073
|
-
none: (
|
2233
|
+
left: (g) => `:${"-".repeat(g - 1)}`,
|
2234
|
+
right: (g) => `${"-".repeat(g - 1)}:`,
|
2235
|
+
center: (g) => `:${"-".repeat(g - 2)}:`,
|
2236
|
+
none: (g) => "-".repeat(g)
|
1074
2237
|
};
|
1075
|
-
static formatIndicator(
|
1076
|
-
return this.indicators[
|
2238
|
+
static formatIndicator(g, r) {
|
2239
|
+
return this.indicators[g](r);
|
1077
2240
|
}
|
1078
2241
|
}
|
1079
|
-
class
|
2242
|
+
class Pt {
|
1080
2243
|
config;
|
1081
2244
|
cellFormatter;
|
1082
2245
|
adjustedAlignments;
|
1083
|
-
constructor(
|
1084
|
-
this.config =
|
2246
|
+
constructor(g) {
|
2247
|
+
this.config = g, this.cellFormatter = new Ot(g), this.adjustedAlignments = this.getAdjustedAlignments();
|
1085
2248
|
}
|
1086
2249
|
getAdjustedAlignments() {
|
1087
2250
|
return this.config.columnAlignments.length < this.config.columnCount ? [
|
@@ -1089,159 +2252,159 @@ class Tr {
|
|
1089
2252
|
...Array(this.config.columnCount - this.config.columnAlignments.length).fill("none")
|
1090
2253
|
] : Array.from(this.config.columnAlignments);
|
1091
2254
|
}
|
1092
|
-
formatRow(
|
1093
|
-
return `|${Array.from({ length: this.config.columnCount }, (
|
1094
|
-
let
|
1095
|
-
this.config.replaceNewlines && (
|
1096
|
-
const
|
1097
|
-
return this.cellFormatter.formatCell(
|
2255
|
+
formatRow(g) {
|
2256
|
+
return `|${Array.from({ length: this.config.columnCount }, (m, v) => {
|
2257
|
+
let k = g[v] ?? "";
|
2258
|
+
this.config.replaceNewlines && (k = k.replace(/\n/g, "<br>"));
|
2259
|
+
const h = this.adjustedAlignments[v], a = this.config.columnWidths ? this.config.columnWidths[v] : k.length;
|
2260
|
+
return this.cellFormatter.formatCell(k, h, a);
|
1098
2261
|
}).join("|")}|`;
|
1099
2262
|
}
|
1100
2263
|
formatAlignmentRow() {
|
1101
|
-
const
|
1102
|
-
return `|${Array.from({ length: this.config.columnCount }, (
|
1103
|
-
const
|
1104
|
-
return `${
|
2264
|
+
const g = Je(this.config);
|
2265
|
+
return `|${Array.from({ length: this.config.columnCount }, (m, v) => {
|
2266
|
+
const k = this.adjustedAlignments[v], h = this.config.columnWidths ? this.config.columnWidths[v] : 3, a = jt.formatIndicator(k, h);
|
2267
|
+
return `${g}${a}${g}`;
|
1105
2268
|
}).join("|")}|`;
|
1106
2269
|
}
|
1107
2270
|
}
|
1108
|
-
function
|
1109
|
-
const
|
1110
|
-
return
|
1111
|
-
for (let
|
1112
|
-
const
|
1113
|
-
|
2271
|
+
function It(l, g) {
|
2272
|
+
const r = new Array(g).fill(3);
|
2273
|
+
return l.forEach((m) => {
|
2274
|
+
for (let v = 0; v < g; v++) {
|
2275
|
+
const k = m[v] ?? "";
|
2276
|
+
r[v] = Math.max(r[v], k.length);
|
1114
2277
|
}
|
1115
|
-
}),
|
2278
|
+
}), r;
|
1116
2279
|
}
|
1117
|
-
function
|
1118
|
-
const
|
1119
|
-
return Math.max(
|
2280
|
+
function Dt(l) {
|
2281
|
+
const g = l.inputDataHeader.length, r = l.inputDataBody.map((m) => m.length);
|
2282
|
+
return Math.max(g, ...r);
|
1120
2283
|
}
|
1121
|
-
function
|
1122
|
-
return
|
1123
|
-
[
|
1124
|
-
|
2284
|
+
function Mt(l, g, r) {
|
2285
|
+
return r ? It(
|
2286
|
+
[l.inputDataHeader, ...l.inputDataBody],
|
2287
|
+
g
|
1125
2288
|
) : void 0;
|
1126
2289
|
}
|
1127
|
-
function
|
1128
|
-
const
|
1129
|
-
columnCount:
|
1130
|
-
columnAlignments:
|
1131
|
-
columnWidths:
|
1132
|
-
useTabs:
|
1133
|
-
replaceNewlines:
|
1134
|
-
hasPadding:
|
1135
|
-
},
|
2290
|
+
function zt(l, g, r = !0, m = !1, v = !1, k = !0) {
|
2291
|
+
const h = Dt(l), a = Mt(l, h, r), c = {
|
2292
|
+
columnCount: h,
|
2293
|
+
columnAlignments: g,
|
2294
|
+
columnWidths: a,
|
2295
|
+
useTabs: m,
|
2296
|
+
replaceNewlines: v,
|
2297
|
+
hasPadding: k
|
2298
|
+
}, x = new Pt(c), p = x.formatRow(l.inputDataHeader), f = x.formatAlignmentRow(), E = l.inputDataBody.map((C) => x.formatRow(C)).join(`
|
1136
2299
|
`);
|
1137
|
-
return `${
|
1138
|
-
${
|
1139
|
-
${
|
2300
|
+
return `${p}
|
2301
|
+
${f}
|
2302
|
+
${E}`.trimEnd();
|
1140
2303
|
}
|
1141
|
-
function
|
1142
|
-
let
|
1143
|
-
for (;
|
1144
|
-
|
1145
|
-
return
|
2304
|
+
function Lt(l) {
|
2305
|
+
let g = "", r = l;
|
2306
|
+
for (; r >= 0; )
|
2307
|
+
g = String.fromCharCode(r % 26 + 65) + g, r = Math.floor(r / 26) - 1;
|
2308
|
+
return g;
|
1146
2309
|
}
|
1147
|
-
function
|
1148
|
-
return Array.from({ length:
|
2310
|
+
function Nt(l) {
|
2311
|
+
return Array.from({ length: l }, (g, r) => Lt(r));
|
1149
2312
|
}
|
1150
|
-
class
|
1151
|
-
constructor(
|
1152
|
-
super(
|
2313
|
+
class ge extends Error {
|
2314
|
+
constructor(g, r) {
|
2315
|
+
super(g, r), this.name = "MarkdownTableError", Object.setPrototypeOf(this, ge.prototype);
|
1153
2316
|
}
|
1154
2317
|
}
|
1155
|
-
function
|
1156
|
-
if (
|
1157
|
-
throw new
|
1158
|
-
if (
|
1159
|
-
throw new
|
2318
|
+
function Wt(l) {
|
2319
|
+
if (l === null || !Array.isArray(l))
|
2320
|
+
throw new ge("The 'data' prop must be a two-dimensional array.");
|
2321
|
+
if (l.length === 0)
|
2322
|
+
throw new ge("The 'data' array must contain at least one row.");
|
1160
2323
|
}
|
1161
|
-
const
|
1162
|
-
code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}pre[class*=language-].line-numbers{position:relative;padding-left:2.4em;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.5em;text-align:right}
|
1163
|
-
`,
|
1164
|
-
code[class*=language-],pre[class*=language-]{color:#f8f8f2;background:0 0;text-shadow:0 1px rgba(0,0,0,.3);font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#282a36}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}pre[class*=language-].line-numbers{position:relative;padding-left:2.4em;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.5em;text-align:right}
|
2324
|
+
const Ht = `
|
2325
|
+
code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#905}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#690}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.function,.token.class-name{color:#dd4a68}.token.regex,.token.important,.token.variable{color:#e90}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.table-header{color:#07a;font-weight:700}.token.title{color:#07a;font-weight:700}pre[class*=language-].line-numbers{position:relative;padding-left:2.4em;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.5em;text-align:right}
|
2326
|
+
`, qt = `
|
2327
|
+
code[class*=language-],pre[class*=language-]{color:#f8f8f2;background:0 0;text-shadow:0 1px rgba(0,0,0,.3);font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#282a36}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#6272a4}.token.punctuation{color:#f8f8f2}.token.namespace{opacity:.7}.token.property,.token.tag,.token.constant,.token.symbol,.token.deleted{color:#ff79c6}.token.boolean,.token.number{color:#bd93f9}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#50fa7b}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#f8f8f2}.token.atrule,.token.attr-value,.token.keyword{color:#8be9fd}.token.function,.token.class-name{color:#ffb86c}.token.regex,.token.important,.token.variable{color:#f1fa8c}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.table-header{color:#8be9fd;font-weight:700}.token.title{color:#8be9fd;font-weight:700}pre[class*=language-].line-numbers{position:relative;padding-left:2.4em;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.5em;text-align:right}
|
1165
2328
|
`;
|
1166
|
-
function
|
1167
|
-
return
|
2329
|
+
function Ut(l, g) {
|
2330
|
+
return g ? { inputDataHeader: l[0], inputDataBody: l.slice(1) } : { inputDataHeader: Nt(l[0].length), inputDataBody: l };
|
1168
2331
|
}
|
1169
|
-
function
|
2332
|
+
function Yt(l, g, r, m, v, k, h) {
|
1170
2333
|
try {
|
1171
|
-
|
1172
|
-
const { inputDataHeader:
|
1173
|
-
return
|
1174
|
-
{ inputDataHeader:
|
1175
|
-
|
1176
|
-
|
1177
|
-
d,
|
2334
|
+
Wt(l);
|
2335
|
+
const { inputDataHeader: a, inputDataBody: c } = Ut(l, g);
|
2336
|
+
return zt(
|
2337
|
+
{ inputDataHeader: a, inputDataBody: c },
|
2338
|
+
r,
|
2339
|
+
m,
|
1178
2340
|
v,
|
1179
|
-
|
2341
|
+
k,
|
2342
|
+
h
|
1180
2343
|
);
|
1181
|
-
} catch (
|
1182
|
-
if (
|
1183
|
-
return `Error: ${
|
1184
|
-
throw
|
2344
|
+
} catch (a) {
|
2345
|
+
if (a instanceof ge)
|
2346
|
+
return `Error: ${a.message}`;
|
2347
|
+
throw a;
|
1185
2348
|
}
|
1186
2349
|
}
|
1187
|
-
function
|
1188
|
-
inputData:
|
1189
|
-
hasHeader:
|
1190
|
-
columnAlignments:
|
1191
|
-
isCompact:
|
1192
|
-
hasTabs:
|
1193
|
-
hasPadding:
|
1194
|
-
convertLineBreaks:
|
1195
|
-
className:
|
1196
|
-
onGenerate:
|
1197
|
-
theme:
|
1198
|
-
preStyle:
|
1199
|
-
topPadding:
|
1200
|
-
minWidth:
|
1201
|
-
showLineNumbers:
|
2350
|
+
function Vt({
|
2351
|
+
inputData: l = null,
|
2352
|
+
hasHeader: g = !0,
|
2353
|
+
columnAlignments: r = [],
|
2354
|
+
isCompact: m = !1,
|
2355
|
+
hasTabs: v = !1,
|
2356
|
+
hasPadding: k = !0,
|
2357
|
+
convertLineBreaks: h = !1,
|
2358
|
+
className: a,
|
2359
|
+
onGenerate: c,
|
2360
|
+
theme: x = "light",
|
2361
|
+
preStyle: p,
|
2362
|
+
topPadding: f = 16,
|
2363
|
+
minWidth: E,
|
2364
|
+
showLineNumbers: C = !0
|
1202
2365
|
}) {
|
1203
|
-
const
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
!
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
2366
|
+
const P = yt(null), S = wt(), _ = kt(l), [, A] = xt(), t = Et(() => Yt(
|
2367
|
+
_,
|
2368
|
+
g,
|
2369
|
+
r,
|
2370
|
+
!m,
|
2371
|
+
v,
|
2372
|
+
h,
|
2373
|
+
k
|
1211
2374
|
), [
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
2375
|
+
_,
|
2376
|
+
g,
|
2377
|
+
r,
|
2378
|
+
m,
|
2379
|
+
v,
|
2380
|
+
h,
|
2381
|
+
k
|
1219
2382
|
]);
|
1220
|
-
return
|
1221
|
-
|
1222
|
-
}, [
|
1223
|
-
const
|
1224
|
-
|
2383
|
+
return Ne(() => {
|
2384
|
+
c && c(t);
|
2385
|
+
}, [t, c]), Ne(() => {
|
2386
|
+
const n = P.current?.querySelector("code");
|
2387
|
+
n && t && A(() => {
|
1225
2388
|
requestAnimationFrame(() => {
|
1226
|
-
if (
|
1227
|
-
const
|
1228
|
-
|
2389
|
+
if (Tt.highlightElement(n), !C && P.current) {
|
2390
|
+
const o = P.current.querySelector(".line-numbers-rows");
|
2391
|
+
o && o.remove();
|
1229
2392
|
}
|
1230
2393
|
});
|
1231
2394
|
});
|
1232
|
-
}, [
|
1233
|
-
/* @__PURE__ */
|
1234
|
-
|
2395
|
+
}, [t, A, C]), /* @__PURE__ */ se.jsxs(se.Fragment, { children: [
|
2396
|
+
/* @__PURE__ */ se.jsxs("style", { children: [
|
2397
|
+
x === "light" ? Ht : qt,
|
1235
2398
|
`
|
1236
2399
|
pre {
|
1237
2400
|
position: relative;
|
1238
|
-
padding-top: ${
|
2401
|
+
padding-top: ${f}px !important;
|
1239
2402
|
}
|
1240
2403
|
pre::before {
|
1241
2404
|
position: absolute;
|
1242
2405
|
top: 8px;
|
1243
2406
|
left: 12px;
|
1244
|
-
color: ${
|
2407
|
+
color: ${x === "light" ? "#666" : "#999"};
|
1245
2408
|
letter-spacing: 2px;
|
1246
2409
|
font-size: 12px;
|
1247
2410
|
}
|
@@ -1258,27 +2421,27 @@ function Hr({
|
|
1258
2421
|
}
|
1259
2422
|
`
|
1260
2423
|
] }),
|
1261
|
-
/* @__PURE__ */
|
2424
|
+
/* @__PURE__ */ se.jsx(
|
1262
2425
|
"div",
|
1263
2426
|
{
|
1264
|
-
id:
|
2427
|
+
id: S,
|
1265
2428
|
style: {
|
1266
2429
|
position: "relative",
|
1267
2430
|
isolation: "isolate",
|
1268
2431
|
display: "inline-block"
|
1269
2432
|
},
|
1270
|
-
children: /* @__PURE__ */
|
2433
|
+
children: /* @__PURE__ */ se.jsx(
|
1271
2434
|
"pre",
|
1272
2435
|
{
|
1273
|
-
ref:
|
1274
|
-
className: `${
|
2436
|
+
ref: P,
|
2437
|
+
className: `${a} language-markdown ${C ? "line-numbers" : ""} ${x === "dark" ? "dark-theme" : ""}`,
|
1275
2438
|
style: {
|
1276
2439
|
width: "fit-content",
|
1277
|
-
minWidth:
|
2440
|
+
minWidth: E ? `${E}px` : "min-content",
|
1278
2441
|
margin: 0,
|
1279
|
-
...
|
2442
|
+
...p
|
1280
2443
|
},
|
1281
|
-
children: /* @__PURE__ */
|
2444
|
+
children: /* @__PURE__ */ se.jsx("code", { className: "language-markdown", role: "code", children: t })
|
1282
2445
|
}
|
1283
2446
|
)
|
1284
2447
|
}
|
@@ -1286,6 +2449,6 @@ function Hr({
|
|
1286
2449
|
] });
|
1287
2450
|
}
|
1288
2451
|
export {
|
1289
|
-
|
1290
|
-
|
2452
|
+
Vt as MarkdownTable,
|
2453
|
+
ge as MarkdownTableError
|
1291
2454
|
};
|