react-markdown-table-ts 1.4.5 → 1.4.7
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 +12 -27
- package/dist/LineNumbers.d.ts +851 -0
- package/dist/LineNumbers.d.ts.map +1 -0
- package/dist/MarkdownTable.d.ts +7 -0
- package/dist/MarkdownTable.d.ts.map +1 -0
- package/dist/index.cjs +27 -47
- package/dist/index.d.ts +3 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +555 -2090
- package/dist/types.d.ts +2 -2
- package/dist/utils.d.ts.map +1 -1
- package/package.json +5 -8
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
3
|
-
function _n(u) {
|
|
4
|
-
return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
|
|
5
|
-
}
|
|
6
|
-
var ye = { exports: {} }, de = {};
|
|
1
|
+
import F, { useId as gr, useDeferredValue as pr, useMemo as mr, useEffect as hr } from "react";
|
|
2
|
+
var q = { exports: {} }, M = {};
|
|
7
3
|
/**
|
|
8
4
|
* @license React
|
|
9
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -13,21 +9,21 @@ var ye = { exports: {} }, de = {};
|
|
|
13
9
|
* This source code is licensed under the MIT license found in the
|
|
14
10
|
* LICENSE file in the root directory of this source tree.
|
|
15
11
|
*/
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
function
|
|
22
|
-
var
|
|
23
|
-
E !== void 0 && (
|
|
24
|
-
for (
|
|
25
|
-
if (
|
|
26
|
-
return { $$typeof:
|
|
12
|
+
var ke;
|
|
13
|
+
function vr() {
|
|
14
|
+
if (ke) return M;
|
|
15
|
+
ke = 1;
|
|
16
|
+
var a = F, t = Symbol.for("react.element"), i = Symbol.for("react.fragment"), h = Object.prototype.hasOwnProperty, u = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
+
function g(p, m, E) {
|
|
18
|
+
var b, R = {}, x = null, S = null;
|
|
19
|
+
E !== void 0 && (x = "" + E), m.key !== void 0 && (x = "" + m.key), m.ref !== void 0 && (S = m.ref);
|
|
20
|
+
for (b in m) h.call(m, b) && !d.hasOwnProperty(b) && (R[b] = m[b]);
|
|
21
|
+
if (p && p.defaultProps) for (b in m = p.defaultProps, m) R[b] === void 0 && (R[b] = m[b]);
|
|
22
|
+
return { $$typeof: t, type: p, key: x, ref: S, props: R, _owner: u.current };
|
|
27
23
|
}
|
|
28
|
-
return
|
|
24
|
+
return M.Fragment = i, M.jsx = g, M.jsxs = g, M;
|
|
29
25
|
}
|
|
30
|
-
var
|
|
26
|
+
var N = {};
|
|
31
27
|
/**
|
|
32
28
|
* @license React
|
|
33
29
|
* react-jsx-runtime.development.js
|
|
@@ -37,91 +33,91 @@ var fe = {};
|
|
|
37
33
|
* This source code is licensed under the MIT license found in the
|
|
38
34
|
* LICENSE file in the root directory of this source tree.
|
|
39
35
|
*/
|
|
40
|
-
var
|
|
41
|
-
function
|
|
42
|
-
return
|
|
43
|
-
var
|
|
44
|
-
function
|
|
36
|
+
var Oe;
|
|
37
|
+
function br() {
|
|
38
|
+
return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
39
|
+
var a = F, t = Symbol.for("react.element"), i = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), p = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), B = Symbol.iterator, z = "@@iterator";
|
|
40
|
+
function D(e) {
|
|
45
41
|
if (e === null || typeof e != "object")
|
|
46
42
|
return null;
|
|
47
|
-
var
|
|
48
|
-
return typeof
|
|
43
|
+
var r = B && e[B] || e[z];
|
|
44
|
+
return typeof r == "function" ? r : null;
|
|
49
45
|
}
|
|
50
|
-
var
|
|
51
|
-
function
|
|
46
|
+
var P = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
|
+
function w(e) {
|
|
52
48
|
{
|
|
53
|
-
for (var
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), o = 1; o < r; o++)
|
|
50
|
+
n[o - 1] = arguments[o];
|
|
51
|
+
Ae("error", e, n);
|
|
56
52
|
}
|
|
57
53
|
}
|
|
58
|
-
function
|
|
54
|
+
function Ae(e, r, n) {
|
|
59
55
|
{
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
return String(
|
|
56
|
+
var o = P.ReactDebugCurrentFrame, c = o.getStackAddendum();
|
|
57
|
+
c !== "" && (r += "%s", n = n.concat([c]));
|
|
58
|
+
var f = n.map(function(l) {
|
|
59
|
+
return String(l);
|
|
64
60
|
});
|
|
65
|
-
|
|
61
|
+
f.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, f);
|
|
66
62
|
}
|
|
67
63
|
}
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
function
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
64
|
+
var $e = !1, Fe = !1, De = !1, Ie = !1, We = !1, ne;
|
|
65
|
+
ne = Symbol.for("react.module.reference");
|
|
66
|
+
function Me(e) {
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === h || e === d || We || e === u || e === E || e === b || Ie || e === S || $e || Fe || De || typeof e == "object" && e !== null && (e.$$typeof === x || e.$$typeof === R || e.$$typeof === g || e.$$typeof === p || e.$$typeof === m || // This needs to include all possible module reference object
|
|
72
68
|
// types supported by any Flight configuration anywhere since
|
|
73
69
|
// we don't know which Flight build this will end up being used
|
|
74
70
|
// with.
|
|
75
|
-
e.$$typeof ===
|
|
71
|
+
e.$$typeof === ne || e.getModuleId !== void 0));
|
|
76
72
|
}
|
|
77
|
-
function
|
|
78
|
-
var
|
|
79
|
-
if (
|
|
80
|
-
return
|
|
81
|
-
var
|
|
82
|
-
return
|
|
73
|
+
function Ne(e, r, n) {
|
|
74
|
+
var o = e.displayName;
|
|
75
|
+
if (o)
|
|
76
|
+
return o;
|
|
77
|
+
var c = r.displayName || r.name || "";
|
|
78
|
+
return c !== "" ? n + "(" + c + ")" : n;
|
|
83
79
|
}
|
|
84
|
-
function
|
|
80
|
+
function ae(e) {
|
|
85
81
|
return e.displayName || "Context";
|
|
86
82
|
}
|
|
87
|
-
function
|
|
83
|
+
function k(e) {
|
|
88
84
|
if (e == null)
|
|
89
85
|
return null;
|
|
90
|
-
if (typeof e.tag == "number" &&
|
|
86
|
+
if (typeof e.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
91
87
|
return e.displayName || e.name || null;
|
|
92
88
|
if (typeof e == "string")
|
|
93
89
|
return e;
|
|
94
90
|
switch (e) {
|
|
95
|
-
case
|
|
91
|
+
case h:
|
|
96
92
|
return "Fragment";
|
|
97
|
-
case
|
|
93
|
+
case i:
|
|
98
94
|
return "Portal";
|
|
99
|
-
case
|
|
95
|
+
case d:
|
|
100
96
|
return "Profiler";
|
|
101
|
-
case
|
|
97
|
+
case u:
|
|
102
98
|
return "StrictMode";
|
|
103
99
|
case E:
|
|
104
100
|
return "Suspense";
|
|
105
|
-
case
|
|
101
|
+
case b:
|
|
106
102
|
return "SuspenseList";
|
|
107
103
|
}
|
|
108
104
|
if (typeof e == "object")
|
|
109
105
|
switch (e.$$typeof) {
|
|
110
|
-
case
|
|
111
|
-
var
|
|
112
|
-
return
|
|
113
|
-
case
|
|
114
|
-
var
|
|
115
|
-
return
|
|
116
|
-
case
|
|
117
|
-
return
|
|
118
|
-
case
|
|
119
|
-
var
|
|
120
|
-
return
|
|
121
|
-
case
|
|
122
|
-
var
|
|
106
|
+
case p:
|
|
107
|
+
var r = e;
|
|
108
|
+
return ae(r) + ".Consumer";
|
|
109
|
+
case g:
|
|
110
|
+
var n = e;
|
|
111
|
+
return ae(n._context) + ".Provider";
|
|
112
|
+
case m:
|
|
113
|
+
return Ne(e, e.render, "ForwardRef");
|
|
114
|
+
case R:
|
|
115
|
+
var o = e.displayName || null;
|
|
116
|
+
return o !== null ? o : k(e.type) || "Memo";
|
|
117
|
+
case x: {
|
|
118
|
+
var c = e, f = c._payload, l = c._init;
|
|
123
119
|
try {
|
|
124
|
-
return
|
|
120
|
+
return k(l(f));
|
|
125
121
|
} catch {
|
|
126
122
|
return null;
|
|
127
123
|
}
|
|
@@ -129,18 +125,18 @@ function Fn() {
|
|
|
129
125
|
}
|
|
130
126
|
return null;
|
|
131
127
|
}
|
|
132
|
-
var
|
|
133
|
-
function
|
|
128
|
+
var O = Object.assign, I = 0, oe, ie, se, le, ue, ce, fe;
|
|
129
|
+
function de() {
|
|
134
130
|
}
|
|
135
|
-
|
|
136
|
-
function
|
|
131
|
+
de.__reactDisabledLog = !0;
|
|
132
|
+
function Ye() {
|
|
137
133
|
{
|
|
138
|
-
if (
|
|
139
|
-
|
|
134
|
+
if (I === 0) {
|
|
135
|
+
oe = console.log, ie = console.info, se = console.warn, le = console.error, ue = console.group, ce = console.groupCollapsed, fe = console.groupEnd;
|
|
140
136
|
var e = {
|
|
141
137
|
configurable: !0,
|
|
142
138
|
enumerable: !0,
|
|
143
|
-
value:
|
|
139
|
+
value: de,
|
|
144
140
|
writable: !0
|
|
145
141
|
};
|
|
146
142
|
Object.defineProperties(console, {
|
|
@@ -153,332 +149,332 @@ function Fn() {
|
|
|
153
149
|
groupEnd: e
|
|
154
150
|
});
|
|
155
151
|
}
|
|
156
|
-
|
|
152
|
+
I++;
|
|
157
153
|
}
|
|
158
154
|
}
|
|
159
|
-
function
|
|
155
|
+
function Le() {
|
|
160
156
|
{
|
|
161
|
-
if (
|
|
157
|
+
if (I--, I === 0) {
|
|
162
158
|
var e = {
|
|
163
159
|
configurable: !0,
|
|
164
160
|
enumerable: !0,
|
|
165
161
|
writable: !0
|
|
166
162
|
};
|
|
167
163
|
Object.defineProperties(console, {
|
|
168
|
-
log:
|
|
169
|
-
value:
|
|
164
|
+
log: O({}, e, {
|
|
165
|
+
value: oe
|
|
170
166
|
}),
|
|
171
|
-
info:
|
|
172
|
-
value:
|
|
167
|
+
info: O({}, e, {
|
|
168
|
+
value: ie
|
|
173
169
|
}),
|
|
174
|
-
warn:
|
|
175
|
-
value:
|
|
170
|
+
warn: O({}, e, {
|
|
171
|
+
value: se
|
|
176
172
|
}),
|
|
177
|
-
error:
|
|
178
|
-
value:
|
|
173
|
+
error: O({}, e, {
|
|
174
|
+
value: le
|
|
179
175
|
}),
|
|
180
|
-
group:
|
|
181
|
-
value:
|
|
176
|
+
group: O({}, e, {
|
|
177
|
+
value: ue
|
|
182
178
|
}),
|
|
183
|
-
groupCollapsed:
|
|
184
|
-
value:
|
|
179
|
+
groupCollapsed: O({}, e, {
|
|
180
|
+
value: ce
|
|
185
181
|
}),
|
|
186
|
-
groupEnd:
|
|
187
|
-
value:
|
|
182
|
+
groupEnd: O({}, e, {
|
|
183
|
+
value: fe
|
|
188
184
|
})
|
|
189
185
|
});
|
|
190
186
|
}
|
|
191
|
-
|
|
187
|
+
I < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
188
|
}
|
|
193
189
|
}
|
|
194
|
-
var
|
|
195
|
-
function
|
|
190
|
+
var K = P.ReactCurrentDispatcher, X;
|
|
191
|
+
function V(e, r, n) {
|
|
196
192
|
{
|
|
197
|
-
if (
|
|
193
|
+
if (X === void 0)
|
|
198
194
|
try {
|
|
199
195
|
throw Error();
|
|
200
|
-
} catch (
|
|
201
|
-
var
|
|
202
|
-
|
|
196
|
+
} catch (c) {
|
|
197
|
+
var o = c.stack.trim().match(/\n( *(at )?)/);
|
|
198
|
+
X = o && o[1] || "";
|
|
203
199
|
}
|
|
204
200
|
return `
|
|
205
|
-
` +
|
|
201
|
+
` + X + e;
|
|
206
202
|
}
|
|
207
203
|
}
|
|
208
|
-
var
|
|
204
|
+
var G = !1, U;
|
|
209
205
|
{
|
|
210
|
-
var
|
|
211
|
-
|
|
206
|
+
var Be = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
U = new Be();
|
|
212
208
|
}
|
|
213
|
-
function
|
|
214
|
-
if (!e ||
|
|
209
|
+
function ge(e, r) {
|
|
210
|
+
if (!e || G)
|
|
215
211
|
return "";
|
|
216
212
|
{
|
|
217
|
-
var
|
|
218
|
-
if (
|
|
219
|
-
return
|
|
213
|
+
var n = U.get(e);
|
|
214
|
+
if (n !== void 0)
|
|
215
|
+
return n;
|
|
220
216
|
}
|
|
221
|
-
var
|
|
222
|
-
|
|
223
|
-
var
|
|
217
|
+
var o;
|
|
218
|
+
G = !0;
|
|
219
|
+
var c = Error.prepareStackTrace;
|
|
224
220
|
Error.prepareStackTrace = void 0;
|
|
225
|
-
var
|
|
226
|
-
|
|
221
|
+
var f;
|
|
222
|
+
f = K.current, K.current = null, Ye();
|
|
227
223
|
try {
|
|
228
|
-
if (
|
|
229
|
-
var
|
|
224
|
+
if (r) {
|
|
225
|
+
var l = function() {
|
|
230
226
|
throw Error();
|
|
231
227
|
};
|
|
232
|
-
if (Object.defineProperty(
|
|
228
|
+
if (Object.defineProperty(l.prototype, "props", {
|
|
233
229
|
set: function() {
|
|
234
230
|
throw Error();
|
|
235
231
|
}
|
|
236
232
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
233
|
try {
|
|
238
|
-
Reflect.construct(
|
|
239
|
-
} catch (
|
|
240
|
-
|
|
234
|
+
Reflect.construct(l, []);
|
|
235
|
+
} catch (C) {
|
|
236
|
+
o = C;
|
|
241
237
|
}
|
|
242
|
-
Reflect.construct(e, [],
|
|
238
|
+
Reflect.construct(e, [], l);
|
|
243
239
|
} else {
|
|
244
240
|
try {
|
|
245
|
-
|
|
246
|
-
} catch (
|
|
247
|
-
|
|
241
|
+
l.call();
|
|
242
|
+
} catch (C) {
|
|
243
|
+
o = C;
|
|
248
244
|
}
|
|
249
|
-
e.call(
|
|
245
|
+
e.call(l.prototype);
|
|
250
246
|
}
|
|
251
247
|
} else {
|
|
252
248
|
try {
|
|
253
249
|
throw Error();
|
|
254
|
-
} catch (
|
|
255
|
-
|
|
250
|
+
} catch (C) {
|
|
251
|
+
o = C;
|
|
256
252
|
}
|
|
257
253
|
e();
|
|
258
254
|
}
|
|
259
|
-
} catch (
|
|
260
|
-
if (
|
|
261
|
-
for (var
|
|
262
|
-
`),
|
|
263
|
-
`),
|
|
264
|
-
|
|
265
|
-
for (;
|
|
266
|
-
if (
|
|
267
|
-
if (
|
|
255
|
+
} catch (C) {
|
|
256
|
+
if (C && o && typeof C.stack == "string") {
|
|
257
|
+
for (var s = C.stack.split(`
|
|
258
|
+
`), _ = o.stack.split(`
|
|
259
|
+
`), v = s.length - 1, y = _.length - 1; v >= 1 && y >= 0 && s[v] !== _[y]; )
|
|
260
|
+
y--;
|
|
261
|
+
for (; v >= 1 && y >= 0; v--, y--)
|
|
262
|
+
if (s[v] !== _[y]) {
|
|
263
|
+
if (v !== 1 || y !== 1)
|
|
268
264
|
do
|
|
269
|
-
if (
|
|
270
|
-
var
|
|
271
|
-
` +
|
|
272
|
-
return e.displayName &&
|
|
265
|
+
if (v--, y--, y < 0 || s[v] !== _[y]) {
|
|
266
|
+
var T = `
|
|
267
|
+
` + s[v].replace(" at new ", " at ");
|
|
268
|
+
return e.displayName && T.includes("<anonymous>") && (T = T.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, T), T;
|
|
273
269
|
}
|
|
274
|
-
while (
|
|
270
|
+
while (v >= 1 && y >= 0);
|
|
275
271
|
break;
|
|
276
272
|
}
|
|
277
273
|
}
|
|
278
274
|
} finally {
|
|
279
|
-
|
|
275
|
+
G = !1, K.current = f, Le(), Error.prepareStackTrace = c;
|
|
280
276
|
}
|
|
281
|
-
var
|
|
282
|
-
return typeof e == "function" &&
|
|
277
|
+
var $ = e ? e.displayName || e.name : "", j = $ ? V($) : "";
|
|
278
|
+
return typeof e == "function" && U.set(e, j), j;
|
|
283
279
|
}
|
|
284
|
-
function
|
|
285
|
-
return
|
|
280
|
+
function ze(e, r, n) {
|
|
281
|
+
return ge(e, !1);
|
|
286
282
|
}
|
|
287
|
-
function
|
|
288
|
-
var
|
|
289
|
-
return !!(
|
|
283
|
+
function Ve(e) {
|
|
284
|
+
var r = e.prototype;
|
|
285
|
+
return !!(r && r.isReactComponent);
|
|
290
286
|
}
|
|
291
|
-
function
|
|
287
|
+
function H(e, r, n) {
|
|
292
288
|
if (e == null)
|
|
293
289
|
return "";
|
|
294
290
|
if (typeof e == "function")
|
|
295
|
-
return
|
|
291
|
+
return ge(e, Ve(e));
|
|
296
292
|
if (typeof e == "string")
|
|
297
|
-
return
|
|
293
|
+
return V(e);
|
|
298
294
|
switch (e) {
|
|
299
295
|
case E:
|
|
300
|
-
return
|
|
301
|
-
case
|
|
302
|
-
return
|
|
296
|
+
return V("Suspense");
|
|
297
|
+
case b:
|
|
298
|
+
return V("SuspenseList");
|
|
303
299
|
}
|
|
304
300
|
if (typeof e == "object")
|
|
305
301
|
switch (e.$$typeof) {
|
|
306
|
-
case
|
|
307
|
-
return
|
|
308
|
-
case
|
|
309
|
-
return
|
|
310
|
-
case
|
|
311
|
-
var
|
|
302
|
+
case m:
|
|
303
|
+
return ze(e.render);
|
|
304
|
+
case R:
|
|
305
|
+
return H(e.type, r, n);
|
|
306
|
+
case x: {
|
|
307
|
+
var o = e, c = o._payload, f = o._init;
|
|
312
308
|
try {
|
|
313
|
-
return
|
|
309
|
+
return H(f(c), r, n);
|
|
314
310
|
} catch {
|
|
315
311
|
}
|
|
316
312
|
}
|
|
317
313
|
}
|
|
318
314
|
return "";
|
|
319
315
|
}
|
|
320
|
-
var
|
|
321
|
-
function
|
|
316
|
+
var W = Object.prototype.hasOwnProperty, pe = {}, me = P.ReactDebugCurrentFrame;
|
|
317
|
+
function J(e) {
|
|
322
318
|
if (e) {
|
|
323
|
-
var
|
|
324
|
-
|
|
319
|
+
var r = e._owner, n = H(e.type, e._source, r ? r.type : null);
|
|
320
|
+
me.setExtraStackFrame(n);
|
|
325
321
|
} else
|
|
326
|
-
|
|
322
|
+
me.setExtraStackFrame(null);
|
|
327
323
|
}
|
|
328
|
-
function
|
|
324
|
+
function Ue(e, r, n, o, c) {
|
|
329
325
|
{
|
|
330
|
-
var
|
|
331
|
-
for (var
|
|
332
|
-
if (
|
|
333
|
-
var
|
|
326
|
+
var f = Function.call.bind(W);
|
|
327
|
+
for (var l in e)
|
|
328
|
+
if (f(e, l)) {
|
|
329
|
+
var s = void 0;
|
|
334
330
|
try {
|
|
335
|
-
if (typeof e[
|
|
336
|
-
var
|
|
337
|
-
throw
|
|
331
|
+
if (typeof e[l] != "function") {
|
|
332
|
+
var _ = Error((o || "React class") + ": " + n + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
|
+
throw _.name = "Invariant Violation", _;
|
|
338
334
|
}
|
|
339
|
-
|
|
340
|
-
} catch (
|
|
341
|
-
|
|
335
|
+
s = e[l](r, l, o, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
|
+
} catch (v) {
|
|
337
|
+
s = v;
|
|
342
338
|
}
|
|
343
|
-
|
|
339
|
+
s && !(s instanceof Error) && (J(c), w("%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).", o || "React class", n, l, typeof s), J(null)), s instanceof Error && !(s.message in pe) && (pe[s.message] = !0, J(c), w("Failed %s type: %s", n, s.message), J(null));
|
|
344
340
|
}
|
|
345
341
|
}
|
|
346
342
|
}
|
|
347
|
-
var
|
|
348
|
-
function
|
|
349
|
-
return
|
|
343
|
+
var He = Array.isArray;
|
|
344
|
+
function Z(e) {
|
|
345
|
+
return He(e);
|
|
350
346
|
}
|
|
351
|
-
function
|
|
347
|
+
function Je(e) {
|
|
352
348
|
{
|
|
353
|
-
var
|
|
354
|
-
return
|
|
349
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
350
|
+
return n;
|
|
355
351
|
}
|
|
356
352
|
}
|
|
357
|
-
function
|
|
353
|
+
function qe(e) {
|
|
358
354
|
try {
|
|
359
|
-
return
|
|
355
|
+
return he(e), !1;
|
|
360
356
|
} catch {
|
|
361
357
|
return !0;
|
|
362
358
|
}
|
|
363
359
|
}
|
|
364
|
-
function
|
|
360
|
+
function he(e) {
|
|
365
361
|
return "" + e;
|
|
366
362
|
}
|
|
367
|
-
function
|
|
368
|
-
if (
|
|
369
|
-
return
|
|
363
|
+
function ve(e) {
|
|
364
|
+
if (qe(e))
|
|
365
|
+
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), he(e);
|
|
370
366
|
}
|
|
371
|
-
var
|
|
367
|
+
var be = P.ReactCurrentOwner, Ke = {
|
|
372
368
|
key: !0,
|
|
373
369
|
ref: !0,
|
|
374
370
|
__self: !0,
|
|
375
371
|
__source: !0
|
|
376
|
-
},
|
|
377
|
-
function
|
|
378
|
-
if (
|
|
379
|
-
var
|
|
380
|
-
if (
|
|
372
|
+
}, ye, Re;
|
|
373
|
+
function Xe(e) {
|
|
374
|
+
if (W.call(e, "ref")) {
|
|
375
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
376
|
+
if (r && r.isReactWarning)
|
|
381
377
|
return !1;
|
|
382
378
|
}
|
|
383
379
|
return e.ref !== void 0;
|
|
384
380
|
}
|
|
385
|
-
function
|
|
386
|
-
if (
|
|
387
|
-
var
|
|
388
|
-
if (
|
|
381
|
+
function Ge(e) {
|
|
382
|
+
if (W.call(e, "key")) {
|
|
383
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
384
|
+
if (r && r.isReactWarning)
|
|
389
385
|
return !1;
|
|
390
386
|
}
|
|
391
387
|
return e.key !== void 0;
|
|
392
388
|
}
|
|
393
|
-
function
|
|
394
|
-
typeof e.ref == "string" &&
|
|
389
|
+
function Ze(e, r) {
|
|
390
|
+
typeof e.ref == "string" && be.current;
|
|
395
391
|
}
|
|
396
|
-
function
|
|
392
|
+
function Qe(e, r) {
|
|
397
393
|
{
|
|
398
|
-
var
|
|
399
|
-
|
|
394
|
+
var n = function() {
|
|
395
|
+
ye || (ye = !0, w("%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)", r));
|
|
400
396
|
};
|
|
401
|
-
|
|
402
|
-
get:
|
|
397
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
398
|
+
get: n,
|
|
403
399
|
configurable: !0
|
|
404
400
|
});
|
|
405
401
|
}
|
|
406
402
|
}
|
|
407
|
-
function
|
|
403
|
+
function er(e, r) {
|
|
408
404
|
{
|
|
409
|
-
var
|
|
410
|
-
|
|
405
|
+
var n = function() {
|
|
406
|
+
Re || (Re = !0, w("%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)", r));
|
|
411
407
|
};
|
|
412
|
-
|
|
413
|
-
get:
|
|
408
|
+
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
409
|
+
get: n,
|
|
414
410
|
configurable: !0
|
|
415
411
|
});
|
|
416
412
|
}
|
|
417
413
|
}
|
|
418
|
-
var
|
|
419
|
-
var
|
|
414
|
+
var rr = function(e, r, n, o, c, f, l) {
|
|
415
|
+
var s = {
|
|
420
416
|
// This tag allows us to uniquely identify this as a React Element
|
|
421
|
-
$$typeof:
|
|
417
|
+
$$typeof: t,
|
|
422
418
|
// Built-in properties that belong on the element
|
|
423
419
|
type: e,
|
|
424
|
-
key:
|
|
425
|
-
ref:
|
|
426
|
-
props:
|
|
420
|
+
key: r,
|
|
421
|
+
ref: n,
|
|
422
|
+
props: l,
|
|
427
423
|
// Record the component responsible for creating this element.
|
|
428
|
-
_owner:
|
|
424
|
+
_owner: f
|
|
429
425
|
};
|
|
430
|
-
return
|
|
426
|
+
return s._store = {}, Object.defineProperty(s._store, "validated", {
|
|
431
427
|
configurable: !1,
|
|
432
428
|
enumerable: !1,
|
|
433
429
|
writable: !0,
|
|
434
430
|
value: !1
|
|
435
|
-
}), Object.defineProperty(
|
|
431
|
+
}), Object.defineProperty(s, "_self", {
|
|
436
432
|
configurable: !1,
|
|
437
433
|
enumerable: !1,
|
|
438
434
|
writable: !1,
|
|
439
|
-
value:
|
|
440
|
-
}), Object.defineProperty(
|
|
435
|
+
value: o
|
|
436
|
+
}), Object.defineProperty(s, "_source", {
|
|
441
437
|
configurable: !1,
|
|
442
438
|
enumerable: !1,
|
|
443
439
|
writable: !1,
|
|
444
|
-
value:
|
|
445
|
-
}), Object.freeze && (Object.freeze(
|
|
440
|
+
value: c
|
|
441
|
+
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
|
|
446
442
|
};
|
|
447
|
-
function
|
|
443
|
+
function tr(e, r, n, o, c) {
|
|
448
444
|
{
|
|
449
|
-
var
|
|
450
|
-
|
|
451
|
-
for (
|
|
452
|
-
|
|
445
|
+
var f, l = {}, s = null, _ = null;
|
|
446
|
+
n !== void 0 && (ve(n), s = "" + n), Ge(r) && (ve(r.key), s = "" + r.key), Xe(r) && (_ = r.ref, Ze(r, c));
|
|
447
|
+
for (f in r)
|
|
448
|
+
W.call(r, f) && !Ke.hasOwnProperty(f) && (l[f] = r[f]);
|
|
453
449
|
if (e && e.defaultProps) {
|
|
454
|
-
var
|
|
455
|
-
for (
|
|
456
|
-
|
|
450
|
+
var v = e.defaultProps;
|
|
451
|
+
for (f in v)
|
|
452
|
+
l[f] === void 0 && (l[f] = v[f]);
|
|
457
453
|
}
|
|
458
|
-
if (
|
|
459
|
-
var
|
|
460
|
-
|
|
454
|
+
if (s || _) {
|
|
455
|
+
var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
456
|
+
s && Qe(l, y), _ && er(l, y);
|
|
461
457
|
}
|
|
462
|
-
return
|
|
458
|
+
return rr(e, s, _, c, o, be.current, l);
|
|
463
459
|
}
|
|
464
460
|
}
|
|
465
|
-
var
|
|
466
|
-
function
|
|
461
|
+
var Q = P.ReactCurrentOwner, Ee = P.ReactDebugCurrentFrame;
|
|
462
|
+
function A(e) {
|
|
467
463
|
if (e) {
|
|
468
|
-
var
|
|
469
|
-
|
|
464
|
+
var r = e._owner, n = H(e.type, e._source, r ? r.type : null);
|
|
465
|
+
Ee.setExtraStackFrame(n);
|
|
470
466
|
} else
|
|
471
|
-
|
|
467
|
+
Ee.setExtraStackFrame(null);
|
|
472
468
|
}
|
|
473
|
-
var
|
|
474
|
-
|
|
475
|
-
function
|
|
476
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
469
|
+
var ee;
|
|
470
|
+
ee = !1;
|
|
471
|
+
function re(e) {
|
|
472
|
+
return typeof e == "object" && e !== null && e.$$typeof === t;
|
|
477
473
|
}
|
|
478
|
-
function
|
|
474
|
+
function we() {
|
|
479
475
|
{
|
|
480
|
-
if (
|
|
481
|
-
var e =
|
|
476
|
+
if (Q.current) {
|
|
477
|
+
var e = k(Q.current.type);
|
|
482
478
|
if (e)
|
|
483
479
|
return `
|
|
484
480
|
|
|
@@ -487,1764 +483,244 @@ Check the render method of \`` + e + "`.";
|
|
|
487
483
|
return "";
|
|
488
484
|
}
|
|
489
485
|
}
|
|
490
|
-
function
|
|
486
|
+
function nr(e) {
|
|
491
487
|
return "";
|
|
492
488
|
}
|
|
493
|
-
var
|
|
494
|
-
function
|
|
489
|
+
var _e = {};
|
|
490
|
+
function ar(e) {
|
|
495
491
|
{
|
|
496
|
-
var
|
|
497
|
-
if (!
|
|
498
|
-
var
|
|
499
|
-
|
|
492
|
+
var r = we();
|
|
493
|
+
if (!r) {
|
|
494
|
+
var n = typeof e == "string" ? e : e.displayName || e.name;
|
|
495
|
+
n && (r = `
|
|
500
496
|
|
|
501
|
-
Check the top-level render call using <` +
|
|
497
|
+
Check the top-level render call using <` + n + ">.");
|
|
502
498
|
}
|
|
503
|
-
return
|
|
499
|
+
return r;
|
|
504
500
|
}
|
|
505
501
|
}
|
|
506
|
-
function
|
|
502
|
+
function Ce(e, r) {
|
|
507
503
|
{
|
|
508
504
|
if (!e._store || e._store.validated || e.key != null)
|
|
509
505
|
return;
|
|
510
506
|
e._store.validated = !0;
|
|
511
|
-
var
|
|
512
|
-
if (
|
|
507
|
+
var n = ar(r);
|
|
508
|
+
if (_e[n])
|
|
513
509
|
return;
|
|
514
|
-
|
|
515
|
-
var
|
|
516
|
-
e && e._owner && e._owner !==
|
|
510
|
+
_e[n] = !0;
|
|
511
|
+
var o = "";
|
|
512
|
+
e && e._owner && e._owner !== Q.current && (o = " It was passed a child from " + k(e._owner.type) + "."), A(e), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, o), A(null);
|
|
517
513
|
}
|
|
518
514
|
}
|
|
519
|
-
function
|
|
515
|
+
function xe(e, r) {
|
|
520
516
|
{
|
|
521
517
|
if (typeof e != "object")
|
|
522
518
|
return;
|
|
523
|
-
if (
|
|
524
|
-
for (var
|
|
525
|
-
var
|
|
526
|
-
|
|
519
|
+
if (Z(e))
|
|
520
|
+
for (var n = 0; n < e.length; n++) {
|
|
521
|
+
var o = e[n];
|
|
522
|
+
re(o) && Ce(o, r);
|
|
527
523
|
}
|
|
528
|
-
else if (
|
|
524
|
+
else if (re(e))
|
|
529
525
|
e._store && (e._store.validated = !0);
|
|
530
526
|
else if (e) {
|
|
531
|
-
var
|
|
532
|
-
if (typeof
|
|
533
|
-
for (var
|
|
534
|
-
|
|
527
|
+
var c = D(e);
|
|
528
|
+
if (typeof c == "function" && c !== e.entries)
|
|
529
|
+
for (var f = c.call(e), l; !(l = f.next()).done; )
|
|
530
|
+
re(l.value) && Ce(l.value, r);
|
|
535
531
|
}
|
|
536
532
|
}
|
|
537
533
|
}
|
|
538
|
-
function
|
|
534
|
+
function or(e) {
|
|
539
535
|
{
|
|
540
|
-
var
|
|
541
|
-
if (
|
|
536
|
+
var r = e.type;
|
|
537
|
+
if (r == null || typeof r == "string")
|
|
542
538
|
return;
|
|
543
|
-
var
|
|
544
|
-
if (typeof
|
|
545
|
-
|
|
546
|
-
else if (typeof
|
|
539
|
+
var n;
|
|
540
|
+
if (typeof r == "function")
|
|
541
|
+
n = r.propTypes;
|
|
542
|
+
else if (typeof r == "object" && (r.$$typeof === m || // Note: Memo only checks outer props here.
|
|
547
543
|
// Inner props are checked in the reconciler.
|
|
548
|
-
|
|
549
|
-
|
|
544
|
+
r.$$typeof === R))
|
|
545
|
+
n = r.propTypes;
|
|
550
546
|
else
|
|
551
547
|
return;
|
|
552
|
-
if (
|
|
553
|
-
var
|
|
554
|
-
|
|
555
|
-
} else if (
|
|
556
|
-
|
|
557
|
-
var
|
|
558
|
-
|
|
548
|
+
if (n) {
|
|
549
|
+
var o = k(r);
|
|
550
|
+
Ue(n, e.props, "prop", o, e);
|
|
551
|
+
} else if (r.PropTypes !== void 0 && !ee) {
|
|
552
|
+
ee = !0;
|
|
553
|
+
var c = k(r);
|
|
554
|
+
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", c || "Unknown");
|
|
559
555
|
}
|
|
560
|
-
typeof
|
|
556
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
561
557
|
}
|
|
562
558
|
}
|
|
563
|
-
function
|
|
559
|
+
function ir(e) {
|
|
564
560
|
{
|
|
565
|
-
for (var
|
|
566
|
-
var
|
|
567
|
-
if (
|
|
568
|
-
|
|
561
|
+
for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
|
|
562
|
+
var o = r[n];
|
|
563
|
+
if (o !== "children" && o !== "key") {
|
|
564
|
+
A(e), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), A(null);
|
|
569
565
|
break;
|
|
570
566
|
}
|
|
571
567
|
}
|
|
572
|
-
e.ref !== null && (
|
|
568
|
+
e.ref !== null && (A(e), w("Invalid attribute `ref` supplied to `React.Fragment`."), A(null));
|
|
573
569
|
}
|
|
574
570
|
}
|
|
575
|
-
var
|
|
576
|
-
function
|
|
571
|
+
var Te = {};
|
|
572
|
+
function Se(e, r, n, o, c, f) {
|
|
577
573
|
{
|
|
578
|
-
var
|
|
579
|
-
if (!
|
|
580
|
-
var
|
|
581
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
582
|
-
var
|
|
583
|
-
|
|
584
|
-
var
|
|
585
|
-
e === null ?
|
|
586
|
-
}
|
|
587
|
-
var
|
|
588
|
-
if (
|
|
589
|
-
return
|
|
590
|
-
if (
|
|
591
|
-
var
|
|
592
|
-
if (
|
|
593
|
-
if (
|
|
594
|
-
if (
|
|
595
|
-
for (var
|
|
596
|
-
|
|
597
|
-
Object.freeze && Object.freeze(
|
|
574
|
+
var l = Me(e);
|
|
575
|
+
if (!l) {
|
|
576
|
+
var s = "";
|
|
577
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (s += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
578
|
+
var _ = nr();
|
|
579
|
+
_ ? s += _ : s += we();
|
|
580
|
+
var v;
|
|
581
|
+
e === null ? v = "null" : Z(e) ? v = "array" : e !== void 0 && e.$$typeof === t ? (v = "<" + (k(e.type) || "Unknown") + " />", s = " Did you accidentally export a JSX literal instead of a component?") : v = typeof e, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", v, s);
|
|
582
|
+
}
|
|
583
|
+
var y = tr(e, r, n, c, f);
|
|
584
|
+
if (y == null)
|
|
585
|
+
return y;
|
|
586
|
+
if (l) {
|
|
587
|
+
var T = r.children;
|
|
588
|
+
if (T !== void 0)
|
|
589
|
+
if (o)
|
|
590
|
+
if (Z(T)) {
|
|
591
|
+
for (var $ = 0; $ < T.length; $++)
|
|
592
|
+
xe(T[$], e);
|
|
593
|
+
Object.freeze && Object.freeze(T);
|
|
598
594
|
} else
|
|
599
|
-
|
|
595
|
+
w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
600
596
|
else
|
|
601
|
-
|
|
602
|
-
}
|
|
603
|
-
if (
|
|
604
|
-
var
|
|
605
|
-
return
|
|
606
|
-
}),
|
|
607
|
-
if (!
|
|
608
|
-
var
|
|
609
|
-
|
|
597
|
+
xe(T, e);
|
|
598
|
+
}
|
|
599
|
+
if (W.call(r, "key")) {
|
|
600
|
+
var j = k(e), C = Object.keys(r).filter(function(dr) {
|
|
601
|
+
return dr !== "key";
|
|
602
|
+
}), te = C.length > 0 ? "{key: someKey, " + C.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
|
+
if (!Te[j + te]) {
|
|
604
|
+
var fr = C.length > 0 ? "{" + C.join(": ..., ") + ": ...}" : "{}";
|
|
605
|
+
w(`A props object containing a "key" prop is being spread into JSX:
|
|
610
606
|
let props = %s;
|
|
611
607
|
<%s {...props} />
|
|
612
608
|
React keys must be passed directly to JSX without using spread:
|
|
613
609
|
let props = %s;
|
|
614
|
-
<%s key={someKey} {...props} />`,
|
|
610
|
+
<%s key={someKey} {...props} />`, te, j, fr, j), Te[j + te] = !0;
|
|
615
611
|
}
|
|
616
612
|
}
|
|
617
|
-
return e ===
|
|
613
|
+
return e === h ? ir(y) : or(y), y;
|
|
618
614
|
}
|
|
619
615
|
}
|
|
620
|
-
function
|
|
621
|
-
return
|
|
616
|
+
function sr(e, r, n) {
|
|
617
|
+
return Se(e, r, n, !0);
|
|
622
618
|
}
|
|
623
|
-
function
|
|
624
|
-
return
|
|
619
|
+
function lr(e, r, n) {
|
|
620
|
+
return Se(e, r, n, !1);
|
|
625
621
|
}
|
|
626
|
-
var
|
|
627
|
-
|
|
628
|
-
})()),
|
|
622
|
+
var ur = lr, cr = sr;
|
|
623
|
+
N.Fragment = h, N.jsx = ur, N.jsxs = cr;
|
|
624
|
+
})()), N;
|
|
629
625
|
}
|
|
630
|
-
var
|
|
631
|
-
function
|
|
632
|
-
return
|
|
626
|
+
var je;
|
|
627
|
+
function yr() {
|
|
628
|
+
return je || (je = 1, process.env.NODE_ENV === "production" ? q.exports = vr() : q.exports = br()), q.exports;
|
|
633
629
|
}
|
|
634
|
-
var
|
|
635
|
-
function
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
* @type {boolean}
|
|
688
|
-
* @memberof Prism
|
|
689
|
-
* @public
|
|
690
|
-
*/
|
|
691
|
-
disableWorkerMessageHandler: v.Prism && v.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 n(r) {
|
|
703
|
-
return r instanceof c ? new c(r.type, n(r.content), r.alias) : Array.isArray(r) ? r.map(n) : r.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(n) {
|
|
722
|
-
return Object.prototype.toString.call(n).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(n) {
|
|
731
|
-
return n.__id || Object.defineProperty(n, "__id", { value: ++x }), n.__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 n(r, o) {
|
|
744
|
-
o = o || {};
|
|
745
|
-
var s, l;
|
|
746
|
-
switch (a.util.type(r)) {
|
|
747
|
-
case "Object":
|
|
748
|
-
if (l = a.util.objId(r), o[l])
|
|
749
|
-
return o[l];
|
|
750
|
-
s = /** @type {Record<string, any>} */
|
|
751
|
-
{}, o[l] = s;
|
|
752
|
-
for (var m in r)
|
|
753
|
-
r.hasOwnProperty(m) && (s[m] = n(r[m], o));
|
|
754
|
-
return (
|
|
755
|
-
/** @type {any} */
|
|
756
|
-
s
|
|
757
|
-
);
|
|
758
|
-
case "Array":
|
|
759
|
-
return l = a.util.objId(r), o[l] ? o[l] : (s = [], o[l] = s, /** @type {Array} */
|
|
760
|
-
/** @type {any} */
|
|
761
|
-
r.forEach(function(S, y) {
|
|
762
|
-
s[y] = n(S, o);
|
|
763
|
-
}), /** @type {any} */
|
|
764
|
-
s);
|
|
765
|
-
default:
|
|
766
|
-
return r;
|
|
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(n) {
|
|
778
|
-
for (; n; ) {
|
|
779
|
-
var r = b.exec(n.className);
|
|
780
|
-
if (r)
|
|
781
|
-
return r[1].toLowerCase();
|
|
782
|
-
n = n.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(n, r) {
|
|
794
|
-
n.className = n.className.replace(RegExp(b, "gi"), ""), n.classList.add("language-" + r);
|
|
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 n = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(s.stack) || [])[1];
|
|
815
|
-
if (n) {
|
|
816
|
-
var r = document.getElementsByTagName("script");
|
|
817
|
-
for (var o in r)
|
|
818
|
-
if (r[o].src == n)
|
|
819
|
-
return r[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(n, r, o) {
|
|
844
|
-
for (var s = "no-" + r; n; ) {
|
|
845
|
-
var l = n.classList;
|
|
846
|
-
if (l.contains(r))
|
|
847
|
-
return !0;
|
|
848
|
-
if (l.contains(s))
|
|
849
|
-
return !1;
|
|
850
|
-
n = n.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(n, r) {
|
|
899
|
-
var o = a.util.clone(a.languages[n]);
|
|
900
|
-
for (var s in r)
|
|
901
|
-
o[s] = r[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(n, r, o, s) {
|
|
980
|
-
s = s || /** @type {any} */
|
|
981
|
-
a.languages;
|
|
982
|
-
var l = s[n], m = {};
|
|
983
|
-
for (var S in l)
|
|
984
|
-
if (l.hasOwnProperty(S)) {
|
|
985
|
-
if (S == r)
|
|
986
|
-
for (var y in o)
|
|
987
|
-
o.hasOwnProperty(y) && (m[y] = o[y]);
|
|
988
|
-
o.hasOwnProperty(S) || (m[S] = l[S]);
|
|
989
|
-
}
|
|
990
|
-
var O = s[n];
|
|
991
|
-
return s[n] = m, a.languages.DFS(a.languages, function(z, U) {
|
|
992
|
-
U === O && z != n && (this[z] = m);
|
|
993
|
-
}), m;
|
|
994
|
-
},
|
|
995
|
-
// Traverse a language definition with Depth First Search
|
|
996
|
-
DFS: function n(r, o, s, l) {
|
|
997
|
-
l = l || {};
|
|
998
|
-
var m = a.util.objId;
|
|
999
|
-
for (var S in r)
|
|
1000
|
-
if (r.hasOwnProperty(S)) {
|
|
1001
|
-
o.call(r, S, r[S], s || S);
|
|
1002
|
-
var y = r[S], O = a.util.type(y);
|
|
1003
|
-
O === "Object" && !l[m(y)] ? (l[m(y)] = !0, n(y, o, null, l)) : O === "Array" && !l[m(y)] && (l[m(y)] = !0, n(y, o, S, l));
|
|
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(n, r) {
|
|
1021
|
-
a.highlightAllUnder(document, n, r);
|
|
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(n, r, o) {
|
|
1039
|
-
var s = {
|
|
1040
|
-
callback: o,
|
|
1041
|
-
container: n,
|
|
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 l = 0, m; m = s.elements[l++]; )
|
|
1046
|
-
a.highlightElement(m, r === !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(n, r, o) {
|
|
1077
|
-
var s = a.util.getLanguage(n), l = a.languages[s];
|
|
1078
|
-
a.util.setLanguage(n, s);
|
|
1079
|
-
var m = n.parentElement;
|
|
1080
|
-
m && m.nodeName.toLowerCase() === "pre" && a.util.setLanguage(m, s);
|
|
1081
|
-
var S = n.textContent, y = {
|
|
1082
|
-
element: n,
|
|
1083
|
-
language: s,
|
|
1084
|
-
grammar: l,
|
|
1085
|
-
code: S
|
|
1086
|
-
};
|
|
1087
|
-
function O(U) {
|
|
1088
|
-
y.highlightedCode = U, a.hooks.run("before-insert", y), y.element.innerHTML = y.highlightedCode, a.hooks.run("after-highlight", y), a.hooks.run("complete", y), o && o.call(y.element);
|
|
1089
|
-
}
|
|
1090
|
-
if (a.hooks.run("before-sanity-check", y), m = y.element.parentElement, m && m.nodeName.toLowerCase() === "pre" && !m.hasAttribute("tabindex") && m.setAttribute("tabindex", "0"), !y.code) {
|
|
1091
|
-
a.hooks.run("complete", y), o && o.call(y.element);
|
|
1092
|
-
return;
|
|
1093
|
-
}
|
|
1094
|
-
if (a.hooks.run("before-highlight", y), !y.grammar) {
|
|
1095
|
-
O(a.util.encode(y.code));
|
|
1096
|
-
return;
|
|
1097
|
-
}
|
|
1098
|
-
if (r && v.Worker) {
|
|
1099
|
-
var z = new Worker(a.filename);
|
|
1100
|
-
z.onmessage = function(U) {
|
|
1101
|
-
O(U.data);
|
|
1102
|
-
}, z.postMessage(JSON.stringify({
|
|
1103
|
-
language: y.language,
|
|
1104
|
-
code: y.code,
|
|
1105
|
-
immediateClose: !0
|
|
1106
|
-
}));
|
|
1107
|
-
} else
|
|
1108
|
-
O(a.highlight(y.code, y.grammar, y.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(n, r, o) {
|
|
1131
|
-
var s = {
|
|
1132
|
-
code: n,
|
|
1133
|
-
grammar: r,
|
|
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(n, r) {
|
|
1165
|
-
var o = r.rest;
|
|
1166
|
-
if (o) {
|
|
1167
|
-
for (var s in o)
|
|
1168
|
-
r[s] = o[s];
|
|
1169
|
-
delete r.rest;
|
|
1170
|
-
}
|
|
1171
|
-
var l = new f();
|
|
1172
|
-
return k(l, l.head, n), p(n, l, r, l.head, 0), P(l);
|
|
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(n, r) {
|
|
1194
|
-
var o = a.hooks.all;
|
|
1195
|
-
o[n] = o[n] || [], o[n].push(r);
|
|
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(n, r) {
|
|
1207
|
-
var o = a.hooks.all[n];
|
|
1208
|
-
if (!(!o || !o.length))
|
|
1209
|
-
for (var s = 0, l; l = o[s++]; )
|
|
1210
|
-
l(r);
|
|
1211
|
-
}
|
|
1212
|
-
},
|
|
1213
|
-
Token: c
|
|
1214
|
-
};
|
|
1215
|
-
v.Prism = a;
|
|
1216
|
-
function c(n, r, o, s) {
|
|
1217
|
-
this.type = n, this.content = r, this.alias = o, this.length = (s || "").length | 0;
|
|
1218
|
-
}
|
|
1219
|
-
c.stringify = function n(r, o) {
|
|
1220
|
-
if (typeof r == "string")
|
|
1221
|
-
return r;
|
|
1222
|
-
if (Array.isArray(r)) {
|
|
1223
|
-
var s = "";
|
|
1224
|
-
return r.forEach(function(O) {
|
|
1225
|
-
s += n(O, o);
|
|
1226
|
-
}), s;
|
|
1227
|
-
}
|
|
1228
|
-
var l = {
|
|
1229
|
-
type: r.type,
|
|
1230
|
-
content: n(r.content, o),
|
|
1231
|
-
tag: "span",
|
|
1232
|
-
classes: ["token", r.type],
|
|
1233
|
-
attributes: {},
|
|
1234
|
-
language: o
|
|
1235
|
-
}, m = r.alias;
|
|
1236
|
-
m && (Array.isArray(m) ? Array.prototype.push.apply(l.classes, m) : l.classes.push(m)), a.hooks.run("wrap", l);
|
|
1237
|
-
var S = "";
|
|
1238
|
-
for (var y in l.attributes)
|
|
1239
|
-
S += " " + y + '="' + (l.attributes[y] || "").replace(/"/g, """) + '"';
|
|
1240
|
-
return "<" + l.tag + ' class="' + l.classes.join(" ") + '"' + S + ">" + l.content + "</" + l.tag + ">";
|
|
1241
|
-
};
|
|
1242
|
-
function E(n, r, o, s) {
|
|
1243
|
-
n.lastIndex = r;
|
|
1244
|
-
var l = n.exec(o);
|
|
1245
|
-
if (l && s && l[1]) {
|
|
1246
|
-
var m = l[1].length;
|
|
1247
|
-
l.index += m, l[0] = l[0].slice(m);
|
|
1248
|
-
}
|
|
1249
|
-
return l;
|
|
1250
|
-
}
|
|
1251
|
-
function p(n, r, o, s, l, m) {
|
|
1252
|
-
for (var S in o)
|
|
1253
|
-
if (!(!o.hasOwnProperty(S) || !o[S])) {
|
|
1254
|
-
var y = o[S];
|
|
1255
|
-
y = Array.isArray(y) ? y : [y];
|
|
1256
|
-
for (var O = 0; O < y.length; ++O) {
|
|
1257
|
-
if (m && m.cause == S + "," + O)
|
|
1258
|
-
return;
|
|
1259
|
-
var z = y[O], 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 = l; M !== r.tail && !(m && H >= m.reach); H += M.value.length, M = M.next) {
|
|
1265
|
-
var G = M.value;
|
|
1266
|
-
if (r.length > n.length)
|
|
1267
|
-
return;
|
|
1268
|
-
if (!(G instanceof c)) {
|
|
1269
|
-
var ee = 1, N;
|
|
1270
|
-
if (B) {
|
|
1271
|
-
if (N = E(le, H, n, Y), !N || N.index >= n.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 ne = M; ne !== r.tail && (V < he || typeof ne.value == "string"); ne = ne.next)
|
|
1279
|
-
ee++, V += ne.value.length;
|
|
1280
|
-
ee--, G = n.slice(H, V), N.index -= H;
|
|
1281
|
-
} else if (N = E(le, 0, G, Y), !N)
|
|
1282
|
-
continue;
|
|
1283
|
-
var J = N.index, K = N[0], Z = G.slice(0, J), te = G.slice(J + K.length), X = H + G.length;
|
|
1284
|
-
m && X > m.reach && (m.reach = X);
|
|
1285
|
-
var ae = M.prev;
|
|
1286
|
-
Z && (ae = k(r, ae, Z), H += Z.length), C(r, ae, ee);
|
|
1287
|
-
var me = new c(S, U ? a.tokenize(K, U) : K, Q, K);
|
|
1288
|
-
if (M = k(r, ae, me), te && k(r, M, te), ee > 1) {
|
|
1289
|
-
var ue = {
|
|
1290
|
-
cause: S + "," + O,
|
|
1291
|
-
reach: X
|
|
1292
|
-
};
|
|
1293
|
-
p(n, r, o, M.prev, H, ue), m && ue.reach > m.reach && (m.reach = ue.reach);
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
function f() {
|
|
1301
|
-
var n = { value: null, prev: null, next: null }, r = { value: null, prev: n, next: null };
|
|
1302
|
-
n.next = r, this.head = n, this.tail = r, this.length = 0;
|
|
1303
|
-
}
|
|
1304
|
-
function k(n, r, o) {
|
|
1305
|
-
var s = r.next, l = { value: o, prev: r, next: s };
|
|
1306
|
-
return r.next = l, s.prev = l, n.length++, l;
|
|
1307
|
-
}
|
|
1308
|
-
function C(n, r, o) {
|
|
1309
|
-
for (var s = r.next, l = 0; l < o && s !== n.tail; l++)
|
|
1310
|
-
s = s.next;
|
|
1311
|
-
r.next = s, s.prev = r, n.length -= l;
|
|
1312
|
-
}
|
|
1313
|
-
function P(n) {
|
|
1314
|
-
for (var r = [], o = n.head.next; o !== n.tail; )
|
|
1315
|
-
r.push(o.value), o = o.next;
|
|
1316
|
-
return r;
|
|
1317
|
-
}
|
|
1318
|
-
if (!v.document)
|
|
1319
|
-
return v.addEventListener && (a.disableWorkerMessageHandler || v.addEventListener("message", function(n) {
|
|
1320
|
-
var r = JSON.parse(n.data), o = r.language, s = r.code, l = r.immediateClose;
|
|
1321
|
-
v.postMessage(a.highlight(s, a.languages[o], o)), l && v.close();
|
|
1322
|
-
}, !1)), a;
|
|
1323
|
-
var F = a.util.currentScript();
|
|
1324
|
-
F && (a.filename = F.src, F.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" && F && F.defer ? document.addEventListener("DOMContentLoaded", _) : window.requestAnimationFrame ? window.requestAnimationFrame(_) : window.setTimeout(_, 16);
|
|
1331
|
-
}
|
|
1332
|
-
return a;
|
|
1333
|
-
})(g);
|
|
1334
|
-
u.exports && (u.exports = t), typeof We < "u" && (We.Prism = t), t.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
|
-
}, t.languages.markup.tag.inside["attr-value"].inside.entity = t.languages.markup.entity, t.languages.markup.doctype.inside["internal-subset"].inside = t.languages.markup, t.hooks.add("wrap", function(v) {
|
|
1412
|
-
v.type === "entity" && (v.attributes.title = v.content.replace(/&/, "&"));
|
|
1413
|
-
}), Object.defineProperty(t.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(b, x) {
|
|
1426
|
-
var h = {};
|
|
1427
|
-
h["language-" + x] = {
|
|
1428
|
-
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
1429
|
-
lookbehind: !0,
|
|
1430
|
-
inside: t.languages[x]
|
|
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-" + x] = {
|
|
1439
|
-
pattern: /[\s\S]+/,
|
|
1440
|
-
inside: t.languages[x]
|
|
1441
|
-
};
|
|
1442
|
-
var c = {};
|
|
1443
|
-
c[b] = {
|
|
1444
|
-
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
1445
|
-
return b;
|
|
1446
|
-
}), "i"),
|
|
1447
|
-
lookbehind: !0,
|
|
1448
|
-
greedy: !0,
|
|
1449
|
-
inside: a
|
|
1450
|
-
}, t.languages.insertBefore("markup", "cdata", c);
|
|
1451
|
-
}
|
|
1452
|
-
}), Object.defineProperty(t.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(v, b) {
|
|
1465
|
-
t.languages.markup.tag.inside["special-attr"].push({
|
|
1466
|
-
pattern: RegExp(
|
|
1467
|
-
/(^|["'\s])/.source + "(?:" + v + ")" + /\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: [b, "language-" + b],
|
|
1480
|
-
inside: t.languages[b]
|
|
1481
|
-
},
|
|
1482
|
-
punctuation: [
|
|
1483
|
-
{
|
|
1484
|
-
pattern: /^=/,
|
|
1485
|
-
alias: "attr-equals"
|
|
1486
|
-
},
|
|
1487
|
-
/"|'/
|
|
1488
|
-
]
|
|
1489
|
-
}
|
|
1490
|
-
}
|
|
1491
|
-
}
|
|
1492
|
-
});
|
|
1493
|
-
}
|
|
1494
|
-
}), t.languages.html = t.languages.markup, t.languages.mathml = t.languages.markup, t.languages.svg = t.languages.markup, t.languages.xml = t.languages.extend("markup", {}), t.languages.ssml = t.languages.xml, t.languages.atom = t.languages.xml, t.languages.rss = t.languages.xml, (function(v) {
|
|
1495
|
-
var b = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
1496
|
-
v.languages.css = {
|
|
1497
|
-
comment: /\/\*[\s\S]*?\*\//,
|
|
1498
|
-
atrule: {
|
|
1499
|
-
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + b.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\\((?:" + b.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
|
1517
|
-
greedy: !0,
|
|
1518
|
-
inside: {
|
|
1519
|
-
function: /^url/i,
|
|
1520
|
-
punctuation: /^\(|\)$/,
|
|
1521
|
-
string: {
|
|
1522
|
-
pattern: RegExp("^" + b.source + "$"),
|
|
1523
|
-
alias: "url"
|
|
1524
|
-
}
|
|
1525
|
-
}
|
|
1526
|
-
},
|
|
1527
|
-
selector: {
|
|
1528
|
-
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + b.source + ")*(?=\\s*\\{)"),
|
|
1529
|
-
lookbehind: !0
|
|
1530
|
-
},
|
|
1531
|
-
string: {
|
|
1532
|
-
pattern: b,
|
|
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
|
-
}, v.languages.css.atrule.inside.rest = v.languages.css;
|
|
1546
|
-
var x = v.languages.markup;
|
|
1547
|
-
x && (x.tag.addInlined("style", "css"), x.tag.addAttribute("style", "css"));
|
|
1548
|
-
})(t), t.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
|
-
}, t.languages.javascript = t.languages.extend("clike", {
|
|
1579
|
-
"class-name": [
|
|
1580
|
-
t.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
|
-
}), t.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, t.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: t.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: t.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: t.languages.javascript
|
|
1652
|
-
},
|
|
1653
|
-
{
|
|
1654
|
-
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
1655
|
-
lookbehind: !0,
|
|
1656
|
-
inside: t.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: t.languages.javascript
|
|
1662
|
-
}
|
|
1663
|
-
],
|
|
1664
|
-
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
1665
|
-
}), t.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: t.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
|
-
}), t.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
|
-
}), t.languages.markup && (t.languages.markup.tag.addInlined("script", "javascript"), t.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
|
-
)), t.languages.js = t.languages.javascript, (function() {
|
|
1709
|
-
if (typeof t > "u" || typeof document > "u")
|
|
1710
|
-
return;
|
|
1711
|
-
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
1712
|
-
var v = "Loading…", b = function(F, _) {
|
|
1713
|
-
return "✖ Error " + F + " while fetching file: " + _;
|
|
1714
|
-
}, x = "✖ 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", E = "loaded", p = "failed", f = "pre[data-src]:not([" + a + '="' + E + '"]):not([' + a + '="' + c + '"])';
|
|
1725
|
-
function k(F, _, A) {
|
|
1726
|
-
var n = new XMLHttpRequest();
|
|
1727
|
-
n.open("GET", F, !0), n.onreadystatechange = function() {
|
|
1728
|
-
n.readyState == 4 && (n.status < 400 && n.responseText ? _(n.responseText) : n.status >= 400 ? A(b(n.status, n.statusText)) : A(x));
|
|
1729
|
-
}, n.send(null);
|
|
1730
|
-
}
|
|
1731
|
-
function C(F) {
|
|
1732
|
-
var _ = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(F || "");
|
|
1733
|
-
if (_) {
|
|
1734
|
-
var A = Number(_[1]), n = _[2], r = _[3];
|
|
1735
|
-
return n ? r ? [A, Number(r)] : [A, void 0] : [A, A];
|
|
1736
|
-
}
|
|
1737
|
-
}
|
|
1738
|
-
t.hooks.add("before-highlightall", function(F) {
|
|
1739
|
-
F.selector += ", " + f;
|
|
1740
|
-
}), t.hooks.add("before-sanity-check", function(F) {
|
|
1741
|
-
var _ = (
|
|
1742
|
-
/** @type {HTMLPreElement} */
|
|
1743
|
-
F.element
|
|
1744
|
-
);
|
|
1745
|
-
if (_.matches(f)) {
|
|
1746
|
-
F.code = "", _.setAttribute(a, c);
|
|
1747
|
-
var A = _.appendChild(document.createElement("CODE"));
|
|
1748
|
-
A.textContent = v;
|
|
1749
|
-
var n = _.getAttribute("data-src"), r = F.language;
|
|
1750
|
-
if (r === "none") {
|
|
1751
|
-
var o = (/\.(\w+)$/.exec(n) || [, "none"])[1];
|
|
1752
|
-
r = h[o] || o;
|
|
1753
|
-
}
|
|
1754
|
-
t.util.setLanguage(A, r), t.util.setLanguage(_, r);
|
|
1755
|
-
var s = t.plugins.autoloader;
|
|
1756
|
-
s && s.loadLanguages(r), k(
|
|
1757
|
-
n,
|
|
1758
|
-
function(l) {
|
|
1759
|
-
_.setAttribute(a, E);
|
|
1760
|
-
var m = C(_.getAttribute("data-range"));
|
|
1761
|
-
if (m) {
|
|
1762
|
-
var S = l.split(/\r\n?|\n/g), y = m[0], O = m[1] == null ? S.length : m[1];
|
|
1763
|
-
y < 0 && (y += S.length), y = Math.max(0, Math.min(y - 1, S.length)), O < 0 && (O += S.length), O = Math.max(0, Math.min(O, S.length)), l = S.slice(y, O).join(`
|
|
1764
|
-
`), _.hasAttribute("data-start") || _.setAttribute("data-start", String(y + 1));
|
|
1765
|
-
}
|
|
1766
|
-
A.textContent = l, t.highlightElement(A);
|
|
1767
|
-
},
|
|
1768
|
-
function(l) {
|
|
1769
|
-
_.setAttribute(a, p), A.textContent = l;
|
|
1770
|
-
}
|
|
1771
|
-
);
|
|
1772
|
-
}
|
|
1773
|
-
}), t.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), n = 0, r; r = A[n++]; )
|
|
1783
|
-
t.highlightElement(r);
|
|
1784
|
-
}
|
|
1785
|
-
};
|
|
1786
|
-
var P = !1;
|
|
1787
|
-
t.fileHighlight = function() {
|
|
1788
|
-
P || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), P = !0), t.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
1789
|
-
};
|
|
1790
|
-
})();
|
|
1791
|
-
})(_e)), _e.exports;
|
|
1792
|
-
}
|
|
1793
|
-
var Tn = Cn();
|
|
1794
|
-
const $n = /* @__PURE__ */ _n(Tn);
|
|
1795
|
-
(function(u) {
|
|
1796
|
-
var g = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;
|
|
1797
|
-
function t(p) {
|
|
1798
|
-
return p = p.replace(/<inner>/g, function() {
|
|
1799
|
-
return g;
|
|
1800
|
-
}), RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + p + ")");
|
|
1801
|
-
}
|
|
1802
|
-
var v = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source, b = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g, function() {
|
|
1803
|
-
return v;
|
|
1804
|
-
}), x = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;
|
|
1805
|
-
u.languages.markdown = u.languages.extend("markup", {}), u.languages.insertBefore("markdown", "prolog", {
|
|
1806
|
-
"front-matter-block": {
|
|
1807
|
-
pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,
|
|
1808
|
-
lookbehind: !0,
|
|
1809
|
-
greedy: !0,
|
|
1810
|
-
inside: {
|
|
1811
|
-
punctuation: /^---|---$/,
|
|
1812
|
-
"front-matter": {
|
|
1813
|
-
pattern: /\S+(?:\s+\S+)*/,
|
|
1814
|
-
alias: ["yaml", "language-yaml"],
|
|
1815
|
-
inside: u.languages.yaml
|
|
1816
|
-
}
|
|
1817
|
-
}
|
|
1818
|
-
},
|
|
1819
|
-
blockquote: {
|
|
1820
|
-
// > ...
|
|
1821
|
-
pattern: /^>(?:[\t ]*>)*/m,
|
|
1822
|
-
alias: "punctuation"
|
|
1823
|
-
},
|
|
1824
|
-
table: {
|
|
1825
|
-
pattern: RegExp("^" + b + x + "(?:" + b + ")*", "m"),
|
|
1826
|
-
inside: {
|
|
1827
|
-
"table-data-rows": {
|
|
1828
|
-
pattern: RegExp("^(" + b + x + ")(?:" + b + ")*$"),
|
|
1829
|
-
lookbehind: !0,
|
|
1830
|
-
inside: {
|
|
1831
|
-
"table-data": {
|
|
1832
|
-
pattern: RegExp(v),
|
|
1833
|
-
inside: u.languages.markdown
|
|
1834
|
-
},
|
|
1835
|
-
punctuation: /\|/
|
|
1836
|
-
}
|
|
1837
|
-
},
|
|
1838
|
-
"table-line": {
|
|
1839
|
-
pattern: RegExp("^(" + b + ")" + x + "$"),
|
|
1840
|
-
lookbehind: !0,
|
|
1841
|
-
inside: {
|
|
1842
|
-
punctuation: /\||:?-{3,}:?/
|
|
1843
|
-
}
|
|
1844
|
-
},
|
|
1845
|
-
"table-header-row": {
|
|
1846
|
-
pattern: RegExp("^" + b + "$"),
|
|
1847
|
-
inside: {
|
|
1848
|
-
"table-header": {
|
|
1849
|
-
pattern: RegExp(v),
|
|
1850
|
-
alias: "important",
|
|
1851
|
-
inside: u.languages.markdown
|
|
1852
|
-
},
|
|
1853
|
-
punctuation: /\|/
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
}
|
|
1857
|
-
},
|
|
1858
|
-
code: [
|
|
1859
|
-
{
|
|
1860
|
-
// Prefixed by 4 spaces or 1 tab and preceded by an empty line
|
|
1861
|
-
pattern: /((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,
|
|
1862
|
-
lookbehind: !0,
|
|
1863
|
-
alias: "keyword"
|
|
1864
|
-
},
|
|
1865
|
-
{
|
|
1866
|
-
// ```optional language
|
|
1867
|
-
// code block
|
|
1868
|
-
// ```
|
|
1869
|
-
pattern: /^```[\s\S]*?^```$/m,
|
|
1870
|
-
greedy: !0,
|
|
1871
|
-
inside: {
|
|
1872
|
-
"code-block": {
|
|
1873
|
-
pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,
|
|
1874
|
-
lookbehind: !0
|
|
1875
|
-
},
|
|
1876
|
-
"code-language": {
|
|
1877
|
-
pattern: /^(```).+/,
|
|
1878
|
-
lookbehind: !0
|
|
1879
|
-
},
|
|
1880
|
-
punctuation: /```/
|
|
1881
|
-
}
|
|
1882
|
-
}
|
|
1883
|
-
],
|
|
1884
|
-
title: [
|
|
1885
|
-
{
|
|
1886
|
-
// title 1
|
|
1887
|
-
// =======
|
|
1888
|
-
// title 2
|
|
1889
|
-
// -------
|
|
1890
|
-
pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,
|
|
1891
|
-
alias: "important",
|
|
1892
|
-
inside: {
|
|
1893
|
-
punctuation: /==+$|--+$/
|
|
1894
|
-
}
|
|
1895
|
-
},
|
|
1896
|
-
{
|
|
1897
|
-
// # title 1
|
|
1898
|
-
// ###### title 6
|
|
1899
|
-
pattern: /(^\s*)#.+/m,
|
|
1900
|
-
lookbehind: !0,
|
|
1901
|
-
alias: "important",
|
|
1902
|
-
inside: {
|
|
1903
|
-
punctuation: /^#+|#+$/
|
|
1904
|
-
}
|
|
1905
|
-
}
|
|
1906
|
-
],
|
|
1907
|
-
hr: {
|
|
1908
|
-
// ***
|
|
1909
|
-
// ---
|
|
1910
|
-
// * * *
|
|
1911
|
-
// -----------
|
|
1912
|
-
pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,
|
|
1913
|
-
lookbehind: !0,
|
|
1914
|
-
alias: "punctuation"
|
|
1915
|
-
},
|
|
1916
|
-
list: {
|
|
1917
|
-
// * item
|
|
1918
|
-
// + item
|
|
1919
|
-
// - item
|
|
1920
|
-
// 1. item
|
|
1921
|
-
pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,
|
|
1922
|
-
lookbehind: !0,
|
|
1923
|
-
alias: "punctuation"
|
|
1924
|
-
},
|
|
1925
|
-
"url-reference": {
|
|
1926
|
-
// [id]: http://example.com "Optional title"
|
|
1927
|
-
// [id]: http://example.com 'Optional title'
|
|
1928
|
-
// [id]: http://example.com (Optional title)
|
|
1929
|
-
// [id]: <http://example.com> "Optional title"
|
|
1930
|
-
pattern: /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,
|
|
1931
|
-
inside: {
|
|
1932
|
-
variable: {
|
|
1933
|
-
pattern: /^(!?\[)[^\]]+/,
|
|
1934
|
-
lookbehind: !0
|
|
1935
|
-
},
|
|
1936
|
-
string: /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,
|
|
1937
|
-
punctuation: /^[\[\]!:]|[<>]/
|
|
1938
|
-
},
|
|
1939
|
-
alias: "url"
|
|
1940
|
-
},
|
|
1941
|
-
bold: {
|
|
1942
|
-
// **strong**
|
|
1943
|
-
// __strong__
|
|
1944
|
-
// allow one nested instance of italic text using the same delimiter
|
|
1945
|
-
pattern: t(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),
|
|
1946
|
-
lookbehind: !0,
|
|
1947
|
-
greedy: !0,
|
|
1948
|
-
inside: {
|
|
1949
|
-
content: {
|
|
1950
|
-
pattern: /(^..)[\s\S]+(?=..$)/,
|
|
1951
|
-
lookbehind: !0,
|
|
1952
|
-
inside: {}
|
|
1953
|
-
// see below
|
|
1954
|
-
},
|
|
1955
|
-
punctuation: /\*\*|__/
|
|
1956
|
-
}
|
|
1957
|
-
},
|
|
1958
|
-
italic: {
|
|
1959
|
-
// *em*
|
|
1960
|
-
// _em_
|
|
1961
|
-
// allow one nested instance of bold text using the same delimiter
|
|
1962
|
-
pattern: t(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),
|
|
1963
|
-
lookbehind: !0,
|
|
1964
|
-
greedy: !0,
|
|
1965
|
-
inside: {
|
|
1966
|
-
content: {
|
|
1967
|
-
pattern: /(^.)[\s\S]+(?=.$)/,
|
|
1968
|
-
lookbehind: !0,
|
|
1969
|
-
inside: {}
|
|
1970
|
-
// see below
|
|
1971
|
-
},
|
|
1972
|
-
punctuation: /[*_]/
|
|
1973
|
-
}
|
|
1974
|
-
},
|
|
1975
|
-
strike: {
|
|
1976
|
-
// ~~strike through~~
|
|
1977
|
-
// ~strike~
|
|
1978
|
-
// eslint-disable-next-line regexp/strict
|
|
1979
|
-
pattern: t(/(~~?)(?:(?!~)<inner>)+\2/.source),
|
|
1980
|
-
lookbehind: !0,
|
|
1981
|
-
greedy: !0,
|
|
1982
|
-
inside: {
|
|
1983
|
-
content: {
|
|
1984
|
-
pattern: /(^~~?)[\s\S]+(?=\1$)/,
|
|
1985
|
-
lookbehind: !0,
|
|
1986
|
-
inside: {}
|
|
1987
|
-
// see below
|
|
1988
|
-
},
|
|
1989
|
-
punctuation: /~~?/
|
|
1990
|
-
}
|
|
1991
|
-
},
|
|
1992
|
-
"code-snippet": {
|
|
1993
|
-
// `code`
|
|
1994
|
-
// ``code``
|
|
1995
|
-
pattern: /(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,
|
|
1996
|
-
lookbehind: !0,
|
|
1997
|
-
greedy: !0,
|
|
1998
|
-
alias: ["code", "keyword"]
|
|
1999
|
-
},
|
|
2000
|
-
url: {
|
|
2001
|
-
// [example](http://example.com "Optional title")
|
|
2002
|
-
// [example][id]
|
|
2003
|
-
// [example] [id]
|
|
2004
|
-
pattern: t(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),
|
|
2005
|
-
lookbehind: !0,
|
|
2006
|
-
greedy: !0,
|
|
2007
|
-
inside: {
|
|
2008
|
-
operator: /^!/,
|
|
2009
|
-
content: {
|
|
2010
|
-
pattern: /(^\[)[^\]]+(?=\])/,
|
|
2011
|
-
lookbehind: !0,
|
|
2012
|
-
inside: {}
|
|
2013
|
-
// see below
|
|
2014
|
-
},
|
|
2015
|
-
variable: {
|
|
2016
|
-
pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/,
|
|
2017
|
-
lookbehind: !0
|
|
2018
|
-
},
|
|
2019
|
-
url: {
|
|
2020
|
-
pattern: /(^\]\()[^\s)]+/,
|
|
2021
|
-
lookbehind: !0
|
|
2022
|
-
},
|
|
2023
|
-
string: {
|
|
2024
|
-
pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,
|
|
2025
|
-
lookbehind: !0
|
|
2026
|
-
}
|
|
2027
|
-
}
|
|
2028
|
-
}
|
|
2029
|
-
}), ["url", "bold", "italic", "strike"].forEach(function(p) {
|
|
2030
|
-
["url", "bold", "italic", "strike", "code-snippet"].forEach(function(f) {
|
|
2031
|
-
p !== f && (u.languages.markdown[p].inside.content.inside[f] = u.languages.markdown[f]);
|
|
2032
|
-
});
|
|
2033
|
-
}), u.hooks.add("after-tokenize", function(p) {
|
|
2034
|
-
if (p.language !== "markdown" && p.language !== "md")
|
|
2035
|
-
return;
|
|
2036
|
-
function f(k) {
|
|
2037
|
-
if (!(!k || typeof k == "string"))
|
|
2038
|
-
for (var C = 0, P = k.length; C < P; C++) {
|
|
2039
|
-
var F = k[C];
|
|
2040
|
-
if (F.type !== "code") {
|
|
2041
|
-
f(F.content);
|
|
2042
|
-
continue;
|
|
2043
|
-
}
|
|
2044
|
-
var _ = F.content[1], A = F.content[3];
|
|
2045
|
-
if (_ && A && _.type === "code-language" && A.type === "code-block" && typeof _.content == "string") {
|
|
2046
|
-
var n = _.content.replace(/\b#/g, "sharp").replace(/\b\+\+/g, "pp");
|
|
2047
|
-
n = (/[a-z][\w-]*/i.exec(n) || [""])[0].toLowerCase();
|
|
2048
|
-
var r = "language-" + n;
|
|
2049
|
-
A.alias ? typeof A.alias == "string" ? A.alias = [A.alias, r] : A.alias.push(r) : A.alias = [r];
|
|
2050
|
-
}
|
|
2051
|
-
}
|
|
2052
|
-
}
|
|
2053
|
-
f(p.tokens);
|
|
2054
|
-
}), u.hooks.add("wrap", function(p) {
|
|
2055
|
-
if (p.type === "code-block") {
|
|
2056
|
-
for (var f = "", k = 0, C = p.classes.length; k < C; k++) {
|
|
2057
|
-
var P = p.classes[k], F = /language-(.+)/.exec(P);
|
|
2058
|
-
if (F) {
|
|
2059
|
-
f = F[1];
|
|
2060
|
-
break;
|
|
2061
|
-
}
|
|
2062
|
-
}
|
|
2063
|
-
var _ = u.languages[f];
|
|
2064
|
-
if (_)
|
|
2065
|
-
p.content = u.highlight(E(p.content), _, f);
|
|
2066
|
-
else if (f && f !== "none" && u.plugins.autoloader) {
|
|
2067
|
-
var A = "md-" + (/* @__PURE__ */ new Date()).valueOf() + "-" + Math.floor(Math.random() * 1e16);
|
|
2068
|
-
p.attributes.id = A, u.plugins.autoloader.loadLanguages(f, function() {
|
|
2069
|
-
var n = document.getElementById(A);
|
|
2070
|
-
n && (n.innerHTML = u.highlight(n.textContent, u.languages[f], f));
|
|
2071
|
-
});
|
|
2072
|
-
}
|
|
2073
|
-
}
|
|
2074
|
-
});
|
|
2075
|
-
var h = RegExp(u.languages.markup.tag.pattern.source, "gi"), a = {
|
|
2076
|
-
amp: "&",
|
|
2077
|
-
lt: "<",
|
|
2078
|
-
gt: ">",
|
|
2079
|
-
quot: '"'
|
|
2080
|
-
}, c = String.fromCodePoint || String.fromCharCode;
|
|
2081
|
-
function E(p) {
|
|
2082
|
-
var f = p.replace(h, "");
|
|
2083
|
-
return f = f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function(k, 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);
|
|
2087
|
-
} else {
|
|
2088
|
-
var F = a[C];
|
|
2089
|
-
return F || k;
|
|
2090
|
-
}
|
|
2091
|
-
}), f;
|
|
2092
|
-
}
|
|
2093
|
-
u.languages.md = u.languages.markdown;
|
|
2094
|
-
})(Prism);
|
|
2095
|
-
var Be = {}, Ve;
|
|
2096
|
-
function jn() {
|
|
2097
|
-
return Ve || (Ve = 1, (function() {
|
|
2098
|
-
if (typeof Prism > "u" || typeof document > "u")
|
|
2099
|
-
return;
|
|
2100
|
-
var u = "line-numbers", g = /\n(?!$)/g, t = Prism.plugins.lineNumbers = {
|
|
2101
|
-
/**
|
|
2102
|
-
* Get node for provided line number
|
|
2103
|
-
*
|
|
2104
|
-
* @param {Element} element pre element
|
|
2105
|
-
* @param {number} number line number
|
|
2106
|
-
* @returns {Element|undefined}
|
|
2107
|
-
*/
|
|
2108
|
-
getLine: function(h, a) {
|
|
2109
|
-
if (!(h.tagName !== "PRE" || !h.classList.contains(u))) {
|
|
2110
|
-
var c = h.querySelector(".line-numbers-rows");
|
|
2111
|
-
if (c) {
|
|
2112
|
-
var E = parseInt(h.getAttribute("data-start"), 10) || 1, p = E + (c.children.length - 1);
|
|
2113
|
-
a < E && (a = E), a > p && (a = p);
|
|
2114
|
-
var f = a - E;
|
|
2115
|
-
return c.children[f];
|
|
2116
|
-
}
|
|
2117
|
-
}
|
|
2118
|
-
},
|
|
2119
|
-
/**
|
|
2120
|
-
* Resizes the line numbers of the given element.
|
|
2121
|
-
*
|
|
2122
|
-
* This function will not add line numbers. It will only resize existing ones.
|
|
2123
|
-
*
|
|
2124
|
-
* @param {HTMLElement} element A `<pre>` element with line numbers.
|
|
2125
|
-
* @returns {void}
|
|
2126
|
-
*/
|
|
2127
|
-
resize: function(h) {
|
|
2128
|
-
v([h]);
|
|
2129
|
-
},
|
|
2130
|
-
/**
|
|
2131
|
-
* Whether the plugin can assume that the units font sizes and margins are not depended on the size of
|
|
2132
|
-
* the current viewport.
|
|
2133
|
-
*
|
|
2134
|
-
* Setting this to `true` will allow the plugin to do certain optimizations for better performance.
|
|
2135
|
-
*
|
|
2136
|
-
* Set this to `false` if you use any of the following CSS units: `vh`, `vw`, `vmin`, `vmax`.
|
|
2137
|
-
*
|
|
2138
|
-
* @type {boolean}
|
|
2139
|
-
*/
|
|
2140
|
-
assumeViewportIndependence: !0
|
|
2141
|
-
};
|
|
2142
|
-
function v(h) {
|
|
2143
|
-
if (h = h.filter(function(c) {
|
|
2144
|
-
var E = b(c), p = E["white-space"];
|
|
2145
|
-
return p === "pre-wrap" || p === "pre-line";
|
|
2146
|
-
}), h.length != 0) {
|
|
2147
|
-
var a = h.map(function(c) {
|
|
2148
|
-
var E = c.querySelector("code"), p = c.querySelector(".line-numbers-rows");
|
|
2149
|
-
if (!(!E || !p)) {
|
|
2150
|
-
var f = c.querySelector(".line-numbers-sizer"), k = E.textContent.split(g);
|
|
2151
|
-
f || (f = document.createElement("span"), f.className = "line-numbers-sizer", E.appendChild(f)), f.innerHTML = "0", f.style.display = "block";
|
|
2152
|
-
var C = f.getBoundingClientRect().height;
|
|
2153
|
-
return f.innerHTML = "", {
|
|
2154
|
-
element: c,
|
|
2155
|
-
lines: k,
|
|
2156
|
-
lineHeights: [],
|
|
2157
|
-
oneLinerHeight: C,
|
|
2158
|
-
sizer: f
|
|
2159
|
-
};
|
|
2160
|
-
}
|
|
2161
|
-
}).filter(Boolean);
|
|
2162
|
-
a.forEach(function(c) {
|
|
2163
|
-
var E = c.sizer, p = c.lines, f = c.lineHeights, k = c.oneLinerHeight;
|
|
2164
|
-
f[p.length - 1] = void 0, p.forEach(function(C, P) {
|
|
2165
|
-
if (C && C.length > 1) {
|
|
2166
|
-
var F = E.appendChild(document.createElement("span"));
|
|
2167
|
-
F.style.display = "block", F.textContent = C;
|
|
2168
|
-
} else
|
|
2169
|
-
f[P] = k;
|
|
2170
|
-
});
|
|
2171
|
-
}), a.forEach(function(c) {
|
|
2172
|
-
for (var E = c.sizer, p = c.lineHeights, f = 0, k = 0; k < p.length; k++)
|
|
2173
|
-
p[k] === void 0 && (p[k] = E.children[f++].getBoundingClientRect().height);
|
|
2174
|
-
}), a.forEach(function(c) {
|
|
2175
|
-
var E = c.sizer, p = c.element.querySelector(".line-numbers-rows");
|
|
2176
|
-
E.style.display = "none", E.innerHTML = "", c.lineHeights.forEach(function(f, k) {
|
|
2177
|
-
p.children[k].style.height = f + "px";
|
|
2178
|
-
});
|
|
2179
|
-
});
|
|
2180
|
-
}
|
|
2181
|
-
}
|
|
2182
|
-
function b(h) {
|
|
2183
|
-
return h ? window.getComputedStyle ? getComputedStyle(h) : h.currentStyle || null : null;
|
|
2184
|
-
}
|
|
2185
|
-
var x = void 0;
|
|
2186
|
-
window.addEventListener("resize", function() {
|
|
2187
|
-
t.assumeViewportIndependence && x === window.innerWidth || (x = window.innerWidth, v(Array.prototype.slice.call(document.querySelectorAll("pre." + u))));
|
|
2188
|
-
}), Prism.hooks.add("complete", function(h) {
|
|
2189
|
-
if (h.code) {
|
|
2190
|
-
var a = (
|
|
2191
|
-
/** @type {Element} */
|
|
2192
|
-
h.element
|
|
2193
|
-
), c = (
|
|
2194
|
-
/** @type {HTMLElement} */
|
|
2195
|
-
a.parentNode
|
|
2196
|
-
);
|
|
2197
|
-
if (!(!c || !/pre/i.test(c.nodeName)) && !a.querySelector(".line-numbers-rows") && Prism.util.isActive(a, u)) {
|
|
2198
|
-
a.classList.remove(u), c.classList.add(u);
|
|
2199
|
-
var E = h.code.match(g), p = E ? E.length + 1 : 1, f, k = new Array(p + 1).join("<span></span>");
|
|
2200
|
-
f = document.createElement("span"), f.setAttribute("aria-hidden", "true"), f.className = "line-numbers-rows", f.innerHTML = k, c.hasAttribute("data-start") && (c.style.counterReset = "linenumber " + (parseInt(c.getAttribute("data-start"), 10) - 1)), h.element.appendChild(f), v([c]), Prism.hooks.run("line-numbers", h);
|
|
2201
|
-
}
|
|
2202
|
-
}
|
|
2203
|
-
}), Prism.hooks.add("line-numbers", function(h) {
|
|
2204
|
-
h.plugins = h.plugins || {}, h.plugins.lineNumbers = !0;
|
|
2205
|
-
});
|
|
2206
|
-
})()), Be;
|
|
630
|
+
var Y = yr();
|
|
631
|
+
function Rr(a) {
|
|
632
|
+
const {
|
|
633
|
+
children: t,
|
|
634
|
+
showLineNumbers: i = !1,
|
|
635
|
+
className: h = "",
|
|
636
|
+
style: u = {},
|
|
637
|
+
topPadding: d = 16
|
|
638
|
+
} = a, g = 1, E = (typeof t == "string" ? t : "").split(`
|
|
639
|
+
`).map((b, R) => g + R);
|
|
640
|
+
return F.createElement("pre", {
|
|
641
|
+
className: `language-markdown ${i ? "line-numbers" : ""} ${h}`.trim(),
|
|
642
|
+
"data-start": g,
|
|
643
|
+
style: {
|
|
644
|
+
position: "relative",
|
|
645
|
+
counterReset: `linenumber ${g - 1}`,
|
|
646
|
+
...i ? { paddingLeft: "1.2em" } : {},
|
|
647
|
+
...u
|
|
648
|
+
}
|
|
649
|
+
}, [
|
|
650
|
+
F.createElement("code", {
|
|
651
|
+
key: "code",
|
|
652
|
+
className: "language-markdown"
|
|
653
|
+
}, t),
|
|
654
|
+
i && F.createElement("span", {
|
|
655
|
+
key: "line-numbers",
|
|
656
|
+
className: "line-numbers-rows",
|
|
657
|
+
"aria-hidden": "true",
|
|
658
|
+
style: {
|
|
659
|
+
position: "absolute",
|
|
660
|
+
pointerEvents: "none",
|
|
661
|
+
top: `${1 + d / 16}em`,
|
|
662
|
+
fontSize: "100%",
|
|
663
|
+
left: "0em",
|
|
664
|
+
width: "2.5em",
|
|
665
|
+
letterSpacing: "-1px",
|
|
666
|
+
borderRight: "1px solid #999",
|
|
667
|
+
userSelect: "none",
|
|
668
|
+
lineHeight: "1.5"
|
|
669
|
+
}
|
|
670
|
+
}, E.map(
|
|
671
|
+
(b, R) => F.createElement("span", {
|
|
672
|
+
key: R,
|
|
673
|
+
style: {
|
|
674
|
+
display: "block",
|
|
675
|
+
textAlign: "right",
|
|
676
|
+
paddingRight: "0.8em",
|
|
677
|
+
color: "#999",
|
|
678
|
+
lineHeight: "1.5"
|
|
679
|
+
}
|
|
680
|
+
}, b)
|
|
681
|
+
))
|
|
682
|
+
].filter(Boolean));
|
|
2207
683
|
}
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
return
|
|
684
|
+
function Pe(a) {
|
|
685
|
+
let t;
|
|
686
|
+
return a.useTabs ? t = " " : a.hasPadding ? t = " " : t = "", t;
|
|
2211
687
|
}
|
|
2212
|
-
class
|
|
688
|
+
class Er {
|
|
2213
689
|
padding;
|
|
2214
|
-
constructor(
|
|
2215
|
-
this.padding =
|
|
690
|
+
constructor(t) {
|
|
691
|
+
this.padding = Pe(t);
|
|
2216
692
|
}
|
|
2217
|
-
formatCell(
|
|
2218
|
-
const
|
|
2219
|
-
switch (
|
|
693
|
+
formatCell(t, i, h) {
|
|
694
|
+
const u = h;
|
|
695
|
+
switch (i) {
|
|
2220
696
|
case "right":
|
|
2221
|
-
return `${this.padding}${
|
|
697
|
+
return `${this.padding}${t.padStart(u)}${this.padding}`;
|
|
2222
698
|
case "center": {
|
|
2223
|
-
const
|
|
2224
|
-
return `${this.padding}${" ".repeat(
|
|
699
|
+
const d = u - t.length, g = Math.floor(d / 2), p = d - g;
|
|
700
|
+
return `${this.padding}${" ".repeat(g)}${t}${" ".repeat(p)}${this.padding}`;
|
|
2225
701
|
}
|
|
2226
702
|
default:
|
|
2227
|
-
return `${this.padding}${
|
|
703
|
+
return `${this.padding}${t.padEnd(u)}${this.padding}`;
|
|
2228
704
|
}
|
|
2229
705
|
}
|
|
2230
706
|
}
|
|
2231
|
-
class
|
|
707
|
+
class wr {
|
|
2232
708
|
static indicators = {
|
|
2233
|
-
left: (
|
|
2234
|
-
right: (
|
|
2235
|
-
center: (
|
|
2236
|
-
none: (
|
|
709
|
+
left: (t) => `:${"-".repeat(t - 1)}`,
|
|
710
|
+
right: (t) => `${"-".repeat(t - 1)}:`,
|
|
711
|
+
center: (t) => `:${"-".repeat(t - 2)}:`,
|
|
712
|
+
none: (t) => "-".repeat(t)
|
|
2237
713
|
};
|
|
2238
|
-
static formatIndicator(
|
|
2239
|
-
return this.indicators[
|
|
714
|
+
static formatIndicator(t, i) {
|
|
715
|
+
return this.indicators[t](i);
|
|
2240
716
|
}
|
|
2241
717
|
}
|
|
2242
|
-
class
|
|
718
|
+
class _r {
|
|
2243
719
|
config;
|
|
2244
720
|
cellFormatter;
|
|
2245
721
|
adjustedAlignments;
|
|
2246
|
-
constructor(
|
|
2247
|
-
this.config =
|
|
722
|
+
constructor(t) {
|
|
723
|
+
this.config = t, this.cellFormatter = new Er(t), this.adjustedAlignments = this.getAdjustedAlignments();
|
|
2248
724
|
}
|
|
2249
725
|
getAdjustedAlignments() {
|
|
2250
726
|
return this.config.columnAlignments.length < this.config.columnCount ? [
|
|
@@ -2252,207 +728,196 @@ class In {
|
|
|
2252
728
|
...Array(this.config.columnCount - this.config.columnAlignments.length).fill("none")
|
|
2253
729
|
] : Array.from(this.config.columnAlignments);
|
|
2254
730
|
}
|
|
2255
|
-
formatRow(
|
|
2256
|
-
return `|${Array.from({ length: this.config.columnCount }, (
|
|
2257
|
-
let
|
|
2258
|
-
this.config.replaceNewlines && (
|
|
2259
|
-
const
|
|
2260
|
-
return this.cellFormatter.formatCell(
|
|
731
|
+
formatRow(t) {
|
|
732
|
+
return `|${Array.from({ length: this.config.columnCount }, (h, u) => {
|
|
733
|
+
let d = t[u] ?? "";
|
|
734
|
+
this.config.replaceNewlines && (d = d.replace(/\n/g, "<br>"));
|
|
735
|
+
const g = this.adjustedAlignments[u], p = this.config.columnWidths ? this.config.columnWidths[u] : d.length;
|
|
736
|
+
return this.cellFormatter.formatCell(d, g, p);
|
|
2261
737
|
}).join("|")}|`;
|
|
2262
738
|
}
|
|
2263
739
|
formatAlignmentRow() {
|
|
2264
|
-
const
|
|
2265
|
-
return `|${Array.from({ length: this.config.columnCount }, (
|
|
2266
|
-
const
|
|
2267
|
-
return `${
|
|
740
|
+
const t = Pe(this.config);
|
|
741
|
+
return `|${Array.from({ length: this.config.columnCount }, (h, u) => {
|
|
742
|
+
const d = this.adjustedAlignments[u], g = this.config.columnWidths ? this.config.columnWidths[u] : 3, p = wr.formatIndicator(d, g);
|
|
743
|
+
return `${t}${p}${t}`;
|
|
2268
744
|
}).join("|")}|`;
|
|
2269
745
|
}
|
|
2270
746
|
}
|
|
2271
|
-
function
|
|
2272
|
-
const
|
|
2273
|
-
return
|
|
2274
|
-
for (let
|
|
2275
|
-
const
|
|
2276
|
-
|
|
2277
|
-
}
|
|
2278
|
-
}),
|
|
747
|
+
function Cr(a, t) {
|
|
748
|
+
const i = new Array(t).fill(3);
|
|
749
|
+
return a.forEach((h) => {
|
|
750
|
+
for (let u = 0; u < t; u++) {
|
|
751
|
+
const d = h[u] ?? "";
|
|
752
|
+
i[u] = Math.max(i[u], d.length);
|
|
753
|
+
}
|
|
754
|
+
}), i;
|
|
2279
755
|
}
|
|
2280
|
-
function
|
|
2281
|
-
const
|
|
2282
|
-
return Math.max(
|
|
756
|
+
function xr(a) {
|
|
757
|
+
const t = a.inputDataHeader.length, i = a.inputDataBody.map((h) => h.length);
|
|
758
|
+
return Math.max(t, ...i);
|
|
2283
759
|
}
|
|
2284
|
-
function
|
|
2285
|
-
return
|
|
2286
|
-
[
|
|
2287
|
-
|
|
760
|
+
function Tr(a, t, i) {
|
|
761
|
+
return i ? Cr(
|
|
762
|
+
[a.inputDataHeader, ...a.inputDataBody],
|
|
763
|
+
t
|
|
2288
764
|
) : void 0;
|
|
2289
765
|
}
|
|
2290
|
-
function
|
|
2291
|
-
const
|
|
2292
|
-
columnCount:
|
|
2293
|
-
columnAlignments:
|
|
2294
|
-
columnWidths:
|
|
2295
|
-
useTabs:
|
|
2296
|
-
replaceNewlines:
|
|
2297
|
-
hasPadding:
|
|
2298
|
-
}, E = new
|
|
766
|
+
function Sr(a, t, i = !0, h = !1, u = !1, d = !0) {
|
|
767
|
+
const g = xr(a), p = Tr(a, g, i), m = {
|
|
768
|
+
columnCount: g,
|
|
769
|
+
columnAlignments: t,
|
|
770
|
+
columnWidths: p,
|
|
771
|
+
useTabs: h,
|
|
772
|
+
replaceNewlines: u,
|
|
773
|
+
hasPadding: d
|
|
774
|
+
}, E = new _r(m), b = E.formatRow(a.inputDataHeader), R = E.formatAlignmentRow(), x = a.inputDataBody.map((S) => E.formatRow(S)).join(`
|
|
2299
775
|
`);
|
|
2300
|
-
return `${
|
|
2301
|
-
${
|
|
2302
|
-
${
|
|
776
|
+
return `${b}
|
|
777
|
+
${R}
|
|
778
|
+
${x}`.trimEnd();
|
|
2303
779
|
}
|
|
2304
|
-
function
|
|
2305
|
-
let
|
|
2306
|
-
for (;
|
|
2307
|
-
|
|
2308
|
-
return
|
|
780
|
+
function kr(a) {
|
|
781
|
+
let t = "", i = a;
|
|
782
|
+
for (; i >= 0; )
|
|
783
|
+
t = String.fromCharCode(i % 26 + 65) + t, i = Math.floor(i / 26) - 1;
|
|
784
|
+
return t;
|
|
2309
785
|
}
|
|
2310
|
-
function
|
|
2311
|
-
return Array.from({ length:
|
|
786
|
+
function Or(a) {
|
|
787
|
+
return Array.from({ length: a }, (t, i) => kr(i));
|
|
2312
788
|
}
|
|
2313
|
-
class
|
|
2314
|
-
constructor(
|
|
2315
|
-
super(
|
|
789
|
+
class L extends Error {
|
|
790
|
+
constructor(t, i) {
|
|
791
|
+
super(t, i), this.name = "MarkdownTableError", Object.setPrototypeOf(this, L.prototype);
|
|
2316
792
|
}
|
|
2317
793
|
}
|
|
2318
|
-
function
|
|
2319
|
-
if (
|
|
2320
|
-
throw new
|
|
2321
|
-
if (
|
|
2322
|
-
throw new
|
|
794
|
+
function jr(a) {
|
|
795
|
+
if (a === null || !Array.isArray(a))
|
|
796
|
+
throw new L("The 'data' prop must be a two-dimensional array.");
|
|
797
|
+
if (a.length === 0)
|
|
798
|
+
throw new L("The 'data' array must contain at least one row.");
|
|
799
|
+
}
|
|
800
|
+
function Pr(a) {
|
|
801
|
+
return a === "light" ? {
|
|
802
|
+
textColor: "#000",
|
|
803
|
+
textShadow: "0 1px #fff",
|
|
804
|
+
background: "#f5f2f0",
|
|
805
|
+
selectionBackground: "#b3d4fc"
|
|
806
|
+
} : {
|
|
807
|
+
textColor: "#f8f8f2",
|
|
808
|
+
textShadow: "0 1px rgba(0,0,0,.3)",
|
|
809
|
+
background: "#282a36",
|
|
810
|
+
selectionBackground: "#b3d4fc",
|
|
811
|
+
borderRadius: ".3em"
|
|
812
|
+
};
|
|
2323
813
|
}
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
code[class*=language-],pre[class*=language-]{color
|
|
814
|
+
function Ar(a) {
|
|
815
|
+
const t = Pr(a);
|
|
816
|
+
return `
|
|
817
|
+
code[class*=language-],pre[class*=language-]{color:${t.textColor};background:0 0;text-shadow:${t.textShadow};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:${t.selectionBackground}}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:${t.selectionBackground}}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:visible${t.borderRadius ? `;border-radius:${t.borderRadius}` : ""}}:not(pre)>code[class*=language-],pre[class*=language-]{background:${t.background}}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}pre[class*=language-].line-numbers{position:relative;padding-left:3.8em}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}
|
|
2328
818
|
`;
|
|
2329
|
-
function Yn(u, g) {
|
|
2330
|
-
return g ? { inputDataHeader: u[0], inputDataBody: u.slice(1) } : { inputDataHeader: Wn(u[0].length), inputDataBody: u };
|
|
2331
819
|
}
|
|
2332
|
-
function
|
|
820
|
+
function $r(a, t) {
|
|
821
|
+
return t ? { inputDataHeader: a[0], inputDataBody: a.slice(1) } : { inputDataHeader: Or(a[0].length), inputDataBody: a };
|
|
822
|
+
}
|
|
823
|
+
function Fr(a, t, i, h, u, d, g) {
|
|
2333
824
|
try {
|
|
2334
|
-
|
|
2335
|
-
const { inputDataHeader:
|
|
2336
|
-
return
|
|
2337
|
-
{ inputDataHeader:
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
825
|
+
jr(a);
|
|
826
|
+
const { inputDataHeader: p, inputDataBody: m } = $r(a, t);
|
|
827
|
+
return Sr(
|
|
828
|
+
{ inputDataHeader: p, inputDataBody: m },
|
|
829
|
+
i,
|
|
830
|
+
h,
|
|
831
|
+
u,
|
|
832
|
+
d,
|
|
833
|
+
g
|
|
2343
834
|
);
|
|
2344
|
-
} catch (
|
|
2345
|
-
if (
|
|
2346
|
-
return `Error: ${
|
|
2347
|
-
throw
|
|
835
|
+
} catch (p) {
|
|
836
|
+
if (p instanceof L)
|
|
837
|
+
return `Error: ${p.message}`;
|
|
838
|
+
throw p;
|
|
2348
839
|
}
|
|
2349
840
|
}
|
|
2350
|
-
function
|
|
2351
|
-
inputData:
|
|
2352
|
-
hasHeader:
|
|
2353
|
-
columnAlignments:
|
|
2354
|
-
isCompact:
|
|
2355
|
-
hasTabs:
|
|
2356
|
-
hasPadding:
|
|
2357
|
-
convertLineBreaks:
|
|
2358
|
-
className:
|
|
2359
|
-
onGenerate:
|
|
841
|
+
function Ir({
|
|
842
|
+
inputData: a = null,
|
|
843
|
+
hasHeader: t = !0,
|
|
844
|
+
columnAlignments: i = [],
|
|
845
|
+
isCompact: h = !1,
|
|
846
|
+
hasTabs: u = !1,
|
|
847
|
+
hasPadding: d = !0,
|
|
848
|
+
convertLineBreaks: g = !1,
|
|
849
|
+
className: p,
|
|
850
|
+
onGenerate: m,
|
|
2360
851
|
theme: E = "light",
|
|
2361
|
-
preStyle:
|
|
2362
|
-
topPadding:
|
|
2363
|
-
minWidth:
|
|
2364
|
-
showLineNumbers:
|
|
852
|
+
preStyle: b,
|
|
853
|
+
topPadding: R = 16,
|
|
854
|
+
minWidth: x,
|
|
855
|
+
showLineNumbers: S = !0
|
|
2365
856
|
}) {
|
|
2366
|
-
const
|
|
2367
|
-
|
|
2368
|
-
g,
|
|
857
|
+
const B = gr(), z = pr(a), D = mr(() => Fr(
|
|
858
|
+
z,
|
|
2369
859
|
t,
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
x
|
|
2374
|
-
), [
|
|
2375
|
-
_,
|
|
860
|
+
i,
|
|
861
|
+
!h,
|
|
862
|
+
u,
|
|
2376
863
|
g,
|
|
864
|
+
d
|
|
865
|
+
), [
|
|
866
|
+
z,
|
|
2377
867
|
t,
|
|
2378
|
-
|
|
2379
|
-
b,
|
|
868
|
+
i,
|
|
2380
869
|
h,
|
|
2381
|
-
|
|
870
|
+
u,
|
|
871
|
+
g,
|
|
872
|
+
d
|
|
2382
873
|
]);
|
|
2383
|
-
return
|
|
2384
|
-
|
|
2385
|
-
}, [
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
requestAnimationFrame(() => {
|
|
2389
|
-
if ($n.highlightElement(r), C && !o.querySelector(".line-numbers-rows")) {
|
|
2390
|
-
const l = n.split(`
|
|
2391
|
-
`).length, m = document.createElement("span");
|
|
2392
|
-
m.setAttribute("aria-hidden", "true"), m.className = "line-numbers-rows";
|
|
2393
|
-
const S = new Array(l).fill(null).map((y, O) => `<span data-line="${O + 1}"></span>`).join("");
|
|
2394
|
-
m.innerHTML = S, o.appendChild(m), o.style.counterReset !== "linenumber" && (o.style.counterReset = "linenumber");
|
|
2395
|
-
}
|
|
2396
|
-
if (!C && o) {
|
|
2397
|
-
const s = o.querySelector(".line-numbers-rows");
|
|
2398
|
-
s && s.remove();
|
|
2399
|
-
}
|
|
2400
|
-
});
|
|
2401
|
-
});
|
|
2402
|
-
}, [n, A, C]), /* @__PURE__ */ se.jsxs(se.Fragment, { children: [
|
|
2403
|
-
/* @__PURE__ */ se.jsxs("style", { children: [
|
|
2404
|
-
E === "light" ? qn : Un,
|
|
874
|
+
return hr(() => {
|
|
875
|
+
m && m(D);
|
|
876
|
+
}, [D, m]), /* @__PURE__ */ Y.jsxs(Y.Fragment, { children: [
|
|
877
|
+
/* @__PURE__ */ Y.jsxs("style", { children: [
|
|
878
|
+
Ar(E),
|
|
2405
879
|
`
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
880
|
+
/* Add top spacing for the table content */
|
|
881
|
+
pre > code {
|
|
882
|
+
display: block;
|
|
883
|
+
padding-top: ${R}px !important;
|
|
884
|
+
padding-left: 3em !important;
|
|
2409
885
|
}
|
|
2410
|
-
|
|
2411
|
-
position: absolute;
|
|
2412
|
-
top: 8px;
|
|
2413
|
-
left: 12px;
|
|
2414
|
-
color: ${E === "light" ? "#666" : "#999"};
|
|
2415
|
-
letter-spacing: 2px;
|
|
2416
|
-
font-size: 12px;
|
|
2417
|
-
}
|
|
2418
|
-
/* Hide line numbers when showLineNumbers is false */
|
|
886
|
+
/* Hide line numbers when disabled */
|
|
2419
887
|
pre:not(.line-numbers) .line-numbers-rows {
|
|
2420
888
|
display: none !important;
|
|
2421
889
|
}
|
|
2422
|
-
/* Remove left padding when line numbers are hidden */
|
|
2423
|
-
pre:not(.line-numbers) {
|
|
2424
|
-
padding-left: 1em !important;
|
|
2425
|
-
}
|
|
2426
890
|
pre:not(.line-numbers) > code {
|
|
2427
|
-
padding-left: 0 !important;
|
|
891
|
+
padding-left: 0.3em !important;
|
|
2428
892
|
}
|
|
2429
|
-
/*
|
|
2430
|
-
.line-numbers-rows
|
|
2431
|
-
|
|
893
|
+
/* Ensure line numbers are visible */
|
|
894
|
+
.line-numbers .line-numbers-rows {
|
|
895
|
+
display: block !important;
|
|
2432
896
|
}
|
|
2433
897
|
`
|
|
2434
898
|
] }),
|
|
2435
|
-
/* @__PURE__ */
|
|
899
|
+
/* @__PURE__ */ Y.jsx(
|
|
2436
900
|
"div",
|
|
2437
901
|
{
|
|
2438
|
-
id:
|
|
902
|
+
id: B,
|
|
2439
903
|
style: {
|
|
2440
904
|
position: "relative",
|
|
2441
905
|
isolation: "isolate",
|
|
2442
906
|
display: "inline-block"
|
|
2443
907
|
},
|
|
2444
|
-
children: /* @__PURE__ */
|
|
2445
|
-
|
|
908
|
+
children: /* @__PURE__ */ Y.jsx(
|
|
909
|
+
Rr,
|
|
2446
910
|
{
|
|
2447
|
-
|
|
2448
|
-
className: `${
|
|
911
|
+
showLineNumbers: S,
|
|
912
|
+
className: `${E === "dark" ? "dark-theme" : ""} ${p || ""}`.trim(),
|
|
913
|
+
topPadding: R,
|
|
2449
914
|
style: {
|
|
2450
915
|
width: "fit-content",
|
|
2451
|
-
minWidth:
|
|
916
|
+
minWidth: x ? `${x}px` : "min-content",
|
|
2452
917
|
margin: 0,
|
|
2453
|
-
...
|
|
918
|
+
...b
|
|
2454
919
|
},
|
|
2455
|
-
children:
|
|
920
|
+
children: D
|
|
2456
921
|
}
|
|
2457
922
|
)
|
|
2458
923
|
}
|
|
@@ -2460,6 +925,6 @@ function Gn({
|
|
|
2460
925
|
] });
|
|
2461
926
|
}
|
|
2462
927
|
export {
|
|
2463
|
-
|
|
2464
|
-
|
|
928
|
+
Ir as MarkdownTable,
|
|
929
|
+
L as MarkdownTableError
|
|
2465
930
|
};
|