@eslint-react/jsx 1.5.11-next.9 → 1.5.12-beta.10

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.mjs CHANGED
@@ -1,8 +1,6 @@
1
- import { is, NodeType, isOneOf, traverseUp, isJSXTagNameExpression, getNestedReturnStatements, traverseUpGuard, isStringLiteral, isMultiLine, ESLintCommunityESLintUtils } from '@eslint-react/ast';
2
- import { parseSchema, ESLintSettingsSchema } from '@eslint-react/shared';
3
- import memo from 'micro-memoize';
4
- import { findVariable, getVariableInit } from '@eslint-react/var';
5
1
  import { AST_NODE_TYPES } from '@typescript-eslint/types';
2
+ import { isOneOf, NodeType, is, traverseUpGuard, isStringLiteral, isMultiLine, isJSXTagNameExpression, ESLintCommunityESLintUtils } from '@eslint-react/ast';
3
+ import { findVariable, getVariableInit } from '@eslint-react/var';
6
4
  import '@typescript-eslint/utils';
7
5
 
8
6
  var __defProp = Object.defineProperty;
@@ -10,8 +8,37 @@ var __export = (target, all3) => {
10
8
  for (var name in all3)
11
9
  __defProp(target, name, { get: all3[name], enumerable: true });
12
10
  };
11
+ function resolveMemberExpressions(object, property) {
12
+ if (object.type === AST_NODE_TYPES.JSXMemberExpression) {
13
+ return `${resolveMemberExpressions(object.object, object.property)}.${property.name}`;
14
+ }
15
+ if (object.type === AST_NODE_TYPES.JSXNamespacedName) {
16
+ return `${object.namespace.name}:${object.name.name}.${property.name}`;
17
+ }
18
+ return `${object.name}.${property.name}`;
19
+ }
20
+ function elementType(node) {
21
+ if (node.type === AST_NODE_TYPES.JSXOpeningFragment) {
22
+ return "<>";
23
+ }
24
+ const { name } = node;
25
+ if (name.type === AST_NODE_TYPES.JSXMemberExpression) {
26
+ const { object, property } = name;
27
+ return resolveMemberExpressions(object, property);
28
+ }
29
+ if (name.type === AST_NODE_TYPES.JSXNamespacedName) {
30
+ return `${name.namespace.name}:${name.name.name}`;
31
+ }
32
+ return name.name;
33
+ }
34
+ function isJSXElementOfUserDefinedComponent(node) {
35
+ return node.openingElement.name.type === NodeType.JSXIdentifier && /^[A-Z]/u.test(node.openingElement.name.name);
36
+ }
37
+ function isJSXElementOfBuiltinComponent(node) {
38
+ return node.openingElement.name.type === NodeType.JSXIdentifier && node.openingElement.name.name.toLowerCase() === node.openingElement.name.name && /^[a-z]/u.test(node.openingElement.name.name);
39
+ }
13
40
 
14
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Function.js
41
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Function.js
15
42
  var Function_exports = {};
16
43
  __export(Function_exports, {
17
44
  SK: () => SK,
@@ -186,25 +213,164 @@ function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
186
213
  var hole = /* @__PURE__ */ unsafeCoerce(absurd);
187
214
  var SK = (_2, b2) => b2;
188
215
 
189
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Equivalence.js
216
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Array.js
217
+ var Array_exports = {};
218
+ __export(Array_exports, {
219
+ allocate: () => allocate,
220
+ append: () => append,
221
+ appendAll: () => appendAll,
222
+ cartesian: () => cartesian,
223
+ cartesianWith: () => cartesianWith,
224
+ chop: () => chop,
225
+ chunksOf: () => chunksOf,
226
+ contains: () => contains2,
227
+ containsWith: () => containsWith2,
228
+ copy: () => copy,
229
+ dedupe: () => dedupe,
230
+ dedupeAdjacent: () => dedupeAdjacent,
231
+ dedupeAdjacentWith: () => dedupeAdjacentWith,
232
+ dedupeWith: () => dedupeWith,
233
+ difference: () => difference,
234
+ differenceWith: () => differenceWith,
235
+ drop: () => drop,
236
+ dropRight: () => dropRight,
237
+ dropWhile: () => dropWhile,
238
+ empty: () => empty2,
239
+ every: () => every2,
240
+ extend: () => extend,
241
+ filter: () => filter2,
242
+ filterMap: () => filterMap2,
243
+ filterMapWhile: () => filterMapWhile,
244
+ findFirst: () => findFirst2,
245
+ findFirstIndex: () => findFirstIndex,
246
+ findLast: () => findLast,
247
+ findLastIndex: () => findLastIndex,
248
+ flatMap: () => flatMap2,
249
+ flatMapNullable: () => flatMapNullable2,
250
+ flatten: () => flatten2,
251
+ forEach: () => forEach,
252
+ fromIterable: () => fromIterable2,
253
+ fromNullable: () => fromNullable2,
254
+ fromOption: () => fromOption2,
255
+ fromRecord: () => fromRecord,
256
+ get: () => get,
257
+ getEquivalence: () => getEquivalence2,
258
+ getLefts: () => getLefts,
259
+ getOrder: () => getOrder2,
260
+ getRights: () => getRights,
261
+ getSomes: () => getSomes,
262
+ group: () => group,
263
+ groupBy: () => groupBy,
264
+ groupWith: () => groupWith,
265
+ head: () => head,
266
+ headNonEmpty: () => headNonEmpty,
267
+ init: () => init,
268
+ initNonEmpty: () => initNonEmpty,
269
+ insertAt: () => insertAt,
270
+ intersection: () => intersection,
271
+ intersectionWith: () => intersectionWith,
272
+ intersperse: () => intersperse,
273
+ isArray: () => isArray,
274
+ isEmptyArray: () => isEmptyArray,
275
+ isEmptyReadonlyArray: () => isEmptyReadonlyArray,
276
+ isNonEmptyArray: () => isNonEmptyArray2,
277
+ isNonEmptyReadonlyArray: () => isNonEmptyReadonlyArray,
278
+ join: () => join,
279
+ last: () => last,
280
+ lastNonEmpty: () => lastNonEmpty,
281
+ length: () => length,
282
+ liftEither: () => liftEither,
283
+ liftNullable: () => liftNullable2,
284
+ liftOption: () => liftOption,
285
+ liftPredicate: () => liftPredicate2,
286
+ make: () => make4,
287
+ makeBy: () => makeBy,
288
+ map: () => map2,
289
+ mapAccum: () => mapAccum,
290
+ match: () => match2,
291
+ matchLeft: () => matchLeft,
292
+ matchRight: () => matchRight,
293
+ max: () => max2,
294
+ min: () => min2,
295
+ modify: () => modify,
296
+ modifyNonEmptyHead: () => modifyNonEmptyHead,
297
+ modifyNonEmptyLast: () => modifyNonEmptyLast,
298
+ modifyOption: () => modifyOption,
299
+ of: () => of,
300
+ partition: () => partition,
301
+ partitionMap: () => partitionMap2,
302
+ prepend: () => prepend,
303
+ prependAll: () => prependAll,
304
+ range: () => range,
305
+ reduce: () => reduce,
306
+ reduceRight: () => reduceRight,
307
+ remove: () => remove,
308
+ replace: () => replace,
309
+ replaceOption: () => replaceOption,
310
+ replicate: () => replicate,
311
+ reverse: () => reverse,
312
+ rotate: () => rotate,
313
+ scan: () => scan,
314
+ scanRight: () => scanRight,
315
+ separate: () => separate,
316
+ setNonEmptyHead: () => setNonEmptyHead,
317
+ setNonEmptyLast: () => setNonEmptyLast,
318
+ some: () => some4,
319
+ sort: () => sort,
320
+ sortBy: () => sortBy,
321
+ sortWith: () => sortWith,
322
+ span: () => span,
323
+ split: () => split,
324
+ splitAt: () => splitAt,
325
+ splitNonEmptyAt: () => splitNonEmptyAt,
326
+ splitWhere: () => splitWhere,
327
+ tail: () => tail,
328
+ tailNonEmpty: () => tailNonEmpty,
329
+ take: () => take,
330
+ takeRight: () => takeRight,
331
+ takeWhile: () => takeWhile,
332
+ unappend: () => unappend,
333
+ unfold: () => unfold,
334
+ union: () => union,
335
+ unionWith: () => unionWith,
336
+ unprepend: () => unprepend,
337
+ unsafeGet: () => unsafeGet,
338
+ unzip: () => unzip,
339
+ zip: () => zip,
340
+ zipWith: () => zipWith2
341
+ });
342
+
343
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Equivalence.js
190
344
  var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
345
+ var array = (item) => make((self, that) => {
346
+ if (self.length !== that.length) {
347
+ return false;
348
+ }
349
+ for (let i2 = 0; i2 < self.length; i2++) {
350
+ const isEq = item(self[i2], that[i2]);
351
+ if (!isEq) {
352
+ return false;
353
+ }
354
+ }
355
+ return true;
356
+ });
191
357
 
192
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/doNotation.js
193
- var let_ = (map2) => dual(3, (self, name, f2) => map2(self, (a2) => Object.assign({}, a2, {
358
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/internal/doNotation.js
359
+ var let_ = (map3) => dual(3, (self, name, f2) => map3(self, (a2) => Object.assign({}, a2, {
194
360
  [name]: f2(a2)
195
361
  })));
196
- var bindTo = (map2) => dual(2, (self, name) => map2(self, (a2) => ({
362
+ var bindTo = (map3) => dual(2, (self, name) => map3(self, (a2) => ({
197
363
  [name]: a2
198
364
  })));
199
- var bind = (map2, flatMap2) => dual(3, (self, name, f2) => flatMap2(self, (a2) => map2(f2(a2), (b2) => Object.assign({}, a2, {
365
+ var bind = (map3, flatMap3) => dual(3, (self, name, f2) => flatMap3(self, (a2) => map3(f2(a2), (b2) => Object.assign({}, a2, {
200
366
  [name]: b2
201
367
  }))));
202
368
 
203
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/version.js
204
- var moduleVersion = "3.1.2";
369
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/internal/version.js
370
+ var moduleVersion = "3.1.5";
205
371
  var getCurrentVersion = () => moduleVersion;
206
372
 
207
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/GlobalValue.js
373
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/GlobalValue.js
208
374
  var globalStoreId = /* @__PURE__ */ Symbol.for(`effect/GlobalValue/globalStoreId/${/* @__PURE__ */ getCurrentVersion()}`);
209
375
  if (!(globalStoreId in globalThis)) {
210
376
  globalThis[globalStoreId] = /* @__PURE__ */ new Map();
@@ -217,7 +383,7 @@ var globalValue = (id, compute) => {
217
383
  return globalStore.get(id);
218
384
  };
219
385
 
220
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Predicate.js
386
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Predicate.js
221
387
  var Predicate_exports = {};
222
388
  __export(Predicate_exports, {
223
389
  all: () => all,
@@ -315,13 +481,13 @@ var all = (collection) => {
315
481
  };
316
482
  var productMany = (self, collection) => {
317
483
  const rest = all(collection);
318
- return ([head, ...tail]) => self(head) === false ? false : rest(tail);
484
+ return ([head2, ...tail2]) => self(head2) === false ? false : rest(tail2);
319
485
  };
320
486
  var tuple = (...elements) => all(elements);
321
487
  var struct = (fields) => {
322
- const keys = Object.keys(fields);
488
+ const keys2 = Object.keys(fields);
323
489
  return (a2) => {
324
- for (const key of keys) {
490
+ for (const key of keys2) {
325
491
  if (!fields[key](a2[key])) {
326
492
  return false;
327
493
  }
@@ -354,10 +520,10 @@ var some = (collection) => (a2) => {
354
520
  return false;
355
521
  };
356
522
 
357
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/errors.js
523
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/internal/errors.js
358
524
  var getBugErrorMessage = (message) => `BUG: ${message} - please report an issue at https://github.com/Effect-TS/effect/issues`;
359
525
 
360
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Utils.js
526
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Utils.js
361
527
  var GenKindTypeId = /* @__PURE__ */ Symbol.for("effect/Gen/GenKind");
362
528
  var isGenKind = (u2) => isObject(u2) && GenKindTypeId in u2;
363
529
  var GenKindImpl = class {
@@ -503,19 +669,19 @@ var PCGRandom = class {
503
669
  * @category getter
504
670
  * @since 2.0.0
505
671
  */
506
- integer(max) {
507
- if (!max) {
672
+ integer(max3) {
673
+ if (!max3) {
508
674
  return this._next();
509
675
  }
510
- max = max >>> 0;
511
- if ((max & max - 1) === 0) {
512
- return this._next() & max - 1;
676
+ max3 = max3 >>> 0;
677
+ if ((max3 & max3 - 1) === 0) {
678
+ return this._next() & max3 - 1;
513
679
  }
514
680
  let num = 0;
515
- const skew = (-max >>> 0) % max >>> 0;
681
+ const skew = (-max3 >>> 0) % max3 >>> 0;
516
682
  for (num = this._next(); num < skew; num = this._next()) {
517
683
  }
518
- return num % max;
684
+ return num % max3;
519
685
  }
520
686
  /**
521
687
  * Get a uniformly distributed IEEE-754 double between 0.0 and 1.0, with
@@ -601,11 +767,14 @@ var structuralRegionState = /* @__PURE__ */ globalValue("effect/Utils/isStructur
601
767
  tester: void 0
602
768
  }));
603
769
 
604
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Hash.js
770
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Hash.js
605
771
  var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => /* @__PURE__ */ new WeakMap());
606
772
  var pcgr = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/pcgr"), () => new PCGRandom());
607
773
  var symbol = /* @__PURE__ */ Symbol.for("effect/Hash");
608
774
  var hash = (self) => {
775
+ if (structuralRegionState.enabled === true) {
776
+ return 0;
777
+ }
609
778
  switch (typeof self) {
610
779
  case "number":
611
780
  return number(self);
@@ -635,9 +804,6 @@ var hash = (self) => {
635
804
  }
636
805
  };
637
806
  var random = (self) => {
638
- if (structuralRegionState.enabled === true) {
639
- return 0;
640
- }
641
807
  if (!randomHashCache.has(self)) {
642
808
  randomHashCache.set(self, number(pcgr.integer(Number.MAX_SAFE_INTEGER)));
643
809
  }
@@ -670,39 +836,27 @@ var cached = function() {
670
836
  if (arguments.length === 1) {
671
837
  const self2 = arguments[0];
672
838
  return function(hash3) {
673
- const original2 = self2[symbol].bind(self2);
674
- if (structuralRegionState.enabled === false) {
675
- Object.defineProperty(self2, symbol, {
676
- value() {
677
- if (structuralRegionState.enabled === true) {
678
- return original2();
679
- }
680
- return hash3;
681
- },
682
- enumerable: false
683
- });
684
- }
839
+ Object.defineProperty(self2, symbol, {
840
+ value() {
841
+ return hash3;
842
+ },
843
+ enumerable: false
844
+ });
685
845
  return hash3;
686
846
  };
687
847
  }
688
848
  const self = arguments[0];
689
849
  const hash2 = arguments[1];
690
- const original = self[symbol].bind(self);
691
- if (structuralRegionState.enabled === false) {
692
- Object.defineProperty(self, symbol, {
693
- value() {
694
- if (structuralRegionState.enabled === true) {
695
- return original();
696
- }
697
- return hash2;
698
- },
699
- enumerable: false
700
- });
701
- }
850
+ Object.defineProperty(self, symbol, {
851
+ value() {
852
+ return hash2;
853
+ },
854
+ enumerable: false
855
+ });
702
856
  return hash2;
703
857
  };
704
858
 
705
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Equal.js
859
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Equal.js
706
860
  var symbol2 = /* @__PURE__ */ Symbol.for("effect/Equal");
707
861
  function equals() {
708
862
  if (arguments.length === 1) {
@@ -721,7 +875,11 @@ function compareBoth(self, that) {
721
875
  if (selfType === "object" || selfType === "function") {
722
876
  if (self !== null && that !== null) {
723
877
  if (isEqual(self) && isEqual(that)) {
724
- return hash(self) === hash(that) && self[symbol2](that);
878
+ if (hash(self) === hash(that) && self[symbol2](that)) {
879
+ return true;
880
+ } else {
881
+ return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
882
+ }
725
883
  }
726
884
  }
727
885
  if (structuralRegionState.enabled) {
@@ -748,7 +906,7 @@ function compareBoth(self, that) {
748
906
  var isEqual = (u2) => hasProperty(u2, symbol2);
749
907
  var equivalence = () => equals;
750
908
 
751
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Inspectable.js
909
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Inspectable.js
752
910
  var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
753
911
  var toJSON = (x2) => {
754
912
  if (hasProperty(x2, "toJSON") && isFunction2(x2["toJSON"]) && x2["toJSON"].length === 0) {
@@ -760,7 +918,7 @@ var toJSON = (x2) => {
760
918
  };
761
919
  var format = (x2) => JSON.stringify(x2, null, 2);
762
920
 
763
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Pipeable.js
921
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Pipeable.js
764
922
  var pipeArguments = (self, args) => {
765
923
  switch (args.length) {
766
924
  case 1:
@@ -791,7 +949,7 @@ var pipeArguments = (self, args) => {
791
949
  }
792
950
  };
793
951
 
794
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/effectable.js
952
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/internal/effectable.js
795
953
  var EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
796
954
  var StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
797
955
  var SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
@@ -852,7 +1010,7 @@ var EffectPrototype = {
852
1010
  }
853
1011
  };
854
1012
 
855
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/option.js
1013
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/internal/option.js
856
1014
  var TypeId = /* @__PURE__ */ Symbol.for("effect/Option");
857
1015
  var CommonProto = {
858
1016
  ...EffectPrototype,
@@ -870,7 +1028,7 @@ var SomeProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(Comm
870
1028
  _tag: "Some",
871
1029
  _op: "Some",
872
1030
  [symbol2](that) {
873
- return isOption(that) && isSome(that) && equals(that.value, this.value);
1031
+ return isOption(that) && isSome(that) && equals(this.value, that.value);
874
1032
  },
875
1033
  [symbol]() {
876
1034
  return cached(this, combine(hash(this._tag))(hash(this.value)));
@@ -910,7 +1068,7 @@ var some2 = (value) => {
910
1068
  return a2;
911
1069
  };
912
1070
 
913
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/either.js
1071
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/internal/either.js
914
1072
  var TypeId2 = /* @__PURE__ */ Symbol.for("effect/Either");
915
1073
  var CommonProto2 = {
916
1074
  ...EffectPrototype,
@@ -928,7 +1086,7 @@ var RightProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(Com
928
1086
  _tag: "Right",
929
1087
  _op: "Right",
930
1088
  [symbol2](that) {
931
- return isEither(that) && isRight(that) && equals(that.right, this.right);
1089
+ return isEither(that) && isRight(that) && equals(this.right, that.right);
932
1090
  },
933
1091
  [symbol]() {
934
1092
  return combine(hash(this._tag))(hash(this.right));
@@ -945,7 +1103,7 @@ var LeftProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(Comm
945
1103
  _tag: "Left",
946
1104
  _op: "Left",
947
1105
  [symbol2](that) {
948
- return isEither(that) && isLeft(that) && equals(that.left, this.left);
1106
+ return isEither(that) && isLeft(that) && equals(this.left, that.left);
949
1107
  },
950
1108
  [symbol]() {
951
1109
  return combine(hash(this._tag))(hash(this.left));
@@ -974,7 +1132,14 @@ var right = (right2) => {
974
1132
  var getLeft = (self) => isRight(self) ? none : some2(self.left);
975
1133
  var getRight = (self) => isLeft(self) ? none : some2(self.right);
976
1134
 
977
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Option.js
1135
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Either.js
1136
+ var isLeft2 = isLeft;
1137
+ var isRight2 = isRight;
1138
+
1139
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/internal/array.js
1140
+ var isNonEmptyArray = (self) => self.length > 0;
1141
+
1142
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Option.js
978
1143
  var Option_exports = {};
979
1144
  __export(Option_exports, {
980
1145
  Do: () => Do,
@@ -1036,10 +1201,41 @@ __export(Option_exports, {
1036
1201
  zipWith: () => zipWith
1037
1202
  });
1038
1203
 
1039
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Order.js
1204
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Order.js
1040
1205
  var make2 = (compare) => (self, that) => self === that ? 0 : compare(self, that);
1206
+ var number2 = /* @__PURE__ */ make2((self, that) => self < that ? -1 : 1);
1207
+ var combineMany = /* @__PURE__ */ dual(2, (self, collection) => make2((a1, a2) => {
1208
+ let out = self(a1, a2);
1209
+ if (out !== 0) {
1210
+ return out;
1211
+ }
1212
+ for (const O2 of collection) {
1213
+ out = O2(a1, a2);
1214
+ if (out !== 0) {
1215
+ return out;
1216
+ }
1217
+ }
1218
+ return out;
1219
+ }));
1220
+ var empty = () => make2(() => 0);
1221
+ var combineAll = (collection) => combineMany(empty(), collection);
1222
+ var mapInput2 = /* @__PURE__ */ dual(2, (self, f2) => make2((b1, b2) => self(f2(b1), f2(b2))));
1223
+ var array2 = (O2) => make2((self, that) => {
1224
+ const aLen = self.length;
1225
+ const bLen = that.length;
1226
+ const len = Math.min(aLen, bLen);
1227
+ for (let i2 = 0; i2 < len; i2++) {
1228
+ const o2 = O2(self[i2], that[i2]);
1229
+ if (o2 !== 0) {
1230
+ return o2;
1231
+ }
1232
+ }
1233
+ return number2(aLen, bLen);
1234
+ });
1235
+ var min = (O2) => dual(2, (self, that) => self === that || O2(self, that) < 1 ? self : that);
1236
+ var max = (O2) => dual(2, (self, that) => self === that || O2(self, that) > -1 ? self : that);
1041
1237
 
1042
- // ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Option.js
1238
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Option.js
1043
1239
  var TypeId3 = /* @__PURE__ */ Symbol.for("effect/Option");
1044
1240
  var none2 = () => none;
1045
1241
  var some3 = some2;
@@ -1206,32 +1402,598 @@ var gen = (f2) => {
1206
1402
  return some3(state.value);
1207
1403
  }
1208
1404
  };
1405
+
1406
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Tuple.js
1407
+ var make3 = (...elements) => elements;
1408
+
1409
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Iterable.js
1410
+ var findFirst = /* @__PURE__ */ dual(2, (self, f2) => {
1411
+ let i2 = 0;
1412
+ for (const a2 of self) {
1413
+ const o2 = f2(a2, i2);
1414
+ if (isBoolean(o2)) {
1415
+ if (o2) {
1416
+ return some3(a2);
1417
+ }
1418
+ } else {
1419
+ if (isSome2(o2)) {
1420
+ return o2;
1421
+ }
1422
+ }
1423
+ i2++;
1424
+ }
1425
+ return none2();
1426
+ });
1427
+
1428
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Record.js
1429
+ var collect = /* @__PURE__ */ dual(2, (self, f2) => {
1430
+ const out = [];
1431
+ for (const key of keys(self)) {
1432
+ out.push(f2(key, self[key]));
1433
+ }
1434
+ return out;
1435
+ });
1436
+ var toEntries = /* @__PURE__ */ collect((key, value) => [key, value]);
1437
+ var keys = (self) => Object.keys(self);
1438
+
1439
+ // ../../../node_modules/.pnpm/effect@3.1.5/node_modules/effect/dist/esm/Array.js
1440
+ var make4 = (...elements) => elements;
1441
+ var allocate = (n2) => new Array(n2);
1442
+ var makeBy = (n2, f2) => {
1443
+ const max3 = Math.max(1, Math.floor(n2));
1444
+ const out = new Array(max3);
1445
+ for (let i2 = 0; i2 < max3; i2++) {
1446
+ out[i2] = f2(i2);
1447
+ }
1448
+ return out;
1449
+ };
1450
+ var range = (start, end) => start <= end ? makeBy(end - start + 1, (i2) => start + i2) : [start];
1451
+ var replicate = /* @__PURE__ */ dual(2, (a2, n2) => makeBy(n2, () => a2));
1452
+ var fromIterable2 = (collection) => Array.isArray(collection) ? collection : Array.from(collection);
1453
+ var fromRecord = toEntries;
1454
+ var fromOption2 = toArray;
1455
+ var match2 = /* @__PURE__ */ dual(2, (self, {
1456
+ onEmpty,
1457
+ onNonEmpty
1458
+ }) => isNonEmptyReadonlyArray(self) ? onNonEmpty(self) : onEmpty());
1459
+ var matchLeft = /* @__PURE__ */ dual(2, (self, {
1460
+ onEmpty,
1461
+ onNonEmpty
1462
+ }) => isNonEmptyReadonlyArray(self) ? onNonEmpty(headNonEmpty(self), tailNonEmpty(self)) : onEmpty());
1463
+ var matchRight = /* @__PURE__ */ dual(2, (self, {
1464
+ onEmpty,
1465
+ onNonEmpty
1466
+ }) => isNonEmptyReadonlyArray(self) ? onNonEmpty(initNonEmpty(self), lastNonEmpty(self)) : onEmpty());
1467
+ var prepend = /* @__PURE__ */ dual(2, (self, head2) => [head2, ...self]);
1468
+ var prependAll = /* @__PURE__ */ dual(2, (self, that) => fromIterable2(that).concat(fromIterable2(self)));
1469
+ var append = /* @__PURE__ */ dual(2, (self, last2) => [...self, last2]);
1470
+ var appendAll = /* @__PURE__ */ dual(2, (self, that) => fromIterable2(self).concat(fromIterable2(that)));
1471
+ var scan = /* @__PURE__ */ dual(3, (self, b2, f2) => {
1472
+ const out = [b2];
1473
+ let i2 = 0;
1474
+ for (const a2 of self) {
1475
+ out[i2 + 1] = f2(out[i2], a2);
1476
+ i2++;
1477
+ }
1478
+ return out;
1479
+ });
1480
+ var scanRight = /* @__PURE__ */ dual(3, (self, b2, f2) => {
1481
+ const input = fromIterable2(self);
1482
+ const out = new Array(input.length + 1);
1483
+ out[input.length] = b2;
1484
+ for (let i2 = input.length - 1; i2 >= 0; i2--) {
1485
+ out[i2] = f2(out[i2 + 1], input[i2]);
1486
+ }
1487
+ return out;
1488
+ });
1489
+ var isArray = Array.isArray;
1490
+ var isEmptyArray = (self) => self.length === 0;
1491
+ var isEmptyReadonlyArray = isEmptyArray;
1492
+ var isNonEmptyArray2 = isNonEmptyArray;
1493
+ var isNonEmptyReadonlyArray = isNonEmptyArray;
1494
+ var length = (self) => self.length;
1495
+ var isOutOfBound = (i2, as2) => i2 < 0 || i2 >= as2.length;
1496
+ var clamp = (i2, as2) => Math.floor(Math.min(Math.max(0, i2), as2.length));
1497
+ var get = /* @__PURE__ */ dual(2, (self, index) => {
1498
+ const i2 = Math.floor(index);
1499
+ return isOutOfBound(i2, self) ? none2() : some3(self[i2]);
1500
+ });
1501
+ var unsafeGet = /* @__PURE__ */ dual(2, (self, index) => {
1502
+ const i2 = Math.floor(index);
1503
+ if (isOutOfBound(i2, self)) {
1504
+ throw new Error(`Index ${i2} out of bounds`);
1505
+ }
1506
+ return self[i2];
1507
+ });
1508
+ var unprepend = (self) => [headNonEmpty(self), tailNonEmpty(self)];
1509
+ var unappend = (self) => [initNonEmpty(self), lastNonEmpty(self)];
1510
+ var head = /* @__PURE__ */ get(0);
1511
+ var headNonEmpty = /* @__PURE__ */ unsafeGet(0);
1512
+ var last = (self) => isNonEmptyReadonlyArray(self) ? some3(lastNonEmpty(self)) : none2();
1513
+ var lastNonEmpty = (self) => self[self.length - 1];
1514
+ var tail = (self) => {
1515
+ const input = fromIterable2(self);
1516
+ return isNonEmptyReadonlyArray(input) ? some3(tailNonEmpty(input)) : none2();
1517
+ };
1518
+ var tailNonEmpty = (self) => self.slice(1);
1519
+ var init = (self) => {
1520
+ const input = fromIterable2(self);
1521
+ return isNonEmptyReadonlyArray(input) ? some3(initNonEmpty(input)) : none2();
1522
+ };
1523
+ var initNonEmpty = (self) => self.slice(0, -1);
1524
+ var take = /* @__PURE__ */ dual(2, (self, n2) => {
1525
+ const input = fromIterable2(self);
1526
+ return input.slice(0, clamp(n2, input));
1527
+ });
1528
+ var takeRight = /* @__PURE__ */ dual(2, (self, n2) => {
1529
+ const input = fromIterable2(self);
1530
+ const i2 = clamp(n2, input);
1531
+ return i2 === 0 ? [] : input.slice(-i2);
1532
+ });
1533
+ var takeWhile = /* @__PURE__ */ dual(2, (self, predicate) => {
1534
+ let i2 = 0;
1535
+ const out = [];
1536
+ for (const a2 of self) {
1537
+ if (!predicate(a2, i2)) {
1538
+ break;
1539
+ }
1540
+ out.push(a2);
1541
+ i2++;
1542
+ }
1543
+ return out;
1544
+ });
1545
+ var spanIndex = (self, predicate) => {
1546
+ let i2 = 0;
1547
+ for (const a2 of self) {
1548
+ if (!predicate(a2, i2)) {
1549
+ break;
1550
+ }
1551
+ i2++;
1552
+ }
1553
+ return i2;
1554
+ };
1555
+ var span = /* @__PURE__ */ dual(2, (self, predicate) => splitAt(self, spanIndex(self, predicate)));
1556
+ var drop = /* @__PURE__ */ dual(2, (self, n2) => {
1557
+ const input = fromIterable2(self);
1558
+ return input.slice(clamp(n2, input), input.length);
1559
+ });
1560
+ var dropRight = /* @__PURE__ */ dual(2, (self, n2) => {
1561
+ const input = fromIterable2(self);
1562
+ return input.slice(0, input.length - clamp(n2, input));
1563
+ });
1564
+ var dropWhile = /* @__PURE__ */ dual(2, (self, predicate) => fromIterable2(self).slice(spanIndex(self, predicate)));
1565
+ var findFirstIndex = /* @__PURE__ */ dual(2, (self, predicate) => {
1566
+ let i2 = 0;
1567
+ for (const a2 of self) {
1568
+ if (predicate(a2, i2)) {
1569
+ return some3(i2);
1570
+ }
1571
+ i2++;
1572
+ }
1573
+ return none2();
1574
+ });
1575
+ var findLastIndex = /* @__PURE__ */ dual(2, (self, predicate) => {
1576
+ const input = fromIterable2(self);
1577
+ for (let i2 = input.length - 1; i2 >= 0; i2--) {
1578
+ if (predicate(input[i2], i2)) {
1579
+ return some3(i2);
1580
+ }
1581
+ }
1582
+ return none2();
1583
+ });
1584
+ var findFirst2 = findFirst;
1585
+ var findLast = /* @__PURE__ */ dual(2, (self, f2) => {
1586
+ const input = fromIterable2(self);
1587
+ for (let i2 = input.length - 1; i2 >= 0; i2--) {
1588
+ const a2 = input[i2];
1589
+ const o2 = f2(a2, i2);
1590
+ if (isBoolean(o2)) {
1591
+ if (o2) {
1592
+ return some3(a2);
1593
+ }
1594
+ } else {
1595
+ if (isSome2(o2)) {
1596
+ return o2;
1597
+ }
1598
+ }
1599
+ }
1600
+ return none2();
1601
+ });
1602
+ var insertAt = /* @__PURE__ */ dual(3, (self, i2, b2) => {
1603
+ const out = Array.from(self);
1604
+ if (i2 < 0 || i2 > out.length) {
1605
+ return none2();
1606
+ }
1607
+ out.splice(i2, 0, b2);
1608
+ return some3(out);
1609
+ });
1610
+ var replace = /* @__PURE__ */ dual(3, (self, i2, b2) => modify(self, i2, () => b2));
1611
+ var replaceOption = /* @__PURE__ */ dual(3, (self, i2, b2) => modifyOption(self, i2, () => b2));
1612
+ var modify = /* @__PURE__ */ dual(3, (self, i2, f2) => getOrElse(modifyOption(self, i2, f2), () => Array.from(self)));
1613
+ var modifyOption = /* @__PURE__ */ dual(3, (self, i2, f2) => {
1614
+ const out = Array.from(self);
1615
+ if (isOutOfBound(i2, out)) {
1616
+ return none2();
1617
+ }
1618
+ const next = f2(out[i2]);
1619
+ out[i2] = next;
1620
+ return some3(out);
1621
+ });
1622
+ var remove = /* @__PURE__ */ dual(2, (self, i2) => {
1623
+ const out = Array.from(self);
1624
+ if (isOutOfBound(i2, out)) {
1625
+ return out;
1626
+ }
1627
+ out.splice(i2, 1);
1628
+ return out;
1629
+ });
1630
+ var reverse = (self) => Array.from(self).reverse();
1631
+ var sort = /* @__PURE__ */ dual(2, (self, O2) => {
1632
+ const out = Array.from(self);
1633
+ out.sort(O2);
1634
+ return out;
1635
+ });
1636
+ var sortWith = /* @__PURE__ */ dual(3, (self, f2, order) => sort(self, mapInput2(order, f2)));
1637
+ var sortBy = (...orders) => {
1638
+ const sortByAll = sort(combineAll(orders));
1639
+ return (self) => {
1640
+ const input = fromIterable2(self);
1641
+ if (isNonEmptyReadonlyArray(input)) {
1642
+ return sortByAll(input);
1643
+ }
1644
+ return [];
1645
+ };
1646
+ };
1647
+ var zip = /* @__PURE__ */ dual(2, (self, that) => zipWith2(self, that, make3));
1648
+ var zipWith2 = /* @__PURE__ */ dual(3, (self, that, f2) => {
1649
+ const as2 = fromIterable2(self);
1650
+ const bs = fromIterable2(that);
1651
+ if (isNonEmptyReadonlyArray(as2) && isNonEmptyReadonlyArray(bs)) {
1652
+ const out = [f2(headNonEmpty(as2), headNonEmpty(bs))];
1653
+ const len = Math.min(as2.length, bs.length);
1654
+ for (let i2 = 1; i2 < len; i2++) {
1655
+ out[i2] = f2(as2[i2], bs[i2]);
1656
+ }
1657
+ return out;
1658
+ }
1659
+ return [];
1660
+ });
1661
+ var unzip = (self) => {
1662
+ const input = fromIterable2(self);
1663
+ if (isNonEmptyReadonlyArray(input)) {
1664
+ const fa = [input[0][0]];
1665
+ const fb = [input[0][1]];
1666
+ for (let i2 = 1; i2 < input.length; i2++) {
1667
+ fa[i2] = input[i2][0];
1668
+ fb[i2] = input[i2][1];
1669
+ }
1670
+ return [fa, fb];
1671
+ }
1672
+ return [[], []];
1673
+ };
1674
+ var intersperse = /* @__PURE__ */ dual(2, (self, middle) => {
1675
+ const input = fromIterable2(self);
1676
+ if (isNonEmptyReadonlyArray(input)) {
1677
+ const out = [headNonEmpty(input)];
1678
+ const tail2 = tailNonEmpty(input);
1679
+ for (let i2 = 0; i2 < tail2.length; i2++) {
1680
+ if (i2 < tail2.length) {
1681
+ out.push(middle);
1682
+ }
1683
+ out.push(tail2[i2]);
1684
+ }
1685
+ return out;
1686
+ }
1687
+ return [];
1688
+ });
1689
+ var modifyNonEmptyHead = /* @__PURE__ */ dual(2, (self, f2) => [f2(headNonEmpty(self)), ...tailNonEmpty(self)]);
1690
+ var setNonEmptyHead = /* @__PURE__ */ dual(2, (self, b2) => modifyNonEmptyHead(self, () => b2));
1691
+ var modifyNonEmptyLast = /* @__PURE__ */ dual(2, (self, f2) => append(initNonEmpty(self), f2(lastNonEmpty(self))));
1692
+ var setNonEmptyLast = /* @__PURE__ */ dual(2, (self, b2) => modifyNonEmptyLast(self, () => b2));
1693
+ var rotate = /* @__PURE__ */ dual(2, (self, n2) => {
1694
+ const input = fromIterable2(self);
1695
+ if (isNonEmptyReadonlyArray(input)) {
1696
+ const len = input.length;
1697
+ const m2 = Math.round(n2) % len;
1698
+ if (isOutOfBound(Math.abs(m2), input) || m2 === 0) {
1699
+ return copy(input);
1700
+ }
1701
+ if (m2 < 0) {
1702
+ const [f2, s2] = splitNonEmptyAt(input, -m2);
1703
+ return appendAll(s2, f2);
1704
+ } else {
1705
+ return rotate(self, m2 - len);
1706
+ }
1707
+ }
1708
+ return [];
1709
+ });
1710
+ var containsWith2 = (isEquivalent) => dual(2, (self, a2) => {
1711
+ for (const i2 of self) {
1712
+ if (isEquivalent(a2, i2)) {
1713
+ return true;
1714
+ }
1715
+ }
1716
+ return false;
1717
+ });
1718
+ var _equivalence2 = /* @__PURE__ */ equivalence();
1719
+ var contains2 = /* @__PURE__ */ containsWith2(_equivalence2);
1720
+ var chop = /* @__PURE__ */ dual(2, (self, f2) => {
1721
+ const input = fromIterable2(self);
1722
+ if (isNonEmptyReadonlyArray(input)) {
1723
+ const [b2, rest] = f2(input);
1724
+ const out = [b2];
1725
+ let next = rest;
1726
+ while (isNonEmptyArray(next)) {
1727
+ const [b3, rest2] = f2(next);
1728
+ out.push(b3);
1729
+ next = rest2;
1730
+ }
1731
+ return out;
1732
+ }
1733
+ return [];
1734
+ });
1735
+ var splitAt = /* @__PURE__ */ dual(2, (self, n2) => {
1736
+ const input = Array.from(self);
1737
+ const _n = Math.floor(n2);
1738
+ if (isNonEmptyReadonlyArray(input)) {
1739
+ if (_n >= 1) {
1740
+ return splitNonEmptyAt(input, _n);
1741
+ }
1742
+ return [[], input];
1743
+ }
1744
+ return [input, []];
1745
+ });
1746
+ var splitNonEmptyAt = /* @__PURE__ */ dual(2, (self, n2) => {
1747
+ const _n = Math.max(1, Math.floor(n2));
1748
+ return _n >= self.length ? [copy(self), []] : [prepend(self.slice(1, _n), headNonEmpty(self)), self.slice(_n)];
1749
+ });
1750
+ var split = /* @__PURE__ */ dual(2, (self, n2) => {
1751
+ const input = fromIterable2(self);
1752
+ return chunksOf(input, Math.ceil(input.length / Math.floor(n2)));
1753
+ });
1754
+ var splitWhere = /* @__PURE__ */ dual(2, (self, predicate) => span(self, (a2, i2) => !predicate(a2, i2)));
1755
+ var copy = (self) => self.slice();
1756
+ var chunksOf = /* @__PURE__ */ dual(2, (self, n2) => {
1757
+ const input = fromIterable2(self);
1758
+ if (isNonEmptyReadonlyArray(input)) {
1759
+ return chop(input, splitNonEmptyAt(n2));
1760
+ }
1761
+ return [];
1762
+ });
1763
+ var groupWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => chop(self, (as2) => {
1764
+ const h2 = headNonEmpty(as2);
1765
+ const out = [h2];
1766
+ let i2 = 1;
1767
+ for (; i2 < as2.length; i2++) {
1768
+ const a2 = as2[i2];
1769
+ if (isEquivalent(a2, h2)) {
1770
+ out.push(a2);
1771
+ } else {
1772
+ break;
1773
+ }
1774
+ }
1775
+ return [out, as2.slice(i2)];
1776
+ }));
1777
+ var group = /* @__PURE__ */ groupWith(/* @__PURE__ */ equivalence());
1778
+ var groupBy = /* @__PURE__ */ dual(2, (self, f2) => {
1779
+ const out = {};
1780
+ for (const a2 of self) {
1781
+ const k2 = f2(a2);
1782
+ if (Object.prototype.hasOwnProperty.call(out, k2)) {
1783
+ out[k2].push(a2);
1784
+ } else {
1785
+ out[k2] = [a2];
1786
+ }
1787
+ }
1788
+ return out;
1789
+ });
1790
+ var unionWith = /* @__PURE__ */ dual(3, (self, that, isEquivalent) => {
1791
+ const a2 = fromIterable2(self);
1792
+ const b2 = fromIterable2(that);
1793
+ if (isNonEmptyReadonlyArray(a2)) {
1794
+ if (isNonEmptyReadonlyArray(b2)) {
1795
+ const dedupe2 = dedupeWith(isEquivalent);
1796
+ return dedupe2(appendAll(a2, b2));
1797
+ }
1798
+ return a2;
1799
+ }
1800
+ return b2;
1801
+ });
1802
+ var union = /* @__PURE__ */ dual(2, (self, that) => unionWith(self, that, _equivalence2));
1803
+ var intersectionWith = (isEquivalent) => {
1804
+ const has = containsWith2(isEquivalent);
1805
+ return dual(2, (self, that) => fromIterable2(self).filter((a2) => has(that, a2)));
1806
+ };
1807
+ var intersection = /* @__PURE__ */ intersectionWith(_equivalence2);
1808
+ var differenceWith = (isEquivalent) => {
1809
+ const has = containsWith2(isEquivalent);
1810
+ return dual(2, (self, that) => fromIterable2(self).filter((a2) => !has(that, a2)));
1811
+ };
1812
+ var difference = /* @__PURE__ */ differenceWith(_equivalence2);
1813
+ var empty2 = () => [];
1814
+ var of = (a2) => [a2];
1815
+ var map2 = /* @__PURE__ */ dual(2, (self, f2) => self.map(f2));
1816
+ var flatMap2 = /* @__PURE__ */ dual(2, (self, f2) => {
1817
+ if (isEmptyReadonlyArray(self)) {
1818
+ return [];
1819
+ }
1820
+ const out = [];
1821
+ for (let i2 = 0; i2 < self.length; i2++) {
1822
+ const inner = f2(self[i2], i2);
1823
+ for (let j2 = 0; j2 < inner.length; j2++) {
1824
+ out.push(inner[j2]);
1825
+ }
1826
+ }
1827
+ return out;
1828
+ });
1829
+ var flatten2 = /* @__PURE__ */ flatMap2(identity);
1830
+ var filterMap2 = /* @__PURE__ */ dual(2, (self, f2) => {
1831
+ const as2 = fromIterable2(self);
1832
+ const out = [];
1833
+ for (let i2 = 0; i2 < as2.length; i2++) {
1834
+ const o2 = f2(as2[i2], i2);
1835
+ if (isSome2(o2)) {
1836
+ out.push(o2.value);
1837
+ }
1838
+ }
1839
+ return out;
1840
+ });
1841
+ var filterMapWhile = /* @__PURE__ */ dual(2, (self, f2) => {
1842
+ let i2 = 0;
1843
+ const out = [];
1844
+ for (const a2 of self) {
1845
+ const b2 = f2(a2, i2);
1846
+ if (isSome2(b2)) {
1847
+ out.push(b2.value);
1848
+ } else {
1849
+ break;
1850
+ }
1851
+ i2++;
1852
+ }
1853
+ return out;
1854
+ });
1855
+ var partitionMap2 = /* @__PURE__ */ dual(2, (self, f2) => {
1856
+ const left2 = [];
1857
+ const right2 = [];
1858
+ const as2 = fromIterable2(self);
1859
+ for (let i2 = 0; i2 < as2.length; i2++) {
1860
+ const e2 = f2(as2[i2], i2);
1861
+ if (isLeft2(e2)) {
1862
+ left2.push(e2.left);
1863
+ } else {
1864
+ right2.push(e2.right);
1865
+ }
1866
+ }
1867
+ return [left2, right2];
1868
+ });
1869
+ var getSomes = /* @__PURE__ */ filterMap2(identity);
1870
+ var getLefts = (self) => {
1871
+ const out = [];
1872
+ for (const a2 of self) {
1873
+ if (isLeft2(a2)) {
1874
+ out.push(a2.left);
1875
+ }
1876
+ }
1877
+ return out;
1878
+ };
1879
+ var getRights = (self) => {
1880
+ const out = [];
1881
+ for (const a2 of self) {
1882
+ if (isRight2(a2)) {
1883
+ out.push(a2.right);
1884
+ }
1885
+ }
1886
+ return out;
1887
+ };
1888
+ var filter2 = /* @__PURE__ */ dual(2, (self, predicate) => {
1889
+ const as2 = fromIterable2(self);
1890
+ const out = [];
1891
+ for (let i2 = 0; i2 < as2.length; i2++) {
1892
+ if (predicate(as2[i2], i2)) {
1893
+ out.push(as2[i2]);
1894
+ }
1895
+ }
1896
+ return out;
1897
+ });
1898
+ var partition = /* @__PURE__ */ dual(2, (self, predicate) => {
1899
+ const left2 = [];
1900
+ const right2 = [];
1901
+ const as2 = fromIterable2(self);
1902
+ for (let i2 = 0; i2 < as2.length; i2++) {
1903
+ if (predicate(as2[i2], i2)) {
1904
+ right2.push(as2[i2]);
1905
+ } else {
1906
+ left2.push(as2[i2]);
1907
+ }
1908
+ }
1909
+ return [left2, right2];
1910
+ });
1911
+ var separate = /* @__PURE__ */ partitionMap2(identity);
1912
+ var reduce = /* @__PURE__ */ dual(3, (self, b2, f2) => fromIterable2(self).reduce((b3, a2, i2) => f2(b3, a2, i2), b2));
1913
+ var reduceRight = /* @__PURE__ */ dual(3, (self, b2, f2) => fromIterable2(self).reduceRight((b3, a2, i2) => f2(b3, a2, i2), b2));
1914
+ var liftPredicate2 = (predicate) => (b2) => predicate(b2) ? [b2] : [];
1915
+ var liftOption = (f2) => (...a2) => fromOption2(f2(...a2));
1916
+ var fromNullable2 = (a2) => a2 == null ? empty2() : [a2];
1917
+ var liftNullable2 = (f2) => (...a2) => fromNullable2(f2(...a2));
1918
+ var flatMapNullable2 = /* @__PURE__ */ dual(2, (self, f2) => isNonEmptyReadonlyArray(self) ? fromNullable2(f2(headNonEmpty(self))) : empty2());
1919
+ var liftEither = (f2) => (...a2) => {
1920
+ const e2 = f2(...a2);
1921
+ return isLeft2(e2) ? [] : [e2.right];
1922
+ };
1923
+ var every2 = /* @__PURE__ */ dual(2, (self, refinement) => self.every(refinement));
1924
+ var some4 = /* @__PURE__ */ dual(2, (self, predicate) => self.some(predicate));
1925
+ var extend = /* @__PURE__ */ dual(2, (self, f2) => self.map((_2, i2, as2) => f2(as2.slice(i2))));
1926
+ var min2 = /* @__PURE__ */ dual(2, (self, O2) => self.reduce(min(O2)));
1927
+ var max2 = /* @__PURE__ */ dual(2, (self, O2) => self.reduce(max(O2)));
1928
+ var unfold = (b2, f2) => {
1929
+ const out = [];
1930
+ let next = b2;
1931
+ let o2;
1932
+ while (isSome2(o2 = f2(next))) {
1933
+ const [a2, b3] = o2.value;
1934
+ out.push(a2);
1935
+ next = b3;
1936
+ }
1937
+ return out;
1938
+ };
1939
+ var getOrder2 = array2;
1940
+ var getEquivalence2 = array;
1941
+ var forEach = /* @__PURE__ */ dual(2, (self, f2) => fromIterable2(self).forEach((a2, i2) => f2(a2, i2)));
1942
+ var dedupeWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
1943
+ const input = fromIterable2(self);
1944
+ if (isNonEmptyReadonlyArray(input)) {
1945
+ const out = [headNonEmpty(input)];
1946
+ const rest = tailNonEmpty(input);
1947
+ for (const r2 of rest) {
1948
+ if (out.every((a2) => !isEquivalent(r2, a2))) {
1949
+ out.push(r2);
1950
+ }
1951
+ }
1952
+ return out;
1953
+ }
1954
+ return [];
1955
+ });
1956
+ var dedupe = (self) => dedupeWith(self, equivalence());
1957
+ var dedupeAdjacentWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
1958
+ const out = [];
1959
+ let lastA = none2();
1960
+ for (const a2 of self) {
1961
+ if (isNone2(lastA) || !isEquivalent(a2, lastA.value)) {
1962
+ out.push(a2);
1963
+ lastA = some3(a2);
1964
+ }
1965
+ }
1966
+ return out;
1967
+ });
1968
+ var dedupeAdjacent = /* @__PURE__ */ dedupeAdjacentWith(/* @__PURE__ */ equivalence());
1969
+ var join = /* @__PURE__ */ dual(2, (self, sep) => fromIterable2(self).join(sep));
1970
+ var mapAccum = /* @__PURE__ */ dual(3, (self, s2, f2) => {
1971
+ let i2 = 0;
1972
+ let s1 = s2;
1973
+ const out = [];
1974
+ for (const a2 of self) {
1975
+ const r2 = f2(s1, a2, i2);
1976
+ s1 = r2[0];
1977
+ out.push(r2[1]);
1978
+ i2++;
1979
+ }
1980
+ return [s1, out];
1981
+ });
1982
+ var cartesianWith = /* @__PURE__ */ dual(3, (self, that, f2) => flatMap2(self, (a2) => map2(that, (b2) => f2(a2, b2))));
1983
+ var cartesian = /* @__PURE__ */ dual(2, (self, that) => cartesianWith(self, that, (a2, b2) => [a2, b2]));
1984
+
1985
+ // src/pragma.ts
1209
1986
  var RE_JSX_ANNOTATION_REGEX = /@jsx\s+(\S+)/u;
1210
1987
  var RE_JS_IDENTIFIER_REGEX = /^[$A-Z_a-z][\w$]*$/u;
1211
- function getFragmentFromContext(context) {
1212
- const settings = parseSchema(ESLintSettingsSchema, context.settings);
1213
- const fragment = settings.reactOptions?.jsxPragmaFrag;
1214
- if (Predicate_exports.isString(fragment) && RE_JS_IDENTIFIER_REGEX.test(fragment))
1215
- return fragment;
1216
- return "Fragment";
1988
+ function getJSXPragmaFromContext(context) {
1989
+ const { sourceCode } = context;
1990
+ return Function_exports.pipe(
1991
+ Array_exports.findFirst(sourceCode.getAllComments(), (node) => RE_JSX_ANNOTATION_REGEX.test(node.value)),
1992
+ Option_exports.map(({ value }) => RE_JSX_ANNOTATION_REGEX.exec(value)),
1993
+ Option_exports.flatMapNullable((matches) => matches?.[1]),
1994
+ Option_exports.filter((pragma) => RE_JS_IDENTIFIER_REGEX.test(pragma))
1995
+ );
1217
1996
  }
1218
- var getPragmaFromContext = memo(
1219
- (context) => {
1220
- const settings = parseSchema(ESLintSettingsSchema, context.settings);
1221
- const pragma = settings.reactOptions?.jsxPragma;
1222
- const { sourceCode } = context;
1223
- const pragmaNode = sourceCode.getAllComments().find((node) => RE_JSX_ANNOTATION_REGEX.test(node.value));
1224
- return Function_exports.pipe(
1225
- Option_exports.orElse(Option_exports.fromNullable(pragma), () => Function_exports.pipe(
1226
- Option_exports.fromNullable(pragmaNode),
1227
- Option_exports.map(({ value }) => RE_JSX_ANNOTATION_REGEX.exec(value)),
1228
- Option_exports.flatMapNullable((matches) => matches?.[1]?.split(".")[0])
1229
- )),
1230
- Option_exports.flatMap(Option_exports.liftPredicate((x2) => RE_JS_IDENTIFIER_REGEX.test(x2))),
1231
- Option_exports.getOrElse(Function_exports.constant("React"))
1232
- );
1233
- }
1234
- );
1235
1997
 
1236
1998
  // ../../../node_modules/.pnpm/ts-pattern@5.1.1/node_modules/ts-pattern/dist/index.js
1237
1999
  var t = Symbol.for("@ts-pattern/matcher");
@@ -1508,249 +2270,7 @@ var z = class _z {
1508
2270
  }
1509
2271
  };
1510
2272
 
1511
- // src/pragma/is-from-pragma.ts
1512
- function isInitializedFromPragma(variableName, context, initialScope, pragma = getPragmaFromContext(context)) {
1513
- const maybeVariable = findVariable(variableName, initialScope);
1514
- const maybeLatestDef = Option_exports.flatMapNullable(maybeVariable, (variable) => variable.defs.at(-1));
1515
- if (Option_exports.isNone(maybeLatestDef))
1516
- return false;
1517
- const latestDef = maybeLatestDef.value;
1518
- const { node, parent } = latestDef;
1519
- if (node.type === NodeType.VariableDeclarator && node.init) {
1520
- const { init } = node;
1521
- if (a({ type: "MemberExpression", object: { type: "Identifier", name: pragma } }, init))
1522
- return true;
1523
- if (a({ type: "Identifier", name: pragma }, init))
1524
- return true;
1525
- const maybeRequireExpression = $(init).with({
1526
- type: NodeType.CallExpression,
1527
- callee: { type: NodeType.Identifier, name: "require" }
1528
- }, (exp) => Option_exports.some(exp)).with(
1529
- {
1530
- type: NodeType.MemberExpression,
1531
- object: {
1532
- type: NodeType.CallExpression,
1533
- callee: { type: NodeType.Identifier, name: "require" }
1534
- }
1535
- },
1536
- ({ object }) => Option_exports.some(object)
1537
- ).otherwise(Option_exports.none);
1538
- if (Option_exports.isNone(maybeRequireExpression))
1539
- return false;
1540
- const requireExpression = maybeRequireExpression.value;
1541
- const [firstArg] = requireExpression.arguments;
1542
- if (firstArg?.type !== NodeType.Literal)
1543
- return false;
1544
- return firstArg.value === pragma.toLowerCase();
1545
- }
1546
- return a({ type: "ImportDeclaration", source: { value: pragma.toLowerCase() } }, parent);
1547
- }
1548
- function isPropertyOfPragma(name, context, pragma = getPragmaFromContext(context)) {
1549
- const isMatch = a({
1550
- type: NodeType.MemberExpression,
1551
- object: {
1552
- type: NodeType.Identifier,
1553
- name: pragma
1554
- },
1555
- property: {
1556
- name
1557
- }
1558
- });
1559
- return isMatch;
1560
- }
1561
- function isFromPragma(name) {
1562
- return (node, context) => {
1563
- const initialScope = context.sourceCode.getScope(node);
1564
- if (node.type === NodeType.MemberExpression)
1565
- return isPropertyOfPragma(name, context)(node);
1566
- if (node.name === name)
1567
- return isInitializedFromPragma(name, context, initialScope);
1568
- return false;
1569
- };
1570
- }
1571
- function isFromPragmaMember(pragmaMemberName, name) {
1572
- return (node, context, pragma = getPragmaFromContext(context)) => {
1573
- const initialScope = context.sourceCode.getScope(node);
1574
- if (node.property.type !== NodeType.Identifier || node.property.name !== name)
1575
- return false;
1576
- if (node.object.type === NodeType.Identifier && node.object.name === pragmaMemberName) {
1577
- return isInitializedFromPragma(node.object.name, context, initialScope, pragma);
1578
- }
1579
- if (node.object.type === NodeType.MemberExpression && node.object.object.type === NodeType.Identifier && node.object.object.name === pragma && node.object.property.type === NodeType.Identifier) {
1580
- return node.object.property.name === pragmaMemberName;
1581
- }
1582
- return false;
1583
- };
1584
- }
1585
- function isCallFromPragma(name) {
1586
- return (node, context) => {
1587
- if (!isOneOf([NodeType.Identifier, NodeType.MemberExpression])(node.callee))
1588
- return false;
1589
- return isFromPragma(name)(node.callee, context);
1590
- };
1591
- }
1592
- function isCallFromPragmaMember(pragmaMemberName, name) {
1593
- return (node, context) => {
1594
- if (!is(NodeType.MemberExpression)(node.callee))
1595
- return false;
1596
- return isFromPragmaMember(pragmaMemberName, name)(node.callee, context);
1597
- };
1598
- }
1599
-
1600
- // src/element/api.ts
1601
- var isCreateElement = isFromPragma("createElement");
1602
- var isCreateElementCall = (node, context) => {
1603
- if (!isOneOf([NodeType.Identifier, NodeType.MemberExpression])(node.callee))
1604
- return false;
1605
- return isCreateElement(node.callee, context);
1606
- };
1607
- var isCloneElement = isFromPragma("cloneElement");
1608
- var isCloneElementCall = (node, context) => {
1609
- if (!isOneOf([NodeType.Identifier, NodeType.MemberExpression])(node.callee))
1610
- return false;
1611
- return isCloneElement(node.callee, context);
1612
- };
1613
- function resolveMemberExpressions(object, property) {
1614
- if (object.type === AST_NODE_TYPES.JSXMemberExpression) {
1615
- return `${resolveMemberExpressions(object.object, object.property)}.${property.name}`;
1616
- }
1617
- if (object.type === AST_NODE_TYPES.JSXNamespacedName) {
1618
- return `${object.namespace.name}:${object.name.name}.${property.name}`;
1619
- }
1620
- return `${object.name}.${property.name}`;
1621
- }
1622
- function elementType(node) {
1623
- if (node.type === AST_NODE_TYPES.JSXOpeningFragment) {
1624
- return "<>";
1625
- }
1626
- const { name } = node;
1627
- if (name.type === AST_NODE_TYPES.JSXMemberExpression) {
1628
- const { object, property } = name;
1629
- return resolveMemberExpressions(object, property);
1630
- }
1631
- if (name.type === AST_NODE_TYPES.JSXNamespacedName) {
1632
- return `${name.namespace.name}:${name.name.name}`;
1633
- }
1634
- return name.name;
1635
- }
1636
- function isInsideCreateElementProps(node, context) {
1637
- return Function_exports.pipe(
1638
- traverseUp(node, (n2) => is(NodeType.CallExpression)(n2) && isCreateElementCall(n2, context)),
1639
- Option_exports.filter(is(NodeType.CallExpression)),
1640
- Option_exports.flatMapNullable((c2) => c2.arguments.at(1)),
1641
- Option_exports.filter(is(NodeType.ObjectExpression)),
1642
- Option_exports.zipWith(traverseUp(node, is(NodeType.ObjectExpression)), (a2, b2) => a2 === b2),
1643
- Option_exports.getOrElse(Function_exports.constFalse)
1644
- );
1645
- }
1646
- function isChildrenOfCreateElement(node, context) {
1647
- return Function_exports.pipe(
1648
- Option_exports.fromNullable(node.parent),
1649
- Option_exports.filter(is(NodeType.CallExpression)),
1650
- Option_exports.filter((n2) => isCreateElementCall(n2, context)),
1651
- Option_exports.exists(
1652
- (n2) => n2.arguments.slice(2).some((arg) => arg === node)
1653
- )
1654
- );
1655
- }
1656
- function hasChildren(node, predicate) {
1657
- if (Predicate_exports.isFunction(predicate))
1658
- return node.children.some(predicate);
1659
- return node.children.length > 0;
1660
- }
1661
- function isChildOfJSXElement(node) {
1662
- return node.parent?.type === NodeType.JSXElement && node.parent.children.some((child) => child === node);
1663
- }
1664
- function isJSXElementOfUserDefinedComponent(node) {
1665
- return node.openingElement.name.type === NodeType.JSXIdentifier && /^[A-Z]/u.test(node.openingElement.name.name);
1666
- }
1667
- function isJSXElementOfBuiltinComponent(node) {
1668
- return node.openingElement.name.type === NodeType.JSXIdentifier && node.openingElement.name.name.toLowerCase() === node.openingElement.name.name && /^[a-z]/u.test(node.openingElement.name.name);
1669
- }
1670
- var isFragment = (node, pragma, fragment) => {
1671
- if (!isOneOf([NodeType.JSXElement, NodeType.JSXFragment])(node))
1672
- return false;
1673
- return isFragmentSyntax(node) || isFragmentElement(node, pragma, fragment);
1674
- };
1675
- var isFragmentSyntax = is(NodeType.JSXFragment);
1676
- function isFragmentElement(node, pragma, fragment) {
1677
- const { name } = node.openingElement;
1678
- if (name.type === NodeType.JSXIdentifier && name.name === fragment)
1679
- return true;
1680
- return name.type === NodeType.JSXMemberExpression && name.object.type === NodeType.JSXIdentifier && name.object.name === pragma && name.property.name === fragment;
1681
- }
1682
- var JSXValueHint = {
1683
- None: 0n,
1684
- SkipNullLiteral: 1n << 0n,
1685
- SkipUndefinedLiteral: 1n << 1n,
1686
- SkipBooleanLiteral: 1n << 2n,
1687
- SkipStringLiteral: 1n << 3n,
1688
- SkipNumberLiteral: 1n << 4n,
1689
- SkipCreateElement: 1n << 5n,
1690
- StrictArray: 1n << 6n,
1691
- StrictLogical: 1n << 7n,
1692
- StrictConditional: 1n << 8n
1693
- };
1694
- var DEFAULT_JSX_VALUE_HINT = JSXValueHint.SkipUndefinedLiteral | JSXValueHint.SkipBooleanLiteral;
1695
- function isJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
1696
- if (!node)
1697
- return false;
1698
- return $(node).with({ type: NodeType.JSXElement }, Function_exports.constTrue).with({ type: NodeType.JSXFragment }, Function_exports.constTrue).with({ type: NodeType.JSXMemberExpression }, Function_exports.constTrue).with({ type: NodeType.JSXNamespacedName }, Function_exports.constTrue).with({ type: NodeType.Literal }, (node2) => {
1699
- return $(node2.value).with(null, () => !(hint & JSXValueHint.SkipNullLiteral)).with(N.boolean, () => !(hint & JSXValueHint.SkipBooleanLiteral)).with(N.string, () => !(hint & JSXValueHint.SkipStringLiteral)).with(N.number, () => !(hint & JSXValueHint.SkipNumberLiteral)).otherwise(Function_exports.constFalse);
1700
- }).with({ type: NodeType.TemplateLiteral }, () => !(hint & JSXValueHint.SkipStringLiteral)).with({ type: NodeType.ArrayExpression }, (node2) => {
1701
- if (hint & JSXValueHint.StrictArray)
1702
- return node2.elements.every((n2) => isJSXValue(n2, context, hint));
1703
- return node2.elements.some((n2) => isJSXValue(n2, context, hint));
1704
- }).with({ type: NodeType.ConditionalExpression }, (node2) => {
1705
- function leftHasJSX(node3) {
1706
- if (Array.isArray(node3.consequent)) {
1707
- if (hint & JSXValueHint.StrictArray) {
1708
- return node3.consequent.every((n2) => isJSXValue(n2, context, hint));
1709
- }
1710
- return node3.consequent.some((n2) => isJSXValue(n2, context, hint));
1711
- }
1712
- return isJSXValue(node3.consequent, context, hint);
1713
- }
1714
- function rightHasJSX(node3) {
1715
- return isJSXValue(node3.alternate, context, hint);
1716
- }
1717
- if (hint & JSXValueHint.StrictConditional) {
1718
- return leftHasJSX(node2) && rightHasJSX(node2);
1719
- }
1720
- return leftHasJSX(node2) || rightHasJSX(node2);
1721
- }).with({ type: NodeType.LogicalExpression }, (node2) => {
1722
- return isJSXValue(node2.left, context, hint) || isJSXValue(node2.right, context, hint);
1723
- }).with({ type: NodeType.SequenceExpression }, (node2) => {
1724
- const exp = node2.expressions.at(-1);
1725
- return isJSXValue(exp, context, hint);
1726
- }).with({ type: NodeType.CallExpression }, (node2) => {
1727
- if (hint & JSXValueHint.SkipCreateElement)
1728
- return false;
1729
- return isCreateElementCall(node2, context);
1730
- }).with({ type: NodeType.Identifier }, (node2) => {
1731
- const { name } = node2;
1732
- if (name === "undefined")
1733
- return !(hint & JSXValueHint.SkipUndefinedLiteral);
1734
- if (isJSXTagNameExpression(node2))
1735
- return true;
1736
- const initialScope = context.sourceCode.getScope(node2);
1737
- const maybeVariable = findVariable(name, initialScope);
1738
- return Function_exports.pipe(
1739
- maybeVariable,
1740
- Option_exports.flatMap(getVariableInit(0)),
1741
- Option_exports.exists((n2) => isJSXValue(n2, context, hint))
1742
- );
1743
- }).otherwise(Function_exports.constFalse);
1744
- }
1745
-
1746
- // src/misc.ts
1747
- function isFunctionReturningJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
1748
- if (node.body.type !== NodeType.BlockStatement) {
1749
- return isJSXValue(node.body, context, hint);
1750
- }
1751
- const statements = getNestedReturnStatements(node.body);
1752
- return statements.some((statement) => isJSXValue(statement.argument, context, hint));
1753
- }
2273
+ // src/prop/get-prop.ts
1754
2274
  var { getStaticValue } = ESLintCommunityESLintUtils;
1755
2275
  function getPropName(node) {
1756
2276
  return $(node.name).when(is(NodeType.JSXIdentifier), (n2) => n2.name).when(is(NodeType.JSXNamespacedName), (n2) => `${n2.namespace.name}:${n2.name.name}`).exhaustive();
@@ -1788,13 +2308,13 @@ function findPropInProperties(properties, context, initialScope, seenProps = [])
1788
2308
  );
1789
2309
  if (Option_exports.isNone(maybeInit))
1790
2310
  return false;
1791
- const init = maybeInit.value;
1792
- if (init.type !== NodeType.ObjectExpression)
2311
+ const init2 = maybeInit.value;
2312
+ if (init2.type !== NodeType.ObjectExpression)
1793
2313
  return false;
1794
2314
  if (seenProps.includes(name))
1795
2315
  return false;
1796
2316
  return Option_exports.isSome(
1797
- findPropInProperties(init.properties, context, initialScope, [...seenProps, name])(propName)
2317
+ findPropInProperties(init2.properties, context, initialScope, [...seenProps, name])(propName)
1798
2318
  );
1799
2319
  }).when(is(NodeType.ObjectExpression), (argument) => {
1800
2320
  return Option_exports.isSome(findPropInProperties(argument.properties, context, initialScope, seenProps)(propName));
@@ -1821,10 +2341,10 @@ function findPropInAttributes(attributes, context, initialScope) {
1821
2341
  );
1822
2342
  if (Option_exports.isNone(maybeInit))
1823
2343
  return false;
1824
- const init = maybeInit.value;
1825
- if (!("properties" in init))
2344
+ const init2 = maybeInit.value;
2345
+ if (!("properties" in init2))
1826
2346
  return false;
1827
- return Option_exports.isSome(findPropInProperties(init.properties, context, initialScope)(propName));
2347
+ return Option_exports.isSome(findPropInProperties(init2.properties, context, initialScope)(propName));
1828
2348
  }).when(is(NodeType.ObjectExpression), (argument) => {
1829
2349
  return Option_exports.isSome(findPropInProperties(argument.properties, context, initialScope)(propName));
1830
2350
  }).when(is(NodeType.MemberExpression), () => {
@@ -1871,5 +2391,68 @@ function isLineBreak(node) {
1871
2391
  function isPaddingSpaces(node) {
1872
2392
  return isLiteral(node) && isWhiteSpace(node) && node.raw.includes("\n");
1873
2393
  }
2394
+ var JSXValueHint = {
2395
+ None: 0n,
2396
+ SkipNullLiteral: 1n << 0n,
2397
+ SkipUndefinedLiteral: 1n << 1n,
2398
+ SkipBooleanLiteral: 1n << 2n,
2399
+ SkipStringLiteral: 1n << 3n,
2400
+ SkipNumberLiteral: 1n << 4n,
2401
+ SkipCreateElement: 1n << 5n,
2402
+ StrictArray: 1n << 6n,
2403
+ StrictLogical: 1n << 7n,
2404
+ StrictConditional: 1n << 8n
2405
+ };
2406
+ var DEFAULT_JSX_VALUE_HINT = JSXValueHint.SkipUndefinedLiteral | JSXValueHint.SkipBooleanLiteral;
2407
+ function isJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
2408
+ if (!node)
2409
+ return false;
2410
+ return $(node).with({ type: NodeType.JSXElement }, Function_exports.constTrue).with({ type: NodeType.JSXFragment }, Function_exports.constTrue).with({ type: NodeType.JSXMemberExpression }, Function_exports.constTrue).with({ type: NodeType.JSXNamespacedName }, Function_exports.constTrue).with({ type: NodeType.Literal }, (node2) => {
2411
+ return $(node2.value).with(null, () => !(hint & JSXValueHint.SkipNullLiteral)).with(N.boolean, () => !(hint & JSXValueHint.SkipBooleanLiteral)).with(N.string, () => !(hint & JSXValueHint.SkipStringLiteral)).with(N.number, () => !(hint & JSXValueHint.SkipNumberLiteral)).otherwise(Function_exports.constFalse);
2412
+ }).with({ type: NodeType.TemplateLiteral }, () => !(hint & JSXValueHint.SkipStringLiteral)).with({ type: NodeType.ArrayExpression }, (node2) => {
2413
+ if (hint & JSXValueHint.StrictArray)
2414
+ return node2.elements.every((n2) => isJSXValue(n2, context, hint));
2415
+ return node2.elements.some((n2) => isJSXValue(n2, context, hint));
2416
+ }).with({ type: NodeType.ConditionalExpression }, (node2) => {
2417
+ function leftHasJSX(node3) {
2418
+ if (Array.isArray(node3.consequent)) {
2419
+ if (hint & JSXValueHint.StrictArray) {
2420
+ return node3.consequent.every((n2) => isJSXValue(n2, context, hint));
2421
+ }
2422
+ return node3.consequent.some((n2) => isJSXValue(n2, context, hint));
2423
+ }
2424
+ return isJSXValue(node3.consequent, context, hint);
2425
+ }
2426
+ function rightHasJSX(node3) {
2427
+ return isJSXValue(node3.alternate, context, hint);
2428
+ }
2429
+ if (hint & JSXValueHint.StrictConditional) {
2430
+ return leftHasJSX(node2) && rightHasJSX(node2);
2431
+ }
2432
+ return leftHasJSX(node2) || rightHasJSX(node2);
2433
+ }).with({ type: NodeType.LogicalExpression }, (node2) => {
2434
+ return isJSXValue(node2.left, context, hint) || isJSXValue(node2.right, context, hint);
2435
+ }).with({ type: NodeType.SequenceExpression }, (node2) => {
2436
+ const exp = node2.expressions.at(-1);
2437
+ return isJSXValue(exp, context, hint);
2438
+ }).with({ type: NodeType.CallExpression }, (node2) => {
2439
+ if (hint & JSXValueHint.SkipCreateElement)
2440
+ return false;
2441
+ return $(node2.callee).with({ type: NodeType.Identifier, name: "createElement" }, Function_exports.constTrue).with({ type: NodeType.MemberExpression, property: { name: "createElement" } }, Function_exports.constTrue).otherwise(Function_exports.constFalse);
2442
+ }).with({ type: NodeType.Identifier }, (node2) => {
2443
+ const { name } = node2;
2444
+ if (name === "undefined")
2445
+ return !(hint & JSXValueHint.SkipUndefinedLiteral);
2446
+ if (isJSXTagNameExpression(node2))
2447
+ return true;
2448
+ const initialScope = context.sourceCode.getScope(node2);
2449
+ const maybeVariable = findVariable(name, initialScope);
2450
+ return Function_exports.pipe(
2451
+ maybeVariable,
2452
+ Option_exports.flatMap(getVariableInit(0)),
2453
+ Option_exports.exists((n2) => isJSXValue(n2, context, hint))
2454
+ );
2455
+ }).otherwise(Function_exports.constFalse);
2456
+ }
1874
2457
 
1875
- export { DEFAULT_JSX_VALUE_HINT, JSXValueHint, elementType, findPropInAttributes, findPropInProperties, getFragmentFromContext, getPragmaFromContext, getProp, getPropName, getPropValue, hasAnyProp, hasChildren, hasEveryProp, hasProp, isCallFromPragma, isCallFromPragmaMember, isChildOfJSXElement, isChildrenOfCreateElement, isCloneElement, isCloneElementCall, isCreateElement, isCreateElementCall, isFragment, isFragmentElement, isFragmentSyntax, isFromPragma, isFromPragmaMember, isFunctionReturningJSXValue, isInitializedFromPragma, isInsideCreateElementProps, isInsidePropValue, isJSXElementOfBuiltinComponent, isJSXElementOfUserDefinedComponent, isJSXValue, isLineBreak, isLiteral, isPaddingSpaces, isPropertyOfPragma, isWhiteSpace, traverseUpProp };
2458
+ export { DEFAULT_JSX_VALUE_HINT, JSXValueHint, elementType, findPropInAttributes, findPropInProperties, getJSXPragmaFromContext, getProp, getPropName, getPropValue, hasAnyProp, hasEveryProp, hasProp, isInsidePropValue, isJSXElementOfBuiltinComponent, isJSXElementOfUserDefinedComponent, isJSXValue, isLineBreak, isLiteral, isPaddingSpaces, isWhiteSpace, traverseUpProp };