@eslint-react/jsx 1.5.16 → 1.5.17-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +42 -2014
  2. package/dist/index.mjs +48 -2020
  3. package/package.json +12 -12
package/dist/index.js CHANGED
@@ -2,14 +2,11 @@
2
2
 
3
3
  var types = require('@typescript-eslint/types');
4
4
  var ast = require('@eslint-react/ast');
5
+ var effect = require('effect');
5
6
  var _var = require('@eslint-react/var');
6
7
  var tsPattern = require('ts-pattern');
7
8
 
8
- var __defProp = Object.defineProperty;
9
- var __export = (target, all3) => {
10
- for (var name in all3)
11
- __defProp(target, name, { get: all3[name], enumerable: true });
12
- };
9
+ // src/element/element-type.ts
13
10
  function resolveMemberExpressions(object, property) {
14
11
  if (object.type === types.AST_NODE_TYPES.JSXMemberExpression) {
15
12
  return `${resolveMemberExpressions(object.object, object.property)}.${property.name}`;
@@ -39,1982 +36,15 @@ function isJSXElementOfUserDefinedComponent(node) {
39
36
  function isJSXElementOfBuiltinComponent(node) {
40
37
  return node.openingElement.name.type === ast.NodeType.JSXIdentifier && node.openingElement.name.name.toLowerCase() === node.openingElement.name.name && /^[a-z]/u.test(node.openingElement.name.name);
41
38
  }
42
-
43
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Function.js
44
- var Function_exports = {};
45
- __export(Function_exports, {
46
- SK: () => SK,
47
- absurd: () => absurd,
48
- apply: () => apply,
49
- compose: () => compose,
50
- constFalse: () => constFalse,
51
- constNull: () => constNull,
52
- constTrue: () => constTrue,
53
- constUndefined: () => constUndefined,
54
- constVoid: () => constVoid,
55
- constant: () => constant,
56
- dual: () => dual,
57
- flip: () => flip,
58
- flow: () => flow,
59
- hole: () => hole,
60
- identity: () => identity,
61
- isFunction: () => isFunction,
62
- pipe: () => pipe,
63
- satisfies: () => satisfies,
64
- tupled: () => tupled,
65
- unsafeCoerce: () => unsafeCoerce,
66
- untupled: () => untupled
67
- });
68
- var isFunction = (input) => typeof input === "function";
69
- var dual = function(arity, body) {
70
- if (typeof arity === "function") {
71
- return function() {
72
- if (arity(arguments)) {
73
- return body.apply(this, arguments);
74
- }
75
- return (self) => body(self, ...arguments);
76
- };
77
- }
78
- switch (arity) {
79
- case 0:
80
- case 1:
81
- throw new RangeError(`Invalid arity ${arity}`);
82
- case 2:
83
- return function(a, b) {
84
- if (arguments.length >= 2) {
85
- return body(a, b);
86
- }
87
- return function(self) {
88
- return body(self, a);
89
- };
90
- };
91
- case 3:
92
- return function(a, b, c) {
93
- if (arguments.length >= 3) {
94
- return body(a, b, c);
95
- }
96
- return function(self) {
97
- return body(self, a, b);
98
- };
99
- };
100
- case 4:
101
- return function(a, b, c, d) {
102
- if (arguments.length >= 4) {
103
- return body(a, b, c, d);
104
- }
105
- return function(self) {
106
- return body(self, a, b, c);
107
- };
108
- };
109
- case 5:
110
- return function(a, b, c, d, e) {
111
- if (arguments.length >= 5) {
112
- return body(a, b, c, d, e);
113
- }
114
- return function(self) {
115
- return body(self, a, b, c, d);
116
- };
117
- };
118
- default:
119
- return function() {
120
- if (arguments.length >= arity) {
121
- return body.apply(this, arguments);
122
- }
123
- const args = arguments;
124
- return function(self) {
125
- return body(self, ...args);
126
- };
127
- };
128
- }
129
- };
130
- var apply = (a) => (self) => self(a);
131
- var identity = (a) => a;
132
- var satisfies = () => (b) => b;
133
- var unsafeCoerce = identity;
134
- var constant = (value) => () => value;
135
- var constTrue = /* @__PURE__ */ constant(true);
136
- var constFalse = /* @__PURE__ */ constant(false);
137
- var constNull = /* @__PURE__ */ constant(null);
138
- var constUndefined = /* @__PURE__ */ constant(void 0);
139
- var constVoid = constUndefined;
140
- var flip = (f) => (...b) => (...a) => f(...a)(...b);
141
- var compose = /* @__PURE__ */ dual(2, (ab, bc) => (a) => bc(ab(a)));
142
- var absurd = (_) => {
143
- throw new Error("Called `absurd` function which should be uncallable");
144
- };
145
- var tupled = (f) => (a) => f(...a);
146
- var untupled = (f) => (...a) => f(a);
147
- function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
148
- switch (arguments.length) {
149
- case 1:
150
- return a;
151
- case 2:
152
- return ab(a);
153
- case 3:
154
- return bc(ab(a));
155
- case 4:
156
- return cd(bc(ab(a)));
157
- case 5:
158
- return de(cd(bc(ab(a))));
159
- case 6:
160
- return ef(de(cd(bc(ab(a)))));
161
- case 7:
162
- return fg(ef(de(cd(bc(ab(a))))));
163
- case 8:
164
- return gh(fg(ef(de(cd(bc(ab(a)))))));
165
- case 9:
166
- return hi(gh(fg(ef(de(cd(bc(ab(a))))))));
167
- default: {
168
- let ret = arguments[0];
169
- for (let i = 1; i < arguments.length; i++) {
170
- ret = arguments[i](ret);
171
- }
172
- return ret;
173
- }
174
- }
175
- }
176
- function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
177
- switch (arguments.length) {
178
- case 1:
179
- return ab;
180
- case 2:
181
- return function() {
182
- return bc(ab.apply(this, arguments));
183
- };
184
- case 3:
185
- return function() {
186
- return cd(bc(ab.apply(this, arguments)));
187
- };
188
- case 4:
189
- return function() {
190
- return de(cd(bc(ab.apply(this, arguments))));
191
- };
192
- case 5:
193
- return function() {
194
- return ef(de(cd(bc(ab.apply(this, arguments)))));
195
- };
196
- case 6:
197
- return function() {
198
- return fg(ef(de(cd(bc(ab.apply(this, arguments))))));
199
- };
200
- case 7:
201
- return function() {
202
- return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));
203
- };
204
- case 8:
205
- return function() {
206
- return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));
207
- };
208
- case 9:
209
- return function() {
210
- return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));
211
- };
212
- }
213
- return;
214
- }
215
- var hole = /* @__PURE__ */ unsafeCoerce(absurd);
216
- var SK = (_, b) => b;
217
-
218
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Array.js
219
- var Array_exports = {};
220
- __export(Array_exports, {
221
- Do: () => Do2,
222
- allocate: () => allocate,
223
- append: () => append,
224
- appendAll: () => appendAll,
225
- bind: () => bind3,
226
- bindTo: () => bindTo3,
227
- cartesian: () => cartesian,
228
- cartesianWith: () => cartesianWith,
229
- chop: () => chop,
230
- chunksOf: () => chunksOf,
231
- contains: () => contains2,
232
- containsWith: () => containsWith2,
233
- copy: () => copy,
234
- dedupe: () => dedupe,
235
- dedupeAdjacent: () => dedupeAdjacent,
236
- dedupeAdjacentWith: () => dedupeAdjacentWith,
237
- dedupeWith: () => dedupeWith,
238
- difference: () => difference,
239
- differenceWith: () => differenceWith,
240
- drop: () => drop,
241
- dropRight: () => dropRight,
242
- dropWhile: () => dropWhile,
243
- empty: () => empty2,
244
- every: () => every2,
245
- extend: () => extend,
246
- filter: () => filter2,
247
- filterMap: () => filterMap2,
248
- filterMapWhile: () => filterMapWhile,
249
- findFirst: () => findFirst2,
250
- findFirstIndex: () => findFirstIndex,
251
- findLast: () => findLast,
252
- findLastIndex: () => findLastIndex,
253
- flatMap: () => flatMap2,
254
- flatMapNullable: () => flatMapNullable2,
255
- flatten: () => flatten2,
256
- forEach: () => forEach,
257
- fromIterable: () => fromIterable2,
258
- fromNullable: () => fromNullable2,
259
- fromOption: () => fromOption2,
260
- fromRecord: () => fromRecord,
261
- get: () => get,
262
- getEquivalence: () => getEquivalence2,
263
- getLefts: () => getLefts,
264
- getOrder: () => getOrder2,
265
- getRights: () => getRights,
266
- getSomes: () => getSomes,
267
- group: () => group,
268
- groupBy: () => groupBy,
269
- groupWith: () => groupWith,
270
- head: () => head,
271
- headNonEmpty: () => headNonEmpty,
272
- init: () => init,
273
- initNonEmpty: () => initNonEmpty,
274
- insertAt: () => insertAt,
275
- intersection: () => intersection,
276
- intersectionWith: () => intersectionWith,
277
- intersperse: () => intersperse,
278
- isArray: () => isArray,
279
- isEmptyArray: () => isEmptyArray,
280
- isEmptyReadonlyArray: () => isEmptyReadonlyArray,
281
- isNonEmptyArray: () => isNonEmptyArray2,
282
- isNonEmptyReadonlyArray: () => isNonEmptyReadonlyArray,
283
- join: () => join,
284
- last: () => last,
285
- lastNonEmpty: () => lastNonEmpty,
286
- length: () => length,
287
- let: () => let_3,
288
- liftEither: () => liftEither,
289
- liftNullable: () => liftNullable2,
290
- liftOption: () => liftOption,
291
- liftPredicate: () => liftPredicate2,
292
- make: () => make4,
293
- makeBy: () => makeBy,
294
- map: () => map2,
295
- mapAccum: () => mapAccum,
296
- match: () => match2,
297
- matchLeft: () => matchLeft,
298
- matchRight: () => matchRight,
299
- max: () => max2,
300
- min: () => min2,
301
- modify: () => modify,
302
- modifyNonEmptyHead: () => modifyNonEmptyHead,
303
- modifyNonEmptyLast: () => modifyNonEmptyLast,
304
- modifyOption: () => modifyOption,
305
- of: () => of,
306
- partition: () => partition,
307
- partitionMap: () => partitionMap2,
308
- prepend: () => prepend,
309
- prependAll: () => prependAll,
310
- range: () => range,
311
- reduce: () => reduce,
312
- reduceRight: () => reduceRight,
313
- remove: () => remove,
314
- replace: () => replace,
315
- replaceOption: () => replaceOption,
316
- replicate: () => replicate,
317
- reverse: () => reverse,
318
- rotate: () => rotate,
319
- scan: () => scan,
320
- scanRight: () => scanRight,
321
- separate: () => separate,
322
- setNonEmptyHead: () => setNonEmptyHead,
323
- setNonEmptyLast: () => setNonEmptyLast,
324
- some: () => some4,
325
- sort: () => sort,
326
- sortBy: () => sortBy,
327
- sortWith: () => sortWith,
328
- span: () => span,
329
- split: () => split,
330
- splitAt: () => splitAt,
331
- splitNonEmptyAt: () => splitNonEmptyAt,
332
- splitWhere: () => splitWhere,
333
- tail: () => tail,
334
- tailNonEmpty: () => tailNonEmpty,
335
- take: () => take,
336
- takeRight: () => takeRight,
337
- takeWhile: () => takeWhile,
338
- unappend: () => unappend,
339
- unfold: () => unfold,
340
- union: () => union,
341
- unionWith: () => unionWith,
342
- unprepend: () => unprepend,
343
- unsafeGet: () => unsafeGet,
344
- unzip: () => unzip,
345
- zip: () => zip,
346
- zipWith: () => zipWith2
347
- });
348
-
349
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Equivalence.js
350
- var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
351
- var array = (item) => make((self, that) => {
352
- if (self.length !== that.length) {
353
- return false;
354
- }
355
- for (let i = 0; i < self.length; i++) {
356
- const isEq = item(self[i], that[i]);
357
- if (!isEq) {
358
- return false;
359
- }
360
- }
361
- return true;
362
- });
363
-
364
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/internal/doNotation.js
365
- var let_ = (map3) => dual(3, (self, name, f) => map3(self, (a) => Object.assign({}, a, {
366
- [name]: f(a)
367
- })));
368
- var bindTo = (map3) => dual(2, (self, name) => map3(self, (a) => ({
369
- [name]: a
370
- })));
371
- var bind = (map3, flatMap3) => dual(3, (self, name, f) => flatMap3(self, (a) => map3(f(a), (b) => Object.assign({}, a, {
372
- [name]: b
373
- }))));
374
-
375
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/internal/version.js
376
- var moduleVersion = "3.3.3";
377
- var getCurrentVersion = () => moduleVersion;
378
-
379
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/GlobalValue.js
380
- var globalStoreId = /* @__PURE__ */ Symbol.for(`effect/GlobalValue/globalStoreId/${/* @__PURE__ */ getCurrentVersion()}`);
381
- if (!(globalStoreId in globalThis)) {
382
- globalThis[globalStoreId] = /* @__PURE__ */ new Map();
383
- }
384
- var globalStore = globalThis[globalStoreId];
385
- var globalValue = (id, compute) => {
386
- if (!globalStore.has(id)) {
387
- globalStore.set(id, compute());
388
- }
389
- return globalStore.get(id);
390
- };
391
-
392
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Predicate.js
393
- var Predicate_exports = {};
394
- __export(Predicate_exports, {
395
- all: () => all,
396
- and: () => and,
397
- compose: () => compose2,
398
- eqv: () => eqv,
399
- every: () => every,
400
- hasProperty: () => hasProperty,
401
- implies: () => implies,
402
- isBigInt: () => isBigInt,
403
- isBoolean: () => isBoolean,
404
- isDate: () => isDate,
405
- isError: () => isError,
406
- isFunction: () => isFunction2,
407
- isIterable: () => isIterable,
408
- isMap: () => isMap,
409
- isNever: () => isNever,
410
- isNotNull: () => isNotNull,
411
- isNotNullable: () => isNotNullable,
412
- isNotUndefined: () => isNotUndefined,
413
- isNull: () => isNull,
414
- isNullable: () => isNullable,
415
- isNumber: () => isNumber,
416
- isObject: () => isObject,
417
- isPromise: () => isPromise,
418
- isPromiseLike: () => isPromiseLike,
419
- isReadonlyRecord: () => isReadonlyRecord,
420
- isRecord: () => isRecord,
421
- isSet: () => isSet,
422
- isString: () => isString,
423
- isSymbol: () => isSymbol,
424
- isTagged: () => isTagged,
425
- isTruthy: () => isTruthy,
426
- isTupleOf: () => isTupleOf,
427
- isTupleOfAtLeast: () => isTupleOfAtLeast,
428
- isUint8Array: () => isUint8Array,
429
- isUndefined: () => isUndefined,
430
- isUnknown: () => isUnknown,
431
- mapInput: () => mapInput,
432
- nand: () => nand,
433
- nor: () => nor,
434
- not: () => not,
435
- or: () => or,
436
- product: () => product,
437
- productMany: () => productMany,
438
- some: () => some,
439
- struct: () => struct,
440
- tuple: () => tuple,
441
- xor: () => xor
442
- });
443
- var mapInput = /* @__PURE__ */ dual(2, (self, f) => (b) => self(f(b)));
444
- var isTupleOf = /* @__PURE__ */ dual(2, (self, n) => self.length === n);
445
- var isTupleOfAtLeast = /* @__PURE__ */ dual(2, (self, n) => self.length >= n);
446
- var isTruthy = (input) => !!input;
447
- var isSet = (input) => input instanceof Set;
448
- var isMap = (input) => input instanceof Map;
449
- var isString = (input) => typeof input === "string";
450
- var isNumber = (input) => typeof input === "number";
451
- var isBoolean = (input) => typeof input === "boolean";
452
- var isBigInt = (input) => typeof input === "bigint";
453
- var isSymbol = (input) => typeof input === "symbol";
454
- var isFunction2 = isFunction;
455
- var isUndefined = (input) => input === void 0;
456
- var isNotUndefined = (input) => input !== void 0;
457
- var isNull = (input) => input === null;
458
- var isNotNull = (input) => input !== null;
459
- var isNever = (_) => false;
460
- var isUnknown = (_) => true;
461
- var isRecordOrArray = (input) => typeof input === "object" && input !== null;
462
- var isObject = (input) => isRecordOrArray(input) || isFunction2(input);
463
- var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObject(self) && property in self);
464
- var isTagged = /* @__PURE__ */ dual(2, (self, tag) => hasProperty(self, "_tag") && self["_tag"] === tag);
465
- var isNullable = (input) => input === null || input === void 0;
466
- var isNotNullable = (input) => input !== null && input !== void 0;
467
- var isError = (input) => input instanceof Error;
468
- var isUint8Array = (input) => input instanceof Uint8Array;
469
- var isDate = (input) => input instanceof Date;
470
- var isIterable = (input) => hasProperty(input, Symbol.iterator);
471
- var isRecord = (input) => isRecordOrArray(input) && !Array.isArray(input);
472
- var isReadonlyRecord = isRecord;
473
- var isPromise = (input) => hasProperty(input, "then") && "catch" in input && isFunction2(input.then) && isFunction2(input.catch);
474
- var isPromiseLike = (input) => hasProperty(input, "then") && isFunction2(input.then);
475
- var compose2 = /* @__PURE__ */ dual(2, (ab, bc) => (a) => ab(a) && bc(a));
476
- var product = (self, that) => ([a, b]) => self(a) && that(b);
477
- var all = (collection) => {
478
- return (as2) => {
479
- let collectionIndex = 0;
480
- for (const p of collection) {
481
- if (collectionIndex >= as2.length) {
482
- break;
483
- }
484
- if (p(as2[collectionIndex]) === false) {
485
- return false;
486
- }
487
- collectionIndex++;
488
- }
489
- return true;
490
- };
491
- };
492
- var productMany = (self, collection) => {
493
- const rest = all(collection);
494
- return ([head2, ...tail2]) => self(head2) === false ? false : rest(tail2);
495
- };
496
- var tuple = (...elements) => all(elements);
497
- var struct = (fields) => {
498
- const keys2 = Object.keys(fields);
499
- return (a) => {
500
- for (const key of keys2) {
501
- if (!fields[key](a[key])) {
502
- return false;
503
- }
504
- }
505
- return true;
506
- };
507
- };
508
- var not = (self) => (a) => !self(a);
509
- var or = /* @__PURE__ */ dual(2, (self, that) => (a) => self(a) || that(a));
510
- var and = /* @__PURE__ */ dual(2, (self, that) => (a) => self(a) && that(a));
511
- var xor = /* @__PURE__ */ dual(2, (self, that) => (a) => self(a) !== that(a));
512
- var eqv = /* @__PURE__ */ dual(2, (self, that) => (a) => self(a) === that(a));
513
- var implies = /* @__PURE__ */ dual(2, (antecedent, consequent) => (a) => antecedent(a) ? consequent(a) : true);
514
- var nor = /* @__PURE__ */ dual(2, (self, that) => (a) => !(self(a) || that(a)));
515
- var nand = /* @__PURE__ */ dual(2, (self, that) => (a) => !(self(a) && that(a)));
516
- var every = (collection) => (a) => {
517
- for (const p of collection) {
518
- if (!p(a)) {
519
- return false;
520
- }
521
- }
522
- return true;
523
- };
524
- var some = (collection) => (a) => {
525
- for (const p of collection) {
526
- if (p(a)) {
527
- return true;
528
- }
529
- }
530
- return false;
531
- };
532
-
533
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/internal/errors.js
534
- var getBugErrorMessage = (message) => `BUG: ${message} - please report an issue at https://github.com/Effect-TS/effect/issues`;
535
-
536
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Utils.js
537
- var GenKindTypeId = /* @__PURE__ */ Symbol.for("effect/Gen/GenKind");
538
- var isGenKind = (u) => isObject(u) && GenKindTypeId in u;
539
- var GenKindImpl = class {
540
- value;
541
- constructor(value) {
542
- this.value = value;
543
- }
544
- /**
545
- * @since 2.0.0
546
- */
547
- get _F() {
548
- return identity;
549
- }
550
- /**
551
- * @since 2.0.0
552
- */
553
- get _R() {
554
- return (_) => _;
555
- }
556
- /**
557
- * @since 2.0.0
558
- */
559
- get _O() {
560
- return (_) => _;
561
- }
562
- /**
563
- * @since 2.0.0
564
- */
565
- get _E() {
566
- return (_) => _;
567
- }
568
- /**
569
- * @since 2.0.0
570
- */
571
- [GenKindTypeId] = GenKindTypeId;
572
- /**
573
- * @since 2.0.0
574
- */
575
- [Symbol.iterator]() {
576
- return new SingleShotGen(this);
577
- }
578
- };
579
- var SingleShotGen = class _SingleShotGen {
580
- self;
581
- called = false;
582
- constructor(self) {
583
- this.self = self;
584
- }
585
- /**
586
- * @since 2.0.0
587
- */
588
- next(a) {
589
- return this.called ? {
590
- value: a,
591
- done: true
592
- } : (this.called = true, {
593
- value: this.self,
594
- done: false
595
- });
596
- }
597
- /**
598
- * @since 2.0.0
599
- */
600
- return(a) {
601
- return {
602
- value: a,
603
- done: true
604
- };
605
- }
606
- /**
607
- * @since 2.0.0
608
- */
609
- throw(e) {
610
- throw e;
611
- }
612
- /**
613
- * @since 2.0.0
614
- */
615
- [Symbol.iterator]() {
616
- return new _SingleShotGen(this.self);
617
- }
618
- };
619
- var adapter = () => function() {
620
- let x = arguments[0];
621
- for (let i = 1; i < arguments.length; i++) {
622
- x = arguments[i](x);
623
- }
624
- return new GenKindImpl(x);
625
- };
626
- var defaultIncHi = 335903614;
627
- var defaultIncLo = 4150755663;
628
- var MUL_HI = 1481765933 >>> 0;
629
- var MUL_LO = 1284865837 >>> 0;
630
- var BIT_53 = 9007199254740992;
631
- var BIT_27 = 134217728;
632
- var PCGRandom = class {
633
- _state;
634
- constructor(seedHi, seedLo, incHi, incLo) {
635
- if (isNullable(seedLo) && isNullable(seedHi)) {
636
- seedLo = Math.random() * 4294967295 >>> 0;
637
- seedHi = 0;
638
- } else if (isNullable(seedLo)) {
639
- seedLo = seedHi;
640
- seedHi = 0;
641
- }
642
- if (isNullable(incLo) && isNullable(incHi)) {
643
- incLo = this._state ? this._state[3] : defaultIncLo;
644
- incHi = this._state ? this._state[2] : defaultIncHi;
645
- } else if (isNullable(incLo)) {
646
- incLo = incHi;
647
- incHi = 0;
648
- }
649
- this._state = new Int32Array([0, 0, incHi >>> 0, ((incLo || 0) | 1) >>> 0]);
650
- this._next();
651
- add64(this._state, this._state[0], this._state[1], seedHi >>> 0, seedLo >>> 0);
652
- this._next();
653
- return this;
654
- }
655
- /**
656
- * Returns a copy of the internal state of this random number generator as a
657
- * JavaScript Array.
658
- *
659
- * @category getters
660
- * @since 2.0.0
661
- */
662
- getState() {
663
- return [this._state[0], this._state[1], this._state[2], this._state[3]];
664
- }
665
- /**
666
- * Restore state previously retrieved using `getState()`.
667
- *
668
- * @since 2.0.0
669
- */
670
- setState(state) {
671
- this._state[0] = state[0];
672
- this._state[1] = state[1];
673
- this._state[2] = state[2];
674
- this._state[3] = state[3] | 1;
675
- }
676
- /**
677
- * Get a uniformly distributed 32 bit integer between [0, max).
678
- *
679
- * @category getter
680
- * @since 2.0.0
681
- */
682
- integer(max3) {
683
- if (!max3) {
684
- return this._next();
685
- }
686
- max3 = max3 >>> 0;
687
- if ((max3 & max3 - 1) === 0) {
688
- return this._next() & max3 - 1;
689
- }
690
- let num = 0;
691
- const skew = (-max3 >>> 0) % max3 >>> 0;
692
- for (num = this._next(); num < skew; num = this._next()) {
693
- }
694
- return num % max3;
695
- }
696
- /**
697
- * Get a uniformly distributed IEEE-754 double between 0.0 and 1.0, with
698
- * 53 bits of precision (every bit of the mantissa is randomized).
699
- *
700
- * @category getters
701
- * @since 2.0.0
702
- */
703
- number() {
704
- const hi = (this._next() & 67108863) * 1;
705
- const lo = (this._next() & 134217727) * 1;
706
- return (hi * BIT_27 + lo) / BIT_53;
707
- }
708
- /** @internal */
709
- _next() {
710
- const oldHi = this._state[0] >>> 0;
711
- const oldLo = this._state[1] >>> 0;
712
- mul64(this._state, oldHi, oldLo, MUL_HI, MUL_LO);
713
- add64(this._state, this._state[0], this._state[1], this._state[2], this._state[3]);
714
- let xsHi = oldHi >>> 18;
715
- let xsLo = (oldLo >>> 18 | oldHi << 14) >>> 0;
716
- xsHi = (xsHi ^ oldHi) >>> 0;
717
- xsLo = (xsLo ^ oldLo) >>> 0;
718
- const xorshifted = (xsLo >>> 27 | xsHi << 5) >>> 0;
719
- const rot = oldHi >>> 27;
720
- const rot2 = (-rot >>> 0 & 31) >>> 0;
721
- return (xorshifted >>> rot | xorshifted << rot2) >>> 0;
722
- }
723
- };
724
- function mul64(out, aHi, aLo, bHi, bLo) {
725
- let c1 = (aLo >>> 16) * (bLo & 65535) >>> 0;
726
- let c0 = (aLo & 65535) * (bLo >>> 16) >>> 0;
727
- let lo = (aLo & 65535) * (bLo & 65535) >>> 0;
728
- let hi = (aLo >>> 16) * (bLo >>> 16) + ((c0 >>> 16) + (c1 >>> 16)) >>> 0;
729
- c0 = c0 << 16 >>> 0;
730
- lo = lo + c0 >>> 0;
731
- if (lo >>> 0 < c0 >>> 0) {
732
- hi = hi + 1 >>> 0;
733
- }
734
- c1 = c1 << 16 >>> 0;
735
- lo = lo + c1 >>> 0;
736
- if (lo >>> 0 < c1 >>> 0) {
737
- hi = hi + 1 >>> 0;
738
- }
739
- hi = hi + Math.imul(aLo, bHi) >>> 0;
740
- hi = hi + Math.imul(aHi, bLo) >>> 0;
741
- out[0] = hi;
742
- out[1] = lo;
743
- }
744
- function add64(out, aHi, aLo, bHi, bLo) {
745
- let hi = aHi + bHi >>> 0;
746
- const lo = aLo + bLo >>> 0;
747
- if (lo >>> 0 < aLo >>> 0) {
748
- hi = hi + 1 | 0;
749
- }
750
- out[0] = hi;
751
- out[1] = lo;
752
- }
753
- var YieldWrapTypeId = /* @__PURE__ */ Symbol.for("effect/Utils/YieldWrap");
754
- var YieldWrap = class {
755
- /**
756
- * @since 3.0.6
757
- */
758
- #value;
759
- constructor(value) {
760
- this.#value = value;
761
- }
762
- /**
763
- * @since 3.0.6
764
- */
765
- [YieldWrapTypeId]() {
766
- return this.#value;
767
- }
768
- };
769
- function yieldWrapGet(self) {
770
- if (typeof self === "object" && self !== null && YieldWrapTypeId in self) {
771
- return self[YieldWrapTypeId]();
772
- }
773
- throw new Error(getBugErrorMessage("yieldWrapGet"));
774
- }
775
- var structuralRegionState = /* @__PURE__ */ globalValue("effect/Utils/isStructuralRegion", () => ({
776
- enabled: false,
777
- tester: void 0
778
- }));
779
-
780
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Hash.js
781
- var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => /* @__PURE__ */ new WeakMap());
782
- var pcgr = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/pcgr"), () => new PCGRandom());
783
- var symbol = /* @__PURE__ */ Symbol.for("effect/Hash");
784
- var hash = (self) => {
785
- if (structuralRegionState.enabled === true) {
786
- return 0;
787
- }
788
- switch (typeof self) {
789
- case "number":
790
- return number(self);
791
- case "bigint":
792
- return string(self.toString(10));
793
- case "boolean":
794
- return string(String(self));
795
- case "symbol":
796
- return string(String(self));
797
- case "string":
798
- return string(self);
799
- case "undefined":
800
- return string("undefined");
801
- case "function":
802
- case "object": {
803
- if (self === null) {
804
- return string("null");
805
- } else if (self instanceof Date) {
806
- return hash(self.toISOString());
807
- } else if (isHash(self)) {
808
- return self[symbol]();
809
- } else {
810
- return random(self);
811
- }
812
- }
813
- default:
814
- throw new Error(`BUG: unhandled typeof ${typeof self} - please report an issue at https://github.com/Effect-TS/effect/issues`);
815
- }
816
- };
817
- var random = (self) => {
818
- if (!randomHashCache.has(self)) {
819
- randomHashCache.set(self, number(pcgr.integer(Number.MAX_SAFE_INTEGER)));
820
- }
821
- return randomHashCache.get(self);
822
- };
823
- var combine = (b) => (self) => self * 53 ^ b;
824
- var optimize = (n) => n & 3221225471 | n >>> 1 & 1073741824;
825
- var isHash = (u) => hasProperty(u, symbol);
826
- var number = (n) => {
827
- if (n !== n || n === Infinity) {
828
- return 0;
829
- }
830
- let h = n | 0;
831
- if (h !== n) {
832
- h ^= n * 4294967295;
833
- }
834
- while (n > 4294967295) {
835
- h ^= n /= 4294967295;
836
- }
837
- return optimize(n);
838
- };
839
- var string = (str) => {
840
- let h = 5381, i = str.length;
841
- while (i) {
842
- h = h * 33 ^ str.charCodeAt(--i);
843
- }
844
- return optimize(h);
845
- };
846
- var cached = function() {
847
- if (arguments.length === 1) {
848
- const self2 = arguments[0];
849
- return function(hash3) {
850
- Object.defineProperty(self2, symbol, {
851
- value() {
852
- return hash3;
853
- },
854
- enumerable: false
855
- });
856
- return hash3;
857
- };
858
- }
859
- const self = arguments[0];
860
- const hash2 = arguments[1];
861
- Object.defineProperty(self, symbol, {
862
- value() {
863
- return hash2;
864
- },
865
- enumerable: false
866
- });
867
- return hash2;
868
- };
869
-
870
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Equal.js
871
- var symbol2 = /* @__PURE__ */ Symbol.for("effect/Equal");
872
- function equals() {
873
- if (arguments.length === 1) {
874
- return (self) => compareBoth(self, arguments[0]);
875
- }
876
- return compareBoth(arguments[0], arguments[1]);
877
- }
878
- function compareBoth(self, that) {
879
- if (self === that) {
880
- return true;
881
- }
882
- const selfType = typeof self;
883
- if (selfType !== typeof that) {
884
- return false;
885
- }
886
- if (selfType === "object" || selfType === "function") {
887
- if (self !== null && that !== null) {
888
- if (isEqual(self) && isEqual(that)) {
889
- if (hash(self) === hash(that) && self[symbol2](that)) {
890
- return true;
891
- } else {
892
- return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
893
- }
894
- } else if (self instanceof Date && that instanceof Date) {
895
- return self.toISOString() === that.toISOString();
896
- }
897
- }
898
- if (structuralRegionState.enabled) {
899
- if (Array.isArray(self) && Array.isArray(that)) {
900
- return self.length === that.length && self.every((v, i) => compareBoth(v, that[i]));
901
- }
902
- if (Object.getPrototypeOf(self) === Object.prototype && Object.getPrototypeOf(self) === Object.prototype) {
903
- const keysSelf = Object.keys(self);
904
- const keysThat = Object.keys(that);
905
- if (keysSelf.length === keysThat.length) {
906
- for (const key of keysSelf) {
907
- if (!(key in that && compareBoth(self[key], that[key]))) {
908
- return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
909
- }
910
- }
911
- return true;
912
- }
913
- }
914
- return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
915
- }
916
- }
917
- return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
918
- }
919
- var isEqual = (u) => hasProperty(u, symbol2);
920
- var equivalence = () => equals;
921
-
922
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Inspectable.js
923
- var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
924
- var toJSON = (x) => {
925
- if (hasProperty(x, "toJSON") && isFunction2(x["toJSON"]) && x["toJSON"].length === 0) {
926
- return x.toJSON();
927
- } else if (Array.isArray(x)) {
928
- return x.map(toJSON);
929
- }
930
- return x;
931
- };
932
- var format = (x) => JSON.stringify(x, null, 2);
933
-
934
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Pipeable.js
935
- var pipeArguments = (self, args) => {
936
- switch (args.length) {
937
- case 1:
938
- return args[0](self);
939
- case 2:
940
- return args[1](args[0](self));
941
- case 3:
942
- return args[2](args[1](args[0](self)));
943
- case 4:
944
- return args[3](args[2](args[1](args[0](self))));
945
- case 5:
946
- return args[4](args[3](args[2](args[1](args[0](self)))));
947
- case 6:
948
- return args[5](args[4](args[3](args[2](args[1](args[0](self))))));
949
- case 7:
950
- return args[6](args[5](args[4](args[3](args[2](args[1](args[0](self)))))));
951
- case 8:
952
- return args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self))))))));
953
- case 9:
954
- return args[8](args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self)))))))));
955
- default: {
956
- let ret = self;
957
- for (let i = 0, len = args.length; i < len; i++) {
958
- ret = args[i](ret);
959
- }
960
- return ret;
961
- }
962
- }
963
- };
964
-
965
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/internal/effectable.js
966
- var EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
967
- var StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
968
- var SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
969
- var ChannelTypeId = /* @__PURE__ */ Symbol.for("effect/Channel");
970
- var effectVariance = {
971
- /* c8 ignore next */
972
- _R: (_) => _,
973
- /* c8 ignore next */
974
- _E: (_) => _,
975
- /* c8 ignore next */
976
- _A: (_) => _,
977
- _V: /* @__PURE__ */ getCurrentVersion()
978
- };
979
- var sinkVariance = {
980
- /* c8 ignore next */
981
- _A: (_) => _,
982
- /* c8 ignore next */
983
- _In: (_) => _,
984
- /* c8 ignore next */
985
- _L: (_) => _,
986
- /* c8 ignore next */
987
- _E: (_) => _,
988
- /* c8 ignore next */
989
- _R: (_) => _
990
- };
991
- var channelVariance = {
992
- /* c8 ignore next */
993
- _Env: (_) => _,
994
- /* c8 ignore next */
995
- _InErr: (_) => _,
996
- /* c8 ignore next */
997
- _InElem: (_) => _,
998
- /* c8 ignore next */
999
- _InDone: (_) => _,
1000
- /* c8 ignore next */
1001
- _OutErr: (_) => _,
1002
- /* c8 ignore next */
1003
- _OutElem: (_) => _,
1004
- /* c8 ignore next */
1005
- _OutDone: (_) => _
1006
- };
1007
- var EffectPrototype = {
1008
- [EffectTypeId]: effectVariance,
1009
- [StreamTypeId]: effectVariance,
1010
- [SinkTypeId]: sinkVariance,
1011
- [ChannelTypeId]: channelVariance,
1012
- [symbol2](that) {
1013
- return this === that;
1014
- },
1015
- [symbol]() {
1016
- return cached(this, random(this));
1017
- },
1018
- [Symbol.iterator]() {
1019
- return new SingleShotGen(new YieldWrap(this));
1020
- },
1021
- pipe() {
1022
- return pipeArguments(this, arguments);
1023
- }
1024
- };
1025
-
1026
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/internal/option.js
1027
- var TypeId = /* @__PURE__ */ Symbol.for("effect/Option");
1028
- var CommonProto = {
1029
- ...EffectPrototype,
1030
- [TypeId]: {
1031
- _A: (_) => _
1032
- },
1033
- [NodeInspectSymbol]() {
1034
- return this.toJSON();
1035
- },
1036
- toString() {
1037
- return format(this.toJSON());
1038
- }
1039
- };
1040
- var SomeProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto), {
1041
- _tag: "Some",
1042
- _op: "Some",
1043
- [symbol2](that) {
1044
- return isOption(that) && isSome(that) && equals(this.value, that.value);
1045
- },
1046
- [symbol]() {
1047
- return cached(this, combine(hash(this._tag))(hash(this.value)));
1048
- },
1049
- toJSON() {
1050
- return {
1051
- _id: "Option",
1052
- _tag: this._tag,
1053
- value: toJSON(this.value)
1054
- };
1055
- }
1056
- });
1057
- var NoneHash = /* @__PURE__ */ hash("None");
1058
- var NoneProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto), {
1059
- _tag: "None",
1060
- _op: "None",
1061
- [symbol2](that) {
1062
- return isOption(that) && isNone(that);
1063
- },
1064
- [symbol]() {
1065
- return NoneHash;
1066
- },
1067
- toJSON() {
1068
- return {
1069
- _id: "Option",
1070
- _tag: this._tag
1071
- };
1072
- }
1073
- });
1074
- var isOption = (input) => hasProperty(input, TypeId);
1075
- var isNone = (fa) => fa._tag === "None";
1076
- var isSome = (fa) => fa._tag === "Some";
1077
- var none = /* @__PURE__ */ Object.create(NoneProto);
1078
- var some2 = (value) => {
1079
- const a = Object.create(SomeProto);
1080
- a.value = value;
1081
- return a;
1082
- };
1083
-
1084
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/internal/either.js
1085
- var TypeId2 = /* @__PURE__ */ Symbol.for("effect/Either");
1086
- var CommonProto2 = {
1087
- ...EffectPrototype,
1088
- [TypeId2]: {
1089
- _R: (_) => _
1090
- },
1091
- [NodeInspectSymbol]() {
1092
- return this.toJSON();
1093
- },
1094
- toString() {
1095
- return format(this.toJSON());
1096
- }
1097
- };
1098
- var RightProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
1099
- _tag: "Right",
1100
- _op: "Right",
1101
- [symbol2](that) {
1102
- return isEither(that) && isRight(that) && equals(this.right, that.right);
1103
- },
1104
- [symbol]() {
1105
- return combine(hash(this._tag))(hash(this.right));
1106
- },
1107
- toJSON() {
1108
- return {
1109
- _id: "Either",
1110
- _tag: this._tag,
1111
- right: toJSON(this.right)
1112
- };
1113
- }
1114
- });
1115
- var LeftProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
1116
- _tag: "Left",
1117
- _op: "Left",
1118
- [symbol2](that) {
1119
- return isEither(that) && isLeft(that) && equals(this.left, that.left);
1120
- },
1121
- [symbol]() {
1122
- return combine(hash(this._tag))(hash(this.left));
1123
- },
1124
- toJSON() {
1125
- return {
1126
- _id: "Either",
1127
- _tag: this._tag,
1128
- left: toJSON(this.left)
1129
- };
1130
- }
1131
- });
1132
- var isEither = (input) => hasProperty(input, TypeId2);
1133
- var isLeft = (ma) => ma._tag === "Left";
1134
- var isRight = (ma) => ma._tag === "Right";
1135
- var left = (left2) => {
1136
- const a = Object.create(LeftProto);
1137
- a.left = left2;
1138
- return a;
1139
- };
1140
- var right = (right2) => {
1141
- const a = Object.create(RightProto);
1142
- a.right = right2;
1143
- return a;
1144
- };
1145
- var getLeft = (self) => isRight(self) ? none : some2(self.left);
1146
- var getRight = (self) => isLeft(self) ? none : some2(self.right);
1147
-
1148
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Either.js
1149
- var isLeft2 = isLeft;
1150
- var isRight2 = isRight;
1151
-
1152
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/internal/array.js
1153
- var isNonEmptyArray = (self) => self.length > 0;
1154
-
1155
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Option.js
1156
- var Option_exports = {};
1157
- __export(Option_exports, {
1158
- Do: () => Do,
1159
- TypeId: () => TypeId3,
1160
- all: () => all2,
1161
- andThen: () => andThen,
1162
- ap: () => ap,
1163
- as: () => as,
1164
- asVoid: () => asVoid,
1165
- bind: () => bind2,
1166
- bindTo: () => bindTo2,
1167
- composeK: () => composeK,
1168
- contains: () => contains,
1169
- containsWith: () => containsWith,
1170
- exists: () => exists,
1171
- filter: () => filter,
1172
- filterMap: () => filterMap,
1173
- firstSomeOf: () => firstSomeOf,
1174
- flatMap: () => flatMap,
1175
- flatMapNullable: () => flatMapNullable,
1176
- flatten: () => flatten,
1177
- fromIterable: () => fromIterable,
1178
- fromNullable: () => fromNullable,
1179
- gen: () => gen,
1180
- getEquivalence: () => getEquivalence,
1181
- getLeft: () => getLeft2,
1182
- getOrElse: () => getOrElse,
1183
- getOrNull: () => getOrNull,
1184
- getOrThrow: () => getOrThrow,
1185
- getOrThrowWith: () => getOrThrowWith,
1186
- getOrUndefined: () => getOrUndefined,
1187
- getOrder: () => getOrder,
1188
- getRight: () => getRight2,
1189
- isNone: () => isNone2,
1190
- isOption: () => isOption2,
1191
- isSome: () => isSome2,
1192
- let: () => let_2,
1193
- lift2: () => lift2,
1194
- liftNullable: () => liftNullable,
1195
- liftPredicate: () => liftPredicate,
1196
- liftThrowable: () => liftThrowable,
1197
- map: () => map,
1198
- match: () => match,
1199
- none: () => none2,
1200
- orElse: () => orElse,
1201
- orElseEither: () => orElseEither,
1202
- orElseSome: () => orElseSome,
1203
- partitionMap: () => partitionMap,
1204
- product: () => product2,
1205
- productMany: () => productMany2,
1206
- reduceCompact: () => reduceCompact,
1207
- some: () => some3,
1208
- tap: () => tap,
1209
- toArray: () => toArray,
1210
- toRefinement: () => toRefinement,
1211
- void: () => void_,
1212
- zipLeft: () => zipLeft,
1213
- zipRight: () => zipRight,
1214
- zipWith: () => zipWith
1215
- });
1216
-
1217
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Order.js
1218
- var make2 = (compare) => (self, that) => self === that ? 0 : compare(self, that);
1219
- var number2 = /* @__PURE__ */ make2((self, that) => self < that ? -1 : 1);
1220
- var combineMany = /* @__PURE__ */ dual(2, (self, collection) => make2((a1, a2) => {
1221
- let out = self(a1, a2);
1222
- if (out !== 0) {
1223
- return out;
1224
- }
1225
- for (const O of collection) {
1226
- out = O(a1, a2);
1227
- if (out !== 0) {
1228
- return out;
1229
- }
1230
- }
1231
- return out;
1232
- }));
1233
- var empty = () => make2(() => 0);
1234
- var combineAll = (collection) => combineMany(empty(), collection);
1235
- var mapInput2 = /* @__PURE__ */ dual(2, (self, f) => make2((b1, b2) => self(f(b1), f(b2))));
1236
- var array2 = (O) => make2((self, that) => {
1237
- const aLen = self.length;
1238
- const bLen = that.length;
1239
- const len = Math.min(aLen, bLen);
1240
- for (let i = 0; i < len; i++) {
1241
- const o = O(self[i], that[i]);
1242
- if (o !== 0) {
1243
- return o;
1244
- }
1245
- }
1246
- return number2(aLen, bLen);
1247
- });
1248
- var min = (O) => dual(2, (self, that) => self === that || O(self, that) < 1 ? self : that);
1249
- var max = (O) => dual(2, (self, that) => self === that || O(self, that) > -1 ? self : that);
1250
-
1251
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Option.js
1252
- var TypeId3 = /* @__PURE__ */ Symbol.for("effect/Option");
1253
- var none2 = () => none;
1254
- var some3 = some2;
1255
- var isOption2 = isOption;
1256
- var isNone2 = isNone;
1257
- var isSome2 = isSome;
1258
- var match = /* @__PURE__ */ dual(2, (self, {
1259
- onNone,
1260
- onSome
1261
- }) => isNone2(self) ? onNone() : onSome(self.value));
1262
- var toRefinement = (f) => (a) => isSome2(f(a));
1263
- var fromIterable = (collection) => {
1264
- for (const a of collection) {
1265
- return some3(a);
1266
- }
1267
- return none2();
1268
- };
1269
- var getRight2 = getRight;
1270
- var getLeft2 = getLeft;
1271
- var getOrElse = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? onNone() : self.value);
1272
- var orElse = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? that() : self);
1273
- var orElseSome = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? some3(onNone()) : self);
1274
- var orElseEither = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? map(that(), right) : map(self, left));
1275
- var firstSomeOf = (collection) => {
1276
- let out = none2();
1277
- for (out of collection) {
1278
- if (isSome2(out)) {
1279
- return out;
1280
- }
1281
- }
1282
- return out;
1283
- };
1284
- var fromNullable = (nullableValue) => nullableValue == null ? none2() : some3(nullableValue);
1285
- var liftNullable = (f) => (...a) => fromNullable(f(...a));
1286
- var getOrNull = /* @__PURE__ */ getOrElse(constNull);
1287
- var getOrUndefined = /* @__PURE__ */ getOrElse(constUndefined);
1288
- var liftThrowable = (f) => (...a) => {
1289
- try {
1290
- return some3(f(...a));
1291
- } catch (e) {
1292
- return none2();
1293
- }
1294
- };
1295
- var getOrThrowWith = /* @__PURE__ */ dual(2, (self, onNone) => {
1296
- if (isSome2(self)) {
1297
- return self.value;
1298
- }
1299
- throw onNone();
1300
- });
1301
- var getOrThrow = /* @__PURE__ */ getOrThrowWith(() => new Error("getOrThrow called on a None"));
1302
- var map = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : some3(f(self.value)));
1303
- var as = /* @__PURE__ */ dual(2, (self, b) => map(self, () => b));
1304
- var asVoid = /* @__PURE__ */ as(void 0);
1305
- var void_ = /* @__PURE__ */ some3(void 0);
1306
- var flatMap = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : f(self.value));
1307
- var andThen = /* @__PURE__ */ dual(2, (self, f) => flatMap(self, (a) => {
1308
- const b = isFunction(f) ? f(a) : f;
1309
- return isOption2(b) ? b : some3(b);
1310
- }));
1311
- var flatMapNullable = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : fromNullable(f(self.value)));
1312
- var flatten = /* @__PURE__ */ flatMap(identity);
1313
- var zipRight = /* @__PURE__ */ dual(2, (self, that) => flatMap(self, () => that));
1314
- var composeK = /* @__PURE__ */ dual(2, (afb, bfc) => (a) => flatMap(afb(a), bfc));
1315
- var zipLeft = /* @__PURE__ */ dual(2, (self, that) => tap(self, () => that));
1316
- var tap = /* @__PURE__ */ dual(2, (self, f) => flatMap(self, (a) => map(f(a), () => a)));
1317
- var product2 = (self, that) => isSome2(self) && isSome2(that) ? some3([self.value, that.value]) : none2();
1318
- var productMany2 = (self, collection) => {
1319
- if (isNone2(self)) {
1320
- return none2();
1321
- }
1322
- const out = [self.value];
1323
- for (const o of collection) {
1324
- if (isNone2(o)) {
1325
- return none2();
1326
- }
1327
- out.push(o.value);
1328
- }
1329
- return some3(out);
1330
- };
1331
- var all2 = (input) => {
1332
- if (Symbol.iterator in input) {
1333
- const out2 = [];
1334
- for (const o of input) {
1335
- if (isNone2(o)) {
1336
- return none2();
1337
- }
1338
- out2.push(o.value);
1339
- }
1340
- return some3(out2);
1341
- }
1342
- const out = {};
1343
- for (const key of Object.keys(input)) {
1344
- const o = input[key];
1345
- if (isNone2(o)) {
1346
- return none2();
1347
- }
1348
- out[key] = o.value;
1349
- }
1350
- return some3(out);
1351
- };
1352
- var zipWith = /* @__PURE__ */ dual(3, (self, that, f) => map(product2(self, that), ([a, b]) => f(a, b)));
1353
- var ap = /* @__PURE__ */ dual(2, (self, that) => zipWith(self, that, (f, a) => f(a)));
1354
- var reduceCompact = /* @__PURE__ */ dual(3, (self, b, f) => {
1355
- let out = b;
1356
- for (const oa of self) {
1357
- if (isSome2(oa)) {
1358
- out = f(out, oa.value);
1359
- }
1360
- }
1361
- return out;
1362
- });
1363
- var toArray = (self) => isNone2(self) ? [] : [self.value];
1364
- var partitionMap = /* @__PURE__ */ dual(2, (self, f) => {
1365
- if (isNone2(self)) {
1366
- return [none2(), none2()];
1367
- }
1368
- const e = f(self.value);
1369
- return isLeft(e) ? [some3(e.left), none2()] : [none2(), some3(e.right)];
1370
- });
1371
- var filterMap = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : f(self.value));
1372
- var filter = /* @__PURE__ */ dual(2, (self, predicate) => filterMap(self, (b) => predicate(b) ? some2(b) : none));
1373
- var getEquivalence = (isEquivalent) => make((x, y) => isNone2(x) ? isNone2(y) : isNone2(y) ? false : isEquivalent(x.value, y.value));
1374
- var getOrder = (O) => make2((self, that) => isSome2(self) ? isSome2(that) ? O(self.value, that.value) : 1 : -1);
1375
- var lift2 = (f) => dual(2, (self, that) => zipWith(self, that, f));
1376
- var liftPredicate = (predicate) => (b) => predicate(b) ? some3(b) : none2();
1377
- var containsWith = (isEquivalent) => dual(2, (self, a) => isNone2(self) ? false : isEquivalent(self.value, a));
1378
- var _equivalence = /* @__PURE__ */ equivalence();
1379
- var contains = /* @__PURE__ */ containsWith(_equivalence);
1380
- var exists = /* @__PURE__ */ dual(2, (self, refinement) => isNone2(self) ? false : refinement(self.value));
1381
- var bindTo2 = /* @__PURE__ */ bindTo(map);
1382
- var let_2 = /* @__PURE__ */ let_(map);
1383
- var bind2 = /* @__PURE__ */ bind(map, flatMap);
1384
- var Do = /* @__PURE__ */ some3({});
1385
- var adapter2 = /* @__PURE__ */ adapter();
1386
- var gen = (...args) => {
1387
- let f;
1388
- if (args.length === 1) {
1389
- f = args[0];
1390
- } else {
1391
- f = args[1].bind(args[0]);
1392
- }
1393
- const iterator = f(adapter2);
1394
- let state = iterator.next();
1395
- if (state.done) {
1396
- return some3(state.value);
1397
- } else {
1398
- let current = state.value;
1399
- if (isGenKind(current)) {
1400
- current = current.value;
1401
- } else {
1402
- current = yieldWrapGet(current);
1403
- }
1404
- if (isNone2(current)) {
1405
- return current;
1406
- }
1407
- while (!state.done) {
1408
- state = iterator.next(current.value);
1409
- if (!state.done) {
1410
- current = state.value;
1411
- if (isGenKind(current)) {
1412
- current = current.value;
1413
- } else {
1414
- current = yieldWrapGet(current);
1415
- }
1416
- if (isNone2(current)) {
1417
- return current;
1418
- }
1419
- }
1420
- }
1421
- return some3(state.value);
1422
- }
1423
- };
1424
-
1425
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Tuple.js
1426
- var make3 = (...elements) => elements;
1427
-
1428
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Iterable.js
1429
- var findFirst = /* @__PURE__ */ dual(2, (self, f) => {
1430
- let i = 0;
1431
- for (const a of self) {
1432
- const o = f(a, i);
1433
- if (isBoolean(o)) {
1434
- if (o) {
1435
- return some3(a);
1436
- }
1437
- } else {
1438
- if (isSome2(o)) {
1439
- return o;
1440
- }
1441
- }
1442
- i++;
1443
- }
1444
- return none2();
1445
- });
1446
-
1447
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Record.js
1448
- var collect = /* @__PURE__ */ dual(2, (self, f) => {
1449
- const out = [];
1450
- for (const key of keys(self)) {
1451
- out.push(f(key, self[key]));
1452
- }
1453
- return out;
1454
- });
1455
- var toEntries = /* @__PURE__ */ collect((key, value) => [key, value]);
1456
- var keys = (self) => Object.keys(self);
1457
-
1458
- // ../../../node_modules/.pnpm/effect@3.3.3/node_modules/effect/dist/esm/Array.js
1459
- var make4 = (...elements) => elements;
1460
- var allocate = (n) => new Array(n);
1461
- var makeBy = (n, f) => {
1462
- const max3 = Math.max(1, Math.floor(n));
1463
- const out = new Array(max3);
1464
- for (let i = 0; i < max3; i++) {
1465
- out[i] = f(i);
1466
- }
1467
- return out;
1468
- };
1469
- var range = (start, end) => start <= end ? makeBy(end - start + 1, (i) => start + i) : [start];
1470
- var replicate = /* @__PURE__ */ dual(2, (a, n) => makeBy(n, () => a));
1471
- var fromIterable2 = (collection) => Array.isArray(collection) ? collection : Array.from(collection);
1472
- var fromRecord = toEntries;
1473
- var fromOption2 = toArray;
1474
- var match2 = /* @__PURE__ */ dual(2, (self, {
1475
- onEmpty,
1476
- onNonEmpty
1477
- }) => isNonEmptyReadonlyArray(self) ? onNonEmpty(self) : onEmpty());
1478
- var matchLeft = /* @__PURE__ */ dual(2, (self, {
1479
- onEmpty,
1480
- onNonEmpty
1481
- }) => isNonEmptyReadonlyArray(self) ? onNonEmpty(headNonEmpty(self), tailNonEmpty(self)) : onEmpty());
1482
- var matchRight = /* @__PURE__ */ dual(2, (self, {
1483
- onEmpty,
1484
- onNonEmpty
1485
- }) => isNonEmptyReadonlyArray(self) ? onNonEmpty(initNonEmpty(self), lastNonEmpty(self)) : onEmpty());
1486
- var prepend = /* @__PURE__ */ dual(2, (self, head2) => [head2, ...self]);
1487
- var prependAll = /* @__PURE__ */ dual(2, (self, that) => fromIterable2(that).concat(fromIterable2(self)));
1488
- var append = /* @__PURE__ */ dual(2, (self, last2) => [...self, last2]);
1489
- var appendAll = /* @__PURE__ */ dual(2, (self, that) => fromIterable2(self).concat(fromIterable2(that)));
1490
- var scan = /* @__PURE__ */ dual(3, (self, b, f) => {
1491
- const out = [b];
1492
- let i = 0;
1493
- for (const a of self) {
1494
- out[i + 1] = f(out[i], a);
1495
- i++;
1496
- }
1497
- return out;
1498
- });
1499
- var scanRight = /* @__PURE__ */ dual(3, (self, b, f) => {
1500
- const input = fromIterable2(self);
1501
- const out = new Array(input.length + 1);
1502
- out[input.length] = b;
1503
- for (let i = input.length - 1; i >= 0; i--) {
1504
- out[i] = f(out[i + 1], input[i]);
1505
- }
1506
- return out;
1507
- });
1508
- var isArray = Array.isArray;
1509
- var isEmptyArray = (self) => self.length === 0;
1510
- var isEmptyReadonlyArray = isEmptyArray;
1511
- var isNonEmptyArray2 = isNonEmptyArray;
1512
- var isNonEmptyReadonlyArray = isNonEmptyArray;
1513
- var length = (self) => self.length;
1514
- var isOutOfBound = (i, as2) => i < 0 || i >= as2.length;
1515
- var clamp = (i, as2) => Math.floor(Math.min(Math.max(0, i), as2.length));
1516
- var get = /* @__PURE__ */ dual(2, (self, index) => {
1517
- const i = Math.floor(index);
1518
- return isOutOfBound(i, self) ? none2() : some3(self[i]);
1519
- });
1520
- var unsafeGet = /* @__PURE__ */ dual(2, (self, index) => {
1521
- const i = Math.floor(index);
1522
- if (isOutOfBound(i, self)) {
1523
- throw new Error(`Index ${i} out of bounds`);
1524
- }
1525
- return self[i];
1526
- });
1527
- var unprepend = (self) => [headNonEmpty(self), tailNonEmpty(self)];
1528
- var unappend = (self) => [initNonEmpty(self), lastNonEmpty(self)];
1529
- var head = /* @__PURE__ */ get(0);
1530
- var headNonEmpty = /* @__PURE__ */ unsafeGet(0);
1531
- var last = (self) => isNonEmptyReadonlyArray(self) ? some3(lastNonEmpty(self)) : none2();
1532
- var lastNonEmpty = (self) => self[self.length - 1];
1533
- var tail = (self) => {
1534
- const input = fromIterable2(self);
1535
- return isNonEmptyReadonlyArray(input) ? some3(tailNonEmpty(input)) : none2();
1536
- };
1537
- var tailNonEmpty = (self) => self.slice(1);
1538
- var init = (self) => {
1539
- const input = fromIterable2(self);
1540
- return isNonEmptyReadonlyArray(input) ? some3(initNonEmpty(input)) : none2();
1541
- };
1542
- var initNonEmpty = (self) => self.slice(0, -1);
1543
- var take = /* @__PURE__ */ dual(2, (self, n) => {
1544
- const input = fromIterable2(self);
1545
- return input.slice(0, clamp(n, input));
1546
- });
1547
- var takeRight = /* @__PURE__ */ dual(2, (self, n) => {
1548
- const input = fromIterable2(self);
1549
- const i = clamp(n, input);
1550
- return i === 0 ? [] : input.slice(-i);
1551
- });
1552
- var takeWhile = /* @__PURE__ */ dual(2, (self, predicate) => {
1553
- let i = 0;
1554
- const out = [];
1555
- for (const a of self) {
1556
- if (!predicate(a, i)) {
1557
- break;
1558
- }
1559
- out.push(a);
1560
- i++;
1561
- }
1562
- return out;
1563
- });
1564
- var spanIndex = (self, predicate) => {
1565
- let i = 0;
1566
- for (const a of self) {
1567
- if (!predicate(a, i)) {
1568
- break;
1569
- }
1570
- i++;
1571
- }
1572
- return i;
1573
- };
1574
- var span = /* @__PURE__ */ dual(2, (self, predicate) => splitAt(self, spanIndex(self, predicate)));
1575
- var drop = /* @__PURE__ */ dual(2, (self, n) => {
1576
- const input = fromIterable2(self);
1577
- return input.slice(clamp(n, input), input.length);
1578
- });
1579
- var dropRight = /* @__PURE__ */ dual(2, (self, n) => {
1580
- const input = fromIterable2(self);
1581
- return input.slice(0, input.length - clamp(n, input));
1582
- });
1583
- var dropWhile = /* @__PURE__ */ dual(2, (self, predicate) => fromIterable2(self).slice(spanIndex(self, predicate)));
1584
- var findFirstIndex = /* @__PURE__ */ dual(2, (self, predicate) => {
1585
- let i = 0;
1586
- for (const a of self) {
1587
- if (predicate(a, i)) {
1588
- return some3(i);
1589
- }
1590
- i++;
1591
- }
1592
- return none2();
1593
- });
1594
- var findLastIndex = /* @__PURE__ */ dual(2, (self, predicate) => {
1595
- const input = fromIterable2(self);
1596
- for (let i = input.length - 1; i >= 0; i--) {
1597
- if (predicate(input[i], i)) {
1598
- return some3(i);
1599
- }
1600
- }
1601
- return none2();
1602
- });
1603
- var findFirst2 = findFirst;
1604
- var findLast = /* @__PURE__ */ dual(2, (self, f) => {
1605
- const input = fromIterable2(self);
1606
- for (let i = input.length - 1; i >= 0; i--) {
1607
- const a = input[i];
1608
- const o = f(a, i);
1609
- if (isBoolean(o)) {
1610
- if (o) {
1611
- return some3(a);
1612
- }
1613
- } else {
1614
- if (isSome2(o)) {
1615
- return o;
1616
- }
1617
- }
1618
- }
1619
- return none2();
1620
- });
1621
- var insertAt = /* @__PURE__ */ dual(3, (self, i, b) => {
1622
- const out = Array.from(self);
1623
- if (i < 0 || i > out.length) {
1624
- return none2();
1625
- }
1626
- out.splice(i, 0, b);
1627
- return some3(out);
1628
- });
1629
- var replace = /* @__PURE__ */ dual(3, (self, i, b) => modify(self, i, () => b));
1630
- var replaceOption = /* @__PURE__ */ dual(3, (self, i, b) => modifyOption(self, i, () => b));
1631
- var modify = /* @__PURE__ */ dual(3, (self, i, f) => getOrElse(modifyOption(self, i, f), () => Array.from(self)));
1632
- var modifyOption = /* @__PURE__ */ dual(3, (self, i, f) => {
1633
- const out = Array.from(self);
1634
- if (isOutOfBound(i, out)) {
1635
- return none2();
1636
- }
1637
- const next = f(out[i]);
1638
- out[i] = next;
1639
- return some3(out);
1640
- });
1641
- var remove = /* @__PURE__ */ dual(2, (self, i) => {
1642
- const out = Array.from(self);
1643
- if (isOutOfBound(i, out)) {
1644
- return out;
1645
- }
1646
- out.splice(i, 1);
1647
- return out;
1648
- });
1649
- var reverse = (self) => Array.from(self).reverse();
1650
- var sort = /* @__PURE__ */ dual(2, (self, O) => {
1651
- const out = Array.from(self);
1652
- out.sort(O);
1653
- return out;
1654
- });
1655
- var sortWith = /* @__PURE__ */ dual(3, (self, f, order) => sort(self, mapInput2(order, f)));
1656
- var sortBy = (...orders) => {
1657
- const sortByAll = sort(combineAll(orders));
1658
- return (self) => {
1659
- const input = fromIterable2(self);
1660
- if (isNonEmptyReadonlyArray(input)) {
1661
- return sortByAll(input);
1662
- }
1663
- return [];
1664
- };
1665
- };
1666
- var zip = /* @__PURE__ */ dual(2, (self, that) => zipWith2(self, that, make3));
1667
- var zipWith2 = /* @__PURE__ */ dual(3, (self, that, f) => {
1668
- const as2 = fromIterable2(self);
1669
- const bs = fromIterable2(that);
1670
- if (isNonEmptyReadonlyArray(as2) && isNonEmptyReadonlyArray(bs)) {
1671
- const out = [f(headNonEmpty(as2), headNonEmpty(bs))];
1672
- const len = Math.min(as2.length, bs.length);
1673
- for (let i = 1; i < len; i++) {
1674
- out[i] = f(as2[i], bs[i]);
1675
- }
1676
- return out;
1677
- }
1678
- return [];
1679
- });
1680
- var unzip = (self) => {
1681
- const input = fromIterable2(self);
1682
- if (isNonEmptyReadonlyArray(input)) {
1683
- const fa = [input[0][0]];
1684
- const fb = [input[0][1]];
1685
- for (let i = 1; i < input.length; i++) {
1686
- fa[i] = input[i][0];
1687
- fb[i] = input[i][1];
1688
- }
1689
- return [fa, fb];
1690
- }
1691
- return [[], []];
1692
- };
1693
- var intersperse = /* @__PURE__ */ dual(2, (self, middle) => {
1694
- const input = fromIterable2(self);
1695
- if (isNonEmptyReadonlyArray(input)) {
1696
- const out = [headNonEmpty(input)];
1697
- const tail2 = tailNonEmpty(input);
1698
- for (let i = 0; i < tail2.length; i++) {
1699
- if (i < tail2.length) {
1700
- out.push(middle);
1701
- }
1702
- out.push(tail2[i]);
1703
- }
1704
- return out;
1705
- }
1706
- return [];
1707
- });
1708
- var modifyNonEmptyHead = /* @__PURE__ */ dual(2, (self, f) => [f(headNonEmpty(self)), ...tailNonEmpty(self)]);
1709
- var setNonEmptyHead = /* @__PURE__ */ dual(2, (self, b) => modifyNonEmptyHead(self, () => b));
1710
- var modifyNonEmptyLast = /* @__PURE__ */ dual(2, (self, f) => append(initNonEmpty(self), f(lastNonEmpty(self))));
1711
- var setNonEmptyLast = /* @__PURE__ */ dual(2, (self, b) => modifyNonEmptyLast(self, () => b));
1712
- var rotate = /* @__PURE__ */ dual(2, (self, n) => {
1713
- const input = fromIterable2(self);
1714
- if (isNonEmptyReadonlyArray(input)) {
1715
- const len = input.length;
1716
- const m = Math.round(n) % len;
1717
- if (isOutOfBound(Math.abs(m), input) || m === 0) {
1718
- return copy(input);
1719
- }
1720
- if (m < 0) {
1721
- const [f, s] = splitNonEmptyAt(input, -m);
1722
- return appendAll(s, f);
1723
- } else {
1724
- return rotate(self, m - len);
1725
- }
1726
- }
1727
- return [];
1728
- });
1729
- var containsWith2 = (isEquivalent) => dual(2, (self, a) => {
1730
- for (const i of self) {
1731
- if (isEquivalent(a, i)) {
1732
- return true;
1733
- }
1734
- }
1735
- return false;
1736
- });
1737
- var _equivalence2 = /* @__PURE__ */ equivalence();
1738
- var contains2 = /* @__PURE__ */ containsWith2(_equivalence2);
1739
- var chop = /* @__PURE__ */ dual(2, (self, f) => {
1740
- const input = fromIterable2(self);
1741
- if (isNonEmptyReadonlyArray(input)) {
1742
- const [b, rest] = f(input);
1743
- const out = [b];
1744
- let next = rest;
1745
- while (isNonEmptyArray(next)) {
1746
- const [b2, rest2] = f(next);
1747
- out.push(b2);
1748
- next = rest2;
1749
- }
1750
- return out;
1751
- }
1752
- return [];
1753
- });
1754
- var splitAt = /* @__PURE__ */ dual(2, (self, n) => {
1755
- const input = Array.from(self);
1756
- const _n = Math.floor(n);
1757
- if (isNonEmptyReadonlyArray(input)) {
1758
- if (_n >= 1) {
1759
- return splitNonEmptyAt(input, _n);
1760
- }
1761
- return [[], input];
1762
- }
1763
- return [input, []];
1764
- });
1765
- var splitNonEmptyAt = /* @__PURE__ */ dual(2, (self, n) => {
1766
- const _n = Math.max(1, Math.floor(n));
1767
- return _n >= self.length ? [copy(self), []] : [prepend(self.slice(1, _n), headNonEmpty(self)), self.slice(_n)];
1768
- });
1769
- var split = /* @__PURE__ */ dual(2, (self, n) => {
1770
- const input = fromIterable2(self);
1771
- return chunksOf(input, Math.ceil(input.length / Math.floor(n)));
1772
- });
1773
- var splitWhere = /* @__PURE__ */ dual(2, (self, predicate) => span(self, (a, i) => !predicate(a, i)));
1774
- var copy = (self) => self.slice();
1775
- var chunksOf = /* @__PURE__ */ dual(2, (self, n) => {
1776
- const input = fromIterable2(self);
1777
- if (isNonEmptyReadonlyArray(input)) {
1778
- return chop(input, splitNonEmptyAt(n));
1779
- }
1780
- return [];
1781
- });
1782
- var groupWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => chop(self, (as2) => {
1783
- const h = headNonEmpty(as2);
1784
- const out = [h];
1785
- let i = 1;
1786
- for (; i < as2.length; i++) {
1787
- const a = as2[i];
1788
- if (isEquivalent(a, h)) {
1789
- out.push(a);
1790
- } else {
1791
- break;
1792
- }
1793
- }
1794
- return [out, as2.slice(i)];
1795
- }));
1796
- var group = /* @__PURE__ */ groupWith(/* @__PURE__ */ equivalence());
1797
- var groupBy = /* @__PURE__ */ dual(2, (self, f) => {
1798
- const out = {};
1799
- for (const a of self) {
1800
- const k = f(a);
1801
- if (Object.prototype.hasOwnProperty.call(out, k)) {
1802
- out[k].push(a);
1803
- } else {
1804
- out[k] = [a];
1805
- }
1806
- }
1807
- return out;
1808
- });
1809
- var unionWith = /* @__PURE__ */ dual(3, (self, that, isEquivalent) => {
1810
- const a = fromIterable2(self);
1811
- const b = fromIterable2(that);
1812
- if (isNonEmptyReadonlyArray(a)) {
1813
- if (isNonEmptyReadonlyArray(b)) {
1814
- const dedupe2 = dedupeWith(isEquivalent);
1815
- return dedupe2(appendAll(a, b));
1816
- }
1817
- return a;
1818
- }
1819
- return b;
1820
- });
1821
- var union = /* @__PURE__ */ dual(2, (self, that) => unionWith(self, that, _equivalence2));
1822
- var intersectionWith = (isEquivalent) => {
1823
- const has = containsWith2(isEquivalent);
1824
- return dual(2, (self, that) => fromIterable2(self).filter((a) => has(that, a)));
1825
- };
1826
- var intersection = /* @__PURE__ */ intersectionWith(_equivalence2);
1827
- var differenceWith = (isEquivalent) => {
1828
- const has = containsWith2(isEquivalent);
1829
- return dual(2, (self, that) => fromIterable2(self).filter((a) => !has(that, a)));
1830
- };
1831
- var difference = /* @__PURE__ */ differenceWith(_equivalence2);
1832
- var empty2 = () => [];
1833
- var of = (a) => [a];
1834
- var map2 = /* @__PURE__ */ dual(2, (self, f) => self.map(f));
1835
- var flatMap2 = /* @__PURE__ */ dual(2, (self, f) => {
1836
- if (isEmptyReadonlyArray(self)) {
1837
- return [];
1838
- }
1839
- const out = [];
1840
- for (let i = 0; i < self.length; i++) {
1841
- const inner = f(self[i], i);
1842
- for (let j = 0; j < inner.length; j++) {
1843
- out.push(inner[j]);
1844
- }
1845
- }
1846
- return out;
1847
- });
1848
- var flatten2 = /* @__PURE__ */ flatMap2(identity);
1849
- var filterMap2 = /* @__PURE__ */ dual(2, (self, f) => {
1850
- const as2 = fromIterable2(self);
1851
- const out = [];
1852
- for (let i = 0; i < as2.length; i++) {
1853
- const o = f(as2[i], i);
1854
- if (isSome2(o)) {
1855
- out.push(o.value);
1856
- }
1857
- }
1858
- return out;
1859
- });
1860
- var filterMapWhile = /* @__PURE__ */ dual(2, (self, f) => {
1861
- let i = 0;
1862
- const out = [];
1863
- for (const a of self) {
1864
- const b = f(a, i);
1865
- if (isSome2(b)) {
1866
- out.push(b.value);
1867
- } else {
1868
- break;
1869
- }
1870
- i++;
1871
- }
1872
- return out;
1873
- });
1874
- var partitionMap2 = /* @__PURE__ */ dual(2, (self, f) => {
1875
- const left2 = [];
1876
- const right2 = [];
1877
- const as2 = fromIterable2(self);
1878
- for (let i = 0; i < as2.length; i++) {
1879
- const e = f(as2[i], i);
1880
- if (isLeft2(e)) {
1881
- left2.push(e.left);
1882
- } else {
1883
- right2.push(e.right);
1884
- }
1885
- }
1886
- return [left2, right2];
1887
- });
1888
- var getSomes = /* @__PURE__ */ filterMap2(identity);
1889
- var getLefts = (self) => {
1890
- const out = [];
1891
- for (const a of self) {
1892
- if (isLeft2(a)) {
1893
- out.push(a.left);
1894
- }
1895
- }
1896
- return out;
1897
- };
1898
- var getRights = (self) => {
1899
- const out = [];
1900
- for (const a of self) {
1901
- if (isRight2(a)) {
1902
- out.push(a.right);
1903
- }
1904
- }
1905
- return out;
1906
- };
1907
- var filter2 = /* @__PURE__ */ dual(2, (self, predicate) => {
1908
- const as2 = fromIterable2(self);
1909
- const out = [];
1910
- for (let i = 0; i < as2.length; i++) {
1911
- if (predicate(as2[i], i)) {
1912
- out.push(as2[i]);
1913
- }
1914
- }
1915
- return out;
1916
- });
1917
- var partition = /* @__PURE__ */ dual(2, (self, predicate) => {
1918
- const left2 = [];
1919
- const right2 = [];
1920
- const as2 = fromIterable2(self);
1921
- for (let i = 0; i < as2.length; i++) {
1922
- if (predicate(as2[i], i)) {
1923
- right2.push(as2[i]);
1924
- } else {
1925
- left2.push(as2[i]);
1926
- }
1927
- }
1928
- return [left2, right2];
1929
- });
1930
- var separate = /* @__PURE__ */ partitionMap2(identity);
1931
- var reduce = /* @__PURE__ */ dual(3, (self, b, f) => fromIterable2(self).reduce((b2, a, i) => f(b2, a, i), b));
1932
- var reduceRight = /* @__PURE__ */ dual(3, (self, b, f) => fromIterable2(self).reduceRight((b2, a, i) => f(b2, a, i), b));
1933
- var liftPredicate2 = (predicate) => (b) => predicate(b) ? [b] : [];
1934
- var liftOption = (f) => (...a) => fromOption2(f(...a));
1935
- var fromNullable2 = (a) => a == null ? empty2() : [a];
1936
- var liftNullable2 = (f) => (...a) => fromNullable2(f(...a));
1937
- var flatMapNullable2 = /* @__PURE__ */ dual(2, (self, f) => flatMap2(self, (a) => fromNullable2(f(a))));
1938
- var liftEither = (f) => (...a) => {
1939
- const e = f(...a);
1940
- return isLeft2(e) ? [] : [e.right];
1941
- };
1942
- var every2 = /* @__PURE__ */ dual(2, (self, refinement) => self.every(refinement));
1943
- var some4 = /* @__PURE__ */ dual(2, (self, predicate) => self.some(predicate));
1944
- var extend = /* @__PURE__ */ dual(2, (self, f) => self.map((_, i, as2) => f(as2.slice(i))));
1945
- var min2 = /* @__PURE__ */ dual(2, (self, O) => self.reduce(min(O)));
1946
- var max2 = /* @__PURE__ */ dual(2, (self, O) => self.reduce(max(O)));
1947
- var unfold = (b, f) => {
1948
- const out = [];
1949
- let next = b;
1950
- let o;
1951
- while (isSome2(o = f(next))) {
1952
- const [a, b2] = o.value;
1953
- out.push(a);
1954
- next = b2;
1955
- }
1956
- return out;
1957
- };
1958
- var getOrder2 = array2;
1959
- var getEquivalence2 = array;
1960
- var forEach = /* @__PURE__ */ dual(2, (self, f) => fromIterable2(self).forEach((a, i) => f(a, i)));
1961
- var dedupeWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
1962
- const input = fromIterable2(self);
1963
- if (isNonEmptyReadonlyArray(input)) {
1964
- const out = [headNonEmpty(input)];
1965
- const rest = tailNonEmpty(input);
1966
- for (const r of rest) {
1967
- if (out.every((a) => !isEquivalent(r, a))) {
1968
- out.push(r);
1969
- }
1970
- }
1971
- return out;
1972
- }
1973
- return [];
1974
- });
1975
- var dedupe = (self) => dedupeWith(self, equivalence());
1976
- var dedupeAdjacentWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
1977
- const out = [];
1978
- let lastA = none2();
1979
- for (const a of self) {
1980
- if (isNone2(lastA) || !isEquivalent(a, lastA.value)) {
1981
- out.push(a);
1982
- lastA = some3(a);
1983
- }
1984
- }
1985
- return out;
1986
- });
1987
- var dedupeAdjacent = /* @__PURE__ */ dedupeAdjacentWith(/* @__PURE__ */ equivalence());
1988
- var join = /* @__PURE__ */ dual(2, (self, sep) => fromIterable2(self).join(sep));
1989
- var mapAccum = /* @__PURE__ */ dual(3, (self, s, f) => {
1990
- let i = 0;
1991
- let s1 = s;
1992
- const out = [];
1993
- for (const a of self) {
1994
- const r = f(s1, a, i);
1995
- s1 = r[0];
1996
- out.push(r[1]);
1997
- i++;
1998
- }
1999
- return [s1, out];
2000
- });
2001
- var cartesianWith = /* @__PURE__ */ dual(3, (self, that, f) => flatMap2(self, (a) => map2(that, (b) => f(a, b))));
2002
- var cartesian = /* @__PURE__ */ dual(2, (self, that) => cartesianWith(self, that, (a, b) => [a, b]));
2003
- var Do2 = /* @__PURE__ */ of({});
2004
- var bind3 = /* @__PURE__ */ bind(map2, flatMap2);
2005
- var bindTo3 = /* @__PURE__ */ bindTo(map2);
2006
- var let_3 = /* @__PURE__ */ let_(map2);
2007
-
2008
- // src/pragma.ts
2009
39
  var RE_JSX_ANNOTATION_REGEX = /@jsx\s+(\S+)/u;
2010
40
  var RE_JS_IDENTIFIER_REGEX = /^[$A-Z_a-z][\w$]*$/u;
2011
41
  function getJSXPragmaFromContext(context) {
2012
42
  const { sourceCode } = context;
2013
- return Function_exports.pipe(
2014
- Array_exports.findFirst(sourceCode.getAllComments(), (node) => RE_JSX_ANNOTATION_REGEX.test(node.value)),
2015
- Option_exports.map(({ value }) => RE_JSX_ANNOTATION_REGEX.exec(value)),
2016
- Option_exports.flatMapNullable((matches) => matches?.[1]),
2017
- Option_exports.filter((pragma) => RE_JS_IDENTIFIER_REGEX.test(pragma))
43
+ return effect.Function.pipe(
44
+ effect.Array.findFirst(sourceCode.getAllComments(), (node) => RE_JSX_ANNOTATION_REGEX.test(node.value)),
45
+ effect.Option.map(({ value }) => RE_JSX_ANNOTATION_REGEX.exec(value)),
46
+ effect.Option.flatMapNullable((matches) => matches?.[1]),
47
+ effect.Option.filter((pragma) => RE_JS_IDENTIFIER_REGEX.test(pragma))
2018
48
  );
2019
49
  }
2020
50
  var { getStaticValue } = ast.ESLintCommunityESLintUtils;
@@ -2028,77 +58,75 @@ function getPropValue(attribute, context) {
2028
58
  const initialScope = context.sourceCode.getScope(attribute);
2029
59
  if (attribute.type === ast.NodeType.JSXAttribute && "value" in attribute) {
2030
60
  const { value } = attribute;
2031
- if (value === null) return Option_exports.none();
2032
- if (value.type === ast.NodeType.Literal) return Option_exports.some(getStaticValue(value, initialScope));
2033
- if (value.type === ast.NodeType.JSXExpressionContainer) return Option_exports.some(getStaticValue(value.expression, initialScope));
2034
- return Option_exports.none();
61
+ if (value === null) return effect.Option.none();
62
+ if (value.type === ast.NodeType.Literal) return effect.Option.some(getStaticValue(value, initialScope));
63
+ if (value.type === ast.NodeType.JSXExpressionContainer) return effect.Option.some(getStaticValue(value.expression, initialScope));
64
+ return effect.Option.none();
2035
65
  }
2036
66
  const { argument } = attribute;
2037
- return Option_exports.some(getStaticValue(argument, initialScope));
67
+ return effect.Option.some(getStaticValue(argument, initialScope));
2038
68
  }
2039
69
  function findPropInProperties(properties, context, initialScope, seenProps = []) {
2040
70
  return (propName) => {
2041
- return Option_exports.fromNullable(
71
+ return effect.Option.fromNullable(
2042
72
  properties.find((prop) => {
2043
73
  return tsPattern.match(prop).when(ast.is(ast.NodeType.Property), (prop2) => {
2044
74
  return "name" in prop2.key && prop2.key.name === propName;
2045
75
  }).when(ast.is(ast.NodeType.SpreadElement), (prop2) => {
2046
76
  return tsPattern.match(prop2.argument).when(ast.is(ast.NodeType.Identifier), (argument) => {
2047
77
  const { name } = argument;
2048
- const maybeInit = Option_exports.flatMap(
78
+ const maybeInit = effect.Option.flatMap(
2049
79
  _var.findVariable(name, initialScope),
2050
80
  _var.getVariableInit(0)
2051
81
  );
2052
- if (Option_exports.isNone(maybeInit)) return false;
2053
- const init2 = maybeInit.value;
2054
- if (init2.type !== ast.NodeType.ObjectExpression) return false;
82
+ if (effect.Option.isNone(maybeInit)) return false;
83
+ const init = maybeInit.value;
84
+ if (init.type !== ast.NodeType.ObjectExpression) return false;
2055
85
  if (seenProps.includes(name)) return false;
2056
- return Option_exports.isSome(
2057
- findPropInProperties(init2.properties, context, initialScope, [...seenProps, name])(propName)
86
+ return effect.Option.isSome(
87
+ findPropInProperties(init.properties, context, initialScope, [...seenProps, name])(propName)
2058
88
  );
2059
89
  }).when(ast.is(ast.NodeType.ObjectExpression), (argument) => {
2060
- return Option_exports.isSome(findPropInProperties(argument.properties, context, initialScope, seenProps)(propName));
90
+ return effect.Option.isSome(findPropInProperties(argument.properties, context, initialScope, seenProps)(propName));
2061
91
  }).when(ast.is(ast.NodeType.MemberExpression), () => {
2062
92
  }).when(ast.is(ast.NodeType.CallExpression), () => {
2063
- }).otherwise(Function_exports.constFalse);
93
+ }).otherwise(effect.Function.constFalse);
2064
94
  }).when(ast.is(ast.NodeType.RestElement), () => {
2065
95
  return false;
2066
- }).otherwise(Function_exports.constFalse);
96
+ }).otherwise(effect.Function.constFalse);
2067
97
  })
2068
98
  );
2069
99
  };
2070
100
  }
2071
101
  function findPropInAttributes(attributes, context, initialScope) {
2072
102
  return (propName) => {
2073
- return Option_exports.fromNullable(
103
+ return effect.Option.fromNullable(
2074
104
  attributes.find((attr) => {
2075
105
  return tsPattern.match(attr).when(ast.is(ast.NodeType.JSXAttribute), (attr2) => getPropName(attr2) === propName).when(ast.is(ast.NodeType.JSXSpreadAttribute), (attr2) => {
2076
106
  return tsPattern.match(attr2.argument).with({ type: ast.NodeType.Identifier }, (argument) => {
2077
107
  const { name } = argument;
2078
- const maybeInit = Option_exports.flatMap(
108
+ const maybeInit = effect.Option.flatMap(
2079
109
  _var.findVariable(name, initialScope),
2080
110
  _var.getVariableInit(0)
2081
111
  );
2082
- if (Option_exports.isNone(maybeInit)) return false;
2083
- const init2 = maybeInit.value;
2084
- if (!("properties" in init2)) return false;
2085
- return Option_exports.isSome(findPropInProperties(init2.properties, context, initialScope)(propName));
112
+ if (effect.Option.isNone(maybeInit)) return false;
113
+ const init = maybeInit.value;
114
+ if (!("properties" in init)) return false;
115
+ return effect.Option.isSome(findPropInProperties(init.properties, context, initialScope)(propName));
2086
116
  }).when(ast.is(ast.NodeType.ObjectExpression), (argument) => {
2087
- return Option_exports.isSome(findPropInProperties(argument.properties, context, initialScope)(propName));
117
+ return effect.Option.isSome(findPropInProperties(argument.properties, context, initialScope)(propName));
2088
118
  }).when(ast.is(ast.NodeType.MemberExpression), () => {
2089
119
  return false;
2090
120
  }).when(ast.is(ast.NodeType.CallExpression), () => {
2091
121
  return false;
2092
- }).otherwise(Function_exports.constFalse);
2093
- }).otherwise(Function_exports.constFalse);
122
+ }).otherwise(effect.Function.constFalse);
123
+ }).otherwise(effect.Function.constFalse);
2094
124
  })
2095
125
  );
2096
126
  };
2097
127
  }
2098
-
2099
- // src/prop/has-prop.ts
2100
128
  function hasProp(attributes, propName, context, initialScope) {
2101
- return Option_exports.isSome(findPropInAttributes(attributes, context, initialScope)(propName));
129
+ return effect.Option.isSome(findPropInAttributes(attributes, context, initialScope)(propName));
2102
130
  }
2103
131
  function hasAnyProp(attributes, propNames, context, initialScope) {
2104
132
  return propNames.some((propName) => hasProp(attributes, propName, context, initialScope));
@@ -2106,7 +134,7 @@ function hasAnyProp(attributes, propNames, context, initialScope) {
2106
134
  function hasEveryProp(attributes, propNames, context, initialScope) {
2107
135
  return propNames.every((propName) => hasProp(attributes, propName, context, initialScope));
2108
136
  }
2109
- function traverseUpProp(node, predicate = Function_exports.constTrue) {
137
+ function traverseUpProp(node, predicate = effect.Function.constTrue) {
2110
138
  const guard = (node2) => {
2111
139
  return node2.type === ast.NodeType.JSXAttribute && predicate(node2);
2112
140
  };
@@ -2116,11 +144,11 @@ function traverseUpProp(node, predicate = Function_exports.constTrue) {
2116
144
  // src/prop/misc.ts
2117
145
  function isInsidePropValue(node) {
2118
146
  if (ast.isStringLiteral(node)) return node.parent.type === ast.NodeType.JSXAttribute;
2119
- return Option_exports.isSome(traverseUpProp(node, (n) => n.value?.type === ast.NodeType.JSXExpressionContainer));
147
+ return effect.Option.isSome(traverseUpProp(node, (n) => n.value?.type === ast.NodeType.JSXExpressionContainer));
2120
148
  }
2121
149
  var isLiteral = ast.isOneOf([ast.NodeType.Literal, ast.NodeType.JSXText]);
2122
150
  function isWhiteSpace(node) {
2123
- return Predicate_exports.isString(node.value) && node.value.trim() === "";
151
+ return effect.Predicate.isString(node.value) && node.value.trim() === "";
2124
152
  }
2125
153
  function isLineBreak(node) {
2126
154
  return isLiteral(node) && isWhiteSpace(node) && ast.isMultiLine(node);
@@ -2143,8 +171,8 @@ var JSXValueHint = {
2143
171
  var DEFAULT_JSX_VALUE_HINT = JSXValueHint.SkipUndefinedLiteral | JSXValueHint.SkipBooleanLiteral;
2144
172
  function isJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
2145
173
  if (!node) return false;
2146
- return tsPattern.match(node).with({ type: ast.NodeType.JSXElement }, Function_exports.constTrue).with({ type: ast.NodeType.JSXFragment }, Function_exports.constTrue).with({ type: ast.NodeType.JSXMemberExpression }, Function_exports.constTrue).with({ type: ast.NodeType.JSXNamespacedName }, Function_exports.constTrue).with({ type: ast.NodeType.Literal }, (node2) => {
2147
- return tsPattern.match(node2.value).with(null, () => !(hint & JSXValueHint.SkipNullLiteral)).with(tsPattern.P.boolean, () => !(hint & JSXValueHint.SkipBooleanLiteral)).with(tsPattern.P.string, () => !(hint & JSXValueHint.SkipStringLiteral)).with(tsPattern.P.number, () => !(hint & JSXValueHint.SkipNumberLiteral)).otherwise(Function_exports.constFalse);
174
+ return tsPattern.match(node).with({ type: ast.NodeType.JSXElement }, effect.Function.constTrue).with({ type: ast.NodeType.JSXFragment }, effect.Function.constTrue).with({ type: ast.NodeType.JSXMemberExpression }, effect.Function.constTrue).with({ type: ast.NodeType.JSXNamespacedName }, effect.Function.constTrue).with({ type: ast.NodeType.Literal }, (node2) => {
175
+ return tsPattern.match(node2.value).with(null, () => !(hint & JSXValueHint.SkipNullLiteral)).with(tsPattern.P.boolean, () => !(hint & JSXValueHint.SkipBooleanLiteral)).with(tsPattern.P.string, () => !(hint & JSXValueHint.SkipStringLiteral)).with(tsPattern.P.number, () => !(hint & JSXValueHint.SkipNumberLiteral)).otherwise(effect.Function.constFalse);
2148
176
  }).with({ type: ast.NodeType.TemplateLiteral }, () => !(hint & JSXValueHint.SkipStringLiteral)).with({ type: ast.NodeType.ArrayExpression }, (node2) => {
2149
177
  if (hint & JSXValueHint.StrictArray) return node2.elements.every((n) => isJSXValue(n, context, hint));
2150
178
  return node2.elements.some((n) => isJSXValue(n, context, hint));
@@ -2172,19 +200,19 @@ function isJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
2172
200
  return isJSXValue(exp, context, hint);
2173
201
  }).with({ type: ast.NodeType.CallExpression }, (node2) => {
2174
202
  if (hint & JSXValueHint.SkipCreateElement) return false;
2175
- return tsPattern.match(node2.callee).with({ type: ast.NodeType.Identifier, name: "createElement" }, Function_exports.constTrue).with({ type: ast.NodeType.MemberExpression, property: { name: "createElement" } }, Function_exports.constTrue).otherwise(Function_exports.constFalse);
203
+ return tsPattern.match(node2.callee).with({ type: ast.NodeType.Identifier, name: "createElement" }, effect.Function.constTrue).with({ type: ast.NodeType.MemberExpression, property: { name: "createElement" } }, effect.Function.constTrue).otherwise(effect.Function.constFalse);
2176
204
  }).with({ type: ast.NodeType.Identifier }, (node2) => {
2177
205
  const { name } = node2;
2178
206
  if (name === "undefined") return !(hint & JSXValueHint.SkipUndefinedLiteral);
2179
207
  if (ast.isJSXTagNameExpression(node2)) return true;
2180
208
  const initialScope = context.sourceCode.getScope(node2);
2181
209
  const maybeVariable = _var.findVariable(name, initialScope);
2182
- return Function_exports.pipe(
210
+ return effect.Function.pipe(
2183
211
  maybeVariable,
2184
- Option_exports.flatMap(_var.getVariableInit(0)),
2185
- Option_exports.exists((n) => isJSXValue(n, context, hint))
212
+ effect.Option.flatMap(_var.getVariableInit(0)),
213
+ effect.Option.exists((n) => isJSXValue(n, context, hint))
2186
214
  );
2187
- }).otherwise(Function_exports.constFalse);
215
+ }).otherwise(effect.Function.constFalse);
2188
216
  }
2189
217
 
2190
218
  exports.DEFAULT_JSX_VALUE_HINT = DEFAULT_JSX_VALUE_HINT;