babel-plugin-react-compiler 0.0.0-experimental-0566679-20250709 → 0.0.0-experimental-acd39a6-20250709

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -10826,7 +10826,7 @@ var require_lib = __commonJS({
10826
10826
  value: true
10827
10827
  });
10828
10828
  exports2.default = void 0;
10829
- exports2.generate = generate3;
10829
+ exports2.generate = generate2;
10830
10830
  var _sourceMap = require_source_map();
10831
10831
  var _printer = require_printer();
10832
10832
  function normalizeOptions(code, opts, ast) {
@@ -10923,13 +10923,13 @@ var require_lib = __commonJS({
10923
10923
  }
10924
10924
  };
10925
10925
  }
10926
- function generate3(ast, opts = {}, code) {
10926
+ function generate2(ast, opts = {}, code) {
10927
10927
  const format = normalizeOptions(code, opts, ast);
10928
10928
  const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null;
10929
10929
  const printer = new _printer.default(format, map, ast.tokens, typeof code === "string" ? code : null);
10930
10930
  return printer.generate(ast);
10931
10931
  }
10932
- var _default = exports2.default = generate3;
10932
+ var _default = exports2.default = generate2;
10933
10933
  }
10934
10934
  });
10935
10935
 
@@ -39737,7 +39737,7 @@ var require_lib8 = __commonJS({
39737
39737
  value: true
39738
39738
  });
39739
39739
  exports2.default = void 0;
39740
- exports2.generate = generate3;
39740
+ exports2.generate = generate2;
39741
39741
  var _sourceMap = require_source_map2();
39742
39742
  var _printer = require_printer2();
39743
39743
  function normalizeOptions(code, opts, ast) {
@@ -39834,13 +39834,13 @@ var require_lib8 = __commonJS({
39834
39834
  }
39835
39835
  };
39836
39836
  }
39837
- function generate3(ast, opts = {}, code) {
39837
+ function generate2(ast, opts = {}, code) {
39838
39838
  const format = normalizeOptions(code, opts, ast);
39839
39839
  const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null;
39840
39840
  const printer = new _printer.default(format, map, ast.tokens, typeof code === "string" ? code : null);
39841
39841
  return printer.generate(ast);
39842
39842
  }
39843
- var _default = exports2.default = generate3;
39843
+ var _default = exports2.default = generate2;
39844
39844
  }
39845
39845
  });
39846
39846
 
@@ -56669,4493 +56669,6 @@ var require_invariant = __commonJS({
56669
56669
  }
56670
56670
  });
56671
56671
 
56672
- // node_modules/@babel/generator/lib/source-map.js
56673
- var require_source_map4 = __commonJS({
56674
- "node_modules/@babel/generator/lib/source-map.js"(exports2) {
56675
- "use strict";
56676
- Object.defineProperty(exports2, "__esModule", {
56677
- value: true
56678
- });
56679
- exports2.default = void 0;
56680
- function _sourceMap() {
56681
- const data = _interopRequireDefault(require_source_map3());
56682
- _sourceMap = function() {
56683
- return data;
56684
- };
56685
- return data;
56686
- }
56687
- function _interopRequireDefault(obj) {
56688
- return obj && obj.__esModule ? obj : { default: obj };
56689
- }
56690
- var SourceMap = class {
56691
- constructor(opts, code) {
56692
- this._cachedMap = null;
56693
- this._code = code;
56694
- this._opts = opts;
56695
- this._rawMappings = [];
56696
- }
56697
- get() {
56698
- if (!this._cachedMap) {
56699
- const map = this._cachedMap = new (_sourceMap()).default.SourceMapGenerator({
56700
- sourceRoot: this._opts.sourceRoot
56701
- });
56702
- const code = this._code;
56703
- if (typeof code === "string") {
56704
- map.setSourceContent(this._opts.sourceFileName, code);
56705
- } else if (typeof code === "object") {
56706
- Object.keys(code).forEach((sourceFileName) => {
56707
- map.setSourceContent(sourceFileName, code[sourceFileName]);
56708
- });
56709
- }
56710
- this._rawMappings.forEach(map.addMapping, map);
56711
- }
56712
- return this._cachedMap.toJSON();
56713
- }
56714
- getRawMappings() {
56715
- return this._rawMappings.slice();
56716
- }
56717
- mark(generatedLine, generatedColumn, line2, column2, identifierName, filename, force) {
56718
- if (this._lastGenLine !== generatedLine && line2 === null) return;
56719
- if (!force && this._lastGenLine === generatedLine && this._lastSourceLine === line2 && this._lastSourceColumn === column2) {
56720
- return;
56721
- }
56722
- this._cachedMap = null;
56723
- this._lastGenLine = generatedLine;
56724
- this._lastSourceLine = line2;
56725
- this._lastSourceColumn = column2;
56726
- this._rawMappings.push({
56727
- name: identifierName || void 0,
56728
- generated: {
56729
- line: generatedLine,
56730
- column: generatedColumn
56731
- },
56732
- source: line2 == null ? void 0 : filename || this._opts.sourceFileName,
56733
- original: line2 == null ? void 0 : {
56734
- line: line2,
56735
- column: column2
56736
- }
56737
- });
56738
- }
56739
- };
56740
- exports2.default = SourceMap;
56741
- }
56742
- });
56743
-
56744
- // ../../node_modules/lodash/_trimmedEndIndex.js
56745
- var require_trimmedEndIndex = __commonJS({
56746
- "../../node_modules/lodash/_trimmedEndIndex.js"(exports2, module2) {
56747
- "use strict";
56748
- var reWhitespace = /\s/;
56749
- function trimmedEndIndex(string) {
56750
- var index = string.length;
56751
- while (index-- && reWhitespace.test(string.charAt(index))) {
56752
- }
56753
- return index;
56754
- }
56755
- module2.exports = trimmedEndIndex;
56756
- }
56757
- });
56758
-
56759
- // ../../node_modules/lodash/_baseTrim.js
56760
- var require_baseTrim = __commonJS({
56761
- "../../node_modules/lodash/_baseTrim.js"(exports2, module2) {
56762
- "use strict";
56763
- var trimmedEndIndex = require_trimmedEndIndex();
56764
- var reTrimStart = /^\s+/;
56765
- function baseTrim(string) {
56766
- return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
56767
- }
56768
- module2.exports = baseTrim;
56769
- }
56770
- });
56771
-
56772
- // ../../node_modules/lodash/toNumber.js
56773
- var require_toNumber = __commonJS({
56774
- "../../node_modules/lodash/toNumber.js"(exports2, module2) {
56775
- "use strict";
56776
- var baseTrim = require_baseTrim();
56777
- var isObject = require_isObject();
56778
- var isSymbol = require_isSymbol();
56779
- var NAN = 0 / 0;
56780
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
56781
- var reIsBinary = /^0b[01]+$/i;
56782
- var reIsOctal = /^0o[0-7]+$/i;
56783
- var freeParseInt = parseInt;
56784
- function toNumber(value) {
56785
- if (typeof value == "number") {
56786
- return value;
56787
- }
56788
- if (isSymbol(value)) {
56789
- return NAN;
56790
- }
56791
- if (isObject(value)) {
56792
- var other = typeof value.valueOf == "function" ? value.valueOf() : value;
56793
- value = isObject(other) ? other + "" : other;
56794
- }
56795
- if (typeof value != "string") {
56796
- return value === 0 ? value : +value;
56797
- }
56798
- value = baseTrim(value);
56799
- var isBinary = reIsBinary.test(value);
56800
- return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
56801
- }
56802
- module2.exports = toNumber;
56803
- }
56804
- });
56805
-
56806
- // ../../node_modules/lodash/toFinite.js
56807
- var require_toFinite = __commonJS({
56808
- "../../node_modules/lodash/toFinite.js"(exports2, module2) {
56809
- "use strict";
56810
- var toNumber = require_toNumber();
56811
- var INFINITY = 1 / 0;
56812
- var MAX_INTEGER = 17976931348623157e292;
56813
- function toFinite(value) {
56814
- if (!value) {
56815
- return value === 0 ? value : 0;
56816
- }
56817
- value = toNumber(value);
56818
- if (value === INFINITY || value === -INFINITY) {
56819
- var sign2 = value < 0 ? -1 : 1;
56820
- return sign2 * MAX_INTEGER;
56821
- }
56822
- return value === value ? value : 0;
56823
- }
56824
- module2.exports = toFinite;
56825
- }
56826
- });
56827
-
56828
- // ../../node_modules/lodash/toInteger.js
56829
- var require_toInteger = __commonJS({
56830
- "../../node_modules/lodash/toInteger.js"(exports2, module2) {
56831
- "use strict";
56832
- var toFinite = require_toFinite();
56833
- function toInteger(value) {
56834
- var result = toFinite(value), remainder = result % 1;
56835
- return result === result ? remainder ? result - remainder : result : 0;
56836
- }
56837
- module2.exports = toInteger;
56838
- }
56839
- });
56840
-
56841
- // ../../node_modules/lodash/isInteger.js
56842
- var require_isInteger = __commonJS({
56843
- "../../node_modules/lodash/isInteger.js"(exports2, module2) {
56844
- "use strict";
56845
- var toInteger = require_toInteger();
56846
- function isInteger(value) {
56847
- return typeof value == "number" && value == toInteger(value);
56848
- }
56849
- module2.exports = isInteger;
56850
- }
56851
- });
56852
-
56853
- // ../../node_modules/lodash/_baseRepeat.js
56854
- var require_baseRepeat = __commonJS({
56855
- "../../node_modules/lodash/_baseRepeat.js"(exports2, module2) {
56856
- "use strict";
56857
- var MAX_SAFE_INTEGER = 9007199254740991;
56858
- var nativeFloor = Math.floor;
56859
- function baseRepeat(string, n) {
56860
- var result = "";
56861
- if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
56862
- return result;
56863
- }
56864
- do {
56865
- if (n % 2) {
56866
- result += string;
56867
- }
56868
- n = nativeFloor(n / 2);
56869
- if (n) {
56870
- string += string;
56871
- }
56872
- } while (n);
56873
- return result;
56874
- }
56875
- module2.exports = baseRepeat;
56876
- }
56877
- });
56878
-
56879
- // ../../node_modules/lodash/repeat.js
56880
- var require_repeat = __commonJS({
56881
- "../../node_modules/lodash/repeat.js"(exports2, module2) {
56882
- "use strict";
56883
- var baseRepeat = require_baseRepeat();
56884
- var isIterateeCall = require_isIterateeCall();
56885
- var toInteger = require_toInteger();
56886
- var toString = require_toString();
56887
- function repeat(string, n, guard) {
56888
- if (guard ? isIterateeCall(string, n, guard) : n === void 0) {
56889
- n = 1;
56890
- } else {
56891
- n = toInteger(n);
56892
- }
56893
- return baseRepeat(toString(string), n);
56894
- }
56895
- module2.exports = repeat;
56896
- }
56897
- });
56898
-
56899
- // ../../node_modules/trim-right/index.js
56900
- var require_trim_right = __commonJS({
56901
- "../../node_modules/trim-right/index.js"(exports2, module2) {
56902
- "use strict";
56903
- module2.exports = function(str) {
56904
- var tail = str.length;
56905
- while (/[\s\uFEFF\u00A0]/.test(str[tail - 1])) {
56906
- tail--;
56907
- }
56908
- return str.slice(0, tail);
56909
- };
56910
- }
56911
- });
56912
-
56913
- // node_modules/@babel/generator/lib/buffer.js
56914
- var require_buffer3 = __commonJS({
56915
- "node_modules/@babel/generator/lib/buffer.js"(exports2) {
56916
- "use strict";
56917
- Object.defineProperty(exports2, "__esModule", {
56918
- value: true
56919
- });
56920
- exports2.default = void 0;
56921
- function _trimRight() {
56922
- const data = _interopRequireDefault(require_trim_right());
56923
- _trimRight = function() {
56924
- return data;
56925
- };
56926
- return data;
56927
- }
56928
- function _interopRequireDefault(obj) {
56929
- return obj && obj.__esModule ? obj : { default: obj };
56930
- }
56931
- var SPACES_RE = /^[ \t]+$/;
56932
- var Buffer2 = class {
56933
- constructor(map) {
56934
- this._map = null;
56935
- this._buf = [];
56936
- this._last = "";
56937
- this._queue = [];
56938
- this._position = {
56939
- line: 1,
56940
- column: 0
56941
- };
56942
- this._sourcePosition = {
56943
- identifierName: null,
56944
- line: null,
56945
- column: null,
56946
- filename: null
56947
- };
56948
- this._disallowedPop = null;
56949
- this._map = map;
56950
- }
56951
- get() {
56952
- this._flush();
56953
- const map = this._map;
56954
- const result = {
56955
- code: (0, _trimRight().default)(this._buf.join("")),
56956
- map: null,
56957
- rawMappings: map && map.getRawMappings()
56958
- };
56959
- if (map) {
56960
- Object.defineProperty(result, "map", {
56961
- configurable: true,
56962
- enumerable: true,
56963
- get() {
56964
- return this.map = map.get();
56965
- },
56966
- set(value) {
56967
- Object.defineProperty(this, "map", {
56968
- value,
56969
- writable: true
56970
- });
56971
- }
56972
- });
56973
- }
56974
- return result;
56975
- }
56976
- append(str) {
56977
- this._flush();
56978
- const {
56979
- line: line2,
56980
- column: column2,
56981
- filename,
56982
- identifierName,
56983
- force
56984
- } = this._sourcePosition;
56985
- this._append(str, line2, column2, identifierName, filename, force);
56986
- }
56987
- queue(str) {
56988
- if (str === "\n") {
56989
- while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) {
56990
- this._queue.shift();
56991
- }
56992
- }
56993
- const {
56994
- line: line2,
56995
- column: column2,
56996
- filename,
56997
- identifierName,
56998
- force
56999
- } = this._sourcePosition;
57000
- this._queue.unshift([str, line2, column2, identifierName, filename, force]);
57001
- }
57002
- _flush() {
57003
- let item;
57004
- while (item = this._queue.pop()) this._append(...item);
57005
- }
57006
- _append(str, line2, column2, identifierName, filename, force) {
57007
- if (this._map && str[0] !== "\n") {
57008
- this._map.mark(this._position.line, this._position.column, line2, column2, identifierName, filename, force);
57009
- }
57010
- this._buf.push(str);
57011
- this._last = str[str.length - 1];
57012
- for (let i = 0; i < str.length; i++) {
57013
- if (str[i] === "\n") {
57014
- this._position.line++;
57015
- this._position.column = 0;
57016
- } else {
57017
- this._position.column++;
57018
- }
57019
- }
57020
- }
57021
- removeTrailingNewline() {
57022
- if (this._queue.length > 0 && this._queue[0][0] === "\n") {
57023
- this._queue.shift();
57024
- }
57025
- }
57026
- removeLastSemicolon() {
57027
- if (this._queue.length > 0 && this._queue[0][0] === ";") {
57028
- this._queue.shift();
57029
- }
57030
- }
57031
- endsWith(suffix) {
57032
- if (suffix.length === 1) {
57033
- let last;
57034
- if (this._queue.length > 0) {
57035
- const str = this._queue[0][0];
57036
- last = str[str.length - 1];
57037
- } else {
57038
- last = this._last;
57039
- }
57040
- return last === suffix;
57041
- }
57042
- const end = this._last + this._queue.reduce((acc, item) => item[0] + acc, "");
57043
- if (suffix.length <= end.length) {
57044
- return end.slice(-suffix.length) === suffix;
57045
- }
57046
- return false;
57047
- }
57048
- hasContent() {
57049
- return this._queue.length > 0 || !!this._last;
57050
- }
57051
- exactSource(loc, cb) {
57052
- this.source("start", loc, true);
57053
- cb();
57054
- this.source("end", loc);
57055
- this._disallowPop("start", loc);
57056
- }
57057
- source(prop, loc, force) {
57058
- if (prop && !loc) return;
57059
- this._normalizePosition(prop, loc, this._sourcePosition, force);
57060
- }
57061
- withSource(prop, loc, cb) {
57062
- if (!this._map) return cb();
57063
- const originalLine = this._sourcePosition.line;
57064
- const originalColumn = this._sourcePosition.column;
57065
- const originalFilename = this._sourcePosition.filename;
57066
- const originalIdentifierName = this._sourcePosition.identifierName;
57067
- this.source(prop, loc);
57068
- cb();
57069
- if ((!this._sourcePosition.force || this._sourcePosition.line !== originalLine || this._sourcePosition.column !== originalColumn || this._sourcePosition.filename !== originalFilename) && (!this._disallowedPop || this._disallowedPop.line !== originalLine || this._disallowedPop.column !== originalColumn || this._disallowedPop.filename !== originalFilename)) {
57070
- this._sourcePosition.line = originalLine;
57071
- this._sourcePosition.column = originalColumn;
57072
- this._sourcePosition.filename = originalFilename;
57073
- this._sourcePosition.identifierName = originalIdentifierName;
57074
- this._sourcePosition.force = false;
57075
- this._disallowedPop = null;
57076
- }
57077
- }
57078
- _disallowPop(prop, loc) {
57079
- if (prop && !loc) return;
57080
- this._disallowedPop = this._normalizePosition(prop, loc);
57081
- }
57082
- _normalizePosition(prop, loc, targetObj, force) {
57083
- const pos2 = loc ? loc[prop] : null;
57084
- if (targetObj === void 0) {
57085
- targetObj = {
57086
- identifierName: null,
57087
- line: null,
57088
- column: null,
57089
- filename: null,
57090
- force: false
57091
- };
57092
- }
57093
- const origLine = targetObj.line;
57094
- const origColumn = targetObj.column;
57095
- const origFilename = targetObj.filename;
57096
- targetObj.identifierName = prop === "start" && loc && loc.identifierName || null;
57097
- targetObj.line = pos2 ? pos2.line : null;
57098
- targetObj.column = pos2 ? pos2.column : null;
57099
- targetObj.filename = loc && loc.filename || null;
57100
- if (force || targetObj.line !== origLine || targetObj.column !== origColumn || targetObj.filename !== origFilename) {
57101
- targetObj.force = force;
57102
- }
57103
- return targetObj;
57104
- }
57105
- getCurrentColumn() {
57106
- const extra = this._queue.reduce((acc, item) => item[0] + acc, "");
57107
- const lastIndex = extra.lastIndexOf("\n");
57108
- return lastIndex === -1 ? this._position.column + extra.length : extra.length - 1 - lastIndex;
57109
- }
57110
- getCurrentLine() {
57111
- const extra = this._queue.reduce((acc, item) => item[0] + acc, "");
57112
- let count = 0;
57113
- for (let i = 0; i < extra.length; i++) {
57114
- if (extra[i] === "\n") count++;
57115
- }
57116
- return this._position.line + count;
57117
- }
57118
- };
57119
- exports2.default = Buffer2;
57120
- }
57121
- });
57122
-
57123
- // node_modules/@babel/generator/lib/node/whitespace.js
57124
- var require_whitespace3 = __commonJS({
57125
- "node_modules/@babel/generator/lib/node/whitespace.js"(exports2) {
57126
- "use strict";
57127
- Object.defineProperty(exports2, "__esModule", {
57128
- value: true
57129
- });
57130
- exports2.list = exports2.nodes = void 0;
57131
- function t6() {
57132
- const data = _interopRequireWildcard(require("@babel/types"));
57133
- t6 = function() {
57134
- return data;
57135
- };
57136
- return data;
57137
- }
57138
- function _interopRequireWildcard(obj) {
57139
- if (obj && obj.__esModule) {
57140
- return obj;
57141
- } else {
57142
- var newObj = {};
57143
- if (obj != null) {
57144
- for (var key2 in obj) {
57145
- if (Object.prototype.hasOwnProperty.call(obj, key2)) {
57146
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : {};
57147
- if (desc.get || desc.set) {
57148
- Object.defineProperty(newObj, key2, desc);
57149
- } else {
57150
- newObj[key2] = obj[key2];
57151
- }
57152
- }
57153
- }
57154
- }
57155
- newObj.default = obj;
57156
- return newObj;
57157
- }
57158
- }
57159
- function crawl(node, state = {}) {
57160
- if (t6().isMemberExpression(node)) {
57161
- crawl(node.object, state);
57162
- if (node.computed) crawl(node.property, state);
57163
- } else if (t6().isBinary(node) || t6().isAssignmentExpression(node)) {
57164
- crawl(node.left, state);
57165
- crawl(node.right, state);
57166
- } else if (t6().isCallExpression(node)) {
57167
- state.hasCall = true;
57168
- crawl(node.callee, state);
57169
- } else if (t6().isFunction(node)) {
57170
- state.hasFunction = true;
57171
- } else if (t6().isIdentifier(node)) {
57172
- state.hasHelper = state.hasHelper || isHelper(node.callee);
57173
- }
57174
- return state;
57175
- }
57176
- function isHelper(node) {
57177
- if (t6().isMemberExpression(node)) {
57178
- return isHelper(node.object) || isHelper(node.property);
57179
- } else if (t6().isIdentifier(node)) {
57180
- return node.name === "require" || node.name[0] === "_";
57181
- } else if (t6().isCallExpression(node)) {
57182
- return isHelper(node.callee);
57183
- } else if (t6().isBinary(node) || t6().isAssignmentExpression(node)) {
57184
- return t6().isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right);
57185
- } else {
57186
- return false;
57187
- }
57188
- }
57189
- function isType(node) {
57190
- return t6().isLiteral(node) || t6().isObjectExpression(node) || t6().isArrayExpression(node) || t6().isIdentifier(node) || t6().isMemberExpression(node);
57191
- }
57192
- var nodes = {
57193
- AssignmentExpression(node) {
57194
- const state = crawl(node.right);
57195
- if (state.hasCall && state.hasHelper || state.hasFunction) {
57196
- return {
57197
- before: state.hasFunction,
57198
- after: true
57199
- };
57200
- }
57201
- },
57202
- SwitchCase(node, parent) {
57203
- return {
57204
- before: node.consequent.length || parent.cases[0] === node,
57205
- after: !node.consequent.length && parent.cases[parent.cases.length - 1] === node
57206
- };
57207
- },
57208
- LogicalExpression(node) {
57209
- if (t6().isFunction(node.left) || t6().isFunction(node.right)) {
57210
- return {
57211
- after: true
57212
- };
57213
- }
57214
- },
57215
- Literal(node) {
57216
- if (node.value === "use strict") {
57217
- return {
57218
- after: true
57219
- };
57220
- }
57221
- },
57222
- CallExpression(node) {
57223
- if (t6().isFunction(node.callee) || isHelper(node)) {
57224
- return {
57225
- before: true,
57226
- after: true
57227
- };
57228
- }
57229
- },
57230
- VariableDeclaration(node) {
57231
- for (let i = 0; i < node.declarations.length; i++) {
57232
- const declar = node.declarations[i];
57233
- let enabled = isHelper(declar.id) && !isType(declar.init);
57234
- if (!enabled) {
57235
- const state = crawl(declar.init);
57236
- enabled = isHelper(declar.init) && state.hasCall || state.hasFunction;
57237
- }
57238
- if (enabled) {
57239
- return {
57240
- before: true,
57241
- after: true
57242
- };
57243
- }
57244
- }
57245
- },
57246
- IfStatement(node) {
57247
- if (t6().isBlockStatement(node.consequent)) {
57248
- return {
57249
- before: true,
57250
- after: true
57251
- };
57252
- }
57253
- }
57254
- };
57255
- exports2.nodes = nodes;
57256
- nodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function(node, parent) {
57257
- if (parent.properties[0] === node) {
57258
- return {
57259
- before: true
57260
- };
57261
- }
57262
- };
57263
- nodes.ObjectTypeCallProperty = function(node, parent) {
57264
- if (parent.callProperties[0] === node && (!parent.properties || !parent.properties.length)) {
57265
- return {
57266
- before: true
57267
- };
57268
- }
57269
- };
57270
- nodes.ObjectTypeIndexer = function(node, parent) {
57271
- if (parent.indexers[0] === node && (!parent.properties || !parent.properties.length) && (!parent.callProperties || !parent.callProperties.length)) {
57272
- return {
57273
- before: true
57274
- };
57275
- }
57276
- };
57277
- nodes.ObjectTypeInternalSlot = function(node, parent) {
57278
- if (parent.internalSlots[0] === node && (!parent.properties || !parent.properties.length) && (!parent.callProperties || !parent.callProperties.length) && (!parent.indexers || !parent.indexers.length)) {
57279
- return {
57280
- before: true
57281
- };
57282
- }
57283
- };
57284
- var list = {
57285
- VariableDeclaration(node) {
57286
- return node.declarations.map((decl) => decl.init);
57287
- },
57288
- ArrayExpression(node) {
57289
- return node.elements;
57290
- },
57291
- ObjectExpression(node) {
57292
- return node.properties;
57293
- }
57294
- };
57295
- exports2.list = list;
57296
- [["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function([type, amounts]) {
57297
- if (typeof amounts === "boolean") {
57298
- amounts = {
57299
- after: amounts,
57300
- before: amounts
57301
- };
57302
- }
57303
- [type].concat(t6().FLIPPED_ALIAS_KEYS[type] || []).forEach(function(type2) {
57304
- nodes[type2] = function() {
57305
- return amounts;
57306
- };
57307
- });
57308
- });
57309
- }
57310
- });
57311
-
57312
- // node_modules/@babel/generator/lib/node/parentheses.js
57313
- var require_parentheses3 = __commonJS({
57314
- "node_modules/@babel/generator/lib/node/parentheses.js"(exports2) {
57315
- "use strict";
57316
- Object.defineProperty(exports2, "__esModule", {
57317
- value: true
57318
- });
57319
- exports2.FunctionTypeAnnotation = exports2.NullableTypeAnnotation = NullableTypeAnnotation;
57320
- exports2.UpdateExpression = UpdateExpression;
57321
- exports2.ObjectExpression = ObjectExpression;
57322
- exports2.DoExpression = DoExpression;
57323
- exports2.Binary = Binary;
57324
- exports2.IntersectionTypeAnnotation = exports2.UnionTypeAnnotation = UnionTypeAnnotation;
57325
- exports2.TSAsExpression = TSAsExpression;
57326
- exports2.TSTypeAssertion = TSTypeAssertion;
57327
- exports2.BinaryExpression = BinaryExpression;
57328
- exports2.SequenceExpression = SequenceExpression;
57329
- exports2.AwaitExpression = exports2.YieldExpression = YieldExpression;
57330
- exports2.ClassExpression = ClassExpression;
57331
- exports2.UnaryLike = UnaryLike;
57332
- exports2.FunctionExpression = FunctionExpression9;
57333
- exports2.ArrowFunctionExpression = ArrowFunctionExpression;
57334
- exports2.ConditionalExpression = ConditionalExpression;
57335
- exports2.OptionalMemberExpression = OptionalMemberExpression;
57336
- exports2.AssignmentExpression = AssignmentExpression;
57337
- exports2.NewExpression = NewExpression2;
57338
- function t6() {
57339
- const data = _interopRequireWildcard(require("@babel/types"));
57340
- t6 = function() {
57341
- return data;
57342
- };
57343
- return data;
57344
- }
57345
- function _interopRequireWildcard(obj) {
57346
- if (obj && obj.__esModule) {
57347
- return obj;
57348
- } else {
57349
- var newObj = {};
57350
- if (obj != null) {
57351
- for (var key2 in obj) {
57352
- if (Object.prototype.hasOwnProperty.call(obj, key2)) {
57353
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : {};
57354
- if (desc.get || desc.set) {
57355
- Object.defineProperty(newObj, key2, desc);
57356
- } else {
57357
- newObj[key2] = obj[key2];
57358
- }
57359
- }
57360
- }
57361
- }
57362
- newObj.default = obj;
57363
- return newObj;
57364
- }
57365
- }
57366
- var PRECEDENCE = {
57367
- "||": 0,
57368
- "&&": 1,
57369
- "|": 2,
57370
- "^": 3,
57371
- "&": 4,
57372
- "==": 5,
57373
- "===": 5,
57374
- "!=": 5,
57375
- "!==": 5,
57376
- "<": 6,
57377
- ">": 6,
57378
- "<=": 6,
57379
- ">=": 6,
57380
- in: 6,
57381
- instanceof: 6,
57382
- ">>": 7,
57383
- "<<": 7,
57384
- ">>>": 7,
57385
- "+": 8,
57386
- "-": 8,
57387
- "*": 9,
57388
- "/": 9,
57389
- "%": 9,
57390
- "**": 10
57391
- };
57392
- var isClassExtendsClause = (node, parent) => (t6().isClassDeclaration(parent) || t6().isClassExpression(parent)) && parent.superClass === node;
57393
- function NullableTypeAnnotation(node, parent) {
57394
- return t6().isArrayTypeAnnotation(parent);
57395
- }
57396
- function UpdateExpression(node, parent) {
57397
- return t6().isMemberExpression(parent, {
57398
- object: node
57399
- }) || t6().isCallExpression(parent, {
57400
- callee: node
57401
- }) || t6().isNewExpression(parent, {
57402
- callee: node
57403
- }) || isClassExtendsClause(node, parent);
57404
- }
57405
- function ObjectExpression(node, parent, printStack) {
57406
- return isFirstInStatement(printStack, {
57407
- considerArrow: true
57408
- });
57409
- }
57410
- function DoExpression(node, parent, printStack) {
57411
- return isFirstInStatement(printStack);
57412
- }
57413
- function Binary(node, parent) {
57414
- if (node.operator === "**" && t6().isBinaryExpression(parent, {
57415
- operator: "**"
57416
- })) {
57417
- return parent.left === node;
57418
- }
57419
- if (isClassExtendsClause(node, parent)) {
57420
- return true;
57421
- }
57422
- if ((t6().isCallExpression(parent) || t6().isNewExpression(parent)) && parent.callee === node || t6().isUnaryLike(parent) || t6().isMemberExpression(parent) && parent.object === node || t6().isAwaitExpression(parent)) {
57423
- return true;
57424
- }
57425
- if (t6().isBinary(parent)) {
57426
- const parentOp = parent.operator;
57427
- const parentPos = PRECEDENCE[parentOp];
57428
- const nodeOp = node.operator;
57429
- const nodePos = PRECEDENCE[nodeOp];
57430
- if (parentPos === nodePos && parent.right === node && !t6().isLogicalExpression(parent) || parentPos > nodePos) {
57431
- return true;
57432
- }
57433
- }
57434
- return false;
57435
- }
57436
- function UnionTypeAnnotation(node, parent) {
57437
- return t6().isArrayTypeAnnotation(parent) || t6().isNullableTypeAnnotation(parent) || t6().isIntersectionTypeAnnotation(parent) || t6().isUnionTypeAnnotation(parent);
57438
- }
57439
- function TSAsExpression() {
57440
- return true;
57441
- }
57442
- function TSTypeAssertion() {
57443
- return true;
57444
- }
57445
- function BinaryExpression(node, parent) {
57446
- return node.operator === "in" && (t6().isVariableDeclarator(parent) || t6().isFor(parent));
57447
- }
57448
- function SequenceExpression(node, parent) {
57449
- if (t6().isForStatement(parent) || t6().isThrowStatement(parent) || t6().isReturnStatement(parent) || t6().isIfStatement(parent) && parent.test === node || t6().isWhileStatement(parent) && parent.test === node || t6().isForInStatement(parent) && parent.right === node || t6().isSwitchStatement(parent) && parent.discriminant === node || t6().isExpressionStatement(parent) && parent.expression === node) {
57450
- return false;
57451
- }
57452
- return true;
57453
- }
57454
- function YieldExpression(node, parent) {
57455
- return t6().isBinary(parent) || t6().isUnaryLike(parent) || t6().isCallExpression(parent) || t6().isMemberExpression(parent) || t6().isNewExpression(parent) || t6().isAwaitExpression(parent) && t6().isYieldExpression(node) || t6().isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent);
57456
- }
57457
- function ClassExpression(node, parent, printStack) {
57458
- return isFirstInStatement(printStack, {
57459
- considerDefaultExports: true
57460
- });
57461
- }
57462
- function UnaryLike(node, parent) {
57463
- return t6().isMemberExpression(parent, {
57464
- object: node
57465
- }) || t6().isCallExpression(parent, {
57466
- callee: node
57467
- }) || t6().isNewExpression(parent, {
57468
- callee: node
57469
- }) || t6().isBinaryExpression(parent, {
57470
- operator: "**",
57471
- left: node
57472
- }) || isClassExtendsClause(node, parent);
57473
- }
57474
- function FunctionExpression9(node, parent, printStack) {
57475
- return isFirstInStatement(printStack, {
57476
- considerDefaultExports: true
57477
- });
57478
- }
57479
- function ArrowFunctionExpression(node, parent) {
57480
- return t6().isExportDeclaration(parent) || ConditionalExpression(node, parent);
57481
- }
57482
- function ConditionalExpression(node, parent) {
57483
- if (t6().isUnaryLike(parent) || t6().isBinary(parent) || t6().isConditionalExpression(parent, {
57484
- test: node
57485
- }) || t6().isAwaitExpression(parent) || t6().isOptionalMemberExpression(parent) || t6().isTaggedTemplateExpression(parent) || t6().isTSTypeAssertion(parent) || t6().isTSAsExpression(parent)) {
57486
- return true;
57487
- }
57488
- return UnaryLike(node, parent);
57489
- }
57490
- function OptionalMemberExpression(node, parent) {
57491
- return t6().isCallExpression(parent) || t6().isMemberExpression(parent);
57492
- }
57493
- function AssignmentExpression(node) {
57494
- if (t6().isObjectPattern(node.left)) {
57495
- return true;
57496
- } else {
57497
- return ConditionalExpression(...arguments);
57498
- }
57499
- }
57500
- function NewExpression2(node, parent) {
57501
- return isClassExtendsClause(node, parent);
57502
- }
57503
- function isFirstInStatement(printStack, {
57504
- considerArrow = false,
57505
- considerDefaultExports = false
57506
- } = {}) {
57507
- let i = printStack.length - 1;
57508
- let node = printStack[i];
57509
- i--;
57510
- let parent = printStack[i];
57511
- while (i > 0) {
57512
- if (t6().isExpressionStatement(parent, {
57513
- expression: node
57514
- }) || t6().isTaggedTemplateExpression(parent) || considerDefaultExports && t6().isExportDefaultDeclaration(parent, {
57515
- declaration: node
57516
- }) || considerArrow && t6().isArrowFunctionExpression(parent, {
57517
- body: node
57518
- })) {
57519
- return true;
57520
- }
57521
- if (t6().isCallExpression(parent, {
57522
- callee: node
57523
- }) || t6().isSequenceExpression(parent) && parent.expressions[0] === node || t6().isMemberExpression(parent, {
57524
- object: node
57525
- }) || t6().isConditional(parent, {
57526
- test: node
57527
- }) || t6().isBinary(parent, {
57528
- left: node
57529
- }) || t6().isAssignmentExpression(parent, {
57530
- left: node
57531
- })) {
57532
- node = parent;
57533
- i--;
57534
- parent = printStack[i];
57535
- } else {
57536
- return false;
57537
- }
57538
- }
57539
- return false;
57540
- }
57541
- }
57542
- });
57543
-
57544
- // node_modules/@babel/generator/lib/node/index.js
57545
- var require_node4 = __commonJS({
57546
- "node_modules/@babel/generator/lib/node/index.js"(exports2) {
57547
- "use strict";
57548
- Object.defineProperty(exports2, "__esModule", {
57549
- value: true
57550
- });
57551
- exports2.needsWhitespace = needsWhitespace;
57552
- exports2.needsWhitespaceBefore = needsWhitespaceBefore;
57553
- exports2.needsWhitespaceAfter = needsWhitespaceAfter;
57554
- exports2.needsParens = needsParens;
57555
- var whitespace = _interopRequireWildcard(require_whitespace3());
57556
- var parens = _interopRequireWildcard(require_parentheses3());
57557
- function t6() {
57558
- const data = _interopRequireWildcard(require("@babel/types"));
57559
- t6 = function() {
57560
- return data;
57561
- };
57562
- return data;
57563
- }
57564
- function _interopRequireWildcard(obj) {
57565
- if (obj && obj.__esModule) {
57566
- return obj;
57567
- } else {
57568
- var newObj = {};
57569
- if (obj != null) {
57570
- for (var key2 in obj) {
57571
- if (Object.prototype.hasOwnProperty.call(obj, key2)) {
57572
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : {};
57573
- if (desc.get || desc.set) {
57574
- Object.defineProperty(newObj, key2, desc);
57575
- } else {
57576
- newObj[key2] = obj[key2];
57577
- }
57578
- }
57579
- }
57580
- }
57581
- newObj.default = obj;
57582
- return newObj;
57583
- }
57584
- }
57585
- function expandAliases(obj) {
57586
- const newObj = {};
57587
- function add(type, func) {
57588
- const fn = newObj[type];
57589
- newObj[type] = fn ? function(node, parent, stack2) {
57590
- const result = fn(node, parent, stack2);
57591
- return result == null ? func(node, parent, stack2) : result;
57592
- } : func;
57593
- }
57594
- for (const type of Object.keys(obj)) {
57595
- const aliases = t6().FLIPPED_ALIAS_KEYS[type];
57596
- if (aliases) {
57597
- for (const alias of aliases) {
57598
- add(alias, obj[type]);
57599
- }
57600
- } else {
57601
- add(type, obj[type]);
57602
- }
57603
- }
57604
- return newObj;
57605
- }
57606
- var expandedParens = expandAliases(parens);
57607
- var expandedWhitespaceNodes = expandAliases(whitespace.nodes);
57608
- var expandedWhitespaceList = expandAliases(whitespace.list);
57609
- function find(obj, node, parent, printStack) {
57610
- const fn = obj[node.type];
57611
- return fn ? fn(node, parent, printStack) : null;
57612
- }
57613
- function isOrHasCallExpression(node) {
57614
- if (t6().isCallExpression(node)) {
57615
- return true;
57616
- }
57617
- if (t6().isMemberExpression(node)) {
57618
- return isOrHasCallExpression(node.object) || !node.computed && isOrHasCallExpression(node.property);
57619
- } else {
57620
- return false;
57621
- }
57622
- }
57623
- function needsWhitespace(node, parent, type) {
57624
- if (!node) return 0;
57625
- if (t6().isExpressionStatement(node)) {
57626
- node = node.expression;
57627
- }
57628
- let linesInfo = find(expandedWhitespaceNodes, node, parent);
57629
- if (!linesInfo) {
57630
- const items = find(expandedWhitespaceList, node, parent);
57631
- if (items) {
57632
- for (let i = 0; i < items.length; i++) {
57633
- linesInfo = needsWhitespace(items[i], node, type);
57634
- if (linesInfo) break;
57635
- }
57636
- }
57637
- }
57638
- if (typeof linesInfo === "object" && linesInfo !== null) {
57639
- return linesInfo[type] || 0;
57640
- }
57641
- return 0;
57642
- }
57643
- function needsWhitespaceBefore(node, parent) {
57644
- return needsWhitespace(node, parent, "before");
57645
- }
57646
- function needsWhitespaceAfter(node, parent) {
57647
- return needsWhitespace(node, parent, "after");
57648
- }
57649
- function needsParens(node, parent, printStack) {
57650
- if (!parent) return false;
57651
- if (t6().isNewExpression(parent) && parent.callee === node) {
57652
- if (isOrHasCallExpression(node)) return true;
57653
- }
57654
- return find(expandedParens, node, parent, printStack);
57655
- }
57656
- }
57657
- });
57658
-
57659
- // node_modules/@babel/generator/lib/generators/template-literals.js
57660
- var require_template_literals3 = __commonJS({
57661
- "node_modules/@babel/generator/lib/generators/template-literals.js"(exports2) {
57662
- "use strict";
57663
- Object.defineProperty(exports2, "__esModule", {
57664
- value: true
57665
- });
57666
- exports2.TaggedTemplateExpression = TaggedTemplateExpression;
57667
- exports2.TemplateElement = TemplateElement;
57668
- exports2.TemplateLiteral = TemplateLiteral;
57669
- function TaggedTemplateExpression(node) {
57670
- this.print(node.tag, node);
57671
- this.print(node.typeParameters, node);
57672
- this.print(node.quasi, node);
57673
- }
57674
- function TemplateElement(node, parent) {
57675
- const isFirst = parent.quasis[0] === node;
57676
- const isLast = parent.quasis[parent.quasis.length - 1] === node;
57677
- const value = (isFirst ? "`" : "}") + node.value.raw + (isLast ? "`" : "${");
57678
- this.token(value);
57679
- }
57680
- function TemplateLiteral(node) {
57681
- const quasis = node.quasis;
57682
- for (let i = 0; i < quasis.length; i++) {
57683
- this.print(quasis[i], node);
57684
- if (i + 1 < quasis.length) {
57685
- this.print(node.expressions[i], node);
57686
- }
57687
- }
57688
- }
57689
- }
57690
- });
57691
-
57692
- // node_modules/@babel/generator/lib/generators/expressions.js
57693
- var require_expressions3 = __commonJS({
57694
- "node_modules/@babel/generator/lib/generators/expressions.js"(exports2) {
57695
- "use strict";
57696
- Object.defineProperty(exports2, "__esModule", {
57697
- value: true
57698
- });
57699
- exports2.UnaryExpression = UnaryExpression;
57700
- exports2.DoExpression = DoExpression;
57701
- exports2.ParenthesizedExpression = ParenthesizedExpression;
57702
- exports2.UpdateExpression = UpdateExpression;
57703
- exports2.ConditionalExpression = ConditionalExpression;
57704
- exports2.NewExpression = NewExpression2;
57705
- exports2.SequenceExpression = SequenceExpression;
57706
- exports2.ThisExpression = ThisExpression;
57707
- exports2.Super = Super;
57708
- exports2.Decorator = Decorator;
57709
- exports2.OptionalMemberExpression = OptionalMemberExpression;
57710
- exports2.OptionalCallExpression = OptionalCallExpression;
57711
- exports2.CallExpression = CallExpression5;
57712
- exports2.Import = Import;
57713
- exports2.EmptyStatement = EmptyStatement;
57714
- exports2.ExpressionStatement = ExpressionStatement;
57715
- exports2.AssignmentPattern = AssignmentPattern;
57716
- exports2.LogicalExpression = exports2.BinaryExpression = exports2.AssignmentExpression = AssignmentExpression;
57717
- exports2.BindExpression = BindExpression;
57718
- exports2.MemberExpression = MemberExpression;
57719
- exports2.MetaProperty = MetaProperty;
57720
- exports2.PrivateName = PrivateName;
57721
- exports2.AwaitExpression = exports2.YieldExpression = void 0;
57722
- function t6() {
57723
- const data = _interopRequireWildcard(require("@babel/types"));
57724
- t6 = function() {
57725
- return data;
57726
- };
57727
- return data;
57728
- }
57729
- var n = _interopRequireWildcard(require_node4());
57730
- function _interopRequireWildcard(obj) {
57731
- if (obj && obj.__esModule) {
57732
- return obj;
57733
- } else {
57734
- var newObj = {};
57735
- if (obj != null) {
57736
- for (var key2 in obj) {
57737
- if (Object.prototype.hasOwnProperty.call(obj, key2)) {
57738
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : {};
57739
- if (desc.get || desc.set) {
57740
- Object.defineProperty(newObj, key2, desc);
57741
- } else {
57742
- newObj[key2] = obj[key2];
57743
- }
57744
- }
57745
- }
57746
- }
57747
- newObj.default = obj;
57748
- return newObj;
57749
- }
57750
- }
57751
- function UnaryExpression(node) {
57752
- if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof" || node.operator === "throw") {
57753
- this.word(node.operator);
57754
- this.space();
57755
- } else {
57756
- this.token(node.operator);
57757
- }
57758
- this.print(node.argument, node);
57759
- }
57760
- function DoExpression(node) {
57761
- this.word("do");
57762
- this.space();
57763
- this.print(node.body, node);
57764
- }
57765
- function ParenthesizedExpression(node) {
57766
- this.token("(");
57767
- this.print(node.expression, node);
57768
- this.token(")");
57769
- }
57770
- function UpdateExpression(node) {
57771
- if (node.prefix) {
57772
- this.token(node.operator);
57773
- this.print(node.argument, node);
57774
- } else {
57775
- this.startTerminatorless(true);
57776
- this.print(node.argument, node);
57777
- this.endTerminatorless();
57778
- this.token(node.operator);
57779
- }
57780
- }
57781
- function ConditionalExpression(node) {
57782
- this.print(node.test, node);
57783
- this.space();
57784
- this.token("?");
57785
- this.space();
57786
- this.print(node.consequent, node);
57787
- this.space();
57788
- this.token(":");
57789
- this.space();
57790
- this.print(node.alternate, node);
57791
- }
57792
- function NewExpression2(node, parent) {
57793
- this.word("new");
57794
- this.space();
57795
- this.print(node.callee, node);
57796
- if (this.format.minified && node.arguments.length === 0 && !node.optional && !t6().isCallExpression(parent, {
57797
- callee: node
57798
- }) && !t6().isMemberExpression(parent) && !t6().isNewExpression(parent)) {
57799
- return;
57800
- }
57801
- this.print(node.typeArguments, node);
57802
- this.print(node.typeParameters, node);
57803
- if (node.optional) {
57804
- this.token("?.");
57805
- }
57806
- this.token("(");
57807
- this.printList(node.arguments, node);
57808
- this.token(")");
57809
- }
57810
- function SequenceExpression(node) {
57811
- this.printList(node.expressions, node);
57812
- }
57813
- function ThisExpression() {
57814
- this.word("this");
57815
- }
57816
- function Super() {
57817
- this.word("super");
57818
- }
57819
- function Decorator(node) {
57820
- this.token("@");
57821
- this.print(node.expression, node);
57822
- this.newline();
57823
- }
57824
- function OptionalMemberExpression(node) {
57825
- this.print(node.object, node);
57826
- if (!node.computed && t6().isMemberExpression(node.property)) {
57827
- throw new TypeError("Got a MemberExpression for MemberExpression property");
57828
- }
57829
- let computed = node.computed;
57830
- if (t6().isLiteral(node.property) && typeof node.property.value === "number") {
57831
- computed = true;
57832
- }
57833
- if (node.optional) {
57834
- this.token("?.");
57835
- }
57836
- if (computed) {
57837
- this.token("[");
57838
- this.print(node.property, node);
57839
- this.token("]");
57840
- } else {
57841
- if (!node.optional) {
57842
- this.token(".");
57843
- }
57844
- this.print(node.property, node);
57845
- }
57846
- }
57847
- function OptionalCallExpression(node) {
57848
- this.print(node.callee, node);
57849
- this.print(node.typeArguments, node);
57850
- this.print(node.typeParameters, node);
57851
- if (node.optional) {
57852
- this.token("?.");
57853
- }
57854
- this.token("(");
57855
- this.printList(node.arguments, node);
57856
- this.token(")");
57857
- }
57858
- function CallExpression5(node) {
57859
- this.print(node.callee, node);
57860
- this.print(node.typeArguments, node);
57861
- this.print(node.typeParameters, node);
57862
- this.token("(");
57863
- this.printList(node.arguments, node);
57864
- this.token(")");
57865
- }
57866
- function Import() {
57867
- this.word("import");
57868
- }
57869
- function buildYieldAwait(keyword) {
57870
- return function(node) {
57871
- this.word(keyword);
57872
- if (node.delegate) {
57873
- this.token("*");
57874
- }
57875
- if (node.argument) {
57876
- this.space();
57877
- const terminatorState = this.startTerminatorless();
57878
- this.print(node.argument, node);
57879
- this.endTerminatorless(terminatorState);
57880
- }
57881
- };
57882
- }
57883
- var YieldExpression = buildYieldAwait("yield");
57884
- exports2.YieldExpression = YieldExpression;
57885
- var AwaitExpression = buildYieldAwait("await");
57886
- exports2.AwaitExpression = AwaitExpression;
57887
- function EmptyStatement() {
57888
- this.semicolon(true);
57889
- }
57890
- function ExpressionStatement(node) {
57891
- this.print(node.expression, node);
57892
- this.semicolon();
57893
- }
57894
- function AssignmentPattern(node) {
57895
- this.print(node.left, node);
57896
- if (node.left.optional) this.token("?");
57897
- this.print(node.left.typeAnnotation, node);
57898
- this.space();
57899
- this.token("=");
57900
- this.space();
57901
- this.print(node.right, node);
57902
- }
57903
- function AssignmentExpression(node, parent) {
57904
- const parens = this.inForStatementInitCounter && node.operator === "in" && !n.needsParens(node, parent);
57905
- if (parens) {
57906
- this.token("(");
57907
- }
57908
- this.print(node.left, node);
57909
- this.space();
57910
- if (node.operator === "in" || node.operator === "instanceof") {
57911
- this.word(node.operator);
57912
- } else {
57913
- this.token(node.operator);
57914
- }
57915
- this.space();
57916
- this.print(node.right, node);
57917
- if (parens) {
57918
- this.token(")");
57919
- }
57920
- }
57921
- function BindExpression(node) {
57922
- this.print(node.object, node);
57923
- this.token("::");
57924
- this.print(node.callee, node);
57925
- }
57926
- function MemberExpression(node) {
57927
- this.print(node.object, node);
57928
- if (!node.computed && t6().isMemberExpression(node.property)) {
57929
- throw new TypeError("Got a MemberExpression for MemberExpression property");
57930
- }
57931
- let computed = node.computed;
57932
- if (t6().isLiteral(node.property) && typeof node.property.value === "number") {
57933
- computed = true;
57934
- }
57935
- if (computed) {
57936
- this.token("[");
57937
- this.print(node.property, node);
57938
- this.token("]");
57939
- } else {
57940
- this.token(".");
57941
- this.print(node.property, node);
57942
- }
57943
- }
57944
- function MetaProperty(node) {
57945
- this.print(node.meta, node);
57946
- this.token(".");
57947
- this.print(node.property, node);
57948
- }
57949
- function PrivateName(node) {
57950
- this.token("#");
57951
- this.print(node.id, node);
57952
- }
57953
- }
57954
- });
57955
-
57956
- // node_modules/@babel/generator/lib/generators/statements.js
57957
- var require_statements3 = __commonJS({
57958
- "node_modules/@babel/generator/lib/generators/statements.js"(exports2) {
57959
- "use strict";
57960
- Object.defineProperty(exports2, "__esModule", {
57961
- value: true
57962
- });
57963
- exports2.WithStatement = WithStatement;
57964
- exports2.IfStatement = IfStatement;
57965
- exports2.ForStatement = ForStatement;
57966
- exports2.WhileStatement = WhileStatement;
57967
- exports2.DoWhileStatement = DoWhileStatement;
57968
- exports2.LabeledStatement = LabeledStatement;
57969
- exports2.TryStatement = TryStatement;
57970
- exports2.CatchClause = CatchClause;
57971
- exports2.SwitchStatement = SwitchStatement;
57972
- exports2.SwitchCase = SwitchCase;
57973
- exports2.DebuggerStatement = DebuggerStatement;
57974
- exports2.VariableDeclaration = VariableDeclaration;
57975
- exports2.VariableDeclarator = VariableDeclarator;
57976
- exports2.ThrowStatement = exports2.BreakStatement = exports2.ReturnStatement = exports2.ContinueStatement = exports2.ForOfStatement = exports2.ForInStatement = void 0;
57977
- function t6() {
57978
- const data = _interopRequireWildcard(require("@babel/types"));
57979
- t6 = function() {
57980
- return data;
57981
- };
57982
- return data;
57983
- }
57984
- function _interopRequireWildcard(obj) {
57985
- if (obj && obj.__esModule) {
57986
- return obj;
57987
- } else {
57988
- var newObj = {};
57989
- if (obj != null) {
57990
- for (var key2 in obj) {
57991
- if (Object.prototype.hasOwnProperty.call(obj, key2)) {
57992
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : {};
57993
- if (desc.get || desc.set) {
57994
- Object.defineProperty(newObj, key2, desc);
57995
- } else {
57996
- newObj[key2] = obj[key2];
57997
- }
57998
- }
57999
- }
58000
- }
58001
- newObj.default = obj;
58002
- return newObj;
58003
- }
58004
- }
58005
- function WithStatement(node) {
58006
- this.word("with");
58007
- this.space();
58008
- this.token("(");
58009
- this.print(node.object, node);
58010
- this.token(")");
58011
- this.printBlock(node);
58012
- }
58013
- function IfStatement(node) {
58014
- this.word("if");
58015
- this.space();
58016
- this.token("(");
58017
- this.print(node.test, node);
58018
- this.token(")");
58019
- this.space();
58020
- const needsBlock = node.alternate && t6().isIfStatement(getLastStatement(node.consequent));
58021
- if (needsBlock) {
58022
- this.token("{");
58023
- this.newline();
58024
- this.indent();
58025
- }
58026
- this.printAndIndentOnComments(node.consequent, node);
58027
- if (needsBlock) {
58028
- this.dedent();
58029
- this.newline();
58030
- this.token("}");
58031
- }
58032
- if (node.alternate) {
58033
- if (this.endsWith("}")) this.space();
58034
- this.word("else");
58035
- this.space();
58036
- this.printAndIndentOnComments(node.alternate, node);
58037
- }
58038
- }
58039
- function getLastStatement(statement) {
58040
- if (!t6().isStatement(statement.body)) return statement;
58041
- return getLastStatement(statement.body);
58042
- }
58043
- function ForStatement(node) {
58044
- this.word("for");
58045
- this.space();
58046
- this.token("(");
58047
- this.inForStatementInitCounter++;
58048
- this.print(node.init, node);
58049
- this.inForStatementInitCounter--;
58050
- this.token(";");
58051
- if (node.test) {
58052
- this.space();
58053
- this.print(node.test, node);
58054
- }
58055
- this.token(";");
58056
- if (node.update) {
58057
- this.space();
58058
- this.print(node.update, node);
58059
- }
58060
- this.token(")");
58061
- this.printBlock(node);
58062
- }
58063
- function WhileStatement(node) {
58064
- this.word("while");
58065
- this.space();
58066
- this.token("(");
58067
- this.print(node.test, node);
58068
- this.token(")");
58069
- this.printBlock(node);
58070
- }
58071
- var buildForXStatement = function(op) {
58072
- return function(node) {
58073
- this.word("for");
58074
- this.space();
58075
- if (op === "of" && node.await) {
58076
- this.word("await");
58077
- this.space();
58078
- }
58079
- this.token("(");
58080
- this.print(node.left, node);
58081
- this.space();
58082
- this.word(op);
58083
- this.space();
58084
- this.print(node.right, node);
58085
- this.token(")");
58086
- this.printBlock(node);
58087
- };
58088
- };
58089
- var ForInStatement = buildForXStatement("in");
58090
- exports2.ForInStatement = ForInStatement;
58091
- var ForOfStatement = buildForXStatement("of");
58092
- exports2.ForOfStatement = ForOfStatement;
58093
- function DoWhileStatement(node) {
58094
- this.word("do");
58095
- this.space();
58096
- this.print(node.body, node);
58097
- this.space();
58098
- this.word("while");
58099
- this.space();
58100
- this.token("(");
58101
- this.print(node.test, node);
58102
- this.token(")");
58103
- this.semicolon();
58104
- }
58105
- function buildLabelStatement(prefix, key2 = "label") {
58106
- return function(node) {
58107
- this.word(prefix);
58108
- const label = node[key2];
58109
- if (label) {
58110
- this.space();
58111
- const isLabel = key2 == "label";
58112
- const terminatorState = this.startTerminatorless(isLabel);
58113
- this.print(label, node);
58114
- this.endTerminatorless(terminatorState);
58115
- }
58116
- this.semicolon();
58117
- };
58118
- }
58119
- var ContinueStatement = buildLabelStatement("continue");
58120
- exports2.ContinueStatement = ContinueStatement;
58121
- var ReturnStatement = buildLabelStatement("return", "argument");
58122
- exports2.ReturnStatement = ReturnStatement;
58123
- var BreakStatement = buildLabelStatement("break");
58124
- exports2.BreakStatement = BreakStatement;
58125
- var ThrowStatement = buildLabelStatement("throw", "argument");
58126
- exports2.ThrowStatement = ThrowStatement;
58127
- function LabeledStatement(node) {
58128
- this.print(node.label, node);
58129
- this.token(":");
58130
- this.space();
58131
- this.print(node.body, node);
58132
- }
58133
- function TryStatement(node) {
58134
- this.word("try");
58135
- this.space();
58136
- this.print(node.block, node);
58137
- this.space();
58138
- if (node.handlers) {
58139
- this.print(node.handlers[0], node);
58140
- } else {
58141
- this.print(node.handler, node);
58142
- }
58143
- if (node.finalizer) {
58144
- this.space();
58145
- this.word("finally");
58146
- this.space();
58147
- this.print(node.finalizer, node);
58148
- }
58149
- }
58150
- function CatchClause(node) {
58151
- this.word("catch");
58152
- this.space();
58153
- if (node.param) {
58154
- this.token("(");
58155
- this.print(node.param, node);
58156
- this.token(")");
58157
- this.space();
58158
- }
58159
- this.print(node.body, node);
58160
- }
58161
- function SwitchStatement(node) {
58162
- this.word("switch");
58163
- this.space();
58164
- this.token("(");
58165
- this.print(node.discriminant, node);
58166
- this.token(")");
58167
- this.space();
58168
- this.token("{");
58169
- this.printSequence(node.cases, node, {
58170
- indent: true,
58171
- addNewlines(leading, cas) {
58172
- if (!leading && node.cases[node.cases.length - 1] === cas) return -1;
58173
- }
58174
- });
58175
- this.token("}");
58176
- }
58177
- function SwitchCase(node) {
58178
- if (node.test) {
58179
- this.word("case");
58180
- this.space();
58181
- this.print(node.test, node);
58182
- this.token(":");
58183
- } else {
58184
- this.word("default");
58185
- this.token(":");
58186
- }
58187
- if (node.consequent.length) {
58188
- this.newline();
58189
- this.printSequence(node.consequent, node, {
58190
- indent: true
58191
- });
58192
- }
58193
- }
58194
- function DebuggerStatement() {
58195
- this.word("debugger");
58196
- this.semicolon();
58197
- }
58198
- function variableDeclarationIndent() {
58199
- this.token(",");
58200
- this.newline();
58201
- if (this.endsWith("\n")) for (let i = 0; i < 4; i++) this.space(true);
58202
- }
58203
- function constDeclarationIndent() {
58204
- this.token(",");
58205
- this.newline();
58206
- if (this.endsWith("\n")) for (let i = 0; i < 6; i++) this.space(true);
58207
- }
58208
- function VariableDeclaration(node, parent) {
58209
- if (node.declare) {
58210
- this.word("declare");
58211
- this.space();
58212
- }
58213
- this.word(node.kind);
58214
- this.space();
58215
- let hasInits = false;
58216
- if (!t6().isFor(parent)) {
58217
- for (const declar of node.declarations) {
58218
- if (declar.init) {
58219
- hasInits = true;
58220
- }
58221
- }
58222
- }
58223
- let separator;
58224
- if (hasInits) {
58225
- separator = node.kind === "const" ? constDeclarationIndent : variableDeclarationIndent;
58226
- }
58227
- this.printList(node.declarations, node, {
58228
- separator
58229
- });
58230
- if (t6().isFor(parent)) {
58231
- if (parent.left === node || parent.init === node) return;
58232
- }
58233
- this.semicolon();
58234
- }
58235
- function VariableDeclarator(node) {
58236
- this.print(node.id, node);
58237
- if (node.definite) this.token("!");
58238
- this.print(node.id.typeAnnotation, node);
58239
- if (node.init) {
58240
- this.space();
58241
- this.token("=");
58242
- this.space();
58243
- this.print(node.init, node);
58244
- }
58245
- }
58246
- }
58247
- });
58248
-
58249
- // node_modules/@babel/generator/lib/generators/classes.js
58250
- var require_classes3 = __commonJS({
58251
- "node_modules/@babel/generator/lib/generators/classes.js"(exports2) {
58252
- "use strict";
58253
- Object.defineProperty(exports2, "__esModule", {
58254
- value: true
58255
- });
58256
- exports2.ClassExpression = exports2.ClassDeclaration = ClassDeclaration;
58257
- exports2.ClassBody = ClassBody;
58258
- exports2.ClassProperty = ClassProperty;
58259
- exports2.ClassPrivateProperty = ClassPrivateProperty;
58260
- exports2.ClassMethod = ClassMethod;
58261
- exports2.ClassPrivateMethod = ClassPrivateMethod;
58262
- exports2._classMethodHead = _classMethodHead;
58263
- function t6() {
58264
- const data = _interopRequireWildcard(require("@babel/types"));
58265
- t6 = function() {
58266
- return data;
58267
- };
58268
- return data;
58269
- }
58270
- function _interopRequireWildcard(obj) {
58271
- if (obj && obj.__esModule) {
58272
- return obj;
58273
- } else {
58274
- var newObj = {};
58275
- if (obj != null) {
58276
- for (var key2 in obj) {
58277
- if (Object.prototype.hasOwnProperty.call(obj, key2)) {
58278
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : {};
58279
- if (desc.get || desc.set) {
58280
- Object.defineProperty(newObj, key2, desc);
58281
- } else {
58282
- newObj[key2] = obj[key2];
58283
- }
58284
- }
58285
- }
58286
- }
58287
- newObj.default = obj;
58288
- return newObj;
58289
- }
58290
- }
58291
- function ClassDeclaration(node, parent) {
58292
- if (!this.format.decoratorsBeforeExport || !t6().isExportDefaultDeclaration(parent) && !t6().isExportNamedDeclaration(parent)) {
58293
- this.printJoin(node.decorators, node);
58294
- }
58295
- if (node.declare) {
58296
- this.word("declare");
58297
- this.space();
58298
- }
58299
- if (node.abstract) {
58300
- this.word("abstract");
58301
- this.space();
58302
- }
58303
- this.word("class");
58304
- if (node.id) {
58305
- this.space();
58306
- this.print(node.id, node);
58307
- }
58308
- this.print(node.typeParameters, node);
58309
- if (node.superClass) {
58310
- this.space();
58311
- this.word("extends");
58312
- this.space();
58313
- this.print(node.superClass, node);
58314
- this.print(node.superTypeParameters, node);
58315
- }
58316
- if (node.implements) {
58317
- this.space();
58318
- this.word("implements");
58319
- this.space();
58320
- this.printList(node.implements, node);
58321
- }
58322
- this.space();
58323
- this.print(node.body, node);
58324
- }
58325
- function ClassBody(node) {
58326
- this.token("{");
58327
- this.printInnerComments(node);
58328
- if (node.body.length === 0) {
58329
- this.token("}");
58330
- } else {
58331
- this.newline();
58332
- this.indent();
58333
- this.printSequence(node.body, node);
58334
- this.dedent();
58335
- if (!this.endsWith("\n")) this.newline();
58336
- this.rightBrace();
58337
- }
58338
- }
58339
- function ClassProperty(node) {
58340
- this.printJoin(node.decorators, node);
58341
- if (node.accessibility) {
58342
- this.word(node.accessibility);
58343
- this.space();
58344
- }
58345
- if (node.static) {
58346
- this.word("static");
58347
- this.space();
58348
- }
58349
- if (node.abstract) {
58350
- this.word("abstract");
58351
- this.space();
58352
- }
58353
- if (node.readonly) {
58354
- this.word("readonly");
58355
- this.space();
58356
- }
58357
- if (node.computed) {
58358
- this.token("[");
58359
- this.print(node.key, node);
58360
- this.token("]");
58361
- } else {
58362
- this._variance(node);
58363
- this.print(node.key, node);
58364
- }
58365
- if (node.optional) {
58366
- this.token("?");
58367
- }
58368
- if (node.definite) {
58369
- this.token("!");
58370
- }
58371
- this.print(node.typeAnnotation, node);
58372
- if (node.value) {
58373
- this.space();
58374
- this.token("=");
58375
- this.space();
58376
- this.print(node.value, node);
58377
- }
58378
- this.semicolon();
58379
- }
58380
- function ClassPrivateProperty(node) {
58381
- if (node.static) {
58382
- this.word("static");
58383
- this.space();
58384
- }
58385
- this.print(node.key, node);
58386
- this.print(node.typeAnnotation, node);
58387
- if (node.value) {
58388
- this.space();
58389
- this.token("=");
58390
- this.space();
58391
- this.print(node.value, node);
58392
- }
58393
- this.semicolon();
58394
- }
58395
- function ClassMethod(node) {
58396
- this._classMethodHead(node);
58397
- this.space();
58398
- this.print(node.body, node);
58399
- }
58400
- function ClassPrivateMethod(node) {
58401
- this._classMethodHead(node);
58402
- this.space();
58403
- this.print(node.body, node);
58404
- }
58405
- function _classMethodHead(node) {
58406
- this.printJoin(node.decorators, node);
58407
- if (node.accessibility) {
58408
- this.word(node.accessibility);
58409
- this.space();
58410
- }
58411
- if (node.abstract) {
58412
- this.word("abstract");
58413
- this.space();
58414
- }
58415
- if (node.static) {
58416
- this.word("static");
58417
- this.space();
58418
- }
58419
- this._methodHead(node);
58420
- }
58421
- }
58422
- });
58423
-
58424
- // node_modules/@babel/generator/lib/generators/methods.js
58425
- var require_methods3 = __commonJS({
58426
- "node_modules/@babel/generator/lib/generators/methods.js"(exports2) {
58427
- "use strict";
58428
- Object.defineProperty(exports2, "__esModule", {
58429
- value: true
58430
- });
58431
- exports2._params = _params;
58432
- exports2._parameters = _parameters;
58433
- exports2._param = _param;
58434
- exports2._methodHead = _methodHead;
58435
- exports2._predicate = _predicate;
58436
- exports2._functionHead = _functionHead;
58437
- exports2.FunctionDeclaration = exports2.FunctionExpression = FunctionExpression9;
58438
- exports2.ArrowFunctionExpression = ArrowFunctionExpression;
58439
- function t6() {
58440
- const data = _interopRequireWildcard(require("@babel/types"));
58441
- t6 = function() {
58442
- return data;
58443
- };
58444
- return data;
58445
- }
58446
- function _interopRequireWildcard(obj) {
58447
- if (obj && obj.__esModule) {
58448
- return obj;
58449
- } else {
58450
- var newObj = {};
58451
- if (obj != null) {
58452
- for (var key2 in obj) {
58453
- if (Object.prototype.hasOwnProperty.call(obj, key2)) {
58454
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : {};
58455
- if (desc.get || desc.set) {
58456
- Object.defineProperty(newObj, key2, desc);
58457
- } else {
58458
- newObj[key2] = obj[key2];
58459
- }
58460
- }
58461
- }
58462
- }
58463
- newObj.default = obj;
58464
- return newObj;
58465
- }
58466
- }
58467
- function _params(node) {
58468
- this.print(node.typeParameters, node);
58469
- this.token("(");
58470
- this._parameters(node.params, node);
58471
- this.token(")");
58472
- this.print(node.returnType, node);
58473
- }
58474
- function _parameters(parameters, parent) {
58475
- for (let i = 0; i < parameters.length; i++) {
58476
- this._param(parameters[i], parent);
58477
- if (i < parameters.length - 1) {
58478
- this.token(",");
58479
- this.space();
58480
- }
58481
- }
58482
- }
58483
- function _param(parameter, parent) {
58484
- this.printJoin(parameter.decorators, parameter);
58485
- this.print(parameter, parent);
58486
- if (parameter.optional) this.token("?");
58487
- this.print(parameter.typeAnnotation, parameter);
58488
- }
58489
- function _methodHead(node) {
58490
- const kind = node.kind;
58491
- const key2 = node.key;
58492
- if (kind === "get" || kind === "set") {
58493
- this.word(kind);
58494
- this.space();
58495
- }
58496
- if (node.async) {
58497
- this.word("async");
58498
- this.space();
58499
- }
58500
- if (kind === "method" || kind === "init") {
58501
- if (node.generator) {
58502
- this.token("*");
58503
- }
58504
- }
58505
- if (node.computed) {
58506
- this.token("[");
58507
- this.print(key2, node);
58508
- this.token("]");
58509
- } else {
58510
- this.print(key2, node);
58511
- }
58512
- if (node.optional) {
58513
- this.token("?");
58514
- }
58515
- this._params(node);
58516
- }
58517
- function _predicate(node) {
58518
- if (node.predicate) {
58519
- if (!node.returnType) {
58520
- this.token(":");
58521
- }
58522
- this.space();
58523
- this.print(node.predicate, node);
58524
- }
58525
- }
58526
- function _functionHead(node) {
58527
- if (node.async) {
58528
- this.word("async");
58529
- this.space();
58530
- }
58531
- this.word("function");
58532
- if (node.generator) this.token("*");
58533
- this.space();
58534
- if (node.id) {
58535
- this.print(node.id, node);
58536
- }
58537
- this._params(node);
58538
- this._predicate(node);
58539
- }
58540
- function FunctionExpression9(node) {
58541
- this._functionHead(node);
58542
- this.space();
58543
- this.print(node.body, node);
58544
- }
58545
- function ArrowFunctionExpression(node) {
58546
- if (node.async) {
58547
- this.word("async");
58548
- this.space();
58549
- }
58550
- const firstParam = node.params[0];
58551
- if (node.params.length === 1 && t6().isIdentifier(firstParam) && !hasTypes(node, firstParam)) {
58552
- if (this.format.retainLines && node.loc && node.body.loc && node.loc.start.line < node.body.loc.start.line) {
58553
- this.token("(");
58554
- if (firstParam.loc && firstParam.loc.start.line > node.loc.start.line) {
58555
- this.indent();
58556
- this.print(firstParam, node);
58557
- this.dedent();
58558
- this._catchUp("start", node.body.loc);
58559
- } else {
58560
- this.print(firstParam, node);
58561
- }
58562
- this.token(")");
58563
- } else {
58564
- this.print(firstParam, node);
58565
- }
58566
- } else {
58567
- this._params(node);
58568
- }
58569
- this._predicate(node);
58570
- this.space();
58571
- this.token("=>");
58572
- this.space();
58573
- this.print(node.body, node);
58574
- }
58575
- function hasTypes(node, param) {
58576
- return node.typeParameters || node.returnType || param.typeAnnotation || param.optional || param.trailingComments;
58577
- }
58578
- }
58579
- });
58580
-
58581
- // node_modules/@babel/generator/lib/generators/modules.js
58582
- var require_modules3 = __commonJS({
58583
- "node_modules/@babel/generator/lib/generators/modules.js"(exports2) {
58584
- "use strict";
58585
- Object.defineProperty(exports2, "__esModule", {
58586
- value: true
58587
- });
58588
- exports2.ImportSpecifier = ImportSpecifier;
58589
- exports2.ImportDefaultSpecifier = ImportDefaultSpecifier;
58590
- exports2.ExportDefaultSpecifier = ExportDefaultSpecifier;
58591
- exports2.ExportSpecifier = ExportSpecifier;
58592
- exports2.ExportNamespaceSpecifier = ExportNamespaceSpecifier;
58593
- exports2.ExportAllDeclaration = ExportAllDeclaration;
58594
- exports2.ExportNamedDeclaration = ExportNamedDeclaration;
58595
- exports2.ExportDefaultDeclaration = ExportDefaultDeclaration;
58596
- exports2.ImportDeclaration = ImportDeclaration;
58597
- exports2.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
58598
- function t6() {
58599
- const data = _interopRequireWildcard(require("@babel/types"));
58600
- t6 = function() {
58601
- return data;
58602
- };
58603
- return data;
58604
- }
58605
- function _interopRequireWildcard(obj) {
58606
- if (obj && obj.__esModule) {
58607
- return obj;
58608
- } else {
58609
- var newObj = {};
58610
- if (obj != null) {
58611
- for (var key2 in obj) {
58612
- if (Object.prototype.hasOwnProperty.call(obj, key2)) {
58613
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : {};
58614
- if (desc.get || desc.set) {
58615
- Object.defineProperty(newObj, key2, desc);
58616
- } else {
58617
- newObj[key2] = obj[key2];
58618
- }
58619
- }
58620
- }
58621
- }
58622
- newObj.default = obj;
58623
- return newObj;
58624
- }
58625
- }
58626
- function ImportSpecifier(node) {
58627
- if (node.importKind === "type" || node.importKind === "typeof") {
58628
- this.word(node.importKind);
58629
- this.space();
58630
- }
58631
- this.print(node.imported, node);
58632
- if (node.local && node.local.name !== node.imported.name) {
58633
- this.space();
58634
- this.word("as");
58635
- this.space();
58636
- this.print(node.local, node);
58637
- }
58638
- }
58639
- function ImportDefaultSpecifier(node) {
58640
- this.print(node.local, node);
58641
- }
58642
- function ExportDefaultSpecifier(node) {
58643
- this.print(node.exported, node);
58644
- }
58645
- function ExportSpecifier(node) {
58646
- this.print(node.local, node);
58647
- if (node.exported && node.local.name !== node.exported.name) {
58648
- this.space();
58649
- this.word("as");
58650
- this.space();
58651
- this.print(node.exported, node);
58652
- }
58653
- }
58654
- function ExportNamespaceSpecifier(node) {
58655
- this.token("*");
58656
- this.space();
58657
- this.word("as");
58658
- this.space();
58659
- this.print(node.exported, node);
58660
- }
58661
- function ExportAllDeclaration(node) {
58662
- this.word("export");
58663
- this.space();
58664
- if (node.exportKind === "type") {
58665
- this.word("type");
58666
- this.space();
58667
- }
58668
- this.token("*");
58669
- this.space();
58670
- this.word("from");
58671
- this.space();
58672
- this.print(node.source, node);
58673
- this.semicolon();
58674
- }
58675
- function ExportNamedDeclaration(node) {
58676
- if (this.format.decoratorsBeforeExport && t6().isClassDeclaration(node.declaration)) {
58677
- this.printJoin(node.declaration.decorators, node);
58678
- }
58679
- this.word("export");
58680
- this.space();
58681
- ExportDeclaration.apply(this, arguments);
58682
- }
58683
- function ExportDefaultDeclaration(node) {
58684
- if (this.format.decoratorsBeforeExport && t6().isClassDeclaration(node.declaration)) {
58685
- this.printJoin(node.declaration.decorators, node);
58686
- }
58687
- this.word("export");
58688
- this.space();
58689
- this.word("default");
58690
- this.space();
58691
- ExportDeclaration.apply(this, arguments);
58692
- }
58693
- function ExportDeclaration(node) {
58694
- if (node.declaration) {
58695
- const declar = node.declaration;
58696
- this.print(declar, node);
58697
- if (!t6().isStatement(declar)) this.semicolon();
58698
- } else {
58699
- if (node.exportKind === "type") {
58700
- this.word("type");
58701
- this.space();
58702
- }
58703
- const specifiers = node.specifiers.slice(0);
58704
- let hasSpecial = false;
58705
- while (true) {
58706
- const first = specifiers[0];
58707
- if (t6().isExportDefaultSpecifier(first) || t6().isExportNamespaceSpecifier(first)) {
58708
- hasSpecial = true;
58709
- this.print(specifiers.shift(), node);
58710
- if (specifiers.length) {
58711
- this.token(",");
58712
- this.space();
58713
- }
58714
- } else {
58715
- break;
58716
- }
58717
- }
58718
- if (specifiers.length || !specifiers.length && !hasSpecial) {
58719
- this.token("{");
58720
- if (specifiers.length) {
58721
- this.space();
58722
- this.printList(specifiers, node);
58723
- this.space();
58724
- }
58725
- this.token("}");
58726
- }
58727
- if (node.source) {
58728
- this.space();
58729
- this.word("from");
58730
- this.space();
58731
- this.print(node.source, node);
58732
- }
58733
- this.semicolon();
58734
- }
58735
- }
58736
- function ImportDeclaration(node) {
58737
- this.word("import");
58738
- this.space();
58739
- if (node.importKind === "type" || node.importKind === "typeof") {
58740
- this.word(node.importKind);
58741
- this.space();
58742
- }
58743
- const specifiers = node.specifiers.slice(0);
58744
- if (specifiers && specifiers.length) {
58745
- while (true) {
58746
- const first = specifiers[0];
58747
- if (t6().isImportDefaultSpecifier(first) || t6().isImportNamespaceSpecifier(first)) {
58748
- this.print(specifiers.shift(), node);
58749
- if (specifiers.length) {
58750
- this.token(",");
58751
- this.space();
58752
- }
58753
- } else {
58754
- break;
58755
- }
58756
- }
58757
- if (specifiers.length) {
58758
- this.token("{");
58759
- this.space();
58760
- this.printList(specifiers, node);
58761
- this.space();
58762
- this.token("}");
58763
- }
58764
- this.space();
58765
- this.word("from");
58766
- this.space();
58767
- }
58768
- this.print(node.source, node);
58769
- this.semicolon();
58770
- }
58771
- function ImportNamespaceSpecifier(node) {
58772
- this.token("*");
58773
- this.space();
58774
- this.word("as");
58775
- this.space();
58776
- this.print(node.local, node);
58777
- }
58778
- }
58779
- });
58780
-
58781
- // node_modules/jsesc/jsesc.js
58782
- var require_jsesc3 = __commonJS({
58783
- "node_modules/jsesc/jsesc.js"(exports2, module2) {
58784
- "use strict";
58785
- var object = {};
58786
- var hasOwnProperty3 = object.hasOwnProperty;
58787
- var forOwn = (object2, callback) => {
58788
- for (const key2 in object2) {
58789
- if (hasOwnProperty3.call(object2, key2)) {
58790
- callback(key2, object2[key2]);
58791
- }
58792
- }
58793
- };
58794
- var extend = (destination, source2) => {
58795
- if (!source2) {
58796
- return destination;
58797
- }
58798
- forOwn(source2, (key2, value) => {
58799
- destination[key2] = value;
58800
- });
58801
- return destination;
58802
- };
58803
- var forEach = (array, callback) => {
58804
- const length = array.length;
58805
- let index = -1;
58806
- while (++index < length) {
58807
- callback(array[index]);
58808
- }
58809
- };
58810
- var toString = object.toString;
58811
- var isArray = Array.isArray;
58812
- var isBuffer = Buffer.isBuffer;
58813
- var isObject = (value) => {
58814
- return toString.call(value) == "[object Object]";
58815
- };
58816
- var isString = (value) => {
58817
- return typeof value == "string" || toString.call(value) == "[object String]";
58818
- };
58819
- var isNumber = (value) => {
58820
- return typeof value == "number" || toString.call(value) == "[object Number]";
58821
- };
58822
- var isFunction = (value) => {
58823
- return typeof value == "function";
58824
- };
58825
- var isMap = (value) => {
58826
- return toString.call(value) == "[object Map]";
58827
- };
58828
- var isSet = (value) => {
58829
- return toString.call(value) == "[object Set]";
58830
- };
58831
- var singleEscapes = {
58832
- '"': '\\"',
58833
- "'": "\\'",
58834
- "\\": "\\\\",
58835
- "\b": "\\b",
58836
- "\f": "\\f",
58837
- "\n": "\\n",
58838
- "\r": "\\r",
58839
- " ": "\\t"
58840
- // `\v` is omitted intentionally, because in IE < 9, '\v' == 'v'.
58841
- // '\v': '\\x0B'
58842
- };
58843
- var regexSingleEscape = /["'\\\b\f\n\r\t]/;
58844
- var regexDigit = /[0-9]/;
58845
- var regexWhitelist = /[ !#-&\(-\[\]-_a-~]/;
58846
- var jsesc = (argument, options) => {
58847
- const increaseIndentation = () => {
58848
- oldIndent = indent;
58849
- ++options.indentLevel;
58850
- indent = options.indent.repeat(options.indentLevel);
58851
- };
58852
- const defaults = {
58853
- "escapeEverything": false,
58854
- "minimal": false,
58855
- "isScriptContext": false,
58856
- "quotes": "single",
58857
- "wrap": false,
58858
- "es6": false,
58859
- "json": false,
58860
- "compact": true,
58861
- "lowercaseHex": false,
58862
- "numbers": "decimal",
58863
- "indent": " ",
58864
- "indentLevel": 0,
58865
- "__inline1__": false,
58866
- "__inline2__": false
58867
- };
58868
- const json = options && options.json;
58869
- if (json) {
58870
- defaults.quotes = "double";
58871
- defaults.wrap = true;
58872
- }
58873
- options = extend(defaults, options);
58874
- if (options.quotes != "single" && options.quotes != "double" && options.quotes != "backtick") {
58875
- options.quotes = "single";
58876
- }
58877
- const quote = options.quotes == "double" ? '"' : options.quotes == "backtick" ? "`" : "'";
58878
- const compact = options.compact;
58879
- const lowercaseHex = options.lowercaseHex;
58880
- let indent = options.indent.repeat(options.indentLevel);
58881
- let oldIndent = "";
58882
- const inline1 = options.__inline1__;
58883
- const inline2 = options.__inline2__;
58884
- const newLine = compact ? "" : "\n";
58885
- let result;
58886
- let isEmpty = true;
58887
- const useBinNumbers = options.numbers == "binary";
58888
- const useOctNumbers = options.numbers == "octal";
58889
- const useDecNumbers = options.numbers == "decimal";
58890
- const useHexNumbers = options.numbers == "hexadecimal";
58891
- if (json && argument && isFunction(argument.toJSON)) {
58892
- argument = argument.toJSON();
58893
- }
58894
- if (!isString(argument)) {
58895
- if (isMap(argument)) {
58896
- if (argument.size == 0) {
58897
- return "new Map()";
58898
- }
58899
- if (!compact) {
58900
- options.__inline1__ = true;
58901
- options.__inline2__ = false;
58902
- }
58903
- return "new Map(" + jsesc(Array.from(argument), options) + ")";
58904
- }
58905
- if (isSet(argument)) {
58906
- if (argument.size == 0) {
58907
- return "new Set()";
58908
- }
58909
- return "new Set(" + jsesc(Array.from(argument), options) + ")";
58910
- }
58911
- if (isBuffer(argument)) {
58912
- if (argument.length == 0) {
58913
- return "Buffer.from([])";
58914
- }
58915
- return "Buffer.from(" + jsesc(Array.from(argument), options) + ")";
58916
- }
58917
- if (isArray(argument)) {
58918
- result = [];
58919
- options.wrap = true;
58920
- if (inline1) {
58921
- options.__inline1__ = false;
58922
- options.__inline2__ = true;
58923
- }
58924
- if (!inline2) {
58925
- increaseIndentation();
58926
- }
58927
- forEach(argument, (value) => {
58928
- isEmpty = false;
58929
- if (inline2) {
58930
- options.__inline2__ = false;
58931
- }
58932
- result.push(
58933
- (compact || inline2 ? "" : indent) + jsesc(value, options)
58934
- );
58935
- });
58936
- if (isEmpty) {
58937
- return "[]";
58938
- }
58939
- if (inline2) {
58940
- return "[" + result.join(", ") + "]";
58941
- }
58942
- return "[" + newLine + result.join("," + newLine) + newLine + (compact ? "" : oldIndent) + "]";
58943
- } else if (isNumber(argument)) {
58944
- if (json) {
58945
- return JSON.stringify(argument);
58946
- }
58947
- if (useDecNumbers) {
58948
- return String(argument);
58949
- }
58950
- if (useHexNumbers) {
58951
- let hexadecimal = argument.toString(16);
58952
- if (!lowercaseHex) {
58953
- hexadecimal = hexadecimal.toUpperCase();
58954
- }
58955
- return "0x" + hexadecimal;
58956
- }
58957
- if (useBinNumbers) {
58958
- return "0b" + argument.toString(2);
58959
- }
58960
- if (useOctNumbers) {
58961
- return "0o" + argument.toString(8);
58962
- }
58963
- } else if (!isObject(argument)) {
58964
- if (json) {
58965
- return JSON.stringify(argument) || "null";
58966
- }
58967
- return String(argument);
58968
- } else {
58969
- result = [];
58970
- options.wrap = true;
58971
- increaseIndentation();
58972
- forOwn(argument, (key2, value) => {
58973
- isEmpty = false;
58974
- result.push(
58975
- (compact ? "" : indent) + jsesc(key2, options) + ":" + (compact ? "" : " ") + jsesc(value, options)
58976
- );
58977
- });
58978
- if (isEmpty) {
58979
- return "{}";
58980
- }
58981
- return "{" + newLine + result.join("," + newLine) + newLine + (compact ? "" : oldIndent) + "}";
58982
- }
58983
- }
58984
- const string = argument;
58985
- let index = -1;
58986
- const length = string.length;
58987
- result = "";
58988
- while (++index < length) {
58989
- const character = string.charAt(index);
58990
- if (options.es6) {
58991
- const first = string.charCodeAt(index);
58992
- if (
58993
- // check if it’s the start of a surrogate pair
58994
- first >= 55296 && first <= 56319 && // high surrogate
58995
- length > index + 1
58996
- ) {
58997
- const second = string.charCodeAt(index + 1);
58998
- if (second >= 56320 && second <= 57343) {
58999
- const codePoint = (first - 55296) * 1024 + second - 56320 + 65536;
59000
- let hexadecimal2 = codePoint.toString(16);
59001
- if (!lowercaseHex) {
59002
- hexadecimal2 = hexadecimal2.toUpperCase();
59003
- }
59004
- result += "\\u{" + hexadecimal2 + "}";
59005
- ++index;
59006
- continue;
59007
- }
59008
- }
59009
- }
59010
- if (!options.escapeEverything) {
59011
- if (regexWhitelist.test(character)) {
59012
- result += character;
59013
- continue;
59014
- }
59015
- if (character == '"') {
59016
- result += quote == character ? '\\"' : character;
59017
- continue;
59018
- }
59019
- if (character == "`") {
59020
- result += quote == character ? "\\`" : character;
59021
- continue;
59022
- }
59023
- if (character == "'") {
59024
- result += quote == character ? "\\'" : character;
59025
- continue;
59026
- }
59027
- }
59028
- if (character == "\0" && !json && !regexDigit.test(string.charAt(index + 1))) {
59029
- result += "\\0";
59030
- continue;
59031
- }
59032
- if (regexSingleEscape.test(character)) {
59033
- result += singleEscapes[character];
59034
- continue;
59035
- }
59036
- const charCode = character.charCodeAt(0);
59037
- if (options.minimal && charCode != 8232 && charCode != 8233) {
59038
- result += character;
59039
- continue;
59040
- }
59041
- let hexadecimal = charCode.toString(16);
59042
- if (!lowercaseHex) {
59043
- hexadecimal = hexadecimal.toUpperCase();
59044
- }
59045
- const longhand = hexadecimal.length > 2 || json;
59046
- const escaped = "\\" + (longhand ? "u" : "x") + ("0000" + hexadecimal).slice(longhand ? -4 : -2);
59047
- result += escaped;
59048
- continue;
59049
- }
59050
- if (options.wrap) {
59051
- result = quote + result + quote;
59052
- }
59053
- if (quote == "`") {
59054
- result = result.replace(/\$\{/g, "\\${");
59055
- }
59056
- if (options.isScriptContext) {
59057
- return result.replace(/<\/(script|style)/gi, "<\\/$1").replace(/<!--/g, json ? "\\u003C!--" : "\\x3C!--");
59058
- }
59059
- return result;
59060
- };
59061
- jsesc.version = "2.5.2";
59062
- module2.exports = jsesc;
59063
- }
59064
- });
59065
-
59066
- // node_modules/@babel/generator/lib/generators/types.js
59067
- var require_types3 = __commonJS({
59068
- "node_modules/@babel/generator/lib/generators/types.js"(exports2) {
59069
- "use strict";
59070
- Object.defineProperty(exports2, "__esModule", {
59071
- value: true
59072
- });
59073
- exports2.Identifier = Identifier30;
59074
- exports2.SpreadElement = exports2.RestElement = RestElement;
59075
- exports2.ObjectPattern = exports2.ObjectExpression = ObjectExpression;
59076
- exports2.ObjectMethod = ObjectMethod4;
59077
- exports2.ObjectProperty = ObjectProperty4;
59078
- exports2.ArrayPattern = exports2.ArrayExpression = ArrayExpression5;
59079
- exports2.RegExpLiteral = RegExpLiteral;
59080
- exports2.BooleanLiteral = BooleanLiteral;
59081
- exports2.NullLiteral = NullLiteral;
59082
- exports2.NumericLiteral = NumericLiteral;
59083
- exports2.StringLiteral = StringLiteral;
59084
- exports2.BigIntLiteral = BigIntLiteral;
59085
- function t6() {
59086
- const data = _interopRequireWildcard(require("@babel/types"));
59087
- t6 = function() {
59088
- return data;
59089
- };
59090
- return data;
59091
- }
59092
- function _jsesc() {
59093
- const data = _interopRequireDefault(require_jsesc3());
59094
- _jsesc = function() {
59095
- return data;
59096
- };
59097
- return data;
59098
- }
59099
- function _interopRequireDefault(obj) {
59100
- return obj && obj.__esModule ? obj : { default: obj };
59101
- }
59102
- function _interopRequireWildcard(obj) {
59103
- if (obj && obj.__esModule) {
59104
- return obj;
59105
- } else {
59106
- var newObj = {};
59107
- if (obj != null) {
59108
- for (var key2 in obj) {
59109
- if (Object.prototype.hasOwnProperty.call(obj, key2)) {
59110
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : {};
59111
- if (desc.get || desc.set) {
59112
- Object.defineProperty(newObj, key2, desc);
59113
- } else {
59114
- newObj[key2] = obj[key2];
59115
- }
59116
- }
59117
- }
59118
- }
59119
- newObj.default = obj;
59120
- return newObj;
59121
- }
59122
- }
59123
- function Identifier30(node) {
59124
- this.exactSource(node.loc, () => {
59125
- this.word(node.name);
59126
- });
59127
- }
59128
- function RestElement(node) {
59129
- this.token("...");
59130
- this.print(node.argument, node);
59131
- }
59132
- function ObjectExpression(node) {
59133
- const props = node.properties;
59134
- this.token("{");
59135
- this.printInnerComments(node);
59136
- if (props.length) {
59137
- this.space();
59138
- this.printList(props, node, {
59139
- indent: true,
59140
- statement: true
59141
- });
59142
- this.space();
59143
- }
59144
- this.token("}");
59145
- }
59146
- function ObjectMethod4(node) {
59147
- this.printJoin(node.decorators, node);
59148
- this._methodHead(node);
59149
- this.space();
59150
- this.print(node.body, node);
59151
- }
59152
- function ObjectProperty4(node) {
59153
- this.printJoin(node.decorators, node);
59154
- if (node.computed) {
59155
- this.token("[");
59156
- this.print(node.key, node);
59157
- this.token("]");
59158
- } else {
59159
- if (t6().isAssignmentPattern(node.value) && t6().isIdentifier(node.key) && node.key.name === node.value.left.name) {
59160
- this.print(node.value, node);
59161
- return;
59162
- }
59163
- this.print(node.key, node);
59164
- if (node.shorthand && t6().isIdentifier(node.key) && t6().isIdentifier(node.value) && node.key.name === node.value.name) {
59165
- return;
59166
- }
59167
- }
59168
- this.token(":");
59169
- this.space();
59170
- this.print(node.value, node);
59171
- }
59172
- function ArrayExpression5(node) {
59173
- const elems = node.elements;
59174
- const len = elems.length;
59175
- this.token("[");
59176
- this.printInnerComments(node);
59177
- for (let i = 0; i < elems.length; i++) {
59178
- const elem = elems[i];
59179
- if (elem) {
59180
- if (i > 0) this.space();
59181
- this.print(elem, node);
59182
- if (i < len - 1) this.token(",");
59183
- } else {
59184
- this.token(",");
59185
- }
59186
- }
59187
- this.token("]");
59188
- }
59189
- function RegExpLiteral(node) {
59190
- this.word(`/${node.pattern}/${node.flags}`);
59191
- }
59192
- function BooleanLiteral(node) {
59193
- this.word(node.value ? "true" : "false");
59194
- }
59195
- function NullLiteral() {
59196
- this.word("null");
59197
- }
59198
- function NumericLiteral(node) {
59199
- const raw = this.getPossibleRaw(node);
59200
- const value = node.value + "";
59201
- if (raw == null) {
59202
- this.number(value);
59203
- } else if (this.format.minified) {
59204
- this.number(raw.length < value.length ? raw : value);
59205
- } else {
59206
- this.number(raw);
59207
- }
59208
- }
59209
- function StringLiteral(node) {
59210
- const raw = this.getPossibleRaw(node);
59211
- if (!this.format.minified && raw != null) {
59212
- this.token(raw);
59213
- return;
59214
- }
59215
- const opts = this.format.jsescOption;
59216
- if (this.format.jsonCompatibleStrings) {
59217
- opts.json = true;
59218
- }
59219
- const val = (0, _jsesc().default)(node.value, opts);
59220
- return this.token(val);
59221
- }
59222
- function BigIntLiteral(node) {
59223
- const raw = this.getPossibleRaw(node);
59224
- if (!this.format.minified && raw != null) {
59225
- this.token(raw);
59226
- return;
59227
- }
59228
- this.token(node.value);
59229
- }
59230
- }
59231
- });
59232
-
59233
- // node_modules/@babel/generator/lib/generators/flow.js
59234
- var require_flow3 = __commonJS({
59235
- "node_modules/@babel/generator/lib/generators/flow.js"(exports2) {
59236
- "use strict";
59237
- Object.defineProperty(exports2, "__esModule", {
59238
- value: true
59239
- });
59240
- exports2.AnyTypeAnnotation = AnyTypeAnnotation;
59241
- exports2.ArrayTypeAnnotation = ArrayTypeAnnotation;
59242
- exports2.BooleanTypeAnnotation = BooleanTypeAnnotation;
59243
- exports2.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
59244
- exports2.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
59245
- exports2.DeclareClass = DeclareClass;
59246
- exports2.DeclareFunction = DeclareFunction;
59247
- exports2.InferredPredicate = InferredPredicate;
59248
- exports2.DeclaredPredicate = DeclaredPredicate;
59249
- exports2.DeclareInterface = DeclareInterface;
59250
- exports2.DeclareModule = DeclareModule;
59251
- exports2.DeclareModuleExports = DeclareModuleExports;
59252
- exports2.DeclareTypeAlias = DeclareTypeAlias;
59253
- exports2.DeclareOpaqueType = DeclareOpaqueType;
59254
- exports2.DeclareVariable = DeclareVariable;
59255
- exports2.DeclareExportDeclaration = DeclareExportDeclaration;
59256
- exports2.DeclareExportAllDeclaration = DeclareExportAllDeclaration;
59257
- exports2.ExistsTypeAnnotation = ExistsTypeAnnotation;
59258
- exports2.FunctionTypeAnnotation = FunctionTypeAnnotation;
59259
- exports2.FunctionTypeParam = FunctionTypeParam;
59260
- exports2.GenericTypeAnnotation = exports2.ClassImplements = exports2.InterfaceExtends = InterfaceExtends;
59261
- exports2._interfaceish = _interfaceish;
59262
- exports2._variance = _variance;
59263
- exports2.InterfaceDeclaration = InterfaceDeclaration;
59264
- exports2.InterfaceTypeAnnotation = InterfaceTypeAnnotation;
59265
- exports2.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
59266
- exports2.MixedTypeAnnotation = MixedTypeAnnotation;
59267
- exports2.EmptyTypeAnnotation = EmptyTypeAnnotation;
59268
- exports2.NullableTypeAnnotation = NullableTypeAnnotation;
59269
- exports2.NumberTypeAnnotation = NumberTypeAnnotation;
59270
- exports2.StringTypeAnnotation = StringTypeAnnotation;
59271
- exports2.ThisTypeAnnotation = ThisTypeAnnotation;
59272
- exports2.TupleTypeAnnotation = TupleTypeAnnotation;
59273
- exports2.TypeofTypeAnnotation = TypeofTypeAnnotation;
59274
- exports2.TypeAlias = TypeAlias;
59275
- exports2.TypeAnnotation = TypeAnnotation;
59276
- exports2.TypeParameterDeclaration = exports2.TypeParameterInstantiation = TypeParameterInstantiation;
59277
- exports2.TypeParameter = TypeParameter;
59278
- exports2.OpaqueType = OpaqueType;
59279
- exports2.ObjectTypeAnnotation = ObjectTypeAnnotation;
59280
- exports2.ObjectTypeInternalSlot = ObjectTypeInternalSlot;
59281
- exports2.ObjectTypeCallProperty = ObjectTypeCallProperty;
59282
- exports2.ObjectTypeIndexer = ObjectTypeIndexer;
59283
- exports2.ObjectTypeProperty = ObjectTypeProperty;
59284
- exports2.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;
59285
- exports2.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
59286
- exports2.UnionTypeAnnotation = UnionTypeAnnotation;
59287
- exports2.TypeCastExpression = TypeCastExpression;
59288
- exports2.Variance = Variance;
59289
- exports2.VoidTypeAnnotation = VoidTypeAnnotation;
59290
- Object.defineProperty(exports2, "NumberLiteralTypeAnnotation", {
59291
- enumerable: true,
59292
- get: function() {
59293
- return _types2.NumericLiteral;
59294
- }
59295
- });
59296
- Object.defineProperty(exports2, "StringLiteralTypeAnnotation", {
59297
- enumerable: true,
59298
- get: function() {
59299
- return _types2.StringLiteral;
59300
- }
59301
- });
59302
- function t6() {
59303
- const data = _interopRequireWildcard(require("@babel/types"));
59304
- t6 = function() {
59305
- return data;
59306
- };
59307
- return data;
59308
- }
59309
- var _modules = require_modules3();
59310
- var _types2 = require_types3();
59311
- function _interopRequireWildcard(obj) {
59312
- if (obj && obj.__esModule) {
59313
- return obj;
59314
- } else {
59315
- var newObj = {};
59316
- if (obj != null) {
59317
- for (var key2 in obj) {
59318
- if (Object.prototype.hasOwnProperty.call(obj, key2)) {
59319
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : {};
59320
- if (desc.get || desc.set) {
59321
- Object.defineProperty(newObj, key2, desc);
59322
- } else {
59323
- newObj[key2] = obj[key2];
59324
- }
59325
- }
59326
- }
59327
- }
59328
- newObj.default = obj;
59329
- return newObj;
59330
- }
59331
- }
59332
- function AnyTypeAnnotation() {
59333
- this.word("any");
59334
- }
59335
- function ArrayTypeAnnotation(node) {
59336
- this.print(node.elementType, node);
59337
- this.token("[");
59338
- this.token("]");
59339
- }
59340
- function BooleanTypeAnnotation() {
59341
- this.word("boolean");
59342
- }
59343
- function BooleanLiteralTypeAnnotation(node) {
59344
- this.word(node.value ? "true" : "false");
59345
- }
59346
- function NullLiteralTypeAnnotation() {
59347
- this.word("null");
59348
- }
59349
- function DeclareClass(node, parent) {
59350
- if (!t6().isDeclareExportDeclaration(parent)) {
59351
- this.word("declare");
59352
- this.space();
59353
- }
59354
- this.word("class");
59355
- this.space();
59356
- this._interfaceish(node);
59357
- }
59358
- function DeclareFunction(node, parent) {
59359
- if (!t6().isDeclareExportDeclaration(parent)) {
59360
- this.word("declare");
59361
- this.space();
59362
- }
59363
- this.word("function");
59364
- this.space();
59365
- this.print(node.id, node);
59366
- this.print(node.id.typeAnnotation.typeAnnotation, node);
59367
- if (node.predicate) {
59368
- this.space();
59369
- this.print(node.predicate, node);
59370
- }
59371
- this.semicolon();
59372
- }
59373
- function InferredPredicate() {
59374
- this.token("%");
59375
- this.word("checks");
59376
- }
59377
- function DeclaredPredicate(node) {
59378
- this.token("%");
59379
- this.word("checks");
59380
- this.token("(");
59381
- this.print(node.value, node);
59382
- this.token(")");
59383
- }
59384
- function DeclareInterface(node) {
59385
- this.word("declare");
59386
- this.space();
59387
- this.InterfaceDeclaration(node);
59388
- }
59389
- function DeclareModule(node) {
59390
- this.word("declare");
59391
- this.space();
59392
- this.word("module");
59393
- this.space();
59394
- this.print(node.id, node);
59395
- this.space();
59396
- this.print(node.body, node);
59397
- }
59398
- function DeclareModuleExports(node) {
59399
- this.word("declare");
59400
- this.space();
59401
- this.word("module");
59402
- this.token(".");
59403
- this.word("exports");
59404
- this.print(node.typeAnnotation, node);
59405
- }
59406
- function DeclareTypeAlias(node) {
59407
- this.word("declare");
59408
- this.space();
59409
- this.TypeAlias(node);
59410
- }
59411
- function DeclareOpaqueType(node, parent) {
59412
- if (!t6().isDeclareExportDeclaration(parent)) {
59413
- this.word("declare");
59414
- this.space();
59415
- }
59416
- this.OpaqueType(node);
59417
- }
59418
- function DeclareVariable(node, parent) {
59419
- if (!t6().isDeclareExportDeclaration(parent)) {
59420
- this.word("declare");
59421
- this.space();
59422
- }
59423
- this.word("var");
59424
- this.space();
59425
- this.print(node.id, node);
59426
- this.print(node.id.typeAnnotation, node);
59427
- this.semicolon();
59428
- }
59429
- function DeclareExportDeclaration(node) {
59430
- this.word("declare");
59431
- this.space();
59432
- this.word("export");
59433
- this.space();
59434
- if (node.default) {
59435
- this.word("default");
59436
- this.space();
59437
- }
59438
- FlowExportDeclaration.apply(this, arguments);
59439
- }
59440
- function DeclareExportAllDeclaration() {
59441
- this.word("declare");
59442
- this.space();
59443
- _modules.ExportAllDeclaration.apply(this, arguments);
59444
- }
59445
- function FlowExportDeclaration(node) {
59446
- if (node.declaration) {
59447
- const declar = node.declaration;
59448
- this.print(declar, node);
59449
- if (!t6().isStatement(declar)) this.semicolon();
59450
- } else {
59451
- this.token("{");
59452
- if (node.specifiers.length) {
59453
- this.space();
59454
- this.printList(node.specifiers, node);
59455
- this.space();
59456
- }
59457
- this.token("}");
59458
- if (node.source) {
59459
- this.space();
59460
- this.word("from");
59461
- this.space();
59462
- this.print(node.source, node);
59463
- }
59464
- this.semicolon();
59465
- }
59466
- }
59467
- function ExistsTypeAnnotation() {
59468
- this.token("*");
59469
- }
59470
- function FunctionTypeAnnotation(node, parent) {
59471
- this.print(node.typeParameters, node);
59472
- this.token("(");
59473
- this.printList(node.params, node);
59474
- if (node.rest) {
59475
- if (node.params.length) {
59476
- this.token(",");
59477
- this.space();
59478
- }
59479
- this.token("...");
59480
- this.print(node.rest, node);
59481
- }
59482
- this.token(")");
59483
- if (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction" || parent.type === "ObjectTypeProperty" && parent.method) {
59484
- this.token(":");
59485
- } else {
59486
- this.space();
59487
- this.token("=>");
59488
- }
59489
- this.space();
59490
- this.print(node.returnType, node);
59491
- }
59492
- function FunctionTypeParam(node) {
59493
- this.print(node.name, node);
59494
- if (node.optional) this.token("?");
59495
- if (node.name) {
59496
- this.token(":");
59497
- this.space();
59498
- }
59499
- this.print(node.typeAnnotation, node);
59500
- }
59501
- function InterfaceExtends(node) {
59502
- this.print(node.id, node);
59503
- this.print(node.typeParameters, node);
59504
- }
59505
- function _interfaceish(node) {
59506
- this.print(node.id, node);
59507
- this.print(node.typeParameters, node);
59508
- if (node.extends.length) {
59509
- this.space();
59510
- this.word("extends");
59511
- this.space();
59512
- this.printList(node.extends, node);
59513
- }
59514
- if (node.mixins && node.mixins.length) {
59515
- this.space();
59516
- this.word("mixins");
59517
- this.space();
59518
- this.printList(node.mixins, node);
59519
- }
59520
- if (node.implements && node.implements.length) {
59521
- this.space();
59522
- this.word("implements");
59523
- this.space();
59524
- this.printList(node.implements, node);
59525
- }
59526
- this.space();
59527
- this.print(node.body, node);
59528
- }
59529
- function _variance(node) {
59530
- if (node.variance) {
59531
- if (node.variance.kind === "plus") {
59532
- this.token("+");
59533
- } else if (node.variance.kind === "minus") {
59534
- this.token("-");
59535
- }
59536
- }
59537
- }
59538
- function InterfaceDeclaration(node) {
59539
- this.word("interface");
59540
- this.space();
59541
- this._interfaceish(node);
59542
- }
59543
- function andSeparator() {
59544
- this.space();
59545
- this.token("&");
59546
- this.space();
59547
- }
59548
- function InterfaceTypeAnnotation(node) {
59549
- this.word("interface");
59550
- if (node.extends && node.extends.length) {
59551
- this.space();
59552
- this.word("extends");
59553
- this.space();
59554
- this.printList(node.extends, node);
59555
- }
59556
- this.space();
59557
- this.print(node.body, node);
59558
- }
59559
- function IntersectionTypeAnnotation(node) {
59560
- this.printJoin(node.types, node, {
59561
- separator: andSeparator
59562
- });
59563
- }
59564
- function MixedTypeAnnotation() {
59565
- this.word("mixed");
59566
- }
59567
- function EmptyTypeAnnotation() {
59568
- this.word("empty");
59569
- }
59570
- function NullableTypeAnnotation(node) {
59571
- this.token("?");
59572
- this.print(node.typeAnnotation, node);
59573
- }
59574
- function NumberTypeAnnotation() {
59575
- this.word("number");
59576
- }
59577
- function StringTypeAnnotation() {
59578
- this.word("string");
59579
- }
59580
- function ThisTypeAnnotation() {
59581
- this.word("this");
59582
- }
59583
- function TupleTypeAnnotation(node) {
59584
- this.token("[");
59585
- this.printList(node.types, node);
59586
- this.token("]");
59587
- }
59588
- function TypeofTypeAnnotation(node) {
59589
- this.word("typeof");
59590
- this.space();
59591
- this.print(node.argument, node);
59592
- }
59593
- function TypeAlias(node) {
59594
- this.word("type");
59595
- this.space();
59596
- this.print(node.id, node);
59597
- this.print(node.typeParameters, node);
59598
- this.space();
59599
- this.token("=");
59600
- this.space();
59601
- this.print(node.right, node);
59602
- this.semicolon();
59603
- }
59604
- function TypeAnnotation(node) {
59605
- this.token(":");
59606
- this.space();
59607
- if (node.optional) this.token("?");
59608
- this.print(node.typeAnnotation, node);
59609
- }
59610
- function TypeParameterInstantiation(node) {
59611
- this.token("<");
59612
- this.printList(node.params, node, {});
59613
- this.token(">");
59614
- }
59615
- function TypeParameter(node) {
59616
- this._variance(node);
59617
- this.word(node.name);
59618
- if (node.bound) {
59619
- this.print(node.bound, node);
59620
- }
59621
- if (node.default) {
59622
- this.space();
59623
- this.token("=");
59624
- this.space();
59625
- this.print(node.default, node);
59626
- }
59627
- }
59628
- function OpaqueType(node) {
59629
- this.word("opaque");
59630
- this.space();
59631
- this.word("type");
59632
- this.space();
59633
- this.print(node.id, node);
59634
- this.print(node.typeParameters, node);
59635
- if (node.supertype) {
59636
- this.token(":");
59637
- this.space();
59638
- this.print(node.supertype, node);
59639
- }
59640
- if (node.impltype) {
59641
- this.space();
59642
- this.token("=");
59643
- this.space();
59644
- this.print(node.impltype, node);
59645
- }
59646
- this.semicolon();
59647
- }
59648
- function ObjectTypeAnnotation(node) {
59649
- if (node.exact) {
59650
- this.token("{|");
59651
- } else {
59652
- this.token("{");
59653
- }
59654
- const props = node.properties.concat(node.callProperties || [], node.indexers || [], node.internalSlots || []);
59655
- if (props.length) {
59656
- this.space();
59657
- this.printJoin(props, node, {
59658
- addNewlines(leading) {
59659
- if (leading && !props[0]) return 1;
59660
- },
59661
- indent: true,
59662
- statement: true,
59663
- iterator: () => {
59664
- if (props.length !== 1) {
59665
- this.token(",");
59666
- this.space();
59667
- }
59668
- }
59669
- });
59670
- this.space();
59671
- }
59672
- if (node.exact) {
59673
- this.token("|}");
59674
- } else {
59675
- this.token("}");
59676
- }
59677
- }
59678
- function ObjectTypeInternalSlot(node) {
59679
- if (node.static) {
59680
- this.word("static");
59681
- this.space();
59682
- }
59683
- this.token("[");
59684
- this.token("[");
59685
- this.print(node.id, node);
59686
- this.token("]");
59687
- this.token("]");
59688
- if (node.optional) this.token("?");
59689
- if (!node.method) {
59690
- this.token(":");
59691
- this.space();
59692
- }
59693
- this.print(node.value, node);
59694
- }
59695
- function ObjectTypeCallProperty(node) {
59696
- if (node.static) {
59697
- this.word("static");
59698
- this.space();
59699
- }
59700
- this.print(node.value, node);
59701
- }
59702
- function ObjectTypeIndexer(node) {
59703
- if (node.static) {
59704
- this.word("static");
59705
- this.space();
59706
- }
59707
- this._variance(node);
59708
- this.token("[");
59709
- if (node.id) {
59710
- this.print(node.id, node);
59711
- this.token(":");
59712
- this.space();
59713
- }
59714
- this.print(node.key, node);
59715
- this.token("]");
59716
- this.token(":");
59717
- this.space();
59718
- this.print(node.value, node);
59719
- }
59720
- function ObjectTypeProperty(node) {
59721
- if (node.proto) {
59722
- this.word("proto");
59723
- this.space();
59724
- }
59725
- if (node.static) {
59726
- this.word("static");
59727
- this.space();
59728
- }
59729
- this._variance(node);
59730
- this.print(node.key, node);
59731
- if (node.optional) this.token("?");
59732
- if (!node.method) {
59733
- this.token(":");
59734
- this.space();
59735
- }
59736
- this.print(node.value, node);
59737
- }
59738
- function ObjectTypeSpreadProperty(node) {
59739
- this.token("...");
59740
- this.print(node.argument, node);
59741
- }
59742
- function QualifiedTypeIdentifier(node) {
59743
- this.print(node.qualification, node);
59744
- this.token(".");
59745
- this.print(node.id, node);
59746
- }
59747
- function orSeparator() {
59748
- this.space();
59749
- this.token("|");
59750
- this.space();
59751
- }
59752
- function UnionTypeAnnotation(node) {
59753
- this.printJoin(node.types, node, {
59754
- separator: orSeparator
59755
- });
59756
- }
59757
- function TypeCastExpression(node) {
59758
- this.token("(");
59759
- this.print(node.expression, node);
59760
- this.print(node.typeAnnotation, node);
59761
- this.token(")");
59762
- }
59763
- function Variance(node) {
59764
- if (node.kind === "plus") {
59765
- this.token("+");
59766
- } else {
59767
- this.token("-");
59768
- }
59769
- }
59770
- function VoidTypeAnnotation() {
59771
- this.word("void");
59772
- }
59773
- }
59774
- });
59775
-
59776
- // node_modules/@babel/generator/lib/generators/base.js
59777
- var require_base3 = __commonJS({
59778
- "node_modules/@babel/generator/lib/generators/base.js"(exports2) {
59779
- "use strict";
59780
- Object.defineProperty(exports2, "__esModule", {
59781
- value: true
59782
- });
59783
- exports2.File = File;
59784
- exports2.Program = Program;
59785
- exports2.BlockStatement = BlockStatement;
59786
- exports2.Noop = Noop;
59787
- exports2.Directive = Directive;
59788
- exports2.InterpreterDirective = InterpreterDirective;
59789
- Object.defineProperty(exports2, "DirectiveLiteral", {
59790
- enumerable: true,
59791
- get: function() {
59792
- return _types.StringLiteral;
59793
- }
59794
- });
59795
- var _types = require_types3();
59796
- function File(node) {
59797
- if (node.program) {
59798
- this.print(node.program.interpreter, node);
59799
- }
59800
- this.print(node.program, node);
59801
- }
59802
- function Program(node) {
59803
- this.printInnerComments(node, false);
59804
- this.printSequence(node.directives, node);
59805
- if (node.directives && node.directives.length) this.newline();
59806
- this.printSequence(node.body, node);
59807
- }
59808
- function BlockStatement(node) {
59809
- this.token("{");
59810
- this.printInnerComments(node);
59811
- const hasDirectives = node.directives && node.directives.length;
59812
- if (node.body.length || hasDirectives) {
59813
- this.newline();
59814
- this.printSequence(node.directives, node, {
59815
- indent: true
59816
- });
59817
- if (hasDirectives) this.newline();
59818
- this.printSequence(node.body, node, {
59819
- indent: true
59820
- });
59821
- this.removeTrailingNewline();
59822
- this.source("end", node.loc);
59823
- if (!this.endsWith("\n")) this.newline();
59824
- this.rightBrace();
59825
- } else {
59826
- this.source("end", node.loc);
59827
- this.token("}");
59828
- }
59829
- }
59830
- function Noop() {
59831
- }
59832
- function Directive(node) {
59833
- this.print(node.value, node);
59834
- this.semicolon();
59835
- }
59836
- function InterpreterDirective(node) {
59837
- this.token(`#!${node.value}
59838
- `);
59839
- }
59840
- }
59841
- });
59842
-
59843
- // node_modules/@babel/generator/lib/generators/jsx.js
59844
- var require_jsx3 = __commonJS({
59845
- "node_modules/@babel/generator/lib/generators/jsx.js"(exports2) {
59846
- "use strict";
59847
- Object.defineProperty(exports2, "__esModule", {
59848
- value: true
59849
- });
59850
- exports2.JSXAttribute = JSXAttribute;
59851
- exports2.JSXIdentifier = JSXIdentifier;
59852
- exports2.JSXNamespacedName = JSXNamespacedName;
59853
- exports2.JSXMemberExpression = JSXMemberExpression;
59854
- exports2.JSXSpreadAttribute = JSXSpreadAttribute;
59855
- exports2.JSXExpressionContainer = JSXExpressionContainer;
59856
- exports2.JSXSpreadChild = JSXSpreadChild;
59857
- exports2.JSXText = JSXText;
59858
- exports2.JSXElement = JSXElement;
59859
- exports2.JSXOpeningElement = JSXOpeningElement;
59860
- exports2.JSXClosingElement = JSXClosingElement;
59861
- exports2.JSXEmptyExpression = JSXEmptyExpression;
59862
- exports2.JSXFragment = JSXFragment;
59863
- exports2.JSXOpeningFragment = JSXOpeningFragment;
59864
- exports2.JSXClosingFragment = JSXClosingFragment;
59865
- function JSXAttribute(node) {
59866
- this.print(node.name, node);
59867
- if (node.value) {
59868
- this.token("=");
59869
- this.print(node.value, node);
59870
- }
59871
- }
59872
- function JSXIdentifier(node) {
59873
- this.word(node.name);
59874
- }
59875
- function JSXNamespacedName(node) {
59876
- this.print(node.namespace, node);
59877
- this.token(":");
59878
- this.print(node.name, node);
59879
- }
59880
- function JSXMemberExpression(node) {
59881
- this.print(node.object, node);
59882
- this.token(".");
59883
- this.print(node.property, node);
59884
- }
59885
- function JSXSpreadAttribute(node) {
59886
- this.token("{");
59887
- this.token("...");
59888
- this.print(node.argument, node);
59889
- this.token("}");
59890
- }
59891
- function JSXExpressionContainer(node) {
59892
- this.token("{");
59893
- this.print(node.expression, node);
59894
- this.token("}");
59895
- }
59896
- function JSXSpreadChild(node) {
59897
- this.token("{");
59898
- this.token("...");
59899
- this.print(node.expression, node);
59900
- this.token("}");
59901
- }
59902
- function JSXText(node) {
59903
- const raw = this.getPossibleRaw(node);
59904
- if (raw != null) {
59905
- this.token(raw);
59906
- } else {
59907
- this.token(node.value);
59908
- }
59909
- }
59910
- function JSXElement(node) {
59911
- const open = node.openingElement;
59912
- this.print(open, node);
59913
- if (open.selfClosing) return;
59914
- this.indent();
59915
- for (const child of node.children) {
59916
- this.print(child, node);
59917
- }
59918
- this.dedent();
59919
- this.print(node.closingElement, node);
59920
- }
59921
- function spaceSeparator() {
59922
- this.space();
59923
- }
59924
- function JSXOpeningElement(node) {
59925
- this.token("<");
59926
- this.print(node.name, node);
59927
- this.print(node.typeParameters, node);
59928
- if (node.attributes.length > 0) {
59929
- this.space();
59930
- this.printJoin(node.attributes, node, {
59931
- separator: spaceSeparator
59932
- });
59933
- }
59934
- if (node.selfClosing) {
59935
- this.space();
59936
- this.token("/>");
59937
- } else {
59938
- this.token(">");
59939
- }
59940
- }
59941
- function JSXClosingElement(node) {
59942
- this.token("</");
59943
- this.print(node.name, node);
59944
- this.token(">");
59945
- }
59946
- function JSXEmptyExpression(node) {
59947
- this.printInnerComments(node);
59948
- }
59949
- function JSXFragment(node) {
59950
- this.print(node.openingFragment, node);
59951
- this.indent();
59952
- for (const child of node.children) {
59953
- this.print(child, node);
59954
- }
59955
- this.dedent();
59956
- this.print(node.closingFragment, node);
59957
- }
59958
- function JSXOpeningFragment() {
59959
- this.token("<");
59960
- this.token(">");
59961
- }
59962
- function JSXClosingFragment() {
59963
- this.token("</");
59964
- this.token(">");
59965
- }
59966
- }
59967
- });
59968
-
59969
- // node_modules/@babel/generator/lib/generators/typescript.js
59970
- var require_typescript3 = __commonJS({
59971
- "node_modules/@babel/generator/lib/generators/typescript.js"(exports2) {
59972
- "use strict";
59973
- Object.defineProperty(exports2, "__esModule", {
59974
- value: true
59975
- });
59976
- exports2.TSTypeAnnotation = TSTypeAnnotation;
59977
- exports2.TSTypeParameterDeclaration = exports2.TSTypeParameterInstantiation = TSTypeParameterInstantiation;
59978
- exports2.TSTypeParameter = TSTypeParameter;
59979
- exports2.TSParameterProperty = TSParameterProperty;
59980
- exports2.TSDeclareFunction = TSDeclareFunction;
59981
- exports2.TSDeclareMethod = TSDeclareMethod;
59982
- exports2.TSQualifiedName = TSQualifiedName;
59983
- exports2.TSCallSignatureDeclaration = TSCallSignatureDeclaration;
59984
- exports2.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration;
59985
- exports2.TSPropertySignature = TSPropertySignature;
59986
- exports2.tsPrintPropertyOrMethodName = tsPrintPropertyOrMethodName;
59987
- exports2.TSMethodSignature = TSMethodSignature;
59988
- exports2.TSIndexSignature = TSIndexSignature;
59989
- exports2.TSAnyKeyword = TSAnyKeyword;
59990
- exports2.TSUnknownKeyword = TSUnknownKeyword;
59991
- exports2.TSNumberKeyword = TSNumberKeyword;
59992
- exports2.TSObjectKeyword = TSObjectKeyword;
59993
- exports2.TSBooleanKeyword = TSBooleanKeyword;
59994
- exports2.TSStringKeyword = TSStringKeyword;
59995
- exports2.TSSymbolKeyword = TSSymbolKeyword;
59996
- exports2.TSVoidKeyword = TSVoidKeyword;
59997
- exports2.TSUndefinedKeyword = TSUndefinedKeyword;
59998
- exports2.TSNullKeyword = TSNullKeyword;
59999
- exports2.TSNeverKeyword = TSNeverKeyword;
60000
- exports2.TSThisType = TSThisType;
60001
- exports2.TSFunctionType = TSFunctionType;
60002
- exports2.TSConstructorType = TSConstructorType;
60003
- exports2.tsPrintFunctionOrConstructorType = tsPrintFunctionOrConstructorType;
60004
- exports2.TSTypeReference = TSTypeReference;
60005
- exports2.TSTypePredicate = TSTypePredicate;
60006
- exports2.TSTypeQuery = TSTypeQuery;
60007
- exports2.TSTypeLiteral = TSTypeLiteral;
60008
- exports2.tsPrintTypeLiteralOrInterfaceBody = tsPrintTypeLiteralOrInterfaceBody;
60009
- exports2.tsPrintBraced = tsPrintBraced;
60010
- exports2.TSArrayType = TSArrayType;
60011
- exports2.TSTupleType = TSTupleType;
60012
- exports2.TSOptionalType = TSOptionalType;
60013
- exports2.TSRestType = TSRestType;
60014
- exports2.TSUnionType = TSUnionType;
60015
- exports2.TSIntersectionType = TSIntersectionType;
60016
- exports2.tsPrintUnionOrIntersectionType = tsPrintUnionOrIntersectionType;
60017
- exports2.TSConditionalType = TSConditionalType;
60018
- exports2.TSInferType = TSInferType;
60019
- exports2.TSParenthesizedType = TSParenthesizedType;
60020
- exports2.TSTypeOperator = TSTypeOperator;
60021
- exports2.TSIndexedAccessType = TSIndexedAccessType;
60022
- exports2.TSMappedType = TSMappedType;
60023
- exports2.TSLiteralType = TSLiteralType;
60024
- exports2.TSExpressionWithTypeArguments = TSExpressionWithTypeArguments;
60025
- exports2.TSInterfaceDeclaration = TSInterfaceDeclaration;
60026
- exports2.TSInterfaceBody = TSInterfaceBody;
60027
- exports2.TSTypeAliasDeclaration = TSTypeAliasDeclaration;
60028
- exports2.TSAsExpression = TSAsExpression;
60029
- exports2.TSTypeAssertion = TSTypeAssertion;
60030
- exports2.TSEnumDeclaration = TSEnumDeclaration;
60031
- exports2.TSEnumMember = TSEnumMember;
60032
- exports2.TSModuleDeclaration = TSModuleDeclaration;
60033
- exports2.TSModuleBlock = TSModuleBlock;
60034
- exports2.TSImportEqualsDeclaration = TSImportEqualsDeclaration;
60035
- exports2.TSExternalModuleReference = TSExternalModuleReference;
60036
- exports2.TSNonNullExpression = TSNonNullExpression;
60037
- exports2.TSExportAssignment = TSExportAssignment;
60038
- exports2.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration;
60039
- exports2.tsPrintSignatureDeclarationBase = tsPrintSignatureDeclarationBase;
60040
- function TSTypeAnnotation(node) {
60041
- this.token(":");
60042
- this.space();
60043
- if (node.optional) this.token("?");
60044
- this.print(node.typeAnnotation, node);
60045
- }
60046
- function TSTypeParameterInstantiation(node) {
60047
- this.token("<");
60048
- this.printList(node.params, node, {});
60049
- this.token(">");
60050
- }
60051
- function TSTypeParameter(node) {
60052
- this.word(node.name);
60053
- if (node.constraint) {
60054
- this.space();
60055
- this.word("extends");
60056
- this.space();
60057
- this.print(node.constraint, node);
60058
- }
60059
- if (node.default) {
60060
- this.space();
60061
- this.token("=");
60062
- this.space();
60063
- this.print(node.default, node);
60064
- }
60065
- }
60066
- function TSParameterProperty(node) {
60067
- if (node.accessibility) {
60068
- this.word(node.accessibility);
60069
- this.space();
60070
- }
60071
- if (node.readonly) {
60072
- this.word("readonly");
60073
- this.space();
60074
- }
60075
- this._param(node.parameter);
60076
- }
60077
- function TSDeclareFunction(node) {
60078
- if (node.declare) {
60079
- this.word("declare");
60080
- this.space();
60081
- }
60082
- this._functionHead(node);
60083
- this.token(";");
60084
- }
60085
- function TSDeclareMethod(node) {
60086
- this._classMethodHead(node);
60087
- this.token(";");
60088
- }
60089
- function TSQualifiedName(node) {
60090
- this.print(node.left, node);
60091
- this.token(".");
60092
- this.print(node.right, node);
60093
- }
60094
- function TSCallSignatureDeclaration(node) {
60095
- this.tsPrintSignatureDeclarationBase(node);
60096
- }
60097
- function TSConstructSignatureDeclaration(node) {
60098
- this.word("new");
60099
- this.space();
60100
- this.tsPrintSignatureDeclarationBase(node);
60101
- }
60102
- function TSPropertySignature(node) {
60103
- const {
60104
- readonly,
60105
- initializer
60106
- } = node;
60107
- if (readonly) {
60108
- this.word("readonly");
60109
- this.space();
60110
- }
60111
- this.tsPrintPropertyOrMethodName(node);
60112
- this.print(node.typeAnnotation, node);
60113
- if (initializer) {
60114
- this.space();
60115
- this.token("=");
60116
- this.space();
60117
- this.print(initializer, node);
60118
- }
60119
- this.token(";");
60120
- }
60121
- function tsPrintPropertyOrMethodName(node) {
60122
- if (node.computed) {
60123
- this.token("[");
60124
- }
60125
- this.print(node.key, node);
60126
- if (node.computed) {
60127
- this.token("]");
60128
- }
60129
- if (node.optional) {
60130
- this.token("?");
60131
- }
60132
- }
60133
- function TSMethodSignature(node) {
60134
- this.tsPrintPropertyOrMethodName(node);
60135
- this.tsPrintSignatureDeclarationBase(node);
60136
- this.token(";");
60137
- }
60138
- function TSIndexSignature(node) {
60139
- const {
60140
- readonly
60141
- } = node;
60142
- if (readonly) {
60143
- this.word("readonly");
60144
- this.space();
60145
- }
60146
- this.token("[");
60147
- this._parameters(node.parameters, node);
60148
- this.token("]");
60149
- this.print(node.typeAnnotation, node);
60150
- this.token(";");
60151
- }
60152
- function TSAnyKeyword() {
60153
- this.word("any");
60154
- }
60155
- function TSUnknownKeyword() {
60156
- this.word("unknown");
60157
- }
60158
- function TSNumberKeyword() {
60159
- this.word("number");
60160
- }
60161
- function TSObjectKeyword() {
60162
- this.word("object");
60163
- }
60164
- function TSBooleanKeyword() {
60165
- this.word("boolean");
60166
- }
60167
- function TSStringKeyword() {
60168
- this.word("string");
60169
- }
60170
- function TSSymbolKeyword() {
60171
- this.word("symbol");
60172
- }
60173
- function TSVoidKeyword() {
60174
- this.word("void");
60175
- }
60176
- function TSUndefinedKeyword() {
60177
- this.word("undefined");
60178
- }
60179
- function TSNullKeyword() {
60180
- this.word("null");
60181
- }
60182
- function TSNeverKeyword() {
60183
- this.word("never");
60184
- }
60185
- function TSThisType() {
60186
- this.word("this");
60187
- }
60188
- function TSFunctionType(node) {
60189
- this.tsPrintFunctionOrConstructorType(node);
60190
- }
60191
- function TSConstructorType(node) {
60192
- this.word("new");
60193
- this.space();
60194
- this.tsPrintFunctionOrConstructorType(node);
60195
- }
60196
- function tsPrintFunctionOrConstructorType(node) {
60197
- const {
60198
- typeParameters,
60199
- parameters
60200
- } = node;
60201
- this.print(typeParameters, node);
60202
- this.token("(");
60203
- this._parameters(parameters, node);
60204
- this.token(")");
60205
- this.space();
60206
- this.token("=>");
60207
- this.space();
60208
- this.print(node.typeAnnotation.typeAnnotation, node);
60209
- }
60210
- function TSTypeReference(node) {
60211
- this.print(node.typeName, node);
60212
- this.print(node.typeParameters, node);
60213
- }
60214
- function TSTypePredicate(node) {
60215
- this.print(node.parameterName);
60216
- this.space();
60217
- this.word("is");
60218
- this.space();
60219
- this.print(node.typeAnnotation.typeAnnotation);
60220
- }
60221
- function TSTypeQuery(node) {
60222
- this.word("typeof");
60223
- this.space();
60224
- this.print(node.exprName);
60225
- }
60226
- function TSTypeLiteral(node) {
60227
- this.tsPrintTypeLiteralOrInterfaceBody(node.members, node);
60228
- }
60229
- function tsPrintTypeLiteralOrInterfaceBody(members, node) {
60230
- this.tsPrintBraced(members, node);
60231
- }
60232
- function tsPrintBraced(members, node) {
60233
- this.token("{");
60234
- if (members.length) {
60235
- this.indent();
60236
- this.newline();
60237
- for (const member of members) {
60238
- this.print(member, node);
60239
- this.newline();
60240
- }
60241
- this.dedent();
60242
- this.rightBrace();
60243
- } else {
60244
- this.token("}");
60245
- }
60246
- }
60247
- function TSArrayType(node) {
60248
- this.print(node.elementType);
60249
- this.token("[]");
60250
- }
60251
- function TSTupleType(node) {
60252
- this.token("[");
60253
- this.printList(node.elementTypes, node);
60254
- this.token("]");
60255
- }
60256
- function TSOptionalType(node) {
60257
- this.print(node.typeAnnotation, node);
60258
- this.token("?");
60259
- }
60260
- function TSRestType(node) {
60261
- this.token("...");
60262
- this.print(node.typeAnnotation, node);
60263
- }
60264
- function TSUnionType(node) {
60265
- this.tsPrintUnionOrIntersectionType(node, "|");
60266
- }
60267
- function TSIntersectionType(node) {
60268
- this.tsPrintUnionOrIntersectionType(node, "&");
60269
- }
60270
- function tsPrintUnionOrIntersectionType(node, sep) {
60271
- this.printJoin(node.types, node, {
60272
- separator() {
60273
- this.space();
60274
- this.token(sep);
60275
- this.space();
60276
- }
60277
- });
60278
- }
60279
- function TSConditionalType(node) {
60280
- this.print(node.checkType);
60281
- this.space();
60282
- this.word("extends");
60283
- this.space();
60284
- this.print(node.extendsType);
60285
- this.space();
60286
- this.token("?");
60287
- this.space();
60288
- this.print(node.trueType);
60289
- this.space();
60290
- this.token(":");
60291
- this.space();
60292
- this.print(node.falseType);
60293
- }
60294
- function TSInferType(node) {
60295
- this.token("infer");
60296
- this.space();
60297
- this.print(node.typeParameter);
60298
- }
60299
- function TSParenthesizedType(node) {
60300
- this.token("(");
60301
- this.print(node.typeAnnotation, node);
60302
- this.token(")");
60303
- }
60304
- function TSTypeOperator(node) {
60305
- this.token(node.operator);
60306
- this.space();
60307
- this.print(node.typeAnnotation, node);
60308
- }
60309
- function TSIndexedAccessType(node) {
60310
- this.print(node.objectType, node);
60311
- this.token("[");
60312
- this.print(node.indexType, node);
60313
- this.token("]");
60314
- }
60315
- function TSMappedType(node) {
60316
- const {
60317
- readonly,
60318
- typeParameter,
60319
- optional
60320
- } = node;
60321
- this.token("{");
60322
- this.space();
60323
- if (readonly) {
60324
- tokenIfPlusMinus(this, readonly);
60325
- this.word("readonly");
60326
- this.space();
60327
- }
60328
- this.token("[");
60329
- this.word(typeParameter.name);
60330
- this.space();
60331
- this.word("in");
60332
- this.space();
60333
- this.print(typeParameter.constraint, typeParameter);
60334
- this.token("]");
60335
- if (optional) {
60336
- tokenIfPlusMinus(this, optional);
60337
- this.token("?");
60338
- }
60339
- this.token(":");
60340
- this.space();
60341
- this.print(node.typeAnnotation, node);
60342
- this.space();
60343
- this.token("}");
60344
- }
60345
- function tokenIfPlusMinus(self2, tok) {
60346
- if (tok !== true) {
60347
- self2.token(tok);
60348
- }
60349
- }
60350
- function TSLiteralType(node) {
60351
- this.print(node.literal, node);
60352
- }
60353
- function TSExpressionWithTypeArguments(node) {
60354
- this.print(node.expression, node);
60355
- this.print(node.typeParameters, node);
60356
- }
60357
- function TSInterfaceDeclaration(node) {
60358
- const {
60359
- declare,
60360
- id,
60361
- typeParameters,
60362
- extends: extendz,
60363
- body
60364
- } = node;
60365
- if (declare) {
60366
- this.word("declare");
60367
- this.space();
60368
- }
60369
- this.word("interface");
60370
- this.space();
60371
- this.print(id, node);
60372
- this.print(typeParameters, node);
60373
- if (extendz) {
60374
- this.space();
60375
- this.word("extends");
60376
- this.space();
60377
- this.printList(extendz, node);
60378
- }
60379
- this.space();
60380
- this.print(body, node);
60381
- }
60382
- function TSInterfaceBody(node) {
60383
- this.tsPrintTypeLiteralOrInterfaceBody(node.body, node);
60384
- }
60385
- function TSTypeAliasDeclaration(node) {
60386
- const {
60387
- declare,
60388
- id,
60389
- typeParameters,
60390
- typeAnnotation: typeAnnotation2
60391
- } = node;
60392
- if (declare) {
60393
- this.word("declare");
60394
- this.space();
60395
- }
60396
- this.word("type");
60397
- this.space();
60398
- this.print(id, node);
60399
- this.print(typeParameters, node);
60400
- this.space();
60401
- this.token("=");
60402
- this.space();
60403
- this.print(typeAnnotation2, node);
60404
- this.token(";");
60405
- }
60406
- function TSAsExpression(node) {
60407
- const {
60408
- expression,
60409
- typeAnnotation: typeAnnotation2
60410
- } = node;
60411
- this.print(expression, node);
60412
- this.space();
60413
- this.word("as");
60414
- this.space();
60415
- this.print(typeAnnotation2, node);
60416
- }
60417
- function TSTypeAssertion(node) {
60418
- const {
60419
- typeAnnotation: typeAnnotation2,
60420
- expression
60421
- } = node;
60422
- this.token("<");
60423
- this.print(typeAnnotation2, node);
60424
- this.token(">");
60425
- this.space();
60426
- this.print(expression, node);
60427
- }
60428
- function TSEnumDeclaration(node) {
60429
- const {
60430
- declare,
60431
- const: isConst,
60432
- id,
60433
- members
60434
- } = node;
60435
- if (declare) {
60436
- this.word("declare");
60437
- this.space();
60438
- }
60439
- if (isConst) {
60440
- this.word("const");
60441
- this.space();
60442
- }
60443
- this.word("enum");
60444
- this.space();
60445
- this.print(id, node);
60446
- this.space();
60447
- this.tsPrintBraced(members, node);
60448
- }
60449
- function TSEnumMember(node) {
60450
- const {
60451
- id,
60452
- initializer
60453
- } = node;
60454
- this.print(id, node);
60455
- if (initializer) {
60456
- this.space();
60457
- this.token("=");
60458
- this.space();
60459
- this.print(initializer, node);
60460
- }
60461
- this.token(",");
60462
- }
60463
- function TSModuleDeclaration(node) {
60464
- const {
60465
- declare,
60466
- id
60467
- } = node;
60468
- if (declare) {
60469
- this.word("declare");
60470
- this.space();
60471
- }
60472
- if (!node.global) {
60473
- this.word(id.type === "Identifier" ? "namespace" : "module");
60474
- this.space();
60475
- }
60476
- this.print(id, node);
60477
- if (!node.body) {
60478
- this.token(";");
60479
- return;
60480
- }
60481
- let body = node.body;
60482
- while (body.type === "TSModuleDeclaration") {
60483
- this.token(".");
60484
- this.print(body.id, body);
60485
- body = body.body;
60486
- }
60487
- this.space();
60488
- this.print(body, node);
60489
- }
60490
- function TSModuleBlock(node) {
60491
- this.tsPrintBraced(node.body, node);
60492
- }
60493
- function TSImportEqualsDeclaration(node) {
60494
- const {
60495
- isExport,
60496
- id,
60497
- moduleReference
60498
- } = node;
60499
- if (isExport) {
60500
- this.word("export");
60501
- this.space();
60502
- }
60503
- this.word("import");
60504
- this.space();
60505
- this.print(id, node);
60506
- this.space();
60507
- this.token("=");
60508
- this.space();
60509
- this.print(moduleReference, node);
60510
- this.token(";");
60511
- }
60512
- function TSExternalModuleReference(node) {
60513
- this.token("require(");
60514
- this.print(node.expression, node);
60515
- this.token(")");
60516
- }
60517
- function TSNonNullExpression(node) {
60518
- this.print(node.expression, node);
60519
- this.token("!");
60520
- }
60521
- function TSExportAssignment(node) {
60522
- this.word("export");
60523
- this.space();
60524
- this.token("=");
60525
- this.space();
60526
- this.print(node.expression, node);
60527
- this.token(";");
60528
- }
60529
- function TSNamespaceExportDeclaration(node) {
60530
- this.word("export");
60531
- this.space();
60532
- this.word("as");
60533
- this.space();
60534
- this.word("namespace");
60535
- this.space();
60536
- this.print(node.id, node);
60537
- }
60538
- function tsPrintSignatureDeclarationBase(node) {
60539
- const {
60540
- typeParameters,
60541
- parameters
60542
- } = node;
60543
- this.print(typeParameters, node);
60544
- this.token("(");
60545
- this._parameters(parameters, node);
60546
- this.token(")");
60547
- this.print(node.typeAnnotation, node);
60548
- }
60549
- }
60550
- });
60551
-
60552
- // node_modules/@babel/generator/lib/generators/index.js
60553
- var require_generators3 = __commonJS({
60554
- "node_modules/@babel/generator/lib/generators/index.js"(exports2) {
60555
- "use strict";
60556
- Object.defineProperty(exports2, "__esModule", {
60557
- value: true
60558
- });
60559
- var _templateLiterals = require_template_literals3();
60560
- Object.keys(_templateLiterals).forEach(function(key2) {
60561
- if (key2 === "default" || key2 === "__esModule") return;
60562
- Object.defineProperty(exports2, key2, {
60563
- enumerable: true,
60564
- get: function() {
60565
- return _templateLiterals[key2];
60566
- }
60567
- });
60568
- });
60569
- var _expressions = require_expressions3();
60570
- Object.keys(_expressions).forEach(function(key2) {
60571
- if (key2 === "default" || key2 === "__esModule") return;
60572
- Object.defineProperty(exports2, key2, {
60573
- enumerable: true,
60574
- get: function() {
60575
- return _expressions[key2];
60576
- }
60577
- });
60578
- });
60579
- var _statements = require_statements3();
60580
- Object.keys(_statements).forEach(function(key2) {
60581
- if (key2 === "default" || key2 === "__esModule") return;
60582
- Object.defineProperty(exports2, key2, {
60583
- enumerable: true,
60584
- get: function() {
60585
- return _statements[key2];
60586
- }
60587
- });
60588
- });
60589
- var _classes = require_classes3();
60590
- Object.keys(_classes).forEach(function(key2) {
60591
- if (key2 === "default" || key2 === "__esModule") return;
60592
- Object.defineProperty(exports2, key2, {
60593
- enumerable: true,
60594
- get: function() {
60595
- return _classes[key2];
60596
- }
60597
- });
60598
- });
60599
- var _methods = require_methods3();
60600
- Object.keys(_methods).forEach(function(key2) {
60601
- if (key2 === "default" || key2 === "__esModule") return;
60602
- Object.defineProperty(exports2, key2, {
60603
- enumerable: true,
60604
- get: function() {
60605
- return _methods[key2];
60606
- }
60607
- });
60608
- });
60609
- var _modules = require_modules3();
60610
- Object.keys(_modules).forEach(function(key2) {
60611
- if (key2 === "default" || key2 === "__esModule") return;
60612
- Object.defineProperty(exports2, key2, {
60613
- enumerable: true,
60614
- get: function() {
60615
- return _modules[key2];
60616
- }
60617
- });
60618
- });
60619
- var _types = require_types3();
60620
- Object.keys(_types).forEach(function(key2) {
60621
- if (key2 === "default" || key2 === "__esModule") return;
60622
- Object.defineProperty(exports2, key2, {
60623
- enumerable: true,
60624
- get: function() {
60625
- return _types[key2];
60626
- }
60627
- });
60628
- });
60629
- var _flow = require_flow3();
60630
- Object.keys(_flow).forEach(function(key2) {
60631
- if (key2 === "default" || key2 === "__esModule") return;
60632
- Object.defineProperty(exports2, key2, {
60633
- enumerable: true,
60634
- get: function() {
60635
- return _flow[key2];
60636
- }
60637
- });
60638
- });
60639
- var _base = require_base3();
60640
- Object.keys(_base).forEach(function(key2) {
60641
- if (key2 === "default" || key2 === "__esModule") return;
60642
- Object.defineProperty(exports2, key2, {
60643
- enumerable: true,
60644
- get: function() {
60645
- return _base[key2];
60646
- }
60647
- });
60648
- });
60649
- var _jsx = require_jsx3();
60650
- Object.keys(_jsx).forEach(function(key2) {
60651
- if (key2 === "default" || key2 === "__esModule") return;
60652
- Object.defineProperty(exports2, key2, {
60653
- enumerable: true,
60654
- get: function() {
60655
- return _jsx[key2];
60656
- }
60657
- });
60658
- });
60659
- var _typescript = require_typescript3();
60660
- Object.keys(_typescript).forEach(function(key2) {
60661
- if (key2 === "default" || key2 === "__esModule") return;
60662
- Object.defineProperty(exports2, key2, {
60663
- enumerable: true,
60664
- get: function() {
60665
- return _typescript[key2];
60666
- }
60667
- });
60668
- });
60669
- }
60670
- });
60671
-
60672
- // node_modules/@babel/generator/lib/printer.js
60673
- var require_printer3 = __commonJS({
60674
- "node_modules/@babel/generator/lib/printer.js"(exports2) {
60675
- "use strict";
60676
- Object.defineProperty(exports2, "__esModule", {
60677
- value: true
60678
- });
60679
- exports2.default = void 0;
60680
- function _isInteger() {
60681
- const data = _interopRequireDefault(require_isInteger());
60682
- _isInteger = function() {
60683
- return data;
60684
- };
60685
- return data;
60686
- }
60687
- function _repeat() {
60688
- const data = _interopRequireDefault(require_repeat());
60689
- _repeat = function() {
60690
- return data;
60691
- };
60692
- return data;
60693
- }
60694
- var _buffer = _interopRequireDefault(require_buffer3());
60695
- var n = _interopRequireWildcard(require_node4());
60696
- function t6() {
60697
- const data = _interopRequireWildcard(require("@babel/types"));
60698
- t6 = function() {
60699
- return data;
60700
- };
60701
- return data;
60702
- }
60703
- var generatorFunctions = _interopRequireWildcard(require_generators3());
60704
- function _interopRequireWildcard(obj) {
60705
- if (obj && obj.__esModule) {
60706
- return obj;
60707
- } else {
60708
- var newObj = {};
60709
- if (obj != null) {
60710
- for (var key2 in obj) {
60711
- if (Object.prototype.hasOwnProperty.call(obj, key2)) {
60712
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : {};
60713
- if (desc.get || desc.set) {
60714
- Object.defineProperty(newObj, key2, desc);
60715
- } else {
60716
- newObj[key2] = obj[key2];
60717
- }
60718
- }
60719
- }
60720
- }
60721
- newObj.default = obj;
60722
- return newObj;
60723
- }
60724
- }
60725
- function _interopRequireDefault(obj) {
60726
- return obj && obj.__esModule ? obj : { default: obj };
60727
- }
60728
- var SCIENTIFIC_NOTATION = /e/i;
60729
- var ZERO_DECIMAL_INTEGER = /\.0+$/;
60730
- var NON_DECIMAL_LITERAL = /^0[box]/;
60731
- var Printer = class {
60732
- constructor(format, map) {
60733
- this.inForStatementInitCounter = 0;
60734
- this._printStack = [];
60735
- this._indent = 0;
60736
- this._insideAux = false;
60737
- this._printedCommentStarts = {};
60738
- this._parenPushNewlineState = null;
60739
- this._noLineTerminator = false;
60740
- this._printAuxAfterOnNextUserNode = false;
60741
- this._printedComments = /* @__PURE__ */ new WeakSet();
60742
- this._endsWithInteger = false;
60743
- this._endsWithWord = false;
60744
- this.format = format || {};
60745
- this._buf = new _buffer.default(map);
60746
- }
60747
- generate(ast) {
60748
- this.print(ast);
60749
- this._maybeAddAuxComment();
60750
- return this._buf.get();
60751
- }
60752
- indent() {
60753
- if (this.format.compact || this.format.concise) return;
60754
- this._indent++;
60755
- }
60756
- dedent() {
60757
- if (this.format.compact || this.format.concise) return;
60758
- this._indent--;
60759
- }
60760
- semicolon(force = false) {
60761
- this._maybeAddAuxComment();
60762
- this._append(";", !force);
60763
- }
60764
- rightBrace() {
60765
- if (this.format.minified) {
60766
- this._buf.removeLastSemicolon();
60767
- }
60768
- this.token("}");
60769
- }
60770
- space(force = false) {
60771
- if (this.format.compact) return;
60772
- if (this._buf.hasContent() && !this.endsWith(" ") && !this.endsWith("\n") || force) {
60773
- this._space();
60774
- }
60775
- }
60776
- word(str) {
60777
- if (this._endsWithWord || this.endsWith("/") && str.indexOf("/") === 0) {
60778
- this._space();
60779
- }
60780
- this._maybeAddAuxComment();
60781
- this._append(str);
60782
- this._endsWithWord = true;
60783
- }
60784
- number(str) {
60785
- this.word(str);
60786
- this._endsWithInteger = (0, _isInteger().default)(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str[str.length - 1] !== ".";
60787
- }
60788
- token(str) {
60789
- if (str === "--" && this.endsWith("!") || str[0] === "+" && this.endsWith("+") || str[0] === "-" && this.endsWith("-") || str[0] === "." && this._endsWithInteger) {
60790
- this._space();
60791
- }
60792
- this._maybeAddAuxComment();
60793
- this._append(str);
60794
- }
60795
- newline(i) {
60796
- if (this.format.retainLines || this.format.compact) return;
60797
- if (this.format.concise) {
60798
- this.space();
60799
- return;
60800
- }
60801
- if (this.endsWith("\n\n")) return;
60802
- if (typeof i !== "number") i = 1;
60803
- i = Math.min(2, i);
60804
- if (this.endsWith("{\n") || this.endsWith(":\n")) i--;
60805
- if (i <= 0) return;
60806
- for (let j = 0; j < i; j++) {
60807
- this._newline();
60808
- }
60809
- }
60810
- endsWith(str) {
60811
- return this._buf.endsWith(str);
60812
- }
60813
- removeTrailingNewline() {
60814
- this._buf.removeTrailingNewline();
60815
- }
60816
- exactSource(loc, cb) {
60817
- this._catchUp("start", loc);
60818
- this._buf.exactSource(loc, cb);
60819
- }
60820
- source(prop, loc) {
60821
- this._catchUp(prop, loc);
60822
- this._buf.source(prop, loc);
60823
- }
60824
- withSource(prop, loc, cb) {
60825
- this._catchUp(prop, loc);
60826
- this._buf.withSource(prop, loc, cb);
60827
- }
60828
- _space() {
60829
- this._append(" ", true);
60830
- }
60831
- _newline() {
60832
- this._append("\n", true);
60833
- }
60834
- _append(str, queue = false) {
60835
- this._maybeAddParen(str);
60836
- this._maybeIndent(str);
60837
- if (queue) this._buf.queue(str);
60838
- else this._buf.append(str);
60839
- this._endsWithWord = false;
60840
- this._endsWithInteger = false;
60841
- }
60842
- _maybeIndent(str) {
60843
- if (this._indent && this.endsWith("\n") && str[0] !== "\n") {
60844
- this._buf.queue(this._getIndent());
60845
- }
60846
- }
60847
- _maybeAddParen(str) {
60848
- const parenPushNewlineState = this._parenPushNewlineState;
60849
- if (!parenPushNewlineState) return;
60850
- this._parenPushNewlineState = null;
60851
- let i;
60852
- for (i = 0; i < str.length && str[i] === " "; i++) continue;
60853
- if (i === str.length) return;
60854
- const cha = str[i];
60855
- if (cha !== "\n") {
60856
- if (cha !== "/") return;
60857
- if (i + 1 === str.length) return;
60858
- const chaPost = str[i + 1];
60859
- if (chaPost !== "/" && chaPost !== "*") return;
60860
- }
60861
- this.token("(");
60862
- this.indent();
60863
- parenPushNewlineState.printed = true;
60864
- }
60865
- _catchUp(prop, loc) {
60866
- if (!this.format.retainLines) return;
60867
- const pos2 = loc ? loc[prop] : null;
60868
- if (pos2 && pos2.line !== null) {
60869
- const count = pos2.line - this._buf.getCurrentLine();
60870
- for (let i = 0; i < count; i++) {
60871
- this._newline();
60872
- }
60873
- }
60874
- }
60875
- _getIndent() {
60876
- return (0, _repeat().default)(this.format.indent.style, this._indent);
60877
- }
60878
- startTerminatorless(isLabel = false) {
60879
- if (isLabel) {
60880
- this._noLineTerminator = true;
60881
- return null;
60882
- } else {
60883
- return this._parenPushNewlineState = {
60884
- printed: false
60885
- };
60886
- }
60887
- }
60888
- endTerminatorless(state) {
60889
- this._noLineTerminator = false;
60890
- if (state && state.printed) {
60891
- this.dedent();
60892
- this.newline();
60893
- this.token(")");
60894
- }
60895
- }
60896
- print(node, parent) {
60897
- if (!node) return;
60898
- const oldConcise = this.format.concise;
60899
- if (node._compact) {
60900
- this.format.concise = true;
60901
- }
60902
- const printMethod = this[node.type];
60903
- if (!printMethod) {
60904
- throw new ReferenceError(`unknown node of type ${JSON.stringify(node.type)} with constructor ${JSON.stringify(node && node.constructor.name)}`);
60905
- }
60906
- this._printStack.push(node);
60907
- const oldInAux = this._insideAux;
60908
- this._insideAux = !node.loc;
60909
- this._maybeAddAuxComment(this._insideAux && !oldInAux);
60910
- let needsParens = n.needsParens(node, parent, this._printStack);
60911
- if (this.format.retainFunctionParens && node.type === "FunctionExpression" && node.extra && node.extra.parenthesized) {
60912
- needsParens = true;
60913
- }
60914
- if (needsParens) this.token("(");
60915
- this._printLeadingComments(node);
60916
- const loc = t6().isProgram(node) || t6().isFile(node) ? null : node.loc;
60917
- this.withSource("start", loc, () => {
60918
- this[node.type](node, parent);
60919
- });
60920
- this._printTrailingComments(node);
60921
- if (needsParens) this.token(")");
60922
- this._printStack.pop();
60923
- this.format.concise = oldConcise;
60924
- this._insideAux = oldInAux;
60925
- }
60926
- _maybeAddAuxComment(enteredPositionlessNode) {
60927
- if (enteredPositionlessNode) this._printAuxBeforeComment();
60928
- if (!this._insideAux) this._printAuxAfterComment();
60929
- }
60930
- _printAuxBeforeComment() {
60931
- if (this._printAuxAfterOnNextUserNode) return;
60932
- this._printAuxAfterOnNextUserNode = true;
60933
- const comment = this.format.auxiliaryCommentBefore;
60934
- if (comment) {
60935
- this._printComment({
60936
- type: "CommentBlock",
60937
- value: comment
60938
- });
60939
- }
60940
- }
60941
- _printAuxAfterComment() {
60942
- if (!this._printAuxAfterOnNextUserNode) return;
60943
- this._printAuxAfterOnNextUserNode = false;
60944
- const comment = this.format.auxiliaryCommentAfter;
60945
- if (comment) {
60946
- this._printComment({
60947
- type: "CommentBlock",
60948
- value: comment
60949
- });
60950
- }
60951
- }
60952
- getPossibleRaw(node) {
60953
- const extra = node.extra;
60954
- if (extra && extra.raw != null && extra.rawValue != null && node.value === extra.rawValue) {
60955
- return extra.raw;
60956
- }
60957
- }
60958
- printJoin(nodes, parent, opts = {}) {
60959
- if (!nodes || !nodes.length) return;
60960
- if (opts.indent) this.indent();
60961
- const newlineOpts = {
60962
- addNewlines: opts.addNewlines
60963
- };
60964
- for (let i = 0; i < nodes.length; i++) {
60965
- const node = nodes[i];
60966
- if (!node) continue;
60967
- if (opts.statement) this._printNewline(true, node, parent, newlineOpts);
60968
- this.print(node, parent);
60969
- if (opts.iterator) {
60970
- opts.iterator(node, i);
60971
- }
60972
- if (opts.separator && i < nodes.length - 1) {
60973
- opts.separator.call(this);
60974
- }
60975
- if (opts.statement) this._printNewline(false, node, parent, newlineOpts);
60976
- }
60977
- if (opts.indent) this.dedent();
60978
- }
60979
- printAndIndentOnComments(node, parent) {
60980
- const indent = node.leadingComments && node.leadingComments.length > 0;
60981
- if (indent) this.indent();
60982
- this.print(node, parent);
60983
- if (indent) this.dedent();
60984
- }
60985
- printBlock(parent) {
60986
- const node = parent.body;
60987
- if (!t6().isEmptyStatement(node)) {
60988
- this.space();
60989
- }
60990
- this.print(node, parent);
60991
- }
60992
- _printTrailingComments(node) {
60993
- this._printComments(this._getComments(false, node));
60994
- }
60995
- _printLeadingComments(node) {
60996
- this._printComments(this._getComments(true, node));
60997
- }
60998
- printInnerComments(node, indent = true) {
60999
- if (!node.innerComments || !node.innerComments.length) return;
61000
- if (indent) this.indent();
61001
- this._printComments(node.innerComments);
61002
- if (indent) this.dedent();
61003
- }
61004
- printSequence(nodes, parent, opts = {}) {
61005
- opts.statement = true;
61006
- return this.printJoin(nodes, parent, opts);
61007
- }
61008
- printList(items, parent, opts = {}) {
61009
- if (opts.separator == null) {
61010
- opts.separator = commaSeparator;
61011
- }
61012
- return this.printJoin(items, parent, opts);
61013
- }
61014
- _printNewline(leading, node, parent, opts) {
61015
- if (this.format.retainLines || this.format.compact) return;
61016
- if (this.format.concise) {
61017
- this.space();
61018
- return;
61019
- }
61020
- let lines = 0;
61021
- if (this._buf.hasContent()) {
61022
- if (!leading) lines++;
61023
- if (opts.addNewlines) lines += opts.addNewlines(leading, node) || 0;
61024
- const needs = leading ? n.needsWhitespaceBefore : n.needsWhitespaceAfter;
61025
- if (needs(node, parent)) lines++;
61026
- }
61027
- this.newline(lines);
61028
- }
61029
- _getComments(leading, node) {
61030
- return node && (leading ? node.leadingComments : node.trailingComments) || [];
61031
- }
61032
- _printComment(comment) {
61033
- if (!this.format.shouldPrintComment(comment.value)) return;
61034
- if (comment.ignore) return;
61035
- if (this._printedComments.has(comment)) return;
61036
- this._printedComments.add(comment);
61037
- if (comment.start != null) {
61038
- if (this._printedCommentStarts[comment.start]) return;
61039
- this._printedCommentStarts[comment.start] = true;
61040
- }
61041
- const isBlockComment = comment.type === "CommentBlock";
61042
- this.newline(this._buf.hasContent() && !this._noLineTerminator && isBlockComment ? 1 : 0);
61043
- if (!this.endsWith("[") && !this.endsWith("{")) this.space();
61044
- let val = !isBlockComment && !this._noLineTerminator ? `//${comment.value}
61045
- ` : `/*${comment.value}*/`;
61046
- if (isBlockComment && this.format.indent.adjustMultilineComment) {
61047
- const offset = comment.loc && comment.loc.start.column;
61048
- if (offset) {
61049
- const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g");
61050
- val = val.replace(newlineRegex, "\n");
61051
- }
61052
- const indentSize = Math.max(this._getIndent().length, this._buf.getCurrentColumn());
61053
- val = val.replace(/\n(?!$)/g, `
61054
- ${(0, _repeat().default)(" ", indentSize)}`);
61055
- }
61056
- if (this.endsWith("/")) this._space();
61057
- this.withSource("start", comment.loc, () => {
61058
- this._append(val);
61059
- });
61060
- this.newline(isBlockComment && !this._noLineTerminator ? 1 : 0);
61061
- }
61062
- _printComments(comments) {
61063
- if (!comments || !comments.length) return;
61064
- for (const comment of comments) {
61065
- this._printComment(comment);
61066
- }
61067
- }
61068
- };
61069
- exports2.default = Printer;
61070
- Object.assign(Printer.prototype, generatorFunctions);
61071
- function commaSeparator() {
61072
- this.token(",");
61073
- this.space();
61074
- }
61075
- }
61076
- });
61077
-
61078
- // node_modules/@babel/generator/lib/index.js
61079
- var require_lib11 = __commonJS({
61080
- "node_modules/@babel/generator/lib/index.js"(exports2) {
61081
- "use strict";
61082
- Object.defineProperty(exports2, "__esModule", {
61083
- value: true
61084
- });
61085
- exports2.default = _default;
61086
- exports2.CodeGenerator = void 0;
61087
- var _sourceMap = _interopRequireDefault(require_source_map4());
61088
- var _printer = _interopRequireDefault(require_printer3());
61089
- function _interopRequireDefault(obj) {
61090
- return obj && obj.__esModule ? obj : { default: obj };
61091
- }
61092
- var Generator = class extends _printer.default {
61093
- constructor(ast, opts = {}, code) {
61094
- const format = normalizeOptions(code, opts);
61095
- const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null;
61096
- super(format, map);
61097
- this.ast = ast;
61098
- }
61099
- generate() {
61100
- return super.generate(this.ast);
61101
- }
61102
- };
61103
- function normalizeOptions(code, opts) {
61104
- const format = {
61105
- auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
61106
- auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
61107
- shouldPrintComment: opts.shouldPrintComment,
61108
- retainLines: opts.retainLines,
61109
- retainFunctionParens: opts.retainFunctionParens,
61110
- comments: opts.comments == null || opts.comments,
61111
- compact: opts.compact,
61112
- minified: opts.minified,
61113
- concise: opts.concise,
61114
- jsonCompatibleStrings: opts.jsonCompatibleStrings,
61115
- indent: {
61116
- adjustMultilineComment: true,
61117
- style: " ",
61118
- base: 0
61119
- },
61120
- decoratorsBeforeExport: !!opts.decoratorsBeforeExport,
61121
- jsescOption: Object.assign({
61122
- quotes: "double",
61123
- wrap: true
61124
- }, opts.jsescOption)
61125
- };
61126
- if (format.minified) {
61127
- format.compact = true;
61128
- format.shouldPrintComment = format.shouldPrintComment || (() => format.comments);
61129
- } else {
61130
- format.shouldPrintComment = format.shouldPrintComment || ((value) => format.comments || value.indexOf("@license") >= 0 || value.indexOf("@preserve") >= 0);
61131
- }
61132
- if (format.compact === "auto") {
61133
- format.compact = code.length > 5e5;
61134
- if (format.compact) {
61135
- console.error(`[BABEL] Note: The code generator has deoptimised the styling of ${opts.filename} as it exceeds the max of ${"500KB"}.`);
61136
- }
61137
- }
61138
- if (format.compact) {
61139
- format.indent.adjustMultilineComment = false;
61140
- }
61141
- return format;
61142
- }
61143
- var CodeGenerator = class {
61144
- constructor(ast, opts, code) {
61145
- this._generator = new Generator(ast, opts, code);
61146
- }
61147
- generate() {
61148
- return this._generator.generate();
61149
- }
61150
- };
61151
- exports2.CodeGenerator = CodeGenerator;
61152
- function _default(ast, opts, code) {
61153
- const gen = new Generator(ast, opts, code);
61154
- return gen.generate();
61155
- }
61156
- }
61157
- });
61158
-
61159
56672
  // ../../node_modules/color-convert/node_modules/color-name/index.js
61160
56673
  var require_color_name = __commonJS({
61161
56674
  "../../node_modules/color-convert/node_modules/color-name/index.js"(exports2, module2) {
@@ -64008,6 +59521,7 @@ function hasOwnProperty2(obj, key2) {
64008
59521
  // src/CompilerError.ts
64009
59522
  var ErrorSeverity = /* @__PURE__ */ ((ErrorSeverity2) => {
64010
59523
  ErrorSeverity2["InvalidJS"] = "InvalidJS";
59524
+ ErrorSeverity2["UnsupportedJS"] = "UnsupportedJS";
64011
59525
  ErrorSeverity2["InvalidReact"] = "InvalidReact";
64012
59526
  ErrorSeverity2["InvalidConfig"] = "InvalidConfig";
64013
59527
  ErrorSeverity2["CannotPreserveMemoization"] = "CannotPreserveMemoization";
@@ -64156,12 +59670,16 @@ var CompilerError = class _CompilerError extends Error {
64156
59670
  case "InvalidJS" /* InvalidJS */:
64157
59671
  case "InvalidReact" /* InvalidReact */:
64158
59672
  case "InvalidConfig" /* InvalidConfig */:
59673
+ case "UnsupportedJS" /* UnsupportedJS */: {
64159
59674
  return true;
59675
+ }
64160
59676
  case "CannotPreserveMemoization" /* CannotPreserveMemoization */:
64161
- case "Todo" /* Todo */:
59677
+ case "Todo" /* Todo */: {
64162
59678
  return false;
64163
- default:
59679
+ }
59680
+ default: {
64164
59681
  assertExhaustive(detail.severity, "Unhandled error severity");
59682
+ }
64165
59683
  }
64166
59684
  });
64167
59685
  }
@@ -68697,9 +64215,6 @@ function getHookKindForType(env, type) {
68697
64215
  return null;
68698
64216
  }
68699
64217
 
68700
- // src/HIR/PrintHIR.ts
68701
- var import_generator = __toESM(require_lib11());
68702
-
68703
64218
  // src/ReactiveScopes/PrintReactiveFunction.ts
68704
64219
  function printReactiveFunctionWithOutlined(fn) {
68705
64220
  const writer = new Writer();
@@ -69449,7 +64964,7 @@ function printInstructionValue(instrValue) {
69449
64964
  break;
69450
64965
  }
69451
64966
  case "UnsupportedNode": {
69452
- value = `UnsupportedNode(${(0, import_generator.default)(instrValue.node).code})`;
64967
+ value = `UnsupportedNode ${instrValue.node.type}`;
69453
64968
  break;
69454
64969
  }
69455
64970
  case "LoadLocal": {
@@ -73295,7 +68810,7 @@ function lower(func, env, bindings = null, capturedRefs = /* @__PURE__ */ new Ma
73295
68810
  });
73296
68811
  }
73297
68812
  function lowerStatement(builder, stmtPath, label = null) {
73298
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$;
68813
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga;
73299
68814
  const stmtNode = stmtPath.node;
73300
68815
  switch (stmtNode.type) {
73301
68816
  case "ThrowStatement": {
@@ -74282,12 +69797,78 @@ function lowerStatement(builder, stmtPath, label = null) {
74282
69797
  );
74283
69798
  return;
74284
69799
  }
74285
- case "TypeAlias":
74286
- case "TSInterfaceDeclaration":
74287
- case "TSTypeAliasDeclaration": {
69800
+ case "WithStatement": {
69801
+ builder.errors.push({
69802
+ reason: `JavaScript 'with' syntax is not supported`,
69803
+ description: `'with' syntax is considered deprecated and removed from JavaScript standards, consider alternatives`,
69804
+ severity: "UnsupportedJS" /* UnsupportedJS */,
69805
+ loc: (__ = stmtPath.node.loc) != null ? __ : null,
69806
+ suggestions: null
69807
+ });
69808
+ lowerValueToTemporary(builder, {
69809
+ kind: "UnsupportedNode",
69810
+ loc: (_$ = stmtPath.node.loc) != null ? _$ : GeneratedSource,
69811
+ node: stmtPath.node
69812
+ });
69813
+ return;
69814
+ }
69815
+ case "ClassDeclaration": {
69816
+ builder.errors.push({
69817
+ reason: "Inline `class` declarations are not supported",
69818
+ description: `Move class declarations outside of components/hooks`,
69819
+ severity: "UnsupportedJS" /* UnsupportedJS */,
69820
+ loc: (_aa = stmtPath.node.loc) != null ? _aa : null,
69821
+ suggestions: null
69822
+ });
69823
+ lowerValueToTemporary(builder, {
69824
+ kind: "UnsupportedNode",
69825
+ loc: (_ba = stmtPath.node.loc) != null ? _ba : GeneratedSource,
69826
+ node: stmtPath.node
69827
+ });
69828
+ return;
69829
+ }
69830
+ case "EnumDeclaration":
69831
+ case "TSEnumDeclaration": {
69832
+ lowerValueToTemporary(builder, {
69833
+ kind: "UnsupportedNode",
69834
+ loc: (_ca = stmtPath.node.loc) != null ? _ca : GeneratedSource,
69835
+ node: stmtPath.node
69836
+ });
69837
+ return;
69838
+ }
69839
+ case "ExportAllDeclaration":
69840
+ case "ExportDefaultDeclaration":
69841
+ case "ExportNamedDeclaration":
69842
+ case "ImportDeclaration":
69843
+ case "TSExportAssignment":
69844
+ case "TSImportEqualsDeclaration": {
69845
+ builder.errors.push({
69846
+ reason: "JavaScript `import` and `export` statements may only appear at the top level of a module",
69847
+ severity: "InvalidJS" /* InvalidJS */,
69848
+ loc: (_da = stmtPath.node.loc) != null ? _da : null,
69849
+ suggestions: null
69850
+ });
69851
+ lowerValueToTemporary(builder, {
69852
+ kind: "UnsupportedNode",
69853
+ loc: (_ea = stmtPath.node.loc) != null ? _ea : GeneratedSource,
69854
+ node: stmtPath.node
69855
+ });
69856
+ return;
69857
+ }
69858
+ case "TSNamespaceExportDeclaration": {
69859
+ builder.errors.push({
69860
+ reason: "TypeScript `namespace` statements may only appear at the top level of a module",
69861
+ severity: "InvalidJS" /* InvalidJS */,
69862
+ loc: (_fa = stmtPath.node.loc) != null ? _fa : null,
69863
+ suggestions: null
69864
+ });
69865
+ lowerValueToTemporary(builder, {
69866
+ kind: "UnsupportedNode",
69867
+ loc: (_ga = stmtPath.node.loc) != null ? _ga : GeneratedSource,
69868
+ node: stmtPath.node
69869
+ });
74288
69870
  return;
74289
69871
  }
74290
- case "ClassDeclaration":
74291
69872
  case "DeclareClass":
74292
69873
  case "DeclareExportAllDeclaration":
74293
69874
  case "DeclareExportDeclaration":
@@ -74298,31 +69879,13 @@ function lowerStatement(builder, stmtPath, label = null) {
74298
69879
  case "DeclareOpaqueType":
74299
69880
  case "DeclareTypeAlias":
74300
69881
  case "DeclareVariable":
74301
- case "EnumDeclaration":
74302
- case "ExportAllDeclaration":
74303
- case "ExportDefaultDeclaration":
74304
- case "ExportNamedDeclaration":
74305
- case "ImportDeclaration":
74306
69882
  case "InterfaceDeclaration":
74307
69883
  case "OpaqueType":
74308
69884
  case "TSDeclareFunction":
74309
- case "TSEnumDeclaration":
74310
- case "TSExportAssignment":
74311
- case "TSImportEqualsDeclaration":
69885
+ case "TSInterfaceDeclaration":
74312
69886
  case "TSModuleDeclaration":
74313
- case "TSNamespaceExportDeclaration":
74314
- case "WithStatement": {
74315
- builder.errors.push({
74316
- reason: `(BuildHIR::lowerStatement) Handle ${stmtPath.type} statements`,
74317
- severity: "Todo" /* Todo */,
74318
- loc: (__ = stmtPath.node.loc) != null ? __ : null,
74319
- suggestions: null
74320
- });
74321
- lowerValueToTemporary(builder, {
74322
- kind: "UnsupportedNode",
74323
- loc: (_$ = stmtPath.node.loc) != null ? _$ : GeneratedSource,
74324
- node: stmtPath.node
74325
- });
69887
+ case "TSTypeAliasDeclaration":
69888
+ case "TypeAlias": {
74326
69889
  return;
74327
69890
  }
74328
69891
  default: {
@@ -76115,7 +71678,7 @@ function lowerValueToTemporary(builder, value) {
76115
71678
  return place;
76116
71679
  }
76117
71680
  function lowerIdentifier(builder, exprPath) {
76118
- var _a;
71681
+ var _a, _b;
76119
71682
  const exprNode = exprPath.node;
76120
71683
  const exprLoc = (_a = exprNode.loc) != null ? _a : GeneratedSource;
76121
71684
  const binding = builder.resolveIdentifier(exprPath);
@@ -76131,6 +71694,15 @@ function lowerIdentifier(builder, exprPath) {
76131
71694
  return place;
76132
71695
  }
76133
71696
  default: {
71697
+ if (binding.kind === "Global" && binding.name === "eval") {
71698
+ builder.errors.push({
71699
+ reason: `The 'eval' function is not supported`,
71700
+ description: "Eval is an anti-pattern in JavaScript, and the code executed cannot be evaluated by React Compiler",
71701
+ severity: "UnsupportedJS" /* UnsupportedJS */,
71702
+ loc: (_b = exprPath.node.loc) != null ? _b : null,
71703
+ suggestions: null
71704
+ });
71705
+ }
76134
71706
  return lowerValueToTemporary(builder, {
76135
71707
  kind: "LoadGlobal",
76136
71708
  binding,
@@ -89345,12 +84917,14 @@ var CollectDependenciesVisitor = class extends ReactiveFunctionVisitor {
89345
84917
  };
89346
84918
  }
89347
84919
  case "UnsupportedNode": {
89348
- CompilerError.invariant(false, {
89349
- reason: `Unexpected unsupported node`,
89350
- description: null,
89351
- loc: value.loc,
89352
- suggestions: null
89353
- });
84920
+ const lvalues = [];
84921
+ if (lvalue !== null) {
84922
+ lvalues.push({ place: lvalue, level: "Never" /* Never */ });
84923
+ }
84924
+ return {
84925
+ lvalues,
84926
+ rvalues: []
84927
+ };
89354
84928
  }
89355
84929
  default: {
89356
84930
  assertExhaustive(
@@ -96472,7 +92046,7 @@ function isPrimitiveBinaryOp(op) {
96472
92046
  }
96473
92047
  function inferTypes(func) {
96474
92048
  const unifier = new Unifier(func.env);
96475
- for (const e of generate2(func)) {
92049
+ for (const e of generate(func)) {
96476
92050
  unifier.unify(e.left, e.right);
96477
92051
  }
96478
92052
  apply(func, unifier);
@@ -96505,7 +92079,7 @@ function equation(left, right) {
96505
92079
  right
96506
92080
  };
96507
92081
  }
96508
- function* generate2(func) {
92082
+ function* generate(func) {
96509
92083
  if (func.fnType === "Component") {
96510
92084
  const [props, ref] = func.params;
96511
92085
  if (props && props.kind === "Identifier") {
@@ -96752,7 +92326,7 @@ function* generateInstructionTypes(env, names, instr) {
96752
92326
  break;
96753
92327
  }
96754
92328
  case "FunctionExpression": {
96755
- yield* __yieldStar(generate2(value.loweredFunc.func));
92329
+ yield* __yieldStar(generate(value.loweredFunc.func));
96756
92330
  yield equation(left, {
96757
92331
  kind: "Function",
96758
92332
  shapeId: BuiltInFunctionId,
@@ -96766,7 +92340,7 @@ function* generateInstructionTypes(env, names, instr) {
96766
92340
  break;
96767
92341
  }
96768
92342
  case "ObjectMethod": {
96769
- yield* __yieldStar(generate2(value.loweredFunc.func));
92343
+ yield* __yieldStar(generate(value.loweredFunc.func));
96770
92344
  yield equation(left, { kind: "ObjectMethod" });
96771
92345
  break;
96772
92346
  }