clanka 0.17.0 → 0.17.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 (62) hide show
  1. package/dist/Agent.d.ts +4 -0
  2. package/dist/Agent.d.ts.map +1 -1
  3. package/dist/Agent.js +5 -1
  4. package/dist/Agent.js.map +1 -1
  5. package/dist/Agent.test.js +35 -0
  6. package/dist/Agent.test.js.map +1 -1
  7. package/dist/AgentCallerConfig.test.js +5 -3
  8. package/dist/AgentCallerConfig.test.js.map +1 -1
  9. package/dist/ChunkRepo.d.ts +1 -1
  10. package/dist/ClaudeAgent.d.ts.map +1 -1
  11. package/dist/ClaudeAgent.js +46 -17
  12. package/dist/ClaudeAgent.js.map +1 -1
  13. package/dist/ClaudeAgent.test.js +87 -16
  14. package/dist/ClaudeAgent.test.js.map +1 -1
  15. package/dist/Compaction.test.js +2 -1
  16. package/dist/Compaction.test.js.map +1 -1
  17. package/dist/CompactionTokens.test.js +15 -8
  18. package/dist/CompactionTokens.test.js.map +1 -1
  19. package/dist/bin/{Effect-On-1ks2z.mjs → Effect-DNYYQ84C.mjs} +421 -367
  20. package/dist/bin/Effect-DNYYQ84C.mjs.map +1 -0
  21. package/dist/bin/Latch-BSlIwuxI.mjs +7 -0
  22. package/dist/bin/Latch-BSlIwuxI.mjs.map +1 -0
  23. package/dist/bin/{McpClient-iwrW83Si.mjs → McpClient-C7ctqJWo.mjs} +4 -5
  24. package/dist/bin/{McpClient-iwrW83Si.mjs.map → McpClient-C7ctqJWo.mjs.map} +1 -1
  25. package/dist/bin/{OutputFormatter-DeNaqhQM.mjs → OutputFormatter-DXej05JW.mjs} +8 -13
  26. package/dist/bin/{OutputFormatter-DeNaqhQM.mjs.map → OutputFormatter-DXej05JW.mjs.map} +1 -1
  27. package/dist/bin/{Schema-B3pFcw4E.mjs → Schema-CSQN_Zso.mjs} +754 -800
  28. package/dist/bin/Schema-CSQN_Zso.mjs.map +1 -0
  29. package/dist/bin/{SemanticSearch-BZIXkWYz.mjs → SemanticSearch-BiwCnpKX.mjs} +241 -148
  30. package/dist/bin/SemanticSearch-BiwCnpKX.mjs.map +1 -0
  31. package/dist/bin/{Stream-DCB3_nIX.mjs → Stream-Dwvj9X5X.mjs} +161 -116
  32. package/dist/bin/Stream-Dwvj9X5X.mjs.map +1 -0
  33. package/dist/bin/cli.mjs +4022 -3231
  34. package/dist/bin/cli.mjs.map +1 -1
  35. package/dist/bin/{helpers-BPLUsjsL.mjs → helpers-CljL9OKa.mjs} +143 -177
  36. package/dist/bin/helpers-CljL9OKa.mjs.map +1 -0
  37. package/dist/bin/index.min-ClUfQ5ji.mjs +3782 -0
  38. package/dist/bin/index.min-ClUfQ5ji.mjs.map +1 -0
  39. package/dist/bin/{rolldown-runtime-Cjv6nE1W.mjs → rolldown-runtime-5zChB7MF.mjs} +1 -2
  40. package/dist/bin/{server-CBmuybpI.mjs → server-HlLriZxF.mjs} +5 -7
  41. package/dist/bin/{server-CBmuybpI.mjs.map → server-HlLriZxF.mjs.map} +1 -1
  42. package/dist/bin/{turndown.cjs-cie0BXQQ.mjs → turndown.cjs-C2WBxeA-.mjs} +56 -110
  43. package/dist/bin/{turndown.cjs-cie0BXQQ.mjs.map → turndown.cjs-C2WBxeA-.mjs.map} +1 -1
  44. package/dist/bin/{types-RT_9fFNm.mjs → types-LcwjLVkt.mjs} +20 -38
  45. package/dist/bin/{types-RT_9fFNm.mjs.map → types-LcwjLVkt.mjs.map} +1 -1
  46. package/dist/bin/upgrade-BSNjCnra.mjs +342 -0
  47. package/dist/bin/upgrade-BSNjCnra.mjs.map +1 -0
  48. package/package.json +14 -20
  49. package/src/Agent.test.ts +69 -0
  50. package/src/Agent.ts +5 -1
  51. package/src/AgentCallerConfig.test.ts +5 -3
  52. package/src/ClaudeAgent.test.ts +120 -21
  53. package/src/ClaudeAgent.ts +59 -19
  54. package/src/Compaction.test.ts +2 -1
  55. package/src/CompactionTokens.test.ts +15 -11
  56. package/dist/bin/Effect-On-1ks2z.mjs.map +0 -1
  57. package/dist/bin/Schema-B3pFcw4E.mjs.map +0 -1
  58. package/dist/bin/SemanticSearch-BZIXkWYz.mjs.map +0 -1
  59. package/dist/bin/Stream-DCB3_nIX.mjs.map +0 -1
  60. package/dist/bin/helpers-BPLUsjsL.mjs.map +0 -1
  61. package/dist/bin/index.min-Bkz7vIWv.mjs +0 -3300
  62. package/dist/bin/index.min-Bkz7vIWv.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Pipeable.js
1
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Pipeable.js
2
2
  const pipeArguments = (self, args) => {
3
3
  switch (args.length) {
4
4
  case 0: return self;
@@ -26,8 +26,7 @@ const Class$2 = function() {
26
26
  PipeableBase.prototype = Prototype$1;
27
27
  return PipeableBase;
28
28
  }();
29
- //#endregion
30
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Function.js
29
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Function.js
31
30
  const dual = function(arity, body) {
32
31
  if (typeof arity === "function") return function() {
33
32
  return arity(arguments) ? body.apply(this, arguments) : (self) => body(self, ...arguments);
@@ -116,8 +115,7 @@ function memoizeIdempotent(f) {
116
115
  return result;
117
116
  };
118
117
  }
119
- //#endregion
120
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/equal.js
118
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/equal.js
121
119
  const getAllObjectKeys = (obj) => {
122
120
  const keys = new Set(Reflect.ownKeys(obj));
123
121
  if (obj.constructor === Object) return keys;
@@ -134,14 +132,20 @@ const getAllObjectKeys = (obj) => {
134
132
  };
135
133
  const byReferenceInstances = new WeakSet();
136
134
  const viewBytes = (view) => new Uint8Array(view.buffer, view.byteOffset, view.byteLength);
137
- //#endregion
138
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/hash.js
135
+ const isArrayBufferLike = (u) => u instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && u instanceof SharedArrayBuffer;
136
+ const bufferBytes = (buffer) => {
137
+ try {
138
+ return new Uint8Array(buffer);
139
+ } catch {
140
+ return;
141
+ }
142
+ };
143
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/hash.js
139
144
  let backEdges = 0;
140
145
  const addBackEdge = () => {
141
146
  backEdges++;
142
147
  };
143
- //#endregion
144
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Predicate.js
148
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Predicate.js
145
149
  function isString(input) {
146
150
  return typeof input === "string";
147
151
  }
@@ -202,8 +206,7 @@ function isIterable(input) {
202
206
  return hasProperty(input, Symbol.iterator) || isString(input);
203
207
  }
204
208
  const or = dual(2, (self, that) => (a) => self(a) || that(a));
205
- //#endregion
206
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Hash.js
209
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Hash.js
207
210
  const symbol$1 = "~effect/Hash";
208
211
  const hash = (self) => {
209
212
  switch (typeof self) {
@@ -228,9 +231,12 @@ const hash = (self) => {
228
231
  const seen = backEdges;
229
232
  let h;
230
233
  try {
231
- if ("~effect/Hash" in self) h = self[symbol$1]();
234
+ if (isHash(self)) h = self[symbol$1]();
232
235
  else if (typeof self === "function") h = random$1(self);
233
- else if (self instanceof DataView) h = array(viewBytes(self));
236
+ else if (isArrayBufferLike(self)) {
237
+ const bytes = bufferBytes(self);
238
+ h = bytes === void 0 ? random$1(self) : array(bytes);
239
+ } else if (self instanceof DataView) h = array(viewBytes(self));
234
240
  else if (Array.isArray(self) || ArrayBuffer.isView(self)) h = array(self);
235
241
  else if (self instanceof Map) h = hashMap(self);
236
242
  else if (self instanceof Set) h = hashSet(self);
@@ -257,6 +263,7 @@ const mix = (h) => {
257
263
  };
258
264
  const combine$1 = dual(2, (self, b) => mix(Math.imul(self, 2654435761) + Math.imul(b, 2246822507)));
259
265
  const optimize = (n) => n & 3221225471 | n >>> 1 & 1073741824;
266
+ const isHash = (u) => hasProperty(u, "~effect/Hash") && typeof u["~effect/Hash"] === "function";
260
267
  const float64 = new DataView(new ArrayBuffer(8));
261
268
  const number = (n) => {
262
269
  const h = n | 0;
@@ -291,8 +298,7 @@ const hashSet = unordered(setSeed, (element) => combine$1(setSeed, hash(element)
291
298
  const randomHashCache = new WeakMap();
292
299
  const hashCache = new WeakMap();
293
300
  const visitedObjects = new WeakSet();
294
- //#endregion
295
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Equal.js
301
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Equal.js
296
302
  const symbol = "~effect/Equal";
297
303
  function equals$1() {
298
304
  if (arguments.length === 1) return (self) => compareBoth(self, arguments[0]);
@@ -345,6 +351,11 @@ function compareStructure(self, that) {
345
351
  else if (Array.isArray(self)) {
346
352
  if (!Array.isArray(that) || self.length !== that.length) return false;
347
353
  return compareArrays(self, that);
354
+ } else if (isArrayBufferLike(self)) {
355
+ if (!isArrayBufferLike(that) || self instanceof ArrayBuffer !== that instanceof ArrayBuffer) return false;
356
+ const selfBytes = bufferBytes(self);
357
+ const thatBytes = bufferBytes(that);
358
+ return selfBytes !== void 0 && thatBytes !== void 0 && compareTypedArrays(selfBytes, thatBytes);
348
359
  } else if (ArrayBuffer.isView(self)) {
349
360
  const selfIsDataView = self instanceof DataView;
350
361
  if (!ArrayBuffer.isView(that) || self.byteLength !== that.byteLength || selfIsDataView !== that instanceof DataView) return false;
@@ -401,14 +412,13 @@ function compareHashed(self, that, hashOf, equivalent) {
401
412
  }
402
413
  const entryHash = (entry) => hash(entry[0]);
403
414
  const equalEntries = (self, that) => compareBoth(self[0], that[0]) && compareBoth(self[1], that[1]);
404
- const isEqual = (u) => hasProperty(u, symbol);
415
+ const isEqual = (u) => hasProperty(u, "~effect/Equal") && typeof u["~effect/Equal"] === "function";
405
416
  const asEquivalence = () => equals$1;
406
417
  const byReferenceUnsafe = (obj) => {
407
418
  byReferenceInstances.add(obj);
408
419
  return obj;
409
420
  };
410
- //#endregion
411
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Redactable.js
421
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Redactable.js
412
422
  const symbolRedactable = Symbol.for("~effect/Redactable");
413
423
  const isRedactable = (u) => hasProperty(u, symbolRedactable);
414
424
  function redact(u) {
@@ -429,8 +439,7 @@ const emptyContext$1 = {
429
439
  return pipeArguments(this, arguments);
430
440
  }
431
441
  };
432
- //#endregion
433
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Formatter.js
442
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Formatter.js
434
443
  function format$1(input, options) {
435
444
  const space = options?.space ?? 0;
436
445
  const ancestors = new WeakSet();
@@ -518,8 +527,9 @@ function safeGet(input, key) {
518
527
  }
519
528
  function formatJson(input, options) {
520
529
  const ancestors = [];
530
+ const sources = new WeakMap();
521
531
  return JSON.stringify(input, function(key, value) {
522
- const original = Object.getOwnPropertyDescriptor(this, key)?.value;
532
+ const original = Object.getOwnPropertyDescriptor(sources.get(this) ?? this, key)?.value;
523
533
  const redacted = hasProperty(original, symbolRedactable) ? redact(original) : redact(value);
524
534
  if (typeof redacted === "bigint") return format$1(redacted);
525
535
  if (typeof redacted !== "object" || redacted === null) return redacted;
@@ -533,18 +543,28 @@ function formatJson(input, options) {
533
543
  ancestors.push(redacted);
534
544
  if (current !== redacted) ancestors.push(current);
535
545
  if (!hasGetter(current) || isJsonPrimitiveWrapper(current)) return current;
536
- const serialized = new Proxy(current, { get(target, key) {
537
- const value = Reflect.get(target, key, target);
538
- return Object.getOwnPropertyDescriptor(target, key)?.get !== void 0 ? redact(value) : value;
539
- } });
540
- ancestors.push(serialized);
541
- return serialized;
546
+ const view = redactingView(current);
547
+ sources.set(view, current);
548
+ ancestors.push(view);
549
+ return view;
542
550
  }, options?.space) ?? "null";
543
551
  }
544
552
  function hasGetter(object) {
545
553
  for (const key of Object.getOwnPropertyNames(object)) if (Object.getOwnPropertyDescriptor(object, key)?.get !== void 0) return true;
546
554
  return false;
547
555
  }
556
+ function redactingView(object) {
557
+ const view = Array.isArray(object) ? [] : {};
558
+ const keys = Array.isArray(object) ? Array.from({ length: object.length }, (_, i) => String(i)) : Object.keys(object);
559
+ for (const key of keys) Object.defineProperty(view, key, {
560
+ enumerable: true,
561
+ get: () => {
562
+ const value = Reflect.get(object, key);
563
+ return Object.getOwnPropertyDescriptor(object, key)?.get !== void 0 ? redact(value) : value;
564
+ }
565
+ });
566
+ return view;
567
+ }
548
568
  function isJsonPrimitiveWrapper(object) {
549
569
  for (const valueOf of [
550
570
  Number.prototype.valueOf,
@@ -556,8 +576,7 @@ function isJsonPrimitiveWrapper(object) {
556
576
  } catch {}
557
577
  return false;
558
578
  }
559
- //#endregion
560
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Inspectable.js
579
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Inspectable.js
561
580
  const NodeInspectSymbol = Symbol.for("nodejs.util.inspect.custom");
562
581
  const toJson = (input) => {
563
582
  try {
@@ -596,8 +615,7 @@ var Class$1 = class {
596
615
  return format$1(this.toJSON());
597
616
  }
598
617
  };
599
- //#endregion
600
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/stackTraceLimit.js
618
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/stackTraceLimit.js
601
619
  const isStackTraceLimitWritable = () => {
602
620
  const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
603
621
  if (desc === void 0) return Object.isExtensible(Error);
@@ -608,8 +626,7 @@ const getStackTraceLimit = () => Error.stackTraceLimit;
608
626
  const setStackTraceLimit = (value) => {
609
627
  if (canWriteStackTraceLimit) Error.stackTraceLimit = value;
610
628
  };
611
- //#endregion
612
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Utils.js
629
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Utils.js
613
630
  var SingleShotGen = class {
614
631
  constructor(self) {
615
632
  this.value = self;
@@ -645,8 +662,7 @@ const pickInternalCall = () => {
645
662
  return error.stack?.includes(InternalTypeId) === true ? standard[InternalTypeId] : forced[InternalTypeId];
646
663
  };
647
664
  const internalCall = pickInternalCall();
648
- //#endregion
649
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/record.js
665
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/record.js
650
666
  function assignProperty(self, key, value) {
651
667
  if (key === "__proto__") Object.defineProperty(self, key, {
652
668
  value,
@@ -657,10 +673,13 @@ function assignProperty(self, key, value) {
657
673
  else self[key] = value;
658
674
  }
659
675
  function assignProperties(self, source) {
676
+ if (!Object.hasOwn(source, "__proto__")) {
677
+ Object.assign(self, source);
678
+ return;
679
+ }
660
680
  for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProperty(self, key, source[key]);
661
681
  }
662
- //#endregion
663
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/core.js
682
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/core.js
664
683
  const EffectTypeId = `~effect/Effect`;
665
684
  const ExitTypeId = `~effect/Exit`;
666
685
  const effectVariance = {
@@ -735,7 +754,7 @@ var CauseImpl = class {
735
754
  toJSON() {
736
755
  return {
737
756
  _id: "Cause",
738
- failures: this.reasons.map((f) => f.toJSON())
757
+ reasons: this.reasons.map((f) => f.toJSON())
739
758
  };
740
759
  }
741
760
  toString() {
@@ -773,6 +792,7 @@ var ReasonBase = class {
773
792
  if (options?.overwrite !== true && newAnnotations.has(key)) return;
774
793
  newAnnotations.set(key, value);
775
794
  });
795
+ if (options?.overwrite !== true && newAnnotations.size === this.annotations.size) return this;
776
796
  const self = Object.assign(Object.create(Object.getPrototypeOf(this)), this);
777
797
  self.annotations = newAnnotations;
778
798
  return self;
@@ -1030,14 +1050,12 @@ const done$2 = (value) => {
1030
1050
  if (value === void 0) return doneVoid;
1031
1051
  return exitFail(Done$1(value));
1032
1052
  };
1033
- //#endregion
1034
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Effectable.js
1053
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Effectable.js
1035
1054
  const Prototype = (options) => makePrimitiveProto({
1036
1055
  op: options.label,
1037
1056
  [evaluate]: options.evaluate
1038
1057
  });
1039
- //#endregion
1040
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Equivalence.js
1058
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Equivalence.js
1041
1059
  const make$7 = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
1042
1060
  const isStrictEquivalent = (x, y) => x === y;
1043
1061
  const strictEqual = () => isStrictEquivalent;
@@ -1055,8 +1073,7 @@ function Array_(item) {
1055
1073
  return true;
1056
1074
  });
1057
1075
  }
1058
- //#endregion
1059
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/option.js
1076
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/option.js
1060
1077
  const TypeId$8 = "~effect/Option";
1061
1078
  const CommonProto$1 = {
1062
1079
  [TypeId$8]: { _A: (_) => _ },
@@ -1117,8 +1134,7 @@ const SomeImpl = function(value) {
1117
1134
  };
1118
1135
  SomeImpl.prototype = SomeProto;
1119
1136
  const some$1 = (value) => new SomeImpl(value);
1120
- //#endregion
1121
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/result.js
1137
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/result.js
1122
1138
  const TypeId$7 = "~effect/Result";
1123
1139
  const CommonProto = {
1124
1140
  [TypeId$7]: {
@@ -1177,14 +1193,13 @@ const FailureImpl = function(failure) {
1177
1193
  this.failure = failure;
1178
1194
  };
1179
1195
  FailureImpl.prototype = FailureProto;
1180
- const fail$5 = (failure) => new FailureImpl(failure);
1196
+ const fail$6 = (failure) => new FailureImpl(failure);
1181
1197
  const SuccessImpl = function(success) {
1182
1198
  this.success = success;
1183
1199
  };
1184
1200
  SuccessImpl.prototype = SuccessProto;
1185
- const succeed$5 = (success) => new SuccessImpl(success);
1186
- //#endregion
1187
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Order.js
1201
+ const succeed$6 = (success) => new SuccessImpl(success);
1202
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Order.js
1188
1203
  function make$6(compare) {
1189
1204
  return (self, that) => self === that ? 0 : compare(self, that);
1190
1205
  }
@@ -1204,8 +1219,7 @@ const isLessThanOrEqualTo = (O) => dual(2, (self, that) => O(self, that) !== 1);
1204
1219
  const isGreaterThanOrEqualTo = (O) => dual(2, (self, that) => O(self, that) !== -1);
1205
1220
  const min$2 = (O) => dual(2, (self, that) => self === that || O(self, that) < 1 ? self : that);
1206
1221
  const max$1 = (O) => dual(2, (self, that) => self === that || O(self, that) > -1 ? self : that);
1207
- //#endregion
1208
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Option.js
1222
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Option.js
1209
1223
  const none = () => none$1;
1210
1224
  const some = some$1;
1211
1225
  const isOption = isOption$1;
@@ -1256,8 +1270,7 @@ const all$2 = (input) => {
1256
1270
  const toArray = (self) => isNone(self) ? [] : [self.value];
1257
1271
  const filter = dual(2, (self, predicate) => isNone(self) ? none() : predicate(self.value) ? some(self.value) : none());
1258
1272
  const exists = dual(2, (self, refinement) => isNone(self) ? false : refinement(self.value));
1259
- //#endregion
1260
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Context.js
1273
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Context.js
1261
1274
  const ServiceTypeId = "~effect/Context/Service";
1262
1275
  const Service = function() {
1263
1276
  function KeyClass() {}
@@ -1305,9 +1318,8 @@ const ServiceProto = {
1305
1318
  const cacheKeys = new Set();
1306
1319
  const ReferenceTypeId = "~effect/Context/Reference";
1307
1320
  const TypeId$6 = "~effect/Context";
1308
- const MaxDepth = 8;
1309
1321
  const FlattenAfterBaseHits = 8;
1310
- const makeImpl = (cacheRoot, base, overlay, depth) => {
1322
+ const makeImpl = (cacheRoot, base, overlay, depth, maxDepth) => {
1311
1323
  const self = Object.create(Proto);
1312
1324
  self.cacheRoot = cacheRoot ?? self;
1313
1325
  self.base = base;
@@ -1315,6 +1327,7 @@ const makeImpl = (cacheRoot, base, overlay, depth) => {
1315
1327
  self.depth = depth;
1316
1328
  self._flat = void 0;
1317
1329
  self.baseHits = 0;
1330
+ self.maxDepth = maxDepth;
1318
1331
  return self;
1319
1332
  };
1320
1333
  const applyOverlays = (map, overlay) => {
@@ -1332,7 +1345,7 @@ const flatten$2 = (self) => {
1332
1345
  const withFlat = (self, f) => {
1333
1346
  const map = new Map(self.mapUnsafe);
1334
1347
  f(map);
1335
- return makeUnsafe$2(map);
1348
+ return makeImpl(void 0, map, void 0, 0, self.maxDepth);
1336
1349
  };
1337
1350
  const notFound = Symbol();
1338
1351
  const lookup = (self, key) => {
@@ -1347,7 +1360,10 @@ const lookup = (self, key) => {
1347
1360
  }
1348
1361
  return value;
1349
1362
  };
1350
- const makeUnsafe$2 = (mapUnsafe) => makeImpl(void 0, mapUnsafe, void 0, 0);
1363
+ const makeUnsafe$2 = (mapUnsafe, options) => {
1364
+ const maxDepth = options?.maxDepth;
1365
+ return makeImpl(void 0, mapUnsafe, void 0, 0, Number.isInteger(maxDepth) && maxDepth >= 0 ? maxDepth : 8);
1366
+ };
1351
1367
  const Proto = {
1352
1368
  get mapUnsafe() {
1353
1369
  return flatten$2(this);
@@ -1385,17 +1401,17 @@ const add = dual(3, (self, key, service) => addUnsafe(self, key.key, service));
1385
1401
  const addUnsafe = (self, key, service) => {
1386
1402
  const impl = self;
1387
1403
  const cacheRoot = cacheKeys.has(key) ? void 0 : impl.cacheRoot;
1388
- if (impl.depth >= MaxDepth) {
1404
+ if (impl.depth >= impl.maxDepth) {
1389
1405
  const map = new Map(impl._flat ?? impl.base);
1390
1406
  if (!impl._flat) applyOverlays(map, impl.overlay);
1391
1407
  map.set(key, service);
1392
- return makeImpl(cacheRoot, map, void 0, 0);
1408
+ return makeImpl(cacheRoot, map, void 0, 0, impl.maxDepth);
1393
1409
  }
1394
1410
  return makeImpl(cacheRoot, impl.base, {
1395
1411
  key,
1396
1412
  value: service,
1397
1413
  parent: impl.overlay
1398
- }, impl.depth + 1);
1414
+ }, impl.depth + 1, impl.maxDepth);
1399
1415
  };
1400
1416
  const getOrUndefined$1 = dual(2, (self, key) => getOrUndefinedUnsafe(self, key.key));
1401
1417
  const getOrUndefinedUnsafe = (self, key) => {
@@ -1442,9 +1458,11 @@ const mergeAll$1 = (...ctxs) => {
1442
1458
  });
1443
1459
  return makeUnsafe$2(map);
1444
1460
  };
1461
+ const omit = (...keys) => (self) => withFlat(self, (map) => {
1462
+ for (let i = 0; i < keys.length; i++) map.delete(keys[i].key);
1463
+ });
1445
1464
  const Reference = Service;
1446
- //#endregion
1447
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Duration.js
1465
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Duration.js
1448
1466
  const TypeId$5 = "~effect/Duration";
1449
1467
  const bigint0$1 = BigInt(0);
1450
1468
  const bigint1 = BigInt(1);
@@ -1454,9 +1472,20 @@ const bigint24 = BigInt(24);
1454
1472
  const bigint60 = BigInt(60);
1455
1473
  const bigint1e3 = BigInt(1e3);
1456
1474
  const bigint1e6 = BigInt(1e6);
1475
+ const bigint1e9 = BigInt(1e9);
1476
+ const bigintNanosPerMinute = BigInt(6e10);
1477
+ const bigintNanosPerHour = BigInt(36e11);
1478
+ const bigintNanosPerDay = BigInt(864e11);
1479
+ const bigintNanosPerWeek = BigInt(6048e11);
1457
1480
  const roundTiesAwayFromZero = (input) => BigInt(Math.sign(input) * Math.round(Math.abs(input)));
1458
1481
  const roundMillisToNanos = (millis) => Number.isInteger(millis) ? BigInt(millis) * bigint1e6 : roundTiesAwayFromZero(millis * 1e6);
1459
1482
  const fromNanosNumber = (nanos) => make$4(Number.isFinite(nanos) ? roundTiesAwayFromZero(nanos) : nanos);
1483
+ const nanosToUnit = (nanos, divisor) => {
1484
+ const value = Number(nanos);
1485
+ if (Number.isFinite(value)) return value / divisor;
1486
+ const scale = BigInt(divisor);
1487
+ return Number(nanos / scale) + Number(nanos % scale) / divisor;
1488
+ };
1460
1489
  const parseNanos = (input, scale) => {
1461
1490
  const decimalIndex = input.indexOf(".");
1462
1491
  if (decimalIndex === -1) return BigInt(input) * scale;
@@ -1471,6 +1500,12 @@ const divideTiesAwayFromZero = (numerator, denominator) => {
1471
1500
  const rounded = absolute / denominator + (absolute % denominator * bigint2 >= denominator ? bigint1 : bigint0$1);
1472
1501
  return numerator < bigint0$1 ? -rounded : rounded;
1473
1502
  };
1503
+ const fromMillisString = (input, scale) => {
1504
+ const millis = Number(input) * scale;
1505
+ if (!Number.isFinite(millis)) return make$4(millis);
1506
+ const nanos = parseNanos(input, BigInt(scale) * bigint1e6);
1507
+ return make$4(Number.isInteger(millis) && BigInt(millis) * bigint1e6 === nanos ? millis : nanos);
1508
+ };
1474
1509
  const DURATION_REGEXP = /^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/;
1475
1510
  const fromInputUnsafe = (input) => {
1476
1511
  switch (typeof input) {
@@ -1484,20 +1519,19 @@ const fromInputUnsafe = (input) => {
1484
1519
  const [_, valueStr, unit] = match;
1485
1520
  if (unit === "nano" || unit === "nanos") return nanos(parseNanos(valueStr, bigint1));
1486
1521
  if (unit === "micro" || unit === "micros") return nanos(parseNanos(valueStr, bigint1e3));
1487
- const value = Number(valueStr);
1488
1522
  switch (unit) {
1489
1523
  case "milli":
1490
- case "millis": return millis(value);
1524
+ case "millis": return fromMillisString(valueStr, 1);
1491
1525
  case "second":
1492
- case "seconds": return seconds(value);
1526
+ case "seconds": return fromMillisString(valueStr, 1e3);
1493
1527
  case "minute":
1494
- case "minutes": return minutes(value);
1528
+ case "minutes": return fromMillisString(valueStr, 6e4);
1495
1529
  case "hour":
1496
- case "hours": return hours(value);
1530
+ case "hours": return fromMillisString(valueStr, 36e5);
1497
1531
  case "day":
1498
- case "days": return days(value);
1532
+ case "days": return fromMillisString(valueStr, 864e5);
1499
1533
  case "week":
1500
- case "weeks": return weeks(value);
1534
+ case "weeks": return fromMillisString(valueStr, 6048e5);
1501
1535
  }
1502
1536
  break;
1503
1537
  }
@@ -1509,7 +1543,8 @@ const fromInputUnsafe = (input) => {
1509
1543
  if (Number.isNaN(input[0]) || Number.isNaN(input[1])) return zero;
1510
1544
  if (input[0] === -Infinity || input[1] === -Infinity) return negativeInfinity;
1511
1545
  if (input[0] === Infinity || input[1] === Infinity) return infinity;
1512
- return fromNanosNumber(input[0] * 1e9 + input[1]);
1546
+ const nanos = input[0] * 1e9 + input[1];
1547
+ return Number.isFinite(nanos) && Number.isInteger(input[0]) && Number.isInteger(input[1]) ? make$4(BigInt(input[0]) * bigint1e9 + BigInt(input[1])) : fromNanosNumber(nanos);
1513
1548
  }
1514
1549
  const obj = input;
1515
1550
  let millis = 0;
@@ -1519,12 +1554,32 @@ const fromInputUnsafe = (input) => {
1519
1554
  if (obj.minutes) millis += obj.minutes * 6e4;
1520
1555
  if (obj.seconds) millis += obj.seconds * 1e3;
1521
1556
  if (obj.milliseconds) millis += obj.milliseconds;
1522
- if (!obj.microseconds && !obj.nanoseconds) return make$4(millis);
1523
- return fromNanosNumber(millis * 1e6 + (obj.microseconds ?? 0) * 1e3 + (obj.nanoseconds ?? 0));
1557
+ if (!obj.microseconds && !obj.nanoseconds) {
1558
+ if (!Number.isFinite(millis)) return make$4(millis);
1559
+ const exact = sumObjectNanos(obj);
1560
+ return exact === void 0 || BigInt(millis) * bigint1e6 === exact ? make$4(millis) : make$4(exact);
1561
+ }
1562
+ const nanos = millis * 1e6 + (obj.microseconds ?? 0) * 1e3 + (obj.nanoseconds ?? 0);
1563
+ const exact = Number.isFinite(nanos) ? sumObjectNanos(obj) : void 0;
1564
+ return exact === void 0 ? fromNanosNumber(nanos) : make$4(exact);
1524
1565
  }
1525
1566
  }
1526
1567
  return invalid(input);
1527
1568
  };
1569
+ const isIntegerOrUnset = (n) => !n || Number.isInteger(n);
1570
+ const sumObjectNanos = (obj) => {
1571
+ if (!isIntegerOrUnset(obj.weeks) || !isIntegerOrUnset(obj.days) || !isIntegerOrUnset(obj.hours) || !isIntegerOrUnset(obj.minutes) || !isIntegerOrUnset(obj.seconds) || !isIntegerOrUnset(obj.milliseconds) || !isIntegerOrUnset(obj.microseconds) || !isIntegerOrUnset(obj.nanoseconds)) return void 0;
1572
+ let nanos = bigint0$1;
1573
+ if (obj.weeks) nanos += BigInt(obj.weeks) * bigintNanosPerWeek;
1574
+ if (obj.days) nanos += BigInt(obj.days) * bigintNanosPerDay;
1575
+ if (obj.hours) nanos += BigInt(obj.hours) * bigintNanosPerHour;
1576
+ if (obj.minutes) nanos += BigInt(obj.minutes) * bigintNanosPerMinute;
1577
+ if (obj.seconds) nanos += BigInt(obj.seconds) * bigint1e9;
1578
+ if (obj.milliseconds) nanos += BigInt(obj.milliseconds) * bigint1e6;
1579
+ if (obj.microseconds) nanos += BigInt(obj.microseconds) * bigint1e3;
1580
+ if (obj.nanoseconds) nanos += BigInt(obj.nanoseconds);
1581
+ return nanos;
1582
+ };
1528
1583
  const invalid = (input) => {
1529
1584
  throw new Error(`Invalid Input: ${input}`);
1530
1585
  };
@@ -1637,17 +1692,15 @@ const millis = (millis) => make$4(millis);
1637
1692
  const seconds = (seconds) => make$4(seconds * 1e3);
1638
1693
  const minutes = (minutes) => make$4(minutes * 6e4);
1639
1694
  const hours = (hours) => make$4(hours * 36e5);
1640
- const days = (days) => make$4(days * 864e5);
1641
- const weeks = (weeks) => make$4(weeks * 6048e5);
1642
1695
  const toMillis = (self) => match$4(fromInputUnsafe(self), {
1643
1696
  onMillis: identity,
1644
- onNanos: (nanos) => Number(nanos) / 1e6,
1697
+ onNanos: (nanos) => nanosToUnit(nanos, 1e6),
1645
1698
  onInfinity: () => Infinity,
1646
1699
  onNegativeInfinity: () => -Infinity
1647
1700
  });
1648
1701
  const toSeconds = (self) => match$4(fromInputUnsafe(self), {
1649
1702
  onMillis: (millis) => millis / 1e3,
1650
- onNanos: (nanos) => Number(nanos) / 1e9,
1703
+ onNanos: (nanos) => nanosToUnit(nanos, 1e9),
1651
1704
  onInfinity: () => Infinity,
1652
1705
  onNegativeInfinity: () => -Infinity
1653
1706
  });
@@ -1742,33 +1795,30 @@ const format = (self) => {
1742
1795
  if (fragments.nanos !== 0) pieces.push(`${fragments.nanos}ns`);
1743
1796
  return pieces.join(" ");
1744
1797
  };
1745
- //#endregion
1746
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/array.js
1798
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/array.js
1747
1799
  const isArrayNonEmpty$1 = (self) => self.length > 0;
1748
- //#endregion
1749
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/count.js
1800
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/count.js
1750
1801
  const normalize = (n) => n > 0 ? Math.floor(n) : 0;
1751
1802
  const normalizeNonEmpty = (n) => Math.max(1, normalize(n));
1752
- //#endregion
1753
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Result.js
1754
- const succeed$4 = succeed$5;
1755
- const fail$4 = fail$5;
1756
- const failVoid = fail$4(void 0);
1803
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Result.js
1804
+ const succeed$5 = succeed$6;
1805
+ const fail$5 = fail$6;
1806
+ const failVoid = fail$5(void 0);
1757
1807
  const try_$2 = (evaluate) => {
1758
1808
  if (isFunction(evaluate)) try {
1759
- return succeed$4(evaluate());
1809
+ return succeed$5(evaluate());
1760
1810
  } catch (e) {
1761
- return fail$4(e);
1811
+ return fail$5(e);
1762
1812
  }
1763
1813
  else try {
1764
- return succeed$4(evaluate.try());
1814
+ return succeed$5(evaluate.try());
1765
1815
  } catch (e) {
1766
- return fail$4(evaluate.catch(e));
1816
+ return fail$5(evaluate.catch(e));
1767
1817
  }
1768
1818
  };
1769
1819
  const isFailure$1 = isFailure$2;
1770
1820
  const isSuccess$1 = isSuccess$2;
1771
- const map$4 = dual(2, (self, f) => isSuccess$1(self) ? succeed$4(f(self.success)) : self);
1821
+ const map$4 = dual(2, (self, f) => isSuccess$1(self) ? succeed$5(f(self.success)) : self);
1772
1822
  const match$3 = dual(2, (self, { onFailure, onSuccess }) => isFailure$1(self) ? onFailure(self.failure) : onSuccess(self.success));
1773
1823
  const getOrElse = dual(2, (self, onFailure) => isFailure$1(self) ? onFailure(self.failure) : self.success);
1774
1824
  const getOrUndefined = getOrElse(constUndefined);
@@ -1777,15 +1827,8 @@ const getOrThrowWith = dual(2, (self, onFailure) => {
1777
1827
  throw onFailure(self.failure);
1778
1828
  });
1779
1829
  const getOrThrow = getOrThrowWith(identity);
1780
- const flatMap$4 = dual(2, (self, f) => isFailure$1(self) ? fail$4(self.failure) : f(self.success));
1781
- //#endregion
1782
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Iterable.js
1783
- const size$1 = (self) => {
1784
- const iterator = self[Symbol.iterator]();
1785
- let count = 0;
1786
- while (!iterator.next().done) count++;
1787
- return count;
1788
- };
1830
+ const flatMap$4 = dual(2, (self, f) => isFailure$1(self) ? fail$5(self.failure) : f(self.success));
1831
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Iterable.js
1789
1832
  const headUnsafe = (self) => {
1790
1833
  const result = self[Symbol.iterator]().next();
1791
1834
  if (result.done) throw new Error("headUnsafe: empty iterable");
@@ -1812,10 +1855,10 @@ const constEmptyIterator = { next() {
1812
1855
  };
1813
1856
  } };
1814
1857
  const empty$3 = () => constEmpty;
1815
- //#endregion
1816
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Array.js
1858
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Array.js
1817
1859
  const Array$1 = globalThis.Array;
1818
1860
  const fromIterable$1 = (collection) => Array$1.isArray(collection) ? collection : Array$1.from(collection);
1861
+ const ensure = (self) => Array$1.isArray(self) ? self : [self];
1819
1862
  const match$2 = dual(2, (self, { onEmpty, onNonEmpty }) => isReadonlyArrayNonEmpty(self) ? onNonEmpty(self) : onEmpty());
1820
1863
  const prepend = dual(2, (self, head) => [head, ...self]);
1821
1864
  const append = dual(2, (self, last) => [...self, last]);
@@ -1927,10 +1970,9 @@ const dedupe = (self) => {
1927
1970
  return out;
1928
1971
  };
1929
1972
  const join = dual(2, (self, sep) => fromIterable$1(self).join(sep));
1930
- //#endregion
1931
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Filter.js
1973
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Filter.js
1932
1974
  const toPredicate = (self) => (input) => !isFailure$1(self(input));
1933
- const has$1 = (key) => (input) => input.has(key) ? succeed$4(input) : fail$4(input);
1975
+ const has$1 = (key) => (input) => input.has(key) ? succeed$5(input) : fail$5(input);
1934
1976
  const compose = dual(2, (left, right) => (input) => {
1935
1977
  const leftOut = left(input);
1936
1978
  if (isFailure$1(leftOut)) return leftOut;
@@ -1938,17 +1980,16 @@ const compose = dual(2, (left, right) => (input) => {
1938
1980
  });
1939
1981
  const composePassthrough = dual(2, (left, right) => (input) => {
1940
1982
  const leftOut = left(input);
1941
- if (isFailure$1(leftOut)) return fail$4(input);
1983
+ if (isFailure$1(leftOut)) return fail$5(input);
1942
1984
  const rightOut = right(leftOut.success);
1943
- if (isFailure$1(rightOut)) return fail$4(input);
1985
+ if (isFailure$1(rightOut)) return fail$5(input);
1944
1986
  return rightOut;
1945
1987
  });
1946
1988
  const toOption = (self) => (input) => {
1947
1989
  const result = self(input);
1948
1990
  return isFailure$1(result) ? none() : some(result.success);
1949
1991
  };
1950
- //#endregion
1951
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Scheduler.js
1992
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Scheduler.js
1952
1993
  const Scheduler = Reference("effect/Scheduler", {
1953
1994
  fiberCached: true,
1954
1995
  defaultValue: () => new MixedScheduler()
@@ -2051,8 +2092,7 @@ const PreventSchedulerYield = Reference("effect/Scheduler/PreventSchedulerYield"
2051
2092
  fiberCached: true,
2052
2093
  defaultValue: () => false
2053
2094
  });
2054
- //#endregion
2055
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/encoding/Hex.js
2095
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/encoding/Hex.js
2056
2096
  const encode = (input) => typeof input === "string" ? hexEncodeUint8Array(encoder.encode(input)) : hexEncodeUint8Array(input);
2057
2097
  const random = (length) => {
2058
2098
  switch (length) {
@@ -2090,8 +2130,7 @@ const hexEncodeUint8Array = (bytes) => {
2090
2130
  for (let i = 0; i < bytes.length; i++) result += byteToHex[bytes[i]];
2091
2131
  return result;
2092
2132
  };
2093
- //#endregion
2094
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Tracer.js
2133
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Tracer.js
2095
2134
  const ParentSpanKey = "effect/Tracer/ParentSpan";
2096
2135
  var ParentSpan = class extends Service()(ParentSpanKey, { fiberCached: true }) {};
2097
2136
  const make$3 = (options) => options;
@@ -2140,6 +2179,7 @@ var NativeSpan = class {
2140
2179
  return this._events ??= [];
2141
2180
  }
2142
2181
  end(endTime, exit) {
2182
+ if (this.status._tag === "Ended") return;
2143
2183
  this.status = {
2144
2184
  _tag: "Ended",
2145
2185
  endTime,
@@ -2148,9 +2188,11 @@ var NativeSpan = class {
2148
2188
  };
2149
2189
  }
2150
2190
  attribute(key, value) {
2191
+ if (this.status._tag === "Ended") return;
2151
2192
  this.attributes.set(key, value);
2152
2193
  }
2153
2194
  event(name, startTime, attributes) {
2195
+ if (this.status._tag === "Ended") return;
2154
2196
  this.events.push([
2155
2197
  name,
2156
2198
  startTime,
@@ -2158,14 +2200,13 @@ var NativeSpan = class {
2158
2200
  ]);
2159
2201
  }
2160
2202
  addLinks(links) {
2203
+ if (this.status._tag === "Ended") return;
2161
2204
  this.links.push(...links);
2162
2205
  }
2163
2206
  };
2164
- //#endregion
2165
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/metric.js
2207
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/metric.js
2166
2208
  const FiberRuntimeMetricsKey = "effect/Metric/FiberRuntimeMetrics";
2167
- //#endregion
2168
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/references.js
2209
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/references.js
2169
2210
  const CurrentStackFrame = Reference("effect/References/CurrentStackFrame", {
2170
2211
  fiberCached: true,
2171
2212
  defaultValue: constUndefined
@@ -2186,9 +2227,9 @@ const MinimumLogLevel$1 = Reference("effect/References/MinimumLogLevel", {
2186
2227
  fiberCached: true,
2187
2228
  defaultValue: () => "Info"
2188
2229
  });
2230
+ const UnhandledLogLevel = Reference("effect/References/UnhandledLogLevel", { defaultValue: () => "Error" });
2189
2231
  const CurrentLogSpans$1 = Reference("effect/References/CurrentLogSpans", { defaultValue: () => [] });
2190
- //#endregion
2191
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/tracer.js
2232
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/tracer.js
2192
2233
  const addSpanStackTrace = (options) => {
2193
2234
  if (options?.captureStackTrace === false) return options;
2194
2235
  else if (options?.captureStackTrace !== void 0 && typeof options.captureStackTrace !== "boolean") return options;
@@ -2219,8 +2260,7 @@ const makeStackCleaner = (line) => (stack) => {
2219
2260
  };
2220
2261
  };
2221
2262
  const spanCleaner = makeStackCleaner(3);
2222
- //#endregion
2223
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/effect.js
2263
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/effect.js
2224
2264
  var Interrupt = class extends ReasonBase {
2225
2265
  constructor(fiberId, annotations = constEmptyAnnotations) {
2226
2266
  super("Interrupt", annotations, "Interrupted");
@@ -2244,21 +2284,21 @@ var Interrupt = class extends ReasonBase {
2244
2284
  };
2245
2285
  const makeInterruptReason$1 = (fiberId) => new Interrupt(fiberId);
2246
2286
  const causeInterrupt = (fiberId) => new CauseImpl([new Interrupt(fiberId)]);
2247
- const findFail = (self) => {
2248
- const reason = self.reasons.find(isFailReason$1);
2249
- return reason ? succeed$4(reason) : fail$4(self);
2250
- };
2251
- const findError$1 = (self) => {
2287
+ const hasFails = (self) => self.reasons.some(isFailReason$1);
2288
+ const findError = (self) => {
2252
2289
  for (let i = 0; i < self.reasons.length; i++) {
2253
2290
  const reason = self.reasons[i];
2254
- if (reason._tag === "Fail") return succeed$4(reason.error);
2291
+ if (reason._tag === "Fail") return succeed$5(reason.error);
2255
2292
  }
2256
- return fail$4(self);
2293
+ return fail$5(self);
2257
2294
  };
2258
- const findErrorOption$2 = toOption(findError$1);
2295
+ const findErrorOption$2 = toOption(findError);
2296
+ const hasDies = (self) => self.reasons.some(isDieReason$1);
2297
+ const causeElectDefects = (self) => hasDies(self) && hasFails(self) ? causeFromReasons(self.reasons.map((reason) => reason._tag === "Fail" && !isDone$2(reason.error) ? new Die(reason.error, reason.annotations) : reason)) : self;
2298
+ const findRecoverableError = (self) => hasDies(self) ? fail$5(causeElectDefects(self)) : findError(self);
2259
2299
  const findDefect = (self) => {
2260
2300
  const reason = self.reasons.find(isDieReason$1);
2261
- return reason ? succeed$4(reason.defect) : fail$4(self);
2301
+ return reason ? succeed$5(reason.defect) : fail$5(self);
2262
2302
  };
2263
2303
  const hasInterrupts$1 = (self) => self.reasons.some(isInterruptReason);
2264
2304
  const causeFilterInterruptors = (self) => {
@@ -2269,7 +2309,7 @@ const causeFilterInterruptors = (self) => {
2269
2309
  interruptors ??= new Set();
2270
2310
  if (f.fiberId !== void 0) interruptors.add(f.fiberId);
2271
2311
  }
2272
- return interruptors ? succeed$4(interruptors) : fail$4(self);
2312
+ return interruptors ? succeed$5(interruptors) : fail$5(self);
2273
2313
  };
2274
2314
  const causeInterruptors = (self) => {
2275
2315
  const result = causeFilterInterruptors(self);
@@ -2327,11 +2367,13 @@ const causePrettyErrors = (self, options) => {
2327
2367
  }
2328
2368
  return errors;
2329
2369
  };
2330
- const causePrettyError = (original, annotations, options) => {
2370
+ const causePrettyError = (original, annotations, options, seen = new Set()) => {
2331
2371
  const kind = typeof original;
2332
2372
  let error;
2333
2373
  if (original && kind === "object") {
2334
- error = new globalThis.Error(causePrettyMessage(original), { cause: original.cause ? causePrettyError(original.cause) : void 0 });
2374
+ seen.add(original);
2375
+ const cause = original.cause;
2376
+ error = new globalThis.Error(causePrettyMessage(original), { cause: cause !== void 0 && !seen.has(cause) ? causePrettyError(cause, void 0, void 0, seen) : void 0 });
2335
2377
  if (typeof original.name === "string") error.name = original.name;
2336
2378
  if (typeof original.stack === "string") error.stack = cleanErrorStack(original.stack, error, annotations);
2337
2379
  else {
@@ -2484,7 +2526,11 @@ var FiberImpl = class {
2484
2526
  else if (this._asyncContext !== void 0) {
2485
2527
  const asyncContext = this._asyncContext;
2486
2528
  this._asyncContext = void 0;
2487
- return asyncContext.runInAsyncScope(this.evaluate, this, effect);
2529
+ try {
2530
+ return asyncContext.runInAsyncScope(this.evaluate, this, effect);
2531
+ } finally {
2532
+ asyncContext.emitDestroy();
2533
+ }
2488
2534
  } else if (this._yielded !== void 0) {
2489
2535
  const yielded = this._yielded;
2490
2536
  this._yielded = void 0;
@@ -2511,6 +2557,12 @@ var FiberImpl = class {
2511
2557
  this._stack.length = 0;
2512
2558
  this._children = void 0;
2513
2559
  this.context = empty$4();
2560
+ const cache = this.cache;
2561
+ if (cache.span !== void 0 || cache.stackFrame !== void 0) this.cache = {
2562
+ ...cache,
2563
+ span: void 0,
2564
+ stackFrame: void 0
2565
+ };
2514
2566
  }
2515
2567
  runLoop(effect) {
2516
2568
  const prevFiber = globalThis[currentFiberTypeId];
@@ -2642,10 +2694,10 @@ const fiberInterruptChildren = (fiber) => {
2642
2694
  };
2643
2695
  const fiberAwait = (self) => {
2644
2696
  const impl = self;
2645
- if (impl._exit) return succeed$3(impl._exit);
2697
+ if (impl._exit) return succeed$4(impl._exit);
2646
2698
  return callback$1((resume) => {
2647
- if (impl._exit) return resume(succeed$3(impl._exit));
2648
- return sync$1(self.addObserver((exit) => resume(succeed$3(exit))));
2699
+ if (impl._exit) return resume(succeed$4(impl._exit));
2700
+ return sync$1(self.addObserver((exit) => resume(succeed$4(exit))));
2649
2701
  });
2650
2702
  };
2651
2703
  const fiberAwaitAll = (self) => callback$1((resume) => {
@@ -2666,7 +2718,7 @@ const fiberAwaitAll = (self) => callback$1((resume) => {
2666
2718
  });
2667
2719
  return;
2668
2720
  }
2669
- resume(succeed$3(exits));
2721
+ resume(succeed$4(exits));
2670
2722
  }
2671
2723
  loop();
2672
2724
  return sync$1(() => cancel?.());
@@ -2704,13 +2756,14 @@ const fiberInterruptAllAs = dual(2, (fibers, fiberId) => withFiber$1((parent) =>
2704
2756
  }
2705
2757
  return asVoid$1(fiberAwaitAll(fiberArr));
2706
2758
  }));
2707
- const succeed$3 = exitSucceed;
2759
+ const succeed$4 = exitSucceed;
2708
2760
  const failCause$3 = exitFailCause;
2709
- const fail$3 = exitFail;
2761
+ const fail$4 = exitFail;
2710
2762
  const sync$1 = makePrimitive({
2711
2763
  op: "Sync",
2712
2764
  [evaluate](fiber) {
2713
- const value = this[args]();
2765
+ const thunk = this[args];
2766
+ const value = thunk();
2714
2767
  const cont = fiber.getCont(contA);
2715
2768
  return cont ? cont[contA](value, fiber) : fiber.yieldWith(exitSucceed(value));
2716
2769
  }
@@ -2718,13 +2771,14 @@ const sync$1 = makePrimitive({
2718
2771
  const suspend$1 = makePrimitive({
2719
2772
  op: "Suspend",
2720
2773
  [evaluate](_fiber) {
2721
- return this[args]();
2774
+ const thunk = this[args];
2775
+ return thunk();
2722
2776
  }
2723
2777
  });
2724
- const fromOption$1 = dual((args) => args.length >= 2 || isOption(args[0]), (option, onNone) => isNone(option) ? fail$3(onNone ? onNone() : new NoSuchElementError$1("Effect.fromOption: Option.none")) : succeed$3(option.value));
2778
+ const fromOption$1 = dual((args) => args.length >= 2 || isOption(args[0]), (option, onNone) => isNone(option) ? onNone ? failSync$1(onNone) : fail$4(new NoSuchElementError$1("Effect.fromOption: Option.none")) : succeed$4(option.value));
2725
2779
  const fromResult$1 = match$3({
2726
- onFailure: fail$3,
2727
- onSuccess: succeed$3
2780
+ onFailure: fail$4,
2781
+ onSuccess: succeed$4
2728
2782
  });
2729
2783
  const yieldNowWith = makePrimitive({
2730
2784
  op: "Yield",
@@ -2740,25 +2794,25 @@ const yieldNowWith = makePrimitive({
2740
2794
  }
2741
2795
  });
2742
2796
  const yieldNow$1 = yieldNowWith(0);
2743
- const succeedSome$1 = (a) => succeed$3(some(a));
2744
- const succeedNone$1 = succeed$3(none());
2797
+ const succeedSome$1 = (a) => succeed$4(some(a));
2798
+ const succeedNone$1 = succeed$4(none());
2745
2799
  const failCauseSync$1 = (evaluate) => suspend$1(() => failCause$3(evaluate()));
2746
2800
  const die$3 = (defect) => exitDie(defect);
2747
- const failSync = (error) => suspend$1(() => fail$3(error()));
2748
- const void_$2 = succeed$3(void 0);
2801
+ const failSync$1 = (error) => suspend$1(() => fail$4(error()));
2802
+ const void_$2 = succeed$4(void 0);
2749
2803
  const try_$1 = (options) => {
2750
2804
  const evaluate = typeof options === "function" ? options : options.try;
2751
2805
  const catcher = typeof options === "function" ? (cause) => new UnknownError$1(cause, "An error occurred in Effect.try") : options.catch;
2752
2806
  return suspend$1(() => {
2753
2807
  try {
2754
- return succeed$3(evaluate());
2808
+ return succeed$4(evaluate());
2755
2809
  } catch (err) {
2756
- return fail$3(catcher(err));
2810
+ return fail$4(catcher(err));
2757
2811
  }
2758
2812
  });
2759
2813
  };
2760
2814
  const promise$1 = (evaluate) => callbackOptions(function(resume, signal) {
2761
- evaluate(signal).then((a) => resume(succeed$3(a)), (e) => resume(die$3(e)));
2815
+ evaluate(signal).then((a) => resume(succeed$4(a)), (e) => resume(die$3(e)));
2762
2816
  }, evaluate.length !== 0);
2763
2817
  const tryPromise$1 = (options) => {
2764
2818
  const f = typeof options === "function" ? options : options.try;
@@ -2766,19 +2820,18 @@ const tryPromise$1 = (options) => {
2766
2820
  return callbackOptions(function(resume, signal) {
2767
2821
  const failWithCatch = (cause) => suspend$1(() => {
2768
2822
  try {
2769
- return fail$3(internalCall(() => catcher(cause)));
2823
+ return fail$4(internalCall(() => catcher(cause)));
2770
2824
  } catch (err) {
2771
2825
  return die$3(err);
2772
2826
  }
2773
2827
  });
2774
2828
  try {
2775
- f(signal).then((a) => resume(succeed$3(a)), (e) => resume(failWithCatch(e)));
2829
+ f(signal).then((a) => resume(succeed$4(a)), (e) => resume(failWithCatch(e)));
2776
2830
  } catch (err) {
2777
2831
  resume(failWithCatch(err));
2778
2832
  }
2779
2833
  }, f.length !== 0);
2780
2834
  };
2781
- const withFiberId = (f) => withFiber$1((fiber) => f(fiber.id));
2782
2835
  const callbackOptions = function() {
2783
2836
  const Proto = makePrimitiveProto({
2784
2837
  op: "Async",
@@ -2794,9 +2847,9 @@ const callbackOptions = function() {
2794
2847
  }, controller?.signal);
2795
2848
  if (yielded !== false) return yielded;
2796
2849
  yielded = true;
2797
- fiber._yielded = () => {
2850
+ fiber.yieldWith(() => {
2798
2851
  resumed = true;
2799
- };
2852
+ });
2800
2853
  if (controller === void 0 && onCancel === void 0) return Yield;
2801
2854
  fiber._stack.push(asyncFinalizer(() => {
2802
2855
  resumed = true;
@@ -2837,7 +2890,9 @@ const gen$1 = (...args) => {
2837
2890
  const [options, body] = args;
2838
2891
  return suspend$1(() => fromIteratorUnsafe(body.call(options.self)));
2839
2892
  };
2840
- const fnUntraced$1 = (body, ...pipeables) => {
2893
+ const fnBody = (bodyOrOptions, pipeables) => typeof bodyOrOptions === "function" ? bodyOrOptions : pipeables.shift().bind(bodyOrOptions.self);
2894
+ const fnUntraced$1 = (bodyOrOptions, ...pipeables) => {
2895
+ const body = fnBody(bodyOrOptions, pipeables);
2841
2896
  const fn = pipeables.length === 0 ? function() {
2842
2897
  return suspend$1(() => fromIteratorUnsafe(body.apply(this, arguments)));
2843
2898
  } : function() {
@@ -2867,9 +2922,18 @@ const fn$1 = function() {
2867
2922
  return makeFn(name, arguments[0], defError, Array.prototype.slice.call(arguments, 1), nameFirst, spanOptions);
2868
2923
  };
2869
2924
  const makeFn = (name, bodyOrOptions, defError, pipeables, addSpan, spanOptions) => {
2870
- const body = typeof bodyOrOptions === "function" ? bodyOrOptions : pipeables.shift().bind(bodyOrOptions.self);
2925
+ const body = fnBody(bodyOrOptions, pipeables);
2871
2926
  const definitionName = `${name} (definition)`;
2872
2927
  const definitionStack = defError ? fnStackCleaner(() => defError.stack) : constUndefined;
2928
+ const makeCallFrame = (callError) => (prev) => ({
2929
+ name,
2930
+ stack: callError ? fnStackCleaner(() => callError.stack) : constUndefined,
2931
+ parent: {
2932
+ name: definitionName,
2933
+ stack: definitionStack,
2934
+ parent: prev
2935
+ }
2936
+ });
2873
2937
  return defineFunctionLength(body.length, function(...args) {
2874
2938
  let result = suspend$1(() => {
2875
2939
  const iter = body.apply(this, arguments);
@@ -2884,31 +2948,26 @@ const makeFn = (name, bodyOrOptions, defError, pipeables, addSpan, spanOptions)
2884
2948
  callError = new globalThis.Error();
2885
2949
  setStackTraceLimit(prevLimit);
2886
2950
  }
2887
- return updateService$1(addSpan ? useSpan$1(name, spanOptions, (span) => provideParentSpan(result, span)) : result, CurrentStackFrame, (prev) => ({
2888
- name,
2889
- stack: callError ? fnStackCleaner(() => callError.stack) : constUndefined,
2890
- parent: {
2891
- name: definitionName,
2892
- stack: definitionStack,
2893
- parent: prev
2894
- }
2895
- }));
2951
+ return updateService$1(addSpan ? useSpan$1(name, spanOptions, (span) => provideParentSpan(result, span)) : result, CurrentStackFrame, makeCallFrame(callError));
2952
+ });
2953
+ };
2954
+ const fnUntracedEager$1 = (bodyOrOptions, ...pipeables) => {
2955
+ const body = fnBody(bodyOrOptions, pipeables);
2956
+ return defineFunctionLength(body.length, pipeables.length === 0 ? function() {
2957
+ return fromIteratorEagerUnsafe(() => body.apply(this, arguments));
2958
+ } : function() {
2959
+ let effect = fromIteratorEagerUnsafe(() => body.apply(this, arguments));
2960
+ for (const pipeable of pipeables) effect = pipeable(effect, ...arguments);
2961
+ return effect;
2896
2962
  });
2897
2963
  };
2898
- const fnUntracedEager$1 = (body, ...pipeables) => defineFunctionLength(body.length, pipeables.length === 0 ? function() {
2899
- return fromIteratorEagerUnsafe(() => body.apply(this, arguments));
2900
- } : function() {
2901
- let effect = fromIteratorEagerUnsafe(() => body.apply(this, arguments));
2902
- for (const pipeable of pipeables) effect = pipeable(effect, ...arguments);
2903
- return effect;
2904
- });
2905
2964
  const fromIteratorEagerUnsafe = (evaluate) => {
2906
2965
  try {
2907
2966
  const iterator = evaluate();
2908
2967
  let value = void 0;
2909
2968
  while (true) {
2910
2969
  const state = iterator.next(value);
2911
- if (state.done) return succeed$3(state.value);
2970
+ if (state.done) return succeed$4(state.value);
2912
2971
  const primitive = state.value;
2913
2972
  if (primitive && primitive._tag === "Success") {
2914
2973
  value = primitive.value;
@@ -2935,7 +2994,7 @@ const fromIteratorUnsafe = function() {
2935
2994
  const iter = this.iterator;
2936
2995
  while (true) {
2937
2996
  const state = iter.next(value);
2938
- if (state.done) return succeed$3(state.value);
2997
+ if (state.done) return succeed$4(state.value);
2939
2998
  if (!effectIsExit(state.value)) {
2940
2999
  fiber._stack.push(this);
2941
3000
  return state.value;
@@ -2956,7 +3015,7 @@ const fromIteratorUnsafe = function() {
2956
3015
  return new IteratorImpl(iterator, initial);
2957
3016
  };
2958
3017
  }();
2959
- const as$1 = dual(2, (self, value) => new ContImpl(self, returnPayload, succeed$3(value)));
3018
+ const as$1 = dual(2, (self, value) => new ContImpl(self, returnPayload, succeed$4(value)));
2960
3019
  const evaluateCont = function(fiber) {
2961
3020
  fiber._stack.push(this);
2962
3021
  return this[args];
@@ -3048,8 +3107,8 @@ const mapBothEager$1 = dual(2, (self, options) => effectIsExit(self) ? exitMapBo
3048
3107
  const catchEager$1 = dual(2, (self, f) => {
3049
3108
  if (effectIsExit(self)) {
3050
3109
  if (self._tag === "Success") return self;
3051
- const error = findError$1(self.cause);
3052
- if (isFailure$1(error)) return self;
3110
+ const error = findRecoverableError(self.cause);
3111
+ if (isFailure$1(error)) return exitFailCause(error.failure);
3053
3112
  return f(error.success);
3054
3113
  }
3055
3114
  return catch_$1(self, f);
@@ -3057,22 +3116,18 @@ const catchEager$1 = dual(2, (self, f) => {
3057
3116
  const exitInterrupt = (fiberId) => exitFailCause(causeInterrupt(fiberId));
3058
3117
  const exitIsSuccess = (self) => self._tag === "Success";
3059
3118
  const exitIsFailure = (self) => self._tag === "Failure";
3060
- const exitFilterCause = (self) => self._tag === "Failure" ? succeed$4(self.cause) : fail$4(self);
3061
- const exitFindError = composePassthrough(exitFilterCause, findError$1);
3119
+ const exitFilterCause = (self) => self._tag === "Failure" ? succeed$5(self.cause) : fail$5(self);
3120
+ const exitFindError = composePassthrough(exitFilterCause, findError);
3062
3121
  const exitHasInterrupts = (self) => self._tag === "Failure" && hasInterrupts$1(self.cause);
3063
3122
  const exitVoid = exitSucceed(void 0);
3064
3123
  const exitMap = dual(2, (self, f) => self._tag === "Success" ? exitSucceed(f(self.value)) : self);
3065
3124
  const exitMapError = dual(2, (self, f) => {
3066
3125
  if (self._tag === "Success") return self;
3067
- const error = findError$1(self.cause);
3068
- if (isFailure$1(error)) return self;
3069
- return exitFail(f(error.success));
3126
+ return exitFailCause(causeMap(self.cause, f));
3070
3127
  });
3071
3128
  const exitMapBoth = dual(2, (self, options) => {
3072
3129
  if (self._tag === "Success") return exitSucceed(options.onSuccess(self.value));
3073
- const error = findError$1(self.cause);
3074
- if (isFailure$1(error)) return self;
3075
- return exitFail(options.onFailure(error.success));
3130
+ return exitFailCause(causeMap(self.cause, options.onFailure));
3076
3131
  });
3077
3132
  const exitZipRight = dual(2, (self, that) => exitIsSuccess(self) ? that : self);
3078
3133
  const exitAsVoidAll = (exits) => {
@@ -3085,7 +3140,7 @@ const exitFindErrorOption = (self) => {
3085
3140
  return isFailure$1(error) ? none() : some(error.success);
3086
3141
  };
3087
3142
  const service$1 = (service) => service;
3088
- const serviceOption$1 = (service) => withFiber$1((fiber) => succeed$3(getOption(fiber.context, service)));
3143
+ const serviceOption$1 = (service) => withFiber$1((fiber) => succeed$4(getOption(fiber.context, service)));
3089
3144
  const updateContext$1 = dual(2, (self, f) => withFiber$1((fiber) => {
3090
3145
  const prevContext = fiber.context;
3091
3146
  const nextContext = f(prevContext);
@@ -3103,7 +3158,7 @@ const updateService$1 = dual(3, (self, service, f) => updateContext$1(self, (s)
3103
3158
  return add(s, service, next);
3104
3159
  }));
3105
3160
  const context$1 = () => getContext;
3106
- const getContext = withFiber$1((fiber) => succeed$3(fiber.context));
3161
+ const getContext = withFiber$1((fiber) => succeed$4(fiber.context));
3107
3162
  const contextWith$1 = (f) => withFiber$1((fiber) => f(fiber.context));
3108
3163
  const provideContext$1 = dual(2, (self, context) => {
3109
3164
  if (effectIsExit(self)) return self;
@@ -3115,7 +3170,7 @@ const provideService$1 = function() {
3115
3170
  };
3116
3171
  const provideServiceImpl = (self, service, implementation) => updateContext$1(self, add(service, implementation));
3117
3172
  const zipWith$1 = dual((args) => isEffect$1(args[1]), (self, that, f, options) => options?.concurrent ? map$2(all$1([self, that], { concurrency: 2 }), ([a, a2]) => f(a, a2)) : flatMap$2(self, (a) => map$2(that, (a2) => f(a, a2))));
3118
- const filterOrFail$1 = dual((args) => isEffect$1(args[0]), (self, predicate, orFailWith) => filterOrElse(self, predicate, orFailWith ? (a) => fail$3(orFailWith(a)) : () => fail$3(new NoSuchElementError$1())));
3173
+ const filterOrFail$1 = dual((args) => isEffect$1(args[0]), (self, predicate, orFailWith) => filterOrElse(self, predicate, orFailWith ? (a) => fail$4(orFailWith(a)) : () => fail$4(new NoSuchElementError$1())));
3119
3174
  const when$1 = dual(2, (self, condition) => flatMap$2(condition, (pass) => pass ? asSome$1(self) : succeedNone$1));
3120
3175
  const forever$2 = dual((args) => isEffect$1(args[0]), (self, options) => whileLoop$1({
3121
3176
  while: constTrue,
@@ -3140,21 +3195,27 @@ const catchCauseFilter = dual(3, (self, filter, f) => catchCause$1(self, (cause)
3140
3195
  const eb = filter(cause);
3141
3196
  return isFailure$1(eb) ? failCause$3(eb.failure) : f(eb.success, cause);
3142
3197
  }));
3143
- const catch_$1 = dual(2, (self, f) => catchCauseFilter(self, findError$1, (e) => f(e)));
3198
+ const catch_$1 = dual(2, (self, f) => catchCauseFilter(self, findRecoverableError, (e) => f(e)));
3144
3199
  const catchNoSuchElement$1 = (self) => matchEffect$2(self, {
3145
- onFailure: (error) => isNoSuchElementError(error) ? succeedNone$1 : fail$3(error),
3200
+ onFailure: (error) => isNoSuchElementError(error) ? succeedNone$1 : fail$4(error),
3146
3201
  onSuccess: succeedSome$1
3147
3202
  });
3148
3203
  const catchDefect$1 = dual(2, (self, f) => catchCauseFilter(self, findDefect, f));
3149
3204
  const tapCause$1 = dual(2, (self, f) => catchCause$1(self, (cause) => andThen$1(f(cause), failCause$3(cause))));
3205
+ const tapCauseFilter = dual(3, (self, filter, f) => catchCause$1(self, (cause) => {
3206
+ const result = filter(cause);
3207
+ if (isFailure$1(result)) return failCause$3(cause);
3208
+ return andThen$1(f(result.success, cause), failCause$3(cause));
3209
+ }));
3210
+ const tapError$1 = dual(2, (self, f) => tapCauseFilter(self, findError, (e) => f(e)));
3150
3211
  const catchIf$1 = dual((args) => isEffect$1(args[0]), (self, predicate, f, orElse) => catchCause$1(self, (cause) => {
3151
- const error = findError$1(cause);
3212
+ const error = findRecoverableError(cause);
3152
3213
  if (isFailure$1(error)) return failCause$3(error.failure);
3153
3214
  if (!predicate(error.success)) return orElse ? orElse(error.success) : failCause$3(cause);
3154
3215
  return f(error.success);
3155
3216
  }));
3156
3217
  const catchFilter$1 = dual((args) => isEffect$1(args[0]), (self, filter, f, orElse) => catchCause$1(self, (cause) => {
3157
- const error = findError$1(cause);
3218
+ const error = findRecoverableError(cause);
3158
3219
  if (isFailure$1(error)) return failCause$3(error.failure);
3159
3220
  const result = filter(error.success);
3160
3221
  if (isFailure$1(result)) return orElse ? orElse(result.failure) : failCause$3(cause);
@@ -3168,42 +3229,57 @@ const catchTags$1 = dual((args) => isEffect$1(args[0]), (self, cases, orElse) =>
3168
3229
  let keys;
3169
3230
  return catchFilter$1(self, (e) => {
3170
3231
  keys ??= Object.keys(cases);
3171
- return hasProperty(e, "_tag") && isString(e["_tag"]) && keys.includes(e["_tag"]) ? succeed$4(e) : fail$4(e);
3232
+ return hasProperty(e, "_tag") && isString(e["_tag"]) && keys.includes(e["_tag"]) ? succeed$5(e) : fail$5(e);
3172
3233
  }, (e) => cases[e["_tag"]](e), orElse);
3173
3234
  });
3174
3235
  const catchReason$1 = dual((args) => isEffect$1(args[0]), (self, errorTag, reasonTag, f, orElse) => catchIf$1(self, (e) => isTagged(e, errorTag) && hasProperty(e, "reason") && (orElse !== void 0 || isTagged(e.reason, reasonTag)), (e) => {
3175
3236
  const reason = e.reason;
3176
3237
  if (isTagged(reason, reasonTag)) return f(reason, e);
3177
- return orElse ? orElse(reason, e) : fail$3(e);
3238
+ return orElse ? orElse(reason, e) : fail$4(e);
3178
3239
  }));
3179
- const mapError$1 = dual(2, (self, f) => catch_$1(self, (error) => failSync(() => f(error))));
3180
- const mapBoth = dual(2, (self, options) => matchEffect$2(self, {
3181
- onFailure: (e) => failSync(() => options.onFailure(e)),
3240
+ const mapError$1 = dual(2, (self, f) => catchCause$1(self, (cause) => failCause$3(causeMap(cause, f))));
3241
+ const mapBoth = dual(2, (self, options) => matchCauseEffect$1(self, {
3242
+ onFailure: (cause) => failCause$3(causeMap(cause, options.onFailure)),
3182
3243
  onSuccess: (a) => sync$1(() => options.onSuccess(a))
3183
3244
  }));
3184
3245
  const orDie$2 = (self) => catch_$1(self, die$3);
3185
3246
  const orElseSucceed$1 = dual(2, (self, f) => catch_$1(self, (error) => sync$1(() => f(error))));
3247
+ const ignoreCauseLogger = (log) => log === "Unhandled" ? (...message) => withFiber$1((fiber) => {
3248
+ const level = fiber.getRef(UnhandledLogLevel);
3249
+ return level === void 0 ? void_$2 : logWithLevel(level)(...message);
3250
+ }) : logWithLevel(log === true ? void 0 : log);
3186
3251
  const ignore$1 = dual((args) => isEffect$1(args[0]), (self, options) => {
3187
3252
  if (!options?.log) return matchEffect$2(self, {
3188
3253
  onFailure: (_) => void_$2,
3189
3254
  onSuccess: (_) => void_$2
3190
3255
  });
3191
- const logEffect = logWithLevel(options.log === true ? void 0 : options.log);
3256
+ const logEffect = ignoreCauseLogger(options.log);
3192
3257
  return matchCauseEffect$1(self, {
3193
3258
  onFailure(cause) {
3194
- const failure = findFail(cause);
3195
- return isFailure$1(failure) ? failCause$3(failure.failure) : options.message === void 0 ? logEffect(cause) : logEffect(options.message, cause);
3259
+ const error = findRecoverableError(cause);
3260
+ return isFailure$1(error) ? failCause$3(error.failure) : options.message === void 0 ? logEffect(cause) : logEffect(options.message, cause);
3196
3261
  },
3197
3262
  onSuccess: (_) => void_$2
3198
3263
  });
3199
3264
  });
3265
+ const ignoreCause$1 = dual((args) => isEffect$1(args[0]), (self, options) => {
3266
+ if (!options?.log) return matchCauseEffect$1(self, {
3267
+ onFailure: (_) => void_$2,
3268
+ onSuccess: (_) => void_$2
3269
+ });
3270
+ const logEffect = ignoreCauseLogger(options.log);
3271
+ return matchCauseEffect$1(self, {
3272
+ onFailure: (cause) => options.message === void 0 ? logEffect(cause) : logEffect(options.message, cause),
3273
+ onSuccess: (_) => void_$2
3274
+ });
3275
+ });
3200
3276
  const option$1 = (self) => match$1(self, {
3201
3277
  onFailure: none,
3202
3278
  onSuccess: some
3203
3279
  });
3204
3280
  const result$1 = (self) => matchEager(self, {
3205
- onFailure: fail$4,
3206
- onSuccess: succeed$4
3281
+ onFailure: fail$5,
3282
+ onSuccess: succeed$5
3207
3283
  });
3208
3284
  const matchCauseEffect$1 = dual(2, (self, options) => new OnSuccessAndFailureImpl(self, options.onSuccess.length !== 1 ? (a) => options.onSuccess(a) : options.onSuccess, options.onFailure.length !== 1 ? (cause) => options.onFailure(cause) : options.onFailure));
3209
3285
  const OnSuccessAndFailureProto = makePrimitiveProto({
@@ -3235,10 +3311,10 @@ const makeMatch = (op, onFailure) => {
3235
3311
  return MatchImpl;
3236
3312
  };
3237
3313
  const MatchImpl = makeMatch("Match", function(cause, fiber) {
3238
- const fail = cause.reasons.find(isFailReason$1);
3239
- if (fail === void 0) return failCause$3(cause);
3314
+ const error = findRecoverableError(cause);
3315
+ if (isFailure$1(error)) return failCause$3(error.failure);
3240
3316
  const handlers = this.payload;
3241
- return fiber.succeedWith(continuationMarksStack ? handlers.onFailure(fail.error) : internalCall(() => handlers.onFailure(fail.error)));
3317
+ return fiber.succeedWith(continuationMarksStack ? handlers.onFailure(error.success) : internalCall(() => handlers.onFailure(error.success)));
3242
3318
  });
3243
3319
  const MatchCauseImpl = makeMatch("MatchCause", function(cause, fiber) {
3244
3320
  const handlers = this.payload;
@@ -3247,8 +3323,8 @@ const MatchCauseImpl = makeMatch("MatchCause", function(cause, fiber) {
3247
3323
  const matchCause = dual(2, (self, options) => new MatchCauseImpl(self, options));
3248
3324
  const matchEffect$2 = dual(2, (self, options) => matchCauseEffect$1(self, {
3249
3325
  onFailure: (cause) => {
3250
- const fail = cause.reasons.find(isFailReason$1);
3251
- return fail ? options.onFailure(fail.error) : failCause$3(cause);
3326
+ const error = findRecoverableError(cause);
3327
+ return isFailure$1(error) ? failCause$3(error.failure) : options.onFailure(error.success);
3252
3328
  },
3253
3329
  onSuccess: options.onSuccess
3254
3330
  }));
@@ -3256,8 +3332,8 @@ const match$1 = dual(2, (self, options) => new MatchImpl(self, options));
3256
3332
  const matchEager = dual(2, (self, options) => {
3257
3333
  if (effectIsExit(self)) {
3258
3334
  if (self._tag === "Success") return exitSucceed(options.onSuccess(self.value));
3259
- const error = findError$1(self.cause);
3260
- if (isFailure$1(error)) return self;
3335
+ const error = findRecoverableError(self.cause);
3336
+ if (isFailure$1(error)) return exitFailCause(error.failure);
3261
3337
  return exitSucceed(options.onFailure(error.success));
3262
3338
  }
3263
3339
  return match$1(self, options);
@@ -3284,13 +3360,13 @@ const exitPrimitive = makePrimitive({
3284
3360
  }
3285
3361
  });
3286
3362
  const delay$1 = dual(2, (self, duration) => andThen$1(sleep$1(duration), self));
3287
- const timeoutOrElse$1 = dual(2, (self, options) => flatMap$2(timeoutOption$1(self, options.duration), (option) => isNone(option) ? options.orElse() : succeed$3(option.value)));
3363
+ const timeoutOrElse$1 = dual(2, (self, options) => flatMap$2(timeoutOption$1(self, options.duration), (option) => isNone(option) ? options.orElse() : succeed$4(option.value)));
3288
3364
  const timeoutErrorFromDuration = (duration) => new TimeoutError$1(`Operation timed out after '${format(duration)}'`);
3289
3365
  const timeout$1 = dual(2, (self, duration) => {
3290
3366
  const decoded = fromInputUnsafe(duration);
3291
3367
  return timeoutOrElse$1(self, {
3292
3368
  duration: decoded,
3293
- orElse: () => fail$3(timeoutErrorFromDuration(decoded))
3369
+ orElse: () => fail$4(timeoutErrorFromDuration(decoded))
3294
3370
  });
3295
3371
  });
3296
3372
  const timeoutOption$1 = dual(2, (self, duration) => raceFirst$1(asSome$1(self), as$1(sleep$1(duration), none())));
@@ -3322,16 +3398,16 @@ const runFinalizer = (finalizer, exit_) => {
3322
3398
  return exitDie(defect);
3323
3399
  }
3324
3400
  };
3325
- const combineFinalizerCause = (exit_, finalizer) => exitIsSuccess(exit_) ? finalizer : catchCause$1(finalizer, (cause) => failCause$3(causeCombine(exit_.cause, cause)));
3401
+ const combineFinalizerCause = (exit_, finalizer) => exitIsSuccess(exit_) ? finalizer : catchCause$1(finalizer, (cause) => failCause$3(causeElectDefects(causeCombine(exit_.cause, cause))));
3326
3402
  const scopeCloseFinalizers = fnUntraced$1(function* (self, finalizers, exit_) {
3327
3403
  let exits = [];
3328
3404
  const fibers = [];
3329
- const arr = Array.from(finalizers.values());
3405
+ const arr = Array.from(finalizers);
3330
3406
  const parent = getCurrentFiber();
3331
3407
  for (let i = arr.length - 1; i >= 0; i--) {
3332
- const finalizer = arr[i];
3408
+ const [key, finalizer] = arr[i];
3333
3409
  if (self.strategy === "sequential") exits.push(yield* exit$1(runFinalizer(finalizer, exit_)));
3334
- else fibers.push(forkUnsafe$1(parent, runFinalizer(finalizer, exit_), true, true, "inherit"));
3410
+ else if (key !== parent) fibers.push(forkUnsafe$1(parent, runFinalizer(finalizer, exit_), true, true, "inherit"));
3335
3411
  }
3336
3412
  if (fibers.length > 0) exits = yield* fiberAwaitAll(fibers);
3337
3413
  return yield* exitAsVoidAll(exits);
@@ -3477,8 +3553,8 @@ const makeCachedUnsafe = (self, ttlMillis) => {
3477
3553
  const join = (fiber, run) => {
3478
3554
  run.awaiters++;
3479
3555
  onExitUnsafe(fiber, () => {
3480
- if (--run.awaiters > 0 || current !== run) return;
3481
- current = void 0;
3556
+ if (--run.awaiters > 0 || run.done) return;
3557
+ if (current === run) current = void 0;
3482
3558
  return fiberInterrupt(run.fiber);
3483
3559
  });
3484
3560
  return fiberJoin(run.fiber);
@@ -3490,11 +3566,13 @@ const makeCachedUnsafe = (self, ttlMillis) => {
3490
3566
  const clock = fiber.getRef(ClockRef);
3491
3567
  const run = {
3492
3568
  fiber: new FiberImpl(fiber.context),
3493
- awaiters: 0
3569
+ awaiters: 0,
3570
+ done: false
3494
3571
  };
3495
3572
  current = run;
3496
3573
  const joined = join(fiber, run);
3497
3574
  run.fiber.evaluate(onExitPrimitive$1(self, (exit_) => {
3575
+ run.done = true;
3498
3576
  if (current !== run) return;
3499
3577
  current = void 0;
3500
3578
  if (exitHasInterrupts(exit_)) return;
@@ -3504,6 +3582,7 @@ const makeCachedUnsafe = (self, ttlMillis) => {
3504
3582
  }));
3505
3583
  return run.fiber._exit ?? joined;
3506
3584
  }), sync$1(() => {
3585
+ current = void 0;
3507
3586
  exit = void 0;
3508
3587
  })];
3509
3588
  };
@@ -3549,15 +3628,7 @@ const uninterruptibleMask$1 = (f) => withFiber$1((fiber) => {
3549
3628
  const all$1 = (arg, options) => {
3550
3629
  if (isIterable(arg)) return options?.mode === "result" ? forEach$2(arg, result$1, options) : forEach$2(arg, identity, options);
3551
3630
  else if (options?.discard) return options.mode === "result" ? forEach$2(Object.values(arg), result$1, options) : forEach$2(Object.values(arg), identity, options);
3552
- return suspend$1(() => {
3553
- const out = {};
3554
- return as$1(forEach$2(Object.entries(arg), ([key, effect]) => map$2(options?.mode === "result" ? result$1(effect) : effect, (value) => {
3555
- assignProperty(out, key, value);
3556
- }), {
3557
- discard: true,
3558
- concurrency: options?.concurrency
3559
- }), out);
3560
- });
3631
+ return suspend$1(() => map$2(forEach$2(Object.entries(arg), ([key, effect]) => map$2(options?.mode === "result" ? result$1(effect) : effect, (value) => [key, value]), { concurrency: options?.concurrency }), Object.fromEntries));
3561
3632
  };
3562
3633
  const whileLoop$1 = makePrimitive({
3563
3634
  op: "While",
@@ -3582,13 +3653,13 @@ const forEach$2 = dual((args) => typeof args[1] === "function", (iterable, f, op
3582
3653
  if (concurrency === 1) return forEachSequential(iterable, f, options);
3583
3654
  const items = fromIterable$1(iterable);
3584
3655
  let length = items.length;
3585
- if (length === 0) return options?.discard ? void_$2 : succeed$3([]);
3656
+ if (length === 0) return options?.discard ? void_$2 : succeed$4([]);
3586
3657
  const out = options?.discard ? void 0 : new Array(length);
3587
3658
  const eff = forEachConcurrent({
3588
3659
  f,
3589
3660
  out
3590
3661
  }, items, { concurrency });
3591
- return eff ? as$1(eff, out) : succeed$3(out);
3662
+ return eff ? as$1(eff, out) : succeed$4(out);
3592
3663
  }));
3593
3664
  const forEachSequential = (iterable, f, options) => suspend$1(() => {
3594
3665
  const out = options?.discard ? void 0 : [];
@@ -3682,7 +3753,7 @@ const iterateConcurrentImpl = (options) => {
3682
3753
  const reasons = exit.cause.reasons.filter((reason) => reason._tag !== "Interrupt");
3683
3754
  if (reasons.length > 0) {
3684
3755
  const cause = causeFromReasons(reasons);
3685
- terminal = exitFailCause(terminal._tag === "Failure" ? causeCombine(terminal.cause, cause) : cause);
3756
+ terminal = exitFailCause(terminal._tag === "Failure" ? causeElectDefects(causeCombine(terminal.cause, cause)) : cause);
3686
3757
  }
3687
3758
  }
3688
3759
  } else {
@@ -3732,10 +3803,10 @@ const forEachConcurrent = iterateConcurrentImpl({
3732
3803
  else if (state.out) state.out[index] = exit.value;
3733
3804
  }
3734
3805
  });
3735
- const filterOrElse = dual(3, (self, predicate, orElse) => flatMap$2(self, (a) => predicate(a) ? succeed$3(a) : orElse(a)));
3806
+ const filterOrElse = dual(3, (self, predicate, orElse) => flatMap$2(self, (a) => predicate(a) ? succeed$4(a) : orElse(a)));
3736
3807
  const forkChild$1 = dual((args) => isEffect$1(args[0]), (self, options) => withFiber$1((fiber) => {
3737
3808
  interruptChildrenPatch();
3738
- return succeed$3(forkUnsafe$1(fiber, self, options?.startImmediately, false, options?.uninterruptible ?? false));
3809
+ return succeed$4(forkUnsafe$1(fiber, self, options?.startImmediately, false, options?.uninterruptible ?? false));
3739
3810
  }));
3740
3811
  const forkUnsafe$1 = (parent, effect, immediate = false, daemon = false, uninterruptible = false) => {
3741
3812
  const parentRuntime = parent;
@@ -3752,17 +3823,17 @@ const forkUnsafe$1 = (parent, effect, immediate = false, daemon = false, uninter
3752
3823
  }
3753
3824
  return child;
3754
3825
  };
3826
+ const forkDetach$1 = dual((args) => isEffect$1(args[0]), (self, options) => withFiber$1((fiber) => succeed$4(forkUnsafe$1(fiber, self, options?.startImmediately, true, options?.uninterruptible))));
3827
+ const fiberScopeFinalizer = (fiber) => () => withFiber$1((current) => current === fiber ? void_$2 : fiberInterrupt(fiber));
3755
3828
  const forkIn$1 = dual((args) => isEffect$1(args[0]), (self, scope, options) => withFiber$1((parent) => {
3756
- const fiber = forkUnsafe$1(parent, self, options?.startImmediately, true, options?.uninterruptible);
3829
+ const fiber = scope.state._tag === "Closed" ? new FiberImpl(parent.context) : forkUnsafe$1(parent, self, options?.startImmediately, true, options?.uninterruptible);
3757
3830
  if (!fiber._exit) {
3758
3831
  if (scope.state._tag !== "Closed") {
3759
- const key = {};
3760
- const finalizer = () => withFiberId((interruptor) => interruptor === fiber.id ? void_$2 : fiberInterrupt(fiber));
3761
- scopeAddFinalizerUnsafe(scope, key, finalizer);
3762
- fiber.addObserver(() => scopeRemoveFinalizerUnsafe(scope, key));
3832
+ scopeAddFinalizerUnsafe(scope, fiber, fiberScopeFinalizer(fiber));
3833
+ fiber.addObserver(() => scopeRemoveFinalizerUnsafe(scope, fiber));
3763
3834
  } else fiber.interruptUnsafe(parent.id, fiberStackAnnotations(parent));
3764
3835
  }
3765
- return succeed$3(fiber);
3836
+ return succeed$4(fiber);
3766
3837
  }));
3767
3838
  const forkScoped$1 = dual((args) => isEffect$1(args[0]), (self, options) => flatMap$2(scope$1, (scope) => forkIn$1(self, scope, options)));
3768
3839
  const runForkWith$1 = (context) => (effect, options) => {
@@ -3787,7 +3858,7 @@ const fiberRunIn = dual(2, (self, scope) => {
3787
3858
  return self;
3788
3859
  }
3789
3860
  scopeRemoveFinalizerUnsafe(scope, self);
3790
- scopeAddFinalizerUnsafe(scope, self, () => fiberInterrupt(self));
3861
+ scopeAddFinalizerUnsafe(scope, self, fiberScopeFinalizer(self));
3791
3862
  self.addObserver(() => scopeRemoveFinalizerUnsafe(scope, self));
3792
3863
  return self;
3793
3864
  });
@@ -3828,8 +3899,8 @@ const runSyncWith = (context) => {
3828
3899
  };
3829
3900
  };
3830
3901
  const runSync$1 = runSyncWith(empty$4());
3831
- const succeedTrue = succeed$3(true);
3832
- const succeedFalse = succeed$3(false);
3902
+ const succeedTrue = succeed$4(true);
3903
+ const succeedFalse = succeed$4(false);
3833
3904
  var Latch = class {
3834
3905
  waiters = [];
3835
3906
  scheduled = void 0;
@@ -4009,7 +4080,7 @@ const withSpan$1 = function() {
4009
4080
  };
4010
4081
  const annotateCurrentSpan$1 = (...args) => withFiber$1((fiber) => {
4011
4082
  const span = fiber.currentSpanLocal;
4012
- if (span) {
4083
+ if (span && span.status._tag !== "Ended") {
4013
4084
  if (args.length === 1) for (const [key, value] of Object.entries(args[0])) span.attribute(key, value);
4014
4085
  else span.attribute(args[0], args[1]);
4015
4086
  }
@@ -4069,10 +4140,10 @@ const wallTimeNanos = function() {
4069
4140
  return origin + monotonic;
4070
4141
  };
4071
4142
  }();
4072
- const clockWith$1 = (f) => withFiber$1((fiber) => f(fiber.getRef(ClockRef)));
4073
- const sleep$1 = (duration) => clockWith$1((clock) => clock.sleep(fromInputUnsafe(duration)));
4074
- const currentTimeMillis = clockWith$1((clock) => clock.currentTimeMillis);
4075
- const monotonicTimeNanos = clockWith$1((clock) => clock.monotonicTimeNanos);
4143
+ const clockWith = (f) => withFiber$1((fiber) => f(fiber.getRef(ClockRef)));
4144
+ const sleep$1 = (duration) => clockWith((clock) => clock.sleep(fromInputUnsafe(duration)));
4145
+ const currentTimeMillis = clockWith((clock) => clock.currentTimeMillis);
4146
+ const monotonicTimeNanos = clockWith((clock) => clock.monotonicTimeNanos);
4076
4147
  const TimeoutErrorTypeId = "~effect/Cause/TimeoutError";
4077
4148
  const isTimeoutError$1 = (u) => hasProperty(u, TimeoutErrorTypeId);
4078
4149
  var TimeoutError$1 = class extends TaggedError("TimeoutError") {
@@ -4213,7 +4284,7 @@ const tracerLogger = loggerMake(({ cause, fiber, logLevel, message }) => {
4213
4284
  const clock = fiber.getRef(ClockRef);
4214
4285
  const annotations = fiber.getRef(CurrentLogAnnotations$1);
4215
4286
  const span = fiber.cache.span;
4216
- if (span === void 0 || span._tag === "ExternalSpan") return;
4287
+ if (span === void 0 || span._tag === "ExternalSpan" || span.status._tag === "Ended") return;
4217
4288
  const attributes = {};
4218
4289
  for (const [key, value] of Object.entries(annotations)) assignProperty(attributes, key, value);
4219
4290
  attributes["effect.fiberId"] = fiber.id;
@@ -4224,13 +4295,12 @@ const tracerLogger = loggerMake(({ cause, fiber, logLevel, message }) => {
4224
4295
  function interruptChildrenPatch() {
4225
4296
  fiberMiddleware.interruptChildren ??= fiberInterruptChildren;
4226
4297
  }
4227
- const undefined_$1 = succeed$3(void 0);
4228
- //#endregion
4229
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Exit.js
4298
+ const undefined_$1 = succeed$4(void 0);
4299
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Exit.js
4230
4300
  const isExit = isExit$1;
4231
- const succeed$2 = exitSucceed;
4301
+ const succeed$3 = exitSucceed;
4232
4302
  const failCause$2 = exitFailCause;
4233
- const fail$2 = exitFail;
4303
+ const fail$3 = exitFail;
4234
4304
  const die$2 = exitDie;
4235
4305
  const interrupt$1 = exitInterrupt;
4236
4306
  const void_$1 = exitVoid;
@@ -4238,8 +4308,7 @@ const isSuccess = exitIsSuccess;
4238
4308
  const isFailure = exitIsFailure;
4239
4309
  const asVoidAll = exitAsVoidAll;
4240
4310
  const findErrorOption$1 = exitFindErrorOption;
4241
- //#endregion
4242
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Deferred.js
4311
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Deferred.js
4243
4312
  const TypeId$4 = "~effect/Deferred";
4244
4313
  const DeferredProto = {
4245
4314
  [TypeId$4]: {
@@ -4270,10 +4339,12 @@ const _await = (self) => callback$1((resume) => {
4270
4339
  });
4271
4340
  const completeWith = dual(2, (self, effect) => sync$1(() => doneUnsafe(self, effect)));
4272
4341
  const done$1 = completeWith;
4342
+ const fail$2 = dual(2, (self, error) => done$1(self, exitFail(error)));
4273
4343
  const failCause$1 = dual(2, (self, cause) => done$1(self, exitFailCause(cause)));
4274
4344
  const interruptWith = dual(2, (self, fiberId) => failCause$1(self, causeInterrupt(fiberId)));
4275
4345
  const isDone$1 = (self) => sync$1(() => isDoneUnsafe(self));
4276
4346
  const isDoneUnsafe = (self) => self.effect !== void 0;
4347
+ const succeed$2 = dual(2, (self, value) => done$1(self, exitSucceed(value)));
4277
4348
  const doneUnsafe = (self, effect) => {
4278
4349
  if (self.effect) return false;
4279
4350
  self.effect = effect;
@@ -4285,14 +4356,12 @@ const doneUnsafe = (self, effect) => {
4285
4356
  return true;
4286
4357
  };
4287
4358
  const into = dual(2, (self, deferred) => uninterruptibleMask$1((restore) => flatMap$2(exit$1(restore(self)), (exit) => done$1(deferred, exit))));
4288
- //#endregion
4289
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/References.js
4359
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/References.js
4290
4360
  const CurrentLogAnnotations = CurrentLogAnnotations$1;
4291
4361
  const CurrentLogSpans = CurrentLogSpans$1;
4292
4362
  const MinimumLogLevel = MinimumLogLevel$1;
4293
4363
  const TracerTimingEnabled = TracerTimingEnabled$1;
4294
- //#endregion
4295
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Scope.js
4364
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Scope.js
4296
4365
  const Scope = scopeTag;
4297
4366
  const make$1 = scopeMake;
4298
4367
  const makeUnsafe = scopeMakeUnsafe;
@@ -4302,8 +4371,7 @@ const addFinalizer$1 = scopeAddFinalizer;
4302
4371
  const fork = scopeFork;
4303
4372
  const forkUnsafe = scopeForkUnsafe;
4304
4373
  const close = scopeClose;
4305
- //#endregion
4306
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Layer.js
4374
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Layer.js
4307
4375
  const TypeId$3 = "~effect/Layer";
4308
4376
  const MemoMapTypeId = "~effect/Layer/MemoMap";
4309
4377
  const makeMemoMapEntry = (memoMap, layer) => {
@@ -4397,7 +4465,7 @@ const succeed$1 = function() {
4397
4465
  if (arguments.length === 1) return (resource) => succeedContext(make$5(arguments[0], resource));
4398
4466
  return succeedContext(make$5(arguments[0], arguments[1]));
4399
4467
  };
4400
- const succeedContext = (context) => fromBuildUnsafe(constant(succeed$3(context)));
4468
+ const succeedContext = (context) => fromBuildUnsafe(constant(succeed$4(context)));
4401
4469
  const empty$1 = succeedContext(empty$4());
4402
4470
  const effect = function() {
4403
4471
  if (arguments.length === 1) return (effect) => effectImpl(arguments[0], effect);
@@ -4412,9 +4480,9 @@ const mergeAllEffect = (layers, memoMap, scope) => {
4412
4480
  const parentScope = forkUnsafe(scope, "parallel");
4413
4481
  return forEach$2(layers, (layer) => layer.build(memoMap, forkUnsafe(parentScope, "sequential")), { concurrency: layers.length }).pipe(map$2((context) => mergeAll$1(...context)));
4414
4482
  };
4415
- const mergeAll = (...layers) => fromBuild((memoMap, scope) => mergeAllEffect(layers, memoMap, scope));
4483
+ const mergeAll = (...layers) => fromBuildMemo((memoMap, scope) => mergeAllEffect(layers, memoMap, scope));
4416
4484
  const merge = dual(2, (self, that) => mergeAll(self, ...Array.isArray(that) ? that : [that]));
4417
- const provideWith = (self, that, f) => fromBuild((memoMap, scope) => flatMap$2(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope) : that.build(memoMap, scope), (context) => self.build(memoMap, scope).pipe(provideContext$1(context), map$2((merged) => f(merged, context)))));
4485
+ const provideWith = (self, that, f) => fromBuildMemo((memoMap, scope) => flatMap$2(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope) : that.build(memoMap, scope), (context) => self.build(memoMap, scope).pipe(provideContext$1(context), map$2((merged) => f(merged, context)))));
4418
4486
  const provide$2 = dual(2, (self, that) => provideWith(self, that, identity));
4419
4487
  const provideMerge = dual(2, (self, that) => provideWith(self, that, (self, that) => merge$1(that, self)));
4420
4488
  const flatMap$1 = dual(2, (self, f) => fromBuild((memoMap, scope) => flatMap$2(self.build(memoMap, scope), (context) => f(context).build(memoMap, scope))));
@@ -4441,13 +4509,13 @@ const makeUnimplemented = (error) => {
4441
4509
  [StreamTypeId]: StreamTypeId,
4442
4510
  channel: {
4443
4511
  [ChannelTypeId]: ChannelTypeId,
4444
- transform: () => succeed$3(dead),
4512
+ transform: () => succeed$4(dead),
4445
4513
  pipe() {
4446
4514
  return pipeArguments(this, arguments);
4447
4515
  }
4448
4516
  },
4449
4517
  [ChannelTypeId]: ChannelTypeId,
4450
- transform: () => succeed$3(dead)
4518
+ transform: () => succeed$4(dead)
4451
4519
  });
4452
4520
  function unimplemented() {
4453
4521
  return dead;
@@ -4458,8 +4526,7 @@ const makeUnimplemented = (error) => {
4458
4526
  };
4459
4527
  const StreamTypeId = "~effect/Stream";
4460
4528
  const ChannelTypeId = "~effect/Channel";
4461
- //#endregion
4462
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Cause.js
4529
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Cause.js
4463
4530
  const isCause = isCause$1;
4464
4531
  const isReason = isCauseReason;
4465
4532
  const isFailReason = isFailReason$1;
@@ -4474,7 +4541,6 @@ const hasInterruptsOnly = hasInterruptsOnly$1;
4474
4541
  const map$1 = causeMap;
4475
4542
  const combine = causeCombine;
4476
4543
  const squash = causeSquash;
4477
- const findError = findError$1;
4478
4544
  const findErrorOption = findErrorOption$2;
4479
4545
  const hasInterrupts = hasInterrupts$1;
4480
4546
  const interruptors = causeInterruptors;
@@ -4491,8 +4557,7 @@ const UnknownError = UnknownError$1;
4491
4557
  const annotate = causeAnnotate;
4492
4558
  const reasonAnnotations = reasonAnnotations$1;
4493
4559
  var StackTrace = class extends Service()("effect/Cause/StackTrace") {};
4494
- //#endregion
4495
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Number.js
4560
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Number.js
4496
4561
  const Number$1 = globalThis.Number;
4497
4562
  const remainder = dual(2, (self, divisor) => {
4498
4563
  if (!globalThis.Number.isFinite(self) || !globalThis.Number.isFinite(divisor) || divisor === 0) return NaN;
@@ -4513,8 +4578,8 @@ function toScientificInteger(n) {
4513
4578
  return [BigInt(digits) * (n < 0 ? -BigInt(1) : BigInt(1)), globalThis.Number(scientific.slice(eIndex + 1)) - digits.length + 1];
4514
4579
  }
4515
4580
  const nextPow2 = (n) => {
4516
- const nextPow = Math.ceil(Math.log(n) / Math.log(2));
4517
- return Math.max(Math.pow(2, nextPow), 2);
4581
+ const nextPow = Math.pow(2, Math.ceil(Math.log2(n)));
4582
+ return Math.max(nextPow < n ? nextPow * 2 : nextPow, 2);
4518
4583
  };
4519
4584
  const parse = (s) => {
4520
4585
  if (s === "NaN") return some(NaN);
@@ -4528,8 +4593,7 @@ const round = dual(2, (self, precision) => {
4528
4593
  const factor = Math.pow(10, precision);
4529
4594
  return Math.round(self * factor) / factor;
4530
4595
  });
4531
- //#endregion
4532
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/random.js
4596
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/random.js
4533
4597
  const Random = Reference("effect/Random", { defaultValue: () => ({
4534
4598
  nextIntUnsafe() {
4535
4599
  return Math.floor(Math.random() * (Number.MAX_SAFE_INTEGER - Number.MIN_SAFE_INTEGER + 1)) + Number.MIN_SAFE_INTEGER;
@@ -4538,18 +4602,7 @@ const Random = Reference("effect/Random", { defaultValue: () => ({
4538
4602
  return Math.random();
4539
4603
  }
4540
4604
  }) });
4541
- const nextBetween = (min, max, draw) => {
4542
- const value = draw * (max - min) + min;
4543
- if (value !== max || min >= max || !Number.isFinite(max)) return value;
4544
- if (max === 0) return -Number.MIN_VALUE;
4545
- const view = new DataView(new ArrayBuffer(8));
4546
- view.setFloat64(0, max);
4547
- const bits = view.getBigUint64(0);
4548
- view.setBigUint64(0, max > 0 ? bits - BigInt(1) : bits + BigInt(1));
4549
- return view.getFloat64(0);
4550
- };
4551
- //#endregion
4552
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Pull.js
4605
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Pull.js
4553
4606
  const catchDone = dual(2, (effect, f) => catchCauseFilter(effect, filterDoneLeftover, (l) => f(l)));
4554
4607
  const isDoneCause = (cause) => cause.reasons.some(isDoneFailure);
4555
4608
  const isDoneFailure = (failure) => failure._tag === "Fail" && isDone(failure.error);
@@ -4558,16 +4611,16 @@ const filterDone = (cause) => {
4558
4611
  let hasFailure = false;
4559
4612
  for (const reason of cause.reasons) if (isDoneFailure(reason)) done ??= reason.error;
4560
4613
  else if (reason._tag !== "Interrupt") hasFailure = true;
4561
- if (done === void 0) return fail$4(cause);
4562
- return hasFailure ? fail$4(fromReasons(cause.reasons.filter((reason) => !isDoneFailure(reason)))) : succeed$4(done);
4614
+ if (done === void 0) return fail$5(cause);
4615
+ return hasFailure ? fail$5(fromReasons(cause.reasons.filter((reason) => !isDoneFailure(reason)))) : succeed$5(done);
4563
4616
  };
4564
4617
  const filterDoneLeftover = (cause) => {
4565
4618
  const done = filterDone(cause);
4566
- return isFailure$1(done) ? done : succeed$4(done.success.value);
4619
+ return isFailure$1(done) ? done : succeed$5(done.success.value);
4567
4620
  };
4568
4621
  const doneExitFromCause = (cause) => {
4569
4622
  const halt = filterDone(cause);
4570
- return !isFailure$1(halt) ? succeed$2(halt.success.value) : failCause$2(halt.failure);
4623
+ return !isFailure$1(halt) ? succeed$3(halt.success.value) : failCause$2(halt.failure);
4571
4624
  };
4572
4625
  const matchEffect$1 = dual(2, (self, options) => matchCauseEffect$1(self, {
4573
4626
  onSuccess: options.onSuccess,
@@ -4576,8 +4629,7 @@ const matchEffect$1 = dual(2, (self, options) => matchCauseEffect$1(self, {
4576
4629
  return !isFailure$1(halt) ? options.onDone(halt.success.value) : options.onFailure(halt.failure);
4577
4630
  }
4578
4631
  }));
4579
- //#endregion
4580
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Schedule.js
4632
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Schedule.js
4581
4633
  const TypeId$2 = "~effect/Schedule";
4582
4634
  const randomNext = Random.useSync((random) => random.nextDoubleUnsafe());
4583
4635
  const CurrentMetadata = Reference("effect/Schedule/CurrentMetadata", { defaultValue: constant({
@@ -4629,8 +4681,8 @@ const fromStepWithMetadata = (step) => fromStep(map$2(step, (f) => {
4629
4681
  const meta = metadataFn();
4630
4682
  return (now, input) => f(meta(now, input));
4631
4683
  }));
4632
- const toStep = (schedule) => catchCause$1(schedule.step, (cause) => succeed$3(() => failCause$3(cause)));
4633
- const toStepWithMetadata = (schedule) => clockWith$1((clock) => map$2(toStep(schedule), (step) => {
4684
+ const toStep = (schedule) => catchCause$1(schedule.step, (cause) => succeed$4(() => failCause$3(cause)));
4685
+ const toStepWithMetadata = (schedule) => clockWith((clock) => map$2(toStep(schedule), (step) => {
4634
4686
  const metaFn = metadataFn();
4635
4687
  return (input) => suspend$1(() => {
4636
4688
  const now = clock.currentTimeMillisUnsafe();
@@ -4643,13 +4695,13 @@ const toStepWithMetadata = (schedule) => clockWith$1((clock) => map$2(toStep(sch
4643
4695
  });
4644
4696
  }));
4645
4697
  const min = (schedules) => fromStep(map$2(all$1(schedules.map(toStep)), (steps) => (now, input) => flatMap$2(forEach$2(steps, (step) => matchEffect$1(step(now, input), {
4646
- onSuccess: (result) => succeed$3(result[1]),
4698
+ onSuccess: (result) => succeed$4(result[1]),
4647
4699
  onDone: () => undefined_$1,
4648
4700
  onFailure: failCause$3
4649
4701
  })), (results) => {
4650
4702
  const duration = minDuration(results);
4651
4703
  if (duration === void 0) return done(zero);
4652
- return succeed$3([duration, duration]);
4704
+ return succeed$4([duration, duration]);
4653
4705
  })));
4654
4706
  const minDuration = (results) => {
4655
4707
  let min = void 0;
@@ -4661,9 +4713,9 @@ const minDuration = (results) => {
4661
4713
  };
4662
4714
  const exponential = (base, factor = 2) => {
4663
4715
  const baseMillis = toMillis(fromInputUnsafe(base));
4664
- return fromStepWithMetadata(succeed$3((meta) => {
4716
+ return fromStepWithMetadata(succeed$4((meta) => {
4665
4717
  const duration = millis(baseMillis * Math.pow(factor, meta.attempt - 1));
4666
- return succeed$3([duration, duration]);
4718
+ return succeed$4([duration, duration]);
4667
4719
  }));
4668
4720
  };
4669
4721
  const modifyDelay = dual(2, (self, f) => fromStep(map$2(toStep(self), (step) => {
@@ -4679,13 +4731,13 @@ const jittered = (self) => modifyDelay(self, ({ duration }) => map$2(randomNext,
4679
4731
  return millis(millis$1 * .8 * (1 - random) + millis$1 * 1.2 * random);
4680
4732
  }));
4681
4733
  const passthrough = (self) => fromStep(map$2(toStep(self), (step) => (now, input) => matchEffect$1(step(now, input), {
4682
- onSuccess: (result) => succeed$3([input, result[1]]),
4734
+ onSuccess: (result) => succeed$4([input, result[1]]),
4683
4735
  onFailure: failCause$3,
4684
4736
  onDone: () => done(input)
4685
4737
  })));
4686
4738
  const spaced = (duration) => {
4687
4739
  const decoded = fromInputUnsafe(duration);
4688
- return fromStepWithMetadata(succeed$3((meta) => succeed$3([meta.attempt - 1, decoded])));
4740
+ return fromStepWithMetadata(succeed$4((meta) => succeed$4([meta.attempt - 1, decoded])));
4689
4741
  };
4690
4742
  const while_ = dual(2, (self, predicate) => fromStep(map$2(toStep(self), (step) => {
4691
4743
  const meta = metadataFn();
@@ -4696,27 +4748,30 @@ const while_ = dual(2, (self, predicate) => fromStep(map$2(toStep(self), (step)
4696
4748
  output,
4697
4749
  duration
4698
4750
  });
4699
- return flatMap$2(isEffect$1(eff) ? eff : succeed$3(eff), (check) => check ? succeed$3(result) : done(output));
4751
+ return flatMap$2(isEffect$1(eff) ? eff : succeed$4(eff), (check) => check ? succeed$4(result) : done(output));
4700
4752
  });
4701
4753
  })));
4702
4754
  const forever$1 = spaced(zero);
4703
- //#endregion
4704
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/layer.js
4755
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/layer.js
4705
4756
  const provideLayer = (self, layer, options) => scopedWith$1((scope) => flatMap$2(options?.local ? buildWithMemoMap(layer, makeMemoMapUnsafe(), scope) : buildWithScope(layer, scope), (context) => provideContext$1(self, context)));
4706
4757
  const provide$1 = dual((args) => isEffect$1(args[0]), (self, source, options) => isContext(source) ? provideContext$1(self, source) : provideLayer(self, Array.isArray(source) ? mergeAll(...source) : source, options));
4707
- //#endregion
4708
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/schedule.js
4709
- const findErrorOnly = (cause) => cause.reasons.every(isFailReason$1) ? findError$1(cause) : fail$4(cause);
4758
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/schedule.js
4710
4759
  const repeatOrElse = dual(3, (self, schedule, orElse) => flatMap$2(toStepWithMetadata(schedule), (step) => {
4711
4760
  let meta = CurrentMetadata.defaultValue();
4712
- return catchCauseFilter(catchDone(forever$2(tap$1(flatMap$2(suspend$1(() => provideService$1(self, CurrentMetadata, meta)), step), (meta_) => sync$1(() => {
4713
- meta = meta_;
4714
- })), { disableYield: true }), (out) => succeed$3(out)), findErrorOnly, (error) => orElse(error, meta.attempt === 0 ? none() : some(meta)));
4761
+ const loop = (input) => matchEffect$1(step(input), {
4762
+ onSuccess(meta_) {
4763
+ meta = meta_;
4764
+ return flatMap$2(provideService$1(self, CurrentMetadata, meta), loop);
4765
+ },
4766
+ onFailure: failCause$3,
4767
+ onDone: succeed$4
4768
+ });
4769
+ return catchCauseFilter(flatMap$2(provideService$1(self, CurrentMetadata, meta), loop), findRecoverableError, (error) => orElse(error, meta.attempt === 0 ? none() : some(meta)));
4715
4770
  }));
4716
4771
  const retryOrElse = dual(3, (self, policy, orElse) => flatMap$2(toStepWithMetadata(policy), (step) => {
4717
4772
  let meta = CurrentMetadata.defaultValue();
4718
4773
  let lastError;
4719
- const loop = catchCauseFilter(suspend$1(() => provideService$1(self, CurrentMetadata, meta)), findErrorOnly, (error) => {
4774
+ const loop = catchCauseFilter(suspend$1(() => provideService$1(self, CurrentMetadata, meta)), findRecoverableError, (error) => {
4720
4775
  lastError = error;
4721
4776
  return flatMap$2(step(error), (meta_) => {
4722
4777
  meta = meta_;
@@ -4727,28 +4782,27 @@ const retryOrElse = dual(3, (self, policy, orElse) => flatMap$2(toStepWithMetada
4727
4782
  }));
4728
4783
  const repeat$1 = dual(2, (self, options) => {
4729
4784
  const schedule = typeof options === "function" ? options(identity) : isSchedule(options) ? options : buildFromOptions(options);
4730
- return repeatOrElse(self, schedule, fail$3);
4785
+ return repeatOrElse(self, schedule, fail$4);
4731
4786
  });
4732
4787
  const retry$1 = dual(2, (self, options) => {
4733
4788
  const schedule = typeof options === "function" ? options(identity) : isSchedule(options) ? options : buildFromOptions(options);
4734
- return retryOrElse(self, schedule, fail$3);
4789
+ return retryOrElse(self, schedule, fail$4);
4735
4790
  });
4736
4791
  const passthroughForever = passthrough(forever$1);
4737
4792
  const buildFromOptions = (options) => {
4738
4793
  let schedule = options.schedule ? passthrough(options.schedule) : passthroughForever;
4739
4794
  if (options.while) schedule = while_(schedule, ({ input }) => {
4740
4795
  const applied = options.while(input);
4741
- return isEffect$1(applied) ? applied : succeed$3(applied);
4796
+ return isEffect$1(applied) ? applied : succeed$4(applied);
4742
4797
  });
4743
4798
  if (options.until) schedule = while_(schedule, ({ input }) => {
4744
4799
  const applied = options.until(input);
4745
- return isEffect$1(applied) ? map$2(applied, (b) => !b) : succeed$3(!applied);
4800
+ return isEffect$1(applied) ? map$2(applied, (b) => !b) : succeed$4(!applied);
4746
4801
  });
4747
- if (options.times !== void 0) schedule = while_(schedule, ({ attempt }) => succeed$3(attempt <= options.times));
4802
+ if (options.times !== void 0) schedule = while_(schedule, ({ attempt }) => succeed$4(attempt <= options.times));
4748
4803
  return schedule;
4749
4804
  };
4750
- //#endregion
4751
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/MutableHashMap.js
4805
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/MutableHashMap.js
4752
4806
  const TypeId$1 = "~effect/MutableHashMap";
4753
4807
  const MutableHashMapProto = {
4754
4808
  [TypeId$1]: TypeId$1,
@@ -4847,8 +4901,7 @@ const isEmpty = (self) => self.backing.size === 0;
4847
4901
  const forEach$1 = dual(2, (self, f) => {
4848
4902
  self.backing.forEach(f);
4849
4903
  });
4850
- //#endregion
4851
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Request.js
4904
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Request.js
4852
4905
  const TypeId = "~effect/Request";
4853
4906
  const requestVariance = byReferenceUnsafe({
4854
4907
  _E: (_) => _,
@@ -4872,8 +4925,7 @@ const TaggedClass = (tag) => {
4872
4925
  };
4873
4926
  };
4874
4927
  const makeEntry = (options) => options;
4875
- //#endregion
4876
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/request.js
4928
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/request.js
4877
4929
  const request$1 = dual(2, (self, resolver) => {
4878
4930
  const withResolver = (resolver) => callback$1((resume) => {
4879
4931
  const entry = addEntry(resolver, self, resume, getCurrentFiber());
@@ -4892,8 +4944,27 @@ const makeBatchMap = (resolver) => {
4892
4944
  delete: (key) => remove(map, key)
4893
4945
  };
4894
4946
  };
4895
- const batchPool = [];
4896
4947
  const pendingBatches = new WeakMap();
4948
+ const makeBatch = (key, context, resolver, map) => {
4949
+ const batch = {
4950
+ key,
4951
+ context,
4952
+ resolver,
4953
+ map,
4954
+ entrySet: new Set(),
4955
+ entries: new Set(),
4956
+ delayEffect: flatMap$2(withFiber$1((delayFiber) => {
4957
+ batch.fiber = delayFiber;
4958
+ return batch.resolver.delay;
4959
+ }), (_) => runBatch(batch)),
4960
+ run: onExit$1(suspend$1(() => batch.resolver.runAll(Array.from(batch.entries), batch.key)), (exit) => {
4961
+ for (const entry of batch.entrySet) entry.completeUnsafe(exit._tag === "Success" ? exitDie(new Error("Effect.request: RequestResolver did not complete request", { cause: entry.request })) : exit);
4962
+ batch.entries.clear();
4963
+ return void_$2;
4964
+ })
4965
+ };
4966
+ return batch;
4967
+ };
4897
4968
  const addEntry = (resolver, request, resume, fiber) => {
4898
4969
  let batchMap = pendingBatches.get(resolver);
4899
4970
  if (!batchMap) {
@@ -4916,44 +4987,21 @@ const addEntry = (resolver, request, resume, fiber) => {
4916
4987
  if (resolver.preCheck !== void 0 && !resolver.preCheck(entry)) return entry;
4917
4988
  const key = resolver.batchKey(entry);
4918
4989
  batch = batchMap.get(key);
4990
+ const isNewBatch = batch === void 0;
4919
4991
  if (!batch) {
4920
- if (batchPool.length > 0) {
4921
- batch = batchPool.pop();
4922
- batch.key = key;
4923
- batch.resolver = resolver;
4924
- batch.map = batchMap;
4925
- } else {
4926
- const newBatch = {
4927
- key,
4928
- resolver,
4929
- map: batchMap,
4930
- entrySet: new Set(),
4931
- entries: new Set(),
4932
- delayEffect: flatMap$2(suspend$1(() => newBatch.resolver.delay), (_) => runBatch(newBatch)),
4933
- run: onExit$1(suspend$1(() => newBatch.resolver.runAll(Array.from(newBatch.entries), newBatch.key)), (exit) => {
4934
- for (const entry of newBatch.entrySet) entry.completeUnsafe(exit._tag === "Success" ? exitDie(new Error("Effect.request: RequestResolver did not complete request", { cause: entry.request })) : exit);
4935
- newBatch.entries.clear();
4936
- if (batchPool.length < 128) {
4937
- newBatch.entrySet.clear();
4938
- newBatch.key = void 0;
4939
- newBatch.fiber = void 0;
4940
- newBatch.resolver = void 0;
4941
- newBatch.map = void 0;
4942
- batchPool.push(newBatch);
4943
- }
4944
- return void_$2;
4945
- })
4946
- };
4947
- batch = newBatch;
4948
- }
4992
+ batch = makeBatch(key, fiber.context, resolver, batchMap);
4949
4993
  batchMap.set(key, batch);
4950
- batch.fiber = runForkWith$1(fiber.context)(batch.delayEffect, { scheduler: fiber.cache.scheduler });
4951
4994
  }
4952
4995
  batch.entrySet.add(entry);
4953
4996
  batch.entries.add(entry);
4997
+ if (isNewBatch) {
4998
+ const delayFiber = runForkWith$1(fiber.context)(batch.delayEffect, { scheduler: fiber.cache.scheduler });
4999
+ if (completed || batchMap.get(key) !== batch) return entry;
5000
+ batch.fiber = delayFiber;
5001
+ }
4954
5002
  if (batch.resolver.collectWhile(batch.entries)) return entry;
4955
5003
  batch.fiber.interruptUnsafe(fiber.id);
4956
- batch.fiber = runForkWith$1(fiber.context)(runBatch(batch), { scheduler: fiber.cache.scheduler });
5004
+ runForkWith$1(batch.context)(runBatch(batch), { scheduler: get$1(batch.context, Scheduler) });
4957
5005
  return entry;
4958
5006
  };
4959
5007
  const removeEntryUnsafe = (resolver, entry) => {
@@ -4979,15 +5027,14 @@ function runBatch(batch) {
4979
5027
  batch.map.delete(batch.key);
4980
5028
  return batch.run;
4981
5029
  }
4982
- //#endregion
4983
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Effect.js
5030
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Effect.js
4984
5031
  const isEffect = isEffect$1;
4985
5032
  const all = all$1;
4986
5033
  const forEach = forEach$2;
4987
5034
  const whileLoop = whileLoop$1;
4988
5035
  const promise = promise$1;
4989
5036
  const tryPromise = tryPromise$1;
4990
- const succeed = succeed$3;
5037
+ const succeed = succeed$4;
4991
5038
  const succeedNone = succeedNone$1;
4992
5039
  const succeedSome = succeedSome$1;
4993
5040
  const suspend = suspend$1;
@@ -4997,7 +5044,8 @@ const undefined_ = undefined_$1;
4997
5044
  const callback = callback$1;
4998
5045
  const never = never$1;
4999
5046
  const gen = gen$1;
5000
- const fail = fail$3;
5047
+ const fail = fail$4;
5048
+ const failSync = failSync$1;
5001
5049
  const failCause = failCause$3;
5002
5050
  const failCauseSync = failCauseSync$1;
5003
5051
  const die = die$3;
@@ -5030,9 +5078,11 @@ const catchNoSuchElement = catchNoSuchElement$1;
5030
5078
  const catchCauseIf = catchCauseIf$1;
5031
5079
  const mapError = mapError$1;
5032
5080
  const orDie = orDie$2;
5081
+ const tapError = tapError$1;
5033
5082
  const tapCause = tapCause$1;
5034
5083
  const retry = retry$1;
5035
5084
  const ignore = ignore$1;
5085
+ const ignoreCause = ignoreCause$1;
5036
5086
  const orElseSucceed = orElseSucceed$1;
5037
5087
  const timeout = timeout$1;
5038
5088
  const timeoutOption = timeoutOption$1;
@@ -5083,6 +5133,7 @@ const request = request$1;
5083
5133
  const forkChild = forkChild$1;
5084
5134
  const forkIn = forkIn$1;
5085
5135
  const forkScoped = forkScoped$1;
5136
+ const forkDetach = forkDetach$1;
5086
5137
  const runFork = runFork$1;
5087
5138
  const runForkWith = runForkWith$1;
5088
5139
  const runPromiseWith = runPromiseWith$1;
@@ -5090,7 +5141,6 @@ const runSync = runSync$1;
5090
5141
  const runSyncExit = runSyncExit$1;
5091
5142
  const fnUntraced = fnUntraced$1;
5092
5143
  const fn = fn$1;
5093
- const clockWith = clockWith$1;
5094
5144
  const logFatal = logWithLevel("Fatal");
5095
5145
  const logWarning = logWithLevel("Warn");
5096
5146
  const logError = logWithLevel("Error");
@@ -5109,14 +5159,19 @@ const withLogSpan = dual(2, (effect, label) => flatMap$2(currentTimeMillis, (now
5109
5159
  return [[label, now], ...spans];
5110
5160
  })));
5111
5161
  const effectify = (fn, onError, onSyncError) => (...args) => callback((resume) => {
5162
+ let synchronous = true;
5163
+ let pending;
5112
5164
  try {
5113
5165
  fn(...args, (err, result) => {
5114
- if (err) resume(onError ? suspend(() => fail(onError(err, args))) : fail(err));
5115
- else resume(succeed(result));
5166
+ const effect = err ? onError ? suspend(() => fail(onError(err, args))) : fail(err) : succeed(result);
5167
+ if (synchronous) pending ??= effect;
5168
+ else resume(effect);
5116
5169
  });
5117
5170
  } catch (err) {
5118
- resume(onSyncError ? fail(onSyncError(err, args)) : die(err));
5171
+ pending = onSyncError ? fail(onSyncError(err, args)) : die(err);
5119
5172
  }
5173
+ synchronous = false;
5174
+ if (pending) resume(pending);
5120
5175
  });
5121
5176
  const mapEager = mapEager$1;
5122
5177
  const mapErrorEager = mapErrorEager$1;
@@ -5124,7 +5179,6 @@ const mapBothEager = mapBothEager$1;
5124
5179
  const flatMapEager = flatMapEager$1;
5125
5180
  const catchEager = catchEager$1;
5126
5181
  const fnUntracedEager = fnUntracedEager$1;
5127
- //#endregion
5128
- export { interruptible as $, hours as $a, suspend$1 as $i, annotate as $n, isGreaterThan as $o, doneUnsafe as $r, isError as $s, timeoutOrElse as $t, effectify as A, match$2 as Aa, Prototype$1 as Ac, exitZipRight as Ai, fromStep as An, flatten$3 as Ao, merge as Ar, formatDate as As, request as At, fn as B, flatMap$4 as Ba, getCurrentFiber as Bi, matchEffect$1 as Bn, isSome as Bo, addFinalizer$1 as Br, symbol as Bs, scopedWith as Bt, catchTags as C, isCanonicalArrayIndex as Ca, dual as Cc, contextWith$1 as Ci, isEmpty as Cn, makeUnsafe$2 as Co, build as Cr, getStackTraceLimit as Cs, orElseSucceed as Ct, contextWith as D, lastNonEmpty as Da, memoizeIdempotent as Dc, exitHasInterrupts as Di, size as Dn, filter as Do, effectDiscard as Dr, NodeInspectSymbol as Ds, provideService as Dt, context as E, last as Ea, memoize as Ec, endSpan as Ei, set as En, exists as Eo, effectContext as Er, Class$1 as Es, provideContext as Et, failCauseSync as F, empty$3 as Fa, fiberInterruptAs as Fi, toStep as Fn, getOrNull as Fo, provideMerge as Fr, redact as Fs, runPromiseWith as Ft, forkChild as G, map$4 as Ga, makeSpanUnsafe as Gi, remainder as Gn, orElse as Go, make$1 as Gr, optimize as Gs, succeedNone as Gt, fnUntracedEager as H, getOrUndefined as Ha, iterateEager as Hi, nextBetween as Hn, map$5 as Ho, close as Hr, combine$1 as Hs, serviceOption as Ht, filterOrFail as I, headUnsafe as Ia, fiberJoin as Ii, catchDone as In, getOrThrow$1 as Io, succeed$1 as Ir, symbolRedactable as Is, runSync as It, fromOption as J, try_$2 as Ja, onExitPrimitive$1 as Ji, IllegalArgumentError as Jn, toArray as Jo, CurrentLogAnnotations as Jr, structureKeys as Js, sync as Jt, forkIn as K, match$3 as Ka, map$2 as Ki, round as Kn, orElseSome as Ko, makeUnsafe as Kr, string as Ks, succeedSome as Kt, flatMap as L, size$1 as La, fiberRunIn as Li, doneExitFromCause as Ln, getOrUndefined$2 as Lo, succeedContext as Lr, asEquivalence as Ls, runSyncExit as Lt, exit as M, reduce as Ma, fiberInterrupt as Mi, jittered as Mn, fromNullishOr$1 as Mo, mock as Mr, formatPath as Ms, retry as Mt, fail as N, sort as Na, fiberInterruptAll as Ni, min as Nn, fromUndefinedOr as No, orDie$1 as Nr, formatPropertyKey as Ns, runFork as Nt, delay as O, makeEquivalence as Oa, pipe as Oc, exitInterrupt as Oi, exponential as On, flatMap$5 as Oo, empty$1 as Or, toJson as Os, raceFirst as Ot, failCause as P, span as Pa, fiberInterruptAllAs as Pi, spaced as Pn, getOrElse$1 as Po, provide$2 as Pr, currentFiberTypeId as Ps, runForkWith as Pt, interrupt as Q, fromInputUnsafe as Qa, succeedNone$1 as Qi, UnknownError as Qn, String$1 as Qo, done$1 as Qr, isBoolean as Qs, timeoutOption as Qt, flatMapEager as R, fail$4 as Ra, flatMap$2 as Ri, filterDone as Rn, isNone as Ro, unwrap as Rr, byReferenceUnsafe as Rs, scope as Rt, catchTag as S, isArrayNonEmpty as Sa, constant as Sc, callback$1 as Si, get as Sn, make$5 as So, squash as Sr, assignProperty as Ss, orDie as St, clockWith as T, join as Ta, identity as Tc, effectIsExit as Ti, remove as Tn, all$2 as To, effect as Tr, BaseProto as Ts, provide as Tt, forEach as U, isFailure$1 as Ua, makeLatch as Ui, nextPow2 as Un, match$5 as Uo, fork as Ur, hash as Us, sleep as Ut, fnUntraced as V, getOrThrow as Va, iterateConcurrent as Vi, Random as Vn, liftThrowable as Vo, addFinalizerExit as Vr, array as Vs, service as Vt, forever as W, isSuccess$1 as Wa, makeLatchUnsafe as Wi, parse as Wn, none as Wo, forkUnsafe as Wr, number as Ws, succeed as Wt, gen as X, normalizeNonEmpty as Xa, resolveConcurrency as Xi, StackTrace as Xn, Date$1 as Xo, TracerTimingEnabled as Xr, hasProperty as Xs, tapCause as Xt, fromResult as Y, normalize as Ya, onExitUnsafe as Yi, NoSuchElementError as Yn, BigInt$1 as Yo, MinimumLogLevel as Yr, symbol$1 as Ys, tap as Yt, ignore as Z, format as Za, succeed$3 as Zi, TimeoutError as Zn, Number$2 as Zo, _await as Zr, isBigInt as Zs, timeout as Zt, catchEager as _, findLast as _a, or as _c, ClockRef as _i, equalBatchKeys as _n, get$1 as _o, makeFailReason as _r, exitSucceed as _s, onError as _t, andThen as a, ParentSpan as aa, isNotUndefined as ac, makeUnsafe$1 as ai, updateContext as an, millis as ao, findError as ar, make$7 as as, logWarning as at, catchNoSuchElement as b, headNonEmpty as ba, constUndefined as bc, andThen$1 as bi, empty as bn, getOrUndefinedUnsafe as bo, pretty as br, withFiber$1 as bs, onInterrupt as bt, as as c, has$1 as ca, isNumber as cc, fail$2 as ci, void_ as cn, negativeInfinity as co, hasInterrupts as cr, Done$1 as cs, mapBothEager as ct, cached as d, append as da, isPropertyKey as dc, interrupt$1 as di, withFiber as dn, toSeconds as do, isCause as dr, TaggedError as ds, mapErrorEager as dt, sync$1 as ea, isFunction as ec, interruptWith as ei, tryPromise as en, infinity as eo, combine as er, isGreaterThanOrEqualTo as es, isEffect as et, cachedWithTTL as f, appendAll as fa, isString as fc, isExit as fi, withLogSpan as fn, zero as fo, isDieReason as fr, args as fs, match as ft, catchDefect as g, findFirstIndex as ga, isUnknown as gc, void_$1 as gi, zipWith as gn, empty$4 as go, makeDieReason as gr, exitFailCause as gs, never as gt, catchCauseIf as h, findFirst as ha, isUndefined as hc, succeed$2 as hi, yieldNow as hn, add as ho, isTimeoutError as hr, exitFail as hs, matchEffect as ht, all as i, DisablePropagation as ia, isNotNullish as ic, make$2 as ii, uninterruptibleMask as in, max as io, filterInterruptors as ir, Tuple as is, logInfo as it, ensuring as j, of as ja, pipeArguments as jc, fiberAwait as ji, isSchedule as jn, fromNullOr as jo, mergeAll as jr, formatJson as js, result as jt, die as k, map$3 as ka, Class$2 as kc, exitVoid as ki, forever$1 as kn, flatMapNullishOr$1 as ko, fresh as kr, format$1 as ks, repeat as kt, asSome as l, toPredicate as la, isObject as lc, failCause$2 as li, when as ln, seconds as lo, hasInterruptsOnly as lr, Error$1 as ls, mapEager as lt, catchCause as m, empty$2 as ma, isTagged as mc, isSuccess as mi, withSpan as mn, Service as mo, isReason as mr, evaluate as ms, matchCauseEffect as mt, acquireUseRelease as n, updateContext$1 as na, isNever as nc, isDone$1 as ni, undefined_ as nn, isFinite as no, done as nr, isLessThanOrEqualTo as ns, logError as nt, annotateCurrentSpan as o, encode as oa, isNull as oc, asVoidAll as oi, updateService as on, minutes as oo, findErrorOption as or, strictEqual as os, makeSpanScoped as ot, callback as p, dedupe as pa, isSymbol as pc, isFailure as pi, withParentSpan as pn, Reference as po, isFailReason as pr, causeFail as ps, matchCauseEager as pt, forkScoped as q, succeed$4 as qa, monotonicTimeNanos as qi, Done as qn, some as qo, provide$3 as qr, structure as qs, suspend as qt, addFinalizer as r, void_$2 as ra, isNotNull as rc, isDoneUnsafe as ri, uninterruptible as rn, isZero as ro, fail$1 as rr, make$6 as rs, logFatal as rt, annotateLogs as s, compose as sa, isNullish as sc, die$2 as si, useSpan as sn, nanos as so, fromReasons as sr, Prototype as ss, map as st, acquireRelease as t, uninterruptibleMask$1 as ta, isIterable as tc, into as ti, try_ as tn, isDuration as to, die$1 as tr, isLessThan as ts, logDebug as tt, asVoid as u, Array$1 as ua, isObjectKeyword as uc, findErrorOption$1 as ui, whileLoop as un, toMillis as uo, interruptors as ur, PipeInspectableProto as us, mapError as ut, catchFilter as v, flatMapNullishOr as va, constFalse as vc, ConsoleRef as vi, Class as vn, getOption as vo, makeInterruptReason as vr, isExit$1 as vs, onExit as vt, catch_ as w, isReadonlyArrayNonEmpty as wa, flow as wc, currentTimeMillis as wi, make as wn, merge$1 as wo, buildWithScope as wr, setStackTraceLimit as ws, promise as wt, catchReason as x, isArray as xa, constVoid as xc, asSome$1 as xi, forEach$1 as xn, getUnsafe$1 as xo, reasonAnnotations as xr, assignProperties as xs, option as xt, catchIf as y, fromIterable$1 as ya, constTrue as yc, LogToStderr as yi, TaggedClass as yn, getOrUndefined$1 as yo, map$1 as yr, makePrimitive as ys, onExitPrimitive as yt, flatten as z, failVoid as za, forkUnsafe$1 as zi, isDoneCause as zn, isOption as zo, Scope as zr, equals$1 as zs, scoped as zt };
5182
+ export { ignoreCause as $, try_$2 as $a, resolveConcurrency as $i, TimeoutError as $n, some as $o, _await as $r, random$1 as $s, tapError as $t, ensuring as A, isReadonlyArrayNonEmpty as Aa, constant as Ac, exitHasInterrupts as Ai, size as An, omit as Ao, empty$1 as Ar, getStackTraceLimit as As, raceFirst as At, fn as B, span as Ba, findRecoverableError as Bi, doneExitFromCause as Bn, getOrElse$1 as Bo, unwrap as Br, formatPropertyKey as Bs, scope as Bt, catchTags as C, findLast as Ca, isUndefined as Cc, andThen$1 as Ci, empty as Cn, getOption as Co, reasonAnnotations as Cr, exitFailCause as Cs, option as Ct, delay as D, isArray as Da, constTrue as Dc, currentTimeMillis as Di, make as Dn, make$5 as Do, effect as Dr, withFiber$1 as Ds, provide as Dt, contextWith as E, headNonEmpty as Ea, constFalse as Ec, contextWith$1 as Ei, isEmpty as En, getUnsafe$1 as Eo, buildWithScope as Er, makePrimitive as Es, promise as Et, failSync as F, map$3 as Fa, memoizeIdempotent as Fc, fiberInterrupt as Fi, jittered as Fn, flatMapNullishOr$1 as Fo, orDie$1 as Fr, toJson as Fs, runFork as Ft, forkChild as G, flatMap$4 as Ga, iterateEager as Gi, nextPow2 as Gn, isOption as Go, fork as Gr, byReferenceUnsafe as Gs, sleep as Gt, fnUntracedEager as H, headUnsafe as Ha, forkUnsafe$1 as Hi, isDoneCause as Hn, getOrThrow$1 as Ho, addFinalizer$1 as Hr, redact as Hs, scopedWith as Ht, filterOrFail as I, match$2 as Ia, pipe as Ic, fiberInterruptAll as Ii, min as In, flatten$3 as Io, provide$2 as Ir, format$1 as Is, runForkWith as It, forkScoped as J, isFailure$1 as Ja, makeSpanUnsafe as Ji, round as Jn, map$5 as Jo, makeUnsafe as Jr, array as Js, succeedSome as Jt, forkDetach as K, getOrThrow as Ka, makeLatch as Ki, parse as Kn, isSome as Ko, forkUnsafe as Kr, equals$1 as Ks, succeed as Kt, flatMap as L, of as La, Class$2 as Lc, fiberInterruptAllAs as Li, spaced as Ln, fromNullOr as Lo, provideMerge as Lr, formatDate as Ls, runPromiseWith as Lt, fail as M, last as Ma, flow as Mc, exitVoid as Mi, forever$1 as Mn, exists as Mo, merge as Mr, BaseProto as Ms, request as Mt, failCause as N, lastNonEmpty as Na, identity as Nc, exitZipRight as Ni, fromStep as Nn, filter as No, mergeAll as Nr, Class$1 as Ns, result as Nt, die as O, isArrayNonEmpty as Oa, constUndefined as Oc, effectIsExit as Oi, remove as On, makeUnsafe$2 as Oo, effectContext as Or, assignProperties as Os, provideContext as Ot, failCauseSync as P, makeEquivalence as Pa, memoize as Pc, fiberAwait as Pi, isSchedule as Pn, flatMap$5 as Po, mock as Pr, NodeInspectSymbol as Ps, retry as Pt, ignore as Q, succeed$5 as Qa, onExitUnsafe as Qi, StackTrace as Qn, orElseSome as Qo, TracerTimingEnabled as Qr, optimize as Qs, tapCause as Qt, flatMapEager as R, reduce as Ra, Prototype$1 as Rc, fiberJoin as Ri, toStep as Rn, fromNullishOr$1 as Ro, succeed$1 as Rr, formatJson as Rs, runSync as Rt, catchTag as S, findFirstIndex as Sa, isTagged as Sc, LogToStderr as Si, TaggedClass as Sn, get$1 as So, pretty as Sr, exitFail as Ss, onInterrupt as St, context as T, fromIterable$1 as Ta, or as Tc, callback$1 as Ti, get as Tn, getOrUndefinedUnsafe as To, build as Tr, isExit$1 as Ts, orElseSucceed as Tt, forEach as U, fail$5 as Ua, getCurrentFiber as Ui, matchEffect$1 as Un, getOrUndefined$2 as Uo, addFinalizerExit as Ur, symbolRedactable as Us, service as Ut, fnUntraced as V, empty$3 as Va, flatMap$2 as Vi, filterDone as Vn, getOrNull as Vo, Scope as Vr, currentFiberTypeId as Vs, scoped as Vt, forever as W, failVoid as Wa, iterateConcurrent as Wi, Random as Wn, isNone as Wo, close as Wr, asEquivalence as Ws, serviceOption as Wt, fromResult as X, map$4 as Xa, monotonicTimeNanos as Xi, IllegalArgumentError as Xn, none as Xo, CurrentLogAnnotations as Xr, hash as Xs, sync as Xt, fromOption as Y, isSuccess$1 as Ya, map$2 as Yi, Done as Yn, match$5 as Yo, provide$3 as Yr, combine$1 as Ys, suspend as Yt, gen as Z, match$3 as Za, onExitPrimitive$1 as Zi, NoSuchElementError as Zn, orElse as Zo, MinimumLogLevel as Zr, number as Zs, tap as Zt, catchEager as _, appendAll as _a, isObject as _c, isSuccess as _i, withSpan as _n, zero as _o, isTimeoutError as _r, PipeInspectableProto as _s, matchEffect as _t, andThen as a, sync$1 as aa, isBigInt as ac, isDoneUnsafe as ai, undefined_ as an, infinity as ao, fail$1 as ar, isGreaterThan as as, logFatal as at, catchNoSuchElement as b, ensure as ba, isString as bc, ClockRef as bi, equalBatchKeys as bn, add as bo, makeInterruptReason as br, causeFail as bs, onExit as bt, as as c, void_$2 as ca, isFunction as cc, succeed$2 as ci, updateContext as cn, isZero as co, fromReasons as cr, isLessThanOrEqualTo as cs, makeSpanScoped as ct, cached as d, encode as da, isNotNull as dc, fail$3 as di, void_ as dn, minutes as do, interruptors as dr, Tuple as ds, mapEager as dt, scope$1 as ea, string as ec, doneUnsafe as ei, timeout as en, normalize as eo, UnknownError as er, toArray as es, interrupt as et, cachedWithTTL as f, compose as fa, isNotNullish as fc, failCause$2 as fi, when as fn, nanos as fo, isCause as fr, make$7 as fs, mapError as ft, catchDefect as g, append as ga, isNumber as gc, isFailure as gi, withParentSpan as gn, toSeconds as go, isReason as gr, Error$1 as gs, matchCauseEffect as gt, catchCauseIf as h, Array$1 as ha, isNullish as hc, isExit as hi, withLogSpan as hn, toMillis as ho, isFailReason as hr, Done$1 as hs, matchCauseEager as ht, all as i, suspend$1 as ia, hasProperty as ic, isDone$1 as ii, try_ as in, hours as io, done as ir, String$1 as is, logError as it, exit as j, join as ja, dual as jc, exitInterrupt as ji, exponential as jn, all$2 as jo, fresh as jr, setStackTraceLimit as js, repeat as jt, effectify as k, isCanonicalArrayIndex as ka, constVoid as kc, endSpan as ki, set as kn, merge$1 as ko, effectDiscard as kr, assignProperty as ks, provideService as kt, asSome as l, DisablePropagation as la, isIterable as lc, asVoidAll as li, updateService as ln, max as lo, hasInterrupts as lr, make$6 as ls, map as lt, catchCause as m, toPredicate as ma, isNull as mc, interrupt$1 as mi, withFiber as mn, seconds as mo, isDone as mr, Prototype as ms, match as mt, acquireUseRelease as n, succeed$4 as na, structureKeys as nc, interruptWith as ni, timeoutOrElse as nn, format as no, combine as nr, Date$1 as ns, isEffect as nt, annotateCurrentSpan as o, uninterruptibleMask$1 as oa, isBoolean as oc, make$2 as oi, uninterruptible as on, isDuration as oo, filterInterruptors as or, isGreaterThanOrEqualTo as os, logInfo as ot, callback as p, has$1 as pa, isNotUndefined as pc, findErrorOption$1 as pi, whileLoop as pn, negativeInfinity as po, isDieReason as pr, strictEqual as ps, mapErrorEager as pt, forkIn as q, getOrUndefined as qa, makeLatchUnsafe as qi, remainder as qn, liftThrowable as qo, make$1 as qr, symbol as qs, succeedNone as qt, addFinalizer as r, succeedNone$1 as ra, symbol$1 as rc, into as ri, tryPromise as rn, fromInputUnsafe as ro, die$1 as rr, Number$2 as rs, logDebug as rt, annotateLogs as s, updateContext$1 as sa, isError as sc, makeUnsafe$1 as si, uninterruptibleMask as sn, isFinite as so, findErrorOption as sr, isLessThan as ss, logWarning as st, acquireRelease as t, scopeAddFinalizer as ta, structure as tc, fail$2 as ti, timeoutOption as tn, normalizeNonEmpty as to, annotate as tr, BigInt$1 as ts, interruptible as tt, asVoid as u, ParentSpan as ua, isNever as uc, die$2 as ui, useSpan as un, millis as uo, hasInterruptsOnly as ur, mapInput as us, mapBothEager as ut, catchFilter as v, dedupe as va, isObjectKeyword as vc, succeed$3 as vi, yieldNow as vn, Reference as vo, makeDieReason as vr, TaggedError as vs, never as vt, catch_ as w, flatMapNullishOr as wa, isUnknown as wc, asSome$1 as wi, forEach$1 as wn, getOrUndefined$1 as wo, squash as wr, exitSucceed as ws, orDie as wt, catchReason as x, findFirst as xa, isSymbol as xc, ConsoleRef as xi, Class as xn, empty$4 as xo, map$1 as xr, evaluate as xs, onExitPrimitive as xt, catchIf as y, empty$2 as ya, isPropertyKey as yc, void_$1 as yi, zipWith as yn, Service as yo, makeFailReason as yr, args as ys, onError as yt, flatten as z, sort as za, pipeArguments as zc, fiberRunIn as zi, catchDone as zn, fromUndefinedOr as zo, succeedContext as zr, formatPath as zs, runSyncExit as zt };
5129
5183
 
5130
- //# sourceMappingURL=Effect-On-1ks2z.mjs.map
5184
+ //# sourceMappingURL=Effect-DNYYQ84C.mjs.map