storybook 10.1.0-alpha.9 → 10.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_browser-chunks/Color-FTG7SQDA.js +1097 -0
- package/dist/_browser-chunks/WithTooltip-LMROHDUP.js +1651 -0
- package/dist/_browser-chunks/chunk-2FRVAXCZ.js +7 -0
- package/dist/_browser-chunks/{chunk-FDWKXLBI.js → chunk-2XZMBGTA.js} +44 -109
- package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
- package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
- package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
- package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
- package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
- package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
- package/dist/_browser-chunks/chunk-AIOS4NGK.js +252 -0
- package/dist/_browser-chunks/chunk-AS2HQEYC.js +14 -0
- package/dist/_browser-chunks/chunk-AXG2BOBL.js +836 -0
- package/dist/_browser-chunks/{chunk-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
- package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
- package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
- package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
- package/dist/_browser-chunks/chunk-FQ7SLVLR.js +66 -0
- package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
- package/dist/_browser-chunks/chunk-GFY5R5EY.js +47 -0
- package/dist/_browser-chunks/{chunk-L2D73C6Z.js → chunk-H6XK3RSC.js} +13 -21
- package/dist/_browser-chunks/chunk-IPA5A322.js +71 -0
- package/dist/_browser-chunks/chunk-JP7NCOJX.js +37 -0
- package/dist/_browser-chunks/chunk-KJHJLCBK.js +11 -0
- package/dist/_browser-chunks/{chunk-OWPZQM2D.js → chunk-L4RMQ7D7.js} +60 -110
- package/dist/_browser-chunks/chunk-P4F4UVXX.js +951 -0
- package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
- package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
- package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
- package/dist/_browser-chunks/chunk-SS2NHR7W.js +2969 -0
- package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
- package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
- package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -0
- package/dist/_browser-chunks/chunk-XJNX76GA.js +85 -0
- package/dist/_browser-chunks/{chunk-F4Q6SGTB.js → chunk-YKE5S47A.js} +177 -399
- package/dist/_browser-chunks/{chunk-SN4J4IQ3.js → chunk-ZUWEVLDX.js} +1 -7
- package/dist/_browser-chunks/{formatter-OMEEQ6HG.js → formatter-QJ4M4OGQ.js} +4 -9
- package/dist/_browser-chunks/{syntaxhighlighter-CAVLW7PM.js → syntaxhighlighter-IQDEPFLK.js} +704 -1848
- package/dist/_node-chunks/{builder-manager-SM3UWERX.js → builder-manager-BDAQHXFI.js} +510 -1019
- package/dist/_node-chunks/camelcase-3C7DZZPX.js +37 -0
- package/dist/_node-chunks/chunk-2IIQTGNE.js +6024 -0
- package/dist/_node-chunks/chunk-56U5LEMP.js +3043 -0
- package/dist/_node-chunks/chunk-7LIRCAQE.js +20 -0
- package/dist/_node-chunks/chunk-7RN6TXKP.js +603 -0
- package/dist/_node-chunks/chunk-7SJ7PZNL.js +4523 -0
- package/dist/_node-chunks/{chunk-HHSTA6QS.js → chunk-BG4RDXG7.js} +8 -10
- package/dist/_node-chunks/chunk-CBQKMXLQ.js +18 -0
- package/dist/_node-chunks/chunk-CN2IW2KQ.js +1564 -0
- package/dist/_node-chunks/chunk-CQMAU6UQ.js +943 -0
- package/dist/_node-chunks/{chunk-EBUEXRH5.js → chunk-D6ND3TVY.js} +116 -276
- package/dist/_node-chunks/chunk-DC355CYB.js +61 -0
- package/dist/_node-chunks/{chunk-SGM3ZCCT.js → chunk-EVK2SBW5.js} +292 -688
- package/dist/_node-chunks/chunk-IXWEUXJ2.js +119 -0
- package/dist/_node-chunks/{chunk-F6EFOEC7.js → chunk-KVRF22SH.js} +469 -983
- package/dist/_node-chunks/chunk-LEDP4QQW.js +919 -0
- package/dist/_node-chunks/{chunk-GHIBZRKD.js → chunk-MMVV6DGG.js} +8133 -8887
- package/dist/_node-chunks/chunk-O5CGEVRI.js +29 -0
- package/dist/_node-chunks/chunk-OZZO56XN.js +299 -0
- package/dist/_node-chunks/chunk-POT2EVGD.js +78 -0
- package/dist/_node-chunks/chunk-R5YGFSTV.js +3781 -0
- package/dist/_node-chunks/chunk-SQCTM2OS.js +23 -0
- package/dist/_node-chunks/chunk-UFOFO5H7.js +54 -0
- package/dist/_node-chunks/chunk-VBF7ALJF.js +72 -0
- package/dist/_node-chunks/chunk-W6MAMTUF.js +70 -0
- package/dist/_node-chunks/chunk-WURL4XOT.js +46662 -0
- package/dist/_node-chunks/chunk-XGK6MVKR.js +61 -0
- package/dist/_node-chunks/chunk-YV3GDSDT.js +765 -0
- package/dist/_node-chunks/{chunk-ATDHMMIZ.js → chunk-YWV55YW3.js} +15 -24
- package/dist/_node-chunks/dist-KEP4IFRN.js +121 -0
- package/dist/_node-chunks/globby-4WUBTDCN.js +3452 -0
- package/dist/_node-chunks/lib-JVOEKTYM.js +366 -0
- package/dist/_node-chunks/mdx-N42X6CFJ-C5WFYYXR.js +14329 -0
- package/dist/_node-chunks/p-limit-LDY632RS.js +116 -0
- package/dist/actions/decorator.js +21 -42
- package/dist/actions/index.js +3 -3
- package/dist/babel/index.d.ts +671 -335
- package/dist/babel/index.js +10 -11
- package/dist/bin/core.js +601 -1548
- package/dist/bin/dispatcher.js +36 -36
- package/dist/bin/loader.js +24 -38
- package/dist/channels/index.js +98 -234
- package/dist/cli/index.d.ts +1479 -133
- package/dist/cli/index.js +30 -8540
- package/dist/client-logger/index.js +31 -61
- package/dist/common/index.d.ts +139 -62
- package/dist/common/index.js +66 -51
- package/dist/components/index.d.ts +575 -273
- package/dist/components/index.js +14863 -4313
- package/dist/core-events/index.js +2 -66
- package/dist/core-server/index.d.ts +3 -2
- package/dist/core-server/index.js +2908 -8518
- package/dist/core-server/presets/common-manager.css +2 -2
- package/dist/core-server/presets/common-manager.js +2521 -5233
- package/dist/core-server/presets/common-override-preset.js +31 -60
- package/dist/core-server/presets/common-preset.js +663 -962
- package/dist/csf/index.js +534 -1179
- package/dist/csf-tools/index.js +9 -9
- package/dist/docs-tools/index.js +6 -6
- package/dist/highlight/index.js +2 -2
- package/dist/instrumenter/index.js +199 -415
- package/dist/manager/globals-runtime.js +59044 -67141
- package/dist/manager/globals.js +2 -3
- package/dist/manager/manager-stores.d.ts +1 -0
- package/dist/manager/manager-stores.js +23 -0
- package/dist/manager/runtime.js +11511 -10953
- package/dist/manager-api/index.d.ts +1811 -2
- package/dist/manager-api/index.js +1348 -2401
- package/dist/manager-errors.d.ts +9 -0
- package/dist/manager-errors.js +3 -3
- package/dist/mocking-utils/index.d.ts +1126 -0
- package/dist/mocking-utils/index.js +1181 -0
- package/dist/node-logger/index.d.ts +192 -24
- package/dist/node-logger/index.js +23 -4471
- package/dist/preview/globals.js +2 -3
- package/dist/preview/runtime.js +10799 -22393
- package/dist/preview-api/index.d.ts +68 -69
- package/dist/preview-api/index.js +13 -13
- package/dist/preview-errors.d.ts +9 -0
- package/dist/preview-errors.js +4 -4
- package/dist/router/index.js +347 -899
- package/dist/server-errors.d.ts +34 -1
- package/dist/server-errors.js +17 -10
- package/dist/telemetry/index.d.ts +24 -3
- package/dist/telemetry/index.js +25 -24
- package/dist/test/index.js +6131 -11916
- package/dist/theming/create.d.ts +1 -0
- package/dist/theming/create.js +4 -4
- package/dist/theming/index.d.ts +3366 -2599
- package/dist/theming/index.js +501 -1091
- package/dist/types/index.d.ts +72 -8
- package/dist/types/index.js +27 -12
- package/dist/viewport/index.js +3 -3
- package/package.json +26 -17
- package/dist/_browser-chunks/Color-7ZNS6F6B.js +0 -1676
- package/dist/_browser-chunks/WithTooltip-SK46ZJ2J.js +0 -13
- package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
- package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
- package/dist/_browser-chunks/chunk-BOOOPFZF.js +0 -2335
- package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
- package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
- package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
- package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
- package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
- package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
- package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
- package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
- package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
- package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
- package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
- package/dist/_browser-chunks/chunk-RNE2IUTB.js +0 -1300
- package/dist/_browser-chunks/chunk-RW5PKMWM.js +0 -4182
- package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
- package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
- package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
- package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
- package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
- package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
- package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
- package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
- package/dist/_node-chunks/camelcase-H5QSGQLK.js +0 -18
- package/dist/_node-chunks/chunk-3THWHQOC.js +0 -61
- package/dist/_node-chunks/chunk-45YUOLTU.js +0 -69
- package/dist/_node-chunks/chunk-4QSNCPAU.js +0 -64656
- package/dist/_node-chunks/chunk-744PQSOU.js +0 -79
- package/dist/_node-chunks/chunk-74Z2U7QG.js +0 -1544
- package/dist/_node-chunks/chunk-7MB7TFPO.js +0 -1198
- package/dist/_node-chunks/chunk-A7GS4RFT.js +0 -697
- package/dist/_node-chunks/chunk-BIA3A5UM.js +0 -61
- package/dist/_node-chunks/chunk-C5G7CLWX.js +0 -1657
- package/dist/_node-chunks/chunk-DLFUKMYJ.js +0 -1531
- package/dist/_node-chunks/chunk-EMRGRXKT.js +0 -111
- package/dist/_node-chunks/chunk-EX46EHHY.js +0 -420
- package/dist/_node-chunks/chunk-F76QKNOJ.js +0 -304
- package/dist/_node-chunks/chunk-HDCRUTEF.js +0 -220
- package/dist/_node-chunks/chunk-HUYAOIPH.js +0 -90
- package/dist/_node-chunks/chunk-IBJZQZJC.js +0 -101
- package/dist/_node-chunks/chunk-KZN2RDDT.js +0 -6712
- package/dist/_node-chunks/chunk-LYUNFU3F.js +0 -4741
- package/dist/_node-chunks/chunk-N44SIS6K.js +0 -28
- package/dist/_node-chunks/chunk-NILZM6KR.js +0 -18
- package/dist/_node-chunks/chunk-PC4ZRP6W.js +0 -34
- package/dist/_node-chunks/chunk-TJNGOQUH.js +0 -4272
- package/dist/_node-chunks/chunk-UBSYLHIL.js +0 -1250
- package/dist/_node-chunks/chunk-UTCLXPOC.js +0 -1518
- package/dist/_node-chunks/chunk-WOXXODXP.js +0 -5029
- package/dist/_node-chunks/chunk-XC4MEUA6.js +0 -1586
- package/dist/_node-chunks/chunk-YRXXMKRR.js +0 -2256
- package/dist/_node-chunks/dist-SL73W244.js +0 -175
- package/dist/_node-chunks/globby-ZSHAUQZ5.js +0 -5222
- package/dist/_node-chunks/lib-U2VIPUTI.js +0 -518
- package/dist/_node-chunks/mdx-N42X6CFJ-ZLHD33JK.js +0 -22017
- package/dist/_node-chunks/p-limit-K5BS5MSV.js +0 -168
- package/dist/_node-chunks/plugin-5PD4YIUH.js +0 -129
- package/dist/_node-chunks/plugin-MONDT2WL.js +0 -159
- package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-EUZJRG3W.js +0 -69102
- package/dist/_node-chunks/webpack-mock-plugin-T4LDXEHE.js +0 -124
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -36
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -33
package/dist/_browser-chunks/{syntaxhighlighter-CAVLW7PM.js → syntaxhighlighter-IQDEPFLK.js}
RENAMED
|
@@ -2,23 +2,22 @@ import {
|
|
|
2
2
|
ActionBar,
|
|
3
3
|
ScrollArea,
|
|
4
4
|
createCopyToClipboardFunction
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-P4F4UVXX.js";
|
|
6
6
|
import {
|
|
7
7
|
_defineProperty,
|
|
8
8
|
_objectWithoutProperties
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-H6XK3RSC.js";
|
|
10
|
+
import "./chunk-45UGUKRX.js";
|
|
11
11
|
import {
|
|
12
12
|
_extends
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-CHUV5WSW.js";
|
|
14
14
|
import {
|
|
15
15
|
require_memoizerific
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WJYERY3R.js";
|
|
17
17
|
import {
|
|
18
18
|
__commonJS,
|
|
19
|
-
__name,
|
|
20
19
|
__toESM
|
|
21
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-A242L54C.js";
|
|
22
21
|
|
|
23
22
|
// ../node_modules/refractor/lang/bash.js
|
|
24
23
|
var require_bash = __commonJS({
|
|
@@ -28,18 +27,15 @@ var require_bash = __commonJS({
|
|
|
28
27
|
bash2.displayName = "bash";
|
|
29
28
|
bash2.aliases = ["shell"];
|
|
30
29
|
function bash2(Prism) {
|
|
31
|
-
;
|
|
32
30
|
(function(Prism2) {
|
|
33
|
-
var envVars = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b"
|
|
34
|
-
var commandAfterHeredoc = {
|
|
31
|
+
var envVars = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", commandAfterHeredoc = {
|
|
35
32
|
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
36
|
-
lookbehind:
|
|
33
|
+
lookbehind: !0,
|
|
37
34
|
alias: "punctuation",
|
|
38
35
|
// this looks reasonably well in all themes
|
|
39
36
|
inside: null
|
|
40
37
|
// see below
|
|
41
|
-
}
|
|
42
|
-
var insideString = {
|
|
38
|
+
}, insideString = {
|
|
43
39
|
bash: commandAfterHeredoc,
|
|
44
40
|
environment: {
|
|
45
41
|
pattern: RegExp("\\$" + envVars),
|
|
@@ -49,13 +45,13 @@ var require_bash = __commonJS({
|
|
|
49
45
|
// [0]: Arithmetic Environment
|
|
50
46
|
{
|
|
51
47
|
pattern: /\$?\(\([\s\S]+?\)\)/,
|
|
52
|
-
greedy:
|
|
48
|
+
greedy: !0,
|
|
53
49
|
inside: {
|
|
54
50
|
// If there is a $ sign at the beginning highlight $(( and )) as variable
|
|
55
51
|
variable: [
|
|
56
52
|
{
|
|
57
53
|
pattern: /(^\$\(\([\s\S]+)\)\)/,
|
|
58
|
-
lookbehind:
|
|
54
|
+
lookbehind: !0
|
|
59
55
|
},
|
|
60
56
|
/^\$\(\(/
|
|
61
57
|
],
|
|
@@ -69,7 +65,7 @@ var require_bash = __commonJS({
|
|
|
69
65
|
// [1]: Command Substitution
|
|
70
66
|
{
|
|
71
67
|
pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
|
|
72
|
-
greedy:
|
|
68
|
+
greedy: !0,
|
|
73
69
|
inside: {
|
|
74
70
|
variable: /^\$\(|^`|\)$|`$/
|
|
75
71
|
}
|
|
@@ -77,13 +73,13 @@ var require_bash = __commonJS({
|
|
|
77
73
|
// [2]: Brace expansion
|
|
78
74
|
{
|
|
79
75
|
pattern: /\$\{[^}]+\}/,
|
|
80
|
-
greedy:
|
|
76
|
+
greedy: !0,
|
|
81
77
|
inside: {
|
|
82
78
|
operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
|
|
83
79
|
punctuation: /[\[\]]/,
|
|
84
80
|
environment: {
|
|
85
81
|
pattern: RegExp("(\\{)" + envVars),
|
|
86
|
-
lookbehind:
|
|
82
|
+
lookbehind: !0,
|
|
87
83
|
alias: "constant"
|
|
88
84
|
}
|
|
89
85
|
}
|
|
@@ -100,7 +96,7 @@ var require_bash = __commonJS({
|
|
|
100
96
|
},
|
|
101
97
|
comment: {
|
|
102
98
|
pattern: /(^|[^"{\\$])#.*/,
|
|
103
|
-
lookbehind:
|
|
99
|
+
lookbehind: !0
|
|
104
100
|
},
|
|
105
101
|
"function-name": [
|
|
106
102
|
// a) function foo {
|
|
@@ -110,7 +106,7 @@ var require_bash = __commonJS({
|
|
|
110
106
|
{
|
|
111
107
|
// a) and c)
|
|
112
108
|
pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
|
|
113
|
-
lookbehind:
|
|
109
|
+
lookbehind: !0,
|
|
114
110
|
alias: "function"
|
|
115
111
|
},
|
|
116
112
|
{
|
|
@@ -123,7 +119,7 @@ var require_bash = __commonJS({
|
|
|
123
119
|
"for-or-select": {
|
|
124
120
|
pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
|
|
125
121
|
alias: "variable",
|
|
126
|
-
lookbehind:
|
|
122
|
+
lookbehind: !0
|
|
127
123
|
},
|
|
128
124
|
// Highlight variable names as variables in the left-hand part
|
|
129
125
|
// of assignments (“=” and “+=”).
|
|
@@ -132,27 +128,27 @@ var require_bash = __commonJS({
|
|
|
132
128
|
inside: {
|
|
133
129
|
environment: {
|
|
134
130
|
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + envVars),
|
|
135
|
-
lookbehind:
|
|
131
|
+
lookbehind: !0,
|
|
136
132
|
alias: "constant"
|
|
137
133
|
}
|
|
138
134
|
},
|
|
139
135
|
alias: "variable",
|
|
140
|
-
lookbehind:
|
|
136
|
+
lookbehind: !0
|
|
141
137
|
},
|
|
142
138
|
string: [
|
|
143
139
|
// Support for Here-documents https://en.wikipedia.org/wiki/Here_document
|
|
144
140
|
{
|
|
145
141
|
pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
|
|
146
|
-
lookbehind:
|
|
147
|
-
greedy:
|
|
142
|
+
lookbehind: !0,
|
|
143
|
+
greedy: !0,
|
|
148
144
|
inside: insideString
|
|
149
145
|
},
|
|
150
146
|
// Here-document with quotes around the tag
|
|
151
147
|
// → No expansion (so no “inside”).
|
|
152
148
|
{
|
|
153
149
|
pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
|
|
154
|
-
lookbehind:
|
|
155
|
-
greedy:
|
|
150
|
+
lookbehind: !0,
|
|
151
|
+
greedy: !0,
|
|
156
152
|
inside: {
|
|
157
153
|
bash: commandAfterHeredoc
|
|
158
154
|
}
|
|
@@ -161,20 +157,20 @@ var require_bash = __commonJS({
|
|
|
161
157
|
{
|
|
162
158
|
// https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
|
|
163
159
|
pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
|
|
164
|
-
lookbehind:
|
|
165
|
-
greedy:
|
|
160
|
+
lookbehind: !0,
|
|
161
|
+
greedy: !0,
|
|
166
162
|
inside: insideString
|
|
167
163
|
},
|
|
168
164
|
{
|
|
169
165
|
// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
|
|
170
166
|
pattern: /(^|[^$\\])'[^']*'/,
|
|
171
|
-
lookbehind:
|
|
172
|
-
greedy:
|
|
167
|
+
lookbehind: !0,
|
|
168
|
+
greedy: !0
|
|
173
169
|
},
|
|
174
170
|
{
|
|
175
171
|
// https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
|
|
176
172
|
pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
|
|
177
|
-
greedy:
|
|
173
|
+
greedy: !0,
|
|
178
174
|
inside: {
|
|
179
175
|
entity: insideString.entity
|
|
180
176
|
}
|
|
@@ -187,22 +183,22 @@ var require_bash = __commonJS({
|
|
|
187
183
|
variable: insideString.variable,
|
|
188
184
|
function: {
|
|
189
185
|
pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
|
|
190
|
-
lookbehind:
|
|
186
|
+
lookbehind: !0
|
|
191
187
|
},
|
|
192
188
|
keyword: {
|
|
193
189
|
pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
|
|
194
|
-
lookbehind:
|
|
190
|
+
lookbehind: !0
|
|
195
191
|
},
|
|
196
192
|
// https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
|
|
197
193
|
builtin: {
|
|
198
194
|
pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
|
|
199
|
-
lookbehind:
|
|
195
|
+
lookbehind: !0,
|
|
200
196
|
// Alias added to make those easier to distinguish from strings.
|
|
201
197
|
alias: "class-name"
|
|
202
198
|
},
|
|
203
199
|
boolean: {
|
|
204
200
|
pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
|
|
205
|
-
lookbehind:
|
|
201
|
+
lookbehind: !0
|
|
206
202
|
},
|
|
207
203
|
"file-descriptor": {
|
|
208
204
|
pattern: /\B&\d\b/,
|
|
@@ -221,11 +217,10 @@ var require_bash = __commonJS({
|
|
|
221
217
|
punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
|
|
222
218
|
number: {
|
|
223
219
|
pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
|
|
224
|
-
lookbehind:
|
|
220
|
+
lookbehind: !0
|
|
225
221
|
}
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
var toBeCopied = [
|
|
222
|
+
}, commandAfterHeredoc.inside = Prism2.languages.bash;
|
|
223
|
+
for (var toBeCopied = [
|
|
229
224
|
"comment",
|
|
230
225
|
"function-name",
|
|
231
226
|
"for-or-select",
|
|
@@ -240,15 +235,11 @@ var require_bash = __commonJS({
|
|
|
240
235
|
"operator",
|
|
241
236
|
"punctuation",
|
|
242
237
|
"number"
|
|
243
|
-
];
|
|
244
|
-
var inside = insideString.variable[1].inside;
|
|
245
|
-
for (var i = 0; i < toBeCopied.length; i++) {
|
|
238
|
+
], inside = insideString.variable[1].inside, i = 0; i < toBeCopied.length; i++)
|
|
246
239
|
inside[toBeCopied[i]] = Prism2.languages.bash[toBeCopied[i]];
|
|
247
|
-
}
|
|
248
240
|
Prism2.languages.shell = Prism2.languages.bash;
|
|
249
241
|
})(Prism);
|
|
250
242
|
}
|
|
251
|
-
__name(bash2, "bash");
|
|
252
243
|
}
|
|
253
244
|
});
|
|
254
245
|
|
|
@@ -260,7 +251,6 @@ var require_css = __commonJS({
|
|
|
260
251
|
css2.displayName = "css";
|
|
261
252
|
css2.aliases = [];
|
|
262
253
|
function css2(Prism) {
|
|
263
|
-
;
|
|
264
254
|
(function(Prism2) {
|
|
265
255
|
var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
266
256
|
Prism2.languages.css = {
|
|
@@ -271,12 +261,12 @@ var require_css = __commonJS({
|
|
|
271
261
|
rule: /^@[\w-]+/,
|
|
272
262
|
"selector-function-argument": {
|
|
273
263
|
pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
|
|
274
|
-
lookbehind:
|
|
264
|
+
lookbehind: !0,
|
|
275
265
|
alias: "selector"
|
|
276
266
|
},
|
|
277
267
|
keyword: {
|
|
278
268
|
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
|
|
279
|
-
lookbehind:
|
|
269
|
+
lookbehind: !0
|
|
280
270
|
}
|
|
281
271
|
// See rest below
|
|
282
272
|
}
|
|
@@ -287,7 +277,7 @@ var require_css = __commonJS({
|
|
|
287
277
|
"\\burl\\((?:" + string.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)",
|
|
288
278
|
"i"
|
|
289
279
|
),
|
|
290
|
-
greedy:
|
|
280
|
+
greedy: !0,
|
|
291
281
|
inside: {
|
|
292
282
|
function: /^url/i,
|
|
293
283
|
punctuation: /^\(|\)$/,
|
|
@@ -301,32 +291,27 @@ var require_css = __commonJS({
|
|
|
301
291
|
pattern: RegExp(
|
|
302
292
|
`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + string.source + ")*(?=\\s*\\{)"
|
|
303
293
|
),
|
|
304
|
-
lookbehind:
|
|
294
|
+
lookbehind: !0
|
|
305
295
|
},
|
|
306
296
|
string: {
|
|
307
297
|
pattern: string,
|
|
308
|
-
greedy:
|
|
298
|
+
greedy: !0
|
|
309
299
|
},
|
|
310
300
|
property: {
|
|
311
301
|
pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
|
|
312
|
-
lookbehind:
|
|
302
|
+
lookbehind: !0
|
|
313
303
|
},
|
|
314
304
|
important: /!important\b/i,
|
|
315
305
|
function: {
|
|
316
306
|
pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
|
|
317
|
-
lookbehind:
|
|
307
|
+
lookbehind: !0
|
|
318
308
|
},
|
|
319
309
|
punctuation: /[(){};:,]/
|
|
320
|
-
};
|
|
321
|
-
Prism2.languages.css["atrule"].inside.rest = Prism2.languages.css;
|
|
310
|
+
}, Prism2.languages.css.atrule.inside.rest = Prism2.languages.css;
|
|
322
311
|
var markup2 = Prism2.languages.markup;
|
|
323
|
-
|
|
324
|
-
markup2.tag.addInlined("style", "css");
|
|
325
|
-
markup2.tag.addAttribute("style", "css");
|
|
326
|
-
}
|
|
312
|
+
markup2 && (markup2.tag.addInlined("style", "css"), markup2.tag.addAttribute("style", "css"));
|
|
327
313
|
})(Prism);
|
|
328
314
|
}
|
|
329
|
-
__name(css2, "css");
|
|
330
315
|
}
|
|
331
316
|
});
|
|
332
317
|
|
|
@@ -342,19 +327,19 @@ var require_graphql = __commonJS({
|
|
|
342
327
|
comment: /#.*/,
|
|
343
328
|
description: {
|
|
344
329
|
pattern: /(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,
|
|
345
|
-
greedy:
|
|
330
|
+
greedy: !0,
|
|
346
331
|
alias: "string",
|
|
347
332
|
inside: {
|
|
348
333
|
"language-markdown": {
|
|
349
334
|
pattern: /(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,
|
|
350
|
-
lookbehind:
|
|
335
|
+
lookbehind: !0,
|
|
351
336
|
inside: Prism.languages.markdown
|
|
352
337
|
}
|
|
353
338
|
}
|
|
354
339
|
},
|
|
355
340
|
string: {
|
|
356
341
|
pattern: /"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,
|
|
357
|
-
greedy:
|
|
342
|
+
greedy: !0
|
|
358
343
|
},
|
|
359
344
|
number: /(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
|
|
360
345
|
boolean: /\b(?:false|true)\b/,
|
|
@@ -365,7 +350,7 @@ var require_graphql = __commonJS({
|
|
|
365
350
|
},
|
|
366
351
|
"attr-name": {
|
|
367
352
|
pattern: /\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,
|
|
368
|
-
greedy:
|
|
353
|
+
greedy: !0
|
|
369
354
|
},
|
|
370
355
|
"atom-input": {
|
|
371
356
|
pattern: /\b[A-Z]\w*Input\b/,
|
|
@@ -375,21 +360,21 @@ var require_graphql = __commonJS({
|
|
|
375
360
|
constant: /\b[A-Z][A-Z_\d]*\b/,
|
|
376
361
|
"class-name": {
|
|
377
362
|
pattern: /(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,
|
|
378
|
-
lookbehind:
|
|
363
|
+
lookbehind: !0
|
|
379
364
|
},
|
|
380
365
|
fragment: {
|
|
381
366
|
pattern: /(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,
|
|
382
|
-
lookbehind:
|
|
367
|
+
lookbehind: !0,
|
|
383
368
|
alias: "function"
|
|
384
369
|
},
|
|
385
370
|
"definition-mutation": {
|
|
386
371
|
pattern: /(\bmutation\s+)[a-zA-Z_]\w*/,
|
|
387
|
-
lookbehind:
|
|
372
|
+
lookbehind: !0,
|
|
388
373
|
alias: "function"
|
|
389
374
|
},
|
|
390
375
|
"definition-query": {
|
|
391
376
|
pattern: /(\bquery\s+)[a-zA-Z_]\w*/,
|
|
392
|
-
lookbehind:
|
|
377
|
+
lookbehind: !0,
|
|
393
378
|
alias: "function"
|
|
394
379
|
},
|
|
395
380
|
keyword: /\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,
|
|
@@ -398,59 +383,40 @@ var require_graphql = __commonJS({
|
|
|
398
383
|
object: /\w+(?=\s*\{)/,
|
|
399
384
|
punctuation: /[!(){}\[\]:=,]/,
|
|
400
385
|
property: /\w+/
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
if (env.language !== "graphql") {
|
|
386
|
+
}, Prism.hooks.add("after-tokenize", function(env) {
|
|
387
|
+
if (env.language !== "graphql")
|
|
404
388
|
return;
|
|
405
|
-
}
|
|
406
389
|
var validTokens = env.tokens.filter(function(token) {
|
|
407
|
-
return typeof token
|
|
408
|
-
});
|
|
409
|
-
var currentIndex = 0;
|
|
390
|
+
return typeof token != "string" && token.type !== "comment" && token.type !== "scalar";
|
|
391
|
+
}), currentIndex = 0;
|
|
410
392
|
function getToken(offset) {
|
|
411
393
|
return validTokens[currentIndex + offset];
|
|
412
394
|
}
|
|
413
|
-
__name(getToken, "getToken");
|
|
414
395
|
function isTokenType(types, offset) {
|
|
415
396
|
offset = offset || 0;
|
|
416
397
|
for (var i2 = 0; i2 < types.length; i2++) {
|
|
417
398
|
var token = getToken(i2 + offset);
|
|
418
|
-
if (!token || token.type !== types[i2])
|
|
419
|
-
return
|
|
420
|
-
}
|
|
399
|
+
if (!token || token.type !== types[i2])
|
|
400
|
+
return !1;
|
|
421
401
|
}
|
|
422
|
-
return
|
|
402
|
+
return !0;
|
|
423
403
|
}
|
|
424
|
-
__name(isTokenType, "isTokenType");
|
|
425
404
|
function findClosingBracket(open, close) {
|
|
426
|
-
var stackHeight = 1;
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
if (token.type === "punctuation" && typeof content === "string") {
|
|
431
|
-
if (open.test(content)) {
|
|
405
|
+
for (var stackHeight = 1, i2 = currentIndex; i2 < validTokens.length; i2++) {
|
|
406
|
+
var token = validTokens[i2], content = token.content;
|
|
407
|
+
if (token.type === "punctuation" && typeof content == "string") {
|
|
408
|
+
if (open.test(content))
|
|
432
409
|
stackHeight++;
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
if (stackHeight === 0) {
|
|
436
|
-
return i2;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
410
|
+
else if (close.test(content) && (stackHeight--, stackHeight === 0))
|
|
411
|
+
return i2;
|
|
439
412
|
}
|
|
440
413
|
}
|
|
441
414
|
return -1;
|
|
442
415
|
}
|
|
443
|
-
__name(findClosingBracket, "findClosingBracket");
|
|
444
416
|
function addAlias(token, alias) {
|
|
445
417
|
var aliases = token.alias;
|
|
446
|
-
|
|
447
|
-
token.alias = aliases = [];
|
|
448
|
-
} else if (!Array.isArray(aliases)) {
|
|
449
|
-
token.alias = aliases = [aliases];
|
|
450
|
-
}
|
|
451
|
-
aliases.push(alias);
|
|
418
|
+
aliases ? Array.isArray(aliases) || (token.alias = aliases = [aliases]) : token.alias = aliases = [], aliases.push(alias);
|
|
452
419
|
}
|
|
453
|
-
__name(addAlias, "addAlias");
|
|
454
420
|
for (; currentIndex < validTokens.length; ) {
|
|
455
421
|
var startToken = validTokens[currentIndex++];
|
|
456
422
|
if (startToken.type === "keyword" && startToken.content === "mutation") {
|
|
@@ -458,39 +424,27 @@ var require_graphql = __commonJS({
|
|
|
458
424
|
if (isTokenType(["definition-mutation", "punctuation"]) && getToken(1).content === "(") {
|
|
459
425
|
currentIndex += 2;
|
|
460
426
|
var definitionEnd = findClosingBracket(/^\($/, /^\)$/);
|
|
461
|
-
if (definitionEnd === -1)
|
|
427
|
+
if (definitionEnd === -1)
|
|
462
428
|
continue;
|
|
463
|
-
}
|
|
464
429
|
for (; currentIndex < definitionEnd; currentIndex++) {
|
|
465
430
|
var t = getToken(0);
|
|
466
|
-
|
|
467
|
-
addAlias(t, "variable-input");
|
|
468
|
-
inputVariables.push(t.content);
|
|
469
|
-
}
|
|
431
|
+
t.type === "variable" && (addAlias(t, "variable-input"), inputVariables.push(t.content));
|
|
470
432
|
}
|
|
471
433
|
currentIndex = definitionEnd + 1;
|
|
472
434
|
}
|
|
473
|
-
if (isTokenType(["punctuation", "property-query"]) && getToken(0).content === "{") {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}
|
|
481
|
-
for (var i = currentIndex; i < mutationEnd; i++) {
|
|
482
|
-
var varToken = validTokens[i];
|
|
483
|
-
if (varToken.type === "variable" && inputVariables.indexOf(varToken.content) >= 0) {
|
|
484
|
-
addAlias(varToken, "variable-input");
|
|
485
|
-
}
|
|
486
|
-
}
|
|
435
|
+
if (isTokenType(["punctuation", "property-query"]) && getToken(0).content === "{" && (currentIndex++, addAlias(getToken(0), "property-mutation"), inputVariables.length > 0)) {
|
|
436
|
+
var mutationEnd = findClosingBracket(/^\{$/, /^\}$/);
|
|
437
|
+
if (mutationEnd === -1)
|
|
438
|
+
continue;
|
|
439
|
+
for (var i = currentIndex; i < mutationEnd; i++) {
|
|
440
|
+
var varToken = validTokens[i];
|
|
441
|
+
varToken.type === "variable" && inputVariables.indexOf(varToken.content) >= 0 && addAlias(varToken, "variable-input");
|
|
487
442
|
}
|
|
488
443
|
}
|
|
489
444
|
}
|
|
490
445
|
}
|
|
491
|
-
}
|
|
446
|
+
});
|
|
492
447
|
}
|
|
493
|
-
__name(graphql2, "graphql");
|
|
494
448
|
}
|
|
495
449
|
});
|
|
496
450
|
|
|
@@ -502,27 +456,24 @@ var require_js_extras = __commonJS({
|
|
|
502
456
|
jsExtras2.displayName = "jsExtras";
|
|
503
457
|
jsExtras2.aliases = [];
|
|
504
458
|
function jsExtras2(Prism) {
|
|
505
|
-
;
|
|
506
459
|
(function(Prism2) {
|
|
507
460
|
Prism2.languages.insertBefore("javascript", "function-variable", {
|
|
508
461
|
"method-variable": {
|
|
509
462
|
pattern: RegExp(
|
|
510
463
|
"(\\.\\s*)" + Prism2.languages.javascript["function-variable"].pattern.source
|
|
511
464
|
),
|
|
512
|
-
lookbehind:
|
|
465
|
+
lookbehind: !0,
|
|
513
466
|
alias: ["function-variable", "method", "function", "property-access"]
|
|
514
467
|
}
|
|
515
|
-
})
|
|
516
|
-
Prism2.languages.insertBefore("javascript", "function", {
|
|
468
|
+
}), Prism2.languages.insertBefore("javascript", "function", {
|
|
517
469
|
method: {
|
|
518
470
|
pattern: RegExp(
|
|
519
|
-
"(\\.\\s*)" + Prism2.languages.javascript
|
|
471
|
+
"(\\.\\s*)" + Prism2.languages.javascript.function.source
|
|
520
472
|
),
|
|
521
|
-
lookbehind:
|
|
473
|
+
lookbehind: !0,
|
|
522
474
|
alias: ["function", "property-access"]
|
|
523
475
|
}
|
|
524
|
-
})
|
|
525
|
-
Prism2.languages.insertBefore("javascript", "constant", {
|
|
476
|
+
}), Prism2.languages.insertBefore("javascript", "constant", {
|
|
526
477
|
"known-class-name": [
|
|
527
478
|
{
|
|
528
479
|
// standard built-ins
|
|
@@ -545,14 +496,13 @@ var require_js_extras = __commonJS({
|
|
|
545
496
|
flags
|
|
546
497
|
);
|
|
547
498
|
}
|
|
548
|
-
__name(withId, "withId");
|
|
549
499
|
Prism2.languages.insertBefore("javascript", "keyword", {
|
|
550
500
|
imports: {
|
|
551
501
|
// https://tc39.es/ecma262/#sec-imports
|
|
552
502
|
pattern: withId(
|
|
553
503
|
/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source
|
|
554
504
|
),
|
|
555
|
-
lookbehind:
|
|
505
|
+
lookbehind: !0,
|
|
556
506
|
inside: Prism2.languages.javascript
|
|
557
507
|
},
|
|
558
508
|
exports: {
|
|
@@ -560,11 +510,10 @@ var require_js_extras = __commonJS({
|
|
|
560
510
|
pattern: withId(
|
|
561
511
|
/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source
|
|
562
512
|
),
|
|
563
|
-
lookbehind:
|
|
513
|
+
lookbehind: !0,
|
|
564
514
|
inside: Prism2.languages.javascript
|
|
565
515
|
}
|
|
566
|
-
})
|
|
567
|
-
Prism2.languages.javascript["keyword"].unshift(
|
|
516
|
+
}), Prism2.languages.javascript.keyword.unshift(
|
|
568
517
|
{
|
|
569
518
|
pattern: /\b(?:as|default|export|from|import)\b/,
|
|
570
519
|
alias: "module"
|
|
@@ -581,8 +530,7 @@ var require_js_extras = __commonJS({
|
|
|
581
530
|
pattern: /\bundefined\b/,
|
|
582
531
|
alias: "nil"
|
|
583
532
|
}
|
|
584
|
-
)
|
|
585
|
-
Prism2.languages.insertBefore("javascript", "operator", {
|
|
533
|
+
), Prism2.languages.insertBefore("javascript", "operator", {
|
|
586
534
|
spread: {
|
|
587
535
|
pattern: /\.{3}/,
|
|
588
536
|
alias: "operator"
|
|
@@ -591,15 +539,14 @@ var require_js_extras = __commonJS({
|
|
|
591
539
|
pattern: /=>/,
|
|
592
540
|
alias: "operator"
|
|
593
541
|
}
|
|
594
|
-
})
|
|
595
|
-
Prism2.languages.insertBefore("javascript", "punctuation", {
|
|
542
|
+
}), Prism2.languages.insertBefore("javascript", "punctuation", {
|
|
596
543
|
"property-access": {
|
|
597
544
|
pattern: withId(/(\.\s*)#?<ID>/.source),
|
|
598
|
-
lookbehind:
|
|
545
|
+
lookbehind: !0
|
|
599
546
|
},
|
|
600
547
|
"maybe-class-name": {
|
|
601
548
|
pattern: /(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,
|
|
602
|
-
lookbehind:
|
|
549
|
+
lookbehind: !0
|
|
603
550
|
},
|
|
604
551
|
dom: {
|
|
605
552
|
// this contains only a few commonly used DOM variables
|
|
@@ -611,28 +558,22 @@ var require_js_extras = __commonJS({
|
|
|
611
558
|
alias: "class-name"
|
|
612
559
|
}
|
|
613
560
|
});
|
|
614
|
-
var maybeClassNameTokens = [
|
|
561
|
+
for (var maybeClassNameTokens = [
|
|
615
562
|
"function",
|
|
616
563
|
"function-variable",
|
|
617
564
|
"method",
|
|
618
565
|
"method-variable",
|
|
619
566
|
"property-access"
|
|
620
|
-
];
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
value = Prism2.languages.javascript[token] = {
|
|
626
|
-
pattern: value
|
|
627
|
-
};
|
|
628
|
-
}
|
|
567
|
+
], i = 0; i < maybeClassNameTokens.length; i++) {
|
|
568
|
+
var token = maybeClassNameTokens[i], value = Prism2.languages.javascript[token];
|
|
569
|
+
Prism2.util.type(value) === "RegExp" && (value = Prism2.languages.javascript[token] = {
|
|
570
|
+
pattern: value
|
|
571
|
+
});
|
|
629
572
|
var inside = value.inside || {};
|
|
630
|
-
value.inside = inside
|
|
631
|
-
inside["maybe-class-name"] = /^[A-Z][\s\S]*/;
|
|
573
|
+
value.inside = inside, inside["maybe-class-name"] = /^[A-Z][\s\S]*/;
|
|
632
574
|
}
|
|
633
575
|
})(Prism);
|
|
634
576
|
}
|
|
635
|
-
__name(jsExtras2, "jsExtras");
|
|
636
577
|
}
|
|
637
578
|
});
|
|
638
579
|
|
|
@@ -647,17 +588,17 @@ var require_json = __commonJS({
|
|
|
647
588
|
Prism.languages.json = {
|
|
648
589
|
property: {
|
|
649
590
|
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
650
|
-
lookbehind:
|
|
651
|
-
greedy:
|
|
591
|
+
lookbehind: !0,
|
|
592
|
+
greedy: !0
|
|
652
593
|
},
|
|
653
594
|
string: {
|
|
654
595
|
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
|
|
655
|
-
lookbehind:
|
|
656
|
-
greedy:
|
|
596
|
+
lookbehind: !0,
|
|
597
|
+
greedy: !0
|
|
657
598
|
},
|
|
658
599
|
comment: {
|
|
659
600
|
pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
|
|
660
|
-
greedy:
|
|
601
|
+
greedy: !0
|
|
661
602
|
},
|
|
662
603
|
number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
|
|
663
604
|
punctuation: /[{}[\],]/,
|
|
@@ -667,10 +608,8 @@ var require_json = __commonJS({
|
|
|
667
608
|
pattern: /\bnull\b/,
|
|
668
609
|
alias: "keyword"
|
|
669
610
|
}
|
|
670
|
-
};
|
|
671
|
-
Prism.languages.webmanifest = Prism.languages.json;
|
|
611
|
+
}, Prism.languages.webmanifest = Prism.languages.json;
|
|
672
612
|
}
|
|
673
|
-
__name(json2, "json");
|
|
674
613
|
}
|
|
675
614
|
});
|
|
676
615
|
|
|
@@ -682,33 +621,20 @@ var require_jsx = __commonJS({
|
|
|
682
621
|
jsx2.displayName = "jsx";
|
|
683
622
|
jsx2.aliases = [];
|
|
684
623
|
function jsx2(Prism) {
|
|
685
|
-
;
|
|
686
624
|
(function(Prism2) {
|
|
687
|
-
var javascript = Prism2.util.clone(Prism2.languages.javascript);
|
|
688
|
-
var space = /(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source;
|
|
689
|
-
var braces = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source;
|
|
690
|
-
var spread = /(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;
|
|
625
|
+
var javascript = Prism2.util.clone(Prism2.languages.javascript), space = /(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source, braces = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source, spread = /(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;
|
|
691
626
|
function re(source, flags) {
|
|
692
|
-
source = source.replace(/<S>/g, function() {
|
|
627
|
+
return source = source.replace(/<S>/g, function() {
|
|
693
628
|
return space;
|
|
694
629
|
}).replace(/<BRACES>/g, function() {
|
|
695
630
|
return braces;
|
|
696
631
|
}).replace(/<SPREAD>/g, function() {
|
|
697
632
|
return spread;
|
|
698
|
-
});
|
|
699
|
-
return RegExp(source, flags);
|
|
633
|
+
}), RegExp(source, flags);
|
|
700
634
|
}
|
|
701
|
-
|
|
702
|
-
spread = re(spread).source;
|
|
703
|
-
Prism2.languages.jsx = Prism2.languages.extend("markup", javascript);
|
|
704
|
-
Prism2.languages.jsx.tag.pattern = re(
|
|
635
|
+
spread = re(spread).source, Prism2.languages.jsx = Prism2.languages.extend("markup", javascript), Prism2.languages.jsx.tag.pattern = re(
|
|
705
636
|
/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source
|
|
706
|
-
)
|
|
707
|
-
Prism2.languages.jsx.tag.inside["tag"].pattern = /^<\/?[^\s>\/]*/;
|
|
708
|
-
Prism2.languages.jsx.tag.inside["attr-value"].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/;
|
|
709
|
-
Prism2.languages.jsx.tag.inside["tag"].inside["class-name"] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/;
|
|
710
|
-
Prism2.languages.jsx.tag.inside["comment"] = javascript["comment"];
|
|
711
|
-
Prism2.languages.insertBefore(
|
|
637
|
+
), Prism2.languages.jsx.tag.inside.tag.pattern = /^<\/?[^\s>\/]*/, Prism2.languages.jsx.tag.inside["attr-value"].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/, Prism2.languages.jsx.tag.inside.tag.inside["class-name"] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/, Prism2.languages.jsx.tag.inside.comment = javascript.comment, Prism2.languages.insertBefore(
|
|
712
638
|
"inside",
|
|
713
639
|
"attr-name",
|
|
714
640
|
{
|
|
@@ -718,8 +644,7 @@ var require_jsx = __commonJS({
|
|
|
718
644
|
}
|
|
719
645
|
},
|
|
720
646
|
Prism2.languages.jsx.tag
|
|
721
|
-
)
|
|
722
|
-
Prism2.languages.insertBefore(
|
|
647
|
+
), Prism2.languages.insertBefore(
|
|
723
648
|
"inside",
|
|
724
649
|
"special-attr",
|
|
725
650
|
{
|
|
@@ -738,80 +663,31 @@ var require_jsx = __commonJS({
|
|
|
738
663
|
},
|
|
739
664
|
Prism2.languages.jsx.tag
|
|
740
665
|
);
|
|
741
|
-
var stringifyToken =
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
var notTagNorBrace = false;
|
|
758
|
-
if (typeof token !== "string") {
|
|
759
|
-
if (token.type === "tag" && token.content[0] && token.content[0].type === "tag") {
|
|
760
|
-
if (token.content[0].content[0].content === "</") {
|
|
761
|
-
if (openedTags.length > 0 && openedTags[openedTags.length - 1].tagName === stringifyToken(token.content[0].content[1])) {
|
|
762
|
-
openedTags.pop();
|
|
763
|
-
}
|
|
764
|
-
} else {
|
|
765
|
-
if (token.content[token.content.length - 1].content === "/>") {
|
|
766
|
-
} else {
|
|
767
|
-
openedTags.push({
|
|
768
|
-
tagName: stringifyToken(token.content[0].content[1]),
|
|
769
|
-
openedBraces: 0
|
|
770
|
-
});
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
} else if (openedTags.length > 0 && token.type === "punctuation" && token.content === "{") {
|
|
774
|
-
openedTags[openedTags.length - 1].openedBraces++;
|
|
775
|
-
} else if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces > 0 && token.type === "punctuation" && token.content === "}") {
|
|
776
|
-
openedTags[openedTags.length - 1].openedBraces--;
|
|
777
|
-
} else {
|
|
778
|
-
notTagNorBrace = true;
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
if (notTagNorBrace || typeof token === "string") {
|
|
782
|
-
if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces === 0) {
|
|
783
|
-
var plainText = stringifyToken(token);
|
|
784
|
-
if (i < tokens.length - 1 && (typeof tokens[i + 1] === "string" || tokens[i + 1].type === "plain-text")) {
|
|
785
|
-
plainText += stringifyToken(tokens[i + 1]);
|
|
786
|
-
tokens.splice(i + 1, 1);
|
|
787
|
-
}
|
|
788
|
-
if (i > 0 && (typeof tokens[i - 1] === "string" || tokens[i - 1].type === "plain-text")) {
|
|
789
|
-
plainText = stringifyToken(tokens[i - 1]) + plainText;
|
|
790
|
-
tokens.splice(i - 1, 1);
|
|
791
|
-
i--;
|
|
792
|
-
}
|
|
793
|
-
tokens[i] = new Prism2.Token(
|
|
794
|
-
"plain-text",
|
|
795
|
-
plainText,
|
|
796
|
-
null,
|
|
797
|
-
plainText
|
|
798
|
-
);
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
if (token.content && typeof token.content !== "string") {
|
|
802
|
-
walkTokens(token.content);
|
|
666
|
+
var stringifyToken = function(token) {
|
|
667
|
+
return token ? typeof token == "string" ? token : typeof token.content == "string" ? token.content : token.content.map(stringifyToken).join("") : "";
|
|
668
|
+
}, walkTokens = function(tokens) {
|
|
669
|
+
for (var openedTags = [], i = 0; i < tokens.length; i++) {
|
|
670
|
+
var token = tokens[i], notTagNorBrace = !1;
|
|
671
|
+
if (typeof token != "string" && (token.type === "tag" && token.content[0] && token.content[0].type === "tag" ? token.content[0].content[0].content === "</" ? openedTags.length > 0 && openedTags[openedTags.length - 1].tagName === stringifyToken(token.content[0].content[1]) && openedTags.pop() : token.content[token.content.length - 1].content === "/>" || openedTags.push({
|
|
672
|
+
tagName: stringifyToken(token.content[0].content[1]),
|
|
673
|
+
openedBraces: 0
|
|
674
|
+
}) : openedTags.length > 0 && token.type === "punctuation" && token.content === "{" ? openedTags[openedTags.length - 1].openedBraces++ : openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces > 0 && token.type === "punctuation" && token.content === "}" ? openedTags[openedTags.length - 1].openedBraces-- : notTagNorBrace = !0), (notTagNorBrace || typeof token == "string") && openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces === 0) {
|
|
675
|
+
var plainText = stringifyToken(token);
|
|
676
|
+
i < tokens.length - 1 && (typeof tokens[i + 1] == "string" || tokens[i + 1].type === "plain-text") && (plainText += stringifyToken(tokens[i + 1]), tokens.splice(i + 1, 1)), i > 0 && (typeof tokens[i - 1] == "string" || tokens[i - 1].type === "plain-text") && (plainText = stringifyToken(tokens[i - 1]) + plainText, tokens.splice(i - 1, 1), i--), tokens[i] = new Prism2.Token(
|
|
677
|
+
"plain-text",
|
|
678
|
+
plainText,
|
|
679
|
+
null,
|
|
680
|
+
plainText
|
|
681
|
+
);
|
|
803
682
|
}
|
|
683
|
+
token.content && typeof token.content != "string" && walkTokens(token.content);
|
|
804
684
|
}
|
|
805
|
-
}
|
|
685
|
+
};
|
|
806
686
|
Prism2.hooks.add("after-tokenize", function(env) {
|
|
807
|
-
|
|
808
|
-
return;
|
|
809
|
-
}
|
|
810
|
-
walkTokens(env.tokens);
|
|
687
|
+
env.language !== "jsx" && env.language !== "tsx" || walkTokens(env.tokens);
|
|
811
688
|
});
|
|
812
689
|
})(Prism);
|
|
813
690
|
}
|
|
814
|
-
__name(jsx2, "jsx");
|
|
815
691
|
}
|
|
816
692
|
});
|
|
817
693
|
|
|
@@ -823,30 +699,24 @@ var require_markdown = __commonJS({
|
|
|
823
699
|
markdown2.displayName = "markdown";
|
|
824
700
|
markdown2.aliases = ["md"];
|
|
825
701
|
function markdown2(Prism) {
|
|
826
|
-
;
|
|
827
702
|
(function(Prism2) {
|
|
828
703
|
var inner = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;
|
|
829
704
|
function createInline(pattern) {
|
|
830
|
-
pattern = pattern.replace(/<inner>/g, function() {
|
|
705
|
+
return pattern = pattern.replace(/<inner>/g, function() {
|
|
831
706
|
return inner;
|
|
832
|
-
});
|
|
833
|
-
return RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + pattern + ")");
|
|
707
|
+
}), RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + pattern + ")");
|
|
834
708
|
}
|
|
835
|
-
|
|
836
|
-
var tableCell = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source;
|
|
837
|
-
var tableRow = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(
|
|
709
|
+
var tableCell = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source, tableRow = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(
|
|
838
710
|
/__/g,
|
|
839
711
|
function() {
|
|
840
712
|
return tableCell;
|
|
841
713
|
}
|
|
842
|
-
);
|
|
843
|
-
|
|
844
|
-
Prism2.languages.markdown = Prism2.languages.extend("markup", {});
|
|
845
|
-
Prism2.languages.insertBefore("markdown", "prolog", {
|
|
714
|
+
), tableLine = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;
|
|
715
|
+
Prism2.languages.markdown = Prism2.languages.extend("markup", {}), Prism2.languages.insertBefore("markdown", "prolog", {
|
|
846
716
|
"front-matter-block": {
|
|
847
717
|
pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,
|
|
848
|
-
lookbehind:
|
|
849
|
-
greedy:
|
|
718
|
+
lookbehind: !0,
|
|
719
|
+
greedy: !0,
|
|
850
720
|
inside: {
|
|
851
721
|
punctuation: /^---|---$/,
|
|
852
722
|
"front-matter": {
|
|
@@ -871,7 +741,7 @@ var require_markdown = __commonJS({
|
|
|
871
741
|
pattern: RegExp(
|
|
872
742
|
"^(" + tableRow + tableLine + ")(?:" + tableRow + ")*$"
|
|
873
743
|
),
|
|
874
|
-
lookbehind:
|
|
744
|
+
lookbehind: !0,
|
|
875
745
|
inside: {
|
|
876
746
|
"table-data": {
|
|
877
747
|
pattern: RegExp(tableCell),
|
|
@@ -882,7 +752,7 @@ var require_markdown = __commonJS({
|
|
|
882
752
|
},
|
|
883
753
|
"table-line": {
|
|
884
754
|
pattern: RegExp("^(" + tableRow + ")" + tableLine + "$"),
|
|
885
|
-
lookbehind:
|
|
755
|
+
lookbehind: !0,
|
|
886
756
|
inside: {
|
|
887
757
|
punctuation: /\||:?-{3,}:?/
|
|
888
758
|
}
|
|
@@ -904,7 +774,7 @@ var require_markdown = __commonJS({
|
|
|
904
774
|
{
|
|
905
775
|
// Prefixed by 4 spaces or 1 tab and preceded by an empty line
|
|
906
776
|
pattern: /((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,
|
|
907
|
-
lookbehind:
|
|
777
|
+
lookbehind: !0,
|
|
908
778
|
alias: "keyword"
|
|
909
779
|
},
|
|
910
780
|
{
|
|
@@ -912,15 +782,15 @@ var require_markdown = __commonJS({
|
|
|
912
782
|
// code block
|
|
913
783
|
// ```
|
|
914
784
|
pattern: /^```[\s\S]*?^```$/m,
|
|
915
|
-
greedy:
|
|
785
|
+
greedy: !0,
|
|
916
786
|
inside: {
|
|
917
787
|
"code-block": {
|
|
918
788
|
pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,
|
|
919
|
-
lookbehind:
|
|
789
|
+
lookbehind: !0
|
|
920
790
|
},
|
|
921
791
|
"code-language": {
|
|
922
792
|
pattern: /^(```).+/,
|
|
923
|
-
lookbehind:
|
|
793
|
+
lookbehind: !0
|
|
924
794
|
},
|
|
925
795
|
punctuation: /```/
|
|
926
796
|
}
|
|
@@ -942,7 +812,7 @@ var require_markdown = __commonJS({
|
|
|
942
812
|
// # title 1
|
|
943
813
|
// ###### title 6
|
|
944
814
|
pattern: /(^\s*)#.+/m,
|
|
945
|
-
lookbehind:
|
|
815
|
+
lookbehind: !0,
|
|
946
816
|
alias: "important",
|
|
947
817
|
inside: {
|
|
948
818
|
punctuation: /^#+|#+$/
|
|
@@ -955,7 +825,7 @@ var require_markdown = __commonJS({
|
|
|
955
825
|
// * * *
|
|
956
826
|
// -----------
|
|
957
827
|
pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,
|
|
958
|
-
lookbehind:
|
|
828
|
+
lookbehind: !0,
|
|
959
829
|
alias: "punctuation"
|
|
960
830
|
},
|
|
961
831
|
list: {
|
|
@@ -964,7 +834,7 @@ var require_markdown = __commonJS({
|
|
|
964
834
|
// - item
|
|
965
835
|
// 1. item
|
|
966
836
|
pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,
|
|
967
|
-
lookbehind:
|
|
837
|
+
lookbehind: !0,
|
|
968
838
|
alias: "punctuation"
|
|
969
839
|
},
|
|
970
840
|
"url-reference": {
|
|
@@ -976,7 +846,7 @@ var require_markdown = __commonJS({
|
|
|
976
846
|
inside: {
|
|
977
847
|
variable: {
|
|
978
848
|
pattern: /^(!?\[)[^\]]+/,
|
|
979
|
-
lookbehind:
|
|
849
|
+
lookbehind: !0
|
|
980
850
|
},
|
|
981
851
|
string: /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,
|
|
982
852
|
punctuation: /^[\[\]!:]|[<>]/
|
|
@@ -990,12 +860,12 @@ var require_markdown = __commonJS({
|
|
|
990
860
|
pattern: createInline(
|
|
991
861
|
/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source
|
|
992
862
|
),
|
|
993
|
-
lookbehind:
|
|
994
|
-
greedy:
|
|
863
|
+
lookbehind: !0,
|
|
864
|
+
greedy: !0,
|
|
995
865
|
inside: {
|
|
996
866
|
content: {
|
|
997
867
|
pattern: /(^..)[\s\S]+(?=..$)/,
|
|
998
|
-
lookbehind:
|
|
868
|
+
lookbehind: !0,
|
|
999
869
|
inside: {}
|
|
1000
870
|
// see below
|
|
1001
871
|
},
|
|
@@ -1009,12 +879,12 @@ var require_markdown = __commonJS({
|
|
|
1009
879
|
pattern: createInline(
|
|
1010
880
|
/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source
|
|
1011
881
|
),
|
|
1012
|
-
lookbehind:
|
|
1013
|
-
greedy:
|
|
882
|
+
lookbehind: !0,
|
|
883
|
+
greedy: !0,
|
|
1014
884
|
inside: {
|
|
1015
885
|
content: {
|
|
1016
886
|
pattern: /(^.)[\s\S]+(?=.$)/,
|
|
1017
|
-
lookbehind:
|
|
887
|
+
lookbehind: !0,
|
|
1018
888
|
inside: {}
|
|
1019
889
|
// see below
|
|
1020
890
|
},
|
|
@@ -1026,12 +896,12 @@ var require_markdown = __commonJS({
|
|
|
1026
896
|
// ~strike~
|
|
1027
897
|
// eslint-disable-next-line regexp/strict
|
|
1028
898
|
pattern: createInline(/(~~?)(?:(?!~)<inner>)+\2/.source),
|
|
1029
|
-
lookbehind:
|
|
1030
|
-
greedy:
|
|
899
|
+
lookbehind: !0,
|
|
900
|
+
greedy: !0,
|
|
1031
901
|
inside: {
|
|
1032
902
|
content: {
|
|
1033
903
|
pattern: /(^~~?)[\s\S]+(?=\1$)/,
|
|
1034
|
-
lookbehind:
|
|
904
|
+
lookbehind: !0,
|
|
1035
905
|
inside: {}
|
|
1036
906
|
// see below
|
|
1037
907
|
},
|
|
@@ -1042,8 +912,8 @@ var require_markdown = __commonJS({
|
|
|
1042
912
|
// `code`
|
|
1043
913
|
// ``code``
|
|
1044
914
|
pattern: /(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,
|
|
1045
|
-
lookbehind:
|
|
1046
|
-
greedy:
|
|
915
|
+
lookbehind: !0,
|
|
916
|
+
greedy: !0,
|
|
1047
917
|
alias: ["code", "keyword"]
|
|
1048
918
|
},
|
|
1049
919
|
url: {
|
|
@@ -1053,144 +923,105 @@ var require_markdown = __commonJS({
|
|
|
1053
923
|
pattern: createInline(
|
|
1054
924
|
/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source
|
|
1055
925
|
),
|
|
1056
|
-
lookbehind:
|
|
1057
|
-
greedy:
|
|
926
|
+
lookbehind: !0,
|
|
927
|
+
greedy: !0,
|
|
1058
928
|
inside: {
|
|
1059
929
|
operator: /^!/,
|
|
1060
930
|
content: {
|
|
1061
931
|
pattern: /(^\[)[^\]]+(?=\])/,
|
|
1062
|
-
lookbehind:
|
|
932
|
+
lookbehind: !0,
|
|
1063
933
|
inside: {}
|
|
1064
934
|
// see below
|
|
1065
935
|
},
|
|
1066
936
|
variable: {
|
|
1067
937
|
pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/,
|
|
1068
|
-
lookbehind:
|
|
938
|
+
lookbehind: !0
|
|
1069
939
|
},
|
|
1070
940
|
url: {
|
|
1071
941
|
pattern: /(^\]\()[^\s)]+/,
|
|
1072
|
-
lookbehind:
|
|
942
|
+
lookbehind: !0
|
|
1073
943
|
},
|
|
1074
944
|
string: {
|
|
1075
945
|
pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,
|
|
1076
|
-
lookbehind:
|
|
946
|
+
lookbehind: !0
|
|
1077
947
|
}
|
|
1078
948
|
}
|
|
1079
949
|
}
|
|
1080
|
-
})
|
|
1081
|
-
["url", "bold", "italic", "strike"].forEach(function(token) {
|
|
1082
|
-
;
|
|
950
|
+
}), ["url", "bold", "italic", "strike"].forEach(function(token) {
|
|
1083
951
|
["url", "bold", "italic", "strike", "code-snippet"].forEach(function(inside) {
|
|
1084
|
-
|
|
1085
|
-
Prism2.languages.markdown[token].inside.content.inside[inside] = Prism2.languages.markdown[inside];
|
|
1086
|
-
}
|
|
952
|
+
token !== inside && (Prism2.languages.markdown[token].inside.content.inside[inside] = Prism2.languages.markdown[inside]);
|
|
1087
953
|
});
|
|
1088
|
-
})
|
|
1089
|
-
|
|
1090
|
-
if (env.language !== "markdown" && env.language !== "md") {
|
|
954
|
+
}), Prism2.hooks.add("after-tokenize", function(env) {
|
|
955
|
+
if (env.language !== "markdown" && env.language !== "md")
|
|
1091
956
|
return;
|
|
1092
|
-
}
|
|
1093
957
|
function walkTokens(tokens) {
|
|
1094
|
-
if (!tokens || typeof tokens
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
lang = (/[a-z][\w-]*/i.exec(lang) || [""])[0].toLowerCase();
|
|
1108
|
-
var alias = "language-" + lang;
|
|
1109
|
-
if (!codeBlock.alias) {
|
|
1110
|
-
codeBlock.alias = [alias];
|
|
1111
|
-
} else if (typeof codeBlock.alias === "string") {
|
|
1112
|
-
codeBlock.alias = [codeBlock.alias, alias];
|
|
1113
|
-
} else {
|
|
1114
|
-
codeBlock.alias.push(alias);
|
|
958
|
+
if (!(!tokens || typeof tokens == "string"))
|
|
959
|
+
for (var i = 0, l = tokens.length; i < l; i++) {
|
|
960
|
+
var token = tokens[i];
|
|
961
|
+
if (token.type !== "code") {
|
|
962
|
+
walkTokens(token.content);
|
|
963
|
+
continue;
|
|
964
|
+
}
|
|
965
|
+
var codeLang = token.content[1], codeBlock = token.content[3];
|
|
966
|
+
if (codeLang && codeBlock && codeLang.type === "code-language" && codeBlock.type === "code-block" && typeof codeLang.content == "string") {
|
|
967
|
+
var lang = codeLang.content.replace(/\b#/g, "sharp").replace(/\b\+\+/g, "pp");
|
|
968
|
+
lang = (/[a-z][\w-]*/i.exec(lang) || [""])[0].toLowerCase();
|
|
969
|
+
var alias = "language-" + lang;
|
|
970
|
+
codeBlock.alias ? typeof codeBlock.alias == "string" ? codeBlock.alias = [codeBlock.alias, alias] : codeBlock.alias.push(alias) : codeBlock.alias = [alias];
|
|
1115
971
|
}
|
|
1116
972
|
}
|
|
1117
|
-
}
|
|
1118
973
|
}
|
|
1119
|
-
__name(walkTokens, "walkTokens");
|
|
1120
974
|
walkTokens(env.tokens);
|
|
1121
|
-
})
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
var match = /language-(.+)/.exec(cls);
|
|
1130
|
-
if (match) {
|
|
1131
|
-
codeLang = match[1];
|
|
1132
|
-
break;
|
|
975
|
+
}), Prism2.hooks.add("wrap", function(env) {
|
|
976
|
+
if (env.type === "code-block") {
|
|
977
|
+
for (var codeLang = "", i = 0, l = env.classes.length; i < l; i++) {
|
|
978
|
+
var cls = env.classes[i], match = /language-(.+)/.exec(cls);
|
|
979
|
+
if (match) {
|
|
980
|
+
codeLang = match[1];
|
|
981
|
+
break;
|
|
982
|
+
}
|
|
1133
983
|
}
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
984
|
+
var grammar = Prism2.languages[codeLang];
|
|
985
|
+
if (grammar)
|
|
986
|
+
env.content = Prism2.highlight(
|
|
987
|
+
textContent(env.content.value),
|
|
988
|
+
grammar,
|
|
989
|
+
codeLang
|
|
990
|
+
);
|
|
991
|
+
else if (codeLang && codeLang !== "none" && Prism2.plugins.autoloader) {
|
|
1138
992
|
var id = "md-" + (/* @__PURE__ */ new Date()).valueOf() + "-" + Math.floor(Math.random() * 1e16);
|
|
1139
|
-
env.attributes
|
|
1140
|
-
Prism2.plugins.autoloader.loadLanguages(codeLang, function() {
|
|
993
|
+
env.attributes.id = id, Prism2.plugins.autoloader.loadLanguages(codeLang, function() {
|
|
1141
994
|
var ele = document.getElementById(id);
|
|
1142
|
-
|
|
1143
|
-
ele.
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
);
|
|
1148
|
-
}
|
|
995
|
+
ele && (ele.innerHTML = Prism2.highlight(
|
|
996
|
+
ele.textContent,
|
|
997
|
+
Prism2.languages[codeLang],
|
|
998
|
+
codeLang
|
|
999
|
+
));
|
|
1149
1000
|
});
|
|
1150
1001
|
}
|
|
1151
|
-
} else {
|
|
1152
|
-
env.content = Prism2.highlight(
|
|
1153
|
-
textContent(env.content.value),
|
|
1154
|
-
grammar,
|
|
1155
|
-
codeLang
|
|
1156
|
-
);
|
|
1157
1002
|
}
|
|
1158
1003
|
});
|
|
1159
|
-
var tagPattern = RegExp(Prism2.languages.markup.tag.pattern.source, "gi")
|
|
1160
|
-
var KNOWN_ENTITY_NAMES = {
|
|
1004
|
+
var tagPattern = RegExp(Prism2.languages.markup.tag.pattern.source, "gi"), KNOWN_ENTITY_NAMES = {
|
|
1161
1005
|
amp: "&",
|
|
1162
1006
|
lt: "<",
|
|
1163
1007
|
gt: ">",
|
|
1164
1008
|
quot: '"'
|
|
1165
|
-
};
|
|
1166
|
-
var fromCodePoint = String.fromCodePoint || String.fromCharCode;
|
|
1009
|
+
}, fromCodePoint = String.fromCodePoint || String.fromCharCode;
|
|
1167
1010
|
function textContent(html) {
|
|
1168
1011
|
var text = html.replace(tagPattern, "");
|
|
1169
|
-
text = text.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function(m, code) {
|
|
1170
|
-
code = code.toLowerCase()
|
|
1171
|
-
if (code[0] === "#") {
|
|
1012
|
+
return text = text.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function(m, code) {
|
|
1013
|
+
if (code = code.toLowerCase(), code[0] === "#") {
|
|
1172
1014
|
var value;
|
|
1173
|
-
|
|
1174
|
-
value = parseInt(code.slice(2), 16);
|
|
1175
|
-
} else {
|
|
1176
|
-
value = Number(code.slice(1));
|
|
1177
|
-
}
|
|
1178
|
-
return fromCodePoint(value);
|
|
1015
|
+
return code[1] === "x" ? value = parseInt(code.slice(2), 16) : value = Number(code.slice(1)), fromCodePoint(value);
|
|
1179
1016
|
} else {
|
|
1180
1017
|
var known = KNOWN_ENTITY_NAMES[code];
|
|
1181
|
-
|
|
1182
|
-
return known;
|
|
1183
|
-
}
|
|
1184
|
-
return m;
|
|
1018
|
+
return known || m;
|
|
1185
1019
|
}
|
|
1186
|
-
});
|
|
1187
|
-
return text;
|
|
1020
|
+
}), text;
|
|
1188
1021
|
}
|
|
1189
|
-
__name(textContent, "textContent");
|
|
1190
1022
|
Prism2.languages.md = Prism2.languages.markdown;
|
|
1191
1023
|
})(Prism);
|
|
1192
1024
|
}
|
|
1193
|
-
__name(markdown2, "markdown");
|
|
1194
1025
|
}
|
|
1195
1026
|
});
|
|
1196
1027
|
|
|
@@ -1205,27 +1036,27 @@ var require_markup = __commonJS({
|
|
|
1205
1036
|
Prism.languages.markup = {
|
|
1206
1037
|
comment: {
|
|
1207
1038
|
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
1208
|
-
greedy:
|
|
1039
|
+
greedy: !0
|
|
1209
1040
|
},
|
|
1210
1041
|
prolog: {
|
|
1211
1042
|
pattern: /<\?[\s\S]+?\?>/,
|
|
1212
|
-
greedy:
|
|
1043
|
+
greedy: !0
|
|
1213
1044
|
},
|
|
1214
1045
|
doctype: {
|
|
1215
1046
|
// https://www.w3.org/TR/xml/#NT-doctypedecl
|
|
1216
1047
|
pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
|
|
1217
|
-
greedy:
|
|
1048
|
+
greedy: !0,
|
|
1218
1049
|
inside: {
|
|
1219
1050
|
"internal-subset": {
|
|
1220
1051
|
pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
|
|
1221
|
-
lookbehind:
|
|
1222
|
-
greedy:
|
|
1052
|
+
lookbehind: !0,
|
|
1053
|
+
greedy: !0,
|
|
1223
1054
|
inside: null
|
|
1224
1055
|
// see below
|
|
1225
1056
|
},
|
|
1226
1057
|
string: {
|
|
1227
1058
|
pattern: /"[^"]*"|'[^']*'/,
|
|
1228
|
-
greedy:
|
|
1059
|
+
greedy: !0
|
|
1229
1060
|
},
|
|
1230
1061
|
punctuation: /^<!|>$|[[\]]/,
|
|
1231
1062
|
"doctype-tag": /^DOCTYPE/i,
|
|
@@ -1234,11 +1065,11 @@ var require_markup = __commonJS({
|
|
|
1234
1065
|
},
|
|
1235
1066
|
cdata: {
|
|
1236
1067
|
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
1237
|
-
greedy:
|
|
1068
|
+
greedy: !0
|
|
1238
1069
|
},
|
|
1239
1070
|
tag: {
|
|
1240
1071
|
pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
|
|
1241
|
-
greedy:
|
|
1072
|
+
greedy: !0,
|
|
1242
1073
|
inside: {
|
|
1243
1074
|
tag: {
|
|
1244
1075
|
pattern: /^<\/?[^\s>\/]+/,
|
|
@@ -1276,15 +1107,9 @@ var require_markup = __commonJS({
|
|
|
1276
1107
|
},
|
|
1277
1108
|
/&#x?[\da-f]{1,8};/i
|
|
1278
1109
|
]
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
Prism.languages.markup
|
|
1282
|
-
Prism.hooks.add("wrap", function(env) {
|
|
1283
|
-
if (env.type === "entity") {
|
|
1284
|
-
env.attributes["title"] = env.content.value.replace(/&/, "&");
|
|
1285
|
-
}
|
|
1286
|
-
});
|
|
1287
|
-
Object.defineProperty(Prism.languages.markup.tag, "addInlined", {
|
|
1110
|
+
}, Prism.languages.markup.tag.inside["attr-value"].inside.entity = Prism.languages.markup.entity, Prism.languages.markup.doctype.inside["internal-subset"].inside = Prism.languages.markup, Prism.hooks.add("wrap", function(env) {
|
|
1111
|
+
env.type === "entity" && (env.attributes.title = env.content.value.replace(/&/, "&"));
|
|
1112
|
+
}), Object.defineProperty(Prism.languages.markup.tag, "addInlined", {
|
|
1288
1113
|
/**
|
|
1289
1114
|
* Adds an inlined language to markup.
|
|
1290
1115
|
*
|
|
@@ -1296,14 +1121,13 @@ var require_markup = __commonJS({
|
|
|
1296
1121
|
* @example
|
|
1297
1122
|
* addInlined('style', 'css');
|
|
1298
1123
|
*/
|
|
1299
|
-
value:
|
|
1124
|
+
value: function(tagName, lang) {
|
|
1300
1125
|
var includedCdataInside = {};
|
|
1301
1126
|
includedCdataInside["language-" + lang] = {
|
|
1302
1127
|
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
1303
|
-
lookbehind:
|
|
1128
|
+
lookbehind: !0,
|
|
1304
1129
|
inside: Prism.languages[lang]
|
|
1305
|
-
};
|
|
1306
|
-
includedCdataInside["cdata"] = /^<!\[CDATA\[|\]\]>$/i;
|
|
1130
|
+
}, includedCdataInside.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
1307
1131
|
var inside = {
|
|
1308
1132
|
"included-cdata": {
|
|
1309
1133
|
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
@@ -1325,14 +1149,12 @@ var require_markup = __commonJS({
|
|
|
1325
1149
|
),
|
|
1326
1150
|
"i"
|
|
1327
1151
|
),
|
|
1328
|
-
lookbehind:
|
|
1329
|
-
greedy:
|
|
1152
|
+
lookbehind: !0,
|
|
1153
|
+
greedy: !0,
|
|
1330
1154
|
inside
|
|
1331
|
-
};
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
});
|
|
1335
|
-
Object.defineProperty(Prism.languages.markup.tag, "addAttribute", {
|
|
1155
|
+
}, Prism.languages.insertBefore("markup", "cdata", def);
|
|
1156
|
+
}
|
|
1157
|
+
}), Object.defineProperty(Prism.languages.markup.tag, "addAttribute", {
|
|
1336
1158
|
/**
|
|
1337
1159
|
* Adds an pattern to highlight languages embedded in HTML attributes.
|
|
1338
1160
|
*
|
|
@@ -1344,13 +1166,13 @@ var require_markup = __commonJS({
|
|
|
1344
1166
|
* @example
|
|
1345
1167
|
* addAttribute('style', 'css');
|
|
1346
1168
|
*/
|
|
1347
|
-
value:
|
|
1169
|
+
value: function(attrName, lang) {
|
|
1348
1170
|
Prism.languages.markup.tag.inside["special-attr"].push({
|
|
1349
1171
|
pattern: RegExp(
|
|
1350
1172
|
/(^|["'\s])/.source + "(?:" + attrName + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
|
|
1351
1173
|
"i"
|
|
1352
1174
|
),
|
|
1353
|
-
lookbehind:
|
|
1175
|
+
lookbehind: !0,
|
|
1354
1176
|
inside: {
|
|
1355
1177
|
"attr-name": /^[^\s=]+/,
|
|
1356
1178
|
"attr-value": {
|
|
@@ -1358,7 +1180,7 @@ var require_markup = __commonJS({
|
|
|
1358
1180
|
inside: {
|
|
1359
1181
|
value: {
|
|
1360
1182
|
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
1361
|
-
lookbehind:
|
|
1183
|
+
lookbehind: !0,
|
|
1362
1184
|
alias: [lang, "language-" + lang],
|
|
1363
1185
|
inside: Prism.languages[lang]
|
|
1364
1186
|
},
|
|
@@ -1373,17 +1195,9 @@ var require_markup = __commonJS({
|
|
|
1373
1195
|
}
|
|
1374
1196
|
}
|
|
1375
1197
|
});
|
|
1376
|
-
}
|
|
1377
|
-
});
|
|
1378
|
-
Prism.languages.html = Prism.languages.markup;
|
|
1379
|
-
Prism.languages.mathml = Prism.languages.markup;
|
|
1380
|
-
Prism.languages.svg = Prism.languages.markup;
|
|
1381
|
-
Prism.languages.xml = Prism.languages.extend("markup", {});
|
|
1382
|
-
Prism.languages.ssml = Prism.languages.xml;
|
|
1383
|
-
Prism.languages.atom = Prism.languages.xml;
|
|
1384
|
-
Prism.languages.rss = Prism.languages.xml;
|
|
1198
|
+
}
|
|
1199
|
+
}), Prism.languages.html = Prism.languages.markup, Prism.languages.mathml = Prism.languages.markup, Prism.languages.svg = Prism.languages.markup, Prism.languages.xml = Prism.languages.extend("markup", {}), Prism.languages.ssml = Prism.languages.xml, Prism.languages.atom = Prism.languages.xml, Prism.languages.rss = Prism.languages.xml;
|
|
1385
1200
|
}
|
|
1386
|
-
__name(markup2, "markup");
|
|
1387
1201
|
}
|
|
1388
1202
|
});
|
|
1389
1203
|
|
|
@@ -1395,31 +1209,25 @@ var require_typescript = __commonJS({
|
|
|
1395
1209
|
typescript2.displayName = "typescript";
|
|
1396
1210
|
typescript2.aliases = ["ts"];
|
|
1397
1211
|
function typescript2(Prism) {
|
|
1398
|
-
;
|
|
1399
1212
|
(function(Prism2) {
|
|
1400
1213
|
Prism2.languages.typescript = Prism2.languages.extend("javascript", {
|
|
1401
1214
|
"class-name": {
|
|
1402
1215
|
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,
|
|
1403
|
-
lookbehind:
|
|
1404
|
-
greedy:
|
|
1216
|
+
lookbehind: !0,
|
|
1217
|
+
greedy: !0,
|
|
1405
1218
|
inside: null
|
|
1406
1219
|
// see below
|
|
1407
1220
|
},
|
|
1408
1221
|
builtin: /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/
|
|
1409
|
-
})
|
|
1410
|
-
Prism2.languages.typescript.keyword.push(
|
|
1222
|
+
}), Prism2.languages.typescript.keyword.push(
|
|
1411
1223
|
/\b(?:abstract|declare|is|keyof|readonly|require)\b/,
|
|
1412
1224
|
// keywords that have to be followed by an identifier
|
|
1413
1225
|
/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,
|
|
1414
1226
|
// This is for `import type *, {}`
|
|
1415
1227
|
/\btype\b(?=\s*(?:[\{*]|$))/
|
|
1416
|
-
);
|
|
1417
|
-
delete Prism2.languages.typescript["parameter"];
|
|
1418
|
-
delete Prism2.languages.typescript["literal-property"];
|
|
1228
|
+
), delete Prism2.languages.typescript.parameter, delete Prism2.languages.typescript["literal-property"];
|
|
1419
1229
|
var typeInside = Prism2.languages.extend("typescript", {});
|
|
1420
|
-
delete typeInside["class-name"]
|
|
1421
|
-
Prism2.languages.typescript["class-name"].inside = typeInside;
|
|
1422
|
-
Prism2.languages.insertBefore("typescript", "function", {
|
|
1230
|
+
delete typeInside["class-name"], Prism2.languages.typescript["class-name"].inside = typeInside, Prism2.languages.insertBefore("typescript", "function", {
|
|
1423
1231
|
decorator: {
|
|
1424
1232
|
pattern: /@[$\w\xA0-\uFFFF]+/,
|
|
1425
1233
|
inside: {
|
|
@@ -1433,7 +1241,7 @@ var require_typescript = __commonJS({
|
|
|
1433
1241
|
"generic-function": {
|
|
1434
1242
|
// e.g. foo<T extends "bar" | "baz">( ...
|
|
1435
1243
|
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,
|
|
1436
|
-
greedy:
|
|
1244
|
+
greedy: !0,
|
|
1437
1245
|
inside: {
|
|
1438
1246
|
function: /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,
|
|
1439
1247
|
generic: {
|
|
@@ -1444,11 +1252,9 @@ var require_typescript = __commonJS({
|
|
|
1444
1252
|
}
|
|
1445
1253
|
}
|
|
1446
1254
|
}
|
|
1447
|
-
});
|
|
1448
|
-
Prism2.languages.ts = Prism2.languages.typescript;
|
|
1255
|
+
}), Prism2.languages.ts = Prism2.languages.typescript;
|
|
1449
1256
|
})(Prism);
|
|
1450
1257
|
}
|
|
1451
|
-
__name(typescript2, "typescript");
|
|
1452
1258
|
}
|
|
1453
1259
|
});
|
|
1454
1260
|
|
|
@@ -1456,28 +1262,21 @@ var require_typescript = __commonJS({
|
|
|
1456
1262
|
var require_tsx = __commonJS({
|
|
1457
1263
|
"../node_modules/refractor/lang/tsx.js"(exports, module) {
|
|
1458
1264
|
"use strict";
|
|
1459
|
-
var refractorJsx = require_jsx();
|
|
1460
|
-
var refractorTypescript = require_typescript();
|
|
1265
|
+
var refractorJsx = require_jsx(), refractorTypescript = require_typescript();
|
|
1461
1266
|
module.exports = tsx2;
|
|
1462
1267
|
tsx2.displayName = "tsx";
|
|
1463
1268
|
tsx2.aliases = [];
|
|
1464
1269
|
function tsx2(Prism) {
|
|
1465
|
-
Prism.register(refractorJsx)
|
|
1466
|
-
Prism.register(refractorTypescript);
|
|
1467
|
-
(function(Prism2) {
|
|
1270
|
+
Prism.register(refractorJsx), Prism.register(refractorTypescript), (function(Prism2) {
|
|
1468
1271
|
var typescript2 = Prism2.util.clone(Prism2.languages.typescript);
|
|
1469
|
-
Prism2.languages.tsx = Prism2.languages.extend("jsx", typescript2);
|
|
1470
|
-
delete Prism2.languages.tsx["parameter"];
|
|
1471
|
-
delete Prism2.languages.tsx["literal-property"];
|
|
1272
|
+
Prism2.languages.tsx = Prism2.languages.extend("jsx", typescript2), delete Prism2.languages.tsx.parameter, delete Prism2.languages.tsx["literal-property"];
|
|
1472
1273
|
var tag = Prism2.languages.tsx.tag;
|
|
1473
1274
|
tag.pattern = RegExp(
|
|
1474
1275
|
/(^|[^\w$]|(?=<\/))/.source + "(?:" + tag.pattern.source + ")",
|
|
1475
1276
|
tag.pattern.flags
|
|
1476
|
-
);
|
|
1477
|
-
tag.lookbehind = true;
|
|
1277
|
+
), tag.lookbehind = !0;
|
|
1478
1278
|
})(Prism);
|
|
1479
1279
|
}
|
|
1480
|
-
__name(tsx2, "tsx");
|
|
1481
1280
|
}
|
|
1482
1281
|
});
|
|
1483
1282
|
|
|
@@ -1489,18 +1288,13 @@ var require_yaml = __commonJS({
|
|
|
1489
1288
|
yaml2.displayName = "yaml";
|
|
1490
1289
|
yaml2.aliases = ["yml"];
|
|
1491
1290
|
function yaml2(Prism) {
|
|
1492
|
-
;
|
|
1493
1291
|
(function(Prism2) {
|
|
1494
|
-
var anchorOrAlias = /[*&][^\s[\]{},]
|
|
1495
|
-
var tag = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/;
|
|
1496
|
-
var properties = "(?:" + tag.source + "(?:[ ]+" + anchorOrAlias.source + ")?|" + anchorOrAlias.source + "(?:[ ]+" + tag.source + ")?)";
|
|
1497
|
-
var plainKey = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(
|
|
1292
|
+
var anchorOrAlias = /[*&][^\s[\]{},]+/, tag = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/, properties = "(?:" + tag.source + "(?:[ ]+" + anchorOrAlias.source + ")?|" + anchorOrAlias.source + "(?:[ ]+" + tag.source + ")?)", plainKey = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(
|
|
1498
1293
|
/<PLAIN>/g,
|
|
1499
1294
|
function() {
|
|
1500
1295
|
return /[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source;
|
|
1501
1296
|
}
|
|
1502
|
-
);
|
|
1503
|
-
var string = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
|
|
1297
|
+
), string = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
|
|
1504
1298
|
function createValuePattern(value, flags) {
|
|
1505
1299
|
flags = (flags || "").replace(/m/g, "") + "m";
|
|
1506
1300
|
var pattern = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g, function() {
|
|
@@ -1510,7 +1304,6 @@ var require_yaml = __commonJS({
|
|
|
1510
1304
|
});
|
|
1511
1305
|
return RegExp(pattern, flags);
|
|
1512
1306
|
}
|
|
1513
|
-
__name(createValuePattern, "createValuePattern");
|
|
1514
1307
|
Prism2.languages.yaml = {
|
|
1515
1308
|
scalar: {
|
|
1516
1309
|
pattern: RegExp(
|
|
@@ -1521,7 +1314,7 @@ var require_yaml = __commonJS({
|
|
|
1521
1314
|
}
|
|
1522
1315
|
)
|
|
1523
1316
|
),
|
|
1524
|
-
lookbehind:
|
|
1317
|
+
lookbehind: !0,
|
|
1525
1318
|
alias: "string"
|
|
1526
1319
|
},
|
|
1527
1320
|
comment: /#.*/,
|
|
@@ -1533,52 +1326,50 @@ var require_yaml = __commonJS({
|
|
|
1533
1326
|
return "(?:" + plainKey + "|" + string + ")";
|
|
1534
1327
|
})
|
|
1535
1328
|
),
|
|
1536
|
-
lookbehind:
|
|
1537
|
-
greedy:
|
|
1329
|
+
lookbehind: !0,
|
|
1330
|
+
greedy: !0,
|
|
1538
1331
|
alias: "atrule"
|
|
1539
1332
|
},
|
|
1540
1333
|
directive: {
|
|
1541
1334
|
pattern: /(^[ \t]*)%.+/m,
|
|
1542
|
-
lookbehind:
|
|
1335
|
+
lookbehind: !0,
|
|
1543
1336
|
alias: "important"
|
|
1544
1337
|
},
|
|
1545
1338
|
datetime: {
|
|
1546
1339
|
pattern: createValuePattern(
|
|
1547
1340
|
/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source
|
|
1548
1341
|
),
|
|
1549
|
-
lookbehind:
|
|
1342
|
+
lookbehind: !0,
|
|
1550
1343
|
alias: "number"
|
|
1551
1344
|
},
|
|
1552
1345
|
boolean: {
|
|
1553
1346
|
pattern: createValuePattern(/false|true/.source, "i"),
|
|
1554
|
-
lookbehind:
|
|
1347
|
+
lookbehind: !0,
|
|
1555
1348
|
alias: "important"
|
|
1556
1349
|
},
|
|
1557
1350
|
null: {
|
|
1558
1351
|
pattern: createValuePattern(/null|~/.source, "i"),
|
|
1559
|
-
lookbehind:
|
|
1352
|
+
lookbehind: !0,
|
|
1560
1353
|
alias: "important"
|
|
1561
1354
|
},
|
|
1562
1355
|
string: {
|
|
1563
1356
|
pattern: createValuePattern(string),
|
|
1564
|
-
lookbehind:
|
|
1565
|
-
greedy:
|
|
1357
|
+
lookbehind: !0,
|
|
1358
|
+
greedy: !0
|
|
1566
1359
|
},
|
|
1567
1360
|
number: {
|
|
1568
1361
|
pattern: createValuePattern(
|
|
1569
1362
|
/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,
|
|
1570
1363
|
"i"
|
|
1571
1364
|
),
|
|
1572
|
-
lookbehind:
|
|
1365
|
+
lookbehind: !0
|
|
1573
1366
|
},
|
|
1574
1367
|
tag,
|
|
1575
1368
|
important: anchorOrAlias,
|
|
1576
1369
|
punctuation: /---|[:[\]{}\-,|>?]|\.\.\./
|
|
1577
|
-
};
|
|
1578
|
-
Prism2.languages.yml = Prism2.languages.yaml;
|
|
1370
|
+
}, Prism2.languages.yml = Prism2.languages.yaml;
|
|
1579
1371
|
})(Prism);
|
|
1580
1372
|
}
|
|
1581
|
-
__name(yaml2, "yaml");
|
|
1582
1373
|
}
|
|
1583
1374
|
});
|
|
1584
1375
|
|
|
@@ -1588,18 +1379,13 @@ var require_immutable = __commonJS({
|
|
|
1588
1379
|
module.exports = extend;
|
|
1589
1380
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1590
1381
|
function extend() {
|
|
1591
|
-
var target = {};
|
|
1592
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
1382
|
+
for (var target = {}, i = 0; i < arguments.length; i++) {
|
|
1593
1383
|
var source = arguments[i];
|
|
1594
|
-
for (var key in source)
|
|
1595
|
-
|
|
1596
|
-
target[key] = source[key];
|
|
1597
|
-
}
|
|
1598
|
-
}
|
|
1384
|
+
for (var key in source)
|
|
1385
|
+
hasOwnProperty.call(source, key) && (target[key] = source[key]);
|
|
1599
1386
|
}
|
|
1600
1387
|
return target;
|
|
1601
1388
|
}
|
|
1602
|
-
__name(extend, "extend");
|
|
1603
1389
|
}
|
|
1604
1390
|
});
|
|
1605
1391
|
|
|
@@ -1613,13 +1399,8 @@ var require_schema = __commonJS({
|
|
|
1613
1399
|
proto.normal = {};
|
|
1614
1400
|
proto.property = {};
|
|
1615
1401
|
function Schema(property, normal, space) {
|
|
1616
|
-
this.property = property;
|
|
1617
|
-
this.normal = normal;
|
|
1618
|
-
if (space) {
|
|
1619
|
-
this.space = space;
|
|
1620
|
-
}
|
|
1402
|
+
this.property = property, this.normal = normal, space && (this.space = space);
|
|
1621
1403
|
}
|
|
1622
|
-
__name(Schema, "Schema");
|
|
1623
1404
|
}
|
|
1624
1405
|
});
|
|
1625
1406
|
|
|
@@ -1627,29 +1408,17 @@ var require_schema = __commonJS({
|
|
|
1627
1408
|
var require_merge = __commonJS({
|
|
1628
1409
|
"../node_modules/hastscript/node_modules/property-information/lib/util/merge.js"(exports, module) {
|
|
1629
1410
|
"use strict";
|
|
1630
|
-
var xtend = require_immutable();
|
|
1631
|
-
var Schema = require_schema();
|
|
1411
|
+
var xtend = require_immutable(), Schema = require_schema();
|
|
1632
1412
|
module.exports = merge;
|
|
1633
1413
|
function merge(definitions) {
|
|
1634
|
-
var length = definitions.length;
|
|
1635
|
-
|
|
1636
|
-
var normal = [];
|
|
1637
|
-
var index = -1;
|
|
1638
|
-
var info;
|
|
1639
|
-
var space;
|
|
1640
|
-
while (++index < length) {
|
|
1641
|
-
info = definitions[index];
|
|
1642
|
-
property.push(info.property);
|
|
1643
|
-
normal.push(info.normal);
|
|
1644
|
-
space = info.space;
|
|
1645
|
-
}
|
|
1414
|
+
for (var length = definitions.length, property = [], normal = [], index = -1, info, space; ++index < length; )
|
|
1415
|
+
info = definitions[index], property.push(info.property), normal.push(info.normal), space = info.space;
|
|
1646
1416
|
return new Schema(
|
|
1647
1417
|
xtend.apply(null, property),
|
|
1648
1418
|
xtend.apply(null, normal),
|
|
1649
1419
|
space
|
|
1650
1420
|
);
|
|
1651
1421
|
}
|
|
1652
|
-
__name(merge, "merge");
|
|
1653
1422
|
}
|
|
1654
1423
|
});
|
|
1655
1424
|
|
|
@@ -1661,7 +1430,6 @@ var require_normalize = __commonJS({
|
|
|
1661
1430
|
function normalize(value) {
|
|
1662
1431
|
return value.toLowerCase();
|
|
1663
1432
|
}
|
|
1664
|
-
__name(normalize, "normalize");
|
|
1665
1433
|
}
|
|
1666
1434
|
});
|
|
1667
1435
|
|
|
@@ -1674,20 +1442,18 @@ var require_info = __commonJS({
|
|
|
1674
1442
|
proto.space = null;
|
|
1675
1443
|
proto.attribute = null;
|
|
1676
1444
|
proto.property = null;
|
|
1677
|
-
proto.boolean =
|
|
1678
|
-
proto.booleanish =
|
|
1679
|
-
proto.overloadedBoolean =
|
|
1680
|
-
proto.number =
|
|
1681
|
-
proto.commaSeparated =
|
|
1682
|
-
proto.spaceSeparated =
|
|
1683
|
-
proto.commaOrSpaceSeparated =
|
|
1684
|
-
proto.mustUseProperty =
|
|
1685
|
-
proto.defined =
|
|
1445
|
+
proto.boolean = !1;
|
|
1446
|
+
proto.booleanish = !1;
|
|
1447
|
+
proto.overloadedBoolean = !1;
|
|
1448
|
+
proto.number = !1;
|
|
1449
|
+
proto.commaSeparated = !1;
|
|
1450
|
+
proto.spaceSeparated = !1;
|
|
1451
|
+
proto.commaOrSpaceSeparated = !1;
|
|
1452
|
+
proto.mustUseProperty = !1;
|
|
1453
|
+
proto.defined = !1;
|
|
1686
1454
|
function Info(property, attribute) {
|
|
1687
|
-
this.property = property;
|
|
1688
|
-
this.attribute = attribute;
|
|
1455
|
+
this.property = property, this.attribute = attribute;
|
|
1689
1456
|
}
|
|
1690
|
-
__name(Info, "Info");
|
|
1691
1457
|
}
|
|
1692
1458
|
});
|
|
1693
1459
|
|
|
@@ -1706,7 +1472,6 @@ var require_types = __commonJS({
|
|
|
1706
1472
|
function increment() {
|
|
1707
1473
|
return Math.pow(2, ++powers);
|
|
1708
1474
|
}
|
|
1709
|
-
__name(increment, "increment");
|
|
1710
1475
|
}
|
|
1711
1476
|
});
|
|
1712
1477
|
|
|
@@ -1714,11 +1479,10 @@ var require_types = __commonJS({
|
|
|
1714
1479
|
var require_defined_info = __commonJS({
|
|
1715
1480
|
"../node_modules/hastscript/node_modules/property-information/lib/util/defined-info.js"(exports, module) {
|
|
1716
1481
|
"use strict";
|
|
1717
|
-
var Info = require_info();
|
|
1718
|
-
var types = require_types();
|
|
1482
|
+
var Info = require_info(), types = require_types();
|
|
1719
1483
|
module.exports = DefinedInfo;
|
|
1720
1484
|
DefinedInfo.prototype = new Info();
|
|
1721
|
-
DefinedInfo.prototype.defined =
|
|
1485
|
+
DefinedInfo.prototype.defined = !0;
|
|
1722
1486
|
var checks = [
|
|
1723
1487
|
"boolean",
|
|
1724
1488
|
"booleanish",
|
|
@@ -1727,25 +1491,15 @@ var require_defined_info = __commonJS({
|
|
|
1727
1491
|
"commaSeparated",
|
|
1728
1492
|
"spaceSeparated",
|
|
1729
1493
|
"commaOrSpaceSeparated"
|
|
1730
|
-
];
|
|
1731
|
-
var checksLength = checks.length;
|
|
1494
|
+
], checksLength = checks.length;
|
|
1732
1495
|
function DefinedInfo(property, attribute, mask, space) {
|
|
1733
|
-
var index = -1;
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
Info.call(this, property, attribute);
|
|
1737
|
-
while (++index < checksLength) {
|
|
1738
|
-
check = checks[index];
|
|
1739
|
-
mark(this, check, (mask & types[check]) === types[check]);
|
|
1740
|
-
}
|
|
1496
|
+
var index = -1, check;
|
|
1497
|
+
for (mark(this, "space", space), Info.call(this, property, attribute); ++index < checksLength; )
|
|
1498
|
+
check = checks[index], mark(this, check, (mask & types[check]) === types[check]);
|
|
1741
1499
|
}
|
|
1742
|
-
__name(DefinedInfo, "DefinedInfo");
|
|
1743
1500
|
function mark(values, key, value) {
|
|
1744
|
-
|
|
1745
|
-
values[key] = value;
|
|
1746
|
-
}
|
|
1501
|
+
value && (values[key] = value);
|
|
1747
1502
|
}
|
|
1748
|
-
__name(mark, "mark");
|
|
1749
1503
|
}
|
|
1750
1504
|
});
|
|
1751
1505
|
|
|
@@ -1753,37 +1507,19 @@ var require_defined_info = __commonJS({
|
|
|
1753
1507
|
var require_create = __commonJS({
|
|
1754
1508
|
"../node_modules/hastscript/node_modules/property-information/lib/util/create.js"(exports, module) {
|
|
1755
1509
|
"use strict";
|
|
1756
|
-
var normalize = require_normalize();
|
|
1757
|
-
var Schema = require_schema();
|
|
1758
|
-
var DefinedInfo = require_defined_info();
|
|
1510
|
+
var normalize = require_normalize(), Schema = require_schema(), DefinedInfo = require_defined_info();
|
|
1759
1511
|
module.exports = create;
|
|
1760
1512
|
function create(definition) {
|
|
1761
|
-
var space = definition.space;
|
|
1762
|
-
|
|
1763
|
-
var attributes = definition.attributes || {};
|
|
1764
|
-
var props = definition.properties;
|
|
1765
|
-
var transform = definition.transform;
|
|
1766
|
-
var property = {};
|
|
1767
|
-
var normal = {};
|
|
1768
|
-
var prop;
|
|
1769
|
-
var info;
|
|
1770
|
-
for (prop in props) {
|
|
1513
|
+
var space = definition.space, mustUseProperty = definition.mustUseProperty || [], attributes = definition.attributes || {}, props = definition.properties, transform = definition.transform, property = {}, normal = {}, prop, info;
|
|
1514
|
+
for (prop in props)
|
|
1771
1515
|
info = new DefinedInfo(
|
|
1772
1516
|
prop,
|
|
1773
1517
|
transform(attributes, prop),
|
|
1774
1518
|
props[prop],
|
|
1775
1519
|
space
|
|
1776
|
-
);
|
|
1777
|
-
if (mustUseProperty.indexOf(prop) !== -1) {
|
|
1778
|
-
info.mustUseProperty = true;
|
|
1779
|
-
}
|
|
1780
|
-
property[prop] = info;
|
|
1781
|
-
normal[normalize(prop)] = prop;
|
|
1782
|
-
normal[normalize(info.attribute)] = prop;
|
|
1783
|
-
}
|
|
1520
|
+
), mustUseProperty.indexOf(prop) !== -1 && (info.mustUseProperty = !0), property[prop] = info, normal[normalize(prop)] = prop, normal[normalize(info.attribute)] = prop;
|
|
1784
1521
|
return new Schema(property, normal, space);
|
|
1785
1522
|
}
|
|
1786
|
-
__name(create, "create");
|
|
1787
1523
|
}
|
|
1788
1524
|
});
|
|
1789
1525
|
|
|
@@ -1808,7 +1544,6 @@ var require_xlink = __commonJS({
|
|
|
1808
1544
|
function xlinkTransform(_, prop) {
|
|
1809
1545
|
return "xlink:" + prop.slice(5).toLowerCase();
|
|
1810
1546
|
}
|
|
1811
|
-
__name(xlinkTransform, "xlinkTransform");
|
|
1812
1547
|
}
|
|
1813
1548
|
});
|
|
1814
1549
|
|
|
@@ -1829,7 +1564,6 @@ var require_xml = __commonJS({
|
|
|
1829
1564
|
function xmlTransform(_, prop) {
|
|
1830
1565
|
return "xml:" + prop.slice(3).toLowerCase();
|
|
1831
1566
|
}
|
|
1832
|
-
__name(xmlTransform, "xmlTransform");
|
|
1833
1567
|
}
|
|
1834
1568
|
});
|
|
1835
1569
|
|
|
@@ -1841,7 +1575,6 @@ var require_case_sensitive_transform = __commonJS({
|
|
|
1841
1575
|
function caseSensitiveTransform(attributes, attribute) {
|
|
1842
1576
|
return attribute in attributes ? attributes[attribute] : attribute;
|
|
1843
1577
|
}
|
|
1844
|
-
__name(caseSensitiveTransform, "caseSensitiveTransform");
|
|
1845
1578
|
}
|
|
1846
1579
|
});
|
|
1847
1580
|
|
|
@@ -1854,7 +1587,6 @@ var require_case_insensitive_transform = __commonJS({
|
|
|
1854
1587
|
function caseInsensitiveTransform(attributes, property) {
|
|
1855
1588
|
return caseSensitiveTransform(attributes, property.toLowerCase());
|
|
1856
1589
|
}
|
|
1857
|
-
__name(caseInsensitiveTransform, "caseInsensitiveTransform");
|
|
1858
1590
|
}
|
|
1859
1591
|
});
|
|
1860
1592
|
|
|
@@ -1862,8 +1594,7 @@ var require_case_insensitive_transform = __commonJS({
|
|
|
1862
1594
|
var require_xmlns = __commonJS({
|
|
1863
1595
|
"../node_modules/hastscript/node_modules/property-information/lib/xmlns.js"(exports, module) {
|
|
1864
1596
|
"use strict";
|
|
1865
|
-
var create = require_create();
|
|
1866
|
-
var caseInsensitiveTransform = require_case_insensitive_transform();
|
|
1597
|
+
var create = require_create(), caseInsensitiveTransform = require_case_insensitive_transform();
|
|
1867
1598
|
module.exports = create({
|
|
1868
1599
|
space: "xmlns",
|
|
1869
1600
|
attributes: {
|
|
@@ -1882,11 +1613,7 @@ var require_xmlns = __commonJS({
|
|
|
1882
1613
|
var require_aria = __commonJS({
|
|
1883
1614
|
"../node_modules/hastscript/node_modules/property-information/lib/aria.js"(exports, module) {
|
|
1884
1615
|
"use strict";
|
|
1885
|
-
var types = require_types();
|
|
1886
|
-
var create = require_create();
|
|
1887
|
-
var booleanish = types.booleanish;
|
|
1888
|
-
var number = types.number;
|
|
1889
|
-
var spaceSeparated = types.spaceSeparated;
|
|
1616
|
+
var types = require_types(), create = require_create(), booleanish = types.booleanish, number = types.number, spaceSeparated = types.spaceSeparated;
|
|
1890
1617
|
module.exports = create({
|
|
1891
1618
|
transform: ariaTransform,
|
|
1892
1619
|
properties: {
|
|
@@ -1944,7 +1671,6 @@ var require_aria = __commonJS({
|
|
|
1944
1671
|
function ariaTransform(_, prop) {
|
|
1945
1672
|
return prop === "role" ? prop : "aria-" + prop.slice(4).toLowerCase();
|
|
1946
1673
|
}
|
|
1947
|
-
__name(ariaTransform, "ariaTransform");
|
|
1948
1674
|
}
|
|
1949
1675
|
});
|
|
1950
1676
|
|
|
@@ -1952,15 +1678,7 @@ var require_aria = __commonJS({
|
|
|
1952
1678
|
var require_html = __commonJS({
|
|
1953
1679
|
"../node_modules/hastscript/node_modules/property-information/lib/html.js"(exports, module) {
|
|
1954
1680
|
"use strict";
|
|
1955
|
-
var types = require_types();
|
|
1956
|
-
var create = require_create();
|
|
1957
|
-
var caseInsensitiveTransform = require_case_insensitive_transform();
|
|
1958
|
-
var boolean = types.boolean;
|
|
1959
|
-
var overloadedBoolean = types.overloadedBoolean;
|
|
1960
|
-
var booleanish = types.booleanish;
|
|
1961
|
-
var number = types.number;
|
|
1962
|
-
var spaceSeparated = types.spaceSeparated;
|
|
1963
|
-
var commaSeparated = types.commaSeparated;
|
|
1681
|
+
var types = require_types(), create = require_create(), caseInsensitiveTransform = require_case_insensitive_transform(), boolean = types.boolean, overloadedBoolean = types.overloadedBoolean, booleanish = types.booleanish, number = types.number, spaceSeparated = types.spaceSeparated, commaSeparated = types.commaSeparated;
|
|
1964
1682
|
module.exports = create({
|
|
1965
1683
|
space: "html",
|
|
1966
1684
|
attributes: {
|
|
@@ -2315,12 +2033,7 @@ var require_html = __commonJS({
|
|
|
2315
2033
|
var require_html2 = __commonJS({
|
|
2316
2034
|
"../node_modules/hastscript/node_modules/property-information/html.js"(exports, module) {
|
|
2317
2035
|
"use strict";
|
|
2318
|
-
var merge = require_merge();
|
|
2319
|
-
var xlink = require_xlink();
|
|
2320
|
-
var xml = require_xml();
|
|
2321
|
-
var xmlns = require_xmlns();
|
|
2322
|
-
var aria = require_aria();
|
|
2323
|
-
var html = require_html();
|
|
2036
|
+
var merge = require_merge(), xlink = require_xlink(), xml = require_xml(), xmlns = require_xmlns(), aria = require_aria(), html = require_html();
|
|
2324
2037
|
module.exports = merge([xml, xlink, xmlns, aria, html]);
|
|
2325
2038
|
}
|
|
2326
2039
|
});
|
|
@@ -2329,57 +2042,27 @@ var require_html2 = __commonJS({
|
|
|
2329
2042
|
var require_find = __commonJS({
|
|
2330
2043
|
"../node_modules/hastscript/node_modules/property-information/find.js"(exports, module) {
|
|
2331
2044
|
"use strict";
|
|
2332
|
-
var normalize = require_normalize();
|
|
2333
|
-
var DefinedInfo = require_defined_info();
|
|
2334
|
-
var Info = require_info();
|
|
2335
|
-
var data = "data";
|
|
2045
|
+
var normalize = require_normalize(), DefinedInfo = require_defined_info(), Info = require_info(), data = "data";
|
|
2336
2046
|
module.exports = find;
|
|
2337
|
-
var valid = /^data[-\w.:]+$/i;
|
|
2338
|
-
var dash = /-[a-z]/g;
|
|
2339
|
-
var cap = /[A-Z]/g;
|
|
2047
|
+
var valid = /^data[-\w.:]+$/i, dash = /-[a-z]/g, cap = /[A-Z]/g;
|
|
2340
2048
|
function find(schema, value) {
|
|
2341
|
-
var normal = normalize(value);
|
|
2342
|
-
|
|
2343
|
-
var Type = Info;
|
|
2344
|
-
if (normal in schema.normal) {
|
|
2345
|
-
return schema.property[schema.normal[normal]];
|
|
2346
|
-
}
|
|
2347
|
-
if (normal.length > 4 && normal.slice(0, 4) === data && valid.test(value)) {
|
|
2348
|
-
if (value.charAt(4) === "-") {
|
|
2349
|
-
prop = datasetToProperty(value);
|
|
2350
|
-
} else {
|
|
2351
|
-
value = datasetToAttribute(value);
|
|
2352
|
-
}
|
|
2353
|
-
Type = DefinedInfo;
|
|
2354
|
-
}
|
|
2355
|
-
return new Type(prop, value);
|
|
2049
|
+
var normal = normalize(value), prop = value, Type = Info;
|
|
2050
|
+
return normal in schema.normal ? schema.property[schema.normal[normal]] : (normal.length > 4 && normal.slice(0, 4) === data && valid.test(value) && (value.charAt(4) === "-" ? prop = datasetToProperty(value) : value = datasetToAttribute(value), Type = DefinedInfo), new Type(prop, value));
|
|
2356
2051
|
}
|
|
2357
|
-
__name(find, "find");
|
|
2358
2052
|
function datasetToProperty(attribute) {
|
|
2359
2053
|
var value = attribute.slice(5).replace(dash, camelcase);
|
|
2360
2054
|
return data + value.charAt(0).toUpperCase() + value.slice(1);
|
|
2361
2055
|
}
|
|
2362
|
-
__name(datasetToProperty, "datasetToProperty");
|
|
2363
2056
|
function datasetToAttribute(property) {
|
|
2364
2057
|
var value = property.slice(4);
|
|
2365
|
-
|
|
2366
|
-
return property;
|
|
2367
|
-
}
|
|
2368
|
-
value = value.replace(cap, kebab);
|
|
2369
|
-
if (value.charAt(0) !== "-") {
|
|
2370
|
-
value = "-" + value;
|
|
2371
|
-
}
|
|
2372
|
-
return data + value;
|
|
2058
|
+
return dash.test(value) ? property : (value = value.replace(cap, kebab), value.charAt(0) !== "-" && (value = "-" + value), data + value);
|
|
2373
2059
|
}
|
|
2374
|
-
__name(datasetToAttribute, "datasetToAttribute");
|
|
2375
2060
|
function kebab($0) {
|
|
2376
2061
|
return "-" + $0.toLowerCase();
|
|
2377
2062
|
}
|
|
2378
|
-
__name(kebab, "kebab");
|
|
2379
2063
|
function camelcase($0) {
|
|
2380
2064
|
return $0.charAt(1).toUpperCase();
|
|
2381
2065
|
}
|
|
2382
|
-
__name(camelcase, "camelcase");
|
|
2383
2066
|
}
|
|
2384
2067
|
});
|
|
2385
2068
|
|
|
@@ -2390,37 +2073,10 @@ var require_hast_util_parse_selector = __commonJS({
|
|
|
2390
2073
|
module.exports = parse;
|
|
2391
2074
|
var search = /[#.]/g;
|
|
2392
2075
|
function parse(selector, defaultTagName) {
|
|
2393
|
-
var value = selector || "";
|
|
2394
|
-
|
|
2395
|
-
var props = {};
|
|
2396
|
-
var start = 0;
|
|
2397
|
-
var subvalue;
|
|
2398
|
-
var previous;
|
|
2399
|
-
var match;
|
|
2400
|
-
while (start < value.length) {
|
|
2401
|
-
search.lastIndex = start;
|
|
2402
|
-
match = search.exec(value);
|
|
2403
|
-
subvalue = value.slice(start, match ? match.index : value.length);
|
|
2404
|
-
if (subvalue) {
|
|
2405
|
-
if (!previous) {
|
|
2406
|
-
name = subvalue;
|
|
2407
|
-
} else if (previous === "#") {
|
|
2408
|
-
props.id = subvalue;
|
|
2409
|
-
} else if (props.className) {
|
|
2410
|
-
props.className.push(subvalue);
|
|
2411
|
-
} else {
|
|
2412
|
-
props.className = [subvalue];
|
|
2413
|
-
}
|
|
2414
|
-
start += subvalue.length;
|
|
2415
|
-
}
|
|
2416
|
-
if (match) {
|
|
2417
|
-
previous = match[0];
|
|
2418
|
-
start++;
|
|
2419
|
-
}
|
|
2420
|
-
}
|
|
2076
|
+
for (var value = selector || "", name = defaultTagName || "div", props = {}, start = 0, subvalue, previous, match; start < value.length; )
|
|
2077
|
+
search.lastIndex = start, match = search.exec(value), subvalue = value.slice(start, match ? match.index : value.length), subvalue && (previous ? previous === "#" ? props.id = subvalue : props.className ? props.className.push(subvalue) : props.className = [subvalue] : name = subvalue, start += subvalue.length), match && (previous = match[0], start++);
|
|
2421
2078
|
return { type: "element", tagName: name, properties: props, children: [] };
|
|
2422
2079
|
}
|
|
2423
|
-
__name(parse, "parse");
|
|
2424
2080
|
}
|
|
2425
2081
|
});
|
|
2426
2082
|
|
|
@@ -2430,18 +2086,14 @@ var require_space_separated_tokens = __commonJS({
|
|
|
2430
2086
|
"use strict";
|
|
2431
2087
|
exports.parse = parse;
|
|
2432
2088
|
exports.stringify = stringify;
|
|
2433
|
-
var empty = "";
|
|
2434
|
-
var space = " ";
|
|
2435
|
-
var whiteSpace = /[ \t\n\r\f]+/g;
|
|
2089
|
+
var empty = "", space = " ", whiteSpace = /[ \t\n\r\f]+/g;
|
|
2436
2090
|
function parse(value) {
|
|
2437
2091
|
var input = String(value || empty).trim();
|
|
2438
2092
|
return input === empty ? [] : input.split(whiteSpace);
|
|
2439
2093
|
}
|
|
2440
|
-
__name(parse, "parse");
|
|
2441
2094
|
function stringify(values) {
|
|
2442
2095
|
return values.join(space).trim();
|
|
2443
2096
|
}
|
|
2444
|
-
__name(stringify, "stringify");
|
|
2445
2097
|
}
|
|
2446
2098
|
});
|
|
2447
2099
|
|
|
@@ -2451,41 +2103,16 @@ var require_comma_separated_tokens = __commonJS({
|
|
|
2451
2103
|
"use strict";
|
|
2452
2104
|
exports.parse = parse;
|
|
2453
2105
|
exports.stringify = stringify;
|
|
2454
|
-
var comma = ",";
|
|
2455
|
-
var space = " ";
|
|
2456
|
-
var empty = "";
|
|
2106
|
+
var comma = ",", space = " ", empty = "";
|
|
2457
2107
|
function parse(value) {
|
|
2458
|
-
var values = [];
|
|
2459
|
-
|
|
2460
|
-
var index = input.indexOf(comma);
|
|
2461
|
-
var lastIndex = 0;
|
|
2462
|
-
var end = false;
|
|
2463
|
-
var val;
|
|
2464
|
-
while (!end) {
|
|
2465
|
-
if (index === -1) {
|
|
2466
|
-
index = input.length;
|
|
2467
|
-
end = true;
|
|
2468
|
-
}
|
|
2469
|
-
val = input.slice(lastIndex, index).trim();
|
|
2470
|
-
if (val || !end) {
|
|
2471
|
-
values.push(val);
|
|
2472
|
-
}
|
|
2473
|
-
lastIndex = index + 1;
|
|
2474
|
-
index = input.indexOf(comma, lastIndex);
|
|
2475
|
-
}
|
|
2108
|
+
for (var values = [], input = String(value || empty), index = input.indexOf(comma), lastIndex = 0, end = !1, val; !end; )
|
|
2109
|
+
index === -1 && (index = input.length, end = !0), val = input.slice(lastIndex, index).trim(), (val || !end) && values.push(val), lastIndex = index + 1, index = input.indexOf(comma, lastIndex);
|
|
2476
2110
|
return values;
|
|
2477
2111
|
}
|
|
2478
|
-
__name(parse, "parse");
|
|
2479
2112
|
function stringify(values, options) {
|
|
2480
|
-
var settings = options || {};
|
|
2481
|
-
|
|
2482
|
-
var right = settings.padRight ? space : empty;
|
|
2483
|
-
if (values[values.length - 1] === empty) {
|
|
2484
|
-
values = values.concat(empty);
|
|
2485
|
-
}
|
|
2486
|
-
return values.join(right + comma + left).trim();
|
|
2113
|
+
var settings = options || {}, left = settings.padLeft === !1 ? empty : space, right = settings.padRight ? space : empty;
|
|
2114
|
+
return values[values.length - 1] === empty && (values = values.concat(empty)), values.join(right + comma + left).trim();
|
|
2487
2115
|
}
|
|
2488
|
-
__name(stringify, "stringify");
|
|
2489
2116
|
}
|
|
2490
2117
|
});
|
|
2491
2118
|
|
|
@@ -2493,160 +2120,69 @@ var require_comma_separated_tokens = __commonJS({
|
|
|
2493
2120
|
var require_factory = __commonJS({
|
|
2494
2121
|
"../node_modules/hastscript/factory.js"(exports, module) {
|
|
2495
2122
|
"use strict";
|
|
2496
|
-
var find = require_find();
|
|
2497
|
-
var normalize = require_normalize();
|
|
2498
|
-
var parseSelector = require_hast_util_parse_selector();
|
|
2499
|
-
var spaces = require_space_separated_tokens().parse;
|
|
2500
|
-
var commas = require_comma_separated_tokens().parse;
|
|
2123
|
+
var find = require_find(), normalize = require_normalize(), parseSelector = require_hast_util_parse_selector(), spaces = require_space_separated_tokens().parse, commas = require_comma_separated_tokens().parse;
|
|
2501
2124
|
module.exports = factory;
|
|
2502
2125
|
var own = {}.hasOwnProperty;
|
|
2503
2126
|
function factory(schema, defaultTagName, caseSensitive) {
|
|
2504
2127
|
var adjust = caseSensitive ? createAdjustMap(caseSensitive) : null;
|
|
2505
2128
|
return h;
|
|
2506
2129
|
function h(selector, properties) {
|
|
2507
|
-
var node = parseSelector(selector, defaultTagName);
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
var property;
|
|
2511
|
-
node.tagName = adjust && own.call(adjust, name) ? adjust[name] : name;
|
|
2512
|
-
if (properties && isChildren(properties, node)) {
|
|
2513
|
-
children.unshift(properties);
|
|
2514
|
-
properties = null;
|
|
2515
|
-
}
|
|
2516
|
-
if (properties) {
|
|
2517
|
-
for (property in properties) {
|
|
2130
|
+
var node = parseSelector(selector, defaultTagName), children = Array.prototype.slice.call(arguments, 2), name = node.tagName.toLowerCase(), property;
|
|
2131
|
+
if (node.tagName = adjust && own.call(adjust, name) ? adjust[name] : name, properties && isChildren(properties, node) && (children.unshift(properties), properties = null), properties)
|
|
2132
|
+
for (property in properties)
|
|
2518
2133
|
addProperty(node.properties, property, properties[property]);
|
|
2519
|
-
|
|
2520
|
-
}
|
|
2521
|
-
addChild(node.children, children);
|
|
2522
|
-
if (node.tagName === "template") {
|
|
2523
|
-
node.content = { type: "root", children: node.children };
|
|
2524
|
-
node.children = [];
|
|
2525
|
-
}
|
|
2526
|
-
return node;
|
|
2134
|
+
return addChild(node.children, children), node.tagName === "template" && (node.content = { type: "root", children: node.children }, node.children = []), node;
|
|
2527
2135
|
}
|
|
2528
|
-
__name(h, "h");
|
|
2529
2136
|
function addProperty(properties, key, value) {
|
|
2530
|
-
var info;
|
|
2531
|
-
|
|
2532
|
-
var result;
|
|
2533
|
-
if (value === null || value === void 0 || value !== value) {
|
|
2534
|
-
return;
|
|
2535
|
-
}
|
|
2536
|
-
info = find(schema, key);
|
|
2537
|
-
property = info.property;
|
|
2538
|
-
result = value;
|
|
2539
|
-
if (typeof result === "string") {
|
|
2540
|
-
if (info.spaceSeparated) {
|
|
2541
|
-
result = spaces(result);
|
|
2542
|
-
} else if (info.commaSeparated) {
|
|
2543
|
-
result = commas(result);
|
|
2544
|
-
} else if (info.commaOrSpaceSeparated) {
|
|
2545
|
-
result = spaces(commas(result).join(" "));
|
|
2546
|
-
}
|
|
2547
|
-
}
|
|
2548
|
-
if (property === "style" && typeof value !== "string") {
|
|
2549
|
-
result = style(result);
|
|
2550
|
-
}
|
|
2551
|
-
if (property === "className" && properties.className) {
|
|
2552
|
-
result = properties.className.concat(result);
|
|
2553
|
-
}
|
|
2554
|
-
properties[property] = parsePrimitives(info, property, result);
|
|
2137
|
+
var info, property, result;
|
|
2138
|
+
value == null || value !== value || (info = find(schema, key), property = info.property, result = value, typeof result == "string" && (info.spaceSeparated ? result = spaces(result) : info.commaSeparated ? result = commas(result) : info.commaOrSpaceSeparated && (result = spaces(commas(result).join(" ")))), property === "style" && typeof value != "string" && (result = style(result)), property === "className" && properties.className && (result = properties.className.concat(result)), properties[property] = parsePrimitives(info, property, result));
|
|
2555
2139
|
}
|
|
2556
|
-
__name(addProperty, "addProperty");
|
|
2557
2140
|
}
|
|
2558
|
-
__name(factory, "factory");
|
|
2559
2141
|
function isChildren(value, node) {
|
|
2560
|
-
return typeof value
|
|
2142
|
+
return typeof value == "string" || "length" in value || isNode(node.tagName, value);
|
|
2561
2143
|
}
|
|
2562
|
-
__name(isChildren, "isChildren");
|
|
2563
2144
|
function isNode(tagName, value) {
|
|
2564
2145
|
var type = value.type;
|
|
2565
|
-
|
|
2566
|
-
return false;
|
|
2567
|
-
}
|
|
2568
|
-
if (typeof value.children === "object" && "length" in value.children) {
|
|
2569
|
-
return true;
|
|
2570
|
-
}
|
|
2571
|
-
type = type.toLowerCase();
|
|
2572
|
-
if (tagName === "button") {
|
|
2573
|
-
return type !== "menu" && type !== "submit" && type !== "reset" && type !== "button";
|
|
2574
|
-
}
|
|
2575
|
-
return "value" in value;
|
|
2146
|
+
return tagName === "input" || !type || typeof type != "string" ? !1 : typeof value.children == "object" && "length" in value.children ? !0 : (type = type.toLowerCase(), tagName === "button" ? type !== "menu" && type !== "submit" && type !== "reset" && type !== "button" : "value" in value);
|
|
2576
2147
|
}
|
|
2577
|
-
__name(isNode, "isNode");
|
|
2578
2148
|
function addChild(nodes, value) {
|
|
2579
|
-
var index;
|
|
2580
|
-
|
|
2581
|
-
if (typeof value === "string" || typeof value === "number") {
|
|
2149
|
+
var index, length;
|
|
2150
|
+
if (typeof value == "string" || typeof value == "number") {
|
|
2582
2151
|
nodes.push({ type: "text", value: String(value) });
|
|
2583
2152
|
return;
|
|
2584
2153
|
}
|
|
2585
|
-
if (typeof value
|
|
2586
|
-
index = -1;
|
|
2587
|
-
length = value.length;
|
|
2588
|
-
while (++index < length) {
|
|
2154
|
+
if (typeof value == "object" && "length" in value) {
|
|
2155
|
+
for (index = -1, length = value.length; ++index < length; )
|
|
2589
2156
|
addChild(nodes, value[index]);
|
|
2590
|
-
}
|
|
2591
2157
|
return;
|
|
2592
2158
|
}
|
|
2593
|
-
if (typeof value
|
|
2159
|
+
if (typeof value != "object" || !("type" in value))
|
|
2594
2160
|
throw new Error("Expected node, nodes, or string, got `" + value + "`");
|
|
2595
|
-
}
|
|
2596
2161
|
nodes.push(value);
|
|
2597
2162
|
}
|
|
2598
|
-
__name(addChild, "addChild");
|
|
2599
2163
|
function parsePrimitives(info, name, value) {
|
|
2600
|
-
var index;
|
|
2601
|
-
|
|
2602
|
-
var result;
|
|
2603
|
-
if (typeof value !== "object" || !("length" in value)) {
|
|
2164
|
+
var index, length, result;
|
|
2165
|
+
if (typeof value != "object" || !("length" in value))
|
|
2604
2166
|
return parsePrimitive(info, name, value);
|
|
2605
|
-
|
|
2606
|
-
length = value.length;
|
|
2607
|
-
index = -1;
|
|
2608
|
-
result = [];
|
|
2609
|
-
while (++index < length) {
|
|
2167
|
+
for (length = value.length, index = -1, result = []; ++index < length; )
|
|
2610
2168
|
result[index] = parsePrimitive(info, name, value[index]);
|
|
2611
|
-
}
|
|
2612
2169
|
return result;
|
|
2613
2170
|
}
|
|
2614
|
-
__name(parsePrimitives, "parsePrimitives");
|
|
2615
2171
|
function parsePrimitive(info, name, value) {
|
|
2616
2172
|
var result = value;
|
|
2617
|
-
|
|
2618
|
-
if (!isNaN(result) && result !== "") {
|
|
2619
|
-
result = Number(result);
|
|
2620
|
-
}
|
|
2621
|
-
} else if (info.boolean || info.overloadedBoolean) {
|
|
2622
|
-
if (typeof result === "string" && (result === "" || normalize(value) === normalize(name))) {
|
|
2623
|
-
result = true;
|
|
2624
|
-
}
|
|
2625
|
-
}
|
|
2626
|
-
return result;
|
|
2173
|
+
return info.number || info.positiveNumber ? !isNaN(result) && result !== "" && (result = Number(result)) : (info.boolean || info.overloadedBoolean) && typeof result == "string" && (result === "" || normalize(value) === normalize(name)) && (result = !0), result;
|
|
2627
2174
|
}
|
|
2628
|
-
__name(parsePrimitive, "parsePrimitive");
|
|
2629
2175
|
function style(value) {
|
|
2630
|
-
var result = [];
|
|
2631
|
-
|
|
2632
|
-
for (key in value) {
|
|
2176
|
+
var result = [], key;
|
|
2177
|
+
for (key in value)
|
|
2633
2178
|
result.push([key, value[key]].join(": "));
|
|
2634
|
-
}
|
|
2635
2179
|
return result.join("; ");
|
|
2636
2180
|
}
|
|
2637
|
-
__name(style, "style");
|
|
2638
2181
|
function createAdjustMap(values) {
|
|
2639
|
-
var length = values.length;
|
|
2640
|
-
|
|
2641
|
-
var result = {};
|
|
2642
|
-
var value;
|
|
2643
|
-
while (++index < length) {
|
|
2644
|
-
value = values[index];
|
|
2645
|
-
result[value.toLowerCase()] = value;
|
|
2646
|
-
}
|
|
2182
|
+
for (var length = values.length, index = -1, result = {}, value; ++index < length; )
|
|
2183
|
+
value = values[index], result[value.toLowerCase()] = value;
|
|
2647
2184
|
return result;
|
|
2648
2185
|
}
|
|
2649
|
-
__name(createAdjustMap, "createAdjustMap");
|
|
2650
2186
|
}
|
|
2651
2187
|
});
|
|
2652
2188
|
|
|
@@ -2654,9 +2190,7 @@ var require_factory = __commonJS({
|
|
|
2654
2190
|
var require_html3 = __commonJS({
|
|
2655
2191
|
"../node_modules/hastscript/html.js"(exports, module) {
|
|
2656
2192
|
"use strict";
|
|
2657
|
-
var schema = require_html2();
|
|
2658
|
-
var factory = require_factory();
|
|
2659
|
-
var html = factory(schema, "div");
|
|
2193
|
+
var schema = require_html2(), factory = require_factory(), html = factory(schema, "div");
|
|
2660
2194
|
html.displayName = "html";
|
|
2661
2195
|
module.exports = html;
|
|
2662
2196
|
}
|
|
@@ -2826,10 +2360,9 @@ var require_is_decimal = __commonJS({
|
|
|
2826
2360
|
"use strict";
|
|
2827
2361
|
module.exports = decimal;
|
|
2828
2362
|
function decimal(character) {
|
|
2829
|
-
var code = typeof character
|
|
2363
|
+
var code = typeof character == "string" ? character.charCodeAt(0) : character;
|
|
2830
2364
|
return code >= 48 && code <= 57;
|
|
2831
2365
|
}
|
|
2832
|
-
__name(decimal, "decimal");
|
|
2833
2366
|
}
|
|
2834
2367
|
});
|
|
2835
2368
|
|
|
@@ -2839,10 +2372,9 @@ var require_is_hexadecimal = __commonJS({
|
|
|
2839
2372
|
"use strict";
|
|
2840
2373
|
module.exports = hexadecimal;
|
|
2841
2374
|
function hexadecimal(character) {
|
|
2842
|
-
var code = typeof character
|
|
2375
|
+
var code = typeof character == "string" ? character.charCodeAt(0) : character;
|
|
2843
2376
|
return code >= 97 && code <= 102 || code >= 65 && code <= 70 || code >= 48 && code <= 57;
|
|
2844
2377
|
}
|
|
2845
|
-
__name(hexadecimal, "hexadecimal");
|
|
2846
2378
|
}
|
|
2847
2379
|
});
|
|
2848
2380
|
|
|
@@ -2852,10 +2384,9 @@ var require_is_alphabetical = __commonJS({
|
|
|
2852
2384
|
"use strict";
|
|
2853
2385
|
module.exports = alphabetical;
|
|
2854
2386
|
function alphabetical(character) {
|
|
2855
|
-
var code = typeof character
|
|
2387
|
+
var code = typeof character == "string" ? character.charCodeAt(0) : character;
|
|
2856
2388
|
return code >= 97 && code <= 122 || code >= 65 && code <= 90;
|
|
2857
2389
|
}
|
|
2858
|
-
__name(alphabetical, "alphabetical");
|
|
2859
2390
|
}
|
|
2860
2391
|
});
|
|
2861
2392
|
|
|
@@ -2863,13 +2394,11 @@ var require_is_alphabetical = __commonJS({
|
|
|
2863
2394
|
var require_is_alphanumerical = __commonJS({
|
|
2864
2395
|
"../node_modules/refractor/node_modules/is-alphanumerical/index.js"(exports, module) {
|
|
2865
2396
|
"use strict";
|
|
2866
|
-
var alphabetical = require_is_alphabetical();
|
|
2867
|
-
var decimal = require_is_decimal();
|
|
2397
|
+
var alphabetical = require_is_alphabetical(), decimal = require_is_decimal();
|
|
2868
2398
|
module.exports = alphanumerical;
|
|
2869
2399
|
function alphanumerical(character) {
|
|
2870
2400
|
return alphabetical(character) || decimal(character);
|
|
2871
2401
|
}
|
|
2872
|
-
__name(alphanumerical, "alphanumerical");
|
|
2873
2402
|
}
|
|
2874
2403
|
});
|
|
2875
2404
|
|
|
@@ -2877,21 +2406,12 @@ var require_is_alphanumerical = __commonJS({
|
|
|
2877
2406
|
var require_decode_entity_browser = __commonJS({
|
|
2878
2407
|
"../node_modules/refractor/node_modules/parse-entities/decode-entity.browser.js"(exports, module) {
|
|
2879
2408
|
"use strict";
|
|
2880
|
-
var el;
|
|
2881
|
-
var semicolon = 59;
|
|
2409
|
+
var el, semicolon = 59;
|
|
2882
2410
|
module.exports = decodeEntity;
|
|
2883
2411
|
function decodeEntity(characters) {
|
|
2884
|
-
var entity = "&" + characters + ";";
|
|
2885
|
-
|
|
2886
|
-
el = el || document.createElement("i");
|
|
2887
|
-
el.innerHTML = entity;
|
|
2888
|
-
char = el.textContent;
|
|
2889
|
-
if (char.charCodeAt(char.length - 1) === semicolon && characters !== "semi") {
|
|
2890
|
-
return false;
|
|
2891
|
-
}
|
|
2892
|
-
return char === entity ? false : char;
|
|
2412
|
+
var entity = "&" + characters + ";", char;
|
|
2413
|
+
return el = el || document.createElement("i"), el.innerHTML = entity, char = el.textContent, char.charCodeAt(char.length - 1) === semicolon && characters !== "semi" || char === entity ? !1 : char;
|
|
2893
2414
|
}
|
|
2894
|
-
__name(decodeEntity, "decodeEntity");
|
|
2895
2415
|
}
|
|
2896
2416
|
});
|
|
2897
2417
|
|
|
@@ -2899,17 +2419,9 @@ var require_decode_entity_browser = __commonJS({
|
|
|
2899
2419
|
var require_parse_entities = __commonJS({
|
|
2900
2420
|
"../node_modules/refractor/node_modules/parse-entities/index.js"(exports, module) {
|
|
2901
2421
|
"use strict";
|
|
2902
|
-
var legacy = require_character_entities_legacy();
|
|
2903
|
-
var invalid = require_character_reference_invalid();
|
|
2904
|
-
var decimal = require_is_decimal();
|
|
2905
|
-
var hexadecimal = require_is_hexadecimal();
|
|
2906
|
-
var alphanumerical = require_is_alphanumerical();
|
|
2907
|
-
var decodeEntity = require_decode_entity_browser();
|
|
2422
|
+
var legacy = require_character_entities_legacy(), invalid = require_character_reference_invalid(), decimal = require_is_decimal(), hexadecimal = require_is_hexadecimal(), alphanumerical = require_is_alphanumerical(), decodeEntity = require_decode_entity_browser();
|
|
2908
2423
|
module.exports = parseEntities;
|
|
2909
|
-
var own = {}.hasOwnProperty
|
|
2910
|
-
var fromCharCode = String.fromCharCode;
|
|
2911
|
-
var noop = Function.prototype;
|
|
2912
|
-
var defaults = {
|
|
2424
|
+
var own = {}.hasOwnProperty, fromCharCode = String.fromCharCode, noop = Function.prototype, defaults = {
|
|
2913
2425
|
warning: null,
|
|
2914
2426
|
reference: null,
|
|
2915
2427
|
text: null,
|
|
@@ -2918,39 +2430,16 @@ var require_parse_entities = __commonJS({
|
|
|
2918
2430
|
textContext: null,
|
|
2919
2431
|
position: {},
|
|
2920
2432
|
additional: null,
|
|
2921
|
-
attribute:
|
|
2922
|
-
nonTerminated:
|
|
2923
|
-
};
|
|
2924
|
-
var tab = 9;
|
|
2925
|
-
var lineFeed = 10;
|
|
2926
|
-
var formFeed = 12;
|
|
2927
|
-
var space = 32;
|
|
2928
|
-
var ampersand = 38;
|
|
2929
|
-
var semicolon = 59;
|
|
2930
|
-
var lessThan = 60;
|
|
2931
|
-
var equalsTo = 61;
|
|
2932
|
-
var numberSign = 35;
|
|
2933
|
-
var uppercaseX = 88;
|
|
2934
|
-
var lowercaseX = 120;
|
|
2935
|
-
var replacementCharacter = 65533;
|
|
2936
|
-
var name = "named";
|
|
2937
|
-
var hexa = "hexadecimal";
|
|
2938
|
-
var deci = "decimal";
|
|
2939
|
-
var bases = {};
|
|
2433
|
+
attribute: !1,
|
|
2434
|
+
nonTerminated: !0
|
|
2435
|
+
}, tab = 9, lineFeed = 10, formFeed = 12, space = 32, ampersand = 38, semicolon = 59, lessThan = 60, equalsTo = 61, numberSign = 35, uppercaseX = 88, lowercaseX = 120, replacementCharacter = 65533, name = "named", hexa = "hexadecimal", deci = "decimal", bases = {};
|
|
2940
2436
|
bases[hexa] = 16;
|
|
2941
2437
|
bases[deci] = 10;
|
|
2942
2438
|
var tests = {};
|
|
2943
2439
|
tests[name] = alphanumerical;
|
|
2944
2440
|
tests[deci] = decimal;
|
|
2945
2441
|
tests[hexa] = hexadecimal;
|
|
2946
|
-
var namedNotTerminated = 1;
|
|
2947
|
-
var numericNotTerminated = 2;
|
|
2948
|
-
var namedEmpty = 3;
|
|
2949
|
-
var numericEmpty = 4;
|
|
2950
|
-
var namedUnknown = 5;
|
|
2951
|
-
var numericDisallowed = 6;
|
|
2952
|
-
var numericProhibited = 7;
|
|
2953
|
-
var messages = {};
|
|
2442
|
+
var namedNotTerminated = 1, numericNotTerminated = 2, namedEmpty = 3, numericEmpty = 4, namedUnknown = 5, numericDisallowed = 6, numericProhibited = 7, messages = {};
|
|
2954
2443
|
messages[namedNotTerminated] = "Named character references must be terminated by a semicolon";
|
|
2955
2444
|
messages[numericNotTerminated] = "Numeric character references must be terminated by a semicolon";
|
|
2956
2445
|
messages[namedEmpty] = "Named character references cannot be empty";
|
|
@@ -2959,213 +2448,30 @@ var require_parse_entities = __commonJS({
|
|
|
2959
2448
|
messages[numericDisallowed] = "Numeric character references cannot be disallowed";
|
|
2960
2449
|
messages[numericProhibited] = "Numeric character references cannot be outside the permissible Unicode range";
|
|
2961
2450
|
function parseEntities(value, options) {
|
|
2962
|
-
var settings = {};
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
}
|
|
2968
|
-
for (key in defaults) {
|
|
2969
|
-
option = options[key];
|
|
2970
|
-
settings[key] = option === null || option === void 0 ? defaults[key] : option;
|
|
2971
|
-
}
|
|
2972
|
-
if (settings.position.indent || settings.position.start) {
|
|
2973
|
-
settings.indent = settings.position.indent || [];
|
|
2974
|
-
settings.position = settings.position.start;
|
|
2975
|
-
}
|
|
2976
|
-
return parse(value, settings);
|
|
2451
|
+
var settings = {}, option, key;
|
|
2452
|
+
options || (options = {});
|
|
2453
|
+
for (key in defaults)
|
|
2454
|
+
option = options[key], settings[key] = option ?? defaults[key];
|
|
2455
|
+
return (settings.position.indent || settings.position.start) && (settings.indent = settings.position.indent || [], settings.position = settings.position.start), parse(value, settings);
|
|
2977
2456
|
}
|
|
2978
|
-
__name(parseEntities, "parseEntities");
|
|
2979
2457
|
function parse(value, settings) {
|
|
2980
|
-
var additional = settings.additional;
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
var textContext = settings.textContext;
|
|
2986
|
-
var referenceContext = settings.referenceContext;
|
|
2987
|
-
var warningContext = settings.warningContext;
|
|
2988
|
-
var pos = settings.position;
|
|
2989
|
-
var indent = settings.indent || [];
|
|
2990
|
-
var length = value.length;
|
|
2991
|
-
var index = 0;
|
|
2992
|
-
var lines = -1;
|
|
2993
|
-
var column = pos.column || 1;
|
|
2994
|
-
var line = pos.line || 1;
|
|
2995
|
-
var queue = "";
|
|
2996
|
-
var result = [];
|
|
2997
|
-
var entityCharacters;
|
|
2998
|
-
var namedEntity;
|
|
2999
|
-
var terminated;
|
|
3000
|
-
var characters;
|
|
3001
|
-
var character;
|
|
3002
|
-
var reference;
|
|
3003
|
-
var following;
|
|
3004
|
-
var warning;
|
|
3005
|
-
var reason;
|
|
3006
|
-
var output;
|
|
3007
|
-
var entity;
|
|
3008
|
-
var begin;
|
|
3009
|
-
var start;
|
|
3010
|
-
var type;
|
|
3011
|
-
var test;
|
|
3012
|
-
var prev;
|
|
3013
|
-
var next;
|
|
3014
|
-
var diff;
|
|
3015
|
-
var end;
|
|
3016
|
-
if (typeof additional === "string") {
|
|
3017
|
-
additional = additional.charCodeAt(0);
|
|
3018
|
-
}
|
|
3019
|
-
prev = now();
|
|
3020
|
-
warning = handleWarning ? parseError : noop;
|
|
3021
|
-
index--;
|
|
3022
|
-
length++;
|
|
3023
|
-
while (++index < length) {
|
|
3024
|
-
if (character === lineFeed) {
|
|
3025
|
-
column = indent[lines] || 1;
|
|
3026
|
-
}
|
|
3027
|
-
character = value.charCodeAt(index);
|
|
3028
|
-
if (character === ampersand) {
|
|
3029
|
-
following = value.charCodeAt(index + 1);
|
|
3030
|
-
if (following === tab || following === lineFeed || following === formFeed || following === space || following === ampersand || following === lessThan || following !== following || additional && following === additional) {
|
|
3031
|
-
queue += fromCharCode(character);
|
|
3032
|
-
column++;
|
|
2458
|
+
var additional = settings.additional, nonTerminated = settings.nonTerminated, handleText = settings.text, handleReference = settings.reference, handleWarning = settings.warning, textContext = settings.textContext, referenceContext = settings.referenceContext, warningContext = settings.warningContext, pos = settings.position, indent = settings.indent || [], length = value.length, index = 0, lines = -1, column = pos.column || 1, line = pos.line || 1, queue = "", result = [], entityCharacters, namedEntity, terminated, characters, character, reference, following, warning, reason, output, entity, begin, start, type, test, prev, next, diff, end;
|
|
2459
|
+
for (typeof additional == "string" && (additional = additional.charCodeAt(0)), prev = now(), warning = handleWarning ? parseError : noop, index--, length++; ++index < length; )
|
|
2460
|
+
if (character === lineFeed && (column = indent[lines] || 1), character = value.charCodeAt(index), character === ampersand) {
|
|
2461
|
+
if (following = value.charCodeAt(index + 1), following === tab || following === lineFeed || following === formFeed || following === space || following === ampersand || following === lessThan || following !== following || additional && following === additional) {
|
|
2462
|
+
queue += fromCharCode(character), column++;
|
|
3033
2463
|
continue;
|
|
3034
2464
|
}
|
|
3035
|
-
start = index + 1;
|
|
3036
|
-
|
|
3037
|
-
end = start
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
type = deci;
|
|
3046
|
-
}
|
|
3047
|
-
} else {
|
|
3048
|
-
type = name;
|
|
3049
|
-
}
|
|
3050
|
-
entityCharacters = "";
|
|
3051
|
-
entity = "";
|
|
3052
|
-
characters = "";
|
|
3053
|
-
test = tests[type];
|
|
3054
|
-
end--;
|
|
3055
|
-
while (++end < length) {
|
|
3056
|
-
following = value.charCodeAt(end);
|
|
3057
|
-
if (!test(following)) {
|
|
3058
|
-
break;
|
|
3059
|
-
}
|
|
3060
|
-
characters += fromCharCode(following);
|
|
3061
|
-
if (type === name && own.call(legacy, characters)) {
|
|
3062
|
-
entityCharacters = characters;
|
|
3063
|
-
entity = legacy[characters];
|
|
3064
|
-
}
|
|
3065
|
-
}
|
|
3066
|
-
terminated = value.charCodeAt(end) === semicolon;
|
|
3067
|
-
if (terminated) {
|
|
3068
|
-
end++;
|
|
3069
|
-
namedEntity = type === name ? decodeEntity(characters) : false;
|
|
3070
|
-
if (namedEntity) {
|
|
3071
|
-
entityCharacters = characters;
|
|
3072
|
-
entity = namedEntity;
|
|
3073
|
-
}
|
|
3074
|
-
}
|
|
3075
|
-
diff = 1 + end - start;
|
|
3076
|
-
if (!terminated && !nonTerminated) {
|
|
3077
|
-
} else if (!characters) {
|
|
3078
|
-
if (type !== name) {
|
|
3079
|
-
warning(numericEmpty, diff);
|
|
3080
|
-
}
|
|
3081
|
-
} else if (type === name) {
|
|
3082
|
-
if (terminated && !entity) {
|
|
3083
|
-
warning(namedUnknown, 1);
|
|
3084
|
-
} else {
|
|
3085
|
-
if (entityCharacters !== characters) {
|
|
3086
|
-
end = begin + entityCharacters.length;
|
|
3087
|
-
diff = 1 + end - begin;
|
|
3088
|
-
terminated = false;
|
|
3089
|
-
}
|
|
3090
|
-
if (!terminated) {
|
|
3091
|
-
reason = entityCharacters ? namedNotTerminated : namedEmpty;
|
|
3092
|
-
if (settings.attribute) {
|
|
3093
|
-
following = value.charCodeAt(end);
|
|
3094
|
-
if (following === equalsTo) {
|
|
3095
|
-
warning(reason, diff);
|
|
3096
|
-
entity = null;
|
|
3097
|
-
} else if (alphanumerical(following)) {
|
|
3098
|
-
entity = null;
|
|
3099
|
-
} else {
|
|
3100
|
-
warning(reason, diff);
|
|
3101
|
-
}
|
|
3102
|
-
} else {
|
|
3103
|
-
warning(reason, diff);
|
|
3104
|
-
}
|
|
3105
|
-
}
|
|
3106
|
-
}
|
|
3107
|
-
reference = entity;
|
|
3108
|
-
} else {
|
|
3109
|
-
if (!terminated) {
|
|
3110
|
-
warning(numericNotTerminated, diff);
|
|
3111
|
-
}
|
|
3112
|
-
reference = parseInt(characters, bases[type]);
|
|
3113
|
-
if (prohibited(reference)) {
|
|
3114
|
-
warning(numericProhibited, diff);
|
|
3115
|
-
reference = fromCharCode(replacementCharacter);
|
|
3116
|
-
} else if (reference in invalid) {
|
|
3117
|
-
warning(numericDisallowed, diff);
|
|
3118
|
-
reference = invalid[reference];
|
|
3119
|
-
} else {
|
|
3120
|
-
output = "";
|
|
3121
|
-
if (disallowed(reference)) {
|
|
3122
|
-
warning(numericDisallowed, diff);
|
|
3123
|
-
}
|
|
3124
|
-
if (reference > 65535) {
|
|
3125
|
-
reference -= 65536;
|
|
3126
|
-
output += fromCharCode(reference >>> (10 & 1023) | 55296);
|
|
3127
|
-
reference = 56320 | reference & 1023;
|
|
3128
|
-
}
|
|
3129
|
-
reference = output + fromCharCode(reference);
|
|
3130
|
-
}
|
|
3131
|
-
}
|
|
3132
|
-
if (reference) {
|
|
3133
|
-
flush();
|
|
3134
|
-
prev = now();
|
|
3135
|
-
index = end - 1;
|
|
3136
|
-
column += end - start + 1;
|
|
3137
|
-
result.push(reference);
|
|
3138
|
-
next = now();
|
|
3139
|
-
next.offset++;
|
|
3140
|
-
if (handleReference) {
|
|
3141
|
-
handleReference.call(
|
|
3142
|
-
referenceContext,
|
|
3143
|
-
reference,
|
|
3144
|
-
{ start: prev, end: next },
|
|
3145
|
-
value.slice(start - 1, end)
|
|
3146
|
-
);
|
|
3147
|
-
}
|
|
3148
|
-
prev = next;
|
|
3149
|
-
} else {
|
|
3150
|
-
characters = value.slice(start - 1, end);
|
|
3151
|
-
queue += characters;
|
|
3152
|
-
column += characters.length;
|
|
3153
|
-
index = end - 1;
|
|
3154
|
-
}
|
|
3155
|
-
} else {
|
|
3156
|
-
if (character === 10) {
|
|
3157
|
-
line++;
|
|
3158
|
-
lines++;
|
|
3159
|
-
column = 0;
|
|
3160
|
-
}
|
|
3161
|
-
if (character === character) {
|
|
3162
|
-
queue += fromCharCode(character);
|
|
3163
|
-
column++;
|
|
3164
|
-
} else {
|
|
3165
|
-
flush();
|
|
3166
|
-
}
|
|
3167
|
-
}
|
|
3168
|
-
}
|
|
2465
|
+
for (start = index + 1, begin = start, end = start, following === numberSign ? (end = ++begin, following = value.charCodeAt(end), following === uppercaseX || following === lowercaseX ? (type = hexa, end = ++begin) : type = deci) : type = name, entityCharacters = "", entity = "", characters = "", test = tests[type], end--; ++end < length && (following = value.charCodeAt(end), !!test(following)); )
|
|
2466
|
+
characters += fromCharCode(following), type === name && own.call(legacy, characters) && (entityCharacters = characters, entity = legacy[characters]);
|
|
2467
|
+
terminated = value.charCodeAt(end) === semicolon, terminated && (end++, namedEntity = type === name ? decodeEntity(characters) : !1, namedEntity && (entityCharacters = characters, entity = namedEntity)), diff = 1 + end - start, !terminated && !nonTerminated || (characters ? type === name ? (terminated && !entity ? warning(namedUnknown, 1) : (entityCharacters !== characters && (end = begin + entityCharacters.length, diff = 1 + end - begin, terminated = !1), terminated || (reason = entityCharacters ? namedNotTerminated : namedEmpty, settings.attribute ? (following = value.charCodeAt(end), following === equalsTo ? (warning(reason, diff), entity = null) : alphanumerical(following) ? entity = null : warning(reason, diff)) : warning(reason, diff))), reference = entity) : (terminated || warning(numericNotTerminated, diff), reference = parseInt(characters, bases[type]), prohibited(reference) ? (warning(numericProhibited, diff), reference = fromCharCode(replacementCharacter)) : reference in invalid ? (warning(numericDisallowed, diff), reference = invalid[reference]) : (output = "", disallowed(reference) && warning(numericDisallowed, diff), reference > 65535 && (reference -= 65536, output += fromCharCode(reference >>> 10 | 55296), reference = 56320 | reference & 1023), reference = output + fromCharCode(reference))) : type !== name && warning(numericEmpty, diff)), reference ? (flush(), prev = now(), index = end - 1, column += end - start + 1, result.push(reference), next = now(), next.offset++, handleReference && handleReference.call(
|
|
2468
|
+
referenceContext,
|
|
2469
|
+
reference,
|
|
2470
|
+
{ start: prev, end: next },
|
|
2471
|
+
value.slice(start - 1, end)
|
|
2472
|
+
), prev = next) : (characters = value.slice(start - 1, end), queue += characters, column += characters.length, index = end - 1);
|
|
2473
|
+
} else
|
|
2474
|
+
character === 10 && (line++, lines++, column = 0), character === character ? (queue += fromCharCode(character), column++) : flush();
|
|
3169
2475
|
return result.join("");
|
|
3170
2476
|
function now() {
|
|
3171
2477
|
return {
|
|
@@ -3174,46 +2480,29 @@ var require_parse_entities = __commonJS({
|
|
|
3174
2480
|
offset: index + (pos.offset || 0)
|
|
3175
2481
|
};
|
|
3176
2482
|
}
|
|
3177
|
-
__name(now, "now");
|
|
3178
2483
|
function parseError(code, offset) {
|
|
3179
2484
|
var position = now();
|
|
3180
|
-
position.column += offset;
|
|
3181
|
-
position.offset += offset;
|
|
3182
|
-
handleWarning.call(warningContext, messages[code], position, code);
|
|
2485
|
+
position.column += offset, position.offset += offset, handleWarning.call(warningContext, messages[code], position, code);
|
|
3183
2486
|
}
|
|
3184
|
-
__name(parseError, "parseError");
|
|
3185
2487
|
function flush() {
|
|
3186
|
-
|
|
3187
|
-
result.push(queue);
|
|
3188
|
-
if (handleText) {
|
|
3189
|
-
handleText.call(textContext, queue, { start: prev, end: now() });
|
|
3190
|
-
}
|
|
3191
|
-
queue = "";
|
|
3192
|
-
}
|
|
2488
|
+
queue && (result.push(queue), handleText && handleText.call(textContext, queue, { start: prev, end: now() }), queue = "");
|
|
3193
2489
|
}
|
|
3194
|
-
__name(flush, "flush");
|
|
3195
2490
|
}
|
|
3196
|
-
__name(parse, "parse");
|
|
3197
2491
|
function prohibited(code) {
|
|
3198
2492
|
return code >= 55296 && code <= 57343 || code > 1114111;
|
|
3199
2493
|
}
|
|
3200
|
-
__name(prohibited, "prohibited");
|
|
3201
2494
|
function disallowed(code) {
|
|
3202
2495
|
return code >= 1 && code <= 8 || code === 11 || code >= 13 && code <= 31 || code >= 127 && code <= 159 || code >= 64976 && code <= 65007 || (code & 65535) === 65535 || (code & 65535) === 65534;
|
|
3203
2496
|
}
|
|
3204
|
-
__name(disallowed, "disallowed");
|
|
3205
2497
|
}
|
|
3206
2498
|
});
|
|
3207
2499
|
|
|
3208
2500
|
// ../node_modules/refractor/node_modules/prismjs/components/prism-core.js
|
|
3209
2501
|
var require_prism_core = __commonJS({
|
|
3210
2502
|
"../node_modules/refractor/node_modules/prismjs/components/prism-core.js"(exports, module) {
|
|
3211
|
-
var _self = typeof window
|
|
3212
|
-
var Prism = function(_self2) {
|
|
3213
|
-
var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i
|
|
3214
|
-
var uniqueId = 0;
|
|
3215
|
-
var plainTextGrammar = {};
|
|
3216
|
-
var _ = {
|
|
2503
|
+
var _self = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
|
|
2504
|
+
var Prism = (function(_self2) {
|
|
2505
|
+
var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, uniqueId = 0, plainTextGrammar = {}, _ = {
|
|
3217
2506
|
/**
|
|
3218
2507
|
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
|
|
3219
2508
|
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
|
|
@@ -3268,15 +2557,9 @@ var require_prism_core = __commonJS({
|
|
|
3268
2557
|
* @memberof Prism
|
|
3269
2558
|
*/
|
|
3270
2559
|
util: {
|
|
3271
|
-
encode:
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
} else if (Array.isArray(tokens)) {
|
|
3275
|
-
return tokens.map(encode);
|
|
3276
|
-
} else {
|
|
3277
|
-
return tokens.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
3278
|
-
}
|
|
3279
|
-
}, "encode"),
|
|
2560
|
+
encode: function encode(tokens) {
|
|
2561
|
+
return tokens instanceof Token ? new Token(tokens.type, encode(tokens.content), tokens.alias) : Array.isArray(tokens) ? tokens.map(encode) : tokens.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
2562
|
+
},
|
|
3280
2563
|
/**
|
|
3281
2564
|
* Returns the name of the type of the given value.
|
|
3282
2565
|
*
|
|
@@ -3293,21 +2576,18 @@ var require_prism_core = __commonJS({
|
|
|
3293
2576
|
* type(String) === 'Function'
|
|
3294
2577
|
* type(/abc+/) === 'RegExp'
|
|
3295
2578
|
*/
|
|
3296
|
-
type:
|
|
2579
|
+
type: function(o) {
|
|
3297
2580
|
return Object.prototype.toString.call(o).slice(8, -1);
|
|
3298
|
-
},
|
|
2581
|
+
},
|
|
3299
2582
|
/**
|
|
3300
2583
|
* Returns a unique number for the given object. Later calls will still return the same number.
|
|
3301
2584
|
*
|
|
3302
2585
|
* @param {Object} obj
|
|
3303
2586
|
* @returns {number}
|
|
3304
2587
|
*/
|
|
3305
|
-
objId:
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
}
|
|
3309
|
-
return obj["__id"];
|
|
3310
|
-
}, "objId"),
|
|
2588
|
+
objId: function(obj) {
|
|
2589
|
+
return obj.__id || Object.defineProperty(obj, "__id", { value: ++uniqueId }), obj.__id;
|
|
2590
|
+
},
|
|
3311
2591
|
/**
|
|
3312
2592
|
* Creates a deep clone of the given object.
|
|
3313
2593
|
*
|
|
@@ -3318,48 +2598,32 @@ var require_prism_core = __commonJS({
|
|
|
3318
2598
|
* @returns {T}
|
|
3319
2599
|
* @template T
|
|
3320
2600
|
*/
|
|
3321
|
-
clone:
|
|
2601
|
+
clone: function deepClone(o, visited) {
|
|
3322
2602
|
visited = visited || {};
|
|
3323
|
-
var clone;
|
|
3324
|
-
var id;
|
|
2603
|
+
var clone, id;
|
|
3325
2604
|
switch (_.util.type(o)) {
|
|
3326
2605
|
case "Object":
|
|
3327
|
-
id = _.util.objId(o)
|
|
3328
|
-
if (visited[id]) {
|
|
2606
|
+
if (id = _.util.objId(o), visited[id])
|
|
3329
2607
|
return visited[id];
|
|
3330
|
-
}
|
|
3331
2608
|
clone = /** @type {Record<string, any>} */
|
|
3332
|
-
{};
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
if (o.hasOwnProperty(key)) {
|
|
3336
|
-
clone[key] = deepClone(o[key], visited);
|
|
3337
|
-
}
|
|
3338
|
-
}
|
|
2609
|
+
{}, visited[id] = clone;
|
|
2610
|
+
for (var key in o)
|
|
2611
|
+
o.hasOwnProperty(key) && (clone[key] = deepClone(o[key], visited));
|
|
3339
2612
|
return (
|
|
3340
2613
|
/** @type {any} */
|
|
3341
2614
|
clone
|
|
3342
2615
|
);
|
|
3343
2616
|
case "Array":
|
|
3344
|
-
id = _.util.objId(o)
|
|
3345
|
-
if (visited[id]) {
|
|
3346
|
-
return visited[id];
|
|
3347
|
-
}
|
|
3348
|
-
clone = [];
|
|
3349
|
-
visited[id] = clone;
|
|
3350
|
-
/** @type {Array} */
|
|
2617
|
+
return id = _.util.objId(o), visited[id] ? visited[id] : (clone = [], visited[id] = clone, /** @type {Array} */
|
|
3351
2618
|
/** @type {any} */
|
|
3352
2619
|
o.forEach(function(v, i) {
|
|
3353
2620
|
clone[i] = deepClone(v, visited);
|
|
3354
|
-
})
|
|
3355
|
-
|
|
3356
|
-
/** @type {any} */
|
|
3357
|
-
clone
|
|
3358
|
-
);
|
|
2621
|
+
}), /** @type {any} */
|
|
2622
|
+
clone);
|
|
3359
2623
|
default:
|
|
3360
2624
|
return o;
|
|
3361
2625
|
}
|
|
3362
|
-
},
|
|
2626
|
+
},
|
|
3363
2627
|
/**
|
|
3364
2628
|
* Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
|
|
3365
2629
|
*
|
|
@@ -3368,16 +2632,15 @@ var require_prism_core = __commonJS({
|
|
|
3368
2632
|
* @param {Element} element
|
|
3369
2633
|
* @returns {string}
|
|
3370
2634
|
*/
|
|
3371
|
-
getLanguage:
|
|
3372
|
-
|
|
2635
|
+
getLanguage: function(element) {
|
|
2636
|
+
for (; element; ) {
|
|
3373
2637
|
var m = lang.exec(element.className);
|
|
3374
|
-
if (m)
|
|
2638
|
+
if (m)
|
|
3375
2639
|
return m[1].toLowerCase();
|
|
3376
|
-
}
|
|
3377
2640
|
element = element.parentElement;
|
|
3378
2641
|
}
|
|
3379
2642
|
return "none";
|
|
3380
|
-
},
|
|
2643
|
+
},
|
|
3381
2644
|
/**
|
|
3382
2645
|
* Sets the Prism `language-xxxx` class of the given element.
|
|
3383
2646
|
*
|
|
@@ -3385,10 +2648,9 @@ var require_prism_core = __commonJS({
|
|
|
3385
2648
|
* @param {string} language
|
|
3386
2649
|
* @returns {void}
|
|
3387
2650
|
*/
|
|
3388
|
-
setLanguage:
|
|
3389
|
-
element.className = element.className.replace(RegExp(lang, "gi"), "");
|
|
3390
|
-
|
|
3391
|
-
}, "setLanguage"),
|
|
2651
|
+
setLanguage: function(element, language) {
|
|
2652
|
+
element.className = element.className.replace(RegExp(lang, "gi"), ""), element.classList.add("language-" + language);
|
|
2653
|
+
},
|
|
3392
2654
|
/**
|
|
3393
2655
|
* Returns the script element that is currently executing.
|
|
3394
2656
|
*
|
|
@@ -3396,31 +2658,27 @@ var require_prism_core = __commonJS({
|
|
|
3396
2658
|
*
|
|
3397
2659
|
* @returns {HTMLScriptElement | null}
|
|
3398
2660
|
*/
|
|
3399
|
-
currentScript:
|
|
3400
|
-
if (typeof document
|
|
2661
|
+
currentScript: function() {
|
|
2662
|
+
if (typeof document > "u")
|
|
3401
2663
|
return null;
|
|
3402
|
-
|
|
3403
|
-
if ("currentScript" in document && 1 < 2) {
|
|
2664
|
+
if ("currentScript" in document)
|
|
3404
2665
|
return (
|
|
3405
2666
|
/** @type {any} */
|
|
3406
2667
|
document.currentScript
|
|
3407
2668
|
);
|
|
3408
|
-
}
|
|
3409
2669
|
try {
|
|
3410
2670
|
throw new Error();
|
|
3411
2671
|
} catch (err) {
|
|
3412
2672
|
var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
|
|
3413
2673
|
if (src) {
|
|
3414
2674
|
var scripts = document.getElementsByTagName("script");
|
|
3415
|
-
for (var i in scripts)
|
|
3416
|
-
if (scripts[i].src == src)
|
|
2675
|
+
for (var i in scripts)
|
|
2676
|
+
if (scripts[i].src == src)
|
|
3417
2677
|
return scripts[i];
|
|
3418
|
-
}
|
|
3419
|
-
}
|
|
3420
2678
|
}
|
|
3421
2679
|
return null;
|
|
3422
2680
|
}
|
|
3423
|
-
},
|
|
2681
|
+
},
|
|
3424
2682
|
/**
|
|
3425
2683
|
* Returns whether a given class is active for `element`.
|
|
3426
2684
|
*
|
|
@@ -3440,20 +2698,17 @@ var require_prism_core = __commonJS({
|
|
|
3440
2698
|
* @param {boolean} [defaultActivation=false]
|
|
3441
2699
|
* @returns {boolean}
|
|
3442
2700
|
*/
|
|
3443
|
-
isActive:
|
|
3444
|
-
var no = "no-" + className;
|
|
3445
|
-
while (element) {
|
|
2701
|
+
isActive: function(element, className, defaultActivation) {
|
|
2702
|
+
for (var no = "no-" + className; element; ) {
|
|
3446
2703
|
var classList = element.classList;
|
|
3447
|
-
if (classList.contains(className))
|
|
3448
|
-
return
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
return false;
|
|
3452
|
-
}
|
|
2704
|
+
if (classList.contains(className))
|
|
2705
|
+
return !0;
|
|
2706
|
+
if (classList.contains(no))
|
|
2707
|
+
return !1;
|
|
3453
2708
|
element = element.parentElement;
|
|
3454
2709
|
}
|
|
3455
2710
|
return !!defaultActivation;
|
|
3456
|
-
}
|
|
2711
|
+
}
|
|
3457
2712
|
},
|
|
3458
2713
|
/**
|
|
3459
2714
|
* This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
|
|
@@ -3498,13 +2753,12 @@ var require_prism_core = __commonJS({
|
|
|
3498
2753
|
* 'color': /\b(?:red|green|blue)\b/
|
|
3499
2754
|
* });
|
|
3500
2755
|
*/
|
|
3501
|
-
extend:
|
|
2756
|
+
extend: function(id, redef) {
|
|
3502
2757
|
var lang2 = _.util.clone(_.languages[id]);
|
|
3503
|
-
for (var key in redef)
|
|
2758
|
+
for (var key in redef)
|
|
3504
2759
|
lang2[key] = redef[key];
|
|
3505
|
-
}
|
|
3506
2760
|
return lang2;
|
|
3507
|
-
},
|
|
2761
|
+
},
|
|
3508
2762
|
/**
|
|
3509
2763
|
* Inserts tokens _before_ another token in a language definition or any other grammar.
|
|
3510
2764
|
*
|
|
@@ -3580,53 +2834,33 @@ var require_prism_core = __commonJS({
|
|
|
3580
2834
|
* @returns {Grammar} The new grammar object.
|
|
3581
2835
|
* @public
|
|
3582
2836
|
*/
|
|
3583
|
-
insertBefore:
|
|
2837
|
+
insertBefore: function(inside, before, insert, root) {
|
|
3584
2838
|
root = root || /** @type {any} */
|
|
3585
2839
|
_.languages;
|
|
3586
|
-
var grammar = root[inside];
|
|
3587
|
-
var
|
|
3588
|
-
for (var token in grammar) {
|
|
2840
|
+
var grammar = root[inside], ret = {};
|
|
2841
|
+
for (var token in grammar)
|
|
3589
2842
|
if (grammar.hasOwnProperty(token)) {
|
|
3590
|
-
if (token == before)
|
|
3591
|
-
for (var newToken in insert)
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
}
|
|
3595
|
-
}
|
|
3596
|
-
}
|
|
3597
|
-
if (!insert.hasOwnProperty(token)) {
|
|
3598
|
-
ret[token] = grammar[token];
|
|
3599
|
-
}
|
|
2843
|
+
if (token == before)
|
|
2844
|
+
for (var newToken in insert)
|
|
2845
|
+
insert.hasOwnProperty(newToken) && (ret[newToken] = insert[newToken]);
|
|
2846
|
+
insert.hasOwnProperty(token) || (ret[token] = grammar[token]);
|
|
3600
2847
|
}
|
|
3601
|
-
}
|
|
3602
2848
|
var old = root[inside];
|
|
3603
|
-
root[inside] = ret
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
}
|
|
3608
|
-
});
|
|
3609
|
-
return ret;
|
|
3610
|
-
}, "insertBefore"),
|
|
2849
|
+
return root[inside] = ret, _.languages.DFS(_.languages, function(key, value) {
|
|
2850
|
+
value === old && key != inside && (this[key] = ret);
|
|
2851
|
+
}), ret;
|
|
2852
|
+
},
|
|
3611
2853
|
// Traverse a language definition with Depth First Search
|
|
3612
|
-
DFS:
|
|
2854
|
+
DFS: function DFS(o, callback, type, visited) {
|
|
3613
2855
|
visited = visited || {};
|
|
3614
2856
|
var objId = _.util.objId;
|
|
3615
|
-
for (var i in o)
|
|
2857
|
+
for (var i in o)
|
|
3616
2858
|
if (o.hasOwnProperty(i)) {
|
|
3617
2859
|
callback.call(o, i, o[i], type || i);
|
|
3618
|
-
var property = o[i];
|
|
3619
|
-
|
|
3620
|
-
if (propertyType === "Object" && !visited[objId(property)]) {
|
|
3621
|
-
visited[objId(property)] = true;
|
|
3622
|
-
DFS(property, callback, null, visited);
|
|
3623
|
-
} else if (propertyType === "Array" && !visited[objId(property)]) {
|
|
3624
|
-
visited[objId(property)] = true;
|
|
3625
|
-
DFS(property, callback, i, visited);
|
|
3626
|
-
}
|
|
2860
|
+
var property = o[i], propertyType = _.util.type(property);
|
|
2861
|
+
propertyType === "Object" && !visited[objId(property)] ? (visited[objId(property)] = !0, DFS(property, callback, null, visited)) : propertyType === "Array" && !visited[objId(property)] && (visited[objId(property)] = !0, DFS(property, callback, i, visited));
|
|
3627
2862
|
}
|
|
3628
|
-
|
|
3629
|
-
}, "DFS")
|
|
2863
|
+
}
|
|
3630
2864
|
},
|
|
3631
2865
|
plugins: {},
|
|
3632
2866
|
/**
|
|
@@ -3641,9 +2875,9 @@ var require_prism_core = __commonJS({
|
|
|
3641
2875
|
* @memberof Prism
|
|
3642
2876
|
* @public
|
|
3643
2877
|
*/
|
|
3644
|
-
highlightAll:
|
|
2878
|
+
highlightAll: function(async, callback) {
|
|
3645
2879
|
_.highlightAllUnder(document, async, callback);
|
|
3646
|
-
},
|
|
2880
|
+
},
|
|
3647
2881
|
/**
|
|
3648
2882
|
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
|
|
3649
2883
|
* {@link Prism.highlightElement} on each one of them.
|
|
@@ -3659,19 +2893,16 @@ var require_prism_core = __commonJS({
|
|
|
3659
2893
|
* @memberof Prism
|
|
3660
2894
|
* @public
|
|
3661
2895
|
*/
|
|
3662
|
-
highlightAllUnder:
|
|
2896
|
+
highlightAllUnder: function(container, async, callback) {
|
|
3663
2897
|
var env = {
|
|
3664
2898
|
callback,
|
|
3665
2899
|
container,
|
|
3666
2900
|
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
|
3667
2901
|
};
|
|
3668
|
-
_.hooks.run("before-highlightall", env);
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
_.highlightElement(element, async === true, env.callback);
|
|
3673
|
-
}
|
|
3674
|
-
}, "highlightAllUnder"),
|
|
2902
|
+
_.hooks.run("before-highlightall", env), env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector)), _.hooks.run("before-all-elements-highlight", env);
|
|
2903
|
+
for (var i = 0, element; element = env.elements[i++]; )
|
|
2904
|
+
_.highlightElement(element, async === !0, env.callback);
|
|
2905
|
+
},
|
|
3675
2906
|
/**
|
|
3676
2907
|
* Highlights the code inside a single element.
|
|
3677
2908
|
*
|
|
@@ -3700,42 +2931,25 @@ var require_prism_core = __commonJS({
|
|
|
3700
2931
|
* @memberof Prism
|
|
3701
2932
|
* @public
|
|
3702
2933
|
*/
|
|
3703
|
-
highlightElement:
|
|
3704
|
-
var language = _.util.getLanguage(element);
|
|
3705
|
-
var grammar = _.languages[language];
|
|
2934
|
+
highlightElement: function(element, async, callback) {
|
|
2935
|
+
var language = _.util.getLanguage(element), grammar = _.languages[language];
|
|
3706
2936
|
_.util.setLanguage(element, language);
|
|
3707
2937
|
var parent = element.parentElement;
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
}
|
|
3711
|
-
var code = element.textContent;
|
|
3712
|
-
var env = {
|
|
2938
|
+
parent && parent.nodeName.toLowerCase() === "pre" && _.util.setLanguage(parent, language);
|
|
2939
|
+
var code = element.textContent, env = {
|
|
3713
2940
|
element,
|
|
3714
2941
|
language,
|
|
3715
2942
|
grammar,
|
|
3716
2943
|
code
|
|
3717
2944
|
};
|
|
3718
2945
|
function insertHighlightedCode(highlightedCode) {
|
|
3719
|
-
env.highlightedCode = highlightedCode;
|
|
3720
|
-
_.hooks.run("before-insert", env);
|
|
3721
|
-
env.element.innerHTML = env.highlightedCode;
|
|
3722
|
-
_.hooks.run("after-highlight", env);
|
|
3723
|
-
_.hooks.run("complete", env);
|
|
3724
|
-
callback && callback.call(env.element);
|
|
3725
|
-
}
|
|
3726
|
-
__name(insertHighlightedCode, "insertHighlightedCode");
|
|
3727
|
-
_.hooks.run("before-sanity-check", env);
|
|
3728
|
-
parent = env.element.parentElement;
|
|
3729
|
-
if (parent && parent.nodeName.toLowerCase() === "pre" && !parent.hasAttribute("tabindex")) {
|
|
3730
|
-
parent.setAttribute("tabindex", "0");
|
|
2946
|
+
env.highlightedCode = highlightedCode, _.hooks.run("before-insert", env), env.element.innerHTML = env.highlightedCode, _.hooks.run("after-highlight", env), _.hooks.run("complete", env), callback && callback.call(env.element);
|
|
3731
2947
|
}
|
|
3732
|
-
if (!env.code) {
|
|
3733
|
-
_.hooks.run("complete", env);
|
|
3734
|
-
callback && callback.call(env.element);
|
|
2948
|
+
if (_.hooks.run("before-sanity-check", env), parent = env.element.parentElement, parent && parent.nodeName.toLowerCase() === "pre" && !parent.hasAttribute("tabindex") && parent.setAttribute("tabindex", "0"), !env.code) {
|
|
2949
|
+
_.hooks.run("complete", env), callback && callback.call(env.element);
|
|
3735
2950
|
return;
|
|
3736
2951
|
}
|
|
3737
|
-
_.hooks.run("before-highlight", env)
|
|
3738
|
-
if (!env.grammar) {
|
|
2952
|
+
if (_.hooks.run("before-highlight", env), !env.grammar) {
|
|
3739
2953
|
insertHighlightedCode(_.util.encode(env.code));
|
|
3740
2954
|
return;
|
|
3741
2955
|
}
|
|
@@ -3743,16 +2957,14 @@ var require_prism_core = __commonJS({
|
|
|
3743
2957
|
var worker = new Worker(_.filename);
|
|
3744
2958
|
worker.onmessage = function(evt) {
|
|
3745
2959
|
insertHighlightedCode(evt.data);
|
|
3746
|
-
}
|
|
3747
|
-
worker.postMessage(JSON.stringify({
|
|
2960
|
+
}, worker.postMessage(JSON.stringify({
|
|
3748
2961
|
language: env.language,
|
|
3749
2962
|
code: env.code,
|
|
3750
|
-
immediateClose:
|
|
2963
|
+
immediateClose: !0
|
|
3751
2964
|
}));
|
|
3752
|
-
} else
|
|
2965
|
+
} else
|
|
3753
2966
|
insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
|
|
3754
|
-
|
|
3755
|
-
}, "highlightElement"),
|
|
2967
|
+
},
|
|
3756
2968
|
/**
|
|
3757
2969
|
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input
|
|
3758
2970
|
* and the language definitions to use, and returns a string with the HTML produced.
|
|
@@ -3773,20 +2985,16 @@ var require_prism_core = __commonJS({
|
|
|
3773
2985
|
* @example
|
|
3774
2986
|
* Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
|
|
3775
2987
|
*/
|
|
3776
|
-
highlight:
|
|
2988
|
+
highlight: function(text, grammar, language) {
|
|
3777
2989
|
var env = {
|
|
3778
2990
|
code: text,
|
|
3779
2991
|
grammar,
|
|
3780
2992
|
language
|
|
3781
2993
|
};
|
|
3782
|
-
_.hooks.run("before-tokenize", env)
|
|
3783
|
-
if (!env.grammar) {
|
|
2994
|
+
if (_.hooks.run("before-tokenize", env), !env.grammar)
|
|
3784
2995
|
throw new Error('The language "' + env.language + '" has no grammar.');
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
_.hooks.run("after-tokenize", env);
|
|
3788
|
-
return Token.stringify(_.util.encode(env.tokens), env.language);
|
|
3789
|
-
}, "highlight"),
|
|
2996
|
+
return env.tokens = _.tokenize(env.code, env.grammar), _.hooks.run("after-tokenize", env), Token.stringify(_.util.encode(env.tokens), env.language);
|
|
2997
|
+
},
|
|
3790
2998
|
/**
|
|
3791
2999
|
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
|
|
3792
3000
|
* and the language definitions to use, and returns an array with the tokenized code.
|
|
@@ -3811,19 +3019,16 @@ var require_prism_core = __commonJS({
|
|
|
3811
3019
|
* }
|
|
3812
3020
|
* });
|
|
3813
3021
|
*/
|
|
3814
|
-
tokenize:
|
|
3022
|
+
tokenize: function(text, grammar) {
|
|
3815
3023
|
var rest = grammar.rest;
|
|
3816
3024
|
if (rest) {
|
|
3817
|
-
for (var token in rest)
|
|
3025
|
+
for (var token in rest)
|
|
3818
3026
|
grammar[token] = rest[token];
|
|
3819
|
-
}
|
|
3820
3027
|
delete grammar.rest;
|
|
3821
3028
|
}
|
|
3822
3029
|
var tokenList = new LinkedList();
|
|
3823
|
-
addAfter(tokenList, tokenList.head, text);
|
|
3824
|
-
|
|
3825
|
-
return toArray(tokenList);
|
|
3826
|
-
}, "tokenize"),
|
|
3030
|
+
return addAfter(tokenList, tokenList.head, text), matchGrammar(text, tokenList, grammar, tokenList.head, 0), toArray(tokenList);
|
|
3031
|
+
},
|
|
3827
3032
|
/**
|
|
3828
3033
|
* @namespace
|
|
3829
3034
|
* @memberof Prism
|
|
@@ -3843,11 +3048,10 @@ var require_prism_core = __commonJS({
|
|
|
3843
3048
|
* @param {HookCallback} callback The callback function which is given environment variables.
|
|
3844
3049
|
* @public
|
|
3845
3050
|
*/
|
|
3846
|
-
add:
|
|
3051
|
+
add: function(name, callback) {
|
|
3847
3052
|
var hooks = _.hooks.all;
|
|
3848
|
-
hooks[name] = hooks[name] || [];
|
|
3849
|
-
|
|
3850
|
-
}, "add"),
|
|
3053
|
+
hooks[name] = hooks[name] || [], hooks[name].push(callback);
|
|
3054
|
+
},
|
|
3851
3055
|
/**
|
|
3852
3056
|
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
3853
3057
|
*
|
|
@@ -3857,36 +3061,27 @@ var require_prism_core = __commonJS({
|
|
|
3857
3061
|
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
|
3858
3062
|
* @public
|
|
3859
3063
|
*/
|
|
3860
|
-
run:
|
|
3064
|
+
run: function(name, env) {
|
|
3861
3065
|
var callbacks = _.hooks.all[name];
|
|
3862
|
-
if (!callbacks || !callbacks.length)
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
callback(env);
|
|
3867
|
-
}
|
|
3868
|
-
}, "run")
|
|
3066
|
+
if (!(!callbacks || !callbacks.length))
|
|
3067
|
+
for (var i = 0, callback; callback = callbacks[i++]; )
|
|
3068
|
+
callback(env);
|
|
3069
|
+
}
|
|
3869
3070
|
},
|
|
3870
3071
|
Token
|
|
3871
3072
|
};
|
|
3872
3073
|
_self2.Prism = _;
|
|
3873
3074
|
function Token(type, content, alias, matchedStr) {
|
|
3874
|
-
this.type = type;
|
|
3875
|
-
this.content = content;
|
|
3876
|
-
this.alias = alias;
|
|
3877
|
-
this.length = (matchedStr || "").length | 0;
|
|
3075
|
+
this.type = type, this.content = content, this.alias = alias, this.length = (matchedStr || "").length | 0;
|
|
3878
3076
|
}
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
if (typeof o == "string") {
|
|
3077
|
+
Token.stringify = function stringify(o, language) {
|
|
3078
|
+
if (typeof o == "string")
|
|
3882
3079
|
return o;
|
|
3883
|
-
}
|
|
3884
3080
|
if (Array.isArray(o)) {
|
|
3885
3081
|
var s = "";
|
|
3886
|
-
o.forEach(function(e) {
|
|
3082
|
+
return o.forEach(function(e) {
|
|
3887
3083
|
s += stringify(e, language);
|
|
3888
|
-
});
|
|
3889
|
-
return s;
|
|
3084
|
+
}), s;
|
|
3890
3085
|
}
|
|
3891
3086
|
var env = {
|
|
3892
3087
|
type: o.type,
|
|
@@ -3895,221 +3090,107 @@ var require_prism_core = __commonJS({
|
|
|
3895
3090
|
classes: ["token", o.type],
|
|
3896
3091
|
attributes: {},
|
|
3897
3092
|
language
|
|
3898
|
-
};
|
|
3899
|
-
|
|
3900
|
-
if (aliases) {
|
|
3901
|
-
if (Array.isArray(aliases)) {
|
|
3902
|
-
Array.prototype.push.apply(env.classes, aliases);
|
|
3903
|
-
} else {
|
|
3904
|
-
env.classes.push(aliases);
|
|
3905
|
-
}
|
|
3906
|
-
}
|
|
3907
|
-
_.hooks.run("wrap", env);
|
|
3093
|
+
}, aliases = o.alias;
|
|
3094
|
+
aliases && (Array.isArray(aliases) ? Array.prototype.push.apply(env.classes, aliases) : env.classes.push(aliases)), _.hooks.run("wrap", env);
|
|
3908
3095
|
var attributes = "";
|
|
3909
|
-
for (var name in env.attributes)
|
|
3096
|
+
for (var name in env.attributes)
|
|
3910
3097
|
attributes += " " + name + '="' + (env.attributes[name] || "").replace(/"/g, """) + '"';
|
|
3911
|
-
}
|
|
3912
3098
|
return "<" + env.tag + ' class="' + env.classes.join(" ") + '"' + attributes + ">" + env.content + "</" + env.tag + ">";
|
|
3913
|
-
}
|
|
3099
|
+
};
|
|
3914
3100
|
function matchPattern(pattern, pos, text, lookbehind) {
|
|
3915
3101
|
pattern.lastIndex = pos;
|
|
3916
3102
|
var match = pattern.exec(text);
|
|
3917
3103
|
if (match && lookbehind && match[1]) {
|
|
3918
3104
|
var lookbehindLength = match[1].length;
|
|
3919
|
-
match.index += lookbehindLength;
|
|
3920
|
-
match[0] = match[0].slice(lookbehindLength);
|
|
3105
|
+
match.index += lookbehindLength, match[0] = match[0].slice(lookbehindLength);
|
|
3921
3106
|
}
|
|
3922
3107
|
return match;
|
|
3923
3108
|
}
|
|
3924
|
-
__name(matchPattern, "matchPattern");
|
|
3925
3109
|
function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
|
|
3926
|
-
for (var token in grammar)
|
|
3927
|
-
if (!grammar.hasOwnProperty(token) || !grammar[token]) {
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
for (var j = 0; j < patterns.length; ++j) {
|
|
3933
|
-
if (rematch && rematch.cause == token + "," + j) {
|
|
3934
|
-
return;
|
|
3935
|
-
}
|
|
3936
|
-
var patternObj = patterns[j];
|
|
3937
|
-
var inside = patternObj.inside;
|
|
3938
|
-
var lookbehind = !!patternObj.lookbehind;
|
|
3939
|
-
var greedy = !!patternObj.greedy;
|
|
3940
|
-
var alias = patternObj.alias;
|
|
3941
|
-
if (greedy && !patternObj.pattern.global) {
|
|
3942
|
-
var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
|
|
3943
|
-
patternObj.pattern = RegExp(patternObj.pattern.source, flags + "g");
|
|
3944
|
-
}
|
|
3945
|
-
var pattern = patternObj.pattern || patternObj;
|
|
3946
|
-
for (var currentNode = startNode.next, pos = startPos; currentNode !== tokenList.tail; pos += currentNode.value.length, currentNode = currentNode.next) {
|
|
3947
|
-
if (rematch && pos >= rematch.reach) {
|
|
3948
|
-
break;
|
|
3949
|
-
}
|
|
3950
|
-
var str = currentNode.value;
|
|
3951
|
-
if (tokenList.length > text.length) {
|
|
3110
|
+
for (var token in grammar)
|
|
3111
|
+
if (!(!grammar.hasOwnProperty(token) || !grammar[token])) {
|
|
3112
|
+
var patterns = grammar[token];
|
|
3113
|
+
patterns = Array.isArray(patterns) ? patterns : [patterns];
|
|
3114
|
+
for (var j = 0; j < patterns.length; ++j) {
|
|
3115
|
+
if (rematch && rematch.cause == token + "," + j)
|
|
3952
3116
|
return;
|
|
3117
|
+
var patternObj = patterns[j], inside = patternObj.inside, lookbehind = !!patternObj.lookbehind, greedy = !!patternObj.greedy, alias = patternObj.alias;
|
|
3118
|
+
if (greedy && !patternObj.pattern.global) {
|
|
3119
|
+
var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
|
|
3120
|
+
patternObj.pattern = RegExp(patternObj.pattern.source, flags + "g");
|
|
3953
3121
|
}
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
removeCount
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
match = matchPattern(pattern, 0, str, lookbehind);
|
|
3986
|
-
if (!match) {
|
|
3987
|
-
continue;
|
|
3988
|
-
}
|
|
3989
|
-
}
|
|
3990
|
-
var from = match.index;
|
|
3991
|
-
var matchStr = match[0];
|
|
3992
|
-
var before = str.slice(0, from);
|
|
3993
|
-
var after = str.slice(from + matchStr.length);
|
|
3994
|
-
var reach = pos + str.length;
|
|
3995
|
-
if (rematch && reach > rematch.reach) {
|
|
3996
|
-
rematch.reach = reach;
|
|
3997
|
-
}
|
|
3998
|
-
var removeFrom = currentNode.prev;
|
|
3999
|
-
if (before) {
|
|
4000
|
-
removeFrom = addAfter(tokenList, removeFrom, before);
|
|
4001
|
-
pos += before.length;
|
|
4002
|
-
}
|
|
4003
|
-
removeRange(tokenList, removeFrom, removeCount);
|
|
4004
|
-
var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
|
|
4005
|
-
currentNode = addAfter(tokenList, removeFrom, wrapped);
|
|
4006
|
-
if (after) {
|
|
4007
|
-
addAfter(tokenList, currentNode, after);
|
|
4008
|
-
}
|
|
4009
|
-
if (removeCount > 1) {
|
|
4010
|
-
var nestedRematch = {
|
|
4011
|
-
cause: token + "," + j,
|
|
4012
|
-
reach
|
|
4013
|
-
};
|
|
4014
|
-
matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
|
|
4015
|
-
if (rematch && nestedRematch.reach > rematch.reach) {
|
|
4016
|
-
rematch.reach = nestedRematch.reach;
|
|
3122
|
+
for (var pattern = patternObj.pattern || patternObj, currentNode = startNode.next, pos = startPos; currentNode !== tokenList.tail && !(rematch && pos >= rematch.reach); pos += currentNode.value.length, currentNode = currentNode.next) {
|
|
3123
|
+
var str = currentNode.value;
|
|
3124
|
+
if (tokenList.length > text.length)
|
|
3125
|
+
return;
|
|
3126
|
+
if (!(str instanceof Token)) {
|
|
3127
|
+
var removeCount = 1, match;
|
|
3128
|
+
if (greedy) {
|
|
3129
|
+
if (match = matchPattern(pattern, pos, text, lookbehind), !match || match.index >= text.length)
|
|
3130
|
+
break;
|
|
3131
|
+
var from = match.index, to = match.index + match[0].length, p = pos;
|
|
3132
|
+
for (p += currentNode.value.length; from >= p; )
|
|
3133
|
+
currentNode = currentNode.next, p += currentNode.value.length;
|
|
3134
|
+
if (p -= currentNode.value.length, pos = p, currentNode.value instanceof Token)
|
|
3135
|
+
continue;
|
|
3136
|
+
for (var k = currentNode; k !== tokenList.tail && (p < to || typeof k.value == "string"); k = k.next)
|
|
3137
|
+
removeCount++, p += k.value.length;
|
|
3138
|
+
removeCount--, str = text.slice(pos, p), match.index -= pos;
|
|
3139
|
+
} else if (match = matchPattern(pattern, 0, str, lookbehind), !match)
|
|
3140
|
+
continue;
|
|
3141
|
+
var from = match.index, matchStr = match[0], before = str.slice(0, from), after = str.slice(from + matchStr.length), reach = pos + str.length;
|
|
3142
|
+
rematch && reach > rematch.reach && (rematch.reach = reach);
|
|
3143
|
+
var removeFrom = currentNode.prev;
|
|
3144
|
+
before && (removeFrom = addAfter(tokenList, removeFrom, before), pos += before.length), removeRange(tokenList, removeFrom, removeCount);
|
|
3145
|
+
var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
|
|
3146
|
+
if (currentNode = addAfter(tokenList, removeFrom, wrapped), after && addAfter(tokenList, currentNode, after), removeCount > 1) {
|
|
3147
|
+
var nestedRematch = {
|
|
3148
|
+
cause: token + "," + j,
|
|
3149
|
+
reach
|
|
3150
|
+
};
|
|
3151
|
+
matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch), rematch && nestedRematch.reach > rematch.reach && (rematch.reach = nestedRematch.reach);
|
|
3152
|
+
}
|
|
4017
3153
|
}
|
|
4018
3154
|
}
|
|
4019
3155
|
}
|
|
4020
3156
|
}
|
|
4021
|
-
}
|
|
4022
3157
|
}
|
|
4023
|
-
__name(matchGrammar, "matchGrammar");
|
|
4024
3158
|
function LinkedList() {
|
|
4025
|
-
var head = { value: null, prev: null, next: null };
|
|
4026
|
-
|
|
4027
|
-
head.next = tail;
|
|
4028
|
-
this.head = head;
|
|
4029
|
-
this.tail = tail;
|
|
4030
|
-
this.length = 0;
|
|
3159
|
+
var head = { value: null, prev: null, next: null }, tail = { value: null, prev: head, next: null };
|
|
3160
|
+
head.next = tail, this.head = head, this.tail = tail, this.length = 0;
|
|
4031
3161
|
}
|
|
4032
|
-
__name(LinkedList, "LinkedList");
|
|
4033
3162
|
function addAfter(list, node, value) {
|
|
4034
|
-
var next = node.next;
|
|
4035
|
-
|
|
4036
|
-
node.next = newNode;
|
|
4037
|
-
next.prev = newNode;
|
|
4038
|
-
list.length++;
|
|
4039
|
-
return newNode;
|
|
3163
|
+
var next = node.next, newNode = { value, prev: node, next };
|
|
3164
|
+
return node.next = newNode, next.prev = newNode, list.length++, newNode;
|
|
4040
3165
|
}
|
|
4041
|
-
__name(addAfter, "addAfter");
|
|
4042
3166
|
function removeRange(list, node, count) {
|
|
4043
|
-
var next = node.next;
|
|
4044
|
-
for (var i = 0; i < count && next !== list.tail; i++) {
|
|
3167
|
+
for (var next = node.next, i = 0; i < count && next !== list.tail; i++)
|
|
4045
3168
|
next = next.next;
|
|
4046
|
-
|
|
4047
|
-
node.next = next;
|
|
4048
|
-
next.prev = node;
|
|
4049
|
-
list.length -= i;
|
|
3169
|
+
node.next = next, next.prev = node, list.length -= i;
|
|
4050
3170
|
}
|
|
4051
|
-
__name(removeRange, "removeRange");
|
|
4052
3171
|
function toArray(list) {
|
|
4053
|
-
var array = [];
|
|
4054
|
-
|
|
4055
|
-
while (node !== list.tail) {
|
|
4056
|
-
array.push(node.value);
|
|
4057
|
-
node = node.next;
|
|
4058
|
-
}
|
|
3172
|
+
for (var array = [], node = list.head.next; node !== list.tail; )
|
|
3173
|
+
array.push(node.value), node = node.next;
|
|
4059
3174
|
return array;
|
|
4060
3175
|
}
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
}
|
|
4066
|
-
if (!_.disableWorkerMessageHandler) {
|
|
4067
|
-
_self2.addEventListener("message", function(evt) {
|
|
4068
|
-
var message = JSON.parse(evt.data);
|
|
4069
|
-
var lang2 = message.language;
|
|
4070
|
-
var code = message.code;
|
|
4071
|
-
var immediateClose = message.immediateClose;
|
|
4072
|
-
_self2.postMessage(_.highlight(code, _.languages[lang2], lang2));
|
|
4073
|
-
if (immediateClose) {
|
|
4074
|
-
_self2.close();
|
|
4075
|
-
}
|
|
4076
|
-
}, false);
|
|
4077
|
-
}
|
|
4078
|
-
return _;
|
|
4079
|
-
}
|
|
3176
|
+
if (!_self2.document)
|
|
3177
|
+
return _self2.addEventListener && (_.disableWorkerMessageHandler || _self2.addEventListener("message", function(evt) {
|
|
3178
|
+
var message = JSON.parse(evt.data), lang2 = message.language, code = message.code, immediateClose = message.immediateClose;
|
|
3179
|
+
_self2.postMessage(_.highlight(code, _.languages[lang2], lang2)), immediateClose && _self2.close();
|
|
3180
|
+
}, !1)), _;
|
|
4080
3181
|
var script = _.util.currentScript();
|
|
4081
|
-
|
|
4082
|
-
_.filename = script.src;
|
|
4083
|
-
if (script.hasAttribute("data-manual")) {
|
|
4084
|
-
_.manual = true;
|
|
4085
|
-
}
|
|
4086
|
-
}
|
|
3182
|
+
script && (_.filename = script.src, script.hasAttribute("data-manual") && (_.manual = !0));
|
|
4087
3183
|
function highlightAutomaticallyCallback() {
|
|
4088
|
-
|
|
4089
|
-
_.highlightAll();
|
|
4090
|
-
}
|
|
3184
|
+
_.manual || _.highlightAll();
|
|
4091
3185
|
}
|
|
4092
|
-
__name(highlightAutomaticallyCallback, "highlightAutomaticallyCallback");
|
|
4093
3186
|
if (!_.manual) {
|
|
4094
3187
|
var readyState = document.readyState;
|
|
4095
|
-
|
|
4096
|
-
document.addEventListener("DOMContentLoaded", highlightAutomaticallyCallback);
|
|
4097
|
-
} else {
|
|
4098
|
-
if (window.requestAnimationFrame) {
|
|
4099
|
-
window.requestAnimationFrame(highlightAutomaticallyCallback);
|
|
4100
|
-
} else {
|
|
4101
|
-
window.setTimeout(highlightAutomaticallyCallback, 16);
|
|
4102
|
-
}
|
|
4103
|
-
}
|
|
3188
|
+
readyState === "loading" || readyState === "interactive" && script && script.defer ? document.addEventListener("DOMContentLoaded", highlightAutomaticallyCallback) : window.requestAnimationFrame ? window.requestAnimationFrame(highlightAutomaticallyCallback) : window.setTimeout(highlightAutomaticallyCallback, 16);
|
|
4104
3189
|
}
|
|
4105
3190
|
return _;
|
|
4106
|
-
}(_self);
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
}
|
|
4110
|
-
if (typeof global !== "undefined") {
|
|
4111
|
-
global.Prism = Prism;
|
|
4112
|
-
}
|
|
3191
|
+
})(_self);
|
|
3192
|
+
typeof module < "u" && module.exports && (module.exports = Prism);
|
|
3193
|
+
typeof global < "u" && (global.Prism = Prism);
|
|
4113
3194
|
}
|
|
4114
3195
|
});
|
|
4115
3196
|
|
|
@@ -4125,22 +3206,22 @@ var require_clike = __commonJS({
|
|
|
4125
3206
|
comment: [
|
|
4126
3207
|
{
|
|
4127
3208
|
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
|
4128
|
-
lookbehind:
|
|
4129
|
-
greedy:
|
|
3209
|
+
lookbehind: !0,
|
|
3210
|
+
greedy: !0
|
|
4130
3211
|
},
|
|
4131
3212
|
{
|
|
4132
3213
|
pattern: /(^|[^\\:])\/\/.*/,
|
|
4133
|
-
lookbehind:
|
|
4134
|
-
greedy:
|
|
3214
|
+
lookbehind: !0,
|
|
3215
|
+
greedy: !0
|
|
4135
3216
|
}
|
|
4136
3217
|
],
|
|
4137
3218
|
string: {
|
|
4138
3219
|
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
|
4139
|
-
greedy:
|
|
3220
|
+
greedy: !0
|
|
4140
3221
|
},
|
|
4141
3222
|
"class-name": {
|
|
4142
3223
|
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
|
4143
|
-
lookbehind:
|
|
3224
|
+
lookbehind: !0,
|
|
4144
3225
|
inside: {
|
|
4145
3226
|
punctuation: /[.\\]/
|
|
4146
3227
|
}
|
|
@@ -4153,7 +3234,6 @@ var require_clike = __commonJS({
|
|
|
4153
3234
|
punctuation: /[{}[\];(),.:]/
|
|
4154
3235
|
};
|
|
4155
3236
|
}
|
|
4156
|
-
__name(clike, "clike");
|
|
4157
3237
|
}
|
|
4158
3238
|
});
|
|
4159
3239
|
|
|
@@ -4170,17 +3250,17 @@ var require_javascript = __commonJS({
|
|
|
4170
3250
|
Prism.languages.clike["class-name"],
|
|
4171
3251
|
{
|
|
4172
3252
|
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
4173
|
-
lookbehind:
|
|
3253
|
+
lookbehind: !0
|
|
4174
3254
|
}
|
|
4175
3255
|
],
|
|
4176
3256
|
keyword: [
|
|
4177
3257
|
{
|
|
4178
3258
|
pattern: /((?:^|\})\s*)catch\b/,
|
|
4179
|
-
lookbehind:
|
|
3259
|
+
lookbehind: !0
|
|
4180
3260
|
},
|
|
4181
3261
|
{
|
|
4182
3262
|
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/,
|
|
4183
|
-
lookbehind:
|
|
3263
|
+
lookbehind: !0
|
|
4184
3264
|
}
|
|
4185
3265
|
],
|
|
4186
3266
|
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
|
|
@@ -4195,21 +3275,19 @@ var require_javascript = __commonJS({
|
|
|
4195
3275
|
/\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
|
|
4196
3276
|
/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
|
|
4197
3277
|
),
|
|
4198
|
-
lookbehind:
|
|
3278
|
+
lookbehind: !0
|
|
4199
3279
|
},
|
|
4200
3280
|
operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
4201
|
-
})
|
|
4202
|
-
Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
|
|
4203
|
-
Prism.languages.insertBefore("javascript", "keyword", {
|
|
3281
|
+
}), Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, Prism.languages.insertBefore("javascript", "keyword", {
|
|
4204
3282
|
regex: {
|
|
4205
3283
|
// eslint-disable-next-line regexp/no-dupe-characters-character-class
|
|
4206
3284
|
pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,
|
|
4207
|
-
lookbehind:
|
|
4208
|
-
greedy:
|
|
3285
|
+
lookbehind: !0,
|
|
3286
|
+
greedy: !0,
|
|
4209
3287
|
inside: {
|
|
4210
3288
|
"regex-source": {
|
|
4211
3289
|
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
4212
|
-
lookbehind:
|
|
3290
|
+
lookbehind: !0,
|
|
4213
3291
|
alias: "language-regex",
|
|
4214
3292
|
inside: Prism.languages.regex
|
|
4215
3293
|
},
|
|
@@ -4225,36 +3303,35 @@ var require_javascript = __commonJS({
|
|
|
4225
3303
|
parameter: [
|
|
4226
3304
|
{
|
|
4227
3305
|
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
4228
|
-
lookbehind:
|
|
3306
|
+
lookbehind: !0,
|
|
4229
3307
|
inside: Prism.languages.javascript
|
|
4230
3308
|
},
|
|
4231
3309
|
{
|
|
4232
3310
|
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
4233
|
-
lookbehind:
|
|
3311
|
+
lookbehind: !0,
|
|
4234
3312
|
inside: Prism.languages.javascript
|
|
4235
3313
|
},
|
|
4236
3314
|
{
|
|
4237
3315
|
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
4238
|
-
lookbehind:
|
|
3316
|
+
lookbehind: !0,
|
|
4239
3317
|
inside: Prism.languages.javascript
|
|
4240
3318
|
},
|
|
4241
3319
|
{
|
|
4242
3320
|
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*\{)/,
|
|
4243
|
-
lookbehind:
|
|
3321
|
+
lookbehind: !0,
|
|
4244
3322
|
inside: Prism.languages.javascript
|
|
4245
3323
|
}
|
|
4246
3324
|
],
|
|
4247
3325
|
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
4248
|
-
})
|
|
4249
|
-
Prism.languages.insertBefore("javascript", "string", {
|
|
3326
|
+
}), Prism.languages.insertBefore("javascript", "string", {
|
|
4250
3327
|
hashbang: {
|
|
4251
3328
|
pattern: /^#!.*/,
|
|
4252
|
-
greedy:
|
|
3329
|
+
greedy: !0,
|
|
4253
3330
|
alias: "comment"
|
|
4254
3331
|
},
|
|
4255
3332
|
"template-string": {
|
|
4256
3333
|
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
4257
|
-
greedy:
|
|
3334
|
+
greedy: !0,
|
|
4258
3335
|
inside: {
|
|
4259
3336
|
"template-punctuation": {
|
|
4260
3337
|
pattern: /^`|`$/,
|
|
@@ -4262,7 +3339,7 @@ var require_javascript = __commonJS({
|
|
|
4262
3339
|
},
|
|
4263
3340
|
interpolation: {
|
|
4264
3341
|
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
4265
|
-
lookbehind:
|
|
3342
|
+
lookbehind: !0,
|
|
4266
3343
|
inside: {
|
|
4267
3344
|
"interpolation-punctuation": {
|
|
4268
3345
|
pattern: /^\$\{|\}$/,
|
|
@@ -4276,28 +3353,21 @@ var require_javascript = __commonJS({
|
|
|
4276
3353
|
},
|
|
4277
3354
|
"string-property": {
|
|
4278
3355
|
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
4279
|
-
lookbehind:
|
|
4280
|
-
greedy:
|
|
3356
|
+
lookbehind: !0,
|
|
3357
|
+
greedy: !0,
|
|
4281
3358
|
alias: "property"
|
|
4282
3359
|
}
|
|
4283
|
-
})
|
|
4284
|
-
Prism.languages.insertBefore("javascript", "operator", {
|
|
3360
|
+
}), Prism.languages.insertBefore("javascript", "operator", {
|
|
4285
3361
|
"literal-property": {
|
|
4286
3362
|
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
|
4287
|
-
lookbehind:
|
|
3363
|
+
lookbehind: !0,
|
|
4288
3364
|
alias: "property"
|
|
4289
3365
|
}
|
|
4290
|
-
})
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
/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,
|
|
4295
|
-
"javascript"
|
|
4296
|
-
);
|
|
4297
|
-
}
|
|
4298
|
-
Prism.languages.js = Prism.languages.javascript;
|
|
3366
|
+
}), Prism.languages.markup && (Prism.languages.markup.tag.addInlined("script", "javascript"), Prism.languages.markup.tag.addAttribute(
|
|
3367
|
+
/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,
|
|
3368
|
+
"javascript"
|
|
3369
|
+
)), Prism.languages.js = Prism.languages.javascript;
|
|
4299
3370
|
}
|
|
4300
|
-
__name(javascript, "javascript");
|
|
4301
3371
|
}
|
|
4302
3372
|
});
|
|
4303
3373
|
|
|
@@ -4305,21 +3375,13 @@ var require_javascript = __commonJS({
|
|
|
4305
3375
|
var require_core = __commonJS({
|
|
4306
3376
|
"../node_modules/refractor/core.js"(exports, module) {
|
|
4307
3377
|
"use strict";
|
|
4308
|
-
var ctx = typeof globalThis
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
var h = require_hastscript();
|
|
4312
|
-
var decode = require_parse_entities();
|
|
4313
|
-
var Prism = require_prism_core();
|
|
4314
|
-
var markup2 = require_markup();
|
|
4315
|
-
var css2 = require_css();
|
|
4316
|
-
var clike = require_clike();
|
|
4317
|
-
var js = require_javascript();
|
|
3378
|
+
var ctx = typeof globalThis == "object" ? globalThis : typeof self == "object" ? self : typeof window == "object" ? window : typeof global == "object" ? global : {}, restore = capture();
|
|
3379
|
+
ctx.Prism = { manual: !0, disableWorkerMessageHandler: !0 };
|
|
3380
|
+
var h = require_hastscript(), decode = require_parse_entities(), Prism = require_prism_core(), markup2 = require_markup(), css2 = require_css(), clike = require_clike(), js = require_javascript();
|
|
4318
3381
|
restore();
|
|
4319
3382
|
var own = {}.hasOwnProperty;
|
|
4320
3383
|
function Refractor() {
|
|
4321
3384
|
}
|
|
4322
|
-
__name(Refractor, "Refractor");
|
|
4323
3385
|
Refractor.prototype = Prism;
|
|
4324
3386
|
var refract = new Refractor();
|
|
4325
3387
|
module.exports = refract;
|
|
@@ -4335,86 +3397,47 @@ var require_core = __commonJS({
|
|
|
4335
3397
|
refract.util.encode = encode;
|
|
4336
3398
|
refract.Token.stringify = stringify;
|
|
4337
3399
|
function register(grammar) {
|
|
4338
|
-
if (typeof grammar
|
|
3400
|
+
if (typeof grammar != "function" || !grammar.displayName)
|
|
4339
3401
|
throw new Error("Expected `function` for `grammar`, got `" + grammar + "`");
|
|
4340
|
-
|
|
4341
|
-
if (refract.languages[grammar.displayName] === void 0) {
|
|
4342
|
-
grammar(refract);
|
|
4343
|
-
}
|
|
3402
|
+
refract.languages[grammar.displayName] === void 0 && grammar(refract);
|
|
4344
3403
|
}
|
|
4345
|
-
__name(register, "register");
|
|
4346
3404
|
function alias(name, alias2) {
|
|
4347
|
-
var languages = refract.languages;
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
var length;
|
|
4352
|
-
var index;
|
|
4353
|
-
if (alias2) {
|
|
4354
|
-
map = {};
|
|
4355
|
-
map[name] = alias2;
|
|
4356
|
-
}
|
|
4357
|
-
for (key in map) {
|
|
4358
|
-
list = map[key];
|
|
4359
|
-
list = typeof list === "string" ? [list] : list;
|
|
4360
|
-
length = list.length;
|
|
4361
|
-
index = -1;
|
|
4362
|
-
while (++index < length) {
|
|
3405
|
+
var languages = refract.languages, map = name, key, list, length, index;
|
|
3406
|
+
alias2 && (map = {}, map[name] = alias2);
|
|
3407
|
+
for (key in map)
|
|
3408
|
+
for (list = map[key], list = typeof list == "string" ? [list] : list, length = list.length, index = -1; ++index < length; )
|
|
4363
3409
|
languages[list[index]] = languages[key];
|
|
4364
|
-
}
|
|
4365
|
-
}
|
|
4366
3410
|
}
|
|
4367
|
-
__name(alias, "alias");
|
|
4368
3411
|
function highlight(value, name) {
|
|
4369
|
-
var sup = Prism.highlight;
|
|
4370
|
-
|
|
4371
|
-
if (typeof value !== "string") {
|
|
3412
|
+
var sup = Prism.highlight, grammar;
|
|
3413
|
+
if (typeof value != "string")
|
|
4372
3414
|
throw new Error("Expected `string` for `value`, got `" + value + "`");
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
name
|
|
4377
|
-
} else {
|
|
4378
|
-
if (typeof name !== "string") {
|
|
3415
|
+
if (refract.util.type(name) === "Object")
|
|
3416
|
+
grammar = name, name = null;
|
|
3417
|
+
else {
|
|
3418
|
+
if (typeof name != "string")
|
|
4379
3419
|
throw new Error("Expected `string` for `name`, got `" + name + "`");
|
|
4380
|
-
|
|
4381
|
-
if (own.call(refract.languages, name)) {
|
|
3420
|
+
if (own.call(refract.languages, name))
|
|
4382
3421
|
grammar = refract.languages[name];
|
|
4383
|
-
|
|
3422
|
+
else
|
|
4384
3423
|
throw new Error("Unknown language: `" + name + "` is not registered");
|
|
4385
|
-
}
|
|
4386
3424
|
}
|
|
4387
3425
|
return sup.call(this, value, grammar, name);
|
|
4388
3426
|
}
|
|
4389
|
-
__name(highlight, "highlight");
|
|
4390
3427
|
function registered(language) {
|
|
4391
|
-
if (typeof language
|
|
3428
|
+
if (typeof language != "string")
|
|
4392
3429
|
throw new Error("Expected `string` for `language`, got `" + language + "`");
|
|
4393
|
-
}
|
|
4394
3430
|
return own.call(refract.languages, language);
|
|
4395
3431
|
}
|
|
4396
|
-
__name(registered, "registered");
|
|
4397
3432
|
function listLanguages() {
|
|
4398
|
-
var languages = refract.languages;
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
for (language in languages) {
|
|
4402
|
-
if (own.call(languages, language) && typeof languages[language] === "object") {
|
|
4403
|
-
list.push(language);
|
|
4404
|
-
}
|
|
4405
|
-
}
|
|
3433
|
+
var languages = refract.languages, list = [], language;
|
|
3434
|
+
for (language in languages)
|
|
3435
|
+
own.call(languages, language) && typeof languages[language] == "object" && list.push(language);
|
|
4406
3436
|
return list;
|
|
4407
3437
|
}
|
|
4408
|
-
__name(listLanguages, "listLanguages");
|
|
4409
3438
|
function stringify(value, language, parent) {
|
|
4410
3439
|
var env;
|
|
4411
|
-
|
|
4412
|
-
return { type: "text", value };
|
|
4413
|
-
}
|
|
4414
|
-
if (refract.util.type(value) === "Array") {
|
|
4415
|
-
return stringifyAll(value, language);
|
|
4416
|
-
}
|
|
4417
|
-
env = {
|
|
3440
|
+
return typeof value == "string" ? { type: "text", value } : refract.util.type(value) === "Array" ? stringifyAll(value, language) : (env = {
|
|
4418
3441
|
type: value.type,
|
|
4419
3442
|
content: refract.Token.stringify(value.content, language, parent),
|
|
4420
3443
|
tag: "span",
|
|
@@ -4422,66 +3445,35 @@ var require_core = __commonJS({
|
|
|
4422
3445
|
attributes: {},
|
|
4423
3446
|
language,
|
|
4424
3447
|
parent
|
|
4425
|
-
}
|
|
4426
|
-
if (value.alias) {
|
|
4427
|
-
env.classes = env.classes.concat(value.alias);
|
|
4428
|
-
}
|
|
4429
|
-
refract.hooks.run("wrap", env);
|
|
4430
|
-
return h(
|
|
3448
|
+
}, value.alias && (env.classes = env.classes.concat(value.alias)), refract.hooks.run("wrap", env), h(
|
|
4431
3449
|
env.tag + "." + env.classes.join("."),
|
|
4432
3450
|
attributes(env.attributes),
|
|
4433
3451
|
env.content
|
|
4434
|
-
);
|
|
3452
|
+
));
|
|
4435
3453
|
}
|
|
4436
|
-
__name(stringify, "stringify");
|
|
4437
3454
|
function stringifyAll(values, language) {
|
|
4438
|
-
var result = [];
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
while (++index < length) {
|
|
4443
|
-
value = values[index];
|
|
4444
|
-
if (value !== "" && value !== null && value !== void 0) {
|
|
4445
|
-
result.push(value);
|
|
4446
|
-
}
|
|
4447
|
-
}
|
|
4448
|
-
index = -1;
|
|
4449
|
-
length = result.length;
|
|
4450
|
-
while (++index < length) {
|
|
4451
|
-
value = result[index];
|
|
4452
|
-
result[index] = refract.Token.stringify(value, language, result);
|
|
4453
|
-
}
|
|
3455
|
+
for (var result = [], length = values.length, index = -1, value; ++index < length; )
|
|
3456
|
+
value = values[index], value !== "" && value !== null && value !== void 0 && result.push(value);
|
|
3457
|
+
for (index = -1, length = result.length; ++index < length; )
|
|
3458
|
+
value = result[index], result[index] = refract.Token.stringify(value, language, result);
|
|
4454
3459
|
return result;
|
|
4455
3460
|
}
|
|
4456
|
-
__name(stringifyAll, "stringifyAll");
|
|
4457
3461
|
function encode(tokens) {
|
|
4458
3462
|
return tokens;
|
|
4459
3463
|
}
|
|
4460
|
-
__name(encode, "encode");
|
|
4461
3464
|
function attributes(attrs) {
|
|
4462
3465
|
var key;
|
|
4463
|
-
for (key in attrs)
|
|
3466
|
+
for (key in attrs)
|
|
4464
3467
|
attrs[key] = decode(attrs[key]);
|
|
4465
|
-
}
|
|
4466
3468
|
return attrs;
|
|
4467
3469
|
}
|
|
4468
|
-
__name(attributes, "attributes");
|
|
4469
3470
|
function capture() {
|
|
4470
|
-
var defined = "Prism" in ctx;
|
|
4471
|
-
var current = defined ? ctx.Prism : void 0;
|
|
3471
|
+
var defined = "Prism" in ctx, current = defined ? ctx.Prism : void 0;
|
|
4472
3472
|
return restore2;
|
|
4473
3473
|
function restore2() {
|
|
4474
|
-
|
|
4475
|
-
ctx.Prism = current;
|
|
4476
|
-
} else {
|
|
4477
|
-
delete ctx.Prism;
|
|
4478
|
-
}
|
|
4479
|
-
defined = void 0;
|
|
4480
|
-
current = void 0;
|
|
3474
|
+
defined ? ctx.Prism = current : delete ctx.Prism, defined = void 0, current = void 0;
|
|
4481
3475
|
}
|
|
4482
|
-
__name(restore2, "restore");
|
|
4483
3476
|
}
|
|
4484
|
-
__name(capture, "capture");
|
|
4485
3477
|
}
|
|
4486
3478
|
});
|
|
4487
3479
|
|
|
@@ -4503,11 +3495,10 @@ function ownKeys(e, r) {
|
|
|
4503
3495
|
}
|
|
4504
3496
|
return t;
|
|
4505
3497
|
}
|
|
4506
|
-
__name(ownKeys, "ownKeys");
|
|
4507
3498
|
function _objectSpread(e) {
|
|
4508
3499
|
for (var r = 1; r < arguments.length; r++) {
|
|
4509
|
-
var t =
|
|
4510
|
-
r % 2 ? ownKeys(Object(t),
|
|
3500
|
+
var t = arguments[r] != null ? arguments[r] : {};
|
|
3501
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function(r2) {
|
|
4511
3502
|
_defineProperty(e, r2, t[r2]);
|
|
4512
3503
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
4513
3504
|
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
@@ -4515,52 +3506,37 @@ function _objectSpread(e) {
|
|
|
4515
3506
|
}
|
|
4516
3507
|
return e;
|
|
4517
3508
|
}
|
|
4518
|
-
__name(_objectSpread, "_objectSpread");
|
|
4519
3509
|
function powerSetPermutations(arr) {
|
|
4520
3510
|
var arrLength = arr.length;
|
|
4521
3511
|
if (arrLength === 0 || arrLength === 1) return arr;
|
|
4522
|
-
if (arrLength === 2)
|
|
3512
|
+
if (arrLength === 2)
|
|
4523
3513
|
return [arr[0], arr[1], "".concat(arr[0], ".").concat(arr[1]), "".concat(arr[1], ".").concat(arr[0])];
|
|
4524
|
-
|
|
4525
|
-
if (arrLength === 3) {
|
|
3514
|
+
if (arrLength === 3)
|
|
4526
3515
|
return [arr[0], arr[1], arr[2], "".concat(arr[0], ".").concat(arr[1]), "".concat(arr[0], ".").concat(arr[2]), "".concat(arr[1], ".").concat(arr[0]), "".concat(arr[1], ".").concat(arr[2]), "".concat(arr[2], ".").concat(arr[0]), "".concat(arr[2], ".").concat(arr[1]), "".concat(arr[0], ".").concat(arr[1], ".").concat(arr[2]), "".concat(arr[0], ".").concat(arr[2], ".").concat(arr[1]), "".concat(arr[1], ".").concat(arr[0], ".").concat(arr[2]), "".concat(arr[1], ".").concat(arr[2], ".").concat(arr[0]), "".concat(arr[2], ".").concat(arr[0], ".").concat(arr[1]), "".concat(arr[2], ".").concat(arr[1], ".").concat(arr[0])];
|
|
4527
|
-
|
|
4528
|
-
if (arrLength >= 4) {
|
|
3516
|
+
if (arrLength >= 4)
|
|
4529
3517
|
return [arr[0], arr[1], arr[2], arr[3], "".concat(arr[0], ".").concat(arr[1]), "".concat(arr[0], ".").concat(arr[2]), "".concat(arr[0], ".").concat(arr[3]), "".concat(arr[1], ".").concat(arr[0]), "".concat(arr[1], ".").concat(arr[2]), "".concat(arr[1], ".").concat(arr[3]), "".concat(arr[2], ".").concat(arr[0]), "".concat(arr[2], ".").concat(arr[1]), "".concat(arr[2], ".").concat(arr[3]), "".concat(arr[3], ".").concat(arr[0]), "".concat(arr[3], ".").concat(arr[1]), "".concat(arr[3], ".").concat(arr[2]), "".concat(arr[0], ".").concat(arr[1], ".").concat(arr[2]), "".concat(arr[0], ".").concat(arr[1], ".").concat(arr[3]), "".concat(arr[0], ".").concat(arr[2], ".").concat(arr[1]), "".concat(arr[0], ".").concat(arr[2], ".").concat(arr[3]), "".concat(arr[0], ".").concat(arr[3], ".").concat(arr[1]), "".concat(arr[0], ".").concat(arr[3], ".").concat(arr[2]), "".concat(arr[1], ".").concat(arr[0], ".").concat(arr[2]), "".concat(arr[1], ".").concat(arr[0], ".").concat(arr[3]), "".concat(arr[1], ".").concat(arr[2], ".").concat(arr[0]), "".concat(arr[1], ".").concat(arr[2], ".").concat(arr[3]), "".concat(arr[1], ".").concat(arr[3], ".").concat(arr[0]), "".concat(arr[1], ".").concat(arr[3], ".").concat(arr[2]), "".concat(arr[2], ".").concat(arr[0], ".").concat(arr[1]), "".concat(arr[2], ".").concat(arr[0], ".").concat(arr[3]), "".concat(arr[2], ".").concat(arr[1], ".").concat(arr[0]), "".concat(arr[2], ".").concat(arr[1], ".").concat(arr[3]), "".concat(arr[2], ".").concat(arr[3], ".").concat(arr[0]), "".concat(arr[2], ".").concat(arr[3], ".").concat(arr[1]), "".concat(arr[3], ".").concat(arr[0], ".").concat(arr[1]), "".concat(arr[3], ".").concat(arr[0], ".").concat(arr[2]), "".concat(arr[3], ".").concat(arr[1], ".").concat(arr[0]), "".concat(arr[3], ".").concat(arr[1], ".").concat(arr[2]), "".concat(arr[3], ".").concat(arr[2], ".").concat(arr[0]), "".concat(arr[3], ".").concat(arr[2], ".").concat(arr[1]), "".concat(arr[0], ".").concat(arr[1], ".").concat(arr[2], ".").concat(arr[3]), "".concat(arr[0], ".").concat(arr[1], ".").concat(arr[3], ".").concat(arr[2]), "".concat(arr[0], ".").concat(arr[2], ".").concat(arr[1], ".").concat(arr[3]), "".concat(arr[0], ".").concat(arr[2], ".").concat(arr[3], ".").concat(arr[1]), "".concat(arr[0], ".").concat(arr[3], ".").concat(arr[1], ".").concat(arr[2]), "".concat(arr[0], ".").concat(arr[3], ".").concat(arr[2], ".").concat(arr[1]), "".concat(arr[1], ".").concat(arr[0], ".").concat(arr[2], ".").concat(arr[3]), "".concat(arr[1], ".").concat(arr[0], ".").concat(arr[3], ".").concat(arr[2]), "".concat(arr[1], ".").concat(arr[2], ".").concat(arr[0], ".").concat(arr[3]), "".concat(arr[1], ".").concat(arr[2], ".").concat(arr[3], ".").concat(arr[0]), "".concat(arr[1], ".").concat(arr[3], ".").concat(arr[0], ".").concat(arr[2]), "".concat(arr[1], ".").concat(arr[3], ".").concat(arr[2], ".").concat(arr[0]), "".concat(arr[2], ".").concat(arr[0], ".").concat(arr[1], ".").concat(arr[3]), "".concat(arr[2], ".").concat(arr[0], ".").concat(arr[3], ".").concat(arr[1]), "".concat(arr[2], ".").concat(arr[1], ".").concat(arr[0], ".").concat(arr[3]), "".concat(arr[2], ".").concat(arr[1], ".").concat(arr[3], ".").concat(arr[0]), "".concat(arr[2], ".").concat(arr[3], ".").concat(arr[0], ".").concat(arr[1]), "".concat(arr[2], ".").concat(arr[3], ".").concat(arr[1], ".").concat(arr[0]), "".concat(arr[3], ".").concat(arr[0], ".").concat(arr[1], ".").concat(arr[2]), "".concat(arr[3], ".").concat(arr[0], ".").concat(arr[2], ".").concat(arr[1]), "".concat(arr[3], ".").concat(arr[1], ".").concat(arr[0], ".").concat(arr[2]), "".concat(arr[3], ".").concat(arr[1], ".").concat(arr[2], ".").concat(arr[0]), "".concat(arr[3], ".").concat(arr[2], ".").concat(arr[0], ".").concat(arr[1]), "".concat(arr[3], ".").concat(arr[2], ".").concat(arr[1], ".").concat(arr[0])];
|
|
4530
|
-
}
|
|
4531
3518
|
}
|
|
4532
|
-
__name(powerSetPermutations, "powerSetPermutations");
|
|
4533
3519
|
var classNameCombinations = {};
|
|
4534
3520
|
function getClassNameCombinations(classNames) {
|
|
4535
3521
|
if (classNames.length === 0 || classNames.length === 1) return classNames;
|
|
4536
3522
|
var key = classNames.join(".");
|
|
4537
|
-
|
|
4538
|
-
classNameCombinations[key] = powerSetPermutations(classNames);
|
|
4539
|
-
}
|
|
4540
|
-
return classNameCombinations[key];
|
|
3523
|
+
return classNameCombinations[key] || (classNameCombinations[key] = powerSetPermutations(classNames)), classNameCombinations[key];
|
|
4541
3524
|
}
|
|
4542
|
-
__name(getClassNameCombinations, "getClassNameCombinations");
|
|
4543
3525
|
function createStyleObject(classNames) {
|
|
4544
|
-
var elementStyle = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}
|
|
4545
|
-
var stylesheet = arguments.length > 2 ? arguments[2] : void 0;
|
|
4546
|
-
var nonTokenClassNames = classNames.filter(function(className) {
|
|
3526
|
+
var elementStyle = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, stylesheet = arguments.length > 2 ? arguments[2] : void 0, nonTokenClassNames = classNames.filter(function(className) {
|
|
4547
3527
|
return className !== "token";
|
|
4548
|
-
});
|
|
4549
|
-
var classNamesCombinations = getClassNameCombinations(nonTokenClassNames);
|
|
3528
|
+
}), classNamesCombinations = getClassNameCombinations(nonTokenClassNames);
|
|
4550
3529
|
return classNamesCombinations.reduce(function(styleObject, className) {
|
|
4551
3530
|
return _objectSpread(_objectSpread({}, styleObject), stylesheet[className]);
|
|
4552
3531
|
}, elementStyle);
|
|
4553
3532
|
}
|
|
4554
|
-
__name(createStyleObject, "createStyleObject");
|
|
4555
3533
|
function createClassNameString(classNames) {
|
|
4556
3534
|
return classNames.join(" ");
|
|
4557
3535
|
}
|
|
4558
|
-
__name(createClassNameString, "createClassNameString");
|
|
4559
3536
|
function createChildren(stylesheet, useInlineStyles) {
|
|
4560
3537
|
var childrenCount = 0;
|
|
4561
3538
|
return function(children) {
|
|
4562
|
-
childrenCount += 1
|
|
4563
|
-
return children.map(function(child, i) {
|
|
3539
|
+
return childrenCount += 1, children.map(function(child, i) {
|
|
4564
3540
|
return createElement({
|
|
4565
3541
|
node: child,
|
|
4566
3542
|
stylesheet,
|
|
@@ -4570,28 +3546,22 @@ function createChildren(stylesheet, useInlineStyles) {
|
|
|
4570
3546
|
});
|
|
4571
3547
|
};
|
|
4572
3548
|
}
|
|
4573
|
-
__name(createChildren, "createChildren");
|
|
4574
3549
|
function createElement(_ref) {
|
|
4575
|
-
var node = _ref.node, stylesheet = _ref.stylesheet, _ref$style = _ref.style, style = _ref$style === void 0 ? {} : _ref$style, useInlineStyles = _ref.useInlineStyles, key = _ref.key;
|
|
4576
|
-
|
|
4577
|
-
if (type === "text") {
|
|
3550
|
+
var node = _ref.node, stylesheet = _ref.stylesheet, _ref$style = _ref.style, style = _ref$style === void 0 ? {} : _ref$style, useInlineStyles = _ref.useInlineStyles, key = _ref.key, properties = node.properties, type = node.type, TagName = node.tagName, value = node.value;
|
|
3551
|
+
if (type === "text")
|
|
4578
3552
|
return value;
|
|
4579
|
-
|
|
4580
|
-
var childrenCreator = createChildren(stylesheet, useInlineStyles);
|
|
4581
|
-
|
|
4582
|
-
if (!useInlineStyles) {
|
|
3553
|
+
if (TagName) {
|
|
3554
|
+
var childrenCreator = createChildren(stylesheet, useInlineStyles), props;
|
|
3555
|
+
if (!useInlineStyles)
|
|
4583
3556
|
props = _objectSpread(_objectSpread({}, properties), {}, {
|
|
4584
3557
|
className: createClassNameString(properties.className)
|
|
4585
3558
|
});
|
|
4586
|
-
|
|
3559
|
+
else {
|
|
4587
3560
|
var allStylesheetSelectors = Object.keys(stylesheet).reduce(function(classes, selector) {
|
|
4588
|
-
selector.split(".").forEach(function(className2) {
|
|
4589
|
-
|
|
4590
|
-
});
|
|
4591
|
-
|
|
4592
|
-
}, []);
|
|
4593
|
-
var startingClassName = properties.className && properties.className.includes("token") ? ["token"] : [];
|
|
4594
|
-
var className = properties.className && startingClassName.concat(properties.className.filter(function(className2) {
|
|
3561
|
+
return selector.split(".").forEach(function(className2) {
|
|
3562
|
+
classes.includes(className2) || classes.push(className2);
|
|
3563
|
+
}), classes;
|
|
3564
|
+
}, []), startingClassName = properties.className && properties.className.includes("token") ? ["token"] : [], className = properties.className && startingClassName.concat(properties.className.filter(function(className2) {
|
|
4595
3565
|
return !allStylesheetSelectors.includes(className2);
|
|
4596
3566
|
}));
|
|
4597
3567
|
props = _objectSpread(_objectSpread({}, properties), {}, {
|
|
@@ -4605,102 +3575,85 @@ function createElement(_ref) {
|
|
|
4605
3575
|
}, props), children);
|
|
4606
3576
|
}
|
|
4607
3577
|
}
|
|
4608
|
-
__name(createElement, "createElement");
|
|
4609
3578
|
|
|
4610
3579
|
// ../node_modules/react-syntax-highlighter/dist/esm/languages/prism/bash.js
|
|
4611
|
-
var import_bash = __toESM(require_bash());
|
|
4612
|
-
var bash_default = import_bash.default;
|
|
3580
|
+
var import_bash = __toESM(require_bash()), bash_default = import_bash.default;
|
|
4613
3581
|
|
|
4614
3582
|
// ../node_modules/react-syntax-highlighter/dist/esm/languages/prism/css.js
|
|
4615
|
-
var import_css = __toESM(require_css());
|
|
4616
|
-
var css_default = import_css.default;
|
|
3583
|
+
var import_css = __toESM(require_css()), css_default = import_css.default;
|
|
4617
3584
|
|
|
4618
3585
|
// ../node_modules/react-syntax-highlighter/dist/esm/languages/prism/graphql.js
|
|
4619
|
-
var import_graphql = __toESM(require_graphql());
|
|
4620
|
-
var graphql_default = import_graphql.default;
|
|
3586
|
+
var import_graphql = __toESM(require_graphql()), graphql_default = import_graphql.default;
|
|
4621
3587
|
|
|
4622
3588
|
// ../node_modules/react-syntax-highlighter/dist/esm/languages/prism/js-extras.js
|
|
4623
|
-
var import_js_extras = __toESM(require_js_extras());
|
|
4624
|
-
var js_extras_default = import_js_extras.default;
|
|
3589
|
+
var import_js_extras = __toESM(require_js_extras()), js_extras_default = import_js_extras.default;
|
|
4625
3590
|
|
|
4626
3591
|
// ../node_modules/react-syntax-highlighter/dist/esm/languages/prism/json.js
|
|
4627
|
-
var import_json = __toESM(require_json());
|
|
4628
|
-
var json_default = import_json.default;
|
|
3592
|
+
var import_json = __toESM(require_json()), json_default = import_json.default;
|
|
4629
3593
|
|
|
4630
3594
|
// ../node_modules/react-syntax-highlighter/dist/esm/languages/prism/jsx.js
|
|
4631
|
-
var import_jsx = __toESM(require_jsx());
|
|
4632
|
-
var jsx_default = import_jsx.default;
|
|
3595
|
+
var import_jsx = __toESM(require_jsx()), jsx_default = import_jsx.default;
|
|
4633
3596
|
|
|
4634
3597
|
// ../node_modules/react-syntax-highlighter/dist/esm/languages/prism/markdown.js
|
|
4635
|
-
var import_markdown = __toESM(require_markdown());
|
|
4636
|
-
var markdown_default = import_markdown.default;
|
|
3598
|
+
var import_markdown = __toESM(require_markdown()), markdown_default = import_markdown.default;
|
|
4637
3599
|
|
|
4638
3600
|
// ../node_modules/react-syntax-highlighter/dist/esm/languages/prism/markup.js
|
|
4639
|
-
var import_markup = __toESM(require_markup());
|
|
4640
|
-
var markup_default = import_markup.default;
|
|
3601
|
+
var import_markup = __toESM(require_markup()), markup_default = import_markup.default;
|
|
4641
3602
|
|
|
4642
3603
|
// ../node_modules/react-syntax-highlighter/dist/esm/languages/prism/tsx.js
|
|
4643
|
-
var import_tsx = __toESM(require_tsx());
|
|
4644
|
-
var tsx_default = import_tsx.default;
|
|
3604
|
+
var import_tsx = __toESM(require_tsx()), tsx_default = import_tsx.default;
|
|
4645
3605
|
|
|
4646
3606
|
// ../node_modules/react-syntax-highlighter/dist/esm/languages/prism/typescript.js
|
|
4647
|
-
var import_typescript = __toESM(require_typescript());
|
|
4648
|
-
var typescript_default = import_typescript.default;
|
|
3607
|
+
var import_typescript = __toESM(require_typescript()), typescript_default = import_typescript.default;
|
|
4649
3608
|
|
|
4650
3609
|
// ../node_modules/react-syntax-highlighter/dist/esm/languages/prism/yaml.js
|
|
4651
|
-
var import_yaml = __toESM(require_yaml());
|
|
4652
|
-
var yaml_default = import_yaml.default;
|
|
3610
|
+
var import_yaml = __toESM(require_yaml()), yaml_default = import_yaml.default;
|
|
4653
3611
|
|
|
4654
3612
|
// ../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
|
4655
3613
|
function _arrayLikeToArray(r, a) {
|
|
4656
|
-
(
|
|
3614
|
+
(a == null || a > r.length) && (a = r.length);
|
|
4657
3615
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
4658
3616
|
return n;
|
|
4659
3617
|
}
|
|
4660
|
-
__name(_arrayLikeToArray, "_arrayLikeToArray");
|
|
4661
3618
|
|
|
4662
3619
|
// ../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
|
4663
3620
|
function _arrayWithoutHoles(r) {
|
|
4664
3621
|
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
4665
3622
|
}
|
|
4666
|
-
__name(_arrayWithoutHoles, "_arrayWithoutHoles");
|
|
4667
3623
|
|
|
4668
3624
|
// ../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
|
4669
3625
|
function _iterableToArray(r) {
|
|
4670
|
-
if (
|
|
3626
|
+
if (typeof Symbol < "u" && r[Symbol.iterator] != null || r["@@iterator"] != null) return Array.from(r);
|
|
4671
3627
|
}
|
|
4672
|
-
__name(_iterableToArray, "_iterableToArray");
|
|
4673
3628
|
|
|
4674
3629
|
// ../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
|
4675
3630
|
function _unsupportedIterableToArray(r, a) {
|
|
4676
3631
|
if (r) {
|
|
4677
|
-
if ("string"
|
|
3632
|
+
if (typeof r == "string") return _arrayLikeToArray(r, a);
|
|
4678
3633
|
var t = {}.toString.call(r).slice(8, -1);
|
|
4679
|
-
return "Object"
|
|
3634
|
+
return t === "Object" && r.constructor && (t = r.constructor.name), t === "Map" || t === "Set" ? Array.from(r) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
4680
3635
|
}
|
|
4681
3636
|
}
|
|
4682
|
-
__name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
|
|
4683
3637
|
|
|
4684
3638
|
// ../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
|
4685
3639
|
function _nonIterableSpread() {
|
|
4686
|
-
throw new TypeError(
|
|
3640
|
+
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
3641
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
4687
3642
|
}
|
|
4688
|
-
__name(_nonIterableSpread, "_nonIterableSpread");
|
|
4689
3643
|
|
|
4690
3644
|
// ../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
|
4691
3645
|
function _toConsumableArray(r) {
|
|
4692
3646
|
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
4693
3647
|
}
|
|
4694
|
-
__name(_toConsumableArray, "_toConsumableArray");
|
|
4695
3648
|
|
|
4696
3649
|
// ../node_modules/react-syntax-highlighter/dist/esm/highlight.js
|
|
4697
3650
|
import React2 from "react";
|
|
4698
3651
|
|
|
4699
3652
|
// ../node_modules/react-syntax-highlighter/dist/esm/checkForListedLanguage.js
|
|
4700
|
-
var checkForListedLanguage_default =
|
|
3653
|
+
var checkForListedLanguage_default = (function(astGenerator, language) {
|
|
4701
3654
|
var langs = astGenerator.listLanguages();
|
|
4702
3655
|
return langs.indexOf(language) !== -1;
|
|
4703
|
-
}
|
|
3656
|
+
});
|
|
4704
3657
|
|
|
4705
3658
|
// ../node_modules/react-syntax-highlighter/dist/esm/highlight.js
|
|
4706
3659
|
var _excluded = ["language", "children", "style", "customStyle", "codeTagProps", "useInlineStyles", "showLineNumbers", "showInlineLineNumbers", "startingLineNumber", "lineNumberContainerStyle", "lineNumberStyle", "wrapLines", "wrapLongLines", "lineProps", "renderer", "PreTag", "CodeTag", "code", "astGenerator"];
|
|
@@ -4714,11 +3667,10 @@ function ownKeys2(e, r) {
|
|
|
4714
3667
|
}
|
|
4715
3668
|
return t;
|
|
4716
3669
|
}
|
|
4717
|
-
__name(ownKeys2, "ownKeys");
|
|
4718
3670
|
function _objectSpread2(e) {
|
|
4719
3671
|
for (var r = 1; r < arguments.length; r++) {
|
|
4720
|
-
var t =
|
|
4721
|
-
r % 2 ? ownKeys2(Object(t),
|
|
3672
|
+
var t = arguments[r] != null ? arguments[r] : {};
|
|
3673
|
+
r % 2 ? ownKeys2(Object(t), !0).forEach(function(r2) {
|
|
4722
3674
|
_defineProperty(e, r2, t[r2]);
|
|
4723
3675
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys2(Object(t)).forEach(function(r2) {
|
|
4724
3676
|
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
@@ -4726,12 +3678,10 @@ function _objectSpread2(e) {
|
|
|
4726
3678
|
}
|
|
4727
3679
|
return e;
|
|
4728
3680
|
}
|
|
4729
|
-
__name(_objectSpread2, "_objectSpread");
|
|
4730
3681
|
var newLineRegex = /\n/g;
|
|
4731
3682
|
function getNewLines(str) {
|
|
4732
3683
|
return str.match(newLineRegex);
|
|
4733
3684
|
}
|
|
4734
|
-
__name(getNewLines, "getNewLines");
|
|
4735
3685
|
function getAllLineNumbers(_ref) {
|
|
4736
3686
|
var lines = _ref.lines, startingLineNumber = _ref.startingLineNumber, style = _ref.style;
|
|
4737
3687
|
return lines.map(function(_, i) {
|
|
@@ -4739,29 +3689,28 @@ function getAllLineNumbers(_ref) {
|
|
|
4739
3689
|
return React2.createElement("span", {
|
|
4740
3690
|
key: "line-".concat(i),
|
|
4741
3691
|
className: "react-syntax-highlighter-line-number",
|
|
4742
|
-
style: typeof style
|
|
4743
|
-
}, "".concat(number,
|
|
3692
|
+
style: typeof style == "function" ? style(number) : style
|
|
3693
|
+
}, "".concat(number, `
|
|
3694
|
+
`));
|
|
4744
3695
|
});
|
|
4745
3696
|
}
|
|
4746
|
-
__name(getAllLineNumbers, "getAllLineNumbers");
|
|
4747
3697
|
function AllLineNumbers(_ref2) {
|
|
4748
3698
|
var codeString = _ref2.codeString, codeStyle = _ref2.codeStyle, _ref2$containerStyle = _ref2.containerStyle, containerStyle = _ref2$containerStyle === void 0 ? {
|
|
4749
|
-
|
|
3699
|
+
float: "left",
|
|
4750
3700
|
paddingRight: "10px"
|
|
4751
3701
|
} : _ref2$containerStyle, _ref2$numberStyle = _ref2.numberStyle, numberStyle = _ref2$numberStyle === void 0 ? {} : _ref2$numberStyle, startingLineNumber = _ref2.startingLineNumber;
|
|
4752
3702
|
return React2.createElement("code", {
|
|
4753
3703
|
style: Object.assign({}, codeStyle, containerStyle)
|
|
4754
3704
|
}, getAllLineNumbers({
|
|
4755
|
-
lines: codeString.replace(/\n$/, "").split(
|
|
3705
|
+
lines: codeString.replace(/\n$/, "").split(`
|
|
3706
|
+
`),
|
|
4756
3707
|
style: numberStyle,
|
|
4757
3708
|
startingLineNumber
|
|
4758
3709
|
}));
|
|
4759
3710
|
}
|
|
4760
|
-
__name(AllLineNumbers, "AllLineNumbers");
|
|
4761
3711
|
function getEmWidthOfNumber(num) {
|
|
4762
3712
|
return "".concat(num.toString().length, ".25em");
|
|
4763
3713
|
}
|
|
4764
|
-
__name(getEmWidthOfNumber, "getEmWidthOfNumber");
|
|
4765
3714
|
function getInlineLineNumber(lineNumber, inlineLineNumberStyle) {
|
|
4766
3715
|
return {
|
|
4767
3716
|
type: "element",
|
|
@@ -4777,7 +3726,6 @@ function getInlineLineNumber(lineNumber, inlineLineNumberStyle) {
|
|
|
4777
3726
|
}]
|
|
4778
3727
|
};
|
|
4779
3728
|
}
|
|
4780
|
-
__name(getInlineLineNumber, "getInlineLineNumber");
|
|
4781
3729
|
function assembleLineNumberStyles(lineNumberStyle, lineNumber, largestLineNumber) {
|
|
4782
3730
|
var defaultLineNumberStyle = {
|
|
4783
3731
|
display: "inline-block",
|
|
@@ -4785,44 +3733,33 @@ function assembleLineNumberStyles(lineNumberStyle, lineNumber, largestLineNumber
|
|
|
4785
3733
|
paddingRight: "1em",
|
|
4786
3734
|
textAlign: "right",
|
|
4787
3735
|
userSelect: "none"
|
|
4788
|
-
};
|
|
4789
|
-
var customLineNumberStyle = typeof lineNumberStyle === "function" ? lineNumberStyle(lineNumber) : lineNumberStyle;
|
|
4790
|
-
var assembledStyle = _objectSpread2(_objectSpread2({}, defaultLineNumberStyle), customLineNumberStyle);
|
|
3736
|
+
}, customLineNumberStyle = typeof lineNumberStyle == "function" ? lineNumberStyle(lineNumber) : lineNumberStyle, assembledStyle = _objectSpread2(_objectSpread2({}, defaultLineNumberStyle), customLineNumberStyle);
|
|
4791
3737
|
return assembledStyle;
|
|
4792
3738
|
}
|
|
4793
|
-
__name(assembleLineNumberStyles, "assembleLineNumberStyles");
|
|
4794
3739
|
function createLineElement(_ref3) {
|
|
4795
|
-
var children = _ref3.children, lineNumber = _ref3.lineNumber, lineNumberStyle = _ref3.lineNumberStyle, largestLineNumber = _ref3.largestLineNumber, showInlineLineNumbers = _ref3.showInlineLineNumbers, _ref3$lineProps = _ref3.lineProps, lineProps = _ref3$lineProps === void 0 ? {} : _ref3$lineProps, _ref3$className = _ref3.className, className = _ref3$className === void 0 ? [] : _ref3$className, showLineNumbers = _ref3.showLineNumbers, wrapLongLines = _ref3.wrapLongLines, _ref3$wrapLines = _ref3.wrapLines, wrapLines = _ref3$wrapLines === void 0 ?
|
|
4796
|
-
|
|
4797
|
-
properties["className"] = properties["className"] ? [].concat(_toConsumableArray(properties["className"].trim().split(/\s+/)), _toConsumableArray(className)) : className;
|
|
4798
|
-
if (lineNumber && showInlineLineNumbers) {
|
|
3740
|
+
var children = _ref3.children, lineNumber = _ref3.lineNumber, lineNumberStyle = _ref3.lineNumberStyle, largestLineNumber = _ref3.largestLineNumber, showInlineLineNumbers = _ref3.showInlineLineNumbers, _ref3$lineProps = _ref3.lineProps, lineProps = _ref3$lineProps === void 0 ? {} : _ref3$lineProps, _ref3$className = _ref3.className, className = _ref3$className === void 0 ? [] : _ref3$className, showLineNumbers = _ref3.showLineNumbers, wrapLongLines = _ref3.wrapLongLines, _ref3$wrapLines = _ref3.wrapLines, wrapLines = _ref3$wrapLines === void 0 ? !1 : _ref3$wrapLines, properties = wrapLines ? _objectSpread2({}, typeof lineProps == "function" ? lineProps(lineNumber) : lineProps) : {};
|
|
3741
|
+
if (properties.className = properties.className ? [].concat(_toConsumableArray(properties.className.trim().split(/\s+/)), _toConsumableArray(className)) : className, lineNumber && showInlineLineNumbers) {
|
|
4799
3742
|
var inlineLineNumberStyle = assembleLineNumberStyles(lineNumberStyle, lineNumber, largestLineNumber);
|
|
4800
3743
|
children.unshift(getInlineLineNumber(lineNumber, inlineLineNumberStyle));
|
|
4801
3744
|
}
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
}, properties.style);
|
|
4806
|
-
}
|
|
4807
|
-
return {
|
|
3745
|
+
return wrapLongLines & showLineNumbers && (properties.style = _objectSpread2({
|
|
3746
|
+
display: "flex"
|
|
3747
|
+
}, properties.style)), {
|
|
4808
3748
|
type: "element",
|
|
4809
3749
|
tagName: "span",
|
|
4810
3750
|
properties,
|
|
4811
3751
|
children
|
|
4812
3752
|
};
|
|
4813
3753
|
}
|
|
4814
|
-
__name(createLineElement, "createLineElement");
|
|
4815
3754
|
function flattenCodeTree(tree) {
|
|
4816
|
-
var className = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
|
4817
|
-
var newTree = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
4818
|
-
for (var i = 0; i < tree.length; i++) {
|
|
3755
|
+
for (var className = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], newTree = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [], i = 0; i < tree.length; i++) {
|
|
4819
3756
|
var node = tree[i];
|
|
4820
|
-
if (node.type === "text")
|
|
3757
|
+
if (node.type === "text")
|
|
4821
3758
|
newTree.push(createLineElement({
|
|
4822
3759
|
children: [node],
|
|
4823
3760
|
className: _toConsumableArray(new Set(className))
|
|
4824
3761
|
}));
|
|
4825
|
-
|
|
3762
|
+
else if (node.children) {
|
|
4826
3763
|
var classNames = className.concat(node.properties.className);
|
|
4827
3764
|
flattenCodeTree(node.children, classNames).forEach(function(i2) {
|
|
4828
3765
|
return newTree.push(i2);
|
|
@@ -4831,13 +3768,8 @@ function flattenCodeTree(tree) {
|
|
|
4831
3768
|
}
|
|
4832
3769
|
return newTree;
|
|
4833
3770
|
}
|
|
4834
|
-
__name(flattenCodeTree, "flattenCodeTree");
|
|
4835
3771
|
function processLines(codeTree, wrapLines, lineProps, showLineNumbers, showInlineLineNumbers, startingLineNumber, largestLineNumber, lineNumberStyle, wrapLongLines) {
|
|
4836
|
-
var _ref4;
|
|
4837
|
-
var tree = flattenCodeTree(codeTree.value);
|
|
4838
|
-
var newTree = [];
|
|
4839
|
-
var lastLineBreakIndex = -1;
|
|
4840
|
-
var index = 0;
|
|
3772
|
+
var _ref4, tree = flattenCodeTree(codeTree.value), newTree = [], lastLineBreakIndex = -1, index = 0;
|
|
4841
3773
|
function createWrappedLine(children2, lineNumber2) {
|
|
4842
3774
|
var className = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
4843
3775
|
return createLineElement({
|
|
@@ -4853,7 +3785,6 @@ function processLines(codeTree, wrapLines, lineProps, showLineNumbers, showInlin
|
|
|
4853
3785
|
wrapLines
|
|
4854
3786
|
});
|
|
4855
3787
|
}
|
|
4856
|
-
__name(createWrappedLine, "createWrappedLine");
|
|
4857
3788
|
function createUnwrappedLine(children2, lineNumber2) {
|
|
4858
3789
|
if (showLineNumbers && lineNumber2 && showInlineLineNumbers) {
|
|
4859
3790
|
var inlineLineNumberStyle = assembleLineNumberStyles(lineNumberStyle, lineNumber2, largestLineNumber);
|
|
@@ -4861,34 +3792,29 @@ function processLines(codeTree, wrapLines, lineProps, showLineNumbers, showInlin
|
|
|
4861
3792
|
}
|
|
4862
3793
|
return children2;
|
|
4863
3794
|
}
|
|
4864
|
-
__name(createUnwrappedLine, "createUnwrappedLine");
|
|
4865
3795
|
function createLine(children2, lineNumber2) {
|
|
4866
3796
|
var className = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
4867
3797
|
return wrapLines || className.length > 0 ? createWrappedLine(children2, lineNumber2, className) : createUnwrappedLine(children2, lineNumber2);
|
|
4868
3798
|
}
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
var node = tree[index];
|
|
4872
|
-
var value = node.children[0].value;
|
|
4873
|
-
var newLines = getNewLines(value);
|
|
3799
|
+
for (var _loop = function() {
|
|
3800
|
+
var node = tree[index], value = node.children[0].value, newLines = getNewLines(value);
|
|
4874
3801
|
if (newLines) {
|
|
4875
|
-
var splitValue = value.split(
|
|
3802
|
+
var splitValue = value.split(`
|
|
3803
|
+
`);
|
|
4876
3804
|
splitValue.forEach(function(text, i) {
|
|
4877
|
-
var lineNumber2 = showLineNumbers && newTree.length + startingLineNumber
|
|
4878
|
-
var newChild = {
|
|
3805
|
+
var lineNumber2 = showLineNumbers && newTree.length + startingLineNumber, newChild = {
|
|
4879
3806
|
type: "text",
|
|
4880
|
-
value: "".concat(text,
|
|
3807
|
+
value: "".concat(text, `
|
|
3808
|
+
`)
|
|
4881
3809
|
};
|
|
4882
3810
|
if (i === 0) {
|
|
4883
3811
|
var _children = tree.slice(lastLineBreakIndex + 1, index).concat(createLineElement({
|
|
4884
3812
|
children: [newChild],
|
|
4885
3813
|
className: node.properties.className
|
|
4886
|
-
}));
|
|
4887
|
-
var _line = createLine(_children, lineNumber2);
|
|
3814
|
+
})), _line = createLine(_children, lineNumber2);
|
|
4888
3815
|
newTree.push(_line);
|
|
4889
3816
|
} else if (i === splitValue.length - 1) {
|
|
4890
|
-
var stringChild = tree[index + 1] && tree[index + 1].children && tree[index + 1].children[0]
|
|
4891
|
-
var lastLineInPreviousSpan = {
|
|
3817
|
+
var stringChild = tree[index + 1] && tree[index + 1].children && tree[index + 1].children[0], lastLineInPreviousSpan = {
|
|
4892
3818
|
type: "text",
|
|
4893
3819
|
value: "".concat(text)
|
|
4894
3820
|
};
|
|
@@ -4899,34 +3825,27 @@ function processLines(codeTree, wrapLines, lineProps, showLineNumbers, showInlin
|
|
|
4899
3825
|
});
|
|
4900
3826
|
tree.splice(index + 1, 0, newElem);
|
|
4901
3827
|
} else {
|
|
4902
|
-
var _children2 = [lastLineInPreviousSpan];
|
|
4903
|
-
var _line2 = createLine(_children2, lineNumber2, node.properties.className);
|
|
3828
|
+
var _children2 = [lastLineInPreviousSpan], _line2 = createLine(_children2, lineNumber2, node.properties.className);
|
|
4904
3829
|
newTree.push(_line2);
|
|
4905
3830
|
}
|
|
4906
3831
|
} else {
|
|
4907
|
-
var _children3 = [newChild];
|
|
4908
|
-
var _line3 = createLine(_children3, lineNumber2, node.properties.className);
|
|
3832
|
+
var _children3 = [newChild], _line3 = createLine(_children3, lineNumber2, node.properties.className);
|
|
4909
3833
|
newTree.push(_line3);
|
|
4910
3834
|
}
|
|
4911
|
-
});
|
|
4912
|
-
lastLineBreakIndex = index;
|
|
3835
|
+
}), lastLineBreakIndex = index;
|
|
4913
3836
|
}
|
|
4914
3837
|
index++;
|
|
4915
|
-
}
|
|
4916
|
-
while (index < tree.length) {
|
|
3838
|
+
}; index < tree.length; )
|
|
4917
3839
|
_loop();
|
|
4918
|
-
}
|
|
4919
3840
|
if (lastLineBreakIndex !== tree.length - 1) {
|
|
4920
3841
|
var children = tree.slice(lastLineBreakIndex + 1, tree.length);
|
|
4921
3842
|
if (children && children.length) {
|
|
4922
|
-
var lineNumber = showLineNumbers && newTree.length + startingLineNumber;
|
|
4923
|
-
var line = createLine(children, lineNumber);
|
|
3843
|
+
var lineNumber = showLineNumbers && newTree.length + startingLineNumber, line = createLine(children, lineNumber);
|
|
4924
3844
|
newTree.push(line);
|
|
4925
3845
|
}
|
|
4926
3846
|
}
|
|
4927
3847
|
return wrapLines ? newTree : (_ref4 = []).concat.apply(_ref4, newTree);
|
|
4928
3848
|
}
|
|
4929
|
-
__name(processLines, "processLines");
|
|
4930
3849
|
function defaultRenderer(_ref5) {
|
|
4931
3850
|
var rows = _ref5.rows, stylesheet = _ref5.stylesheet, useInlineStyles = _ref5.useInlineStyles;
|
|
4932
3851
|
return rows.map(function(node, i) {
|
|
@@ -4938,25 +3857,17 @@ function defaultRenderer(_ref5) {
|
|
|
4938
3857
|
});
|
|
4939
3858
|
});
|
|
4940
3859
|
}
|
|
4941
|
-
__name(defaultRenderer, "defaultRenderer");
|
|
4942
3860
|
function isHighlightJs(astGenerator) {
|
|
4943
|
-
return astGenerator && typeof astGenerator.highlightAuto
|
|
3861
|
+
return astGenerator && typeof astGenerator.highlightAuto < "u";
|
|
4944
3862
|
}
|
|
4945
|
-
__name(isHighlightJs, "isHighlightJs");
|
|
4946
3863
|
function getCodeTree(_ref6) {
|
|
4947
3864
|
var astGenerator = _ref6.astGenerator, language = _ref6.language, code = _ref6.code, defaultCodeValue = _ref6.defaultCodeValue;
|
|
4948
3865
|
if (isHighlightJs(astGenerator)) {
|
|
4949
3866
|
var hasLanguage = checkForListedLanguage_default(astGenerator, language);
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
};
|
|
4955
|
-
} else if (hasLanguage) {
|
|
4956
|
-
return astGenerator.highlight(language, code);
|
|
4957
|
-
} else {
|
|
4958
|
-
return astGenerator.highlightAuto(code);
|
|
4959
|
-
}
|
|
3867
|
+
return language === "text" ? {
|
|
3868
|
+
value: defaultCodeValue,
|
|
3869
|
+
language: "text"
|
|
3870
|
+
} : hasLanguage ? astGenerator.highlight(language, code) : astGenerator.highlightAuto(code);
|
|
4960
3871
|
}
|
|
4961
3872
|
try {
|
|
4962
3873
|
return language && language !== "text" ? {
|
|
@@ -4964,20 +3875,18 @@ function getCodeTree(_ref6) {
|
|
|
4964
3875
|
} : {
|
|
4965
3876
|
value: defaultCodeValue
|
|
4966
3877
|
};
|
|
4967
|
-
} catch
|
|
3878
|
+
} catch {
|
|
4968
3879
|
return {
|
|
4969
3880
|
value: defaultCodeValue
|
|
4970
3881
|
};
|
|
4971
3882
|
}
|
|
4972
3883
|
}
|
|
4973
|
-
__name(getCodeTree, "getCodeTree");
|
|
4974
3884
|
function highlight_default(defaultAstGenerator, defaultStyle) {
|
|
4975
|
-
return
|
|
4976
|
-
var _code$match$length, _code$match
|
|
4977
|
-
var language = _ref7.language, children = _ref7.children, _ref7$style = _ref7.style, style = _ref7$style === void 0 ? defaultStyle : _ref7$style, _ref7$customStyle = _ref7.customStyle, customStyle = _ref7$customStyle === void 0 ? {} : _ref7$customStyle, _ref7$codeTagProps = _ref7.codeTagProps, codeTagProps = _ref7$codeTagProps === void 0 ? {
|
|
3885
|
+
return function(_ref7) {
|
|
3886
|
+
var _code$match$length, _code$match, language = _ref7.language, children = _ref7.children, _ref7$style = _ref7.style, style = _ref7$style === void 0 ? defaultStyle : _ref7$style, _ref7$customStyle = _ref7.customStyle, customStyle = _ref7$customStyle === void 0 ? {} : _ref7$customStyle, _ref7$codeTagProps = _ref7.codeTagProps, codeTagProps = _ref7$codeTagProps === void 0 ? {
|
|
4978
3887
|
className: language ? "language-".concat(language) : void 0,
|
|
4979
3888
|
style: _objectSpread2(_objectSpread2({}, style['code[class*="language-"]']), style['code[class*="language-'.concat(language, '"]')])
|
|
4980
|
-
} : _ref7$codeTagProps, _ref7$useInlineStyles = _ref7.useInlineStyles, useInlineStyles = _ref7$useInlineStyles === void 0 ?
|
|
3889
|
+
} : _ref7$codeTagProps, _ref7$useInlineStyles = _ref7.useInlineStyles, useInlineStyles = _ref7$useInlineStyles === void 0 ? !0 : _ref7$useInlineStyles, _ref7$showLineNumbers = _ref7.showLineNumbers, showLineNumbers = _ref7$showLineNumbers === void 0 ? !1 : _ref7$showLineNumbers, _ref7$showInlineLineN = _ref7.showInlineLineNumbers, showInlineLineNumbers = _ref7$showInlineLineN === void 0 ? !0 : _ref7$showInlineLineN, _ref7$startingLineNum = _ref7.startingLineNumber, startingLineNumber = _ref7$startingLineNum === void 0 ? 1 : _ref7$startingLineNum, lineNumberContainerStyle = _ref7.lineNumberContainerStyle, _ref7$lineNumberStyle = _ref7.lineNumberStyle, lineNumberStyle = _ref7$lineNumberStyle === void 0 ? {} : _ref7$lineNumberStyle, wrapLines = _ref7.wrapLines, _ref7$wrapLongLines = _ref7.wrapLongLines, wrapLongLines = _ref7$wrapLongLines === void 0 ? !1 : _ref7$wrapLongLines, _ref7$lineProps = _ref7.lineProps, lineProps = _ref7$lineProps === void 0 ? {} : _ref7$lineProps, renderer = _ref7.renderer, _ref7$PreTag = _ref7.PreTag, PreTag = _ref7$PreTag === void 0 ? "pre" : _ref7$PreTag, _ref7$CodeTag = _ref7.CodeTag, CodeTag = _ref7$CodeTag === void 0 ? "code" : _ref7$CodeTag, _ref7$code = _ref7.code, code = _ref7$code === void 0 ? (Array.isArray(children) ? children[0] : children) || "" : _ref7$code, astGenerator = _ref7.astGenerator, rest = _objectWithoutProperties(_ref7, _excluded);
|
|
4981
3890
|
astGenerator = astGenerator || defaultAstGenerator;
|
|
4982
3891
|
var allLineNumbers = showLineNumbers ? React2.createElement(AllLineNumbers, {
|
|
4983
3892
|
containerStyle: lineNumberContainerStyle,
|
|
@@ -4985,59 +3894,42 @@ function highlight_default(defaultAstGenerator, defaultStyle) {
|
|
|
4985
3894
|
numberStyle: lineNumberStyle,
|
|
4986
3895
|
startingLineNumber,
|
|
4987
3896
|
codeString: code
|
|
4988
|
-
}) : null
|
|
4989
|
-
var defaultPreStyle = style.hljs || style['pre[class*="language-"]'] || {
|
|
3897
|
+
}) : null, defaultPreStyle = style.hljs || style['pre[class*="language-"]'] || {
|
|
4990
3898
|
backgroundColor: "#fff"
|
|
4991
|
-
}
|
|
4992
|
-
var generatorClassName = isHighlightJs(astGenerator) ? "hljs" : "prismjs";
|
|
4993
|
-
var preProps = useInlineStyles ? Object.assign({}, rest, {
|
|
3899
|
+
}, generatorClassName = isHighlightJs(astGenerator) ? "hljs" : "prismjs", preProps = useInlineStyles ? Object.assign({}, rest, {
|
|
4994
3900
|
style: Object.assign({}, defaultPreStyle, customStyle)
|
|
4995
3901
|
}) : Object.assign({}, rest, {
|
|
4996
3902
|
className: rest.className ? "".concat(generatorClassName, " ").concat(rest.className) : generatorClassName,
|
|
4997
3903
|
style: Object.assign({}, customStyle)
|
|
4998
3904
|
});
|
|
4999
|
-
if (wrapLongLines
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
}
|
|
5004
|
-
codeTagProps.style = _objectSpread2({
|
|
5005
|
-
whiteSpace: "pre"
|
|
5006
|
-
}, codeTagProps.style);
|
|
5007
|
-
}
|
|
5008
|
-
if (!astGenerator) {
|
|
3905
|
+
if (wrapLongLines ? codeTagProps.style = _objectSpread2({
|
|
3906
|
+
whiteSpace: "pre-wrap"
|
|
3907
|
+
}, codeTagProps.style) : codeTagProps.style = _objectSpread2({
|
|
3908
|
+
whiteSpace: "pre"
|
|
3909
|
+
}, codeTagProps.style), !astGenerator)
|
|
5009
3910
|
return React2.createElement(PreTag, preProps, allLineNumbers, React2.createElement(CodeTag, codeTagProps, code));
|
|
5010
|
-
|
|
5011
|
-
if (wrapLines === void 0 && renderer || wrapLongLines) wrapLines = true;
|
|
5012
|
-
renderer = renderer || defaultRenderer;
|
|
3911
|
+
(wrapLines === void 0 && renderer || wrapLongLines) && (wrapLines = !0), renderer = renderer || defaultRenderer;
|
|
5013
3912
|
var defaultCodeValue = [{
|
|
5014
3913
|
type: "text",
|
|
5015
3914
|
value: code
|
|
5016
|
-
}]
|
|
5017
|
-
var codeTree = getCodeTree({
|
|
3915
|
+
}], codeTree = getCodeTree({
|
|
5018
3916
|
astGenerator,
|
|
5019
3917
|
language,
|
|
5020
3918
|
code,
|
|
5021
3919
|
defaultCodeValue
|
|
5022
3920
|
});
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
}
|
|
5026
|
-
var lineBreakCount = (_code$match$length = (_code$match = code.match(/\n/g)) === null || _code$match === void 0 ? void 0 : _code$match.length) !== null && _code$match$length !== void 0 ? _code$match$length : 0;
|
|
5027
|
-
var largestLineNumber = startingLineNumber + lineBreakCount;
|
|
5028
|
-
var rows = processLines(codeTree, wrapLines, lineProps, showLineNumbers, showInlineLineNumbers, startingLineNumber, largestLineNumber, lineNumberStyle, wrapLongLines);
|
|
3921
|
+
codeTree.language === null && (codeTree.value = defaultCodeValue);
|
|
3922
|
+
var lineBreakCount = (_code$match$length = (_code$match = code.match(/\n/g)) === null || _code$match === void 0 ? void 0 : _code$match.length) !== null && _code$match$length !== void 0 ? _code$match$length : 0, largestLineNumber = startingLineNumber + lineBreakCount, rows = processLines(codeTree, wrapLines, lineProps, showLineNumbers, showInlineLineNumbers, startingLineNumber, largestLineNumber, lineNumberStyle, wrapLongLines);
|
|
5029
3923
|
return React2.createElement(PreTag, preProps, React2.createElement(CodeTag, codeTagProps, !showInlineLineNumbers && allLineNumbers, renderer({
|
|
5030
3924
|
rows,
|
|
5031
3925
|
stylesheet: style,
|
|
5032
3926
|
useInlineStyles
|
|
5033
3927
|
})));
|
|
5034
|
-
}
|
|
3928
|
+
};
|
|
5035
3929
|
}
|
|
5036
|
-
__name(highlight_default, "default");
|
|
5037
3930
|
|
|
5038
3931
|
// ../node_modules/react-syntax-highlighter/dist/esm/prism-light.js
|
|
5039
|
-
var import_core = __toESM(require_core());
|
|
5040
|
-
var SyntaxHighlighter = highlight_default(import_core.default, {});
|
|
3932
|
+
var import_core = __toESM(require_core()), SyntaxHighlighter = highlight_default(import_core.default, {});
|
|
5041
3933
|
SyntaxHighlighter.registerLanguage = function(_, language) {
|
|
5042
3934
|
return import_core.default.register(language);
|
|
5043
3935
|
};
|
|
@@ -5048,8 +3940,7 @@ var prism_light_default = SyntaxHighlighter;
|
|
|
5048
3940
|
|
|
5049
3941
|
// src/components/components/syntaxhighlighter/syntaxhighlighter.tsx
|
|
5050
3942
|
import { styled } from "storybook/theming";
|
|
5051
|
-
var { window: globalWindow } = global2
|
|
5052
|
-
var supportedLanguages = {
|
|
3943
|
+
var { window: globalWindow } = global2, supportedLanguages = {
|
|
5053
3944
|
jsextra: js_extras_default,
|
|
5054
3945
|
jsx: jsx_default,
|
|
5055
3946
|
json: json_default,
|
|
@@ -5067,9 +3958,7 @@ Object.entries(supportedLanguages).forEach(([key, val]) => {
|
|
|
5067
3958
|
});
|
|
5068
3959
|
var themedSyntax = (0, import_memoizerific.default)(2)(
|
|
5069
3960
|
(theme) => Object.entries(theme.code || {}).reduce((acc, [key, val]) => ({ ...acc, [`* .${key}`]: val }), {})
|
|
5070
|
-
)
|
|
5071
|
-
var copyToClipboard = createCopyToClipboardFunction();
|
|
5072
|
-
var Wrapper = styled.div(
|
|
3961
|
+
), copyToClipboard = createCopyToClipboardFunction(), Wrapper = styled.div(
|
|
5073
3962
|
({ theme }) => ({
|
|
5074
3963
|
position: "relative",
|
|
5075
3964
|
overflow: "hidden",
|
|
@@ -5086,33 +3975,25 @@ var Wrapper = styled.div(
|
|
|
5086
3975
|
content: "attr(data-line-number)"
|
|
5087
3976
|
}
|
|
5088
3977
|
} : {}
|
|
5089
|
-
)
|
|
5090
|
-
var UnstyledScroller = /* @__PURE__ */ __name(({ children, className }) => React3.createElement(ScrollArea, { horizontal: true, vertical: true, className }, children), "UnstyledScroller");
|
|
5091
|
-
var Scroller = styled(UnstyledScroller)(
|
|
3978
|
+
), UnstyledScroller = ({ children, className }) => React3.createElement(ScrollArea, { horizontal: !0, vertical: !0, className }, children), Scroller = styled(UnstyledScroller)(
|
|
5092
3979
|
{
|
|
5093
3980
|
position: "relative"
|
|
5094
3981
|
},
|
|
5095
3982
|
({ theme }) => themedSyntax(theme)
|
|
5096
|
-
)
|
|
5097
|
-
var Pre = styled.pre(({ theme, padded }) => ({
|
|
3983
|
+
), Pre = styled.pre(({ theme, padded }) => ({
|
|
5098
3984
|
display: "flex",
|
|
5099
3985
|
justifyContent: "flex-start",
|
|
5100
3986
|
margin: 0,
|
|
5101
3987
|
padding: padded ? theme.layoutMargin : 0
|
|
5102
|
-
}))
|
|
5103
|
-
var Code = styled.div(({ theme }) => ({
|
|
3988
|
+
})), Code = styled.div(({ theme }) => ({
|
|
5104
3989
|
flex: 1,
|
|
5105
3990
|
paddingLeft: 2,
|
|
5106
3991
|
// TODO: To match theming/global.ts for now
|
|
5107
3992
|
paddingRight: theme.layoutMargin,
|
|
5108
3993
|
opacity: 1,
|
|
5109
3994
|
fontFamily: theme.typography.fonts.mono
|
|
5110
|
-
}))
|
|
5111
|
-
|
|
5112
|
-
const children = [...row.children];
|
|
5113
|
-
const lineNumberNode = children[0];
|
|
5114
|
-
const lineNumber = lineNumberNode.children[0].value;
|
|
5115
|
-
const processedLineNumberNode = {
|
|
3995
|
+
})), processLineNumber = (row) => {
|
|
3996
|
+
let children = [...row.children], lineNumberNode = children[0], lineNumber = lineNumberNode.children[0].value, processedLineNumberNode = {
|
|
5116
3997
|
...lineNumberNode,
|
|
5117
3998
|
// empty the line-number element
|
|
5118
3999
|
children: [],
|
|
@@ -5124,63 +4005,38 @@ var processLineNumber = /* @__PURE__ */ __name((row) => {
|
|
|
5124
4005
|
style: { ...lineNumberNode.properties.style, userSelect: "auto" }
|
|
5125
4006
|
}
|
|
5126
4007
|
};
|
|
5127
|
-
children[0] = processedLineNumberNode;
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
stylesheet,
|
|
5135
|
-
useInlineStyles,
|
|
5136
|
-
key: `code-segement${i}`
|
|
5137
|
-
});
|
|
5138
|
-
});
|
|
5139
|
-
}, "defaultRenderer");
|
|
5140
|
-
var wrapRenderer = /* @__PURE__ */ __name((renderer, showLineNumbers) => {
|
|
5141
|
-
if (!showLineNumbers) {
|
|
5142
|
-
return renderer;
|
|
5143
|
-
}
|
|
5144
|
-
if (renderer) {
|
|
5145
|
-
return ({ rows, ...rest }) => renderer({ rows: rows.map((row) => processLineNumber(row)), ...rest });
|
|
5146
|
-
}
|
|
5147
|
-
return defaultRenderer2;
|
|
5148
|
-
}, "wrapRenderer");
|
|
5149
|
-
var SyntaxHighlighter2 = /* @__PURE__ */ __name(({
|
|
4008
|
+
return children[0] = processedLineNumberNode, { ...row, children };
|
|
4009
|
+
}, defaultRenderer2 = ({ rows, stylesheet, useInlineStyles }) => rows.map((node, i) => createElement({
|
|
4010
|
+
node: processLineNumber(node),
|
|
4011
|
+
stylesheet,
|
|
4012
|
+
useInlineStyles,
|
|
4013
|
+
key: `code-segement${i}`
|
|
4014
|
+
})), wrapRenderer = (renderer, showLineNumbers) => showLineNumbers ? renderer ? ({ rows, ...rest }) => renderer({ rows: rows.map((row) => processLineNumber(row)), ...rest }) : defaultRenderer2 : renderer, SyntaxHighlighter2 = ({
|
|
5150
4015
|
children,
|
|
5151
4016
|
language = "jsx",
|
|
5152
|
-
copyable =
|
|
5153
|
-
bordered =
|
|
5154
|
-
padded =
|
|
5155
|
-
format =
|
|
4017
|
+
copyable = !1,
|
|
4018
|
+
bordered = !1,
|
|
4019
|
+
padded = !1,
|
|
4020
|
+
format = !0,
|
|
5156
4021
|
formatter = void 0,
|
|
5157
4022
|
className = void 0,
|
|
5158
|
-
showLineNumbers =
|
|
4023
|
+
showLineNumbers = !1,
|
|
5159
4024
|
...rest
|
|
5160
4025
|
}) => {
|
|
5161
|
-
if (typeof children
|
|
4026
|
+
if (typeof children != "string" || !children.trim())
|
|
5162
4027
|
return null;
|
|
5163
|
-
|
|
5164
|
-
const [highlightableCode, setHighlightableCode] = useState("");
|
|
4028
|
+
let [highlightableCode, setHighlightableCode] = useState("");
|
|
5165
4029
|
useEffect(() => {
|
|
5166
|
-
|
|
5167
|
-
formatter(format, children).then(setHighlightableCode);
|
|
5168
|
-
} else {
|
|
5169
|
-
setHighlightableCode(children.trim());
|
|
5170
|
-
}
|
|
4030
|
+
formatter ? formatter(format, children).then(setHighlightableCode) : setHighlightableCode(children.trim());
|
|
5171
4031
|
}, [children, format, formatter]);
|
|
5172
|
-
|
|
5173
|
-
const onClick = useCallback(
|
|
4032
|
+
let [copied, setCopied] = useState(!1), onClick = useCallback(
|
|
5174
4033
|
(e) => {
|
|
5175
|
-
e.preventDefault()
|
|
5176
|
-
|
|
5177
|
-
setCopied(true);
|
|
5178
|
-
globalWindow.setTimeout(() => setCopied(false), 1500);
|
|
4034
|
+
e.preventDefault(), copyToClipboard(highlightableCode).then(() => {
|
|
4035
|
+
setCopied(!0), globalWindow.setTimeout(() => setCopied(!1), 1500);
|
|
5179
4036
|
}).catch(logger.error);
|
|
5180
4037
|
},
|
|
5181
4038
|
[highlightableCode]
|
|
5182
|
-
);
|
|
5183
|
-
const renderer = wrapRenderer(rest.renderer, showLineNumbers);
|
|
4039
|
+
), renderer = wrapRenderer(rest.renderer, showLineNumbers);
|
|
5184
4040
|
return React3.createElement(
|
|
5185
4041
|
Wrapper,
|
|
5186
4042
|
{
|
|
@@ -5196,7 +4052,7 @@ var SyntaxHighlighter2 = /* @__PURE__ */ __name(({
|
|
|
5196
4052
|
language,
|
|
5197
4053
|
showLineNumbers,
|
|
5198
4054
|
showInlineLineNumbers: showLineNumbers,
|
|
5199
|
-
useInlineStyles:
|
|
4055
|
+
useInlineStyles: !1,
|
|
5200
4056
|
PreTag: Pre,
|
|
5201
4057
|
CodeTag: Code,
|
|
5202
4058
|
lineNumberContainerStyle: {},
|
|
@@ -5207,7 +4063,7 @@ var SyntaxHighlighter2 = /* @__PURE__ */ __name(({
|
|
|
5207
4063
|
)),
|
|
5208
4064
|
copyable ? React3.createElement(ActionBar, { actionItems: [{ title: copied ? "Copied" : "Copy", onClick }] }) : null
|
|
5209
4065
|
);
|
|
5210
|
-
}
|
|
4066
|
+
};
|
|
5211
4067
|
SyntaxHighlighter2.registerLanguage = (...args) => prism_light_default.registerLanguage(...args);
|
|
5212
4068
|
var syntaxhighlighter_default = SyntaxHighlighter2;
|
|
5213
4069
|
export {
|