@sanity/cli 3.62.3 → 3.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_chunks-cjs/cli.js +235 -209
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/lib/_chunks-cjs/cliWorker.js.map +1 -1
- package/lib/_chunks-cjs/generateAction.js.map +1 -1
- package/lib/_chunks-cjs/getCliConfig.js.map +1 -1
- package/lib/_chunks-cjs/journeyConfig.js.map +1 -1
- package/lib/_chunks-cjs/loadEnv.js.map +1 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/workers/getCliConfig.js.map +1 -1
- package/lib/workers/typegenGenerate.js.map +1 -1
- package/package.json +11 -11
- package/src/actions/init-project/templates/nextjs/index.ts +16 -0
package/lib/_chunks-cjs/cli.js
CHANGED
@@ -18348,7 +18348,7 @@ function require_escape() {
|
|
18348
18348
|
return arg = arg.replace(metaCharsRegExp, "^$1"), arg;
|
18349
18349
|
}
|
18350
18350
|
function escapeArgument(arg, doubleEscapeMetaChars) {
|
18351
|
-
return arg = `${arg}`, arg = arg.replace(/(
|
18351
|
+
return arg = `${arg}`, arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"'), arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1"), arg = `"${arg}"`, arg = arg.replace(metaCharsRegExp, "^$1"), doubleEscapeMetaChars && (arg = arg.replace(metaCharsRegExp, "^$1")), arg;
|
18352
18352
|
}
|
18353
18353
|
return _escape.command = escapeCommand, _escape.argument = escapeArgument, _escape;
|
18354
18354
|
}
|
@@ -24045,11 +24045,17 @@ var __setModuleDefault = Object.create ? function(o, v) {
|
|
24045
24045
|
Object.defineProperty(o, "default", { enumerable: !0, value: v });
|
24046
24046
|
} : function(o, v) {
|
24047
24047
|
o.default = v;
|
24048
|
+
}, ownKeys = function(o) {
|
24049
|
+
return ownKeys = Object.getOwnPropertyNames || function(o2) {
|
24050
|
+
var ar = [];
|
24051
|
+
for (var k in o2) Object.prototype.hasOwnProperty.call(o2, k) && (ar[ar.length] = k);
|
24052
|
+
return ar;
|
24053
|
+
}, ownKeys(o);
|
24048
24054
|
};
|
24049
24055
|
function __importStar(mod) {
|
24050
24056
|
if (mod && mod.__esModule) return mod;
|
24051
24057
|
var result = {};
|
24052
|
-
if (mod != null) for (var k
|
24058
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) k[i] !== "default" && __createBinding(result, mod, k[i]);
|
24053
24059
|
return __setModuleDefault(result, mod), result;
|
24054
24060
|
}
|
24055
24061
|
function __importDefault(mod) {
|
@@ -34043,15 +34049,12 @@ function requireLib$1() {
|
|
34043
34049
|
}) => `Unsyntactic ${type2 === "BreakStatement" ? "break" : "continue"}.`,
|
34044
34050
|
IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.",
|
34045
34051
|
IllegalReturn: "'return' outside of function.",
|
34046
|
-
ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `
|
34052
|
+
ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",
|
34047
34053
|
ImportBindingIsString: ({
|
34048
34054
|
importName
|
34049
34055
|
}) => `A string literal cannot be used as an imported binding.
|
34050
34056
|
- Did you mean \`import { "${importName}" as foo }\`?`,
|
34051
|
-
|
34052
|
-
ImportCallArity: ({
|
34053
|
-
maxArgumentCount
|
34054
|
-
}) => `\`import()\` requires exactly ${maxArgumentCount === 1 ? "one argument" : "one or two arguments"}.`,
|
34057
|
+
ImportCallArity: "`import()` requires exactly one or two arguments.",
|
34055
34058
|
ImportCallNotNewExpression: "Cannot use new with import(...).",
|
34056
34059
|
ImportCallSpreadArgument: "`...` is not allowed in `import()`.",
|
34057
34060
|
ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.",
|
@@ -34460,11 +34463,8 @@ function requireLib$1() {
|
|
34460
34463
|
finishCallExpression(unfinished, optional) {
|
34461
34464
|
const node = super.finishCallExpression(unfinished, optional);
|
34462
34465
|
if (node.callee.type === "Import") {
|
34463
|
-
|
34464
|
-
|
34465
|
-
node.options = (_ref = node.arguments[1]) != null ? _ref : null, node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null;
|
34466
|
-
}
|
34467
|
-
delete node.arguments, delete node.callee;
|
34466
|
+
var _ref, _ref2;
|
34467
|
+
node.type = "ImportExpression", node.source = node.arguments[0], node.options = (_ref = node.arguments[1]) != null ? _ref : null, node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null, delete node.arguments, delete node.callee;
|
34468
34468
|
}
|
34469
34469
|
return node;
|
34470
34470
|
}
|
@@ -34927,6 +34927,9 @@ function requireLib$1() {
|
|
34927
34927
|
name: createToken("name", {
|
34928
34928
|
startsExpr
|
34929
34929
|
}),
|
34930
|
+
placeholder: createToken("%%", {
|
34931
|
+
startsExpr: !0
|
34932
|
+
}),
|
34930
34933
|
string: createToken("string", {
|
34931
34934
|
startsExpr
|
34932
34935
|
}),
|
@@ -34953,22 +34956,19 @@ function requireLib$1() {
|
|
34953
34956
|
jsxTagStart: createToken("jsxTagStart", {
|
34954
34957
|
startsExpr: !0
|
34955
34958
|
}),
|
34956
|
-
jsxTagEnd: createToken("jsxTagEnd")
|
34957
|
-
placeholder: createToken("%%", {
|
34958
|
-
startsExpr: !0
|
34959
|
-
})
|
34959
|
+
jsxTagEnd: createToken("jsxTagEnd")
|
34960
34960
|
};
|
34961
34961
|
function tokenIsIdentifier(token2) {
|
34962
|
-
return token2 >= 93 && token2 <=
|
34962
|
+
return token2 >= 93 && token2 <= 133;
|
34963
34963
|
}
|
34964
34964
|
function tokenKeywordOrIdentifierIsKeyword(token2) {
|
34965
34965
|
return token2 <= 92;
|
34966
34966
|
}
|
34967
34967
|
function tokenIsKeywordOrIdentifier(token2) {
|
34968
|
-
return token2 >= 58 && token2 <=
|
34968
|
+
return token2 >= 58 && token2 <= 133;
|
34969
34969
|
}
|
34970
34970
|
function tokenIsLiteralPropertyName(token2) {
|
34971
|
-
return token2 >= 58 && token2 <=
|
34971
|
+
return token2 >= 58 && token2 <= 137;
|
34972
34972
|
}
|
34973
34973
|
function tokenComesBeforeExpression(token2) {
|
34974
34974
|
return tokenBeforeExprs[token2];
|
@@ -35024,7 +35024,7 @@ function requireLib$1() {
|
|
35024
35024
|
context.push(types2.brace);
|
35025
35025
|
}, tokenTypes[22].updateContext = (context) => {
|
35026
35026
|
context[context.length - 1] === types2.template ? context.pop() : context.push(types2.template);
|
35027
|
-
}, tokenTypes[
|
35027
|
+
}, tokenTypes[143].updateContext = (context) => {
|
35028
35028
|
context.push(types2.j_expr, types2.j_oTag);
|
35029
35029
|
};
|
35030
35030
|
let nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC", nonASCIIidentifierChars = "\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65";
|
@@ -35216,6 +35216,12 @@ function requireLib$1() {
|
|
35216
35216
|
constructor() {
|
35217
35217
|
this.sawUnambiguousESM = !1, this.ambiguousScriptDifferentAst = !1;
|
35218
35218
|
}
|
35219
|
+
sourceToOffsetPos(sourcePos) {
|
35220
|
+
return sourcePos + this.startIndex;
|
35221
|
+
}
|
35222
|
+
offsetToSourcePos(offsetPos) {
|
35223
|
+
return offsetPos - this.startIndex;
|
35224
|
+
}
|
35219
35225
|
hasPlugin(pluginConfig) {
|
35220
35226
|
if (typeof pluginConfig == "string")
|
35221
35227
|
return this.plugins.has(pluginConfig);
|
@@ -35290,7 +35296,7 @@ function requireLib$1() {
|
|
35290
35296
|
containingNode: node,
|
35291
35297
|
start: commentStart
|
35292
35298
|
} = commentWS;
|
35293
|
-
if (this.input.charCodeAt(commentStart - 1) === 44)
|
35299
|
+
if (this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) === 44)
|
35294
35300
|
switch (node.type) {
|
35295
35301
|
case "ObjectExpression":
|
35296
35302
|
case "ObjectPattern":
|
@@ -35417,10 +35423,10 @@ function requireLib$1() {
|
|
35417
35423
|
}
|
35418
35424
|
class State {
|
35419
35425
|
constructor() {
|
35420
|
-
this.flags = 1024, this.curLine = void 0, this.lineStart = void 0, this.startLoc = void 0, this.endLoc = void 0, this.errors = [], this.potentialArrowAt = -1, this.noArrowAt = [], this.noArrowParamsConversionAt = [], this.topicContext = {
|
35426
|
+
this.flags = 1024, this.startIndex = void 0, this.curLine = void 0, this.lineStart = void 0, this.startLoc = void 0, this.endLoc = void 0, this.errors = [], this.potentialArrowAt = -1, this.noArrowAt = [], this.noArrowParamsConversionAt = [], this.topicContext = {
|
35421
35427
|
maxNumOfResolvableTopics: 0,
|
35422
35428
|
maxTopicIndex: null
|
35423
|
-
}, this.labels = [], this.commentsLen = 0, this.commentStack = [], this.pos = 0, this.type =
|
35429
|
+
}, this.labels = [], this.commentsLen = 0, this.commentStack = [], this.pos = 0, this.type = 140, this.value = null, this.start = 0, this.end = 0, this.lastTokEndLoc = null, this.lastTokStartLoc = null, this.context = [types2.brace], this.firstInvalidTemplateEscapePos = null, this.strictErrors = /* @__PURE__ */ new Map(), this.tokensLength = 0;
|
35424
35430
|
}
|
35425
35431
|
get strict() {
|
35426
35432
|
return (this.flags & 1) > 0;
|
@@ -35431,10 +35437,11 @@ function requireLib$1() {
|
|
35431
35437
|
init({
|
35432
35438
|
strictMode,
|
35433
35439
|
sourceType,
|
35440
|
+
startIndex,
|
35434
35441
|
startLine,
|
35435
35442
|
startColumn
|
35436
35443
|
}) {
|
35437
|
-
this.strict = strictMode === !1 ? !1 : strictMode === !0 ? !0 : sourceType === "module", this.curLine = startLine, this.lineStart = -startColumn, this.startLoc = this.endLoc = new Position(startLine, startColumn,
|
35444
|
+
this.strict = strictMode === !1 ? !1 : strictMode === !0 ? !0 : sourceType === "module", this.startIndex = startIndex, this.curLine = startLine, this.lineStart = -startColumn, this.startLoc = this.endLoc = new Position(startLine, startColumn, startIndex);
|
35438
35445
|
}
|
35439
35446
|
get maybeInArrowParameters() {
|
35440
35447
|
return (this.flags & 2) > 0;
|
@@ -35509,11 +35516,11 @@ function requireLib$1() {
|
|
35509
35516
|
v ? this.flags |= 4096 : this.flags &= -4097;
|
35510
35517
|
}
|
35511
35518
|
curPosition() {
|
35512
|
-
return new Position(this.curLine, this.pos - this.lineStart, this.pos);
|
35519
|
+
return new Position(this.curLine, this.pos - this.lineStart, this.pos + this.startIndex);
|
35513
35520
|
}
|
35514
35521
|
clone() {
|
35515
35522
|
const state = new State();
|
35516
|
-
return state.flags = this.flags, state.curLine = this.curLine, state.lineStart = this.lineStart, state.startLoc = this.startLoc, state.endLoc = this.endLoc, state.errors = this.errors.slice(), state.potentialArrowAt = this.potentialArrowAt, state.noArrowAt = this.noArrowAt.slice(), state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice(), state.topicContext = this.topicContext, state.labels = this.labels.slice(), state.commentsLen = this.commentsLen, state.commentStack = this.commentStack.slice(), state.pos = this.pos, state.type = this.type, state.value = this.value, state.start = this.start, state.end = this.end, state.lastTokEndLoc = this.lastTokEndLoc, state.lastTokStartLoc = this.lastTokStartLoc, state.context = this.context.slice(), state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos, state.strictErrors = this.strictErrors, state.tokensLength = this.tokensLength, state;
|
35523
|
+
return state.flags = this.flags, state.startIndex = this.startIndex, state.curLine = this.curLine, state.lineStart = this.lineStart, state.startLoc = this.startLoc, state.endLoc = this.endLoc, state.errors = this.errors.slice(), state.potentialArrowAt = this.potentialArrowAt, state.noArrowAt = this.noArrowAt.slice(), state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice(), state.topicContext = this.topicContext, state.labels = this.labels.slice(), state.commentsLen = this.commentsLen, state.commentStack = this.commentStack.slice(), state.pos = this.pos, state.type = this.type, state.value = this.value, state.start = this.start, state.end = this.end, state.lastTokEndLoc = this.lastTokEndLoc, state.lastTokStartLoc = this.lastTokStartLoc, state.context = this.context.slice(), state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos, state.strictErrors = this.strictErrors, state.tokensLength = this.tokensLength, state;
|
35517
35524
|
}
|
35518
35525
|
}
|
35519
35526
|
var _isDigit = function(code2) {
|
@@ -35727,7 +35734,8 @@ function requireLib$1() {
|
|
35727
35734
|
const VALID_REGEX_FLAGS = /* @__PURE__ */ new Set([103, 109, 115, 105, 121, 117, 100, 118]);
|
35728
35735
|
class Token {
|
35729
35736
|
constructor(state) {
|
35730
|
-
|
35737
|
+
const startIndex = state.startIndex || 0;
|
35738
|
+
this.type = state.type, this.value = state.value, this.start = startIndex + state.start, this.end = startIndex + state.end, this.loc = new SourceLocation(state.startLoc, state.endLoc);
|
35731
35739
|
}
|
35732
35740
|
}
|
35733
35741
|
class Tokenizer extends CommentsParser {
|
@@ -35823,7 +35831,7 @@ function requireLib$1() {
|
|
35823
35831
|
}
|
35824
35832
|
nextToken() {
|
35825
35833
|
if (this.skipSpace(), this.state.start = this.state.pos, this.isLookahead || (this.state.startLoc = this.state.curPosition()), this.state.pos >= this.length) {
|
35826
|
-
this.finishToken(
|
35834
|
+
this.finishToken(140);
|
35827
35835
|
return;
|
35828
35836
|
}
|
35829
35837
|
this.getTokenFromCode(this.codePointAtPos(this.state.pos));
|
@@ -35840,8 +35848,8 @@ function requireLib$1() {
|
|
35840
35848
|
const comment = {
|
35841
35849
|
type: "CommentBlock",
|
35842
35850
|
value: this.input.slice(start + 2, end),
|
35843
|
-
start,
|
35844
|
-
end: end + commentEnd.length,
|
35851
|
+
start: this.sourceToOffsetPos(start),
|
35852
|
+
end: this.sourceToOffsetPos(end + commentEnd.length),
|
35845
35853
|
loc: new SourceLocation(startLoc, this.state.curPosition())
|
35846
35854
|
};
|
35847
35855
|
return this.options.tokens && this.pushToken(comment), comment;
|
@@ -35858,8 +35866,8 @@ function requireLib$1() {
|
|
35858
35866
|
const end = this.state.pos, comment = {
|
35859
35867
|
type: "CommentLine",
|
35860
35868
|
value: this.input.slice(start + startSkip, end),
|
35861
|
-
start,
|
35862
|
-
end,
|
35869
|
+
start: this.sourceToOffsetPos(start),
|
35870
|
+
end: this.sourceToOffsetPos(end),
|
35863
35871
|
loc: new SourceLocation(startLoc, this.state.curPosition())
|
35864
35872
|
};
|
35865
35873
|
return this.options.tokens && this.pushToken(comment), comment;
|
@@ -35920,8 +35928,8 @@ function requireLib$1() {
|
|
35920
35928
|
}
|
35921
35929
|
if (comments2.length > 0) {
|
35922
35930
|
const end = this.state.pos, commentWhitespace = {
|
35923
|
-
start: spaceStart,
|
35924
|
-
end,
|
35931
|
+
start: this.sourceToOffsetPos(spaceStart),
|
35932
|
+
end: this.sourceToOffsetPos(end),
|
35925
35933
|
comments: comments2,
|
35926
35934
|
leadingNode: null,
|
35927
35935
|
trailingNode: null,
|
@@ -35948,7 +35956,7 @@ function requireLib$1() {
|
|
35948
35956
|
if (this.expectPlugin("recordAndTuple"), this.getPluginOption("recordAndTuple", "syntaxType") === "bar")
|
35949
35957
|
throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, this.state.curPosition());
|
35950
35958
|
this.state.pos += 2, next === 123 ? this.finishToken(7) : this.finishToken(1);
|
35951
|
-
} else isIdentifierStart(next) ? (++this.state.pos, this.finishToken(
|
35959
|
+
} else isIdentifierStart(next) ? (++this.state.pos, this.finishToken(139, this.readWord1(next))) : next === 92 ? (++this.state.pos, this.finishToken(139, this.readWord1())) : this.finishOp(27, 1);
|
35952
35960
|
}
|
35953
35961
|
readToken_dot() {
|
35954
35962
|
const next = this.input.charCodeAt(this.state.pos + 1);
|
@@ -36248,7 +36256,7 @@ function requireLib$1() {
|
|
36248
36256
|
break;
|
36249
36257
|
++pos2, mods2 += char;
|
36250
36258
|
}
|
36251
|
-
this.state.pos = pos2, this.finishToken(
|
36259
|
+
this.state.pos = pos2, this.finishToken(138, {
|
36252
36260
|
pattern: content,
|
36253
36261
|
flags: mods2
|
36254
36262
|
});
|
@@ -36261,7 +36269,7 @@ function requireLib$1() {
|
|
36261
36269
|
return this.state.pos = pos2, n;
|
36262
36270
|
}
|
36263
36271
|
readRadixNumber(radix) {
|
36264
|
-
const startLoc = this.state.curPosition();
|
36272
|
+
const start = this.state.pos, startLoc = this.state.curPosition();
|
36265
36273
|
let isBigInt = !1;
|
36266
36274
|
this.state.pos += 2;
|
36267
36275
|
const val = this.readInt(radix);
|
@@ -36276,11 +36284,11 @@ function requireLib$1() {
|
|
36276
36284
|
if (isIdentifierStart(this.codePointAtPos(this.state.pos)))
|
36277
36285
|
throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
|
36278
36286
|
if (isBigInt) {
|
36279
|
-
const str2 = this.input.slice(
|
36280
|
-
this.finishToken(
|
36287
|
+
const str2 = this.input.slice(start, this.state.pos).replace(/[_n]/g, "");
|
36288
|
+
this.finishToken(136, str2);
|
36281
36289
|
return;
|
36282
36290
|
}
|
36283
|
-
this.finishToken(
|
36291
|
+
this.finishToken(135, val);
|
36284
36292
|
}
|
36285
36293
|
readNumber(startsWithDot) {
|
36286
36294
|
const start = this.state.pos, startLoc = this.state.curPosition();
|
@@ -36304,15 +36312,15 @@ function requireLib$1() {
|
|
36304
36312
|
throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
|
36305
36313
|
const str2 = this.input.slice(start, this.state.pos).replace(/[_mn]/g, "");
|
36306
36314
|
if (isBigInt) {
|
36307
|
-
this.finishToken(
|
36315
|
+
this.finishToken(136, str2);
|
36308
36316
|
return;
|
36309
36317
|
}
|
36310
36318
|
if (isDecimal) {
|
36311
|
-
this.finishToken(
|
36319
|
+
this.finishToken(137, str2);
|
36312
36320
|
return;
|
36313
36321
|
}
|
36314
36322
|
const val = isOctal ? parseInt(str2, 8) : parseFloat(str2);
|
36315
|
-
this.finishToken(
|
36323
|
+
this.finishToken(135, val);
|
36316
36324
|
}
|
36317
36325
|
readCodePoint(throwOnInvalid) {
|
36318
36326
|
const {
|
@@ -36328,7 +36336,7 @@ function requireLib$1() {
|
|
36328
36336
|
curLine,
|
36329
36337
|
lineStart
|
36330
36338
|
} = readStringContents(quote === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string);
|
36331
|
-
this.state.pos = pos2 + 1, this.state.lineStart = lineStart, this.state.curLine = curLine, this.finishToken(
|
36339
|
+
this.state.pos = pos2 + 1, this.state.lineStart = lineStart, this.state.curLine = curLine, this.finishToken(134, str2);
|
36332
36340
|
}
|
36333
36341
|
readTemplateContinuation() {
|
36334
36342
|
this.match(8) || this.unexpected(null, 8), this.state.pos--, this.readTemplateToken();
|
@@ -36341,7 +36349,7 @@ function requireLib$1() {
|
|
36341
36349
|
curLine,
|
36342
36350
|
lineStart
|
36343
36351
|
} = readStringContents("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template);
|
36344
|
-
this.state.pos = pos2 + 1, this.state.lineStart = lineStart, this.state.curLine = curLine, firstInvalidLoc && (this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, firstInvalidLoc.pos)), this.input.codePointAt(pos2) === 96 ? this.finishToken(24, firstInvalidLoc ? null : opening + str2 + "`") : (this.state.pos++, this.finishToken(25, firstInvalidLoc ? null : opening + str2 + "${"));
|
36352
|
+
this.state.pos = pos2 + 1, this.state.lineStart = lineStart, this.state.curLine = curLine, firstInvalidLoc && (this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, this.sourceToOffsetPos(firstInvalidLoc.pos))), this.input.codePointAt(pos2) === 96 ? this.finishToken(24, firstInvalidLoc ? null : opening + str2 + "`") : (this.state.pos++, this.finishToken(25, firstInvalidLoc ? null : opening + str2 + "${"));
|
36345
36353
|
}
|
36346
36354
|
recordStrictModeErrors(toParseError, at) {
|
36347
36355
|
const index = at.index;
|
@@ -36632,10 +36640,10 @@ function requireLib$1() {
|
|
36632
36640
|
}
|
36633
36641
|
}
|
36634
36642
|
canInsertSemicolon() {
|
36635
|
-
return this.match(
|
36643
|
+
return this.match(140) || this.match(8) || this.hasPrecedingLineBreak();
|
36636
36644
|
}
|
36637
36645
|
hasPrecedingLineBreak() {
|
36638
|
-
return hasNewLine(this.input, this.state.lastTokEndLoc.index, this.state.start);
|
36646
|
+
return hasNewLine(this.input, this.offsetToSourcePos(this.state.lastTokEndLoc.index), this.state.start);
|
36639
36647
|
}
|
36640
36648
|
hasFollowingLineBreak() {
|
36641
36649
|
return hasNewLine(this.input, this.state.end, this.nextTokenStart());
|
@@ -36952,7 +36960,7 @@ function requireLib$1() {
|
|
36952
36960
|
return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
|
36953
36961
|
}
|
36954
36962
|
finishToken(type2, val) {
|
36955
|
-
type2 !==
|
36963
|
+
type2 !== 134 && type2 !== 13 && type2 !== 28 && this.flowPragma === void 0 && (this.flowPragma = null), super.finishToken(type2, val);
|
36956
36964
|
}
|
36957
36965
|
addComment(comment) {
|
36958
36966
|
if (this.flowPragma === void 0) {
|
@@ -37015,7 +37023,7 @@ function requireLib$1() {
|
|
37015
37023
|
return this.next(), node.id = this.flowParseTypeAnnotatableIdentifier(!0), this.scope.declareName(node.id.name, 5, node.id.loc.start), this.semicolon(), this.finishNode(node, "DeclareVariable");
|
37016
37024
|
}
|
37017
37025
|
flowParseDeclareModule(node) {
|
37018
|
-
this.scope.enter(0), this.match(
|
37026
|
+
this.scope.enter(0), this.match(134) ? node.id = super.parseExprAtom() : node.id = this.parseIdentifier();
|
37019
37027
|
const bodyNode = node.body = this.startNode(), body = bodyNode.body = [];
|
37020
37028
|
for (this.expect(5); !this.match(8); ) {
|
37021
37029
|
let bodyNode2 = this.startNode();
|
@@ -37112,7 +37120,7 @@ function requireLib$1() {
|
|
37112
37120
|
}
|
37113
37121
|
flowParseTypeParameterDeclaration() {
|
37114
37122
|
const oldInType = this.state.inType, node = this.startNode();
|
37115
|
-
node.params = [], this.state.inType = !0, this.match(47) || this.match(
|
37123
|
+
node.params = [], this.state.inType = !0, this.match(47) || this.match(143) ? this.next() : this.unexpected();
|
37116
37124
|
let defaultRequired = !1;
|
37117
37125
|
do {
|
37118
37126
|
const typeParameter = this.flowParseTypeParameter(defaultRequired);
|
@@ -37149,7 +37157,7 @@ function requireLib$1() {
|
|
37149
37157
|
}), this.finishNode(node, "InterfaceTypeAnnotation");
|
37150
37158
|
}
|
37151
37159
|
flowParseObjectPropertyKey() {
|
37152
|
-
return this.match(
|
37160
|
+
return this.match(135) || this.match(134) ? super.parseExprAtom() : this.parseIdentifier(!0);
|
37153
37161
|
}
|
37154
37162
|
flowParseObjectTypeIndexer(node, isStatic, variance) {
|
37155
37163
|
return node.static = isStatic, this.lookahead().type === 14 ? (node.id = this.flowParseObjectPropertyKey(), node.key = this.flowParseTypeInitialiser()) : (node.id = null, node.key = this.flowParseType()), this.expect(3), node.value = this.flowParseTypeInitialiser(), node.variance = variance, this.finishNode(node, "ObjectTypeIndexer");
|
@@ -37331,24 +37339,24 @@ function requireLib$1() {
|
|
37331
37339
|
}
|
37332
37340
|
return type2 ? tmp2 = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type2)]) : tmp2 = this.flowParseFunctionTypeParams(), node2.params = tmp2.params, node2.rest = tmp2.rest, node2.this = tmp2._this, this.expect(11), this.expect(19), node2.returnType = this.flowParseType(), node2.typeParameters = null, this.finishNode(node2, "FunctionTypeAnnotation");
|
37333
37341
|
}
|
37334
|
-
case
|
37342
|
+
case 134:
|
37335
37343
|
return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
|
37336
37344
|
case 85:
|
37337
37345
|
case 86:
|
37338
37346
|
return node.value = this.match(85), this.next(), this.finishNode(node, "BooleanLiteralTypeAnnotation");
|
37339
37347
|
case 53:
|
37340
37348
|
if (this.state.value === "-") {
|
37341
|
-
if (this.next(), this.match(
|
37349
|
+
if (this.next(), this.match(135))
|
37342
37350
|
return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node);
|
37343
|
-
if (this.match(
|
37351
|
+
if (this.match(136))
|
37344
37352
|
return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node);
|
37345
37353
|
throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc);
|
37346
37354
|
}
|
37347
37355
|
this.unexpected();
|
37348
37356
|
return;
|
37349
|
-
case 134:
|
37350
|
-
return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
|
37351
37357
|
case 135:
|
37358
|
+
return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
|
37359
|
+
case 136:
|
37352
37360
|
return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation");
|
37353
37361
|
case 88:
|
37354
37362
|
return this.next(), this.finishNode(node, "VoidTypeAnnotation");
|
@@ -37455,7 +37463,7 @@ function requireLib$1() {
|
|
37455
37463
|
const node = this.startNode();
|
37456
37464
|
return this.next(), this.flowParseInterface(node);
|
37457
37465
|
}
|
37458
|
-
} else if (this.
|
37466
|
+
} else if (this.isContextual(126)) {
|
37459
37467
|
const node = this.startNode();
|
37460
37468
|
return this.next(), this.flowParseEnumDeclaration(node);
|
37461
37469
|
}
|
@@ -37482,16 +37490,16 @@ function requireLib$1() {
|
|
37482
37490
|
const {
|
37483
37491
|
type: type2
|
37484
37492
|
} = this.state;
|
37485
|
-
return
|
37493
|
+
return type2 === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type2) ? !this.state.containsEsc : super.shouldParseExportDeclaration();
|
37486
37494
|
}
|
37487
37495
|
isExportDefaultSpecifier() {
|
37488
37496
|
const {
|
37489
37497
|
type: type2
|
37490
37498
|
} = this.state;
|
37491
|
-
return
|
37499
|
+
return type2 === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type2) ? this.state.containsEsc : super.isExportDefaultSpecifier();
|
37492
37500
|
}
|
37493
37501
|
parseExportDefaultExpression() {
|
37494
|
-
if (this.
|
37502
|
+
if (this.isContextual(126)) {
|
37495
37503
|
const node = this.startNode();
|
37496
37504
|
return this.next(), this.flowParseEnumDeclaration(node);
|
37497
37505
|
}
|
@@ -37550,7 +37558,7 @@ function requireLib$1() {
|
|
37550
37558
|
}
|
37551
37559
|
forwardNoArrowParamsConversionAt(node, parse4) {
|
37552
37560
|
let result;
|
37553
|
-
return this.state.noArrowParamsConversionAt.includes(node.start) ? (this.state.noArrowParamsConversionAt.push(this.state.start), result = parse4(), this.state.noArrowParamsConversionAt.pop()) : result = parse4(), result;
|
37561
|
+
return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start)) ? (this.state.noArrowParamsConversionAt.push(this.state.start), result = parse4(), this.state.noArrowParamsConversionAt.pop()) : result = parse4(), result;
|
37554
37562
|
}
|
37555
37563
|
parseParenItem(node, startLoc) {
|
37556
37564
|
const newNode = super.parseParenItem(node, startLoc);
|
@@ -37576,7 +37584,7 @@ function requireLib$1() {
|
|
37576
37584
|
node.exportKind = "type";
|
37577
37585
|
const declarationNode = this.startNode();
|
37578
37586
|
return this.next(), this.flowParseInterface(declarationNode);
|
37579
|
-
} else if (this.
|
37587
|
+
} else if (this.isContextual(126)) {
|
37580
37588
|
node.exportKind = "value";
|
37581
37589
|
const declarationNode = this.startNode();
|
37582
37590
|
return this.next(), this.flowParseEnumDeclaration(declarationNode);
|
@@ -37783,7 +37791,7 @@ function requireLib$1() {
|
|
37783
37791
|
parseMaybeAssign(refExpressionErrors, afterLeftParse) {
|
37784
37792
|
var _jsx;
|
37785
37793
|
let state = null, jsx3;
|
37786
|
-
if (this.hasPlugin("jsx") && (this.match(
|
37794
|
+
if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) {
|
37787
37795
|
if (state = this.state.clone(), jsx3 = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state), !jsx3.error) return jsx3.node;
|
37788
37796
|
const {
|
37789
37797
|
context
|
@@ -37836,23 +37844,23 @@ function requireLib$1() {
|
|
37836
37844
|
return this.match(14) || super.shouldParseArrow(params);
|
37837
37845
|
}
|
37838
37846
|
setArrowFunctionParameters(node, params) {
|
37839
|
-
this.state.noArrowParamsConversionAt.includes(node.start) ? node.params = params : super.setArrowFunctionParameters(node, params);
|
37847
|
+
this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start)) ? node.params = params : super.setArrowFunctionParameters(node, params);
|
37840
37848
|
}
|
37841
37849
|
checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = !0) {
|
37842
|
-
if (!(isArrowFunction && this.state.noArrowParamsConversionAt.includes(node.start))) {
|
37850
|
+
if (!(isArrowFunction && this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start)))) {
|
37843
37851
|
for (let i = 0; i < node.params.length; i++)
|
37844
37852
|
this.isThisParam(node.params[i]) && i > 0 && this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]);
|
37845
37853
|
super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged);
|
37846
37854
|
}
|
37847
37855
|
}
|
37848
37856
|
parseParenAndDistinguishExpression(canBeArrow) {
|
37849
|
-
return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.state.start));
|
37857
|
+
return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)));
|
37850
37858
|
}
|
37851
37859
|
parseSubscripts(base2, startLoc, noCalls) {
|
37852
37860
|
if (base2.type === "Identifier" && base2.name === "async" && this.state.noArrowAt.includes(startLoc.index)) {
|
37853
37861
|
this.next();
|
37854
37862
|
const node = this.startNodeAt(startLoc);
|
37855
|
-
node.callee = base2, node.arguments = super.parseCallExpressionArguments(11
|
37863
|
+
node.callee = base2, node.arguments = super.parseCallExpressionArguments(11), base2 = this.finishNode(node, "CallExpression");
|
37856
37864
|
} else if (base2.type === "Identifier" && base2.name === "async" && this.match(47)) {
|
37857
37865
|
const state = this.state.clone(), arrow4 = this.tryParse((abort) => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state);
|
37858
37866
|
if (!arrow4.error && !arrow4.aborted) return arrow4.node;
|
@@ -37872,11 +37880,11 @@ function requireLib$1() {
|
|
37872
37880
|
return subscriptState.stop = !0, base2;
|
37873
37881
|
this.next();
|
37874
37882
|
const node = this.startNodeAt(startLoc);
|
37875
|
-
return node.callee = base2, node.typeArguments = this.flowParseTypeParameterInstantiation(), this.expect(10), node.arguments = this.parseCallExpressionArguments(11
|
37883
|
+
return node.callee = base2, node.typeArguments = this.flowParseTypeParameterInstantiation(), this.expect(10), node.arguments = this.parseCallExpressionArguments(11), node.optional = !0, this.finishCallExpression(node, !0);
|
37876
37884
|
} else if (!noCalls && this.shouldParseTypes() && this.match(47)) {
|
37877
37885
|
const node = this.startNodeAt(startLoc);
|
37878
37886
|
node.callee = base2;
|
37879
|
-
const result = this.tryParse(() => (node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(), this.expect(10), node.arguments = super.parseCallExpressionArguments(11
|
37887
|
+
const result = this.tryParse(() => (node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(), this.expect(10), node.arguments = super.parseCallExpressionArguments(11), subscriptState.optionalChainMember && (node.optional = !1), this.finishCallExpression(node, subscriptState.optionalChainMember)));
|
37880
37888
|
if (result.node)
|
37881
37889
|
return result.error && (this.state = result.failState), result.node;
|
37882
37890
|
}
|
@@ -37958,7 +37966,7 @@ function requireLib$1() {
|
|
37958
37966
|
flowEnumMemberInit() {
|
37959
37967
|
const startLoc = this.state.startLoc, endOfInit = () => this.match(12) || this.match(8);
|
37960
37968
|
switch (this.state.type) {
|
37961
|
-
case
|
37969
|
+
case 135: {
|
37962
37970
|
const literal2 = this.parseNumericLiteral(this.state.value);
|
37963
37971
|
return endOfInit() ? {
|
37964
37972
|
type: "number",
|
@@ -37969,7 +37977,7 @@ function requireLib$1() {
|
|
37969
37977
|
loc: startLoc
|
37970
37978
|
};
|
37971
37979
|
}
|
37972
|
-
case
|
37980
|
+
case 134: {
|
37973
37981
|
const literal2 = this.parseStringLiteral(this.state.value);
|
37974
37982
|
return endOfInit() ? {
|
37975
37983
|
type: "string",
|
@@ -38484,10 +38492,10 @@ function requireLib$1() {
|
|
38484
38492
|
case 60:
|
38485
38493
|
case 123:
|
38486
38494
|
if (this.state.pos === this.state.start) {
|
38487
|
-
ch === 60 && this.state.canStartJSXElement ? (++this.state.pos, this.finishToken(
|
38495
|
+
ch === 60 && this.state.canStartJSXElement ? (++this.state.pos, this.finishToken(143)) : super.getTokenFromCode(ch);
|
38488
38496
|
return;
|
38489
38497
|
}
|
38490
|
-
out += this.input.slice(chunkStart, this.state.pos), this.finishToken(
|
38498
|
+
out += this.input.slice(chunkStart, this.state.pos), this.finishToken(142, out);
|
38491
38499
|
return;
|
38492
38500
|
case 38:
|
38493
38501
|
out += this.input.slice(chunkStart, this.state.pos), out += this.jsxReadEntity(), chunkStart = this.state.pos;
|
@@ -38515,7 +38523,7 @@ function requireLib$1() {
|
|
38515
38523
|
if (ch === quote) break;
|
38516
38524
|
ch === 38 ? (out += this.input.slice(chunkStart, this.state.pos), out += this.jsxReadEntity(), chunkStart = this.state.pos) : isNewLine(ch) ? (out += this.input.slice(chunkStart, this.state.pos), out += this.jsxReadNewLine(!1), chunkStart = this.state.pos) : ++this.state.pos;
|
38517
38525
|
}
|
38518
|
-
out += this.input.slice(chunkStart, this.state.pos++), this.finishToken(
|
38526
|
+
out += this.input.slice(chunkStart, this.state.pos++), this.finishToken(134, out);
|
38519
38527
|
}
|
38520
38528
|
jsxReadEntity() {
|
38521
38529
|
const startPos = ++this.state.pos;
|
@@ -38544,11 +38552,11 @@ function requireLib$1() {
|
|
38544
38552
|
do
|
38545
38553
|
ch = this.input.charCodeAt(++this.state.pos);
|
38546
38554
|
while (isIdentifierChar(ch) || ch === 45);
|
38547
|
-
this.finishToken(
|
38555
|
+
this.finishToken(141, this.input.slice(start, this.state.pos));
|
38548
38556
|
}
|
38549
38557
|
jsxParseIdentifier() {
|
38550
38558
|
const node = this.startNode();
|
38551
|
-
return this.match(
|
38559
|
+
return this.match(141) ? node.name = this.state.value : tokenIsKeyword(this.state.type) ? node.name = tokenLabelName(this.state.type) : this.unexpected(), this.next(), this.finishNode(node, "JSXIdentifier");
|
38552
38560
|
}
|
38553
38561
|
jsxParseNamespacedName() {
|
38554
38562
|
const startLoc = this.state.startLoc, name = this.jsxParseIdentifier();
|
@@ -38572,8 +38580,8 @@ function requireLib$1() {
|
|
38572
38580
|
switch (this.state.type) {
|
38573
38581
|
case 5:
|
38574
38582
|
return node = this.startNode(), this.setContext(types2.brace), this.next(), node = this.jsxParseExpressionContainer(node, types2.j_oTag), node.expression.type === "JSXEmptyExpression" && this.raise(JsxErrors.AttributeIsEmpty, node), node;
|
38575
|
-
case
|
38576
|
-
case
|
38583
|
+
case 143:
|
38584
|
+
case 134:
|
38577
38585
|
return this.parseExprAtom();
|
38578
38586
|
default:
|
38579
38587
|
throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc);
|
@@ -38601,17 +38609,17 @@ function requireLib$1() {
|
|
38601
38609
|
}
|
38602
38610
|
jsxParseOpeningElementAt(startLoc) {
|
38603
38611
|
const node = this.startNodeAt(startLoc);
|
38604
|
-
return this.eat(
|
38612
|
+
return this.eat(144) ? this.finishNode(node, "JSXOpeningFragment") : (node.name = this.jsxParseElementName(), this.jsxParseOpeningElementAfterName(node));
|
38605
38613
|
}
|
38606
38614
|
jsxParseOpeningElementAfterName(node) {
|
38607
38615
|
const attributes = [];
|
38608
|
-
for (; !this.match(56) && !this.match(
|
38616
|
+
for (; !this.match(56) && !this.match(144); )
|
38609
38617
|
attributes.push(this.jsxParseAttribute());
|
38610
|
-
return node.attributes = attributes, node.selfClosing = this.eat(56), this.expect(
|
38618
|
+
return node.attributes = attributes, node.selfClosing = this.eat(56), this.expect(144), this.finishNode(node, "JSXOpeningElement");
|
38611
38619
|
}
|
38612
38620
|
jsxParseClosingElementAt(startLoc) {
|
38613
38621
|
const node = this.startNodeAt(startLoc);
|
38614
|
-
return this.eat(
|
38622
|
+
return this.eat(144) ? this.finishNode(node, "JSXClosingFragment") : (node.name = this.jsxParseElementName(), this.expect(144), this.finishNode(node, "JSXClosingElement"));
|
38615
38623
|
}
|
38616
38624
|
jsxParseElementAt(startLoc) {
|
38617
38625
|
const node = this.startNodeAt(startLoc), children = [], openingElement = this.jsxParseOpeningElementAt(startLoc);
|
@@ -38619,14 +38627,14 @@ function requireLib$1() {
|
|
38619
38627
|
if (!openingElement.selfClosing) {
|
38620
38628
|
contents: for (; ; )
|
38621
38629
|
switch (this.state.type) {
|
38622
|
-
case
|
38630
|
+
case 143:
|
38623
38631
|
if (startLoc = this.state.startLoc, this.next(), this.eat(56)) {
|
38624
38632
|
closingElement = this.jsxParseClosingElementAt(startLoc);
|
38625
38633
|
break contents;
|
38626
38634
|
}
|
38627
38635
|
children.push(this.jsxParseElementAt(startLoc));
|
38628
38636
|
break;
|
38629
|
-
case
|
38637
|
+
case 142:
|
38630
38638
|
children.push(this.parseLiteral(this.state.value, "JSXText"));
|
38631
38639
|
break;
|
38632
38640
|
case 5: {
|
@@ -38658,7 +38666,7 @@ function requireLib$1() {
|
|
38658
38666
|
context[context.length - 1] = newContext;
|
38659
38667
|
}
|
38660
38668
|
parseExprAtom(refExpressionErrors) {
|
38661
|
-
return this.match(
|
38669
|
+
return this.match(143) ? this.jsxParseElement() : this.match(47) && this.input.charCodeAt(this.state.pos) !== 33 ? (this.replaceToken(143), this.jsxParseElement()) : super.parseExprAtom(refExpressionErrors);
|
38662
38670
|
}
|
38663
38671
|
skipSpace() {
|
38664
38672
|
this.curContext().preserveSpace || super.skipSpace();
|
@@ -38675,7 +38683,7 @@ function requireLib$1() {
|
|
38675
38683
|
return;
|
38676
38684
|
}
|
38677
38685
|
if (code2 === 62) {
|
38678
|
-
++this.state.pos, this.finishToken(
|
38686
|
+
++this.state.pos, this.finishToken(144);
|
38679
38687
|
return;
|
38680
38688
|
}
|
38681
38689
|
if ((code2 === 34 || code2 === 39) && context === types2.j_oTag) {
|
@@ -38684,7 +38692,7 @@ function requireLib$1() {
|
|
38684
38692
|
}
|
38685
38693
|
}
|
38686
38694
|
if (code2 === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) {
|
38687
|
-
++this.state.pos, this.finishToken(
|
38695
|
+
++this.state.pos, this.finishToken(143);
|
38688
38696
|
return;
|
38689
38697
|
}
|
38690
38698
|
super.getTokenFromCode(code2);
|
@@ -38694,11 +38702,11 @@ function requireLib$1() {
|
|
38694
38702
|
context,
|
38695
38703
|
type: type2
|
38696
38704
|
} = this.state;
|
38697
|
-
if (type2 === 56 && prevType ===
|
38705
|
+
if (type2 === 56 && prevType === 143)
|
38698
38706
|
context.splice(-2, 2, types2.j_cTag), this.state.canStartJSXElement = !1;
|
38699
|
-
else if (type2 ===
|
38707
|
+
else if (type2 === 143)
|
38700
38708
|
context.push(types2.j_oTag);
|
38701
|
-
else if (type2 ===
|
38709
|
+
else if (type2 === 144) {
|
38702
38710
|
const out = context[context.length - 1];
|
38703
38711
|
out === types2.j_oTag && prevType === 56 || out === types2.j_cTag ? (context.pop(), this.state.canStartJSXElement = context[context.length - 1] === types2.j_expr) : (this.setContext(types2.j_expr), this.state.canStartJSXElement = !0);
|
38704
38712
|
} else
|
@@ -38931,7 +38939,7 @@ function requireLib$1() {
|
|
38931
38939
|
if (type2 === 21)
|
38932
38940
|
return this.parseBindingRestProperty(this.startNode());
|
38933
38941
|
const prop = this.startNode();
|
38934
|
-
return type2 ===
|
38942
|
+
return type2 === 139 ? (this.expectPlugin("destructuringPrivate", startLoc), this.classScope.usePrivateName(this.state.value, startLoc), prop.key = this.parsePrivateName()) : this.parsePropertyName(prop), prop.method = !1, this.parseObjPropValue(prop, startLoc, !1, !1, !0, !1);
|
38935
38943
|
}
|
38936
38944
|
parseAssignableListItem(flags, decorators) {
|
38937
38945
|
const left = this.parseMaybeDefault();
|
@@ -39192,7 +39200,7 @@ function requireLib$1() {
|
|
39192
39200
|
return tokenIsIdentifier(this.state.type);
|
39193
39201
|
}
|
39194
39202
|
tsTokenCanFollowModifier() {
|
39195
|
-
return this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(
|
39203
|
+
return this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(139) || this.isLiteralPropertyName();
|
39196
39204
|
}
|
39197
39205
|
tsNextTokenOnSameLineAndCanFollowModifier() {
|
39198
39206
|
return this.next(), this.hasPrecedingLineBreak() ? !1 : this.tsTokenCanFollowModifier();
|
@@ -39290,7 +39298,7 @@ function requireLib$1() {
|
|
39290
39298
|
}
|
39291
39299
|
tsParseImportType() {
|
39292
39300
|
const node = this.startNode();
|
39293
|
-
return this.expect(83), this.expect(10), this.match(
|
39301
|
+
return this.expect(83), this.expect(10), this.match(134) || this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc), node.argument = super.parseExprAtom(), this.eat(12) && !this.match(11) ? (node.options = super.parseMaybeAssignAllowIn(), this.eat(12)) : node.options = null, this.expect(11), this.eat(16) && (node.qualifier = this.tsParseEntityName()), this.match(47) && (node.typeParameters = this.tsParseTypeArguments()), this.finishNode(node, "TSImportType");
|
39294
39302
|
}
|
39295
39303
|
tsParseEntityName(allowReservedWords = !0) {
|
39296
39304
|
let entity = this.parseIdentifier(allowReservedWords);
|
@@ -39327,7 +39335,7 @@ function requireLib$1() {
|
|
39327
39335
|
}
|
39328
39336
|
tsParseTypeParameters(parseModifiers) {
|
39329
39337
|
const node = this.startNode();
|
39330
|
-
this.match(47) || this.match(
|
39338
|
+
this.match(47) || this.match(143) ? this.next() : this.unexpected();
|
39331
39339
|
const refTrailingCommaPos = {
|
39332
39340
|
value: -1
|
39333
39341
|
};
|
@@ -39480,9 +39488,9 @@ function requireLib$1() {
|
|
39480
39488
|
tsParseLiteralTypeNode() {
|
39481
39489
|
const node = this.startNode();
|
39482
39490
|
switch (this.state.type) {
|
39483
|
-
case 134:
|
39484
39491
|
case 135:
|
39485
|
-
case
|
39492
|
+
case 136:
|
39493
|
+
case 134:
|
39486
39494
|
case 85:
|
39487
39495
|
case 86:
|
39488
39496
|
node.literal = super.parseExprAtom();
|
@@ -39505,16 +39513,16 @@ function requireLib$1() {
|
|
39505
39513
|
}
|
39506
39514
|
tsParseNonArrayType() {
|
39507
39515
|
switch (this.state.type) {
|
39508
|
-
case 133:
|
39509
39516
|
case 134:
|
39510
39517
|
case 135:
|
39518
|
+
case 136:
|
39511
39519
|
case 85:
|
39512
39520
|
case 86:
|
39513
39521
|
return this.tsParseLiteralTypeNode();
|
39514
39522
|
case 53:
|
39515
39523
|
if (this.state.value === "-") {
|
39516
39524
|
const node = this.startNode(), nextToken = this.lookahead();
|
39517
|
-
return nextToken.type !==
|
39525
|
+
return nextToken.type !== 135 && nextToken.type !== 136 && this.unexpected(), node.literal = this.parseMaybeUnary(), this.finishNode(node, "TSLiteralType");
|
39518
39526
|
}
|
39519
39527
|
break;
|
39520
39528
|
case 78:
|
@@ -39770,7 +39778,7 @@ function requireLib$1() {
|
|
39770
39778
|
}
|
39771
39779
|
tsParseEnumMember() {
|
39772
39780
|
const node = this.startNode();
|
39773
|
-
return node.id = this.match(
|
39781
|
+
return node.id = this.match(134) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(!0), this.eat(29) && (node.initializer = super.parseMaybeAssignAllowIn()), this.finishNode(node, "TSEnumMember");
|
39774
39782
|
}
|
39775
39783
|
tsParseEnumDeclaration(node, properties = {}) {
|
39776
39784
|
return properties.const && (node.const = !0), properties.declare && (node.declare = !0), this.expectContextual(126), node.id = this.parseIdentifier(), this.checkIdentifier(node.id, node.const ? 8971 : 8459), this.expect(5), node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)), this.expect(8), this.finishNode(node, "TSEnumDeclaration");
|
@@ -39788,7 +39796,7 @@ function requireLib$1() {
|
|
39788
39796
|
return this.finishNode(node, "TSModuleDeclaration");
|
39789
39797
|
}
|
39790
39798
|
tsParseAmbientExternalModuleDeclaration(node) {
|
39791
|
-
return this.isContextual(112) ? (node.global = !0, node.id = this.parseIdentifier()) : this.match(
|
39799
|
+
return this.isContextual(112) ? (node.kind = "global", node.global = !0, node.id = this.parseIdentifier()) : this.match(134) ? (node.kind = "module", node.id = super.parseStringLiteral(this.state.value)) : this.unexpected(), this.match(5) ? (this.scope.enter(256), this.prodParam.enter(0), node.body = this.tsParseModuleBlock(), this.prodParam.exit(), this.scope.exit()) : this.semicolon(), this.finishNode(node, "TSModuleDeclaration");
|
39792
39800
|
}
|
39793
39801
|
tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, isExport) {
|
39794
39802
|
node.isExport = isExport || !1, node.id = maybeDefaultIdentifier || this.parseIdentifier(), this.checkIdentifier(node.id, 4096), this.expect(29);
|
@@ -39803,7 +39811,7 @@ function requireLib$1() {
|
|
39803
39811
|
}
|
39804
39812
|
tsParseExternalModuleReference() {
|
39805
39813
|
const node = this.startNode();
|
39806
|
-
return this.expectContextual(119), this.expect(10), this.match(
|
39814
|
+
return this.expectContextual(119), this.expect(10), this.match(134) || this.unexpected(), node.expression = super.parseExprAtom(), this.expect(11), this.sawUnambiguousESM = !0, this.finishNode(node, "TSExternalModuleReference");
|
39807
39815
|
}
|
39808
39816
|
tsLookAhead(f) {
|
39809
39817
|
const state = this.state.clone(), res = f();
|
@@ -39867,7 +39875,7 @@ function requireLib$1() {
|
|
39867
39875
|
if (this.match(5)) {
|
39868
39876
|
this.scope.enter(256), this.prodParam.enter(0);
|
39869
39877
|
const mod = node;
|
39870
|
-
return mod.global = !0, mod.id = expr, mod.body = this.tsParseModuleBlock(), this.scope.exit(), this.prodParam.exit(), this.finishNode(mod, "TSModuleDeclaration");
|
39878
|
+
return mod.kind = "global", mod.global = !0, mod.id = expr, mod.body = this.tsParseModuleBlock(), this.scope.exit(), this.prodParam.exit(), this.finishNode(mod, "TSModuleDeclaration");
|
39871
39879
|
}
|
39872
39880
|
break;
|
39873
39881
|
default:
|
@@ -39882,15 +39890,15 @@ function requireLib$1() {
|
|
39882
39890
|
break;
|
39883
39891
|
case "module":
|
39884
39892
|
if (this.tsCheckLineTerminator(next)) {
|
39885
|
-
if (this.match(
|
39893
|
+
if (this.match(134))
|
39886
39894
|
return this.tsParseAmbientExternalModuleDeclaration(node);
|
39887
39895
|
if (tokenIsIdentifier(this.state.type))
|
39888
|
-
return this.tsParseModuleOrNamespaceDeclaration(node);
|
39896
|
+
return node.kind = "module", this.tsParseModuleOrNamespaceDeclaration(node);
|
39889
39897
|
}
|
39890
39898
|
break;
|
39891
39899
|
case "namespace":
|
39892
39900
|
if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type))
|
39893
|
-
return this.tsParseModuleOrNamespaceDeclaration(node);
|
39901
|
+
return node.kind = "namespace", this.tsParseModuleOrNamespaceDeclaration(node);
|
39894
39902
|
break;
|
39895
39903
|
case "type":
|
39896
39904
|
if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type))
|
@@ -40004,7 +40012,7 @@ function requireLib$1() {
|
|
40004
40012
|
}
|
40005
40013
|
if (!noCalls && this.eat(10)) {
|
40006
40014
|
const node2 = this.startNodeAt(startLoc);
|
40007
|
-
return node2.callee = base2, node2.arguments = this.parseCallExpressionArguments(11
|
40015
|
+
return node2.callee = base2, node2.arguments = this.parseCallExpressionArguments(11), this.tsCheckForInvalidTypeCasts(node2.arguments), node2.typeParameters = typeArguments, state.optionalChainMember && (node2.optional = isOptionalCall), this.finishCallExpression(node2, state.optionalChainMember);
|
40008
40016
|
}
|
40009
40017
|
const tokenType = this.state.type;
|
40010
40018
|
if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak())
|
@@ -40055,7 +40063,7 @@ function requireLib$1() {
|
|
40055
40063
|
super.applyImportPhase(node, isExport, phase, loc), isExport ? node.exportKind = phase === "type" ? "type" : "value" : node.importKind = phase === "type" || phase === "typeof" ? phase : "value";
|
40056
40064
|
}
|
40057
40065
|
parseImport(node) {
|
40058
|
-
if (this.match(
|
40066
|
+
if (this.match(134))
|
40059
40067
|
return node.importKind = "value", super.parseImport(node);
|
40060
40068
|
let importNode;
|
40061
40069
|
if (tokenIsIdentifier(this.state.type) && this.lookaheadCharCode() === 61)
|
@@ -40207,7 +40215,7 @@ function requireLib$1() {
|
|
40207
40215
|
key: key2
|
40208
40216
|
} = node;
|
40209
40217
|
this.raise(TSErrors.AbstractPropertyHasInitializer, this.state.startLoc, {
|
40210
|
-
propertyName: key2.type === "Identifier" && !node.computed ? key2.name : `[${this.input.slice(key2.start, key2.end)}]`
|
40218
|
+
propertyName: key2.type === "Identifier" && !node.computed ? key2.name : `[${this.input.slice(this.offsetToSourcePos(key2.start), this.offsetToSourcePos(key2.end))}]`
|
40211
40219
|
});
|
40212
40220
|
}
|
40213
40221
|
return super.parseClassProperty(node);
|
@@ -40260,7 +40268,7 @@ function requireLib$1() {
|
|
40260
40268
|
parseMaybeAssign(refExpressionErrors, afterLeftParse) {
|
40261
40269
|
var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2;
|
40262
40270
|
let state, jsx3, typeCast;
|
40263
|
-
if (this.hasPlugin("jsx") && (this.match(
|
40271
|
+
if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) {
|
40264
40272
|
if (state = this.state.clone(), jsx3 = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state), !jsx3.error) return jsx3.node;
|
40265
40273
|
const {
|
40266
40274
|
context
|
@@ -40504,7 +40512,7 @@ function requireLib$1() {
|
|
40504
40512
|
key: key2
|
40505
40513
|
} = method;
|
40506
40514
|
this.raise(TSErrors.AbstractMethodHasImplementation, method, {
|
40507
|
-
methodName: key2.type === "Identifier" && !method.computed ? key2.name : `[${this.input.slice(key2.start, key2.end)}]`
|
40515
|
+
methodName: key2.type === "Identifier" && !method.computed ? key2.name : `[${this.input.slice(this.offsetToSourcePos(key2.start), this.offsetToSourcePos(key2.end))}]`
|
40508
40516
|
});
|
40509
40517
|
}
|
40510
40518
|
return method;
|
@@ -40593,9 +40601,9 @@ function requireLib$1() {
|
|
40593
40601
|
});
|
40594
40602
|
var placeholders = (superClass) => class extends superClass {
|
40595
40603
|
parsePlaceholder(expectedNode) {
|
40596
|
-
if (this.match(
|
40604
|
+
if (this.match(133)) {
|
40597
40605
|
const node = this.startNode();
|
40598
|
-
return this.next(), this.assertNoSpace(), node.name = super.parseIdentifier(!0), this.assertNoSpace(), this.expect(
|
40606
|
+
return this.next(), this.assertNoSpace(), node.name = super.parseIdentifier(!0), this.assertNoSpace(), this.expect(133), this.finishPlaceholder(node, expectedNode);
|
40599
40607
|
}
|
40600
40608
|
}
|
40601
40609
|
finishPlaceholder(node, expectedNode) {
|
@@ -40603,7 +40611,7 @@ function requireLib$1() {
|
|
40603
40611
|
return (!placeholder.expectedNode || !placeholder.type) && (placeholder = this.finishNode(placeholder, "Placeholder")), placeholder.expectedNode = expectedNode, placeholder;
|
40604
40612
|
}
|
40605
40613
|
getTokenFromCode(code2) {
|
40606
|
-
code2 === 37 && this.input.charCodeAt(this.state.pos + 1) === 37 ? this.finishOp(
|
40614
|
+
code2 === 37 && this.input.charCodeAt(this.state.pos + 1) === 37 ? this.finishOp(133, 2) : super.getTokenFromCode(code2);
|
40607
40615
|
}
|
40608
40616
|
parseExprAtom(refExpressionErrors) {
|
40609
40617
|
return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors);
|
@@ -40624,7 +40632,7 @@ function requireLib$1() {
|
|
40624
40632
|
node && node.type === "Placeholder" && node.expectedNode === "Expression" ? node.expectedNode = "Pattern" : super.toAssignable(node, isLHS);
|
40625
40633
|
}
|
40626
40634
|
chStartsBindingIdentifier(ch, pos2) {
|
40627
|
-
return !!(super.chStartsBindingIdentifier(ch, pos2) || this.lookahead().type ===
|
40635
|
+
return !!(super.chStartsBindingIdentifier(ch, pos2) || this.lookahead().type === 133);
|
40628
40636
|
}
|
40629
40637
|
verifyBreakContinue(node, isBreak) {
|
40630
40638
|
node.label && node.label.type === "Placeholder" || super.verifyBreakContinue(node, isBreak);
|
@@ -40652,7 +40660,7 @@ function requireLib$1() {
|
|
40652
40660
|
this.next();
|
40653
40661
|
const oldStrict = this.state.strict, placeholder = this.parsePlaceholder("Identifier");
|
40654
40662
|
if (placeholder)
|
40655
|
-
if (this.match(81) || this.match(
|
40663
|
+
if (this.match(81) || this.match(133) || this.match(5))
|
40656
40664
|
node.id = placeholder;
|
40657
40665
|
else {
|
40658
40666
|
if (optionalId || !isStatement)
|
@@ -40676,7 +40684,7 @@ function requireLib$1() {
|
|
40676
40684
|
isExportDefaultSpecifier() {
|
40677
40685
|
if (this.match(65)) {
|
40678
40686
|
const next = this.nextTokenStart();
|
40679
|
-
if (this.isUnparsedContextual(next, "from") && this.input.startsWith(tokenLabelName(
|
40687
|
+
if (this.isUnparsedContextual(next, "from") && this.input.startsWith(tokenLabelName(133), this.nextTokenStartSince(next + 4)))
|
40680
40688
|
return !0;
|
40681
40689
|
}
|
40682
40690
|
return super.isExportDefaultSpecifier();
|
@@ -40703,7 +40711,7 @@ function requireLib$1() {
|
|
40703
40711
|
return this.parsePlaceholder("StringLiteral") || super.parseImportSource();
|
40704
40712
|
}
|
40705
40713
|
assertNoSpace() {
|
40706
|
-
this.state.start > this.state.lastTokEndLoc.index && this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc);
|
40714
|
+
this.state.start > this.offsetToSourcePos(this.state.lastTokEndLoc.index) && this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc);
|
40707
40715
|
}
|
40708
40716
|
}, v8intrinsic = (superClass) => class extends superClass {
|
40709
40717
|
parseV8Intrinsic() {
|
@@ -40761,14 +40769,14 @@ function requireLib$1() {
|
|
40761
40769
|
throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`);
|
40762
40770
|
}
|
40763
40771
|
if (pluginsMap.has("moduleAttributes")) {
|
40764
|
-
if (pluginsMap.has("
|
40765
|
-
throw new Error("Cannot combine importAssertions,
|
40772
|
+
if (pluginsMap.has("deprecatedImportAssert") || pluginsMap.has("importAssertions"))
|
40773
|
+
throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");
|
40766
40774
|
if (pluginsMap.get("moduleAttributes").version !== "may-2020")
|
40767
40775
|
throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.");
|
40768
40776
|
}
|
40769
|
-
if (pluginsMap.has("importAssertions") && pluginsMap.has("
|
40770
|
-
throw new Error("Cannot combine importAssertions and
|
40771
|
-
if (pluginsMap.has("recordAndTuple")) {
|
40777
|
+
if (pluginsMap.has("importAssertions") && pluginsMap.has("deprecatedImportAssert"))
|
40778
|
+
throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");
|
40779
|
+
if (!pluginsMap.has("deprecatedImportAssert") && pluginsMap.has("importAttributes") && pluginsMap.get("importAttributes").deprecatedAssertSyntax && pluginsMap.set("deprecatedImportAssert", {}), pluginsMap.has("recordAndTuple")) {
|
40772
40780
|
const syntaxType = pluginsMap.get("recordAndTuple").syntaxType;
|
40773
40781
|
if (syntaxType != null) {
|
40774
40782
|
const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"];
|
@@ -40790,37 +40798,43 @@ function requireLib$1() {
|
|
40790
40798
|
typescript: typescript2,
|
40791
40799
|
v8intrinsic,
|
40792
40800
|
placeholders
|
40793
|
-
}, mixinPluginNames = Object.keys(mixinPlugins)
|
40794
|
-
|
40795
|
-
|
40796
|
-
|
40797
|
-
|
40798
|
-
|
40799
|
-
|
40800
|
-
|
40801
|
-
|
40802
|
-
|
40803
|
-
|
40804
|
-
|
40805
|
-
|
40806
|
-
|
40807
|
-
|
40808
|
-
|
40809
|
-
|
40810
|
-
|
40811
|
-
|
40812
|
-
|
40813
|
-
|
40801
|
+
}, mixinPluginNames = Object.keys(mixinPlugins);
|
40802
|
+
function createDefaultOptions() {
|
40803
|
+
return {
|
40804
|
+
sourceType: "script",
|
40805
|
+
sourceFilename: void 0,
|
40806
|
+
startIndex: 0,
|
40807
|
+
startColumn: 0,
|
40808
|
+
startLine: 1,
|
40809
|
+
allowAwaitOutsideFunction: !1,
|
40810
|
+
allowReturnOutsideFunction: !1,
|
40811
|
+
allowNewTargetOutsideFunction: !1,
|
40812
|
+
allowImportExportEverywhere: !1,
|
40813
|
+
allowSuperOutsideMethod: !1,
|
40814
|
+
allowUndeclaredExports: !1,
|
40815
|
+
plugins: [],
|
40816
|
+
strictMode: null,
|
40817
|
+
ranges: !1,
|
40818
|
+
tokens: !1,
|
40819
|
+
createImportExpressions: !1,
|
40820
|
+
createParenthesizedExpressions: !1,
|
40821
|
+
errorRecovery: !1,
|
40822
|
+
attachComment: !0,
|
40823
|
+
annexB: !0
|
40824
|
+
};
|
40825
|
+
}
|
40814
40826
|
function getOptions(opts) {
|
40827
|
+
const options2 = createDefaultOptions();
|
40815
40828
|
if (opts == null)
|
40816
|
-
return
|
40829
|
+
return options2;
|
40817
40830
|
if (opts.annexB != null && opts.annexB !== !1)
|
40818
40831
|
throw new Error("The `annexB` option can only be set to `false`.");
|
40819
|
-
const
|
40820
|
-
|
40821
|
-
|
40822
|
-
options2
|
40823
|
-
|
40832
|
+
for (const key2 of Object.keys(options2))
|
40833
|
+
opts[key2] != null && (options2[key2] = opts[key2]);
|
40834
|
+
if (options2.startLine === 1)
|
40835
|
+
opts.startIndex == null && options2.startColumn > 0 ? options2.startIndex = options2.startColumn : opts.startColumn == null && options2.startIndex > 0 && (options2.startColumn = options2.startIndex);
|
40836
|
+
else if ((opts.startColumn == null || opts.startIndex == null) && opts.startIndex != null)
|
40837
|
+
throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");
|
40824
40838
|
return options2;
|
40825
40839
|
}
|
40826
40840
|
class ExpressionParser extends LValParser {
|
@@ -40837,12 +40851,12 @@ function requireLib$1() {
|
|
40837
40851
|
}
|
40838
40852
|
}
|
40839
40853
|
shouldExitDescending(expr, potentialArrowAt) {
|
40840
|
-
return expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt;
|
40854
|
+
return expr.type === "ArrowFunctionExpression" && this.offsetToSourcePos(expr.start) === potentialArrowAt;
|
40841
40855
|
}
|
40842
40856
|
getExpression() {
|
40843
40857
|
this.enterInitialScopes(), this.nextToken();
|
40844
40858
|
const expr = this.parseExpression();
|
40845
|
-
return this.match(
|
40859
|
+
return this.match(140) || this.unexpected(), this.finalizeRemainingComments(), expr.comments = this.comments, expr.errors = this.state.errors, this.options.tokens && (expr.tokens = this.tokens), expr;
|
40846
40860
|
}
|
40847
40861
|
parseExpression(disallowIn, refExpressionErrors) {
|
40848
40862
|
return disallowIn ? this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)) : this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));
|
@@ -40904,7 +40918,7 @@ function requireLib$1() {
|
|
40904
40918
|
return expr;
|
40905
40919
|
}
|
40906
40920
|
parseMaybeUnaryOrPrivate(refExpressionErrors) {
|
40907
|
-
return this.match(
|
40921
|
+
return this.match(139) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);
|
40908
40922
|
}
|
40909
40923
|
parseExprOps(refExpressionErrors) {
|
40910
40924
|
const startLoc = this.state.startLoc, potentialArrowAt = this.state.potentialArrowAt, expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors);
|
@@ -41058,7 +41072,7 @@ function requireLib$1() {
|
|
41058
41072
|
}
|
41059
41073
|
parseMember(base2, startLoc, state, computed, optional) {
|
41060
41074
|
const node = this.startNodeAt(startLoc);
|
41061
|
-
return node.object = base2, node.computed = computed, computed ? (node.property = this.parseExpression(), this.expect(3)) : this.match(
|
41075
|
+
return node.object = base2, node.computed = computed, computed ? (node.property = this.parseExpression(), this.expect(3)) : this.match(139) ? (base2.type === "Super" && this.raise(Errors.SuperPrivateField, startLoc), this.classScope.usePrivateName(this.state.value, this.state.startLoc), node.property = this.parsePrivateName()) : node.property = this.parseIdentifier(!0), state.optionalChainMember ? (node.optional = optional, this.finishNode(node, "OptionalMemberExpression")) : this.finishNode(node, "MemberExpression");
|
41062
41076
|
}
|
41063
41077
|
parseBind(base2, startLoc, noCalls, state) {
|
41064
41078
|
const node = this.startNodeAt(startLoc);
|
@@ -41074,7 +41088,7 @@ function requireLib$1() {
|
|
41074
41088
|
maybeAsyncArrow,
|
41075
41089
|
optionalChainMember
|
41076
41090
|
} = state;
|
41077
|
-
maybeAsyncArrow && (this.expressionScope.enter(newAsyncArrowScope()), refExpressionErrors = new ExpressionErrors()), optionalChainMember && (node.optional = optional), optional ? node.arguments = this.parseCallExpressionArguments(11) : node.arguments = this.parseCallExpressionArguments(11, base2.type
|
41091
|
+
maybeAsyncArrow && (this.expressionScope.enter(newAsyncArrowScope()), refExpressionErrors = new ExpressionErrors()), optionalChainMember && (node.optional = optional), optional ? node.arguments = this.parseCallExpressionArguments(11) : node.arguments = this.parseCallExpressionArguments(11, base2.type !== "Super", node, refExpressionErrors);
|
41078
41092
|
let finishedNode = this.finishCallExpression(node, optionalChainMember);
|
41079
41093
|
return maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional ? (state.stop = !0, this.checkDestructuringPrivate(refExpressionErrors), this.expressionScope.validateAsPattern(), this.expressionScope.exit(), finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode)) : (maybeAsyncArrow && (this.checkExpressionErrors(refExpressionErrors, !0), this.expressionScope.exit()), this.toReferencedArguments(finishedNode)), this.state.maybeInArrowParameters = oldMaybeInArrowParameters, finishedNode;
|
41080
41094
|
}
|
@@ -41086,20 +41100,18 @@ function requireLib$1() {
|
|
41086
41100
|
return node.tag = base2, node.quasi = this.parseTemplate(!0), state.optionalChainMember && this.raise(Errors.OptionalChainingNoTemplate, startLoc), this.finishNode(node, "TaggedTemplateExpression");
|
41087
41101
|
}
|
41088
41102
|
atPossibleAsyncArrow(base2) {
|
41089
|
-
return base2.type === "Identifier" && base2.name === "async" && this.state.lastTokEndLoc.index === base2.end && !this.canInsertSemicolon() && base2.end - base2.start === 5 && base2.start === this.state.potentialArrowAt;
|
41103
|
+
return base2.type === "Identifier" && base2.name === "async" && this.state.lastTokEndLoc.index === base2.end && !this.canInsertSemicolon() && base2.end - base2.start === 5 && this.offsetToSourcePos(base2.start) === this.state.potentialArrowAt;
|
41090
41104
|
}
|
41091
41105
|
finishCallExpression(node, optional) {
|
41092
41106
|
if (node.callee.type === "Import")
|
41093
|
-
if (node.arguments.length ===
|
41094
|
-
this.raise(Errors.ImportCallArity, node
|
41095
|
-
maxArgumentCount: this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? 2 : 1
|
41096
|
-
});
|
41107
|
+
if (node.arguments.length === 0 || node.arguments.length > 2)
|
41108
|
+
this.raise(Errors.ImportCallArity, node);
|
41097
41109
|
else
|
41098
41110
|
for (const arg of node.arguments)
|
41099
41111
|
arg.type === "SpreadElement" && this.raise(Errors.ImportCallSpreadArgument, arg);
|
41100
41112
|
return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression");
|
41101
41113
|
}
|
41102
|
-
parseCallExpressionArguments(close,
|
41114
|
+
parseCallExpressionArguments(close, allowPlaceholder, nodeForExtra, refExpressionErrors) {
|
41103
41115
|
const elts = [];
|
41104
41116
|
let first2 = !0;
|
41105
41117
|
const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
|
@@ -41107,7 +41119,7 @@ function requireLib$1() {
|
|
41107
41119
|
if (first2)
|
41108
41120
|
first2 = !1;
|
41109
41121
|
else if (this.expect(12), this.match(close)) {
|
41110
|
-
|
41122
|
+
nodeForExtra && this.addTrailingCommaExtraToNode(nodeForExtra), this.next();
|
41111
41123
|
break;
|
41112
41124
|
}
|
41113
41125
|
elts.push(this.parseExprListItem(!1, refExpressionErrors, allowPlaceholder));
|
@@ -41142,11 +41154,11 @@ function requireLib$1() {
|
|
41142
41154
|
case 56:
|
41143
41155
|
case 31:
|
41144
41156
|
return this.readRegexp(), this.parseRegExpLiteral(this.state.value);
|
41145
|
-
case 134:
|
41146
|
-
return this.parseNumericLiteral(this.state.value);
|
41147
41157
|
case 135:
|
41158
|
+
return this.parseNumericLiteral(this.state.value);
|
41159
|
+
case 136:
|
41148
41160
|
return this.parseBigIntLiteral(this.state.value);
|
41149
|
-
case
|
41161
|
+
case 134:
|
41150
41162
|
return this.parseStringLiteral(this.state.value);
|
41151
41163
|
case 84:
|
41152
41164
|
return this.parseNullLiteral();
|
@@ -41186,7 +41198,7 @@ function requireLib$1() {
|
|
41186
41198
|
return this.finishNode(node, "BindExpression");
|
41187
41199
|
throw this.raise(Errors.UnsupportedBind, callee);
|
41188
41200
|
}
|
41189
|
-
case
|
41201
|
+
case 139:
|
41190
41202
|
return this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, {
|
41191
41203
|
identifierName: this.state.value
|
41192
41204
|
}), this.parsePrivateName();
|
@@ -41212,7 +41224,7 @@ function requireLib$1() {
|
|
41212
41224
|
break;
|
41213
41225
|
}
|
41214
41226
|
default:
|
41215
|
-
if (type2 ===
|
41227
|
+
if (type2 === 137)
|
41216
41228
|
return this.parseDecimalLiteral(this.state.value);
|
41217
41229
|
if (tokenIsIdentifier(type2)) {
|
41218
41230
|
if (this.isContextual(127) && this.lookaheadInLineCharCode() === 123)
|
@@ -41314,7 +41326,7 @@ function requireLib$1() {
|
|
41314
41326
|
return this.parseMetaProperty(node, id, "meta");
|
41315
41327
|
}
|
41316
41328
|
parseLiteralAtNode(value, type2, node) {
|
41317
|
-
return this.addExtra(node, "rawValue", value), this.addExtra(node, "raw", this.input.slice(node.start, this.state.end)), node.value = value, this.next(), this.finishNode(node, type2);
|
41329
|
+
return this.addExtra(node, "rawValue", value), this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end)), node.value = value, this.next(), this.finishNode(node, type2);
|
41318
41330
|
}
|
41319
41331
|
parseLiteral(value, type2) {
|
41320
41332
|
const node = this.startNode();
|
@@ -41334,7 +41346,7 @@ function requireLib$1() {
|
|
41334
41346
|
}
|
41335
41347
|
parseRegExpLiteral(value) {
|
41336
41348
|
const node = this.startNode();
|
41337
|
-
return this.addExtra(node, "raw", this.input.slice(node.start, this.state.end)), node.pattern = value.pattern, node.flags = value.flags, this.next(), this.finishNode(node, "RegExpLiteral");
|
41349
|
+
return this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end)), node.pattern = value.pattern, node.flags = value.flags, this.next(), this.finishNode(node, "RegExpLiteral");
|
41338
41350
|
}
|
41339
41351
|
parseBooleanLiteral(value) {
|
41340
41352
|
const node = this.startNode();
|
@@ -41537,28 +41549,28 @@ function requireLib$1() {
|
|
41537
41549
|
key2 = this.parseIdentifier(!0);
|
41538
41550
|
else
|
41539
41551
|
switch (type2) {
|
41540
|
-
case
|
41552
|
+
case 135:
|
41541
41553
|
key2 = this.parseNumericLiteral(value);
|
41542
41554
|
break;
|
41543
|
-
case
|
41555
|
+
case 134:
|
41544
41556
|
key2 = this.parseStringLiteral(value);
|
41545
41557
|
break;
|
41546
|
-
case
|
41558
|
+
case 136:
|
41547
41559
|
key2 = this.parseBigIntLiteral(value);
|
41548
41560
|
break;
|
41549
|
-
case
|
41561
|
+
case 139: {
|
41550
41562
|
const privateKeyLoc = this.state.startLoc;
|
41551
41563
|
refExpressionErrors != null ? refExpressionErrors.privateKeyLoc === null && (refExpressionErrors.privateKeyLoc = privateKeyLoc) : this.raise(Errors.UnexpectedPrivateField, privateKeyLoc), key2 = this.parsePrivateName();
|
41552
41564
|
break;
|
41553
41565
|
}
|
41554
41566
|
default:
|
41555
|
-
if (type2 ===
|
41567
|
+
if (type2 === 137) {
|
41556
41568
|
key2 = this.parseDecimalLiteral(value);
|
41557
41569
|
break;
|
41558
41570
|
}
|
41559
41571
|
this.unexpected();
|
41560
41572
|
}
|
41561
|
-
prop.key = key2, type2 !==
|
41573
|
+
prop.key = key2, type2 !== 139 && (prop.computed = !1);
|
41562
41574
|
}
|
41563
41575
|
}
|
41564
41576
|
initFunction(node, isAsync) {
|
@@ -41714,7 +41726,7 @@ function requireLib$1() {
|
|
41714
41726
|
const {
|
41715
41727
|
type: type2
|
41716
41728
|
} = this.state;
|
41717
|
-
return type2 === 53 || type2 === 10 || type2 === 0 || tokenIsTemplate(type2) || type2 === 102 && !this.state.containsEsc || type2 ===
|
41729
|
+
return type2 === 53 || type2 === 10 || type2 === 0 || tokenIsTemplate(type2) || type2 === 102 && !this.state.containsEsc || type2 === 138 || type2 === 56 || this.hasPlugin("v8intrinsic") && type2 === 54;
|
41718
41730
|
}
|
41719
41731
|
parseYield() {
|
41720
41732
|
const node = this.startNode();
|
@@ -41723,7 +41735,7 @@ function requireLib$1() {
|
|
41723
41735
|
if (!this.hasPrecedingLineBreak())
|
41724
41736
|
switch (delegating = this.eat(55), this.state.type) {
|
41725
41737
|
case 13:
|
41726
|
-
case
|
41738
|
+
case 140:
|
41727
41739
|
case 8:
|
41728
41740
|
case 11:
|
41729
41741
|
case 3:
|
@@ -41737,7 +41749,13 @@ function requireLib$1() {
|
|
41737
41749
|
return node.delegate = delegating, node.argument = argument, this.finishNode(node, "YieldExpression");
|
41738
41750
|
}
|
41739
41751
|
parseImportCall(node) {
|
41740
|
-
|
41752
|
+
if (this.next(), node.source = this.parseMaybeAssignAllowIn(), node.options = null, this.eat(12) && !this.match(11) && (node.options = this.parseMaybeAssignAllowIn(), this.eat(12) && !this.match(11))) {
|
41753
|
+
do
|
41754
|
+
this.parseMaybeAssignAllowIn();
|
41755
|
+
while (this.eat(12) && !this.match(11));
|
41756
|
+
this.raise(Errors.ImportCallArity, node);
|
41757
|
+
}
|
41758
|
+
return this.expect(11), this.finishNode(node, "ImportExpression");
|
41741
41759
|
}
|
41742
41760
|
checkPipelineAtInfixOperator(left, leftStartLoc) {
|
41743
41761
|
this.hasPlugin(["pipelineOperator", {
|
@@ -41870,14 +41888,14 @@ function requireLib$1() {
|
|
41870
41888
|
}, switchLabel = {
|
41871
41889
|
kind: 2
|
41872
41890
|
}, loneSurrogate = /[\uD800-\uDFFF]/u, keywordRelationalOperator = /in(?:stanceof)?/y;
|
41873
|
-
function babel7CompatTokens(tokens, input2) {
|
41891
|
+
function babel7CompatTokens(tokens, input2, startIndex) {
|
41874
41892
|
for (let i = 0; i < tokens.length; i++) {
|
41875
41893
|
const token2 = tokens[i], {
|
41876
41894
|
type: type2
|
41877
41895
|
} = token2;
|
41878
41896
|
if (typeof type2 == "number") {
|
41879
41897
|
{
|
41880
|
-
if (type2 ===
|
41898
|
+
if (type2 === 139) {
|
41881
41899
|
const {
|
41882
41900
|
loc,
|
41883
41901
|
start,
|
@@ -41909,7 +41927,7 @@ function requireLib$1() {
|
|
41909
41927
|
end
|
41910
41928
|
} = token2, backquoteEnd = start + 1, backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1);
|
41911
41929
|
let startToken;
|
41912
|
-
input2.charCodeAt(start) === 96 ? startToken = new Token({
|
41930
|
+
input2.charCodeAt(start - startIndex) === 96 ? startToken = new Token({
|
41913
41931
|
type: getExportedToken(22),
|
41914
41932
|
value: "`",
|
41915
41933
|
start,
|
@@ -41957,9 +41975,9 @@ function requireLib$1() {
|
|
41957
41975
|
}
|
41958
41976
|
class StatementParser extends ExpressionParser {
|
41959
41977
|
parseTopLevel(file, program) {
|
41960
|
-
return file.program = this.parseProgram(program), file.comments = this.comments, this.options.tokens && (file.tokens = babel7CompatTokens(this.tokens, this.input)), this.finishNode(file, "File");
|
41978
|
+
return file.program = this.parseProgram(program), file.comments = this.comments, this.options.tokens && (file.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex)), this.finishNode(file, "File");
|
41961
41979
|
}
|
41962
|
-
parseProgram(program, end =
|
41980
|
+
parseProgram(program, end = 140, sourceType = this.options.sourceType) {
|
41963
41981
|
if (program.sourceType = sourceType, program.interpreter = this.parseInterpreterDirective(), this.parseBlockBody(program, !0, !0, end), this.inModule) {
|
41964
41982
|
if (!this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0)
|
41965
41983
|
for (const [localName, at] of Array.from(this.scope.undefinedExports))
|
@@ -41969,12 +41987,12 @@ function requireLib$1() {
|
|
41969
41987
|
this.addExtra(program, "topLevelAwait", this.state.hasTopLevelAwait);
|
41970
41988
|
}
|
41971
41989
|
let finishedProgram;
|
41972
|
-
return end ===
|
41990
|
+
return end === 140 ? finishedProgram = this.finishNode(program, "Program") : finishedProgram = this.finishNodeAt(program, "Program", createPositionWithColumnOffset(this.state.startLoc, -1)), finishedProgram;
|
41973
41991
|
}
|
41974
41992
|
stmtToDirective(stmt) {
|
41975
41993
|
const directive = stmt;
|
41976
41994
|
directive.type = "Directive", directive.value = directive.expression, delete directive.expression;
|
41977
|
-
const directiveLiteral = directive.value, expressionValue = directiveLiteral.value, raw = this.input.slice(directiveLiteral.start, directiveLiteral.end), val = directiveLiteral.value = raw.slice(1, -1);
|
41995
|
+
const directiveLiteral = directive.value, expressionValue = directiveLiteral.value, raw = this.input.slice(this.offsetToSourcePos(directiveLiteral.start), this.offsetToSourcePos(directiveLiteral.end)), val = directiveLiteral.value = raw.slice(1, -1);
|
41978
41996
|
return this.addExtra(directiveLiteral, "raw", raw), this.addExtra(directiveLiteral, "rawValue", val), this.addExtra(directiveLiteral, "expressionValue", expressionValue), directiveLiteral.type = "DirectiveLiteral", directive;
|
41979
41997
|
}
|
41980
41998
|
parseInterpreterDirective() {
|
@@ -42155,7 +42173,7 @@ function requireLib$1() {
|
|
42155
42173
|
} else {
|
42156
42174
|
for (expr = this.parseIdentifier(!1); this.eat(16); ) {
|
42157
42175
|
const node2 = this.startNodeAt(startLoc);
|
42158
|
-
node2.object = expr, this.match(
|
42176
|
+
node2.object = expr, this.match(139) ? (this.classScope.usePrivateName(this.state.value, this.state.startLoc), node2.property = this.parsePrivateName()) : node2.property = this.parseIdentifier(!0), node2.computed = !1, expr = this.finishNode(node2, "MemberExpression");
|
42159
42177
|
}
|
42160
42178
|
node.expression = this.parseMaybeDecoratorArguments(expr);
|
42161
42179
|
}
|
@@ -42166,7 +42184,7 @@ function requireLib$1() {
|
|
42166
42184
|
parseMaybeDecoratorArguments(expr) {
|
42167
42185
|
if (this.eat(10)) {
|
42168
42186
|
const node = this.startNodeAtNode(expr);
|
42169
|
-
return node.callee = expr, node.arguments = this.parseCallExpressionArguments(11
|
42187
|
+
return node.callee = expr, node.arguments = this.parseCallExpressionArguments(11), this.toReferencedList(node.arguments), this.finishNode(node, "CallExpression");
|
42170
42188
|
}
|
42171
42189
|
return expr;
|
42172
42190
|
}
|
@@ -42284,14 +42302,14 @@ function requireLib$1() {
|
|
42284
42302
|
for (let i = this.state.labels.length - 1; i >= 0; i--) {
|
42285
42303
|
const label = this.state.labels[i];
|
42286
42304
|
if (label.statementStart === node.start)
|
42287
|
-
label.statementStart = this.state.start, label.kind = kind;
|
42305
|
+
label.statementStart = this.sourceToOffsetPos(this.state.start), label.kind = kind;
|
42288
42306
|
else
|
42289
42307
|
break;
|
42290
42308
|
}
|
42291
42309
|
return this.state.labels.push({
|
42292
42310
|
name: maybeName,
|
42293
42311
|
kind,
|
42294
|
-
statementStart: this.state.start
|
42312
|
+
statementStart: this.sourceToOffsetPos(this.state.start)
|
42295
42313
|
}), node.body = flags & 8 ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0) : this.parseStatement(), this.state.labels.pop(), node.label = expr, this.finishNode(node, "LabeledStatement");
|
42296
42314
|
}
|
42297
42315
|
parseExpressionStatement(node, expr, decorators) {
|
@@ -42446,7 +42464,7 @@ function requireLib$1() {
|
|
42446
42464
|
const publicMethod = member, privateMethod = member, publicProp = member, privateProp = member, accessorProp = member, method = publicMethod, publicMember = publicMethod;
|
42447
42465
|
if (member.static = isStatic, this.parsePropertyNamePrefixOperator(member), this.eat(55)) {
|
42448
42466
|
method.kind = "method";
|
42449
|
-
const isPrivateName = this.match(
|
42467
|
+
const isPrivateName = this.match(139);
|
42450
42468
|
if (this.parseClassElementName(method), isPrivateName) {
|
42451
42469
|
this.pushClassPrivateMethod(classBody, privateMethod, !0, !1);
|
42452
42470
|
return;
|
@@ -42469,15 +42487,15 @@ function requireLib$1() {
|
|
42469
42487
|
this.resetPreviousNodeTrailingComments(key2);
|
42470
42488
|
const isGenerator = this.eat(55);
|
42471
42489
|
publicMember.optional && this.unexpected(maybeQuestionTokenStartLoc), method.kind = "method";
|
42472
|
-
const isPrivate2 = this.match(
|
42490
|
+
const isPrivate2 = this.match(139);
|
42473
42491
|
this.parseClassElementName(method), this.parsePostMemberNameModifiers(publicMember), isPrivate2 ? this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, !0) : (this.isNonstaticConstructor(publicMethod) && this.raise(Errors.ConstructorIsAsync, publicMethod.key), this.pushClassMethod(classBody, publicMethod, isGenerator, !0, !1, !1));
|
42474
42492
|
} else if ((maybeContextualKw === "get" || maybeContextualKw === "set") && !(this.match(55) && this.isLineTerminator())) {
|
42475
42493
|
this.resetPreviousNodeTrailingComments(key2), method.kind = maybeContextualKw;
|
42476
|
-
const isPrivate2 = this.match(
|
42494
|
+
const isPrivate2 = this.match(139);
|
42477
42495
|
this.parseClassElementName(publicMethod), isPrivate2 ? this.pushClassPrivateMethod(classBody, privateMethod, !1, !1) : (this.isNonstaticConstructor(publicMethod) && this.raise(Errors.ConstructorIsAccessor, publicMethod.key), this.pushClassMethod(classBody, publicMethod, !1, !1, !1, !1)), this.checkGetterSetterParams(publicMethod);
|
42478
42496
|
} else if (maybeContextualKw === "accessor" && !this.isLineTerminator()) {
|
42479
42497
|
this.expectPlugin("decoratorAutoAccessors"), this.resetPreviousNodeTrailingComments(key2);
|
42480
|
-
const isPrivate2 = this.match(
|
42498
|
+
const isPrivate2 = this.match(139);
|
42481
42499
|
this.parseClassElementName(publicProp), this.pushClassAccessorProperty(classBody, accessorProp, isPrivate2);
|
42482
42500
|
} else this.isLineTerminator() ? isPrivate ? this.pushClassPrivateProperty(classBody, privateProp) : this.pushClassProperty(classBody, publicProp) : this.unexpected();
|
42483
42501
|
}
|
@@ -42486,7 +42504,7 @@ function requireLib$1() {
|
|
42486
42504
|
type: type2,
|
42487
42505
|
value
|
42488
42506
|
} = this.state;
|
42489
|
-
if ((type2 === 132 || type2 ===
|
42507
|
+
if ((type2 === 132 || type2 === 134) && member.static && value === "prototype" && this.raise(Errors.StaticPrototype, this.state.startLoc), type2 === 139) {
|
42490
42508
|
value === "constructor" && this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc);
|
42491
42509
|
const key2 = this.parsePrivateName();
|
42492
42510
|
return member.key = key2, key2;
|
@@ -42735,7 +42753,7 @@ function requireLib$1() {
|
|
42735
42753
|
if (first2)
|
42736
42754
|
first2 = !1;
|
42737
42755
|
else if (this.expect(12), this.eat(8)) break;
|
42738
|
-
const isMaybeTypeOnly = this.isContextual(130), isString = this.match(
|
42756
|
+
const isMaybeTypeOnly = this.isContextual(130), isString = this.match(134), node = this.startNode();
|
42739
42757
|
node.local = this.parseModuleExportName(), nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly));
|
42740
42758
|
}
|
42741
42759
|
return nodes;
|
@@ -42744,7 +42762,7 @@ function requireLib$1() {
|
|
42744
42762
|
return this.eatContextual(93) ? node.exported = this.parseModuleExportName() : isString ? node.exported = cloneStringLiteral(node.local) : node.exported || (node.exported = cloneIdentifier(node.local)), this.finishNode(node, "ExportSpecifier");
|
42745
42763
|
}
|
42746
42764
|
parseModuleExportName() {
|
42747
|
-
if (this.match(
|
42765
|
+
if (this.match(134)) {
|
42748
42766
|
const result = this.parseStringLiteral(this.state.value), surrogate = loneSurrogate.exec(result.value);
|
42749
42767
|
return surrogate && this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, {
|
42750
42768
|
surrogateCharCode: surrogate[0].charCodeAt(0)
|
@@ -42807,7 +42825,7 @@ function requireLib$1() {
|
|
42807
42825
|
return tokenIsIdentifier(type2) ? type2 !== 98 || this.lookaheadCharCode() === 102 : type2 !== 12;
|
42808
42826
|
}
|
42809
42827
|
parseImport(node) {
|
42810
|
-
return this.match(
|
42828
|
+
return this.match(134) ? this.parseImportSourceAndAttributes(node) : this.parseImportSpecifiersAndAfter(node, this.parseMaybeImportPhase(node, !1));
|
42811
42829
|
}
|
42812
42830
|
parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier) {
|
42813
42831
|
node.specifiers = [];
|
@@ -42819,7 +42837,7 @@ function requireLib$1() {
|
|
42819
42837
|
return (_node$specifiers2 = node.specifiers) != null || (node.specifiers = []), node.source = this.parseImportSource(), this.maybeParseImportAttributes(node), this.checkImportReflection(node), this.checkJSONModuleImport(node), this.semicolon(), this.finishNode(node, "ImportDeclaration");
|
42820
42838
|
}
|
42821
42839
|
parseImportSource() {
|
42822
|
-
return this.match(
|
42840
|
+
return this.match(134) || this.unexpected(), this.parseExprAtom();
|
42823
42841
|
}
|
42824
42842
|
parseImportSpecifierLocal(node, specifier, type2) {
|
42825
42843
|
specifier.local = this.parseIdentifier(), node.specifiers.push(this.finishImportSpecifier(specifier, type2));
|
@@ -42838,7 +42856,7 @@ function requireLib$1() {
|
|
42838
42856
|
const node = this.startNode(), keyName = this.state.value;
|
42839
42857
|
if (attrNames.has(keyName) && this.raise(Errors.ModuleAttributesWithDuplicateKeys, this.state.startLoc, {
|
42840
42858
|
key: keyName
|
42841
|
-
}), attrNames.add(keyName), this.match(
|
42859
|
+
}), attrNames.add(keyName), this.match(134) ? node.key = this.parseStringLiteral(keyName) : node.key = this.parseIdentifier(!0), this.expect(14), !this.match(134))
|
42842
42860
|
throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
|
42843
42861
|
node.value = this.parseStringLiteral(this.state.value), attrs.push(this.finishNode(node, "ImportAttribute"));
|
42844
42862
|
} while (this.eat(12));
|
@@ -42850,7 +42868,7 @@ function requireLib$1() {
|
|
42850
42868
|
const node = this.startNode();
|
42851
42869
|
if (node.key = this.parseIdentifier(!0), node.key.name !== "type" && this.raise(Errors.ModuleAttributeDifferentFromType, node.key), attributes.has(node.key.name) && this.raise(Errors.ModuleAttributesWithDuplicateKeys, node.key, {
|
42852
42870
|
key: node.key.name
|
42853
|
-
}), attributes.add(node.key.name), this.expect(14), !this.match(
|
42871
|
+
}), attributes.add(node.key.name), this.expect(14), !this.match(134))
|
42854
42872
|
throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
|
42855
42873
|
node.value = this.parseStringLiteral(this.state.value), attrs.push(this.finishNode(node, "ImportAttribute"));
|
42856
42874
|
} while (this.eat(12));
|
@@ -42862,14 +42880,8 @@ function requireLib$1() {
|
|
42862
42880
|
if (this.match(76)) {
|
42863
42881
|
if (this.hasPrecedingLineBreak() && this.lookaheadCharCode() === 40)
|
42864
42882
|
return;
|
42865
|
-
this.next(), this.hasPlugin("moduleAttributes") ? attributes = this.parseModuleAttributes() :
|
42866
|
-
} else
|
42867
|
-
this.hasPlugin("importAttributes") ? (this.getPluginOption("importAttributes", "deprecatedAssertSyntax") !== !0 && this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc), this.addExtra(node, "deprecatedAssertSyntax", !0)) : this.expectOnePlugin(["importAttributes", "importAssertions"]), this.next(), attributes = this.parseImportAttributes();
|
42868
|
-
else if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions"))
|
42869
|
-
attributes = [];
|
42870
|
-
else if (this.hasPlugin("moduleAttributes"))
|
42871
|
-
attributes = [];
|
42872
|
-
else return;
|
42883
|
+
this.next(), this.hasPlugin("moduleAttributes") ? attributes = this.parseModuleAttributes() : attributes = this.parseImportAttributes(), useWith = !0;
|
42884
|
+
} else this.isContextual(94) && !this.hasPrecedingLineBreak() ? (!this.hasPlugin("deprecatedImportAssert") && !this.hasPlugin("importAssertions") && this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc), this.hasPlugin("importAssertions") || this.addExtra(node, "deprecatedAssertSyntax", !0), this.next(), attributes = this.parseImportAttributes()) : attributes = [];
|
42873
42885
|
!useWith && this.hasPlugin("importAssertions") ? node.assertions = attributes : node.attributes = attributes;
|
42874
42886
|
}
|
42875
42887
|
maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier) {
|
@@ -42897,7 +42909,7 @@ function requireLib$1() {
|
|
42897
42909
|
throw this.raise(Errors.DestructureNamedImport, this.state.startLoc);
|
42898
42910
|
if (this.expect(12), this.eat(8)) break;
|
42899
42911
|
}
|
42900
|
-
const specifier = this.startNode(), importedIsString = this.match(
|
42912
|
+
const specifier = this.startNode(), importedIsString = this.match(134), isMaybeTypeOnly = this.isContextual(130);
|
42901
42913
|
specifier.imported = this.parseModuleExportName();
|
42902
42914
|
const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly, void 0);
|
42903
42915
|
node.specifiers.push(importSpecifier);
|
@@ -42924,7 +42936,7 @@ function requireLib$1() {
|
|
42924
42936
|
}
|
42925
42937
|
class Parser extends StatementParser {
|
42926
42938
|
constructor(options2, input2, pluginsMap) {
|
42927
|
-
options2 = getOptions(options2), super(options2, input2), this.options = options2, this.initializeScopes(), this.plugins = pluginsMap, this.filename = options2.sourceFilename;
|
42939
|
+
options2 = getOptions(options2), super(options2, input2), this.options = options2, this.initializeScopes(), this.plugins = pluginsMap, this.filename = options2.sourceFilename, this.startIndex = options2.startIndex;
|
42928
42940
|
}
|
42929
42941
|
getScopeHandler() {
|
42930
42942
|
return ScopeHandler;
|
@@ -45158,6 +45170,19 @@ export const client = createClient({
|
|
45158
45170
|
apiVersion,
|
45159
45171
|
useCdn: true, // Set to false if statically generating pages, using ISR or tag-based revalidation
|
45160
45172
|
})
|
45173
|
+
`, live = `// Querying with "sanityFetch" will keep content automatically updated
|
45174
|
+
// Before using it, import and render "<SanityLive />" in your layout, see
|
45175
|
+
// https://github.com/sanity-io/next-sanity#live-content-api for more information.
|
45176
|
+
import { defineLive } from "next-sanity";
|
45177
|
+
import { client } from './client'
|
45178
|
+
|
45179
|
+
export const { sanityFetch, SanityLive } = defineLive({
|
45180
|
+
client: client.withConfig({
|
45181
|
+
// Live content is currently only available on the experimental API
|
45182
|
+
// https://www.sanity.io/docs/api-versioning
|
45183
|
+
apiVersion: 'vX'
|
45184
|
+
})
|
45185
|
+
});
|
45161
45186
|
`, imageTS = `import createImageUrlBuilder from '@sanity/image-url'
|
45162
45187
|
import { SanityImageSource } from "@sanity/image-url/lib/types/types";
|
45163
45188
|
|
@@ -45184,6 +45209,7 @@ export const urlFor = (source) => {
|
|
45184
45209
|
"env.": useTypeScript ? envTS : envJS,
|
45185
45210
|
lib: {
|
45186
45211
|
"client.": client,
|
45212
|
+
"live.": live,
|
45187
45213
|
"image.": useTypeScript ? imageTS : imageJS
|
45188
45214
|
}
|
45189
45215
|
};
|