xml-model 1.1.2 → 1.3.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.
Files changed (138) hide show
  1. package/README.md +0 -1
  2. package/dist/_virtual/Reflect.js +8 -0
  3. package/dist/_virtual/Reflect2.js +5 -0
  4. package/{vite/dist → dist}/_virtual/_commonjsHelpers.js +10 -4
  5. package/dist/defaults.d.ts +1 -0
  6. package/dist/errors.d.ts +1 -0
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +42 -2
  9. package/dist/middleware.d.ts +1 -0
  10. package/dist/model/built-ins.d.ts +1 -0
  11. package/dist/model/index.d.ts +1 -0
  12. package/dist/model/index.js +3 -1
  13. package/dist/model/property.d.ts +1 -0
  14. package/dist/model/property.js +2 -1
  15. package/dist/model/registry.d.ts +1 -0
  16. package/dist/model/types.d.ts +1 -0
  17. package/dist/node_modules/reflect-metadata/Reflect.js +867 -0
  18. package/dist/node_modules/typescript-rtti/dist.esm/common/format.js +106 -0
  19. package/dist/node_modules/typescript-rtti/dist.esm/index.js +2 -0
  20. package/dist/node_modules/typescript-rtti/dist.esm/lib/get-parameter-names.js +15 -0
  21. package/dist/node_modules/typescript-rtti/dist.esm/lib/index.js +43 -0
  22. package/dist/node_modules/typescript-rtti/dist.esm/lib/reflect.js +2225 -0
  23. package/dist/node_modules/typescript-rtti/dist.esm/lib/sealed.js +13 -0
  24. package/dist/types.d.ts +1 -0
  25. package/dist/util/is-regexp.d.ts +1 -0
  26. package/dist/util/kebab-case.d.ts +1 -0
  27. package/dist/util/merge-maps.d.ts +1 -0
  28. package/dist/xml/index.d.ts +1 -0
  29. package/dist/xml/xml-js.d.ts +1 -0
  30. package/package.json +3 -3
  31. package/vite/dist/index.js +5 -6
  32. package/vite/dist/node_modules/typescript-rtti/dist.esm/common/format.js +103 -0
  33. package/vite/dist/node_modules/typescript-rtti/dist.esm/common/index.js +53 -0
  34. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/api-call-transformer.js +150 -0
  35. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/common/class-analyzer.js +81 -0
  36. package/vite/dist/{_virtual → node_modules/typescript-rtti/dist.esm/transformer/common}/compile-error.js +3 -2
  37. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/common/import-analyzer.js +87 -0
  38. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/common/interface-analyzer.js +56 -0
  39. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/common/visitor-base.js +91 -0
  40. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/declarations-emitter.js +29 -0
  41. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/encode-parameter.js +62 -0
  42. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/find-relative-path.js +39 -0
  43. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/flags.js +41 -0
  44. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/forward-ref.js +18 -0
  45. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/get-exports-for-symbol.js +62 -0
  46. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/index.js +128 -0
  47. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/legacy-decorator.js +8 -0
  48. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/legacy-type-encoder.js +80 -0
  49. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/literal-node.js +7 -0
  50. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/metadata-collector.js +54 -0
  51. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/metadata-decorator.js +78 -0
  52. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/metadata-emitter.js +423 -0
  53. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/metadata-encoder.js +210 -0
  54. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/rt-helper.js +94 -0
  55. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/rtti-visitor-base.js +26 -0
  56. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/serialize.js +29 -0
  57. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/type-encoder.js +74 -0
  58. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/type-literal.js +497 -0
  59. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/utils.js +904 -0
  60. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/workarounds.js +5 -0
  61. package/vite/dist/src/class-names.test.d.ts +9 -0
  62. package/vite/dist/src/defaults.d.ts +15 -0
  63. package/vite/dist/src/errors.d.ts +24 -0
  64. package/vite/dist/src/index.d.ts +8 -0
  65. package/vite/dist/src/middleware.d.ts +10 -0
  66. package/vite/dist/src/model/built-ins.d.ts +3 -0
  67. package/vite/dist/src/model/index.d.ts +21 -0
  68. package/vite/dist/src/model/property.d.ts +6 -0
  69. package/vite/dist/src/model/registry.d.ts +9 -0
  70. package/vite/dist/src/model/types.d.ts +74 -0
  71. package/vite/dist/src/model.test.d.ts +2 -0
  72. package/vite/dist/src/types.d.ts +17 -0
  73. package/vite/dist/src/util/is-regexp.d.ts +12 -0
  74. package/vite/dist/src/util/kebab-case.d.ts +16 -0
  75. package/vite/dist/src/util/merge-maps.d.ts +2 -0
  76. package/vite/dist/src/xml/index.d.ts +33 -0
  77. package/vite/dist/src/xml/xml-js.d.ts +7 -0
  78. package/vite/dist/_virtual/_commonjs-dynamic-modules.js +0 -7
  79. package/vite/dist/_virtual/_typescript.js +0 -5
  80. package/vite/dist/_virtual/api-call-transformer.js +0 -5
  81. package/vite/dist/_virtual/class-analyzer.js +0 -5
  82. package/vite/dist/_virtual/declarations-emitter.js +0 -5
  83. package/vite/dist/_virtual/encode-parameter.js +0 -5
  84. package/vite/dist/_virtual/find-relative-path.js +0 -5
  85. package/vite/dist/_virtual/flags.js +0 -5
  86. package/vite/dist/_virtual/format.js +0 -5
  87. package/vite/dist/_virtual/forward-ref.js +0 -5
  88. package/vite/dist/_virtual/get-exports-for-symbol.js +0 -5
  89. package/vite/dist/_virtual/import-analyzer.js +0 -5
  90. package/vite/dist/_virtual/index.js +0 -8
  91. package/vite/dist/_virtual/index2.js +0 -5
  92. package/vite/dist/_virtual/index3.js +0 -5
  93. package/vite/dist/_virtual/interface-analyzer.js +0 -5
  94. package/vite/dist/_virtual/legacy-decorator.js +0 -5
  95. package/vite/dist/_virtual/legacy-type-encoder.js +0 -5
  96. package/vite/dist/_virtual/literal-node.js +0 -5
  97. package/vite/dist/_virtual/metadata-collector.js +0 -5
  98. package/vite/dist/_virtual/metadata-decorator.js +0 -5
  99. package/vite/dist/_virtual/metadata-emitter.js +0 -5
  100. package/vite/dist/_virtual/metadata-encoder.js +0 -5
  101. package/vite/dist/_virtual/rt-helper.js +0 -5
  102. package/vite/dist/_virtual/rtti-visitor-base.js +0 -5
  103. package/vite/dist/_virtual/serialize.js +0 -5
  104. package/vite/dist/_virtual/type-encoder.js +0 -5
  105. package/vite/dist/_virtual/type-literal.js +0 -5
  106. package/vite/dist/_virtual/utils.js +0 -5
  107. package/vite/dist/_virtual/visitor-base.js +0 -5
  108. package/vite/dist/_virtual/workarounds.js +0 -5
  109. package/vite/dist/index.d.ts +0 -22
  110. package/vite/dist/node_modules/typescript-rtti/dist/common/format.js +0 -69
  111. package/vite/dist/node_modules/typescript-rtti/dist/common/index.js +0 -34
  112. package/vite/dist/node_modules/typescript-rtti/dist/transformer/api-call-transformer.js +0 -197
  113. package/vite/dist/node_modules/typescript-rtti/dist/transformer/common/class-analyzer.js +0 -124
  114. package/vite/dist/node_modules/typescript-rtti/dist/transformer/common/compile-error.js +0 -18
  115. package/vite/dist/node_modules/typescript-rtti/dist/transformer/common/import-analyzer.js +0 -130
  116. package/vite/dist/node_modules/typescript-rtti/dist/transformer/common/interface-analyzer.js +0 -98
  117. package/vite/dist/node_modules/typescript-rtti/dist/transformer/common/visitor-base.js +0 -132
  118. package/vite/dist/node_modules/typescript-rtti/dist/transformer/declarations-emitter.js +0 -72
  119. package/vite/dist/node_modules/typescript-rtti/dist/transformer/encode-parameter.js +0 -110
  120. package/vite/dist/node_modules/typescript-rtti/dist/transformer/find-relative-path.js +0 -51
  121. package/vite/dist/node_modules/typescript-rtti/dist/transformer/flags.js +0 -59
  122. package/vite/dist/node_modules/typescript-rtti/dist/transformer/forward-ref.js +0 -35
  123. package/vite/dist/node_modules/typescript-rtti/dist/transformer/get-exports-for-symbol.js +0 -75
  124. package/vite/dist/node_modules/typescript-rtti/dist/transformer/index.js +0 -174
  125. package/vite/dist/node_modules/typescript-rtti/dist/transformer/legacy-decorator.js +0 -20
  126. package/vite/dist/node_modules/typescript-rtti/dist/transformer/legacy-type-encoder.js +0 -123
  127. package/vite/dist/node_modules/typescript-rtti/dist/transformer/literal-node.js +0 -19
  128. package/vite/dist/node_modules/typescript-rtti/dist/transformer/metadata-collector.js +0 -96
  129. package/vite/dist/node_modules/typescript-rtti/dist/transformer/metadata-decorator.js +0 -99
  130. package/vite/dist/node_modules/typescript-rtti/dist/transformer/metadata-emitter.js +0 -475
  131. package/vite/dist/node_modules/typescript-rtti/dist/transformer/metadata-encoder.js +0 -261
  132. package/vite/dist/node_modules/typescript-rtti/dist/transformer/rt-helper.js +0 -113
  133. package/vite/dist/node_modules/typescript-rtti/dist/transformer/rtti-visitor-base.js +0 -39
  134. package/vite/dist/node_modules/typescript-rtti/dist/transformer/serialize.js +0 -46
  135. package/vite/dist/node_modules/typescript-rtti/dist/transformer/type-encoder.js +0 -96
  136. package/vite/dist/node_modules/typescript-rtti/dist/transformer/type-literal.js +0 -546
  137. package/vite/dist/node_modules/typescript-rtti/dist/transformer/utils.js +0 -922
  138. package/vite/dist/node_modules/typescript-rtti/dist/transformer/workarounds.js +0 -16
@@ -0,0 +1,904 @@
1
+ import ts from "typescript";
2
+ function assert(check) {
3
+ if (!check())
4
+ throw new Error(`Assertion failed: ${check.toString().replace(/.*?=> */, "")}`);
5
+ }
6
+ function isInterfaceType(type) {
7
+ return type.isClassOrInterface() && !type.isClass();
8
+ }
9
+ function getRootNameOfQualifiedName(qualifiedName) {
10
+ if (ts.isQualifiedName(qualifiedName.left))
11
+ return getRootNameOfQualifiedName(qualifiedName.left);
12
+ else if (ts.isIdentifier(qualifiedName.left))
13
+ return qualifiedName.left.text;
14
+ }
15
+ function getRootNameOfEntityName(entityName) {
16
+ if (ts.isQualifiedName(entityName)) {
17
+ return getRootNameOfQualifiedName(entityName);
18
+ } else if (ts.isIdentifier(entityName)) {
19
+ return entityName.text;
20
+ }
21
+ }
22
+ function hasFlag(flags, flag) {
23
+ return (flags & flag) !== 0;
24
+ }
25
+ function hasAnyFlag(flags, possibleFlags) {
26
+ return possibleFlags.some((x) => hasFlag(flags, x));
27
+ }
28
+ function isFlagType(type, flag) {
29
+ return hasFlag(type.flags, flag);
30
+ }
31
+ function cloneQualifiedName(qualifiedName, rootName) {
32
+ let left;
33
+ if (ts.isIdentifier(qualifiedName.left)) {
34
+ left = ts.factory.createIdentifier(rootName);
35
+ } else {
36
+ left = cloneEntityNameAsExpr(qualifiedName.left, rootName);
37
+ }
38
+ return ts.factory.createPropertyAccessExpression(left, cloneEntityNameAsExpr(qualifiedName.right));
39
+ }
40
+ function cloneEntityNameAsExpr(entityName, rootName) {
41
+ if (ts.isQualifiedName(entityName))
42
+ return cloneQualifiedName(entityName, rootName);
43
+ else if (ts.isIdentifier(entityName))
44
+ return ts.factory.createIdentifier(entityName.text);
45
+ }
46
+ function qualifiedNameToString(qualifiedName) {
47
+ return ts.isIdentifier(qualifiedName.left) ? qualifiedName.left.text + "." + qualifiedName.right.text : entityNameToString(qualifiedName.left) + "." + qualifiedName.right.text;
48
+ }
49
+ function entityNameToString(entityName) {
50
+ if (ts.isQualifiedName(entityName))
51
+ return qualifiedNameToString(entityName);
52
+ else if (ts.isIdentifier(entityName))
53
+ return entityName.text;
54
+ }
55
+ function createCheckedValue(left, right) {
56
+ return ts.factory.createLogicalAnd(ts.factory.createStrictInequality(ts.factory.createTypeOfExpression(left), ts.factory.createStringLiteral("undefined")), right);
57
+ }
58
+ function setParent(child, parent) {
59
+ if (child && parent) {
60
+ child.parent = parent;
61
+ }
62
+ return child;
63
+ }
64
+ function serializeEntityNameAsExpressionFallback(node, context, currentLexicalScope) {
65
+ if (node.kind === ts.SyntaxKind.Identifier) {
66
+ const copied = serializeEntityNameAsExpression(node, currentLexicalScope);
67
+ return createCheckedValue(copied, copied);
68
+ }
69
+ if (node.left.kind === ts.SyntaxKind.Identifier) {
70
+ return createCheckedValue(serializeEntityNameAsExpression(node.left, currentLexicalScope), serializeEntityNameAsExpression(node, currentLexicalScope));
71
+ }
72
+ const left = serializeEntityNameAsExpressionFallback(node.left, context, currentLexicalScope);
73
+ const temp = ts.factory.createTempVariable(context.hoistVariableDeclaration);
74
+ return ts.factory.createLogicalAnd(ts.factory.createLogicalAnd(left.left, ts.factory.createStrictInequality(ts.factory.createAssignment(temp, left.right), ts.factory.createVoidZero())), ts.factory.createPropertyAccessExpression(temp, node.right));
75
+ }
76
+ function serializeEntityNameAsExpression(node, currentLexicalScope) {
77
+ switch (node.kind) {
78
+ case ts.SyntaxKind.Identifier:
79
+ const name = setParent(ts.setTextRange(ts.factory["cloneNode"](node), node), node.parent);
80
+ name["original"] = void 0;
81
+ setParent(name, ts.getParseTreeNode(currentLexicalScope));
82
+ return name;
83
+ case ts.SyntaxKind.QualifiedName:
84
+ return serializeQualifiedNameAsExpression(node, currentLexicalScope);
85
+ }
86
+ }
87
+ function serializeQualifiedNameAsExpression(node, currentLexicalScope) {
88
+ return ts.factory.createPropertyAccessExpression(serializeEntityNameAsExpression(node.left, currentLexicalScope), node.right);
89
+ }
90
+ function dottedNameToExpr(dottedName) {
91
+ return dottedName.split(".").map((ident) => ts.factory.createIdentifier(ident)).reduce((pv, cv) => pv ? ts.factory.createPropertyAccessExpression(pv, cv) : cv);
92
+ }
93
+ function replacePropertyRoot(propertyExpr, newRootExpr) {
94
+ if (ts.isPropertyAccessExpression(propertyExpr.expression)) {
95
+ return ts.factory.createPropertyAccessExpression(replacePropertyRoot(propertyExpr.expression, newRootExpr), propertyExpr.name);
96
+ } else {
97
+ return ts.factory.createPropertyAccessExpression(newRootExpr, propertyExpr.name);
98
+ }
99
+ }
100
+ function getPropertyRoot(propertyExpr) {
101
+ if (ts.isPropertyAccessExpression(propertyExpr.expression))
102
+ return getPropertyRoot(propertyExpr.expression);
103
+ return propertyExpr.expression;
104
+ }
105
+ function optionalExportRef(object, expr) {
106
+ let propertyName;
107
+ let propertyAccess;
108
+ if (ts.isIdentifier(expr)) {
109
+ propertyName = expr.text;
110
+ } else if (ts.isPropertyAccessExpression(expr)) {
111
+ let propertyRoot = getPropertyRoot(expr);
112
+ propertyAccess = expr;
113
+ if (ts.isIdentifier(propertyRoot)) {
114
+ propertyName = propertyRoot.text;
115
+ } else {
116
+ throw new Error(`Property root should have been an identifier!`);
117
+ }
118
+ }
119
+ let callExpr = ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier("__RΦ"), "oe"), [], [
120
+ object,
121
+ ts.factory.createStringLiteral(propertyName)
122
+ ]);
123
+ if (propertyAccess)
124
+ return replacePropertyRoot(propertyAccess, callExpr);
125
+ return callExpr;
126
+ }
127
+ function propertyPrepend(expr, propAccess) {
128
+ if (ts.isIdentifier(propAccess)) {
129
+ return ts.factory.createPropertyAccessExpression(expr, propAccess);
130
+ } else if (ts.isPropertyAccessExpression(propAccess.expression)) {
131
+ return ts.factory.createPropertyAccessExpression(propertyPrepend(expr, propAccess.expression), propAccess.name);
132
+ } else if (ts.isIdentifier(propAccess.expression)) {
133
+ return ts.factory.createPropertyAccessExpression(ts.factory.createPropertyAccessExpression(expr, propAccess.expression), propAccess.name);
134
+ } else {
135
+ console.dir(propAccess);
136
+ throw new Error(`Unsupported expression type '${ts.SyntaxKind[propAccess.kind]}'`);
137
+ }
138
+ }
139
+ function expressionForPropertyName(propName) {
140
+ if (ts.isComputedPropertyName(propName)) {
141
+ return propName.expression;
142
+ } else if (ts.isIdentifier(propName)) {
143
+ return ts.factory.createStringLiteral(propName.text);
144
+ } else if (ts.isStringLiteral(propName)) {
145
+ return ts.factory.createStringLiteral(propName.text);
146
+ } else if (ts.isPrivateIdentifier(propName)) {
147
+ return ts.factory.createStringLiteral(propName.text);
148
+ } else {
149
+ throw new Error(`Unexpected property name node of type '${ts.SyntaxKind[propName.kind]}'! Please file a bug!`);
150
+ }
151
+ }
152
+ function propertyNameToString(propName) {
153
+ if (!propName)
154
+ return `<undefined>`;
155
+ if (propName.getSourceFile()) {
156
+ return propName.getText();
157
+ }
158
+ if (ts.isComputedPropertyName(propName)) {
159
+ return `(computed property name)`;
160
+ } else if (ts.isIdentifier(propName)) {
161
+ return propName.text;
162
+ } else if (ts.isStringLiteral(propName)) {
163
+ return `"${propName.text}"`;
164
+ } else if (ts.isPrivateIdentifier(propName)) {
165
+ return propName.text;
166
+ } else {
167
+ throw new Error(`Unexpected property name node of type '${ts.SyntaxKind[propName.kind]}'! Please file a bug!`);
168
+ }
169
+ }
170
+ function hasModifier(modifiers, modifier) {
171
+ var _a;
172
+ return (_a = modifiers === null || modifiers === void 0 ? void 0 : modifiers.some((x) => x.kind === modifier)) !== null && _a !== void 0 ? _a : false;
173
+ }
174
+ function hasModifiers(modifiersArray, modifiers) {
175
+ return modifiers.every((modifier) => hasModifier(modifiersArray, modifier));
176
+ }
177
+ function getModifiers(node) {
178
+ var _a;
179
+ return ts.canHaveModifiers(node) ? (_a = ts.getModifiers(node)) !== null && _a !== void 0 ? _a : [] : [];
180
+ }
181
+ function getDecorators(node) {
182
+ var _a;
183
+ return ts.canHaveDecorators(node) ? (_a = ts.getDecorators(node)) !== null && _a !== void 0 ? _a : [] : [];
184
+ }
185
+ function referenceImportedSymbol(ctx, modulePath, identifier, hasValue, importDecl) {
186
+ let impo = ctx.importMap.get(`*:${modulePath}`);
187
+ if (!impo) {
188
+ ctx.importMap.set(`*:${modulePath}`, impo = {
189
+ importDeclaration: importDecl !== null && importDecl !== void 0 ? importDecl : ctx.currentTopStatement,
190
+ isDefault: false,
191
+ isNamespace: true,
192
+ localName: `LΦ_${ctx.freeImportReference++}`,
193
+ modulePath,
194
+ name: `*:${modulePath}`,
195
+ refName: "",
196
+ referenced: true
197
+ });
198
+ }
199
+ impo.referenced = true;
200
+ if (hasValue === true) {
201
+ return ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(impo.localName), identifier);
202
+ } else if (hasValue === false) {
203
+ return ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(impo.localName), `IΦ${identifier}`);
204
+ }
205
+ return ts.factory.createBinaryExpression(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(impo.localName), identifier), ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken), ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(impo.localName), `IΦ${identifier}`));
206
+ }
207
+ function isExternalOrCommonJsModule(file) {
208
+ return (file["externalModuleIndicator"] || file["commonJsModuleIndicator"]) !== void 0;
209
+ }
210
+ function* externalModules(program) {
211
+ let checker = program.getTypeChecker();
212
+ for (const ambient of checker.getAmbientModules()) {
213
+ yield [
214
+ ambient,
215
+ /*sourceFile*/
216
+ void 0
217
+ ];
218
+ }
219
+ for (const sourceFile of program.getSourceFiles()) {
220
+ if (isExternalOrCommonJsModule(sourceFile)) {
221
+ yield [checker["getMergedSymbol"](sourceFile["symbol"]), sourceFile];
222
+ }
223
+ }
224
+ }
225
+ function removeTrailingSlash(path) {
226
+ return path.replace(/[/\\]+$/, "");
227
+ }
228
+ function getDirectoryPath(path) {
229
+ return removeTrailingSlash(removeTrailingSlash(path).replace(/[/\\][^/\\]+$/, ""));
230
+ }
231
+ function hasTrailingDirectorySeparator(path) {
232
+ return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1));
233
+ }
234
+ function isAnyDirectorySeparator(charCode) {
235
+ return charCode === 47 || charCode === 92;
236
+ }
237
+ function removeTrailingDirectorySeparator(path) {
238
+ if (hasTrailingDirectorySeparator(path)) {
239
+ return path.substr(0, path.length - 1);
240
+ }
241
+ return path;
242
+ }
243
+ function getBaseFileName(path, extensions, ignoreCase) {
244
+ path = normalizeSlashes(path);
245
+ const rootLength = getRootLength(path);
246
+ if (rootLength === path.length)
247
+ return "";
248
+ path = removeTrailingDirectorySeparator(path);
249
+ const name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(directorySeparator) + 1));
250
+ const extension = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(name, extensions, ignoreCase) : void 0;
251
+ return extension ? name.slice(0, name.length - extension.length) : name;
252
+ }
253
+ const backslashRegExp = /\\/g;
254
+ const directorySeparator = "/";
255
+ const altDirectorySeparator = "\\";
256
+ const urlSchemeSeparator = "://";
257
+ function equateStringsCaseInsensitive(a, b) {
258
+ return a === b || a !== void 0 && b !== void 0 && a.toUpperCase() === b.toUpperCase();
259
+ }
260
+ function equateStringsCaseSensitive(a, b) {
261
+ return a === b;
262
+ }
263
+ function getAnyExtensionFromPath(path, extensions, ignoreCase) {
264
+ if (extensions) {
265
+ return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? equateStringsCaseInsensitive : equateStringsCaseSensitive);
266
+ }
267
+ const baseFileName = getBaseFileName(path);
268
+ const extensionIndex = baseFileName.lastIndexOf(".");
269
+ if (extensionIndex >= 0) {
270
+ return baseFileName.substring(extensionIndex);
271
+ }
272
+ return "";
273
+ }
274
+ function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) {
275
+ if (typeof extensions === "string") {
276
+ return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || "";
277
+ }
278
+ for (const extension of extensions) {
279
+ const result = tryGetExtensionFromPath(path, extension, stringEqualityComparer);
280
+ if (result)
281
+ return result;
282
+ }
283
+ return "";
284
+ }
285
+ function tryGetExtensionFromPath(path, extension, stringEqualityComparer) {
286
+ if (!extension.startsWith("."))
287
+ extension = "." + extension;
288
+ if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46) {
289
+ const pathExtension = path.slice(path.length - extension.length);
290
+ if (stringEqualityComparer(pathExtension, extension)) {
291
+ return pathExtension;
292
+ }
293
+ }
294
+ }
295
+ function getRootLength(path) {
296
+ const rootLength = getEncodedRootLength(path);
297
+ return rootLength < 0 ? ~rootLength : rootLength;
298
+ }
299
+ function isVolumeCharacter(charCode) {
300
+ return charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90;
301
+ }
302
+ function getFileUrlVolumeSeparatorEnd(url, start) {
303
+ const ch0 = url.charCodeAt(start);
304
+ if (ch0 === 58)
305
+ return start + 1;
306
+ if (ch0 === 37 && url.charCodeAt(start + 1) === 51) {
307
+ const ch2 = url.charCodeAt(start + 2);
308
+ if (ch2 === 97 || ch2 === 65)
309
+ return start + 3;
310
+ }
311
+ return -1;
312
+ }
313
+ function getEncodedRootLength(path) {
314
+ if (!path)
315
+ return 0;
316
+ const ch0 = path.charCodeAt(0);
317
+ if (ch0 === 47 || ch0 === 92) {
318
+ if (path.charCodeAt(1) !== ch0)
319
+ return 1;
320
+ const p1 = path.indexOf(ch0 === 47 ? directorySeparator : altDirectorySeparator, 2);
321
+ if (p1 < 0)
322
+ return path.length;
323
+ return p1 + 1;
324
+ }
325
+ if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58) {
326
+ const ch2 = path.charCodeAt(2);
327
+ if (ch2 === 47 || ch2 === 92)
328
+ return 3;
329
+ if (path.length === 2)
330
+ return 2;
331
+ }
332
+ const schemeEnd = path.indexOf(urlSchemeSeparator);
333
+ if (schemeEnd !== -1) {
334
+ const authorityStart = schemeEnd + urlSchemeSeparator.length;
335
+ const authorityEnd = path.indexOf(directorySeparator, authorityStart);
336
+ if (authorityEnd !== -1) {
337
+ const scheme = path.slice(0, schemeEnd);
338
+ const authority = path.slice(authorityStart, authorityEnd);
339
+ if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) {
340
+ const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2);
341
+ if (volumeSeparatorEnd !== -1) {
342
+ if (path.charCodeAt(volumeSeparatorEnd) === 47) {
343
+ return ~(volumeSeparatorEnd + 1);
344
+ }
345
+ if (volumeSeparatorEnd === path.length) {
346
+ return ~volumeSeparatorEnd;
347
+ }
348
+ }
349
+ }
350
+ return ~(authorityEnd + 1);
351
+ }
352
+ return ~path.length;
353
+ }
354
+ return 0;
355
+ }
356
+ function normalizeSlashes(path) {
357
+ return path.replace(backslashRegExp, directorySeparator);
358
+ }
359
+ function getParentOfSymbol(symbol) {
360
+ return symbol["parent"];
361
+ }
362
+ function getDefaultLikeExportInfo(importingFile, moduleSymbol, checker, compilerOptions) {
363
+ const exported = getDefaultLikeExportWorker(importingFile, moduleSymbol, checker, compilerOptions);
364
+ if (!exported)
365
+ return void 0;
366
+ const { symbol, kind } = exported;
367
+ const info = getDefaultExportInfoWorker(symbol, checker, compilerOptions);
368
+ return info && Object.assign({ symbol, kind }, info);
369
+ }
370
+ function getDefaultExportInfoWorker(defaultExport, checker, compilerOptions) {
371
+ const localSymbol = getLocalSymbolForExportDefault(defaultExport);
372
+ if (localSymbol)
373
+ return { symbolForMeaning: localSymbol, name: localSymbol.name };
374
+ const name = getNameForExportDefault(defaultExport);
375
+ if (name !== void 0)
376
+ return { symbolForMeaning: defaultExport, name };
377
+ if (defaultExport.flags & ts.SymbolFlags.Alias) {
378
+ const aliased = checker.getImmediateAliasedSymbol(defaultExport);
379
+ if (aliased && getParentOfSymbol(aliased)) {
380
+ return getDefaultExportInfoWorker(aliased, checker, compilerOptions);
381
+ }
382
+ }
383
+ if (defaultExport.escapedName !== ts.InternalSymbolName.Default && defaultExport.escapedName !== ts.InternalSymbolName.ExportEquals) {
384
+ return { symbolForMeaning: defaultExport, name: defaultExport.getName() };
385
+ }
386
+ return { symbolForMeaning: defaultExport, name: getNameForExportedSymbol(defaultExport, compilerOptions.target) };
387
+ }
388
+ function getSymbolParentOrFail(symbol) {
389
+ var _a;
390
+ let parent = getParentOfSymbol(symbol);
391
+ if (!parent) {
392
+ throw new Error(`RTTI: Symbol parent was undefined. Flags: ${symbol.flags}. Declarations: ${(_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.map((d) => {
393
+ const inJS = isInJSFile(d);
394
+ const { expression } = d;
395
+ return (inJS ? "[JS]" : "") + d.kind + (expression ? ` (expression: ${expression.kind})` : "");
396
+ }).join(", ")}.`);
397
+ }
398
+ return parent;
399
+ }
400
+ function getNameForExportedSymbol(symbol, scriptTarget) {
401
+ if (!(symbol.flags & ts.SymbolFlags.Transient) && (symbol.escapedName === ts.InternalSymbolName.ExportEquals || symbol.escapedName === ts.InternalSymbolName.Default)) {
402
+ if (!symbol.declarations)
403
+ return void 0;
404
+ for (let d of symbol.declarations) {
405
+ if (isExportAssignment(d)) {
406
+ let expr = skipOuterExpressions(d.expression);
407
+ if (ts.isIdentifier(expr))
408
+ return expr.text;
409
+ let x = moduleSymbolToValidIdentifier(getSymbolParentOrFail(symbol), scriptTarget);
410
+ if (x)
411
+ return x;
412
+ }
413
+ }
414
+ return void 0;
415
+ }
416
+ return symbol.name;
417
+ }
418
+ function getNameForExportDefault(symbol) {
419
+ if (!symbol.declarations)
420
+ return void 0;
421
+ let firstDefined = symbol.declarations.find((x) => x !== void 0);
422
+ for (let declaration of symbol.declarations) {
423
+ if (ts.isExportAssignment(declaration)) {
424
+ let expr = skipOuterExpressions(declaration.expression);
425
+ if (ts.isIdentifier(expr))
426
+ return expr.text;
427
+ } else if (ts.isExportSpecifier(declaration)) {
428
+ if (declaration.name.text !== ts.InternalSymbolName.Default)
429
+ throw new Error("Expected the specifier to be a default export");
430
+ return declaration.propertyName && declaration.propertyName.text;
431
+ }
432
+ }
433
+ }
434
+ function getDefaultLikeExportWorker(importingFile, moduleSymbol, checker, compilerOptions) {
435
+ const defaultExport = checker.tryGetMemberInModuleExports(ts.InternalSymbolName.Default, moduleSymbol);
436
+ if (defaultExport)
437
+ return {
438
+ symbol: defaultExport,
439
+ kind: 1
440
+ /* ImportKind.Default */
441
+ };
442
+ const exportEquals = checker.resolveExternalModuleSymbol(moduleSymbol);
443
+ return exportEquals === moduleSymbol ? void 0 : { symbol: exportEquals, kind: getExportEqualsImportKind(importingFile, compilerOptions) };
444
+ }
445
+ function getExportEqualsImportKind(importingFile, compilerOptions) {
446
+ const allowSyntheticDefaults = getAllowSyntheticDefaultImports(compilerOptions);
447
+ if (getEmitModuleKind(compilerOptions) >= ts.ModuleKind.ES2015) {
448
+ return allowSyntheticDefaults ? 1 : 2;
449
+ }
450
+ if (isInJSFile(importingFile)) {
451
+ return isExternalModule(importingFile) ? 1 : 3;
452
+ }
453
+ for (const statement of importingFile.statements) {
454
+ if (statement.kind === ts.SyntaxKind.ImportEqualsDeclaration) {
455
+ return 3;
456
+ }
457
+ }
458
+ return allowSyntheticDefaults ? 1 : 3;
459
+ }
460
+ function getEmitModuleKind(compilerOptions) {
461
+ return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= ts.ScriptTarget.ES2015 ? ts.ModuleKind.ES2015 : ts.ModuleKind.CommonJS;
462
+ }
463
+ function getEmitScriptTarget(compilerOptions) {
464
+ return compilerOptions.target || ts.ScriptTarget.ES3;
465
+ }
466
+ function getAllowSyntheticDefaultImports(compilerOptions) {
467
+ const moduleKind = getEmitModuleKind(compilerOptions);
468
+ return compilerOptions.allowSyntheticDefaultImports !== void 0 ? compilerOptions.allowSyntheticDefaultImports : compilerOptions.esModuleInterop || moduleKind === ts.ModuleKind.System;
469
+ }
470
+ function isInJSFile(node) {
471
+ return !!node && !!(node.flags & ts.NodeFlags.JavaScriptFile);
472
+ }
473
+ function isExternalModule(file) {
474
+ return file.externalModuleIndicator !== void 0;
475
+ }
476
+ function getLocalSymbolForExportDefault(symbol) {
477
+ if (!isExportDefaultSymbol(symbol))
478
+ return void 0;
479
+ if (!symbol.declarations)
480
+ return void 0;
481
+ for (const decl of symbol.declarations) {
482
+ if (decl.localSymbol)
483
+ return decl.localSymbol;
484
+ }
485
+ return void 0;
486
+ }
487
+ function isExportDefaultSymbol(symbol) {
488
+ var _a, _b;
489
+ if (!symbol.declarations)
490
+ return false;
491
+ return symbol && ((_b = (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0 && hasModifier(ts.canHaveModifiers(symbol.declarations[0]) ? ts.getModifiers(symbol.declarations[0]) : [], ts.SyntaxKind.DefaultKeyword);
492
+ }
493
+ function skipOuterExpressions(node, kinds = ts.OuterExpressionKinds.All) {
494
+ while (isOuterExpression(node, kinds)) {
495
+ node = node.expression;
496
+ }
497
+ return node;
498
+ }
499
+ function isOuterExpression(node, kinds = ts.OuterExpressionKinds.All) {
500
+ switch (node.kind) {
501
+ case ts.SyntaxKind.ParenthesizedExpression:
502
+ return (kinds & ts.OuterExpressionKinds.Parentheses) !== 0;
503
+ case ts.SyntaxKind.TypeAssertionExpression:
504
+ case ts.SyntaxKind.AsExpression:
505
+ return (kinds & ts.OuterExpressionKinds.TypeAssertions) !== 0;
506
+ case ts.SyntaxKind.NonNullExpression:
507
+ return (kinds & ts.OuterExpressionKinds.NonNullAssertions) !== 0;
508
+ case ts.SyntaxKind.PartiallyEmittedExpression:
509
+ return (kinds & ts.OuterExpressionKinds.PartiallyEmittedExpressions) !== 0;
510
+ }
511
+ return false;
512
+ }
513
+ function isExportAssignment(node) {
514
+ return node.kind === ts.SyntaxKind.ExportAssignment;
515
+ }
516
+ function moduleSymbolToValidIdentifier(moduleSymbol, target) {
517
+ return moduleSpecifierToValidIdentifier(removeFileExtension(stripQuotes(moduleSymbol.name)), target);
518
+ }
519
+ function removeSuffix(str, suffix) {
520
+ return str.endsWith(suffix) ? str.slice(0, str.length - suffix.length) : str;
521
+ }
522
+ function getRttiDocTagFromNode(element, tagName) {
523
+ let tags = ts.getJSDocTags(element);
524
+ if (!tags)
525
+ return void 0;
526
+ let match = tags.find((x) => x.tagName.text === "rtti" && typeof x.comment === "string" && (x.comment.startsWith(`:${tagName} `) || x.comment === `:${tagName}`));
527
+ if (!match)
528
+ return void 0;
529
+ return match.comment.slice(`:${tagName} `.length);
530
+ }
531
+ function getRttiDocTagFromSignature(signature, tagName) {
532
+ let jsDocTags = signature.getJsDocTags();
533
+ if (!jsDocTags)
534
+ return void 0;
535
+ let tag = jsDocTags.find((x) => {
536
+ var _a;
537
+ return x.name === "rtti" && ((_a = x.text[0]) === null || _a === void 0 ? void 0 : _a.text.startsWith(`:${tagName} `));
538
+ });
539
+ if (!tag)
540
+ return void 0;
541
+ let comment = tag.text[0].text;
542
+ let value = comment.slice(`:${tagName} `.length);
543
+ return value;
544
+ }
545
+ const unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
546
+ const unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
547
+ const unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
548
+ const unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
549
+ const unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895, 895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2144, 2154, 2208, 2228, 2230, 2237, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3133, 3160, 3162, 3168, 3169, 3200, 3200, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401, 7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66335, 66349, 66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69376, 69404, 69415, 69415, 69424, 69445, 69600, 69622, 69635, 69687, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727, 70730, 70751, 70751, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71680, 71723, 71840, 71903, 71935, 71935, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72750, 72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030, 73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 123136, 123180, 123191, 123197, 123214, 123214, 123584, 123627, 124928, 125124, 125184, 125251, 125259, 125259, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101];
550
+ const unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999];
551
+ function isUnicodeIdentifierStart(code, languageVersion) {
552
+ return languageVersion >= ts.ScriptTarget.ES2015 ? lookupInUnicodeMap(code, unicodeESNextIdentifierStart) : languageVersion === ts.ScriptTarget.ES5 ? lookupInUnicodeMap(code, unicodeES5IdentifierStart) : lookupInUnicodeMap(code, unicodeES3IdentifierStart);
553
+ }
554
+ function lookupInUnicodeMap(code, map) {
555
+ if (code < map[0]) {
556
+ return false;
557
+ }
558
+ let lo = 0;
559
+ let hi = map.length;
560
+ let mid;
561
+ while (lo + 1 < hi) {
562
+ mid = lo + (hi - lo) / 2;
563
+ mid -= mid % 2;
564
+ if (map[mid] <= code && code <= map[mid + 1]) {
565
+ return true;
566
+ }
567
+ if (code < map[mid]) {
568
+ hi = mid;
569
+ } else {
570
+ lo = mid + 2;
571
+ }
572
+ }
573
+ return false;
574
+ }
575
+ function moduleSpecifierToValidIdentifier(moduleSpecifier, target) {
576
+ const baseName = getBaseFileName(removeSuffix(moduleSpecifier, "/index"));
577
+ let res = "";
578
+ let lastCharWasValid = true;
579
+ const firstCharCode = baseName.charCodeAt(0);
580
+ if (isIdentifierStart(firstCharCode, target)) {
581
+ res += String.fromCharCode(firstCharCode);
582
+ } else {
583
+ lastCharWasValid = false;
584
+ }
585
+ for (let i = 1; i < baseName.length; i++) {
586
+ const ch = baseName.charCodeAt(i);
587
+ const isValid = isIdentifierPart(ch, target);
588
+ if (isValid) {
589
+ let char = String.fromCharCode(ch);
590
+ if (!lastCharWasValid) {
591
+ char = char.toUpperCase();
592
+ }
593
+ res += char;
594
+ }
595
+ lastCharWasValid = isValid;
596
+ }
597
+ return !isStringANonContextualKeyword(res) ? res || "_" : `_${res}`;
598
+ }
599
+ function isIdentifierStart(ch, languageVersion) {
600
+ return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierStart(ch, languageVersion);
601
+ }
602
+ function isIdentifierPart(ch, languageVersion, identifierVariant) {
603
+ return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || // "-" and ":" are valid in JSX Identifiers
604
+ (identifierVariant === ts.LanguageVariant.JSX ? ch === 45 || ch === 58 : false) || ch > 127 && isUnicodeIdentifierPart(ch, languageVersion);
605
+ }
606
+ function isUnicodeIdentifierPart(code, languageVersion) {
607
+ return languageVersion >= ts.ScriptTarget.ES2015 ? lookupInUnicodeMap(code, unicodeESNextIdentifierPart) : languageVersion === ts.ScriptTarget.ES5 ? lookupInUnicodeMap(code, unicodeES5IdentifierPart) : lookupInUnicodeMap(code, unicodeES3IdentifierPart);
608
+ }
609
+ const textToKeywordObj = {
610
+ abstract: ts.SyntaxKind.AbstractKeyword,
611
+ any: ts.SyntaxKind.AnyKeyword,
612
+ as: ts.SyntaxKind.AsKeyword,
613
+ asserts: ts.SyntaxKind.AssertsKeyword,
614
+ bigint: ts.SyntaxKind.BigIntKeyword,
615
+ boolean: ts.SyntaxKind.BooleanKeyword,
616
+ break: ts.SyntaxKind.BreakKeyword,
617
+ case: ts.SyntaxKind.CaseKeyword,
618
+ catch: ts.SyntaxKind.CatchKeyword,
619
+ class: ts.SyntaxKind.ClassKeyword,
620
+ continue: ts.SyntaxKind.ContinueKeyword,
621
+ const: ts.SyntaxKind.ConstKeyword,
622
+ ["constructor"]: ts.SyntaxKind.ConstructorKeyword,
623
+ debugger: ts.SyntaxKind.DebuggerKeyword,
624
+ declare: ts.SyntaxKind.DeclareKeyword,
625
+ default: ts.SyntaxKind.DefaultKeyword,
626
+ delete: ts.SyntaxKind.DeleteKeyword,
627
+ do: ts.SyntaxKind.DoKeyword,
628
+ else: ts.SyntaxKind.ElseKeyword,
629
+ enum: ts.SyntaxKind.EnumKeyword,
630
+ export: ts.SyntaxKind.ExportKeyword,
631
+ extends: ts.SyntaxKind.ExtendsKeyword,
632
+ false: ts.SyntaxKind.FalseKeyword,
633
+ finally: ts.SyntaxKind.FinallyKeyword,
634
+ for: ts.SyntaxKind.ForKeyword,
635
+ from: ts.SyntaxKind.FromKeyword,
636
+ function: ts.SyntaxKind.FunctionKeyword,
637
+ get: ts.SyntaxKind.GetKeyword,
638
+ if: ts.SyntaxKind.IfKeyword,
639
+ implements: ts.SyntaxKind.ImplementsKeyword,
640
+ import: ts.SyntaxKind.ImportKeyword,
641
+ in: ts.SyntaxKind.InKeyword,
642
+ infer: ts.SyntaxKind.InferKeyword,
643
+ instanceof: ts.SyntaxKind.InstanceOfKeyword,
644
+ interface: ts.SyntaxKind.InterfaceKeyword,
645
+ intrinsic: ts.SyntaxKind.IntrinsicKeyword,
646
+ is: ts.SyntaxKind.IsKeyword,
647
+ keyof: ts.SyntaxKind.KeyOfKeyword,
648
+ let: ts.SyntaxKind.LetKeyword,
649
+ module: ts.SyntaxKind.ModuleKeyword,
650
+ namespace: ts.SyntaxKind.NamespaceKeyword,
651
+ never: ts.SyntaxKind.NeverKeyword,
652
+ new: ts.SyntaxKind.NewKeyword,
653
+ null: ts.SyntaxKind.NullKeyword,
654
+ number: ts.SyntaxKind.NumberKeyword,
655
+ object: ts.SyntaxKind.ObjectKeyword,
656
+ package: ts.SyntaxKind.PackageKeyword,
657
+ private: ts.SyntaxKind.PrivateKeyword,
658
+ protected: ts.SyntaxKind.ProtectedKeyword,
659
+ public: ts.SyntaxKind.PublicKeyword,
660
+ readonly: ts.SyntaxKind.ReadonlyKeyword,
661
+ require: ts.SyntaxKind.RequireKeyword,
662
+ global: ts.SyntaxKind.GlobalKeyword,
663
+ return: ts.SyntaxKind.ReturnKeyword,
664
+ set: ts.SyntaxKind.SetKeyword,
665
+ static: ts.SyntaxKind.StaticKeyword,
666
+ string: ts.SyntaxKind.StringKeyword,
667
+ super: ts.SyntaxKind.SuperKeyword,
668
+ switch: ts.SyntaxKind.SwitchKeyword,
669
+ symbol: ts.SyntaxKind.SymbolKeyword,
670
+ this: ts.SyntaxKind.ThisKeyword,
671
+ throw: ts.SyntaxKind.ThrowKeyword,
672
+ true: ts.SyntaxKind.TrueKeyword,
673
+ try: ts.SyntaxKind.TryKeyword,
674
+ type: ts.SyntaxKind.TypeKeyword,
675
+ typeof: ts.SyntaxKind.TypeOfKeyword,
676
+ undefined: ts.SyntaxKind.UndefinedKeyword,
677
+ unique: ts.SyntaxKind.UniqueKeyword,
678
+ unknown: ts.SyntaxKind.UnknownKeyword,
679
+ var: ts.SyntaxKind.VarKeyword,
680
+ void: ts.SyntaxKind.VoidKeyword,
681
+ while: ts.SyntaxKind.WhileKeyword,
682
+ with: ts.SyntaxKind.WithKeyword,
683
+ yield: ts.SyntaxKind.YieldKeyword,
684
+ async: ts.SyntaxKind.AsyncKeyword,
685
+ await: ts.SyntaxKind.AwaitKeyword,
686
+ of: ts.SyntaxKind.OfKeyword
687
+ };
688
+ function isStringANonContextualKeyword(name) {
689
+ const token = stringToToken(name);
690
+ return token !== void 0 && isNonContextualKeyword(token);
691
+ }
692
+ function isNonContextualKeyword(token) {
693
+ return isKeyword(token) && !isContextualKeyword(token);
694
+ }
695
+ function isKeyword(token) {
696
+ return ts.SyntaxKind.FirstKeyword <= token && token <= ts.SyntaxKind.LastKeyword;
697
+ }
698
+ function isContextualKeyword(token) {
699
+ return ts.SyntaxKind.FirstContextualKeyword <= token && token <= ts.SyntaxKind.LastContextualKeyword;
700
+ }
701
+ function getEntries(obj) {
702
+ return obj ? _entries(obj) : [];
703
+ }
704
+ const hasOwnProperty = Object.prototype.hasOwnProperty;
705
+ function getOwnKeys(map) {
706
+ const keys = [];
707
+ for (const key in map) {
708
+ if (hasOwnProperty.call(map, key)) {
709
+ keys.push(key);
710
+ }
711
+ }
712
+ return keys;
713
+ }
714
+ const _entries = Object.entries || ((obj) => {
715
+ const keys = getOwnKeys(obj);
716
+ const result = Array(keys.length);
717
+ for (let i = 0; i < keys.length; i++) {
718
+ result[i] = [keys[i], obj[keys[i]]];
719
+ }
720
+ return result;
721
+ });
722
+ const textToToken = new Map(getEntries(Object.assign(Object.assign({}, textToKeywordObj), { "{": ts.SyntaxKind.OpenBraceToken, "}": ts.SyntaxKind.CloseBraceToken, "(": ts.SyntaxKind.OpenParenToken, ")": ts.SyntaxKind.CloseParenToken, "[": ts.SyntaxKind.OpenBracketToken, "]": ts.SyntaxKind.CloseBracketToken, ".": ts.SyntaxKind.DotToken, "...": ts.SyntaxKind.DotDotDotToken, ";": ts.SyntaxKind.SemicolonToken, ",": ts.SyntaxKind.CommaToken, "<": ts.SyntaxKind.LessThanToken, ">": ts.SyntaxKind.GreaterThanToken, "<=": ts.SyntaxKind.LessThanEqualsToken, ">=": ts.SyntaxKind.GreaterThanEqualsToken, "==": ts.SyntaxKind.EqualsEqualsToken, "!=": ts.SyntaxKind.ExclamationEqualsToken, "===": ts.SyntaxKind.EqualsEqualsEqualsToken, "!==": ts.SyntaxKind.ExclamationEqualsEqualsToken, "=>": ts.SyntaxKind.EqualsGreaterThanToken, "+": ts.SyntaxKind.PlusToken, "-": ts.SyntaxKind.MinusToken, "**": ts.SyntaxKind.AsteriskAsteriskToken, "*": ts.SyntaxKind.AsteriskToken, "/": ts.SyntaxKind.SlashToken, "%": ts.SyntaxKind.PercentToken, "++": ts.SyntaxKind.PlusPlusToken, "--": ts.SyntaxKind.MinusMinusToken, "<<": ts.SyntaxKind.LessThanLessThanToken, "</": ts.SyntaxKind.LessThanSlashToken, ">>": ts.SyntaxKind.GreaterThanGreaterThanToken, ">>>": ts.SyntaxKind.GreaterThanGreaterThanGreaterThanToken, "&": ts.SyntaxKind.AmpersandToken, "|": ts.SyntaxKind.BarToken, "^": ts.SyntaxKind.CaretToken, "!": ts.SyntaxKind.ExclamationToken, "~": ts.SyntaxKind.TildeToken, "&&": ts.SyntaxKind.AmpersandAmpersandToken, "||": ts.SyntaxKind.BarBarToken, "?": ts.SyntaxKind.QuestionToken, "??": ts.SyntaxKind.QuestionQuestionToken, "?.": ts.SyntaxKind.QuestionDotToken, ":": ts.SyntaxKind.ColonToken, "=": ts.SyntaxKind.EqualsToken, "+=": ts.SyntaxKind.PlusEqualsToken, "-=": ts.SyntaxKind.MinusEqualsToken, "*=": ts.SyntaxKind.AsteriskEqualsToken, "**=": ts.SyntaxKind.AsteriskAsteriskEqualsToken, "/=": ts.SyntaxKind.SlashEqualsToken, "%=": ts.SyntaxKind.PercentEqualsToken, "<<=": ts.SyntaxKind.LessThanLessThanEqualsToken, ">>=": ts.SyntaxKind.GreaterThanGreaterThanEqualsToken, ">>>=": ts.SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken, "&=": ts.SyntaxKind.AmpersandEqualsToken, "|=": ts.SyntaxKind.BarEqualsToken, "^=": ts.SyntaxKind.CaretEqualsToken, "||=": ts.SyntaxKind.BarBarEqualsToken, "&&=": ts.SyntaxKind.AmpersandAmpersandEqualsToken, "??=": ts.SyntaxKind.QuestionQuestionEqualsToken, "@": ts.SyntaxKind.AtToken, "`": ts.SyntaxKind.BacktickToken })));
723
+ function stringToToken(s) {
724
+ return textToToken.get(s);
725
+ }
726
+ function stripQuotes(name) {
727
+ const length = name.length;
728
+ if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && isQuoteOrBacktick(name.charCodeAt(0))) {
729
+ return name.substring(1, length - 1);
730
+ }
731
+ return name;
732
+ }
733
+ function isQuoteOrBacktick(charCode) {
734
+ return charCode === 39 || charCode === 34 || charCode === 96;
735
+ }
736
+ const extensionsToRemove = [ts.Extension.Dts, ts.Extension.Ts, ts.Extension.Js, ts.Extension.Tsx, ts.Extension.Jsx, ts.Extension.Json];
737
+ function removeFileExtension(path) {
738
+ for (const ext of extensionsToRemove) {
739
+ const extensionless = tryRemoveExtension(path, ext);
740
+ if (extensionless !== void 0) {
741
+ return extensionless;
742
+ }
743
+ }
744
+ return path;
745
+ }
746
+ function tryRemoveExtension(path, extension) {
747
+ return path.endsWith(extension) ? removeExtension(path, extension) : void 0;
748
+ }
749
+ function removeExtension(path, extension) {
750
+ return path.substring(0, path.length - extension.length);
751
+ }
752
+ function isTypeOnlySymbol(s, checker) {
753
+ return !(skipAlias(s, checker).flags & ts.SymbolFlags.Value);
754
+ }
755
+ function skipAlias(symbol, checker) {
756
+ return symbol.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(symbol) : symbol;
757
+ }
758
+ function typeHasValue(type) {
759
+ var _a, _b;
760
+ return type.isClass() || ((_a = type.symbol) === null || _a === void 0 ? void 0 : _a.name) === "Promise" || !!((_b = type.symbol) === null || _b === void 0 ? void 0 : _b.valueDeclaration);
761
+ }
762
+ function isNodeJS() {
763
+ return Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]";
764
+ }
765
+ function hasGlobalFlag(name) {
766
+ return !!globalThis[name];
767
+ }
768
+ function setGlobalFlag(name, value) {
769
+ globalThis[name] = value;
770
+ }
771
+ function resolveName(checker, location, name, meaning, excludeGlobals) {
772
+ return checker.resolveName(name, location, meaning, excludeGlobals);
773
+ }
774
+ function isStatement(node) {
775
+ return ts["isStatement"](node);
776
+ }
777
+ function getTypeLocality(ctx, type, typeNode) {
778
+ var _a, _b;
779
+ if (!type.symbol)
780
+ return "global";
781
+ let typeSourceFile = (_b = (_a = type.symbol.declarations) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.getSourceFile();
782
+ if (!typeSourceFile || ctx.program.isSourceFileDefaultLibrary(typeSourceFile))
783
+ return "global";
784
+ let isLocal = typeSourceFile === ctx.sourceFile;
785
+ let resolvedGlobalSymbol = resolveName(ctx.checker, typeNode, type.symbol.name, ts.SymbolFlags.Value, false);
786
+ let resolvedNonGlobalSymbol = resolveName(ctx.checker, typeNode, type.symbol.name, ts.SymbolFlags.Value, true);
787
+ if (resolvedGlobalSymbol && !resolvedNonGlobalSymbol && resolvedGlobalSymbol === type.symbol)
788
+ return "global";
789
+ return isLocal ? "local" : "imported";
790
+ }
791
+ function hasFilesystemAccess() {
792
+ if (isNodeJS()) {
793
+ let fsx;
794
+ try {
795
+ fsx = require("fs");
796
+ } catch (e) {
797
+ }
798
+ return !!fsx;
799
+ }
800
+ return false;
801
+ }
802
+ function fileExists(filename) {
803
+ if (isNodeJS()) {
804
+ let fsx;
805
+ try {
806
+ fsx = require("fs");
807
+ } catch (e) {
808
+ }
809
+ if (fsx)
810
+ return fsx.existsSync(filename);
811
+ }
812
+ throw new Error(`No filesystem access available in this environment! Should guard using hasFilesystem()! This is a bug.`);
813
+ }
814
+ export {
815
+ altDirectorySeparator,
816
+ assert,
817
+ cloneEntityNameAsExpr,
818
+ cloneQualifiedName,
819
+ directorySeparator,
820
+ dottedNameToExpr,
821
+ entityNameToString,
822
+ equateStringsCaseInsensitive,
823
+ equateStringsCaseSensitive,
824
+ expressionForPropertyName,
825
+ externalModules,
826
+ fileExists,
827
+ getAllowSyntheticDefaultImports,
828
+ getAnyExtensionFromPath,
829
+ getBaseFileName,
830
+ getDecorators,
831
+ getDefaultLikeExportInfo,
832
+ getDefaultLikeExportWorker,
833
+ getDirectoryPath,
834
+ getEmitModuleKind,
835
+ getEmitScriptTarget,
836
+ getEntries,
837
+ getExportEqualsImportKind,
838
+ getLocalSymbolForExportDefault,
839
+ getModifiers,
840
+ getNameForExportDefault,
841
+ getNameForExportedSymbol,
842
+ getOwnKeys,
843
+ getParentOfSymbol,
844
+ getPropertyRoot,
845
+ getRootLength,
846
+ getRootNameOfEntityName,
847
+ getRootNameOfQualifiedName,
848
+ getRttiDocTagFromNode,
849
+ getRttiDocTagFromSignature,
850
+ getTypeLocality,
851
+ hasAnyFlag,
852
+ hasFilesystemAccess,
853
+ hasFlag,
854
+ hasGlobalFlag,
855
+ hasModifier,
856
+ hasModifiers,
857
+ hasTrailingDirectorySeparator,
858
+ isAnyDirectorySeparator,
859
+ isContextualKeyword,
860
+ isExportAssignment,
861
+ isExportDefaultSymbol,
862
+ isExternalModule,
863
+ isExternalOrCommonJsModule,
864
+ isFlagType,
865
+ isIdentifierPart,
866
+ isIdentifierStart,
867
+ isInJSFile,
868
+ isInterfaceType,
869
+ isKeyword,
870
+ isNodeJS,
871
+ isNonContextualKeyword,
872
+ isOuterExpression,
873
+ isQuoteOrBacktick,
874
+ isStatement,
875
+ isStringANonContextualKeyword,
876
+ isTypeOnlySymbol,
877
+ isUnicodeIdentifierStart,
878
+ moduleSpecifierToValidIdentifier,
879
+ moduleSymbolToValidIdentifier,
880
+ normalizeSlashes,
881
+ optionalExportRef,
882
+ propertyNameToString,
883
+ propertyPrepend,
884
+ qualifiedNameToString,
885
+ referenceImportedSymbol,
886
+ removeExtension,
887
+ removeFileExtension,
888
+ removeSuffix,
889
+ removeTrailingDirectorySeparator,
890
+ removeTrailingSlash,
891
+ replacePropertyRoot,
892
+ resolveName,
893
+ serializeEntityNameAsExpression,
894
+ serializeEntityNameAsExpressionFallback,
895
+ setGlobalFlag,
896
+ setParent,
897
+ skipAlias,
898
+ skipOuterExpressions,
899
+ stringToToken,
900
+ stripQuotes,
901
+ tryRemoveExtension,
902
+ typeHasValue
903
+ };
904
+ //# sourceMappingURL=utils.js.map