@firfi/huly-mcp 0.1.60 → 0.1.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -451,7 +451,7 @@ var require_errors = __commonJS({
451
451
  }
452
452
  };
453
453
  var kAbortError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_ABORT");
454
- var AbortError2 = class extends UndiciError {
454
+ var AbortError = class extends UndiciError {
455
455
  constructor(message) {
456
456
  super(message);
457
457
  this.name = "AbortError";
@@ -466,7 +466,7 @@ var require_errors = __commonJS({
466
466
  }
467
467
  };
468
468
  var kRequestAbortedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_ABORTED");
469
- var RequestAbortedError = class extends AbortError2 {
469
+ var RequestAbortedError = class extends AbortError {
470
470
  constructor(message) {
471
471
  super(message);
472
472
  this.name = "AbortError";
@@ -699,7 +699,7 @@ var require_errors = __commonJS({
699
699
  }
700
700
  };
701
701
  module2.exports = {
702
- AbortError: AbortError2,
702
+ AbortError,
703
703
  HTTPParserError,
704
704
  UndiciError,
705
705
  HeadersTimeoutError,
@@ -10288,7 +10288,7 @@ var require_readable = __commonJS({
10288
10288
  "use strict";
10289
10289
  var assert4 = require("node:assert");
10290
10290
  var { Readable: Readable2 } = require("node:stream");
10291
- var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError: AbortError2 } = require_errors();
10291
+ var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors();
10292
10292
  var util2 = require_util();
10293
10293
  var { ReadableStreamFrom } = require_util();
10294
10294
  var kConsume = /* @__PURE__ */ Symbol("kConsume");
@@ -10499,24 +10499,24 @@ var require_readable = __commonJS({
10499
10499
  }
10500
10500
  const limit = opts?.limit && Number.isFinite(opts.limit) ? opts.limit : 128 * 1024;
10501
10501
  if (signal?.aborted) {
10502
- return Promise.reject(signal.reason ?? new AbortError2());
10502
+ return Promise.reject(signal.reason ?? new AbortError());
10503
10503
  }
10504
10504
  if (this._readableState.closeEmitted) {
10505
10505
  return Promise.resolve(null);
10506
10506
  }
10507
10507
  return new Promise((resolve2, reject) => {
10508
10508
  if (this[kContentLength] && this[kContentLength] > limit || this[kBytesRead] > limit) {
10509
- this.destroy(new AbortError2());
10509
+ this.destroy(new AbortError());
10510
10510
  }
10511
10511
  if (signal) {
10512
10512
  const onAbort = () => {
10513
- this.destroy(signal.reason ?? new AbortError2());
10513
+ this.destroy(signal.reason ?? new AbortError());
10514
10514
  };
10515
10515
  signal.addEventListener("abort", onAbort);
10516
10516
  this.on("close", function() {
10517
10517
  signal.removeEventListener("abort", onAbort);
10518
10518
  if (signal.aborted) {
10519
- reject(signal.reason ?? new AbortError2());
10519
+ reject(signal.reason ?? new AbortError());
10520
10520
  } else {
10521
10521
  resolve2(null);
10522
10522
  }
@@ -15590,7 +15590,7 @@ var require_cache2 = __commonJS({
15590
15590
  var MemoryCacheStore = require_memory_cache_store();
15591
15591
  var CacheRevalidationHandler = require_cache_revalidation_handler();
15592
15592
  var { assertCacheStore, assertCacheMethods, makeCacheKey, normalizeHeaders, parseCacheControlHeader } = require_cache();
15593
- var { AbortError: AbortError2 } = require_errors();
15593
+ var { AbortError } = require_errors();
15594
15594
  function assertCacheOrigins(origins, name) {
15595
15595
  if (origins === void 0) return;
15596
15596
  if (!Array.isArray(origins)) {
@@ -15693,7 +15693,7 @@ var require_cache2 = __commonJS({
15693
15693
  return stream2.errored;
15694
15694
  },
15695
15695
  abort(reason) {
15696
- stream2.destroy(reason ?? new AbortError2());
15696
+ stream2.destroy(reason ?? new AbortError());
15697
15697
  }
15698
15698
  };
15699
15699
  stream2.on("error", function(err) {
@@ -28234,10 +28234,10 @@ var require_i18n = __commonJS({
28234
28234
  if (!translations.has(locale)) {
28235
28235
  translations.set(locale, localtTanslations);
28236
28236
  }
28237
- let messages2 = localtTanslations.get(plugin);
28238
- if (messages2 === void 0 || force) {
28239
- messages2 = await loadTranslationsForComponent(plugin, locale);
28240
- localtTanslations.set(plugin, messages2);
28237
+ let messages = localtTanslations.get(plugin);
28238
+ if (messages === void 0 || force) {
28239
+ messages = await loadTranslationsForComponent(plugin, locale);
28240
+ localtTanslations.set(plugin, messages);
28241
28241
  }
28242
28242
  }
28243
28243
  }
@@ -28268,16 +28268,16 @@ var require_i18n = __commonJS({
28268
28268
  if (localtTanslations === void 0) {
28269
28269
  return void 0;
28270
28270
  }
28271
- const messages2 = localtTanslations.get(id.component);
28272
- if (messages2 === void 0) {
28271
+ const messages = localtTanslations.get(id.component);
28272
+ if (messages === void 0) {
28273
28273
  return void 0;
28274
28274
  }
28275
- if (messages2 instanceof import_status.Status) {
28276
- return messages2;
28275
+ if (messages instanceof import_status.Status) {
28276
+ return messages;
28277
28277
  }
28278
28278
  if (id.kind !== void 0) {
28279
- if (messages2[id.kind]?.[id.name] !== void 0) {
28280
- return messages2[id.kind]?.[id.name];
28279
+ if (messages[id.kind]?.[id.name] !== void 0) {
28280
+ return messages[id.kind]?.[id.name];
28281
28281
  }
28282
28282
  }
28283
28283
  }
@@ -28288,17 +28288,17 @@ var require_i18n = __commonJS({
28288
28288
  if (!translations.has(locale)) {
28289
28289
  translations.set(locale, localtTanslations);
28290
28290
  }
28291
- let messages2 = localtTanslations.get(id.component);
28292
- if (messages2 === void 0) {
28293
- messages2 = await loadTranslationsForComponent(id.component, locale);
28294
- localtTanslations.set(id.component, messages2);
28291
+ let messages = localtTanslations.get(id.component);
28292
+ if (messages === void 0) {
28293
+ messages = await loadTranslationsForComponent(id.component, locale);
28294
+ localtTanslations.set(id.component, messages);
28295
28295
  }
28296
- if (messages2 instanceof import_status.Status) {
28297
- return messages2;
28296
+ if (messages instanceof import_status.Status) {
28297
+ return messages;
28298
28298
  }
28299
28299
  if (id.kind !== void 0) {
28300
- if (messages2[id.kind]?.[id.name] !== void 0) {
28301
- return messages2[id.kind]?.[id.name];
28300
+ if (messages[id.kind]?.[id.name] !== void 0) {
28301
+ return messages[id.kind]?.[id.name];
28302
28302
  } else {
28303
28303
  let eng = englishTranslationsForMissing.get(id.component);
28304
28304
  if (eng === void 0) {
@@ -28311,7 +28311,7 @@ var require_i18n = __commonJS({
28311
28311
  return eng[id.kind]?.[id.name];
28312
28312
  }
28313
28313
  } else {
28314
- return messages2[id.name];
28314
+ return messages[id.name];
28315
28315
  }
28316
28316
  } catch (err) {
28317
28317
  const status = (0, import_status.unknownError)(err);
@@ -36937,16 +36937,16 @@ var require_dist2 = __commonJS({
36937
36937
  return NodeRange2;
36938
36938
  })();
36939
36939
  var emptyAttrs = /* @__PURE__ */ Object.create(null);
36940
- var Node2 = (function() {
36941
- function Node3(type, attrs, content) {
36940
+ var Node = (function() {
36941
+ function Node2(type, attrs, content) {
36942
36942
  var marks = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : Mark.none;
36943
- _classCallCheck(this, Node3);
36943
+ _classCallCheck(this, Node2);
36944
36944
  this.type = type;
36945
36945
  this.attrs = attrs;
36946
36946
  this.marks = marks;
36947
36947
  this.content = content || Fragment.empty;
36948
36948
  }
36949
- _createClass(Node3, [{
36949
+ _createClass(Node2, [{
36950
36950
  key: "children",
36951
36951
  get: function get13() {
36952
36952
  return this.content.content;
@@ -37027,12 +37027,12 @@ var require_dist2 = __commonJS({
37027
37027
  value: function copy4() {
37028
37028
  var content = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
37029
37029
  if (content == this.content) return this;
37030
- return new Node3(this.type, this.attrs, content, this.marks);
37030
+ return new Node2(this.type, this.attrs, content, this.marks);
37031
37031
  }
37032
37032
  }, {
37033
37033
  key: "mark",
37034
37034
  value: function mark(marks) {
37035
- return marks == this.marks ? this : new Node3(this.type, this.attrs, this.content, marks);
37035
+ return marks == this.marks ? this : new Node2(this.type, this.attrs, this.content, marks);
37036
37036
  }
37037
37037
  }, {
37038
37038
  key: "cut",
@@ -37249,9 +37249,9 @@ var require_dist2 = __commonJS({
37249
37249
  return node;
37250
37250
  }
37251
37251
  }]);
37252
- return Node3;
37252
+ return Node2;
37253
37253
  })();
37254
- Node2.prototype.text = void 0;
37254
+ Node.prototype.text = void 0;
37255
37255
  var TextNode = (function(_Node) {
37256
37256
  _inherits(TextNode2, _Node);
37257
37257
  var _super2 = _createSuper(TextNode2);
@@ -37317,7 +37317,7 @@ var require_dist2 = __commonJS({
37317
37317
  }
37318
37318
  }]);
37319
37319
  return TextNode2;
37320
- })(Node2);
37320
+ })(Node);
37321
37321
  function wrapMarks(marks, str) {
37322
37322
  for (var i = marks.length - 1; i >= 0; i--) str = marks[i].type.name + "(" + str + ")";
37323
37323
  return str;
@@ -37656,13 +37656,13 @@ var require_dist2 = __commonJS({
37656
37656
  }
37657
37657
  }
37658
37658
  }
37659
- function cmp2(a, b) {
37659
+ function cmp(a, b) {
37660
37660
  return b - a;
37661
37661
  }
37662
37662
  function nullFrom(nfa2, node) {
37663
37663
  var result = [];
37664
37664
  scan(node);
37665
- return result.sort(cmp2);
37665
+ return result.sort(cmp);
37666
37666
  function scan(node2) {
37667
37667
  var edges = nfa2[node2];
37668
37668
  if (edges.length == 1 && !edges[0].term) return scan(edges[0].to);
@@ -37692,7 +37692,7 @@ var require_dist2 = __commonJS({
37692
37692
  });
37693
37693
  var state = labeled[states.join(",")] = new ContentMatch(states.indexOf(nfa2.length - 1) > -1);
37694
37694
  for (var i = 0; i < out.length; i++) {
37695
- var _states = out[i][1].sort(cmp2);
37695
+ var _states = out[i][1].sort(cmp);
37696
37696
  state.next.push({
37697
37697
  type: out[i][0],
37698
37698
  next: labeled[_states.join(",")] || explore(_states)
@@ -37816,7 +37816,7 @@ var require_dist2 = __commonJS({
37816
37816
  var content = arguments.length > 1 ? arguments[1] : void 0;
37817
37817
  var marks = arguments.length > 2 ? arguments[2] : void 0;
37818
37818
  if (this.isText) throw new Error("NodeType.create can't construct text nodes");
37819
- return new Node2(this, this.computeAttrs(attrs), Fragment.from(content), Mark.setFrom(marks));
37819
+ return new Node(this, this.computeAttrs(attrs), Fragment.from(content), Mark.setFrom(marks));
37820
37820
  }
37821
37821
  }, {
37822
37822
  key: "createChecked",
@@ -37826,7 +37826,7 @@ var require_dist2 = __commonJS({
37826
37826
  var marks = arguments.length > 2 ? arguments[2] : void 0;
37827
37827
  content = Fragment.from(content);
37828
37828
  this.checkContent(content);
37829
- return new Node2(this, this.computeAttrs(attrs), content, Mark.setFrom(marks));
37829
+ return new Node(this, this.computeAttrs(attrs), content, Mark.setFrom(marks));
37830
37830
  }
37831
37831
  }, {
37832
37832
  key: "createAndFill",
@@ -37844,7 +37844,7 @@ var require_dist2 = __commonJS({
37844
37844
  var matched = this.contentMatch.matchFragment(content);
37845
37845
  var after3 = matched && matched.fillBefore(Fragment.empty, true);
37846
37846
  if (!after3) return null;
37847
- return new Node2(this, attrs, content.append(after3), Mark.setFrom(marks));
37847
+ return new Node(this, attrs, content.append(after3), Mark.setFrom(marks));
37848
37848
  }
37849
37849
  }, {
37850
37850
  key: "validContent",
@@ -38011,7 +38011,7 @@ var require_dist2 = __commonJS({
38011
38011
  _type2.excluded = excl == null ? [_type2] : excl == "" ? [] : gatherMarks(this, excl.split(" "));
38012
38012
  }
38013
38013
  this.nodeFromJSON = function(json3) {
38014
- return Node2.fromJSON(_this2, json3);
38014
+ return Node.fromJSON(_this2, json3);
38015
38015
  };
38016
38016
  this.markFromJSON = function(json3) {
38017
38017
  return Mark.fromJSON(_this2, json3);
@@ -38922,7 +38922,7 @@ var require_dist2 = __commonJS({
38922
38922
  exports2.Fragment = Fragment;
38923
38923
  exports2.Mark = Mark;
38924
38924
  exports2.MarkType = MarkType;
38925
- exports2.Node = Node2;
38925
+ exports2.Node = Node;
38926
38926
  exports2.NodeRange = NodeRange;
38927
38927
  exports2.NodeType = NodeType;
38928
38928
  exports2.ReplaceError = ReplaceError;
@@ -49132,11 +49132,11 @@ var require_dist16 = __commonJS({
49132
49132
  });
49133
49133
  return plugin;
49134
49134
  }
49135
- function getType2(value3) {
49135
+ function getType(value3) {
49136
49136
  return Object.prototype.toString.call(value3).slice(8, -1);
49137
49137
  }
49138
49138
  function isPlainObject4(value3) {
49139
- if (getType2(value3) !== "Object") {
49139
+ if (getType(value3) !== "Object") {
49140
49140
  return false;
49141
49141
  }
49142
49142
  return value3.constructor === Object && Object.getPrototypeOf(value3) === Object.prototype;
@@ -52714,7 +52714,7 @@ img.ProseMirror-separator {
52714
52714
  }
52715
52715
  });
52716
52716
  }
52717
- var Node2 = class _Node {
52717
+ var Node = class _Node {
52718
52718
  constructor(config3 = {}) {
52719
52719
  this.type = "node";
52720
52720
  this.name = "node";
@@ -53076,7 +53076,7 @@ img.ProseMirror-separator {
53076
53076
  exports2.Extension = Extension;
53077
53077
  exports2.InputRule = InputRule;
53078
53078
  exports2.Mark = Mark;
53079
- exports2.Node = Node2;
53079
+ exports2.Node = Node;
53080
53080
  exports2.NodePos = NodePos;
53081
53081
  exports2.NodeView = NodeView;
53082
53082
  exports2.PasteRule = PasteRule;
@@ -67966,17 +67966,17 @@ var require_node = __commonJS({
67966
67966
  Object.defineProperty(exports2, "__esModule", { value: true });
67967
67967
  exports2.cloneNode = exports2.hasChildren = exports2.isDocument = exports2.isDirective = exports2.isComment = exports2.isText = exports2.isCDATA = exports2.isTag = exports2.Element = exports2.Document = exports2.CDATA = exports2.NodeWithChildren = exports2.ProcessingInstruction = exports2.Comment = exports2.Text = exports2.DataNode = exports2.Node = void 0;
67968
67968
  var domelementtype_1 = require_lib10();
67969
- var Node2 = (
67969
+ var Node = (
67970
67970
  /** @class */
67971
67971
  (function() {
67972
- function Node3() {
67972
+ function Node2() {
67973
67973
  this.parent = null;
67974
67974
  this.prev = null;
67975
67975
  this.next = null;
67976
67976
  this.startIndex = null;
67977
67977
  this.endIndex = null;
67978
67978
  }
67979
- Object.defineProperty(Node3.prototype, "parentNode", {
67979
+ Object.defineProperty(Node2.prototype, "parentNode", {
67980
67980
  // Read-write aliases for properties
67981
67981
  /**
67982
67982
  * Same as {@link parent}.
@@ -67991,7 +67991,7 @@ var require_node = __commonJS({
67991
67991
  enumerable: false,
67992
67992
  configurable: true
67993
67993
  });
67994
- Object.defineProperty(Node3.prototype, "previousSibling", {
67994
+ Object.defineProperty(Node2.prototype, "previousSibling", {
67995
67995
  /**
67996
67996
  * Same as {@link prev}.
67997
67997
  * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
@@ -68005,7 +68005,7 @@ var require_node = __commonJS({
68005
68005
  enumerable: false,
68006
68006
  configurable: true
68007
68007
  });
68008
- Object.defineProperty(Node3.prototype, "nextSibling", {
68008
+ Object.defineProperty(Node2.prototype, "nextSibling", {
68009
68009
  /**
68010
68010
  * Same as {@link next}.
68011
68011
  * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
@@ -68019,16 +68019,16 @@ var require_node = __commonJS({
68019
68019
  enumerable: false,
68020
68020
  configurable: true
68021
68021
  });
68022
- Node3.prototype.cloneNode = function(recursive) {
68022
+ Node2.prototype.cloneNode = function(recursive) {
68023
68023
  if (recursive === void 0) {
68024
68024
  recursive = false;
68025
68025
  }
68026
68026
  return cloneNode(this, recursive);
68027
68027
  };
68028
- return Node3;
68028
+ return Node2;
68029
68029
  })()
68030
68030
  );
68031
- exports2.Node = Node2;
68031
+ exports2.Node = Node;
68032
68032
  var DataNode = (
68033
68033
  /** @class */
68034
68034
  (function(_super) {
@@ -68053,7 +68053,7 @@ var require_node = __commonJS({
68053
68053
  configurable: true
68054
68054
  });
68055
68055
  return DataNode2;
68056
- })(Node2)
68056
+ })(Node)
68057
68057
  );
68058
68058
  exports2.DataNode = DataNode;
68059
68059
  var Text = (
@@ -68159,7 +68159,7 @@ var require_node = __commonJS({
68159
68159
  configurable: true
68160
68160
  });
68161
68161
  return NodeWithChildren2;
68162
- })(Node2)
68162
+ })(Node)
68163
68163
  );
68164
68164
  exports2.NodeWithChildren = NodeWithChildren;
68165
68165
  var CDATA = (
@@ -83650,7 +83650,7 @@ var require_error3 = __commonJS({
83650
83650
  var error_exports = {};
83651
83651
  __export2(error_exports, {
83652
83652
  NetworkError: () => NetworkError,
83653
- NotFoundError: () => NotFoundError2,
83653
+ NotFoundError: () => NotFoundError,
83654
83654
  StorageError: () => StorageError
83655
83655
  });
83656
83656
  module2.exports = __toCommonJS2(error_exports);
@@ -83672,7 +83672,7 @@ var require_error3 = __commonJS({
83672
83672
  this.name = "StorageError";
83673
83673
  }
83674
83674
  };
83675
- var NotFoundError2 = class extends StorageError {
83675
+ var NotFoundError = class extends StorageError {
83676
83676
  static {
83677
83677
  __name(this, "NotFoundError");
83678
83678
  }
@@ -84448,10 +84448,10 @@ var require_i18n2 = __commonJS({
84448
84448
  if (!translations.has(locale)) {
84449
84449
  translations.set(locale, localtTanslations);
84450
84450
  }
84451
- let messages2 = localtTanslations.get(plugin);
84452
- if (messages2 === void 0 || force) {
84453
- messages2 = await loadTranslationsForComponent(plugin, locale);
84454
- localtTanslations.set(plugin, messages2);
84451
+ let messages = localtTanslations.get(plugin);
84452
+ if (messages === void 0 || force) {
84453
+ messages = await loadTranslationsForComponent(plugin, locale);
84454
+ localtTanslations.set(plugin, messages);
84455
84455
  }
84456
84456
  }
84457
84457
  }
@@ -84482,16 +84482,16 @@ var require_i18n2 = __commonJS({
84482
84482
  if (localtTanslations === void 0) {
84483
84483
  return void 0;
84484
84484
  }
84485
- const messages2 = localtTanslations.get(id.component);
84486
- if (messages2 === void 0) {
84485
+ const messages = localtTanslations.get(id.component);
84486
+ if (messages === void 0) {
84487
84487
  return void 0;
84488
84488
  }
84489
- if (messages2 instanceof import_status.Status) {
84490
- return messages2;
84489
+ if (messages instanceof import_status.Status) {
84490
+ return messages;
84491
84491
  }
84492
84492
  if (id.kind !== void 0) {
84493
- if (messages2[id.kind]?.[id.name] !== void 0) {
84494
- return messages2[id.kind]?.[id.name];
84493
+ if (messages[id.kind]?.[id.name] !== void 0) {
84494
+ return messages[id.kind]?.[id.name];
84495
84495
  }
84496
84496
  }
84497
84497
  }
@@ -84502,17 +84502,17 @@ var require_i18n2 = __commonJS({
84502
84502
  if (!translations.has(locale)) {
84503
84503
  translations.set(locale, localtTanslations);
84504
84504
  }
84505
- let messages2 = localtTanslations.get(id.component);
84506
- if (messages2 === void 0) {
84507
- messages2 = await loadTranslationsForComponent(id.component, locale);
84508
- localtTanslations.set(id.component, messages2);
84505
+ let messages = localtTanslations.get(id.component);
84506
+ if (messages === void 0) {
84507
+ messages = await loadTranslationsForComponent(id.component, locale);
84508
+ localtTanslations.set(id.component, messages);
84509
84509
  }
84510
- if (messages2 instanceof import_status.Status) {
84511
- return messages2;
84510
+ if (messages instanceof import_status.Status) {
84511
+ return messages;
84512
84512
  }
84513
84513
  if (id.kind !== void 0) {
84514
- if (messages2[id.kind]?.[id.name] !== void 0) {
84515
- return messages2[id.kind]?.[id.name];
84514
+ if (messages[id.kind]?.[id.name] !== void 0) {
84515
+ return messages[id.kind]?.[id.name];
84516
84516
  } else {
84517
84517
  let eng = englishTranslationsForMissing.get(id.component);
84518
84518
  if (eng === void 0) {
@@ -84525,7 +84525,7 @@ var require_i18n2 = __commonJS({
84525
84525
  return eng[id.kind]?.[id.name];
84526
84526
  }
84527
84527
  } else {
84528
- return messages2[id.name];
84528
+ return messages[id.name];
84529
84529
  }
84530
84530
  } catch (err) {
84531
84531
  const status = (0, import_status.unknownError)(err);
@@ -88556,11 +88556,11 @@ var require_lexoInteger = __commonJS({
88556
88556
  negate3 = other.negate();
88557
88557
  return this.add(negate3);
88558
88558
  }
88559
- const cmp2 = _LexoInteger.compare(this.mag, other.mag);
88560
- if (cmp2 === 0) {
88559
+ const cmp = _LexoInteger.compare(this.mag, other.mag);
88560
+ if (cmp === 0) {
88561
88561
  return _LexoInteger.zero(this.sys);
88562
88562
  }
88563
- return cmp2 < 0 ? _LexoInteger.make(this.sys, this.sign === -1 ? 1 : -1, _LexoInteger.subtract(this.sys, other.mag, this.mag)) : _LexoInteger.make(this.sys, this.sign === -1 ? -1 : 1, _LexoInteger.subtract(this.sys, this.mag, other.mag));
88563
+ return cmp < 0 ? _LexoInteger.make(this.sys, this.sign === -1 ? 1 : -1, _LexoInteger.subtract(this.sys, other.mag, this.mag)) : _LexoInteger.make(this.sys, this.sign === -1 ? -1 : 1, _LexoInteger.subtract(this.sys, this.mag, other.mag));
88564
88564
  }
88565
88565
  multiply(other) {
88566
88566
  this.checkSystem(other);
@@ -88625,11 +88625,11 @@ var require_lexoInteger = __commonJS({
88625
88625
  }
88626
88626
  if (this.sign === -1) {
88627
88627
  if (other.sign === -1) {
88628
- const cmp2 = _LexoInteger.compare(this.mag, other.mag);
88629
- if (cmp2 === -1) {
88628
+ const cmp = _LexoInteger.compare(this.mag, other.mag);
88629
+ if (cmp === -1) {
88630
88630
  return 1;
88631
88631
  }
88632
- return cmp2 === 1 ? -1 : 0;
88632
+ return cmp === 1 ? -1 : 0;
88633
88633
  }
88634
88634
  return -1;
88635
88635
  }
@@ -89126,8 +89126,8 @@ var require_lexoRank = __commonJS({
89126
89126
  const nScale1 = scale2 - 1;
89127
89127
  const nLeft1 = left3.setScale(nScale1, true);
89128
89128
  nRight = right3.setScale(nScale1, false);
89129
- const cmp2 = nLeft1.compareTo(nRight);
89130
- if (cmp2 === 0) {
89129
+ const cmp = nLeft1.compareTo(nRight);
89130
+ if (cmp === 0) {
89131
89131
  return _LexoRank.checkMid(oLeft, oRight, nLeft1);
89132
89132
  }
89133
89133
  if (nLeft1.compareTo(nRight) > 0) {
@@ -89232,11 +89232,11 @@ var require_lexoRank = __commonJS({
89232
89232
  if (!this.bucket.equals(other.bucket)) {
89233
89233
  throw new Error("Between works only within the same bucket");
89234
89234
  }
89235
- const cmp2 = this.decimal.compareTo(other.decimal);
89236
- if (cmp2 > 0) {
89235
+ const cmp = this.decimal.compareTo(other.decimal);
89236
+ if (cmp > 0) {
89237
89237
  return new _LexoRank(this.bucket, _LexoRank.between(other.decimal, this.decimal));
89238
89238
  }
89239
- if (cmp2 === 0) {
89239
+ if (cmp === 0) {
89240
89240
  throw new Error("Try to rank between issues with same rank this=" + this + " other=" + other + " this.decimal=" + this.decimal + " other.decimal=" + other.decimal);
89241
89241
  }
89242
89242
  return new _LexoRank(this.bucket, _LexoRank.between(this.decimal, other.decimal));
@@ -111659,7 +111659,7 @@ var require_mediaType = __commonJS({
111659
111659
  var priorities = provided.map(function getPriority(type, index) {
111660
111660
  return getMediaTypePriority(type, accepts, index);
111661
111661
  });
111662
- return priorities.filter(isQuality).sort(compareSpecs).map(function getType2(priority) {
111662
+ return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) {
111663
111663
  return provided[priorities.indexOf(priority)];
111664
111664
  });
111665
111665
  }
@@ -114043,7 +114043,7 @@ var require_codegen = __commonJS({
114043
114043
  AND: new code_1._Code("&&"),
114044
114044
  ADD: new code_1._Code("+")
114045
114045
  };
114046
- var Node2 = class {
114046
+ var Node = class {
114047
114047
  optimizeNodes() {
114048
114048
  return this;
114049
114049
  }
@@ -114051,7 +114051,7 @@ var require_codegen = __commonJS({
114051
114051
  return this;
114052
114052
  }
114053
114053
  };
114054
- var Def = class extends Node2 {
114054
+ var Def = class extends Node {
114055
114055
  constructor(varKind, name, rhs) {
114056
114056
  super();
114057
114057
  this.varKind = varKind;
@@ -114074,7 +114074,7 @@ var require_codegen = __commonJS({
114074
114074
  return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};
114075
114075
  }
114076
114076
  };
114077
- var Assign = class extends Node2 {
114077
+ var Assign = class extends Node {
114078
114078
  constructor(lhs, rhs, sideEffects) {
114079
114079
  super();
114080
114080
  this.lhs = lhs;
@@ -114104,7 +114104,7 @@ var require_codegen = __commonJS({
114104
114104
  return `${this.lhs} ${this.op}= ${this.rhs};` + _n;
114105
114105
  }
114106
114106
  };
114107
- var Label = class extends Node2 {
114107
+ var Label = class extends Node {
114108
114108
  constructor(label) {
114109
114109
  super();
114110
114110
  this.label = label;
@@ -114114,7 +114114,7 @@ var require_codegen = __commonJS({
114114
114114
  return `${this.label}:` + _n;
114115
114115
  }
114116
114116
  };
114117
- var Break = class extends Node2 {
114117
+ var Break = class extends Node {
114118
114118
  constructor(label) {
114119
114119
  super();
114120
114120
  this.label = label;
@@ -114125,7 +114125,7 @@ var require_codegen = __commonJS({
114125
114125
  return `break${label};` + _n;
114126
114126
  }
114127
114127
  };
114128
- var Throw = class extends Node2 {
114128
+ var Throw = class extends Node {
114129
114129
  constructor(error2) {
114130
114130
  super();
114131
114131
  this.error = error2;
@@ -114137,7 +114137,7 @@ var require_codegen = __commonJS({
114137
114137
  return this.error.names;
114138
114138
  }
114139
114139
  };
114140
- var AnyCode = class extends Node2 {
114140
+ var AnyCode = class extends Node {
114141
114141
  constructor(code) {
114142
114142
  super();
114143
114143
  this.code = code;
@@ -114156,7 +114156,7 @@ var require_codegen = __commonJS({
114156
114156
  return this.code instanceof code_1._CodeOrName ? this.code.names : {};
114157
114157
  }
114158
114158
  };
114159
- var ParentNode = class extends Node2 {
114159
+ var ParentNode = class extends Node {
114160
114160
  constructor(nodes = []) {
114161
114161
  super();
114162
114162
  this.nodes = nodes;
@@ -120453,3292 +120453,6 @@ __export(index_exports, {
120453
120453
  });
120454
120454
  module.exports = __toCommonJS(index_exports);
120455
120455
 
120456
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/errors.js
120457
- var messages = {
120458
- AbortError: "A request was aborted, for example through a call to IDBTransaction.abort.",
120459
- ConstraintError: "A mutation operation in the transaction failed because a constraint was not satisfied. For example, an object such as an object store or index already exists and a request attempted to create a new one.",
120460
- DataCloneError: "The data being stored could not be cloned by the internal structured cloning algorithm.",
120461
- DataError: "Data provided to an operation does not meet requirements.",
120462
- InvalidAccessError: "An invalid operation was performed on an object. For example transaction creation attempt was made, but an empty scope was provided.",
120463
- InvalidStateError: "An operation was called on an object on which it is not allowed or at a time when it is not allowed. Also occurs if a request is made on a source object that has been deleted or removed. Use TransactionInactiveError or ReadOnlyError when possible, as they are more specific variations of InvalidStateError.",
120464
- NotFoundError: "The operation failed because the requested database object could not be found. For example, an object store did not exist but was being opened.",
120465
- ReadOnlyError: 'The mutating operation was attempted in a "readonly" transaction.',
120466
- TransactionInactiveError: "A request was placed against a transaction which is currently not active, or which is finished.",
120467
- SyntaxError: "The keypath argument contains an invalid key path",
120468
- VersionError: "An attempt was made to open a database using a lower version than the existing version."
120469
- };
120470
- var setErrorCode = (error2, value3) => {
120471
- Object.defineProperty(error2, "code", {
120472
- value: value3,
120473
- writable: false,
120474
- enumerable: true,
120475
- configurable: false
120476
- });
120477
- };
120478
- var AbortError = class extends DOMException {
120479
- constructor(message = messages.AbortError) {
120480
- super(message, "AbortError");
120481
- }
120482
- };
120483
- var ConstraintError = class extends DOMException {
120484
- constructor(message = messages.ConstraintError) {
120485
- super(message, "ConstraintError");
120486
- }
120487
- };
120488
- var DataError = class extends DOMException {
120489
- constructor(message = messages.DataError) {
120490
- super(message, "DataError");
120491
- setErrorCode(this, 0);
120492
- }
120493
- };
120494
- var InvalidAccessError = class extends DOMException {
120495
- constructor(message = messages.InvalidAccessError) {
120496
- super(message, "InvalidAccessError");
120497
- }
120498
- };
120499
- var InvalidStateError = class extends DOMException {
120500
- constructor(message = messages.InvalidStateError) {
120501
- super(message, "InvalidStateError");
120502
- setErrorCode(this, 11);
120503
- }
120504
- };
120505
- var NotFoundError = class extends DOMException {
120506
- constructor(message = messages.NotFoundError) {
120507
- super(message, "NotFoundError");
120508
- }
120509
- };
120510
- var ReadOnlyError = class extends DOMException {
120511
- constructor(message = messages.ReadOnlyError) {
120512
- super(message, "ReadOnlyError");
120513
- }
120514
- };
120515
- var SyntaxError2 = class extends DOMException {
120516
- constructor(message = messages.VersionError) {
120517
- super(message, "SyntaxError");
120518
- setErrorCode(this, 12);
120519
- }
120520
- };
120521
- var TransactionInactiveError = class extends DOMException {
120522
- constructor(message = messages.TransactionInactiveError) {
120523
- super(message, "TransactionInactiveError");
120524
- setErrorCode(this, 0);
120525
- }
120526
- };
120527
- var VersionError = class extends DOMException {
120528
- constructor(message = messages.VersionError) {
120529
- super(message, "VersionError");
120530
- }
120531
- };
120532
-
120533
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/isSharedArrayBuffer.js
120534
- function isSharedArrayBuffer(input) {
120535
- return typeof SharedArrayBuffer !== "undefined" && input instanceof SharedArrayBuffer;
120536
- }
120537
-
120538
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/valueToKeyWithoutThrowing.js
120539
- var INVALID_TYPE = /* @__PURE__ */ Symbol("INVALID_TYPE");
120540
- var INVALID_VALUE = /* @__PURE__ */ Symbol("INVALID_VALUE");
120541
- var valueToKeyWithoutThrowing = (input, seen) => {
120542
- if (typeof input === "number") {
120543
- if (isNaN(input)) {
120544
- return INVALID_VALUE;
120545
- }
120546
- return input;
120547
- } else if (Object.prototype.toString.call(input) === "[object Date]") {
120548
- const ms = input.valueOf();
120549
- if (isNaN(ms)) {
120550
- return INVALID_VALUE;
120551
- }
120552
- return new Date(ms);
120553
- } else if (typeof input === "string") {
120554
- return input;
120555
- } else if (
120556
- // https://w3c.github.io/IndexedDB/#ref-for-dfn-buffer-source-type
120557
- input instanceof ArrayBuffer || isSharedArrayBuffer(input) || typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView && ArrayBuffer.isView(input)
120558
- ) {
120559
- if ("detached" in input ? input.detached : input.byteLength === 0) {
120560
- return INVALID_VALUE;
120561
- }
120562
- let arrayBuffer;
120563
- let offset = 0;
120564
- let length3 = 0;
120565
- if (input instanceof ArrayBuffer || isSharedArrayBuffer(input)) {
120566
- arrayBuffer = input;
120567
- length3 = input.byteLength;
120568
- } else {
120569
- arrayBuffer = input.buffer;
120570
- offset = input.byteOffset;
120571
- length3 = input.byteLength;
120572
- }
120573
- return arrayBuffer.slice(offset, offset + length3);
120574
- } else if (Array.isArray(input)) {
120575
- if (seen === void 0) {
120576
- seen = /* @__PURE__ */ new Set();
120577
- } else if (seen.has(input)) {
120578
- return INVALID_VALUE;
120579
- }
120580
- seen.add(input);
120581
- let hasInvalid = false;
120582
- const keys6 = Array.from({
120583
- length: input.length
120584
- }, (_, i) => {
120585
- if (hasInvalid) {
120586
- return;
120587
- }
120588
- const hop = Object.hasOwn(input, i);
120589
- if (!hop) {
120590
- hasInvalid = true;
120591
- return;
120592
- }
120593
- const entry = input[i];
120594
- const key = valueToKeyWithoutThrowing(entry, seen);
120595
- if (key === INVALID_VALUE || key === INVALID_TYPE) {
120596
- hasInvalid = true;
120597
- return;
120598
- }
120599
- return key;
120600
- });
120601
- if (hasInvalid) {
120602
- return INVALID_VALUE;
120603
- }
120604
- return keys6;
120605
- } else {
120606
- return INVALID_TYPE;
120607
- }
120608
- };
120609
- var valueToKeyWithoutThrowing_default = valueToKeyWithoutThrowing;
120610
-
120611
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/valueToKey.js
120612
- var valueToKey = (input, seen) => {
120613
- const result = valueToKeyWithoutThrowing_default(input, seen);
120614
- if (result === INVALID_VALUE || result === INVALID_TYPE) {
120615
- throw new DataError();
120616
- }
120617
- return result;
120618
- };
120619
- var valueToKey_default = valueToKey;
120620
-
120621
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/cmp.js
120622
- var getType = (x) => {
120623
- if (typeof x === "number") {
120624
- return "Number";
120625
- }
120626
- if (Object.prototype.toString.call(x) === "[object Date]") {
120627
- return "Date";
120628
- }
120629
- if (Array.isArray(x)) {
120630
- return "Array";
120631
- }
120632
- if (typeof x === "string") {
120633
- return "String";
120634
- }
120635
- if (x instanceof ArrayBuffer) {
120636
- return "Binary";
120637
- }
120638
- throw new DataError();
120639
- };
120640
- var cmp = (first2, second) => {
120641
- if (second === void 0) {
120642
- throw new TypeError();
120643
- }
120644
- first2 = valueToKey_default(first2);
120645
- second = valueToKey_default(second);
120646
- const t1 = getType(first2);
120647
- const t2 = getType(second);
120648
- if (t1 !== t2) {
120649
- if (t1 === "Array") {
120650
- return 1;
120651
- }
120652
- if (t1 === "Binary" && (t2 === "String" || t2 === "Date" || t2 === "Number")) {
120653
- return 1;
120654
- }
120655
- if (t1 === "String" && (t2 === "Date" || t2 === "Number")) {
120656
- return 1;
120657
- }
120658
- if (t1 === "Date" && t2 === "Number") {
120659
- return 1;
120660
- }
120661
- return -1;
120662
- }
120663
- if (t1 === "Binary") {
120664
- first2 = new Uint8Array(first2);
120665
- second = new Uint8Array(second);
120666
- }
120667
- if (t1 === "Array" || t1 === "Binary") {
120668
- const length3 = Math.min(first2.length, second.length);
120669
- for (let i = 0; i < length3; i++) {
120670
- const result = cmp(first2[i], second[i]);
120671
- if (result !== 0) {
120672
- return result;
120673
- }
120674
- }
120675
- if (first2.length > second.length) {
120676
- return 1;
120677
- }
120678
- if (first2.length < second.length) {
120679
- return -1;
120680
- }
120681
- return 0;
120682
- }
120683
- if (t1 === "Date") {
120684
- if (first2.getTime() === second.getTime()) {
120685
- return 0;
120686
- }
120687
- } else {
120688
- if (first2 === second) {
120689
- return 0;
120690
- }
120691
- }
120692
- return first2 > second ? 1 : -1;
120693
- };
120694
- var cmp_default = cmp;
120695
-
120696
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/FDBKeyRange.js
120697
- var FDBKeyRange = class _FDBKeyRange {
120698
- static only(value3) {
120699
- if (arguments.length === 0) {
120700
- throw new TypeError();
120701
- }
120702
- value3 = valueToKey_default(value3);
120703
- return new _FDBKeyRange(value3, value3, false, false);
120704
- }
120705
- static lowerBound(lower, open = false) {
120706
- if (arguments.length === 0) {
120707
- throw new TypeError();
120708
- }
120709
- lower = valueToKey_default(lower);
120710
- return new _FDBKeyRange(lower, void 0, open, true);
120711
- }
120712
- static upperBound(upper, open = false) {
120713
- if (arguments.length === 0) {
120714
- throw new TypeError();
120715
- }
120716
- upper = valueToKey_default(upper);
120717
- return new _FDBKeyRange(void 0, upper, true, open);
120718
- }
120719
- static bound(lower, upper, lowerOpen = false, upperOpen = false) {
120720
- if (arguments.length < 2) {
120721
- throw new TypeError();
120722
- }
120723
- const cmpResult = cmp_default(lower, upper);
120724
- if (cmpResult === 1 || cmpResult === 0 && (lowerOpen || upperOpen)) {
120725
- throw new DataError();
120726
- }
120727
- lower = valueToKey_default(lower);
120728
- upper = valueToKey_default(upper);
120729
- return new _FDBKeyRange(lower, upper, lowerOpen, upperOpen);
120730
- }
120731
- constructor(lower, upper, lowerOpen, upperOpen) {
120732
- this.lower = lower;
120733
- this.upper = upper;
120734
- this.lowerOpen = lowerOpen;
120735
- this.upperOpen = upperOpen;
120736
- }
120737
- // https://w3c.github.io/IndexedDB/#dom-idbkeyrange-includes
120738
- includes(key) {
120739
- if (arguments.length === 0) {
120740
- throw new TypeError();
120741
- }
120742
- key = valueToKey_default(key);
120743
- if (this.lower !== void 0) {
120744
- const cmpResult = cmp_default(this.lower, key);
120745
- if (cmpResult === 1 || cmpResult === 0 && this.lowerOpen) {
120746
- return false;
120747
- }
120748
- }
120749
- if (this.upper !== void 0) {
120750
- const cmpResult = cmp_default(this.upper, key);
120751
- if (cmpResult === -1 || cmpResult === 0 && this.upperOpen) {
120752
- return false;
120753
- }
120754
- }
120755
- return true;
120756
- }
120757
- get [Symbol.toStringTag]() {
120758
- return "IDBKeyRange";
120759
- }
120760
- };
120761
- var FDBKeyRange_default = FDBKeyRange;
120762
-
120763
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/extractKey.js
120764
- var extractKey = (keyPath, value3) => {
120765
- if (Array.isArray(keyPath)) {
120766
- const result = [];
120767
- for (let item of keyPath) {
120768
- if (item !== void 0 && item !== null && typeof item !== "string" && item.toString) {
120769
- item = item.toString();
120770
- }
120771
- const key = extractKey(item, value3).key;
120772
- result.push(valueToKey_default(key));
120773
- }
120774
- return {
120775
- type: "found",
120776
- key: result
120777
- };
120778
- }
120779
- if (keyPath === "") {
120780
- return {
120781
- type: "found",
120782
- key: value3
120783
- };
120784
- }
120785
- let remainingKeyPath = keyPath;
120786
- let object4 = value3;
120787
- while (remainingKeyPath !== null) {
120788
- let identifier2;
120789
- const i = remainingKeyPath.indexOf(".");
120790
- if (i >= 0) {
120791
- identifier2 = remainingKeyPath.slice(0, i);
120792
- remainingKeyPath = remainingKeyPath.slice(i + 1);
120793
- } else {
120794
- identifier2 = remainingKeyPath;
120795
- remainingKeyPath = null;
120796
- }
120797
- const isSpecialIdentifier = identifier2 === "length" && (typeof object4 === "string" || Array.isArray(object4)) || (identifier2 === "size" || identifier2 === "type") && typeof Blob !== "undefined" && object4 instanceof Blob || (identifier2 === "name" || identifier2 === "lastModified") && typeof File !== "undefined" && object4 instanceof File;
120798
- if (!isSpecialIdentifier && (typeof object4 !== "object" || object4 === null || !Object.hasOwn(object4, identifier2))) {
120799
- return {
120800
- type: "notFound"
120801
- };
120802
- }
120803
- object4 = object4[identifier2];
120804
- }
120805
- return {
120806
- type: "found",
120807
- key: object4
120808
- };
120809
- };
120810
- var extractKey_default = extractKey;
120811
-
120812
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/cloneValueForInsertion.js
120813
- function cloneValueForInsertion(value3, transaction) {
120814
- if (transaction._state !== "active") {
120815
- throw new Error("Assert: transaction state is active");
120816
- }
120817
- transaction._state = "inactive";
120818
- try {
120819
- return structuredClone(value3);
120820
- } finally {
120821
- transaction._state = "active";
120822
- }
120823
- }
120824
-
120825
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/FDBCursor.js
120826
- var getEffectiveObjectStore = (cursor) => {
120827
- if (cursor.source instanceof FDBObjectStore_default) {
120828
- return cursor.source;
120829
- }
120830
- return cursor.source.objectStore;
120831
- };
120832
- var makeKeyRange = (range2, lowers, uppers) => {
120833
- let lower = range2 !== void 0 ? range2.lower : void 0;
120834
- let upper = range2 !== void 0 ? range2.upper : void 0;
120835
- for (const lowerTemp of lowers) {
120836
- if (lowerTemp === void 0) {
120837
- continue;
120838
- }
120839
- if (lower === void 0 || cmp_default(lower, lowerTemp) === 1) {
120840
- lower = lowerTemp;
120841
- }
120842
- }
120843
- for (const upperTemp of uppers) {
120844
- if (upperTemp === void 0) {
120845
- continue;
120846
- }
120847
- if (upper === void 0 || cmp_default(upper, upperTemp) === -1) {
120848
- upper = upperTemp;
120849
- }
120850
- }
120851
- if (lower !== void 0 && upper !== void 0) {
120852
- return FDBKeyRange_default.bound(lower, upper);
120853
- }
120854
- if (lower !== void 0) {
120855
- return FDBKeyRange_default.lowerBound(lower);
120856
- }
120857
- if (upper !== void 0) {
120858
- return FDBKeyRange_default.upperBound(upper);
120859
- }
120860
- };
120861
- var FDBCursor = class {
120862
- _gotValue = false;
120863
- _position = void 0;
120864
- // Key of previously returned record
120865
- _objectStorePosition = void 0;
120866
- _keyOnly = false;
120867
- _key = void 0;
120868
- _primaryKey = void 0;
120869
- constructor(source, range2, direction = "next", request2, keyOnly = false) {
120870
- this._range = range2;
120871
- this._source = source;
120872
- this._direction = direction;
120873
- this._request = request2;
120874
- this._keyOnly = keyOnly;
120875
- }
120876
- // Read only properties
120877
- get source() {
120878
- return this._source;
120879
- }
120880
- set source(val) {
120881
- }
120882
- get request() {
120883
- return this._request;
120884
- }
120885
- set request(val) {
120886
- }
120887
- get direction() {
120888
- return this._direction;
120889
- }
120890
- set direction(val) {
120891
- }
120892
- get key() {
120893
- return this._key;
120894
- }
120895
- set key(val) {
120896
- }
120897
- get primaryKey() {
120898
- return this._primaryKey;
120899
- }
120900
- set primaryKey(val) {
120901
- }
120902
- // https://w3c.github.io/IndexedDB/#iterate-a-cursor
120903
- _iterate(key, primaryKey) {
120904
- const sourceIsObjectStore = this.source instanceof FDBObjectStore_default;
120905
- const records = this.source instanceof FDBObjectStore_default ? this.source._rawObjectStore.records : this.source._rawIndex.records;
120906
- let foundRecord;
120907
- if (this.direction === "next") {
120908
- const range2 = makeKeyRange(this._range, [key, this._position], []);
120909
- for (const record4 of records.values(range2)) {
120910
- const cmpResultKey = key !== void 0 ? cmp_default(record4.key, key) : void 0;
120911
- const cmpResultPosition = this._position !== void 0 ? cmp_default(record4.key, this._position) : void 0;
120912
- if (key !== void 0) {
120913
- if (cmpResultKey === -1) {
120914
- continue;
120915
- }
120916
- }
120917
- if (primaryKey !== void 0) {
120918
- if (cmpResultKey === -1) {
120919
- continue;
120920
- }
120921
- const cmpResultPrimaryKey = cmp_default(record4.value, primaryKey);
120922
- if (cmpResultKey === 0 && cmpResultPrimaryKey === -1) {
120923
- continue;
120924
- }
120925
- }
120926
- if (this._position !== void 0 && sourceIsObjectStore) {
120927
- if (cmpResultPosition !== 1) {
120928
- continue;
120929
- }
120930
- }
120931
- if (this._position !== void 0 && !sourceIsObjectStore) {
120932
- if (cmpResultPosition === -1) {
120933
- continue;
120934
- }
120935
- if (cmpResultPosition === 0 && cmp_default(record4.value, this._objectStorePosition) !== 1) {
120936
- continue;
120937
- }
120938
- }
120939
- if (this._range !== void 0) {
120940
- if (!this._range.includes(record4.key)) {
120941
- continue;
120942
- }
120943
- }
120944
- foundRecord = record4;
120945
- break;
120946
- }
120947
- } else if (this.direction === "nextunique") {
120948
- const range2 = makeKeyRange(this._range, [key, this._position], []);
120949
- for (const record4 of records.values(range2)) {
120950
- if (key !== void 0) {
120951
- if (cmp_default(record4.key, key) === -1) {
120952
- continue;
120953
- }
120954
- }
120955
- if (this._position !== void 0) {
120956
- if (cmp_default(record4.key, this._position) !== 1) {
120957
- continue;
120958
- }
120959
- }
120960
- if (this._range !== void 0) {
120961
- if (!this._range.includes(record4.key)) {
120962
- continue;
120963
- }
120964
- }
120965
- foundRecord = record4;
120966
- break;
120967
- }
120968
- } else if (this.direction === "prev") {
120969
- const range2 = makeKeyRange(this._range, [], [key, this._position]);
120970
- for (const record4 of records.values(range2, "prev")) {
120971
- const cmpResultKey = key !== void 0 ? cmp_default(record4.key, key) : void 0;
120972
- const cmpResultPosition = this._position !== void 0 ? cmp_default(record4.key, this._position) : void 0;
120973
- if (key !== void 0) {
120974
- if (cmpResultKey === 1) {
120975
- continue;
120976
- }
120977
- }
120978
- if (primaryKey !== void 0) {
120979
- if (cmpResultKey === 1) {
120980
- continue;
120981
- }
120982
- const cmpResultPrimaryKey = cmp_default(record4.value, primaryKey);
120983
- if (cmpResultKey === 0 && cmpResultPrimaryKey === 1) {
120984
- continue;
120985
- }
120986
- }
120987
- if (this._position !== void 0 && sourceIsObjectStore) {
120988
- if (cmpResultPosition !== -1) {
120989
- continue;
120990
- }
120991
- }
120992
- if (this._position !== void 0 && !sourceIsObjectStore) {
120993
- if (cmpResultPosition === 1) {
120994
- continue;
120995
- }
120996
- if (cmpResultPosition === 0 && cmp_default(record4.value, this._objectStorePosition) !== -1) {
120997
- continue;
120998
- }
120999
- }
121000
- if (this._range !== void 0) {
121001
- if (!this._range.includes(record4.key)) {
121002
- continue;
121003
- }
121004
- }
121005
- foundRecord = record4;
121006
- break;
121007
- }
121008
- } else if (this.direction === "prevunique") {
121009
- let tempRecord;
121010
- const range2 = makeKeyRange(this._range, [], [key, this._position]);
121011
- for (const record4 of records.values(range2, "prev")) {
121012
- if (key !== void 0) {
121013
- if (cmp_default(record4.key, key) === 1) {
121014
- continue;
121015
- }
121016
- }
121017
- if (this._position !== void 0) {
121018
- if (cmp_default(record4.key, this._position) !== -1) {
121019
- continue;
121020
- }
121021
- }
121022
- if (this._range !== void 0) {
121023
- if (!this._range.includes(record4.key)) {
121024
- continue;
121025
- }
121026
- }
121027
- tempRecord = record4;
121028
- break;
121029
- }
121030
- if (tempRecord) {
121031
- foundRecord = records.get(tempRecord.key);
121032
- }
121033
- }
121034
- let result;
121035
- if (!foundRecord) {
121036
- this._key = void 0;
121037
- if (!sourceIsObjectStore) {
121038
- this._objectStorePosition = void 0;
121039
- }
121040
- if (!this._keyOnly && this.toString() === "[object IDBCursorWithValue]") {
121041
- this.value = void 0;
121042
- }
121043
- result = null;
121044
- } else {
121045
- this._position = foundRecord.key;
121046
- if (!sourceIsObjectStore) {
121047
- this._objectStorePosition = foundRecord.value;
121048
- }
121049
- this._key = foundRecord.key;
121050
- if (sourceIsObjectStore) {
121051
- this._primaryKey = structuredClone(foundRecord.key);
121052
- if (!this._keyOnly && this.toString() === "[object IDBCursorWithValue]") {
121053
- this.value = structuredClone(foundRecord.value);
121054
- }
121055
- } else {
121056
- this._primaryKey = structuredClone(foundRecord.value);
121057
- if (!this._keyOnly && this.toString() === "[object IDBCursorWithValue]") {
121058
- if (this.source instanceof FDBObjectStore_default) {
121059
- throw new Error("This should never happen");
121060
- }
121061
- const value3 = this.source.objectStore._rawObjectStore.getValue(foundRecord.value);
121062
- this.value = structuredClone(value3);
121063
- }
121064
- }
121065
- this._gotValue = true;
121066
- result = this;
121067
- }
121068
- return result;
121069
- }
121070
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#widl-IDBCursor-update-IDBRequest-any-value
121071
- update(value3) {
121072
- if (value3 === void 0) {
121073
- throw new TypeError();
121074
- }
121075
- const effectiveObjectStore = getEffectiveObjectStore(this);
121076
- const effectiveKey = Object.hasOwn(this.source, "_rawIndex") ? this.primaryKey : this._position;
121077
- const transaction = effectiveObjectStore.transaction;
121078
- if (transaction._state !== "active") {
121079
- throw new TransactionInactiveError();
121080
- }
121081
- if (transaction.mode === "readonly") {
121082
- throw new ReadOnlyError();
121083
- }
121084
- if (effectiveObjectStore._rawObjectStore.deleted) {
121085
- throw new InvalidStateError();
121086
- }
121087
- if (!(this.source instanceof FDBObjectStore_default) && this.source._rawIndex.deleted) {
121088
- throw new InvalidStateError();
121089
- }
121090
- if (!this._gotValue || !Object.hasOwn(this, "value")) {
121091
- throw new InvalidStateError();
121092
- }
121093
- const clone4 = cloneValueForInsertion(value3, transaction);
121094
- if (effectiveObjectStore.keyPath !== null) {
121095
- let tempKey;
121096
- try {
121097
- tempKey = extractKey_default(effectiveObjectStore.keyPath, clone4).key;
121098
- } catch (err) {
121099
- }
121100
- if (cmp_default(tempKey, effectiveKey) !== 0) {
121101
- throw new DataError();
121102
- }
121103
- }
121104
- const record4 = {
121105
- key: effectiveKey,
121106
- value: clone4
121107
- };
121108
- return transaction._execRequestAsync({
121109
- operation: effectiveObjectStore._rawObjectStore.storeRecord.bind(effectiveObjectStore._rawObjectStore, record4, false, transaction._rollbackLog),
121110
- source: this
121111
- });
121112
- }
121113
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#widl-IDBCursor-advance-void-unsigned-long-count
121114
- advance(count3) {
121115
- if (!Number.isInteger(count3) || count3 <= 0) {
121116
- throw new TypeError();
121117
- }
121118
- const effectiveObjectStore = getEffectiveObjectStore(this);
121119
- const transaction = effectiveObjectStore.transaction;
121120
- if (transaction._state !== "active") {
121121
- throw new TransactionInactiveError();
121122
- }
121123
- if (effectiveObjectStore._rawObjectStore.deleted) {
121124
- throw new InvalidStateError();
121125
- }
121126
- if (!(this.source instanceof FDBObjectStore_default) && this.source._rawIndex.deleted) {
121127
- throw new InvalidStateError();
121128
- }
121129
- if (!this._gotValue) {
121130
- throw new InvalidStateError();
121131
- }
121132
- if (this._request) {
121133
- this._request.readyState = "pending";
121134
- }
121135
- transaction._execRequestAsync({
121136
- operation: () => {
121137
- let result;
121138
- for (let i = 0; i < count3; i++) {
121139
- result = this._iterate();
121140
- if (!result) {
121141
- break;
121142
- }
121143
- }
121144
- return result;
121145
- },
121146
- request: this._request,
121147
- source: this.source
121148
- });
121149
- this._gotValue = false;
121150
- }
121151
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#widl-IDBCursor-continue-void-any-key
121152
- continue(key) {
121153
- const effectiveObjectStore = getEffectiveObjectStore(this);
121154
- const transaction = effectiveObjectStore.transaction;
121155
- if (transaction._state !== "active") {
121156
- throw new TransactionInactiveError();
121157
- }
121158
- if (effectiveObjectStore._rawObjectStore.deleted) {
121159
- throw new InvalidStateError();
121160
- }
121161
- if (!(this.source instanceof FDBObjectStore_default) && this.source._rawIndex.deleted) {
121162
- throw new InvalidStateError();
121163
- }
121164
- if (!this._gotValue) {
121165
- throw new InvalidStateError();
121166
- }
121167
- if (key !== void 0) {
121168
- key = valueToKey_default(key);
121169
- const cmpResult = cmp_default(key, this._position);
121170
- if (cmpResult <= 0 && (this.direction === "next" || this.direction === "nextunique") || cmpResult >= 0 && (this.direction === "prev" || this.direction === "prevunique")) {
121171
- throw new DataError();
121172
- }
121173
- }
121174
- if (this._request) {
121175
- this._request.readyState = "pending";
121176
- }
121177
- transaction._execRequestAsync({
121178
- operation: this._iterate.bind(this, key),
121179
- request: this._request,
121180
- source: this.source
121181
- });
121182
- this._gotValue = false;
121183
- }
121184
- // hthttps://w3c.github.io/IndexedDB/#dom-idbcursor-continueprimarykey
121185
- continuePrimaryKey(key, primaryKey) {
121186
- const effectiveObjectStore = getEffectiveObjectStore(this);
121187
- const transaction = effectiveObjectStore.transaction;
121188
- if (transaction._state !== "active") {
121189
- throw new TransactionInactiveError();
121190
- }
121191
- if (effectiveObjectStore._rawObjectStore.deleted) {
121192
- throw new InvalidStateError();
121193
- }
121194
- if (!(this.source instanceof FDBObjectStore_default) && this.source._rawIndex.deleted) {
121195
- throw new InvalidStateError();
121196
- }
121197
- if (this.source instanceof FDBObjectStore_default || this.direction !== "next" && this.direction !== "prev") {
121198
- throw new InvalidAccessError();
121199
- }
121200
- if (!this._gotValue) {
121201
- throw new InvalidStateError();
121202
- }
121203
- if (key === void 0 || primaryKey === void 0) {
121204
- throw new DataError();
121205
- }
121206
- key = valueToKey_default(key);
121207
- const cmpResult = cmp_default(key, this._position);
121208
- if (cmpResult === -1 && this.direction === "next" || cmpResult === 1 && this.direction === "prev") {
121209
- throw new DataError();
121210
- }
121211
- const cmpResult2 = cmp_default(primaryKey, this._objectStorePosition);
121212
- if (cmpResult === 0) {
121213
- if (cmpResult2 <= 0 && this.direction === "next" || cmpResult2 >= 0 && this.direction === "prev") {
121214
- throw new DataError();
121215
- }
121216
- }
121217
- if (this._request) {
121218
- this._request.readyState = "pending";
121219
- }
121220
- transaction._execRequestAsync({
121221
- operation: this._iterate.bind(this, key, primaryKey),
121222
- request: this._request,
121223
- source: this.source
121224
- });
121225
- this._gotValue = false;
121226
- }
121227
- delete() {
121228
- const effectiveObjectStore = getEffectiveObjectStore(this);
121229
- const effectiveKey = Object.hasOwn(this.source, "_rawIndex") ? this.primaryKey : this._position;
121230
- const transaction = effectiveObjectStore.transaction;
121231
- if (transaction._state !== "active") {
121232
- throw new TransactionInactiveError();
121233
- }
121234
- if (transaction.mode === "readonly") {
121235
- throw new ReadOnlyError();
121236
- }
121237
- if (effectiveObjectStore._rawObjectStore.deleted) {
121238
- throw new InvalidStateError();
121239
- }
121240
- if (!(this.source instanceof FDBObjectStore_default) && this.source._rawIndex.deleted) {
121241
- throw new InvalidStateError();
121242
- }
121243
- if (!this._gotValue || !Object.hasOwn(this, "value")) {
121244
- throw new InvalidStateError();
121245
- }
121246
- return transaction._execRequestAsync({
121247
- operation: effectiveObjectStore._rawObjectStore.deleteRecord.bind(effectiveObjectStore._rawObjectStore, effectiveKey, transaction._rollbackLog),
121248
- source: this
121249
- });
121250
- }
121251
- get [Symbol.toStringTag]() {
121252
- return "IDBCursor";
121253
- }
121254
- };
121255
- var FDBCursor_default = FDBCursor;
121256
-
121257
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/FDBCursorWithValue.js
121258
- var FDBCursorWithValue = class extends FDBCursor_default {
121259
- value = void 0;
121260
- constructor(source, range2, direction, request2) {
121261
- super(source, range2, direction, request2);
121262
- }
121263
- get [Symbol.toStringTag]() {
121264
- return "IDBCursorWithValue";
121265
- }
121266
- };
121267
- var FDBCursorWithValue_default = FDBCursorWithValue;
121268
-
121269
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/FakeEventTarget.js
121270
- var stopped = (event, listener) => {
121271
- return event.immediatePropagationStopped || event.eventPhase === event.CAPTURING_PHASE && listener.capture === false || event.eventPhase === event.BUBBLING_PHASE && listener.capture === true;
121272
- };
121273
- var invokeEventListeners = (event, obj) => {
121274
- event.currentTarget = obj;
121275
- const errors = [];
121276
- const invoke = (callbackOrObject) => {
121277
- try {
121278
- const callback2 = typeof callbackOrObject === "function" ? callbackOrObject : callbackOrObject.handleEvent;
121279
- callback2.call(event.currentTarget, event);
121280
- } catch (err) {
121281
- errors.push(err);
121282
- }
121283
- };
121284
- for (const listener of obj.listeners.slice()) {
121285
- if (event.type !== listener.type || stopped(event, listener)) {
121286
- continue;
121287
- }
121288
- invoke(listener.callback);
121289
- }
121290
- const typeToProp = {
121291
- abort: "onabort",
121292
- blocked: "onblocked",
121293
- close: "onclose",
121294
- complete: "oncomplete",
121295
- error: "onerror",
121296
- success: "onsuccess",
121297
- upgradeneeded: "onupgradeneeded",
121298
- versionchange: "onversionchange"
121299
- };
121300
- const prop = typeToProp[event.type];
121301
- if (prop === void 0) {
121302
- throw new Error(`Unknown event type: "${event.type}"`);
121303
- }
121304
- const callback = event.currentTarget[prop];
121305
- if (callback) {
121306
- const listener = {
121307
- callback,
121308
- capture: false,
121309
- type: event.type
121310
- };
121311
- if (!stopped(event, listener)) {
121312
- invoke(listener.callback);
121313
- }
121314
- }
121315
- if (errors.length) {
121316
- throw new AggregateError(errors);
121317
- }
121318
- };
121319
- var FakeEventTarget = class {
121320
- listeners = [];
121321
- // These will be overridden in individual subclasses and made not readonly
121322
- addEventListener(type, callback, options) {
121323
- const capture2 = !!(typeof options === "object" && options ? options.capture : options);
121324
- this.listeners.push({
121325
- callback,
121326
- capture: capture2,
121327
- type
121328
- });
121329
- }
121330
- removeEventListener(type, callback, options) {
121331
- const capture2 = !!(typeof options === "object" && options ? options.capture : options);
121332
- const i = this.listeners.findIndex((listener) => {
121333
- return listener.type === type && listener.callback === callback && listener.capture === capture2;
121334
- });
121335
- this.listeners.splice(i, 1);
121336
- }
121337
- // http://www.w3.org/TR/dom/#dispatching-events
121338
- dispatchEvent(event) {
121339
- if (event.dispatched || !event.initialized) {
121340
- throw new InvalidStateError("The object is in an invalid state.");
121341
- }
121342
- event.isTrusted = false;
121343
- event.dispatched = true;
121344
- event.target = this;
121345
- event.eventPhase = event.CAPTURING_PHASE;
121346
- for (const obj of event.eventPath) {
121347
- if (!event.propagationStopped) {
121348
- invokeEventListeners(event, obj);
121349
- }
121350
- }
121351
- event.eventPhase = event.AT_TARGET;
121352
- if (!event.propagationStopped) {
121353
- invokeEventListeners(event, event.target);
121354
- }
121355
- if (event.bubbles) {
121356
- event.eventPath.reverse();
121357
- event.eventPhase = event.BUBBLING_PHASE;
121358
- for (const obj of event.eventPath) {
121359
- if (!event.propagationStopped) {
121360
- invokeEventListeners(event, obj);
121361
- }
121362
- }
121363
- }
121364
- event.dispatched = false;
121365
- event.eventPhase = event.NONE;
121366
- event.currentTarget = null;
121367
- if (event.canceled) {
121368
- return false;
121369
- }
121370
- return true;
121371
- }
121372
- };
121373
- var FakeEventTarget_default = FakeEventTarget;
121374
-
121375
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/FDBRequest.js
121376
- var FDBRequest = class extends FakeEventTarget_default {
121377
- _result = null;
121378
- _error = null;
121379
- source = null;
121380
- transaction = null;
121381
- readyState = "pending";
121382
- onsuccess = null;
121383
- onerror = null;
121384
- get error() {
121385
- if (this.readyState === "pending") {
121386
- throw new InvalidStateError();
121387
- }
121388
- return this._error;
121389
- }
121390
- set error(value3) {
121391
- this._error = value3;
121392
- }
121393
- get result() {
121394
- if (this.readyState === "pending") {
121395
- throw new InvalidStateError();
121396
- }
121397
- return this._result;
121398
- }
121399
- set result(value3) {
121400
- this._result = value3;
121401
- }
121402
- get [Symbol.toStringTag]() {
121403
- return "IDBRequest";
121404
- }
121405
- };
121406
- var FDBRequest_default = FDBRequest;
121407
-
121408
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/FakeDOMStringList.js
121409
- var FakeDOMStringList = class {
121410
- constructor(...values4) {
121411
- this._values = values4;
121412
- for (let i = 0; i < values4.length; i++) {
121413
- this[i] = values4[i];
121414
- }
121415
- }
121416
- contains(value3) {
121417
- return this._values.includes(value3);
121418
- }
121419
- item(i) {
121420
- if (i < 0 || i >= this._values.length) {
121421
- return null;
121422
- }
121423
- return this._values[i];
121424
- }
121425
- get length() {
121426
- return this._values.length;
121427
- }
121428
- [Symbol.iterator]() {
121429
- return this._values[Symbol.iterator]();
121430
- }
121431
- // Handled by proxy
121432
- // Used internally, should not be used by others. I could maybe get rid of these and replace rather than mutate, but too lazy to check the spec.
121433
- _push(...values4) {
121434
- for (let i = 0; i < values4.length; i++) {
121435
- this[this._values.length + i] = values4[i];
121436
- }
121437
- this._values.push(...values4);
121438
- }
121439
- _sort(...values4) {
121440
- this._values.sort(...values4);
121441
- for (let i = 0; i < this._values.length; i++) {
121442
- this[i] = this._values[i];
121443
- }
121444
- return this;
121445
- }
121446
- };
121447
- var FakeDOMStringList_default = FakeDOMStringList;
121448
-
121449
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/valueToKeyRange.js
121450
- var valueToKeyRange = (value3, nullDisallowedFlag = false) => {
121451
- if (value3 instanceof FDBKeyRange_default) {
121452
- return value3;
121453
- }
121454
- if (value3 === null || value3 === void 0) {
121455
- if (nullDisallowedFlag) {
121456
- throw new DataError();
121457
- }
121458
- return new FDBKeyRange_default(void 0, void 0, false, false);
121459
- }
121460
- const key = valueToKey_default(value3);
121461
- return FDBKeyRange_default.only(key);
121462
- };
121463
- var valueToKeyRange_default = valueToKeyRange;
121464
-
121465
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/getKeyPath.js
121466
- var convertKey = (key) => typeof key === "object" && key ? key + "" : key;
121467
- function getKeyPath(keyPath) {
121468
- return Array.isArray(keyPath) ? keyPath.map(convertKey) : convertKey(keyPath);
121469
- }
121470
-
121471
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/isPotentiallyValidKeyRange.js
121472
- var isPotentiallyValidKeyRange = (value3) => {
121473
- if (value3 instanceof FDBKeyRange_default) {
121474
- return true;
121475
- }
121476
- const key = valueToKeyWithoutThrowing_default(value3);
121477
- return key !== INVALID_TYPE;
121478
- };
121479
- var isPotentiallyValidKeyRange_default = isPotentiallyValidKeyRange;
121480
-
121481
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/enforceRange.js
121482
- var enforceRange = (num, type) => {
121483
- const min4 = 0;
121484
- const max6 = type === "unsigned long" ? 4294967295 : 9007199254740991;
121485
- if (isNaN(num) || num < min4 || num > max6) {
121486
- throw new TypeError();
121487
- }
121488
- if (num >= 0) {
121489
- return Math.floor(num);
121490
- }
121491
- };
121492
- var enforceRange_default = enforceRange;
121493
-
121494
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/extractGetAllOptions.js
121495
- var extractGetAllOptions = (queryOrOptions, count3, numArguments) => {
121496
- let query;
121497
- let direction;
121498
- if (queryOrOptions === void 0 || queryOrOptions === null || isPotentiallyValidKeyRange_default(queryOrOptions)) {
121499
- query = queryOrOptions;
121500
- if (numArguments > 1 && count3 !== void 0) {
121501
- count3 = enforceRange_default(count3, "unsigned long");
121502
- }
121503
- } else {
121504
- const getAllOptions = queryOrOptions;
121505
- if (getAllOptions.query !== void 0) {
121506
- query = getAllOptions.query;
121507
- }
121508
- if (getAllOptions.count !== void 0) {
121509
- count3 = enforceRange_default(getAllOptions.count, "unsigned long");
121510
- }
121511
- if (getAllOptions.direction !== void 0) {
121512
- direction = getAllOptions.direction;
121513
- }
121514
- }
121515
- return {
121516
- query,
121517
- count: count3,
121518
- direction
121519
- };
121520
- };
121521
- var extractGetAllOptions_default = extractGetAllOptions;
121522
-
121523
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/FDBIndex.js
121524
- var confirmActiveTransaction = (index) => {
121525
- if (index._rawIndex.deleted || index.objectStore._rawObjectStore.deleted) {
121526
- throw new InvalidStateError();
121527
- }
121528
- if (index.objectStore.transaction._state !== "active") {
121529
- throw new TransactionInactiveError();
121530
- }
121531
- };
121532
- var FDBIndex = class {
121533
- constructor(objectStore, rawIndex) {
121534
- this._rawIndex = rawIndex;
121535
- this._name = rawIndex.name;
121536
- this.objectStore = objectStore;
121537
- this.keyPath = getKeyPath(rawIndex.keyPath);
121538
- this.multiEntry = rawIndex.multiEntry;
121539
- this.unique = rawIndex.unique;
121540
- }
121541
- get name() {
121542
- return this._name;
121543
- }
121544
- // https://w3c.github.io/IndexedDB/#dom-idbindex-name
121545
- set name(name) {
121546
- const transaction = this.objectStore.transaction;
121547
- if (!transaction.db._runningVersionchangeTransaction) {
121548
- throw transaction._state === "active" ? new InvalidStateError() : new TransactionInactiveError();
121549
- }
121550
- if (transaction._state !== "active") {
121551
- throw new TransactionInactiveError();
121552
- }
121553
- if (this._rawIndex.deleted || this.objectStore._rawObjectStore.deleted) {
121554
- throw new InvalidStateError();
121555
- }
121556
- name = String(name);
121557
- if (name === this._name) {
121558
- return;
121559
- }
121560
- if (this.objectStore.indexNames.contains(name)) {
121561
- throw new ConstraintError();
121562
- }
121563
- const oldName = this._name;
121564
- const oldIndexNames = [...this.objectStore.indexNames];
121565
- this._name = name;
121566
- this._rawIndex.name = name;
121567
- this.objectStore._indexesCache.delete(oldName);
121568
- this.objectStore._indexesCache.set(name, this);
121569
- this.objectStore._rawObjectStore.rawIndexes.delete(oldName);
121570
- this.objectStore._rawObjectStore.rawIndexes.set(name, this._rawIndex);
121571
- this.objectStore.indexNames = new FakeDOMStringList_default(...Array.from(this.objectStore._rawObjectStore.rawIndexes.keys()).filter((indexName) => {
121572
- const index = this.objectStore._rawObjectStore.rawIndexes.get(indexName);
121573
- return index && !index.deleted;
121574
- }).sort());
121575
- if (!this.objectStore.transaction._createdIndexes.has(this._rawIndex)) {
121576
- transaction._rollbackLog.push(() => {
121577
- this._name = oldName;
121578
- this._rawIndex.name = oldName;
121579
- this.objectStore._indexesCache.delete(name);
121580
- this.objectStore._indexesCache.set(oldName, this);
121581
- this.objectStore._rawObjectStore.rawIndexes.delete(name);
121582
- this.objectStore._rawObjectStore.rawIndexes.set(oldName, this._rawIndex);
121583
- this.objectStore.indexNames = new FakeDOMStringList_default(...oldIndexNames);
121584
- });
121585
- }
121586
- }
121587
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#widl-IDBIndex-openCursor-IDBRequest-any-range-IDBCursorDirection-direction
121588
- openCursor(range2, direction) {
121589
- confirmActiveTransaction(this);
121590
- if (range2 === null) {
121591
- range2 = void 0;
121592
- }
121593
- if (range2 !== void 0 && !(range2 instanceof FDBKeyRange_default)) {
121594
- range2 = FDBKeyRange_default.only(valueToKey_default(range2));
121595
- }
121596
- const request2 = new FDBRequest_default();
121597
- request2.source = this;
121598
- request2.transaction = this.objectStore.transaction;
121599
- const cursor = new FDBCursorWithValue_default(this, range2, direction, request2);
121600
- return this.objectStore.transaction._execRequestAsync({
121601
- operation: cursor._iterate.bind(cursor),
121602
- request: request2,
121603
- source: this
121604
- });
121605
- }
121606
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#widl-IDBIndex-openKeyCursor-IDBRequest-any-range-IDBCursorDirection-direction
121607
- openKeyCursor(range2, direction) {
121608
- confirmActiveTransaction(this);
121609
- if (range2 === null) {
121610
- range2 = void 0;
121611
- }
121612
- if (range2 !== void 0 && !(range2 instanceof FDBKeyRange_default)) {
121613
- range2 = FDBKeyRange_default.only(valueToKey_default(range2));
121614
- }
121615
- const request2 = new FDBRequest_default();
121616
- request2.source = this;
121617
- request2.transaction = this.objectStore.transaction;
121618
- const cursor = new FDBCursor_default(this, range2, direction, request2, true);
121619
- return this.objectStore.transaction._execRequestAsync({
121620
- operation: cursor._iterate.bind(cursor),
121621
- request: request2,
121622
- source: this
121623
- });
121624
- }
121625
- get(key) {
121626
- confirmActiveTransaction(this);
121627
- if (!(key instanceof FDBKeyRange_default)) {
121628
- key = valueToKey_default(key);
121629
- }
121630
- return this.objectStore.transaction._execRequestAsync({
121631
- operation: this._rawIndex.getValue.bind(this._rawIndex, key),
121632
- source: this
121633
- });
121634
- }
121635
- // http://w3c.github.io/IndexedDB/#dom-idbindex-getall
121636
- getAll(queryOrOptions, count3) {
121637
- const options = extractGetAllOptions_default(queryOrOptions, count3, arguments.length);
121638
- confirmActiveTransaction(this);
121639
- const range2 = valueToKeyRange_default(options.query);
121640
- return this.objectStore.transaction._execRequestAsync({
121641
- operation: this._rawIndex.getAllValues.bind(this._rawIndex, range2, options.count, options.direction),
121642
- source: this
121643
- });
121644
- }
121645
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#widl-IDBIndex-getKey-IDBRequest-any-key
121646
- getKey(key) {
121647
- confirmActiveTransaction(this);
121648
- if (!(key instanceof FDBKeyRange_default)) {
121649
- key = valueToKey_default(key);
121650
- }
121651
- return this.objectStore.transaction._execRequestAsync({
121652
- operation: this._rawIndex.getKey.bind(this._rawIndex, key),
121653
- source: this
121654
- });
121655
- }
121656
- // http://w3c.github.io/IndexedDB/#dom-idbindex-getallkeys
121657
- getAllKeys(queryOrOptions, count3) {
121658
- const options = extractGetAllOptions_default(queryOrOptions, count3, arguments.length);
121659
- confirmActiveTransaction(this);
121660
- const range2 = valueToKeyRange_default(options.query);
121661
- return this.objectStore.transaction._execRequestAsync({
121662
- operation: this._rawIndex.getAllKeys.bind(this._rawIndex, range2, options.count, options.direction),
121663
- source: this
121664
- });
121665
- }
121666
- // https://www.w3.org/TR/IndexedDB/#dom-idbobjectstore-getallrecords
121667
- getAllRecords(options) {
121668
- let query;
121669
- let count3;
121670
- let direction;
121671
- if (options !== void 0) {
121672
- if (options.query !== void 0) {
121673
- query = options.query;
121674
- }
121675
- if (options.count !== void 0) {
121676
- count3 = enforceRange_default(options.count, "unsigned long");
121677
- }
121678
- if (options.direction !== void 0) {
121679
- direction = options.direction;
121680
- }
121681
- }
121682
- confirmActiveTransaction(this);
121683
- const range2 = valueToKeyRange_default(query);
121684
- return this.objectStore.transaction._execRequestAsync({
121685
- operation: this._rawIndex.getAllRecords.bind(this._rawIndex, range2, count3, direction),
121686
- source: this
121687
- });
121688
- }
121689
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#widl-IDBIndex-count-IDBRequest-any-key
121690
- count(key) {
121691
- confirmActiveTransaction(this);
121692
- if (key === null) {
121693
- key = void 0;
121694
- }
121695
- if (key !== void 0 && !(key instanceof FDBKeyRange_default)) {
121696
- key = FDBKeyRange_default.only(valueToKey_default(key));
121697
- }
121698
- return this.objectStore.transaction._execRequestAsync({
121699
- operation: () => {
121700
- return this._rawIndex.count(key);
121701
- },
121702
- source: this
121703
- });
121704
- }
121705
- get [Symbol.toStringTag]() {
121706
- return "IDBIndex";
121707
- }
121708
- };
121709
- var FDBIndex_default = FDBIndex;
121710
-
121711
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/canInjectKey.js
121712
- var canInjectKey = (keyPath, value3) => {
121713
- if (Array.isArray(keyPath)) {
121714
- throw new Error("The key paths used in this section are always strings and never sequences, since it is not possible to create a object store which has a key generator and also has a key path that is a sequence.");
121715
- }
121716
- const identifiers = keyPath.split(".");
121717
- if (identifiers.length === 0) {
121718
- throw new Error("Assert: identifiers is not empty");
121719
- }
121720
- identifiers.pop();
121721
- for (const identifier2 of identifiers) {
121722
- if (typeof value3 !== "object" && !Array.isArray(value3)) {
121723
- return false;
121724
- }
121725
- const hop = Object.hasOwn(value3, identifier2);
121726
- if (!hop) {
121727
- return true;
121728
- }
121729
- value3 = value3[identifier2];
121730
- }
121731
- return typeof value3 === "object" || Array.isArray(value3);
121732
- };
121733
- var canInjectKey_default = canInjectKey;
121734
-
121735
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/FDBRecord.js
121736
- var FDBRecord = class {
121737
- constructor(key, primaryKey, value3) {
121738
- this._key = key;
121739
- this._primaryKey = primaryKey;
121740
- this._value = value3;
121741
- }
121742
- get key() {
121743
- return this._key;
121744
- }
121745
- set key(_) {
121746
- }
121747
- get primaryKey() {
121748
- return this._primaryKey;
121749
- }
121750
- set primaryKey(_) {
121751
- }
121752
- get value() {
121753
- return this._value;
121754
- }
121755
- set value(_) {
121756
- }
121757
- get [Symbol.toStringTag]() {
121758
- return "IDBRecord";
121759
- }
121760
- };
121761
- var FDBRecord_default = FDBRecord;
121762
-
121763
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/binarySearchTree.js
121764
- var MAX_TOMBSTONE_FACTOR = 2 / 3;
121765
- var EVERYTHING_KEY_RANGE = new FDBKeyRange_default(void 0, void 0, false, false);
121766
- var BinarySearchTree = class {
121767
- _numTombstones = 0;
121768
- _numNodes = 0;
121769
- /**
121770
- *
121771
- * @param keysAreUnique - whether keys can be unique, and thus whether we cn skip checking `record.value` when
121772
- * comparing. This is basically used to distinguish ObjectStores (where the value is the entire object, not used
121773
- * as a key) from non-unique Indexes (where both the key and the value are meaningful keys used for sorting)
121774
- */
121775
- constructor(keysAreUnique) {
121776
- this._keysAreUnique = !!keysAreUnique;
121777
- }
121778
- size() {
121779
- return this._numNodes - this._numTombstones;
121780
- }
121781
- get(record4) {
121782
- return this._getByComparator(this._root, (otherRecord) => this._compare(record4, otherRecord));
121783
- }
121784
- contains(record4) {
121785
- return !!this.get(record4);
121786
- }
121787
- _compare(a, b) {
121788
- const keyComparison = cmp_default(a.key, b.key);
121789
- if (keyComparison !== 0) {
121790
- return keyComparison;
121791
- }
121792
- return this._keysAreUnique ? 0 : cmp_default(a.value, b.value);
121793
- }
121794
- _getByComparator(node, comparator) {
121795
- let current = node;
121796
- while (current) {
121797
- const comparison = comparator(current.record);
121798
- if (comparison < 0) {
121799
- current = current.left;
121800
- } else if (comparison > 0) {
121801
- current = current.right;
121802
- } else {
121803
- return current.record;
121804
- }
121805
- }
121806
- }
121807
- /**
121808
- * Put a new record, and return the overwritten record if an overwrite occurred.
121809
- * @param record
121810
- * @param noOverwrite - throw a ConstraintError in case of overwrite
121811
- */
121812
- put(record4, noOverwrite = false) {
121813
- if (!this._root) {
121814
- this._root = {
121815
- record: record4,
121816
- left: void 0,
121817
- right: void 0,
121818
- parent: void 0,
121819
- deleted: false,
121820
- // the root is always black in a red-black tree
121821
- red: false
121822
- };
121823
- this._numNodes++;
121824
- return;
121825
- }
121826
- return this._put(this._root, record4, noOverwrite);
121827
- }
121828
- _put(node, record4, noOverwrite) {
121829
- const comparison = this._compare(record4, node.record);
121830
- if (comparison < 0) {
121831
- if (node.left) {
121832
- return this._put(node.left, record4, noOverwrite);
121833
- } else {
121834
- node.left = {
121835
- record: record4,
121836
- left: void 0,
121837
- right: void 0,
121838
- parent: node,
121839
- deleted: false,
121840
- red: true
121841
- };
121842
- this._onNewNodeInserted(node.left);
121843
- }
121844
- } else if (comparison > 0) {
121845
- if (node.right) {
121846
- return this._put(node.right, record4, noOverwrite);
121847
- } else {
121848
- node.right = {
121849
- record: record4,
121850
- left: void 0,
121851
- right: void 0,
121852
- parent: node,
121853
- deleted: false,
121854
- red: true
121855
- };
121856
- this._onNewNodeInserted(node.right);
121857
- }
121858
- } else if (node.deleted) {
121859
- node.deleted = false;
121860
- node.record = record4;
121861
- this._numTombstones--;
121862
- } else if (noOverwrite) {
121863
- throw new ConstraintError();
121864
- } else {
121865
- const overwrittenRecord = node.record;
121866
- node.record = record4;
121867
- return overwrittenRecord;
121868
- }
121869
- }
121870
- delete(record4) {
121871
- if (!this._root) {
121872
- return;
121873
- }
121874
- this._delete(this._root, record4);
121875
- if (this._numTombstones > this._numNodes * MAX_TOMBSTONE_FACTOR) {
121876
- const records = [...this.getAllRecords()];
121877
- this._root = this._rebuild(records, void 0, false);
121878
- this._numNodes = records.length;
121879
- this._numTombstones = 0;
121880
- }
121881
- }
121882
- _delete(node, record4) {
121883
- if (!node) {
121884
- return;
121885
- }
121886
- const comparison = this._compare(record4, node.record);
121887
- if (comparison < 0) {
121888
- this._delete(node.left, record4);
121889
- } else if (comparison > 0) {
121890
- this._delete(node.right, record4);
121891
- } else if (!node.deleted) {
121892
- this._numTombstones++;
121893
- node.deleted = true;
121894
- }
121895
- }
121896
- *getAllRecords(descending = false) {
121897
- yield* this.getRecords(EVERYTHING_KEY_RANGE, descending);
121898
- }
121899
- *getRecords(keyRange, descending = false) {
121900
- yield* this._getRecordsForNode(this._root, keyRange, descending);
121901
- }
121902
- *_getRecordsForNode(node, keyRange, descending = false) {
121903
- if (!node) {
121904
- return;
121905
- }
121906
- yield* this._findRecords(node, keyRange, descending);
121907
- }
121908
- *_findRecords(node, keyRange, descending = false) {
121909
- const {
121910
- lower,
121911
- upper,
121912
- lowerOpen,
121913
- upperOpen
121914
- } = keyRange;
121915
- const {
121916
- record: {
121917
- key
121918
- }
121919
- } = node;
121920
- const lowerComparison = lower === void 0 ? -1 : cmp_default(lower, key);
121921
- const upperComparison = upper === void 0 ? 1 : cmp_default(upper, key);
121922
- const moreLeft = this._keysAreUnique ? lowerComparison < 0 : lowerComparison <= 0;
121923
- const moreRight = this._keysAreUnique ? upperComparison > 0 : upperComparison >= 0;
121924
- const moreStart = descending ? moreRight : moreLeft;
121925
- const moreEnd = descending ? moreLeft : moreRight;
121926
- const start3 = descending ? "right" : "left";
121927
- const end3 = descending ? "left" : "right";
121928
- const lowerMatches = lowerOpen ? lowerComparison < 0 : lowerComparison <= 0;
121929
- const upperMatches = upperOpen ? upperComparison > 0 : upperComparison >= 0;
121930
- if (moreStart && node[start3]) {
121931
- yield* this._findRecords(node[start3], keyRange, descending);
121932
- }
121933
- if (lowerMatches && upperMatches && !node.deleted) {
121934
- yield node.record;
121935
- }
121936
- if (moreEnd && node[end3]) {
121937
- yield* this._findRecords(node[end3], keyRange, descending);
121938
- }
121939
- }
121940
- _onNewNodeInserted(newNode) {
121941
- this._numNodes++;
121942
- this._rebalanceTree(newNode);
121943
- }
121944
- // based on https://en.wikipedia.org/wiki/Red%E2%80%93black_tree#Insertion
121945
- _rebalanceTree(node) {
121946
- let parent = node.parent;
121947
- do {
121948
- if (!parent.red) {
121949
- return;
121950
- }
121951
- const grandparent = parent.parent;
121952
- if (!grandparent) {
121953
- parent.red = false;
121954
- return;
121955
- }
121956
- const parentIsRightChild = parent === grandparent.right;
121957
- const uncle = parentIsRightChild ? grandparent.left : grandparent.right;
121958
- if (!uncle || !uncle.red) {
121959
- if (node === (parentIsRightChild ? parent.left : parent.right)) {
121960
- this._rotateSubtree(parent, parentIsRightChild);
121961
- node = parent;
121962
- parent = parentIsRightChild ? grandparent.right : grandparent.left;
121963
- }
121964
- this._rotateSubtree(grandparent, !parentIsRightChild);
121965
- parent.red = false;
121966
- grandparent.red = true;
121967
- return;
121968
- }
121969
- parent.red = false;
121970
- uncle.red = false;
121971
- grandparent.red = true;
121972
- node = grandparent;
121973
- } while (node.parent ? parent = node.parent : false);
121974
- }
121975
- // based on https://en.wikipedia.org/wiki/Red%E2%80%93black_tree#Implementation
121976
- _rotateSubtree(node, right3) {
121977
- const parent = node.parent;
121978
- const newRoot = right3 ? node.left : node.right;
121979
- const newChild = right3 ? newRoot.right : newRoot.left;
121980
- node[right3 ? "left" : "right"] = newChild;
121981
- if (newChild) {
121982
- newChild.parent = node;
121983
- }
121984
- newRoot[right3 ? "right" : "left"] = node;
121985
- newRoot.parent = parent;
121986
- node.parent = newRoot;
121987
- if (parent) {
121988
- parent[node === parent.right ? "right" : "left"] = newRoot;
121989
- } else {
121990
- this._root = newRoot;
121991
- }
121992
- return newRoot;
121993
- }
121994
- // rebuild the whole tree from scratch, used to avoid too many deletion tombstones accumulating
121995
- _rebuild(records, parent, red) {
121996
- const {
121997
- length: length3
121998
- } = records;
121999
- if (!length3) {
122000
- return void 0;
122001
- }
122002
- const mid = length3 >>> 1;
122003
- const node = {
122004
- record: records[mid],
122005
- left: void 0,
122006
- right: void 0,
122007
- parent,
122008
- deleted: false,
122009
- red
122010
- };
122011
- const left3 = this._rebuild(records.slice(0, mid), node, !red);
122012
- const right3 = this._rebuild(records.slice(mid + 1), node, !red);
122013
- node.left = left3;
122014
- node.right = right3;
122015
- return node;
122016
- }
122017
- };
122018
-
122019
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/RecordStore.js
122020
- var RecordStore = class {
122021
- constructor(keysAreUnique) {
122022
- this.keysAreUnique = keysAreUnique;
122023
- this.records = new BinarySearchTree(this.keysAreUnique);
122024
- }
122025
- get(key) {
122026
- const range2 = key instanceof FDBKeyRange_default ? key : FDBKeyRange_default.only(key);
122027
- return this.records.getRecords(range2).next().value;
122028
- }
122029
- /**
122030
- * Put a new record, and return the overwritten record if an overwrite occurred.
122031
- * @param newRecord
122032
- * @param noOverwrite - throw a ConstraintError in case of overwrite
122033
- */
122034
- put(newRecord, noOverwrite = false) {
122035
- return this.records.put(newRecord, noOverwrite);
122036
- }
122037
- delete(key) {
122038
- const range2 = key instanceof FDBKeyRange_default ? key : FDBKeyRange_default.only(key);
122039
- const deletedRecords = [...this.records.getRecords(range2)];
122040
- for (const record4 of deletedRecords) {
122041
- this.records.delete(record4);
122042
- }
122043
- return deletedRecords;
122044
- }
122045
- deleteByValue(key) {
122046
- const range2 = key instanceof FDBKeyRange_default ? key : FDBKeyRange_default.only(key);
122047
- const deletedRecords = [];
122048
- for (const record4 of this.records.getAllRecords()) {
122049
- if (range2.includes(record4.value)) {
122050
- this.records.delete(record4);
122051
- deletedRecords.push(record4);
122052
- }
122053
- }
122054
- return deletedRecords;
122055
- }
122056
- clear() {
122057
- const deletedRecords = [...this.records.getAllRecords()];
122058
- this.records = new BinarySearchTree(this.keysAreUnique);
122059
- return deletedRecords;
122060
- }
122061
- values(range2, direction = "next") {
122062
- const descending = direction === "prev" || direction === "prevunique";
122063
- const records = range2 ? this.records.getRecords(range2, descending) : this.records.getAllRecords(descending);
122064
- return {
122065
- [Symbol.iterator]: () => {
122066
- const next4 = () => {
122067
- return records.next();
122068
- };
122069
- if (direction === "next" || direction === "prev") {
122070
- return {
122071
- next: next4
122072
- };
122073
- }
122074
- if (direction === "nextunique") {
122075
- let previousValue = void 0;
122076
- return {
122077
- next: () => {
122078
- let current2 = next4();
122079
- while (!current2.done && previousValue !== void 0 && cmp_default(previousValue.key, current2.value.key) === 0) {
122080
- current2 = next4();
122081
- }
122082
- previousValue = current2.value;
122083
- return current2;
122084
- }
122085
- };
122086
- }
122087
- let current = next4();
122088
- let nextResult = next4();
122089
- return {
122090
- next: () => {
122091
- while (!nextResult.done && cmp_default(current.value.key, nextResult.value.key) === 0) {
122092
- current = nextResult;
122093
- nextResult = next4();
122094
- }
122095
- const result = current;
122096
- current = nextResult;
122097
- nextResult = next4();
122098
- return result;
122099
- }
122100
- };
122101
- }
122102
- };
122103
- }
122104
- size() {
122105
- return this.records.size();
122106
- }
122107
- };
122108
- var RecordStore_default = RecordStore;
122109
-
122110
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/Index.js
122111
- var Index = class {
122112
- deleted = false;
122113
- // Initialized should be used to decide whether to throw an error or abort the versionchange transaction when there is a
122114
- // constraint
122115
- initialized = false;
122116
- constructor(rawObjectStore, name, keyPath, multiEntry, unique) {
122117
- this.rawObjectStore = rawObjectStore;
122118
- this.name = name;
122119
- this.keyPath = keyPath;
122120
- this.multiEntry = multiEntry;
122121
- this.unique = unique;
122122
- this.records = new RecordStore_default(unique);
122123
- }
122124
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#dfn-steps-for-retrieving-a-value-from-an-index
122125
- getKey(key) {
122126
- const record4 = this.records.get(key);
122127
- return record4 !== void 0 ? record4.value : void 0;
122128
- }
122129
- // http://w3c.github.io/IndexedDB/#retrieve-multiple-referenced-values-from-an-index
122130
- getAllKeys(range2, count3, direction) {
122131
- if (count3 === void 0 || count3 === 0) {
122132
- count3 = Infinity;
122133
- }
122134
- const records = [];
122135
- for (const record4 of this.records.values(range2, direction)) {
122136
- records.push(structuredClone(record4.value));
122137
- if (records.length >= count3) {
122138
- break;
122139
- }
122140
- }
122141
- return records;
122142
- }
122143
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#index-referenced-value-retrieval-operation
122144
- getValue(key) {
122145
- const record4 = this.records.get(key);
122146
- return record4 !== void 0 ? this.rawObjectStore.getValue(record4.value) : void 0;
122147
- }
122148
- // http://w3c.github.io/IndexedDB/#retrieve-multiple-referenced-values-from-an-index
122149
- getAllValues(range2, count3, direction) {
122150
- if (count3 === void 0 || count3 === 0) {
122151
- count3 = Infinity;
122152
- }
122153
- const records = [];
122154
- for (const record4 of this.records.values(range2, direction)) {
122155
- records.push(this.rawObjectStore.getValue(record4.value));
122156
- if (records.length >= count3) {
122157
- break;
122158
- }
122159
- }
122160
- return records;
122161
- }
122162
- // https://www.w3.org/TR/IndexedDB/#dom-idbindex-getallrecords
122163
- getAllRecords(range2, count3, direction) {
122164
- if (count3 === void 0 || count3 === 0) {
122165
- count3 = Infinity;
122166
- }
122167
- const records = [];
122168
- for (const record4 of this.records.values(range2, direction)) {
122169
- records.push(new FDBRecord_default(structuredClone(record4.key), structuredClone(this.rawObjectStore.getKey(record4.value)), this.rawObjectStore.getValue(record4.value)));
122170
- if (records.length >= count3) {
122171
- break;
122172
- }
122173
- }
122174
- return records;
122175
- }
122176
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#dfn-steps-for-storing-a-record-into-an-object-store (step 7)
122177
- storeRecord(newRecord) {
122178
- let indexKey;
122179
- try {
122180
- indexKey = extractKey_default(this.keyPath, newRecord.value).key;
122181
- } catch (err) {
122182
- if (err.name === "DataError") {
122183
- return;
122184
- }
122185
- throw err;
122186
- }
122187
- if (!this.multiEntry || !Array.isArray(indexKey)) {
122188
- try {
122189
- valueToKey_default(indexKey);
122190
- } catch (e) {
122191
- return;
122192
- }
122193
- } else {
122194
- const keep = [];
122195
- for (const part of indexKey) {
122196
- if (keep.indexOf(part) < 0) {
122197
- try {
122198
- keep.push(valueToKey_default(part));
122199
- } catch (err) {
122200
- }
122201
- }
122202
- }
122203
- indexKey = keep;
122204
- }
122205
- if (!this.multiEntry || !Array.isArray(indexKey)) {
122206
- if (this.unique) {
122207
- const existingRecord = this.records.get(indexKey);
122208
- if (existingRecord) {
122209
- throw new ConstraintError();
122210
- }
122211
- }
122212
- } else {
122213
- if (this.unique) {
122214
- for (const individualIndexKey of indexKey) {
122215
- const existingRecord = this.records.get(individualIndexKey);
122216
- if (existingRecord) {
122217
- throw new ConstraintError();
122218
- }
122219
- }
122220
- }
122221
- }
122222
- if (!this.multiEntry || !Array.isArray(indexKey)) {
122223
- this.records.put({
122224
- key: indexKey,
122225
- value: newRecord.key
122226
- });
122227
- } else {
122228
- for (const individualIndexKey of indexKey) {
122229
- this.records.put({
122230
- key: individualIndexKey,
122231
- value: newRecord.key
122232
- });
122233
- }
122234
- }
122235
- }
122236
- initialize(transaction) {
122237
- if (this.initialized) {
122238
- throw new Error("Index already initialized");
122239
- }
122240
- transaction._execRequestAsync({
122241
- operation: () => {
122242
- try {
122243
- for (const record4 of this.rawObjectStore.records.values()) {
122244
- this.storeRecord(record4);
122245
- }
122246
- this.initialized = true;
122247
- } catch (err) {
122248
- transaction._abort(err.name);
122249
- }
122250
- },
122251
- source: null
122252
- });
122253
- }
122254
- count(range2) {
122255
- let count3 = 0;
122256
- for (const record4 of this.records.values(range2)) {
122257
- count3 += 1;
122258
- }
122259
- return count3;
122260
- }
122261
- };
122262
- var Index_default = Index;
122263
-
122264
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/validateKeyPath.js
122265
- var validateKeyPath = (keyPath, parent) => {
122266
- if (keyPath !== void 0 && keyPath !== null && typeof keyPath !== "string" && keyPath.toString && (parent === "array" || !Array.isArray(keyPath))) {
122267
- keyPath = keyPath.toString();
122268
- }
122269
- if (typeof keyPath === "string") {
122270
- if (keyPath === "" && parent !== "string") {
122271
- return;
122272
- }
122273
- try {
122274
- const validIdentifierRegex = (
122275
- // eslint-disable-next-line no-misleading-character-class
122276
- /^(?:[$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC])(?:[$0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC])*$/
122277
- );
122278
- if (keyPath.length >= 1 && validIdentifierRegex.test(keyPath)) {
122279
- return;
122280
- }
122281
- } catch (err) {
122282
- throw new SyntaxError2(err.message);
122283
- }
122284
- if (keyPath.indexOf(" ") >= 0) {
122285
- throw new SyntaxError2("The keypath argument contains an invalid key path (no spaces allowed).");
122286
- }
122287
- }
122288
- if (Array.isArray(keyPath) && keyPath.length > 0) {
122289
- if (parent) {
122290
- throw new SyntaxError2("The keypath argument contains an invalid key path (nested arrays).");
122291
- }
122292
- for (const part of keyPath) {
122293
- validateKeyPath(part, "array");
122294
- }
122295
- return;
122296
- } else if (typeof keyPath === "string" && keyPath.indexOf(".") >= 0) {
122297
- keyPath = keyPath.split(".");
122298
- for (const part of keyPath) {
122299
- validateKeyPath(part, "string");
122300
- }
122301
- return;
122302
- }
122303
- throw new SyntaxError2();
122304
- };
122305
- var validateKeyPath_default = validateKeyPath;
122306
-
122307
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/FDBObjectStore.js
122308
- var confirmActiveTransaction2 = (objectStore) => {
122309
- if (objectStore._rawObjectStore.deleted) {
122310
- throw new InvalidStateError();
122311
- }
122312
- if (objectStore.transaction._state !== "active") {
122313
- throw new TransactionInactiveError();
122314
- }
122315
- };
122316
- var buildRecordAddPut = (objectStore, value3, key) => {
122317
- confirmActiveTransaction2(objectStore);
122318
- if (objectStore.transaction.mode === "readonly") {
122319
- throw new ReadOnlyError();
122320
- }
122321
- if (objectStore.keyPath !== null) {
122322
- if (key !== void 0) {
122323
- throw new DataError();
122324
- }
122325
- }
122326
- const clone4 = cloneValueForInsertion(value3, objectStore.transaction);
122327
- if (objectStore.keyPath !== null) {
122328
- const tempKey = extractKey_default(objectStore.keyPath, clone4);
122329
- if (tempKey.type === "found") {
122330
- valueToKey_default(tempKey.key);
122331
- } else {
122332
- if (!objectStore._rawObjectStore.keyGenerator) {
122333
- throw new DataError();
122334
- } else if (!canInjectKey_default(objectStore.keyPath, clone4)) {
122335
- throw new DataError();
122336
- }
122337
- }
122338
- }
122339
- if (objectStore.keyPath === null && objectStore._rawObjectStore.keyGenerator === null && key === void 0) {
122340
- throw new DataError();
122341
- }
122342
- if (key !== void 0) {
122343
- key = valueToKey_default(key);
122344
- }
122345
- return {
122346
- key,
122347
- value: clone4
122348
- };
122349
- };
122350
- var FDBObjectStore = class {
122351
- _indexesCache = /* @__PURE__ */ new Map();
122352
- constructor(transaction, rawObjectStore) {
122353
- this._rawObjectStore = rawObjectStore;
122354
- this._name = rawObjectStore.name;
122355
- this.keyPath = getKeyPath(rawObjectStore.keyPath);
122356
- this.autoIncrement = rawObjectStore.autoIncrement;
122357
- this.transaction = transaction;
122358
- this.indexNames = new FakeDOMStringList_default(...Array.from(rawObjectStore.rawIndexes.keys()).sort());
122359
- }
122360
- get name() {
122361
- return this._name;
122362
- }
122363
- // http://w3c.github.io/IndexedDB/#dom-idbobjectstore-name
122364
- set name(name) {
122365
- const transaction = this.transaction;
122366
- if (!transaction.db._runningVersionchangeTransaction) {
122367
- throw transaction._state === "active" ? new InvalidStateError() : new TransactionInactiveError();
122368
- }
122369
- confirmActiveTransaction2(this);
122370
- name = String(name);
122371
- if (name === this._name) {
122372
- return;
122373
- }
122374
- if (this._rawObjectStore.rawDatabase.rawObjectStores.has(name)) {
122375
- throw new ConstraintError();
122376
- }
122377
- const oldName = this._name;
122378
- const oldObjectStoreNames = [...transaction.db.objectStoreNames];
122379
- this._name = name;
122380
- this._rawObjectStore.name = name;
122381
- this.transaction._objectStoresCache.delete(oldName);
122382
- this.transaction._objectStoresCache.set(name, this);
122383
- this._rawObjectStore.rawDatabase.rawObjectStores.delete(oldName);
122384
- this._rawObjectStore.rawDatabase.rawObjectStores.set(name, this._rawObjectStore);
122385
- transaction.db.objectStoreNames = new FakeDOMStringList_default(...Array.from(this._rawObjectStore.rawDatabase.rawObjectStores.keys()).filter((objectStoreName) => {
122386
- const objectStore = this._rawObjectStore.rawDatabase.rawObjectStores.get(objectStoreName);
122387
- return objectStore && !objectStore.deleted;
122388
- }).sort());
122389
- const oldScope = new Set(transaction._scope);
122390
- const oldTransactionObjectStoreNames = [...transaction.objectStoreNames];
122391
- this.transaction._scope.delete(oldName);
122392
- transaction._scope.add(name);
122393
- transaction.objectStoreNames = new FakeDOMStringList_default(...Array.from(transaction._scope).sort());
122394
- if (!this.transaction._createdObjectStores.has(this._rawObjectStore)) {
122395
- transaction._rollbackLog.push(() => {
122396
- this._name = oldName;
122397
- this._rawObjectStore.name = oldName;
122398
- this.transaction._objectStoresCache.delete(name);
122399
- this.transaction._objectStoresCache.set(oldName, this);
122400
- this._rawObjectStore.rawDatabase.rawObjectStores.delete(name);
122401
- this._rawObjectStore.rawDatabase.rawObjectStores.set(oldName, this._rawObjectStore);
122402
- transaction.db.objectStoreNames = new FakeDOMStringList_default(...oldObjectStoreNames);
122403
- transaction._scope = oldScope;
122404
- transaction.objectStoreNames = new FakeDOMStringList_default(...oldTransactionObjectStoreNames);
122405
- });
122406
- }
122407
- }
122408
- put(value3, key) {
122409
- if (arguments.length === 0) {
122410
- throw new TypeError();
122411
- }
122412
- const record4 = buildRecordAddPut(this, value3, key);
122413
- return this.transaction._execRequestAsync({
122414
- operation: this._rawObjectStore.storeRecord.bind(this._rawObjectStore, record4, false, this.transaction._rollbackLog),
122415
- source: this
122416
- });
122417
- }
122418
- add(value3, key) {
122419
- if (arguments.length === 0) {
122420
- throw new TypeError();
122421
- }
122422
- const record4 = buildRecordAddPut(this, value3, key);
122423
- return this.transaction._execRequestAsync({
122424
- operation: this._rawObjectStore.storeRecord.bind(this._rawObjectStore, record4, true, this.transaction._rollbackLog),
122425
- source: this
122426
- });
122427
- }
122428
- delete(key) {
122429
- if (arguments.length === 0) {
122430
- throw new TypeError();
122431
- }
122432
- confirmActiveTransaction2(this);
122433
- if (this.transaction.mode === "readonly") {
122434
- throw new ReadOnlyError();
122435
- }
122436
- if (!(key instanceof FDBKeyRange_default)) {
122437
- key = valueToKey_default(key);
122438
- }
122439
- return this.transaction._execRequestAsync({
122440
- operation: this._rawObjectStore.deleteRecord.bind(this._rawObjectStore, key, this.transaction._rollbackLog),
122441
- source: this
122442
- });
122443
- }
122444
- get(key) {
122445
- if (arguments.length === 0) {
122446
- throw new TypeError();
122447
- }
122448
- confirmActiveTransaction2(this);
122449
- if (!(key instanceof FDBKeyRange_default)) {
122450
- key = valueToKey_default(key);
122451
- }
122452
- return this.transaction._execRequestAsync({
122453
- operation: this._rawObjectStore.getValue.bind(this._rawObjectStore, key),
122454
- source: this
122455
- });
122456
- }
122457
- // http://w3c.github.io/IndexedDB/#dom-idbobjectstore-getall
122458
- getAll(queryOrOptions, count3) {
122459
- const options = extractGetAllOptions_default(queryOrOptions, count3, arguments.length);
122460
- confirmActiveTransaction2(this);
122461
- const range2 = valueToKeyRange_default(options.query);
122462
- return this.transaction._execRequestAsync({
122463
- operation: this._rawObjectStore.getAllValues.bind(this._rawObjectStore, range2, options.count, options.direction),
122464
- source: this
122465
- });
122466
- }
122467
- // http://w3c.github.io/IndexedDB/#dom-idbobjectstore-getkey
122468
- getKey(key) {
122469
- if (arguments.length === 0) {
122470
- throw new TypeError();
122471
- }
122472
- confirmActiveTransaction2(this);
122473
- if (!(key instanceof FDBKeyRange_default)) {
122474
- key = valueToKey_default(key);
122475
- }
122476
- return this.transaction._execRequestAsync({
122477
- operation: this._rawObjectStore.getKey.bind(this._rawObjectStore, key),
122478
- source: this
122479
- });
122480
- }
122481
- // http://w3c.github.io/IndexedDB/#dom-idbobjectstore-getallkeys
122482
- getAllKeys(queryOrOptions, count3) {
122483
- const options = extractGetAllOptions_default(queryOrOptions, count3, arguments.length);
122484
- confirmActiveTransaction2(this);
122485
- const range2 = valueToKeyRange_default(options.query);
122486
- return this.transaction._execRequestAsync({
122487
- operation: this._rawObjectStore.getAllKeys.bind(this._rawObjectStore, range2, options.count, options.direction),
122488
- source: this
122489
- });
122490
- }
122491
- // https://www.w3.org/TR/IndexedDB/#dom-idbobjectstore-getallrecords
122492
- getAllRecords(options) {
122493
- let query;
122494
- let count3;
122495
- let direction;
122496
- if (options !== void 0) {
122497
- if (options.query !== void 0) {
122498
- query = options.query;
122499
- }
122500
- if (options.count !== void 0) {
122501
- count3 = enforceRange_default(options.count, "unsigned long");
122502
- }
122503
- if (options.direction !== void 0) {
122504
- direction = options.direction;
122505
- }
122506
- }
122507
- confirmActiveTransaction2(this);
122508
- const range2 = valueToKeyRange_default(query);
122509
- return this.transaction._execRequestAsync({
122510
- operation: this._rawObjectStore.getAllRecords.bind(this._rawObjectStore, range2, count3, direction),
122511
- source: this
122512
- });
122513
- }
122514
- clear() {
122515
- confirmActiveTransaction2(this);
122516
- if (this.transaction.mode === "readonly") {
122517
- throw new ReadOnlyError();
122518
- }
122519
- return this.transaction._execRequestAsync({
122520
- operation: this._rawObjectStore.clear.bind(this._rawObjectStore, this.transaction._rollbackLog),
122521
- source: this
122522
- });
122523
- }
122524
- openCursor(range2, direction) {
122525
- confirmActiveTransaction2(this);
122526
- if (range2 === null) {
122527
- range2 = void 0;
122528
- }
122529
- if (range2 !== void 0 && !(range2 instanceof FDBKeyRange_default)) {
122530
- range2 = FDBKeyRange_default.only(valueToKey_default(range2));
122531
- }
122532
- const request2 = new FDBRequest_default();
122533
- request2.source = this;
122534
- request2.transaction = this.transaction;
122535
- const cursor = new FDBCursorWithValue_default(this, range2, direction, request2);
122536
- return this.transaction._execRequestAsync({
122537
- operation: cursor._iterate.bind(cursor),
122538
- request: request2,
122539
- source: this
122540
- });
122541
- }
122542
- openKeyCursor(range2, direction) {
122543
- confirmActiveTransaction2(this);
122544
- if (range2 === null) {
122545
- range2 = void 0;
122546
- }
122547
- if (range2 !== void 0 && !(range2 instanceof FDBKeyRange_default)) {
122548
- range2 = FDBKeyRange_default.only(valueToKey_default(range2));
122549
- }
122550
- const request2 = new FDBRequest_default();
122551
- request2.source = this;
122552
- request2.transaction = this.transaction;
122553
- const cursor = new FDBCursor_default(this, range2, direction, request2, true);
122554
- return this.transaction._execRequestAsync({
122555
- operation: cursor._iterate.bind(cursor),
122556
- request: request2,
122557
- source: this
122558
- });
122559
- }
122560
- // tslint:-next-line max-line-length
122561
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#widl-IDBObjectStore-createIndex-IDBIndex-DOMString-name-DOMString-sequence-DOMString--keyPath-IDBIndexParameters-optionalParameters
122562
- createIndex(name, keyPath, optionalParameters = {}) {
122563
- if (arguments.length < 2) {
122564
- throw new TypeError();
122565
- }
122566
- const multiEntry = optionalParameters.multiEntry !== void 0 ? optionalParameters.multiEntry : false;
122567
- const unique = optionalParameters.unique !== void 0 ? optionalParameters.unique : false;
122568
- if (this.transaction.mode !== "versionchange") {
122569
- throw new InvalidStateError();
122570
- }
122571
- confirmActiveTransaction2(this);
122572
- if (this.indexNames.contains(name)) {
122573
- throw new ConstraintError();
122574
- }
122575
- validateKeyPath_default(keyPath);
122576
- if (Array.isArray(keyPath) && multiEntry) {
122577
- throw new InvalidAccessError();
122578
- }
122579
- const indexNames = [...this.indexNames];
122580
- const index = new Index_default(this._rawObjectStore, name, keyPath, multiEntry, unique);
122581
- this.indexNames._push(name);
122582
- this.indexNames._sort();
122583
- this.transaction._createdIndexes.add(index);
122584
- this._rawObjectStore.rawIndexes.set(name, index);
122585
- index.initialize(this.transaction);
122586
- this.transaction._rollbackLog.push(() => {
122587
- index.deleted = true;
122588
- this.indexNames = new FakeDOMStringList_default(...indexNames);
122589
- this._rawObjectStore.rawIndexes.delete(index.name);
122590
- });
122591
- return new FDBIndex_default(this, index);
122592
- }
122593
- // https://w3c.github.io/IndexedDB/#dom-idbobjectstore-index
122594
- index(name) {
122595
- if (arguments.length === 0) {
122596
- throw new TypeError();
122597
- }
122598
- if (this._rawObjectStore.deleted || this.transaction._state === "finished") {
122599
- throw new InvalidStateError();
122600
- }
122601
- const index = this._indexesCache.get(name);
122602
- if (index !== void 0) {
122603
- return index;
122604
- }
122605
- const rawIndex = this._rawObjectStore.rawIndexes.get(name);
122606
- if (!this.indexNames.contains(name) || rawIndex === void 0) {
122607
- throw new NotFoundError();
122608
- }
122609
- const index2 = new FDBIndex_default(this, rawIndex);
122610
- this._indexesCache.set(name, index2);
122611
- return index2;
122612
- }
122613
- deleteIndex(name) {
122614
- if (arguments.length === 0) {
122615
- throw new TypeError();
122616
- }
122617
- if (this.transaction.mode !== "versionchange") {
122618
- throw new InvalidStateError();
122619
- }
122620
- confirmActiveTransaction2(this);
122621
- const rawIndex = this._rawObjectStore.rawIndexes.get(name);
122622
- if (rawIndex === void 0) {
122623
- throw new NotFoundError();
122624
- }
122625
- this.transaction._rollbackLog.push(() => {
122626
- rawIndex.deleted = false;
122627
- this._rawObjectStore.rawIndexes.set(rawIndex.name, rawIndex);
122628
- this.indexNames._push(rawIndex.name);
122629
- this.indexNames._sort();
122630
- });
122631
- this.indexNames = new FakeDOMStringList_default(...Array.from(this.indexNames).filter((indexName) => {
122632
- return indexName !== name;
122633
- }));
122634
- rawIndex.deleted = true;
122635
- this.transaction._execRequestAsync({
122636
- operation: () => {
122637
- const rawIndex2 = this._rawObjectStore.rawIndexes.get(name);
122638
- if (rawIndex === rawIndex2) {
122639
- this._rawObjectStore.rawIndexes.delete(name);
122640
- }
122641
- },
122642
- source: this
122643
- });
122644
- }
122645
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#widl-IDBObjectStore-count-IDBRequest-any-key
122646
- count(key) {
122647
- confirmActiveTransaction2(this);
122648
- if (key === null) {
122649
- key = void 0;
122650
- }
122651
- if (key !== void 0 && !(key instanceof FDBKeyRange_default)) {
122652
- key = FDBKeyRange_default.only(valueToKey_default(key));
122653
- }
122654
- return this.transaction._execRequestAsync({
122655
- operation: () => {
122656
- return this._rawObjectStore.count(key);
122657
- },
122658
- source: this
122659
- });
122660
- }
122661
- get [Symbol.toStringTag]() {
122662
- return "IDBObjectStore";
122663
- }
122664
- };
122665
- var FDBObjectStore_default = FDBObjectStore;
122666
-
122667
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/FakeEvent.js
122668
- var Event2 = class {
122669
- eventPath = [];
122670
- NONE = 0;
122671
- CAPTURING_PHASE = 1;
122672
- AT_TARGET = 2;
122673
- BUBBLING_PHASE = 3;
122674
- // Flags
122675
- propagationStopped = false;
122676
- immediatePropagationStopped = false;
122677
- canceled = false;
122678
- initialized = true;
122679
- dispatched = false;
122680
- target = null;
122681
- currentTarget = null;
122682
- eventPhase = 0;
122683
- defaultPrevented = false;
122684
- isTrusted = false;
122685
- timeStamp = Date.now();
122686
- constructor(type, eventInitDict = {}) {
122687
- this.type = type;
122688
- this.bubbles = eventInitDict.bubbles !== void 0 ? eventInitDict.bubbles : false;
122689
- this.cancelable = eventInitDict.cancelable !== void 0 ? eventInitDict.cancelable : false;
122690
- }
122691
- preventDefault() {
122692
- if (this.cancelable) {
122693
- this.canceled = true;
122694
- }
122695
- }
122696
- stopPropagation() {
122697
- this.propagationStopped = true;
122698
- }
122699
- stopImmediatePropagation() {
122700
- this.propagationStopped = true;
122701
- this.immediatePropagationStopped = true;
122702
- }
122703
- };
122704
- var FakeEvent_default = Event2;
122705
-
122706
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/scheduling.js
122707
- function getSetImmediateFromJsdom() {
122708
- if (typeof navigator !== "undefined" && /jsdom/.test(navigator.userAgent)) {
122709
- const outerRealmFunctionConstructor = Node.constructor;
122710
- return new outerRealmFunctionConstructor("return setImmediate")();
122711
- } else {
122712
- return void 0;
122713
- }
122714
- }
122715
- var schedulerPostTask = typeof scheduler !== "undefined" && ((fn2) => scheduler.postTask(fn2));
122716
- var doSetTimeout = (fn2) => setTimeout(fn2, 0);
122717
- var queueTask = (fn2) => {
122718
- const setImmediate3 = globalThis.setImmediate || getSetImmediateFromJsdom() || schedulerPostTask || doSetTimeout;
122719
- setImmediate3(fn2);
122720
- };
122721
-
122722
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/FDBTransaction.js
122723
- var prioritizedListenerTypes = ["error", "abort", "complete"];
122724
- var FDBTransaction = class extends FakeEventTarget_default {
122725
- _state = "active";
122726
- _started = false;
122727
- _rollbackLog = [];
122728
- _objectStoresCache = /* @__PURE__ */ new Map();
122729
- _openRequest = null;
122730
- error = null;
122731
- onabort = null;
122732
- oncomplete = null;
122733
- onerror = null;
122734
- _prioritizedListeners = /* @__PURE__ */ new Map();
122735
- _requests = [];
122736
- _createdIndexes = /* @__PURE__ */ new Set();
122737
- _createdObjectStores = /* @__PURE__ */ new Set();
122738
- constructor(storeNames, mode, durability, db) {
122739
- super();
122740
- this._scope = new Set(storeNames);
122741
- this.mode = mode;
122742
- this.durability = durability;
122743
- this.db = db;
122744
- this.objectStoreNames = new FakeDOMStringList_default(...Array.from(this._scope).sort());
122745
- for (const type of prioritizedListenerTypes) {
122746
- this.addEventListener(type, () => {
122747
- this._prioritizedListeners.get(type)?.();
122748
- });
122749
- }
122750
- }
122751
- // https://w3c.github.io/IndexedDB/#abort-transaction
122752
- _abort(errName) {
122753
- for (const f of this._rollbackLog.reverse()) {
122754
- f();
122755
- }
122756
- if (errName !== null) {
122757
- const e = new DOMException(void 0, errName);
122758
- this.error = e;
122759
- }
122760
- for (const {
122761
- request: request2
122762
- } of this._requests) {
122763
- if (request2.readyState !== "done") {
122764
- request2.readyState = "done";
122765
- if (request2.source) {
122766
- queueTask(() => {
122767
- request2.result = void 0;
122768
- request2.error = new AbortError();
122769
- const event = new FakeEvent_default("error", {
122770
- bubbles: true,
122771
- cancelable: true
122772
- });
122773
- event.eventPath = [this.db, this];
122774
- try {
122775
- request2.dispatchEvent(event);
122776
- } catch (_err) {
122777
- if (this._state === "active") {
122778
- this._abort("AbortError");
122779
- }
122780
- }
122781
- });
122782
- }
122783
- }
122784
- }
122785
- queueTask(() => {
122786
- const isUpgradeTransaction = this.mode === "versionchange";
122787
- if (isUpgradeTransaction) {
122788
- this.db._rawDatabase.connections = this.db._rawDatabase.connections.filter((connection) => !connection._rawDatabase.transactions.includes(this));
122789
- }
122790
- const event = new FakeEvent_default("abort", {
122791
- bubbles: true,
122792
- cancelable: false
122793
- });
122794
- event.eventPath = [this.db];
122795
- this.dispatchEvent(event);
122796
- if (isUpgradeTransaction) {
122797
- const request2 = this._openRequest;
122798
- request2.transaction = null;
122799
- request2.result = void 0;
122800
- }
122801
- });
122802
- this._state = "finished";
122803
- }
122804
- abort() {
122805
- if (this._state === "committing" || this._state === "finished") {
122806
- throw new InvalidStateError();
122807
- }
122808
- this._state = "active";
122809
- this._abort(null);
122810
- }
122811
- // http://w3c.github.io/IndexedDB/#dom-idbtransaction-objectstore
122812
- objectStore(name) {
122813
- if (this._state !== "active") {
122814
- throw new InvalidStateError();
122815
- }
122816
- const objectStore = this._objectStoresCache.get(name);
122817
- if (objectStore !== void 0) {
122818
- return objectStore;
122819
- }
122820
- const rawObjectStore = this.db._rawDatabase.rawObjectStores.get(name);
122821
- if (!this._scope.has(name) || rawObjectStore === void 0) {
122822
- throw new NotFoundError();
122823
- }
122824
- const objectStore2 = new FDBObjectStore_default(this, rawObjectStore);
122825
- this._objectStoresCache.set(name, objectStore2);
122826
- return objectStore2;
122827
- }
122828
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#dfn-steps-for-asynchronously-executing-a-request
122829
- _execRequestAsync(obj) {
122830
- const source = obj.source;
122831
- const operation = obj.operation;
122832
- let request2 = Object.hasOwn(obj, "request") ? obj.request : null;
122833
- if (this._state !== "active") {
122834
- throw new TransactionInactiveError();
122835
- }
122836
- if (!request2) {
122837
- if (!source) {
122838
- request2 = new FDBRequest_default();
122839
- } else {
122840
- request2 = new FDBRequest_default();
122841
- request2.source = source;
122842
- request2.transaction = source.transaction;
122843
- }
122844
- }
122845
- this._requests.push({
122846
- operation,
122847
- request: request2
122848
- });
122849
- return request2;
122850
- }
122851
- _start() {
122852
- this._started = true;
122853
- let operation;
122854
- let request2;
122855
- while (this._requests.length > 0) {
122856
- const r = this._requests.shift();
122857
- if (r && r.request.readyState !== "done") {
122858
- request2 = r.request;
122859
- operation = r.operation;
122860
- break;
122861
- }
122862
- }
122863
- if (request2 && operation) {
122864
- if (!request2.source) {
122865
- operation();
122866
- } else {
122867
- let defaultAction;
122868
- let event;
122869
- try {
122870
- const result = operation();
122871
- request2.readyState = "done";
122872
- request2.result = result;
122873
- request2.error = void 0;
122874
- if (this._state === "inactive") {
122875
- this._state = "active";
122876
- }
122877
- event = new FakeEvent_default("success", {
122878
- bubbles: false,
122879
- cancelable: false
122880
- });
122881
- } catch (err) {
122882
- request2.readyState = "done";
122883
- request2.result = void 0;
122884
- request2.error = err;
122885
- if (this._state === "inactive") {
122886
- this._state = "active";
122887
- }
122888
- event = new FakeEvent_default("error", {
122889
- bubbles: true,
122890
- cancelable: true
122891
- });
122892
- defaultAction = this._abort.bind(this, err.name);
122893
- }
122894
- try {
122895
- event.eventPath = [this.db, this];
122896
- request2.dispatchEvent(event);
122897
- } catch (_err) {
122898
- if (this._state === "active") {
122899
- this._abort("AbortError");
122900
- defaultAction = void 0;
122901
- }
122902
- }
122903
- if (!event.canceled) {
122904
- if (defaultAction) {
122905
- defaultAction();
122906
- }
122907
- }
122908
- }
122909
- queueTask(this._start.bind(this));
122910
- return;
122911
- }
122912
- if (this._state !== "finished") {
122913
- this._state = "finished";
122914
- if (!this.error) {
122915
- const event = new FakeEvent_default("complete");
122916
- this.dispatchEvent(event);
122917
- }
122918
- }
122919
- }
122920
- commit() {
122921
- if (this._state !== "active") {
122922
- throw new InvalidStateError();
122923
- }
122924
- this._state = "committing";
122925
- }
122926
- get [Symbol.toStringTag]() {
122927
- return "IDBTransaction";
122928
- }
122929
- };
122930
- var FDBTransaction_default = FDBTransaction;
122931
-
122932
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/KeyGenerator.js
122933
- var MAX_KEY = 9007199254740992;
122934
- var KeyGenerator = class {
122935
- // This is kind of wrong. Should start at 1 and increment only after record is saved
122936
- num = 0;
122937
- next() {
122938
- if (this.num >= MAX_KEY) {
122939
- throw new ConstraintError();
122940
- }
122941
- this.num += 1;
122942
- return this.num;
122943
- }
122944
- // https://w3c.github.io/IndexedDB/#possibly-update-the-key-generator
122945
- setIfLarger(num) {
122946
- const value3 = Math.floor(Math.min(num, MAX_KEY)) - 1;
122947
- if (value3 >= this.num) {
122948
- this.num = value3 + 1;
122949
- }
122950
- }
122951
- };
122952
- var KeyGenerator_default = KeyGenerator;
122953
-
122954
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/ObjectStore.js
122955
- var ObjectStore = class {
122956
- deleted = false;
122957
- records = new RecordStore_default(true);
122958
- rawIndexes = /* @__PURE__ */ new Map();
122959
- constructor(rawDatabase, name, keyPath, autoIncrement) {
122960
- this.rawDatabase = rawDatabase;
122961
- this.keyGenerator = autoIncrement === true ? new KeyGenerator_default() : null;
122962
- this.deleted = false;
122963
- this.name = name;
122964
- this.keyPath = keyPath;
122965
- this.autoIncrement = autoIncrement;
122966
- }
122967
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#dfn-steps-for-retrieving-a-value-from-an-object-store
122968
- getKey(key) {
122969
- const record4 = this.records.get(key);
122970
- return record4 !== void 0 ? structuredClone(record4.key) : void 0;
122971
- }
122972
- // http://w3c.github.io/IndexedDB/#retrieve-multiple-keys-from-an-object-store
122973
- getAllKeys(range2, count3, direction) {
122974
- if (count3 === void 0 || count3 === 0) {
122975
- count3 = Infinity;
122976
- }
122977
- const records = [];
122978
- for (const record4 of this.records.values(range2, direction)) {
122979
- records.push(structuredClone(record4.key));
122980
- if (records.length >= count3) {
122981
- break;
122982
- }
122983
- }
122984
- return records;
122985
- }
122986
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#dfn-steps-for-retrieving-a-value-from-an-object-store
122987
- getValue(key) {
122988
- const record4 = this.records.get(key);
122989
- return record4 !== void 0 ? structuredClone(record4.value) : void 0;
122990
- }
122991
- // http://w3c.github.io/IndexedDB/#retrieve-multiple-values-from-an-object-store
122992
- getAllValues(range2, count3, direction) {
122993
- if (count3 === void 0 || count3 === 0) {
122994
- count3 = Infinity;
122995
- }
122996
- const records = [];
122997
- for (const record4 of this.records.values(range2, direction)) {
122998
- records.push(structuredClone(record4.value));
122999
- if (records.length >= count3) {
123000
- break;
123001
- }
123002
- }
123003
- return records;
123004
- }
123005
- // https://www.w3.org/TR/IndexedDB/#dom-idbobjectstore-getallrecords
123006
- getAllRecords(range2, count3, direction) {
123007
- if (count3 === void 0 || count3 === 0) {
123008
- count3 = Infinity;
123009
- }
123010
- const records = [];
123011
- for (const record4 of this.records.values(range2, direction)) {
123012
- records.push(new FDBRecord_default(structuredClone(record4.key), structuredClone(record4.key), structuredClone(record4.value)));
123013
- if (records.length >= count3) {
123014
- break;
123015
- }
123016
- }
123017
- return records;
123018
- }
123019
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#dfn-steps-for-storing-a-record-into-an-object-store
123020
- storeRecord(newRecord, noOverwrite, rollbackLog) {
123021
- if (this.keyPath !== null) {
123022
- const key = extractKey_default(this.keyPath, newRecord.value).key;
123023
- if (key !== void 0) {
123024
- newRecord.key = key;
123025
- }
123026
- }
123027
- const rollbackLogForThisOperation = [];
123028
- if (this.keyGenerator !== null && newRecord.key === void 0) {
123029
- let rolledBack2 = false;
123030
- const keyGeneratorBefore = this.keyGenerator.num;
123031
- const rollbackKeyGenerator = () => {
123032
- if (rolledBack2) {
123033
- return;
123034
- }
123035
- rolledBack2 = true;
123036
- if (this.keyGenerator) {
123037
- this.keyGenerator.num = keyGeneratorBefore;
123038
- }
123039
- };
123040
- rollbackLogForThisOperation.push(rollbackKeyGenerator);
123041
- if (rollbackLog) {
123042
- rollbackLog.push(rollbackKeyGenerator);
123043
- }
123044
- newRecord.key = this.keyGenerator.next();
123045
- if (this.keyPath !== null) {
123046
- if (Array.isArray(this.keyPath)) {
123047
- throw new Error("Cannot have an array key path in an object store with a key generator");
123048
- }
123049
- let remainingKeyPath = this.keyPath;
123050
- let object4 = newRecord.value;
123051
- let identifier2;
123052
- let i = 0;
123053
- while (i >= 0) {
123054
- if (typeof object4 !== "object") {
123055
- throw new DataError();
123056
- }
123057
- i = remainingKeyPath.indexOf(".");
123058
- if (i >= 0) {
123059
- identifier2 = remainingKeyPath.slice(0, i);
123060
- remainingKeyPath = remainingKeyPath.slice(i + 1);
123061
- if (!Object.hasOwn(object4, identifier2)) {
123062
- Object.defineProperty(object4, identifier2, {
123063
- configurable: true,
123064
- enumerable: true,
123065
- writable: true,
123066
- value: {}
123067
- });
123068
- }
123069
- object4 = object4[identifier2];
123070
- }
123071
- }
123072
- identifier2 = remainingKeyPath;
123073
- Object.defineProperty(object4, identifier2, {
123074
- configurable: true,
123075
- enumerable: true,
123076
- writable: true,
123077
- value: newRecord.key
123078
- });
123079
- }
123080
- } else if (this.keyGenerator !== null && typeof newRecord.key === "number") {
123081
- this.keyGenerator.setIfLarger(newRecord.key);
123082
- }
123083
- const existingRecord = this.records.put(newRecord, noOverwrite);
123084
- let rolledBack = false;
123085
- const rollbackStoreRecord = () => {
123086
- if (rolledBack) {
123087
- return;
123088
- }
123089
- rolledBack = true;
123090
- if (existingRecord) {
123091
- this.storeRecord(existingRecord, false);
123092
- } else {
123093
- this.deleteRecord(newRecord.key);
123094
- }
123095
- };
123096
- rollbackLogForThisOperation.push(rollbackStoreRecord);
123097
- if (rollbackLog) {
123098
- rollbackLog.push(rollbackStoreRecord);
123099
- }
123100
- if (existingRecord) {
123101
- for (const rawIndex of this.rawIndexes.values()) {
123102
- rawIndex.records.deleteByValue(newRecord.key);
123103
- }
123104
- }
123105
- try {
123106
- for (const rawIndex of this.rawIndexes.values()) {
123107
- if (rawIndex.initialized) {
123108
- rawIndex.storeRecord(newRecord);
123109
- }
123110
- }
123111
- } catch (err) {
123112
- if (err.name === "ConstraintError") {
123113
- for (const rollback of rollbackLogForThisOperation) {
123114
- rollback();
123115
- }
123116
- }
123117
- throw err;
123118
- }
123119
- return newRecord.key;
123120
- }
123121
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#dfn-steps-for-deleting-records-from-an-object-store
123122
- deleteRecord(key, rollbackLog) {
123123
- const deletedRecords = this.records.delete(key);
123124
- if (rollbackLog) {
123125
- for (const record4 of deletedRecords) {
123126
- rollbackLog.push(() => {
123127
- this.storeRecord(record4, true);
123128
- });
123129
- }
123130
- }
123131
- for (const rawIndex of this.rawIndexes.values()) {
123132
- rawIndex.records.deleteByValue(key);
123133
- }
123134
- }
123135
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#dfn-steps-for-clearing-an-object-store
123136
- clear(rollbackLog) {
123137
- const deletedRecords = this.records.clear();
123138
- if (rollbackLog) {
123139
- for (const record4 of deletedRecords) {
123140
- rollbackLog.push(() => {
123141
- this.storeRecord(record4, true);
123142
- });
123143
- }
123144
- }
123145
- for (const rawIndex of this.rawIndexes.values()) {
123146
- rawIndex.records.clear();
123147
- }
123148
- }
123149
- count(range2) {
123150
- if (range2 === void 0 || range2.lower === void 0 && range2.upper === void 0) {
123151
- return this.records.size();
123152
- }
123153
- let count3 = 0;
123154
- for (const record4 of this.records.values(range2)) {
123155
- count3 += 1;
123156
- }
123157
- return count3;
123158
- }
123159
- };
123160
- var ObjectStore_default = ObjectStore;
123161
-
123162
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/closeConnection.js
123163
- var closeConnection = (connection, forced2 = false) => {
123164
- connection._closePending = true;
123165
- const transactionsComplete = connection._rawDatabase.transactions.every((transaction) => {
123166
- return transaction._state === "finished";
123167
- });
123168
- if (transactionsComplete) {
123169
- connection._closed = true;
123170
- connection._rawDatabase.connections = connection._rawDatabase.connections.filter((otherConnection) => {
123171
- return connection !== otherConnection;
123172
- });
123173
- if (forced2) {
123174
- const event = new FakeEvent_default("close", {
123175
- bubbles: false,
123176
- cancelable: false
123177
- });
123178
- event.eventPath = [];
123179
- connection.dispatchEvent(event);
123180
- }
123181
- } else {
123182
- queueTask(() => {
123183
- closeConnection(connection, forced2);
123184
- });
123185
- }
123186
- };
123187
- var closeConnection_default = closeConnection;
123188
-
123189
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/FDBDatabase.js
123190
- var confirmActiveVersionchangeTransaction = (database) => {
123191
- let transaction;
123192
- if (database._runningVersionchangeTransaction) {
123193
- transaction = database._rawDatabase.transactions.findLast((tx) => {
123194
- return tx.mode === "versionchange";
123195
- });
123196
- }
123197
- if (!transaction) {
123198
- throw new InvalidStateError();
123199
- }
123200
- if (transaction._state !== "active") {
123201
- throw new TransactionInactiveError();
123202
- }
123203
- return transaction;
123204
- };
123205
- var FDBDatabase = class extends FakeEventTarget_default {
123206
- _closePending = false;
123207
- _closed = false;
123208
- _runningVersionchangeTransaction = false;
123209
- constructor(rawDatabase) {
123210
- super();
123211
- this._rawDatabase = rawDatabase;
123212
- this._rawDatabase.connections.push(this);
123213
- this.name = rawDatabase.name;
123214
- this.version = rawDatabase.version;
123215
- this.objectStoreNames = new FakeDOMStringList_default(...Array.from(rawDatabase.rawObjectStores.keys()).sort());
123216
- }
123217
- // http://w3c.github.io/IndexedDB/#dom-idbdatabase-createobjectstore
123218
- createObjectStore(name, options = {}) {
123219
- if (name === void 0) {
123220
- throw new TypeError();
123221
- }
123222
- const transaction = confirmActiveVersionchangeTransaction(this);
123223
- const keyPath = options !== null && options.keyPath !== void 0 ? options.keyPath : null;
123224
- const autoIncrement = options !== null && options.autoIncrement !== void 0 ? options.autoIncrement : false;
123225
- if (keyPath !== null) {
123226
- validateKeyPath_default(keyPath);
123227
- }
123228
- if (this._rawDatabase.rawObjectStores.has(name)) {
123229
- throw new ConstraintError();
123230
- }
123231
- if (autoIncrement && (keyPath === "" || Array.isArray(keyPath))) {
123232
- throw new InvalidAccessError();
123233
- }
123234
- const objectStoreNames = [...this.objectStoreNames];
123235
- const transactionObjectStoreNames = [...transaction.objectStoreNames];
123236
- const rawObjectStore = new ObjectStore_default(this._rawDatabase, name, keyPath, autoIncrement);
123237
- this.objectStoreNames._push(name);
123238
- this.objectStoreNames._sort();
123239
- transaction._scope.add(name);
123240
- transaction._createdObjectStores.add(rawObjectStore);
123241
- this._rawDatabase.rawObjectStores.set(name, rawObjectStore);
123242
- transaction.objectStoreNames = new FakeDOMStringList_default(...this.objectStoreNames);
123243
- transaction._rollbackLog.push(() => {
123244
- rawObjectStore.deleted = true;
123245
- this.objectStoreNames = new FakeDOMStringList_default(...objectStoreNames);
123246
- transaction.objectStoreNames = new FakeDOMStringList_default(...transactionObjectStoreNames);
123247
- transaction._scope.delete(rawObjectStore.name);
123248
- this._rawDatabase.rawObjectStores.delete(rawObjectStore.name);
123249
- });
123250
- return transaction.objectStore(name);
123251
- }
123252
- // https://www.w3.org/TR/IndexedDB/#dom-idbdatabase-deleteobjectstore
123253
- deleteObjectStore(name) {
123254
- if (name === void 0) {
123255
- throw new TypeError();
123256
- }
123257
- const transaction = confirmActiveVersionchangeTransaction(this);
123258
- const store = this._rawDatabase.rawObjectStores.get(name);
123259
- if (store === void 0) {
123260
- throw new NotFoundError();
123261
- }
123262
- this.objectStoreNames = new FakeDOMStringList_default(...Array.from(this.objectStoreNames).filter((objectStoreName) => {
123263
- return objectStoreName !== name;
123264
- }));
123265
- transaction.objectStoreNames = new FakeDOMStringList_default(...this.objectStoreNames);
123266
- const objectStore = transaction._objectStoresCache.get(name);
123267
- let prevIndexNames;
123268
- if (objectStore) {
123269
- prevIndexNames = [...objectStore.indexNames];
123270
- objectStore.indexNames = new FakeDOMStringList_default();
123271
- }
123272
- transaction._rollbackLog.push(() => {
123273
- store.deleted = false;
123274
- this._rawDatabase.rawObjectStores.set(store.name, store);
123275
- this.objectStoreNames._push(store.name);
123276
- transaction.objectStoreNames._push(store.name);
123277
- this.objectStoreNames._sort();
123278
- if (objectStore && prevIndexNames) {
123279
- objectStore.indexNames = new FakeDOMStringList_default(...prevIndexNames);
123280
- }
123281
- });
123282
- store.deleted = true;
123283
- this._rawDatabase.rawObjectStores.delete(name);
123284
- transaction._objectStoresCache.delete(name);
123285
- }
123286
- transaction(storeNames, mode, options) {
123287
- mode = mode !== void 0 ? mode : "readonly";
123288
- if (mode !== "readonly" && mode !== "readwrite" && mode !== "versionchange") {
123289
- throw new TypeError("Invalid mode: " + mode);
123290
- }
123291
- const hasActiveVersionchange = this._rawDatabase.transactions.some((transaction) => {
123292
- return transaction._state === "active" && transaction.mode === "versionchange" && transaction.db === this;
123293
- });
123294
- if (hasActiveVersionchange) {
123295
- throw new InvalidStateError();
123296
- }
123297
- if (this._closePending) {
123298
- throw new InvalidStateError();
123299
- }
123300
- if (!Array.isArray(storeNames)) {
123301
- storeNames = [storeNames];
123302
- }
123303
- if (storeNames.length === 0 && mode !== "versionchange") {
123304
- throw new InvalidAccessError();
123305
- }
123306
- for (const storeName of storeNames) {
123307
- if (!this.objectStoreNames.contains(storeName)) {
123308
- throw new NotFoundError("No objectStore named " + storeName + " in this database");
123309
- }
123310
- }
123311
- const durability = options?.durability ?? "default";
123312
- if (durability !== "default" && durability !== "strict" && durability !== "relaxed") {
123313
- throw new TypeError(
123314
- // based on Firefox's error message
123315
- `'${durability}' (value of 'durability' member of IDBTransactionOptions) is not a valid value for enumeration IDBTransactionDurability`
123316
- );
123317
- }
123318
- const tx = new FDBTransaction_default(storeNames, mode, durability, this);
123319
- this._rawDatabase.transactions.push(tx);
123320
- this._rawDatabase.processTransactions();
123321
- return tx;
123322
- }
123323
- close() {
123324
- closeConnection_default(this);
123325
- }
123326
- get [Symbol.toStringTag]() {
123327
- return "IDBDatabase";
123328
- }
123329
- };
123330
- var FDBDatabase_default = FDBDatabase;
123331
-
123332
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/FDBOpenDBRequest.js
123333
- var FDBOpenDBRequest = class extends FDBRequest_default {
123334
- onupgradeneeded = null;
123335
- onblocked = null;
123336
- get [Symbol.toStringTag]() {
123337
- return "IDBOpenDBRequest";
123338
- }
123339
- };
123340
- var FDBOpenDBRequest_default = FDBOpenDBRequest;
123341
-
123342
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/FDBVersionChangeEvent.js
123343
- var FDBVersionChangeEvent = class extends FakeEvent_default {
123344
- constructor(type, parameters = {}) {
123345
- super(type);
123346
- this.newVersion = parameters.newVersion !== void 0 ? parameters.newVersion : null;
123347
- this.oldVersion = parameters.oldVersion !== void 0 ? parameters.oldVersion : 0;
123348
- }
123349
- get [Symbol.toStringTag]() {
123350
- return "IDBVersionChangeEvent";
123351
- }
123352
- };
123353
- var FDBVersionChangeEvent_default = FDBVersionChangeEvent;
123354
-
123355
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/intersection.js
123356
- function intersection(set1, set22) {
123357
- if ("intersection" in set1) {
123358
- return set1.intersection(set22);
123359
- }
123360
- return new Set([...set1].filter((item) => set22.has(item)));
123361
- }
123362
-
123363
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/Database.js
123364
- var Database = class {
123365
- transactions = [];
123366
- rawObjectStores = /* @__PURE__ */ new Map();
123367
- connections = [];
123368
- constructor(name, version3) {
123369
- this.name = name;
123370
- this.version = version3;
123371
- this.processTransactions = this.processTransactions.bind(this);
123372
- }
123373
- processTransactions() {
123374
- queueTask(() => {
123375
- const running3 = this.transactions.filter((transaction) => transaction._started && transaction._state !== "finished");
123376
- const waiting = this.transactions.filter((transaction) => !transaction._started && transaction._state !== "finished");
123377
- const next4 = waiting.find((transaction, i) => {
123378
- const anyRunning = running3.some((other) => !(transaction.mode === "readonly" && other.mode === "readonly") && intersection(other._scope, transaction._scope).size > 0);
123379
- if (anyRunning) {
123380
- return false;
123381
- }
123382
- const anyWaiting = waiting.slice(0, i).some((other) => intersection(other._scope, transaction._scope).size > 0);
123383
- return !anyWaiting;
123384
- });
123385
- if (next4) {
123386
- next4.addEventListener("complete", this.processTransactions);
123387
- next4.addEventListener("abort", this.processTransactions);
123388
- next4._start();
123389
- }
123390
- });
123391
- }
123392
- };
123393
- var Database_default = Database;
123394
-
123395
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/lib/validateRequiredArguments.js
123396
- function validateRequiredArguments(numArguments, expectedNumArguments, methodName) {
123397
- if (numArguments < expectedNumArguments) {
123398
- throw new TypeError(`${methodName}: At least ${expectedNumArguments} ${expectedNumArguments === 1 ? "argument" : "arguments"} required, but only ${arguments.length} passed`);
123399
- }
123400
- }
123401
-
123402
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/FDBFactory.js
123403
- var runTaskInConnectionQueue = (connectionQueues, name, task2) => {
123404
- const queue = connectionQueues.get(name) ?? Promise.resolve();
123405
- connectionQueues.set(name, queue.then(task2));
123406
- };
123407
- var waitForOthersClosedDelete = (databases, name, openDatabases, cb) => {
123408
- const anyOpen = openDatabases.some((openDatabase2) => {
123409
- return !openDatabase2._closed && !openDatabase2._closePending;
123410
- });
123411
- if (anyOpen) {
123412
- queueTask(() => waitForOthersClosedDelete(databases, name, openDatabases, cb));
123413
- return;
123414
- }
123415
- databases.delete(name);
123416
- cb(null);
123417
- };
123418
- var deleteDatabase = (databases, connectionQueues, name, request2, cb) => {
123419
- const deleteDBTask = () => {
123420
- return new Promise((resolve2) => {
123421
- const db = databases.get(name);
123422
- const oldVersion = db !== void 0 ? db.version : 0;
123423
- const onComplete = (err) => {
123424
- try {
123425
- if (err) {
123426
- cb(err);
123427
- } else {
123428
- cb(null, oldVersion);
123429
- }
123430
- } finally {
123431
- resolve2();
123432
- }
123433
- };
123434
- try {
123435
- const db2 = databases.get(name);
123436
- if (db2 === void 0) {
123437
- onComplete(null);
123438
- return;
123439
- }
123440
- const openConnections = db2.connections.filter((connection) => {
123441
- return !connection._closed;
123442
- });
123443
- for (const openDatabase2 of openConnections) {
123444
- if (!openDatabase2._closePending) {
123445
- queueTask(() => {
123446
- const event = new FDBVersionChangeEvent_default("versionchange", {
123447
- newVersion: null,
123448
- oldVersion: db2.version
123449
- });
123450
- openDatabase2.dispatchEvent(event);
123451
- });
123452
- }
123453
- }
123454
- queueTask(() => {
123455
- const anyOpen = openConnections.some((openDatabase3) => {
123456
- return !openDatabase3._closed && !openDatabase3._closePending;
123457
- });
123458
- if (anyOpen) {
123459
- queueTask(() => {
123460
- const event = new FDBVersionChangeEvent_default("blocked", {
123461
- newVersion: null,
123462
- oldVersion: db2.version
123463
- });
123464
- request2.dispatchEvent(event);
123465
- });
123466
- }
123467
- waitForOthersClosedDelete(databases, name, openConnections, onComplete);
123468
- });
123469
- } catch (err) {
123470
- onComplete(err);
123471
- }
123472
- });
123473
- };
123474
- runTaskInConnectionQueue(connectionQueues, name, deleteDBTask);
123475
- };
123476
- var runVersionchangeTransaction = (connection, version3, request2, cb) => {
123477
- connection._runningVersionchangeTransaction = true;
123478
- const oldVersion = connection._oldVersion = connection.version;
123479
- const openConnections = connection._rawDatabase.connections.filter((otherDatabase) => {
123480
- return connection !== otherDatabase;
123481
- });
123482
- for (const openDatabase2 of openConnections) {
123483
- if (!openDatabase2._closed && !openDatabase2._closePending) {
123484
- queueTask(() => {
123485
- const event = new FDBVersionChangeEvent_default("versionchange", {
123486
- newVersion: version3,
123487
- oldVersion
123488
- });
123489
- openDatabase2.dispatchEvent(event);
123490
- });
123491
- }
123492
- }
123493
- queueTask(() => {
123494
- const anyOpen = openConnections.some((openDatabase3) => {
123495
- return !openDatabase3._closed && !openDatabase3._closePending;
123496
- });
123497
- if (anyOpen) {
123498
- queueTask(() => {
123499
- const event = new FDBVersionChangeEvent_default("blocked", {
123500
- newVersion: version3,
123501
- oldVersion
123502
- });
123503
- request2.dispatchEvent(event);
123504
- });
123505
- }
123506
- const waitForOthersClosed = () => {
123507
- const anyOpen2 = openConnections.some((openDatabase2) => {
123508
- return !openDatabase2._closed && !openDatabase2._closePending;
123509
- });
123510
- if (anyOpen2) {
123511
- queueTask(waitForOthersClosed);
123512
- return;
123513
- }
123514
- connection._rawDatabase.version = version3;
123515
- connection.version = version3;
123516
- const transaction = connection.transaction(Array.from(connection.objectStoreNames), "versionchange");
123517
- transaction._openRequest = request2;
123518
- request2.result = connection;
123519
- request2.readyState = "done";
123520
- request2.transaction = transaction;
123521
- transaction._rollbackLog.push(() => {
123522
- connection._rawDatabase.version = oldVersion;
123523
- connection.version = oldVersion;
123524
- });
123525
- transaction._state = "active";
123526
- const event = new FDBVersionChangeEvent_default("upgradeneeded", {
123527
- newVersion: version3,
123528
- oldVersion
123529
- });
123530
- let didThrow = false;
123531
- try {
123532
- request2.dispatchEvent(event);
123533
- } catch (_err) {
123534
- didThrow = true;
123535
- }
123536
- const concludeUpgrade = () => {
123537
- if (transaction._state === "active") {
123538
- transaction._state = "inactive";
123539
- if (didThrow) {
123540
- transaction._abort("AbortError");
123541
- }
123542
- }
123543
- };
123544
- if (didThrow) {
123545
- concludeUpgrade();
123546
- } else {
123547
- queueTask(concludeUpgrade);
123548
- }
123549
- transaction._prioritizedListeners.set("error", () => {
123550
- connection._runningVersionchangeTransaction = false;
123551
- connection._oldVersion = void 0;
123552
- });
123553
- transaction._prioritizedListeners.set("abort", () => {
123554
- connection._runningVersionchangeTransaction = false;
123555
- connection._oldVersion = void 0;
123556
- queueTask(() => {
123557
- request2.transaction = null;
123558
- cb(new AbortError());
123559
- });
123560
- });
123561
- transaction._prioritizedListeners.set("complete", () => {
123562
- connection._runningVersionchangeTransaction = false;
123563
- connection._oldVersion = void 0;
123564
- queueTask(() => {
123565
- request2.transaction = null;
123566
- if (connection._closePending) {
123567
- cb(new AbortError());
123568
- } else {
123569
- cb(null);
123570
- }
123571
- });
123572
- });
123573
- };
123574
- waitForOthersClosed();
123575
- });
123576
- };
123577
- var openDatabase = (databases, connectionQueues, name, version3, request2, cb) => {
123578
- const openDBTask = () => {
123579
- return new Promise((resolve2) => {
123580
- const onComplete = (err) => {
123581
- try {
123582
- if (err) {
123583
- cb(err);
123584
- } else {
123585
- cb(null, connection);
123586
- }
123587
- } finally {
123588
- resolve2();
123589
- }
123590
- };
123591
- let db = databases.get(name);
123592
- if (db === void 0) {
123593
- db = new Database_default(name, 0);
123594
- databases.set(name, db);
123595
- }
123596
- if (version3 === void 0) {
123597
- version3 = db.version !== 0 ? db.version : 1;
123598
- }
123599
- if (db.version > version3) {
123600
- return onComplete(new VersionError());
123601
- }
123602
- const connection = new FDBDatabase_default(db);
123603
- if (db.version < version3) {
123604
- runVersionchangeTransaction(connection, version3, request2, (err) => {
123605
- onComplete(err);
123606
- });
123607
- } else {
123608
- onComplete(null);
123609
- }
123610
- });
123611
- };
123612
- runTaskInConnectionQueue(connectionQueues, name, openDBTask);
123613
- };
123614
- var FDBFactory = class {
123615
- _databases = /* @__PURE__ */ new Map();
123616
- // https://w3c.github.io/IndexedDB/#connection-queue
123617
- _connectionQueues = /* @__PURE__ */ new Map();
123618
- // promise chain as lightweight FIFO task queue
123619
- // https://w3c.github.io/IndexedDB/#dom-idbfactory-cmp
123620
- cmp(first2, second) {
123621
- validateRequiredArguments(arguments.length, 2, "IDBFactory.cmp");
123622
- return cmp_default(first2, second);
123623
- }
123624
- // https://w3c.github.io/IndexedDB/#dom-idbfactory-deletedatabase
123625
- deleteDatabase(name) {
123626
- validateRequiredArguments(arguments.length, 1, "IDBFactory.deleteDatabase");
123627
- const request2 = new FDBOpenDBRequest_default();
123628
- request2.source = null;
123629
- queueTask(() => {
123630
- deleteDatabase(this._databases, this._connectionQueues, name, request2, (err, oldVersion) => {
123631
- if (err) {
123632
- request2.error = new DOMException(err.message, err.name);
123633
- request2.readyState = "done";
123634
- const event = new FakeEvent_default("error", {
123635
- bubbles: true,
123636
- cancelable: true
123637
- });
123638
- event.eventPath = [];
123639
- request2.dispatchEvent(event);
123640
- return;
123641
- }
123642
- request2.result = void 0;
123643
- request2.readyState = "done";
123644
- const event2 = new FDBVersionChangeEvent_default("success", {
123645
- newVersion: null,
123646
- oldVersion
123647
- });
123648
- request2.dispatchEvent(event2);
123649
- });
123650
- });
123651
- return request2;
123652
- }
123653
- // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#widl-IDBFactory-open-IDBOpenDBRequest-DOMString-name-unsigned-long-long-version
123654
- open(name, version3) {
123655
- validateRequiredArguments(arguments.length, 1, "IDBFactory.open");
123656
- if (arguments.length > 1 && version3 !== void 0) {
123657
- version3 = enforceRange_default(version3, "MAX_SAFE_INTEGER");
123658
- }
123659
- if (version3 === 0) {
123660
- throw new TypeError("Database version cannot be 0");
123661
- }
123662
- const request2 = new FDBOpenDBRequest_default();
123663
- request2.source = null;
123664
- queueTask(() => {
123665
- openDatabase(this._databases, this._connectionQueues, name, version3, request2, (err, connection) => {
123666
- if (err) {
123667
- request2.result = void 0;
123668
- request2.readyState = "done";
123669
- request2.error = new DOMException(err.message, err.name);
123670
- const event = new FakeEvent_default("error", {
123671
- bubbles: true,
123672
- cancelable: true
123673
- });
123674
- event.eventPath = [];
123675
- request2.dispatchEvent(event);
123676
- return;
123677
- }
123678
- request2.result = connection;
123679
- request2.readyState = "done";
123680
- const event2 = new FakeEvent_default("success");
123681
- event2.eventPath = [];
123682
- request2.dispatchEvent(event2);
123683
- });
123684
- });
123685
- return request2;
123686
- }
123687
- // https://w3c.github.io/IndexedDB/#dom-idbfactory-databases
123688
- databases() {
123689
- return Promise.resolve(Array.from(this._databases.entries(), ([name, database]) => {
123690
- const activeVersionChangeConnection = database.connections.find((connection) => connection._runningVersionchangeTransaction);
123691
- const version3 = activeVersionChangeConnection ? activeVersionChangeConnection._oldVersion : database.version;
123692
- return {
123693
- name,
123694
- version: version3
123695
- };
123696
- }).filter(({
123697
- version: version3
123698
- }) => {
123699
- return version3 > 0;
123700
- }));
123701
- }
123702
- get [Symbol.toStringTag]() {
123703
- return "IDBFactory";
123704
- }
123705
- };
123706
- var FDBFactory_default = FDBFactory;
123707
-
123708
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/fakeIndexedDB.js
123709
- var fakeIndexedDB = new FDBFactory_default();
123710
- var fakeIndexedDB_default = fakeIndexedDB;
123711
-
123712
- // node_modules/.pnpm/fake-indexeddb@6.2.5/node_modules/fake-indexeddb/build/esm/index.js
123713
- var esm_default = fakeIndexedDB_default;
123714
-
123715
- // src/polyfills.ts
123716
- Object.defineProperty(globalThis, "indexedDB", {
123717
- value: esm_default,
123718
- writable: true,
123719
- configurable: true
123720
- });
123721
- var mockWindow = {
123722
- addEventListener: () => {
123723
- },
123724
- removeEventListener: () => {
123725
- },
123726
- location: { href: "" },
123727
- document: {}
123728
- };
123729
- Object.defineProperty(globalThis, "window", {
123730
- value: mockWindow,
123731
- writable: true,
123732
- configurable: true
123733
- });
123734
- if (typeof globalThis.navigator === "undefined") {
123735
- Object.defineProperty(globalThis, "navigator", {
123736
- value: { userAgent: "node" },
123737
- writable: true,
123738
- configurable: true
123739
- });
123740
- }
123741
-
123742
120456
  // node_modules/.pnpm/effect@3.19.19/node_modules/effect/dist/esm/Cause.js
123743
120457
  var Cause_exports = {};
123744
120458
  __export(Cause_exports, {
@@ -125447,7 +122161,7 @@ var intersectionWith = (isEquivalent) => {
125447
122161
  return fromIterable2(self).filter((a) => has9(bs, a));
125448
122162
  });
125449
122163
  };
125450
- var intersection2 = /* @__PURE__ */ intersectionWith(_equivalence2);
122164
+ var intersection = /* @__PURE__ */ intersectionWith(_equivalence2);
125451
122165
  var differenceWith = (isEquivalent) => {
125452
122166
  const has9 = containsWith2(isEquivalent);
125453
122167
  return dual(2, (self, that) => {
@@ -125625,7 +122339,7 @@ __export(Chunk_exports, {
125625
122339
  getEquivalence: () => getEquivalence4,
125626
122340
  head: () => head2,
125627
122341
  headNonEmpty: () => headNonEmpty2,
125628
- intersection: () => intersection3,
122342
+ intersection: () => intersection2,
125629
122343
  isChunk: () => isChunk,
125630
122344
  isEmpty: () => isEmpty,
125631
122345
  isNonEmpty: () => isNonEmpty,
@@ -126086,7 +122800,7 @@ var chunksOf = /* @__PURE__ */ dual(2, (self, n) => {
126086
122800
  }
126087
122801
  return unsafeFromArray(gr);
126088
122802
  });
126089
- var intersection3 = /* @__PURE__ */ dual(2, (self, that) => unsafeFromArray(intersection2(toReadonlyArray(self), toReadonlyArray(that))));
122803
+ var intersection2 = /* @__PURE__ */ dual(2, (self, that) => unsafeFromArray(intersection(toReadonlyArray(self), toReadonlyArray(that))));
126090
122804
  var isEmpty = (self) => self.length === 0;
126091
122805
  var isNonEmpty = (self) => self.length > 0;
126092
122806
  var head2 = /* @__PURE__ */ get2(0);
@@ -129883,8 +126597,8 @@ var currentMaxOpsBeforeYield = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbo
129883
126597
  var currentLogAnnotations = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/FiberRef/currentLogAnnotation"), () => fiberRefUnsafeMake(empty9()));
129884
126598
  var currentLogLevel = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/FiberRef/currentLogLevel"), () => fiberRefUnsafeMake(logLevelInfo));
129885
126599
  var currentLogSpan = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/FiberRef/currentLogSpan"), () => fiberRefUnsafeMake(empty10()));
129886
- var withSchedulingPriority = /* @__PURE__ */ dual(2, (self, scheduler3) => fiberRefLocally(self, currentSchedulingPriority, scheduler3));
129887
- var withMaxOpsBeforeYield = /* @__PURE__ */ dual(2, (self, scheduler3) => fiberRefLocally(self, currentMaxOpsBeforeYield, scheduler3));
126600
+ var withSchedulingPriority = /* @__PURE__ */ dual(2, (self, scheduler2) => fiberRefLocally(self, currentSchedulingPriority, scheduler2));
126601
+ var withMaxOpsBeforeYield = /* @__PURE__ */ dual(2, (self, scheduler2) => fiberRefLocally(self, currentMaxOpsBeforeYield, scheduler2));
129888
126602
  var currentConcurrency = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/FiberRef/currentConcurrency"), () => fiberRefUnsafeMake("unbounded"));
129889
126603
  var currentRequestBatching = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/FiberRef/currentRequestBatching"), () => fiberRefUnsafeMake(true));
129890
126604
  var currentUnhandledErrorLogLevel = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/FiberRef/currentUnhandledErrorLogLevel"), () => fiberRefUnsafeMake(some2(logLevelDebug)));
@@ -133018,7 +129732,7 @@ var SyncScheduler = class {
133018
129732
  }
133019
129733
  };
133020
129734
  var currentScheduler = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/FiberRef/currentScheduler"), () => fiberRefUnsafeMake(defaultScheduler));
133021
- var withScheduler = /* @__PURE__ */ dual(2, (self, scheduler3) => fiberRefLocally(self, currentScheduler, scheduler3));
129735
+ var withScheduler = /* @__PURE__ */ dual(2, (self, scheduler2) => fiberRefLocally(self, currentScheduler, scheduler2));
133022
129736
 
133023
129737
  // node_modules/.pnpm/effect@3.19.19/node_modules/effect/dist/esm/internal/completedRequestMap.js
133024
129738
  var currentRequestMap = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/FiberRef/currentRequestMap"), () => fiberRefUnsafeMake(/* @__PURE__ */ new Map()));
@@ -133974,9 +130688,9 @@ var format3 = (quoteValue, whitespace) => ({
133974
130688
  let out = format7("timestamp", date7.toISOString());
133975
130689
  out += append4("level", logLevel3.label);
133976
130690
  out += append4("fiber", threadName(fiberId3));
133977
- const messages2 = ensure(message);
133978
- for (let i = 0; i < messages2.length; i++) {
133979
- out += append4("message", toStringUnknown(messages2[i], whitespace));
130691
+ const messages = ensure(message);
130692
+ for (let i = 0; i < messages.length; i++) {
130693
+ out += append4("message", toStringUnknown(messages[i], whitespace));
133980
130694
  }
133981
130695
  if (!isEmptyType(cause3)) {
133982
130696
  out += append4("cause", pretty(cause3, {
@@ -135485,10 +132199,10 @@ var fromIterable10 = /* @__PURE__ */ dual(2, (entries2, ord) => {
135485
132199
  return tree;
135486
132200
  });
135487
132201
  var findFirst6 = /* @__PURE__ */ dual(2, (self, key) => {
135488
- const cmp2 = self._ord;
132202
+ const cmp = self._ord;
135489
132203
  let node = self._root;
135490
132204
  while (node !== void 0) {
135491
- const d = cmp2(key, node.key);
132205
+ const d = cmp(key, node.key);
135492
132206
  if (equals(key, node.key)) {
135493
132207
  return some2(node.value);
135494
132208
  }
@@ -135502,12 +132216,12 @@ var findFirst6 = /* @__PURE__ */ dual(2, (self, key) => {
135502
132216
  });
135503
132217
  var has6 = /* @__PURE__ */ dual(2, (self, key) => isSome2(findFirst6(self, key)));
135504
132218
  var insert = /* @__PURE__ */ dual(3, (self, key, value3) => {
135505
- const cmp2 = self._ord;
132219
+ const cmp = self._ord;
135506
132220
  let n = self._root;
135507
132221
  const n_stack = [];
135508
132222
  const d_stack = [];
135509
132223
  while (n != null) {
135510
- const d = cmp2(key, n.key);
132224
+ const d = cmp(key, n.key);
135511
132225
  n_stack.push(n);
135512
132226
  d_stack.push(d);
135513
132227
  if (d <= 0) {
@@ -135708,11 +132422,11 @@ var removeFirst = /* @__PURE__ */ dual(2, (self, key) => {
135708
132422
  return self;
135709
132423
  }
135710
132424
  const ord = self._ord;
135711
- const cmp2 = ord;
132425
+ const cmp = ord;
135712
132426
  let node = self._root;
135713
132427
  const stack = [];
135714
132428
  while (node !== void 0) {
135715
- const d = cmp2(key, node.key);
132429
+ const d = cmp(key, node.key);
135716
132430
  stack.push(node);
135717
132431
  if (equals(key, node.key)) {
135718
132432
  node = void 0;
@@ -138894,11 +135608,11 @@ var unsafeRunSyncExit = /* @__PURE__ */ makeDual((runtime5, effect2) => {
138894
135608
  if (op) {
138895
135609
  return op;
138896
135610
  }
138897
- const scheduler3 = new SyncScheduler();
135611
+ const scheduler2 = new SyncScheduler();
138898
135612
  const fiberRuntime = unsafeFork3(runtime5)(effect2, {
138899
- scheduler: scheduler3
135613
+ scheduler: scheduler2
138900
135614
  });
138901
- scheduler3.flush();
135615
+ scheduler2.flush();
138902
135616
  const result = fiberRuntime.unsafePoll();
138903
135617
  if (result) {
138904
135618
  return result;
@@ -142410,7 +139124,7 @@ var setRandom = (random4) => scopedDiscard2(fiberRefLocallyScopedWith(currentSer
142410
139124
  var setRequestBatching = (requestBatching) => scopedDiscard2(fiberRefLocallyScoped(currentRequestBatching, requestBatching));
142411
139125
  var setRequestCaching = (requestCaching) => scopedDiscard2(fiberRefLocallyScoped(currentCacheEnabled, requestCaching));
142412
139126
  var setRequestCache = (cache) => scopedDiscard2(isEffect(cache) ? flatMap9(cache, (x) => fiberRefLocallyScoped(currentCache, x)) : fiberRefLocallyScoped(currentCache, cache));
142413
- var setScheduler = (scheduler3) => scopedDiscard2(fiberRefLocallyScoped(currentScheduler, scheduler3));
139127
+ var setScheduler = (scheduler2) => scopedDiscard2(fiberRefLocallyScoped(currentScheduler, scheduler2));
142414
139128
  var span3 = span2;
142415
139129
  var setTracer2 = setTracer;
142416
139130
  var setTracerEnabled = (enabled2) => scopedDiscard2(fiberRefLocallyScoped(currentTracerEnabled, enabled2));
@@ -148266,7 +144980,7 @@ var getPropertyKeys = (ast) => {
148266
144980
  case "TypeLiteral":
148267
144981
  return ast.propertySignatures.map((ps) => ps.name);
148268
144982
  case "Union":
148269
- return ast.types.slice(1).reduce((out, ast2) => intersection2(out, getPropertyKeys(ast2)), getPropertyKeys(ast.types[0]));
144983
+ return ast.types.slice(1).reduce((out, ast2) => intersection(out, getPropertyKeys(ast2)), getPropertyKeys(ast.types[0]));
148270
144984
  case "Suspend":
148271
144985
  return getPropertyKeys(ast.f());
148272
144986
  case "Refinement":
@@ -148661,7 +145375,7 @@ var equalsTemplateLiteralSpan = /* @__PURE__ */ getEquivalence3((self, that) =>
148661
145375
  });
148662
145376
  var equalsEnums = /* @__PURE__ */ getEquivalence3((self, that) => that[0] === self[0] && that[1] === self[1]);
148663
145377
  var equalsUnion = /* @__PURE__ */ getEquivalence3(equals5);
148664
- var intersection5 = /* @__PURE__ */ intersectionWith(equals5);
145378
+ var intersection4 = /* @__PURE__ */ intersectionWith(equals5);
148665
145379
  var _keyof = (ast) => {
148666
145380
  switch (ast._tag) {
148667
145381
  case "Declaration": {
@@ -148676,7 +145390,7 @@ var _keyof = (ast) => {
148676
145390
  case "Suspend":
148677
145391
  return _keyof(ast.f());
148678
145392
  case "Union":
148679
- return ast.types.slice(1).reduce((out, ast2) => intersection5(out, _keyof(ast2)), _keyof(ast.types[0]));
145393
+ return ast.types.slice(1).reduce((out, ast2) => intersection4(out, _keyof(ast2)), _keyof(ast.types[0]));
148680
145394
  case "Transformation":
148681
145395
  return _keyof(ast.to);
148682
145396
  }
@@ -149705,11 +146419,11 @@ var handleForbidden = (effect2, ast, actual, options) => {
149705
146419
  if (isEither3(effect2)) {
149706
146420
  return effect2;
149707
146421
  }
149708
- const scheduler3 = new SyncScheduler();
146422
+ const scheduler2 = new SyncScheduler();
149709
146423
  const fiber = runFork2(effect2, {
149710
- scheduler: scheduler3
146424
+ scheduler: scheduler2
149711
146425
  });
149712
- scheduler3.flush();
146426
+ scheduler2.flush();
149713
146427
  const exit4 = fiber.unsafePoll();
149714
146428
  if (exit4) {
149715
146429
  if (isSuccess2(exit4)) {
@@ -150035,16 +146749,16 @@ var standardSchemaV1 = (schema, overrideOptions) => {
150035
146749
  version: 1,
150036
146750
  vendor: "effect",
150037
146751
  validate(value3) {
150038
- const scheduler3 = new SyncScheduler();
146752
+ const scheduler2 = new SyncScheduler();
150039
146753
  const fiber = runFork2(matchEffect3(decodeUnknown4(value3, overrideOptions), {
150040
146754
  onFailure: makeStandardFailureFromParseIssue,
150041
146755
  onSuccess: (value4) => succeed7({
150042
146756
  value: value4
150043
146757
  })
150044
146758
  }), {
150045
- scheduler: scheduler3
146759
+ scheduler: scheduler2
150046
146760
  });
150047
- scheduler3.flush();
146761
+ scheduler2.flush();
150048
146762
  const exit4 = fiber.unsafePoll();
150049
146763
  if (exit4) {
150050
146764
  return makeStandardResult(exit4);
@@ -162228,7 +158942,7 @@ __export(schemas_exports2, {
162228
158942
  int: () => int2,
162229
158943
  int32: () => int32,
162230
158944
  int64: () => int64,
162231
- intersection: () => intersection6,
158945
+ intersection: () => intersection5,
162232
158946
  ipv4: () => ipv42,
162233
158947
  ipv6: () => ipv62,
162234
158948
  json: () => json2,
@@ -162470,7 +159184,7 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
162470
159184
  inst.nonoptional = (params) => nonoptional(inst, params);
162471
159185
  inst.array = () => array7(inst);
162472
159186
  inst.or = (arg) => union11([inst, arg]);
162473
- inst.and = (arg) => intersection6(inst, arg);
159187
+ inst.and = (arg) => intersection5(inst, arg);
162474
159188
  inst.transform = (tx) => pipe2(inst, transform3(tx));
162475
159189
  inst.default = (def2) => _default(inst, def2);
162476
159190
  inst.prefault = (def2) => prefault(inst, def2);
@@ -163011,7 +159725,7 @@ var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def
163011
159725
  ZodType.init(inst, def);
163012
159726
  inst._zod.processJSONSchema = (ctx, json3, params) => intersectionProcessor(inst, ctx, json3, params);
163013
159727
  });
163014
- function intersection6(left3, right3) {
159728
+ function intersection5(left3, right3) {
163015
159729
  return new ZodIntersection({
163016
159730
  type: "intersection",
163017
159731
  left: left3,
@@ -163728,7 +160442,7 @@ var ImplementationSchema = BaseMetadataSchema.extend({
163728
160442
  */
163729
160443
  description: string6().optional()
163730
160444
  });
163731
- var FormElicitationCapabilitySchema = intersection6(object2({
160445
+ var FormElicitationCapabilitySchema = intersection5(object2({
163732
160446
  applyDefaults: boolean5().optional()
163733
160447
  }), record3(string6(), unknown()));
163734
160448
  var ElicitationCapabilitySchema = preprocess((value3) => {
@@ -163738,7 +160452,7 @@ var ElicitationCapabilitySchema = preprocess((value3) => {
163738
160452
  }
163739
160453
  }
163740
160454
  return value3;
163741
- }, intersection6(object2({
160455
+ }, intersection5(object2({
163742
160456
  form: FormElicitationCapabilitySchema.optional(),
163743
160457
  url: AssertObjectSchema.optional()
163744
160458
  }), record3(string6(), unknown()).optional()));
@@ -165343,24 +162057,24 @@ data:
165343
162057
  return this.createJsonErrorResponse(400, -32700, "Parse error: Invalid JSON");
165344
162058
  }
165345
162059
  }
165346
- let messages2;
162060
+ let messages;
165347
162061
  try {
165348
162062
  if (Array.isArray(rawMessage)) {
165349
- messages2 = rawMessage.map((msg) => JSONRPCMessageSchema.parse(msg));
162063
+ messages = rawMessage.map((msg) => JSONRPCMessageSchema.parse(msg));
165350
162064
  } else {
165351
- messages2 = [JSONRPCMessageSchema.parse(rawMessage)];
162065
+ messages = [JSONRPCMessageSchema.parse(rawMessage)];
165352
162066
  }
165353
162067
  } catch {
165354
162068
  this.onerror?.(new Error("Parse error: Invalid JSON-RPC message"));
165355
162069
  return this.createJsonErrorResponse(400, -32700, "Parse error: Invalid JSON-RPC message");
165356
162070
  }
165357
- const isInitializationRequest = messages2.some(isInitializeRequest);
162071
+ const isInitializationRequest = messages.some(isInitializeRequest);
165358
162072
  if (isInitializationRequest) {
165359
162073
  if (this._initialized && this.sessionId !== void 0) {
165360
162074
  this.onerror?.(new Error("Invalid Request: Server already initialized"));
165361
162075
  return this.createJsonErrorResponse(400, -32600, "Invalid Request: Server already initialized");
165362
162076
  }
165363
- if (messages2.length > 1) {
162077
+ if (messages.length > 1) {
165364
162078
  this.onerror?.(new Error("Invalid Request: Only one initialization request is allowed"));
165365
162079
  return this.createJsonErrorResponse(400, -32600, "Invalid Request: Only one initialization request is allowed");
165366
162080
  }
@@ -165380,15 +162094,15 @@ data:
165380
162094
  return protocolError;
165381
162095
  }
165382
162096
  }
165383
- const hasRequests = messages2.some(isJSONRPCRequest);
162097
+ const hasRequests = messages.some(isJSONRPCRequest);
165384
162098
  if (!hasRequests) {
165385
- for (const message of messages2) {
162099
+ for (const message of messages) {
165386
162100
  this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo });
165387
162101
  }
165388
162102
  return new Response(null, { status: 202 });
165389
162103
  }
165390
162104
  const streamId = crypto.randomUUID();
165391
- const initRequest = messages2.find((m) => isInitializeRequest(m));
162105
+ const initRequest = messages.find((m) => isInitializeRequest(m));
165392
162106
  const clientProtocolVersion = initRequest ? initRequest.params.protocolVersion : req.headers.get("mcp-protocol-version") ?? DEFAULT_NEGOTIATED_PROTOCOL_VERSION;
165393
162107
  if (this._enableJsonResponse) {
165394
162108
  return new Promise((resolve2) => {
@@ -165398,12 +162112,12 @@ data:
165398
162112
  this._streamMapping.delete(streamId);
165399
162113
  }
165400
162114
  });
165401
- for (const message of messages2) {
162115
+ for (const message of messages) {
165402
162116
  if (isJSONRPCRequest(message)) {
165403
162117
  this._requestToStreamMapping.set(message.id, streamId);
165404
162118
  }
165405
162119
  }
165406
- for (const message of messages2) {
162120
+ for (const message of messages) {
165407
162121
  this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo });
165408
162122
  }
165409
162123
  });
@@ -165426,7 +162140,7 @@ data:
165426
162140
  if (this.sessionId !== void 0) {
165427
162141
  headers["mcp-session-id"] = this.sessionId;
165428
162142
  }
165429
- for (const message of messages2) {
162143
+ for (const message of messages) {
165430
162144
  if (isJSONRPCRequest(message)) {
165431
162145
  this._streamMapping.set(streamId, {
165432
162146
  controller: streamController,
@@ -165443,7 +162157,7 @@ data:
165443
162157
  }
165444
162158
  }
165445
162159
  await this.writePrimingEvent(streamController, encoder2, streamId, clientProtocolVersion);
165446
- for (const message of messages2) {
162160
+ for (const message of messages) {
165447
162161
  let closeSSEStream;
165448
162162
  let closeStandaloneSSEStream;
165449
162163
  if (isJSONRPCRequest(message) && this._eventStore && clientProtocolVersion >= "2025-11-25") {
@@ -170652,8 +167366,8 @@ var Protocol = class {
170652
167366
  */
170653
167367
  async _clearTaskQueue(taskId, sessionId) {
170654
167368
  if (this._taskMessageQueue) {
170655
- const messages2 = await this._taskMessageQueue.dequeueAll(taskId, sessionId);
170656
- for (const message of messages2) {
167369
+ const messages = await this._taskMessageQueue.dequeueAll(taskId, sessionId);
167370
+ for (const message of messages) {
170657
167371
  if (message.type === "request" && isJSONRPCRequest(message.message)) {
170658
167372
  const requestId = message.message.id;
170659
167373
  const resolver = this._requestResolvers.get(requestId);
@@ -175695,7 +172409,7 @@ var serverPopulatedCreateBy = "";
175695
172409
  var listActivity = (params) => Effect_exports.gen(function* () {
175696
172410
  const client = yield* HulyClient;
175697
172411
  const limit = clampLimit(params.limit);
175698
- const messages2 = yield* client.findAll(
172412
+ const messages = yield* client.findAll(
175699
172413
  activity.class.ActivityMessage,
175700
172414
  {
175701
172415
  attachedTo: toRef(params.objectId),
@@ -175708,7 +172422,7 @@ var listActivity = (params) => Effect_exports.gen(function* () {
175708
172422
  }
175709
172423
  }
175710
172424
  );
175711
- const result = messages2.map((msg) => ({
172425
+ const result = messages.map((msg) => ({
175712
172426
  id: ActivityMessageId.make(msg._id),
175713
172427
  objectId: msg.attachedTo,
175714
172428
  objectClass: ObjectClassName.make(msg.attachedToClass),
@@ -180821,7 +177535,7 @@ var deleteChannel = (params) => Effect_exports.gen(function* () {
180821
177535
  var listChannelMessages = (params) => Effect_exports.gen(function* () {
180822
177536
  const { channel, client } = yield* findChannel(params.channel);
180823
177537
  const limit = clampLimit(params.limit);
180824
- const messages2 = yield* client.findAll(
177538
+ const messages = yield* client.findAll(
180825
177539
  chunter.class.ChatMessage,
180826
177540
  {
180827
177541
  space: channel._id
@@ -180833,14 +177547,14 @@ var listChannelMessages = (params) => Effect_exports.gen(function* () {
180833
177547
  }
180834
177548
  }
180835
177549
  );
180836
- const total = messages2.total;
177550
+ const total = messages.total;
180837
177551
  const uniqueSocialIds = [
180838
177552
  ...new Set(
180839
- messages2.map((msg) => msg.modifiedBy)
177553
+ messages.map((msg) => msg.modifiedBy)
180840
177554
  )
180841
177555
  ];
180842
177556
  const socialIdToName = yield* buildSocialIdToPersonNameMap(client, uniqueSocialIds);
180843
- const summaries = messages2.map((msg) => {
177557
+ const summaries = messages.map((msg) => {
180844
177558
  const senderName = socialIdToName.get(msg.modifiedBy);
180845
177559
  return {
180846
177560
  id: MessageId.make(msg._id),
@@ -181198,7 +177912,7 @@ var listComments = (params) => Effect_exports.gen(function* () {
181198
177912
  issueIdentifier: params.issueIdentifier
181199
177913
  });
181200
177914
  const limit = clampLimit(params.limit);
181201
- const messages2 = yield* client.findAll(
177915
+ const messages = yield* client.findAll(
181202
177916
  chunter.class.ChatMessage,
181203
177917
  {
181204
177918
  attachedTo: issue2._id,
@@ -181212,7 +177926,7 @@ var listComments = (params) => Effect_exports.gen(function* () {
181212
177926
  }
181213
177927
  );
181214
177928
  const validated = yield* Schema_exports.decodeUnknown(Schema_exports.Array(CommentSchema))(
181215
- messages2.map((msg) => ({
177929
+ messages.map((msg) => ({
181216
177930
  id: msg._id,
181217
177931
  body: msg.message,
181218
177932
  authorId: msg.modifiedBy,