bunki 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1193 -422
- package/dist/index.js +1234 -463
- package/dist/server.d.ts +1 -1
- package/package.json +8 -8
package/dist/cli.js
CHANGED
|
@@ -69,7 +69,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
69
69
|
this._name = name;
|
|
70
70
|
break;
|
|
71
71
|
}
|
|
72
|
-
if (this._name.
|
|
72
|
+
if (this._name.endsWith("...")) {
|
|
73
73
|
this.variadic = true;
|
|
74
74
|
this._name = this._name.slice(0, -3);
|
|
75
75
|
}
|
|
@@ -77,11 +77,12 @@ var require_argument = __commonJS((exports) => {
|
|
|
77
77
|
name() {
|
|
78
78
|
return this._name;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
_collectValue(value, previous) {
|
|
81
81
|
if (previous === this.defaultValue || !Array.isArray(previous)) {
|
|
82
82
|
return [value];
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
previous.push(value);
|
|
85
|
+
return previous;
|
|
85
86
|
}
|
|
86
87
|
default(value, description) {
|
|
87
88
|
this.defaultValue = value;
|
|
@@ -99,7 +100,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
99
100
|
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
100
101
|
}
|
|
101
102
|
if (this.variadic) {
|
|
102
|
-
return this.
|
|
103
|
+
return this._collectValue(arg, previous);
|
|
103
104
|
}
|
|
104
105
|
return arg;
|
|
105
106
|
};
|
|
@@ -546,11 +547,12 @@ var require_option = __commonJS((exports) => {
|
|
|
546
547
|
this.hidden = !!hide;
|
|
547
548
|
return this;
|
|
548
549
|
}
|
|
549
|
-
|
|
550
|
+
_collectValue(value, previous) {
|
|
550
551
|
if (previous === this.defaultValue || !Array.isArray(previous)) {
|
|
551
552
|
return [value];
|
|
552
553
|
}
|
|
553
|
-
|
|
554
|
+
previous.push(value);
|
|
555
|
+
return previous;
|
|
554
556
|
}
|
|
555
557
|
choices(values) {
|
|
556
558
|
this.argChoices = values.slice();
|
|
@@ -559,7 +561,7 @@ var require_option = __commonJS((exports) => {
|
|
|
559
561
|
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
560
562
|
}
|
|
561
563
|
if (this.variadic) {
|
|
562
|
-
return this.
|
|
564
|
+
return this._collectValue(arg, previous);
|
|
563
565
|
}
|
|
564
566
|
return arg;
|
|
565
567
|
};
|
|
@@ -865,7 +867,10 @@ var require_command = __commonJS((exports) => {
|
|
|
865
867
|
configureOutput(configuration) {
|
|
866
868
|
if (configuration === undefined)
|
|
867
869
|
return this._outputConfiguration;
|
|
868
|
-
this._outputConfiguration =
|
|
870
|
+
this._outputConfiguration = {
|
|
871
|
+
...this._outputConfiguration,
|
|
872
|
+
...configuration
|
|
873
|
+
};
|
|
869
874
|
return this;
|
|
870
875
|
}
|
|
871
876
|
showHelpAfterError(displayHelp = true) {
|
|
@@ -914,7 +919,7 @@ var require_command = __commonJS((exports) => {
|
|
|
914
919
|
}
|
|
915
920
|
addArgument(argument) {
|
|
916
921
|
const previousArgument = this.registeredArguments.slice(-1)[0];
|
|
917
|
-
if (previousArgument
|
|
922
|
+
if (previousArgument?.variadic) {
|
|
918
923
|
throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);
|
|
919
924
|
}
|
|
920
925
|
if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {
|
|
@@ -1069,7 +1074,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1069
1074
|
if (val !== null && option.parseArg) {
|
|
1070
1075
|
val = this._callParseArg(option, val, oldValue, invalidValueMessage);
|
|
1071
1076
|
} else if (val !== null && option.variadic) {
|
|
1072
|
-
val = option.
|
|
1077
|
+
val = option._collectValue(val, oldValue);
|
|
1073
1078
|
}
|
|
1074
1079
|
if (val == null) {
|
|
1075
1080
|
if (option.negate) {
|
|
@@ -1444,7 +1449,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1444
1449
|
this.processedArgs = processedArgs;
|
|
1445
1450
|
}
|
|
1446
1451
|
_chainOrCall(promise, fn) {
|
|
1447
|
-
if (promise
|
|
1452
|
+
if (promise?.then && typeof promise.then === "function") {
|
|
1448
1453
|
return promise.then(() => fn());
|
|
1449
1454
|
}
|
|
1450
1455
|
return fn();
|
|
@@ -1521,7 +1526,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1521
1526
|
promiseChain = this._chainOrCallHooks(promiseChain, "postAction");
|
|
1522
1527
|
return promiseChain;
|
|
1523
1528
|
}
|
|
1524
|
-
if (this.parent
|
|
1529
|
+
if (this.parent?.listenerCount(commandEvent)) {
|
|
1525
1530
|
checkForUnknownOptions();
|
|
1526
1531
|
this._processArguments();
|
|
1527
1532
|
this.parent.emit(commandEvent, operands, unknown);
|
|
@@ -1583,11 +1588,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1583
1588
|
cmd._checkForConflictingLocalOptions();
|
|
1584
1589
|
});
|
|
1585
1590
|
}
|
|
1586
|
-
parseOptions(
|
|
1591
|
+
parseOptions(args) {
|
|
1587
1592
|
const operands = [];
|
|
1588
1593
|
const unknown = [];
|
|
1589
1594
|
let dest = operands;
|
|
1590
|
-
const args = argv.slice();
|
|
1591
1595
|
function maybeOption(arg) {
|
|
1592
1596
|
return arg.length > 1 && arg[0] === "-";
|
|
1593
1597
|
}
|
|
@@ -1597,12 +1601,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1597
1601
|
return !this._getCommandAndAncestors().some((cmd) => cmd.options.map((opt) => opt.short).some((short) => /^-\d$/.test(short)));
|
|
1598
1602
|
};
|
|
1599
1603
|
let activeVariadicOption = null;
|
|
1600
|
-
|
|
1601
|
-
|
|
1604
|
+
let activeGroup = null;
|
|
1605
|
+
let i = 0;
|
|
1606
|
+
while (i < args.length || activeGroup) {
|
|
1607
|
+
const arg = activeGroup ?? args[i++];
|
|
1608
|
+
activeGroup = null;
|
|
1602
1609
|
if (arg === "--") {
|
|
1603
1610
|
if (dest === unknown)
|
|
1604
1611
|
dest.push(arg);
|
|
1605
|
-
dest.push(...args);
|
|
1612
|
+
dest.push(...args.slice(i));
|
|
1606
1613
|
break;
|
|
1607
1614
|
}
|
|
1608
1615
|
if (activeVariadicOption && (!maybeOption(arg) || negativeNumberArg(arg))) {
|
|
@@ -1614,14 +1621,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1614
1621
|
const option = this._findOption(arg);
|
|
1615
1622
|
if (option) {
|
|
1616
1623
|
if (option.required) {
|
|
1617
|
-
const value = args
|
|
1624
|
+
const value = args[i++];
|
|
1618
1625
|
if (value === undefined)
|
|
1619
1626
|
this.optionMissingArgument(option);
|
|
1620
1627
|
this.emit(`option:${option.name()}`, value);
|
|
1621
1628
|
} else if (option.optional) {
|
|
1622
1629
|
let value = null;
|
|
1623
|
-
if (args.length
|
|
1624
|
-
value = args
|
|
1630
|
+
if (i < args.length && (!maybeOption(args[i]) || negativeNumberArg(args[i]))) {
|
|
1631
|
+
value = args[i++];
|
|
1625
1632
|
}
|
|
1626
1633
|
this.emit(`option:${option.name()}`, value);
|
|
1627
1634
|
} else {
|
|
@@ -1638,7 +1645,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1638
1645
|
this.emit(`option:${option.name()}`, arg.slice(2));
|
|
1639
1646
|
} else {
|
|
1640
1647
|
this.emit(`option:${option.name()}`);
|
|
1641
|
-
|
|
1648
|
+
activeGroup = `-${arg.slice(2)}`;
|
|
1642
1649
|
}
|
|
1643
1650
|
continue;
|
|
1644
1651
|
}
|
|
@@ -1657,25 +1664,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1657
1664
|
if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {
|
|
1658
1665
|
if (this._findCommand(arg)) {
|
|
1659
1666
|
operands.push(arg);
|
|
1660
|
-
|
|
1661
|
-
unknown.push(...args);
|
|
1667
|
+
unknown.push(...args.slice(i));
|
|
1662
1668
|
break;
|
|
1663
1669
|
} else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {
|
|
1664
|
-
operands.push(arg);
|
|
1665
|
-
if (args.length > 0)
|
|
1666
|
-
operands.push(...args);
|
|
1670
|
+
operands.push(arg, ...args.slice(i));
|
|
1667
1671
|
break;
|
|
1668
1672
|
} else if (this._defaultCommandName) {
|
|
1669
|
-
unknown.push(arg);
|
|
1670
|
-
if (args.length > 0)
|
|
1671
|
-
unknown.push(...args);
|
|
1673
|
+
unknown.push(arg, ...args.slice(i));
|
|
1672
1674
|
break;
|
|
1673
1675
|
}
|
|
1674
1676
|
}
|
|
1675
1677
|
if (this._passThroughOptions) {
|
|
1676
|
-
dest.push(arg);
|
|
1677
|
-
if (args.length > 0)
|
|
1678
|
-
dest.push(...args);
|
|
1678
|
+
dest.push(arg, ...args.slice(i));
|
|
1679
1679
|
break;
|
|
1680
1680
|
}
|
|
1681
1681
|
dest.push(arg);
|
|
@@ -17686,20 +17686,20 @@ var require_decode_codepoint = __commonJS((exports) => {
|
|
|
17686
17686
|
|
|
17687
17687
|
// node_modules/entities/lib/decode.js
|
|
17688
17688
|
var require_decode = __commonJS((exports) => {
|
|
17689
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m2,
|
|
17690
|
-
if (
|
|
17691
|
-
|
|
17692
|
-
var desc = Object.getOwnPropertyDescriptor(m2,
|
|
17689
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m2, k2, k22) {
|
|
17690
|
+
if (k22 === undefined)
|
|
17691
|
+
k22 = k2;
|
|
17692
|
+
var desc = Object.getOwnPropertyDescriptor(m2, k2);
|
|
17693
17693
|
if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
|
|
17694
17694
|
desc = { enumerable: true, get: function() {
|
|
17695
|
-
return m2[
|
|
17695
|
+
return m2[k2];
|
|
17696
17696
|
} };
|
|
17697
17697
|
}
|
|
17698
|
-
Object.defineProperty(o,
|
|
17699
|
-
} : function(o, m2,
|
|
17700
|
-
if (
|
|
17701
|
-
|
|
17702
|
-
o[
|
|
17698
|
+
Object.defineProperty(o, k22, desc);
|
|
17699
|
+
} : function(o, m2, k2, k22) {
|
|
17700
|
+
if (k22 === undefined)
|
|
17701
|
+
k22 = k2;
|
|
17702
|
+
o[k22] = m2[k2];
|
|
17703
17703
|
});
|
|
17704
17704
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v2) {
|
|
17705
17705
|
Object.defineProperty(o, "default", { enumerable: true, value: v2 });
|
|
@@ -17711,9 +17711,9 @@ var require_decode = __commonJS((exports) => {
|
|
|
17711
17711
|
return mod;
|
|
17712
17712
|
var result = {};
|
|
17713
17713
|
if (mod != null) {
|
|
17714
|
-
for (var
|
|
17715
|
-
if (
|
|
17716
|
-
__createBinding(result, mod,
|
|
17714
|
+
for (var k2 in mod)
|
|
17715
|
+
if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2))
|
|
17716
|
+
__createBinding(result, mod, k2);
|
|
17717
17717
|
}
|
|
17718
17718
|
__setModuleDefault(result, mod);
|
|
17719
17719
|
return result;
|
|
@@ -18793,20 +18793,20 @@ var require_Tokenizer = __commonJS((exports) => {
|
|
|
18793
18793
|
|
|
18794
18794
|
// node_modules/htmlparser2/lib/Parser.js
|
|
18795
18795
|
var require_Parser = __commonJS((exports) => {
|
|
18796
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m2,
|
|
18797
|
-
if (
|
|
18798
|
-
|
|
18799
|
-
var desc = Object.getOwnPropertyDescriptor(m2,
|
|
18796
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m2, k2, k22) {
|
|
18797
|
+
if (k22 === undefined)
|
|
18798
|
+
k22 = k2;
|
|
18799
|
+
var desc = Object.getOwnPropertyDescriptor(m2, k2);
|
|
18800
18800
|
if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
|
|
18801
18801
|
desc = { enumerable: true, get: function() {
|
|
18802
|
-
return m2[
|
|
18802
|
+
return m2[k2];
|
|
18803
18803
|
} };
|
|
18804
18804
|
}
|
|
18805
|
-
Object.defineProperty(o,
|
|
18806
|
-
} : function(o, m2,
|
|
18807
|
-
if (
|
|
18808
|
-
|
|
18809
|
-
o[
|
|
18805
|
+
Object.defineProperty(o, k22, desc);
|
|
18806
|
+
} : function(o, m2, k2, k22) {
|
|
18807
|
+
if (k22 === undefined)
|
|
18808
|
+
k22 = k2;
|
|
18809
|
+
o[k22] = m2[k2];
|
|
18810
18810
|
});
|
|
18811
18811
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v2) {
|
|
18812
18812
|
Object.defineProperty(o, "default", { enumerable: true, value: v2 });
|
|
@@ -18818,9 +18818,9 @@ var require_Parser = __commonJS((exports) => {
|
|
|
18818
18818
|
return mod;
|
|
18819
18819
|
var result = {};
|
|
18820
18820
|
if (mod != null) {
|
|
18821
|
-
for (var
|
|
18822
|
-
if (
|
|
18823
|
-
__createBinding(result, mod,
|
|
18821
|
+
for (var k2 in mod)
|
|
18822
|
+
if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2))
|
|
18823
|
+
__createBinding(result, mod, k2);
|
|
18824
18824
|
}
|
|
18825
18825
|
__setModuleDefault(result, mod);
|
|
18826
18826
|
return result;
|
|
@@ -19633,20 +19633,20 @@ var require_node = __commonJS((exports) => {
|
|
|
19633
19633
|
|
|
19634
19634
|
// node_modules/domhandler/lib/index.js
|
|
19635
19635
|
var require_lib3 = __commonJS((exports) => {
|
|
19636
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m2,
|
|
19637
|
-
if (
|
|
19638
|
-
|
|
19639
|
-
var desc = Object.getOwnPropertyDescriptor(m2,
|
|
19636
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m2, k2, k22) {
|
|
19637
|
+
if (k22 === undefined)
|
|
19638
|
+
k22 = k2;
|
|
19639
|
+
var desc = Object.getOwnPropertyDescriptor(m2, k2);
|
|
19640
19640
|
if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
|
|
19641
19641
|
desc = { enumerable: true, get: function() {
|
|
19642
|
-
return m2[
|
|
19642
|
+
return m2[k2];
|
|
19643
19643
|
} };
|
|
19644
19644
|
}
|
|
19645
|
-
Object.defineProperty(o,
|
|
19646
|
-
} : function(o, m2,
|
|
19647
|
-
if (
|
|
19648
|
-
|
|
19649
|
-
o[
|
|
19645
|
+
Object.defineProperty(o, k22, desc);
|
|
19646
|
+
} : function(o, m2, k2, k22) {
|
|
19647
|
+
if (k22 === undefined)
|
|
19648
|
+
k22 = k2;
|
|
19649
|
+
o[k22] = m2[k2];
|
|
19650
19650
|
});
|
|
19651
19651
|
var __exportStar = exports && exports.__exportStar || function(m2, exports2) {
|
|
19652
19652
|
for (var p in m2)
|
|
@@ -20169,20 +20169,20 @@ var require_lib5 = __commonJS((exports) => {
|
|
|
20169
20169
|
};
|
|
20170
20170
|
return __assign.apply(this, arguments);
|
|
20171
20171
|
};
|
|
20172
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m2,
|
|
20173
|
-
if (
|
|
20174
|
-
|
|
20175
|
-
var desc = Object.getOwnPropertyDescriptor(m2,
|
|
20172
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m2, k2, k22) {
|
|
20173
|
+
if (k22 === undefined)
|
|
20174
|
+
k22 = k2;
|
|
20175
|
+
var desc = Object.getOwnPropertyDescriptor(m2, k2);
|
|
20176
20176
|
if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
|
|
20177
20177
|
desc = { enumerable: true, get: function() {
|
|
20178
|
-
return m2[
|
|
20178
|
+
return m2[k2];
|
|
20179
20179
|
} };
|
|
20180
20180
|
}
|
|
20181
|
-
Object.defineProperty(o,
|
|
20182
|
-
} : function(o, m2,
|
|
20183
|
-
if (
|
|
20184
|
-
|
|
20185
|
-
o[
|
|
20181
|
+
Object.defineProperty(o, k22, desc);
|
|
20182
|
+
} : function(o, m2, k2, k22) {
|
|
20183
|
+
if (k22 === undefined)
|
|
20184
|
+
k22 = k2;
|
|
20185
|
+
o[k22] = m2[k2];
|
|
20186
20186
|
});
|
|
20187
20187
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v2) {
|
|
20188
20188
|
Object.defineProperty(o, "default", { enumerable: true, value: v2 });
|
|
@@ -20194,9 +20194,9 @@ var require_lib5 = __commonJS((exports) => {
|
|
|
20194
20194
|
return mod;
|
|
20195
20195
|
var result = {};
|
|
20196
20196
|
if (mod != null) {
|
|
20197
|
-
for (var
|
|
20198
|
-
if (
|
|
20199
|
-
__createBinding(result, mod,
|
|
20197
|
+
for (var k2 in mod)
|
|
20198
|
+
if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2))
|
|
20199
|
+
__createBinding(result, mod, k2);
|
|
20200
20200
|
}
|
|
20201
20201
|
__setModuleDefault(result, mod);
|
|
20202
20202
|
return result;
|
|
@@ -21005,20 +21005,20 @@ var require_feeds = __commonJS((exports) => {
|
|
|
21005
21005
|
|
|
21006
21006
|
// node_modules/domutils/lib/index.js
|
|
21007
21007
|
var require_lib6 = __commonJS((exports) => {
|
|
21008
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m2,
|
|
21009
|
-
if (
|
|
21010
|
-
|
|
21011
|
-
var desc = Object.getOwnPropertyDescriptor(m2,
|
|
21008
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m2, k2, k22) {
|
|
21009
|
+
if (k22 === undefined)
|
|
21010
|
+
k22 = k2;
|
|
21011
|
+
var desc = Object.getOwnPropertyDescriptor(m2, k2);
|
|
21012
21012
|
if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
|
|
21013
21013
|
desc = { enumerable: true, get: function() {
|
|
21014
|
-
return m2[
|
|
21014
|
+
return m2[k2];
|
|
21015
21015
|
} };
|
|
21016
21016
|
}
|
|
21017
|
-
Object.defineProperty(o,
|
|
21018
|
-
} : function(o, m2,
|
|
21019
|
-
if (
|
|
21020
|
-
|
|
21021
|
-
o[
|
|
21017
|
+
Object.defineProperty(o, k22, desc);
|
|
21018
|
+
} : function(o, m2, k2, k22) {
|
|
21019
|
+
if (k22 === undefined)
|
|
21020
|
+
k22 = k2;
|
|
21021
|
+
o[k22] = m2[k2];
|
|
21022
21022
|
});
|
|
21023
21023
|
var __exportStar = exports && exports.__exportStar || function(m2, exports2) {
|
|
21024
21024
|
for (var p in m2)
|
|
@@ -21057,20 +21057,20 @@ var require_lib6 = __commonJS((exports) => {
|
|
|
21057
21057
|
|
|
21058
21058
|
// node_modules/htmlparser2/lib/index.js
|
|
21059
21059
|
var require_lib7 = __commonJS((exports) => {
|
|
21060
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m2,
|
|
21061
|
-
if (
|
|
21062
|
-
|
|
21063
|
-
var desc = Object.getOwnPropertyDescriptor(m2,
|
|
21060
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m2, k2, k22) {
|
|
21061
|
+
if (k22 === undefined)
|
|
21062
|
+
k22 = k2;
|
|
21063
|
+
var desc = Object.getOwnPropertyDescriptor(m2, k2);
|
|
21064
21064
|
if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
|
|
21065
21065
|
desc = { enumerable: true, get: function() {
|
|
21066
|
-
return m2[
|
|
21066
|
+
return m2[k2];
|
|
21067
21067
|
} };
|
|
21068
21068
|
}
|
|
21069
|
-
Object.defineProperty(o,
|
|
21070
|
-
} : function(o, m2,
|
|
21071
|
-
if (
|
|
21072
|
-
|
|
21073
|
-
o[
|
|
21069
|
+
Object.defineProperty(o, k22, desc);
|
|
21070
|
+
} : function(o, m2, k2, k22) {
|
|
21071
|
+
if (k22 === undefined)
|
|
21072
|
+
k22 = k2;
|
|
21073
|
+
o[k22] = m2[k2];
|
|
21074
21074
|
});
|
|
21075
21075
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v2) {
|
|
21076
21076
|
Object.defineProperty(o, "default", { enumerable: true, value: v2 });
|
|
@@ -21082,9 +21082,9 @@ var require_lib7 = __commonJS((exports) => {
|
|
|
21082
21082
|
return mod;
|
|
21083
21083
|
var result = {};
|
|
21084
21084
|
if (mod != null) {
|
|
21085
|
-
for (var
|
|
21086
|
-
if (
|
|
21087
|
-
__createBinding(result, mod,
|
|
21085
|
+
for (var k2 in mod)
|
|
21086
|
+
if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2))
|
|
21087
|
+
__createBinding(result, mod, k2);
|
|
21088
21088
|
}
|
|
21089
21089
|
__setModuleDefault(result, mod);
|
|
21090
21090
|
return result;
|
|
@@ -21206,8 +21206,8 @@ var require_cjs = __commonJS((exports, module) => {
|
|
|
21206
21206
|
function cloneUnlessOtherwiseSpecified(value, options2) {
|
|
21207
21207
|
return options2.clone !== false && options2.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options2) : value;
|
|
21208
21208
|
}
|
|
21209
|
-
function defaultArrayMerge(target,
|
|
21210
|
-
return target.concat(
|
|
21209
|
+
function defaultArrayMerge(target, source2, options2) {
|
|
21210
|
+
return target.concat(source2).map(function(element) {
|
|
21211
21211
|
return cloneUnlessOtherwiseSpecified(element, options2);
|
|
21212
21212
|
});
|
|
21213
21213
|
}
|
|
@@ -21236,39 +21236,39 @@ var require_cjs = __commonJS((exports, module) => {
|
|
|
21236
21236
|
function propertyIsUnsafe(target, key) {
|
|
21237
21237
|
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
|
|
21238
21238
|
}
|
|
21239
|
-
function mergeObject(target,
|
|
21239
|
+
function mergeObject(target, source2, options2) {
|
|
21240
21240
|
var destination = {};
|
|
21241
21241
|
if (options2.isMergeableObject(target)) {
|
|
21242
21242
|
getKeys(target).forEach(function(key) {
|
|
21243
21243
|
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options2);
|
|
21244
21244
|
});
|
|
21245
21245
|
}
|
|
21246
|
-
getKeys(
|
|
21246
|
+
getKeys(source2).forEach(function(key) {
|
|
21247
21247
|
if (propertyIsUnsafe(target, key)) {
|
|
21248
21248
|
return;
|
|
21249
21249
|
}
|
|
21250
|
-
if (propertyIsOnObject(target, key) && options2.isMergeableObject(
|
|
21251
|
-
destination[key] = getMergeFunction(key, options2)(target[key],
|
|
21250
|
+
if (propertyIsOnObject(target, key) && options2.isMergeableObject(source2[key])) {
|
|
21251
|
+
destination[key] = getMergeFunction(key, options2)(target[key], source2[key], options2);
|
|
21252
21252
|
} else {
|
|
21253
|
-
destination[key] = cloneUnlessOtherwiseSpecified(
|
|
21253
|
+
destination[key] = cloneUnlessOtherwiseSpecified(source2[key], options2);
|
|
21254
21254
|
}
|
|
21255
21255
|
});
|
|
21256
21256
|
return destination;
|
|
21257
21257
|
}
|
|
21258
|
-
function deepmerge(target,
|
|
21258
|
+
function deepmerge(target, source2, options2) {
|
|
21259
21259
|
options2 = options2 || {};
|
|
21260
21260
|
options2.arrayMerge = options2.arrayMerge || defaultArrayMerge;
|
|
21261
21261
|
options2.isMergeableObject = options2.isMergeableObject || isMergeableObject;
|
|
21262
21262
|
options2.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
21263
|
-
var sourceIsArray = Array.isArray(
|
|
21263
|
+
var sourceIsArray = Array.isArray(source2);
|
|
21264
21264
|
var targetIsArray = Array.isArray(target);
|
|
21265
21265
|
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
21266
21266
|
if (!sourceAndTargetTypesMatch) {
|
|
21267
|
-
return cloneUnlessOtherwiseSpecified(
|
|
21267
|
+
return cloneUnlessOtherwiseSpecified(source2, options2);
|
|
21268
21268
|
} else if (sourceIsArray) {
|
|
21269
|
-
return options2.arrayMerge(target,
|
|
21269
|
+
return options2.arrayMerge(target, source2, options2);
|
|
21270
21270
|
} else {
|
|
21271
|
-
return mergeObject(target,
|
|
21271
|
+
return mergeObject(target, source2, options2);
|
|
21272
21272
|
}
|
|
21273
21273
|
}
|
|
21274
21274
|
deepmerge.all = function deepmergeAll(array, options2) {
|
|
@@ -21378,7 +21378,7 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
21378
21378
|
}
|
|
21379
21379
|
}
|
|
21380
21380
|
function parseDescriptors() {
|
|
21381
|
-
var pError = false, w2, d2,
|
|
21381
|
+
var pError = false, w2, d2, h, i, candidate = {}, desc, lastChar, value, intVal, floatVal;
|
|
21382
21382
|
for (i = 0;i < descriptors.length; i++) {
|
|
21383
21383
|
desc = descriptors[i];
|
|
21384
21384
|
lastChar = desc[desc.length - 1];
|
|
@@ -21395,7 +21395,7 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
21395
21395
|
w2 = intVal;
|
|
21396
21396
|
}
|
|
21397
21397
|
} else if (regexFloatingPoint.test(value) && lastChar === "x") {
|
|
21398
|
-
if (w2 || d2 ||
|
|
21398
|
+
if (w2 || d2 || h) {
|
|
21399
21399
|
pError = true;
|
|
21400
21400
|
}
|
|
21401
21401
|
if (floatVal < 0) {
|
|
@@ -21404,13 +21404,13 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
21404
21404
|
d2 = floatVal;
|
|
21405
21405
|
}
|
|
21406
21406
|
} else if (regexNonNegativeInteger.test(value) && lastChar === "h") {
|
|
21407
|
-
if (
|
|
21407
|
+
if (h || d2) {
|
|
21408
21408
|
pError = true;
|
|
21409
21409
|
}
|
|
21410
21410
|
if (intVal === 0) {
|
|
21411
21411
|
pError = true;
|
|
21412
21412
|
} else {
|
|
21413
|
-
|
|
21413
|
+
h = intVal;
|
|
21414
21414
|
}
|
|
21415
21415
|
} else {
|
|
21416
21416
|
pError = true;
|
|
@@ -21424,8 +21424,8 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
21424
21424
|
if (d2) {
|
|
21425
21425
|
candidate.d = d2;
|
|
21426
21426
|
}
|
|
21427
|
-
if (
|
|
21428
|
-
candidate.h =
|
|
21427
|
+
if (h) {
|
|
21428
|
+
candidate.h = h;
|
|
21429
21429
|
}
|
|
21430
21430
|
candidates.push(candidate);
|
|
21431
21431
|
} else if (console && console.log) {
|
|
@@ -21787,15 +21787,15 @@ var require_css_syntax_error = __commonJS((exports, module) => {
|
|
|
21787
21787
|
var terminalHighlight = require_terminal_highlight();
|
|
21788
21788
|
|
|
21789
21789
|
class CssSyntaxError extends Error {
|
|
21790
|
-
constructor(message, line, column,
|
|
21790
|
+
constructor(message, line, column, source2, file, plugin) {
|
|
21791
21791
|
super(message);
|
|
21792
21792
|
this.name = "CssSyntaxError";
|
|
21793
21793
|
this.reason = message;
|
|
21794
21794
|
if (file) {
|
|
21795
21795
|
this.file = file;
|
|
21796
21796
|
}
|
|
21797
|
-
if (
|
|
21798
|
-
this.source =
|
|
21797
|
+
if (source2) {
|
|
21798
|
+
this.source = source2;
|
|
21799
21799
|
}
|
|
21800
21800
|
if (plugin) {
|
|
21801
21801
|
this.plugin = plugin;
|
|
@@ -23734,17 +23734,17 @@ var require_source_map_generator = __commonJS((exports) => {
|
|
|
23734
23734
|
SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
|
|
23735
23735
|
var generated = util.getArg(aArgs, "generated");
|
|
23736
23736
|
var original = util.getArg(aArgs, "original", null);
|
|
23737
|
-
var
|
|
23737
|
+
var source2 = util.getArg(aArgs, "source", null);
|
|
23738
23738
|
var name = util.getArg(aArgs, "name", null);
|
|
23739
23739
|
if (!this._skipValidation) {
|
|
23740
|
-
if (this._validateMapping(generated, original,
|
|
23740
|
+
if (this._validateMapping(generated, original, source2, name) === false) {
|
|
23741
23741
|
return;
|
|
23742
23742
|
}
|
|
23743
23743
|
}
|
|
23744
|
-
if (
|
|
23745
|
-
|
|
23746
|
-
if (!this._sources.has(
|
|
23747
|
-
this._sources.add(
|
|
23744
|
+
if (source2 != null) {
|
|
23745
|
+
source2 = String(source2);
|
|
23746
|
+
if (!this._sources.has(source2)) {
|
|
23747
|
+
this._sources.add(source2);
|
|
23748
23748
|
}
|
|
23749
23749
|
}
|
|
23750
23750
|
if (name != null) {
|
|
@@ -23758,22 +23758,22 @@ var require_source_map_generator = __commonJS((exports) => {
|
|
|
23758
23758
|
generatedColumn: generated.column,
|
|
23759
23759
|
originalLine: original != null && original.line,
|
|
23760
23760
|
originalColumn: original != null && original.column,
|
|
23761
|
-
source,
|
|
23761
|
+
source: source2,
|
|
23762
23762
|
name
|
|
23763
23763
|
});
|
|
23764
23764
|
};
|
|
23765
23765
|
SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
|
|
23766
|
-
var
|
|
23766
|
+
var source2 = aSourceFile;
|
|
23767
23767
|
if (this._sourceRoot != null) {
|
|
23768
|
-
|
|
23768
|
+
source2 = util.relative(this._sourceRoot, source2);
|
|
23769
23769
|
}
|
|
23770
23770
|
if (aSourceContent != null) {
|
|
23771
23771
|
if (!this._sourcesContents) {
|
|
23772
23772
|
this._sourcesContents = Object.create(null);
|
|
23773
23773
|
}
|
|
23774
|
-
this._sourcesContents[util.toSetString(
|
|
23774
|
+
this._sourcesContents[util.toSetString(source2)] = aSourceContent;
|
|
23775
23775
|
} else if (this._sourcesContents) {
|
|
23776
|
-
delete this._sourcesContents[util.toSetString(
|
|
23776
|
+
delete this._sourcesContents[util.toSetString(source2)];
|
|
23777
23777
|
if (Object.keys(this._sourcesContents).length === 0) {
|
|
23778
23778
|
this._sourcesContents = null;
|
|
23779
23779
|
}
|
|
@@ -23814,9 +23814,9 @@ var require_source_map_generator = __commonJS((exports) => {
|
|
|
23814
23814
|
}
|
|
23815
23815
|
}
|
|
23816
23816
|
}
|
|
23817
|
-
var
|
|
23818
|
-
if (
|
|
23819
|
-
newSources.add(
|
|
23817
|
+
var source2 = mapping.source;
|
|
23818
|
+
if (source2 != null && !newSources.has(source2)) {
|
|
23819
|
+
newSources.add(source2);
|
|
23820
23820
|
}
|
|
23821
23821
|
var name = mapping.name;
|
|
23822
23822
|
if (name != null && !newNames.has(name)) {
|
|
@@ -23922,14 +23922,14 @@ var require_source_map_generator = __commonJS((exports) => {
|
|
|
23922
23922
|
return result;
|
|
23923
23923
|
};
|
|
23924
23924
|
SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
|
|
23925
|
-
return aSources.map(function(
|
|
23925
|
+
return aSources.map(function(source2) {
|
|
23926
23926
|
if (!this._sourcesContents) {
|
|
23927
23927
|
return null;
|
|
23928
23928
|
}
|
|
23929
23929
|
if (aSourceRoot != null) {
|
|
23930
|
-
|
|
23930
|
+
source2 = util.relative(aSourceRoot, source2);
|
|
23931
23931
|
}
|
|
23932
|
-
var key = util.toSetString(
|
|
23932
|
+
var key = util.toSetString(source2);
|
|
23933
23933
|
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
|
|
23934
23934
|
}, this);
|
|
23935
23935
|
};
|
|
@@ -24007,9 +24007,9 @@ var require_binary_search = __commonJS((exports) => {
|
|
|
24007
24007
|
// node_modules/source-map-js/lib/quick-sort.js
|
|
24008
24008
|
var require_quick_sort = __commonJS((exports) => {
|
|
24009
24009
|
function SortTemplate(comparator) {
|
|
24010
|
-
function swap(ary,
|
|
24011
|
-
var temp = ary[
|
|
24012
|
-
ary[
|
|
24010
|
+
function swap(ary, x2, y2) {
|
|
24011
|
+
var temp = ary[x2];
|
|
24012
|
+
ary[x2] = ary[y2];
|
|
24013
24013
|
ary[y2] = temp;
|
|
24014
24014
|
}
|
|
24015
24015
|
function randomIntInRange(low, high) {
|
|
@@ -24123,12 +24123,12 @@ var require_source_map_consumer = __commonJS((exports) => {
|
|
|
24123
24123
|
var sourceMapURL = this._sourceMapURL;
|
|
24124
24124
|
for (var i = 0, n = mappings.length;i < n; i++) {
|
|
24125
24125
|
var mapping = mappings[i];
|
|
24126
|
-
var
|
|
24127
|
-
if (
|
|
24128
|
-
|
|
24126
|
+
var source2 = mapping.source === null ? null : sources.at(mapping.source);
|
|
24127
|
+
if (source2 !== null) {
|
|
24128
|
+
source2 = util.computeSourceURL(sourceRoot, source2, sourceMapURL);
|
|
24129
24129
|
}
|
|
24130
24130
|
boundCallback({
|
|
24131
|
-
source,
|
|
24131
|
+
source: source2,
|
|
24132
24132
|
generatedLine: mapping.generatedLine,
|
|
24133
24133
|
generatedColumn: mapping.generatedColumn,
|
|
24134
24134
|
originalLine: mapping.originalLine,
|
|
@@ -24195,8 +24195,8 @@ var require_source_map_consumer = __commonJS((exports) => {
|
|
|
24195
24195
|
if (sourceRoot) {
|
|
24196
24196
|
sourceRoot = util.normalize(sourceRoot);
|
|
24197
24197
|
}
|
|
24198
|
-
sources = sources.map(String).map(util.normalize).map(function(
|
|
24199
|
-
return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(
|
|
24198
|
+
sources = sources.map(String).map(util.normalize).map(function(source2) {
|
|
24199
|
+
return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source2) ? util.relative(sourceRoot, source2) : source2;
|
|
24200
24200
|
});
|
|
24201
24201
|
this._names = ArraySet.fromArray(names.map(String), true);
|
|
24202
24202
|
this._sources = ArraySet.fromArray(sources, true);
|
|
@@ -24276,7 +24276,7 @@ var require_source_map_consumer = __commonJS((exports) => {
|
|
|
24276
24276
|
}
|
|
24277
24277
|
var compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine;
|
|
24278
24278
|
function sortGenerated(array, start) {
|
|
24279
|
-
let
|
|
24279
|
+
let l = array.length;
|
|
24280
24280
|
let n = array.length - start;
|
|
24281
24281
|
if (n <= 1) {
|
|
24282
24282
|
return;
|
|
@@ -24288,7 +24288,7 @@ var require_source_map_consumer = __commonJS((exports) => {
|
|
|
24288
24288
|
array[start + 1] = a;
|
|
24289
24289
|
}
|
|
24290
24290
|
} else if (n < 20) {
|
|
24291
|
-
for (let i = start;i <
|
|
24291
|
+
for (let i = start;i < l; i++) {
|
|
24292
24292
|
for (let j2 = i;j2 > start; j2--) {
|
|
24293
24293
|
let a = array[j2 - 1];
|
|
24294
24294
|
let b2 = array[j2];
|
|
@@ -24417,17 +24417,17 @@ var require_source_map_consumer = __commonJS((exports) => {
|
|
|
24417
24417
|
if (index >= 0) {
|
|
24418
24418
|
var mapping = this._generatedMappings[index];
|
|
24419
24419
|
if (mapping.generatedLine === needle.generatedLine) {
|
|
24420
|
-
var
|
|
24421
|
-
if (
|
|
24422
|
-
|
|
24423
|
-
|
|
24420
|
+
var source2 = util.getArg(mapping, "source", null);
|
|
24421
|
+
if (source2 !== null) {
|
|
24422
|
+
source2 = this._sources.at(source2);
|
|
24423
|
+
source2 = util.computeSourceURL(this.sourceRoot, source2, this._sourceMapURL);
|
|
24424
24424
|
}
|
|
24425
24425
|
var name = util.getArg(mapping, "name", null);
|
|
24426
24426
|
if (name !== null) {
|
|
24427
24427
|
name = this._names.at(name);
|
|
24428
24428
|
}
|
|
24429
24429
|
return {
|
|
24430
|
-
source,
|
|
24430
|
+
source: source2,
|
|
24431
24431
|
line: util.getArg(mapping, "originalLine", null),
|
|
24432
24432
|
column: util.getArg(mapping, "originalColumn", null),
|
|
24433
24433
|
name
|
|
@@ -24478,9 +24478,9 @@ var require_source_map_consumer = __commonJS((exports) => {
|
|
|
24478
24478
|
}
|
|
24479
24479
|
};
|
|
24480
24480
|
BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
|
|
24481
|
-
var
|
|
24482
|
-
|
|
24483
|
-
if (
|
|
24481
|
+
var source2 = util.getArg(aArgs, "source");
|
|
24482
|
+
source2 = this._findSourceIndex(source2);
|
|
24483
|
+
if (source2 < 0) {
|
|
24484
24484
|
return {
|
|
24485
24485
|
line: null,
|
|
24486
24486
|
column: null,
|
|
@@ -24488,7 +24488,7 @@ var require_source_map_consumer = __commonJS((exports) => {
|
|
|
24488
24488
|
};
|
|
24489
24489
|
}
|
|
24490
24490
|
var needle = {
|
|
24491
|
-
source,
|
|
24491
|
+
source: source2,
|
|
24492
24492
|
originalLine: util.getArg(aArgs, "line"),
|
|
24493
24493
|
originalColumn: util.getArg(aArgs, "column")
|
|
24494
24494
|
};
|
|
@@ -24634,12 +24634,12 @@ var require_source_map_consumer = __commonJS((exports) => {
|
|
|
24634
24634
|
var sectionMappings = section.consumer._generatedMappings;
|
|
24635
24635
|
for (var j2 = 0;j2 < sectionMappings.length; j2++) {
|
|
24636
24636
|
var mapping = sectionMappings[j2];
|
|
24637
|
-
var
|
|
24638
|
-
if (
|
|
24639
|
-
|
|
24637
|
+
var source2 = section.consumer._sources.at(mapping.source);
|
|
24638
|
+
if (source2 !== null) {
|
|
24639
|
+
source2 = util.computeSourceURL(section.consumer.sourceRoot, source2, this._sourceMapURL);
|
|
24640
24640
|
}
|
|
24641
|
-
this._sources.add(
|
|
24642
|
-
|
|
24641
|
+
this._sources.add(source2);
|
|
24642
|
+
source2 = this._sources.indexOf(source2);
|
|
24643
24643
|
var name = null;
|
|
24644
24644
|
if (mapping.name) {
|
|
24645
24645
|
name = section.consumer._names.at(mapping.name);
|
|
@@ -24647,7 +24647,7 @@ var require_source_map_consumer = __commonJS((exports) => {
|
|
|
24647
24647
|
name = this._names.indexOf(name);
|
|
24648
24648
|
}
|
|
24649
24649
|
var adjustedMapping = {
|
|
24650
|
-
source,
|
|
24650
|
+
source: source2,
|
|
24651
24651
|
generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
|
|
24652
24652
|
generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
|
|
24653
24653
|
originalLine: mapping.originalLine,
|
|
@@ -24746,8 +24746,8 @@ var require_source_node = __commonJS((exports) => {
|
|
|
24746
24746
|
if (mapping === null || mapping.source === undefined) {
|
|
24747
24747
|
node.add(code);
|
|
24748
24748
|
} else {
|
|
24749
|
-
var
|
|
24750
|
-
node.add(new SourceNode(mapping.originalLine, mapping.originalColumn,
|
|
24749
|
+
var source2 = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
|
|
24750
|
+
node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source2, code, mapping.name));
|
|
24751
24751
|
}
|
|
24752
24752
|
}
|
|
24753
24753
|
};
|
|
@@ -25150,7 +25150,7 @@ var require_input = __commonJS((exports, module) => {
|
|
|
25150
25150
|
`);
|
|
25151
25151
|
lineToIndex = new Array(lines.length);
|
|
25152
25152
|
let prevIndex = 0;
|
|
25153
|
-
for (let i = 0,
|
|
25153
|
+
for (let i = 0, l = lines.length;i < l; i++) {
|
|
25154
25154
|
lineToIndex[i] = prevIndex;
|
|
25155
25155
|
prevIndex += lines[i].length + 1;
|
|
25156
25156
|
}
|
|
@@ -25219,9 +25219,9 @@ var require_input = __commonJS((exports, module) => {
|
|
|
25219
25219
|
throw new Error(`file: protocol is not available in this PostCSS build`);
|
|
25220
25220
|
}
|
|
25221
25221
|
}
|
|
25222
|
-
let
|
|
25223
|
-
if (
|
|
25224
|
-
result.source =
|
|
25222
|
+
let source2 = consumer.sourceContentFor(from.source);
|
|
25223
|
+
if (source2)
|
|
25224
|
+
result.source = source2;
|
|
25225
25225
|
return result;
|
|
25226
25226
|
}
|
|
25227
25227
|
toJSON() {
|
|
@@ -25414,8 +25414,8 @@ var require_fromJSON = __commonJS((exports, module) => {
|
|
|
25414
25414
|
defaults.nodes = json2.nodes.map((n) => fromJSON(n, inputs));
|
|
25415
25415
|
}
|
|
25416
25416
|
if (defaults.source) {
|
|
25417
|
-
let { inputId, ...
|
|
25418
|
-
defaults.source =
|
|
25417
|
+
let { inputId, ...source2 } = defaults.source;
|
|
25418
|
+
defaults.source = source2;
|
|
25419
25419
|
if (inputId != null) {
|
|
25420
25420
|
defaults.source.input = inputs[inputId];
|
|
25421
25421
|
}
|
|
@@ -29700,6 +29700,759 @@ function python(hljs) {
|
|
|
29700
29700
|
};
|
|
29701
29701
|
}
|
|
29702
29702
|
|
|
29703
|
+
// node_modules/highlight.js/es/languages/swift.js
|
|
29704
|
+
function source(re) {
|
|
29705
|
+
if (!re)
|
|
29706
|
+
return null;
|
|
29707
|
+
if (typeof re === "string")
|
|
29708
|
+
return re;
|
|
29709
|
+
return re.source;
|
|
29710
|
+
}
|
|
29711
|
+
function lookahead(re) {
|
|
29712
|
+
return concat("(?=", re, ")");
|
|
29713
|
+
}
|
|
29714
|
+
function concat(...args) {
|
|
29715
|
+
const joined = args.map((x) => source(x)).join("");
|
|
29716
|
+
return joined;
|
|
29717
|
+
}
|
|
29718
|
+
function stripOptionsFromArgs(args) {
|
|
29719
|
+
const opts = args[args.length - 1];
|
|
29720
|
+
if (typeof opts === "object" && opts.constructor === Object) {
|
|
29721
|
+
args.splice(args.length - 1, 1);
|
|
29722
|
+
return opts;
|
|
29723
|
+
} else {
|
|
29724
|
+
return {};
|
|
29725
|
+
}
|
|
29726
|
+
}
|
|
29727
|
+
function either(...args) {
|
|
29728
|
+
const opts = stripOptionsFromArgs(args);
|
|
29729
|
+
const joined = "(" + (opts.capture ? "" : "?:") + args.map((x) => source(x)).join("|") + ")";
|
|
29730
|
+
return joined;
|
|
29731
|
+
}
|
|
29732
|
+
var keywordWrapper = (keyword) => concat(/\b/, keyword, /\w$/.test(keyword) ? /\b/ : /\B/);
|
|
29733
|
+
var dotKeywords = [
|
|
29734
|
+
"Protocol",
|
|
29735
|
+
"Type"
|
|
29736
|
+
].map(keywordWrapper);
|
|
29737
|
+
var optionalDotKeywords = [
|
|
29738
|
+
"init",
|
|
29739
|
+
"self"
|
|
29740
|
+
].map(keywordWrapper);
|
|
29741
|
+
var keywordTypes = [
|
|
29742
|
+
"Any",
|
|
29743
|
+
"Self"
|
|
29744
|
+
];
|
|
29745
|
+
var keywords = [
|
|
29746
|
+
"actor",
|
|
29747
|
+
"any",
|
|
29748
|
+
"associatedtype",
|
|
29749
|
+
"async",
|
|
29750
|
+
"await",
|
|
29751
|
+
/as\?/,
|
|
29752
|
+
/as!/,
|
|
29753
|
+
"as",
|
|
29754
|
+
"borrowing",
|
|
29755
|
+
"break",
|
|
29756
|
+
"case",
|
|
29757
|
+
"catch",
|
|
29758
|
+
"class",
|
|
29759
|
+
"consume",
|
|
29760
|
+
"consuming",
|
|
29761
|
+
"continue",
|
|
29762
|
+
"convenience",
|
|
29763
|
+
"copy",
|
|
29764
|
+
"default",
|
|
29765
|
+
"defer",
|
|
29766
|
+
"deinit",
|
|
29767
|
+
"didSet",
|
|
29768
|
+
"distributed",
|
|
29769
|
+
"do",
|
|
29770
|
+
"dynamic",
|
|
29771
|
+
"each",
|
|
29772
|
+
"else",
|
|
29773
|
+
"enum",
|
|
29774
|
+
"extension",
|
|
29775
|
+
"fallthrough",
|
|
29776
|
+
/fileprivate\(set\)/,
|
|
29777
|
+
"fileprivate",
|
|
29778
|
+
"final",
|
|
29779
|
+
"for",
|
|
29780
|
+
"func",
|
|
29781
|
+
"get",
|
|
29782
|
+
"guard",
|
|
29783
|
+
"if",
|
|
29784
|
+
"import",
|
|
29785
|
+
"indirect",
|
|
29786
|
+
"infix",
|
|
29787
|
+
/init\?/,
|
|
29788
|
+
/init!/,
|
|
29789
|
+
"inout",
|
|
29790
|
+
/internal\(set\)/,
|
|
29791
|
+
"internal",
|
|
29792
|
+
"in",
|
|
29793
|
+
"is",
|
|
29794
|
+
"isolated",
|
|
29795
|
+
"nonisolated",
|
|
29796
|
+
"lazy",
|
|
29797
|
+
"let",
|
|
29798
|
+
"macro",
|
|
29799
|
+
"mutating",
|
|
29800
|
+
"nonmutating",
|
|
29801
|
+
/open\(set\)/,
|
|
29802
|
+
"open",
|
|
29803
|
+
"operator",
|
|
29804
|
+
"optional",
|
|
29805
|
+
"override",
|
|
29806
|
+
"package",
|
|
29807
|
+
"postfix",
|
|
29808
|
+
"precedencegroup",
|
|
29809
|
+
"prefix",
|
|
29810
|
+
/private\(set\)/,
|
|
29811
|
+
"private",
|
|
29812
|
+
"protocol",
|
|
29813
|
+
/public\(set\)/,
|
|
29814
|
+
"public",
|
|
29815
|
+
"repeat",
|
|
29816
|
+
"required",
|
|
29817
|
+
"rethrows",
|
|
29818
|
+
"return",
|
|
29819
|
+
"set",
|
|
29820
|
+
"some",
|
|
29821
|
+
"static",
|
|
29822
|
+
"struct",
|
|
29823
|
+
"subscript",
|
|
29824
|
+
"super",
|
|
29825
|
+
"switch",
|
|
29826
|
+
"throws",
|
|
29827
|
+
"throw",
|
|
29828
|
+
/try\?/,
|
|
29829
|
+
/try!/,
|
|
29830
|
+
"try",
|
|
29831
|
+
"typealias",
|
|
29832
|
+
/unowned\(safe\)/,
|
|
29833
|
+
/unowned\(unsafe\)/,
|
|
29834
|
+
"unowned",
|
|
29835
|
+
"var",
|
|
29836
|
+
"weak",
|
|
29837
|
+
"where",
|
|
29838
|
+
"while",
|
|
29839
|
+
"willSet"
|
|
29840
|
+
];
|
|
29841
|
+
var literals = [
|
|
29842
|
+
"false",
|
|
29843
|
+
"nil",
|
|
29844
|
+
"true"
|
|
29845
|
+
];
|
|
29846
|
+
var precedencegroupKeywords = [
|
|
29847
|
+
"assignment",
|
|
29848
|
+
"associativity",
|
|
29849
|
+
"higherThan",
|
|
29850
|
+
"left",
|
|
29851
|
+
"lowerThan",
|
|
29852
|
+
"none",
|
|
29853
|
+
"right"
|
|
29854
|
+
];
|
|
29855
|
+
var numberSignKeywords = [
|
|
29856
|
+
"#colorLiteral",
|
|
29857
|
+
"#column",
|
|
29858
|
+
"#dsohandle",
|
|
29859
|
+
"#else",
|
|
29860
|
+
"#elseif",
|
|
29861
|
+
"#endif",
|
|
29862
|
+
"#error",
|
|
29863
|
+
"#file",
|
|
29864
|
+
"#fileID",
|
|
29865
|
+
"#fileLiteral",
|
|
29866
|
+
"#filePath",
|
|
29867
|
+
"#function",
|
|
29868
|
+
"#if",
|
|
29869
|
+
"#imageLiteral",
|
|
29870
|
+
"#keyPath",
|
|
29871
|
+
"#line",
|
|
29872
|
+
"#selector",
|
|
29873
|
+
"#sourceLocation",
|
|
29874
|
+
"#warning"
|
|
29875
|
+
];
|
|
29876
|
+
var builtIns = [
|
|
29877
|
+
"abs",
|
|
29878
|
+
"all",
|
|
29879
|
+
"any",
|
|
29880
|
+
"assert",
|
|
29881
|
+
"assertionFailure",
|
|
29882
|
+
"debugPrint",
|
|
29883
|
+
"dump",
|
|
29884
|
+
"fatalError",
|
|
29885
|
+
"getVaList",
|
|
29886
|
+
"isKnownUniquelyReferenced",
|
|
29887
|
+
"max",
|
|
29888
|
+
"min",
|
|
29889
|
+
"numericCast",
|
|
29890
|
+
"pointwiseMax",
|
|
29891
|
+
"pointwiseMin",
|
|
29892
|
+
"precondition",
|
|
29893
|
+
"preconditionFailure",
|
|
29894
|
+
"print",
|
|
29895
|
+
"readLine",
|
|
29896
|
+
"repeatElement",
|
|
29897
|
+
"sequence",
|
|
29898
|
+
"stride",
|
|
29899
|
+
"swap",
|
|
29900
|
+
"swift_unboxFromSwiftValueWithType",
|
|
29901
|
+
"transcode",
|
|
29902
|
+
"type",
|
|
29903
|
+
"unsafeBitCast",
|
|
29904
|
+
"unsafeDowncast",
|
|
29905
|
+
"withExtendedLifetime",
|
|
29906
|
+
"withUnsafeMutablePointer",
|
|
29907
|
+
"withUnsafePointer",
|
|
29908
|
+
"withVaList",
|
|
29909
|
+
"withoutActuallyEscaping",
|
|
29910
|
+
"zip"
|
|
29911
|
+
];
|
|
29912
|
+
var operatorHead = either(/[/=\-+!*%<>&|^~?]/, /[\u00A1-\u00A7]/, /[\u00A9\u00AB]/, /[\u00AC\u00AE]/, /[\u00B0\u00B1]/, /[\u00B6\u00BB\u00BF\u00D7\u00F7]/, /[\u2016-\u2017]/, /[\u2020-\u2027]/, /[\u2030-\u203E]/, /[\u2041-\u2053]/, /[\u2055-\u205E]/, /[\u2190-\u23FF]/, /[\u2500-\u2775]/, /[\u2794-\u2BFF]/, /[\u2E00-\u2E7F]/, /[\u3001-\u3003]/, /[\u3008-\u3020]/, /[\u3030]/);
|
|
29913
|
+
var operatorCharacter = either(operatorHead, /[\u0300-\u036F]/, /[\u1DC0-\u1DFF]/, /[\u20D0-\u20FF]/, /[\uFE00-\uFE0F]/, /[\uFE20-\uFE2F]/);
|
|
29914
|
+
var operator = concat(operatorHead, operatorCharacter, "*");
|
|
29915
|
+
var identifierHead = either(/[a-zA-Z_]/, /[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/, /[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/, /[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/, /[\u1E00-\u1FFF]/, /[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/, /[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/, /[\u2C00-\u2DFF\u2E80-\u2FFF]/, /[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/, /[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/, /[\uFE47-\uFEFE\uFF00-\uFFFD]/);
|
|
29916
|
+
var identifierCharacter = either(identifierHead, /\d/, /[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/);
|
|
29917
|
+
var identifier = concat(identifierHead, identifierCharacter, "*");
|
|
29918
|
+
var typeIdentifier = concat(/[A-Z]/, identifierCharacter, "*");
|
|
29919
|
+
var keywordAttributes = [
|
|
29920
|
+
"attached",
|
|
29921
|
+
"autoclosure",
|
|
29922
|
+
concat(/convention\(/, either("swift", "block", "c"), /\)/),
|
|
29923
|
+
"discardableResult",
|
|
29924
|
+
"dynamicCallable",
|
|
29925
|
+
"dynamicMemberLookup",
|
|
29926
|
+
"escaping",
|
|
29927
|
+
"freestanding",
|
|
29928
|
+
"frozen",
|
|
29929
|
+
"GKInspectable",
|
|
29930
|
+
"IBAction",
|
|
29931
|
+
"IBDesignable",
|
|
29932
|
+
"IBInspectable",
|
|
29933
|
+
"IBOutlet",
|
|
29934
|
+
"IBSegueAction",
|
|
29935
|
+
"inlinable",
|
|
29936
|
+
"main",
|
|
29937
|
+
"nonobjc",
|
|
29938
|
+
"NSApplicationMain",
|
|
29939
|
+
"NSCopying",
|
|
29940
|
+
"NSManaged",
|
|
29941
|
+
concat(/objc\(/, identifier, /\)/),
|
|
29942
|
+
"objc",
|
|
29943
|
+
"objcMembers",
|
|
29944
|
+
"propertyWrapper",
|
|
29945
|
+
"requires_stored_property_inits",
|
|
29946
|
+
"resultBuilder",
|
|
29947
|
+
"Sendable",
|
|
29948
|
+
"testable",
|
|
29949
|
+
"UIApplicationMain",
|
|
29950
|
+
"unchecked",
|
|
29951
|
+
"unknown",
|
|
29952
|
+
"usableFromInline",
|
|
29953
|
+
"warn_unqualified_access"
|
|
29954
|
+
];
|
|
29955
|
+
var availabilityKeywords = [
|
|
29956
|
+
"iOS",
|
|
29957
|
+
"iOSApplicationExtension",
|
|
29958
|
+
"macOS",
|
|
29959
|
+
"macOSApplicationExtension",
|
|
29960
|
+
"macCatalyst",
|
|
29961
|
+
"macCatalystApplicationExtension",
|
|
29962
|
+
"watchOS",
|
|
29963
|
+
"watchOSApplicationExtension",
|
|
29964
|
+
"tvOS",
|
|
29965
|
+
"tvOSApplicationExtension",
|
|
29966
|
+
"swift"
|
|
29967
|
+
];
|
|
29968
|
+
function swift(hljs) {
|
|
29969
|
+
const WHITESPACE = {
|
|
29970
|
+
match: /\s+/,
|
|
29971
|
+
relevance: 0
|
|
29972
|
+
};
|
|
29973
|
+
const BLOCK_COMMENT = hljs.COMMENT("/\\*", "\\*/", { contains: ["self"] });
|
|
29974
|
+
const COMMENTS = [
|
|
29975
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
29976
|
+
BLOCK_COMMENT
|
|
29977
|
+
];
|
|
29978
|
+
const DOT_KEYWORD = {
|
|
29979
|
+
match: [
|
|
29980
|
+
/\./,
|
|
29981
|
+
either(...dotKeywords, ...optionalDotKeywords)
|
|
29982
|
+
],
|
|
29983
|
+
className: { 2: "keyword" }
|
|
29984
|
+
};
|
|
29985
|
+
const KEYWORD_GUARD = {
|
|
29986
|
+
match: concat(/\./, either(...keywords)),
|
|
29987
|
+
relevance: 0
|
|
29988
|
+
};
|
|
29989
|
+
const PLAIN_KEYWORDS = keywords.filter((kw) => typeof kw === "string").concat(["_|0"]);
|
|
29990
|
+
const REGEX_KEYWORDS = keywords.filter((kw) => typeof kw !== "string").concat(keywordTypes).map(keywordWrapper);
|
|
29991
|
+
const KEYWORD = { variants: [
|
|
29992
|
+
{
|
|
29993
|
+
className: "keyword",
|
|
29994
|
+
match: either(...REGEX_KEYWORDS, ...optionalDotKeywords)
|
|
29995
|
+
}
|
|
29996
|
+
] };
|
|
29997
|
+
const KEYWORDS2 = {
|
|
29998
|
+
$pattern: either(/\b\w+/, /#\w+/),
|
|
29999
|
+
keyword: PLAIN_KEYWORDS.concat(numberSignKeywords),
|
|
30000
|
+
literal: literals
|
|
30001
|
+
};
|
|
30002
|
+
const KEYWORD_MODES = [
|
|
30003
|
+
DOT_KEYWORD,
|
|
30004
|
+
KEYWORD_GUARD,
|
|
30005
|
+
KEYWORD
|
|
30006
|
+
];
|
|
30007
|
+
const BUILT_IN_GUARD = {
|
|
30008
|
+
match: concat(/\./, either(...builtIns)),
|
|
30009
|
+
relevance: 0
|
|
30010
|
+
};
|
|
30011
|
+
const BUILT_IN = {
|
|
30012
|
+
className: "built_in",
|
|
30013
|
+
match: concat(/\b/, either(...builtIns), /(?=\()/)
|
|
30014
|
+
};
|
|
30015
|
+
const BUILT_INS2 = [
|
|
30016
|
+
BUILT_IN_GUARD,
|
|
30017
|
+
BUILT_IN
|
|
30018
|
+
];
|
|
30019
|
+
const OPERATOR_GUARD = {
|
|
30020
|
+
match: /->/,
|
|
30021
|
+
relevance: 0
|
|
30022
|
+
};
|
|
30023
|
+
const OPERATOR = {
|
|
30024
|
+
className: "operator",
|
|
30025
|
+
relevance: 0,
|
|
30026
|
+
variants: [
|
|
30027
|
+
{ match: operator },
|
|
30028
|
+
{
|
|
30029
|
+
match: `\\.(\\.|${operatorCharacter})+`
|
|
30030
|
+
}
|
|
30031
|
+
]
|
|
30032
|
+
};
|
|
30033
|
+
const OPERATORS = [
|
|
30034
|
+
OPERATOR_GUARD,
|
|
30035
|
+
OPERATOR
|
|
30036
|
+
];
|
|
30037
|
+
const decimalDigits = "([0-9]_*)+";
|
|
30038
|
+
const hexDigits = "([0-9a-fA-F]_*)+";
|
|
30039
|
+
const NUMBER = {
|
|
30040
|
+
className: "number",
|
|
30041
|
+
relevance: 0,
|
|
30042
|
+
variants: [
|
|
30043
|
+
{ match: `\\b(${decimalDigits})(\\.(${decimalDigits}))?` + `([eE][+-]?(${decimalDigits}))?\\b` },
|
|
30044
|
+
{ match: `\\b0x(${hexDigits})(\\.(${hexDigits}))?` + `([pP][+-]?(${decimalDigits}))?\\b` },
|
|
30045
|
+
{ match: /\b0o([0-7]_*)+\b/ },
|
|
30046
|
+
{ match: /\b0b([01]_*)+\b/ }
|
|
30047
|
+
]
|
|
30048
|
+
};
|
|
30049
|
+
const ESCAPED_CHARACTER = (rawDelimiter = "") => ({
|
|
30050
|
+
className: "subst",
|
|
30051
|
+
variants: [
|
|
30052
|
+
{ match: concat(/\\/, rawDelimiter, /[0\\tnr"']/) },
|
|
30053
|
+
{ match: concat(/\\/, rawDelimiter, /u\{[0-9a-fA-F]{1,8}\}/) }
|
|
30054
|
+
]
|
|
30055
|
+
});
|
|
30056
|
+
const ESCAPED_NEWLINE = (rawDelimiter = "") => ({
|
|
30057
|
+
className: "subst",
|
|
30058
|
+
match: concat(/\\/, rawDelimiter, /[\t ]*(?:[\r\n]|\r\n)/)
|
|
30059
|
+
});
|
|
30060
|
+
const INTERPOLATION = (rawDelimiter = "") => ({
|
|
30061
|
+
className: "subst",
|
|
30062
|
+
label: "interpol",
|
|
30063
|
+
begin: concat(/\\/, rawDelimiter, /\(/),
|
|
30064
|
+
end: /\)/
|
|
30065
|
+
});
|
|
30066
|
+
const MULTILINE_STRING = (rawDelimiter = "") => ({
|
|
30067
|
+
begin: concat(rawDelimiter, /"""/),
|
|
30068
|
+
end: concat(/"""/, rawDelimiter),
|
|
30069
|
+
contains: [
|
|
30070
|
+
ESCAPED_CHARACTER(rawDelimiter),
|
|
30071
|
+
ESCAPED_NEWLINE(rawDelimiter),
|
|
30072
|
+
INTERPOLATION(rawDelimiter)
|
|
30073
|
+
]
|
|
30074
|
+
});
|
|
30075
|
+
const SINGLE_LINE_STRING = (rawDelimiter = "") => ({
|
|
30076
|
+
begin: concat(rawDelimiter, /"/),
|
|
30077
|
+
end: concat(/"/, rawDelimiter),
|
|
30078
|
+
contains: [
|
|
30079
|
+
ESCAPED_CHARACTER(rawDelimiter),
|
|
30080
|
+
INTERPOLATION(rawDelimiter)
|
|
30081
|
+
]
|
|
30082
|
+
});
|
|
30083
|
+
const STRING = {
|
|
30084
|
+
className: "string",
|
|
30085
|
+
variants: [
|
|
30086
|
+
MULTILINE_STRING(),
|
|
30087
|
+
MULTILINE_STRING("#"),
|
|
30088
|
+
MULTILINE_STRING("##"),
|
|
30089
|
+
MULTILINE_STRING("###"),
|
|
30090
|
+
SINGLE_LINE_STRING(),
|
|
30091
|
+
SINGLE_LINE_STRING("#"),
|
|
30092
|
+
SINGLE_LINE_STRING("##"),
|
|
30093
|
+
SINGLE_LINE_STRING("###")
|
|
30094
|
+
]
|
|
30095
|
+
};
|
|
30096
|
+
const REGEXP_CONTENTS = [
|
|
30097
|
+
hljs.BACKSLASH_ESCAPE,
|
|
30098
|
+
{
|
|
30099
|
+
begin: /\[/,
|
|
30100
|
+
end: /\]/,
|
|
30101
|
+
relevance: 0,
|
|
30102
|
+
contains: [hljs.BACKSLASH_ESCAPE]
|
|
30103
|
+
}
|
|
30104
|
+
];
|
|
30105
|
+
const BARE_REGEXP_LITERAL = {
|
|
30106
|
+
begin: /\/[^\s](?=[^/\n]*\/)/,
|
|
30107
|
+
end: /\//,
|
|
30108
|
+
contains: REGEXP_CONTENTS
|
|
30109
|
+
};
|
|
30110
|
+
const EXTENDED_REGEXP_LITERAL = (rawDelimiter) => {
|
|
30111
|
+
const begin = concat(rawDelimiter, /\//);
|
|
30112
|
+
const end = concat(/\//, rawDelimiter);
|
|
30113
|
+
return {
|
|
30114
|
+
begin,
|
|
30115
|
+
end,
|
|
30116
|
+
contains: [
|
|
30117
|
+
...REGEXP_CONTENTS,
|
|
30118
|
+
{
|
|
30119
|
+
scope: "comment",
|
|
30120
|
+
begin: `#(?!.*${end})`,
|
|
30121
|
+
end: /$/
|
|
30122
|
+
}
|
|
30123
|
+
]
|
|
30124
|
+
};
|
|
30125
|
+
};
|
|
30126
|
+
const REGEXP = {
|
|
30127
|
+
scope: "regexp",
|
|
30128
|
+
variants: [
|
|
30129
|
+
EXTENDED_REGEXP_LITERAL("###"),
|
|
30130
|
+
EXTENDED_REGEXP_LITERAL("##"),
|
|
30131
|
+
EXTENDED_REGEXP_LITERAL("#"),
|
|
30132
|
+
BARE_REGEXP_LITERAL
|
|
30133
|
+
]
|
|
30134
|
+
};
|
|
30135
|
+
const QUOTED_IDENTIFIER = { match: concat(/`/, identifier, /`/) };
|
|
30136
|
+
const IMPLICIT_PARAMETER = {
|
|
30137
|
+
className: "variable",
|
|
30138
|
+
match: /\$\d+/
|
|
30139
|
+
};
|
|
30140
|
+
const PROPERTY_WRAPPER_PROJECTION = {
|
|
30141
|
+
className: "variable",
|
|
30142
|
+
match: `\\$${identifierCharacter}+`
|
|
30143
|
+
};
|
|
30144
|
+
const IDENTIFIERS = [
|
|
30145
|
+
QUOTED_IDENTIFIER,
|
|
30146
|
+
IMPLICIT_PARAMETER,
|
|
30147
|
+
PROPERTY_WRAPPER_PROJECTION
|
|
30148
|
+
];
|
|
30149
|
+
const AVAILABLE_ATTRIBUTE = {
|
|
30150
|
+
match: /(@|#(un)?)available/,
|
|
30151
|
+
scope: "keyword",
|
|
30152
|
+
starts: { contains: [
|
|
30153
|
+
{
|
|
30154
|
+
begin: /\(/,
|
|
30155
|
+
end: /\)/,
|
|
30156
|
+
keywords: availabilityKeywords,
|
|
30157
|
+
contains: [
|
|
30158
|
+
...OPERATORS,
|
|
30159
|
+
NUMBER,
|
|
30160
|
+
STRING
|
|
30161
|
+
]
|
|
30162
|
+
}
|
|
30163
|
+
] }
|
|
30164
|
+
};
|
|
30165
|
+
const KEYWORD_ATTRIBUTE = {
|
|
30166
|
+
scope: "keyword",
|
|
30167
|
+
match: concat(/@/, either(...keywordAttributes), lookahead(either(/\(/, /\s+/)))
|
|
30168
|
+
};
|
|
30169
|
+
const USER_DEFINED_ATTRIBUTE = {
|
|
30170
|
+
scope: "meta",
|
|
30171
|
+
match: concat(/@/, identifier)
|
|
30172
|
+
};
|
|
30173
|
+
const ATTRIBUTES = [
|
|
30174
|
+
AVAILABLE_ATTRIBUTE,
|
|
30175
|
+
KEYWORD_ATTRIBUTE,
|
|
30176
|
+
USER_DEFINED_ATTRIBUTE
|
|
30177
|
+
];
|
|
30178
|
+
const TYPE = {
|
|
30179
|
+
match: lookahead(/\b[A-Z]/),
|
|
30180
|
+
relevance: 0,
|
|
30181
|
+
contains: [
|
|
30182
|
+
{
|
|
30183
|
+
className: "type",
|
|
30184
|
+
match: concat(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/, identifierCharacter, "+")
|
|
30185
|
+
},
|
|
30186
|
+
{
|
|
30187
|
+
className: "type",
|
|
30188
|
+
match: typeIdentifier,
|
|
30189
|
+
relevance: 0
|
|
30190
|
+
},
|
|
30191
|
+
{
|
|
30192
|
+
match: /[?!]+/,
|
|
30193
|
+
relevance: 0
|
|
30194
|
+
},
|
|
30195
|
+
{
|
|
30196
|
+
match: /\.\.\./,
|
|
30197
|
+
relevance: 0
|
|
30198
|
+
},
|
|
30199
|
+
{
|
|
30200
|
+
match: concat(/\s+&\s+/, lookahead(typeIdentifier)),
|
|
30201
|
+
relevance: 0
|
|
30202
|
+
}
|
|
30203
|
+
]
|
|
30204
|
+
};
|
|
30205
|
+
const GENERIC_ARGUMENTS = {
|
|
30206
|
+
begin: /</,
|
|
30207
|
+
end: />/,
|
|
30208
|
+
keywords: KEYWORDS2,
|
|
30209
|
+
contains: [
|
|
30210
|
+
...COMMENTS,
|
|
30211
|
+
...KEYWORD_MODES,
|
|
30212
|
+
...ATTRIBUTES,
|
|
30213
|
+
OPERATOR_GUARD,
|
|
30214
|
+
TYPE
|
|
30215
|
+
]
|
|
30216
|
+
};
|
|
30217
|
+
TYPE.contains.push(GENERIC_ARGUMENTS);
|
|
30218
|
+
const TUPLE_ELEMENT_NAME = {
|
|
30219
|
+
match: concat(identifier, /\s*:/),
|
|
30220
|
+
keywords: "_|0",
|
|
30221
|
+
relevance: 0
|
|
30222
|
+
};
|
|
30223
|
+
const TUPLE = {
|
|
30224
|
+
begin: /\(/,
|
|
30225
|
+
end: /\)/,
|
|
30226
|
+
relevance: 0,
|
|
30227
|
+
keywords: KEYWORDS2,
|
|
30228
|
+
contains: [
|
|
30229
|
+
"self",
|
|
30230
|
+
TUPLE_ELEMENT_NAME,
|
|
30231
|
+
...COMMENTS,
|
|
30232
|
+
REGEXP,
|
|
30233
|
+
...KEYWORD_MODES,
|
|
30234
|
+
...BUILT_INS2,
|
|
30235
|
+
...OPERATORS,
|
|
30236
|
+
NUMBER,
|
|
30237
|
+
STRING,
|
|
30238
|
+
...IDENTIFIERS,
|
|
30239
|
+
...ATTRIBUTES,
|
|
30240
|
+
TYPE
|
|
30241
|
+
]
|
|
30242
|
+
};
|
|
30243
|
+
const GENERIC_PARAMETERS = {
|
|
30244
|
+
begin: /</,
|
|
30245
|
+
end: />/,
|
|
30246
|
+
keywords: "repeat each",
|
|
30247
|
+
contains: [
|
|
30248
|
+
...COMMENTS,
|
|
30249
|
+
TYPE
|
|
30250
|
+
]
|
|
30251
|
+
};
|
|
30252
|
+
const FUNCTION_PARAMETER_NAME = {
|
|
30253
|
+
begin: either(lookahead(concat(identifier, /\s*:/)), lookahead(concat(identifier, /\s+/, identifier, /\s*:/))),
|
|
30254
|
+
end: /:/,
|
|
30255
|
+
relevance: 0,
|
|
30256
|
+
contains: [
|
|
30257
|
+
{
|
|
30258
|
+
className: "keyword",
|
|
30259
|
+
match: /\b_\b/
|
|
30260
|
+
},
|
|
30261
|
+
{
|
|
30262
|
+
className: "params",
|
|
30263
|
+
match: identifier
|
|
30264
|
+
}
|
|
30265
|
+
]
|
|
30266
|
+
};
|
|
30267
|
+
const FUNCTION_PARAMETERS = {
|
|
30268
|
+
begin: /\(/,
|
|
30269
|
+
end: /\)/,
|
|
30270
|
+
keywords: KEYWORDS2,
|
|
30271
|
+
contains: [
|
|
30272
|
+
FUNCTION_PARAMETER_NAME,
|
|
30273
|
+
...COMMENTS,
|
|
30274
|
+
...KEYWORD_MODES,
|
|
30275
|
+
...OPERATORS,
|
|
30276
|
+
NUMBER,
|
|
30277
|
+
STRING,
|
|
30278
|
+
...ATTRIBUTES,
|
|
30279
|
+
TYPE,
|
|
30280
|
+
TUPLE
|
|
30281
|
+
],
|
|
30282
|
+
endsParent: true,
|
|
30283
|
+
illegal: /["']/
|
|
30284
|
+
};
|
|
30285
|
+
const FUNCTION_OR_MACRO = {
|
|
30286
|
+
match: [
|
|
30287
|
+
/(func|macro)/,
|
|
30288
|
+
/\s+/,
|
|
30289
|
+
either(QUOTED_IDENTIFIER.match, identifier, operator)
|
|
30290
|
+
],
|
|
30291
|
+
className: {
|
|
30292
|
+
1: "keyword",
|
|
30293
|
+
3: "title.function"
|
|
30294
|
+
},
|
|
30295
|
+
contains: [
|
|
30296
|
+
GENERIC_PARAMETERS,
|
|
30297
|
+
FUNCTION_PARAMETERS,
|
|
30298
|
+
WHITESPACE
|
|
30299
|
+
],
|
|
30300
|
+
illegal: [
|
|
30301
|
+
/\[/,
|
|
30302
|
+
/%/
|
|
30303
|
+
]
|
|
30304
|
+
};
|
|
30305
|
+
const INIT_SUBSCRIPT = {
|
|
30306
|
+
match: [
|
|
30307
|
+
/\b(?:subscript|init[?!]?)/,
|
|
30308
|
+
/\s*(?=[<(])/
|
|
30309
|
+
],
|
|
30310
|
+
className: { 1: "keyword" },
|
|
30311
|
+
contains: [
|
|
30312
|
+
GENERIC_PARAMETERS,
|
|
30313
|
+
FUNCTION_PARAMETERS,
|
|
30314
|
+
WHITESPACE
|
|
30315
|
+
],
|
|
30316
|
+
illegal: /\[|%/
|
|
30317
|
+
};
|
|
30318
|
+
const OPERATOR_DECLARATION = {
|
|
30319
|
+
match: [
|
|
30320
|
+
/operator/,
|
|
30321
|
+
/\s+/,
|
|
30322
|
+
operator
|
|
30323
|
+
],
|
|
30324
|
+
className: {
|
|
30325
|
+
1: "keyword",
|
|
30326
|
+
3: "title"
|
|
30327
|
+
}
|
|
30328
|
+
};
|
|
30329
|
+
const PRECEDENCEGROUP = {
|
|
30330
|
+
begin: [
|
|
30331
|
+
/precedencegroup/,
|
|
30332
|
+
/\s+/,
|
|
30333
|
+
typeIdentifier
|
|
30334
|
+
],
|
|
30335
|
+
className: {
|
|
30336
|
+
1: "keyword",
|
|
30337
|
+
3: "title"
|
|
30338
|
+
},
|
|
30339
|
+
contains: [TYPE],
|
|
30340
|
+
keywords: [
|
|
30341
|
+
...precedencegroupKeywords,
|
|
30342
|
+
...literals
|
|
30343
|
+
],
|
|
30344
|
+
end: /}/
|
|
30345
|
+
};
|
|
30346
|
+
const CLASS_FUNC_DECLARATION = {
|
|
30347
|
+
match: [
|
|
30348
|
+
/class\b/,
|
|
30349
|
+
/\s+/,
|
|
30350
|
+
/func\b/,
|
|
30351
|
+
/\s+/,
|
|
30352
|
+
/\b[A-Za-z_][A-Za-z0-9_]*\b/
|
|
30353
|
+
],
|
|
30354
|
+
scope: {
|
|
30355
|
+
1: "keyword",
|
|
30356
|
+
3: "keyword",
|
|
30357
|
+
5: "title.function"
|
|
30358
|
+
}
|
|
30359
|
+
};
|
|
30360
|
+
const CLASS_VAR_DECLARATION = {
|
|
30361
|
+
match: [
|
|
30362
|
+
/class\b/,
|
|
30363
|
+
/\s+/,
|
|
30364
|
+
/var\b/
|
|
30365
|
+
],
|
|
30366
|
+
scope: {
|
|
30367
|
+
1: "keyword",
|
|
30368
|
+
3: "keyword"
|
|
30369
|
+
}
|
|
30370
|
+
};
|
|
30371
|
+
const TYPE_DECLARATION = {
|
|
30372
|
+
begin: [
|
|
30373
|
+
/(struct|protocol|class|extension|enum|actor)/,
|
|
30374
|
+
/\s+/,
|
|
30375
|
+
identifier,
|
|
30376
|
+
/\s*/
|
|
30377
|
+
],
|
|
30378
|
+
beginScope: {
|
|
30379
|
+
1: "keyword",
|
|
30380
|
+
3: "title.class"
|
|
30381
|
+
},
|
|
30382
|
+
keywords: KEYWORDS2,
|
|
30383
|
+
contains: [
|
|
30384
|
+
GENERIC_PARAMETERS,
|
|
30385
|
+
...KEYWORD_MODES,
|
|
30386
|
+
{
|
|
30387
|
+
begin: /:/,
|
|
30388
|
+
end: /\{/,
|
|
30389
|
+
keywords: KEYWORDS2,
|
|
30390
|
+
contains: [
|
|
30391
|
+
{
|
|
30392
|
+
scope: "title.class.inherited",
|
|
30393
|
+
match: typeIdentifier
|
|
30394
|
+
},
|
|
30395
|
+
...KEYWORD_MODES
|
|
30396
|
+
],
|
|
30397
|
+
relevance: 0
|
|
30398
|
+
}
|
|
30399
|
+
]
|
|
30400
|
+
};
|
|
30401
|
+
for (const variant of STRING.variants) {
|
|
30402
|
+
const interpolation = variant.contains.find((mode) => mode.label === "interpol");
|
|
30403
|
+
interpolation.keywords = KEYWORDS2;
|
|
30404
|
+
const submodes = [
|
|
30405
|
+
...KEYWORD_MODES,
|
|
30406
|
+
...BUILT_INS2,
|
|
30407
|
+
...OPERATORS,
|
|
30408
|
+
NUMBER,
|
|
30409
|
+
STRING,
|
|
30410
|
+
...IDENTIFIERS
|
|
30411
|
+
];
|
|
30412
|
+
interpolation.contains = [
|
|
30413
|
+
...submodes,
|
|
30414
|
+
{
|
|
30415
|
+
begin: /\(/,
|
|
30416
|
+
end: /\)/,
|
|
30417
|
+
contains: [
|
|
30418
|
+
"self",
|
|
30419
|
+
...submodes
|
|
30420
|
+
]
|
|
30421
|
+
}
|
|
30422
|
+
];
|
|
30423
|
+
}
|
|
30424
|
+
return {
|
|
30425
|
+
name: "Swift",
|
|
30426
|
+
keywords: KEYWORDS2,
|
|
30427
|
+
contains: [
|
|
30428
|
+
...COMMENTS,
|
|
30429
|
+
FUNCTION_OR_MACRO,
|
|
30430
|
+
INIT_SUBSCRIPT,
|
|
30431
|
+
CLASS_FUNC_DECLARATION,
|
|
30432
|
+
CLASS_VAR_DECLARATION,
|
|
30433
|
+
TYPE_DECLARATION,
|
|
30434
|
+
OPERATOR_DECLARATION,
|
|
30435
|
+
PRECEDENCEGROUP,
|
|
30436
|
+
{
|
|
30437
|
+
beginKeywords: "import",
|
|
30438
|
+
end: /$/,
|
|
30439
|
+
contains: [...COMMENTS],
|
|
30440
|
+
relevance: 0
|
|
30441
|
+
},
|
|
30442
|
+
REGEXP,
|
|
30443
|
+
...KEYWORD_MODES,
|
|
30444
|
+
...BUILT_INS2,
|
|
30445
|
+
...OPERATORS,
|
|
30446
|
+
NUMBER,
|
|
30447
|
+
STRING,
|
|
30448
|
+
...IDENTIFIERS,
|
|
30449
|
+
...ATTRIBUTES,
|
|
30450
|
+
TYPE,
|
|
30451
|
+
TUPLE
|
|
30452
|
+
]
|
|
30453
|
+
};
|
|
30454
|
+
}
|
|
30455
|
+
|
|
29703
30456
|
// node_modules/highlight.js/es/languages/typescript.js
|
|
29704
30457
|
var IDENT_RE2 = "[A-Za-z$_][0-9A-Za-z$_]*";
|
|
29705
30458
|
var KEYWORDS2 = [
|
|
@@ -30607,99 +31360,100 @@ function xml(hljs) {
|
|
|
30607
31360
|
function L() {
|
|
30608
31361
|
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
30609
31362
|
}
|
|
30610
|
-
var
|
|
30611
|
-
function
|
|
30612
|
-
|
|
31363
|
+
var T = L();
|
|
31364
|
+
function G(u) {
|
|
31365
|
+
T = u;
|
|
30613
31366
|
}
|
|
30614
|
-
var
|
|
30615
|
-
function
|
|
30616
|
-
let t = typeof
|
|
31367
|
+
var I = { exec: () => null };
|
|
31368
|
+
function d(u, e = "") {
|
|
31369
|
+
let t = typeof u == "string" ? u : u.source, n = { replace: (r, i) => {
|
|
30617
31370
|
let s = typeof i == "string" ? i : i.source;
|
|
30618
31371
|
return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
|
|
30619
31372
|
}, getRegex: () => new RegExp(t, e) };
|
|
30620
31373
|
return n;
|
|
30621
31374
|
}
|
|
30622
|
-
var m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (
|
|
30623
|
-
var
|
|
30624
|
-
var
|
|
30625
|
-
var
|
|
30626
|
-
var
|
|
31375
|
+
var m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (u) => new RegExp(`^( {0,3}${u})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}#`), htmlBeginRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}<(?:[a-z].*>|!--)`, "i") };
|
|
31376
|
+
var be = /^(?:[ \t]*(?:\n|$))+/;
|
|
31377
|
+
var Re = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
|
|
31378
|
+
var Te = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
|
|
31379
|
+
var E = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
|
30627
31380
|
var Oe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
|
30628
|
-
var
|
|
30629
|
-
var
|
|
30630
|
-
var
|
|
30631
|
-
var
|
|
30632
|
-
var
|
|
30633
|
-
var
|
|
31381
|
+
var F = /(?:[*+-]|\d{1,9}[.)])/;
|
|
31382
|
+
var ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
|
|
31383
|
+
var oe = d(ie).replace(/bull/g, F).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
|
|
31384
|
+
var we = d(ie).replace(/bull/g, F).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
|
|
31385
|
+
var j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
|
|
31386
|
+
var ye = /^[^\n]+/;
|
|
30634
31387
|
var Q = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
|
|
30635
|
-
var
|
|
30636
|
-
var
|
|
31388
|
+
var Pe = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
|
|
31389
|
+
var Se = d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, F).getRegex();
|
|
30637
31390
|
var v = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
|
|
30638
31391
|
var U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
|
|
30639
|
-
var
|
|
30640
|
-
var
|
|
30641
|
-
var
|
|
30642
|
-
var K = { blockquote:
|
|
30643
|
-
var re =
|
|
30644
|
-
var
|
|
30645
|
-
var
|
|
30646
|
-
]`).replace("lheading",
|
|
30647
|
-
var
|
|
30648
|
-
var
|
|
30649
|
-
var
|
|
30650
|
-
var
|
|
31392
|
+
var $e = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
|
|
31393
|
+
var ae = d(j).replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex();
|
|
31394
|
+
var _e = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex();
|
|
31395
|
+
var K = { blockquote: _e, code: Re, def: Pe, fences: Te, heading: Oe, hr: E, html: $e, lheading: oe, list: Se, newline: be, paragraph: ae, table: I, text: ye };
|
|
31396
|
+
var re = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3}\t)[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex();
|
|
31397
|
+
var Le = { ...K, lheading: we, table: re, paragraph: d(j).replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex() };
|
|
31398
|
+
var Me = { ...K, html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: I, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d(j).replace("hr", E).replace("heading", ` *#{1,6} *[^
|
|
31399
|
+
]`).replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
|
|
31400
|
+
var ze = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
|
|
31401
|
+
var Ae = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
|
|
31402
|
+
var le = /^( {2,}|\\)\n(?!\s*$)/;
|
|
31403
|
+
var Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
|
|
30651
31404
|
var D = /[\p{P}\p{S}]/u;
|
|
30652
31405
|
var W = /[\s\p{P}\p{S}]/u;
|
|
30653
|
-
var
|
|
30654
|
-
var Ee =
|
|
30655
|
-
var
|
|
31406
|
+
var ue = /[^\s\p{P}\p{S}]/u;
|
|
31407
|
+
var Ee = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex();
|
|
31408
|
+
var pe = /(?!~)[\p{P}\p{S}]/u;
|
|
30656
31409
|
var Ce = /(?!~)[\s\p{P}\p{S}]/u;
|
|
30657
|
-
var
|
|
30658
|
-
var
|
|
30659
|
-
var
|
|
30660
|
-
var
|
|
30661
|
-
var
|
|
30662
|
-
var
|
|
30663
|
-
var
|
|
30664
|
-
var Ze =
|
|
30665
|
-
var Ge =
|
|
30666
|
-
var
|
|
30667
|
-
var
|
|
30668
|
-
var je =
|
|
30669
|
-
var
|
|
30670
|
-
var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]
|
|
30671
|
-
var
|
|
30672
|
-
var
|
|
30673
|
-
var
|
|
30674
|
-
var
|
|
30675
|
-
var
|
|
30676
|
-
var
|
|
30677
|
-
var
|
|
30678
|
-
var
|
|
30679
|
-
var
|
|
30680
|
-
var
|
|
30681
|
-
var
|
|
30682
|
-
var
|
|
30683
|
-
|
|
31410
|
+
var Be = /(?:[^\s\p{P}\p{S}]|~)/u;
|
|
31411
|
+
var qe = /\[(?:[^\[\]`]|`[^`]*?`)*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g;
|
|
31412
|
+
var ce = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
|
|
31413
|
+
var ve = d(ce, "u").replace(/punct/g, D).getRegex();
|
|
31414
|
+
var De = d(ce, "u").replace(/punct/g, pe).getRegex();
|
|
31415
|
+
var he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
|
|
31416
|
+
var He = d(he, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex();
|
|
31417
|
+
var Ze = d(he, "gu").replace(/notPunctSpace/g, Be).replace(/punctSpace/g, Ce).replace(/punct/g, pe).getRegex();
|
|
31418
|
+
var Ge = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex();
|
|
31419
|
+
var Ne = d(/\\(punct)/, "gu").replace(/punct/g, D).getRegex();
|
|
31420
|
+
var Fe = d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
|
|
31421
|
+
var je = d(U).replace("(?:-->|$)", "-->").getRegex();
|
|
31422
|
+
var Qe = d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
|
|
31423
|
+
var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/;
|
|
31424
|
+
var Ue = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
|
|
31425
|
+
var de = d(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex();
|
|
31426
|
+
var ke = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex();
|
|
31427
|
+
var Ke = d("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", ke).getRegex();
|
|
31428
|
+
var se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
|
|
31429
|
+
var X = { _backpedal: I, anyPunctuation: Ne, autolink: Fe, blockSkip: qe, br: le, code: Ae, del: I, emStrongLDelim: ve, emStrongRDelimAst: He, emStrongRDelimUnd: Ge, escape: ze, link: Ue, nolink: ke, punctuation: Ee, reflink: de, reflinkSearch: Ke, tag: Qe, text: Ie, url: I };
|
|
31430
|
+
var We = { ...X, link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() };
|
|
31431
|
+
var N = { ...X, emStrongRDelimAst: Ze, emStrongLDelim: De, url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex() };
|
|
31432
|
+
var Xe = { ...N, br: d(le).replace("{2,}", "*").getRegex(), text: d(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
|
|
31433
|
+
var C = { normal: K, gfm: Le, pedantic: Me };
|
|
31434
|
+
var M = { normal: X, gfm: N, breaks: Xe, pedantic: We };
|
|
31435
|
+
var Je = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
31436
|
+
var ge = (u) => Je[u];
|
|
31437
|
+
function w(u, e) {
|
|
30684
31438
|
if (e) {
|
|
30685
|
-
if (m.escapeTest.test(
|
|
30686
|
-
return
|
|
30687
|
-
} else if (m.escapeTestNoEncode.test(
|
|
30688
|
-
return
|
|
30689
|
-
return
|
|
31439
|
+
if (m.escapeTest.test(u))
|
|
31440
|
+
return u.replace(m.escapeReplace, ge);
|
|
31441
|
+
} else if (m.escapeTestNoEncode.test(u))
|
|
31442
|
+
return u.replace(m.escapeReplaceNoEncode, ge);
|
|
31443
|
+
return u;
|
|
30690
31444
|
}
|
|
30691
|
-
function J(
|
|
31445
|
+
function J(u) {
|
|
30692
31446
|
try {
|
|
30693
|
-
|
|
31447
|
+
u = encodeURI(u).replace(m.percentDecode, "%");
|
|
30694
31448
|
} catch {
|
|
30695
31449
|
return null;
|
|
30696
31450
|
}
|
|
30697
|
-
return
|
|
31451
|
+
return u;
|
|
30698
31452
|
}
|
|
30699
|
-
function V(
|
|
30700
|
-
let t =
|
|
30701
|
-
let a = false,
|
|
30702
|
-
for (;--
|
|
31453
|
+
function V(u, e) {
|
|
31454
|
+
let t = u.replace(m.findPipe, (i, s, o) => {
|
|
31455
|
+
let a = false, l = s;
|
|
31456
|
+
for (;--l >= 0 && o[l] === "\\"; )
|
|
30703
31457
|
a = !a;
|
|
30704
31458
|
return a ? "|" : " |";
|
|
30705
31459
|
}), n = t.split(m.splitPipe), r = 0;
|
|
@@ -30713,13 +31467,13 @@ function V(l, e) {
|
|
|
30713
31467
|
n[r] = n[r].trim().replace(m.slashPipe, "|");
|
|
30714
31468
|
return n;
|
|
30715
31469
|
}
|
|
30716
|
-
function z(
|
|
30717
|
-
let n =
|
|
31470
|
+
function z(u, e, t) {
|
|
31471
|
+
let n = u.length;
|
|
30718
31472
|
if (n === 0)
|
|
30719
31473
|
return "";
|
|
30720
31474
|
let r = 0;
|
|
30721
31475
|
for (;r < n; ) {
|
|
30722
|
-
let i =
|
|
31476
|
+
let i = u.charAt(n - r - 1);
|
|
30723
31477
|
if (i === e && !t)
|
|
30724
31478
|
r++;
|
|
30725
31479
|
else if (i !== e && t)
|
|
@@ -30727,29 +31481,29 @@ function z(l, e, t) {
|
|
|
30727
31481
|
else
|
|
30728
31482
|
break;
|
|
30729
31483
|
}
|
|
30730
|
-
return
|
|
31484
|
+
return u.slice(0, n - r);
|
|
30731
31485
|
}
|
|
30732
|
-
function
|
|
30733
|
-
if (
|
|
31486
|
+
function fe(u, e) {
|
|
31487
|
+
if (u.indexOf(e[1]) === -1)
|
|
30734
31488
|
return -1;
|
|
30735
31489
|
let t = 0;
|
|
30736
|
-
for (let n = 0;n <
|
|
30737
|
-
if (
|
|
31490
|
+
for (let n = 0;n < u.length; n++)
|
|
31491
|
+
if (u[n] === "\\")
|
|
30738
31492
|
n++;
|
|
30739
|
-
else if (
|
|
31493
|
+
else if (u[n] === e[0])
|
|
30740
31494
|
t++;
|
|
30741
|
-
else if (
|
|
31495
|
+
else if (u[n] === e[1] && (t--, t < 0))
|
|
30742
31496
|
return n;
|
|
30743
31497
|
return t > 0 ? -2 : -1;
|
|
30744
31498
|
}
|
|
30745
|
-
function
|
|
30746
|
-
let i = e.href, s = e.title || null, o =
|
|
31499
|
+
function me(u, e, t, n, r) {
|
|
31500
|
+
let i = e.href, s = e.title || null, o = u[1].replace(r.other.outputLinkReplace, "$1");
|
|
30747
31501
|
n.state.inLink = true;
|
|
30748
|
-
let a = { type:
|
|
31502
|
+
let a = { type: u[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: o, tokens: n.inlineTokens(o) };
|
|
30749
31503
|
return n.state.inLink = false, a;
|
|
30750
31504
|
}
|
|
30751
|
-
function
|
|
30752
|
-
let n =
|
|
31505
|
+
function Ve(u, e, t) {
|
|
31506
|
+
let n = u.match(t.other.indentCodeCompensation);
|
|
30753
31507
|
if (n === null)
|
|
30754
31508
|
return e;
|
|
30755
31509
|
let r = n[1];
|
|
@@ -30768,7 +31522,7 @@ var y = class {
|
|
|
30768
31522
|
rules;
|
|
30769
31523
|
lexer;
|
|
30770
31524
|
constructor(e) {
|
|
30771
|
-
this.options = e ||
|
|
31525
|
+
this.options = e || T;
|
|
30772
31526
|
}
|
|
30773
31527
|
space(e) {
|
|
30774
31528
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -30786,7 +31540,7 @@ var y = class {
|
|
|
30786
31540
|
fences(e) {
|
|
30787
31541
|
let t = this.rules.block.fences.exec(e);
|
|
30788
31542
|
if (t) {
|
|
30789
|
-
let n = t[0], r =
|
|
31543
|
+
let n = t[0], r = Ve(n, t[3] || "", this.rules);
|
|
30790
31544
|
return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
|
|
30791
31545
|
}
|
|
30792
31546
|
}
|
|
@@ -30814,38 +31568,38 @@ var y = class {
|
|
|
30814
31568
|
`).split(`
|
|
30815
31569
|
`), r = "", i = "", s = [];
|
|
30816
31570
|
for (;n.length > 0; ) {
|
|
30817
|
-
let o = false, a = [],
|
|
30818
|
-
for (
|
|
30819
|
-
if (this.rules.other.blockquoteStart.test(n[
|
|
30820
|
-
a.push(n[
|
|
31571
|
+
let o = false, a = [], l;
|
|
31572
|
+
for (l = 0;l < n.length; l++)
|
|
31573
|
+
if (this.rules.other.blockquoteStart.test(n[l]))
|
|
31574
|
+
a.push(n[l]), o = true;
|
|
30821
31575
|
else if (!o)
|
|
30822
|
-
a.push(n[
|
|
31576
|
+
a.push(n[l]);
|
|
30823
31577
|
else
|
|
30824
31578
|
break;
|
|
30825
|
-
n = n.slice(
|
|
30826
|
-
let
|
|
30827
|
-
`),
|
|
31579
|
+
n = n.slice(l);
|
|
31580
|
+
let c = a.join(`
|
|
31581
|
+
`), p = c.replace(this.rules.other.blockquoteSetextReplace, `
|
|
30828
31582
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
30829
31583
|
r = r ? `${r}
|
|
30830
|
-
${
|
|
30831
|
-
${
|
|
30832
|
-
let
|
|
30833
|
-
if (this.lexer.state.top = true, this.lexer.blockTokens(
|
|
31584
|
+
${c}` : c, i = i ? `${i}
|
|
31585
|
+
${p}` : p;
|
|
31586
|
+
let g = this.lexer.state.top;
|
|
31587
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(p, s, true), this.lexer.state.top = g, n.length === 0)
|
|
30834
31588
|
break;
|
|
30835
|
-
let
|
|
30836
|
-
if (
|
|
31589
|
+
let h = s.at(-1);
|
|
31590
|
+
if (h?.type === "code")
|
|
30837
31591
|
break;
|
|
30838
|
-
if (
|
|
30839
|
-
let
|
|
31592
|
+
if (h?.type === "blockquote") {
|
|
31593
|
+
let R = h, f = R.raw + `
|
|
30840
31594
|
` + n.join(`
|
|
30841
|
-
`),
|
|
30842
|
-
s[s.length - 1] =
|
|
31595
|
+
`), O = this.blockquote(f);
|
|
31596
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - R.raw.length) + O.raw, i = i.substring(0, i.length - R.text.length) + O.text;
|
|
30843
31597
|
break;
|
|
30844
|
-
} else if (
|
|
30845
|
-
let
|
|
31598
|
+
} else if (h?.type === "list") {
|
|
31599
|
+
let R = h, f = R.raw + `
|
|
30846
31600
|
` + n.join(`
|
|
30847
|
-
`),
|
|
30848
|
-
s[s.length - 1] =
|
|
31601
|
+
`), O = this.list(f);
|
|
31602
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - h.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
|
|
30849
31603
|
`);
|
|
30850
31604
|
continue;
|
|
30851
31605
|
}
|
|
@@ -30860,37 +31614,37 @@ ${c}` : c;
|
|
|
30860
31614
|
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
30861
31615
|
let s = this.rules.other.listItemRegex(n), o = false;
|
|
30862
31616
|
for (;e; ) {
|
|
30863
|
-
let
|
|
31617
|
+
let l = false, c = "", p = "";
|
|
30864
31618
|
if (!(t = s.exec(e)) || this.rules.block.hr.test(e))
|
|
30865
31619
|
break;
|
|
30866
|
-
|
|
30867
|
-
let
|
|
30868
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs, (
|
|
30869
|
-
`, 1)[0],
|
|
30870
|
-
if (this.options.pedantic ? (
|
|
30871
|
-
`, e = e.substring(
|
|
30872
|
-
let
|
|
31620
|
+
c = t[0], e = e.substring(c.length);
|
|
31621
|
+
let g = t[2].split(`
|
|
31622
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)), h = e.split(`
|
|
31623
|
+
`, 1)[0], R = !g.trim(), f = 0;
|
|
31624
|
+
if (this.options.pedantic ? (f = 2, p = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, p = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (c += h + `
|
|
31625
|
+
`, e = e.substring(h.length + 1), l = true), !l) {
|
|
31626
|
+
let H = this.rules.other.nextBulletRegex(f), ee = this.rules.other.hrRegex(f), te = this.rules.other.fencesBeginRegex(f), ne = this.rules.other.headingBeginRegex(f), xe = this.rules.other.htmlBeginRegex(f);
|
|
30873
31627
|
for (;e; ) {
|
|
30874
|
-
let
|
|
31628
|
+
let Z = e.split(`
|
|
30875
31629
|
`, 1)[0], A;
|
|
30876
|
-
if (
|
|
31630
|
+
if (h = Z, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), A = h) : A = h.replace(this.rules.other.tabCharGlobal, " "), te.test(h) || ne.test(h) || xe.test(h) || H.test(h) || ee.test(h))
|
|
30877
31631
|
break;
|
|
30878
|
-
if (A.search(this.rules.other.nonSpaceChar) >=
|
|
30879
|
-
|
|
30880
|
-
` + A.slice(
|
|
31632
|
+
if (A.search(this.rules.other.nonSpaceChar) >= f || !h.trim())
|
|
31633
|
+
p += `
|
|
31634
|
+
` + A.slice(f);
|
|
30881
31635
|
else {
|
|
30882
|
-
if (
|
|
31636
|
+
if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(g) || ne.test(g) || ee.test(g))
|
|
30883
31637
|
break;
|
|
30884
|
-
|
|
30885
|
-
` +
|
|
31638
|
+
p += `
|
|
31639
|
+
` + h;
|
|
30886
31640
|
}
|
|
30887
|
-
!
|
|
30888
|
-
`, e = e.substring(
|
|
31641
|
+
!R && !h.trim() && (R = true), c += Z + `
|
|
31642
|
+
`, e = e.substring(Z.length + 1), g = A.slice(f);
|
|
30889
31643
|
}
|
|
30890
31644
|
}
|
|
30891
|
-
i.loose || (o ? i.loose = true : this.rules.other.doubleBlankLine.test(
|
|
30892
|
-
let
|
|
30893
|
-
this.options.gfm && (
|
|
31645
|
+
i.loose || (o ? i.loose = true : this.rules.other.doubleBlankLine.test(c) && (o = true));
|
|
31646
|
+
let O = null, Y;
|
|
31647
|
+
this.options.gfm && (O = this.rules.other.listIsTask.exec(p), O && (Y = O[0] !== "[ ] ", p = p.replace(this.rules.other.listReplaceTask, ""))), i.items.push({ type: "list_item", raw: c, task: !!O, checked: Y, loose: false, text: p, tokens: [] }), i.raw += c;
|
|
30894
31648
|
}
|
|
30895
31649
|
let a = i.items.at(-1);
|
|
30896
31650
|
if (a)
|
|
@@ -30898,14 +31652,14 @@ ${c}` : c;
|
|
|
30898
31652
|
else
|
|
30899
31653
|
return;
|
|
30900
31654
|
i.raw = i.raw.trimEnd();
|
|
30901
|
-
for (let
|
|
30902
|
-
if (this.lexer.state.top = false, i.items[
|
|
30903
|
-
let
|
|
30904
|
-
i.loose =
|
|
31655
|
+
for (let l = 0;l < i.items.length; l++)
|
|
31656
|
+
if (this.lexer.state.top = false, i.items[l].tokens = this.lexer.blockTokens(i.items[l].text, []), !i.loose) {
|
|
31657
|
+
let c = i.items[l].tokens.filter((g) => g.type === "space"), p = c.length > 0 && c.some((g) => this.rules.other.anyLine.test(g.raw));
|
|
31658
|
+
i.loose = p;
|
|
30905
31659
|
}
|
|
30906
31660
|
if (i.loose)
|
|
30907
|
-
for (let
|
|
30908
|
-
i.items[
|
|
31661
|
+
for (let l = 0;l < i.items.length; l++)
|
|
31662
|
+
i.items[l].loose = true;
|
|
30909
31663
|
return i;
|
|
30910
31664
|
}
|
|
30911
31665
|
}
|
|
@@ -30933,7 +31687,7 @@ ${c}` : c;
|
|
|
30933
31687
|
for (let o = 0;o < n.length; o++)
|
|
30934
31688
|
s.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: true, align: s.align[o] });
|
|
30935
31689
|
for (let o of i)
|
|
30936
|
-
s.rows.push(V(o, s.header.length).map((a,
|
|
31690
|
+
s.rows.push(V(o, s.header.length).map((a, l) => ({ text: a, tokens: this.lexer.inline(a), header: false, align: s.align[l] })));
|
|
30937
31691
|
return s;
|
|
30938
31692
|
}
|
|
30939
31693
|
}
|
|
@@ -30976,7 +31730,7 @@ ${c}` : c;
|
|
|
30976
31730
|
if ((n.length - s.length) % 2 === 0)
|
|
30977
31731
|
return;
|
|
30978
31732
|
} else {
|
|
30979
|
-
let s =
|
|
31733
|
+
let s = fe(t[2], "()");
|
|
30980
31734
|
if (s === -2)
|
|
30981
31735
|
return;
|
|
30982
31736
|
if (s > -1) {
|
|
@@ -30990,7 +31744,7 @@ ${c}` : c;
|
|
|
30990
31744
|
s && (r = s[1], i = s[3]);
|
|
30991
31745
|
} else
|
|
30992
31746
|
i = t[3] ? t[3].slice(1, -1) : "";
|
|
30993
|
-
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)),
|
|
31747
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), me(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
|
|
30994
31748
|
}
|
|
30995
31749
|
}
|
|
30996
31750
|
reflink(e, t) {
|
|
@@ -31001,7 +31755,7 @@ ${c}` : c;
|
|
|
31001
31755
|
let s = n[0].charAt(0);
|
|
31002
31756
|
return { type: "text", raw: s, text: s };
|
|
31003
31757
|
}
|
|
31004
|
-
return
|
|
31758
|
+
return me(n, i, n[0], this.lexer, this.rules);
|
|
31005
31759
|
}
|
|
31006
31760
|
}
|
|
31007
31761
|
emStrong(e, t, n = "") {
|
|
@@ -31009,27 +31763,27 @@ ${c}` : c;
|
|
|
31009
31763
|
if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric))
|
|
31010
31764
|
return;
|
|
31011
31765
|
if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
31012
|
-
let s = [...r[0]].length - 1, o, a,
|
|
31013
|
-
for (
|
|
31766
|
+
let s = [...r[0]].length - 1, o, a, l = s, c = 0, p = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
31767
|
+
for (p.lastIndex = 0, t = t.slice(-1 * e.length + s);(r = p.exec(t)) != null; ) {
|
|
31014
31768
|
if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o)
|
|
31015
31769
|
continue;
|
|
31016
31770
|
if (a = [...o].length, r[3] || r[4]) {
|
|
31017
|
-
|
|
31771
|
+
l += a;
|
|
31018
31772
|
continue;
|
|
31019
31773
|
} else if ((r[5] || r[6]) && s % 3 && !((s + a) % 3)) {
|
|
31020
|
-
|
|
31774
|
+
c += a;
|
|
31021
31775
|
continue;
|
|
31022
31776
|
}
|
|
31023
|
-
if (
|
|
31777
|
+
if (l -= a, l > 0)
|
|
31024
31778
|
continue;
|
|
31025
|
-
a = Math.min(a, a +
|
|
31026
|
-
let
|
|
31779
|
+
a = Math.min(a, a + l + c);
|
|
31780
|
+
let g = [...r[0]][0].length, h = e.slice(0, s + r.index + g + a);
|
|
31027
31781
|
if (Math.min(s, a) % 2) {
|
|
31028
|
-
let
|
|
31029
|
-
return { type: "em", raw:
|
|
31782
|
+
let f = h.slice(1, -1);
|
|
31783
|
+
return { type: "em", raw: h, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
31030
31784
|
}
|
|
31031
|
-
let
|
|
31032
|
-
return { type: "strong", raw:
|
|
31785
|
+
let R = h.slice(2, -2);
|
|
31786
|
+
return { type: "strong", raw: h, text: R, tokens: this.lexer.inlineTokens(R) };
|
|
31033
31787
|
}
|
|
31034
31788
|
}
|
|
31035
31789
|
}
|
|
@@ -31081,25 +31835,25 @@ ${c}` : c;
|
|
|
31081
31835
|
}
|
|
31082
31836
|
}
|
|
31083
31837
|
};
|
|
31084
|
-
var
|
|
31838
|
+
var x = class u {
|
|
31085
31839
|
tokens;
|
|
31086
31840
|
options;
|
|
31087
31841
|
state;
|
|
31088
31842
|
tokenizer;
|
|
31089
31843
|
inlineQueue;
|
|
31090
31844
|
constructor(e) {
|
|
31091
|
-
this.tokens = [], this.tokens.links = Object.create(null), this.options = e ||
|
|
31092
|
-
let t = { other: m, block:
|
|
31093
|
-
this.options.pedantic ? (t.block =
|
|
31845
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new y, this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
|
|
31846
|
+
let t = { other: m, block: C.normal, inline: M.normal };
|
|
31847
|
+
this.options.pedantic ? (t.block = C.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = C.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
|
|
31094
31848
|
}
|
|
31095
31849
|
static get rules() {
|
|
31096
|
-
return { block:
|
|
31850
|
+
return { block: C, inline: M };
|
|
31097
31851
|
}
|
|
31098
31852
|
static lex(e, t) {
|
|
31099
|
-
return new
|
|
31853
|
+
return new u(t).lex(e);
|
|
31100
31854
|
}
|
|
31101
31855
|
static lexInline(e, t) {
|
|
31102
|
-
return new
|
|
31856
|
+
return new u(t).inlineTokens(e);
|
|
31103
31857
|
}
|
|
31104
31858
|
lex(e) {
|
|
31105
31859
|
e = e.replace(m.carriageReturn, `
|
|
@@ -31175,8 +31929,8 @@ var b = class l {
|
|
|
31175
31929
|
let i = e;
|
|
31176
31930
|
if (this.options.extensions?.startBlock) {
|
|
31177
31931
|
let s = 1 / 0, o = e.slice(1), a;
|
|
31178
|
-
this.options.extensions.startBlock.forEach((
|
|
31179
|
-
a =
|
|
31932
|
+
this.options.extensions.startBlock.forEach((l) => {
|
|
31933
|
+
a = l.call({ lexer: this }, o), typeof a == "number" && a >= 0 && (s = Math.min(s, a));
|
|
31180
31934
|
}), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
|
|
31181
31935
|
}
|
|
31182
31936
|
if (this.state.top && (r = this.tokenizer.paragraph(i))) {
|
|
@@ -31222,11 +31976,12 @@ var b = class l {
|
|
|
31222
31976
|
n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
31223
31977
|
for (;(r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; )
|
|
31224
31978
|
n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
31979
|
+
n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
31225
31980
|
let i = false, s = "";
|
|
31226
31981
|
for (;e; ) {
|
|
31227
31982
|
i || (s = ""), i = false;
|
|
31228
31983
|
let o;
|
|
31229
|
-
if (this.options.extensions?.inline?.some((
|
|
31984
|
+
if (this.options.extensions?.inline?.some((l) => (o = l.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false))
|
|
31230
31985
|
continue;
|
|
31231
31986
|
if (o = this.tokenizer.escape(e)) {
|
|
31232
31987
|
e = e.substring(o.raw.length), t.push(o);
|
|
@@ -31242,8 +31997,8 @@ var b = class l {
|
|
|
31242
31997
|
}
|
|
31243
31998
|
if (o = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
31244
31999
|
e = e.substring(o.raw.length);
|
|
31245
|
-
let
|
|
31246
|
-
o.type === "text" &&
|
|
32000
|
+
let l = t.at(-1);
|
|
32001
|
+
o.type === "text" && l?.type === "text" ? (l.raw += o.raw, l.text += o.text) : t.push(o);
|
|
31247
32002
|
continue;
|
|
31248
32003
|
}
|
|
31249
32004
|
if (o = this.tokenizer.emStrong(e, n, s)) {
|
|
@@ -31272,24 +32027,24 @@ var b = class l {
|
|
|
31272
32027
|
}
|
|
31273
32028
|
let a = e;
|
|
31274
32029
|
if (this.options.extensions?.startInline) {
|
|
31275
|
-
let
|
|
31276
|
-
this.options.extensions.startInline.forEach((
|
|
31277
|
-
|
|
31278
|
-
}),
|
|
32030
|
+
let l = 1 / 0, c = e.slice(1), p;
|
|
32031
|
+
this.options.extensions.startInline.forEach((g) => {
|
|
32032
|
+
p = g.call({ lexer: this }, c), typeof p == "number" && p >= 0 && (l = Math.min(l, p));
|
|
32033
|
+
}), l < 1 / 0 && l >= 0 && (a = e.substring(0, l + 1));
|
|
31279
32034
|
}
|
|
31280
32035
|
if (o = this.tokenizer.inlineText(a)) {
|
|
31281
32036
|
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (s = o.raw.slice(-1)), i = true;
|
|
31282
|
-
let
|
|
31283
|
-
|
|
32037
|
+
let l = t.at(-1);
|
|
32038
|
+
l?.type === "text" ? (l.raw += o.raw, l.text += o.text) : t.push(o);
|
|
31284
32039
|
continue;
|
|
31285
32040
|
}
|
|
31286
32041
|
if (e) {
|
|
31287
|
-
let
|
|
32042
|
+
let l = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
31288
32043
|
if (this.options.silent) {
|
|
31289
|
-
console.error(
|
|
32044
|
+
console.error(l);
|
|
31290
32045
|
break;
|
|
31291
32046
|
} else
|
|
31292
|
-
throw new Error(
|
|
32047
|
+
throw new Error(l);
|
|
31293
32048
|
}
|
|
31294
32049
|
}
|
|
31295
32050
|
return t;
|
|
@@ -31299,7 +32054,7 @@ var P = class {
|
|
|
31299
32054
|
options;
|
|
31300
32055
|
parser;
|
|
31301
32056
|
constructor(e) {
|
|
31302
|
-
this.options = e ||
|
|
32057
|
+
this.options = e || T;
|
|
31303
32058
|
}
|
|
31304
32059
|
space(e) {
|
|
31305
32060
|
return "";
|
|
@@ -31422,7 +32177,7 @@ ${e}</tr>
|
|
|
31422
32177
|
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : ("escaped" in e) && e.escaped ? e.text : w(e.text);
|
|
31423
32178
|
}
|
|
31424
32179
|
};
|
|
31425
|
-
var
|
|
32180
|
+
var $ = class {
|
|
31426
32181
|
strong({ text: e }) {
|
|
31427
32182
|
return e;
|
|
31428
32183
|
}
|
|
@@ -31451,18 +32206,18 @@ var S = class {
|
|
|
31451
32206
|
return "";
|
|
31452
32207
|
}
|
|
31453
32208
|
};
|
|
31454
|
-
var
|
|
32209
|
+
var b = class u2 {
|
|
31455
32210
|
options;
|
|
31456
32211
|
renderer;
|
|
31457
32212
|
textRenderer;
|
|
31458
32213
|
constructor(e) {
|
|
31459
|
-
this.options = e ||
|
|
32214
|
+
this.options = e || T, this.options.renderer = this.options.renderer || new P, this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $;
|
|
31460
32215
|
}
|
|
31461
32216
|
static parse(e, t) {
|
|
31462
|
-
return new
|
|
32217
|
+
return new u2(t).parse(e);
|
|
31463
32218
|
}
|
|
31464
32219
|
static parseInline(e, t) {
|
|
31465
|
-
return new
|
|
32220
|
+
return new u2(t).parseInline(e);
|
|
31466
32221
|
}
|
|
31467
32222
|
parse(e, t = true) {
|
|
31468
32223
|
let n = "";
|
|
@@ -31599,13 +32354,14 @@ var R = class l2 {
|
|
|
31599
32354
|
return n;
|
|
31600
32355
|
}
|
|
31601
32356
|
};
|
|
31602
|
-
var
|
|
32357
|
+
var S = class {
|
|
31603
32358
|
options;
|
|
31604
32359
|
block;
|
|
31605
32360
|
constructor(e) {
|
|
31606
|
-
this.options = e ||
|
|
32361
|
+
this.options = e || T;
|
|
31607
32362
|
}
|
|
31608
|
-
static passThroughHooks = new Set(["preprocess", "postprocess", "processAllTokens"]);
|
|
32363
|
+
static passThroughHooks = new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
|
|
32364
|
+
static passThroughHooksRespectAsync = new Set(["preprocess", "postprocess", "processAllTokens"]);
|
|
31609
32365
|
preprocess(e) {
|
|
31610
32366
|
return e;
|
|
31611
32367
|
}
|
|
@@ -31615,11 +32371,14 @@ var $ = class {
|
|
|
31615
32371
|
processAllTokens(e) {
|
|
31616
32372
|
return e;
|
|
31617
32373
|
}
|
|
32374
|
+
emStrongMask(e) {
|
|
32375
|
+
return e;
|
|
32376
|
+
}
|
|
31618
32377
|
provideLexer() {
|
|
31619
|
-
return this.block ?
|
|
32378
|
+
return this.block ? x.lex : x.lexInline;
|
|
31620
32379
|
}
|
|
31621
32380
|
provideParser() {
|
|
31622
|
-
return this.block ?
|
|
32381
|
+
return this.block ? b.parse : b.parseInline;
|
|
31623
32382
|
}
|
|
31624
32383
|
};
|
|
31625
32384
|
var B = class {
|
|
@@ -31627,12 +32386,12 @@ var B = class {
|
|
|
31627
32386
|
options = this.setOptions;
|
|
31628
32387
|
parse = this.parseMarkdown(true);
|
|
31629
32388
|
parseInline = this.parseMarkdown(false);
|
|
31630
|
-
Parser =
|
|
32389
|
+
Parser = b;
|
|
31631
32390
|
Renderer = P;
|
|
31632
|
-
TextRenderer =
|
|
31633
|
-
Lexer =
|
|
32391
|
+
TextRenderer = $;
|
|
32392
|
+
Lexer = x;
|
|
31634
32393
|
Tokenizer = y;
|
|
31635
|
-
Hooks =
|
|
32394
|
+
Hooks = S;
|
|
31636
32395
|
constructor(...e) {
|
|
31637
32396
|
this.use(...e);
|
|
31638
32397
|
}
|
|
@@ -31692,10 +32451,10 @@ var B = class {
|
|
|
31692
32451
|
throw new Error(`renderer '${s}' does not exist`);
|
|
31693
32452
|
if (["options", "parser"].includes(s))
|
|
31694
32453
|
continue;
|
|
31695
|
-
let o = s, a = n.renderer[o],
|
|
31696
|
-
i[o] = (...
|
|
31697
|
-
let
|
|
31698
|
-
return
|
|
32454
|
+
let o = s, a = n.renderer[o], l = i[o];
|
|
32455
|
+
i[o] = (...c) => {
|
|
32456
|
+
let p = a.apply(i, c);
|
|
32457
|
+
return p === false && (p = l.apply(i, c)), p || "";
|
|
31699
32458
|
};
|
|
31700
32459
|
}
|
|
31701
32460
|
r.renderer = i;
|
|
@@ -31707,30 +32466,38 @@ var B = class {
|
|
|
31707
32466
|
throw new Error(`tokenizer '${s}' does not exist`);
|
|
31708
32467
|
if (["options", "rules", "lexer"].includes(s))
|
|
31709
32468
|
continue;
|
|
31710
|
-
let o = s, a = n.tokenizer[o],
|
|
31711
|
-
i[o] = (...
|
|
31712
|
-
let
|
|
31713
|
-
return
|
|
32469
|
+
let o = s, a = n.tokenizer[o], l = i[o];
|
|
32470
|
+
i[o] = (...c) => {
|
|
32471
|
+
let p = a.apply(i, c);
|
|
32472
|
+
return p === false && (p = l.apply(i, c)), p;
|
|
31714
32473
|
};
|
|
31715
32474
|
}
|
|
31716
32475
|
r.tokenizer = i;
|
|
31717
32476
|
}
|
|
31718
32477
|
if (n.hooks) {
|
|
31719
|
-
let i = this.defaults.hooks || new
|
|
32478
|
+
let i = this.defaults.hooks || new S;
|
|
31720
32479
|
for (let s in n.hooks) {
|
|
31721
32480
|
if (!(s in i))
|
|
31722
32481
|
throw new Error(`hook '${s}' does not exist`);
|
|
31723
32482
|
if (["options", "block"].includes(s))
|
|
31724
32483
|
continue;
|
|
31725
|
-
let o = s, a = n.hooks[o],
|
|
31726
|
-
|
|
32484
|
+
let o = s, a = n.hooks[o], l = i[o];
|
|
32485
|
+
S.passThroughHooks.has(s) ? i[o] = (c) => {
|
|
32486
|
+
if (this.defaults.async && S.passThroughHooksRespectAsync.has(s))
|
|
32487
|
+
return (async () => {
|
|
32488
|
+
let g = await a.call(i, c);
|
|
32489
|
+
return l.call(i, g);
|
|
32490
|
+
})();
|
|
32491
|
+
let p = a.call(i, c);
|
|
32492
|
+
return l.call(i, p);
|
|
32493
|
+
} : i[o] = (...c) => {
|
|
31727
32494
|
if (this.defaults.async)
|
|
31728
|
-
return
|
|
31729
|
-
|
|
31730
|
-
|
|
31731
|
-
|
|
31732
|
-
let
|
|
31733
|
-
return
|
|
32495
|
+
return (async () => {
|
|
32496
|
+
let g = await a.apply(i, c);
|
|
32497
|
+
return g === false && (g = await l.apply(i, c)), g;
|
|
32498
|
+
})();
|
|
32499
|
+
let p = a.apply(i, c);
|
|
32500
|
+
return p === false && (p = l.apply(i, c)), p;
|
|
31734
32501
|
};
|
|
31735
32502
|
}
|
|
31736
32503
|
r.hooks = i;
|
|
@@ -31749,10 +32516,10 @@ var B = class {
|
|
|
31749
32516
|
return this.defaults = { ...this.defaults, ...e }, this;
|
|
31750
32517
|
}
|
|
31751
32518
|
lexer(e, t) {
|
|
31752
|
-
return
|
|
32519
|
+
return x.lex(e, t ?? this.defaults);
|
|
31753
32520
|
}
|
|
31754
32521
|
parser(e, t) {
|
|
31755
|
-
return
|
|
32522
|
+
return b.parse(e, t ?? this.defaults);
|
|
31756
32523
|
}
|
|
31757
32524
|
parseMarkdown(e) {
|
|
31758
32525
|
return (n, r) => {
|
|
@@ -31763,18 +32530,21 @@ var B = class {
|
|
|
31763
32530
|
return o(new Error("marked(): input parameter is undefined or null"));
|
|
31764
32531
|
if (typeof n != "string")
|
|
31765
32532
|
return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
31766
|
-
s.hooks && (s.hooks.options = s, s.hooks.block = e)
|
|
31767
|
-
|
|
31768
|
-
|
|
31769
|
-
|
|
32533
|
+
if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async)
|
|
32534
|
+
return (async () => {
|
|
32535
|
+
let a = s.hooks ? await s.hooks.preprocess(n) : n, c = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(a, s), p = s.hooks ? await s.hooks.processAllTokens(c) : c;
|
|
32536
|
+
s.walkTokens && await Promise.all(this.walkTokens(p, s.walkTokens));
|
|
32537
|
+
let h = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(p, s);
|
|
32538
|
+
return s.hooks ? await s.hooks.postprocess(h) : h;
|
|
32539
|
+
})().catch(o);
|
|
31770
32540
|
try {
|
|
31771
32541
|
s.hooks && (n = s.hooks.preprocess(n));
|
|
31772
|
-
let
|
|
31773
|
-
s.hooks && (
|
|
31774
|
-
let
|
|
31775
|
-
return s.hooks && (
|
|
31776
|
-
} catch (
|
|
31777
|
-
return o(
|
|
32542
|
+
let l = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
|
|
32543
|
+
s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
|
|
32544
|
+
let p = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(l, s);
|
|
32545
|
+
return s.hooks && (p = s.hooks.postprocess(p)), p;
|
|
32546
|
+
} catch (a) {
|
|
32547
|
+
return o(a);
|
|
31778
32548
|
}
|
|
31779
32549
|
};
|
|
31780
32550
|
}
|
|
@@ -31792,37 +32562,37 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
31792
32562
|
}
|
|
31793
32563
|
};
|
|
31794
32564
|
var _ = new B;
|
|
31795
|
-
function
|
|
31796
|
-
return _.parse(
|
|
32565
|
+
function k(u3, e) {
|
|
32566
|
+
return _.parse(u3, e);
|
|
31797
32567
|
}
|
|
31798
|
-
|
|
31799
|
-
return _.setOptions(
|
|
32568
|
+
k.options = k.setOptions = function(u3) {
|
|
32569
|
+
return _.setOptions(u3), k.defaults = _.defaults, G(k.defaults), k;
|
|
31800
32570
|
};
|
|
31801
|
-
|
|
31802
|
-
|
|
31803
|
-
|
|
31804
|
-
return _.use(...
|
|
32571
|
+
k.getDefaults = L;
|
|
32572
|
+
k.defaults = T;
|
|
32573
|
+
k.use = function(...u3) {
|
|
32574
|
+
return _.use(...u3), k.defaults = _.defaults, G(k.defaults), k;
|
|
31805
32575
|
};
|
|
31806
|
-
|
|
31807
|
-
return _.walkTokens(
|
|
32576
|
+
k.walkTokens = function(u3, e) {
|
|
32577
|
+
return _.walkTokens(u3, e);
|
|
31808
32578
|
};
|
|
31809
|
-
|
|
31810
|
-
|
|
31811
|
-
|
|
31812
|
-
|
|
31813
|
-
|
|
31814
|
-
|
|
31815
|
-
|
|
31816
|
-
|
|
31817
|
-
|
|
31818
|
-
|
|
31819
|
-
var
|
|
31820
|
-
var Zt =
|
|
31821
|
-
var Gt =
|
|
31822
|
-
var
|
|
31823
|
-
var
|
|
31824
|
-
var
|
|
31825
|
-
var
|
|
32579
|
+
k.parseInline = _.parseInline;
|
|
32580
|
+
k.Parser = b;
|
|
32581
|
+
k.parser = b.parse;
|
|
32582
|
+
k.Renderer = P;
|
|
32583
|
+
k.TextRenderer = $;
|
|
32584
|
+
k.Lexer = x;
|
|
32585
|
+
k.lexer = x.lex;
|
|
32586
|
+
k.Tokenizer = y;
|
|
32587
|
+
k.Hooks = S;
|
|
32588
|
+
k.parse = k;
|
|
32589
|
+
var Ht = k.options;
|
|
32590
|
+
var Zt = k.setOptions;
|
|
32591
|
+
var Gt = k.use;
|
|
32592
|
+
var Nt = k.walkTokens;
|
|
32593
|
+
var Ft = k.parseInline;
|
|
32594
|
+
var Qt = b.parse;
|
|
32595
|
+
var Ut = x.lex;
|
|
31826
32596
|
|
|
31827
32597
|
// node_modules/marked-highlight/src/index.js
|
|
31828
32598
|
function markedHighlight(options2) {
|
|
@@ -31919,6 +32689,7 @@ core_default.registerLanguage("xml", xml);
|
|
|
31919
32689
|
core_default.registerLanguage("diff", diff);
|
|
31920
32690
|
core_default.registerLanguage("python", python);
|
|
31921
32691
|
core_default.registerLanguage("json", json);
|
|
32692
|
+
core_default.registerLanguage("swift", swift);
|
|
31922
32693
|
var marked = new B(markedHighlight({
|
|
31923
32694
|
emptyLangClass: "hljs",
|
|
31924
32695
|
langPrefix: "hljs language-",
|